diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..abff88ccb --- /dev/null +++ b/.gitignore @@ -0,0 +1,90 @@ +venv/ +.env +.clang-format +.DS_Store +.tags +.ipynb_checkpoints +.idea +.overlay_init +.overlay_consistent +.sconsign.dblite +.vscode* +model2.png +a.out +.hypothesis + +*.dylib +*.DSYM +*.d +*.pyc +*.pyo +.*.swp +.*.swo +.*.un~ +*.tmp +*.o +*.o-* +*.os +*.os-* +*.so +*.a +*.clb +*.class +*.pyxbldc +*.vcd +config.json +clcache +compile_commands.json + +persist +board/obj/ +selfdrive/boardd/boardd +selfdrive/logcatd/logcatd +selfdrive/mapd/default_speeds_by_region.json +selfdrive/proclogd/proclogd +selfdrive/ui/_ui +selfdrive/ui/qt/flasher +selfdrive/car/modules/teslaEpasFlasher/flasher +selfdrive/car/modules/radarFlasher/flasher +selfdrive/panda/board/flasher +selfdrive/panda/board/pedal/flasher +selfdrive/test/longitudinal_maneuvers/out +selfdrive/visiond/visiond +selfdrive/loggerd/loggerd +selfdrive/loggerd/bootlog +selfdrive/sensord/_gpsd +selfdrive/sensord/_sensord +selfdrive/camerad/camerad +selfdrive/camerad/test/ae_gray_test +selfdrive/modeld/_modeld +selfdrive/modeld/_dmonitoringmodeld +/src/ + +one +openpilot +notebooks +xx +yy +hyperthneed +panda_jungle +provisioning + +.coverage* +coverage.xml +htmlcov +pandaextra + +.mypy_cache/ +flycheck_* + +cppcheck_report.txt +comma*.sh + +selfdrive/modeld/thneed/compile +models/*.thneed + +*.bz2 + +build/ + +!**/.gitkeep diff --git a/.overlay_init b/.overlay_init new file mode 100644 index 000000000..e69de29bb diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..7dafa9443 --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2018, Comma.ai, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100755 index 000000000..b012883d7 --- /dev/null +++ b/README.md @@ -0,0 +1,142 @@ +![](https://i.imgur.com/b0ZyIx5.jpg) + +Table of Contents +======================= + +* [What is openpilot?](#what-is-openpilot) +* [Running in a car](#running-in-a-car) +* [Running on PC](#running-on-pc) +* [Community and Contributing](#community-and-contributing) +* [User Data and comma Account](#user-data-and-comma-account) +* [Safety and Testing](#safety-and-testing) +* [Directory Structure](#directory-structure) +* [Licensing](#licensing) + +--- + +What is openpilot? +------ + +[openpilot](http://github.com/commaai/openpilot) is an open source driver assistance system. Currently, openpilot performs the functions of Adaptive Cruise Control (ACC), Automated Lane Centering (ALC), Forward Collision Warning (FCW) and Lane Departure Warning (LDW) for a growing variety of [supported car makes, models and model years](docs/CARS.md). In addition, while openpilot is engaged, a camera based Driver Monitoring (DM) feature alerts distracted and asleep drivers. See more about [the vehicle integration](docs/INTEGRATION.md) and [limitations](docs/LIMITATIONS.md). + + + + + + + + + + + + + + +
+ + +Running in a car +------ + +To use openpilot in a car, you need four things +* This software. It's free and available right here. +* One of [the 150+ supported cars](docs/CARS.md). We support Honda, Toyota, Hyundai, Nissan, Kia, Chrysler, Lexus, Acura, Audi, VW, and more. If your car is not supported, but has adaptive cruise control and lane keeping assist, it's likely able to run openpilot. +* A supported device to run this software. This can be a [comma two](https://comma.ai/shop/products/two), [comma three](https://comma.ai/shop/products/three), or if you like to experiment, a [Ubuntu computer with webcams](https://github.com/commaai/openpilot/tree/master/tools/webcam). +* A way to connect to your car. With a comma two or three, you need only a [car harness](https://comma.ai/shop/products/car-harness). With an EON Gold or PC, you also need a [black panda](https://comma.ai/shop/products/panda). + +We have detailed instructions for [how to install the device in a car](https://comma.ai/setup). + +Running on PC +------ + +All of openpilot's services can run as normal on a PC, even without special hardware or a car. To develop or experiment with openpilot you can run openpilot on recorded or simulated data. + +With openpilot's tools you can plot logs, replay drives and watch the full-res camera streams. See [the tools README](tools/README.md) for more information. + +You can also run openpilot in simulation [with the CARLA simulator](tools/sim/README.md). This allows openpilot to drive around a virtual car on your Ubuntu machine. The whole setup should only take a few minutes, but does require a decent GPU. + + +Community and Contributing +------ + +openpilot is developed by [comma](https://comma.ai/) and by users like you. We welcome both pull requests and issues on [GitHub](http://github.com/commaai/openpilot). Bug fixes and new car ports are encouraged. Check out [the contributing docs](docs/CONTRIBUTING.md). + +Documentation related to openpilot development can be found on [docs.comma.ai](https://docs.comma.ai). Information about running openpilot (e.g. FAQ, fingerprinting, troubleshooting, custom forks, community hardware) should go on the [wiki](https://github.com/commaai/openpilot/wiki). + +You can add support for your car by following guides we have written for [Brand](https://blog.comma.ai/how-to-write-a-car-port-for-openpilot/) and [Model](https://blog.comma.ai/openpilot-port-guide-for-toyota-models/) ports. Generally, a car with adaptive cruise control and lane keep assist is a good candidate. [Join our Discord](https://discord.comma.ai) to discuss car ports: most car makes have a dedicated channel. + +Want to get paid to work on openpilot? [comma is hiring](https://comma.ai/jobs/). + +And [follow us on Twitter](https://twitter.com/comma_ai). + +User Data and comma Account +------ + +By default, openpilot uploads the driving data to our servers. You can also access your data through [comma connect](https://connect.comma.ai/). We use your data to train better models and improve openpilot for everyone. + +openpilot is open source software: the user is free to disable data collection if they wish to do so. + +openpilot logs the road facing cameras, CAN, GPS, IMU, magnetometer, thermal sensors, crashes, and operating system logs. +The driver facing camera is only logged if you explicitly opt-in in settings. The microphone is not recorded. + +By using openpilot, you agree to [our Privacy Policy](https://comma.ai/privacy). You understand that use of this software or its related services will generate certain types of user data, which may be logged and stored at the sole discretion of comma. By accepting this agreement, you grant an irrevocable, perpetual, worldwide right to comma for the use of this data. + +Safety and Testing +---- + +* openpilot observes ISO26262 guidelines, see [SAFETY.md](docs/SAFETY.md) for more details. +* openpilot has software in the loop [tests](.github/workflows/selfdrive_tests.yaml) that run on every commit. +* The code enforcing the safety model lives in panda and is written in C, see [code rigor](https://github.com/commaai/panda#code-rigor) for more details. +* panda has software in the loop [safety tests](https://github.com/commaai/panda/tree/master/tests/safety). +* Internally, we have a hardware in the loop Jenkins test suite that builds and unit tests the various processes. +* panda has additional hardware in the loop [tests](https://github.com/commaai/panda/blob/master/Jenkinsfile). +* We run the latest openpilot in a testing closet containing 10 comma devices continuously replaying routes. + +Directory Structure +------ + . + ├── cereal # The messaging spec and libs used for all logs + ├── common # Library like functionality we've developed here + ├── docs # Documentation + ├── opendbc # Files showing how to interpret data from cars + ├── panda # Code used to communicate on CAN + ├── third_party # External libraries + ├── pyextra # Extra python packages + └── selfdrive # Code needed to drive the car + ├── assets # Fonts, images, and sounds for UI + ├── athena # Allows communication with the app + ├── boardd # Daemon to talk to the board + ├── camerad # Driver to capture images from the camera sensors + ├── car # Car specific code to read states and control actuators + ├── common # Shared C/C++ code for the daemons + ├── controls # Planning and controls + ├── debug # Tools to help you debug and do car ports + ├── locationd # Precise localization and vehicle parameter estimation + ├── logcatd # Android logcat as a service + ├── loggerd # Logger and uploader of car data + ├── modeld # Driving and monitoring model runners + ├── proclogd # Logs information from proc + ├── sensord # IMU interface code + ├── test # Unit tests, system tests, and a car simulator + └── ui # The UI + +Licensing +------ + +openpilot is released under the MIT license. Some parts of the software are released under other licenses as specified. + +Any user of this software shall indemnify and hold harmless Comma.ai, Inc. and its directors, officers, employees, agents, stockholders, affiliates, subcontractors and customers from and against all allegations, claims, actions, suits, demands, damages, liabilities, obligations, losses, settlements, judgments, costs and expenses (including without limitation attorneys’ fees and costs) which arise out of, relate to or result from any use of this software by user. + +**THIS IS ALPHA QUALITY SOFTWARE FOR RESEARCH PURPOSES ONLY. THIS IS NOT A PRODUCT. +YOU ARE RESPONSIBLE FOR COMPLYING WITH LOCAL LAWS AND REGULATIONS. +NO WARRANTY EXPRESSED OR IMPLIED.** + +--- + + + +[![openpilot tests](https://github.com/commaai/openpilot/workflows/openpilot%20tests/badge.svg?event=push)](https://github.com/commaai/openpilot/actions) +[![Total alerts](https://img.shields.io/lgtm/alerts/g/commaai/openpilot.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/commaai/openpilot/alerts/) +[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/commaai/openpilot.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/commaai/openpilot/context:python) +[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/commaai/openpilot.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/commaai/openpilot/context:cpp) +[![codecov](https://codecov.io/gh/commaai/openpilot/branch/master/graph/badge.svg)](https://codecov.io/gh/commaai/openpilot) diff --git a/RELEASES.md b/RELEASES.md new file mode 100644 index 000000000..8564975f4 --- /dev/null +++ b/RELEASES.md @@ -0,0 +1,794 @@ +Version 0.8.13 (2022-02-18) +======================== + * Improved driver monitoring + * Retuned driver pose learner for relaxed driving positions + * Added reliance on driving model to be more scene adaptive + * Matched strictness between comma two and comma three + * Improved performance in turns by compensating for the road bank angle + * Improved camera focus on the comma two + * AGNOS 4 + * ADB support + * improved cell auto configuration + * NEOS 19 + * package updates + * stability improvements + * Subaru ECU firmware fingerprinting thanks to martinl! + * Hyundai Santa Fe Plug-in Hybrid 2022 support thanks to sunnyhaibin! + * Mazda CX-5 2022 support thanks to Jafaral! + * Subaru Impreza 2020 support thanks to martinl! + * Toyota Avalon 2022 support thanks to sshane! + * Toyota Prius v 2017 support thanks to CT921! + * Volkswagen Caravelle 2020 support thanks to jyoung8607! + +Version 0.8.12 (2021-12-15) +======================== + * New driving model + * Improved behavior around exits + * Better pose accuracy at high speeds, allowing max speed of 90mph + * Fully incorporated comma three data into all parts of training stack + * Improved follow distance + * Better longitudinal policy, especially in low speed traffic + * New alert sounds + * AGNOS 3 + * Display burn in mitigation + * Improved audio amplifier configuration + * System reliability improvements + * Update Python to 3.8.10 + * Raw logs upload moved to connect.comma.ai + * Fixed HUD alerts on newer Honda Bosch thanks to csouers! + * Audi Q3 2020-21 support thanks to jyoung8607! + * Lexus RC 2020 support thanks to ErichMoraga! + +Version 0.8.11 (2021-11-29) +======================== + * Support for CAN FD on the red panda + * Support for an external panda on the comma three + * Navigation: Show more detailed instructions when approaching maneuver + * Fixed occasional steering faults on GM cars thanks to jyoung8607! + * Nissan ECU firmware fingerprinting thanks to robin-reckmann, martinl, and razem-io! + * Cadillac Escalade ESV 2016 support thanks to Gibby! + * Genesis G70 2020 support thanks to tecandrew! + * Hyundai Santa Fe Hybrid 2022 support thanks to sunnyhaibin! + * Mazda CX-9 2021 support thanks to Jacar! + * Volkswagen Polo 2020 support thanks to jyoung8607! + * Volkswagen T-Roc 2021 support thanks to jyoung8607! + +Version 0.8.10 (2021-11-01) +======================== + * New driving model + * Trained on one million minutes!!! + * Fixed lead training making lead predictions significantly more accurate + * Fixed several localizer dataset bugs and loss function bugs, overall improved accuracy + * New driver monitoring model + * Trained on latest data from both comma two and comma three + * Increased model field of view by 40% on comma three + * Improved model stability on masked users + * Improved pose prediction with reworked ground-truth stack + * Lateral and longitudinal planning MPCs now in ACADOS + * Combined longitudinal MPCs + * All longitudinal planning now happens in a single MPC system + * Fixed instability in MPC problem to prevent sporadic CPU usage + * AGNOS 2: minor stability improvements and builder repo open sourced + * tools: new and improved replay thanks to deanlee! + * Moved community-supported cars outside of the Community Features toggle + * Improved FW fingerprinting reliability for Hyundai/Kia/Genesis + * Added prerequisites for longitudinal control on Hyundai/Kia/Genesis and Honda Bosch + * Audi S3 2015 support thanks to jyoung8607! + * Honda Freed 2020 support thanks to belm0! + * Hyundai Ioniq Hybrid 2020-2022 support thanks to sunnyhaibin! + * Hyundai Santa Fe 2022 support thanks to sunnyhaibin! + * Kia K5 2021 support thanks to sunnyhaibin! + * Škoda Kamiq 2021 support thanks to jyoung8607! + * Škoda Karoq 2019 support thanks to jyoung8607! + * Volkswagen Arteon 2021 support thanks to jyoung8607! + * Volkswagen California 2021 support thanks to jyoung8607! + * Volkswagen Taos 2022 support thanks to jyoung8607! + +Version 0.8.9 (2021-09-14) +======================== + * Improved fan control on comma three + * AGNOS 1.5: improved stability + * Honda e 2020 support + +Version 0.8.8 (2021-08-27) +======================== + * New driving model with improved laneless performance + * Trained on 5000+ hours of diverse driving data from 3000+ users in 40+ countries + * Better anti-cheating methods during simulator training ensure the model hugs less when in laneless mode + * All new desire ground-truthing stack makes the model better at lane changes + * New driver monitoring model: improved performance on comma three + * NEOS 18 for comma two: update packages + * AGNOS 1.3 for comma three: fix display init at high temperatures + * Improved auto-exposure on comma three + * Improved longitudinal control on Honda Nidec cars + * Hyundai Kona Hybrid 2020 support thanks to haram-KONA! + * Hyundai Sonata Hybrid 2021 support thanks to Matt-Wash-Burn! + * Kia Niro Hybrid 2021 support thanks to tetious! + +Version 0.8.7 (2021-07-31) +======================== + * comma three support! + * Navigation alpha for the comma three! + * Volkswagen T-Cross 2021 support thanks to jyoung8607! + +Version 0.8.6 (2021-07-21) +======================== + * Revamp lateral and longitudinal planners + * Refactor planner output API to be more readable and verbose + * Planners now output desired trajectories for speed, acceleration, curvature, and curvature rate + * Use MPC for longitudinal planning when no lead car is present, makes accel and decel smoother + * Remove "CHECK DRIVER FACE VISIBILITY" warning + * Fixed cruise fault on some TSS2.5 Camrys and international Toyotas + * Hyundai Elantra Hybrid 2021 support thanks to tecandrew! + * Hyundai Ioniq PHEV 2020 support thanks to YawWashout! + * Kia Niro Hybrid 2019 support thanks to jyoung8607! + * Škoda Octavia RS 2016 support thanks to jyoung8607! + * Toyota Alphard 2020 support thanks to belm0! + * Volkswagen Golf SportWagen 2015 support thanks to jona96! + * Volkswagen Touran 2017 support thanks to jyoung8607! + +Version 0.8.5 (2021-06-11) +======================== + * NEOS update: improved reliability and stability with better voltage regulator configuration + * Smart model-based Forward Collision Warning + * CAN-based fingerprinting moved behind community features toggle + * Improved longitudinal control on Toyotas with a comma pedal + * Improved auto-brightness using road-facing camera + * Added "Software" settings page with updater controls + * Audi Q2 2018 support thanks to jyoung8607! + * Hyundai Elantra 2021 support thanks to CruiseBrantley! + * Lexus UX Hybrid 2019-2020 support thanks to brianhaugen2! + * Toyota Avalon Hybrid 2019 support thanks to jbates9011! + * SEAT Leon 2017 & 2020 support thanks to jyoung8607! + * Škoda Octavia 2015 & 2019 support thanks to jyoung8607! + +Version 0.8.4 (2021-05-17) +======================== + * Delay controls start until system is ready + * Fuzzy car identification, enabled with Community Features toggle + * Localizer optimized for increased precision and less CPU usage + * Retuned lateral control to be more aggressive when model is confident + * Toyota Mirai 2021 support + * Lexus NX 300 2020 support thanks to goesreallyfast! + * Volkswagen Atlas 2018-19 support thanks to jyoung8607! + +Version 0.8.3 (2021-04-01) +======================== + * New model + * Trained on new diverse dataset from 2000+ users from 30+ countries + * Trained with improved segnet from the comma-pencil community project + * 🥬 Dramatically improved end-to-end lateral performance 🥬 + * Toggle added to disable the use of lanelines + * NEOS update: update packages and support for new UI + * New offroad UI based on Qt + * Default SSH key only used for setup + * Kia Ceed 2019 support thanks to ZanZaD13! + * Kia Seltos 2021 support thanks to speedking456! + * Added support for many Volkswagen and Škoda models thanks to jyoung8607! + +Version 0.8.2 (2021-02-26) +======================== + * Use model points directly in MPC (no more polyfits), making lateral planning more accurate + * Use model heading prediction for smoother lateral control + * Smarter actuator delay compensation + * Improve qcamera resolution for improved video in explorer and connect + * Adjust maximum engagement speed to better fit the model's training distribution + * New driver monitoring model trained with 3x more diverse data + * Improved face detection with masks + * More predictable DM alerts when visibility is bad + * Rewritten video streaming between openpilot processes + * Improved longitudinal tuning on TSS2 Corolla and Rav4 thanks to briskspirit! + * Audi A3 2015 and 2017 support thanks to keeleysam! + * Nissan Altima 2020 support thanks to avolmensky! + * Lexus ES Hybrid 2018 support thanks to TheInventorMan! + * Toyota Camry Hybrid 2021 support thanks to alancyau! + +Version 0.8.1 (2020-12-21) +======================== + * Original EON is deprecated, upgrade to comma two + * Better model performance in heavy rain + * Better lane positioning in turns + * Fixed bug where model would cut turns on empty roads at night + * Fixed issue where some Toyotas would not completely stop thanks to briskspirit! + * Toyota Camry 2021 with TSS2.5 support + * Hyundai Ioniq Electric 2020 support thanks to baldwalker! + +Version 0.8.0 (2020-11-30) +======================== + * New driving model: fully 3D and improved cut-in detection + * UI draws 2 road edges, 4 lanelines and paths in 3D + * Major fixes to cut-in detection for openpilot longitudinal + * Grey panda is no longer supported, upgrade to comma two or black panda + * Lexus NX 2018 support thanks to matt12eagles! + * Kia Niro EV 2020 support thanks to nickn17! + * Toyota Prius 2021 support thanks to rav4kumar! + * Improved lane positioning with uncertain lanelines, wide lanes and exits + * Improved lateral control for Prius and Subaru + +Version 0.7.10 (2020-10-29) +======================== + * Grey panda is deprecated, upgrade to comma two or black panda + * NEOS update: update to Python 3.8.2 and lower CPU frequency + * Improved thermals due to reduced CPU frequency + * Update SNPE to 1.41.0 + * Reduced offroad power consumption + * Various system stability improvements + * Acura RDX 2020 support thanks to csouers! + +Version 0.7.9 (2020-10-09) +======================== + * Improved car battery power management + * Improved updater robustness + * Improved realtime performance + * Reduced UI and modeld lags + * Increased torque on 2020 Hyundai Sonata and Palisade + +Version 0.7.8 (2020-08-19) +======================== + * New driver monitoring model: improved face detection and better compatibility with sunglasses + * Download NEOS operating system updates in the background + * Improved updater reliability and responsiveness + * Hyundai Kona 2020, Veloster 2019, and Genesis G70 2018 support thanks to xps-genesis! + +Version 0.7.7 (2020-07-20) +======================== + * White panda is no longer supported, upgrade to comma two or black panda + * Improved vehicle model estimation using high precision localizer + * Improved thermal management on comma two + * Improved autofocus for road-facing camera + * Improved noise performance for driver-facing camera + * Block lane change start using blindspot monitor on select Toyota, Hyundai, and Subaru + * Fix GM ignition detection + * Code cleanup and smaller release sizes + * Hyundai Sonata 2020 promoted to officially supported car + * Hyundai Ioniq Electric Limited 2019 and Ioniq SE 2020 support thanks to baldwalker! + * Subaru Forester 2019 and Ascent 2019 support thanks to martinl! + +Version 0.7.6.1 (2020-06-16) +======================== + * Hotfix: update kernel on some comma twos (orders #8570-#8680) + +Version 0.7.6 (2020-06-05) +======================== + * White panda is deprecated, upgrade to comma two or black panda + * 2017 Nissan X-Trail, 2018-19 Leaf and 2019 Rogue support thanks to avolmensky! + * 2017 Mazda CX-5 support in dashcam mode thanks to Jafaral! + * Huge CPU savings in modeld by using thneed! + * Lots of code cleanup and refactors + +Version 0.7.5 (2020-05-13) +======================== + * Right-Hand Drive support for both driving and driver monitoring! + * New driving model: improved at sharp turns and lead speed estimation + * New driver monitoring model: overall improvement on comma two + * Driver camera preview in settings to improve mounting position + * Added support for many Hyundai, Kia, Genesis models thanks to xx979xx! + * Improved lateral tuning for 2020 Toyota Rav 4 (hybrid) + +Version 0.7.4 (2020-03-20) +======================== + * New driving model: improved lane changes and lead car detection + * Improved driver monitoring model: improve eye detection + * Improved calibration stability + * Improved lateral control on some 2019 and 2020 Toyota Prius + * Improved lateral control on VW Golf: 20% more steering torque + * Fixed bug where some 2017 and 2018 Toyota C-HR would use the wrong steering angle sensor + * Support for Honda Insight thanks to theantihero! + * Code cleanup in car abstraction layers and ui + +Version 0.7.3 (2020-02-21) +======================== + * Support for 2020 Highlander thanks to che220! + * Support for 2018 Lexus NX 300h thanks to kengggg! + * Speed up ECU firmware query + * Fix bug where manager would sometimes hang after shutting down the car + +Version 0.7.2 (2020-02-07) +======================== + * ECU firmware version based fingerprinting for Honda & Toyota + * New driving model: improved path prediction during turns and lane changes and better lead speed tracking + * Improve driver monitoring under extreme lighting and add low accuracy alert + * Support for 2019 Rav4 Hybrid thanks to illumiN8i! + * Support for 2016, 2017 and 2020 Lexus RX thanks to illumiN8i! + * Support for 2020 Chrysler Pacifica Hybrid thanks to adhintz! + +Version 0.7.1 (2020-01-20) +======================== + * comma two support! + * Lane Change Assist above 45 mph! + * Replace zmq with custom messaging library, msgq! + * Supercombo model: calibration and driving models are combined for better lead estimate + * More robust updater thanks to jyoung8607! Requires NEOS update + * Improve low speed ACC tuning + +Version 0.7 (2019-12-13) +======================== + * Move to SCons build system! + * Add Lane Departure Warning (LDW) for all supported vehicles! + * NEOS update: increase wifi speed thanks to jyoung8607! + * Adaptive driver monitoring based on scene + * New driving model trained end-to-end: improve lane lines and lead detection + * Smarter torque limit alerts for all cars + * Improve GM longitudinal control: proper computations for 15Hz radar + * Move GM port, Toyota with DSU removed, comma pedal in community features; toggle switch required + * Remove upload over cellular toggle: only upload qlog and qcamera files if not on wifi + * Refactor Panda code towards ISO26262 and SIL2 compliancy + * Forward stock FCW for Honda Nidec + * Volkswagen port now standard: comma Harness intercepts stock camera + +Version 0.6.6 (2019-11-05) +======================== + * Volkswagen support thanks to jyoung8607! + * Toyota Corolla Hybrid with TSS 2.0 support thanks to u8511049! + * Lexus ES with TSS 2.0 support thanks to energee! + * Fix GM ignition detection and lock safety mode not required anymore + * Log panda firmware and dongle ID thanks to martinl! + * New driving model: improve path prediction and lead detection + * New driver monitoring model, 4x smaller and running on DSP + * Display an alert and don't start openpilot if panda has wrong firmware + * Fix bug preventing EON from terminating processes after a drive + * Remove support for Toyota giraffe without the 120Ohm resistor + +Version 0.6.5 (2019-10-07) +======================== + * NEOS update: upgrade to Python3 and new installer! + * comma Harness support! + * New driving model: improve path prediction + * New driver monitoring model: more accurate face and eye detection + * Redesign offroad screen to display updates and alerts + * Increase maximum allowed acceleration + * Prevent car 12V battery drain by cutting off EON charge after 3 days of no drive + * Lexus CT Hybrid support thanks to thomaspich! + * Louder chime for critical alerts + * Add toggle to switch to dashcam mode + * Fix "invalid vehicle params" error on DSU-less Toyota + +Version 0.6.4 (2019-09-08) +======================== + * Forward stock AEB for Honda Nidec + * Improve lane centering on banked roads + * Always-on forward collision warning + * Always-on driver monitoring, except for right hand drive countries + * Driver monitoring learns the user's normal driving position + * Honda Fit support thanks to energee! + * Lexus IS support + +Version 0.6.3 (2019-08-12) +======================== + * Alert sounds from EON: requires NEOS update + * Improve driver monitoring: eye tracking and improved awareness logic + * Improve path prediction with new driving model + * Improve lane positioning with wide lanes and exits + * Improve lateral control on RAV4 + * Slow down for turns using model + * Open sourced regression test to verify outputs against reference logs + * Open sourced regression test to sanity check all car models + +Version 0.6.2 (2019-07-29) +======================== + * New driving model! + * Improve lane tracking with double lines + * Strongly improve stationary vehicle detection + * Strongly reduce cases of braking due to false leads + * Better lead tracking around turns + * Improve cut-in prediction by using neural network + * Improve lateral control on Toyota Camry and C-HR thanks to zorrobyte! + * Fix unintended openpilot disengagements on Jeep thanks to adhintz! + * Fix delayed transition to offroad when car is turned off + +Version 0.6.1 (2019-07-21) +======================== + * Remote SSH with comma prime and [ssh.comma.ai](https://ssh.comma.ai) + * Panda code Misra-c2012 compliance, tested against cppcheck coverage + * Lockout openpilot after 3 terminal alerts for driver distracted or unresponsive + * Toyota Sienna support thanks to wocsor! + +Version 0.6 (2019-07-01) +======================== + * New model, with double the pixels and ten times the temporal context! + * Car should not take exits when in the right lane + * openpilot uses only ~65% of the CPU (down from 75%) + * Routes visible in connect/explorer after only 0.2% is uploaded (qlogs) + * loggerd and sensord are open source, every line of openpilot is now open + * Panda safety code is MISRA compliant and ships with a signed version on release2 + * New NEOS is 500MB smaller and has a reproducible usr/pipenv + * Lexus ES Hybrid support thanks to wocsor! + * Improve tuning for supported Toyota with TSS 2.0 + * Various other stability improvements + +Version 0.5.13 (2019-05-31) +========================== + * Reduce panda power consumption by 70%, down to 80mW, when car is off (not for GM) + * Reduce EON power consumption by 40%, down to 1100mW, when car is off + * Reduce CPU utilization by 20% and improve stability + * Temporarily remove mapd functionalities to improve stability + * Add openpilot record-only mode for unsupported cars + * Synchronize controlsd to boardd to reduce latency + * Remove panda support for Subaru giraffe + +Version 0.5.12 (2019-05-16) +========================== + * Improve lateral control for the Prius and Prius Prime + * Compress logs before writing to disk + * Remove old driving data when storage reaches 90% full + * Fix small offset in following distance + * Various small CPU optimizations + * Improve offroad power consumption: require NEOS Update + * Add default speed limits for Estonia thanks to martinl! + * Subaru Crosstrek support thanks to martinl! + * Toyota Avalon support thanks to njbrown09! + * Toyota Rav4 with TSS 2.0 support thanks to wocsor! + * Toyota Corolla with TSS 2.0 support thanks to wocsor! + +Version 0.5.11 (2019-04-17) +======================== + * Add support for Subaru + * Reduce panda power consumption by 60% when car is off + * Fix controlsd lag every 6 minutes. This would sometimes cause disengagements + * Fix bug in controls with new angle-offset learner in MPC + * Reduce cpu consumption of ubloxd by rewriting it in C++ + * Improve driver monitoring model and face detection + * Improve performance of visiond and ui + * Honda Passport 2019 support + * Lexus RX Hybrid 2019 support thanks to schomems! + * Improve road selection heuristic in mapd + * Add Lane Departure Warning to dashboard for Toyota thanks to arne182 + +Version 0.5.10 (2019-03-19) +======================== + * Self-tuning vehicle parameters: steering offset, tire stiffness and steering ratio + * Improve longitudinal control at low speed when lead vehicle harshly decelerates + * Fix panda bug going unexpectedly in DCP mode when EON is connected + * Reduce white panda power consumption by 500mW when EON is disconnected by turning off WIFI + * New Driver Monitoring Model + * Support QR codes for login using comma connect + * Refactor comma pedal FW and use CRC-8 checksum algorithm for safety. Reflashing pedal is required. + Please see `#hw-pedal` on [discord](discord.comma.ai) for assistance updating comma pedal. + * Additional speed limit rules for Germany thanks to arne182 + * Allow negative speed limit offsets + +Version 0.5.9 (2019-02-10) +======================== + * Improve calibration using a dedicated neural network + * Abstract planner in its own process to remove lags in controls process + * Improve speed limits with country/region defaults by road type + * Reduce mapd data usage with gzip thanks to eFiniLan + * Zip log files in the background to reduce disk usage + * Kia Optima support thanks to emmertex! + * Buick Regal 2018 support thanks to HOYS! + * Comma pedal support for Toyota thanks to wocsor! Note: tuning needed and not maintained by comma + * Chrysler Pacifica and Jeep Grand Cherokee support thanks to adhintz! + +Version 0.5.8 (2019-01-17) +======================== + * Open sourced visiond + * Auto-slowdown for upcoming turns + * Chrysler/Jeep/Fiat support thanks to adhintz! + * Honda Civic 2019 support thanks to csouers! + * Improve use of car display in Toyota thanks to arne182! + * No data upload when connected to Android or iOS hotspots and "Enable Upload Over Cellular" setting is off + * EON stops charging when 12V battery drops below 11.8V + +Version 0.5.7 (2018-12-06) +======================== + * Speed limit from OpenStreetMap added to UI + * Highlight speed limit when speed exceeds road speed limit plus a delta + * Option to limit openpilot max speed to road speed limit plus a delta + * Cadillac ATS support thanks to vntarasov! + * GMC Acadia support thanks to CryptoKylan! + * Decrease GPU power consumption + * NEOSv8 autoupdate + +Version 0.5.6 (2018-11-16) +======================== + * Refresh settings layout and add feature descriptions + * In Honda, keep stock camera on for logging and extra stock features; new openpilot giraffe setting is 0111! + * In Toyota, option to keep stock camera on for logging and extra stock features (e.g. AHB); 120Ohm resistor required on giraffe. + * Improve camera calibration stability + * More tuning to Honda positive accelerations + * Reduce brake pump use on Hondas + * Chevrolet Malibu support thanks to tylergets! + * Holden Astra support thanks to AlexHill! + +Version 0.5.5 (2018-10-20) +======================== + * Increase allowed Honda positive accelerations + * Fix sporadic unexpected braking when passing semi-trucks in Toyota + * Fix gear reading bug in Hyundai Elantra thanks to emmertex! + +Version 0.5.4 (2018-09-25) +======================== + * New Driving Model + * New Driver Monitoring Model + * Improve longitudinal mpc in mid-low speed braking + * Honda Accord hybrid support thanks to energee! + * Ship mpc binaries and sensibly reduce build time + * Calibration more stable + * More Hyundai and Kia cars supported thanks to emmertex! + * Various GM Volt improvements thanks to vntarasov! + +Version 0.5.3 (2018-09-03) +======================== + * Hyundai Santa Fe support! + * Honda Pilot 2019 support thanks to energee! + * Toyota Highlander support thanks to daehahn! + * Improve steering tuning for Honda Odyssey + +Version 0.5.2 (2018-08-16) +======================== + * New calibration: more accurate, a lot faster, open source! + * Enable orbd + * Add little endian support to CAN packer + * Fix fingerprint for Honda Accord 1.5T + * Improve driver monitoring model + +Version 0.5.1 (2018-08-01) +======================== + * Fix radar error on Civic sedan 2018 + * Improve thermal management logic + * Alpha Toyota C-HR and Camry support! + * Auto-switch Driver Monitoring to 3 min counter when inaccurate + +Version 0.5 (2018-07-11) +======================== + * Driver Monitoring (beta) option in settings! + * Make visiond, loggerd and UI use less resources + * 60 FPS UI + * Better car parameters for most cars + * New sidebar with stats + * Remove Waze and Spotify to free up system resources + * Remove rear view mirror option + * Calibration 3x faster + +Version 0.4.7.2 (2018-06-25) +========================== + * Fix loggerd lag issue + * No longer prompt for updates + * Mitigate right lane hugging for properly mounted EON (procedure on wiki) + +Version 0.4.7.1 (2018-06-18) +========================== + * Fix Acura ILX steer faults + * Fix bug in mock car + +Version 0.4.7 (2018-06-15) +========================== + * New model! + * GM Volt (and CT6 lateral) support! + * Honda Bosch lateral support! + * Improve actuator modeling to reduce lateral wobble + * Minor refactor of car abstraction layer + * Hack around orbd startup issue + +Version 0.4.6 (2018-05-18) +========================== + * NEOSv6 required! Will autoupdate + * Stability improvements + * Fix all memory leaks + * Update C++ compiler to clang6 + * Improve front camera exposure + +Version 0.4.5 (2018-04-27) +========================== + * Release notes added to the update popup + * Improve auto shut-off logic to disallow empty battery + * Added onboarding instructions + * Include orbd, the first piece of new calibration algorithm + * Show remaining upload data instead of file numbers + * Fix UI bugs + * Fix memory leaks + +Version 0.4.4 (2018-04-13) +========================== + * EON are flipped! Flip your EON's mount! + * Alpha Honda Ridgeline support thanks to energee! + * Support optional front camera recording + * Upload over cellular toggle now applies to all files, not just video + * Increase acceleration when closing lead gap + * User now prompted for future updates + * NEO no longer supported :( + +Version 0.4.3.2 (2018-03-29) +============================ + * Improve autofocus + * Improve driving when only one lane line is detected + * Added fingerprint for Toyota Corolla LE + * Fixed Toyota Corolla steer error + * Full-screen driving UI + * Improved path drawing + +Version 0.4.3.1 (2018-03-19) +============================ + * Improve autofocus + * Add check for MPC solution error + * Make first distracted warning visual only + +Version 0.4.3 (2018-03-13) +========================== + * Add HDR and autofocus + * Update UI aesthetic + * Grey panda works in Waze + * Add alpha support for 2017 Honda Pilot + * Slight increase in acceleration response from stop + * Switch CAN sending to use CANPacker + * Fix pulsing acceleration regression on Honda + * Fix openpilot bugs when stock system is in use + * Change starting logic for chffrplus to use battery voltage + +Version 0.4.2 (2018-02-05) +========================== + * Add alpha support for 2017 Lexus RX Hybrid + * Add alpha support for 2018 ACURA RDX + * Updated fingerprint to include Toyota Rav4 SE and Prius Prime + * Bugfixes for Acura ILX and Honda Odyssey + +Version 0.4.1 (2018-01-30) +========================== + * Add alpha support for 2017 Toyota Corolla + * Add alpha support for 2018 Honda Odyssey with Honda Sensing + * Add alpha support for Grey Panda + * Refactored car abstraction layer to make car ports easier + * Increased steering torque limit on Honda CR-V by 30% + +Version 0.4.0.2 (2018-01-18) +========================== + * Add focus adjustment slider + * Minor bugfixes + +Version 0.4.0.1 (2017-12-21) +========================== + * New UI to match chffrplus + * Improved lateral control tuning to fix oscillations on Civic + * Add alpha support for 2017 Toyota Rav4 Hybrid + * Reduced CPU usage + * Removed unnecessary utilization of fan at max speed + * Minor bug fixes + +Version 0.3.9 (2017-11-21) +========================== + * Add alpha support for 2017 Toyota Prius + * Improved longitudinal control using model predictive control + * Enable Forward Collision Warning + * Acura ILX now maintains openpilot engaged at standstill when brakes are applied + +Version 0.3.8.2 (2017-10-30) +========================== + * Add alpha support for 2017 Toyota RAV4 + * Smoother lateral control + * Stay silent if stock system is connected through giraffe + * Minor bug fixes + +Version 0.3.7 (2017-09-30) +========================== + * Improved lateral control using model predictive control + * Improved lane centering + * Improved GPS + * Reduced tendency of path deviation near right side exits + * Enable engagement while the accelerator pedal is pressed + * Enable engagement while the brake pedal is pressed, when stationary and with lead vehicle within 5m + * Disable engagement when park brake or brake hold are active + * Fixed sporadic longitudinal pulsing in Civic + * Cleanups to vehicle interface + +Version 0.3.6.1 (2017-08-15) +============================ + * Mitigate low speed steering oscillations on some vehicles + * Include board steering check for CR-V + +Version 0.3.6 (2017-08-08) +========================== + * Fix alpha CR-V support + * Improved GPS + * Fix display of target speed not always matching HUD + * Increased acceleration after stop + * Mitigated some vehicles driving too close to the right line + +Version 0.3.5 (2017-07-30) +========================== + * Fix bug where new devices would not begin calibration + * Minor robustness improvements + +Version 0.3.4 (2017-07-28) +========================== + * Improved model trained on more data + * Much improved controls tuning + * Performance improvements + * Bugfixes and improvements to calibration + * Driving log can play back video + * Acura only: system now stays engaged below 25mph as long as brakes are applied + +Version 0.3.3 (2017-06-28) +=========================== + * Improved model trained on more data + * Alpha CR-V support thanks to energee and johnnwvs! + * Using the opendbc project for DBC files + * Minor performance improvements + * UI update thanks to pjlao307 + * Power off button + * 6% more torque on the Civic + +Version 0.3.2 (2017-05-22) +=========================== + * Minor stability bugfixes + * Added metrics and rear view mirror disable to settings + * Update model with more crowdsourced data + +Version 0.3.1 (2017-05-17) +=========================== + * visiond stability bugfix + * Add logging for angle and flashing + +Version 0.3.0 (2017-05-12) +=========================== + * Add CarParams struct to improve the abstraction layer + * Refactor visiond IPC to support multiple clients + * Add raw GPS and beginning support for navigation + * Improve model in visiond using crowdsourced data + * Add improved system logging to diagnose instability + * Rewrite baseui in React Native + * Moved calibration to the cloud + +Version 0.2.9 (2017-03-01) +=========================== + * Retain compatibility with NEOS v1 + +Version 0.2.8 (2017-02-27) +=========================== + * Fix bug where frames were being dropped in minute 71 + +Version 0.2.7 (2017-02-08) +=========================== + * Better performance and pictures at night + * Fix ptr alignment issue in boardd + * Fix brake error light, fix crash if too cold + +Version 0.2.6 (2017-01-31) +=========================== + * Fix bug in visiond model execution + +Version 0.2.5 (2017-01-30) +=========================== + * Fix race condition in manager + +Version 0.2.4 (2017-01-27) +=========================== + * OnePlus 3T support + * Enable installation as NEOS app + * Various minor bugfixes + +Version 0.2.3 (2017-01-11) +=========================== + * Reduce space usage by 80% + * Add better logging + * Add Travis CI + +Version 0.2.2 (2017-01-10) +=========================== + * Board triggers started signal on CAN messages + * Improved autoexposure + * Handle out of space, improve upload status + +Version 0.2.1 (2016-12-14) +=========================== + * Performance improvements, removal of more numpy + * Fix boardd process priority + * Make counter timer reset on use of steering wheel + +Version 0.2 (2016-12-12) +========================= + * Car/Radar abstraction layers have shipped, see cereal/car.capnp + * controlsd has been refactored + * Shipped plant model and testing maneuvers + * visiond exits more gracefully now + * Hardware encoder in visiond should always init + * ui now turns off the screen after 30 seconds + * Switch to openpilot release branch for future releases + * Added preliminary Docker container to run tests on PC + +Version 0.1 (2016-11-29) +========================= + * Initial release of openpilot + * Adaptive cruise control is working + * Lane keep assist is working + * Support for Acura ILX 2016 with AcuraWatch Plus + * Support for Honda Civic 2016 Touring Edition diff --git a/SConstruct b/SConstruct new file mode 100644 index 000000000..23db7c302 --- /dev/null +++ b/SConstruct @@ -0,0 +1,445 @@ +import os +import shutil +import subprocess +import sys +import sysconfig +import platform +import numpy as np + +TICI = os.path.isfile('/TICI') +Decider('MD5-timestamp') + +AddOption('--test', + action='store_true', + help='build test files') + +AddOption('--extras', + action='store_true', + help='build misc extras, like setup and installer files') + +AddOption('--kaitai', + action='store_true', + help='Regenerate kaitai struct parsers') + +AddOption('--asan', + action='store_true', + help='turn on ASAN') + +AddOption('--ubsan', + action='store_true', + help='turn on UBSan') + +AddOption('--clazy', + action='store_true', + help='build with clazy') + +AddOption('--compile_db', + action='store_true', + help='build clang compilation database') + +AddOption('--snpe', + action='store_true', + help='use SNPE on PC') + +AddOption('--external-sconscript', + action='store', + metavar='FILE', + dest='external_sconscript', + help='add an external SConscript to the build') + +AddOption('--no-thneed', + action='store_true', + dest='no_thneed', + help='avoid using thneed') + +real_arch = arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() +if platform.system() == "Darwin": + arch = "Darwin" + +if arch == "aarch64" and TICI: + arch = "larch64" + +USE_WEBCAM = os.getenv("USE_WEBCAM") is not None + +lenv = { + "PATH": os.environ['PATH'], + "LD_LIBRARY_PATH": [Dir(f"#third_party/acados/{arch}/lib").abspath], + "PYTHONPATH": Dir("#").abspath + ":" + Dir("#pyextra/").abspath, + + "ACADOS_SOURCE_DIR": Dir("#third_party/acados/include/acados").abspath, + "ACADOS_PYTHON_INTERFACE_PATH": Dir("#pyextra/acados_template").abspath, + "TERA_PATH": Dir("#").abspath + f"/third_party/acados/{arch}/t_renderer", +} + +rpath = lenv["LD_LIBRARY_PATH"].copy() + +if arch == "aarch64" or arch == "larch64": + lenv["LD_LIBRARY_PATH"] += ['/data/data/com.termux/files/usr/lib'] + + if arch == "aarch64": + # android + lenv["ANDROID_DATA"] = os.environ['ANDROID_DATA'] + lenv["ANDROID_ROOT"] = os.environ['ANDROID_ROOT'] + + cpppath = [ + "#third_party/opencl/include", + ] + + libpath = [ + "/usr/local/lib", + "/usr/lib", + "/system/vendor/lib64", + "/system/comma/usr/lib", + f"#third_party/acados/{arch}/lib", + ] + + if arch == "larch64": + libpath += [ + "#third_party/snpe/larch64", + "#third_party/libyuv/larch64/lib", + "/usr/lib/aarch64-linux-gnu" + ] + cpppath += [ + "#selfdrive/camerad/include", + ] + cflags = ["-DQCOM2", "-mcpu=cortex-a57"] + cxxflags = ["-DQCOM2", "-mcpu=cortex-a57"] + rpath += ["/usr/local/lib"] + else: + rpath = [] + libpath += [ + "#third_party/snpe/aarch64", + "#third_party/libyuv/lib", + "/system/vendor/lib64" + ] + cflags = ["-DQCOM", "-D_USING_LIBCXX", "-mcpu=cortex-a57"] + cxxflags = ["-DQCOM", "-D_USING_LIBCXX", "-mcpu=cortex-a57"] +else: + cflags = [] + cxxflags = [] + cpppath = [] + + if arch == "Darwin": + yuv_dir = "mac" if real_arch != "arm64" else "mac_arm64" + libpath = [ + f"#third_party/libyuv/{yuv_dir}/lib", + "/usr/local/lib", + "/opt/homebrew/lib", + "/usr/local/Homebrew/Library", + "/usr/local/opt/openssl/lib", + "/opt/homebrew/opt/openssl/lib", + "/usr/local/Cellar", + f"#third_party/acados/{arch}/lib", + "/System/Library/Frameworks/OpenGL.framework/Libraries", + ] + cflags += ["-DGL_SILENCE_DEPRECATION"] + cxxflags += ["-DGL_SILENCE_DEPRECATION"] + cpppath += [ + "/opt/homebrew/include", + "/usr/local/include", + "/usr/local/opt/openssl/include", + "/opt/homebrew/opt/openssl/include" + ] + else: + libpath = [ + "#third_party/acados/x86_64/lib", + "#third_party/snpe/x86_64-linux-clang", + "#third_party/libyuv/x64/lib", + "#third_party/mapbox-gl-native-qt/x86_64", + "#cereal", + "#selfdrive/common", + "/usr/lib", + "/usr/local/lib", + ] + + rpath += [ + Dir("#third_party/snpe/x86_64-linux-clang").abspath, + Dir("#cereal").abspath, + Dir("#selfdrive/common").abspath + ] + +if GetOption('asan'): + ccflags = ["-fsanitize=address", "-fno-omit-frame-pointer"] + ldflags = ["-fsanitize=address"] +elif GetOption('ubsan'): + ccflags = ["-fsanitize=undefined"] + ldflags = ["-fsanitize=undefined"] +else: + ccflags = [] + ldflags = [] + +# no --as-needed on mac linker +if arch != "Darwin": + ldflags += ["-Wl,--as-needed", "-Wl,--no-undefined"] + +# Enable swaglog include in submodules +cflags += ["-DSWAGLOG"] +cxxflags += ["-DSWAGLOG"] + +env = Environment( + ENV=lenv, + CCFLAGS=[ + "-g", + "-fPIC", + "-O2", + "-Wunused", + "-Werror", + "-Wshadow", + "-Wno-unknown-warning-option", + "-Wno-deprecated-register", + "-Wno-register", + "-Wno-inconsistent-missing-override", + "-Wno-c99-designator", + "-Wno-reorder-init-list", + "-Wno-error=unused-but-set-variable", + ] + cflags + ccflags, + + CPPPATH=cpppath + [ + "#", + "#third_party/acados/include", + "#third_party/acados/include/blasfeo/include", + "#third_party/acados/include/hpipm/include", + "#third_party/catch2/include", + "#third_party/bzip2", + "#third_party/libyuv/include", + "#third_party/openmax/include", + "#third_party/json11", + "#third_party/curl/include", + "#third_party/libgralloc/include", + "#third_party/android_frameworks_native/include", + "#third_party/android_hardware_libhardware/include", + "#third_party/android_system_core/include", + "#third_party/linux/include", + "#third_party/snpe/include", + "#third_party/mapbox-gl-native-qt/include", + "#third_party/qrcode", + "#third_party", + "#cereal", + "#opendbc/can", + ], + + CC='clang', + CXX='clang++', + LINKFLAGS=ldflags, + + RPATH=rpath, + + CFLAGS=["-std=gnu11"] + cflags, + CXXFLAGS=["-std=c++1z"] + cxxflags, + LIBPATH=libpath + [ + "#cereal", + "#third_party", + "#opendbc/can", + "#selfdrive/boardd", + "#selfdrive/common", + ], + CYTHONCFILESUFFIX=".cpp", + COMPILATIONDB_USE_ABSPATH=True, + tools=["default", "cython", "compilation_db"], +) + +if arch == "Darwin": + env['RPATHPREFIX'] = "-rpath " + +if GetOption('compile_db'): + env.CompilationDatabase('compile_commands.json') + +# Setup cache dir +cache_dir = '/data/scons_cache' if TICI else '/tmp/scons_cache' +CacheDir(cache_dir) +Clean(["."], cache_dir) + +node_interval = 5 +node_count = 0 +def progress_function(node): + global node_count + node_count += node_interval + sys.stderr.write("progress: %d\n" % node_count) + +if os.environ.get('SCONS_PROGRESS'): + Progress(progress_function, interval=node_interval) + +SHARED = False + +def abspath(x): + if arch == 'aarch64': + pth = os.path.join("/data/pythonpath", x[0].path) + env.Depends(pth, x) + return File(pth) + else: + # rpath works elsewhere + return x[0].path.rsplit("/", 1)[1][:-3] + +# Cython build enviroment +py_include = sysconfig.get_paths()['include'] +envCython = env.Clone() +envCython["CPPPATH"] += [py_include, np.get_include()] +envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-shadow", "-Wno-deprecated-declarations"] + +envCython["LIBS"] = [] +if arch == "Darwin": + envCython["LINKFLAGS"] = ["-bundle", "-undefined", "dynamic_lookup"] +elif arch == "aarch64": + envCython["LINKFLAGS"] = ["-shared"] + envCython["LIBS"] = [os.path.basename(py_include)] +else: + envCython["LINKFLAGS"] = ["-pthread", "-shared"] + +Export('envCython') + +# Qt build environment +qt_env = env.Clone() +qt_modules = ["Widgets", "Gui", "Core", "Network", "Concurrent", "Multimedia", "Quick", "Qml", "QuickWidgets", "Location", "Positioning"] +if arch != "aarch64": + qt_modules += ["DBus"] + +qt_libs = [] +if arch == "Darwin": + if real_arch == "arm64": + qt_env['QTDIR'] = "/opt/homebrew/opt/qt@5" + else: + qt_env['QTDIR'] = "/usr/local/opt/qt@5" + qt_dirs = [ + os.path.join(qt_env['QTDIR'], "include"), + ] + qt_dirs += [f"{qt_env['QTDIR']}/include/Qt{m}" for m in qt_modules] + qt_env["LINKFLAGS"] += ["-F" + os.path.join(qt_env['QTDIR'], "lib")] + qt_env["FRAMEWORKS"] += [f"Qt{m}" for m in qt_modules] + ["OpenGL"] + qt_env.AppendENVPath('PATH', os.path.join(qt_env['QTDIR'], "bin")) +elif arch == "aarch64": + qt_env['QTDIR'] = "/system/comma/usr" + qt_dirs = [ + f"/system/comma/usr/include/qt", + ] + qt_dirs += [f"/system/comma/usr/include/qt/Qt{m}" for m in qt_modules] + + qt_libs = [f"Qt5{m}" for m in qt_modules] + qt_libs += ['EGL', 'GLESv3', 'c++_shared'] +else: + qt_env['QTDIR'] = "/usr" + qt_dirs = [ + f"/usr/include/{real_arch}-linux-gnu/qt5", + f"/usr/include/{real_arch}-linux-gnu/qt5/QtGui/5.12.8/QtGui", + ] + qt_dirs += [f"/usr/include/{real_arch}-linux-gnu/qt5/Qt{m}" for m in qt_modules] + + qt_libs = [f"Qt5{m}" for m in qt_modules] + if arch == "larch64": + qt_libs += ["GLESv2", "wayland-client"] + elif arch != "Darwin": + qt_libs += ["GL"] + +qt_env.Tool('qt') +qt_env['CPPPATH'] += qt_dirs + ["#selfdrive/ui/qt/"] + ["#selfdrive/car/modules/qt/"] +qt_flags = [ + "-D_REENTRANT", + "-DQT_NO_DEBUG", + "-DQT_WIDGETS_LIB", + "-DQT_GUI_LIB", + "-DQT_QUICK_LIB", + "-DQT_QUICKWIDGETS_LIB", + "-DQT_QML_LIB", + "-DQT_CORE_LIB", + "-DQT_MESSAGELOGCONTEXT", +] +qt_env['CXXFLAGS'] += qt_flags +qt_env['LIBPATH'] += ['#selfdrive/ui'] +qt_env['LIBS'] = qt_libs + +if GetOption("clazy"): + checks = [ + "level0", + "level1", + "no-range-loop", + "no-non-pod-global-static", + ] + qt_env['CXX'] = 'clazy' + qt_env['ENV']['CLAZY_IGNORE_DIRS'] = qt_dirs[0] + qt_env['ENV']['CLAZY_CHECKS'] = ','.join(checks) + +Export('env', 'qt_env', 'arch', 'real_arch', 'SHARED', 'USE_WEBCAM') + +SConscript(['selfdrive/common/SConscript']) +Import('_common', '_gpucommon', '_gpu_libs') + +if SHARED: + common, gpucommon = abspath(common), abspath(gpucommon) +else: + common = [_common, 'json11'] + gpucommon = [_gpucommon] + _gpu_libs + +Export('common', 'gpucommon') + +# cereal and messaging are shared with the system +SConscript(['cereal/SConscript']) +if SHARED: + cereal = abspath([File('cereal/libcereal_shared.so')]) + messaging = abspath([File('cereal/libmessaging_shared.so')]) +else: + cereal = [File('#cereal/libcereal.a')] + messaging = [File('#cereal/libmessaging.a')] + visionipc = [File('#cereal/libvisionipc.a')] + +Export('cereal', 'messaging', 'visionipc') + +# Build rednose library and ekf models + +rednose_config = { + 'generated_folder': '#selfdrive/locationd/models/generated', + 'to_build': { + 'live': ('#selfdrive/locationd/models/live_kf.py', True, ['live_kf_constants.h']), + 'car': ('#selfdrive/locationd/models/car_kf.py', True, []), + }, +} + +if arch not in ["aarch64", "larch64"]: + rednose_config['to_build'].update({ + 'gnss': ('#selfdrive/locationd/models/gnss_kf.py', True, []), + 'loc_4': ('#selfdrive/locationd/models/loc_kf.py', True, []), + 'pos_computer_4': ('#rednose/helpers/lst_sq_computer.py', False, []), + 'pos_computer_5': ('#rednose/helpers/lst_sq_computer.py', False, []), + 'feature_handler_5': ('#rednose/helpers/feature_handler.py', False, []), + 'lane': ('#xx/pipeline/lib/ekf/lane_kf.py', True, []), + }) + +Export('rednose_config') +SConscript(['rednose/SConscript']) + +# Build openpilot + +SConscript(['cereal/SConscript']) +SConscript(['panda/board/SConscript']) +SConscript(['opendbc/can/SConscript']) + +SConscript(['third_party/SConscript']) + +SConscript(['common/SConscript']) +SConscript(['common/kalman/SConscript']) +SConscript(['common/transformations/SConscript']) + +SConscript(['selfdrive/camerad/SConscript']) +SConscript(['selfdrive/modeld/SConscript']) + +SConscript(['selfdrive/controls/lib/cluster/SConscript']) +SConscript(['selfdrive/controls/lib/lateral_mpc_lib/SConscript']) +SConscript(['selfdrive/controls/lib/longitudinal_mpc_lib/SConscript']) + +SConscript(['selfdrive/boardd/SConscript']) +SConscript(['selfdrive/proclogd/SConscript']) +SConscript(['selfdrive/clocksd/SConscript']) + +SConscript(['selfdrive/loggerd/SConscript']) + +SConscript(['selfdrive/locationd/SConscript']) +SConscript(['selfdrive/sensord/SConscript']) +SConscript(['selfdrive/ui/SConscript']) + +if arch != "Darwin": + SConscript(['selfdrive/logcatd/SConscript']) + +if GetOption('test'): + SConscript('panda/tests/safety/SConscript') + +external_sconscript = GetOption('external_sconscript') +if external_sconscript: + SConscript([external_sconscript]) diff --git a/cereal/.gitignore b/cereal/.gitignore new file mode 100644 index 000000000..14cd02eff --- /dev/null +++ b/cereal/.gitignore @@ -0,0 +1,21 @@ +gen +node_modules +package-lock.json +*.tmp +*.pyc +__pycache__ +.*.swp +.*.swo +*.os +*.o +*.a + +test_runner + +libmessaging.* +libmessaging_shared.* +services.h +.sconsign.dblite +libcereal_shared.* +.mypy_cache/ +catch2/ diff --git a/cereal/SConscript b/cereal/SConscript new file mode 100644 index 000000000..df066dc51 --- /dev/null +++ b/cereal/SConscript @@ -0,0 +1,72 @@ +Import('env', 'envCython', 'arch', 'common') + +import shutil + +cereal_dir = Dir('.') +gen_dir = Dir('gen') +messaging_dir = Dir('messaging') + +# Build cereal + +schema_files = ['log.capnp', 'car.capnp', 'legacy.capnp'] +env.Command(["gen/c/include/c++.capnp.h"], [], "mkdir -p " + gen_dir.path + "/c/include && touch $TARGETS") +env.Command([f'gen/cpp/{s}.c++' for s in schema_files] + [f'gen/cpp/{s}.h' for s in schema_files], + schema_files, + f"capnpc --src-prefix={cereal_dir.path} $SOURCES -o c++:{gen_dir.path}/cpp/") + +# TODO: remove non shared cereal and messaging +cereal_objects = env.SharedObject([f'gen/cpp/{s}.c++' for s in schema_files]) + +env.Library('cereal', cereal_objects) +env.SharedLibrary('cereal_shared', cereal_objects) + +# Build messaging + +services_h = env.Command(['services.h'], ['services.py'], 'python3 ' + cereal_dir.path + '/services.py > $TARGET') + +messaging_objects = env.SharedObject([ + 'messaging/messaging.cc', + 'messaging/impl_zmq.cc', + 'messaging/impl_msgq.cc', + 'messaging/msgq.cc', + 'messaging/socketmaster.cc', +]) + +messaging_lib = env.Library('messaging', messaging_objects) +Depends('messaging/impl_zmq.cc', services_h) + +env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=[messaging_lib, 'zmq', common]) +Depends('messaging/bridge.cc', services_h) + +envCython.Program('messaging/messaging_pyx.so', 'messaging/messaging_pyx.pyx', LIBS=envCython["LIBS"]+[messaging_lib, "zmq", common]) + + +# Build Vision IPC +vipc_sources = [ + 'visionipc/ipc.cc', + 'visionipc/visionipc_server.cc', + 'visionipc/visionipc_client.cc', + 'visionipc/visionbuf.cc', +] + +if arch in ["aarch64", "larch64"]: + vipc_sources += ['visionipc/visionbuf_ion.cc'] +else: + vipc_sources += ['visionipc/visionbuf_cl.cc'] + +vipc_objects = env.SharedObject(vipc_sources) +vipc = env.Library('visionipc', vipc_objects) + + +libs = envCython["LIBS"]+["OpenCL", "zmq", vipc, messaging_lib, common] +if arch == "aarch64": + libs += ["adreno_utils"] +if arch == "Darwin": + del libs[libs.index('OpenCL')] + envCython['FRAMEWORKS'] += ['OpenCL'] +envCython.Program('visionipc/visionipc_pyx.so', 'visionipc/visionipc_pyx.pyx', LIBS=libs) + + +if GetOption('test'): + env.Program('messaging/test_runner', ['messaging/test_runner.cc', 'messaging/msgq_tests.cc'], LIBS=[messaging_lib, common]) + env.Program('visionipc/test_runner', ['visionipc/test_runner.cc', 'visionipc/visionipc_tests.cc'], LIBS=[vipc, messaging_lib, 'zmq', 'pthread', 'OpenCL', common]) diff --git a/cereal/__init__.py b/cereal/__init__.py new file mode 100644 index 000000000..88a181cbc --- /dev/null +++ b/cereal/__init__.py @@ -0,0 +1,9 @@ +# pylint: skip-file +import os +import capnp + +CEREAL_PATH = os.path.dirname(os.path.abspath(__file__)) +capnp.remove_import_hook() + +log = capnp.load(os.path.join(CEREAL_PATH, "log.capnp")) +car = capnp.load(os.path.join(CEREAL_PATH, "car.capnp")) diff --git a/cereal/car.capnp b/cereal/car.capnp new file mode 100644 index 000000000..df297f4af --- /dev/null +++ b/cereal/car.capnp @@ -0,0 +1,615 @@ +using Cxx = import "./include/c++.capnp"; +$Cxx.namespace("cereal"); + +@0x8e2af1e708af8b8d; + +# ******* events causing controls state machine transition ******* + +struct CarEvent @0x9b1657f34caf3ad3 { + name @0 :EventName; + + # event types + enable @1 :Bool; + noEntry @2 :Bool; + warning @3 :Bool; # alerts presented only when enabled or soft disabling + userDisable @4 :Bool; + softDisable @5 :Bool; + immediateDisable @6 :Bool; + preEnable @7 :Bool; + permanent @8 :Bool; # alerts presented regardless of openpilot state + + enum EventName @0xbaa8c5d505f727de { + canError @0; + steerUnavailable @1; + brakeUnavailable @2; + wrongGear @4; + doorOpen @5; + seatbeltNotLatched @6; + espDisabled @7; + wrongCarMode @8; + steerTempUnavailable @9; + reverseGear @10; + buttonCancel @11; + buttonEnable @12; + pedalPressed @13; + cruiseDisabled @14; + speedTooLow @17; + outOfSpace @18; + overheat @19; + calibrationIncomplete @20; + calibrationInvalid @21; + controlsMismatch @22; + pcmEnable @23; + pcmDisable @24; + noTarget @25; + radarFault @26; + brakeHold @28; + parkBrake @29; + manualRestart @30; + lowSpeedLockout @31; + plannerError @32; + joystickDebug @34; + steerTempUnavailableSilent @35; + resumeRequired @36; + preDriverDistracted @37; + promptDriverDistracted @38; + driverDistracted @39; + preDriverUnresponsive @43; + promptDriverUnresponsive @44; + driverUnresponsive @45; + belowSteerSpeed @46; + lowBattery @48; + vehicleModelInvalid @50; + accFaulted @51; + sensorDataInvalid @52; + commIssue @53; + tooDistracted @54; + posenetInvalid @55; + soundsUnavailable @56; + preLaneChangeLeft @57; + preLaneChangeRight @58; + laneChange @59; + lowMemory @63; + stockAeb @64; + ldw @65; + carUnrecognized @66; + invalidLkasSetting @69; + speedTooHigh @70; + laneChangeBlocked @71; + relayMalfunction @72; + gasPressed @73; + stockFcw @74; + startup @75; + startupNoCar @76; + startupNoControl @77; + startupMaster @78; + startupNoFw @104; + fcw @79; + steerSaturated @80; + belowEngageSpeed @84; + noGps @85; + wrongCruiseMode @87; + modeldLagging @89; + deviceFalling @90; + fanMalfunction @91; + cameraMalfunction @92; + gpsMalfunction @94; + processNotRunning @95; + dashcamMode @96; + controlsInitializing @98; + usbError @99; + roadCameraError @100; + driverCameraError @101; + wideRoadCameraError @102; + localizerMalfunction @103; + highCpuUsage @105; + cruiseMismatch @106; + lkasDisabled @107; + pccEnabled @108; + pccDisabled @109; + pccError @110; + accEnabled @111; + accDisabled @112; + iBoosterBrakeNotOk @113; + + radarCanErrorDEPRECATED @15; + communityFeatureDisallowedDEPRECATED @62; + radarCommIssueDEPRECATED @67; + driverMonitorLowAccDEPRECATED @68; + gasUnavailableDEPRECATED @3; + dataNeededDEPRECATED @16; + modelCommIssueDEPRECATED @27; + ipasOverrideDEPRECATED @33; + geofenceDEPRECATED @40; + driverMonitorOnDEPRECATED @41; + driverMonitorOffDEPRECATED @42; + calibrationProgressDEPRECATED @47; + invalidGiraffeHondaDEPRECATED @49; + invalidGiraffeToyotaDEPRECATED @60; + internetConnectivityNeededDEPRECATED @61; + whitePandaUnsupportedDEPRECATED @81; + commIssueWarningDEPRECATED @83; + focusRecoverActiveDEPRECATED @86; + neosUpdateRequiredDEPRECATED @88; + modelLagWarningDEPRECATED @93; + startupOneplusDEPRECATED @82; + startupFuzzyFingerprintDEPRECATED @97; + } +} + +# ******* main car state @ 100hz ******* +# all speeds in m/s + +struct CarState { + events @13 :List(CarEvent); + + # car speed + vEgo @1 :Float32; # best estimate of speed + aEgo @16 :Float32; # best estimate of acceleration + vEgoRaw @17 :Float32; # unfiltered speed from CAN sensors + yawRate @22 :Float32; # best estimate of yaw rate + standstill @18 :Bool; + wheelSpeeds @2 :WheelSpeeds; + + # gas pedal, 0.0-1.0 + gas @3 :Float32; # this is user pedal only + gasPressed @4 :Bool; # this is user pedal only + + # brake pedal, 0.0-1.0 + brake @5 :Float32; # this is user pedal only + brakePressed @6 :Bool; # this is user pedal only + brakeHoldActive @38 :Bool; + + # steering wheel + steeringAngleDeg @7 :Float32; + steeringAngleOffsetDeg @37 :Float32; # Offset betweens sensors in case there multiple + steeringRateDeg @15 :Float32; + steeringTorque @8 :Float32; # TODO: standardize units + steeringTorqueEps @27 :Float32; # TODO: standardize units + steeringPressed @9 :Bool; # if the user is using the steering wheel + steeringRateLimited @29 :Bool; # if the torque is limited by the rate limiter + steerWarning @35 :Bool; # temporary steer unavailble + steerError @36 :Bool; # permanent steer error + stockAeb @30 :Bool; + stockFcw @31 :Bool; + espDisabled @32 :Bool; + + # cruise state + cruiseState @10 :CruiseState; + + # gear + gearShifter @14 :GearShifter; + + # button presses + buttonEvents @11 :List(ButtonEvent); + leftBlinker @20 :Bool; + rightBlinker @21 :Bool; + genericToggle @23 :Bool; + + # lock info + doorOpen @24 :Bool; + seatbeltUnlatched @25 :Bool; + canValid @26 :Bool; + + # clutch (manual transmission only) + clutchPressed @28 :Bool; + + # which packets this state came from + canMonoTimes @12: List(UInt64); + + # blindspot sensors + leftBlindspot @33 :Bool; # Is there something blocking the left lane change + rightBlindspot @34 :Bool; # Is there something blocking the right lane change + + struct WheelSpeeds { + # optional wheel speeds + fl @0 :Float32; + fr @1 :Float32; + rl @2 :Float32; + rr @3 :Float32; + } + + struct CruiseState { + enabled @0 :Bool; + speed @1 :Float32; + available @2 :Bool; + speedOffset @3 :Float32; + standstill @4 :Bool; + nonAdaptive @5 :Bool; + } + + enum GearShifter { + unknown @0; + park @1; + drive @2; + neutral @3; + reverse @4; + sport @5; + low @6; + brake @7; + eco @8; + manumatic @9; + } + + # send on change + struct ButtonEvent { + pressed @0 :Bool; + type @1 :Type; + + enum Type { + unknown @0; + leftBlinker @1; + rightBlinker @2; + accelCruise @3; + decelCruise @4; + cancel @5; + altButton1 @6; + altButton2 @7; + altButton3 @8; + setCruise @9; + resumeCruise @10; + gapAdjustCruise @11; + } + } + + errorsDEPRECATED @0 :List(CarEvent.EventName); + brakeLightsDEPRECATED @19 :Bool; +} + +# ******* radar state @ 20hz ******* + +struct RadarData @0x888ad6581cf0aacb { + errors @0 :List(Error); + points @1 :List(RadarPoint); + + # which packets this state came from + canMonoTimes @2 :List(UInt64); + + enum Error { + canError @0; + fault @1; + wrongConfig @2; + } + + # similar to LiveTracks + # is one timestamp valid for all? I think so + struct RadarPoint { + trackId @0 :UInt64; # no trackId reuse + + # these 3 are the minimum required + dRel @1 :Float32; # m from the front bumper of the car + yRel @2 :Float32; # m + vRel @3 :Float32; # m/s + + # these are optional and valid if they are not NaN + aRel @4 :Float32; # m/s^2 + yvRel @5 :Float32; # m/s + + # some radars flag measurements VS estimates + measured @6 :Bool; + } +} + +# ******* car controls @ 100hz ******* + +struct CarControl { + # must be true for any actuator commands to work + enabled @0 :Bool; + active @7 :Bool; + + # Actuator commands as computed by controlsd + actuators @6 :Actuators; + + # Any car specific rate limits or quirks applied by + # the CarController are reflected in actuatorsOutput + # and matches what is sent to the car + actuatorsOutput @10 :Actuators; + + roll @8 :Float32; + pitch @9 :Float32; + + cruiseControl @4 :CruiseControl; + hudControl @5 :HUDControl; + + struct Actuators { + # range from 0.0 - 1.0 + gas @0: Float32; + brake @1: Float32; + # range from -1.0 - 1.0 + steer @2: Float32; + steeringAngleDeg @3: Float32; + + speed @6: Float32; # m/s + accel @4: Float32; # m/s^2 + longControlState @5: LongControlState; + + enum LongControlState @0xe40f3a917d908282{ + off @0; + pid @1; + stopping @2; + + startingDEPRECATED @3; + } + + } + + struct CruiseControl { + cancel @0: Bool; + override @1: Bool; + speedOverride @2: Float32; + accelOverride @3: Float32; + } + + struct HUDControl { + speedVisible @0: Bool; + setSpeed @1: Float32; + lanesVisible @2: Bool; + leadVisible @3: Bool; + visualAlert @4: VisualAlert; + audibleAlert @5: AudibleAlert; + rightLaneVisible @6: Bool; + leftLaneVisible @7: Bool; + rightLaneDepart @8: Bool; + leftLaneDepart @9: Bool; + + enum VisualAlert { + # these are the choices from the Honda + # map as good as you can for your car + none @0; + fcw @1; + steerRequired @2; + brakePressed @3; + wrongGear @4; + seatbeltUnbuckled @5; + speedTooHigh @6; + ldw @7; + } + + enum AudibleAlert { + none @0; + + engage @1; + disengage @2; + refuse @3; + + warningSoft @4; + warningImmediate @5; + + prompt @6; + promptRepeat @7; + promptDistracted @8; + } + } + + gasDEPRECATED @1 :Float32; + brakeDEPRECATED @2 :Float32; + steeringTorqueDEPRECATED @3 :Float32; +} + +# ****** car param ****** + +struct CarParams { + carName @0 :Text; + carFingerprint @1 :Text; + fuzzyFingerprint @55 :Bool; + + enableGasInterceptor @2 :Bool; + pcmCruise @3 :Bool; # is openpilot's state tied to the PCM's cruise state? + enableDsu @5 :Bool; # driving support unit + enableApgs @6 :Bool; # advanced parking guidance system + enableBsm @56 :Bool; # blind spot monitoring + flags @64 :UInt32; # flags for car specific quirks + + minEnableSpeed @7 :Float32; + minSteerSpeed @8 :Float32; + maxSteeringAngleDeg @54 :Float32; + safetyConfigs @62 :List(SafetyConfig); + unsafeMode @65 :Int16; + + steerMaxBP @11 :List(Float32); + steerMaxV @12 :List(Float32); + gasMaxBPDEPRECATED @13 :List(Float32); + gasMaxVDEPRECATED @14 :List(Float32); + brakeMaxBPDEPRECATED @15 :List(Float32); + brakeMaxVDEPRECATED @16 :List(Float32); + + # things about the car in the manual + mass @17 :Float32; # [kg] curb weight: all fluids no cargo + wheelbase @18 :Float32; # [m] distance from rear axle to front axle + centerToFront @19 :Float32; # [m] distance from center of mass to front axle + steerRatio @20 :Float32; # [] ratio of steering wheel angle to front wheel angle + steerRatioRear @21 :Float32; # [] ratio of steering wheel angle to rear wheel angle (usually 0) + + # things we can derive + rotationalInertia @22 :Float32; # [kg*m2] body rotational inertia + tireStiffnessFront @23 :Float32; # [N/rad] front tire coeff of stiff + tireStiffnessRear @24 :Float32; # [N/rad] rear tire coeff of stiff + + longitudinalTuning @25 :LongitudinalPIDTuning; + lateralParams @48 :LateralParams; + lateralTuning :union { + pid @26 :LateralPIDTuning; + indi @27 :LateralINDITuning; + lqr @40 :LateralLQRTuning; + } + + steerLimitAlert @28 :Bool; + steerLimitTimer @47 :Float32; # time before steerLimitAlert is issued + + vEgoStopping @29 :Float32; # Speed at which the car goes into stopping state + vEgoStarting @59 :Float32; # Speed at which the car goes into starting state + directAccelControl @30 :Bool; # Does the car have direct accel control or just gas/brake + stoppingControl @31 :Bool; # Does the car allows full control even at lows speeds when stopping + stopAccel @60 :Float32; # Required acceleraton to keep vehicle stationary + steerRateCost @33 :Float32; # Lateral MPC cost on steering rate + steerControlType @34 :SteerControlType; + radarOffCan @35 :Bool; # True when radar objects aren't visible on CAN + stoppingDecelRate @52 :Float32; # m/s^2/s while trying to stop + + steerActuatorDelay @36 :Float32; # Steering wheel actuator delay in seconds + longitudinalActuatorDelayLowerBound @61 :Float32; # Gas/Brake actuator delay in seconds, lower bound + longitudinalActuatorDelayUpperBound @58 :Float32; # Gas/Brake actuator delay in seconds, upper bound + openpilotLongitudinalControl @37 :Bool; # is openpilot doing the longitudinal control? + carVin @38 :Text; # VIN number queried during fingerprinting + dashcamOnly @41: Bool; + transmissionType @43 :TransmissionType; + carFw @44 :List(CarFw); + + radarTimeStep @45: Float32 = 0.05; # time delta between radar updates, 20Hz is very standard + fingerprintSource @49: FingerprintSource; + networkLocation @50 :NetworkLocation; # Where Panda/C2 is integrated into the car's CAN network + + wheelSpeedFactor @63 :Float32; # Multiplier on wheels speeds to computer actual speeds + + struct SafetyConfig { + safetyModel @0 :SafetyModel; + safetyParam @1 :Int16; + } + + struct LateralParams { + torqueBP @0 :List(Int32); + torqueV @1 :List(Int32); + } + + struct LateralPIDTuning { + kpBP @0 :List(Float32); + kpV @1 :List(Float32); + kiBP @2 :List(Float32); + kiV @3 :List(Float32); + kf @4 :Float32; + } + + struct LongitudinalPIDTuning { + kpBP @0 :List(Float32); + kpV @1 :List(Float32); + kiBP @2 :List(Float32); + kiV @3 :List(Float32); + deadzoneBP @4 :List(Float32); + deadzoneV @5 :List(Float32); + } + + struct LateralINDITuning { + outerLoopGainBP @4 :List(Float32); + outerLoopGainV @5 :List(Float32); + innerLoopGainBP @6 :List(Float32); + innerLoopGainV @7 :List(Float32); + timeConstantBP @8 :List(Float32); + timeConstantV @9 :List(Float32); + actuatorEffectivenessBP @10 :List(Float32); + actuatorEffectivenessV @11 :List(Float32); + + outerLoopGainDEPRECATED @0 :Float32; + innerLoopGainDEPRECATED @1 :Float32; + timeConstantDEPRECATED @2 :Float32; + actuatorEffectivenessDEPRECATED @3 :Float32; + } + + struct LateralLQRTuning { + scale @0 :Float32; + ki @1 :Float32; + dcGain @2 :Float32; + + # State space system + a @3 :List(Float32); + b @4 :List(Float32); + c @5 :List(Float32); + + k @6 :List(Float32); # LQR gain + l @7 :List(Float32); # Kalman gain + } + + enum SafetyModel { + silent @0; + hondaNidec @1; + toyota @2; + elm327 @3; + gm @4; + hondaBoschGiraffe @5; + ford @6; + cadillac @7; + hyundai @8; + chrysler @9; + tesla @10; + subaru @11; + gmPassive @12; + mazda @13; + nissan @14; + volkswagen @15; + toyotaIpas @16; + allOutput @17; + gmAscm @18; + noOutput @19; # like silent but without silent CAN TXs + hondaBosch @20; + volkswagenPq @21; + subaruLegacy @22; # pre-Global platform + hyundaiLegacy @23; + hyundaiCommunity @24; + stellantis @25; + } + + enum SteerControlType { + torque @0; + angle @1; + } + + enum TransmissionType { + unknown @0; + automatic @1; # Traditional auto, including DSG + manual @2; # True "stick shift" only + direct @3; # Electric vehicle or other direct drive + cvt @4; + } + + struct CarFw { + ecu @0 :Ecu; + fwVersion @1 :Data; + address @2: UInt32; + subAddress @3: UInt8; + } + + enum Ecu { + eps @0; + esp @1; + fwdRadar @2; + fwdCamera @3; + engine @4; + unknown @5; + transmission @8; # Transmission Control Module + srs @9; # airbag + gateway @10; # can gateway + hud @11; # heads up display + combinationMeter @12; # instrument cluster + + # Toyota only + dsu @6; + apgs @7; + + # Honda only + vsa @13; # Vehicle Stability Assist + programmedFuelInjection @14; + electricBrakeBooster @15; + shiftByWire @16; + } + + enum FingerprintSource { + can @0; + fw @1; + fixed @2; + } + + enum NetworkLocation { + fwdCamera @0; # Standard/default integration at LKAS camera + gateway @1; # Integration at vehicle's CAN gateway + } + + enableCameraDEPRECATED @4 :Bool; + isPandaBlackDEPRECATED @39 :Bool; + hasStockCameraDEPRECATED @57 :Bool; + safetyParamDEPRECATED @10 :Int16; + safetyModelDEPRECATED @9 :SafetyModel; + safetyModelPassiveDEPRECATED @42 :SafetyModel = silent; + minSpeedCanDEPRECATED @51 :Float32; + startAccelDEPRECATED @32 :Float32; + communityFeatureDEPRECATED @46: Bool; + startingAccelRateDEPRECATED @53 :Float32; +} diff --git a/cereal/gen/c/include/c++.capnp.h b/cereal/gen/c/include/c++.capnp.h new file mode 100644 index 000000000..e69de29bb diff --git a/cereal/gen/cpp/car.capnp.c++ b/cereal/gen/cpp/car.capnp.c++ new file mode 100644 index 000000000..2abbe8442 --- /dev/null +++ b/cereal/gen/cpp/car.capnp.c++ @@ -0,0 +1,5893 @@ +// Generated by Cap'n Proto compiler, DO NOT EDIT +// source: car.capnp + +#include "car.capnp.h" + +namespace capnp { +namespace schemas { +static const ::capnp::_::AlignedData<162> b_9b1657f34caf3ad3 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 211, 58, 175, 76, 243, 87, 22, 155, + 10, 0, 0, 0, 1, 0, 1, 0, + 141, 139, 175, 8, 231, 241, 42, 142, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 154, 0, 0, 0, + 29, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 255, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 69, 118, 101, + 110, 116, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 222, 39, 247, 5, 213, 197, 168, 186, + 1, 0, 0, 0, 82, 0, 0, 0, + 69, 118, 101, 110, 116, 78, 97, 109, + 101, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 0, 0, 0, 3, 0, 1, 0, + 244, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 0, 0, 0, 3, 0, 1, 0, + 248, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 0, 0, 0, 3, 0, 1, 0, + 252, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 0, 0, 0, 3, 0, 1, 0, + 0, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 0, 0, 0, 3, 0, 1, 0, + 8, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 20, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 1, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 1, 0, 0, 3, 0, 1, 0, + 16, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 21, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 1, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 1, 0, 0, 3, 0, 1, 0, + 28, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 22, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 1, 0, 0, 3, 0, 1, 0, + 36, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 1, 0, 0, 3, 0, 1, 0, + 44, 1, 0, 0, 2, 0, 1, 0, + 110, 97, 109, 101, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 222, 39, 247, 5, 213, 197, 168, 186, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 97, 98, 108, 101, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 69, 110, 116, 114, 121, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 119, 97, 114, 110, 105, 110, 103, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 115, 101, 114, 68, 105, 115, 97, + 98, 108, 101, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 111, 102, 116, 68, 105, 115, 97, + 98, 108, 101, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 109, 109, 101, 100, 105, 97, 116, + 101, 68, 105, 115, 97, 98, 108, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 101, 69, 110, 97, 98, 108, + 101, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 101, 114, 109, 97, 110, 101, 110, + 116, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9b1657f34caf3ad3 = b_9b1657f34caf3ad3.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_9b1657f34caf3ad3[] = { + &s_baa8c5d505f727de, +}; +static const uint16_t m_9b1657f34caf3ad3[] = {1, 6, 0, 2, 8, 7, 5, 4, 3}; +static const uint16_t i_9b1657f34caf3ad3[] = {0, 1, 2, 3, 4, 5, 6, 7, 8}; +const ::capnp::_::RawSchema s_9b1657f34caf3ad3 = { + 0x9b1657f34caf3ad3, b_9b1657f34caf3ad3.words, 162, d_9b1657f34caf3ad3, m_9b1657f34caf3ad3, + 1, 9, i_9b1657f34caf3ad3, nullptr, nullptr, { &s_9b1657f34caf3ad3, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<660> b_baa8c5d505f727de = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 222, 39, 247, 5, 213, 197, 168, 186, + 19, 0, 0, 0, 2, 0, 0, 0, + 211, 58, 175, 76, 243, 87, 22, 155, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 234, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 183, 10, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 69, 118, 101, + 110, 116, 46, 69, 118, 101, 110, 116, + 78, 97, 109, 101, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 200, 1, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 5, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 77, 5, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 77, 5, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 0, 0, 0, 0, + 77, 5, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 81, 5, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 77, 5, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 73, 5, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 73, 5, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 69, 5, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 65, 5, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 65, 5, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 61, 5, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 57, 5, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 53, 5, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 49, 5, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 0, 0, 0, + 45, 5, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 0, 0, 0, 0, + 45, 5, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 45, 5, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 41, 5, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 37, 5, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 0, 0, 0, 0, + 33, 5, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 33, 5, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 19, 0, 0, 0, 0, 0, 0, 0, + 33, 5, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 0, 0, 0, 0, + 33, 5, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 0, 0, 0, 0, + 29, 5, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 0, 0, 0, 0, + 25, 5, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 23, 0, 0, 0, 0, 0, 0, 0, + 21, 5, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 0, 0, 0, 0, 0, 0, 0, + 17, 5, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 0, 0, 0, 0, 0, 0, 0, + 21, 5, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 0, 0, 0, 0, + 17, 5, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 26, 0, 0, 0, 0, 0, 0, 0, + 13, 5, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 27, 0, 0, 0, 0, 0, 0, 0, + 9, 5, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 0, 0, 0, 0, 0, 0, 0, + 5, 5, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 0, 0, 0, 0, 0, 0, 0, + 1, 5, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 0, 0, 0, 0, + 1, 5, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 30, 0, 0, 0, 0, 0, 0, 0, + 253, 4, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 31, 0, 0, 0, 0, 0, 0, 0, + 1, 5, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 0, 0, 0, 0, 0, 0, 0, + 253, 4, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 0, 0, 0, 0, + 253, 4, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 34, 0, 0, 0, 0, 0, 0, 0, + 253, 4, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 0, 0, 0, 0, 0, 0, 0, + 253, 4, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 0, 0, 0, 0, 0, 0, 0, + 253, 4, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 0, 0, 0, 0, 0, 0, 0, + 1, 5, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 35, 0, 0, 0, 0, 0, 0, 0, + 5, 5, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 0, 0, 0, 0, + 5, 5, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 0, 0, 0, 0, + 9, 5, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 38, 0, 0, 0, 0, 0, 0, 0, + 9, 5, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 0, 0, 0, 0, 0, 0, 0, + 5, 5, 0, 0, 242, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 39, 0, 0, 0, 0, 0, 0, 0, + 9, 5, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 0, 0, 0, 0, 0, 0, 0, + 5, 5, 0, 0, 242, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 0, 0, 0, 0, + 9, 5, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 0, 0, 0, 0, + 9, 5, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 42, 0, 0, 0, 0, 0, 0, 0, + 5, 5, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 43, 0, 0, 0, 0, 0, 0, 0, + 5, 5, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 0, 0, 0, 0, 0, 0, 0, + 1, 5, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 0, 0, 0, 0, + 253, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 46, 0, 0, 0, 0, 0, 0, 0, + 249, 4, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 47, 0, 0, 0, 0, 0, 0, 0, + 249, 4, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 0, 0, 0, 0, 0, 0, 0, + 249, 4, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 0, 0, 0, 0, + 249, 4, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 0, 0, 0, 0, + 245, 4, 0, 0, 250, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 106, 0, 0, 0, 0, 0, 0, 0, + 249, 4, 0, 0, 42, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 0, 0, 0, 0, 0, 0, 0, + 1, 5, 0, 0, 42, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 9, 5, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 51, 0, 0, 0, 0, 0, 0, 0, + 5, 5, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 0, 0, 0, 0, 0, 0, 0, + 1, 5, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 0, 0, 0, 0, + 249, 4, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 94, 0, 0, 0, 0, 0, 0, 0, + 245, 4, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 95, 0, 0, 0, 0, 0, 0, 0, + 249, 4, 0, 0, 242, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 54, 0, 0, 0, 0, 0, 0, 0, + 253, 4, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 55, 0, 0, 0, 0, 0, 0, 0, + 253, 4, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 0, 0, 0, 0, 0, 0, 0, + 249, 4, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 0, 0, 0, 0, 0, 0, 0, + 249, 4, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 58, 0, 0, 0, 0, 0, 0, 0, + 249, 4, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 59, 0, 0, 0, 0, 0, 0, 0, + 245, 4, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 0, 0, 0, 0, 0, 0, 0, + 241, 4, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 0, 0, 0, 0, + 233, 4, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 62, 0, 0, 0, 0, 0, 0, 0, + 229, 4, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 63, 0, 0, 0, 0, 0, 0, 0, + 229, 4, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 0, 0, 0, 0, + 225, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 66, 0, 0, 0, 0, 0, 0, 0, + 217, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 0, 0, 0, 0, 0, 0, 0, + 213, 4, 0, 0, 2, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 0, 0, 0, 0, 0, 0, 0, + 217, 4, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 0, 0, 0, 0, 0, 0, 0, + 221, 4, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 67, 0, 0, 0, 0, 0, 0, 0, + 225, 4, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 0, 0, 0, 0, 0, 0, + 225, 4, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 0, 0, 0, 0, + 217, 4, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 0, 0, 0, 0, + 221, 4, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 0, 0, 0, 0, 0, 0, 0, + 217, 4, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 70, 0, 0, 0, 0, 0, 0, 0, + 221, 4, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 71, 0, 0, 0, 0, 0, 0, 0, + 217, 4, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 0, 0, 0, 0, 0, 0, 0, + 213, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 0, 0, 0, 0, + 209, 4, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 0, 0, 0, 0, 0, 0, 0, + 209, 4, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 74, 0, 0, 0, 0, 0, 0, 0, + 213, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 75, 0, 0, 0, 0, 0, 0, 0, + 209, 4, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 0, 0, 0, 0, 0, 0, 0, + 209, 4, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 0, 0, 0, 0, + 205, 4, 0, 0, 18, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 0, 0, 0, 0, + 213, 4, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 78, 0, 0, 0, 0, 0, 0, 0, + 213, 4, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 79, 0, 0, 0, 0, 0, 0, 0, + 209, 4, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 0, 0, 0, 0, 0, 0, 0, + 205, 4, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 0, 0, 0, 0, 0, 0, 0, + 205, 4, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 82, 0, 0, 0, 0, 0, 0, 0, + 205, 4, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, + 205, 4, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 83, 0, 0, 0, 0, 0, 0, 0, + 201, 4, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 0, 0, 0, 0, 0, 0, 0, + 197, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 0, 0, 0, 0, 0, 0, 0, + 193, 4, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 86, 0, 0, 0, 0, 0, 0, 0, + 189, 4, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 87, 0, 0, 0, 0, 0, 0, 0, + 185, 4, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 0, 0, 0, 0, 0, 0, 0, + 181, 4, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 0, 0, 0, 0, 0, 0, 0, + 177, 4, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 90, 0, 0, 0, 0, 0, 0, 0, + 173, 4, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 91, 0, 0, 0, 0, 0, 0, 0, + 169, 4, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 69, 114, 114, 111, 114, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 85, 110, 97, + 118, 97, 105, 108, 97, 98, 108, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 85, 110, 97, + 118, 97, 105, 108, 97, 98, 108, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 115, 85, 110, 97, 118, 97, + 105, 108, 97, 98, 108, 101, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 119, 114, 111, 110, 103, 71, 101, 97, + 114, 0, 0, 0, 0, 0, 0, 0, + 100, 111, 111, 114, 79, 112, 101, 110, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 97, 116, 98, 101, 108, 116, + 78, 111, 116, 76, 97, 116, 99, 104, + 101, 100, 0, 0, 0, 0, 0, 0, + 101, 115, 112, 68, 105, 115, 97, 98, + 108, 101, 100, 0, 0, 0, 0, 0, + 119, 114, 111, 110, 103, 67, 97, 114, + 77, 111, 100, 101, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 84, 101, 109, + 112, 85, 110, 97, 118, 97, 105, 108, + 97, 98, 108, 101, 0, 0, 0, 0, + 114, 101, 118, 101, 114, 115, 101, 71, + 101, 97, 114, 0, 0, 0, 0, 0, + 98, 117, 116, 116, 111, 110, 67, 97, + 110, 99, 101, 108, 0, 0, 0, 0, + 98, 117, 116, 116, 111, 110, 69, 110, + 97, 98, 108, 101, 0, 0, 0, 0, + 112, 101, 100, 97, 108, 80, 114, 101, + 115, 115, 101, 100, 0, 0, 0, 0, + 99, 114, 117, 105, 115, 101, 68, 105, + 115, 97, 98, 108, 101, 100, 0, 0, + 114, 97, 100, 97, 114, 67, 97, 110, + 69, 114, 114, 111, 114, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 100, 97, 116, 97, 78, 101, 101, 100, + 101, 100, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 84, 111, 111, + 76, 111, 119, 0, 0, 0, 0, 0, + 111, 117, 116, 79, 102, 83, 112, 97, + 99, 101, 0, 0, 0, 0, 0, 0, + 111, 118, 101, 114, 104, 101, 97, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 108, 105, 98, 114, 97, 116, + 105, 111, 110, 73, 110, 99, 111, 109, + 112, 108, 101, 116, 101, 0, 0, 0, + 99, 97, 108, 105, 98, 114, 97, 116, + 105, 111, 110, 73, 110, 118, 97, 108, + 105, 100, 0, 0, 0, 0, 0, 0, + 99, 111, 110, 116, 114, 111, 108, 115, + 77, 105, 115, 109, 97, 116, 99, 104, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 99, 109, 69, 110, 97, 98, 108, + 101, 0, 0, 0, 0, 0, 0, 0, + 112, 99, 109, 68, 105, 115, 97, 98, + 108, 101, 0, 0, 0, 0, 0, 0, + 110, 111, 84, 97, 114, 103, 101, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 100, 97, 114, 70, 97, 117, + 108, 116, 0, 0, 0, 0, 0, 0, + 109, 111, 100, 101, 108, 67, 111, 109, + 109, 73, 115, 115, 117, 101, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 72, 111, 108, + 100, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 114, 107, 66, 114, 97, 107, + 101, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 110, 117, 97, 108, 82, 101, + 115, 116, 97, 114, 116, 0, 0, 0, + 108, 111, 119, 83, 112, 101, 101, 100, + 76, 111, 99, 107, 111, 117, 116, 0, + 112, 108, 97, 110, 110, 101, 114, 69, + 114, 114, 111, 114, 0, 0, 0, 0, + 105, 112, 97, 115, 79, 118, 101, 114, + 114, 105, 100, 101, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 106, 111, 121, 115, 116, 105, 99, 107, + 68, 101, 98, 117, 103, 0, 0, 0, + 115, 116, 101, 101, 114, 84, 101, 109, + 112, 85, 110, 97, 118, 97, 105, 108, + 97, 98, 108, 101, 83, 105, 108, 101, + 110, 116, 0, 0, 0, 0, 0, 0, + 114, 101, 115, 117, 109, 101, 82, 101, + 113, 117, 105, 114, 101, 100, 0, 0, + 112, 114, 101, 68, 114, 105, 118, 101, + 114, 68, 105, 115, 116, 114, 97, 99, + 116, 101, 100, 0, 0, 0, 0, 0, + 112, 114, 111, 109, 112, 116, 68, 114, + 105, 118, 101, 114, 68, 105, 115, 116, + 114, 97, 99, 116, 101, 100, 0, 0, + 100, 114, 105, 118, 101, 114, 68, 105, + 115, 116, 114, 97, 99, 116, 101, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 101, 111, 102, 101, 110, 99, 101, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 100, 114, 105, 118, 101, 114, 77, 111, + 110, 105, 116, 111, 114, 79, 110, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 100, 114, 105, 118, 101, 114, 77, 111, + 110, 105, 116, 111, 114, 79, 102, 102, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 112, 114, 101, 68, 114, 105, 118, 101, + 114, 85, 110, 114, 101, 115, 112, 111, + 110, 115, 105, 118, 101, 0, 0, 0, + 112, 114, 111, 109, 112, 116, 68, 114, + 105, 118, 101, 114, 85, 110, 114, 101, + 115, 112, 111, 110, 115, 105, 118, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 114, 105, 118, 101, 114, 85, 110, + 114, 101, 115, 112, 111, 110, 115, 105, + 118, 101, 0, 0, 0, 0, 0, 0, + 98, 101, 108, 111, 119, 83, 116, 101, + 101, 114, 83, 112, 101, 101, 100, 0, + 99, 97, 108, 105, 98, 114, 97, 116, + 105, 111, 110, 80, 114, 111, 103, 114, + 101, 115, 115, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 108, 111, 119, 66, 97, 116, 116, 101, + 114, 121, 0, 0, 0, 0, 0, 0, + 105, 110, 118, 97, 108, 105, 100, 71, + 105, 114, 97, 102, 102, 101, 72, 111, + 110, 100, 97, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 118, 101, 104, 105, 99, 108, 101, 77, + 111, 100, 101, 108, 73, 110, 118, 97, + 108, 105, 100, 0, 0, 0, 0, 0, + 97, 99, 99, 70, 97, 117, 108, 116, + 101, 100, 0, 0, 0, 0, 0, 0, + 115, 101, 110, 115, 111, 114, 68, 97, + 116, 97, 73, 110, 118, 97, 108, 105, + 100, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 109, 109, 73, 115, 115, 117, + 101, 0, 0, 0, 0, 0, 0, 0, + 116, 111, 111, 68, 105, 115, 116, 114, + 97, 99, 116, 101, 100, 0, 0, 0, + 112, 111, 115, 101, 110, 101, 116, 73, + 110, 118, 97, 108, 105, 100, 0, 0, + 115, 111, 117, 110, 100, 115, 85, 110, + 97, 118, 97, 105, 108, 97, 98, 108, + 101, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 101, 76, 97, 110, 101, 67, + 104, 97, 110, 103, 101, 76, 101, 102, + 116, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 101, 76, 97, 110, 101, 67, + 104, 97, 110, 103, 101, 82, 105, 103, + 104, 116, 0, 0, 0, 0, 0, 0, + 108, 97, 110, 101, 67, 104, 97, 110, + 103, 101, 0, 0, 0, 0, 0, 0, + 105, 110, 118, 97, 108, 105, 100, 71, + 105, 114, 97, 102, 102, 101, 84, 111, + 121, 111, 116, 97, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 105, 110, 116, 101, 114, 110, 101, 116, + 67, 111, 110, 110, 101, 99, 116, 105, + 118, 105, 116, 121, 78, 101, 101, 100, + 101, 100, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 99, 111, 109, 109, 117, 110, 105, 116, + 121, 70, 101, 97, 116, 117, 114, 101, + 68, 105, 115, 97, 108, 108, 111, 119, + 101, 100, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 108, 111, 119, 77, 101, 109, 111, 114, + 121, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 111, 99, 107, 65, 101, 98, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 100, 119, 0, 0, 0, 0, 0, + 99, 97, 114, 85, 110, 114, 101, 99, + 111, 103, 110, 105, 122, 101, 100, 0, + 114, 97, 100, 97, 114, 67, 111, 109, + 109, 73, 115, 115, 117, 101, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 114, 105, 118, 101, 114, 77, 111, + 110, 105, 116, 111, 114, 76, 111, 119, + 65, 99, 99, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 105, 110, 118, 97, 108, 105, 100, 76, + 107, 97, 115, 83, 101, 116, 116, 105, + 110, 103, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 84, 111, 111, + 72, 105, 103, 104, 0, 0, 0, 0, + 108, 97, 110, 101, 67, 104, 97, 110, + 103, 101, 66, 108, 111, 99, 107, 101, + 100, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 108, 97, 121, 77, 97, 108, + 102, 117, 110, 99, 116, 105, 111, 110, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 115, 80, 114, 101, 115, 115, + 101, 100, 0, 0, 0, 0, 0, 0, + 115, 116, 111, 99, 107, 70, 99, 119, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 114, 116, 117, 112, 0, + 115, 116, 97, 114, 116, 117, 112, 78, + 111, 67, 97, 114, 0, 0, 0, 0, + 115, 116, 97, 114, 116, 117, 112, 78, + 111, 67, 111, 110, 116, 114, 111, 108, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 114, 116, 117, 112, 77, + 97, 115, 116, 101, 114, 0, 0, 0, + 102, 99, 119, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 83, 97, 116, + 117, 114, 97, 116, 101, 100, 0, 0, + 119, 104, 105, 116, 101, 80, 97, 110, + 100, 97, 85, 110, 115, 117, 112, 112, + 111, 114, 116, 101, 100, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 115, 116, 97, 114, 116, 117, 112, 79, + 110, 101, 112, 108, 117, 115, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 109, 109, 73, 115, 115, 117, + 101, 87, 97, 114, 110, 105, 110, 103, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 98, 101, 108, 111, 119, 69, 110, 103, + 97, 103, 101, 83, 112, 101, 101, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 71, 112, 115, 0, 0, 0, + 102, 111, 99, 117, 115, 82, 101, 99, + 111, 118, 101, 114, 65, 99, 116, 105, + 118, 101, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 119, 114, 111, 110, 103, 67, 114, 117, + 105, 115, 101, 77, 111, 100, 101, 0, + 110, 101, 111, 115, 85, 112, 100, 97, + 116, 101, 82, 101, 113, 117, 105, 114, + 101, 100, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 109, 111, 100, 101, 108, 100, 76, 97, + 103, 103, 105, 110, 103, 0, 0, 0, + 100, 101, 118, 105, 99, 101, 70, 97, + 108, 108, 105, 110, 103, 0, 0, 0, + 102, 97, 110, 77, 97, 108, 102, 117, + 110, 99, 116, 105, 111, 110, 0, 0, + 99, 97, 109, 101, 114, 97, 77, 97, + 108, 102, 117, 110, 99, 116, 105, 111, + 110, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 100, 101, 108, 76, 97, 103, + 87, 97, 114, 110, 105, 110, 103, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 77, 97, 108, 102, 117, + 110, 99, 116, 105, 111, 110, 0, 0, + 112, 114, 111, 99, 101, 115, 115, 78, + 111, 116, 82, 117, 110, 110, 105, 110, + 103, 0, 0, 0, 0, 0, 0, 0, + 100, 97, 115, 104, 99, 97, 109, 77, + 111, 100, 101, 0, 0, 0, 0, 0, + 115, 116, 97, 114, 116, 117, 112, 70, + 117, 122, 122, 121, 70, 105, 110, 103, + 101, 114, 112, 114, 105, 110, 116, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 110, 116, 114, 111, 108, 115, + 73, 110, 105, 116, 105, 97, 108, 105, + 122, 105, 110, 103, 0, 0, 0, 0, + 117, 115, 98, 69, 114, 114, 111, 114, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 97, 100, 67, 97, 109, 101, + 114, 97, 69, 114, 114, 111, 114, 0, + 100, 114, 105, 118, 101, 114, 67, 97, + 109, 101, 114, 97, 69, 114, 114, 111, + 114, 0, 0, 0, 0, 0, 0, 0, + 119, 105, 100, 101, 82, 111, 97, 100, + 67, 97, 109, 101, 114, 97, 69, 114, + 114, 111, 114, 0, 0, 0, 0, 0, + 108, 111, 99, 97, 108, 105, 122, 101, + 114, 77, 97, 108, 102, 117, 110, 99, + 116, 105, 111, 110, 0, 0, 0, 0, + 115, 116, 97, 114, 116, 117, 112, 78, + 111, 70, 119, 0, 0, 0, 0, 0, + 104, 105, 103, 104, 67, 112, 117, 85, + 115, 97, 103, 101, 0, 0, 0, 0, + 99, 114, 117, 105, 115, 101, 77, 105, + 115, 109, 97, 116, 99, 104, 0, 0, + 108, 107, 97, 115, 68, 105, 115, 97, + 98, 108, 101, 100, 0, 0, 0, 0, + 112, 99, 99, 69, 110, 97, 98, 108, + 101, 100, 0, 0, 0, 0, 0, 0, + 112, 99, 99, 68, 105, 115, 97, 98, + 108, 101, 100, 0, 0, 0, 0, 0, + 112, 99, 99, 69, 114, 114, 111, 114, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 69, 110, 97, 98, 108, + 101, 100, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 68, 105, 115, 97, 98, + 108, 101, 100, 0, 0, 0, 0, 0, + 105, 66, 111, 111, 115, 116, 101, 114, + 66, 114, 97, 107, 101, 78, 111, 116, + 79, 107, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_baa8c5d505f727de = b_baa8c5d505f727de.words; +#if !CAPNP_LITE +static const uint16_t m_baa8c5d505f727de[] = {112, 111, 51, 84, 46, 28, 2, 11, 12, 20, 21, 47, 92, 0, 66, 53, 83, 62, 98, 22, 14, 106, 96, 16, 90, 5, 101, 39, 68, 42, 41, 45, 7, 91, 79, 86, 73, 3, 40, 94, 105, 113, 61, 49, 60, 69, 33, 34, 59, 71, 65, 107, 103, 48, 63, 31, 30, 27, 93, 89, 88, 85, 25, 18, 19, 29, 109, 108, 110, 24, 23, 13, 32, 55, 37, 43, 57, 58, 95, 38, 44, 15, 67, 26, 72, 36, 10, 100, 6, 52, 56, 70, 17, 75, 97, 78, 76, 77, 104, 82, 80, 9, 35, 1, 64, 74, 54, 99, 50, 81, 102, 8, 87, 4}; +const ::capnp::_::RawSchema s_baa8c5d505f727de = { + 0xbaa8c5d505f727de, b_baa8c5d505f727de.words, 660, nullptr, m_baa8c5d505f727de, + 0, 114, nullptr, nullptr, nullptr, { &s_baa8c5d505f727de, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(EventName_baa8c5d505f727de, baa8c5d505f727de); +static const ::capnp::_::AlignedData<673> b_9da4fa09e052903c = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 60, 144, 82, 224, 9, 250, 164, 157, + 10, 0, 0, 0, 1, 0, 7, 0, + 141, 139, 175, 8, 231, 241, 42, 142, + 6, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 154, 0, 0, 0, + 29, 0, 0, 0, 71, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 0, 0, 0, 143, 8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 83, 116, 97, + 116, 101, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 1, 0, 1, 0, + 163, 53, 89, 21, 166, 55, 26, 153, + 25, 0, 0, 0, 98, 0, 0, 0, + 175, 96, 110, 142, 71, 129, 78, 230, + 25, 0, 0, 0, 98, 0, 0, 0, + 137, 106, 111, 19, 69, 202, 4, 224, + 25, 0, 0, 0, 98, 0, 0, 0, + 246, 206, 74, 91, 131, 166, 92, 255, + 25, 0, 0, 0, 98, 0, 0, 0, + 87, 104, 101, 101, 108, 83, 112, 101, + 101, 100, 115, 0, 0, 0, 0, 0, + 67, 114, 117, 105, 115, 101, 83, 116, + 97, 116, 101, 0, 0, 0, 0, 0, + 71, 101, 97, 114, 83, 104, 105, 102, + 116, 101, 114, 0, 0, 0, 0, 0, + 66, 117, 116, 116, 111, 110, 69, 118, + 101, 110, 116, 0, 0, 0, 0, 0, + 156, 0, 0, 0, 3, 0, 4, 0, + 37, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 4, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 4, 0, 0, 3, 0, 1, 0, + 84, 4, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 4, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 4, 0, 0, 3, 0, 1, 0, + 88, 4, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 4, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 4, 0, 0, 3, 0, 1, 0, + 96, 4, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 4, 0, 0, 3, 0, 1, 0, + 100, 4, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 64, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 4, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 4, 0, 0, 3, 0, 1, 0, + 108, 4, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 4, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 4, 0, 0, 3, 0, 1, 0, + 112, 4, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 65, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 4, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 4, 0, 0, 3, 0, 1, 0, + 120, 4, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 4, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 4, 0, 0, 3, 0, 1, 0, + 132, 4, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 4, 0, 0, 3, 0, 1, 0, + 140, 4, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 4, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 4, 0, 0, 3, 0, 1, 0, + 148, 4, 0, 0, 2, 0, 1, 0, + 24, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 4, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 4, 0, 0, 3, 0, 1, 0, + 156, 4, 0, 0, 2, 0, 1, 0, + 26, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 4, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 4, 0, 0, 3, 0, 1, 0, + 180, 4, 0, 0, 2, 0, 1, 0, + 34, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 4, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 4, 0, 0, 3, 0, 1, 0, + 204, 4, 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 4, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 4, 0, 0, 3, 0, 1, 0, + 224, 4, 0, 0, 2, 0, 1, 0, + 25, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 4, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 4, 0, 0, 3, 0, 1, 0, + 232, 4, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 4, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 4, 0, 0, 3, 0, 1, 0, + 240, 4, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 4, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 4, 0, 0, 3, 0, 1, 0, + 244, 4, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 4, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 4, 0, 0, 3, 0, 1, 0, + 248, 4, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 67, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 4, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 4, 0, 0, 3, 0, 1, 0, + 0, 5, 0, 0, 2, 0, 1, 0, + 38, 0, 0, 0, 68, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 4, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 5, 0, 0, 3, 0, 1, 0, + 12, 5, 0, 0, 2, 0, 1, 0, + 27, 0, 0, 0, 69, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 5, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 5, 0, 0, 3, 0, 1, 0, + 20, 5, 0, 0, 2, 0, 1, 0, + 28, 0, 0, 0, 70, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 5, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 5, 0, 0, 3, 0, 1, 0, + 28, 5, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 5, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 5, 0, 0, 3, 0, 1, 0, + 32, 5, 0, 0, 2, 0, 1, 0, + 29, 0, 0, 0, 71, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 5, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 5, 0, 0, 3, 0, 1, 0, + 40, 5, 0, 0, 2, 0, 1, 0, + 30, 0, 0, 0, 72, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 5, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 5, 0, 0, 3, 0, 1, 0, + 48, 5, 0, 0, 2, 0, 1, 0, + 31, 0, 0, 0, 73, 0, 0, 0, + 0, 0, 1, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 5, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 5, 0, 0, 3, 0, 1, 0, + 60, 5, 0, 0, 2, 0, 1, 0, + 32, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 1, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 5, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 5, 0, 0, 3, 0, 1, 0, + 68, 5, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 5, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 5, 0, 0, 3, 0, 1, 0, + 80, 5, 0, 0, 2, 0, 1, 0, + 33, 0, 0, 0, 75, 0, 0, 0, + 0, 0, 1, 0, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 5, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 5, 0, 0, 3, 0, 1, 0, + 88, 5, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 76, 0, 0, 0, + 0, 0, 1, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 5, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 5, 0, 0, 3, 0, 1, 0, + 100, 5, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 77, 0, 0, 0, + 0, 0, 1, 0, 30, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 5, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 5, 0, 0, 3, 0, 1, 0, + 108, 5, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 78, 0, 0, 0, + 0, 0, 1, 0, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 5, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 5, 0, 0, 3, 0, 1, 0, + 116, 5, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 79, 0, 0, 0, + 0, 0, 1, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 5, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 5, 0, 0, 3, 0, 1, 0, + 124, 5, 0, 0, 2, 0, 1, 0, + 35, 0, 0, 0, 96, 1, 0, 0, + 0, 0, 1, 0, 33, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 5, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 5, 0, 0, 3, 0, 1, 0, + 132, 5, 0, 0, 2, 0, 1, 0, + 36, 0, 0, 0, 97, 1, 0, 0, + 0, 0, 1, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 5, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 5, 0, 0, 3, 0, 1, 0, + 140, 5, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 98, 1, 0, 0, + 0, 0, 1, 0, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 5, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 5, 0, 0, 3, 0, 1, 0, + 148, 5, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 99, 1, 0, 0, + 0, 0, 1, 0, 36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 5, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 5, 0, 0, 3, 0, 1, 0, + 156, 5, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 5, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 5, 0, 0, 3, 0, 1, 0, + 168, 5, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 100, 1, 0, 0, + 0, 0, 1, 0, 38, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 5, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 5, 0, 0, 3, 0, 1, 0, + 176, 5, 0, 0, 2, 0, 1, 0, + 101, 114, 114, 111, 114, 115, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 222, 39, 247, 5, 213, 197, 168, 186, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 69, 103, 111, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 119, 104, 101, 101, 108, 83, 112, 101, + 101, 100, 115, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 163, 53, 89, 21, 166, 55, 26, 153, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 115, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 115, 80, 114, 101, 115, 115, + 101, 100, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 80, 114, 101, + 115, 115, 101, 100, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 110, 103, 108, 101, 68, 101, 103, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 84, 111, 114, 113, 117, 101, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 80, 114, 101, 115, 115, 101, 100, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 114, 117, 105, 115, 101, 83, 116, + 97, 116, 101, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 175, 96, 110, 142, 71, 129, 78, 230, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 117, 116, 116, 111, 110, 69, 118, + 101, 110, 116, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 246, 206, 74, 91, 131, 166, 92, 255, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 77, 111, 110, 111, 84, + 105, 109, 101, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 118, 101, 110, 116, 115, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 211, 58, 175, 76, 243, 87, 22, 155, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 101, 97, 114, 83, 104, 105, 102, + 116, 101, 114, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 137, 106, 111, 19, 69, 202, 4, 224, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 82, 97, 116, 101, 68, 101, 103, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 69, 103, 111, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 69, 103, 111, 82, 97, 119, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 110, 100, 115, 116, 105, + 108, 108, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 76, 105, 103, + 104, 116, 115, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 102, 116, 66, 108, 105, 110, + 107, 101, 114, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 105, 103, 104, 116, 66, 108, 105, + 110, 107, 101, 114, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 97, 119, 82, 97, 116, 101, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 101, 110, 101, 114, 105, 99, 84, + 111, 103, 103, 108, 101, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 111, 111, 114, 79, 112, 101, 110, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 97, 116, 98, 101, 108, 116, + 85, 110, 108, 97, 116, 99, 104, 101, + 100, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 86, 97, 108, 105, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 84, 111, 114, 113, 117, 101, 69, 112, + 115, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 108, 117, 116, 99, 104, 80, 114, + 101, 115, 115, 101, 100, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 82, 97, 116, 101, 76, 105, 109, 105, + 116, 101, 100, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 111, 99, 107, 65, 101, 98, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 111, 99, 107, 70, 99, 119, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 115, 112, 68, 105, 115, 97, 98, + 108, 101, 100, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 102, 116, 66, 108, 105, 110, + 100, 115, 112, 111, 116, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 105, 103, 104, 116, 66, 108, 105, + 110, 100, 115, 112, 111, 116, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 87, 97, 114, + 110, 105, 110, 103, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 69, 114, 114, + 111, 114, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 110, 103, 108, 101, 79, 102, 102, + 115, 101, 116, 68, 101, 103, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 72, 111, 108, + 100, 65, 99, 116, 105, 118, 101, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9da4fa09e052903c = b_9da4fa09e052903c.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_9da4fa09e052903c[] = { + &s_991a37a6155935a3, + &s_9b1657f34caf3ad3, + &s_baa8c5d505f727de, + &s_e004ca45136f6a89, + &s_e64e81478e6e60af, + &s_ff5ca6835b4acef6, +}; +static const uint16_t m_9da4fa09e052903c[] = {16, 5, 38, 19, 6, 11, 12, 26, 28, 10, 24, 0, 32, 13, 3, 4, 14, 23, 33, 20, 34, 21, 25, 18, 36, 35, 7, 37, 9, 15, 29, 8, 27, 30, 31, 1, 17, 2, 22}; +static const uint16_t i_9da4fa09e052903c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38}; +const ::capnp::_::RawSchema s_9da4fa09e052903c = { + 0x9da4fa09e052903c, b_9da4fa09e052903c.words, 673, d_9da4fa09e052903c, m_9da4fa09e052903c, + 6, 39, i_9da4fa09e052903c, nullptr, nullptr, { &s_9da4fa09e052903c, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<78> b_991a37a6155935a3 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 163, 53, 89, 21, 166, 55, 26, 153, + 19, 0, 0, 0, 1, 0, 2, 0, + 60, 144, 82, 224, 9, 250, 164, 157, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 83, 116, 97, + 116, 101, 46, 87, 104, 101, 101, 108, + 83, 112, 101, 101, 100, 115, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 3, 0, 1, 0, + 104, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 3, 0, 1, 0, + 108, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 0, 0, 0, 3, 0, 1, 0, + 112, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 0, 0, 0, 3, 0, 1, 0, + 116, 0, 0, 0, 2, 0, 1, 0, + 102, 108, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 108, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 114, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_991a37a6155935a3 = b_991a37a6155935a3.words; +#if !CAPNP_LITE +static const uint16_t m_991a37a6155935a3[] = {0, 1, 2, 3}; +static const uint16_t i_991a37a6155935a3[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_991a37a6155935a3 = { + 0x991a37a6155935a3, b_991a37a6155935a3.words, 78, nullptr, m_991a37a6155935a3, + 0, 4, i_991a37a6155935a3, nullptr, nullptr, { &s_991a37a6155935a3, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<112> b_e64e81478e6e60af = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 175, 96, 110, 142, 71, 129, 78, 230, + 19, 0, 0, 0, 1, 0, 2, 0, + 60, 144, 82, 224, 9, 250, 164, 157, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 87, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 83, 116, 97, + 116, 101, 46, 67, 114, 117, 105, 115, + 101, 83, 116, 97, 116, 101, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 24, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 0, 0, 0, 3, 0, 1, 0, + 160, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 3, 0, 1, 0, + 172, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 0, 0, 0, 3, 0, 1, 0, + 180, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 3, 0, 1, 0, + 188, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 0, 0, 0, 3, 0, 1, 0, + 196, 0, 0, 0, 2, 0, 1, 0, + 101, 110, 97, 98, 108, 101, 100, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 118, 97, 105, 108, 97, 98, 108, + 101, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 79, 102, 102, + 115, 101, 116, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 110, 100, 115, 116, 105, + 108, 108, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 110, 65, 100, 97, 112, 116, + 105, 118, 101, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e64e81478e6e60af = b_e64e81478e6e60af.words; +#if !CAPNP_LITE +static const uint16_t m_e64e81478e6e60af[] = {2, 0, 5, 1, 3, 4}; +static const uint16_t i_e64e81478e6e60af[] = {0, 1, 2, 3, 4, 5}; +const ::capnp::_::RawSchema s_e64e81478e6e60af = { + 0xe64e81478e6e60af, b_e64e81478e6e60af.words, 112, nullptr, m_e64e81478e6e60af, + 0, 6, i_e64e81478e6e60af, nullptr, nullptr, { &s_e64e81478e6e60af, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<59> b_e004ca45136f6a89 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 137, 106, 111, 19, 69, 202, 4, 224, + 19, 0, 0, 0, 2, 0, 0, 0, + 60, 144, 82, 224, 9, 250, 164, 157, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 247, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 83, 116, 97, + 116, 101, 46, 71, 101, 97, 114, 83, + 104, 105, 102, 116, 101, 114, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 40, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 89, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 81, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 57, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 111, 119, 110, 0, + 112, 97, 114, 107, 0, 0, 0, 0, + 100, 114, 105, 118, 101, 0, 0, 0, + 110, 101, 117, 116, 114, 97, 108, 0, + 114, 101, 118, 101, 114, 115, 101, 0, + 115, 112, 111, 114, 116, 0, 0, 0, + 108, 111, 119, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 0, 0, 0, + 101, 99, 111, 0, 0, 0, 0, 0, + 109, 97, 110, 117, 109, 97, 116, 105, + 99, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e004ca45136f6a89 = b_e004ca45136f6a89.words; +#if !CAPNP_LITE +static const uint16_t m_e004ca45136f6a89[] = {7, 2, 8, 6, 9, 3, 1, 4, 5, 0}; +const ::capnp::_::RawSchema s_e004ca45136f6a89 = { + 0xe004ca45136f6a89, b_e004ca45136f6a89.words, 59, nullptr, m_e004ca45136f6a89, + 0, 10, nullptr, nullptr, nullptr, { &s_e004ca45136f6a89, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(GearShifter_e004ca45136f6a89, e004ca45136f6a89); +static const ::capnp::_::AlignedData<51> b_ff5ca6835b4acef6 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 246, 206, 74, 91, 131, 166, 92, 255, + 19, 0, 0, 0, 1, 0, 1, 0, + 60, 144, 82, 224, 9, 250, 164, 157, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 83, 116, 97, + 116, 101, 46, 66, 117, 116, 116, 111, + 110, 69, 118, 101, 110, 116, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 124, 113, 20, 84, 32, 0, 97, 225, + 1, 0, 0, 0, 42, 0, 0, 0, + 84, 121, 112, 101, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 1, 0, + 48, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 112, 114, 101, 115, 115, 101, 100, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 121, 112, 101, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 124, 113, 20, 84, 32, 0, 97, 225, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_ff5ca6835b4acef6 = b_ff5ca6835b4acef6.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_ff5ca6835b4acef6[] = { + &s_e16100205414717c, +}; +static const uint16_t m_ff5ca6835b4acef6[] = {0, 1}; +static const uint16_t i_ff5ca6835b4acef6[] = {0, 1}; +const ::capnp::_::RawSchema s_ff5ca6835b4acef6 = { + 0xff5ca6835b4acef6, b_ff5ca6835b4acef6.words, 51, d_ff5ca6835b4acef6, m_ff5ca6835b4acef6, + 1, 2, i_ff5ca6835b4acef6, nullptr, nullptr, { &s_ff5ca6835b4acef6, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<77> b_e16100205414717c = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 124, 113, 20, 84, 32, 0, 97, 225, + 31, 0, 0, 0, 2, 0, 0, 0, + 246, 206, 74, 91, 131, 166, 92, 255, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 34, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 39, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 83, 116, 97, + 116, 101, 46, 66, 117, 116, 116, 111, + 110, 69, 118, 101, 110, 116, 46, 84, + 121, 112, 101, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 48, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 129, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 117, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 101, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 93, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 89, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 85, 0, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 111, 119, 110, 0, + 108, 101, 102, 116, 66, 108, 105, 110, + 107, 101, 114, 0, 0, 0, 0, 0, + 114, 105, 103, 104, 116, 66, 108, 105, + 110, 107, 101, 114, 0, 0, 0, 0, + 97, 99, 99, 101, 108, 67, 114, 117, + 105, 115, 101, 0, 0, 0, 0, 0, + 100, 101, 99, 101, 108, 67, 114, 117, + 105, 115, 101, 0, 0, 0, 0, 0, + 99, 97, 110, 99, 101, 108, 0, 0, + 97, 108, 116, 66, 117, 116, 116, 111, + 110, 49, 0, 0, 0, 0, 0, 0, + 97, 108, 116, 66, 117, 116, 116, 111, + 110, 50, 0, 0, 0, 0, 0, 0, + 97, 108, 116, 66, 117, 116, 116, 111, + 110, 51, 0, 0, 0, 0, 0, 0, + 115, 101, 116, 67, 114, 117, 105, 115, + 101, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 115, 117, 109, 101, 67, 114, + 117, 105, 115, 101, 0, 0, 0, 0, + 103, 97, 112, 65, 100, 106, 117, 115, + 116, 67, 114, 117, 105, 115, 101, 0, } +}; +::capnp::word const* const bp_e16100205414717c = b_e16100205414717c.words; +#if !CAPNP_LITE +static const uint16_t m_e16100205414717c[] = {3, 6, 7, 8, 5, 4, 11, 1, 10, 2, 9, 0}; +const ::capnp::_::RawSchema s_e16100205414717c = { + 0xe16100205414717c, b_e16100205414717c.words, 77, nullptr, m_e16100205414717c, + 0, 12, nullptr, nullptr, nullptr, { &s_e16100205414717c, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(Type_e16100205414717c, e16100205414717c); +static const ::capnp::_::AlignedData<82> b_888ad6581cf0aacb = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 203, 170, 240, 28, 88, 214, 138, 136, + 10, 0, 0, 0, 1, 0, 0, 0, + 141, 139, 175, 8, 231, 241, 42, 142, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 162, 0, 0, 0, + 29, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 82, 97, 100, 97, 114, 68, + 97, 116, 97, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 173, 118, 186, 235, 121, 102, 168, 232, + 9, 0, 0, 0, 50, 0, 0, 0, + 54, 223, 31, 172, 235, 51, 243, 143, + 5, 0, 0, 0, 90, 0, 0, 0, + 69, 114, 114, 111, 114, 0, 0, 0, + 82, 97, 100, 97, 114, 80, 111, 105, + 110, 116, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 3, 0, 1, 0, + 92, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 0, 0, 0, 3, 0, 1, 0, + 112, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 0, 0, 0, 3, 0, 1, 0, + 136, 0, 0, 0, 2, 0, 1, 0, + 101, 114, 114, 111, 114, 115, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 173, 118, 186, 235, 121, 102, 168, 232, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 105, 110, 116, 115, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 54, 223, 31, 172, 235, 51, 243, 143, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 77, 111, 110, 111, 84, + 105, 109, 101, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_888ad6581cf0aacb = b_888ad6581cf0aacb.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_888ad6581cf0aacb[] = { + &s_8ff333ebac1fdf36, + &s_e8a86679ebba76ad, +}; +static const uint16_t m_888ad6581cf0aacb[] = {2, 0, 1}; +static const uint16_t i_888ad6581cf0aacb[] = {0, 1, 2}; +const ::capnp::_::RawSchema s_888ad6581cf0aacb = { + 0x888ad6581cf0aacb, b_888ad6581cf0aacb.words, 82, d_888ad6581cf0aacb, m_888ad6581cf0aacb, + 2, 3, i_888ad6581cf0aacb, nullptr, nullptr, { &s_888ad6581cf0aacb, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<32> b_e8a86679ebba76ad = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 173, 118, 186, 235, 121, 102, 168, 232, + 20, 0, 0, 0, 2, 0, 0, 0, + 203, 170, 240, 28, 88, 214, 138, 136, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 210, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 79, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 82, 97, 100, 97, 114, 68, + 97, 116, 97, 46, 69, 114, 114, 111, + 114, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 69, 114, 114, 111, 114, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 97, 117, 108, 116, 0, 0, 0, + 119, 114, 111, 110, 103, 67, 111, 110, + 102, 105, 103, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e8a86679ebba76ad = b_e8a86679ebba76ad.words; +#if !CAPNP_LITE +static const uint16_t m_e8a86679ebba76ad[] = {0, 1, 2}; +const ::capnp::_::RawSchema s_e8a86679ebba76ad = { + 0xe8a86679ebba76ad, b_e8a86679ebba76ad.words, 32, nullptr, m_e8a86679ebba76ad, + 0, 3, nullptr, nullptr, nullptr, { &s_e8a86679ebba76ad, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(Error_e8a86679ebba76ad, e8a86679ebba76ad); +static const ::capnp::_::AlignedData<124> b_8ff333ebac1fdf36 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 54, 223, 31, 172, 235, 51, 243, 143, + 20, 0, 0, 0, 1, 0, 4, 0, + 203, 170, 240, 28, 88, 214, 138, 136, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 143, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 82, 97, 100, 97, 114, 68, + 97, 116, 97, 46, 82, 97, 100, 97, + 114, 80, 111, 105, 110, 116, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 3, 0, 1, 0, + 188, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 0, 0, 0, 3, 0, 1, 0, + 192, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 0, 0, 0, 3, 0, 1, 0, + 196, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 3, 0, 1, 0, + 200, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 0, 0, 0, 3, 0, 1, 0, + 204, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 0, 0, 0, 3, 0, 1, 0, + 208, 0, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 224, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 216, 0, 0, 0, 2, 0, 1, 0, + 116, 114, 97, 99, 107, 73, 100, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 82, 101, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 82, 101, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 82, 101, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 82, 101, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 118, 82, 101, 108, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 97, 115, 117, 114, 101, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_8ff333ebac1fdf36 = b_8ff333ebac1fdf36.words; +#if !CAPNP_LITE +static const uint16_t m_8ff333ebac1fdf36[] = {4, 1, 6, 0, 3, 2, 5}; +static const uint16_t i_8ff333ebac1fdf36[] = {0, 1, 2, 3, 4, 5, 6}; +const ::capnp::_::RawSchema s_8ff333ebac1fdf36 = { + 0x8ff333ebac1fdf36, b_8ff333ebac1fdf36.words, 124, nullptr, m_8ff333ebac1fdf36, + 0, 7, i_8ff333ebac1fdf36, nullptr, nullptr, { &s_8ff333ebac1fdf36, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<203> b_f78829049ab814af = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 175, 20, 184, 154, 4, 41, 136, 247, + 10, 0, 0, 0, 1, 0, 3, 0, + 141, 139, 175, 8, 231, 241, 42, 142, + 4, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 170, 0, 0, 0, + 29, 0, 0, 0, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 111, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 67, 111, 110, + 116, 114, 111, 108, 0, 0, 0, 0, + 12, 0, 0, 0, 1, 0, 1, 0, + 40, 40, 67, 25, 169, 117, 114, 233, + 17, 0, 0, 0, 82, 0, 0, 0, + 211, 168, 11, 14, 110, 56, 14, 178, + 17, 0, 0, 0, 114, 0, 0, 0, + 56, 58, 176, 78, 124, 200, 149, 216, + 17, 0, 0, 0, 90, 0, 0, 0, + 65, 99, 116, 117, 97, 116, 111, 114, + 115, 0, 0, 0, 0, 0, 0, 0, + 67, 114, 117, 105, 115, 101, 67, 111, + 110, 116, 114, 111, 108, 0, 0, 0, + 72, 85, 68, 67, 111, 110, 116, 114, + 111, 108, 0, 0, 0, 0, 0, 0, + 44, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 1, 0, 0, 3, 0, 1, 0, + 44, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 1, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 1, 0, 0, 3, 0, 1, 0, + 52, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 1, 0, 0, 3, 0, 1, 0, + 60, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 1, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 1, 0, 0, 3, 0, 1, 0, + 76, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 1, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 1, 0, 0, 3, 0, 1, 0, + 84, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 1, 0, 0, 3, 0, 1, 0, + 92, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 1, 0, 0, 3, 0, 1, 0, + 100, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 1, 0, 0, 3, 0, 1, 0, + 104, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 1, 0, 0, 3, 0, 1, 0, + 108, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 1, 0, 0, 3, 0, 1, 0, + 112, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 1, 0, 0, 3, 0, 1, 0, + 120, 1, 0, 0, 2, 0, 1, 0, + 101, 110, 97, 98, 108, 101, 100, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 115, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 84, 111, 114, 113, 117, 101, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 114, 117, 105, 115, 101, 67, 111, + 110, 116, 114, 111, 108, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 211, 168, 11, 14, 110, 56, 14, 178, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 117, 100, 67, 111, 110, 116, 114, + 111, 108, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 56, 58, 176, 78, 124, 200, 149, 216, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 116, 117, 97, 116, 111, 114, + 115, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 40, 40, 67, 25, 169, 117, 114, 233, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 116, 105, 118, 101, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 108, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 105, 116, 99, 104, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 116, 117, 97, 116, 111, 114, + 115, 79, 117, 116, 112, 117, 116, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 40, 40, 67, 25, 169, 117, 114, 233, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_f78829049ab814af = b_f78829049ab814af.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_f78829049ab814af[] = { + &s_b20e386e0e0ba8d3, + &s_d895c87c4eb03a38, + &s_e97275a919432828, +}; +static const uint16_t m_f78829049ab814af[] = {7, 6, 10, 2, 4, 0, 1, 5, 9, 8, 3}; +static const uint16_t i_f78829049ab814af[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; +const ::capnp::_::RawSchema s_f78829049ab814af = { + 0xf78829049ab814af, b_f78829049ab814af.words, 203, d_f78829049ab814af, m_f78829049ab814af, + 3, 11, i_f78829049ab814af, nullptr, nullptr, { &s_f78829049ab814af, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<132> b_e97275a919432828 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 40, 40, 67, 25, 169, 117, 114, 233, + 21, 0, 0, 0, 1, 0, 4, 0, + 175, 20, 184, 154, 4, 41, 136, 247, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 143, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 67, 111, 110, + 116, 114, 111, 108, 46, 65, 99, 116, + 117, 97, 116, 111, 114, 115, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 130, 130, 144, 125, 145, 58, 15, 228, + 1, 0, 0, 0, 138, 0, 0, 0, + 76, 111, 110, 103, 67, 111, 110, 116, + 114, 111, 108, 83, 116, 97, 116, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 3, 0, 1, 0, + 188, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 0, 0, 0, 3, 0, 1, 0, + 192, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 0, 0, 0, 3, 0, 1, 0, + 196, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 0, 0, 0, 3, 0, 1, 0, + 208, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 0, 0, 0, 3, 0, 1, 0, + 212, 0, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 0, 0, 0, 3, 0, 1, 0, + 224, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 0, 0, 0, 3, 0, 1, 0, + 228, 0, 0, 0, 2, 0, 1, 0, + 103, 97, 115, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 110, 103, 108, 101, 68, 101, 103, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 101, 108, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 110, 103, 67, 111, 110, 116, + 114, 111, 108, 83, 116, 97, 116, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 130, 130, 144, 125, 145, 58, 15, 228, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e97275a919432828 = b_e97275a919432828.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_e97275a919432828[] = { + &s_e40f3a917d908282, +}; +static const uint16_t m_e97275a919432828[] = {4, 1, 0, 5, 6, 2, 3}; +static const uint16_t i_e97275a919432828[] = {0, 1, 2, 3, 4, 5, 6}; +const ::capnp::_::RawSchema s_e97275a919432828 = { + 0xe97275a919432828, b_e97275a919432828.words, 132, d_e97275a919432828, m_e97275a919432828, + 1, 7, i_e97275a919432828, nullptr, nullptr, { &s_e97275a919432828, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<39> b_e40f3a917d908282 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 130, 130, 144, 125, 145, 58, 15, 228, + 31, 0, 0, 0, 2, 0, 0, 0, + 40, 40, 67, 25, 169, 117, 114, 233, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 130, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 103, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 67, 111, 110, + 116, 114, 111, 108, 46, 65, 99, 116, + 117, 97, 116, 111, 114, 115, 46, 76, + 111, 110, 103, 67, 111, 110, 116, 114, + 111, 108, 83, 116, 97, 116, 101, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 102, 102, 0, 0, 0, 0, 0, + 112, 105, 100, 0, 0, 0, 0, 0, + 115, 116, 111, 112, 112, 105, 110, 103, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 114, 116, 105, 110, 103, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e40f3a917d908282 = b_e40f3a917d908282.words; +#if !CAPNP_LITE +static const uint16_t m_e40f3a917d908282[] = {0, 1, 3, 2}; +const ::capnp::_::RawSchema s_e40f3a917d908282 = { + 0xe40f3a917d908282, b_e40f3a917d908282.words, 39, nullptr, m_e40f3a917d908282, + 0, 4, nullptr, nullptr, nullptr, { &s_e40f3a917d908282, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(LongControlState_e40f3a917d908282, e40f3a917d908282); +static const ::capnp::_::AlignedData<82> b_b20e386e0e0ba8d3 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 211, 168, 11, 14, 110, 56, 14, 178, + 21, 0, 0, 0, 1, 0, 2, 0, + 175, 20, 184, 154, 4, 41, 136, 247, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 26, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 67, 111, 110, + 116, 114, 111, 108, 46, 67, 114, 117, + 105, 115, 101, 67, 111, 110, 116, 114, + 111, 108, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 3, 0, 1, 0, + 104, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 0, 0, 0, 3, 0, 1, 0, + 112, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 0, 0, 0, 3, 0, 1, 0, + 120, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 0, 0, 0, 3, 0, 1, 0, + 128, 0, 0, 0, 2, 0, 1, 0, + 99, 97, 110, 99, 101, 108, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 118, 101, 114, 114, 105, 100, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 79, 118, 101, + 114, 114, 105, 100, 101, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 101, 108, 79, 118, 101, + 114, 114, 105, 100, 101, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_b20e386e0e0ba8d3 = b_b20e386e0e0ba8d3.words; +#if !CAPNP_LITE +static const uint16_t m_b20e386e0e0ba8d3[] = {3, 0, 1, 2}; +static const uint16_t i_b20e386e0e0ba8d3[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_b20e386e0e0ba8d3 = { + 0xb20e386e0e0ba8d3, b_b20e386e0e0ba8d3.words, 82, nullptr, m_b20e386e0e0ba8d3, + 0, 4, i_b20e386e0e0ba8d3, nullptr, nullptr, { &s_b20e386e0e0ba8d3, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<187> b_d895c87c4eb03a38 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 56, 58, 176, 78, 124, 200, 149, 216, + 21, 0, 0, 0, 1, 0, 2, 0, + 175, 20, 184, 154, 4, 41, 136, 247, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 2, 1, 0, 0, + 33, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 55, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 67, 111, 110, + 116, 114, 111, 108, 46, 72, 85, 68, + 67, 111, 110, 116, 114, 111, 108, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 212, 23, 110, 97, 132, 142, 215, 144, + 9, 0, 0, 0, 98, 0, 0, 0, + 158, 51, 78, 149, 108, 226, 165, 245, + 9, 0, 0, 0, 106, 0, 0, 0, + 86, 105, 115, 117, 97, 108, 65, 108, + 101, 114, 116, 0, 0, 0, 0, 0, + 65, 117, 100, 105, 98, 108, 101, 65, + 108, 101, 114, 116, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 1, 0, 0, 3, 0, 1, 0, + 20, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 1, 0, 0, 3, 0, 1, 0, + 28, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 1, 0, 0, 3, 0, 1, 0, + 36, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 1, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 1, 0, 0, 3, 0, 1, 0, + 44, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 1, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 1, 0, 0, 3, 0, 1, 0, + 52, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 1, 0, 0, 3, 0, 1, 0, + 60, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 1, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 1, 0, 0, 3, 0, 1, 0, + 72, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 1, 0, 0, 3, 0, 1, 0, + 80, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 1, 0, 0, 3, 0, 1, 0, + 88, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 1, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 1, 0, 0, 3, 0, 1, 0, + 96, 1, 0, 0, 2, 0, 1, 0, + 115, 112, 101, 101, 100, 86, 105, 115, + 105, 98, 108, 101, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 116, 83, 112, 101, 101, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 110, 101, 115, 86, 105, 115, + 105, 98, 108, 101, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 97, 100, 86, 105, 115, 105, + 98, 108, 101, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 105, 115, 117, 97, 108, 65, 108, + 101, 114, 116, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 212, 23, 110, 97, 132, 142, 215, 144, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 117, 100, 105, 98, 108, 101, 65, + 108, 101, 114, 116, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 158, 51, 78, 149, 108, 226, 165, 245, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 105, 103, 104, 116, 76, 97, 110, + 101, 86, 105, 115, 105, 98, 108, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 102, 116, 76, 97, 110, 101, + 86, 105, 115, 105, 98, 108, 101, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 105, 103, 104, 116, 76, 97, 110, + 101, 68, 101, 112, 97, 114, 116, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 102, 116, 76, 97, 110, 101, + 68, 101, 112, 97, 114, 116, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d895c87c4eb03a38 = b_d895c87c4eb03a38.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_d895c87c4eb03a38[] = { + &s_90d78e84616e17d4, + &s_f5a5e26c954e339e, +}; +static const uint16_t m_d895c87c4eb03a38[] = {5, 2, 3, 9, 7, 8, 6, 1, 0, 4}; +static const uint16_t i_d895c87c4eb03a38[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; +const ::capnp::_::RawSchema s_d895c87c4eb03a38 = { + 0xd895c87c4eb03a38, b_d895c87c4eb03a38.words, 187, d_d895c87c4eb03a38, m_d895c87c4eb03a38, + 2, 10, i_d895c87c4eb03a38, nullptr, nullptr, { &s_d895c87c4eb03a38, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<58> b_90d78e84616e17d4 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 212, 23, 110, 97, 132, 142, 215, 144, + 32, 0, 0, 0, 2, 0, 0, 0, + 56, 58, 176, 78, 124, 200, 149, 216, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 98, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 199, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 67, 111, 110, + 116, 114, 111, 108, 46, 72, 85, 68, + 67, 111, 110, 116, 114, 111, 108, 46, + 86, 105, 115, 117, 97, 108, 65, 108, + 101, 114, 116, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 32, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 81, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 57, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 110, 101, 0, 0, 0, 0, + 102, 99, 119, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 82, 101, 113, + 117, 105, 114, 101, 100, 0, 0, 0, + 98, 114, 97, 107, 101, 80, 114, 101, + 115, 115, 101, 100, 0, 0, 0, 0, + 119, 114, 111, 110, 103, 71, 101, 97, + 114, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 97, 116, 98, 101, 108, 116, + 85, 110, 98, 117, 99, 107, 108, 101, + 100, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 84, 111, 111, + 72, 105, 103, 104, 0, 0, 0, 0, + 108, 100, 119, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_90d78e84616e17d4 = b_90d78e84616e17d4.words; +#if !CAPNP_LITE +static const uint16_t m_90d78e84616e17d4[] = {3, 1, 7, 0, 5, 6, 2, 4}; +const ::capnp::_::RawSchema s_90d78e84616e17d4 = { + 0x90d78e84616e17d4, b_90d78e84616e17d4.words, 58, nullptr, m_90d78e84616e17d4, + 0, 8, nullptr, nullptr, nullptr, { &s_90d78e84616e17d4, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(VisualAlert_90d78e84616e17d4, 90d78e84616e17d4); +static const ::capnp::_::AlignedData<63> b_f5a5e26c954e339e = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 158, 51, 78, 149, 108, 226, 165, 245, + 32, 0, 0, 0, 2, 0, 0, 0, + 56, 58, 176, 78, 124, 200, 149, 216, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 106, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 223, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 67, 111, 110, + 116, 114, 111, 108, 46, 72, 85, 68, + 67, 111, 110, 116, 114, 111, 108, 46, + 65, 117, 100, 105, 98, 108, 101, 65, + 108, 101, 114, 116, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 36, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 93, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 85, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 81, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 57, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 110, 101, 0, 0, 0, 0, + 101, 110, 103, 97, 103, 101, 0, 0, + 100, 105, 115, 101, 110, 103, 97, 103, + 101, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 102, 117, 115, 101, 0, 0, + 119, 97, 114, 110, 105, 110, 103, 83, + 111, 102, 116, 0, 0, 0, 0, 0, + 119, 97, 114, 110, 105, 110, 103, 73, + 109, 109, 101, 100, 105, 97, 116, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 111, 109, 112, 116, 0, 0, + 112, 114, 111, 109, 112, 116, 82, 101, + 112, 101, 97, 116, 0, 0, 0, 0, + 112, 114, 111, 109, 112, 116, 68, 105, + 115, 116, 114, 97, 99, 116, 101, 100, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_f5a5e26c954e339e = b_f5a5e26c954e339e.words; +#if !CAPNP_LITE +static const uint16_t m_f5a5e26c954e339e[] = {2, 1, 0, 6, 8, 7, 3, 5, 4}; +const ::capnp::_::RawSchema s_f5a5e26c954e339e = { + 0xf5a5e26c954e339e, b_f5a5e26c954e339e.words, 63, nullptr, m_f5a5e26c954e339e, + 0, 9, nullptr, nullptr, nullptr, { &s_f5a5e26c954e339e, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(AudibleAlert_f5a5e26c954e339e, f5a5e26c954e339e); +static const ::capnp::_::AlignedData<1158> b_8c69372490aaa9da = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 10, 0, 0, 0, 1, 0, 16, 0, + 141, 139, 175, 8, 231, 241, 42, 142, + 14, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 162, 0, 0, 0, + 29, 0, 0, 0, 215, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 0, 0, 0, 7, 14, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 0, 0, 0, 0, 0, + 52, 0, 0, 0, 1, 0, 1, 0, + 201, 176, 86, 96, 156, 52, 54, 232, + 97, 0, 0, 0, 106, 0, 0, 0, + 163, 221, 137, 28, 59, 178, 129, 181, + 97, 0, 0, 0, 114, 0, 0, 0, + 46, 76, 209, 203, 63, 114, 34, 150, + 97, 0, 0, 0, 138, 0, 0, 0, + 142, 155, 62, 48, 252, 206, 66, 195, + 101, 0, 0, 0, 178, 0, 0, 0, + 179, 51, 85, 4, 46, 71, 52, 163, + 105, 0, 0, 0, 146, 0, 0, 0, + 18, 106, 97, 40, 63, 30, 21, 157, + 109, 0, 0, 0, 138, 0, 0, 0, + 81, 244, 218, 30, 91, 30, 85, 149, + 113, 0, 0, 0, 98, 0, 0, 0, + 127, 247, 222, 226, 43, 81, 97, 214, + 113, 0, 0, 0, 138, 0, 0, 0, + 236, 192, 191, 20, 235, 46, 22, 143, + 117, 0, 0, 0, 138, 0, 0, 0, + 206, 89, 147, 12, 24, 86, 43, 150, + 121, 0, 0, 0, 50, 0, 0, 0, + 145, 214, 209, 89, 183, 155, 17, 247, + 117, 0, 0, 0, 34, 0, 0, 0, + 206, 64, 220, 216, 35, 85, 217, 159, + 113, 0, 0, 0, 146, 0, 0, 0, + 81, 60, 131, 42, 104, 227, 153, 255, + 117, 0, 0, 0, 130, 0, 0, 0, + 83, 97, 102, 101, 116, 121, 67, 111, + 110, 102, 105, 103, 0, 0, 0, 0, + 76, 97, 116, 101, 114, 97, 108, 80, + 97, 114, 97, 109, 115, 0, 0, 0, + 76, 97, 116, 101, 114, 97, 108, 80, + 73, 68, 84, 117, 110, 105, 110, 103, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 111, 110, 103, 105, 116, 117, 100, + 105, 110, 97, 108, 80, 73, 68, 84, + 117, 110, 105, 110, 103, 0, 0, 0, + 76, 97, 116, 101, 114, 97, 108, 73, + 78, 68, 73, 84, 117, 110, 105, 110, + 103, 0, 0, 0, 0, 0, 0, 0, + 76, 97, 116, 101, 114, 97, 108, 76, + 81, 82, 84, 117, 110, 105, 110, 103, + 0, 0, 0, 0, 0, 0, 0, 0, + 83, 97, 102, 101, 116, 121, 77, 111, + 100, 101, 108, 0, 0, 0, 0, 0, + 83, 116, 101, 101, 114, 67, 111, 110, + 116, 114, 111, 108, 84, 121, 112, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 114, 97, 110, 115, 109, 105, 115, + 115, 105, 111, 110, 84, 121, 112, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 67, 97, 114, 70, 119, 0, 0, 0, + 69, 99, 117, 0, 0, 0, 0, 0, + 70, 105, 110, 103, 101, 114, 112, 114, + 105, 110, 116, 83, 111, 117, 114, 99, + 101, 0, 0, 0, 0, 0, 0, 0, + 78, 101, 116, 119, 111, 114, 107, 76, + 111, 99, 97, 116, 105, 111, 110, 0, + 0, 1, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 6, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 6, 0, 0, 3, 0, 1, 0, + 248, 6, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 6, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 6, 0, 0, 3, 0, 1, 0, + 0, 7, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 6, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 7, 0, 0, 3, 0, 1, 0, + 12, 7, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 7, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 7, 0, 0, 3, 0, 1, 0, + 20, 7, 0, 0, 2, 0, 1, 0, + 54, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 7, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 7, 0, 0, 3, 0, 1, 0, + 32, 7, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 7, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 7, 0, 0, 3, 0, 1, 0, + 40, 7, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 7, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 7, 0, 0, 3, 0, 1, 0, + 48, 7, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 7, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 7, 0, 0, 3, 0, 1, 0, + 56, 7, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 7, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 7, 0, 0, 3, 0, 1, 0, + 64, 7, 0, 0, 2, 0, 1, 0, + 58, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 7, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 7, 0, 0, 3, 0, 1, 0, + 76, 7, 0, 0, 2, 0, 1, 0, + 57, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 7, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 7, 0, 0, 3, 0, 1, 0, + 88, 7, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 7, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 7, 0, 0, 3, 0, 1, 0, + 112, 7, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 7, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 7, 0, 0, 3, 0, 1, 0, + 136, 7, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 7, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 7, 0, 0, 3, 0, 1, 0, + 164, 7, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 7, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 7, 0, 0, 3, 0, 1, 0, + 192, 7, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 7, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 7, 0, 0, 3, 0, 1, 0, + 220, 7, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 7, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 7, 0, 0, 3, 0, 1, 0, + 248, 7, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 7, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 7, 0, 0, 3, 0, 1, 0, + 252, 7, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 7, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 7, 0, 0, 3, 0, 1, 0, + 4, 8, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 8, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 8, 0, 0, 3, 0, 1, 0, + 12, 8, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 8, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 0, 0, 3, 0, 1, 0, + 20, 8, 0, 0, 2, 0, 1, 0, + 24, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 8, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 8, 0, 0, 3, 0, 1, 0, + 28, 8, 0, 0, 2, 0, 1, 0, + 25, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 8, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 8, 0, 0, 3, 0, 1, 0, + 40, 8, 0, 0, 2, 0, 1, 0, + 26, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 8, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 8, 0, 0, 3, 0, 1, 0, + 52, 8, 0, 0, 2, 0, 1, 0, + 27, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 8, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 8, 0, 0, 3, 0, 1, 0, + 64, 8, 0, 0, 2, 0, 1, 0, + 28, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 8, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 8, 0, 0, 3, 0, 1, 0, + 76, 8, 0, 0, 2, 0, 1, 0, + 30, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 104, 149, 51, 53, 10, 88, 252, 147, + 73, 8, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 31, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 8, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 8, 0, 0, 3, 0, 1, 0, + 64, 8, 0, 0, 2, 0, 1, 0, + 33, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 8, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 8, 0, 0, 3, 0, 1, 0, + 72, 8, 0, 0, 2, 0, 1, 0, + 35, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 30, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 8, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 8, 0, 0, 3, 0, 1, 0, + 84, 8, 0, 0, 2, 0, 1, 0, + 36, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 8, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 8, 0, 0, 3, 0, 1, 0, + 92, 8, 0, 0, 2, 0, 1, 0, + 61, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 8, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 8, 0, 0, 3, 0, 1, 0, + 104, 8, 0, 0, 2, 0, 1, 0, + 38, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 33, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 8, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 8, 0, 0, 3, 0, 1, 0, + 112, 8, 0, 0, 2, 0, 1, 0, + 39, 0, 0, 0, 30, 0, 0, 0, + 0, 0, 1, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 8, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 8, 0, 0, 3, 0, 1, 0, + 124, 8, 0, 0, 2, 0, 1, 0, + 40, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 8, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 8, 0, 0, 3, 0, 1, 0, + 132, 8, 0, 0, 2, 0, 1, 0, + 42, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 8, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 8, 0, 0, 3, 0, 1, 0, + 144, 8, 0, 0, 2, 0, 1, 0, + 45, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 8, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 8, 0, 0, 3, 0, 1, 0, + 160, 8, 0, 0, 2, 0, 1, 0, + 46, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 38, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 8, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 8, 0, 0, 3, 0, 1, 0, + 164, 8, 0, 0, 2, 0, 1, 0, + 55, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 8, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 8, 0, 0, 3, 0, 1, 0, + 176, 8, 0, 0, 2, 0, 1, 0, + 47, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 41, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 8, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 8, 0, 0, 3, 0, 1, 0, + 184, 8, 0, 0, 2, 0, 1, 0, + 59, 0, 0, 0, 31, 0, 0, 0, + 0, 0, 1, 0, 42, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 181, 8, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 8, 0, 0, 3, 0, 1, 0, + 200, 8, 0, 0, 2, 0, 1, 0, + 48, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 1, 0, 43, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 8, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 8, 0, 0, 3, 0, 1, 0, + 212, 8, 0, 0, 2, 0, 1, 0, + 49, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 44, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 8, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 8, 0, 0, 3, 0, 1, 0, + 232, 8, 0, 0, 2, 0, 1, 0, + 50, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 1, 0, 45, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 229, 8, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 8, 0, 0, 3, 0, 1, 0, + 240, 8, 0, 0, 2, 0, 1, 0, + 62, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 46, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 8, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 8, 0, 0, 3, 0, 1, 0, + 0, 9, 0, 0, 2, 0, 1, 0, + 32, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 1, 0, 47, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 8, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 8, 0, 0, 3, 0, 1, 0, + 8, 9, 0, 0, 2, 0, 1, 0, + 29, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 48, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 9, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 9, 0, 0, 3, 0, 1, 0, + 16, 9, 0, 0, 2, 0, 1, 0, + 51, 0, 0, 0, 35, 0, 0, 0, + 0, 0, 1, 0, 49, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 9, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 9, 0, 0, 3, 0, 1, 0, + 28, 9, 0, 0, 2, 0, 1, 0, + 52, 0, 0, 0, 40, 0, 0, 0, + 0, 0, 1, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 9, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 9, 0, 0, 3, 0, 1, 0, + 36, 9, 0, 0, 2, 0, 1, 0, + 60, 0, 0, 0, 21, 0, 0, 0, + 0, 0, 1, 0, 51, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 9, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 9, 0, 0, 3, 0, 1, 0, + 48, 9, 0, 0, 2, 0, 1, 0, + 41, 0, 0, 0, 22, 0, 0, 0, + 0, 0, 1, 0, 52, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 9, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 9, 0, 0, 3, 0, 1, 0, + 60, 9, 0, 0, 2, 0, 1, 0, + 63, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 1, 0, 53, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 9, 0, 0, 226, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 9, 0, 0, 3, 0, 1, 0, + 76, 9, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 24, 0, 0, 0, + 0, 0, 1, 0, 54, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 9, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 9, 0, 0, 3, 0, 1, 0, + 88, 9, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 9, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 9, 0, 0, 3, 0, 1, 0, + 100, 9, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 56, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 9, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 9, 0, 0, 3, 0, 1, 0, + 108, 9, 0, 0, 2, 0, 1, 0, + 56, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 57, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 9, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 9, 0, 0, 3, 0, 1, 0, + 124, 9, 0, 0, 2, 0, 1, 0, + 44, 0, 0, 0, 25, 0, 0, 0, + 0, 0, 1, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 9, 0, 0, 34, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 9, 0, 0, 3, 0, 1, 0, + 144, 9, 0, 0, 2, 0, 1, 0, + 34, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 1, 0, 59, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 9, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 9, 0, 0, 3, 0, 1, 0, + 152, 9, 0, 0, 2, 0, 1, 0, + 37, 0, 0, 0, 27, 0, 0, 0, + 0, 0, 1, 0, 60, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 9, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 9, 0, 0, 3, 0, 1, 0, + 160, 9, 0, 0, 2, 0, 1, 0, + 43, 0, 0, 0, 28, 0, 0, 0, + 0, 0, 1, 0, 61, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 9, 0, 0, 34, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 9, 0, 0, 3, 0, 1, 0, + 180, 9, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 62, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 9, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 9, 0, 0, 3, 0, 1, 0, + 204, 9, 0, 0, 2, 0, 1, 0, + 53, 0, 0, 0, 29, 0, 0, 0, + 0, 0, 1, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 9, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 9, 0, 0, 3, 0, 1, 0, + 216, 9, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 30, 0, 0, 0, + 0, 0, 1, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 9, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 9, 0, 0, 3, 0, 1, 0, + 220, 9, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 41, 0, 0, 0, + 0, 0, 1, 0, 65, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 9, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 9, 0, 0, 3, 0, 1, 0, + 228, 9, 0, 0, 2, 0, 1, 0, + 99, 97, 114, 78, 97, 109, 101, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 70, 105, 110, 103, 101, + 114, 112, 114, 105, 110, 116, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 97, 98, 108, 101, 71, 97, + 115, 73, 110, 116, 101, 114, 99, 101, + 112, 116, 111, 114, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 99, 109, 67, 114, 117, 105, 115, + 101, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 97, 98, 108, 101, 67, 97, + 109, 101, 114, 97, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 97, 98, 108, 101, 68, 115, + 117, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 97, 98, 108, 101, 65, 112, + 103, 115, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 105, 110, 69, 110, 97, 98, 108, + 101, 83, 112, 101, 101, 100, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 105, 110, 83, 116, 101, 101, 114, + 83, 112, 101, 101, 100, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 97, 102, 101, 116, 121, 77, 111, + 100, 101, 108, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 81, 244, 218, 30, 91, 30, 85, 149, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 97, 102, 101, 116, 121, 80, 97, + 114, 97, 109, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 77, 97, 120, + 66, 80, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 77, 97, 120, + 86, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 115, 77, 97, 120, 66, 80, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 115, 77, 97, 120, 86, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 77, 97, 120, + 66, 80, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 77, 97, 120, + 86, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 115, 115, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 119, 104, 101, 101, 108, 98, 97, 115, + 101, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 101, 110, 116, 101, 114, 84, 111, + 70, 114, 111, 110, 116, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 82, 97, 116, + 105, 111, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 82, 97, 116, + 105, 111, 82, 101, 97, 114, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 116, 97, 116, 105, 111, 110, + 97, 108, 73, 110, 101, 114, 116, 105, + 97, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 114, 101, 83, 116, 105, 102, + 102, 110, 101, 115, 115, 70, 114, 111, + 110, 116, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 114, 101, 83, 116, 105, 102, + 102, 110, 101, 115, 115, 82, 101, 97, + 114, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 110, 103, 105, 116, 117, 100, + 105, 110, 97, 108, 84, 117, 110, 105, + 110, 103, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 142, 155, 62, 48, 252, 206, 66, 195, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 116, 101, 114, 97, 108, 84, + 117, 110, 105, 110, 103, 0, 0, 0, + 115, 116, 101, 101, 114, 76, 105, 109, + 105, 116, 65, 108, 101, 114, 116, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 69, 103, 111, 83, 116, 111, 112, + 112, 105, 110, 103, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 114, 101, 99, 116, 65, 99, + 99, 101, 108, 67, 111, 110, 116, 114, + 111, 108, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 111, 112, 112, 105, 110, 103, + 67, 111, 110, 116, 114, 111, 108, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 114, 116, 65, 99, 99, + 101, 108, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 82, 97, 116, + 101, 67, 111, 115, 116, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 67, 111, 110, + 116, 114, 111, 108, 84, 121, 112, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 127, 247, 222, 226, 43, 81, 97, 214, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 100, 97, 114, 79, 102, 102, + 67, 97, 110, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 65, 99, 116, + 117, 97, 116, 111, 114, 68, 101, 108, + 97, 121, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 112, 101, 110, 112, 105, 108, 111, + 116, 76, 111, 110, 103, 105, 116, 117, + 100, 105, 110, 97, 108, 67, 111, 110, + 116, 114, 111, 108, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 86, 105, 110, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 115, 80, 97, 110, 100, 97, 66, + 108, 97, 99, 107, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 97, 115, 104, 99, 97, 109, 79, + 110, 108, 121, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 97, 102, 101, 116, 121, 77, 111, + 100, 101, 108, 80, 97, 115, 115, 105, + 118, 101, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 81, 244, 218, 30, 91, 30, 85, 149, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 114, 97, 110, 115, 109, 105, 115, + 115, 105, 111, 110, 84, 121, 112, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 236, 192, 191, 20, 235, 46, 22, 143, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 70, 119, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 206, 89, 147, 12, 24, 86, 43, 150, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 100, 97, 114, 84, 105, 109, + 101, 83, 116, 101, 112, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 205, 204, 76, 61, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 109, 109, 117, 110, 105, 116, + 121, 70, 101, 97, 116, 117, 114, 101, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 76, 105, 109, + 105, 116, 84, 105, 109, 101, 114, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 116, 101, 114, 97, 108, 80, + 97, 114, 97, 109, 115, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 163, 221, 137, 28, 59, 178, 129, 181, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 110, 103, 101, 114, 112, 114, + 105, 110, 116, 83, 111, 117, 114, 99, + 101, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 206, 64, 220, 216, 35, 85, 217, 159, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 101, 116, 119, 111, 114, 107, 76, + 111, 99, 97, 116, 105, 111, 110, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 81, 60, 131, 42, 104, 227, 153, 255, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 105, 110, 83, 112, 101, 101, 100, + 67, 97, 110, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 111, 112, 112, 105, 110, 103, + 68, 101, 99, 101, 108, 82, 97, 116, + 101, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 114, 116, 105, 110, 103, + 65, 99, 99, 101, 108, 82, 97, 116, + 101, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 120, 83, 116, 101, 101, 114, + 105, 110, 103, 65, 110, 103, 108, 101, + 68, 101, 103, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 117, 122, 122, 121, 70, 105, 110, + 103, 101, 114, 112, 114, 105, 110, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 97, 98, 108, 101, 66, 115, + 109, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 83, 116, 111, 99, 107, + 67, 97, 109, 101, 114, 97, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 110, 103, 105, 116, 117, 100, + 105, 110, 97, 108, 65, 99, 116, 117, + 97, 116, 111, 114, 68, 101, 108, 97, + 121, 85, 112, 112, 101, 114, 66, 111, + 117, 110, 100, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 69, 103, 111, 83, 116, 97, 114, + 116, 105, 110, 103, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 111, 112, 65, 99, 99, 101, + 108, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 110, 103, 105, 116, 117, 100, + 105, 110, 97, 108, 65, 99, 116, 117, + 97, 116, 111, 114, 68, 101, 108, 97, + 121, 76, 111, 119, 101, 114, 66, 111, + 117, 110, 100, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 97, 102, 101, 116, 121, 67, 111, + 110, 102, 105, 103, 115, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 201, 176, 86, 96, 156, 52, 54, 232, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 119, 104, 101, 101, 108, 83, 112, 101, + 101, 100, 70, 97, 99, 116, 111, 114, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 108, 97, 103, 115, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 115, 97, 102, 101, 77, 111, + 100, 101, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_8c69372490aaa9da = b_8c69372490aaa9da.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_8c69372490aaa9da[] = { + &s_8f162eeb14bfc0ec, + &s_93fc580a35339568, + &s_95551e5b1edaf451, + &s_962b56180c9359ce, + &s_9fd95523d8dc40ce, + &s_b581b23b1c89dda3, + &s_c342cefc303e9b8e, + &s_d661512be2def77f, + &s_e836349c6056b0c9, + &s_ff99e3682a833c51, +}; +static const uint16_t m_8c69372490aaa9da[] = {15, 16, 1, 42, 0, 37, 19, 44, 39, 29, 6, 54, 4, 5, 2, 47, 62, 53, 13, 14, 55, 38, 46, 26, 59, 56, 25, 17, 52, 7, 49, 8, 48, 36, 3, 34, 43, 22, 60, 9, 40, 10, 31, 51, 35, 33, 27, 45, 11, 12, 32, 20, 21, 58, 30, 50, 23, 24, 41, 63, 57, 28, 61, 18}; +static const uint16_t i_8c69372490aaa9da[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}; +const ::capnp::_::RawSchema s_8c69372490aaa9da = { + 0x8c69372490aaa9da, b_8c69372490aaa9da.words, 1158, d_8c69372490aaa9da, m_8c69372490aaa9da, + 10, 64, i_8c69372490aaa9da, nullptr, nullptr, { &s_8c69372490aaa9da, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<51> b_e836349c6056b0c9 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 201, 176, 86, 96, 156, 52, 54, 232, + 20, 0, 0, 0, 1, 0, 1, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 10, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 46, 83, 97, 102, 101, + 116, 121, 67, 111, 110, 102, 105, 103, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 0, 0, 0, 3, 0, 1, 0, + 60, 0, 0, 0, 2, 0, 1, 0, + 115, 97, 102, 101, 116, 121, 77, 111, + 100, 101, 108, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 81, 244, 218, 30, 91, 30, 85, 149, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 97, 102, 101, 116, 121, 80, 97, + 114, 97, 109, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e836349c6056b0c9 = b_e836349c6056b0c9.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_e836349c6056b0c9[] = { + &s_95551e5b1edaf451, +}; +static const uint16_t m_e836349c6056b0c9[] = {0, 1}; +static const uint16_t i_e836349c6056b0c9[] = {0, 1}; +const ::capnp::_::RawSchema s_e836349c6056b0c9 = { + 0xe836349c6056b0c9, b_e836349c6056b0c9.words, 51, d_e836349c6056b0c9, m_e836349c6056b0c9, + 1, 2, i_e836349c6056b0c9, nullptr, nullptr, { &s_e836349c6056b0c9, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<58> b_b581b23b1c89dda3 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 163, 221, 137, 28, 59, 178, 129, 181, + 20, 0, 0, 0, 1, 0, 0, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 18, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 46, 76, 97, 116, 101, + 114, 97, 108, 80, 97, 114, 97, 109, + 115, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 68, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 0, 0, 0, 3, 0, 1, 0, + 88, 0, 0, 0, 2, 0, 1, 0, + 116, 111, 114, 113, 117, 101, 66, 80, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 111, 114, 113, 117, 101, 86, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_b581b23b1c89dda3 = b_b581b23b1c89dda3.words; +#if !CAPNP_LITE +static const uint16_t m_b581b23b1c89dda3[] = {0, 1}; +static const uint16_t i_b581b23b1c89dda3[] = {0, 1}; +const ::capnp::_::RawSchema s_b581b23b1c89dda3 = { + 0xb581b23b1c89dda3, b_b581b23b1c89dda3.words, 58, nullptr, m_b581b23b1c89dda3, + 0, 2, i_b581b23b1c89dda3, nullptr, nullptr, { &s_b581b23b1c89dda3, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<110> b_9622723fcbd14c2e = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 46, 76, 209, 203, 63, 114, 34, 150, + 20, 0, 0, 0, 1, 0, 1, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 4, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 42, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 31, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 46, 76, 97, 116, 101, + 114, 97, 108, 80, 73, 68, 84, 117, + 110, 105, 110, 103, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 0, 0, 0, 3, 0, 1, 0, + 148, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 0, 0, 0, 3, 0, 1, 0, + 168, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 3, 0, 1, 0, + 188, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 0, 0, 0, 3, 0, 1, 0, + 208, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 0, 0, 0, 3, 0, 1, 0, + 212, 0, 0, 0, 2, 0, 1, 0, + 107, 112, 66, 80, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 112, 86, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 105, 66, 80, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 105, 86, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 102, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9622723fcbd14c2e = b_9622723fcbd14c2e.words; +#if !CAPNP_LITE +static const uint16_t m_9622723fcbd14c2e[] = {4, 2, 3, 0, 1}; +static const uint16_t i_9622723fcbd14c2e[] = {0, 1, 2, 3, 4}; +const ::capnp::_::RawSchema s_9622723fcbd14c2e = { + 0x9622723fcbd14c2e, b_9622723fcbd14c2e.words, 110, nullptr, m_9622723fcbd14c2e, + 0, 5, i_9622723fcbd14c2e, nullptr, nullptr, { &s_9622723fcbd14c2e, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<136> b_c342cefc303e9b8e = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 142, 155, 62, 48, 252, 206, 66, 195, + 20, 0, 0, 0, 1, 0, 0, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 6, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 82, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 87, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 46, 76, 111, 110, 103, + 105, 116, 117, 100, 105, 110, 97, 108, + 80, 73, 68, 84, 117, 110, 105, 110, + 103, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 24, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 0, 0, 0, 3, 0, 1, 0, + 176, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 0, 0, 0, 3, 0, 1, 0, + 196, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 3, 0, 1, 0, + 216, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 0, 0, 0, 3, 0, 1, 0, + 236, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 0, 0, 0, 3, 0, 1, 0, + 4, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 3, 0, 1, 0, + 28, 1, 0, 0, 2, 0, 1, 0, + 107, 112, 66, 80, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 112, 86, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 105, 66, 80, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 105, 86, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 97, 100, 122, 111, 110, 101, + 66, 80, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 97, 100, 122, 111, 110, 101, + 86, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_c342cefc303e9b8e = b_c342cefc303e9b8e.words; +#if !CAPNP_LITE +static const uint16_t m_c342cefc303e9b8e[] = {4, 5, 2, 3, 0, 1}; +static const uint16_t i_c342cefc303e9b8e[] = {0, 1, 2, 3, 4, 5}; +const ::capnp::_::RawSchema s_c342cefc303e9b8e = { + 0xc342cefc303e9b8e, b_c342cefc303e9b8e.words, 136, nullptr, m_c342cefc303e9b8e, + 0, 6, i_c342cefc303e9b8e, nullptr, nullptr, { &s_c342cefc303e9b8e, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<250> b_a334472e045533b3 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 179, 51, 85, 4, 46, 71, 52, 163, + 20, 0, 0, 0, 1, 0, 2, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 8, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 50, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 167, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 46, 76, 97, 116, 101, + 114, 97, 108, 73, 78, 68, 73, 84, + 117, 110, 105, 110, 103, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 48, 0, 0, 0, 3, 0, 4, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 1, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 1, 0, 0, 3, 0, 1, 0, + 80, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 1, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 1, 0, 0, 3, 0, 1, 0, + 92, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 1, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 1, 0, 0, 3, 0, 1, 0, + 104, 1, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 1, 0, 0, 2, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 1, 0, 0, 3, 0, 1, 0, + 120, 1, 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 1, 0, 0, 3, 0, 1, 0, + 144, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 1, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 1, 0, 0, 3, 0, 1, 0, + 168, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 1, 0, 0, 3, 0, 1, 0, + 192, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 1, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 1, 0, 0, 3, 0, 1, 0, + 216, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 1, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 1, 0, 0, 3, 0, 1, 0, + 240, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 1, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 1, 0, 0, 3, 0, 1, 0, + 8, 2, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 2, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 2, 0, 0, 3, 0, 1, 0, + 36, 2, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 2, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 2, 0, 0, 3, 0, 1, 0, + 64, 2, 0, 0, 2, 0, 1, 0, + 111, 117, 116, 101, 114, 76, 111, 111, + 112, 71, 97, 105, 110, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 110, 101, 114, 76, 111, 111, + 112, 71, 97, 105, 110, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 67, 111, 110, 115, + 116, 97, 110, 116, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 116, 117, 97, 116, 111, 114, + 69, 102, 102, 101, 99, 116, 105, 118, + 101, 110, 101, 115, 115, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 117, 116, 101, 114, 76, 111, 111, + 112, 71, 97, 105, 110, 66, 80, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 117, 116, 101, 114, 76, 111, 111, + 112, 71, 97, 105, 110, 86, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 110, 101, 114, 76, 111, 111, + 112, 71, 97, 105, 110, 66, 80, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 110, 101, 114, 76, 111, 111, + 112, 71, 97, 105, 110, 86, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 67, 111, 110, 115, + 116, 97, 110, 116, 66, 80, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 67, 111, 110, 115, + 116, 97, 110, 116, 86, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 116, 117, 97, 116, 111, 114, + 69, 102, 102, 101, 99, 116, 105, 118, + 101, 110, 101, 115, 115, 66, 80, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 116, 117, 97, 116, 111, 114, + 69, 102, 102, 101, 99, 116, 105, 118, + 101, 110, 101, 115, 115, 86, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a334472e045533b3 = b_a334472e045533b3.words; +#if !CAPNP_LITE +static const uint16_t m_a334472e045533b3[] = {10, 3, 11, 6, 1, 7, 4, 0, 5, 8, 2, 9}; +static const uint16_t i_a334472e045533b3[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; +const ::capnp::_::RawSchema s_a334472e045533b3 = { + 0xa334472e045533b3, b_a334472e045533b3.words, 250, nullptr, m_a334472e045533b3, + 0, 12, i_a334472e045533b3, nullptr, nullptr, { &s_a334472e045533b3, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<159> b_9d151e3f28616a12 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 18, 106, 97, 40, 63, 30, 21, 157, + 20, 0, 0, 0, 1, 0, 2, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 5, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 42, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 199, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 46, 76, 97, 116, 101, + 114, 97, 108, 76, 81, 82, 84, 117, + 110, 105, 110, 103, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 32, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 216, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 0, 0, 0, 3, 0, 1, 0, + 220, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 0, 0, 0, 3, 0, 1, 0, + 224, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 0, 0, 0, 3, 0, 1, 0, + 244, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 0, 0, 0, 3, 0, 1, 0, + 8, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 1, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 3, 0, 1, 0, + 28, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 1, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 1, 0, 0, 3, 0, 1, 0, + 48, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 1, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 1, 0, 0, 3, 0, 1, 0, + 68, 1, 0, 0, 2, 0, 1, 0, + 115, 99, 97, 108, 101, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 105, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 99, 71, 97, 105, 110, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9d151e3f28616a12 = b_9d151e3f28616a12.words; +#if !CAPNP_LITE +static const uint16_t m_9d151e3f28616a12[] = {3, 4, 5, 2, 6, 1, 7, 0}; +static const uint16_t i_9d151e3f28616a12[] = {0, 1, 2, 3, 4, 5, 6, 7}; +const ::capnp::_::RawSchema s_9d151e3f28616a12 = { + 0x9d151e3f28616a12, b_9d151e3f28616a12.words, 159, nullptr, m_9d151e3f28616a12, + 0, 8, i_9d151e3f28616a12, nullptr, nullptr, { &s_9d151e3f28616a12, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<139> b_95551e5b1edaf451 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 81, 244, 218, 30, 91, 30, 85, 149, + 20, 0, 0, 0, 2, 0, 0, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 2, 1, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 119, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 46, 83, 97, 102, 101, + 116, 121, 77, 111, 100, 101, 108, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 104, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 41, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 37, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 29, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 21, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 13, 1, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 13, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 5, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 249, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 245, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 237, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 229, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 225, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 217, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 205, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 0, 0, 0, 0, + 201, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 197, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 19, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 0, 0, 0, 0, + 185, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 0, 0, 0, 0, + 177, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 23, 0, 0, 0, 0, 0, 0, 0, + 173, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 0, 0, 0, 0, 0, 0, 0, + 169, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 0, 0, 0, 0, + 169, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 105, 108, 101, 110, 116, 0, 0, + 104, 111, 110, 100, 97, 78, 105, 100, + 101, 99, 0, 0, 0, 0, 0, 0, + 116, 111, 121, 111, 116, 97, 0, 0, + 101, 108, 109, 51, 50, 55, 0, 0, + 103, 109, 0, 0, 0, 0, 0, 0, + 104, 111, 110, 100, 97, 66, 111, 115, + 99, 104, 71, 105, 114, 97, 102, 102, + 101, 0, 0, 0, 0, 0, 0, 0, + 102, 111, 114, 100, 0, 0, 0, 0, + 99, 97, 100, 105, 108, 108, 97, 99, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 121, 117, 110, 100, 97, 105, 0, + 99, 104, 114, 121, 115, 108, 101, 114, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 101, 115, 108, 97, 0, 0, 0, + 115, 117, 98, 97, 114, 117, 0, 0, + 103, 109, 80, 97, 115, 115, 105, 118, + 101, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 122, 100, 97, 0, 0, 0, + 110, 105, 115, 115, 97, 110, 0, 0, + 118, 111, 108, 107, 115, 119, 97, 103, + 101, 110, 0, 0, 0, 0, 0, 0, + 116, 111, 121, 111, 116, 97, 73, 112, + 97, 115, 0, 0, 0, 0, 0, 0, + 97, 108, 108, 79, 117, 116, 112, 117, + 116, 0, 0, 0, 0, 0, 0, 0, + 103, 109, 65, 115, 99, 109, 0, 0, + 110, 111, 79, 117, 116, 112, 117, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 111, 110, 100, 97, 66, 111, 115, + 99, 104, 0, 0, 0, 0, 0, 0, + 118, 111, 108, 107, 115, 119, 97, 103, + 101, 110, 80, 113, 0, 0, 0, 0, + 115, 117, 98, 97, 114, 117, 76, 101, + 103, 97, 99, 121, 0, 0, 0, 0, + 104, 121, 117, 110, 100, 97, 105, 76, + 101, 103, 97, 99, 121, 0, 0, 0, + 104, 121, 117, 110, 100, 97, 105, 67, + 111, 109, 109, 117, 110, 105, 116, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 108, 108, 97, 110, 116, + 105, 115, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_95551e5b1edaf451 = b_95551e5b1edaf451.words; +#if !CAPNP_LITE +static const uint16_t m_95551e5b1edaf451[] = {17, 7, 9, 3, 6, 4, 18, 12, 20, 5, 1, 8, 24, 23, 13, 14, 19, 0, 25, 11, 22, 10, 2, 16, 15, 21}; +const ::capnp::_::RawSchema s_95551e5b1edaf451 = { + 0x95551e5b1edaf451, b_95551e5b1edaf451.words, 139, nullptr, m_95551e5b1edaf451, + 0, 26, nullptr, nullptr, nullptr, { &s_95551e5b1edaf451, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(SafetyModel_95551e5b1edaf451, 95551e5b1edaf451); +static const ::capnp::_::AlignedData<27> b_d661512be2def77f = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 127, 247, 222, 226, 43, 81, 97, 214, + 20, 0, 0, 0, 2, 0, 0, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 42, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 46, 83, 116, 101, 101, + 114, 67, 111, 110, 116, 114, 111, 108, + 84, 121, 112, 101, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 111, 114, 113, 117, 101, 0, 0, + 97, 110, 103, 108, 101, 0, 0, 0, } +}; +::capnp::word const* const bp_d661512be2def77f = b_d661512be2def77f.words; +#if !CAPNP_LITE +static const uint16_t m_d661512be2def77f[] = {1, 0}; +const ::capnp::_::RawSchema s_d661512be2def77f = { + 0xd661512be2def77f, b_d661512be2def77f.words, 27, nullptr, m_d661512be2def77f, + 0, 2, nullptr, nullptr, nullptr, { &s_d661512be2def77f, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(SteerControlType_d661512be2def77f, d661512be2def77f); +static const ::capnp::_::AlignedData<40> b_8f162eeb14bfc0ec = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 236, 192, 191, 20, 235, 46, 22, 143, + 20, 0, 0, 0, 2, 0, 0, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 42, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 127, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 46, 84, 114, 97, 110, + 115, 109, 105, 115, 115, 105, 111, 110, + 84, 121, 112, 101, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 111, 119, 110, 0, + 97, 117, 116, 111, 109, 97, 116, 105, + 99, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 110, 117, 97, 108, 0, 0, + 100, 105, 114, 101, 99, 116, 0, 0, + 99, 118, 116, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_8f162eeb14bfc0ec = b_8f162eeb14bfc0ec.words; +#if !CAPNP_LITE +static const uint16_t m_8f162eeb14bfc0ec[] = {1, 4, 3, 2, 0}; +const ::capnp::_::RawSchema s_8f162eeb14bfc0ec = { + 0x8f162eeb14bfc0ec, b_8f162eeb14bfc0ec.words, 40, nullptr, m_8f162eeb14bfc0ec, + 0, 5, nullptr, nullptr, nullptr, { &s_8f162eeb14bfc0ec, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(TransmissionType_8f162eeb14bfc0ec, 8f162eeb14bfc0ec); +static const ::capnp::_::AlignedData<80> b_962b56180c9359ce = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 206, 89, 147, 12, 24, 86, 43, 150, + 20, 0, 0, 0, 1, 0, 1, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 210, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 46, 67, 97, 114, 70, + 119, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 3, 0, 1, 0, + 104, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 0, 0, 0, 3, 0, 1, 0, + 112, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 0, 0, 0, 3, 0, 1, 0, + 116, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 0, 0, 0, 3, 0, 1, 0, + 124, 0, 0, 0, 2, 0, 1, 0, + 101, 99, 117, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 145, 214, 209, 89, 183, 155, 17, 247, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 119, 86, 101, 114, 115, 105, 111, + 110, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 100, 100, 114, 101, 115, 115, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 117, 98, 65, 100, 100, 114, 101, + 115, 115, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_962b56180c9359ce = b_962b56180c9359ce.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_962b56180c9359ce[] = { + &s_f7119bb759d1d691, +}; +static const uint16_t m_962b56180c9359ce[] = {2, 0, 1, 3}; +static const uint16_t i_962b56180c9359ce[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_962b56180c9359ce = { + 0x962b56180c9359ce, b_962b56180c9359ce.words, 80, d_962b56180c9359ce, m_962b56180c9359ce, + 1, 4, i_962b56180c9359ce, nullptr, nullptr, { &s_962b56180c9359ce, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<95> b_f7119bb759d1d691 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 145, 214, 209, 89, 183, 155, 17, 247, + 20, 0, 0, 0, 2, 0, 0, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 194, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 159, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 46, 69, 99, 117, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 68, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 177, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 173, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 165, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 157, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 149, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 141, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 137, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 129, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 112, 115, 0, 0, 0, 0, 0, + 101, 115, 112, 0, 0, 0, 0, 0, + 102, 119, 100, 82, 97, 100, 97, 114, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 119, 100, 67, 97, 109, 101, 114, + 97, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 103, 105, 110, 101, 0, 0, + 117, 110, 107, 110, 111, 119, 110, 0, + 100, 115, 117, 0, 0, 0, 0, 0, + 97, 112, 103, 115, 0, 0, 0, 0, + 116, 114, 97, 110, 115, 109, 105, 115, + 115, 105, 111, 110, 0, 0, 0, 0, + 115, 114, 115, 0, 0, 0, 0, 0, + 103, 97, 116, 101, 119, 97, 121, 0, + 104, 117, 100, 0, 0, 0, 0, 0, + 99, 111, 109, 98, 105, 110, 97, 116, + 105, 111, 110, 77, 101, 116, 101, 114, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 115, 97, 0, 0, 0, 0, 0, + 112, 114, 111, 103, 114, 97, 109, 109, + 101, 100, 70, 117, 101, 108, 73, 110, + 106, 101, 99, 116, 105, 111, 110, 0, + 101, 108, 101, 99, 116, 114, 105, 99, + 66, 114, 97, 107, 101, 66, 111, 111, + 115, 116, 101, 114, 0, 0, 0, 0, + 115, 104, 105, 102, 116, 66, 121, 87, + 105, 114, 101, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_f7119bb759d1d691 = b_f7119bb759d1d691.words; +#if !CAPNP_LITE +static const uint16_t m_f7119bb759d1d691[] = {7, 12, 6, 15, 4, 0, 1, 3, 2, 10, 11, 14, 16, 9, 8, 5, 13}; +const ::capnp::_::RawSchema s_f7119bb759d1d691 = { + 0xf7119bb759d1d691, b_f7119bb759d1d691.words, 95, nullptr, m_f7119bb759d1d691, + 0, 17, nullptr, nullptr, nullptr, { &s_f7119bb759d1d691, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(Ecu_f7119bb759d1d691, f7119bb759d1d691); +static const ::capnp::_::AlignedData<31> b_9fd95523d8dc40ce = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 206, 64, 220, 216, 35, 85, 217, 159, + 20, 0, 0, 0, 2, 0, 0, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 50, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 79, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 46, 70, 105, 110, 103, + 101, 114, 112, 114, 105, 110, 116, 83, + 111, 117, 114, 99, 101, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 0, 0, 0, 0, 0, + 102, 119, 0, 0, 0, 0, 0, 0, + 102, 105, 120, 101, 100, 0, 0, 0, } +}; +::capnp::word const* const bp_9fd95523d8dc40ce = b_9fd95523d8dc40ce.words; +#if !CAPNP_LITE +static const uint16_t m_9fd95523d8dc40ce[] = {0, 2, 1}; +const ::capnp::_::RawSchema s_9fd95523d8dc40ce = { + 0x9fd95523d8dc40ce, b_9fd95523d8dc40ce.words, 31, nullptr, m_9fd95523d8dc40ce, + 0, 3, nullptr, nullptr, nullptr, { &s_9fd95523d8dc40ce, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(FingerprintSource_9fd95523d8dc40ce, 9fd95523d8dc40ce); +static const ::capnp::_::AlignedData<28> b_ff99e3682a833c51 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 81, 60, 131, 42, 104, 227, 153, 255, + 20, 0, 0, 0, 2, 0, 0, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 34, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 46, 78, 101, 116, 119, + 111, 114, 107, 76, 111, 99, 97, 116, + 105, 111, 110, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 119, 100, 67, 97, 109, 101, 114, + 97, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 116, 101, 119, 97, 121, 0, } +}; +::capnp::word const* const bp_ff99e3682a833c51 = b_ff99e3682a833c51.words; +#if !CAPNP_LITE +static const uint16_t m_ff99e3682a833c51[] = {0, 1}; +const ::capnp::_::RawSchema s_ff99e3682a833c51 = { + 0xff99e3682a833c51, b_ff99e3682a833c51.words, 28, nullptr, m_ff99e3682a833c51, + 0, 2, nullptr, nullptr, nullptr, { &s_ff99e3682a833c51, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(NetworkLocation_ff99e3682a833c51, ff99e3682a833c51); +static const ::capnp::_::AlignedData<63> b_93fc580a35339568 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 104, 149, 51, 53, 10, 88, 252, 147, + 20, 0, 0, 0, 1, 0, 16, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 14, 0, 7, 0, 1, 0, 3, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 18, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 80, 97, 114, + 97, 109, 115, 46, 108, 97, 116, 101, + 114, 97, 108, 84, 117, 110, 105, 110, + 103, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 255, 255, 9, 0, 0, 0, + 0, 0, 1, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 3, 0, 1, 0, + 76, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 254, 255, 9, 0, 0, 0, + 0, 0, 1, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 0, 0, 3, 0, 1, 0, + 80, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 253, 255, 9, 0, 0, 0, + 0, 0, 1, 0, 40, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 0, 0, 0, 3, 0, 1, 0, + 84, 0, 0, 0, 2, 0, 1, 0, + 112, 105, 100, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 46, 76, 209, 203, 63, 114, 34, 150, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 100, 105, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 179, 51, 85, 4, 46, 71, 52, 163, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 113, 114, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 18, 106, 97, 40, 63, 30, 21, 157, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_93fc580a35339568 = b_93fc580a35339568.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_93fc580a35339568[] = { + &s_8c69372490aaa9da, + &s_9622723fcbd14c2e, + &s_9d151e3f28616a12, + &s_a334472e045533b3, +}; +static const uint16_t m_93fc580a35339568[] = {1, 2, 0}; +static const uint16_t i_93fc580a35339568[] = {0, 1, 2}; +const ::capnp::_::RawSchema s_93fc580a35339568 = { + 0x93fc580a35339568, b_93fc580a35339568.words, 63, d_93fc580a35339568, m_93fc580a35339568, + 4, 3, i_93fc580a35339568, nullptr, nullptr, { &s_93fc580a35339568, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +} // namespace schemas +} // namespace capnp + +// ======================================================================================= + +namespace cereal { + +// CarEvent +constexpr uint16_t CarEvent::_capnpPrivate::dataWordSize; +constexpr uint16_t CarEvent::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarEvent::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarEvent::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarState +constexpr uint16_t CarState::_capnpPrivate::dataWordSize; +constexpr uint16_t CarState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarState::WheelSpeeds +constexpr uint16_t CarState::WheelSpeeds::_capnpPrivate::dataWordSize; +constexpr uint16_t CarState::WheelSpeeds::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarState::WheelSpeeds::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarState::WheelSpeeds::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarState::CruiseState +constexpr uint16_t CarState::CruiseState::_capnpPrivate::dataWordSize; +constexpr uint16_t CarState::CruiseState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarState::CruiseState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarState::CruiseState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarState::ButtonEvent +constexpr uint16_t CarState::ButtonEvent::_capnpPrivate::dataWordSize; +constexpr uint16_t CarState::ButtonEvent::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarState::ButtonEvent::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarState::ButtonEvent::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// RadarData +constexpr uint16_t RadarData::_capnpPrivate::dataWordSize; +constexpr uint16_t RadarData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind RadarData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* RadarData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// RadarData::RadarPoint +constexpr uint16_t RadarData::RadarPoint::_capnpPrivate::dataWordSize; +constexpr uint16_t RadarData::RadarPoint::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind RadarData::RadarPoint::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* RadarData::RadarPoint::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarControl +constexpr uint16_t CarControl::_capnpPrivate::dataWordSize; +constexpr uint16_t CarControl::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarControl::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarControl::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarControl::Actuators +constexpr uint16_t CarControl::Actuators::_capnpPrivate::dataWordSize; +constexpr uint16_t CarControl::Actuators::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarControl::Actuators::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarControl::Actuators::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarControl::CruiseControl +constexpr uint16_t CarControl::CruiseControl::_capnpPrivate::dataWordSize; +constexpr uint16_t CarControl::CruiseControl::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarControl::CruiseControl::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarControl::CruiseControl::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarControl::HUDControl +constexpr uint16_t CarControl::HUDControl::_capnpPrivate::dataWordSize; +constexpr uint16_t CarControl::HUDControl::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarControl::HUDControl::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarControl::HUDControl::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarParams +constexpr uint16_t CarParams::_capnpPrivate::dataWordSize; +constexpr uint16_t CarParams::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarParams::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarParams::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarParams::SafetyConfig +constexpr uint16_t CarParams::SafetyConfig::_capnpPrivate::dataWordSize; +constexpr uint16_t CarParams::SafetyConfig::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarParams::SafetyConfig::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarParams::SafetyConfig::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarParams::LateralParams +constexpr uint16_t CarParams::LateralParams::_capnpPrivate::dataWordSize; +constexpr uint16_t CarParams::LateralParams::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarParams::LateralParams::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarParams::LateralParams::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarParams::LateralPIDTuning +constexpr uint16_t CarParams::LateralPIDTuning::_capnpPrivate::dataWordSize; +constexpr uint16_t CarParams::LateralPIDTuning::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarParams::LateralPIDTuning::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarParams::LateralPIDTuning::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarParams::LongitudinalPIDTuning +constexpr uint16_t CarParams::LongitudinalPIDTuning::_capnpPrivate::dataWordSize; +constexpr uint16_t CarParams::LongitudinalPIDTuning::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarParams::LongitudinalPIDTuning::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarParams::LongitudinalPIDTuning::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarParams::LateralINDITuning +constexpr uint16_t CarParams::LateralINDITuning::_capnpPrivate::dataWordSize; +constexpr uint16_t CarParams::LateralINDITuning::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarParams::LateralINDITuning::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarParams::LateralINDITuning::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarParams::LateralLQRTuning +constexpr uint16_t CarParams::LateralLQRTuning::_capnpPrivate::dataWordSize; +constexpr uint16_t CarParams::LateralLQRTuning::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarParams::LateralLQRTuning::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarParams::LateralLQRTuning::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarParams::CarFw +constexpr uint16_t CarParams::CarFw::_capnpPrivate::dataWordSize; +constexpr uint16_t CarParams::CarFw::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarParams::CarFw::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarParams::CarFw::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CarParams::LateralTuning +constexpr uint16_t CarParams::LateralTuning::_capnpPrivate::dataWordSize; +constexpr uint16_t CarParams::LateralTuning::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CarParams::LateralTuning::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarParams::LateralTuning::_capnpPrivate::schema; +#endif // !CAPNP_LITE + + +} // namespace + diff --git a/cereal/gen/cpp/car.capnp.h b/cereal/gen/cpp/car.capnp.h new file mode 100644 index 000000000..dd79197e1 --- /dev/null +++ b/cereal/gen/cpp/car.capnp.h @@ -0,0 +1,7711 @@ +// Generated by Cap'n Proto compiler, DO NOT EDIT +// source: car.capnp + +#pragma once + +#include +#include + +#if CAPNP_VERSION != 8000 +#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." +#endif + + +namespace capnp { +namespace schemas { + +CAPNP_DECLARE_SCHEMA(9b1657f34caf3ad3); +CAPNP_DECLARE_SCHEMA(baa8c5d505f727de); +enum class EventName_baa8c5d505f727de: uint16_t { + CAN_ERROR, + STEER_UNAVAILABLE, + BRAKE_UNAVAILABLE, + GAS_UNAVAILABLE_D_E_P_R_E_C_A_T_E_D, + WRONG_GEAR, + DOOR_OPEN, + SEATBELT_NOT_LATCHED, + ESP_DISABLED, + WRONG_CAR_MODE, + STEER_TEMP_UNAVAILABLE, + REVERSE_GEAR, + BUTTON_CANCEL, + BUTTON_ENABLE, + PEDAL_PRESSED, + CRUISE_DISABLED, + RADAR_CAN_ERROR_D_E_P_R_E_C_A_T_E_D, + DATA_NEEDED_D_E_P_R_E_C_A_T_E_D, + SPEED_TOO_LOW, + OUT_OF_SPACE, + OVERHEAT, + CALIBRATION_INCOMPLETE, + CALIBRATION_INVALID, + CONTROLS_MISMATCH, + PCM_ENABLE, + PCM_DISABLE, + NO_TARGET, + RADAR_FAULT, + MODEL_COMM_ISSUE_D_E_P_R_E_C_A_T_E_D, + BRAKE_HOLD, + PARK_BRAKE, + MANUAL_RESTART, + LOW_SPEED_LOCKOUT, + PLANNER_ERROR, + IPAS_OVERRIDE_D_E_P_R_E_C_A_T_E_D, + JOYSTICK_DEBUG, + STEER_TEMP_UNAVAILABLE_SILENT, + RESUME_REQUIRED, + PRE_DRIVER_DISTRACTED, + PROMPT_DRIVER_DISTRACTED, + DRIVER_DISTRACTED, + GEOFENCE_D_E_P_R_E_C_A_T_E_D, + DRIVER_MONITOR_ON_D_E_P_R_E_C_A_T_E_D, + DRIVER_MONITOR_OFF_D_E_P_R_E_C_A_T_E_D, + PRE_DRIVER_UNRESPONSIVE, + PROMPT_DRIVER_UNRESPONSIVE, + DRIVER_UNRESPONSIVE, + BELOW_STEER_SPEED, + CALIBRATION_PROGRESS_D_E_P_R_E_C_A_T_E_D, + LOW_BATTERY, + INVALID_GIRAFFE_HONDA_D_E_P_R_E_C_A_T_E_D, + VEHICLE_MODEL_INVALID, + ACC_FAULTED, + SENSOR_DATA_INVALID, + COMM_ISSUE, + TOO_DISTRACTED, + POSENET_INVALID, + SOUNDS_UNAVAILABLE, + PRE_LANE_CHANGE_LEFT, + PRE_LANE_CHANGE_RIGHT, + LANE_CHANGE, + INVALID_GIRAFFE_TOYOTA_D_E_P_R_E_C_A_T_E_D, + INTERNET_CONNECTIVITY_NEEDED_D_E_P_R_E_C_A_T_E_D, + COMMUNITY_FEATURE_DISALLOWED_D_E_P_R_E_C_A_T_E_D, + LOW_MEMORY, + STOCK_AEB, + LDW, + CAR_UNRECOGNIZED, + RADAR_COMM_ISSUE_D_E_P_R_E_C_A_T_E_D, + DRIVER_MONITOR_LOW_ACC_D_E_P_R_E_C_A_T_E_D, + INVALID_LKAS_SETTING, + SPEED_TOO_HIGH, + LANE_CHANGE_BLOCKED, + RELAY_MALFUNCTION, + GAS_PRESSED, + STOCK_FCW, + STARTUP, + STARTUP_NO_CAR, + STARTUP_NO_CONTROL, + STARTUP_MASTER, + FCW, + STEER_SATURATED, + WHITE_PANDA_UNSUPPORTED_D_E_P_R_E_C_A_T_E_D, + STARTUP_ONEPLUS_D_E_P_R_E_C_A_T_E_D, + COMM_ISSUE_WARNING_D_E_P_R_E_C_A_T_E_D, + BELOW_ENGAGE_SPEED, + NO_GPS, + FOCUS_RECOVER_ACTIVE_D_E_P_R_E_C_A_T_E_D, + WRONG_CRUISE_MODE, + NEOS_UPDATE_REQUIRED_D_E_P_R_E_C_A_T_E_D, + MODELD_LAGGING, + DEVICE_FALLING, + FAN_MALFUNCTION, + CAMERA_MALFUNCTION, + MODEL_LAG_WARNING_D_E_P_R_E_C_A_T_E_D, + GPS_MALFUNCTION, + PROCESS_NOT_RUNNING, + DASHCAM_MODE, + STARTUP_FUZZY_FINGERPRINT_D_E_P_R_E_C_A_T_E_D, + CONTROLS_INITIALIZING, + USB_ERROR, + ROAD_CAMERA_ERROR, + DRIVER_CAMERA_ERROR, + WIDE_ROAD_CAMERA_ERROR, + LOCALIZER_MALFUNCTION, + STARTUP_NO_FW, + HIGH_CPU_USAGE, + CRUISE_MISMATCH, + LKAS_DISABLED, + PCC_ENABLED, + PCC_DISABLED, + PCC_ERROR, + ACC_ENABLED, + ACC_DISABLED, + I_BOOSTER_BRAKE_NOT_OK, +}; +CAPNP_DECLARE_ENUM(EventName, baa8c5d505f727de); +CAPNP_DECLARE_SCHEMA(9da4fa09e052903c); +CAPNP_DECLARE_SCHEMA(991a37a6155935a3); +CAPNP_DECLARE_SCHEMA(e64e81478e6e60af); +CAPNP_DECLARE_SCHEMA(e004ca45136f6a89); +enum class GearShifter_e004ca45136f6a89: uint16_t { + UNKNOWN, + PARK, + DRIVE, + NEUTRAL, + REVERSE, + SPORT, + LOW, + BRAKE, + ECO, + MANUMATIC, +}; +CAPNP_DECLARE_ENUM(GearShifter, e004ca45136f6a89); +CAPNP_DECLARE_SCHEMA(ff5ca6835b4acef6); +CAPNP_DECLARE_SCHEMA(e16100205414717c); +enum class Type_e16100205414717c: uint16_t { + UNKNOWN, + LEFT_BLINKER, + RIGHT_BLINKER, + ACCEL_CRUISE, + DECEL_CRUISE, + CANCEL, + ALT_BUTTON1, + ALT_BUTTON2, + ALT_BUTTON3, + SET_CRUISE, + RESUME_CRUISE, + GAP_ADJUST_CRUISE, +}; +CAPNP_DECLARE_ENUM(Type, e16100205414717c); +CAPNP_DECLARE_SCHEMA(888ad6581cf0aacb); +CAPNP_DECLARE_SCHEMA(e8a86679ebba76ad); +enum class Error_e8a86679ebba76ad: uint16_t { + CAN_ERROR, + FAULT, + WRONG_CONFIG, +}; +CAPNP_DECLARE_ENUM(Error, e8a86679ebba76ad); +CAPNP_DECLARE_SCHEMA(8ff333ebac1fdf36); +CAPNP_DECLARE_SCHEMA(f78829049ab814af); +CAPNP_DECLARE_SCHEMA(e97275a919432828); +CAPNP_DECLARE_SCHEMA(e40f3a917d908282); +enum class LongControlState_e40f3a917d908282: uint16_t { + OFF, + PID, + STOPPING, + STARTING_D_E_P_R_E_C_A_T_E_D, +}; +CAPNP_DECLARE_ENUM(LongControlState, e40f3a917d908282); +CAPNP_DECLARE_SCHEMA(b20e386e0e0ba8d3); +CAPNP_DECLARE_SCHEMA(d895c87c4eb03a38); +CAPNP_DECLARE_SCHEMA(90d78e84616e17d4); +enum class VisualAlert_90d78e84616e17d4: uint16_t { + NONE, + FCW, + STEER_REQUIRED, + BRAKE_PRESSED, + WRONG_GEAR, + SEATBELT_UNBUCKLED, + SPEED_TOO_HIGH, + LDW, +}; +CAPNP_DECLARE_ENUM(VisualAlert, 90d78e84616e17d4); +CAPNP_DECLARE_SCHEMA(f5a5e26c954e339e); +enum class AudibleAlert_f5a5e26c954e339e: uint16_t { + NONE, + ENGAGE, + DISENGAGE, + REFUSE, + WARNING_SOFT, + WARNING_IMMEDIATE, + PROMPT, + PROMPT_REPEAT, + PROMPT_DISTRACTED, +}; +CAPNP_DECLARE_ENUM(AudibleAlert, f5a5e26c954e339e); +CAPNP_DECLARE_SCHEMA(8c69372490aaa9da); +CAPNP_DECLARE_SCHEMA(e836349c6056b0c9); +CAPNP_DECLARE_SCHEMA(b581b23b1c89dda3); +CAPNP_DECLARE_SCHEMA(9622723fcbd14c2e); +CAPNP_DECLARE_SCHEMA(c342cefc303e9b8e); +CAPNP_DECLARE_SCHEMA(a334472e045533b3); +CAPNP_DECLARE_SCHEMA(9d151e3f28616a12); +CAPNP_DECLARE_SCHEMA(95551e5b1edaf451); +enum class SafetyModel_95551e5b1edaf451: uint16_t { + SILENT, + HONDA_NIDEC, + TOYOTA, + ELM327, + GM, + HONDA_BOSCH_GIRAFFE, + FORD, + CADILLAC, + HYUNDAI, + CHRYSLER, + TESLA, + SUBARU, + GM_PASSIVE, + MAZDA, + NISSAN, + VOLKSWAGEN, + TOYOTA_IPAS, + ALL_OUTPUT, + GM_ASCM, + NO_OUTPUT, + HONDA_BOSCH, + VOLKSWAGEN_PQ, + SUBARU_LEGACY, + HYUNDAI_LEGACY, + HYUNDAI_COMMUNITY, + STELLANTIS, +}; +CAPNP_DECLARE_ENUM(SafetyModel, 95551e5b1edaf451); +CAPNP_DECLARE_SCHEMA(d661512be2def77f); +enum class SteerControlType_d661512be2def77f: uint16_t { + TORQUE, + ANGLE, +}; +CAPNP_DECLARE_ENUM(SteerControlType, d661512be2def77f); +CAPNP_DECLARE_SCHEMA(8f162eeb14bfc0ec); +enum class TransmissionType_8f162eeb14bfc0ec: uint16_t { + UNKNOWN, + AUTOMATIC, + MANUAL, + DIRECT, + CVT, +}; +CAPNP_DECLARE_ENUM(TransmissionType, 8f162eeb14bfc0ec); +CAPNP_DECLARE_SCHEMA(962b56180c9359ce); +CAPNP_DECLARE_SCHEMA(f7119bb759d1d691); +enum class Ecu_f7119bb759d1d691: uint16_t { + EPS, + ESP, + FWD_RADAR, + FWD_CAMERA, + ENGINE, + UNKNOWN, + DSU, + APGS, + TRANSMISSION, + SRS, + GATEWAY, + HUD, + COMBINATION_METER, + VSA, + PROGRAMMED_FUEL_INJECTION, + ELECTRIC_BRAKE_BOOSTER, + SHIFT_BY_WIRE, +}; +CAPNP_DECLARE_ENUM(Ecu, f7119bb759d1d691); +CAPNP_DECLARE_SCHEMA(9fd95523d8dc40ce); +enum class FingerprintSource_9fd95523d8dc40ce: uint16_t { + CAN, + FW, + FIXED, +}; +CAPNP_DECLARE_ENUM(FingerprintSource, 9fd95523d8dc40ce); +CAPNP_DECLARE_SCHEMA(ff99e3682a833c51); +enum class NetworkLocation_ff99e3682a833c51: uint16_t { + FWD_CAMERA, + GATEWAY, +}; +CAPNP_DECLARE_ENUM(NetworkLocation, ff99e3682a833c51); +CAPNP_DECLARE_SCHEMA(93fc580a35339568); + +} // namespace schemas +} // namespace capnp + +namespace cereal { + +struct CarEvent { + CarEvent() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::EventName_baa8c5d505f727de EventName; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(9b1657f34caf3ad3, 1, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarState { + CarState() = delete; + + class Reader; + class Builder; + class Pipeline; + struct WheelSpeeds; + struct CruiseState; + typedef ::capnp::schemas::GearShifter_e004ca45136f6a89 GearShifter; + + struct ButtonEvent; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(9da4fa09e052903c, 7, 6) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarState::WheelSpeeds { + WheelSpeeds() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(991a37a6155935a3, 2, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarState::CruiseState { + CruiseState() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e64e81478e6e60af, 2, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarState::ButtonEvent { + ButtonEvent() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::Type_e16100205414717c Type; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(ff5ca6835b4acef6, 1, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct RadarData { + RadarData() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::Error_e8a86679ebba76ad Error; + + struct RadarPoint; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(888ad6581cf0aacb, 0, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct RadarData::RadarPoint { + RadarPoint() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(8ff333ebac1fdf36, 4, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarControl { + CarControl() = delete; + + class Reader; + class Builder; + class Pipeline; + struct Actuators; + struct CruiseControl; + struct HUDControl; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(f78829049ab814af, 3, 4) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarControl::Actuators { + Actuators() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::LongControlState_e40f3a917d908282 LongControlState; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e97275a919432828, 4, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarControl::CruiseControl { + CruiseControl() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(b20e386e0e0ba8d3, 2, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarControl::HUDControl { + HUDControl() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::VisualAlert_90d78e84616e17d4 VisualAlert; + + typedef ::capnp::schemas::AudibleAlert_f5a5e26c954e339e AudibleAlert; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d895c87c4eb03a38, 2, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarParams { + CarParams() = delete; + + class Reader; + class Builder; + class Pipeline; + struct SafetyConfig; + struct LateralParams; + struct LateralPIDTuning; + struct LongitudinalPIDTuning; + struct LateralINDITuning; + struct LateralLQRTuning; + typedef ::capnp::schemas::SafetyModel_95551e5b1edaf451 SafetyModel; + + typedef ::capnp::schemas::SteerControlType_d661512be2def77f SteerControlType; + + typedef ::capnp::schemas::TransmissionType_8f162eeb14bfc0ec TransmissionType; + + struct CarFw; + typedef ::capnp::schemas::Ecu_f7119bb759d1d691 Ecu; + + typedef ::capnp::schemas::FingerprintSource_9fd95523d8dc40ce FingerprintSource; + + typedef ::capnp::schemas::NetworkLocation_ff99e3682a833c51 NetworkLocation; + + struct LateralTuning; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(8c69372490aaa9da, 16, 14) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarParams::SafetyConfig { + SafetyConfig() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e836349c6056b0c9, 1, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarParams::LateralParams { + LateralParams() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(b581b23b1c89dda3, 0, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarParams::LateralPIDTuning { + LateralPIDTuning() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(9622723fcbd14c2e, 1, 4) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarParams::LongitudinalPIDTuning { + LongitudinalPIDTuning() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(c342cefc303e9b8e, 0, 6) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarParams::LateralINDITuning { + LateralINDITuning() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a334472e045533b3, 2, 8) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarParams::LateralLQRTuning { + LateralLQRTuning() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(9d151e3f28616a12, 2, 5) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarParams::CarFw { + CarFw() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(962b56180c9359ce, 1, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CarParams::LateralTuning { + LateralTuning() = delete; + + class Reader; + class Builder; + class Pipeline; + enum Which: uint16_t { + PID, + INDI, + LQR, + }; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(93fc580a35339568, 16, 14) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +// ======================================================================================= + +class CarEvent::Reader { +public: + typedef CarEvent Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::cereal::CarEvent::EventName getName() const; + + inline bool getEnable() const; + + inline bool getNoEntry() const; + + inline bool getWarning() const; + + inline bool getUserDisable() const; + + inline bool getSoftDisable() const; + + inline bool getImmediateDisable() const; + + inline bool getPreEnable() const; + + inline bool getPermanent() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarEvent::Builder { +public: + typedef CarEvent Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::cereal::CarEvent::EventName getName(); + inline void setName( ::cereal::CarEvent::EventName value); + + inline bool getEnable(); + inline void setEnable(bool value); + + inline bool getNoEntry(); + inline void setNoEntry(bool value); + + inline bool getWarning(); + inline void setWarning(bool value); + + inline bool getUserDisable(); + inline void setUserDisable(bool value); + + inline bool getSoftDisable(); + inline void setSoftDisable(bool value); + + inline bool getImmediateDisable(); + inline void setImmediateDisable(bool value); + + inline bool getPreEnable(); + inline void setPreEnable(bool value); + + inline bool getPermanent(); + inline void setPermanent(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarEvent::Pipeline { +public: + typedef CarEvent Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarState::Reader { +public: + typedef CarState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasErrorsDEPRECATED() const; + inline ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>::Reader getErrorsDEPRECATED() const; + + inline float getVEgo() const; + + inline bool hasWheelSpeeds() const; + inline ::cereal::CarState::WheelSpeeds::Reader getWheelSpeeds() const; + + inline float getGas() const; + + inline bool getGasPressed() const; + + inline float getBrake() const; + + inline bool getBrakePressed() const; + + inline float getSteeringAngleDeg() const; + + inline float getSteeringTorque() const; + + inline bool getSteeringPressed() const; + + inline bool hasCruiseState() const; + inline ::cereal::CarState::CruiseState::Reader getCruiseState() const; + + inline bool hasButtonEvents() const; + inline ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>::Reader getButtonEvents() const; + + inline bool hasCanMonoTimes() const; + inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader getCanMonoTimes() const; + + inline bool hasEvents() const; + inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader getEvents() const; + + inline ::cereal::CarState::GearShifter getGearShifter() const; + + inline float getSteeringRateDeg() const; + + inline float getAEgo() const; + + inline float getVEgoRaw() const; + + inline bool getStandstill() const; + + inline bool getBrakeLightsDEPRECATED() const; + + inline bool getLeftBlinker() const; + + inline bool getRightBlinker() const; + + inline float getYawRate() const; + + inline bool getGenericToggle() const; + + inline bool getDoorOpen() const; + + inline bool getSeatbeltUnlatched() const; + + inline bool getCanValid() const; + + inline float getSteeringTorqueEps() const; + + inline bool getClutchPressed() const; + + inline bool getSteeringRateLimited() const; + + inline bool getStockAeb() const; + + inline bool getStockFcw() const; + + inline bool getEspDisabled() const; + + inline bool getLeftBlindspot() const; + + inline bool getRightBlindspot() const; + + inline bool getSteerWarning() const; + + inline bool getSteerError() const; + + inline float getSteeringAngleOffsetDeg() const; + + inline bool getBrakeHoldActive() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarState::Builder { +public: + typedef CarState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasErrorsDEPRECATED(); + inline ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>::Builder getErrorsDEPRECATED(); + inline void setErrorsDEPRECATED( ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>::Reader value); + inline void setErrorsDEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>::Builder initErrorsDEPRECATED(unsigned int size); + inline void adoptErrorsDEPRECATED(::capnp::Orphan< ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>> disownErrorsDEPRECATED(); + + inline float getVEgo(); + inline void setVEgo(float value); + + inline bool hasWheelSpeeds(); + inline ::cereal::CarState::WheelSpeeds::Builder getWheelSpeeds(); + inline void setWheelSpeeds( ::cereal::CarState::WheelSpeeds::Reader value); + inline ::cereal::CarState::WheelSpeeds::Builder initWheelSpeeds(); + inline void adoptWheelSpeeds(::capnp::Orphan< ::cereal::CarState::WheelSpeeds>&& value); + inline ::capnp::Orphan< ::cereal::CarState::WheelSpeeds> disownWheelSpeeds(); + + inline float getGas(); + inline void setGas(float value); + + inline bool getGasPressed(); + inline void setGasPressed(bool value); + + inline float getBrake(); + inline void setBrake(float value); + + inline bool getBrakePressed(); + inline void setBrakePressed(bool value); + + inline float getSteeringAngleDeg(); + inline void setSteeringAngleDeg(float value); + + inline float getSteeringTorque(); + inline void setSteeringTorque(float value); + + inline bool getSteeringPressed(); + inline void setSteeringPressed(bool value); + + inline bool hasCruiseState(); + inline ::cereal::CarState::CruiseState::Builder getCruiseState(); + inline void setCruiseState( ::cereal::CarState::CruiseState::Reader value); + inline ::cereal::CarState::CruiseState::Builder initCruiseState(); + inline void adoptCruiseState(::capnp::Orphan< ::cereal::CarState::CruiseState>&& value); + inline ::capnp::Orphan< ::cereal::CarState::CruiseState> disownCruiseState(); + + inline bool hasButtonEvents(); + inline ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>::Builder getButtonEvents(); + inline void setButtonEvents( ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>::Builder initButtonEvents(unsigned int size); + inline void adoptButtonEvents(::capnp::Orphan< ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>> disownButtonEvents(); + + inline bool hasCanMonoTimes(); + inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder getCanMonoTimes(); + inline void setCanMonoTimes( ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setCanMonoTimes(::kj::ArrayPtr value); + inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder initCanMonoTimes(unsigned int size); + inline void adoptCanMonoTimes(::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>> disownCanMonoTimes(); + + inline bool hasEvents(); + inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder getEvents(); + inline void setEvents( ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder initEvents(unsigned int size); + inline void adoptEvents(::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>> disownEvents(); + + inline ::cereal::CarState::GearShifter getGearShifter(); + inline void setGearShifter( ::cereal::CarState::GearShifter value); + + inline float getSteeringRateDeg(); + inline void setSteeringRateDeg(float value); + + inline float getAEgo(); + inline void setAEgo(float value); + + inline float getVEgoRaw(); + inline void setVEgoRaw(float value); + + inline bool getStandstill(); + inline void setStandstill(bool value); + + inline bool getBrakeLightsDEPRECATED(); + inline void setBrakeLightsDEPRECATED(bool value); + + inline bool getLeftBlinker(); + inline void setLeftBlinker(bool value); + + inline bool getRightBlinker(); + inline void setRightBlinker(bool value); + + inline float getYawRate(); + inline void setYawRate(float value); + + inline bool getGenericToggle(); + inline void setGenericToggle(bool value); + + inline bool getDoorOpen(); + inline void setDoorOpen(bool value); + + inline bool getSeatbeltUnlatched(); + inline void setSeatbeltUnlatched(bool value); + + inline bool getCanValid(); + inline void setCanValid(bool value); + + inline float getSteeringTorqueEps(); + inline void setSteeringTorqueEps(float value); + + inline bool getClutchPressed(); + inline void setClutchPressed(bool value); + + inline bool getSteeringRateLimited(); + inline void setSteeringRateLimited(bool value); + + inline bool getStockAeb(); + inline void setStockAeb(bool value); + + inline bool getStockFcw(); + inline void setStockFcw(bool value); + + inline bool getEspDisabled(); + inline void setEspDisabled(bool value); + + inline bool getLeftBlindspot(); + inline void setLeftBlindspot(bool value); + + inline bool getRightBlindspot(); + inline void setRightBlindspot(bool value); + + inline bool getSteerWarning(); + inline void setSteerWarning(bool value); + + inline bool getSteerError(); + inline void setSteerError(bool value); + + inline float getSteeringAngleOffsetDeg(); + inline void setSteeringAngleOffsetDeg(float value); + + inline bool getBrakeHoldActive(); + inline void setBrakeHoldActive(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarState::Pipeline { +public: + typedef CarState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::CarState::WheelSpeeds::Pipeline getWheelSpeeds(); + inline ::cereal::CarState::CruiseState::Pipeline getCruiseState(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarState::WheelSpeeds::Reader { +public: + typedef WheelSpeeds Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline float getFl() const; + + inline float getFr() const; + + inline float getRl() const; + + inline float getRr() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarState::WheelSpeeds::Builder { +public: + typedef WheelSpeeds Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline float getFl(); + inline void setFl(float value); + + inline float getFr(); + inline void setFr(float value); + + inline float getRl(); + inline void setRl(float value); + + inline float getRr(); + inline void setRr(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarState::WheelSpeeds::Pipeline { +public: + typedef WheelSpeeds Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarState::CruiseState::Reader { +public: + typedef CruiseState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getEnabled() const; + + inline float getSpeed() const; + + inline bool getAvailable() const; + + inline float getSpeedOffset() const; + + inline bool getStandstill() const; + + inline bool getNonAdaptive() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarState::CruiseState::Builder { +public: + typedef CruiseState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getEnabled(); + inline void setEnabled(bool value); + + inline float getSpeed(); + inline void setSpeed(float value); + + inline bool getAvailable(); + inline void setAvailable(bool value); + + inline float getSpeedOffset(); + inline void setSpeedOffset(float value); + + inline bool getStandstill(); + inline void setStandstill(bool value); + + inline bool getNonAdaptive(); + inline void setNonAdaptive(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarState::CruiseState::Pipeline { +public: + typedef CruiseState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarState::ButtonEvent::Reader { +public: + typedef ButtonEvent Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getPressed() const; + + inline ::cereal::CarState::ButtonEvent::Type getType() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarState::ButtonEvent::Builder { +public: + typedef ButtonEvent Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getPressed(); + inline void setPressed(bool value); + + inline ::cereal::CarState::ButtonEvent::Type getType(); + inline void setType( ::cereal::CarState::ButtonEvent::Type value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarState::ButtonEvent::Pipeline { +public: + typedef ButtonEvent Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class RadarData::Reader { +public: + typedef RadarData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasErrors() const; + inline ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Reader getErrors() const; + + inline bool hasPoints() const; + inline ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>::Reader getPoints() const; + + inline bool hasCanMonoTimes() const; + inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader getCanMonoTimes() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class RadarData::Builder { +public: + typedef RadarData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasErrors(); + inline ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Builder getErrors(); + inline void setErrors( ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Reader value); + inline void setErrors(::kj::ArrayPtr value); + inline ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Builder initErrors(unsigned int size); + inline void adoptErrors(::capnp::Orphan< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>> disownErrors(); + + inline bool hasPoints(); + inline ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>::Builder getPoints(); + inline void setPoints( ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>::Builder initPoints(unsigned int size); + inline void adoptPoints(::capnp::Orphan< ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>> disownPoints(); + + inline bool hasCanMonoTimes(); + inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder getCanMonoTimes(); + inline void setCanMonoTimes( ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setCanMonoTimes(::kj::ArrayPtr value); + inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder initCanMonoTimes(unsigned int size); + inline void adoptCanMonoTimes(::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>> disownCanMonoTimes(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class RadarData::Pipeline { +public: + typedef RadarData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class RadarData::RadarPoint::Reader { +public: + typedef RadarPoint Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint64_t getTrackId() const; + + inline float getDRel() const; + + inline float getYRel() const; + + inline float getVRel() const; + + inline float getARel() const; + + inline float getYvRel() const; + + inline bool getMeasured() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class RadarData::RadarPoint::Builder { +public: + typedef RadarPoint Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint64_t getTrackId(); + inline void setTrackId( ::uint64_t value); + + inline float getDRel(); + inline void setDRel(float value); + + inline float getYRel(); + inline void setYRel(float value); + + inline float getVRel(); + inline void setVRel(float value); + + inline float getARel(); + inline void setARel(float value); + + inline float getYvRel(); + inline void setYvRel(float value); + + inline bool getMeasured(); + inline void setMeasured(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class RadarData::RadarPoint::Pipeline { +public: + typedef RadarPoint Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarControl::Reader { +public: + typedef CarControl Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getEnabled() const; + + inline float getGasDEPRECATED() const; + + inline float getBrakeDEPRECATED() const; + + inline float getSteeringTorqueDEPRECATED() const; + + inline bool hasCruiseControl() const; + inline ::cereal::CarControl::CruiseControl::Reader getCruiseControl() const; + + inline bool hasHudControl() const; + inline ::cereal::CarControl::HUDControl::Reader getHudControl() const; + + inline bool hasActuators() const; + inline ::cereal::CarControl::Actuators::Reader getActuators() const; + + inline bool getActive() const; + + inline float getRoll() const; + + inline float getPitch() const; + + inline bool hasActuatorsOutput() const; + inline ::cereal::CarControl::Actuators::Reader getActuatorsOutput() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarControl::Builder { +public: + typedef CarControl Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getEnabled(); + inline void setEnabled(bool value); + + inline float getGasDEPRECATED(); + inline void setGasDEPRECATED(float value); + + inline float getBrakeDEPRECATED(); + inline void setBrakeDEPRECATED(float value); + + inline float getSteeringTorqueDEPRECATED(); + inline void setSteeringTorqueDEPRECATED(float value); + + inline bool hasCruiseControl(); + inline ::cereal::CarControl::CruiseControl::Builder getCruiseControl(); + inline void setCruiseControl( ::cereal::CarControl::CruiseControl::Reader value); + inline ::cereal::CarControl::CruiseControl::Builder initCruiseControl(); + inline void adoptCruiseControl(::capnp::Orphan< ::cereal::CarControl::CruiseControl>&& value); + inline ::capnp::Orphan< ::cereal::CarControl::CruiseControl> disownCruiseControl(); + + inline bool hasHudControl(); + inline ::cereal::CarControl::HUDControl::Builder getHudControl(); + inline void setHudControl( ::cereal::CarControl::HUDControl::Reader value); + inline ::cereal::CarControl::HUDControl::Builder initHudControl(); + inline void adoptHudControl(::capnp::Orphan< ::cereal::CarControl::HUDControl>&& value); + inline ::capnp::Orphan< ::cereal::CarControl::HUDControl> disownHudControl(); + + inline bool hasActuators(); + inline ::cereal::CarControl::Actuators::Builder getActuators(); + inline void setActuators( ::cereal::CarControl::Actuators::Reader value); + inline ::cereal::CarControl::Actuators::Builder initActuators(); + inline void adoptActuators(::capnp::Orphan< ::cereal::CarControl::Actuators>&& value); + inline ::capnp::Orphan< ::cereal::CarControl::Actuators> disownActuators(); + + inline bool getActive(); + inline void setActive(bool value); + + inline float getRoll(); + inline void setRoll(float value); + + inline float getPitch(); + inline void setPitch(float value); + + inline bool hasActuatorsOutput(); + inline ::cereal::CarControl::Actuators::Builder getActuatorsOutput(); + inline void setActuatorsOutput( ::cereal::CarControl::Actuators::Reader value); + inline ::cereal::CarControl::Actuators::Builder initActuatorsOutput(); + inline void adoptActuatorsOutput(::capnp::Orphan< ::cereal::CarControl::Actuators>&& value); + inline ::capnp::Orphan< ::cereal::CarControl::Actuators> disownActuatorsOutput(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarControl::Pipeline { +public: + typedef CarControl Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::CarControl::CruiseControl::Pipeline getCruiseControl(); + inline ::cereal::CarControl::HUDControl::Pipeline getHudControl(); + inline ::cereal::CarControl::Actuators::Pipeline getActuators(); + inline ::cereal::CarControl::Actuators::Pipeline getActuatorsOutput(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarControl::Actuators::Reader { +public: + typedef Actuators Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline float getGas() const; + + inline float getBrake() const; + + inline float getSteer() const; + + inline float getSteeringAngleDeg() const; + + inline float getAccel() const; + + inline ::cereal::CarControl::Actuators::LongControlState getLongControlState() const; + + inline float getSpeed() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarControl::Actuators::Builder { +public: + typedef Actuators Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline float getGas(); + inline void setGas(float value); + + inline float getBrake(); + inline void setBrake(float value); + + inline float getSteer(); + inline void setSteer(float value); + + inline float getSteeringAngleDeg(); + inline void setSteeringAngleDeg(float value); + + inline float getAccel(); + inline void setAccel(float value); + + inline ::cereal::CarControl::Actuators::LongControlState getLongControlState(); + inline void setLongControlState( ::cereal::CarControl::Actuators::LongControlState value); + + inline float getSpeed(); + inline void setSpeed(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarControl::Actuators::Pipeline { +public: + typedef Actuators Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarControl::CruiseControl::Reader { +public: + typedef CruiseControl Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getCancel() const; + + inline bool getOverride() const; + + inline float getSpeedOverride() const; + + inline float getAccelOverride() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarControl::CruiseControl::Builder { +public: + typedef CruiseControl Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getCancel(); + inline void setCancel(bool value); + + inline bool getOverride(); + inline void setOverride(bool value); + + inline float getSpeedOverride(); + inline void setSpeedOverride(float value); + + inline float getAccelOverride(); + inline void setAccelOverride(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarControl::CruiseControl::Pipeline { +public: + typedef CruiseControl Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarControl::HUDControl::Reader { +public: + typedef HUDControl Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getSpeedVisible() const; + + inline float getSetSpeed() const; + + inline bool getLanesVisible() const; + + inline bool getLeadVisible() const; + + inline ::cereal::CarControl::HUDControl::VisualAlert getVisualAlert() const; + + inline ::cereal::CarControl::HUDControl::AudibleAlert getAudibleAlert() const; + + inline bool getRightLaneVisible() const; + + inline bool getLeftLaneVisible() const; + + inline bool getRightLaneDepart() const; + + inline bool getLeftLaneDepart() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarControl::HUDControl::Builder { +public: + typedef HUDControl Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getSpeedVisible(); + inline void setSpeedVisible(bool value); + + inline float getSetSpeed(); + inline void setSetSpeed(float value); + + inline bool getLanesVisible(); + inline void setLanesVisible(bool value); + + inline bool getLeadVisible(); + inline void setLeadVisible(bool value); + + inline ::cereal::CarControl::HUDControl::VisualAlert getVisualAlert(); + inline void setVisualAlert( ::cereal::CarControl::HUDControl::VisualAlert value); + + inline ::cereal::CarControl::HUDControl::AudibleAlert getAudibleAlert(); + inline void setAudibleAlert( ::cereal::CarControl::HUDControl::AudibleAlert value); + + inline bool getRightLaneVisible(); + inline void setRightLaneVisible(bool value); + + inline bool getLeftLaneVisible(); + inline void setLeftLaneVisible(bool value); + + inline bool getRightLaneDepart(); + inline void setRightLaneDepart(bool value); + + inline bool getLeftLaneDepart(); + inline void setLeftLaneDepart(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarControl::HUDControl::Pipeline { +public: + typedef HUDControl Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarParams::Reader { +public: + typedef CarParams Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasCarName() const; + inline ::capnp::Text::Reader getCarName() const; + + inline bool hasCarFingerprint() const; + inline ::capnp::Text::Reader getCarFingerprint() const; + + inline bool getEnableGasInterceptor() const; + + inline bool getPcmCruise() const; + + inline bool getEnableCameraDEPRECATED() const; + + inline bool getEnableDsu() const; + + inline bool getEnableApgs() const; + + inline float getMinEnableSpeed() const; + + inline float getMinSteerSpeed() const; + + inline ::cereal::CarParams::SafetyModel getSafetyModelDEPRECATED() const; + + inline ::int16_t getSafetyParamDEPRECATED() const; + + inline bool hasSteerMaxBP() const; + inline ::capnp::List::Reader getSteerMaxBP() const; + + inline bool hasSteerMaxV() const; + inline ::capnp::List::Reader getSteerMaxV() const; + + inline bool hasGasMaxBPDEPRECATED() const; + inline ::capnp::List::Reader getGasMaxBPDEPRECATED() const; + + inline bool hasGasMaxVDEPRECATED() const; + inline ::capnp::List::Reader getGasMaxVDEPRECATED() const; + + inline bool hasBrakeMaxBPDEPRECATED() const; + inline ::capnp::List::Reader getBrakeMaxBPDEPRECATED() const; + + inline bool hasBrakeMaxVDEPRECATED() const; + inline ::capnp::List::Reader getBrakeMaxVDEPRECATED() const; + + inline float getMass() const; + + inline float getWheelbase() const; + + inline float getCenterToFront() const; + + inline float getSteerRatio() const; + + inline float getSteerRatioRear() const; + + inline float getRotationalInertia() const; + + inline float getTireStiffnessFront() const; + + inline float getTireStiffnessRear() const; + + inline bool hasLongitudinalTuning() const; + inline ::cereal::CarParams::LongitudinalPIDTuning::Reader getLongitudinalTuning() const; + + inline typename LateralTuning::Reader getLateralTuning() const; + + inline bool getSteerLimitAlert() const; + + inline float getVEgoStopping() const; + + inline bool getDirectAccelControl() const; + + inline bool getStoppingControl() const; + + inline float getStartAccelDEPRECATED() const; + + inline float getSteerRateCost() const; + + inline ::cereal::CarParams::SteerControlType getSteerControlType() const; + + inline bool getRadarOffCan() const; + + inline float getSteerActuatorDelay() const; + + inline bool getOpenpilotLongitudinalControl() const; + + inline bool hasCarVin() const; + inline ::capnp::Text::Reader getCarVin() const; + + inline bool getIsPandaBlackDEPRECATED() const; + + inline bool getDashcamOnly() const; + + inline ::cereal::CarParams::SafetyModel getSafetyModelPassiveDEPRECATED() const; + + inline ::cereal::CarParams::TransmissionType getTransmissionType() const; + + inline bool hasCarFw() const; + inline ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>::Reader getCarFw() const; + + inline float getRadarTimeStep() const; + + inline bool getCommunityFeatureDEPRECATED() const; + + inline float getSteerLimitTimer() const; + + inline bool hasLateralParams() const; + inline ::cereal::CarParams::LateralParams::Reader getLateralParams() const; + + inline ::cereal::CarParams::FingerprintSource getFingerprintSource() const; + + inline ::cereal::CarParams::NetworkLocation getNetworkLocation() const; + + inline float getMinSpeedCanDEPRECATED() const; + + inline float getStoppingDecelRate() const; + + inline float getStartingAccelRateDEPRECATED() const; + + inline float getMaxSteeringAngleDeg() const; + + inline bool getFuzzyFingerprint() const; + + inline bool getEnableBsm() const; + + inline bool getHasStockCameraDEPRECATED() const; + + inline float getLongitudinalActuatorDelayUpperBound() const; + + inline float getVEgoStarting() const; + + inline float getStopAccel() const; + + inline float getLongitudinalActuatorDelayLowerBound() const; + + inline bool hasSafetyConfigs() const; + inline ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>::Reader getSafetyConfigs() const; + + inline float getWheelSpeedFactor() const; + + inline ::uint32_t getFlags() const; + + inline ::int16_t getUnsafeMode() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarParams::Builder { +public: + typedef CarParams Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasCarName(); + inline ::capnp::Text::Builder getCarName(); + inline void setCarName( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initCarName(unsigned int size); + inline void adoptCarName(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownCarName(); + + inline bool hasCarFingerprint(); + inline ::capnp::Text::Builder getCarFingerprint(); + inline void setCarFingerprint( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initCarFingerprint(unsigned int size); + inline void adoptCarFingerprint(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownCarFingerprint(); + + inline bool getEnableGasInterceptor(); + inline void setEnableGasInterceptor(bool value); + + inline bool getPcmCruise(); + inline void setPcmCruise(bool value); + + inline bool getEnableCameraDEPRECATED(); + inline void setEnableCameraDEPRECATED(bool value); + + inline bool getEnableDsu(); + inline void setEnableDsu(bool value); + + inline bool getEnableApgs(); + inline void setEnableApgs(bool value); + + inline float getMinEnableSpeed(); + inline void setMinEnableSpeed(float value); + + inline float getMinSteerSpeed(); + inline void setMinSteerSpeed(float value); + + inline ::cereal::CarParams::SafetyModel getSafetyModelDEPRECATED(); + inline void setSafetyModelDEPRECATED( ::cereal::CarParams::SafetyModel value); + + inline ::int16_t getSafetyParamDEPRECATED(); + inline void setSafetyParamDEPRECATED( ::int16_t value); + + inline bool hasSteerMaxBP(); + inline ::capnp::List::Builder getSteerMaxBP(); + inline void setSteerMaxBP( ::capnp::List::Reader value); + inline void setSteerMaxBP(::kj::ArrayPtr value); + inline ::capnp::List::Builder initSteerMaxBP(unsigned int size); + inline void adoptSteerMaxBP(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownSteerMaxBP(); + + inline bool hasSteerMaxV(); + inline ::capnp::List::Builder getSteerMaxV(); + inline void setSteerMaxV( ::capnp::List::Reader value); + inline void setSteerMaxV(::kj::ArrayPtr value); + inline ::capnp::List::Builder initSteerMaxV(unsigned int size); + inline void adoptSteerMaxV(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownSteerMaxV(); + + inline bool hasGasMaxBPDEPRECATED(); + inline ::capnp::List::Builder getGasMaxBPDEPRECATED(); + inline void setGasMaxBPDEPRECATED( ::capnp::List::Reader value); + inline void setGasMaxBPDEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initGasMaxBPDEPRECATED(unsigned int size); + inline void adoptGasMaxBPDEPRECATED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownGasMaxBPDEPRECATED(); + + inline bool hasGasMaxVDEPRECATED(); + inline ::capnp::List::Builder getGasMaxVDEPRECATED(); + inline void setGasMaxVDEPRECATED( ::capnp::List::Reader value); + inline void setGasMaxVDEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initGasMaxVDEPRECATED(unsigned int size); + inline void adoptGasMaxVDEPRECATED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownGasMaxVDEPRECATED(); + + inline bool hasBrakeMaxBPDEPRECATED(); + inline ::capnp::List::Builder getBrakeMaxBPDEPRECATED(); + inline void setBrakeMaxBPDEPRECATED( ::capnp::List::Reader value); + inline void setBrakeMaxBPDEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initBrakeMaxBPDEPRECATED(unsigned int size); + inline void adoptBrakeMaxBPDEPRECATED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownBrakeMaxBPDEPRECATED(); + + inline bool hasBrakeMaxVDEPRECATED(); + inline ::capnp::List::Builder getBrakeMaxVDEPRECATED(); + inline void setBrakeMaxVDEPRECATED( ::capnp::List::Reader value); + inline void setBrakeMaxVDEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initBrakeMaxVDEPRECATED(unsigned int size); + inline void adoptBrakeMaxVDEPRECATED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownBrakeMaxVDEPRECATED(); + + inline float getMass(); + inline void setMass(float value); + + inline float getWheelbase(); + inline void setWheelbase(float value); + + inline float getCenterToFront(); + inline void setCenterToFront(float value); + + inline float getSteerRatio(); + inline void setSteerRatio(float value); + + inline float getSteerRatioRear(); + inline void setSteerRatioRear(float value); + + inline float getRotationalInertia(); + inline void setRotationalInertia(float value); + + inline float getTireStiffnessFront(); + inline void setTireStiffnessFront(float value); + + inline float getTireStiffnessRear(); + inline void setTireStiffnessRear(float value); + + inline bool hasLongitudinalTuning(); + inline ::cereal::CarParams::LongitudinalPIDTuning::Builder getLongitudinalTuning(); + inline void setLongitudinalTuning( ::cereal::CarParams::LongitudinalPIDTuning::Reader value); + inline ::cereal::CarParams::LongitudinalPIDTuning::Builder initLongitudinalTuning(); + inline void adoptLongitudinalTuning(::capnp::Orphan< ::cereal::CarParams::LongitudinalPIDTuning>&& value); + inline ::capnp::Orphan< ::cereal::CarParams::LongitudinalPIDTuning> disownLongitudinalTuning(); + + inline typename LateralTuning::Builder getLateralTuning(); + inline typename LateralTuning::Builder initLateralTuning(); + + inline bool getSteerLimitAlert(); + inline void setSteerLimitAlert(bool value); + + inline float getVEgoStopping(); + inline void setVEgoStopping(float value); + + inline bool getDirectAccelControl(); + inline void setDirectAccelControl(bool value); + + inline bool getStoppingControl(); + inline void setStoppingControl(bool value); + + inline float getStartAccelDEPRECATED(); + inline void setStartAccelDEPRECATED(float value); + + inline float getSteerRateCost(); + inline void setSteerRateCost(float value); + + inline ::cereal::CarParams::SteerControlType getSteerControlType(); + inline void setSteerControlType( ::cereal::CarParams::SteerControlType value); + + inline bool getRadarOffCan(); + inline void setRadarOffCan(bool value); + + inline float getSteerActuatorDelay(); + inline void setSteerActuatorDelay(float value); + + inline bool getOpenpilotLongitudinalControl(); + inline void setOpenpilotLongitudinalControl(bool value); + + inline bool hasCarVin(); + inline ::capnp::Text::Builder getCarVin(); + inline void setCarVin( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initCarVin(unsigned int size); + inline void adoptCarVin(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownCarVin(); + + inline bool getIsPandaBlackDEPRECATED(); + inline void setIsPandaBlackDEPRECATED(bool value); + + inline bool getDashcamOnly(); + inline void setDashcamOnly(bool value); + + inline ::cereal::CarParams::SafetyModel getSafetyModelPassiveDEPRECATED(); + inline void setSafetyModelPassiveDEPRECATED( ::cereal::CarParams::SafetyModel value); + + inline ::cereal::CarParams::TransmissionType getTransmissionType(); + inline void setTransmissionType( ::cereal::CarParams::TransmissionType value); + + inline bool hasCarFw(); + inline ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>::Builder getCarFw(); + inline void setCarFw( ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>::Builder initCarFw(unsigned int size); + inline void adoptCarFw(::capnp::Orphan< ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>> disownCarFw(); + + inline float getRadarTimeStep(); + inline void setRadarTimeStep(float value); + + inline bool getCommunityFeatureDEPRECATED(); + inline void setCommunityFeatureDEPRECATED(bool value); + + inline float getSteerLimitTimer(); + inline void setSteerLimitTimer(float value); + + inline bool hasLateralParams(); + inline ::cereal::CarParams::LateralParams::Builder getLateralParams(); + inline void setLateralParams( ::cereal::CarParams::LateralParams::Reader value); + inline ::cereal::CarParams::LateralParams::Builder initLateralParams(); + inline void adoptLateralParams(::capnp::Orphan< ::cereal::CarParams::LateralParams>&& value); + inline ::capnp::Orphan< ::cereal::CarParams::LateralParams> disownLateralParams(); + + inline ::cereal::CarParams::FingerprintSource getFingerprintSource(); + inline void setFingerprintSource( ::cereal::CarParams::FingerprintSource value); + + inline ::cereal::CarParams::NetworkLocation getNetworkLocation(); + inline void setNetworkLocation( ::cereal::CarParams::NetworkLocation value); + + inline float getMinSpeedCanDEPRECATED(); + inline void setMinSpeedCanDEPRECATED(float value); + + inline float getStoppingDecelRate(); + inline void setStoppingDecelRate(float value); + + inline float getStartingAccelRateDEPRECATED(); + inline void setStartingAccelRateDEPRECATED(float value); + + inline float getMaxSteeringAngleDeg(); + inline void setMaxSteeringAngleDeg(float value); + + inline bool getFuzzyFingerprint(); + inline void setFuzzyFingerprint(bool value); + + inline bool getEnableBsm(); + inline void setEnableBsm(bool value); + + inline bool getHasStockCameraDEPRECATED(); + inline void setHasStockCameraDEPRECATED(bool value); + + inline float getLongitudinalActuatorDelayUpperBound(); + inline void setLongitudinalActuatorDelayUpperBound(float value); + + inline float getVEgoStarting(); + inline void setVEgoStarting(float value); + + inline float getStopAccel(); + inline void setStopAccel(float value); + + inline float getLongitudinalActuatorDelayLowerBound(); + inline void setLongitudinalActuatorDelayLowerBound(float value); + + inline bool hasSafetyConfigs(); + inline ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>::Builder getSafetyConfigs(); + inline void setSafetyConfigs( ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>::Builder initSafetyConfigs(unsigned int size); + inline void adoptSafetyConfigs(::capnp::Orphan< ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>> disownSafetyConfigs(); + + inline float getWheelSpeedFactor(); + inline void setWheelSpeedFactor(float value); + + inline ::uint32_t getFlags(); + inline void setFlags( ::uint32_t value); + + inline ::int16_t getUnsafeMode(); + inline void setUnsafeMode( ::int16_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarParams::Pipeline { +public: + typedef CarParams Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::CarParams::LongitudinalPIDTuning::Pipeline getLongitudinalTuning(); + inline typename LateralTuning::Pipeline getLateralTuning(); + inline ::cereal::CarParams::LateralParams::Pipeline getLateralParams(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarParams::SafetyConfig::Reader { +public: + typedef SafetyConfig Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::cereal::CarParams::SafetyModel getSafetyModel() const; + + inline ::int16_t getSafetyParam() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarParams::SafetyConfig::Builder { +public: + typedef SafetyConfig Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::cereal::CarParams::SafetyModel getSafetyModel(); + inline void setSafetyModel( ::cereal::CarParams::SafetyModel value); + + inline ::int16_t getSafetyParam(); + inline void setSafetyParam( ::int16_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarParams::SafetyConfig::Pipeline { +public: + typedef SafetyConfig Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarParams::LateralParams::Reader { +public: + typedef LateralParams Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasTorqueBP() const; + inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Reader getTorqueBP() const; + + inline bool hasTorqueV() const; + inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Reader getTorqueV() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarParams::LateralParams::Builder { +public: + typedef LateralParams Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasTorqueBP(); + inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Builder getTorqueBP(); + inline void setTorqueBP( ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setTorqueBP(::kj::ArrayPtr value); + inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Builder initTorqueBP(unsigned int size); + inline void adoptTorqueBP(::capnp::Orphan< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>> disownTorqueBP(); + + inline bool hasTorqueV(); + inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Builder getTorqueV(); + inline void setTorqueV( ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setTorqueV(::kj::ArrayPtr value); + inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Builder initTorqueV(unsigned int size); + inline void adoptTorqueV(::capnp::Orphan< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>> disownTorqueV(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarParams::LateralParams::Pipeline { +public: + typedef LateralParams Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarParams::LateralPIDTuning::Reader { +public: + typedef LateralPIDTuning Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasKpBP() const; + inline ::capnp::List::Reader getKpBP() const; + + inline bool hasKpV() const; + inline ::capnp::List::Reader getKpV() const; + + inline bool hasKiBP() const; + inline ::capnp::List::Reader getKiBP() const; + + inline bool hasKiV() const; + inline ::capnp::List::Reader getKiV() const; + + inline float getKf() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarParams::LateralPIDTuning::Builder { +public: + typedef LateralPIDTuning Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasKpBP(); + inline ::capnp::List::Builder getKpBP(); + inline void setKpBP( ::capnp::List::Reader value); + inline void setKpBP(::kj::ArrayPtr value); + inline ::capnp::List::Builder initKpBP(unsigned int size); + inline void adoptKpBP(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownKpBP(); + + inline bool hasKpV(); + inline ::capnp::List::Builder getKpV(); + inline void setKpV( ::capnp::List::Reader value); + inline void setKpV(::kj::ArrayPtr value); + inline ::capnp::List::Builder initKpV(unsigned int size); + inline void adoptKpV(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownKpV(); + + inline bool hasKiBP(); + inline ::capnp::List::Builder getKiBP(); + inline void setKiBP( ::capnp::List::Reader value); + inline void setKiBP(::kj::ArrayPtr value); + inline ::capnp::List::Builder initKiBP(unsigned int size); + inline void adoptKiBP(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownKiBP(); + + inline bool hasKiV(); + inline ::capnp::List::Builder getKiV(); + inline void setKiV( ::capnp::List::Reader value); + inline void setKiV(::kj::ArrayPtr value); + inline ::capnp::List::Builder initKiV(unsigned int size); + inline void adoptKiV(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownKiV(); + + inline float getKf(); + inline void setKf(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarParams::LateralPIDTuning::Pipeline { +public: + typedef LateralPIDTuning Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarParams::LongitudinalPIDTuning::Reader { +public: + typedef LongitudinalPIDTuning Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasKpBP() const; + inline ::capnp::List::Reader getKpBP() const; + + inline bool hasKpV() const; + inline ::capnp::List::Reader getKpV() const; + + inline bool hasKiBP() const; + inline ::capnp::List::Reader getKiBP() const; + + inline bool hasKiV() const; + inline ::capnp::List::Reader getKiV() const; + + inline bool hasDeadzoneBP() const; + inline ::capnp::List::Reader getDeadzoneBP() const; + + inline bool hasDeadzoneV() const; + inline ::capnp::List::Reader getDeadzoneV() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarParams::LongitudinalPIDTuning::Builder { +public: + typedef LongitudinalPIDTuning Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasKpBP(); + inline ::capnp::List::Builder getKpBP(); + inline void setKpBP( ::capnp::List::Reader value); + inline void setKpBP(::kj::ArrayPtr value); + inline ::capnp::List::Builder initKpBP(unsigned int size); + inline void adoptKpBP(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownKpBP(); + + inline bool hasKpV(); + inline ::capnp::List::Builder getKpV(); + inline void setKpV( ::capnp::List::Reader value); + inline void setKpV(::kj::ArrayPtr value); + inline ::capnp::List::Builder initKpV(unsigned int size); + inline void adoptKpV(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownKpV(); + + inline bool hasKiBP(); + inline ::capnp::List::Builder getKiBP(); + inline void setKiBP( ::capnp::List::Reader value); + inline void setKiBP(::kj::ArrayPtr value); + inline ::capnp::List::Builder initKiBP(unsigned int size); + inline void adoptKiBP(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownKiBP(); + + inline bool hasKiV(); + inline ::capnp::List::Builder getKiV(); + inline void setKiV( ::capnp::List::Reader value); + inline void setKiV(::kj::ArrayPtr value); + inline ::capnp::List::Builder initKiV(unsigned int size); + inline void adoptKiV(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownKiV(); + + inline bool hasDeadzoneBP(); + inline ::capnp::List::Builder getDeadzoneBP(); + inline void setDeadzoneBP( ::capnp::List::Reader value); + inline void setDeadzoneBP(::kj::ArrayPtr value); + inline ::capnp::List::Builder initDeadzoneBP(unsigned int size); + inline void adoptDeadzoneBP(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownDeadzoneBP(); + + inline bool hasDeadzoneV(); + inline ::capnp::List::Builder getDeadzoneV(); + inline void setDeadzoneV( ::capnp::List::Reader value); + inline void setDeadzoneV(::kj::ArrayPtr value); + inline ::capnp::List::Builder initDeadzoneV(unsigned int size); + inline void adoptDeadzoneV(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownDeadzoneV(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarParams::LongitudinalPIDTuning::Pipeline { +public: + typedef LongitudinalPIDTuning Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarParams::LateralINDITuning::Reader { +public: + typedef LateralINDITuning Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline float getOuterLoopGainDEPRECATED() const; + + inline float getInnerLoopGainDEPRECATED() const; + + inline float getTimeConstantDEPRECATED() const; + + inline float getActuatorEffectivenessDEPRECATED() const; + + inline bool hasOuterLoopGainBP() const; + inline ::capnp::List::Reader getOuterLoopGainBP() const; + + inline bool hasOuterLoopGainV() const; + inline ::capnp::List::Reader getOuterLoopGainV() const; + + inline bool hasInnerLoopGainBP() const; + inline ::capnp::List::Reader getInnerLoopGainBP() const; + + inline bool hasInnerLoopGainV() const; + inline ::capnp::List::Reader getInnerLoopGainV() const; + + inline bool hasTimeConstantBP() const; + inline ::capnp::List::Reader getTimeConstantBP() const; + + inline bool hasTimeConstantV() const; + inline ::capnp::List::Reader getTimeConstantV() const; + + inline bool hasActuatorEffectivenessBP() const; + inline ::capnp::List::Reader getActuatorEffectivenessBP() const; + + inline bool hasActuatorEffectivenessV() const; + inline ::capnp::List::Reader getActuatorEffectivenessV() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarParams::LateralINDITuning::Builder { +public: + typedef LateralINDITuning Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline float getOuterLoopGainDEPRECATED(); + inline void setOuterLoopGainDEPRECATED(float value); + + inline float getInnerLoopGainDEPRECATED(); + inline void setInnerLoopGainDEPRECATED(float value); + + inline float getTimeConstantDEPRECATED(); + inline void setTimeConstantDEPRECATED(float value); + + inline float getActuatorEffectivenessDEPRECATED(); + inline void setActuatorEffectivenessDEPRECATED(float value); + + inline bool hasOuterLoopGainBP(); + inline ::capnp::List::Builder getOuterLoopGainBP(); + inline void setOuterLoopGainBP( ::capnp::List::Reader value); + inline void setOuterLoopGainBP(::kj::ArrayPtr value); + inline ::capnp::List::Builder initOuterLoopGainBP(unsigned int size); + inline void adoptOuterLoopGainBP(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownOuterLoopGainBP(); + + inline bool hasOuterLoopGainV(); + inline ::capnp::List::Builder getOuterLoopGainV(); + inline void setOuterLoopGainV( ::capnp::List::Reader value); + inline void setOuterLoopGainV(::kj::ArrayPtr value); + inline ::capnp::List::Builder initOuterLoopGainV(unsigned int size); + inline void adoptOuterLoopGainV(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownOuterLoopGainV(); + + inline bool hasInnerLoopGainBP(); + inline ::capnp::List::Builder getInnerLoopGainBP(); + inline void setInnerLoopGainBP( ::capnp::List::Reader value); + inline void setInnerLoopGainBP(::kj::ArrayPtr value); + inline ::capnp::List::Builder initInnerLoopGainBP(unsigned int size); + inline void adoptInnerLoopGainBP(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownInnerLoopGainBP(); + + inline bool hasInnerLoopGainV(); + inline ::capnp::List::Builder getInnerLoopGainV(); + inline void setInnerLoopGainV( ::capnp::List::Reader value); + inline void setInnerLoopGainV(::kj::ArrayPtr value); + inline ::capnp::List::Builder initInnerLoopGainV(unsigned int size); + inline void adoptInnerLoopGainV(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownInnerLoopGainV(); + + inline bool hasTimeConstantBP(); + inline ::capnp::List::Builder getTimeConstantBP(); + inline void setTimeConstantBP( ::capnp::List::Reader value); + inline void setTimeConstantBP(::kj::ArrayPtr value); + inline ::capnp::List::Builder initTimeConstantBP(unsigned int size); + inline void adoptTimeConstantBP(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownTimeConstantBP(); + + inline bool hasTimeConstantV(); + inline ::capnp::List::Builder getTimeConstantV(); + inline void setTimeConstantV( ::capnp::List::Reader value); + inline void setTimeConstantV(::kj::ArrayPtr value); + inline ::capnp::List::Builder initTimeConstantV(unsigned int size); + inline void adoptTimeConstantV(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownTimeConstantV(); + + inline bool hasActuatorEffectivenessBP(); + inline ::capnp::List::Builder getActuatorEffectivenessBP(); + inline void setActuatorEffectivenessBP( ::capnp::List::Reader value); + inline void setActuatorEffectivenessBP(::kj::ArrayPtr value); + inline ::capnp::List::Builder initActuatorEffectivenessBP(unsigned int size); + inline void adoptActuatorEffectivenessBP(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownActuatorEffectivenessBP(); + + inline bool hasActuatorEffectivenessV(); + inline ::capnp::List::Builder getActuatorEffectivenessV(); + inline void setActuatorEffectivenessV( ::capnp::List::Reader value); + inline void setActuatorEffectivenessV(::kj::ArrayPtr value); + inline ::capnp::List::Builder initActuatorEffectivenessV(unsigned int size); + inline void adoptActuatorEffectivenessV(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownActuatorEffectivenessV(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarParams::LateralINDITuning::Pipeline { +public: + typedef LateralINDITuning Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarParams::LateralLQRTuning::Reader { +public: + typedef LateralLQRTuning Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline float getScale() const; + + inline float getKi() const; + + inline float getDcGain() const; + + inline bool hasA() const; + inline ::capnp::List::Reader getA() const; + + inline bool hasB() const; + inline ::capnp::List::Reader getB() const; + + inline bool hasC() const; + inline ::capnp::List::Reader getC() const; + + inline bool hasK() const; + inline ::capnp::List::Reader getK() const; + + inline bool hasL() const; + inline ::capnp::List::Reader getL() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarParams::LateralLQRTuning::Builder { +public: + typedef LateralLQRTuning Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline float getScale(); + inline void setScale(float value); + + inline float getKi(); + inline void setKi(float value); + + inline float getDcGain(); + inline void setDcGain(float value); + + inline bool hasA(); + inline ::capnp::List::Builder getA(); + inline void setA( ::capnp::List::Reader value); + inline void setA(::kj::ArrayPtr value); + inline ::capnp::List::Builder initA(unsigned int size); + inline void adoptA(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownA(); + + inline bool hasB(); + inline ::capnp::List::Builder getB(); + inline void setB( ::capnp::List::Reader value); + inline void setB(::kj::ArrayPtr value); + inline ::capnp::List::Builder initB(unsigned int size); + inline void adoptB(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownB(); + + inline bool hasC(); + inline ::capnp::List::Builder getC(); + inline void setC( ::capnp::List::Reader value); + inline void setC(::kj::ArrayPtr value); + inline ::capnp::List::Builder initC(unsigned int size); + inline void adoptC(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownC(); + + inline bool hasK(); + inline ::capnp::List::Builder getK(); + inline void setK( ::capnp::List::Reader value); + inline void setK(::kj::ArrayPtr value); + inline ::capnp::List::Builder initK(unsigned int size); + inline void adoptK(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownK(); + + inline bool hasL(); + inline ::capnp::List::Builder getL(); + inline void setL( ::capnp::List::Reader value); + inline void setL(::kj::ArrayPtr value); + inline ::capnp::List::Builder initL(unsigned int size); + inline void adoptL(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownL(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarParams::LateralLQRTuning::Pipeline { +public: + typedef LateralLQRTuning Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarParams::CarFw::Reader { +public: + typedef CarFw Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::cereal::CarParams::Ecu getEcu() const; + + inline bool hasFwVersion() const; + inline ::capnp::Data::Reader getFwVersion() const; + + inline ::uint32_t getAddress() const; + + inline ::uint8_t getSubAddress() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarParams::CarFw::Builder { +public: + typedef CarFw Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::cereal::CarParams::Ecu getEcu(); + inline void setEcu( ::cereal::CarParams::Ecu value); + + inline bool hasFwVersion(); + inline ::capnp::Data::Builder getFwVersion(); + inline void setFwVersion( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initFwVersion(unsigned int size); + inline void adoptFwVersion(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownFwVersion(); + + inline ::uint32_t getAddress(); + inline void setAddress( ::uint32_t value); + + inline ::uint8_t getSubAddress(); + inline void setSubAddress( ::uint8_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarParams::CarFw::Pipeline { +public: + typedef CarFw Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CarParams::LateralTuning::Reader { +public: + typedef LateralTuning Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline Which which() const; + inline bool isPid() const; + inline bool hasPid() const; + inline ::cereal::CarParams::LateralPIDTuning::Reader getPid() const; + + inline bool isIndi() const; + inline bool hasIndi() const; + inline ::cereal::CarParams::LateralINDITuning::Reader getIndi() const; + + inline bool isLqr() const; + inline bool hasLqr() const; + inline ::cereal::CarParams::LateralLQRTuning::Reader getLqr() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarParams::LateralTuning::Builder { +public: + typedef LateralTuning Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline Which which(); + inline bool isPid(); + inline bool hasPid(); + inline ::cereal::CarParams::LateralPIDTuning::Builder getPid(); + inline void setPid( ::cereal::CarParams::LateralPIDTuning::Reader value); + inline ::cereal::CarParams::LateralPIDTuning::Builder initPid(); + inline void adoptPid(::capnp::Orphan< ::cereal::CarParams::LateralPIDTuning>&& value); + inline ::capnp::Orphan< ::cereal::CarParams::LateralPIDTuning> disownPid(); + + inline bool isIndi(); + inline bool hasIndi(); + inline ::cereal::CarParams::LateralINDITuning::Builder getIndi(); + inline void setIndi( ::cereal::CarParams::LateralINDITuning::Reader value); + inline ::cereal::CarParams::LateralINDITuning::Builder initIndi(); + inline void adoptIndi(::capnp::Orphan< ::cereal::CarParams::LateralINDITuning>&& value); + inline ::capnp::Orphan< ::cereal::CarParams::LateralINDITuning> disownIndi(); + + inline bool isLqr(); + inline bool hasLqr(); + inline ::cereal::CarParams::LateralLQRTuning::Builder getLqr(); + inline void setLqr( ::cereal::CarParams::LateralLQRTuning::Reader value); + inline ::cereal::CarParams::LateralLQRTuning::Builder initLqr(); + inline void adoptLqr(::capnp::Orphan< ::cereal::CarParams::LateralLQRTuning>&& value); + inline ::capnp::Orphan< ::cereal::CarParams::LateralLQRTuning> disownLqr(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarParams::LateralTuning::Pipeline { +public: + typedef LateralTuning Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +// ======================================================================================= + +inline ::cereal::CarEvent::EventName CarEvent::Reader::getName() const { + return _reader.getDataField< ::cereal::CarEvent::EventName>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarEvent::EventName CarEvent::Builder::getName() { + return _builder.getDataField< ::cereal::CarEvent::EventName>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarEvent::Builder::setName( ::cereal::CarEvent::EventName value) { + _builder.setDataField< ::cereal::CarEvent::EventName>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool CarEvent::Reader::getEnable() const { + return _reader.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline bool CarEvent::Builder::getEnable() { + return _builder.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void CarEvent::Builder::setEnable(bool value) { + _builder.setDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline bool CarEvent::Reader::getNoEntry() const { + return _reader.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} + +inline bool CarEvent::Builder::getNoEntry() { + return _builder.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} +inline void CarEvent::Builder::setNoEntry(bool value) { + _builder.setDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS, value); +} + +inline bool CarEvent::Reader::getWarning() const { + return _reader.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} + +inline bool CarEvent::Builder::getWarning() { + return _builder.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} +inline void CarEvent::Builder::setWarning(bool value) { + _builder.setDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS, value); +} + +inline bool CarEvent::Reader::getUserDisable() const { + return _reader.getDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS); +} + +inline bool CarEvent::Builder::getUserDisable() { + return _builder.getDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS); +} +inline void CarEvent::Builder::setUserDisable(bool value) { + _builder.setDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS, value); +} + +inline bool CarEvent::Reader::getSoftDisable() const { + return _reader.getDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} + +inline bool CarEvent::Builder::getSoftDisable() { + return _builder.getDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} +inline void CarEvent::Builder::setSoftDisable(bool value) { + _builder.setDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS, value); +} + +inline bool CarEvent::Reader::getImmediateDisable() const { + return _reader.getDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} + +inline bool CarEvent::Builder::getImmediateDisable() { + return _builder.getDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} +inline void CarEvent::Builder::setImmediateDisable(bool value) { + _builder.setDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS, value); +} + +inline bool CarEvent::Reader::getPreEnable() const { + return _reader.getDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS); +} + +inline bool CarEvent::Builder::getPreEnable() { + return _builder.getDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS); +} +inline void CarEvent::Builder::setPreEnable(bool value) { + _builder.setDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS, value); +} + +inline bool CarEvent::Reader::getPermanent() const { + return _reader.getDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS); +} + +inline bool CarEvent::Builder::getPermanent() { + return _builder.getDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS); +} +inline void CarEvent::Builder::setPermanent(bool value) { + _builder.setDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::hasErrorsDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool CarState::Builder::hasErrorsDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>::Reader CarState::Reader::getErrorsDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>::Builder CarState::Builder::getErrorsDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void CarState::Builder::setErrorsDEPRECATED( ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void CarState::Builder::setErrorsDEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>::Builder CarState::Builder::initErrorsDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void CarState::Builder::adoptErrorsDEPRECATED( + ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>> CarState::Builder::disownErrorsDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent::EventName, ::capnp::Kind::ENUM>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline float CarState::Reader::getVEgo() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float CarState::Builder::getVEgo() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setVEgo(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::hasWheelSpeeds() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool CarState::Builder::hasWheelSpeeds() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarState::WheelSpeeds::Reader CarState::Reader::getWheelSpeeds() const { + return ::capnp::_::PointerHelpers< ::cereal::CarState::WheelSpeeds>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::cereal::CarState::WheelSpeeds::Builder CarState::Builder::getWheelSpeeds() { + return ::capnp::_::PointerHelpers< ::cereal::CarState::WheelSpeeds>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::CarState::WheelSpeeds::Pipeline CarState::Pipeline::getWheelSpeeds() { + return ::cereal::CarState::WheelSpeeds::Pipeline(_typeless.getPointerField(1)); +} +#endif // !CAPNP_LITE +inline void CarState::Builder::setWheelSpeeds( ::cereal::CarState::WheelSpeeds::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::CarState::WheelSpeeds>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarState::WheelSpeeds::Builder CarState::Builder::initWheelSpeeds() { + return ::capnp::_::PointerHelpers< ::cereal::CarState::WheelSpeeds>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void CarState::Builder::adoptWheelSpeeds( + ::capnp::Orphan< ::cereal::CarState::WheelSpeeds>&& value) { + ::capnp::_::PointerHelpers< ::cereal::CarState::WheelSpeeds>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarState::WheelSpeeds> CarState::Builder::disownWheelSpeeds() { + return ::capnp::_::PointerHelpers< ::cereal::CarState::WheelSpeeds>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline float CarState::Reader::getGas() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float CarState::Builder::getGas() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setGas(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getGasPressed() const { + return _reader.getDataField( + ::capnp::bounded<64>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getGasPressed() { + return _builder.getDataField( + ::capnp::bounded<64>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setGasPressed(bool value) { + _builder.setDataField( + ::capnp::bounded<64>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::Reader::getBrake() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float CarState::Builder::getBrake() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setBrake(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getBrakePressed() const { + return _reader.getDataField( + ::capnp::bounded<65>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getBrakePressed() { + return _builder.getDataField( + ::capnp::bounded<65>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setBrakePressed(bool value) { + _builder.setDataField( + ::capnp::bounded<65>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::Reader::getSteeringAngleDeg() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float CarState::Builder::getSteeringAngleDeg() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setSteeringAngleDeg(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::Reader::getSteeringTorque() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float CarState::Builder::getSteeringTorque() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setSteeringTorque(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getSteeringPressed() const { + return _reader.getDataField( + ::capnp::bounded<66>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getSteeringPressed() { + return _builder.getDataField( + ::capnp::bounded<66>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setSteeringPressed(bool value) { + _builder.setDataField( + ::capnp::bounded<66>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::hasCruiseState() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool CarState::Builder::hasCruiseState() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarState::CruiseState::Reader CarState::Reader::getCruiseState() const { + return ::capnp::_::PointerHelpers< ::cereal::CarState::CruiseState>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::cereal::CarState::CruiseState::Builder CarState::Builder::getCruiseState() { + return ::capnp::_::PointerHelpers< ::cereal::CarState::CruiseState>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::CarState::CruiseState::Pipeline CarState::Pipeline::getCruiseState() { + return ::cereal::CarState::CruiseState::Pipeline(_typeless.getPointerField(2)); +} +#endif // !CAPNP_LITE +inline void CarState::Builder::setCruiseState( ::cereal::CarState::CruiseState::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::CarState::CruiseState>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarState::CruiseState::Builder CarState::Builder::initCruiseState() { + return ::capnp::_::PointerHelpers< ::cereal::CarState::CruiseState>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void CarState::Builder::adoptCruiseState( + ::capnp::Orphan< ::cereal::CarState::CruiseState>&& value) { + ::capnp::_::PointerHelpers< ::cereal::CarState::CruiseState>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarState::CruiseState> CarState::Builder::disownCruiseState() { + return ::capnp::_::PointerHelpers< ::cereal::CarState::CruiseState>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool CarState::Reader::hasButtonEvents() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool CarState::Builder::hasButtonEvents() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>::Reader CarState::Reader::getButtonEvents() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>::Builder CarState::Builder::getButtonEvents() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void CarState::Builder::setButtonEvents( ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>::Builder CarState::Builder::initButtonEvents(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void CarState::Builder::adoptButtonEvents( + ::capnp::Orphan< ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>> CarState::Builder::disownButtonEvents() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarState::ButtonEvent, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool CarState::Reader::hasCanMonoTimes() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool CarState::Builder::hasCanMonoTimes() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader CarState::Reader::getCanMonoTimes() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder CarState::Builder::getCanMonoTimes() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void CarState::Builder::setCanMonoTimes( ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void CarState::Builder::setCanMonoTimes(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder CarState::Builder::initCanMonoTimes(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void CarState::Builder::adoptCanMonoTimes( + ::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>> CarState::Builder::disownCanMonoTimes() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool CarState::Reader::hasEvents() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool CarState::Builder::hasEvents() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader CarState::Reader::getEvents() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder CarState::Builder::getEvents() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void CarState::Builder::setEvents( ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder CarState::Builder::initEvents(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void CarState::Builder::adoptEvents( + ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>> CarState::Builder::disownEvents() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline ::cereal::CarState::GearShifter CarState::Reader::getGearShifter() const { + return _reader.getDataField< ::cereal::CarState::GearShifter>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarState::GearShifter CarState::Builder::getGearShifter() { + return _builder.getDataField< ::cereal::CarState::GearShifter>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setGearShifter( ::cereal::CarState::GearShifter value) { + _builder.setDataField< ::cereal::CarState::GearShifter>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::Reader::getSteeringRateDeg() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float CarState::Builder::getSteeringRateDeg() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setSteeringRateDeg(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::Reader::getAEgo() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float CarState::Builder::getAEgo() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setAEgo(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::Reader::getVEgoRaw() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float CarState::Builder::getVEgoRaw() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setVEgoRaw(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getStandstill() const { + return _reader.getDataField( + ::capnp::bounded<67>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getStandstill() { + return _builder.getDataField( + ::capnp::bounded<67>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setStandstill(bool value) { + _builder.setDataField( + ::capnp::bounded<67>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getBrakeLightsDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<68>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getBrakeLightsDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<68>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setBrakeLightsDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<68>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getLeftBlinker() const { + return _reader.getDataField( + ::capnp::bounded<69>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getLeftBlinker() { + return _builder.getDataField( + ::capnp::bounded<69>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setLeftBlinker(bool value) { + _builder.setDataField( + ::capnp::bounded<69>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getRightBlinker() const { + return _reader.getDataField( + ::capnp::bounded<70>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getRightBlinker() { + return _builder.getDataField( + ::capnp::bounded<70>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setRightBlinker(bool value) { + _builder.setDataField( + ::capnp::bounded<70>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::Reader::getYawRate() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline float CarState::Builder::getYawRate() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setYawRate(float value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getGenericToggle() const { + return _reader.getDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getGenericToggle() { + return _builder.getDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setGenericToggle(bool value) { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getDoorOpen() const { + return _reader.getDataField( + ::capnp::bounded<72>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getDoorOpen() { + return _builder.getDataField( + ::capnp::bounded<72>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setDoorOpen(bool value) { + _builder.setDataField( + ::capnp::bounded<72>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getSeatbeltUnlatched() const { + return _reader.getDataField( + ::capnp::bounded<73>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getSeatbeltUnlatched() { + return _builder.getDataField( + ::capnp::bounded<73>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setSeatbeltUnlatched(bool value) { + _builder.setDataField( + ::capnp::bounded<73>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getCanValid() const { + return _reader.getDataField( + ::capnp::bounded<74>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getCanValid() { + return _builder.getDataField( + ::capnp::bounded<74>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setCanValid(bool value) { + _builder.setDataField( + ::capnp::bounded<74>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::Reader::getSteeringTorqueEps() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline float CarState::Builder::getSteeringTorqueEps() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setSteeringTorqueEps(float value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getClutchPressed() const { + return _reader.getDataField( + ::capnp::bounded<75>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getClutchPressed() { + return _builder.getDataField( + ::capnp::bounded<75>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setClutchPressed(bool value) { + _builder.setDataField( + ::capnp::bounded<75>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getSteeringRateLimited() const { + return _reader.getDataField( + ::capnp::bounded<76>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getSteeringRateLimited() { + return _builder.getDataField( + ::capnp::bounded<76>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setSteeringRateLimited(bool value) { + _builder.setDataField( + ::capnp::bounded<76>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getStockAeb() const { + return _reader.getDataField( + ::capnp::bounded<77>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getStockAeb() { + return _builder.getDataField( + ::capnp::bounded<77>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setStockAeb(bool value) { + _builder.setDataField( + ::capnp::bounded<77>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getStockFcw() const { + return _reader.getDataField( + ::capnp::bounded<78>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getStockFcw() { + return _builder.getDataField( + ::capnp::bounded<78>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setStockFcw(bool value) { + _builder.setDataField( + ::capnp::bounded<78>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getEspDisabled() const { + return _reader.getDataField( + ::capnp::bounded<79>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getEspDisabled() { + return _builder.getDataField( + ::capnp::bounded<79>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setEspDisabled(bool value) { + _builder.setDataField( + ::capnp::bounded<79>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getLeftBlindspot() const { + return _reader.getDataField( + ::capnp::bounded<352>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getLeftBlindspot() { + return _builder.getDataField( + ::capnp::bounded<352>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setLeftBlindspot(bool value) { + _builder.setDataField( + ::capnp::bounded<352>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getRightBlindspot() const { + return _reader.getDataField( + ::capnp::bounded<353>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getRightBlindspot() { + return _builder.getDataField( + ::capnp::bounded<353>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setRightBlindspot(bool value) { + _builder.setDataField( + ::capnp::bounded<353>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getSteerWarning() const { + return _reader.getDataField( + ::capnp::bounded<354>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getSteerWarning() { + return _builder.getDataField( + ::capnp::bounded<354>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setSteerWarning(bool value) { + _builder.setDataField( + ::capnp::bounded<354>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getSteerError() const { + return _reader.getDataField( + ::capnp::bounded<355>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getSteerError() { + return _builder.getDataField( + ::capnp::bounded<355>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setSteerError(bool value) { + _builder.setDataField( + ::capnp::bounded<355>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::Reader::getSteeringAngleOffsetDeg() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline float CarState::Builder::getSteeringAngleOffsetDeg() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setSteeringAngleOffsetDeg(float value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::Reader::getBrakeHoldActive() const { + return _reader.getDataField( + ::capnp::bounded<356>() * ::capnp::ELEMENTS); +} + +inline bool CarState::Builder::getBrakeHoldActive() { + return _builder.getDataField( + ::capnp::bounded<356>() * ::capnp::ELEMENTS); +} +inline void CarState::Builder::setBrakeHoldActive(bool value) { + _builder.setDataField( + ::capnp::bounded<356>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::WheelSpeeds::Reader::getFl() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float CarState::WheelSpeeds::Builder::getFl() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarState::WheelSpeeds::Builder::setFl(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::WheelSpeeds::Reader::getFr() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float CarState::WheelSpeeds::Builder::getFr() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarState::WheelSpeeds::Builder::setFr(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::WheelSpeeds::Reader::getRl() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float CarState::WheelSpeeds::Builder::getRl() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void CarState::WheelSpeeds::Builder::setRl(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::WheelSpeeds::Reader::getRr() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float CarState::WheelSpeeds::Builder::getRr() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void CarState::WheelSpeeds::Builder::setRr(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::CruiseState::Reader::getEnabled() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool CarState::CruiseState::Builder::getEnabled() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarState::CruiseState::Builder::setEnabled(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::CruiseState::Reader::getSpeed() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float CarState::CruiseState::Builder::getSpeed() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarState::CruiseState::Builder::setSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::CruiseState::Reader::getAvailable() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool CarState::CruiseState::Builder::getAvailable() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarState::CruiseState::Builder::setAvailable(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float CarState::CruiseState::Reader::getSpeedOffset() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float CarState::CruiseState::Builder::getSpeedOffset() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void CarState::CruiseState::Builder::setSpeedOffset(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::CruiseState::Reader::getStandstill() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline bool CarState::CruiseState::Builder::getStandstill() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void CarState::CruiseState::Builder::setStandstill(bool value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::CruiseState::Reader::getNonAdaptive() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline bool CarState::CruiseState::Builder::getNonAdaptive() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void CarState::CruiseState::Builder::setNonAdaptive(bool value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool CarState::ButtonEvent::Reader::getPressed() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool CarState::ButtonEvent::Builder::getPressed() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarState::ButtonEvent::Builder::setPressed(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::CarState::ButtonEvent::Type CarState::ButtonEvent::Reader::getType() const { + return _reader.getDataField< ::cereal::CarState::ButtonEvent::Type>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarState::ButtonEvent::Type CarState::ButtonEvent::Builder::getType() { + return _builder.getDataField< ::cereal::CarState::ButtonEvent::Type>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarState::ButtonEvent::Builder::setType( ::cereal::CarState::ButtonEvent::Type value) { + _builder.setDataField< ::cereal::CarState::ButtonEvent::Type>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool RadarData::Reader::hasErrors() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool RadarData::Builder::hasErrors() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Reader RadarData::Reader::getErrors() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Builder RadarData::Builder::getErrors() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void RadarData::Builder::setErrors( ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void RadarData::Builder::setErrors(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Builder RadarData::Builder::initErrors(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void RadarData::Builder::adoptErrors( + ::capnp::Orphan< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>> RadarData::Builder::disownErrors() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool RadarData::Reader::hasPoints() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool RadarData::Builder::hasPoints() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>::Reader RadarData::Reader::getPoints() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>::Builder RadarData::Builder::getPoints() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void RadarData::Builder::setPoints( ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>::Builder RadarData::Builder::initPoints(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void RadarData::Builder::adoptPoints( + ::capnp::Orphan< ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>> RadarData::Builder::disownPoints() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::RadarPoint, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool RadarData::Reader::hasCanMonoTimes() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool RadarData::Builder::hasCanMonoTimes() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader RadarData::Reader::getCanMonoTimes() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder RadarData::Builder::getCanMonoTimes() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void RadarData::Builder::setCanMonoTimes( ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void RadarData::Builder::setCanMonoTimes(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder RadarData::Builder::initCanMonoTimes(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void RadarData::Builder::adoptCanMonoTimes( + ::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>> RadarData::Builder::disownCanMonoTimes() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline ::uint64_t RadarData::RadarPoint::Reader::getTrackId() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t RadarData::RadarPoint::Builder::getTrackId() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void RadarData::RadarPoint::Builder::setTrackId( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float RadarData::RadarPoint::Reader::getDRel() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float RadarData::RadarPoint::Builder::getDRel() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void RadarData::RadarPoint::Builder::setDRel(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float RadarData::RadarPoint::Reader::getYRel() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float RadarData::RadarPoint::Builder::getYRel() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void RadarData::RadarPoint::Builder::setYRel(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float RadarData::RadarPoint::Reader::getVRel() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float RadarData::RadarPoint::Builder::getVRel() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void RadarData::RadarPoint::Builder::setVRel(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float RadarData::RadarPoint::Reader::getARel() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float RadarData::RadarPoint::Builder::getARel() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void RadarData::RadarPoint::Builder::setARel(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float RadarData::RadarPoint::Reader::getYvRel() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float RadarData::RadarPoint::Builder::getYvRel() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void RadarData::RadarPoint::Builder::setYvRel(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool RadarData::RadarPoint::Reader::getMeasured() const { + return _reader.getDataField( + ::capnp::bounded<224>() * ::capnp::ELEMENTS); +} + +inline bool RadarData::RadarPoint::Builder::getMeasured() { + return _builder.getDataField( + ::capnp::bounded<224>() * ::capnp::ELEMENTS); +} +inline void RadarData::RadarPoint::Builder::setMeasured(bool value) { + _builder.setDataField( + ::capnp::bounded<224>() * ::capnp::ELEMENTS, value); +} + +inline bool CarControl::Reader::getEnabled() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool CarControl::Builder::getEnabled() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarControl::Builder::setEnabled(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float CarControl::Reader::getGasDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float CarControl::Builder::getGasDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarControl::Builder::setGasDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float CarControl::Reader::getBrakeDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float CarControl::Builder::getBrakeDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void CarControl::Builder::setBrakeDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float CarControl::Reader::getSteeringTorqueDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float CarControl::Builder::getSteeringTorqueDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void CarControl::Builder::setSteeringTorqueDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool CarControl::Reader::hasCruiseControl() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool CarControl::Builder::hasCruiseControl() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarControl::CruiseControl::Reader CarControl::Reader::getCruiseControl() const { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::CruiseControl>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::CarControl::CruiseControl::Builder CarControl::Builder::getCruiseControl() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::CruiseControl>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::CarControl::CruiseControl::Pipeline CarControl::Pipeline::getCruiseControl() { + return ::cereal::CarControl::CruiseControl::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void CarControl::Builder::setCruiseControl( ::cereal::CarControl::CruiseControl::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::CarControl::CruiseControl>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarControl::CruiseControl::Builder CarControl::Builder::initCruiseControl() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::CruiseControl>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void CarControl::Builder::adoptCruiseControl( + ::capnp::Orphan< ::cereal::CarControl::CruiseControl>&& value) { + ::capnp::_::PointerHelpers< ::cereal::CarControl::CruiseControl>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarControl::CruiseControl> CarControl::Builder::disownCruiseControl() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::CruiseControl>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool CarControl::Reader::hasHudControl() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool CarControl::Builder::hasHudControl() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarControl::HUDControl::Reader CarControl::Reader::getHudControl() const { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::HUDControl>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::cereal::CarControl::HUDControl::Builder CarControl::Builder::getHudControl() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::HUDControl>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::CarControl::HUDControl::Pipeline CarControl::Pipeline::getHudControl() { + return ::cereal::CarControl::HUDControl::Pipeline(_typeless.getPointerField(1)); +} +#endif // !CAPNP_LITE +inline void CarControl::Builder::setHudControl( ::cereal::CarControl::HUDControl::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::CarControl::HUDControl>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarControl::HUDControl::Builder CarControl::Builder::initHudControl() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::HUDControl>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void CarControl::Builder::adoptHudControl( + ::capnp::Orphan< ::cereal::CarControl::HUDControl>&& value) { + ::capnp::_::PointerHelpers< ::cereal::CarControl::HUDControl>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarControl::HUDControl> CarControl::Builder::disownHudControl() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::HUDControl>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool CarControl::Reader::hasActuators() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool CarControl::Builder::hasActuators() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarControl::Actuators::Reader CarControl::Reader::getActuators() const { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::cereal::CarControl::Actuators::Builder CarControl::Builder::getActuators() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::CarControl::Actuators::Pipeline CarControl::Pipeline::getActuators() { + return ::cereal::CarControl::Actuators::Pipeline(_typeless.getPointerField(2)); +} +#endif // !CAPNP_LITE +inline void CarControl::Builder::setActuators( ::cereal::CarControl::Actuators::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarControl::Actuators::Builder CarControl::Builder::initActuators() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void CarControl::Builder::adoptActuators( + ::capnp::Orphan< ::cereal::CarControl::Actuators>&& value) { + ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarControl::Actuators> CarControl::Builder::disownActuators() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool CarControl::Reader::getActive() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool CarControl::Builder::getActive() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarControl::Builder::setActive(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float CarControl::Reader::getRoll() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float CarControl::Builder::getRoll() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void CarControl::Builder::setRoll(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float CarControl::Reader::getPitch() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float CarControl::Builder::getPitch() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void CarControl::Builder::setPitch(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool CarControl::Reader::hasActuatorsOutput() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool CarControl::Builder::hasActuatorsOutput() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarControl::Actuators::Reader CarControl::Reader::getActuatorsOutput() const { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::cereal::CarControl::Actuators::Builder CarControl::Builder::getActuatorsOutput() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::CarControl::Actuators::Pipeline CarControl::Pipeline::getActuatorsOutput() { + return ::cereal::CarControl::Actuators::Pipeline(_typeless.getPointerField(3)); +} +#endif // !CAPNP_LITE +inline void CarControl::Builder::setActuatorsOutput( ::cereal::CarControl::Actuators::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarControl::Actuators::Builder CarControl::Builder::initActuatorsOutput() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void CarControl::Builder::adoptActuatorsOutput( + ::capnp::Orphan< ::cereal::CarControl::Actuators>&& value) { + ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarControl::Actuators> CarControl::Builder::disownActuatorsOutput() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline float CarControl::Actuators::Reader::getGas() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float CarControl::Actuators::Builder::getGas() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarControl::Actuators::Builder::setGas(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float CarControl::Actuators::Reader::getBrake() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float CarControl::Actuators::Builder::getBrake() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarControl::Actuators::Builder::setBrake(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float CarControl::Actuators::Reader::getSteer() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float CarControl::Actuators::Builder::getSteer() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void CarControl::Actuators::Builder::setSteer(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float CarControl::Actuators::Reader::getSteeringAngleDeg() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float CarControl::Actuators::Builder::getSteeringAngleDeg() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void CarControl::Actuators::Builder::setSteeringAngleDeg(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float CarControl::Actuators::Reader::getAccel() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float CarControl::Actuators::Builder::getAccel() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void CarControl::Actuators::Builder::setAccel(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::CarControl::Actuators::LongControlState CarControl::Actuators::Reader::getLongControlState() const { + return _reader.getDataField< ::cereal::CarControl::Actuators::LongControlState>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarControl::Actuators::LongControlState CarControl::Actuators::Builder::getLongControlState() { + return _builder.getDataField< ::cereal::CarControl::Actuators::LongControlState>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void CarControl::Actuators::Builder::setLongControlState( ::cereal::CarControl::Actuators::LongControlState value) { + _builder.setDataField< ::cereal::CarControl::Actuators::LongControlState>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline float CarControl::Actuators::Reader::getSpeed() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float CarControl::Actuators::Builder::getSpeed() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void CarControl::Actuators::Builder::setSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool CarControl::CruiseControl::Reader::getCancel() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool CarControl::CruiseControl::Builder::getCancel() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarControl::CruiseControl::Builder::setCancel(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool CarControl::CruiseControl::Reader::getOverride() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool CarControl::CruiseControl::Builder::getOverride() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarControl::CruiseControl::Builder::setOverride(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float CarControl::CruiseControl::Reader::getSpeedOverride() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float CarControl::CruiseControl::Builder::getSpeedOverride() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarControl::CruiseControl::Builder::setSpeedOverride(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float CarControl::CruiseControl::Reader::getAccelOverride() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float CarControl::CruiseControl::Builder::getAccelOverride() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void CarControl::CruiseControl::Builder::setAccelOverride(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool CarControl::HUDControl::Reader::getSpeedVisible() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool CarControl::HUDControl::Builder::getSpeedVisible() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarControl::HUDControl::Builder::setSpeedVisible(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float CarControl::HUDControl::Reader::getSetSpeed() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float CarControl::HUDControl::Builder::getSetSpeed() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarControl::HUDControl::Builder::setSetSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool CarControl::HUDControl::Reader::getLanesVisible() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool CarControl::HUDControl::Builder::getLanesVisible() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarControl::HUDControl::Builder::setLanesVisible(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool CarControl::HUDControl::Reader::getLeadVisible() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline bool CarControl::HUDControl::Builder::getLeadVisible() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void CarControl::HUDControl::Builder::setLeadVisible(bool value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::CarControl::HUDControl::VisualAlert CarControl::HUDControl::Reader::getVisualAlert() const { + return _reader.getDataField< ::cereal::CarControl::HUDControl::VisualAlert>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarControl::HUDControl::VisualAlert CarControl::HUDControl::Builder::getVisualAlert() { + return _builder.getDataField< ::cereal::CarControl::HUDControl::VisualAlert>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarControl::HUDControl::Builder::setVisualAlert( ::cereal::CarControl::HUDControl::VisualAlert value) { + _builder.setDataField< ::cereal::CarControl::HUDControl::VisualAlert>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::CarControl::HUDControl::AudibleAlert CarControl::HUDControl::Reader::getAudibleAlert() const { + return _reader.getDataField< ::cereal::CarControl::HUDControl::AudibleAlert>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarControl::HUDControl::AudibleAlert CarControl::HUDControl::Builder::getAudibleAlert() { + return _builder.getDataField< ::cereal::CarControl::HUDControl::AudibleAlert>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void CarControl::HUDControl::Builder::setAudibleAlert( ::cereal::CarControl::HUDControl::AudibleAlert value) { + _builder.setDataField< ::cereal::CarControl::HUDControl::AudibleAlert>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline bool CarControl::HUDControl::Reader::getRightLaneVisible() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline bool CarControl::HUDControl::Builder::getRightLaneVisible() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void CarControl::HUDControl::Builder::setRightLaneVisible(bool value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool CarControl::HUDControl::Reader::getLeftLaneVisible() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline bool CarControl::HUDControl::Builder::getLeftLaneVisible() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void CarControl::HUDControl::Builder::setLeftLaneVisible(bool value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline bool CarControl::HUDControl::Reader::getRightLaneDepart() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline bool CarControl::HUDControl::Builder::getRightLaneDepart() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void CarControl::HUDControl::Builder::setRightLaneDepart(bool value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool CarControl::HUDControl::Reader::getLeftLaneDepart() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline bool CarControl::HUDControl::Builder::getLeftLaneDepart() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void CarControl::HUDControl::Builder::setLeftLaneDepart(bool value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::hasCarName() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::Builder::hasCarName() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader CarParams::Reader::getCarName() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder CarParams::Builder::getCarName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void CarParams::Builder::setCarName( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder CarParams::Builder::initCarName(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void CarParams::Builder::adoptCarName( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> CarParams::Builder::disownCarName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool CarParams::Reader::hasCarFingerprint() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::Builder::hasCarFingerprint() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader CarParams::Reader::getCarFingerprint() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder CarParams::Builder::getCarFingerprint() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void CarParams::Builder::setCarFingerprint( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder CarParams::Builder::initCarFingerprint(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void CarParams::Builder::adoptCarFingerprint( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> CarParams::Builder::disownCarFingerprint() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool CarParams::Reader::getEnableGasInterceptor() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getEnableGasInterceptor() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setEnableGasInterceptor(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::getPcmCruise() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getPcmCruise() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setPcmCruise(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::getEnableCameraDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getEnableCameraDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setEnableCameraDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::getEnableDsu() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getEnableDsu() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setEnableDsu(bool value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::getEnableApgs() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getEnableApgs() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setEnableApgs(bool value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getMinEnableSpeed() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getMinEnableSpeed() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setMinEnableSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getMinSteerSpeed() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getMinSteerSpeed() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setMinSteerSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::CarParams::SafetyModel CarParams::Reader::getSafetyModelDEPRECATED() const { + return _reader.getDataField< ::cereal::CarParams::SafetyModel>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarParams::SafetyModel CarParams::Builder::getSafetyModelDEPRECATED() { + return _builder.getDataField< ::cereal::CarParams::SafetyModel>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setSafetyModelDEPRECATED( ::cereal::CarParams::SafetyModel value) { + _builder.setDataField< ::cereal::CarParams::SafetyModel>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int16_t CarParams::Reader::getSafetyParamDEPRECATED() const { + return _reader.getDataField< ::int16_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::int16_t CarParams::Builder::getSafetyParamDEPRECATED() { + return _builder.getDataField< ::int16_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setSafetyParamDEPRECATED( ::int16_t value) { + _builder.setDataField< ::int16_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::hasSteerMaxBP() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::Builder::hasSteerMaxBP() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::Reader::getSteerMaxBP() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::Builder::getSteerMaxBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void CarParams::Builder::setSteerMaxBP( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void CarParams::Builder::setSteerMaxBP(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::Builder::initSteerMaxBP(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void CarParams::Builder::adoptSteerMaxBP( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::Builder::disownSteerMaxBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool CarParams::Reader::hasSteerMaxV() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::Builder::hasSteerMaxV() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::Reader::getSteerMaxV() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::Builder::getSteerMaxV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void CarParams::Builder::setSteerMaxV( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void CarParams::Builder::setSteerMaxV(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::Builder::initSteerMaxV(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void CarParams::Builder::adoptSteerMaxV( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::Builder::disownSteerMaxV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool CarParams::Reader::hasGasMaxBPDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::Builder::hasGasMaxBPDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::Reader::getGasMaxBPDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::Builder::getGasMaxBPDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void CarParams::Builder::setGasMaxBPDEPRECATED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void CarParams::Builder::setGasMaxBPDEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::Builder::initGasMaxBPDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void CarParams::Builder::adoptGasMaxBPDEPRECATED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::Builder::disownGasMaxBPDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool CarParams::Reader::hasGasMaxVDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::Builder::hasGasMaxVDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::Reader::getGasMaxVDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::Builder::getGasMaxVDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void CarParams::Builder::setGasMaxVDEPRECATED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void CarParams::Builder::setGasMaxVDEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::Builder::initGasMaxVDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void CarParams::Builder::adoptGasMaxVDEPRECATED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::Builder::disownGasMaxVDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool CarParams::Reader::hasBrakeMaxBPDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::Builder::hasBrakeMaxBPDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::Reader::getBrakeMaxBPDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::Builder::getBrakeMaxBPDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline void CarParams::Builder::setBrakeMaxBPDEPRECATED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline void CarParams::Builder::setBrakeMaxBPDEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::Builder::initBrakeMaxBPDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), size); +} +inline void CarParams::Builder::adoptBrakeMaxBPDEPRECATED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::Builder::disownBrakeMaxBPDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} + +inline bool CarParams::Reader::hasBrakeMaxVDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::Builder::hasBrakeMaxVDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::Reader::getBrakeMaxVDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::Builder::getBrakeMaxVDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline void CarParams::Builder::setBrakeMaxVDEPRECATED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline void CarParams::Builder::setBrakeMaxVDEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::Builder::initBrakeMaxVDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), size); +} +inline void CarParams::Builder::adoptBrakeMaxVDEPRECATED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::Builder::disownBrakeMaxVDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} + +inline float CarParams::Reader::getMass() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getMass() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setMass(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getWheelbase() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getWheelbase() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setWheelbase(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getCenterToFront() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getCenterToFront() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setCenterToFront(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getSteerRatio() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getSteerRatio() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setSteerRatio(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getSteerRatioRear() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getSteerRatioRear() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setSteerRatioRear(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getRotationalInertia() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getRotationalInertia() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setRotationalInertia(float value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getTireStiffnessFront() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getTireStiffnessFront() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setTireStiffnessFront(float value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getTireStiffnessRear() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getTireStiffnessRear() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setTireStiffnessRear(float value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::hasLongitudinalTuning() const { + return !_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::Builder::hasLongitudinalTuning() { + return !_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarParams::LongitudinalPIDTuning::Reader CarParams::Reader::getLongitudinalTuning() const { + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LongitudinalPIDTuning>::get(_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline ::cereal::CarParams::LongitudinalPIDTuning::Builder CarParams::Builder::getLongitudinalTuning() { + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LongitudinalPIDTuning>::get(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::CarParams::LongitudinalPIDTuning::Pipeline CarParams::Pipeline::getLongitudinalTuning() { + return ::cereal::CarParams::LongitudinalPIDTuning::Pipeline(_typeless.getPointerField(8)); +} +#endif // !CAPNP_LITE +inline void CarParams::Builder::setLongitudinalTuning( ::cereal::CarParams::LongitudinalPIDTuning::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::CarParams::LongitudinalPIDTuning>::set(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarParams::LongitudinalPIDTuning::Builder CarParams::Builder::initLongitudinalTuning() { + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LongitudinalPIDTuning>::init(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline void CarParams::Builder::adoptLongitudinalTuning( + ::capnp::Orphan< ::cereal::CarParams::LongitudinalPIDTuning>&& value) { + ::capnp::_::PointerHelpers< ::cereal::CarParams::LongitudinalPIDTuning>::adopt(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarParams::LongitudinalPIDTuning> CarParams::Builder::disownLongitudinalTuning() { + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LongitudinalPIDTuning>::disown(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} + +inline typename CarParams::LateralTuning::Reader CarParams::Reader::getLateralTuning() const { + return typename CarParams::LateralTuning::Reader(_reader); +} +inline typename CarParams::LateralTuning::Builder CarParams::Builder::getLateralTuning() { + return typename CarParams::LateralTuning::Builder(_builder); +} +#if !CAPNP_LITE +inline typename CarParams::LateralTuning::Pipeline CarParams::Pipeline::getLateralTuning() { + return typename CarParams::LateralTuning::Pipeline(_typeless.noop()); +} +#endif // !CAPNP_LITE +inline typename CarParams::LateralTuning::Builder CarParams::Builder::initLateralTuning() { + _builder.setDataField< ::uint16_t>(::capnp::bounded<7>() * ::capnp::ELEMENTS, 0); + _builder.getPointerField(::capnp::bounded<9>() * ::capnp::POINTERS).clear(); + return typename CarParams::LateralTuning::Builder(_builder); +} +inline bool CarParams::Reader::getSteerLimitAlert() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getSteerLimitAlert() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setSteerLimitAlert(bool value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getVEgoStopping() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getVEgoStopping() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setVEgoStopping(float value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::getDirectAccelControl() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getDirectAccelControl() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setDirectAccelControl(bool value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::getStoppingControl() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getStoppingControl() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setStoppingControl(bool value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getStartAccelDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getStartAccelDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setStartAccelDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getSteerRateCost() const { + return _reader.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getSteerRateCost() { + return _builder.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setSteerRateCost(float value) { + _builder.setDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::CarParams::SteerControlType CarParams::Reader::getSteerControlType() const { + return _reader.getDataField< ::cereal::CarParams::SteerControlType>( + ::capnp::bounded<30>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarParams::SteerControlType CarParams::Builder::getSteerControlType() { + return _builder.getDataField< ::cereal::CarParams::SteerControlType>( + ::capnp::bounded<30>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setSteerControlType( ::cereal::CarParams::SteerControlType value) { + _builder.setDataField< ::cereal::CarParams::SteerControlType>( + ::capnp::bounded<30>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::getRadarOffCan() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getRadarOffCan() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setRadarOffCan(bool value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getSteerActuatorDelay() const { + return _reader.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getSteerActuatorDelay() { + return _builder.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setSteerActuatorDelay(float value) { + _builder.setDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::getOpenpilotLongitudinalControl() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getOpenpilotLongitudinalControl() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setOpenpilotLongitudinalControl(bool value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::hasCarVin() const { + return !_reader.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::Builder::hasCarVin() { + return !_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader CarParams::Reader::getCarVin() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder CarParams::Builder::getCarVin() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} +inline void CarParams::Builder::setCarVin( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder CarParams::Builder::initCarVin(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), size); +} +inline void CarParams::Builder::adoptCarVin( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> CarParams::Builder::disownCarVin() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} + +inline bool CarParams::Reader::getIsPandaBlackDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getIsPandaBlackDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setIsPandaBlackDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::getDashcamOnly() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getDashcamOnly() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setDashcamOnly(bool value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::CarParams::SafetyModel CarParams::Reader::getSafetyModelPassiveDEPRECATED() const { + return _reader.getDataField< ::cereal::CarParams::SafetyModel>( + ::capnp::bounded<31>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarParams::SafetyModel CarParams::Builder::getSafetyModelPassiveDEPRECATED() { + return _builder.getDataField< ::cereal::CarParams::SafetyModel>( + ::capnp::bounded<31>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setSafetyModelPassiveDEPRECATED( ::cereal::CarParams::SafetyModel value) { + _builder.setDataField< ::cereal::CarParams::SafetyModel>( + ::capnp::bounded<31>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::CarParams::TransmissionType CarParams::Reader::getTransmissionType() const { + return _reader.getDataField< ::cereal::CarParams::TransmissionType>( + ::capnp::bounded<34>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarParams::TransmissionType CarParams::Builder::getTransmissionType() { + return _builder.getDataField< ::cereal::CarParams::TransmissionType>( + ::capnp::bounded<34>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setTransmissionType( ::cereal::CarParams::TransmissionType value) { + _builder.setDataField< ::cereal::CarParams::TransmissionType>( + ::capnp::bounded<34>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::hasCarFw() const { + return !_reader.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::Builder::hasCarFw() { + return !_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>::Reader CarParams::Reader::getCarFw() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>::Builder CarParams::Builder::getCarFw() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} +inline void CarParams::Builder::setCarFw( ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>::Builder CarParams::Builder::initCarFw(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS), size); +} +inline void CarParams::Builder::adoptCarFw( + ::capnp::Orphan< ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>> CarParams::Builder::disownCarFw() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarParams::CarFw, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} + +inline float CarParams::Reader::getRadarTimeStep() const { + return _reader.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS, 1028443341u); +} + +inline float CarParams::Builder::getRadarTimeStep() { + return _builder.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS, 1028443341u); +} +inline void CarParams::Builder::setRadarTimeStep(float value) { + _builder.setDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS, value, 1028443341u); +} + +inline bool CarParams::Reader::getCommunityFeatureDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getCommunityFeatureDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setCommunityFeatureDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getSteerLimitTimer() const { + return _reader.getDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getSteerLimitTimer() { + return _builder.getDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setSteerLimitTimer(float value) { + _builder.setDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::hasLateralParams() const { + return !_reader.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::Builder::hasLateralParams() { + return !_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarParams::LateralParams::Reader CarParams::Reader::getLateralParams() const { + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralParams>::get(_reader.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} +inline ::cereal::CarParams::LateralParams::Builder CarParams::Builder::getLateralParams() { + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralParams>::get(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::CarParams::LateralParams::Pipeline CarParams::Pipeline::getLateralParams() { + return ::cereal::CarParams::LateralParams::Pipeline(_typeless.getPointerField(12)); +} +#endif // !CAPNP_LITE +inline void CarParams::Builder::setLateralParams( ::cereal::CarParams::LateralParams::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralParams>::set(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarParams::LateralParams::Builder CarParams::Builder::initLateralParams() { + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralParams>::init(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} +inline void CarParams::Builder::adoptLateralParams( + ::capnp::Orphan< ::cereal::CarParams::LateralParams>&& value) { + ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralParams>::adopt(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarParams::LateralParams> CarParams::Builder::disownLateralParams() { + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralParams>::disown(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} + +inline ::cereal::CarParams::FingerprintSource CarParams::Reader::getFingerprintSource() const { + return _reader.getDataField< ::cereal::CarParams::FingerprintSource>( + ::capnp::bounded<35>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarParams::FingerprintSource CarParams::Builder::getFingerprintSource() { + return _builder.getDataField< ::cereal::CarParams::FingerprintSource>( + ::capnp::bounded<35>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setFingerprintSource( ::cereal::CarParams::FingerprintSource value) { + _builder.setDataField< ::cereal::CarParams::FingerprintSource>( + ::capnp::bounded<35>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::CarParams::NetworkLocation CarParams::Reader::getNetworkLocation() const { + return _reader.getDataField< ::cereal::CarParams::NetworkLocation>( + ::capnp::bounded<40>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarParams::NetworkLocation CarParams::Builder::getNetworkLocation() { + return _builder.getDataField< ::cereal::CarParams::NetworkLocation>( + ::capnp::bounded<40>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setNetworkLocation( ::cereal::CarParams::NetworkLocation value) { + _builder.setDataField< ::cereal::CarParams::NetworkLocation>( + ::capnp::bounded<40>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getMinSpeedCanDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getMinSpeedCanDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setMinSpeedCanDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getStoppingDecelRate() const { + return _reader.getDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getStoppingDecelRate() { + return _builder.getDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setStoppingDecelRate(float value) { + _builder.setDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getStartingAccelRateDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getStartingAccelRateDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setStartingAccelRateDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getMaxSteeringAngleDeg() const { + return _reader.getDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getMaxSteeringAngleDeg() { + return _builder.getDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setMaxSteeringAngleDeg(float value) { + _builder.setDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::getFuzzyFingerprint() const { + return _reader.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getFuzzyFingerprint() { + return _builder.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setFuzzyFingerprint(bool value) { + _builder.setDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::getEnableBsm() const { + return _reader.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getEnableBsm() { + return _builder.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setEnableBsm(bool value) { + _builder.setDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::getHasStockCameraDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::Builder::getHasStockCameraDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setHasStockCameraDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getLongitudinalActuatorDelayUpperBound() const { + return _reader.getDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getLongitudinalActuatorDelayUpperBound() { + return _builder.getDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setLongitudinalActuatorDelayUpperBound(float value) { + _builder.setDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getVEgoStarting() const { + return _reader.getDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getVEgoStarting() { + return _builder.getDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setVEgoStarting(float value) { + _builder.setDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getStopAccel() const { + return _reader.getDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getStopAccel() { + return _builder.getDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setStopAccel(float value) { + _builder.setDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::Reader::getLongitudinalActuatorDelayLowerBound() const { + return _reader.getDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getLongitudinalActuatorDelayLowerBound() { + return _builder.getDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setLongitudinalActuatorDelayLowerBound(float value) { + _builder.setDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::Reader::hasSafetyConfigs() const { + return !_reader.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::Builder::hasSafetyConfigs() { + return !_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>::Reader CarParams::Reader::getSafetyConfigs() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>::Builder CarParams::Builder::getSafetyConfigs() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} +inline void CarParams::Builder::setSafetyConfigs( ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>::Builder CarParams::Builder::initSafetyConfigs(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS), size); +} +inline void CarParams::Builder::adoptSafetyConfigs( + ::capnp::Orphan< ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>> CarParams::Builder::disownSafetyConfigs() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarParams::SafetyConfig, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} + +inline float CarParams::Reader::getWheelSpeedFactor() const { + return _reader.getDataField( + ::capnp::bounded<29>() * ::capnp::ELEMENTS); +} + +inline float CarParams::Builder::getWheelSpeedFactor() { + return _builder.getDataField( + ::capnp::bounded<29>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setWheelSpeedFactor(float value) { + _builder.setDataField( + ::capnp::bounded<29>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t CarParams::Reader::getFlags() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<30>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t CarParams::Builder::getFlags() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<30>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setFlags( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<30>() * ::capnp::ELEMENTS, value); +} + +inline ::int16_t CarParams::Reader::getUnsafeMode() const { + return _reader.getDataField< ::int16_t>( + ::capnp::bounded<41>() * ::capnp::ELEMENTS); +} + +inline ::int16_t CarParams::Builder::getUnsafeMode() { + return _builder.getDataField< ::int16_t>( + ::capnp::bounded<41>() * ::capnp::ELEMENTS); +} +inline void CarParams::Builder::setUnsafeMode( ::int16_t value) { + _builder.setDataField< ::int16_t>( + ::capnp::bounded<41>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::CarParams::SafetyModel CarParams::SafetyConfig::Reader::getSafetyModel() const { + return _reader.getDataField< ::cereal::CarParams::SafetyModel>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarParams::SafetyModel CarParams::SafetyConfig::Builder::getSafetyModel() { + return _builder.getDataField< ::cereal::CarParams::SafetyModel>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarParams::SafetyConfig::Builder::setSafetyModel( ::cereal::CarParams::SafetyModel value) { + _builder.setDataField< ::cereal::CarParams::SafetyModel>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int16_t CarParams::SafetyConfig::Reader::getSafetyParam() const { + return _reader.getDataField< ::int16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int16_t CarParams::SafetyConfig::Builder::getSafetyParam() { + return _builder.getDataField< ::int16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarParams::SafetyConfig::Builder::setSafetyParam( ::int16_t value) { + _builder.setDataField< ::int16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::LateralParams::Reader::hasTorqueBP() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralParams::Builder::hasTorqueBP() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Reader CarParams::LateralParams::Reader::getTorqueBP() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Builder CarParams::LateralParams::Builder::getTorqueBP() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralParams::Builder::setTorqueBP( ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralParams::Builder::setTorqueBP(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Builder CarParams::LateralParams::Builder::initTorqueBP(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralParams::Builder::adoptTorqueBP( + ::capnp::Orphan< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>> CarParams::LateralParams::Builder::disownTorqueBP() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralParams::Reader::hasTorqueV() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralParams::Builder::hasTorqueV() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Reader CarParams::LateralParams::Reader::getTorqueV() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Builder CarParams::LateralParams::Builder::getTorqueV() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralParams::Builder::setTorqueV( ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralParams::Builder::setTorqueV(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Builder CarParams::LateralParams::Builder::initTorqueV(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralParams::Builder::adoptTorqueV( + ::capnp::Orphan< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>> CarParams::LateralParams::Builder::disownTorqueV() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralPIDTuning::Reader::hasKpBP() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralPIDTuning::Builder::hasKpBP() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralPIDTuning::Reader::getKpBP() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralPIDTuning::Builder::getKpBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralPIDTuning::Builder::setKpBP( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralPIDTuning::Builder::setKpBP(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralPIDTuning::Builder::initKpBP(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralPIDTuning::Builder::adoptKpBP( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralPIDTuning::Builder::disownKpBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralPIDTuning::Reader::hasKpV() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralPIDTuning::Builder::hasKpV() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralPIDTuning::Reader::getKpV() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralPIDTuning::Builder::getKpV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralPIDTuning::Builder::setKpV( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralPIDTuning::Builder::setKpV(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralPIDTuning::Builder::initKpV(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralPIDTuning::Builder::adoptKpV( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralPIDTuning::Builder::disownKpV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralPIDTuning::Reader::hasKiBP() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralPIDTuning::Builder::hasKiBP() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralPIDTuning::Reader::getKiBP() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralPIDTuning::Builder::getKiBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralPIDTuning::Builder::setKiBP( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralPIDTuning::Builder::setKiBP(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralPIDTuning::Builder::initKiBP(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralPIDTuning::Builder::adoptKiBP( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralPIDTuning::Builder::disownKiBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralPIDTuning::Reader::hasKiV() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralPIDTuning::Builder::hasKiV() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralPIDTuning::Reader::getKiV() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralPIDTuning::Builder::getKiV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralPIDTuning::Builder::setKiV( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralPIDTuning::Builder::setKiV(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralPIDTuning::Builder::initKiV(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralPIDTuning::Builder::adoptKiV( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralPIDTuning::Builder::disownKiV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline float CarParams::LateralPIDTuning::Reader::getKf() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float CarParams::LateralPIDTuning::Builder::getKf() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarParams::LateralPIDTuning::Builder::setKf(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::LongitudinalPIDTuning::Reader::hasKpBP() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LongitudinalPIDTuning::Builder::hasKpBP() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LongitudinalPIDTuning::Reader::getKpBP() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LongitudinalPIDTuning::Builder::getKpBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void CarParams::LongitudinalPIDTuning::Builder::setKpBP( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void CarParams::LongitudinalPIDTuning::Builder::setKpBP(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LongitudinalPIDTuning::Builder::initKpBP(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void CarParams::LongitudinalPIDTuning::Builder::adoptKpBP( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LongitudinalPIDTuning::Builder::disownKpBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LongitudinalPIDTuning::Reader::hasKpV() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LongitudinalPIDTuning::Builder::hasKpV() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LongitudinalPIDTuning::Reader::getKpV() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LongitudinalPIDTuning::Builder::getKpV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void CarParams::LongitudinalPIDTuning::Builder::setKpV( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void CarParams::LongitudinalPIDTuning::Builder::setKpV(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LongitudinalPIDTuning::Builder::initKpV(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void CarParams::LongitudinalPIDTuning::Builder::adoptKpV( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LongitudinalPIDTuning::Builder::disownKpV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LongitudinalPIDTuning::Reader::hasKiBP() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LongitudinalPIDTuning::Builder::hasKiBP() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LongitudinalPIDTuning::Reader::getKiBP() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LongitudinalPIDTuning::Builder::getKiBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void CarParams::LongitudinalPIDTuning::Builder::setKiBP( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void CarParams::LongitudinalPIDTuning::Builder::setKiBP(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LongitudinalPIDTuning::Builder::initKiBP(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void CarParams::LongitudinalPIDTuning::Builder::adoptKiBP( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LongitudinalPIDTuning::Builder::disownKiBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LongitudinalPIDTuning::Reader::hasKiV() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LongitudinalPIDTuning::Builder::hasKiV() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LongitudinalPIDTuning::Reader::getKiV() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LongitudinalPIDTuning::Builder::getKiV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void CarParams::LongitudinalPIDTuning::Builder::setKiV( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void CarParams::LongitudinalPIDTuning::Builder::setKiV(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LongitudinalPIDTuning::Builder::initKiV(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void CarParams::LongitudinalPIDTuning::Builder::adoptKiV( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LongitudinalPIDTuning::Builder::disownKiV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LongitudinalPIDTuning::Reader::hasDeadzoneBP() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LongitudinalPIDTuning::Builder::hasDeadzoneBP() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LongitudinalPIDTuning::Reader::getDeadzoneBP() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LongitudinalPIDTuning::Builder::getDeadzoneBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void CarParams::LongitudinalPIDTuning::Builder::setDeadzoneBP( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void CarParams::LongitudinalPIDTuning::Builder::setDeadzoneBP(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LongitudinalPIDTuning::Builder::initDeadzoneBP(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void CarParams::LongitudinalPIDTuning::Builder::adoptDeadzoneBP( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LongitudinalPIDTuning::Builder::disownDeadzoneBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LongitudinalPIDTuning::Reader::hasDeadzoneV() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LongitudinalPIDTuning::Builder::hasDeadzoneV() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LongitudinalPIDTuning::Reader::getDeadzoneV() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LongitudinalPIDTuning::Builder::getDeadzoneV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void CarParams::LongitudinalPIDTuning::Builder::setDeadzoneV( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void CarParams::LongitudinalPIDTuning::Builder::setDeadzoneV(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LongitudinalPIDTuning::Builder::initDeadzoneV(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void CarParams::LongitudinalPIDTuning::Builder::adoptDeadzoneV( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LongitudinalPIDTuning::Builder::disownDeadzoneV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline float CarParams::LateralINDITuning::Reader::getOuterLoopGainDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float CarParams::LateralINDITuning::Builder::getOuterLoopGainDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarParams::LateralINDITuning::Builder::setOuterLoopGainDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::LateralINDITuning::Reader::getInnerLoopGainDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float CarParams::LateralINDITuning::Builder::getInnerLoopGainDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarParams::LateralINDITuning::Builder::setInnerLoopGainDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::LateralINDITuning::Reader::getTimeConstantDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float CarParams::LateralINDITuning::Builder::getTimeConstantDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void CarParams::LateralINDITuning::Builder::setTimeConstantDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::LateralINDITuning::Reader::getActuatorEffectivenessDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float CarParams::LateralINDITuning::Builder::getActuatorEffectivenessDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void CarParams::LateralINDITuning::Builder::setActuatorEffectivenessDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::LateralINDITuning::Reader::hasOuterLoopGainBP() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralINDITuning::Builder::hasOuterLoopGainBP() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralINDITuning::Reader::getOuterLoopGainBP() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::getOuterLoopGainBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralINDITuning::Builder::setOuterLoopGainBP( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralINDITuning::Builder::setOuterLoopGainBP(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::initOuterLoopGainBP(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralINDITuning::Builder::adoptOuterLoopGainBP( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralINDITuning::Builder::disownOuterLoopGainBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralINDITuning::Reader::hasOuterLoopGainV() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralINDITuning::Builder::hasOuterLoopGainV() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralINDITuning::Reader::getOuterLoopGainV() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::getOuterLoopGainV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralINDITuning::Builder::setOuterLoopGainV( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralINDITuning::Builder::setOuterLoopGainV(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::initOuterLoopGainV(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralINDITuning::Builder::adoptOuterLoopGainV( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralINDITuning::Builder::disownOuterLoopGainV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralINDITuning::Reader::hasInnerLoopGainBP() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralINDITuning::Builder::hasInnerLoopGainBP() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralINDITuning::Reader::getInnerLoopGainBP() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::getInnerLoopGainBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralINDITuning::Builder::setInnerLoopGainBP( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralINDITuning::Builder::setInnerLoopGainBP(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::initInnerLoopGainBP(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralINDITuning::Builder::adoptInnerLoopGainBP( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralINDITuning::Builder::disownInnerLoopGainBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralINDITuning::Reader::hasInnerLoopGainV() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralINDITuning::Builder::hasInnerLoopGainV() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralINDITuning::Reader::getInnerLoopGainV() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::getInnerLoopGainV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralINDITuning::Builder::setInnerLoopGainV( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralINDITuning::Builder::setInnerLoopGainV(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::initInnerLoopGainV(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralINDITuning::Builder::adoptInnerLoopGainV( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralINDITuning::Builder::disownInnerLoopGainV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralINDITuning::Reader::hasTimeConstantBP() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralINDITuning::Builder::hasTimeConstantBP() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralINDITuning::Reader::getTimeConstantBP() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::getTimeConstantBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralINDITuning::Builder::setTimeConstantBP( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralINDITuning::Builder::setTimeConstantBP(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::initTimeConstantBP(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralINDITuning::Builder::adoptTimeConstantBP( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralINDITuning::Builder::disownTimeConstantBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralINDITuning::Reader::hasTimeConstantV() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralINDITuning::Builder::hasTimeConstantV() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralINDITuning::Reader::getTimeConstantV() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::getTimeConstantV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralINDITuning::Builder::setTimeConstantV( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralINDITuning::Builder::setTimeConstantV(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::initTimeConstantV(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralINDITuning::Builder::adoptTimeConstantV( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralINDITuning::Builder::disownTimeConstantV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralINDITuning::Reader::hasActuatorEffectivenessBP() const { + return !_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralINDITuning::Builder::hasActuatorEffectivenessBP() { + return !_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralINDITuning::Reader::getActuatorEffectivenessBP() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::getActuatorEffectivenessBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralINDITuning::Builder::setActuatorEffectivenessBP( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralINDITuning::Builder::setActuatorEffectivenessBP(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::initActuatorEffectivenessBP(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralINDITuning::Builder::adoptActuatorEffectivenessBP( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralINDITuning::Builder::disownActuatorEffectivenessBP() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralINDITuning::Reader::hasActuatorEffectivenessV() const { + return !_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralINDITuning::Builder::hasActuatorEffectivenessV() { + return !_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralINDITuning::Reader::getActuatorEffectivenessV() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::getActuatorEffectivenessV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralINDITuning::Builder::setActuatorEffectivenessV( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralINDITuning::Builder::setActuatorEffectivenessV(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralINDITuning::Builder::initActuatorEffectivenessV(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralINDITuning::Builder::adoptActuatorEffectivenessV( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralINDITuning::Builder::disownActuatorEffectivenessV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} + +inline float CarParams::LateralLQRTuning::Reader::getScale() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float CarParams::LateralLQRTuning::Builder::getScale() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarParams::LateralLQRTuning::Builder::setScale(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::LateralLQRTuning::Reader::getKi() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float CarParams::LateralLQRTuning::Builder::getKi() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarParams::LateralLQRTuning::Builder::setKi(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float CarParams::LateralLQRTuning::Reader::getDcGain() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float CarParams::LateralLQRTuning::Builder::getDcGain() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void CarParams::LateralLQRTuning::Builder::setDcGain(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::LateralLQRTuning::Reader::hasA() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralLQRTuning::Builder::hasA() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralLQRTuning::Reader::getA() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralLQRTuning::Builder::getA() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralLQRTuning::Builder::setA( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralLQRTuning::Builder::setA(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralLQRTuning::Builder::initA(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralLQRTuning::Builder::adoptA( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralLQRTuning::Builder::disownA() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralLQRTuning::Reader::hasB() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralLQRTuning::Builder::hasB() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralLQRTuning::Reader::getB() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralLQRTuning::Builder::getB() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralLQRTuning::Builder::setB( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralLQRTuning::Builder::setB(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralLQRTuning::Builder::initB(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralLQRTuning::Builder::adoptB( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralLQRTuning::Builder::disownB() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralLQRTuning::Reader::hasC() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralLQRTuning::Builder::hasC() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralLQRTuning::Reader::getC() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralLQRTuning::Builder::getC() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralLQRTuning::Builder::setC( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralLQRTuning::Builder::setC(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralLQRTuning::Builder::initC(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralLQRTuning::Builder::adoptC( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralLQRTuning::Builder::disownC() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralLQRTuning::Reader::hasK() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralLQRTuning::Builder::hasK() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralLQRTuning::Reader::getK() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralLQRTuning::Builder::getK() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralLQRTuning::Builder::setK( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralLQRTuning::Builder::setK(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralLQRTuning::Builder::initK(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralLQRTuning::Builder::adoptK( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralLQRTuning::Builder::disownK() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralLQRTuning::Reader::hasL() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralLQRTuning::Builder::hasL() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CarParams::LateralLQRTuning::Reader::getL() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CarParams::LateralLQRTuning::Builder::getL() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralLQRTuning::Builder::setL( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void CarParams::LateralLQRTuning::Builder::setL(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CarParams::LateralLQRTuning::Builder::initL(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void CarParams::LateralLQRTuning::Builder::adoptL( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CarParams::LateralLQRTuning::Builder::disownL() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline ::cereal::CarParams::Ecu CarParams::CarFw::Reader::getEcu() const { + return _reader.getDataField< ::cereal::CarParams::Ecu>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarParams::Ecu CarParams::CarFw::Builder::getEcu() { + return _builder.getDataField< ::cereal::CarParams::Ecu>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CarParams::CarFw::Builder::setEcu( ::cereal::CarParams::Ecu value) { + _builder.setDataField< ::cereal::CarParams::Ecu>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool CarParams::CarFw::Reader::hasFwVersion() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::CarFw::Builder::hasFwVersion() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader CarParams::CarFw::Reader::getFwVersion() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder CarParams::CarFw::Builder::getFwVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void CarParams::CarFw::Builder::setFwVersion( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder CarParams::CarFw::Builder::initFwVersion(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void CarParams::CarFw::Builder::adoptFwVersion( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> CarParams::CarFw::Builder::disownFwVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::uint32_t CarParams::CarFw::Reader::getAddress() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t CarParams::CarFw::Builder::getAddress() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CarParams::CarFw::Builder::setAddress( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t CarParams::CarFw::Reader::getSubAddress() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t CarParams::CarFw::Builder::getSubAddress() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void CarParams::CarFw::Builder::setSubAddress( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::CarParams::LateralTuning::Which CarParams::LateralTuning::Reader::which() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline ::cereal::CarParams::LateralTuning::Which CarParams::LateralTuning::Builder::which() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline bool CarParams::LateralTuning::Reader::isPid() const { + return which() == CarParams::LateralTuning::PID; +} +inline bool CarParams::LateralTuning::Builder::isPid() { + return which() == CarParams::LateralTuning::PID; +} +inline bool CarParams::LateralTuning::Reader::hasPid() const { + if (which() != CarParams::LateralTuning::PID) return false; + return !_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralTuning::Builder::hasPid() { + if (which() != CarParams::LateralTuning::PID) return false; + return !_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarParams::LateralPIDTuning::Reader CarParams::LateralTuning::Reader::getPid() const { + KJ_IREQUIRE((which() == CarParams::LateralTuning::PID), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralPIDTuning>::get(_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline ::cereal::CarParams::LateralPIDTuning::Builder CarParams::LateralTuning::Builder::getPid() { + KJ_IREQUIRE((which() == CarParams::LateralTuning::PID), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralPIDTuning>::get(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralTuning::Builder::setPid( ::cereal::CarParams::LateralPIDTuning::Reader value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, CarParams::LateralTuning::PID); + ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralPIDTuning>::set(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarParams::LateralPIDTuning::Builder CarParams::LateralTuning::Builder::initPid() { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, CarParams::LateralTuning::PID); + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralPIDTuning>::init(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralTuning::Builder::adoptPid( + ::capnp::Orphan< ::cereal::CarParams::LateralPIDTuning>&& value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, CarParams::LateralTuning::PID); + ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralPIDTuning>::adopt(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarParams::LateralPIDTuning> CarParams::LateralTuning::Builder::disownPid() { + KJ_IREQUIRE((which() == CarParams::LateralTuning::PID), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralPIDTuning>::disown(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralTuning::Reader::isIndi() const { + return which() == CarParams::LateralTuning::INDI; +} +inline bool CarParams::LateralTuning::Builder::isIndi() { + return which() == CarParams::LateralTuning::INDI; +} +inline bool CarParams::LateralTuning::Reader::hasIndi() const { + if (which() != CarParams::LateralTuning::INDI) return false; + return !_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralTuning::Builder::hasIndi() { + if (which() != CarParams::LateralTuning::INDI) return false; + return !_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarParams::LateralINDITuning::Reader CarParams::LateralTuning::Reader::getIndi() const { + KJ_IREQUIRE((which() == CarParams::LateralTuning::INDI), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralINDITuning>::get(_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline ::cereal::CarParams::LateralINDITuning::Builder CarParams::LateralTuning::Builder::getIndi() { + KJ_IREQUIRE((which() == CarParams::LateralTuning::INDI), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralINDITuning>::get(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralTuning::Builder::setIndi( ::cereal::CarParams::LateralINDITuning::Reader value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, CarParams::LateralTuning::INDI); + ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralINDITuning>::set(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarParams::LateralINDITuning::Builder CarParams::LateralTuning::Builder::initIndi() { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, CarParams::LateralTuning::INDI); + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralINDITuning>::init(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralTuning::Builder::adoptIndi( + ::capnp::Orphan< ::cereal::CarParams::LateralINDITuning>&& value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, CarParams::LateralTuning::INDI); + ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralINDITuning>::adopt(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarParams::LateralINDITuning> CarParams::LateralTuning::Builder::disownIndi() { + KJ_IREQUIRE((which() == CarParams::LateralTuning::INDI), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralINDITuning>::disown(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} + +inline bool CarParams::LateralTuning::Reader::isLqr() const { + return which() == CarParams::LateralTuning::LQR; +} +inline bool CarParams::LateralTuning::Builder::isLqr() { + return which() == CarParams::LateralTuning::LQR; +} +inline bool CarParams::LateralTuning::Reader::hasLqr() const { + if (which() != CarParams::LateralTuning::LQR) return false; + return !_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline bool CarParams::LateralTuning::Builder::hasLqr() { + if (which() != CarParams::LateralTuning::LQR) return false; + return !_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarParams::LateralLQRTuning::Reader CarParams::LateralTuning::Reader::getLqr() const { + KJ_IREQUIRE((which() == CarParams::LateralTuning::LQR), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralLQRTuning>::get(_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline ::cereal::CarParams::LateralLQRTuning::Builder CarParams::LateralTuning::Builder::getLqr() { + KJ_IREQUIRE((which() == CarParams::LateralTuning::LQR), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralLQRTuning>::get(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralTuning::Builder::setLqr( ::cereal::CarParams::LateralLQRTuning::Reader value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, CarParams::LateralTuning::LQR); + ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralLQRTuning>::set(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarParams::LateralLQRTuning::Builder CarParams::LateralTuning::Builder::initLqr() { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, CarParams::LateralTuning::LQR); + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralLQRTuning>::init(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline void CarParams::LateralTuning::Builder::adoptLqr( + ::capnp::Orphan< ::cereal::CarParams::LateralLQRTuning>&& value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, CarParams::LateralTuning::LQR); + ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralLQRTuning>::adopt(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarParams::LateralLQRTuning> CarParams::LateralTuning::Builder::disownLqr() { + KJ_IREQUIRE((which() == CarParams::LateralTuning::LQR), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarParams::LateralLQRTuning>::disown(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} + +} // namespace + diff --git a/cereal/gen/cpp/legacy.capnp.c++ b/cereal/gen/cpp/legacy.capnp.c++ new file mode 100644 index 000000000..fafd68c7e --- /dev/null +++ b/cereal/gen/cpp/legacy.capnp.c++ @@ -0,0 +1,10663 @@ +// Generated by Cap'n Proto compiler, DO NOT EDIT +// source: legacy.capnp + +#include "legacy.capnp.h" + +namespace capnp { +namespace schemas { +static const ::capnp::_::AlignedData<48> b_9811e1f38f62f2d1 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 209, 242, 98, 143, 243, 225, 17, 152, + 13, 0, 0, 0, 1, 0, 1, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 186, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 76, 111, 103, + 82, 111, 116, 97, 116, 101, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 0, 0, 0, 3, 0, 1, 0, + 56, 0, 0, 0, 2, 0, 1, 0, + 115, 101, 103, 109, 101, 110, 116, 78, + 117, 109, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 116, 104, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9811e1f38f62f2d1 = b_9811e1f38f62f2d1.words; +#if !CAPNP_LITE +static const uint16_t m_9811e1f38f62f2d1[] = {1, 0}; +static const uint16_t i_9811e1f38f62f2d1[] = {0, 1}; +const ::capnp::_::RawSchema s_9811e1f38f62f2d1 = { + 0x9811e1f38f62f2d1, b_9811e1f38f62f2d1.words, 48, nullptr, m_9811e1f38f62f2d1, + 0, 2, i_9811e1f38f62f2d1, nullptr, nullptr, { &s_9811e1f38f62f2d1, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<81> b_c08240f996aefced = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 237, 252, 174, 150, 249, 64, 130, 192, + 13, 0, 0, 0, 1, 0, 1, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 162, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 76, 105, 118, + 101, 85, 73, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 3, 0, 1, 0, + 108, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 0, 0, 0, 3, 0, 1, 0, + 116, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 0, 0, 0, 3, 0, 1, 0, + 124, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 0, 0, 0, 3, 0, 1, 0, + 132, 0, 0, 0, 2, 0, 1, 0, + 114, 101, 97, 114, 86, 105, 101, 119, + 67, 97, 109, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 108, 101, 114, 116, 84, 101, 120, + 116, 49, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 108, 101, 114, 116, 84, 101, 120, + 116, 50, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 119, 97, 114, 101, 110, 101, 115, + 115, 83, 116, 97, 116, 117, 115, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_c08240f996aefced = b_c08240f996aefced.words; +#if !CAPNP_LITE +static const uint16_t m_c08240f996aefced[] = {1, 2, 3, 0}; +static const uint16_t i_c08240f996aefced[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_c08240f996aefced = { + 0xc08240f996aefced, b_c08240f996aefced.words, 81, nullptr, m_c08240f996aefced, + 0, 4, i_c08240f996aefced, nullptr, nullptr, { &s_c08240f996aefced, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<86> b_88dcce08ad29dda0 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 160, 221, 41, 173, 8, 206, 220, 136, + 13, 0, 0, 0, 1, 0, 1, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 218, 0, 0, 0, + 33, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 85, 105, 76, + 97, 121, 111, 117, 116, 83, 116, 97, + 116, 101, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 133, 210, 148, 207, 10, 71, 23, 153, + 1, 0, 0, 0, 34, 0, 0, 0, + 65, 112, 112, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 3, 0, 1, 0, + 108, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 0, 0, 0, 3, 0, 1, 0, + 120, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 0, 0, 0, 3, 0, 1, 0, + 128, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 3, 0, 1, 0, + 136, 0, 0, 0, 2, 0, 1, 0, + 97, 99, 116, 105, 118, 101, 65, 112, + 112, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 133, 210, 148, 207, 10, 71, 23, 153, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 105, 100, 101, 98, 97, 114, 67, + 111, 108, 108, 97, 112, 115, 101, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 112, 69, 110, 97, 98, 108, + 101, 100, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 99, 107, 69, 110, 103, 97, + 103, 101, 100, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_88dcce08ad29dda0 = b_88dcce08ad29dda0.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_88dcce08ad29dda0[] = { + &s_9917470acf94d285, +}; +static const uint16_t m_88dcce08ad29dda0[] = {0, 2, 3, 1}; +static const uint16_t i_88dcce08ad29dda0[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_88dcce08ad29dda0 = { + 0x88dcce08ad29dda0, b_88dcce08ad29dda0.words, 86, d_88dcce08ad29dda0, m_88dcce08ad29dda0, + 1, 4, i_88dcce08ad29dda0, nullptr, nullptr, { &s_88dcce08ad29dda0, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<39> b_9917470acf94d285 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 133, 210, 148, 207, 10, 71, 23, 153, + 27, 0, 0, 0, 2, 0, 0, 0, + 160, 221, 41, 173, 8, 206, 220, 136, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 127, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 85, 105, 76, + 97, 121, 111, 117, 116, 83, 116, 97, + 116, 101, 46, 65, 112, 112, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 111, 109, 101, 0, 0, 0, 0, + 109, 117, 115, 105, 99, 0, 0, 0, + 110, 97, 118, 0, 0, 0, 0, 0, + 115, 101, 116, 116, 105, 110, 103, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 110, 101, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9917470acf94d285 = b_9917470acf94d285.words; +#if !CAPNP_LITE +static const uint16_t m_9917470acf94d285[] = {0, 1, 2, 4, 3}; +const ::capnp::_::RawSchema s_9917470acf94d285 = { + 0x9917470acf94d285, b_9917470acf94d285.words, 39, nullptr, m_9917470acf94d285, + 0, 5, nullptr, nullptr, nullptr, { &s_9917470acf94d285, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(App_9917470acf94d285, 9917470acf94d285); +static const ::capnp::_::AlignedData<133> b_8afd33dc9b35e1aa = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 170, 225, 53, 155, 220, 51, 253, 138, + 13, 0, 0, 0, 1, 0, 2, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 4, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 87, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 79, 114, 98, + 115, 108, 97, 109, 67, 111, 114, 114, + 101, 99, 116, 105, 111, 110, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 24, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 0, 0, 0, 3, 0, 1, 0, + 168, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 0, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 0, 0, 0, 3, 0, 1, 0, + 192, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 0, 0, 0, 3, 0, 1, 0, + 220, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 0, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 0, 0, 0, 3, 0, 1, 0, + 244, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 0, 0, 0, 3, 0, 1, 0, + 16, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 1, 0, 0, 3, 0, 1, 0, + 24, 1, 0, 0, 2, 0, 1, 0, + 99, 111, 114, 114, 101, 99, 116, 105, + 111, 110, 77, 111, 110, 111, 84, 105, + 109, 101, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 101, 80, 111, 115, 105, 116, + 105, 111, 110, 69, 67, 69, 70, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 116, 80, 111, 115, 105, + 116, 105, 111, 110, 69, 67, 69, 70, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 101, 80, 111, 115, 101, 81, + 117, 97, 116, 69, 67, 69, 70, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 116, 80, 111, 115, 101, + 81, 117, 97, 116, 69, 67, 69, 70, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 117, 109, 73, 110, 108, 105, 101, + 114, 115, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_8afd33dc9b35e1aa = b_8afd33dc9b35e1aa.words; +#if !CAPNP_LITE +static const uint16_t m_8afd33dc9b35e1aa[] = {0, 5, 4, 2, 3, 1}; +static const uint16_t i_8afd33dc9b35e1aa[] = {0, 1, 2, 3, 4, 5}; +const ::capnp::_::RawSchema s_8afd33dc9b35e1aa = { + 0x8afd33dc9b35e1aa, b_8afd33dc9b35e1aa.words, 133, nullptr, m_8afd33dc9b35e1aa, + 0, 6, i_8afd33dc9b35e1aa, nullptr, nullptr, { &s_8afd33dc9b35e1aa, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<48> b_a99a9d5b33cf5859 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 89, 88, 207, 51, 91, 157, 154, 169, + 13, 0, 0, 0, 1, 0, 1, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 226, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 69, 116, 104, + 101, 114, 110, 101, 116, 80, 97, 99, + 107, 101, 116, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 1, 0, + 48, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 112, 107, 116, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 115, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a99a9d5b33cf5859 = b_a99a9d5b33cf5859.words; +#if !CAPNP_LITE +static const uint16_t m_a99a9d5b33cf5859[] = {0, 1}; +static const uint16_t i_a99a9d5b33cf5859[] = {0, 1}; +const ::capnp::_::RawSchema s_a99a9d5b33cf5859 = { + 0xa99a9d5b33cf5859, b_a99a9d5b33cf5859.words, 48, nullptr, m_a99a9d5b33cf5859, + 0, 2, i_a99a9d5b33cf5859, nullptr, nullptr, { &s_a99a9d5b33cf5859, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<48> b_cff7566681c277ce = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 206, 119, 194, 129, 102, 86, 247, 207, + 13, 0, 0, 0, 1, 0, 1, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 178, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 67, 101, 108, + 108, 73, 110, 102, 111, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 0, 0, 0, 3, 0, 1, 0, + 56, 0, 0, 0, 2, 0, 1, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 112, 114, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_cff7566681c277ce = b_cff7566681c277ce.words; +#if !CAPNP_LITE +static const uint16_t m_cff7566681c277ce[] = {1, 0}; +static const uint16_t i_cff7566681c277ce[] = {0, 1}; +const ::capnp::_::RawSchema s_cff7566681c277ce = { + 0xcff7566681c277ce, b_cff7566681c277ce.words, 48, nullptr, m_cff7566681c277ce, + 0, 2, i_cff7566681c277ce, nullptr, nullptr, { &s_cff7566681c277ce, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<260> b_d4df5a192382ba0b = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 11, 186, 130, 35, 25, 90, 223, 212, + 13, 0, 0, 0, 1, 0, 5, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 5, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 178, 0, 0, 0, + 29, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 79, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 87, 105, 102, + 105, 83, 99, 97, 110, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 81, 107, 95, 1, 159, 39, 106, 203, + 1, 0, 0, 0, 106, 0, 0, 0, + 67, 104, 97, 110, 110, 101, 108, 87, + 105, 100, 116, 104, 0, 0, 0, 0, + 60, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 1, 0, 0, 3, 0, 1, 0, + 156, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 1, 0, 0, 3, 0, 1, 0, + 160, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 1, 0, 0, 3, 0, 1, 0, + 168, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 1, 0, 0, 3, 0, 1, 0, + 176, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 1, 0, 0, 3, 0, 1, 0, + 180, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 1, 0, 0, 3, 0, 1, 0, + 188, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 1, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 1, 0, 0, 3, 0, 1, 0, + 196, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 1, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 1, 0, 0, 3, 0, 1, 0, + 204, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 1, 0, 0, 3, 0, 1, 0, + 212, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 1, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 1, 0, 0, 3, 0, 1, 0, + 224, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 1, 0, 0, 3, 0, 1, 0, + 232, 1, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 208, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 1, 0, 0, 3, 0, 1, 0, + 244, 1, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 209, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 1, 0, 0, 3, 0, 1, 0, + 252, 1, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 1, 0, 0, 3, 0, 1, 0, + 4, 2, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2, 0, 0, 3, 0, 1, 0, + 12, 2, 0, 0, 2, 0, 1, 0, + 98, 115, 115, 105, 100, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 115, 105, 100, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 112, 97, 98, 105, 108, 105, + 116, 105, 101, 115, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 101, 113, 117, 101, 110, 99, + 121, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 118, 101, 108, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 101, 110, 116, 101, 114, 70, 114, + 101, 113, 48, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 101, 110, 116, 101, 114, 70, 114, + 101, 113, 49, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 104, 97, 110, 110, 101, 108, 87, + 105, 100, 116, 104, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 81, 107, 95, 1, 159, 39, 106, 203, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 112, 101, 114, 97, 116, 111, 114, + 70, 114, 105, 101, 110, 100, 108, 121, + 78, 97, 109, 101, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 110, 117, 101, 78, 97, 109, + 101, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 115, 56, 48, 50, 49, 49, 109, + 99, 82, 101, 115, 112, 111, 110, 100, + 101, 114, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 115, 115, 112, 111, 105, 110, + 116, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 115, 116, 97, 110, 99, 101, + 67, 109, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 115, 116, 97, 110, 99, 101, + 83, 100, 67, 109, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d4df5a192382ba0b = b_d4df5a192382ba0b.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_d4df5a192382ba0b[] = { + &s_cb6a279f015f6b51, +}; +static const uint16_t m_d4df5a192382ba0b[] = {0, 2, 6, 7, 8, 13, 14, 3, 11, 4, 9, 12, 1, 5, 10}; +static const uint16_t i_d4df5a192382ba0b[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; +const ::capnp::_::RawSchema s_d4df5a192382ba0b = { + 0xd4df5a192382ba0b, b_d4df5a192382ba0b.words, 260, d_d4df5a192382ba0b, m_d4df5a192382ba0b, + 1, 15, i_d4df5a192382ba0b, nullptr, nullptr, { &s_d4df5a192382ba0b, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<40> b_cb6a279f015f6b51 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 81, 107, 95, 1, 159, 39, 106, 203, + 22, 0, 0, 0, 2, 0, 0, 0, + 11, 186, 130, 35, 25, 90, 223, 212, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 26, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 127, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 87, 105, 102, + 105, 83, 99, 97, 110, 46, 67, 104, + 97, 110, 110, 101, 108, 87, 105, 100, + 116, 104, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 119, 50, 48, 77, 104, 122, 0, 0, + 119, 52, 48, 77, 104, 122, 0, 0, + 119, 56, 48, 77, 104, 122, 0, 0, + 119, 49, 54, 48, 77, 104, 122, 0, + 119, 56, 48, 80, 108, 117, 115, 56, + 48, 77, 104, 122, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_cb6a279f015f6b51 = b_cb6a279f015f6b51.words; +#if !CAPNP_LITE +static const uint16_t m_cb6a279f015f6b51[] = {3, 0, 1, 2, 4}; +const ::capnp::_::RawSchema s_cb6a279f015f6b51 = { + 0xcb6a279f015f6b51, b_cb6a279f015f6b51.words, 40, nullptr, m_cb6a279f015f6b51, + 0, 5, nullptr, nullptr, nullptr, { &s_cb6a279f015f6b51, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(ChannelWidth_cb6a279f015f6b51, cb6a279f015f6b51); +static const ::capnp::_::AlignedData<48> b_94b7baa90c5c321e = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 30, 50, 92, 12, 169, 186, 183, 148, + 13, 0, 0, 0, 1, 0, 1, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 218, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 76, 105, 118, + 101, 69, 118, 101, 110, 116, 68, 97, + 116, 97, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 1, 0, + 48, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 110, 97, 109, 101, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 97, 108, 117, 101, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_94b7baa90c5c321e = b_94b7baa90c5c321e.words; +#if !CAPNP_LITE +static const uint16_t m_94b7baa90c5c321e[] = {0, 1}; +static const uint16_t i_94b7baa90c5c321e[] = {0, 1}; +const ::capnp::_::RawSchema s_94b7baa90c5c321e = { + 0x94b7baa90c5c321e, b_94b7baa90c5c321e.words, 48, nullptr, m_94b7baa90c5c321e, + 0, 2, i_94b7baa90c5c321e, nullptr, nullptr, { &s_94b7baa90c5c321e, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<314> b_b8aad62cffef28a9 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 169, 40, 239, 255, 44, 214, 170, 184, + 13, 0, 0, 0, 1, 0, 4, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 11, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 186, 0, 0, 0, + 29, 0, 0, 0, 87, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 191, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 77, 111, 100, + 101, 108, 68, 97, 116, 97, 0, 0, + 20, 0, 0, 0, 1, 0, 1, 0, + 8, 159, 158, 56, 234, 238, 23, 136, + 33, 0, 0, 0, 74, 0, 0, 0, + 145, 250, 38, 109, 249, 190, 201, 209, + 33, 0, 0, 0, 74, 0, 0, 0, + 20, 233, 211, 239, 16, 55, 110, 162, + 33, 0, 0, 0, 114, 0, 0, 0, + 248, 43, 15, 182, 95, 242, 68, 151, + 33, 0, 0, 0, 74, 0, 0, 0, + 34, 17, 7, 106, 156, 153, 143, 249, + 33, 0, 0, 0, 138, 0, 0, 0, + 80, 97, 116, 104, 68, 97, 116, 97, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 101, 97, 100, 68, 97, 116, 97, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 111, 100, 101, 108, 83, 101, 116, + 116, 105, 110, 103, 115, 0, 0, 0, + 77, 101, 116, 97, 68, 97, 116, 97, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 111, 110, 103, 105, 116, 117, 100, + 105, 110, 97, 108, 68, 97, 116, 97, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 1, 0, 0, 3, 0, 1, 0, + 212, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 1, 0, 0, 3, 0, 1, 0, + 216, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 1, 0, 0, 3, 0, 1, 0, + 224, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 1, 0, 0, 3, 0, 1, 0, + 232, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 1, 0, 0, 3, 0, 1, 0, + 236, 1, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 1, 0, 0, 3, 0, 1, 0, + 244, 1, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 1, 0, 0, 3, 0, 1, 0, + 12, 2, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 2, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 2, 0, 0, 3, 0, 1, 0, + 20, 2, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 2, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 2, 0, 0, 3, 0, 1, 0, + 40, 2, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 2, 0, 0, 3, 0, 1, 0, + 48, 2, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 2, 0, 0, 3, 0, 1, 0, + 52, 2, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 2, 0, 0, 3, 0, 1, 0, + 60, 2, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 2, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 2, 0, 0, 3, 0, 1, 0, + 68, 2, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 2, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 2, 0, 0, 3, 0, 1, 0, + 76, 2, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 2, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 2, 0, 0, 3, 0, 1, 0, + 88, 2, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 2, 0, 0, 3, 0, 1, 0, + 92, 2, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 2, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 2, 0, 0, 3, 0, 1, 0, + 104, 2, 0, 0, 2, 0, 1, 0, + 102, 114, 97, 109, 101, 73, 100, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 116, 104, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 8, 159, 158, 56, 234, 238, 23, 136, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 102, 116, 76, 97, 110, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 8, 159, 158, 56, 234, 238, 23, 136, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 105, 103, 104, 116, 76, 97, 110, + 101, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 8, 159, 158, 56, 234, 238, 23, 136, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 97, 100, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 145, 250, 38, 109, 249, 190, 201, 209, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 116, 116, 105, 110, 103, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 20, 233, 211, 239, 16, 55, 110, 162, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 101, 101, 80, 97, 116, 104, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 97, 100, 70, 117, 116, 117, + 114, 101, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 145, 250, 38, 109, 249, 190, 201, 209, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 69, 111, 102, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 116, 97, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 248, 43, 15, 182, 95, 242, 68, 151, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 110, 103, 105, 116, 117, 100, + 105, 110, 97, 108, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 34, 17, 7, 106, 156, 153, 143, 249, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 97, 109, 101, 65, 103, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 97, 109, 101, 68, 114, 111, + 112, 80, 101, 114, 99, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 100, 101, 108, 69, 120, 101, + 99, 117, 116, 105, 111, 110, 84, 105, + 109, 101, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 119, 80, 114, 101, 100, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 117, 69, 120, 101, 99, 117, + 116, 105, 111, 110, 84, 105, 109, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_b8aad62cffef28a9 = b_b8aad62cffef28a9.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_b8aad62cffef28a9[] = { + &s_8817eeea389e9f08, + &s_9744f25fb60f2bf8, + &s_a26e3710efd3e914, + &s_d1c9bef96d26fa91, + &s_f98f999c6a071122, +}; +static const uint16_t m_b8aad62cffef28a9[] = {12, 13, 0, 6, 16, 4, 7, 2, 11, 10, 14, 1, 15, 3, 5, 8, 9}; +static const uint16_t i_b8aad62cffef28a9[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; +const ::capnp::_::RawSchema s_b8aad62cffef28a9 = { + 0xb8aad62cffef28a9, b_b8aad62cffef28a9.words, 314, d_b8aad62cffef28a9, m_b8aad62cffef28a9, + 5, 17, i_b8aad62cffef28a9, nullptr, nullptr, { &s_b8aad62cffef28a9, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<121> b_8817eeea389e9f08 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 8, 159, 158, 56, 234, 238, 23, 136, + 23, 0, 0, 0, 1, 0, 2, 0, + 169, 40, 239, 255, 44, 214, 170, 184, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 2, 1, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 87, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 77, 111, 100, + 101, 108, 68, 97, 116, 97, 46, 80, + 97, 116, 104, 68, 97, 116, 97, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 24, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 0, 0, 0, 3, 0, 1, 0, + 176, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 0, 0, 0, 3, 0, 1, 0, + 180, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 0, 0, 0, 3, 0, 1, 0, + 184, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 3, 0, 1, 0, + 204, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 0, 0, 0, 3, 0, 1, 0, + 224, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 0, 0, 0, 3, 0, 1, 0, + 232, 0, 0, 0, 2, 0, 1, 0, + 112, 111, 105, 110, 116, 115, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 111, 98, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 100, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 100, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 108, 121, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 97, 108, 105, 100, 76, 101, 110, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_8817eeea389e9f08 = b_8817eeea389e9f08.words; +#if !CAPNP_LITE +static const uint16_t m_8817eeea389e9f08[] = {0, 4, 1, 2, 3, 5}; +static const uint16_t i_8817eeea389e9f08[] = {0, 1, 2, 3, 4, 5}; +const ::capnp::_::RawSchema s_8817eeea389e9f08 = { + 0x8817eeea389e9f08, b_8817eeea389e9f08.words, 121, nullptr, m_8817eeea389e9f08, + 0, 6, i_8817eeea389e9f08, nullptr, nullptr, { &s_8817eeea389e9f08, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<154> b_d1c9bef96d26fa91 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 145, 250, 38, 109, 249, 190, 201, 209, + 23, 0, 0, 0, 1, 0, 5, 0, + 169, 40, 239, 255, 44, 214, 170, 184, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 2, 1, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 255, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 77, 111, 100, + 101, 108, 68, 97, 116, 97, 46, 76, + 101, 97, 100, 68, 97, 116, 97, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 36, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 0, 0, 0, 3, 0, 1, 0, + 244, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 0, 0, 0, 3, 0, 1, 0, + 248, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 0, 0, 0, 3, 0, 1, 0, + 252, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 0, 0, 0, 3, 0, 1, 0, + 0, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 0, 0, 0, 3, 0, 1, 0, + 8, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 3, 0, 1, 0, + 12, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 1, 0, 0, 3, 0, 1, 0, + 16, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 1, 0, 0, 3, 0, 1, 0, + 20, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 1, 0, 0, 3, 0, 1, 0, + 24, 1, 0, 0, 2, 0, 1, 0, + 100, 105, 115, 116, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 111, 98, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 100, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 108, 86, 101, 108, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 108, 86, 101, 108, 83, 116, + 100, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 108, 89, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 108, 89, 83, 116, 100, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 108, 65, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 108, 65, 83, 116, 100, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d1c9bef96d26fa91 = b_d1c9bef96d26fa91.words; +#if !CAPNP_LITE +static const uint16_t m_d1c9bef96d26fa91[] = {0, 1, 7, 8, 3, 4, 5, 6, 2}; +static const uint16_t i_d1c9bef96d26fa91[] = {0, 1, 2, 3, 4, 5, 6, 7, 8}; +const ::capnp::_::RawSchema s_d1c9bef96d26fa91 = { + 0xd1c9bef96d26fa91, b_d1c9bef96d26fa91.words, 154, nullptr, m_d1c9bef96d26fa91, + 0, 9, i_d1c9bef96d26fa91, nullptr, nullptr, { &s_d1c9bef96d26fa91, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<141> b_a26e3710efd3e914 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 20, 233, 211, 239, 16, 55, 110, 162, + 23, 0, 0, 0, 1, 0, 1, 0, + 169, 40, 239, 255, 44, 214, 170, 184, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 42, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 143, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 77, 111, 100, + 101, 108, 68, 97, 116, 97, 46, 77, + 111, 100, 101, 108, 83, 101, 116, 116, + 105, 110, 103, 115, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 3, 0, 1, 0, + 188, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 0, 0, 0, 3, 0, 1, 0, + 192, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 3, 0, 1, 0, + 200, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 0, 0, 0, 3, 0, 1, 0, + 208, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 232, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 0, 0, 0, 3, 0, 1, 0, + 0, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 0, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 0, 0, 0, 3, 0, 1, 0, + 24, 1, 0, 0, 2, 0, 1, 0, + 98, 105, 103, 66, 111, 120, 88, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 105, 103, 66, 111, 120, 89, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 105, 103, 66, 111, 120, 87, 105, + 100, 116, 104, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 105, 103, 66, 111, 120, 72, 101, + 105, 103, 104, 116, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 111, 120, 80, 114, 111, 106, 101, + 99, 116, 105, 111, 110, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 117, 118, 67, 111, 114, 114, 101, + 99, 116, 105, 111, 110, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 112, 117, 116, 84, 114, 97, + 110, 115, 102, 111, 114, 109, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a26e3710efd3e914 = b_a26e3710efd3e914.words; +#if !CAPNP_LITE +static const uint16_t m_a26e3710efd3e914[] = {3, 2, 0, 1, 4, 6, 5}; +static const uint16_t i_a26e3710efd3e914[] = {0, 1, 2, 3, 4, 5, 6}; +const ::capnp::_::RawSchema s_a26e3710efd3e914 = { + 0xa26e3710efd3e914, b_a26e3710efd3e914.words, 141, nullptr, m_a26e3710efd3e914, + 0, 7, i_a26e3710efd3e914, nullptr, nullptr, { &s_a26e3710efd3e914, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<126> b_9744f25fb60f2bf8 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 248, 43, 15, 182, 95, 242, 68, 151, + 23, 0, 0, 0, 1, 0, 2, 0, + 169, 40, 239, 255, 44, 214, 170, 184, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 2, 1, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 87, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 77, 111, 100, + 101, 108, 68, 97, 116, 97, 46, 77, + 101, 116, 97, 68, 97, 116, 97, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 24, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 0, 0, 0, 3, 0, 1, 0, + 192, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 0, 0, 0, 3, 0, 1, 0, + 204, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 216, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 0, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 0, 0, 0, 3, 0, 1, 0, + 228, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 0, 0, 0, 3, 0, 1, 0, + 252, 0, 0, 0, 2, 0, 1, 0, + 101, 110, 103, 97, 103, 101, 100, 80, + 114, 111, 98, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 115, 105, 114, 101, 80, 114, + 101, 100, 105, 99, 116, 105, 111, 110, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 68, 105, 115, + 101, 110, 103, 97, 103, 101, 80, 114, + 111, 98, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 115, 68, 105, 115, 101, 110, + 103, 97, 103, 101, 80, 114, 111, 98, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 79, 118, 101, + 114, 114, 105, 100, 101, 80, 114, 111, + 98, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 115, 105, 114, 101, 83, 116, + 97, 116, 101, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9744f25fb60f2bf8 = b_9744f25fb60f2bf8.words; +#if !CAPNP_LITE +static const uint16_t m_9744f25fb60f2bf8[] = {2, 1, 5, 0, 3, 4}; +static const uint16_t i_9744f25fb60f2bf8[] = {0, 1, 2, 3, 4, 5}; +const ::capnp::_::RawSchema s_9744f25fb60f2bf8 = { + 0x9744f25fb60f2bf8, b_9744f25fb60f2bf8.words, 126, nullptr, m_9744f25fb60f2bf8, + 0, 6, i_9744f25fb60f2bf8, nullptr, nullptr, { &s_9744f25fb60f2bf8, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<78> b_f98f999c6a071122 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 34, 17, 7, 106, 156, 153, 143, 249, + 23, 0, 0, 0, 1, 0, 0, 0, + 169, 40, 239, 255, 44, 214, 170, 184, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 66, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 77, 111, 100, + 101, 108, 68, 97, 116, 97, 46, 76, + 111, 110, 103, 105, 116, 117, 100, 105, + 110, 97, 108, 68, 97, 116, 97, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 3, 0, 4, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 3, 0, 1, 0, + 92, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 0, 0, 0, 3, 0, 1, 0, + 116, 0, 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 0, 0, 0, 3, 0, 1, 0, + 140, 0, 0, 0, 2, 0, 1, 0, + 115, 112, 101, 101, 100, 115, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 101, 108, 101, 114, 97, + 116, 105, 111, 110, 115, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 115, 116, 97, 110, 99, 101, + 115, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_f98f999c6a071122 = b_f98f999c6a071122.words; +#if !CAPNP_LITE +static const uint16_t m_f98f999c6a071122[] = {1, 2, 0}; +static const uint16_t i_f98f999c6a071122[] = {0, 1, 2}; +const ::capnp::_::RawSchema s_f98f999c6a071122 = { + 0xf98f999c6a071122, b_f98f999c6a071122.words, 78, nullptr, m_f98f999c6a071122, + 0, 3, i_f98f999c6a071122, nullptr, nullptr, { &s_f98f999c6a071122, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<62> b_c25bbbd524983447 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 71, 52, 152, 36, 213, 187, 91, 194, + 13, 0, 0, 0, 1, 0, 3, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 186, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 69, 67, 69, + 70, 80, 111, 105, 110, 116, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 3, 0, 1, 0, + 76, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 0, 0, 3, 0, 1, 0, + 80, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 0, 0, 0, 3, 0, 1, 0, + 84, 0, 0, 0, 2, 0, 1, 0, + 120, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 122, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_c25bbbd524983447 = b_c25bbbd524983447.words; +#if !CAPNP_LITE +static const uint16_t m_c25bbbd524983447[] = {0, 1, 2}; +static const uint16_t i_c25bbbd524983447[] = {0, 1, 2}; +const ::capnp::_::RawSchema s_c25bbbd524983447 = { + 0xc25bbbd524983447, b_c25bbbd524983447.words, 62, nullptr, m_c25bbbd524983447, + 0, 3, i_c25bbbd524983447, nullptr, nullptr, { &s_c25bbbd524983447, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<64> b_e10e21168db0c7f7 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 247, 199, 176, 141, 22, 33, 14, 225, + 13, 0, 0, 0, 1, 0, 2, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 10, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 69, 67, 69, + 70, 80, 111, 105, 110, 116, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 3, 0, 1, 0, + 76, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 0, 0, 3, 0, 1, 0, + 80, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 0, 0, 0, 3, 0, 1, 0, + 84, 0, 0, 0, 2, 0, 1, 0, + 120, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 122, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e10e21168db0c7f7 = b_e10e21168db0c7f7.words; +#if !CAPNP_LITE +static const uint16_t m_e10e21168db0c7f7[] = {0, 1, 2}; +static const uint16_t i_e10e21168db0c7f7[] = {0, 1, 2}; +const ::capnp::_::RawSchema s_e10e21168db0c7f7 = { + 0xe10e21168db0c7f7, b_e10e21168db0c7f7.words, 64, nullptr, m_e10e21168db0c7f7, + 0, 3, i_e10e21168db0c7f7, nullptr, nullptr, { &s_e10e21168db0c7f7, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<153> b_ab54c59699f8f9f3 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 243, 249, 248, 153, 150, 197, 84, 171, + 13, 0, 0, 0, 1, 0, 2, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 5, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 242, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 199, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 71, 80, 83, + 80, 108, 97, 110, 110, 101, 114, 80, + 111, 105, 110, 116, 115, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 32, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 0, 0, 0, 3, 0, 1, 0, + 224, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 0, 0, 0, 3, 0, 1, 0, + 252, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 0, 0, 0, 3, 0, 1, 0, + 0, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 0, 0, 0, 3, 0, 1, 0, + 8, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 1, 0, 0, 3, 0, 1, 0, + 16, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 1, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 1, 0, 0, 3, 0, 1, 0, + 24, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 1, 0, 0, 3, 0, 1, 0, + 28, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 1, 0, 0, 3, 0, 1, 0, + 48, 1, 0, 0, 2, 0, 1, 0, + 99, 117, 114, 80, 111, 115, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 247, 199, 176, 141, 22, 33, 14, 225, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 105, 110, 116, 115, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 247, 199, 176, 141, 22, 33, 14, 225, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 97, 108, 105, 100, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 114, 97, 99, 107, 78, 97, 109, + 101, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 76, 105, 109, + 105, 116, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 101, 108, 84, 97, 114, + 103, 101, 116, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 114, 80, 111, 115, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 71, 52, 152, 36, 213, 187, 91, 194, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 105, 110, 116, 115, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 71, 52, 152, 36, 213, 187, 91, 194, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_ab54c59699f8f9f3 = b_ab54c59699f8f9f3.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_ab54c59699f8f9f3[] = { + &s_c25bbbd524983447, + &s_e10e21168db0c7f7, +}; +static const uint16_t m_ab54c59699f8f9f3[] = {5, 6, 0, 7, 1, 4, 3, 2}; +static const uint16_t i_ab54c59699f8f9f3[] = {0, 1, 2, 3, 4, 5, 6, 7}; +const ::capnp::_::RawSchema s_ab54c59699f8f9f3 = { + 0xab54c59699f8f9f3, b_ab54c59699f8f9f3.words, 153, d_ab54c59699f8f9f3, m_ab54c59699f8f9f3, + 2, 8, i_ab54c59699f8f9f3, nullptr, nullptr, { &s_ab54c59699f8f9f3, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<155> b_f5ad1d90cdc1dd6b = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 107, 221, 193, 205, 144, 29, 173, 245, + 13, 0, 0, 0, 1, 0, 2, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 4, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 226, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 199, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 71, 80, 83, + 80, 108, 97, 110, 110, 101, 114, 80, + 108, 97, 110, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 32, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 216, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 0, 0, 0, 3, 0, 1, 0, + 236, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 0, 0, 0, 3, 0, 1, 0, + 244, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 0, 0, 0, 3, 0, 1, 0, + 248, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 0, 0, 0, 3, 0, 1, 0, + 0, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 3, 0, 1, 0, + 28, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 1, 0, 0, 3, 0, 1, 0, + 48, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 1, 0, 0, 3, 0, 1, 0, + 56, 1, 0, 0, 2, 0, 1, 0, + 118, 97, 108, 105, 100, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 108, 121, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 114, 97, 99, 107, 78, 97, 109, + 101, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 101, 108, 101, 114, 97, + 116, 105, 111, 110, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 105, 110, 116, 115, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 247, 199, 176, 141, 22, 33, 14, 225, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 105, 110, 116, 115, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 71, 52, 152, 36, 213, 187, 91, 194, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 76, 111, 111, 107, 97, 104, 101, + 97, 100, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_f5ad1d90cdc1dd6b = b_f5ad1d90cdc1dd6b.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_f5ad1d90cdc1dd6b[] = { + &s_c25bbbd524983447, + &s_e10e21168db0c7f7, +}; +static const uint16_t m_f5ad1d90cdc1dd6b[] = {4, 6, 5, 1, 3, 2, 0, 7}; +static const uint16_t i_f5ad1d90cdc1dd6b[] = {0, 1, 2, 3, 4, 5, 6, 7}; +const ::capnp::_::RawSchema s_f5ad1d90cdc1dd6b = { + 0xf5ad1d90cdc1dd6b, b_f5ad1d90cdc1dd6b.words, 155, d_f5ad1d90cdc1dd6b, m_f5ad1d90cdc1dd6b, + 2, 8, i_f5ad1d90cdc1dd6b, nullptr, nullptr, { &s_f5ad1d90cdc1dd6b, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<103> b_90c8426c3eaddd3b = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 59, 221, 173, 62, 108, 66, 200, 144, + 13, 0, 0, 0, 1, 0, 1, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 31, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 85, 105, 78, + 97, 118, 105, 103, 97, 116, 105, 111, + 110, 69, 118, 101, 110, 116, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 5, 234, 252, 248, 220, 7, 219, 232, + 9, 0, 0, 0, 42, 0, 0, 0, + 31, 154, 249, 94, 199, 136, 170, 185, + 5, 0, 0, 0, 58, 0, 0, 0, + 84, 121, 112, 101, 0, 0, 0, 0, + 83, 116, 97, 116, 117, 115, 0, 0, + 20, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 0, 0, 0, 3, 0, 1, 0, + 132, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 3, 0, 1, 0, + 136, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 0, 0, 0, 3, 0, 1, 0, + 144, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 0, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 0, 0, 0, 3, 0, 1, 0, + 156, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 116, 121, 112, 101, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 5, 234, 252, 248, 220, 7, 219, 232, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 116, 117, 115, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 31, 154, 249, 94, 199, 136, 170, 185, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 115, 116, 97, 110, 99, 101, + 84, 111, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 100, 82, 111, 97, 100, 80, + 111, 105, 110, 116, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 247, 199, 176, 141, 22, 33, 14, 225, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 100, 82, 111, 97, 100, 80, + 111, 105, 110, 116, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 71, 52, 152, 36, 213, 187, 91, 194, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_90c8426c3eaddd3b = b_90c8426c3eaddd3b.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_90c8426c3eaddd3b[] = { + &s_b9aa88c75ef99a1f, + &s_c25bbbd524983447, + &s_e10e21168db0c7f7, + &s_e8db07dcf8fcea05, +}; +static const uint16_t m_90c8426c3eaddd3b[] = {2, 4, 3, 1, 0}; +static const uint16_t i_90c8426c3eaddd3b[] = {0, 1, 2, 3, 4}; +const ::capnp::_::RawSchema s_90c8426c3eaddd3b = { + 0x90c8426c3eaddd3b, b_90c8426c3eaddd3b.words, 103, d_90c8426c3eaddd3b, m_90c8426c3eaddd3b, + 4, 5, i_90c8426c3eaddd3b, nullptr, nullptr, { &s_90c8426c3eaddd3b, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<53> b_e8db07dcf8fcea05 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 5, 234, 252, 248, 220, 7, 219, 232, + 31, 0, 0, 0, 2, 0, 0, 0, + 59, 221, 173, 62, 108, 66, 200, 144, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 34, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 85, 105, 78, + 97, 118, 105, 103, 97, 116, 105, 111, + 110, 69, 118, 101, 110, 116, 46, 84, + 121, 112, 101, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 57, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 110, 101, 0, 0, 0, 0, + 108, 97, 110, 101, 67, 104, 97, 110, + 103, 101, 76, 101, 102, 116, 0, 0, + 108, 97, 110, 101, 67, 104, 97, 110, + 103, 101, 82, 105, 103, 104, 116, 0, + 109, 101, 114, 103, 101, 76, 101, 102, + 116, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 114, 103, 101, 82, 105, 103, + 104, 116, 0, 0, 0, 0, 0, 0, + 116, 117, 114, 110, 76, 101, 102, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 117, 114, 110, 82, 105, 103, 104, + 116, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e8db07dcf8fcea05 = b_e8db07dcf8fcea05.words; +#if !CAPNP_LITE +static const uint16_t m_e8db07dcf8fcea05[] = {1, 2, 3, 4, 0, 5, 6}; +const ::capnp::_::RawSchema s_e8db07dcf8fcea05 = { + 0xe8db07dcf8fcea05, b_e8db07dcf8fcea05.words, 53, nullptr, m_e8db07dcf8fcea05, + 0, 7, nullptr, nullptr, nullptr, { &s_e8db07dcf8fcea05, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(Type_e8db07dcf8fcea05, e8db07dcf8fcea05); +static const ::capnp::_::AlignedData<36> b_b9aa88c75ef99a1f = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 31, 154, 249, 94, 199, 136, 170, 185, + 31, 0, 0, 0, 2, 0, 0, 0, + 59, 221, 173, 62, 108, 66, 200, 144, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 50, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 103, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 85, 105, 78, + 97, 118, 105, 103, 97, 116, 105, 111, + 110, 69, 118, 101, 110, 116, 46, 83, + 116, 97, 116, 117, 115, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 110, 101, 0, 0, 0, 0, + 112, 97, 115, 115, 105, 118, 101, 0, + 97, 112, 112, 114, 111, 97, 99, 104, + 105, 110, 103, 0, 0, 0, 0, 0, + 97, 99, 116, 105, 118, 101, 0, 0, } +}; +::capnp::word const* const bp_b9aa88c75ef99a1f = b_b9aa88c75ef99a1f.words; +#if !CAPNP_LITE +static const uint16_t m_b9aa88c75ef99a1f[] = {3, 2, 0, 1}; +const ::capnp::_::RawSchema s_b9aa88c75ef99a1f = { + 0xb9aa88c75ef99a1f, b_b9aa88c75ef99a1f.words, 36, nullptr, m_b9aa88c75ef99a1f, + 0, 4, nullptr, nullptr, nullptr, { &s_b9aa88c75ef99a1f, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(Status_b9aa88c75ef99a1f, b9aa88c75ef99a1f); +static const ::capnp::_::AlignedData<406> b_b99b2bc7a57e8128 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 40, 129, 126, 165, 199, 43, 155, 185, + 13, 0, 0, 0, 1, 0, 10, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 7, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 242, 0, 0, 0, + 33, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 15, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 76, 105, 118, + 101, 76, 111, 99, 97, 116, 105, 111, + 110, 68, 97, 116, 97, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 63, 176, 115, 84, 98, 196, 61, 148, + 9, 0, 0, 0, 74, 0, 0, 0, + 87, 246, 42, 37, 204, 211, 113, 200, + 9, 0, 0, 0, 106, 0, 0, 0, + 65, 99, 99, 117, 114, 97, 99, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 83, 101, 110, 115, 111, 114, 83, 111, + 117, 114, 99, 101, 0, 0, 0, 0, + 92, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 2, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 2, 0, 0, 3, 0, 1, 0, + 124, 2, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 2, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 2, 0, 0, 3, 0, 1, 0, + 128, 2, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 2, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 2, 0, 0, 3, 0, 1, 0, + 132, 2, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 2, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 2, 0, 0, 3, 0, 1, 0, + 136, 2, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 2, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 2, 0, 0, 3, 0, 1, 0, + 140, 2, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 2, 0, 0, 3, 0, 1, 0, + 160, 2, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 2, 0, 0, 3, 0, 1, 0, + 164, 2, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 2, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 2, 0, 0, 3, 0, 1, 0, + 168, 2, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 2, 0, 0, 3, 0, 1, 0, + 172, 2, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 2, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 2, 0, 0, 3, 0, 1, 0, + 180, 2, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 2, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 2, 0, 0, 3, 0, 1, 0, + 188, 2, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 2, 0, 0, 3, 0, 1, 0, + 208, 2, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 2, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 2, 0, 0, 3, 0, 1, 0, + 228, 2, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 2, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 2, 0, 0, 3, 0, 1, 0, + 236, 2, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 2, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 2, 0, 0, 3, 0, 1, 0, + 240, 2, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 2, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 2, 0, 0, 3, 0, 1, 0, + 248, 2, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 2, 0, 0, 3, 0, 1, 0, + 252, 2, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 2, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 2, 0, 0, 3, 0, 1, 0, + 4, 3, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 3, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 3, 0, 1, 0, + 28, 3, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 3, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 3, 0, 0, 3, 0, 1, 0, + 52, 3, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 3, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 3, 0, 0, 3, 0, 1, 0, + 64, 3, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 3, 0, 0, 3, 0, 1, 0, + 72, 3, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 3, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 3, 0, 0, 3, 0, 1, 0, + 96, 3, 0, 0, 2, 0, 1, 0, + 115, 116, 97, 116, 117, 115, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 116, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 110, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 108, 116, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 78, 69, 68, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 108, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 105, 116, 99, 104, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 101, 97, 100, 105, 110, 103, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 119, 97, 110, 100, 101, 114, 65, 110, + 103, 108, 101, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 114, 97, 99, 107, 65, 110, 103, + 108, 101, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 121, 114, 111, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 101, 108, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 117, 114, 97, 99, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 63, 176, 115, 84, 98, 196, 61, 148, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 111, 117, 114, 99, 101, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 87, 246, 42, 37, 204, 211, 113, 200, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 120, 77, 111, 110, 111, 84, + 105, 109, 101, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 87, 101, 101, 107, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 79, 102, 87, 101, + 101, 107, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 105, 116, 105, 111, 110, + 69, 67, 69, 70, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 101, 81, 117, 97, 116, + 69, 67, 69, 70, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 105, 116, 99, 104, 67, 97, 108, + 105, 98, 114, 97, 116, 105, 111, 110, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 97, 119, 67, 97, 108, 105, 98, + 114, 97, 116, 105, 111, 110, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 109, 117, 70, 114, 97, 109, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_b99b2bc7a57e8128 = b_b99b2bc7a57e8128.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_b99b2bc7a57e8128[] = { + &s_943dc4625473b03f, + &s_c871d3cc252af657, +}; +static const uint16_t m_b99b2bc7a57e8128[] = {12, 13, 3, 15, 16, 11, 8, 22, 1, 2, 7, 20, 19, 18, 6, 14, 4, 0, 17, 10, 5, 9, 21}; +static const uint16_t i_b99b2bc7a57e8128[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22}; +const ::capnp::_::RawSchema s_b99b2bc7a57e8128 = { + 0xb99b2bc7a57e8128, b_b99b2bc7a57e8128.words, 406, d_b99b2bc7a57e8128, m_b99b2bc7a57e8128, + 2, 23, i_b99b2bc7a57e8128, nullptr, nullptr, { &s_b99b2bc7a57e8128, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<159> b_943dc4625473b03f = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 63, 176, 115, 84, 98, 196, 61, 148, + 30, 0, 0, 0, 1, 0, 3, 0, + 40, 129, 126, 165, 199, 43, 155, 185, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 58, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 199, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 76, 105, 118, + 101, 76, 111, 99, 97, 116, 105, 111, + 110, 68, 97, 116, 97, 46, 65, 99, + 99, 117, 114, 97, 99, 121, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 32, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 0, 0, 0, 3, 0, 1, 0, + 236, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 0, 0, 0, 3, 0, 1, 0, + 4, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 3, 0, 1, 0, + 12, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 1, 0, 0, 3, 0, 1, 0, + 20, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 1, 0, 0, 3, 0, 1, 0, + 28, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 1, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 1, 0, 0, 3, 0, 1, 0, + 40, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 1, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 1, 0, 0, 3, 0, 1, 0, + 52, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 1, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 1, 0, 0, 3, 0, 1, 0, + 68, 1, 0, 0, 2, 0, 1, 0, + 112, 78, 69, 68, 69, 114, 114, 111, + 114, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 78, 69, 68, 69, 114, 114, 111, + 114, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 108, 108, 69, 114, 114, 111, + 114, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 105, 116, 99, 104, 69, 114, 114, + 111, 114, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 101, 97, 100, 105, 110, 103, 69, + 114, 114, 111, 114, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 108, 108, 105, 112, 115, 111, 105, + 100, 83, 101, 109, 105, 77, 97, 106, + 111, 114, 69, 114, 114, 111, 114, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 108, 108, 105, 112, 115, 111, 105, + 100, 83, 101, 109, 105, 77, 105, 110, + 111, 114, 69, 114, 114, 111, 114, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 108, 108, 105, 112, 115, 111, 105, + 100, 79, 114, 105, 101, 110, 116, 97, + 116, 105, 111, 110, 69, 114, 114, 111, + 114, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_943dc4625473b03f = b_943dc4625473b03f.words; +#if !CAPNP_LITE +static const uint16_t m_943dc4625473b03f[] = {7, 5, 6, 4, 0, 3, 2, 1}; +static const uint16_t i_943dc4625473b03f[] = {0, 1, 2, 3, 4, 5, 6, 7}; +const ::capnp::_::RawSchema s_943dc4625473b03f = { + 0x943dc4625473b03f, b_943dc4625473b03f.words, 159, nullptr, m_943dc4625473b03f, + 0, 8, i_943dc4625473b03f, nullptr, nullptr, { &s_943dc4625473b03f, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<41> b_c871d3cc252af657 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 87, 246, 42, 37, 204, 211, 113, 200, + 30, 0, 0, 0, 2, 0, 0, 0, + 40, 129, 126, 165, 199, 43, 155, 185, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 90, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 127, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 76, 105, 118, + 101, 76, 111, 99, 97, 116, 105, 111, + 110, 68, 97, 116, 97, 46, 83, 101, + 110, 115, 111, 114, 83, 111, 117, 114, + 99, 101, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 112, 112, 108, 97, 110, 105, 120, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 97, 108, 109, 97, 110, 0, 0, + 111, 114, 98, 115, 108, 97, 109, 0, + 116, 105, 109, 105, 110, 103, 0, 0, + 100, 117, 109, 109, 121, 0, 0, 0, } +}; +::capnp::word const* const bp_c871d3cc252af657 = b_c871d3cc252af657.words; +#if !CAPNP_LITE +static const uint16_t m_c871d3cc252af657[] = {0, 4, 1, 2, 3}; +const ::capnp::_::RawSchema s_c871d3cc252af657 = { + 0xc871d3cc252af657, b_c871d3cc252af657.words, 41, nullptr, m_c871d3cc252af657, + 0, 5, nullptr, nullptr, nullptr, { &s_c871d3cc252af657, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(SensorSource_c871d3cc252af657, c871d3cc252af657); +static const ::capnp::_::AlignedData<118> b_d7700859ed1f5b76 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 118, 91, 31, 237, 89, 8, 112, 215, + 13, 0, 0, 0, 1, 0, 4, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 202, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 87, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 79, 114, 98, + 79, 100, 111, 109, 101, 116, 114, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 24, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 3, 0, 1, 0, + 172, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 0, 0, 0, 3, 0, 1, 0, + 192, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 0, 0, 0, 3, 0, 1, 0, + 196, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 3, 0, 1, 0, + 200, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 0, 0, 0, 3, 0, 1, 0, + 220, 0, 0, 0, 2, 0, 1, 0, + 115, 116, 97, 114, 116, 77, 111, 110, + 111, 84, 105, 109, 101, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 100, 77, 111, 110, 111, 84, + 105, 109, 101, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 114, 114, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 108, 105, 101, 114, 115, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 116, 99, 104, 101, 115, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d7700859ed1f5b76 = b_d7700859ed1f5b76.words; +#if !CAPNP_LITE +static const uint16_t m_d7700859ed1f5b76[] = {1, 3, 2, 4, 5, 0}; +static const uint16_t i_d7700859ed1f5b76[] = {0, 1, 2, 3, 4, 5}; +const ::capnp::_::RawSchema s_d7700859ed1f5b76 = { + 0xd7700859ed1f5b76, b_d7700859ed1f5b76.words, 118, nullptr, m_d7700859ed1f5b76, + 0, 6, i_d7700859ed1f5b76, nullptr, nullptr, { &s_d7700859ed1f5b76, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<143> b_cd60164a8a0159ef = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 239, 89, 1, 138, 74, 22, 96, 205, + 13, 0, 0, 0, 1, 0, 2, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 5, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 202, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 143, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 79, 114, 98, + 70, 101, 97, 116, 117, 114, 101, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 0, 0, 0, 3, 0, 1, 0, + 192, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 0, 0, 0, 3, 0, 1, 0, + 212, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 232, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 0, 0, 0, 3, 0, 1, 0, + 240, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 0, 0, 0, 3, 0, 1, 0, + 4, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 1, 0, 0, 3, 0, 1, 0, + 16, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 1, 0, 0, 3, 0, 1, 0, + 36, 1, 0, 0, 2, 0, 1, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 69, 111, 102, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 115, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 115, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 115, 99, 114, 105, 112, 116, + 111, 114, 115, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 99, 116, 97, 118, 101, 115, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 76, 97, 115, 116, 69, 111, 102, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 116, 99, 104, 101, 115, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_cd60164a8a0159ef = b_cd60164a8a0159ef.words; +#if !CAPNP_LITE +static const uint16_t m_cd60164a8a0159ef[] = {3, 6, 4, 0, 5, 1, 2}; +static const uint16_t i_cd60164a8a0159ef[] = {0, 1, 2, 3, 4, 5, 6}; +const ::capnp::_::RawSchema s_cd60164a8a0159ef = { + 0xcd60164a8a0159ef, b_cd60164a8a0159ef.words, 143, nullptr, m_cd60164a8a0159ef, + 0, 7, i_cd60164a8a0159ef, nullptr, nullptr, { &s_cd60164a8a0159ef, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<99> b_d500d30c5803fa4f = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 79, 250, 3, 88, 12, 211, 0, 213, + 13, 0, 0, 0, 1, 0, 4, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 2, 1, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 31, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 79, 114, 98, + 70, 101, 97, 116, 117, 114, 101, 115, + 83, 117, 109, 109, 97, 114, 121, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 3, 0, 1, 0, + 136, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 0, 0, 0, 3, 0, 1, 0, + 148, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 0, 0, 0, 3, 0, 1, 0, + 156, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 3, 0, 1, 0, + 172, 0, 0, 0, 2, 0, 1, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 69, 111, 102, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 76, 97, 115, 116, 69, 111, 102, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 101, 97, 116, 117, 114, 101, 67, + 111, 117, 110, 116, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 116, 99, 104, 67, 111, 117, + 110, 116, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 109, 112, 117, 116, 101, 78, + 115, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d500d30c5803fa4f = b_d500d30c5803fa4f.words; +#if !CAPNP_LITE +static const uint16_t m_d500d30c5803fa4f[] = {4, 2, 3, 0, 1}; +static const uint16_t i_d500d30c5803fa4f[] = {0, 1, 2, 3, 4}; +const ::capnp::_::RawSchema s_d500d30c5803fa4f = { + 0xd500d30c5803fa4f, b_d500d30c5803fa4f.words, 99, nullptr, m_d500d30c5803fa4f, + 0, 5, i_d500d30c5803fa4f, nullptr, nullptr, { &s_d500d30c5803fa4f, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<83> b_c8233c0345e27e24 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 36, 126, 226, 69, 3, 60, 35, 200, + 13, 0, 0, 0, 1, 0, 1, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 202, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 79, 114, 98, + 75, 101, 121, 70, 114, 97, 109, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 3, 0, 1, 0, + 104, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 3, 0, 1, 0, + 108, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 0, 0, 0, 3, 0, 1, 0, + 128, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 3, 0, 1, 0, + 136, 0, 0, 0, 2, 0, 1, 0, + 105, 100, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 71, 52, 152, 36, 213, 187, 91, 194, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 112, 111, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 71, 52, 152, 36, 213, 187, 91, 194, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 115, 99, 114, 105, 112, 116, + 111, 114, 115, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_c8233c0345e27e24 = b_c8233c0345e27e24.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_c8233c0345e27e24[] = { + &s_c25bbbd524983447, +}; +static const uint16_t m_c8233c0345e27e24[] = {3, 2, 0, 1}; +static const uint16_t i_c8233c0345e27e24[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_c8233c0345e27e24 = { + 0xc8233c0345e27e24, b_c8233c0345e27e24.words, 83, d_c8233c0345e27e24, m_c8233c0345e27e24, + 1, 4, i_c8233c0345e27e24, nullptr, nullptr, { &s_c8233c0345e27e24, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<95> b_92e21bb7ea38793a = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 58, 121, 56, 234, 183, 27, 226, 146, + 13, 0, 0, 0, 1, 0, 0, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 4, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 226, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 75, 97, 108, + 109, 97, 110, 79, 100, 111, 109, 101, + 116, 114, 121, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 3, 0, 1, 0, + 120, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 0, 0, 0, 3, 0, 1, 0, + 140, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 0, 0, 0, 3, 0, 1, 0, + 184, 0, 0, 0, 2, 0, 1, 0, + 116, 114, 97, 110, 115, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 116, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 114, 97, 110, 115, 83, 116, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 116, 83, 116, 100, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_92e21bb7ea38793a = b_92e21bb7ea38793a.words; +#if !CAPNP_LITE +static const uint16_t m_92e21bb7ea38793a[] = {1, 3, 0, 2}; +static const uint16_t i_92e21bb7ea38793a[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_92e21bb7ea38793a = { + 0x92e21bb7ea38793a, b_92e21bb7ea38793a.words, 95, nullptr, m_92e21bb7ea38793a, + 0, 4, i_92e21bb7ea38793a, nullptr, nullptr, { &s_92e21bb7ea38793a, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<92> b_9b326d4e436afec7 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 199, 254, 106, 67, 78, 109, 50, 155, + 13, 0, 0, 0, 1, 0, 2, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 226, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 79, 114, 98, + 79, 98, 115, 101, 114, 118, 97, 116, + 105, 111, 110, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 0, 0, 0, 3, 0, 1, 0, + 112, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 0, 0, 0, 3, 0, 1, 0, + 140, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 3, 0, 1, 0, + 172, 0, 0, 0, 2, 0, 1, 0, + 111, 98, 115, 101, 114, 118, 97, 116, + 105, 111, 110, 77, 111, 110, 111, 84, + 105, 109, 101, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 114, 109, 97, 108, 105, 122, + 101, 100, 67, 111, 111, 114, 100, 105, + 110, 97, 116, 101, 115, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 99, 97, 116, 105, 111, 110, + 69, 67, 69, 70, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 116, 99, 104, 68, 105, 115, + 116, 97, 110, 99, 101, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9b326d4e436afec7 = b_9b326d4e436afec7.words; +#if !CAPNP_LITE +static const uint16_t m_9b326d4e436afec7[] = {2, 3, 1, 0}; +static const uint16_t i_9b326d4e436afec7[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_9b326d4e436afec7 = { + 0x9b326d4e436afec7, b_9b326d4e436afec7.words, 92, nullptr, m_9b326d4e436afec7, + 0, 4, i_9b326d4e436afec7, nullptr, nullptr, { &s_9b326d4e436afec7, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<91> b_8fdfadb254ea867a = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 122, 134, 234, 84, 178, 173, 223, 143, + 13, 0, 0, 0, 1, 0, 1, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 10, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 67, 97, 108, + 105, 98, 114, 97, 116, 105, 111, 110, + 70, 101, 97, 116, 117, 114, 101, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 3, 0, 1, 0, + 104, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 3, 0, 1, 0, + 124, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 0, 0, 0, 3, 0, 1, 0, + 144, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 102, 114, 97, 109, 101, 73, 100, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 48, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 49, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 116, 117, 115, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_8fdfadb254ea867a = b_8fdfadb254ea867a.words; +#if !CAPNP_LITE +static const uint16_t m_8fdfadb254ea867a[] = {0, 1, 2, 3}; +static const uint16_t i_8fdfadb254ea867a[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_8fdfadb254ea867a = { + 0x8fdfadb254ea867a, b_8fdfadb254ea867a.words, 91, nullptr, m_8fdfadb254ea867a, + 0, 4, i_8fdfadb254ea867a, nullptr, nullptr, { &s_8fdfadb254ea867a, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<52> b_bd8822120928120c = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 12, 18, 40, 9, 18, 34, 136, 189, + 13, 0, 0, 0, 1, 0, 1, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 186, 0, 0, 0, + 29, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 78, 97, 118, + 83, 116, 97, 116, 117, 115, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 20, 120, 204, 202, 114, 214, 124, 206, + 1, 0, 0, 0, 66, 0, 0, 0, + 65, 100, 100, 114, 101, 115, 115, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 0, 0, 0, 3, 0, 1, 0, + 60, 0, 0, 0, 2, 0, 1, 0, + 105, 115, 78, 97, 118, 105, 103, 97, + 116, 105, 110, 103, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 114, 114, 101, 110, 116, 65, + 100, 100, 114, 101, 115, 115, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 20, 120, 204, 202, 114, 214, 124, 206, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_bd8822120928120c = b_bd8822120928120c.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_bd8822120928120c[] = { + &s_ce7cd672cacc7814, +}; +static const uint16_t m_bd8822120928120c[] = {1, 0}; +static const uint16_t i_bd8822120928120c[] = {0, 1}; +const ::capnp::_::RawSchema s_bd8822120928120c = { + 0xbd8822120928120c, b_bd8822120928120c.words, 52, d_bd8822120928120c, m_bd8822120928120c, + 1, 2, i_bd8822120928120c, nullptr, nullptr, { &s_bd8822120928120c, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<153> b_ce7cd672cacc7814 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 20, 120, 204, 202, 114, 214, 124, 206, + 23, 0, 0, 0, 1, 0, 2, 0, + 12, 18, 40, 9, 18, 34, 136, 189, + 7, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 255, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 78, 97, 118, + 83, 116, 97, 116, 117, 115, 46, 65, + 100, 100, 114, 101, 115, 115, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 36, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 0, 0, 0, 3, 0, 1, 0, + 244, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 0, 0, 0, 3, 0, 1, 0, + 248, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 0, 0, 0, 3, 0, 1, 0, + 252, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 0, 0, 0, 3, 0, 1, 0, + 0, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 0, 0, 0, 3, 0, 1, 0, + 4, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 0, 0, 0, 3, 0, 1, 0, + 8, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 3, 0, 1, 0, + 12, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 1, 0, 0, 3, 0, 1, 0, + 16, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 1, 0, 0, 3, 0, 1, 0, + 20, 1, 0, 0, 2, 0, 1, 0, + 116, 105, 116, 108, 101, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 116, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 110, 103, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 111, 117, 115, 101, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 100, 100, 114, 101, 115, 115, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 114, 101, 101, 116, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 105, 116, 121, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 116, 101, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 117, 110, 116, 114, 121, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_ce7cd672cacc7814 = b_ce7cd672cacc7814.words; +#if !CAPNP_LITE +static const uint16_t m_ce7cd672cacc7814[] = {4, 6, 8, 3, 1, 2, 7, 5, 0}; +static const uint16_t i_ce7cd672cacc7814[] = {0, 1, 2, 3, 4, 5, 6, 7, 8}; +const ::capnp::_::RawSchema s_ce7cd672cacc7814 = { + 0xce7cd672cacc7814, b_ce7cd672cacc7814.words, 153, nullptr, m_ce7cd672cacc7814, + 0, 9, i_ce7cd672cacc7814, nullptr, nullptr, { &s_ce7cd672cacc7814, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<75> b_db98be6565516acb = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 203, 106, 81, 101, 101, 190, 152, 219, + 13, 0, 0, 0, 1, 0, 1, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 186, 0, 0, 0, + 29, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 78, 97, 118, + 85, 112, 100, 97, 116, 101, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 155, 187, 173, 124, 24, 249, 174, 158, + 9, 0, 0, 0, 58, 0, 0, 0, + 63, 218, 215, 196, 79, 155, 179, 165, + 5, 0, 0, 0, 66, 0, 0, 0, + 76, 97, 116, 76, 110, 103, 0, 0, + 83, 101, 103, 109, 101, 110, 116, 0, + 12, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 0, 0, 3, 0, 1, 0, + 80, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 0, 0, 0, 3, 0, 1, 0, + 88, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 0, 0, 0, 3, 0, 1, 0, + 112, 0, 0, 0, 2, 0, 1, 0, + 105, 115, 78, 97, 118, 105, 103, 97, + 116, 105, 110, 103, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 114, 83, 101, 103, 109, 101, + 110, 116, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 103, 109, 101, 110, 116, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 63, 218, 215, 196, 79, 155, 179, 165, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_db98be6565516acb = b_db98be6565516acb.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_db98be6565516acb[] = { + &s_a5b39b4fc4d7da3f, +}; +static const uint16_t m_db98be6565516acb[] = {1, 0, 2}; +static const uint16_t i_db98be6565516acb[] = {0, 1, 2}; +const ::capnp::_::RawSchema s_db98be6565516acb = { + 0xdb98be6565516acb, b_db98be6565516acb.words, 75, d_db98be6565516acb, m_db98be6565516acb, + 1, 3, i_db98be6565516acb, nullptr, nullptr, { &s_db98be6565516acb, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<48> b_9eaef9187cadbb9b = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 155, 187, 173, 124, 24, 249, 174, 158, + 23, 0, 0, 0, 1, 0, 2, 0, + 203, 106, 81, 101, 101, 190, 152, 219, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 242, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 78, 97, 118, + 85, 112, 100, 97, 116, 101, 46, 76, + 97, 116, 76, 110, 103, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 1, 0, + 48, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 108, 97, 116, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 110, 103, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9eaef9187cadbb9b = b_9eaef9187cadbb9b.words; +#if !CAPNP_LITE +static const uint16_t m_9eaef9187cadbb9b[] = {0, 1}; +static const uint16_t i_9eaef9187cadbb9b[] = {0, 1}; +const ::capnp::_::RawSchema s_9eaef9187cadbb9b = { + 0x9eaef9187cadbb9b, b_9eaef9187cadbb9b.words, 48, nullptr, m_9eaef9187cadbb9b, + 0, 2, i_9eaef9187cadbb9b, nullptr, nullptr, { &s_9eaef9187cadbb9b, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<150> b_a5b39b4fc4d7da3f = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 63, 218, 215, 196, 79, 155, 179, 165, + 23, 0, 0, 0, 1, 0, 3, 0, + 203, 106, 81, 101, 101, 190, 152, 219, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 199, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 78, 97, 118, + 85, 112, 100, 97, 116, 101, 46, 83, + 101, 103, 109, 101, 110, 116, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 111, 36, 81, 116, 99, 122, 65, 197, + 1, 0, 0, 0, 98, 0, 0, 0, + 73, 110, 115, 116, 114, 117, 99, 116, + 105, 111, 110, 0, 0, 0, 0, 0, + 32, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 216, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 0, 0, 0, 3, 0, 1, 0, + 220, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 0, 0, 0, 3, 0, 1, 0, + 228, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 0, 0, 0, 3, 0, 1, 0, + 236, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 0, 0, 0, 3, 0, 1, 0, + 244, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 0, 0, 0, 3, 0, 1, 0, + 248, 0, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 0, 0, 0, 3, 0, 1, 0, + 0, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 0, 0, 0, 3, 0, 1, 0, + 20, 1, 0, 0, 2, 0, 1, 0, + 102, 114, 111, 109, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 155, 187, 173, 124, 24, 249, 174, 158, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 111, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 155, 187, 173, 124, 24, 249, 174, 158, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 112, 100, 97, 116, 101, 84, 105, + 109, 101, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 115, 116, 97, 110, 99, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 114, 111, 115, 115, 84, 105, 109, + 101, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 120, 105, 116, 78, 111, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 115, 116, 114, 117, 99, 116, + 105, 111, 110, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 111, 36, 81, 116, 99, 122, 65, 197, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 114, 116, 115, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 155, 187, 173, 124, 24, 249, 174, 158, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a5b39b4fc4d7da3f = b_a5b39b4fc4d7da3f.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_a5b39b4fc4d7da3f[] = { + &s_9eaef9187cadbb9b, + &s_c5417a637451246f, +}; +static const uint16_t m_a5b39b4fc4d7da3f[] = {4, 3, 5, 0, 6, 7, 1, 2}; +static const uint16_t i_a5b39b4fc4d7da3f[] = {0, 1, 2, 3, 4, 5, 6, 7}; +const ::capnp::_::RawSchema s_a5b39b4fc4d7da3f = { + 0xa5b39b4fc4d7da3f, b_a5b39b4fc4d7da3f.words, 150, d_a5b39b4fc4d7da3f, m_a5b39b4fc4d7da3f, + 2, 8, i_a5b39b4fc4d7da3f, nullptr, nullptr, { &s_a5b39b4fc4d7da3f, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<117> b_c5417a637451246f = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 111, 36, 81, 116, 99, 122, 65, 197, + 31, 0, 0, 0, 2, 0, 0, 0, + 63, 218, 215, 196, 79, 155, 179, 165, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 90, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 231, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 78, 97, 118, + 85, 112, 100, 97, 116, 101, 46, 83, + 101, 103, 109, 101, 110, 116, 46, 73, + 110, 115, 116, 114, 117, 99, 116, 105, + 111, 110, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 80, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 229, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 225, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 221, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 217, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 213, 0, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 213, 0, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 201, 0, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 201, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 193, 0, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 193, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 185, 0, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 173, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 165, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 157, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 19, 0, 0, 0, 0, 0, 0, 0, + 149, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 117, 114, 110, 76, 101, 102, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 117, 114, 110, 82, 105, 103, 104, + 116, 0, 0, 0, 0, 0, 0, 0, + 107, 101, 101, 112, 76, 101, 102, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 101, 101, 112, 82, 105, 103, 104, + 116, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 114, 97, 105, 103, 104, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 117, 110, 100, 97, 98, 111, + 117, 116, 69, 120, 105, 116, 78, 117, + 109, 98, 101, 114, 0, 0, 0, 0, + 114, 111, 117, 110, 100, 97, 98, 111, + 117, 116, 69, 120, 105, 116, 0, 0, + 114, 111, 117, 110, 100, 97, 98, 111, + 117, 116, 84, 117, 114, 110, 76, 101, + 102, 116, 0, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 56, 0, 0, 0, + 114, 111, 117, 110, 100, 97, 98, 111, + 117, 116, 83, 116, 114, 97, 105, 103, + 104, 116, 0, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 49, 48, 0, 0, + 114, 111, 117, 110, 100, 97, 98, 111, + 117, 116, 84, 117, 114, 110, 82, 105, + 103, 104, 116, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 49, 50, 0, 0, + 114, 111, 117, 110, 100, 97, 98, 111, + 117, 116, 85, 116, 117, 114, 110, 0, + 117, 110, 107, 110, 49, 52, 0, 0, + 97, 114, 114, 105, 118, 101, 0, 0, + 101, 120, 105, 116, 76, 101, 102, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 120, 105, 116, 82, 105, 103, 104, + 116, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 49, 56, 0, 0, + 117, 116, 117, 114, 110, 0, 0, 0, } +}; +::capnp::word const* const bp_c5417a637451246f = b_c5417a637451246f.words; +#if !CAPNP_LITE +static const uint16_t m_c5417a637451246f[] = {15, 16, 17, 2, 3, 6, 5, 9, 7, 11, 13, 4, 0, 1, 10, 12, 14, 18, 8, 19}; +const ::capnp::_::RawSchema s_c5417a637451246f = { + 0xc5417a637451246f, b_c5417a637451246f.words, 117, nullptr, m_c5417a637451246f, + 0, 20, nullptr, nullptr, nullptr, { &s_c5417a637451246f, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(Instruction_c5417a637451246f, c5417a637451246f); +static const ::capnp::_::AlignedData<86> b_acfa74a094e62626 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 38, 38, 230, 148, 160, 116, 250, 172, + 13, 0, 0, 0, 1, 0, 2, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 210, 0, 0, 0, + 33, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 84, 114, 97, + 102, 102, 105, 99, 69, 118, 101, 110, + 116, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 75, 191, 53, 52, 37, 117, 93, 216, + 9, 0, 0, 0, 42, 0, 0, 0, + 73, 203, 92, 22, 114, 206, 246, 166, + 5, 0, 0, 0, 58, 0, 0, 0, + 84, 121, 112, 101, 0, 0, 0, 0, + 65, 99, 116, 105, 111, 110, 0, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 3, 0, 1, 0, + 104, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 0, 0, 0, 3, 0, 1, 0, + 112, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 0, 0, 0, 3, 0, 1, 0, + 116, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 64, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 0, 0, 0, 3, 0, 1, 0, + 124, 0, 0, 0, 2, 0, 1, 0, + 116, 121, 112, 101, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 75, 191, 53, 52, 37, 117, 93, 216, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 115, 116, 97, 110, 99, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 116, 105, 111, 110, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 73, 203, 92, 22, 114, 206, 246, 166, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 115, 117, 109, 105, 110, 103, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_acfa74a094e62626 = b_acfa74a094e62626.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_acfa74a094e62626[] = { + &s_a6f6ce72165ccb49, + &s_d85d75253435bf4b, +}; +static const uint16_t m_acfa74a094e62626[] = {2, 1, 3, 0}; +static const uint16_t i_acfa74a094e62626[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_acfa74a094e62626 = { + 0xacfa74a094e62626, b_acfa74a094e62626.words, 86, d_acfa74a094e62626, m_acfa74a094e62626, + 2, 4, i_acfa74a094e62626, nullptr, nullptr, { &s_acfa74a094e62626, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<43> b_d85d75253435bf4b = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 75, 191, 53, 52, 37, 117, 93, 216, + 26, 0, 0, 0, 2, 0, 0, 0, + 38, 38, 230, 148, 160, 116, 250, 172, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 127, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 84, 114, 97, + 102, 102, 105, 99, 69, 118, 101, 110, + 116, 46, 84, 121, 112, 101, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 111, 112, 83, 105, 103, 110, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 103, 104, 116, 82, 101, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 103, 104, 116, 89, 101, 108, + 108, 111, 119, 0, 0, 0, 0, 0, + 108, 105, 103, 104, 116, 71, 114, 101, + 101, 110, 0, 0, 0, 0, 0, 0, + 115, 116, 111, 112, 76, 105, 103, 104, + 116, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d85d75253435bf4b = b_d85d75253435bf4b.words; +#if !CAPNP_LITE +static const uint16_t m_d85d75253435bf4b[] = {3, 1, 2, 4, 0}; +const ::capnp::_::RawSchema s_d85d75253435bf4b = { + 0xd85d75253435bf4b, b_d85d75253435bf4b.words, 43, nullptr, m_d85d75253435bf4b, + 0, 5, nullptr, nullptr, nullptr, { &s_d85d75253435bf4b, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(Type_d85d75253435bf4b, d85d75253435bf4b); +static const ::capnp::_::AlignedData<36> b_a6f6ce72165ccb49 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 73, 203, 92, 22, 114, 206, 246, 166, + 26, 0, 0, 0, 2, 0, 0, 0, + 38, 38, 230, 148, 160, 116, 250, 172, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 10, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 103, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 84, 114, 97, + 102, 102, 105, 99, 69, 118, 101, 110, + 116, 46, 65, 99, 116, 105, 111, 110, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 110, 101, 0, 0, 0, 0, + 121, 105, 101, 108, 100, 0, 0, 0, + 115, 116, 111, 112, 0, 0, 0, 0, + 114, 101, 115, 117, 109, 101, 82, 101, + 97, 100, 121, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a6f6ce72165ccb49 = b_a6f6ce72165ccb49.words; +#if !CAPNP_LITE +static const uint16_t m_a6f6ce72165ccb49[] = {0, 3, 2, 1}; +const ::capnp::_::RawSchema s_a6f6ce72165ccb49 = { + 0xa6f6ce72165ccb49, b_a6f6ce72165ccb49.words, 36, nullptr, m_a6f6ce72165ccb49, + 0, 4, nullptr, nullptr, nullptr, { &s_a6f6ce72165ccb49, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(Action_a6f6ce72165ccb49, a6f6ce72165ccb49); +static const ::capnp::_::AlignedData<60> b_dfdf30d03fc485bd = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 189, 133, 196, 63, 208, 48, 223, 223, + 13, 0, 0, 0, 1, 0, 1, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 1, 0, 7, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 202, 0, 0, 0, + 33, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 65, 110, 100, + 114, 111, 105, 100, 71, 110, 115, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 205, 214, 40, 244, 212, 16, 7, 162, + 9, 0, 0, 0, 106, 0, 0, 0, + 78, 253, 149, 48, 8, 123, 81, 226, + 9, 0, 0, 0, 146, 0, 0, 0, + 77, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 115, 0, 0, 0, 0, + 78, 97, 118, 105, 103, 97, 116, 105, + 111, 110, 77, 101, 115, 115, 97, 103, + 101, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 255, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 254, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 0, 0, 0, 3, 0, 1, 0, + 64, 0, 0, 0, 2, 0, 1, 0, + 109, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 115, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 205, 214, 40, 244, 212, 16, 7, 162, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 97, 118, 105, 103, 97, 116, 105, + 111, 110, 77, 101, 115, 115, 97, 103, + 101, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 78, 253, 149, 48, 8, 123, 81, 226, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_dfdf30d03fc485bd = b_dfdf30d03fc485bd.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_dfdf30d03fc485bd[] = { + &s_a20710d4f428d6cd, + &s_e2517b083095fd4e, +}; +static const uint16_t m_dfdf30d03fc485bd[] = {0, 1}; +static const uint16_t i_dfdf30d03fc485bd[] = {0, 1}; +const ::capnp::_::RawSchema s_dfdf30d03fc485bd = { + 0xdfdf30d03fc485bd, b_dfdf30d03fc485bd.words, 60, d_dfdf30d03fc485bd, m_dfdf30d03fc485bd, + 2, 2, i_dfdf30d03fc485bd, nullptr, nullptr, { &s_dfdf30d03fc485bd, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<61> b_a20710d4f428d6cd = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 205, 214, 40, 244, 212, 16, 7, 162, + 25, 0, 0, 0, 1, 0, 0, 0, + 189, 133, 196, 63, 208, 48, 223, 223, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 50, 1, 0, 0, + 37, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 65, 110, 100, + 114, 111, 105, 100, 71, 110, 115, 115, + 46, 77, 101, 97, 115, 117, 114, 101, + 109, 101, 110, 116, 115, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 80, 244, 56, 58, 69, 123, 226, 160, + 9, 0, 0, 0, 50, 0, 0, 0, + 77, 97, 119, 125, 113, 191, 73, 217, + 5, 0, 0, 0, 98, 0, 0, 0, + 67, 108, 111, 99, 107, 0, 0, 0, + 77, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 1, 0, + 48, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 0, 0, 0, 3, 0, 1, 0, + 72, 0, 0, 0, 2, 0, 1, 0, + 99, 108, 111, 99, 107, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 80, 244, 56, 58, 69, 123, 226, 160, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 77, 97, 119, 125, 113, 191, 73, 217, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a20710d4f428d6cd = b_a20710d4f428d6cd.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_a20710d4f428d6cd[] = { + &s_a0e27b453a38f450, + &s_d949bf717d77614d, +}; +static const uint16_t m_a20710d4f428d6cd[] = {0, 1}; +static const uint16_t i_a20710d4f428d6cd[] = {0, 1}; +const ::capnp::_::RawSchema s_a20710d4f428d6cd = { + 0xa20710d4f428d6cd, b_a20710d4f428d6cd.words, 61, d_a20710d4f428d6cd, m_a20710d4f428d6cd, + 2, 2, i_a20710d4f428d6cd, nullptr, nullptr, { &s_a20710d4f428d6cd, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<290> b_a0e27b453a38f450 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 80, 244, 56, 58, 69, 123, 226, 160, + 38, 0, 0, 0, 1, 0, 9, 0, + 205, 214, 40, 244, 212, 16, 7, 162, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 98, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 135, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 65, 110, 100, + 114, 111, 105, 100, 71, 110, 115, 115, + 46, 77, 101, 97, 115, 117, 114, 101, + 109, 101, 110, 116, 115, 46, 67, 108, + 111, 99, 107, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 64, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 1, 0, 0, 3, 0, 1, 0, + 188, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 1, 0, 0, 2, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 1, 0, 0, 3, 0, 1, 0, + 204, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 96, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 1, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 1, 0, 0, 3, 0, 1, 0, + 216, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 1, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 1, 0, 0, 3, 0, 1, 0, + 228, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 97, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 1, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 1, 0, 0, 3, 0, 1, 0, + 236, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 1, 0, 0, 3, 0, 1, 0, + 244, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 1, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 1, 0, 0, 3, 0, 1, 0, + 0, 2, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 1, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 1, 0, 0, 3, 0, 1, 0, + 8, 2, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 99, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 2, 0, 0, 3, 0, 1, 0, + 16, 2, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 2, 0, 0, 3, 0, 1, 0, + 24, 2, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 100, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 2, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 2, 0, 0, 3, 0, 1, 0, + 36, 2, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 2, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 2, 0, 0, 3, 0, 1, 0, + 48, 2, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 101, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 2, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 2, 0, 0, 3, 0, 1, 0, + 60, 2, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 2, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 2, 0, 0, 3, 0, 1, 0, + 72, 2, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 102, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 2, 0, 0, 18, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 2, 0, 0, 3, 0, 1, 0, + 92, 2, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 2, 0, 0, 250, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 2, 0, 0, 3, 0, 1, 0, + 108, 2, 0, 0, 2, 0, 1, 0, + 116, 105, 109, 101, 78, 97, 110, 111, + 115, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 114, 100, 119, 97, 114, 101, + 67, 108, 111, 99, 107, 68, 105, 115, + 99, 111, 110, 116, 105, 110, 117, 105, + 116, 121, 67, 111, 117, 110, 116, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 84, 105, 109, 101, 85, + 110, 99, 101, 114, 116, 97, 105, 110, + 116, 121, 78, 97, 110, 111, 115, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 85, 110, 99, 101, + 114, 116, 97, 105, 110, 116, 121, 78, + 97, 110, 111, 115, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 76, 101, 97, 112, 83, + 101, 99, 111, 110, 100, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 97, 112, 83, 101, 99, 111, + 110, 100, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 70, 117, 108, 108, 66, + 105, 97, 115, 78, 97, 110, 111, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 117, 108, 108, 66, 105, 97, 115, + 78, 97, 110, 111, 115, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 66, 105, 97, 115, 78, + 97, 110, 111, 115, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 105, 97, 115, 78, 97, 110, 111, + 115, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 66, 105, 97, 115, 85, + 110, 99, 101, 114, 116, 97, 105, 110, + 116, 121, 78, 97, 110, 111, 115, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 105, 97, 115, 85, 110, 99, 101, + 114, 116, 97, 105, 110, 116, 121, 78, + 97, 110, 111, 115, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 68, 114, 105, 102, 116, + 78, 97, 110, 111, 115, 80, 101, 114, + 83, 101, 99, 111, 110, 100, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 114, 105, 102, 116, 78, 97, 110, + 111, 115, 80, 101, 114, 83, 101, 99, + 111, 110, 100, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 68, 114, 105, 102, 116, + 85, 110, 99, 101, 114, 116, 97, 105, + 110, 116, 121, 78, 97, 110, 111, 115, + 80, 101, 114, 83, 101, 99, 111, 110, + 100, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 114, 105, 102, 116, 85, 110, 99, + 101, 114, 116, 97, 105, 110, 116, 121, + 78, 97, 110, 111, 115, 80, 101, 114, + 83, 101, 99, 111, 110, 100, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a0e27b453a38f450 = b_a0e27b453a38f450.words; +#if !CAPNP_LITE +static const uint16_t m_a0e27b453a38f450[] = {9, 11, 13, 15, 7, 1, 8, 10, 12, 14, 6, 4, 2, 5, 0, 3}; +static const uint16_t i_a0e27b453a38f450[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; +const ::capnp::_::RawSchema s_a0e27b453a38f450 = { + 0xa0e27b453a38f450, b_a0e27b453a38f450.words, 290, nullptr, m_a0e27b453a38f450, + 0, 16, i_a0e27b453a38f450, nullptr, nullptr, { &s_a0e27b453a38f450, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<420> b_d949bf717d77614d = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 77, 97, 119, 125, 113, 191, 73, 217, + 38, 0, 0, 0, 1, 0, 15, 0, + 205, 214, 40, 244, 212, 16, 7, 162, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 146, 1, 0, 0, + 45, 0, 0, 0, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 0, 0, 0, 15, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 65, 110, 100, + 114, 111, 105, 100, 71, 110, 115, 115, + 46, 77, 101, 97, 115, 117, 114, 101, + 109, 101, 110, 116, 115, 46, 77, 101, + 97, 115, 117, 114, 101, 109, 101, 110, + 116, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 1, 0, 1, 0, + 251, 95, 235, 13, 255, 243, 241, 158, + 17, 0, 0, 0, 114, 0, 0, 0, + 114, 45, 225, 220, 10, 73, 185, 203, + 17, 0, 0, 0, 50, 0, 0, 0, + 168, 202, 212, 49, 98, 123, 78, 192, + 13, 0, 0, 0, 154, 0, 0, 0, + 67, 111, 110, 115, 116, 101, 108, 108, + 97, 116, 105, 111, 110, 0, 0, 0, + 83, 116, 97, 116, 101, 0, 0, 0, + 77, 117, 108, 116, 105, 112, 97, 116, + 104, 73, 110, 100, 105, 99, 97, 116, + 111, 114, 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 2, 0, 0, 3, 0, 1, 0, + 124, 2, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 2, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 2, 0, 0, 3, 0, 1, 0, + 132, 2, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 2, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 2, 0, 0, 3, 0, 1, 0, + 140, 2, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 2, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 2, 0, 0, 3, 0, 1, 0, + 144, 2, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 2, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 2, 0, 0, 3, 0, 1, 0, + 156, 2, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 2, 0, 0, 250, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 2, 0, 0, 3, 0, 1, 0, + 172, 2, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 2, 0, 0, 3, 0, 1, 0, + 176, 2, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 2, 0, 0, 250, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 2, 0, 0, 3, 0, 1, 0, + 192, 2, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 2, 0, 0, 82, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 2, 0, 0, 3, 0, 1, 0, + 216, 2, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 2, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 2, 0, 0, 3, 0, 1, 0, + 232, 2, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 2, 0, 0, 226, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 2, 0, 0, 3, 0, 1, 0, + 248, 2, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 2, 0, 0, 58, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 3, 0, 1, 0, + 12, 3, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 48, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 3, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 3, 0, 0, 3, 0, 1, 0, + 24, 3, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 20, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 3, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 3, 0, 0, 3, 0, 1, 0, + 36, 3, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 49, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 3, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 3, 0, 0, 3, 0, 1, 0, + 48, 3, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 3, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 3, 0, 0, 3, 0, 1, 0, + 56, 3, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 3, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 3, 0, 0, 3, 0, 1, 0, + 64, 3, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 3, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 3, 0, 0, 3, 0, 1, 0, + 72, 3, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 51, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 3, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 3, 0, 0, 3, 0, 1, 0, + 88, 3, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 3, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 3, 0, 0, 3, 0, 1, 0, + 100, 3, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 52, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 3, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 3, 0, 0, 3, 0, 1, 0, + 108, 3, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 3, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 3, 0, 0, 3, 0, 1, 0, + 112, 3, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 3, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 3, 0, 0, 3, 0, 1, 0, + 124, 3, 0, 0, 2, 0, 1, 0, + 115, 118, 73, 100, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 110, 115, 116, 101, 108, 108, + 97, 116, 105, 111, 110, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 251, 95, 235, 13, 255, 243, 241, 158, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 79, 102, 102, 115, + 101, 116, 78, 97, 110, 111, 115, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 116, 101, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 99, 101, 105, 118, 101, 100, + 83, 118, 84, 105, 109, 101, 78, 97, + 110, 111, 115, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 99, 101, 105, 118, 101, 100, + 83, 118, 84, 105, 109, 101, 85, 110, + 99, 101, 114, 116, 97, 105, 110, 116, + 121, 78, 97, 110, 111, 115, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 110, 48, 68, 98, 72, 122, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 115, 101, 117, 100, 111, 114, 97, + 110, 103, 101, 82, 97, 116, 101, 77, + 101, 116, 101, 114, 115, 80, 101, 114, + 83, 101, 99, 111, 110, 100, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 115, 101, 117, 100, 111, 114, 97, + 110, 103, 101, 82, 97, 116, 101, 85, + 110, 99, 101, 114, 116, 97, 105, 110, + 116, 121, 77, 101, 116, 101, 114, 115, + 80, 101, 114, 83, 101, 99, 111, 110, + 100, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 117, 109, 117, 108, 97, + 116, 101, 100, 68, 101, 108, 116, 97, + 82, 97, 110, 103, 101, 83, 116, 97, + 116, 101, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 117, 109, 117, 108, 97, + 116, 101, 100, 68, 101, 108, 116, 97, + 82, 97, 110, 103, 101, 77, 101, 116, + 101, 114, 115, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 117, 109, 117, 108, 97, + 116, 101, 100, 68, 101, 108, 116, 97, + 82, 97, 110, 103, 101, 85, 110, 99, + 101, 114, 116, 97, 105, 110, 116, 121, + 77, 101, 116, 101, 114, 115, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 67, 97, 114, 114, 105, + 101, 114, 70, 114, 101, 113, 117, 101, + 110, 99, 121, 72, 122, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 114, 105, 101, 114, 70, + 114, 101, 113, 117, 101, 110, 99, 121, + 72, 122, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 67, 97, 114, 114, 105, + 101, 114, 67, 121, 99, 108, 101, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 114, 105, 101, 114, 67, + 121, 99, 108, 101, 115, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 67, 97, 114, 114, 105, + 101, 114, 80, 104, 97, 115, 101, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 114, 105, 101, 114, 80, + 104, 97, 115, 101, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 67, 97, 114, 114, 105, + 101, 114, 80, 104, 97, 115, 101, 85, + 110, 99, 101, 114, 116, 97, 105, 110, + 116, 121, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 114, 105, 101, 114, 80, + 104, 97, 115, 101, 85, 110, 99, 101, + 114, 116, 97, 105, 110, 116, 121, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 83, 110, 114, 73, 110, + 68, 98, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 110, 114, 73, 110, 68, 98, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 117, 108, 116, 105, 112, 97, 116, + 104, 73, 110, 100, 105, 99, 97, 116, + 111, 114, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 168, 202, 212, 49, 98, 123, 78, 192, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d949bf717d77614d = b_d949bf717d77614d.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_d949bf717d77614d[] = { + &s_9ef1f3ff0deb5ffb, + &s_c04e7b6231d4caa8, +}; +static const uint16_t m_d949bf717d77614d[] = {10, 9, 11, 15, 13, 17, 19, 6, 1, 14, 12, 16, 18, 20, 22, 7, 8, 4, 5, 21, 3, 0, 2}; +static const uint16_t i_d949bf717d77614d[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22}; +const ::capnp::_::RawSchema s_d949bf717d77614d = { + 0xd949bf717d77614d, b_d949bf717d77614d.words, 420, d_d949bf717d77614d, m_d949bf717d77614d, + 2, 23, i_d949bf717d77614d, nullptr, nullptr, { &s_d949bf717d77614d, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<50> b_9ef1f3ff0deb5ffb = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 251, 95, 235, 13, 255, 243, 241, 158, + 50, 0, 0, 0, 2, 0, 0, 0, + 77, 97, 119, 125, 113, 191, 73, 217, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 2, 2, 0, 0, + 49, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 65, 110, 100, + 114, 111, 105, 100, 71, 110, 115, 115, + 46, 77, 101, 97, 115, 117, 114, 101, + 109, 101, 110, 116, 115, 46, 77, 101, + 97, 115, 117, 114, 101, 109, 101, 110, + 116, 46, 67, 111, 110, 115, 116, 101, + 108, 108, 97, 116, 105, 111, 110, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 111, 119, 110, 0, + 103, 112, 115, 0, 0, 0, 0, 0, + 115, 98, 97, 115, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 0, + 113, 122, 115, 115, 0, 0, 0, 0, + 98, 101, 105, 100, 111, 117, 0, 0, + 103, 97, 108, 105, 108, 101, 111, 0, } +}; +::capnp::word const* const bp_9ef1f3ff0deb5ffb = b_9ef1f3ff0deb5ffb.words; +#if !CAPNP_LITE +static const uint16_t m_9ef1f3ff0deb5ffb[] = {5, 6, 3, 1, 4, 2, 0}; +const ::capnp::_::RawSchema s_9ef1f3ff0deb5ffb = { + 0x9ef1f3ff0deb5ffb, b_9ef1f3ff0deb5ffb.words, 50, nullptr, m_9ef1f3ff0deb5ffb, + 0, 7, nullptr, nullptr, nullptr, { &s_9ef1f3ff0deb5ffb, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(Constellation_9ef1f3ff0deb5ffb, 9ef1f3ff0deb5ffb); +static const ::capnp::_::AlignedData<96> b_cbb9490adce12d72 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 114, 45, 225, 220, 10, 73, 185, 203, + 50, 0, 0, 0, 2, 0, 0, 0, + 77, 97, 119, 125, 113, 191, 73, 217, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 194, 1, 0, 0, + 45, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 111, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 65, 110, 100, + 114, 111, 105, 100, 71, 110, 115, 115, + 46, 77, 101, 97, 115, 117, 114, 101, + 109, 101, 110, 116, 115, 46, 77, 101, + 97, 115, 117, 114, 101, 109, 101, 110, + 116, 46, 83, 116, 97, 116, 101, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 60, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 165, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 149, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 145, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 141, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 137, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 133, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 129, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 117, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 111, 119, 110, 0, + 99, 111, 100, 101, 76, 111, 99, 107, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 105, 116, 83, 121, 110, 99, 0, + 115, 117, 98, 102, 114, 97, 109, 101, + 83, 121, 110, 99, 0, 0, 0, 0, + 116, 111, 119, 68, 101, 99, 111, 100, + 101, 100, 0, 0, 0, 0, 0, 0, + 109, 115, 101, 99, 65, 109, 98, 105, + 103, 117, 111, 117, 115, 0, 0, 0, + 115, 121, 109, 98, 111, 108, 83, 121, + 110, 99, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 83, 116, 114, 105, 110, + 103, 83, 121, 110, 99, 0, 0, 0, + 103, 108, 111, 84, 111, 100, 68, 101, + 99, 111, 100, 101, 100, 0, 0, 0, + 98, 100, 115, 68, 50, 66, 105, 116, + 83, 121, 110, 99, 0, 0, 0, 0, + 98, 100, 115, 68, 50, 83, 117, 98, + 102, 114, 97, 109, 101, 83, 121, 110, + 99, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 108, 69, 49, 98, 99, 67, + 111, 100, 101, 76, 111, 99, 107, 0, + 103, 97, 108, 69, 49, 99, 50, 110, + 100, 67, 111, 100, 101, 76, 111, 99, + 107, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 108, 69, 49, 98, 80, 97, + 103, 101, 83, 121, 110, 99, 0, 0, + 115, 98, 97, 115, 83, 121, 110, 99, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_cbb9490adce12d72 = b_cbb9490adce12d72.words; +#if !CAPNP_LITE +static const uint16_t m_cbb9490adce12d72[] = {9, 10, 2, 1, 13, 11, 12, 7, 8, 5, 14, 3, 6, 4, 0}; +const ::capnp::_::RawSchema s_cbb9490adce12d72 = { + 0xcbb9490adce12d72, b_cbb9490adce12d72.words, 96, nullptr, m_cbb9490adce12d72, + 0, 15, nullptr, nullptr, nullptr, { &s_cbb9490adce12d72, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(State_cbb9490adce12d72, cbb9490adce12d72); +static const ::capnp::_::AlignedData<37> b_c04e7b6231d4caa8 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 168, 202, 212, 49, 98, 123, 78, 192, + 50, 0, 0, 0, 2, 0, 0, 0, + 77, 97, 119, 125, 113, 191, 73, 217, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 42, 2, 0, 0, + 53, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 79, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 65, 110, 100, + 114, 111, 105, 100, 71, 110, 115, 115, + 46, 77, 101, 97, 115, 117, 114, 101, + 109, 101, 110, 116, 115, 46, 77, 101, + 97, 115, 117, 114, 101, 109, 101, 110, + 116, 46, 77, 117, 108, 116, 105, 112, + 97, 116, 104, 73, 110, 100, 105, 99, + 97, 116, 111, 114, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 111, 119, 110, 0, + 100, 101, 116, 101, 99, 116, 101, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 116, 68, 101, 116, 101, 99, + 116, 101, 100, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_c04e7b6231d4caa8 = b_c04e7b6231d4caa8.words; +#if !CAPNP_LITE +static const uint16_t m_c04e7b6231d4caa8[] = {1, 2, 0}; +const ::capnp::_::RawSchema s_c04e7b6231d4caa8 = { + 0xc04e7b6231d4caa8, b_c04e7b6231d4caa8.words, 37, nullptr, m_c04e7b6231d4caa8, + 0, 3, nullptr, nullptr, nullptr, { &s_c04e7b6231d4caa8, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(MultipathIndicator_c04e7b6231d4caa8, c04e7b6231d4caa8); +static const ::capnp::_::AlignedData<115> b_e2517b083095fd4e = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 78, 253, 149, 48, 8, 123, 81, 226, + 25, 0, 0, 0, 1, 0, 3, 0, + 189, 133, 196, 63, 208, 48, 223, 223, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 90, 1, 0, 0, + 41, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 87, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 65, 110, 100, + 114, 111, 105, 100, 71, 110, 115, 115, + 46, 78, 97, 118, 105, 103, 97, 116, + 105, 111, 110, 77, 101, 115, 115, 97, + 103, 101, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 111, 54, 53, 107, 153, 247, 31, 236, + 1, 0, 0, 0, 58, 0, 0, 0, + 83, 116, 97, 116, 117, 115, 0, 0, + 24, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 0, 0, 0, 3, 0, 1, 0, + 160, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 3, 0, 1, 0, + 172, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 0, 0, 0, 3, 0, 1, 0, + 180, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 0, 0, 0, 3, 0, 1, 0, + 184, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 3, 0, 1, 0, + 188, 0, 0, 0, 2, 0, 1, 0, + 116, 121, 112, 101, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 118, 73, 100, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 115, 115, 97, 103, 101, 73, + 100, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 117, 98, 109, 101, 115, 115, 97, + 103, 101, 73, 100, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 97, 116, 97, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 116, 117, 115, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 111, 54, 53, 107, 153, 247, 31, 236, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e2517b083095fd4e = b_e2517b083095fd4e.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_e2517b083095fd4e[] = { + &s_ec1ff7996b35366f, +}; +static const uint16_t m_e2517b083095fd4e[] = {4, 2, 5, 3, 1, 0}; +static const uint16_t i_e2517b083095fd4e[] = {0, 1, 2, 3, 4, 5}; +const ::capnp::_::RawSchema s_e2517b083095fd4e = { + 0xe2517b083095fd4e, b_e2517b083095fd4e.words, 115, d_e2517b083095fd4e, m_e2517b083095fd4e, + 1, 6, i_e2517b083095fd4e, nullptr, nullptr, { &s_e2517b083095fd4e, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<35> b_ec1ff7996b35366f = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 111, 54, 53, 107, 153, 247, 31, 236, + 43, 0, 0, 0, 2, 0, 0, 0, + 78, 253, 149, 48, 8, 123, 81, 226, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 146, 1, 0, 0, + 45, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 79, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 65, 110, 100, + 114, 111, 105, 100, 71, 110, 115, 115, + 46, 78, 97, 118, 105, 103, 97, 116, + 105, 111, 110, 77, 101, 115, 115, 97, + 103, 101, 46, 83, 116, 97, 116, 117, + 115, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 111, 119, 110, 0, + 112, 97, 114, 105, 116, 121, 80, 97, + 115, 115, 101, 100, 0, 0, 0, 0, + 112, 97, 114, 105, 116, 121, 82, 101, + 98, 117, 105, 108, 116, 0, 0, 0, } +}; +::capnp::word const* const bp_ec1ff7996b35366f = b_ec1ff7996b35366f.words; +#if !CAPNP_LITE +static const uint16_t m_ec1ff7996b35366f[] = {1, 2, 0}; +const ::capnp::_::RawSchema s_ec1ff7996b35366f = { + 0xec1ff7996b35366f, b_ec1ff7996b35366f.words, 35, nullptr, m_ec1ff7996b35366f, + 0, 3, nullptr, nullptr, nullptr, { &s_ec1ff7996b35366f, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(Status_ec1ff7996b35366f, ec1ff7996b35366f); +static const ::capnp::_::AlignedData<146> b_de94674b07ae51c1 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 193, 81, 174, 7, 75, 103, 148, 222, + 13, 0, 0, 0, 1, 0, 2, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 1, 0, 7, 0, 0, 0, 5, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 178, 0, 0, 0, + 29, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 0, 0, 0, 87, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 81, 99, 111, + 109, 71, 110, 115, 115, 0, 0, 0, + 28, 0, 0, 0, 1, 0, 1, 0, + 238, 167, 173, 250, 182, 18, 26, 215, + 49, 0, 0, 0, 146, 0, 0, 0, + 233, 131, 108, 13, 154, 130, 30, 232, + 53, 0, 0, 0, 154, 0, 0, 0, + 59, 232, 202, 27, 14, 1, 1, 229, + 57, 0, 0, 0, 146, 0, 0, 0, + 146, 134, 123, 107, 216, 215, 128, 245, + 61, 0, 0, 0, 146, 0, 0, 0, + 11, 79, 143, 221, 74, 94, 150, 202, + 65, 0, 0, 0, 98, 0, 0, 0, + 92, 199, 198, 69, 148, 195, 83, 128, + 65, 0, 0, 0, 162, 0, 0, 0, + 112, 50, 103, 26, 129, 128, 251, 177, + 69, 0, 0, 0, 122, 0, 0, 0, + 77, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 83, 111, 117, 114, 99, + 101, 0, 0, 0, 0, 0, 0, 0, + 83, 86, 79, 98, 115, 101, 114, 118, + 97, 116, 105, 111, 110, 83, 116, 97, + 116, 101, 0, 0, 0, 0, 0, 0, + 77, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 83, 116, 97, 116, 117, + 115, 0, 0, 0, 0, 0, 0, 0, + 77, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 82, 101, 112, 111, 114, + 116, 0, 0, 0, 0, 0, 0, 0, + 67, 108, 111, 99, 107, 82, 101, 112, + 111, 114, 116, 0, 0, 0, 0, 0, + 68, 114, 77, 101, 97, 115, 117, 114, + 101, 109, 101, 110, 116, 82, 101, 112, + 111, 114, 116, 0, 0, 0, 0, 0, + 68, 114, 83, 118, 80, 111, 108, 121, + 82, 101, 112, 111, 114, 116, 0, 0, + 24, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 0, 0, 0, 3, 0, 1, 0, + 160, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 255, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 0, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 3, 0, 1, 0, + 172, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 254, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 0, 0, 0, 3, 0, 1, 0, + 180, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 253, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 0, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 0, 0, 0, 3, 0, 1, 0, + 192, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 252, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 3, 0, 1, 0, + 200, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 251, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 0, 0, 0, 3, 0, 1, 0, + 204, 0, 0, 0, 2, 0, 1, 0, + 108, 111, 103, 84, 115, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 82, 101, 112, 111, 114, + 116, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 146, 134, 123, 107, 216, 215, 128, 245, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 108, 111, 99, 107, 82, 101, 112, + 111, 114, 116, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 11, 79, 143, 221, 74, 94, 150, 202, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 114, 77, 101, 97, 115, 117, 114, + 101, 109, 101, 110, 116, 82, 101, 112, + 111, 114, 116, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 92, 199, 198, 69, 148, 195, 83, 128, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 114, 83, 118, 80, 111, 108, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 112, 50, 103, 26, 129, 128, 251, 177, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 119, 76, 111, 103, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_de94674b07ae51c1 = b_de94674b07ae51c1.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_de94674b07ae51c1[] = { + &s_8053c39445c6c75c, + &s_b1fb80811a673270, + &s_ca965e4add8f4f0b, + &s_f580d7d86b7b8692, +}; +static const uint16_t m_de94674b07ae51c1[] = {2, 3, 4, 0, 1, 5}; +static const uint16_t i_de94674b07ae51c1[] = {1, 2, 3, 4, 5, 0}; +const ::capnp::_::RawSchema s_de94674b07ae51c1 = { + 0xde94674b07ae51c1, b_de94674b07ae51c1.words, 146, d_de94674b07ae51c1, m_de94674b07ae51c1, + 4, 6, i_de94674b07ae51c1, nullptr, nullptr, { &s_de94674b07ae51c1, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<31> b_d71a12b6faada7ee = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 238, 167, 173, 250, 182, 18, 26, 215, + 22, 0, 0, 0, 2, 0, 0, 0, + 193, 81, 174, 7, 75, 103, 148, 222, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 66, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 79, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 81, 99, 111, + 109, 71, 110, 115, 115, 46, 77, 101, + 97, 115, 117, 114, 101, 109, 101, 110, + 116, 83, 111, 117, 114, 99, 101, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 0, + 98, 101, 105, 100, 111, 117, 0, 0, } +}; +::capnp::word const* const bp_d71a12b6faada7ee = b_d71a12b6faada7ee.words; +#if !CAPNP_LITE +static const uint16_t m_d71a12b6faada7ee[] = {2, 1, 0}; +const ::capnp::_::RawSchema s_d71a12b6faada7ee = { + 0xd71a12b6faada7ee, b_d71a12b6faada7ee.words, 31, nullptr, m_d71a12b6faada7ee, + 0, 3, nullptr, nullptr, nullptr, { &s_d71a12b6faada7ee, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(MeasurementSource_d71a12b6faada7ee, d71a12b6faada7ee); +static const ::capnp::_::AlignedData<64> b_e81e829a0d6c83e9 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 233, 131, 108, 13, 154, 130, 30, 232, + 22, 0, 0, 0, 2, 0, 0, 0, + 193, 81, 174, 7, 75, 103, 148, 222, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 74, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 247, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 81, 99, 111, + 109, 71, 110, 115, 115, 46, 83, 86, + 79, 98, 115, 101, 114, 118, 97, 116, + 105, 111, 110, 83, 116, 97, 116, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 40, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 93, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 85, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 81, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 57, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 100, 108, 101, 0, 0, 0, 0, + 115, 101, 97, 114, 99, 104, 0, 0, + 115, 101, 97, 114, 99, 104, 86, 101, + 114, 105, 102, 121, 0, 0, 0, 0, + 98, 105, 116, 69, 100, 103, 101, 0, + 116, 114, 97, 99, 107, 86, 101, 114, + 105, 102, 121, 0, 0, 0, 0, 0, + 116, 114, 97, 99, 107, 0, 0, 0, + 114, 101, 115, 116, 97, 114, 116, 0, + 100, 112, 111, 0, 0, 0, 0, 0, + 103, 108, 111, 49, 48, 109, 115, 66, + 101, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 49, 48, 109, 115, 65, + 116, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e81e829a0d6c83e9 = b_e81e829a0d6c83e9.words; +#if !CAPNP_LITE +static const uint16_t m_e81e829a0d6c83e9[] = {3, 7, 9, 8, 0, 6, 1, 2, 5, 4}; +const ::capnp::_::RawSchema s_e81e829a0d6c83e9 = { + 0xe81e829a0d6c83e9, b_e81e829a0d6c83e9.words, 64, nullptr, m_e81e829a0d6c83e9, + 0, 10, nullptr, nullptr, nullptr, { &s_e81e829a0d6c83e9, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(SVObservationState_e81e829a0d6c83e9, e81e829a0d6c83e9); +static const ::capnp::_::AlignedData<522> b_e501010e1bcae83b = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 59, 232, 202, 27, 14, 1, 1, 229, + 22, 0, 0, 0, 1, 0, 1, 0, + 193, 81, 174, 7, 75, 103, 148, 222, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 66, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 95, 6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 81, 99, 111, + 109, 71, 110, 115, 115, 46, 77, 101, + 97, 115, 117, 114, 101, 109, 101, 110, + 116, 83, 116, 97, 116, 117, 115, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 116, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 3, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 3, 0, 0, 3, 0, 1, 0, + 44, 3, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 3, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 3, 0, 0, 3, 0, 1, 0, + 56, 3, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 3, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 3, 0, 0, 3, 0, 1, 0, + 68, 3, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 3, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 3, 0, 0, 3, 0, 1, 0, + 84, 3, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 3, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 3, 0, 0, 3, 0, 1, 0, + 96, 3, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 3, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 3, 0, 0, 3, 0, 1, 0, + 108, 3, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 3, 0, 0, 3, 0, 1, 0, + 116, 3, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 3, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 3, 0, 0, 3, 0, 1, 0, + 128, 3, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 3, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 3, 0, 0, 3, 0, 1, 0, + 144, 3, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 3, 0, 0, 10, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 3, 0, 0, 3, 0, 1, 0, + 164, 3, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 3, 0, 0, 18, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 3, 0, 0, 3, 0, 1, 0, + 184, 3, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 3, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 3, 0, 0, 3, 0, 1, 0, + 196, 3, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 3, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 3, 0, 0, 3, 0, 1, 0, + 208, 3, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 3, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 3, 0, 0, 3, 0, 1, 0, + 220, 3, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 3, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 3, 0, 0, 3, 0, 1, 0, + 228, 3, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 3, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 3, 0, 0, 3, 0, 1, 0, + 244, 3, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 3, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 3, 0, 0, 3, 0, 1, 0, + 0, 4, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 3, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 4, 0, 0, 3, 0, 1, 0, + 16, 4, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 4, 0, 0, 3, 0, 1, 0, + 24, 4, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 4, 0, 0, 26, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 4, 0, 0, 3, 0, 1, 0, + 44, 4, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 20, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 4, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 4, 0, 0, 3, 0, 1, 0, + 56, 4, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 21, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 4, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 4, 0, 0, 3, 0, 1, 0, + 68, 4, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 22, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 4, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 4, 0, 0, 3, 0, 1, 0, + 80, 4, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 4, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 4, 0, 0, 3, 0, 1, 0, + 92, 4, 0, 0, 2, 0, 1, 0, + 24, 0, 0, 0, 24, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 4, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 4, 0, 0, 3, 0, 1, 0, + 104, 4, 0, 0, 2, 0, 1, 0, + 25, 0, 0, 0, 25, 0, 0, 0, + 0, 0, 1, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 4, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 4, 0, 0, 3, 0, 1, 0, + 120, 4, 0, 0, 2, 0, 1, 0, + 26, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 1, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 4, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 4, 0, 0, 3, 0, 1, 0, + 136, 4, 0, 0, 2, 0, 1, 0, + 27, 0, 0, 0, 27, 0, 0, 0, + 0, 0, 1, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 4, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 4, 0, 0, 3, 0, 1, 0, + 152, 4, 0, 0, 2, 0, 1, 0, + 28, 0, 0, 0, 28, 0, 0, 0, + 0, 0, 1, 0, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 4, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 4, 0, 0, 3, 0, 1, 0, + 164, 4, 0, 0, 2, 0, 1, 0, + 115, 117, 98, 77, 105, 108, 108, 105, + 115, 101, 99, 111, 110, 100, 73, 115, + 86, 97, 108, 105, 100, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 117, 98, 66, 105, 116, 84, 105, + 109, 101, 73, 115, 75, 110, 111, 119, + 110, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 97, 116, 101, 108, 108, 105, 116, + 101, 84, 105, 109, 101, 73, 115, 75, + 110, 111, 119, 110, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 105, 116, 69, 100, 103, 101, 67, + 111, 110, 102, 105, 114, 109, 101, 100, + 70, 114, 111, 109, 83, 105, 103, 110, + 97, 108, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 97, 115, 117, 114, 101, 100, + 86, 101, 108, 111, 99, 105, 116, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 110, 101, 79, 114, 67, 111, + 97, 114, 115, 101, 86, 101, 108, 111, + 99, 105, 116, 121, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 99, 107, 80, 111, 105, 110, + 116, 86, 97, 108, 105, 100, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 99, 107, 80, 111, 105, 110, + 116, 80, 111, 115, 105, 116, 105, 118, + 101, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 115, 116, 85, 112, 100, 97, + 116, 101, 70, 114, 111, 109, 68, 105, + 102, 102, 101, 114, 101, 110, 99, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 115, 116, 85, 112, 100, 97, + 116, 101, 70, 114, 111, 109, 86, 101, + 108, 111, 99, 105, 116, 121, 68, 105, + 102, 102, 101, 114, 101, 110, 99, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 114, 111, 110, 103, 73, 110, + 100, 105, 99, 97, 116, 105, 111, 110, + 79, 102, 67, 114, 111, 115, 115, 67, + 111, 114, 101, 108, 97, 116, 105, 111, + 110, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 101, 110, 116, 97, 116, 105, 118, + 101, 77, 101, 97, 115, 117, 114, 101, + 109, 101, 110, 116, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 78, 111, 116, 85, 115, + 97, 98, 108, 101, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 105, 114, 67, 104, 101, 99, 107, + 73, 115, 78, 101, 101, 100, 101, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 111, 98, 97, 116, 105, 111, + 110, 77, 111, 100, 101, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 77, + 101, 97, 110, 100, 101, 114, 66, 105, + 116, 69, 100, 103, 101, 86, 97, 108, + 105, 100, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 84, + 105, 109, 101, 77, 97, 114, 107, 86, + 97, 108, 105, 100, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 82, 111, 117, 110, 100, + 82, 111, 98, 105, 110, 82, 120, 68, + 105, 118, 101, 114, 115, 105, 116, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 82, 120, 68, 105, 118, + 101, 114, 115, 105, 116, 121, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 76, 111, 119, 66, 97, + 110, 100, 119, 105, 100, 116, 104, 82, + 120, 68, 105, 118, 101, 114, 115, 105, + 116, 121, 67, 111, 109, 98, 105, 110, + 101, 100, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 72, 105, 103, 104, 66, + 97, 110, 100, 119, 105, 100, 116, 104, + 78, 117, 52, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 72, 105, 103, 104, 66, + 97, 110, 100, 119, 105, 100, 116, 104, + 78, 117, 56, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 72, 105, 103, 104, 66, + 97, 110, 100, 119, 105, 100, 116, 104, + 85, 110, 105, 102, 111, 114, 109, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 117, 108, 116, 105, 112, 97, 116, + 104, 73, 110, 100, 105, 99, 97, 116, + 111, 114, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 109, 100, 74, 97, 109, 109, 105, + 110, 103, 73, 110, 100, 105, 99, 97, + 116, 111, 114, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 116, 101, 66, 49, 51, 84, 120, + 74, 97, 109, 109, 105, 110, 103, 73, + 110, 100, 105, 99, 97, 116, 111, 114, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 101, 115, 104, 77, 101, 97, + 115, 117, 114, 101, 109, 101, 110, 116, + 73, 110, 100, 105, 99, 97, 116, 111, + 114, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 117, 108, 116, 105, 112, 97, 116, + 104, 69, 115, 116, 105, 109, 97, 116, + 101, 73, 115, 86, 97, 108, 105, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 114, 101, 99, 116, 105, 111, + 110, 73, 115, 86, 97, 108, 105, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e501010e1bcae83b = b_e501010e1bcae83b.words; +#if !CAPNP_LITE +static const uint16_t m_e501010e1bcae83b[] = {3, 28, 5, 26, 15, 16, 20, 21, 22, 19, 17, 18, 24, 8, 9, 7, 6, 25, 4, 12, 27, 23, 14, 2, 13, 10, 1, 0, 11}; +static const uint16_t i_e501010e1bcae83b[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28}; +const ::capnp::_::RawSchema s_e501010e1bcae83b = { + 0xe501010e1bcae83b, b_e501010e1bcae83b.words, 522, nullptr, m_e501010e1bcae83b, + 0, 29, i_e501010e1bcae83b, nullptr, nullptr, { &s_e501010e1bcae83b, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<204> b_f580d7d86b7b8692 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 146, 134, 123, 107, 216, 215, 128, 245, + 22, 0, 0, 0, 1, 0, 4, 0, + 193, 81, 174, 7, 75, 103, 148, 222, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 66, 1, 0, 0, + 37, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 111, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 81, 99, 111, + 109, 71, 110, 115, 115, 46, 77, 101, + 97, 115, 117, 114, 101, 109, 101, 110, + 116, 82, 101, 112, 111, 114, 116, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 39, 44, 187, 231, 90, 89, 12, 241, + 1, 0, 0, 0, 26, 0, 0, 0, + 83, 86, 0, 0, 0, 0, 0, 0, + 44, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 1, 0, 0, 3, 0, 1, 0, + 44, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 1, 0, 0, 3, 0, 1, 0, + 48, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 1, 0, 0, 3, 0, 1, 0, + 52, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 1, 0, 0, 3, 0, 1, 0, + 64, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 1, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 1, 0, 0, 3, 0, 1, 0, + 76, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 1, 0, 0, 3, 0, 1, 0, + 84, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 1, 0, 0, 3, 0, 1, 0, + 92, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 1, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 1, 0, 0, 3, 0, 1, 0, + 104, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 1, 0, 0, 3, 0, 1, 0, + 116, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 1, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 1, 0, 0, 3, 0, 1, 0, + 132, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 1, 0, 0, 3, 0, 1, 0, + 152, 1, 0, 0, 2, 0, 1, 0, + 115, 111, 117, 114, 99, 101, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 238, 167, 173, 250, 182, 18, 26, 215, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 67, 111, 117, 110, 116, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 87, 101, 101, 107, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 67, + 121, 99, 108, 101, 78, 117, 109, 98, + 101, 114, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 78, + 117, 109, 98, 101, 114, 79, 102, 68, + 97, 121, 115, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 105, 108, 108, 105, 115, 101, 99, + 111, 110, 100, 115, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 66, 105, 97, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 108, 111, 99, 107, 84, 105, 109, + 101, 85, 110, 99, 101, 114, 116, 97, + 105, 110, 116, 121, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 108, 111, 99, 107, 70, 114, 101, + 113, 117, 101, 110, 99, 121, 66, 105, + 97, 115, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 108, 111, 99, 107, 70, 114, 101, + 113, 117, 101, 110, 99, 121, 85, 110, + 99, 101, 114, 116, 97, 105, 110, 116, + 121, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 118, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 39, 44, 187, 231, 90, 89, 12, 241, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_f580d7d86b7b8692 = b_f580d7d86b7b8692.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_f580d7d86b7b8692[] = { + &s_d71a12b6faada7ee, + &s_f10c595ae7bb2c27, +}; +static const uint16_t m_f580d7d86b7b8692[] = {8, 9, 7, 1, 3, 4, 2, 5, 0, 10, 6}; +static const uint16_t i_f580d7d86b7b8692[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; +const ::capnp::_::RawSchema s_f580d7d86b7b8692 = { + 0xf580d7d86b7b8692, b_f580d7d86b7b8692.words, 204, d_f580d7d86b7b8692, m_f580d7d86b7b8692, + 2, 11, i_f580d7d86b7b8692, nullptr, nullptr, { &s_f580d7d86b7b8692, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<455> b_f10c595ae7bb2c27 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 39, 44, 187, 231, 90, 89, 12, 241, + 40, 0, 0, 0, 1, 0, 8, 0, + 146, 134, 123, 107, 216, 215, 128, 245, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 90, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 183, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 81, 99, 111, + 109, 71, 110, 115, 115, 46, 77, 101, + 97, 115, 117, 114, 101, 109, 101, 110, + 116, 82, 101, 112, 111, 114, 116, 46, + 83, 86, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 104, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 2, 0, 0, 3, 0, 1, 0, + 208, 2, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 2, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 2, 0, 0, 3, 0, 1, 0, + 220, 2, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 2, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 2, 0, 0, 3, 0, 1, 0, + 232, 2, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 2, 0, 0, 3, 0, 1, 0, + 240, 2, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 2, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 2, 0, 0, 3, 0, 1, 0, + 252, 2, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 2, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 2, 0, 0, 3, 0, 1, 0, + 8, 3, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 3, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 3, 0, 0, 3, 0, 1, 0, + 24, 3, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 3, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 3, 0, 0, 3, 0, 1, 0, + 32, 3, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 3, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 3, 0, 0, 3, 0, 1, 0, + 40, 3, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 3, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 3, 0, 0, 3, 0, 1, 0, + 44, 3, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 3, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 3, 0, 0, 3, 0, 1, 0, + 56, 3, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 3, 0, 0, 3, 0, 1, 0, + 64, 3, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 3, 0, 0, 242, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 3, 0, 0, 3, 0, 1, 0, + 80, 3, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 3, 0, 0, 242, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 3, 0, 0, 3, 0, 1, 0, + 96, 3, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 3, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 3, 0, 0, 3, 0, 1, 0, + 112, 3, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 3, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 3, 0, 0, 3, 0, 1, 0, + 120, 3, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 3, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 3, 0, 0, 3, 0, 1, 0, + 136, 3, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 3, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 3, 0, 0, 3, 0, 1, 0, + 148, 3, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 3, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 3, 0, 0, 3, 0, 1, 0, + 160, 3, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 3, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 3, 0, 0, 3, 0, 1, 0, + 164, 3, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 3, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 3, 0, 0, 3, 0, 1, 0, + 172, 3, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 3, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 3, 0, 0, 3, 0, 1, 0, + 188, 3, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 3, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 3, 0, 0, 3, 0, 1, 0, + 204, 3, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 3, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 3, 0, 0, 3, 0, 1, 0, + 212, 3, 0, 0, 2, 0, 1, 0, + 24, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 3, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 3, 0, 0, 3, 0, 1, 0, + 224, 3, 0, 0, 2, 0, 1, 0, + 25, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 3, 0, 0, 3, 0, 1, 0, + 232, 3, 0, 0, 2, 0, 1, 0, + 115, 118, 73, 100, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 70, + 114, 101, 113, 117, 101, 110, 99, 121, + 73, 110, 100, 101, 120, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 98, 115, 101, 114, 118, 97, 116, + 105, 111, 110, 83, 116, 97, 116, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 233, 131, 108, 13, 154, 130, 30, 232, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 98, 115, 101, 114, 118, 97, 116, + 105, 111, 110, 115, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 111, 111, 100, 79, 98, 115, 101, + 114, 118, 97, 116, 105, 111, 110, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 80, 97, 114, 105, 116, + 121, 69, 114, 114, 111, 114, 67, 111, + 117, 110, 116, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 72, + 101, 109, 109, 105, 110, 103, 69, 114, + 114, 111, 114, 67, 111, 117, 110, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 108, 116, 101, 114, 83, 116, + 97, 103, 101, 115, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 114, 105, 101, 114, 78, + 111, 105, 115, 101, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 116, 101, 110, 99, 121, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 101, 100, 101, 116, 101, 99, + 116, 73, 110, 116, 101, 114, 118, 97, + 108, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 116, 100, 101, 116, 101, + 99, 116, 105, 111, 110, 115, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 102, 105, 108, 116, 101, 114, + 101, 100, 77, 101, 97, 115, 117, 114, + 101, 109, 101, 110, 116, 73, 110, 116, + 101, 103, 114, 97, 108, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 102, 105, 108, 116, 101, 114, + 101, 100, 77, 101, 97, 115, 117, 114, + 101, 109, 101, 110, 116, 70, 114, 97, + 99, 116, 105, 111, 110, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 102, 105, 108, 116, 101, 114, + 101, 100, 84, 105, 109, 101, 85, 110, + 99, 101, 114, 116, 97, 105, 110, 116, + 121, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 102, 105, 108, 116, 101, 114, + 101, 100, 83, 112, 101, 101, 100, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 102, 105, 108, 116, 101, 114, + 101, 100, 83, 112, 101, 101, 100, 85, + 110, 99, 101, 114, 116, 97, 105, 110, + 116, 121, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 83, 116, 97, 116, 117, + 115, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 59, 232, 202, 27, 14, 1, 1, 229, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 117, 108, 116, 105, 112, 97, 116, + 104, 69, 115, 116, 105, 109, 97, 116, + 101, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 122, 105, 109, 117, 116, 104, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 108, 101, 118, 97, 116, 105, 111, + 110, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 114, 105, 101, 114, 80, + 104, 97, 115, 101, 67, 121, 99, 108, + 101, 115, 73, 110, 116, 101, 103, 114, + 97, 108, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 114, 105, 101, 114, 80, + 104, 97, 115, 101, 67, 121, 99, 108, + 101, 115, 70, 114, 97, 99, 116, 105, + 111, 110, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 110, 101, 83, 112, 101, 101, + 100, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 110, 101, 83, 112, 101, 101, + 100, 85, 110, 99, 101, 114, 116, 97, + 105, 110, 116, 121, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 121, 99, 108, 101, 83, 108, 105, + 112, 67, 111, 117, 110, 116, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_f10c595ae7bb2c27 = b_f10c595ae7bb2c27.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_f10c595ae7bb2c27[] = { + &s_e501010e1bcae83b, + &s_e81e829a0d6c83e9, +}; +static const uint16_t m_f10c595ae7bb2c27[] = {19, 8, 22, 21, 25, 20, 7, 23, 24, 1, 6, 4, 5, 9, 17, 18, 2, 3, 11, 10, 0, 13, 12, 15, 16, 14}; +static const uint16_t i_f10c595ae7bb2c27[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25}; +const ::capnp::_::RawSchema s_f10c595ae7bb2c27 = { + 0xf10c595ae7bb2c27, b_f10c595ae7bb2c27.words, 455, d_f10c595ae7bb2c27, m_f10c595ae7bb2c27, + 2, 26, i_f10c595ae7bb2c27, nullptr, nullptr, { &s_f10c595ae7bb2c27, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<878> b_ca965e4add8f4f0b = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 11, 79, 143, 221, 74, 94, 150, 202, + 22, 0, 0, 0, 1, 0, 18, 0, + 193, 81, 174, 7, 75, 103, 148, 222, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 18, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 47, 11, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 81, 99, 111, + 109, 71, 110, 115, 115, 46, 67, 108, + 111, 99, 107, 82, 101, 112, 111, 114, + 116, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 204, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 5, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 5, 0, 0, 3, 0, 1, 0, + 144, 5, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 5, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 5, 0, 0, 3, 0, 1, 0, + 148, 5, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 5, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 5, 0, 0, 3, 0, 1, 0, + 156, 5, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 5, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 5, 0, 0, 3, 0, 1, 0, + 160, 5, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 5, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 5, 0, 0, 3, 0, 1, 0, + 172, 5, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 5, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 5, 0, 0, 3, 0, 1, 0, + 180, 5, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 5, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 5, 0, 0, 3, 0, 1, 0, + 188, 5, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 5, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 5, 0, 0, 3, 0, 1, 0, + 200, 5, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 5, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 5, 0, 0, 3, 0, 1, 0, + 208, 5, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 5, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 5, 0, 0, 3, 0, 1, 0, + 216, 5, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 20, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 5, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 5, 0, 0, 3, 0, 1, 0, + 224, 5, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 5, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 5, 0, 0, 3, 0, 1, 0, + 232, 5, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 5, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 5, 0, 0, 3, 0, 1, 0, + 240, 5, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 5, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 5, 0, 0, 3, 0, 1, 0, + 252, 5, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 5, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 5, 0, 0, 3, 0, 1, 0, + 8, 6, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 6, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 6, 0, 0, 3, 0, 1, 0, + 16, 6, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 6, 0, 0, 226, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 6, 0, 0, 3, 0, 1, 0, + 32, 6, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 21, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 6, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 6, 0, 0, 3, 0, 1, 0, + 44, 6, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 6, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 6, 0, 0, 3, 0, 1, 0, + 48, 6, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 6, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 6, 0, 0, 3, 0, 1, 0, + 56, 6, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 6, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 6, 0, 0, 3, 0, 1, 0, + 64, 6, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 6, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 6, 0, 0, 3, 0, 1, 0, + 76, 6, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 38, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 6, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 6, 0, 0, 3, 0, 1, 0, + 84, 6, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 6, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 6, 0, 0, 3, 0, 1, 0, + 88, 6, 0, 0, 2, 0, 1, 0, + 24, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 6, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 6, 0, 0, 3, 0, 1, 0, + 96, 6, 0, 0, 2, 0, 1, 0, + 25, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 6, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 6, 0, 0, 3, 0, 1, 0, + 104, 6, 0, 0, 2, 0, 1, 0, + 26, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 6, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 6, 0, 0, 3, 0, 1, 0, + 116, 6, 0, 0, 2, 0, 1, 0, + 27, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 1, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 6, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 6, 0, 0, 3, 0, 1, 0, + 124, 6, 0, 0, 2, 0, 1, 0, + 28, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 6, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 6, 0, 0, 3, 0, 1, 0, + 136, 6, 0, 0, 2, 0, 1, 0, + 29, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 1, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 6, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 6, 0, 0, 3, 0, 1, 0, + 152, 6, 0, 0, 2, 0, 1, 0, + 30, 0, 0, 0, 54, 0, 0, 0, + 0, 0, 1, 0, 30, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 6, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 6, 0, 0, 3, 0, 1, 0, + 160, 6, 0, 0, 2, 0, 1, 0, + 31, 0, 0, 0, 55, 0, 0, 0, + 0, 0, 1, 0, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 6, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 6, 0, 0, 3, 0, 1, 0, + 168, 6, 0, 0, 2, 0, 1, 0, + 32, 0, 0, 0, 76, 0, 0, 0, + 0, 0, 1, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 6, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 6, 0, 0, 3, 0, 1, 0, + 184, 6, 0, 0, 2, 0, 1, 0, + 33, 0, 0, 0, 77, 0, 0, 0, + 0, 0, 1, 0, 33, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 6, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 6, 0, 0, 3, 0, 1, 0, + 196, 6, 0, 0, 2, 0, 1, 0, + 34, 0, 0, 0, 20, 0, 0, 0, + 0, 0, 1, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 6, 0, 0, 10, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 6, 0, 0, 3, 0, 1, 0, + 216, 6, 0, 0, 2, 0, 1, 0, + 35, 0, 0, 0, 21, 0, 0, 0, + 0, 0, 1, 0, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 6, 0, 0, 98, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 6, 0, 0, 3, 0, 1, 0, + 240, 6, 0, 0, 2, 0, 1, 0, + 36, 0, 0, 0, 22, 0, 0, 0, + 0, 0, 1, 0, 36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 6, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 6, 0, 0, 3, 0, 1, 0, + 0, 7, 0, 0, 2, 0, 1, 0, + 37, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 1, 0, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 6, 0, 0, 66, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 7, 0, 0, 3, 0, 1, 0, + 20, 7, 0, 0, 2, 0, 1, 0, + 38, 0, 0, 0, 24, 0, 0, 0, + 0, 0, 1, 0, 38, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 7, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 7, 0, 0, 3, 0, 1, 0, + 36, 7, 0, 0, 2, 0, 1, 0, + 39, 0, 0, 0, 25, 0, 0, 0, + 0, 0, 1, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 7, 0, 0, 66, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 7, 0, 0, 3, 0, 1, 0, + 56, 7, 0, 0, 2, 0, 1, 0, + 40, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 1, 0, 40, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 7, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 7, 0, 0, 3, 0, 1, 0, + 72, 7, 0, 0, 2, 0, 1, 0, + 41, 0, 0, 0, 27, 0, 0, 0, + 0, 0, 1, 0, 41, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 7, 0, 0, 66, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 7, 0, 0, 3, 0, 1, 0, + 92, 7, 0, 0, 2, 0, 1, 0, + 42, 0, 0, 0, 28, 0, 0, 0, + 0, 0, 1, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 7, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 7, 0, 0, 3, 0, 1, 0, + 108, 7, 0, 0, 2, 0, 1, 0, + 43, 0, 0, 0, 29, 0, 0, 0, + 0, 0, 1, 0, 43, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 7, 0, 0, 66, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 7, 0, 0, 3, 0, 1, 0, + 128, 7, 0, 0, 2, 0, 1, 0, + 44, 0, 0, 0, 30, 0, 0, 0, + 0, 0, 1, 0, 44, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 7, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 7, 0, 0, 3, 0, 1, 0, + 144, 7, 0, 0, 2, 0, 1, 0, + 45, 0, 0, 0, 31, 0, 0, 0, + 0, 0, 1, 0, 45, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 7, 0, 0, 66, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 7, 0, 0, 3, 0, 1, 0, + 164, 7, 0, 0, 2, 0, 1, 0, + 46, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 46, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 7, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 7, 0, 0, 3, 0, 1, 0, + 172, 7, 0, 0, 2, 0, 1, 0, + 47, 0, 0, 0, 32, 0, 0, 0, + 0, 0, 1, 0, 47, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 7, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 7, 0, 0, 3, 0, 1, 0, + 180, 7, 0, 0, 2, 0, 1, 0, + 48, 0, 0, 0, 33, 0, 0, 0, + 0, 0, 1, 0, 48, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 7, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 7, 0, 0, 3, 0, 1, 0, + 188, 7, 0, 0, 2, 0, 1, 0, + 49, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 1, 0, 49, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 7, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 7, 0, 0, 3, 0, 1, 0, + 196, 7, 0, 0, 2, 0, 1, 0, + 50, 0, 0, 0, 35, 0, 0, 0, + 0, 0, 1, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 7, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 7, 0, 0, 3, 0, 1, 0, + 204, 7, 0, 0, 2, 0, 1, 0, + 104, 97, 115, 70, 67, 111, 117, 110, + 116, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 67, 111, 117, 110, 116, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 71, 112, 115, 87, 101, + 101, 107, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 87, 101, 101, 107, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 71, 112, 115, 77, 105, + 108, 108, 105, 115, 101, 99, 111, 110, + 100, 115, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 77, 105, 108, 108, 105, + 115, 101, 99, 111, 110, 100, 115, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 84, 105, 109, 101, 66, + 105, 97, 115, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 67, 108, 111, 99, 107, + 84, 105, 109, 101, 85, 110, 99, 101, + 114, 116, 97, 105, 110, 116, 121, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 67, 108, 111, 99, 107, + 83, 111, 117, 114, 99, 101, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 71, 108, 111, 110, 97, + 115, 115, 89, 101, 97, 114, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 89, + 101, 97, 114, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 71, 108, 111, 110, 97, + 115, 115, 68, 97, 121, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 68, + 97, 121, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 71, 108, 111, 110, 97, + 115, 115, 77, 105, 108, 108, 105, 115, + 101, 99, 111, 110, 100, 115, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 77, + 105, 108, 108, 105, 115, 101, 99, 111, + 110, 100, 115, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 84, + 105, 109, 101, 66, 105, 97, 115, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 67, + 108, 111, 99, 107, 84, 105, 109, 101, + 85, 110, 99, 101, 114, 116, 97, 105, + 110, 116, 121, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 67, + 108, 111, 99, 107, 83, 111, 117, 114, + 99, 101, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 100, 115, 87, 101, 101, 107, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 100, 115, 77, 105, 108, 108, 105, + 115, 101, 99, 111, 110, 100, 115, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 100, 115, 84, 105, 109, 101, 66, + 105, 97, 115, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 100, 115, 67, 108, 111, 99, 107, + 84, 105, 109, 101, 85, 110, 99, 101, + 114, 116, 97, 105, 110, 116, 121, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 100, 115, 67, 108, 111, 99, 107, + 83, 111, 117, 114, 99, 101, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 108, 87, 101, 101, 107, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 108, 77, 105, 108, 108, 105, + 115, 101, 99, 111, 110, 100, 115, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 108, 84, 105, 109, 101, 66, + 105, 97, 115, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 108, 67, 108, 111, 99, 107, + 84, 105, 109, 101, 85, 110, 99, 101, + 114, 116, 97, 105, 110, 116, 121, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 108, 67, 108, 111, 99, 107, + 83, 111, 117, 114, 99, 101, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 108, 111, 99, 107, 70, 114, 101, + 113, 117, 101, 110, 99, 121, 66, 105, + 97, 115, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 108, 111, 99, 107, 70, 114, 101, + 113, 117, 101, 110, 99, 121, 85, 110, + 99, 101, 114, 116, 97, 105, 110, 116, + 121, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 101, 113, 117, 101, 110, 99, + 121, 83, 111, 117, 114, 99, 101, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 76, 101, 97, 112, 83, + 101, 99, 111, 110, 100, 115, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 76, 101, 97, 112, 83, + 101, 99, 111, 110, 100, 115, 85, 110, + 99, 101, 114, 116, 97, 105, 110, 116, + 121, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 76, 101, 97, 112, 83, + 101, 99, 111, 110, 100, 115, 83, 111, + 117, 114, 99, 101, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 84, 111, 71, 108, 111, + 110, 97, 115, 115, 84, 105, 109, 101, + 66, 105, 97, 115, 77, 105, 108, 108, + 105, 115, 101, 99, 111, 110, 100, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 84, 111, 71, 108, 111, + 110, 97, 115, 115, 84, 105, 109, 101, + 66, 105, 97, 115, 77, 105, 108, 108, + 105, 115, 101, 99, 111, 110, 100, 115, + 85, 110, 99, 101, 114, 116, 97, 105, + 110, 116, 121, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 84, 111, 66, 100, 115, + 84, 105, 109, 101, 66, 105, 97, 115, + 77, 105, 108, 108, 105, 115, 101, 99, + 111, 110, 100, 115, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 84, 111, 66, 100, 115, + 84, 105, 109, 101, 66, 105, 97, 115, + 77, 105, 108, 108, 105, 115, 101, 99, + 111, 110, 100, 115, 85, 110, 99, 101, + 114, 116, 97, 105, 110, 116, 121, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 100, 115, 84, 111, 71, 108, 111, + 84, 105, 109, 101, 66, 105, 97, 115, + 77, 105, 108, 108, 105, 115, 101, 99, + 111, 110, 100, 115, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 100, 115, 84, 111, 71, 108, 111, + 84, 105, 109, 101, 66, 105, 97, 115, + 77, 105, 108, 108, 105, 115, 101, 99, + 111, 110, 100, 115, 85, 110, 99, 101, + 114, 116, 97, 105, 110, 116, 121, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 84, 111, 71, 97, 108, + 84, 105, 109, 101, 66, 105, 97, 115, + 77, 105, 108, 108, 105, 115, 101, 99, + 111, 110, 100, 115, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 84, 111, 71, 97, 108, + 84, 105, 109, 101, 66, 105, 97, 115, + 77, 105, 108, 108, 105, 115, 101, 99, + 111, 110, 100, 115, 85, 110, 99, 101, + 114, 116, 97, 105, 110, 116, 121, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 108, 84, 111, 71, 108, 111, + 84, 105, 109, 101, 66, 105, 97, 115, + 77, 105, 108, 108, 105, 115, 101, 99, + 111, 110, 100, 115, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 108, 84, 111, 71, 108, 111, + 84, 105, 109, 101, 66, 105, 97, 115, + 77, 105, 108, 108, 105, 115, 101, 99, + 111, 110, 100, 115, 85, 110, 99, 101, + 114, 116, 97, 105, 110, 116, 121, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 108, 84, 111, 66, 100, 115, + 84, 105, 109, 101, 66, 105, 97, 115, + 77, 105, 108, 108, 105, 115, 101, 99, + 111, 110, 100, 115, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 108, 84, 111, 66, 100, 115, + 84, 105, 109, 101, 66, 105, 97, 115, + 77, 105, 108, 108, 105, 115, 101, 99, + 111, 110, 100, 115, 85, 110, 99, 101, + 114, 116, 97, 105, 110, 116, 121, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 82, 116, 99, 84, 105, + 109, 101, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 121, 115, 116, 101, 109, 82, 116, + 99, 84, 105, 109, 101, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 67, 111, 117, 110, 116, 79, 102, + 102, 115, 101, 116, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 112, 109, 82, 116, 99, 67, 111, + 117, 110, 116, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 108, 111, 99, 107, 82, 101, 115, + 101, 116, 115, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_ca965e4add8f4f0b = b_ca965e4add8f4f0b.words; +#if !CAPNP_LITE +static const uint16_t m_ca965e4add8f4f0b[] = {22, 21, 19, 20, 38, 39, 18, 28, 29, 50, 1, 48, 30, 27, 26, 24, 25, 44, 45, 42, 43, 23, 17, 16, 12, 14, 15, 10, 8, 7, 31, 33, 32, 5, 6, 36, 37, 40, 41, 34, 35, 3, 0, 11, 13, 9, 4, 2, 46, 49, 47}; +static const uint16_t i_ca965e4add8f4f0b[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50}; +const ::capnp::_::RawSchema s_ca965e4add8f4f0b = { + 0xca965e4add8f4f0b, b_ca965e4add8f4f0b.words, 878, nullptr, m_ca965e4add8f4f0b, + 0, 51, i_ca965e4add8f4f0b, nullptr, nullptr, { &s_ca965e4add8f4f0b, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<485> b_8053c39445c6c75c = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 92, 199, 198, 69, 148, 195, 83, 128, + 22, 0, 0, 0, 1, 0, 10, 0, + 193, 81, 174, 7, 75, 103, 148, 222, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 82, 1, 0, 0, + 41, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 39, 6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 81, 99, 111, + 109, 71, 110, 115, 115, 46, 68, 114, + 77, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 82, 101, 112, 111, 114, + 116, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 156, 69, 191, 140, 223, 129, 139, 240, + 1, 0, 0, 0, 26, 0, 0, 0, + 83, 86, 0, 0, 0, 0, 0, 0, + 112, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 3, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 2, 0, 0, 3, 0, 1, 0, + 8, 3, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 3, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 3, 0, 1, 0, + 12, 3, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 3, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 3, 0, 0, 3, 0, 1, 0, + 16, 3, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 3, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 3, 0, 0, 3, 0, 1, 0, + 20, 3, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 24, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 3, 0, 0, 3, 0, 1, 0, + 28, 3, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 3, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 3, 0, 0, 3, 0, 1, 0, + 32, 3, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 3, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 3, 0, 0, 3, 0, 1, 0, + 40, 3, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 3, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 3, 0, 0, 3, 0, 1, 0, + 48, 3, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 3, 0, 0, 3, 0, 1, 0, + 56, 3, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 3, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 3, 0, 0, 3, 0, 1, 0, + 72, 3, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 3, 0, 0, 10, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 3, 0, 0, 3, 0, 1, 0, + 92, 3, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 3, 0, 0, 98, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 3, 0, 0, 3, 0, 1, 0, + 116, 3, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 3, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 3, 0, 0, 3, 0, 1, 0, + 120, 3, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 3, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 3, 0, 0, 3, 0, 1, 0, + 128, 3, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 3, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 3, 0, 0, 3, 0, 1, 0, + 136, 3, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 3, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 3, 0, 0, 3, 0, 1, 0, + 152, 3, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 3, 0, 0, 3, 0, 1, 0, + 160, 3, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 35, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 3, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 3, 0, 0, 3, 0, 1, 0, + 172, 3, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 48, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 3, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 3, 0, 0, 3, 0, 1, 0, + 180, 3, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 25, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 3, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 3, 0, 0, 3, 0, 1, 0, + 188, 3, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 3, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 3, 0, 0, 3, 0, 1, 0, + 200, 3, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 3, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 3, 0, 0, 3, 0, 1, 0, + 208, 3, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 3, 0, 0, 226, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 3, 0, 0, 3, 0, 1, 0, + 224, 3, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 3, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 3, 0, 0, 3, 0, 1, 0, + 236, 3, 0, 0, 2, 0, 1, 0, + 24, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 3, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 3, 0, 0, 3, 0, 1, 0, + 252, 3, 0, 0, 2, 0, 1, 0, + 25, 0, 0, 0, 49, 0, 0, 0, + 0, 0, 1, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 3, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 3, 0, 0, 3, 0, 1, 0, + 4, 4, 0, 0, 2, 0, 1, 0, + 26, 0, 0, 0, 36, 0, 0, 0, + 0, 0, 1, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 4, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 3, 0, 0, 3, 0, 1, 0, + 8, 4, 0, 0, 2, 0, 1, 0, + 27, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 4, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 4, 0, 0, 3, 0, 1, 0, + 28, 4, 0, 0, 2, 0, 1, 0, + 114, 101, 97, 115, 111, 110, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 113, 78, 117, 109, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 113, 77, 97, 120, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 102, 76, 111, 115, 115, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 121, 115, 116, 101, 109, 82, 116, + 99, 86, 97, 108, 105, 100, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 67, 111, 117, 110, 116, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 108, 111, 99, 107, 82, 101, 115, + 101, 116, 115, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 121, 115, 116, 101, 109, 82, 116, + 99, 84, 105, 109, 101, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 76, 101, 97, 112, 83, + 101, 99, 111, 110, 100, 115, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 76, 101, 97, 112, 83, + 101, 99, 111, 110, 100, 115, 85, 110, + 99, 101, 114, 116, 97, 105, 110, 116, + 121, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 84, 111, 71, 108, 111, + 110, 97, 115, 115, 84, 105, 109, 101, + 66, 105, 97, 115, 77, 105, 108, 108, + 105, 115, 101, 99, 111, 110, 100, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 84, 111, 71, 108, 111, + 110, 97, 115, 115, 84, 105, 109, 101, + 66, 105, 97, 115, 77, 105, 108, 108, + 105, 115, 101, 99, 111, 110, 100, 115, + 85, 110, 99, 101, 114, 116, 97, 105, + 110, 116, 121, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 87, 101, 101, 107, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 77, 105, 108, 108, 105, + 115, 101, 99, 111, 110, 100, 115, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 84, 105, 109, 101, 66, + 105, 97, 115, 77, 115, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 67, 108, 111, 99, 107, + 84, 105, 109, 101, 85, 110, 99, 101, + 114, 116, 97, 105, 110, 116, 121, 77, + 115, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 67, 108, 111, 99, 107, + 83, 111, 117, 114, 99, 101, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 67, + 108, 111, 99, 107, 83, 111, 117, 114, + 99, 101, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 89, + 101, 97, 114, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 68, + 97, 121, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 77, + 105, 108, 108, 105, 115, 101, 99, 111, + 110, 100, 115, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 84, + 105, 109, 101, 66, 105, 97, 115, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 67, + 108, 111, 99, 107, 84, 105, 109, 101, + 85, 110, 99, 101, 114, 116, 97, 105, + 110, 116, 121, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 108, 111, 99, 107, 70, 114, 101, + 113, 117, 101, 110, 99, 121, 66, 105, + 97, 115, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 108, 111, 99, 107, 70, 114, 101, + 113, 117, 101, 110, 99, 121, 85, 110, + 99, 101, 114, 116, 97, 105, 110, 116, + 121, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 101, 113, 117, 101, 110, 99, + 121, 83, 111, 117, 114, 99, 101, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 111, 117, 114, 99, 101, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 238, 167, 173, 250, 182, 18, 26, 215, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 118, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 156, 69, 191, 140, 223, 129, 139, 240, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_8053c39445c6c75c = b_8053c39445c6c75c.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_8053c39445c6c75c[] = { + &s_d71a12b6faada7ee, + &s_f08b81df8cbf459c, +}; +static const uint16_t m_8053c39445c6c75c[] = {23, 24, 6, 5, 25, 17, 22, 19, 20, 21, 18, 16, 15, 8, 9, 13, 14, 10, 11, 12, 0, 3, 2, 1, 26, 27, 7, 4}; +static const uint16_t i_8053c39445c6c75c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27}; +const ::capnp::_::RawSchema s_8053c39445c6c75c = { + 0x8053c39445c6c75c, b_8053c39445c6c75c.words, 485, d_8053c39445c6c75c, m_8053c39445c6c75c, + 2, 28, i_8053c39445c6c75c, nullptr, nullptr, { &s_8053c39445c6c75c, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<567> b_f08b81df8cbf459c = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 156, 69, 191, 140, 223, 129, 139, 240, + 42, 0, 0, 0, 1, 0, 12, 0, + 92, 199, 198, 69, 148, 195, 83, 128, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 106, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 63, 7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 81, 99, 111, + 109, 71, 110, 115, 115, 46, 68, 114, + 77, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 82, 101, 112, 111, 114, + 116, 46, 83, 86, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 132, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 3, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 3, 0, 0, 3, 0, 1, 0, + 148, 3, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 3, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 3, 0, 0, 3, 0, 1, 0, + 160, 3, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 3, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 3, 0, 0, 3, 0, 1, 0, + 172, 3, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 3, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 3, 0, 0, 3, 0, 1, 0, + 180, 3, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 3, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 3, 0, 0, 3, 0, 1, 0, + 192, 3, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 3, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 3, 0, 0, 3, 0, 1, 0, + 200, 3, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 3, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 3, 0, 0, 3, 0, 1, 0, + 212, 3, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 3, 0, 0, 3, 0, 1, 0, + 220, 3, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 3, 0, 0, 3, 0, 1, 0, + 228, 3, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 3, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 3, 0, 0, 3, 0, 1, 0, + 240, 3, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 3, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 3, 0, 0, 3, 0, 1, 0, + 248, 3, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 3, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 3, 0, 0, 3, 0, 1, 0, + 252, 3, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 3, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 3, 0, 0, 3, 0, 1, 0, + 0, 4, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 3, 0, 0, 226, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 4, 0, 0, 3, 0, 1, 0, + 16, 4, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 4, 0, 0, 226, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 4, 0, 0, 3, 0, 1, 0, + 32, 4, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 4, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 4, 0, 0, 3, 0, 1, 0, + 44, 4, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 4, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 4, 0, 0, 3, 0, 1, 0, + 52, 4, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 4, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 4, 0, 0, 3, 0, 1, 0, + 68, 4, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 4, 0, 0, 242, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 4, 0, 0, 3, 0, 1, 0, + 84, 4, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 4, 0, 0, 242, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 4, 0, 0, 3, 0, 1, 0, + 100, 4, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 4, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 4, 0, 0, 3, 0, 1, 0, + 116, 4, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 4, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 4, 0, 0, 3, 0, 1, 0, + 124, 4, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 4, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 4, 0, 0, 3, 0, 1, 0, + 140, 4, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 4, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 4, 0, 0, 3, 0, 1, 0, + 152, 4, 0, 0, 2, 0, 1, 0, + 24, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 4, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 4, 0, 0, 3, 0, 1, 0, + 156, 4, 0, 0, 2, 0, 1, 0, + 25, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 4, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 4, 0, 0, 3, 0, 1, 0, + 164, 4, 0, 0, 2, 0, 1, 0, + 26, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 1, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 4, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 4, 0, 0, 3, 0, 1, 0, + 176, 4, 0, 0, 2, 0, 1, 0, + 27, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 1, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 4, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 4, 0, 0, 3, 0, 1, 0, + 184, 4, 0, 0, 2, 0, 1, 0, + 28, 0, 0, 0, 20, 0, 0, 0, + 0, 0, 1, 0, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 4, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 4, 0, 0, 3, 0, 1, 0, + 196, 4, 0, 0, 2, 0, 1, 0, + 29, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 4, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 4, 0, 0, 3, 0, 1, 0, + 204, 4, 0, 0, 2, 0, 1, 0, + 30, 0, 0, 0, 21, 0, 0, 0, + 0, 0, 1, 0, 30, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 4, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 4, 0, 0, 3, 0, 1, 0, + 208, 4, 0, 0, 2, 0, 1, 0, + 31, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 4, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 4, 0, 0, 3, 0, 1, 0, + 220, 4, 0, 0, 2, 0, 1, 0, + 32, 0, 0, 0, 72, 0, 0, 0, + 0, 0, 1, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 4, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 4, 0, 0, 3, 0, 1, 0, + 228, 4, 0, 0, 2, 0, 1, 0, + 115, 118, 73, 100, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 70, + 114, 101, 113, 117, 101, 110, 99, 121, + 73, 110, 100, 101, 120, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 98, 115, 101, 114, 118, 97, 116, + 105, 111, 110, 83, 116, 97, 116, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 233, 131, 108, 13, 154, 130, 30, 232, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 98, 115, 101, 114, 118, 97, 116, + 105, 111, 110, 115, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 111, 111, 100, 79, 98, 115, 101, + 114, 118, 97, 116, 105, 111, 110, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 108, 116, 101, 114, 83, 116, + 97, 103, 101, 115, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 101, 100, 101, 116, 101, 99, + 116, 73, 110, 116, 101, 114, 118, 97, + 108, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 121, 99, 108, 101, 83, 108, 105, + 112, 67, 111, 117, 110, 116, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 116, 100, 101, 116, 101, + 99, 116, 105, 111, 110, 115, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 83, 116, 97, 116, 117, + 115, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 59, 232, 202, 27, 14, 1, 1, 229, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 114, 105, 101, 114, 78, + 111, 105, 115, 101, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 102, 76, 111, 115, 115, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 116, 101, 110, 99, 121, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 108, 116, 101, 114, 101, 100, + 77, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 70, 114, 97, 99, 116, + 105, 111, 110, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 108, 116, 101, 114, 101, 100, + 77, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 73, 110, 116, 101, 103, + 114, 97, 108, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 108, 116, 101, 114, 101, 100, + 84, 105, 109, 101, 85, 110, 99, 101, + 114, 116, 97, 105, 110, 116, 121, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 108, 116, 101, 114, 101, 100, + 83, 112, 101, 101, 100, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 108, 116, 101, 114, 101, 100, + 83, 112, 101, 101, 100, 85, 110, 99, + 101, 114, 116, 97, 105, 110, 116, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 102, 105, 108, 116, 101, 114, + 101, 100, 77, 101, 97, 115, 117, 114, + 101, 109, 101, 110, 116, 70, 114, 97, + 99, 116, 105, 111, 110, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 102, 105, 108, 116, 101, 114, + 101, 100, 77, 101, 97, 115, 117, 114, + 101, 109, 101, 110, 116, 73, 110, 116, + 101, 103, 114, 97, 108, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 102, 105, 108, 116, 101, 114, + 101, 100, 84, 105, 109, 101, 85, 110, + 99, 101, 114, 116, 97, 105, 110, 116, + 121, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 102, 105, 108, 116, 101, 114, + 101, 100, 83, 112, 101, 101, 100, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 102, 105, 108, 116, 101, 114, + 101, 100, 83, 112, 101, 101, 100, 85, + 110, 99, 101, 114, 116, 97, 105, 110, + 116, 121, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 117, 108, 116, 105, 112, 97, 116, + 104, 69, 115, 116, 105, 109, 97, 116, + 101, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 122, 105, 109, 117, 116, 104, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 108, 101, 118, 97, 116, 105, 111, + 110, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 111, 112, 112, 108, 101, 114, 65, + 99, 99, 101, 108, 101, 114, 97, 116, + 105, 111, 110, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 110, 101, 83, 112, 101, 101, + 100, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 110, 101, 83, 112, 101, 101, + 100, 85, 110, 99, 101, 114, 116, 97, + 105, 110, 116, 121, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 114, 105, 101, 114, 80, + 104, 97, 115, 101, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 67, 111, 117, 110, 116, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 114, 105, 116, 121, 69, 114, + 114, 111, 114, 67, 111, 117, 110, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 111, 111, 100, 80, 97, 114, 105, + 116, 121, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_f08b81df8cbf459c = b_f08b81df8cbf459c.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_f08b81df8cbf459c[] = { + &s_e501010e1bcae83b, + &s_e81e829a0d6c83e9, +}; +static const uint16_t m_f08b81df8cbf459c[] = {24, 10, 29, 7, 26, 25, 30, 5, 13, 14, 16, 17, 15, 27, 28, 1, 4, 32, 12, 9, 23, 2, 3, 31, 8, 6, 11, 0, 18, 19, 21, 22, 20}; +static const uint16_t i_f08b81df8cbf459c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}; +const ::capnp::_::RawSchema s_f08b81df8cbf459c = { + 0xf08b81df8cbf459c, b_f08b81df8cbf459c.words, 567, d_f08b81df8cbf459c, m_f08b81df8cbf459c, + 2, 33, i_f08b81df8cbf459c, nullptr, nullptr, { &s_f08b81df8cbf459c, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<397> b_b1fb80811a673270 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 112, 50, 103, 26, 129, 128, 251, 177, + 22, 0, 0, 0, 1, 0, 7, 0, + 193, 81, 174, 7, 75, 103, 148, 222, + 4, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 42, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 15, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 81, 99, 111, + 109, 71, 110, 115, 115, 46, 68, 114, + 83, 118, 80, 111, 108, 121, 82, 101, + 112, 111, 114, 116, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 92, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 2, 0, 0, 3, 0, 1, 0, + 124, 2, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 2, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 2, 0, 0, 3, 0, 1, 0, + 132, 2, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 24, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 2, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 2, 0, 0, 3, 0, 1, 0, + 140, 2, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 25, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 2, 0, 0, 3, 0, 1, 0, + 144, 2, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 2, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 2, 0, 0, 3, 0, 1, 0, + 152, 2, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 27, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 2, 0, 0, 3, 0, 1, 0, + 160, 2, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 28, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 2, 0, 0, 3, 0, 1, 0, + 168, 2, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 29, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 2, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 2, 0, 0, 3, 0, 1, 0, + 176, 2, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 2, 0, 0, 3, 0, 1, 0, + 180, 2, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 2, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 2, 0, 0, 3, 0, 1, 0, + 184, 2, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 2, 0, 0, 3, 0, 1, 0, + 204, 2, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 2, 0, 0, 3, 0, 1, 0, + 224, 2, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 2, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 2, 0, 0, 3, 0, 1, 0, + 244, 2, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 2, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 2, 0, 0, 3, 0, 1, 0, + 0, 3, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 2, 0, 0, 3, 0, 1, 0, + 8, 3, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 3, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 3, 0, 1, 0, + 12, 3, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 3, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 3, 0, 0, 3, 0, 1, 0, + 20, 3, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 3, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 3, 0, 0, 3, 0, 1, 0, + 28, 3, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 3, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 3, 0, 0, 3, 0, 1, 0, + 36, 3, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 3, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 3, 0, 0, 3, 0, 1, 0, + 44, 3, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 3, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 3, 0, 0, 3, 0, 1, 0, + 52, 3, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 3, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 3, 0, 0, 3, 0, 1, 0, + 64, 3, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 3, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 3, 0, 0, 3, 0, 1, 0, + 88, 3, 0, 0, 2, 0, 1, 0, + 115, 118, 73, 100, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 101, 113, 117, 101, 110, 99, + 121, 73, 110, 100, 101, 120, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 80, 111, 115, 105, 116, + 105, 111, 110, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 73, 111, 110, 111, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 84, 114, 111, 112, 111, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 69, 108, 101, 118, 97, + 116, 105, 111, 110, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 108, 121, 70, 114, 111, 109, + 88, 116, 114, 97, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 83, 98, 97, 115, 73, + 111, 110, 111, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 111, 100, 101, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 48, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 121, 122, 48, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 121, 122, 78, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 116, 104, 101, 114, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 105, 116, 105, 111, 110, + 85, 110, 99, 101, 114, 116, 97, 105, + 110, 116, 121, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 111, 110, 111, 68, 101, 108, 97, + 121, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 111, 110, 111, 68, 111, 116, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 98, 97, 115, 73, 111, 110, 111, + 68, 101, 108, 97, 121, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 98, 97, 115, 73, 111, 110, 111, + 68, 111, 116, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 114, 111, 112, 111, 68, 101, 108, + 97, 121, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 108, 101, 118, 97, 116, 105, 111, + 110, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 108, 101, 118, 97, 116, 105, 111, + 110, 68, 111, 116, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 108, 101, 118, 97, 116, 105, 111, + 110, 85, 110, 99, 101, 114, 116, 97, + 105, 110, 116, 121, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 108, 111, 99, 105, 116, 121, + 67, 111, 101, 102, 102, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_b1fb80811a673270 = b_b1fb80811a673270.words; +#if !CAPNP_LITE +static const uint16_t m_b1fb80811a673270[] = {19, 20, 21, 1, 5, 3, 2, 7, 4, 8, 14, 15, 12, 6, 13, 16, 17, 0, 9, 18, 22, 10, 11}; +static const uint16_t i_b1fb80811a673270[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22}; +const ::capnp::_::RawSchema s_b1fb80811a673270 = { + 0xb1fb80811a673270, b_b1fb80811a673270.words, 397, nullptr, m_b1fb80811a673270, + 0, 23, i_b1fb80811a673270, nullptr, nullptr, { &s_b1fb80811a673270, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<104> b_e3d6685d4e9d8f7a = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 122, 143, 157, 78, 93, 104, 214, 227, + 13, 0, 0, 0, 1, 0, 1, 0, + 99, 42, 156, 136, 196, 30, 239, 128, + 4, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 178, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 31, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 103, 97, 99, 121, 46, 99, + 97, 112, 110, 112, 58, 76, 105, 100, + 97, 114, 80, 116, 115, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 0, 0, 0, 3, 0, 1, 0, + 148, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 0, 0, 0, 3, 0, 1, 0, + 168, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 3, 0, 1, 0, + 188, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 0, 0, 0, 3, 0, 1, 0, + 192, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 0, 0, 0, 3, 0, 1, 0, + 196, 0, 0, 0, 2, 0, 1, 0, + 114, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 104, 101, 116, 97, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 102, 108, 101, 99, 116, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 100, 120, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 107, 116, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e3d6685d4e9d8f7a = b_e3d6685d4e9d8f7a.words; +#if !CAPNP_LITE +static const uint16_t m_e3d6685d4e9d8f7a[] = {3, 4, 0, 2, 1}; +static const uint16_t i_e3d6685d4e9d8f7a[] = {0, 1, 2, 3, 4}; +const ::capnp::_::RawSchema s_e3d6685d4e9d8f7a = { + 0xe3d6685d4e9d8f7a, b_e3d6685d4e9d8f7a.words, 104, nullptr, m_e3d6685d4e9d8f7a, + 0, 5, i_e3d6685d4e9d8f7a, nullptr, nullptr, { &s_e3d6685d4e9d8f7a, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +} // namespace schemas +} // namespace capnp + +// ======================================================================================= + +namespace cereal { + +// LogRotate +constexpr uint16_t LogRotate::_capnpPrivate::dataWordSize; +constexpr uint16_t LogRotate::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LogRotate::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LogRotate::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LiveUI +constexpr uint16_t LiveUI::_capnpPrivate::dataWordSize; +constexpr uint16_t LiveUI::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LiveUI::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LiveUI::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// UiLayoutState +constexpr uint16_t UiLayoutState::_capnpPrivate::dataWordSize; +constexpr uint16_t UiLayoutState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind UiLayoutState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* UiLayoutState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// OrbslamCorrection +constexpr uint16_t OrbslamCorrection::_capnpPrivate::dataWordSize; +constexpr uint16_t OrbslamCorrection::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind OrbslamCorrection::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* OrbslamCorrection::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// EthernetPacket +constexpr uint16_t EthernetPacket::_capnpPrivate::dataWordSize; +constexpr uint16_t EthernetPacket::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind EthernetPacket::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* EthernetPacket::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CellInfo +constexpr uint16_t CellInfo::_capnpPrivate::dataWordSize; +constexpr uint16_t CellInfo::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CellInfo::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CellInfo::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// WifiScan +constexpr uint16_t WifiScan::_capnpPrivate::dataWordSize; +constexpr uint16_t WifiScan::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind WifiScan::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* WifiScan::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LiveEventData +constexpr uint16_t LiveEventData::_capnpPrivate::dataWordSize; +constexpr uint16_t LiveEventData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LiveEventData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LiveEventData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ModelData +constexpr uint16_t ModelData::_capnpPrivate::dataWordSize; +constexpr uint16_t ModelData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ModelData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ModelData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ModelData::PathData +constexpr uint16_t ModelData::PathData::_capnpPrivate::dataWordSize; +constexpr uint16_t ModelData::PathData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ModelData::PathData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ModelData::PathData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ModelData::LeadData +constexpr uint16_t ModelData::LeadData::_capnpPrivate::dataWordSize; +constexpr uint16_t ModelData::LeadData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ModelData::LeadData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ModelData::LeadData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ModelData::ModelSettings +constexpr uint16_t ModelData::ModelSettings::_capnpPrivate::dataWordSize; +constexpr uint16_t ModelData::ModelSettings::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ModelData::ModelSettings::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ModelData::ModelSettings::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ModelData::MetaData +constexpr uint16_t ModelData::MetaData::_capnpPrivate::dataWordSize; +constexpr uint16_t ModelData::MetaData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ModelData::MetaData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ModelData::MetaData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ModelData::LongitudinalData +constexpr uint16_t ModelData::LongitudinalData::_capnpPrivate::dataWordSize; +constexpr uint16_t ModelData::LongitudinalData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ModelData::LongitudinalData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ModelData::LongitudinalData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ECEFPoint +constexpr uint16_t ECEFPoint::_capnpPrivate::dataWordSize; +constexpr uint16_t ECEFPoint::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ECEFPoint::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ECEFPoint::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ECEFPointDEPRECATED +constexpr uint16_t ECEFPointDEPRECATED::_capnpPrivate::dataWordSize; +constexpr uint16_t ECEFPointDEPRECATED::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ECEFPointDEPRECATED::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ECEFPointDEPRECATED::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// GPSPlannerPoints +constexpr uint16_t GPSPlannerPoints::_capnpPrivate::dataWordSize; +constexpr uint16_t GPSPlannerPoints::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind GPSPlannerPoints::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* GPSPlannerPoints::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// GPSPlannerPlan +constexpr uint16_t GPSPlannerPlan::_capnpPrivate::dataWordSize; +constexpr uint16_t GPSPlannerPlan::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind GPSPlannerPlan::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* GPSPlannerPlan::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// UiNavigationEvent +constexpr uint16_t UiNavigationEvent::_capnpPrivate::dataWordSize; +constexpr uint16_t UiNavigationEvent::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind UiNavigationEvent::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* UiNavigationEvent::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LiveLocationData +constexpr uint16_t LiveLocationData::_capnpPrivate::dataWordSize; +constexpr uint16_t LiveLocationData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LiveLocationData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LiveLocationData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LiveLocationData::Accuracy +constexpr uint16_t LiveLocationData::Accuracy::_capnpPrivate::dataWordSize; +constexpr uint16_t LiveLocationData::Accuracy::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LiveLocationData::Accuracy::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LiveLocationData::Accuracy::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// OrbOdometry +constexpr uint16_t OrbOdometry::_capnpPrivate::dataWordSize; +constexpr uint16_t OrbOdometry::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind OrbOdometry::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* OrbOdometry::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// OrbFeatures +constexpr uint16_t OrbFeatures::_capnpPrivate::dataWordSize; +constexpr uint16_t OrbFeatures::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind OrbFeatures::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* OrbFeatures::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// OrbFeaturesSummary +constexpr uint16_t OrbFeaturesSummary::_capnpPrivate::dataWordSize; +constexpr uint16_t OrbFeaturesSummary::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind OrbFeaturesSummary::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* OrbFeaturesSummary::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// OrbKeyFrame +constexpr uint16_t OrbKeyFrame::_capnpPrivate::dataWordSize; +constexpr uint16_t OrbKeyFrame::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind OrbKeyFrame::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* OrbKeyFrame::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// KalmanOdometry +constexpr uint16_t KalmanOdometry::_capnpPrivate::dataWordSize; +constexpr uint16_t KalmanOdometry::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind KalmanOdometry::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* KalmanOdometry::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// OrbObservation +constexpr uint16_t OrbObservation::_capnpPrivate::dataWordSize; +constexpr uint16_t OrbObservation::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind OrbObservation::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* OrbObservation::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CalibrationFeatures +constexpr uint16_t CalibrationFeatures::_capnpPrivate::dataWordSize; +constexpr uint16_t CalibrationFeatures::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CalibrationFeatures::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CalibrationFeatures::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// NavStatus +constexpr uint16_t NavStatus::_capnpPrivate::dataWordSize; +constexpr uint16_t NavStatus::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind NavStatus::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* NavStatus::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// NavStatus::Address +constexpr uint16_t NavStatus::Address::_capnpPrivate::dataWordSize; +constexpr uint16_t NavStatus::Address::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind NavStatus::Address::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* NavStatus::Address::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// NavUpdate +constexpr uint16_t NavUpdate::_capnpPrivate::dataWordSize; +constexpr uint16_t NavUpdate::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind NavUpdate::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* NavUpdate::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// NavUpdate::LatLng +constexpr uint16_t NavUpdate::LatLng::_capnpPrivate::dataWordSize; +constexpr uint16_t NavUpdate::LatLng::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind NavUpdate::LatLng::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* NavUpdate::LatLng::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// NavUpdate::Segment +constexpr uint16_t NavUpdate::Segment::_capnpPrivate::dataWordSize; +constexpr uint16_t NavUpdate::Segment::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind NavUpdate::Segment::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* NavUpdate::Segment::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// TrafficEvent +constexpr uint16_t TrafficEvent::_capnpPrivate::dataWordSize; +constexpr uint16_t TrafficEvent::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind TrafficEvent::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* TrafficEvent::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// AndroidGnss +constexpr uint16_t AndroidGnss::_capnpPrivate::dataWordSize; +constexpr uint16_t AndroidGnss::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind AndroidGnss::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* AndroidGnss::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// AndroidGnss::Measurements +constexpr uint16_t AndroidGnss::Measurements::_capnpPrivate::dataWordSize; +constexpr uint16_t AndroidGnss::Measurements::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind AndroidGnss::Measurements::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* AndroidGnss::Measurements::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// AndroidGnss::Measurements::Clock +constexpr uint16_t AndroidGnss::Measurements::Clock::_capnpPrivate::dataWordSize; +constexpr uint16_t AndroidGnss::Measurements::Clock::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind AndroidGnss::Measurements::Clock::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* AndroidGnss::Measurements::Clock::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// AndroidGnss::Measurements::Measurement +constexpr uint16_t AndroidGnss::Measurements::Measurement::_capnpPrivate::dataWordSize; +constexpr uint16_t AndroidGnss::Measurements::Measurement::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind AndroidGnss::Measurements::Measurement::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* AndroidGnss::Measurements::Measurement::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// AndroidGnss::NavigationMessage +constexpr uint16_t AndroidGnss::NavigationMessage::_capnpPrivate::dataWordSize; +constexpr uint16_t AndroidGnss::NavigationMessage::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind AndroidGnss::NavigationMessage::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* AndroidGnss::NavigationMessage::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// QcomGnss +constexpr uint16_t QcomGnss::_capnpPrivate::dataWordSize; +constexpr uint16_t QcomGnss::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind QcomGnss::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* QcomGnss::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// QcomGnss::MeasurementStatus +constexpr uint16_t QcomGnss::MeasurementStatus::_capnpPrivate::dataWordSize; +constexpr uint16_t QcomGnss::MeasurementStatus::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind QcomGnss::MeasurementStatus::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* QcomGnss::MeasurementStatus::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// QcomGnss::MeasurementReport +constexpr uint16_t QcomGnss::MeasurementReport::_capnpPrivate::dataWordSize; +constexpr uint16_t QcomGnss::MeasurementReport::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind QcomGnss::MeasurementReport::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* QcomGnss::MeasurementReport::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// QcomGnss::MeasurementReport::SV +constexpr uint16_t QcomGnss::MeasurementReport::SV::_capnpPrivate::dataWordSize; +constexpr uint16_t QcomGnss::MeasurementReport::SV::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind QcomGnss::MeasurementReport::SV::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* QcomGnss::MeasurementReport::SV::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// QcomGnss::ClockReport +constexpr uint16_t QcomGnss::ClockReport::_capnpPrivate::dataWordSize; +constexpr uint16_t QcomGnss::ClockReport::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind QcomGnss::ClockReport::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* QcomGnss::ClockReport::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// QcomGnss::DrMeasurementReport +constexpr uint16_t QcomGnss::DrMeasurementReport::_capnpPrivate::dataWordSize; +constexpr uint16_t QcomGnss::DrMeasurementReport::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind QcomGnss::DrMeasurementReport::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* QcomGnss::DrMeasurementReport::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// QcomGnss::DrMeasurementReport::SV +constexpr uint16_t QcomGnss::DrMeasurementReport::SV::_capnpPrivate::dataWordSize; +constexpr uint16_t QcomGnss::DrMeasurementReport::SV::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind QcomGnss::DrMeasurementReport::SV::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* QcomGnss::DrMeasurementReport::SV::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// QcomGnss::DrSvPolyReport +constexpr uint16_t QcomGnss::DrSvPolyReport::_capnpPrivate::dataWordSize; +constexpr uint16_t QcomGnss::DrSvPolyReport::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind QcomGnss::DrSvPolyReport::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* QcomGnss::DrSvPolyReport::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LidarPts +constexpr uint16_t LidarPts::_capnpPrivate::dataWordSize; +constexpr uint16_t LidarPts::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LidarPts::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LidarPts::_capnpPrivate::schema; +#endif // !CAPNP_LITE + + +} // namespace + diff --git a/cereal/gen/cpp/legacy.capnp.h b/cereal/gen/cpp/legacy.capnp.h new file mode 100644 index 000000000..2b48972a1 --- /dev/null +++ b/cereal/gen/cpp/legacy.capnp.h @@ -0,0 +1,16555 @@ +// Generated by Cap'n Proto compiler, DO NOT EDIT +// source: legacy.capnp + +#pragma once + +#include +#include + +#if CAPNP_VERSION != 8000 +#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." +#endif + + +namespace capnp { +namespace schemas { + +CAPNP_DECLARE_SCHEMA(9811e1f38f62f2d1); +CAPNP_DECLARE_SCHEMA(c08240f996aefced); +CAPNP_DECLARE_SCHEMA(88dcce08ad29dda0); +CAPNP_DECLARE_SCHEMA(9917470acf94d285); +enum class App_9917470acf94d285: uint16_t { + HOME, + MUSIC, + NAV, + SETTINGS, + NONE, +}; +CAPNP_DECLARE_ENUM(App, 9917470acf94d285); +CAPNP_DECLARE_SCHEMA(8afd33dc9b35e1aa); +CAPNP_DECLARE_SCHEMA(a99a9d5b33cf5859); +CAPNP_DECLARE_SCHEMA(cff7566681c277ce); +CAPNP_DECLARE_SCHEMA(d4df5a192382ba0b); +CAPNP_DECLARE_SCHEMA(cb6a279f015f6b51); +enum class ChannelWidth_cb6a279f015f6b51: uint16_t { + W20_MHZ, + W40_MHZ, + W80_MHZ, + W160_MHZ, + W80_PLUS80_MHZ, +}; +CAPNP_DECLARE_ENUM(ChannelWidth, cb6a279f015f6b51); +CAPNP_DECLARE_SCHEMA(94b7baa90c5c321e); +CAPNP_DECLARE_SCHEMA(b8aad62cffef28a9); +CAPNP_DECLARE_SCHEMA(8817eeea389e9f08); +CAPNP_DECLARE_SCHEMA(d1c9bef96d26fa91); +CAPNP_DECLARE_SCHEMA(a26e3710efd3e914); +CAPNP_DECLARE_SCHEMA(9744f25fb60f2bf8); +CAPNP_DECLARE_SCHEMA(f98f999c6a071122); +CAPNP_DECLARE_SCHEMA(c25bbbd524983447); +CAPNP_DECLARE_SCHEMA(e10e21168db0c7f7); +CAPNP_DECLARE_SCHEMA(ab54c59699f8f9f3); +CAPNP_DECLARE_SCHEMA(f5ad1d90cdc1dd6b); +CAPNP_DECLARE_SCHEMA(90c8426c3eaddd3b); +CAPNP_DECLARE_SCHEMA(e8db07dcf8fcea05); +enum class Type_e8db07dcf8fcea05: uint16_t { + NONE, + LANE_CHANGE_LEFT, + LANE_CHANGE_RIGHT, + MERGE_LEFT, + MERGE_RIGHT, + TURN_LEFT, + TURN_RIGHT, +}; +CAPNP_DECLARE_ENUM(Type, e8db07dcf8fcea05); +CAPNP_DECLARE_SCHEMA(b9aa88c75ef99a1f); +enum class Status_b9aa88c75ef99a1f: uint16_t { + NONE, + PASSIVE, + APPROACHING, + ACTIVE, +}; +CAPNP_DECLARE_ENUM(Status, b9aa88c75ef99a1f); +CAPNP_DECLARE_SCHEMA(b99b2bc7a57e8128); +CAPNP_DECLARE_SCHEMA(943dc4625473b03f); +CAPNP_DECLARE_SCHEMA(c871d3cc252af657); +enum class SensorSource_c871d3cc252af657: uint16_t { + APPLANIX, + KALMAN, + ORBSLAM, + TIMING, + DUMMY, +}; +CAPNP_DECLARE_ENUM(SensorSource, c871d3cc252af657); +CAPNP_DECLARE_SCHEMA(d7700859ed1f5b76); +CAPNP_DECLARE_SCHEMA(cd60164a8a0159ef); +CAPNP_DECLARE_SCHEMA(d500d30c5803fa4f); +CAPNP_DECLARE_SCHEMA(c8233c0345e27e24); +CAPNP_DECLARE_SCHEMA(92e21bb7ea38793a); +CAPNP_DECLARE_SCHEMA(9b326d4e436afec7); +CAPNP_DECLARE_SCHEMA(8fdfadb254ea867a); +CAPNP_DECLARE_SCHEMA(bd8822120928120c); +CAPNP_DECLARE_SCHEMA(ce7cd672cacc7814); +CAPNP_DECLARE_SCHEMA(db98be6565516acb); +CAPNP_DECLARE_SCHEMA(9eaef9187cadbb9b); +CAPNP_DECLARE_SCHEMA(a5b39b4fc4d7da3f); +CAPNP_DECLARE_SCHEMA(c5417a637451246f); +enum class Instruction_c5417a637451246f: uint16_t { + TURN_LEFT, + TURN_RIGHT, + KEEP_LEFT, + KEEP_RIGHT, + STRAIGHT, + ROUNDABOUT_EXIT_NUMBER, + ROUNDABOUT_EXIT, + ROUNDABOUT_TURN_LEFT, + UNKN8, + ROUNDABOUT_STRAIGHT, + UNKN10, + ROUNDABOUT_TURN_RIGHT, + UNKN12, + ROUNDABOUT_UTURN, + UNKN14, + ARRIVE, + EXIT_LEFT, + EXIT_RIGHT, + UNKN18, + UTURN, +}; +CAPNP_DECLARE_ENUM(Instruction, c5417a637451246f); +CAPNP_DECLARE_SCHEMA(acfa74a094e62626); +CAPNP_DECLARE_SCHEMA(d85d75253435bf4b); +enum class Type_d85d75253435bf4b: uint16_t { + STOP_SIGN, + LIGHT_RED, + LIGHT_YELLOW, + LIGHT_GREEN, + STOP_LIGHT, +}; +CAPNP_DECLARE_ENUM(Type, d85d75253435bf4b); +CAPNP_DECLARE_SCHEMA(a6f6ce72165ccb49); +enum class Action_a6f6ce72165ccb49: uint16_t { + NONE, + YIELD, + STOP, + RESUME_READY, +}; +CAPNP_DECLARE_ENUM(Action, a6f6ce72165ccb49); +CAPNP_DECLARE_SCHEMA(dfdf30d03fc485bd); +CAPNP_DECLARE_SCHEMA(a20710d4f428d6cd); +CAPNP_DECLARE_SCHEMA(a0e27b453a38f450); +CAPNP_DECLARE_SCHEMA(d949bf717d77614d); +CAPNP_DECLARE_SCHEMA(9ef1f3ff0deb5ffb); +enum class Constellation_9ef1f3ff0deb5ffb: uint16_t { + UNKNOWN, + GPS, + SBAS, + GLONASS, + QZSS, + BEIDOU, + GALILEO, +}; +CAPNP_DECLARE_ENUM(Constellation, 9ef1f3ff0deb5ffb); +CAPNP_DECLARE_SCHEMA(cbb9490adce12d72); +enum class State_cbb9490adce12d72: uint16_t { + UNKNOWN, + CODE_LOCK, + BIT_SYNC, + SUBFRAME_SYNC, + TOW_DECODED, + MSEC_AMBIGUOUS, + SYMBOL_SYNC, + GLO_STRING_SYNC, + GLO_TOD_DECODED, + BDS_D2_BIT_SYNC, + BDS_D2_SUBFRAME_SYNC, + GAL_E1BC_CODE_LOCK, + GAL_E1C2ND_CODE_LOCK, + GAL_E1B_PAGE_SYNC, + SBAS_SYNC, +}; +CAPNP_DECLARE_ENUM(State, cbb9490adce12d72); +CAPNP_DECLARE_SCHEMA(c04e7b6231d4caa8); +enum class MultipathIndicator_c04e7b6231d4caa8: uint16_t { + UNKNOWN, + DETECTED, + NOT_DETECTED, +}; +CAPNP_DECLARE_ENUM(MultipathIndicator, c04e7b6231d4caa8); +CAPNP_DECLARE_SCHEMA(e2517b083095fd4e); +CAPNP_DECLARE_SCHEMA(ec1ff7996b35366f); +enum class Status_ec1ff7996b35366f: uint16_t { + UNKNOWN, + PARITY_PASSED, + PARITY_REBUILT, +}; +CAPNP_DECLARE_ENUM(Status, ec1ff7996b35366f); +CAPNP_DECLARE_SCHEMA(de94674b07ae51c1); +CAPNP_DECLARE_SCHEMA(d71a12b6faada7ee); +enum class MeasurementSource_d71a12b6faada7ee: uint16_t { + GPS, + GLONASS, + BEIDOU, +}; +CAPNP_DECLARE_ENUM(MeasurementSource, d71a12b6faada7ee); +CAPNP_DECLARE_SCHEMA(e81e829a0d6c83e9); +enum class SVObservationState_e81e829a0d6c83e9: uint16_t { + IDLE, + SEARCH, + SEARCH_VERIFY, + BIT_EDGE, + TRACK_VERIFY, + TRACK, + RESTART, + DPO, + GLO10MS_BE, + GLO10MS_AT, +}; +CAPNP_DECLARE_ENUM(SVObservationState, e81e829a0d6c83e9); +CAPNP_DECLARE_SCHEMA(e501010e1bcae83b); +CAPNP_DECLARE_SCHEMA(f580d7d86b7b8692); +CAPNP_DECLARE_SCHEMA(f10c595ae7bb2c27); +CAPNP_DECLARE_SCHEMA(ca965e4add8f4f0b); +CAPNP_DECLARE_SCHEMA(8053c39445c6c75c); +CAPNP_DECLARE_SCHEMA(f08b81df8cbf459c); +CAPNP_DECLARE_SCHEMA(b1fb80811a673270); +CAPNP_DECLARE_SCHEMA(e3d6685d4e9d8f7a); + +} // namespace schemas +} // namespace capnp + +namespace cereal { + +struct LogRotate { + LogRotate() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(9811e1f38f62f2d1, 1, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LiveUI { + LiveUI() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(c08240f996aefced, 1, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct UiLayoutState { + UiLayoutState() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::App_9917470acf94d285 App; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(88dcce08ad29dda0, 1, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct OrbslamCorrection { + OrbslamCorrection() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(8afd33dc9b35e1aa, 2, 4) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct EthernetPacket { + EthernetPacket() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a99a9d5b33cf5859, 1, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CellInfo { + CellInfo() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(cff7566681c277ce, 1, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct WifiScan { + WifiScan() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::ChannelWidth_cb6a279f015f6b51 ChannelWidth; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d4df5a192382ba0b, 5, 5) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LiveEventData { + LiveEventData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(94b7baa90c5c321e, 1, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ModelData { + ModelData() = delete; + + class Reader; + class Builder; + class Pipeline; + struct PathData; + struct LeadData; + struct ModelSettings; + struct MetaData; + struct LongitudinalData; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(b8aad62cffef28a9, 4, 11) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ModelData::PathData { + PathData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(8817eeea389e9f08, 2, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ModelData::LeadData { + LeadData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d1c9bef96d26fa91, 5, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ModelData::ModelSettings { + ModelSettings() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a26e3710efd3e914, 1, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ModelData::MetaData { + MetaData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(9744f25fb60f2bf8, 2, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ModelData::LongitudinalData { + LongitudinalData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(f98f999c6a071122, 0, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ECEFPoint { + ECEFPoint() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(c25bbbd524983447, 3, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ECEFPointDEPRECATED { + ECEFPointDEPRECATED() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e10e21168db0c7f7, 2, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct GPSPlannerPoints { + GPSPlannerPoints() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(ab54c59699f8f9f3, 2, 5) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct GPSPlannerPlan { + GPSPlannerPlan() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(f5ad1d90cdc1dd6b, 2, 4) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct UiNavigationEvent { + UiNavigationEvent() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::Type_e8db07dcf8fcea05 Type; + + typedef ::capnp::schemas::Status_b9aa88c75ef99a1f Status; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(90c8426c3eaddd3b, 1, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LiveLocationData { + LiveLocationData() = delete; + + class Reader; + class Builder; + class Pipeline; + struct Accuracy; + typedef ::capnp::schemas::SensorSource_c871d3cc252af657 SensorSource; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(b99b2bc7a57e8128, 10, 7) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LiveLocationData::Accuracy { + Accuracy() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(943dc4625473b03f, 3, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct OrbOdometry { + OrbOdometry() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d7700859ed1f5b76, 4, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct OrbFeatures { + OrbFeatures() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(cd60164a8a0159ef, 2, 5) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct OrbFeaturesSummary { + OrbFeaturesSummary() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d500d30c5803fa4f, 4, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct OrbKeyFrame { + OrbKeyFrame() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(c8233c0345e27e24, 1, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct KalmanOdometry { + KalmanOdometry() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(92e21bb7ea38793a, 0, 4) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct OrbObservation { + OrbObservation() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(9b326d4e436afec7, 2, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CalibrationFeatures { + CalibrationFeatures() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(8fdfadb254ea867a, 1, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct NavStatus { + NavStatus() = delete; + + class Reader; + class Builder; + class Pipeline; + struct Address; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(bd8822120928120c, 1, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct NavStatus::Address { + Address() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(ce7cd672cacc7814, 2, 7) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct NavUpdate { + NavUpdate() = delete; + + class Reader; + class Builder; + class Pipeline; + struct LatLng; + struct Segment; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(db98be6565516acb, 1, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct NavUpdate::LatLng { + LatLng() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(9eaef9187cadbb9b, 2, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct NavUpdate::Segment { + Segment() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::Instruction_c5417a637451246f Instruction; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a5b39b4fc4d7da3f, 3, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct TrafficEvent { + TrafficEvent() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::Type_d85d75253435bf4b Type; + + typedef ::capnp::schemas::Action_a6f6ce72165ccb49 Action; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(acfa74a094e62626, 2, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct AndroidGnss { + AndroidGnss() = delete; + + class Reader; + class Builder; + class Pipeline; + enum Which: uint16_t { + MEASUREMENTS, + NAVIGATION_MESSAGE, + }; + struct Measurements; + struct NavigationMessage; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(dfdf30d03fc485bd, 1, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct AndroidGnss::Measurements { + Measurements() = delete; + + class Reader; + class Builder; + class Pipeline; + struct Clock; + struct Measurement; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a20710d4f428d6cd, 0, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct AndroidGnss::Measurements::Clock { + Clock() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a0e27b453a38f450, 9, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct AndroidGnss::Measurements::Measurement { + Measurement() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::Constellation_9ef1f3ff0deb5ffb Constellation; + + typedef ::capnp::schemas::State_cbb9490adce12d72 State; + + typedef ::capnp::schemas::MultipathIndicator_c04e7b6231d4caa8 MultipathIndicator; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d949bf717d77614d, 15, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct AndroidGnss::NavigationMessage { + NavigationMessage() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::Status_ec1ff7996b35366f Status; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e2517b083095fd4e, 3, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct QcomGnss { + QcomGnss() = delete; + + class Reader; + class Builder; + class Pipeline; + enum Which: uint16_t { + MEASUREMENT_REPORT, + CLOCK_REPORT, + DR_MEASUREMENT_REPORT, + DR_SV_POLY, + RAW_LOG, + }; + typedef ::capnp::schemas::MeasurementSource_d71a12b6faada7ee MeasurementSource; + + typedef ::capnp::schemas::SVObservationState_e81e829a0d6c83e9 SVObservationState; + + struct MeasurementStatus; + struct MeasurementReport; + struct ClockReport; + struct DrMeasurementReport; + struct DrSvPolyReport; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(de94674b07ae51c1, 2, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct QcomGnss::MeasurementStatus { + MeasurementStatus() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e501010e1bcae83b, 1, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct QcomGnss::MeasurementReport { + MeasurementReport() = delete; + + class Reader; + class Builder; + class Pipeline; + struct SV; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(f580d7d86b7b8692, 4, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct QcomGnss::MeasurementReport::SV { + SV() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(f10c595ae7bb2c27, 8, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct QcomGnss::ClockReport { + ClockReport() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(ca965e4add8f4f0b, 18, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct QcomGnss::DrMeasurementReport { + DrMeasurementReport() = delete; + + class Reader; + class Builder; + class Pipeline; + struct SV; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(8053c39445c6c75c, 10, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct QcomGnss::DrMeasurementReport::SV { + SV() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(f08b81df8cbf459c, 12, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct QcomGnss::DrSvPolyReport { + DrSvPolyReport() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(b1fb80811a673270, 7, 4) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LidarPts { + LidarPts() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e3d6685d4e9d8f7a, 1, 4) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +// ======================================================================================= + +class LogRotate::Reader { +public: + typedef LogRotate Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::int32_t getSegmentNum() const; + + inline bool hasPath() const; + inline ::capnp::Text::Reader getPath() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LogRotate::Builder { +public: + typedef LogRotate Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::int32_t getSegmentNum(); + inline void setSegmentNum( ::int32_t value); + + inline bool hasPath(); + inline ::capnp::Text::Builder getPath(); + inline void setPath( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initPath(unsigned int size); + inline void adoptPath(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownPath(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LogRotate::Pipeline { +public: + typedef LogRotate Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LiveUI::Reader { +public: + typedef LiveUI Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getRearViewCam() const; + + inline bool hasAlertText1() const; + inline ::capnp::Text::Reader getAlertText1() const; + + inline bool hasAlertText2() const; + inline ::capnp::Text::Reader getAlertText2() const; + + inline float getAwarenessStatus() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LiveUI::Builder { +public: + typedef LiveUI Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getRearViewCam(); + inline void setRearViewCam(bool value); + + inline bool hasAlertText1(); + inline ::capnp::Text::Builder getAlertText1(); + inline void setAlertText1( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initAlertText1(unsigned int size); + inline void adoptAlertText1(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownAlertText1(); + + inline bool hasAlertText2(); + inline ::capnp::Text::Builder getAlertText2(); + inline void setAlertText2( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initAlertText2(unsigned int size); + inline void adoptAlertText2(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownAlertText2(); + + inline float getAwarenessStatus(); + inline void setAwarenessStatus(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LiveUI::Pipeline { +public: + typedef LiveUI Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class UiLayoutState::Reader { +public: + typedef UiLayoutState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::cereal::UiLayoutState::App getActiveApp() const; + + inline bool getSidebarCollapsed() const; + + inline bool getMapEnabled() const; + + inline bool getMockEngaged() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class UiLayoutState::Builder { +public: + typedef UiLayoutState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::cereal::UiLayoutState::App getActiveApp(); + inline void setActiveApp( ::cereal::UiLayoutState::App value); + + inline bool getSidebarCollapsed(); + inline void setSidebarCollapsed(bool value); + + inline bool getMapEnabled(); + inline void setMapEnabled(bool value); + + inline bool getMockEngaged(); + inline void setMockEngaged(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class UiLayoutState::Pipeline { +public: + typedef UiLayoutState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class OrbslamCorrection::Reader { +public: + typedef OrbslamCorrection Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint64_t getCorrectionMonoTime() const; + + inline bool hasPrePositionECEF() const; + inline ::capnp::List::Reader getPrePositionECEF() const; + + inline bool hasPostPositionECEF() const; + inline ::capnp::List::Reader getPostPositionECEF() const; + + inline bool hasPrePoseQuatECEF() const; + inline ::capnp::List::Reader getPrePoseQuatECEF() const; + + inline bool hasPostPoseQuatECEF() const; + inline ::capnp::List::Reader getPostPoseQuatECEF() const; + + inline ::uint32_t getNumInliers() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class OrbslamCorrection::Builder { +public: + typedef OrbslamCorrection Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint64_t getCorrectionMonoTime(); + inline void setCorrectionMonoTime( ::uint64_t value); + + inline bool hasPrePositionECEF(); + inline ::capnp::List::Builder getPrePositionECEF(); + inline void setPrePositionECEF( ::capnp::List::Reader value); + inline void setPrePositionECEF(::kj::ArrayPtr value); + inline ::capnp::List::Builder initPrePositionECEF(unsigned int size); + inline void adoptPrePositionECEF(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownPrePositionECEF(); + + inline bool hasPostPositionECEF(); + inline ::capnp::List::Builder getPostPositionECEF(); + inline void setPostPositionECEF( ::capnp::List::Reader value); + inline void setPostPositionECEF(::kj::ArrayPtr value); + inline ::capnp::List::Builder initPostPositionECEF(unsigned int size); + inline void adoptPostPositionECEF(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownPostPositionECEF(); + + inline bool hasPrePoseQuatECEF(); + inline ::capnp::List::Builder getPrePoseQuatECEF(); + inline void setPrePoseQuatECEF( ::capnp::List::Reader value); + inline void setPrePoseQuatECEF(::kj::ArrayPtr value); + inline ::capnp::List::Builder initPrePoseQuatECEF(unsigned int size); + inline void adoptPrePoseQuatECEF(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownPrePoseQuatECEF(); + + inline bool hasPostPoseQuatECEF(); + inline ::capnp::List::Builder getPostPoseQuatECEF(); + inline void setPostPoseQuatECEF( ::capnp::List::Reader value); + inline void setPostPoseQuatECEF(::kj::ArrayPtr value); + inline ::capnp::List::Builder initPostPoseQuatECEF(unsigned int size); + inline void adoptPostPoseQuatECEF(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownPostPoseQuatECEF(); + + inline ::uint32_t getNumInliers(); + inline void setNumInliers( ::uint32_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class OrbslamCorrection::Pipeline { +public: + typedef OrbslamCorrection Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class EthernetPacket::Reader { +public: + typedef EthernetPacket Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasPkt() const; + inline ::capnp::Data::Reader getPkt() const; + + inline float getTs() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class EthernetPacket::Builder { +public: + typedef EthernetPacket Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasPkt(); + inline ::capnp::Data::Builder getPkt(); + inline void setPkt( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initPkt(unsigned int size); + inline void adoptPkt(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownPkt(); + + inline float getTs(); + inline void setTs(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class EthernetPacket::Pipeline { +public: + typedef EthernetPacket Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CellInfo::Reader { +public: + typedef CellInfo Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint64_t getTimestamp() const; + + inline bool hasRepr() const; + inline ::capnp::Text::Reader getRepr() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CellInfo::Builder { +public: + typedef CellInfo Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint64_t getTimestamp(); + inline void setTimestamp( ::uint64_t value); + + inline bool hasRepr(); + inline ::capnp::Text::Builder getRepr(); + inline void setRepr( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initRepr(unsigned int size); + inline void adoptRepr(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownRepr(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CellInfo::Pipeline { +public: + typedef CellInfo Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class WifiScan::Reader { +public: + typedef WifiScan Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasBssid() const; + inline ::capnp::Text::Reader getBssid() const; + + inline bool hasSsid() const; + inline ::capnp::Text::Reader getSsid() const; + + inline bool hasCapabilities() const; + inline ::capnp::Text::Reader getCapabilities() const; + + inline ::int32_t getFrequency() const; + + inline ::int32_t getLevel() const; + + inline ::int64_t getTimestamp() const; + + inline ::int32_t getCenterFreq0() const; + + inline ::int32_t getCenterFreq1() const; + + inline ::cereal::WifiScan::ChannelWidth getChannelWidth() const; + + inline bool hasOperatorFriendlyName() const; + inline ::capnp::Text::Reader getOperatorFriendlyName() const; + + inline bool hasVenueName() const; + inline ::capnp::Text::Reader getVenueName() const; + + inline bool getIs80211mcResponder() const; + + inline bool getPasspoint() const; + + inline ::int32_t getDistanceCm() const; + + inline ::int32_t getDistanceSdCm() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class WifiScan::Builder { +public: + typedef WifiScan Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasBssid(); + inline ::capnp::Text::Builder getBssid(); + inline void setBssid( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initBssid(unsigned int size); + inline void adoptBssid(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownBssid(); + + inline bool hasSsid(); + inline ::capnp::Text::Builder getSsid(); + inline void setSsid( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initSsid(unsigned int size); + inline void adoptSsid(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownSsid(); + + inline bool hasCapabilities(); + inline ::capnp::Text::Builder getCapabilities(); + inline void setCapabilities( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initCapabilities(unsigned int size); + inline void adoptCapabilities(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownCapabilities(); + + inline ::int32_t getFrequency(); + inline void setFrequency( ::int32_t value); + + inline ::int32_t getLevel(); + inline void setLevel( ::int32_t value); + + inline ::int64_t getTimestamp(); + inline void setTimestamp( ::int64_t value); + + inline ::int32_t getCenterFreq0(); + inline void setCenterFreq0( ::int32_t value); + + inline ::int32_t getCenterFreq1(); + inline void setCenterFreq1( ::int32_t value); + + inline ::cereal::WifiScan::ChannelWidth getChannelWidth(); + inline void setChannelWidth( ::cereal::WifiScan::ChannelWidth value); + + inline bool hasOperatorFriendlyName(); + inline ::capnp::Text::Builder getOperatorFriendlyName(); + inline void setOperatorFriendlyName( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initOperatorFriendlyName(unsigned int size); + inline void adoptOperatorFriendlyName(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownOperatorFriendlyName(); + + inline bool hasVenueName(); + inline ::capnp::Text::Builder getVenueName(); + inline void setVenueName( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initVenueName(unsigned int size); + inline void adoptVenueName(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownVenueName(); + + inline bool getIs80211mcResponder(); + inline void setIs80211mcResponder(bool value); + + inline bool getPasspoint(); + inline void setPasspoint(bool value); + + inline ::int32_t getDistanceCm(); + inline void setDistanceCm( ::int32_t value); + + inline ::int32_t getDistanceSdCm(); + inline void setDistanceSdCm( ::int32_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class WifiScan::Pipeline { +public: + typedef WifiScan Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LiveEventData::Reader { +public: + typedef LiveEventData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasName() const; + inline ::capnp::Text::Reader getName() const; + + inline ::int32_t getValue() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LiveEventData::Builder { +public: + typedef LiveEventData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasName(); + inline ::capnp::Text::Builder getName(); + inline void setName( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initName(unsigned int size); + inline void adoptName(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownName(); + + inline ::int32_t getValue(); + inline void setValue( ::int32_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LiveEventData::Pipeline { +public: + typedef LiveEventData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ModelData::Reader { +public: + typedef ModelData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint32_t getFrameId() const; + + inline bool hasPath() const; + inline ::cereal::ModelData::PathData::Reader getPath() const; + + inline bool hasLeftLane() const; + inline ::cereal::ModelData::PathData::Reader getLeftLane() const; + + inline bool hasRightLane() const; + inline ::cereal::ModelData::PathData::Reader getRightLane() const; + + inline bool hasLead() const; + inline ::cereal::ModelData::LeadData::Reader getLead() const; + + inline bool hasSettings() const; + inline ::cereal::ModelData::ModelSettings::Reader getSettings() const; + + inline bool hasFreePath() const; + inline ::capnp::List::Reader getFreePath() const; + + inline bool hasLeadFuture() const; + inline ::cereal::ModelData::LeadData::Reader getLeadFuture() const; + + inline bool hasSpeed() const; + inline ::capnp::List::Reader getSpeed() const; + + inline ::uint64_t getTimestampEof() const; + + inline bool hasMeta() const; + inline ::cereal::ModelData::MetaData::Reader getMeta() const; + + inline bool hasLongitudinal() const; + inline ::cereal::ModelData::LongitudinalData::Reader getLongitudinal() const; + + inline ::uint32_t getFrameAge() const; + + inline float getFrameDropPerc() const; + + inline float getModelExecutionTime() const; + + inline bool hasRawPred() const; + inline ::capnp::Data::Reader getRawPred() const; + + inline float getGpuExecutionTime() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ModelData::Builder { +public: + typedef ModelData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint32_t getFrameId(); + inline void setFrameId( ::uint32_t value); + + inline bool hasPath(); + inline ::cereal::ModelData::PathData::Builder getPath(); + inline void setPath( ::cereal::ModelData::PathData::Reader value); + inline ::cereal::ModelData::PathData::Builder initPath(); + inline void adoptPath(::capnp::Orphan< ::cereal::ModelData::PathData>&& value); + inline ::capnp::Orphan< ::cereal::ModelData::PathData> disownPath(); + + inline bool hasLeftLane(); + inline ::cereal::ModelData::PathData::Builder getLeftLane(); + inline void setLeftLane( ::cereal::ModelData::PathData::Reader value); + inline ::cereal::ModelData::PathData::Builder initLeftLane(); + inline void adoptLeftLane(::capnp::Orphan< ::cereal::ModelData::PathData>&& value); + inline ::capnp::Orphan< ::cereal::ModelData::PathData> disownLeftLane(); + + inline bool hasRightLane(); + inline ::cereal::ModelData::PathData::Builder getRightLane(); + inline void setRightLane( ::cereal::ModelData::PathData::Reader value); + inline ::cereal::ModelData::PathData::Builder initRightLane(); + inline void adoptRightLane(::capnp::Orphan< ::cereal::ModelData::PathData>&& value); + inline ::capnp::Orphan< ::cereal::ModelData::PathData> disownRightLane(); + + inline bool hasLead(); + inline ::cereal::ModelData::LeadData::Builder getLead(); + inline void setLead( ::cereal::ModelData::LeadData::Reader value); + inline ::cereal::ModelData::LeadData::Builder initLead(); + inline void adoptLead(::capnp::Orphan< ::cereal::ModelData::LeadData>&& value); + inline ::capnp::Orphan< ::cereal::ModelData::LeadData> disownLead(); + + inline bool hasSettings(); + inline ::cereal::ModelData::ModelSettings::Builder getSettings(); + inline void setSettings( ::cereal::ModelData::ModelSettings::Reader value); + inline ::cereal::ModelData::ModelSettings::Builder initSettings(); + inline void adoptSettings(::capnp::Orphan< ::cereal::ModelData::ModelSettings>&& value); + inline ::capnp::Orphan< ::cereal::ModelData::ModelSettings> disownSettings(); + + inline bool hasFreePath(); + inline ::capnp::List::Builder getFreePath(); + inline void setFreePath( ::capnp::List::Reader value); + inline void setFreePath(::kj::ArrayPtr value); + inline ::capnp::List::Builder initFreePath(unsigned int size); + inline void adoptFreePath(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownFreePath(); + + inline bool hasLeadFuture(); + inline ::cereal::ModelData::LeadData::Builder getLeadFuture(); + inline void setLeadFuture( ::cereal::ModelData::LeadData::Reader value); + inline ::cereal::ModelData::LeadData::Builder initLeadFuture(); + inline void adoptLeadFuture(::capnp::Orphan< ::cereal::ModelData::LeadData>&& value); + inline ::capnp::Orphan< ::cereal::ModelData::LeadData> disownLeadFuture(); + + inline bool hasSpeed(); + inline ::capnp::List::Builder getSpeed(); + inline void setSpeed( ::capnp::List::Reader value); + inline void setSpeed(::kj::ArrayPtr value); + inline ::capnp::List::Builder initSpeed(unsigned int size); + inline void adoptSpeed(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownSpeed(); + + inline ::uint64_t getTimestampEof(); + inline void setTimestampEof( ::uint64_t value); + + inline bool hasMeta(); + inline ::cereal::ModelData::MetaData::Builder getMeta(); + inline void setMeta( ::cereal::ModelData::MetaData::Reader value); + inline ::cereal::ModelData::MetaData::Builder initMeta(); + inline void adoptMeta(::capnp::Orphan< ::cereal::ModelData::MetaData>&& value); + inline ::capnp::Orphan< ::cereal::ModelData::MetaData> disownMeta(); + + inline bool hasLongitudinal(); + inline ::cereal::ModelData::LongitudinalData::Builder getLongitudinal(); + inline void setLongitudinal( ::cereal::ModelData::LongitudinalData::Reader value); + inline ::cereal::ModelData::LongitudinalData::Builder initLongitudinal(); + inline void adoptLongitudinal(::capnp::Orphan< ::cereal::ModelData::LongitudinalData>&& value); + inline ::capnp::Orphan< ::cereal::ModelData::LongitudinalData> disownLongitudinal(); + + inline ::uint32_t getFrameAge(); + inline void setFrameAge( ::uint32_t value); + + inline float getFrameDropPerc(); + inline void setFrameDropPerc(float value); + + inline float getModelExecutionTime(); + inline void setModelExecutionTime(float value); + + inline bool hasRawPred(); + inline ::capnp::Data::Builder getRawPred(); + inline void setRawPred( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initRawPred(unsigned int size); + inline void adoptRawPred(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownRawPred(); + + inline float getGpuExecutionTime(); + inline void setGpuExecutionTime(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ModelData::Pipeline { +public: + typedef ModelData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::ModelData::PathData::Pipeline getPath(); + inline ::cereal::ModelData::PathData::Pipeline getLeftLane(); + inline ::cereal::ModelData::PathData::Pipeline getRightLane(); + inline ::cereal::ModelData::LeadData::Pipeline getLead(); + inline ::cereal::ModelData::ModelSettings::Pipeline getSettings(); + inline ::cereal::ModelData::LeadData::Pipeline getLeadFuture(); + inline ::cereal::ModelData::MetaData::Pipeline getMeta(); + inline ::cereal::ModelData::LongitudinalData::Pipeline getLongitudinal(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ModelData::PathData::Reader { +public: + typedef PathData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasPoints() const; + inline ::capnp::List::Reader getPoints() const; + + inline float getProb() const; + + inline float getStd() const; + + inline bool hasStds() const; + inline ::capnp::List::Reader getStds() const; + + inline bool hasPoly() const; + inline ::capnp::List::Reader getPoly() const; + + inline float getValidLen() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ModelData::PathData::Builder { +public: + typedef PathData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasPoints(); + inline ::capnp::List::Builder getPoints(); + inline void setPoints( ::capnp::List::Reader value); + inline void setPoints(::kj::ArrayPtr value); + inline ::capnp::List::Builder initPoints(unsigned int size); + inline void adoptPoints(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownPoints(); + + inline float getProb(); + inline void setProb(float value); + + inline float getStd(); + inline void setStd(float value); + + inline bool hasStds(); + inline ::capnp::List::Builder getStds(); + inline void setStds( ::capnp::List::Reader value); + inline void setStds(::kj::ArrayPtr value); + inline ::capnp::List::Builder initStds(unsigned int size); + inline void adoptStds(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownStds(); + + inline bool hasPoly(); + inline ::capnp::List::Builder getPoly(); + inline void setPoly( ::capnp::List::Reader value); + inline void setPoly(::kj::ArrayPtr value); + inline ::capnp::List::Builder initPoly(unsigned int size); + inline void adoptPoly(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownPoly(); + + inline float getValidLen(); + inline void setValidLen(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ModelData::PathData::Pipeline { +public: + typedef PathData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ModelData::LeadData::Reader { +public: + typedef LeadData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline float getDist() const; + + inline float getProb() const; + + inline float getStd() const; + + inline float getRelVel() const; + + inline float getRelVelStd() const; + + inline float getRelY() const; + + inline float getRelYStd() const; + + inline float getRelA() const; + + inline float getRelAStd() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ModelData::LeadData::Builder { +public: + typedef LeadData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline float getDist(); + inline void setDist(float value); + + inline float getProb(); + inline void setProb(float value); + + inline float getStd(); + inline void setStd(float value); + + inline float getRelVel(); + inline void setRelVel(float value); + + inline float getRelVelStd(); + inline void setRelVelStd(float value); + + inline float getRelY(); + inline void setRelY(float value); + + inline float getRelYStd(); + inline void setRelYStd(float value); + + inline float getRelA(); + inline void setRelA(float value); + + inline float getRelAStd(); + inline void setRelAStd(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ModelData::LeadData::Pipeline { +public: + typedef LeadData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ModelData::ModelSettings::Reader { +public: + typedef ModelSettings Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint16_t getBigBoxX() const; + + inline ::uint16_t getBigBoxY() const; + + inline ::uint16_t getBigBoxWidth() const; + + inline ::uint16_t getBigBoxHeight() const; + + inline bool hasBoxProjection() const; + inline ::capnp::List::Reader getBoxProjection() const; + + inline bool hasYuvCorrection() const; + inline ::capnp::List::Reader getYuvCorrection() const; + + inline bool hasInputTransform() const; + inline ::capnp::List::Reader getInputTransform() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ModelData::ModelSettings::Builder { +public: + typedef ModelSettings Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint16_t getBigBoxX(); + inline void setBigBoxX( ::uint16_t value); + + inline ::uint16_t getBigBoxY(); + inline void setBigBoxY( ::uint16_t value); + + inline ::uint16_t getBigBoxWidth(); + inline void setBigBoxWidth( ::uint16_t value); + + inline ::uint16_t getBigBoxHeight(); + inline void setBigBoxHeight( ::uint16_t value); + + inline bool hasBoxProjection(); + inline ::capnp::List::Builder getBoxProjection(); + inline void setBoxProjection( ::capnp::List::Reader value); + inline void setBoxProjection(::kj::ArrayPtr value); + inline ::capnp::List::Builder initBoxProjection(unsigned int size); + inline void adoptBoxProjection(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownBoxProjection(); + + inline bool hasYuvCorrection(); + inline ::capnp::List::Builder getYuvCorrection(); + inline void setYuvCorrection( ::capnp::List::Reader value); + inline void setYuvCorrection(::kj::ArrayPtr value); + inline ::capnp::List::Builder initYuvCorrection(unsigned int size); + inline void adoptYuvCorrection(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownYuvCorrection(); + + inline bool hasInputTransform(); + inline ::capnp::List::Builder getInputTransform(); + inline void setInputTransform( ::capnp::List::Reader value); + inline void setInputTransform(::kj::ArrayPtr value); + inline ::capnp::List::Builder initInputTransform(unsigned int size); + inline void adoptInputTransform(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownInputTransform(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ModelData::ModelSettings::Pipeline { +public: + typedef ModelSettings Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ModelData::MetaData::Reader { +public: + typedef MetaData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline float getEngagedProb() const; + + inline bool hasDesirePrediction() const; + inline ::capnp::List::Reader getDesirePrediction() const; + + inline float getBrakeDisengageProb() const; + + inline float getGasDisengageProb() const; + + inline float getSteerOverrideProb() const; + + inline bool hasDesireState() const; + inline ::capnp::List::Reader getDesireState() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ModelData::MetaData::Builder { +public: + typedef MetaData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline float getEngagedProb(); + inline void setEngagedProb(float value); + + inline bool hasDesirePrediction(); + inline ::capnp::List::Builder getDesirePrediction(); + inline void setDesirePrediction( ::capnp::List::Reader value); + inline void setDesirePrediction(::kj::ArrayPtr value); + inline ::capnp::List::Builder initDesirePrediction(unsigned int size); + inline void adoptDesirePrediction(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownDesirePrediction(); + + inline float getBrakeDisengageProb(); + inline void setBrakeDisengageProb(float value); + + inline float getGasDisengageProb(); + inline void setGasDisengageProb(float value); + + inline float getSteerOverrideProb(); + inline void setSteerOverrideProb(float value); + + inline bool hasDesireState(); + inline ::capnp::List::Builder getDesireState(); + inline void setDesireState( ::capnp::List::Reader value); + inline void setDesireState(::kj::ArrayPtr value); + inline ::capnp::List::Builder initDesireState(unsigned int size); + inline void adoptDesireState(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownDesireState(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ModelData::MetaData::Pipeline { +public: + typedef MetaData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ModelData::LongitudinalData::Reader { +public: + typedef LongitudinalData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasSpeeds() const; + inline ::capnp::List::Reader getSpeeds() const; + + inline bool hasAccelerations() const; + inline ::capnp::List::Reader getAccelerations() const; + + inline bool hasDistances() const; + inline ::capnp::List::Reader getDistances() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ModelData::LongitudinalData::Builder { +public: + typedef LongitudinalData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasSpeeds(); + inline ::capnp::List::Builder getSpeeds(); + inline void setSpeeds( ::capnp::List::Reader value); + inline void setSpeeds(::kj::ArrayPtr value); + inline ::capnp::List::Builder initSpeeds(unsigned int size); + inline void adoptSpeeds(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownSpeeds(); + + inline bool hasAccelerations(); + inline ::capnp::List::Builder getAccelerations(); + inline void setAccelerations( ::capnp::List::Reader value); + inline void setAccelerations(::kj::ArrayPtr value); + inline ::capnp::List::Builder initAccelerations(unsigned int size); + inline void adoptAccelerations(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownAccelerations(); + + inline bool hasDistances(); + inline ::capnp::List::Builder getDistances(); + inline void setDistances( ::capnp::List::Reader value); + inline void setDistances(::kj::ArrayPtr value); + inline ::capnp::List::Builder initDistances(unsigned int size); + inline void adoptDistances(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownDistances(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ModelData::LongitudinalData::Pipeline { +public: + typedef LongitudinalData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ECEFPoint::Reader { +public: + typedef ECEFPoint Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline double getX() const; + + inline double getY() const; + + inline double getZ() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ECEFPoint::Builder { +public: + typedef ECEFPoint Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline double getX(); + inline void setX(double value); + + inline double getY(); + inline void setY(double value); + + inline double getZ(); + inline void setZ(double value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ECEFPoint::Pipeline { +public: + typedef ECEFPoint Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ECEFPointDEPRECATED::Reader { +public: + typedef ECEFPointDEPRECATED Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline float getX() const; + + inline float getY() const; + + inline float getZ() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ECEFPointDEPRECATED::Builder { +public: + typedef ECEFPointDEPRECATED Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline float getX(); + inline void setX(float value); + + inline float getY(); + inline void setY(float value); + + inline float getZ(); + inline void setZ(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ECEFPointDEPRECATED::Pipeline { +public: + typedef ECEFPointDEPRECATED Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class GPSPlannerPoints::Reader { +public: + typedef GPSPlannerPoints Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasCurPosDEPRECATED() const; + inline ::cereal::ECEFPointDEPRECATED::Reader getCurPosDEPRECATED() const; + + inline bool hasPointsDEPRECATED() const; + inline ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Reader getPointsDEPRECATED() const; + + inline bool getValid() const; + + inline bool hasTrackName() const; + inline ::capnp::Text::Reader getTrackName() const; + + inline float getSpeedLimit() const; + + inline float getAccelTarget() const; + + inline bool hasCurPos() const; + inline ::cereal::ECEFPoint::Reader getCurPos() const; + + inline bool hasPoints() const; + inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Reader getPoints() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class GPSPlannerPoints::Builder { +public: + typedef GPSPlannerPoints Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasCurPosDEPRECATED(); + inline ::cereal::ECEFPointDEPRECATED::Builder getCurPosDEPRECATED(); + inline void setCurPosDEPRECATED( ::cereal::ECEFPointDEPRECATED::Reader value); + inline ::cereal::ECEFPointDEPRECATED::Builder initCurPosDEPRECATED(); + inline void adoptCurPosDEPRECATED(::capnp::Orphan< ::cereal::ECEFPointDEPRECATED>&& value); + inline ::capnp::Orphan< ::cereal::ECEFPointDEPRECATED> disownCurPosDEPRECATED(); + + inline bool hasPointsDEPRECATED(); + inline ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Builder getPointsDEPRECATED(); + inline void setPointsDEPRECATED( ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Builder initPointsDEPRECATED(unsigned int size); + inline void adoptPointsDEPRECATED(::capnp::Orphan< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>> disownPointsDEPRECATED(); + + inline bool getValid(); + inline void setValid(bool value); + + inline bool hasTrackName(); + inline ::capnp::Text::Builder getTrackName(); + inline void setTrackName( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initTrackName(unsigned int size); + inline void adoptTrackName(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownTrackName(); + + inline float getSpeedLimit(); + inline void setSpeedLimit(float value); + + inline float getAccelTarget(); + inline void setAccelTarget(float value); + + inline bool hasCurPos(); + inline ::cereal::ECEFPoint::Builder getCurPos(); + inline void setCurPos( ::cereal::ECEFPoint::Reader value); + inline ::cereal::ECEFPoint::Builder initCurPos(); + inline void adoptCurPos(::capnp::Orphan< ::cereal::ECEFPoint>&& value); + inline ::capnp::Orphan< ::cereal::ECEFPoint> disownCurPos(); + + inline bool hasPoints(); + inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Builder getPoints(); + inline void setPoints( ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Builder initPoints(unsigned int size); + inline void adoptPoints(::capnp::Orphan< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>> disownPoints(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class GPSPlannerPoints::Pipeline { +public: + typedef GPSPlannerPoints Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::ECEFPointDEPRECATED::Pipeline getCurPosDEPRECATED(); + inline ::cereal::ECEFPoint::Pipeline getCurPos(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class GPSPlannerPlan::Reader { +public: + typedef GPSPlannerPlan Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getValid() const; + + inline bool hasPoly() const; + inline ::capnp::List::Reader getPoly() const; + + inline bool hasTrackName() const; + inline ::capnp::Text::Reader getTrackName() const; + + inline float getSpeed() const; + + inline float getAcceleration() const; + + inline bool hasPointsDEPRECATED() const; + inline ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Reader getPointsDEPRECATED() const; + + inline bool hasPoints() const; + inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Reader getPoints() const; + + inline float getXLookahead() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class GPSPlannerPlan::Builder { +public: + typedef GPSPlannerPlan Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getValid(); + inline void setValid(bool value); + + inline bool hasPoly(); + inline ::capnp::List::Builder getPoly(); + inline void setPoly( ::capnp::List::Reader value); + inline void setPoly(::kj::ArrayPtr value); + inline ::capnp::List::Builder initPoly(unsigned int size); + inline void adoptPoly(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownPoly(); + + inline bool hasTrackName(); + inline ::capnp::Text::Builder getTrackName(); + inline void setTrackName( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initTrackName(unsigned int size); + inline void adoptTrackName(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownTrackName(); + + inline float getSpeed(); + inline void setSpeed(float value); + + inline float getAcceleration(); + inline void setAcceleration(float value); + + inline bool hasPointsDEPRECATED(); + inline ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Builder getPointsDEPRECATED(); + inline void setPointsDEPRECATED( ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Builder initPointsDEPRECATED(unsigned int size); + inline void adoptPointsDEPRECATED(::capnp::Orphan< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>> disownPointsDEPRECATED(); + + inline bool hasPoints(); + inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Builder getPoints(); + inline void setPoints( ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Builder initPoints(unsigned int size); + inline void adoptPoints(::capnp::Orphan< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>> disownPoints(); + + inline float getXLookahead(); + inline void setXLookahead(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class GPSPlannerPlan::Pipeline { +public: + typedef GPSPlannerPlan Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class UiNavigationEvent::Reader { +public: + typedef UiNavigationEvent Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::cereal::UiNavigationEvent::Type getType() const; + + inline ::cereal::UiNavigationEvent::Status getStatus() const; + + inline float getDistanceTo() const; + + inline bool hasEndRoadPointDEPRECATED() const; + inline ::cereal::ECEFPointDEPRECATED::Reader getEndRoadPointDEPRECATED() const; + + inline bool hasEndRoadPoint() const; + inline ::cereal::ECEFPoint::Reader getEndRoadPoint() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class UiNavigationEvent::Builder { +public: + typedef UiNavigationEvent Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::cereal::UiNavigationEvent::Type getType(); + inline void setType( ::cereal::UiNavigationEvent::Type value); + + inline ::cereal::UiNavigationEvent::Status getStatus(); + inline void setStatus( ::cereal::UiNavigationEvent::Status value); + + inline float getDistanceTo(); + inline void setDistanceTo(float value); + + inline bool hasEndRoadPointDEPRECATED(); + inline ::cereal::ECEFPointDEPRECATED::Builder getEndRoadPointDEPRECATED(); + inline void setEndRoadPointDEPRECATED( ::cereal::ECEFPointDEPRECATED::Reader value); + inline ::cereal::ECEFPointDEPRECATED::Builder initEndRoadPointDEPRECATED(); + inline void adoptEndRoadPointDEPRECATED(::capnp::Orphan< ::cereal::ECEFPointDEPRECATED>&& value); + inline ::capnp::Orphan< ::cereal::ECEFPointDEPRECATED> disownEndRoadPointDEPRECATED(); + + inline bool hasEndRoadPoint(); + inline ::cereal::ECEFPoint::Builder getEndRoadPoint(); + inline void setEndRoadPoint( ::cereal::ECEFPoint::Reader value); + inline ::cereal::ECEFPoint::Builder initEndRoadPoint(); + inline void adoptEndRoadPoint(::capnp::Orphan< ::cereal::ECEFPoint>&& value); + inline ::capnp::Orphan< ::cereal::ECEFPoint> disownEndRoadPoint(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class UiNavigationEvent::Pipeline { +public: + typedef UiNavigationEvent Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::ECEFPointDEPRECATED::Pipeline getEndRoadPointDEPRECATED(); + inline ::cereal::ECEFPoint::Pipeline getEndRoadPoint(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LiveLocationData::Reader { +public: + typedef LiveLocationData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint8_t getStatus() const; + + inline double getLat() const; + + inline double getLon() const; + + inline float getAlt() const; + + inline float getSpeed() const; + + inline bool hasVNED() const; + inline ::capnp::List::Reader getVNED() const; + + inline float getRoll() const; + + inline float getPitch() const; + + inline float getHeading() const; + + inline float getWanderAngle() const; + + inline float getTrackAngle() const; + + inline bool hasGyro() const; + inline ::capnp::List::Reader getGyro() const; + + inline bool hasAccel() const; + inline ::capnp::List::Reader getAccel() const; + + inline bool hasAccuracy() const; + inline ::cereal::LiveLocationData::Accuracy::Reader getAccuracy() const; + + inline ::cereal::LiveLocationData::SensorSource getSource() const; + + inline ::uint64_t getFixMonoTime() const; + + inline ::int32_t getGpsWeek() const; + + inline double getTimeOfWeek() const; + + inline bool hasPositionECEF() const; + inline ::capnp::List::Reader getPositionECEF() const; + + inline bool hasPoseQuatECEF() const; + inline ::capnp::List::Reader getPoseQuatECEF() const; + + inline float getPitchCalibration() const; + + inline float getYawCalibration() const; + + inline bool hasImuFrame() const; + inline ::capnp::List::Reader getImuFrame() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LiveLocationData::Builder { +public: + typedef LiveLocationData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint8_t getStatus(); + inline void setStatus( ::uint8_t value); + + inline double getLat(); + inline void setLat(double value); + + inline double getLon(); + inline void setLon(double value); + + inline float getAlt(); + inline void setAlt(float value); + + inline float getSpeed(); + inline void setSpeed(float value); + + inline bool hasVNED(); + inline ::capnp::List::Builder getVNED(); + inline void setVNED( ::capnp::List::Reader value); + inline void setVNED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initVNED(unsigned int size); + inline void adoptVNED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownVNED(); + + inline float getRoll(); + inline void setRoll(float value); + + inline float getPitch(); + inline void setPitch(float value); + + inline float getHeading(); + inline void setHeading(float value); + + inline float getWanderAngle(); + inline void setWanderAngle(float value); + + inline float getTrackAngle(); + inline void setTrackAngle(float value); + + inline bool hasGyro(); + inline ::capnp::List::Builder getGyro(); + inline void setGyro( ::capnp::List::Reader value); + inline void setGyro(::kj::ArrayPtr value); + inline ::capnp::List::Builder initGyro(unsigned int size); + inline void adoptGyro(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownGyro(); + + inline bool hasAccel(); + inline ::capnp::List::Builder getAccel(); + inline void setAccel( ::capnp::List::Reader value); + inline void setAccel(::kj::ArrayPtr value); + inline ::capnp::List::Builder initAccel(unsigned int size); + inline void adoptAccel(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownAccel(); + + inline bool hasAccuracy(); + inline ::cereal::LiveLocationData::Accuracy::Builder getAccuracy(); + inline void setAccuracy( ::cereal::LiveLocationData::Accuracy::Reader value); + inline ::cereal::LiveLocationData::Accuracy::Builder initAccuracy(); + inline void adoptAccuracy(::capnp::Orphan< ::cereal::LiveLocationData::Accuracy>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationData::Accuracy> disownAccuracy(); + + inline ::cereal::LiveLocationData::SensorSource getSource(); + inline void setSource( ::cereal::LiveLocationData::SensorSource value); + + inline ::uint64_t getFixMonoTime(); + inline void setFixMonoTime( ::uint64_t value); + + inline ::int32_t getGpsWeek(); + inline void setGpsWeek( ::int32_t value); + + inline double getTimeOfWeek(); + inline void setTimeOfWeek(double value); + + inline bool hasPositionECEF(); + inline ::capnp::List::Builder getPositionECEF(); + inline void setPositionECEF( ::capnp::List::Reader value); + inline void setPositionECEF(::kj::ArrayPtr value); + inline ::capnp::List::Builder initPositionECEF(unsigned int size); + inline void adoptPositionECEF(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownPositionECEF(); + + inline bool hasPoseQuatECEF(); + inline ::capnp::List::Builder getPoseQuatECEF(); + inline void setPoseQuatECEF( ::capnp::List::Reader value); + inline void setPoseQuatECEF(::kj::ArrayPtr value); + inline ::capnp::List::Builder initPoseQuatECEF(unsigned int size); + inline void adoptPoseQuatECEF(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownPoseQuatECEF(); + + inline float getPitchCalibration(); + inline void setPitchCalibration(float value); + + inline float getYawCalibration(); + inline void setYawCalibration(float value); + + inline bool hasImuFrame(); + inline ::capnp::List::Builder getImuFrame(); + inline void setImuFrame( ::capnp::List::Reader value); + inline void setImuFrame(::kj::ArrayPtr value); + inline ::capnp::List::Builder initImuFrame(unsigned int size); + inline void adoptImuFrame(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownImuFrame(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LiveLocationData::Pipeline { +public: + typedef LiveLocationData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::LiveLocationData::Accuracy::Pipeline getAccuracy(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LiveLocationData::Accuracy::Reader { +public: + typedef Accuracy Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasPNEDError() const; + inline ::capnp::List::Reader getPNEDError() const; + + inline bool hasVNEDError() const; + inline ::capnp::List::Reader getVNEDError() const; + + inline float getRollError() const; + + inline float getPitchError() const; + + inline float getHeadingError() const; + + inline float getEllipsoidSemiMajorError() const; + + inline float getEllipsoidSemiMinorError() const; + + inline float getEllipsoidOrientationError() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LiveLocationData::Accuracy::Builder { +public: + typedef Accuracy Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasPNEDError(); + inline ::capnp::List::Builder getPNEDError(); + inline void setPNEDError( ::capnp::List::Reader value); + inline void setPNEDError(::kj::ArrayPtr value); + inline ::capnp::List::Builder initPNEDError(unsigned int size); + inline void adoptPNEDError(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownPNEDError(); + + inline bool hasVNEDError(); + inline ::capnp::List::Builder getVNEDError(); + inline void setVNEDError( ::capnp::List::Reader value); + inline void setVNEDError(::kj::ArrayPtr value); + inline ::capnp::List::Builder initVNEDError(unsigned int size); + inline void adoptVNEDError(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownVNEDError(); + + inline float getRollError(); + inline void setRollError(float value); + + inline float getPitchError(); + inline void setPitchError(float value); + + inline float getHeadingError(); + inline void setHeadingError(float value); + + inline float getEllipsoidSemiMajorError(); + inline void setEllipsoidSemiMajorError(float value); + + inline float getEllipsoidSemiMinorError(); + inline void setEllipsoidSemiMinorError(float value); + + inline float getEllipsoidOrientationError(); + inline void setEllipsoidOrientationError(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LiveLocationData::Accuracy::Pipeline { +public: + typedef Accuracy Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class OrbOdometry::Reader { +public: + typedef OrbOdometry Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint64_t getStartMonoTime() const; + + inline ::uint64_t getEndMonoTime() const; + + inline bool hasF() const; + inline ::capnp::List::Reader getF() const; + + inline double getErr() const; + + inline ::int32_t getInliers() const; + + inline bool hasMatches() const; + inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Reader getMatches() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class OrbOdometry::Builder { +public: + typedef OrbOdometry Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint64_t getStartMonoTime(); + inline void setStartMonoTime( ::uint64_t value); + + inline ::uint64_t getEndMonoTime(); + inline void setEndMonoTime( ::uint64_t value); + + inline bool hasF(); + inline ::capnp::List::Builder getF(); + inline void setF( ::capnp::List::Reader value); + inline void setF(::kj::ArrayPtr value); + inline ::capnp::List::Builder initF(unsigned int size); + inline void adoptF(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownF(); + + inline double getErr(); + inline void setErr(double value); + + inline ::int32_t getInliers(); + inline void setInliers( ::int32_t value); + + inline bool hasMatches(); + inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Builder getMatches(); + inline void setMatches( ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setMatches(::kj::ArrayPtr value); + inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Builder initMatches(unsigned int size); + inline void adoptMatches(::capnp::Orphan< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>> disownMatches(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class OrbOdometry::Pipeline { +public: + typedef OrbOdometry Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class OrbFeatures::Reader { +public: + typedef OrbFeatures Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint64_t getTimestampEof() const; + + inline bool hasXs() const; + inline ::capnp::List::Reader getXs() const; + + inline bool hasYs() const; + inline ::capnp::List::Reader getYs() const; + + inline bool hasDescriptors() const; + inline ::capnp::Data::Reader getDescriptors() const; + + inline bool hasOctaves() const; + inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Reader getOctaves() const; + + inline ::uint64_t getTimestampLastEof() const; + + inline bool hasMatches() const; + inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Reader getMatches() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class OrbFeatures::Builder { +public: + typedef OrbFeatures Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint64_t getTimestampEof(); + inline void setTimestampEof( ::uint64_t value); + + inline bool hasXs(); + inline ::capnp::List::Builder getXs(); + inline void setXs( ::capnp::List::Reader value); + inline void setXs(::kj::ArrayPtr value); + inline ::capnp::List::Builder initXs(unsigned int size); + inline void adoptXs(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownXs(); + + inline bool hasYs(); + inline ::capnp::List::Builder getYs(); + inline void setYs( ::capnp::List::Reader value); + inline void setYs(::kj::ArrayPtr value); + inline ::capnp::List::Builder initYs(unsigned int size); + inline void adoptYs(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownYs(); + + inline bool hasDescriptors(); + inline ::capnp::Data::Builder getDescriptors(); + inline void setDescriptors( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initDescriptors(unsigned int size); + inline void adoptDescriptors(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownDescriptors(); + + inline bool hasOctaves(); + inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Builder getOctaves(); + inline void setOctaves( ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setOctaves(::kj::ArrayPtr value); + inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Builder initOctaves(unsigned int size); + inline void adoptOctaves(::capnp::Orphan< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>> disownOctaves(); + + inline ::uint64_t getTimestampLastEof(); + inline void setTimestampLastEof( ::uint64_t value); + + inline bool hasMatches(); + inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Builder getMatches(); + inline void setMatches( ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setMatches(::kj::ArrayPtr value); + inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Builder initMatches(unsigned int size); + inline void adoptMatches(::capnp::Orphan< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>> disownMatches(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class OrbFeatures::Pipeline { +public: + typedef OrbFeatures Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class OrbFeaturesSummary::Reader { +public: + typedef OrbFeaturesSummary Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint64_t getTimestampEof() const; + + inline ::uint64_t getTimestampLastEof() const; + + inline ::uint16_t getFeatureCount() const; + + inline ::uint16_t getMatchCount() const; + + inline ::uint64_t getComputeNs() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class OrbFeaturesSummary::Builder { +public: + typedef OrbFeaturesSummary Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint64_t getTimestampEof(); + inline void setTimestampEof( ::uint64_t value); + + inline ::uint64_t getTimestampLastEof(); + inline void setTimestampLastEof( ::uint64_t value); + + inline ::uint16_t getFeatureCount(); + inline void setFeatureCount( ::uint16_t value); + + inline ::uint16_t getMatchCount(); + inline void setMatchCount( ::uint16_t value); + + inline ::uint64_t getComputeNs(); + inline void setComputeNs( ::uint64_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class OrbFeaturesSummary::Pipeline { +public: + typedef OrbFeaturesSummary Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class OrbKeyFrame::Reader { +public: + typedef OrbKeyFrame Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint64_t getId() const; + + inline bool hasPos() const; + inline ::cereal::ECEFPoint::Reader getPos() const; + + inline bool hasDpos() const; + inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Reader getDpos() const; + + inline bool hasDescriptors() const; + inline ::capnp::Data::Reader getDescriptors() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class OrbKeyFrame::Builder { +public: + typedef OrbKeyFrame Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint64_t getId(); + inline void setId( ::uint64_t value); + + inline bool hasPos(); + inline ::cereal::ECEFPoint::Builder getPos(); + inline void setPos( ::cereal::ECEFPoint::Reader value); + inline ::cereal::ECEFPoint::Builder initPos(); + inline void adoptPos(::capnp::Orphan< ::cereal::ECEFPoint>&& value); + inline ::capnp::Orphan< ::cereal::ECEFPoint> disownPos(); + + inline bool hasDpos(); + inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Builder getDpos(); + inline void setDpos( ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Builder initDpos(unsigned int size); + inline void adoptDpos(::capnp::Orphan< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>> disownDpos(); + + inline bool hasDescriptors(); + inline ::capnp::Data::Builder getDescriptors(); + inline void setDescriptors( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initDescriptors(unsigned int size); + inline void adoptDescriptors(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownDescriptors(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class OrbKeyFrame::Pipeline { +public: + typedef OrbKeyFrame Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::ECEFPoint::Pipeline getPos(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class KalmanOdometry::Reader { +public: + typedef KalmanOdometry Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasTrans() const; + inline ::capnp::List::Reader getTrans() const; + + inline bool hasRot() const; + inline ::capnp::List::Reader getRot() const; + + inline bool hasTransStd() const; + inline ::capnp::List::Reader getTransStd() const; + + inline bool hasRotStd() const; + inline ::capnp::List::Reader getRotStd() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class KalmanOdometry::Builder { +public: + typedef KalmanOdometry Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasTrans(); + inline ::capnp::List::Builder getTrans(); + inline void setTrans( ::capnp::List::Reader value); + inline void setTrans(::kj::ArrayPtr value); + inline ::capnp::List::Builder initTrans(unsigned int size); + inline void adoptTrans(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownTrans(); + + inline bool hasRot(); + inline ::capnp::List::Builder getRot(); + inline void setRot( ::capnp::List::Reader value); + inline void setRot(::kj::ArrayPtr value); + inline ::capnp::List::Builder initRot(unsigned int size); + inline void adoptRot(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownRot(); + + inline bool hasTransStd(); + inline ::capnp::List::Builder getTransStd(); + inline void setTransStd( ::capnp::List::Reader value); + inline void setTransStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initTransStd(unsigned int size); + inline void adoptTransStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownTransStd(); + + inline bool hasRotStd(); + inline ::capnp::List::Builder getRotStd(); + inline void setRotStd( ::capnp::List::Reader value); + inline void setRotStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initRotStd(unsigned int size); + inline void adoptRotStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownRotStd(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class KalmanOdometry::Pipeline { +public: + typedef KalmanOdometry Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class OrbObservation::Reader { +public: + typedef OrbObservation Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint64_t getObservationMonoTime() const; + + inline bool hasNormalizedCoordinates() const; + inline ::capnp::List::Reader getNormalizedCoordinates() const; + + inline bool hasLocationECEF() const; + inline ::capnp::List::Reader getLocationECEF() const; + + inline ::uint32_t getMatchDistance() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class OrbObservation::Builder { +public: + typedef OrbObservation Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint64_t getObservationMonoTime(); + inline void setObservationMonoTime( ::uint64_t value); + + inline bool hasNormalizedCoordinates(); + inline ::capnp::List::Builder getNormalizedCoordinates(); + inline void setNormalizedCoordinates( ::capnp::List::Reader value); + inline void setNormalizedCoordinates(::kj::ArrayPtr value); + inline ::capnp::List::Builder initNormalizedCoordinates(unsigned int size); + inline void adoptNormalizedCoordinates(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownNormalizedCoordinates(); + + inline bool hasLocationECEF(); + inline ::capnp::List::Builder getLocationECEF(); + inline void setLocationECEF( ::capnp::List::Reader value); + inline void setLocationECEF(::kj::ArrayPtr value); + inline ::capnp::List::Builder initLocationECEF(unsigned int size); + inline void adoptLocationECEF(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownLocationECEF(); + + inline ::uint32_t getMatchDistance(); + inline void setMatchDistance( ::uint32_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class OrbObservation::Pipeline { +public: + typedef OrbObservation Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CalibrationFeatures::Reader { +public: + typedef CalibrationFeatures Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint32_t getFrameId() const; + + inline bool hasP0() const; + inline ::capnp::List::Reader getP0() const; + + inline bool hasP1() const; + inline ::capnp::List::Reader getP1() const; + + inline bool hasStatus() const; + inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Reader getStatus() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CalibrationFeatures::Builder { +public: + typedef CalibrationFeatures Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint32_t getFrameId(); + inline void setFrameId( ::uint32_t value); + + inline bool hasP0(); + inline ::capnp::List::Builder getP0(); + inline void setP0( ::capnp::List::Reader value); + inline void setP0(::kj::ArrayPtr value); + inline ::capnp::List::Builder initP0(unsigned int size); + inline void adoptP0(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownP0(); + + inline bool hasP1(); + inline ::capnp::List::Builder getP1(); + inline void setP1( ::capnp::List::Reader value); + inline void setP1(::kj::ArrayPtr value); + inline ::capnp::List::Builder initP1(unsigned int size); + inline void adoptP1(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownP1(); + + inline bool hasStatus(); + inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Builder getStatus(); + inline void setStatus( ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setStatus(::kj::ArrayPtr value); + inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Builder initStatus(unsigned int size); + inline void adoptStatus(::capnp::Orphan< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>> disownStatus(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CalibrationFeatures::Pipeline { +public: + typedef CalibrationFeatures Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class NavStatus::Reader { +public: + typedef NavStatus Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getIsNavigating() const; + + inline bool hasCurrentAddress() const; + inline ::cereal::NavStatus::Address::Reader getCurrentAddress() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class NavStatus::Builder { +public: + typedef NavStatus Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getIsNavigating(); + inline void setIsNavigating(bool value); + + inline bool hasCurrentAddress(); + inline ::cereal::NavStatus::Address::Builder getCurrentAddress(); + inline void setCurrentAddress( ::cereal::NavStatus::Address::Reader value); + inline ::cereal::NavStatus::Address::Builder initCurrentAddress(); + inline void adoptCurrentAddress(::capnp::Orphan< ::cereal::NavStatus::Address>&& value); + inline ::capnp::Orphan< ::cereal::NavStatus::Address> disownCurrentAddress(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class NavStatus::Pipeline { +public: + typedef NavStatus Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::NavStatus::Address::Pipeline getCurrentAddress(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class NavStatus::Address::Reader { +public: + typedef Address Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasTitle() const; + inline ::capnp::Text::Reader getTitle() const; + + inline double getLat() const; + + inline double getLng() const; + + inline bool hasHouse() const; + inline ::capnp::Text::Reader getHouse() const; + + inline bool hasAddress() const; + inline ::capnp::Text::Reader getAddress() const; + + inline bool hasStreet() const; + inline ::capnp::Text::Reader getStreet() const; + + inline bool hasCity() const; + inline ::capnp::Text::Reader getCity() const; + + inline bool hasState() const; + inline ::capnp::Text::Reader getState() const; + + inline bool hasCountry() const; + inline ::capnp::Text::Reader getCountry() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class NavStatus::Address::Builder { +public: + typedef Address Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasTitle(); + inline ::capnp::Text::Builder getTitle(); + inline void setTitle( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initTitle(unsigned int size); + inline void adoptTitle(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownTitle(); + + inline double getLat(); + inline void setLat(double value); + + inline double getLng(); + inline void setLng(double value); + + inline bool hasHouse(); + inline ::capnp::Text::Builder getHouse(); + inline void setHouse( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initHouse(unsigned int size); + inline void adoptHouse(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownHouse(); + + inline bool hasAddress(); + inline ::capnp::Text::Builder getAddress(); + inline void setAddress( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initAddress(unsigned int size); + inline void adoptAddress(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownAddress(); + + inline bool hasStreet(); + inline ::capnp::Text::Builder getStreet(); + inline void setStreet( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initStreet(unsigned int size); + inline void adoptStreet(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownStreet(); + + inline bool hasCity(); + inline ::capnp::Text::Builder getCity(); + inline void setCity( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initCity(unsigned int size); + inline void adoptCity(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownCity(); + + inline bool hasState(); + inline ::capnp::Text::Builder getState(); + inline void setState( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initState(unsigned int size); + inline void adoptState(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownState(); + + inline bool hasCountry(); + inline ::capnp::Text::Builder getCountry(); + inline void setCountry( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initCountry(unsigned int size); + inline void adoptCountry(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownCountry(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class NavStatus::Address::Pipeline { +public: + typedef Address Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class NavUpdate::Reader { +public: + typedef NavUpdate Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getIsNavigating() const; + + inline ::int32_t getCurSegment() const; + + inline bool hasSegments() const; + inline ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>::Reader getSegments() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class NavUpdate::Builder { +public: + typedef NavUpdate Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getIsNavigating(); + inline void setIsNavigating(bool value); + + inline ::int32_t getCurSegment(); + inline void setCurSegment( ::int32_t value); + + inline bool hasSegments(); + inline ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>::Builder getSegments(); + inline void setSegments( ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>::Builder initSegments(unsigned int size); + inline void adoptSegments(::capnp::Orphan< ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>> disownSegments(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class NavUpdate::Pipeline { +public: + typedef NavUpdate Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class NavUpdate::LatLng::Reader { +public: + typedef LatLng Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline double getLat() const; + + inline double getLng() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class NavUpdate::LatLng::Builder { +public: + typedef LatLng Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline double getLat(); + inline void setLat(double value); + + inline double getLng(); + inline void setLng(double value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class NavUpdate::LatLng::Pipeline { +public: + typedef LatLng Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class NavUpdate::Segment::Reader { +public: + typedef Segment Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasFrom() const; + inline ::cereal::NavUpdate::LatLng::Reader getFrom() const; + + inline bool hasTo() const; + inline ::cereal::NavUpdate::LatLng::Reader getTo() const; + + inline ::int32_t getUpdateTime() const; + + inline ::int32_t getDistance() const; + + inline ::int32_t getCrossTime() const; + + inline ::int32_t getExitNo() const; + + inline ::cereal::NavUpdate::Segment::Instruction getInstruction() const; + + inline bool hasParts() const; + inline ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>::Reader getParts() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class NavUpdate::Segment::Builder { +public: + typedef Segment Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasFrom(); + inline ::cereal::NavUpdate::LatLng::Builder getFrom(); + inline void setFrom( ::cereal::NavUpdate::LatLng::Reader value); + inline ::cereal::NavUpdate::LatLng::Builder initFrom(); + inline void adoptFrom(::capnp::Orphan< ::cereal::NavUpdate::LatLng>&& value); + inline ::capnp::Orphan< ::cereal::NavUpdate::LatLng> disownFrom(); + + inline bool hasTo(); + inline ::cereal::NavUpdate::LatLng::Builder getTo(); + inline void setTo( ::cereal::NavUpdate::LatLng::Reader value); + inline ::cereal::NavUpdate::LatLng::Builder initTo(); + inline void adoptTo(::capnp::Orphan< ::cereal::NavUpdate::LatLng>&& value); + inline ::capnp::Orphan< ::cereal::NavUpdate::LatLng> disownTo(); + + inline ::int32_t getUpdateTime(); + inline void setUpdateTime( ::int32_t value); + + inline ::int32_t getDistance(); + inline void setDistance( ::int32_t value); + + inline ::int32_t getCrossTime(); + inline void setCrossTime( ::int32_t value); + + inline ::int32_t getExitNo(); + inline void setExitNo( ::int32_t value); + + inline ::cereal::NavUpdate::Segment::Instruction getInstruction(); + inline void setInstruction( ::cereal::NavUpdate::Segment::Instruction value); + + inline bool hasParts(); + inline ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>::Builder getParts(); + inline void setParts( ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>::Builder initParts(unsigned int size); + inline void adoptParts(::capnp::Orphan< ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>> disownParts(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class NavUpdate::Segment::Pipeline { +public: + typedef Segment Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::NavUpdate::LatLng::Pipeline getFrom(); + inline ::cereal::NavUpdate::LatLng::Pipeline getTo(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class TrafficEvent::Reader { +public: + typedef TrafficEvent Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::cereal::TrafficEvent::Type getType() const; + + inline float getDistance() const; + + inline ::cereal::TrafficEvent::Action getAction() const; + + inline bool getResuming() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class TrafficEvent::Builder { +public: + typedef TrafficEvent Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::cereal::TrafficEvent::Type getType(); + inline void setType( ::cereal::TrafficEvent::Type value); + + inline float getDistance(); + inline void setDistance(float value); + + inline ::cereal::TrafficEvent::Action getAction(); + inline void setAction( ::cereal::TrafficEvent::Action value); + + inline bool getResuming(); + inline void setResuming(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class TrafficEvent::Pipeline { +public: + typedef TrafficEvent Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class AndroidGnss::Reader { +public: + typedef AndroidGnss Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline Which which() const; + inline bool isMeasurements() const; + inline bool hasMeasurements() const; + inline ::cereal::AndroidGnss::Measurements::Reader getMeasurements() const; + + inline bool isNavigationMessage() const; + inline bool hasNavigationMessage() const; + inline ::cereal::AndroidGnss::NavigationMessage::Reader getNavigationMessage() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class AndroidGnss::Builder { +public: + typedef AndroidGnss Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline Which which(); + inline bool isMeasurements(); + inline bool hasMeasurements(); + inline ::cereal::AndroidGnss::Measurements::Builder getMeasurements(); + inline void setMeasurements( ::cereal::AndroidGnss::Measurements::Reader value); + inline ::cereal::AndroidGnss::Measurements::Builder initMeasurements(); + inline void adoptMeasurements(::capnp::Orphan< ::cereal::AndroidGnss::Measurements>&& value); + inline ::capnp::Orphan< ::cereal::AndroidGnss::Measurements> disownMeasurements(); + + inline bool isNavigationMessage(); + inline bool hasNavigationMessage(); + inline ::cereal::AndroidGnss::NavigationMessage::Builder getNavigationMessage(); + inline void setNavigationMessage( ::cereal::AndroidGnss::NavigationMessage::Reader value); + inline ::cereal::AndroidGnss::NavigationMessage::Builder initNavigationMessage(); + inline void adoptNavigationMessage(::capnp::Orphan< ::cereal::AndroidGnss::NavigationMessage>&& value); + inline ::capnp::Orphan< ::cereal::AndroidGnss::NavigationMessage> disownNavigationMessage(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class AndroidGnss::Pipeline { +public: + typedef AndroidGnss Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class AndroidGnss::Measurements::Reader { +public: + typedef Measurements Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasClock() const; + inline ::cereal::AndroidGnss::Measurements::Clock::Reader getClock() const; + + inline bool hasMeasurements() const; + inline ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>::Reader getMeasurements() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class AndroidGnss::Measurements::Builder { +public: + typedef Measurements Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasClock(); + inline ::cereal::AndroidGnss::Measurements::Clock::Builder getClock(); + inline void setClock( ::cereal::AndroidGnss::Measurements::Clock::Reader value); + inline ::cereal::AndroidGnss::Measurements::Clock::Builder initClock(); + inline void adoptClock(::capnp::Orphan< ::cereal::AndroidGnss::Measurements::Clock>&& value); + inline ::capnp::Orphan< ::cereal::AndroidGnss::Measurements::Clock> disownClock(); + + inline bool hasMeasurements(); + inline ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>::Builder getMeasurements(); + inline void setMeasurements( ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>::Builder initMeasurements(unsigned int size); + inline void adoptMeasurements(::capnp::Orphan< ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>> disownMeasurements(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class AndroidGnss::Measurements::Pipeline { +public: + typedef Measurements Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::AndroidGnss::Measurements::Clock::Pipeline getClock(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class AndroidGnss::Measurements::Clock::Reader { +public: + typedef Clock Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::int64_t getTimeNanos() const; + + inline ::int32_t getHardwareClockDiscontinuityCount() const; + + inline bool getHasTimeUncertaintyNanos() const; + + inline double getTimeUncertaintyNanos() const; + + inline bool getHasLeapSecond() const; + + inline ::int32_t getLeapSecond() const; + + inline bool getHasFullBiasNanos() const; + + inline ::int64_t getFullBiasNanos() const; + + inline bool getHasBiasNanos() const; + + inline double getBiasNanos() const; + + inline bool getHasBiasUncertaintyNanos() const; + + inline double getBiasUncertaintyNanos() const; + + inline bool getHasDriftNanosPerSecond() const; + + inline double getDriftNanosPerSecond() const; + + inline bool getHasDriftUncertaintyNanosPerSecond() const; + + inline double getDriftUncertaintyNanosPerSecond() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class AndroidGnss::Measurements::Clock::Builder { +public: + typedef Clock Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::int64_t getTimeNanos(); + inline void setTimeNanos( ::int64_t value); + + inline ::int32_t getHardwareClockDiscontinuityCount(); + inline void setHardwareClockDiscontinuityCount( ::int32_t value); + + inline bool getHasTimeUncertaintyNanos(); + inline void setHasTimeUncertaintyNanos(bool value); + + inline double getTimeUncertaintyNanos(); + inline void setTimeUncertaintyNanos(double value); + + inline bool getHasLeapSecond(); + inline void setHasLeapSecond(bool value); + + inline ::int32_t getLeapSecond(); + inline void setLeapSecond( ::int32_t value); + + inline bool getHasFullBiasNanos(); + inline void setHasFullBiasNanos(bool value); + + inline ::int64_t getFullBiasNanos(); + inline void setFullBiasNanos( ::int64_t value); + + inline bool getHasBiasNanos(); + inline void setHasBiasNanos(bool value); + + inline double getBiasNanos(); + inline void setBiasNanos(double value); + + inline bool getHasBiasUncertaintyNanos(); + inline void setHasBiasUncertaintyNanos(bool value); + + inline double getBiasUncertaintyNanos(); + inline void setBiasUncertaintyNanos(double value); + + inline bool getHasDriftNanosPerSecond(); + inline void setHasDriftNanosPerSecond(bool value); + + inline double getDriftNanosPerSecond(); + inline void setDriftNanosPerSecond(double value); + + inline bool getHasDriftUncertaintyNanosPerSecond(); + inline void setHasDriftUncertaintyNanosPerSecond(bool value); + + inline double getDriftUncertaintyNanosPerSecond(); + inline void setDriftUncertaintyNanosPerSecond(double value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class AndroidGnss::Measurements::Clock::Pipeline { +public: + typedef Clock Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class AndroidGnss::Measurements::Measurement::Reader { +public: + typedef Measurement Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::int32_t getSvId() const; + + inline ::cereal::AndroidGnss::Measurements::Measurement::Constellation getConstellation() const; + + inline double getTimeOffsetNanos() const; + + inline ::int32_t getState() const; + + inline ::int64_t getReceivedSvTimeNanos() const; + + inline ::int64_t getReceivedSvTimeUncertaintyNanos() const; + + inline double getCn0DbHz() const; + + inline double getPseudorangeRateMetersPerSecond() const; + + inline double getPseudorangeRateUncertaintyMetersPerSecond() const; + + inline ::int32_t getAccumulatedDeltaRangeState() const; + + inline double getAccumulatedDeltaRangeMeters() const; + + inline double getAccumulatedDeltaRangeUncertaintyMeters() const; + + inline bool getHasCarrierFrequencyHz() const; + + inline float getCarrierFrequencyHz() const; + + inline bool getHasCarrierCycles() const; + + inline ::int64_t getCarrierCycles() const; + + inline bool getHasCarrierPhase() const; + + inline double getCarrierPhase() const; + + inline bool getHasCarrierPhaseUncertainty() const; + + inline double getCarrierPhaseUncertainty() const; + + inline bool getHasSnrInDb() const; + + inline double getSnrInDb() const; + + inline ::cereal::AndroidGnss::Measurements::Measurement::MultipathIndicator getMultipathIndicator() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class AndroidGnss::Measurements::Measurement::Builder { +public: + typedef Measurement Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::int32_t getSvId(); + inline void setSvId( ::int32_t value); + + inline ::cereal::AndroidGnss::Measurements::Measurement::Constellation getConstellation(); + inline void setConstellation( ::cereal::AndroidGnss::Measurements::Measurement::Constellation value); + + inline double getTimeOffsetNanos(); + inline void setTimeOffsetNanos(double value); + + inline ::int32_t getState(); + inline void setState( ::int32_t value); + + inline ::int64_t getReceivedSvTimeNanos(); + inline void setReceivedSvTimeNanos( ::int64_t value); + + inline ::int64_t getReceivedSvTimeUncertaintyNanos(); + inline void setReceivedSvTimeUncertaintyNanos( ::int64_t value); + + inline double getCn0DbHz(); + inline void setCn0DbHz(double value); + + inline double getPseudorangeRateMetersPerSecond(); + inline void setPseudorangeRateMetersPerSecond(double value); + + inline double getPseudorangeRateUncertaintyMetersPerSecond(); + inline void setPseudorangeRateUncertaintyMetersPerSecond(double value); + + inline ::int32_t getAccumulatedDeltaRangeState(); + inline void setAccumulatedDeltaRangeState( ::int32_t value); + + inline double getAccumulatedDeltaRangeMeters(); + inline void setAccumulatedDeltaRangeMeters(double value); + + inline double getAccumulatedDeltaRangeUncertaintyMeters(); + inline void setAccumulatedDeltaRangeUncertaintyMeters(double value); + + inline bool getHasCarrierFrequencyHz(); + inline void setHasCarrierFrequencyHz(bool value); + + inline float getCarrierFrequencyHz(); + inline void setCarrierFrequencyHz(float value); + + inline bool getHasCarrierCycles(); + inline void setHasCarrierCycles(bool value); + + inline ::int64_t getCarrierCycles(); + inline void setCarrierCycles( ::int64_t value); + + inline bool getHasCarrierPhase(); + inline void setHasCarrierPhase(bool value); + + inline double getCarrierPhase(); + inline void setCarrierPhase(double value); + + inline bool getHasCarrierPhaseUncertainty(); + inline void setHasCarrierPhaseUncertainty(bool value); + + inline double getCarrierPhaseUncertainty(); + inline void setCarrierPhaseUncertainty(double value); + + inline bool getHasSnrInDb(); + inline void setHasSnrInDb(bool value); + + inline double getSnrInDb(); + inline void setSnrInDb(double value); + + inline ::cereal::AndroidGnss::Measurements::Measurement::MultipathIndicator getMultipathIndicator(); + inline void setMultipathIndicator( ::cereal::AndroidGnss::Measurements::Measurement::MultipathIndicator value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class AndroidGnss::Measurements::Measurement::Pipeline { +public: + typedef Measurement Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class AndroidGnss::NavigationMessage::Reader { +public: + typedef NavigationMessage Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::int32_t getType() const; + + inline ::int32_t getSvId() const; + + inline ::int32_t getMessageId() const; + + inline ::int32_t getSubmessageId() const; + + inline bool hasData() const; + inline ::capnp::Data::Reader getData() const; + + inline ::cereal::AndroidGnss::NavigationMessage::Status getStatus() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class AndroidGnss::NavigationMessage::Builder { +public: + typedef NavigationMessage Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::int32_t getType(); + inline void setType( ::int32_t value); + + inline ::int32_t getSvId(); + inline void setSvId( ::int32_t value); + + inline ::int32_t getMessageId(); + inline void setMessageId( ::int32_t value); + + inline ::int32_t getSubmessageId(); + inline void setSubmessageId( ::int32_t value); + + inline bool hasData(); + inline ::capnp::Data::Builder getData(); + inline void setData( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initData(unsigned int size); + inline void adoptData(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownData(); + + inline ::cereal::AndroidGnss::NavigationMessage::Status getStatus(); + inline void setStatus( ::cereal::AndroidGnss::NavigationMessage::Status value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class AndroidGnss::NavigationMessage::Pipeline { +public: + typedef NavigationMessage Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class QcomGnss::Reader { +public: + typedef QcomGnss Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline Which which() const; + inline ::uint64_t getLogTs() const; + + inline bool isMeasurementReport() const; + inline bool hasMeasurementReport() const; + inline ::cereal::QcomGnss::MeasurementReport::Reader getMeasurementReport() const; + + inline bool isClockReport() const; + inline bool hasClockReport() const; + inline ::cereal::QcomGnss::ClockReport::Reader getClockReport() const; + + inline bool isDrMeasurementReport() const; + inline bool hasDrMeasurementReport() const; + inline ::cereal::QcomGnss::DrMeasurementReport::Reader getDrMeasurementReport() const; + + inline bool isDrSvPoly() const; + inline bool hasDrSvPoly() const; + inline ::cereal::QcomGnss::DrSvPolyReport::Reader getDrSvPoly() const; + + inline bool isRawLog() const; + inline bool hasRawLog() const; + inline ::capnp::Data::Reader getRawLog() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class QcomGnss::Builder { +public: + typedef QcomGnss Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline Which which(); + inline ::uint64_t getLogTs(); + inline void setLogTs( ::uint64_t value); + + inline bool isMeasurementReport(); + inline bool hasMeasurementReport(); + inline ::cereal::QcomGnss::MeasurementReport::Builder getMeasurementReport(); + inline void setMeasurementReport( ::cereal::QcomGnss::MeasurementReport::Reader value); + inline ::cereal::QcomGnss::MeasurementReport::Builder initMeasurementReport(); + inline void adoptMeasurementReport(::capnp::Orphan< ::cereal::QcomGnss::MeasurementReport>&& value); + inline ::capnp::Orphan< ::cereal::QcomGnss::MeasurementReport> disownMeasurementReport(); + + inline bool isClockReport(); + inline bool hasClockReport(); + inline ::cereal::QcomGnss::ClockReport::Builder getClockReport(); + inline void setClockReport( ::cereal::QcomGnss::ClockReport::Reader value); + inline ::cereal::QcomGnss::ClockReport::Builder initClockReport(); + inline void adoptClockReport(::capnp::Orphan< ::cereal::QcomGnss::ClockReport>&& value); + inline ::capnp::Orphan< ::cereal::QcomGnss::ClockReport> disownClockReport(); + + inline bool isDrMeasurementReport(); + inline bool hasDrMeasurementReport(); + inline ::cereal::QcomGnss::DrMeasurementReport::Builder getDrMeasurementReport(); + inline void setDrMeasurementReport( ::cereal::QcomGnss::DrMeasurementReport::Reader value); + inline ::cereal::QcomGnss::DrMeasurementReport::Builder initDrMeasurementReport(); + inline void adoptDrMeasurementReport(::capnp::Orphan< ::cereal::QcomGnss::DrMeasurementReport>&& value); + inline ::capnp::Orphan< ::cereal::QcomGnss::DrMeasurementReport> disownDrMeasurementReport(); + + inline bool isDrSvPoly(); + inline bool hasDrSvPoly(); + inline ::cereal::QcomGnss::DrSvPolyReport::Builder getDrSvPoly(); + inline void setDrSvPoly( ::cereal::QcomGnss::DrSvPolyReport::Reader value); + inline ::cereal::QcomGnss::DrSvPolyReport::Builder initDrSvPoly(); + inline void adoptDrSvPoly(::capnp::Orphan< ::cereal::QcomGnss::DrSvPolyReport>&& value); + inline ::capnp::Orphan< ::cereal::QcomGnss::DrSvPolyReport> disownDrSvPoly(); + + inline bool isRawLog(); + inline bool hasRawLog(); + inline ::capnp::Data::Builder getRawLog(); + inline void setRawLog( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initRawLog(unsigned int size); + inline void adoptRawLog(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownRawLog(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class QcomGnss::Pipeline { +public: + typedef QcomGnss Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class QcomGnss::MeasurementStatus::Reader { +public: + typedef MeasurementStatus Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getSubMillisecondIsValid() const; + + inline bool getSubBitTimeIsKnown() const; + + inline bool getSatelliteTimeIsKnown() const; + + inline bool getBitEdgeConfirmedFromSignal() const; + + inline bool getMeasuredVelocity() const; + + inline bool getFineOrCoarseVelocity() const; + + inline bool getLockPointValid() const; + + inline bool getLockPointPositive() const; + + inline bool getLastUpdateFromDifference() const; + + inline bool getLastUpdateFromVelocityDifference() const; + + inline bool getStrongIndicationOfCrossCorelation() const; + + inline bool getTentativeMeasurement() const; + + inline bool getMeasurementNotUsable() const; + + inline bool getSirCheckIsNeeded() const; + + inline bool getProbationMode() const; + + inline bool getGlonassMeanderBitEdgeValid() const; + + inline bool getGlonassTimeMarkValid() const; + + inline bool getGpsRoundRobinRxDiversity() const; + + inline bool getGpsRxDiversity() const; + + inline bool getGpsLowBandwidthRxDiversityCombined() const; + + inline bool getGpsHighBandwidthNu4() const; + + inline bool getGpsHighBandwidthNu8() const; + + inline bool getGpsHighBandwidthUniform() const; + + inline bool getMultipathIndicator() const; + + inline bool getImdJammingIndicator() const; + + inline bool getLteB13TxJammingIndicator() const; + + inline bool getFreshMeasurementIndicator() const; + + inline bool getMultipathEstimateIsValid() const; + + inline bool getDirectionIsValid() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class QcomGnss::MeasurementStatus::Builder { +public: + typedef MeasurementStatus Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getSubMillisecondIsValid(); + inline void setSubMillisecondIsValid(bool value); + + inline bool getSubBitTimeIsKnown(); + inline void setSubBitTimeIsKnown(bool value); + + inline bool getSatelliteTimeIsKnown(); + inline void setSatelliteTimeIsKnown(bool value); + + inline bool getBitEdgeConfirmedFromSignal(); + inline void setBitEdgeConfirmedFromSignal(bool value); + + inline bool getMeasuredVelocity(); + inline void setMeasuredVelocity(bool value); + + inline bool getFineOrCoarseVelocity(); + inline void setFineOrCoarseVelocity(bool value); + + inline bool getLockPointValid(); + inline void setLockPointValid(bool value); + + inline bool getLockPointPositive(); + inline void setLockPointPositive(bool value); + + inline bool getLastUpdateFromDifference(); + inline void setLastUpdateFromDifference(bool value); + + inline bool getLastUpdateFromVelocityDifference(); + inline void setLastUpdateFromVelocityDifference(bool value); + + inline bool getStrongIndicationOfCrossCorelation(); + inline void setStrongIndicationOfCrossCorelation(bool value); + + inline bool getTentativeMeasurement(); + inline void setTentativeMeasurement(bool value); + + inline bool getMeasurementNotUsable(); + inline void setMeasurementNotUsable(bool value); + + inline bool getSirCheckIsNeeded(); + inline void setSirCheckIsNeeded(bool value); + + inline bool getProbationMode(); + inline void setProbationMode(bool value); + + inline bool getGlonassMeanderBitEdgeValid(); + inline void setGlonassMeanderBitEdgeValid(bool value); + + inline bool getGlonassTimeMarkValid(); + inline void setGlonassTimeMarkValid(bool value); + + inline bool getGpsRoundRobinRxDiversity(); + inline void setGpsRoundRobinRxDiversity(bool value); + + inline bool getGpsRxDiversity(); + inline void setGpsRxDiversity(bool value); + + inline bool getGpsLowBandwidthRxDiversityCombined(); + inline void setGpsLowBandwidthRxDiversityCombined(bool value); + + inline bool getGpsHighBandwidthNu4(); + inline void setGpsHighBandwidthNu4(bool value); + + inline bool getGpsHighBandwidthNu8(); + inline void setGpsHighBandwidthNu8(bool value); + + inline bool getGpsHighBandwidthUniform(); + inline void setGpsHighBandwidthUniform(bool value); + + inline bool getMultipathIndicator(); + inline void setMultipathIndicator(bool value); + + inline bool getImdJammingIndicator(); + inline void setImdJammingIndicator(bool value); + + inline bool getLteB13TxJammingIndicator(); + inline void setLteB13TxJammingIndicator(bool value); + + inline bool getFreshMeasurementIndicator(); + inline void setFreshMeasurementIndicator(bool value); + + inline bool getMultipathEstimateIsValid(); + inline void setMultipathEstimateIsValid(bool value); + + inline bool getDirectionIsValid(); + inline void setDirectionIsValid(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class QcomGnss::MeasurementStatus::Pipeline { +public: + typedef MeasurementStatus Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class QcomGnss::MeasurementReport::Reader { +public: + typedef MeasurementReport Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::cereal::QcomGnss::MeasurementSource getSource() const; + + inline ::uint32_t getFCount() const; + + inline ::uint16_t getGpsWeek() const; + + inline ::uint8_t getGlonassCycleNumber() const; + + inline ::uint16_t getGlonassNumberOfDays() const; + + inline ::uint32_t getMilliseconds() const; + + inline float getTimeBias() const; + + inline float getClockTimeUncertainty() const; + + inline float getClockFrequencyBias() const; + + inline float getClockFrequencyUncertainty() const; + + inline bool hasSv() const; + inline ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>::Reader getSv() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class QcomGnss::MeasurementReport::Builder { +public: + typedef MeasurementReport Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::cereal::QcomGnss::MeasurementSource getSource(); + inline void setSource( ::cereal::QcomGnss::MeasurementSource value); + + inline ::uint32_t getFCount(); + inline void setFCount( ::uint32_t value); + + inline ::uint16_t getGpsWeek(); + inline void setGpsWeek( ::uint16_t value); + + inline ::uint8_t getGlonassCycleNumber(); + inline void setGlonassCycleNumber( ::uint8_t value); + + inline ::uint16_t getGlonassNumberOfDays(); + inline void setGlonassNumberOfDays( ::uint16_t value); + + inline ::uint32_t getMilliseconds(); + inline void setMilliseconds( ::uint32_t value); + + inline float getTimeBias(); + inline void setTimeBias(float value); + + inline float getClockTimeUncertainty(); + inline void setClockTimeUncertainty(float value); + + inline float getClockFrequencyBias(); + inline void setClockFrequencyBias(float value); + + inline float getClockFrequencyUncertainty(); + inline void setClockFrequencyUncertainty(float value); + + inline bool hasSv(); + inline ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>::Builder getSv(); + inline void setSv( ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>::Builder initSv(unsigned int size); + inline void adoptSv(::capnp::Orphan< ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>> disownSv(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class QcomGnss::MeasurementReport::Pipeline { +public: + typedef MeasurementReport Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class QcomGnss::MeasurementReport::SV::Reader { +public: + typedef SV Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint8_t getSvId() const; + + inline ::int8_t getGlonassFrequencyIndex() const; + + inline ::cereal::QcomGnss::SVObservationState getObservationState() const; + + inline ::uint8_t getObservations() const; + + inline ::uint8_t getGoodObservations() const; + + inline ::uint16_t getGpsParityErrorCount() const; + + inline ::uint8_t getGlonassHemmingErrorCount() const; + + inline ::uint8_t getFilterStages() const; + + inline ::uint16_t getCarrierNoise() const; + + inline ::int16_t getLatency() const; + + inline ::uint8_t getPredetectInterval() const; + + inline ::uint16_t getPostdetections() const; + + inline ::uint32_t getUnfilteredMeasurementIntegral() const; + + inline float getUnfilteredMeasurementFraction() const; + + inline float getUnfilteredTimeUncertainty() const; + + inline float getUnfilteredSpeed() const; + + inline float getUnfilteredSpeedUncertainty() const; + + inline bool hasMeasurementStatus() const; + inline ::cereal::QcomGnss::MeasurementStatus::Reader getMeasurementStatus() const; + + inline ::uint32_t getMultipathEstimate() const; + + inline float getAzimuth() const; + + inline float getElevation() const; + + inline ::int32_t getCarrierPhaseCyclesIntegral() const; + + inline ::uint16_t getCarrierPhaseCyclesFraction() const; + + inline float getFineSpeed() const; + + inline float getFineSpeedUncertainty() const; + + inline ::uint8_t getCycleSlipCount() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class QcomGnss::MeasurementReport::SV::Builder { +public: + typedef SV Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint8_t getSvId(); + inline void setSvId( ::uint8_t value); + + inline ::int8_t getGlonassFrequencyIndex(); + inline void setGlonassFrequencyIndex( ::int8_t value); + + inline ::cereal::QcomGnss::SVObservationState getObservationState(); + inline void setObservationState( ::cereal::QcomGnss::SVObservationState value); + + inline ::uint8_t getObservations(); + inline void setObservations( ::uint8_t value); + + inline ::uint8_t getGoodObservations(); + inline void setGoodObservations( ::uint8_t value); + + inline ::uint16_t getGpsParityErrorCount(); + inline void setGpsParityErrorCount( ::uint16_t value); + + inline ::uint8_t getGlonassHemmingErrorCount(); + inline void setGlonassHemmingErrorCount( ::uint8_t value); + + inline ::uint8_t getFilterStages(); + inline void setFilterStages( ::uint8_t value); + + inline ::uint16_t getCarrierNoise(); + inline void setCarrierNoise( ::uint16_t value); + + inline ::int16_t getLatency(); + inline void setLatency( ::int16_t value); + + inline ::uint8_t getPredetectInterval(); + inline void setPredetectInterval( ::uint8_t value); + + inline ::uint16_t getPostdetections(); + inline void setPostdetections( ::uint16_t value); + + inline ::uint32_t getUnfilteredMeasurementIntegral(); + inline void setUnfilteredMeasurementIntegral( ::uint32_t value); + + inline float getUnfilteredMeasurementFraction(); + inline void setUnfilteredMeasurementFraction(float value); + + inline float getUnfilteredTimeUncertainty(); + inline void setUnfilteredTimeUncertainty(float value); + + inline float getUnfilteredSpeed(); + inline void setUnfilteredSpeed(float value); + + inline float getUnfilteredSpeedUncertainty(); + inline void setUnfilteredSpeedUncertainty(float value); + + inline bool hasMeasurementStatus(); + inline ::cereal::QcomGnss::MeasurementStatus::Builder getMeasurementStatus(); + inline void setMeasurementStatus( ::cereal::QcomGnss::MeasurementStatus::Reader value); + inline ::cereal::QcomGnss::MeasurementStatus::Builder initMeasurementStatus(); + inline void adoptMeasurementStatus(::capnp::Orphan< ::cereal::QcomGnss::MeasurementStatus>&& value); + inline ::capnp::Orphan< ::cereal::QcomGnss::MeasurementStatus> disownMeasurementStatus(); + + inline ::uint32_t getMultipathEstimate(); + inline void setMultipathEstimate( ::uint32_t value); + + inline float getAzimuth(); + inline void setAzimuth(float value); + + inline float getElevation(); + inline void setElevation(float value); + + inline ::int32_t getCarrierPhaseCyclesIntegral(); + inline void setCarrierPhaseCyclesIntegral( ::int32_t value); + + inline ::uint16_t getCarrierPhaseCyclesFraction(); + inline void setCarrierPhaseCyclesFraction( ::uint16_t value); + + inline float getFineSpeed(); + inline void setFineSpeed(float value); + + inline float getFineSpeedUncertainty(); + inline void setFineSpeedUncertainty(float value); + + inline ::uint8_t getCycleSlipCount(); + inline void setCycleSlipCount( ::uint8_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class QcomGnss::MeasurementReport::SV::Pipeline { +public: + typedef SV Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::QcomGnss::MeasurementStatus::Pipeline getMeasurementStatus(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class QcomGnss::ClockReport::Reader { +public: + typedef ClockReport Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getHasFCount() const; + + inline ::uint32_t getFCount() const; + + inline bool getHasGpsWeek() const; + + inline ::uint16_t getGpsWeek() const; + + inline bool getHasGpsMilliseconds() const; + + inline ::uint32_t getGpsMilliseconds() const; + + inline float getGpsTimeBias() const; + + inline float getGpsClockTimeUncertainty() const; + + inline ::uint8_t getGpsClockSource() const; + + inline bool getHasGlonassYear() const; + + inline ::uint8_t getGlonassYear() const; + + inline bool getHasGlonassDay() const; + + inline ::uint16_t getGlonassDay() const; + + inline bool getHasGlonassMilliseconds() const; + + inline ::uint32_t getGlonassMilliseconds() const; + + inline float getGlonassTimeBias() const; + + inline float getGlonassClockTimeUncertainty() const; + + inline ::uint8_t getGlonassClockSource() const; + + inline ::uint16_t getBdsWeek() const; + + inline ::uint32_t getBdsMilliseconds() const; + + inline float getBdsTimeBias() const; + + inline float getBdsClockTimeUncertainty() const; + + inline ::uint8_t getBdsClockSource() const; + + inline ::uint16_t getGalWeek() const; + + inline ::uint32_t getGalMilliseconds() const; + + inline float getGalTimeBias() const; + + inline float getGalClockTimeUncertainty() const; + + inline ::uint8_t getGalClockSource() const; + + inline float getClockFrequencyBias() const; + + inline float getClockFrequencyUncertainty() const; + + inline ::uint8_t getFrequencySource() const; + + inline ::uint8_t getGpsLeapSeconds() const; + + inline ::uint8_t getGpsLeapSecondsUncertainty() const; + + inline ::uint8_t getGpsLeapSecondsSource() const; + + inline float getGpsToGlonassTimeBiasMilliseconds() const; + + inline float getGpsToGlonassTimeBiasMillisecondsUncertainty() const; + + inline float getGpsToBdsTimeBiasMilliseconds() const; + + inline float getGpsToBdsTimeBiasMillisecondsUncertainty() const; + + inline float getBdsToGloTimeBiasMilliseconds() const; + + inline float getBdsToGloTimeBiasMillisecondsUncertainty() const; + + inline float getGpsToGalTimeBiasMilliseconds() const; + + inline float getGpsToGalTimeBiasMillisecondsUncertainty() const; + + inline float getGalToGloTimeBiasMilliseconds() const; + + inline float getGalToGloTimeBiasMillisecondsUncertainty() const; + + inline float getGalToBdsTimeBiasMilliseconds() const; + + inline float getGalToBdsTimeBiasMillisecondsUncertainty() const; + + inline bool getHasRtcTime() const; + + inline ::uint32_t getSystemRtcTime() const; + + inline ::uint32_t getFCountOffset() const; + + inline ::uint32_t getLpmRtcCount() const; + + inline ::uint32_t getClockResets() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class QcomGnss::ClockReport::Builder { +public: + typedef ClockReport Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getHasFCount(); + inline void setHasFCount(bool value); + + inline ::uint32_t getFCount(); + inline void setFCount( ::uint32_t value); + + inline bool getHasGpsWeek(); + inline void setHasGpsWeek(bool value); + + inline ::uint16_t getGpsWeek(); + inline void setGpsWeek( ::uint16_t value); + + inline bool getHasGpsMilliseconds(); + inline void setHasGpsMilliseconds(bool value); + + inline ::uint32_t getGpsMilliseconds(); + inline void setGpsMilliseconds( ::uint32_t value); + + inline float getGpsTimeBias(); + inline void setGpsTimeBias(float value); + + inline float getGpsClockTimeUncertainty(); + inline void setGpsClockTimeUncertainty(float value); + + inline ::uint8_t getGpsClockSource(); + inline void setGpsClockSource( ::uint8_t value); + + inline bool getHasGlonassYear(); + inline void setHasGlonassYear(bool value); + + inline ::uint8_t getGlonassYear(); + inline void setGlonassYear( ::uint8_t value); + + inline bool getHasGlonassDay(); + inline void setHasGlonassDay(bool value); + + inline ::uint16_t getGlonassDay(); + inline void setGlonassDay( ::uint16_t value); + + inline bool getHasGlonassMilliseconds(); + inline void setHasGlonassMilliseconds(bool value); + + inline ::uint32_t getGlonassMilliseconds(); + inline void setGlonassMilliseconds( ::uint32_t value); + + inline float getGlonassTimeBias(); + inline void setGlonassTimeBias(float value); + + inline float getGlonassClockTimeUncertainty(); + inline void setGlonassClockTimeUncertainty(float value); + + inline ::uint8_t getGlonassClockSource(); + inline void setGlonassClockSource( ::uint8_t value); + + inline ::uint16_t getBdsWeek(); + inline void setBdsWeek( ::uint16_t value); + + inline ::uint32_t getBdsMilliseconds(); + inline void setBdsMilliseconds( ::uint32_t value); + + inline float getBdsTimeBias(); + inline void setBdsTimeBias(float value); + + inline float getBdsClockTimeUncertainty(); + inline void setBdsClockTimeUncertainty(float value); + + inline ::uint8_t getBdsClockSource(); + inline void setBdsClockSource( ::uint8_t value); + + inline ::uint16_t getGalWeek(); + inline void setGalWeek( ::uint16_t value); + + inline ::uint32_t getGalMilliseconds(); + inline void setGalMilliseconds( ::uint32_t value); + + inline float getGalTimeBias(); + inline void setGalTimeBias(float value); + + inline float getGalClockTimeUncertainty(); + inline void setGalClockTimeUncertainty(float value); + + inline ::uint8_t getGalClockSource(); + inline void setGalClockSource( ::uint8_t value); + + inline float getClockFrequencyBias(); + inline void setClockFrequencyBias(float value); + + inline float getClockFrequencyUncertainty(); + inline void setClockFrequencyUncertainty(float value); + + inline ::uint8_t getFrequencySource(); + inline void setFrequencySource( ::uint8_t value); + + inline ::uint8_t getGpsLeapSeconds(); + inline void setGpsLeapSeconds( ::uint8_t value); + + inline ::uint8_t getGpsLeapSecondsUncertainty(); + inline void setGpsLeapSecondsUncertainty( ::uint8_t value); + + inline ::uint8_t getGpsLeapSecondsSource(); + inline void setGpsLeapSecondsSource( ::uint8_t value); + + inline float getGpsToGlonassTimeBiasMilliseconds(); + inline void setGpsToGlonassTimeBiasMilliseconds(float value); + + inline float getGpsToGlonassTimeBiasMillisecondsUncertainty(); + inline void setGpsToGlonassTimeBiasMillisecondsUncertainty(float value); + + inline float getGpsToBdsTimeBiasMilliseconds(); + inline void setGpsToBdsTimeBiasMilliseconds(float value); + + inline float getGpsToBdsTimeBiasMillisecondsUncertainty(); + inline void setGpsToBdsTimeBiasMillisecondsUncertainty(float value); + + inline float getBdsToGloTimeBiasMilliseconds(); + inline void setBdsToGloTimeBiasMilliseconds(float value); + + inline float getBdsToGloTimeBiasMillisecondsUncertainty(); + inline void setBdsToGloTimeBiasMillisecondsUncertainty(float value); + + inline float getGpsToGalTimeBiasMilliseconds(); + inline void setGpsToGalTimeBiasMilliseconds(float value); + + inline float getGpsToGalTimeBiasMillisecondsUncertainty(); + inline void setGpsToGalTimeBiasMillisecondsUncertainty(float value); + + inline float getGalToGloTimeBiasMilliseconds(); + inline void setGalToGloTimeBiasMilliseconds(float value); + + inline float getGalToGloTimeBiasMillisecondsUncertainty(); + inline void setGalToGloTimeBiasMillisecondsUncertainty(float value); + + inline float getGalToBdsTimeBiasMilliseconds(); + inline void setGalToBdsTimeBiasMilliseconds(float value); + + inline float getGalToBdsTimeBiasMillisecondsUncertainty(); + inline void setGalToBdsTimeBiasMillisecondsUncertainty(float value); + + inline bool getHasRtcTime(); + inline void setHasRtcTime(bool value); + + inline ::uint32_t getSystemRtcTime(); + inline void setSystemRtcTime( ::uint32_t value); + + inline ::uint32_t getFCountOffset(); + inline void setFCountOffset( ::uint32_t value); + + inline ::uint32_t getLpmRtcCount(); + inline void setLpmRtcCount( ::uint32_t value); + + inline ::uint32_t getClockResets(); + inline void setClockResets( ::uint32_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class QcomGnss::ClockReport::Pipeline { +public: + typedef ClockReport Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class QcomGnss::DrMeasurementReport::Reader { +public: + typedef DrMeasurementReport Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint8_t getReason() const; + + inline ::uint8_t getSeqNum() const; + + inline ::uint8_t getSeqMax() const; + + inline ::uint16_t getRfLoss() const; + + inline bool getSystemRtcValid() const; + + inline ::uint32_t getFCount() const; + + inline ::uint32_t getClockResets() const; + + inline ::uint64_t getSystemRtcTime() const; + + inline ::uint8_t getGpsLeapSeconds() const; + + inline ::uint8_t getGpsLeapSecondsUncertainty() const; + + inline float getGpsToGlonassTimeBiasMilliseconds() const; + + inline float getGpsToGlonassTimeBiasMillisecondsUncertainty() const; + + inline ::uint16_t getGpsWeek() const; + + inline ::uint32_t getGpsMilliseconds() const; + + inline ::uint32_t getGpsTimeBiasMs() const; + + inline ::uint32_t getGpsClockTimeUncertaintyMs() const; + + inline ::uint8_t getGpsClockSource() const; + + inline ::uint8_t getGlonassClockSource() const; + + inline ::uint8_t getGlonassYear() const; + + inline ::uint16_t getGlonassDay() const; + + inline ::uint32_t getGlonassMilliseconds() const; + + inline float getGlonassTimeBias() const; + + inline float getGlonassClockTimeUncertainty() const; + + inline float getClockFrequencyBias() const; + + inline float getClockFrequencyUncertainty() const; + + inline ::uint8_t getFrequencySource() const; + + inline ::cereal::QcomGnss::MeasurementSource getSource() const; + + inline bool hasSv() const; + inline ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>::Reader getSv() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class QcomGnss::DrMeasurementReport::Builder { +public: + typedef DrMeasurementReport Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint8_t getReason(); + inline void setReason( ::uint8_t value); + + inline ::uint8_t getSeqNum(); + inline void setSeqNum( ::uint8_t value); + + inline ::uint8_t getSeqMax(); + inline void setSeqMax( ::uint8_t value); + + inline ::uint16_t getRfLoss(); + inline void setRfLoss( ::uint16_t value); + + inline bool getSystemRtcValid(); + inline void setSystemRtcValid(bool value); + + inline ::uint32_t getFCount(); + inline void setFCount( ::uint32_t value); + + inline ::uint32_t getClockResets(); + inline void setClockResets( ::uint32_t value); + + inline ::uint64_t getSystemRtcTime(); + inline void setSystemRtcTime( ::uint64_t value); + + inline ::uint8_t getGpsLeapSeconds(); + inline void setGpsLeapSeconds( ::uint8_t value); + + inline ::uint8_t getGpsLeapSecondsUncertainty(); + inline void setGpsLeapSecondsUncertainty( ::uint8_t value); + + inline float getGpsToGlonassTimeBiasMilliseconds(); + inline void setGpsToGlonassTimeBiasMilliseconds(float value); + + inline float getGpsToGlonassTimeBiasMillisecondsUncertainty(); + inline void setGpsToGlonassTimeBiasMillisecondsUncertainty(float value); + + inline ::uint16_t getGpsWeek(); + inline void setGpsWeek( ::uint16_t value); + + inline ::uint32_t getGpsMilliseconds(); + inline void setGpsMilliseconds( ::uint32_t value); + + inline ::uint32_t getGpsTimeBiasMs(); + inline void setGpsTimeBiasMs( ::uint32_t value); + + inline ::uint32_t getGpsClockTimeUncertaintyMs(); + inline void setGpsClockTimeUncertaintyMs( ::uint32_t value); + + inline ::uint8_t getGpsClockSource(); + inline void setGpsClockSource( ::uint8_t value); + + inline ::uint8_t getGlonassClockSource(); + inline void setGlonassClockSource( ::uint8_t value); + + inline ::uint8_t getGlonassYear(); + inline void setGlonassYear( ::uint8_t value); + + inline ::uint16_t getGlonassDay(); + inline void setGlonassDay( ::uint16_t value); + + inline ::uint32_t getGlonassMilliseconds(); + inline void setGlonassMilliseconds( ::uint32_t value); + + inline float getGlonassTimeBias(); + inline void setGlonassTimeBias(float value); + + inline float getGlonassClockTimeUncertainty(); + inline void setGlonassClockTimeUncertainty(float value); + + inline float getClockFrequencyBias(); + inline void setClockFrequencyBias(float value); + + inline float getClockFrequencyUncertainty(); + inline void setClockFrequencyUncertainty(float value); + + inline ::uint8_t getFrequencySource(); + inline void setFrequencySource( ::uint8_t value); + + inline ::cereal::QcomGnss::MeasurementSource getSource(); + inline void setSource( ::cereal::QcomGnss::MeasurementSource value); + + inline bool hasSv(); + inline ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>::Builder getSv(); + inline void setSv( ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>::Builder initSv(unsigned int size); + inline void adoptSv(::capnp::Orphan< ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>> disownSv(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class QcomGnss::DrMeasurementReport::Pipeline { +public: + typedef DrMeasurementReport Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class QcomGnss::DrMeasurementReport::SV::Reader { +public: + typedef SV Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint8_t getSvId() const; + + inline ::int8_t getGlonassFrequencyIndex() const; + + inline ::cereal::QcomGnss::SVObservationState getObservationState() const; + + inline ::uint8_t getObservations() const; + + inline ::uint8_t getGoodObservations() const; + + inline ::uint8_t getFilterStages() const; + + inline ::uint8_t getPredetectInterval() const; + + inline ::uint8_t getCycleSlipCount() const; + + inline ::uint16_t getPostdetections() const; + + inline bool hasMeasurementStatus() const; + inline ::cereal::QcomGnss::MeasurementStatus::Reader getMeasurementStatus() const; + + inline ::uint16_t getCarrierNoise() const; + + inline ::uint16_t getRfLoss() const; + + inline ::int16_t getLatency() const; + + inline float getFilteredMeasurementFraction() const; + + inline ::uint32_t getFilteredMeasurementIntegral() const; + + inline float getFilteredTimeUncertainty() const; + + inline float getFilteredSpeed() const; + + inline float getFilteredSpeedUncertainty() const; + + inline float getUnfilteredMeasurementFraction() const; + + inline ::uint32_t getUnfilteredMeasurementIntegral() const; + + inline float getUnfilteredTimeUncertainty() const; + + inline float getUnfilteredSpeed() const; + + inline float getUnfilteredSpeedUncertainty() const; + + inline ::uint32_t getMultipathEstimate() const; + + inline float getAzimuth() const; + + inline float getElevation() const; + + inline float getDopplerAcceleration() const; + + inline float getFineSpeed() const; + + inline float getFineSpeedUncertainty() const; + + inline double getCarrierPhase() const; + + inline ::uint32_t getFCount() const; + + inline ::uint16_t getParityErrorCount() const; + + inline bool getGoodParity() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class QcomGnss::DrMeasurementReport::SV::Builder { +public: + typedef SV Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint8_t getSvId(); + inline void setSvId( ::uint8_t value); + + inline ::int8_t getGlonassFrequencyIndex(); + inline void setGlonassFrequencyIndex( ::int8_t value); + + inline ::cereal::QcomGnss::SVObservationState getObservationState(); + inline void setObservationState( ::cereal::QcomGnss::SVObservationState value); + + inline ::uint8_t getObservations(); + inline void setObservations( ::uint8_t value); + + inline ::uint8_t getGoodObservations(); + inline void setGoodObservations( ::uint8_t value); + + inline ::uint8_t getFilterStages(); + inline void setFilterStages( ::uint8_t value); + + inline ::uint8_t getPredetectInterval(); + inline void setPredetectInterval( ::uint8_t value); + + inline ::uint8_t getCycleSlipCount(); + inline void setCycleSlipCount( ::uint8_t value); + + inline ::uint16_t getPostdetections(); + inline void setPostdetections( ::uint16_t value); + + inline bool hasMeasurementStatus(); + inline ::cereal::QcomGnss::MeasurementStatus::Builder getMeasurementStatus(); + inline void setMeasurementStatus( ::cereal::QcomGnss::MeasurementStatus::Reader value); + inline ::cereal::QcomGnss::MeasurementStatus::Builder initMeasurementStatus(); + inline void adoptMeasurementStatus(::capnp::Orphan< ::cereal::QcomGnss::MeasurementStatus>&& value); + inline ::capnp::Orphan< ::cereal::QcomGnss::MeasurementStatus> disownMeasurementStatus(); + + inline ::uint16_t getCarrierNoise(); + inline void setCarrierNoise( ::uint16_t value); + + inline ::uint16_t getRfLoss(); + inline void setRfLoss( ::uint16_t value); + + inline ::int16_t getLatency(); + inline void setLatency( ::int16_t value); + + inline float getFilteredMeasurementFraction(); + inline void setFilteredMeasurementFraction(float value); + + inline ::uint32_t getFilteredMeasurementIntegral(); + inline void setFilteredMeasurementIntegral( ::uint32_t value); + + inline float getFilteredTimeUncertainty(); + inline void setFilteredTimeUncertainty(float value); + + inline float getFilteredSpeed(); + inline void setFilteredSpeed(float value); + + inline float getFilteredSpeedUncertainty(); + inline void setFilteredSpeedUncertainty(float value); + + inline float getUnfilteredMeasurementFraction(); + inline void setUnfilteredMeasurementFraction(float value); + + inline ::uint32_t getUnfilteredMeasurementIntegral(); + inline void setUnfilteredMeasurementIntegral( ::uint32_t value); + + inline float getUnfilteredTimeUncertainty(); + inline void setUnfilteredTimeUncertainty(float value); + + inline float getUnfilteredSpeed(); + inline void setUnfilteredSpeed(float value); + + inline float getUnfilteredSpeedUncertainty(); + inline void setUnfilteredSpeedUncertainty(float value); + + inline ::uint32_t getMultipathEstimate(); + inline void setMultipathEstimate( ::uint32_t value); + + inline float getAzimuth(); + inline void setAzimuth(float value); + + inline float getElevation(); + inline void setElevation(float value); + + inline float getDopplerAcceleration(); + inline void setDopplerAcceleration(float value); + + inline float getFineSpeed(); + inline void setFineSpeed(float value); + + inline float getFineSpeedUncertainty(); + inline void setFineSpeedUncertainty(float value); + + inline double getCarrierPhase(); + inline void setCarrierPhase(double value); + + inline ::uint32_t getFCount(); + inline void setFCount( ::uint32_t value); + + inline ::uint16_t getParityErrorCount(); + inline void setParityErrorCount( ::uint16_t value); + + inline bool getGoodParity(); + inline void setGoodParity(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class QcomGnss::DrMeasurementReport::SV::Pipeline { +public: + typedef SV Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::QcomGnss::MeasurementStatus::Pipeline getMeasurementStatus(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class QcomGnss::DrSvPolyReport::Reader { +public: + typedef DrSvPolyReport Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint16_t getSvId() const; + + inline ::int8_t getFrequencyIndex() const; + + inline bool getHasPosition() const; + + inline bool getHasIono() const; + + inline bool getHasTropo() const; + + inline bool getHasElevation() const; + + inline bool getPolyFromXtra() const; + + inline bool getHasSbasIono() const; + + inline ::uint16_t getIode() const; + + inline double getT0() const; + + inline bool hasXyz0() const; + inline ::capnp::List::Reader getXyz0() const; + + inline bool hasXyzN() const; + inline ::capnp::List::Reader getXyzN() const; + + inline bool hasOther() const; + inline ::capnp::List::Reader getOther() const; + + inline float getPositionUncertainty() const; + + inline float getIonoDelay() const; + + inline float getIonoDot() const; + + inline float getSbasIonoDelay() const; + + inline float getSbasIonoDot() const; + + inline float getTropoDelay() const; + + inline float getElevation() const; + + inline float getElevationDot() const; + + inline float getElevationUncertainty() const; + + inline bool hasVelocityCoeff() const; + inline ::capnp::List::Reader getVelocityCoeff() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class QcomGnss::DrSvPolyReport::Builder { +public: + typedef DrSvPolyReport Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint16_t getSvId(); + inline void setSvId( ::uint16_t value); + + inline ::int8_t getFrequencyIndex(); + inline void setFrequencyIndex( ::int8_t value); + + inline bool getHasPosition(); + inline void setHasPosition(bool value); + + inline bool getHasIono(); + inline void setHasIono(bool value); + + inline bool getHasTropo(); + inline void setHasTropo(bool value); + + inline bool getHasElevation(); + inline void setHasElevation(bool value); + + inline bool getPolyFromXtra(); + inline void setPolyFromXtra(bool value); + + inline bool getHasSbasIono(); + inline void setHasSbasIono(bool value); + + inline ::uint16_t getIode(); + inline void setIode( ::uint16_t value); + + inline double getT0(); + inline void setT0(double value); + + inline bool hasXyz0(); + inline ::capnp::List::Builder getXyz0(); + inline void setXyz0( ::capnp::List::Reader value); + inline void setXyz0(::kj::ArrayPtr value); + inline ::capnp::List::Builder initXyz0(unsigned int size); + inline void adoptXyz0(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownXyz0(); + + inline bool hasXyzN(); + inline ::capnp::List::Builder getXyzN(); + inline void setXyzN( ::capnp::List::Reader value); + inline void setXyzN(::kj::ArrayPtr value); + inline ::capnp::List::Builder initXyzN(unsigned int size); + inline void adoptXyzN(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownXyzN(); + + inline bool hasOther(); + inline ::capnp::List::Builder getOther(); + inline void setOther( ::capnp::List::Reader value); + inline void setOther(::kj::ArrayPtr value); + inline ::capnp::List::Builder initOther(unsigned int size); + inline void adoptOther(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownOther(); + + inline float getPositionUncertainty(); + inline void setPositionUncertainty(float value); + + inline float getIonoDelay(); + inline void setIonoDelay(float value); + + inline float getIonoDot(); + inline void setIonoDot(float value); + + inline float getSbasIonoDelay(); + inline void setSbasIonoDelay(float value); + + inline float getSbasIonoDot(); + inline void setSbasIonoDot(float value); + + inline float getTropoDelay(); + inline void setTropoDelay(float value); + + inline float getElevation(); + inline void setElevation(float value); + + inline float getElevationDot(); + inline void setElevationDot(float value); + + inline float getElevationUncertainty(); + inline void setElevationUncertainty(float value); + + inline bool hasVelocityCoeff(); + inline ::capnp::List::Builder getVelocityCoeff(); + inline void setVelocityCoeff( ::capnp::List::Reader value); + inline void setVelocityCoeff(::kj::ArrayPtr value); + inline ::capnp::List::Builder initVelocityCoeff(unsigned int size); + inline void adoptVelocityCoeff(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownVelocityCoeff(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class QcomGnss::DrSvPolyReport::Pipeline { +public: + typedef DrSvPolyReport Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LidarPts::Reader { +public: + typedef LidarPts Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasR() const; + inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader getR() const; + + inline bool hasTheta() const; + inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader getTheta() const; + + inline bool hasReflect() const; + inline ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Reader getReflect() const; + + inline ::uint64_t getIdx() const; + + inline bool hasPkt() const; + inline ::capnp::Data::Reader getPkt() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LidarPts::Builder { +public: + typedef LidarPts Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasR(); + inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder getR(); + inline void setR( ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setR(::kj::ArrayPtr value); + inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder initR(unsigned int size); + inline void adoptR(::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>> disownR(); + + inline bool hasTheta(); + inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder getTheta(); + inline void setTheta( ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setTheta(::kj::ArrayPtr value); + inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder initTheta(unsigned int size); + inline void adoptTheta(::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>> disownTheta(); + + inline bool hasReflect(); + inline ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Builder getReflect(); + inline void setReflect( ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setReflect(::kj::ArrayPtr value); + inline ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Builder initReflect(unsigned int size); + inline void adoptReflect(::capnp::Orphan< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>> disownReflect(); + + inline ::uint64_t getIdx(); + inline void setIdx( ::uint64_t value); + + inline bool hasPkt(); + inline ::capnp::Data::Builder getPkt(); + inline void setPkt( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initPkt(unsigned int size); + inline void adoptPkt(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownPkt(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LidarPts::Pipeline { +public: + typedef LidarPts Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +// ======================================================================================= + +inline ::int32_t LogRotate::Reader::getSegmentNum() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t LogRotate::Builder::getSegmentNum() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LogRotate::Builder::setSegmentNum( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool LogRotate::Reader::hasPath() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LogRotate::Builder::hasPath() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader LogRotate::Reader::getPath() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder LogRotate::Builder::getPath() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LogRotate::Builder::setPath( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder LogRotate::Builder::initPath(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void LogRotate::Builder::adoptPath( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> LogRotate::Builder::disownPath() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool LiveUI::Reader::getRearViewCam() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool LiveUI::Builder::getRearViewCam() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LiveUI::Builder::setRearViewCam(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveUI::Reader::hasAlertText1() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveUI::Builder::hasAlertText1() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader LiveUI::Reader::getAlertText1() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder LiveUI::Builder::getAlertText1() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LiveUI::Builder::setAlertText1( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder LiveUI::Builder::initAlertText1(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void LiveUI::Builder::adoptAlertText1( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> LiveUI::Builder::disownAlertText1() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool LiveUI::Reader::hasAlertText2() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveUI::Builder::hasAlertText2() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader LiveUI::Reader::getAlertText2() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder LiveUI::Builder::getAlertText2() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void LiveUI::Builder::setAlertText2( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder LiveUI::Builder::initAlertText2(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void LiveUI::Builder::adoptAlertText2( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> LiveUI::Builder::disownAlertText2() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline float LiveUI::Reader::getAwarenessStatus() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float LiveUI::Builder::getAwarenessStatus() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveUI::Builder::setAwarenessStatus(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::UiLayoutState::App UiLayoutState::Reader::getActiveApp() const { + return _reader.getDataField< ::cereal::UiLayoutState::App>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::cereal::UiLayoutState::App UiLayoutState::Builder::getActiveApp() { + return _builder.getDataField< ::cereal::UiLayoutState::App>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void UiLayoutState::Builder::setActiveApp( ::cereal::UiLayoutState::App value) { + _builder.setDataField< ::cereal::UiLayoutState::App>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool UiLayoutState::Reader::getSidebarCollapsed() const { + return _reader.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline bool UiLayoutState::Builder::getSidebarCollapsed() { + return _builder.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void UiLayoutState::Builder::setSidebarCollapsed(bool value) { + _builder.setDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline bool UiLayoutState::Reader::getMapEnabled() const { + return _reader.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} + +inline bool UiLayoutState::Builder::getMapEnabled() { + return _builder.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} +inline void UiLayoutState::Builder::setMapEnabled(bool value) { + _builder.setDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS, value); +} + +inline bool UiLayoutState::Reader::getMockEngaged() const { + return _reader.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} + +inline bool UiLayoutState::Builder::getMockEngaged() { + return _builder.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} +inline void UiLayoutState::Builder::setMockEngaged(bool value) { + _builder.setDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t OrbslamCorrection::Reader::getCorrectionMonoTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t OrbslamCorrection::Builder::getCorrectionMonoTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void OrbslamCorrection::Builder::setCorrectionMonoTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool OrbslamCorrection::Reader::hasPrePositionECEF() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbslamCorrection::Builder::hasPrePositionECEF() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader OrbslamCorrection::Reader::getPrePositionECEF() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder OrbslamCorrection::Builder::getPrePositionECEF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void OrbslamCorrection::Builder::setPrePositionECEF( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void OrbslamCorrection::Builder::setPrePositionECEF(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder OrbslamCorrection::Builder::initPrePositionECEF(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void OrbslamCorrection::Builder::adoptPrePositionECEF( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> OrbslamCorrection::Builder::disownPrePositionECEF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool OrbslamCorrection::Reader::hasPostPositionECEF() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbslamCorrection::Builder::hasPostPositionECEF() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader OrbslamCorrection::Reader::getPostPositionECEF() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder OrbslamCorrection::Builder::getPostPositionECEF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void OrbslamCorrection::Builder::setPostPositionECEF( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void OrbslamCorrection::Builder::setPostPositionECEF(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder OrbslamCorrection::Builder::initPostPositionECEF(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void OrbslamCorrection::Builder::adoptPostPositionECEF( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> OrbslamCorrection::Builder::disownPostPositionECEF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool OrbslamCorrection::Reader::hasPrePoseQuatECEF() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbslamCorrection::Builder::hasPrePoseQuatECEF() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader OrbslamCorrection::Reader::getPrePoseQuatECEF() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder OrbslamCorrection::Builder::getPrePoseQuatECEF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void OrbslamCorrection::Builder::setPrePoseQuatECEF( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void OrbslamCorrection::Builder::setPrePoseQuatECEF(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder OrbslamCorrection::Builder::initPrePoseQuatECEF(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void OrbslamCorrection::Builder::adoptPrePoseQuatECEF( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> OrbslamCorrection::Builder::disownPrePoseQuatECEF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool OrbslamCorrection::Reader::hasPostPoseQuatECEF() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbslamCorrection::Builder::hasPostPoseQuatECEF() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader OrbslamCorrection::Reader::getPostPoseQuatECEF() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder OrbslamCorrection::Builder::getPostPoseQuatECEF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void OrbslamCorrection::Builder::setPostPoseQuatECEF( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void OrbslamCorrection::Builder::setPostPoseQuatECEF(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder OrbslamCorrection::Builder::initPostPoseQuatECEF(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void OrbslamCorrection::Builder::adoptPostPoseQuatECEF( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> OrbslamCorrection::Builder::disownPostPoseQuatECEF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline ::uint32_t OrbslamCorrection::Reader::getNumInliers() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t OrbslamCorrection::Builder::getNumInliers() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void OrbslamCorrection::Builder::setNumInliers( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool EthernetPacket::Reader::hasPkt() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool EthernetPacket::Builder::hasPkt() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader EthernetPacket::Reader::getPkt() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder EthernetPacket::Builder::getPkt() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void EthernetPacket::Builder::setPkt( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder EthernetPacket::Builder::initPkt(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void EthernetPacket::Builder::adoptPkt( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> EthernetPacket::Builder::disownPkt() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline float EthernetPacket::Reader::getTs() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float EthernetPacket::Builder::getTs() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void EthernetPacket::Builder::setTs(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t CellInfo::Reader::getTimestamp() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t CellInfo::Builder::getTimestamp() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CellInfo::Builder::setTimestamp( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool CellInfo::Reader::hasRepr() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool CellInfo::Builder::hasRepr() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader CellInfo::Reader::getRepr() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder CellInfo::Builder::getRepr() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void CellInfo::Builder::setRepr( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder CellInfo::Builder::initRepr(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void CellInfo::Builder::adoptRepr( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> CellInfo::Builder::disownRepr() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool WifiScan::Reader::hasBssid() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool WifiScan::Builder::hasBssid() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader WifiScan::Reader::getBssid() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder WifiScan::Builder::getBssid() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void WifiScan::Builder::setBssid( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder WifiScan::Builder::initBssid(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void WifiScan::Builder::adoptBssid( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> WifiScan::Builder::disownBssid() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool WifiScan::Reader::hasSsid() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool WifiScan::Builder::hasSsid() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader WifiScan::Reader::getSsid() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder WifiScan::Builder::getSsid() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void WifiScan::Builder::setSsid( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder WifiScan::Builder::initSsid(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void WifiScan::Builder::adoptSsid( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> WifiScan::Builder::disownSsid() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool WifiScan::Reader::hasCapabilities() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool WifiScan::Builder::hasCapabilities() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader WifiScan::Reader::getCapabilities() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder WifiScan::Builder::getCapabilities() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void WifiScan::Builder::setCapabilities( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder WifiScan::Builder::initCapabilities(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void WifiScan::Builder::adoptCapabilities( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> WifiScan::Builder::disownCapabilities() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline ::int32_t WifiScan::Reader::getFrequency() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t WifiScan::Builder::getFrequency() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void WifiScan::Builder::setFrequency( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t WifiScan::Reader::getLevel() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int32_t WifiScan::Builder::getLevel() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void WifiScan::Builder::setLevel( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int64_t WifiScan::Reader::getTimestamp() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int64_t WifiScan::Builder::getTimestamp() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void WifiScan::Builder::setTimestamp( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t WifiScan::Reader::getCenterFreq0() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::int32_t WifiScan::Builder::getCenterFreq0() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void WifiScan::Builder::setCenterFreq0( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t WifiScan::Reader::getCenterFreq1() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::int32_t WifiScan::Builder::getCenterFreq1() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void WifiScan::Builder::setCenterFreq1( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::WifiScan::ChannelWidth WifiScan::Reader::getChannelWidth() const { + return _reader.getDataField< ::cereal::WifiScan::ChannelWidth>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline ::cereal::WifiScan::ChannelWidth WifiScan::Builder::getChannelWidth() { + return _builder.getDataField< ::cereal::WifiScan::ChannelWidth>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void WifiScan::Builder::setChannelWidth( ::cereal::WifiScan::ChannelWidth value) { + _builder.setDataField< ::cereal::WifiScan::ChannelWidth>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline bool WifiScan::Reader::hasOperatorFriendlyName() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool WifiScan::Builder::hasOperatorFriendlyName() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader WifiScan::Reader::getOperatorFriendlyName() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder WifiScan::Builder::getOperatorFriendlyName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void WifiScan::Builder::setOperatorFriendlyName( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder WifiScan::Builder::initOperatorFriendlyName(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void WifiScan::Builder::adoptOperatorFriendlyName( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> WifiScan::Builder::disownOperatorFriendlyName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool WifiScan::Reader::hasVenueName() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool WifiScan::Builder::hasVenueName() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader WifiScan::Reader::getVenueName() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder WifiScan::Builder::getVenueName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void WifiScan::Builder::setVenueName( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder WifiScan::Builder::initVenueName(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void WifiScan::Builder::adoptVenueName( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> WifiScan::Builder::disownVenueName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool WifiScan::Reader::getIs80211mcResponder() const { + return _reader.getDataField( + ::capnp::bounded<208>() * ::capnp::ELEMENTS); +} + +inline bool WifiScan::Builder::getIs80211mcResponder() { + return _builder.getDataField( + ::capnp::bounded<208>() * ::capnp::ELEMENTS); +} +inline void WifiScan::Builder::setIs80211mcResponder(bool value) { + _builder.setDataField( + ::capnp::bounded<208>() * ::capnp::ELEMENTS, value); +} + +inline bool WifiScan::Reader::getPasspoint() const { + return _reader.getDataField( + ::capnp::bounded<209>() * ::capnp::ELEMENTS); +} + +inline bool WifiScan::Builder::getPasspoint() { + return _builder.getDataField( + ::capnp::bounded<209>() * ::capnp::ELEMENTS); +} +inline void WifiScan::Builder::setPasspoint(bool value) { + _builder.setDataField( + ::capnp::bounded<209>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t WifiScan::Reader::getDistanceCm() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline ::int32_t WifiScan::Builder::getDistanceCm() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void WifiScan::Builder::setDistanceCm( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t WifiScan::Reader::getDistanceSdCm() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline ::int32_t WifiScan::Builder::getDistanceSdCm() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void WifiScan::Builder::setDistanceSdCm( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveEventData::Reader::hasName() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveEventData::Builder::hasName() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader LiveEventData::Reader::getName() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder LiveEventData::Builder::getName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LiveEventData::Builder::setName( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder LiveEventData::Builder::initName(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void LiveEventData::Builder::adoptName( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> LiveEventData::Builder::disownName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::int32_t LiveEventData::Reader::getValue() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t LiveEventData::Builder::getValue() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LiveEventData::Builder::setValue( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t ModelData::Reader::getFrameId() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t ModelData::Builder::getFrameId() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ModelData::Builder::setFrameId( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelData::Reader::hasPath() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::Builder::hasPath() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelData::PathData::Reader ModelData::Reader::getPath() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelData::PathData::Builder ModelData::Builder::getPath() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelData::PathData::Pipeline ModelData::Pipeline::getPath() { + return ::cereal::ModelData::PathData::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void ModelData::Builder::setPath( ::cereal::ModelData::PathData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelData::PathData::Builder ModelData::Builder::initPath() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ModelData::Builder::adoptPath( + ::capnp::Orphan< ::cereal::ModelData::PathData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelData::PathData> ModelData::Builder::disownPath() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool ModelData::Reader::hasLeftLane() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::Builder::hasLeftLane() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelData::PathData::Reader ModelData::Reader::getLeftLane() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelData::PathData::Builder ModelData::Builder::getLeftLane() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelData::PathData::Pipeline ModelData::Pipeline::getLeftLane() { + return ::cereal::ModelData::PathData::Pipeline(_typeless.getPointerField(1)); +} +#endif // !CAPNP_LITE +inline void ModelData::Builder::setLeftLane( ::cereal::ModelData::PathData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelData::PathData::Builder ModelData::Builder::initLeftLane() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void ModelData::Builder::adoptLeftLane( + ::capnp::Orphan< ::cereal::ModelData::PathData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelData::PathData> ModelData::Builder::disownLeftLane() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool ModelData::Reader::hasRightLane() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::Builder::hasRightLane() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelData::PathData::Reader ModelData::Reader::getRightLane() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelData::PathData::Builder ModelData::Builder::getRightLane() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelData::PathData::Pipeline ModelData::Pipeline::getRightLane() { + return ::cereal::ModelData::PathData::Pipeline(_typeless.getPointerField(2)); +} +#endif // !CAPNP_LITE +inline void ModelData::Builder::setRightLane( ::cereal::ModelData::PathData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelData::PathData::Builder ModelData::Builder::initRightLane() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void ModelData::Builder::adoptRightLane( + ::capnp::Orphan< ::cereal::ModelData::PathData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelData::PathData> ModelData::Builder::disownRightLane() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::PathData>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool ModelData::Reader::hasLead() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::Builder::hasLead() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelData::LeadData::Reader ModelData::Reader::getLead() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::LeadData>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelData::LeadData::Builder ModelData::Builder::getLead() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::LeadData>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelData::LeadData::Pipeline ModelData::Pipeline::getLead() { + return ::cereal::ModelData::LeadData::Pipeline(_typeless.getPointerField(3)); +} +#endif // !CAPNP_LITE +inline void ModelData::Builder::setLead( ::cereal::ModelData::LeadData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::LeadData>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelData::LeadData::Builder ModelData::Builder::initLead() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::LeadData>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void ModelData::Builder::adoptLead( + ::capnp::Orphan< ::cereal::ModelData::LeadData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::LeadData>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelData::LeadData> ModelData::Builder::disownLead() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::LeadData>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool ModelData::Reader::hasSettings() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::Builder::hasSettings() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelData::ModelSettings::Reader ModelData::Reader::getSettings() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::ModelSettings>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelData::ModelSettings::Builder ModelData::Builder::getSettings() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::ModelSettings>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelData::ModelSettings::Pipeline ModelData::Pipeline::getSettings() { + return ::cereal::ModelData::ModelSettings::Pipeline(_typeless.getPointerField(4)); +} +#endif // !CAPNP_LITE +inline void ModelData::Builder::setSettings( ::cereal::ModelData::ModelSettings::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::ModelSettings>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelData::ModelSettings::Builder ModelData::Builder::initSettings() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::ModelSettings>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void ModelData::Builder::adoptSettings( + ::capnp::Orphan< ::cereal::ModelData::ModelSettings>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::ModelSettings>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelData::ModelSettings> ModelData::Builder::disownSettings() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::ModelSettings>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool ModelData::Reader::hasFreePath() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::Builder::hasFreePath() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelData::Reader::getFreePath() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelData::Builder::getFreePath() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ModelData::Builder::setFreePath( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void ModelData::Builder::setFreePath(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelData::Builder::initFreePath(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void ModelData::Builder::adoptFreePath( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelData::Builder::disownFreePath() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool ModelData::Reader::hasLeadFuture() const { + return !_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::Builder::hasLeadFuture() { + return !_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelData::LeadData::Reader ModelData::Reader::getLeadFuture() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::LeadData>::get(_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelData::LeadData::Builder ModelData::Builder::getLeadFuture() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::LeadData>::get(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelData::LeadData::Pipeline ModelData::Pipeline::getLeadFuture() { + return ::cereal::ModelData::LeadData::Pipeline(_typeless.getPointerField(6)); +} +#endif // !CAPNP_LITE +inline void ModelData::Builder::setLeadFuture( ::cereal::ModelData::LeadData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::LeadData>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelData::LeadData::Builder ModelData::Builder::initLeadFuture() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::LeadData>::init(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline void ModelData::Builder::adoptLeadFuture( + ::capnp::Orphan< ::cereal::ModelData::LeadData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::LeadData>::adopt(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelData::LeadData> ModelData::Builder::disownLeadFuture() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::LeadData>::disown(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} + +inline bool ModelData::Reader::hasSpeed() const { + return !_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::Builder::hasSpeed() { + return !_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelData::Reader::getSpeed() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelData::Builder::getSpeed() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline void ModelData::Builder::setSpeed( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline void ModelData::Builder::setSpeed(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelData::Builder::initSpeed(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), size); +} +inline void ModelData::Builder::adoptSpeed( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelData::Builder::disownSpeed() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} + +inline ::uint64_t ModelData::Reader::getTimestampEof() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ModelData::Builder::getTimestampEof() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ModelData::Builder::setTimestampEof( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelData::Reader::hasMeta() const { + return !_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::Builder::hasMeta() { + return !_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelData::MetaData::Reader ModelData::Reader::getMeta() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::MetaData>::get(_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelData::MetaData::Builder ModelData::Builder::getMeta() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::MetaData>::get(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelData::MetaData::Pipeline ModelData::Pipeline::getMeta() { + return ::cereal::ModelData::MetaData::Pipeline(_typeless.getPointerField(8)); +} +#endif // !CAPNP_LITE +inline void ModelData::Builder::setMeta( ::cereal::ModelData::MetaData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::MetaData>::set(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelData::MetaData::Builder ModelData::Builder::initMeta() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::MetaData>::init(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline void ModelData::Builder::adoptMeta( + ::capnp::Orphan< ::cereal::ModelData::MetaData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::MetaData>::adopt(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelData::MetaData> ModelData::Builder::disownMeta() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::MetaData>::disown(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} + +inline bool ModelData::Reader::hasLongitudinal() const { + return !_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::Builder::hasLongitudinal() { + return !_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelData::LongitudinalData::Reader ModelData::Reader::getLongitudinal() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::LongitudinalData>::get(_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelData::LongitudinalData::Builder ModelData::Builder::getLongitudinal() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::LongitudinalData>::get(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelData::LongitudinalData::Pipeline ModelData::Pipeline::getLongitudinal() { + return ::cereal::ModelData::LongitudinalData::Pipeline(_typeless.getPointerField(9)); +} +#endif // !CAPNP_LITE +inline void ModelData::Builder::setLongitudinal( ::cereal::ModelData::LongitudinalData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::LongitudinalData>::set(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelData::LongitudinalData::Builder ModelData::Builder::initLongitudinal() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::LongitudinalData>::init(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline void ModelData::Builder::adoptLongitudinal( + ::capnp::Orphan< ::cereal::ModelData::LongitudinalData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelData::LongitudinalData>::adopt(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelData::LongitudinalData> ModelData::Builder::disownLongitudinal() { + return ::capnp::_::PointerHelpers< ::cereal::ModelData::LongitudinalData>::disown(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} + +inline ::uint32_t ModelData::Reader::getFrameAge() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t ModelData::Builder::getFrameAge() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ModelData::Builder::setFrameAge( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ModelData::Reader::getFrameDropPerc() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float ModelData::Builder::getFrameDropPerc() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void ModelData::Builder::setFrameDropPerc(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float ModelData::Reader::getModelExecutionTime() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float ModelData::Builder::getModelExecutionTime() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void ModelData::Builder::setModelExecutionTime(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelData::Reader::hasRawPred() const { + return !_reader.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::Builder::hasRawPred() { + return !_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader ModelData::Reader::getRawPred() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder ModelData::Builder::getRawPred() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} +inline void ModelData::Builder::setRawPred( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder ModelData::Builder::initRawPred(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), size); +} +inline void ModelData::Builder::adoptRawPred( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> ModelData::Builder::disownRawPred() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} + +inline float ModelData::Reader::getGpuExecutionTime() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float ModelData::Builder::getGpuExecutionTime() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void ModelData::Builder::setGpuExecutionTime(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelData::PathData::Reader::hasPoints() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::PathData::Builder::hasPoints() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelData::PathData::Reader::getPoints() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelData::PathData::Builder::getPoints() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ModelData::PathData::Builder::setPoints( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void ModelData::PathData::Builder::setPoints(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelData::PathData::Builder::initPoints(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void ModelData::PathData::Builder::adoptPoints( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelData::PathData::Builder::disownPoints() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline float ModelData::PathData::Reader::getProb() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float ModelData::PathData::Builder::getProb() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ModelData::PathData::Builder::setProb(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float ModelData::PathData::Reader::getStd() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float ModelData::PathData::Builder::getStd() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ModelData::PathData::Builder::setStd(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelData::PathData::Reader::hasStds() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::PathData::Builder::hasStds() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelData::PathData::Reader::getStds() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelData::PathData::Builder::getStds() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void ModelData::PathData::Builder::setStds( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void ModelData::PathData::Builder::setStds(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelData::PathData::Builder::initStds(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void ModelData::PathData::Builder::adoptStds( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelData::PathData::Builder::disownStds() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool ModelData::PathData::Reader::hasPoly() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::PathData::Builder::hasPoly() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelData::PathData::Reader::getPoly() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelData::PathData::Builder::getPoly() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void ModelData::PathData::Builder::setPoly( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void ModelData::PathData::Builder::setPoly(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelData::PathData::Builder::initPoly(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void ModelData::PathData::Builder::adoptPoly( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelData::PathData::Builder::disownPoly() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline float ModelData::PathData::Reader::getValidLen() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float ModelData::PathData::Builder::getValidLen() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ModelData::PathData::Builder::setValidLen(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float ModelData::LeadData::Reader::getDist() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float ModelData::LeadData::Builder::getDist() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ModelData::LeadData::Builder::setDist(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float ModelData::LeadData::Reader::getProb() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float ModelData::LeadData::Builder::getProb() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ModelData::LeadData::Builder::setProb(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ModelData::LeadData::Reader::getStd() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float ModelData::LeadData::Builder::getStd() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ModelData::LeadData::Builder::setStd(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float ModelData::LeadData::Reader::getRelVel() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float ModelData::LeadData::Builder::getRelVel() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void ModelData::LeadData::Builder::setRelVel(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float ModelData::LeadData::Reader::getRelVelStd() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float ModelData::LeadData::Builder::getRelVelStd() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void ModelData::LeadData::Builder::setRelVelStd(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float ModelData::LeadData::Reader::getRelY() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float ModelData::LeadData::Builder::getRelY() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void ModelData::LeadData::Builder::setRelY(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float ModelData::LeadData::Reader::getRelYStd() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float ModelData::LeadData::Builder::getRelYStd() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void ModelData::LeadData::Builder::setRelYStd(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float ModelData::LeadData::Reader::getRelA() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float ModelData::LeadData::Builder::getRelA() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void ModelData::LeadData::Builder::setRelA(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float ModelData::LeadData::Reader::getRelAStd() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float ModelData::LeadData::Builder::getRelAStd() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void ModelData::LeadData::Builder::setRelAStd(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t ModelData::ModelSettings::Reader::getBigBoxX() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t ModelData::ModelSettings::Builder::getBigBoxX() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ModelData::ModelSettings::Builder::setBigBoxX( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t ModelData::ModelSettings::Reader::getBigBoxY() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t ModelData::ModelSettings::Builder::getBigBoxY() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ModelData::ModelSettings::Builder::setBigBoxY( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t ModelData::ModelSettings::Reader::getBigBoxWidth() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t ModelData::ModelSettings::Builder::getBigBoxWidth() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ModelData::ModelSettings::Builder::setBigBoxWidth( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t ModelData::ModelSettings::Reader::getBigBoxHeight() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t ModelData::ModelSettings::Builder::getBigBoxHeight() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void ModelData::ModelSettings::Builder::setBigBoxHeight( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelData::ModelSettings::Reader::hasBoxProjection() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::ModelSettings::Builder::hasBoxProjection() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelData::ModelSettings::Reader::getBoxProjection() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelData::ModelSettings::Builder::getBoxProjection() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ModelData::ModelSettings::Builder::setBoxProjection( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void ModelData::ModelSettings::Builder::setBoxProjection(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelData::ModelSettings::Builder::initBoxProjection(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void ModelData::ModelSettings::Builder::adoptBoxProjection( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelData::ModelSettings::Builder::disownBoxProjection() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool ModelData::ModelSettings::Reader::hasYuvCorrection() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::ModelSettings::Builder::hasYuvCorrection() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelData::ModelSettings::Reader::getYuvCorrection() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelData::ModelSettings::Builder::getYuvCorrection() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void ModelData::ModelSettings::Builder::setYuvCorrection( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void ModelData::ModelSettings::Builder::setYuvCorrection(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelData::ModelSettings::Builder::initYuvCorrection(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void ModelData::ModelSettings::Builder::adoptYuvCorrection( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelData::ModelSettings::Builder::disownYuvCorrection() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool ModelData::ModelSettings::Reader::hasInputTransform() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::ModelSettings::Builder::hasInputTransform() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelData::ModelSettings::Reader::getInputTransform() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelData::ModelSettings::Builder::getInputTransform() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void ModelData::ModelSettings::Builder::setInputTransform( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void ModelData::ModelSettings::Builder::setInputTransform(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelData::ModelSettings::Builder::initInputTransform(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void ModelData::ModelSettings::Builder::adoptInputTransform( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelData::ModelSettings::Builder::disownInputTransform() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline float ModelData::MetaData::Reader::getEngagedProb() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float ModelData::MetaData::Builder::getEngagedProb() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ModelData::MetaData::Builder::setEngagedProb(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelData::MetaData::Reader::hasDesirePrediction() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::MetaData::Builder::hasDesirePrediction() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelData::MetaData::Reader::getDesirePrediction() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelData::MetaData::Builder::getDesirePrediction() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ModelData::MetaData::Builder::setDesirePrediction( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void ModelData::MetaData::Builder::setDesirePrediction(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelData::MetaData::Builder::initDesirePrediction(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void ModelData::MetaData::Builder::adoptDesirePrediction( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelData::MetaData::Builder::disownDesirePrediction() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline float ModelData::MetaData::Reader::getBrakeDisengageProb() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float ModelData::MetaData::Builder::getBrakeDisengageProb() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ModelData::MetaData::Builder::setBrakeDisengageProb(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ModelData::MetaData::Reader::getGasDisengageProb() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float ModelData::MetaData::Builder::getGasDisengageProb() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ModelData::MetaData::Builder::setGasDisengageProb(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float ModelData::MetaData::Reader::getSteerOverrideProb() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float ModelData::MetaData::Builder::getSteerOverrideProb() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void ModelData::MetaData::Builder::setSteerOverrideProb(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelData::MetaData::Reader::hasDesireState() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::MetaData::Builder::hasDesireState() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelData::MetaData::Reader::getDesireState() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelData::MetaData::Builder::getDesireState() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void ModelData::MetaData::Builder::setDesireState( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void ModelData::MetaData::Builder::setDesireState(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelData::MetaData::Builder::initDesireState(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void ModelData::MetaData::Builder::adoptDesireState( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelData::MetaData::Builder::disownDesireState() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool ModelData::LongitudinalData::Reader::hasSpeeds() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::LongitudinalData::Builder::hasSpeeds() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelData::LongitudinalData::Reader::getSpeeds() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelData::LongitudinalData::Builder::getSpeeds() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ModelData::LongitudinalData::Builder::setSpeeds( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void ModelData::LongitudinalData::Builder::setSpeeds(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelData::LongitudinalData::Builder::initSpeeds(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void ModelData::LongitudinalData::Builder::adoptSpeeds( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelData::LongitudinalData::Builder::disownSpeeds() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool ModelData::LongitudinalData::Reader::hasAccelerations() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::LongitudinalData::Builder::hasAccelerations() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelData::LongitudinalData::Reader::getAccelerations() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelData::LongitudinalData::Builder::getAccelerations() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void ModelData::LongitudinalData::Builder::setAccelerations( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void ModelData::LongitudinalData::Builder::setAccelerations(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelData::LongitudinalData::Builder::initAccelerations(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void ModelData::LongitudinalData::Builder::adoptAccelerations( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelData::LongitudinalData::Builder::disownAccelerations() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool ModelData::LongitudinalData::Reader::hasDistances() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelData::LongitudinalData::Builder::hasDistances() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelData::LongitudinalData::Reader::getDistances() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelData::LongitudinalData::Builder::getDistances() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void ModelData::LongitudinalData::Builder::setDistances( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void ModelData::LongitudinalData::Builder::setDistances(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelData::LongitudinalData::Builder::initDistances(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void ModelData::LongitudinalData::Builder::adoptDistances( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelData::LongitudinalData::Builder::disownDistances() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline double ECEFPoint::Reader::getX() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline double ECEFPoint::Builder::getX() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ECEFPoint::Builder::setX(double value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline double ECEFPoint::Reader::getY() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline double ECEFPoint::Builder::getY() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ECEFPoint::Builder::setY(double value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline double ECEFPoint::Reader::getZ() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline double ECEFPoint::Builder::getZ() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ECEFPoint::Builder::setZ(double value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float ECEFPointDEPRECATED::Reader::getX() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float ECEFPointDEPRECATED::Builder::getX() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ECEFPointDEPRECATED::Builder::setX(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float ECEFPointDEPRECATED::Reader::getY() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float ECEFPointDEPRECATED::Builder::getY() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ECEFPointDEPRECATED::Builder::setY(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ECEFPointDEPRECATED::Reader::getZ() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float ECEFPointDEPRECATED::Builder::getZ() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ECEFPointDEPRECATED::Builder::setZ(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool GPSPlannerPoints::Reader::hasCurPosDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool GPSPlannerPoints::Builder::hasCurPosDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ECEFPointDEPRECATED::Reader GPSPlannerPoints::Reader::getCurPosDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPointDEPRECATED>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::ECEFPointDEPRECATED::Builder GPSPlannerPoints::Builder::getCurPosDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPointDEPRECATED>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ECEFPointDEPRECATED::Pipeline GPSPlannerPoints::Pipeline::getCurPosDEPRECATED() { + return ::cereal::ECEFPointDEPRECATED::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void GPSPlannerPoints::Builder::setCurPosDEPRECATED( ::cereal::ECEFPointDEPRECATED::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ECEFPointDEPRECATED>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::ECEFPointDEPRECATED::Builder GPSPlannerPoints::Builder::initCurPosDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPointDEPRECATED>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void GPSPlannerPoints::Builder::adoptCurPosDEPRECATED( + ::capnp::Orphan< ::cereal::ECEFPointDEPRECATED>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ECEFPointDEPRECATED>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ECEFPointDEPRECATED> GPSPlannerPoints::Builder::disownCurPosDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPointDEPRECATED>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool GPSPlannerPoints::Reader::hasPointsDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool GPSPlannerPoints::Builder::hasPointsDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Reader GPSPlannerPoints::Reader::getPointsDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Builder GPSPlannerPoints::Builder::getPointsDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void GPSPlannerPoints::Builder::setPointsDEPRECATED( ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Builder GPSPlannerPoints::Builder::initPointsDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void GPSPlannerPoints::Builder::adoptPointsDEPRECATED( + ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>> GPSPlannerPoints::Builder::disownPointsDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool GPSPlannerPoints::Reader::getValid() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool GPSPlannerPoints::Builder::getValid() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void GPSPlannerPoints::Builder::setValid(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool GPSPlannerPoints::Reader::hasTrackName() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool GPSPlannerPoints::Builder::hasTrackName() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader GPSPlannerPoints::Reader::getTrackName() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder GPSPlannerPoints::Builder::getTrackName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void GPSPlannerPoints::Builder::setTrackName( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder GPSPlannerPoints::Builder::initTrackName(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void GPSPlannerPoints::Builder::adoptTrackName( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> GPSPlannerPoints::Builder::disownTrackName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline float GPSPlannerPoints::Reader::getSpeedLimit() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float GPSPlannerPoints::Builder::getSpeedLimit() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void GPSPlannerPoints::Builder::setSpeedLimit(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float GPSPlannerPoints::Reader::getAccelTarget() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float GPSPlannerPoints::Builder::getAccelTarget() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void GPSPlannerPoints::Builder::setAccelTarget(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool GPSPlannerPoints::Reader::hasCurPos() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool GPSPlannerPoints::Builder::hasCurPos() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ECEFPoint::Reader GPSPlannerPoints::Reader::getCurPos() const { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::cereal::ECEFPoint::Builder GPSPlannerPoints::Builder::getCurPos() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ECEFPoint::Pipeline GPSPlannerPoints::Pipeline::getCurPos() { + return ::cereal::ECEFPoint::Pipeline(_typeless.getPointerField(3)); +} +#endif // !CAPNP_LITE +inline void GPSPlannerPoints::Builder::setCurPos( ::cereal::ECEFPoint::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::cereal::ECEFPoint::Builder GPSPlannerPoints::Builder::initCurPos() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void GPSPlannerPoints::Builder::adoptCurPos( + ::capnp::Orphan< ::cereal::ECEFPoint>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ECEFPoint> GPSPlannerPoints::Builder::disownCurPos() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool GPSPlannerPoints::Reader::hasPoints() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool GPSPlannerPoints::Builder::hasPoints() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Reader GPSPlannerPoints::Reader::getPoints() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Builder GPSPlannerPoints::Builder::getPoints() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void GPSPlannerPoints::Builder::setPoints( ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Builder GPSPlannerPoints::Builder::initPoints(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void GPSPlannerPoints::Builder::adoptPoints( + ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>> GPSPlannerPoints::Builder::disownPoints() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool GPSPlannerPlan::Reader::getValid() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool GPSPlannerPlan::Builder::getValid() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void GPSPlannerPlan::Builder::setValid(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool GPSPlannerPlan::Reader::hasPoly() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool GPSPlannerPlan::Builder::hasPoly() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader GPSPlannerPlan::Reader::getPoly() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder GPSPlannerPlan::Builder::getPoly() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void GPSPlannerPlan::Builder::setPoly( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void GPSPlannerPlan::Builder::setPoly(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder GPSPlannerPlan::Builder::initPoly(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void GPSPlannerPlan::Builder::adoptPoly( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> GPSPlannerPlan::Builder::disownPoly() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool GPSPlannerPlan::Reader::hasTrackName() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool GPSPlannerPlan::Builder::hasTrackName() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader GPSPlannerPlan::Reader::getTrackName() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder GPSPlannerPlan::Builder::getTrackName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void GPSPlannerPlan::Builder::setTrackName( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder GPSPlannerPlan::Builder::initTrackName(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void GPSPlannerPlan::Builder::adoptTrackName( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> GPSPlannerPlan::Builder::disownTrackName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline float GPSPlannerPlan::Reader::getSpeed() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float GPSPlannerPlan::Builder::getSpeed() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void GPSPlannerPlan::Builder::setSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float GPSPlannerPlan::Reader::getAcceleration() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float GPSPlannerPlan::Builder::getAcceleration() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void GPSPlannerPlan::Builder::setAcceleration(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool GPSPlannerPlan::Reader::hasPointsDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool GPSPlannerPlan::Builder::hasPointsDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Reader GPSPlannerPlan::Reader::getPointsDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Builder GPSPlannerPlan::Builder::getPointsDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void GPSPlannerPlan::Builder::setPointsDEPRECATED( ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>::Builder GPSPlannerPlan::Builder::initPointsDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void GPSPlannerPlan::Builder::adoptPointsDEPRECATED( + ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>> GPSPlannerPlan::Builder::disownPointsDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPointDEPRECATED, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool GPSPlannerPlan::Reader::hasPoints() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool GPSPlannerPlan::Builder::hasPoints() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Reader GPSPlannerPlan::Reader::getPoints() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Builder GPSPlannerPlan::Builder::getPoints() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void GPSPlannerPlan::Builder::setPoints( ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Builder GPSPlannerPlan::Builder::initPoints(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void GPSPlannerPlan::Builder::adoptPoints( + ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>> GPSPlannerPlan::Builder::disownPoints() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline float GPSPlannerPlan::Reader::getXLookahead() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float GPSPlannerPlan::Builder::getXLookahead() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void GPSPlannerPlan::Builder::setXLookahead(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::UiNavigationEvent::Type UiNavigationEvent::Reader::getType() const { + return _reader.getDataField< ::cereal::UiNavigationEvent::Type>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::cereal::UiNavigationEvent::Type UiNavigationEvent::Builder::getType() { + return _builder.getDataField< ::cereal::UiNavigationEvent::Type>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void UiNavigationEvent::Builder::setType( ::cereal::UiNavigationEvent::Type value) { + _builder.setDataField< ::cereal::UiNavigationEvent::Type>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::UiNavigationEvent::Status UiNavigationEvent::Reader::getStatus() const { + return _reader.getDataField< ::cereal::UiNavigationEvent::Status>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::cereal::UiNavigationEvent::Status UiNavigationEvent::Builder::getStatus() { + return _builder.getDataField< ::cereal::UiNavigationEvent::Status>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void UiNavigationEvent::Builder::setStatus( ::cereal::UiNavigationEvent::Status value) { + _builder.setDataField< ::cereal::UiNavigationEvent::Status>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float UiNavigationEvent::Reader::getDistanceTo() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float UiNavigationEvent::Builder::getDistanceTo() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void UiNavigationEvent::Builder::setDistanceTo(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool UiNavigationEvent::Reader::hasEndRoadPointDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool UiNavigationEvent::Builder::hasEndRoadPointDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ECEFPointDEPRECATED::Reader UiNavigationEvent::Reader::getEndRoadPointDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPointDEPRECATED>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::ECEFPointDEPRECATED::Builder UiNavigationEvent::Builder::getEndRoadPointDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPointDEPRECATED>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ECEFPointDEPRECATED::Pipeline UiNavigationEvent::Pipeline::getEndRoadPointDEPRECATED() { + return ::cereal::ECEFPointDEPRECATED::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void UiNavigationEvent::Builder::setEndRoadPointDEPRECATED( ::cereal::ECEFPointDEPRECATED::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ECEFPointDEPRECATED>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::ECEFPointDEPRECATED::Builder UiNavigationEvent::Builder::initEndRoadPointDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPointDEPRECATED>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UiNavigationEvent::Builder::adoptEndRoadPointDEPRECATED( + ::capnp::Orphan< ::cereal::ECEFPointDEPRECATED>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ECEFPointDEPRECATED>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ECEFPointDEPRECATED> UiNavigationEvent::Builder::disownEndRoadPointDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPointDEPRECATED>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool UiNavigationEvent::Reader::hasEndRoadPoint() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool UiNavigationEvent::Builder::hasEndRoadPoint() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ECEFPoint::Reader UiNavigationEvent::Reader::getEndRoadPoint() const { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::cereal::ECEFPoint::Builder UiNavigationEvent::Builder::getEndRoadPoint() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ECEFPoint::Pipeline UiNavigationEvent::Pipeline::getEndRoadPoint() { + return ::cereal::ECEFPoint::Pipeline(_typeless.getPointerField(1)); +} +#endif // !CAPNP_LITE +inline void UiNavigationEvent::Builder::setEndRoadPoint( ::cereal::ECEFPoint::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::cereal::ECEFPoint::Builder UiNavigationEvent::Builder::initEndRoadPoint() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void UiNavigationEvent::Builder::adoptEndRoadPoint( + ::capnp::Orphan< ::cereal::ECEFPoint>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ECEFPoint> UiNavigationEvent::Builder::disownEndRoadPoint() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline ::uint8_t LiveLocationData::Reader::getStatus() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t LiveLocationData::Builder::getStatus() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setStatus( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline double LiveLocationData::Reader::getLat() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline double LiveLocationData::Builder::getLat() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setLat(double value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline double LiveLocationData::Reader::getLon() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline double LiveLocationData::Builder::getLon() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setLon(double value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float LiveLocationData::Reader::getAlt() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Builder::getAlt() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setAlt(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float LiveLocationData::Reader::getSpeed() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Builder::getSpeed() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveLocationData::Reader::hasVNED() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationData::Builder::hasVNED() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLocationData::Reader::getVNED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLocationData::Builder::getVNED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LiveLocationData::Builder::setVNED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void LiveLocationData::Builder::setVNED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLocationData::Builder::initVNED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void LiveLocationData::Builder::adoptVNED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLocationData::Builder::disownVNED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline float LiveLocationData::Reader::getRoll() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Builder::getRoll() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setRoll(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float LiveLocationData::Reader::getPitch() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Builder::getPitch() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setPitch(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float LiveLocationData::Reader::getHeading() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Builder::getHeading() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setHeading(float value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline float LiveLocationData::Reader::getWanderAngle() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Builder::getWanderAngle() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setWanderAngle(float value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline float LiveLocationData::Reader::getTrackAngle() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Builder::getTrackAngle() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setTrackAngle(float value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveLocationData::Reader::hasGyro() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationData::Builder::hasGyro() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLocationData::Reader::getGyro() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLocationData::Builder::getGyro() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void LiveLocationData::Builder::setGyro( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void LiveLocationData::Builder::setGyro(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLocationData::Builder::initGyro(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void LiveLocationData::Builder::adoptGyro( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLocationData::Builder::disownGyro() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationData::Reader::hasAccel() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationData::Builder::hasAccel() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLocationData::Reader::getAccel() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLocationData::Builder::getAccel() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void LiveLocationData::Builder::setAccel( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void LiveLocationData::Builder::setAccel(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLocationData::Builder::initAccel(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void LiveLocationData::Builder::adoptAccel( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLocationData::Builder::disownAccel() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationData::Reader::hasAccuracy() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationData::Builder::hasAccuracy() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationData::Accuracy::Reader LiveLocationData::Reader::getAccuracy() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData::Accuracy>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationData::Accuracy::Builder LiveLocationData::Builder::getAccuracy() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData::Accuracy>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationData::Accuracy::Pipeline LiveLocationData::Pipeline::getAccuracy() { + return ::cereal::LiveLocationData::Accuracy::Pipeline(_typeless.getPointerField(3)); +} +#endif // !CAPNP_LITE +inline void LiveLocationData::Builder::setAccuracy( ::cereal::LiveLocationData::Accuracy::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationData::Accuracy>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationData::Accuracy::Builder LiveLocationData::Builder::initAccuracy() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData::Accuracy>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void LiveLocationData::Builder::adoptAccuracy( + ::capnp::Orphan< ::cereal::LiveLocationData::Accuracy>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationData::Accuracy>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationData::Accuracy> LiveLocationData::Builder::disownAccuracy() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData::Accuracy>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline ::cereal::LiveLocationData::SensorSource LiveLocationData::Reader::getSource() const { + return _reader.getDataField< ::cereal::LiveLocationData::SensorSource>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::cereal::LiveLocationData::SensorSource LiveLocationData::Builder::getSource() { + return _builder.getDataField< ::cereal::LiveLocationData::SensorSource>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setSource( ::cereal::LiveLocationData::SensorSource value) { + _builder.setDataField< ::cereal::LiveLocationData::SensorSource>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t LiveLocationData::Reader::getFixMonoTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t LiveLocationData::Builder::getFixMonoTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setFixMonoTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t LiveLocationData::Reader::getGpsWeek() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline ::int32_t LiveLocationData::Builder::getGpsWeek() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setGpsWeek( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline double LiveLocationData::Reader::getTimeOfWeek() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline double LiveLocationData::Builder::getTimeOfWeek() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setTimeOfWeek(double value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveLocationData::Reader::hasPositionECEF() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationData::Builder::hasPositionECEF() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLocationData::Reader::getPositionECEF() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLocationData::Builder::getPositionECEF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void LiveLocationData::Builder::setPositionECEF( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void LiveLocationData::Builder::setPositionECEF(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLocationData::Builder::initPositionECEF(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void LiveLocationData::Builder::adoptPositionECEF( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLocationData::Builder::disownPositionECEF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationData::Reader::hasPoseQuatECEF() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationData::Builder::hasPoseQuatECEF() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLocationData::Reader::getPoseQuatECEF() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLocationData::Builder::getPoseQuatECEF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void LiveLocationData::Builder::setPoseQuatECEF( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void LiveLocationData::Builder::setPoseQuatECEF(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLocationData::Builder::initPoseQuatECEF(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void LiveLocationData::Builder::adoptPoseQuatECEF( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLocationData::Builder::disownPoseQuatECEF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline float LiveLocationData::Reader::getPitchCalibration() const { + return _reader.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Builder::getPitchCalibration() { + return _builder.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setPitchCalibration(float value) { + _builder.setDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline float LiveLocationData::Reader::getYawCalibration() const { + return _reader.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Builder::getYawCalibration() { + return _builder.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Builder::setYawCalibration(float value) { + _builder.setDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveLocationData::Reader::hasImuFrame() const { + return !_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationData::Builder::hasImuFrame() { + return !_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLocationData::Reader::getImuFrame() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLocationData::Builder::getImuFrame() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline void LiveLocationData::Builder::setImuFrame( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline void LiveLocationData::Builder::setImuFrame(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLocationData::Builder::initImuFrame(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), size); +} +inline void LiveLocationData::Builder::adoptImuFrame( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLocationData::Builder::disownImuFrame() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationData::Accuracy::Reader::hasPNEDError() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationData::Accuracy::Builder::hasPNEDError() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLocationData::Accuracy::Reader::getPNEDError() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLocationData::Accuracy::Builder::getPNEDError() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LiveLocationData::Accuracy::Builder::setPNEDError( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void LiveLocationData::Accuracy::Builder::setPNEDError(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLocationData::Accuracy::Builder::initPNEDError(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void LiveLocationData::Accuracy::Builder::adoptPNEDError( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLocationData::Accuracy::Builder::disownPNEDError() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationData::Accuracy::Reader::hasVNEDError() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationData::Accuracy::Builder::hasVNEDError() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLocationData::Accuracy::Reader::getVNEDError() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLocationData::Accuracy::Builder::getVNEDError() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void LiveLocationData::Accuracy::Builder::setVNEDError( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void LiveLocationData::Accuracy::Builder::setVNEDError(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLocationData::Accuracy::Builder::initVNEDError(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void LiveLocationData::Accuracy::Builder::adoptVNEDError( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLocationData::Accuracy::Builder::disownVNEDError() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline float LiveLocationData::Accuracy::Reader::getRollError() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Accuracy::Builder::getRollError() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Accuracy::Builder::setRollError(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float LiveLocationData::Accuracy::Reader::getPitchError() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Accuracy::Builder::getPitchError() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Accuracy::Builder::setPitchError(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float LiveLocationData::Accuracy::Reader::getHeadingError() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Accuracy::Builder::getHeadingError() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Accuracy::Builder::setHeadingError(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float LiveLocationData::Accuracy::Reader::getEllipsoidSemiMajorError() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Accuracy::Builder::getEllipsoidSemiMajorError() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Accuracy::Builder::setEllipsoidSemiMajorError(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float LiveLocationData::Accuracy::Reader::getEllipsoidSemiMinorError() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Accuracy::Builder::getEllipsoidSemiMinorError() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Accuracy::Builder::setEllipsoidSemiMinorError(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float LiveLocationData::Accuracy::Reader::getEllipsoidOrientationError() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float LiveLocationData::Accuracy::Builder::getEllipsoidOrientationError() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void LiveLocationData::Accuracy::Builder::setEllipsoidOrientationError(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t OrbOdometry::Reader::getStartMonoTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t OrbOdometry::Builder::getStartMonoTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void OrbOdometry::Builder::setStartMonoTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t OrbOdometry::Reader::getEndMonoTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t OrbOdometry::Builder::getEndMonoTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void OrbOdometry::Builder::setEndMonoTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool OrbOdometry::Reader::hasF() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbOdometry::Builder::hasF() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader OrbOdometry::Reader::getF() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder OrbOdometry::Builder::getF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void OrbOdometry::Builder::setF( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void OrbOdometry::Builder::setF(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder OrbOdometry::Builder::initF(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void OrbOdometry::Builder::adoptF( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> OrbOdometry::Builder::disownF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline double OrbOdometry::Reader::getErr() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline double OrbOdometry::Builder::getErr() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void OrbOdometry::Builder::setErr(double value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t OrbOdometry::Reader::getInliers() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::int32_t OrbOdometry::Builder::getInliers() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void OrbOdometry::Builder::setInliers( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool OrbOdometry::Reader::hasMatches() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbOdometry::Builder::hasMatches() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Reader OrbOdometry::Reader::getMatches() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Builder OrbOdometry::Builder::getMatches() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void OrbOdometry::Builder::setMatches( ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void OrbOdometry::Builder::setMatches(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Builder OrbOdometry::Builder::initMatches(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void OrbOdometry::Builder::adoptMatches( + ::capnp::Orphan< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>> OrbOdometry::Builder::disownMatches() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline ::uint64_t OrbFeatures::Reader::getTimestampEof() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t OrbFeatures::Builder::getTimestampEof() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void OrbFeatures::Builder::setTimestampEof( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool OrbFeatures::Reader::hasXs() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbFeatures::Builder::hasXs() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader OrbFeatures::Reader::getXs() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder OrbFeatures::Builder::getXs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void OrbFeatures::Builder::setXs( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void OrbFeatures::Builder::setXs(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder OrbFeatures::Builder::initXs(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void OrbFeatures::Builder::adoptXs( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> OrbFeatures::Builder::disownXs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool OrbFeatures::Reader::hasYs() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbFeatures::Builder::hasYs() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader OrbFeatures::Reader::getYs() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder OrbFeatures::Builder::getYs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void OrbFeatures::Builder::setYs( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void OrbFeatures::Builder::setYs(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder OrbFeatures::Builder::initYs(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void OrbFeatures::Builder::adoptYs( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> OrbFeatures::Builder::disownYs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool OrbFeatures::Reader::hasDescriptors() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbFeatures::Builder::hasDescriptors() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader OrbFeatures::Reader::getDescriptors() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder OrbFeatures::Builder::getDescriptors() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void OrbFeatures::Builder::setDescriptors( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder OrbFeatures::Builder::initDescriptors(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void OrbFeatures::Builder::adoptDescriptors( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> OrbFeatures::Builder::disownDescriptors() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool OrbFeatures::Reader::hasOctaves() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbFeatures::Builder::hasOctaves() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Reader OrbFeatures::Reader::getOctaves() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Builder OrbFeatures::Builder::getOctaves() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void OrbFeatures::Builder::setOctaves( ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void OrbFeatures::Builder::setOctaves(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Builder OrbFeatures::Builder::initOctaves(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void OrbFeatures::Builder::adoptOctaves( + ::capnp::Orphan< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>> OrbFeatures::Builder::disownOctaves() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline ::uint64_t OrbFeatures::Reader::getTimestampLastEof() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t OrbFeatures::Builder::getTimestampLastEof() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void OrbFeatures::Builder::setTimestampLastEof( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool OrbFeatures::Reader::hasMatches() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbFeatures::Builder::hasMatches() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Reader OrbFeatures::Reader::getMatches() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Builder OrbFeatures::Builder::getMatches() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void OrbFeatures::Builder::setMatches( ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void OrbFeatures::Builder::setMatches(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Builder OrbFeatures::Builder::initMatches(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void OrbFeatures::Builder::adoptMatches( + ::capnp::Orphan< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>> OrbFeatures::Builder::disownMatches() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline ::uint64_t OrbFeaturesSummary::Reader::getTimestampEof() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t OrbFeaturesSummary::Builder::getTimestampEof() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void OrbFeaturesSummary::Builder::setTimestampEof( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t OrbFeaturesSummary::Reader::getTimestampLastEof() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t OrbFeaturesSummary::Builder::getTimestampLastEof() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void OrbFeaturesSummary::Builder::setTimestampLastEof( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t OrbFeaturesSummary::Reader::getFeatureCount() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t OrbFeaturesSummary::Builder::getFeatureCount() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void OrbFeaturesSummary::Builder::setFeatureCount( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t OrbFeaturesSummary::Reader::getMatchCount() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t OrbFeaturesSummary::Builder::getMatchCount() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void OrbFeaturesSummary::Builder::setMatchCount( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t OrbFeaturesSummary::Reader::getComputeNs() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t OrbFeaturesSummary::Builder::getComputeNs() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void OrbFeaturesSummary::Builder::setComputeNs( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t OrbKeyFrame::Reader::getId() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t OrbKeyFrame::Builder::getId() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void OrbKeyFrame::Builder::setId( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool OrbKeyFrame::Reader::hasPos() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbKeyFrame::Builder::hasPos() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ECEFPoint::Reader OrbKeyFrame::Reader::getPos() const { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::ECEFPoint::Builder OrbKeyFrame::Builder::getPos() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ECEFPoint::Pipeline OrbKeyFrame::Pipeline::getPos() { + return ::cereal::ECEFPoint::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void OrbKeyFrame::Builder::setPos( ::cereal::ECEFPoint::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::ECEFPoint::Builder OrbKeyFrame::Builder::initPos() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void OrbKeyFrame::Builder::adoptPos( + ::capnp::Orphan< ::cereal::ECEFPoint>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ECEFPoint> OrbKeyFrame::Builder::disownPos() { + return ::capnp::_::PointerHelpers< ::cereal::ECEFPoint>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool OrbKeyFrame::Reader::hasDpos() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbKeyFrame::Builder::hasDpos() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Reader OrbKeyFrame::Reader::getDpos() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Builder OrbKeyFrame::Builder::getDpos() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void OrbKeyFrame::Builder::setDpos( ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>::Builder OrbKeyFrame::Builder::initDpos(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void OrbKeyFrame::Builder::adoptDpos( + ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>> OrbKeyFrame::Builder::disownDpos() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ECEFPoint, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool OrbKeyFrame::Reader::hasDescriptors() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbKeyFrame::Builder::hasDescriptors() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader OrbKeyFrame::Reader::getDescriptors() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder OrbKeyFrame::Builder::getDescriptors() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void OrbKeyFrame::Builder::setDescriptors( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder OrbKeyFrame::Builder::initDescriptors(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void OrbKeyFrame::Builder::adoptDescriptors( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> OrbKeyFrame::Builder::disownDescriptors() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool KalmanOdometry::Reader::hasTrans() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool KalmanOdometry::Builder::hasTrans() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader KalmanOdometry::Reader::getTrans() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder KalmanOdometry::Builder::getTrans() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void KalmanOdometry::Builder::setTrans( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void KalmanOdometry::Builder::setTrans(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder KalmanOdometry::Builder::initTrans(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void KalmanOdometry::Builder::adoptTrans( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> KalmanOdometry::Builder::disownTrans() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool KalmanOdometry::Reader::hasRot() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool KalmanOdometry::Builder::hasRot() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader KalmanOdometry::Reader::getRot() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder KalmanOdometry::Builder::getRot() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void KalmanOdometry::Builder::setRot( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void KalmanOdometry::Builder::setRot(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder KalmanOdometry::Builder::initRot(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void KalmanOdometry::Builder::adoptRot( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> KalmanOdometry::Builder::disownRot() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool KalmanOdometry::Reader::hasTransStd() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool KalmanOdometry::Builder::hasTransStd() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader KalmanOdometry::Reader::getTransStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder KalmanOdometry::Builder::getTransStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void KalmanOdometry::Builder::setTransStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void KalmanOdometry::Builder::setTransStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder KalmanOdometry::Builder::initTransStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void KalmanOdometry::Builder::adoptTransStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> KalmanOdometry::Builder::disownTransStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool KalmanOdometry::Reader::hasRotStd() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool KalmanOdometry::Builder::hasRotStd() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader KalmanOdometry::Reader::getRotStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder KalmanOdometry::Builder::getRotStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void KalmanOdometry::Builder::setRotStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void KalmanOdometry::Builder::setRotStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder KalmanOdometry::Builder::initRotStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void KalmanOdometry::Builder::adoptRotStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> KalmanOdometry::Builder::disownRotStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline ::uint64_t OrbObservation::Reader::getObservationMonoTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t OrbObservation::Builder::getObservationMonoTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void OrbObservation::Builder::setObservationMonoTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool OrbObservation::Reader::hasNormalizedCoordinates() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbObservation::Builder::hasNormalizedCoordinates() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader OrbObservation::Reader::getNormalizedCoordinates() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder OrbObservation::Builder::getNormalizedCoordinates() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void OrbObservation::Builder::setNormalizedCoordinates( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void OrbObservation::Builder::setNormalizedCoordinates(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder OrbObservation::Builder::initNormalizedCoordinates(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void OrbObservation::Builder::adoptNormalizedCoordinates( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> OrbObservation::Builder::disownNormalizedCoordinates() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool OrbObservation::Reader::hasLocationECEF() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool OrbObservation::Builder::hasLocationECEF() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader OrbObservation::Reader::getLocationECEF() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder OrbObservation::Builder::getLocationECEF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void OrbObservation::Builder::setLocationECEF( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void OrbObservation::Builder::setLocationECEF(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder OrbObservation::Builder::initLocationECEF(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void OrbObservation::Builder::adoptLocationECEF( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> OrbObservation::Builder::disownLocationECEF() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline ::uint32_t OrbObservation::Reader::getMatchDistance() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t OrbObservation::Builder::getMatchDistance() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void OrbObservation::Builder::setMatchDistance( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t CalibrationFeatures::Reader::getFrameId() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t CalibrationFeatures::Builder::getFrameId() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CalibrationFeatures::Builder::setFrameId( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool CalibrationFeatures::Reader::hasP0() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool CalibrationFeatures::Builder::hasP0() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CalibrationFeatures::Reader::getP0() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CalibrationFeatures::Builder::getP0() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void CalibrationFeatures::Builder::setP0( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void CalibrationFeatures::Builder::setP0(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CalibrationFeatures::Builder::initP0(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void CalibrationFeatures::Builder::adoptP0( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CalibrationFeatures::Builder::disownP0() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool CalibrationFeatures::Reader::hasP1() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool CalibrationFeatures::Builder::hasP1() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CalibrationFeatures::Reader::getP1() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CalibrationFeatures::Builder::getP1() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void CalibrationFeatures::Builder::setP1( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void CalibrationFeatures::Builder::setP1(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CalibrationFeatures::Builder::initP1(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void CalibrationFeatures::Builder::adoptP1( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CalibrationFeatures::Builder::disownP1() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool CalibrationFeatures::Reader::hasStatus() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool CalibrationFeatures::Builder::hasStatus() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Reader CalibrationFeatures::Reader::getStatus() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Builder CalibrationFeatures::Builder::getStatus() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void CalibrationFeatures::Builder::setStatus( ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void CalibrationFeatures::Builder::setStatus(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Builder CalibrationFeatures::Builder::initStatus(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void CalibrationFeatures::Builder::adoptStatus( + ::capnp::Orphan< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>> CalibrationFeatures::Builder::disownStatus() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool NavStatus::Reader::getIsNavigating() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool NavStatus::Builder::getIsNavigating() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void NavStatus::Builder::setIsNavigating(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool NavStatus::Reader::hasCurrentAddress() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool NavStatus::Builder::hasCurrentAddress() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::NavStatus::Address::Reader NavStatus::Reader::getCurrentAddress() const { + return ::capnp::_::PointerHelpers< ::cereal::NavStatus::Address>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::NavStatus::Address::Builder NavStatus::Builder::getCurrentAddress() { + return ::capnp::_::PointerHelpers< ::cereal::NavStatus::Address>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::NavStatus::Address::Pipeline NavStatus::Pipeline::getCurrentAddress() { + return ::cereal::NavStatus::Address::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void NavStatus::Builder::setCurrentAddress( ::cereal::NavStatus::Address::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::NavStatus::Address>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::NavStatus::Address::Builder NavStatus::Builder::initCurrentAddress() { + return ::capnp::_::PointerHelpers< ::cereal::NavStatus::Address>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void NavStatus::Builder::adoptCurrentAddress( + ::capnp::Orphan< ::cereal::NavStatus::Address>&& value) { + ::capnp::_::PointerHelpers< ::cereal::NavStatus::Address>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::NavStatus::Address> NavStatus::Builder::disownCurrentAddress() { + return ::capnp::_::PointerHelpers< ::cereal::NavStatus::Address>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool NavStatus::Address::Reader::hasTitle() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool NavStatus::Address::Builder::hasTitle() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader NavStatus::Address::Reader::getTitle() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder NavStatus::Address::Builder::getTitle() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void NavStatus::Address::Builder::setTitle( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder NavStatus::Address::Builder::initTitle(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void NavStatus::Address::Builder::adoptTitle( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> NavStatus::Address::Builder::disownTitle() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline double NavStatus::Address::Reader::getLat() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline double NavStatus::Address::Builder::getLat() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void NavStatus::Address::Builder::setLat(double value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline double NavStatus::Address::Reader::getLng() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline double NavStatus::Address::Builder::getLng() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void NavStatus::Address::Builder::setLng(double value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool NavStatus::Address::Reader::hasHouse() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool NavStatus::Address::Builder::hasHouse() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader NavStatus::Address::Reader::getHouse() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder NavStatus::Address::Builder::getHouse() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void NavStatus::Address::Builder::setHouse( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder NavStatus::Address::Builder::initHouse(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void NavStatus::Address::Builder::adoptHouse( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> NavStatus::Address::Builder::disownHouse() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool NavStatus::Address::Reader::hasAddress() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool NavStatus::Address::Builder::hasAddress() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader NavStatus::Address::Reader::getAddress() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder NavStatus::Address::Builder::getAddress() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void NavStatus::Address::Builder::setAddress( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder NavStatus::Address::Builder::initAddress(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void NavStatus::Address::Builder::adoptAddress( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> NavStatus::Address::Builder::disownAddress() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool NavStatus::Address::Reader::hasStreet() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool NavStatus::Address::Builder::hasStreet() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader NavStatus::Address::Reader::getStreet() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder NavStatus::Address::Builder::getStreet() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void NavStatus::Address::Builder::setStreet( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder NavStatus::Address::Builder::initStreet(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void NavStatus::Address::Builder::adoptStreet( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> NavStatus::Address::Builder::disownStreet() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool NavStatus::Address::Reader::hasCity() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool NavStatus::Address::Builder::hasCity() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader NavStatus::Address::Reader::getCity() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder NavStatus::Address::Builder::getCity() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void NavStatus::Address::Builder::setCity( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder NavStatus::Address::Builder::initCity(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void NavStatus::Address::Builder::adoptCity( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> NavStatus::Address::Builder::disownCity() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool NavStatus::Address::Reader::hasState() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool NavStatus::Address::Builder::hasState() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader NavStatus::Address::Reader::getState() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder NavStatus::Address::Builder::getState() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void NavStatus::Address::Builder::setState( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder NavStatus::Address::Builder::initState(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void NavStatus::Address::Builder::adoptState( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> NavStatus::Address::Builder::disownState() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool NavStatus::Address::Reader::hasCountry() const { + return !_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline bool NavStatus::Address::Builder::hasCountry() { + return !_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader NavStatus::Address::Reader::getCountry() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder NavStatus::Address::Builder::getCountry() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline void NavStatus::Address::Builder::setCountry( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder NavStatus::Address::Builder::initCountry(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), size); +} +inline void NavStatus::Address::Builder::adoptCountry( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> NavStatus::Address::Builder::disownCountry() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} + +inline bool NavUpdate::Reader::getIsNavigating() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool NavUpdate::Builder::getIsNavigating() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void NavUpdate::Builder::setIsNavigating(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t NavUpdate::Reader::getCurSegment() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int32_t NavUpdate::Builder::getCurSegment() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void NavUpdate::Builder::setCurSegment( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool NavUpdate::Reader::hasSegments() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool NavUpdate::Builder::hasSegments() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>::Reader NavUpdate::Reader::getSegments() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>::Builder NavUpdate::Builder::getSegments() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void NavUpdate::Builder::setSegments( ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>::Builder NavUpdate::Builder::initSegments(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void NavUpdate::Builder::adoptSegments( + ::capnp::Orphan< ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>> NavUpdate::Builder::disownSegments() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavUpdate::Segment, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline double NavUpdate::LatLng::Reader::getLat() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline double NavUpdate::LatLng::Builder::getLat() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void NavUpdate::LatLng::Builder::setLat(double value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline double NavUpdate::LatLng::Reader::getLng() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline double NavUpdate::LatLng::Builder::getLng() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void NavUpdate::LatLng::Builder::setLng(double value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool NavUpdate::Segment::Reader::hasFrom() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool NavUpdate::Segment::Builder::hasFrom() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::NavUpdate::LatLng::Reader NavUpdate::Segment::Reader::getFrom() const { + return ::capnp::_::PointerHelpers< ::cereal::NavUpdate::LatLng>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::NavUpdate::LatLng::Builder NavUpdate::Segment::Builder::getFrom() { + return ::capnp::_::PointerHelpers< ::cereal::NavUpdate::LatLng>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::NavUpdate::LatLng::Pipeline NavUpdate::Segment::Pipeline::getFrom() { + return ::cereal::NavUpdate::LatLng::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void NavUpdate::Segment::Builder::setFrom( ::cereal::NavUpdate::LatLng::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::NavUpdate::LatLng>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::NavUpdate::LatLng::Builder NavUpdate::Segment::Builder::initFrom() { + return ::capnp::_::PointerHelpers< ::cereal::NavUpdate::LatLng>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void NavUpdate::Segment::Builder::adoptFrom( + ::capnp::Orphan< ::cereal::NavUpdate::LatLng>&& value) { + ::capnp::_::PointerHelpers< ::cereal::NavUpdate::LatLng>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::NavUpdate::LatLng> NavUpdate::Segment::Builder::disownFrom() { + return ::capnp::_::PointerHelpers< ::cereal::NavUpdate::LatLng>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool NavUpdate::Segment::Reader::hasTo() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool NavUpdate::Segment::Builder::hasTo() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::NavUpdate::LatLng::Reader NavUpdate::Segment::Reader::getTo() const { + return ::capnp::_::PointerHelpers< ::cereal::NavUpdate::LatLng>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::cereal::NavUpdate::LatLng::Builder NavUpdate::Segment::Builder::getTo() { + return ::capnp::_::PointerHelpers< ::cereal::NavUpdate::LatLng>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::NavUpdate::LatLng::Pipeline NavUpdate::Segment::Pipeline::getTo() { + return ::cereal::NavUpdate::LatLng::Pipeline(_typeless.getPointerField(1)); +} +#endif // !CAPNP_LITE +inline void NavUpdate::Segment::Builder::setTo( ::cereal::NavUpdate::LatLng::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::NavUpdate::LatLng>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::cereal::NavUpdate::LatLng::Builder NavUpdate::Segment::Builder::initTo() { + return ::capnp::_::PointerHelpers< ::cereal::NavUpdate::LatLng>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void NavUpdate::Segment::Builder::adoptTo( + ::capnp::Orphan< ::cereal::NavUpdate::LatLng>&& value) { + ::capnp::_::PointerHelpers< ::cereal::NavUpdate::LatLng>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::NavUpdate::LatLng> NavUpdate::Segment::Builder::disownTo() { + return ::capnp::_::PointerHelpers< ::cereal::NavUpdate::LatLng>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline ::int32_t NavUpdate::Segment::Reader::getUpdateTime() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t NavUpdate::Segment::Builder::getUpdateTime() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void NavUpdate::Segment::Builder::setUpdateTime( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t NavUpdate::Segment::Reader::getDistance() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int32_t NavUpdate::Segment::Builder::getDistance() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void NavUpdate::Segment::Builder::setDistance( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t NavUpdate::Segment::Reader::getCrossTime() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int32_t NavUpdate::Segment::Builder::getCrossTime() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void NavUpdate::Segment::Builder::setCrossTime( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t NavUpdate::Segment::Reader::getExitNo() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::int32_t NavUpdate::Segment::Builder::getExitNo() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void NavUpdate::Segment::Builder::setExitNo( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::NavUpdate::Segment::Instruction NavUpdate::Segment::Reader::getInstruction() const { + return _reader.getDataField< ::cereal::NavUpdate::Segment::Instruction>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline ::cereal::NavUpdate::Segment::Instruction NavUpdate::Segment::Builder::getInstruction() { + return _builder.getDataField< ::cereal::NavUpdate::Segment::Instruction>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void NavUpdate::Segment::Builder::setInstruction( ::cereal::NavUpdate::Segment::Instruction value) { + _builder.setDataField< ::cereal::NavUpdate::Segment::Instruction>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline bool NavUpdate::Segment::Reader::hasParts() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool NavUpdate::Segment::Builder::hasParts() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>::Reader NavUpdate::Segment::Reader::getParts() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>::Builder NavUpdate::Segment::Builder::getParts() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void NavUpdate::Segment::Builder::setParts( ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>::Builder NavUpdate::Segment::Builder::initParts(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void NavUpdate::Segment::Builder::adoptParts( + ::capnp::Orphan< ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>> NavUpdate::Segment::Builder::disownParts() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavUpdate::LatLng, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline ::cereal::TrafficEvent::Type TrafficEvent::Reader::getType() const { + return _reader.getDataField< ::cereal::TrafficEvent::Type>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::cereal::TrafficEvent::Type TrafficEvent::Builder::getType() { + return _builder.getDataField< ::cereal::TrafficEvent::Type>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void TrafficEvent::Builder::setType( ::cereal::TrafficEvent::Type value) { + _builder.setDataField< ::cereal::TrafficEvent::Type>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float TrafficEvent::Reader::getDistance() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float TrafficEvent::Builder::getDistance() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void TrafficEvent::Builder::setDistance(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::TrafficEvent::Action TrafficEvent::Reader::getAction() const { + return _reader.getDataField< ::cereal::TrafficEvent::Action>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::cereal::TrafficEvent::Action TrafficEvent::Builder::getAction() { + return _builder.getDataField< ::cereal::TrafficEvent::Action>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void TrafficEvent::Builder::setAction( ::cereal::TrafficEvent::Action value) { + _builder.setDataField< ::cereal::TrafficEvent::Action>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool TrafficEvent::Reader::getResuming() const { + return _reader.getDataField( + ::capnp::bounded<64>() * ::capnp::ELEMENTS); +} + +inline bool TrafficEvent::Builder::getResuming() { + return _builder.getDataField( + ::capnp::bounded<64>() * ::capnp::ELEMENTS); +} +inline void TrafficEvent::Builder::setResuming(bool value) { + _builder.setDataField( + ::capnp::bounded<64>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::AndroidGnss::Which AndroidGnss::Reader::which() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline ::cereal::AndroidGnss::Which AndroidGnss::Builder::which() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool AndroidGnss::Reader::isMeasurements() const { + return which() == AndroidGnss::MEASUREMENTS; +} +inline bool AndroidGnss::Builder::isMeasurements() { + return which() == AndroidGnss::MEASUREMENTS; +} +inline bool AndroidGnss::Reader::hasMeasurements() const { + if (which() != AndroidGnss::MEASUREMENTS) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool AndroidGnss::Builder::hasMeasurements() { + if (which() != AndroidGnss::MEASUREMENTS) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::AndroidGnss::Measurements::Reader AndroidGnss::Reader::getMeasurements() const { + KJ_IREQUIRE((which() == AndroidGnss::MEASUREMENTS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::Measurements>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::AndroidGnss::Measurements::Builder AndroidGnss::Builder::getMeasurements() { + KJ_IREQUIRE((which() == AndroidGnss::MEASUREMENTS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::Measurements>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void AndroidGnss::Builder::setMeasurements( ::cereal::AndroidGnss::Measurements::Reader value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, AndroidGnss::MEASUREMENTS); + ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::Measurements>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::AndroidGnss::Measurements::Builder AndroidGnss::Builder::initMeasurements() { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, AndroidGnss::MEASUREMENTS); + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::Measurements>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void AndroidGnss::Builder::adoptMeasurements( + ::capnp::Orphan< ::cereal::AndroidGnss::Measurements>&& value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, AndroidGnss::MEASUREMENTS); + ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::Measurements>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::AndroidGnss::Measurements> AndroidGnss::Builder::disownMeasurements() { + KJ_IREQUIRE((which() == AndroidGnss::MEASUREMENTS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::Measurements>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool AndroidGnss::Reader::isNavigationMessage() const { + return which() == AndroidGnss::NAVIGATION_MESSAGE; +} +inline bool AndroidGnss::Builder::isNavigationMessage() { + return which() == AndroidGnss::NAVIGATION_MESSAGE; +} +inline bool AndroidGnss::Reader::hasNavigationMessage() const { + if (which() != AndroidGnss::NAVIGATION_MESSAGE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool AndroidGnss::Builder::hasNavigationMessage() { + if (which() != AndroidGnss::NAVIGATION_MESSAGE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::AndroidGnss::NavigationMessage::Reader AndroidGnss::Reader::getNavigationMessage() const { + KJ_IREQUIRE((which() == AndroidGnss::NAVIGATION_MESSAGE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::NavigationMessage>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::AndroidGnss::NavigationMessage::Builder AndroidGnss::Builder::getNavigationMessage() { + KJ_IREQUIRE((which() == AndroidGnss::NAVIGATION_MESSAGE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::NavigationMessage>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void AndroidGnss::Builder::setNavigationMessage( ::cereal::AndroidGnss::NavigationMessage::Reader value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, AndroidGnss::NAVIGATION_MESSAGE); + ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::NavigationMessage>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::AndroidGnss::NavigationMessage::Builder AndroidGnss::Builder::initNavigationMessage() { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, AndroidGnss::NAVIGATION_MESSAGE); + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::NavigationMessage>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void AndroidGnss::Builder::adoptNavigationMessage( + ::capnp::Orphan< ::cereal::AndroidGnss::NavigationMessage>&& value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, AndroidGnss::NAVIGATION_MESSAGE); + ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::NavigationMessage>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::AndroidGnss::NavigationMessage> AndroidGnss::Builder::disownNavigationMessage() { + KJ_IREQUIRE((which() == AndroidGnss::NAVIGATION_MESSAGE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::NavigationMessage>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool AndroidGnss::Measurements::Reader::hasClock() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool AndroidGnss::Measurements::Builder::hasClock() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::AndroidGnss::Measurements::Clock::Reader AndroidGnss::Measurements::Reader::getClock() const { + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::Measurements::Clock>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::AndroidGnss::Measurements::Clock::Builder AndroidGnss::Measurements::Builder::getClock() { + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::Measurements::Clock>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::AndroidGnss::Measurements::Clock::Pipeline AndroidGnss::Measurements::Pipeline::getClock() { + return ::cereal::AndroidGnss::Measurements::Clock::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void AndroidGnss::Measurements::Builder::setClock( ::cereal::AndroidGnss::Measurements::Clock::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::Measurements::Clock>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::AndroidGnss::Measurements::Clock::Builder AndroidGnss::Measurements::Builder::initClock() { + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::Measurements::Clock>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void AndroidGnss::Measurements::Builder::adoptClock( + ::capnp::Orphan< ::cereal::AndroidGnss::Measurements::Clock>&& value) { + ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::Measurements::Clock>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::AndroidGnss::Measurements::Clock> AndroidGnss::Measurements::Builder::disownClock() { + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss::Measurements::Clock>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool AndroidGnss::Measurements::Reader::hasMeasurements() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool AndroidGnss::Measurements::Builder::hasMeasurements() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>::Reader AndroidGnss::Measurements::Reader::getMeasurements() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>::Builder AndroidGnss::Measurements::Builder::getMeasurements() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void AndroidGnss::Measurements::Builder::setMeasurements( ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>::Builder AndroidGnss::Measurements::Builder::initMeasurements(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void AndroidGnss::Measurements::Builder::adoptMeasurements( + ::capnp::Orphan< ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>> AndroidGnss::Measurements::Builder::disownMeasurements() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::AndroidGnss::Measurements::Measurement, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline ::int64_t AndroidGnss::Measurements::Clock::Reader::getTimeNanos() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int64_t AndroidGnss::Measurements::Clock::Builder::getTimeNanos() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setTimeNanos( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t AndroidGnss::Measurements::Clock::Reader::getHardwareClockDiscontinuityCount() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int32_t AndroidGnss::Measurements::Clock::Builder::getHardwareClockDiscontinuityCount() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setHardwareClockDiscontinuityCount( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool AndroidGnss::Measurements::Clock::Reader::getHasTimeUncertaintyNanos() const { + return _reader.getDataField( + ::capnp::bounded<96>() * ::capnp::ELEMENTS); +} + +inline bool AndroidGnss::Measurements::Clock::Builder::getHasTimeUncertaintyNanos() { + return _builder.getDataField( + ::capnp::bounded<96>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setHasTimeUncertaintyNanos(bool value) { + _builder.setDataField( + ::capnp::bounded<96>() * ::capnp::ELEMENTS, value); +} + +inline double AndroidGnss::Measurements::Clock::Reader::getTimeUncertaintyNanos() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline double AndroidGnss::Measurements::Clock::Builder::getTimeUncertaintyNanos() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setTimeUncertaintyNanos(double value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool AndroidGnss::Measurements::Clock::Reader::getHasLeapSecond() const { + return _reader.getDataField( + ::capnp::bounded<97>() * ::capnp::ELEMENTS); +} + +inline bool AndroidGnss::Measurements::Clock::Builder::getHasLeapSecond() { + return _builder.getDataField( + ::capnp::bounded<97>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setHasLeapSecond(bool value) { + _builder.setDataField( + ::capnp::bounded<97>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t AndroidGnss::Measurements::Clock::Reader::getLeapSecond() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::int32_t AndroidGnss::Measurements::Clock::Builder::getLeapSecond() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setLeapSecond( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool AndroidGnss::Measurements::Clock::Reader::getHasFullBiasNanos() const { + return _reader.getDataField( + ::capnp::bounded<98>() * ::capnp::ELEMENTS); +} + +inline bool AndroidGnss::Measurements::Clock::Builder::getHasFullBiasNanos() { + return _builder.getDataField( + ::capnp::bounded<98>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setHasFullBiasNanos(bool value) { + _builder.setDataField( + ::capnp::bounded<98>() * ::capnp::ELEMENTS, value); +} + +inline ::int64_t AndroidGnss::Measurements::Clock::Reader::getFullBiasNanos() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::int64_t AndroidGnss::Measurements::Clock::Builder::getFullBiasNanos() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setFullBiasNanos( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline bool AndroidGnss::Measurements::Clock::Reader::getHasBiasNanos() const { + return _reader.getDataField( + ::capnp::bounded<99>() * ::capnp::ELEMENTS); +} + +inline bool AndroidGnss::Measurements::Clock::Builder::getHasBiasNanos() { + return _builder.getDataField( + ::capnp::bounded<99>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setHasBiasNanos(bool value) { + _builder.setDataField( + ::capnp::bounded<99>() * ::capnp::ELEMENTS, value); +} + +inline double AndroidGnss::Measurements::Clock::Reader::getBiasNanos() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline double AndroidGnss::Measurements::Clock::Builder::getBiasNanos() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setBiasNanos(double value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool AndroidGnss::Measurements::Clock::Reader::getHasBiasUncertaintyNanos() const { + return _reader.getDataField( + ::capnp::bounded<100>() * ::capnp::ELEMENTS); +} + +inline bool AndroidGnss::Measurements::Clock::Builder::getHasBiasUncertaintyNanos() { + return _builder.getDataField( + ::capnp::bounded<100>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setHasBiasUncertaintyNanos(bool value) { + _builder.setDataField( + ::capnp::bounded<100>() * ::capnp::ELEMENTS, value); +} + +inline double AndroidGnss::Measurements::Clock::Reader::getBiasUncertaintyNanos() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline double AndroidGnss::Measurements::Clock::Builder::getBiasUncertaintyNanos() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setBiasUncertaintyNanos(double value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool AndroidGnss::Measurements::Clock::Reader::getHasDriftNanosPerSecond() const { + return _reader.getDataField( + ::capnp::bounded<101>() * ::capnp::ELEMENTS); +} + +inline bool AndroidGnss::Measurements::Clock::Builder::getHasDriftNanosPerSecond() { + return _builder.getDataField( + ::capnp::bounded<101>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setHasDriftNanosPerSecond(bool value) { + _builder.setDataField( + ::capnp::bounded<101>() * ::capnp::ELEMENTS, value); +} + +inline double AndroidGnss::Measurements::Clock::Reader::getDriftNanosPerSecond() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline double AndroidGnss::Measurements::Clock::Builder::getDriftNanosPerSecond() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setDriftNanosPerSecond(double value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline bool AndroidGnss::Measurements::Clock::Reader::getHasDriftUncertaintyNanosPerSecond() const { + return _reader.getDataField( + ::capnp::bounded<102>() * ::capnp::ELEMENTS); +} + +inline bool AndroidGnss::Measurements::Clock::Builder::getHasDriftUncertaintyNanosPerSecond() { + return _builder.getDataField( + ::capnp::bounded<102>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setHasDriftUncertaintyNanosPerSecond(bool value) { + _builder.setDataField( + ::capnp::bounded<102>() * ::capnp::ELEMENTS, value); +} + +inline double AndroidGnss::Measurements::Clock::Reader::getDriftUncertaintyNanosPerSecond() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline double AndroidGnss::Measurements::Clock::Builder::getDriftUncertaintyNanosPerSecond() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Clock::Builder::setDriftUncertaintyNanosPerSecond(double value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t AndroidGnss::Measurements::Measurement::Reader::getSvId() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t AndroidGnss::Measurements::Measurement::Builder::getSvId() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setSvId( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::AndroidGnss::Measurements::Measurement::Constellation AndroidGnss::Measurements::Measurement::Reader::getConstellation() const { + return _reader.getDataField< ::cereal::AndroidGnss::Measurements::Measurement::Constellation>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::cereal::AndroidGnss::Measurements::Measurement::Constellation AndroidGnss::Measurements::Measurement::Builder::getConstellation() { + return _builder.getDataField< ::cereal::AndroidGnss::Measurements::Measurement::Constellation>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setConstellation( ::cereal::AndroidGnss::Measurements::Measurement::Constellation value) { + _builder.setDataField< ::cereal::AndroidGnss::Measurements::Measurement::Constellation>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline double AndroidGnss::Measurements::Measurement::Reader::getTimeOffsetNanos() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline double AndroidGnss::Measurements::Measurement::Builder::getTimeOffsetNanos() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setTimeOffsetNanos(double value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t AndroidGnss::Measurements::Measurement::Reader::getState() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::int32_t AndroidGnss::Measurements::Measurement::Builder::getState() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setState( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::int64_t AndroidGnss::Measurements::Measurement::Reader::getReceivedSvTimeNanos() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::int64_t AndroidGnss::Measurements::Measurement::Builder::getReceivedSvTimeNanos() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setReceivedSvTimeNanos( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::int64_t AndroidGnss::Measurements::Measurement::Reader::getReceivedSvTimeUncertaintyNanos() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::int64_t AndroidGnss::Measurements::Measurement::Builder::getReceivedSvTimeUncertaintyNanos() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setReceivedSvTimeUncertaintyNanos( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline double AndroidGnss::Measurements::Measurement::Reader::getCn0DbHz() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline double AndroidGnss::Measurements::Measurement::Builder::getCn0DbHz() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setCn0DbHz(double value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline double AndroidGnss::Measurements::Measurement::Reader::getPseudorangeRateMetersPerSecond() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline double AndroidGnss::Measurements::Measurement::Builder::getPseudorangeRateMetersPerSecond() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setPseudorangeRateMetersPerSecond(double value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline double AndroidGnss::Measurements::Measurement::Reader::getPseudorangeRateUncertaintyMetersPerSecond() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline double AndroidGnss::Measurements::Measurement::Builder::getPseudorangeRateUncertaintyMetersPerSecond() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setPseudorangeRateUncertaintyMetersPerSecond(double value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t AndroidGnss::Measurements::Measurement::Reader::getAccumulatedDeltaRangeState() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::int32_t AndroidGnss::Measurements::Measurement::Builder::getAccumulatedDeltaRangeState() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setAccumulatedDeltaRangeState( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline double AndroidGnss::Measurements::Measurement::Reader::getAccumulatedDeltaRangeMeters() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline double AndroidGnss::Measurements::Measurement::Builder::getAccumulatedDeltaRangeMeters() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setAccumulatedDeltaRangeMeters(double value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline double AndroidGnss::Measurements::Measurement::Reader::getAccumulatedDeltaRangeUncertaintyMeters() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline double AndroidGnss::Measurements::Measurement::Builder::getAccumulatedDeltaRangeUncertaintyMeters() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setAccumulatedDeltaRangeUncertaintyMeters(double value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline bool AndroidGnss::Measurements::Measurement::Reader::getHasCarrierFrequencyHz() const { + return _reader.getDataField( + ::capnp::bounded<48>() * ::capnp::ELEMENTS); +} + +inline bool AndroidGnss::Measurements::Measurement::Builder::getHasCarrierFrequencyHz() { + return _builder.getDataField( + ::capnp::bounded<48>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setHasCarrierFrequencyHz(bool value) { + _builder.setDataField( + ::capnp::bounded<48>() * ::capnp::ELEMENTS, value); +} + +inline float AndroidGnss::Measurements::Measurement::Reader::getCarrierFrequencyHz() const { + return _reader.getDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} + +inline float AndroidGnss::Measurements::Measurement::Builder::getCarrierFrequencyHz() { + return _builder.getDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setCarrierFrequencyHz(float value) { + _builder.setDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS, value); +} + +inline bool AndroidGnss::Measurements::Measurement::Reader::getHasCarrierCycles() const { + return _reader.getDataField( + ::capnp::bounded<49>() * ::capnp::ELEMENTS); +} + +inline bool AndroidGnss::Measurements::Measurement::Builder::getHasCarrierCycles() { + return _builder.getDataField( + ::capnp::bounded<49>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setHasCarrierCycles(bool value) { + _builder.setDataField( + ::capnp::bounded<49>() * ::capnp::ELEMENTS, value); +} + +inline ::int64_t AndroidGnss::Measurements::Measurement::Reader::getCarrierCycles() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline ::int64_t AndroidGnss::Measurements::Measurement::Builder::getCarrierCycles() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setCarrierCycles( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline bool AndroidGnss::Measurements::Measurement::Reader::getHasCarrierPhase() const { + return _reader.getDataField( + ::capnp::bounded<50>() * ::capnp::ELEMENTS); +} + +inline bool AndroidGnss::Measurements::Measurement::Builder::getHasCarrierPhase() { + return _builder.getDataField( + ::capnp::bounded<50>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setHasCarrierPhase(bool value) { + _builder.setDataField( + ::capnp::bounded<50>() * ::capnp::ELEMENTS, value); +} + +inline double AndroidGnss::Measurements::Measurement::Reader::getCarrierPhase() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline double AndroidGnss::Measurements::Measurement::Builder::getCarrierPhase() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setCarrierPhase(double value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline bool AndroidGnss::Measurements::Measurement::Reader::getHasCarrierPhaseUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<51>() * ::capnp::ELEMENTS); +} + +inline bool AndroidGnss::Measurements::Measurement::Builder::getHasCarrierPhaseUncertainty() { + return _builder.getDataField( + ::capnp::bounded<51>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setHasCarrierPhaseUncertainty(bool value) { + _builder.setDataField( + ::capnp::bounded<51>() * ::capnp::ELEMENTS, value); +} + +inline double AndroidGnss::Measurements::Measurement::Reader::getCarrierPhaseUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline double AndroidGnss::Measurements::Measurement::Builder::getCarrierPhaseUncertainty() { + return _builder.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setCarrierPhaseUncertainty(double value) { + _builder.setDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline bool AndroidGnss::Measurements::Measurement::Reader::getHasSnrInDb() const { + return _reader.getDataField( + ::capnp::bounded<52>() * ::capnp::ELEMENTS); +} + +inline bool AndroidGnss::Measurements::Measurement::Builder::getHasSnrInDb() { + return _builder.getDataField( + ::capnp::bounded<52>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setHasSnrInDb(bool value) { + _builder.setDataField( + ::capnp::bounded<52>() * ::capnp::ELEMENTS, value); +} + +inline double AndroidGnss::Measurements::Measurement::Reader::getSnrInDb() const { + return _reader.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline double AndroidGnss::Measurements::Measurement::Builder::getSnrInDb() { + return _builder.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setSnrInDb(double value) { + _builder.setDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::AndroidGnss::Measurements::Measurement::MultipathIndicator AndroidGnss::Measurements::Measurement::Reader::getMultipathIndicator() const { + return _reader.getDataField< ::cereal::AndroidGnss::Measurements::Measurement::MultipathIndicator>( + ::capnp::bounded<42>() * ::capnp::ELEMENTS); +} + +inline ::cereal::AndroidGnss::Measurements::Measurement::MultipathIndicator AndroidGnss::Measurements::Measurement::Builder::getMultipathIndicator() { + return _builder.getDataField< ::cereal::AndroidGnss::Measurements::Measurement::MultipathIndicator>( + ::capnp::bounded<42>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::Measurements::Measurement::Builder::setMultipathIndicator( ::cereal::AndroidGnss::Measurements::Measurement::MultipathIndicator value) { + _builder.setDataField< ::cereal::AndroidGnss::Measurements::Measurement::MultipathIndicator>( + ::capnp::bounded<42>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t AndroidGnss::NavigationMessage::Reader::getType() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t AndroidGnss::NavigationMessage::Builder::getType() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::NavigationMessage::Builder::setType( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t AndroidGnss::NavigationMessage::Reader::getSvId() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int32_t AndroidGnss::NavigationMessage::Builder::getSvId() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::NavigationMessage::Builder::setSvId( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t AndroidGnss::NavigationMessage::Reader::getMessageId() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int32_t AndroidGnss::NavigationMessage::Builder::getMessageId() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::NavigationMessage::Builder::setMessageId( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t AndroidGnss::NavigationMessage::Reader::getSubmessageId() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::int32_t AndroidGnss::NavigationMessage::Builder::getSubmessageId() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::NavigationMessage::Builder::setSubmessageId( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool AndroidGnss::NavigationMessage::Reader::hasData() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool AndroidGnss::NavigationMessage::Builder::hasData() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader AndroidGnss::NavigationMessage::Reader::getData() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder AndroidGnss::NavigationMessage::Builder::getData() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void AndroidGnss::NavigationMessage::Builder::setData( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder AndroidGnss::NavigationMessage::Builder::initData(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void AndroidGnss::NavigationMessage::Builder::adoptData( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> AndroidGnss::NavigationMessage::Builder::disownData() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::cereal::AndroidGnss::NavigationMessage::Status AndroidGnss::NavigationMessage::Reader::getStatus() const { + return _reader.getDataField< ::cereal::AndroidGnss::NavigationMessage::Status>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline ::cereal::AndroidGnss::NavigationMessage::Status AndroidGnss::NavigationMessage::Builder::getStatus() { + return _builder.getDataField< ::cereal::AndroidGnss::NavigationMessage::Status>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void AndroidGnss::NavigationMessage::Builder::setStatus( ::cereal::AndroidGnss::NavigationMessage::Status value) { + _builder.setDataField< ::cereal::AndroidGnss::NavigationMessage::Status>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::QcomGnss::Which QcomGnss::Reader::which() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline ::cereal::QcomGnss::Which QcomGnss::Builder::which() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t QcomGnss::Reader::getLogTs() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t QcomGnss::Builder::getLogTs() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::Builder::setLogTs( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::Reader::isMeasurementReport() const { + return which() == QcomGnss::MEASUREMENT_REPORT; +} +inline bool QcomGnss::Builder::isMeasurementReport() { + return which() == QcomGnss::MEASUREMENT_REPORT; +} +inline bool QcomGnss::Reader::hasMeasurementReport() const { + if (which() != QcomGnss::MEASUREMENT_REPORT) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool QcomGnss::Builder::hasMeasurementReport() { + if (which() != QcomGnss::MEASUREMENT_REPORT) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::QcomGnss::MeasurementReport::Reader QcomGnss::Reader::getMeasurementReport() const { + KJ_IREQUIRE((which() == QcomGnss::MEASUREMENT_REPORT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementReport>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::QcomGnss::MeasurementReport::Builder QcomGnss::Builder::getMeasurementReport() { + KJ_IREQUIRE((which() == QcomGnss::MEASUREMENT_REPORT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementReport>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void QcomGnss::Builder::setMeasurementReport( ::cereal::QcomGnss::MeasurementReport::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::MEASUREMENT_REPORT); + ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementReport>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::QcomGnss::MeasurementReport::Builder QcomGnss::Builder::initMeasurementReport() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::MEASUREMENT_REPORT); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementReport>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void QcomGnss::Builder::adoptMeasurementReport( + ::capnp::Orphan< ::cereal::QcomGnss::MeasurementReport>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::MEASUREMENT_REPORT); + ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementReport>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::QcomGnss::MeasurementReport> QcomGnss::Builder::disownMeasurementReport() { + KJ_IREQUIRE((which() == QcomGnss::MEASUREMENT_REPORT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementReport>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool QcomGnss::Reader::isClockReport() const { + return which() == QcomGnss::CLOCK_REPORT; +} +inline bool QcomGnss::Builder::isClockReport() { + return which() == QcomGnss::CLOCK_REPORT; +} +inline bool QcomGnss::Reader::hasClockReport() const { + if (which() != QcomGnss::CLOCK_REPORT) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool QcomGnss::Builder::hasClockReport() { + if (which() != QcomGnss::CLOCK_REPORT) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::QcomGnss::ClockReport::Reader QcomGnss::Reader::getClockReport() const { + KJ_IREQUIRE((which() == QcomGnss::CLOCK_REPORT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::ClockReport>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::QcomGnss::ClockReport::Builder QcomGnss::Builder::getClockReport() { + KJ_IREQUIRE((which() == QcomGnss::CLOCK_REPORT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::ClockReport>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void QcomGnss::Builder::setClockReport( ::cereal::QcomGnss::ClockReport::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::CLOCK_REPORT); + ::capnp::_::PointerHelpers< ::cereal::QcomGnss::ClockReport>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::QcomGnss::ClockReport::Builder QcomGnss::Builder::initClockReport() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::CLOCK_REPORT); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::ClockReport>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void QcomGnss::Builder::adoptClockReport( + ::capnp::Orphan< ::cereal::QcomGnss::ClockReport>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::CLOCK_REPORT); + ::capnp::_::PointerHelpers< ::cereal::QcomGnss::ClockReport>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::QcomGnss::ClockReport> QcomGnss::Builder::disownClockReport() { + KJ_IREQUIRE((which() == QcomGnss::CLOCK_REPORT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::ClockReport>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool QcomGnss::Reader::isDrMeasurementReport() const { + return which() == QcomGnss::DR_MEASUREMENT_REPORT; +} +inline bool QcomGnss::Builder::isDrMeasurementReport() { + return which() == QcomGnss::DR_MEASUREMENT_REPORT; +} +inline bool QcomGnss::Reader::hasDrMeasurementReport() const { + if (which() != QcomGnss::DR_MEASUREMENT_REPORT) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool QcomGnss::Builder::hasDrMeasurementReport() { + if (which() != QcomGnss::DR_MEASUREMENT_REPORT) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::QcomGnss::DrMeasurementReport::Reader QcomGnss::Reader::getDrMeasurementReport() const { + KJ_IREQUIRE((which() == QcomGnss::DR_MEASUREMENT_REPORT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::DrMeasurementReport>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::QcomGnss::DrMeasurementReport::Builder QcomGnss::Builder::getDrMeasurementReport() { + KJ_IREQUIRE((which() == QcomGnss::DR_MEASUREMENT_REPORT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::DrMeasurementReport>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void QcomGnss::Builder::setDrMeasurementReport( ::cereal::QcomGnss::DrMeasurementReport::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::DR_MEASUREMENT_REPORT); + ::capnp::_::PointerHelpers< ::cereal::QcomGnss::DrMeasurementReport>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::QcomGnss::DrMeasurementReport::Builder QcomGnss::Builder::initDrMeasurementReport() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::DR_MEASUREMENT_REPORT); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::DrMeasurementReport>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void QcomGnss::Builder::adoptDrMeasurementReport( + ::capnp::Orphan< ::cereal::QcomGnss::DrMeasurementReport>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::DR_MEASUREMENT_REPORT); + ::capnp::_::PointerHelpers< ::cereal::QcomGnss::DrMeasurementReport>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::QcomGnss::DrMeasurementReport> QcomGnss::Builder::disownDrMeasurementReport() { + KJ_IREQUIRE((which() == QcomGnss::DR_MEASUREMENT_REPORT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::DrMeasurementReport>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool QcomGnss::Reader::isDrSvPoly() const { + return which() == QcomGnss::DR_SV_POLY; +} +inline bool QcomGnss::Builder::isDrSvPoly() { + return which() == QcomGnss::DR_SV_POLY; +} +inline bool QcomGnss::Reader::hasDrSvPoly() const { + if (which() != QcomGnss::DR_SV_POLY) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool QcomGnss::Builder::hasDrSvPoly() { + if (which() != QcomGnss::DR_SV_POLY) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::QcomGnss::DrSvPolyReport::Reader QcomGnss::Reader::getDrSvPoly() const { + KJ_IREQUIRE((which() == QcomGnss::DR_SV_POLY), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::DrSvPolyReport>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::QcomGnss::DrSvPolyReport::Builder QcomGnss::Builder::getDrSvPoly() { + KJ_IREQUIRE((which() == QcomGnss::DR_SV_POLY), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::DrSvPolyReport>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void QcomGnss::Builder::setDrSvPoly( ::cereal::QcomGnss::DrSvPolyReport::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::DR_SV_POLY); + ::capnp::_::PointerHelpers< ::cereal::QcomGnss::DrSvPolyReport>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::QcomGnss::DrSvPolyReport::Builder QcomGnss::Builder::initDrSvPoly() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::DR_SV_POLY); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::DrSvPolyReport>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void QcomGnss::Builder::adoptDrSvPoly( + ::capnp::Orphan< ::cereal::QcomGnss::DrSvPolyReport>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::DR_SV_POLY); + ::capnp::_::PointerHelpers< ::cereal::QcomGnss::DrSvPolyReport>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::QcomGnss::DrSvPolyReport> QcomGnss::Builder::disownDrSvPoly() { + KJ_IREQUIRE((which() == QcomGnss::DR_SV_POLY), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::DrSvPolyReport>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool QcomGnss::Reader::isRawLog() const { + return which() == QcomGnss::RAW_LOG; +} +inline bool QcomGnss::Builder::isRawLog() { + return which() == QcomGnss::RAW_LOG; +} +inline bool QcomGnss::Reader::hasRawLog() const { + if (which() != QcomGnss::RAW_LOG) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool QcomGnss::Builder::hasRawLog() { + if (which() != QcomGnss::RAW_LOG) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader QcomGnss::Reader::getRawLog() const { + KJ_IREQUIRE((which() == QcomGnss::RAW_LOG), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder QcomGnss::Builder::getRawLog() { + KJ_IREQUIRE((which() == QcomGnss::RAW_LOG), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void QcomGnss::Builder::setRawLog( ::capnp::Data::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::RAW_LOG); + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder QcomGnss::Builder::initRawLog(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::RAW_LOG); + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void QcomGnss::Builder::adoptRawLog( + ::capnp::Orphan< ::capnp::Data>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, QcomGnss::RAW_LOG); + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> QcomGnss::Builder::disownRawLog() { + KJ_IREQUIRE((which() == QcomGnss::RAW_LOG), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getSubMillisecondIsValid() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getSubMillisecondIsValid() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setSubMillisecondIsValid(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getSubBitTimeIsKnown() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getSubBitTimeIsKnown() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setSubBitTimeIsKnown(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getSatelliteTimeIsKnown() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getSatelliteTimeIsKnown() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setSatelliteTimeIsKnown(bool value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getBitEdgeConfirmedFromSignal() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getBitEdgeConfirmedFromSignal() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setBitEdgeConfirmedFromSignal(bool value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getMeasuredVelocity() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getMeasuredVelocity() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setMeasuredVelocity(bool value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getFineOrCoarseVelocity() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getFineOrCoarseVelocity() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setFineOrCoarseVelocity(bool value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getLockPointValid() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getLockPointValid() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setLockPointValid(bool value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getLockPointPositive() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getLockPointPositive() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setLockPointPositive(bool value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getLastUpdateFromDifference() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getLastUpdateFromDifference() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setLastUpdateFromDifference(bool value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getLastUpdateFromVelocityDifference() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getLastUpdateFromVelocityDifference() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setLastUpdateFromVelocityDifference(bool value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getStrongIndicationOfCrossCorelation() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getStrongIndicationOfCrossCorelation() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setStrongIndicationOfCrossCorelation(bool value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getTentativeMeasurement() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getTentativeMeasurement() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setTentativeMeasurement(bool value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getMeasurementNotUsable() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getMeasurementNotUsable() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setMeasurementNotUsable(bool value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getSirCheckIsNeeded() const { + return _reader.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getSirCheckIsNeeded() { + return _builder.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setSirCheckIsNeeded(bool value) { + _builder.setDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getProbationMode() const { + return _reader.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getProbationMode() { + return _builder.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setProbationMode(bool value) { + _builder.setDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getGlonassMeanderBitEdgeValid() const { + return _reader.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getGlonassMeanderBitEdgeValid() { + return _builder.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setGlonassMeanderBitEdgeValid(bool value) { + _builder.setDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getGlonassTimeMarkValid() const { + return _reader.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getGlonassTimeMarkValid() { + return _builder.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setGlonassTimeMarkValid(bool value) { + _builder.setDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getGpsRoundRobinRxDiversity() const { + return _reader.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getGpsRoundRobinRxDiversity() { + return _builder.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setGpsRoundRobinRxDiversity(bool value) { + _builder.setDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getGpsRxDiversity() const { + return _reader.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getGpsRxDiversity() { + return _builder.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setGpsRxDiversity(bool value) { + _builder.setDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getGpsLowBandwidthRxDiversityCombined() const { + return _reader.getDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getGpsLowBandwidthRxDiversityCombined() { + return _builder.getDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setGpsLowBandwidthRxDiversityCombined(bool value) { + _builder.setDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getGpsHighBandwidthNu4() const { + return _reader.getDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getGpsHighBandwidthNu4() { + return _builder.getDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setGpsHighBandwidthNu4(bool value) { + _builder.setDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getGpsHighBandwidthNu8() const { + return _reader.getDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getGpsHighBandwidthNu8() { + return _builder.getDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setGpsHighBandwidthNu8(bool value) { + _builder.setDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getGpsHighBandwidthUniform() const { + return _reader.getDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getGpsHighBandwidthUniform() { + return _builder.getDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setGpsHighBandwidthUniform(bool value) { + _builder.setDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getMultipathIndicator() const { + return _reader.getDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getMultipathIndicator() { + return _builder.getDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setMultipathIndicator(bool value) { + _builder.setDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getImdJammingIndicator() const { + return _reader.getDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getImdJammingIndicator() { + return _builder.getDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setImdJammingIndicator(bool value) { + _builder.setDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getLteB13TxJammingIndicator() const { + return _reader.getDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getLteB13TxJammingIndicator() { + return _builder.getDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setLteB13TxJammingIndicator(bool value) { + _builder.setDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getFreshMeasurementIndicator() const { + return _reader.getDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getFreshMeasurementIndicator() { + return _builder.getDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setFreshMeasurementIndicator(bool value) { + _builder.setDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getMultipathEstimateIsValid() const { + return _reader.getDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getMultipathEstimateIsValid() { + return _builder.getDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setMultipathEstimateIsValid(bool value) { + _builder.setDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementStatus::Reader::getDirectionIsValid() const { + return _reader.getDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::MeasurementStatus::Builder::getDirectionIsValid() { + return _builder.getDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementStatus::Builder::setDirectionIsValid(bool value) { + _builder.setDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::QcomGnss::MeasurementSource QcomGnss::MeasurementReport::Reader::getSource() const { + return _reader.getDataField< ::cereal::QcomGnss::MeasurementSource>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::cereal::QcomGnss::MeasurementSource QcomGnss::MeasurementReport::Builder::getSource() { + return _builder.getDataField< ::cereal::QcomGnss::MeasurementSource>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::Builder::setSource( ::cereal::QcomGnss::MeasurementSource value) { + _builder.setDataField< ::cereal::QcomGnss::MeasurementSource>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::MeasurementReport::Reader::getFCount() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::MeasurementReport::Builder::getFCount() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::Builder::setFCount( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::MeasurementReport::Reader::getGpsWeek() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::MeasurementReport::Builder::getGpsWeek() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::Builder::setGpsWeek( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::MeasurementReport::Reader::getGlonassCycleNumber() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::MeasurementReport::Builder::getGlonassCycleNumber() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::Builder::setGlonassCycleNumber( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::MeasurementReport::Reader::getGlonassNumberOfDays() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::MeasurementReport::Builder::getGlonassNumberOfDays() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::Builder::setGlonassNumberOfDays( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::MeasurementReport::Reader::getMilliseconds() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::MeasurementReport::Builder::getMilliseconds() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::Builder::setMilliseconds( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::MeasurementReport::Reader::getTimeBias() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::MeasurementReport::Builder::getTimeBias() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::Builder::setTimeBias(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::MeasurementReport::Reader::getClockTimeUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::MeasurementReport::Builder::getClockTimeUncertainty() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::Builder::setClockTimeUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::MeasurementReport::Reader::getClockFrequencyBias() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::MeasurementReport::Builder::getClockFrequencyBias() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::Builder::setClockFrequencyBias(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::MeasurementReport::Reader::getClockFrequencyUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::MeasurementReport::Builder::getClockFrequencyUncertainty() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::Builder::setClockFrequencyUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementReport::Reader::hasSv() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool QcomGnss::MeasurementReport::Builder::hasSv() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>::Reader QcomGnss::MeasurementReport::Reader::getSv() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>::Builder QcomGnss::MeasurementReport::Builder::getSv() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void QcomGnss::MeasurementReport::Builder::setSv( ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>::Builder QcomGnss::MeasurementReport::Builder::initSv(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void QcomGnss::MeasurementReport::Builder::adoptSv( + ::capnp::Orphan< ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>> QcomGnss::MeasurementReport::Builder::disownSv() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::QcomGnss::MeasurementReport::SV, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::uint8_t QcomGnss::MeasurementReport::SV::Reader::getSvId() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::MeasurementReport::SV::Builder::getSvId() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setSvId( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int8_t QcomGnss::MeasurementReport::SV::Reader::getGlonassFrequencyIndex() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int8_t QcomGnss::MeasurementReport::SV::Builder::getGlonassFrequencyIndex() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setGlonassFrequencyIndex( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::QcomGnss::SVObservationState QcomGnss::MeasurementReport::SV::Reader::getObservationState() const { + return _reader.getDataField< ::cereal::QcomGnss::SVObservationState>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::cereal::QcomGnss::SVObservationState QcomGnss::MeasurementReport::SV::Builder::getObservationState() { + return _builder.getDataField< ::cereal::QcomGnss::SVObservationState>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setObservationState( ::cereal::QcomGnss::SVObservationState value) { + _builder.setDataField< ::cereal::QcomGnss::SVObservationState>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::MeasurementReport::SV::Reader::getObservations() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::MeasurementReport::SV::Builder::getObservations() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setObservations( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::MeasurementReport::SV::Reader::getGoodObservations() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::MeasurementReport::SV::Builder::getGoodObservations() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setGoodObservations( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::MeasurementReport::SV::Reader::getGpsParityErrorCount() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::MeasurementReport::SV::Builder::getGpsParityErrorCount() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setGpsParityErrorCount( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::MeasurementReport::SV::Reader::getGlonassHemmingErrorCount() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::MeasurementReport::SV::Builder::getGlonassHemmingErrorCount() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setGlonassHemmingErrorCount( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::MeasurementReport::SV::Reader::getFilterStages() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::MeasurementReport::SV::Builder::getFilterStages() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setFilterStages( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::MeasurementReport::SV::Reader::getCarrierNoise() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::MeasurementReport::SV::Builder::getCarrierNoise() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setCarrierNoise( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::int16_t QcomGnss::MeasurementReport::SV::Reader::getLatency() const { + return _reader.getDataField< ::int16_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::int16_t QcomGnss::MeasurementReport::SV::Builder::getLatency() { + return _builder.getDataField< ::int16_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setLatency( ::int16_t value) { + _builder.setDataField< ::int16_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::MeasurementReport::SV::Reader::getPredetectInterval() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::MeasurementReport::SV::Builder::getPredetectInterval() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setPredetectInterval( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::MeasurementReport::SV::Reader::getPostdetections() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::MeasurementReport::SV::Builder::getPostdetections() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setPostdetections( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::MeasurementReport::SV::Reader::getUnfilteredMeasurementIntegral() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::MeasurementReport::SV::Builder::getUnfilteredMeasurementIntegral() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setUnfilteredMeasurementIntegral( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::MeasurementReport::SV::Reader::getUnfilteredMeasurementFraction() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::MeasurementReport::SV::Builder::getUnfilteredMeasurementFraction() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setUnfilteredMeasurementFraction(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::MeasurementReport::SV::Reader::getUnfilteredTimeUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::MeasurementReport::SV::Builder::getUnfilteredTimeUncertainty() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setUnfilteredTimeUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::MeasurementReport::SV::Reader::getUnfilteredSpeed() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::MeasurementReport::SV::Builder::getUnfilteredSpeed() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setUnfilteredSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::MeasurementReport::SV::Reader::getUnfilteredSpeedUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::MeasurementReport::SV::Builder::getUnfilteredSpeedUncertainty() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setUnfilteredSpeedUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::MeasurementReport::SV::Reader::hasMeasurementStatus() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool QcomGnss::MeasurementReport::SV::Builder::hasMeasurementStatus() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::QcomGnss::MeasurementStatus::Reader QcomGnss::MeasurementReport::SV::Reader::getMeasurementStatus() const { + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementStatus>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::QcomGnss::MeasurementStatus::Builder QcomGnss::MeasurementReport::SV::Builder::getMeasurementStatus() { + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementStatus>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::QcomGnss::MeasurementStatus::Pipeline QcomGnss::MeasurementReport::SV::Pipeline::getMeasurementStatus() { + return ::cereal::QcomGnss::MeasurementStatus::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void QcomGnss::MeasurementReport::SV::Builder::setMeasurementStatus( ::cereal::QcomGnss::MeasurementStatus::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementStatus>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::QcomGnss::MeasurementStatus::Builder QcomGnss::MeasurementReport::SV::Builder::initMeasurementStatus() { + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementStatus>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void QcomGnss::MeasurementReport::SV::Builder::adoptMeasurementStatus( + ::capnp::Orphan< ::cereal::QcomGnss::MeasurementStatus>&& value) { + ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementStatus>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::QcomGnss::MeasurementStatus> QcomGnss::MeasurementReport::SV::Builder::disownMeasurementStatus() { + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementStatus>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::uint32_t QcomGnss::MeasurementReport::SV::Reader::getMultipathEstimate() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::MeasurementReport::SV::Builder::getMultipathEstimate() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setMultipathEstimate( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::MeasurementReport::SV::Reader::getAzimuth() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::MeasurementReport::SV::Builder::getAzimuth() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setAzimuth(float value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::MeasurementReport::SV::Reader::getElevation() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::MeasurementReport::SV::Builder::getElevation() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setElevation(float value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t QcomGnss::MeasurementReport::SV::Reader::getCarrierPhaseCyclesIntegral() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline ::int32_t QcomGnss::MeasurementReport::SV::Builder::getCarrierPhaseCyclesIntegral() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setCarrierPhaseCyclesIntegral( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::MeasurementReport::SV::Reader::getCarrierPhaseCyclesFraction() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::MeasurementReport::SV::Builder::getCarrierPhaseCyclesFraction() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setCarrierPhaseCyclesFraction( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::MeasurementReport::SV::Reader::getFineSpeed() const { + return _reader.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::MeasurementReport::SV::Builder::getFineSpeed() { + return _builder.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setFineSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::MeasurementReport::SV::Reader::getFineSpeedUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::MeasurementReport::SV::Builder::getFineSpeedUncertainty() { + return _builder.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setFineSpeedUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::MeasurementReport::SV::Reader::getCycleSlipCount() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::MeasurementReport::SV::Builder::getCycleSlipCount() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::MeasurementReport::SV::Builder::setCycleSlipCount( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::ClockReport::Reader::getHasFCount() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::ClockReport::Builder::getHasFCount() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setHasFCount(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::ClockReport::Reader::getFCount() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::ClockReport::Builder::getFCount() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setFCount( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::ClockReport::Reader::getHasGpsWeek() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::ClockReport::Builder::getHasGpsWeek() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setHasGpsWeek(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::ClockReport::Reader::getGpsWeek() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::ClockReport::Builder::getGpsWeek() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGpsWeek( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::ClockReport::Reader::getHasGpsMilliseconds() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::ClockReport::Builder::getHasGpsMilliseconds() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setHasGpsMilliseconds(bool value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::ClockReport::Reader::getGpsMilliseconds() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::ClockReport::Builder::getGpsMilliseconds() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGpsMilliseconds( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGpsTimeBias() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGpsTimeBias() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGpsTimeBias(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGpsClockTimeUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGpsClockTimeUncertainty() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGpsClockTimeUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::ClockReport::Reader::getGpsClockSource() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::ClockReport::Builder::getGpsClockSource() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGpsClockSource( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::ClockReport::Reader::getHasGlonassYear() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::ClockReport::Builder::getHasGlonassYear() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setHasGlonassYear(bool value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::ClockReport::Reader::getGlonassYear() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::ClockReport::Builder::getGlonassYear() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGlonassYear( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<20>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::ClockReport::Reader::getHasGlonassDay() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::ClockReport::Builder::getHasGlonassDay() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setHasGlonassDay(bool value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::ClockReport::Reader::getGlonassDay() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::ClockReport::Builder::getGlonassDay() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGlonassDay( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::ClockReport::Reader::getHasGlonassMilliseconds() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::ClockReport::Builder::getHasGlonassMilliseconds() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setHasGlonassMilliseconds(bool value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::ClockReport::Reader::getGlonassMilliseconds() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::ClockReport::Builder::getGlonassMilliseconds() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGlonassMilliseconds( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGlonassTimeBias() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGlonassTimeBias() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGlonassTimeBias(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGlonassClockTimeUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGlonassClockTimeUncertainty() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGlonassClockTimeUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::ClockReport::Reader::getGlonassClockSource() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::ClockReport::Builder::getGlonassClockSource() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGlonassClockSource( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<21>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::ClockReport::Reader::getBdsWeek() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::ClockReport::Builder::getBdsWeek() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setBdsWeek( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<18>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::ClockReport::Reader::getBdsMilliseconds() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::ClockReport::Builder::getBdsMilliseconds() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setBdsMilliseconds( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getBdsTimeBias() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getBdsTimeBias() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setBdsTimeBias(float value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getBdsClockTimeUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getBdsClockTimeUncertainty() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setBdsClockTimeUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::ClockReport::Reader::getBdsClockSource() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<38>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::ClockReport::Builder::getBdsClockSource() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<38>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setBdsClockSource( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<38>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::ClockReport::Reader::getGalWeek() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<26>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::ClockReport::Builder::getGalWeek() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<26>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGalWeek( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<26>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::ClockReport::Reader::getGalMilliseconds() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::ClockReport::Builder::getGalMilliseconds() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGalMilliseconds( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGalTimeBias() const { + return _reader.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGalTimeBias() { + return _builder.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGalTimeBias(float value) { + _builder.setDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGalClockTimeUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGalClockTimeUncertainty() { + return _builder.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGalClockTimeUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::ClockReport::Reader::getGalClockSource() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<39>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::ClockReport::Builder::getGalClockSource() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<39>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGalClockSource( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<39>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getClockFrequencyBias() const { + return _reader.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getClockFrequencyBias() { + return _builder.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setClockFrequencyBias(float value) { + _builder.setDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getClockFrequencyUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getClockFrequencyUncertainty() { + return _builder.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setClockFrequencyUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::ClockReport::Reader::getFrequencySource() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<54>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::ClockReport::Builder::getFrequencySource() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<54>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setFrequencySource( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<54>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::ClockReport::Reader::getGpsLeapSeconds() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<55>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::ClockReport::Builder::getGpsLeapSeconds() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<55>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGpsLeapSeconds( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<55>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::ClockReport::Reader::getGpsLeapSecondsUncertainty() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<76>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::ClockReport::Builder::getGpsLeapSecondsUncertainty() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<76>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGpsLeapSecondsUncertainty( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<76>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::ClockReport::Reader::getGpsLeapSecondsSource() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<77>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::ClockReport::Builder::getGpsLeapSecondsSource() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<77>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGpsLeapSecondsSource( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<77>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGpsToGlonassTimeBiasMilliseconds() const { + return _reader.getDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGpsToGlonassTimeBiasMilliseconds() { + return _builder.getDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGpsToGlonassTimeBiasMilliseconds(float value) { + _builder.setDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGpsToGlonassTimeBiasMillisecondsUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGpsToGlonassTimeBiasMillisecondsUncertainty() { + return _builder.getDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGpsToGlonassTimeBiasMillisecondsUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGpsToBdsTimeBiasMilliseconds() const { + return _reader.getDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGpsToBdsTimeBiasMilliseconds() { + return _builder.getDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGpsToBdsTimeBiasMilliseconds(float value) { + _builder.setDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGpsToBdsTimeBiasMillisecondsUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGpsToBdsTimeBiasMillisecondsUncertainty() { + return _builder.getDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGpsToBdsTimeBiasMillisecondsUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getBdsToGloTimeBiasMilliseconds() const { + return _reader.getDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getBdsToGloTimeBiasMilliseconds() { + return _builder.getDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setBdsToGloTimeBiasMilliseconds(float value) { + _builder.setDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getBdsToGloTimeBiasMillisecondsUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getBdsToGloTimeBiasMillisecondsUncertainty() { + return _builder.getDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setBdsToGloTimeBiasMillisecondsUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGpsToGalTimeBiasMilliseconds() const { + return _reader.getDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGpsToGalTimeBiasMilliseconds() { + return _builder.getDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGpsToGalTimeBiasMilliseconds(float value) { + _builder.setDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGpsToGalTimeBiasMillisecondsUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGpsToGalTimeBiasMillisecondsUncertainty() { + return _builder.getDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGpsToGalTimeBiasMillisecondsUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGalToGloTimeBiasMilliseconds() const { + return _reader.getDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGalToGloTimeBiasMilliseconds() { + return _builder.getDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGalToGloTimeBiasMilliseconds(float value) { + _builder.setDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGalToGloTimeBiasMillisecondsUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<29>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGalToGloTimeBiasMillisecondsUncertainty() { + return _builder.getDataField( + ::capnp::bounded<29>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGalToGloTimeBiasMillisecondsUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<29>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGalToBdsTimeBiasMilliseconds() const { + return _reader.getDataField( + ::capnp::bounded<30>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGalToBdsTimeBiasMilliseconds() { + return _builder.getDataField( + ::capnp::bounded<30>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGalToBdsTimeBiasMilliseconds(float value) { + _builder.setDataField( + ::capnp::bounded<30>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::ClockReport::Reader::getGalToBdsTimeBiasMillisecondsUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<31>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::ClockReport::Builder::getGalToBdsTimeBiasMillisecondsUncertainty() { + return _builder.getDataField( + ::capnp::bounded<31>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setGalToBdsTimeBiasMillisecondsUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<31>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::ClockReport::Reader::getHasRtcTime() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::ClockReport::Builder::getHasRtcTime() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setHasRtcTime(bool value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::ClockReport::Reader::getSystemRtcTime() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<32>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::ClockReport::Builder::getSystemRtcTime() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<32>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setSystemRtcTime( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<32>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::ClockReport::Reader::getFCountOffset() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<33>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::ClockReport::Builder::getFCountOffset() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<33>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setFCountOffset( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<33>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::ClockReport::Reader::getLpmRtcCount() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<34>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::ClockReport::Builder::getLpmRtcCount() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<34>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setLpmRtcCount( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<34>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::ClockReport::Reader::getClockResets() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<35>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::ClockReport::Builder::getClockResets() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<35>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::ClockReport::Builder::setClockResets( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<35>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Reader::getReason() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Builder::getReason() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setReason( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Reader::getSeqNum() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Builder::getSeqNum() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setSeqNum( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Reader::getSeqMax() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Builder::getSeqMax() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setSeqMax( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::DrMeasurementReport::Reader::getRfLoss() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::DrMeasurementReport::Builder::getRfLoss() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setRfLoss( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::DrMeasurementReport::Reader::getSystemRtcValid() const { + return _reader.getDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::DrMeasurementReport::Builder::getSystemRtcValid() { + return _builder.getDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setSystemRtcValid(bool value) { + _builder.setDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::Reader::getFCount() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::Builder::getFCount() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setFCount( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::Reader::getClockResets() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::Builder::getClockResets() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setClockResets( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t QcomGnss::DrMeasurementReport::Reader::getSystemRtcTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t QcomGnss::DrMeasurementReport::Builder::getSystemRtcTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setSystemRtcTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Reader::getGpsLeapSeconds() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Builder::getGpsLeapSeconds() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGpsLeapSeconds( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Reader::getGpsLeapSecondsUncertainty() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Builder::getGpsLeapSecondsUncertainty() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGpsLeapSecondsUncertainty( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::Reader::getGpsToGlonassTimeBiasMilliseconds() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::Builder::getGpsToGlonassTimeBiasMilliseconds() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGpsToGlonassTimeBiasMilliseconds(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::Reader::getGpsToGlonassTimeBiasMillisecondsUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::Builder::getGpsToGlonassTimeBiasMillisecondsUncertainty() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGpsToGlonassTimeBiasMillisecondsUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::DrMeasurementReport::Reader::getGpsWeek() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::DrMeasurementReport::Builder::getGpsWeek() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGpsWeek( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::Reader::getGpsMilliseconds() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::Builder::getGpsMilliseconds() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGpsMilliseconds( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::Reader::getGpsTimeBiasMs() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::Builder::getGpsTimeBiasMs() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGpsTimeBiasMs( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::Reader::getGpsClockTimeUncertaintyMs() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::Builder::getGpsClockTimeUncertaintyMs() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGpsClockTimeUncertaintyMs( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Reader::getGpsClockSource() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<34>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Builder::getGpsClockSource() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<34>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGpsClockSource( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<34>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Reader::getGlonassClockSource() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<35>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Builder::getGlonassClockSource() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<35>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGlonassClockSource( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<35>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Reader::getGlonassYear() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<48>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Builder::getGlonassYear() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<48>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGlonassYear( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<48>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::DrMeasurementReport::Reader::getGlonassDay() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::DrMeasurementReport::Builder::getGlonassDay() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGlonassDay( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<25>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::Reader::getGlonassMilliseconds() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::Builder::getGlonassMilliseconds() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGlonassMilliseconds( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::Reader::getGlonassTimeBias() const { + return _reader.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::Builder::getGlonassTimeBias() { + return _builder.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGlonassTimeBias(float value) { + _builder.setDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::Reader::getGlonassClockTimeUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::Builder::getGlonassClockTimeUncertainty() { + return _builder.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setGlonassClockTimeUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::Reader::getClockFrequencyBias() const { + return _reader.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::Builder::getClockFrequencyBias() { + return _builder.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setClockFrequencyBias(float value) { + _builder.setDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::Reader::getClockFrequencyUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::Builder::getClockFrequencyUncertainty() { + return _builder.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setClockFrequencyUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Reader::getFrequencySource() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<49>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::Builder::getFrequencySource() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<49>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setFrequencySource( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<49>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::QcomGnss::MeasurementSource QcomGnss::DrMeasurementReport::Reader::getSource() const { + return _reader.getDataField< ::cereal::QcomGnss::MeasurementSource>( + ::capnp::bounded<36>() * ::capnp::ELEMENTS); +} + +inline ::cereal::QcomGnss::MeasurementSource QcomGnss::DrMeasurementReport::Builder::getSource() { + return _builder.getDataField< ::cereal::QcomGnss::MeasurementSource>( + ::capnp::bounded<36>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::Builder::setSource( ::cereal::QcomGnss::MeasurementSource value) { + _builder.setDataField< ::cereal::QcomGnss::MeasurementSource>( + ::capnp::bounded<36>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::DrMeasurementReport::Reader::hasSv() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool QcomGnss::DrMeasurementReport::Builder::hasSv() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>::Reader QcomGnss::DrMeasurementReport::Reader::getSv() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>::Builder QcomGnss::DrMeasurementReport::Builder::getSv() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void QcomGnss::DrMeasurementReport::Builder::setSv( ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>::Builder QcomGnss::DrMeasurementReport::Builder::initSv(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void QcomGnss::DrMeasurementReport::Builder::adoptSv( + ::capnp::Orphan< ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>> QcomGnss::DrMeasurementReport::Builder::disownSv() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::QcomGnss::DrMeasurementReport::SV, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::SV::Reader::getSvId() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::SV::Builder::getSvId() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setSvId( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int8_t QcomGnss::DrMeasurementReport::SV::Reader::getGlonassFrequencyIndex() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int8_t QcomGnss::DrMeasurementReport::SV::Builder::getGlonassFrequencyIndex() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setGlonassFrequencyIndex( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::QcomGnss::SVObservationState QcomGnss::DrMeasurementReport::SV::Reader::getObservationState() const { + return _reader.getDataField< ::cereal::QcomGnss::SVObservationState>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::cereal::QcomGnss::SVObservationState QcomGnss::DrMeasurementReport::SV::Builder::getObservationState() { + return _builder.getDataField< ::cereal::QcomGnss::SVObservationState>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setObservationState( ::cereal::QcomGnss::SVObservationState value) { + _builder.setDataField< ::cereal::QcomGnss::SVObservationState>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::SV::Reader::getObservations() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::SV::Builder::getObservations() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setObservations( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::SV::Reader::getGoodObservations() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::SV::Builder::getGoodObservations() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setGoodObservations( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::SV::Reader::getFilterStages() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::SV::Builder::getFilterStages() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setFilterStages( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::SV::Reader::getPredetectInterval() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::SV::Builder::getPredetectInterval() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setPredetectInterval( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::SV::Reader::getCycleSlipCount() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t QcomGnss::DrMeasurementReport::SV::Builder::getCycleSlipCount() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setCycleSlipCount( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::DrMeasurementReport::SV::Reader::getPostdetections() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::DrMeasurementReport::SV::Builder::getPostdetections() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setPostdetections( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::DrMeasurementReport::SV::Reader::hasMeasurementStatus() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool QcomGnss::DrMeasurementReport::SV::Builder::hasMeasurementStatus() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::QcomGnss::MeasurementStatus::Reader QcomGnss::DrMeasurementReport::SV::Reader::getMeasurementStatus() const { + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementStatus>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::QcomGnss::MeasurementStatus::Builder QcomGnss::DrMeasurementReport::SV::Builder::getMeasurementStatus() { + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementStatus>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::QcomGnss::MeasurementStatus::Pipeline QcomGnss::DrMeasurementReport::SV::Pipeline::getMeasurementStatus() { + return ::cereal::QcomGnss::MeasurementStatus::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void QcomGnss::DrMeasurementReport::SV::Builder::setMeasurementStatus( ::cereal::QcomGnss::MeasurementStatus::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementStatus>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::QcomGnss::MeasurementStatus::Builder QcomGnss::DrMeasurementReport::SV::Builder::initMeasurementStatus() { + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementStatus>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::adoptMeasurementStatus( + ::capnp::Orphan< ::cereal::QcomGnss::MeasurementStatus>&& value) { + ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementStatus>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::QcomGnss::MeasurementStatus> QcomGnss::DrMeasurementReport::SV::Builder::disownMeasurementStatus() { + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss::MeasurementStatus>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::uint16_t QcomGnss::DrMeasurementReport::SV::Reader::getCarrierNoise() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::DrMeasurementReport::SV::Builder::getCarrierNoise() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setCarrierNoise( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::DrMeasurementReport::SV::Reader::getRfLoss() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::DrMeasurementReport::SV::Builder::getRfLoss() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setRfLoss( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline ::int16_t QcomGnss::DrMeasurementReport::SV::Reader::getLatency() const { + return _reader.getDataField< ::int16_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline ::int16_t QcomGnss::DrMeasurementReport::SV::Builder::getLatency() { + return _builder.getDataField< ::int16_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setLatency( ::int16_t value) { + _builder.setDataField< ::int16_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::SV::Reader::getFilteredMeasurementFraction() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::SV::Builder::getFilteredMeasurementFraction() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setFilteredMeasurementFraction(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::SV::Reader::getFilteredMeasurementIntegral() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::SV::Builder::getFilteredMeasurementIntegral() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setFilteredMeasurementIntegral( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::SV::Reader::getFilteredTimeUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::SV::Builder::getFilteredTimeUncertainty() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setFilteredTimeUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::SV::Reader::getFilteredSpeed() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::SV::Builder::getFilteredSpeed() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setFilteredSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::SV::Reader::getFilteredSpeedUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::SV::Builder::getFilteredSpeedUncertainty() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setFilteredSpeedUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::SV::Reader::getUnfilteredMeasurementFraction() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::SV::Builder::getUnfilteredMeasurementFraction() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setUnfilteredMeasurementFraction(float value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::SV::Reader::getUnfilteredMeasurementIntegral() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::SV::Builder::getUnfilteredMeasurementIntegral() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setUnfilteredMeasurementIntegral( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::SV::Reader::getUnfilteredTimeUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::SV::Builder::getUnfilteredTimeUncertainty() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setUnfilteredTimeUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::SV::Reader::getUnfilteredSpeed() const { + return _reader.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::SV::Builder::getUnfilteredSpeed() { + return _builder.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setUnfilteredSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::SV::Reader::getUnfilteredSpeedUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::SV::Builder::getUnfilteredSpeedUncertainty() { + return _builder.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setUnfilteredSpeedUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::SV::Reader::getMultipathEstimate() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::SV::Builder::getMultipathEstimate() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setMultipathEstimate( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::SV::Reader::getAzimuth() const { + return _reader.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::SV::Builder::getAzimuth() { + return _builder.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setAzimuth(float value) { + _builder.setDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::SV::Reader::getElevation() const { + return _reader.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::SV::Builder::getElevation() { + return _builder.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setElevation(float value) { + _builder.setDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::SV::Reader::getDopplerAcceleration() const { + return _reader.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::SV::Builder::getDopplerAcceleration() { + return _builder.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setDopplerAcceleration(float value) { + _builder.setDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::SV::Reader::getFineSpeed() const { + return _reader.getDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::SV::Builder::getFineSpeed() { + return _builder.getDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setFineSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrMeasurementReport::SV::Reader::getFineSpeedUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrMeasurementReport::SV::Builder::getFineSpeedUncertainty() { + return _builder.getDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setFineSpeedUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS, value); +} + +inline double QcomGnss::DrMeasurementReport::SV::Reader::getCarrierPhase() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline double QcomGnss::DrMeasurementReport::SV::Builder::getCarrierPhase() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setCarrierPhase(double value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::SV::Reader::getFCount() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t QcomGnss::DrMeasurementReport::SV::Builder::getFCount() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setFCount( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<21>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::DrMeasurementReport::SV::Reader::getParityErrorCount() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::DrMeasurementReport::SV::Builder::getParityErrorCount() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setParityErrorCount( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::DrMeasurementReport::SV::Reader::getGoodParity() const { + return _reader.getDataField( + ::capnp::bounded<72>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::DrMeasurementReport::SV::Builder::getGoodParity() { + return _builder.getDataField( + ::capnp::bounded<72>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrMeasurementReport::SV::Builder::setGoodParity(bool value) { + _builder.setDataField( + ::capnp::bounded<72>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::DrSvPolyReport::Reader::getSvId() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::DrSvPolyReport::Builder::getSvId() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setSvId( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int8_t QcomGnss::DrSvPolyReport::Reader::getFrequencyIndex() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int8_t QcomGnss::DrSvPolyReport::Builder::getFrequencyIndex() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setFrequencyIndex( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::DrSvPolyReport::Reader::getHasPosition() const { + return _reader.getDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::DrSvPolyReport::Builder::getHasPosition() { + return _builder.getDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setHasPosition(bool value) { + _builder.setDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::DrSvPolyReport::Reader::getHasIono() const { + return _reader.getDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::DrSvPolyReport::Builder::getHasIono() { + return _builder.getDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setHasIono(bool value) { + _builder.setDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::DrSvPolyReport::Reader::getHasTropo() const { + return _reader.getDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::DrSvPolyReport::Builder::getHasTropo() { + return _builder.getDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setHasTropo(bool value) { + _builder.setDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::DrSvPolyReport::Reader::getHasElevation() const { + return _reader.getDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::DrSvPolyReport::Builder::getHasElevation() { + return _builder.getDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setHasElevation(bool value) { + _builder.setDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::DrSvPolyReport::Reader::getPolyFromXtra() const { + return _reader.getDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::DrSvPolyReport::Builder::getPolyFromXtra() { + return _builder.getDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setPolyFromXtra(bool value) { + _builder.setDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::DrSvPolyReport::Reader::getHasSbasIono() const { + return _reader.getDataField( + ::capnp::bounded<29>() * ::capnp::ELEMENTS); +} + +inline bool QcomGnss::DrSvPolyReport::Builder::getHasSbasIono() { + return _builder.getDataField( + ::capnp::bounded<29>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setHasSbasIono(bool value) { + _builder.setDataField( + ::capnp::bounded<29>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t QcomGnss::DrSvPolyReport::Reader::getIode() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t QcomGnss::DrSvPolyReport::Builder::getIode() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setIode( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline double QcomGnss::DrSvPolyReport::Reader::getT0() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline double QcomGnss::DrSvPolyReport::Builder::getT0() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setT0(double value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::DrSvPolyReport::Reader::hasXyz0() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool QcomGnss::DrSvPolyReport::Builder::hasXyz0() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader QcomGnss::DrSvPolyReport::Reader::getXyz0() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder QcomGnss::DrSvPolyReport::Builder::getXyz0() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void QcomGnss::DrSvPolyReport::Builder::setXyz0( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void QcomGnss::DrSvPolyReport::Builder::setXyz0(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder QcomGnss::DrSvPolyReport::Builder::initXyz0(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void QcomGnss::DrSvPolyReport::Builder::adoptXyz0( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> QcomGnss::DrSvPolyReport::Builder::disownXyz0() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool QcomGnss::DrSvPolyReport::Reader::hasXyzN() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool QcomGnss::DrSvPolyReport::Builder::hasXyzN() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader QcomGnss::DrSvPolyReport::Reader::getXyzN() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder QcomGnss::DrSvPolyReport::Builder::getXyzN() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void QcomGnss::DrSvPolyReport::Builder::setXyzN( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void QcomGnss::DrSvPolyReport::Builder::setXyzN(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder QcomGnss::DrSvPolyReport::Builder::initXyzN(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void QcomGnss::DrSvPolyReport::Builder::adoptXyzN( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> QcomGnss::DrSvPolyReport::Builder::disownXyzN() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool QcomGnss::DrSvPolyReport::Reader::hasOther() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool QcomGnss::DrSvPolyReport::Builder::hasOther() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader QcomGnss::DrSvPolyReport::Reader::getOther() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder QcomGnss::DrSvPolyReport::Builder::getOther() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void QcomGnss::DrSvPolyReport::Builder::setOther( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void QcomGnss::DrSvPolyReport::Builder::setOther(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder QcomGnss::DrSvPolyReport::Builder::initOther(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void QcomGnss::DrSvPolyReport::Builder::adoptOther( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> QcomGnss::DrSvPolyReport::Builder::disownOther() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline float QcomGnss::DrSvPolyReport::Reader::getPositionUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrSvPolyReport::Builder::getPositionUncertainty() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setPositionUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrSvPolyReport::Reader::getIonoDelay() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrSvPolyReport::Builder::getIonoDelay() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setIonoDelay(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrSvPolyReport::Reader::getIonoDot() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrSvPolyReport::Builder::getIonoDot() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setIonoDot(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrSvPolyReport::Reader::getSbasIonoDelay() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrSvPolyReport::Builder::getSbasIonoDelay() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setSbasIonoDelay(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrSvPolyReport::Reader::getSbasIonoDot() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrSvPolyReport::Builder::getSbasIonoDot() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setSbasIonoDot(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrSvPolyReport::Reader::getTropoDelay() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrSvPolyReport::Builder::getTropoDelay() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setTropoDelay(float value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrSvPolyReport::Reader::getElevation() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrSvPolyReport::Builder::getElevation() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setElevation(float value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrSvPolyReport::Reader::getElevationDot() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrSvPolyReport::Builder::getElevationDot() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setElevationDot(float value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline float QcomGnss::DrSvPolyReport::Reader::getElevationUncertainty() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline float QcomGnss::DrSvPolyReport::Builder::getElevationUncertainty() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void QcomGnss::DrSvPolyReport::Builder::setElevationUncertainty(float value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline bool QcomGnss::DrSvPolyReport::Reader::hasVelocityCoeff() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool QcomGnss::DrSvPolyReport::Builder::hasVelocityCoeff() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader QcomGnss::DrSvPolyReport::Reader::getVelocityCoeff() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder QcomGnss::DrSvPolyReport::Builder::getVelocityCoeff() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void QcomGnss::DrSvPolyReport::Builder::setVelocityCoeff( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void QcomGnss::DrSvPolyReport::Builder::setVelocityCoeff(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder QcomGnss::DrSvPolyReport::Builder::initVelocityCoeff(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void QcomGnss::DrSvPolyReport::Builder::adoptVelocityCoeff( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> QcomGnss::DrSvPolyReport::Builder::disownVelocityCoeff() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool LidarPts::Reader::hasR() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LidarPts::Builder::hasR() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader LidarPts::Reader::getR() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder LidarPts::Builder::getR() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LidarPts::Builder::setR( ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void LidarPts::Builder::setR(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder LidarPts::Builder::initR(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void LidarPts::Builder::adoptR( + ::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>> LidarPts::Builder::disownR() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool LidarPts::Reader::hasTheta() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool LidarPts::Builder::hasTheta() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader LidarPts::Reader::getTheta() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder LidarPts::Builder::getTheta() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void LidarPts::Builder::setTheta( ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void LidarPts::Builder::setTheta(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder LidarPts::Builder::initTheta(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void LidarPts::Builder::adoptTheta( + ::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>> LidarPts::Builder::disownTheta() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool LidarPts::Reader::hasReflect() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool LidarPts::Builder::hasReflect() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Reader LidarPts::Reader::getReflect() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Builder LidarPts::Builder::getReflect() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void LidarPts::Builder::setReflect( ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void LidarPts::Builder::setReflect(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Builder LidarPts::Builder::initReflect(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void LidarPts::Builder::adoptReflect( + ::capnp::Orphan< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>> LidarPts::Builder::disownReflect() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline ::uint64_t LidarPts::Reader::getIdx() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t LidarPts::Builder::getIdx() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LidarPts::Builder::setIdx( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool LidarPts::Reader::hasPkt() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool LidarPts::Builder::hasPkt() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader LidarPts::Reader::getPkt() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder LidarPts::Builder::getPkt() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void LidarPts::Builder::setPkt( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder LidarPts::Builder::initPkt(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void LidarPts::Builder::adoptPkt( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> LidarPts::Builder::disownPkt() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +} // namespace + diff --git a/cereal/gen/cpp/log.capnp.c++ b/cereal/gen/cpp/log.capnp.c++ new file mode 100644 index 000000000..715e9da93 --- /dev/null +++ b/cereal/gen/cpp/log.capnp.c++ @@ -0,0 +1,19662 @@ +// Generated by Cap'n Proto compiler, DO NOT EDIT +// source: log.capnp + +#include "log.capnp.h" + +namespace capnp { +namespace schemas { +static const ::capnp::_::AlignedData<23> b_d578fb3372ed5043 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 67, 80, 237, 114, 51, 251, 120, 213, + 10, 0, 0, 0, 4, 0, 0, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 170, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 0, 0, 0, 3, 0, 1, 0, + 36, 0, 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 108, 111, 103, 86, 101, 114, + 115, 105, 111, 110, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d578fb3372ed5043 = b_d578fb3372ed5043.words; +#if !CAPNP_LITE +const ::capnp::_::RawSchema s_d578fb3372ed5043 = { + 0xd578fb3372ed5043, b_d578fb3372ed5043.words, 23, nullptr, nullptr, + 0, 0, nullptr, nullptr, nullptr, { &s_d578fb3372ed5043, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<48> b_f8b13ce2183eb696 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 10, 0, 0, 0, 1, 0, 0, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, + 21, 0, 0, 0, 114, 0, 0, 0, + 25, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 23, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 77, 97, 112, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 14, 234, 110, 74, 8, 221, 223, 165, + 1, 0, 0, 0, 50, 0, 0, 0, + 69, 110, 116, 114, 121, 0, 0, 0, + 4, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 1, 0, + 56, 0, 0, 0, 2, 0, 1, 0, + 101, 110, 116, 114, 105, 101, 115, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 14, 234, 110, 74, 8, 221, 223, 165, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 1, 0, 0, 0, 31, 0, 0, 0, + 4, 0, 0, 0, 2, 0, 1, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 1, 0, + 5, 0, 0, 0, 34, 0, 0, 0, + 5, 0, 0, 0, 50, 0, 0, 0, + 75, 101, 121, 0, 0, 0, 0, 0, + 86, 97, 108, 117, 101, 0, 0, 0, } +}; +::capnp::word const* const bp_f8b13ce2183eb696 = b_f8b13ce2183eb696.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_f8b13ce2183eb696[] = { + &s_a5dfdd084a6eea0e, +}; +static const uint16_t m_f8b13ce2183eb696[] = {0}; +static const uint16_t i_f8b13ce2183eb696[] = {0}; +KJ_CONSTEXPR(const) ::capnp::_::RawBrandedSchema::Dependency bd_f8b13ce2183eb696[] = { + { 16777216, ::cereal::Map< ::capnp::AnyPointer, ::capnp::AnyPointer>::Entry::_capnpPrivate::brand() }, +}; +const ::capnp::_::RawSchema s_f8b13ce2183eb696 = { + 0xf8b13ce2183eb696, b_f8b13ce2183eb696.words, 48, d_f8b13ce2183eb696, m_f8b13ce2183eb696, + 1, 1, i_f8b13ce2183eb696, nullptr, nullptr, { &s_f8b13ce2183eb696, nullptr, bd_f8b13ce2183eb696, 0, sizeof(bd_f8b13ce2183eb696) / sizeof(bd_f8b13ce2183eb696[0]), nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<47> b_a5dfdd084a6eea0e = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 14, 234, 110, 74, 8, 221, 223, 165, + 14, 0, 0, 0, 1, 0, 0, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, + 21, 0, 0, 0, 162, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 77, 97, 112, 46, 69, 110, + 116, 114, 121, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 1, 0, + 48, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 107, 101, 121, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 0, 0, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 97, 108, 117, 101, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 0, 0, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 0, 0, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a5dfdd084a6eea0e = b_a5dfdd084a6eea0e.words; +#if !CAPNP_LITE +static const uint16_t m_a5dfdd084a6eea0e[] = {0, 1}; +static const uint16_t i_a5dfdd084a6eea0e[] = {0, 1}; +const ::capnp::_::RawSchema s_a5dfdd084a6eea0e = { + 0xa5dfdd084a6eea0e, b_a5dfdd084a6eea0e.words, 47, nullptr, m_a5dfdd084a6eea0e, + 0, 2, i_a5dfdd084a6eea0e, nullptr, nullptr, { &s_a5dfdd084a6eea0e, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<394> b_e71008caeb3fb65c = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 92, 182, 63, 235, 202, 8, 16, 231, + 10, 0, 0, 0, 1, 0, 1, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 16, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 154, 0, 0, 0, + 29, 0, 0, 0, 103, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 0, 0, 0, 47, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 73, 110, 105, 116, 68, 97, + 116, 97, 0, 0, 0, 0, 0, 0, + 24, 0, 0, 0, 1, 0, 1, 0, + 8, 102, 168, 235, 56, 114, 93, 157, + 41, 0, 0, 0, 90, 0, 0, 0, + 173, 240, 223, 92, 114, 232, 115, 230, + 41, 0, 0, 0, 82, 0, 0, 0, + 108, 66, 31, 194, 213, 25, 41, 254, + 41, 0, 0, 0, 138, 0, 0, 0, + 205, 219, 135, 168, 147, 59, 81, 155, + 45, 0, 0, 0, 114, 0, 0, 0, + 165, 21, 246, 164, 83, 93, 251, 156, + 45, 0, 0, 0, 146, 0, 0, 0, + 128, 85, 159, 35, 40, 59, 126, 217, + 49, 0, 0, 0, 106, 0, 0, 0, + 68, 101, 118, 105, 99, 101, 84, 121, + 112, 101, 0, 0, 0, 0, 0, 0, + 80, 97, 110, 100, 97, 73, 110, 102, + 111, 0, 0, 0, 0, 0, 0, 0, + 65, 110, 100, 114, 111, 105, 100, 66, + 117, 105, 108, 100, 73, 110, 102, 111, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 110, 100, 114, 111, 105, 100, 83, + 101, 110, 115, 111, 114, 0, 0, 0, + 67, 104, 102, 102, 114, 65, 110, 100, + 114, 111, 105, 100, 69, 120, 116, 114, + 97, 0, 0, 0, 0, 0, 0, 0, + 73, 111, 115, 66, 117, 105, 108, 100, + 73, 110, 102, 111, 0, 0, 0, 0, + 76, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 2, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 2, 0, 0, 3, 0, 1, 0, + 32, 2, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 2, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 2, 0, 0, 3, 0, 1, 0, + 40, 2, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 2, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 2, 0, 0, 3, 0, 1, 0, + 48, 2, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 2, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 2, 0, 0, 3, 0, 1, 0, + 56, 2, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 2, 0, 0, 3, 0, 1, 0, + 60, 2, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 2, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 2, 0, 0, 3, 0, 1, 0, + 72, 2, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 2, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 2, 0, 0, 3, 0, 1, 0, + 104, 2, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 2, 0, 0, 226, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 2, 0, 0, 3, 0, 1, 0, + 120, 2, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 2, 0, 0, 3, 0, 1, 0, + 128, 2, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 2, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 2, 0, 0, 3, 0, 1, 0, + 132, 2, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 2, 0, 0, 3, 0, 1, 0, + 140, 2, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 2, 0, 0, 3, 0, 1, 0, + 148, 2, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 2, 0, 0, 3, 0, 1, 0, + 152, 2, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 2, 0, 0, 3, 0, 1, 0, + 160, 2, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 2, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 2, 0, 0, 3, 0, 1, 0, + 172, 2, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 2, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 2, 0, 0, 3, 0, 1, 0, + 180, 2, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 2, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 2, 0, 0, 3, 0, 1, 0, + 8, 3, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 3, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 3, 0, 1, 0, + 84, 3, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 3, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 3, 0, 0, 3, 0, 1, 0, + 92, 3, 0, 0, 2, 0, 1, 0, + 107, 101, 114, 110, 101, 108, 65, 114, + 103, 115, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 99, 116, 120, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 111, 110, 103, 108, 101, 73, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 118, 105, 99, 101, 84, 121, + 112, 101, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 8, 102, 168, 235, 56, 114, 93, 157, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 114, 115, 105, 111, 110, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 100, 114, 111, 105, 100, 66, + 117, 105, 108, 100, 73, 110, 102, 111, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 108, 66, 31, 194, 213, 25, 41, 254, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 100, 114, 111, 105, 100, 83, + 101, 110, 115, 111, 114, 115, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 205, 219, 135, 168, 147, 59, 81, 155, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 104, 102, 102, 114, 65, 110, 100, + 114, 111, 105, 100, 69, 120, 116, 114, + 97, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 165, 21, 246, 164, 83, 93, 251, 156, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 110, 100, 97, 73, 110, 102, + 111, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 173, 240, 223, 92, 114, 232, 115, 230, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 114, 116, 121, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 105, 116, 67, 111, 109, 109, 105, + 116, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 105, 116, 66, 114, 97, 110, 99, + 104, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 115, 115, 105, 118, 101, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 105, 116, 82, 101, 109, 111, 116, + 101, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 111, 115, 66, 117, 105, 108, 100, + 73, 110, 102, 111, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 128, 85, 159, 35, 40, 59, 126, 217, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 101, 114, 110, 101, 108, 86, 101, + 114, 115, 105, 111, 110, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 100, 114, 111, 105, 100, 80, + 114, 111, 112, 101, 114, 116, 105, 101, + 115, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 1, 0, 0, 0, 31, 0, 0, 0, + 4, 0, 0, 0, 2, 0, 1, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 39, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 3, 0, 1, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 114, 97, 109, 115, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 1, 0, 0, 0, 31, 0, 0, 0, + 4, 0, 0, 0, 2, 0, 1, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 39, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 3, 0, 1, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 115, 86, 101, 114, 115, 105, 111, + 110, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e71008caeb3fb65c = b_e71008caeb3fb65c.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_e71008caeb3fb65c[] = { + &s_9b513b93a887dbcd, + &s_9cfb5d53a4f615a5, + &s_9d5d7238eba86608, + &s_d97e3b28239f5580, + &s_e673e8725cdff0ad, + &s_f8b13ce2183eb696, + &s_fe2919d5c21f426c, +}; +static const uint16_t m_e71008caeb3fb65c[] = {5, 16, 6, 7, 3, 9, 2, 1, 11, 10, 13, 14, 0, 15, 18, 8, 17, 12, 4}; +static const uint16_t i_e71008caeb3fb65c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}; +KJ_CONSTEXPR(const) ::capnp::_::RawBrandedSchema::Dependency bd_e71008caeb3fb65c[] = { + { 16777232, ::cereal::Map< ::capnp::Text, ::capnp::Text>::_capnpPrivate::brand() }, + { 16777233, ::cereal::Map< ::capnp::Text, ::capnp::Data>::_capnpPrivate::brand() }, +}; +const ::capnp::_::RawSchema s_e71008caeb3fb65c = { + 0xe71008caeb3fb65c, b_e71008caeb3fb65c.words, 394, d_e71008caeb3fb65c, m_e71008caeb3fb65c, + 7, 19, i_e71008caeb3fb65c, nullptr, nullptr, { &s_e71008caeb3fb65c, nullptr, bd_e71008caeb3fb65c, 0, sizeof(bd_e71008caeb3fb65c) / sizeof(bd_e71008caeb3fb65c[0]), nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<44> b_9d5d7238eba86608 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 8, 102, 168, 235, 56, 114, 93, 157, + 19, 0, 0, 0, 2, 0, 0, 0, + 92, 182, 63, 235, 202, 8, 16, 231, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 242, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 151, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 73, 110, 105, 116, 68, 97, + 116, 97, 46, 68, 101, 118, 105, 99, + 101, 84, 121, 112, 101, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 24, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 57, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 111, 119, 110, 0, + 110, 101, 111, 0, 0, 0, 0, 0, + 99, 104, 102, 102, 114, 65, 110, 100, + 114, 111, 105, 100, 0, 0, 0, 0, + 99, 104, 102, 102, 114, 73, 111, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 99, 105, 0, 0, 0, 0, + 112, 99, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9d5d7238eba86608 = b_9d5d7238eba86608.words; +#if !CAPNP_LITE +static const uint16_t m_9d5d7238eba86608[] = {2, 3, 1, 5, 4, 0}; +const ::capnp::_::RawSchema s_9d5d7238eba86608 = { + 0x9d5d7238eba86608, b_9d5d7238eba86608.words, 44, nullptr, m_9d5d7238eba86608, + 0, 6, nullptr, nullptr, nullptr, { &s_9d5d7238eba86608, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(DeviceType_9d5d7238eba86608, 9d5d7238eba86608); +static const ::capnp::_::AlignedData<82> b_e673e8725cdff0ad = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 173, 240, 223, 92, 114, 232, 115, 230, + 19, 0, 0, 0, 1, 0, 1, 0, + 92, 182, 63, 235, 202, 8, 16, 231, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 234, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 73, 110, 105, 116, 68, 97, + 116, 97, 46, 80, 97, 110, 100, 97, + 73, 110, 102, 111, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 3, 0, 1, 0, + 108, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 0, 0, 0, 3, 0, 1, 0, + 116, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 0, 0, 0, 3, 0, 1, 0, + 124, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 0, 0, 0, 3, 0, 1, 0, + 132, 0, 0, 0, 2, 0, 1, 0, + 104, 97, 115, 80, 97, 110, 100, 97, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 111, 110, 103, 108, 101, 73, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 86, 101, 114, 115, 105, 111, + 110, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 115, 112, 86, 101, 114, 115, 105, + 111, 110, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e673e8725cdff0ad = b_e673e8725cdff0ad.words; +#if !CAPNP_LITE +static const uint16_t m_e673e8725cdff0ad[] = {1, 3, 0, 2}; +static const uint16_t i_e673e8725cdff0ad[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_e673e8725cdff0ad = { + 0xe673e8725cdff0ad, b_e673e8725cdff0ad.words, 82, nullptr, m_e673e8725cdff0ad, + 0, 4, i_e673e8725cdff0ad, nullptr, nullptr, { &s_e673e8725cdff0ad, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<379> b_fe2919d5c21f426c = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 108, 66, 31, 194, 213, 25, 41, 254, + 19, 0, 0, 0, 1, 0, 2, 0, + 92, 182, 63, 235, 202, 8, 16, 231, + 21, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 34, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 15, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 73, 110, 105, 116, 68, 97, + 116, 97, 46, 65, 110, 100, 114, 111, + 105, 100, 66, 117, 105, 108, 100, 73, + 110, 102, 111, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 92, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 2, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 2, 0, 0, 3, 0, 1, 0, + 124, 2, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 2, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 2, 0, 0, 3, 0, 1, 0, + 132, 2, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 2, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 2, 0, 0, 3, 0, 1, 0, + 136, 2, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 2, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 2, 0, 0, 3, 0, 1, 0, + 140, 2, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 2, 0, 0, 3, 0, 1, 0, + 144, 2, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 2, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 2, 0, 0, 3, 0, 1, 0, + 152, 2, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 2, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 2, 0, 0, 3, 0, 1, 0, + 160, 2, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 2, 0, 0, 3, 0, 1, 0, + 164, 2, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 2, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 2, 0, 0, 3, 0, 1, 0, + 168, 2, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 2, 0, 0, 3, 0, 1, 0, + 176, 2, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 2, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 2, 0, 0, 3, 0, 1, 0, + 180, 2, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 2, 0, 0, 3, 0, 1, 0, + 184, 2, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 2, 0, 0, 3, 0, 1, 0, + 192, 2, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 2, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 2, 0, 0, 3, 0, 1, 0, + 196, 2, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 2, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 2, 0, 0, 3, 0, 1, 0, + 220, 2, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 2, 0, 0, 3, 0, 1, 0, + 224, 2, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 2, 0, 0, 3, 0, 1, 0, + 228, 2, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 2, 0, 0, 3, 0, 1, 0, + 232, 2, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 2, 0, 0, 3, 0, 1, 0, + 236, 2, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 2, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 2, 0, 0, 3, 0, 1, 0, + 244, 2, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 2, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 2, 0, 0, 3, 0, 1, 0, + 252, 2, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 2, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 2, 0, 0, 3, 0, 1, 0, + 4, 3, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 20, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 3, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 3, 0, 0, 3, 0, 1, 0, + 16, 3, 0, 0, 2, 0, 1, 0, + 98, 111, 97, 114, 100, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 111, 111, 116, 108, 111, 97, 100, + 101, 114, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 110, 100, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 118, 105, 99, 101, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 115, 112, 108, 97, 121, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 110, 103, 101, 114, 112, 114, + 105, 110, 116, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 114, 100, 119, 97, 114, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 111, 115, 116, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 100, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 110, 117, 102, 97, 99, 116, + 117, 114, 101, 114, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 100, 101, 108, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 111, 100, 117, 99, 116, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 100, 105, 111, 86, 101, 114, + 115, 105, 111, 110, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 114, 105, 97, 108, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 117, 112, 112, 111, 114, 116, 101, + 100, 65, 98, 105, 115, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 97, 103, 115, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 121, 112, 101, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 115, 101, 114, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 114, 115, 105, 111, 110, 67, + 111, 100, 101, 110, 97, 109, 101, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 114, 115, 105, 111, 110, 82, + 101, 108, 101, 97, 115, 101, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 114, 115, 105, 111, 110, 83, + 100, 107, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 114, 115, 105, 111, 110, 83, + 101, 99, 117, 114, 105, 116, 121, 80, + 97, 116, 99, 104, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_fe2919d5c21f426c = b_fe2919d5c21f426c.words; +#if !CAPNP_LITE +static const uint16_t m_fe2919d5c21f426c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22}; +static const uint16_t i_fe2919d5c21f426c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22}; +const ::capnp::_::RawSchema s_fe2919d5c21f426c = { + 0xfe2919d5c21f426c, b_fe2919d5c21f426c.words, 379, nullptr, m_fe2919d5c21f426c, + 0, 23, i_fe2919d5c21f426c, nullptr, nullptr, { &s_fe2919d5c21f426c, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<238> b_9b513b93a887dbcd = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 205, 219, 135, 168, 147, 59, 81, 155, + 19, 0, 0, 0, 1, 0, 6, 0, + 92, 182, 63, 235, 202, 8, 16, 231, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 10, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 23, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 73, 110, 105, 116, 68, 97, + 116, 97, 46, 65, 110, 100, 114, 111, + 105, 100, 83, 101, 110, 115, 111, 114, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 56, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 1, 0, 0, 3, 0, 1, 0, + 128, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 1, 0, 0, 3, 0, 1, 0, + 132, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 1, 0, 0, 3, 0, 1, 0, + 136, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 1, 0, 0, 3, 0, 1, 0, + 140, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 1, 0, 0, 3, 0, 1, 0, + 144, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 1, 0, 0, 3, 0, 1, 0, + 148, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 1, 0, 0, 3, 0, 1, 0, + 156, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 1, 0, 0, 3, 0, 1, 0, + 164, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 1, 0, 0, 3, 0, 1, 0, + 168, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 1, 0, 0, 3, 0, 1, 0, + 176, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 1, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 1, 0, 0, 3, 0, 1, 0, + 188, 1, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 1, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 1, 0, 0, 3, 0, 1, 0, + 200, 1, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 1, 0, 0, 3, 0, 1, 0, + 208, 1, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 1, 0, 0, 3, 0, 1, 0, + 216, 1, 0, 0, 2, 0, 1, 0, + 105, 100, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 97, 109, 101, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 110, 100, 111, 114, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 114, 115, 105, 111, 110, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 110, 100, 108, 101, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 121, 112, 101, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 120, 82, 97, 110, 103, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 115, 111, 108, 117, 116, 105, + 111, 110, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 119, 101, 114, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 105, 110, 68, 101, 108, 97, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 102, 111, 82, 101, 115, 101, + 114, 118, 101, 100, 69, 118, 101, 110, + 116, 67, 111, 117, 110, 116, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 102, 111, 77, 97, 120, 69, + 118, 101, 110, 116, 67, 111, 117, 110, + 116, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 114, 105, 110, 103, 84, 121, + 112, 101, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 120, 68, 101, 108, 97, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9b513b93a887dbcd = b_9b513b93a887dbcd.words; +#if !CAPNP_LITE +static const uint16_t m_9b513b93a887dbcd[] = {11, 10, 4, 0, 13, 6, 9, 1, 8, 7, 12, 5, 2, 3}; +static const uint16_t i_9b513b93a887dbcd[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}; +const ::capnp::_::RawSchema s_9b513b93a887dbcd = { + 0x9b513b93a887dbcd, b_9b513b93a887dbcd.words, 238, nullptr, m_9b513b93a887dbcd, + 0, 14, i_9b513b93a887dbcd, nullptr, nullptr, { &s_9b513b93a887dbcd, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<55> b_9cfb5d53a4f615a5 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 165, 21, 246, 164, 83, 93, 251, 156, + 19, 0, 0, 0, 1, 0, 0, 0, + 92, 182, 63, 235, 202, 8, 16, 231, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 42, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 73, 110, 105, 116, 68, 97, + 116, 97, 46, 67, 104, 102, 102, 114, + 65, 110, 100, 114, 111, 105, 100, 69, + 120, 116, 114, 97, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 3, 0, 1, 0, + 104, 0, 0, 0, 2, 0, 1, 0, + 97, 108, 108, 67, 97, 109, 101, 114, + 97, 67, 104, 97, 114, 97, 99, 116, + 101, 114, 105, 115, 116, 105, 99, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 1, 0, 0, 0, 31, 0, 0, 0, + 4, 0, 0, 0, 2, 0, 1, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 39, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 3, 0, 1, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9cfb5d53a4f615a5 = b_9cfb5d53a4f615a5.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_9cfb5d53a4f615a5[] = { + &s_f8b13ce2183eb696, +}; +static const uint16_t m_9cfb5d53a4f615a5[] = {0}; +static const uint16_t i_9cfb5d53a4f615a5[] = {0}; +KJ_CONSTEXPR(const) ::capnp::_::RawBrandedSchema::Dependency bd_9cfb5d53a4f615a5[] = { + { 16777216, ::cereal::Map< ::capnp::Text, ::capnp::Text>::_capnpPrivate::brand() }, +}; +const ::capnp::_::RawSchema s_9cfb5d53a4f615a5 = { + 0x9cfb5d53a4f615a5, b_9cfb5d53a4f615a5.words, 55, d_9cfb5d53a4f615a5, m_9cfb5d53a4f615a5, + 1, 1, i_9cfb5d53a4f615a5, nullptr, nullptr, { &s_9cfb5d53a4f615a5, nullptr, bd_9cfb5d53a4f615a5, 0, sizeof(bd_9cfb5d53a4f615a5) / sizeof(bd_9cfb5d53a4f615a5[0]), nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<82> b_d97e3b28239f5580 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 128, 85, 159, 35, 40, 59, 126, 217, + 19, 0, 0, 0, 1, 0, 1, 0, + 92, 182, 63, 235, 202, 8, 16, 231, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 2, 1, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 73, 110, 105, 116, 68, 97, + 116, 97, 46, 73, 111, 115, 66, 117, + 105, 108, 100, 73, 110, 102, 111, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 3, 0, 1, 0, + 108, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 0, 0, 0, 3, 0, 1, 0, + 116, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 0, 0, 0, 3, 0, 1, 0, + 124, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 0, 0, 0, 3, 0, 1, 0, + 132, 0, 0, 0, 2, 0, 1, 0, + 97, 112, 112, 86, 101, 114, 115, 105, + 111, 110, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 112, 112, 66, 117, 105, 108, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 115, 86, 101, 114, 115, 105, 111, + 110, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 118, 105, 99, 101, 77, 111, + 100, 101, 108, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d97e3b28239f5580 = b_d97e3b28239f5580.words; +#if !CAPNP_LITE +static const uint16_t m_d97e3b28239f5580[] = {1, 0, 3, 2}; +static const uint16_t i_d97e3b28239f5580[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_d97e3b28239f5580 = { + 0xd97e3b28239f5580, b_d97e3b28239f5580.words, 82, nullptr, m_d97e3b28239f5580, + 0, 4, i_d97e3b28239f5580, nullptr, nullptr, { &s_d97e3b28239f5580, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<409> b_ea0245f695ae0a33 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 51, 10, 174, 149, 246, 69, 2, 234, + 10, 0, 0, 0, 1, 0, 9, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 6, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 162, 0, 0, 0, + 29, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 15, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 70, 114, 97, 109, 101, 68, + 97, 116, 97, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 121, 40, 16, 30, 240, 105, 177, 221, + 9, 0, 0, 0, 82, 0, 0, 0, + 72, 32, 29, 196, 186, 239, 195, 188, + 9, 0, 0, 0, 170, 0, 0, 0, + 70, 114, 97, 109, 101, 84, 121, 112, + 101, 0, 0, 0, 0, 0, 0, 0, + 65, 110, 100, 114, 111, 105, 100, 67, + 97, 112, 116, 117, 114, 101, 82, 101, + 115, 117, 108, 116, 0, 0, 0, 0, + 92, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 2, 0, 0, 3, 0, 1, 0, + 124, 2, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 2, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 2, 0, 0, 3, 0, 1, 0, + 132, 2, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 2, 0, 0, 3, 0, 1, 0, + 140, 2, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 2, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 2, 0, 0, 3, 0, 1, 0, + 148, 2, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 2, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 2, 0, 0, 3, 0, 1, 0, + 156, 2, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 2, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 2, 0, 0, 3, 0, 1, 0, + 168, 2, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 2, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 2, 0, 0, 3, 0, 1, 0, + 172, 2, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 2, 0, 0, 3, 0, 1, 0, + 180, 2, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 2, 0, 0, 3, 0, 1, 0, + 188, 2, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 2, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 2, 0, 0, 3, 0, 1, 0, + 200, 2, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 2, 0, 0, 3, 0, 1, 0, + 224, 2, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 2, 0, 0, 3, 0, 1, 0, + 228, 2, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 2, 0, 0, 3, 0, 1, 0, + 232, 2, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 2, 0, 0, 3, 0, 1, 0, + 236, 2, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 2, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 2, 0, 0, 3, 0, 1, 0, + 244, 2, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 2, 0, 0, 3, 0, 1, 0, + 248, 2, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 2, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 2, 0, 0, 3, 0, 1, 0, + 16, 3, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 3, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 3, 0, 0, 3, 0, 1, 0, + 40, 3, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 3, 0, 0, 3, 0, 1, 0, + 64, 3, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 3, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 3, 0, 0, 3, 0, 1, 0, + 72, 3, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 240, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 3, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 3, 0, 0, 3, 0, 1, 0, + 84, 3, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 3, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 3, 0, 0, 3, 0, 1, 0, + 96, 3, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 3, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 3, 0, 0, 3, 0, 1, 0, + 108, 3, 0, 0, 2, 0, 1, 0, + 102, 114, 97, 109, 101, 73, 100, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 99, 111, 100, 101, 73, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 69, 111, 102, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 97, 109, 101, 76, 101, 110, + 103, 116, 104, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 103, 76, 105, 110, + 101, 115, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 98, 97, 108, 71, 97, + 105, 110, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 109, 97, 103, 101, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 97, 109, 101, 84, 121, 112, + 101, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 121, 40, 16, 30, 240, 105, 177, 221, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 83, 111, 102, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 100, 114, 111, 105, 100, 67, + 97, 112, 116, 117, 114, 101, 82, 101, + 115, 117, 108, 116, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 72, 32, 29, 196, 186, 239, 195, 188, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 114, 97, 110, 115, 102, 111, 114, + 109, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 110, 115, 80, 111, 115, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 110, 115, 83, 97, 103, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 110, 115, 69, 114, 114, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 110, 115, 84, 114, 117, 101, + 80, 111, 115, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 105, 110, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 111, 99, 117, 115, 86, 97, 108, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 111, 99, 117, 115, 67, 111, 110, + 102, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 104, 97, 114, 112, 110, 101, 115, + 115, 83, 99, 111, 114, 101, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 99, 111, 118, 101, 114, 83, + 116, 97, 116, 101, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 105, 103, 104, 67, 111, 110, 118, + 101, 114, 115, 105, 111, 110, 71, 97, + 105, 110, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 97, 115, 117, 114, 101, 100, + 71, 114, 101, 121, 70, 114, 97, 99, + 116, 105, 111, 110, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 97, 114, 103, 101, 116, 71, 114, + 101, 121, 70, 114, 97, 99, 116, 105, + 111, 110, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_ea0245f695ae0a33 = b_ea0245f695ae0a33.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_ea0245f695ae0a33[] = { + &s_bcc3efbac41d2048, + &s_ddb169f01e102879, +}; +static const uint16_t m_ea0245f695ae0a33[] = {9, 1, 17, 16, 0, 3, 7, 15, 5, 20, 6, 4, 13, 11, 12, 14, 21, 19, 18, 22, 2, 8, 10}; +static const uint16_t i_ea0245f695ae0a33[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22}; +const ::capnp::_::RawSchema s_ea0245f695ae0a33 = { + 0xea0245f695ae0a33, b_ea0245f695ae0a33.words, 409, d_ea0245f695ae0a33, m_ea0245f695ae0a33, + 2, 23, i_ea0245f695ae0a33, nullptr, nullptr, { &s_ea0245f695ae0a33, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<35> b_ddb169f01e102879 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 121, 40, 16, 30, 240, 105, 177, 221, + 20, 0, 0, 0, 2, 0, 0, 0, + 51, 10, 174, 149, 246, 69, 2, 234, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 242, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 103, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 70, 114, 97, 109, 101, 68, + 97, 116, 97, 46, 70, 114, 97, 109, + 101, 84, 121, 112, 101, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 111, 119, 110, 0, + 110, 101, 111, 0, 0, 0, 0, 0, + 99, 104, 102, 102, 114, 65, 110, 100, + 114, 111, 105, 100, 0, 0, 0, 0, + 102, 114, 111, 110, 116, 0, 0, 0, } +}; +::capnp::word const* const bp_ddb169f01e102879 = b_ddb169f01e102879.words; +#if !CAPNP_LITE +static const uint16_t m_ddb169f01e102879[] = {2, 3, 1, 0}; +const ::capnp::_::RawSchema s_ddb169f01e102879 = { + 0xddb169f01e102879, b_ddb169f01e102879.words, 35, nullptr, m_ddb169f01e102879, + 0, 4, nullptr, nullptr, nullptr, { &s_ddb169f01e102879, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(FrameType_ddb169f01e102879, ddb169f01e102879); +static const ::capnp::_::AlignedData<144> b_bcc3efbac41d2048 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 72, 32, 29, 196, 186, 239, 195, 188, + 20, 0, 0, 0, 1, 0, 4, 0, + 51, 10, 174, 149, 246, 69, 2, 234, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 74, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 143, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 70, 114, 97, 109, 101, 68, + 97, 116, 97, 46, 65, 110, 100, 114, + 111, 105, 100, 67, 97, 112, 116, 117, + 114, 101, 82, 101, 115, 117, 108, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 0, 0, 0, 3, 0, 1, 0, + 192, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 3, 0, 1, 0, + 200, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 0, 0, 0, 3, 0, 1, 0, + 208, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 0, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 0, 0, 0, 3, 0, 1, 0, + 220, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 0, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 0, 0, 0, 3, 0, 1, 0, + 252, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 0, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 0, 0, 0, 3, 0, 1, 0, + 24, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 1, 0, 0, 3, 0, 1, 0, + 32, 1, 0, 0, 2, 0, 1, 0, + 115, 101, 110, 115, 105, 116, 105, 118, + 105, 116, 121, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 97, 109, 101, 68, 117, 114, + 97, 116, 105, 111, 110, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 120, 112, 111, 115, 117, 114, 101, + 84, 105, 109, 101, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 108, 108, 105, 110, 103, 83, + 104, 117, 116, 116, 101, 114, 83, 107, + 101, 119, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 108, 111, 114, 67, 111, 114, + 114, 101, 99, 116, 105, 111, 110, 84, + 114, 97, 110, 115, 102, 111, 114, 109, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 108, 111, 114, 67, 111, 114, + 114, 101, 99, 116, 105, 111, 110, 71, + 97, 105, 110, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 115, 112, 108, 97, 121, 82, + 111, 116, 97, 116, 105, 111, 110, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_bcc3efbac41d2048 = b_bcc3efbac41d2048.words; +#if !CAPNP_LITE +static const uint16_t m_bcc3efbac41d2048[] = {5, 4, 6, 2, 1, 3, 0}; +static const uint16_t i_bcc3efbac41d2048[] = {0, 1, 2, 3, 4, 5, 6}; +const ::capnp::_::RawSchema s_bcc3efbac41d2048 = { + 0xbcc3efbac41d2048, b_bcc3efbac41d2048.words, 144, nullptr, m_bcc3efbac41d2048, + 0, 7, i_bcc3efbac41d2048, nullptr, nullptr, { &s_bcc3efbac41d2048, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<64> b_b65fce64120af7d3 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 211, 247, 10, 18, 100, 206, 95, 182, + 10, 0, 0, 0, 1, 0, 2, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 162, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 84, 104, 117, 109, 98, 110, + 97, 105, 108, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 3, 0, 1, 0, + 76, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 0, 0, 0, 3, 0, 1, 0, + 84, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 0, 0, 0, 3, 0, 1, 0, + 92, 0, 0, 0, 2, 0, 1, 0, + 102, 114, 97, 109, 101, 73, 100, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 69, 111, 102, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 104, 117, 109, 98, 110, 97, 105, + 108, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_b65fce64120af7d3 = b_b65fce64120af7d3.words; +#if !CAPNP_LITE +static const uint16_t m_b65fce64120af7d3[] = {0, 2, 1}; +static const uint16_t i_b65fce64120af7d3[] = {0, 1, 2}; +const ::capnp::_::RawSchema s_b65fce64120af7d3 = { + 0xb65fce64120af7d3, b_b65fce64120af7d3.words, 64, nullptr, m_b65fce64120af7d3, + 0, 3, i_b65fce64120af7d3, nullptr, nullptr, { &s_b65fce64120af7d3, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<64> b_9d291d7813ba4a88 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 136, 74, 186, 19, 120, 29, 41, 157, + 10, 0, 0, 0, 1, 0, 2, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 178, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 71, 80, 83, 78, 77, 69, + 65, 68, 97, 116, 97, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 0, 0, 3, 0, 1, 0, + 80, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 0, 0, 0, 3, 0, 1, 0, + 88, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 0, 0, 0, 3, 0, 1, 0, + 92, 0, 0, 0, 2, 0, 1, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 99, 97, 108, 87, 97, 108, + 108, 84, 105, 109, 101, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 109, 101, 97, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9d291d7813ba4a88 = b_9d291d7813ba4a88.words; +#if !CAPNP_LITE +static const uint16_t m_9d291d7813ba4a88[] = {1, 2, 0}; +static const uint16_t i_9d291d7813ba4a88[] = {0, 1, 2}; +const ::capnp::_::RawSchema s_9d291d7813ba4a88 = { + 0x9d291d7813ba4a88, b_9d291d7813ba4a88.words, 64, nullptr, m_9d291d7813ba4a88, + 0, 3, i_9d291d7813ba4a88, nullptr, nullptr, { &s_9d291d7813ba4a88, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<279> b_a2b29a69d44529a1 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 161, 41, 69, 212, 105, 154, 178, 162, + 10, 0, 0, 0, 1, 0, 4, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 1, 0, 7, 0, 0, 0, 10, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 210, 0, 0, 0, + 33, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 135, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 83, 101, 110, 115, 111, 114, + 69, 118, 101, 110, 116, 68, 97, 116, + 97, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 252, 36, 252, 43, 189, 41, 52, 164, + 9, 0, 0, 0, 82, 0, 0, 0, + 13, 141, 244, 247, 232, 60, 155, 228, + 9, 0, 0, 0, 106, 0, 0, 0, + 83, 101, 110, 115, 111, 114, 86, 101, + 99, 0, 0, 0, 0, 0, 0, 0, + 83, 101, 110, 115, 111, 114, 83, 111, + 117, 114, 99, 101, 0, 0, 0, 0, + 64, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 1, 0, 0, 3, 0, 1, 0, + 184, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 1, 0, 0, 3, 0, 1, 0, + 188, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 1, 0, 0, 3, 0, 1, 0, + 192, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 1, 0, 0, 3, 0, 1, 0, + 200, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 255, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 1, 0, 0, 3, 0, 1, 0, + 208, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 254, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 1, 0, 0, 3, 0, 1, 0, + 216, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 253, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 1, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 1, 0, 0, 3, 0, 1, 0, + 224, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 252, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 1, 0, 0, 3, 0, 1, 0, + 228, 1, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 1, 0, 0, 3, 0, 1, 0, + 232, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 251, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 1, 0, 0, 3, 0, 1, 0, + 240, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 192, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 1, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 1, 0, 0, 3, 0, 1, 0, + 252, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 250, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 1, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 1, 0, 0, 3, 0, 1, 0, + 8, 2, 0, 0, 2, 0, 1, 0, + 11, 0, 249, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 2, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 2, 0, 0, 3, 0, 1, 0, + 20, 2, 0, 0, 2, 0, 1, 0, + 12, 0, 248, 255, 7, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 2, 0, 0, 3, 0, 1, 0, + 28, 2, 0, 0, 2, 0, 1, 0, + 13, 0, 247, 255, 7, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 2, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 2, 0, 0, 3, 0, 1, 0, + 32, 2, 0, 0, 2, 0, 1, 0, + 14, 0, 246, 255, 7, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 2, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 2, 0, 0, 3, 0, 1, 0, + 40, 2, 0, 0, 2, 0, 1, 0, + 118, 101, 114, 115, 105, 111, 110, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 110, 115, 111, 114, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 121, 112, 101, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 101, 108, 101, 114, 97, + 116, 105, 111, 110, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 252, 36, 252, 43, 189, 41, 52, 164, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 103, 110, 101, 116, 105, 99, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 252, 36, 252, 43, 189, 41, 52, 164, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 114, 105, 101, 110, 116, 97, 116, + 105, 111, 110, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 252, 36, 252, 43, 189, 41, 52, 164, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 121, 114, 111, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 252, 36, 252, 43, 189, 41, 52, 164, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 111, 117, 114, 99, 101, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 13, 141, 244, 247, 232, 60, 155, 228, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 101, 115, 115, 117, 114, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 252, 36, 252, 43, 189, 41, 52, 164, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 99, 97, 108, 105, 98, 114, + 97, 116, 101, 100, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 103, 110, 101, 116, 105, 99, + 85, 110, 99, 97, 108, 105, 98, 114, + 97, 116, 101, 100, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 252, 36, 252, 43, 189, 41, 52, 164, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 121, 114, 111, 85, 110, 99, 97, + 108, 105, 98, 114, 97, 116, 101, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 252, 36, 252, 43, 189, 41, 52, 164, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 111, 120, 105, 109, 105, 116, + 121, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 103, 104, 116, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 101, 109, 112, 101, 114, 97, 116, + 117, 114, 101, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a2b29a69d44529a1 = b_a2b29a69d44529a1.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_a2b29a69d44529a1[] = { + &s_a43429bd2bfc24fc, + &s_e49b3ce8f7f48d0d, +}; +static const uint16_t m_a2b29a69d44529a1[] = {4, 7, 12, 14, 5, 11, 6, 9, 13, 1, 8, 15, 3, 2, 10, 0}; +static const uint16_t i_a2b29a69d44529a1[] = {4, 5, 6, 7, 9, 11, 12, 13, 14, 15, 0, 1, 2, 3, 8, 10}; +const ::capnp::_::RawSchema s_a2b29a69d44529a1 = { + 0xa2b29a69d44529a1, b_a2b29a69d44529a1.words, 279, d_a2b29a69d44529a1, m_a2b29a69d44529a1, + 2, 16, i_a2b29a69d44529a1, nullptr, nullptr, { &s_a2b29a69d44529a1, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<53> b_a43429bd2bfc24fc = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 252, 36, 252, 43, 189, 41, 52, 164, + 26, 0, 0, 0, 1, 0, 1, 0, + 161, 41, 69, 212, 105, 154, 178, 162, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 34, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 83, 101, 110, 115, 111, 114, + 69, 118, 101, 110, 116, 68, 97, 116, + 97, 46, 83, 101, 110, 115, 111, 114, + 86, 101, 99, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 1, 0, + 64, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 0, 0, 0, 3, 0, 1, 0, + 68, 0, 0, 0, 2, 0, 1, 0, + 118, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 116, 117, 115, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a43429bd2bfc24fc = b_a43429bd2bfc24fc.words; +#if !CAPNP_LITE +static const uint16_t m_a43429bd2bfc24fc[] = {1, 0}; +static const uint16_t i_a43429bd2bfc24fc[] = {0, 1}; +const ::capnp::_::RawSchema s_a43429bd2bfc24fc = { + 0xa43429bd2bfc24fc, b_a43429bd2bfc24fc.words, 53, nullptr, m_a43429bd2bfc24fc, + 0, 2, i_a43429bd2bfc24fc, nullptr, nullptr, { &s_a43429bd2bfc24fc, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<71> b_e49b3ce8f7f48d0d = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 13, 141, 244, 247, 232, 60, 155, 228, + 26, 0, 0, 0, 2, 0, 0, 0, + 161, 41, 69, 212, 105, 154, 178, 162, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 58, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 39, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 83, 101, 110, 115, 111, 114, + 69, 118, 101, 110, 116, 68, 97, 116, + 97, 46, 83, 101, 110, 115, 111, 114, + 83, 111, 117, 114, 99, 101, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 48, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 129, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 101, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 93, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 85, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 81, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 100, 114, 111, 105, 100, 0, + 105, 79, 83, 0, 0, 0, 0, 0, + 102, 105, 98, 101, 114, 0, 0, 0, + 118, 101, 108, 111, 100, 121, 110, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 110, 111, 48, 53, 53, 0, 0, + 108, 115, 109, 54, 100, 115, 51, 0, + 98, 109, 112, 50, 56, 48, 0, 0, + 109, 109, 99, 51, 52, 49, 54, 120, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 109, 120, 48, 53, 53, 0, 0, + 114, 112, 114, 48, 53, 50, 49, 0, + 108, 115, 109, 54, 100, 115, 51, 116, + 114, 99, 0, 0, 0, 0, 0, 0, + 109, 109, 99, 53, 54, 48, 51, 110, + 106, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e49b3ce8f7f48d0d = b_e49b3ce8f7f48d0d.words; +#if !CAPNP_LITE +static const uint16_t m_e49b3ce8f7f48d0d[] = {0, 6, 8, 4, 2, 1, 5, 10, 7, 11, 9, 3}; +const ::capnp::_::RawSchema s_e49b3ce8f7f48d0d = { + 0xe49b3ce8f7f48d0d, b_e49b3ce8f7f48d0d.words, 71, nullptr, m_e49b3ce8f7f48d0d, + 0, 12, nullptr, nullptr, nullptr, { &s_e49b3ce8f7f48d0d, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(SensorSource_e49b3ce8f7f48d0d, e49b3ce8f7f48d0d); +static const ::capnp::_::AlignedData<232> b_e946524859add50e = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 14, 213, 173, 89, 72, 82, 70, 233, + 10, 0, 0, 0, 1, 0, 8, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 210, 0, 0, 0, + 33, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 223, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 71, 112, 115, 76, 111, 99, + 97, 116, 105, 111, 110, 68, 97, 116, + 97, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 99, 72, 115, 92, 242, 121, 255, 211, + 1, 0, 0, 0, 106, 0, 0, 0, + 83, 101, 110, 115, 111, 114, 83, 111, + 117, 114, 99, 101, 0, 0, 0, 0, + 52, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 1, 0, 0, 3, 0, 1, 0, + 100, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 1, 0, 0, 3, 0, 1, 0, + 108, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 1, 0, 0, 3, 0, 1, 0, + 116, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 1, 0, 0, 3, 0, 1, 0, + 124, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 1, 0, 0, 3, 0, 1, 0, + 128, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 1, 0, 0, 3, 0, 1, 0, + 136, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 1, 0, 0, 3, 0, 1, 0, + 144, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 1, 0, 0, 3, 0, 1, 0, + 152, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 1, 0, 0, 3, 0, 1, 0, + 156, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 1, 0, 0, 3, 0, 1, 0, + 176, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 1, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 1, 0, 0, 3, 0, 1, 0, + 188, 1, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 1, 0, 0, 3, 0, 1, 0, + 200, 1, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 1, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 1, 0, 0, 3, 0, 1, 0, + 208, 1, 0, 0, 2, 0, 1, 0, + 102, 108, 97, 103, 115, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 116, 105, 116, 117, 100, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 110, 103, 105, 116, 117, 100, + 101, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 108, 116, 105, 116, 117, 100, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 101, 97, 114, 105, 110, 103, 68, + 101, 103, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 117, 114, 97, 99, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 111, 117, 114, 99, 101, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 99, 72, 115, 92, 242, 121, 255, 211, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 78, 69, 68, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 114, 116, 105, 99, 97, 108, + 65, 99, 99, 117, 114, 97, 99, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 101, 97, 114, 105, 110, 103, 65, + 99, 99, 117, 114, 97, 99, 121, 68, + 101, 103, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 65, 99, 99, + 117, 114, 97, 99, 121, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e946524859add50e = b_e946524859add50e.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_e946524859add50e[] = { + &s_d3ff79f25c734863, +}; +static const uint16_t m_e946524859add50e[] = {6, 3, 11, 5, 0, 1, 2, 8, 4, 12, 7, 9, 10}; +static const uint16_t i_e946524859add50e[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; +const ::capnp::_::RawSchema s_e946524859add50e = { + 0xe946524859add50e, b_e946524859add50e.words, 232, d_e946524859add50e, m_e946524859add50e, + 1, 13, i_e946524859add50e, nullptr, nullptr, { &s_e946524859add50e, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<53> b_d3ff79f25c734863 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 99, 72, 115, 92, 242, 121, 255, 211, + 26, 0, 0, 0, 2, 0, 0, 0, + 14, 213, 173, 89, 72, 82, 70, 233, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 58, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 199, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 71, 112, 115, 76, 111, 99, + 97, 116, 105, 111, 110, 68, 97, 116, + 97, 46, 83, 101, 110, 115, 111, 114, + 83, 111, 117, 114, 99, 101, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 32, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 81, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 100, 114, 111, 105, 100, 0, + 105, 79, 83, 0, 0, 0, 0, 0, + 99, 97, 114, 0, 0, 0, 0, 0, + 118, 101, 108, 111, 100, 121, 110, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 117, 115, 105, 111, 110, 0, 0, + 101, 120, 116, 101, 114, 110, 97, 108, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 98, 108, 111, 120, 0, 0, 0, + 116, 114, 105, 109, 98, 108, 101, 0, } +}; +::capnp::word const* const bp_d3ff79f25c734863 = b_d3ff79f25c734863.words; +#if !CAPNP_LITE +static const uint16_t m_d3ff79f25c734863[] = {0, 2, 5, 4, 1, 7, 6, 3}; +const ::capnp::_::RawSchema s_d3ff79f25c734863 = { + 0xd3ff79f25c734863, b_d3ff79f25c734863.words, 53, nullptr, m_d3ff79f25c734863, + 0, 8, nullptr, nullptr, nullptr, { &s_d3ff79f25c734863, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(SensorSource_d3ff79f25c734863, d3ff79f25c734863); +static const ::capnp::_::AlignedData<77> b_8785009a964c7c59 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 89, 124, 76, 150, 154, 0, 133, 135, + 10, 0, 0, 0, 1, 0, 1, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 146, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 110, 68, 97, 116, + 97, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 3, 0, 1, 0, + 104, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 3, 0, 1, 0, + 108, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 0, 0, 0, 3, 0, 1, 0, + 112, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 0, 0, 0, 3, 0, 1, 0, + 116, 0, 0, 0, 2, 0, 1, 0, + 97, 100, 100, 114, 101, 115, 115, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 117, 115, 84, 105, 109, 101, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 97, 116, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 114, 99, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_8785009a964c7c59 = b_8785009a964c7c59.words; +#if !CAPNP_LITE +static const uint16_t m_8785009a964c7c59[] = {0, 1, 2, 3}; +static const uint16_t i_8785009a964c7c59[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_8785009a964c7c59 = { + 0x8785009a964c7c59, b_8785009a964c7c59.words, 77, nullptr, m_8785009a964c7c59, + 0, 4, i_8785009a964c7c59, nullptr, nullptr, { &s_8785009a964c7c59, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<734> b_a4d8b5af2aa492eb = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 235, 146, 164, 42, 175, 181, 216, 164, + 10, 0, 0, 0, 1, 0, 11, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 9, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 178, 0, 0, 0, + 29, 0, 0, 0, 87, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 255, 8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 68, 101, 118, 105, 99, 101, + 83, 116, 97, 116, 101, 0, 0, 0, + 20, 0, 0, 0, 1, 0, 1, 0, + 111, 246, 61, 133, 41, 0, 121, 208, + 33, 0, 0, 0, 98, 0, 0, 0, + 126, 247, 84, 194, 16, 113, 15, 175, + 33, 0, 0, 0, 114, 0, 0, 0, + 157, 4, 209, 88, 201, 156, 199, 187, + 33, 0, 0, 0, 98, 0, 0, 0, + 19, 62, 32, 19, 138, 140, 48, 221, + 33, 0, 0, 0, 130, 0, 0, 0, + 252, 74, 192, 130, 45, 83, 87, 157, + 33, 0, 0, 0, 98, 0, 0, 0, + 84, 104, 101, 114, 109, 97, 108, 90, + 111, 110, 101, 0, 0, 0, 0, 0, + 84, 104, 101, 114, 109, 97, 108, 83, + 116, 97, 116, 117, 115, 0, 0, 0, + 78, 101, 116, 119, 111, 114, 107, 84, + 121, 112, 101, 0, 0, 0, 0, 0, + 78, 101, 116, 119, 111, 114, 107, 83, + 116, 114, 101, 110, 103, 116, 104, 0, + 78, 101, 116, 119, 111, 114, 107, 73, + 110, 102, 111, 0, 0, 0, 0, 0, + 164, 0, 0, 0, 3, 0, 4, 0, + 29, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 4, 0, 0, 3, 0, 1, 0, + 120, 4, 0, 0, 2, 0, 1, 0, + 30, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 4, 0, 0, 3, 0, 1, 0, + 128, 4, 0, 0, 2, 0, 1, 0, + 31, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 4, 0, 0, 3, 0, 1, 0, + 136, 4, 0, 0, 2, 0, 1, 0, + 32, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 4, 0, 0, 3, 0, 1, 0, + 144, 4, 0, 0, 2, 0, 1, 0, + 33, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 4, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 4, 0, 0, 3, 0, 1, 0, + 152, 4, 0, 0, 2, 0, 1, 0, + 34, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 4, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 4, 0, 0, 3, 0, 1, 0, + 160, 4, 0, 0, 2, 0, 1, 0, + 35, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 4, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 4, 0, 0, 3, 0, 1, 0, + 168, 4, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 4, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 4, 0, 0, 3, 0, 1, 0, + 180, 4, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 4, 0, 0, 3, 0, 1, 0, + 188, 4, 0, 0, 2, 0, 1, 0, + 38, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 4, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 4, 0, 0, 3, 0, 1, 0, + 200, 4, 0, 0, 2, 0, 1, 0, + 27, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 4, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 4, 0, 0, 3, 0, 1, 0, + 212, 4, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 192, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 4, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 4, 0, 0, 3, 0, 1, 0, + 216, 4, 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 193, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 4, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 4, 0, 0, 3, 0, 1, 0, + 224, 4, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 4, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 4, 0, 0, 3, 0, 1, 0, + 232, 4, 0, 0, 2, 0, 1, 0, + 26, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 4, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 4, 0, 0, 3, 0, 1, 0, + 240, 4, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 4, 0, 0, 3, 0, 1, 0, + 248, 4, 0, 0, 2, 0, 1, 0, + 39, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 4, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 4, 0, 0, 3, 0, 1, 0, + 8, 5, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 194, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 5, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 5, 0, 0, 3, 0, 1, 0, + 16, 5, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 195, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 5, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 5, 0, 0, 3, 0, 1, 0, + 28, 5, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 25, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 5, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 5, 0, 0, 3, 0, 1, 0, + 40, 5, 0, 0, 2, 0, 1, 0, + 37, 0, 0, 0, 44, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 5, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 5, 0, 0, 3, 0, 1, 0, + 56, 5, 0, 0, 2, 0, 1, 0, + 36, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 5, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 5, 0, 0, 3, 0, 1, 0, + 64, 5, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 24, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 5, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 5, 0, 0, 3, 0, 1, 0, + 72, 5, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 5, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 5, 0, 0, 3, 0, 1, 0, + 84, 5, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 25, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 5, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 5, 0, 0, 3, 0, 1, 0, + 92, 5, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 5, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 5, 0, 0, 3, 0, 1, 0, + 104, 5, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 5, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 5, 0, 0, 3, 0, 1, 0, + 128, 5, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 5, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 5, 0, 0, 3, 0, 1, 0, + 152, 5, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 5, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 5, 0, 0, 3, 0, 1, 0, + 160, 5, 0, 0, 2, 0, 1, 0, + 40, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 5, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 5, 0, 0, 3, 0, 1, 0, + 172, 5, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 30, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 5, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 5, 0, 0, 3, 0, 1, 0, + 180, 5, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 5, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 5, 0, 0, 3, 0, 1, 0, + 188, 5, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 5, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 5, 0, 0, 3, 0, 1, 0, + 200, 5, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 45, 0, 0, 0, + 0, 0, 1, 0, 33, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 5, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 5, 0, 0, 3, 0, 1, 0, + 208, 5, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 5, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 5, 0, 0, 3, 0, 1, 0, + 232, 5, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 5, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 5, 0, 0, 3, 0, 1, 0, + 0, 6, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 5, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 5, 0, 0, 3, 0, 1, 0, + 24, 6, 0, 0, 2, 0, 1, 0, + 28, 0, 0, 0, 80, 0, 0, 0, + 0, 0, 1, 0, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 6, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 6, 0, 0, 3, 0, 1, 0, + 36, 6, 0, 0, 2, 0, 1, 0, + 25, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 38, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 6, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 6, 0, 0, 3, 0, 1, 0, + 60, 6, 0, 0, 2, 0, 1, 0, + 24, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 6, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 6, 0, 0, 3, 0, 1, 0, + 84, 6, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 21, 0, 0, 0, + 0, 0, 1, 0, 40, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 6, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 6, 0, 0, 3, 0, 1, 0, + 92, 6, 0, 0, 2, 0, 1, 0, + 99, 112, 117, 48, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 112, 117, 49, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 112, 117, 50, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 112, 117, 51, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 109, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 117, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 97, 116, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 101, 101, 83, 112, 97, 99, + 101, 80, 101, 114, 99, 101, 110, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 97, 116, 116, 101, 114, 121, 80, + 101, 114, 99, 101, 110, 116, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 97, 116, 116, 101, 114, 121, 83, + 116, 97, 116, 117, 115, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 97, 110, 83, 112, 101, 101, 100, + 80, 101, 114, 99, 101, 110, 116, 68, + 101, 115, 105, 114, 101, 100, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 114, 116, 101, 100, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 115, 98, 79, 110, 108, 105, 110, + 101, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 114, 116, 101, 100, 77, + 111, 110, 111, 84, 105, 109, 101, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 104, 101, 114, 109, 97, 108, 83, + 116, 97, 116, 117, 115, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 126, 247, 84, 194, 16, 113, 15, 175, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 97, 116, 116, 101, 114, 121, 67, + 117, 114, 114, 101, 110, 116, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 97, 116, 116, 101, 114, 121, 86, + 111, 108, 116, 97, 103, 101, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 104, 97, 114, 103, 105, 110, 103, + 69, 114, 114, 111, 114, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 104, 97, 114, 103, 105, 110, 103, + 68, 105, 115, 97, 98, 108, 101, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 109, 111, 114, 121, 85, 115, + 97, 103, 101, 80, 101, 114, 99, 101, + 110, 116, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 112, 117, 85, 115, 97, 103, 101, + 80, 101, 114, 99, 101, 110, 116, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 48, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 101, 116, 119, 111, 114, 107, 84, + 121, 112, 101, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 157, 4, 209, 88, 201, 156, 199, 187, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 102, 102, 114, 111, 97, 100, 80, + 111, 119, 101, 114, 85, 115, 97, 103, + 101, 85, 119, 104, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 101, 116, 119, 111, 114, 107, 83, + 116, 114, 101, 110, 103, 116, 104, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 19, 62, 32, 19, 138, 140, 48, 221, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 66, 97, 116, 116, 101, + 114, 121, 67, 97, 112, 97, 99, 105, + 116, 121, 85, 119, 104, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 112, 117, 84, 101, 109, 112, 67, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 117, 84, 101, 109, 112, 67, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 109, 111, 114, 121, 84, 101, + 109, 112, 67, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 97, 116, 116, 101, 114, 121, 84, + 101, 109, 112, 67, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 109, 98, 105, 101, 110, 116, 84, + 101, 109, 112, 67, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 101, 116, 119, 111, 114, 107, 73, + 110, 102, 111, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 252, 74, 192, 130, 45, 83, 87, 157, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 115, 116, 65, 116, 104, 101, + 110, 97, 80, 105, 110, 103, 84, 105, + 109, 101, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 117, 85, 115, 97, 103, 101, + 80, 101, 114, 99, 101, 110, 116, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 112, 117, 85, 115, 97, 103, 101, + 80, 101, 114, 99, 101, 110, 116, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 118, 109, 101, 84, 101, 109, 112, + 67, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 100, 101, 109, 84, 101, 109, + 112, 67, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 99, 114, 101, 101, 110, 66, 114, + 105, 103, 104, 116, 110, 101, 115, 115, + 80, 101, 114, 99, 101, 110, 116, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 104, 101, 114, 109, 97, 108, 90, + 111, 110, 101, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 111, 246, 61, 133, 41, 0, 121, 208, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 109, 105, 99, 84, 101, 109, 112, + 67, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 119, 101, 114, 68, 114, 97, + 119, 87, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a4d8b5af2aa492eb = b_a4d8b5af2aa492eb.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_a4d8b5af2aa492eb[] = { + &s_9d57532d82c04afc, + &s_af0f7110c254f77e, + &s_bbc79cc958d1049d, + &s_d0790029853df66f, + &s_dd308c8a13203e13, +}; +static const uint16_t m_a4d8b5af2aa492eb[] = {30, 6, 15, 8, 9, 29, 16, 25, 18, 17, 0, 1, 2, 3, 26, 34, 20, 10, 7, 5, 27, 33, 32, 4, 28, 19, 36, 31, 24, 22, 35, 23, 21, 39, 40, 37, 11, 13, 14, 38, 12}; +static const uint16_t i_a4d8b5af2aa492eb[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40}; +const ::capnp::_::RawSchema s_a4d8b5af2aa492eb = { + 0xa4d8b5af2aa492eb, b_a4d8b5af2aa492eb.words, 734, d_a4d8b5af2aa492eb, m_a4d8b5af2aa492eb, + 5, 41, i_a4d8b5af2aa492eb, nullptr, nullptr, { &s_a4d8b5af2aa492eb, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<49> b_d0790029853df66f = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 111, 246, 61, 133, 41, 0, 121, 208, + 22, 0, 0, 0, 1, 0, 1, 0, + 235, 146, 164, 42, 175, 181, 216, 164, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 18, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 68, 101, 118, 105, 99, 101, + 83, 116, 97, 116, 101, 46, 84, 104, + 101, 114, 109, 97, 108, 90, 111, 110, + 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 1, 0, + 48, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 110, 97, 109, 101, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 101, 109, 112, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d0790029853df66f = b_d0790029853df66f.words; +#if !CAPNP_LITE +static const uint16_t m_d0790029853df66f[] = {0, 1}; +static const uint16_t i_d0790029853df66f[] = {0, 1}; +const ::capnp::_::RawSchema s_d0790029853df66f = { + 0xd0790029853df66f, b_d0790029853df66f.words, 49, nullptr, m_d0790029853df66f, + 0, 2, i_d0790029853df66f, nullptr, nullptr, { &s_d0790029853df66f, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<35> b_af0f7110c254f77e = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 126, 247, 84, 194, 16, 113, 15, 175, + 22, 0, 0, 0, 2, 0, 0, 0, + 235, 146, 164, 42, 175, 181, 216, 164, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 34, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 103, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 68, 101, 118, 105, 99, 101, + 83, 116, 97, 116, 101, 46, 84, 104, + 101, 114, 109, 97, 108, 83, 116, 97, + 116, 117, 115, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 114, 101, 101, 110, 0, 0, 0, + 121, 101, 108, 108, 111, 119, 0, 0, + 114, 101, 100, 0, 0, 0, 0, 0, + 100, 97, 110, 103, 101, 114, 0, 0, } +}; +::capnp::word const* const bp_af0f7110c254f77e = b_af0f7110c254f77e.words; +#if !CAPNP_LITE +static const uint16_t m_af0f7110c254f77e[] = {3, 0, 2, 1}; +const ::capnp::_::RawSchema s_af0f7110c254f77e = { + 0xaf0f7110c254f77e, b_af0f7110c254f77e.words, 35, nullptr, m_af0f7110c254f77e, + 0, 4, nullptr, nullptr, nullptr, { &s_af0f7110c254f77e, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(ThermalStatus_af0f7110c254f77e, af0f7110c254f77e); +static const ::capnp::_::AlignedData<48> b_bbc79cc958d1049d = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 157, 4, 209, 88, 201, 156, 199, 187, + 22, 0, 0, 0, 2, 0, 0, 0, + 235, 146, 164, 42, 175, 181, 216, 164, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 18, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 68, 101, 118, 105, 99, 101, + 83, 116, 97, 116, 101, 46, 78, 101, + 116, 119, 111, 114, 107, 84, 121, 112, + 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 110, 101, 0, 0, 0, 0, + 119, 105, 102, 105, 0, 0, 0, 0, + 99, 101, 108, 108, 50, 71, 0, 0, + 99, 101, 108, 108, 51, 71, 0, 0, + 99, 101, 108, 108, 52, 71, 0, 0, + 99, 101, 108, 108, 53, 71, 0, 0, + 101, 116, 104, 101, 114, 110, 101, 116, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_bbc79cc958d1049d = b_bbc79cc958d1049d.words; +#if !CAPNP_LITE +static const uint16_t m_bbc79cc958d1049d[] = {2, 3, 4, 5, 6, 0, 1}; +const ::capnp::_::RawSchema s_bbc79cc958d1049d = { + 0xbbc79cc958d1049d, b_bbc79cc958d1049d.words, 48, nullptr, m_bbc79cc958d1049d, + 0, 7, nullptr, nullptr, nullptr, { &s_bbc79cc958d1049d, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(NetworkType_bbc79cc958d1049d, bbc79cc958d1049d); +static const ::capnp::_::AlignedData<40> b_dd308c8a13203e13 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 19, 62, 32, 19, 138, 140, 48, 221, + 22, 0, 0, 0, 2, 0, 0, 0, + 235, 146, 164, 42, 175, 181, 216, 164, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 50, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 127, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 68, 101, 118, 105, 99, 101, + 83, 116, 97, 116, 101, 46, 78, 101, + 116, 119, 111, 114, 107, 83, 116, 114, + 101, 110, 103, 116, 104, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 111, 119, 110, 0, + 112, 111, 111, 114, 0, 0, 0, 0, + 109, 111, 100, 101, 114, 97, 116, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 111, 111, 100, 0, 0, 0, 0, + 103, 114, 101, 97, 116, 0, 0, 0, } +}; +::capnp::word const* const bp_dd308c8a13203e13 = b_dd308c8a13203e13.words; +#if !CAPNP_LITE +static const uint16_t m_dd308c8a13203e13[] = {3, 4, 2, 1, 0}; +const ::capnp::_::RawSchema s_dd308c8a13203e13 = { + 0xdd308c8a13203e13, b_dd308c8a13203e13.words, 40, nullptr, m_dd308c8a13203e13, + 0, 5, nullptr, nullptr, nullptr, { &s_dd308c8a13203e13, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(NetworkStrength_dd308c8a13203e13, dd308c8a13203e13); +static const ::capnp::_::AlignedData<111> b_9d57532d82c04afc = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 252, 74, 192, 130, 45, 83, 87, 157, + 22, 0, 0, 0, 1, 0, 1, 0, + 235, 146, 164, 42, 175, 181, 216, 164, + 5, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 18, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 87, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 68, 101, 118, 105, 99, 101, + 83, 116, 97, 116, 101, 46, 78, 101, + 116, 119, 111, 114, 107, 73, 110, 102, + 111, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 24, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 3, 0, 1, 0, + 172, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 0, 0, 0, 3, 0, 1, 0, + 176, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 0, 0, 0, 3, 0, 1, 0, + 180, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 0, 0, 0, 3, 0, 1, 0, + 184, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 3, 0, 1, 0, + 188, 0, 0, 0, 2, 0, 1, 0, + 116, 101, 99, 104, 110, 111, 108, 111, + 103, 121, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 112, 101, 114, 97, 116, 111, 114, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 97, 110, 100, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 104, 97, 110, 110, 101, 108, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 120, 116, 114, 97, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 116, 101, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9d57532d82c04afc = b_9d57532d82c04afc.words; +#if !CAPNP_LITE +static const uint16_t m_9d57532d82c04afc[] = {2, 3, 4, 1, 5, 0}; +static const uint16_t i_9d57532d82c04afc[] = {0, 1, 2, 3, 4, 5}; +const ::capnp::_::RawSchema s_9d57532d82c04afc = { + 0x9d57532d82c04afc, b_9d57532d82c04afc.words, 111, nullptr, m_9d57532d82c04afc, + 0, 6, i_9d57532d82c04afc, nullptr, nullptr, { &s_9d57532d82c04afc, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<444> b_a7649e2575e4591e = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 30, 89, 228, 117, 37, 158, 100, 167, + 10, 0, 0, 0, 1, 0, 7, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 170, 0, 0, 0, + 29, 0, 0, 0, 71, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 0, 0, 0, 127, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 80, 97, 110, 100, 97, 83, + 116, 97, 116, 101, 0, 0, 0, 0, + 16, 0, 0, 0, 1, 0, 1, 0, + 187, 173, 201, 10, 139, 11, 253, 242, + 25, 0, 0, 0, 98, 0, 0, 0, + 152, 151, 36, 105, 127, 192, 85, 205, + 25, 0, 0, 0, 82, 0, 0, 0, + 81, 55, 91, 62, 249, 173, 88, 138, + 25, 0, 0, 0, 82, 0, 0, 0, + 191, 129, 192, 232, 209, 62, 154, 246, + 25, 0, 0, 0, 114, 0, 0, 0, + 70, 97, 117, 108, 116, 83, 116, 97, + 116, 117, 115, 0, 0, 0, 0, 0, + 70, 97, 117, 108, 116, 84, 121, 112, + 101, 0, 0, 0, 0, 0, 0, 0, + 80, 97, 110, 100, 97, 84, 121, 112, + 101, 0, 0, 0, 0, 0, 0, 0, + 72, 97, 114, 110, 101, 115, 115, 83, + 116, 97, 116, 117, 115, 0, 0, 0, + 100, 0, 0, 0, 3, 0, 4, 0, + 20, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 2, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 2, 0, 0, 3, 0, 1, 0, + 188, 2, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 2, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 2, 0, 0, 3, 0, 1, 0, + 200, 2, 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 64, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 2, 0, 0, 3, 0, 1, 0, + 208, 2, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 65, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 2, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 2, 0, 0, 3, 0, 1, 0, + 216, 2, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 2, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 2, 0, 0, 3, 0, 1, 0, + 228, 2, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 67, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 2, 0, 0, 2, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 2, 0, 0, 3, 0, 1, 0, + 244, 2, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 68, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 2, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 2, 0, 0, 3, 0, 1, 0, + 0, 3, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 2, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 2, 0, 0, 3, 0, 1, 0, + 8, 3, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 3, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 3, 0, 0, 3, 0, 1, 0, + 16, 3, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 3, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 3, 0, 0, 3, 0, 1, 0, + 24, 3, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 3, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 3, 0, 0, 3, 0, 1, 0, + 32, 3, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 3, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 3, 0, 0, 3, 0, 1, 0, + 44, 3, 0, 0, 2, 0, 1, 0, + 24, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 3, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 3, 0, 0, 3, 0, 1, 0, + 56, 3, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 69, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 3, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 3, 0, 0, 3, 0, 1, 0, + 64, 3, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 3, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 3, 0, 0, 3, 0, 1, 0, + 72, 3, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 3, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 3, 0, 0, 3, 0, 1, 0, + 80, 3, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 70, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 3, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 3, 0, 0, 3, 0, 1, 0, + 92, 3, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 3, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 3, 0, 0, 3, 0, 1, 0, + 96, 3, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 3, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 3, 0, 0, 3, 0, 1, 0, + 116, 3, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 3, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 3, 0, 0, 3, 0, 1, 0, + 124, 3, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 20, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 3, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 3, 0, 0, 3, 0, 1, 0, + 132, 3, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 21, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 3, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 3, 0, 0, 3, 0, 1, 0, + 140, 3, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 71, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 3, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 3, 0, 0, 3, 0, 1, 0, + 148, 3, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 22, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 3, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 3, 0, 0, 3, 0, 1, 0, + 156, 3, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 3, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 3, 0, 0, 3, 0, 1, 0, + 164, 3, 0, 0, 2, 0, 1, 0, + 118, 111, 108, 116, 97, 103, 101, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 114, 114, 101, 110, 116, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 103, 110, 105, 116, 105, 111, 110, + 76, 105, 110, 101, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 110, 116, 114, 111, 108, 115, + 65, 108, 108, 111, 119, 101, 100, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 115, 73, 110, 116, 101, 114, + 99, 101, 112, 116, 111, 114, 68, 101, + 116, 101, 99, 116, 101, 100, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 114, 116, 101, 100, 83, + 105, 103, 110, 97, 108, 68, 101, 116, + 101, 99, 116, 101, 100, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 71, 112, 115, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 83, 101, 110, 100, 69, + 114, 114, 115, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 70, 119, 100, 69, 114, + 114, 115, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 109, 108, 97, 110, 83, 101, 110, + 100, 69, 114, 114, 115, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 110, 100, 97, 84, 121, 112, + 101, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 81, 55, 91, 62, 249, 173, 88, 138, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 97, 110, 83, 112, 101, 101, 100, + 82, 112, 109, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 115, 98, 80, 111, 119, 101, 114, + 77, 111, 100, 101, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 119, 152, 44, 179, 131, 53, 136, 168, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 103, 110, 105, 116, 105, 111, 110, + 67, 97, 110, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 97, 102, 101, 116, 121, 77, 111, + 100, 101, 108, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 81, 244, 218, 30, 91, 30, 85, 149, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 97, 117, 108, 116, 83, 116, 97, + 116, 117, 115, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 187, 173, 201, 10, 139, 11, 253, 242, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 119, 101, 114, 83, 97, 118, + 101, 69, 110, 97, 98, 108, 101, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 112, 116, 105, 109, 101, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 97, 117, 108, 116, 115, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 152, 151, 36, 105, 127, 192, 85, 205, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 82, 120, 69, 114, 114, + 115, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 97, 102, 101, 116, 121, 80, 97, + 114, 97, 109, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 114, 110, 101, 115, 115, 83, + 116, 97, 116, 117, 115, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 191, 129, 192, 232, 209, 62, 154, 246, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 101, 97, 114, 116, 98, 101, 97, + 116, 76, 111, 115, 116, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 115, 97, 102, 101, 77, 111, + 100, 101, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 108, 111, 99, 107, 101, 100, 67, + 110, 116, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a7649e2575e4591e = b_a7649e2575e4591e.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_a7649e2575e4591e[] = { + &s_8a58adf93e5b3751, + &s_95551e5b1edaf451, + &s_a8883583b32c9877, + &s_cd55c07f69249798, + &s_f2fd0b8b0ac9adbb, + &s_f69a3ed1e8c081bf, +}; +static const uint16_t m_a7649e2575e4591e[] = {24, 8, 19, 7, 3, 1, 11, 15, 18, 4, 9, 21, 6, 22, 13, 2, 10, 16, 14, 20, 5, 23, 17, 12, 0}; +static const uint16_t i_a7649e2575e4591e[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}; +const ::capnp::_::RawSchema s_a7649e2575e4591e = { + 0xa7649e2575e4591e, b_a7649e2575e4591e.words, 444, d_a7649e2575e4591e, m_a7649e2575e4591e, + 6, 25, i_a7649e2575e4591e, nullptr, nullptr, { &s_a7649e2575e4591e, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<33> b_f2fd0b8b0ac9adbb = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 187, 173, 201, 10, 139, 11, 253, 242, + 21, 0, 0, 0, 2, 0, 0, 0, + 30, 89, 228, 117, 37, 158, 100, 167, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 10, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 79, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 80, 97, 110, 100, 97, 83, + 116, 97, 116, 101, 46, 70, 97, 117, + 108, 116, 83, 116, 97, 116, 117, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 110, 101, 0, 0, 0, 0, + 102, 97, 117, 108, 116, 84, 101, 109, + 112, 0, 0, 0, 0, 0, 0, 0, + 102, 97, 117, 108, 116, 80, 101, 114, + 109, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_f2fd0b8b0ac9adbb = b_f2fd0b8b0ac9adbb.words; +#if !CAPNP_LITE +static const uint16_t m_f2fd0b8b0ac9adbb[] = {2, 1, 0}; +const ::capnp::_::RawSchema s_f2fd0b8b0ac9adbb = { + 0xf2fd0b8b0ac9adbb, b_f2fd0b8b0ac9adbb.words, 33, nullptr, m_f2fd0b8b0ac9adbb, + 0, 3, nullptr, nullptr, nullptr, { &s_f2fd0b8b0ac9adbb, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(FaultStatus_f2fd0b8b0ac9adbb, f2fd0b8b0ac9adbb); +static const ::capnp::_::AlignedData<151> b_cd55c07f69249798 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 152, 151, 36, 105, 127, 192, 85, 205, + 21, 0, 0, 0, 2, 0, 0, 0, + 30, 89, 228, 117, 37, 158, 100, 167, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 23, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 80, 97, 110, 100, 97, 83, + 116, 97, 116, 101, 46, 70, 97, 117, + 108, 116, 84, 121, 112, 101, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 88, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 19, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 0, 0, 0, 0, + 5, 1, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 108, 97, 121, 77, 97, 108, + 102, 117, 110, 99, 116, 105, 111, 110, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 117, 115, 101, 100, 73, 110, + 116, 101, 114, 114, 117, 112, 116, 72, + 97, 110, 100, 108, 101, 100, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 67, 97, 110, + 49, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 67, 97, 110, + 50, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 67, 97, 110, + 51, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 84, 97, 99, + 104, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 71, 109, 108, + 97, 110, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 73, 110, 116, + 101, 114, 114, 117, 112, 116, 115, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 83, 112, 105, + 68, 109, 97, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 83, 112, 105, + 67, 115, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 85, 97, 114, + 116, 49, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 85, 97, 114, + 116, 50, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 85, 97, 114, + 116, 51, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 85, 97, 114, + 116, 53, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 85, 97, 114, + 116, 68, 109, 97, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 85, 115, 98, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 84, 105, 109, + 49, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 84, 105, 109, + 51, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 103, 105, 115, 116, 101, 114, + 68, 105, 118, 101, 114, 103, 101, 110, + 116, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 75, 108, 105, + 110, 101, 73, 110, 105, 116, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 67, 108, 111, + 99, 107, 83, 111, 117, 114, 99, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 116, 101, 114, 114, 117, 112, + 116, 82, 97, 116, 101, 84, 105, 99, + 107, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_cd55c07f69249798 = b_cd55c07f69249798.words; +#if !CAPNP_LITE +static const uint16_t m_cd55c07f69249798[] = {2, 3, 4, 20, 6, 7, 19, 9, 8, 5, 21, 16, 17, 10, 11, 12, 13, 14, 15, 18, 0, 1}; +const ::capnp::_::RawSchema s_cd55c07f69249798 = { + 0xcd55c07f69249798, b_cd55c07f69249798.words, 151, nullptr, m_cd55c07f69249798, + 0, 22, nullptr, nullptr, nullptr, { &s_cd55c07f69249798, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(FaultType_cd55c07f69249798, cd55c07f69249798); +static const ::capnp::_::AlignedData<54> b_8a58adf93e5b3751 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 81, 55, 91, 62, 249, 173, 88, 138, + 21, 0, 0, 0, 2, 0, 0, 0, + 30, 89, 228, 117, 37, 158, 100, 167, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 199, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 80, 97, 110, 100, 97, 83, + 116, 97, 116, 101, 46, 80, 97, 110, + 100, 97, 84, 121, 112, 101, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 32, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 81, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 107, 110, 111, 119, 110, 0, + 119, 104, 105, 116, 101, 80, 97, 110, + 100, 97, 0, 0, 0, 0, 0, 0, + 103, 114, 101, 121, 80, 97, 110, 100, + 97, 0, 0, 0, 0, 0, 0, 0, + 98, 108, 97, 99, 107, 80, 97, 110, + 100, 97, 0, 0, 0, 0, 0, 0, + 112, 101, 100, 97, 108, 0, 0, 0, + 117, 110, 111, 0, 0, 0, 0, 0, + 100, 111, 115, 0, 0, 0, 0, 0, + 114, 101, 100, 80, 97, 110, 100, 97, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_8a58adf93e5b3751 = b_8a58adf93e5b3751.words; +#if !CAPNP_LITE +static const uint16_t m_8a58adf93e5b3751[] = {3, 6, 2, 4, 7, 0, 5, 1}; +const ::capnp::_::RawSchema s_8a58adf93e5b3751 = { + 0x8a58adf93e5b3751, b_8a58adf93e5b3751.words, 54, nullptr, m_8a58adf93e5b3751, + 0, 8, nullptr, nullptr, nullptr, { &s_8a58adf93e5b3751, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(PandaType_8a58adf93e5b3751, 8a58adf93e5b3751); +static const ::capnp::_::AlignedData<32> b_f69a3ed1e8c081bf = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 191, 129, 192, 232, 209, 62, 154, 246, + 21, 0, 0, 0, 2, 0, 0, 0, + 30, 89, 228, 117, 37, 158, 100, 167, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 26, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 79, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 80, 97, 110, 100, 97, 83, + 116, 97, 116, 101, 46, 72, 97, 114, + 110, 101, 115, 115, 83, 116, 97, 116, + 117, 115, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 116, 67, 111, 110, 110, 101, + 99, 116, 101, 100, 0, 0, 0, 0, + 110, 111, 114, 109, 97, 108, 0, 0, + 102, 108, 105, 112, 112, 101, 100, 0, } +}; +::capnp::word const* const bp_f69a3ed1e8c081bf = b_f69a3ed1e8c081bf.words; +#if !CAPNP_LITE +static const uint16_t m_f69a3ed1e8c081bf[] = {2, 1, 0}; +const ::capnp::_::RawSchema s_f69a3ed1e8c081bf = { + 0xf69a3ed1e8c081bf, b_f69a3ed1e8c081bf.words, 32, nullptr, m_f69a3ed1e8c081bf, + 0, 3, nullptr, nullptr, nullptr, { &s_f69a3ed1e8c081bf, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(HarnessStatus_f69a3ed1e8c081bf, f69a3ed1e8c081bf); +static const ::capnp::_::AlignedData<100> b_ceb8f49734857a88 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 136, 122, 133, 52, 151, 244, 184, 206, + 10, 0, 0, 0, 1, 0, 2, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 210, 0, 0, 0, + 33, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 31, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 80, 101, 114, 105, 112, 104, + 101, 114, 97, 108, 83, 116, 97, 116, + 101, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 119, 152, 44, 179, 131, 53, 136, 168, + 1, 0, 0, 0, 106, 0, 0, 0, + 85, 115, 98, 80, 111, 119, 101, 114, + 77, 111, 100, 101, 0, 0, 0, 0, + 20, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 3, 0, 1, 0, + 136, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 3, 0, 1, 0, + 140, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 0, 0, 0, 3, 0, 1, 0, + 144, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 0, 0, 0, 3, 0, 1, 0, + 152, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 0, 0, 0, 3, 0, 1, 0, + 160, 0, 0, 0, 2, 0, 1, 0, + 112, 97, 110, 100, 97, 84, 121, 112, + 101, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 81, 55, 91, 62, 249, 173, 88, 138, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 111, 108, 116, 97, 103, 101, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 114, 114, 101, 110, 116, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 97, 110, 83, 112, 101, 101, 100, + 82, 112, 109, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 115, 98, 80, 111, 119, 101, 114, + 77, 111, 100, 101, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 119, 152, 44, 179, 131, 53, 136, 168, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_ceb8f49734857a88 = b_ceb8f49734857a88.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_ceb8f49734857a88[] = { + &s_8a58adf93e5b3751, + &s_a8883583b32c9877, +}; +static const uint16_t m_ceb8f49734857a88[] = {2, 3, 0, 4, 1}; +static const uint16_t i_ceb8f49734857a88[] = {0, 1, 2, 3, 4}; +const ::capnp::_::RawSchema s_ceb8f49734857a88 = { + 0xceb8f49734857a88, b_ceb8f49734857a88.words, 100, d_ceb8f49734857a88, m_ceb8f49734857a88, + 2, 5, i_ceb8f49734857a88, nullptr, nullptr, { &s_ceb8f49734857a88, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<35> b_a8883583b32c9877 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 119, 152, 44, 179, 131, 53, 136, 168, + 26, 0, 0, 0, 2, 0, 0, 0, + 136, 122, 133, 52, 151, 244, 184, 206, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 58, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 103, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 80, 101, 114, 105, 112, 104, + 101, 114, 97, 108, 83, 116, 97, 116, + 101, 46, 85, 115, 98, 80, 111, 119, + 101, 114, 77, 111, 100, 101, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 110, 101, 0, 0, 0, 0, + 99, 108, 105, 101, 110, 116, 0, 0, + 99, 100, 112, 0, 0, 0, 0, 0, + 100, 99, 112, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a8883583b32c9877 = b_a8883583b32c9877.words; +#if !CAPNP_LITE +static const uint16_t m_a8883583b32c9877[] = {2, 1, 3, 0}; +const ::capnp::_::RawSchema s_a8883583b32c9877 = { + 0xa8883583b32c9877, b_a8883583b32c9877.words, 35, nullptr, m_a8883583b32c9877, + 0, 4, nullptr, nullptr, nullptr, { &s_a8883583b32c9877, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(UsbPowerMode_a8883583b32c9877, a8883583b32c9877); +static const ::capnp::_::AlignedData<246> b_9a185389d6fdd05f = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 95, 208, 253, 214, 137, 83, 24, 154, + 10, 0, 0, 0, 1, 0, 5, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 5, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 170, 0, 0, 0, + 29, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 223, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 82, 97, 100, 97, 114, 83, + 116, 97, 116, 101, 0, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 133, 240, 12, 23, 217, 58, 111, 185, + 1, 0, 0, 0, 74, 0, 0, 0, + 76, 101, 97, 100, 68, 97, 116, 97, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 0, 0, 0, 3, 0, 4, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 1, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 1, 0, 0, 3, 0, 1, 0, + 124, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 1, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 1, 0, 0, 3, 0, 1, 0, + 136, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 1, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 1, 0, 0, 3, 0, 1, 0, + 148, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 1, 0, 0, 3, 0, 1, 0, + 152, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 1, 0, 0, 3, 0, 1, 0, + 156, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 1, 0, 0, 3, 0, 1, 0, + 164, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 1, 0, 0, 3, 0, 1, 0, + 172, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 1, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 1, 0, 0, 3, 0, 1, 0, + 184, 1, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 1, 0, 0, 3, 0, 1, 0, + 196, 1, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 1, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 1, 0, 0, 3, 0, 1, 0, + 208, 1, 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 1, 0, 0, 3, 0, 1, 0, + 232, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 1, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 1, 0, 0, 3, 0, 1, 0, + 244, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 1, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 1, 0, 0, 3, 0, 1, 0, + 12, 2, 0, 0, 2, 0, 1, 0, + 119, 97, 114, 112, 77, 97, 116, 114, + 105, 120, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 103, 108, 101, 79, 102, 102, + 115, 101, 116, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 108, 83, 116, 97, 116, 117, + 115, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 97, 100, 79, 110, 101, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 133, 240, 12, 23, 217, 58, 111, 185, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 97, 100, 84, 119, 111, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 133, 240, 12, 23, 217, 58, 111, 185, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 109, 76, 97, 103, 77, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 100, 77, 111, 110, 111, 84, 105, + 109, 101, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 116, 77, 111, 110, 111, 84, 105, + 109, 101, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 108, 67, 121, 99, 108, 101, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 108, 80, 101, 114, 99, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 77, 111, 110, 111, 84, + 105, 109, 101, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 83, 116, 97, 116, 101, + 77, 111, 110, 111, 84, 105, 109, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 100, 97, 114, 69, 114, 114, + 111, 114, 115, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 173, 118, 186, 235, 121, 102, 168, 232, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9a185389d6fdd05f = b_9a185389d6fdd05f.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_9a185389d6fdd05f[] = { + &s_b96f3ad9170cf085, + &s_e8a86679ebba76ad, +}; +static const uint16_t m_9a185389d6fdd05f[] = {1, 8, 9, 2, 10, 11, 5, 7, 3, 4, 6, 12, 0}; +static const uint16_t i_9a185389d6fdd05f[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; +const ::capnp::_::RawSchema s_9a185389d6fdd05f = { + 0x9a185389d6fdd05f, b_9a185389d6fdd05f.words, 246, d_9a185389d6fdd05f, m_9a185389d6fdd05f, + 2, 13, i_9a185389d6fdd05f, nullptr, nullptr, { &s_9a185389d6fdd05f, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<246> b_b96f3ad9170cf085 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 133, 240, 12, 23, 217, 58, 111, 185, + 21, 0, 0, 0, 1, 0, 7, 0, + 95, 208, 253, 214, 137, 83, 24, 154, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 242, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 79, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 82, 97, 100, 97, 114, 83, + 116, 97, 116, 101, 46, 76, 101, 97, + 100, 68, 97, 116, 97, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 60, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 1, 0, 0, 3, 0, 1, 0, + 156, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 1, 0, 0, 3, 0, 1, 0, + 160, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 1, 0, 0, 3, 0, 1, 0, + 164, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 1, 0, 0, 3, 0, 1, 0, + 168, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 1, 0, 0, 3, 0, 1, 0, + 172, 1, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 1, 0, 0, 3, 0, 1, 0, + 180, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 1, 0, 0, 3, 0, 1, 0, + 184, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 1, 0, 0, 3, 0, 1, 0, + 188, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 1, 0, 0, 3, 0, 1, 0, + 192, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 1, 0, 0, 3, 0, 1, 0, + 196, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 64, 1, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 1, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 1, 0, 0, 3, 0, 1, 0, + 200, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 65, 1, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 1, 0, 0, 3, 0, 1, 0, + 204, 1, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 1, 0, 0, 3, 0, 1, 0, + 212, 1, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 1, 0, 0, 3, 0, 1, 0, + 220, 1, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 66, 1, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 1, 0, 0, 3, 0, 1, 0, + 224, 1, 0, 0, 2, 0, 1, 0, + 100, 82, 101, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 82, 101, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 82, 101, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 82, 101, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 76, 101, 97, 100, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 76, 101, 97, 100, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 80, 97, 116, 104, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 76, 97, 116, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 76, 101, 97, 100, 75, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 76, 101, 97, 100, 75, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 99, 119, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 116, 117, 115, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 76, 101, 97, 100, 84, 97, 117, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 100, 101, 108, 80, 114, 111, + 98, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 100, 97, 114, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_b96f3ad9170cf085 = b_b96f3ad9170cf085.words; +#if !CAPNP_LITE +static const uint16_t m_b96f3ad9170cf085[] = {5, 9, 12, 3, 6, 0, 10, 13, 14, 11, 7, 4, 8, 2, 1}; +static const uint16_t i_b96f3ad9170cf085[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; +const ::capnp::_::RawSchema s_b96f3ad9170cf085 = { + 0xb96f3ad9170cf085, b_b96f3ad9170cf085.words, 246, nullptr, m_b96f3ad9170cf085, + 0, 15, i_b96f3ad9170cf085, nullptr, nullptr, { &s_b96f3ad9170cf085, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<204> b_96df70754d8390bc = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 188, 144, 131, 77, 117, 112, 223, 150, + 10, 0, 0, 0, 1, 0, 2, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 6, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 242, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 55, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 105, 118, 101, 67, 97, + 108, 105, 98, 114, 97, 116, 105, 111, + 110, 68, 97, 116, 97, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 40, 0, 0, 0, 3, 0, 4, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 1, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 1, 0, 0, 3, 0, 1, 0, + 40, 1, 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 1, 0, 0, 3, 0, 1, 0, + 48, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 1, 0, 0, 3, 0, 1, 0, + 56, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 1, 0, 0, 3, 0, 1, 0, + 60, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 1, 0, 0, 3, 0, 1, 0, + 84, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 1, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 1, 0, 0, 3, 0, 1, 0, + 112, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 1, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 1, 0, 0, 3, 0, 1, 0, + 140, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 1, 0, 0, 3, 0, 1, 0, + 164, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 1, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 1, 0, 0, 3, 0, 1, 0, + 188, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 1, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 1, 0, 0, 3, 0, 1, 0, + 196, 1, 0, 0, 2, 0, 1, 0, + 119, 97, 114, 112, 77, 97, 116, 114, + 105, 120, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 108, 83, 116, 97, 116, 117, + 115, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 108, 67, 121, 99, 108, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 108, 80, 101, 114, 99, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 120, 116, 114, 105, 110, 115, 105, + 99, 77, 97, 116, 114, 105, 120, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 119, 97, 114, 112, 77, 97, 116, 114, + 105, 120, 50, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 119, 97, 114, 112, 77, 97, 116, 114, + 105, 120, 66, 105, 103, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 112, 121, 67, 97, 108, 105, 98, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 112, 121, 67, 97, 108, 105, 98, + 83, 112, 114, 101, 97, 100, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 97, 108, 105, 100, 66, 108, 111, + 99, 107, 115, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_96df70754d8390bc = b_96df70754d8390bc.words; +#if !CAPNP_LITE +static const uint16_t m_96df70754d8390bc[] = {2, 3, 1, 4, 7, 8, 9, 5, 6, 0}; +static const uint16_t i_96df70754d8390bc[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; +const ::capnp::_::RawSchema s_96df70754d8390bc = { + 0x96df70754d8390bc, b_96df70754d8390bc.words, 204, nullptr, m_96df70754d8390bc, + 0, 10, i_96df70754d8390bc, nullptr, nullptr, { &s_96df70754d8390bc, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<171> b_8faa644732dec251 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 81, 194, 222, 50, 71, 100, 170, 143, + 10, 0, 0, 0, 1, 0, 5, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 170, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 55, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 105, 118, 101, 84, 114, + 97, 99, 107, 115, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 40, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 1, 0, 0, 3, 0, 1, 0, + 16, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 1, 0, 0, 3, 0, 1, 0, + 20, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 1, 0, 0, 3, 0, 1, 0, + 24, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 1, 0, 0, 3, 0, 1, 0, + 28, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 1, 0, 0, 3, 0, 1, 0, + 32, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 1, 0, 0, 3, 0, 1, 0, + 40, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 1, 0, 0, 3, 0, 1, 0, + 44, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 1, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 1, 0, 0, 3, 0, 1, 0, + 52, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 1, 0, 0, 3, 0, 1, 0, + 60, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 1, 1, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 1, 0, 0, 3, 0, 1, 0, + 68, 1, 0, 0, 2, 0, 1, 0, + 116, 114, 97, 99, 107, 73, 100, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 82, 101, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 82, 101, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 82, 101, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 82, 101, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 83, 116, 97, 109, + 112, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 116, 117, 115, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 114, 114, 101, 110, 116, 84, + 105, 109, 101, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 116, 105, 111, 110, 97, + 114, 121, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 110, 99, 111, 109, 105, 110, 103, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_8faa644732dec251 = b_8faa644732dec251.words; +#if !CAPNP_LITE +static const uint16_t m_8faa644732dec251[] = {4, 7, 1, 9, 8, 6, 5, 0, 3, 2}; +static const uint16_t i_8faa644732dec251[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; +const ::capnp::_::RawSchema s_8faa644732dec251 = { + 0x8faa644732dec251, b_8faa644732dec251.words, 171, nullptr, m_8faa644732dec251, + 0, 10, i_8faa644732dec251, nullptr, nullptr, { &s_8faa644732dec251, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<977> b_97ff69c53601abf1 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 241, 171, 1, 54, 197, 105, 255, 151, + 10, 0, 0, 0, 1, 0, 22, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 6, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 194, 0, 0, 0, + 29, 0, 0, 0, 135, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 0, 0, 0, 71, 12, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 67, 111, 110, 116, 114, 111, + 108, 115, 83, 116, 97, 116, 101, 0, + 32, 0, 0, 0, 1, 0, 1, 0, + 97, 172, 209, 210, 150, 139, 229, 219, + 57, 0, 0, 0, 122, 0, 0, 0, + 98, 60, 25, 19, 209, 220, 208, 160, + 57, 0, 0, 0, 98, 0, 0, 0, + 100, 95, 152, 110, 157, 185, 139, 233, + 57, 0, 0, 0, 82, 0, 0, 0, + 94, 55, 50, 134, 52, 99, 148, 147, + 57, 0, 0, 0, 138, 0, 0, 0, + 227, 117, 147, 224, 201, 93, 140, 242, + 61, 0, 0, 0, 130, 0, 0, 0, + 222, 42, 200, 144, 215, 226, 36, 144, + 61, 0, 0, 0, 130, 0, 0, 0, + 241, 128, 153, 172, 136, 234, 228, 162, + 61, 0, 0, 0, 146, 0, 0, 0, + 45, 155, 136, 242, 240, 70, 58, 166, + 65, 0, 0, 0, 146, 0, 0, 0, + 79, 112, 101, 110, 112, 105, 108, 111, + 116, 83, 116, 97, 116, 101, 0, 0, + 65, 108, 101, 114, 116, 83, 116, 97, + 116, 117, 115, 0, 0, 0, 0, 0, + 65, 108, 101, 114, 116, 83, 105, 122, + 101, 0, 0, 0, 0, 0, 0, 0, + 76, 97, 116, 101, 114, 97, 108, 73, + 78, 68, 73, 83, 116, 97, 116, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 97, 116, 101, 114, 97, 108, 80, + 73, 68, 83, 116, 97, 116, 101, 0, + 76, 97, 116, 101, 114, 97, 108, 76, + 81, 82, 83, 116, 97, 116, 101, 0, + 76, 97, 116, 101, 114, 97, 108, 65, + 110, 103, 108, 101, 83, 116, 97, 116, + 101, 0, 0, 0, 0, 0, 0, 0, + 76, 97, 116, 101, 114, 97, 108, 68, + 101, 98, 117, 103, 83, 116, 97, 116, + 101, 0, 0, 0, 0, 0, 0, 0, + 224, 0, 0, 0, 3, 0, 4, 0, + 28, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 6, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 6, 0, 0, 3, 0, 1, 0, + 28, 6, 0, 0, 2, 0, 1, 0, + 30, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 6, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 6, 0, 0, 3, 0, 1, 0, + 36, 6, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 6, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 6, 0, 0, 3, 0, 1, 0, + 40, 6, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 6, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 6, 0, 0, 3, 0, 1, 0, + 48, 6, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 6, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 6, 0, 0, 3, 0, 1, 0, + 56, 6, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 6, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 6, 0, 0, 3, 0, 1, 0, + 64, 6, 0, 0, 2, 0, 1, 0, + 34, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 6, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 6, 0, 0, 3, 0, 1, 0, + 76, 6, 0, 0, 2, 0, 1, 0, + 35, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 6, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 6, 0, 0, 3, 0, 1, 0, + 84, 6, 0, 0, 2, 0, 1, 0, + 36, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 6, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 6, 0, 0, 3, 0, 1, 0, + 96, 6, 0, 0, 2, 0, 1, 0, + 37, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 6, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 6, 0, 0, 3, 0, 1, 0, + 108, 6, 0, 0, 2, 0, 1, 0, + 39, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 6, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 6, 0, 0, 3, 0, 1, 0, + 120, 6, 0, 0, 2, 0, 1, 0, + 40, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 6, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 6, 0, 0, 3, 0, 1, 0, + 132, 6, 0, 0, 2, 0, 1, 0, + 53, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 6, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 6, 0, 0, 3, 0, 1, 0, + 144, 6, 0, 0, 2, 0, 1, 0, + 50, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 6, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 6, 0, 0, 3, 0, 1, 0, + 156, 6, 0, 0, 2, 0, 1, 0, + 43, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 6, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 6, 0, 0, 3, 0, 1, 0, + 168, 6, 0, 0, 2, 0, 1, 0, + 25, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 6, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 6, 0, 0, 3, 0, 1, 0, + 176, 6, 0, 0, 2, 0, 1, 0, + 31, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 6, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 6, 0, 0, 3, 0, 1, 0, + 188, 6, 0, 0, 2, 0, 1, 0, + 32, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 6, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 6, 0, 0, 3, 0, 1, 0, + 204, 6, 0, 0, 2, 0, 1, 0, + 33, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 6, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 6, 0, 0, 3, 0, 1, 0, + 216, 6, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 192, 2, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 6, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 6, 0, 0, 3, 0, 1, 0, + 220, 6, 0, 0, 2, 0, 1, 0, + 54, 0, 0, 0, 193, 2, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 6, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 6, 0, 0, 3, 0, 1, 0, + 232, 6, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 6, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 6, 0, 0, 3, 0, 1, 0, + 0, 7, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 6, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 6, 0, 0, 3, 0, 1, 0, + 4, 7, 0, 0, 2, 0, 1, 0, + 41, 0, 0, 0, 194, 2, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 7, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 7, 0, 0, 3, 0, 1, 0, + 16, 7, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 7, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 7, 0, 0, 3, 0, 1, 0, + 24, 7, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 7, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 7, 0, 0, 3, 0, 1, 0, + 32, 7, 0, 0, 2, 0, 1, 0, + 49, 0, 0, 0, 24, 0, 0, 0, + 0, 0, 1, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 7, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 7, 0, 0, 3, 0, 1, 0, + 48, 7, 0, 0, 2, 0, 1, 0, + 45, 0, 0, 0, 25, 0, 0, 0, + 0, 0, 1, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 7, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 7, 0, 0, 3, 0, 1, 0, + 64, 7, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 7, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 7, 0, 0, 3, 0, 1, 0, + 80, 7, 0, 0, 2, 0, 1, 0, + 55, 0, 0, 0, 28, 0, 0, 0, + 0, 0, 1, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 7, 0, 0, 18, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 7, 0, 0, 3, 0, 1, 0, + 100, 7, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 45, 0, 0, 0, + 0, 0, 1, 0, 30, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 7, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 7, 0, 0, 3, 0, 1, 0, + 112, 7, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 1, 0, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 7, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 7, 0, 0, 3, 0, 1, 0, + 116, 7, 0, 0, 2, 0, 1, 0, + 29, 0, 0, 0, 30, 0, 0, 0, + 0, 0, 1, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 7, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 7, 0, 0, 3, 0, 1, 0, + 128, 7, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 31, 0, 0, 0, + 0, 0, 1, 0, 33, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 7, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 7, 0, 0, 3, 0, 1, 0, + 136, 7, 0, 0, 2, 0, 1, 0, + 38, 0, 0, 0, 32, 0, 0, 0, + 0, 0, 1, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 7, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 7, 0, 0, 3, 0, 1, 0, + 148, 7, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 33, 0, 0, 0, + 0, 0, 1, 0, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 7, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 7, 0, 0, 3, 0, 1, 0, + 152, 7, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 195, 2, 0, 0, + 0, 0, 1, 0, 36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 7, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 7, 0, 0, 3, 0, 1, 0, + 156, 7, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 1, 0, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 7, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 7, 0, 0, 3, 0, 1, 0, + 164, 7, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 59, 0, 0, 0, + 0, 0, 1, 0, 38, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 7, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 7, 0, 0, 3, 0, 1, 0, + 172, 7, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 70, 0, 0, 0, + 0, 0, 1, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 7, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 7, 0, 0, 3, 0, 1, 0, + 180, 7, 0, 0, 2, 0, 1, 0, + 46, 0, 0, 0, 196, 2, 0, 0, + 0, 0, 1, 0, 40, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 7, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 7, 0, 0, 3, 0, 1, 0, + 196, 7, 0, 0, 2, 0, 1, 0, + 24, 0, 0, 0, 197, 2, 0, 0, + 0, 0, 1, 0, 41, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 7, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 7, 0, 0, 3, 0, 1, 0, + 204, 7, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 36, 0, 0, 0, + 0, 0, 1, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 7, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 7, 0, 0, 3, 0, 1, 0, + 216, 7, 0, 0, 2, 0, 1, 0, + 42, 0, 0, 0, 198, 2, 0, 0, + 0, 0, 1, 0, 43, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 7, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 7, 0, 0, 3, 0, 1, 0, + 232, 7, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 44, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 7, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 7, 0, 0, 3, 0, 1, 0, + 240, 7, 0, 0, 2, 0, 1, 0, + 44, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 45, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 7, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 7, 0, 0, 3, 0, 1, 0, + 252, 7, 0, 0, 2, 0, 1, 0, + 51, 0, 0, 0, 37, 0, 0, 0, + 0, 0, 1, 0, 46, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 7, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 7, 0, 0, 3, 0, 1, 0, + 8, 8, 0, 0, 2, 0, 1, 0, + 47, 0, 0, 0, 199, 2, 0, 0, + 0, 0, 1, 0, 47, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 8, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 0, 0, 3, 0, 1, 0, + 20, 8, 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 1, 0, 48, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 8, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 8, 0, 0, 3, 0, 1, 0, + 28, 8, 0, 0, 2, 0, 1, 0, + 52, 0, 0, 0, 200, 2, 0, 0, + 0, 0, 1, 0, 49, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 8, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 8, 0, 0, 3, 0, 1, 0, + 40, 8, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 20, 0, 0, 0, + 0, 0, 1, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 8, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 8, 0, 0, 3, 0, 1, 0, + 52, 8, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 201, 2, 0, 0, + 0, 0, 1, 0, 51, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 8, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 8, 0, 0, 3, 0, 1, 0, + 60, 8, 0, 0, 2, 0, 1, 0, + 27, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 149, 70, 68, 107, 77, 145, 91, 253, + 57, 8, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 0, 0, 0, 202, 2, 0, 0, + 0, 0, 1, 0, 54, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 8, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 8, 0, 0, 3, 0, 1, 0, + 56, 8, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 84, 0, 0, 0, + 0, 0, 1, 0, 56, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 8, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 8, 0, 0, 3, 0, 1, 0, + 64, 8, 0, 0, 2, 0, 1, 0, + 26, 0, 0, 0, 43, 0, 0, 0, + 0, 0, 1, 0, 57, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 8, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 8, 0, 0, 3, 0, 1, 0, + 72, 8, 0, 0, 2, 0, 1, 0, + 118, 69, 103, 111, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 69, 103, 111, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 80, 105, 100, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 84, 97, 114, 103, 101, 116, 76, + 101, 97, 100, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 112, 65, 99, 99, 101, 108, 67, + 109, 100, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 105, 65, 99, 99, 101, 108, 67, + 109, 100, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 65, 99, 116, 117, 97, 108, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 68, 101, 115, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 112, 83, 116, 101, 101, 114, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 105, 83, 116, 101, 101, 114, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 84, 97, 114, 103, 101, 116, 77, + 105, 110, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 84, 97, 114, 103, 101, 116, 77, + 97, 120, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 106, 101, 114, 107, 70, 97, 99, 116, + 111, 114, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 103, 108, 101, 83, 116, 101, + 101, 114, 115, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 117, 100, 76, 101, 97, 100, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 109, 76, 97, 103, 77, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 77, 111, 110, 111, 84, + 105, 109, 101, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 100, 97, 114, 83, 116, 97, + 116, 101, 77, 111, 110, 111, 84, 105, + 109, 101, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 100, 77, 111, 110, 111, 84, 105, + 109, 101, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 97, 98, 108, 101, 100, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 79, 118, 101, + 114, 114, 105, 100, 101, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 77, 111, 110, 111, 84, + 105, 109, 101, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 67, 114, 117, 105, 115, 101, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 97, 114, 86, 105, 101, 119, + 67, 97, 109, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 108, 101, 114, 116, 84, 101, 120, + 116, 49, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 108, 101, 114, 116, 84, 101, 120, + 116, 50, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 119, 97, 114, 101, 110, 101, 115, + 115, 83, 116, 97, 116, 117, 115, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 103, 108, 101, 77, 111, 100, + 101, 108, 66, 105, 97, 115, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 110, 103, 105, 116, 117, 100, + 105, 110, 97, 108, 80, 108, 97, 110, + 77, 111, 110, 111, 84, 105, 109, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 110, 103, 108, 101, 68, 101, 115, + 105, 114, 101, 100, 68, 101, 103, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 110, 103, 67, 111, 110, 116, + 114, 111, 108, 83, 116, 97, 116, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 130, 130, 144, 125, 145, 58, 15, 228, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 116, 101, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 97, 172, 209, 210, 150, 139, 229, 219, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 69, 103, 111, 82, 97, 119, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 102, 65, 99, 99, 101, 108, 67, + 109, 100, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 102, 83, 116, 101, 101, 114, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 84, 97, 114, 103, 101, 116, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 116, 105, 118, 101, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 114, 118, 97, 116, 117, 114, + 101, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 108, 101, 114, 116, 83, 116, 97, + 116, 117, 115, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 98, 60, 25, 19, 209, 220, 208, 160, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 108, 101, 114, 116, 83, 105, 122, + 101, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 100, 95, 152, 110, 157, 185, 139, 233, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 80, 108, 97, 110, 110, + 101, 114, 65, 99, 116, 105, 118, 101, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 103, 97, 103, 101, 97, 98, + 108, 101, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 108, 101, 114, 116, 66, 108, 105, + 110, 107, 105, 110, 103, 82, 97, 116, + 101, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 114, 105, 118, 101, 114, 77, 111, + 110, 105, 116, 111, 114, 105, 110, 103, + 79, 110, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 108, 101, 114, 116, 84, 121, 112, + 101, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 108, 101, 114, 116, 83, 111, 117, + 110, 100, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 67, 117, 114, 118, 97, 116, 117, + 114, 101, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 99, 101, 108, 70, 111, 114, + 84, 117, 114, 110, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 114, 116, 77, 111, 110, + 111, 84, 105, 109, 101, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 112, 86, 97, 108, 105, 100, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 116, 101, 114, 97, 108, 80, + 108, 97, 110, 77, 111, 110, 111, 84, + 105, 109, 101, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 111, 114, 99, 101, 68, 101, 99, + 101, 108, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 116, 101, 114, 97, 108, 67, + 111, 110, 116, 114, 111, 108, 83, 116, + 97, 116, 101, 0, 0, 0, 0, 0, + 100, 101, 99, 101, 108, 70, 111, 114, + 77, 111, 100, 101, 108, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 108, 101, 114, 116, 83, 111, 117, + 110, 100, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 158, 51, 78, 149, 108, 226, 165, 245, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 69, 114, 114, 111, 114, + 67, 111, 117, 110, 116, 101, 114, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_97ff69c53601abf1 = b_97ff69c53601abf1.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_97ff69c53601abf1[] = { + &s_a0d0dcd113193c62, + &s_dbe58b96d2d1ac61, + &s_e40f3a917d908282, + &s_e98bb99d6e985f64, + &s_f5a5e26c954e339e, + &s_fd5b914d6b444695, +}; +static const uint16_t m_97ff69c53601abf1[] = {1, 35, 11, 10, 36, 42, 39, 54, 45, 38, 24, 25, 44, 27, 13, 26, 55, 16, 21, 15, 37, 53, 47, 43, 19, 41, 51, 40, 14, 12, 52, 50, 30, 28, 49, 18, 17, 23, 48, 31, 20, 29, 33, 34, 5, 9, 4, 8, 22, 46, 0, 32, 2, 3, 6, 7}; +static const uint16_t i_97ff69c53601abf1[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55}; +const ::capnp::_::RawSchema s_97ff69c53601abf1 = { + 0x97ff69c53601abf1, b_97ff69c53601abf1.words, 977, d_97ff69c53601abf1, m_97ff69c53601abf1, + 6, 56, i_97ff69c53601abf1, nullptr, nullptr, { &s_97ff69c53601abf1, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<38> b_dbe58b96d2d1ac61 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 97, 172, 209, 210, 150, 139, 229, 219, + 24, 0, 0, 0, 2, 0, 0, 0, + 241, 171, 1, 54, 197, 105, 255, 151, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 58, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 103, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 67, 111, 110, 116, 114, 111, + 108, 115, 83, 116, 97, 116, 101, 46, + 79, 112, 101, 110, 112, 105, 108, 111, + 116, 83, 116, 97, 116, 101, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 115, 97, 98, 108, 101, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 101, 69, 110, 97, 98, 108, + 101, 100, 0, 0, 0, 0, 0, 0, + 101, 110, 97, 98, 108, 101, 100, 0, + 115, 111, 102, 116, 68, 105, 115, 97, + 98, 108, 105, 110, 103, 0, 0, 0, } +}; +::capnp::word const* const bp_dbe58b96d2d1ac61 = b_dbe58b96d2d1ac61.words; +#if !CAPNP_LITE +static const uint16_t m_dbe58b96d2d1ac61[] = {0, 2, 1, 3}; +const ::capnp::_::RawSchema s_dbe58b96d2d1ac61 = { + 0xdbe58b96d2d1ac61, b_dbe58b96d2d1ac61.words, 38, nullptr, m_dbe58b96d2d1ac61, + 0, 4, nullptr, nullptr, nullptr, { &s_dbe58b96d2d1ac61, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(OpenpilotState_dbe58b96d2d1ac61, dbe58b96d2d1ac61); +static const ::capnp::_::AlignedData<33> b_a0d0dcd113193c62 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 98, 60, 25, 19, 209, 220, 208, 160, + 24, 0, 0, 0, 2, 0, 0, 0, + 241, 171, 1, 54, 197, 105, 255, 151, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 34, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 79, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 67, 111, 110, 116, 114, 111, + 108, 115, 83, 116, 97, 116, 101, 46, + 65, 108, 101, 114, 116, 83, 116, 97, + 116, 117, 115, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 114, 109, 97, 108, 0, 0, + 117, 115, 101, 114, 80, 114, 111, 109, + 112, 116, 0, 0, 0, 0, 0, 0, + 99, 114, 105, 116, 105, 99, 97, 108, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a0d0dcd113193c62 = b_a0d0dcd113193c62.words; +#if !CAPNP_LITE +static const uint16_t m_a0d0dcd113193c62[] = {2, 0, 1}; +const ::capnp::_::RawSchema s_a0d0dcd113193c62 = { + 0xa0d0dcd113193c62, b_a0d0dcd113193c62.words, 33, nullptr, m_a0d0dcd113193c62, + 0, 3, nullptr, nullptr, nullptr, { &s_a0d0dcd113193c62, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(AlertStatus_a0d0dcd113193c62, a0d0dcd113193c62); +static const ::capnp::_::AlignedData<35> b_e98bb99d6e985f64 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 100, 95, 152, 110, 157, 185, 139, 233, + 24, 0, 0, 0, 2, 0, 0, 0, + 241, 171, 1, 54, 197, 105, 255, 151, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 18, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 103, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 67, 111, 110, 116, 114, 111, + 108, 115, 83, 116, 97, 116, 101, 46, + 65, 108, 101, 114, 116, 83, 105, 122, + 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 110, 101, 0, 0, 0, 0, + 115, 109, 97, 108, 108, 0, 0, 0, + 109, 105, 100, 0, 0, 0, 0, 0, + 102, 117, 108, 108, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e98bb99d6e985f64 = b_e98bb99d6e985f64.words; +#if !CAPNP_LITE +static const uint16_t m_e98bb99d6e985f64[] = {3, 2, 0, 1}; +const ::capnp::_::RawSchema s_e98bb99d6e985f64 = { + 0xe98bb99d6e985f64, b_e98bb99d6e985f64.words, 35, nullptr, m_e98bb99d6e985f64, + 0, 4, nullptr, nullptr, nullptr, { &s_e98bb99d6e985f64, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(AlertSize_e98bb99d6e985f64, e98bb99d6e985f64); +static const ::capnp::_::AlignedData<229> b_939463348632375e = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 94, 55, 50, 134, 52, 99, 148, 147, + 24, 0, 0, 0, 1, 0, 6, 0, + 241, 171, 1, 54, 197, 105, 255, 151, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 74, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 223, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 67, 111, 110, 116, 114, 111, + 108, 115, 83, 116, 97, 116, 101, 46, + 76, 97, 116, 101, 114, 97, 108, 73, + 78, 68, 73, 83, 116, 97, 116, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 52, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 1, 0, 0, 3, 0, 1, 0, + 100, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 1, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 1, 0, 0, 3, 0, 1, 0, + 112, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 1, 0, 0, 3, 0, 1, 0, + 120, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 1, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 1, 0, 0, 3, 0, 1, 0, + 132, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 1, 0, 0, 3, 0, 1, 0, + 140, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 1, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 1, 0, 0, 3, 0, 1, 0, + 148, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 1, 0, 0, 3, 0, 1, 0, + 156, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 1, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 1, 0, 0, 3, 0, 1, 0, + 164, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 1, 0, 0, 3, 0, 1, 0, + 168, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 1, 0, 0, 3, 0, 1, 0, + 172, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 1, 0, 0, 3, 0, 1, 0, + 180, 1, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 1, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 1, 0, 0, 3, 0, 1, 0, + 192, 1, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 1, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 1, 0, 0, 3, 0, 1, 0, + 204, 1, 0, 0, 2, 0, 1, 0, + 97, 99, 116, 105, 118, 101, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 110, 103, 108, 101, 68, 101, 103, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 82, 97, 116, 101, 68, 101, 103, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 99, 99, 101, 108, 68, 101, 103, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 116, 101, 83, 101, 116, 80, + 111, 105, 110, 116, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 101, 108, 83, 101, 116, + 80, 111, 105, 110, 116, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 101, 108, 69, 114, 114, + 111, 114, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 108, 97, 121, 101, 100, 79, + 117, 116, 112, 117, 116, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 108, 116, 97, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 117, 116, 112, 117, 116, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 97, 116, 117, 114, 97, 116, 101, + 100, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 110, 103, 108, 101, 68, 101, 115, + 105, 114, 101, 100, 68, 101, 103, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 82, 97, 116, 101, 68, 101, 115, 105, + 114, 101, 100, 68, 101, 103, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_939463348632375e = b_939463348632375e.words; +#if !CAPNP_LITE +static const uint16_t m_939463348632375e[] = {6, 5, 0, 7, 8, 9, 4, 10, 3, 1, 11, 2, 12}; +static const uint16_t i_939463348632375e[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; +const ::capnp::_::RawSchema s_939463348632375e = { + 0x939463348632375e, b_939463348632375e.words, 229, nullptr, m_939463348632375e, + 0, 13, i_939463348632375e, nullptr, nullptr, { &s_939463348632375e, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<176> b_f28c5dc9e09375e3 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 227, 117, 147, 224, 201, 93, 140, 242, + 24, 0, 0, 0, 1, 0, 5, 0, + 241, 171, 1, 54, 197, 105, 255, 151, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 66, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 55, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 67, 111, 110, 116, 114, 111, + 108, 115, 83, 116, 97, 116, 101, 46, + 76, 97, 116, 101, 114, 97, 108, 80, + 73, 68, 83, 116, 97, 116, 101, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 40, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 1, 0, 0, 3, 0, 1, 0, + 16, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 1, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 1, 0, 0, 3, 0, 1, 0, + 28, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 1, 0, 0, 3, 0, 1, 0, + 36, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 1, 0, 0, 3, 0, 1, 0, + 44, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 1, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 1, 0, 0, 3, 0, 1, 0, + 48, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 1, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 1, 0, 0, 3, 0, 1, 0, + 52, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 1, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 1, 0, 0, 3, 0, 1, 0, + 56, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 1, 0, 0, 3, 0, 1, 0, + 60, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 1, 0, 0, 3, 0, 1, 0, + 68, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 1, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 1, 0, 0, 3, 0, 1, 0, + 80, 1, 0, 0, 2, 0, 1, 0, + 97, 99, 116, 105, 118, 101, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 110, 103, 108, 101, 68, 101, 103, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 82, 97, 116, 101, 68, 101, 103, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 103, 108, 101, 69, 114, 114, + 111, 114, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 117, 116, 112, 117, 116, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 97, 116, 117, 114, 97, 116, 101, + 100, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 110, 103, 108, 101, 68, 101, 115, + 105, 114, 101, 100, 68, 101, 103, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_f28c5dc9e09375e3 = b_f28c5dc9e09375e3.words; +#if !CAPNP_LITE +static const uint16_t m_f28c5dc9e09375e3[] = {0, 3, 6, 5, 7, 4, 8, 1, 9, 2}; +static const uint16_t i_f28c5dc9e09375e3[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; +const ::capnp::_::RawSchema s_f28c5dc9e09375e3 = { + 0xf28c5dc9e09375e3, b_f28c5dc9e09375e3.words, 176, nullptr, m_f28c5dc9e09375e3, + 0, 10, i_f28c5dc9e09375e3, nullptr, nullptr, { &s_f28c5dc9e09375e3, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<130> b_9024e2d790c82ade = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 222, 42, 200, 144, 215, 226, 36, 144, + 24, 0, 0, 0, 1, 0, 3, 0, + 241, 171, 1, 54, 197, 105, 255, 151, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 66, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 143, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 67, 111, 110, 116, 114, 111, + 108, 115, 83, 116, 97, 116, 101, 46, + 76, 97, 116, 101, 114, 97, 108, 76, + 81, 82, 83, 116, 97, 116, 101, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 3, 0, 1, 0, + 188, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 3, 0, 1, 0, + 200, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 0, 0, 0, 3, 0, 1, 0, + 204, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 0, 0, 0, 3, 0, 1, 0, + 208, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 216, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 0, 0, 0, 3, 0, 1, 0, + 224, 0, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 0, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 0, 0, 0, 3, 0, 1, 0, + 236, 0, 0, 0, 2, 0, 1, 0, + 97, 99, 116, 105, 118, 101, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 110, 103, 108, 101, 68, 101, 103, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 117, 116, 112, 117, 116, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 113, 114, 79, 117, 116, 112, 117, + 116, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 97, 116, 117, 114, 97, 116, 101, + 100, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 110, 103, 108, 101, 68, 101, 115, + 105, 114, 101, 100, 68, 101, 103, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_9024e2d790c82ade = b_9024e2d790c82ade.words; +#if !CAPNP_LITE +static const uint16_t m_9024e2d790c82ade[] = {0, 2, 4, 3, 5, 1, 6}; +static const uint16_t i_9024e2d790c82ade[] = {0, 1, 2, 3, 4, 5, 6}; +const ::capnp::_::RawSchema s_9024e2d790c82ade = { + 0x9024e2d790c82ade, b_9024e2d790c82ade.words, 130, nullptr, m_9024e2d790c82ade, + 0, 7, i_9024e2d790c82ade, nullptr, nullptr, { &s_9024e2d790c82ade, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<100> b_a2e4ea88ac9980f1 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 241, 128, 153, 172, 136, 234, 228, 162, + 24, 0, 0, 0, 1, 0, 2, 0, + 241, 171, 1, 54, 197, 105, 255, 151, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 82, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 31, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 67, 111, 110, 116, 114, 111, + 108, 115, 83, 116, 97, 116, 101, 46, + 76, 97, 116, 101, 114, 97, 108, 65, + 110, 103, 108, 101, 83, 116, 97, 116, + 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 0, 0, 0, 3, 0, 1, 0, + 132, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 0, 0, 0, 3, 0, 1, 0, + 144, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 0, 0, 0, 3, 0, 1, 0, + 148, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 0, 0, 0, 3, 0, 1, 0, + 156, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 0, 0, 0, 3, 0, 1, 0, + 168, 0, 0, 0, 2, 0, 1, 0, + 97, 99, 116, 105, 118, 101, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 110, 103, 108, 101, 68, 101, 103, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 117, 116, 112, 117, 116, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 97, 116, 117, 114, 97, 116, 101, + 100, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 110, 103, 108, 101, 68, 101, 115, + 105, 114, 101, 100, 68, 101, 103, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a2e4ea88ac9980f1 = b_a2e4ea88ac9980f1.words; +#if !CAPNP_LITE +static const uint16_t m_a2e4ea88ac9980f1[] = {0, 2, 3, 1, 4}; +static const uint16_t i_a2e4ea88ac9980f1[] = {0, 1, 2, 3, 4}; +const ::capnp::_::RawSchema s_a2e4ea88ac9980f1 = { + 0xa2e4ea88ac9980f1, b_a2e4ea88ac9980f1.words, 100, nullptr, m_a2e4ea88ac9980f1, + 0, 5, i_a2e4ea88ac9980f1, nullptr, nullptr, { &s_a2e4ea88ac9980f1, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<83> b_a63a46f0f2889b2d = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 45, 155, 136, 242, 240, 70, 58, 166, + 24, 0, 0, 0, 1, 0, 2, 0, + 241, 171, 1, 54, 197, 105, 255, 151, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 82, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 67, 111, 110, 116, 114, 111, + 108, 115, 83, 116, 97, 116, 101, 46, + 76, 97, 116, 101, 114, 97, 108, 68, + 101, 98, 117, 103, 83, 116, 97, 116, + 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 3, 0, 1, 0, + 104, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 0, 0, 0, 3, 0, 1, 0, + 116, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 0, 0, 0, 3, 0, 1, 0, + 120, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 0, 0, 0, 3, 0, 1, 0, + 128, 0, 0, 0, 2, 0, 1, 0, + 97, 99, 116, 105, 118, 101, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 110, 103, 108, 101, 68, 101, 103, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 117, 116, 112, 117, 116, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 97, 116, 117, 114, 97, 116, 101, + 100, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a63a46f0f2889b2d = b_a63a46f0f2889b2d.words; +#if !CAPNP_LITE +static const uint16_t m_a63a46f0f2889b2d[] = {0, 2, 3, 1}; +static const uint16_t i_a63a46f0f2889b2d[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_a63a46f0f2889b2d = { + 0xa63a46f0f2889b2d, b_a63a46f0f2889b2d.words, 83, nullptr, m_a63a46f0f2889b2d, + 0, 4, i_a63a46f0f2889b2d, nullptr, nullptr, { &s_a63a46f0f2889b2d, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<99> b_fd5b914d6b444695 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 149, 70, 68, 107, 77, 145, 91, 253, + 24, 0, 0, 0, 1, 0, 22, 0, + 241, 171, 1, 54, 197, 105, 255, 151, + 6, 0, 7, 0, 1, 0, 5, 0, + 71, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 98, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 31, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 67, 111, 110, 116, 114, 111, + 108, 115, 83, 116, 97, 116, 101, 46, + 108, 97, 116, 101, 114, 97, 108, 67, + 111, 110, 116, 114, 111, 108, 83, 116, + 97, 116, 101, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 255, 255, 5, 0, 0, 0, + 0, 0, 1, 0, 52, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 3, 0, 1, 0, + 136, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 254, 255, 5, 0, 0, 0, + 0, 0, 1, 0, 53, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 0, 0, 0, 3, 0, 1, 0, + 144, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 253, 255, 5, 0, 0, 0, + 0, 0, 1, 0, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 0, 0, 0, 3, 0, 1, 0, + 152, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 252, 255, 5, 0, 0, 0, + 0, 0, 1, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 0, 0, 0, 3, 0, 1, 0, + 160, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 251, 255, 5, 0, 0, 0, + 0, 0, 1, 0, 59, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 0, 0, 0, 3, 0, 1, 0, + 168, 0, 0, 0, 2, 0, 1, 0, + 105, 110, 100, 105, 83, 116, 97, 116, + 101, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 94, 55, 50, 134, 52, 99, 148, 147, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 105, 100, 83, 116, 97, 116, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 227, 117, 147, 224, 201, 93, 140, 242, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 113, 114, 83, 116, 97, 116, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 222, 42, 200, 144, 215, 226, 36, 144, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 103, 108, 101, 83, 116, 97, + 116, 101, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 241, 128, 153, 172, 136, 234, 228, 162, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 98, 117, 103, 83, 116, 97, + 116, 101, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 45, 155, 136, 242, 240, 70, 58, 166, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_fd5b914d6b444695 = b_fd5b914d6b444695.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_fd5b914d6b444695[] = { + &s_9024e2d790c82ade, + &s_939463348632375e, + &s_97ff69c53601abf1, + &s_a2e4ea88ac9980f1, + &s_a63a46f0f2889b2d, + &s_f28c5dc9e09375e3, +}; +static const uint16_t m_fd5b914d6b444695[] = {3, 4, 0, 2, 1}; +static const uint16_t i_fd5b914d6b444695[] = {0, 1, 2, 3, 4}; +const ::capnp::_::RawSchema s_fd5b914d6b444695 = { + 0xfd5b914d6b444695, b_fd5b914d6b444695.words, 99, d_fd5b914d6b444695, m_fd5b914d6b444695, + 6, 5, i_fd5b914d6b444695, nullptr, nullptr, { &s_fd5b914d6b444695, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<384> b_c4713f6b0d36abe9 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 233, 171, 54, 13, 107, 63, 113, 196, + 10, 0, 0, 0, 1, 0, 4, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 14, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 178, 0, 0, 0, + 29, 0, 0, 0, 87, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 103, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 77, 111, 100, 101, 108, 68, + 97, 116, 97, 86, 50, 0, 0, 0, + 20, 0, 0, 0, 1, 0, 1, 0, + 128, 174, 5, 213, 31, 174, 203, 195, + 33, 0, 0, 0, 74, 0, 0, 0, + 40, 175, 135, 33, 43, 237, 68, 164, + 33, 0, 0, 0, 90, 0, 0, 0, + 235, 127, 206, 208, 26, 136, 152, 214, + 33, 0, 0, 0, 90, 0, 0, 0, + 189, 250, 92, 180, 179, 106, 100, 209, + 33, 0, 0, 0, 74, 0, 0, 0, + 37, 141, 220, 188, 221, 165, 10, 134, + 33, 0, 0, 0, 170, 0, 0, 0, + 88, 89, 90, 84, 68, 97, 116, 97, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 101, 97, 100, 68, 97, 116, 97, + 86, 50, 0, 0, 0, 0, 0, 0, + 76, 101, 97, 100, 68, 97, 116, 97, + 86, 51, 0, 0, 0, 0, 0, 0, + 77, 101, 116, 97, 68, 97, 116, 97, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 105, 115, 101, 110, 103, 97, 103, + 101, 80, 114, 101, 100, 105, 99, 116, + 105, 111, 110, 115, 0, 0, 0, 0, + 80, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 2, 0, 0, 3, 0, 1, 0, + 40, 2, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 2, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 2, 0, 0, 3, 0, 1, 0, + 48, 2, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 2, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 2, 0, 0, 3, 0, 1, 0, + 56, 2, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 2, 0, 0, 3, 0, 1, 0, + 64, 2, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 2, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 2, 0, 0, 3, 0, 1, 0, + 72, 2, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 2, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 2, 0, 0, 3, 0, 1, 0, + 80, 2, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 2, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 2, 0, 0, 3, 0, 1, 0, + 88, 2, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 2, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 2, 0, 0, 3, 0, 1, 0, + 96, 2, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 2, 0, 0, 3, 0, 1, 0, + 120, 2, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 2, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 2, 0, 0, 3, 0, 1, 0, + 144, 2, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 2, 0, 0, 3, 0, 1, 0, + 168, 2, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 2, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 2, 0, 0, 3, 0, 1, 0, + 188, 2, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 2, 0, 0, 3, 0, 1, 0, + 192, 2, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 2, 0, 0, 3, 0, 1, 0, + 216, 2, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 2, 0, 0, 3, 0, 1, 0, + 240, 2, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 2, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 2, 0, 0, 3, 0, 1, 0, + 252, 2, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 2, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 2, 0, 0, 3, 0, 1, 0, + 4, 3, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 3, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 3, 0, 0, 3, 0, 1, 0, + 16, 3, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 3, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 3, 0, 0, 3, 0, 1, 0, + 36, 3, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 3, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 3, 0, 0, 3, 0, 1, 0, + 44, 3, 0, 0, 2, 0, 1, 0, + 102, 114, 97, 109, 101, 73, 100, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 97, 109, 101, 65, 103, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 97, 109, 101, 68, 114, 111, + 112, 80, 101, 114, 99, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 69, 111, 102, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 105, 116, 105, 111, 110, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 128, 174, 5, 213, 31, 174, 203, 195, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 114, 105, 101, 110, 116, 97, 116, + 105, 111, 110, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 128, 174, 5, 213, 31, 174, 203, 195, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 108, 111, 99, 105, 116, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 128, 174, 5, 213, 31, 174, 203, 195, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 114, 105, 101, 110, 116, 97, 116, + 105, 111, 110, 82, 97, 116, 101, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 128, 174, 5, 213, 31, 174, 203, 195, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 110, 101, 76, 105, 110, 101, + 115, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 128, 174, 5, 213, 31, 174, 203, 195, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 110, 101, 76, 105, 110, 101, + 80, 114, 111, 98, 115, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 97, 100, 69, 100, 103, 101, + 115, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 128, 174, 5, 213, 31, 174, 203, 195, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 97, 100, 115, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 40, 175, 135, 33, 43, 237, 68, 164, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 116, 97, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 189, 250, 92, 180, 179, 106, 100, 209, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 110, 101, 76, 105, 110, 101, + 83, 116, 100, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 97, 100, 69, 100, 103, 101, + 83, 116, 100, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 100, 101, 108, 69, 120, 101, + 99, 117, 116, 105, 111, 110, 84, 105, + 109, 101, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 119, 80, 114, 101, 100, 105, + 99, 116, 105, 111, 110, 115, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 117, 69, 120, 101, 99, 117, + 116, 105, 111, 110, 84, 105, 109, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 97, 100, 115, 86, 51, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 235, 127, 206, 208, 26, 136, 152, 214, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 101, 108, 101, 114, 97, + 116, 105, 111, 110, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 128, 174, 5, 213, 31, 174, 203, 195, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_c4713f6b0d36abe9 = b_c4713f6b0d36abe9.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_c4713f6b0d36abe9[] = { + &s_a444ed2b2187af28, + &s_c3cbae1fd505ae80, + &s_d1646ab3b45cfabd, + &s_d698881ad0ce7feb, +}; +static const uint16_t m_c4713f6b0d36abe9[] = {19, 1, 2, 0, 17, 9, 13, 8, 11, 18, 12, 15, 5, 7, 4, 16, 14, 10, 3, 6}; +static const uint16_t i_c4713f6b0d36abe9[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; +const ::capnp::_::RawSchema s_c4713f6b0d36abe9 = { + 0xc4713f6b0d36abe9, b_c4713f6b0d36abe9.words, 384, d_c4713f6b0d36abe9, m_c4713f6b0d36abe9, + 4, 20, i_c4713f6b0d36abe9, nullptr, nullptr, { &s_c4713f6b0d36abe9, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<151> b_c3cbae1fd505ae80 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 128, 174, 5, 213, 31, 174, 203, 195, + 22, 0, 0, 0, 1, 0, 0, 0, + 233, 171, 54, 13, 107, 63, 113, 196, + 7, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 143, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 77, 111, 100, 101, 108, 68, + 97, 116, 97, 86, 50, 46, 88, 89, + 90, 84, 68, 97, 116, 97, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 3, 0, 1, 0, + 204, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 0, 0, 0, 3, 0, 1, 0, + 224, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 0, 0, 0, 3, 0, 1, 0, + 244, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 0, 0, 0, 3, 0, 1, 0, + 8, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 3, 0, 1, 0, + 28, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 1, 0, 0, 3, 0, 1, 0, + 48, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 1, 0, 0, 3, 0, 1, 0, + 68, 1, 0, 0, 2, 0, 1, 0, + 120, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 122, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 83, 116, 100, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 83, 116, 100, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 122, 83, 116, 100, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_c3cbae1fd505ae80 = b_c3cbae1fd505ae80.words; +#if !CAPNP_LITE +static const uint16_t m_c3cbae1fd505ae80[] = {3, 0, 4, 1, 5, 2, 6}; +static const uint16_t i_c3cbae1fd505ae80[] = {0, 1, 2, 3, 4, 5, 6}; +const ::capnp::_::RawSchema s_c3cbae1fd505ae80 = { + 0xc3cbae1fd505ae80, b_c3cbae1fd505ae80.words, 151, nullptr, m_c3cbae1fd505ae80, + 0, 7, i_c3cbae1fd505ae80, nullptr, nullptr, { &s_c3cbae1fd505ae80, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<87> b_a444ed2b2187af28 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 40, 175, 135, 33, 43, 237, 68, 164, + 22, 0, 0, 0, 1, 0, 1, 0, + 233, 171, 54, 13, 107, 63, 113, 196, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 10, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 77, 111, 100, 101, 108, 68, + 97, 116, 97, 86, 50, 46, 76, 101, + 97, 100, 68, 97, 116, 97, 86, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 3, 0, 1, 0, + 104, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 3, 0, 1, 0, + 108, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 0, 0, 0, 3, 0, 1, 0, + 128, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 0, 0, 0, 3, 0, 1, 0, + 148, 0, 0, 0, 2, 0, 1, 0, + 112, 114, 111, 98, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 121, 118, 97, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 121, 118, 97, 83, 116, 100, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a444ed2b2187af28 = b_a444ed2b2187af28.words; +#if !CAPNP_LITE +static const uint16_t m_a444ed2b2187af28[] = {0, 1, 2, 3}; +static const uint16_t i_a444ed2b2187af28[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_a444ed2b2187af28 = { + 0xa444ed2b2187af28, b_a444ed2b2187af28.words, 87, nullptr, m_a444ed2b2187af28, + 0, 4, i_a444ed2b2187af28, nullptr, nullptr, { &s_a444ed2b2187af28, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<221> b_d698881ad0ce7feb = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 235, 127, 206, 208, 26, 136, 152, 214, + 22, 0, 0, 0, 1, 0, 1, 0, + 233, 171, 54, 13, 107, 63, 113, 196, + 9, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 10, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 111, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 77, 111, 100, 101, 108, 68, + 97, 116, 97, 86, 50, 46, 76, 101, + 97, 100, 68, 97, 116, 97, 86, 51, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 44, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 1, 0, 0, 3, 0, 1, 0, + 44, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 1, 0, 0, 3, 0, 1, 0, + 52, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 1, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 1, 0, 0, 3, 0, 1, 0, + 72, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 1, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 1, 0, 0, 3, 0, 1, 0, + 92, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 1, 0, 0, 3, 0, 1, 0, + 112, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 1, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 1, 0, 0, 3, 0, 1, 0, + 132, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 1, 0, 0, 3, 0, 1, 0, + 152, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 1, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 1, 0, 0, 3, 0, 1, 0, + 172, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 1, 0, 0, 3, 0, 1, 0, + 192, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 1, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 1, 0, 0, 3, 0, 1, 0, + 212, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 1, 0, 0, 3, 0, 1, 0, + 232, 1, 0, 0, 2, 0, 1, 0, + 112, 114, 111, 98, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 111, 98, 84, 105, 109, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 83, 116, 100, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 83, 116, 100, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 83, 116, 100, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 83, 116, 100, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d698881ad0ce7feb = b_d698881ad0ce7feb.words; +#if !CAPNP_LITE +static const uint16_t m_d698881ad0ce7feb[] = {9, 10, 0, 1, 2, 7, 8, 3, 4, 5, 6}; +static const uint16_t i_d698881ad0ce7feb[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; +const ::capnp::_::RawSchema s_d698881ad0ce7feb = { + 0xd698881ad0ce7feb, b_d698881ad0ce7feb.words, 221, nullptr, m_d698881ad0ce7feb, + 0, 11, i_d698881ad0ce7feb, nullptr, nullptr, { &s_d698881ad0ce7feb, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<163> b_d1646ab3b45cfabd = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 189, 250, 92, 180, 179, 106, 100, 209, + 22, 0, 0, 0, 1, 0, 3, 0, + 233, 171, 54, 13, 107, 63, 113, 196, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 250, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 199, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 77, 111, 100, 101, 108, 68, + 97, 116, 97, 86, 50, 46, 77, 101, + 116, 97, 68, 97, 116, 97, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 32, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 0, 0, 0, 3, 0, 1, 0, + 220, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 0, 0, 0, 3, 0, 1, 0, + 248, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 0, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 0, 0, 0, 3, 0, 1, 0, + 8, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 1, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 1, 0, 0, 3, 0, 1, 0, + 24, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 1, 0, 0, 226, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 1, 0, 0, 3, 0, 1, 0, + 40, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 1, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 1, 0, 0, 3, 0, 1, 0, + 64, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 1, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 1, 0, 0, 3, 0, 1, 0, + 76, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 128, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 1, 0, 0, 3, 0, 1, 0, + 88, 1, 0, 0, 2, 0, 1, 0, + 101, 110, 103, 97, 103, 101, 100, 80, + 114, 111, 98, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 115, 105, 114, 101, 80, 114, + 101, 100, 105, 99, 116, 105, 111, 110, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 68, 105, 115, + 101, 110, 103, 97, 103, 101, 80, 114, + 111, 98, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 115, 68, 105, 115, 101, 110, + 103, 97, 103, 101, 80, 114, 111, 98, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 79, 118, 101, + 114, 114, 105, 100, 101, 80, 114, 111, + 98, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 115, 105, 114, 101, 83, 116, + 97, 116, 101, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 115, 101, 110, 103, 97, 103, + 101, 80, 114, 101, 100, 105, 99, 116, + 105, 111, 110, 115, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 37, 141, 220, 188, 221, 165, 10, 134, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 114, 100, 66, 114, 97, 107, + 101, 80, 114, 101, 100, 105, 99, 116, + 101, 100, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d1646ab3b45cfabd = b_d1646ab3b45cfabd.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_d1646ab3b45cfabd[] = { + &s_860aa5ddbcdc8d25, +}; +static const uint16_t m_d1646ab3b45cfabd[] = {2, 1, 5, 6, 0, 3, 7, 4}; +static const uint16_t i_d1646ab3b45cfabd[] = {0, 1, 2, 3, 4, 5, 6, 7}; +const ::capnp::_::RawSchema s_d1646ab3b45cfabd = { + 0xd1646ab3b45cfabd, b_d1646ab3b45cfabd.words, 163, d_d1646ab3b45cfabd, m_d1646ab3b45cfabd, + 1, 8, i_d1646ab3b45cfabd, nullptr, nullptr, { &s_d1646ab3b45cfabd, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<171> b_860aa5ddbcdc8d25 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 37, 141, 220, 188, 221, 165, 10, 134, + 22, 0, 0, 0, 1, 0, 0, 0, + 233, 171, 54, 13, 107, 63, 113, 196, + 7, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 90, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 143, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 77, 111, 100, 101, 108, 68, + 97, 116, 97, 86, 50, 46, 68, 105, + 115, 101, 110, 103, 97, 103, 101, 80, + 114, 101, 100, 105, 99, 116, 105, 111, + 110, 115, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 3, 0, 1, 0, + 204, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 0, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 232, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 0, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 0, 0, 0, 3, 0, 1, 0, + 4, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 1, 0, 0, 3, 0, 1, 0, + 32, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 1, 0, 0, 18, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 1, 0, 0, 3, 0, 1, 0, + 68, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 1, 0, 0, 18, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 1, 0, 0, 3, 0, 1, 0, + 104, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 1, 0, 0, 18, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 1, 0, 0, 3, 0, 1, 0, + 140, 1, 0, 0, 2, 0, 1, 0, + 116, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 68, 105, 115, + 101, 110, 103, 97, 103, 101, 80, 114, + 111, 98, 115, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 97, 115, 68, 105, 115, 101, 110, + 103, 97, 103, 101, 80, 114, 111, 98, + 115, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 79, 118, 101, + 114, 114, 105, 100, 101, 80, 114, 111, + 98, 115, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 51, 77, 101, + 116, 101, 114, 115, 80, 101, 114, 83, + 101, 99, 111, 110, 100, 83, 113, 117, + 97, 114, 101, 100, 80, 114, 111, 98, + 115, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 52, 77, 101, + 116, 101, 114, 115, 80, 101, 114, 83, + 101, 99, 111, 110, 100, 83, 113, 117, + 97, 114, 101, 100, 80, 114, 111, 98, + 115, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 114, 97, 107, 101, 53, 77, 101, + 116, 101, 114, 115, 80, 101, 114, 83, + 101, 99, 111, 110, 100, 83, 113, 117, + 97, 114, 101, 100, 80, 114, 111, 98, + 115, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_860aa5ddbcdc8d25 = b_860aa5ddbcdc8d25.words; +#if !CAPNP_LITE +static const uint16_t m_860aa5ddbcdc8d25[] = {4, 5, 6, 1, 2, 3, 0}; +static const uint16_t i_860aa5ddbcdc8d25[] = {0, 1, 2, 3, 4, 5, 6}; +const ::capnp::_::RawSchema s_860aa5ddbcdc8d25 = { + 0x860aa5ddbcdc8d25, b_860aa5ddbcdc8d25.words, 171, nullptr, m_860aa5ddbcdc8d25, + 0, 7, i_860aa5ddbcdc8d25, nullptr, nullptr, { &s_860aa5ddbcdc8d25, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<146> b_89d394e3541735fc = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 252, 53, 23, 84, 227, 148, 211, 137, + 10, 0, 0, 0, 1, 0, 5, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 178, 0, 0, 0, + 29, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 199, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 69, 110, 99, 111, 100, 101, + 73, 110, 100, 101, 120, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 211, 204, 87, 193, 158, 37, 173, 192, + 1, 0, 0, 0, 42, 0, 0, 0, + 84, 121, 112, 101, 0, 0, 0, 0, + 32, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 216, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 0, 0, 0, 3, 0, 1, 0, + 220, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 0, 0, 0, 3, 0, 1, 0, + 228, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 0, 0, 0, 3, 0, 1, 0, + 236, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 0, 0, 0, 3, 0, 1, 0, + 244, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 0, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 0, 0, 0, 3, 0, 1, 0, + 252, 0, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 0, 0, 0, 3, 0, 1, 0, + 4, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 3, 0, 1, 0, + 12, 1, 0, 0, 2, 0, 1, 0, + 102, 114, 97, 109, 101, 73, 100, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 121, 112, 101, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 211, 204, 87, 193, 158, 37, 173, 192, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 99, 111, 100, 101, 73, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 103, 109, 101, 110, 116, 78, + 117, 109, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 103, 109, 101, 110, 116, 73, + 100, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 103, 109, 101, 110, 116, 73, + 100, 69, 110, 99, 111, 100, 101, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 83, 111, 102, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 69, 111, 102, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_89d394e3541735fc = b_89d394e3541735fc.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_89d394e3541735fc[] = { + &s_c0ad259ec157ccd3, +}; +static const uint16_t m_89d394e3541735fc[] = {2, 0, 4, 5, 3, 7, 6, 1}; +static const uint16_t i_89d394e3541735fc[] = {0, 1, 2, 3, 4, 5, 6, 7}; +const ::capnp::_::RawSchema s_89d394e3541735fc = { + 0x89d394e3541735fc, b_89d394e3541735fc.words, 146, d_89d394e3541735fc, m_89d394e3541735fc, + 1, 8, i_89d394e3541735fc, nullptr, nullptr, { &s_89d394e3541735fc, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<49> b_c0ad259ec157ccd3 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 211, 204, 87, 193, 158, 37, 173, 192, + 22, 0, 0, 0, 2, 0, 0, 0, + 252, 53, 23, 84, 227, 148, 211, 137, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 218, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 151, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 69, 110, 99, 111, 100, 101, + 73, 110, 100, 101, 120, 46, 84, 121, + 112, 101, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 24, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 57, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 105, 103, 66, 111, 120, 76, 111, + 115, 115, 108, 101, 115, 115, 0, 0, + 102, 117, 108, 108, 72, 69, 86, 67, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 105, 103, 66, 111, 120, 72, 69, + 86, 67, 0, 0, 0, 0, 0, 0, + 99, 104, 102, 102, 114, 65, 110, 100, + 114, 111, 105, 100, 72, 50, 54, 52, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 117, 108, 108, 76, 111, 115, 115, + 108, 101, 115, 115, 67, 108, 105, 112, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 111, 110, 116, 0, 0, 0, } +}; +::capnp::word const* const bp_c0ad259ec157ccd3 = b_c0ad259ec157ccd3.words; +#if !CAPNP_LITE +static const uint16_t m_c0ad259ec157ccd3[] = {2, 0, 3, 5, 1, 4}; +const ::capnp::_::RawSchema s_c0ad259ec157ccd3 = { + 0xc0ad259ec157ccd3, b_c0ad259ec157ccd3.words, 49, nullptr, m_c0ad259ec157ccd3, + 0, 6, nullptr, nullptr, nullptr, { &s_c0ad259ec157ccd3, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(Type_c0ad259ec157ccd3, c0ad259ec157ccd3); +static const ::capnp::_::AlignedData<124> b_ea095da1894f7d85 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 133, 125, 79, 137, 161, 93, 9, 234, + 10, 0, 0, 0, 1, 0, 3, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 210, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 143, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 65, 110, 100, 114, 111, 105, + 100, 76, 111, 103, 69, 110, 116, 114, + 121, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 3, 0, 1, 0, + 188, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 0, 0, 0, 3, 0, 1, 0, + 192, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 3, 0, 1, 0, + 200, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 0, 0, 0, 3, 0, 1, 0, + 204, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 0, 0, 0, 3, 0, 1, 0, + 208, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 0, 0, 0, 3, 0, 1, 0, + 212, 0, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 216, 0, 0, 0, 2, 0, 1, 0, + 105, 100, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 115, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 105, 111, 114, 105, 116, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 105, 100, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 100, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 97, 103, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 115, 115, 97, 103, 101, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_ea095da1894f7d85 = b_ea095da1894f7d85.words; +#if !CAPNP_LITE +static const uint16_t m_ea095da1894f7d85[] = {0, 6, 3, 2, 5, 4, 1}; +static const uint16_t i_ea095da1894f7d85[] = {0, 1, 2, 3, 4, 5, 6}; +const ::capnp::_::RawSchema s_ea095da1894f7d85 = { + 0xea095da1894f7d85, b_ea095da1894f7d85.words, 124, nullptr, m_ea095da1894f7d85, + 0, 7, i_ea095da1894f7d85, nullptr, nullptr, { &s_ea095da1894f7d85, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<648> b_e00b5b3eba12876c = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 108, 135, 18, 186, 62, 91, 11, 224, + 10, 0, 0, 0, 1, 0, 10, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 6, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 218, 0, 0, 0, + 33, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 231, 7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 111, 110, 103, 105, 116, + 117, 100, 105, 110, 97, 108, 80, 108, + 97, 110, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 32, 145, 7, 204, 83, 167, 49, 178, + 9, 0, 0, 0, 186, 0, 0, 0, + 0, 16, 48, 245, 114, 176, 254, 140, + 13, 0, 0, 0, 114, 0, 0, 0, + 76, 111, 110, 103, 105, 116, 117, 100, + 105, 110, 97, 108, 80, 108, 97, 110, + 83, 111, 117, 114, 99, 101, 0, 0, + 71, 112, 115, 84, 114, 97, 106, 101, + 99, 116, 111, 114, 121, 0, 0, 0, + 144, 0, 0, 0, 3, 0, 4, 0, + 23, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 3, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 3, 0, 0, 3, 0, 1, 0, + 240, 3, 0, 0, 2, 0, 1, 0, + 25, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 3, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 3, 0, 0, 3, 0, 1, 0, + 8, 4, 0, 0, 2, 0, 1, 0, + 24, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 4, 0, 0, 226, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 4, 0, 0, 3, 0, 1, 0, + 24, 4, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 4, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 4, 0, 0, 3, 0, 1, 0, + 36, 4, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 4, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 4, 0, 0, 3, 0, 1, 0, + 48, 4, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 4, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 4, 0, 0, 3, 0, 1, 0, + 60, 4, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 4, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 4, 0, 0, 3, 0, 1, 0, + 72, 4, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 4, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 4, 0, 0, 3, 0, 1, 0, + 76, 4, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 4, 0, 0, 3, 0, 1, 0, + 80, 4, 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 4, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 4, 0, 0, 3, 0, 1, 0, + 88, 4, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 4, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 4, 0, 0, 3, 0, 1, 0, + 104, 4, 0, 0, 2, 0, 1, 0, + 26, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 4, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 4, 0, 0, 3, 0, 1, 0, + 116, 4, 0, 0, 2, 0, 1, 0, + 34, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 4, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 4, 0, 0, 3, 0, 1, 0, + 128, 4, 0, 0, 2, 0, 1, 0, + 33, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 4, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 4, 0, 0, 3, 0, 1, 0, + 156, 4, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 4, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 4, 0, 0, 3, 0, 1, 0, + 168, 4, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 4, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 4, 0, 0, 3, 0, 1, 0, + 180, 4, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 4, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 4, 0, 0, 3, 0, 1, 0, + 192, 4, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 4, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 4, 0, 0, 3, 0, 1, 0, + 204, 4, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 4, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 4, 0, 0, 3, 0, 1, 0, + 216, 4, 0, 0, 2, 0, 1, 0, + 35, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 4, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 4, 0, 0, 3, 0, 1, 0, + 232, 4, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 4, 0, 0, 3, 0, 1, 0, + 240, 4, 0, 0, 2, 0, 1, 0, + 27, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 4, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 4, 0, 0, 3, 0, 1, 0, + 252, 4, 0, 0, 2, 0, 1, 0, + 28, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 4, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 4, 0, 0, 3, 0, 1, 0, + 8, 5, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 5, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 5, 0, 0, 3, 0, 1, 0, + 20, 5, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 5, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 5, 0, 0, 3, 0, 1, 0, + 32, 5, 0, 0, 2, 0, 1, 0, + 29, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 5, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 5, 0, 0, 3, 0, 1, 0, + 44, 5, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 5, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 5, 0, 0, 3, 0, 1, 0, + 56, 5, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 5, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 5, 0, 0, 3, 0, 1, 0, + 68, 5, 0, 0, 2, 0, 1, 0, + 30, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 5, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 5, 0, 0, 3, 0, 1, 0, + 80, 5, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 1, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 5, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 5, 0, 0, 3, 0, 1, 0, + 88, 5, 0, 0, 2, 0, 1, 0, + 31, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 30, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 5, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 5, 0, 0, 3, 0, 1, 0, + 100, 5, 0, 0, 2, 0, 1, 0, + 32, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 5, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 5, 0, 0, 3, 0, 1, 0, + 112, 5, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 5, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 5, 0, 0, 3, 0, 1, 0, + 132, 5, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 33, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 5, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 5, 0, 0, 3, 0, 1, 0, + 152, 5, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 5, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 5, 0, 0, 3, 0, 1, 0, + 172, 5, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 1, 0, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 5, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 5, 0, 0, 3, 0, 1, 0, + 184, 5, 0, 0, 2, 0, 1, 0, + 108, 97, 116, 101, 114, 97, 108, 86, + 97, 108, 105, 100, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 80, 111, 108, 121, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 110, 103, 105, 116, 117, 100, + 105, 110, 97, 108, 86, 97, 108, 105, + 100, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 84, 97, 114, 103, 101, 116, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 84, 97, 114, 103, 101, 116, 77, + 105, 110, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 84, 97, 114, 103, 101, 116, 77, + 97, 120, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 106, 101, 114, 107, 70, 97, 99, 116, + 111, 114, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 76, 101, 97, 100, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 99, 119, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 100, 101, 108, 77, 111, 110, + 111, 84, 105, 109, 101, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 100, 97, 114, 83, 116, 97, + 116, 101, 77, 111, 110, 111, 84, 105, + 109, 101, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 110, 101, 87, 105, 100, 116, + 104, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 84, 114, 97, 106, 101, + 99, 116, 111, 114, 121, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 16, 48, 245, 114, 176, 254, 140, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 118, 101, 110, 116, 115, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 211, 58, 175, 76, 243, 87, 22, 155, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 84, 97, 114, 103, 101, 116, 70, + 117, 116, 117, 114, 101, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 110, 103, 105, 116, 117, 100, + 105, 110, 97, 108, 80, 108, 97, 110, + 83, 111, 117, 114, 99, 101, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 32, 145, 7, 204, 83, 167, 49, 178, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 67, 114, 117, 105, 115, 101, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 67, 114, 117, 105, 115, 101, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 84, 97, 114, 103, 101, 116, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 80, 108, 97, 110, 110, + 101, 114, 65, 99, 116, 105, 118, 101, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 77, 97, 120, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 67, 117, 114, 118, 97, 116, 117, + 114, 101, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 99, 101, 108, 70, 111, 114, + 84, 117, 114, 110, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 76, 101, 102, 116, 76, + 97, 110, 101, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 115, 82, 105, 103, 104, 116, + 76, 97, 110, 101, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 112, 86, 97, 108, 105, 100, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 83, 116, 97, 114, 116, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 83, 116, 97, 114, 116, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 100, 97, 114, 86, 97, 108, + 105, 100, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 111, 99, 101, 115, 115, 105, + 110, 103, 68, 101, 108, 97, 121, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 100, 97, 114, 67, 97, 110, + 69, 114, 114, 111, 114, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 109, 109, 73, 115, 115, 117, + 101, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 101, 108, 115, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 115, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 106, 101, 114, 107, 115, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 111, 108, 118, 101, 114, 69, 120, + 101, 99, 117, 116, 105, 111, 110, 84, + 105, 109, 101, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e00b5b3eba12876c = b_e00b5b3eba12876c.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_e00b5b3eba12876c[] = { + &s_8cfeb072f5301000, + &s_9b1657f34caf3ad3, + &s_b231a753cc079120, +}; +static const uint16_t m_e00b5b3eba12876c[] = {17, 27, 18, 5, 4, 32, 31, 1, 22, 13, 8, 19, 12, 7, 23, 24, 6, 34, 11, 0, 15, 2, 25, 9, 29, 30, 10, 28, 35, 33, 16, 21, 20, 26, 3, 14}; +static const uint16_t i_e00b5b3eba12876c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35}; +const ::capnp::_::RawSchema s_e00b5b3eba12876c = { + 0xe00b5b3eba12876c, b_e00b5b3eba12876c.words, 648, d_e00b5b3eba12876c, m_e00b5b3eba12876c, + 3, 36, i_e00b5b3eba12876c, nullptr, nullptr, { &s_e00b5b3eba12876c, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<41> b_b231a753cc079120 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 32, 145, 7, 204, 83, 167, 49, 178, + 27, 0, 0, 0, 2, 0, 0, 0, + 108, 135, 18, 186, 62, 91, 11, 224, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 146, 1, 0, 0, + 45, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 127, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 111, 110, 103, 105, 116, + 117, 100, 105, 110, 97, 108, 80, 108, + 97, 110, 46, 76, 111, 110, 103, 105, + 116, 117, 100, 105, 110, 97, 108, 80, + 108, 97, 110, 83, 111, 117, 114, 99, + 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 114, 117, 105, 115, 101, 0, 0, + 108, 101, 97, 100, 48, 0, 0, 0, + 108, 101, 97, 100, 49, 0, 0, 0, + 108, 101, 97, 100, 50, 0, 0, 0, + 101, 50, 101, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_b231a753cc079120 = b_b231a753cc079120.words; +#if !CAPNP_LITE +static const uint16_t m_b231a753cc079120[] = {0, 4, 1, 2, 3}; +const ::capnp::_::RawSchema s_b231a753cc079120 = { + 0xb231a753cc079120, b_b231a753cc079120.words, 41, nullptr, m_b231a753cc079120, + 0, 5, nullptr, nullptr, nullptr, { &s_b231a753cc079120, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(LongitudinalPlanSource_b231a753cc079120, b231a753cc079120); +static const ::capnp::_::AlignedData<58> b_8cfeb072f5301000 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 0, 16, 48, 245, 114, 176, 254, 140, + 27, 0, 0, 0, 1, 0, 0, 0, + 108, 135, 18, 186, 62, 91, 11, 224, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 74, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 111, 110, 103, 105, 116, + 117, 100, 105, 110, 97, 108, 80, 108, + 97, 110, 46, 71, 112, 115, 84, 114, + 97, 106, 101, 99, 116, 111, 114, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 1, 0, + 64, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 0, 0, 0, 3, 0, 1, 0, + 84, 0, 0, 0, 2, 0, 1, 0, + 120, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_8cfeb072f5301000 = b_8cfeb072f5301000.words; +#if !CAPNP_LITE +static const uint16_t m_8cfeb072f5301000[] = {0, 1}; +static const uint16_t i_8cfeb072f5301000[] = {0, 1}; +const ::capnp::_::RawSchema s_8cfeb072f5301000 = { + 0x8cfeb072f5301000, b_8cfeb072f5301000.words, 58, nullptr, m_8cfeb072f5301000, + 0, 2, i_8cfeb072f5301000, nullptr, nullptr, { &s_8cfeb072f5301000, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<571> b_e1e9318e2ae8b51e = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 30, 181, 232, 42, 142, 49, 233, 225, + 10, 0, 0, 0, 1, 0, 8, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 8, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 178, 0, 0, 0, + 29, 0, 0, 0, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 207, 6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 97, 116, 101, 114, 97, + 108, 80, 108, 97, 110, 0, 0, 0, + 12, 0, 0, 0, 1, 0, 1, 0, + 13, 127, 42, 207, 63, 239, 83, 187, + 17, 0, 0, 0, 58, 0, 0, 0, + 210, 86, 206, 149, 241, 151, 194, 250, + 13, 0, 0, 0, 130, 0, 0, 0, + 3, 211, 186, 188, 17, 99, 57, 247, + 13, 0, 0, 0, 162, 0, 0, 0, + 68, 101, 115, 105, 114, 101, 0, 0, + 76, 97, 110, 101, 67, 104, 97, 110, + 103, 101, 83, 116, 97, 116, 101, 0, + 76, 97, 110, 101, 67, 104, 97, 110, + 103, 101, 68, 105, 114, 101, 99, 116, + 105, 111, 110, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 3, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 3, 0, 0, 3, 0, 1, 0, + 96, 3, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 3, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 3, 0, 0, 3, 0, 1, 0, + 120, 3, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 3, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 3, 0, 0, 3, 0, 1, 0, + 144, 3, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 3, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 3, 0, 0, 3, 0, 1, 0, + 152, 3, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 3, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 3, 0, 0, 3, 0, 1, 0, + 176, 3, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 3, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 3, 0, 0, 3, 0, 1, 0, + 180, 3, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 3, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 3, 0, 0, 3, 0, 1, 0, + 204, 3, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 3, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 3, 0, 0, 3, 0, 1, 0, + 208, 3, 0, 0, 2, 0, 1, 0, + 28, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 3, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 3, 0, 0, 3, 0, 1, 0, + 224, 3, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 160, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 3, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 3, 0, 0, 3, 0, 1, 0, + 236, 3, 0, 0, 2, 0, 1, 0, + 27, 0, 0, 0, 161, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 3, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 3, 0, 0, 3, 0, 1, 0, + 248, 3, 0, 0, 2, 0, 1, 0, + 30, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 3, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 3, 0, 0, 3, 0, 1, 0, + 8, 4, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 162, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 4, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 4, 0, 0, 3, 0, 1, 0, + 20, 4, 0, 0, 2, 0, 1, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 4, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 4, 0, 0, 3, 0, 1, 0, + 36, 4, 0, 0, 2, 0, 1, 0, + 26, 0, 0, 0, 163, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 4, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 4, 0, 0, 3, 0, 1, 0, + 48, 4, 0, 0, 2, 0, 1, 0, + 24, 0, 0, 0, 164, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 4, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 4, 0, 0, 3, 0, 1, 0, + 60, 4, 0, 0, 2, 0, 1, 0, + 25, 0, 0, 0, 165, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 4, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 4, 0, 0, 3, 0, 1, 0, + 72, 4, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 4, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 4, 0, 0, 3, 0, 1, 0, + 76, 4, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 4, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 4, 0, 0, 3, 0, 1, 0, + 84, 4, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 4, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 4, 0, 0, 3, 0, 1, 0, + 96, 4, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 4, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 4, 0, 0, 3, 0, 1, 0, + 120, 4, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 4, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 4, 0, 0, 3, 0, 1, 0, + 124, 4, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 4, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 4, 0, 0, 3, 0, 1, 0, + 136, 4, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 4, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 4, 0, 0, 3, 0, 1, 0, + 148, 4, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 4, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 4, 0, 0, 3, 0, 1, 0, + 160, 4, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 4, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 4, 0, 0, 3, 0, 1, 0, + 176, 4, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 4, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 4, 0, 0, 3, 0, 1, 0, + 196, 4, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 4, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 4, 0, 0, 3, 0, 1, 0, + 220, 4, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 4, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 4, 0, 0, 3, 0, 1, 0, + 244, 4, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 166, 0, 0, 0, + 0, 0, 1, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 4, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 4, 0, 0, 3, 0, 1, 0, + 252, 4, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 30, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 4, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 4, 0, 0, 3, 0, 1, 0, + 8, 5, 0, 0, 2, 0, 1, 0, + 108, 97, 110, 101, 87, 105, 100, 116, + 104, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 80, 111, 108, 121, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 80, 111, 108, 121, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 80, 114, 111, 98, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 80, 111, 108, 121, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 80, 114, 111, 98, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 80, 111, 108, 121, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 80, 114, 111, 98, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 65, 110, 103, 108, 101, 68, 101, 103, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 112, 99, 83, 111, 108, 117, 116, + 105, 111, 110, 86, 97, 108, 105, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 114, 97, 109, 115, 86, 97, + 108, 105, 100, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 103, 108, 101, 79, 102, 102, + 115, 101, 116, 68, 101, 103, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 100, 101, 108, 86, 97, 108, + 105, 100, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 105, 110, 103, + 82, 97, 116, 101, 68, 101, 103, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 110, 115, 111, 114, 86, 97, + 108, 105, 100, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 109, 109, 73, 115, 115, 117, + 101, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 101, 110, 101, 116, 86, + 97, 108, 105, 100, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 115, 105, 114, 101, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 13, 127, 42, 207, 63, 239, 83, 187, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 110, 101, 67, 104, 97, 110, + 103, 101, 83, 116, 97, 116, 101, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 210, 86, 206, 149, 241, 151, 194, 250, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 110, 101, 67, 104, 97, 110, + 103, 101, 68, 105, 114, 101, 99, 116, + 105, 111, 110, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 3, 211, 186, 188, 17, 99, 57, 247, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 80, 97, 116, 104, 80, 111, 105, + 110, 116, 115, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 80, 114, 111, 98, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 114, 118, 97, 116, 117, 114, + 101, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 114, 118, 97, 116, 117, 114, + 101, 82, 97, 116, 101, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 119, 67, 117, 114, 118, 97, + 116, 117, 114, 101, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 119, 67, 117, 114, 118, 97, + 116, 117, 114, 101, 82, 97, 116, 101, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 115, 105, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 114, 118, 97, 116, 117, 114, + 101, 115, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 114, 118, 97, 116, 117, 114, + 101, 82, 97, 116, 101, 115, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 115, 101, 76, 97, 110, 101, 76, + 105, 110, 101, 115, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 111, 108, 118, 101, 114, 69, 120, + 101, 99, 117, 116, 105, 111, 110, 84, + 105, 109, 101, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e1e9318e2ae8b51e = b_e1e9318e2ae8b51e.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_e1e9318e2ae8b51e[] = { + &s_bb53ef3fcf2a7f0d, + &s_f7396311bcbad303, + &s_fac297f195ce56d2, +}; +static const uint16_t m_e1e9318e2ae8b51e[] = {11, 2, 3, 15, 22, 23, 28, 27, 20, 1, 21, 17, 4, 5, 19, 18, 0, 12, 9, 10, 16, 26, 6, 7, 24, 25, 14, 30, 8, 13, 29}; +static const uint16_t i_e1e9318e2ae8b51e[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30}; +const ::capnp::_::RawSchema s_e1e9318e2ae8b51e = { + 0xe1e9318e2ae8b51e, b_e1e9318e2ae8b51e.words, 571, d_e1e9318e2ae8b51e, m_e1e9318e2ae8b51e, + 3, 31, i_e1e9318e2ae8b51e, nullptr, nullptr, { &s_e1e9318e2ae8b51e, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<52> b_bb53ef3fcf2a7f0d = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 13, 127, 42, 207, 63, 239, 83, 187, + 22, 0, 0, 0, 2, 0, 0, 0, + 30, 181, 232, 42, 142, 49, 233, 225, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 234, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 97, 116, 101, 114, 97, + 108, 80, 108, 97, 110, 46, 68, 101, + 115, 105, 114, 101, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 57, 0, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 110, 101, 0, 0, 0, 0, + 116, 117, 114, 110, 76, 101, 102, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 117, 114, 110, 82, 105, 103, 104, + 116, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 110, 101, 67, 104, 97, 110, + 103, 101, 76, 101, 102, 116, 0, 0, + 108, 97, 110, 101, 67, 104, 97, 110, + 103, 101, 82, 105, 103, 104, 116, 0, + 107, 101, 101, 112, 76, 101, 102, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 101, 101, 112, 82, 105, 103, 104, + 116, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_bb53ef3fcf2a7f0d = b_bb53ef3fcf2a7f0d.words; +#if !CAPNP_LITE +static const uint16_t m_bb53ef3fcf2a7f0d[] = {5, 6, 3, 4, 0, 1, 2}; +const ::capnp::_::RawSchema s_bb53ef3fcf2a7f0d = { + 0xbb53ef3fcf2a7f0d, b_bb53ef3fcf2a7f0d.words, 52, nullptr, m_bb53ef3fcf2a7f0d, + 0, 7, nullptr, nullptr, nullptr, { &s_bb53ef3fcf2a7f0d, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(Desire_bb53ef3fcf2a7f0d, bb53ef3fcf2a7f0d); +static const ::capnp::_::AlignedData<40> b_fac297f195ce56d2 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 210, 86, 206, 149, 241, 151, 194, 250, + 22, 0, 0, 0, 2, 0, 0, 0, + 30, 181, 232, 42, 142, 49, 233, 225, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 50, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 103, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 97, 116, 101, 114, 97, + 108, 80, 108, 97, 110, 46, 76, 97, + 110, 101, 67, 104, 97, 110, 103, 101, + 83, 116, 97, 116, 101, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 102, 102, 0, 0, 0, 0, 0, + 112, 114, 101, 76, 97, 110, 101, 67, + 104, 97, 110, 103, 101, 0, 0, 0, + 108, 97, 110, 101, 67, 104, 97, 110, + 103, 101, 83, 116, 97, 114, 116, 105, + 110, 103, 0, 0, 0, 0, 0, 0, + 108, 97, 110, 101, 67, 104, 97, 110, + 103, 101, 70, 105, 110, 105, 115, 104, + 105, 110, 103, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_fac297f195ce56d2 = b_fac297f195ce56d2.words; +#if !CAPNP_LITE +static const uint16_t m_fac297f195ce56d2[] = {3, 2, 0, 1}; +const ::capnp::_::RawSchema s_fac297f195ce56d2 = { + 0xfac297f195ce56d2, b_fac297f195ce56d2.words, 40, nullptr, m_fac297f195ce56d2, + 0, 4, nullptr, nullptr, nullptr, { &s_fac297f195ce56d2, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(LaneChangeState_fac297f195ce56d2, fac297f195ce56d2); +static const ::capnp::_::AlignedData<32> b_f7396311bcbad303 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 3, 211, 186, 188, 17, 99, 57, 247, + 22, 0, 0, 0, 2, 0, 0, 0, + 30, 181, 232, 42, 142, 49, 233, 225, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 82, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 79, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 97, 116, 101, 114, 97, + 108, 80, 108, 97, 110, 46, 76, 97, + 110, 101, 67, 104, 97, 110, 103, 101, + 68, 105, 114, 101, 99, 116, 105, 111, + 110, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 110, 101, 0, 0, 0, 0, + 108, 101, 102, 116, 0, 0, 0, 0, + 114, 105, 103, 104, 116, 0, 0, 0, } +}; +::capnp::word const* const bp_f7396311bcbad303 = b_f7396311bcbad303.words; +#if !CAPNP_LITE +static const uint16_t m_f7396311bcbad303[] = {1, 0, 2}; +const ::capnp::_::RawSchema s_f7396311bcbad303 = { + 0xf7396311bcbad303, b_f7396311bcbad303.words, 32, nullptr, m_f7396311bcbad303, + 0, 3, nullptr, nullptr, nullptr, { &s_f7396311bcbad303, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(LaneChangeDirection_f7396311bcbad303, f7396311bcbad303); +static const ::capnp::_::AlignedData<434> b_ebc5703d1ee7c129 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 41, 193, 231, 30, 61, 112, 197, 235, + 10, 0, 0, 0, 1, 0, 4, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 14, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 234, 0, 0, 0, + 33, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 0, 0, 0, 127, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 105, 118, 101, 76, 111, + 99, 97, 116, 105, 111, 110, 75, 97, + 108, 109, 97, 110, 0, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 1, 252, 81, 75, 204, 200, 77, 142, + 9, 0, 0, 0, 58, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 5, 0, 0, 0, 98, 0, 0, 0, + 83, 116, 97, 116, 117, 115, 0, 0, + 77, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 0, 0, 0, 0, 0, + 100, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 2, 0, 0, 3, 0, 1, 0, + 184, 2, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 2, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 2, 0, 0, 3, 0, 1, 0, + 196, 2, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 2, 0, 0, 3, 0, 1, 0, + 204, 2, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 2, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 2, 0, 0, 3, 0, 1, 0, + 212, 2, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 2, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 2, 0, 0, 3, 0, 1, 0, + 220, 2, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 2, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 2, 0, 0, 3, 0, 1, 0, + 232, 2, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 2, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 2, 0, 0, 3, 0, 1, 0, + 240, 2, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 2, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 2, 0, 0, 3, 0, 1, 0, + 248, 2, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 2, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 2, 0, 0, 3, 0, 1, 0, + 4, 3, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 3, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 3, 0, 0, 3, 0, 1, 0, + 20, 3, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 3, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 3, 0, 0, 3, 0, 1, 0, + 32, 3, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 3, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 3, 0, 0, 3, 0, 1, 0, + 44, 3, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 3, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 3, 0, 0, 3, 0, 1, 0, + 60, 3, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 3, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 3, 0, 0, 3, 0, 1, 0, + 64, 3, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 3, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 3, 0, 0, 3, 0, 1, 0, + 72, 3, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 3, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 3, 0, 0, 3, 0, 1, 0, + 76, 3, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 3, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 3, 0, 0, 3, 0, 1, 0, + 88, 3, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 48, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 85, 3, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 3, 0, 0, 3, 0, 1, 0, + 96, 3, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 49, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 93, 3, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 3, 0, 0, 3, 0, 1, 0, + 104, 3, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 101, 3, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 3, 0, 0, 3, 0, 1, 0, + 108, 3, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 3, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 3, 0, 0, 3, 0, 1, 0, + 124, 3, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 51, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 121, 3, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 3, 0, 0, 3, 0, 1, 0, + 132, 3, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 52, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 129, 3, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 3, 0, 0, 3, 0, 1, 0, + 140, 3, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 3, 0, 0, 3, 0, 1, 0, + 148, 3, 0, 0, 2, 0, 1, 0, + 24, 0, 0, 0, 53, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 3, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 3, 0, 0, 3, 0, 1, 0, + 156, 3, 0, 0, 2, 0, 1, 0, + 112, 111, 115, 105, 116, 105, 111, 110, + 69, 67, 69, 70, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 105, 116, 105, 111, 110, + 71, 101, 111, 100, 101, 116, 105, 99, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 108, 111, 99, 105, 116, 121, + 69, 67, 69, 70, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 108, 111, 99, 105, 116, 121, + 78, 69, 68, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 108, 111, 99, 105, 116, 121, + 68, 101, 118, 105, 99, 101, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 101, 108, 101, 114, 97, + 116, 105, 111, 110, 68, 101, 118, 105, + 99, 101, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 114, 105, 101, 110, 116, 97, 116, + 105, 111, 110, 69, 67, 69, 70, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 114, 105, 101, 110, 116, 97, 116, + 105, 111, 110, 78, 69, 68, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 103, 117, 108, 97, 114, 86, + 101, 108, 111, 99, 105, 116, 121, 68, + 101, 118, 105, 99, 101, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 108, 105, 98, 114, 97, 116, + 101, 100, 79, 114, 105, 101, 110, 116, + 97, 116, 105, 111, 110, 78, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 101, 108, 111, 99, 105, 116, 121, + 67, 97, 108, 105, 98, 114, 97, 116, + 101, 100, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 99, 101, 108, 101, 114, 97, + 116, 105, 111, 110, 67, 97, 108, 105, + 98, 114, 97, 116, 101, 100, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 103, 117, 108, 97, 114, 86, + 101, 108, 111, 99, 105, 116, 121, 67, + 97, 108, 105, 98, 114, 97, 116, 101, + 100, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 87, 101, 101, 107, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 84, 105, 109, 101, 79, + 102, 87, 101, 101, 107, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 116, 117, 115, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 1, 252, 81, 75, 204, 200, 77, 142, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 105, 120, 84, 105, 109, 101, + 115, 116, 97, 109, 112, 77, 105, 108, + 108, 105, 115, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 112, 117, 116, 115, 79, 75, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 101, 110, 101, 116, 79, + 75, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 79, 75, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 108, 105, 98, 114, 97, 116, + 101, 100, 79, 114, 105, 101, 110, 116, + 97, 116, 105, 111, 110, 69, 67, 69, + 70, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 110, 115, 111, 114, 115, 79, + 75, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 118, 105, 99, 101, 83, 116, + 97, 98, 108, 101, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 83, 105, 110, 99, + 101, 82, 101, 115, 101, 116, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 120, 99, 101, 115, 115, 105, 118, + 101, 82, 101, 115, 101, 116, 115, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_ebc5703d1ee7c129 = b_ebc5703d1ee7c129.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_ebc5703d1ee7c129[] = { + &s_8e4dc8cc4b51fc01, + &s_bf23f9ed66dace1c, +}; +static const uint16_t m_ebc5703d1ee7c129[] = {11, 5, 12, 8, 20, 9, 22, 24, 19, 14, 13, 17, 6, 7, 18, 0, 1, 21, 15, 23, 16, 10, 4, 2, 3}; +static const uint16_t i_ebc5703d1ee7c129[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}; +const ::capnp::_::RawSchema s_ebc5703d1ee7c129 = { + 0xebc5703d1ee7c129, b_ebc5703d1ee7c129.words, 434, d_ebc5703d1ee7c129, m_ebc5703d1ee7c129, + 2, 25, i_ebc5703d1ee7c129, nullptr, nullptr, { &s_ebc5703d1ee7c129, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<33> b_8e4dc8cc4b51fc01 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 1, 252, 81, 75, 204, 200, 77, 142, + 29, 0, 0, 0, 2, 0, 0, 0, + 41, 193, 231, 30, 61, 112, 197, 235, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 34, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 79, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 105, 118, 101, 76, 111, + 99, 97, 116, 105, 111, 110, 75, 97, + 108, 109, 97, 110, 46, 83, 116, 97, + 116, 117, 115, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 105, 110, 105, 116, 105, 97, + 108, 105, 122, 101, 100, 0, 0, 0, + 117, 110, 99, 97, 108, 105, 98, 114, + 97, 116, 101, 100, 0, 0, 0, 0, + 118, 97, 108, 105, 100, 0, 0, 0, } +}; +::capnp::word const* const bp_8e4dc8cc4b51fc01 = b_8e4dc8cc4b51fc01.words; +#if !CAPNP_LITE +static const uint16_t m_8e4dc8cc4b51fc01[] = {1, 0, 2}; +const ::capnp::_::RawSchema s_8e4dc8cc4b51fc01 = { + 0x8e4dc8cc4b51fc01, b_8e4dc8cc4b51fc01.words, 33, nullptr, m_8e4dc8cc4b51fc01, + 0, 3, nullptr, nullptr, nullptr, { &s_8e4dc8cc4b51fc01, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(Status_8e4dc8cc4b51fc01, 8e4dc8cc4b51fc01); +static const ::capnp::_::AlignedData<73> b_bf23f9ed66dace1c = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 28, 206, 218, 102, 237, 249, 35, 191, + 29, 0, 0, 0, 1, 0, 1, 0, + 41, 193, 231, 30, 61, 112, 197, 235, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 74, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 105, 118, 101, 76, 111, + 99, 97, 116, 105, 111, 110, 75, 97, + 108, 109, 97, 110, 46, 77, 101, 97, + 115, 117, 114, 101, 109, 101, 110, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 3, 0, 1, 0, + 92, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 0, 0, 0, 3, 0, 1, 0, + 112, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 0, 0, 0, 3, 0, 1, 0, + 116, 0, 0, 0, 2, 0, 1, 0, + 118, 97, 108, 117, 101, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 100, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 97, 108, 105, 100, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_bf23f9ed66dace1c = b_bf23f9ed66dace1c.words; +#if !CAPNP_LITE +static const uint16_t m_bf23f9ed66dace1c[] = {1, 2, 0}; +static const uint16_t i_bf23f9ed66dace1c[] = {0, 1, 2}; +const ::capnp::_::RawSchema s_bf23f9ed66dace1c = { + 0xbf23f9ed66dace1c, b_bf23f9ed66dace1c.words, 73, nullptr, m_bf23f9ed66dace1c, + 0, 3, i_bf23f9ed66dace1c, nullptr, nullptr, { &s_bf23f9ed66dace1c, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<81> b_af85387b3f681406 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 6, 20, 104, 63, 123, 56, 133, 175, + 10, 0, 0, 0, 1, 0, 0, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 146, 0, 0, 0, + 29, 0, 0, 0, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 80, 114, 111, 99, 76, 111, + 103, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 1, 0, 1, 0, + 40, 109, 158, 241, 19, 86, 184, 176, + 17, 0, 0, 0, 66, 0, 0, 0, + 135, 224, 44, 191, 197, 200, 137, 241, + 13, 0, 0, 0, 74, 0, 0, 0, + 212, 63, 139, 240, 148, 95, 9, 253, + 13, 0, 0, 0, 34, 0, 0, 0, + 80, 114, 111, 99, 101, 115, 115, 0, + 67, 80, 85, 84, 105, 109, 101, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 101, 109, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 0, 0, 3, 0, 1, 0, + 96, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 0, 0, 0, 3, 0, 1, 0, + 100, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 3, 0, 1, 0, + 120, 0, 0, 0, 2, 0, 1, 0, + 99, 112, 117, 84, 105, 109, 101, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 135, 224, 44, 191, 197, 200, 137, 241, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 109, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 212, 63, 139, 240, 148, 95, 9, 253, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 111, 99, 115, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 40, 109, 158, 241, 19, 86, 184, 176, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_af85387b3f681406 = b_af85387b3f681406.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_af85387b3f681406[] = { + &s_b0b85613f19e6d28, + &s_f189c8c5bf2ce087, + &s_fd095f94f08b3fd4, +}; +static const uint16_t m_af85387b3f681406[] = {0, 1, 2}; +static const uint16_t i_af85387b3f681406[] = {0, 1, 2}; +const ::capnp::_::RawSchema s_af85387b3f681406 = { + 0xaf85387b3f681406, b_af85387b3f681406.words, 81, d_af85387b3f681406, m_af85387b3f681406, + 3, 3, i_af85387b3f681406, nullptr, nullptr, { &s_af85387b3f681406, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<285> b_b0b85613f19e6d28 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 40, 109, 158, 241, 19, 86, 184, 176, + 18, 0, 0, 0, 1, 0, 9, 0, + 6, 20, 104, 63, 123, 56, 133, 175, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 210, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 191, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 80, 114, 111, 99, 76, 111, + 103, 46, 80, 114, 111, 99, 101, 115, + 115, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 68, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 1, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 1, 0, 0, 3, 0, 1, 0, + 212, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 1, 0, 0, 3, 0, 1, 0, + 216, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 1, 0, 0, 3, 0, 1, 0, + 220, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 1, 0, 0, 3, 0, 1, 0, + 224, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 1, 0, 0, 3, 0, 1, 0, + 228, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 1, 0, 0, 3, 0, 1, 0, + 236, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 1, 0, 0, 3, 0, 1, 0, + 244, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 1, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 1, 0, 0, 3, 0, 1, 0, + 0, 2, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 1, 0, 0, 3, 0, 1, 0, + 8, 2, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2, 0, 0, 3, 0, 1, 0, + 12, 2, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 2, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 2, 0, 0, 3, 0, 1, 0, + 20, 2, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 2, 0, 0, 3, 0, 1, 0, + 28, 2, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 2, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 2, 0, 0, 3, 0, 1, 0, + 32, 2, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 2, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 2, 0, 0, 3, 0, 1, 0, + 36, 2, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 2, 0, 0, 3, 0, 1, 0, + 44, 2, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 2, 0, 0, 3, 0, 1, 0, + 64, 2, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 2, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 2, 0, 0, 3, 0, 1, 0, + 68, 2, 0, 0, 2, 0, 1, 0, + 112, 105, 100, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 97, 109, 101, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 116, 101, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 112, 105, 100, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 112, 117, 85, 115, 101, 114, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 112, 117, 83, 121, 115, 116, 101, + 109, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 112, 117, 67, 104, 105, 108, 100, + 114, 101, 110, 85, 115, 101, 114, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 112, 117, 67, 104, 105, 108, 100, + 114, 101, 110, 83, 121, 115, 116, 101, + 109, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 105, 111, 114, 105, 116, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 105, 99, 101, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 117, 109, 84, 104, 114, 101, 97, + 100, 115, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 114, 116, 84, 105, 109, + 101, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 109, 86, 109, 115, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 109, 82, 115, 115, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 111, 99, 101, 115, 115, 111, + 114, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 109, 100, 108, 105, 110, 101, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 120, 101, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_b0b85613f19e6d28 = b_b0b85613f19e6d28.words; +#if !CAPNP_LITE +static const uint16_t m_b0b85613f19e6d28[] = {15, 7, 6, 5, 4, 16, 13, 12, 1, 9, 10, 0, 3, 8, 14, 11, 2}; +static const uint16_t i_b0b85613f19e6d28[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; +const ::capnp::_::RawSchema s_b0b85613f19e6d28 = { + 0xb0b85613f19e6d28, b_b0b85613f19e6d28.words, 285, nullptr, m_b0b85613f19e6d28, + 0, 17, i_b0b85613f19e6d28, nullptr, nullptr, { &s_b0b85613f19e6d28, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<138> b_f189c8c5bf2ce087 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 135, 224, 44, 191, 197, 200, 137, 241, + 18, 0, 0, 0, 1, 0, 5, 0, + 6, 20, 104, 63, 123, 56, 133, 175, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 218, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 199, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 80, 114, 111, 99, 76, 111, + 103, 46, 67, 80, 85, 84, 105, 109, + 101, 115, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 32, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 216, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 0, 0, 0, 3, 0, 1, 0, + 220, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 0, 0, 0, 3, 0, 1, 0, + 224, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 0, 0, 0, 3, 0, 1, 0, + 228, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 0, 0, 0, 3, 0, 1, 0, + 232, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 0, 0, 0, 3, 0, 1, 0, + 236, 0, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 0, 0, 0, 3, 0, 1, 0, + 240, 0, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 0, 0, 0, 3, 0, 1, 0, + 244, 0, 0, 0, 2, 0, 1, 0, + 99, 112, 117, 78, 117, 109, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 115, 101, 114, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 105, 99, 101, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 121, 115, 116, 101, 109, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 100, 108, 101, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 111, 119, 97, 105, 116, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 114, 113, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 111, 102, 116, 105, 114, 113, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_f189c8c5bf2ce087 = b_f189c8c5bf2ce087.words; +#if !CAPNP_LITE +static const uint16_t m_f189c8c5bf2ce087[] = {0, 4, 5, 6, 2, 7, 3, 1}; +static const uint16_t i_f189c8c5bf2ce087[] = {0, 1, 2, 3, 4, 5, 6, 7}; +const ::capnp::_::RawSchema s_f189c8c5bf2ce087 = { + 0xf189c8c5bf2ce087, b_f189c8c5bf2ce087.words, 138, nullptr, m_f189c8c5bf2ce087, + 0, 8, i_f189c8c5bf2ce087, nullptr, nullptr, { &s_f189c8c5bf2ce087, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<139> b_fd095f94f08b3fd4 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 212, 63, 139, 240, 148, 95, 9, 253, + 18, 0, 0, 0, 1, 0, 8, 0, + 6, 20, 104, 63, 123, 56, 133, 175, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 178, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 199, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 80, 114, 111, 99, 76, 111, + 103, 46, 77, 101, 109, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 32, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 216, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 0, 0, 0, 3, 0, 1, 0, + 220, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 0, 0, 0, 3, 0, 1, 0, + 228, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 0, 0, 0, 3, 0, 1, 0, + 232, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 0, 0, 0, 3, 0, 1, 0, + 236, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 0, 0, 0, 3, 0, 1, 0, + 240, 0, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 0, 0, 0, 3, 0, 1, 0, + 248, 0, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 0, 0, 0, 3, 0, 1, 0, + 252, 0, 0, 0, 2, 0, 1, 0, + 116, 111, 116, 97, 108, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 101, 101, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 118, 97, 105, 108, 97, 98, 108, + 101, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 117, 102, 102, 101, 114, 115, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 99, 104, 101, 100, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 116, 105, 118, 101, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 97, 99, 116, 105, 118, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 104, 97, 114, 101, 100, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_fd095f94f08b3fd4 = b_fd095f94f08b3fd4.words; +#if !CAPNP_LITE +static const uint16_t m_fd095f94f08b3fd4[] = {5, 2, 3, 4, 1, 6, 7, 0}; +static const uint16_t i_fd095f94f08b3fd4[] = {0, 1, 2, 3, 4, 5, 6, 7}; +const ::capnp::_::RawSchema s_fd095f94f08b3fd4 = { + 0xfd095f94f08b3fd4, b_fd095f94f08b3fd4.words, 139, nullptr, m_fd095f94f08b3fd4, + 0, 8, i_fd095f94f08b3fd4, nullptr, nullptr, { &s_fd095f94f08b3fd4, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<119> b_85dddd7ce6cefa5d = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 93, 250, 206, 230, 124, 221, 221, 133, + 10, 0, 0, 0, 1, 0, 1, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 1, 0, 7, 0, 0, 0, 5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 162, 0, 0, 0, + 29, 0, 0, 0, 87, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 31, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 85, 98, 108, 111, 120, 71, + 110, 115, 115, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 1, 0, 1, 0, + 244, 32, 152, 162, 70, 165, 59, 167, + 33, 0, 0, 0, 146, 0, 0, 0, + 92, 248, 24, 129, 120, 140, 65, 216, + 37, 0, 0, 0, 82, 0, 0, 0, + 38, 74, 154, 81, 222, 168, 163, 195, + 37, 0, 0, 0, 74, 0, 0, 0, + 168, 90, 39, 20, 177, 54, 176, 235, + 37, 0, 0, 0, 74, 0, 0, 0, + 198, 83, 14, 185, 16, 180, 25, 249, + 37, 0, 0, 0, 82, 0, 0, 0, + 77, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 82, 101, 112, 111, 114, + 116, 0, 0, 0, 0, 0, 0, 0, + 69, 112, 104, 101, 109, 101, 114, 105, + 115, 0, 0, 0, 0, 0, 0, 0, + 73, 111, 110, 111, 68, 97, 116, 97, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 119, 83, 116, 97, 116, 117, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 119, 83, 116, 97, 116, 117, 115, + 50, 0, 0, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 255, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 3, 0, 1, 0, + 140, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 254, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 0, 0, 0, 3, 0, 1, 0, + 148, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 253, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 0, 0, 0, 3, 0, 1, 0, + 156, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 252, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 251, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 3, 0, 1, 0, + 172, 0, 0, 0, 2, 0, 1, 0, + 109, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 82, 101, 112, 111, 114, + 116, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 244, 32, 152, 162, 70, 165, 59, 167, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 112, 104, 101, 109, 101, 114, 105, + 115, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 92, 248, 24, 129, 120, 140, 65, 216, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 111, 110, 111, 68, 97, 116, 97, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 38, 74, 154, 81, 222, 168, 163, 195, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 119, 83, 116, 97, 116, 117, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 168, 90, 39, 20, 177, 54, 176, 235, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 119, 83, 116, 97, 116, 117, 115, + 50, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 198, 83, 14, 185, 16, 180, 25, 249, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_85dddd7ce6cefa5d = b_85dddd7ce6cefa5d.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_85dddd7ce6cefa5d[] = { + &s_a73ba546a29820f4, + &s_c3a3a8de519a4a26, + &s_d8418c788118f85c, + &s_ebb036b114275aa8, + &s_f919b410b90e53c6, +}; +static const uint16_t m_85dddd7ce6cefa5d[] = {1, 3, 4, 2, 0}; +static const uint16_t i_85dddd7ce6cefa5d[] = {0, 1, 2, 3, 4}; +const ::capnp::_::RawSchema s_85dddd7ce6cefa5d = { + 0x85dddd7ce6cefa5d, b_85dddd7ce6cefa5d.words, 119, d_85dddd7ce6cefa5d, m_85dddd7ce6cefa5d, + 5, 5, i_85dddd7ce6cefa5d, nullptr, nullptr, { &s_85dddd7ce6cefa5d, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<124> b_a73ba546a29820f4 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 244, 32, 152, 162, 70, 165, 59, 167, + 20, 0, 0, 0, 1, 0, 2, 0, + 93, 250, 206, 230, 124, 221, 221, 133, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 50, 1, 0, 0, + 37, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 0, 87, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 85, 98, 108, 111, 120, 71, + 110, 115, 115, 46, 77, 101, 97, 115, + 117, 114, 101, 109, 101, 110, 116, 82, + 101, 112, 111, 114, 116, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 182, 170, 96, 81, 214, 56, 184, 251, + 9, 0, 0, 0, 122, 0, 0, 0, + 1, 100, 50, 94, 95, 101, 138, 143, + 9, 0, 0, 0, 98, 0, 0, 0, + 82, 101, 99, 101, 105, 118, 101, 114, + 83, 116, 97, 116, 117, 115, 0, 0, + 77, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 0, 0, 0, 0, 0, + 24, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 0, 0, 0, 3, 0, 1, 0, + 160, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 3, 0, 1, 0, + 172, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 0, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 0, 0, 0, 3, 0, 1, 0, + 180, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 0, 0, 0, 3, 0, 1, 0, + 184, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 0, 0, 0, 3, 0, 1, 0, + 208, 0, 0, 0, 2, 0, 1, 0, + 114, 99, 118, 84, 111, 119, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 87, 101, 101, 107, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 97, 112, 83, 101, 99, 111, + 110, 100, 115, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 99, 101, 105, 118, 101, 114, + 83, 116, 97, 116, 117, 115, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 182, 170, 96, 81, 214, 56, 184, 251, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 117, 109, 77, 101, 97, 115, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 101, 97, 115, 117, 114, 101, 109, + 101, 110, 116, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 1, 100, 50, 94, 95, 101, 138, 143, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a73ba546a29820f4 = b_a73ba546a29820f4.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_a73ba546a29820f4[] = { + &s_8f8a655f5e326401, + &s_fbb838d65160aab6, +}; +static const uint16_t m_a73ba546a29820f4[] = {1, 2, 5, 4, 0, 3}; +static const uint16_t i_a73ba546a29820f4[] = {0, 1, 2, 3, 4, 5}; +const ::capnp::_::RawSchema s_a73ba546a29820f4 = { + 0xa73ba546a29820f4, b_a73ba546a29820f4.words, 124, d_a73ba546a29820f4, m_a73ba546a29820f4, + 2, 6, i_a73ba546a29820f4, nullptr, nullptr, { &s_a73ba546a29820f4, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<53> b_fbb838d65160aab6 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 182, 170, 96, 81, 214, 56, 184, 251, + 38, 0, 0, 0, 1, 0, 1, 0, + 244, 32, 152, 162, 70, 165, 59, 167, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 170, 1, 0, 0, + 45, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 85, 98, 108, 111, 120, 71, + 110, 115, 115, 46, 77, 101, 97, 115, + 117, 114, 101, 109, 101, 110, 116, 82, + 101, 112, 111, 114, 116, 46, 82, 101, + 99, 101, 105, 118, 101, 114, 83, 116, + 97, 116, 117, 115, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 0, 0, 0, 3, 0, 1, 0, + 60, 0, 0, 0, 2, 0, 1, 0, + 108, 101, 97, 112, 83, 101, 99, 86, + 97, 108, 105, 100, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 108, 107, 82, 101, 115, 101, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_fbb838d65160aab6 = b_fbb838d65160aab6.words; +#if !CAPNP_LITE +static const uint16_t m_fbb838d65160aab6[] = {1, 0}; +static const uint16_t i_fbb838d65160aab6[] = {0, 1}; +const ::capnp::_::RawSchema s_fbb838d65160aab6 = { + 0xfbb838d65160aab6, b_fbb838d65160aab6.words, 53, nullptr, m_fbb838d65160aab6, + 0, 2, i_fbb838d65160aab6, nullptr, nullptr, { &s_fbb838d65160aab6, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<231> b_8f8a655f5e326401 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 1, 100, 50, 94, 95, 101, 138, 143, + 38, 0, 0, 0, 1, 0, 5, 0, + 244, 32, 152, 162, 70, 165, 59, 167, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 146, 1, 0, 0, + 45, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 0, 0, 0, 223, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 85, 98, 108, 111, 120, 71, + 110, 115, 115, 46, 77, 101, 97, 115, + 117, 114, 101, 109, 101, 110, 116, 82, + 101, 112, 111, 114, 116, 46, 77, 101, + 97, 115, 117, 114, 101, 109, 101, 110, + 116, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 178, 153, 178, 2, 168, 179, 239, 232, + 1, 0, 0, 0, 122, 0, 0, 0, + 84, 114, 97, 99, 107, 105, 110, 103, + 83, 116, 97, 116, 117, 115, 0, 0, + 52, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 1, 0, 0, 3, 0, 1, 0, + 100, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 1, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 1, 0, 0, 3, 0, 1, 0, + 108, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 1, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 1, 0, 0, 3, 0, 1, 0, + 116, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 1, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 1, 0, 0, 3, 0, 1, 0, + 124, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 1, 0, 0, 3, 0, 1, 0, + 128, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 1, 0, 0, 3, 0, 1, 0, + 132, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 1, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 1, 0, 0, 3, 0, 1, 0, + 144, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 1, 0, 0, 3, 0, 1, 0, + 152, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 1, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 1, 0, 0, 3, 0, 1, 0, + 156, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 1, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 1, 0, 0, 3, 0, 1, 0, + 168, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 1, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 1, 0, 0, 3, 0, 1, 0, + 180, 1, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 1, 0, 0, 3, 0, 1, 0, + 188, 1, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 1, 0, 0, 3, 0, 1, 0, + 192, 1, 0, 0, 2, 0, 1, 0, + 115, 118, 73, 100, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 114, 97, 99, 107, 105, 110, 103, + 83, 116, 97, 116, 117, 115, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 178, 153, 178, 2, 168, 179, 239, 232, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 115, 101, 117, 100, 111, 114, 97, + 110, 103, 101, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 114, 105, 101, 114, 67, + 121, 99, 108, 101, 115, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 111, 112, 112, 108, 101, 114, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 110, 115, 115, 73, 100, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 108, 111, 110, 97, 115, 115, 70, + 114, 101, 113, 117, 101, 110, 99, 121, + 73, 110, 100, 101, 120, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 99, 107, 116, 105, 109, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 110, 111, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 115, 101, 117, 100, 111, 114, 97, + 110, 103, 101, 83, 116, 100, 101, 118, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 114, 105, 101, 114, 80, + 104, 97, 115, 101, 83, 116, 100, 101, + 118, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 111, 112, 112, 108, 101, 114, 83, + 116, 100, 101, 118, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 105, 103, 73, 100, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_8f8a655f5e326401 = b_8f8a655f5e326401.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_8f8a655f5e326401[] = { + &s_e8efb3a802b299b2, +}; +static const uint16_t m_8f8a655f5e326401[] = {3, 10, 8, 4, 11, 6, 5, 7, 2, 9, 12, 0, 1}; +static const uint16_t i_8f8a655f5e326401[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; +const ::capnp::_::RawSchema s_8f8a655f5e326401 = { + 0x8f8a655f5e326401, b_8f8a655f5e326401.words, 231, d_8f8a655f5e326401, m_8f8a655f5e326401, + 1, 13, i_8f8a655f5e326401, nullptr, nullptr, { &s_8f8a655f5e326401, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<90> b_e8efb3a802b299b2 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 178, 153, 178, 2, 168, 179, 239, 232, + 50, 0, 0, 0, 1, 0, 1, 0, + 1, 100, 50, 94, 95, 101, 138, 143, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 10, 2, 0, 0, + 53, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 85, 98, 108, 111, 120, 71, + 110, 115, 115, 46, 77, 101, 97, 115, + 117, 114, 101, 109, 101, 110, 116, 82, + 101, 112, 111, 114, 116, 46, 77, 101, + 97, 115, 117, 114, 101, 109, 101, 110, + 116, 46, 84, 114, 97, 99, 107, 105, + 110, 103, 83, 116, 97, 116, 117, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 0, 0, 0, 3, 0, 1, 0, + 112, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 0, 0, 0, 3, 0, 1, 0, + 124, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 0, 0, 0, 3, 0, 1, 0, + 132, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 0, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 0, 0, 0, 3, 0, 1, 0, + 144, 0, 0, 0, 2, 0, 1, 0, + 112, 115, 101, 117, 100, 111, 114, 97, + 110, 103, 101, 86, 97, 108, 105, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 114, 105, 101, 114, 80, + 104, 97, 115, 101, 86, 97, 108, 105, + 100, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 108, 102, 67, 121, 99, 108, + 101, 86, 97, 108, 105, 100, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 97, 108, 102, 67, 121, 99, 108, + 101, 83, 117, 98, 116, 114, 97, 99, + 116, 101, 100, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e8efb3a802b299b2 = b_e8efb3a802b299b2.words; +#if !CAPNP_LITE +static const uint16_t m_e8efb3a802b299b2[] = {1, 3, 2, 0}; +static const uint16_t i_e8efb3a802b299b2[] = {0, 1, 2, 3}; +const ::capnp::_::RawSchema s_e8efb3a802b299b2 = { + 0xe8efb3a802b299b2, b_e8efb3a802b299b2.words, 90, nullptr, m_e8efb3a802b299b2, + 0, 4, i_e8efb3a802b299b2, nullptr, nullptr, { &s_e8efb3a802b299b2, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<634> b_d8418c788118f85c = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 92, 248, 24, 129, 120, 140, 65, 216, + 20, 0, 0, 0, 1, 0, 33, 0, + 93, 250, 206, 230, 124, 221, 221, 133, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 242, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 199, 8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 85, 98, 108, 111, 120, 71, + 110, 115, 115, 46, 69, 112, 104, 101, + 109, 101, 114, 105, 115, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 160, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 4, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 4, 0, 0, 3, 0, 1, 0, + 88, 4, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 4, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 4, 0, 0, 3, 0, 1, 0, + 92, 4, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 4, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 4, 0, 0, 3, 0, 1, 0, + 96, 4, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 4, 0, 0, 3, 0, 1, 0, + 100, 4, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 4, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 4, 0, 0, 3, 0, 1, 0, + 104, 4, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 4, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 4, 0, 0, 3, 0, 1, 0, + 108, 4, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 4, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 4, 0, 0, 3, 0, 1, 0, + 112, 4, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 4, 0, 0, 3, 0, 1, 0, + 116, 4, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 4, 0, 0, 3, 0, 1, 0, + 120, 4, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 4, 0, 0, 3, 0, 1, 0, + 124, 4, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 4, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 4, 0, 0, 3, 0, 1, 0, + 128, 4, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 4, 0, 0, 3, 0, 1, 0, + 132, 4, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 4, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 4, 0, 0, 3, 0, 1, 0, + 136, 4, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 4, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 4, 0, 0, 3, 0, 1, 0, + 140, 4, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 4, 0, 0, 3, 0, 1, 0, + 144, 4, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 4, 0, 0, 3, 0, 1, 0, + 148, 4, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 4, 0, 0, 3, 0, 1, 0, + 152, 4, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 4, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 4, 0, 0, 3, 0, 1, 0, + 156, 4, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 4, 0, 0, 3, 0, 1, 0, + 160, 4, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 4, 0, 0, 3, 0, 1, 0, + 164, 4, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 4, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 4, 0, 0, 3, 0, 1, 0, + 168, 4, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 4, 0, 0, 3, 0, 1, 0, + 172, 4, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 4, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 4, 0, 0, 3, 0, 1, 0, + 176, 4, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 4, 0, 0, 3, 0, 1, 0, + 180, 4, 0, 0, 2, 0, 1, 0, + 24, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 4, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 4, 0, 0, 3, 0, 1, 0, + 184, 4, 0, 0, 2, 0, 1, 0, + 25, 0, 0, 0, 20, 0, 0, 0, + 0, 0, 1, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 4, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 4, 0, 0, 3, 0, 1, 0, + 192, 4, 0, 0, 2, 0, 1, 0, + 26, 0, 0, 0, 21, 0, 0, 0, + 0, 0, 1, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 4, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 4, 0, 0, 3, 0, 1, 0, + 196, 4, 0, 0, 2, 0, 1, 0, + 27, 0, 0, 0, 22, 0, 0, 0, + 0, 0, 1, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 4, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 4, 0, 0, 3, 0, 1, 0, + 200, 4, 0, 0, 2, 0, 1, 0, + 28, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 1, 0, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 4, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 4, 0, 0, 3, 0, 1, 0, + 204, 4, 0, 0, 2, 0, 1, 0, + 29, 0, 0, 0, 24, 0, 0, 0, + 0, 0, 1, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 4, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 4, 0, 0, 3, 0, 1, 0, + 208, 4, 0, 0, 2, 0, 1, 0, + 30, 0, 0, 0, 25, 0, 0, 0, + 0, 0, 1, 0, 30, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 4, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 4, 0, 0, 3, 0, 1, 0, + 212, 4, 0, 0, 2, 0, 1, 0, + 31, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 1, 0, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 4, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 4, 0, 0, 3, 0, 1, 0, + 220, 4, 0, 0, 2, 0, 1, 0, + 32, 0, 0, 0, 27, 0, 0, 0, + 0, 0, 1, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 4, 0, 0, 3, 0, 1, 0, + 224, 4, 0, 0, 2, 0, 1, 0, + 33, 0, 0, 0, 28, 0, 0, 0, + 0, 0, 1, 0, 33, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 4, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 4, 0, 0, 3, 0, 1, 0, + 228, 4, 0, 0, 2, 0, 1, 0, + 34, 0, 0, 0, 29, 0, 0, 0, + 0, 0, 1, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 4, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 4, 0, 0, 3, 0, 1, 0, + 240, 4, 0, 0, 2, 0, 1, 0, + 35, 0, 0, 0, 30, 0, 0, 0, + 0, 0, 1, 0, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 4, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 4, 0, 0, 3, 0, 1, 0, + 248, 4, 0, 0, 2, 0, 1, 0, + 36, 0, 0, 0, 31, 0, 0, 0, + 0, 0, 1, 0, 36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 4, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 4, 0, 0, 3, 0, 1, 0, + 252, 4, 0, 0, 2, 0, 1, 0, + 37, 0, 0, 0, 0, 8, 0, 0, + 0, 0, 1, 0, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 4, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 4, 0, 0, 3, 0, 1, 0, + 4, 5, 0, 0, 2, 0, 1, 0, + 38, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 38, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 5, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 5, 0, 0, 3, 0, 1, 0, + 28, 5, 0, 0, 2, 0, 1, 0, + 39, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 5, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 5, 0, 0, 3, 0, 1, 0, + 52, 5, 0, 0, 2, 0, 1, 0, + 115, 118, 73, 100, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 101, 97, 114, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 110, 116, 104, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 97, 121, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 111, 117, 114, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 105, 110, 117, 116, 101, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 99, 111, 110, 100, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 102, 48, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 102, 49, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 102, 50, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 111, 100, 101, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 114, 115, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 108, 116, 97, 78, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 48, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 99, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 99, 99, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 115, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 111, 101, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 105, 99, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 109, 101, 103, 97, 48, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 105, 115, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 48, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 114, 99, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 109, 101, 103, 97, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 109, 101, 103, 97, 68, 111, 116, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 68, 111, 116, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 100, 101, 115, 76, 50, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 87, 101, 101, 107, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 50, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 118, 65, 99, 99, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 118, 72, 101, 97, 108, 116, 104, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 103, 100, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 111, 100, 99, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 114, 97, 110, 115, 109, 105, 115, + 115, 105, 111, 110, 84, 105, 109, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 105, 116, 73, 110, 116, 101, 114, + 118, 97, 108, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 111, 99, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 111, 110, 111, 67, 111, 101, 102, + 102, 115, 86, 97, 108, 105, 100, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 111, 110, 111, 65, 108, 112, 104, + 97, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 111, 110, 111, 66, 101, 116, 97, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d8418c788118f85c = b_d8418c788118f85c.words; +#if !CAPNP_LITE +static const uint16_t m_d8418c788118f85c[] = {17, 7, 8, 9, 19, 21, 27, 23, 11, 14, 16, 3, 12, 15, 35, 28, 4, 22, 26, 33, 10, 38, 39, 37, 29, 13, 5, 2, 24, 20, 25, 6, 30, 31, 0, 32, 36, 18, 34, 1}; +static const uint16_t i_d8418c788118f85c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39}; +const ::capnp::_::RawSchema s_d8418c788118f85c = { + 0xd8418c788118f85c, b_d8418c788118f85c.words, 634, nullptr, m_d8418c788118f85c, + 0, 40, i_d8418c788118f85c, nullptr, nullptr, { &s_d8418c788118f85c, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<136> b_c3a3a8de519a4a26 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 38, 74, 154, 81, 222, 168, 163, 195, + 20, 0, 0, 0, 1, 0, 3, 0, + 93, 250, 206, 230, 124, 221, 221, 133, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 234, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 143, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 85, 98, 108, 111, 120, 71, + 110, 115, 115, 46, 73, 111, 110, 111, + 68, 97, 116, 97, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 0, 0, 0, 3, 0, 1, 0, + 192, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 0, 0, 0, 3, 0, 1, 0, + 196, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 3, 0, 1, 0, + 200, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 0, 0, 0, 3, 0, 1, 0, + 224, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 0, 0, 0, 3, 0, 1, 0, + 248, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 32, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 0, 0, 0, 3, 0, 1, 0, + 0, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 33, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 0, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 0, 0, 0, 3, 0, 1, 0, + 8, 1, 0, 0, 2, 0, 1, 0, + 115, 118, 72, 101, 97, 108, 116, 104, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 111, 119, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 87, 101, 101, 107, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 111, 110, 111, 65, 108, 112, 104, + 97, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 111, 110, 111, 66, 101, 116, 97, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 101, 97, 108, 116, 104, 86, 97, + 108, 105, 100, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 111, 110, 111, 67, 111, 101, 102, + 102, 115, 86, 97, 108, 105, 100, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_c3a3a8de519a4a26 = b_c3a3a8de519a4a26.words; +#if !CAPNP_LITE +static const uint16_t m_c3a3a8de519a4a26[] = {2, 5, 3, 4, 6, 0, 1}; +static const uint16_t i_c3a3a8de519a4a26[] = {0, 1, 2, 3, 4, 5, 6}; +const ::capnp::_::RawSchema s_c3a3a8de519a4a26 = { + 0xc3a3a8de519a4a26, b_c3a3a8de519a4a26.words, 136, nullptr, m_c3a3a8de519a4a26, + 0, 7, i_c3a3a8de519a4a26, nullptr, nullptr, { &s_c3a3a8de519a4a26, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<119> b_ebb036b114275aa8 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 168, 90, 39, 20, 177, 54, 176, 235, + 20, 0, 0, 0, 1, 0, 2, 0, + 93, 250, 206, 230, 124, 221, 221, 133, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 234, 0, 0, 0, + 33, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 87, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 85, 98, 108, 111, 120, 71, + 110, 115, 115, 46, 72, 119, 83, 116, + 97, 116, 117, 115, 0, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 83, 91, 77, 171, 40, 17, 62, 194, + 9, 0, 0, 0, 186, 0, 0, 0, + 89, 101, 228, 36, 169, 81, 59, 254, + 13, 0, 0, 0, 154, 0, 0, 0, + 65, 110, 116, 101, 110, 110, 97, 83, + 117, 112, 101, 114, 118, 105, 115, 111, + 114, 83, 116, 97, 116, 101, 0, 0, + 65, 110, 116, 101, 110, 110, 97, 80, + 111, 119, 101, 114, 83, 116, 97, 116, + 117, 115, 0, 0, 0, 0, 0, 0, + 24, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 0, 0, 0, 3, 0, 1, 0, + 168, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 3, 0, 1, 0, + 172, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 0, 0, 0, 3, 0, 1, 0, + 176, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 0, 0, 0, 3, 0, 1, 0, + 180, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 0, 0, 0, 3, 0, 1, 0, + 184, 0, 0, 0, 2, 0, 1, 0, + 110, 111, 105, 115, 101, 80, 101, 114, + 77, 83, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 103, 99, 67, 110, 116, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 83, 116, 97, 116, 117, 115, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 83, 91, 77, 171, 40, 17, 62, 194, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 80, 111, 119, 101, 114, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 89, 101, 228, 36, 169, 81, 59, 254, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 106, 97, 109, 73, 110, 100, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 108, 97, 103, 115, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_ebb036b114275aa8 = b_ebb036b114275aa8.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_ebb036b114275aa8[] = { + &s_c23e1128ab4d5b53, + &s_fe3b51a924e46559, +}; +static const uint16_t m_ebb036b114275aa8[] = {3, 2, 1, 5, 4, 0}; +static const uint16_t i_ebb036b114275aa8[] = {0, 1, 2, 3, 4, 5}; +const ::capnp::_::RawSchema s_ebb036b114275aa8 = { + 0xebb036b114275aa8, b_ebb036b114275aa8.words, 119, d_ebb036b114275aa8, m_ebb036b114275aa8, + 2, 6, i_ebb036b114275aa8, nullptr, nullptr, { &s_ebb036b114275aa8, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<42> b_c23e1128ab4d5b53 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 83, 91, 77, 171, 40, 17, 62, 194, + 29, 0, 0, 0, 2, 0, 0, 0, + 168, 90, 39, 20, 177, 54, 176, 235, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 162, 1, 0, 0, + 45, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 127, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 85, 98, 108, 111, 120, 71, + 110, 115, 115, 46, 72, 119, 83, 116, + 97, 116, 117, 115, 46, 65, 110, 116, + 101, 110, 110, 97, 83, 117, 112, 101, + 114, 118, 105, 115, 111, 114, 83, 116, + 97, 116, 101, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 105, 116, 0, 0, 0, 0, + 100, 111, 110, 116, 107, 110, 111, 119, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 107, 0, 0, 0, 0, 0, 0, + 115, 104, 111, 114, 116, 0, 0, 0, + 111, 112, 101, 110, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_c23e1128ab4d5b53 = b_c23e1128ab4d5b53.words; +#if !CAPNP_LITE +static const uint16_t m_c23e1128ab4d5b53[] = {1, 0, 2, 4, 3}; +const ::capnp::_::RawSchema s_c23e1128ab4d5b53 = { + 0xc23e1128ab4d5b53, b_c23e1128ab4d5b53.words, 42, nullptr, m_c23e1128ab4d5b53, + 0, 5, nullptr, nullptr, nullptr, { &s_c23e1128ab4d5b53, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(AntennaSupervisorState_c23e1128ab4d5b53, c23e1128ab4d5b53); +static const ::capnp::_::AlignedData<33> b_fe3b51a924e46559 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 89, 101, 228, 36, 169, 81, 59, 254, + 29, 0, 0, 0, 2, 0, 0, 0, + 168, 90, 39, 20, 177, 54, 176, 235, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 130, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 79, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 85, 98, 108, 111, 120, 71, + 110, 115, 115, 46, 72, 119, 83, 116, + 97, 116, 117, 115, 46, 65, 110, 116, + 101, 110, 110, 97, 80, 111, 119, 101, + 114, 83, 116, 97, 116, 117, 115, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 102, 102, 0, 0, 0, 0, 0, + 111, 110, 0, 0, 0, 0, 0, 0, + 100, 111, 110, 116, 107, 110, 111, 119, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_fe3b51a924e46559 = b_fe3b51a924e46559.words; +#if !CAPNP_LITE +static const uint16_t m_fe3b51a924e46559[] = {2, 0, 1}; +const ::capnp::_::RawSchema s_fe3b51a924e46559 = { + 0xfe3b51a924e46559, b_fe3b51a924e46559.words, 33, nullptr, m_fe3b51a924e46559, + 0, 3, nullptr, nullptr, nullptr, { &s_fe3b51a924e46559, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(AntennaPowerStatus_fe3b51a924e46559, fe3b51a924e46559); +static const ::capnp::_::AlignedData<130> b_f919b410b90e53c6 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 198, 83, 14, 185, 16, 180, 25, 249, + 20, 0, 0, 0, 1, 0, 2, 0, + 93, 250, 206, 230, 124, 221, 221, 133, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 242, 0, 0, 0, + 33, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 143, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 85, 98, 108, 111, 120, 71, + 110, 115, 115, 46, 72, 119, 83, 116, + 97, 116, 117, 115, 50, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 185, 151, 28, 181, 94, 152, 208, 178, + 1, 0, 0, 0, 106, 0, 0, 0, + 67, 111, 110, 102, 105, 103, 83, 111, + 117, 114, 99, 101, 0, 0, 0, 0, + 28, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 3, 0, 1, 0, + 188, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 0, 0, 0, 3, 0, 1, 0, + 192, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 0, 0, 0, 3, 0, 1, 0, + 196, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 3, 0, 1, 0, + 200, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 0, 0, 0, 3, 0, 1, 0, + 208, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 216, 0, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 0, 0, 0, 3, 0, 1, 0, + 224, 0, 0, 0, 2, 0, 1, 0, + 111, 102, 115, 73, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 103, 73, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 102, 115, 81, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 103, 81, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 102, 103, 83, 111, 117, 114, 99, + 101, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 185, 151, 28, 181, 94, 152, 208, 178, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 119, 76, 101, 118, 67, 102, + 103, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 116, 83, 116, 97, 116, + 117, 115, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_f919b410b90e53c6 = b_f919b410b90e53c6.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_f919b410b90e53c6[] = { + &s_b2d0985eb51c97b9, +}; +static const uint16_t m_f919b410b90e53c6[] = {4, 5, 1, 3, 0, 2, 6}; +static const uint16_t i_f919b410b90e53c6[] = {0, 1, 2, 3, 4, 5, 6}; +const ::capnp::_::RawSchema s_f919b410b90e53c6 = { + 0xf919b410b90e53c6, b_f919b410b90e53c6.words, 130, d_f919b410b90e53c6, m_f919b410b90e53c6, + 1, 7, i_f919b410b90e53c6, nullptr, nullptr, { &s_f919b410b90e53c6, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<42> b_b2d0985eb51c97b9 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 185, 151, 28, 181, 94, 152, 208, 178, + 30, 0, 0, 0, 2, 0, 0, 0, + 198, 83, 14, 185, 16, 180, 25, 249, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 90, 1, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 127, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 85, 98, 108, 111, 120, 71, + 110, 115, 115, 46, 72, 119, 83, 116, + 97, 116, 117, 115, 50, 46, 67, 111, + 110, 102, 105, 103, 83, 111, 117, 114, + 99, 101, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 110, 100, 101, 102, 105, 110, 101, + 100, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 109, 0, 0, 0, 0, 0, + 111, 116, 112, 0, 0, 0, 0, 0, + 99, 111, 110, 102, 105, 103, 112, 105, + 110, 115, 0, 0, 0, 0, 0, 0, + 102, 108, 97, 115, 104, 0, 0, 0, } +}; +::capnp::word const* const bp_b2d0985eb51c97b9 = b_b2d0985eb51c97b9.words; +#if !CAPNP_LITE +static const uint16_t m_b2d0985eb51c97b9[] = {3, 4, 2, 1, 0}; +const ::capnp::_::RawSchema s_b2d0985eb51c97b9 = { + 0xb2d0985eb51c97b9, b_b2d0985eb51c97b9.words, 42, nullptr, m_b2d0985eb51c97b9, + 0, 5, nullptr, nullptr, nullptr, { &s_b2d0985eb51c97b9, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(ConfigSource_b2d0985eb51c97b9, b2d0985eb51c97b9); +static const ::capnp::_::AlignedData<99> b_c95fb49a7bdc4618 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 24, 70, 220, 123, 154, 180, 95, 201, + 10, 0, 0, 0, 1, 0, 5, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 138, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 31, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 67, 108, 111, 99, 107, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 3, 0, 1, 0, + 136, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 0, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 0, 0, 0, 3, 0, 1, 0, + 144, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 0, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 0, 0, 0, 3, 0, 1, 0, + 156, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 0, 0, 0, 3, 0, 1, 0, + 176, 0, 0, 0, 2, 0, 1, 0, + 98, 111, 111, 116, 84, 105, 109, 101, + 78, 97, 110, 111, 115, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 110, 111, 116, 111, 110, 105, + 99, 78, 97, 110, 111, 115, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 110, 111, 116, 111, 110, 105, + 99, 82, 97, 119, 78, 97, 110, 111, + 115, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 119, 97, 108, 108, 84, 105, 109, 101, + 78, 97, 110, 111, 115, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 100, 101, 109, 85, 112, 116, + 105, 109, 101, 77, 105, 108, 108, 105, + 115, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_c95fb49a7bdc4618 = b_c95fb49a7bdc4618.words; +#if !CAPNP_LITE +static const uint16_t m_c95fb49a7bdc4618[] = {0, 4, 1, 2, 3}; +static const uint16_t i_c95fb49a7bdc4618[] = {0, 1, 2, 3, 4}; +const ::capnp::_::RawSchema s_c95fb49a7bdc4618 = { + 0xc95fb49a7bdc4618, b_c95fb49a7bdc4618.words, 99, nullptr, m_c95fb49a7bdc4618, + 0, 5, i_c95fb49a7bdc4618, nullptr, nullptr, { &s_c95fb49a7bdc4618, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<141> b_92a5e332a85f32a0 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 160, 50, 95, 168, 50, 227, 165, 146, + 10, 0, 0, 0, 1, 0, 3, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 4, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 178, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 143, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 105, 118, 101, 77, 112, + 99, 68, 97, 116, 97, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 3, 0, 1, 0, + 204, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 0, 0, 0, 3, 0, 1, 0, + 224, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 0, 0, 0, 3, 0, 1, 0, + 244, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 0, 0, 0, 3, 0, 1, 0, + 12, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 1, 0, 0, 3, 0, 1, 0, + 20, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 1, 0, 0, 3, 0, 1, 0, + 28, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 1, 0, 0, 3, 0, 1, 0, + 32, 1, 0, 0, 2, 0, 1, 0, + 120, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 115, 105, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 114, 118, 97, 116, 117, 114, + 101, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 112, 73, 116, 101, 114, 97, 116, + 105, 111, 110, 115, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 108, 99, 117, 108, 97, 116, + 105, 111, 110, 84, 105, 109, 101, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 115, 116, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_92a5e332a85f32a0 = b_92a5e332a85f32a0.words; +#if !CAPNP_LITE +static const uint16_t m_92a5e332a85f32a0[] = {5, 6, 3, 2, 4, 0, 1}; +static const uint16_t i_92a5e332a85f32a0[] = {0, 1, 2, 3, 4, 5, 6}; +const ::capnp::_::RawSchema s_92a5e332a85f32a0 = { + 0x92a5e332a85f32a0, b_92a5e332a85f32a0.words, 141, nullptr, m_92a5e332a85f32a0, + 0, 7, i_92a5e332a85f32a0, nullptr, nullptr, { &s_92a5e332a85f32a0, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<211> b_e7e17c434f865ae2 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 226, 90, 134, 79, 67, 124, 225, 231, + 10, 0, 0, 0, 1, 0, 4, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 6, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 18, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 111, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 105, 118, 101, 76, 111, + 110, 103, 105, 116, 117, 100, 105, 110, + 97, 108, 77, 112, 99, 68, 97, 116, + 97, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 44, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 1, 0, 0, 3, 0, 1, 0, + 60, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 1, 0, 0, 3, 0, 1, 0, + 80, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 1, 0, 0, 3, 0, 1, 0, + 100, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 1, 0, 0, 3, 0, 1, 0, + 120, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 1, 0, 0, 3, 0, 1, 0, + 140, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 1, 0, 0, 3, 0, 1, 0, + 160, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 1, 0, 0, 3, 0, 1, 0, + 168, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 1, 0, 0, 3, 0, 1, 0, + 176, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 1, 0, 0, 3, 0, 1, 0, + 180, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 1, 0, 0, 3, 0, 1, 0, + 188, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 1, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 1, 0, 0, 3, 0, 1, 0, + 192, 1, 0, 0, 2, 0, 1, 0, + 120, 69, 103, 111, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 69, 103, 111, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 69, 103, 111, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 76, 101, 97, 100, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 76, 101, 97, 100, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 76, 101, 97, 100, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 76, 101, 97, 100, 84, 97, 117, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 112, 73, 116, 101, 114, 97, 116, + 105, 111, 110, 115, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 112, 99, 73, 100, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 108, 99, 117, 108, 97, 116, + 105, 111, 110, 84, 105, 109, 101, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 115, 116, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e7e17c434f865ae2 = b_e7e17c434f865ae2.words; +#if !CAPNP_LITE +static const uint16_t m_e7e17c434f865ae2[] = {2, 5, 6, 9, 10, 8, 7, 1, 4, 0, 3}; +static const uint16_t i_e7e17c434f865ae2[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; +const ::capnp::_::RawSchema s_e7e17c434f865ae2 = { + 0xe7e17c434f865ae2, b_e7e17c434f865ae2.words, 211, nullptr, m_e7e17c434f865ae2, + 0, 11, i_e7e17c434f865ae2, nullptr, nullptr, { &s_e7e17c434f865ae2, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<55> b_e42401658e2715e2 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 226, 21, 39, 142, 101, 1, 36, 228, + 10, 0, 0, 0, 1, 0, 0, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 154, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 74, 111, 121, 115, 116, 105, + 99, 107, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 1, 0, + 64, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 0, 0, 0, 3, 0, 1, 0, + 84, 0, 0, 0, 2, 0, 1, 0, + 97, 120, 101, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 117, 116, 116, 111, 110, 115, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_e42401658e2715e2 = b_e42401658e2715e2.words; +#if !CAPNP_LITE +static const uint16_t m_e42401658e2715e2[] = {0, 1}; +static const uint16_t i_e42401658e2715e2[] = {0, 1}; +const ::capnp::_::RawSchema s_e42401658e2715e2 = { + 0xe42401658e2715e2, b_e42401658e2715e2.words, 55, nullptr, m_e42401658e2715e2, + 0, 2, i_e42401658e2715e2, nullptr, nullptr, { &s_e42401658e2715e2, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<424> b_b83c6cc593ed0a00 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 0, 10, 237, 147, 197, 108, 60, 184, + 10, 0, 0, 0, 1, 0, 9, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 6, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 178, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 71, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 68, 114, 105, 118, 101, 114, + 83, 116, 97, 116, 101, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 96, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 2, 0, 0, 3, 0, 1, 0, + 152, 2, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 2, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 2, 0, 0, 3, 0, 1, 0, + 180, 2, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 2, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 2, 0, 0, 3, 0, 1, 0, + 188, 2, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 2, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 2, 0, 0, 3, 0, 1, 0, + 212, 2, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 2, 0, 0, 3, 0, 1, 0, + 236, 2, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 2, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 2, 0, 0, 3, 0, 1, 0, + 244, 2, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 2, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 2, 0, 0, 3, 0, 1, 0, + 252, 2, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 2, 0, 0, 3, 0, 1, 0, + 4, 3, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 3, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 3, 0, 1, 0, + 12, 3, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 3, 0, 0, 3, 0, 1, 0, + 20, 3, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 3, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 3, 0, 0, 3, 0, 1, 0, + 28, 3, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 3, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 3, 0, 0, 3, 0, 1, 0, + 56, 3, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 3, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 3, 0, 0, 3, 0, 1, 0, + 80, 3, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 3, 0, 0, 3, 0, 1, 0, + 88, 3, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 3, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 3, 0, 0, 3, 0, 1, 0, + 100, 3, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 3, 0, 0, 3, 0, 1, 0, + 108, 3, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 3, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 3, 0, 0, 3, 0, 1, 0, + 120, 3, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 3, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 3, 0, 0, 3, 0, 1, 0, + 128, 3, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 3, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 3, 0, 0, 3, 0, 1, 0, + 136, 3, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 3, 0, 0, 3, 0, 1, 0, + 144, 3, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 3, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 3, 0, 0, 3, 0, 1, 0, + 152, 3, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 3, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 3, 0, 0, 3, 0, 1, 0, + 160, 3, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 3, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 3, 0, 0, 3, 0, 1, 0, + 168, 3, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 3, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 3, 0, 0, 3, 0, 1, 0, + 176, 3, 0, 0, 2, 0, 1, 0, + 102, 114, 97, 109, 101, 73, 100, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 115, 99, 114, 105, 112, 116, + 111, 114, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 100, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 97, 99, 101, 79, 114, 105, 101, + 110, 116, 97, 116, 105, 111, 110, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 97, 99, 101, 80, 111, 115, 105, + 116, 105, 111, 110, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 97, 99, 101, 80, 114, 111, 98, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 102, 116, 69, 121, 101, 80, + 114, 111, 98, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 105, 103, 104, 116, 69, 121, 101, + 80, 114, 111, 98, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 101, 102, 116, 66, 108, 105, 110, + 107, 80, 114, 111, 98, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 105, 103, 104, 116, 66, 108, 105, + 110, 107, 80, 114, 111, 98, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 114, 80, 119, 114, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 97, 99, 101, 79, 114, 105, 101, + 110, 116, 97, 116, 105, 111, 110, 83, + 116, 100, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 97, 99, 101, 80, 111, 115, 105, + 116, 105, 111, 110, 83, 116, 100, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 117, 110, 103, 108, 97, 115, 115, + 101, 115, 80, 114, 111, 98, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 100, 101, 108, 69, 120, 101, + 99, 117, 116, 105, 111, 110, 84, 105, + 109, 101, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 119, 80, 114, 101, 100, 105, + 99, 116, 105, 111, 110, 115, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 115, 112, 69, 120, 101, 99, 117, + 116, 105, 111, 110, 84, 105, 109, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 111, 114, 86, 105, 115, 105, + 111, 110, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 114, 116, 105, 97, 108, 70, + 97, 99, 101, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 115, 116, 114, 97, 99, 116, + 101, 100, 80, 111, 115, 101, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 115, 116, 114, 97, 99, 116, + 101, 100, 69, 121, 101, 115, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 121, 101, 115, 79, 110, 82, 111, + 97, 100, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 104, 111, 110, 101, 85, 115, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 99, 99, 108, 117, 100, 101, 100, + 80, 114, 111, 98, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_b83c6cc593ed0a00 = b_b83c6cc593ed0a00.words; +#if !CAPNP_LITE +static const uint16_t m_b83c6cc593ed0a00[] = {1, 20, 19, 16, 21, 3, 11, 4, 12, 5, 0, 10, 8, 6, 14, 23, 18, 22, 17, 15, 9, 7, 2, 13}; +static const uint16_t i_b83c6cc593ed0a00[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}; +const ::capnp::_::RawSchema s_b83c6cc593ed0a00 = { + 0xb83c6cc593ed0a00, b_b83c6cc593ed0a00.words, 424, nullptr, m_b83c6cc593ed0a00, + 0, 24, i_b83c6cc593ed0a00, nullptr, nullptr, { &s_b83c6cc593ed0a00, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<298> b_b83cda094a1da284 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 132, 162, 29, 74, 9, 218, 60, 184, + 10, 0, 0, 0, 1, 0, 5, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 2, 1, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 191, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 68, 114, 105, 118, 101, 114, + 77, 111, 110, 105, 116, 111, 114, 105, + 110, 103, 83, 116, 97, 116, 101, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 68, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 1, 0, 0, 3, 0, 1, 0, + 228, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 224, 1, 0, 0, 3, 0, 1, 0, + 236, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 1, 0, 0, 3, 0, 1, 0, + 244, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 1, 0, 0, 3, 0, 1, 0, + 252, 1, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 1, 0, 0, 3, 0, 1, 0, + 4, 2, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 2, 0, 0, 3, 0, 1, 0, + 16, 2, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 2, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 2, 0, 0, 3, 0, 1, 0, + 24, 2, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 2, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 2, 0, 0, 3, 0, 1, 0, + 36, 2, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 2, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 2, 0, 0, 3, 0, 1, 0, + 44, 2, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 2, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 2, 0, 0, 3, 0, 1, 0, + 56, 2, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 2, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 2, 0, 0, 3, 0, 1, 0, + 64, 2, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 2, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 2, 0, 0, 3, 0, 1, 0, + 72, 2, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 2, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 2, 0, 0, 3, 0, 1, 0, + 84, 2, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 2, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 2, 0, 0, 3, 0, 1, 0, + 92, 2, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 2, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 2, 0, 0, 3, 0, 1, 0, + 100, 2, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 2, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 2, 0, 0, 3, 0, 1, 0, + 112, 2, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 2, 0, 0, 3, 0, 1, 0, + 120, 2, 0, 0, 2, 0, 1, 0, + 101, 118, 101, 110, 116, 115, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 211, 58, 175, 76, 243, 87, 22, 155, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 97, 99, 101, 68, 101, 116, 101, + 99, 116, 101, 100, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 115, 68, 105, 115, 116, 114, 97, + 99, 116, 101, 100, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 119, 97, 114, 101, 110, 101, 115, + 115, 83, 116, 97, 116, 117, 115, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 115, 82, 72, 68, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 104, 100, 67, 104, 101, 99, 107, + 101, 100, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 101, 80, 105, 116, 99, + 104, 79, 102, 102, 115, 101, 116, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 101, 80, 105, 116, 99, + 104, 86, 97, 108, 105, 100, 67, 111, + 117, 110, 116, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 101, 89, 97, 119, 79, + 102, 102, 115, 101, 116, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 101, 89, 97, 119, 86, + 97, 108, 105, 100, 67, 111, 117, 110, + 116, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 112, 67, 104, 97, 110, + 103, 101, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 119, 97, 114, 101, 110, 101, 115, + 115, 65, 99, 116, 105, 118, 101, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 119, 97, 114, 101, 110, 101, 115, + 115, 80, 97, 115, 115, 105, 118, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 115, 76, 111, 119, 83, 116, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 105, 83, 116, 100, 67, 111, 117, + 110, 116, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 115, 80, 114, 101, 118, 105, 101, + 119, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 115, 65, 99, 116, 105, 118, 101, + 77, 111, 100, 101, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_b83cda094a1da284 = b_b83cda094a1da284.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_b83cda094a1da284[] = { + &s_9b1657f34caf3ad3, +}; +static const uint16_t m_b83cda094a1da284[] = {11, 12, 3, 0, 1, 14, 16, 2, 13, 15, 4, 6, 7, 8, 9, 5, 10}; +static const uint16_t i_b83cda094a1da284[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; +const ::capnp::_::RawSchema s_b83cda094a1da284 = { + 0xb83cda094a1da284, b_b83cda094a1da284.words, 298, d_b83cda094a1da284, m_b83cda094a1da284, + 1, 17, i_b83cda094a1da284, nullptr, nullptr, { &s_b83cda094a1da284, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<149> b_a12e8670927a2549 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 73, 37, 122, 146, 112, 134, 46, 161, + 10, 0, 0, 0, 1, 0, 1, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 5, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 122, 0, 0, 0, + 25, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 87, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 66, 111, 111, 116, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 24, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 0, 0, 0, 3, 0, 1, 0, + 164, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 0, 0, 0, 3, 0, 1, 0, + 176, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 0, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 3, 0, 1, 0, + 188, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 0, 0, 0, 3, 0, 1, 0, + 196, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 3, 0, 1, 0, + 16, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 1, 0, 0, 3, 0, 1, 0, + 96, 1, 0, 0, 2, 0, 1, 0, + 119, 97, 108, 108, 84, 105, 109, 101, + 78, 97, 110, 111, 115, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 115, 116, 75, 109, 115, 103, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 115, 116, 80, 109, 115, 103, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 117, 110, 99, 104, 76, 111, + 103, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 115, 116, 111, 114, 101, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 1, 0, 0, 0, 31, 0, 0, 0, + 4, 0, 0, 0, 2, 0, 1, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 39, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 3, 0, 1, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 109, 109, 97, 110, 100, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 1, 0, 0, 0, 31, 0, 0, 0, + 4, 0, 0, 0, 2, 0, 1, 0, + 150, 182, 62, 24, 226, 60, 177, 248, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 39, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 3, 0, 1, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a12e8670927a2549 = b_a12e8670927a2549.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_a12e8670927a2549[] = { + &s_f8b13ce2183eb696, +}; +static const uint16_t m_a12e8670927a2549[] = {5, 1, 2, 3, 4, 0}; +static const uint16_t i_a12e8670927a2549[] = {0, 1, 2, 3, 4, 5}; +KJ_CONSTEXPR(const) ::capnp::_::RawBrandedSchema::Dependency bd_a12e8670927a2549[] = { + { 16777220, ::cereal::Map< ::capnp::Text, ::capnp::Data>::_capnpPrivate::brand() }, + { 16777221, ::cereal::Map< ::capnp::Text, ::capnp::Data>::_capnpPrivate::brand() }, +}; +const ::capnp::_::RawSchema s_a12e8670927a2549 = { + 0xa12e8670927a2549, b_a12e8670927a2549.words, 149, d_a12e8670927a2549, m_a12e8670927a2549, + 1, 6, i_a12e8670927a2549, nullptr, nullptr, { &s_a12e8670927a2549, nullptr, bd_a12e8670927a2549, 0, sizeof(bd_a12e8670927a2549) / sizeof(bd_a12e8670927a2549[0]), nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<259> b_d9058dcb967c2753 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 83, 39, 124, 150, 203, 141, 5, 217, + 10, 0, 0, 0, 1, 0, 7, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 234, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 79, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 105, 118, 101, 80, 97, + 114, 97, 109, 101, 116, 101, 114, 115, + 68, 97, 116, 97, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 60, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 1, 0, 0, 3, 0, 1, 0, + 156, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 1, 0, 0, 3, 0, 1, 0, + 164, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 161, 1, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 1, 0, 0, 3, 0, 1, 0, + 172, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 169, 1, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 1, 0, 0, 3, 0, 1, 0, + 184, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 1, 0, 0, 3, 0, 1, 0, + 192, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 1, 0, 0, 3, 0, 1, 0, + 200, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 1, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 1, 0, 0, 3, 0, 1, 0, + 208, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 1, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 1, 0, 0, 3, 0, 1, 0, + 212, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 1, 0, 0, 3, 0, 1, 0, + 220, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 1, 0, 0, 3, 0, 1, 0, + 228, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 1, 0, 0, 3, 0, 1, 0, + 240, 1, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 1, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 1, 0, 0, 3, 0, 1, 0, + 252, 1, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 1, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 1, 0, 0, 3, 0, 1, 0, + 8, 2, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 2, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 2, 0, 0, 3, 0, 1, 0, + 16, 2, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 2, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 2, 0, 0, 3, 0, 1, 0, + 20, 2, 0, 0, 2, 0, 1, 0, + 118, 97, 108, 105, 100, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 121, 114, 111, 66, 105, 97, 115, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 103, 108, 101, 79, 102, 102, + 115, 101, 116, 68, 101, 103, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 103, 108, 101, 79, 102, 102, + 115, 101, 116, 65, 118, 101, 114, 97, + 103, 101, 68, 101, 103, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 105, 102, 102, 110, 101, 115, + 115, 70, 97, 99, 116, 111, 114, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 82, 97, 116, + 105, 111, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 110, 115, 111, 114, 86, 97, + 108, 105, 100, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 97, 119, 82, 97, 116, 101, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 101, 110, 101, 116, 83, + 112, 101, 101, 100, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 111, 115, 101, 110, 101, 116, 86, + 97, 108, 105, 100, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 103, 108, 101, 79, 102, 102, + 115, 101, 116, 70, 97, 115, 116, 83, + 116, 100, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 103, 108, 101, 79, 102, 102, + 115, 101, 116, 65, 118, 101, 114, 97, + 103, 101, 83, 116, 100, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 105, 102, 102, 110, 101, 115, + 115, 70, 97, 99, 116, 111, 114, 83, + 116, 100, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 101, 101, 114, 82, 97, 116, + 105, 111, 83, 116, 100, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 108, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d9058dcb967c2753 = b_d9058dcb967c2753.words; +#if !CAPNP_LITE +static const uint16_t m_d9058dcb967c2753[] = {3, 11, 2, 10, 1, 8, 9, 14, 6, 5, 13, 4, 12, 0, 7}; +static const uint16_t i_d9058dcb967c2753[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; +const ::capnp::_::RawSchema s_d9058dcb967c2753 = { + 0xd9058dcb967c2753, b_d9058dcb967c2753.words, 259, nullptr, m_d9058dcb967c2753, + 0, 15, i_d9058dcb967c2753, nullptr, nullptr, { &s_d9058dcb967c2753, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<305> b_943e268f93f711a6 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 166, 17, 247, 147, 143, 38, 62, 148, + 10, 0, 0, 0, 1, 0, 5, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 5, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 2, 1, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 191, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 76, 105, 118, 101, 77, 97, + 112, 68, 97, 116, 97, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 68, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 1, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 1, 0, 0, 3, 0, 1, 0, + 216, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 1, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 1, 0, 0, 3, 0, 1, 0, + 224, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 1, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 1, 0, 0, 3, 0, 1, 0, + 232, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 1, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 1, 0, 0, 3, 0, 1, 0, + 240, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 1, 0, 0, 3, 0, 1, 0, + 244, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 1, 0, 0, 3, 0, 1, 0, + 8, 2, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 2, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2, 0, 0, 3, 0, 1, 0, + 28, 2, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 2, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 2, 0, 0, 3, 0, 1, 0, + 32, 2, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 2, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 2, 0, 0, 3, 0, 1, 0, + 56, 2, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 2, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 2, 0, 0, 3, 0, 1, 0, + 80, 2, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 2, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 2, 0, 0, 3, 0, 1, 0, + 88, 2, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 2, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 2, 0, 0, 3, 0, 1, 0, + 96, 2, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 2, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 2, 0, 0, 3, 0, 1, 0, + 108, 2, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 2, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 2, 0, 0, 3, 0, 1, 0, + 116, 2, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 2, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 2, 0, 0, 3, 0, 1, 0, + 128, 2, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 2, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 2, 0, 0, 3, 0, 1, 0, + 136, 2, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 2, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 2, 0, 0, 3, 0, 1, 0, + 148, 2, 0, 0, 2, 0, 1, 0, + 115, 112, 101, 101, 100, 76, 105, 109, + 105, 116, 86, 97, 108, 105, 100, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 76, 105, 109, + 105, 116, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 114, 118, 97, 116, 117, 114, + 101, 86, 97, 108, 105, 100, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 117, 114, 118, 97, 116, 117, 114, + 101, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 119, 97, 121, 73, 100, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 97, 100, 88, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 97, 100, 89, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 115, 116, 71, 112, 115, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 14, 213, 173, 89, 72, 82, 70, 233, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 97, 100, 67, 117, 114, 118, + 97, 116, 117, 114, 101, 88, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 97, 100, 67, 117, 114, 118, + 97, 116, 117, 114, 101, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 115, 116, 84, 111, 84, 117, + 114, 110, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 112, 86, 97, 108, 105, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 65, 100, 118, + 105, 115, 111, 114, 121, 86, 97, 108, + 105, 100, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 65, 100, 118, + 105, 115, 111, 114, 121, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 76, 105, 109, + 105, 116, 65, 104, 101, 97, 100, 86, + 97, 108, 105, 100, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 76, 105, 109, + 105, 116, 65, 104, 101, 97, 100, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 112, 101, 101, 100, 76, 105, 109, + 105, 116, 65, 104, 101, 97, 100, 68, + 105, 115, 116, 97, 110, 99, 101, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_943e268f93f711a6 = b_943e268f93f711a6.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_943e268f93f711a6[] = { + &s_e946524859add50e, +}; +static const uint16_t m_943e268f93f711a6[] = {3, 2, 10, 7, 11, 9, 8, 5, 6, 13, 12, 1, 15, 16, 14, 0, 4}; +static const uint16_t i_943e268f93f711a6[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; +const ::capnp::_::RawSchema s_943e268f93f711a6 = { + 0x943e268f93f711a6, b_943e268f93f711a6.words, 305, d_943e268f93f711a6, m_943e268f93f711a6, + 1, 17, i_943e268f93f711a6, nullptr, nullptr, { &s_943e268f93f711a6, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<126> b_fa9a296b9fd41a96 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 150, 26, 212, 159, 107, 41, 154, 250, + 10, 0, 0, 0, 1, 0, 2, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 4, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 202, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 87, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 109, 101, 114, 97, + 79, 100, 111, 109, 101, 116, 114, 121, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 24, 0, 0, 0, 3, 0, 4, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 0, 0, 0, 3, 0, 1, 0, + 176, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 0, 0, 0, 3, 0, 1, 0, + 196, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 0, 0, 0, 3, 0, 1, 0, + 220, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 0, 0, 0, 3, 0, 1, 0, + 240, 0, 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 0, 0, 0, 3, 0, 1, 0, + 244, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 0, 0, 0, 3, 0, 1, 0, + 252, 0, 0, 0, 2, 0, 1, 0, + 116, 114, 97, 110, 115, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 116, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 114, 97, 110, 115, 83, 116, 100, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 116, 83, 116, 100, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 114, 97, 109, 101, 73, 100, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 115, 116, 97, 109, + 112, 69, 111, 102, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_fa9a296b9fd41a96 = b_fa9a296b9fd41a96.words; +#if !CAPNP_LITE +static const uint16_t m_fa9a296b9fd41a96[] = {4, 1, 3, 5, 0, 2}; +static const uint16_t i_fa9a296b9fd41a96[] = {0, 1, 2, 3, 4, 5}; +const ::capnp::_::RawSchema s_fa9a296b9fd41a96 = { + 0xfa9a296b9fd41a96, b_fa9a296b9fd41a96.words, 126, nullptr, m_fa9a296b9fd41a96, + 0, 6, i_fa9a296b9fd41a96, nullptr, nullptr, { &s_fa9a296b9fd41a96, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<51> b_ef0382d244f56e38 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 56, 110, 245, 68, 210, 130, 3, 239, + 10, 0, 0, 0, 1, 0, 1, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 154, 0, 0, 0, + 29, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 83, 101, 110, 116, 105, 110, + 101, 108, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 26, 3, 247, 182, 30, 230, 216, 162, + 1, 0, 0, 0, 106, 0, 0, 0, + 83, 101, 110, 116, 105, 110, 101, 108, + 84, 121, 112, 101, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 1, 0, + 48, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 116, 121, 112, 101, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 26, 3, 247, 182, 30, 230, 216, 162, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 105, 103, 110, 97, 108, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_ef0382d244f56e38 = b_ef0382d244f56e38.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_ef0382d244f56e38[] = { + &s_a2d8e61eb6f7031a, +}; +static const uint16_t m_ef0382d244f56e38[] = {1, 0}; +static const uint16_t i_ef0382d244f56e38[] = {0, 1}; +const ::capnp::_::RawSchema s_ef0382d244f56e38 = { + 0xef0382d244f56e38, b_ef0382d244f56e38.words, 51, d_ef0382d244f56e38, m_ef0382d244f56e38, + 1, 2, i_ef0382d244f56e38, nullptr, nullptr, { &s_ef0382d244f56e38, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<38> b_a2d8e61eb6f7031a = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 26, 3, 247, 182, 30, 230, 216, 162, + 19, 0, 0, 0, 2, 0, 0, 0, + 56, 110, 245, 68, 210, 130, 3, 239, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 2, 1, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 103, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 83, 101, 110, 116, 105, 110, + 101, 108, 46, 83, 101, 110, 116, 105, + 110, 101, 108, 84, 121, 112, 101, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 110, 100, 79, 102, 83, 101, 103, + 109, 101, 110, 116, 0, 0, 0, 0, + 101, 110, 100, 79, 102, 82, 111, 117, + 116, 101, 0, 0, 0, 0, 0, 0, + 115, 116, 97, 114, 116, 79, 102, 83, + 101, 103, 109, 101, 110, 116, 0, 0, + 115, 116, 97, 114, 116, 79, 102, 82, + 111, 117, 116, 101, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a2d8e61eb6f7031a = b_a2d8e61eb6f7031a.words; +#if !CAPNP_LITE +static const uint16_t m_a2d8e61eb6f7031a[] = {1, 0, 3, 2}; +const ::capnp::_::RawSchema s_a2d8e61eb6f7031a = { + 0xa2d8e61eb6f7031a, b_a2d8e61eb6f7031a.words, 38, nullptr, m_a2d8e61eb6f7031a, + 0, 4, nullptr, nullptr, nullptr, { &s_a2d8e61eb6f7031a, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(SentinelType_a2d8e61eb6f7031a, a2d8e61eb6f7031a); +static const ::capnp::_::AlignedData<41> b_cf7154b31a69635b = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 91, 99, 105, 26, 179, 84, 113, 207, + 10, 0, 0, 0, 1, 0, 0, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 186, 0, 0, 0, + 29, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 77, 97, 110, 97, 103, 101, + 114, 83, 116, 97, 116, 101, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 234, 105, 132, 112, 210, 84, 154, 134, + 1, 0, 0, 0, 106, 0, 0, 0, + 80, 114, 111, 99, 101, 115, 115, 83, + 116, 97, 116, 101, 0, 0, 0, 0, + 4, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 3, 0, 1, 0, + 40, 0, 0, 0, 2, 0, 1, 0, + 112, 114, 111, 99, 101, 115, 115, 101, + 115, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 234, 105, 132, 112, 210, 84, 154, 134, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_cf7154b31a69635b = b_cf7154b31a69635b.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_cf7154b31a69635b[] = { + &s_869a54d2708469ea, +}; +static const uint16_t m_cf7154b31a69635b[] = {0}; +static const uint16_t i_cf7154b31a69635b[] = {0}; +const ::capnp::_::RawSchema s_cf7154b31a69635b = { + 0xcf7154b31a69635b, b_cf7154b31a69635b.words, 41, d_cf7154b31a69635b, m_cf7154b31a69635b, + 1, 1, i_cf7154b31a69635b, nullptr, nullptr, { &s_cf7154b31a69635b, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<96> b_869a54d2708469ea = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 234, 105, 132, 112, 210, 84, 154, 134, + 23, 0, 0, 0, 1, 0, 2, 0, + 91, 99, 105, 26, 179, 84, 113, 207, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 34, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 31, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 77, 97, 110, 97, 103, 101, + 114, 83, 116, 97, 116, 101, 46, 80, + 114, 111, 99, 101, 115, 115, 83, 116, + 97, 116, 101, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 20, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 0, 0, 0, 3, 0, 1, 0, + 132, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 3, 0, 1, 0, + 136, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 32, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 3, 0, 1, 0, + 140, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 0, 0, 0, 3, 0, 1, 0, + 148, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 33, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 0, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 0, 0, 0, 3, 0, 1, 0, + 156, 0, 0, 0, 2, 0, 1, 0, + 110, 97, 109, 101, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 105, 100, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 110, 105, 110, 103, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 120, 105, 116, 67, 111, 100, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 104, 111, 117, 108, 100, 66, 101, + 82, 117, 110, 110, 105, 110, 103, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_869a54d2708469ea = b_869a54d2708469ea.words; +#if !CAPNP_LITE +static const uint16_t m_869a54d2708469ea[] = {3, 0, 1, 2, 4}; +static const uint16_t i_869a54d2708469ea[] = {0, 1, 2, 3, 4}; +const ::capnp::_::RawSchema s_869a54d2708469ea = { + 0x869a54d2708469ea, b_869a54d2708469ea.words, 96, nullptr, m_869a54d2708469ea, + 0, 5, i_869a54d2708469ea, nullptr, nullptr, { &s_869a54d2708469ea, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<131> b_de266b39b76b461e = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 30, 70, 107, 183, 57, 107, 38, 222, + 10, 0, 0, 0, 1, 0, 3, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 194, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 143, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 85, 112, 108, 111, 97, 100, + 101, 114, 83, 116, 97, 116, 101, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 28, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 0, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 0, 0, 0, 3, 0, 1, 0, + 196, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 0, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 0, 0, 0, 3, 0, 1, 0, + 208, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 3, 0, 1, 0, + 216, 0, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 0, 0, 0, 3, 0, 1, 0, + 224, 0, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 221, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 0, 0, 0, 3, 0, 1, 0, + 232, 0, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 0, 0, 0, 3, 0, 1, 0, + 240, 0, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 0, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 0, 0, 0, 3, 0, 1, 0, + 248, 0, 0, 0, 2, 0, 1, 0, + 105, 109, 109, 101, 100, 105, 97, 116, + 101, 81, 117, 101, 117, 101, 83, 105, + 122, 101, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 109, 109, 101, 100, 105, 97, 116, + 101, 81, 117, 101, 117, 101, 67, 111, + 117, 110, 116, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 119, 81, 117, 101, 117, 101, + 83, 105, 122, 101, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 119, 81, 117, 101, 117, 101, + 67, 111, 117, 110, 116, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 115, 116, 84, 105, 109, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 115, 116, 83, 112, 101, 101, + 100, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 115, 116, 70, 105, 108, 101, + 110, 97, 109, 101, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_de266b39b76b461e = b_de266b39b76b461e.words; +#if !CAPNP_LITE +static const uint16_t m_de266b39b76b461e[] = {1, 0, 6, 5, 4, 3, 2}; +static const uint16_t i_de266b39b76b461e[] = {0, 1, 2, 3, 4, 5, 6}; +const ::capnp::_::RawSchema s_de266b39b76b461e = { + 0xde266b39b76b461e, b_de266b39b76b461e.words, 131, nullptr, m_de266b39b76b461e, + 0, 7, i_de266b39b76b461e, nullptr, nullptr, { &s_de266b39b76b461e, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<194> b_c18216b27f8602af = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 175, 2, 134, 127, 178, 22, 130, 193, + 10, 0, 0, 0, 1, 0, 3, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 5, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 202, 0, 0, 0, + 33, 0, 0, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 0, 0, 0, 55, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 78, 97, 118, 73, 110, 115, + 116, 114, 117, 99, 116, 105, 111, 110, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 1, 0, 1, 0, + 217, 57, 164, 192, 137, 22, 205, 164, + 9, 0, 0, 0, 42, 0, 0, 0, + 146, 193, 229, 201, 216, 185, 165, 238, + 5, 0, 0, 0, 82, 0, 0, 0, + 76, 97, 110, 101, 0, 0, 0, 0, + 68, 105, 114, 101, 99, 116, 105, 111, + 110, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 1, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 1, 0, 0, 3, 0, 1, 0, + 24, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 1, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 24, 1, 0, 0, 3, 0, 1, 0, + 36, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 1, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 1, 0, 0, 3, 0, 1, 0, + 48, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 1, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 1, 0, 0, 3, 0, 1, 0, + 56, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 53, 1, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 1, 0, 0, 3, 0, 1, 0, + 68, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 1, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 1, 0, 0, 3, 0, 1, 0, + 80, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 1, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 1, 0, 0, 3, 0, 1, 0, + 88, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 1, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 1, 0, 0, 3, 0, 1, 0, + 100, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 1, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 1, 0, 0, 3, 0, 1, 0, + 120, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 128, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 1, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 1, 0, 0, 3, 0, 1, 0, + 128, 1, 0, 0, 2, 0, 1, 0, + 109, 97, 110, 101, 117, 118, 101, 114, + 80, 114, 105, 109, 97, 114, 121, 84, + 101, 120, 116, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 110, 101, 117, 118, 101, 114, + 83, 101, 99, 111, 110, 100, 97, 114, + 121, 84, 101, 120, 116, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 110, 101, 117, 118, 101, 114, + 68, 105, 115, 116, 97, 110, 99, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 110, 101, 117, 118, 101, 114, + 84, 121, 112, 101, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 110, 101, 117, 118, 101, 114, + 77, 111, 100, 105, 102, 105, 101, 114, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 105, 115, 116, 97, 110, 99, 101, + 82, 101, 109, 97, 105, 110, 105, 110, + 103, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 82, 101, 109, 97, + 105, 110, 105, 110, 103, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 109, 101, 82, 101, 109, 97, + 105, 110, 105, 110, 103, 84, 121, 112, + 105, 99, 97, 108, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 110, 101, 115, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 217, 57, 164, 192, 137, 22, 205, 164, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 104, 111, 119, 70, 117, 108, 108, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_c18216b27f8602af = b_c18216b27f8602af.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_c18216b27f8602af[] = { + &s_a4cd1689c0a439d9, +}; +static const uint16_t m_c18216b27f8602af[] = {5, 8, 2, 4, 0, 1, 3, 9, 6, 7}; +static const uint16_t i_c18216b27f8602af[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; +const ::capnp::_::RawSchema s_c18216b27f8602af = { + 0xc18216b27f8602af, b_c18216b27f8602af.words, 194, d_c18216b27f8602af, m_c18216b27f8602af, + 1, 10, i_c18216b27f8602af, nullptr, nullptr, { &s_c18216b27f8602af, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<69> b_a4cd1689c0a439d9 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 217, 57, 164, 192, 137, 22, 205, 164, + 25, 0, 0, 0, 1, 0, 1, 0, + 175, 2, 134, 127, 178, 22, 130, 193, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 242, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 78, 97, 118, 73, 110, 115, + 116, 114, 117, 99, 116, 105, 111, 110, + 46, 76, 97, 110, 101, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 0, 0, 3, 0, 1, 0, + 96, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 0, 0, 0, 3, 0, 1, 0, + 100, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 3, 0, 1, 0, + 108, 0, 0, 0, 2, 0, 1, 0, + 100, 105, 114, 101, 99, 116, 105, 111, + 110, 115, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 146, 193, 229, 201, 216, 185, 165, 238, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 116, 105, 118, 101, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 99, 116, 105, 118, 101, 68, 105, + 114, 101, 99, 116, 105, 111, 110, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 146, 193, 229, 201, 216, 185, 165, 238, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a4cd1689c0a439d9 = b_a4cd1689c0a439d9.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_a4cd1689c0a439d9[] = { + &s_eea5b9d8c9e5c192, +}; +static const uint16_t m_a4cd1689c0a439d9[] = {1, 2, 0}; +static const uint16_t i_a4cd1689c0a439d9[] = {0, 1, 2}; +const ::capnp::_::RawSchema s_a4cd1689c0a439d9 = { + 0xa4cd1689c0a439d9, b_a4cd1689c0a439d9.words, 69, d_a4cd1689c0a439d9, m_a4cd1689c0a439d9, + 1, 3, i_a4cd1689c0a439d9, nullptr, nullptr, { &s_a4cd1689c0a439d9, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<36> b_eea5b9d8c9e5c192 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 146, 193, 229, 201, 216, 185, 165, 238, + 25, 0, 0, 0, 2, 0, 0, 0, + 175, 2, 134, 127, 178, 22, 130, 193, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 26, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 103, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 78, 97, 118, 73, 110, 115, + 116, 114, 117, 99, 116, 105, 111, 110, + 46, 68, 105, 114, 101, 99, 116, 105, + 111, 110, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 16, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 111, 110, 101, 0, 0, 0, 0, + 108, 101, 102, 116, 0, 0, 0, 0, + 114, 105, 103, 104, 116, 0, 0, 0, + 115, 116, 114, 97, 105, 103, 104, 116, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_eea5b9d8c9e5c192 = b_eea5b9d8c9e5c192.words; +#if !CAPNP_LITE +static const uint16_t m_eea5b9d8c9e5c192[] = {1, 0, 2, 3}; +const ::capnp::_::RawSchema s_eea5b9d8c9e5c192 = { + 0xeea5b9d8c9e5c192, b_eea5b9d8c9e5c192.words, 36, nullptr, m_eea5b9d8c9e5c192, + 0, 4, nullptr, nullptr, nullptr, { &s_eea5b9d8c9e5c192, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(Direction_eea5b9d8c9e5c192, eea5b9d8c9e5c192); +static const ::capnp::_::AlignedData<41> b_a61452f6440d97d3 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 211, 151, 13, 68, 246, 82, 20, 166, + 10, 0, 0, 0, 1, 0, 0, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 154, 0, 0, 0, + 29, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 78, 97, 118, 82, 111, 117, + 116, 101, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 133, 116, 30, 173, 83, 111, 201, 196, + 1, 0, 0, 0, 90, 0, 0, 0, + 67, 111, 111, 114, 100, 105, 110, 97, + 116, 101, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 3, 0, 1, 0, + 40, 0, 0, 0, 2, 0, 1, 0, + 99, 111, 111, 114, 100, 105, 110, 97, + 116, 101, 115, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 133, 116, 30, 173, 83, 111, 201, 196, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a61452f6440d97d3 = b_a61452f6440d97d3.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_a61452f6440d97d3[] = { + &s_c4c96f53ad1e7485, +}; +static const uint16_t m_a61452f6440d97d3[] = {0}; +static const uint16_t i_a61452f6440d97d3[] = {0}; +const ::capnp::_::RawSchema s_a61452f6440d97d3 = { + 0xa61452f6440d97d3, b_a61452f6440d97d3.words, 41, d_a61452f6440d97d3, m_a61452f6440d97d3, + 1, 1, i_a61452f6440d97d3, nullptr, nullptr, { &s_a61452f6440d97d3, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<50> b_c4c96f53ad1e7485 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 133, 116, 30, 173, 83, 111, 201, 196, + 19, 0, 0, 0, 1, 0, 1, 0, + 211, 151, 13, 68, 246, 82, 20, 166, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 242, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 78, 97, 118, 82, 111, 117, + 116, 101, 46, 67, 111, 111, 114, 100, + 105, 110, 97, 116, 101, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 0, 0, 0, 3, 0, 1, 0, + 60, 0, 0, 0, 2, 0, 1, 0, + 108, 97, 116, 105, 116, 117, 100, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 110, 103, 105, 116, 117, 100, + 101, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_c4c96f53ad1e7485 = b_c4c96f53ad1e7485.words; +#if !CAPNP_LITE +static const uint16_t m_c4c96f53ad1e7485[] = {0, 1}; +static const uint16_t i_c4c96f53ad1e7485[] = {0, 1}; +const ::capnp::_::RawSchema s_c4c96f53ad1e7485 = { + 0xc4c96f53ad1e7485, b_c4c96f53ad1e7485.words, 50, nullptr, m_c4c96f53ad1e7485, + 0, 2, i_c4c96f53ad1e7485, nullptr, nullptr, { &s_c4c96f53ad1e7485, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<1486> b_d314cfd957229c11 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 17, 156, 34, 87, 217, 207, 20, 211, + 10, 0, 0, 0, 1, 0, 2, 0, + 91, 40, 164, 37, 126, 241, 177, 243, + 1, 0, 7, 0, 0, 0, 84, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 130, 0, 0, 0, + 25, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 215, 18, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 46, 99, 97, 112, 110, + 112, 58, 69, 118, 101, 110, 116, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 88, 1, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 9, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 9, 0, 0, 3, 0, 1, 0, + 100, 9, 0, 0, 2, 0, 1, 0, + 2, 0, 255, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 9, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 9, 0, 0, 3, 0, 1, 0, + 108, 9, 0, 0, 2, 0, 1, 0, + 31, 0, 254, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 9, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 9, 0, 0, 3, 0, 1, 0, + 116, 9, 0, 0, 2, 0, 1, 0, + 5, 0, 253, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 9, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 9, 0, 0, 3, 0, 1, 0, + 120, 9, 0, 0, 2, 0, 1, 0, + 55, 0, 252, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 9, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 9, 0, 0, 3, 0, 1, 0, + 132, 9, 0, 0, 2, 0, 1, 0, + 6, 0, 251, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 9, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 9, 0, 0, 3, 0, 1, 0, + 152, 9, 0, 0, 2, 0, 1, 0, + 42, 0, 250, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 9, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 9, 0, 0, 3, 0, 1, 0, + 160, 9, 0, 0, 2, 0, 1, 0, + 7, 0, 249, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 9, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 9, 0, 0, 3, 0, 1, 0, + 168, 9, 0, 0, 2, 0, 1, 0, + 56, 0, 248, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 9, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 9, 0, 0, 3, 0, 1, 0, + 196, 9, 0, 0, 2, 0, 1, 0, + 49, 0, 247, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 9, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 9, 0, 0, 3, 0, 1, 0, + 200, 9, 0, 0, 2, 0, 1, 0, + 81, 0, 246, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 9, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 200, 9, 0, 0, 3, 0, 1, 0, + 212, 9, 0, 0, 2, 0, 1, 0, + 8, 0, 245, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 9, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 9, 0, 0, 3, 0, 1, 0, + 236, 9, 0, 0, 2, 0, 1, 0, + 85, 0, 244, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 9, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 9, 0, 0, 3, 0, 1, 0, + 248, 9, 0, 0, 2, 0, 1, 0, + 11, 0, 243, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 9, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 9, 0, 0, 3, 0, 1, 0, + 0, 10, 0, 0, 2, 0, 1, 0, + 54, 0, 242, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 9, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 10, 0, 0, 3, 0, 1, 0, + 12, 10, 0, 0, 2, 0, 1, 0, + 34, 0, 241, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 10, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 10, 0, 0, 3, 0, 1, 0, + 20, 10, 0, 0, 2, 0, 1, 0, + 12, 0, 240, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 10, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 10, 0, 0, 3, 0, 1, 0, + 44, 10, 0, 0, 2, 0, 1, 0, + 13, 0, 239, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 10, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 10, 0, 0, 3, 0, 1, 0, + 64, 10, 0, 0, 2, 0, 1, 0, + 43, 0, 238, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 10, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 10, 0, 0, 3, 0, 1, 0, + 72, 10, 0, 0, 2, 0, 1, 0, + 14, 0, 237, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 10, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 10, 0, 0, 3, 0, 1, 0, + 80, 10, 0, 0, 2, 0, 1, 0, + 37, 0, 236, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 20, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 10, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 10, 0, 0, 3, 0, 1, 0, + 88, 10, 0, 0, 2, 0, 1, 0, + 83, 0, 235, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 10, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 10, 0, 0, 3, 0, 1, 0, + 100, 10, 0, 0, 2, 0, 1, 0, + 15, 0, 234, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 10, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 10, 0, 0, 3, 0, 1, 0, + 108, 10, 0, 0, 2, 0, 1, 0, + 16, 0, 233, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 10, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 10, 0, 0, 3, 0, 1, 0, + 116, 10, 0, 0, 2, 0, 1, 0, + 17, 0, 232, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 10, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 10, 0, 0, 3, 0, 1, 0, + 128, 10, 0, 0, 2, 0, 1, 0, + 57, 0, 231, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 10, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 10, 0, 0, 3, 0, 1, 0, + 140, 10, 0, 0, 2, 0, 1, 0, + 58, 0, 230, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 10, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 10, 0, 0, 3, 0, 1, 0, + 168, 10, 0, 0, 2, 0, 1, 0, + 73, 0, 229, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 10, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 10, 0, 0, 3, 0, 1, 0, + 180, 10, 0, 0, 2, 0, 1, 0, + 59, 0, 228, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 177, 10, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 10, 0, 0, 3, 0, 1, 0, + 208, 10, 0, 0, 2, 0, 1, 0, + 60, 0, 227, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 10, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 10, 0, 0, 3, 0, 1, 0, + 236, 10, 0, 0, 2, 0, 1, 0, + 66, 0, 226, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 30, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 10, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 236, 10, 0, 0, 3, 0, 1, 0, + 248, 10, 0, 0, 2, 0, 1, 0, + 67, 0, 225, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 245, 10, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 10, 0, 0, 3, 0, 1, 0, + 4, 11, 0, 0, 2, 0, 1, 0, + 68, 0, 224, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 11, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 11, 0, 0, 3, 0, 1, 0, + 16, 11, 0, 0, 2, 0, 1, 0, + 40, 0, 223, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 33, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 11, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 11, 0, 0, 3, 0, 1, 0, + 20, 11, 0, 0, 2, 0, 1, 0, + 19, 0, 222, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 11, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 11, 0, 0, 3, 0, 1, 0, + 28, 11, 0, 0, 2, 0, 1, 0, + 41, 0, 221, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 11, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 11, 0, 0, 3, 0, 1, 0, + 32, 11, 0, 0, 2, 0, 1, 0, + 50, 0, 220, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 11, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 11, 0, 0, 3, 0, 1, 0, + 44, 11, 0, 0, 2, 0, 1, 0, + 51, 0, 219, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 11, 0, 0, 242, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 11, 0, 0, 3, 0, 1, 0, + 60, 11, 0, 0, 2, 0, 1, 0, + 69, 0, 218, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 38, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 11, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 11, 0, 0, 3, 0, 1, 0, + 72, 11, 0, 0, 2, 0, 1, 0, + 20, 0, 217, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 11, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 11, 0, 0, 3, 0, 1, 0, + 80, 11, 0, 0, 2, 0, 1, 0, + 63, 0, 216, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 40, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 11, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 11, 0, 0, 3, 0, 1, 0, + 96, 11, 0, 0, 2, 0, 1, 0, + 64, 0, 215, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 41, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 11, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 11, 0, 0, 3, 0, 1, 0, + 112, 11, 0, 0, 2, 0, 1, 0, + 65, 0, 214, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 11, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 11, 0, 0, 3, 0, 1, 0, + 124, 11, 0, 0, 2, 0, 1, 0, + 70, 0, 213, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 43, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 11, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 11, 0, 0, 3, 0, 1, 0, + 152, 11, 0, 0, 2, 0, 1, 0, + 71, 0, 212, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 44, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 11, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 11, 0, 0, 3, 0, 1, 0, + 168, 11, 0, 0, 2, 0, 1, 0, + 53, 0, 211, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 45, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 11, 0, 0, 226, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 11, 0, 0, 3, 0, 1, 0, + 184, 11, 0, 0, 2, 0, 1, 0, + 72, 0, 210, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 46, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 11, 0, 0, 2, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 188, 11, 0, 0, 3, 0, 1, 0, + 200, 11, 0, 0, 2, 0, 1, 0, + 74, 0, 209, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 47, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 197, 11, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 11, 0, 0, 3, 0, 1, 0, + 232, 11, 0, 0, 2, 0, 1, 0, + 21, 0, 208, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 48, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 11, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 11, 0, 0, 3, 0, 1, 0, + 244, 11, 0, 0, 2, 0, 1, 0, + 75, 0, 207, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 49, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 11, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 11, 0, 0, 3, 0, 1, 0, + 0, 12, 0, 0, 2, 0, 1, 0, + 61, 0, 206, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 11, 0, 0, 226, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 12, 0, 0, 3, 0, 1, 0, + 16, 12, 0, 0, 2, 0, 1, 0, + 52, 0, 205, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 51, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 12, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 12, 0, 0, 3, 0, 1, 0, + 32, 12, 0, 0, 2, 0, 1, 0, + 48, 0, 204, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 52, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 12, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 12, 0, 0, 3, 0, 1, 0, + 40, 12, 0, 0, 2, 0, 1, 0, + 76, 0, 203, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 53, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 12, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 12, 0, 0, 3, 0, 1, 0, + 52, 12, 0, 0, 2, 0, 1, 0, + 77, 0, 202, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 54, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 12, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 52, 12, 0, 0, 3, 0, 1, 0, + 64, 12, 0, 0, 2, 0, 1, 0, + 78, 0, 201, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 12, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 12, 0, 0, 3, 0, 1, 0, + 80, 12, 0, 0, 2, 0, 1, 0, + 79, 0, 200, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 56, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 12, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 12, 0, 0, 3, 0, 1, 0, + 92, 12, 0, 0, 2, 0, 1, 0, + 84, 0, 199, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 57, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 12, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 12, 0, 0, 3, 0, 1, 0, + 104, 12, 0, 0, 2, 0, 1, 0, + 80, 0, 198, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 12, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 12, 0, 0, 3, 0, 1, 0, + 120, 12, 0, 0, 2, 0, 1, 0, + 22, 0, 197, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 59, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 12, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 12, 0, 0, 3, 0, 1, 0, + 128, 12, 0, 0, 2, 0, 1, 0, + 4, 0, 196, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 60, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 12, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 12, 0, 0, 3, 0, 1, 0, + 132, 12, 0, 0, 2, 0, 1, 0, + 23, 0, 195, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 61, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 12, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 12, 0, 0, 3, 0, 1, 0, + 140, 12, 0, 0, 2, 0, 1, 0, + 62, 0, 194, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 62, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 12, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 12, 0, 0, 3, 0, 1, 0, + 152, 12, 0, 0, 2, 0, 1, 0, + 24, 0, 193, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 149, 12, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 148, 12, 0, 0, 3, 0, 1, 0, + 160, 12, 0, 0, 2, 0, 1, 0, + 18, 0, 192, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 12, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 12, 0, 0, 3, 0, 1, 0, + 168, 12, 0, 0, 2, 0, 1, 0, + 82, 0, 191, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 65, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 12, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 12, 0, 0, 3, 0, 1, 0, + 184, 12, 0, 0, 2, 0, 1, 0, + 25, 0, 190, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 181, 12, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 180, 12, 0, 0, 3, 0, 1, 0, + 192, 12, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 80, 0, 0, 0, + 0, 0, 1, 0, 67, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 189, 12, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 12, 0, 0, 3, 0, 1, 0, + 196, 12, 0, 0, 2, 0, 1, 0, + 26, 0, 189, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 68, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 12, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 192, 12, 0, 0, 3, 0, 1, 0, + 220, 12, 0, 0, 2, 0, 1, 0, + 27, 0, 188, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 69, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 12, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 216, 12, 0, 0, 3, 0, 1, 0, + 228, 12, 0, 0, 2, 0, 1, 0, + 32, 0, 187, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 70, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 225, 12, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 12, 0, 0, 3, 0, 1, 0, + 240, 12, 0, 0, 2, 0, 1, 0, + 28, 0, 186, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 71, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 237, 12, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 240, 12, 0, 0, 3, 0, 1, 0, + 252, 12, 0, 0, 2, 0, 1, 0, + 29, 0, 185, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 72, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 12, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 12, 0, 0, 3, 0, 1, 0, + 8, 13, 0, 0, 2, 0, 1, 0, + 3, 0, 184, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 73, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 13, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 13, 0, 0, 3, 0, 1, 0, + 16, 13, 0, 0, 2, 0, 1, 0, + 33, 0, 183, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 13, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 13, 0, 0, 3, 0, 1, 0, + 28, 13, 0, 0, 2, 0, 1, 0, + 30, 0, 182, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 75, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 13, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 13, 0, 0, 3, 0, 1, 0, + 32, 13, 0, 0, 2, 0, 1, 0, + 35, 0, 181, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 76, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 13, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 13, 0, 0, 3, 0, 1, 0, + 40, 13, 0, 0, 2, 0, 1, 0, + 36, 0, 180, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 77, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 13, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 13, 0, 0, 3, 0, 1, 0, + 52, 13, 0, 0, 2, 0, 1, 0, + 38, 0, 179, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 78, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 13, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 13, 0, 0, 3, 0, 1, 0, + 60, 13, 0, 0, 2, 0, 1, 0, + 39, 0, 178, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 79, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 13, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 56, 13, 0, 0, 3, 0, 1, 0, + 68, 13, 0, 0, 2, 0, 1, 0, + 10, 0, 177, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 80, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 13, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 13, 0, 0, 3, 0, 1, 0, + 76, 13, 0, 0, 2, 0, 1, 0, + 9, 0, 176, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 81, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 13, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 13, 0, 0, 3, 0, 1, 0, + 100, 13, 0, 0, 2, 0, 1, 0, + 45, 0, 175, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 13, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 13, 0, 0, 3, 0, 1, 0, + 108, 13, 0, 0, 2, 0, 1, 0, + 46, 0, 174, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 83, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 13, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 13, 0, 0, 3, 0, 1, 0, + 116, 13, 0, 0, 2, 0, 1, 0, + 47, 0, 173, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 84, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 13, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 13, 0, 0, 3, 0, 1, 0, + 124, 13, 0, 0, 2, 0, 1, 0, + 44, 0, 172, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 85, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 13, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 120, 13, 0, 0, 3, 0, 1, 0, + 132, 13, 0, 0, 2, 0, 1, 0, + 108, 111, 103, 77, 111, 110, 111, 84, + 105, 109, 101, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 110, 105, 116, 68, 97, 116, 97, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 92, 182, 63, 235, 202, 8, 16, 231, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 97, 100, 67, 97, 109, 101, + 114, 97, 83, 116, 97, 116, 101, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 51, 10, 174, 149, 246, 69, 2, 234, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 78, 77, 69, 65, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 136, 74, 186, 19, 120, 29, 41, 157, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 110, 115, 111, 114, 69, 118, + 101, 110, 116, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 161, 41, 69, 212, 105, 154, 178, 162, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 89, 124, 76, 150, 154, 0, 133, 135, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 118, 105, 99, 101, 83, 116, + 97, 116, 101, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 235, 146, 164, 42, 175, 181, 216, 164, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 111, 110, 116, 114, 111, 108, 115, + 83, 116, 97, 116, 101, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 241, 171, 1, 54, 197, 105, 255, 151, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 118, 101, 69, 118, 101, 110, + 116, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 30, 50, 92, 12, 169, 186, 183, 148, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 100, 101, 108, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 169, 40, 239, 255, 44, 214, 170, 184, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 101, 97, 116, 117, 114, 101, 115, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 122, 134, 234, 84, 178, 173, 223, 143, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 110, 115, 111, 114, 69, 118, + 101, 110, 116, 115, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 161, 41, 69, 212, 105, 154, 178, 162, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 110, 100, 97, 83, 116, 97, + 116, 101, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 30, 89, 228, 117, 37, 158, 100, 167, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 97, 100, 97, 114, 83, 116, 97, + 116, 101, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 95, 208, 253, 214, 137, 83, 24, 154, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 118, 101, 85, 73, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 237, 252, 174, 150, 249, 64, 130, 192, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 111, 97, 100, 69, 110, 99, 111, + 100, 101, 73, 100, 120, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 252, 53, 23, 84, 227, 148, 211, 137, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 118, 101, 84, 114, 97, 99, + 107, 115, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 81, 194, 222, 50, 71, 100, 170, 143, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 110, 100, 99, 97, 110, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 89, 124, 76, 150, 154, 0, 133, 135, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 103, 77, 101, 115, 115, 97, + 103, 101, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 118, 101, 67, 97, 108, 105, + 98, 114, 97, 116, 105, 111, 110, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 188, 144, 131, 77, 117, 112, 223, 150, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 100, 114, 111, 105, 100, 76, + 111, 103, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 133, 125, 79, 137, 161, 93, 9, 234, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 76, 111, 99, 97, 116, + 105, 111, 110, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 14, 213, 173, 89, 72, 82, 70, 233, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 83, 116, 97, 116, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 60, 144, 82, 224, 9, 250, 164, 157, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 67, 111, 110, 116, 114, + 111, 108, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 175, 20, 184, 154, 4, 41, 136, 247, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 110, 103, 105, 116, 117, 100, + 105, 110, 97, 108, 80, 108, 97, 110, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 108, 135, 18, 186, 62, 91, 11, 224, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 118, 101, 76, 111, 99, 97, + 116, 105, 111, 110, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 40, 129, 126, 165, 199, 43, 155, 185, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 116, 104, 101, 114, 110, 101, 116, + 68, 97, 116, 97, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 89, 88, 207, 51, 91, 157, 154, 169, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 97, 118, 85, 112, 100, 97, 116, + 101, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 203, 106, 81, 101, 101, 190, 152, 219, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 101, 108, 108, 73, 110, 102, 111, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 206, 119, 194, 129, 102, 86, 247, 207, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 119, 105, 102, 105, 83, 99, 97, 110, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 11, 186, 130, 35, 25, 90, 223, 212, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 110, 100, 114, 111, 105, 100, 71, + 110, 115, 115, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 189, 133, 196, 63, 208, 48, 223, 223, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 113, 99, 111, 109, 71, 110, 115, 115, + 68, 69, 80, 82, 69, 67, 65, 84, + 68, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 193, 81, 174, 7, 75, 103, 148, 222, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 100, 97, 114, 80, 116, 115, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 122, 143, 157, 78, 93, 104, 214, 227, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 114, 111, 99, 76, 111, 103, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 6, 20, 104, 63, 123, 56, 133, 175, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 98, 108, 111, 120, 71, 110, 115, + 115, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 93, 250, 206, 230, 124, 221, 221, 133, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 108, 111, 99, 107, 115, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 24, 70, 220, 123, 154, 180, 95, 201, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 118, 101, 77, 112, 99, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 160, 50, 95, 168, 50, 227, 165, 146, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 118, 101, 76, 111, 110, 103, + 105, 116, 117, 100, 105, 110, 97, 108, + 77, 112, 99, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 226, 90, 134, 79, 67, 124, 225, 231, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 97, 118, 83, 116, 97, 116, 117, + 115, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 12, 18, 40, 9, 18, 34, 136, 189, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 98, 108, 111, 120, 82, 97, 119, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 80, 108, 97, 110, 110, + 101, 114, 80, 111, 105, 110, 116, 115, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 243, 249, 248, 153, 150, 197, 84, 171, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 80, 108, 97, 110, 110, + 101, 114, 80, 108, 97, 110, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 107, 221, 193, 205, 144, 29, 173, 245, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 112, 112, 108, 97, 110, 105, 120, + 82, 97, 119, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 114, 97, 102, 102, 105, 99, 69, + 118, 101, 110, 116, 115, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 38, 38, 230, 148, 160, 116, 250, 172, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 118, 101, 76, 111, 99, 97, + 116, 105, 111, 110, 84, 105, 109, 105, + 110, 103, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 40, 129, 126, 165, 199, 43, 155, 185, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 114, 98, 115, 108, 97, 109, 67, + 111, 114, 114, 101, 99, 116, 105, 111, + 110, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 170, 225, 53, 155, 220, 51, 253, 138, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 118, 101, 76, 111, 99, 97, + 116, 105, 111, 110, 67, 111, 114, 114, + 101, 99, 116, 101, 100, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 40, 129, 126, 165, 199, 43, 155, 185, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 114, 98, 79, 98, 115, 101, 114, + 118, 97, 116, 105, 111, 110, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 199, 254, 106, 67, 78, 109, 50, 155, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 112, 115, 76, 111, 99, 97, 116, + 105, 111, 110, 69, 120, 116, 101, 114, + 110, 97, 108, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 14, 213, 173, 89, 72, 82, 70, 233, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 99, 97, 116, 105, 111, 110, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 40, 129, 126, 165, 199, 43, 155, 185, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 105, 78, 97, 118, 105, 103, 97, + 116, 105, 111, 110, 69, 118, 101, 110, + 116, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 59, 221, 173, 62, 108, 66, 200, 144, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 118, 101, 76, 111, 99, 97, + 116, 105, 111, 110, 75, 97, 108, 109, + 97, 110, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 40, 129, 126, 165, 199, 43, 155, 185, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 101, 115, 116, 74, 111, 121, 115, + 116, 105, 99, 107, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 226, 21, 39, 142, 101, 1, 36, 228, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 114, 98, 79, 100, 111, 109, 101, + 116, 114, 121, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 118, 91, 31, 237, 89, 8, 112, 215, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 114, 98, 70, 101, 97, 116, 117, + 114, 101, 115, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 239, 89, 1, 138, 74, 22, 96, 205, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 112, 112, 108, 97, 110, 105, 120, + 76, 111, 99, 97, 116, 105, 111, 110, + 68, 69, 80, 82, 69, 67, 65, 84, + 69, 68, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 40, 129, 126, 165, 199, 43, 155, 185, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 114, 98, 75, 101, 121, 70, 114, + 97, 109, 101, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 36, 126, 226, 69, 3, 60, 35, 200, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 105, 76, 97, 121, 111, 117, 116, + 83, 116, 97, 116, 101, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 160, 221, 41, 173, 8, 206, 220, 136, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 111, 114, 98, 70, 101, 97, 116, 117, + 114, 101, 115, 83, 117, 109, 109, 97, + 114, 121, 68, 69, 80, 82, 69, 67, + 65, 84, 69, 68, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 79, 250, 3, 88, 12, 211, 0, 213, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 114, 105, 118, 101, 114, 83, 116, + 97, 116, 101, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 10, 237, 147, 197, 108, 60, 184, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 98, 111, 111, 116, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 73, 37, 122, 146, 112, 134, 46, 161, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 118, 101, 80, 97, 114, 97, + 109, 101, 116, 101, 114, 115, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 83, 39, 124, 150, 203, 141, 5, 217, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 118, 101, 77, 97, 112, 68, + 97, 116, 97, 68, 69, 80, 82, 69, + 67, 65, 84, 69, 68, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 166, 17, 247, 147, 143, 38, 62, 148, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 109, 101, 114, 97, 79, 100, + 111, 109, 101, 116, 114, 121, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 150, 26, 212, 159, 107, 41, 154, 250, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 97, 116, 101, 114, 97, 108, 80, + 108, 97, 110, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 30, 181, 232, 42, 142, 49, 233, 225, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 107, 97, 108, 109, 97, 110, 79, 100, + 111, 109, 101, 116, 114, 121, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 58, 121, 56, 234, 183, 27, 226, 146, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 104, 117, 109, 98, 110, 97, 105, + 108, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 211, 247, 10, 18, 100, 206, 95, 182, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 118, 97, 108, 105, 100, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 69, 118, 101, 110, 116, + 115, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 211, 58, 175, 76, 243, 87, 22, 155, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 80, 97, 114, 97, 109, + 115, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 218, 169, 170, 144, 36, 55, 105, 140, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 114, 105, 118, 101, 114, 67, 97, + 109, 101, 114, 97, 83, 116, 97, 116, + 101, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 51, 10, 174, 149, 246, 69, 2, 234, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 114, 105, 118, 101, 114, 77, 111, + 110, 105, 116, 111, 114, 105, 110, 103, + 83, 116, 97, 116, 101, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 132, 162, 29, 74, 9, 218, 60, 184, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 108, 105, 118, 101, 76, 111, 99, 97, + 116, 105, 111, 110, 75, 97, 108, 109, + 97, 110, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 41, 193, 231, 30, 61, 112, 197, 235, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 115, 101, 110, 116, 105, 110, 101, 108, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 56, 110, 245, 68, 210, 130, 3, 239, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 119, 105, 100, 101, 82, 111, 97, 100, + 67, 97, 109, 101, 114, 97, 83, 116, + 97, 116, 101, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 51, 10, 174, 149, 246, 69, 2, 234, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 111, 100, 101, 108, 86, 50, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 233, 171, 54, 13, 107, 63, 113, 196, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 114, 105, 118, 101, 114, 69, 110, + 99, 111, 100, 101, 73, 100, 120, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 252, 53, 23, 84, 227, 148, 211, 137, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 119, 105, 100, 101, 82, 111, 97, 100, + 69, 110, 99, 111, 100, 101, 73, 100, + 120, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 252, 53, 23, 84, 227, 148, 211, 137, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 97, 110, 97, 103, 101, 114, 83, + 116, 97, 116, 101, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 91, 99, 105, 26, 179, 84, 113, 207, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 117, 112, 108, 111, 97, 100, 101, 114, + 83, 116, 97, 116, 101, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 30, 70, 107, 183, 57, 107, 38, 222, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 101, 114, 105, 112, 104, 101, 114, + 97, 108, 83, 116, 97, 116, 101, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 136, 122, 133, 52, 151, 244, 184, 206, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 112, 97, 110, 100, 97, 83, 116, 97, + 116, 101, 115, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 1, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 30, 89, 228, 117, 37, 158, 100, 167, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 97, 118, 73, 110, 115, 116, 114, + 117, 99, 116, 105, 111, 110, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 175, 2, 134, 127, 178, 22, 130, 193, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 97, 118, 82, 111, 117, 116, 101, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 211, 151, 13, 68, 246, 82, 20, 166, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 110, 97, 118, 84, 104, 117, 109, 98, + 110, 97, 105, 108, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 211, 247, 10, 18, 100, 206, 95, 182, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 114, 114, 111, 114, 76, 111, 103, + 77, 101, 115, 115, 97, 103, 101, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d314cfd957229c11 = b_d314cfd957229c11.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_d314cfd957229c11[] = { + &s_85dddd7ce6cefa5d, + &s_8785009a964c7c59, + &s_88dcce08ad29dda0, + &s_89d394e3541735fc, + &s_8afd33dc9b35e1aa, + &s_8c69372490aaa9da, + &s_8faa644732dec251, + &s_8fdfadb254ea867a, + &s_90c8426c3eaddd3b, + &s_92a5e332a85f32a0, + &s_92e21bb7ea38793a, + &s_943e268f93f711a6, + &s_94b7baa90c5c321e, + &s_96df70754d8390bc, + &s_97ff69c53601abf1, + &s_9a185389d6fdd05f, + &s_9b1657f34caf3ad3, + &s_9b326d4e436afec7, + &s_9d291d7813ba4a88, + &s_9da4fa09e052903c, + &s_a12e8670927a2549, + &s_a2b29a69d44529a1, + &s_a4d8b5af2aa492eb, + &s_a61452f6440d97d3, + &s_a7649e2575e4591e, + &s_a99a9d5b33cf5859, + &s_ab54c59699f8f9f3, + &s_acfa74a094e62626, + &s_af85387b3f681406, + &s_b65fce64120af7d3, + &s_b83c6cc593ed0a00, + &s_b83cda094a1da284, + &s_b8aad62cffef28a9, + &s_b99b2bc7a57e8128, + &s_bd8822120928120c, + &s_c08240f996aefced, + &s_c18216b27f8602af, + &s_c4713f6b0d36abe9, + &s_c8233c0345e27e24, + &s_c95fb49a7bdc4618, + &s_cd60164a8a0159ef, + &s_ceb8f49734857a88, + &s_cf7154b31a69635b, + &s_cff7566681c277ce, + &s_d4df5a192382ba0b, + &s_d500d30c5803fa4f, + &s_d7700859ed1f5b76, + &s_d9058dcb967c2753, + &s_db98be6565516acb, + &s_de266b39b76b461e, + &s_de94674b07ae51c1, + &s_dfdf30d03fc485bd, + &s_e00b5b3eba12876c, + &s_e1e9318e2ae8b51e, + &s_e3d6685d4e9d8f7a, + &s_e42401658e2715e2, + &s_e71008caeb3fb65c, + &s_e7e17c434f865ae2, + &s_e946524859add50e, + &s_ea0245f695ae0a33, + &s_ea095da1894f7d85, + &s_ebc5703d1ee7c129, + &s_ef0382d244f56e38, + &s_f5ad1d90cdc1dd6b, + &s_f78829049ab814af, + &s_fa9a296b9fd41a96, +}; +static const uint16_t m_d314cfd957229c11[] = {30, 20, 55, 42, 60, 63, 5, 23, 68, 69, 22, 28, 35, 7, 6, 70, 76, 71, 59, 85, 26, 10, 21, 48, 3, 41, 40, 1, 65, 64, 32, 19, 8, 46, 25, 72, 51, 44, 37, 62, 36, 61, 16, 14, 49, 18, 0, 24, 78, 9, 75, 82, 83, 38, 84, 27, 54, 58, 56, 47, 53, 45, 12, 81, 80, 33, 31, 13, 2, 15, 17, 4, 11, 73, 52, 66, 43, 34, 39, 57, 50, 79, 67, 74, 77, 29}; +static const uint16_t i_d314cfd957229c11[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 0, 67}; +const ::capnp::_::RawSchema s_d314cfd957229c11 = { + 0xd314cfd957229c11, b_d314cfd957229c11.words, 1486, d_d314cfd957229c11, m_d314cfd957229c11, + 66, 86, i_d314cfd957229c11, nullptr, nullptr, { &s_d314cfd957229c11, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +} // namespace schemas +} // namespace capnp + +// ======================================================================================= + +namespace cereal { + +// InitData +constexpr uint16_t InitData::_capnpPrivate::dataWordSize; +constexpr uint16_t InitData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind InitData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* InitData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// InitData::PandaInfo +constexpr uint16_t InitData::PandaInfo::_capnpPrivate::dataWordSize; +constexpr uint16_t InitData::PandaInfo::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind InitData::PandaInfo::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* InitData::PandaInfo::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// InitData::AndroidBuildInfo +constexpr uint16_t InitData::AndroidBuildInfo::_capnpPrivate::dataWordSize; +constexpr uint16_t InitData::AndroidBuildInfo::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind InitData::AndroidBuildInfo::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* InitData::AndroidBuildInfo::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// InitData::AndroidSensor +constexpr uint16_t InitData::AndroidSensor::_capnpPrivate::dataWordSize; +constexpr uint16_t InitData::AndroidSensor::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind InitData::AndroidSensor::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* InitData::AndroidSensor::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// InitData::ChffrAndroidExtra +constexpr uint16_t InitData::ChffrAndroidExtra::_capnpPrivate::dataWordSize; +constexpr uint16_t InitData::ChffrAndroidExtra::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind InitData::ChffrAndroidExtra::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* InitData::ChffrAndroidExtra::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// InitData::IosBuildInfo +constexpr uint16_t InitData::IosBuildInfo::_capnpPrivate::dataWordSize; +constexpr uint16_t InitData::IosBuildInfo::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind InitData::IosBuildInfo::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* InitData::IosBuildInfo::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// FrameData +constexpr uint16_t FrameData::_capnpPrivate::dataWordSize; +constexpr uint16_t FrameData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind FrameData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* FrameData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// FrameData::AndroidCaptureResult +constexpr uint16_t FrameData::AndroidCaptureResult::_capnpPrivate::dataWordSize; +constexpr uint16_t FrameData::AndroidCaptureResult::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind FrameData::AndroidCaptureResult::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* FrameData::AndroidCaptureResult::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Thumbnail +constexpr uint16_t Thumbnail::_capnpPrivate::dataWordSize; +constexpr uint16_t Thumbnail::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Thumbnail::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Thumbnail::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// GPSNMEAData +constexpr uint16_t GPSNMEAData::_capnpPrivate::dataWordSize; +constexpr uint16_t GPSNMEAData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind GPSNMEAData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* GPSNMEAData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// SensorEventData +constexpr uint16_t SensorEventData::_capnpPrivate::dataWordSize; +constexpr uint16_t SensorEventData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind SensorEventData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* SensorEventData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// SensorEventData::SensorVec +constexpr uint16_t SensorEventData::SensorVec::_capnpPrivate::dataWordSize; +constexpr uint16_t SensorEventData::SensorVec::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind SensorEventData::SensorVec::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* SensorEventData::SensorVec::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// GpsLocationData +constexpr uint16_t GpsLocationData::_capnpPrivate::dataWordSize; +constexpr uint16_t GpsLocationData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind GpsLocationData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* GpsLocationData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CanData +constexpr uint16_t CanData::_capnpPrivate::dataWordSize; +constexpr uint16_t CanData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CanData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CanData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// DeviceState +constexpr uint16_t DeviceState::_capnpPrivate::dataWordSize; +constexpr uint16_t DeviceState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind DeviceState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* DeviceState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// DeviceState::ThermalZone +constexpr uint16_t DeviceState::ThermalZone::_capnpPrivate::dataWordSize; +constexpr uint16_t DeviceState::ThermalZone::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind DeviceState::ThermalZone::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* DeviceState::ThermalZone::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// DeviceState::NetworkInfo +constexpr uint16_t DeviceState::NetworkInfo::_capnpPrivate::dataWordSize; +constexpr uint16_t DeviceState::NetworkInfo::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind DeviceState::NetworkInfo::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* DeviceState::NetworkInfo::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// PandaState +constexpr uint16_t PandaState::_capnpPrivate::dataWordSize; +constexpr uint16_t PandaState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind PandaState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* PandaState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// PeripheralState +constexpr uint16_t PeripheralState::_capnpPrivate::dataWordSize; +constexpr uint16_t PeripheralState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind PeripheralState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* PeripheralState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// RadarState +constexpr uint16_t RadarState::_capnpPrivate::dataWordSize; +constexpr uint16_t RadarState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind RadarState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* RadarState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// RadarState::LeadData +constexpr uint16_t RadarState::LeadData::_capnpPrivate::dataWordSize; +constexpr uint16_t RadarState::LeadData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind RadarState::LeadData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* RadarState::LeadData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LiveCalibrationData +constexpr uint16_t LiveCalibrationData::_capnpPrivate::dataWordSize; +constexpr uint16_t LiveCalibrationData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LiveCalibrationData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LiveCalibrationData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LiveTracks +constexpr uint16_t LiveTracks::_capnpPrivate::dataWordSize; +constexpr uint16_t LiveTracks::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LiveTracks::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LiveTracks::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ControlsState +constexpr uint16_t ControlsState::_capnpPrivate::dataWordSize; +constexpr uint16_t ControlsState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ControlsState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ControlsState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ControlsState::LateralINDIState +constexpr uint16_t ControlsState::LateralINDIState::_capnpPrivate::dataWordSize; +constexpr uint16_t ControlsState::LateralINDIState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ControlsState::LateralINDIState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ControlsState::LateralINDIState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ControlsState::LateralPIDState +constexpr uint16_t ControlsState::LateralPIDState::_capnpPrivate::dataWordSize; +constexpr uint16_t ControlsState::LateralPIDState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ControlsState::LateralPIDState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ControlsState::LateralPIDState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ControlsState::LateralLQRState +constexpr uint16_t ControlsState::LateralLQRState::_capnpPrivate::dataWordSize; +constexpr uint16_t ControlsState::LateralLQRState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ControlsState::LateralLQRState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ControlsState::LateralLQRState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ControlsState::LateralAngleState +constexpr uint16_t ControlsState::LateralAngleState::_capnpPrivate::dataWordSize; +constexpr uint16_t ControlsState::LateralAngleState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ControlsState::LateralAngleState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ControlsState::LateralAngleState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ControlsState::LateralDebugState +constexpr uint16_t ControlsState::LateralDebugState::_capnpPrivate::dataWordSize; +constexpr uint16_t ControlsState::LateralDebugState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ControlsState::LateralDebugState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ControlsState::LateralDebugState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ControlsState::LateralControlState +constexpr uint16_t ControlsState::LateralControlState::_capnpPrivate::dataWordSize; +constexpr uint16_t ControlsState::LateralControlState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ControlsState::LateralControlState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ControlsState::LateralControlState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ModelDataV2 +constexpr uint16_t ModelDataV2::_capnpPrivate::dataWordSize; +constexpr uint16_t ModelDataV2::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ModelDataV2::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ModelDataV2::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ModelDataV2::XYZTData +constexpr uint16_t ModelDataV2::XYZTData::_capnpPrivate::dataWordSize; +constexpr uint16_t ModelDataV2::XYZTData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ModelDataV2::XYZTData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ModelDataV2::XYZTData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ModelDataV2::LeadDataV2 +constexpr uint16_t ModelDataV2::LeadDataV2::_capnpPrivate::dataWordSize; +constexpr uint16_t ModelDataV2::LeadDataV2::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ModelDataV2::LeadDataV2::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ModelDataV2::LeadDataV2::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ModelDataV2::LeadDataV3 +constexpr uint16_t ModelDataV2::LeadDataV3::_capnpPrivate::dataWordSize; +constexpr uint16_t ModelDataV2::LeadDataV3::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ModelDataV2::LeadDataV3::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ModelDataV2::LeadDataV3::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ModelDataV2::MetaData +constexpr uint16_t ModelDataV2::MetaData::_capnpPrivate::dataWordSize; +constexpr uint16_t ModelDataV2::MetaData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ModelDataV2::MetaData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ModelDataV2::MetaData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ModelDataV2::DisengagePredictions +constexpr uint16_t ModelDataV2::DisengagePredictions::_capnpPrivate::dataWordSize; +constexpr uint16_t ModelDataV2::DisengagePredictions::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ModelDataV2::DisengagePredictions::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ModelDataV2::DisengagePredictions::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// EncodeIndex +constexpr uint16_t EncodeIndex::_capnpPrivate::dataWordSize; +constexpr uint16_t EncodeIndex::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind EncodeIndex::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* EncodeIndex::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// AndroidLogEntry +constexpr uint16_t AndroidLogEntry::_capnpPrivate::dataWordSize; +constexpr uint16_t AndroidLogEntry::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind AndroidLogEntry::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* AndroidLogEntry::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LongitudinalPlan +constexpr uint16_t LongitudinalPlan::_capnpPrivate::dataWordSize; +constexpr uint16_t LongitudinalPlan::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LongitudinalPlan::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LongitudinalPlan::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LongitudinalPlan::GpsTrajectory +constexpr uint16_t LongitudinalPlan::GpsTrajectory::_capnpPrivate::dataWordSize; +constexpr uint16_t LongitudinalPlan::GpsTrajectory::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LongitudinalPlan::GpsTrajectory::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LongitudinalPlan::GpsTrajectory::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LateralPlan +constexpr uint16_t LateralPlan::_capnpPrivate::dataWordSize; +constexpr uint16_t LateralPlan::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LateralPlan::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LateralPlan::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LiveLocationKalman +constexpr uint16_t LiveLocationKalman::_capnpPrivate::dataWordSize; +constexpr uint16_t LiveLocationKalman::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LiveLocationKalman::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LiveLocationKalman::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LiveLocationKalman::Measurement +constexpr uint16_t LiveLocationKalman::Measurement::_capnpPrivate::dataWordSize; +constexpr uint16_t LiveLocationKalman::Measurement::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LiveLocationKalman::Measurement::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LiveLocationKalman::Measurement::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ProcLog +constexpr uint16_t ProcLog::_capnpPrivate::dataWordSize; +constexpr uint16_t ProcLog::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ProcLog::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ProcLog::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ProcLog::Process +constexpr uint16_t ProcLog::Process::_capnpPrivate::dataWordSize; +constexpr uint16_t ProcLog::Process::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ProcLog::Process::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ProcLog::Process::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ProcLog::CPUTimes +constexpr uint16_t ProcLog::CPUTimes::_capnpPrivate::dataWordSize; +constexpr uint16_t ProcLog::CPUTimes::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ProcLog::CPUTimes::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ProcLog::CPUTimes::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ProcLog::Mem +constexpr uint16_t ProcLog::Mem::_capnpPrivate::dataWordSize; +constexpr uint16_t ProcLog::Mem::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ProcLog::Mem::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ProcLog::Mem::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// UbloxGnss +constexpr uint16_t UbloxGnss::_capnpPrivate::dataWordSize; +constexpr uint16_t UbloxGnss::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind UbloxGnss::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* UbloxGnss::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// UbloxGnss::MeasurementReport +constexpr uint16_t UbloxGnss::MeasurementReport::_capnpPrivate::dataWordSize; +constexpr uint16_t UbloxGnss::MeasurementReport::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind UbloxGnss::MeasurementReport::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* UbloxGnss::MeasurementReport::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// UbloxGnss::MeasurementReport::ReceiverStatus +constexpr uint16_t UbloxGnss::MeasurementReport::ReceiverStatus::_capnpPrivate::dataWordSize; +constexpr uint16_t UbloxGnss::MeasurementReport::ReceiverStatus::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind UbloxGnss::MeasurementReport::ReceiverStatus::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* UbloxGnss::MeasurementReport::ReceiverStatus::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// UbloxGnss::MeasurementReport::Measurement +constexpr uint16_t UbloxGnss::MeasurementReport::Measurement::_capnpPrivate::dataWordSize; +constexpr uint16_t UbloxGnss::MeasurementReport::Measurement::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind UbloxGnss::MeasurementReport::Measurement::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* UbloxGnss::MeasurementReport::Measurement::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// UbloxGnss::MeasurementReport::Measurement::TrackingStatus +constexpr uint16_t UbloxGnss::MeasurementReport::Measurement::TrackingStatus::_capnpPrivate::dataWordSize; +constexpr uint16_t UbloxGnss::MeasurementReport::Measurement::TrackingStatus::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind UbloxGnss::MeasurementReport::Measurement::TrackingStatus::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* UbloxGnss::MeasurementReport::Measurement::TrackingStatus::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// UbloxGnss::Ephemeris +constexpr uint16_t UbloxGnss::Ephemeris::_capnpPrivate::dataWordSize; +constexpr uint16_t UbloxGnss::Ephemeris::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind UbloxGnss::Ephemeris::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* UbloxGnss::Ephemeris::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// UbloxGnss::IonoData +constexpr uint16_t UbloxGnss::IonoData::_capnpPrivate::dataWordSize; +constexpr uint16_t UbloxGnss::IonoData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind UbloxGnss::IonoData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* UbloxGnss::IonoData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// UbloxGnss::HwStatus +constexpr uint16_t UbloxGnss::HwStatus::_capnpPrivate::dataWordSize; +constexpr uint16_t UbloxGnss::HwStatus::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind UbloxGnss::HwStatus::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* UbloxGnss::HwStatus::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// UbloxGnss::HwStatus2 +constexpr uint16_t UbloxGnss::HwStatus2::_capnpPrivate::dataWordSize; +constexpr uint16_t UbloxGnss::HwStatus2::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind UbloxGnss::HwStatus2::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* UbloxGnss::HwStatus2::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Clocks +constexpr uint16_t Clocks::_capnpPrivate::dataWordSize; +constexpr uint16_t Clocks::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Clocks::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Clocks::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LiveMpcData +constexpr uint16_t LiveMpcData::_capnpPrivate::dataWordSize; +constexpr uint16_t LiveMpcData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LiveMpcData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LiveMpcData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LiveLongitudinalMpcData +constexpr uint16_t LiveLongitudinalMpcData::_capnpPrivate::dataWordSize; +constexpr uint16_t LiveLongitudinalMpcData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LiveLongitudinalMpcData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LiveLongitudinalMpcData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Joystick +constexpr uint16_t Joystick::_capnpPrivate::dataWordSize; +constexpr uint16_t Joystick::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Joystick::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Joystick::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// DriverState +constexpr uint16_t DriverState::_capnpPrivate::dataWordSize; +constexpr uint16_t DriverState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind DriverState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* DriverState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// DriverMonitoringState +constexpr uint16_t DriverMonitoringState::_capnpPrivate::dataWordSize; +constexpr uint16_t DriverMonitoringState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind DriverMonitoringState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* DriverMonitoringState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Boot +constexpr uint16_t Boot::_capnpPrivate::dataWordSize; +constexpr uint16_t Boot::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Boot::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Boot::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LiveParametersData +constexpr uint16_t LiveParametersData::_capnpPrivate::dataWordSize; +constexpr uint16_t LiveParametersData::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LiveParametersData::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LiveParametersData::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// LiveMapDataDEPRECATED +constexpr uint16_t LiveMapDataDEPRECATED::_capnpPrivate::dataWordSize; +constexpr uint16_t LiveMapDataDEPRECATED::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind LiveMapDataDEPRECATED::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* LiveMapDataDEPRECATED::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// CameraOdometry +constexpr uint16_t CameraOdometry::_capnpPrivate::dataWordSize; +constexpr uint16_t CameraOdometry::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind CameraOdometry::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CameraOdometry::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Sentinel +constexpr uint16_t Sentinel::_capnpPrivate::dataWordSize; +constexpr uint16_t Sentinel::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Sentinel::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Sentinel::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ManagerState +constexpr uint16_t ManagerState::_capnpPrivate::dataWordSize; +constexpr uint16_t ManagerState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ManagerState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ManagerState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// ManagerState::ProcessState +constexpr uint16_t ManagerState::ProcessState::_capnpPrivate::dataWordSize; +constexpr uint16_t ManagerState::ProcessState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind ManagerState::ProcessState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ManagerState::ProcessState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// UploaderState +constexpr uint16_t UploaderState::_capnpPrivate::dataWordSize; +constexpr uint16_t UploaderState::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind UploaderState::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* UploaderState::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// NavInstruction +constexpr uint16_t NavInstruction::_capnpPrivate::dataWordSize; +constexpr uint16_t NavInstruction::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind NavInstruction::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* NavInstruction::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// NavInstruction::Lane +constexpr uint16_t NavInstruction::Lane::_capnpPrivate::dataWordSize; +constexpr uint16_t NavInstruction::Lane::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind NavInstruction::Lane::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* NavInstruction::Lane::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// NavRoute +constexpr uint16_t NavRoute::_capnpPrivate::dataWordSize; +constexpr uint16_t NavRoute::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind NavRoute::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* NavRoute::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// NavRoute::Coordinate +constexpr uint16_t NavRoute::Coordinate::_capnpPrivate::dataWordSize; +constexpr uint16_t NavRoute::Coordinate::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind NavRoute::Coordinate::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* NavRoute::Coordinate::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Event +constexpr uint16_t Event::_capnpPrivate::dataWordSize; +constexpr uint16_t Event::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Event::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Event::_capnpPrivate::schema; +#endif // !CAPNP_LITE + + +} // namespace + diff --git a/cereal/gen/cpp/log.capnp.h b/cereal/gen/cpp/log.capnp.h new file mode 100644 index 000000000..b088a1c32 --- /dev/null +++ b/cereal/gen/cpp/log.capnp.h @@ -0,0 +1,35461 @@ +// Generated by Cap'n Proto compiler, DO NOT EDIT +// source: log.capnp + +#pragma once + +#include +#include + +#if CAPNP_VERSION != 8000 +#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." +#endif + +#include "car.capnp.h" +#include "legacy.capnp.h" + +namespace capnp { +namespace schemas { + +CAPNP_DECLARE_SCHEMA(d578fb3372ed5043); +CAPNP_DECLARE_SCHEMA(f8b13ce2183eb696); +CAPNP_DECLARE_SCHEMA(a5dfdd084a6eea0e); +CAPNP_DECLARE_SCHEMA(e71008caeb3fb65c); +CAPNP_DECLARE_SCHEMA(9d5d7238eba86608); +enum class DeviceType_9d5d7238eba86608: uint16_t { + UNKNOWN, + NEO, + CHFFR_ANDROID, + CHFFR_IOS, + TICI, + PC, +}; +CAPNP_DECLARE_ENUM(DeviceType, 9d5d7238eba86608); +CAPNP_DECLARE_SCHEMA(e673e8725cdff0ad); +CAPNP_DECLARE_SCHEMA(fe2919d5c21f426c); +CAPNP_DECLARE_SCHEMA(9b513b93a887dbcd); +CAPNP_DECLARE_SCHEMA(9cfb5d53a4f615a5); +CAPNP_DECLARE_SCHEMA(d97e3b28239f5580); +CAPNP_DECLARE_SCHEMA(ea0245f695ae0a33); +CAPNP_DECLARE_SCHEMA(ddb169f01e102879); +enum class FrameType_ddb169f01e102879: uint16_t { + UNKNOWN, + NEO, + CHFFR_ANDROID, + FRONT, +}; +CAPNP_DECLARE_ENUM(FrameType, ddb169f01e102879); +CAPNP_DECLARE_SCHEMA(bcc3efbac41d2048); +CAPNP_DECLARE_SCHEMA(b65fce64120af7d3); +CAPNP_DECLARE_SCHEMA(9d291d7813ba4a88); +CAPNP_DECLARE_SCHEMA(a2b29a69d44529a1); +CAPNP_DECLARE_SCHEMA(a43429bd2bfc24fc); +CAPNP_DECLARE_SCHEMA(e49b3ce8f7f48d0d); +enum class SensorSource_e49b3ce8f7f48d0d: uint16_t { + ANDROID, + I_O_S, + FIBER, + VELODYNE, + BNO055, + LSM6DS3, + BMP280, + MMC3416X, + BMX055, + RPR0521, + LSM6DS3TRC, + MMC5603NJ, +}; +CAPNP_DECLARE_ENUM(SensorSource, e49b3ce8f7f48d0d); +CAPNP_DECLARE_SCHEMA(e946524859add50e); +CAPNP_DECLARE_SCHEMA(d3ff79f25c734863); +enum class SensorSource_d3ff79f25c734863: uint16_t { + ANDROID, + I_O_S, + CAR, + VELODYNE, + FUSION, + EXTERNAL, + UBLOX, + TRIMBLE, +}; +CAPNP_DECLARE_ENUM(SensorSource, d3ff79f25c734863); +CAPNP_DECLARE_SCHEMA(8785009a964c7c59); +CAPNP_DECLARE_SCHEMA(a4d8b5af2aa492eb); +CAPNP_DECLARE_SCHEMA(d0790029853df66f); +CAPNP_DECLARE_SCHEMA(af0f7110c254f77e); +enum class ThermalStatus_af0f7110c254f77e: uint16_t { + GREEN, + YELLOW, + RED, + DANGER, +}; +CAPNP_DECLARE_ENUM(ThermalStatus, af0f7110c254f77e); +CAPNP_DECLARE_SCHEMA(bbc79cc958d1049d); +enum class NetworkType_bbc79cc958d1049d: uint16_t { + NONE, + WIFI, + CELL2_G, + CELL3_G, + CELL4_G, + CELL5_G, + ETHERNET, +}; +CAPNP_DECLARE_ENUM(NetworkType, bbc79cc958d1049d); +CAPNP_DECLARE_SCHEMA(dd308c8a13203e13); +enum class NetworkStrength_dd308c8a13203e13: uint16_t { + UNKNOWN, + POOR, + MODERATE, + GOOD, + GREAT, +}; +CAPNP_DECLARE_ENUM(NetworkStrength, dd308c8a13203e13); +CAPNP_DECLARE_SCHEMA(9d57532d82c04afc); +CAPNP_DECLARE_SCHEMA(a7649e2575e4591e); +CAPNP_DECLARE_SCHEMA(f2fd0b8b0ac9adbb); +enum class FaultStatus_f2fd0b8b0ac9adbb: uint16_t { + NONE, + FAULT_TEMP, + FAULT_PERM, +}; +CAPNP_DECLARE_ENUM(FaultStatus, f2fd0b8b0ac9adbb); +CAPNP_DECLARE_SCHEMA(cd55c07f69249798); +enum class FaultType_cd55c07f69249798: uint16_t { + RELAY_MALFUNCTION, + UNUSED_INTERRUPT_HANDLED, + INTERRUPT_RATE_CAN1, + INTERRUPT_RATE_CAN2, + INTERRUPT_RATE_CAN3, + INTERRUPT_RATE_TACH, + INTERRUPT_RATE_GMLAN, + INTERRUPT_RATE_INTERRUPTS, + INTERRUPT_RATE_SPI_DMA, + INTERRUPT_RATE_SPI_CS, + INTERRUPT_RATE_UART1, + INTERRUPT_RATE_UART2, + INTERRUPT_RATE_UART3, + INTERRUPT_RATE_UART5, + INTERRUPT_RATE_UART_DMA, + INTERRUPT_RATE_USB, + INTERRUPT_RATE_TIM1, + INTERRUPT_RATE_TIM3, + REGISTER_DIVERGENT, + INTERRUPT_RATE_KLINE_INIT, + INTERRUPT_RATE_CLOCK_SOURCE, + INTERRUPT_RATE_TICK, +}; +CAPNP_DECLARE_ENUM(FaultType, cd55c07f69249798); +CAPNP_DECLARE_SCHEMA(8a58adf93e5b3751); +enum class PandaType_8a58adf93e5b3751: uint16_t { + UNKNOWN, + WHITE_PANDA, + GREY_PANDA, + BLACK_PANDA, + PEDAL, + UNO, + DOS, + RED_PANDA, +}; +CAPNP_DECLARE_ENUM(PandaType, 8a58adf93e5b3751); +CAPNP_DECLARE_SCHEMA(f69a3ed1e8c081bf); +enum class HarnessStatus_f69a3ed1e8c081bf: uint16_t { + NOT_CONNECTED, + NORMAL, + FLIPPED, +}; +CAPNP_DECLARE_ENUM(HarnessStatus, f69a3ed1e8c081bf); +CAPNP_DECLARE_SCHEMA(ceb8f49734857a88); +CAPNP_DECLARE_SCHEMA(a8883583b32c9877); +enum class UsbPowerMode_a8883583b32c9877: uint16_t { + NONE, + CLIENT, + CDP, + DCP, +}; +CAPNP_DECLARE_ENUM(UsbPowerMode, a8883583b32c9877); +CAPNP_DECLARE_SCHEMA(9a185389d6fdd05f); +CAPNP_DECLARE_SCHEMA(b96f3ad9170cf085); +CAPNP_DECLARE_SCHEMA(96df70754d8390bc); +CAPNP_DECLARE_SCHEMA(8faa644732dec251); +CAPNP_DECLARE_SCHEMA(97ff69c53601abf1); +CAPNP_DECLARE_SCHEMA(dbe58b96d2d1ac61); +enum class OpenpilotState_dbe58b96d2d1ac61: uint16_t { + DISABLED, + PRE_ENABLED, + ENABLED, + SOFT_DISABLING, +}; +CAPNP_DECLARE_ENUM(OpenpilotState, dbe58b96d2d1ac61); +CAPNP_DECLARE_SCHEMA(a0d0dcd113193c62); +enum class AlertStatus_a0d0dcd113193c62: uint16_t { + NORMAL, + USER_PROMPT, + CRITICAL, +}; +CAPNP_DECLARE_ENUM(AlertStatus, a0d0dcd113193c62); +CAPNP_DECLARE_SCHEMA(e98bb99d6e985f64); +enum class AlertSize_e98bb99d6e985f64: uint16_t { + NONE, + SMALL, + MID, + FULL, +}; +CAPNP_DECLARE_ENUM(AlertSize, e98bb99d6e985f64); +CAPNP_DECLARE_SCHEMA(939463348632375e); +CAPNP_DECLARE_SCHEMA(f28c5dc9e09375e3); +CAPNP_DECLARE_SCHEMA(9024e2d790c82ade); +CAPNP_DECLARE_SCHEMA(a2e4ea88ac9980f1); +CAPNP_DECLARE_SCHEMA(a63a46f0f2889b2d); +CAPNP_DECLARE_SCHEMA(fd5b914d6b444695); +CAPNP_DECLARE_SCHEMA(c4713f6b0d36abe9); +CAPNP_DECLARE_SCHEMA(c3cbae1fd505ae80); +CAPNP_DECLARE_SCHEMA(a444ed2b2187af28); +CAPNP_DECLARE_SCHEMA(d698881ad0ce7feb); +CAPNP_DECLARE_SCHEMA(d1646ab3b45cfabd); +CAPNP_DECLARE_SCHEMA(860aa5ddbcdc8d25); +CAPNP_DECLARE_SCHEMA(89d394e3541735fc); +CAPNP_DECLARE_SCHEMA(c0ad259ec157ccd3); +enum class Type_c0ad259ec157ccd3: uint16_t { + BIG_BOX_LOSSLESS, + FULL_H_E_V_C, + BIG_BOX_H_E_V_C, + CHFFR_ANDROID_H264, + FULL_LOSSLESS_CLIP, + FRONT, +}; +CAPNP_DECLARE_ENUM(Type, c0ad259ec157ccd3); +CAPNP_DECLARE_SCHEMA(ea095da1894f7d85); +CAPNP_DECLARE_SCHEMA(e00b5b3eba12876c); +CAPNP_DECLARE_SCHEMA(b231a753cc079120); +enum class LongitudinalPlanSource_b231a753cc079120: uint16_t { + CRUISE, + LEAD0, + LEAD1, + LEAD2, + E2E, +}; +CAPNP_DECLARE_ENUM(LongitudinalPlanSource, b231a753cc079120); +CAPNP_DECLARE_SCHEMA(8cfeb072f5301000); +CAPNP_DECLARE_SCHEMA(e1e9318e2ae8b51e); +CAPNP_DECLARE_SCHEMA(bb53ef3fcf2a7f0d); +enum class Desire_bb53ef3fcf2a7f0d: uint16_t { + NONE, + TURN_LEFT, + TURN_RIGHT, + LANE_CHANGE_LEFT, + LANE_CHANGE_RIGHT, + KEEP_LEFT, + KEEP_RIGHT, +}; +CAPNP_DECLARE_ENUM(Desire, bb53ef3fcf2a7f0d); +CAPNP_DECLARE_SCHEMA(fac297f195ce56d2); +enum class LaneChangeState_fac297f195ce56d2: uint16_t { + OFF, + PRE_LANE_CHANGE, + LANE_CHANGE_STARTING, + LANE_CHANGE_FINISHING, +}; +CAPNP_DECLARE_ENUM(LaneChangeState, fac297f195ce56d2); +CAPNP_DECLARE_SCHEMA(f7396311bcbad303); +enum class LaneChangeDirection_f7396311bcbad303: uint16_t { + NONE, + LEFT, + RIGHT, +}; +CAPNP_DECLARE_ENUM(LaneChangeDirection, f7396311bcbad303); +CAPNP_DECLARE_SCHEMA(ebc5703d1ee7c129); +CAPNP_DECLARE_SCHEMA(8e4dc8cc4b51fc01); +enum class Status_8e4dc8cc4b51fc01: uint16_t { + UNINITIALIZED, + UNCALIBRATED, + VALID, +}; +CAPNP_DECLARE_ENUM(Status, 8e4dc8cc4b51fc01); +CAPNP_DECLARE_SCHEMA(bf23f9ed66dace1c); +CAPNP_DECLARE_SCHEMA(af85387b3f681406); +CAPNP_DECLARE_SCHEMA(b0b85613f19e6d28); +CAPNP_DECLARE_SCHEMA(f189c8c5bf2ce087); +CAPNP_DECLARE_SCHEMA(fd095f94f08b3fd4); +CAPNP_DECLARE_SCHEMA(85dddd7ce6cefa5d); +CAPNP_DECLARE_SCHEMA(a73ba546a29820f4); +CAPNP_DECLARE_SCHEMA(fbb838d65160aab6); +CAPNP_DECLARE_SCHEMA(8f8a655f5e326401); +CAPNP_DECLARE_SCHEMA(e8efb3a802b299b2); +CAPNP_DECLARE_SCHEMA(d8418c788118f85c); +CAPNP_DECLARE_SCHEMA(c3a3a8de519a4a26); +CAPNP_DECLARE_SCHEMA(ebb036b114275aa8); +CAPNP_DECLARE_SCHEMA(c23e1128ab4d5b53); +enum class AntennaSupervisorState_c23e1128ab4d5b53: uint16_t { + INIT, + DONTKNOW, + OK, + SHORT, + OPEN, +}; +CAPNP_DECLARE_ENUM(AntennaSupervisorState, c23e1128ab4d5b53); +CAPNP_DECLARE_SCHEMA(fe3b51a924e46559); +enum class AntennaPowerStatus_fe3b51a924e46559: uint16_t { + OFF, + ON, + DONTKNOW, +}; +CAPNP_DECLARE_ENUM(AntennaPowerStatus, fe3b51a924e46559); +CAPNP_DECLARE_SCHEMA(f919b410b90e53c6); +CAPNP_DECLARE_SCHEMA(b2d0985eb51c97b9); +enum class ConfigSource_b2d0985eb51c97b9: uint16_t { + UNDEFINED, + ROM, + OTP, + CONFIGPINS, + FLASH, +}; +CAPNP_DECLARE_ENUM(ConfigSource, b2d0985eb51c97b9); +CAPNP_DECLARE_SCHEMA(c95fb49a7bdc4618); +CAPNP_DECLARE_SCHEMA(92a5e332a85f32a0); +CAPNP_DECLARE_SCHEMA(e7e17c434f865ae2); +CAPNP_DECLARE_SCHEMA(e42401658e2715e2); +CAPNP_DECLARE_SCHEMA(b83c6cc593ed0a00); +CAPNP_DECLARE_SCHEMA(b83cda094a1da284); +CAPNP_DECLARE_SCHEMA(a12e8670927a2549); +CAPNP_DECLARE_SCHEMA(d9058dcb967c2753); +CAPNP_DECLARE_SCHEMA(943e268f93f711a6); +CAPNP_DECLARE_SCHEMA(fa9a296b9fd41a96); +CAPNP_DECLARE_SCHEMA(ef0382d244f56e38); +CAPNP_DECLARE_SCHEMA(a2d8e61eb6f7031a); +enum class SentinelType_a2d8e61eb6f7031a: uint16_t { + END_OF_SEGMENT, + END_OF_ROUTE, + START_OF_SEGMENT, + START_OF_ROUTE, +}; +CAPNP_DECLARE_ENUM(SentinelType, a2d8e61eb6f7031a); +CAPNP_DECLARE_SCHEMA(cf7154b31a69635b); +CAPNP_DECLARE_SCHEMA(869a54d2708469ea); +CAPNP_DECLARE_SCHEMA(de266b39b76b461e); +CAPNP_DECLARE_SCHEMA(c18216b27f8602af); +CAPNP_DECLARE_SCHEMA(a4cd1689c0a439d9); +CAPNP_DECLARE_SCHEMA(eea5b9d8c9e5c192); +enum class Direction_eea5b9d8c9e5c192: uint16_t { + NONE, + LEFT, + RIGHT, + STRAIGHT, +}; +CAPNP_DECLARE_ENUM(Direction, eea5b9d8c9e5c192); +CAPNP_DECLARE_SCHEMA(a61452f6440d97d3); +CAPNP_DECLARE_SCHEMA(c4c96f53ad1e7485); +CAPNP_DECLARE_SCHEMA(d314cfd957229c11); + +} // namespace schemas +} // namespace capnp + +namespace cereal { + +static constexpr ::int32_t LOG_VERSION = 1; +template +struct Map { + Map() = delete; + + class Reader; + class Builder; + class Pipeline; + struct Entry; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(f8b13ce2183eb696, 0, 1) + #if !CAPNP_LITE + static const ::capnp::_::RawBrandedSchema::Scope brandScopes[]; + static const ::capnp::_::RawBrandedSchema::Binding brandBindings[]; + static const ::capnp::_::RawBrandedSchema::Dependency brandDependencies[]; + static const ::capnp::_::RawBrandedSchema specificBrand; + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return ::capnp::_::ChooseBrand<_capnpPrivate, Key, Value>::brand(); } + #endif // !CAPNP_LITE + }; +}; + +template +struct Map::Entry { + Entry() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a5dfdd084a6eea0e, 0, 2) + #if !CAPNP_LITE + static const ::capnp::_::RawBrandedSchema::Scope brandScopes[]; + static const ::capnp::_::RawBrandedSchema::Binding brandBindings[]; + static const ::capnp::_::RawBrandedSchema specificBrand; + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return ::capnp::_::ChooseBrand<_capnpPrivate, Key, Value>::brand(); } + #endif // !CAPNP_LITE + }; +}; + +struct InitData { + InitData() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::DeviceType_9d5d7238eba86608 DeviceType; + + struct PandaInfo; + struct AndroidBuildInfo; + struct AndroidSensor; + struct ChffrAndroidExtra; + struct IosBuildInfo; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e71008caeb3fb65c, 1, 16) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct InitData::PandaInfo { + PandaInfo() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e673e8725cdff0ad, 1, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct InitData::AndroidBuildInfo { + AndroidBuildInfo() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(fe2919d5c21f426c, 2, 21) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct InitData::AndroidSensor { + AndroidSensor() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(9b513b93a887dbcd, 6, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct InitData::ChffrAndroidExtra { + ChffrAndroidExtra() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(9cfb5d53a4f615a5, 0, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct InitData::IosBuildInfo { + IosBuildInfo() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d97e3b28239f5580, 1, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct FrameData { + FrameData() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::FrameType_ddb169f01e102879 FrameType; + + struct AndroidCaptureResult; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(ea0245f695ae0a33, 9, 6) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct FrameData::AndroidCaptureResult { + AndroidCaptureResult() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(bcc3efbac41d2048, 4, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Thumbnail { + Thumbnail() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(b65fce64120af7d3, 2, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct GPSNMEAData { + GPSNMEAData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(9d291d7813ba4a88, 2, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct SensorEventData { + SensorEventData() = delete; + + class Reader; + class Builder; + class Pipeline; + enum Which: uint16_t { + ACCELERATION, + MAGNETIC, + ORIENTATION, + GYRO, + PRESSURE, + MAGNETIC_UNCALIBRATED, + GYRO_UNCALIBRATED, + PROXIMITY, + LIGHT, + TEMPERATURE, + }; + struct SensorVec; + typedef ::capnp::schemas::SensorSource_e49b3ce8f7f48d0d SensorSource; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a2b29a69d44529a1, 4, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct SensorEventData::SensorVec { + SensorVec() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a43429bd2bfc24fc, 1, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct GpsLocationData { + GpsLocationData() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::SensorSource_d3ff79f25c734863 SensorSource; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e946524859add50e, 8, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CanData { + CanData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(8785009a964c7c59, 1, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct DeviceState { + DeviceState() = delete; + + class Reader; + class Builder; + class Pipeline; + struct ThermalZone; + typedef ::capnp::schemas::ThermalStatus_af0f7110c254f77e ThermalStatus; + + typedef ::capnp::schemas::NetworkType_bbc79cc958d1049d NetworkType; + + typedef ::capnp::schemas::NetworkStrength_dd308c8a13203e13 NetworkStrength; + + struct NetworkInfo; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a4d8b5af2aa492eb, 11, 9) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct DeviceState::ThermalZone { + ThermalZone() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d0790029853df66f, 1, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct DeviceState::NetworkInfo { + NetworkInfo() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(9d57532d82c04afc, 1, 5) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct PandaState { + PandaState() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::FaultStatus_f2fd0b8b0ac9adbb FaultStatus; + + typedef ::capnp::schemas::FaultType_cd55c07f69249798 FaultType; + + typedef ::capnp::schemas::PandaType_8a58adf93e5b3751 PandaType; + + typedef ::capnp::schemas::HarnessStatus_f69a3ed1e8c081bf HarnessStatus; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a7649e2575e4591e, 7, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct PeripheralState { + PeripheralState() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::UsbPowerMode_a8883583b32c9877 UsbPowerMode; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(ceb8f49734857a88, 2, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct RadarState { + RadarState() = delete; + + class Reader; + class Builder; + class Pipeline; + struct LeadData; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(9a185389d6fdd05f, 5, 5) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct RadarState::LeadData { + LeadData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(b96f3ad9170cf085, 7, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LiveCalibrationData { + LiveCalibrationData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(96df70754d8390bc, 2, 6) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LiveTracks { + LiveTracks() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(8faa644732dec251, 5, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ControlsState { + ControlsState() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::OpenpilotState_dbe58b96d2d1ac61 OpenpilotState; + + typedef ::capnp::schemas::AlertStatus_a0d0dcd113193c62 AlertStatus; + + typedef ::capnp::schemas::AlertSize_e98bb99d6e985f64 AlertSize; + + struct LateralINDIState; + struct LateralPIDState; + struct LateralLQRState; + struct LateralAngleState; + struct LateralDebugState; + struct LateralControlState; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(97ff69c53601abf1, 22, 6) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ControlsState::LateralINDIState { + LateralINDIState() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(939463348632375e, 6, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ControlsState::LateralPIDState { + LateralPIDState() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(f28c5dc9e09375e3, 5, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ControlsState::LateralLQRState { + LateralLQRState() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(9024e2d790c82ade, 3, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ControlsState::LateralAngleState { + LateralAngleState() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a2e4ea88ac9980f1, 2, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ControlsState::LateralDebugState { + LateralDebugState() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a63a46f0f2889b2d, 2, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ControlsState::LateralControlState { + LateralControlState() = delete; + + class Reader; + class Builder; + class Pipeline; + enum Which: uint16_t { + INDI_STATE, + PID_STATE, + LQR_STATE, + ANGLE_STATE, + DEBUG_STATE, + }; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(fd5b914d6b444695, 22, 6) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ModelDataV2 { + ModelDataV2() = delete; + + class Reader; + class Builder; + class Pipeline; + struct XYZTData; + struct LeadDataV2; + struct LeadDataV3; + struct MetaData; + struct DisengagePredictions; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(c4713f6b0d36abe9, 4, 14) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ModelDataV2::XYZTData { + XYZTData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(c3cbae1fd505ae80, 0, 7) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ModelDataV2::LeadDataV2 { + LeadDataV2() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a444ed2b2187af28, 1, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ModelDataV2::LeadDataV3 { + LeadDataV3() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d698881ad0ce7feb, 1, 9) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ModelDataV2::MetaData { + MetaData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d1646ab3b45cfabd, 3, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ModelDataV2::DisengagePredictions { + DisengagePredictions() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(860aa5ddbcdc8d25, 0, 7) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct EncodeIndex { + EncodeIndex() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::Type_c0ad259ec157ccd3 Type; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(89d394e3541735fc, 5, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct AndroidLogEntry { + AndroidLogEntry() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(ea095da1894f7d85, 3, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LongitudinalPlan { + LongitudinalPlan() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::LongitudinalPlanSource_b231a753cc079120 LongitudinalPlanSource; + + struct GpsTrajectory; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e00b5b3eba12876c, 10, 6) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LongitudinalPlan::GpsTrajectory { + GpsTrajectory() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(8cfeb072f5301000, 0, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LateralPlan { + LateralPlan() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::Desire_bb53ef3fcf2a7f0d Desire; + + typedef ::capnp::schemas::LaneChangeState_fac297f195ce56d2 LaneChangeState; + + typedef ::capnp::schemas::LaneChangeDirection_f7396311bcbad303 LaneChangeDirection; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e1e9318e2ae8b51e, 8, 8) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LiveLocationKalman { + LiveLocationKalman() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::Status_8e4dc8cc4b51fc01 Status; + + struct Measurement; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(ebc5703d1ee7c129, 4, 14) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LiveLocationKalman::Measurement { + Measurement() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(bf23f9ed66dace1c, 1, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ProcLog { + ProcLog() = delete; + + class Reader; + class Builder; + class Pipeline; + struct Process; + struct CPUTimes; + struct Mem; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(af85387b3f681406, 0, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ProcLog::Process { + Process() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(b0b85613f19e6d28, 9, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ProcLog::CPUTimes { + CPUTimes() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(f189c8c5bf2ce087, 5, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ProcLog::Mem { + Mem() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(fd095f94f08b3fd4, 8, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct UbloxGnss { + UbloxGnss() = delete; + + class Reader; + class Builder; + class Pipeline; + enum Which: uint16_t { + MEASUREMENT_REPORT, + EPHEMERIS, + IONO_DATA, + HW_STATUS, + HW_STATUS2, + }; + struct MeasurementReport; + struct Ephemeris; + struct IonoData; + struct HwStatus; + struct HwStatus2; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(85dddd7ce6cefa5d, 1, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct UbloxGnss::MeasurementReport { + MeasurementReport() = delete; + + class Reader; + class Builder; + class Pipeline; + struct ReceiverStatus; + struct Measurement; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a73ba546a29820f4, 2, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct UbloxGnss::MeasurementReport::ReceiverStatus { + ReceiverStatus() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(fbb838d65160aab6, 1, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct UbloxGnss::MeasurementReport::Measurement { + Measurement() = delete; + + class Reader; + class Builder; + class Pipeline; + struct TrackingStatus; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(8f8a655f5e326401, 5, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct UbloxGnss::MeasurementReport::Measurement::TrackingStatus { + TrackingStatus() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e8efb3a802b299b2, 1, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct UbloxGnss::Ephemeris { + Ephemeris() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d8418c788118f85c, 33, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct UbloxGnss::IonoData { + IonoData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(c3a3a8de519a4a26, 3, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct UbloxGnss::HwStatus { + HwStatus() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::AntennaSupervisorState_c23e1128ab4d5b53 AntennaSupervisorState; + + typedef ::capnp::schemas::AntennaPowerStatus_fe3b51a924e46559 AntennaPowerStatus; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(ebb036b114275aa8, 2, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct UbloxGnss::HwStatus2 { + HwStatus2() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::ConfigSource_b2d0985eb51c97b9 ConfigSource; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(f919b410b90e53c6, 2, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Clocks { + Clocks() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(c95fb49a7bdc4618, 5, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LiveMpcData { + LiveMpcData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(92a5e332a85f32a0, 3, 4) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LiveLongitudinalMpcData { + LiveLongitudinalMpcData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e7e17c434f865ae2, 4, 6) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Joystick { + Joystick() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(e42401658e2715e2, 0, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct DriverState { + DriverState() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(b83c6cc593ed0a00, 9, 6) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct DriverMonitoringState { + DriverMonitoringState() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(b83cda094a1da284, 5, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Boot { + Boot() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a12e8670927a2549, 1, 5) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LiveParametersData { + LiveParametersData() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d9058dcb967c2753, 7, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct LiveMapDataDEPRECATED { + LiveMapDataDEPRECATED() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(943e268f93f711a6, 5, 5) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct CameraOdometry { + CameraOdometry() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(fa9a296b9fd41a96, 2, 4) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Sentinel { + Sentinel() = delete; + + class Reader; + class Builder; + class Pipeline; + typedef ::capnp::schemas::SentinelType_a2d8e61eb6f7031a SentinelType; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(ef0382d244f56e38, 1, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ManagerState { + ManagerState() = delete; + + class Reader; + class Builder; + class Pipeline; + struct ProcessState; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(cf7154b31a69635b, 0, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct ManagerState::ProcessState { + ProcessState() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(869a54d2708469ea, 2, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct UploaderState { + UploaderState() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(de266b39b76b461e, 3, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct NavInstruction { + NavInstruction() = delete; + + class Reader; + class Builder; + class Pipeline; + struct Lane; + typedef ::capnp::schemas::Direction_eea5b9d8c9e5c192 Direction; + + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(c18216b27f8602af, 3, 5) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct NavInstruction::Lane { + Lane() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a4cd1689c0a439d9, 1, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct NavRoute { + NavRoute() = delete; + + class Reader; + class Builder; + class Pipeline; + struct Coordinate; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a61452f6440d97d3, 0, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct NavRoute::Coordinate { + Coordinate() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(c4c96f53ad1e7485, 1, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Event { + Event() = delete; + + class Reader; + class Builder; + class Pipeline; + enum Which: uint16_t { + INIT_DATA, + ROAD_CAMERA_STATE, + GPS_N_M_E_A, + SENSOR_EVENT_D_E_P_R_E_C_A_T_E_D, + CAN, + DEVICE_STATE, + CONTROLS_STATE, + LIVE_EVENT_D_E_P_R_E_C_A_T_E_D, + MODEL, + FEATURES_D_E_P_R_E_C_A_T_E_D, + SENSOR_EVENTS, + PANDA_STATE_D_E_P_R_E_C_A_T_E_D, + RADAR_STATE, + LIVE_U_I_D_E_P_R_E_C_A_T_E_D, + ROAD_ENCODE_IDX, + LIVE_TRACKS, + SENDCAN, + LOG_MESSAGE, + LIVE_CALIBRATION, + ANDROID_LOG, + GPS_LOCATION_D_E_P_R_E_C_A_T_E_D, + CAR_STATE, + CAR_CONTROL, + LONGITUDINAL_PLAN, + LIVE_LOCATION_D_E_P_R_E_C_A_T_E_D, + ETHERNET_DATA_D_E_P_R_E_C_A_T_E_D, + NAV_UPDATE_D_E_P_R_E_C_A_T_E_D, + CELL_INFO_D_E_P_R_E_C_A_T_E_D, + WIFI_SCAN_D_E_P_R_E_C_A_T_E_D, + ANDROID_GNSS_D_E_P_R_E_C_A_T_E_D, + QCOM_GNSS_D_E_P_R_E_C_A_T_D, + LIDAR_PTS_D_E_P_R_E_C_A_T_E_D, + PROC_LOG, + UBLOX_GNSS, + CLOCKS, + LIVE_MPC_D_E_P_R_E_C_A_T_E_D, + LIVE_LONGITUDINAL_MPC_D_E_P_R_E_C_A_T_E_D, + NAV_STATUS_D_E_P_R_E_C_A_T_E_D, + UBLOX_RAW, + GPS_PLANNER_POINTS_D_E_P_R_E_C_A_T_E_D, + GPS_PLANNER_PLAN_D_E_P_R_E_C_A_T_E_D, + APPLANIX_RAW_D_E_P_R_E_C_A_T_E_D, + TRAFFIC_EVENTS_D_E_P_R_E_C_A_T_E_D, + LIVE_LOCATION_TIMING_D_E_P_R_E_C_A_T_E_D, + ORBSLAM_CORRECTION_D_E_P_R_E_C_A_T_E_D, + LIVE_LOCATION_CORRECTED_D_E_P_R_E_C_A_T_E_D, + ORB_OBSERVATION_D_E_P_R_E_C_A_T_E_D, + GPS_LOCATION_EXTERNAL, + LOCATION_D_E_P_R_E_C_A_T_E_D, + UI_NAVIGATION_EVENT_D_E_P_R_E_C_A_T_E_D, + LIVE_LOCATION_KALMAN_D_E_P_R_E_C_A_T_E_D, + TEST_JOYSTICK, + ORB_ODOMETRY_D_E_P_R_E_C_A_T_E_D, + ORB_FEATURES_D_E_P_R_E_C_A_T_E_D, + APPLANIX_LOCATION_D_E_P_R_E_C_A_T_E_D, + ORB_KEY_FRAME_D_E_P_R_E_C_A_T_E_D, + UI_LAYOUT_STATE_D_E_P_R_E_C_A_T_E_D, + ORB_FEATURES_SUMMARY_D_E_P_R_E_C_A_T_E_D, + DRIVER_STATE, + BOOT, + LIVE_PARAMETERS, + LIVE_MAP_DATA_D_E_P_R_E_C_A_T_E_D, + CAMERA_ODOMETRY, + LATERAL_PLAN, + KALMAN_ODOMETRY_D_E_P_R_E_C_A_T_E_D, + THUMBNAIL, + CAR_EVENTS, + CAR_PARAMS, + DRIVER_CAMERA_STATE, + DRIVER_MONITORING_STATE, + LIVE_LOCATION_KALMAN, + SENTINEL, + WIDE_ROAD_CAMERA_STATE, + MODEL_V2, + DRIVER_ENCODE_IDX, + WIDE_ROAD_ENCODE_IDX, + MANAGER_STATE, + UPLOADER_STATE, + PERIPHERAL_STATE, + PANDA_STATES, + NAV_INSTRUCTION, + NAV_ROUTE, + NAV_THUMBNAIL, + ERROR_LOG_MESSAGE, + }; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d314cfd957229c11, 2, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +// ======================================================================================= + +template +class Map::Reader { +public: + typedef Map Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + template + typename Map::Reader asGeneric() { + return typename Map::Reader(_reader); + } + + inline bool hasEntries() const; + inline typename ::capnp::List::Entry, ::capnp::Kind::STRUCT>::Reader getEntries() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +template +class Map::Builder { +public: + typedef Map Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + template + typename Map::Builder asGeneric() { + return typename Map::Builder(_builder); + } + + inline bool hasEntries(); + inline typename ::capnp::List::Entry, ::capnp::Kind::STRUCT>::Builder getEntries(); + inline void setEntries(typename ::capnp::List::Entry, ::capnp::Kind::STRUCT>::Reader value); + inline typename ::capnp::List::Entry, ::capnp::Kind::STRUCT>::Builder initEntries(unsigned int size); + inline void adoptEntries(::capnp::Orphan< ::capnp::List::Entry, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List::Entry, ::capnp::Kind::STRUCT>> disownEntries(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +template +class Map::Pipeline { +public: + typedef Map Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +template +class Map::Entry::Reader { +public: + typedef Entry Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + template + typename Map::Entry::Reader asMapGeneric() { + return typename Map::Entry::Reader(_reader); + } + + inline bool hasKey() const; + inline ::capnp::ReaderFor getKey() const; + + inline bool hasValue() const; + inline ::capnp::ReaderFor getValue() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +template +class Map::Entry::Builder { +public: + typedef Entry Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + template + typename Map::Entry::Builder asMapGeneric() { + return typename Map::Entry::Builder(_builder); + } + + inline bool hasKey(); + inline ::capnp::BuilderFor getKey(); + inline void setKey( ::capnp::ReaderFor value); + inline ::capnp::BuilderFor initKey(); + inline ::capnp::BuilderFor initKey(unsigned int size); + inline void adoptKey(::capnp::Orphan&& value); + inline ::capnp::Orphan disownKey(); + + inline bool hasValue(); + inline ::capnp::BuilderFor getValue(); + inline void setValue( ::capnp::ReaderFor value); + inline ::capnp::BuilderFor initValue(); + inline ::capnp::BuilderFor initValue(unsigned int size); + inline void adoptValue(::capnp::Orphan&& value); + inline ::capnp::Orphan disownValue(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +template +class Map::Entry::Pipeline { +public: + typedef Entry Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::capnp::PipelineFor getKey(); + inline ::capnp::PipelineFor getValue(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class InitData::Reader { +public: + typedef InitData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasKernelArgs() const; + inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Reader getKernelArgs() const; + + inline bool hasGctxDEPRECATED() const; + inline ::capnp::Text::Reader getGctxDEPRECATED() const; + + inline bool hasDongleId() const; + inline ::capnp::Text::Reader getDongleId() const; + + inline ::cereal::InitData::DeviceType getDeviceType() const; + + inline bool hasVersion() const; + inline ::capnp::Text::Reader getVersion() const; + + inline bool hasAndroidBuildInfo() const; + inline ::cereal::InitData::AndroidBuildInfo::Reader getAndroidBuildInfo() const; + + inline bool hasAndroidSensorsDEPRECATED() const; + inline ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>::Reader getAndroidSensorsDEPRECATED() const; + + inline bool hasChffrAndroidExtraDEPRECATED() const; + inline ::cereal::InitData::ChffrAndroidExtra::Reader getChffrAndroidExtraDEPRECATED() const; + + inline bool hasPandaInfo() const; + inline ::cereal::InitData::PandaInfo::Reader getPandaInfo() const; + + inline bool getDirty() const; + + inline bool hasGitCommit() const; + inline ::capnp::Text::Reader getGitCommit() const; + + inline bool hasGitBranch() const; + inline ::capnp::Text::Reader getGitBranch() const; + + inline bool getPassive() const; + + inline bool hasGitRemote() const; + inline ::capnp::Text::Reader getGitRemote() const; + + inline bool hasIosBuildInfoDEPRECATED() const; + inline ::cereal::InitData::IosBuildInfo::Reader getIosBuildInfoDEPRECATED() const; + + inline bool hasKernelVersion() const; + inline ::capnp::Text::Reader getKernelVersion() const; + + inline bool hasAndroidProperties() const; + inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Reader getAndroidProperties() const; + + inline bool hasParams() const; + inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Reader getParams() const; + + inline bool hasOsVersion() const; + inline ::capnp::Text::Reader getOsVersion() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class InitData::Builder { +public: + typedef InitData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasKernelArgs(); + inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Builder getKernelArgs(); + inline void setKernelArgs( ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Reader value); + inline void setKernelArgs(::kj::ArrayPtr value); + inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Builder initKernelArgs(unsigned int size); + inline void adoptKernelArgs(::capnp::Orphan< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>> disownKernelArgs(); + + inline bool hasGctxDEPRECATED(); + inline ::capnp::Text::Builder getGctxDEPRECATED(); + inline void setGctxDEPRECATED( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initGctxDEPRECATED(unsigned int size); + inline void adoptGctxDEPRECATED(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownGctxDEPRECATED(); + + inline bool hasDongleId(); + inline ::capnp::Text::Builder getDongleId(); + inline void setDongleId( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initDongleId(unsigned int size); + inline void adoptDongleId(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownDongleId(); + + inline ::cereal::InitData::DeviceType getDeviceType(); + inline void setDeviceType( ::cereal::InitData::DeviceType value); + + inline bool hasVersion(); + inline ::capnp::Text::Builder getVersion(); + inline void setVersion( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initVersion(unsigned int size); + inline void adoptVersion(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownVersion(); + + inline bool hasAndroidBuildInfo(); + inline ::cereal::InitData::AndroidBuildInfo::Builder getAndroidBuildInfo(); + inline void setAndroidBuildInfo( ::cereal::InitData::AndroidBuildInfo::Reader value); + inline ::cereal::InitData::AndroidBuildInfo::Builder initAndroidBuildInfo(); + inline void adoptAndroidBuildInfo(::capnp::Orphan< ::cereal::InitData::AndroidBuildInfo>&& value); + inline ::capnp::Orphan< ::cereal::InitData::AndroidBuildInfo> disownAndroidBuildInfo(); + + inline bool hasAndroidSensorsDEPRECATED(); + inline ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>::Builder getAndroidSensorsDEPRECATED(); + inline void setAndroidSensorsDEPRECATED( ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>::Builder initAndroidSensorsDEPRECATED(unsigned int size); + inline void adoptAndroidSensorsDEPRECATED(::capnp::Orphan< ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>> disownAndroidSensorsDEPRECATED(); + + inline bool hasChffrAndroidExtraDEPRECATED(); + inline ::cereal::InitData::ChffrAndroidExtra::Builder getChffrAndroidExtraDEPRECATED(); + inline void setChffrAndroidExtraDEPRECATED( ::cereal::InitData::ChffrAndroidExtra::Reader value); + inline ::cereal::InitData::ChffrAndroidExtra::Builder initChffrAndroidExtraDEPRECATED(); + inline void adoptChffrAndroidExtraDEPRECATED(::capnp::Orphan< ::cereal::InitData::ChffrAndroidExtra>&& value); + inline ::capnp::Orphan< ::cereal::InitData::ChffrAndroidExtra> disownChffrAndroidExtraDEPRECATED(); + + inline bool hasPandaInfo(); + inline ::cereal::InitData::PandaInfo::Builder getPandaInfo(); + inline void setPandaInfo( ::cereal::InitData::PandaInfo::Reader value); + inline ::cereal::InitData::PandaInfo::Builder initPandaInfo(); + inline void adoptPandaInfo(::capnp::Orphan< ::cereal::InitData::PandaInfo>&& value); + inline ::capnp::Orphan< ::cereal::InitData::PandaInfo> disownPandaInfo(); + + inline bool getDirty(); + inline void setDirty(bool value); + + inline bool hasGitCommit(); + inline ::capnp::Text::Builder getGitCommit(); + inline void setGitCommit( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initGitCommit(unsigned int size); + inline void adoptGitCommit(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownGitCommit(); + + inline bool hasGitBranch(); + inline ::capnp::Text::Builder getGitBranch(); + inline void setGitBranch( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initGitBranch(unsigned int size); + inline void adoptGitBranch(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownGitBranch(); + + inline bool getPassive(); + inline void setPassive(bool value); + + inline bool hasGitRemote(); + inline ::capnp::Text::Builder getGitRemote(); + inline void setGitRemote( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initGitRemote(unsigned int size); + inline void adoptGitRemote(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownGitRemote(); + + inline bool hasIosBuildInfoDEPRECATED(); + inline ::cereal::InitData::IosBuildInfo::Builder getIosBuildInfoDEPRECATED(); + inline void setIosBuildInfoDEPRECATED( ::cereal::InitData::IosBuildInfo::Reader value); + inline ::cereal::InitData::IosBuildInfo::Builder initIosBuildInfoDEPRECATED(); + inline void adoptIosBuildInfoDEPRECATED(::capnp::Orphan< ::cereal::InitData::IosBuildInfo>&& value); + inline ::capnp::Orphan< ::cereal::InitData::IosBuildInfo> disownIosBuildInfoDEPRECATED(); + + inline bool hasKernelVersion(); + inline ::capnp::Text::Builder getKernelVersion(); + inline void setKernelVersion( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initKernelVersion(unsigned int size); + inline void adoptKernelVersion(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownKernelVersion(); + + inline bool hasAndroidProperties(); + inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Builder getAndroidProperties(); + inline void setAndroidProperties( ::cereal::Map< ::capnp::Text, ::capnp::Text>::Reader value); + inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Builder initAndroidProperties(); + inline void adoptAndroidProperties(::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Text>>&& value); + inline ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Text>> disownAndroidProperties(); + + inline bool hasParams(); + inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Builder getParams(); + inline void setParams( ::cereal::Map< ::capnp::Text, ::capnp::Data>::Reader value); + inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Builder initParams(); + inline void adoptParams(::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Data>>&& value); + inline ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Data>> disownParams(); + + inline bool hasOsVersion(); + inline ::capnp::Text::Builder getOsVersion(); + inline void setOsVersion( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initOsVersion(unsigned int size); + inline void adoptOsVersion(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownOsVersion(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class InitData::Pipeline { +public: + typedef InitData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::InitData::AndroidBuildInfo::Pipeline getAndroidBuildInfo(); + inline ::cereal::InitData::ChffrAndroidExtra::Pipeline getChffrAndroidExtraDEPRECATED(); + inline ::cereal::InitData::PandaInfo::Pipeline getPandaInfo(); + inline ::cereal::InitData::IosBuildInfo::Pipeline getIosBuildInfoDEPRECATED(); + inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Pipeline getAndroidProperties(); + inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Pipeline getParams(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class InitData::PandaInfo::Reader { +public: + typedef PandaInfo Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getHasPanda() const; + + inline bool hasDongleId() const; + inline ::capnp::Text::Reader getDongleId() const; + + inline bool hasStVersion() const; + inline ::capnp::Text::Reader getStVersion() const; + + inline bool hasEspVersion() const; + inline ::capnp::Text::Reader getEspVersion() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class InitData::PandaInfo::Builder { +public: + typedef PandaInfo Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getHasPanda(); + inline void setHasPanda(bool value); + + inline bool hasDongleId(); + inline ::capnp::Text::Builder getDongleId(); + inline void setDongleId( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initDongleId(unsigned int size); + inline void adoptDongleId(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownDongleId(); + + inline bool hasStVersion(); + inline ::capnp::Text::Builder getStVersion(); + inline void setStVersion( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initStVersion(unsigned int size); + inline void adoptStVersion(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownStVersion(); + + inline bool hasEspVersion(); + inline ::capnp::Text::Builder getEspVersion(); + inline void setEspVersion( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initEspVersion(unsigned int size); + inline void adoptEspVersion(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownEspVersion(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class InitData::PandaInfo::Pipeline { +public: + typedef PandaInfo Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class InitData::AndroidBuildInfo::Reader { +public: + typedef AndroidBuildInfo Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasBoard() const; + inline ::capnp::Text::Reader getBoard() const; + + inline bool hasBootloader() const; + inline ::capnp::Text::Reader getBootloader() const; + + inline bool hasBrand() const; + inline ::capnp::Text::Reader getBrand() const; + + inline bool hasDevice() const; + inline ::capnp::Text::Reader getDevice() const; + + inline bool hasDisplay() const; + inline ::capnp::Text::Reader getDisplay() const; + + inline bool hasFingerprint() const; + inline ::capnp::Text::Reader getFingerprint() const; + + inline bool hasHardware() const; + inline ::capnp::Text::Reader getHardware() const; + + inline bool hasHost() const; + inline ::capnp::Text::Reader getHost() const; + + inline bool hasId() const; + inline ::capnp::Text::Reader getId() const; + + inline bool hasManufacturer() const; + inline ::capnp::Text::Reader getManufacturer() const; + + inline bool hasModel() const; + inline ::capnp::Text::Reader getModel() const; + + inline bool hasProduct() const; + inline ::capnp::Text::Reader getProduct() const; + + inline bool hasRadioVersion() const; + inline ::capnp::Text::Reader getRadioVersion() const; + + inline bool hasSerial() const; + inline ::capnp::Text::Reader getSerial() const; + + inline bool hasSupportedAbis() const; + inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Reader getSupportedAbis() const; + + inline bool hasTags() const; + inline ::capnp::Text::Reader getTags() const; + + inline ::int64_t getTime() const; + + inline bool hasType() const; + inline ::capnp::Text::Reader getType() const; + + inline bool hasUser() const; + inline ::capnp::Text::Reader getUser() const; + + inline bool hasVersionCodename() const; + inline ::capnp::Text::Reader getVersionCodename() const; + + inline bool hasVersionRelease() const; + inline ::capnp::Text::Reader getVersionRelease() const; + + inline ::int32_t getVersionSdk() const; + + inline bool hasVersionSecurityPatch() const; + inline ::capnp::Text::Reader getVersionSecurityPatch() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class InitData::AndroidBuildInfo::Builder { +public: + typedef AndroidBuildInfo Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasBoard(); + inline ::capnp::Text::Builder getBoard(); + inline void setBoard( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initBoard(unsigned int size); + inline void adoptBoard(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownBoard(); + + inline bool hasBootloader(); + inline ::capnp::Text::Builder getBootloader(); + inline void setBootloader( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initBootloader(unsigned int size); + inline void adoptBootloader(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownBootloader(); + + inline bool hasBrand(); + inline ::capnp::Text::Builder getBrand(); + inline void setBrand( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initBrand(unsigned int size); + inline void adoptBrand(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownBrand(); + + inline bool hasDevice(); + inline ::capnp::Text::Builder getDevice(); + inline void setDevice( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initDevice(unsigned int size); + inline void adoptDevice(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownDevice(); + + inline bool hasDisplay(); + inline ::capnp::Text::Builder getDisplay(); + inline void setDisplay( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initDisplay(unsigned int size); + inline void adoptDisplay(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownDisplay(); + + inline bool hasFingerprint(); + inline ::capnp::Text::Builder getFingerprint(); + inline void setFingerprint( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initFingerprint(unsigned int size); + inline void adoptFingerprint(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownFingerprint(); + + inline bool hasHardware(); + inline ::capnp::Text::Builder getHardware(); + inline void setHardware( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initHardware(unsigned int size); + inline void adoptHardware(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownHardware(); + + inline bool hasHost(); + inline ::capnp::Text::Builder getHost(); + inline void setHost( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initHost(unsigned int size); + inline void adoptHost(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownHost(); + + inline bool hasId(); + inline ::capnp::Text::Builder getId(); + inline void setId( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initId(unsigned int size); + inline void adoptId(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownId(); + + inline bool hasManufacturer(); + inline ::capnp::Text::Builder getManufacturer(); + inline void setManufacturer( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initManufacturer(unsigned int size); + inline void adoptManufacturer(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownManufacturer(); + + inline bool hasModel(); + inline ::capnp::Text::Builder getModel(); + inline void setModel( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initModel(unsigned int size); + inline void adoptModel(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownModel(); + + inline bool hasProduct(); + inline ::capnp::Text::Builder getProduct(); + inline void setProduct( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initProduct(unsigned int size); + inline void adoptProduct(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownProduct(); + + inline bool hasRadioVersion(); + inline ::capnp::Text::Builder getRadioVersion(); + inline void setRadioVersion( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initRadioVersion(unsigned int size); + inline void adoptRadioVersion(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownRadioVersion(); + + inline bool hasSerial(); + inline ::capnp::Text::Builder getSerial(); + inline void setSerial( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initSerial(unsigned int size); + inline void adoptSerial(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownSerial(); + + inline bool hasSupportedAbis(); + inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Builder getSupportedAbis(); + inline void setSupportedAbis( ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Reader value); + inline void setSupportedAbis(::kj::ArrayPtr value); + inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Builder initSupportedAbis(unsigned int size); + inline void adoptSupportedAbis(::capnp::Orphan< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>> disownSupportedAbis(); + + inline bool hasTags(); + inline ::capnp::Text::Builder getTags(); + inline void setTags( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initTags(unsigned int size); + inline void adoptTags(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownTags(); + + inline ::int64_t getTime(); + inline void setTime( ::int64_t value); + + inline bool hasType(); + inline ::capnp::Text::Builder getType(); + inline void setType( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initType(unsigned int size); + inline void adoptType(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownType(); + + inline bool hasUser(); + inline ::capnp::Text::Builder getUser(); + inline void setUser( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initUser(unsigned int size); + inline void adoptUser(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownUser(); + + inline bool hasVersionCodename(); + inline ::capnp::Text::Builder getVersionCodename(); + inline void setVersionCodename( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initVersionCodename(unsigned int size); + inline void adoptVersionCodename(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownVersionCodename(); + + inline bool hasVersionRelease(); + inline ::capnp::Text::Builder getVersionRelease(); + inline void setVersionRelease( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initVersionRelease(unsigned int size); + inline void adoptVersionRelease(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownVersionRelease(); + + inline ::int32_t getVersionSdk(); + inline void setVersionSdk( ::int32_t value); + + inline bool hasVersionSecurityPatch(); + inline ::capnp::Text::Builder getVersionSecurityPatch(); + inline void setVersionSecurityPatch( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initVersionSecurityPatch(unsigned int size); + inline void adoptVersionSecurityPatch(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownVersionSecurityPatch(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class InitData::AndroidBuildInfo::Pipeline { +public: + typedef AndroidBuildInfo Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class InitData::AndroidSensor::Reader { +public: + typedef AndroidSensor Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::int32_t getId() const; + + inline bool hasName() const; + inline ::capnp::Text::Reader getName() const; + + inline bool hasVendor() const; + inline ::capnp::Text::Reader getVendor() const; + + inline ::int32_t getVersion() const; + + inline ::int32_t getHandle() const; + + inline ::int32_t getType() const; + + inline float getMaxRange() const; + + inline float getResolution() const; + + inline float getPower() const; + + inline ::int32_t getMinDelay() const; + + inline ::uint32_t getFifoReservedEventCount() const; + + inline ::uint32_t getFifoMaxEventCount() const; + + inline bool hasStringType() const; + inline ::capnp::Text::Reader getStringType() const; + + inline ::int32_t getMaxDelay() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class InitData::AndroidSensor::Builder { +public: + typedef AndroidSensor Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::int32_t getId(); + inline void setId( ::int32_t value); + + inline bool hasName(); + inline ::capnp::Text::Builder getName(); + inline void setName( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initName(unsigned int size); + inline void adoptName(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownName(); + + inline bool hasVendor(); + inline ::capnp::Text::Builder getVendor(); + inline void setVendor( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initVendor(unsigned int size); + inline void adoptVendor(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownVendor(); + + inline ::int32_t getVersion(); + inline void setVersion( ::int32_t value); + + inline ::int32_t getHandle(); + inline void setHandle( ::int32_t value); + + inline ::int32_t getType(); + inline void setType( ::int32_t value); + + inline float getMaxRange(); + inline void setMaxRange(float value); + + inline float getResolution(); + inline void setResolution(float value); + + inline float getPower(); + inline void setPower(float value); + + inline ::int32_t getMinDelay(); + inline void setMinDelay( ::int32_t value); + + inline ::uint32_t getFifoReservedEventCount(); + inline void setFifoReservedEventCount( ::uint32_t value); + + inline ::uint32_t getFifoMaxEventCount(); + inline void setFifoMaxEventCount( ::uint32_t value); + + inline bool hasStringType(); + inline ::capnp::Text::Builder getStringType(); + inline void setStringType( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initStringType(unsigned int size); + inline void adoptStringType(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownStringType(); + + inline ::int32_t getMaxDelay(); + inline void setMaxDelay( ::int32_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class InitData::AndroidSensor::Pipeline { +public: + typedef AndroidSensor Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class InitData::ChffrAndroidExtra::Reader { +public: + typedef ChffrAndroidExtra Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasAllCameraCharacteristics() const; + inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Reader getAllCameraCharacteristics() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class InitData::ChffrAndroidExtra::Builder { +public: + typedef ChffrAndroidExtra Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasAllCameraCharacteristics(); + inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Builder getAllCameraCharacteristics(); + inline void setAllCameraCharacteristics( ::cereal::Map< ::capnp::Text, ::capnp::Text>::Reader value); + inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Builder initAllCameraCharacteristics(); + inline void adoptAllCameraCharacteristics(::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Text>>&& value); + inline ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Text>> disownAllCameraCharacteristics(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class InitData::ChffrAndroidExtra::Pipeline { +public: + typedef ChffrAndroidExtra Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Pipeline getAllCameraCharacteristics(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class InitData::IosBuildInfo::Reader { +public: + typedef IosBuildInfo Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasAppVersion() const; + inline ::capnp::Text::Reader getAppVersion() const; + + inline ::uint32_t getAppBuild() const; + + inline bool hasOsVersion() const; + inline ::capnp::Text::Reader getOsVersion() const; + + inline bool hasDeviceModel() const; + inline ::capnp::Text::Reader getDeviceModel() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class InitData::IosBuildInfo::Builder { +public: + typedef IosBuildInfo Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasAppVersion(); + inline ::capnp::Text::Builder getAppVersion(); + inline void setAppVersion( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initAppVersion(unsigned int size); + inline void adoptAppVersion(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownAppVersion(); + + inline ::uint32_t getAppBuild(); + inline void setAppBuild( ::uint32_t value); + + inline bool hasOsVersion(); + inline ::capnp::Text::Builder getOsVersion(); + inline void setOsVersion( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initOsVersion(unsigned int size); + inline void adoptOsVersion(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownOsVersion(); + + inline bool hasDeviceModel(); + inline ::capnp::Text::Builder getDeviceModel(); + inline void setDeviceModel( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initDeviceModel(unsigned int size); + inline void adoptDeviceModel(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownDeviceModel(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class InitData::IosBuildInfo::Pipeline { +public: + typedef IosBuildInfo Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class FrameData::Reader { +public: + typedef FrameData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint32_t getFrameId() const; + + inline ::uint32_t getEncodeId() const; + + inline ::uint64_t getTimestampEof() const; + + inline ::int32_t getFrameLength() const; + + inline ::int32_t getIntegLines() const; + + inline ::int32_t getGlobalGainDEPRECATED() const; + + inline bool hasImage() const; + inline ::capnp::Data::Reader getImage() const; + + inline ::cereal::FrameData::FrameType getFrameType() const; + + inline ::uint64_t getTimestampSof() const; + + inline bool hasAndroidCaptureResult() const; + inline ::cereal::FrameData::AndroidCaptureResult::Reader getAndroidCaptureResult() const; + + inline bool hasTransform() const; + inline ::capnp::List::Reader getTransform() const; + + inline ::int32_t getLensPos() const; + + inline float getLensSag() const; + + inline float getLensErr() const; + + inline float getLensTruePos() const; + + inline float getGain() const; + + inline bool hasFocusVal() const; + inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Reader getFocusVal() const; + + inline bool hasFocusConf() const; + inline ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Reader getFocusConf() const; + + inline bool hasSharpnessScore() const; + inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader getSharpnessScore() const; + + inline ::int32_t getRecoverState() const; + + inline bool getHighConversionGain() const; + + inline float getMeasuredGreyFraction() const; + + inline float getTargetGreyFraction() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class FrameData::Builder { +public: + typedef FrameData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint32_t getFrameId(); + inline void setFrameId( ::uint32_t value); + + inline ::uint32_t getEncodeId(); + inline void setEncodeId( ::uint32_t value); + + inline ::uint64_t getTimestampEof(); + inline void setTimestampEof( ::uint64_t value); + + inline ::int32_t getFrameLength(); + inline void setFrameLength( ::int32_t value); + + inline ::int32_t getIntegLines(); + inline void setIntegLines( ::int32_t value); + + inline ::int32_t getGlobalGainDEPRECATED(); + inline void setGlobalGainDEPRECATED( ::int32_t value); + + inline bool hasImage(); + inline ::capnp::Data::Builder getImage(); + inline void setImage( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initImage(unsigned int size); + inline void adoptImage(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownImage(); + + inline ::cereal::FrameData::FrameType getFrameType(); + inline void setFrameType( ::cereal::FrameData::FrameType value); + + inline ::uint64_t getTimestampSof(); + inline void setTimestampSof( ::uint64_t value); + + inline bool hasAndroidCaptureResult(); + inline ::cereal::FrameData::AndroidCaptureResult::Builder getAndroidCaptureResult(); + inline void setAndroidCaptureResult( ::cereal::FrameData::AndroidCaptureResult::Reader value); + inline ::cereal::FrameData::AndroidCaptureResult::Builder initAndroidCaptureResult(); + inline void adoptAndroidCaptureResult(::capnp::Orphan< ::cereal::FrameData::AndroidCaptureResult>&& value); + inline ::capnp::Orphan< ::cereal::FrameData::AndroidCaptureResult> disownAndroidCaptureResult(); + + inline bool hasTransform(); + inline ::capnp::List::Builder getTransform(); + inline void setTransform( ::capnp::List::Reader value); + inline void setTransform(::kj::ArrayPtr value); + inline ::capnp::List::Builder initTransform(unsigned int size); + inline void adoptTransform(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownTransform(); + + inline ::int32_t getLensPos(); + inline void setLensPos( ::int32_t value); + + inline float getLensSag(); + inline void setLensSag(float value); + + inline float getLensErr(); + inline void setLensErr(float value); + + inline float getLensTruePos(); + inline void setLensTruePos(float value); + + inline float getGain(); + inline void setGain(float value); + + inline bool hasFocusVal(); + inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Builder getFocusVal(); + inline void setFocusVal( ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setFocusVal(::kj::ArrayPtr value); + inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Builder initFocusVal(unsigned int size); + inline void adoptFocusVal(::capnp::Orphan< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>> disownFocusVal(); + + inline bool hasFocusConf(); + inline ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Builder getFocusConf(); + inline void setFocusConf( ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setFocusConf(::kj::ArrayPtr value); + inline ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Builder initFocusConf(unsigned int size); + inline void adoptFocusConf(::capnp::Orphan< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>> disownFocusConf(); + + inline bool hasSharpnessScore(); + inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder getSharpnessScore(); + inline void setSharpnessScore( ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setSharpnessScore(::kj::ArrayPtr value); + inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder initSharpnessScore(unsigned int size); + inline void adoptSharpnessScore(::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>> disownSharpnessScore(); + + inline ::int32_t getRecoverState(); + inline void setRecoverState( ::int32_t value); + + inline bool getHighConversionGain(); + inline void setHighConversionGain(bool value); + + inline float getMeasuredGreyFraction(); + inline void setMeasuredGreyFraction(float value); + + inline float getTargetGreyFraction(); + inline void setTargetGreyFraction(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class FrameData::Pipeline { +public: + typedef FrameData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::FrameData::AndroidCaptureResult::Pipeline getAndroidCaptureResult(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class FrameData::AndroidCaptureResult::Reader { +public: + typedef AndroidCaptureResult Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::int32_t getSensitivity() const; + + inline ::int64_t getFrameDuration() const; + + inline ::int64_t getExposureTime() const; + + inline ::uint64_t getRollingShutterSkew() const; + + inline bool hasColorCorrectionTransform() const; + inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Reader getColorCorrectionTransform() const; + + inline bool hasColorCorrectionGains() const; + inline ::capnp::List::Reader getColorCorrectionGains() const; + + inline ::int8_t getDisplayRotation() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class FrameData::AndroidCaptureResult::Builder { +public: + typedef AndroidCaptureResult Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::int32_t getSensitivity(); + inline void setSensitivity( ::int32_t value); + + inline ::int64_t getFrameDuration(); + inline void setFrameDuration( ::int64_t value); + + inline ::int64_t getExposureTime(); + inline void setExposureTime( ::int64_t value); + + inline ::uint64_t getRollingShutterSkew(); + inline void setRollingShutterSkew( ::uint64_t value); + + inline bool hasColorCorrectionTransform(); + inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Builder getColorCorrectionTransform(); + inline void setColorCorrectionTransform( ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setColorCorrectionTransform(::kj::ArrayPtr value); + inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Builder initColorCorrectionTransform(unsigned int size); + inline void adoptColorCorrectionTransform(::capnp::Orphan< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>> disownColorCorrectionTransform(); + + inline bool hasColorCorrectionGains(); + inline ::capnp::List::Builder getColorCorrectionGains(); + inline void setColorCorrectionGains( ::capnp::List::Reader value); + inline void setColorCorrectionGains(::kj::ArrayPtr value); + inline ::capnp::List::Builder initColorCorrectionGains(unsigned int size); + inline void adoptColorCorrectionGains(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownColorCorrectionGains(); + + inline ::int8_t getDisplayRotation(); + inline void setDisplayRotation( ::int8_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class FrameData::AndroidCaptureResult::Pipeline { +public: + typedef AndroidCaptureResult Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class Thumbnail::Reader { +public: + typedef Thumbnail Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint32_t getFrameId() const; + + inline ::uint64_t getTimestampEof() const; + + inline bool hasThumbnail() const; + inline ::capnp::Data::Reader getThumbnail() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Thumbnail::Builder { +public: + typedef Thumbnail Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint32_t getFrameId(); + inline void setFrameId( ::uint32_t value); + + inline ::uint64_t getTimestampEof(); + inline void setTimestampEof( ::uint64_t value); + + inline bool hasThumbnail(); + inline ::capnp::Data::Builder getThumbnail(); + inline void setThumbnail( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initThumbnail(unsigned int size); + inline void adoptThumbnail(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownThumbnail(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Thumbnail::Pipeline { +public: + typedef Thumbnail Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class GPSNMEAData::Reader { +public: + typedef GPSNMEAData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::int64_t getTimestamp() const; + + inline ::uint64_t getLocalWallTime() const; + + inline bool hasNmea() const; + inline ::capnp::Text::Reader getNmea() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class GPSNMEAData::Builder { +public: + typedef GPSNMEAData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::int64_t getTimestamp(); + inline void setTimestamp( ::int64_t value); + + inline ::uint64_t getLocalWallTime(); + inline void setLocalWallTime( ::uint64_t value); + + inline bool hasNmea(); + inline ::capnp::Text::Builder getNmea(); + inline void setNmea( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initNmea(unsigned int size); + inline void adoptNmea(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownNmea(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class GPSNMEAData::Pipeline { +public: + typedef GPSNMEAData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class SensorEventData::Reader { +public: + typedef SensorEventData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline Which which() const; + inline ::int32_t getVersion() const; + + inline ::int32_t getSensor() const; + + inline ::int32_t getType() const; + + inline ::int64_t getTimestamp() const; + + inline bool isAcceleration() const; + inline bool hasAcceleration() const; + inline ::cereal::SensorEventData::SensorVec::Reader getAcceleration() const; + + inline bool isMagnetic() const; + inline bool hasMagnetic() const; + inline ::cereal::SensorEventData::SensorVec::Reader getMagnetic() const; + + inline bool isOrientation() const; + inline bool hasOrientation() const; + inline ::cereal::SensorEventData::SensorVec::Reader getOrientation() const; + + inline bool isGyro() const; + inline bool hasGyro() const; + inline ::cereal::SensorEventData::SensorVec::Reader getGyro() const; + + inline ::cereal::SensorEventData::SensorSource getSource() const; + + inline bool isPressure() const; + inline bool hasPressure() const; + inline ::cereal::SensorEventData::SensorVec::Reader getPressure() const; + + inline bool getUncalibratedDEPRECATED() const; + + inline bool isMagneticUncalibrated() const; + inline bool hasMagneticUncalibrated() const; + inline ::cereal::SensorEventData::SensorVec::Reader getMagneticUncalibrated() const; + + inline bool isGyroUncalibrated() const; + inline bool hasGyroUncalibrated() const; + inline ::cereal::SensorEventData::SensorVec::Reader getGyroUncalibrated() const; + + inline bool isProximity() const; + inline float getProximity() const; + + inline bool isLight() const; + inline float getLight() const; + + inline bool isTemperature() const; + inline float getTemperature() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class SensorEventData::Builder { +public: + typedef SensorEventData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline Which which(); + inline ::int32_t getVersion(); + inline void setVersion( ::int32_t value); + + inline ::int32_t getSensor(); + inline void setSensor( ::int32_t value); + + inline ::int32_t getType(); + inline void setType( ::int32_t value); + + inline ::int64_t getTimestamp(); + inline void setTimestamp( ::int64_t value); + + inline bool isAcceleration(); + inline bool hasAcceleration(); + inline ::cereal::SensorEventData::SensorVec::Builder getAcceleration(); + inline void setAcceleration( ::cereal::SensorEventData::SensorVec::Reader value); + inline ::cereal::SensorEventData::SensorVec::Builder initAcceleration(); + inline void adoptAcceleration(::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value); + inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> disownAcceleration(); + + inline bool isMagnetic(); + inline bool hasMagnetic(); + inline ::cereal::SensorEventData::SensorVec::Builder getMagnetic(); + inline void setMagnetic( ::cereal::SensorEventData::SensorVec::Reader value); + inline ::cereal::SensorEventData::SensorVec::Builder initMagnetic(); + inline void adoptMagnetic(::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value); + inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> disownMagnetic(); + + inline bool isOrientation(); + inline bool hasOrientation(); + inline ::cereal::SensorEventData::SensorVec::Builder getOrientation(); + inline void setOrientation( ::cereal::SensorEventData::SensorVec::Reader value); + inline ::cereal::SensorEventData::SensorVec::Builder initOrientation(); + inline void adoptOrientation(::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value); + inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> disownOrientation(); + + inline bool isGyro(); + inline bool hasGyro(); + inline ::cereal::SensorEventData::SensorVec::Builder getGyro(); + inline void setGyro( ::cereal::SensorEventData::SensorVec::Reader value); + inline ::cereal::SensorEventData::SensorVec::Builder initGyro(); + inline void adoptGyro(::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value); + inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> disownGyro(); + + inline ::cereal::SensorEventData::SensorSource getSource(); + inline void setSource( ::cereal::SensorEventData::SensorSource value); + + inline bool isPressure(); + inline bool hasPressure(); + inline ::cereal::SensorEventData::SensorVec::Builder getPressure(); + inline void setPressure( ::cereal::SensorEventData::SensorVec::Reader value); + inline ::cereal::SensorEventData::SensorVec::Builder initPressure(); + inline void adoptPressure(::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value); + inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> disownPressure(); + + inline bool getUncalibratedDEPRECATED(); + inline void setUncalibratedDEPRECATED(bool value); + + inline bool isMagneticUncalibrated(); + inline bool hasMagneticUncalibrated(); + inline ::cereal::SensorEventData::SensorVec::Builder getMagneticUncalibrated(); + inline void setMagneticUncalibrated( ::cereal::SensorEventData::SensorVec::Reader value); + inline ::cereal::SensorEventData::SensorVec::Builder initMagneticUncalibrated(); + inline void adoptMagneticUncalibrated(::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value); + inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> disownMagneticUncalibrated(); + + inline bool isGyroUncalibrated(); + inline bool hasGyroUncalibrated(); + inline ::cereal::SensorEventData::SensorVec::Builder getGyroUncalibrated(); + inline void setGyroUncalibrated( ::cereal::SensorEventData::SensorVec::Reader value); + inline ::cereal::SensorEventData::SensorVec::Builder initGyroUncalibrated(); + inline void adoptGyroUncalibrated(::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value); + inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> disownGyroUncalibrated(); + + inline bool isProximity(); + inline float getProximity(); + inline void setProximity(float value); + + inline bool isLight(); + inline float getLight(); + inline void setLight(float value); + + inline bool isTemperature(); + inline float getTemperature(); + inline void setTemperature(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class SensorEventData::Pipeline { +public: + typedef SensorEventData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class SensorEventData::SensorVec::Reader { +public: + typedef SensorVec Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasV() const; + inline ::capnp::List::Reader getV() const; + + inline ::int8_t getStatus() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class SensorEventData::SensorVec::Builder { +public: + typedef SensorVec Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasV(); + inline ::capnp::List::Builder getV(); + inline void setV( ::capnp::List::Reader value); + inline void setV(::kj::ArrayPtr value); + inline ::capnp::List::Builder initV(unsigned int size); + inline void adoptV(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownV(); + + inline ::int8_t getStatus(); + inline void setStatus( ::int8_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class SensorEventData::SensorVec::Pipeline { +public: + typedef SensorVec Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class GpsLocationData::Reader { +public: + typedef GpsLocationData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint16_t getFlags() const; + + inline double getLatitude() const; + + inline double getLongitude() const; + + inline double getAltitude() const; + + inline float getSpeed() const; + + inline float getBearingDeg() const; + + inline float getAccuracy() const; + + inline ::int64_t getTimestamp() const; + + inline ::cereal::GpsLocationData::SensorSource getSource() const; + + inline bool hasVNED() const; + inline ::capnp::List::Reader getVNED() const; + + inline float getVerticalAccuracy() const; + + inline float getBearingAccuracyDeg() const; + + inline float getSpeedAccuracy() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class GpsLocationData::Builder { +public: + typedef GpsLocationData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint16_t getFlags(); + inline void setFlags( ::uint16_t value); + + inline double getLatitude(); + inline void setLatitude(double value); + + inline double getLongitude(); + inline void setLongitude(double value); + + inline double getAltitude(); + inline void setAltitude(double value); + + inline float getSpeed(); + inline void setSpeed(float value); + + inline float getBearingDeg(); + inline void setBearingDeg(float value); + + inline float getAccuracy(); + inline void setAccuracy(float value); + + inline ::int64_t getTimestamp(); + inline void setTimestamp( ::int64_t value); + + inline ::cereal::GpsLocationData::SensorSource getSource(); + inline void setSource( ::cereal::GpsLocationData::SensorSource value); + + inline bool hasVNED(); + inline ::capnp::List::Builder getVNED(); + inline void setVNED( ::capnp::List::Reader value); + inline void setVNED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initVNED(unsigned int size); + inline void adoptVNED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownVNED(); + + inline float getVerticalAccuracy(); + inline void setVerticalAccuracy(float value); + + inline float getBearingAccuracyDeg(); + inline void setBearingAccuracyDeg(float value); + + inline float getSpeedAccuracy(); + inline void setSpeedAccuracy(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class GpsLocationData::Pipeline { +public: + typedef GpsLocationData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CanData::Reader { +public: + typedef CanData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint32_t getAddress() const; + + inline ::uint16_t getBusTime() const; + + inline bool hasDat() const; + inline ::capnp::Data::Reader getDat() const; + + inline ::uint8_t getSrc() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CanData::Builder { +public: + typedef CanData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint32_t getAddress(); + inline void setAddress( ::uint32_t value); + + inline ::uint16_t getBusTime(); + inline void setBusTime( ::uint16_t value); + + inline bool hasDat(); + inline ::capnp::Data::Builder getDat(); + inline void setDat( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initDat(unsigned int size); + inline void adoptDat(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownDat(); + + inline ::uint8_t getSrc(); + inline void setSrc( ::uint8_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CanData::Pipeline { +public: + typedef CanData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class DeviceState::Reader { +public: + typedef DeviceState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint16_t getCpu0DEPRECATED() const; + + inline ::uint16_t getCpu1DEPRECATED() const; + + inline ::uint16_t getCpu2DEPRECATED() const; + + inline ::uint16_t getCpu3DEPRECATED() const; + + inline ::uint16_t getMemDEPRECATED() const; + + inline ::uint16_t getGpuDEPRECATED() const; + + inline ::uint32_t getBatDEPRECATED() const; + + inline float getFreeSpacePercent() const; + + inline ::int16_t getBatteryPercent() const; + + inline bool hasBatteryStatusDEPRECATED() const; + inline ::capnp::Text::Reader getBatteryStatusDEPRECATED() const; + + inline ::uint16_t getFanSpeedPercentDesired() const; + + inline bool getStarted() const; + + inline bool getUsbOnline() const; + + inline ::uint64_t getStartedMonoTime() const; + + inline ::cereal::DeviceState::ThermalStatus getThermalStatus() const; + + inline ::int32_t getBatteryCurrent() const; + + inline ::int32_t getBatteryVoltageDEPRECATED() const; + + inline bool getChargingError() const; + + inline bool getChargingDisabled() const; + + inline ::int8_t getMemoryUsagePercent() const; + + inline ::int8_t getCpuUsagePercentDEPRECATED() const; + + inline ::uint16_t getPa0DEPRECATED() const; + + inline ::cereal::DeviceState::NetworkType getNetworkType() const; + + inline ::uint32_t getOffroadPowerUsageUwh() const; + + inline ::cereal::DeviceState::NetworkStrength getNetworkStrength() const; + + inline ::uint32_t getCarBatteryCapacityUwh() const; + + inline bool hasCpuTempC() const; + inline ::capnp::List::Reader getCpuTempC() const; + + inline bool hasGpuTempC() const; + inline ::capnp::List::Reader getGpuTempC() const; + + inline float getMemoryTempC() const; + + inline float getBatteryTempCDEPRECATED() const; + + inline float getAmbientTempC() const; + + inline bool hasNetworkInfo() const; + inline ::cereal::DeviceState::NetworkInfo::Reader getNetworkInfo() const; + + inline ::uint64_t getLastAthenaPingTime() const; + + inline ::int8_t getGpuUsagePercent() const; + + inline bool hasCpuUsagePercent() const; + inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Reader getCpuUsagePercent() const; + + inline bool hasNvmeTempC() const; + inline ::capnp::List::Reader getNvmeTempC() const; + + inline bool hasModemTempC() const; + inline ::capnp::List::Reader getModemTempC() const; + + inline ::int8_t getScreenBrightnessPercent() const; + + inline bool hasThermalZones() const; + inline ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>::Reader getThermalZones() const; + + inline bool hasPmicTempC() const; + inline ::capnp::List::Reader getPmicTempC() const; + + inline float getPowerDrawW() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class DeviceState::Builder { +public: + typedef DeviceState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint16_t getCpu0DEPRECATED(); + inline void setCpu0DEPRECATED( ::uint16_t value); + + inline ::uint16_t getCpu1DEPRECATED(); + inline void setCpu1DEPRECATED( ::uint16_t value); + + inline ::uint16_t getCpu2DEPRECATED(); + inline void setCpu2DEPRECATED( ::uint16_t value); + + inline ::uint16_t getCpu3DEPRECATED(); + inline void setCpu3DEPRECATED( ::uint16_t value); + + inline ::uint16_t getMemDEPRECATED(); + inline void setMemDEPRECATED( ::uint16_t value); + + inline ::uint16_t getGpuDEPRECATED(); + inline void setGpuDEPRECATED( ::uint16_t value); + + inline ::uint32_t getBatDEPRECATED(); + inline void setBatDEPRECATED( ::uint32_t value); + + inline float getFreeSpacePercent(); + inline void setFreeSpacePercent(float value); + + inline ::int16_t getBatteryPercent(); + inline void setBatteryPercent( ::int16_t value); + + inline bool hasBatteryStatusDEPRECATED(); + inline ::capnp::Text::Builder getBatteryStatusDEPRECATED(); + inline void setBatteryStatusDEPRECATED( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initBatteryStatusDEPRECATED(unsigned int size); + inline void adoptBatteryStatusDEPRECATED(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownBatteryStatusDEPRECATED(); + + inline ::uint16_t getFanSpeedPercentDesired(); + inline void setFanSpeedPercentDesired( ::uint16_t value); + + inline bool getStarted(); + inline void setStarted(bool value); + + inline bool getUsbOnline(); + inline void setUsbOnline(bool value); + + inline ::uint64_t getStartedMonoTime(); + inline void setStartedMonoTime( ::uint64_t value); + + inline ::cereal::DeviceState::ThermalStatus getThermalStatus(); + inline void setThermalStatus( ::cereal::DeviceState::ThermalStatus value); + + inline ::int32_t getBatteryCurrent(); + inline void setBatteryCurrent( ::int32_t value); + + inline ::int32_t getBatteryVoltageDEPRECATED(); + inline void setBatteryVoltageDEPRECATED( ::int32_t value); + + inline bool getChargingError(); + inline void setChargingError(bool value); + + inline bool getChargingDisabled(); + inline void setChargingDisabled(bool value); + + inline ::int8_t getMemoryUsagePercent(); + inline void setMemoryUsagePercent( ::int8_t value); + + inline ::int8_t getCpuUsagePercentDEPRECATED(); + inline void setCpuUsagePercentDEPRECATED( ::int8_t value); + + inline ::uint16_t getPa0DEPRECATED(); + inline void setPa0DEPRECATED( ::uint16_t value); + + inline ::cereal::DeviceState::NetworkType getNetworkType(); + inline void setNetworkType( ::cereal::DeviceState::NetworkType value); + + inline ::uint32_t getOffroadPowerUsageUwh(); + inline void setOffroadPowerUsageUwh( ::uint32_t value); + + inline ::cereal::DeviceState::NetworkStrength getNetworkStrength(); + inline void setNetworkStrength( ::cereal::DeviceState::NetworkStrength value); + + inline ::uint32_t getCarBatteryCapacityUwh(); + inline void setCarBatteryCapacityUwh( ::uint32_t value); + + inline bool hasCpuTempC(); + inline ::capnp::List::Builder getCpuTempC(); + inline void setCpuTempC( ::capnp::List::Reader value); + inline void setCpuTempC(::kj::ArrayPtr value); + inline ::capnp::List::Builder initCpuTempC(unsigned int size); + inline void adoptCpuTempC(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownCpuTempC(); + + inline bool hasGpuTempC(); + inline ::capnp::List::Builder getGpuTempC(); + inline void setGpuTempC( ::capnp::List::Reader value); + inline void setGpuTempC(::kj::ArrayPtr value); + inline ::capnp::List::Builder initGpuTempC(unsigned int size); + inline void adoptGpuTempC(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownGpuTempC(); + + inline float getMemoryTempC(); + inline void setMemoryTempC(float value); + + inline float getBatteryTempCDEPRECATED(); + inline void setBatteryTempCDEPRECATED(float value); + + inline float getAmbientTempC(); + inline void setAmbientTempC(float value); + + inline bool hasNetworkInfo(); + inline ::cereal::DeviceState::NetworkInfo::Builder getNetworkInfo(); + inline void setNetworkInfo( ::cereal::DeviceState::NetworkInfo::Reader value); + inline ::cereal::DeviceState::NetworkInfo::Builder initNetworkInfo(); + inline void adoptNetworkInfo(::capnp::Orphan< ::cereal::DeviceState::NetworkInfo>&& value); + inline ::capnp::Orphan< ::cereal::DeviceState::NetworkInfo> disownNetworkInfo(); + + inline ::uint64_t getLastAthenaPingTime(); + inline void setLastAthenaPingTime( ::uint64_t value); + + inline ::int8_t getGpuUsagePercent(); + inline void setGpuUsagePercent( ::int8_t value); + + inline bool hasCpuUsagePercent(); + inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Builder getCpuUsagePercent(); + inline void setCpuUsagePercent( ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setCpuUsagePercent(::kj::ArrayPtr value); + inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Builder initCpuUsagePercent(unsigned int size); + inline void adoptCpuUsagePercent(::capnp::Orphan< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>> disownCpuUsagePercent(); + + inline bool hasNvmeTempC(); + inline ::capnp::List::Builder getNvmeTempC(); + inline void setNvmeTempC( ::capnp::List::Reader value); + inline void setNvmeTempC(::kj::ArrayPtr value); + inline ::capnp::List::Builder initNvmeTempC(unsigned int size); + inline void adoptNvmeTempC(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownNvmeTempC(); + + inline bool hasModemTempC(); + inline ::capnp::List::Builder getModemTempC(); + inline void setModemTempC( ::capnp::List::Reader value); + inline void setModemTempC(::kj::ArrayPtr value); + inline ::capnp::List::Builder initModemTempC(unsigned int size); + inline void adoptModemTempC(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownModemTempC(); + + inline ::int8_t getScreenBrightnessPercent(); + inline void setScreenBrightnessPercent( ::int8_t value); + + inline bool hasThermalZones(); + inline ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>::Builder getThermalZones(); + inline void setThermalZones( ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>::Builder initThermalZones(unsigned int size); + inline void adoptThermalZones(::capnp::Orphan< ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>> disownThermalZones(); + + inline bool hasPmicTempC(); + inline ::capnp::List::Builder getPmicTempC(); + inline void setPmicTempC( ::capnp::List::Reader value); + inline void setPmicTempC(::kj::ArrayPtr value); + inline ::capnp::List::Builder initPmicTempC(unsigned int size); + inline void adoptPmicTempC(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownPmicTempC(); + + inline float getPowerDrawW(); + inline void setPowerDrawW(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class DeviceState::Pipeline { +public: + typedef DeviceState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::DeviceState::NetworkInfo::Pipeline getNetworkInfo(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class DeviceState::ThermalZone::Reader { +public: + typedef ThermalZone Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasName() const; + inline ::capnp::Text::Reader getName() const; + + inline float getTemp() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class DeviceState::ThermalZone::Builder { +public: + typedef ThermalZone Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasName(); + inline ::capnp::Text::Builder getName(); + inline void setName( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initName(unsigned int size); + inline void adoptName(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownName(); + + inline float getTemp(); + inline void setTemp(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class DeviceState::ThermalZone::Pipeline { +public: + typedef ThermalZone Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class DeviceState::NetworkInfo::Reader { +public: + typedef NetworkInfo Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasTechnology() const; + inline ::capnp::Text::Reader getTechnology() const; + + inline bool hasOperator() const; + inline ::capnp::Text::Reader getOperator() const; + + inline bool hasBand() const; + inline ::capnp::Text::Reader getBand() const; + + inline ::uint16_t getChannel() const; + + inline bool hasExtra() const; + inline ::capnp::Text::Reader getExtra() const; + + inline bool hasState() const; + inline ::capnp::Text::Reader getState() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class DeviceState::NetworkInfo::Builder { +public: + typedef NetworkInfo Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasTechnology(); + inline ::capnp::Text::Builder getTechnology(); + inline void setTechnology( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initTechnology(unsigned int size); + inline void adoptTechnology(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownTechnology(); + + inline bool hasOperator(); + inline ::capnp::Text::Builder getOperator(); + inline void setOperator( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initOperator(unsigned int size); + inline void adoptOperator(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownOperator(); + + inline bool hasBand(); + inline ::capnp::Text::Builder getBand(); + inline void setBand( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initBand(unsigned int size); + inline void adoptBand(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownBand(); + + inline ::uint16_t getChannel(); + inline void setChannel( ::uint16_t value); + + inline bool hasExtra(); + inline ::capnp::Text::Builder getExtra(); + inline void setExtra( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initExtra(unsigned int size); + inline void adoptExtra(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownExtra(); + + inline bool hasState(); + inline ::capnp::Text::Builder getState(); + inline void setState( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initState(unsigned int size); + inline void adoptState(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownState(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class DeviceState::NetworkInfo::Pipeline { +public: + typedef NetworkInfo Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class PandaState::Reader { +public: + typedef PandaState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint32_t getVoltageDEPRECATED() const; + + inline ::uint32_t getCurrentDEPRECATED() const; + + inline bool getIgnitionLine() const; + + inline bool getControlsAllowed() const; + + inline bool getGasInterceptorDetected() const; + + inline bool getStartedSignalDetectedDEPRECATED() const; + + inline bool getHasGpsDEPRECATED() const; + + inline ::uint32_t getCanSendErrs() const; + + inline ::uint32_t getCanFwdErrs() const; + + inline ::uint32_t getGmlanSendErrs() const; + + inline ::cereal::PandaState::PandaType getPandaType() const; + + inline ::uint16_t getFanSpeedRpmDEPRECATED() const; + + inline ::cereal::PeripheralState::UsbPowerMode getUsbPowerModeDEPRECATED() const; + + inline bool getIgnitionCan() const; + + inline ::cereal::CarParams::SafetyModel getSafetyModel() const; + + inline ::cereal::PandaState::FaultStatus getFaultStatus() const; + + inline bool getPowerSaveEnabled() const; + + inline ::uint32_t getUptime() const; + + inline bool hasFaults() const; + inline ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>::Reader getFaults() const; + + inline ::uint32_t getCanRxErrs() const; + + inline ::int16_t getSafetyParam() const; + + inline ::cereal::PandaState::HarnessStatus getHarnessStatus() const; + + inline bool getHeartbeatLost() const; + + inline ::int16_t getUnsafeMode() const; + + inline ::uint32_t getBlockedCnt() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class PandaState::Builder { +public: + typedef PandaState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint32_t getVoltageDEPRECATED(); + inline void setVoltageDEPRECATED( ::uint32_t value); + + inline ::uint32_t getCurrentDEPRECATED(); + inline void setCurrentDEPRECATED( ::uint32_t value); + + inline bool getIgnitionLine(); + inline void setIgnitionLine(bool value); + + inline bool getControlsAllowed(); + inline void setControlsAllowed(bool value); + + inline bool getGasInterceptorDetected(); + inline void setGasInterceptorDetected(bool value); + + inline bool getStartedSignalDetectedDEPRECATED(); + inline void setStartedSignalDetectedDEPRECATED(bool value); + + inline bool getHasGpsDEPRECATED(); + inline void setHasGpsDEPRECATED(bool value); + + inline ::uint32_t getCanSendErrs(); + inline void setCanSendErrs( ::uint32_t value); + + inline ::uint32_t getCanFwdErrs(); + inline void setCanFwdErrs( ::uint32_t value); + + inline ::uint32_t getGmlanSendErrs(); + inline void setGmlanSendErrs( ::uint32_t value); + + inline ::cereal::PandaState::PandaType getPandaType(); + inline void setPandaType( ::cereal::PandaState::PandaType value); + + inline ::uint16_t getFanSpeedRpmDEPRECATED(); + inline void setFanSpeedRpmDEPRECATED( ::uint16_t value); + + inline ::cereal::PeripheralState::UsbPowerMode getUsbPowerModeDEPRECATED(); + inline void setUsbPowerModeDEPRECATED( ::cereal::PeripheralState::UsbPowerMode value); + + inline bool getIgnitionCan(); + inline void setIgnitionCan(bool value); + + inline ::cereal::CarParams::SafetyModel getSafetyModel(); + inline void setSafetyModel( ::cereal::CarParams::SafetyModel value); + + inline ::cereal::PandaState::FaultStatus getFaultStatus(); + inline void setFaultStatus( ::cereal::PandaState::FaultStatus value); + + inline bool getPowerSaveEnabled(); + inline void setPowerSaveEnabled(bool value); + + inline ::uint32_t getUptime(); + inline void setUptime( ::uint32_t value); + + inline bool hasFaults(); + inline ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>::Builder getFaults(); + inline void setFaults( ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>::Reader value); + inline void setFaults(::kj::ArrayPtr value); + inline ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>::Builder initFaults(unsigned int size); + inline void adoptFaults(::capnp::Orphan< ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>> disownFaults(); + + inline ::uint32_t getCanRxErrs(); + inline void setCanRxErrs( ::uint32_t value); + + inline ::int16_t getSafetyParam(); + inline void setSafetyParam( ::int16_t value); + + inline ::cereal::PandaState::HarnessStatus getHarnessStatus(); + inline void setHarnessStatus( ::cereal::PandaState::HarnessStatus value); + + inline bool getHeartbeatLost(); + inline void setHeartbeatLost(bool value); + + inline ::int16_t getUnsafeMode(); + inline void setUnsafeMode( ::int16_t value); + + inline ::uint32_t getBlockedCnt(); + inline void setBlockedCnt( ::uint32_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class PandaState::Pipeline { +public: + typedef PandaState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class PeripheralState::Reader { +public: + typedef PeripheralState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::cereal::PandaState::PandaType getPandaType() const; + + inline ::uint32_t getVoltage() const; + + inline ::uint32_t getCurrent() const; + + inline ::uint16_t getFanSpeedRpm() const; + + inline ::cereal::PeripheralState::UsbPowerMode getUsbPowerMode() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class PeripheralState::Builder { +public: + typedef PeripheralState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::cereal::PandaState::PandaType getPandaType(); + inline void setPandaType( ::cereal::PandaState::PandaType value); + + inline ::uint32_t getVoltage(); + inline void setVoltage( ::uint32_t value); + + inline ::uint32_t getCurrent(); + inline void setCurrent( ::uint32_t value); + + inline ::uint16_t getFanSpeedRpm(); + inline void setFanSpeedRpm( ::uint16_t value); + + inline ::cereal::PeripheralState::UsbPowerMode getUsbPowerMode(); + inline void setUsbPowerMode( ::cereal::PeripheralState::UsbPowerMode value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class PeripheralState::Pipeline { +public: + typedef PeripheralState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class RadarState::Reader { +public: + typedef RadarState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasWarpMatrixDEPRECATED() const; + inline ::capnp::List::Reader getWarpMatrixDEPRECATED() const; + + inline float getAngleOffsetDEPRECATED() const; + + inline ::int8_t getCalStatusDEPRECATED() const; + + inline bool hasLeadOne() const; + inline ::cereal::RadarState::LeadData::Reader getLeadOne() const; + + inline bool hasLeadTwo() const; + inline ::cereal::RadarState::LeadData::Reader getLeadTwo() const; + + inline float getCumLagMs() const; + + inline ::uint64_t getMdMonoTime() const; + + inline ::uint64_t getFtMonoTimeDEPRECATED() const; + + inline ::int32_t getCalCycleDEPRECATED() const; + + inline ::int8_t getCalPercDEPRECATED() const; + + inline bool hasCanMonoTimes() const; + inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader getCanMonoTimes() const; + + inline ::uint64_t getCarStateMonoTime() const; + + inline bool hasRadarErrors() const; + inline ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Reader getRadarErrors() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class RadarState::Builder { +public: + typedef RadarState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasWarpMatrixDEPRECATED(); + inline ::capnp::List::Builder getWarpMatrixDEPRECATED(); + inline void setWarpMatrixDEPRECATED( ::capnp::List::Reader value); + inline void setWarpMatrixDEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initWarpMatrixDEPRECATED(unsigned int size); + inline void adoptWarpMatrixDEPRECATED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownWarpMatrixDEPRECATED(); + + inline float getAngleOffsetDEPRECATED(); + inline void setAngleOffsetDEPRECATED(float value); + + inline ::int8_t getCalStatusDEPRECATED(); + inline void setCalStatusDEPRECATED( ::int8_t value); + + inline bool hasLeadOne(); + inline ::cereal::RadarState::LeadData::Builder getLeadOne(); + inline void setLeadOne( ::cereal::RadarState::LeadData::Reader value); + inline ::cereal::RadarState::LeadData::Builder initLeadOne(); + inline void adoptLeadOne(::capnp::Orphan< ::cereal::RadarState::LeadData>&& value); + inline ::capnp::Orphan< ::cereal::RadarState::LeadData> disownLeadOne(); + + inline bool hasLeadTwo(); + inline ::cereal::RadarState::LeadData::Builder getLeadTwo(); + inline void setLeadTwo( ::cereal::RadarState::LeadData::Reader value); + inline ::cereal::RadarState::LeadData::Builder initLeadTwo(); + inline void adoptLeadTwo(::capnp::Orphan< ::cereal::RadarState::LeadData>&& value); + inline ::capnp::Orphan< ::cereal::RadarState::LeadData> disownLeadTwo(); + + inline float getCumLagMs(); + inline void setCumLagMs(float value); + + inline ::uint64_t getMdMonoTime(); + inline void setMdMonoTime( ::uint64_t value); + + inline ::uint64_t getFtMonoTimeDEPRECATED(); + inline void setFtMonoTimeDEPRECATED( ::uint64_t value); + + inline ::int32_t getCalCycleDEPRECATED(); + inline void setCalCycleDEPRECATED( ::int32_t value); + + inline ::int8_t getCalPercDEPRECATED(); + inline void setCalPercDEPRECATED( ::int8_t value); + + inline bool hasCanMonoTimes(); + inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder getCanMonoTimes(); + inline void setCanMonoTimes( ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setCanMonoTimes(::kj::ArrayPtr value); + inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder initCanMonoTimes(unsigned int size); + inline void adoptCanMonoTimes(::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>> disownCanMonoTimes(); + + inline ::uint64_t getCarStateMonoTime(); + inline void setCarStateMonoTime( ::uint64_t value); + + inline bool hasRadarErrors(); + inline ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Builder getRadarErrors(); + inline void setRadarErrors( ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Reader value); + inline void setRadarErrors(::kj::ArrayPtr value); + inline ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Builder initRadarErrors(unsigned int size); + inline void adoptRadarErrors(::capnp::Orphan< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>> disownRadarErrors(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class RadarState::Pipeline { +public: + typedef RadarState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::RadarState::LeadData::Pipeline getLeadOne(); + inline ::cereal::RadarState::LeadData::Pipeline getLeadTwo(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class RadarState::LeadData::Reader { +public: + typedef LeadData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline float getDRel() const; + + inline float getYRel() const; + + inline float getVRel() const; + + inline float getARel() const; + + inline float getVLead() const; + + inline float getALeadDEPRECATED() const; + + inline float getDPath() const; + + inline float getVLat() const; + + inline float getVLeadK() const; + + inline float getALeadK() const; + + inline bool getFcw() const; + + inline bool getStatus() const; + + inline float getALeadTau() const; + + inline float getModelProb() const; + + inline bool getRadar() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class RadarState::LeadData::Builder { +public: + typedef LeadData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline float getDRel(); + inline void setDRel(float value); + + inline float getYRel(); + inline void setYRel(float value); + + inline float getVRel(); + inline void setVRel(float value); + + inline float getARel(); + inline void setARel(float value); + + inline float getVLead(); + inline void setVLead(float value); + + inline float getALeadDEPRECATED(); + inline void setALeadDEPRECATED(float value); + + inline float getDPath(); + inline void setDPath(float value); + + inline float getVLat(); + inline void setVLat(float value); + + inline float getVLeadK(); + inline void setVLeadK(float value); + + inline float getALeadK(); + inline void setALeadK(float value); + + inline bool getFcw(); + inline void setFcw(bool value); + + inline bool getStatus(); + inline void setStatus(bool value); + + inline float getALeadTau(); + inline void setALeadTau(float value); + + inline float getModelProb(); + inline void setModelProb(float value); + + inline bool getRadar(); + inline void setRadar(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class RadarState::LeadData::Pipeline { +public: + typedef LeadData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LiveCalibrationData::Reader { +public: + typedef LiveCalibrationData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasWarpMatrixDEPRECATED() const; + inline ::capnp::List::Reader getWarpMatrixDEPRECATED() const; + + inline ::int8_t getCalStatus() const; + + inline ::int32_t getCalCycle() const; + + inline ::int8_t getCalPerc() const; + + inline bool hasExtrinsicMatrix() const; + inline ::capnp::List::Reader getExtrinsicMatrix() const; + + inline bool hasWarpMatrix2DEPRECATED() const; + inline ::capnp::List::Reader getWarpMatrix2DEPRECATED() const; + + inline bool hasWarpMatrixBigDEPRECATED() const; + inline ::capnp::List::Reader getWarpMatrixBigDEPRECATED() const; + + inline bool hasRpyCalib() const; + inline ::capnp::List::Reader getRpyCalib() const; + + inline bool hasRpyCalibSpread() const; + inline ::capnp::List::Reader getRpyCalibSpread() const; + + inline ::int32_t getValidBlocks() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LiveCalibrationData::Builder { +public: + typedef LiveCalibrationData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasWarpMatrixDEPRECATED(); + inline ::capnp::List::Builder getWarpMatrixDEPRECATED(); + inline void setWarpMatrixDEPRECATED( ::capnp::List::Reader value); + inline void setWarpMatrixDEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initWarpMatrixDEPRECATED(unsigned int size); + inline void adoptWarpMatrixDEPRECATED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownWarpMatrixDEPRECATED(); + + inline ::int8_t getCalStatus(); + inline void setCalStatus( ::int8_t value); + + inline ::int32_t getCalCycle(); + inline void setCalCycle( ::int32_t value); + + inline ::int8_t getCalPerc(); + inline void setCalPerc( ::int8_t value); + + inline bool hasExtrinsicMatrix(); + inline ::capnp::List::Builder getExtrinsicMatrix(); + inline void setExtrinsicMatrix( ::capnp::List::Reader value); + inline void setExtrinsicMatrix(::kj::ArrayPtr value); + inline ::capnp::List::Builder initExtrinsicMatrix(unsigned int size); + inline void adoptExtrinsicMatrix(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownExtrinsicMatrix(); + + inline bool hasWarpMatrix2DEPRECATED(); + inline ::capnp::List::Builder getWarpMatrix2DEPRECATED(); + inline void setWarpMatrix2DEPRECATED( ::capnp::List::Reader value); + inline void setWarpMatrix2DEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initWarpMatrix2DEPRECATED(unsigned int size); + inline void adoptWarpMatrix2DEPRECATED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownWarpMatrix2DEPRECATED(); + + inline bool hasWarpMatrixBigDEPRECATED(); + inline ::capnp::List::Builder getWarpMatrixBigDEPRECATED(); + inline void setWarpMatrixBigDEPRECATED( ::capnp::List::Reader value); + inline void setWarpMatrixBigDEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initWarpMatrixBigDEPRECATED(unsigned int size); + inline void adoptWarpMatrixBigDEPRECATED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownWarpMatrixBigDEPRECATED(); + + inline bool hasRpyCalib(); + inline ::capnp::List::Builder getRpyCalib(); + inline void setRpyCalib( ::capnp::List::Reader value); + inline void setRpyCalib(::kj::ArrayPtr value); + inline ::capnp::List::Builder initRpyCalib(unsigned int size); + inline void adoptRpyCalib(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownRpyCalib(); + + inline bool hasRpyCalibSpread(); + inline ::capnp::List::Builder getRpyCalibSpread(); + inline void setRpyCalibSpread( ::capnp::List::Reader value); + inline void setRpyCalibSpread(::kj::ArrayPtr value); + inline ::capnp::List::Builder initRpyCalibSpread(unsigned int size); + inline void adoptRpyCalibSpread(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownRpyCalibSpread(); + + inline ::int32_t getValidBlocks(); + inline void setValidBlocks( ::int32_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LiveCalibrationData::Pipeline { +public: + typedef LiveCalibrationData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LiveTracks::Reader { +public: + typedef LiveTracks Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::int32_t getTrackId() const; + + inline float getDRel() const; + + inline float getYRel() const; + + inline float getVRel() const; + + inline float getARel() const; + + inline float getTimeStamp() const; + + inline float getStatus() const; + + inline float getCurrentTime() const; + + inline bool getStationary() const; + + inline bool getOncoming() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LiveTracks::Builder { +public: + typedef LiveTracks Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::int32_t getTrackId(); + inline void setTrackId( ::int32_t value); + + inline float getDRel(); + inline void setDRel(float value); + + inline float getYRel(); + inline void setYRel(float value); + + inline float getVRel(); + inline void setVRel(float value); + + inline float getARel(); + inline void setARel(float value); + + inline float getTimeStamp(); + inline void setTimeStamp(float value); + + inline float getStatus(); + inline void setStatus(float value); + + inline float getCurrentTime(); + inline void setCurrentTime(float value); + + inline bool getStationary(); + inline void setStationary(bool value); + + inline bool getOncoming(); + inline void setOncoming(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LiveTracks::Pipeline { +public: + typedef LiveTracks Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ControlsState::Reader { +public: + typedef ControlsState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline float getVEgoDEPRECATED() const; + + inline float getAEgoDEPRECATED() const; + + inline float getVPid() const; + + inline float getVTargetLead() const; + + inline float getUpAccelCmd() const; + + inline float getUiAccelCmd() const; + + inline float getYActualDEPRECATED() const; + + inline float getYDesDEPRECATED() const; + + inline float getUpSteerDEPRECATED() const; + + inline float getUiSteerDEPRECATED() const; + + inline float getATargetMinDEPRECATED() const; + + inline float getATargetMaxDEPRECATED() const; + + inline float getJerkFactorDEPRECATED() const; + + inline float getAngleSteersDEPRECATED() const; + + inline ::int32_t getHudLeadDEPRECATED() const; + + inline float getCumLagMs() const; + + inline ::uint64_t getCanMonoTimeDEPRECATED() const; + + inline ::uint64_t getRadarStateMonoTimeDEPRECATED() const; + + inline ::uint64_t getMdMonoTimeDEPRECATED() const; + + inline bool getEnabled() const; + + inline bool getSteerOverrideDEPRECATED() const; + + inline bool hasCanMonoTimes() const; + inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader getCanMonoTimes() const; + + inline float getVCruise() const; + + inline bool getRearViewCamDEPRECATED() const; + + inline bool hasAlertText1() const; + inline ::capnp::Text::Reader getAlertText1() const; + + inline bool hasAlertText2() const; + inline ::capnp::Text::Reader getAlertText2() const; + + inline float getAwarenessStatusDEPRECATED() const; + + inline float getAngleModelBiasDEPRECATED() const; + + inline ::uint64_t getLongitudinalPlanMonoTime() const; + + inline float getSteeringAngleDesiredDegDEPRECATED() const; + + inline ::cereal::CarControl::Actuators::LongControlState getLongControlState() const; + + inline ::cereal::ControlsState::OpenpilotState getState() const; + + inline float getVEgoRawDEPRECATED() const; + + inline float getUfAccelCmd() const; + + inline float getUfSteerDEPRECATED() const; + + inline float getATarget() const; + + inline bool getActive() const; + + inline float getCurvature() const; + + inline ::cereal::ControlsState::AlertStatus getAlertStatus() const; + + inline ::cereal::ControlsState::AlertSize getAlertSize() const; + + inline bool getGpsPlannerActiveDEPRECATED() const; + + inline bool getEngageable() const; + + inline float getAlertBlinkingRate() const; + + inline bool getDriverMonitoringOnDEPRECATED() const; + + inline bool hasAlertType() const; + inline ::capnp::Text::Reader getAlertType() const; + + inline bool hasAlertSoundDEPRECATED() const; + inline ::capnp::Text::Reader getAlertSoundDEPRECATED() const; + + inline float getVCurvatureDEPRECATED() const; + + inline bool getDecelForTurnDEPRECATED() const; + + inline ::uint64_t getStartMonoTime() const; + + inline bool getMapValidDEPRECATED() const; + + inline ::uint64_t getLateralPlanMonoTime() const; + + inline bool getForceDecel() const; + + inline typename LateralControlState::Reader getLateralControlState() const; + + inline bool getDecelForModelDEPRECATED() const; + + inline ::cereal::CarControl::HUDControl::AudibleAlert getAlertSound() const; + + inline ::uint32_t getCanErrorCounter() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ControlsState::Builder { +public: + typedef ControlsState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline float getVEgoDEPRECATED(); + inline void setVEgoDEPRECATED(float value); + + inline float getAEgoDEPRECATED(); + inline void setAEgoDEPRECATED(float value); + + inline float getVPid(); + inline void setVPid(float value); + + inline float getVTargetLead(); + inline void setVTargetLead(float value); + + inline float getUpAccelCmd(); + inline void setUpAccelCmd(float value); + + inline float getUiAccelCmd(); + inline void setUiAccelCmd(float value); + + inline float getYActualDEPRECATED(); + inline void setYActualDEPRECATED(float value); + + inline float getYDesDEPRECATED(); + inline void setYDesDEPRECATED(float value); + + inline float getUpSteerDEPRECATED(); + inline void setUpSteerDEPRECATED(float value); + + inline float getUiSteerDEPRECATED(); + inline void setUiSteerDEPRECATED(float value); + + inline float getATargetMinDEPRECATED(); + inline void setATargetMinDEPRECATED(float value); + + inline float getATargetMaxDEPRECATED(); + inline void setATargetMaxDEPRECATED(float value); + + inline float getJerkFactorDEPRECATED(); + inline void setJerkFactorDEPRECATED(float value); + + inline float getAngleSteersDEPRECATED(); + inline void setAngleSteersDEPRECATED(float value); + + inline ::int32_t getHudLeadDEPRECATED(); + inline void setHudLeadDEPRECATED( ::int32_t value); + + inline float getCumLagMs(); + inline void setCumLagMs(float value); + + inline ::uint64_t getCanMonoTimeDEPRECATED(); + inline void setCanMonoTimeDEPRECATED( ::uint64_t value); + + inline ::uint64_t getRadarStateMonoTimeDEPRECATED(); + inline void setRadarStateMonoTimeDEPRECATED( ::uint64_t value); + + inline ::uint64_t getMdMonoTimeDEPRECATED(); + inline void setMdMonoTimeDEPRECATED( ::uint64_t value); + + inline bool getEnabled(); + inline void setEnabled(bool value); + + inline bool getSteerOverrideDEPRECATED(); + inline void setSteerOverrideDEPRECATED(bool value); + + inline bool hasCanMonoTimes(); + inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder getCanMonoTimes(); + inline void setCanMonoTimes( ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader value); + inline void setCanMonoTimes(::kj::ArrayPtr value); + inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder initCanMonoTimes(unsigned int size); + inline void adoptCanMonoTimes(::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>> disownCanMonoTimes(); + + inline float getVCruise(); + inline void setVCruise(float value); + + inline bool getRearViewCamDEPRECATED(); + inline void setRearViewCamDEPRECATED(bool value); + + inline bool hasAlertText1(); + inline ::capnp::Text::Builder getAlertText1(); + inline void setAlertText1( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initAlertText1(unsigned int size); + inline void adoptAlertText1(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownAlertText1(); + + inline bool hasAlertText2(); + inline ::capnp::Text::Builder getAlertText2(); + inline void setAlertText2( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initAlertText2(unsigned int size); + inline void adoptAlertText2(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownAlertText2(); + + inline float getAwarenessStatusDEPRECATED(); + inline void setAwarenessStatusDEPRECATED(float value); + + inline float getAngleModelBiasDEPRECATED(); + inline void setAngleModelBiasDEPRECATED(float value); + + inline ::uint64_t getLongitudinalPlanMonoTime(); + inline void setLongitudinalPlanMonoTime( ::uint64_t value); + + inline float getSteeringAngleDesiredDegDEPRECATED(); + inline void setSteeringAngleDesiredDegDEPRECATED(float value); + + inline ::cereal::CarControl::Actuators::LongControlState getLongControlState(); + inline void setLongControlState( ::cereal::CarControl::Actuators::LongControlState value); + + inline ::cereal::ControlsState::OpenpilotState getState(); + inline void setState( ::cereal::ControlsState::OpenpilotState value); + + inline float getVEgoRawDEPRECATED(); + inline void setVEgoRawDEPRECATED(float value); + + inline float getUfAccelCmd(); + inline void setUfAccelCmd(float value); + + inline float getUfSteerDEPRECATED(); + inline void setUfSteerDEPRECATED(float value); + + inline float getATarget(); + inline void setATarget(float value); + + inline bool getActive(); + inline void setActive(bool value); + + inline float getCurvature(); + inline void setCurvature(float value); + + inline ::cereal::ControlsState::AlertStatus getAlertStatus(); + inline void setAlertStatus( ::cereal::ControlsState::AlertStatus value); + + inline ::cereal::ControlsState::AlertSize getAlertSize(); + inline void setAlertSize( ::cereal::ControlsState::AlertSize value); + + inline bool getGpsPlannerActiveDEPRECATED(); + inline void setGpsPlannerActiveDEPRECATED(bool value); + + inline bool getEngageable(); + inline void setEngageable(bool value); + + inline float getAlertBlinkingRate(); + inline void setAlertBlinkingRate(float value); + + inline bool getDriverMonitoringOnDEPRECATED(); + inline void setDriverMonitoringOnDEPRECATED(bool value); + + inline bool hasAlertType(); + inline ::capnp::Text::Builder getAlertType(); + inline void setAlertType( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initAlertType(unsigned int size); + inline void adoptAlertType(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownAlertType(); + + inline bool hasAlertSoundDEPRECATED(); + inline ::capnp::Text::Builder getAlertSoundDEPRECATED(); + inline void setAlertSoundDEPRECATED( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initAlertSoundDEPRECATED(unsigned int size); + inline void adoptAlertSoundDEPRECATED(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownAlertSoundDEPRECATED(); + + inline float getVCurvatureDEPRECATED(); + inline void setVCurvatureDEPRECATED(float value); + + inline bool getDecelForTurnDEPRECATED(); + inline void setDecelForTurnDEPRECATED(bool value); + + inline ::uint64_t getStartMonoTime(); + inline void setStartMonoTime( ::uint64_t value); + + inline bool getMapValidDEPRECATED(); + inline void setMapValidDEPRECATED(bool value); + + inline ::uint64_t getLateralPlanMonoTime(); + inline void setLateralPlanMonoTime( ::uint64_t value); + + inline bool getForceDecel(); + inline void setForceDecel(bool value); + + inline typename LateralControlState::Builder getLateralControlState(); + inline typename LateralControlState::Builder initLateralControlState(); + + inline bool getDecelForModelDEPRECATED(); + inline void setDecelForModelDEPRECATED(bool value); + + inline ::cereal::CarControl::HUDControl::AudibleAlert getAlertSound(); + inline void setAlertSound( ::cereal::CarControl::HUDControl::AudibleAlert value); + + inline ::uint32_t getCanErrorCounter(); + inline void setCanErrorCounter( ::uint32_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ControlsState::Pipeline { +public: + typedef ControlsState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline typename LateralControlState::Pipeline getLateralControlState(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ControlsState::LateralINDIState::Reader { +public: + typedef LateralINDIState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getActive() const; + + inline float getSteeringAngleDeg() const; + + inline float getSteeringRateDeg() const; + + inline float getSteeringAccelDeg() const; + + inline float getRateSetPoint() const; + + inline float getAccelSetPoint() const; + + inline float getAccelError() const; + + inline float getDelayedOutput() const; + + inline float getDelta() const; + + inline float getOutput() const; + + inline bool getSaturated() const; + + inline float getSteeringAngleDesiredDeg() const; + + inline float getSteeringRateDesiredDeg() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ControlsState::LateralINDIState::Builder { +public: + typedef LateralINDIState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getActive(); + inline void setActive(bool value); + + inline float getSteeringAngleDeg(); + inline void setSteeringAngleDeg(float value); + + inline float getSteeringRateDeg(); + inline void setSteeringRateDeg(float value); + + inline float getSteeringAccelDeg(); + inline void setSteeringAccelDeg(float value); + + inline float getRateSetPoint(); + inline void setRateSetPoint(float value); + + inline float getAccelSetPoint(); + inline void setAccelSetPoint(float value); + + inline float getAccelError(); + inline void setAccelError(float value); + + inline float getDelayedOutput(); + inline void setDelayedOutput(float value); + + inline float getDelta(); + inline void setDelta(float value); + + inline float getOutput(); + inline void setOutput(float value); + + inline bool getSaturated(); + inline void setSaturated(bool value); + + inline float getSteeringAngleDesiredDeg(); + inline void setSteeringAngleDesiredDeg(float value); + + inline float getSteeringRateDesiredDeg(); + inline void setSteeringRateDesiredDeg(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ControlsState::LateralINDIState::Pipeline { +public: + typedef LateralINDIState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ControlsState::LateralPIDState::Reader { +public: + typedef LateralPIDState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getActive() const; + + inline float getSteeringAngleDeg() const; + + inline float getSteeringRateDeg() const; + + inline float getAngleError() const; + + inline float getP() const; + + inline float getI() const; + + inline float getF() const; + + inline float getOutput() const; + + inline bool getSaturated() const; + + inline float getSteeringAngleDesiredDeg() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ControlsState::LateralPIDState::Builder { +public: + typedef LateralPIDState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getActive(); + inline void setActive(bool value); + + inline float getSteeringAngleDeg(); + inline void setSteeringAngleDeg(float value); + + inline float getSteeringRateDeg(); + inline void setSteeringRateDeg(float value); + + inline float getAngleError(); + inline void setAngleError(float value); + + inline float getP(); + inline void setP(float value); + + inline float getI(); + inline void setI(float value); + + inline float getF(); + inline void setF(float value); + + inline float getOutput(); + inline void setOutput(float value); + + inline bool getSaturated(); + inline void setSaturated(bool value); + + inline float getSteeringAngleDesiredDeg(); + inline void setSteeringAngleDesiredDeg(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ControlsState::LateralPIDState::Pipeline { +public: + typedef LateralPIDState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ControlsState::LateralLQRState::Reader { +public: + typedef LateralLQRState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getActive() const; + + inline float getSteeringAngleDeg() const; + + inline float getI() const; + + inline float getOutput() const; + + inline float getLqrOutput() const; + + inline bool getSaturated() const; + + inline float getSteeringAngleDesiredDeg() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ControlsState::LateralLQRState::Builder { +public: + typedef LateralLQRState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getActive(); + inline void setActive(bool value); + + inline float getSteeringAngleDeg(); + inline void setSteeringAngleDeg(float value); + + inline float getI(); + inline void setI(float value); + + inline float getOutput(); + inline void setOutput(float value); + + inline float getLqrOutput(); + inline void setLqrOutput(float value); + + inline bool getSaturated(); + inline void setSaturated(bool value); + + inline float getSteeringAngleDesiredDeg(); + inline void setSteeringAngleDesiredDeg(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ControlsState::LateralLQRState::Pipeline { +public: + typedef LateralLQRState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ControlsState::LateralAngleState::Reader { +public: + typedef LateralAngleState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getActive() const; + + inline float getSteeringAngleDeg() const; + + inline float getOutput() const; + + inline bool getSaturated() const; + + inline float getSteeringAngleDesiredDeg() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ControlsState::LateralAngleState::Builder { +public: + typedef LateralAngleState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getActive(); + inline void setActive(bool value); + + inline float getSteeringAngleDeg(); + inline void setSteeringAngleDeg(float value); + + inline float getOutput(); + inline void setOutput(float value); + + inline bool getSaturated(); + inline void setSaturated(bool value); + + inline float getSteeringAngleDesiredDeg(); + inline void setSteeringAngleDesiredDeg(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ControlsState::LateralAngleState::Pipeline { +public: + typedef LateralAngleState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ControlsState::LateralDebugState::Reader { +public: + typedef LateralDebugState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getActive() const; + + inline float getSteeringAngleDeg() const; + + inline float getOutput() const; + + inline bool getSaturated() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ControlsState::LateralDebugState::Builder { +public: + typedef LateralDebugState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getActive(); + inline void setActive(bool value); + + inline float getSteeringAngleDeg(); + inline void setSteeringAngleDeg(float value); + + inline float getOutput(); + inline void setOutput(float value); + + inline bool getSaturated(); + inline void setSaturated(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ControlsState::LateralDebugState::Pipeline { +public: + typedef LateralDebugState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ControlsState::LateralControlState::Reader { +public: + typedef LateralControlState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline Which which() const; + inline bool isIndiState() const; + inline bool hasIndiState() const; + inline ::cereal::ControlsState::LateralINDIState::Reader getIndiState() const; + + inline bool isPidState() const; + inline bool hasPidState() const; + inline ::cereal::ControlsState::LateralPIDState::Reader getPidState() const; + + inline bool isLqrState() const; + inline bool hasLqrState() const; + inline ::cereal::ControlsState::LateralLQRState::Reader getLqrState() const; + + inline bool isAngleState() const; + inline bool hasAngleState() const; + inline ::cereal::ControlsState::LateralAngleState::Reader getAngleState() const; + + inline bool isDebugState() const; + inline bool hasDebugState() const; + inline ::cereal::ControlsState::LateralDebugState::Reader getDebugState() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ControlsState::LateralControlState::Builder { +public: + typedef LateralControlState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline Which which(); + inline bool isIndiState(); + inline bool hasIndiState(); + inline ::cereal::ControlsState::LateralINDIState::Builder getIndiState(); + inline void setIndiState( ::cereal::ControlsState::LateralINDIState::Reader value); + inline ::cereal::ControlsState::LateralINDIState::Builder initIndiState(); + inline void adoptIndiState(::capnp::Orphan< ::cereal::ControlsState::LateralINDIState>&& value); + inline ::capnp::Orphan< ::cereal::ControlsState::LateralINDIState> disownIndiState(); + + inline bool isPidState(); + inline bool hasPidState(); + inline ::cereal::ControlsState::LateralPIDState::Builder getPidState(); + inline void setPidState( ::cereal::ControlsState::LateralPIDState::Reader value); + inline ::cereal::ControlsState::LateralPIDState::Builder initPidState(); + inline void adoptPidState(::capnp::Orphan< ::cereal::ControlsState::LateralPIDState>&& value); + inline ::capnp::Orphan< ::cereal::ControlsState::LateralPIDState> disownPidState(); + + inline bool isLqrState(); + inline bool hasLqrState(); + inline ::cereal::ControlsState::LateralLQRState::Builder getLqrState(); + inline void setLqrState( ::cereal::ControlsState::LateralLQRState::Reader value); + inline ::cereal::ControlsState::LateralLQRState::Builder initLqrState(); + inline void adoptLqrState(::capnp::Orphan< ::cereal::ControlsState::LateralLQRState>&& value); + inline ::capnp::Orphan< ::cereal::ControlsState::LateralLQRState> disownLqrState(); + + inline bool isAngleState(); + inline bool hasAngleState(); + inline ::cereal::ControlsState::LateralAngleState::Builder getAngleState(); + inline void setAngleState( ::cereal::ControlsState::LateralAngleState::Reader value); + inline ::cereal::ControlsState::LateralAngleState::Builder initAngleState(); + inline void adoptAngleState(::capnp::Orphan< ::cereal::ControlsState::LateralAngleState>&& value); + inline ::capnp::Orphan< ::cereal::ControlsState::LateralAngleState> disownAngleState(); + + inline bool isDebugState(); + inline bool hasDebugState(); + inline ::cereal::ControlsState::LateralDebugState::Builder getDebugState(); + inline void setDebugState( ::cereal::ControlsState::LateralDebugState::Reader value); + inline ::cereal::ControlsState::LateralDebugState::Builder initDebugState(); + inline void adoptDebugState(::capnp::Orphan< ::cereal::ControlsState::LateralDebugState>&& value); + inline ::capnp::Orphan< ::cereal::ControlsState::LateralDebugState> disownDebugState(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ControlsState::LateralControlState::Pipeline { +public: + typedef LateralControlState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ModelDataV2::Reader { +public: + typedef ModelDataV2 Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint32_t getFrameId() const; + + inline ::uint32_t getFrameAge() const; + + inline float getFrameDropPerc() const; + + inline ::uint64_t getTimestampEof() const; + + inline bool hasPosition() const; + inline ::cereal::ModelDataV2::XYZTData::Reader getPosition() const; + + inline bool hasOrientation() const; + inline ::cereal::ModelDataV2::XYZTData::Reader getOrientation() const; + + inline bool hasVelocity() const; + inline ::cereal::ModelDataV2::XYZTData::Reader getVelocity() const; + + inline bool hasOrientationRate() const; + inline ::cereal::ModelDataV2::XYZTData::Reader getOrientationRate() const; + + inline bool hasLaneLines() const; + inline ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Reader getLaneLines() const; + + inline bool hasLaneLineProbs() const; + inline ::capnp::List::Reader getLaneLineProbs() const; + + inline bool hasRoadEdges() const; + inline ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Reader getRoadEdges() const; + + inline bool hasLeads() const; + inline ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>::Reader getLeads() const; + + inline bool hasMeta() const; + inline ::cereal::ModelDataV2::MetaData::Reader getMeta() const; + + inline bool hasLaneLineStds() const; + inline ::capnp::List::Reader getLaneLineStds() const; + + inline bool hasRoadEdgeStds() const; + inline ::capnp::List::Reader getRoadEdgeStds() const; + + inline float getModelExecutionTime() const; + + inline bool hasRawPredictions() const; + inline ::capnp::Data::Reader getRawPredictions() const; + + inline float getGpuExecutionTime() const; + + inline bool hasLeadsV3() const; + inline ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>::Reader getLeadsV3() const; + + inline bool hasAcceleration() const; + inline ::cereal::ModelDataV2::XYZTData::Reader getAcceleration() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ModelDataV2::Builder { +public: + typedef ModelDataV2 Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint32_t getFrameId(); + inline void setFrameId( ::uint32_t value); + + inline ::uint32_t getFrameAge(); + inline void setFrameAge( ::uint32_t value); + + inline float getFrameDropPerc(); + inline void setFrameDropPerc(float value); + + inline ::uint64_t getTimestampEof(); + inline void setTimestampEof( ::uint64_t value); + + inline bool hasPosition(); + inline ::cereal::ModelDataV2::XYZTData::Builder getPosition(); + inline void setPosition( ::cereal::ModelDataV2::XYZTData::Reader value); + inline ::cereal::ModelDataV2::XYZTData::Builder initPosition(); + inline void adoptPosition(::capnp::Orphan< ::cereal::ModelDataV2::XYZTData>&& value); + inline ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData> disownPosition(); + + inline bool hasOrientation(); + inline ::cereal::ModelDataV2::XYZTData::Builder getOrientation(); + inline void setOrientation( ::cereal::ModelDataV2::XYZTData::Reader value); + inline ::cereal::ModelDataV2::XYZTData::Builder initOrientation(); + inline void adoptOrientation(::capnp::Orphan< ::cereal::ModelDataV2::XYZTData>&& value); + inline ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData> disownOrientation(); + + inline bool hasVelocity(); + inline ::cereal::ModelDataV2::XYZTData::Builder getVelocity(); + inline void setVelocity( ::cereal::ModelDataV2::XYZTData::Reader value); + inline ::cereal::ModelDataV2::XYZTData::Builder initVelocity(); + inline void adoptVelocity(::capnp::Orphan< ::cereal::ModelDataV2::XYZTData>&& value); + inline ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData> disownVelocity(); + + inline bool hasOrientationRate(); + inline ::cereal::ModelDataV2::XYZTData::Builder getOrientationRate(); + inline void setOrientationRate( ::cereal::ModelDataV2::XYZTData::Reader value); + inline ::cereal::ModelDataV2::XYZTData::Builder initOrientationRate(); + inline void adoptOrientationRate(::capnp::Orphan< ::cereal::ModelDataV2::XYZTData>&& value); + inline ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData> disownOrientationRate(); + + inline bool hasLaneLines(); + inline ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Builder getLaneLines(); + inline void setLaneLines( ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Builder initLaneLines(unsigned int size); + inline void adoptLaneLines(::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>> disownLaneLines(); + + inline bool hasLaneLineProbs(); + inline ::capnp::List::Builder getLaneLineProbs(); + inline void setLaneLineProbs( ::capnp::List::Reader value); + inline void setLaneLineProbs(::kj::ArrayPtr value); + inline ::capnp::List::Builder initLaneLineProbs(unsigned int size); + inline void adoptLaneLineProbs(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownLaneLineProbs(); + + inline bool hasRoadEdges(); + inline ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Builder getRoadEdges(); + inline void setRoadEdges( ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Builder initRoadEdges(unsigned int size); + inline void adoptRoadEdges(::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>> disownRoadEdges(); + + inline bool hasLeads(); + inline ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>::Builder getLeads(); + inline void setLeads( ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>::Builder initLeads(unsigned int size); + inline void adoptLeads(::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>> disownLeads(); + + inline bool hasMeta(); + inline ::cereal::ModelDataV2::MetaData::Builder getMeta(); + inline void setMeta( ::cereal::ModelDataV2::MetaData::Reader value); + inline ::cereal::ModelDataV2::MetaData::Builder initMeta(); + inline void adoptMeta(::capnp::Orphan< ::cereal::ModelDataV2::MetaData>&& value); + inline ::capnp::Orphan< ::cereal::ModelDataV2::MetaData> disownMeta(); + + inline bool hasLaneLineStds(); + inline ::capnp::List::Builder getLaneLineStds(); + inline void setLaneLineStds( ::capnp::List::Reader value); + inline void setLaneLineStds(::kj::ArrayPtr value); + inline ::capnp::List::Builder initLaneLineStds(unsigned int size); + inline void adoptLaneLineStds(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownLaneLineStds(); + + inline bool hasRoadEdgeStds(); + inline ::capnp::List::Builder getRoadEdgeStds(); + inline void setRoadEdgeStds( ::capnp::List::Reader value); + inline void setRoadEdgeStds(::kj::ArrayPtr value); + inline ::capnp::List::Builder initRoadEdgeStds(unsigned int size); + inline void adoptRoadEdgeStds(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownRoadEdgeStds(); + + inline float getModelExecutionTime(); + inline void setModelExecutionTime(float value); + + inline bool hasRawPredictions(); + inline ::capnp::Data::Builder getRawPredictions(); + inline void setRawPredictions( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initRawPredictions(unsigned int size); + inline void adoptRawPredictions(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownRawPredictions(); + + inline float getGpuExecutionTime(); + inline void setGpuExecutionTime(float value); + + inline bool hasLeadsV3(); + inline ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>::Builder getLeadsV3(); + inline void setLeadsV3( ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>::Builder initLeadsV3(unsigned int size); + inline void adoptLeadsV3(::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>> disownLeadsV3(); + + inline bool hasAcceleration(); + inline ::cereal::ModelDataV2::XYZTData::Builder getAcceleration(); + inline void setAcceleration( ::cereal::ModelDataV2::XYZTData::Reader value); + inline ::cereal::ModelDataV2::XYZTData::Builder initAcceleration(); + inline void adoptAcceleration(::capnp::Orphan< ::cereal::ModelDataV2::XYZTData>&& value); + inline ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData> disownAcceleration(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ModelDataV2::Pipeline { +public: + typedef ModelDataV2 Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::ModelDataV2::XYZTData::Pipeline getPosition(); + inline ::cereal::ModelDataV2::XYZTData::Pipeline getOrientation(); + inline ::cereal::ModelDataV2::XYZTData::Pipeline getVelocity(); + inline ::cereal::ModelDataV2::XYZTData::Pipeline getOrientationRate(); + inline ::cereal::ModelDataV2::MetaData::Pipeline getMeta(); + inline ::cereal::ModelDataV2::XYZTData::Pipeline getAcceleration(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ModelDataV2::XYZTData::Reader { +public: + typedef XYZTData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasX() const; + inline ::capnp::List::Reader getX() const; + + inline bool hasY() const; + inline ::capnp::List::Reader getY() const; + + inline bool hasZ() const; + inline ::capnp::List::Reader getZ() const; + + inline bool hasT() const; + inline ::capnp::List::Reader getT() const; + + inline bool hasXStd() const; + inline ::capnp::List::Reader getXStd() const; + + inline bool hasYStd() const; + inline ::capnp::List::Reader getYStd() const; + + inline bool hasZStd() const; + inline ::capnp::List::Reader getZStd() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ModelDataV2::XYZTData::Builder { +public: + typedef XYZTData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasX(); + inline ::capnp::List::Builder getX(); + inline void setX( ::capnp::List::Reader value); + inline void setX(::kj::ArrayPtr value); + inline ::capnp::List::Builder initX(unsigned int size); + inline void adoptX(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownX(); + + inline bool hasY(); + inline ::capnp::List::Builder getY(); + inline void setY( ::capnp::List::Reader value); + inline void setY(::kj::ArrayPtr value); + inline ::capnp::List::Builder initY(unsigned int size); + inline void adoptY(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownY(); + + inline bool hasZ(); + inline ::capnp::List::Builder getZ(); + inline void setZ( ::capnp::List::Reader value); + inline void setZ(::kj::ArrayPtr value); + inline ::capnp::List::Builder initZ(unsigned int size); + inline void adoptZ(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownZ(); + + inline bool hasT(); + inline ::capnp::List::Builder getT(); + inline void setT( ::capnp::List::Reader value); + inline void setT(::kj::ArrayPtr value); + inline ::capnp::List::Builder initT(unsigned int size); + inline void adoptT(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownT(); + + inline bool hasXStd(); + inline ::capnp::List::Builder getXStd(); + inline void setXStd( ::capnp::List::Reader value); + inline void setXStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initXStd(unsigned int size); + inline void adoptXStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownXStd(); + + inline bool hasYStd(); + inline ::capnp::List::Builder getYStd(); + inline void setYStd( ::capnp::List::Reader value); + inline void setYStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initYStd(unsigned int size); + inline void adoptYStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownYStd(); + + inline bool hasZStd(); + inline ::capnp::List::Builder getZStd(); + inline void setZStd( ::capnp::List::Reader value); + inline void setZStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initZStd(unsigned int size); + inline void adoptZStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownZStd(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ModelDataV2::XYZTData::Pipeline { +public: + typedef XYZTData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ModelDataV2::LeadDataV2::Reader { +public: + typedef LeadDataV2 Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline float getProb() const; + + inline float getT() const; + + inline bool hasXyva() const; + inline ::capnp::List::Reader getXyva() const; + + inline bool hasXyvaStd() const; + inline ::capnp::List::Reader getXyvaStd() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ModelDataV2::LeadDataV2::Builder { +public: + typedef LeadDataV2 Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline float getProb(); + inline void setProb(float value); + + inline float getT(); + inline void setT(float value); + + inline bool hasXyva(); + inline ::capnp::List::Builder getXyva(); + inline void setXyva( ::capnp::List::Reader value); + inline void setXyva(::kj::ArrayPtr value); + inline ::capnp::List::Builder initXyva(unsigned int size); + inline void adoptXyva(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownXyva(); + + inline bool hasXyvaStd(); + inline ::capnp::List::Builder getXyvaStd(); + inline void setXyvaStd( ::capnp::List::Reader value); + inline void setXyvaStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initXyvaStd(unsigned int size); + inline void adoptXyvaStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownXyvaStd(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ModelDataV2::LeadDataV2::Pipeline { +public: + typedef LeadDataV2 Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ModelDataV2::LeadDataV3::Reader { +public: + typedef LeadDataV3 Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline float getProb() const; + + inline float getProbTime() const; + + inline bool hasT() const; + inline ::capnp::List::Reader getT() const; + + inline bool hasX() const; + inline ::capnp::List::Reader getX() const; + + inline bool hasXStd() const; + inline ::capnp::List::Reader getXStd() const; + + inline bool hasY() const; + inline ::capnp::List::Reader getY() const; + + inline bool hasYStd() const; + inline ::capnp::List::Reader getYStd() const; + + inline bool hasV() const; + inline ::capnp::List::Reader getV() const; + + inline bool hasVStd() const; + inline ::capnp::List::Reader getVStd() const; + + inline bool hasA() const; + inline ::capnp::List::Reader getA() const; + + inline bool hasAStd() const; + inline ::capnp::List::Reader getAStd() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ModelDataV2::LeadDataV3::Builder { +public: + typedef LeadDataV3 Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline float getProb(); + inline void setProb(float value); + + inline float getProbTime(); + inline void setProbTime(float value); + + inline bool hasT(); + inline ::capnp::List::Builder getT(); + inline void setT( ::capnp::List::Reader value); + inline void setT(::kj::ArrayPtr value); + inline ::capnp::List::Builder initT(unsigned int size); + inline void adoptT(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownT(); + + inline bool hasX(); + inline ::capnp::List::Builder getX(); + inline void setX( ::capnp::List::Reader value); + inline void setX(::kj::ArrayPtr value); + inline ::capnp::List::Builder initX(unsigned int size); + inline void adoptX(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownX(); + + inline bool hasXStd(); + inline ::capnp::List::Builder getXStd(); + inline void setXStd( ::capnp::List::Reader value); + inline void setXStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initXStd(unsigned int size); + inline void adoptXStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownXStd(); + + inline bool hasY(); + inline ::capnp::List::Builder getY(); + inline void setY( ::capnp::List::Reader value); + inline void setY(::kj::ArrayPtr value); + inline ::capnp::List::Builder initY(unsigned int size); + inline void adoptY(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownY(); + + inline bool hasYStd(); + inline ::capnp::List::Builder getYStd(); + inline void setYStd( ::capnp::List::Reader value); + inline void setYStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initYStd(unsigned int size); + inline void adoptYStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownYStd(); + + inline bool hasV(); + inline ::capnp::List::Builder getV(); + inline void setV( ::capnp::List::Reader value); + inline void setV(::kj::ArrayPtr value); + inline ::capnp::List::Builder initV(unsigned int size); + inline void adoptV(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownV(); + + inline bool hasVStd(); + inline ::capnp::List::Builder getVStd(); + inline void setVStd( ::capnp::List::Reader value); + inline void setVStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initVStd(unsigned int size); + inline void adoptVStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownVStd(); + + inline bool hasA(); + inline ::capnp::List::Builder getA(); + inline void setA( ::capnp::List::Reader value); + inline void setA(::kj::ArrayPtr value); + inline ::capnp::List::Builder initA(unsigned int size); + inline void adoptA(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownA(); + + inline bool hasAStd(); + inline ::capnp::List::Builder getAStd(); + inline void setAStd( ::capnp::List::Reader value); + inline void setAStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initAStd(unsigned int size); + inline void adoptAStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownAStd(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ModelDataV2::LeadDataV3::Pipeline { +public: + typedef LeadDataV3 Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ModelDataV2::MetaData::Reader { +public: + typedef MetaData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline float getEngagedProb() const; + + inline bool hasDesirePrediction() const; + inline ::capnp::List::Reader getDesirePrediction() const; + + inline float getBrakeDisengageProbDEPRECATED() const; + + inline float getGasDisengageProbDEPRECATED() const; + + inline float getSteerOverrideProbDEPRECATED() const; + + inline bool hasDesireState() const; + inline ::capnp::List::Reader getDesireState() const; + + inline bool hasDisengagePredictions() const; + inline ::cereal::ModelDataV2::DisengagePredictions::Reader getDisengagePredictions() const; + + inline bool getHardBrakePredicted() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ModelDataV2::MetaData::Builder { +public: + typedef MetaData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline float getEngagedProb(); + inline void setEngagedProb(float value); + + inline bool hasDesirePrediction(); + inline ::capnp::List::Builder getDesirePrediction(); + inline void setDesirePrediction( ::capnp::List::Reader value); + inline void setDesirePrediction(::kj::ArrayPtr value); + inline ::capnp::List::Builder initDesirePrediction(unsigned int size); + inline void adoptDesirePrediction(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownDesirePrediction(); + + inline float getBrakeDisengageProbDEPRECATED(); + inline void setBrakeDisengageProbDEPRECATED(float value); + + inline float getGasDisengageProbDEPRECATED(); + inline void setGasDisengageProbDEPRECATED(float value); + + inline float getSteerOverrideProbDEPRECATED(); + inline void setSteerOverrideProbDEPRECATED(float value); + + inline bool hasDesireState(); + inline ::capnp::List::Builder getDesireState(); + inline void setDesireState( ::capnp::List::Reader value); + inline void setDesireState(::kj::ArrayPtr value); + inline ::capnp::List::Builder initDesireState(unsigned int size); + inline void adoptDesireState(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownDesireState(); + + inline bool hasDisengagePredictions(); + inline ::cereal::ModelDataV2::DisengagePredictions::Builder getDisengagePredictions(); + inline void setDisengagePredictions( ::cereal::ModelDataV2::DisengagePredictions::Reader value); + inline ::cereal::ModelDataV2::DisengagePredictions::Builder initDisengagePredictions(); + inline void adoptDisengagePredictions(::capnp::Orphan< ::cereal::ModelDataV2::DisengagePredictions>&& value); + inline ::capnp::Orphan< ::cereal::ModelDataV2::DisengagePredictions> disownDisengagePredictions(); + + inline bool getHardBrakePredicted(); + inline void setHardBrakePredicted(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ModelDataV2::MetaData::Pipeline { +public: + typedef MetaData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::ModelDataV2::DisengagePredictions::Pipeline getDisengagePredictions(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ModelDataV2::DisengagePredictions::Reader { +public: + typedef DisengagePredictions Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasT() const; + inline ::capnp::List::Reader getT() const; + + inline bool hasBrakeDisengageProbs() const; + inline ::capnp::List::Reader getBrakeDisengageProbs() const; + + inline bool hasGasDisengageProbs() const; + inline ::capnp::List::Reader getGasDisengageProbs() const; + + inline bool hasSteerOverrideProbs() const; + inline ::capnp::List::Reader getSteerOverrideProbs() const; + + inline bool hasBrake3MetersPerSecondSquaredProbs() const; + inline ::capnp::List::Reader getBrake3MetersPerSecondSquaredProbs() const; + + inline bool hasBrake4MetersPerSecondSquaredProbs() const; + inline ::capnp::List::Reader getBrake4MetersPerSecondSquaredProbs() const; + + inline bool hasBrake5MetersPerSecondSquaredProbs() const; + inline ::capnp::List::Reader getBrake5MetersPerSecondSquaredProbs() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ModelDataV2::DisengagePredictions::Builder { +public: + typedef DisengagePredictions Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasT(); + inline ::capnp::List::Builder getT(); + inline void setT( ::capnp::List::Reader value); + inline void setT(::kj::ArrayPtr value); + inline ::capnp::List::Builder initT(unsigned int size); + inline void adoptT(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownT(); + + inline bool hasBrakeDisengageProbs(); + inline ::capnp::List::Builder getBrakeDisengageProbs(); + inline void setBrakeDisengageProbs( ::capnp::List::Reader value); + inline void setBrakeDisengageProbs(::kj::ArrayPtr value); + inline ::capnp::List::Builder initBrakeDisengageProbs(unsigned int size); + inline void adoptBrakeDisengageProbs(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownBrakeDisengageProbs(); + + inline bool hasGasDisengageProbs(); + inline ::capnp::List::Builder getGasDisengageProbs(); + inline void setGasDisengageProbs( ::capnp::List::Reader value); + inline void setGasDisengageProbs(::kj::ArrayPtr value); + inline ::capnp::List::Builder initGasDisengageProbs(unsigned int size); + inline void adoptGasDisengageProbs(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownGasDisengageProbs(); + + inline bool hasSteerOverrideProbs(); + inline ::capnp::List::Builder getSteerOverrideProbs(); + inline void setSteerOverrideProbs( ::capnp::List::Reader value); + inline void setSteerOverrideProbs(::kj::ArrayPtr value); + inline ::capnp::List::Builder initSteerOverrideProbs(unsigned int size); + inline void adoptSteerOverrideProbs(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownSteerOverrideProbs(); + + inline bool hasBrake3MetersPerSecondSquaredProbs(); + inline ::capnp::List::Builder getBrake3MetersPerSecondSquaredProbs(); + inline void setBrake3MetersPerSecondSquaredProbs( ::capnp::List::Reader value); + inline void setBrake3MetersPerSecondSquaredProbs(::kj::ArrayPtr value); + inline ::capnp::List::Builder initBrake3MetersPerSecondSquaredProbs(unsigned int size); + inline void adoptBrake3MetersPerSecondSquaredProbs(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownBrake3MetersPerSecondSquaredProbs(); + + inline bool hasBrake4MetersPerSecondSquaredProbs(); + inline ::capnp::List::Builder getBrake4MetersPerSecondSquaredProbs(); + inline void setBrake4MetersPerSecondSquaredProbs( ::capnp::List::Reader value); + inline void setBrake4MetersPerSecondSquaredProbs(::kj::ArrayPtr value); + inline ::capnp::List::Builder initBrake4MetersPerSecondSquaredProbs(unsigned int size); + inline void adoptBrake4MetersPerSecondSquaredProbs(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownBrake4MetersPerSecondSquaredProbs(); + + inline bool hasBrake5MetersPerSecondSquaredProbs(); + inline ::capnp::List::Builder getBrake5MetersPerSecondSquaredProbs(); + inline void setBrake5MetersPerSecondSquaredProbs( ::capnp::List::Reader value); + inline void setBrake5MetersPerSecondSquaredProbs(::kj::ArrayPtr value); + inline ::capnp::List::Builder initBrake5MetersPerSecondSquaredProbs(unsigned int size); + inline void adoptBrake5MetersPerSecondSquaredProbs(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownBrake5MetersPerSecondSquaredProbs(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ModelDataV2::DisengagePredictions::Pipeline { +public: + typedef DisengagePredictions Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class EncodeIndex::Reader { +public: + typedef EncodeIndex Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint32_t getFrameId() const; + + inline ::cereal::EncodeIndex::Type getType() const; + + inline ::uint32_t getEncodeId() const; + + inline ::int32_t getSegmentNum() const; + + inline ::uint32_t getSegmentId() const; + + inline ::uint32_t getSegmentIdEncode() const; + + inline ::uint64_t getTimestampSof() const; + + inline ::uint64_t getTimestampEof() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class EncodeIndex::Builder { +public: + typedef EncodeIndex Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint32_t getFrameId(); + inline void setFrameId( ::uint32_t value); + + inline ::cereal::EncodeIndex::Type getType(); + inline void setType( ::cereal::EncodeIndex::Type value); + + inline ::uint32_t getEncodeId(); + inline void setEncodeId( ::uint32_t value); + + inline ::int32_t getSegmentNum(); + inline void setSegmentNum( ::int32_t value); + + inline ::uint32_t getSegmentId(); + inline void setSegmentId( ::uint32_t value); + + inline ::uint32_t getSegmentIdEncode(); + inline void setSegmentIdEncode( ::uint32_t value); + + inline ::uint64_t getTimestampSof(); + inline void setTimestampSof( ::uint64_t value); + + inline ::uint64_t getTimestampEof(); + inline void setTimestampEof( ::uint64_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class EncodeIndex::Pipeline { +public: + typedef EncodeIndex Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class AndroidLogEntry::Reader { +public: + typedef AndroidLogEntry Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint8_t getId() const; + + inline ::uint64_t getTs() const; + + inline ::uint8_t getPriority() const; + + inline ::int32_t getPid() const; + + inline ::int32_t getTid() const; + + inline bool hasTag() const; + inline ::capnp::Text::Reader getTag() const; + + inline bool hasMessage() const; + inline ::capnp::Text::Reader getMessage() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class AndroidLogEntry::Builder { +public: + typedef AndroidLogEntry Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint8_t getId(); + inline void setId( ::uint8_t value); + + inline ::uint64_t getTs(); + inline void setTs( ::uint64_t value); + + inline ::uint8_t getPriority(); + inline void setPriority( ::uint8_t value); + + inline ::int32_t getPid(); + inline void setPid( ::int32_t value); + + inline ::int32_t getTid(); + inline void setTid( ::int32_t value); + + inline bool hasTag(); + inline ::capnp::Text::Builder getTag(); + inline void setTag( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initTag(unsigned int size); + inline void adoptTag(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownTag(); + + inline bool hasMessage(); + inline ::capnp::Text::Builder getMessage(); + inline void setMessage( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initMessage(unsigned int size); + inline void adoptMessage(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownMessage(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class AndroidLogEntry::Pipeline { +public: + typedef AndroidLogEntry Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LongitudinalPlan::Reader { +public: + typedef LongitudinalPlan Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getLateralValidDEPRECATED() const; + + inline bool hasDPolyDEPRECATED() const; + inline ::capnp::List::Reader getDPolyDEPRECATED() const; + + inline bool getLongitudinalValidDEPRECATED() const; + + inline float getVTargetDEPRECATED() const; + + inline float getATargetMinDEPRECATED() const; + + inline float getATargetMaxDEPRECATED() const; + + inline float getJerkFactorDEPRECATED() const; + + inline bool getHasLead() const; + + inline bool getFcw() const; + + inline ::uint64_t getModelMonoTime() const; + + inline ::uint64_t getRadarStateMonoTimeDEPRECATED() const; + + inline float getLaneWidthDEPRECATED() const; + + inline bool hasGpsTrajectoryDEPRECATED() const; + inline ::cereal::LongitudinalPlan::GpsTrajectory::Reader getGpsTrajectoryDEPRECATED() const; + + inline bool hasEventsDEPRECATED() const; + inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader getEventsDEPRECATED() const; + + inline float getVTargetFutureDEPRECATED() const; + + inline ::cereal::LongitudinalPlan::LongitudinalPlanSource getLongitudinalPlanSource() const; + + inline float getVCruiseDEPRECATED() const; + + inline float getACruiseDEPRECATED() const; + + inline float getATargetDEPRECATED() const; + + inline bool getGpsPlannerActiveDEPRECATED() const; + + inline float getVMaxDEPRECATED() const; + + inline float getVCurvatureDEPRECATED() const; + + inline bool getDecelForTurnDEPRECATED() const; + + inline bool getHasLeftLaneDEPRECATED() const; + + inline bool getHasRightLaneDEPRECATED() const; + + inline bool getMapValidDEPRECATED() const; + + inline float getVStartDEPRECATED() const; + + inline float getAStartDEPRECATED() const; + + inline bool getRadarValidDEPRECATED() const; + + inline float getProcessingDelay() const; + + inline bool getRadarCanErrorDEPRECATED() const; + + inline bool getCommIssueDEPRECATED() const; + + inline bool hasAccels() const; + inline ::capnp::List::Reader getAccels() const; + + inline bool hasSpeeds() const; + inline ::capnp::List::Reader getSpeeds() const; + + inline bool hasJerks() const; + inline ::capnp::List::Reader getJerks() const; + + inline float getSolverExecutionTime() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LongitudinalPlan::Builder { +public: + typedef LongitudinalPlan Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getLateralValidDEPRECATED(); + inline void setLateralValidDEPRECATED(bool value); + + inline bool hasDPolyDEPRECATED(); + inline ::capnp::List::Builder getDPolyDEPRECATED(); + inline void setDPolyDEPRECATED( ::capnp::List::Reader value); + inline void setDPolyDEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initDPolyDEPRECATED(unsigned int size); + inline void adoptDPolyDEPRECATED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownDPolyDEPRECATED(); + + inline bool getLongitudinalValidDEPRECATED(); + inline void setLongitudinalValidDEPRECATED(bool value); + + inline float getVTargetDEPRECATED(); + inline void setVTargetDEPRECATED(float value); + + inline float getATargetMinDEPRECATED(); + inline void setATargetMinDEPRECATED(float value); + + inline float getATargetMaxDEPRECATED(); + inline void setATargetMaxDEPRECATED(float value); + + inline float getJerkFactorDEPRECATED(); + inline void setJerkFactorDEPRECATED(float value); + + inline bool getHasLead(); + inline void setHasLead(bool value); + + inline bool getFcw(); + inline void setFcw(bool value); + + inline ::uint64_t getModelMonoTime(); + inline void setModelMonoTime( ::uint64_t value); + + inline ::uint64_t getRadarStateMonoTimeDEPRECATED(); + inline void setRadarStateMonoTimeDEPRECATED( ::uint64_t value); + + inline float getLaneWidthDEPRECATED(); + inline void setLaneWidthDEPRECATED(float value); + + inline bool hasGpsTrajectoryDEPRECATED(); + inline ::cereal::LongitudinalPlan::GpsTrajectory::Builder getGpsTrajectoryDEPRECATED(); + inline void setGpsTrajectoryDEPRECATED( ::cereal::LongitudinalPlan::GpsTrajectory::Reader value); + inline ::cereal::LongitudinalPlan::GpsTrajectory::Builder initGpsTrajectoryDEPRECATED(); + inline void adoptGpsTrajectoryDEPRECATED(::capnp::Orphan< ::cereal::LongitudinalPlan::GpsTrajectory>&& value); + inline ::capnp::Orphan< ::cereal::LongitudinalPlan::GpsTrajectory> disownGpsTrajectoryDEPRECATED(); + + inline bool hasEventsDEPRECATED(); + inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder getEventsDEPRECATED(); + inline void setEventsDEPRECATED( ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder initEventsDEPRECATED(unsigned int size); + inline void adoptEventsDEPRECATED(::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>> disownEventsDEPRECATED(); + + inline float getVTargetFutureDEPRECATED(); + inline void setVTargetFutureDEPRECATED(float value); + + inline ::cereal::LongitudinalPlan::LongitudinalPlanSource getLongitudinalPlanSource(); + inline void setLongitudinalPlanSource( ::cereal::LongitudinalPlan::LongitudinalPlanSource value); + + inline float getVCruiseDEPRECATED(); + inline void setVCruiseDEPRECATED(float value); + + inline float getACruiseDEPRECATED(); + inline void setACruiseDEPRECATED(float value); + + inline float getATargetDEPRECATED(); + inline void setATargetDEPRECATED(float value); + + inline bool getGpsPlannerActiveDEPRECATED(); + inline void setGpsPlannerActiveDEPRECATED(bool value); + + inline float getVMaxDEPRECATED(); + inline void setVMaxDEPRECATED(float value); + + inline float getVCurvatureDEPRECATED(); + inline void setVCurvatureDEPRECATED(float value); + + inline bool getDecelForTurnDEPRECATED(); + inline void setDecelForTurnDEPRECATED(bool value); + + inline bool getHasLeftLaneDEPRECATED(); + inline void setHasLeftLaneDEPRECATED(bool value); + + inline bool getHasRightLaneDEPRECATED(); + inline void setHasRightLaneDEPRECATED(bool value); + + inline bool getMapValidDEPRECATED(); + inline void setMapValidDEPRECATED(bool value); + + inline float getVStartDEPRECATED(); + inline void setVStartDEPRECATED(float value); + + inline float getAStartDEPRECATED(); + inline void setAStartDEPRECATED(float value); + + inline bool getRadarValidDEPRECATED(); + inline void setRadarValidDEPRECATED(bool value); + + inline float getProcessingDelay(); + inline void setProcessingDelay(float value); + + inline bool getRadarCanErrorDEPRECATED(); + inline void setRadarCanErrorDEPRECATED(bool value); + + inline bool getCommIssueDEPRECATED(); + inline void setCommIssueDEPRECATED(bool value); + + inline bool hasAccels(); + inline ::capnp::List::Builder getAccels(); + inline void setAccels( ::capnp::List::Reader value); + inline void setAccels(::kj::ArrayPtr value); + inline ::capnp::List::Builder initAccels(unsigned int size); + inline void adoptAccels(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownAccels(); + + inline bool hasSpeeds(); + inline ::capnp::List::Builder getSpeeds(); + inline void setSpeeds( ::capnp::List::Reader value); + inline void setSpeeds(::kj::ArrayPtr value); + inline ::capnp::List::Builder initSpeeds(unsigned int size); + inline void adoptSpeeds(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownSpeeds(); + + inline bool hasJerks(); + inline ::capnp::List::Builder getJerks(); + inline void setJerks( ::capnp::List::Reader value); + inline void setJerks(::kj::ArrayPtr value); + inline ::capnp::List::Builder initJerks(unsigned int size); + inline void adoptJerks(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownJerks(); + + inline float getSolverExecutionTime(); + inline void setSolverExecutionTime(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LongitudinalPlan::Pipeline { +public: + typedef LongitudinalPlan Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::LongitudinalPlan::GpsTrajectory::Pipeline getGpsTrajectoryDEPRECATED(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LongitudinalPlan::GpsTrajectory::Reader { +public: + typedef GpsTrajectory Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasX() const; + inline ::capnp::List::Reader getX() const; + + inline bool hasY() const; + inline ::capnp::List::Reader getY() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LongitudinalPlan::GpsTrajectory::Builder { +public: + typedef GpsTrajectory Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasX(); + inline ::capnp::List::Builder getX(); + inline void setX( ::capnp::List::Reader value); + inline void setX(::kj::ArrayPtr value); + inline ::capnp::List::Builder initX(unsigned int size); + inline void adoptX(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownX(); + + inline bool hasY(); + inline ::capnp::List::Builder getY(); + inline void setY( ::capnp::List::Reader value); + inline void setY(::kj::ArrayPtr value); + inline ::capnp::List::Builder initY(unsigned int size); + inline void adoptY(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownY(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LongitudinalPlan::GpsTrajectory::Pipeline { +public: + typedef GpsTrajectory Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LateralPlan::Reader { +public: + typedef LateralPlan Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline float getLaneWidth() const; + + inline bool hasDPolyDEPRECATED() const; + inline ::capnp::List::Reader getDPolyDEPRECATED() const; + + inline bool hasCPolyDEPRECATED() const; + inline ::capnp::List::Reader getCPolyDEPRECATED() const; + + inline float getCProbDEPRECATED() const; + + inline bool hasLPolyDEPRECATED() const; + inline ::capnp::List::Reader getLPolyDEPRECATED() const; + + inline float getLProb() const; + + inline bool hasRPolyDEPRECATED() const; + inline ::capnp::List::Reader getRPolyDEPRECATED() const; + + inline float getRProb() const; + + inline float getSteeringAngleDegDEPRECATED() const; + + inline bool getMpcSolutionValid() const; + + inline bool getParamsValidDEPRECATED() const; + + inline float getAngleOffsetDegDEPRECATED() const; + + inline bool getModelValidDEPRECATED() const; + + inline float getSteeringRateDegDEPRECATED() const; + + inline bool getSensorValidDEPRECATED() const; + + inline bool getCommIssueDEPRECATED() const; + + inline bool getPosenetValidDEPRECATED() const; + + inline ::cereal::LateralPlan::Desire getDesire() const; + + inline ::cereal::LateralPlan::LaneChangeState getLaneChangeState() const; + + inline ::cereal::LateralPlan::LaneChangeDirection getLaneChangeDirection() const; + + inline bool hasDPathPoints() const; + inline ::capnp::List::Reader getDPathPoints() const; + + inline float getDProb() const; + + inline float getCurvatureDEPRECATED() const; + + inline float getCurvatureRateDEPRECATED() const; + + inline float getRawCurvatureDEPRECATED() const; + + inline float getRawCurvatureRateDEPRECATED() const; + + inline bool hasPsis() const; + inline ::capnp::List::Reader getPsis() const; + + inline bool hasCurvatures() const; + inline ::capnp::List::Reader getCurvatures() const; + + inline bool hasCurvatureRates() const; + inline ::capnp::List::Reader getCurvatureRates() const; + + inline bool getUseLaneLines() const; + + inline float getSolverExecutionTime() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LateralPlan::Builder { +public: + typedef LateralPlan Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline float getLaneWidth(); + inline void setLaneWidth(float value); + + inline bool hasDPolyDEPRECATED(); + inline ::capnp::List::Builder getDPolyDEPRECATED(); + inline void setDPolyDEPRECATED( ::capnp::List::Reader value); + inline void setDPolyDEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initDPolyDEPRECATED(unsigned int size); + inline void adoptDPolyDEPRECATED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownDPolyDEPRECATED(); + + inline bool hasCPolyDEPRECATED(); + inline ::capnp::List::Builder getCPolyDEPRECATED(); + inline void setCPolyDEPRECATED( ::capnp::List::Reader value); + inline void setCPolyDEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initCPolyDEPRECATED(unsigned int size); + inline void adoptCPolyDEPRECATED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownCPolyDEPRECATED(); + + inline float getCProbDEPRECATED(); + inline void setCProbDEPRECATED(float value); + + inline bool hasLPolyDEPRECATED(); + inline ::capnp::List::Builder getLPolyDEPRECATED(); + inline void setLPolyDEPRECATED( ::capnp::List::Reader value); + inline void setLPolyDEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initLPolyDEPRECATED(unsigned int size); + inline void adoptLPolyDEPRECATED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownLPolyDEPRECATED(); + + inline float getLProb(); + inline void setLProb(float value); + + inline bool hasRPolyDEPRECATED(); + inline ::capnp::List::Builder getRPolyDEPRECATED(); + inline void setRPolyDEPRECATED( ::capnp::List::Reader value); + inline void setRPolyDEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initRPolyDEPRECATED(unsigned int size); + inline void adoptRPolyDEPRECATED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownRPolyDEPRECATED(); + + inline float getRProb(); + inline void setRProb(float value); + + inline float getSteeringAngleDegDEPRECATED(); + inline void setSteeringAngleDegDEPRECATED(float value); + + inline bool getMpcSolutionValid(); + inline void setMpcSolutionValid(bool value); + + inline bool getParamsValidDEPRECATED(); + inline void setParamsValidDEPRECATED(bool value); + + inline float getAngleOffsetDegDEPRECATED(); + inline void setAngleOffsetDegDEPRECATED(float value); + + inline bool getModelValidDEPRECATED(); + inline void setModelValidDEPRECATED(bool value); + + inline float getSteeringRateDegDEPRECATED(); + inline void setSteeringRateDegDEPRECATED(float value); + + inline bool getSensorValidDEPRECATED(); + inline void setSensorValidDEPRECATED(bool value); + + inline bool getCommIssueDEPRECATED(); + inline void setCommIssueDEPRECATED(bool value); + + inline bool getPosenetValidDEPRECATED(); + inline void setPosenetValidDEPRECATED(bool value); + + inline ::cereal::LateralPlan::Desire getDesire(); + inline void setDesire( ::cereal::LateralPlan::Desire value); + + inline ::cereal::LateralPlan::LaneChangeState getLaneChangeState(); + inline void setLaneChangeState( ::cereal::LateralPlan::LaneChangeState value); + + inline ::cereal::LateralPlan::LaneChangeDirection getLaneChangeDirection(); + inline void setLaneChangeDirection( ::cereal::LateralPlan::LaneChangeDirection value); + + inline bool hasDPathPoints(); + inline ::capnp::List::Builder getDPathPoints(); + inline void setDPathPoints( ::capnp::List::Reader value); + inline void setDPathPoints(::kj::ArrayPtr value); + inline ::capnp::List::Builder initDPathPoints(unsigned int size); + inline void adoptDPathPoints(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownDPathPoints(); + + inline float getDProb(); + inline void setDProb(float value); + + inline float getCurvatureDEPRECATED(); + inline void setCurvatureDEPRECATED(float value); + + inline float getCurvatureRateDEPRECATED(); + inline void setCurvatureRateDEPRECATED(float value); + + inline float getRawCurvatureDEPRECATED(); + inline void setRawCurvatureDEPRECATED(float value); + + inline float getRawCurvatureRateDEPRECATED(); + inline void setRawCurvatureRateDEPRECATED(float value); + + inline bool hasPsis(); + inline ::capnp::List::Builder getPsis(); + inline void setPsis( ::capnp::List::Reader value); + inline void setPsis(::kj::ArrayPtr value); + inline ::capnp::List::Builder initPsis(unsigned int size); + inline void adoptPsis(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownPsis(); + + inline bool hasCurvatures(); + inline ::capnp::List::Builder getCurvatures(); + inline void setCurvatures( ::capnp::List::Reader value); + inline void setCurvatures(::kj::ArrayPtr value); + inline ::capnp::List::Builder initCurvatures(unsigned int size); + inline void adoptCurvatures(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownCurvatures(); + + inline bool hasCurvatureRates(); + inline ::capnp::List::Builder getCurvatureRates(); + inline void setCurvatureRates( ::capnp::List::Reader value); + inline void setCurvatureRates(::kj::ArrayPtr value); + inline ::capnp::List::Builder initCurvatureRates(unsigned int size); + inline void adoptCurvatureRates(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownCurvatureRates(); + + inline bool getUseLaneLines(); + inline void setUseLaneLines(bool value); + + inline float getSolverExecutionTime(); + inline void setSolverExecutionTime(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LateralPlan::Pipeline { +public: + typedef LateralPlan Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LiveLocationKalman::Reader { +public: + typedef LiveLocationKalman Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasPositionECEF() const; + inline ::cereal::LiveLocationKalman::Measurement::Reader getPositionECEF() const; + + inline bool hasPositionGeodetic() const; + inline ::cereal::LiveLocationKalman::Measurement::Reader getPositionGeodetic() const; + + inline bool hasVelocityECEF() const; + inline ::cereal::LiveLocationKalman::Measurement::Reader getVelocityECEF() const; + + inline bool hasVelocityNED() const; + inline ::cereal::LiveLocationKalman::Measurement::Reader getVelocityNED() const; + + inline bool hasVelocityDevice() const; + inline ::cereal::LiveLocationKalman::Measurement::Reader getVelocityDevice() const; + + inline bool hasAccelerationDevice() const; + inline ::cereal::LiveLocationKalman::Measurement::Reader getAccelerationDevice() const; + + inline bool hasOrientationECEF() const; + inline ::cereal::LiveLocationKalman::Measurement::Reader getOrientationECEF() const; + + inline bool hasOrientationNED() const; + inline ::cereal::LiveLocationKalman::Measurement::Reader getOrientationNED() const; + + inline bool hasAngularVelocityDevice() const; + inline ::cereal::LiveLocationKalman::Measurement::Reader getAngularVelocityDevice() const; + + inline bool hasCalibratedOrientationNED() const; + inline ::cereal::LiveLocationKalman::Measurement::Reader getCalibratedOrientationNED() const; + + inline bool hasVelocityCalibrated() const; + inline ::cereal::LiveLocationKalman::Measurement::Reader getVelocityCalibrated() const; + + inline bool hasAccelerationCalibrated() const; + inline ::cereal::LiveLocationKalman::Measurement::Reader getAccelerationCalibrated() const; + + inline bool hasAngularVelocityCalibrated() const; + inline ::cereal::LiveLocationKalman::Measurement::Reader getAngularVelocityCalibrated() const; + + inline ::int32_t getGpsWeek() const; + + inline double getGpsTimeOfWeek() const; + + inline ::cereal::LiveLocationKalman::Status getStatus() const; + + inline ::int64_t getUnixTimestampMillis() const; + + inline bool getInputsOK() const; + + inline bool getPosenetOK() const; + + inline bool getGpsOK() const; + + inline bool hasCalibratedOrientationECEF() const; + inline ::cereal::LiveLocationKalman::Measurement::Reader getCalibratedOrientationECEF() const; + + inline bool getSensorsOK() const; + + inline bool getDeviceStable() const; + + inline double getTimeSinceReset() const; + + inline bool getExcessiveResets() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LiveLocationKalman::Builder { +public: + typedef LiveLocationKalman Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasPositionECEF(); + inline ::cereal::LiveLocationKalman::Measurement::Builder getPositionECEF(); + inline void setPositionECEF( ::cereal::LiveLocationKalman::Measurement::Reader value); + inline ::cereal::LiveLocationKalman::Measurement::Builder initPositionECEF(); + inline void adoptPositionECEF(::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> disownPositionECEF(); + + inline bool hasPositionGeodetic(); + inline ::cereal::LiveLocationKalman::Measurement::Builder getPositionGeodetic(); + inline void setPositionGeodetic( ::cereal::LiveLocationKalman::Measurement::Reader value); + inline ::cereal::LiveLocationKalman::Measurement::Builder initPositionGeodetic(); + inline void adoptPositionGeodetic(::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> disownPositionGeodetic(); + + inline bool hasVelocityECEF(); + inline ::cereal::LiveLocationKalman::Measurement::Builder getVelocityECEF(); + inline void setVelocityECEF( ::cereal::LiveLocationKalman::Measurement::Reader value); + inline ::cereal::LiveLocationKalman::Measurement::Builder initVelocityECEF(); + inline void adoptVelocityECEF(::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> disownVelocityECEF(); + + inline bool hasVelocityNED(); + inline ::cereal::LiveLocationKalman::Measurement::Builder getVelocityNED(); + inline void setVelocityNED( ::cereal::LiveLocationKalman::Measurement::Reader value); + inline ::cereal::LiveLocationKalman::Measurement::Builder initVelocityNED(); + inline void adoptVelocityNED(::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> disownVelocityNED(); + + inline bool hasVelocityDevice(); + inline ::cereal::LiveLocationKalman::Measurement::Builder getVelocityDevice(); + inline void setVelocityDevice( ::cereal::LiveLocationKalman::Measurement::Reader value); + inline ::cereal::LiveLocationKalman::Measurement::Builder initVelocityDevice(); + inline void adoptVelocityDevice(::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> disownVelocityDevice(); + + inline bool hasAccelerationDevice(); + inline ::cereal::LiveLocationKalman::Measurement::Builder getAccelerationDevice(); + inline void setAccelerationDevice( ::cereal::LiveLocationKalman::Measurement::Reader value); + inline ::cereal::LiveLocationKalman::Measurement::Builder initAccelerationDevice(); + inline void adoptAccelerationDevice(::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> disownAccelerationDevice(); + + inline bool hasOrientationECEF(); + inline ::cereal::LiveLocationKalman::Measurement::Builder getOrientationECEF(); + inline void setOrientationECEF( ::cereal::LiveLocationKalman::Measurement::Reader value); + inline ::cereal::LiveLocationKalman::Measurement::Builder initOrientationECEF(); + inline void adoptOrientationECEF(::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> disownOrientationECEF(); + + inline bool hasOrientationNED(); + inline ::cereal::LiveLocationKalman::Measurement::Builder getOrientationNED(); + inline void setOrientationNED( ::cereal::LiveLocationKalman::Measurement::Reader value); + inline ::cereal::LiveLocationKalman::Measurement::Builder initOrientationNED(); + inline void adoptOrientationNED(::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> disownOrientationNED(); + + inline bool hasAngularVelocityDevice(); + inline ::cereal::LiveLocationKalman::Measurement::Builder getAngularVelocityDevice(); + inline void setAngularVelocityDevice( ::cereal::LiveLocationKalman::Measurement::Reader value); + inline ::cereal::LiveLocationKalman::Measurement::Builder initAngularVelocityDevice(); + inline void adoptAngularVelocityDevice(::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> disownAngularVelocityDevice(); + + inline bool hasCalibratedOrientationNED(); + inline ::cereal::LiveLocationKalman::Measurement::Builder getCalibratedOrientationNED(); + inline void setCalibratedOrientationNED( ::cereal::LiveLocationKalman::Measurement::Reader value); + inline ::cereal::LiveLocationKalman::Measurement::Builder initCalibratedOrientationNED(); + inline void adoptCalibratedOrientationNED(::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> disownCalibratedOrientationNED(); + + inline bool hasVelocityCalibrated(); + inline ::cereal::LiveLocationKalman::Measurement::Builder getVelocityCalibrated(); + inline void setVelocityCalibrated( ::cereal::LiveLocationKalman::Measurement::Reader value); + inline ::cereal::LiveLocationKalman::Measurement::Builder initVelocityCalibrated(); + inline void adoptVelocityCalibrated(::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> disownVelocityCalibrated(); + + inline bool hasAccelerationCalibrated(); + inline ::cereal::LiveLocationKalman::Measurement::Builder getAccelerationCalibrated(); + inline void setAccelerationCalibrated( ::cereal::LiveLocationKalman::Measurement::Reader value); + inline ::cereal::LiveLocationKalman::Measurement::Builder initAccelerationCalibrated(); + inline void adoptAccelerationCalibrated(::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> disownAccelerationCalibrated(); + + inline bool hasAngularVelocityCalibrated(); + inline ::cereal::LiveLocationKalman::Measurement::Builder getAngularVelocityCalibrated(); + inline void setAngularVelocityCalibrated( ::cereal::LiveLocationKalman::Measurement::Reader value); + inline ::cereal::LiveLocationKalman::Measurement::Builder initAngularVelocityCalibrated(); + inline void adoptAngularVelocityCalibrated(::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> disownAngularVelocityCalibrated(); + + inline ::int32_t getGpsWeek(); + inline void setGpsWeek( ::int32_t value); + + inline double getGpsTimeOfWeek(); + inline void setGpsTimeOfWeek(double value); + + inline ::cereal::LiveLocationKalman::Status getStatus(); + inline void setStatus( ::cereal::LiveLocationKalman::Status value); + + inline ::int64_t getUnixTimestampMillis(); + inline void setUnixTimestampMillis( ::int64_t value); + + inline bool getInputsOK(); + inline void setInputsOK(bool value); + + inline bool getPosenetOK(); + inline void setPosenetOK(bool value); + + inline bool getGpsOK(); + inline void setGpsOK(bool value); + + inline bool hasCalibratedOrientationECEF(); + inline ::cereal::LiveLocationKalman::Measurement::Builder getCalibratedOrientationECEF(); + inline void setCalibratedOrientationECEF( ::cereal::LiveLocationKalman::Measurement::Reader value); + inline ::cereal::LiveLocationKalman::Measurement::Builder initCalibratedOrientationECEF(); + inline void adoptCalibratedOrientationECEF(::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> disownCalibratedOrientationECEF(); + + inline bool getSensorsOK(); + inline void setSensorsOK(bool value); + + inline bool getDeviceStable(); + inline void setDeviceStable(bool value); + + inline double getTimeSinceReset(); + inline void setTimeSinceReset(double value); + + inline bool getExcessiveResets(); + inline void setExcessiveResets(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LiveLocationKalman::Pipeline { +public: + typedef LiveLocationKalman Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::LiveLocationKalman::Measurement::Pipeline getPositionECEF(); + inline ::cereal::LiveLocationKalman::Measurement::Pipeline getPositionGeodetic(); + inline ::cereal::LiveLocationKalman::Measurement::Pipeline getVelocityECEF(); + inline ::cereal::LiveLocationKalman::Measurement::Pipeline getVelocityNED(); + inline ::cereal::LiveLocationKalman::Measurement::Pipeline getVelocityDevice(); + inline ::cereal::LiveLocationKalman::Measurement::Pipeline getAccelerationDevice(); + inline ::cereal::LiveLocationKalman::Measurement::Pipeline getOrientationECEF(); + inline ::cereal::LiveLocationKalman::Measurement::Pipeline getOrientationNED(); + inline ::cereal::LiveLocationKalman::Measurement::Pipeline getAngularVelocityDevice(); + inline ::cereal::LiveLocationKalman::Measurement::Pipeline getCalibratedOrientationNED(); + inline ::cereal::LiveLocationKalman::Measurement::Pipeline getVelocityCalibrated(); + inline ::cereal::LiveLocationKalman::Measurement::Pipeline getAccelerationCalibrated(); + inline ::cereal::LiveLocationKalman::Measurement::Pipeline getAngularVelocityCalibrated(); + inline ::cereal::LiveLocationKalman::Measurement::Pipeline getCalibratedOrientationECEF(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LiveLocationKalman::Measurement::Reader { +public: + typedef Measurement Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasValue() const; + inline ::capnp::List::Reader getValue() const; + + inline bool hasStd() const; + inline ::capnp::List::Reader getStd() const; + + inline bool getValid() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LiveLocationKalman::Measurement::Builder { +public: + typedef Measurement Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasValue(); + inline ::capnp::List::Builder getValue(); + inline void setValue( ::capnp::List::Reader value); + inline void setValue(::kj::ArrayPtr value); + inline ::capnp::List::Builder initValue(unsigned int size); + inline void adoptValue(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownValue(); + + inline bool hasStd(); + inline ::capnp::List::Builder getStd(); + inline void setStd( ::capnp::List::Reader value); + inline void setStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initStd(unsigned int size); + inline void adoptStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownStd(); + + inline bool getValid(); + inline void setValid(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LiveLocationKalman::Measurement::Pipeline { +public: + typedef Measurement Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ProcLog::Reader { +public: + typedef ProcLog Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasCpuTimes() const; + inline ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>::Reader getCpuTimes() const; + + inline bool hasMem() const; + inline ::cereal::ProcLog::Mem::Reader getMem() const; + + inline bool hasProcs() const; + inline ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>::Reader getProcs() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ProcLog::Builder { +public: + typedef ProcLog Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasCpuTimes(); + inline ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>::Builder getCpuTimes(); + inline void setCpuTimes( ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>::Builder initCpuTimes(unsigned int size); + inline void adoptCpuTimes(::capnp::Orphan< ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>> disownCpuTimes(); + + inline bool hasMem(); + inline ::cereal::ProcLog::Mem::Builder getMem(); + inline void setMem( ::cereal::ProcLog::Mem::Reader value); + inline ::cereal::ProcLog::Mem::Builder initMem(); + inline void adoptMem(::capnp::Orphan< ::cereal::ProcLog::Mem>&& value); + inline ::capnp::Orphan< ::cereal::ProcLog::Mem> disownMem(); + + inline bool hasProcs(); + inline ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>::Builder getProcs(); + inline void setProcs( ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>::Builder initProcs(unsigned int size); + inline void adoptProcs(::capnp::Orphan< ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>> disownProcs(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ProcLog::Pipeline { +public: + typedef ProcLog Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::ProcLog::Mem::Pipeline getMem(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ProcLog::Process::Reader { +public: + typedef Process Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::int32_t getPid() const; + + inline bool hasName() const; + inline ::capnp::Text::Reader getName() const; + + inline ::uint8_t getState() const; + + inline ::int32_t getPpid() const; + + inline float getCpuUser() const; + + inline float getCpuSystem() const; + + inline float getCpuChildrenUser() const; + + inline float getCpuChildrenSystem() const; + + inline ::int64_t getPriority() const; + + inline ::int32_t getNice() const; + + inline ::int32_t getNumThreads() const; + + inline double getStartTime() const; + + inline ::uint64_t getMemVms() const; + + inline ::uint64_t getMemRss() const; + + inline ::int32_t getProcessor() const; + + inline bool hasCmdline() const; + inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Reader getCmdline() const; + + inline bool hasExe() const; + inline ::capnp::Text::Reader getExe() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ProcLog::Process::Builder { +public: + typedef Process Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::int32_t getPid(); + inline void setPid( ::int32_t value); + + inline bool hasName(); + inline ::capnp::Text::Builder getName(); + inline void setName( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initName(unsigned int size); + inline void adoptName(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownName(); + + inline ::uint8_t getState(); + inline void setState( ::uint8_t value); + + inline ::int32_t getPpid(); + inline void setPpid( ::int32_t value); + + inline float getCpuUser(); + inline void setCpuUser(float value); + + inline float getCpuSystem(); + inline void setCpuSystem(float value); + + inline float getCpuChildrenUser(); + inline void setCpuChildrenUser(float value); + + inline float getCpuChildrenSystem(); + inline void setCpuChildrenSystem(float value); + + inline ::int64_t getPriority(); + inline void setPriority( ::int64_t value); + + inline ::int32_t getNice(); + inline void setNice( ::int32_t value); + + inline ::int32_t getNumThreads(); + inline void setNumThreads( ::int32_t value); + + inline double getStartTime(); + inline void setStartTime(double value); + + inline ::uint64_t getMemVms(); + inline void setMemVms( ::uint64_t value); + + inline ::uint64_t getMemRss(); + inline void setMemRss( ::uint64_t value); + + inline ::int32_t getProcessor(); + inline void setProcessor( ::int32_t value); + + inline bool hasCmdline(); + inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Builder getCmdline(); + inline void setCmdline( ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Reader value); + inline void setCmdline(::kj::ArrayPtr value); + inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Builder initCmdline(unsigned int size); + inline void adoptCmdline(::capnp::Orphan< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>> disownCmdline(); + + inline bool hasExe(); + inline ::capnp::Text::Builder getExe(); + inline void setExe( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initExe(unsigned int size); + inline void adoptExe(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownExe(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ProcLog::Process::Pipeline { +public: + typedef Process Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ProcLog::CPUTimes::Reader { +public: + typedef CPUTimes Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::int64_t getCpuNum() const; + + inline float getUser() const; + + inline float getNice() const; + + inline float getSystem() const; + + inline float getIdle() const; + + inline float getIowait() const; + + inline float getIrq() const; + + inline float getSoftirq() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ProcLog::CPUTimes::Builder { +public: + typedef CPUTimes Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::int64_t getCpuNum(); + inline void setCpuNum( ::int64_t value); + + inline float getUser(); + inline void setUser(float value); + + inline float getNice(); + inline void setNice(float value); + + inline float getSystem(); + inline void setSystem(float value); + + inline float getIdle(); + inline void setIdle(float value); + + inline float getIowait(); + inline void setIowait(float value); + + inline float getIrq(); + inline void setIrq(float value); + + inline float getSoftirq(); + inline void setSoftirq(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ProcLog::CPUTimes::Pipeline { +public: + typedef CPUTimes Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ProcLog::Mem::Reader { +public: + typedef Mem Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint64_t getTotal() const; + + inline ::uint64_t getFree() const; + + inline ::uint64_t getAvailable() const; + + inline ::uint64_t getBuffers() const; + + inline ::uint64_t getCached() const; + + inline ::uint64_t getActive() const; + + inline ::uint64_t getInactive() const; + + inline ::uint64_t getShared() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ProcLog::Mem::Builder { +public: + typedef Mem Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint64_t getTotal(); + inline void setTotal( ::uint64_t value); + + inline ::uint64_t getFree(); + inline void setFree( ::uint64_t value); + + inline ::uint64_t getAvailable(); + inline void setAvailable( ::uint64_t value); + + inline ::uint64_t getBuffers(); + inline void setBuffers( ::uint64_t value); + + inline ::uint64_t getCached(); + inline void setCached( ::uint64_t value); + + inline ::uint64_t getActive(); + inline void setActive( ::uint64_t value); + + inline ::uint64_t getInactive(); + inline void setInactive( ::uint64_t value); + + inline ::uint64_t getShared(); + inline void setShared( ::uint64_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ProcLog::Mem::Pipeline { +public: + typedef Mem Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class UbloxGnss::Reader { +public: + typedef UbloxGnss Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline Which which() const; + inline bool isMeasurementReport() const; + inline bool hasMeasurementReport() const; + inline ::cereal::UbloxGnss::MeasurementReport::Reader getMeasurementReport() const; + + inline bool isEphemeris() const; + inline bool hasEphemeris() const; + inline ::cereal::UbloxGnss::Ephemeris::Reader getEphemeris() const; + + inline bool isIonoData() const; + inline bool hasIonoData() const; + inline ::cereal::UbloxGnss::IonoData::Reader getIonoData() const; + + inline bool isHwStatus() const; + inline bool hasHwStatus() const; + inline ::cereal::UbloxGnss::HwStatus::Reader getHwStatus() const; + + inline bool isHwStatus2() const; + inline bool hasHwStatus2() const; + inline ::cereal::UbloxGnss::HwStatus2::Reader getHwStatus2() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class UbloxGnss::Builder { +public: + typedef UbloxGnss Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline Which which(); + inline bool isMeasurementReport(); + inline bool hasMeasurementReport(); + inline ::cereal::UbloxGnss::MeasurementReport::Builder getMeasurementReport(); + inline void setMeasurementReport( ::cereal::UbloxGnss::MeasurementReport::Reader value); + inline ::cereal::UbloxGnss::MeasurementReport::Builder initMeasurementReport(); + inline void adoptMeasurementReport(::capnp::Orphan< ::cereal::UbloxGnss::MeasurementReport>&& value); + inline ::capnp::Orphan< ::cereal::UbloxGnss::MeasurementReport> disownMeasurementReport(); + + inline bool isEphemeris(); + inline bool hasEphemeris(); + inline ::cereal::UbloxGnss::Ephemeris::Builder getEphemeris(); + inline void setEphemeris( ::cereal::UbloxGnss::Ephemeris::Reader value); + inline ::cereal::UbloxGnss::Ephemeris::Builder initEphemeris(); + inline void adoptEphemeris(::capnp::Orphan< ::cereal::UbloxGnss::Ephemeris>&& value); + inline ::capnp::Orphan< ::cereal::UbloxGnss::Ephemeris> disownEphemeris(); + + inline bool isIonoData(); + inline bool hasIonoData(); + inline ::cereal::UbloxGnss::IonoData::Builder getIonoData(); + inline void setIonoData( ::cereal::UbloxGnss::IonoData::Reader value); + inline ::cereal::UbloxGnss::IonoData::Builder initIonoData(); + inline void adoptIonoData(::capnp::Orphan< ::cereal::UbloxGnss::IonoData>&& value); + inline ::capnp::Orphan< ::cereal::UbloxGnss::IonoData> disownIonoData(); + + inline bool isHwStatus(); + inline bool hasHwStatus(); + inline ::cereal::UbloxGnss::HwStatus::Builder getHwStatus(); + inline void setHwStatus( ::cereal::UbloxGnss::HwStatus::Reader value); + inline ::cereal::UbloxGnss::HwStatus::Builder initHwStatus(); + inline void adoptHwStatus(::capnp::Orphan< ::cereal::UbloxGnss::HwStatus>&& value); + inline ::capnp::Orphan< ::cereal::UbloxGnss::HwStatus> disownHwStatus(); + + inline bool isHwStatus2(); + inline bool hasHwStatus2(); + inline ::cereal::UbloxGnss::HwStatus2::Builder getHwStatus2(); + inline void setHwStatus2( ::cereal::UbloxGnss::HwStatus2::Reader value); + inline ::cereal::UbloxGnss::HwStatus2::Builder initHwStatus2(); + inline void adoptHwStatus2(::capnp::Orphan< ::cereal::UbloxGnss::HwStatus2>&& value); + inline ::capnp::Orphan< ::cereal::UbloxGnss::HwStatus2> disownHwStatus2(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class UbloxGnss::Pipeline { +public: + typedef UbloxGnss Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class UbloxGnss::MeasurementReport::Reader { +public: + typedef MeasurementReport Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline double getRcvTow() const; + + inline ::uint16_t getGpsWeek() const; + + inline ::uint16_t getLeapSeconds() const; + + inline bool hasReceiverStatus() const; + inline ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus::Reader getReceiverStatus() const; + + inline ::uint8_t getNumMeas() const; + + inline bool hasMeasurements() const; + inline ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>::Reader getMeasurements() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class UbloxGnss::MeasurementReport::Builder { +public: + typedef MeasurementReport Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline double getRcvTow(); + inline void setRcvTow(double value); + + inline ::uint16_t getGpsWeek(); + inline void setGpsWeek( ::uint16_t value); + + inline ::uint16_t getLeapSeconds(); + inline void setLeapSeconds( ::uint16_t value); + + inline bool hasReceiverStatus(); + inline ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus::Builder getReceiverStatus(); + inline void setReceiverStatus( ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus::Reader value); + inline ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus::Builder initReceiverStatus(); + inline void adoptReceiverStatus(::capnp::Orphan< ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus>&& value); + inline ::capnp::Orphan< ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus> disownReceiverStatus(); + + inline ::uint8_t getNumMeas(); + inline void setNumMeas( ::uint8_t value); + + inline bool hasMeasurements(); + inline ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>::Builder getMeasurements(); + inline void setMeasurements( ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>::Builder initMeasurements(unsigned int size); + inline void adoptMeasurements(::capnp::Orphan< ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>> disownMeasurements(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class UbloxGnss::MeasurementReport::Pipeline { +public: + typedef MeasurementReport Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus::Pipeline getReceiverStatus(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class UbloxGnss::MeasurementReport::ReceiverStatus::Reader { +public: + typedef ReceiverStatus Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getLeapSecValid() const; + + inline bool getClkReset() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class UbloxGnss::MeasurementReport::ReceiverStatus::Builder { +public: + typedef ReceiverStatus Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getLeapSecValid(); + inline void setLeapSecValid(bool value); + + inline bool getClkReset(); + inline void setClkReset(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class UbloxGnss::MeasurementReport::ReceiverStatus::Pipeline { +public: + typedef ReceiverStatus Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class UbloxGnss::MeasurementReport::Measurement::Reader { +public: + typedef Measurement Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint8_t getSvId() const; + + inline bool hasTrackingStatus() const; + inline ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Reader getTrackingStatus() const; + + inline double getPseudorange() const; + + inline double getCarrierCycles() const; + + inline float getDoppler() const; + + inline ::uint8_t getGnssId() const; + + inline ::uint8_t getGlonassFrequencyIndex() const; + + inline ::uint16_t getLocktime() const; + + inline ::uint8_t getCno() const; + + inline float getPseudorangeStdev() const; + + inline float getCarrierPhaseStdev() const; + + inline float getDopplerStdev() const; + + inline ::uint8_t getSigId() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class UbloxGnss::MeasurementReport::Measurement::Builder { +public: + typedef Measurement Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint8_t getSvId(); + inline void setSvId( ::uint8_t value); + + inline bool hasTrackingStatus(); + inline ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Builder getTrackingStatus(); + inline void setTrackingStatus( ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Reader value); + inline ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Builder initTrackingStatus(); + inline void adoptTrackingStatus(::capnp::Orphan< ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus>&& value); + inline ::capnp::Orphan< ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus> disownTrackingStatus(); + + inline double getPseudorange(); + inline void setPseudorange(double value); + + inline double getCarrierCycles(); + inline void setCarrierCycles(double value); + + inline float getDoppler(); + inline void setDoppler(float value); + + inline ::uint8_t getGnssId(); + inline void setGnssId( ::uint8_t value); + + inline ::uint8_t getGlonassFrequencyIndex(); + inline void setGlonassFrequencyIndex( ::uint8_t value); + + inline ::uint16_t getLocktime(); + inline void setLocktime( ::uint16_t value); + + inline ::uint8_t getCno(); + inline void setCno( ::uint8_t value); + + inline float getPseudorangeStdev(); + inline void setPseudorangeStdev(float value); + + inline float getCarrierPhaseStdev(); + inline void setCarrierPhaseStdev(float value); + + inline float getDopplerStdev(); + inline void setDopplerStdev(float value); + + inline ::uint8_t getSigId(); + inline void setSigId( ::uint8_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class UbloxGnss::MeasurementReport::Measurement::Pipeline { +public: + typedef Measurement Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Pipeline getTrackingStatus(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Reader { +public: + typedef TrackingStatus Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getPseudorangeValid() const; + + inline bool getCarrierPhaseValid() const; + + inline bool getHalfCycleValid() const; + + inline bool getHalfCycleSubtracted() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Builder { +public: + typedef TrackingStatus Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getPseudorangeValid(); + inline void setPseudorangeValid(bool value); + + inline bool getCarrierPhaseValid(); + inline void setCarrierPhaseValid(bool value); + + inline bool getHalfCycleValid(); + inline void setHalfCycleValid(bool value); + + inline bool getHalfCycleSubtracted(); + inline void setHalfCycleSubtracted(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Pipeline { +public: + typedef TrackingStatus Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class UbloxGnss::Ephemeris::Reader { +public: + typedef Ephemeris Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint16_t getSvId() const; + + inline ::uint16_t getYear() const; + + inline ::uint16_t getMonth() const; + + inline ::uint16_t getDay() const; + + inline ::uint16_t getHour() const; + + inline ::uint16_t getMinute() const; + + inline float getSecond() const; + + inline double getAf0() const; + + inline double getAf1() const; + + inline double getAf2() const; + + inline double getIode() const; + + inline double getCrs() const; + + inline double getDeltaN() const; + + inline double getM0() const; + + inline double getCuc() const; + + inline double getEcc() const; + + inline double getCus() const; + + inline double getA() const; + + inline double getToe() const; + + inline double getCic() const; + + inline double getOmega0() const; + + inline double getCis() const; + + inline double getI0() const; + + inline double getCrc() const; + + inline double getOmega() const; + + inline double getOmegaDot() const; + + inline double getIDot() const; + + inline double getCodesL2() const; + + inline double getGpsWeek() const; + + inline double getL2() const; + + inline double getSvAcc() const; + + inline double getSvHealth() const; + + inline double getTgd() const; + + inline double getIodc() const; + + inline double getTransmissionTime() const; + + inline double getFitInterval() const; + + inline double getToc() const; + + inline bool getIonoCoeffsValid() const; + + inline bool hasIonoAlpha() const; + inline ::capnp::List::Reader getIonoAlpha() const; + + inline bool hasIonoBeta() const; + inline ::capnp::List::Reader getIonoBeta() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class UbloxGnss::Ephemeris::Builder { +public: + typedef Ephemeris Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint16_t getSvId(); + inline void setSvId( ::uint16_t value); + + inline ::uint16_t getYear(); + inline void setYear( ::uint16_t value); + + inline ::uint16_t getMonth(); + inline void setMonth( ::uint16_t value); + + inline ::uint16_t getDay(); + inline void setDay( ::uint16_t value); + + inline ::uint16_t getHour(); + inline void setHour( ::uint16_t value); + + inline ::uint16_t getMinute(); + inline void setMinute( ::uint16_t value); + + inline float getSecond(); + inline void setSecond(float value); + + inline double getAf0(); + inline void setAf0(double value); + + inline double getAf1(); + inline void setAf1(double value); + + inline double getAf2(); + inline void setAf2(double value); + + inline double getIode(); + inline void setIode(double value); + + inline double getCrs(); + inline void setCrs(double value); + + inline double getDeltaN(); + inline void setDeltaN(double value); + + inline double getM0(); + inline void setM0(double value); + + inline double getCuc(); + inline void setCuc(double value); + + inline double getEcc(); + inline void setEcc(double value); + + inline double getCus(); + inline void setCus(double value); + + inline double getA(); + inline void setA(double value); + + inline double getToe(); + inline void setToe(double value); + + inline double getCic(); + inline void setCic(double value); + + inline double getOmega0(); + inline void setOmega0(double value); + + inline double getCis(); + inline void setCis(double value); + + inline double getI0(); + inline void setI0(double value); + + inline double getCrc(); + inline void setCrc(double value); + + inline double getOmega(); + inline void setOmega(double value); + + inline double getOmegaDot(); + inline void setOmegaDot(double value); + + inline double getIDot(); + inline void setIDot(double value); + + inline double getCodesL2(); + inline void setCodesL2(double value); + + inline double getGpsWeek(); + inline void setGpsWeek(double value); + + inline double getL2(); + inline void setL2(double value); + + inline double getSvAcc(); + inline void setSvAcc(double value); + + inline double getSvHealth(); + inline void setSvHealth(double value); + + inline double getTgd(); + inline void setTgd(double value); + + inline double getIodc(); + inline void setIodc(double value); + + inline double getTransmissionTime(); + inline void setTransmissionTime(double value); + + inline double getFitInterval(); + inline void setFitInterval(double value); + + inline double getToc(); + inline void setToc(double value); + + inline bool getIonoCoeffsValid(); + inline void setIonoCoeffsValid(bool value); + + inline bool hasIonoAlpha(); + inline ::capnp::List::Builder getIonoAlpha(); + inline void setIonoAlpha( ::capnp::List::Reader value); + inline void setIonoAlpha(::kj::ArrayPtr value); + inline ::capnp::List::Builder initIonoAlpha(unsigned int size); + inline void adoptIonoAlpha(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownIonoAlpha(); + + inline bool hasIonoBeta(); + inline ::capnp::List::Builder getIonoBeta(); + inline void setIonoBeta( ::capnp::List::Reader value); + inline void setIonoBeta(::kj::ArrayPtr value); + inline ::capnp::List::Builder initIonoBeta(unsigned int size); + inline void adoptIonoBeta(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownIonoBeta(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class UbloxGnss::Ephemeris::Pipeline { +public: + typedef Ephemeris Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class UbloxGnss::IonoData::Reader { +public: + typedef IonoData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint32_t getSvHealth() const; + + inline double getTow() const; + + inline double getGpsWeek() const; + + inline bool hasIonoAlpha() const; + inline ::capnp::List::Reader getIonoAlpha() const; + + inline bool hasIonoBeta() const; + inline ::capnp::List::Reader getIonoBeta() const; + + inline bool getHealthValid() const; + + inline bool getIonoCoeffsValid() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class UbloxGnss::IonoData::Builder { +public: + typedef IonoData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint32_t getSvHealth(); + inline void setSvHealth( ::uint32_t value); + + inline double getTow(); + inline void setTow(double value); + + inline double getGpsWeek(); + inline void setGpsWeek(double value); + + inline bool hasIonoAlpha(); + inline ::capnp::List::Builder getIonoAlpha(); + inline void setIonoAlpha( ::capnp::List::Reader value); + inline void setIonoAlpha(::kj::ArrayPtr value); + inline ::capnp::List::Builder initIonoAlpha(unsigned int size); + inline void adoptIonoAlpha(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownIonoAlpha(); + + inline bool hasIonoBeta(); + inline ::capnp::List::Builder getIonoBeta(); + inline void setIonoBeta( ::capnp::List::Reader value); + inline void setIonoBeta(::kj::ArrayPtr value); + inline ::capnp::List::Builder initIonoBeta(unsigned int size); + inline void adoptIonoBeta(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownIonoBeta(); + + inline bool getHealthValid(); + inline void setHealthValid(bool value); + + inline bool getIonoCoeffsValid(); + inline void setIonoCoeffsValid(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class UbloxGnss::IonoData::Pipeline { +public: + typedef IonoData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class UbloxGnss::HwStatus::Reader { +public: + typedef HwStatus Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint16_t getNoisePerMS() const; + + inline ::uint16_t getAgcCnt() const; + + inline ::cereal::UbloxGnss::HwStatus::AntennaSupervisorState getAStatus() const; + + inline ::cereal::UbloxGnss::HwStatus::AntennaPowerStatus getAPower() const; + + inline ::uint8_t getJamInd() const; + + inline ::uint8_t getFlags() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class UbloxGnss::HwStatus::Builder { +public: + typedef HwStatus Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint16_t getNoisePerMS(); + inline void setNoisePerMS( ::uint16_t value); + + inline ::uint16_t getAgcCnt(); + inline void setAgcCnt( ::uint16_t value); + + inline ::cereal::UbloxGnss::HwStatus::AntennaSupervisorState getAStatus(); + inline void setAStatus( ::cereal::UbloxGnss::HwStatus::AntennaSupervisorState value); + + inline ::cereal::UbloxGnss::HwStatus::AntennaPowerStatus getAPower(); + inline void setAPower( ::cereal::UbloxGnss::HwStatus::AntennaPowerStatus value); + + inline ::uint8_t getJamInd(); + inline void setJamInd( ::uint8_t value); + + inline ::uint8_t getFlags(); + inline void setFlags( ::uint8_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class UbloxGnss::HwStatus::Pipeline { +public: + typedef HwStatus Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class UbloxGnss::HwStatus2::Reader { +public: + typedef HwStatus2 Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::int8_t getOfsI() const; + + inline ::uint8_t getMagI() const; + + inline ::int8_t getOfsQ() const; + + inline ::uint8_t getMagQ() const; + + inline ::cereal::UbloxGnss::HwStatus2::ConfigSource getCfgSource() const; + + inline ::uint32_t getLowLevCfg() const; + + inline ::uint32_t getPostStatus() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class UbloxGnss::HwStatus2::Builder { +public: + typedef HwStatus2 Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::int8_t getOfsI(); + inline void setOfsI( ::int8_t value); + + inline ::uint8_t getMagI(); + inline void setMagI( ::uint8_t value); + + inline ::int8_t getOfsQ(); + inline void setOfsQ( ::int8_t value); + + inline ::uint8_t getMagQ(); + inline void setMagQ( ::uint8_t value); + + inline ::cereal::UbloxGnss::HwStatus2::ConfigSource getCfgSource(); + inline void setCfgSource( ::cereal::UbloxGnss::HwStatus2::ConfigSource value); + + inline ::uint32_t getLowLevCfg(); + inline void setLowLevCfg( ::uint32_t value); + + inline ::uint32_t getPostStatus(); + inline void setPostStatus( ::uint32_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class UbloxGnss::HwStatus2::Pipeline { +public: + typedef HwStatus2 Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class Clocks::Reader { +public: + typedef Clocks Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint64_t getBootTimeNanos() const; + + inline ::uint64_t getMonotonicNanos() const; + + inline ::uint64_t getMonotonicRawNanos() const; + + inline ::uint64_t getWallTimeNanos() const; + + inline ::uint64_t getModemUptimeMillis() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Clocks::Builder { +public: + typedef Clocks Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint64_t getBootTimeNanos(); + inline void setBootTimeNanos( ::uint64_t value); + + inline ::uint64_t getMonotonicNanos(); + inline void setMonotonicNanos( ::uint64_t value); + + inline ::uint64_t getMonotonicRawNanos(); + inline void setMonotonicRawNanos( ::uint64_t value); + + inline ::uint64_t getWallTimeNanos(); + inline void setWallTimeNanos( ::uint64_t value); + + inline ::uint64_t getModemUptimeMillis(); + inline void setModemUptimeMillis( ::uint64_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Clocks::Pipeline { +public: + typedef Clocks Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LiveMpcData::Reader { +public: + typedef LiveMpcData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasX() const; + inline ::capnp::List::Reader getX() const; + + inline bool hasY() const; + inline ::capnp::List::Reader getY() const; + + inline bool hasPsi() const; + inline ::capnp::List::Reader getPsi() const; + + inline bool hasCurvature() const; + inline ::capnp::List::Reader getCurvature() const; + + inline ::uint32_t getQpIterations() const; + + inline ::uint64_t getCalculationTime() const; + + inline double getCost() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LiveMpcData::Builder { +public: + typedef LiveMpcData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasX(); + inline ::capnp::List::Builder getX(); + inline void setX( ::capnp::List::Reader value); + inline void setX(::kj::ArrayPtr value); + inline ::capnp::List::Builder initX(unsigned int size); + inline void adoptX(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownX(); + + inline bool hasY(); + inline ::capnp::List::Builder getY(); + inline void setY( ::capnp::List::Reader value); + inline void setY(::kj::ArrayPtr value); + inline ::capnp::List::Builder initY(unsigned int size); + inline void adoptY(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownY(); + + inline bool hasPsi(); + inline ::capnp::List::Builder getPsi(); + inline void setPsi( ::capnp::List::Reader value); + inline void setPsi(::kj::ArrayPtr value); + inline ::capnp::List::Builder initPsi(unsigned int size); + inline void adoptPsi(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownPsi(); + + inline bool hasCurvature(); + inline ::capnp::List::Builder getCurvature(); + inline void setCurvature( ::capnp::List::Reader value); + inline void setCurvature(::kj::ArrayPtr value); + inline ::capnp::List::Builder initCurvature(unsigned int size); + inline void adoptCurvature(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownCurvature(); + + inline ::uint32_t getQpIterations(); + inline void setQpIterations( ::uint32_t value); + + inline ::uint64_t getCalculationTime(); + inline void setCalculationTime( ::uint64_t value); + + inline double getCost(); + inline void setCost(double value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LiveMpcData::Pipeline { +public: + typedef LiveMpcData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LiveLongitudinalMpcData::Reader { +public: + typedef LiveLongitudinalMpcData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasXEgo() const; + inline ::capnp::List::Reader getXEgo() const; + + inline bool hasVEgo() const; + inline ::capnp::List::Reader getVEgo() const; + + inline bool hasAEgo() const; + inline ::capnp::List::Reader getAEgo() const; + + inline bool hasXLead() const; + inline ::capnp::List::Reader getXLead() const; + + inline bool hasVLead() const; + inline ::capnp::List::Reader getVLead() const; + + inline bool hasALead() const; + inline ::capnp::List::Reader getALead() const; + + inline float getALeadTau() const; + + inline ::uint32_t getQpIterations() const; + + inline ::uint32_t getMpcId() const; + + inline ::uint64_t getCalculationTime() const; + + inline double getCost() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LiveLongitudinalMpcData::Builder { +public: + typedef LiveLongitudinalMpcData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasXEgo(); + inline ::capnp::List::Builder getXEgo(); + inline void setXEgo( ::capnp::List::Reader value); + inline void setXEgo(::kj::ArrayPtr value); + inline ::capnp::List::Builder initXEgo(unsigned int size); + inline void adoptXEgo(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownXEgo(); + + inline bool hasVEgo(); + inline ::capnp::List::Builder getVEgo(); + inline void setVEgo( ::capnp::List::Reader value); + inline void setVEgo(::kj::ArrayPtr value); + inline ::capnp::List::Builder initVEgo(unsigned int size); + inline void adoptVEgo(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownVEgo(); + + inline bool hasAEgo(); + inline ::capnp::List::Builder getAEgo(); + inline void setAEgo( ::capnp::List::Reader value); + inline void setAEgo(::kj::ArrayPtr value); + inline ::capnp::List::Builder initAEgo(unsigned int size); + inline void adoptAEgo(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownAEgo(); + + inline bool hasXLead(); + inline ::capnp::List::Builder getXLead(); + inline void setXLead( ::capnp::List::Reader value); + inline void setXLead(::kj::ArrayPtr value); + inline ::capnp::List::Builder initXLead(unsigned int size); + inline void adoptXLead(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownXLead(); + + inline bool hasVLead(); + inline ::capnp::List::Builder getVLead(); + inline void setVLead( ::capnp::List::Reader value); + inline void setVLead(::kj::ArrayPtr value); + inline ::capnp::List::Builder initVLead(unsigned int size); + inline void adoptVLead(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownVLead(); + + inline bool hasALead(); + inline ::capnp::List::Builder getALead(); + inline void setALead( ::capnp::List::Reader value); + inline void setALead(::kj::ArrayPtr value); + inline ::capnp::List::Builder initALead(unsigned int size); + inline void adoptALead(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownALead(); + + inline float getALeadTau(); + inline void setALeadTau(float value); + + inline ::uint32_t getQpIterations(); + inline void setQpIterations( ::uint32_t value); + + inline ::uint32_t getMpcId(); + inline void setMpcId( ::uint32_t value); + + inline ::uint64_t getCalculationTime(); + inline void setCalculationTime( ::uint64_t value); + + inline double getCost(); + inline void setCost(double value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LiveLongitudinalMpcData::Pipeline { +public: + typedef LiveLongitudinalMpcData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class Joystick::Reader { +public: + typedef Joystick Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasAxes() const; + inline ::capnp::List::Reader getAxes() const; + + inline bool hasButtons() const; + inline ::capnp::List::Reader getButtons() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Joystick::Builder { +public: + typedef Joystick Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasAxes(); + inline ::capnp::List::Builder getAxes(); + inline void setAxes( ::capnp::List::Reader value); + inline void setAxes(::kj::ArrayPtr value); + inline ::capnp::List::Builder initAxes(unsigned int size); + inline void adoptAxes(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownAxes(); + + inline bool hasButtons(); + inline ::capnp::List::Builder getButtons(); + inline void setButtons( ::capnp::List::Reader value); + inline void setButtons(::kj::ArrayPtr value); + inline ::capnp::List::Builder initButtons(unsigned int size); + inline void adoptButtons(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownButtons(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Joystick::Pipeline { +public: + typedef Joystick Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class DriverState::Reader { +public: + typedef DriverState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint32_t getFrameId() const; + + inline bool hasDescriptorDEPRECATED() const; + inline ::capnp::List::Reader getDescriptorDEPRECATED() const; + + inline float getStdDEPRECATED() const; + + inline bool hasFaceOrientation() const; + inline ::capnp::List::Reader getFaceOrientation() const; + + inline bool hasFacePosition() const; + inline ::capnp::List::Reader getFacePosition() const; + + inline float getFaceProb() const; + + inline float getLeftEyeProb() const; + + inline float getRightEyeProb() const; + + inline float getLeftBlinkProb() const; + + inline float getRightBlinkProb() const; + + inline float getIrPwrDEPRECATED() const; + + inline bool hasFaceOrientationStd() const; + inline ::capnp::List::Reader getFaceOrientationStd() const; + + inline bool hasFacePositionStd() const; + inline ::capnp::List::Reader getFacePositionStd() const; + + inline float getSunglassesProb() const; + + inline float getModelExecutionTime() const; + + inline bool hasRawPredictions() const; + inline ::capnp::Data::Reader getRawPredictions() const; + + inline float getDspExecutionTime() const; + + inline float getPoorVision() const; + + inline float getPartialFace() const; + + inline float getDistractedPose() const; + + inline float getDistractedEyes() const; + + inline float getEyesOnRoad() const; + + inline float getPhoneUse() const; + + inline float getOccludedProb() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class DriverState::Builder { +public: + typedef DriverState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint32_t getFrameId(); + inline void setFrameId( ::uint32_t value); + + inline bool hasDescriptorDEPRECATED(); + inline ::capnp::List::Builder getDescriptorDEPRECATED(); + inline void setDescriptorDEPRECATED( ::capnp::List::Reader value); + inline void setDescriptorDEPRECATED(::kj::ArrayPtr value); + inline ::capnp::List::Builder initDescriptorDEPRECATED(unsigned int size); + inline void adoptDescriptorDEPRECATED(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownDescriptorDEPRECATED(); + + inline float getStdDEPRECATED(); + inline void setStdDEPRECATED(float value); + + inline bool hasFaceOrientation(); + inline ::capnp::List::Builder getFaceOrientation(); + inline void setFaceOrientation( ::capnp::List::Reader value); + inline void setFaceOrientation(::kj::ArrayPtr value); + inline ::capnp::List::Builder initFaceOrientation(unsigned int size); + inline void adoptFaceOrientation(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownFaceOrientation(); + + inline bool hasFacePosition(); + inline ::capnp::List::Builder getFacePosition(); + inline void setFacePosition( ::capnp::List::Reader value); + inline void setFacePosition(::kj::ArrayPtr value); + inline ::capnp::List::Builder initFacePosition(unsigned int size); + inline void adoptFacePosition(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownFacePosition(); + + inline float getFaceProb(); + inline void setFaceProb(float value); + + inline float getLeftEyeProb(); + inline void setLeftEyeProb(float value); + + inline float getRightEyeProb(); + inline void setRightEyeProb(float value); + + inline float getLeftBlinkProb(); + inline void setLeftBlinkProb(float value); + + inline float getRightBlinkProb(); + inline void setRightBlinkProb(float value); + + inline float getIrPwrDEPRECATED(); + inline void setIrPwrDEPRECATED(float value); + + inline bool hasFaceOrientationStd(); + inline ::capnp::List::Builder getFaceOrientationStd(); + inline void setFaceOrientationStd( ::capnp::List::Reader value); + inline void setFaceOrientationStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initFaceOrientationStd(unsigned int size); + inline void adoptFaceOrientationStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownFaceOrientationStd(); + + inline bool hasFacePositionStd(); + inline ::capnp::List::Builder getFacePositionStd(); + inline void setFacePositionStd( ::capnp::List::Reader value); + inline void setFacePositionStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initFacePositionStd(unsigned int size); + inline void adoptFacePositionStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownFacePositionStd(); + + inline float getSunglassesProb(); + inline void setSunglassesProb(float value); + + inline float getModelExecutionTime(); + inline void setModelExecutionTime(float value); + + inline bool hasRawPredictions(); + inline ::capnp::Data::Builder getRawPredictions(); + inline void setRawPredictions( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initRawPredictions(unsigned int size); + inline void adoptRawPredictions(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownRawPredictions(); + + inline float getDspExecutionTime(); + inline void setDspExecutionTime(float value); + + inline float getPoorVision(); + inline void setPoorVision(float value); + + inline float getPartialFace(); + inline void setPartialFace(float value); + + inline float getDistractedPose(); + inline void setDistractedPose(float value); + + inline float getDistractedEyes(); + inline void setDistractedEyes(float value); + + inline float getEyesOnRoad(); + inline void setEyesOnRoad(float value); + + inline float getPhoneUse(); + inline void setPhoneUse(float value); + + inline float getOccludedProb(); + inline void setOccludedProb(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class DriverState::Pipeline { +public: + typedef DriverState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class DriverMonitoringState::Reader { +public: + typedef DriverMonitoringState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasEvents() const; + inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader getEvents() const; + + inline bool getFaceDetected() const; + + inline bool getIsDistracted() const; + + inline float getAwarenessStatus() const; + + inline bool getIsRHDDEPRECATED() const; + + inline bool getRhdCheckedDEPRECATED() const; + + inline float getPosePitchOffset() const; + + inline ::uint32_t getPosePitchValidCount() const; + + inline float getPoseYawOffset() const; + + inline ::uint32_t getPoseYawValidCount() const; + + inline float getStepChange() const; + + inline float getAwarenessActive() const; + + inline float getAwarenessPassive() const; + + inline bool getIsLowStd() const; + + inline ::uint32_t getHiStdCount() const; + + inline bool getIsPreviewDEPRECATED() const; + + inline bool getIsActiveMode() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class DriverMonitoringState::Builder { +public: + typedef DriverMonitoringState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasEvents(); + inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder getEvents(); + inline void setEvents( ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder initEvents(unsigned int size); + inline void adoptEvents(::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>> disownEvents(); + + inline bool getFaceDetected(); + inline void setFaceDetected(bool value); + + inline bool getIsDistracted(); + inline void setIsDistracted(bool value); + + inline float getAwarenessStatus(); + inline void setAwarenessStatus(float value); + + inline bool getIsRHDDEPRECATED(); + inline void setIsRHDDEPRECATED(bool value); + + inline bool getRhdCheckedDEPRECATED(); + inline void setRhdCheckedDEPRECATED(bool value); + + inline float getPosePitchOffset(); + inline void setPosePitchOffset(float value); + + inline ::uint32_t getPosePitchValidCount(); + inline void setPosePitchValidCount( ::uint32_t value); + + inline float getPoseYawOffset(); + inline void setPoseYawOffset(float value); + + inline ::uint32_t getPoseYawValidCount(); + inline void setPoseYawValidCount( ::uint32_t value); + + inline float getStepChange(); + inline void setStepChange(float value); + + inline float getAwarenessActive(); + inline void setAwarenessActive(float value); + + inline float getAwarenessPassive(); + inline void setAwarenessPassive(float value); + + inline bool getIsLowStd(); + inline void setIsLowStd(bool value); + + inline ::uint32_t getHiStdCount(); + inline void setHiStdCount( ::uint32_t value); + + inline bool getIsPreviewDEPRECATED(); + inline void setIsPreviewDEPRECATED(bool value); + + inline bool getIsActiveMode(); + inline void setIsActiveMode(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class DriverMonitoringState::Pipeline { +public: + typedef DriverMonitoringState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class Boot::Reader { +public: + typedef Boot Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint64_t getWallTimeNanos() const; + + inline bool hasLastKmsgDEPRECATED() const; + inline ::capnp::Data::Reader getLastKmsgDEPRECATED() const; + + inline bool hasLastPmsgDEPRECATED() const; + inline ::capnp::Data::Reader getLastPmsgDEPRECATED() const; + + inline bool hasLaunchLog() const; + inline ::capnp::Text::Reader getLaunchLog() const; + + inline bool hasPstore() const; + inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Reader getPstore() const; + + inline bool hasCommands() const; + inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Reader getCommands() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Boot::Builder { +public: + typedef Boot Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint64_t getWallTimeNanos(); + inline void setWallTimeNanos( ::uint64_t value); + + inline bool hasLastKmsgDEPRECATED(); + inline ::capnp::Data::Builder getLastKmsgDEPRECATED(); + inline void setLastKmsgDEPRECATED( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initLastKmsgDEPRECATED(unsigned int size); + inline void adoptLastKmsgDEPRECATED(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownLastKmsgDEPRECATED(); + + inline bool hasLastPmsgDEPRECATED(); + inline ::capnp::Data::Builder getLastPmsgDEPRECATED(); + inline void setLastPmsgDEPRECATED( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initLastPmsgDEPRECATED(unsigned int size); + inline void adoptLastPmsgDEPRECATED(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownLastPmsgDEPRECATED(); + + inline bool hasLaunchLog(); + inline ::capnp::Text::Builder getLaunchLog(); + inline void setLaunchLog( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initLaunchLog(unsigned int size); + inline void adoptLaunchLog(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownLaunchLog(); + + inline bool hasPstore(); + inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Builder getPstore(); + inline void setPstore( ::cereal::Map< ::capnp::Text, ::capnp::Data>::Reader value); + inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Builder initPstore(); + inline void adoptPstore(::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Data>>&& value); + inline ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Data>> disownPstore(); + + inline bool hasCommands(); + inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Builder getCommands(); + inline void setCommands( ::cereal::Map< ::capnp::Text, ::capnp::Data>::Reader value); + inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Builder initCommands(); + inline void adoptCommands(::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Data>>&& value); + inline ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Data>> disownCommands(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Boot::Pipeline { +public: + typedef Boot Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Pipeline getPstore(); + inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Pipeline getCommands(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LiveParametersData::Reader { +public: + typedef LiveParametersData Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getValid() const; + + inline float getGyroBias() const; + + inline float getAngleOffsetDeg() const; + + inline float getAngleOffsetAverageDeg() const; + + inline float getStiffnessFactor() const; + + inline float getSteerRatio() const; + + inline bool getSensorValid() const; + + inline float getYawRate() const; + + inline float getPosenetSpeed() const; + + inline bool getPosenetValid() const; + + inline float getAngleOffsetFastStd() const; + + inline float getAngleOffsetAverageStd() const; + + inline float getStiffnessFactorStd() const; + + inline float getSteerRatioStd() const; + + inline float getRoll() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LiveParametersData::Builder { +public: + typedef LiveParametersData Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getValid(); + inline void setValid(bool value); + + inline float getGyroBias(); + inline void setGyroBias(float value); + + inline float getAngleOffsetDeg(); + inline void setAngleOffsetDeg(float value); + + inline float getAngleOffsetAverageDeg(); + inline void setAngleOffsetAverageDeg(float value); + + inline float getStiffnessFactor(); + inline void setStiffnessFactor(float value); + + inline float getSteerRatio(); + inline void setSteerRatio(float value); + + inline bool getSensorValid(); + inline void setSensorValid(bool value); + + inline float getYawRate(); + inline void setYawRate(float value); + + inline float getPosenetSpeed(); + inline void setPosenetSpeed(float value); + + inline bool getPosenetValid(); + inline void setPosenetValid(bool value); + + inline float getAngleOffsetFastStd(); + inline void setAngleOffsetFastStd(float value); + + inline float getAngleOffsetAverageStd(); + inline void setAngleOffsetAverageStd(float value); + + inline float getStiffnessFactorStd(); + inline void setStiffnessFactorStd(float value); + + inline float getSteerRatioStd(); + inline void setSteerRatioStd(float value); + + inline float getRoll(); + inline void setRoll(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LiveParametersData::Pipeline { +public: + typedef LiveParametersData Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class LiveMapDataDEPRECATED::Reader { +public: + typedef LiveMapDataDEPRECATED Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getSpeedLimitValid() const; + + inline float getSpeedLimit() const; + + inline bool getCurvatureValid() const; + + inline float getCurvature() const; + + inline ::uint64_t getWayId() const; + + inline bool hasRoadX() const; + inline ::capnp::List::Reader getRoadX() const; + + inline bool hasRoadY() const; + inline ::capnp::List::Reader getRoadY() const; + + inline bool hasLastGps() const; + inline ::cereal::GpsLocationData::Reader getLastGps() const; + + inline bool hasRoadCurvatureX() const; + inline ::capnp::List::Reader getRoadCurvatureX() const; + + inline bool hasRoadCurvature() const; + inline ::capnp::List::Reader getRoadCurvature() const; + + inline float getDistToTurn() const; + + inline bool getMapValid() const; + + inline bool getSpeedAdvisoryValid() const; + + inline float getSpeedAdvisory() const; + + inline bool getSpeedLimitAheadValid() const; + + inline float getSpeedLimitAhead() const; + + inline float getSpeedLimitAheadDistance() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class LiveMapDataDEPRECATED::Builder { +public: + typedef LiveMapDataDEPRECATED Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getSpeedLimitValid(); + inline void setSpeedLimitValid(bool value); + + inline float getSpeedLimit(); + inline void setSpeedLimit(float value); + + inline bool getCurvatureValid(); + inline void setCurvatureValid(bool value); + + inline float getCurvature(); + inline void setCurvature(float value); + + inline ::uint64_t getWayId(); + inline void setWayId( ::uint64_t value); + + inline bool hasRoadX(); + inline ::capnp::List::Builder getRoadX(); + inline void setRoadX( ::capnp::List::Reader value); + inline void setRoadX(::kj::ArrayPtr value); + inline ::capnp::List::Builder initRoadX(unsigned int size); + inline void adoptRoadX(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownRoadX(); + + inline bool hasRoadY(); + inline ::capnp::List::Builder getRoadY(); + inline void setRoadY( ::capnp::List::Reader value); + inline void setRoadY(::kj::ArrayPtr value); + inline ::capnp::List::Builder initRoadY(unsigned int size); + inline void adoptRoadY(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownRoadY(); + + inline bool hasLastGps(); + inline ::cereal::GpsLocationData::Builder getLastGps(); + inline void setLastGps( ::cereal::GpsLocationData::Reader value); + inline ::cereal::GpsLocationData::Builder initLastGps(); + inline void adoptLastGps(::capnp::Orphan< ::cereal::GpsLocationData>&& value); + inline ::capnp::Orphan< ::cereal::GpsLocationData> disownLastGps(); + + inline bool hasRoadCurvatureX(); + inline ::capnp::List::Builder getRoadCurvatureX(); + inline void setRoadCurvatureX( ::capnp::List::Reader value); + inline void setRoadCurvatureX(::kj::ArrayPtr value); + inline ::capnp::List::Builder initRoadCurvatureX(unsigned int size); + inline void adoptRoadCurvatureX(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownRoadCurvatureX(); + + inline bool hasRoadCurvature(); + inline ::capnp::List::Builder getRoadCurvature(); + inline void setRoadCurvature( ::capnp::List::Reader value); + inline void setRoadCurvature(::kj::ArrayPtr value); + inline ::capnp::List::Builder initRoadCurvature(unsigned int size); + inline void adoptRoadCurvature(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownRoadCurvature(); + + inline float getDistToTurn(); + inline void setDistToTurn(float value); + + inline bool getMapValid(); + inline void setMapValid(bool value); + + inline bool getSpeedAdvisoryValid(); + inline void setSpeedAdvisoryValid(bool value); + + inline float getSpeedAdvisory(); + inline void setSpeedAdvisory(float value); + + inline bool getSpeedLimitAheadValid(); + inline void setSpeedLimitAheadValid(bool value); + + inline float getSpeedLimitAhead(); + inline void setSpeedLimitAhead(float value); + + inline float getSpeedLimitAheadDistance(); + inline void setSpeedLimitAheadDistance(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class LiveMapDataDEPRECATED::Pipeline { +public: + typedef LiveMapDataDEPRECATED Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::GpsLocationData::Pipeline getLastGps(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class CameraOdometry::Reader { +public: + typedef CameraOdometry Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasTrans() const; + inline ::capnp::List::Reader getTrans() const; + + inline bool hasRot() const; + inline ::capnp::List::Reader getRot() const; + + inline bool hasTransStd() const; + inline ::capnp::List::Reader getTransStd() const; + + inline bool hasRotStd() const; + inline ::capnp::List::Reader getRotStd() const; + + inline ::uint32_t getFrameId() const; + + inline ::uint64_t getTimestampEof() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CameraOdometry::Builder { +public: + typedef CameraOdometry Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasTrans(); + inline ::capnp::List::Builder getTrans(); + inline void setTrans( ::capnp::List::Reader value); + inline void setTrans(::kj::ArrayPtr value); + inline ::capnp::List::Builder initTrans(unsigned int size); + inline void adoptTrans(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownTrans(); + + inline bool hasRot(); + inline ::capnp::List::Builder getRot(); + inline void setRot( ::capnp::List::Reader value); + inline void setRot(::kj::ArrayPtr value); + inline ::capnp::List::Builder initRot(unsigned int size); + inline void adoptRot(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownRot(); + + inline bool hasTransStd(); + inline ::capnp::List::Builder getTransStd(); + inline void setTransStd( ::capnp::List::Reader value); + inline void setTransStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initTransStd(unsigned int size); + inline void adoptTransStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownTransStd(); + + inline bool hasRotStd(); + inline ::capnp::List::Builder getRotStd(); + inline void setRotStd( ::capnp::List::Reader value); + inline void setRotStd(::kj::ArrayPtr value); + inline ::capnp::List::Builder initRotStd(unsigned int size); + inline void adoptRotStd(::capnp::Orphan< ::capnp::List>&& value); + inline ::capnp::Orphan< ::capnp::List> disownRotStd(); + + inline ::uint32_t getFrameId(); + inline void setFrameId( ::uint32_t value); + + inline ::uint64_t getTimestampEof(); + inline void setTimestampEof( ::uint64_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CameraOdometry::Pipeline { +public: + typedef CameraOdometry Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class Sentinel::Reader { +public: + typedef Sentinel Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::cereal::Sentinel::SentinelType getType() const; + + inline ::int32_t getSignal() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Sentinel::Builder { +public: + typedef Sentinel Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::cereal::Sentinel::SentinelType getType(); + inline void setType( ::cereal::Sentinel::SentinelType value); + + inline ::int32_t getSignal(); + inline void setSignal( ::int32_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Sentinel::Pipeline { +public: + typedef Sentinel Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ManagerState::Reader { +public: + typedef ManagerState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasProcesses() const; + inline ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>::Reader getProcesses() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ManagerState::Builder { +public: + typedef ManagerState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasProcesses(); + inline ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>::Builder getProcesses(); + inline void setProcesses( ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>::Builder initProcesses(unsigned int size); + inline void adoptProcesses(::capnp::Orphan< ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>> disownProcesses(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ManagerState::Pipeline { +public: + typedef ManagerState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class ManagerState::ProcessState::Reader { +public: + typedef ProcessState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasName() const; + inline ::capnp::Text::Reader getName() const; + + inline ::int32_t getPid() const; + + inline bool getRunning() const; + + inline ::int32_t getExitCode() const; + + inline bool getShouldBeRunning() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ManagerState::ProcessState::Builder { +public: + typedef ProcessState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasName(); + inline ::capnp::Text::Builder getName(); + inline void setName( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initName(unsigned int size); + inline void adoptName(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownName(); + + inline ::int32_t getPid(); + inline void setPid( ::int32_t value); + + inline bool getRunning(); + inline void setRunning(bool value); + + inline ::int32_t getExitCode(); + inline void setExitCode( ::int32_t value); + + inline bool getShouldBeRunning(); + inline void setShouldBeRunning(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ManagerState::ProcessState::Pipeline { +public: + typedef ProcessState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class UploaderState::Reader { +public: + typedef UploaderState Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::uint32_t getImmediateQueueSize() const; + + inline ::uint32_t getImmediateQueueCount() const; + + inline ::uint32_t getRawQueueSize() const; + + inline ::uint32_t getRawQueueCount() const; + + inline float getLastTime() const; + + inline float getLastSpeed() const; + + inline bool hasLastFilename() const; + inline ::capnp::Text::Reader getLastFilename() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class UploaderState::Builder { +public: + typedef UploaderState Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::uint32_t getImmediateQueueSize(); + inline void setImmediateQueueSize( ::uint32_t value); + + inline ::uint32_t getImmediateQueueCount(); + inline void setImmediateQueueCount( ::uint32_t value); + + inline ::uint32_t getRawQueueSize(); + inline void setRawQueueSize( ::uint32_t value); + + inline ::uint32_t getRawQueueCount(); + inline void setRawQueueCount( ::uint32_t value); + + inline float getLastTime(); + inline void setLastTime(float value); + + inline float getLastSpeed(); + inline void setLastSpeed(float value); + + inline bool hasLastFilename(); + inline ::capnp::Text::Builder getLastFilename(); + inline void setLastFilename( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initLastFilename(unsigned int size); + inline void adoptLastFilename(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownLastFilename(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class UploaderState::Pipeline { +public: + typedef UploaderState Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class NavInstruction::Reader { +public: + typedef NavInstruction Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasManeuverPrimaryText() const; + inline ::capnp::Text::Reader getManeuverPrimaryText() const; + + inline bool hasManeuverSecondaryText() const; + inline ::capnp::Text::Reader getManeuverSecondaryText() const; + + inline float getManeuverDistance() const; + + inline bool hasManeuverType() const; + inline ::capnp::Text::Reader getManeuverType() const; + + inline bool hasManeuverModifier() const; + inline ::capnp::Text::Reader getManeuverModifier() const; + + inline float getDistanceRemaining() const; + + inline float getTimeRemaining() const; + + inline float getTimeRemainingTypical() const; + + inline bool hasLanes() const; + inline ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>::Reader getLanes() const; + + inline bool getShowFull() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class NavInstruction::Builder { +public: + typedef NavInstruction Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasManeuverPrimaryText(); + inline ::capnp::Text::Builder getManeuverPrimaryText(); + inline void setManeuverPrimaryText( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initManeuverPrimaryText(unsigned int size); + inline void adoptManeuverPrimaryText(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownManeuverPrimaryText(); + + inline bool hasManeuverSecondaryText(); + inline ::capnp::Text::Builder getManeuverSecondaryText(); + inline void setManeuverSecondaryText( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initManeuverSecondaryText(unsigned int size); + inline void adoptManeuverSecondaryText(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownManeuverSecondaryText(); + + inline float getManeuverDistance(); + inline void setManeuverDistance(float value); + + inline bool hasManeuverType(); + inline ::capnp::Text::Builder getManeuverType(); + inline void setManeuverType( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initManeuverType(unsigned int size); + inline void adoptManeuverType(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownManeuverType(); + + inline bool hasManeuverModifier(); + inline ::capnp::Text::Builder getManeuverModifier(); + inline void setManeuverModifier( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initManeuverModifier(unsigned int size); + inline void adoptManeuverModifier(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownManeuverModifier(); + + inline float getDistanceRemaining(); + inline void setDistanceRemaining(float value); + + inline float getTimeRemaining(); + inline void setTimeRemaining(float value); + + inline float getTimeRemainingTypical(); + inline void setTimeRemainingTypical(float value); + + inline bool hasLanes(); + inline ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>::Builder getLanes(); + inline void setLanes( ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>::Builder initLanes(unsigned int size); + inline void adoptLanes(::capnp::Orphan< ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>> disownLanes(); + + inline bool getShowFull(); + inline void setShowFull(bool value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class NavInstruction::Pipeline { +public: + typedef NavInstruction Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class NavInstruction::Lane::Reader { +public: + typedef Lane Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasDirections() const; + inline ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>::Reader getDirections() const; + + inline bool getActive() const; + + inline ::cereal::NavInstruction::Direction getActiveDirection() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class NavInstruction::Lane::Builder { +public: + typedef Lane Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasDirections(); + inline ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>::Builder getDirections(); + inline void setDirections( ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>::Reader value); + inline void setDirections(::kj::ArrayPtr value); + inline ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>::Builder initDirections(unsigned int size); + inline void adoptDirections(::capnp::Orphan< ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>> disownDirections(); + + inline bool getActive(); + inline void setActive(bool value); + + inline ::cereal::NavInstruction::Direction getActiveDirection(); + inline void setActiveDirection( ::cereal::NavInstruction::Direction value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class NavInstruction::Lane::Pipeline { +public: + typedef Lane Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class NavRoute::Reader { +public: + typedef NavRoute Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasCoordinates() const; + inline ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>::Reader getCoordinates() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class NavRoute::Builder { +public: + typedef NavRoute Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasCoordinates(); + inline ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>::Builder getCoordinates(); + inline void setCoordinates( ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>::Builder initCoordinates(unsigned int size); + inline void adoptCoordinates(::capnp::Orphan< ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>> disownCoordinates(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class NavRoute::Pipeline { +public: + typedef NavRoute Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class NavRoute::Coordinate::Reader { +public: + typedef Coordinate Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline float getLatitude() const; + + inline float getLongitude() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class NavRoute::Coordinate::Builder { +public: + typedef Coordinate Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline float getLatitude(); + inline void setLatitude(float value); + + inline float getLongitude(); + inline void setLongitude(float value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class NavRoute::Coordinate::Pipeline { +public: + typedef Coordinate Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class Event::Reader { +public: + typedef Event Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline Which which() const; + inline ::uint64_t getLogMonoTime() const; + + inline bool isInitData() const; + inline bool hasInitData() const; + inline ::cereal::InitData::Reader getInitData() const; + + inline bool isRoadCameraState() const; + inline bool hasRoadCameraState() const; + inline ::cereal::FrameData::Reader getRoadCameraState() const; + + inline bool isGpsNMEA() const; + inline bool hasGpsNMEA() const; + inline ::cereal::GPSNMEAData::Reader getGpsNMEA() const; + + inline bool isSensorEventDEPRECATED() const; + inline bool hasSensorEventDEPRECATED() const; + inline ::cereal::SensorEventData::Reader getSensorEventDEPRECATED() const; + + inline bool isCan() const; + inline bool hasCan() const; + inline ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Reader getCan() const; + + inline bool isDeviceState() const; + inline bool hasDeviceState() const; + inline ::cereal::DeviceState::Reader getDeviceState() const; + + inline bool isControlsState() const; + inline bool hasControlsState() const; + inline ::cereal::ControlsState::Reader getControlsState() const; + + inline bool isLiveEventDEPRECATED() const; + inline bool hasLiveEventDEPRECATED() const; + inline ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>::Reader getLiveEventDEPRECATED() const; + + inline bool isModel() const; + inline bool hasModel() const; + inline ::cereal::ModelData::Reader getModel() const; + + inline bool isFeaturesDEPRECATED() const; + inline bool hasFeaturesDEPRECATED() const; + inline ::cereal::CalibrationFeatures::Reader getFeaturesDEPRECATED() const; + + inline bool isSensorEvents() const; + inline bool hasSensorEvents() const; + inline ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>::Reader getSensorEvents() const; + + inline bool isPandaStateDEPRECATED() const; + inline bool hasPandaStateDEPRECATED() const; + inline ::cereal::PandaState::Reader getPandaStateDEPRECATED() const; + + inline bool isRadarState() const; + inline bool hasRadarState() const; + inline ::cereal::RadarState::Reader getRadarState() const; + + inline bool isLiveUIDEPRECATED() const; + inline bool hasLiveUIDEPRECATED() const; + inline ::cereal::LiveUI::Reader getLiveUIDEPRECATED() const; + + inline bool isRoadEncodeIdx() const; + inline bool hasRoadEncodeIdx() const; + inline ::cereal::EncodeIndex::Reader getRoadEncodeIdx() const; + + inline bool isLiveTracks() const; + inline bool hasLiveTracks() const; + inline ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>::Reader getLiveTracks() const; + + inline bool isSendcan() const; + inline bool hasSendcan() const; + inline ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Reader getSendcan() const; + + inline bool isLogMessage() const; + inline bool hasLogMessage() const; + inline ::capnp::Text::Reader getLogMessage() const; + + inline bool isLiveCalibration() const; + inline bool hasLiveCalibration() const; + inline ::cereal::LiveCalibrationData::Reader getLiveCalibration() const; + + inline bool isAndroidLog() const; + inline bool hasAndroidLog() const; + inline ::cereal::AndroidLogEntry::Reader getAndroidLog() const; + + inline bool isGpsLocationDEPRECATED() const; + inline bool hasGpsLocationDEPRECATED() const; + inline ::cereal::GpsLocationData::Reader getGpsLocationDEPRECATED() const; + + inline bool isCarState() const; + inline bool hasCarState() const; + inline ::cereal::CarState::Reader getCarState() const; + + inline bool isCarControl() const; + inline bool hasCarControl() const; + inline ::cereal::CarControl::Reader getCarControl() const; + + inline bool isLongitudinalPlan() const; + inline bool hasLongitudinalPlan() const; + inline ::cereal::LongitudinalPlan::Reader getLongitudinalPlan() const; + + inline bool isLiveLocationDEPRECATED() const; + inline bool hasLiveLocationDEPRECATED() const; + inline ::cereal::LiveLocationData::Reader getLiveLocationDEPRECATED() const; + + inline bool isEthernetDataDEPRECATED() const; + inline bool hasEthernetDataDEPRECATED() const; + inline ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>::Reader getEthernetDataDEPRECATED() const; + + inline bool isNavUpdateDEPRECATED() const; + inline bool hasNavUpdateDEPRECATED() const; + inline ::cereal::NavUpdate::Reader getNavUpdateDEPRECATED() const; + + inline bool isCellInfoDEPRECATED() const; + inline bool hasCellInfoDEPRECATED() const; + inline ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>::Reader getCellInfoDEPRECATED() const; + + inline bool isWifiScanDEPRECATED() const; + inline bool hasWifiScanDEPRECATED() const; + inline ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>::Reader getWifiScanDEPRECATED() const; + + inline bool isAndroidGnssDEPRECATED() const; + inline bool hasAndroidGnssDEPRECATED() const; + inline ::cereal::AndroidGnss::Reader getAndroidGnssDEPRECATED() const; + + inline bool isQcomGnssDEPRECATD() const; + inline bool hasQcomGnssDEPRECATD() const; + inline ::cereal::QcomGnss::Reader getQcomGnssDEPRECATD() const; + + inline bool isLidarPtsDEPRECATED() const; + inline bool hasLidarPtsDEPRECATED() const; + inline ::cereal::LidarPts::Reader getLidarPtsDEPRECATED() const; + + inline bool isProcLog() const; + inline bool hasProcLog() const; + inline ::cereal::ProcLog::Reader getProcLog() const; + + inline bool isUbloxGnss() const; + inline bool hasUbloxGnss() const; + inline ::cereal::UbloxGnss::Reader getUbloxGnss() const; + + inline bool isClocks() const; + inline bool hasClocks() const; + inline ::cereal::Clocks::Reader getClocks() const; + + inline bool isLiveMpcDEPRECATED() const; + inline bool hasLiveMpcDEPRECATED() const; + inline ::cereal::LiveMpcData::Reader getLiveMpcDEPRECATED() const; + + inline bool isLiveLongitudinalMpcDEPRECATED() const; + inline bool hasLiveLongitudinalMpcDEPRECATED() const; + inline ::cereal::LiveLongitudinalMpcData::Reader getLiveLongitudinalMpcDEPRECATED() const; + + inline bool isNavStatusDEPRECATED() const; + inline bool hasNavStatusDEPRECATED() const; + inline ::cereal::NavStatus::Reader getNavStatusDEPRECATED() const; + + inline bool isUbloxRaw() const; + inline bool hasUbloxRaw() const; + inline ::capnp::Data::Reader getUbloxRaw() const; + + inline bool isGpsPlannerPointsDEPRECATED() const; + inline bool hasGpsPlannerPointsDEPRECATED() const; + inline ::cereal::GPSPlannerPoints::Reader getGpsPlannerPointsDEPRECATED() const; + + inline bool isGpsPlannerPlanDEPRECATED() const; + inline bool hasGpsPlannerPlanDEPRECATED() const; + inline ::cereal::GPSPlannerPlan::Reader getGpsPlannerPlanDEPRECATED() const; + + inline bool isApplanixRawDEPRECATED() const; + inline bool hasApplanixRawDEPRECATED() const; + inline ::capnp::Data::Reader getApplanixRawDEPRECATED() const; + + inline bool isTrafficEventsDEPRECATED() const; + inline bool hasTrafficEventsDEPRECATED() const; + inline ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>::Reader getTrafficEventsDEPRECATED() const; + + inline bool isLiveLocationTimingDEPRECATED() const; + inline bool hasLiveLocationTimingDEPRECATED() const; + inline ::cereal::LiveLocationData::Reader getLiveLocationTimingDEPRECATED() const; + + inline bool isOrbslamCorrectionDEPRECATED() const; + inline bool hasOrbslamCorrectionDEPRECATED() const; + inline ::cereal::OrbslamCorrection::Reader getOrbslamCorrectionDEPRECATED() const; + + inline bool isLiveLocationCorrectedDEPRECATED() const; + inline bool hasLiveLocationCorrectedDEPRECATED() const; + inline ::cereal::LiveLocationData::Reader getLiveLocationCorrectedDEPRECATED() const; + + inline bool isOrbObservationDEPRECATED() const; + inline bool hasOrbObservationDEPRECATED() const; + inline ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>::Reader getOrbObservationDEPRECATED() const; + + inline bool isGpsLocationExternal() const; + inline bool hasGpsLocationExternal() const; + inline ::cereal::GpsLocationData::Reader getGpsLocationExternal() const; + + inline bool isLocationDEPRECATED() const; + inline bool hasLocationDEPRECATED() const; + inline ::cereal::LiveLocationData::Reader getLocationDEPRECATED() const; + + inline bool isUiNavigationEventDEPRECATED() const; + inline bool hasUiNavigationEventDEPRECATED() const; + inline ::cereal::UiNavigationEvent::Reader getUiNavigationEventDEPRECATED() const; + + inline bool isLiveLocationKalmanDEPRECATED() const; + inline bool hasLiveLocationKalmanDEPRECATED() const; + inline ::cereal::LiveLocationData::Reader getLiveLocationKalmanDEPRECATED() const; + + inline bool isTestJoystick() const; + inline bool hasTestJoystick() const; + inline ::cereal::Joystick::Reader getTestJoystick() const; + + inline bool isOrbOdometryDEPRECATED() const; + inline bool hasOrbOdometryDEPRECATED() const; + inline ::cereal::OrbOdometry::Reader getOrbOdometryDEPRECATED() const; + + inline bool isOrbFeaturesDEPRECATED() const; + inline bool hasOrbFeaturesDEPRECATED() const; + inline ::cereal::OrbFeatures::Reader getOrbFeaturesDEPRECATED() const; + + inline bool isApplanixLocationDEPRECATED() const; + inline bool hasApplanixLocationDEPRECATED() const; + inline ::cereal::LiveLocationData::Reader getApplanixLocationDEPRECATED() const; + + inline bool isOrbKeyFrameDEPRECATED() const; + inline bool hasOrbKeyFrameDEPRECATED() const; + inline ::cereal::OrbKeyFrame::Reader getOrbKeyFrameDEPRECATED() const; + + inline bool isUiLayoutStateDEPRECATED() const; + inline bool hasUiLayoutStateDEPRECATED() const; + inline ::cereal::UiLayoutState::Reader getUiLayoutStateDEPRECATED() const; + + inline bool isOrbFeaturesSummaryDEPRECATED() const; + inline bool hasOrbFeaturesSummaryDEPRECATED() const; + inline ::cereal::OrbFeaturesSummary::Reader getOrbFeaturesSummaryDEPRECATED() const; + + inline bool isDriverState() const; + inline bool hasDriverState() const; + inline ::cereal::DriverState::Reader getDriverState() const; + + inline bool isBoot() const; + inline bool hasBoot() const; + inline ::cereal::Boot::Reader getBoot() const; + + inline bool isLiveParameters() const; + inline bool hasLiveParameters() const; + inline ::cereal::LiveParametersData::Reader getLiveParameters() const; + + inline bool isLiveMapDataDEPRECATED() const; + inline bool hasLiveMapDataDEPRECATED() const; + inline ::cereal::LiveMapDataDEPRECATED::Reader getLiveMapDataDEPRECATED() const; + + inline bool isCameraOdometry() const; + inline bool hasCameraOdometry() const; + inline ::cereal::CameraOdometry::Reader getCameraOdometry() const; + + inline bool isLateralPlan() const; + inline bool hasLateralPlan() const; + inline ::cereal::LateralPlan::Reader getLateralPlan() const; + + inline bool isKalmanOdometryDEPRECATED() const; + inline bool hasKalmanOdometryDEPRECATED() const; + inline ::cereal::KalmanOdometry::Reader getKalmanOdometryDEPRECATED() const; + + inline bool isThumbnail() const; + inline bool hasThumbnail() const; + inline ::cereal::Thumbnail::Reader getThumbnail() const; + + inline bool getValid() const; + + inline bool isCarEvents() const; + inline bool hasCarEvents() const; + inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader getCarEvents() const; + + inline bool isCarParams() const; + inline bool hasCarParams() const; + inline ::cereal::CarParams::Reader getCarParams() const; + + inline bool isDriverCameraState() const; + inline bool hasDriverCameraState() const; + inline ::cereal::FrameData::Reader getDriverCameraState() const; + + inline bool isDriverMonitoringState() const; + inline bool hasDriverMonitoringState() const; + inline ::cereal::DriverMonitoringState::Reader getDriverMonitoringState() const; + + inline bool isLiveLocationKalman() const; + inline bool hasLiveLocationKalman() const; + inline ::cereal::LiveLocationKalman::Reader getLiveLocationKalman() const; + + inline bool isSentinel() const; + inline bool hasSentinel() const; + inline ::cereal::Sentinel::Reader getSentinel() const; + + inline bool isWideRoadCameraState() const; + inline bool hasWideRoadCameraState() const; + inline ::cereal::FrameData::Reader getWideRoadCameraState() const; + + inline bool isModelV2() const; + inline bool hasModelV2() const; + inline ::cereal::ModelDataV2::Reader getModelV2() const; + + inline bool isDriverEncodeIdx() const; + inline bool hasDriverEncodeIdx() const; + inline ::cereal::EncodeIndex::Reader getDriverEncodeIdx() const; + + inline bool isWideRoadEncodeIdx() const; + inline bool hasWideRoadEncodeIdx() const; + inline ::cereal::EncodeIndex::Reader getWideRoadEncodeIdx() const; + + inline bool isManagerState() const; + inline bool hasManagerState() const; + inline ::cereal::ManagerState::Reader getManagerState() const; + + inline bool isUploaderState() const; + inline bool hasUploaderState() const; + inline ::cereal::UploaderState::Reader getUploaderState() const; + + inline bool isPeripheralState() const; + inline bool hasPeripheralState() const; + inline ::cereal::PeripheralState::Reader getPeripheralState() const; + + inline bool isPandaStates() const; + inline bool hasPandaStates() const; + inline ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>::Reader getPandaStates() const; + + inline bool isNavInstruction() const; + inline bool hasNavInstruction() const; + inline ::cereal::NavInstruction::Reader getNavInstruction() const; + + inline bool isNavRoute() const; + inline bool hasNavRoute() const; + inline ::cereal::NavRoute::Reader getNavRoute() const; + + inline bool isNavThumbnail() const; + inline bool hasNavThumbnail() const; + inline ::cereal::Thumbnail::Reader getNavThumbnail() const; + + inline bool isErrorLogMessage() const; + inline bool hasErrorLogMessage() const; + inline ::capnp::Text::Reader getErrorLogMessage() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Event::Builder { +public: + typedef Event Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline Which which(); + inline ::uint64_t getLogMonoTime(); + inline void setLogMonoTime( ::uint64_t value); + + inline bool isInitData(); + inline bool hasInitData(); + inline ::cereal::InitData::Builder getInitData(); + inline void setInitData( ::cereal::InitData::Reader value); + inline ::cereal::InitData::Builder initInitData(); + inline void adoptInitData(::capnp::Orphan< ::cereal::InitData>&& value); + inline ::capnp::Orphan< ::cereal::InitData> disownInitData(); + + inline bool isRoadCameraState(); + inline bool hasRoadCameraState(); + inline ::cereal::FrameData::Builder getRoadCameraState(); + inline void setRoadCameraState( ::cereal::FrameData::Reader value); + inline ::cereal::FrameData::Builder initRoadCameraState(); + inline void adoptRoadCameraState(::capnp::Orphan< ::cereal::FrameData>&& value); + inline ::capnp::Orphan< ::cereal::FrameData> disownRoadCameraState(); + + inline bool isGpsNMEA(); + inline bool hasGpsNMEA(); + inline ::cereal::GPSNMEAData::Builder getGpsNMEA(); + inline void setGpsNMEA( ::cereal::GPSNMEAData::Reader value); + inline ::cereal::GPSNMEAData::Builder initGpsNMEA(); + inline void adoptGpsNMEA(::capnp::Orphan< ::cereal::GPSNMEAData>&& value); + inline ::capnp::Orphan< ::cereal::GPSNMEAData> disownGpsNMEA(); + + inline bool isSensorEventDEPRECATED(); + inline bool hasSensorEventDEPRECATED(); + inline ::cereal::SensorEventData::Builder getSensorEventDEPRECATED(); + inline void setSensorEventDEPRECATED( ::cereal::SensorEventData::Reader value); + inline ::cereal::SensorEventData::Builder initSensorEventDEPRECATED(); + inline void adoptSensorEventDEPRECATED(::capnp::Orphan< ::cereal::SensorEventData>&& value); + inline ::capnp::Orphan< ::cereal::SensorEventData> disownSensorEventDEPRECATED(); + + inline bool isCan(); + inline bool hasCan(); + inline ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Builder getCan(); + inline void setCan( ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Builder initCan(unsigned int size); + inline void adoptCan(::capnp::Orphan< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>> disownCan(); + + inline bool isDeviceState(); + inline bool hasDeviceState(); + inline ::cereal::DeviceState::Builder getDeviceState(); + inline void setDeviceState( ::cereal::DeviceState::Reader value); + inline ::cereal::DeviceState::Builder initDeviceState(); + inline void adoptDeviceState(::capnp::Orphan< ::cereal::DeviceState>&& value); + inline ::capnp::Orphan< ::cereal::DeviceState> disownDeviceState(); + + inline bool isControlsState(); + inline bool hasControlsState(); + inline ::cereal::ControlsState::Builder getControlsState(); + inline void setControlsState( ::cereal::ControlsState::Reader value); + inline ::cereal::ControlsState::Builder initControlsState(); + inline void adoptControlsState(::capnp::Orphan< ::cereal::ControlsState>&& value); + inline ::capnp::Orphan< ::cereal::ControlsState> disownControlsState(); + + inline bool isLiveEventDEPRECATED(); + inline bool hasLiveEventDEPRECATED(); + inline ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>::Builder getLiveEventDEPRECATED(); + inline void setLiveEventDEPRECATED( ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>::Builder initLiveEventDEPRECATED(unsigned int size); + inline void adoptLiveEventDEPRECATED(::capnp::Orphan< ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>> disownLiveEventDEPRECATED(); + + inline bool isModel(); + inline bool hasModel(); + inline ::cereal::ModelData::Builder getModel(); + inline void setModel( ::cereal::ModelData::Reader value); + inline ::cereal::ModelData::Builder initModel(); + inline void adoptModel(::capnp::Orphan< ::cereal::ModelData>&& value); + inline ::capnp::Orphan< ::cereal::ModelData> disownModel(); + + inline bool isFeaturesDEPRECATED(); + inline bool hasFeaturesDEPRECATED(); + inline ::cereal::CalibrationFeatures::Builder getFeaturesDEPRECATED(); + inline void setFeaturesDEPRECATED( ::cereal::CalibrationFeatures::Reader value); + inline ::cereal::CalibrationFeatures::Builder initFeaturesDEPRECATED(); + inline void adoptFeaturesDEPRECATED(::capnp::Orphan< ::cereal::CalibrationFeatures>&& value); + inline ::capnp::Orphan< ::cereal::CalibrationFeatures> disownFeaturesDEPRECATED(); + + inline bool isSensorEvents(); + inline bool hasSensorEvents(); + inline ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>::Builder getSensorEvents(); + inline void setSensorEvents( ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>::Builder initSensorEvents(unsigned int size); + inline void adoptSensorEvents(::capnp::Orphan< ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>> disownSensorEvents(); + + inline bool isPandaStateDEPRECATED(); + inline bool hasPandaStateDEPRECATED(); + inline ::cereal::PandaState::Builder getPandaStateDEPRECATED(); + inline void setPandaStateDEPRECATED( ::cereal::PandaState::Reader value); + inline ::cereal::PandaState::Builder initPandaStateDEPRECATED(); + inline void adoptPandaStateDEPRECATED(::capnp::Orphan< ::cereal::PandaState>&& value); + inline ::capnp::Orphan< ::cereal::PandaState> disownPandaStateDEPRECATED(); + + inline bool isRadarState(); + inline bool hasRadarState(); + inline ::cereal::RadarState::Builder getRadarState(); + inline void setRadarState( ::cereal::RadarState::Reader value); + inline ::cereal::RadarState::Builder initRadarState(); + inline void adoptRadarState(::capnp::Orphan< ::cereal::RadarState>&& value); + inline ::capnp::Orphan< ::cereal::RadarState> disownRadarState(); + + inline bool isLiveUIDEPRECATED(); + inline bool hasLiveUIDEPRECATED(); + inline ::cereal::LiveUI::Builder getLiveUIDEPRECATED(); + inline void setLiveUIDEPRECATED( ::cereal::LiveUI::Reader value); + inline ::cereal::LiveUI::Builder initLiveUIDEPRECATED(); + inline void adoptLiveUIDEPRECATED(::capnp::Orphan< ::cereal::LiveUI>&& value); + inline ::capnp::Orphan< ::cereal::LiveUI> disownLiveUIDEPRECATED(); + + inline bool isRoadEncodeIdx(); + inline bool hasRoadEncodeIdx(); + inline ::cereal::EncodeIndex::Builder getRoadEncodeIdx(); + inline void setRoadEncodeIdx( ::cereal::EncodeIndex::Reader value); + inline ::cereal::EncodeIndex::Builder initRoadEncodeIdx(); + inline void adoptRoadEncodeIdx(::capnp::Orphan< ::cereal::EncodeIndex>&& value); + inline ::capnp::Orphan< ::cereal::EncodeIndex> disownRoadEncodeIdx(); + + inline bool isLiveTracks(); + inline bool hasLiveTracks(); + inline ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>::Builder getLiveTracks(); + inline void setLiveTracks( ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>::Builder initLiveTracks(unsigned int size); + inline void adoptLiveTracks(::capnp::Orphan< ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>> disownLiveTracks(); + + inline bool isSendcan(); + inline bool hasSendcan(); + inline ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Builder getSendcan(); + inline void setSendcan( ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Builder initSendcan(unsigned int size); + inline void adoptSendcan(::capnp::Orphan< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>> disownSendcan(); + + inline bool isLogMessage(); + inline bool hasLogMessage(); + inline ::capnp::Text::Builder getLogMessage(); + inline void setLogMessage( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initLogMessage(unsigned int size); + inline void adoptLogMessage(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownLogMessage(); + + inline bool isLiveCalibration(); + inline bool hasLiveCalibration(); + inline ::cereal::LiveCalibrationData::Builder getLiveCalibration(); + inline void setLiveCalibration( ::cereal::LiveCalibrationData::Reader value); + inline ::cereal::LiveCalibrationData::Builder initLiveCalibration(); + inline void adoptLiveCalibration(::capnp::Orphan< ::cereal::LiveCalibrationData>&& value); + inline ::capnp::Orphan< ::cereal::LiveCalibrationData> disownLiveCalibration(); + + inline bool isAndroidLog(); + inline bool hasAndroidLog(); + inline ::cereal::AndroidLogEntry::Builder getAndroidLog(); + inline void setAndroidLog( ::cereal::AndroidLogEntry::Reader value); + inline ::cereal::AndroidLogEntry::Builder initAndroidLog(); + inline void adoptAndroidLog(::capnp::Orphan< ::cereal::AndroidLogEntry>&& value); + inline ::capnp::Orphan< ::cereal::AndroidLogEntry> disownAndroidLog(); + + inline bool isGpsLocationDEPRECATED(); + inline bool hasGpsLocationDEPRECATED(); + inline ::cereal::GpsLocationData::Builder getGpsLocationDEPRECATED(); + inline void setGpsLocationDEPRECATED( ::cereal::GpsLocationData::Reader value); + inline ::cereal::GpsLocationData::Builder initGpsLocationDEPRECATED(); + inline void adoptGpsLocationDEPRECATED(::capnp::Orphan< ::cereal::GpsLocationData>&& value); + inline ::capnp::Orphan< ::cereal::GpsLocationData> disownGpsLocationDEPRECATED(); + + inline bool isCarState(); + inline bool hasCarState(); + inline ::cereal::CarState::Builder getCarState(); + inline void setCarState( ::cereal::CarState::Reader value); + inline ::cereal::CarState::Builder initCarState(); + inline void adoptCarState(::capnp::Orphan< ::cereal::CarState>&& value); + inline ::capnp::Orphan< ::cereal::CarState> disownCarState(); + + inline bool isCarControl(); + inline bool hasCarControl(); + inline ::cereal::CarControl::Builder getCarControl(); + inline void setCarControl( ::cereal::CarControl::Reader value); + inline ::cereal::CarControl::Builder initCarControl(); + inline void adoptCarControl(::capnp::Orphan< ::cereal::CarControl>&& value); + inline ::capnp::Orphan< ::cereal::CarControl> disownCarControl(); + + inline bool isLongitudinalPlan(); + inline bool hasLongitudinalPlan(); + inline ::cereal::LongitudinalPlan::Builder getLongitudinalPlan(); + inline void setLongitudinalPlan( ::cereal::LongitudinalPlan::Reader value); + inline ::cereal::LongitudinalPlan::Builder initLongitudinalPlan(); + inline void adoptLongitudinalPlan(::capnp::Orphan< ::cereal::LongitudinalPlan>&& value); + inline ::capnp::Orphan< ::cereal::LongitudinalPlan> disownLongitudinalPlan(); + + inline bool isLiveLocationDEPRECATED(); + inline bool hasLiveLocationDEPRECATED(); + inline ::cereal::LiveLocationData::Builder getLiveLocationDEPRECATED(); + inline void setLiveLocationDEPRECATED( ::cereal::LiveLocationData::Reader value); + inline ::cereal::LiveLocationData::Builder initLiveLocationDEPRECATED(); + inline void adoptLiveLocationDEPRECATED(::capnp::Orphan< ::cereal::LiveLocationData>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationData> disownLiveLocationDEPRECATED(); + + inline bool isEthernetDataDEPRECATED(); + inline bool hasEthernetDataDEPRECATED(); + inline ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>::Builder getEthernetDataDEPRECATED(); + inline void setEthernetDataDEPRECATED( ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>::Builder initEthernetDataDEPRECATED(unsigned int size); + inline void adoptEthernetDataDEPRECATED(::capnp::Orphan< ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>> disownEthernetDataDEPRECATED(); + + inline bool isNavUpdateDEPRECATED(); + inline bool hasNavUpdateDEPRECATED(); + inline ::cereal::NavUpdate::Builder getNavUpdateDEPRECATED(); + inline void setNavUpdateDEPRECATED( ::cereal::NavUpdate::Reader value); + inline ::cereal::NavUpdate::Builder initNavUpdateDEPRECATED(); + inline void adoptNavUpdateDEPRECATED(::capnp::Orphan< ::cereal::NavUpdate>&& value); + inline ::capnp::Orphan< ::cereal::NavUpdate> disownNavUpdateDEPRECATED(); + + inline bool isCellInfoDEPRECATED(); + inline bool hasCellInfoDEPRECATED(); + inline ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>::Builder getCellInfoDEPRECATED(); + inline void setCellInfoDEPRECATED( ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>::Builder initCellInfoDEPRECATED(unsigned int size); + inline void adoptCellInfoDEPRECATED(::capnp::Orphan< ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>> disownCellInfoDEPRECATED(); + + inline bool isWifiScanDEPRECATED(); + inline bool hasWifiScanDEPRECATED(); + inline ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>::Builder getWifiScanDEPRECATED(); + inline void setWifiScanDEPRECATED( ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>::Builder initWifiScanDEPRECATED(unsigned int size); + inline void adoptWifiScanDEPRECATED(::capnp::Orphan< ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>> disownWifiScanDEPRECATED(); + + inline bool isAndroidGnssDEPRECATED(); + inline bool hasAndroidGnssDEPRECATED(); + inline ::cereal::AndroidGnss::Builder getAndroidGnssDEPRECATED(); + inline void setAndroidGnssDEPRECATED( ::cereal::AndroidGnss::Reader value); + inline ::cereal::AndroidGnss::Builder initAndroidGnssDEPRECATED(); + inline void adoptAndroidGnssDEPRECATED(::capnp::Orphan< ::cereal::AndroidGnss>&& value); + inline ::capnp::Orphan< ::cereal::AndroidGnss> disownAndroidGnssDEPRECATED(); + + inline bool isQcomGnssDEPRECATD(); + inline bool hasQcomGnssDEPRECATD(); + inline ::cereal::QcomGnss::Builder getQcomGnssDEPRECATD(); + inline void setQcomGnssDEPRECATD( ::cereal::QcomGnss::Reader value); + inline ::cereal::QcomGnss::Builder initQcomGnssDEPRECATD(); + inline void adoptQcomGnssDEPRECATD(::capnp::Orphan< ::cereal::QcomGnss>&& value); + inline ::capnp::Orphan< ::cereal::QcomGnss> disownQcomGnssDEPRECATD(); + + inline bool isLidarPtsDEPRECATED(); + inline bool hasLidarPtsDEPRECATED(); + inline ::cereal::LidarPts::Builder getLidarPtsDEPRECATED(); + inline void setLidarPtsDEPRECATED( ::cereal::LidarPts::Reader value); + inline ::cereal::LidarPts::Builder initLidarPtsDEPRECATED(); + inline void adoptLidarPtsDEPRECATED(::capnp::Orphan< ::cereal::LidarPts>&& value); + inline ::capnp::Orphan< ::cereal::LidarPts> disownLidarPtsDEPRECATED(); + + inline bool isProcLog(); + inline bool hasProcLog(); + inline ::cereal::ProcLog::Builder getProcLog(); + inline void setProcLog( ::cereal::ProcLog::Reader value); + inline ::cereal::ProcLog::Builder initProcLog(); + inline void adoptProcLog(::capnp::Orphan< ::cereal::ProcLog>&& value); + inline ::capnp::Orphan< ::cereal::ProcLog> disownProcLog(); + + inline bool isUbloxGnss(); + inline bool hasUbloxGnss(); + inline ::cereal::UbloxGnss::Builder getUbloxGnss(); + inline void setUbloxGnss( ::cereal::UbloxGnss::Reader value); + inline ::cereal::UbloxGnss::Builder initUbloxGnss(); + inline void adoptUbloxGnss(::capnp::Orphan< ::cereal::UbloxGnss>&& value); + inline ::capnp::Orphan< ::cereal::UbloxGnss> disownUbloxGnss(); + + inline bool isClocks(); + inline bool hasClocks(); + inline ::cereal::Clocks::Builder getClocks(); + inline void setClocks( ::cereal::Clocks::Reader value); + inline ::cereal::Clocks::Builder initClocks(); + inline void adoptClocks(::capnp::Orphan< ::cereal::Clocks>&& value); + inline ::capnp::Orphan< ::cereal::Clocks> disownClocks(); + + inline bool isLiveMpcDEPRECATED(); + inline bool hasLiveMpcDEPRECATED(); + inline ::cereal::LiveMpcData::Builder getLiveMpcDEPRECATED(); + inline void setLiveMpcDEPRECATED( ::cereal::LiveMpcData::Reader value); + inline ::cereal::LiveMpcData::Builder initLiveMpcDEPRECATED(); + inline void adoptLiveMpcDEPRECATED(::capnp::Orphan< ::cereal::LiveMpcData>&& value); + inline ::capnp::Orphan< ::cereal::LiveMpcData> disownLiveMpcDEPRECATED(); + + inline bool isLiveLongitudinalMpcDEPRECATED(); + inline bool hasLiveLongitudinalMpcDEPRECATED(); + inline ::cereal::LiveLongitudinalMpcData::Builder getLiveLongitudinalMpcDEPRECATED(); + inline void setLiveLongitudinalMpcDEPRECATED( ::cereal::LiveLongitudinalMpcData::Reader value); + inline ::cereal::LiveLongitudinalMpcData::Builder initLiveLongitudinalMpcDEPRECATED(); + inline void adoptLiveLongitudinalMpcDEPRECATED(::capnp::Orphan< ::cereal::LiveLongitudinalMpcData>&& value); + inline ::capnp::Orphan< ::cereal::LiveLongitudinalMpcData> disownLiveLongitudinalMpcDEPRECATED(); + + inline bool isNavStatusDEPRECATED(); + inline bool hasNavStatusDEPRECATED(); + inline ::cereal::NavStatus::Builder getNavStatusDEPRECATED(); + inline void setNavStatusDEPRECATED( ::cereal::NavStatus::Reader value); + inline ::cereal::NavStatus::Builder initNavStatusDEPRECATED(); + inline void adoptNavStatusDEPRECATED(::capnp::Orphan< ::cereal::NavStatus>&& value); + inline ::capnp::Orphan< ::cereal::NavStatus> disownNavStatusDEPRECATED(); + + inline bool isUbloxRaw(); + inline bool hasUbloxRaw(); + inline ::capnp::Data::Builder getUbloxRaw(); + inline void setUbloxRaw( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initUbloxRaw(unsigned int size); + inline void adoptUbloxRaw(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownUbloxRaw(); + + inline bool isGpsPlannerPointsDEPRECATED(); + inline bool hasGpsPlannerPointsDEPRECATED(); + inline ::cereal::GPSPlannerPoints::Builder getGpsPlannerPointsDEPRECATED(); + inline void setGpsPlannerPointsDEPRECATED( ::cereal::GPSPlannerPoints::Reader value); + inline ::cereal::GPSPlannerPoints::Builder initGpsPlannerPointsDEPRECATED(); + inline void adoptGpsPlannerPointsDEPRECATED(::capnp::Orphan< ::cereal::GPSPlannerPoints>&& value); + inline ::capnp::Orphan< ::cereal::GPSPlannerPoints> disownGpsPlannerPointsDEPRECATED(); + + inline bool isGpsPlannerPlanDEPRECATED(); + inline bool hasGpsPlannerPlanDEPRECATED(); + inline ::cereal::GPSPlannerPlan::Builder getGpsPlannerPlanDEPRECATED(); + inline void setGpsPlannerPlanDEPRECATED( ::cereal::GPSPlannerPlan::Reader value); + inline ::cereal::GPSPlannerPlan::Builder initGpsPlannerPlanDEPRECATED(); + inline void adoptGpsPlannerPlanDEPRECATED(::capnp::Orphan< ::cereal::GPSPlannerPlan>&& value); + inline ::capnp::Orphan< ::cereal::GPSPlannerPlan> disownGpsPlannerPlanDEPRECATED(); + + inline bool isApplanixRawDEPRECATED(); + inline bool hasApplanixRawDEPRECATED(); + inline ::capnp::Data::Builder getApplanixRawDEPRECATED(); + inline void setApplanixRawDEPRECATED( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initApplanixRawDEPRECATED(unsigned int size); + inline void adoptApplanixRawDEPRECATED(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownApplanixRawDEPRECATED(); + + inline bool isTrafficEventsDEPRECATED(); + inline bool hasTrafficEventsDEPRECATED(); + inline ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>::Builder getTrafficEventsDEPRECATED(); + inline void setTrafficEventsDEPRECATED( ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>::Builder initTrafficEventsDEPRECATED(unsigned int size); + inline void adoptTrafficEventsDEPRECATED(::capnp::Orphan< ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>> disownTrafficEventsDEPRECATED(); + + inline bool isLiveLocationTimingDEPRECATED(); + inline bool hasLiveLocationTimingDEPRECATED(); + inline ::cereal::LiveLocationData::Builder getLiveLocationTimingDEPRECATED(); + inline void setLiveLocationTimingDEPRECATED( ::cereal::LiveLocationData::Reader value); + inline ::cereal::LiveLocationData::Builder initLiveLocationTimingDEPRECATED(); + inline void adoptLiveLocationTimingDEPRECATED(::capnp::Orphan< ::cereal::LiveLocationData>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationData> disownLiveLocationTimingDEPRECATED(); + + inline bool isOrbslamCorrectionDEPRECATED(); + inline bool hasOrbslamCorrectionDEPRECATED(); + inline ::cereal::OrbslamCorrection::Builder getOrbslamCorrectionDEPRECATED(); + inline void setOrbslamCorrectionDEPRECATED( ::cereal::OrbslamCorrection::Reader value); + inline ::cereal::OrbslamCorrection::Builder initOrbslamCorrectionDEPRECATED(); + inline void adoptOrbslamCorrectionDEPRECATED(::capnp::Orphan< ::cereal::OrbslamCorrection>&& value); + inline ::capnp::Orphan< ::cereal::OrbslamCorrection> disownOrbslamCorrectionDEPRECATED(); + + inline bool isLiveLocationCorrectedDEPRECATED(); + inline bool hasLiveLocationCorrectedDEPRECATED(); + inline ::cereal::LiveLocationData::Builder getLiveLocationCorrectedDEPRECATED(); + inline void setLiveLocationCorrectedDEPRECATED( ::cereal::LiveLocationData::Reader value); + inline ::cereal::LiveLocationData::Builder initLiveLocationCorrectedDEPRECATED(); + inline void adoptLiveLocationCorrectedDEPRECATED(::capnp::Orphan< ::cereal::LiveLocationData>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationData> disownLiveLocationCorrectedDEPRECATED(); + + inline bool isOrbObservationDEPRECATED(); + inline bool hasOrbObservationDEPRECATED(); + inline ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>::Builder getOrbObservationDEPRECATED(); + inline void setOrbObservationDEPRECATED( ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>::Builder initOrbObservationDEPRECATED(unsigned int size); + inline void adoptOrbObservationDEPRECATED(::capnp::Orphan< ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>> disownOrbObservationDEPRECATED(); + + inline bool isGpsLocationExternal(); + inline bool hasGpsLocationExternal(); + inline ::cereal::GpsLocationData::Builder getGpsLocationExternal(); + inline void setGpsLocationExternal( ::cereal::GpsLocationData::Reader value); + inline ::cereal::GpsLocationData::Builder initGpsLocationExternal(); + inline void adoptGpsLocationExternal(::capnp::Orphan< ::cereal::GpsLocationData>&& value); + inline ::capnp::Orphan< ::cereal::GpsLocationData> disownGpsLocationExternal(); + + inline bool isLocationDEPRECATED(); + inline bool hasLocationDEPRECATED(); + inline ::cereal::LiveLocationData::Builder getLocationDEPRECATED(); + inline void setLocationDEPRECATED( ::cereal::LiveLocationData::Reader value); + inline ::cereal::LiveLocationData::Builder initLocationDEPRECATED(); + inline void adoptLocationDEPRECATED(::capnp::Orphan< ::cereal::LiveLocationData>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationData> disownLocationDEPRECATED(); + + inline bool isUiNavigationEventDEPRECATED(); + inline bool hasUiNavigationEventDEPRECATED(); + inline ::cereal::UiNavigationEvent::Builder getUiNavigationEventDEPRECATED(); + inline void setUiNavigationEventDEPRECATED( ::cereal::UiNavigationEvent::Reader value); + inline ::cereal::UiNavigationEvent::Builder initUiNavigationEventDEPRECATED(); + inline void adoptUiNavigationEventDEPRECATED(::capnp::Orphan< ::cereal::UiNavigationEvent>&& value); + inline ::capnp::Orphan< ::cereal::UiNavigationEvent> disownUiNavigationEventDEPRECATED(); + + inline bool isLiveLocationKalmanDEPRECATED(); + inline bool hasLiveLocationKalmanDEPRECATED(); + inline ::cereal::LiveLocationData::Builder getLiveLocationKalmanDEPRECATED(); + inline void setLiveLocationKalmanDEPRECATED( ::cereal::LiveLocationData::Reader value); + inline ::cereal::LiveLocationData::Builder initLiveLocationKalmanDEPRECATED(); + inline void adoptLiveLocationKalmanDEPRECATED(::capnp::Orphan< ::cereal::LiveLocationData>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationData> disownLiveLocationKalmanDEPRECATED(); + + inline bool isTestJoystick(); + inline bool hasTestJoystick(); + inline ::cereal::Joystick::Builder getTestJoystick(); + inline void setTestJoystick( ::cereal::Joystick::Reader value); + inline ::cereal::Joystick::Builder initTestJoystick(); + inline void adoptTestJoystick(::capnp::Orphan< ::cereal::Joystick>&& value); + inline ::capnp::Orphan< ::cereal::Joystick> disownTestJoystick(); + + inline bool isOrbOdometryDEPRECATED(); + inline bool hasOrbOdometryDEPRECATED(); + inline ::cereal::OrbOdometry::Builder getOrbOdometryDEPRECATED(); + inline void setOrbOdometryDEPRECATED( ::cereal::OrbOdometry::Reader value); + inline ::cereal::OrbOdometry::Builder initOrbOdometryDEPRECATED(); + inline void adoptOrbOdometryDEPRECATED(::capnp::Orphan< ::cereal::OrbOdometry>&& value); + inline ::capnp::Orphan< ::cereal::OrbOdometry> disownOrbOdometryDEPRECATED(); + + inline bool isOrbFeaturesDEPRECATED(); + inline bool hasOrbFeaturesDEPRECATED(); + inline ::cereal::OrbFeatures::Builder getOrbFeaturesDEPRECATED(); + inline void setOrbFeaturesDEPRECATED( ::cereal::OrbFeatures::Reader value); + inline ::cereal::OrbFeatures::Builder initOrbFeaturesDEPRECATED(); + inline void adoptOrbFeaturesDEPRECATED(::capnp::Orphan< ::cereal::OrbFeatures>&& value); + inline ::capnp::Orphan< ::cereal::OrbFeatures> disownOrbFeaturesDEPRECATED(); + + inline bool isApplanixLocationDEPRECATED(); + inline bool hasApplanixLocationDEPRECATED(); + inline ::cereal::LiveLocationData::Builder getApplanixLocationDEPRECATED(); + inline void setApplanixLocationDEPRECATED( ::cereal::LiveLocationData::Reader value); + inline ::cereal::LiveLocationData::Builder initApplanixLocationDEPRECATED(); + inline void adoptApplanixLocationDEPRECATED(::capnp::Orphan< ::cereal::LiveLocationData>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationData> disownApplanixLocationDEPRECATED(); + + inline bool isOrbKeyFrameDEPRECATED(); + inline bool hasOrbKeyFrameDEPRECATED(); + inline ::cereal::OrbKeyFrame::Builder getOrbKeyFrameDEPRECATED(); + inline void setOrbKeyFrameDEPRECATED( ::cereal::OrbKeyFrame::Reader value); + inline ::cereal::OrbKeyFrame::Builder initOrbKeyFrameDEPRECATED(); + inline void adoptOrbKeyFrameDEPRECATED(::capnp::Orphan< ::cereal::OrbKeyFrame>&& value); + inline ::capnp::Orphan< ::cereal::OrbKeyFrame> disownOrbKeyFrameDEPRECATED(); + + inline bool isUiLayoutStateDEPRECATED(); + inline bool hasUiLayoutStateDEPRECATED(); + inline ::cereal::UiLayoutState::Builder getUiLayoutStateDEPRECATED(); + inline void setUiLayoutStateDEPRECATED( ::cereal::UiLayoutState::Reader value); + inline ::cereal::UiLayoutState::Builder initUiLayoutStateDEPRECATED(); + inline void adoptUiLayoutStateDEPRECATED(::capnp::Orphan< ::cereal::UiLayoutState>&& value); + inline ::capnp::Orphan< ::cereal::UiLayoutState> disownUiLayoutStateDEPRECATED(); + + inline bool isOrbFeaturesSummaryDEPRECATED(); + inline bool hasOrbFeaturesSummaryDEPRECATED(); + inline ::cereal::OrbFeaturesSummary::Builder getOrbFeaturesSummaryDEPRECATED(); + inline void setOrbFeaturesSummaryDEPRECATED( ::cereal::OrbFeaturesSummary::Reader value); + inline ::cereal::OrbFeaturesSummary::Builder initOrbFeaturesSummaryDEPRECATED(); + inline void adoptOrbFeaturesSummaryDEPRECATED(::capnp::Orphan< ::cereal::OrbFeaturesSummary>&& value); + inline ::capnp::Orphan< ::cereal::OrbFeaturesSummary> disownOrbFeaturesSummaryDEPRECATED(); + + inline bool isDriverState(); + inline bool hasDriverState(); + inline ::cereal::DriverState::Builder getDriverState(); + inline void setDriverState( ::cereal::DriverState::Reader value); + inline ::cereal::DriverState::Builder initDriverState(); + inline void adoptDriverState(::capnp::Orphan< ::cereal::DriverState>&& value); + inline ::capnp::Orphan< ::cereal::DriverState> disownDriverState(); + + inline bool isBoot(); + inline bool hasBoot(); + inline ::cereal::Boot::Builder getBoot(); + inline void setBoot( ::cereal::Boot::Reader value); + inline ::cereal::Boot::Builder initBoot(); + inline void adoptBoot(::capnp::Orphan< ::cereal::Boot>&& value); + inline ::capnp::Orphan< ::cereal::Boot> disownBoot(); + + inline bool isLiveParameters(); + inline bool hasLiveParameters(); + inline ::cereal::LiveParametersData::Builder getLiveParameters(); + inline void setLiveParameters( ::cereal::LiveParametersData::Reader value); + inline ::cereal::LiveParametersData::Builder initLiveParameters(); + inline void adoptLiveParameters(::capnp::Orphan< ::cereal::LiveParametersData>&& value); + inline ::capnp::Orphan< ::cereal::LiveParametersData> disownLiveParameters(); + + inline bool isLiveMapDataDEPRECATED(); + inline bool hasLiveMapDataDEPRECATED(); + inline ::cereal::LiveMapDataDEPRECATED::Builder getLiveMapDataDEPRECATED(); + inline void setLiveMapDataDEPRECATED( ::cereal::LiveMapDataDEPRECATED::Reader value); + inline ::cereal::LiveMapDataDEPRECATED::Builder initLiveMapDataDEPRECATED(); + inline void adoptLiveMapDataDEPRECATED(::capnp::Orphan< ::cereal::LiveMapDataDEPRECATED>&& value); + inline ::capnp::Orphan< ::cereal::LiveMapDataDEPRECATED> disownLiveMapDataDEPRECATED(); + + inline bool isCameraOdometry(); + inline bool hasCameraOdometry(); + inline ::cereal::CameraOdometry::Builder getCameraOdometry(); + inline void setCameraOdometry( ::cereal::CameraOdometry::Reader value); + inline ::cereal::CameraOdometry::Builder initCameraOdometry(); + inline void adoptCameraOdometry(::capnp::Orphan< ::cereal::CameraOdometry>&& value); + inline ::capnp::Orphan< ::cereal::CameraOdometry> disownCameraOdometry(); + + inline bool isLateralPlan(); + inline bool hasLateralPlan(); + inline ::cereal::LateralPlan::Builder getLateralPlan(); + inline void setLateralPlan( ::cereal::LateralPlan::Reader value); + inline ::cereal::LateralPlan::Builder initLateralPlan(); + inline void adoptLateralPlan(::capnp::Orphan< ::cereal::LateralPlan>&& value); + inline ::capnp::Orphan< ::cereal::LateralPlan> disownLateralPlan(); + + inline bool isKalmanOdometryDEPRECATED(); + inline bool hasKalmanOdometryDEPRECATED(); + inline ::cereal::KalmanOdometry::Builder getKalmanOdometryDEPRECATED(); + inline void setKalmanOdometryDEPRECATED( ::cereal::KalmanOdometry::Reader value); + inline ::cereal::KalmanOdometry::Builder initKalmanOdometryDEPRECATED(); + inline void adoptKalmanOdometryDEPRECATED(::capnp::Orphan< ::cereal::KalmanOdometry>&& value); + inline ::capnp::Orphan< ::cereal::KalmanOdometry> disownKalmanOdometryDEPRECATED(); + + inline bool isThumbnail(); + inline bool hasThumbnail(); + inline ::cereal::Thumbnail::Builder getThumbnail(); + inline void setThumbnail( ::cereal::Thumbnail::Reader value); + inline ::cereal::Thumbnail::Builder initThumbnail(); + inline void adoptThumbnail(::capnp::Orphan< ::cereal::Thumbnail>&& value); + inline ::capnp::Orphan< ::cereal::Thumbnail> disownThumbnail(); + + inline bool getValid(); + inline void setValid(bool value); + + inline bool isCarEvents(); + inline bool hasCarEvents(); + inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder getCarEvents(); + inline void setCarEvents( ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder initCarEvents(unsigned int size); + inline void adoptCarEvents(::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>> disownCarEvents(); + + inline bool isCarParams(); + inline bool hasCarParams(); + inline ::cereal::CarParams::Builder getCarParams(); + inline void setCarParams( ::cereal::CarParams::Reader value); + inline ::cereal::CarParams::Builder initCarParams(); + inline void adoptCarParams(::capnp::Orphan< ::cereal::CarParams>&& value); + inline ::capnp::Orphan< ::cereal::CarParams> disownCarParams(); + + inline bool isDriverCameraState(); + inline bool hasDriverCameraState(); + inline ::cereal::FrameData::Builder getDriverCameraState(); + inline void setDriverCameraState( ::cereal::FrameData::Reader value); + inline ::cereal::FrameData::Builder initDriverCameraState(); + inline void adoptDriverCameraState(::capnp::Orphan< ::cereal::FrameData>&& value); + inline ::capnp::Orphan< ::cereal::FrameData> disownDriverCameraState(); + + inline bool isDriverMonitoringState(); + inline bool hasDriverMonitoringState(); + inline ::cereal::DriverMonitoringState::Builder getDriverMonitoringState(); + inline void setDriverMonitoringState( ::cereal::DriverMonitoringState::Reader value); + inline ::cereal::DriverMonitoringState::Builder initDriverMonitoringState(); + inline void adoptDriverMonitoringState(::capnp::Orphan< ::cereal::DriverMonitoringState>&& value); + inline ::capnp::Orphan< ::cereal::DriverMonitoringState> disownDriverMonitoringState(); + + inline bool isLiveLocationKalman(); + inline bool hasLiveLocationKalman(); + inline ::cereal::LiveLocationKalman::Builder getLiveLocationKalman(); + inline void setLiveLocationKalman( ::cereal::LiveLocationKalman::Reader value); + inline ::cereal::LiveLocationKalman::Builder initLiveLocationKalman(); + inline void adoptLiveLocationKalman(::capnp::Orphan< ::cereal::LiveLocationKalman>&& value); + inline ::capnp::Orphan< ::cereal::LiveLocationKalman> disownLiveLocationKalman(); + + inline bool isSentinel(); + inline bool hasSentinel(); + inline ::cereal::Sentinel::Builder getSentinel(); + inline void setSentinel( ::cereal::Sentinel::Reader value); + inline ::cereal::Sentinel::Builder initSentinel(); + inline void adoptSentinel(::capnp::Orphan< ::cereal::Sentinel>&& value); + inline ::capnp::Orphan< ::cereal::Sentinel> disownSentinel(); + + inline bool isWideRoadCameraState(); + inline bool hasWideRoadCameraState(); + inline ::cereal::FrameData::Builder getWideRoadCameraState(); + inline void setWideRoadCameraState( ::cereal::FrameData::Reader value); + inline ::cereal::FrameData::Builder initWideRoadCameraState(); + inline void adoptWideRoadCameraState(::capnp::Orphan< ::cereal::FrameData>&& value); + inline ::capnp::Orphan< ::cereal::FrameData> disownWideRoadCameraState(); + + inline bool isModelV2(); + inline bool hasModelV2(); + inline ::cereal::ModelDataV2::Builder getModelV2(); + inline void setModelV2( ::cereal::ModelDataV2::Reader value); + inline ::cereal::ModelDataV2::Builder initModelV2(); + inline void adoptModelV2(::capnp::Orphan< ::cereal::ModelDataV2>&& value); + inline ::capnp::Orphan< ::cereal::ModelDataV2> disownModelV2(); + + inline bool isDriverEncodeIdx(); + inline bool hasDriverEncodeIdx(); + inline ::cereal::EncodeIndex::Builder getDriverEncodeIdx(); + inline void setDriverEncodeIdx( ::cereal::EncodeIndex::Reader value); + inline ::cereal::EncodeIndex::Builder initDriverEncodeIdx(); + inline void adoptDriverEncodeIdx(::capnp::Orphan< ::cereal::EncodeIndex>&& value); + inline ::capnp::Orphan< ::cereal::EncodeIndex> disownDriverEncodeIdx(); + + inline bool isWideRoadEncodeIdx(); + inline bool hasWideRoadEncodeIdx(); + inline ::cereal::EncodeIndex::Builder getWideRoadEncodeIdx(); + inline void setWideRoadEncodeIdx( ::cereal::EncodeIndex::Reader value); + inline ::cereal::EncodeIndex::Builder initWideRoadEncodeIdx(); + inline void adoptWideRoadEncodeIdx(::capnp::Orphan< ::cereal::EncodeIndex>&& value); + inline ::capnp::Orphan< ::cereal::EncodeIndex> disownWideRoadEncodeIdx(); + + inline bool isManagerState(); + inline bool hasManagerState(); + inline ::cereal::ManagerState::Builder getManagerState(); + inline void setManagerState( ::cereal::ManagerState::Reader value); + inline ::cereal::ManagerState::Builder initManagerState(); + inline void adoptManagerState(::capnp::Orphan< ::cereal::ManagerState>&& value); + inline ::capnp::Orphan< ::cereal::ManagerState> disownManagerState(); + + inline bool isUploaderState(); + inline bool hasUploaderState(); + inline ::cereal::UploaderState::Builder getUploaderState(); + inline void setUploaderState( ::cereal::UploaderState::Reader value); + inline ::cereal::UploaderState::Builder initUploaderState(); + inline void adoptUploaderState(::capnp::Orphan< ::cereal::UploaderState>&& value); + inline ::capnp::Orphan< ::cereal::UploaderState> disownUploaderState(); + + inline bool isPeripheralState(); + inline bool hasPeripheralState(); + inline ::cereal::PeripheralState::Builder getPeripheralState(); + inline void setPeripheralState( ::cereal::PeripheralState::Reader value); + inline ::cereal::PeripheralState::Builder initPeripheralState(); + inline void adoptPeripheralState(::capnp::Orphan< ::cereal::PeripheralState>&& value); + inline ::capnp::Orphan< ::cereal::PeripheralState> disownPeripheralState(); + + inline bool isPandaStates(); + inline bool hasPandaStates(); + inline ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>::Builder getPandaStates(); + inline void setPandaStates( ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>::Reader value); + inline ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>::Builder initPandaStates(unsigned int size); + inline void adoptPandaStates(::capnp::Orphan< ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>>&& value); + inline ::capnp::Orphan< ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>> disownPandaStates(); + + inline bool isNavInstruction(); + inline bool hasNavInstruction(); + inline ::cereal::NavInstruction::Builder getNavInstruction(); + inline void setNavInstruction( ::cereal::NavInstruction::Reader value); + inline ::cereal::NavInstruction::Builder initNavInstruction(); + inline void adoptNavInstruction(::capnp::Orphan< ::cereal::NavInstruction>&& value); + inline ::capnp::Orphan< ::cereal::NavInstruction> disownNavInstruction(); + + inline bool isNavRoute(); + inline bool hasNavRoute(); + inline ::cereal::NavRoute::Builder getNavRoute(); + inline void setNavRoute( ::cereal::NavRoute::Reader value); + inline ::cereal::NavRoute::Builder initNavRoute(); + inline void adoptNavRoute(::capnp::Orphan< ::cereal::NavRoute>&& value); + inline ::capnp::Orphan< ::cereal::NavRoute> disownNavRoute(); + + inline bool isNavThumbnail(); + inline bool hasNavThumbnail(); + inline ::cereal::Thumbnail::Builder getNavThumbnail(); + inline void setNavThumbnail( ::cereal::Thumbnail::Reader value); + inline ::cereal::Thumbnail::Builder initNavThumbnail(); + inline void adoptNavThumbnail(::capnp::Orphan< ::cereal::Thumbnail>&& value); + inline ::capnp::Orphan< ::cereal::Thumbnail> disownNavThumbnail(); + + inline bool isErrorLogMessage(); + inline bool hasErrorLogMessage(); + inline ::capnp::Text::Builder getErrorLogMessage(); + inline void setErrorLogMessage( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initErrorLogMessage(unsigned int size); + inline void adoptErrorLogMessage(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownErrorLogMessage(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Event::Pipeline { +public: + typedef Event Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +// ======================================================================================= + +template +inline bool Map::Reader::hasEntries() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +template +inline bool Map::Builder::hasEntries() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +template +inline typename ::capnp::List::Entry, ::capnp::Kind::STRUCT>::Reader Map::Reader::getEntries() const { + return ::capnp::_::PointerHelpers< ::capnp::List::Entry, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +template +inline typename ::capnp::List::Entry, ::capnp::Kind::STRUCT>::Builder Map::Builder::getEntries() { + return ::capnp::_::PointerHelpers< ::capnp::List::Entry, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +template +inline void Map::Builder::setEntries(typename ::capnp::List::Entry, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List::Entry, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +template +inline typename ::capnp::List::Entry, ::capnp::Kind::STRUCT>::Builder Map::Builder::initEntries(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List::Entry, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +template +inline void Map::Builder::adoptEntries( + ::capnp::Orphan< ::capnp::List::Entry, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List::Entry, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +template +inline ::capnp::Orphan< ::capnp::List::Entry, ::capnp::Kind::STRUCT>> Map::Builder::disownEntries() { + return ::capnp::_::PointerHelpers< ::capnp::List::Entry, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +template +inline bool Map::Entry::Reader::hasKey() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +template +inline bool Map::Entry::Builder::hasKey() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +template +inline ::capnp::ReaderFor Map::Entry::Reader::getKey() const { + return ::capnp::_::PointerHelpers::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +template +inline ::capnp::BuilderFor Map::Entry::Builder::getKey() { + return ::capnp::_::PointerHelpers::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +template +inline ::capnp::PipelineFor Map::Entry::Pipeline::getKey() { + return ::capnp::PipelineFor(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +template +inline void Map::Entry::Builder::setKey( ::capnp::ReaderFor value) { + ::capnp::_::PointerHelpers::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +template +inline ::capnp::BuilderFor Map::Entry::Builder::initKey() { + return ::capnp::_::PointerHelpers::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +template +inline ::capnp::BuilderFor Map::Entry::Builder::initKey(unsigned int size) { + return ::capnp::_::PointerHelpers::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +template +inline void Map::Entry::Builder::adoptKey( + ::capnp::Orphan&& value) { + ::capnp::_::PointerHelpers::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +template +inline ::capnp::Orphan Map::Entry::Builder::disownKey() { + return ::capnp::_::PointerHelpers::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +template +inline bool Map::Entry::Reader::hasValue() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +template +inline bool Map::Entry::Builder::hasValue() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +template +inline ::capnp::ReaderFor Map::Entry::Reader::getValue() const { + return ::capnp::_::PointerHelpers::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +template +inline ::capnp::BuilderFor Map::Entry::Builder::getValue() { + return ::capnp::_::PointerHelpers::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +template +inline ::capnp::PipelineFor Map::Entry::Pipeline::getValue() { + return ::capnp::PipelineFor(_typeless.getPointerField(1)); +} +#endif // !CAPNP_LITE +template +inline void Map::Entry::Builder::setValue( ::capnp::ReaderFor value) { + ::capnp::_::PointerHelpers::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +template +inline ::capnp::BuilderFor Map::Entry::Builder::initValue() { + return ::capnp::_::PointerHelpers::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +template +inline ::capnp::BuilderFor Map::Entry::Builder::initValue(unsigned int size) { + return ::capnp::_::PointerHelpers::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +template +inline void Map::Entry::Builder::adoptValue( + ::capnp::Orphan&& value) { + ::capnp::_::PointerHelpers::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +template +inline ::capnp::Orphan Map::Entry::Builder::disownValue() { + return ::capnp::_::PointerHelpers::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +// Map::Entry +template +constexpr uint16_t Map::Entry::_capnpPrivate::dataWordSize; +template +constexpr uint16_t Map::Entry::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +template +constexpr ::capnp::Kind Map::Entry::_capnpPrivate::kind; +template +constexpr ::capnp::_::RawSchema const* Map::Entry::_capnpPrivate::schema; +template +const ::capnp::_::RawBrandedSchema::Scope Map::Entry::_capnpPrivate::brandScopes[] = { + { 0xf8b13ce2183eb696, brandBindings + 0, 2, false}, +}; +template +const ::capnp::_::RawBrandedSchema::Binding Map::Entry::_capnpPrivate::brandBindings[] = { + ::capnp::_::brandBindingFor(), + ::capnp::_::brandBindingFor(), +}; +template +const ::capnp::_::RawBrandedSchema Map::Entry::_capnpPrivate::specificBrand = { + &::capnp::schemas::s_a5dfdd084a6eea0e, brandScopes, nullptr, + 1, 0, nullptr +}; +#endif // !CAPNP_LITE + +// Map +template +constexpr uint16_t Map::_capnpPrivate::dataWordSize; +template +constexpr uint16_t Map::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +template +constexpr ::capnp::Kind Map::_capnpPrivate::kind; +template +constexpr ::capnp::_::RawSchema const* Map::_capnpPrivate::schema; +template +const ::capnp::_::RawBrandedSchema::Scope Map::_capnpPrivate::brandScopes[] = { + { 0xf8b13ce2183eb696, brandBindings + 0, 2, false}, +}; +template +const ::capnp::_::RawBrandedSchema::Binding Map::_capnpPrivate::brandBindings[] = { + ::capnp::_::brandBindingFor(), + ::capnp::_::brandBindingFor(), +}; +template +const ::capnp::_::RawBrandedSchema::Dependency Map::_capnpPrivate::brandDependencies[] = { + { 16777216, ::cereal::Map::Entry::_capnpPrivate::brand() }, +}; +template +const ::capnp::_::RawBrandedSchema Map::_capnpPrivate::specificBrand = { + &::capnp::schemas::s_f8b13ce2183eb696, brandScopes, brandDependencies, + 1, 1, nullptr +}; +#endif // !CAPNP_LITE + +inline bool InitData::Reader::hasKernelArgs() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasKernelArgs() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Reader InitData::Reader::getKernelArgs() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Builder InitData::Builder::getKernelArgs() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::setKernelArgs( ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void InitData::Builder::setKernelArgs(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Builder InitData::Builder::initKernelArgs(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void InitData::Builder::adoptKernelArgs( + ::capnp::Orphan< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>> InitData::Builder::disownKernelArgs() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool InitData::Reader::hasGctxDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasGctxDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::Reader::getGctxDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::Builder::getGctxDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::setGctxDEPRECATED( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::Builder::initGctxDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void InitData::Builder::adoptGctxDEPRECATED( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::Builder::disownGctxDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool InitData::Reader::hasDongleId() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasDongleId() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::Reader::getDongleId() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::Builder::getDongleId() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::setDongleId( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::Builder::initDongleId(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void InitData::Builder::adoptDongleId( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::Builder::disownDongleId() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline ::cereal::InitData::DeviceType InitData::Reader::getDeviceType() const { + return _reader.getDataField< ::cereal::InitData::DeviceType>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::cereal::InitData::DeviceType InitData::Builder::getDeviceType() { + return _builder.getDataField< ::cereal::InitData::DeviceType>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void InitData::Builder::setDeviceType( ::cereal::InitData::DeviceType value) { + _builder.setDataField< ::cereal::InitData::DeviceType>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool InitData::Reader::hasVersion() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasVersion() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::Reader::getVersion() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::Builder::getVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::setVersion( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::Builder::initVersion(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void InitData::Builder::adoptVersion( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::Builder::disownVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool InitData::Reader::hasAndroidBuildInfo() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasAndroidBuildInfo() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::InitData::AndroidBuildInfo::Reader InitData::Reader::getAndroidBuildInfo() const { + return ::capnp::_::PointerHelpers< ::cereal::InitData::AndroidBuildInfo>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::cereal::InitData::AndroidBuildInfo::Builder InitData::Builder::getAndroidBuildInfo() { + return ::capnp::_::PointerHelpers< ::cereal::InitData::AndroidBuildInfo>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::InitData::AndroidBuildInfo::Pipeline InitData::Pipeline::getAndroidBuildInfo() { + return ::cereal::InitData::AndroidBuildInfo::Pipeline(_typeless.getPointerField(4)); +} +#endif // !CAPNP_LITE +inline void InitData::Builder::setAndroidBuildInfo( ::cereal::InitData::AndroidBuildInfo::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::InitData::AndroidBuildInfo>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::cereal::InitData::AndroidBuildInfo::Builder InitData::Builder::initAndroidBuildInfo() { + return ::capnp::_::PointerHelpers< ::cereal::InitData::AndroidBuildInfo>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::adoptAndroidBuildInfo( + ::capnp::Orphan< ::cereal::InitData::AndroidBuildInfo>&& value) { + ::capnp::_::PointerHelpers< ::cereal::InitData::AndroidBuildInfo>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::InitData::AndroidBuildInfo> InitData::Builder::disownAndroidBuildInfo() { + return ::capnp::_::PointerHelpers< ::cereal::InitData::AndroidBuildInfo>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool InitData::Reader::hasAndroidSensorsDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasAndroidSensorsDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>::Reader InitData::Reader::getAndroidSensorsDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>::Builder InitData::Builder::getAndroidSensorsDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::setAndroidSensorsDEPRECATED( ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>::Builder InitData::Builder::initAndroidSensorsDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void InitData::Builder::adoptAndroidSensorsDEPRECATED( + ::capnp::Orphan< ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>> InitData::Builder::disownAndroidSensorsDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::InitData::AndroidSensor, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool InitData::Reader::hasChffrAndroidExtraDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasChffrAndroidExtraDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::InitData::ChffrAndroidExtra::Reader InitData::Reader::getChffrAndroidExtraDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::cereal::InitData::ChffrAndroidExtra>::get(_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline ::cereal::InitData::ChffrAndroidExtra::Builder InitData::Builder::getChffrAndroidExtraDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::InitData::ChffrAndroidExtra>::get(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::InitData::ChffrAndroidExtra::Pipeline InitData::Pipeline::getChffrAndroidExtraDEPRECATED() { + return ::cereal::InitData::ChffrAndroidExtra::Pipeline(_typeless.getPointerField(6)); +} +#endif // !CAPNP_LITE +inline void InitData::Builder::setChffrAndroidExtraDEPRECATED( ::cereal::InitData::ChffrAndroidExtra::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::InitData::ChffrAndroidExtra>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline ::cereal::InitData::ChffrAndroidExtra::Builder InitData::Builder::initChffrAndroidExtraDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::InitData::ChffrAndroidExtra>::init(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::adoptChffrAndroidExtraDEPRECATED( + ::capnp::Orphan< ::cereal::InitData::ChffrAndroidExtra>&& value) { + ::capnp::_::PointerHelpers< ::cereal::InitData::ChffrAndroidExtra>::adopt(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::InitData::ChffrAndroidExtra> InitData::Builder::disownChffrAndroidExtraDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::InitData::ChffrAndroidExtra>::disown(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} + +inline bool InitData::Reader::hasPandaInfo() const { + return !_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasPandaInfo() { + return !_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::InitData::PandaInfo::Reader InitData::Reader::getPandaInfo() const { + return ::capnp::_::PointerHelpers< ::cereal::InitData::PandaInfo>::get(_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline ::cereal::InitData::PandaInfo::Builder InitData::Builder::getPandaInfo() { + return ::capnp::_::PointerHelpers< ::cereal::InitData::PandaInfo>::get(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::InitData::PandaInfo::Pipeline InitData::Pipeline::getPandaInfo() { + return ::cereal::InitData::PandaInfo::Pipeline(_typeless.getPointerField(7)); +} +#endif // !CAPNP_LITE +inline void InitData::Builder::setPandaInfo( ::cereal::InitData::PandaInfo::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::InitData::PandaInfo>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline ::cereal::InitData::PandaInfo::Builder InitData::Builder::initPandaInfo() { + return ::capnp::_::PointerHelpers< ::cereal::InitData::PandaInfo>::init(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::adoptPandaInfo( + ::capnp::Orphan< ::cereal::InitData::PandaInfo>&& value) { + ::capnp::_::PointerHelpers< ::cereal::InitData::PandaInfo>::adopt(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::InitData::PandaInfo> InitData::Builder::disownPandaInfo() { + return ::capnp::_::PointerHelpers< ::cereal::InitData::PandaInfo>::disown(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} + +inline bool InitData::Reader::getDirty() const { + return _reader.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline bool InitData::Builder::getDirty() { + return _builder.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void InitData::Builder::setDirty(bool value) { + _builder.setDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline bool InitData::Reader::hasGitCommit() const { + return !_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasGitCommit() { + return !_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::Reader::getGitCommit() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::Builder::getGitCommit() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::setGitCommit( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::Builder::initGitCommit(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), size); +} +inline void InitData::Builder::adoptGitCommit( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::Builder::disownGitCommit() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} + +inline bool InitData::Reader::hasGitBranch() const { + return !_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasGitBranch() { + return !_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::Reader::getGitBranch() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::Builder::getGitBranch() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::setGitBranch( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::Builder::initGitBranch(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), size); +} +inline void InitData::Builder::adoptGitBranch( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::Builder::disownGitBranch() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} + +inline bool InitData::Reader::getPassive() const { + return _reader.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} + +inline bool InitData::Builder::getPassive() { + return _builder.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} +inline void InitData::Builder::setPassive(bool value) { + _builder.setDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS, value); +} + +inline bool InitData::Reader::hasGitRemote() const { + return !_reader.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasGitRemote() { + return !_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::Reader::getGitRemote() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::Builder::getGitRemote() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::setGitRemote( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::Builder::initGitRemote(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), size); +} +inline void InitData::Builder::adoptGitRemote( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::Builder::disownGitRemote() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} + +inline bool InitData::Reader::hasIosBuildInfoDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasIosBuildInfoDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::InitData::IosBuildInfo::Reader InitData::Reader::getIosBuildInfoDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::cereal::InitData::IosBuildInfo>::get(_reader.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} +inline ::cereal::InitData::IosBuildInfo::Builder InitData::Builder::getIosBuildInfoDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::InitData::IosBuildInfo>::get(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::InitData::IosBuildInfo::Pipeline InitData::Pipeline::getIosBuildInfoDEPRECATED() { + return ::cereal::InitData::IosBuildInfo::Pipeline(_typeless.getPointerField(11)); +} +#endif // !CAPNP_LITE +inline void InitData::Builder::setIosBuildInfoDEPRECATED( ::cereal::InitData::IosBuildInfo::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::InitData::IosBuildInfo>::set(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS), value); +} +inline ::cereal::InitData::IosBuildInfo::Builder InitData::Builder::initIosBuildInfoDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::InitData::IosBuildInfo>::init(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::adoptIosBuildInfoDEPRECATED( + ::capnp::Orphan< ::cereal::InitData::IosBuildInfo>&& value) { + ::capnp::_::PointerHelpers< ::cereal::InitData::IosBuildInfo>::adopt(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::InitData::IosBuildInfo> InitData::Builder::disownIosBuildInfoDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::InitData::IosBuildInfo>::disown(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} + +inline bool InitData::Reader::hasKernelVersion() const { + return !_reader.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasKernelVersion() { + return !_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::Reader::getKernelVersion() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::Builder::getKernelVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::setKernelVersion( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::Builder::initKernelVersion(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS), size); +} +inline void InitData::Builder::adoptKernelVersion( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::Builder::disownKernelVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} + +inline bool InitData::Reader::hasAndroidProperties() const { + return !_reader.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasAndroidProperties() { + return !_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Reader InitData::Reader::getAndroidProperties() const { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Text>>::get(_reader.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Builder InitData::Builder::getAndroidProperties() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Text>>::get(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Pipeline InitData::Pipeline::getAndroidProperties() { + return ::cereal::Map< ::capnp::Text, ::capnp::Text>::Pipeline(_typeless.getPointerField(13)); +} +#endif // !CAPNP_LITE +inline void InitData::Builder::setAndroidProperties( ::cereal::Map< ::capnp::Text, ::capnp::Text>::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Text>>::set(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS), value); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Builder InitData::Builder::initAndroidProperties() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Text>>::init(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::adoptAndroidProperties( + ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Text>>&& value) { + ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Text>>::adopt(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Text>> InitData::Builder::disownAndroidProperties() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Text>>::disown(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} + +inline bool InitData::Reader::hasParams() const { + return !_reader.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasParams() { + return !_builder.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Reader InitData::Reader::getParams() const { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::get(_reader.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS)); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Builder InitData::Builder::getParams() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::get(_builder.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Pipeline InitData::Pipeline::getParams() { + return ::cereal::Map< ::capnp::Text, ::capnp::Data>::Pipeline(_typeless.getPointerField(14)); +} +#endif // !CAPNP_LITE +inline void InitData::Builder::setParams( ::cereal::Map< ::capnp::Text, ::capnp::Data>::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::set(_builder.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS), value); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Builder InitData::Builder::initParams() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::init(_builder.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::adoptParams( + ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Data>>&& value) { + ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::adopt(_builder.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Data>> InitData::Builder::disownParams() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::disown(_builder.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS)); +} + +inline bool InitData::Reader::hasOsVersion() const { + return !_reader.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasOsVersion() { + return !_builder.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::Reader::getOsVersion() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::Builder::getOsVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::setOsVersion( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::Builder::initOsVersion(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS), size); +} +inline void InitData::Builder::adoptOsVersion( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::Builder::disownOsVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS)); +} + +inline bool InitData::PandaInfo::Reader::getHasPanda() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool InitData::PandaInfo::Builder::getHasPanda() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void InitData::PandaInfo::Builder::setHasPanda(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool InitData::PandaInfo::Reader::hasDongleId() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::PandaInfo::Builder::hasDongleId() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::PandaInfo::Reader::getDongleId() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::PandaInfo::Builder::getDongleId() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void InitData::PandaInfo::Builder::setDongleId( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::PandaInfo::Builder::initDongleId(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void InitData::PandaInfo::Builder::adoptDongleId( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::PandaInfo::Builder::disownDongleId() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool InitData::PandaInfo::Reader::hasStVersion() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::PandaInfo::Builder::hasStVersion() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::PandaInfo::Reader::getStVersion() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::PandaInfo::Builder::getStVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void InitData::PandaInfo::Builder::setStVersion( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::PandaInfo::Builder::initStVersion(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void InitData::PandaInfo::Builder::adoptStVersion( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::PandaInfo::Builder::disownStVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool InitData::PandaInfo::Reader::hasEspVersion() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::PandaInfo::Builder::hasEspVersion() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::PandaInfo::Reader::getEspVersion() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::PandaInfo::Builder::getEspVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void InitData::PandaInfo::Builder::setEspVersion( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::PandaInfo::Builder::initEspVersion(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void InitData::PandaInfo::Builder::adoptEspVersion( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::PandaInfo::Builder::disownEspVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasBoard() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasBoard() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getBoard() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getBoard() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setBoard( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initBoard(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptBoard( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownBoard() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasBootloader() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasBootloader() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getBootloader() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getBootloader() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setBootloader( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initBootloader(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptBootloader( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownBootloader() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasBrand() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasBrand() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getBrand() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getBrand() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setBrand( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initBrand(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptBrand( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownBrand() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasDevice() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasDevice() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getDevice() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getDevice() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setDevice( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initDevice(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptDevice( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownDevice() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasDisplay() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasDisplay() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getDisplay() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getDisplay() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setDisplay( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initDisplay(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptDisplay( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownDisplay() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasFingerprint() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasFingerprint() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getFingerprint() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getFingerprint() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setFingerprint( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initFingerprint(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptFingerprint( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownFingerprint() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasHardware() const { + return !_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasHardware() { + return !_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getHardware() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getHardware() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setHardware( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initHardware(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptHardware( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownHardware() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasHost() const { + return !_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasHost() { + return !_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getHost() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getHost() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setHost( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initHost(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptHost( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownHost() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasId() const { + return !_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasId() { + return !_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getId() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getId() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setId( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initId(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptId( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownId() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasManufacturer() const { + return !_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasManufacturer() { + return !_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getManufacturer() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getManufacturer() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setManufacturer( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initManufacturer(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptManufacturer( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownManufacturer() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasModel() const { + return !_reader.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasModel() { + return !_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getModel() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getModel() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setModel( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initModel(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptModel( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownModel() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasProduct() const { + return !_reader.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasProduct() { + return !_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getProduct() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getProduct() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setProduct( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initProduct(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptProduct( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownProduct() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasRadioVersion() const { + return !_reader.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasRadioVersion() { + return !_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getRadioVersion() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getRadioVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setRadioVersion( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initRadioVersion(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptRadioVersion( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownRadioVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasSerial() const { + return !_reader.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasSerial() { + return !_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getSerial() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getSerial() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setSerial( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initSerial(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptSerial( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownSerial() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasSupportedAbis() const { + return !_reader.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasSupportedAbis() { + return !_builder.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Reader InitData::AndroidBuildInfo::Reader::getSupportedAbis() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::get(_reader.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Builder InitData::AndroidBuildInfo::Builder::getSupportedAbis() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::get(_builder.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setSupportedAbis( ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::set(_builder.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS), value); +} +inline void InitData::AndroidBuildInfo::Builder::setSupportedAbis(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::set(_builder.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Builder InitData::AndroidBuildInfo::Builder::initSupportedAbis(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::init(_builder.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptSupportedAbis( + ::capnp::Orphan< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::adopt(_builder.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>> InitData::AndroidBuildInfo::Builder::disownSupportedAbis() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::disown(_builder.getPointerField( + ::capnp::bounded<14>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasTags() const { + return !_reader.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasTags() { + return !_builder.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getTags() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getTags() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setTags( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initTags(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptTags( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownTags() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<15>() * ::capnp::POINTERS)); +} + +inline ::int64_t InitData::AndroidBuildInfo::Reader::getTime() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int64_t InitData::AndroidBuildInfo::Builder::getTime() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void InitData::AndroidBuildInfo::Builder::setTime( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasType() const { + return !_reader.getPointerField( + ::capnp::bounded<16>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasType() { + return !_builder.getPointerField( + ::capnp::bounded<16>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getType() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<16>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getType() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<16>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setType( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<16>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initType(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<16>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptType( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<16>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownType() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<16>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasUser() const { + return !_reader.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasUser() { + return !_builder.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getUser() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getUser() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setUser( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initUser(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptUser( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownUser() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasVersionCodename() const { + return !_reader.getPointerField( + ::capnp::bounded<18>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasVersionCodename() { + return !_builder.getPointerField( + ::capnp::bounded<18>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getVersionCodename() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<18>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getVersionCodename() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<18>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setVersionCodename( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<18>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initVersionCodename(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<18>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptVersionCodename( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<18>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownVersionCodename() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<18>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasVersionRelease() const { + return !_reader.getPointerField( + ::capnp::bounded<19>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasVersionRelease() { + return !_builder.getPointerField( + ::capnp::bounded<19>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getVersionRelease() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<19>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getVersionRelease() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<19>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setVersionRelease( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<19>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initVersionRelease(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<19>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptVersionRelease( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<19>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownVersionRelease() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<19>() * ::capnp::POINTERS)); +} + +inline ::int32_t InitData::AndroidBuildInfo::Reader::getVersionSdk() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int32_t InitData::AndroidBuildInfo::Builder::getVersionSdk() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void InitData::AndroidBuildInfo::Builder::setVersionSdk( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool InitData::AndroidBuildInfo::Reader::hasVersionSecurityPatch() const { + return !_reader.getPointerField( + ::capnp::bounded<20>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidBuildInfo::Builder::hasVersionSecurityPatch() { + return !_builder.getPointerField( + ::capnp::bounded<20>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidBuildInfo::Reader::getVersionSecurityPatch() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<20>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::getVersionSecurityPatch() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<20>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidBuildInfo::Builder::setVersionSecurityPatch( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<20>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidBuildInfo::Builder::initVersionSecurityPatch(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<20>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidBuildInfo::Builder::adoptVersionSecurityPatch( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<20>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidBuildInfo::Builder::disownVersionSecurityPatch() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<20>() * ::capnp::POINTERS)); +} + +inline ::int32_t InitData::AndroidSensor::Reader::getId() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t InitData::AndroidSensor::Builder::getId() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void InitData::AndroidSensor::Builder::setId( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool InitData::AndroidSensor::Reader::hasName() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidSensor::Builder::hasName() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidSensor::Reader::getName() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidSensor::Builder::getName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidSensor::Builder::setName( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidSensor::Builder::initName(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidSensor::Builder::adoptName( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidSensor::Builder::disownName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool InitData::AndroidSensor::Reader::hasVendor() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidSensor::Builder::hasVendor() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidSensor::Reader::getVendor() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidSensor::Builder::getVendor() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidSensor::Builder::setVendor( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidSensor::Builder::initVendor(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidSensor::Builder::adoptVendor( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidSensor::Builder::disownVendor() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline ::int32_t InitData::AndroidSensor::Reader::getVersion() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int32_t InitData::AndroidSensor::Builder::getVersion() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void InitData::AndroidSensor::Builder::setVersion( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t InitData::AndroidSensor::Reader::getHandle() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int32_t InitData::AndroidSensor::Builder::getHandle() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void InitData::AndroidSensor::Builder::setHandle( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t InitData::AndroidSensor::Reader::getType() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::int32_t InitData::AndroidSensor::Builder::getType() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void InitData::AndroidSensor::Builder::setType( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float InitData::AndroidSensor::Reader::getMaxRange() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float InitData::AndroidSensor::Builder::getMaxRange() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void InitData::AndroidSensor::Builder::setMaxRange(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float InitData::AndroidSensor::Reader::getResolution() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float InitData::AndroidSensor::Builder::getResolution() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void InitData::AndroidSensor::Builder::setResolution(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float InitData::AndroidSensor::Reader::getPower() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float InitData::AndroidSensor::Builder::getPower() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void InitData::AndroidSensor::Builder::setPower(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t InitData::AndroidSensor::Reader::getMinDelay() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline ::int32_t InitData::AndroidSensor::Builder::getMinDelay() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void InitData::AndroidSensor::Builder::setMinDelay( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t InitData::AndroidSensor::Reader::getFifoReservedEventCount() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t InitData::AndroidSensor::Builder::getFifoReservedEventCount() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void InitData::AndroidSensor::Builder::setFifoReservedEventCount( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t InitData::AndroidSensor::Reader::getFifoMaxEventCount() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t InitData::AndroidSensor::Builder::getFifoMaxEventCount() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void InitData::AndroidSensor::Builder::setFifoMaxEventCount( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline bool InitData::AndroidSensor::Reader::hasStringType() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::AndroidSensor::Builder::hasStringType() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::AndroidSensor::Reader::getStringType() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::AndroidSensor::Builder::getStringType() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void InitData::AndroidSensor::Builder::setStringType( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::AndroidSensor::Builder::initStringType(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void InitData::AndroidSensor::Builder::adoptStringType( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::AndroidSensor::Builder::disownStringType() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline ::int32_t InitData::AndroidSensor::Reader::getMaxDelay() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline ::int32_t InitData::AndroidSensor::Builder::getMaxDelay() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void InitData::AndroidSensor::Builder::setMaxDelay( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline bool InitData::ChffrAndroidExtra::Reader::hasAllCameraCharacteristics() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::ChffrAndroidExtra::Builder::hasAllCameraCharacteristics() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Reader InitData::ChffrAndroidExtra::Reader::getAllCameraCharacteristics() const { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Text>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Builder InitData::ChffrAndroidExtra::Builder::getAllCameraCharacteristics() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Text>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Pipeline InitData::ChffrAndroidExtra::Pipeline::getAllCameraCharacteristics() { + return ::cereal::Map< ::capnp::Text, ::capnp::Text>::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void InitData::ChffrAndroidExtra::Builder::setAllCameraCharacteristics( ::cereal::Map< ::capnp::Text, ::capnp::Text>::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Text>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Text>::Builder InitData::ChffrAndroidExtra::Builder::initAllCameraCharacteristics() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Text>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void InitData::ChffrAndroidExtra::Builder::adoptAllCameraCharacteristics( + ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Text>>&& value) { + ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Text>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Text>> InitData::ChffrAndroidExtra::Builder::disownAllCameraCharacteristics() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Text>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool InitData::IosBuildInfo::Reader::hasAppVersion() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::IosBuildInfo::Builder::hasAppVersion() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::IosBuildInfo::Reader::getAppVersion() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::IosBuildInfo::Builder::getAppVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void InitData::IosBuildInfo::Builder::setAppVersion( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::IosBuildInfo::Builder::initAppVersion(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void InitData::IosBuildInfo::Builder::adoptAppVersion( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::IosBuildInfo::Builder::disownAppVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::uint32_t InitData::IosBuildInfo::Reader::getAppBuild() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t InitData::IosBuildInfo::Builder::getAppBuild() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void InitData::IosBuildInfo::Builder::setAppBuild( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool InitData::IosBuildInfo::Reader::hasOsVersion() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::IosBuildInfo::Builder::hasOsVersion() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::IosBuildInfo::Reader::getOsVersion() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::IosBuildInfo::Builder::getOsVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void InitData::IosBuildInfo::Builder::setOsVersion( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::IosBuildInfo::Builder::initOsVersion(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void InitData::IosBuildInfo::Builder::adoptOsVersion( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::IosBuildInfo::Builder::disownOsVersion() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool InitData::IosBuildInfo::Reader::hasDeviceModel() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::IosBuildInfo::Builder::hasDeviceModel() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::IosBuildInfo::Reader::getDeviceModel() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::IosBuildInfo::Builder::getDeviceModel() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void InitData::IosBuildInfo::Builder::setDeviceModel( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::IosBuildInfo::Builder::initDeviceModel(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void InitData::IosBuildInfo::Builder::adoptDeviceModel( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::IosBuildInfo::Builder::disownDeviceModel() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline ::uint32_t FrameData::Reader::getFrameId() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t FrameData::Builder::getFrameId() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setFrameId( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t FrameData::Reader::getEncodeId() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t FrameData::Builder::getEncodeId() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setEncodeId( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t FrameData::Reader::getTimestampEof() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t FrameData::Builder::getTimestampEof() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setTimestampEof( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t FrameData::Reader::getFrameLength() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::int32_t FrameData::Builder::getFrameLength() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setFrameLength( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t FrameData::Reader::getIntegLines() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::int32_t FrameData::Builder::getIntegLines() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setIntegLines( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t FrameData::Reader::getGlobalGainDEPRECATED() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::int32_t FrameData::Builder::getGlobalGainDEPRECATED() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setGlobalGainDEPRECATED( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool FrameData::Reader::hasImage() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool FrameData::Builder::hasImage() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader FrameData::Reader::getImage() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder FrameData::Builder::getImage() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void FrameData::Builder::setImage( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder FrameData::Builder::initImage(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void FrameData::Builder::adoptImage( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> FrameData::Builder::disownImage() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::cereal::FrameData::FrameType FrameData::Reader::getFrameType() const { + return _reader.getDataField< ::cereal::FrameData::FrameType>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline ::cereal::FrameData::FrameType FrameData::Builder::getFrameType() { + return _builder.getDataField< ::cereal::FrameData::FrameType>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setFrameType( ::cereal::FrameData::FrameType value) { + _builder.setDataField< ::cereal::FrameData::FrameType>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t FrameData::Reader::getTimestampSof() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t FrameData::Builder::getTimestampSof() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setTimestampSof( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline bool FrameData::Reader::hasAndroidCaptureResult() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool FrameData::Builder::hasAndroidCaptureResult() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::FrameData::AndroidCaptureResult::Reader FrameData::Reader::getAndroidCaptureResult() const { + return ::capnp::_::PointerHelpers< ::cereal::FrameData::AndroidCaptureResult>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::cereal::FrameData::AndroidCaptureResult::Builder FrameData::Builder::getAndroidCaptureResult() { + return ::capnp::_::PointerHelpers< ::cereal::FrameData::AndroidCaptureResult>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::FrameData::AndroidCaptureResult::Pipeline FrameData::Pipeline::getAndroidCaptureResult() { + return ::cereal::FrameData::AndroidCaptureResult::Pipeline(_typeless.getPointerField(1)); +} +#endif // !CAPNP_LITE +inline void FrameData::Builder::setAndroidCaptureResult( ::cereal::FrameData::AndroidCaptureResult::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::FrameData::AndroidCaptureResult>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::cereal::FrameData::AndroidCaptureResult::Builder FrameData::Builder::initAndroidCaptureResult() { + return ::capnp::_::PointerHelpers< ::cereal::FrameData::AndroidCaptureResult>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void FrameData::Builder::adoptAndroidCaptureResult( + ::capnp::Orphan< ::cereal::FrameData::AndroidCaptureResult>&& value) { + ::capnp::_::PointerHelpers< ::cereal::FrameData::AndroidCaptureResult>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::FrameData::AndroidCaptureResult> FrameData::Builder::disownAndroidCaptureResult() { + return ::capnp::_::PointerHelpers< ::cereal::FrameData::AndroidCaptureResult>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool FrameData::Reader::hasTransform() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool FrameData::Builder::hasTransform() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader FrameData::Reader::getTransform() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder FrameData::Builder::getTransform() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void FrameData::Builder::setTransform( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void FrameData::Builder::setTransform(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder FrameData::Builder::initTransform(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void FrameData::Builder::adoptTransform( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> FrameData::Builder::disownTransform() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline ::int32_t FrameData::Reader::getLensPos() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline ::int32_t FrameData::Builder::getLensPos() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setLensPos( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline float FrameData::Reader::getLensSag() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline float FrameData::Builder::getLensSag() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setLensSag(float value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline float FrameData::Reader::getLensErr() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline float FrameData::Builder::getLensErr() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setLensErr(float value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline float FrameData::Reader::getLensTruePos() const { + return _reader.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline float FrameData::Builder::getLensTruePos() { + return _builder.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setLensTruePos(float value) { + _builder.setDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline float FrameData::Reader::getGain() const { + return _reader.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline float FrameData::Builder::getGain() { + return _builder.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setGain(float value) { + _builder.setDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline bool FrameData::Reader::hasFocusVal() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool FrameData::Builder::hasFocusVal() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Reader FrameData::Reader::getFocusVal() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Builder FrameData::Builder::getFocusVal() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void FrameData::Builder::setFocusVal( ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void FrameData::Builder::setFocusVal(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>::Builder FrameData::Builder::initFocusVal(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void FrameData::Builder::adoptFocusVal( + ::capnp::Orphan< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>> FrameData::Builder::disownFocusVal() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int16_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool FrameData::Reader::hasFocusConf() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool FrameData::Builder::hasFocusConf() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Reader FrameData::Reader::getFocusConf() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Builder FrameData::Builder::getFocusConf() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void FrameData::Builder::setFocusConf( ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void FrameData::Builder::setFocusConf(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>::Builder FrameData::Builder::initFocusConf(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void FrameData::Builder::adoptFocusConf( + ::capnp::Orphan< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>> FrameData::Builder::disownFocusConf() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint8_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool FrameData::Reader::hasSharpnessScore() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool FrameData::Builder::hasSharpnessScore() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader FrameData::Reader::getSharpnessScore() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder FrameData::Builder::getSharpnessScore() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void FrameData::Builder::setSharpnessScore( ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void FrameData::Builder::setSharpnessScore(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder FrameData::Builder::initSharpnessScore(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void FrameData::Builder::adoptSharpnessScore( + ::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>> FrameData::Builder::disownSharpnessScore() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline ::int32_t FrameData::Reader::getRecoverState() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline ::int32_t FrameData::Builder::getRecoverState() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setRecoverState( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline bool FrameData::Reader::getHighConversionGain() const { + return _reader.getDataField( + ::capnp::bounded<240>() * ::capnp::ELEMENTS); +} + +inline bool FrameData::Builder::getHighConversionGain() { + return _builder.getDataField( + ::capnp::bounded<240>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setHighConversionGain(bool value) { + _builder.setDataField( + ::capnp::bounded<240>() * ::capnp::ELEMENTS, value); +} + +inline float FrameData::Reader::getMeasuredGreyFraction() const { + return _reader.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline float FrameData::Builder::getMeasuredGreyFraction() { + return _builder.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setMeasuredGreyFraction(float value) { + _builder.setDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline float FrameData::Reader::getTargetGreyFraction() const { + return _reader.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} + +inline float FrameData::Builder::getTargetGreyFraction() { + return _builder.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} +inline void FrameData::Builder::setTargetGreyFraction(float value) { + _builder.setDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t FrameData::AndroidCaptureResult::Reader::getSensitivity() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t FrameData::AndroidCaptureResult::Builder::getSensitivity() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void FrameData::AndroidCaptureResult::Builder::setSensitivity( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int64_t FrameData::AndroidCaptureResult::Reader::getFrameDuration() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int64_t FrameData::AndroidCaptureResult::Builder::getFrameDuration() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void FrameData::AndroidCaptureResult::Builder::setFrameDuration( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int64_t FrameData::AndroidCaptureResult::Reader::getExposureTime() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int64_t FrameData::AndroidCaptureResult::Builder::getExposureTime() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void FrameData::AndroidCaptureResult::Builder::setExposureTime( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t FrameData::AndroidCaptureResult::Reader::getRollingShutterSkew() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t FrameData::AndroidCaptureResult::Builder::getRollingShutterSkew() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void FrameData::AndroidCaptureResult::Builder::setRollingShutterSkew( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool FrameData::AndroidCaptureResult::Reader::hasColorCorrectionTransform() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool FrameData::AndroidCaptureResult::Builder::hasColorCorrectionTransform() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Reader FrameData::AndroidCaptureResult::Reader::getColorCorrectionTransform() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Builder FrameData::AndroidCaptureResult::Builder::getColorCorrectionTransform() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void FrameData::AndroidCaptureResult::Builder::setColorCorrectionTransform( ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void FrameData::AndroidCaptureResult::Builder::setColorCorrectionTransform(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>::Builder FrameData::AndroidCaptureResult::Builder::initColorCorrectionTransform(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void FrameData::AndroidCaptureResult::Builder::adoptColorCorrectionTransform( + ::capnp::Orphan< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>> FrameData::AndroidCaptureResult::Builder::disownColorCorrectionTransform() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int32_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool FrameData::AndroidCaptureResult::Reader::hasColorCorrectionGains() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool FrameData::AndroidCaptureResult::Builder::hasColorCorrectionGains() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader FrameData::AndroidCaptureResult::Reader::getColorCorrectionGains() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder FrameData::AndroidCaptureResult::Builder::getColorCorrectionGains() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void FrameData::AndroidCaptureResult::Builder::setColorCorrectionGains( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void FrameData::AndroidCaptureResult::Builder::setColorCorrectionGains(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder FrameData::AndroidCaptureResult::Builder::initColorCorrectionGains(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void FrameData::AndroidCaptureResult::Builder::adoptColorCorrectionGains( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> FrameData::AndroidCaptureResult::Builder::disownColorCorrectionGains() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline ::int8_t FrameData::AndroidCaptureResult::Reader::getDisplayRotation() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::int8_t FrameData::AndroidCaptureResult::Builder::getDisplayRotation() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void FrameData::AndroidCaptureResult::Builder::setDisplayRotation( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t Thumbnail::Reader::getFrameId() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t Thumbnail::Builder::getFrameId() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void Thumbnail::Builder::setFrameId( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t Thumbnail::Reader::getTimestampEof() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t Thumbnail::Builder::getTimestampEof() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void Thumbnail::Builder::setTimestampEof( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool Thumbnail::Reader::hasThumbnail() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Thumbnail::Builder::hasThumbnail() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader Thumbnail::Reader::getThumbnail() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder Thumbnail::Builder::getThumbnail() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Thumbnail::Builder::setThumbnail( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder Thumbnail::Builder::initThumbnail(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Thumbnail::Builder::adoptThumbnail( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> Thumbnail::Builder::disownThumbnail() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::int64_t GPSNMEAData::Reader::getTimestamp() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int64_t GPSNMEAData::Builder::getTimestamp() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void GPSNMEAData::Builder::setTimestamp( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t GPSNMEAData::Reader::getLocalWallTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t GPSNMEAData::Builder::getLocalWallTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void GPSNMEAData::Builder::setLocalWallTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool GPSNMEAData::Reader::hasNmea() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool GPSNMEAData::Builder::hasNmea() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader GPSNMEAData::Reader::getNmea() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder GPSNMEAData::Builder::getNmea() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void GPSNMEAData::Builder::setNmea( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder GPSNMEAData::Builder::initNmea(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void GPSNMEAData::Builder::adoptNmea( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> GPSNMEAData::Builder::disownNmea() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::cereal::SensorEventData::Which SensorEventData::Reader::which() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline ::cereal::SensorEventData::Which SensorEventData::Builder::which() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::int32_t SensorEventData::Reader::getVersion() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t SensorEventData::Builder::getVersion() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void SensorEventData::Builder::setVersion( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t SensorEventData::Reader::getSensor() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int32_t SensorEventData::Builder::getSensor() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void SensorEventData::Builder::setSensor( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t SensorEventData::Reader::getType() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int32_t SensorEventData::Builder::getType() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void SensorEventData::Builder::setType( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::int64_t SensorEventData::Reader::getTimestamp() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int64_t SensorEventData::Builder::getTimestamp() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void SensorEventData::Builder::setTimestamp( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool SensorEventData::Reader::isAcceleration() const { + return which() == SensorEventData::ACCELERATION; +} +inline bool SensorEventData::Builder::isAcceleration() { + return which() == SensorEventData::ACCELERATION; +} +inline bool SensorEventData::Reader::hasAcceleration() const { + if (which() != SensorEventData::ACCELERATION) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool SensorEventData::Builder::hasAcceleration() { + if (which() != SensorEventData::ACCELERATION) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::SensorEventData::SensorVec::Reader SensorEventData::Reader::getAcceleration() const { + KJ_IREQUIRE((which() == SensorEventData::ACCELERATION), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::SensorEventData::SensorVec::Builder SensorEventData::Builder::getAcceleration() { + KJ_IREQUIRE((which() == SensorEventData::ACCELERATION), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::Builder::setAcceleration( ::cereal::SensorEventData::SensorVec::Reader value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::ACCELERATION); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::SensorEventData::SensorVec::Builder SensorEventData::Builder::initAcceleration() { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::ACCELERATION); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::Builder::adoptAcceleration( + ::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::ACCELERATION); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> SensorEventData::Builder::disownAcceleration() { + KJ_IREQUIRE((which() == SensorEventData::ACCELERATION), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool SensorEventData::Reader::isMagnetic() const { + return which() == SensorEventData::MAGNETIC; +} +inline bool SensorEventData::Builder::isMagnetic() { + return which() == SensorEventData::MAGNETIC; +} +inline bool SensorEventData::Reader::hasMagnetic() const { + if (which() != SensorEventData::MAGNETIC) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool SensorEventData::Builder::hasMagnetic() { + if (which() != SensorEventData::MAGNETIC) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::SensorEventData::SensorVec::Reader SensorEventData::Reader::getMagnetic() const { + KJ_IREQUIRE((which() == SensorEventData::MAGNETIC), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::SensorEventData::SensorVec::Builder SensorEventData::Builder::getMagnetic() { + KJ_IREQUIRE((which() == SensorEventData::MAGNETIC), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::Builder::setMagnetic( ::cereal::SensorEventData::SensorVec::Reader value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::MAGNETIC); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::SensorEventData::SensorVec::Builder SensorEventData::Builder::initMagnetic() { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::MAGNETIC); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::Builder::adoptMagnetic( + ::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::MAGNETIC); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> SensorEventData::Builder::disownMagnetic() { + KJ_IREQUIRE((which() == SensorEventData::MAGNETIC), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool SensorEventData::Reader::isOrientation() const { + return which() == SensorEventData::ORIENTATION; +} +inline bool SensorEventData::Builder::isOrientation() { + return which() == SensorEventData::ORIENTATION; +} +inline bool SensorEventData::Reader::hasOrientation() const { + if (which() != SensorEventData::ORIENTATION) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool SensorEventData::Builder::hasOrientation() { + if (which() != SensorEventData::ORIENTATION) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::SensorEventData::SensorVec::Reader SensorEventData::Reader::getOrientation() const { + KJ_IREQUIRE((which() == SensorEventData::ORIENTATION), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::SensorEventData::SensorVec::Builder SensorEventData::Builder::getOrientation() { + KJ_IREQUIRE((which() == SensorEventData::ORIENTATION), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::Builder::setOrientation( ::cereal::SensorEventData::SensorVec::Reader value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::ORIENTATION); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::SensorEventData::SensorVec::Builder SensorEventData::Builder::initOrientation() { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::ORIENTATION); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::Builder::adoptOrientation( + ::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::ORIENTATION); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> SensorEventData::Builder::disownOrientation() { + KJ_IREQUIRE((which() == SensorEventData::ORIENTATION), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool SensorEventData::Reader::isGyro() const { + return which() == SensorEventData::GYRO; +} +inline bool SensorEventData::Builder::isGyro() { + return which() == SensorEventData::GYRO; +} +inline bool SensorEventData::Reader::hasGyro() const { + if (which() != SensorEventData::GYRO) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool SensorEventData::Builder::hasGyro() { + if (which() != SensorEventData::GYRO) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::SensorEventData::SensorVec::Reader SensorEventData::Reader::getGyro() const { + KJ_IREQUIRE((which() == SensorEventData::GYRO), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::SensorEventData::SensorVec::Builder SensorEventData::Builder::getGyro() { + KJ_IREQUIRE((which() == SensorEventData::GYRO), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::Builder::setGyro( ::cereal::SensorEventData::SensorVec::Reader value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::GYRO); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::SensorEventData::SensorVec::Builder SensorEventData::Builder::initGyro() { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::GYRO); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::Builder::adoptGyro( + ::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::GYRO); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> SensorEventData::Builder::disownGyro() { + KJ_IREQUIRE((which() == SensorEventData::GYRO), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::cereal::SensorEventData::SensorSource SensorEventData::Reader::getSource() const { + return _reader.getDataField< ::cereal::SensorEventData::SensorSource>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline ::cereal::SensorEventData::SensorSource SensorEventData::Builder::getSource() { + return _builder.getDataField< ::cereal::SensorEventData::SensorSource>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void SensorEventData::Builder::setSource( ::cereal::SensorEventData::SensorSource value) { + _builder.setDataField< ::cereal::SensorEventData::SensorSource>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline bool SensorEventData::Reader::isPressure() const { + return which() == SensorEventData::PRESSURE; +} +inline bool SensorEventData::Builder::isPressure() { + return which() == SensorEventData::PRESSURE; +} +inline bool SensorEventData::Reader::hasPressure() const { + if (which() != SensorEventData::PRESSURE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool SensorEventData::Builder::hasPressure() { + if (which() != SensorEventData::PRESSURE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::SensorEventData::SensorVec::Reader SensorEventData::Reader::getPressure() const { + KJ_IREQUIRE((which() == SensorEventData::PRESSURE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::SensorEventData::SensorVec::Builder SensorEventData::Builder::getPressure() { + KJ_IREQUIRE((which() == SensorEventData::PRESSURE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::Builder::setPressure( ::cereal::SensorEventData::SensorVec::Reader value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::PRESSURE); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::SensorEventData::SensorVec::Builder SensorEventData::Builder::initPressure() { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::PRESSURE); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::Builder::adoptPressure( + ::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::PRESSURE); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> SensorEventData::Builder::disownPressure() { + KJ_IREQUIRE((which() == SensorEventData::PRESSURE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool SensorEventData::Reader::getUncalibratedDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<192>() * ::capnp::ELEMENTS); +} + +inline bool SensorEventData::Builder::getUncalibratedDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<192>() * ::capnp::ELEMENTS); +} +inline void SensorEventData::Builder::setUncalibratedDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<192>() * ::capnp::ELEMENTS, value); +} + +inline bool SensorEventData::Reader::isMagneticUncalibrated() const { + return which() == SensorEventData::MAGNETIC_UNCALIBRATED; +} +inline bool SensorEventData::Builder::isMagneticUncalibrated() { + return which() == SensorEventData::MAGNETIC_UNCALIBRATED; +} +inline bool SensorEventData::Reader::hasMagneticUncalibrated() const { + if (which() != SensorEventData::MAGNETIC_UNCALIBRATED) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool SensorEventData::Builder::hasMagneticUncalibrated() { + if (which() != SensorEventData::MAGNETIC_UNCALIBRATED) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::SensorEventData::SensorVec::Reader SensorEventData::Reader::getMagneticUncalibrated() const { + KJ_IREQUIRE((which() == SensorEventData::MAGNETIC_UNCALIBRATED), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::SensorEventData::SensorVec::Builder SensorEventData::Builder::getMagneticUncalibrated() { + KJ_IREQUIRE((which() == SensorEventData::MAGNETIC_UNCALIBRATED), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::Builder::setMagneticUncalibrated( ::cereal::SensorEventData::SensorVec::Reader value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::MAGNETIC_UNCALIBRATED); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::SensorEventData::SensorVec::Builder SensorEventData::Builder::initMagneticUncalibrated() { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::MAGNETIC_UNCALIBRATED); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::Builder::adoptMagneticUncalibrated( + ::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::MAGNETIC_UNCALIBRATED); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> SensorEventData::Builder::disownMagneticUncalibrated() { + KJ_IREQUIRE((which() == SensorEventData::MAGNETIC_UNCALIBRATED), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool SensorEventData::Reader::isGyroUncalibrated() const { + return which() == SensorEventData::GYRO_UNCALIBRATED; +} +inline bool SensorEventData::Builder::isGyroUncalibrated() { + return which() == SensorEventData::GYRO_UNCALIBRATED; +} +inline bool SensorEventData::Reader::hasGyroUncalibrated() const { + if (which() != SensorEventData::GYRO_UNCALIBRATED) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool SensorEventData::Builder::hasGyroUncalibrated() { + if (which() != SensorEventData::GYRO_UNCALIBRATED) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::SensorEventData::SensorVec::Reader SensorEventData::Reader::getGyroUncalibrated() const { + KJ_IREQUIRE((which() == SensorEventData::GYRO_UNCALIBRATED), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::SensorEventData::SensorVec::Builder SensorEventData::Builder::getGyroUncalibrated() { + KJ_IREQUIRE((which() == SensorEventData::GYRO_UNCALIBRATED), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::Builder::setGyroUncalibrated( ::cereal::SensorEventData::SensorVec::Reader value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::GYRO_UNCALIBRATED); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::SensorEventData::SensorVec::Builder SensorEventData::Builder::initGyroUncalibrated() { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::GYRO_UNCALIBRATED); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::Builder::adoptGyroUncalibrated( + ::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::GYRO_UNCALIBRATED); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> SensorEventData::Builder::disownGyroUncalibrated() { + KJ_IREQUIRE((which() == SensorEventData::GYRO_UNCALIBRATED), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData::SensorVec>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool SensorEventData::Reader::isProximity() const { + return which() == SensorEventData::PROXIMITY; +} +inline bool SensorEventData::Builder::isProximity() { + return which() == SensorEventData::PROXIMITY; +} +inline float SensorEventData::Reader::getProximity() const { + KJ_IREQUIRE((which() == SensorEventData::PROXIMITY), + "Must check which() before get()ing a union member."); + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float SensorEventData::Builder::getProximity() { + KJ_IREQUIRE((which() == SensorEventData::PROXIMITY), + "Must check which() before get()ing a union member."); + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void SensorEventData::Builder::setProximity(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::PROXIMITY); + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline bool SensorEventData::Reader::isLight() const { + return which() == SensorEventData::LIGHT; +} +inline bool SensorEventData::Builder::isLight() { + return which() == SensorEventData::LIGHT; +} +inline float SensorEventData::Reader::getLight() const { + KJ_IREQUIRE((which() == SensorEventData::LIGHT), + "Must check which() before get()ing a union member."); + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float SensorEventData::Builder::getLight() { + KJ_IREQUIRE((which() == SensorEventData::LIGHT), + "Must check which() before get()ing a union member."); + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void SensorEventData::Builder::setLight(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::LIGHT); + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline bool SensorEventData::Reader::isTemperature() const { + return which() == SensorEventData::TEMPERATURE; +} +inline bool SensorEventData::Builder::isTemperature() { + return which() == SensorEventData::TEMPERATURE; +} +inline float SensorEventData::Reader::getTemperature() const { + KJ_IREQUIRE((which() == SensorEventData::TEMPERATURE), + "Must check which() before get()ing a union member."); + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float SensorEventData::Builder::getTemperature() { + KJ_IREQUIRE((which() == SensorEventData::TEMPERATURE), + "Must check which() before get()ing a union member."); + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void SensorEventData::Builder::setTemperature(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, SensorEventData::TEMPERATURE); + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline bool SensorEventData::SensorVec::Reader::hasV() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool SensorEventData::SensorVec::Builder::hasV() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader SensorEventData::SensorVec::Reader::getV() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder SensorEventData::SensorVec::Builder::getV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void SensorEventData::SensorVec::Builder::setV( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void SensorEventData::SensorVec::Builder::setV(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder SensorEventData::SensorVec::Builder::initV(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void SensorEventData::SensorVec::Builder::adoptV( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> SensorEventData::SensorVec::Builder::disownV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::int8_t SensorEventData::SensorVec::Reader::getStatus() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int8_t SensorEventData::SensorVec::Builder::getStatus() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void SensorEventData::SensorVec::Builder::setStatus( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t GpsLocationData::Reader::getFlags() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t GpsLocationData::Builder::getFlags() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void GpsLocationData::Builder::setFlags( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline double GpsLocationData::Reader::getLatitude() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline double GpsLocationData::Builder::getLatitude() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void GpsLocationData::Builder::setLatitude(double value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline double GpsLocationData::Reader::getLongitude() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline double GpsLocationData::Builder::getLongitude() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void GpsLocationData::Builder::setLongitude(double value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline double GpsLocationData::Reader::getAltitude() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline double GpsLocationData::Builder::getAltitude() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void GpsLocationData::Builder::setAltitude(double value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float GpsLocationData::Reader::getSpeed() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float GpsLocationData::Builder::getSpeed() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void GpsLocationData::Builder::setSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float GpsLocationData::Reader::getBearingDeg() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float GpsLocationData::Builder::getBearingDeg() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void GpsLocationData::Builder::setBearingDeg(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float GpsLocationData::Reader::getAccuracy() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline float GpsLocationData::Builder::getAccuracy() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void GpsLocationData::Builder::setAccuracy(float value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline ::int64_t GpsLocationData::Reader::getTimestamp() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::int64_t GpsLocationData::Builder::getTimestamp() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void GpsLocationData::Builder::setTimestamp( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::GpsLocationData::SensorSource GpsLocationData::Reader::getSource() const { + return _reader.getDataField< ::cereal::GpsLocationData::SensorSource>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::cereal::GpsLocationData::SensorSource GpsLocationData::Builder::getSource() { + return _builder.getDataField< ::cereal::GpsLocationData::SensorSource>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void GpsLocationData::Builder::setSource( ::cereal::GpsLocationData::SensorSource value) { + _builder.setDataField< ::cereal::GpsLocationData::SensorSource>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool GpsLocationData::Reader::hasVNED() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool GpsLocationData::Builder::hasVNED() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader GpsLocationData::Reader::getVNED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder GpsLocationData::Builder::getVNED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void GpsLocationData::Builder::setVNED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void GpsLocationData::Builder::setVNED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder GpsLocationData::Builder::initVNED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void GpsLocationData::Builder::adoptVNED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> GpsLocationData::Builder::disownVNED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline float GpsLocationData::Reader::getVerticalAccuracy() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline float GpsLocationData::Builder::getVerticalAccuracy() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void GpsLocationData::Builder::setVerticalAccuracy(float value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline float GpsLocationData::Reader::getBearingAccuracyDeg() const { + return _reader.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline float GpsLocationData::Builder::getBearingAccuracyDeg() { + return _builder.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void GpsLocationData::Builder::setBearingAccuracyDeg(float value) { + _builder.setDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline float GpsLocationData::Reader::getSpeedAccuracy() const { + return _reader.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline float GpsLocationData::Builder::getSpeedAccuracy() { + return _builder.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void GpsLocationData::Builder::setSpeedAccuracy(float value) { + _builder.setDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t CanData::Reader::getAddress() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t CanData::Builder::getAddress() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CanData::Builder::setAddress( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t CanData::Reader::getBusTime() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t CanData::Builder::getBusTime() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void CanData::Builder::setBusTime( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool CanData::Reader::hasDat() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool CanData::Builder::hasDat() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader CanData::Reader::getDat() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder CanData::Builder::getDat() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void CanData::Builder::setDat( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder CanData::Builder::initDat(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void CanData::Builder::adoptDat( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> CanData::Builder::disownDat() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::uint8_t CanData::Reader::getSrc() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t CanData::Builder::getSrc() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void CanData::Builder::setSrc( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t DeviceState::Reader::getCpu0DEPRECATED() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t DeviceState::Builder::getCpu0DEPRECATED() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setCpu0DEPRECATED( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t DeviceState::Reader::getCpu1DEPRECATED() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t DeviceState::Builder::getCpu1DEPRECATED() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setCpu1DEPRECATED( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t DeviceState::Reader::getCpu2DEPRECATED() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t DeviceState::Builder::getCpu2DEPRECATED() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setCpu2DEPRECATED( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t DeviceState::Reader::getCpu3DEPRECATED() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t DeviceState::Builder::getCpu3DEPRECATED() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setCpu3DEPRECATED( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t DeviceState::Reader::getMemDEPRECATED() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t DeviceState::Builder::getMemDEPRECATED() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setMemDEPRECATED( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t DeviceState::Reader::getGpuDEPRECATED() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t DeviceState::Builder::getGpuDEPRECATED() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setGpuDEPRECATED( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t DeviceState::Reader::getBatDEPRECATED() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t DeviceState::Builder::getBatDEPRECATED() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setBatDEPRECATED( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float DeviceState::Reader::getFreeSpacePercent() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float DeviceState::Builder::getFreeSpacePercent() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setFreeSpacePercent(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::int16_t DeviceState::Reader::getBatteryPercent() const { + return _reader.getDataField< ::int16_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline ::int16_t DeviceState::Builder::getBatteryPercent() { + return _builder.getDataField< ::int16_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setBatteryPercent( ::int16_t value) { + _builder.setDataField< ::int16_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline bool DeviceState::Reader::hasBatteryStatusDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::Builder::hasBatteryStatusDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader DeviceState::Reader::getBatteryStatusDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder DeviceState::Builder::getBatteryStatusDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void DeviceState::Builder::setBatteryStatusDEPRECATED( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder DeviceState::Builder::initBatteryStatusDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void DeviceState::Builder::adoptBatteryStatusDEPRECATED( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> DeviceState::Builder::disownBatteryStatusDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::uint16_t DeviceState::Reader::getFanSpeedPercentDesired() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t DeviceState::Builder::getFanSpeedPercentDesired() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setFanSpeedPercentDesired( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline bool DeviceState::Reader::getStarted() const { + return _reader.getDataField( + ::capnp::bounded<192>() * ::capnp::ELEMENTS); +} + +inline bool DeviceState::Builder::getStarted() { + return _builder.getDataField( + ::capnp::bounded<192>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setStarted(bool value) { + _builder.setDataField( + ::capnp::bounded<192>() * ::capnp::ELEMENTS, value); +} + +inline bool DeviceState::Reader::getUsbOnline() const { + return _reader.getDataField( + ::capnp::bounded<193>() * ::capnp::ELEMENTS); +} + +inline bool DeviceState::Builder::getUsbOnline() { + return _builder.getDataField( + ::capnp::bounded<193>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setUsbOnline(bool value) { + _builder.setDataField( + ::capnp::bounded<193>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t DeviceState::Reader::getStartedMonoTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t DeviceState::Builder::getStartedMonoTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setStartedMonoTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::DeviceState::ThermalStatus DeviceState::Reader::getThermalStatus() const { + return _reader.getDataField< ::cereal::DeviceState::ThermalStatus>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline ::cereal::DeviceState::ThermalStatus DeviceState::Builder::getThermalStatus() { + return _builder.getDataField< ::cereal::DeviceState::ThermalStatus>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setThermalStatus( ::cereal::DeviceState::ThermalStatus value) { + _builder.setDataField< ::cereal::DeviceState::ThermalStatus>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t DeviceState::Reader::getBatteryCurrent() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline ::int32_t DeviceState::Builder::getBatteryCurrent() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setBatteryCurrent( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t DeviceState::Reader::getBatteryVoltageDEPRECATED() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline ::int32_t DeviceState::Builder::getBatteryVoltageDEPRECATED() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setBatteryVoltageDEPRECATED( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline bool DeviceState::Reader::getChargingError() const { + return _reader.getDataField( + ::capnp::bounded<194>() * ::capnp::ELEMENTS); +} + +inline bool DeviceState::Builder::getChargingError() { + return _builder.getDataField( + ::capnp::bounded<194>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setChargingError(bool value) { + _builder.setDataField( + ::capnp::bounded<194>() * ::capnp::ELEMENTS, value); +} + +inline bool DeviceState::Reader::getChargingDisabled() const { + return _reader.getDataField( + ::capnp::bounded<195>() * ::capnp::ELEMENTS); +} + +inline bool DeviceState::Builder::getChargingDisabled() { + return _builder.getDataField( + ::capnp::bounded<195>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setChargingDisabled(bool value) { + _builder.setDataField( + ::capnp::bounded<195>() * ::capnp::ELEMENTS, value); +} + +inline ::int8_t DeviceState::Reader::getMemoryUsagePercent() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} + +inline ::int8_t DeviceState::Builder::getMemoryUsagePercent() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setMemoryUsagePercent( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<25>() * ::capnp::ELEMENTS, value); +} + +inline ::int8_t DeviceState::Reader::getCpuUsagePercentDEPRECATED() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<44>() * ::capnp::ELEMENTS); +} + +inline ::int8_t DeviceState::Builder::getCpuUsagePercentDEPRECATED() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<44>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setCpuUsagePercentDEPRECATED( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<44>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t DeviceState::Reader::getPa0DEPRECATED() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<23>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t DeviceState::Builder::getPa0DEPRECATED() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<23>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setPa0DEPRECATED( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<23>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::DeviceState::NetworkType DeviceState::Reader::getNetworkType() const { + return _reader.getDataField< ::cereal::DeviceState::NetworkType>( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} + +inline ::cereal::DeviceState::NetworkType DeviceState::Builder::getNetworkType() { + return _builder.getDataField< ::cereal::DeviceState::NetworkType>( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setNetworkType( ::cereal::DeviceState::NetworkType value) { + _builder.setDataField< ::cereal::DeviceState::NetworkType>( + ::capnp::bounded<24>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t DeviceState::Reader::getOffroadPowerUsageUwh() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t DeviceState::Builder::getOffroadPowerUsageUwh() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setOffroadPowerUsageUwh( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::DeviceState::NetworkStrength DeviceState::Reader::getNetworkStrength() const { + return _reader.getDataField< ::cereal::DeviceState::NetworkStrength>( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} + +inline ::cereal::DeviceState::NetworkStrength DeviceState::Builder::getNetworkStrength() { + return _builder.getDataField< ::cereal::DeviceState::NetworkStrength>( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setNetworkStrength( ::cereal::DeviceState::NetworkStrength value) { + _builder.setDataField< ::cereal::DeviceState::NetworkStrength>( + ::capnp::bounded<25>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t DeviceState::Reader::getCarBatteryCapacityUwh() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t DeviceState::Builder::getCarBatteryCapacityUwh() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setCarBatteryCapacityUwh( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline bool DeviceState::Reader::hasCpuTempC() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::Builder::hasCpuTempC() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader DeviceState::Reader::getCpuTempC() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder DeviceState::Builder::getCpuTempC() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void DeviceState::Builder::setCpuTempC( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void DeviceState::Builder::setCpuTempC(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder DeviceState::Builder::initCpuTempC(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void DeviceState::Builder::adoptCpuTempC( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> DeviceState::Builder::disownCpuTempC() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool DeviceState::Reader::hasGpuTempC() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::Builder::hasGpuTempC() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader DeviceState::Reader::getGpuTempC() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder DeviceState::Builder::getGpuTempC() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void DeviceState::Builder::setGpuTempC( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void DeviceState::Builder::setGpuTempC(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder DeviceState::Builder::initGpuTempC(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void DeviceState::Builder::adoptGpuTempC( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> DeviceState::Builder::disownGpuTempC() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline float DeviceState::Reader::getMemoryTempC() const { + return _reader.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline float DeviceState::Builder::getMemoryTempC() { + return _builder.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setMemoryTempC(float value) { + _builder.setDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline float DeviceState::Reader::getBatteryTempCDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline float DeviceState::Builder::getBatteryTempCDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setBatteryTempCDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline float DeviceState::Reader::getAmbientTempC() const { + return _reader.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} + +inline float DeviceState::Builder::getAmbientTempC() { + return _builder.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setAmbientTempC(float value) { + _builder.setDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS, value); +} + +inline bool DeviceState::Reader::hasNetworkInfo() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::Builder::hasNetworkInfo() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::DeviceState::NetworkInfo::Reader DeviceState::Reader::getNetworkInfo() const { + return ::capnp::_::PointerHelpers< ::cereal::DeviceState::NetworkInfo>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::cereal::DeviceState::NetworkInfo::Builder DeviceState::Builder::getNetworkInfo() { + return ::capnp::_::PointerHelpers< ::cereal::DeviceState::NetworkInfo>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::DeviceState::NetworkInfo::Pipeline DeviceState::Pipeline::getNetworkInfo() { + return ::cereal::DeviceState::NetworkInfo::Pipeline(_typeless.getPointerField(3)); +} +#endif // !CAPNP_LITE +inline void DeviceState::Builder::setNetworkInfo( ::cereal::DeviceState::NetworkInfo::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::DeviceState::NetworkInfo>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::cereal::DeviceState::NetworkInfo::Builder DeviceState::Builder::initNetworkInfo() { + return ::capnp::_::PointerHelpers< ::cereal::DeviceState::NetworkInfo>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void DeviceState::Builder::adoptNetworkInfo( + ::capnp::Orphan< ::cereal::DeviceState::NetworkInfo>&& value) { + ::capnp::_::PointerHelpers< ::cereal::DeviceState::NetworkInfo>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::DeviceState::NetworkInfo> DeviceState::Builder::disownNetworkInfo() { + return ::capnp::_::PointerHelpers< ::cereal::DeviceState::NetworkInfo>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline ::uint64_t DeviceState::Reader::getLastAthenaPingTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t DeviceState::Builder::getLastAthenaPingTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setLastAthenaPingTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline ::int8_t DeviceState::Reader::getGpuUsagePercent() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<45>() * ::capnp::ELEMENTS); +} + +inline ::int8_t DeviceState::Builder::getGpuUsagePercent() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<45>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setGpuUsagePercent( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<45>() * ::capnp::ELEMENTS, value); +} + +inline bool DeviceState::Reader::hasCpuUsagePercent() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::Builder::hasCpuUsagePercent() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Reader DeviceState::Reader::getCpuUsagePercent() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Builder DeviceState::Builder::getCpuUsagePercent() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void DeviceState::Builder::setCpuUsagePercent( ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void DeviceState::Builder::setCpuUsagePercent(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>::Builder DeviceState::Builder::initCpuUsagePercent(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void DeviceState::Builder::adoptCpuUsagePercent( + ::capnp::Orphan< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>> DeviceState::Builder::disownCpuUsagePercent() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::int8_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool DeviceState::Reader::hasNvmeTempC() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::Builder::hasNvmeTempC() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader DeviceState::Reader::getNvmeTempC() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder DeviceState::Builder::getNvmeTempC() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void DeviceState::Builder::setNvmeTempC( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void DeviceState::Builder::setNvmeTempC(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder DeviceState::Builder::initNvmeTempC(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void DeviceState::Builder::adoptNvmeTempC( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> DeviceState::Builder::disownNvmeTempC() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool DeviceState::Reader::hasModemTempC() const { + return !_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::Builder::hasModemTempC() { + return !_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader DeviceState::Reader::getModemTempC() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder DeviceState::Builder::getModemTempC() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline void DeviceState::Builder::setModemTempC( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline void DeviceState::Builder::setModemTempC(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder DeviceState::Builder::initModemTempC(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), size); +} +inline void DeviceState::Builder::adoptModemTempC( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> DeviceState::Builder::disownModemTempC() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} + +inline ::int8_t DeviceState::Reader::getScreenBrightnessPercent() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<80>() * ::capnp::ELEMENTS); +} + +inline ::int8_t DeviceState::Builder::getScreenBrightnessPercent() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<80>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setScreenBrightnessPercent( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<80>() * ::capnp::ELEMENTS, value); +} + +inline bool DeviceState::Reader::hasThermalZones() const { + return !_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::Builder::hasThermalZones() { + return !_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>::Reader DeviceState::Reader::getThermalZones() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>::Builder DeviceState::Builder::getThermalZones() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline void DeviceState::Builder::setThermalZones( ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>::Builder DeviceState::Builder::initThermalZones(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), size); +} +inline void DeviceState::Builder::adoptThermalZones( + ::capnp::Orphan< ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>> DeviceState::Builder::disownThermalZones() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::DeviceState::ThermalZone, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} + +inline bool DeviceState::Reader::hasPmicTempC() const { + return !_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::Builder::hasPmicTempC() { + return !_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader DeviceState::Reader::getPmicTempC() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder DeviceState::Builder::getPmicTempC() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline void DeviceState::Builder::setPmicTempC( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), value); +} +inline void DeviceState::Builder::setPmicTempC(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder DeviceState::Builder::initPmicTempC(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), size); +} +inline void DeviceState::Builder::adoptPmicTempC( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> DeviceState::Builder::disownPmicTempC() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} + +inline float DeviceState::Reader::getPowerDrawW() const { + return _reader.getDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} + +inline float DeviceState::Builder::getPowerDrawW() { + return _builder.getDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} +inline void DeviceState::Builder::setPowerDrawW(float value) { + _builder.setDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS, value); +} + +inline bool DeviceState::ThermalZone::Reader::hasName() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::ThermalZone::Builder::hasName() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader DeviceState::ThermalZone::Reader::getName() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder DeviceState::ThermalZone::Builder::getName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void DeviceState::ThermalZone::Builder::setName( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder DeviceState::ThermalZone::Builder::initName(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void DeviceState::ThermalZone::Builder::adoptName( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> DeviceState::ThermalZone::Builder::disownName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline float DeviceState::ThermalZone::Reader::getTemp() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float DeviceState::ThermalZone::Builder::getTemp() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void DeviceState::ThermalZone::Builder::setTemp(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool DeviceState::NetworkInfo::Reader::hasTechnology() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::NetworkInfo::Builder::hasTechnology() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader DeviceState::NetworkInfo::Reader::getTechnology() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder DeviceState::NetworkInfo::Builder::getTechnology() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void DeviceState::NetworkInfo::Builder::setTechnology( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder DeviceState::NetworkInfo::Builder::initTechnology(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void DeviceState::NetworkInfo::Builder::adoptTechnology( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> DeviceState::NetworkInfo::Builder::disownTechnology() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool DeviceState::NetworkInfo::Reader::hasOperator() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::NetworkInfo::Builder::hasOperator() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader DeviceState::NetworkInfo::Reader::getOperator() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder DeviceState::NetworkInfo::Builder::getOperator() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void DeviceState::NetworkInfo::Builder::setOperator( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder DeviceState::NetworkInfo::Builder::initOperator(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void DeviceState::NetworkInfo::Builder::adoptOperator( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> DeviceState::NetworkInfo::Builder::disownOperator() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool DeviceState::NetworkInfo::Reader::hasBand() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::NetworkInfo::Builder::hasBand() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader DeviceState::NetworkInfo::Reader::getBand() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder DeviceState::NetworkInfo::Builder::getBand() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void DeviceState::NetworkInfo::Builder::setBand( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder DeviceState::NetworkInfo::Builder::initBand(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void DeviceState::NetworkInfo::Builder::adoptBand( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> DeviceState::NetworkInfo::Builder::disownBand() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline ::uint16_t DeviceState::NetworkInfo::Reader::getChannel() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t DeviceState::NetworkInfo::Builder::getChannel() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void DeviceState::NetworkInfo::Builder::setChannel( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool DeviceState::NetworkInfo::Reader::hasExtra() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::NetworkInfo::Builder::hasExtra() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader DeviceState::NetworkInfo::Reader::getExtra() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder DeviceState::NetworkInfo::Builder::getExtra() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void DeviceState::NetworkInfo::Builder::setExtra( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder DeviceState::NetworkInfo::Builder::initExtra(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void DeviceState::NetworkInfo::Builder::adoptExtra( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> DeviceState::NetworkInfo::Builder::disownExtra() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool DeviceState::NetworkInfo::Reader::hasState() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool DeviceState::NetworkInfo::Builder::hasState() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader DeviceState::NetworkInfo::Reader::getState() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder DeviceState::NetworkInfo::Builder::getState() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void DeviceState::NetworkInfo::Builder::setState( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder DeviceState::NetworkInfo::Builder::initState(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void DeviceState::NetworkInfo::Builder::adoptState( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> DeviceState::NetworkInfo::Builder::disownState() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline ::uint32_t PandaState::Reader::getVoltageDEPRECATED() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t PandaState::Builder::getVoltageDEPRECATED() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setVoltageDEPRECATED( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t PandaState::Reader::getCurrentDEPRECATED() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t PandaState::Builder::getCurrentDEPRECATED() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setCurrentDEPRECATED( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool PandaState::Reader::getIgnitionLine() const { + return _reader.getDataField( + ::capnp::bounded<64>() * ::capnp::ELEMENTS); +} + +inline bool PandaState::Builder::getIgnitionLine() { + return _builder.getDataField( + ::capnp::bounded<64>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setIgnitionLine(bool value) { + _builder.setDataField( + ::capnp::bounded<64>() * ::capnp::ELEMENTS, value); +} + +inline bool PandaState::Reader::getControlsAllowed() const { + return _reader.getDataField( + ::capnp::bounded<65>() * ::capnp::ELEMENTS); +} + +inline bool PandaState::Builder::getControlsAllowed() { + return _builder.getDataField( + ::capnp::bounded<65>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setControlsAllowed(bool value) { + _builder.setDataField( + ::capnp::bounded<65>() * ::capnp::ELEMENTS, value); +} + +inline bool PandaState::Reader::getGasInterceptorDetected() const { + return _reader.getDataField( + ::capnp::bounded<66>() * ::capnp::ELEMENTS); +} + +inline bool PandaState::Builder::getGasInterceptorDetected() { + return _builder.getDataField( + ::capnp::bounded<66>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setGasInterceptorDetected(bool value) { + _builder.setDataField( + ::capnp::bounded<66>() * ::capnp::ELEMENTS, value); +} + +inline bool PandaState::Reader::getStartedSignalDetectedDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<67>() * ::capnp::ELEMENTS); +} + +inline bool PandaState::Builder::getStartedSignalDetectedDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<67>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setStartedSignalDetectedDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<67>() * ::capnp::ELEMENTS, value); +} + +inline bool PandaState::Reader::getHasGpsDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<68>() * ::capnp::ELEMENTS); +} + +inline bool PandaState::Builder::getHasGpsDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<68>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setHasGpsDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<68>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t PandaState::Reader::getCanSendErrs() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t PandaState::Builder::getCanSendErrs() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setCanSendErrs( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t PandaState::Reader::getCanFwdErrs() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t PandaState::Builder::getCanFwdErrs() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setCanFwdErrs( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t PandaState::Reader::getGmlanSendErrs() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t PandaState::Builder::getGmlanSendErrs() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setGmlanSendErrs( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::PandaState::PandaType PandaState::Reader::getPandaType() const { + return _reader.getDataField< ::cereal::PandaState::PandaType>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::cereal::PandaState::PandaType PandaState::Builder::getPandaType() { + return _builder.getDataField< ::cereal::PandaState::PandaType>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setPandaType( ::cereal::PandaState::PandaType value) { + _builder.setDataField< ::cereal::PandaState::PandaType>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t PandaState::Reader::getFanSpeedRpmDEPRECATED() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t PandaState::Builder::getFanSpeedRpmDEPRECATED() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setFanSpeedRpmDEPRECATED( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::PeripheralState::UsbPowerMode PandaState::Reader::getUsbPowerModeDEPRECATED() const { + return _reader.getDataField< ::cereal::PeripheralState::UsbPowerMode>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline ::cereal::PeripheralState::UsbPowerMode PandaState::Builder::getUsbPowerModeDEPRECATED() { + return _builder.getDataField< ::cereal::PeripheralState::UsbPowerMode>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setUsbPowerModeDEPRECATED( ::cereal::PeripheralState::UsbPowerMode value) { + _builder.setDataField< ::cereal::PeripheralState::UsbPowerMode>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline bool PandaState::Reader::getIgnitionCan() const { + return _reader.getDataField( + ::capnp::bounded<69>() * ::capnp::ELEMENTS); +} + +inline bool PandaState::Builder::getIgnitionCan() { + return _builder.getDataField( + ::capnp::bounded<69>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setIgnitionCan(bool value) { + _builder.setDataField( + ::capnp::bounded<69>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::CarParams::SafetyModel PandaState::Reader::getSafetyModel() const { + return _reader.getDataField< ::cereal::CarParams::SafetyModel>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarParams::SafetyModel PandaState::Builder::getSafetyModel() { + return _builder.getDataField< ::cereal::CarParams::SafetyModel>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setSafetyModel( ::cereal::CarParams::SafetyModel value) { + _builder.setDataField< ::cereal::CarParams::SafetyModel>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::PandaState::FaultStatus PandaState::Reader::getFaultStatus() const { + return _reader.getDataField< ::cereal::PandaState::FaultStatus>( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline ::cereal::PandaState::FaultStatus PandaState::Builder::getFaultStatus() { + return _builder.getDataField< ::cereal::PandaState::FaultStatus>( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setFaultStatus( ::cereal::PandaState::FaultStatus value) { + _builder.setDataField< ::cereal::PandaState::FaultStatus>( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline bool PandaState::Reader::getPowerSaveEnabled() const { + return _reader.getDataField( + ::capnp::bounded<70>() * ::capnp::ELEMENTS); +} + +inline bool PandaState::Builder::getPowerSaveEnabled() { + return _builder.getDataField( + ::capnp::bounded<70>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setPowerSaveEnabled(bool value) { + _builder.setDataField( + ::capnp::bounded<70>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t PandaState::Reader::getUptime() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t PandaState::Builder::getUptime() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setUptime( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline bool PandaState::Reader::hasFaults() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool PandaState::Builder::hasFaults() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>::Reader PandaState::Reader::getFaults() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>::Builder PandaState::Builder::getFaults() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void PandaState::Builder::setFaults( ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void PandaState::Builder::setFaults(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>::Builder PandaState::Builder::initFaults(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void PandaState::Builder::adoptFaults( + ::capnp::Orphan< ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>> PandaState::Builder::disownFaults() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::PandaState::FaultType, ::capnp::Kind::ENUM>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::uint32_t PandaState::Reader::getCanRxErrs() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t PandaState::Builder::getCanRxErrs() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setCanRxErrs( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline ::int16_t PandaState::Reader::getSafetyParam() const { + return _reader.getDataField< ::int16_t>( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} + +inline ::int16_t PandaState::Builder::getSafetyParam() { + return _builder.getDataField< ::int16_t>( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setSafetyParam( ::int16_t value) { + _builder.setDataField< ::int16_t>( + ::capnp::bounded<20>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::PandaState::HarnessStatus PandaState::Reader::getHarnessStatus() const { + return _reader.getDataField< ::cereal::PandaState::HarnessStatus>( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} + +inline ::cereal::PandaState::HarnessStatus PandaState::Builder::getHarnessStatus() { + return _builder.getDataField< ::cereal::PandaState::HarnessStatus>( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setHarnessStatus( ::cereal::PandaState::HarnessStatus value) { + _builder.setDataField< ::cereal::PandaState::HarnessStatus>( + ::capnp::bounded<21>() * ::capnp::ELEMENTS, value); +} + +inline bool PandaState::Reader::getHeartbeatLost() const { + return _reader.getDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS); +} + +inline bool PandaState::Builder::getHeartbeatLost() { + return _builder.getDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setHeartbeatLost(bool value) { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, value); +} + +inline ::int16_t PandaState::Reader::getUnsafeMode() const { + return _reader.getDataField< ::int16_t>( + ::capnp::bounded<22>() * ::capnp::ELEMENTS); +} + +inline ::int16_t PandaState::Builder::getUnsafeMode() { + return _builder.getDataField< ::int16_t>( + ::capnp::bounded<22>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setUnsafeMode( ::int16_t value) { + _builder.setDataField< ::int16_t>( + ::capnp::bounded<22>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t PandaState::Reader::getBlockedCnt() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t PandaState::Builder::getBlockedCnt() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void PandaState::Builder::setBlockedCnt( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::PandaState::PandaType PeripheralState::Reader::getPandaType() const { + return _reader.getDataField< ::cereal::PandaState::PandaType>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::cereal::PandaState::PandaType PeripheralState::Builder::getPandaType() { + return _builder.getDataField< ::cereal::PandaState::PandaType>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void PeripheralState::Builder::setPandaType( ::cereal::PandaState::PandaType value) { + _builder.setDataField< ::cereal::PandaState::PandaType>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t PeripheralState::Reader::getVoltage() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t PeripheralState::Builder::getVoltage() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void PeripheralState::Builder::setVoltage( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t PeripheralState::Reader::getCurrent() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t PeripheralState::Builder::getCurrent() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void PeripheralState::Builder::setCurrent( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t PeripheralState::Reader::getFanSpeedRpm() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t PeripheralState::Builder::getFanSpeedRpm() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void PeripheralState::Builder::setFanSpeedRpm( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::PeripheralState::UsbPowerMode PeripheralState::Reader::getUsbPowerMode() const { + return _reader.getDataField< ::cereal::PeripheralState::UsbPowerMode>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::cereal::PeripheralState::UsbPowerMode PeripheralState::Builder::getUsbPowerMode() { + return _builder.getDataField< ::cereal::PeripheralState::UsbPowerMode>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void PeripheralState::Builder::setUsbPowerMode( ::cereal::PeripheralState::UsbPowerMode value) { + _builder.setDataField< ::cereal::PeripheralState::UsbPowerMode>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool RadarState::Reader::hasWarpMatrixDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool RadarState::Builder::hasWarpMatrixDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader RadarState::Reader::getWarpMatrixDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder RadarState::Builder::getWarpMatrixDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void RadarState::Builder::setWarpMatrixDEPRECATED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void RadarState::Builder::setWarpMatrixDEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder RadarState::Builder::initWarpMatrixDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void RadarState::Builder::adoptWarpMatrixDEPRECATED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> RadarState::Builder::disownWarpMatrixDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline float RadarState::Reader::getAngleOffsetDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float RadarState::Builder::getAngleOffsetDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void RadarState::Builder::setAngleOffsetDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int8_t RadarState::Reader::getCalStatusDEPRECATED() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::int8_t RadarState::Builder::getCalStatusDEPRECATED() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void RadarState::Builder::setCalStatusDEPRECATED( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline bool RadarState::Reader::hasLeadOne() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool RadarState::Builder::hasLeadOne() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::RadarState::LeadData::Reader RadarState::Reader::getLeadOne() const { + return ::capnp::_::PointerHelpers< ::cereal::RadarState::LeadData>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::cereal::RadarState::LeadData::Builder RadarState::Builder::getLeadOne() { + return ::capnp::_::PointerHelpers< ::cereal::RadarState::LeadData>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::RadarState::LeadData::Pipeline RadarState::Pipeline::getLeadOne() { + return ::cereal::RadarState::LeadData::Pipeline(_typeless.getPointerField(1)); +} +#endif // !CAPNP_LITE +inline void RadarState::Builder::setLeadOne( ::cereal::RadarState::LeadData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::RadarState::LeadData>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::cereal::RadarState::LeadData::Builder RadarState::Builder::initLeadOne() { + return ::capnp::_::PointerHelpers< ::cereal::RadarState::LeadData>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void RadarState::Builder::adoptLeadOne( + ::capnp::Orphan< ::cereal::RadarState::LeadData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::RadarState::LeadData>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::RadarState::LeadData> RadarState::Builder::disownLeadOne() { + return ::capnp::_::PointerHelpers< ::cereal::RadarState::LeadData>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool RadarState::Reader::hasLeadTwo() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool RadarState::Builder::hasLeadTwo() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::RadarState::LeadData::Reader RadarState::Reader::getLeadTwo() const { + return ::capnp::_::PointerHelpers< ::cereal::RadarState::LeadData>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::cereal::RadarState::LeadData::Builder RadarState::Builder::getLeadTwo() { + return ::capnp::_::PointerHelpers< ::cereal::RadarState::LeadData>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::RadarState::LeadData::Pipeline RadarState::Pipeline::getLeadTwo() { + return ::cereal::RadarState::LeadData::Pipeline(_typeless.getPointerField(2)); +} +#endif // !CAPNP_LITE +inline void RadarState::Builder::setLeadTwo( ::cereal::RadarState::LeadData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::RadarState::LeadData>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::cereal::RadarState::LeadData::Builder RadarState::Builder::initLeadTwo() { + return ::capnp::_::PointerHelpers< ::cereal::RadarState::LeadData>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void RadarState::Builder::adoptLeadTwo( + ::capnp::Orphan< ::cereal::RadarState::LeadData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::RadarState::LeadData>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::RadarState::LeadData> RadarState::Builder::disownLeadTwo() { + return ::capnp::_::PointerHelpers< ::cereal::RadarState::LeadData>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline float RadarState::Reader::getCumLagMs() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float RadarState::Builder::getCumLagMs() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void RadarState::Builder::setCumLagMs(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t RadarState::Reader::getMdMonoTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t RadarState::Builder::getMdMonoTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void RadarState::Builder::setMdMonoTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t RadarState::Reader::getFtMonoTimeDEPRECATED() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t RadarState::Builder::getFtMonoTimeDEPRECATED() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void RadarState::Builder::setFtMonoTimeDEPRECATED( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t RadarState::Reader::getCalCycleDEPRECATED() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::int32_t RadarState::Builder::getCalCycleDEPRECATED() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void RadarState::Builder::setCalCycleDEPRECATED( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::int8_t RadarState::Reader::getCalPercDEPRECATED() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::int8_t RadarState::Builder::getCalPercDEPRECATED() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void RadarState::Builder::setCalPercDEPRECATED( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool RadarState::Reader::hasCanMonoTimes() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool RadarState::Builder::hasCanMonoTimes() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader RadarState::Reader::getCanMonoTimes() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder RadarState::Builder::getCanMonoTimes() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void RadarState::Builder::setCanMonoTimes( ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void RadarState::Builder::setCanMonoTimes(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder RadarState::Builder::initCanMonoTimes(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void RadarState::Builder::adoptCanMonoTimes( + ::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>> RadarState::Builder::disownCanMonoTimes() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline ::uint64_t RadarState::Reader::getCarStateMonoTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t RadarState::Builder::getCarStateMonoTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void RadarState::Builder::setCarStateMonoTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline bool RadarState::Reader::hasRadarErrors() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool RadarState::Builder::hasRadarErrors() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Reader RadarState::Reader::getRadarErrors() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Builder RadarState::Builder::getRadarErrors() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void RadarState::Builder::setRadarErrors( ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void RadarState::Builder::setRadarErrors(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>::Builder RadarState::Builder::initRadarErrors(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void RadarState::Builder::adoptRadarErrors( + ::capnp::Orphan< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>> RadarState::Builder::disownRadarErrors() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::RadarData::Error, ::capnp::Kind::ENUM>>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline float RadarState::LeadData::Reader::getDRel() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float RadarState::LeadData::Builder::getDRel() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setDRel(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float RadarState::LeadData::Reader::getYRel() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float RadarState::LeadData::Builder::getYRel() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setYRel(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float RadarState::LeadData::Reader::getVRel() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float RadarState::LeadData::Builder::getVRel() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setVRel(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float RadarState::LeadData::Reader::getARel() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float RadarState::LeadData::Builder::getARel() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setARel(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float RadarState::LeadData::Reader::getVLead() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float RadarState::LeadData::Builder::getVLead() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setVLead(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float RadarState::LeadData::Reader::getALeadDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float RadarState::LeadData::Builder::getALeadDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setALeadDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float RadarState::LeadData::Reader::getDPath() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float RadarState::LeadData::Builder::getDPath() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setDPath(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float RadarState::LeadData::Reader::getVLat() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float RadarState::LeadData::Builder::getVLat() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setVLat(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float RadarState::LeadData::Reader::getVLeadK() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float RadarState::LeadData::Builder::getVLeadK() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setVLeadK(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float RadarState::LeadData::Reader::getALeadK() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline float RadarState::LeadData::Builder::getALeadK() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setALeadK(float value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline bool RadarState::LeadData::Reader::getFcw() const { + return _reader.getDataField( + ::capnp::bounded<320>() * ::capnp::ELEMENTS); +} + +inline bool RadarState::LeadData::Builder::getFcw() { + return _builder.getDataField( + ::capnp::bounded<320>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setFcw(bool value) { + _builder.setDataField( + ::capnp::bounded<320>() * ::capnp::ELEMENTS, value); +} + +inline bool RadarState::LeadData::Reader::getStatus() const { + return _reader.getDataField( + ::capnp::bounded<321>() * ::capnp::ELEMENTS); +} + +inline bool RadarState::LeadData::Builder::getStatus() { + return _builder.getDataField( + ::capnp::bounded<321>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setStatus(bool value) { + _builder.setDataField( + ::capnp::bounded<321>() * ::capnp::ELEMENTS, value); +} + +inline float RadarState::LeadData::Reader::getALeadTau() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline float RadarState::LeadData::Builder::getALeadTau() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setALeadTau(float value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline float RadarState::LeadData::Reader::getModelProb() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline float RadarState::LeadData::Builder::getModelProb() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setModelProb(float value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline bool RadarState::LeadData::Reader::getRadar() const { + return _reader.getDataField( + ::capnp::bounded<322>() * ::capnp::ELEMENTS); +} + +inline bool RadarState::LeadData::Builder::getRadar() { + return _builder.getDataField( + ::capnp::bounded<322>() * ::capnp::ELEMENTS); +} +inline void RadarState::LeadData::Builder::setRadar(bool value) { + _builder.setDataField( + ::capnp::bounded<322>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveCalibrationData::Reader::hasWarpMatrixDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveCalibrationData::Builder::hasWarpMatrixDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveCalibrationData::Reader::getWarpMatrixDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveCalibrationData::Builder::getWarpMatrixDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LiveCalibrationData::Builder::setWarpMatrixDEPRECATED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void LiveCalibrationData::Builder::setWarpMatrixDEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveCalibrationData::Builder::initWarpMatrixDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void LiveCalibrationData::Builder::adoptWarpMatrixDEPRECATED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveCalibrationData::Builder::disownWarpMatrixDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::int8_t LiveCalibrationData::Reader::getCalStatus() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int8_t LiveCalibrationData::Builder::getCalStatus() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LiveCalibrationData::Builder::setCalStatus( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t LiveCalibrationData::Reader::getCalCycle() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int32_t LiveCalibrationData::Builder::getCalCycle() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveCalibrationData::Builder::setCalCycle( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int8_t LiveCalibrationData::Reader::getCalPerc() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int8_t LiveCalibrationData::Builder::getCalPerc() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveCalibrationData::Builder::setCalPerc( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveCalibrationData::Reader::hasExtrinsicMatrix() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveCalibrationData::Builder::hasExtrinsicMatrix() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveCalibrationData::Reader::getExtrinsicMatrix() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveCalibrationData::Builder::getExtrinsicMatrix() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void LiveCalibrationData::Builder::setExtrinsicMatrix( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void LiveCalibrationData::Builder::setExtrinsicMatrix(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveCalibrationData::Builder::initExtrinsicMatrix(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void LiveCalibrationData::Builder::adoptExtrinsicMatrix( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveCalibrationData::Builder::disownExtrinsicMatrix() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool LiveCalibrationData::Reader::hasWarpMatrix2DEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveCalibrationData::Builder::hasWarpMatrix2DEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveCalibrationData::Reader::getWarpMatrix2DEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveCalibrationData::Builder::getWarpMatrix2DEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void LiveCalibrationData::Builder::setWarpMatrix2DEPRECATED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void LiveCalibrationData::Builder::setWarpMatrix2DEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveCalibrationData::Builder::initWarpMatrix2DEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void LiveCalibrationData::Builder::adoptWarpMatrix2DEPRECATED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveCalibrationData::Builder::disownWarpMatrix2DEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool LiveCalibrationData::Reader::hasWarpMatrixBigDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveCalibrationData::Builder::hasWarpMatrixBigDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveCalibrationData::Reader::getWarpMatrixBigDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveCalibrationData::Builder::getWarpMatrixBigDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void LiveCalibrationData::Builder::setWarpMatrixBigDEPRECATED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void LiveCalibrationData::Builder::setWarpMatrixBigDEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveCalibrationData::Builder::initWarpMatrixBigDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void LiveCalibrationData::Builder::adoptWarpMatrixBigDEPRECATED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveCalibrationData::Builder::disownWarpMatrixBigDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool LiveCalibrationData::Reader::hasRpyCalib() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveCalibrationData::Builder::hasRpyCalib() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveCalibrationData::Reader::getRpyCalib() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveCalibrationData::Builder::getRpyCalib() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void LiveCalibrationData::Builder::setRpyCalib( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void LiveCalibrationData::Builder::setRpyCalib(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveCalibrationData::Builder::initRpyCalib(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void LiveCalibrationData::Builder::adoptRpyCalib( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveCalibrationData::Builder::disownRpyCalib() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool LiveCalibrationData::Reader::hasRpyCalibSpread() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveCalibrationData::Builder::hasRpyCalibSpread() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveCalibrationData::Reader::getRpyCalibSpread() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveCalibrationData::Builder::getRpyCalibSpread() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void LiveCalibrationData::Builder::setRpyCalibSpread( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void LiveCalibrationData::Builder::setRpyCalibSpread(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveCalibrationData::Builder::initRpyCalibSpread(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void LiveCalibrationData::Builder::adoptRpyCalibSpread( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveCalibrationData::Builder::disownRpyCalibSpread() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline ::int32_t LiveCalibrationData::Reader::getValidBlocks() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int32_t LiveCalibrationData::Builder::getValidBlocks() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LiveCalibrationData::Builder::setValidBlocks( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t LiveTracks::Reader::getTrackId() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t LiveTracks::Builder::getTrackId() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LiveTracks::Builder::setTrackId( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float LiveTracks::Reader::getDRel() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float LiveTracks::Builder::getDRel() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveTracks::Builder::setDRel(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float LiveTracks::Reader::getYRel() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float LiveTracks::Builder::getYRel() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LiveTracks::Builder::setYRel(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float LiveTracks::Reader::getVRel() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float LiveTracks::Builder::getVRel() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void LiveTracks::Builder::setVRel(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float LiveTracks::Reader::getARel() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float LiveTracks::Builder::getARel() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void LiveTracks::Builder::setARel(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float LiveTracks::Reader::getTimeStamp() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float LiveTracks::Builder::getTimeStamp() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void LiveTracks::Builder::setTimeStamp(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float LiveTracks::Reader::getStatus() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float LiveTracks::Builder::getStatus() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void LiveTracks::Builder::setStatus(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float LiveTracks::Reader::getCurrentTime() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float LiveTracks::Builder::getCurrentTime() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void LiveTracks::Builder::setCurrentTime(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveTracks::Reader::getStationary() const { + return _reader.getDataField( + ::capnp::bounded<256>() * ::capnp::ELEMENTS); +} + +inline bool LiveTracks::Builder::getStationary() { + return _builder.getDataField( + ::capnp::bounded<256>() * ::capnp::ELEMENTS); +} +inline void LiveTracks::Builder::setStationary(bool value) { + _builder.setDataField( + ::capnp::bounded<256>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveTracks::Reader::getOncoming() const { + return _reader.getDataField( + ::capnp::bounded<257>() * ::capnp::ELEMENTS); +} + +inline bool LiveTracks::Builder::getOncoming() { + return _builder.getDataField( + ::capnp::bounded<257>() * ::capnp::ELEMENTS); +} +inline void LiveTracks::Builder::setOncoming(bool value) { + _builder.setDataField( + ::capnp::bounded<257>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getVEgoDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getVEgoDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setVEgoDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getAEgoDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getAEgoDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setAEgoDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getVPid() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getVPid() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setVPid(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getVTargetLead() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getVTargetLead() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setVTargetLead(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getUpAccelCmd() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getUpAccelCmd() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setUpAccelCmd(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getUiAccelCmd() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getUiAccelCmd() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setUiAccelCmd(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getYActualDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getYActualDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setYActualDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getYDesDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getYDesDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setYDesDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getUpSteerDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getUpSteerDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setUpSteerDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getUiSteerDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getUiSteerDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setUiSteerDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getATargetMinDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getATargetMinDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setATargetMinDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getATargetMaxDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getATargetMaxDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setATargetMaxDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getJerkFactorDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getJerkFactorDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setJerkFactorDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getAngleSteersDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getAngleSteersDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setAngleSteersDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t ControlsState::Reader::getHudLeadDEPRECATED() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline ::int32_t ControlsState::Builder::getHudLeadDEPRECATED() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setHudLeadDEPRECATED( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getCumLagMs() const { + return _reader.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getCumLagMs() { + return _builder.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setCumLagMs(float value) { + _builder.setDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ControlsState::Reader::getCanMonoTimeDEPRECATED() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ControlsState::Builder::getCanMonoTimeDEPRECATED() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setCanMonoTimeDEPRECATED( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ControlsState::Reader::getRadarStateMonoTimeDEPRECATED() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ControlsState::Builder::getRadarStateMonoTimeDEPRECATED() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setRadarStateMonoTimeDEPRECATED( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ControlsState::Reader::getMdMonoTimeDEPRECATED() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ControlsState::Builder::getMdMonoTimeDEPRECATED() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setMdMonoTimeDEPRECATED( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::Reader::getEnabled() const { + return _reader.getDataField( + ::capnp::bounded<704>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::Builder::getEnabled() { + return _builder.getDataField( + ::capnp::bounded<704>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setEnabled(bool value) { + _builder.setDataField( + ::capnp::bounded<704>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::Reader::getSteerOverrideDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<705>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::Builder::getSteerOverrideDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<705>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setSteerOverrideDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<705>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::Reader::hasCanMonoTimes() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ControlsState::Builder::hasCanMonoTimes() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader ControlsState::Reader::getCanMonoTimes() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder ControlsState::Builder::getCanMonoTimes() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ControlsState::Builder::setCanMonoTimes( ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void ControlsState::Builder::setCanMonoTimes(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>::Builder ControlsState::Builder::initCanMonoTimes(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void ControlsState::Builder::adoptCanMonoTimes( + ::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>> ControlsState::Builder::disownCanMonoTimes() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::uint64_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline float ControlsState::Reader::getVCruise() const { + return _reader.getDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getVCruise() { + return _builder.getDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setVCruise(float value) { + _builder.setDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::Reader::getRearViewCamDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<706>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::Builder::getRearViewCamDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<706>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setRearViewCamDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<706>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::Reader::hasAlertText1() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool ControlsState::Builder::hasAlertText1() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader ControlsState::Reader::getAlertText1() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder ControlsState::Builder::getAlertText1() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void ControlsState::Builder::setAlertText1( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder ControlsState::Builder::initAlertText1(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void ControlsState::Builder::adoptAlertText1( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> ControlsState::Builder::disownAlertText1() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool ControlsState::Reader::hasAlertText2() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool ControlsState::Builder::hasAlertText2() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader ControlsState::Reader::getAlertText2() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder ControlsState::Builder::getAlertText2() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void ControlsState::Builder::setAlertText2( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder ControlsState::Builder::initAlertText2(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void ControlsState::Builder::adoptAlertText2( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> ControlsState::Builder::disownAlertText2() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline float ControlsState::Reader::getAwarenessStatusDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getAwarenessStatusDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setAwarenessStatusDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getAngleModelBiasDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getAngleModelBiasDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setAngleModelBiasDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ControlsState::Reader::getLongitudinalPlanMonoTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ControlsState::Builder::getLongitudinalPlanMonoTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setLongitudinalPlanMonoTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getSteeringAngleDesiredDegDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getSteeringAngleDesiredDegDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setSteeringAngleDesiredDegDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::CarControl::Actuators::LongControlState ControlsState::Reader::getLongControlState() const { + return _reader.getDataField< ::cereal::CarControl::Actuators::LongControlState>( + ::capnp::bounded<45>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarControl::Actuators::LongControlState ControlsState::Builder::getLongControlState() { + return _builder.getDataField< ::cereal::CarControl::Actuators::LongControlState>( + ::capnp::bounded<45>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setLongControlState( ::cereal::CarControl::Actuators::LongControlState value) { + _builder.setDataField< ::cereal::CarControl::Actuators::LongControlState>( + ::capnp::bounded<45>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::ControlsState::OpenpilotState ControlsState::Reader::getState() const { + return _reader.getDataField< ::cereal::ControlsState::OpenpilotState>( + ::capnp::bounded<58>() * ::capnp::ELEMENTS); +} + +inline ::cereal::ControlsState::OpenpilotState ControlsState::Builder::getState() { + return _builder.getDataField< ::cereal::ControlsState::OpenpilotState>( + ::capnp::bounded<58>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setState( ::cereal::ControlsState::OpenpilotState value) { + _builder.setDataField< ::cereal::ControlsState::OpenpilotState>( + ::capnp::bounded<58>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getVEgoRawDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<30>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getVEgoRawDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<30>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setVEgoRawDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<30>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getUfAccelCmd() const { + return _reader.getDataField( + ::capnp::bounded<31>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getUfAccelCmd() { + return _builder.getDataField( + ::capnp::bounded<31>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setUfAccelCmd(float value) { + _builder.setDataField( + ::capnp::bounded<31>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getUfSteerDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<32>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getUfSteerDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<32>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setUfSteerDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<32>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getATarget() const { + return _reader.getDataField( + ::capnp::bounded<33>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getATarget() { + return _builder.getDataField( + ::capnp::bounded<33>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setATarget(float value) { + _builder.setDataField( + ::capnp::bounded<33>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::Reader::getActive() const { + return _reader.getDataField( + ::capnp::bounded<707>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::Builder::getActive() { + return _builder.getDataField( + ::capnp::bounded<707>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setActive(bool value) { + _builder.setDataField( + ::capnp::bounded<707>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getCurvature() const { + return _reader.getDataField( + ::capnp::bounded<34>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getCurvature() { + return _builder.getDataField( + ::capnp::bounded<34>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setCurvature(float value) { + _builder.setDataField( + ::capnp::bounded<34>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::ControlsState::AlertStatus ControlsState::Reader::getAlertStatus() const { + return _reader.getDataField< ::cereal::ControlsState::AlertStatus>( + ::capnp::bounded<59>() * ::capnp::ELEMENTS); +} + +inline ::cereal::ControlsState::AlertStatus ControlsState::Builder::getAlertStatus() { + return _builder.getDataField< ::cereal::ControlsState::AlertStatus>( + ::capnp::bounded<59>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setAlertStatus( ::cereal::ControlsState::AlertStatus value) { + _builder.setDataField< ::cereal::ControlsState::AlertStatus>( + ::capnp::bounded<59>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::ControlsState::AlertSize ControlsState::Reader::getAlertSize() const { + return _reader.getDataField< ::cereal::ControlsState::AlertSize>( + ::capnp::bounded<70>() * ::capnp::ELEMENTS); +} + +inline ::cereal::ControlsState::AlertSize ControlsState::Builder::getAlertSize() { + return _builder.getDataField< ::cereal::ControlsState::AlertSize>( + ::capnp::bounded<70>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setAlertSize( ::cereal::ControlsState::AlertSize value) { + _builder.setDataField< ::cereal::ControlsState::AlertSize>( + ::capnp::bounded<70>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::Reader::getGpsPlannerActiveDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<708>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::Builder::getGpsPlannerActiveDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<708>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setGpsPlannerActiveDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<708>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::Reader::getEngageable() const { + return _reader.getDataField( + ::capnp::bounded<709>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::Builder::getEngageable() { + return _builder.getDataField( + ::capnp::bounded<709>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setEngageable(bool value) { + _builder.setDataField( + ::capnp::bounded<709>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::Reader::getAlertBlinkingRate() const { + return _reader.getDataField( + ::capnp::bounded<36>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getAlertBlinkingRate() { + return _builder.getDataField( + ::capnp::bounded<36>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setAlertBlinkingRate(float value) { + _builder.setDataField( + ::capnp::bounded<36>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::Reader::getDriverMonitoringOnDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<710>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::Builder::getDriverMonitoringOnDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<710>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setDriverMonitoringOnDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<710>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::Reader::hasAlertType() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool ControlsState::Builder::hasAlertType() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader ControlsState::Reader::getAlertType() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder ControlsState::Builder::getAlertType() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void ControlsState::Builder::setAlertType( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder ControlsState::Builder::initAlertType(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void ControlsState::Builder::adoptAlertType( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> ControlsState::Builder::disownAlertType() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool ControlsState::Reader::hasAlertSoundDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool ControlsState::Builder::hasAlertSoundDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader ControlsState::Reader::getAlertSoundDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder ControlsState::Builder::getAlertSoundDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void ControlsState::Builder::setAlertSoundDEPRECATED( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder ControlsState::Builder::initAlertSoundDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void ControlsState::Builder::adoptAlertSoundDEPRECATED( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> ControlsState::Builder::disownAlertSoundDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline float ControlsState::Reader::getVCurvatureDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<37>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::Builder::getVCurvatureDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<37>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setVCurvatureDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<37>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::Reader::getDecelForTurnDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<711>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::Builder::getDecelForTurnDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<711>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setDecelForTurnDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<711>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ControlsState::Reader::getStartMonoTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<19>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ControlsState::Builder::getStartMonoTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<19>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setStartMonoTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<19>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::Reader::getMapValidDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<712>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::Builder::getMapValidDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<712>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setMapValidDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<712>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ControlsState::Reader::getLateralPlanMonoTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ControlsState::Builder::getLateralPlanMonoTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setLateralPlanMonoTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<20>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::Reader::getForceDecel() const { + return _reader.getDataField( + ::capnp::bounded<713>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::Builder::getForceDecel() { + return _builder.getDataField( + ::capnp::bounded<713>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setForceDecel(bool value) { + _builder.setDataField( + ::capnp::bounded<713>() * ::capnp::ELEMENTS, value); +} + +inline typename ControlsState::LateralControlState::Reader ControlsState::Reader::getLateralControlState() const { + return typename ControlsState::LateralControlState::Reader(_reader); +} +inline typename ControlsState::LateralControlState::Builder ControlsState::Builder::getLateralControlState() { + return typename ControlsState::LateralControlState::Builder(_builder); +} +#if !CAPNP_LITE +inline typename ControlsState::LateralControlState::Pipeline ControlsState::Pipeline::getLateralControlState() { + return typename ControlsState::LateralControlState::Pipeline(_typeless.noop()); +} +#endif // !CAPNP_LITE +inline typename ControlsState::LateralControlState::Builder ControlsState::Builder::initLateralControlState() { + _builder.setDataField< ::uint16_t>(::capnp::bounded<71>() * ::capnp::ELEMENTS, 0); + _builder.getPointerField(::capnp::bounded<5>() * ::capnp::POINTERS).clear(); + return typename ControlsState::LateralControlState::Builder(_builder); +} +inline bool ControlsState::Reader::getDecelForModelDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<714>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::Builder::getDecelForModelDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<714>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setDecelForModelDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<714>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::CarControl::HUDControl::AudibleAlert ControlsState::Reader::getAlertSound() const { + return _reader.getDataField< ::cereal::CarControl::HUDControl::AudibleAlert>( + ::capnp::bounded<84>() * ::capnp::ELEMENTS); +} + +inline ::cereal::CarControl::HUDControl::AudibleAlert ControlsState::Builder::getAlertSound() { + return _builder.getDataField< ::cereal::CarControl::HUDControl::AudibleAlert>( + ::capnp::bounded<84>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setAlertSound( ::cereal::CarControl::HUDControl::AudibleAlert value) { + _builder.setDataField< ::cereal::CarControl::HUDControl::AudibleAlert>( + ::capnp::bounded<84>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t ControlsState::Reader::getCanErrorCounter() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<43>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t ControlsState::Builder::getCanErrorCounter() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<43>() * ::capnp::ELEMENTS); +} +inline void ControlsState::Builder::setCanErrorCounter( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<43>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::LateralINDIState::Reader::getActive() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::LateralINDIState::Builder::getActive() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralINDIState::Builder::setActive(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralINDIState::Reader::getSteeringAngleDeg() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralINDIState::Builder::getSteeringAngleDeg() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralINDIState::Builder::setSteeringAngleDeg(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralINDIState::Reader::getSteeringRateDeg() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralINDIState::Builder::getSteeringRateDeg() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralINDIState::Builder::setSteeringRateDeg(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralINDIState::Reader::getSteeringAccelDeg() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralINDIState::Builder::getSteeringAccelDeg() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralINDIState::Builder::setSteeringAccelDeg(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralINDIState::Reader::getRateSetPoint() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralINDIState::Builder::getRateSetPoint() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralINDIState::Builder::setRateSetPoint(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralINDIState::Reader::getAccelSetPoint() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralINDIState::Builder::getAccelSetPoint() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralINDIState::Builder::setAccelSetPoint(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralINDIState::Reader::getAccelError() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralINDIState::Builder::getAccelError() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralINDIState::Builder::setAccelError(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralINDIState::Reader::getDelayedOutput() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralINDIState::Builder::getDelayedOutput() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralINDIState::Builder::setDelayedOutput(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralINDIState::Reader::getDelta() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralINDIState::Builder::getDelta() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralINDIState::Builder::setDelta(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralINDIState::Reader::getOutput() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralINDIState::Builder::getOutput() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralINDIState::Builder::setOutput(float value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::LateralINDIState::Reader::getSaturated() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::LateralINDIState::Builder::getSaturated() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralINDIState::Builder::setSaturated(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralINDIState::Reader::getSteeringAngleDesiredDeg() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralINDIState::Builder::getSteeringAngleDesiredDeg() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralINDIState::Builder::setSteeringAngleDesiredDeg(float value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralINDIState::Reader::getSteeringRateDesiredDeg() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralINDIState::Builder::getSteeringRateDesiredDeg() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralINDIState::Builder::setSteeringRateDesiredDeg(float value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::LateralPIDState::Reader::getActive() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::LateralPIDState::Builder::getActive() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralPIDState::Builder::setActive(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralPIDState::Reader::getSteeringAngleDeg() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralPIDState::Builder::getSteeringAngleDeg() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralPIDState::Builder::setSteeringAngleDeg(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralPIDState::Reader::getSteeringRateDeg() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralPIDState::Builder::getSteeringRateDeg() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralPIDState::Builder::setSteeringRateDeg(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralPIDState::Reader::getAngleError() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralPIDState::Builder::getAngleError() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralPIDState::Builder::setAngleError(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralPIDState::Reader::getP() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralPIDState::Builder::getP() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralPIDState::Builder::setP(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralPIDState::Reader::getI() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralPIDState::Builder::getI() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralPIDState::Builder::setI(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralPIDState::Reader::getF() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralPIDState::Builder::getF() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralPIDState::Builder::setF(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralPIDState::Reader::getOutput() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralPIDState::Builder::getOutput() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralPIDState::Builder::setOutput(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::LateralPIDState::Reader::getSaturated() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::LateralPIDState::Builder::getSaturated() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralPIDState::Builder::setSaturated(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralPIDState::Reader::getSteeringAngleDesiredDeg() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralPIDState::Builder::getSteeringAngleDesiredDeg() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralPIDState::Builder::setSteeringAngleDesiredDeg(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::LateralLQRState::Reader::getActive() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::LateralLQRState::Builder::getActive() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralLQRState::Builder::setActive(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralLQRState::Reader::getSteeringAngleDeg() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralLQRState::Builder::getSteeringAngleDeg() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralLQRState::Builder::setSteeringAngleDeg(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralLQRState::Reader::getI() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralLQRState::Builder::getI() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralLQRState::Builder::setI(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralLQRState::Reader::getOutput() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralLQRState::Builder::getOutput() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralLQRState::Builder::setOutput(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralLQRState::Reader::getLqrOutput() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralLQRState::Builder::getLqrOutput() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralLQRState::Builder::setLqrOutput(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::LateralLQRState::Reader::getSaturated() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::LateralLQRState::Builder::getSaturated() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralLQRState::Builder::setSaturated(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralLQRState::Reader::getSteeringAngleDesiredDeg() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralLQRState::Builder::getSteeringAngleDesiredDeg() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralLQRState::Builder::setSteeringAngleDesiredDeg(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::LateralAngleState::Reader::getActive() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::LateralAngleState::Builder::getActive() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralAngleState::Builder::setActive(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralAngleState::Reader::getSteeringAngleDeg() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralAngleState::Builder::getSteeringAngleDeg() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralAngleState::Builder::setSteeringAngleDeg(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralAngleState::Reader::getOutput() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralAngleState::Builder::getOutput() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralAngleState::Builder::setOutput(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::LateralAngleState::Reader::getSaturated() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::LateralAngleState::Builder::getSaturated() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralAngleState::Builder::setSaturated(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralAngleState::Reader::getSteeringAngleDesiredDeg() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralAngleState::Builder::getSteeringAngleDesiredDeg() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralAngleState::Builder::setSteeringAngleDesiredDeg(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::LateralDebugState::Reader::getActive() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::LateralDebugState::Builder::getActive() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralDebugState::Builder::setActive(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralDebugState::Reader::getSteeringAngleDeg() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralDebugState::Builder::getSteeringAngleDeg() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralDebugState::Builder::setSteeringAngleDeg(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ControlsState::LateralDebugState::Reader::getOutput() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float ControlsState::LateralDebugState::Builder::getOutput() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralDebugState::Builder::setOutput(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool ControlsState::LateralDebugState::Reader::getSaturated() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::LateralDebugState::Builder::getSaturated() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ControlsState::LateralDebugState::Builder::setSaturated(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::ControlsState::LateralControlState::Which ControlsState::LateralControlState::Reader::which() const { + return _reader.getDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS); +} +inline ::cereal::ControlsState::LateralControlState::Which ControlsState::LateralControlState::Builder::which() { + return _builder.getDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS); +} + +inline bool ControlsState::LateralControlState::Reader::isIndiState() const { + return which() == ControlsState::LateralControlState::INDI_STATE; +} +inline bool ControlsState::LateralControlState::Builder::isIndiState() { + return which() == ControlsState::LateralControlState::INDI_STATE; +} +inline bool ControlsState::LateralControlState::Reader::hasIndiState() const { + if (which() != ControlsState::LateralControlState::INDI_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool ControlsState::LateralControlState::Builder::hasIndiState() { + if (which() != ControlsState::LateralControlState::INDI_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ControlsState::LateralINDIState::Reader ControlsState::LateralControlState::Reader::getIndiState() const { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::INDI_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralINDIState>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::cereal::ControlsState::LateralINDIState::Builder ControlsState::LateralControlState::Builder::getIndiState() { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::INDI_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralINDIState>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ControlsState::LateralControlState::Builder::setIndiState( ::cereal::ControlsState::LateralINDIState::Reader value) { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::INDI_STATE); + ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralINDIState>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::cereal::ControlsState::LateralINDIState::Builder ControlsState::LateralControlState::Builder::initIndiState() { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::INDI_STATE); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralINDIState>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ControlsState::LateralControlState::Builder::adoptIndiState( + ::capnp::Orphan< ::cereal::ControlsState::LateralINDIState>&& value) { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::INDI_STATE); + ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralINDIState>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ControlsState::LateralINDIState> ControlsState::LateralControlState::Builder::disownIndiState() { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::INDI_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralINDIState>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool ControlsState::LateralControlState::Reader::isPidState() const { + return which() == ControlsState::LateralControlState::PID_STATE; +} +inline bool ControlsState::LateralControlState::Builder::isPidState() { + return which() == ControlsState::LateralControlState::PID_STATE; +} +inline bool ControlsState::LateralControlState::Reader::hasPidState() const { + if (which() != ControlsState::LateralControlState::PID_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool ControlsState::LateralControlState::Builder::hasPidState() { + if (which() != ControlsState::LateralControlState::PID_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ControlsState::LateralPIDState::Reader ControlsState::LateralControlState::Reader::getPidState() const { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::PID_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralPIDState>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::cereal::ControlsState::LateralPIDState::Builder ControlsState::LateralControlState::Builder::getPidState() { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::PID_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralPIDState>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ControlsState::LateralControlState::Builder::setPidState( ::cereal::ControlsState::LateralPIDState::Reader value) { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::PID_STATE); + ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralPIDState>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::cereal::ControlsState::LateralPIDState::Builder ControlsState::LateralControlState::Builder::initPidState() { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::PID_STATE); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralPIDState>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ControlsState::LateralControlState::Builder::adoptPidState( + ::capnp::Orphan< ::cereal::ControlsState::LateralPIDState>&& value) { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::PID_STATE); + ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralPIDState>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ControlsState::LateralPIDState> ControlsState::LateralControlState::Builder::disownPidState() { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::PID_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralPIDState>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool ControlsState::LateralControlState::Reader::isLqrState() const { + return which() == ControlsState::LateralControlState::LQR_STATE; +} +inline bool ControlsState::LateralControlState::Builder::isLqrState() { + return which() == ControlsState::LateralControlState::LQR_STATE; +} +inline bool ControlsState::LateralControlState::Reader::hasLqrState() const { + if (which() != ControlsState::LateralControlState::LQR_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool ControlsState::LateralControlState::Builder::hasLqrState() { + if (which() != ControlsState::LateralControlState::LQR_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ControlsState::LateralLQRState::Reader ControlsState::LateralControlState::Reader::getLqrState() const { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::LQR_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralLQRState>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::cereal::ControlsState::LateralLQRState::Builder ControlsState::LateralControlState::Builder::getLqrState() { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::LQR_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralLQRState>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ControlsState::LateralControlState::Builder::setLqrState( ::cereal::ControlsState::LateralLQRState::Reader value) { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::LQR_STATE); + ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralLQRState>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::cereal::ControlsState::LateralLQRState::Builder ControlsState::LateralControlState::Builder::initLqrState() { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::LQR_STATE); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralLQRState>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ControlsState::LateralControlState::Builder::adoptLqrState( + ::capnp::Orphan< ::cereal::ControlsState::LateralLQRState>&& value) { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::LQR_STATE); + ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralLQRState>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ControlsState::LateralLQRState> ControlsState::LateralControlState::Builder::disownLqrState() { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::LQR_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralLQRState>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool ControlsState::LateralControlState::Reader::isAngleState() const { + return which() == ControlsState::LateralControlState::ANGLE_STATE; +} +inline bool ControlsState::LateralControlState::Builder::isAngleState() { + return which() == ControlsState::LateralControlState::ANGLE_STATE; +} +inline bool ControlsState::LateralControlState::Reader::hasAngleState() const { + if (which() != ControlsState::LateralControlState::ANGLE_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool ControlsState::LateralControlState::Builder::hasAngleState() { + if (which() != ControlsState::LateralControlState::ANGLE_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ControlsState::LateralAngleState::Reader ControlsState::LateralControlState::Reader::getAngleState() const { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::ANGLE_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralAngleState>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::cereal::ControlsState::LateralAngleState::Builder ControlsState::LateralControlState::Builder::getAngleState() { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::ANGLE_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralAngleState>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ControlsState::LateralControlState::Builder::setAngleState( ::cereal::ControlsState::LateralAngleState::Reader value) { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::ANGLE_STATE); + ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralAngleState>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::cereal::ControlsState::LateralAngleState::Builder ControlsState::LateralControlState::Builder::initAngleState() { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::ANGLE_STATE); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralAngleState>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ControlsState::LateralControlState::Builder::adoptAngleState( + ::capnp::Orphan< ::cereal::ControlsState::LateralAngleState>&& value) { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::ANGLE_STATE); + ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralAngleState>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ControlsState::LateralAngleState> ControlsState::LateralControlState::Builder::disownAngleState() { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::ANGLE_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralAngleState>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool ControlsState::LateralControlState::Reader::isDebugState() const { + return which() == ControlsState::LateralControlState::DEBUG_STATE; +} +inline bool ControlsState::LateralControlState::Builder::isDebugState() { + return which() == ControlsState::LateralControlState::DEBUG_STATE; +} +inline bool ControlsState::LateralControlState::Reader::hasDebugState() const { + if (which() != ControlsState::LateralControlState::DEBUG_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool ControlsState::LateralControlState::Builder::hasDebugState() { + if (which() != ControlsState::LateralControlState::DEBUG_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ControlsState::LateralDebugState::Reader ControlsState::LateralControlState::Reader::getDebugState() const { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::DEBUG_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralDebugState>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::cereal::ControlsState::LateralDebugState::Builder ControlsState::LateralControlState::Builder::getDebugState() { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::DEBUG_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralDebugState>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ControlsState::LateralControlState::Builder::setDebugState( ::cereal::ControlsState::LateralDebugState::Reader value) { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::DEBUG_STATE); + ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralDebugState>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::cereal::ControlsState::LateralDebugState::Builder ControlsState::LateralControlState::Builder::initDebugState() { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::DEBUG_STATE); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralDebugState>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ControlsState::LateralControlState::Builder::adoptDebugState( + ::capnp::Orphan< ::cereal::ControlsState::LateralDebugState>&& value) { + _builder.setDataField( + ::capnp::bounded<71>() * ::capnp::ELEMENTS, ControlsState::LateralControlState::DEBUG_STATE); + ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralDebugState>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ControlsState::LateralDebugState> ControlsState::LateralControlState::Builder::disownDebugState() { + KJ_IREQUIRE((which() == ControlsState::LateralControlState::DEBUG_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState::LateralDebugState>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline ::uint32_t ModelDataV2::Reader::getFrameId() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t ModelDataV2::Builder::getFrameId() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::Builder::setFrameId( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t ModelDataV2::Reader::getFrameAge() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t ModelDataV2::Builder::getFrameAge() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::Builder::setFrameAge( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ModelDataV2::Reader::getFrameDropPerc() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float ModelDataV2::Builder::getFrameDropPerc() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::Builder::setFrameDropPerc(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ModelDataV2::Reader::getTimestampEof() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ModelDataV2::Builder::getTimestampEof() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::Builder::setTimestampEof( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelDataV2::Reader::hasPosition() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::Builder::hasPosition() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelDataV2::XYZTData::Reader ModelDataV2::Reader::getPosition() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelDataV2::XYZTData::Builder ModelDataV2::Builder::getPosition() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelDataV2::XYZTData::Pipeline ModelDataV2::Pipeline::getPosition() { + return ::cereal::ModelDataV2::XYZTData::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void ModelDataV2::Builder::setPosition( ::cereal::ModelDataV2::XYZTData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelDataV2::XYZTData::Builder ModelDataV2::Builder::initPosition() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::Builder::adoptPosition( + ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData> ModelDataV2::Builder::disownPosition() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::Reader::hasOrientation() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::Builder::hasOrientation() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelDataV2::XYZTData::Reader ModelDataV2::Reader::getOrientation() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelDataV2::XYZTData::Builder ModelDataV2::Builder::getOrientation() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelDataV2::XYZTData::Pipeline ModelDataV2::Pipeline::getOrientation() { + return ::cereal::ModelDataV2::XYZTData::Pipeline(_typeless.getPointerField(1)); +} +#endif // !CAPNP_LITE +inline void ModelDataV2::Builder::setOrientation( ::cereal::ModelDataV2::XYZTData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelDataV2::XYZTData::Builder ModelDataV2::Builder::initOrientation() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::Builder::adoptOrientation( + ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData> ModelDataV2::Builder::disownOrientation() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::Reader::hasVelocity() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::Builder::hasVelocity() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelDataV2::XYZTData::Reader ModelDataV2::Reader::getVelocity() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelDataV2::XYZTData::Builder ModelDataV2::Builder::getVelocity() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelDataV2::XYZTData::Pipeline ModelDataV2::Pipeline::getVelocity() { + return ::cereal::ModelDataV2::XYZTData::Pipeline(_typeless.getPointerField(2)); +} +#endif // !CAPNP_LITE +inline void ModelDataV2::Builder::setVelocity( ::cereal::ModelDataV2::XYZTData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelDataV2::XYZTData::Builder ModelDataV2::Builder::initVelocity() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::Builder::adoptVelocity( + ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData> ModelDataV2::Builder::disownVelocity() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::Reader::hasOrientationRate() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::Builder::hasOrientationRate() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelDataV2::XYZTData::Reader ModelDataV2::Reader::getOrientationRate() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelDataV2::XYZTData::Builder ModelDataV2::Builder::getOrientationRate() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelDataV2::XYZTData::Pipeline ModelDataV2::Pipeline::getOrientationRate() { + return ::cereal::ModelDataV2::XYZTData::Pipeline(_typeless.getPointerField(3)); +} +#endif // !CAPNP_LITE +inline void ModelDataV2::Builder::setOrientationRate( ::cereal::ModelDataV2::XYZTData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelDataV2::XYZTData::Builder ModelDataV2::Builder::initOrientationRate() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::Builder::adoptOrientationRate( + ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData> ModelDataV2::Builder::disownOrientationRate() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::Reader::hasLaneLines() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::Builder::hasLaneLines() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Reader ModelDataV2::Reader::getLaneLines() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Builder ModelDataV2::Builder::getLaneLines() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::Builder::setLaneLines( ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Builder ModelDataV2::Builder::initLaneLines(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::Builder::adoptLaneLines( + ::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>> ModelDataV2::Builder::disownLaneLines() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::Reader::hasLaneLineProbs() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::Builder::hasLaneLineProbs() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::Reader::getLaneLineProbs() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::Builder::getLaneLineProbs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::Builder::setLaneLineProbs( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::Builder::setLaneLineProbs(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::Builder::initLaneLineProbs(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::Builder::adoptLaneLineProbs( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::Builder::disownLaneLineProbs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::Reader::hasRoadEdges() const { + return !_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::Builder::hasRoadEdges() { + return !_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Reader ModelDataV2::Reader::getRoadEdges() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Builder ModelDataV2::Builder::getRoadEdges() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::Builder::setRoadEdges( ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>::Builder ModelDataV2::Builder::initRoadEdges(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::Builder::adoptRoadEdges( + ::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>> ModelDataV2::Builder::disownRoadEdges() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::XYZTData, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::Reader::hasLeads() const { + return !_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::Builder::hasLeads() { + return !_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>::Reader ModelDataV2::Reader::getLeads() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>::Builder ModelDataV2::Builder::getLeads() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::Builder::setLeads( ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>::Builder ModelDataV2::Builder::initLeads(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::Builder::adoptLeads( + ::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>> ModelDataV2::Builder::disownLeads() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::LeadDataV2, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::Reader::hasMeta() const { + return !_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::Builder::hasMeta() { + return !_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelDataV2::MetaData::Reader ModelDataV2::Reader::getMeta() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::MetaData>::get(_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelDataV2::MetaData::Builder ModelDataV2::Builder::getMeta() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::MetaData>::get(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelDataV2::MetaData::Pipeline ModelDataV2::Pipeline::getMeta() { + return ::cereal::ModelDataV2::MetaData::Pipeline(_typeless.getPointerField(8)); +} +#endif // !CAPNP_LITE +inline void ModelDataV2::Builder::setMeta( ::cereal::ModelDataV2::MetaData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::MetaData>::set(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelDataV2::MetaData::Builder ModelDataV2::Builder::initMeta() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::MetaData>::init(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::Builder::adoptMeta( + ::capnp::Orphan< ::cereal::ModelDataV2::MetaData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::MetaData>::adopt(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelDataV2::MetaData> ModelDataV2::Builder::disownMeta() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::MetaData>::disown(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::Reader::hasLaneLineStds() const { + return !_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::Builder::hasLaneLineStds() { + return !_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::Reader::getLaneLineStds() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::Builder::getLaneLineStds() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::Builder::setLaneLineStds( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::Builder::setLaneLineStds(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::Builder::initLaneLineStds(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::Builder::adoptLaneLineStds( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::Builder::disownLaneLineStds() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::Reader::hasRoadEdgeStds() const { + return !_reader.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::Builder::hasRoadEdgeStds() { + return !_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::Reader::getRoadEdgeStds() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::Builder::getRoadEdgeStds() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::Builder::setRoadEdgeStds( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::Builder::setRoadEdgeStds(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::Builder::initRoadEdgeStds(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::Builder::adoptRoadEdgeStds( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::Builder::disownRoadEdgeStds() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} + +inline float ModelDataV2::Reader::getModelExecutionTime() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float ModelDataV2::Builder::getModelExecutionTime() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::Builder::setModelExecutionTime(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelDataV2::Reader::hasRawPredictions() const { + return !_reader.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::Builder::hasRawPredictions() { + return !_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader ModelDataV2::Reader::getRawPredictions() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder ModelDataV2::Builder::getRawPredictions() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::Builder::setRawPredictions( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder ModelDataV2::Builder::initRawPredictions(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::Builder::adoptRawPredictions( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> ModelDataV2::Builder::disownRawPredictions() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} + +inline float ModelDataV2::Reader::getGpuExecutionTime() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float ModelDataV2::Builder::getGpuExecutionTime() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::Builder::setGpuExecutionTime(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelDataV2::Reader::hasLeadsV3() const { + return !_reader.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::Builder::hasLeadsV3() { + return !_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>::Reader ModelDataV2::Reader::getLeadsV3() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>::Builder ModelDataV2::Builder::getLeadsV3() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::Builder::setLeadsV3( ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>::Builder ModelDataV2::Builder::initLeadsV3(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::Builder::adoptLeadsV3( + ::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>> ModelDataV2::Builder::disownLeadsV3() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ModelDataV2::LeadDataV3, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::Reader::hasAcceleration() const { + return !_reader.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::Builder::hasAcceleration() { + return !_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelDataV2::XYZTData::Reader ModelDataV2::Reader::getAcceleration() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::get(_reader.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelDataV2::XYZTData::Builder ModelDataV2::Builder::getAcceleration() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::get(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelDataV2::XYZTData::Pipeline ModelDataV2::Pipeline::getAcceleration() { + return ::cereal::ModelDataV2::XYZTData::Pipeline(_typeless.getPointerField(13)); +} +#endif // !CAPNP_LITE +inline void ModelDataV2::Builder::setAcceleration( ::cereal::ModelDataV2::XYZTData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::set(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelDataV2::XYZTData::Builder ModelDataV2::Builder::initAcceleration() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::init(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::Builder::adoptAcceleration( + ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::adopt(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelDataV2::XYZTData> ModelDataV2::Builder::disownAcceleration() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::XYZTData>::disown(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::XYZTData::Reader::hasX() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::XYZTData::Builder::hasX() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::XYZTData::Reader::getX() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::XYZTData::Builder::getX() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::XYZTData::Builder::setX( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::XYZTData::Builder::setX(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::XYZTData::Builder::initX(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::XYZTData::Builder::adoptX( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::XYZTData::Builder::disownX() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::XYZTData::Reader::hasY() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::XYZTData::Builder::hasY() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::XYZTData::Reader::getY() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::XYZTData::Builder::getY() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::XYZTData::Builder::setY( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::XYZTData::Builder::setY(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::XYZTData::Builder::initY(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::XYZTData::Builder::adoptY( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::XYZTData::Builder::disownY() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::XYZTData::Reader::hasZ() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::XYZTData::Builder::hasZ() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::XYZTData::Reader::getZ() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::XYZTData::Builder::getZ() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::XYZTData::Builder::setZ( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::XYZTData::Builder::setZ(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::XYZTData::Builder::initZ(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::XYZTData::Builder::adoptZ( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::XYZTData::Builder::disownZ() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::XYZTData::Reader::hasT() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::XYZTData::Builder::hasT() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::XYZTData::Reader::getT() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::XYZTData::Builder::getT() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::XYZTData::Builder::setT( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::XYZTData::Builder::setT(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::XYZTData::Builder::initT(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::XYZTData::Builder::adoptT( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::XYZTData::Builder::disownT() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::XYZTData::Reader::hasXStd() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::XYZTData::Builder::hasXStd() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::XYZTData::Reader::getXStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::XYZTData::Builder::getXStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::XYZTData::Builder::setXStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::XYZTData::Builder::setXStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::XYZTData::Builder::initXStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::XYZTData::Builder::adoptXStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::XYZTData::Builder::disownXStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::XYZTData::Reader::hasYStd() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::XYZTData::Builder::hasYStd() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::XYZTData::Reader::getYStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::XYZTData::Builder::getYStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::XYZTData::Builder::setYStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::XYZTData::Builder::setYStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::XYZTData::Builder::initYStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::XYZTData::Builder::adoptYStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::XYZTData::Builder::disownYStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::XYZTData::Reader::hasZStd() const { + return !_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::XYZTData::Builder::hasZStd() { + return !_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::XYZTData::Reader::getZStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::XYZTData::Builder::getZStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::XYZTData::Builder::setZStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::XYZTData::Builder::setZStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::XYZTData::Builder::initZStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::XYZTData::Builder::adoptZStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::XYZTData::Builder::disownZStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} + +inline float ModelDataV2::LeadDataV2::Reader::getProb() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float ModelDataV2::LeadDataV2::Builder::getProb() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::LeadDataV2::Builder::setProb(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float ModelDataV2::LeadDataV2::Reader::getT() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float ModelDataV2::LeadDataV2::Builder::getT() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::LeadDataV2::Builder::setT(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelDataV2::LeadDataV2::Reader::hasXyva() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::LeadDataV2::Builder::hasXyva() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::LeadDataV2::Reader::getXyva() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV2::Builder::getXyva() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::LeadDataV2::Builder::setXyva( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::LeadDataV2::Builder::setXyva(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV2::Builder::initXyva(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::LeadDataV2::Builder::adoptXyva( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::LeadDataV2::Builder::disownXyva() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::LeadDataV2::Reader::hasXyvaStd() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::LeadDataV2::Builder::hasXyvaStd() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::LeadDataV2::Reader::getXyvaStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV2::Builder::getXyvaStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::LeadDataV2::Builder::setXyvaStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::LeadDataV2::Builder::setXyvaStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV2::Builder::initXyvaStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::LeadDataV2::Builder::adoptXyvaStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::LeadDataV2::Builder::disownXyvaStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline float ModelDataV2::LeadDataV3::Reader::getProb() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float ModelDataV2::LeadDataV3::Builder::getProb() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::LeadDataV3::Builder::setProb(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float ModelDataV2::LeadDataV3::Reader::getProbTime() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float ModelDataV2::LeadDataV3::Builder::getProbTime() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::LeadDataV3::Builder::setProbTime(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelDataV2::LeadDataV3::Reader::hasT() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::LeadDataV3::Builder::hasT() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::LeadDataV3::Reader::getT() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::getT() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::LeadDataV3::Builder::setT( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::LeadDataV3::Builder::setT(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::initT(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::LeadDataV3::Builder::adoptT( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::LeadDataV3::Builder::disownT() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::LeadDataV3::Reader::hasX() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::LeadDataV3::Builder::hasX() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::LeadDataV3::Reader::getX() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::getX() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::LeadDataV3::Builder::setX( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::LeadDataV3::Builder::setX(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::initX(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::LeadDataV3::Builder::adoptX( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::LeadDataV3::Builder::disownX() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::LeadDataV3::Reader::hasXStd() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::LeadDataV3::Builder::hasXStd() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::LeadDataV3::Reader::getXStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::getXStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::LeadDataV3::Builder::setXStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::LeadDataV3::Builder::setXStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::initXStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::LeadDataV3::Builder::adoptXStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::LeadDataV3::Builder::disownXStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::LeadDataV3::Reader::hasY() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::LeadDataV3::Builder::hasY() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::LeadDataV3::Reader::getY() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::getY() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::LeadDataV3::Builder::setY( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::LeadDataV3::Builder::setY(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::initY(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::LeadDataV3::Builder::adoptY( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::LeadDataV3::Builder::disownY() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::LeadDataV3::Reader::hasYStd() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::LeadDataV3::Builder::hasYStd() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::LeadDataV3::Reader::getYStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::getYStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::LeadDataV3::Builder::setYStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::LeadDataV3::Builder::setYStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::initYStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::LeadDataV3::Builder::adoptYStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::LeadDataV3::Builder::disownYStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::LeadDataV3::Reader::hasV() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::LeadDataV3::Builder::hasV() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::LeadDataV3::Reader::getV() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::getV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::LeadDataV3::Builder::setV( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::LeadDataV3::Builder::setV(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::initV(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::LeadDataV3::Builder::adoptV( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::LeadDataV3::Builder::disownV() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::LeadDataV3::Reader::hasVStd() const { + return !_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::LeadDataV3::Builder::hasVStd() { + return !_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::LeadDataV3::Reader::getVStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::getVStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::LeadDataV3::Builder::setVStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::LeadDataV3::Builder::setVStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::initVStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::LeadDataV3::Builder::adoptVStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::LeadDataV3::Builder::disownVStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::LeadDataV3::Reader::hasA() const { + return !_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::LeadDataV3::Builder::hasA() { + return !_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::LeadDataV3::Reader::getA() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::getA() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::LeadDataV3::Builder::setA( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::LeadDataV3::Builder::setA(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::initA(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::LeadDataV3::Builder::adoptA( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::LeadDataV3::Builder::disownA() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::LeadDataV3::Reader::hasAStd() const { + return !_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::LeadDataV3::Builder::hasAStd() { + return !_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::LeadDataV3::Reader::getAStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::getAStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::LeadDataV3::Builder::setAStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::LeadDataV3::Builder::setAStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::LeadDataV3::Builder::initAStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::LeadDataV3::Builder::adoptAStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::LeadDataV3::Builder::disownAStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} + +inline float ModelDataV2::MetaData::Reader::getEngagedProb() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float ModelDataV2::MetaData::Builder::getEngagedProb() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::MetaData::Builder::setEngagedProb(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelDataV2::MetaData::Reader::hasDesirePrediction() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::MetaData::Builder::hasDesirePrediction() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::MetaData::Reader::getDesirePrediction() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::MetaData::Builder::getDesirePrediction() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::MetaData::Builder::setDesirePrediction( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::MetaData::Builder::setDesirePrediction(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::MetaData::Builder::initDesirePrediction(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::MetaData::Builder::adoptDesirePrediction( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::MetaData::Builder::disownDesirePrediction() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline float ModelDataV2::MetaData::Reader::getBrakeDisengageProbDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float ModelDataV2::MetaData::Builder::getBrakeDisengageProbDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::MetaData::Builder::setBrakeDisengageProbDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float ModelDataV2::MetaData::Reader::getGasDisengageProbDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float ModelDataV2::MetaData::Builder::getGasDisengageProbDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::MetaData::Builder::setGasDisengageProbDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float ModelDataV2::MetaData::Reader::getSteerOverrideProbDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float ModelDataV2::MetaData::Builder::getSteerOverrideProbDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::MetaData::Builder::setSteerOverrideProbDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelDataV2::MetaData::Reader::hasDesireState() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::MetaData::Builder::hasDesireState() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::MetaData::Reader::getDesireState() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::MetaData::Builder::getDesireState() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::MetaData::Builder::setDesireState( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::MetaData::Builder::setDesireState(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::MetaData::Builder::initDesireState(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::MetaData::Builder::adoptDesireState( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::MetaData::Builder::disownDesireState() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::MetaData::Reader::hasDisengagePredictions() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::MetaData::Builder::hasDisengagePredictions() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelDataV2::DisengagePredictions::Reader ModelDataV2::MetaData::Reader::getDisengagePredictions() const { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::DisengagePredictions>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelDataV2::DisengagePredictions::Builder ModelDataV2::MetaData::Builder::getDisengagePredictions() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::DisengagePredictions>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ModelDataV2::DisengagePredictions::Pipeline ModelDataV2::MetaData::Pipeline::getDisengagePredictions() { + return ::cereal::ModelDataV2::DisengagePredictions::Pipeline(_typeless.getPointerField(2)); +} +#endif // !CAPNP_LITE +inline void ModelDataV2::MetaData::Builder::setDisengagePredictions( ::cereal::ModelDataV2::DisengagePredictions::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::DisengagePredictions>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelDataV2::DisengagePredictions::Builder ModelDataV2::MetaData::Builder::initDisengagePredictions() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::DisengagePredictions>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::MetaData::Builder::adoptDisengagePredictions( + ::capnp::Orphan< ::cereal::ModelDataV2::DisengagePredictions>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::DisengagePredictions>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelDataV2::DisengagePredictions> ModelDataV2::MetaData::Builder::disownDisengagePredictions() { + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2::DisengagePredictions>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::MetaData::Reader::getHardBrakePredicted() const { + return _reader.getDataField( + ::capnp::bounded<128>() * ::capnp::ELEMENTS); +} + +inline bool ModelDataV2::MetaData::Builder::getHardBrakePredicted() { + return _builder.getDataField( + ::capnp::bounded<128>() * ::capnp::ELEMENTS); +} +inline void ModelDataV2::MetaData::Builder::setHardBrakePredicted(bool value) { + _builder.setDataField( + ::capnp::bounded<128>() * ::capnp::ELEMENTS, value); +} + +inline bool ModelDataV2::DisengagePredictions::Reader::hasT() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::DisengagePredictions::Builder::hasT() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::DisengagePredictions::Reader::getT() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::DisengagePredictions::Builder::getT() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::DisengagePredictions::Builder::setT( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::DisengagePredictions::Builder::setT(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::DisengagePredictions::Builder::initT(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::DisengagePredictions::Builder::adoptT( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::DisengagePredictions::Builder::disownT() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::DisengagePredictions::Reader::hasBrakeDisengageProbs() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::DisengagePredictions::Builder::hasBrakeDisengageProbs() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::DisengagePredictions::Reader::getBrakeDisengageProbs() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::DisengagePredictions::Builder::getBrakeDisengageProbs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::DisengagePredictions::Builder::setBrakeDisengageProbs( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::DisengagePredictions::Builder::setBrakeDisengageProbs(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::DisengagePredictions::Builder::initBrakeDisengageProbs(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::DisengagePredictions::Builder::adoptBrakeDisengageProbs( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::DisengagePredictions::Builder::disownBrakeDisengageProbs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::DisengagePredictions::Reader::hasGasDisengageProbs() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::DisengagePredictions::Builder::hasGasDisengageProbs() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::DisengagePredictions::Reader::getGasDisengageProbs() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::DisengagePredictions::Builder::getGasDisengageProbs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::DisengagePredictions::Builder::setGasDisengageProbs( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::DisengagePredictions::Builder::setGasDisengageProbs(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::DisengagePredictions::Builder::initGasDisengageProbs(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::DisengagePredictions::Builder::adoptGasDisengageProbs( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::DisengagePredictions::Builder::disownGasDisengageProbs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::DisengagePredictions::Reader::hasSteerOverrideProbs() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::DisengagePredictions::Builder::hasSteerOverrideProbs() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::DisengagePredictions::Reader::getSteerOverrideProbs() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::DisengagePredictions::Builder::getSteerOverrideProbs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::DisengagePredictions::Builder::setSteerOverrideProbs( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::DisengagePredictions::Builder::setSteerOverrideProbs(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::DisengagePredictions::Builder::initSteerOverrideProbs(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::DisengagePredictions::Builder::adoptSteerOverrideProbs( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::DisengagePredictions::Builder::disownSteerOverrideProbs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::DisengagePredictions::Reader::hasBrake3MetersPerSecondSquaredProbs() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::DisengagePredictions::Builder::hasBrake3MetersPerSecondSquaredProbs() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::DisengagePredictions::Reader::getBrake3MetersPerSecondSquaredProbs() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::DisengagePredictions::Builder::getBrake3MetersPerSecondSquaredProbs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::DisengagePredictions::Builder::setBrake3MetersPerSecondSquaredProbs( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::DisengagePredictions::Builder::setBrake3MetersPerSecondSquaredProbs(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::DisengagePredictions::Builder::initBrake3MetersPerSecondSquaredProbs(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::DisengagePredictions::Builder::adoptBrake3MetersPerSecondSquaredProbs( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::DisengagePredictions::Builder::disownBrake3MetersPerSecondSquaredProbs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::DisengagePredictions::Reader::hasBrake4MetersPerSecondSquaredProbs() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::DisengagePredictions::Builder::hasBrake4MetersPerSecondSquaredProbs() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::DisengagePredictions::Reader::getBrake4MetersPerSecondSquaredProbs() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::DisengagePredictions::Builder::getBrake4MetersPerSecondSquaredProbs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::DisengagePredictions::Builder::setBrake4MetersPerSecondSquaredProbs( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::DisengagePredictions::Builder::setBrake4MetersPerSecondSquaredProbs(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::DisengagePredictions::Builder::initBrake4MetersPerSecondSquaredProbs(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::DisengagePredictions::Builder::adoptBrake4MetersPerSecondSquaredProbs( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::DisengagePredictions::Builder::disownBrake4MetersPerSecondSquaredProbs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool ModelDataV2::DisengagePredictions::Reader::hasBrake5MetersPerSecondSquaredProbs() const { + return !_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline bool ModelDataV2::DisengagePredictions::Builder::hasBrake5MetersPerSecondSquaredProbs() { + return !_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader ModelDataV2::DisengagePredictions::Reader::getBrake5MetersPerSecondSquaredProbs() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder ModelDataV2::DisengagePredictions::Builder::getBrake5MetersPerSecondSquaredProbs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline void ModelDataV2::DisengagePredictions::Builder::setBrake5MetersPerSecondSquaredProbs( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline void ModelDataV2::DisengagePredictions::Builder::setBrake5MetersPerSecondSquaredProbs(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder ModelDataV2::DisengagePredictions::Builder::initBrake5MetersPerSecondSquaredProbs(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), size); +} +inline void ModelDataV2::DisengagePredictions::Builder::adoptBrake5MetersPerSecondSquaredProbs( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> ModelDataV2::DisengagePredictions::Builder::disownBrake5MetersPerSecondSquaredProbs() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} + +inline ::uint32_t EncodeIndex::Reader::getFrameId() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t EncodeIndex::Builder::getFrameId() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void EncodeIndex::Builder::setFrameId( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::EncodeIndex::Type EncodeIndex::Reader::getType() const { + return _reader.getDataField< ::cereal::EncodeIndex::Type>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::cereal::EncodeIndex::Type EncodeIndex::Builder::getType() { + return _builder.getDataField< ::cereal::EncodeIndex::Type>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void EncodeIndex::Builder::setType( ::cereal::EncodeIndex::Type value) { + _builder.setDataField< ::cereal::EncodeIndex::Type>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t EncodeIndex::Reader::getEncodeId() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t EncodeIndex::Builder::getEncodeId() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void EncodeIndex::Builder::setEncodeId( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t EncodeIndex::Reader::getSegmentNum() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::int32_t EncodeIndex::Builder::getSegmentNum() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void EncodeIndex::Builder::setSegmentNum( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t EncodeIndex::Reader::getSegmentId() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t EncodeIndex::Builder::getSegmentId() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void EncodeIndex::Builder::setSegmentId( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t EncodeIndex::Reader::getSegmentIdEncode() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t EncodeIndex::Builder::getSegmentIdEncode() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void EncodeIndex::Builder::setSegmentIdEncode( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t EncodeIndex::Reader::getTimestampSof() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t EncodeIndex::Builder::getTimestampSof() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void EncodeIndex::Builder::setTimestampSof( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t EncodeIndex::Reader::getTimestampEof() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t EncodeIndex::Builder::getTimestampEof() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void EncodeIndex::Builder::setTimestampEof( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t AndroidLogEntry::Reader::getId() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t AndroidLogEntry::Builder::getId() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void AndroidLogEntry::Builder::setId( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t AndroidLogEntry::Reader::getTs() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t AndroidLogEntry::Builder::getTs() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void AndroidLogEntry::Builder::setTs( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t AndroidLogEntry::Reader::getPriority() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t AndroidLogEntry::Builder::getPriority() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void AndroidLogEntry::Builder::setPriority( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t AndroidLogEntry::Reader::getPid() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int32_t AndroidLogEntry::Builder::getPid() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void AndroidLogEntry::Builder::setPid( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t AndroidLogEntry::Reader::getTid() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::int32_t AndroidLogEntry::Builder::getTid() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void AndroidLogEntry::Builder::setTid( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline bool AndroidLogEntry::Reader::hasTag() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool AndroidLogEntry::Builder::hasTag() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader AndroidLogEntry::Reader::getTag() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder AndroidLogEntry::Builder::getTag() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void AndroidLogEntry::Builder::setTag( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder AndroidLogEntry::Builder::initTag(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void AndroidLogEntry::Builder::adoptTag( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> AndroidLogEntry::Builder::disownTag() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool AndroidLogEntry::Reader::hasMessage() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool AndroidLogEntry::Builder::hasMessage() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader AndroidLogEntry::Reader::getMessage() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder AndroidLogEntry::Builder::getMessage() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void AndroidLogEntry::Builder::setMessage( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder AndroidLogEntry::Builder::initMessage(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void AndroidLogEntry::Builder::adoptMessage( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> AndroidLogEntry::Builder::disownMessage() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool LongitudinalPlan::Reader::getLateralValidDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool LongitudinalPlan::Builder::getLateralValidDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setLateralValidDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool LongitudinalPlan::Reader::hasDPolyDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LongitudinalPlan::Builder::hasDPolyDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LongitudinalPlan::Reader::getDPolyDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LongitudinalPlan::Builder::getDPolyDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LongitudinalPlan::Builder::setDPolyDEPRECATED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void LongitudinalPlan::Builder::setDPolyDEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LongitudinalPlan::Builder::initDPolyDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void LongitudinalPlan::Builder::adoptDPolyDEPRECATED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LongitudinalPlan::Builder::disownDPolyDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool LongitudinalPlan::Reader::getLongitudinalValidDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool LongitudinalPlan::Builder::getLongitudinalValidDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setLongitudinalValidDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float LongitudinalPlan::Reader::getVTargetDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getVTargetDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setVTargetDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float LongitudinalPlan::Reader::getATargetMinDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getATargetMinDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setATargetMinDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float LongitudinalPlan::Reader::getATargetMaxDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getATargetMaxDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setATargetMaxDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float LongitudinalPlan::Reader::getJerkFactorDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getJerkFactorDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setJerkFactorDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline bool LongitudinalPlan::Reader::getHasLead() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline bool LongitudinalPlan::Builder::getHasLead() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setHasLead(bool value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool LongitudinalPlan::Reader::getFcw() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline bool LongitudinalPlan::Builder::getFcw() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setFcw(bool value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t LongitudinalPlan::Reader::getModelMonoTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t LongitudinalPlan::Builder::getModelMonoTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setModelMonoTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t LongitudinalPlan::Reader::getRadarStateMonoTimeDEPRECATED() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t LongitudinalPlan::Builder::getRadarStateMonoTimeDEPRECATED() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setRadarStateMonoTimeDEPRECATED( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float LongitudinalPlan::Reader::getLaneWidthDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getLaneWidthDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setLaneWidthDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool LongitudinalPlan::Reader::hasGpsTrajectoryDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool LongitudinalPlan::Builder::hasGpsTrajectoryDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LongitudinalPlan::GpsTrajectory::Reader LongitudinalPlan::Reader::getGpsTrajectoryDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::cereal::LongitudinalPlan::GpsTrajectory>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::cereal::LongitudinalPlan::GpsTrajectory::Builder LongitudinalPlan::Builder::getGpsTrajectoryDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::LongitudinalPlan::GpsTrajectory>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LongitudinalPlan::GpsTrajectory::Pipeline LongitudinalPlan::Pipeline::getGpsTrajectoryDEPRECATED() { + return ::cereal::LongitudinalPlan::GpsTrajectory::Pipeline(_typeless.getPointerField(1)); +} +#endif // !CAPNP_LITE +inline void LongitudinalPlan::Builder::setGpsTrajectoryDEPRECATED( ::cereal::LongitudinalPlan::GpsTrajectory::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LongitudinalPlan::GpsTrajectory>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::cereal::LongitudinalPlan::GpsTrajectory::Builder LongitudinalPlan::Builder::initGpsTrajectoryDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::LongitudinalPlan::GpsTrajectory>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void LongitudinalPlan::Builder::adoptGpsTrajectoryDEPRECATED( + ::capnp::Orphan< ::cereal::LongitudinalPlan::GpsTrajectory>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LongitudinalPlan::GpsTrajectory>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LongitudinalPlan::GpsTrajectory> LongitudinalPlan::Builder::disownGpsTrajectoryDEPRECATED() { + return ::capnp::_::PointerHelpers< ::cereal::LongitudinalPlan::GpsTrajectory>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool LongitudinalPlan::Reader::hasEventsDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool LongitudinalPlan::Builder::hasEventsDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader LongitudinalPlan::Reader::getEventsDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder LongitudinalPlan::Builder::getEventsDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void LongitudinalPlan::Builder::setEventsDEPRECATED( ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder LongitudinalPlan::Builder::initEventsDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void LongitudinalPlan::Builder::adoptEventsDEPRECATED( + ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>> LongitudinalPlan::Builder::disownEventsDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline float LongitudinalPlan::Reader::getVTargetFutureDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getVTargetFutureDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setVTargetFutureDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::LongitudinalPlan::LongitudinalPlanSource LongitudinalPlan::Reader::getLongitudinalPlanSource() const { + return _reader.getDataField< ::cereal::LongitudinalPlan::LongitudinalPlanSource>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::cereal::LongitudinalPlan::LongitudinalPlanSource LongitudinalPlan::Builder::getLongitudinalPlanSource() { + return _builder.getDataField< ::cereal::LongitudinalPlan::LongitudinalPlanSource>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setLongitudinalPlanSource( ::cereal::LongitudinalPlan::LongitudinalPlanSource value) { + _builder.setDataField< ::cereal::LongitudinalPlan::LongitudinalPlanSource>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float LongitudinalPlan::Reader::getVCruiseDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getVCruiseDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setVCruiseDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline float LongitudinalPlan::Reader::getACruiseDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getACruiseDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setACruiseDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline float LongitudinalPlan::Reader::getATargetDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getATargetDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setATargetDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline bool LongitudinalPlan::Reader::getGpsPlannerActiveDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline bool LongitudinalPlan::Builder::getGpsPlannerActiveDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setGpsPlannerActiveDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float LongitudinalPlan::Reader::getVMaxDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getVMaxDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setVMaxDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline float LongitudinalPlan::Reader::getVCurvatureDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getVCurvatureDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setVCurvatureDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline bool LongitudinalPlan::Reader::getDecelForTurnDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline bool LongitudinalPlan::Builder::getDecelForTurnDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setDecelForTurnDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool LongitudinalPlan::Reader::getHasLeftLaneDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline bool LongitudinalPlan::Builder::getHasLeftLaneDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setHasLeftLaneDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool LongitudinalPlan::Reader::getHasRightLaneDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline bool LongitudinalPlan::Builder::getHasRightLaneDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setHasRightLaneDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline bool LongitudinalPlan::Reader::getMapValidDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline bool LongitudinalPlan::Builder::getMapValidDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setMapValidDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float LongitudinalPlan::Reader::getVStartDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getVStartDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setVStartDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline float LongitudinalPlan::Reader::getAStartDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getAStartDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setAStartDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS, value); +} + +inline bool LongitudinalPlan::Reader::getRadarValidDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline bool LongitudinalPlan::Builder::getRadarValidDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setRadarValidDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline float LongitudinalPlan::Reader::getProcessingDelay() const { + return _reader.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getProcessingDelay() { + return _builder.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setProcessingDelay(float value) { + _builder.setDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS, value); +} + +inline bool LongitudinalPlan::Reader::getRadarCanErrorDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline bool LongitudinalPlan::Builder::getRadarCanErrorDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setRadarCanErrorDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline bool LongitudinalPlan::Reader::getCommIssueDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline bool LongitudinalPlan::Builder::getCommIssueDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setCommIssueDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline bool LongitudinalPlan::Reader::hasAccels() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool LongitudinalPlan::Builder::hasAccels() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LongitudinalPlan::Reader::getAccels() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LongitudinalPlan::Builder::getAccels() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void LongitudinalPlan::Builder::setAccels( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void LongitudinalPlan::Builder::setAccels(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LongitudinalPlan::Builder::initAccels(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void LongitudinalPlan::Builder::adoptAccels( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LongitudinalPlan::Builder::disownAccels() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool LongitudinalPlan::Reader::hasSpeeds() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool LongitudinalPlan::Builder::hasSpeeds() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LongitudinalPlan::Reader::getSpeeds() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LongitudinalPlan::Builder::getSpeeds() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void LongitudinalPlan::Builder::setSpeeds( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void LongitudinalPlan::Builder::setSpeeds(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LongitudinalPlan::Builder::initSpeeds(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void LongitudinalPlan::Builder::adoptSpeeds( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LongitudinalPlan::Builder::disownSpeeds() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool LongitudinalPlan::Reader::hasJerks() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool LongitudinalPlan::Builder::hasJerks() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LongitudinalPlan::Reader::getJerks() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LongitudinalPlan::Builder::getJerks() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void LongitudinalPlan::Builder::setJerks( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void LongitudinalPlan::Builder::setJerks(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LongitudinalPlan::Builder::initJerks(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void LongitudinalPlan::Builder::adoptJerks( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LongitudinalPlan::Builder::disownJerks() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline float LongitudinalPlan::Reader::getSolverExecutionTime() const { + return _reader.getDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS); +} + +inline float LongitudinalPlan::Builder::getSolverExecutionTime() { + return _builder.getDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS); +} +inline void LongitudinalPlan::Builder::setSolverExecutionTime(float value) { + _builder.setDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS, value); +} + +inline bool LongitudinalPlan::GpsTrajectory::Reader::hasX() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LongitudinalPlan::GpsTrajectory::Builder::hasX() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LongitudinalPlan::GpsTrajectory::Reader::getX() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LongitudinalPlan::GpsTrajectory::Builder::getX() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LongitudinalPlan::GpsTrajectory::Builder::setX( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void LongitudinalPlan::GpsTrajectory::Builder::setX(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LongitudinalPlan::GpsTrajectory::Builder::initX(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void LongitudinalPlan::GpsTrajectory::Builder::adoptX( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LongitudinalPlan::GpsTrajectory::Builder::disownX() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool LongitudinalPlan::GpsTrajectory::Reader::hasY() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool LongitudinalPlan::GpsTrajectory::Builder::hasY() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LongitudinalPlan::GpsTrajectory::Reader::getY() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LongitudinalPlan::GpsTrajectory::Builder::getY() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void LongitudinalPlan::GpsTrajectory::Builder::setY( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void LongitudinalPlan::GpsTrajectory::Builder::setY(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LongitudinalPlan::GpsTrajectory::Builder::initY(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void LongitudinalPlan::GpsTrajectory::Builder::adoptY( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LongitudinalPlan::GpsTrajectory::Builder::disownY() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline float LateralPlan::Reader::getLaneWidth() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float LateralPlan::Builder::getLaneWidth() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setLaneWidth(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool LateralPlan::Reader::hasDPolyDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LateralPlan::Builder::hasDPolyDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LateralPlan::Reader::getDPolyDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LateralPlan::Builder::getDPolyDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LateralPlan::Builder::setDPolyDEPRECATED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void LateralPlan::Builder::setDPolyDEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LateralPlan::Builder::initDPolyDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void LateralPlan::Builder::adoptDPolyDEPRECATED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LateralPlan::Builder::disownDPolyDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool LateralPlan::Reader::hasCPolyDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool LateralPlan::Builder::hasCPolyDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LateralPlan::Reader::getCPolyDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LateralPlan::Builder::getCPolyDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void LateralPlan::Builder::setCPolyDEPRECATED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void LateralPlan::Builder::setCPolyDEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LateralPlan::Builder::initCPolyDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void LateralPlan::Builder::adoptCPolyDEPRECATED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LateralPlan::Builder::disownCPolyDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline float LateralPlan::Reader::getCProbDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float LateralPlan::Builder::getCProbDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setCProbDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool LateralPlan::Reader::hasLPolyDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool LateralPlan::Builder::hasLPolyDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LateralPlan::Reader::getLPolyDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LateralPlan::Builder::getLPolyDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void LateralPlan::Builder::setLPolyDEPRECATED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void LateralPlan::Builder::setLPolyDEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LateralPlan::Builder::initLPolyDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void LateralPlan::Builder::adoptLPolyDEPRECATED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LateralPlan::Builder::disownLPolyDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline float LateralPlan::Reader::getLProb() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float LateralPlan::Builder::getLProb() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setLProb(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool LateralPlan::Reader::hasRPolyDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool LateralPlan::Builder::hasRPolyDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LateralPlan::Reader::getRPolyDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LateralPlan::Builder::getRPolyDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void LateralPlan::Builder::setRPolyDEPRECATED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void LateralPlan::Builder::setRPolyDEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LateralPlan::Builder::initRPolyDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void LateralPlan::Builder::adoptRPolyDEPRECATED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LateralPlan::Builder::disownRPolyDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline float LateralPlan::Reader::getRProb() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float LateralPlan::Builder::getRProb() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setRProb(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float LateralPlan::Reader::getSteeringAngleDegDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float LateralPlan::Builder::getSteeringAngleDegDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setSteeringAngleDegDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline bool LateralPlan::Reader::getMpcSolutionValid() const { + return _reader.getDataField( + ::capnp::bounded<160>() * ::capnp::ELEMENTS); +} + +inline bool LateralPlan::Builder::getMpcSolutionValid() { + return _builder.getDataField( + ::capnp::bounded<160>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setMpcSolutionValid(bool value) { + _builder.setDataField( + ::capnp::bounded<160>() * ::capnp::ELEMENTS, value); +} + +inline bool LateralPlan::Reader::getParamsValidDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<161>() * ::capnp::ELEMENTS); +} + +inline bool LateralPlan::Builder::getParamsValidDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<161>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setParamsValidDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<161>() * ::capnp::ELEMENTS, value); +} + +inline float LateralPlan::Reader::getAngleOffsetDegDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float LateralPlan::Builder::getAngleOffsetDegDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setAngleOffsetDegDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool LateralPlan::Reader::getModelValidDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<162>() * ::capnp::ELEMENTS); +} + +inline bool LateralPlan::Builder::getModelValidDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<162>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setModelValidDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<162>() * ::capnp::ELEMENTS, value); +} + +inline float LateralPlan::Reader::getSteeringRateDegDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float LateralPlan::Builder::getSteeringRateDegDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setSteeringRateDegDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline bool LateralPlan::Reader::getSensorValidDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<163>() * ::capnp::ELEMENTS); +} + +inline bool LateralPlan::Builder::getSensorValidDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<163>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setSensorValidDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<163>() * ::capnp::ELEMENTS, value); +} + +inline bool LateralPlan::Reader::getCommIssueDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<164>() * ::capnp::ELEMENTS); +} + +inline bool LateralPlan::Builder::getCommIssueDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<164>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setCommIssueDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<164>() * ::capnp::ELEMENTS, value); +} + +inline bool LateralPlan::Reader::getPosenetValidDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<165>() * ::capnp::ELEMENTS); +} + +inline bool LateralPlan::Builder::getPosenetValidDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<165>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setPosenetValidDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<165>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::LateralPlan::Desire LateralPlan::Reader::getDesire() const { + return _reader.getDataField< ::cereal::LateralPlan::Desire>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline ::cereal::LateralPlan::Desire LateralPlan::Builder::getDesire() { + return _builder.getDataField< ::cereal::LateralPlan::Desire>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setDesire( ::cereal::LateralPlan::Desire value) { + _builder.setDataField< ::cereal::LateralPlan::Desire>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::LateralPlan::LaneChangeState LateralPlan::Reader::getLaneChangeState() const { + return _reader.getDataField< ::cereal::LateralPlan::LaneChangeState>( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline ::cereal::LateralPlan::LaneChangeState LateralPlan::Builder::getLaneChangeState() { + return _builder.getDataField< ::cereal::LateralPlan::LaneChangeState>( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setLaneChangeState( ::cereal::LateralPlan::LaneChangeState value) { + _builder.setDataField< ::cereal::LateralPlan::LaneChangeState>( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::LateralPlan::LaneChangeDirection LateralPlan::Reader::getLaneChangeDirection() const { + return _reader.getDataField< ::cereal::LateralPlan::LaneChangeDirection>( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} + +inline ::cereal::LateralPlan::LaneChangeDirection LateralPlan::Builder::getLaneChangeDirection() { + return _builder.getDataField< ::cereal::LateralPlan::LaneChangeDirection>( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setLaneChangeDirection( ::cereal::LateralPlan::LaneChangeDirection value) { + _builder.setDataField< ::cereal::LateralPlan::LaneChangeDirection>( + ::capnp::bounded<17>() * ::capnp::ELEMENTS, value); +} + +inline bool LateralPlan::Reader::hasDPathPoints() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool LateralPlan::Builder::hasDPathPoints() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LateralPlan::Reader::getDPathPoints() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LateralPlan::Builder::getDPathPoints() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void LateralPlan::Builder::setDPathPoints( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void LateralPlan::Builder::setDPathPoints(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LateralPlan::Builder::initDPathPoints(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void LateralPlan::Builder::adoptDPathPoints( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LateralPlan::Builder::disownDPathPoints() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline float LateralPlan::Reader::getDProb() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline float LateralPlan::Builder::getDProb() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setDProb(float value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline float LateralPlan::Reader::getCurvatureDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline float LateralPlan::Builder::getCurvatureDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setCurvatureDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline float LateralPlan::Reader::getCurvatureRateDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline float LateralPlan::Builder::getCurvatureRateDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setCurvatureRateDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline float LateralPlan::Reader::getRawCurvatureDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline float LateralPlan::Builder::getRawCurvatureDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setRawCurvatureDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline float LateralPlan::Reader::getRawCurvatureRateDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline float LateralPlan::Builder::getRawCurvatureRateDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setRawCurvatureRateDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline bool LateralPlan::Reader::hasPsis() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool LateralPlan::Builder::hasPsis() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LateralPlan::Reader::getPsis() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LateralPlan::Builder::getPsis() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void LateralPlan::Builder::setPsis( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void LateralPlan::Builder::setPsis(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LateralPlan::Builder::initPsis(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void LateralPlan::Builder::adoptPsis( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LateralPlan::Builder::disownPsis() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool LateralPlan::Reader::hasCurvatures() const { + return !_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline bool LateralPlan::Builder::hasCurvatures() { + return !_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LateralPlan::Reader::getCurvatures() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LateralPlan::Builder::getCurvatures() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline void LateralPlan::Builder::setCurvatures( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline void LateralPlan::Builder::setCurvatures(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LateralPlan::Builder::initCurvatures(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), size); +} +inline void LateralPlan::Builder::adoptCurvatures( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LateralPlan::Builder::disownCurvatures() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} + +inline bool LateralPlan::Reader::hasCurvatureRates() const { + return !_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline bool LateralPlan::Builder::hasCurvatureRates() { + return !_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LateralPlan::Reader::getCurvatureRates() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LateralPlan::Builder::getCurvatureRates() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline void LateralPlan::Builder::setCurvatureRates( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline void LateralPlan::Builder::setCurvatureRates(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LateralPlan::Builder::initCurvatureRates(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), size); +} +inline void LateralPlan::Builder::adoptCurvatureRates( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LateralPlan::Builder::disownCurvatureRates() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} + +inline bool LateralPlan::Reader::getUseLaneLines() const { + return _reader.getDataField( + ::capnp::bounded<166>() * ::capnp::ELEMENTS); +} + +inline bool LateralPlan::Builder::getUseLaneLines() { + return _builder.getDataField( + ::capnp::bounded<166>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setUseLaneLines(bool value) { + _builder.setDataField( + ::capnp::bounded<166>() * ::capnp::ELEMENTS, value); +} + +inline float LateralPlan::Reader::getSolverExecutionTime() const { + return _reader.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline float LateralPlan::Builder::getSolverExecutionTime() { + return _builder.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void LateralPlan::Builder::setSolverExecutionTime(float value) { + _builder.setDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveLocationKalman::Reader::hasPositionECEF() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Builder::hasPositionECEF() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Measurement::Reader LiveLocationKalman::Reader::getPositionECEF() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::getPositionECEF() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationKalman::Measurement::Pipeline LiveLocationKalman::Pipeline::getPositionECEF() { + return ::cereal::LiveLocationKalman::Measurement::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void LiveLocationKalman::Builder::setPositionECEF( ::cereal::LiveLocationKalman::Measurement::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::initPositionECEF() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Builder::adoptPositionECEF( + ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> LiveLocationKalman::Builder::disownPositionECEF() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Reader::hasPositionGeodetic() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Builder::hasPositionGeodetic() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Measurement::Reader LiveLocationKalman::Reader::getPositionGeodetic() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::getPositionGeodetic() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationKalman::Measurement::Pipeline LiveLocationKalman::Pipeline::getPositionGeodetic() { + return ::cereal::LiveLocationKalman::Measurement::Pipeline(_typeless.getPointerField(1)); +} +#endif // !CAPNP_LITE +inline void LiveLocationKalman::Builder::setPositionGeodetic( ::cereal::LiveLocationKalman::Measurement::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::initPositionGeodetic() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Builder::adoptPositionGeodetic( + ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> LiveLocationKalman::Builder::disownPositionGeodetic() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Reader::hasVelocityECEF() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Builder::hasVelocityECEF() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Measurement::Reader LiveLocationKalman::Reader::getVelocityECEF() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::getVelocityECEF() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationKalman::Measurement::Pipeline LiveLocationKalman::Pipeline::getVelocityECEF() { + return ::cereal::LiveLocationKalman::Measurement::Pipeline(_typeless.getPointerField(2)); +} +#endif // !CAPNP_LITE +inline void LiveLocationKalman::Builder::setVelocityECEF( ::cereal::LiveLocationKalman::Measurement::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::initVelocityECEF() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Builder::adoptVelocityECEF( + ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> LiveLocationKalman::Builder::disownVelocityECEF() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Reader::hasVelocityNED() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Builder::hasVelocityNED() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Measurement::Reader LiveLocationKalman::Reader::getVelocityNED() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::getVelocityNED() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationKalman::Measurement::Pipeline LiveLocationKalman::Pipeline::getVelocityNED() { + return ::cereal::LiveLocationKalman::Measurement::Pipeline(_typeless.getPointerField(3)); +} +#endif // !CAPNP_LITE +inline void LiveLocationKalman::Builder::setVelocityNED( ::cereal::LiveLocationKalman::Measurement::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::initVelocityNED() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Builder::adoptVelocityNED( + ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> LiveLocationKalman::Builder::disownVelocityNED() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Reader::hasVelocityDevice() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Builder::hasVelocityDevice() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Measurement::Reader LiveLocationKalman::Reader::getVelocityDevice() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::getVelocityDevice() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationKalman::Measurement::Pipeline LiveLocationKalman::Pipeline::getVelocityDevice() { + return ::cereal::LiveLocationKalman::Measurement::Pipeline(_typeless.getPointerField(4)); +} +#endif // !CAPNP_LITE +inline void LiveLocationKalman::Builder::setVelocityDevice( ::cereal::LiveLocationKalman::Measurement::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::initVelocityDevice() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Builder::adoptVelocityDevice( + ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> LiveLocationKalman::Builder::disownVelocityDevice() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Reader::hasAccelerationDevice() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Builder::hasAccelerationDevice() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Measurement::Reader LiveLocationKalman::Reader::getAccelerationDevice() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::getAccelerationDevice() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationKalman::Measurement::Pipeline LiveLocationKalman::Pipeline::getAccelerationDevice() { + return ::cereal::LiveLocationKalman::Measurement::Pipeline(_typeless.getPointerField(5)); +} +#endif // !CAPNP_LITE +inline void LiveLocationKalman::Builder::setAccelerationDevice( ::cereal::LiveLocationKalman::Measurement::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::initAccelerationDevice() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Builder::adoptAccelerationDevice( + ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> LiveLocationKalman::Builder::disownAccelerationDevice() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Reader::hasOrientationECEF() const { + return !_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Builder::hasOrientationECEF() { + return !_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Measurement::Reader LiveLocationKalman::Reader::getOrientationECEF() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_reader.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::getOrientationECEF() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationKalman::Measurement::Pipeline LiveLocationKalman::Pipeline::getOrientationECEF() { + return ::cereal::LiveLocationKalman::Measurement::Pipeline(_typeless.getPointerField(6)); +} +#endif // !CAPNP_LITE +inline void LiveLocationKalman::Builder::setOrientationECEF( ::cereal::LiveLocationKalman::Measurement::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::set(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::initOrientationECEF() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::init(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Builder::adoptOrientationECEF( + ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::adopt(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> LiveLocationKalman::Builder::disownOrientationECEF() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::disown(_builder.getPointerField( + ::capnp::bounded<6>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Reader::hasOrientationNED() const { + return !_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Builder::hasOrientationNED() { + return !_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Measurement::Reader LiveLocationKalman::Reader::getOrientationNED() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_reader.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::getOrientationNED() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationKalman::Measurement::Pipeline LiveLocationKalman::Pipeline::getOrientationNED() { + return ::cereal::LiveLocationKalman::Measurement::Pipeline(_typeless.getPointerField(7)); +} +#endif // !CAPNP_LITE +inline void LiveLocationKalman::Builder::setOrientationNED( ::cereal::LiveLocationKalman::Measurement::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::set(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::initOrientationNED() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::init(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Builder::adoptOrientationNED( + ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::adopt(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> LiveLocationKalman::Builder::disownOrientationNED() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::disown(_builder.getPointerField( + ::capnp::bounded<7>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Reader::hasAngularVelocityDevice() const { + return !_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Builder::hasAngularVelocityDevice() { + return !_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Measurement::Reader LiveLocationKalman::Reader::getAngularVelocityDevice() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_reader.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::getAngularVelocityDevice() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationKalman::Measurement::Pipeline LiveLocationKalman::Pipeline::getAngularVelocityDevice() { + return ::cereal::LiveLocationKalman::Measurement::Pipeline(_typeless.getPointerField(8)); +} +#endif // !CAPNP_LITE +inline void LiveLocationKalman::Builder::setAngularVelocityDevice( ::cereal::LiveLocationKalman::Measurement::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::set(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::initAngularVelocityDevice() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::init(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Builder::adoptAngularVelocityDevice( + ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::adopt(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> LiveLocationKalman::Builder::disownAngularVelocityDevice() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::disown(_builder.getPointerField( + ::capnp::bounded<8>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Reader::hasCalibratedOrientationNED() const { + return !_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Builder::hasCalibratedOrientationNED() { + return !_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Measurement::Reader LiveLocationKalman::Reader::getCalibratedOrientationNED() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_reader.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::getCalibratedOrientationNED() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationKalman::Measurement::Pipeline LiveLocationKalman::Pipeline::getCalibratedOrientationNED() { + return ::cereal::LiveLocationKalman::Measurement::Pipeline(_typeless.getPointerField(9)); +} +#endif // !CAPNP_LITE +inline void LiveLocationKalman::Builder::setCalibratedOrientationNED( ::cereal::LiveLocationKalman::Measurement::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::set(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::initCalibratedOrientationNED() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::init(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Builder::adoptCalibratedOrientationNED( + ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::adopt(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> LiveLocationKalman::Builder::disownCalibratedOrientationNED() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::disown(_builder.getPointerField( + ::capnp::bounded<9>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Reader::hasVelocityCalibrated() const { + return !_reader.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Builder::hasVelocityCalibrated() { + return !_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Measurement::Reader LiveLocationKalman::Reader::getVelocityCalibrated() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_reader.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::getVelocityCalibrated() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationKalman::Measurement::Pipeline LiveLocationKalman::Pipeline::getVelocityCalibrated() { + return ::cereal::LiveLocationKalman::Measurement::Pipeline(_typeless.getPointerField(10)); +} +#endif // !CAPNP_LITE +inline void LiveLocationKalman::Builder::setVelocityCalibrated( ::cereal::LiveLocationKalman::Measurement::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::set(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::initVelocityCalibrated() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::init(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Builder::adoptVelocityCalibrated( + ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::adopt(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> LiveLocationKalman::Builder::disownVelocityCalibrated() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::disown(_builder.getPointerField( + ::capnp::bounded<10>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Reader::hasAccelerationCalibrated() const { + return !_reader.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Builder::hasAccelerationCalibrated() { + return !_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Measurement::Reader LiveLocationKalman::Reader::getAccelerationCalibrated() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_reader.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::getAccelerationCalibrated() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationKalman::Measurement::Pipeline LiveLocationKalman::Pipeline::getAccelerationCalibrated() { + return ::cereal::LiveLocationKalman::Measurement::Pipeline(_typeless.getPointerField(11)); +} +#endif // !CAPNP_LITE +inline void LiveLocationKalman::Builder::setAccelerationCalibrated( ::cereal::LiveLocationKalman::Measurement::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::set(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::initAccelerationCalibrated() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::init(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Builder::adoptAccelerationCalibrated( + ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::adopt(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> LiveLocationKalman::Builder::disownAccelerationCalibrated() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::disown(_builder.getPointerField( + ::capnp::bounded<11>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Reader::hasAngularVelocityCalibrated() const { + return !_reader.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Builder::hasAngularVelocityCalibrated() { + return !_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Measurement::Reader LiveLocationKalman::Reader::getAngularVelocityCalibrated() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_reader.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::getAngularVelocityCalibrated() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationKalman::Measurement::Pipeline LiveLocationKalman::Pipeline::getAngularVelocityCalibrated() { + return ::cereal::LiveLocationKalman::Measurement::Pipeline(_typeless.getPointerField(12)); +} +#endif // !CAPNP_LITE +inline void LiveLocationKalman::Builder::setAngularVelocityCalibrated( ::cereal::LiveLocationKalman::Measurement::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::set(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::initAngularVelocityCalibrated() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::init(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Builder::adoptAngularVelocityCalibrated( + ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::adopt(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> LiveLocationKalman::Builder::disownAngularVelocityCalibrated() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::disown(_builder.getPointerField( + ::capnp::bounded<12>() * ::capnp::POINTERS)); +} + +inline ::int32_t LiveLocationKalman::Reader::getGpsWeek() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t LiveLocationKalman::Builder::getGpsWeek() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LiveLocationKalman::Builder::setGpsWeek( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline double LiveLocationKalman::Reader::getGpsTimeOfWeek() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline double LiveLocationKalman::Builder::getGpsTimeOfWeek() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveLocationKalman::Builder::setGpsTimeOfWeek(double value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::LiveLocationKalman::Status LiveLocationKalman::Reader::getStatus() const { + return _reader.getDataField< ::cereal::LiveLocationKalman::Status>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::cereal::LiveLocationKalman::Status LiveLocationKalman::Builder::getStatus() { + return _builder.getDataField< ::cereal::LiveLocationKalman::Status>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LiveLocationKalman::Builder::setStatus( ::cereal::LiveLocationKalman::Status value) { + _builder.setDataField< ::cereal::LiveLocationKalman::Status>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::int64_t LiveLocationKalman::Reader::getUnixTimestampMillis() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int64_t LiveLocationKalman::Builder::getUnixTimestampMillis() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LiveLocationKalman::Builder::setUnixTimestampMillis( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveLocationKalman::Reader::getInputsOK() const { + return _reader.getDataField( + ::capnp::bounded<48>() * ::capnp::ELEMENTS, true); +} + +inline bool LiveLocationKalman::Builder::getInputsOK() { + return _builder.getDataField( + ::capnp::bounded<48>() * ::capnp::ELEMENTS, true); +} +inline void LiveLocationKalman::Builder::setInputsOK(bool value) { + _builder.setDataField( + ::capnp::bounded<48>() * ::capnp::ELEMENTS, value, true); +} + +inline bool LiveLocationKalman::Reader::getPosenetOK() const { + return _reader.getDataField( + ::capnp::bounded<49>() * ::capnp::ELEMENTS, true); +} + +inline bool LiveLocationKalman::Builder::getPosenetOK() { + return _builder.getDataField( + ::capnp::bounded<49>() * ::capnp::ELEMENTS, true); +} +inline void LiveLocationKalman::Builder::setPosenetOK(bool value) { + _builder.setDataField( + ::capnp::bounded<49>() * ::capnp::ELEMENTS, value, true); +} + +inline bool LiveLocationKalman::Reader::getGpsOK() const { + return _reader.getDataField( + ::capnp::bounded<50>() * ::capnp::ELEMENTS, true); +} + +inline bool LiveLocationKalman::Builder::getGpsOK() { + return _builder.getDataField( + ::capnp::bounded<50>() * ::capnp::ELEMENTS, true); +} +inline void LiveLocationKalman::Builder::setGpsOK(bool value) { + _builder.setDataField( + ::capnp::bounded<50>() * ::capnp::ELEMENTS, value, true); +} + +inline bool LiveLocationKalman::Reader::hasCalibratedOrientationECEF() const { + return !_reader.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Builder::hasCalibratedOrientationECEF() { + return !_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Measurement::Reader LiveLocationKalman::Reader::getCalibratedOrientationECEF() const { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_reader.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::getCalibratedOrientationECEF() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::get(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::LiveLocationKalman::Measurement::Pipeline LiveLocationKalman::Pipeline::getCalibratedOrientationECEF() { + return ::cereal::LiveLocationKalman::Measurement::Pipeline(_typeless.getPointerField(13)); +} +#endif // !CAPNP_LITE +inline void LiveLocationKalman::Builder::setCalibratedOrientationECEF( ::cereal::LiveLocationKalman::Measurement::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::set(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Measurement::Builder LiveLocationKalman::Builder::initCalibratedOrientationECEF() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::init(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Builder::adoptCalibratedOrientationECEF( + ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement>&& value) { + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::adopt(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman::Measurement> LiveLocationKalman::Builder::disownCalibratedOrientationECEF() { + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman::Measurement>::disown(_builder.getPointerField( + ::capnp::bounded<13>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Reader::getSensorsOK() const { + return _reader.getDataField( + ::capnp::bounded<51>() * ::capnp::ELEMENTS, true); +} + +inline bool LiveLocationKalman::Builder::getSensorsOK() { + return _builder.getDataField( + ::capnp::bounded<51>() * ::capnp::ELEMENTS, true); +} +inline void LiveLocationKalman::Builder::setSensorsOK(bool value) { + _builder.setDataField( + ::capnp::bounded<51>() * ::capnp::ELEMENTS, value, true); +} + +inline bool LiveLocationKalman::Reader::getDeviceStable() const { + return _reader.getDataField( + ::capnp::bounded<52>() * ::capnp::ELEMENTS, true); +} + +inline bool LiveLocationKalman::Builder::getDeviceStable() { + return _builder.getDataField( + ::capnp::bounded<52>() * ::capnp::ELEMENTS, true); +} +inline void LiveLocationKalman::Builder::setDeviceStable(bool value) { + _builder.setDataField( + ::capnp::bounded<52>() * ::capnp::ELEMENTS, value, true); +} + +inline double LiveLocationKalman::Reader::getTimeSinceReset() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline double LiveLocationKalman::Builder::getTimeSinceReset() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void LiveLocationKalman::Builder::setTimeSinceReset(double value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveLocationKalman::Reader::getExcessiveResets() const { + return _reader.getDataField( + ::capnp::bounded<53>() * ::capnp::ELEMENTS); +} + +inline bool LiveLocationKalman::Builder::getExcessiveResets() { + return _builder.getDataField( + ::capnp::bounded<53>() * ::capnp::ELEMENTS); +} +inline void LiveLocationKalman::Builder::setExcessiveResets(bool value) { + _builder.setDataField( + ::capnp::bounded<53>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveLocationKalman::Measurement::Reader::hasValue() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Measurement::Builder::hasValue() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLocationKalman::Measurement::Reader::getValue() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLocationKalman::Measurement::Builder::getValue() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Measurement::Builder::setValue( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void LiveLocationKalman::Measurement::Builder::setValue(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLocationKalman::Measurement::Builder::initValue(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void LiveLocationKalman::Measurement::Builder::adoptValue( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLocationKalman::Measurement::Builder::disownValue() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Measurement::Reader::hasStd() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLocationKalman::Measurement::Builder::hasStd() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLocationKalman::Measurement::Reader::getStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLocationKalman::Measurement::Builder::getStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void LiveLocationKalman::Measurement::Builder::setStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void LiveLocationKalman::Measurement::Builder::setStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLocationKalman::Measurement::Builder::initStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void LiveLocationKalman::Measurement::Builder::adoptStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLocationKalman::Measurement::Builder::disownStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool LiveLocationKalman::Measurement::Reader::getValid() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool LiveLocationKalman::Measurement::Builder::getValid() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LiveLocationKalman::Measurement::Builder::setValid(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool ProcLog::Reader::hasCpuTimes() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ProcLog::Builder::hasCpuTimes() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>::Reader ProcLog::Reader::getCpuTimes() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>::Builder ProcLog::Builder::getCpuTimes() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ProcLog::Builder::setCpuTimes( ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>::Builder ProcLog::Builder::initCpuTimes(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void ProcLog::Builder::adoptCpuTimes( + ::capnp::Orphan< ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>> ProcLog::Builder::disownCpuTimes() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ProcLog::CPUTimes, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool ProcLog::Reader::hasMem() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool ProcLog::Builder::hasMem() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ProcLog::Mem::Reader ProcLog::Reader::getMem() const { + return ::capnp::_::PointerHelpers< ::cereal::ProcLog::Mem>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::cereal::ProcLog::Mem::Builder ProcLog::Builder::getMem() { + return ::capnp::_::PointerHelpers< ::cereal::ProcLog::Mem>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::ProcLog::Mem::Pipeline ProcLog::Pipeline::getMem() { + return ::cereal::ProcLog::Mem::Pipeline(_typeless.getPointerField(1)); +} +#endif // !CAPNP_LITE +inline void ProcLog::Builder::setMem( ::cereal::ProcLog::Mem::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::ProcLog::Mem>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::cereal::ProcLog::Mem::Builder ProcLog::Builder::initMem() { + return ::capnp::_::PointerHelpers< ::cereal::ProcLog::Mem>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void ProcLog::Builder::adoptMem( + ::capnp::Orphan< ::cereal::ProcLog::Mem>&& value) { + ::capnp::_::PointerHelpers< ::cereal::ProcLog::Mem>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ProcLog::Mem> ProcLog::Builder::disownMem() { + return ::capnp::_::PointerHelpers< ::cereal::ProcLog::Mem>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool ProcLog::Reader::hasProcs() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool ProcLog::Builder::hasProcs() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>::Reader ProcLog::Reader::getProcs() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>::Builder ProcLog::Builder::getProcs() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void ProcLog::Builder::setProcs( ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>::Builder ProcLog::Builder::initProcs(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void ProcLog::Builder::adoptProcs( + ::capnp::Orphan< ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>> ProcLog::Builder::disownProcs() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ProcLog::Process, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline ::int32_t ProcLog::Process::Reader::getPid() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t ProcLog::Process::Builder::getPid() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Process::Builder::setPid( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool ProcLog::Process::Reader::hasName() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ProcLog::Process::Builder::hasName() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader ProcLog::Process::Reader::getName() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder ProcLog::Process::Builder::getName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ProcLog::Process::Builder::setName( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder ProcLog::Process::Builder::initName(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void ProcLog::Process::Builder::adoptName( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> ProcLog::Process::Builder::disownName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::uint8_t ProcLog::Process::Reader::getState() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t ProcLog::Process::Builder::getState() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Process::Builder::setState( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t ProcLog::Process::Reader::getPpid() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int32_t ProcLog::Process::Builder::getPpid() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Process::Builder::setPpid( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float ProcLog::Process::Reader::getCpuUser() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float ProcLog::Process::Builder::getCpuUser() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Process::Builder::setCpuUser(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float ProcLog::Process::Reader::getCpuSystem() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float ProcLog::Process::Builder::getCpuSystem() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Process::Builder::setCpuSystem(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float ProcLog::Process::Reader::getCpuChildrenUser() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float ProcLog::Process::Builder::getCpuChildrenUser() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Process::Builder::setCpuChildrenUser(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float ProcLog::Process::Reader::getCpuChildrenSystem() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float ProcLog::Process::Builder::getCpuChildrenSystem() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Process::Builder::setCpuChildrenSystem(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline ::int64_t ProcLog::Process::Reader::getPriority() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::int64_t ProcLog::Process::Builder::getPriority() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Process::Builder::setPriority( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t ProcLog::Process::Reader::getNice() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline ::int32_t ProcLog::Process::Builder::getNice() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Process::Builder::setNice( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t ProcLog::Process::Reader::getNumThreads() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline ::int32_t ProcLog::Process::Builder::getNumThreads() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Process::Builder::setNumThreads( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline double ProcLog::Process::Reader::getStartTime() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline double ProcLog::Process::Builder::getStartTime() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Process::Builder::setStartTime(double value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ProcLog::Process::Reader::getMemVms() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ProcLog::Process::Builder::getMemVms() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Process::Builder::setMemVms( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ProcLog::Process::Reader::getMemRss() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ProcLog::Process::Builder::getMemRss() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Process::Builder::setMemRss( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t ProcLog::Process::Reader::getProcessor() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline ::int32_t ProcLog::Process::Builder::getProcessor() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Process::Builder::setProcessor( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline bool ProcLog::Process::Reader::hasCmdline() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool ProcLog::Process::Builder::hasCmdline() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Reader ProcLog::Process::Reader::getCmdline() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Builder ProcLog::Process::Builder::getCmdline() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void ProcLog::Process::Builder::setCmdline( ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void ProcLog::Process::Builder::setCmdline(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>::Builder ProcLog::Process::Builder::initCmdline(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void ProcLog::Process::Builder::adoptCmdline( + ::capnp::Orphan< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>> ProcLog::Process::Builder::disownCmdline() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::Text, ::capnp::Kind::BLOB>>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool ProcLog::Process::Reader::hasExe() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool ProcLog::Process::Builder::hasExe() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader ProcLog::Process::Reader::getExe() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder ProcLog::Process::Builder::getExe() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void ProcLog::Process::Builder::setExe( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder ProcLog::Process::Builder::initExe(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void ProcLog::Process::Builder::adoptExe( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> ProcLog::Process::Builder::disownExe() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline ::int64_t ProcLog::CPUTimes::Reader::getCpuNum() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int64_t ProcLog::CPUTimes::Builder::getCpuNum() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ProcLog::CPUTimes::Builder::setCpuNum( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float ProcLog::CPUTimes::Reader::getUser() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float ProcLog::CPUTimes::Builder::getUser() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ProcLog::CPUTimes::Builder::setUser(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float ProcLog::CPUTimes::Reader::getNice() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float ProcLog::CPUTimes::Builder::getNice() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void ProcLog::CPUTimes::Builder::setNice(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float ProcLog::CPUTimes::Reader::getSystem() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float ProcLog::CPUTimes::Builder::getSystem() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void ProcLog::CPUTimes::Builder::setSystem(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float ProcLog::CPUTimes::Reader::getIdle() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float ProcLog::CPUTimes::Builder::getIdle() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void ProcLog::CPUTimes::Builder::setIdle(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float ProcLog::CPUTimes::Reader::getIowait() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float ProcLog::CPUTimes::Builder::getIowait() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void ProcLog::CPUTimes::Builder::setIowait(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float ProcLog::CPUTimes::Reader::getIrq() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float ProcLog::CPUTimes::Builder::getIrq() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void ProcLog::CPUTimes::Builder::setIrq(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float ProcLog::CPUTimes::Reader::getSoftirq() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float ProcLog::CPUTimes::Builder::getSoftirq() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void ProcLog::CPUTimes::Builder::setSoftirq(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ProcLog::Mem::Reader::getTotal() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ProcLog::Mem::Builder::getTotal() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Mem::Builder::setTotal( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ProcLog::Mem::Reader::getFree() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ProcLog::Mem::Builder::getFree() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Mem::Builder::setFree( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ProcLog::Mem::Reader::getAvailable() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ProcLog::Mem::Builder::getAvailable() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Mem::Builder::setAvailable( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ProcLog::Mem::Reader::getBuffers() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ProcLog::Mem::Builder::getBuffers() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Mem::Builder::setBuffers( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ProcLog::Mem::Reader::getCached() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ProcLog::Mem::Builder::getCached() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Mem::Builder::setCached( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ProcLog::Mem::Reader::getActive() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ProcLog::Mem::Builder::getActive() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Mem::Builder::setActive( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ProcLog::Mem::Reader::getInactive() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ProcLog::Mem::Builder::getInactive() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Mem::Builder::setInactive( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t ProcLog::Mem::Reader::getShared() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t ProcLog::Mem::Builder::getShared() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void ProcLog::Mem::Builder::setShared( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::UbloxGnss::Which UbloxGnss::Reader::which() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline ::cereal::UbloxGnss::Which UbloxGnss::Builder::which() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool UbloxGnss::Reader::isMeasurementReport() const { + return which() == UbloxGnss::MEASUREMENT_REPORT; +} +inline bool UbloxGnss::Builder::isMeasurementReport() { + return which() == UbloxGnss::MEASUREMENT_REPORT; +} +inline bool UbloxGnss::Reader::hasMeasurementReport() const { + if (which() != UbloxGnss::MEASUREMENT_REPORT) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool UbloxGnss::Builder::hasMeasurementReport() { + if (which() != UbloxGnss::MEASUREMENT_REPORT) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::UbloxGnss::MeasurementReport::Reader UbloxGnss::Reader::getMeasurementReport() const { + KJ_IREQUIRE((which() == UbloxGnss::MEASUREMENT_REPORT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::UbloxGnss::MeasurementReport::Builder UbloxGnss::Builder::getMeasurementReport() { + KJ_IREQUIRE((which() == UbloxGnss::MEASUREMENT_REPORT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::Builder::setMeasurementReport( ::cereal::UbloxGnss::MeasurementReport::Reader value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::MEASUREMENT_REPORT); + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::UbloxGnss::MeasurementReport::Builder UbloxGnss::Builder::initMeasurementReport() { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::MEASUREMENT_REPORT); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::Builder::adoptMeasurementReport( + ::capnp::Orphan< ::cereal::UbloxGnss::MeasurementReport>&& value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::MEASUREMENT_REPORT); + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::UbloxGnss::MeasurementReport> UbloxGnss::Builder::disownMeasurementReport() { + KJ_IREQUIRE((which() == UbloxGnss::MEASUREMENT_REPORT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool UbloxGnss::Reader::isEphemeris() const { + return which() == UbloxGnss::EPHEMERIS; +} +inline bool UbloxGnss::Builder::isEphemeris() { + return which() == UbloxGnss::EPHEMERIS; +} +inline bool UbloxGnss::Reader::hasEphemeris() const { + if (which() != UbloxGnss::EPHEMERIS) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool UbloxGnss::Builder::hasEphemeris() { + if (which() != UbloxGnss::EPHEMERIS) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::UbloxGnss::Ephemeris::Reader UbloxGnss::Reader::getEphemeris() const { + KJ_IREQUIRE((which() == UbloxGnss::EPHEMERIS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::Ephemeris>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::UbloxGnss::Ephemeris::Builder UbloxGnss::Builder::getEphemeris() { + KJ_IREQUIRE((which() == UbloxGnss::EPHEMERIS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::Ephemeris>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::Builder::setEphemeris( ::cereal::UbloxGnss::Ephemeris::Reader value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::EPHEMERIS); + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::Ephemeris>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::UbloxGnss::Ephemeris::Builder UbloxGnss::Builder::initEphemeris() { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::EPHEMERIS); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::Ephemeris>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::Builder::adoptEphemeris( + ::capnp::Orphan< ::cereal::UbloxGnss::Ephemeris>&& value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::EPHEMERIS); + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::Ephemeris>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::UbloxGnss::Ephemeris> UbloxGnss::Builder::disownEphemeris() { + KJ_IREQUIRE((which() == UbloxGnss::EPHEMERIS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::Ephemeris>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool UbloxGnss::Reader::isIonoData() const { + return which() == UbloxGnss::IONO_DATA; +} +inline bool UbloxGnss::Builder::isIonoData() { + return which() == UbloxGnss::IONO_DATA; +} +inline bool UbloxGnss::Reader::hasIonoData() const { + if (which() != UbloxGnss::IONO_DATA) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool UbloxGnss::Builder::hasIonoData() { + if (which() != UbloxGnss::IONO_DATA) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::UbloxGnss::IonoData::Reader UbloxGnss::Reader::getIonoData() const { + KJ_IREQUIRE((which() == UbloxGnss::IONO_DATA), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::IonoData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::UbloxGnss::IonoData::Builder UbloxGnss::Builder::getIonoData() { + KJ_IREQUIRE((which() == UbloxGnss::IONO_DATA), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::IonoData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::Builder::setIonoData( ::cereal::UbloxGnss::IonoData::Reader value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::IONO_DATA); + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::IonoData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::UbloxGnss::IonoData::Builder UbloxGnss::Builder::initIonoData() { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::IONO_DATA); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::IonoData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::Builder::adoptIonoData( + ::capnp::Orphan< ::cereal::UbloxGnss::IonoData>&& value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::IONO_DATA); + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::IonoData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::UbloxGnss::IonoData> UbloxGnss::Builder::disownIonoData() { + KJ_IREQUIRE((which() == UbloxGnss::IONO_DATA), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::IonoData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool UbloxGnss::Reader::isHwStatus() const { + return which() == UbloxGnss::HW_STATUS; +} +inline bool UbloxGnss::Builder::isHwStatus() { + return which() == UbloxGnss::HW_STATUS; +} +inline bool UbloxGnss::Reader::hasHwStatus() const { + if (which() != UbloxGnss::HW_STATUS) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool UbloxGnss::Builder::hasHwStatus() { + if (which() != UbloxGnss::HW_STATUS) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::UbloxGnss::HwStatus::Reader UbloxGnss::Reader::getHwStatus() const { + KJ_IREQUIRE((which() == UbloxGnss::HW_STATUS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::HwStatus>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::UbloxGnss::HwStatus::Builder UbloxGnss::Builder::getHwStatus() { + KJ_IREQUIRE((which() == UbloxGnss::HW_STATUS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::HwStatus>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::Builder::setHwStatus( ::cereal::UbloxGnss::HwStatus::Reader value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::HW_STATUS); + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::HwStatus>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::UbloxGnss::HwStatus::Builder UbloxGnss::Builder::initHwStatus() { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::HW_STATUS); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::HwStatus>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::Builder::adoptHwStatus( + ::capnp::Orphan< ::cereal::UbloxGnss::HwStatus>&& value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::HW_STATUS); + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::HwStatus>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::UbloxGnss::HwStatus> UbloxGnss::Builder::disownHwStatus() { + KJ_IREQUIRE((which() == UbloxGnss::HW_STATUS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::HwStatus>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool UbloxGnss::Reader::isHwStatus2() const { + return which() == UbloxGnss::HW_STATUS2; +} +inline bool UbloxGnss::Builder::isHwStatus2() { + return which() == UbloxGnss::HW_STATUS2; +} +inline bool UbloxGnss::Reader::hasHwStatus2() const { + if (which() != UbloxGnss::HW_STATUS2) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool UbloxGnss::Builder::hasHwStatus2() { + if (which() != UbloxGnss::HW_STATUS2) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::UbloxGnss::HwStatus2::Reader UbloxGnss::Reader::getHwStatus2() const { + KJ_IREQUIRE((which() == UbloxGnss::HW_STATUS2), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::HwStatus2>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::UbloxGnss::HwStatus2::Builder UbloxGnss::Builder::getHwStatus2() { + KJ_IREQUIRE((which() == UbloxGnss::HW_STATUS2), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::HwStatus2>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::Builder::setHwStatus2( ::cereal::UbloxGnss::HwStatus2::Reader value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::HW_STATUS2); + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::HwStatus2>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::UbloxGnss::HwStatus2::Builder UbloxGnss::Builder::initHwStatus2() { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::HW_STATUS2); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::HwStatus2>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::Builder::adoptHwStatus2( + ::capnp::Orphan< ::cereal::UbloxGnss::HwStatus2>&& value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, UbloxGnss::HW_STATUS2); + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::HwStatus2>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::UbloxGnss::HwStatus2> UbloxGnss::Builder::disownHwStatus2() { + KJ_IREQUIRE((which() == UbloxGnss::HW_STATUS2), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::HwStatus2>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline double UbloxGnss::MeasurementReport::Reader::getRcvTow() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::MeasurementReport::Builder::getRcvTow() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Builder::setRcvTow(double value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t UbloxGnss::MeasurementReport::Reader::getGpsWeek() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t UbloxGnss::MeasurementReport::Builder::getGpsWeek() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Builder::setGpsWeek( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t UbloxGnss::MeasurementReport::Reader::getLeapSeconds() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t UbloxGnss::MeasurementReport::Builder::getLeapSeconds() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Builder::setLeapSeconds( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool UbloxGnss::MeasurementReport::Reader::hasReceiverStatus() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool UbloxGnss::MeasurementReport::Builder::hasReceiverStatus() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus::Reader UbloxGnss::MeasurementReport::Reader::getReceiverStatus() const { + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus::Builder UbloxGnss::MeasurementReport::Builder::getReceiverStatus() { + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus::Pipeline UbloxGnss::MeasurementReport::Pipeline::getReceiverStatus() { + return ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void UbloxGnss::MeasurementReport::Builder::setReceiverStatus( ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus::Builder UbloxGnss::MeasurementReport::Builder::initReceiverStatus() { + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::MeasurementReport::Builder::adoptReceiverStatus( + ::capnp::Orphan< ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus>&& value) { + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus> UbloxGnss::MeasurementReport::Builder::disownReceiverStatus() { + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport::ReceiverStatus>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::uint8_t UbloxGnss::MeasurementReport::Reader::getNumMeas() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t UbloxGnss::MeasurementReport::Builder::getNumMeas() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Builder::setNumMeas( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline bool UbloxGnss::MeasurementReport::Reader::hasMeasurements() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool UbloxGnss::MeasurementReport::Builder::hasMeasurements() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>::Reader UbloxGnss::MeasurementReport::Reader::getMeasurements() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>::Builder UbloxGnss::MeasurementReport::Builder::getMeasurements() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::MeasurementReport::Builder::setMeasurements( ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>::Builder UbloxGnss::MeasurementReport::Builder::initMeasurements(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void UbloxGnss::MeasurementReport::Builder::adoptMeasurements( + ::capnp::Orphan< ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>> UbloxGnss::MeasurementReport::Builder::disownMeasurements() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::UbloxGnss::MeasurementReport::Measurement, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool UbloxGnss::MeasurementReport::ReceiverStatus::Reader::getLeapSecValid() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool UbloxGnss::MeasurementReport::ReceiverStatus::Builder::getLeapSecValid() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::ReceiverStatus::Builder::setLeapSecValid(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool UbloxGnss::MeasurementReport::ReceiverStatus::Reader::getClkReset() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool UbloxGnss::MeasurementReport::ReceiverStatus::Builder::getClkReset() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::ReceiverStatus::Builder::setClkReset(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t UbloxGnss::MeasurementReport::Measurement::Reader::getSvId() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t UbloxGnss::MeasurementReport::Measurement::Builder::getSvId() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::Builder::setSvId( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool UbloxGnss::MeasurementReport::Measurement::Reader::hasTrackingStatus() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool UbloxGnss::MeasurementReport::Measurement::Builder::hasTrackingStatus() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Reader UbloxGnss::MeasurementReport::Measurement::Reader::getTrackingStatus() const { + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Builder UbloxGnss::MeasurementReport::Measurement::Builder::getTrackingStatus() { + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Pipeline UbloxGnss::MeasurementReport::Measurement::Pipeline::getTrackingStatus() { + return ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void UbloxGnss::MeasurementReport::Measurement::Builder::setTrackingStatus( ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Builder UbloxGnss::MeasurementReport::Measurement::Builder::initTrackingStatus() { + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::MeasurementReport::Measurement::Builder::adoptTrackingStatus( + ::capnp::Orphan< ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus>&& value) { + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus> UbloxGnss::MeasurementReport::Measurement::Builder::disownTrackingStatus() { + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss::MeasurementReport::Measurement::TrackingStatus>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline double UbloxGnss::MeasurementReport::Measurement::Reader::getPseudorange() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::MeasurementReport::Measurement::Builder::getPseudorange() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::Builder::setPseudorange(double value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::MeasurementReport::Measurement::Reader::getCarrierCycles() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::MeasurementReport::Measurement::Builder::getCarrierCycles() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::Builder::setCarrierCycles(double value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float UbloxGnss::MeasurementReport::Measurement::Reader::getDoppler() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float UbloxGnss::MeasurementReport::Measurement::Builder::getDoppler() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::Builder::setDoppler(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t UbloxGnss::MeasurementReport::Measurement::Reader::getGnssId() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t UbloxGnss::MeasurementReport::Measurement::Builder::getGnssId() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::Builder::setGnssId( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t UbloxGnss::MeasurementReport::Measurement::Reader::getGlonassFrequencyIndex() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t UbloxGnss::MeasurementReport::Measurement::Builder::getGlonassFrequencyIndex() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::Builder::setGlonassFrequencyIndex( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t UbloxGnss::MeasurementReport::Measurement::Reader::getLocktime() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t UbloxGnss::MeasurementReport::Measurement::Builder::getLocktime() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::Builder::setLocktime( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t UbloxGnss::MeasurementReport::Measurement::Reader::getCno() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t UbloxGnss::MeasurementReport::Measurement::Builder::getCno() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::Builder::setCno( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float UbloxGnss::MeasurementReport::Measurement::Reader::getPseudorangeStdev() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float UbloxGnss::MeasurementReport::Measurement::Builder::getPseudorangeStdev() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::Builder::setPseudorangeStdev(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float UbloxGnss::MeasurementReport::Measurement::Reader::getCarrierPhaseStdev() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float UbloxGnss::MeasurementReport::Measurement::Builder::getCarrierPhaseStdev() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::Builder::setCarrierPhaseStdev(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float UbloxGnss::MeasurementReport::Measurement::Reader::getDopplerStdev() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline float UbloxGnss::MeasurementReport::Measurement::Builder::getDopplerStdev() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::Builder::setDopplerStdev(float value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t UbloxGnss::MeasurementReport::Measurement::Reader::getSigId() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<26>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t UbloxGnss::MeasurementReport::Measurement::Builder::getSigId() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<26>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::Builder::setSigId( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<26>() * ::capnp::ELEMENTS, value); +} + +inline bool UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Reader::getPseudorangeValid() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Builder::getPseudorangeValid() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Builder::setPseudorangeValid(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Reader::getCarrierPhaseValid() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Builder::getCarrierPhaseValid() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Builder::setCarrierPhaseValid(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Reader::getHalfCycleValid() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline bool UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Builder::getHalfCycleValid() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Builder::setHalfCycleValid(bool value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Reader::getHalfCycleSubtracted() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline bool UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Builder::getHalfCycleSubtracted() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::MeasurementReport::Measurement::TrackingStatus::Builder::setHalfCycleSubtracted(bool value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t UbloxGnss::Ephemeris::Reader::getSvId() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t UbloxGnss::Ephemeris::Builder::getSvId() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setSvId( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t UbloxGnss::Ephemeris::Reader::getYear() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t UbloxGnss::Ephemeris::Builder::getYear() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setYear( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t UbloxGnss::Ephemeris::Reader::getMonth() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t UbloxGnss::Ephemeris::Builder::getMonth() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setMonth( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t UbloxGnss::Ephemeris::Reader::getDay() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t UbloxGnss::Ephemeris::Builder::getDay() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setDay( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t UbloxGnss::Ephemeris::Reader::getHour() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t UbloxGnss::Ephemeris::Builder::getHour() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setHour( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t UbloxGnss::Ephemeris::Reader::getMinute() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t UbloxGnss::Ephemeris::Builder::getMinute() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setMinute( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float UbloxGnss::Ephemeris::Reader::getSecond() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float UbloxGnss::Ephemeris::Builder::getSecond() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setSecond(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getAf0() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getAf0() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setAf0(double value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getAf1() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getAf1() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setAf1(double value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getAf2() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getAf2() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setAf2(double value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getIode() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getIode() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setIode(double value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getCrs() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getCrs() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setCrs(double value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getDeltaN() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getDeltaN() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setDeltaN(double value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getM0() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getM0() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setM0(double value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getCuc() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getCuc() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setCuc(double value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getEcc() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getEcc() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setEcc(double value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getCus() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getCus() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setCus(double value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getA() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getA() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setA(double value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getToe() const { + return _reader.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getToe() { + return _builder.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setToe(double value) { + _builder.setDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getCic() const { + return _reader.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getCic() { + return _builder.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setCic(double value) { + _builder.setDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getOmega0() const { + return _reader.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getOmega0() { + return _builder.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setOmega0(double value) { + _builder.setDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getCis() const { + return _reader.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getCis() { + return _builder.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setCis(double value) { + _builder.setDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getI0() const { + return _reader.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getI0() { + return _builder.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setI0(double value) { + _builder.setDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getCrc() const { + return _reader.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getCrc() { + return _builder.getDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setCrc(double value) { + _builder.setDataField( + ::capnp::bounded<18>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getOmega() const { + return _reader.getDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getOmega() { + return _builder.getDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setOmega(double value) { + _builder.setDataField( + ::capnp::bounded<19>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getOmegaDot() const { + return _reader.getDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getOmegaDot() { + return _builder.getDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setOmegaDot(double value) { + _builder.setDataField( + ::capnp::bounded<20>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getIDot() const { + return _reader.getDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getIDot() { + return _builder.getDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setIDot(double value) { + _builder.setDataField( + ::capnp::bounded<21>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getCodesL2() const { + return _reader.getDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getCodesL2() { + return _builder.getDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setCodesL2(double value) { + _builder.setDataField( + ::capnp::bounded<22>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getGpsWeek() const { + return _reader.getDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getGpsWeek() { + return _builder.getDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setGpsWeek(double value) { + _builder.setDataField( + ::capnp::bounded<23>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getL2() const { + return _reader.getDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getL2() { + return _builder.getDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setL2(double value) { + _builder.setDataField( + ::capnp::bounded<24>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getSvAcc() const { + return _reader.getDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getSvAcc() { + return _builder.getDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setSvAcc(double value) { + _builder.setDataField( + ::capnp::bounded<25>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getSvHealth() const { + return _reader.getDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getSvHealth() { + return _builder.getDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setSvHealth(double value) { + _builder.setDataField( + ::capnp::bounded<26>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getTgd() const { + return _reader.getDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getTgd() { + return _builder.getDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setTgd(double value) { + _builder.setDataField( + ::capnp::bounded<27>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getIodc() const { + return _reader.getDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getIodc() { + return _builder.getDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setIodc(double value) { + _builder.setDataField( + ::capnp::bounded<28>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getTransmissionTime() const { + return _reader.getDataField( + ::capnp::bounded<29>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getTransmissionTime() { + return _builder.getDataField( + ::capnp::bounded<29>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setTransmissionTime(double value) { + _builder.setDataField( + ::capnp::bounded<29>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getFitInterval() const { + return _reader.getDataField( + ::capnp::bounded<30>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getFitInterval() { + return _builder.getDataField( + ::capnp::bounded<30>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setFitInterval(double value) { + _builder.setDataField( + ::capnp::bounded<30>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::Ephemeris::Reader::getToc() const { + return _reader.getDataField( + ::capnp::bounded<31>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::Ephemeris::Builder::getToc() { + return _builder.getDataField( + ::capnp::bounded<31>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setToc(double value) { + _builder.setDataField( + ::capnp::bounded<31>() * ::capnp::ELEMENTS, value); +} + +inline bool UbloxGnss::Ephemeris::Reader::getIonoCoeffsValid() const { + return _reader.getDataField( + ::capnp::bounded<2048>() * ::capnp::ELEMENTS); +} + +inline bool UbloxGnss::Ephemeris::Builder::getIonoCoeffsValid() { + return _builder.getDataField( + ::capnp::bounded<2048>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::Ephemeris::Builder::setIonoCoeffsValid(bool value) { + _builder.setDataField( + ::capnp::bounded<2048>() * ::capnp::ELEMENTS, value); +} + +inline bool UbloxGnss::Ephemeris::Reader::hasIonoAlpha() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool UbloxGnss::Ephemeris::Builder::hasIonoAlpha() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader UbloxGnss::Ephemeris::Reader::getIonoAlpha() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder UbloxGnss::Ephemeris::Builder::getIonoAlpha() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::Ephemeris::Builder::setIonoAlpha( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void UbloxGnss::Ephemeris::Builder::setIonoAlpha(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder UbloxGnss::Ephemeris::Builder::initIonoAlpha(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void UbloxGnss::Ephemeris::Builder::adoptIonoAlpha( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> UbloxGnss::Ephemeris::Builder::disownIonoAlpha() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool UbloxGnss::Ephemeris::Reader::hasIonoBeta() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool UbloxGnss::Ephemeris::Builder::hasIonoBeta() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader UbloxGnss::Ephemeris::Reader::getIonoBeta() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder UbloxGnss::Ephemeris::Builder::getIonoBeta() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::Ephemeris::Builder::setIonoBeta( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void UbloxGnss::Ephemeris::Builder::setIonoBeta(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder UbloxGnss::Ephemeris::Builder::initIonoBeta(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void UbloxGnss::Ephemeris::Builder::adoptIonoBeta( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> UbloxGnss::Ephemeris::Builder::disownIonoBeta() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline ::uint32_t UbloxGnss::IonoData::Reader::getSvHealth() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t UbloxGnss::IonoData::Builder::getSvHealth() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::IonoData::Builder::setSvHealth( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::IonoData::Reader::getTow() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::IonoData::Builder::getTow() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::IonoData::Builder::setTow(double value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline double UbloxGnss::IonoData::Reader::getGpsWeek() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline double UbloxGnss::IonoData::Builder::getGpsWeek() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::IonoData::Builder::setGpsWeek(double value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool UbloxGnss::IonoData::Reader::hasIonoAlpha() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool UbloxGnss::IonoData::Builder::hasIonoAlpha() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader UbloxGnss::IonoData::Reader::getIonoAlpha() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder UbloxGnss::IonoData::Builder::getIonoAlpha() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::IonoData::Builder::setIonoAlpha( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void UbloxGnss::IonoData::Builder::setIonoAlpha(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder UbloxGnss::IonoData::Builder::initIonoAlpha(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void UbloxGnss::IonoData::Builder::adoptIonoAlpha( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> UbloxGnss::IonoData::Builder::disownIonoAlpha() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool UbloxGnss::IonoData::Reader::hasIonoBeta() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool UbloxGnss::IonoData::Builder::hasIonoBeta() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader UbloxGnss::IonoData::Reader::getIonoBeta() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder UbloxGnss::IonoData::Builder::getIonoBeta() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void UbloxGnss::IonoData::Builder::setIonoBeta( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void UbloxGnss::IonoData::Builder::setIonoBeta(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder UbloxGnss::IonoData::Builder::initIonoBeta(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void UbloxGnss::IonoData::Builder::adoptIonoBeta( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> UbloxGnss::IonoData::Builder::disownIonoBeta() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool UbloxGnss::IonoData::Reader::getHealthValid() const { + return _reader.getDataField( + ::capnp::bounded<32>() * ::capnp::ELEMENTS); +} + +inline bool UbloxGnss::IonoData::Builder::getHealthValid() { + return _builder.getDataField( + ::capnp::bounded<32>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::IonoData::Builder::setHealthValid(bool value) { + _builder.setDataField( + ::capnp::bounded<32>() * ::capnp::ELEMENTS, value); +} + +inline bool UbloxGnss::IonoData::Reader::getIonoCoeffsValid() const { + return _reader.getDataField( + ::capnp::bounded<33>() * ::capnp::ELEMENTS); +} + +inline bool UbloxGnss::IonoData::Builder::getIonoCoeffsValid() { + return _builder.getDataField( + ::capnp::bounded<33>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::IonoData::Builder::setIonoCoeffsValid(bool value) { + _builder.setDataField( + ::capnp::bounded<33>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t UbloxGnss::HwStatus::Reader::getNoisePerMS() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t UbloxGnss::HwStatus::Builder::getNoisePerMS() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::HwStatus::Builder::setNoisePerMS( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t UbloxGnss::HwStatus::Reader::getAgcCnt() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t UbloxGnss::HwStatus::Builder::getAgcCnt() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::HwStatus::Builder::setAgcCnt( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::UbloxGnss::HwStatus::AntennaSupervisorState UbloxGnss::HwStatus::Reader::getAStatus() const { + return _reader.getDataField< ::cereal::UbloxGnss::HwStatus::AntennaSupervisorState>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::cereal::UbloxGnss::HwStatus::AntennaSupervisorState UbloxGnss::HwStatus::Builder::getAStatus() { + return _builder.getDataField< ::cereal::UbloxGnss::HwStatus::AntennaSupervisorState>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::HwStatus::Builder::setAStatus( ::cereal::UbloxGnss::HwStatus::AntennaSupervisorState value) { + _builder.setDataField< ::cereal::UbloxGnss::HwStatus::AntennaSupervisorState>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::UbloxGnss::HwStatus::AntennaPowerStatus UbloxGnss::HwStatus::Reader::getAPower() const { + return _reader.getDataField< ::cereal::UbloxGnss::HwStatus::AntennaPowerStatus>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::cereal::UbloxGnss::HwStatus::AntennaPowerStatus UbloxGnss::HwStatus::Builder::getAPower() { + return _builder.getDataField< ::cereal::UbloxGnss::HwStatus::AntennaPowerStatus>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::HwStatus::Builder::setAPower( ::cereal::UbloxGnss::HwStatus::AntennaPowerStatus value) { + _builder.setDataField< ::cereal::UbloxGnss::HwStatus::AntennaPowerStatus>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t UbloxGnss::HwStatus::Reader::getJamInd() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t UbloxGnss::HwStatus::Builder::getJamInd() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::HwStatus::Builder::setJamInd( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t UbloxGnss::HwStatus::Reader::getFlags() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t UbloxGnss::HwStatus::Builder::getFlags() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::HwStatus::Builder::setFlags( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline ::int8_t UbloxGnss::HwStatus2::Reader::getOfsI() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int8_t UbloxGnss::HwStatus2::Builder::getOfsI() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::HwStatus2::Builder::setOfsI( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t UbloxGnss::HwStatus2::Reader::getMagI() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t UbloxGnss::HwStatus2::Builder::getMagI() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::HwStatus2::Builder::setMagI( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int8_t UbloxGnss::HwStatus2::Reader::getOfsQ() const { + return _reader.getDataField< ::int8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int8_t UbloxGnss::HwStatus2::Builder::getOfsQ() { + return _builder.getDataField< ::int8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::HwStatus2::Builder::setOfsQ( ::int8_t value) { + _builder.setDataField< ::int8_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint8_t UbloxGnss::HwStatus2::Reader::getMagQ() const { + return _reader.getDataField< ::uint8_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint8_t UbloxGnss::HwStatus2::Builder::getMagQ() { + return _builder.getDataField< ::uint8_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::HwStatus2::Builder::setMagQ( ::uint8_t value) { + _builder.setDataField< ::uint8_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::UbloxGnss::HwStatus2::ConfigSource UbloxGnss::HwStatus2::Reader::getCfgSource() const { + return _reader.getDataField< ::cereal::UbloxGnss::HwStatus2::ConfigSource>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::cereal::UbloxGnss::HwStatus2::ConfigSource UbloxGnss::HwStatus2::Builder::getCfgSource() { + return _builder.getDataField< ::cereal::UbloxGnss::HwStatus2::ConfigSource>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::HwStatus2::Builder::setCfgSource( ::cereal::UbloxGnss::HwStatus2::ConfigSource value) { + _builder.setDataField< ::cereal::UbloxGnss::HwStatus2::ConfigSource>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t UbloxGnss::HwStatus2::Reader::getLowLevCfg() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t UbloxGnss::HwStatus2::Builder::getLowLevCfg() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::HwStatus2::Builder::setLowLevCfg( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t UbloxGnss::HwStatus2::Reader::getPostStatus() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t UbloxGnss::HwStatus2::Builder::getPostStatus() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void UbloxGnss::HwStatus2::Builder::setPostStatus( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t Clocks::Reader::getBootTimeNanos() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t Clocks::Builder::getBootTimeNanos() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void Clocks::Builder::setBootTimeNanos( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t Clocks::Reader::getMonotonicNanos() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t Clocks::Builder::getMonotonicNanos() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void Clocks::Builder::setMonotonicNanos( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t Clocks::Reader::getMonotonicRawNanos() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t Clocks::Builder::getMonotonicRawNanos() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void Clocks::Builder::setMonotonicRawNanos( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t Clocks::Reader::getWallTimeNanos() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t Clocks::Builder::getWallTimeNanos() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void Clocks::Builder::setWallTimeNanos( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t Clocks::Reader::getModemUptimeMillis() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t Clocks::Builder::getModemUptimeMillis() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void Clocks::Builder::setModemUptimeMillis( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveMpcData::Reader::hasX() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveMpcData::Builder::hasX() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveMpcData::Reader::getX() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveMpcData::Builder::getX() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LiveMpcData::Builder::setX( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void LiveMpcData::Builder::setX(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveMpcData::Builder::initX(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void LiveMpcData::Builder::adoptX( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveMpcData::Builder::disownX() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool LiveMpcData::Reader::hasY() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveMpcData::Builder::hasY() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveMpcData::Reader::getY() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveMpcData::Builder::getY() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void LiveMpcData::Builder::setY( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void LiveMpcData::Builder::setY(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveMpcData::Builder::initY(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void LiveMpcData::Builder::adoptY( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveMpcData::Builder::disownY() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool LiveMpcData::Reader::hasPsi() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveMpcData::Builder::hasPsi() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveMpcData::Reader::getPsi() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveMpcData::Builder::getPsi() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void LiveMpcData::Builder::setPsi( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void LiveMpcData::Builder::setPsi(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveMpcData::Builder::initPsi(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void LiveMpcData::Builder::adoptPsi( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveMpcData::Builder::disownPsi() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool LiveMpcData::Reader::hasCurvature() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveMpcData::Builder::hasCurvature() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveMpcData::Reader::getCurvature() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveMpcData::Builder::getCurvature() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void LiveMpcData::Builder::setCurvature( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void LiveMpcData::Builder::setCurvature(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveMpcData::Builder::initCurvature(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void LiveMpcData::Builder::adoptCurvature( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveMpcData::Builder::disownCurvature() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline ::uint32_t LiveMpcData::Reader::getQpIterations() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t LiveMpcData::Builder::getQpIterations() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LiveMpcData::Builder::setQpIterations( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t LiveMpcData::Reader::getCalculationTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t LiveMpcData::Builder::getCalculationTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveMpcData::Builder::setCalculationTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline double LiveMpcData::Reader::getCost() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline double LiveMpcData::Builder::getCost() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LiveMpcData::Builder::setCost(double value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveLongitudinalMpcData::Reader::hasXEgo() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLongitudinalMpcData::Builder::hasXEgo() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLongitudinalMpcData::Reader::getXEgo() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLongitudinalMpcData::Builder::getXEgo() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LiveLongitudinalMpcData::Builder::setXEgo( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void LiveLongitudinalMpcData::Builder::setXEgo(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLongitudinalMpcData::Builder::initXEgo(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void LiveLongitudinalMpcData::Builder::adoptXEgo( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLongitudinalMpcData::Builder::disownXEgo() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool LiveLongitudinalMpcData::Reader::hasVEgo() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLongitudinalMpcData::Builder::hasVEgo() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLongitudinalMpcData::Reader::getVEgo() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLongitudinalMpcData::Builder::getVEgo() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void LiveLongitudinalMpcData::Builder::setVEgo( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void LiveLongitudinalMpcData::Builder::setVEgo(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLongitudinalMpcData::Builder::initVEgo(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void LiveLongitudinalMpcData::Builder::adoptVEgo( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLongitudinalMpcData::Builder::disownVEgo() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool LiveLongitudinalMpcData::Reader::hasAEgo() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLongitudinalMpcData::Builder::hasAEgo() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLongitudinalMpcData::Reader::getAEgo() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLongitudinalMpcData::Builder::getAEgo() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void LiveLongitudinalMpcData::Builder::setAEgo( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void LiveLongitudinalMpcData::Builder::setAEgo(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLongitudinalMpcData::Builder::initAEgo(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void LiveLongitudinalMpcData::Builder::adoptAEgo( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLongitudinalMpcData::Builder::disownAEgo() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool LiveLongitudinalMpcData::Reader::hasXLead() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLongitudinalMpcData::Builder::hasXLead() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLongitudinalMpcData::Reader::getXLead() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLongitudinalMpcData::Builder::getXLead() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void LiveLongitudinalMpcData::Builder::setXLead( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void LiveLongitudinalMpcData::Builder::setXLead(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLongitudinalMpcData::Builder::initXLead(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void LiveLongitudinalMpcData::Builder::adoptXLead( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLongitudinalMpcData::Builder::disownXLead() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool LiveLongitudinalMpcData::Reader::hasVLead() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLongitudinalMpcData::Builder::hasVLead() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLongitudinalMpcData::Reader::getVLead() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLongitudinalMpcData::Builder::getVLead() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void LiveLongitudinalMpcData::Builder::setVLead( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void LiveLongitudinalMpcData::Builder::setVLead(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLongitudinalMpcData::Builder::initVLead(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void LiveLongitudinalMpcData::Builder::adoptVLead( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLongitudinalMpcData::Builder::disownVLead() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool LiveLongitudinalMpcData::Reader::hasALead() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveLongitudinalMpcData::Builder::hasALead() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveLongitudinalMpcData::Reader::getALead() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveLongitudinalMpcData::Builder::getALead() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void LiveLongitudinalMpcData::Builder::setALead( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline void LiveLongitudinalMpcData::Builder::setALead(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveLongitudinalMpcData::Builder::initALead(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void LiveLongitudinalMpcData::Builder::adoptALead( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveLongitudinalMpcData::Builder::disownALead() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline float LiveLongitudinalMpcData::Reader::getALeadTau() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float LiveLongitudinalMpcData::Builder::getALeadTau() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LiveLongitudinalMpcData::Builder::setALeadTau(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t LiveLongitudinalMpcData::Reader::getQpIterations() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t LiveLongitudinalMpcData::Builder::getQpIterations() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveLongitudinalMpcData::Builder::setQpIterations( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t LiveLongitudinalMpcData::Reader::getMpcId() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t LiveLongitudinalMpcData::Builder::getMpcId() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LiveLongitudinalMpcData::Builder::setMpcId( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t LiveLongitudinalMpcData::Reader::getCalculationTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t LiveLongitudinalMpcData::Builder::getCalculationTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LiveLongitudinalMpcData::Builder::setCalculationTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline double LiveLongitudinalMpcData::Reader::getCost() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline double LiveLongitudinalMpcData::Builder::getCost() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void LiveLongitudinalMpcData::Builder::setCost(double value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool Joystick::Reader::hasAxes() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Joystick::Builder::hasAxes() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader Joystick::Reader::getAxes() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder Joystick::Builder::getAxes() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Joystick::Builder::setAxes( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void Joystick::Builder::setAxes(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder Joystick::Builder::initAxes(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Joystick::Builder::adoptAxes( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> Joystick::Builder::disownAxes() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Joystick::Reader::hasButtons() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool Joystick::Builder::hasButtons() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader Joystick::Reader::getButtons() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder Joystick::Builder::getButtons() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void Joystick::Builder::setButtons( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void Joystick::Builder::setButtons(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder Joystick::Builder::initButtons(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void Joystick::Builder::adoptButtons( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> Joystick::Builder::disownButtons() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline ::uint32_t DriverState::Reader::getFrameId() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t DriverState::Builder::getFrameId() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setFrameId( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool DriverState::Reader::hasDescriptorDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool DriverState::Builder::hasDescriptorDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader DriverState::Reader::getDescriptorDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder DriverState::Builder::getDescriptorDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void DriverState::Builder::setDescriptorDEPRECATED( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void DriverState::Builder::setDescriptorDEPRECATED(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder DriverState::Builder::initDescriptorDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void DriverState::Builder::adoptDescriptorDEPRECATED( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> DriverState::Builder::disownDescriptorDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline float DriverState::Reader::getStdDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getStdDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setStdDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool DriverState::Reader::hasFaceOrientation() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool DriverState::Builder::hasFaceOrientation() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader DriverState::Reader::getFaceOrientation() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder DriverState::Builder::getFaceOrientation() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void DriverState::Builder::setFaceOrientation( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void DriverState::Builder::setFaceOrientation(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder DriverState::Builder::initFaceOrientation(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void DriverState::Builder::adoptFaceOrientation( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> DriverState::Builder::disownFaceOrientation() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool DriverState::Reader::hasFacePosition() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool DriverState::Builder::hasFacePosition() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader DriverState::Reader::getFacePosition() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder DriverState::Builder::getFacePosition() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void DriverState::Builder::setFacePosition( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void DriverState::Builder::setFacePosition(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder DriverState::Builder::initFacePosition(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void DriverState::Builder::adoptFacePosition( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> DriverState::Builder::disownFacePosition() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline float DriverState::Reader::getFaceProb() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getFaceProb() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setFaceProb(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float DriverState::Reader::getLeftEyeProb() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getLeftEyeProb() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setLeftEyeProb(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float DriverState::Reader::getRightEyeProb() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getRightEyeProb() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setRightEyeProb(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float DriverState::Reader::getLeftBlinkProb() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getLeftBlinkProb() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setLeftBlinkProb(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float DriverState::Reader::getRightBlinkProb() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getRightBlinkProb() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setRightBlinkProb(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float DriverState::Reader::getIrPwrDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getIrPwrDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setIrPwrDEPRECATED(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline bool DriverState::Reader::hasFaceOrientationStd() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool DriverState::Builder::hasFaceOrientationStd() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader DriverState::Reader::getFaceOrientationStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder DriverState::Builder::getFaceOrientationStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void DriverState::Builder::setFaceOrientationStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void DriverState::Builder::setFaceOrientationStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder DriverState::Builder::initFaceOrientationStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void DriverState::Builder::adoptFaceOrientationStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> DriverState::Builder::disownFaceOrientationStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool DriverState::Reader::hasFacePositionStd() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool DriverState::Builder::hasFacePositionStd() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader DriverState::Reader::getFacePositionStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder DriverState::Builder::getFacePositionStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void DriverState::Builder::setFacePositionStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void DriverState::Builder::setFacePositionStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder DriverState::Builder::initFacePositionStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void DriverState::Builder::adoptFacePositionStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> DriverState::Builder::disownFacePositionStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline float DriverState::Reader::getSunglassesProb() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getSunglassesProb() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setSunglassesProb(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float DriverState::Reader::getModelExecutionTime() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getModelExecutionTime() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setModelExecutionTime(float value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline bool DriverState::Reader::hasRawPredictions() const { + return !_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline bool DriverState::Builder::hasRawPredictions() { + return !_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader DriverState::Reader::getRawPredictions() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder DriverState::Builder::getRawPredictions() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} +inline void DriverState::Builder::setRawPredictions( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder DriverState::Builder::initRawPredictions(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), size); +} +inline void DriverState::Builder::adoptRawPredictions( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> DriverState::Builder::disownRawPredictions() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<5>() * ::capnp::POINTERS)); +} + +inline float DriverState::Reader::getDspExecutionTime() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getDspExecutionTime() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setDspExecutionTime(float value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline float DriverState::Reader::getPoorVision() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getPoorVision() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setPoorVision(float value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline float DriverState::Reader::getPartialFace() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getPartialFace() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setPartialFace(float value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline float DriverState::Reader::getDistractedPose() const { + return _reader.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getDistractedPose() { + return _builder.getDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setDistractedPose(float value) { + _builder.setDataField( + ::capnp::bounded<13>() * ::capnp::ELEMENTS, value); +} + +inline float DriverState::Reader::getDistractedEyes() const { + return _reader.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getDistractedEyes() { + return _builder.getDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setDistractedEyes(float value) { + _builder.setDataField( + ::capnp::bounded<14>() * ::capnp::ELEMENTS, value); +} + +inline float DriverState::Reader::getEyesOnRoad() const { + return _reader.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getEyesOnRoad() { + return _builder.getDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setEyesOnRoad(float value) { + _builder.setDataField( + ::capnp::bounded<15>() * ::capnp::ELEMENTS, value); +} + +inline float DriverState::Reader::getPhoneUse() const { + return _reader.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getPhoneUse() { + return _builder.getDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setPhoneUse(float value) { + _builder.setDataField( + ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); +} + +inline float DriverState::Reader::getOccludedProb() const { + return _reader.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} + +inline float DriverState::Builder::getOccludedProb() { + return _builder.getDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS); +} +inline void DriverState::Builder::setOccludedProb(float value) { + _builder.setDataField( + ::capnp::bounded<17>() * ::capnp::ELEMENTS, value); +} + +inline bool DriverMonitoringState::Reader::hasEvents() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool DriverMonitoringState::Builder::hasEvents() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader DriverMonitoringState::Reader::getEvents() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder DriverMonitoringState::Builder::getEvents() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void DriverMonitoringState::Builder::setEvents( ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder DriverMonitoringState::Builder::initEvents(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void DriverMonitoringState::Builder::adoptEvents( + ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>> DriverMonitoringState::Builder::disownEvents() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool DriverMonitoringState::Reader::getFaceDetected() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool DriverMonitoringState::Builder::getFaceDetected() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setFaceDetected(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool DriverMonitoringState::Reader::getIsDistracted() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool DriverMonitoringState::Builder::getIsDistracted() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setIsDistracted(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float DriverMonitoringState::Reader::getAwarenessStatus() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float DriverMonitoringState::Builder::getAwarenessStatus() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setAwarenessStatus(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool DriverMonitoringState::Reader::getIsRHDDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline bool DriverMonitoringState::Builder::getIsRHDDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setIsRHDDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool DriverMonitoringState::Reader::getRhdCheckedDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline bool DriverMonitoringState::Builder::getRhdCheckedDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setRhdCheckedDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float DriverMonitoringState::Reader::getPosePitchOffset() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float DriverMonitoringState::Builder::getPosePitchOffset() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setPosePitchOffset(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t DriverMonitoringState::Reader::getPosePitchValidCount() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t DriverMonitoringState::Builder::getPosePitchValidCount() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setPosePitchValidCount( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float DriverMonitoringState::Reader::getPoseYawOffset() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float DriverMonitoringState::Builder::getPoseYawOffset() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setPoseYawOffset(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t DriverMonitoringState::Reader::getPoseYawValidCount() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t DriverMonitoringState::Builder::getPoseYawValidCount() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setPoseYawValidCount( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline float DriverMonitoringState::Reader::getStepChange() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float DriverMonitoringState::Builder::getStepChange() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setStepChange(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float DriverMonitoringState::Reader::getAwarenessActive() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float DriverMonitoringState::Builder::getAwarenessActive() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setAwarenessActive(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float DriverMonitoringState::Reader::getAwarenessPassive() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float DriverMonitoringState::Builder::getAwarenessPassive() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setAwarenessPassive(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline bool DriverMonitoringState::Reader::getIsLowStd() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline bool DriverMonitoringState::Builder::getIsLowStd() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setIsLowStd(bool value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t DriverMonitoringState::Reader::getHiStdCount() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t DriverMonitoringState::Builder::getHiStdCount() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setHiStdCount( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline bool DriverMonitoringState::Reader::getIsPreviewDEPRECATED() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline bool DriverMonitoringState::Builder::getIsPreviewDEPRECATED() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setIsPreviewDEPRECATED(bool value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool DriverMonitoringState::Reader::getIsActiveMode() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline bool DriverMonitoringState::Builder::getIsActiveMode() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void DriverMonitoringState::Builder::setIsActiveMode(bool value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t Boot::Reader::getWallTimeNanos() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t Boot::Builder::getWallTimeNanos() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void Boot::Builder::setWallTimeNanos( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool Boot::Reader::hasLastKmsgDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Boot::Builder::hasLastKmsgDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader Boot::Reader::getLastKmsgDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder Boot::Builder::getLastKmsgDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Boot::Builder::setLastKmsgDEPRECATED( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder Boot::Builder::initLastKmsgDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Boot::Builder::adoptLastKmsgDEPRECATED( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> Boot::Builder::disownLastKmsgDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Boot::Reader::hasLastPmsgDEPRECATED() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool Boot::Builder::hasLastPmsgDEPRECATED() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader Boot::Reader::getLastPmsgDEPRECATED() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder Boot::Builder::getLastPmsgDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void Boot::Builder::setLastPmsgDEPRECATED( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder Boot::Builder::initLastPmsgDEPRECATED(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void Boot::Builder::adoptLastPmsgDEPRECATED( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> Boot::Builder::disownLastPmsgDEPRECATED() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool Boot::Reader::hasLaunchLog() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool Boot::Builder::hasLaunchLog() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader Boot::Reader::getLaunchLog() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder Boot::Builder::getLaunchLog() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void Boot::Builder::setLaunchLog( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder Boot::Builder::initLaunchLog(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void Boot::Builder::adoptLaunchLog( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> Boot::Builder::disownLaunchLog() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool Boot::Reader::hasPstore() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool Boot::Builder::hasPstore() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Reader Boot::Reader::getPstore() const { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Builder Boot::Builder::getPstore() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Pipeline Boot::Pipeline::getPstore() { + return ::cereal::Map< ::capnp::Text, ::capnp::Data>::Pipeline(_typeless.getPointerField(3)); +} +#endif // !CAPNP_LITE +inline void Boot::Builder::setPstore( ::cereal::Map< ::capnp::Text, ::capnp::Data>::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Builder Boot::Builder::initPstore() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void Boot::Builder::adoptPstore( + ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Data>>&& value) { + ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Data>> Boot::Builder::disownPstore() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool Boot::Reader::hasCommands() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool Boot::Builder::hasCommands() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Reader Boot::Reader::getCommands() const { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Builder Boot::Builder::getCommands() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Pipeline Boot::Pipeline::getCommands() { + return ::cereal::Map< ::capnp::Text, ::capnp::Data>::Pipeline(_typeless.getPointerField(4)); +} +#endif // !CAPNP_LITE +inline void Boot::Builder::setCommands( ::cereal::Map< ::capnp::Text, ::capnp::Data>::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::cereal::Map< ::capnp::Text, ::capnp::Data>::Builder Boot::Builder::initCommands() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void Boot::Builder::adoptCommands( + ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Data>>&& value) { + ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::Map< ::capnp::Text, ::capnp::Data>> Boot::Builder::disownCommands() { + return ::capnp::_::PointerHelpers< ::cereal::Map< ::capnp::Text, ::capnp::Data>>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool LiveParametersData::Reader::getValid() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool LiveParametersData::Builder::getValid() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setValid(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float LiveParametersData::Reader::getGyroBias() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float LiveParametersData::Builder::getGyroBias() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setGyroBias(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float LiveParametersData::Reader::getAngleOffsetDeg() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float LiveParametersData::Builder::getAngleOffsetDeg() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setAngleOffsetDeg(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float LiveParametersData::Reader::getAngleOffsetAverageDeg() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float LiveParametersData::Builder::getAngleOffsetAverageDeg() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setAngleOffsetAverageDeg(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float LiveParametersData::Reader::getStiffnessFactor() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float LiveParametersData::Builder::getStiffnessFactor() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setStiffnessFactor(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float LiveParametersData::Reader::getSteerRatio() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float LiveParametersData::Builder::getSteerRatio() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setSteerRatio(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveParametersData::Reader::getSensorValid() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool LiveParametersData::Builder::getSensorValid() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setSensorValid(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float LiveParametersData::Reader::getYawRate() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float LiveParametersData::Builder::getYawRate() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setYawRate(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline float LiveParametersData::Reader::getPosenetSpeed() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float LiveParametersData::Builder::getPosenetSpeed() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setPosenetSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveParametersData::Reader::getPosenetValid() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline bool LiveParametersData::Builder::getPosenetValid() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setPosenetValid(bool value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float LiveParametersData::Reader::getAngleOffsetFastStd() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float LiveParametersData::Builder::getAngleOffsetFastStd() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setAngleOffsetFastStd(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline float LiveParametersData::Reader::getAngleOffsetAverageStd() const { + return _reader.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} + +inline float LiveParametersData::Builder::getAngleOffsetAverageStd() { + return _builder.getDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setAngleOffsetAverageStd(float value) { + _builder.setDataField( + ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); +} + +inline float LiveParametersData::Reader::getStiffnessFactorStd() const { + return _reader.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} + +inline float LiveParametersData::Builder::getStiffnessFactorStd() { + return _builder.getDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setStiffnessFactorStd(float value) { + _builder.setDataField( + ::capnp::bounded<10>() * ::capnp::ELEMENTS, value); +} + +inline float LiveParametersData::Reader::getSteerRatioStd() const { + return _reader.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} + +inline float LiveParametersData::Builder::getSteerRatioStd() { + return _builder.getDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setSteerRatioStd(float value) { + _builder.setDataField( + ::capnp::bounded<11>() * ::capnp::ELEMENTS, value); +} + +inline float LiveParametersData::Reader::getRoll() const { + return _reader.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} + +inline float LiveParametersData::Builder::getRoll() { + return _builder.getDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS); +} +inline void LiveParametersData::Builder::setRoll(float value) { + _builder.setDataField( + ::capnp::bounded<12>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveMapDataDEPRECATED::Reader::getSpeedLimitValid() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool LiveMapDataDEPRECATED::Builder::getSpeedLimitValid() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void LiveMapDataDEPRECATED::Builder::setSpeedLimitValid(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float LiveMapDataDEPRECATED::Reader::getSpeedLimit() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float LiveMapDataDEPRECATED::Builder::getSpeedLimit() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveMapDataDEPRECATED::Builder::setSpeedLimit(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveMapDataDEPRECATED::Reader::getCurvatureValid() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline bool LiveMapDataDEPRECATED::Builder::getCurvatureValid() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void LiveMapDataDEPRECATED::Builder::setCurvatureValid(bool value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float LiveMapDataDEPRECATED::Reader::getCurvature() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float LiveMapDataDEPRECATED::Builder::getCurvature() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LiveMapDataDEPRECATED::Builder::setCurvature(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t LiveMapDataDEPRECATED::Reader::getWayId() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t LiveMapDataDEPRECATED::Builder::getWayId() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LiveMapDataDEPRECATED::Builder::setWayId( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveMapDataDEPRECATED::Reader::hasRoadX() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveMapDataDEPRECATED::Builder::hasRoadX() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveMapDataDEPRECATED::Reader::getRoadX() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveMapDataDEPRECATED::Builder::getRoadX() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void LiveMapDataDEPRECATED::Builder::setRoadX( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void LiveMapDataDEPRECATED::Builder::setRoadX(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveMapDataDEPRECATED::Builder::initRoadX(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void LiveMapDataDEPRECATED::Builder::adoptRoadX( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveMapDataDEPRECATED::Builder::disownRoadX() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool LiveMapDataDEPRECATED::Reader::hasRoadY() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveMapDataDEPRECATED::Builder::hasRoadY() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveMapDataDEPRECATED::Reader::getRoadY() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveMapDataDEPRECATED::Builder::getRoadY() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void LiveMapDataDEPRECATED::Builder::setRoadY( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void LiveMapDataDEPRECATED::Builder::setRoadY(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveMapDataDEPRECATED::Builder::initRoadY(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void LiveMapDataDEPRECATED::Builder::adoptRoadY( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveMapDataDEPRECATED::Builder::disownRoadY() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool LiveMapDataDEPRECATED::Reader::hasLastGps() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveMapDataDEPRECATED::Builder::hasLastGps() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::GpsLocationData::Reader LiveMapDataDEPRECATED::Reader::getLastGps() const { + return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::cereal::GpsLocationData::Builder LiveMapDataDEPRECATED::Builder::getLastGps() { + return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::GpsLocationData::Pipeline LiveMapDataDEPRECATED::Pipeline::getLastGps() { + return ::cereal::GpsLocationData::Pipeline(_typeless.getPointerField(2)); +} +#endif // !CAPNP_LITE +inline void LiveMapDataDEPRECATED::Builder::setLastGps( ::cereal::GpsLocationData::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::cereal::GpsLocationData::Builder LiveMapDataDEPRECATED::Builder::initLastGps() { + return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void LiveMapDataDEPRECATED::Builder::adoptLastGps( + ::capnp::Orphan< ::cereal::GpsLocationData>&& value) { + ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::GpsLocationData> LiveMapDataDEPRECATED::Builder::disownLastGps() { + return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool LiveMapDataDEPRECATED::Reader::hasRoadCurvatureX() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveMapDataDEPRECATED::Builder::hasRoadCurvatureX() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveMapDataDEPRECATED::Reader::getRoadCurvatureX() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveMapDataDEPRECATED::Builder::getRoadCurvatureX() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void LiveMapDataDEPRECATED::Builder::setRoadCurvatureX( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void LiveMapDataDEPRECATED::Builder::setRoadCurvatureX(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveMapDataDEPRECATED::Builder::initRoadCurvatureX(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void LiveMapDataDEPRECATED::Builder::adoptRoadCurvatureX( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveMapDataDEPRECATED::Builder::disownRoadCurvatureX() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline bool LiveMapDataDEPRECATED::Reader::hasRoadCurvature() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool LiveMapDataDEPRECATED::Builder::hasRoadCurvature() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader LiveMapDataDEPRECATED::Reader::getRoadCurvature() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder LiveMapDataDEPRECATED::Builder::getRoadCurvature() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void LiveMapDataDEPRECATED::Builder::setRoadCurvature( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline void LiveMapDataDEPRECATED::Builder::setRoadCurvature(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder LiveMapDataDEPRECATED::Builder::initRoadCurvature(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void LiveMapDataDEPRECATED::Builder::adoptRoadCurvature( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> LiveMapDataDEPRECATED::Builder::disownRoadCurvature() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline float LiveMapDataDEPRECATED::Reader::getDistToTurn() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float LiveMapDataDEPRECATED::Builder::getDistToTurn() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void LiveMapDataDEPRECATED::Builder::setDistToTurn(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveMapDataDEPRECATED::Reader::getMapValid() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline bool LiveMapDataDEPRECATED::Builder::getMapValid() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void LiveMapDataDEPRECATED::Builder::setMapValid(bool value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveMapDataDEPRECATED::Reader::getSpeedAdvisoryValid() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline bool LiveMapDataDEPRECATED::Builder::getSpeedAdvisoryValid() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void LiveMapDataDEPRECATED::Builder::setSpeedAdvisoryValid(bool value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float LiveMapDataDEPRECATED::Reader::getSpeedAdvisory() const { + return _reader.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} + +inline float LiveMapDataDEPRECATED::Builder::getSpeedAdvisory() { + return _builder.getDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS); +} +inline void LiveMapDataDEPRECATED::Builder::setSpeedAdvisory(float value) { + _builder.setDataField( + ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); +} + +inline bool LiveMapDataDEPRECATED::Reader::getSpeedLimitAheadValid() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline bool LiveMapDataDEPRECATED::Builder::getSpeedLimitAheadValid() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void LiveMapDataDEPRECATED::Builder::setSpeedLimitAheadValid(bool value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float LiveMapDataDEPRECATED::Reader::getSpeedLimitAhead() const { + return _reader.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} + +inline float LiveMapDataDEPRECATED::Builder::getSpeedLimitAhead() { + return _builder.getDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS); +} +inline void LiveMapDataDEPRECATED::Builder::setSpeedLimitAhead(float value) { + _builder.setDataField( + ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); +} + +inline float LiveMapDataDEPRECATED::Reader::getSpeedLimitAheadDistance() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float LiveMapDataDEPRECATED::Builder::getSpeedLimitAheadDistance() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void LiveMapDataDEPRECATED::Builder::setSpeedLimitAheadDistance(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline bool CameraOdometry::Reader::hasTrans() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool CameraOdometry::Builder::hasTrans() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CameraOdometry::Reader::getTrans() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CameraOdometry::Builder::getTrans() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void CameraOdometry::Builder::setTrans( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void CameraOdometry::Builder::setTrans(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CameraOdometry::Builder::initTrans(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void CameraOdometry::Builder::adoptTrans( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CameraOdometry::Builder::disownTrans() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool CameraOdometry::Reader::hasRot() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool CameraOdometry::Builder::hasRot() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CameraOdometry::Reader::getRot() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CameraOdometry::Builder::getRot() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void CameraOdometry::Builder::setRot( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline void CameraOdometry::Builder::setRot(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CameraOdometry::Builder::initRot(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void CameraOdometry::Builder::adoptRot( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CameraOdometry::Builder::disownRot() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool CameraOdometry::Reader::hasTransStd() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool CameraOdometry::Builder::hasTransStd() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CameraOdometry::Reader::getTransStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CameraOdometry::Builder::getTransStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void CameraOdometry::Builder::setTransStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline void CameraOdometry::Builder::setTransStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CameraOdometry::Builder::initTransStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void CameraOdometry::Builder::adoptTransStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CameraOdometry::Builder::disownTransStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool CameraOdometry::Reader::hasRotStd() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool CameraOdometry::Builder::hasRotStd() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List::Reader CameraOdometry::Reader::getRotStd() const { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::List::Builder CameraOdometry::Builder::getRotStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void CameraOdometry::Builder::setRotStd( ::capnp::List::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline void CameraOdometry::Builder::setRotStd(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::List::Builder CameraOdometry::Builder::initRotStd(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void CameraOdometry::Builder::adoptRotStd( + ::capnp::Orphan< ::capnp::List>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List> CameraOdometry::Builder::disownRotStd() { + return ::capnp::_::PointerHelpers< ::capnp::List>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline ::uint32_t CameraOdometry::Reader::getFrameId() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t CameraOdometry::Builder::getFrameId() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void CameraOdometry::Builder::setFrameId( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t CameraOdometry::Reader::getTimestampEof() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t CameraOdometry::Builder::getTimestampEof() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void CameraOdometry::Builder::setTimestampEof( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::Sentinel::SentinelType Sentinel::Reader::getType() const { + return _reader.getDataField< ::cereal::Sentinel::SentinelType>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::cereal::Sentinel::SentinelType Sentinel::Builder::getType() { + return _builder.getDataField< ::cereal::Sentinel::SentinelType>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void Sentinel::Builder::setType( ::cereal::Sentinel::SentinelType value) { + _builder.setDataField< ::cereal::Sentinel::SentinelType>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t Sentinel::Reader::getSignal() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::int32_t Sentinel::Builder::getSignal() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void Sentinel::Builder::setSignal( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool ManagerState::Reader::hasProcesses() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ManagerState::Builder::hasProcesses() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>::Reader ManagerState::Reader::getProcesses() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>::Builder ManagerState::Builder::getProcesses() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ManagerState::Builder::setProcesses( ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>::Builder ManagerState::Builder::initProcesses(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void ManagerState::Builder::adoptProcesses( + ::capnp::Orphan< ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>> ManagerState::Builder::disownProcesses() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::ManagerState::ProcessState, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool ManagerState::ProcessState::Reader::hasName() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool ManagerState::ProcessState::Builder::hasName() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader ManagerState::ProcessState::Reader::getName() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder ManagerState::ProcessState::Builder::getName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void ManagerState::ProcessState::Builder::setName( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder ManagerState::ProcessState::Builder::initName(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void ManagerState::ProcessState::Builder::adoptName( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> ManagerState::ProcessState::Builder::disownName() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline ::int32_t ManagerState::ProcessState::Reader::getPid() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t ManagerState::ProcessState::Builder::getPid() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ManagerState::ProcessState::Builder::setPid( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool ManagerState::ProcessState::Reader::getRunning() const { + return _reader.getDataField( + ::capnp::bounded<32>() * ::capnp::ELEMENTS); +} + +inline bool ManagerState::ProcessState::Builder::getRunning() { + return _builder.getDataField( + ::capnp::bounded<32>() * ::capnp::ELEMENTS); +} +inline void ManagerState::ProcessState::Builder::setRunning(bool value) { + _builder.setDataField( + ::capnp::bounded<32>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t ManagerState::ProcessState::Reader::getExitCode() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int32_t ManagerState::ProcessState::Builder::getExitCode() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void ManagerState::ProcessState::Builder::setExitCode( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline bool ManagerState::ProcessState::Reader::getShouldBeRunning() const { + return _reader.getDataField( + ::capnp::bounded<33>() * ::capnp::ELEMENTS); +} + +inline bool ManagerState::ProcessState::Builder::getShouldBeRunning() { + return _builder.getDataField( + ::capnp::bounded<33>() * ::capnp::ELEMENTS); +} +inline void ManagerState::ProcessState::Builder::setShouldBeRunning(bool value) { + _builder.setDataField( + ::capnp::bounded<33>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t UploaderState::Reader::getImmediateQueueSize() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t UploaderState::Builder::getImmediateQueueSize() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void UploaderState::Builder::setImmediateQueueSize( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t UploaderState::Reader::getImmediateQueueCount() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t UploaderState::Builder::getImmediateQueueCount() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void UploaderState::Builder::setImmediateQueueCount( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t UploaderState::Reader::getRawQueueSize() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t UploaderState::Builder::getRawQueueSize() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void UploaderState::Builder::setRawQueueSize( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t UploaderState::Reader::getRawQueueCount() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t UploaderState::Builder::getRawQueueCount() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void UploaderState::Builder::setRawQueueCount( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float UploaderState::Reader::getLastTime() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline float UploaderState::Builder::getLastTime() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline void UploaderState::Builder::setLastTime(float value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); +} + +inline float UploaderState::Reader::getLastSpeed() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline float UploaderState::Builder::getLastSpeed() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void UploaderState::Builder::setLastSpeed(float value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool UploaderState::Reader::hasLastFilename() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool UploaderState::Builder::hasLastFilename() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader UploaderState::Reader::getLastFilename() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder UploaderState::Builder::getLastFilename() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void UploaderState::Builder::setLastFilename( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder UploaderState::Builder::initLastFilename(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void UploaderState::Builder::adoptLastFilename( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> UploaderState::Builder::disownLastFilename() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool NavInstruction::Reader::hasManeuverPrimaryText() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool NavInstruction::Builder::hasManeuverPrimaryText() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader NavInstruction::Reader::getManeuverPrimaryText() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder NavInstruction::Builder::getManeuverPrimaryText() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void NavInstruction::Builder::setManeuverPrimaryText( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder NavInstruction::Builder::initManeuverPrimaryText(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void NavInstruction::Builder::adoptManeuverPrimaryText( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> NavInstruction::Builder::disownManeuverPrimaryText() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool NavInstruction::Reader::hasManeuverSecondaryText() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool NavInstruction::Builder::hasManeuverSecondaryText() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader NavInstruction::Reader::getManeuverSecondaryText() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder NavInstruction::Builder::getManeuverSecondaryText() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void NavInstruction::Builder::setManeuverSecondaryText( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder NavInstruction::Builder::initManeuverSecondaryText(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void NavInstruction::Builder::adoptManeuverSecondaryText( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> NavInstruction::Builder::disownManeuverSecondaryText() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline float NavInstruction::Reader::getManeuverDistance() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float NavInstruction::Builder::getManeuverDistance() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void NavInstruction::Builder::setManeuverDistance(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool NavInstruction::Reader::hasManeuverType() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool NavInstruction::Builder::hasManeuverType() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader NavInstruction::Reader::getManeuverType() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder NavInstruction::Builder::getManeuverType() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline void NavInstruction::Builder::setManeuverType( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder NavInstruction::Builder::initManeuverType(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), size); +} +inline void NavInstruction::Builder::adoptManeuverType( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> NavInstruction::Builder::disownManeuverType() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} + +inline bool NavInstruction::Reader::hasManeuverModifier() const { + return !_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline bool NavInstruction::Builder::hasManeuverModifier() { + return !_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader NavInstruction::Reader::getManeuverModifier() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder NavInstruction::Builder::getManeuverModifier() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} +inline void NavInstruction::Builder::setManeuverModifier( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder NavInstruction::Builder::initManeuverModifier(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), size); +} +inline void NavInstruction::Builder::adoptManeuverModifier( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> NavInstruction::Builder::disownManeuverModifier() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<3>() * ::capnp::POINTERS)); +} + +inline float NavInstruction::Reader::getDistanceRemaining() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float NavInstruction::Builder::getDistanceRemaining() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void NavInstruction::Builder::setDistanceRemaining(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline float NavInstruction::Reader::getTimeRemaining() const { + return _reader.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline float NavInstruction::Builder::getTimeRemaining() { + return _builder.getDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void NavInstruction::Builder::setTimeRemaining(float value) { + _builder.setDataField( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline float NavInstruction::Reader::getTimeRemainingTypical() const { + return _reader.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline float NavInstruction::Builder::getTimeRemainingTypical() { + return _builder.getDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void NavInstruction::Builder::setTimeRemainingTypical(float value) { + _builder.setDataField( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline bool NavInstruction::Reader::hasLanes() const { + return !_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline bool NavInstruction::Builder::hasLanes() { + return !_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>::Reader NavInstruction::Reader::getLanes() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>::Builder NavInstruction::Builder::getLanes() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} +inline void NavInstruction::Builder::setLanes( ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>::Builder NavInstruction::Builder::initLanes(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), size); +} +inline void NavInstruction::Builder::adoptLanes( + ::capnp::Orphan< ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>> NavInstruction::Builder::disownLanes() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavInstruction::Lane, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<4>() * ::capnp::POINTERS)); +} + +inline bool NavInstruction::Reader::getShowFull() const { + return _reader.getDataField( + ::capnp::bounded<128>() * ::capnp::ELEMENTS); +} + +inline bool NavInstruction::Builder::getShowFull() { + return _builder.getDataField( + ::capnp::bounded<128>() * ::capnp::ELEMENTS); +} +inline void NavInstruction::Builder::setShowFull(bool value) { + _builder.setDataField( + ::capnp::bounded<128>() * ::capnp::ELEMENTS, value); +} + +inline bool NavInstruction::Lane::Reader::hasDirections() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool NavInstruction::Lane::Builder::hasDirections() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>::Reader NavInstruction::Lane::Reader::getDirections() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>::Builder NavInstruction::Lane::Builder::getDirections() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void NavInstruction::Lane::Builder::setDirections( ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline void NavInstruction::Lane::Builder::setDirections(::kj::ArrayPtr value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>::Builder NavInstruction::Lane::Builder::initDirections(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void NavInstruction::Lane::Builder::adoptDirections( + ::capnp::Orphan< ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>> NavInstruction::Lane::Builder::disownDirections() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavInstruction::Direction, ::capnp::Kind::ENUM>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool NavInstruction::Lane::Reader::getActive() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool NavInstruction::Lane::Builder::getActive() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void NavInstruction::Lane::Builder::setActive(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::NavInstruction::Direction NavInstruction::Lane::Reader::getActiveDirection() const { + return _reader.getDataField< ::cereal::NavInstruction::Direction>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::cereal::NavInstruction::Direction NavInstruction::Lane::Builder::getActiveDirection() { + return _builder.getDataField< ::cereal::NavInstruction::Direction>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void NavInstruction::Lane::Builder::setActiveDirection( ::cereal::NavInstruction::Direction value) { + _builder.setDataField< ::cereal::NavInstruction::Direction>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline bool NavRoute::Reader::hasCoordinates() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool NavRoute::Builder::hasCoordinates() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>::Reader NavRoute::Reader::getCoordinates() const { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>::Builder NavRoute::Builder::getCoordinates() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void NavRoute::Builder::setCoordinates( ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>::Builder NavRoute::Builder::initCoordinates(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void NavRoute::Builder::adoptCoordinates( + ::capnp::Orphan< ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>>&& value) { + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>> NavRoute::Builder::disownCoordinates() { + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::NavRoute::Coordinate, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline float NavRoute::Coordinate::Reader::getLatitude() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline float NavRoute::Coordinate::Builder::getLatitude() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void NavRoute::Coordinate::Builder::setLatitude(float value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline float NavRoute::Coordinate::Reader::getLongitude() const { + return _reader.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline float NavRoute::Coordinate::Builder::getLongitude() { + return _builder.getDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void NavRoute::Coordinate::Builder::setLongitude(float value) { + _builder.setDataField( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::cereal::Event::Which Event::Reader::which() const { + return _reader.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} +inline ::cereal::Event::Which Event::Builder::which() { + return _builder.getDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t Event::Reader::getLogMonoTime() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t Event::Builder::getLogMonoTime() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void Event::Builder::setLogMonoTime( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool Event::Reader::isInitData() const { + return which() == Event::INIT_DATA; +} +inline bool Event::Builder::isInitData() { + return which() == Event::INIT_DATA; +} +inline bool Event::Reader::hasInitData() const { + if (which() != Event::INIT_DATA) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasInitData() { + if (which() != Event::INIT_DATA) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::InitData::Reader Event::Reader::getInitData() const { + KJ_IREQUIRE((which() == Event::INIT_DATA), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::InitData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::InitData::Builder Event::Builder::getInitData() { + KJ_IREQUIRE((which() == Event::INIT_DATA), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::InitData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setInitData( ::cereal::InitData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::INIT_DATA); + ::capnp::_::PointerHelpers< ::cereal::InitData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::InitData::Builder Event::Builder::initInitData() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::INIT_DATA); + return ::capnp::_::PointerHelpers< ::cereal::InitData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptInitData( + ::capnp::Orphan< ::cereal::InitData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::INIT_DATA); + ::capnp::_::PointerHelpers< ::cereal::InitData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::InitData> Event::Builder::disownInitData() { + KJ_IREQUIRE((which() == Event::INIT_DATA), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::InitData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isRoadCameraState() const { + return which() == Event::ROAD_CAMERA_STATE; +} +inline bool Event::Builder::isRoadCameraState() { + return which() == Event::ROAD_CAMERA_STATE; +} +inline bool Event::Reader::hasRoadCameraState() const { + if (which() != Event::ROAD_CAMERA_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasRoadCameraState() { + if (which() != Event::ROAD_CAMERA_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::FrameData::Reader Event::Reader::getRoadCameraState() const { + KJ_IREQUIRE((which() == Event::ROAD_CAMERA_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::FrameData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::FrameData::Builder Event::Builder::getRoadCameraState() { + KJ_IREQUIRE((which() == Event::ROAD_CAMERA_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::FrameData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setRoadCameraState( ::cereal::FrameData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ROAD_CAMERA_STATE); + ::capnp::_::PointerHelpers< ::cereal::FrameData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::FrameData::Builder Event::Builder::initRoadCameraState() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ROAD_CAMERA_STATE); + return ::capnp::_::PointerHelpers< ::cereal::FrameData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptRoadCameraState( + ::capnp::Orphan< ::cereal::FrameData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ROAD_CAMERA_STATE); + ::capnp::_::PointerHelpers< ::cereal::FrameData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::FrameData> Event::Builder::disownRoadCameraState() { + KJ_IREQUIRE((which() == Event::ROAD_CAMERA_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::FrameData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isGpsNMEA() const { + return which() == Event::GPS_N_M_E_A; +} +inline bool Event::Builder::isGpsNMEA() { + return which() == Event::GPS_N_M_E_A; +} +inline bool Event::Reader::hasGpsNMEA() const { + if (which() != Event::GPS_N_M_E_A) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasGpsNMEA() { + if (which() != Event::GPS_N_M_E_A) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::GPSNMEAData::Reader Event::Reader::getGpsNMEA() const { + KJ_IREQUIRE((which() == Event::GPS_N_M_E_A), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GPSNMEAData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::GPSNMEAData::Builder Event::Builder::getGpsNMEA() { + KJ_IREQUIRE((which() == Event::GPS_N_M_E_A), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GPSNMEAData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setGpsNMEA( ::cereal::GPSNMEAData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_N_M_E_A); + ::capnp::_::PointerHelpers< ::cereal::GPSNMEAData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::GPSNMEAData::Builder Event::Builder::initGpsNMEA() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_N_M_E_A); + return ::capnp::_::PointerHelpers< ::cereal::GPSNMEAData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptGpsNMEA( + ::capnp::Orphan< ::cereal::GPSNMEAData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_N_M_E_A); + ::capnp::_::PointerHelpers< ::cereal::GPSNMEAData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::GPSNMEAData> Event::Builder::disownGpsNMEA() { + KJ_IREQUIRE((which() == Event::GPS_N_M_E_A), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GPSNMEAData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isSensorEventDEPRECATED() const { + return which() == Event::SENSOR_EVENT_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isSensorEventDEPRECATED() { + return which() == Event::SENSOR_EVENT_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasSensorEventDEPRECATED() const { + if (which() != Event::SENSOR_EVENT_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasSensorEventDEPRECATED() { + if (which() != Event::SENSOR_EVENT_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::SensorEventData::Reader Event::Reader::getSensorEventDEPRECATED() const { + KJ_IREQUIRE((which() == Event::SENSOR_EVENT_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::SensorEventData::Builder Event::Builder::getSensorEventDEPRECATED() { + KJ_IREQUIRE((which() == Event::SENSOR_EVENT_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setSensorEventDEPRECATED( ::cereal::SensorEventData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::SENSOR_EVENT_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::SensorEventData::Builder Event::Builder::initSensorEventDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::SENSOR_EVENT_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptSensorEventDEPRECATED( + ::capnp::Orphan< ::cereal::SensorEventData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::SENSOR_EVENT_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::SensorEventData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::SensorEventData> Event::Builder::disownSensorEventDEPRECATED() { + KJ_IREQUIRE((which() == Event::SENSOR_EVENT_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::SensorEventData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isCan() const { + return which() == Event::CAN; +} +inline bool Event::Builder::isCan() { + return which() == Event::CAN; +} +inline bool Event::Reader::hasCan() const { + if (which() != Event::CAN) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasCan() { + if (which() != Event::CAN) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Reader Event::Reader::getCan() const { + KJ_IREQUIRE((which() == Event::CAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Builder Event::Builder::getCan() { + KJ_IREQUIRE((which() == Event::CAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setCan( ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAN); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Builder Event::Builder::initCan(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAN); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptCan( + ::capnp::Orphan< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAN); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>> Event::Builder::disownCan() { + KJ_IREQUIRE((which() == Event::CAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isDeviceState() const { + return which() == Event::DEVICE_STATE; +} +inline bool Event::Builder::isDeviceState() { + return which() == Event::DEVICE_STATE; +} +inline bool Event::Reader::hasDeviceState() const { + if (which() != Event::DEVICE_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasDeviceState() { + if (which() != Event::DEVICE_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::DeviceState::Reader Event::Reader::getDeviceState() const { + KJ_IREQUIRE((which() == Event::DEVICE_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::DeviceState>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::DeviceState::Builder Event::Builder::getDeviceState() { + KJ_IREQUIRE((which() == Event::DEVICE_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::DeviceState>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setDeviceState( ::cereal::DeviceState::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DEVICE_STATE); + ::capnp::_::PointerHelpers< ::cereal::DeviceState>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::DeviceState::Builder Event::Builder::initDeviceState() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DEVICE_STATE); + return ::capnp::_::PointerHelpers< ::cereal::DeviceState>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptDeviceState( + ::capnp::Orphan< ::cereal::DeviceState>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DEVICE_STATE); + ::capnp::_::PointerHelpers< ::cereal::DeviceState>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::DeviceState> Event::Builder::disownDeviceState() { + KJ_IREQUIRE((which() == Event::DEVICE_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::DeviceState>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isControlsState() const { + return which() == Event::CONTROLS_STATE; +} +inline bool Event::Builder::isControlsState() { + return which() == Event::CONTROLS_STATE; +} +inline bool Event::Reader::hasControlsState() const { + if (which() != Event::CONTROLS_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasControlsState() { + if (which() != Event::CONTROLS_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ControlsState::Reader Event::Reader::getControlsState() const { + KJ_IREQUIRE((which() == Event::CONTROLS_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::ControlsState::Builder Event::Builder::getControlsState() { + KJ_IREQUIRE((which() == Event::CONTROLS_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setControlsState( ::cereal::ControlsState::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CONTROLS_STATE); + ::capnp::_::PointerHelpers< ::cereal::ControlsState>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::ControlsState::Builder Event::Builder::initControlsState() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CONTROLS_STATE); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptControlsState( + ::capnp::Orphan< ::cereal::ControlsState>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CONTROLS_STATE); + ::capnp::_::PointerHelpers< ::cereal::ControlsState>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ControlsState> Event::Builder::disownControlsState() { + KJ_IREQUIRE((which() == Event::CONTROLS_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ControlsState>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLiveEventDEPRECATED() const { + return which() == Event::LIVE_EVENT_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isLiveEventDEPRECATED() { + return which() == Event::LIVE_EVENT_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasLiveEventDEPRECATED() const { + if (which() != Event::LIVE_EVENT_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLiveEventDEPRECATED() { + if (which() != Event::LIVE_EVENT_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>::Reader Event::Reader::getLiveEventDEPRECATED() const { + KJ_IREQUIRE((which() == Event::LIVE_EVENT_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>::Builder Event::Builder::getLiveEventDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_EVENT_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLiveEventDEPRECATED( ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_EVENT_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>::Builder Event::Builder::initLiveEventDEPRECATED(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_EVENT_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptLiveEventDEPRECATED( + ::capnp::Orphan< ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_EVENT_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>> Event::Builder::disownLiveEventDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_EVENT_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::LiveEventData, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isModel() const { + return which() == Event::MODEL; +} +inline bool Event::Builder::isModel() { + return which() == Event::MODEL; +} +inline bool Event::Reader::hasModel() const { + if (which() != Event::MODEL) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasModel() { + if (which() != Event::MODEL) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelData::Reader Event::Reader::getModel() const { + KJ_IREQUIRE((which() == Event::MODEL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ModelData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelData::Builder Event::Builder::getModel() { + KJ_IREQUIRE((which() == Event::MODEL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ModelData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setModel( ::cereal::ModelData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::MODEL); + ::capnp::_::PointerHelpers< ::cereal::ModelData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelData::Builder Event::Builder::initModel() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::MODEL); + return ::capnp::_::PointerHelpers< ::cereal::ModelData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptModel( + ::capnp::Orphan< ::cereal::ModelData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::MODEL); + ::capnp::_::PointerHelpers< ::cereal::ModelData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelData> Event::Builder::disownModel() { + KJ_IREQUIRE((which() == Event::MODEL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ModelData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isFeaturesDEPRECATED() const { + return which() == Event::FEATURES_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isFeaturesDEPRECATED() { + return which() == Event::FEATURES_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasFeaturesDEPRECATED() const { + if (which() != Event::FEATURES_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasFeaturesDEPRECATED() { + if (which() != Event::FEATURES_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CalibrationFeatures::Reader Event::Reader::getFeaturesDEPRECATED() const { + KJ_IREQUIRE((which() == Event::FEATURES_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CalibrationFeatures>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::CalibrationFeatures::Builder Event::Builder::getFeaturesDEPRECATED() { + KJ_IREQUIRE((which() == Event::FEATURES_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CalibrationFeatures>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setFeaturesDEPRECATED( ::cereal::CalibrationFeatures::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::FEATURES_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::CalibrationFeatures>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::CalibrationFeatures::Builder Event::Builder::initFeaturesDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::FEATURES_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::CalibrationFeatures>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptFeaturesDEPRECATED( + ::capnp::Orphan< ::cereal::CalibrationFeatures>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::FEATURES_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::CalibrationFeatures>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CalibrationFeatures> Event::Builder::disownFeaturesDEPRECATED() { + KJ_IREQUIRE((which() == Event::FEATURES_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CalibrationFeatures>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isSensorEvents() const { + return which() == Event::SENSOR_EVENTS; +} +inline bool Event::Builder::isSensorEvents() { + return which() == Event::SENSOR_EVENTS; +} +inline bool Event::Reader::hasSensorEvents() const { + if (which() != Event::SENSOR_EVENTS) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasSensorEvents() { + if (which() != Event::SENSOR_EVENTS) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>::Reader Event::Reader::getSensorEvents() const { + KJ_IREQUIRE((which() == Event::SENSOR_EVENTS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>::Builder Event::Builder::getSensorEvents() { + KJ_IREQUIRE((which() == Event::SENSOR_EVENTS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setSensorEvents( ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::SENSOR_EVENTS); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>::Builder Event::Builder::initSensorEvents(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::SENSOR_EVENTS); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptSensorEvents( + ::capnp::Orphan< ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::SENSOR_EVENTS); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>> Event::Builder::disownSensorEvents() { + KJ_IREQUIRE((which() == Event::SENSOR_EVENTS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::SensorEventData, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isPandaStateDEPRECATED() const { + return which() == Event::PANDA_STATE_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isPandaStateDEPRECATED() { + return which() == Event::PANDA_STATE_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasPandaStateDEPRECATED() const { + if (which() != Event::PANDA_STATE_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasPandaStateDEPRECATED() { + if (which() != Event::PANDA_STATE_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::PandaState::Reader Event::Reader::getPandaStateDEPRECATED() const { + KJ_IREQUIRE((which() == Event::PANDA_STATE_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::PandaState>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::PandaState::Builder Event::Builder::getPandaStateDEPRECATED() { + KJ_IREQUIRE((which() == Event::PANDA_STATE_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::PandaState>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setPandaStateDEPRECATED( ::cereal::PandaState::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::PANDA_STATE_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::PandaState>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::PandaState::Builder Event::Builder::initPandaStateDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::PANDA_STATE_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::PandaState>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptPandaStateDEPRECATED( + ::capnp::Orphan< ::cereal::PandaState>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::PANDA_STATE_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::PandaState>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::PandaState> Event::Builder::disownPandaStateDEPRECATED() { + KJ_IREQUIRE((which() == Event::PANDA_STATE_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::PandaState>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isRadarState() const { + return which() == Event::RADAR_STATE; +} +inline bool Event::Builder::isRadarState() { + return which() == Event::RADAR_STATE; +} +inline bool Event::Reader::hasRadarState() const { + if (which() != Event::RADAR_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasRadarState() { + if (which() != Event::RADAR_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::RadarState::Reader Event::Reader::getRadarState() const { + KJ_IREQUIRE((which() == Event::RADAR_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::RadarState>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::RadarState::Builder Event::Builder::getRadarState() { + KJ_IREQUIRE((which() == Event::RADAR_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::RadarState>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setRadarState( ::cereal::RadarState::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::RADAR_STATE); + ::capnp::_::PointerHelpers< ::cereal::RadarState>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::RadarState::Builder Event::Builder::initRadarState() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::RADAR_STATE); + return ::capnp::_::PointerHelpers< ::cereal::RadarState>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptRadarState( + ::capnp::Orphan< ::cereal::RadarState>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::RADAR_STATE); + ::capnp::_::PointerHelpers< ::cereal::RadarState>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::RadarState> Event::Builder::disownRadarState() { + KJ_IREQUIRE((which() == Event::RADAR_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::RadarState>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLiveUIDEPRECATED() const { + return which() == Event::LIVE_U_I_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isLiveUIDEPRECATED() { + return which() == Event::LIVE_U_I_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasLiveUIDEPRECATED() const { + if (which() != Event::LIVE_U_I_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLiveUIDEPRECATED() { + if (which() != Event::LIVE_U_I_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveUI::Reader Event::Reader::getLiveUIDEPRECATED() const { + KJ_IREQUIRE((which() == Event::LIVE_U_I_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveUI>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveUI::Builder Event::Builder::getLiveUIDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_U_I_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveUI>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLiveUIDEPRECATED( ::cereal::LiveUI::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_U_I_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveUI>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveUI::Builder Event::Builder::initLiveUIDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_U_I_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::LiveUI>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLiveUIDEPRECATED( + ::capnp::Orphan< ::cereal::LiveUI>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_U_I_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveUI>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveUI> Event::Builder::disownLiveUIDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_U_I_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveUI>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isRoadEncodeIdx() const { + return which() == Event::ROAD_ENCODE_IDX; +} +inline bool Event::Builder::isRoadEncodeIdx() { + return which() == Event::ROAD_ENCODE_IDX; +} +inline bool Event::Reader::hasRoadEncodeIdx() const { + if (which() != Event::ROAD_ENCODE_IDX) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasRoadEncodeIdx() { + if (which() != Event::ROAD_ENCODE_IDX) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::EncodeIndex::Reader Event::Reader::getRoadEncodeIdx() const { + KJ_IREQUIRE((which() == Event::ROAD_ENCODE_IDX), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::EncodeIndex::Builder Event::Builder::getRoadEncodeIdx() { + KJ_IREQUIRE((which() == Event::ROAD_ENCODE_IDX), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setRoadEncodeIdx( ::cereal::EncodeIndex::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ROAD_ENCODE_IDX); + ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::EncodeIndex::Builder Event::Builder::initRoadEncodeIdx() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ROAD_ENCODE_IDX); + return ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptRoadEncodeIdx( + ::capnp::Orphan< ::cereal::EncodeIndex>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ROAD_ENCODE_IDX); + ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::EncodeIndex> Event::Builder::disownRoadEncodeIdx() { + KJ_IREQUIRE((which() == Event::ROAD_ENCODE_IDX), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLiveTracks() const { + return which() == Event::LIVE_TRACKS; +} +inline bool Event::Builder::isLiveTracks() { + return which() == Event::LIVE_TRACKS; +} +inline bool Event::Reader::hasLiveTracks() const { + if (which() != Event::LIVE_TRACKS) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLiveTracks() { + if (which() != Event::LIVE_TRACKS) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>::Reader Event::Reader::getLiveTracks() const { + KJ_IREQUIRE((which() == Event::LIVE_TRACKS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>::Builder Event::Builder::getLiveTracks() { + KJ_IREQUIRE((which() == Event::LIVE_TRACKS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLiveTracks( ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_TRACKS); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>::Builder Event::Builder::initLiveTracks(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_TRACKS); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptLiveTracks( + ::capnp::Orphan< ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_TRACKS); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>> Event::Builder::disownLiveTracks() { + KJ_IREQUIRE((which() == Event::LIVE_TRACKS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::LiveTracks, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isSendcan() const { + return which() == Event::SENDCAN; +} +inline bool Event::Builder::isSendcan() { + return which() == Event::SENDCAN; +} +inline bool Event::Reader::hasSendcan() const { + if (which() != Event::SENDCAN) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasSendcan() { + if (which() != Event::SENDCAN) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Reader Event::Reader::getSendcan() const { + KJ_IREQUIRE((which() == Event::SENDCAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Builder Event::Builder::getSendcan() { + KJ_IREQUIRE((which() == Event::SENDCAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setSendcan( ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::SENDCAN); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>::Builder Event::Builder::initSendcan(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::SENDCAN); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptSendcan( + ::capnp::Orphan< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::SENDCAN); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>> Event::Builder::disownSendcan() { + KJ_IREQUIRE((which() == Event::SENDCAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CanData, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLogMessage() const { + return which() == Event::LOG_MESSAGE; +} +inline bool Event::Builder::isLogMessage() { + return which() == Event::LOG_MESSAGE; +} +inline bool Event::Reader::hasLogMessage() const { + if (which() != Event::LOG_MESSAGE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLogMessage() { + if (which() != Event::LOG_MESSAGE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader Event::Reader::getLogMessage() const { + KJ_IREQUIRE((which() == Event::LOG_MESSAGE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder Event::Builder::getLogMessage() { + KJ_IREQUIRE((which() == Event::LOG_MESSAGE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLogMessage( ::capnp::Text::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LOG_MESSAGE); + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder Event::Builder::initLogMessage(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LOG_MESSAGE); + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptLogMessage( + ::capnp::Orphan< ::capnp::Text>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LOG_MESSAGE); + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> Event::Builder::disownLogMessage() { + KJ_IREQUIRE((which() == Event::LOG_MESSAGE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLiveCalibration() const { + return which() == Event::LIVE_CALIBRATION; +} +inline bool Event::Builder::isLiveCalibration() { + return which() == Event::LIVE_CALIBRATION; +} +inline bool Event::Reader::hasLiveCalibration() const { + if (which() != Event::LIVE_CALIBRATION) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLiveCalibration() { + if (which() != Event::LIVE_CALIBRATION) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveCalibrationData::Reader Event::Reader::getLiveCalibration() const { + KJ_IREQUIRE((which() == Event::LIVE_CALIBRATION), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveCalibrationData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveCalibrationData::Builder Event::Builder::getLiveCalibration() { + KJ_IREQUIRE((which() == Event::LIVE_CALIBRATION), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveCalibrationData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLiveCalibration( ::cereal::LiveCalibrationData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_CALIBRATION); + ::capnp::_::PointerHelpers< ::cereal::LiveCalibrationData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveCalibrationData::Builder Event::Builder::initLiveCalibration() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_CALIBRATION); + return ::capnp::_::PointerHelpers< ::cereal::LiveCalibrationData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLiveCalibration( + ::capnp::Orphan< ::cereal::LiveCalibrationData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_CALIBRATION); + ::capnp::_::PointerHelpers< ::cereal::LiveCalibrationData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveCalibrationData> Event::Builder::disownLiveCalibration() { + KJ_IREQUIRE((which() == Event::LIVE_CALIBRATION), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveCalibrationData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isAndroidLog() const { + return which() == Event::ANDROID_LOG; +} +inline bool Event::Builder::isAndroidLog() { + return which() == Event::ANDROID_LOG; +} +inline bool Event::Reader::hasAndroidLog() const { + if (which() != Event::ANDROID_LOG) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasAndroidLog() { + if (which() != Event::ANDROID_LOG) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::AndroidLogEntry::Reader Event::Reader::getAndroidLog() const { + KJ_IREQUIRE((which() == Event::ANDROID_LOG), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::AndroidLogEntry>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::AndroidLogEntry::Builder Event::Builder::getAndroidLog() { + KJ_IREQUIRE((which() == Event::ANDROID_LOG), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::AndroidLogEntry>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setAndroidLog( ::cereal::AndroidLogEntry::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ANDROID_LOG); + ::capnp::_::PointerHelpers< ::cereal::AndroidLogEntry>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::AndroidLogEntry::Builder Event::Builder::initAndroidLog() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ANDROID_LOG); + return ::capnp::_::PointerHelpers< ::cereal::AndroidLogEntry>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptAndroidLog( + ::capnp::Orphan< ::cereal::AndroidLogEntry>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ANDROID_LOG); + ::capnp::_::PointerHelpers< ::cereal::AndroidLogEntry>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::AndroidLogEntry> Event::Builder::disownAndroidLog() { + KJ_IREQUIRE((which() == Event::ANDROID_LOG), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::AndroidLogEntry>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isGpsLocationDEPRECATED() const { + return which() == Event::GPS_LOCATION_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isGpsLocationDEPRECATED() { + return which() == Event::GPS_LOCATION_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasGpsLocationDEPRECATED() const { + if (which() != Event::GPS_LOCATION_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasGpsLocationDEPRECATED() { + if (which() != Event::GPS_LOCATION_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::GpsLocationData::Reader Event::Reader::getGpsLocationDEPRECATED() const { + KJ_IREQUIRE((which() == Event::GPS_LOCATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::GpsLocationData::Builder Event::Builder::getGpsLocationDEPRECATED() { + KJ_IREQUIRE((which() == Event::GPS_LOCATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setGpsLocationDEPRECATED( ::cereal::GpsLocationData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_LOCATION_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::GpsLocationData::Builder Event::Builder::initGpsLocationDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_LOCATION_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptGpsLocationDEPRECATED( + ::capnp::Orphan< ::cereal::GpsLocationData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_LOCATION_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::GpsLocationData> Event::Builder::disownGpsLocationDEPRECATED() { + KJ_IREQUIRE((which() == Event::GPS_LOCATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isCarState() const { + return which() == Event::CAR_STATE; +} +inline bool Event::Builder::isCarState() { + return which() == Event::CAR_STATE; +} +inline bool Event::Reader::hasCarState() const { + if (which() != Event::CAR_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasCarState() { + if (which() != Event::CAR_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarState::Reader Event::Reader::getCarState() const { + KJ_IREQUIRE((which() == Event::CAR_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarState>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::CarState::Builder Event::Builder::getCarState() { + KJ_IREQUIRE((which() == Event::CAR_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarState>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setCarState( ::cereal::CarState::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_STATE); + ::capnp::_::PointerHelpers< ::cereal::CarState>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarState::Builder Event::Builder::initCarState() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_STATE); + return ::capnp::_::PointerHelpers< ::cereal::CarState>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptCarState( + ::capnp::Orphan< ::cereal::CarState>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_STATE); + ::capnp::_::PointerHelpers< ::cereal::CarState>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarState> Event::Builder::disownCarState() { + KJ_IREQUIRE((which() == Event::CAR_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarState>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isCarControl() const { + return which() == Event::CAR_CONTROL; +} +inline bool Event::Builder::isCarControl() { + return which() == Event::CAR_CONTROL; +} +inline bool Event::Reader::hasCarControl() const { + if (which() != Event::CAR_CONTROL) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasCarControl() { + if (which() != Event::CAR_CONTROL) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarControl::Reader Event::Reader::getCarControl() const { + KJ_IREQUIRE((which() == Event::CAR_CONTROL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarControl>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::CarControl::Builder Event::Builder::getCarControl() { + KJ_IREQUIRE((which() == Event::CAR_CONTROL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarControl>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setCarControl( ::cereal::CarControl::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_CONTROL); + ::capnp::_::PointerHelpers< ::cereal::CarControl>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarControl::Builder Event::Builder::initCarControl() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_CONTROL); + return ::capnp::_::PointerHelpers< ::cereal::CarControl>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptCarControl( + ::capnp::Orphan< ::cereal::CarControl>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_CONTROL); + ::capnp::_::PointerHelpers< ::cereal::CarControl>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarControl> Event::Builder::disownCarControl() { + KJ_IREQUIRE((which() == Event::CAR_CONTROL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarControl>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLongitudinalPlan() const { + return which() == Event::LONGITUDINAL_PLAN; +} +inline bool Event::Builder::isLongitudinalPlan() { + return which() == Event::LONGITUDINAL_PLAN; +} +inline bool Event::Reader::hasLongitudinalPlan() const { + if (which() != Event::LONGITUDINAL_PLAN) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLongitudinalPlan() { + if (which() != Event::LONGITUDINAL_PLAN) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LongitudinalPlan::Reader Event::Reader::getLongitudinalPlan() const { + KJ_IREQUIRE((which() == Event::LONGITUDINAL_PLAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LongitudinalPlan>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LongitudinalPlan::Builder Event::Builder::getLongitudinalPlan() { + KJ_IREQUIRE((which() == Event::LONGITUDINAL_PLAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LongitudinalPlan>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLongitudinalPlan( ::cereal::LongitudinalPlan::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LONGITUDINAL_PLAN); + ::capnp::_::PointerHelpers< ::cereal::LongitudinalPlan>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LongitudinalPlan::Builder Event::Builder::initLongitudinalPlan() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LONGITUDINAL_PLAN); + return ::capnp::_::PointerHelpers< ::cereal::LongitudinalPlan>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLongitudinalPlan( + ::capnp::Orphan< ::cereal::LongitudinalPlan>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LONGITUDINAL_PLAN); + ::capnp::_::PointerHelpers< ::cereal::LongitudinalPlan>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LongitudinalPlan> Event::Builder::disownLongitudinalPlan() { + KJ_IREQUIRE((which() == Event::LONGITUDINAL_PLAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LongitudinalPlan>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLiveLocationDEPRECATED() const { + return which() == Event::LIVE_LOCATION_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isLiveLocationDEPRECATED() { + return which() == Event::LIVE_LOCATION_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasLiveLocationDEPRECATED() const { + if (which() != Event::LIVE_LOCATION_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLiveLocationDEPRECATED() { + if (which() != Event::LIVE_LOCATION_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationData::Reader Event::Reader::getLiveLocationDEPRECATED() const { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationData::Builder Event::Builder::getLiveLocationDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLiveLocationDEPRECATED( ::cereal::LiveLocationData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationData::Builder Event::Builder::initLiveLocationDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLiveLocationDEPRECATED( + ::capnp::Orphan< ::cereal::LiveLocationData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationData> Event::Builder::disownLiveLocationDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isEthernetDataDEPRECATED() const { + return which() == Event::ETHERNET_DATA_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isEthernetDataDEPRECATED() { + return which() == Event::ETHERNET_DATA_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasEthernetDataDEPRECATED() const { + if (which() != Event::ETHERNET_DATA_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasEthernetDataDEPRECATED() { + if (which() != Event::ETHERNET_DATA_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>::Reader Event::Reader::getEthernetDataDEPRECATED() const { + KJ_IREQUIRE((which() == Event::ETHERNET_DATA_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>::Builder Event::Builder::getEthernetDataDEPRECATED() { + KJ_IREQUIRE((which() == Event::ETHERNET_DATA_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setEthernetDataDEPRECATED( ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ETHERNET_DATA_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>::Builder Event::Builder::initEthernetDataDEPRECATED(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ETHERNET_DATA_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptEthernetDataDEPRECATED( + ::capnp::Orphan< ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ETHERNET_DATA_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>> Event::Builder::disownEthernetDataDEPRECATED() { + KJ_IREQUIRE((which() == Event::ETHERNET_DATA_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::EthernetPacket, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isNavUpdateDEPRECATED() const { + return which() == Event::NAV_UPDATE_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isNavUpdateDEPRECATED() { + return which() == Event::NAV_UPDATE_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasNavUpdateDEPRECATED() const { + if (which() != Event::NAV_UPDATE_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasNavUpdateDEPRECATED() { + if (which() != Event::NAV_UPDATE_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::NavUpdate::Reader Event::Reader::getNavUpdateDEPRECATED() const { + KJ_IREQUIRE((which() == Event::NAV_UPDATE_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::NavUpdate>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::NavUpdate::Builder Event::Builder::getNavUpdateDEPRECATED() { + KJ_IREQUIRE((which() == Event::NAV_UPDATE_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::NavUpdate>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setNavUpdateDEPRECATED( ::cereal::NavUpdate::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_UPDATE_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::NavUpdate>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::NavUpdate::Builder Event::Builder::initNavUpdateDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_UPDATE_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::NavUpdate>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptNavUpdateDEPRECATED( + ::capnp::Orphan< ::cereal::NavUpdate>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_UPDATE_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::NavUpdate>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::NavUpdate> Event::Builder::disownNavUpdateDEPRECATED() { + KJ_IREQUIRE((which() == Event::NAV_UPDATE_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::NavUpdate>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isCellInfoDEPRECATED() const { + return which() == Event::CELL_INFO_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isCellInfoDEPRECATED() { + return which() == Event::CELL_INFO_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasCellInfoDEPRECATED() const { + if (which() != Event::CELL_INFO_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasCellInfoDEPRECATED() { + if (which() != Event::CELL_INFO_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>::Reader Event::Reader::getCellInfoDEPRECATED() const { + KJ_IREQUIRE((which() == Event::CELL_INFO_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>::Builder Event::Builder::getCellInfoDEPRECATED() { + KJ_IREQUIRE((which() == Event::CELL_INFO_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setCellInfoDEPRECATED( ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CELL_INFO_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>::Builder Event::Builder::initCellInfoDEPRECATED(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CELL_INFO_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptCellInfoDEPRECATED( + ::capnp::Orphan< ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CELL_INFO_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>> Event::Builder::disownCellInfoDEPRECATED() { + KJ_IREQUIRE((which() == Event::CELL_INFO_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CellInfo, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isWifiScanDEPRECATED() const { + return which() == Event::WIFI_SCAN_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isWifiScanDEPRECATED() { + return which() == Event::WIFI_SCAN_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasWifiScanDEPRECATED() const { + if (which() != Event::WIFI_SCAN_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasWifiScanDEPRECATED() { + if (which() != Event::WIFI_SCAN_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>::Reader Event::Reader::getWifiScanDEPRECATED() const { + KJ_IREQUIRE((which() == Event::WIFI_SCAN_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>::Builder Event::Builder::getWifiScanDEPRECATED() { + KJ_IREQUIRE((which() == Event::WIFI_SCAN_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setWifiScanDEPRECATED( ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::WIFI_SCAN_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>::Builder Event::Builder::initWifiScanDEPRECATED(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::WIFI_SCAN_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptWifiScanDEPRECATED( + ::capnp::Orphan< ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::WIFI_SCAN_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>> Event::Builder::disownWifiScanDEPRECATED() { + KJ_IREQUIRE((which() == Event::WIFI_SCAN_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::WifiScan, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isAndroidGnssDEPRECATED() const { + return which() == Event::ANDROID_GNSS_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isAndroidGnssDEPRECATED() { + return which() == Event::ANDROID_GNSS_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasAndroidGnssDEPRECATED() const { + if (which() != Event::ANDROID_GNSS_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasAndroidGnssDEPRECATED() { + if (which() != Event::ANDROID_GNSS_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::AndroidGnss::Reader Event::Reader::getAndroidGnssDEPRECATED() const { + KJ_IREQUIRE((which() == Event::ANDROID_GNSS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::AndroidGnss::Builder Event::Builder::getAndroidGnssDEPRECATED() { + KJ_IREQUIRE((which() == Event::ANDROID_GNSS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setAndroidGnssDEPRECATED( ::cereal::AndroidGnss::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ANDROID_GNSS_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::AndroidGnss>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::AndroidGnss::Builder Event::Builder::initAndroidGnssDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ANDROID_GNSS_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptAndroidGnssDEPRECATED( + ::capnp::Orphan< ::cereal::AndroidGnss>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ANDROID_GNSS_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::AndroidGnss>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::AndroidGnss> Event::Builder::disownAndroidGnssDEPRECATED() { + KJ_IREQUIRE((which() == Event::ANDROID_GNSS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::AndroidGnss>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isQcomGnssDEPRECATD() const { + return which() == Event::QCOM_GNSS_D_E_P_R_E_C_A_T_D; +} +inline bool Event::Builder::isQcomGnssDEPRECATD() { + return which() == Event::QCOM_GNSS_D_E_P_R_E_C_A_T_D; +} +inline bool Event::Reader::hasQcomGnssDEPRECATD() const { + if (which() != Event::QCOM_GNSS_D_E_P_R_E_C_A_T_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasQcomGnssDEPRECATD() { + if (which() != Event::QCOM_GNSS_D_E_P_R_E_C_A_T_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::QcomGnss::Reader Event::Reader::getQcomGnssDEPRECATD() const { + KJ_IREQUIRE((which() == Event::QCOM_GNSS_D_E_P_R_E_C_A_T_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::QcomGnss::Builder Event::Builder::getQcomGnssDEPRECATD() { + KJ_IREQUIRE((which() == Event::QCOM_GNSS_D_E_P_R_E_C_A_T_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setQcomGnssDEPRECATD( ::cereal::QcomGnss::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::QCOM_GNSS_D_E_P_R_E_C_A_T_D); + ::capnp::_::PointerHelpers< ::cereal::QcomGnss>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::QcomGnss::Builder Event::Builder::initQcomGnssDEPRECATD() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::QCOM_GNSS_D_E_P_R_E_C_A_T_D); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptQcomGnssDEPRECATD( + ::capnp::Orphan< ::cereal::QcomGnss>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::QCOM_GNSS_D_E_P_R_E_C_A_T_D); + ::capnp::_::PointerHelpers< ::cereal::QcomGnss>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::QcomGnss> Event::Builder::disownQcomGnssDEPRECATD() { + KJ_IREQUIRE((which() == Event::QCOM_GNSS_D_E_P_R_E_C_A_T_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::QcomGnss>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLidarPtsDEPRECATED() const { + return which() == Event::LIDAR_PTS_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isLidarPtsDEPRECATED() { + return which() == Event::LIDAR_PTS_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasLidarPtsDEPRECATED() const { + if (which() != Event::LIDAR_PTS_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLidarPtsDEPRECATED() { + if (which() != Event::LIDAR_PTS_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LidarPts::Reader Event::Reader::getLidarPtsDEPRECATED() const { + KJ_IREQUIRE((which() == Event::LIDAR_PTS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LidarPts>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LidarPts::Builder Event::Builder::getLidarPtsDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIDAR_PTS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LidarPts>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLidarPtsDEPRECATED( ::cereal::LidarPts::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIDAR_PTS_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LidarPts>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LidarPts::Builder Event::Builder::initLidarPtsDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIDAR_PTS_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::LidarPts>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLidarPtsDEPRECATED( + ::capnp::Orphan< ::cereal::LidarPts>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIDAR_PTS_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LidarPts>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LidarPts> Event::Builder::disownLidarPtsDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIDAR_PTS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LidarPts>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isProcLog() const { + return which() == Event::PROC_LOG; +} +inline bool Event::Builder::isProcLog() { + return which() == Event::PROC_LOG; +} +inline bool Event::Reader::hasProcLog() const { + if (which() != Event::PROC_LOG) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasProcLog() { + if (which() != Event::PROC_LOG) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ProcLog::Reader Event::Reader::getProcLog() const { + KJ_IREQUIRE((which() == Event::PROC_LOG), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ProcLog>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::ProcLog::Builder Event::Builder::getProcLog() { + KJ_IREQUIRE((which() == Event::PROC_LOG), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ProcLog>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setProcLog( ::cereal::ProcLog::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::PROC_LOG); + ::capnp::_::PointerHelpers< ::cereal::ProcLog>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::ProcLog::Builder Event::Builder::initProcLog() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::PROC_LOG); + return ::capnp::_::PointerHelpers< ::cereal::ProcLog>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptProcLog( + ::capnp::Orphan< ::cereal::ProcLog>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::PROC_LOG); + ::capnp::_::PointerHelpers< ::cereal::ProcLog>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ProcLog> Event::Builder::disownProcLog() { + KJ_IREQUIRE((which() == Event::PROC_LOG), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ProcLog>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isUbloxGnss() const { + return which() == Event::UBLOX_GNSS; +} +inline bool Event::Builder::isUbloxGnss() { + return which() == Event::UBLOX_GNSS; +} +inline bool Event::Reader::hasUbloxGnss() const { + if (which() != Event::UBLOX_GNSS) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasUbloxGnss() { + if (which() != Event::UBLOX_GNSS) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::UbloxGnss::Reader Event::Reader::getUbloxGnss() const { + KJ_IREQUIRE((which() == Event::UBLOX_GNSS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::UbloxGnss::Builder Event::Builder::getUbloxGnss() { + KJ_IREQUIRE((which() == Event::UBLOX_GNSS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setUbloxGnss( ::cereal::UbloxGnss::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UBLOX_GNSS); + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::UbloxGnss::Builder Event::Builder::initUbloxGnss() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UBLOX_GNSS); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptUbloxGnss( + ::capnp::Orphan< ::cereal::UbloxGnss>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UBLOX_GNSS); + ::capnp::_::PointerHelpers< ::cereal::UbloxGnss>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::UbloxGnss> Event::Builder::disownUbloxGnss() { + KJ_IREQUIRE((which() == Event::UBLOX_GNSS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UbloxGnss>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isClocks() const { + return which() == Event::CLOCKS; +} +inline bool Event::Builder::isClocks() { + return which() == Event::CLOCKS; +} +inline bool Event::Reader::hasClocks() const { + if (which() != Event::CLOCKS) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasClocks() { + if (which() != Event::CLOCKS) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::Clocks::Reader Event::Reader::getClocks() const { + KJ_IREQUIRE((which() == Event::CLOCKS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Clocks>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::Clocks::Builder Event::Builder::getClocks() { + KJ_IREQUIRE((which() == Event::CLOCKS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Clocks>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setClocks( ::cereal::Clocks::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CLOCKS); + ::capnp::_::PointerHelpers< ::cereal::Clocks>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::Clocks::Builder Event::Builder::initClocks() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CLOCKS); + return ::capnp::_::PointerHelpers< ::cereal::Clocks>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptClocks( + ::capnp::Orphan< ::cereal::Clocks>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CLOCKS); + ::capnp::_::PointerHelpers< ::cereal::Clocks>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::Clocks> Event::Builder::disownClocks() { + KJ_IREQUIRE((which() == Event::CLOCKS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Clocks>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLiveMpcDEPRECATED() const { + return which() == Event::LIVE_MPC_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isLiveMpcDEPRECATED() { + return which() == Event::LIVE_MPC_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasLiveMpcDEPRECATED() const { + if (which() != Event::LIVE_MPC_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLiveMpcDEPRECATED() { + if (which() != Event::LIVE_MPC_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveMpcData::Reader Event::Reader::getLiveMpcDEPRECATED() const { + KJ_IREQUIRE((which() == Event::LIVE_MPC_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveMpcData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveMpcData::Builder Event::Builder::getLiveMpcDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_MPC_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveMpcData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLiveMpcDEPRECATED( ::cereal::LiveMpcData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_MPC_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveMpcData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveMpcData::Builder Event::Builder::initLiveMpcDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_MPC_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::LiveMpcData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLiveMpcDEPRECATED( + ::capnp::Orphan< ::cereal::LiveMpcData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_MPC_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveMpcData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveMpcData> Event::Builder::disownLiveMpcDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_MPC_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveMpcData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLiveLongitudinalMpcDEPRECATED() const { + return which() == Event::LIVE_LONGITUDINAL_MPC_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isLiveLongitudinalMpcDEPRECATED() { + return which() == Event::LIVE_LONGITUDINAL_MPC_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasLiveLongitudinalMpcDEPRECATED() const { + if (which() != Event::LIVE_LONGITUDINAL_MPC_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLiveLongitudinalMpcDEPRECATED() { + if (which() != Event::LIVE_LONGITUDINAL_MPC_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLongitudinalMpcData::Reader Event::Reader::getLiveLongitudinalMpcDEPRECATED() const { + KJ_IREQUIRE((which() == Event::LIVE_LONGITUDINAL_MPC_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLongitudinalMpcData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLongitudinalMpcData::Builder Event::Builder::getLiveLongitudinalMpcDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_LONGITUDINAL_MPC_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLongitudinalMpcData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLiveLongitudinalMpcDEPRECATED( ::cereal::LiveLongitudinalMpcData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LONGITUDINAL_MPC_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveLongitudinalMpcData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLongitudinalMpcData::Builder Event::Builder::initLiveLongitudinalMpcDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LONGITUDINAL_MPC_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::LiveLongitudinalMpcData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLiveLongitudinalMpcDEPRECATED( + ::capnp::Orphan< ::cereal::LiveLongitudinalMpcData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LONGITUDINAL_MPC_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveLongitudinalMpcData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLongitudinalMpcData> Event::Builder::disownLiveLongitudinalMpcDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_LONGITUDINAL_MPC_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLongitudinalMpcData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isNavStatusDEPRECATED() const { + return which() == Event::NAV_STATUS_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isNavStatusDEPRECATED() { + return which() == Event::NAV_STATUS_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasNavStatusDEPRECATED() const { + if (which() != Event::NAV_STATUS_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasNavStatusDEPRECATED() { + if (which() != Event::NAV_STATUS_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::NavStatus::Reader Event::Reader::getNavStatusDEPRECATED() const { + KJ_IREQUIRE((which() == Event::NAV_STATUS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::NavStatus>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::NavStatus::Builder Event::Builder::getNavStatusDEPRECATED() { + KJ_IREQUIRE((which() == Event::NAV_STATUS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::NavStatus>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setNavStatusDEPRECATED( ::cereal::NavStatus::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_STATUS_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::NavStatus>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::NavStatus::Builder Event::Builder::initNavStatusDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_STATUS_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::NavStatus>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptNavStatusDEPRECATED( + ::capnp::Orphan< ::cereal::NavStatus>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_STATUS_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::NavStatus>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::NavStatus> Event::Builder::disownNavStatusDEPRECATED() { + KJ_IREQUIRE((which() == Event::NAV_STATUS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::NavStatus>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isUbloxRaw() const { + return which() == Event::UBLOX_RAW; +} +inline bool Event::Builder::isUbloxRaw() { + return which() == Event::UBLOX_RAW; +} +inline bool Event::Reader::hasUbloxRaw() const { + if (which() != Event::UBLOX_RAW) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasUbloxRaw() { + if (which() != Event::UBLOX_RAW) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader Event::Reader::getUbloxRaw() const { + KJ_IREQUIRE((which() == Event::UBLOX_RAW), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder Event::Builder::getUbloxRaw() { + KJ_IREQUIRE((which() == Event::UBLOX_RAW), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setUbloxRaw( ::capnp::Data::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UBLOX_RAW); + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder Event::Builder::initUbloxRaw(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UBLOX_RAW); + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptUbloxRaw( + ::capnp::Orphan< ::capnp::Data>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UBLOX_RAW); + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> Event::Builder::disownUbloxRaw() { + KJ_IREQUIRE((which() == Event::UBLOX_RAW), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isGpsPlannerPointsDEPRECATED() const { + return which() == Event::GPS_PLANNER_POINTS_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isGpsPlannerPointsDEPRECATED() { + return which() == Event::GPS_PLANNER_POINTS_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasGpsPlannerPointsDEPRECATED() const { + if (which() != Event::GPS_PLANNER_POINTS_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasGpsPlannerPointsDEPRECATED() { + if (which() != Event::GPS_PLANNER_POINTS_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::GPSPlannerPoints::Reader Event::Reader::getGpsPlannerPointsDEPRECATED() const { + KJ_IREQUIRE((which() == Event::GPS_PLANNER_POINTS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GPSPlannerPoints>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::GPSPlannerPoints::Builder Event::Builder::getGpsPlannerPointsDEPRECATED() { + KJ_IREQUIRE((which() == Event::GPS_PLANNER_POINTS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GPSPlannerPoints>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setGpsPlannerPointsDEPRECATED( ::cereal::GPSPlannerPoints::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_PLANNER_POINTS_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::GPSPlannerPoints>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::GPSPlannerPoints::Builder Event::Builder::initGpsPlannerPointsDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_PLANNER_POINTS_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::GPSPlannerPoints>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptGpsPlannerPointsDEPRECATED( + ::capnp::Orphan< ::cereal::GPSPlannerPoints>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_PLANNER_POINTS_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::GPSPlannerPoints>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::GPSPlannerPoints> Event::Builder::disownGpsPlannerPointsDEPRECATED() { + KJ_IREQUIRE((which() == Event::GPS_PLANNER_POINTS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GPSPlannerPoints>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isGpsPlannerPlanDEPRECATED() const { + return which() == Event::GPS_PLANNER_PLAN_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isGpsPlannerPlanDEPRECATED() { + return which() == Event::GPS_PLANNER_PLAN_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasGpsPlannerPlanDEPRECATED() const { + if (which() != Event::GPS_PLANNER_PLAN_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasGpsPlannerPlanDEPRECATED() { + if (which() != Event::GPS_PLANNER_PLAN_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::GPSPlannerPlan::Reader Event::Reader::getGpsPlannerPlanDEPRECATED() const { + KJ_IREQUIRE((which() == Event::GPS_PLANNER_PLAN_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GPSPlannerPlan>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::GPSPlannerPlan::Builder Event::Builder::getGpsPlannerPlanDEPRECATED() { + KJ_IREQUIRE((which() == Event::GPS_PLANNER_PLAN_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GPSPlannerPlan>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setGpsPlannerPlanDEPRECATED( ::cereal::GPSPlannerPlan::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_PLANNER_PLAN_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::GPSPlannerPlan>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::GPSPlannerPlan::Builder Event::Builder::initGpsPlannerPlanDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_PLANNER_PLAN_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::GPSPlannerPlan>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptGpsPlannerPlanDEPRECATED( + ::capnp::Orphan< ::cereal::GPSPlannerPlan>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_PLANNER_PLAN_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::GPSPlannerPlan>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::GPSPlannerPlan> Event::Builder::disownGpsPlannerPlanDEPRECATED() { + KJ_IREQUIRE((which() == Event::GPS_PLANNER_PLAN_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GPSPlannerPlan>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isApplanixRawDEPRECATED() const { + return which() == Event::APPLANIX_RAW_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isApplanixRawDEPRECATED() { + return which() == Event::APPLANIX_RAW_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasApplanixRawDEPRECATED() const { + if (which() != Event::APPLANIX_RAW_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasApplanixRawDEPRECATED() { + if (which() != Event::APPLANIX_RAW_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader Event::Reader::getApplanixRawDEPRECATED() const { + KJ_IREQUIRE((which() == Event::APPLANIX_RAW_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder Event::Builder::getApplanixRawDEPRECATED() { + KJ_IREQUIRE((which() == Event::APPLANIX_RAW_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setApplanixRawDEPRECATED( ::capnp::Data::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::APPLANIX_RAW_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder Event::Builder::initApplanixRawDEPRECATED(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::APPLANIX_RAW_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptApplanixRawDEPRECATED( + ::capnp::Orphan< ::capnp::Data>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::APPLANIX_RAW_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> Event::Builder::disownApplanixRawDEPRECATED() { + KJ_IREQUIRE((which() == Event::APPLANIX_RAW_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isTrafficEventsDEPRECATED() const { + return which() == Event::TRAFFIC_EVENTS_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isTrafficEventsDEPRECATED() { + return which() == Event::TRAFFIC_EVENTS_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasTrafficEventsDEPRECATED() const { + if (which() != Event::TRAFFIC_EVENTS_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasTrafficEventsDEPRECATED() { + if (which() != Event::TRAFFIC_EVENTS_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>::Reader Event::Reader::getTrafficEventsDEPRECATED() const { + KJ_IREQUIRE((which() == Event::TRAFFIC_EVENTS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>::Builder Event::Builder::getTrafficEventsDEPRECATED() { + KJ_IREQUIRE((which() == Event::TRAFFIC_EVENTS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setTrafficEventsDEPRECATED( ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::TRAFFIC_EVENTS_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>::Builder Event::Builder::initTrafficEventsDEPRECATED(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::TRAFFIC_EVENTS_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptTrafficEventsDEPRECATED( + ::capnp::Orphan< ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::TRAFFIC_EVENTS_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>> Event::Builder::disownTrafficEventsDEPRECATED() { + KJ_IREQUIRE((which() == Event::TRAFFIC_EVENTS_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::TrafficEvent, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLiveLocationTimingDEPRECATED() const { + return which() == Event::LIVE_LOCATION_TIMING_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isLiveLocationTimingDEPRECATED() { + return which() == Event::LIVE_LOCATION_TIMING_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasLiveLocationTimingDEPRECATED() const { + if (which() != Event::LIVE_LOCATION_TIMING_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLiveLocationTimingDEPRECATED() { + if (which() != Event::LIVE_LOCATION_TIMING_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationData::Reader Event::Reader::getLiveLocationTimingDEPRECATED() const { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_TIMING_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationData::Builder Event::Builder::getLiveLocationTimingDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_TIMING_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLiveLocationTimingDEPRECATED( ::cereal::LiveLocationData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_TIMING_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationData::Builder Event::Builder::initLiveLocationTimingDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_TIMING_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLiveLocationTimingDEPRECATED( + ::capnp::Orphan< ::cereal::LiveLocationData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_TIMING_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationData> Event::Builder::disownLiveLocationTimingDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_TIMING_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isOrbslamCorrectionDEPRECATED() const { + return which() == Event::ORBSLAM_CORRECTION_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isOrbslamCorrectionDEPRECATED() { + return which() == Event::ORBSLAM_CORRECTION_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasOrbslamCorrectionDEPRECATED() const { + if (which() != Event::ORBSLAM_CORRECTION_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasOrbslamCorrectionDEPRECATED() { + if (which() != Event::ORBSLAM_CORRECTION_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::OrbslamCorrection::Reader Event::Reader::getOrbslamCorrectionDEPRECATED() const { + KJ_IREQUIRE((which() == Event::ORBSLAM_CORRECTION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbslamCorrection>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::OrbslamCorrection::Builder Event::Builder::getOrbslamCorrectionDEPRECATED() { + KJ_IREQUIRE((which() == Event::ORBSLAM_CORRECTION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbslamCorrection>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setOrbslamCorrectionDEPRECATED( ::cereal::OrbslamCorrection::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORBSLAM_CORRECTION_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::OrbslamCorrection>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::OrbslamCorrection::Builder Event::Builder::initOrbslamCorrectionDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORBSLAM_CORRECTION_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::OrbslamCorrection>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptOrbslamCorrectionDEPRECATED( + ::capnp::Orphan< ::cereal::OrbslamCorrection>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORBSLAM_CORRECTION_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::OrbslamCorrection>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::OrbslamCorrection> Event::Builder::disownOrbslamCorrectionDEPRECATED() { + KJ_IREQUIRE((which() == Event::ORBSLAM_CORRECTION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbslamCorrection>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLiveLocationCorrectedDEPRECATED() const { + return which() == Event::LIVE_LOCATION_CORRECTED_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isLiveLocationCorrectedDEPRECATED() { + return which() == Event::LIVE_LOCATION_CORRECTED_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasLiveLocationCorrectedDEPRECATED() const { + if (which() != Event::LIVE_LOCATION_CORRECTED_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLiveLocationCorrectedDEPRECATED() { + if (which() != Event::LIVE_LOCATION_CORRECTED_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationData::Reader Event::Reader::getLiveLocationCorrectedDEPRECATED() const { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_CORRECTED_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationData::Builder Event::Builder::getLiveLocationCorrectedDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_CORRECTED_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLiveLocationCorrectedDEPRECATED( ::cereal::LiveLocationData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_CORRECTED_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationData::Builder Event::Builder::initLiveLocationCorrectedDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_CORRECTED_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLiveLocationCorrectedDEPRECATED( + ::capnp::Orphan< ::cereal::LiveLocationData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_CORRECTED_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationData> Event::Builder::disownLiveLocationCorrectedDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_CORRECTED_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isOrbObservationDEPRECATED() const { + return which() == Event::ORB_OBSERVATION_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isOrbObservationDEPRECATED() { + return which() == Event::ORB_OBSERVATION_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasOrbObservationDEPRECATED() const { + if (which() != Event::ORB_OBSERVATION_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasOrbObservationDEPRECATED() { + if (which() != Event::ORB_OBSERVATION_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>::Reader Event::Reader::getOrbObservationDEPRECATED() const { + KJ_IREQUIRE((which() == Event::ORB_OBSERVATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>::Builder Event::Builder::getOrbObservationDEPRECATED() { + KJ_IREQUIRE((which() == Event::ORB_OBSERVATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setOrbObservationDEPRECATED( ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_OBSERVATION_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>::Builder Event::Builder::initOrbObservationDEPRECATED(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_OBSERVATION_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptOrbObservationDEPRECATED( + ::capnp::Orphan< ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_OBSERVATION_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>> Event::Builder::disownOrbObservationDEPRECATED() { + KJ_IREQUIRE((which() == Event::ORB_OBSERVATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::OrbObservation, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isGpsLocationExternal() const { + return which() == Event::GPS_LOCATION_EXTERNAL; +} +inline bool Event::Builder::isGpsLocationExternal() { + return which() == Event::GPS_LOCATION_EXTERNAL; +} +inline bool Event::Reader::hasGpsLocationExternal() const { + if (which() != Event::GPS_LOCATION_EXTERNAL) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasGpsLocationExternal() { + if (which() != Event::GPS_LOCATION_EXTERNAL) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::GpsLocationData::Reader Event::Reader::getGpsLocationExternal() const { + KJ_IREQUIRE((which() == Event::GPS_LOCATION_EXTERNAL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::GpsLocationData::Builder Event::Builder::getGpsLocationExternal() { + KJ_IREQUIRE((which() == Event::GPS_LOCATION_EXTERNAL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setGpsLocationExternal( ::cereal::GpsLocationData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_LOCATION_EXTERNAL); + ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::GpsLocationData::Builder Event::Builder::initGpsLocationExternal() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_LOCATION_EXTERNAL); + return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptGpsLocationExternal( + ::capnp::Orphan< ::cereal::GpsLocationData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::GPS_LOCATION_EXTERNAL); + ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::GpsLocationData> Event::Builder::disownGpsLocationExternal() { + KJ_IREQUIRE((which() == Event::GPS_LOCATION_EXTERNAL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLocationDEPRECATED() const { + return which() == Event::LOCATION_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isLocationDEPRECATED() { + return which() == Event::LOCATION_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasLocationDEPRECATED() const { + if (which() != Event::LOCATION_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLocationDEPRECATED() { + if (which() != Event::LOCATION_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationData::Reader Event::Reader::getLocationDEPRECATED() const { + KJ_IREQUIRE((which() == Event::LOCATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationData::Builder Event::Builder::getLocationDEPRECATED() { + KJ_IREQUIRE((which() == Event::LOCATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLocationDEPRECATED( ::cereal::LiveLocationData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LOCATION_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationData::Builder Event::Builder::initLocationDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LOCATION_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLocationDEPRECATED( + ::capnp::Orphan< ::cereal::LiveLocationData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LOCATION_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationData> Event::Builder::disownLocationDEPRECATED() { + KJ_IREQUIRE((which() == Event::LOCATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isUiNavigationEventDEPRECATED() const { + return which() == Event::UI_NAVIGATION_EVENT_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isUiNavigationEventDEPRECATED() { + return which() == Event::UI_NAVIGATION_EVENT_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasUiNavigationEventDEPRECATED() const { + if (which() != Event::UI_NAVIGATION_EVENT_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasUiNavigationEventDEPRECATED() { + if (which() != Event::UI_NAVIGATION_EVENT_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::UiNavigationEvent::Reader Event::Reader::getUiNavigationEventDEPRECATED() const { + KJ_IREQUIRE((which() == Event::UI_NAVIGATION_EVENT_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UiNavigationEvent>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::UiNavigationEvent::Builder Event::Builder::getUiNavigationEventDEPRECATED() { + KJ_IREQUIRE((which() == Event::UI_NAVIGATION_EVENT_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UiNavigationEvent>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setUiNavigationEventDEPRECATED( ::cereal::UiNavigationEvent::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UI_NAVIGATION_EVENT_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::UiNavigationEvent>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::UiNavigationEvent::Builder Event::Builder::initUiNavigationEventDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UI_NAVIGATION_EVENT_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::UiNavigationEvent>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptUiNavigationEventDEPRECATED( + ::capnp::Orphan< ::cereal::UiNavigationEvent>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UI_NAVIGATION_EVENT_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::UiNavigationEvent>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::UiNavigationEvent> Event::Builder::disownUiNavigationEventDEPRECATED() { + KJ_IREQUIRE((which() == Event::UI_NAVIGATION_EVENT_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UiNavigationEvent>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLiveLocationKalmanDEPRECATED() const { + return which() == Event::LIVE_LOCATION_KALMAN_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isLiveLocationKalmanDEPRECATED() { + return which() == Event::LIVE_LOCATION_KALMAN_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasLiveLocationKalmanDEPRECATED() const { + if (which() != Event::LIVE_LOCATION_KALMAN_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLiveLocationKalmanDEPRECATED() { + if (which() != Event::LIVE_LOCATION_KALMAN_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationData::Reader Event::Reader::getLiveLocationKalmanDEPRECATED() const { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_KALMAN_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationData::Builder Event::Builder::getLiveLocationKalmanDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_KALMAN_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLiveLocationKalmanDEPRECATED( ::cereal::LiveLocationData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_KALMAN_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationData::Builder Event::Builder::initLiveLocationKalmanDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_KALMAN_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLiveLocationKalmanDEPRECATED( + ::capnp::Orphan< ::cereal::LiveLocationData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_KALMAN_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationData> Event::Builder::disownLiveLocationKalmanDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_KALMAN_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isTestJoystick() const { + return which() == Event::TEST_JOYSTICK; +} +inline bool Event::Builder::isTestJoystick() { + return which() == Event::TEST_JOYSTICK; +} +inline bool Event::Reader::hasTestJoystick() const { + if (which() != Event::TEST_JOYSTICK) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasTestJoystick() { + if (which() != Event::TEST_JOYSTICK) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::Joystick::Reader Event::Reader::getTestJoystick() const { + KJ_IREQUIRE((which() == Event::TEST_JOYSTICK), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Joystick>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::Joystick::Builder Event::Builder::getTestJoystick() { + KJ_IREQUIRE((which() == Event::TEST_JOYSTICK), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Joystick>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setTestJoystick( ::cereal::Joystick::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::TEST_JOYSTICK); + ::capnp::_::PointerHelpers< ::cereal::Joystick>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::Joystick::Builder Event::Builder::initTestJoystick() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::TEST_JOYSTICK); + return ::capnp::_::PointerHelpers< ::cereal::Joystick>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptTestJoystick( + ::capnp::Orphan< ::cereal::Joystick>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::TEST_JOYSTICK); + ::capnp::_::PointerHelpers< ::cereal::Joystick>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::Joystick> Event::Builder::disownTestJoystick() { + KJ_IREQUIRE((which() == Event::TEST_JOYSTICK), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Joystick>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isOrbOdometryDEPRECATED() const { + return which() == Event::ORB_ODOMETRY_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isOrbOdometryDEPRECATED() { + return which() == Event::ORB_ODOMETRY_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasOrbOdometryDEPRECATED() const { + if (which() != Event::ORB_ODOMETRY_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasOrbOdometryDEPRECATED() { + if (which() != Event::ORB_ODOMETRY_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::OrbOdometry::Reader Event::Reader::getOrbOdometryDEPRECATED() const { + KJ_IREQUIRE((which() == Event::ORB_ODOMETRY_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbOdometry>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::OrbOdometry::Builder Event::Builder::getOrbOdometryDEPRECATED() { + KJ_IREQUIRE((which() == Event::ORB_ODOMETRY_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbOdometry>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setOrbOdometryDEPRECATED( ::cereal::OrbOdometry::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_ODOMETRY_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::OrbOdometry>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::OrbOdometry::Builder Event::Builder::initOrbOdometryDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_ODOMETRY_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::OrbOdometry>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptOrbOdometryDEPRECATED( + ::capnp::Orphan< ::cereal::OrbOdometry>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_ODOMETRY_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::OrbOdometry>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::OrbOdometry> Event::Builder::disownOrbOdometryDEPRECATED() { + KJ_IREQUIRE((which() == Event::ORB_ODOMETRY_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbOdometry>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isOrbFeaturesDEPRECATED() const { + return which() == Event::ORB_FEATURES_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isOrbFeaturesDEPRECATED() { + return which() == Event::ORB_FEATURES_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasOrbFeaturesDEPRECATED() const { + if (which() != Event::ORB_FEATURES_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasOrbFeaturesDEPRECATED() { + if (which() != Event::ORB_FEATURES_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::OrbFeatures::Reader Event::Reader::getOrbFeaturesDEPRECATED() const { + KJ_IREQUIRE((which() == Event::ORB_FEATURES_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbFeatures>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::OrbFeatures::Builder Event::Builder::getOrbFeaturesDEPRECATED() { + KJ_IREQUIRE((which() == Event::ORB_FEATURES_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbFeatures>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setOrbFeaturesDEPRECATED( ::cereal::OrbFeatures::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_FEATURES_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::OrbFeatures>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::OrbFeatures::Builder Event::Builder::initOrbFeaturesDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_FEATURES_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::OrbFeatures>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptOrbFeaturesDEPRECATED( + ::capnp::Orphan< ::cereal::OrbFeatures>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_FEATURES_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::OrbFeatures>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::OrbFeatures> Event::Builder::disownOrbFeaturesDEPRECATED() { + KJ_IREQUIRE((which() == Event::ORB_FEATURES_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbFeatures>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isApplanixLocationDEPRECATED() const { + return which() == Event::APPLANIX_LOCATION_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isApplanixLocationDEPRECATED() { + return which() == Event::APPLANIX_LOCATION_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasApplanixLocationDEPRECATED() const { + if (which() != Event::APPLANIX_LOCATION_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasApplanixLocationDEPRECATED() { + if (which() != Event::APPLANIX_LOCATION_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationData::Reader Event::Reader::getApplanixLocationDEPRECATED() const { + KJ_IREQUIRE((which() == Event::APPLANIX_LOCATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationData::Builder Event::Builder::getApplanixLocationDEPRECATED() { + KJ_IREQUIRE((which() == Event::APPLANIX_LOCATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setApplanixLocationDEPRECATED( ::cereal::LiveLocationData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::APPLANIX_LOCATION_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationData::Builder Event::Builder::initApplanixLocationDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::APPLANIX_LOCATION_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptApplanixLocationDEPRECATED( + ::capnp::Orphan< ::cereal::LiveLocationData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::APPLANIX_LOCATION_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationData> Event::Builder::disownApplanixLocationDEPRECATED() { + KJ_IREQUIRE((which() == Event::APPLANIX_LOCATION_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isOrbKeyFrameDEPRECATED() const { + return which() == Event::ORB_KEY_FRAME_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isOrbKeyFrameDEPRECATED() { + return which() == Event::ORB_KEY_FRAME_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasOrbKeyFrameDEPRECATED() const { + if (which() != Event::ORB_KEY_FRAME_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasOrbKeyFrameDEPRECATED() { + if (which() != Event::ORB_KEY_FRAME_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::OrbKeyFrame::Reader Event::Reader::getOrbKeyFrameDEPRECATED() const { + KJ_IREQUIRE((which() == Event::ORB_KEY_FRAME_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbKeyFrame>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::OrbKeyFrame::Builder Event::Builder::getOrbKeyFrameDEPRECATED() { + KJ_IREQUIRE((which() == Event::ORB_KEY_FRAME_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbKeyFrame>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setOrbKeyFrameDEPRECATED( ::cereal::OrbKeyFrame::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_KEY_FRAME_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::OrbKeyFrame>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::OrbKeyFrame::Builder Event::Builder::initOrbKeyFrameDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_KEY_FRAME_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::OrbKeyFrame>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptOrbKeyFrameDEPRECATED( + ::capnp::Orphan< ::cereal::OrbKeyFrame>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_KEY_FRAME_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::OrbKeyFrame>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::OrbKeyFrame> Event::Builder::disownOrbKeyFrameDEPRECATED() { + KJ_IREQUIRE((which() == Event::ORB_KEY_FRAME_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbKeyFrame>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isUiLayoutStateDEPRECATED() const { + return which() == Event::UI_LAYOUT_STATE_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isUiLayoutStateDEPRECATED() { + return which() == Event::UI_LAYOUT_STATE_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasUiLayoutStateDEPRECATED() const { + if (which() != Event::UI_LAYOUT_STATE_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasUiLayoutStateDEPRECATED() { + if (which() != Event::UI_LAYOUT_STATE_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::UiLayoutState::Reader Event::Reader::getUiLayoutStateDEPRECATED() const { + KJ_IREQUIRE((which() == Event::UI_LAYOUT_STATE_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UiLayoutState>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::UiLayoutState::Builder Event::Builder::getUiLayoutStateDEPRECATED() { + KJ_IREQUIRE((which() == Event::UI_LAYOUT_STATE_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UiLayoutState>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setUiLayoutStateDEPRECATED( ::cereal::UiLayoutState::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UI_LAYOUT_STATE_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::UiLayoutState>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::UiLayoutState::Builder Event::Builder::initUiLayoutStateDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UI_LAYOUT_STATE_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::UiLayoutState>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptUiLayoutStateDEPRECATED( + ::capnp::Orphan< ::cereal::UiLayoutState>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UI_LAYOUT_STATE_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::UiLayoutState>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::UiLayoutState> Event::Builder::disownUiLayoutStateDEPRECATED() { + KJ_IREQUIRE((which() == Event::UI_LAYOUT_STATE_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UiLayoutState>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isOrbFeaturesSummaryDEPRECATED() const { + return which() == Event::ORB_FEATURES_SUMMARY_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isOrbFeaturesSummaryDEPRECATED() { + return which() == Event::ORB_FEATURES_SUMMARY_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasOrbFeaturesSummaryDEPRECATED() const { + if (which() != Event::ORB_FEATURES_SUMMARY_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasOrbFeaturesSummaryDEPRECATED() { + if (which() != Event::ORB_FEATURES_SUMMARY_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::OrbFeaturesSummary::Reader Event::Reader::getOrbFeaturesSummaryDEPRECATED() const { + KJ_IREQUIRE((which() == Event::ORB_FEATURES_SUMMARY_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbFeaturesSummary>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::OrbFeaturesSummary::Builder Event::Builder::getOrbFeaturesSummaryDEPRECATED() { + KJ_IREQUIRE((which() == Event::ORB_FEATURES_SUMMARY_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbFeaturesSummary>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setOrbFeaturesSummaryDEPRECATED( ::cereal::OrbFeaturesSummary::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_FEATURES_SUMMARY_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::OrbFeaturesSummary>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::OrbFeaturesSummary::Builder Event::Builder::initOrbFeaturesSummaryDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_FEATURES_SUMMARY_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::OrbFeaturesSummary>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptOrbFeaturesSummaryDEPRECATED( + ::capnp::Orphan< ::cereal::OrbFeaturesSummary>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ORB_FEATURES_SUMMARY_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::OrbFeaturesSummary>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::OrbFeaturesSummary> Event::Builder::disownOrbFeaturesSummaryDEPRECATED() { + KJ_IREQUIRE((which() == Event::ORB_FEATURES_SUMMARY_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::OrbFeaturesSummary>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isDriverState() const { + return which() == Event::DRIVER_STATE; +} +inline bool Event::Builder::isDriverState() { + return which() == Event::DRIVER_STATE; +} +inline bool Event::Reader::hasDriverState() const { + if (which() != Event::DRIVER_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasDriverState() { + if (which() != Event::DRIVER_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::DriverState::Reader Event::Reader::getDriverState() const { + KJ_IREQUIRE((which() == Event::DRIVER_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::DriverState>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::DriverState::Builder Event::Builder::getDriverState() { + KJ_IREQUIRE((which() == Event::DRIVER_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::DriverState>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setDriverState( ::cereal::DriverState::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DRIVER_STATE); + ::capnp::_::PointerHelpers< ::cereal::DriverState>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::DriverState::Builder Event::Builder::initDriverState() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DRIVER_STATE); + return ::capnp::_::PointerHelpers< ::cereal::DriverState>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptDriverState( + ::capnp::Orphan< ::cereal::DriverState>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DRIVER_STATE); + ::capnp::_::PointerHelpers< ::cereal::DriverState>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::DriverState> Event::Builder::disownDriverState() { + KJ_IREQUIRE((which() == Event::DRIVER_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::DriverState>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isBoot() const { + return which() == Event::BOOT; +} +inline bool Event::Builder::isBoot() { + return which() == Event::BOOT; +} +inline bool Event::Reader::hasBoot() const { + if (which() != Event::BOOT) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasBoot() { + if (which() != Event::BOOT) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::Boot::Reader Event::Reader::getBoot() const { + KJ_IREQUIRE((which() == Event::BOOT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Boot>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::Boot::Builder Event::Builder::getBoot() { + KJ_IREQUIRE((which() == Event::BOOT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Boot>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setBoot( ::cereal::Boot::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::BOOT); + ::capnp::_::PointerHelpers< ::cereal::Boot>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::Boot::Builder Event::Builder::initBoot() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::BOOT); + return ::capnp::_::PointerHelpers< ::cereal::Boot>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptBoot( + ::capnp::Orphan< ::cereal::Boot>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::BOOT); + ::capnp::_::PointerHelpers< ::cereal::Boot>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::Boot> Event::Builder::disownBoot() { + KJ_IREQUIRE((which() == Event::BOOT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Boot>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLiveParameters() const { + return which() == Event::LIVE_PARAMETERS; +} +inline bool Event::Builder::isLiveParameters() { + return which() == Event::LIVE_PARAMETERS; +} +inline bool Event::Reader::hasLiveParameters() const { + if (which() != Event::LIVE_PARAMETERS) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLiveParameters() { + if (which() != Event::LIVE_PARAMETERS) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveParametersData::Reader Event::Reader::getLiveParameters() const { + KJ_IREQUIRE((which() == Event::LIVE_PARAMETERS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveParametersData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveParametersData::Builder Event::Builder::getLiveParameters() { + KJ_IREQUIRE((which() == Event::LIVE_PARAMETERS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveParametersData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLiveParameters( ::cereal::LiveParametersData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_PARAMETERS); + ::capnp::_::PointerHelpers< ::cereal::LiveParametersData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveParametersData::Builder Event::Builder::initLiveParameters() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_PARAMETERS); + return ::capnp::_::PointerHelpers< ::cereal::LiveParametersData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLiveParameters( + ::capnp::Orphan< ::cereal::LiveParametersData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_PARAMETERS); + ::capnp::_::PointerHelpers< ::cereal::LiveParametersData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveParametersData> Event::Builder::disownLiveParameters() { + KJ_IREQUIRE((which() == Event::LIVE_PARAMETERS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveParametersData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLiveMapDataDEPRECATED() const { + return which() == Event::LIVE_MAP_DATA_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isLiveMapDataDEPRECATED() { + return which() == Event::LIVE_MAP_DATA_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasLiveMapDataDEPRECATED() const { + if (which() != Event::LIVE_MAP_DATA_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLiveMapDataDEPRECATED() { + if (which() != Event::LIVE_MAP_DATA_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveMapDataDEPRECATED::Reader Event::Reader::getLiveMapDataDEPRECATED() const { + KJ_IREQUIRE((which() == Event::LIVE_MAP_DATA_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveMapDataDEPRECATED>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveMapDataDEPRECATED::Builder Event::Builder::getLiveMapDataDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_MAP_DATA_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveMapDataDEPRECATED>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLiveMapDataDEPRECATED( ::cereal::LiveMapDataDEPRECATED::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_MAP_DATA_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveMapDataDEPRECATED>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveMapDataDEPRECATED::Builder Event::Builder::initLiveMapDataDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_MAP_DATA_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::LiveMapDataDEPRECATED>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLiveMapDataDEPRECATED( + ::capnp::Orphan< ::cereal::LiveMapDataDEPRECATED>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_MAP_DATA_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::LiveMapDataDEPRECATED>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveMapDataDEPRECATED> Event::Builder::disownLiveMapDataDEPRECATED() { + KJ_IREQUIRE((which() == Event::LIVE_MAP_DATA_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveMapDataDEPRECATED>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isCameraOdometry() const { + return which() == Event::CAMERA_ODOMETRY; +} +inline bool Event::Builder::isCameraOdometry() { + return which() == Event::CAMERA_ODOMETRY; +} +inline bool Event::Reader::hasCameraOdometry() const { + if (which() != Event::CAMERA_ODOMETRY) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasCameraOdometry() { + if (which() != Event::CAMERA_ODOMETRY) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CameraOdometry::Reader Event::Reader::getCameraOdometry() const { + KJ_IREQUIRE((which() == Event::CAMERA_ODOMETRY), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CameraOdometry>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::CameraOdometry::Builder Event::Builder::getCameraOdometry() { + KJ_IREQUIRE((which() == Event::CAMERA_ODOMETRY), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CameraOdometry>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setCameraOdometry( ::cereal::CameraOdometry::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAMERA_ODOMETRY); + ::capnp::_::PointerHelpers< ::cereal::CameraOdometry>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::CameraOdometry::Builder Event::Builder::initCameraOdometry() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAMERA_ODOMETRY); + return ::capnp::_::PointerHelpers< ::cereal::CameraOdometry>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptCameraOdometry( + ::capnp::Orphan< ::cereal::CameraOdometry>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAMERA_ODOMETRY); + ::capnp::_::PointerHelpers< ::cereal::CameraOdometry>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CameraOdometry> Event::Builder::disownCameraOdometry() { + KJ_IREQUIRE((which() == Event::CAMERA_ODOMETRY), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CameraOdometry>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLateralPlan() const { + return which() == Event::LATERAL_PLAN; +} +inline bool Event::Builder::isLateralPlan() { + return which() == Event::LATERAL_PLAN; +} +inline bool Event::Reader::hasLateralPlan() const { + if (which() != Event::LATERAL_PLAN) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLateralPlan() { + if (which() != Event::LATERAL_PLAN) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LateralPlan::Reader Event::Reader::getLateralPlan() const { + KJ_IREQUIRE((which() == Event::LATERAL_PLAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LateralPlan>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LateralPlan::Builder Event::Builder::getLateralPlan() { + KJ_IREQUIRE((which() == Event::LATERAL_PLAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LateralPlan>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLateralPlan( ::cereal::LateralPlan::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LATERAL_PLAN); + ::capnp::_::PointerHelpers< ::cereal::LateralPlan>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LateralPlan::Builder Event::Builder::initLateralPlan() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LATERAL_PLAN); + return ::capnp::_::PointerHelpers< ::cereal::LateralPlan>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLateralPlan( + ::capnp::Orphan< ::cereal::LateralPlan>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LATERAL_PLAN); + ::capnp::_::PointerHelpers< ::cereal::LateralPlan>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LateralPlan> Event::Builder::disownLateralPlan() { + KJ_IREQUIRE((which() == Event::LATERAL_PLAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LateralPlan>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isKalmanOdometryDEPRECATED() const { + return which() == Event::KALMAN_ODOMETRY_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Builder::isKalmanOdometryDEPRECATED() { + return which() == Event::KALMAN_ODOMETRY_D_E_P_R_E_C_A_T_E_D; +} +inline bool Event::Reader::hasKalmanOdometryDEPRECATED() const { + if (which() != Event::KALMAN_ODOMETRY_D_E_P_R_E_C_A_T_E_D) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasKalmanOdometryDEPRECATED() { + if (which() != Event::KALMAN_ODOMETRY_D_E_P_R_E_C_A_T_E_D) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::KalmanOdometry::Reader Event::Reader::getKalmanOdometryDEPRECATED() const { + KJ_IREQUIRE((which() == Event::KALMAN_ODOMETRY_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::KalmanOdometry>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::KalmanOdometry::Builder Event::Builder::getKalmanOdometryDEPRECATED() { + KJ_IREQUIRE((which() == Event::KALMAN_ODOMETRY_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::KalmanOdometry>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setKalmanOdometryDEPRECATED( ::cereal::KalmanOdometry::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::KALMAN_ODOMETRY_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::KalmanOdometry>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::KalmanOdometry::Builder Event::Builder::initKalmanOdometryDEPRECATED() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::KALMAN_ODOMETRY_D_E_P_R_E_C_A_T_E_D); + return ::capnp::_::PointerHelpers< ::cereal::KalmanOdometry>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptKalmanOdometryDEPRECATED( + ::capnp::Orphan< ::cereal::KalmanOdometry>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::KALMAN_ODOMETRY_D_E_P_R_E_C_A_T_E_D); + ::capnp::_::PointerHelpers< ::cereal::KalmanOdometry>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::KalmanOdometry> Event::Builder::disownKalmanOdometryDEPRECATED() { + KJ_IREQUIRE((which() == Event::KALMAN_ODOMETRY_D_E_P_R_E_C_A_T_E_D), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::KalmanOdometry>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isThumbnail() const { + return which() == Event::THUMBNAIL; +} +inline bool Event::Builder::isThumbnail() { + return which() == Event::THUMBNAIL; +} +inline bool Event::Reader::hasThumbnail() const { + if (which() != Event::THUMBNAIL) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasThumbnail() { + if (which() != Event::THUMBNAIL) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::Thumbnail::Reader Event::Reader::getThumbnail() const { + KJ_IREQUIRE((which() == Event::THUMBNAIL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Thumbnail>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::Thumbnail::Builder Event::Builder::getThumbnail() { + KJ_IREQUIRE((which() == Event::THUMBNAIL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Thumbnail>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setThumbnail( ::cereal::Thumbnail::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::THUMBNAIL); + ::capnp::_::PointerHelpers< ::cereal::Thumbnail>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::Thumbnail::Builder Event::Builder::initThumbnail() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::THUMBNAIL); + return ::capnp::_::PointerHelpers< ::cereal::Thumbnail>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptThumbnail( + ::capnp::Orphan< ::cereal::Thumbnail>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::THUMBNAIL); + ::capnp::_::PointerHelpers< ::cereal::Thumbnail>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::Thumbnail> Event::Builder::disownThumbnail() { + KJ_IREQUIRE((which() == Event::THUMBNAIL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Thumbnail>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::getValid() const { + return _reader.getDataField( + ::capnp::bounded<80>() * ::capnp::ELEMENTS, true); +} + +inline bool Event::Builder::getValid() { + return _builder.getDataField( + ::capnp::bounded<80>() * ::capnp::ELEMENTS, true); +} +inline void Event::Builder::setValid(bool value) { + _builder.setDataField( + ::capnp::bounded<80>() * ::capnp::ELEMENTS, value, true); +} + +inline bool Event::Reader::isCarEvents() const { + return which() == Event::CAR_EVENTS; +} +inline bool Event::Builder::isCarEvents() { + return which() == Event::CAR_EVENTS; +} +inline bool Event::Reader::hasCarEvents() const { + if (which() != Event::CAR_EVENTS) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasCarEvents() { + if (which() != Event::CAR_EVENTS) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader Event::Reader::getCarEvents() const { + KJ_IREQUIRE((which() == Event::CAR_EVENTS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder Event::Builder::getCarEvents() { + KJ_IREQUIRE((which() == Event::CAR_EVENTS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setCarEvents( ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_EVENTS); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>::Builder Event::Builder::initCarEvents(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_EVENTS); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptCarEvents( + ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_EVENTS); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>> Event::Builder::disownCarEvents() { + KJ_IREQUIRE((which() == Event::CAR_EVENTS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::CarEvent, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isCarParams() const { + return which() == Event::CAR_PARAMS; +} +inline bool Event::Builder::isCarParams() { + return which() == Event::CAR_PARAMS; +} +inline bool Event::Reader::hasCarParams() const { + if (which() != Event::CAR_PARAMS) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasCarParams() { + if (which() != Event::CAR_PARAMS) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarParams::Reader Event::Reader::getCarParams() const { + KJ_IREQUIRE((which() == Event::CAR_PARAMS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarParams>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::CarParams::Builder Event::Builder::getCarParams() { + KJ_IREQUIRE((which() == Event::CAR_PARAMS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarParams>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setCarParams( ::cereal::CarParams::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_PARAMS); + ::capnp::_::PointerHelpers< ::cereal::CarParams>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarParams::Builder Event::Builder::initCarParams() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_PARAMS); + return ::capnp::_::PointerHelpers< ::cereal::CarParams>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptCarParams( + ::capnp::Orphan< ::cereal::CarParams>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_PARAMS); + ::capnp::_::PointerHelpers< ::cereal::CarParams>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarParams> Event::Builder::disownCarParams() { + KJ_IREQUIRE((which() == Event::CAR_PARAMS), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarParams>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isDriverCameraState() const { + return which() == Event::DRIVER_CAMERA_STATE; +} +inline bool Event::Builder::isDriverCameraState() { + return which() == Event::DRIVER_CAMERA_STATE; +} +inline bool Event::Reader::hasDriverCameraState() const { + if (which() != Event::DRIVER_CAMERA_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasDriverCameraState() { + if (which() != Event::DRIVER_CAMERA_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::FrameData::Reader Event::Reader::getDriverCameraState() const { + KJ_IREQUIRE((which() == Event::DRIVER_CAMERA_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::FrameData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::FrameData::Builder Event::Builder::getDriverCameraState() { + KJ_IREQUIRE((which() == Event::DRIVER_CAMERA_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::FrameData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setDriverCameraState( ::cereal::FrameData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DRIVER_CAMERA_STATE); + ::capnp::_::PointerHelpers< ::cereal::FrameData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::FrameData::Builder Event::Builder::initDriverCameraState() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DRIVER_CAMERA_STATE); + return ::capnp::_::PointerHelpers< ::cereal::FrameData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptDriverCameraState( + ::capnp::Orphan< ::cereal::FrameData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DRIVER_CAMERA_STATE); + ::capnp::_::PointerHelpers< ::cereal::FrameData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::FrameData> Event::Builder::disownDriverCameraState() { + KJ_IREQUIRE((which() == Event::DRIVER_CAMERA_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::FrameData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isDriverMonitoringState() const { + return which() == Event::DRIVER_MONITORING_STATE; +} +inline bool Event::Builder::isDriverMonitoringState() { + return which() == Event::DRIVER_MONITORING_STATE; +} +inline bool Event::Reader::hasDriverMonitoringState() const { + if (which() != Event::DRIVER_MONITORING_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasDriverMonitoringState() { + if (which() != Event::DRIVER_MONITORING_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::DriverMonitoringState::Reader Event::Reader::getDriverMonitoringState() const { + KJ_IREQUIRE((which() == Event::DRIVER_MONITORING_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::DriverMonitoringState>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::DriverMonitoringState::Builder Event::Builder::getDriverMonitoringState() { + KJ_IREQUIRE((which() == Event::DRIVER_MONITORING_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::DriverMonitoringState>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setDriverMonitoringState( ::cereal::DriverMonitoringState::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DRIVER_MONITORING_STATE); + ::capnp::_::PointerHelpers< ::cereal::DriverMonitoringState>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::DriverMonitoringState::Builder Event::Builder::initDriverMonitoringState() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DRIVER_MONITORING_STATE); + return ::capnp::_::PointerHelpers< ::cereal::DriverMonitoringState>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptDriverMonitoringState( + ::capnp::Orphan< ::cereal::DriverMonitoringState>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DRIVER_MONITORING_STATE); + ::capnp::_::PointerHelpers< ::cereal::DriverMonitoringState>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::DriverMonitoringState> Event::Builder::disownDriverMonitoringState() { + KJ_IREQUIRE((which() == Event::DRIVER_MONITORING_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::DriverMonitoringState>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isLiveLocationKalman() const { + return which() == Event::LIVE_LOCATION_KALMAN; +} +inline bool Event::Builder::isLiveLocationKalman() { + return which() == Event::LIVE_LOCATION_KALMAN; +} +inline bool Event::Reader::hasLiveLocationKalman() const { + if (which() != Event::LIVE_LOCATION_KALMAN) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasLiveLocationKalman() { + if (which() != Event::LIVE_LOCATION_KALMAN) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::LiveLocationKalman::Reader Event::Reader::getLiveLocationKalman() const { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_KALMAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::LiveLocationKalman::Builder Event::Builder::getLiveLocationKalman() { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_KALMAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setLiveLocationKalman( ::cereal::LiveLocationKalman::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_KALMAN); + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::LiveLocationKalman::Builder Event::Builder::initLiveLocationKalman() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_KALMAN); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptLiveLocationKalman( + ::capnp::Orphan< ::cereal::LiveLocationKalman>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::LIVE_LOCATION_KALMAN); + ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::LiveLocationKalman> Event::Builder::disownLiveLocationKalman() { + KJ_IREQUIRE((which() == Event::LIVE_LOCATION_KALMAN), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::LiveLocationKalman>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isSentinel() const { + return which() == Event::SENTINEL; +} +inline bool Event::Builder::isSentinel() { + return which() == Event::SENTINEL; +} +inline bool Event::Reader::hasSentinel() const { + if (which() != Event::SENTINEL) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasSentinel() { + if (which() != Event::SENTINEL) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::Sentinel::Reader Event::Reader::getSentinel() const { + KJ_IREQUIRE((which() == Event::SENTINEL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Sentinel>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::Sentinel::Builder Event::Builder::getSentinel() { + KJ_IREQUIRE((which() == Event::SENTINEL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Sentinel>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setSentinel( ::cereal::Sentinel::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::SENTINEL); + ::capnp::_::PointerHelpers< ::cereal::Sentinel>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::Sentinel::Builder Event::Builder::initSentinel() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::SENTINEL); + return ::capnp::_::PointerHelpers< ::cereal::Sentinel>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptSentinel( + ::capnp::Orphan< ::cereal::Sentinel>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::SENTINEL); + ::capnp::_::PointerHelpers< ::cereal::Sentinel>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::Sentinel> Event::Builder::disownSentinel() { + KJ_IREQUIRE((which() == Event::SENTINEL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Sentinel>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isWideRoadCameraState() const { + return which() == Event::WIDE_ROAD_CAMERA_STATE; +} +inline bool Event::Builder::isWideRoadCameraState() { + return which() == Event::WIDE_ROAD_CAMERA_STATE; +} +inline bool Event::Reader::hasWideRoadCameraState() const { + if (which() != Event::WIDE_ROAD_CAMERA_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasWideRoadCameraState() { + if (which() != Event::WIDE_ROAD_CAMERA_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::FrameData::Reader Event::Reader::getWideRoadCameraState() const { + KJ_IREQUIRE((which() == Event::WIDE_ROAD_CAMERA_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::FrameData>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::FrameData::Builder Event::Builder::getWideRoadCameraState() { + KJ_IREQUIRE((which() == Event::WIDE_ROAD_CAMERA_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::FrameData>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setWideRoadCameraState( ::cereal::FrameData::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::WIDE_ROAD_CAMERA_STATE); + ::capnp::_::PointerHelpers< ::cereal::FrameData>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::FrameData::Builder Event::Builder::initWideRoadCameraState() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::WIDE_ROAD_CAMERA_STATE); + return ::capnp::_::PointerHelpers< ::cereal::FrameData>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptWideRoadCameraState( + ::capnp::Orphan< ::cereal::FrameData>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::WIDE_ROAD_CAMERA_STATE); + ::capnp::_::PointerHelpers< ::cereal::FrameData>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::FrameData> Event::Builder::disownWideRoadCameraState() { + KJ_IREQUIRE((which() == Event::WIDE_ROAD_CAMERA_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::FrameData>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isModelV2() const { + return which() == Event::MODEL_V2; +} +inline bool Event::Builder::isModelV2() { + return which() == Event::MODEL_V2; +} +inline bool Event::Reader::hasModelV2() const { + if (which() != Event::MODEL_V2) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasModelV2() { + if (which() != Event::MODEL_V2) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ModelDataV2::Reader Event::Reader::getModelV2() const { + KJ_IREQUIRE((which() == Event::MODEL_V2), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::ModelDataV2::Builder Event::Builder::getModelV2() { + KJ_IREQUIRE((which() == Event::MODEL_V2), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setModelV2( ::cereal::ModelDataV2::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::MODEL_V2); + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::ModelDataV2::Builder Event::Builder::initModelV2() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::MODEL_V2); + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptModelV2( + ::capnp::Orphan< ::cereal::ModelDataV2>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::MODEL_V2); + ::capnp::_::PointerHelpers< ::cereal::ModelDataV2>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ModelDataV2> Event::Builder::disownModelV2() { + KJ_IREQUIRE((which() == Event::MODEL_V2), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ModelDataV2>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isDriverEncodeIdx() const { + return which() == Event::DRIVER_ENCODE_IDX; +} +inline bool Event::Builder::isDriverEncodeIdx() { + return which() == Event::DRIVER_ENCODE_IDX; +} +inline bool Event::Reader::hasDriverEncodeIdx() const { + if (which() != Event::DRIVER_ENCODE_IDX) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasDriverEncodeIdx() { + if (which() != Event::DRIVER_ENCODE_IDX) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::EncodeIndex::Reader Event::Reader::getDriverEncodeIdx() const { + KJ_IREQUIRE((which() == Event::DRIVER_ENCODE_IDX), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::EncodeIndex::Builder Event::Builder::getDriverEncodeIdx() { + KJ_IREQUIRE((which() == Event::DRIVER_ENCODE_IDX), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setDriverEncodeIdx( ::cereal::EncodeIndex::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DRIVER_ENCODE_IDX); + ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::EncodeIndex::Builder Event::Builder::initDriverEncodeIdx() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DRIVER_ENCODE_IDX); + return ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptDriverEncodeIdx( + ::capnp::Orphan< ::cereal::EncodeIndex>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::DRIVER_ENCODE_IDX); + ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::EncodeIndex> Event::Builder::disownDriverEncodeIdx() { + KJ_IREQUIRE((which() == Event::DRIVER_ENCODE_IDX), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isWideRoadEncodeIdx() const { + return which() == Event::WIDE_ROAD_ENCODE_IDX; +} +inline bool Event::Builder::isWideRoadEncodeIdx() { + return which() == Event::WIDE_ROAD_ENCODE_IDX; +} +inline bool Event::Reader::hasWideRoadEncodeIdx() const { + if (which() != Event::WIDE_ROAD_ENCODE_IDX) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasWideRoadEncodeIdx() { + if (which() != Event::WIDE_ROAD_ENCODE_IDX) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::EncodeIndex::Reader Event::Reader::getWideRoadEncodeIdx() const { + KJ_IREQUIRE((which() == Event::WIDE_ROAD_ENCODE_IDX), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::EncodeIndex::Builder Event::Builder::getWideRoadEncodeIdx() { + KJ_IREQUIRE((which() == Event::WIDE_ROAD_ENCODE_IDX), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setWideRoadEncodeIdx( ::cereal::EncodeIndex::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::WIDE_ROAD_ENCODE_IDX); + ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::EncodeIndex::Builder Event::Builder::initWideRoadEncodeIdx() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::WIDE_ROAD_ENCODE_IDX); + return ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptWideRoadEncodeIdx( + ::capnp::Orphan< ::cereal::EncodeIndex>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::WIDE_ROAD_ENCODE_IDX); + ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::EncodeIndex> Event::Builder::disownWideRoadEncodeIdx() { + KJ_IREQUIRE((which() == Event::WIDE_ROAD_ENCODE_IDX), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::EncodeIndex>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isManagerState() const { + return which() == Event::MANAGER_STATE; +} +inline bool Event::Builder::isManagerState() { + return which() == Event::MANAGER_STATE; +} +inline bool Event::Reader::hasManagerState() const { + if (which() != Event::MANAGER_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasManagerState() { + if (which() != Event::MANAGER_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::ManagerState::Reader Event::Reader::getManagerState() const { + KJ_IREQUIRE((which() == Event::MANAGER_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ManagerState>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::ManagerState::Builder Event::Builder::getManagerState() { + KJ_IREQUIRE((which() == Event::MANAGER_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ManagerState>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setManagerState( ::cereal::ManagerState::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::MANAGER_STATE); + ::capnp::_::PointerHelpers< ::cereal::ManagerState>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::ManagerState::Builder Event::Builder::initManagerState() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::MANAGER_STATE); + return ::capnp::_::PointerHelpers< ::cereal::ManagerState>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptManagerState( + ::capnp::Orphan< ::cereal::ManagerState>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::MANAGER_STATE); + ::capnp::_::PointerHelpers< ::cereal::ManagerState>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::ManagerState> Event::Builder::disownManagerState() { + KJ_IREQUIRE((which() == Event::MANAGER_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::ManagerState>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isUploaderState() const { + return which() == Event::UPLOADER_STATE; +} +inline bool Event::Builder::isUploaderState() { + return which() == Event::UPLOADER_STATE; +} +inline bool Event::Reader::hasUploaderState() const { + if (which() != Event::UPLOADER_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasUploaderState() { + if (which() != Event::UPLOADER_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::UploaderState::Reader Event::Reader::getUploaderState() const { + KJ_IREQUIRE((which() == Event::UPLOADER_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UploaderState>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::UploaderState::Builder Event::Builder::getUploaderState() { + KJ_IREQUIRE((which() == Event::UPLOADER_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UploaderState>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setUploaderState( ::cereal::UploaderState::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UPLOADER_STATE); + ::capnp::_::PointerHelpers< ::cereal::UploaderState>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::UploaderState::Builder Event::Builder::initUploaderState() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UPLOADER_STATE); + return ::capnp::_::PointerHelpers< ::cereal::UploaderState>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptUploaderState( + ::capnp::Orphan< ::cereal::UploaderState>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::UPLOADER_STATE); + ::capnp::_::PointerHelpers< ::cereal::UploaderState>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::UploaderState> Event::Builder::disownUploaderState() { + KJ_IREQUIRE((which() == Event::UPLOADER_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::UploaderState>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isPeripheralState() const { + return which() == Event::PERIPHERAL_STATE; +} +inline bool Event::Builder::isPeripheralState() { + return which() == Event::PERIPHERAL_STATE; +} +inline bool Event::Reader::hasPeripheralState() const { + if (which() != Event::PERIPHERAL_STATE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasPeripheralState() { + if (which() != Event::PERIPHERAL_STATE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::PeripheralState::Reader Event::Reader::getPeripheralState() const { + KJ_IREQUIRE((which() == Event::PERIPHERAL_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::PeripheralState>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::PeripheralState::Builder Event::Builder::getPeripheralState() { + KJ_IREQUIRE((which() == Event::PERIPHERAL_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::PeripheralState>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setPeripheralState( ::cereal::PeripheralState::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::PERIPHERAL_STATE); + ::capnp::_::PointerHelpers< ::cereal::PeripheralState>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::PeripheralState::Builder Event::Builder::initPeripheralState() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::PERIPHERAL_STATE); + return ::capnp::_::PointerHelpers< ::cereal::PeripheralState>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptPeripheralState( + ::capnp::Orphan< ::cereal::PeripheralState>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::PERIPHERAL_STATE); + ::capnp::_::PointerHelpers< ::cereal::PeripheralState>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::PeripheralState> Event::Builder::disownPeripheralState() { + KJ_IREQUIRE((which() == Event::PERIPHERAL_STATE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::PeripheralState>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isPandaStates() const { + return which() == Event::PANDA_STATES; +} +inline bool Event::Builder::isPandaStates() { + return which() == Event::PANDA_STATES; +} +inline bool Event::Reader::hasPandaStates() const { + if (which() != Event::PANDA_STATES) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasPandaStates() { + if (which() != Event::PANDA_STATES) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>::Reader Event::Reader::getPandaStates() const { + KJ_IREQUIRE((which() == Event::PANDA_STATES), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>::Builder Event::Builder::getPandaStates() { + KJ_IREQUIRE((which() == Event::PANDA_STATES), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setPandaStates( ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::PANDA_STATES); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>::Builder Event::Builder::initPandaStates(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::PANDA_STATES); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptPandaStates( + ::capnp::Orphan< ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::PANDA_STATES); + ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>> Event::Builder::disownPandaStates() { + KJ_IREQUIRE((which() == Event::PANDA_STATES), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::List< ::cereal::PandaState, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isNavInstruction() const { + return which() == Event::NAV_INSTRUCTION; +} +inline bool Event::Builder::isNavInstruction() { + return which() == Event::NAV_INSTRUCTION; +} +inline bool Event::Reader::hasNavInstruction() const { + if (which() != Event::NAV_INSTRUCTION) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasNavInstruction() { + if (which() != Event::NAV_INSTRUCTION) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::NavInstruction::Reader Event::Reader::getNavInstruction() const { + KJ_IREQUIRE((which() == Event::NAV_INSTRUCTION), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::NavInstruction>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::NavInstruction::Builder Event::Builder::getNavInstruction() { + KJ_IREQUIRE((which() == Event::NAV_INSTRUCTION), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::NavInstruction>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setNavInstruction( ::cereal::NavInstruction::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_INSTRUCTION); + ::capnp::_::PointerHelpers< ::cereal::NavInstruction>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::NavInstruction::Builder Event::Builder::initNavInstruction() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_INSTRUCTION); + return ::capnp::_::PointerHelpers< ::cereal::NavInstruction>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptNavInstruction( + ::capnp::Orphan< ::cereal::NavInstruction>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_INSTRUCTION); + ::capnp::_::PointerHelpers< ::cereal::NavInstruction>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::NavInstruction> Event::Builder::disownNavInstruction() { + KJ_IREQUIRE((which() == Event::NAV_INSTRUCTION), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::NavInstruction>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isNavRoute() const { + return which() == Event::NAV_ROUTE; +} +inline bool Event::Builder::isNavRoute() { + return which() == Event::NAV_ROUTE; +} +inline bool Event::Reader::hasNavRoute() const { + if (which() != Event::NAV_ROUTE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasNavRoute() { + if (which() != Event::NAV_ROUTE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::NavRoute::Reader Event::Reader::getNavRoute() const { + KJ_IREQUIRE((which() == Event::NAV_ROUTE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::NavRoute>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::NavRoute::Builder Event::Builder::getNavRoute() { + KJ_IREQUIRE((which() == Event::NAV_ROUTE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::NavRoute>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setNavRoute( ::cereal::NavRoute::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_ROUTE); + ::capnp::_::PointerHelpers< ::cereal::NavRoute>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::NavRoute::Builder Event::Builder::initNavRoute() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_ROUTE); + return ::capnp::_::PointerHelpers< ::cereal::NavRoute>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptNavRoute( + ::capnp::Orphan< ::cereal::NavRoute>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_ROUTE); + ::capnp::_::PointerHelpers< ::cereal::NavRoute>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::NavRoute> Event::Builder::disownNavRoute() { + KJ_IREQUIRE((which() == Event::NAV_ROUTE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::NavRoute>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isNavThumbnail() const { + return which() == Event::NAV_THUMBNAIL; +} +inline bool Event::Builder::isNavThumbnail() { + return which() == Event::NAV_THUMBNAIL; +} +inline bool Event::Reader::hasNavThumbnail() const { + if (which() != Event::NAV_THUMBNAIL) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasNavThumbnail() { + if (which() != Event::NAV_THUMBNAIL) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::Thumbnail::Reader Event::Reader::getNavThumbnail() const { + KJ_IREQUIRE((which() == Event::NAV_THUMBNAIL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Thumbnail>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::Thumbnail::Builder Event::Builder::getNavThumbnail() { + KJ_IREQUIRE((which() == Event::NAV_THUMBNAIL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Thumbnail>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setNavThumbnail( ::cereal::Thumbnail::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_THUMBNAIL); + ::capnp::_::PointerHelpers< ::cereal::Thumbnail>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::Thumbnail::Builder Event::Builder::initNavThumbnail() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_THUMBNAIL); + return ::capnp::_::PointerHelpers< ::cereal::Thumbnail>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptNavThumbnail( + ::capnp::Orphan< ::cereal::Thumbnail>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::NAV_THUMBNAIL); + ::capnp::_::PointerHelpers< ::cereal::Thumbnail>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::Thumbnail> Event::Builder::disownNavThumbnail() { + KJ_IREQUIRE((which() == Event::NAV_THUMBNAIL), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::Thumbnail>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Event::Reader::isErrorLogMessage() const { + return which() == Event::ERROR_LOG_MESSAGE; +} +inline bool Event::Builder::isErrorLogMessage() { + return which() == Event::ERROR_LOG_MESSAGE; +} +inline bool Event::Reader::hasErrorLogMessage() const { + if (which() != Event::ERROR_LOG_MESSAGE) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasErrorLogMessage() { + if (which() != Event::ERROR_LOG_MESSAGE) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader Event::Reader::getErrorLogMessage() const { + KJ_IREQUIRE((which() == Event::ERROR_LOG_MESSAGE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder Event::Builder::getErrorLogMessage() { + KJ_IREQUIRE((which() == Event::ERROR_LOG_MESSAGE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setErrorLogMessage( ::capnp::Text::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ERROR_LOG_MESSAGE); + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder Event::Builder::initErrorLogMessage(unsigned int size) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ERROR_LOG_MESSAGE); + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Event::Builder::adoptErrorLogMessage( + ::capnp::Orphan< ::capnp::Text>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::ERROR_LOG_MESSAGE); + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> Event::Builder::disownErrorLogMessage() { + KJ_IREQUIRE((which() == Event::ERROR_LOG_MESSAGE), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +} // namespace + diff --git a/cereal/include/c++.capnp b/cereal/include/c++.capnp new file mode 100644 index 000000000..2bda54717 --- /dev/null +++ b/cereal/include/c++.capnp @@ -0,0 +1,26 @@ +# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors +# Licensed under the MIT License: +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +@0xbdf87d7bb8304e81; +$namespace("capnp::annotations"); + +annotation namespace(file): Text; +annotation name(field, enumerant, struct, enum, interface, method, param, group, union): Text; diff --git a/cereal/legacy.capnp b/cereal/legacy.capnp new file mode 100644 index 000000000..9a4891681 --- /dev/null +++ b/cereal/legacy.capnp @@ -0,0 +1,861 @@ +using Cxx = import "./include/c++.capnp"; +$Cxx.namespace("cereal"); + +@0x80ef1ec4889c2a63; + +# legacy.capnp: a home for deprecated structs + +struct LogRotate @0x9811e1f38f62f2d1 { + segmentNum @0 :Int32; + path @1 :Text; +} + +struct LiveUI @0xc08240f996aefced { + rearViewCam @0 :Bool; + alertText1 @1 :Text; + alertText2 @2 :Text; + awarenessStatus @3 :Float32; +} + +struct UiLayoutState @0x88dcce08ad29dda0 { + activeApp @0 :App; + sidebarCollapsed @1 :Bool; + mapEnabled @2 :Bool; + mockEngaged @3 :Bool; + + enum App @0x9917470acf94d285 { + home @0; + music @1; + nav @2; + settings @3; + none @4; + } +} + +struct OrbslamCorrection @0x8afd33dc9b35e1aa { + correctionMonoTime @0 :UInt64; + prePositionECEF @1 :List(Float64); + postPositionECEF @2 :List(Float64); + prePoseQuatECEF @3 :List(Float32); + postPoseQuatECEF @4 :List(Float32); + numInliers @5 :UInt32; +} + +struct EthernetPacket @0xa99a9d5b33cf5859 { + pkt @0 :Data; + ts @1 :Float32; +} + +struct CellInfo @0xcff7566681c277ce { + timestamp @0 :UInt64; + repr @1 :Text; # android toString() for now +} + +struct WifiScan @0xd4df5a192382ba0b { + bssid @0 :Text; + ssid @1 :Text; + capabilities @2 :Text; + frequency @3 :Int32; + level @4 :Int32; + timestamp @5 :Int64; + + centerFreq0 @6 :Int32; + centerFreq1 @7 :Int32; + channelWidth @8 :ChannelWidth; + operatorFriendlyName @9 :Text; + venueName @10 :Text; + is80211mcResponder @11 :Bool; + passpoint @12 :Bool; + + distanceCm @13 :Int32; + distanceSdCm @14 :Int32; + + enum ChannelWidth @0xcb6a279f015f6b51 { + w20Mhz @0; + w40Mhz @1; + w80Mhz @2; + w160Mhz @3; + w80Plus80Mhz @4; + } +} + +struct LiveEventData @0x94b7baa90c5c321e { + name @0 :Text; + value @1 :Int32; +} + +struct ModelData @0xb8aad62cffef28a9 { + frameId @0 :UInt32; + frameAge @12 :UInt32; + frameDropPerc @13 :Float32; + timestampEof @9 :UInt64; + modelExecutionTime @14 :Float32; + gpuExecutionTime @16 :Float32; + rawPred @15 :Data; + + path @1 :PathData; + leftLane @2 :PathData; + rightLane @3 :PathData; + lead @4 :LeadData; + freePath @6 :List(Float32); + + settings @5 :ModelSettings; + leadFuture @7 :LeadData; + speed @8 :List(Float32); + meta @10 :MetaData; + longitudinal @11 :LongitudinalData; + + struct PathData @0x8817eeea389e9f08 { + points @0 :List(Float32); + prob @1 :Float32; + std @2 :Float32; + stds @3 :List(Float32); + poly @4 :List(Float32); + validLen @5 :Float32; + } + + struct LeadData @0xd1c9bef96d26fa91 { + dist @0 :Float32; + prob @1 :Float32; + std @2 :Float32; + relVel @3 :Float32; + relVelStd @4 :Float32; + relY @5 :Float32; + relYStd @6 :Float32; + relA @7 :Float32; + relAStd @8 :Float32; + } + + struct ModelSettings @0xa26e3710efd3e914 { + bigBoxX @0 :UInt16; + bigBoxY @1 :UInt16; + bigBoxWidth @2 :UInt16; + bigBoxHeight @3 :UInt16; + boxProjection @4 :List(Float32); + yuvCorrection @5 :List(Float32); + inputTransform @6 :List(Float32); + } + + struct MetaData @0x9744f25fb60f2bf8 { + engagedProb @0 :Float32; + desirePrediction @1 :List(Float32); + brakeDisengageProb @2 :Float32; + gasDisengageProb @3 :Float32; + steerOverrideProb @4 :Float32; + desireState @5 :List(Float32); + } + + struct LongitudinalData @0xf98f999c6a071122 { + distances @2 :List(Float32); + speeds @0 :List(Float32); + accelerations @1 :List(Float32); + } +} + +struct ECEFPoint @0xc25bbbd524983447 { + x @0 :Float64; + y @1 :Float64; + z @2 :Float64; +} + +struct ECEFPointDEPRECATED @0xe10e21168db0c7f7 { + x @0 :Float32; + y @1 :Float32; + z @2 :Float32; +} + +struct GPSPlannerPoints @0xab54c59699f8f9f3 { + curPosDEPRECATED @0 :ECEFPointDEPRECATED; + pointsDEPRECATED @1 :List(ECEFPointDEPRECATED); + curPos @6 :ECEFPoint; + points @7 :List(ECEFPoint); + valid @2 :Bool; + trackName @3 :Text; + speedLimit @4 :Float32; + accelTarget @5 :Float32; +} + +struct GPSPlannerPlan @0xf5ad1d90cdc1dd6b { + valid @0 :Bool; + poly @1 :List(Float32); + trackName @2 :Text; + speed @3 :Float32; + acceleration @4 :Float32; + pointsDEPRECATED @5 :List(ECEFPointDEPRECATED); + points @6 :List(ECEFPoint); + xLookahead @7 :Float32; +} + +struct UiNavigationEvent @0x90c8426c3eaddd3b { + type @0: Type; + status @1: Status; + distanceTo @2: Float32; + endRoadPointDEPRECATED @3: ECEFPointDEPRECATED; + endRoadPoint @4: ECEFPoint; + + enum Type @0xe8db07dcf8fcea05 { + none @0; + laneChangeLeft @1; + laneChangeRight @2; + mergeLeft @3; + mergeRight @4; + turnLeft @5; + turnRight @6; + } + + enum Status @0xb9aa88c75ef99a1f { + none @0; + passive @1; + approaching @2; + active @3; + } +} + +struct LiveLocationData @0xb99b2bc7a57e8128 { + status @0 :UInt8; + + # 3D fix + lat @1 :Float64; + lon @2 :Float64; + alt @3 :Float32; # m + + # speed + speed @4 :Float32; # m/s + + # NED velocity components + vNED @5 :List(Float32); + + # roll, pitch, heading (x,y,z) + roll @6 :Float32; # WRT to center of earth? + pitch @7 :Float32; # WRT to center of earth? + heading @8 :Float32; # WRT to north? + + # what are these? + wanderAngle @9 :Float32; + trackAngle @10 :Float32; + + # car frame -- https://upload.wikimedia.org/wikipedia/commons/f/f5/RPY_angles_of_cars.png + + # gyro, in car frame, deg/s + gyro @11 :List(Float32); + + # accel, in car frame, m/s^2 + accel @12 :List(Float32); + + accuracy @13 :Accuracy; + + source @14 :SensorSource; + # if we are fixing a location in the past + fixMonoTime @15 :UInt64; + + gpsWeek @16 :Int32; + timeOfWeek @17 :Float64; + + positionECEF @18 :List(Float64); + poseQuatECEF @19 :List(Float32); + pitchCalibration @20 :Float32; + yawCalibration @21 :Float32; + imuFrame @22 :List(Float32); + + struct Accuracy @0x943dc4625473b03f { + pNEDError @0 :List(Float32); + vNEDError @1 :List(Float32); + rollError @2 :Float32; + pitchError @3 :Float32; + headingError @4 :Float32; + ellipsoidSemiMajorError @5 :Float32; + ellipsoidSemiMinorError @6 :Float32; + ellipsoidOrientationError @7 :Float32; + } + + enum SensorSource @0xc871d3cc252af657 { + applanix @0; + kalman @1; + orbslam @2; + timing @3; + dummy @4; + } +} + +struct OrbOdometry @0xd7700859ed1f5b76 { + # timing first + startMonoTime @0 :UInt64; + endMonoTime @1 :UInt64; + + # fundamental matrix and error + f @2: List(Float64); + err @3: Float64; + + # number of inlier points + inliers @4: Int32; + + # for debug only + # indexed by endMonoTime features + # value is startMonoTime feature match + # -1 if no match + matches @5: List(Int16); +} + +struct OrbFeatures @0xcd60164a8a0159ef { + timestampEof @0 :UInt64; + # transposed arrays of normalized image coordinates + # len(xs) == len(ys) == len(descriptors) * 32 + xs @1 :List(Float32); + ys @2 :List(Float32); + descriptors @3 :Data; + octaves @4 :List(Int8); + + # match index to last OrbFeatures + # -1 if no match + timestampLastEof @5 :UInt64; + matches @6: List(Int16); +} + +struct OrbFeaturesSummary @0xd500d30c5803fa4f { + timestampEof @0 :UInt64; + timestampLastEof @1 :UInt64; + + featureCount @2 :UInt16; + matchCount @3 :UInt16; + computeNs @4 :UInt64; +} + +struct OrbKeyFrame @0xc8233c0345e27e24 { + # this is a globally unique id for the KeyFrame + id @0: UInt64; + + # this is the location of the KeyFrame + pos @1: ECEFPoint; + + # these are the features in the world + # len(dpos) == len(descriptors) * 32 + dpos @2 :List(ECEFPoint); + descriptors @3 :Data; +} + +struct KalmanOdometry @0x92e21bb7ea38793a { + trans @0 :List(Float32); # m/s in device frame + rot @1 :List(Float32); # rad/s in device frame + transStd @2 :List(Float32); # std m/s in device frame + rotStd @3 :List(Float32); # std rad/s in device frame +} + +struct OrbObservation @0x9b326d4e436afec7 { + observationMonoTime @0 :UInt64; + normalizedCoordinates @1 :List(Float32); + locationECEF @2 :List(Float64); + matchDistance @3: UInt32; +} + +struct CalibrationFeatures @0x8fdfadb254ea867a { + frameId @0 :UInt32; + + p0 @1 :List(Float32); + p1 @2 :List(Float32); + status @3 :List(Int8); +} + +struct NavStatus @0xbd8822120928120c { + isNavigating @0 :Bool; + currentAddress @1 :Address; + + struct Address @0xce7cd672cacc7814 { + title @0 :Text; + lat @1 :Float64; + lng @2 :Float64; + house @3 :Text; + address @4 :Text; + street @5 :Text; + city @6 :Text; + state @7 :Text; + country @8 :Text; + } +} + +struct NavUpdate @0xdb98be6565516acb { + isNavigating @0 :Bool; + curSegment @1 :Int32; + segments @2 :List(Segment); + + struct LatLng @0x9eaef9187cadbb9b { + lat @0 :Float64; + lng @1 :Float64; + } + + struct Segment @0xa5b39b4fc4d7da3f { + from @0 :LatLng; + to @1 :LatLng; + updateTime @2 :Int32; + distance @3 :Int32; + crossTime @4 :Int32; + exitNo @5 :Int32; + instruction @6 :Instruction; + + parts @7 :List(LatLng); + + enum Instruction @0xc5417a637451246f { + turnLeft @0; + turnRight @1; + keepLeft @2; + keepRight @3; + straight @4; + roundaboutExitNumber @5; + roundaboutExit @6; + roundaboutTurnLeft @7; + unkn8 @8; + roundaboutStraight @9; + unkn10 @10; + roundaboutTurnRight @11; + unkn12 @12; + roundaboutUturn @13; + unkn14 @14; + arrive @15; + exitLeft @16; + exitRight @17; + unkn18 @18; + uturn @19; + # ... + } + } +} + +struct TrafficEvent @0xacfa74a094e62626 { + type @0 :Type; + distance @1 :Float32; + action @2 :Action; + resuming @3 :Bool; + + enum Type @0xd85d75253435bf4b { + stopSign @0; + lightRed @1; + lightYellow @2; + lightGreen @3; + stopLight @4; + } + + enum Action @0xa6f6ce72165ccb49 { + none @0; + yield @1; + stop @2; + resumeReady @3; + } + +} + + +struct AndroidGnss @0xdfdf30d03fc485bd { + union { + measurements @0 :Measurements; + navigationMessage @1 :NavigationMessage; + } + + struct Measurements @0xa20710d4f428d6cd { + clock @0 :Clock; + measurements @1 :List(Measurement); + + struct Clock @0xa0e27b453a38f450 { + timeNanos @0 :Int64; + hardwareClockDiscontinuityCount @1 :Int32; + + hasTimeUncertaintyNanos @2 :Bool; + timeUncertaintyNanos @3 :Float64; + + hasLeapSecond @4 :Bool; + leapSecond @5 :Int32; + + hasFullBiasNanos @6 :Bool; + fullBiasNanos @7 :Int64; + + hasBiasNanos @8 :Bool; + biasNanos @9 :Float64; + + hasBiasUncertaintyNanos @10 :Bool; + biasUncertaintyNanos @11 :Float64; + + hasDriftNanosPerSecond @12 :Bool; + driftNanosPerSecond @13 :Float64; + + hasDriftUncertaintyNanosPerSecond @14 :Bool; + driftUncertaintyNanosPerSecond @15 :Float64; + } + + struct Measurement @0xd949bf717d77614d { + svId @0 :Int32; + constellation @1 :Constellation; + + timeOffsetNanos @2 :Float64; + state @3 :Int32; + receivedSvTimeNanos @4 :Int64; + receivedSvTimeUncertaintyNanos @5 :Int64; + cn0DbHz @6 :Float64; + pseudorangeRateMetersPerSecond @7 :Float64; + pseudorangeRateUncertaintyMetersPerSecond @8 :Float64; + accumulatedDeltaRangeState @9 :Int32; + accumulatedDeltaRangeMeters @10 :Float64; + accumulatedDeltaRangeUncertaintyMeters @11 :Float64; + + hasCarrierFrequencyHz @12 :Bool; + carrierFrequencyHz @13 :Float32; + hasCarrierCycles @14 :Bool; + carrierCycles @15 :Int64; + hasCarrierPhase @16 :Bool; + carrierPhase @17 :Float64; + hasCarrierPhaseUncertainty @18 :Bool; + carrierPhaseUncertainty @19 :Float64; + hasSnrInDb @20 :Bool; + snrInDb @21 :Float64; + + multipathIndicator @22 :MultipathIndicator; + + enum Constellation @0x9ef1f3ff0deb5ffb { + unknown @0; + gps @1; + sbas @2; + glonass @3; + qzss @4; + beidou @5; + galileo @6; + } + + enum State @0xcbb9490adce12d72 { + unknown @0; + codeLock @1; + bitSync @2; + subframeSync @3; + towDecoded @4; + msecAmbiguous @5; + symbolSync @6; + gloStringSync @7; + gloTodDecoded @8; + bdsD2BitSync @9; + bdsD2SubframeSync @10; + galE1bcCodeLock @11; + galE1c2ndCodeLock @12; + galE1bPageSync @13; + sbasSync @14; + } + + enum MultipathIndicator @0xc04e7b6231d4caa8 { + unknown @0; + detected @1; + notDetected @2; + } + } + } + + struct NavigationMessage @0xe2517b083095fd4e { + type @0 :Int32; + svId @1 :Int32; + messageId @2 :Int32; + submessageId @3 :Int32; + data @4 :Data; + status @5 :Status; + + enum Status @0xec1ff7996b35366f { + unknown @0; + parityPassed @1; + parityRebuilt @2; + } + } +} + +struct QcomGnss @0xde94674b07ae51c1 { + logTs @0 :UInt64; + union { + measurementReport @1 :MeasurementReport; + clockReport @2 :ClockReport; + drMeasurementReport @3 :DrMeasurementReport; + drSvPoly @4 :DrSvPolyReport; + rawLog @5 :Data; + } + + enum MeasurementSource @0xd71a12b6faada7ee { + gps @0; + glonass @1; + beidou @2; + } + + enum SVObservationState @0xe81e829a0d6c83e9 { + idle @0; + search @1; + searchVerify @2; + bitEdge @3; + trackVerify @4; + track @5; + restart @6; + dpo @7; + glo10msBe @8; + glo10msAt @9; + } + + struct MeasurementStatus @0xe501010e1bcae83b { + subMillisecondIsValid @0 :Bool; + subBitTimeIsKnown @1 :Bool; + satelliteTimeIsKnown @2 :Bool; + bitEdgeConfirmedFromSignal @3 :Bool; + measuredVelocity @4 :Bool; + fineOrCoarseVelocity @5 :Bool; + lockPointValid @6 :Bool; + lockPointPositive @7 :Bool; + lastUpdateFromDifference @8 :Bool; + lastUpdateFromVelocityDifference @9 :Bool; + strongIndicationOfCrossCorelation @10 :Bool; + tentativeMeasurement @11 :Bool; + measurementNotUsable @12 :Bool; + sirCheckIsNeeded @13 :Bool; + probationMode @14 :Bool; + + glonassMeanderBitEdgeValid @15 :Bool; + glonassTimeMarkValid @16 :Bool; + + gpsRoundRobinRxDiversity @17 :Bool; + gpsRxDiversity @18 :Bool; + gpsLowBandwidthRxDiversityCombined @19 :Bool; + gpsHighBandwidthNu4 @20 :Bool; + gpsHighBandwidthNu8 @21 :Bool; + gpsHighBandwidthUniform @22 :Bool; + multipathIndicator @23 :Bool; + + imdJammingIndicator @24 :Bool; + lteB13TxJammingIndicator @25 :Bool; + freshMeasurementIndicator @26 :Bool; + + multipathEstimateIsValid @27 :Bool; + directionIsValid @28 :Bool; + } + + struct MeasurementReport @0xf580d7d86b7b8692 { + source @0 :MeasurementSource; + + fCount @1 :UInt32; + + gpsWeek @2 :UInt16; + glonassCycleNumber @3 :UInt8; + glonassNumberOfDays @4 :UInt16; + + milliseconds @5 :UInt32; + timeBias @6 :Float32; + clockTimeUncertainty @7 :Float32; + clockFrequencyBias @8 :Float32; + clockFrequencyUncertainty @9 :Float32; + + sv @10 :List(SV); + + struct SV @0xf10c595ae7bb2c27 { + svId @0 :UInt8; + observationState @2 :SVObservationState; + observations @3 :UInt8; + goodObservations @4 :UInt8; + gpsParityErrorCount @5 :UInt16; + glonassFrequencyIndex @1 :Int8; + glonassHemmingErrorCount @6 :UInt8; + filterStages @7 :UInt8; + carrierNoise @8 :UInt16; + latency @9 :Int16; + predetectInterval @10 :UInt8; + postdetections @11 :UInt16; + + unfilteredMeasurementIntegral @12 :UInt32; + unfilteredMeasurementFraction @13 :Float32; + unfilteredTimeUncertainty @14 :Float32; + unfilteredSpeed @15 :Float32; + unfilteredSpeedUncertainty @16 :Float32; + measurementStatus @17 :MeasurementStatus; + multipathEstimate @18 :UInt32; + azimuth @19 :Float32; + elevation @20 :Float32; + carrierPhaseCyclesIntegral @21 :Int32; + carrierPhaseCyclesFraction @22 :UInt16; + fineSpeed @23 :Float32; + fineSpeedUncertainty @24 :Float32; + cycleSlipCount @25 :UInt8; + } + + } + + struct ClockReport @0xca965e4add8f4f0b { + hasFCount @0 :Bool; + fCount @1 :UInt32; + + hasGpsWeek @2 :Bool; + gpsWeek @3 :UInt16; + hasGpsMilliseconds @4 :Bool; + gpsMilliseconds @5 :UInt32; + gpsTimeBias @6 :Float32; + gpsClockTimeUncertainty @7 :Float32; + gpsClockSource @8 :UInt8; + + hasGlonassYear @9 :Bool; + glonassYear @10 :UInt8; + hasGlonassDay @11 :Bool; + glonassDay @12 :UInt16; + hasGlonassMilliseconds @13 :Bool; + glonassMilliseconds @14 :UInt32; + glonassTimeBias @15 :Float32; + glonassClockTimeUncertainty @16 :Float32; + glonassClockSource @17 :UInt8; + + bdsWeek @18 :UInt16; + bdsMilliseconds @19 :UInt32; + bdsTimeBias @20 :Float32; + bdsClockTimeUncertainty @21 :Float32; + bdsClockSource @22 :UInt8; + + galWeek @23 :UInt16; + galMilliseconds @24 :UInt32; + galTimeBias @25 :Float32; + galClockTimeUncertainty @26 :Float32; + galClockSource @27 :UInt8; + + clockFrequencyBias @28 :Float32; + clockFrequencyUncertainty @29 :Float32; + frequencySource @30 :UInt8; + gpsLeapSeconds @31 :UInt8; + gpsLeapSecondsUncertainty @32 :UInt8; + gpsLeapSecondsSource @33 :UInt8; + + gpsToGlonassTimeBiasMilliseconds @34 :Float32; + gpsToGlonassTimeBiasMillisecondsUncertainty @35 :Float32; + gpsToBdsTimeBiasMilliseconds @36 :Float32; + gpsToBdsTimeBiasMillisecondsUncertainty @37 :Float32; + bdsToGloTimeBiasMilliseconds @38 :Float32; + bdsToGloTimeBiasMillisecondsUncertainty @39 :Float32; + gpsToGalTimeBiasMilliseconds @40 :Float32; + gpsToGalTimeBiasMillisecondsUncertainty @41 :Float32; + galToGloTimeBiasMilliseconds @42 :Float32; + galToGloTimeBiasMillisecondsUncertainty @43 :Float32; + galToBdsTimeBiasMilliseconds @44 :Float32; + galToBdsTimeBiasMillisecondsUncertainty @45 :Float32; + + hasRtcTime @46 :Bool; + systemRtcTime @47 :UInt32; + fCountOffset @48 :UInt32; + lpmRtcCount @49 :UInt32; + clockResets @50 :UInt32; + } + + struct DrMeasurementReport @0x8053c39445c6c75c { + + reason @0 :UInt8; + seqNum @1 :UInt8; + seqMax @2 :UInt8; + rfLoss @3 :UInt16; + + systemRtcValid @4 :Bool; + fCount @5 :UInt32; + clockResets @6 :UInt32; + systemRtcTime @7 :UInt64; + + gpsLeapSeconds @8 :UInt8; + gpsLeapSecondsUncertainty @9 :UInt8; + gpsToGlonassTimeBiasMilliseconds @10 :Float32; + gpsToGlonassTimeBiasMillisecondsUncertainty @11 :Float32; + + gpsWeek @12 :UInt16; + gpsMilliseconds @13 :UInt32; + gpsTimeBiasMs @14 :UInt32; + gpsClockTimeUncertaintyMs @15 :UInt32; + gpsClockSource @16 :UInt8; + + glonassClockSource @17 :UInt8; + glonassYear @18 :UInt8; + glonassDay @19 :UInt16; + glonassMilliseconds @20 :UInt32; + glonassTimeBias @21 :Float32; + glonassClockTimeUncertainty @22 :Float32; + + clockFrequencyBias @23 :Float32; + clockFrequencyUncertainty @24 :Float32; + frequencySource @25 :UInt8; + + source @26 :MeasurementSource; + + sv @27 :List(SV); + + struct SV @0xf08b81df8cbf459c { + svId @0 :UInt8; + glonassFrequencyIndex @1 :Int8; + observationState @2 :SVObservationState; + observations @3 :UInt8; + goodObservations @4 :UInt8; + filterStages @5 :UInt8; + predetectInterval @6 :UInt8; + cycleSlipCount @7 :UInt8; + postdetections @8 :UInt16; + + measurementStatus @9 :MeasurementStatus; + + carrierNoise @10 :UInt16; + rfLoss @11 :UInt16; + latency @12 :Int16; + + filteredMeasurementFraction @13 :Float32; + filteredMeasurementIntegral @14 :UInt32; + filteredTimeUncertainty @15 :Float32; + filteredSpeed @16 :Float32; + filteredSpeedUncertainty @17 :Float32; + + unfilteredMeasurementFraction @18 :Float32; + unfilteredMeasurementIntegral @19 :UInt32; + unfilteredTimeUncertainty @20 :Float32; + unfilteredSpeed @21 :Float32; + unfilteredSpeedUncertainty @22 :Float32; + + multipathEstimate @23 :UInt32; + azimuth @24 :Float32; + elevation @25 :Float32; + dopplerAcceleration @26 :Float32; + fineSpeed @27 :Float32; + fineSpeedUncertainty @28 :Float32; + + carrierPhase @29 :Float64; + fCount @30 :UInt32; + + parityErrorCount @31 :UInt16; + goodParity @32 :Bool; + } + } + + struct DrSvPolyReport @0xb1fb80811a673270 { + svId @0 :UInt16; + frequencyIndex @1 :Int8; + + hasPosition @2 :Bool; + hasIono @3 :Bool; + hasTropo @4 :Bool; + hasElevation @5 :Bool; + polyFromXtra @6 :Bool; + hasSbasIono @7 :Bool; + + iode @8 :UInt16; + t0 @9 :Float64; + xyz0 @10 :List(Float64); + xyzN @11 :List(Float64); + other @12 :List(Float32); + + positionUncertainty @13 :Float32; + ionoDelay @14 :Float32; + ionoDot @15 :Float32; + sbasIonoDelay @16 :Float32; + sbasIonoDot @17 :Float32; + tropoDelay @18 :Float32; + elevation @19 :Float32; + elevationDot @20 :Float32; + elevationUncertainty @21 :Float32; + velocityCoeff @22 :List(Float64); + } +} + +struct LidarPts @0xe3d6685d4e9d8f7a { + r @0 :List(UInt16); # uint16 m*500.0 + theta @1 :List(UInt16); # uint16 deg*100.0 + reflect @2 :List(UInt8); # uint8 0-255 + + # For storing out of file. + idx @3 :UInt64; + + # For storing in file + pkt @4 :Data; +} + + diff --git a/cereal/libcereal_shared.so b/cereal/libcereal_shared.so new file mode 100755 index 000000000..3844c10ea Binary files /dev/null and b/cereal/libcereal_shared.so differ diff --git a/cereal/log.capnp b/cereal/log.capnp new file mode 100644 index 000000000..6f4f43939 --- /dev/null +++ b/cereal/log.capnp @@ -0,0 +1,1540 @@ +using Cxx = import "./include/c++.capnp"; +$Cxx.namespace("cereal"); + +using Car = import "car.capnp"; +using Legacy = import "legacy.capnp"; + +@0xf3b1f17e25a4285b; + +const logVersion :Int32 = 1; + +struct Map(Key, Value) { + entries @0 :List(Entry); + struct Entry { + key @0 :Key; + value @1 :Value; + } +} + +struct InitData { + kernelArgs @0 :List(Text); + kernelVersion @15 :Text; + osVersion @18 :Text; + + dongleId @2 :Text; + + deviceType @3 :DeviceType; + version @4 :Text; + gitCommit @10 :Text; + gitBranch @11 :Text; + gitRemote @13 :Text; + + androidProperties @16 :Map(Text, Text); + + pandaInfo @8 :PandaInfo; + + dirty @9 :Bool; + passive @12 :Bool; + params @17 :Map(Text, Data); + + enum DeviceType { + unknown @0; + neo @1; + chffrAndroid @2; + chffrIos @3; + tici @4; + pc @5; + } + + struct PandaInfo { + hasPanda @0 :Bool; + dongleId @1 :Text; + stVersion @2 :Text; + espVersion @3 :Text; + } + + # ***** deprecated stuff ***** + gctxDEPRECATED @1 :Text; + androidBuildInfo @5 :AndroidBuildInfo; + androidSensorsDEPRECATED @6 :List(AndroidSensor); + chffrAndroidExtraDEPRECATED @7 :ChffrAndroidExtra; + iosBuildInfoDEPRECATED @14 :IosBuildInfo; + + struct AndroidBuildInfo { + board @0 :Text; + bootloader @1 :Text; + brand @2 :Text; + device @3 :Text; + display @4 :Text; + fingerprint @5 :Text; + hardware @6 :Text; + host @7 :Text; + id @8 :Text; + manufacturer @9 :Text; + model @10 :Text; + product @11 :Text; + radioVersion @12 :Text; + serial @13 :Text; + supportedAbis @14 :List(Text); + tags @15 :Text; + time @16 :Int64; + type @17 :Text; + user @18 :Text; + + versionCodename @19 :Text; + versionRelease @20 :Text; + versionSdk @21 :Int32; + versionSecurityPatch @22 :Text; + } + + struct AndroidSensor { + id @0 :Int32; + name @1 :Text; + vendor @2 :Text; + version @3 :Int32; + handle @4 :Int32; + type @5 :Int32; + maxRange @6 :Float32; + resolution @7 :Float32; + power @8 :Float32; + minDelay @9 :Int32; + fifoReservedEventCount @10 :UInt32; + fifoMaxEventCount @11 :UInt32; + stringType @12 :Text; + maxDelay @13 :Int32; + } + + struct ChffrAndroidExtra { + allCameraCharacteristics @0 :Map(Text, Text); + } + + struct IosBuildInfo { + appVersion @0 :Text; + appBuild @1 :UInt32; + osVersion @2 :Text; + deviceModel @3 :Text; + } +} + +struct FrameData { + frameId @0 :UInt32; + encodeId @1 :UInt32; # DEPRECATED + + frameType @7 :FrameType; + frameLength @3 :Int32; + + # Timestamps + timestampEof @2 :UInt64; + timestampSof @8 :UInt64; + + # Exposure + integLines @4 :Int32; + highConversionGain @20 :Bool; + gain @15 :Float32; # This includes highConversionGain if enabled + measuredGreyFraction @21 :Float32; + targetGreyFraction @22 :Float32; + + # Focus + lensPos @11 :Int32; + lensSag @12 :Float32; + lensErr @13 :Float32; + lensTruePos @14 :Float32; + focusVal @16 :List(Int16); + focusConf @17 :List(UInt8); + sharpnessScore @18 :List(UInt16); + recoverState @19 :Int32; + + transform @10 :List(Float32); + + androidCaptureResult @9 :AndroidCaptureResult; + + image @6 :Data; + globalGainDEPRECATED @5 :Int32; + + enum FrameType { + unknown @0; + neo @1; + chffrAndroid @2; + front @3; + } + + struct AndroidCaptureResult { + sensitivity @0 :Int32; + frameDuration @1 :Int64; + exposureTime @2 :Int64; + rollingShutterSkew @3 :UInt64; + colorCorrectionTransform @4 :List(Int32); + colorCorrectionGains @5 :List(Float32); + displayRotation @6 :Int8; + } +} + +struct Thumbnail { + frameId @0 :UInt32; + timestampEof @1 :UInt64; + thumbnail @2 :Data; +} + +struct GPSNMEAData { + timestamp @0 :Int64; + localWallTime @1 :UInt64; + nmea @2 :Text; +} + +# android sensor_event_t +struct SensorEventData { + version @0 :Int32; + sensor @1 :Int32; + type @2 :Int32; + timestamp @3 :Int64; + uncalibratedDEPRECATED @10 :Bool; + + union { + acceleration @4 :SensorVec; + magnetic @5 :SensorVec; + orientation @6 :SensorVec; + gyro @7 :SensorVec; + pressure @9 :SensorVec; + magneticUncalibrated @11 :SensorVec; + gyroUncalibrated @12 :SensorVec; + proximity @13: Float32; + light @14: Float32; + temperature @15: Float32; + } + source @8 :SensorSource; + + struct SensorVec { + v @0 :List(Float32); + status @1 :Int8; + } + + enum SensorSource { + android @0; + iOS @1; + fiber @2; + velodyne @3; # Velodyne IMU + bno055 @4; # Bosch accelerometer + lsm6ds3 @5; # accelerometer (c2) + bmp280 @6; # barometer (c2) + mmc3416x @7; # magnetometer (c2) + bmx055 @8; + rpr0521 @9; + lsm6ds3trc @10; + mmc5603nj @11; + } +} + +# android struct GpsLocation +struct GpsLocationData { + # Contains GpsLocationFlags bits. + flags @0 :UInt16; + + # Represents latitude in degrees. + latitude @1 :Float64; + + # Represents longitude in degrees. + longitude @2 :Float64; + + # Represents altitude in meters above the WGS 84 reference ellipsoid. + altitude @3 :Float64; + + # Represents speed in meters per second. + speed @4 :Float32; + + # Represents heading in degrees. + bearingDeg @5 :Float32; + + # Represents expected accuracy in meters. (presumably 1 sigma?) + accuracy @6 :Float32; + + # Timestamp for the location fix. + # Milliseconds since January 1, 1970. + timestamp @7 :Int64; + + source @8 :SensorSource; + + # Represents NED velocity in m/s. + vNED @9 :List(Float32); + + # Represents expected vertical accuracy in meters. (presumably 1 sigma?) + verticalAccuracy @10 :Float32; + + # Represents bearing accuracy in degrees. (presumably 1 sigma?) + bearingAccuracyDeg @11 :Float32; + + # Represents velocity accuracy in m/s. (presumably 1 sigma?) + speedAccuracy @12 :Float32; + + enum SensorSource { + android @0; + iOS @1; + car @2; + velodyne @3; # Velodyne IMU + fusion @4; + external @5; + ublox @6; + trimble @7; + } +} + +struct CanData { + address @0 :UInt32; + busTime @1 :UInt16; + dat @2 :Data; + src @3 :UInt8; +} + +struct DeviceState @0xa4d8b5af2aa492eb { + usbOnline @12 :Bool; + networkType @22 :NetworkType; + networkInfo @31 :NetworkInfo; + networkStrength @24 :NetworkStrength; + lastAthenaPingTime @32 :UInt64; + + started @11 :Bool; + startedMonoTime @13 :UInt64; + + # system utilization + freeSpacePercent @7 :Float32; + memoryUsagePercent @19 :Int8; + gpuUsagePercent @33 :Int8; + cpuUsagePercent @34 :List(Int8); # per-core cpu usage + + # power + batteryPercent @8 :Int16; + batteryCurrent @15 :Int32; + chargingError @17 :Bool; + chargingDisabled @18 :Bool; + offroadPowerUsageUwh @23 :UInt32; + carBatteryCapacityUwh @25 :UInt32; + powerDrawW @40 :Float32; + + # device thermals + cpuTempC @26 :List(Float32); + gpuTempC @27 :List(Float32); + memoryTempC @28 :Float32; + ambientTempC @30 :Float32; + nvmeTempC @35 :List(Float32); + modemTempC @36 :List(Float32); + pmicTempC @39 :List(Float32); + thermalZones @38 :List(ThermalZone); + thermalStatus @14 :ThermalStatus; + + fanSpeedPercentDesired @10 :UInt16; + screenBrightnessPercent @37 :Int8; + + struct ThermalZone { + name @0 :Text; + temp @1 :Float32; + } + + enum ThermalStatus { + green @0; + yellow @1; + red @2; + danger @3; + } + + enum NetworkType { + none @0; + wifi @1; + cell2G @2; + cell3G @3; + cell4G @4; + cell5G @5; + ethernet @6; + } + + enum NetworkStrength { + unknown @0; + poor @1; + moderate @2; + good @3; + great @4; + } + + struct NetworkInfo { + technology @0 :Text; + operator @1 :Text; + band @2 :Text; + channel @3 :UInt16; + extra @4 :Text; + state @5 :Text; + } + + # deprecated + cpu0DEPRECATED @0 :UInt16; + cpu1DEPRECATED @1 :UInt16; + cpu2DEPRECATED @2 :UInt16; + cpu3DEPRECATED @3 :UInt16; + memDEPRECATED @4 :UInt16; + gpuDEPRECATED @5 :UInt16; + batDEPRECATED @6 :UInt32; + pa0DEPRECATED @21 :UInt16; + cpuUsagePercentDEPRECATED @20 :Int8; + batteryStatusDEPRECATED @9 :Text; + batteryVoltageDEPRECATED @16 :Int32; + batteryTempCDEPRECATED @29 :Float32; +} + +struct PandaState @0xa7649e2575e4591e { + ignitionLine @2 :Bool; + controlsAllowed @3 :Bool; + gasInterceptorDetected @4 :Bool; + canSendErrs @7 :UInt32; + canFwdErrs @8 :UInt32; + canRxErrs @19 :UInt32; + gmlanSendErrs @9 :UInt32; + pandaType @10 :PandaType; + ignitionCan @13 :Bool; + safetyModel @14 :Car.CarParams.SafetyModel; + safetyParam @20 :Int16; + unsafeMode @23 :Int16; + faultStatus @15 :FaultStatus; + powerSaveEnabled @16 :Bool; + uptime @17 :UInt32; + faults @18 :List(FaultType); + harnessStatus @21 :HarnessStatus; + heartbeatLost @22 :Bool; + blockedCnt @24 :UInt32; + + enum FaultStatus { + none @0; + faultTemp @1; + faultPerm @2; + } + + enum FaultType { + relayMalfunction @0; + unusedInterruptHandled @1; + interruptRateCan1 @2; + interruptRateCan2 @3; + interruptRateCan3 @4; + interruptRateTach @5; + interruptRateGmlan @6; + interruptRateInterrupts @7; + interruptRateSpiDma @8; + interruptRateSpiCs @9; + interruptRateUart1 @10; + interruptRateUart2 @11; + interruptRateUart3 @12; + interruptRateUart5 @13; + interruptRateUartDma @14; + interruptRateUsb @15; + interruptRateTim1 @16; + interruptRateTim3 @17; + registerDivergent @18; + interruptRateKlineInit @19; + interruptRateClockSource @20; + interruptRateTick @21; + # Update max fault type in boardd when adding faults + } + + enum PandaType @0x8a58adf93e5b3751 { + unknown @0; + whitePanda @1; + greyPanda @2; + blackPanda @3; + pedal @4; + uno @5; + dos @6; + redPanda @7; + } + + enum HarnessStatus { + notConnected @0; + normal @1; + flipped @2; + } + + startedSignalDetectedDEPRECATED @5 :Bool; + voltageDEPRECATED @0 :UInt32; + currentDEPRECATED @1 :UInt32; + hasGpsDEPRECATED @6 :Bool; + fanSpeedRpmDEPRECATED @11 :UInt16; + usbPowerModeDEPRECATED @12 :PeripheralState.UsbPowerMode; +} + +struct PeripheralState { + pandaType @0 :PandaState.PandaType; + voltage @1 :UInt32; + current @2 :UInt32; + fanSpeedRpm @3 :UInt16; + usbPowerMode @4 :UsbPowerMode; + + enum UsbPowerMode @0xa8883583b32c9877 { + none @0; + client @1; + cdp @2; + dcp @3; + } +} + +struct RadarState @0x9a185389d6fdd05f { + canMonoTimes @10 :List(UInt64); + mdMonoTime @6 :UInt64; + carStateMonoTime @11 :UInt64; + radarErrors @12 :List(Car.RadarData.Error); + + leadOne @3 :LeadData; + leadTwo @4 :LeadData; + cumLagMs @5 :Float32; + + struct LeadData { + dRel @0 :Float32; + yRel @1 :Float32; + vRel @2 :Float32; + aRel @3 :Float32; + vLead @4 :Float32; + dPath @6 :Float32; + vLat @7 :Float32; + vLeadK @8 :Float32; + aLeadK @9 :Float32; + fcw @10 :Bool; + status @11 :Bool; + aLeadTau @12 :Float32; + modelProb @13 :Float32; + radar @14 :Bool; + + aLeadDEPRECATED @5 :Float32; + } + + # deprecated + ftMonoTimeDEPRECATED @7 :UInt64; + warpMatrixDEPRECATED @0 :List(Float32); + angleOffsetDEPRECATED @1 :Float32; + calStatusDEPRECATED @2 :Int8; + calCycleDEPRECATED @8 :Int32; + calPercDEPRECATED @9 :Int8; +} + +struct LiveCalibrationData { + calStatus @1 :Int8; + calCycle @2 :Int32; + calPerc @3 :Int8; + validBlocks @9 :Int32; + + # view_frame_from_road_frame + # ui's is inversed needs new + extrinsicMatrix @4 :List(Float32); + # the direction of travel vector in device frame + rpyCalib @7 :List(Float32); + rpyCalibSpread @8 :List(Float32); + + warpMatrixDEPRECATED @0 :List(Float32); + warpMatrix2DEPRECATED @5 :List(Float32); + warpMatrixBigDEPRECATED @6 :List(Float32); +} + +struct LiveTracks { + trackId @0 :Int32; + dRel @1 :Float32; + yRel @2 :Float32; + vRel @3 :Float32; + aRel @4 :Float32; + timeStamp @5 :Float32; + status @6 :Float32; + currentTime @7 :Float32; + stationary @8 :Bool; + oncoming @9 :Bool; +} + +struct ControlsState @0x97ff69c53601abf1 { + startMonoTime @48 :UInt64; + canMonoTimes @21 :List(UInt64); + longitudinalPlanMonoTime @28 :UInt64; + lateralPlanMonoTime @50 :UInt64; + + state @31 :OpenpilotState; + enabled @19 :Bool; + active @36 :Bool; + + longControlState @30 :Car.CarControl.Actuators.LongControlState; + vPid @2 :Float32; + vTargetLead @3 :Float32; + vCruise @22 :Float32; + upAccelCmd @4 :Float32; + uiAccelCmd @5 :Float32; + ufAccelCmd @33 :Float32; + aTarget @35 :Float32; + curvature @37 :Float32; # path curvature from vehicle model + forceDecel @51 :Bool; + + # UI alerts + alertText1 @24 :Text; + alertText2 @25 :Text; + alertStatus @38 :AlertStatus; + alertSize @39 :AlertSize; + alertBlinkingRate @42 :Float32; + alertType @44 :Text; + alertSound @56 :Car.CarControl.HUDControl.AudibleAlert; + engageable @41 :Bool; # can OP be engaged? + + cumLagMs @15 :Float32; + canErrorCounter @57 :UInt32; + + lateralControlState :union { + indiState @52 :LateralINDIState; + pidState @53 :LateralPIDState; + lqrState @55 :LateralLQRState; + angleState @58 :LateralAngleState; + debugState @59 :LateralDebugState; + } + + enum OpenpilotState @0xdbe58b96d2d1ac61 { + disabled @0; + preEnabled @1; + enabled @2; + softDisabling @3; + } + + enum AlertStatus { + normal @0; # low priority alert for user's convenience + userPrompt @1; # mid priority alert that might require user intervention + critical @2; # high priority alert that needs immediate user intervention + } + + enum AlertSize { + none @0; # don't display the alert + small @1; # small box + mid @2; # mid screen + full @3; # full screen + } + + struct LateralINDIState { + active @0 :Bool; + steeringAngleDeg @1 :Float32; + steeringRateDeg @2 :Float32; + steeringAccelDeg @3 :Float32; + rateSetPoint @4 :Float32; + accelSetPoint @5 :Float32; + accelError @6 :Float32; + delayedOutput @7 :Float32; + delta @8 :Float32; + output @9 :Float32; + saturated @10 :Bool; + steeringAngleDesiredDeg @11 :Float32; + steeringRateDesiredDeg @12 :Float32; + } + + struct LateralPIDState { + active @0 :Bool; + steeringAngleDeg @1 :Float32; + steeringRateDeg @2 :Float32; + angleError @3 :Float32; + p @4 :Float32; + i @5 :Float32; + f @6 :Float32; + output @7 :Float32; + saturated @8 :Bool; + steeringAngleDesiredDeg @9 :Float32; + } + + struct LateralLQRState { + active @0 :Bool; + steeringAngleDeg @1 :Float32; + i @2 :Float32; + output @3 :Float32; + lqrOutput @4 :Float32; + saturated @5 :Bool; + steeringAngleDesiredDeg @6 :Float32; + } + + struct LateralAngleState { + active @0 :Bool; + steeringAngleDeg @1 :Float32; + output @2 :Float32; + saturated @3 :Bool; + steeringAngleDesiredDeg @4 :Float32; + } + + struct LateralDebugState { + active @0 :Bool; + steeringAngleDeg @1 :Float32; + output @2 :Float32; + saturated @3 :Bool; + } + + # deprecated + vEgoDEPRECATED @0 :Float32; + vEgoRawDEPRECATED @32 :Float32; + aEgoDEPRECATED @1 :Float32; + canMonoTimeDEPRECATED @16 :UInt64; + radarStateMonoTimeDEPRECATED @17 :UInt64; + mdMonoTimeDEPRECATED @18 :UInt64; + yActualDEPRECATED @6 :Float32; + yDesDEPRECATED @7 :Float32; + upSteerDEPRECATED @8 :Float32; + uiSteerDEPRECATED @9 :Float32; + ufSteerDEPRECATED @34 :Float32; + aTargetMinDEPRECATED @10 :Float32; + aTargetMaxDEPRECATED @11 :Float32; + rearViewCamDEPRECATED @23 :Bool; + driverMonitoringOnDEPRECATED @43 :Bool; + hudLeadDEPRECATED @14 :Int32; + alertSoundDEPRECATED @45 :Text; + angleModelBiasDEPRECATED @27 :Float32; + gpsPlannerActiveDEPRECATED @40 :Bool; + decelForTurnDEPRECATED @47 :Bool; + decelForModelDEPRECATED @54 :Bool; + awarenessStatusDEPRECATED @26 :Float32; + angleSteersDEPRECATED @13 :Float32; + vCurvatureDEPRECATED @46 :Float32; + mapValidDEPRECATED @49 :Bool; + jerkFactorDEPRECATED @12 :Float32; + steerOverrideDEPRECATED @20 :Bool; + steeringAngleDesiredDegDEPRECATED @29 :Float32; +} + +struct ModelDataV2 { + frameId @0 :UInt32; + frameAge @1 :UInt32; + frameDropPerc @2 :Float32; + timestampEof @3 :UInt64; + modelExecutionTime @15 :Float32; + gpuExecutionTime @17 :Float32; + rawPredictions @16 :Data; + + # predicted future position, orientation, etc.. + position @4 :XYZTData; + orientation @5 :XYZTData; + velocity @6 :XYZTData; + orientationRate @7 :XYZTData; + acceleration @19 :XYZTData; + + # prediction lanelines and road edges + laneLines @8 :List(XYZTData); + laneLineProbs @9 :List(Float32); + laneLineStds @13 :List(Float32); + roadEdges @10 :List(XYZTData); + roadEdgeStds @14 :List(Float32); + + # predicted lead cars + leads @11 :List(LeadDataV2); + leadsV3 @18 :List(LeadDataV3); + + meta @12 :MetaData; + + # All SI units and in device frame + struct XYZTData { + x @0 :List(Float32); + y @1 :List(Float32); + z @2 :List(Float32); + t @3 :List(Float32); + xStd @4 :List(Float32); + yStd @5 :List(Float32); + zStd @6 :List(Float32); + } + + struct LeadDataV2 { + prob @0 :Float32; # probability that car is your lead at time t + t @1 :Float32; + + # x and y are relative position in device frame + # v is norm relative speed + # a is norm relative acceleration + xyva @2 :List(Float32); + xyvaStd @3 :List(Float32); + } + + struct LeadDataV3 { + prob @0 :Float32; # probability that car is your lead at time t + probTime @1 :Float32; + t @2 :List(Float32); + + # x and y are relative position in device frame + # v absolute norm speed + # a is derivative of v + x @3 :List(Float32); + xStd @4 :List(Float32); + y @5 :List(Float32); + yStd @6 :List(Float32); + v @7 :List(Float32); + vStd @8 :List(Float32); + a @9 :List(Float32); + aStd @10 :List(Float32); + } + + + struct MetaData { + engagedProb @0 :Float32; + desirePrediction @1 :List(Float32); + desireState @5 :List(Float32); + disengagePredictions @6 :DisengagePredictions; + hardBrakePredicted @7 :Bool; + + # deprecated + brakeDisengageProbDEPRECATED @2 :Float32; + gasDisengageProbDEPRECATED @3 :Float32; + steerOverrideProbDEPRECATED @4 :Float32; + } + + struct DisengagePredictions { + t @0 :List(Float32); + brakeDisengageProbs @1 :List(Float32); + gasDisengageProbs @2 :List(Float32); + steerOverrideProbs @3 :List(Float32); + brake3MetersPerSecondSquaredProbs @4 :List(Float32); + brake4MetersPerSecondSquaredProbs @5 :List(Float32); + brake5MetersPerSecondSquaredProbs @6 :List(Float32); + } +} + +struct EncodeIndex { + # picture from camera + frameId @0 :UInt32; + type @1 :Type; + # index of encoder from start of route + encodeId @2 :UInt32; + # minute long segment this frame is in + segmentNum @3 :Int32; + # index into camera file in segment in presentation order + segmentId @4 :UInt32; + # index into camera file in segment in encode order + segmentIdEncode @5 :UInt32; + timestampSof @6 :UInt64; + timestampEof @7 :UInt64; + + enum Type { + bigBoxLossless @0; # rcamera.mkv + fullHEVC @1; # fcamera.hevc + bigBoxHEVC @2; # bcamera.hevc + chffrAndroidH264 @3; # acamera + fullLosslessClip @4; # prcamera.mkv + front @5; # dcamera.hevc + } +} + +struct AndroidLogEntry { + id @0 :UInt8; + ts @1 :UInt64; + priority @2 :UInt8; + pid @3 :Int32; + tid @4 :Int32; + tag @5 :Text; + message @6 :Text; +} + +struct LongitudinalPlan @0xe00b5b3eba12876c { + modelMonoTime @9 :UInt64; + hasLead @7 :Bool; + fcw @8 :Bool; + longitudinalPlanSource @15 :LongitudinalPlanSource; + processingDelay @29 :Float32; + + # desired speed/accel/jerk over next 2.5s + accels @32 :List(Float32); + speeds @33 :List(Float32); + jerks @34 :List(Float32); + + solverExecutionTime @35 :Float32; + + enum LongitudinalPlanSource { + cruise @0; + lead0 @1; + lead1 @2; + lead2 @3; + e2e @4; + } + + # deprecated + vCruiseDEPRECATED @16 :Float32; + aCruiseDEPRECATED @17 :Float32; + vTargetDEPRECATED @3 :Float32; + vTargetFutureDEPRECATED @14 :Float32; + aTargetDEPRECATED @18 :Float32; + vStartDEPRECATED @26 :Float32; + aStartDEPRECATED @27 :Float32; + vMaxDEPRECATED @20 :Float32; + radarStateMonoTimeDEPRECATED @10 :UInt64; + jerkFactorDEPRECATED @6 :Float32; + hasLeftLaneDEPRECATED @23 :Bool; + hasRightLaneDEPRECATED @24 :Bool; + aTargetMinDEPRECATED @4 :Float32; + aTargetMaxDEPRECATED @5 :Float32; + lateralValidDEPRECATED @0 :Bool; + longitudinalValidDEPRECATED @2 :Bool; + dPolyDEPRECATED @1 :List(Float32); + laneWidthDEPRECATED @11 :Float32; + vCurvatureDEPRECATED @21 :Float32; + decelForTurnDEPRECATED @22 :Bool; + mapValidDEPRECATED @25 :Bool; + radarValidDEPRECATED @28 :Bool; + radarCanErrorDEPRECATED @30 :Bool; + commIssueDEPRECATED @31 :Bool; + eventsDEPRECATED @13 :List(Car.CarEvent); + gpsTrajectoryDEPRECATED @12 :GpsTrajectory; + gpsPlannerActiveDEPRECATED @19 :Bool; + + struct GpsTrajectory { + x @0 :List(Float32); + y @1 :List(Float32); + } +} + +struct LateralPlan @0xe1e9318e2ae8b51e { + laneWidth @0 :Float32; + lProb @5 :Float32; + rProb @7 :Float32; + dPathPoints @20 :List(Float32); + dProb @21 :Float32; + + mpcSolutionValid @9 :Bool; + desire @17 :Desire; + laneChangeState @18 :LaneChangeState; + laneChangeDirection @19 :LaneChangeDirection; + useLaneLines @29 :Bool; + + # desired curvatures over next 2.5s in rad/m + psis @26 :List(Float32); + curvatures @27 :List(Float32); + curvatureRates @28 :List(Float32); + + solverExecutionTime @30 :Float32; + + enum Desire { + none @0; + turnLeft @1; + turnRight @2; + laneChangeLeft @3; + laneChangeRight @4; + keepLeft @5; + keepRight @6; + } + + enum LaneChangeState { + off @0; + preLaneChange @1; + laneChangeStarting @2; + laneChangeFinishing @3; + } + + enum LaneChangeDirection { + none @0; + left @1; + right @2; + } + + # deprecated + curvatureDEPRECATED @22 :Float32; + curvatureRateDEPRECATED @23 :Float32; + rawCurvatureDEPRECATED @24 :Float32; + rawCurvatureRateDEPRECATED @25 :Float32; + cProbDEPRECATED @3 :Float32; + dPolyDEPRECATED @1 :List(Float32); + cPolyDEPRECATED @2 :List(Float32); + lPolyDEPRECATED @4 :List(Float32); + rPolyDEPRECATED @6 :List(Float32); + modelValidDEPRECATED @12 :Bool; + commIssueDEPRECATED @15 :Bool; + posenetValidDEPRECATED @16 :Bool; + sensorValidDEPRECATED @14 :Bool; + paramsValidDEPRECATED @10 :Bool; + steeringAngleDegDEPRECATED @8 :Float32; # deg + steeringRateDegDEPRECATED @13 :Float32; # deg/s + angleOffsetDegDEPRECATED @11 :Float32; +} + +struct LiveLocationKalman { + + # More info on reference frames: + # https://github.com/commaai/openpilot/tree/master/common/transformations + + positionECEF @0 : Measurement; + positionGeodetic @1 : Measurement; + velocityECEF @2 : Measurement; + velocityNED @3 : Measurement; + velocityDevice @4 : Measurement; + accelerationDevice @5: Measurement; + + + # These angles are all eulers and roll, pitch, yaw + # orientationECEF transforms to rot matrix: ecef_from_device + orientationECEF @6 : Measurement; + calibratedOrientationECEF @20 : Measurement; + orientationNED @7 : Measurement; + angularVelocityDevice @8 : Measurement; + + # orientationNEDCalibrated transforms to rot matrix: NED_from_calibrated + calibratedOrientationNED @9 : Measurement; + + # Calibrated frame is simply device frame + # aligned with the vehicle + velocityCalibrated @10 : Measurement; + accelerationCalibrated @11 : Measurement; + angularVelocityCalibrated @12 : Measurement; + + gpsWeek @13 :Int32; + gpsTimeOfWeek @14 :Float64; + status @15 :Status; + unixTimestampMillis @16 :Int64; + inputsOK @17 :Bool = true; + posenetOK @18 :Bool = true; + gpsOK @19 :Bool = true; + sensorsOK @21 :Bool = true; + deviceStable @22 :Bool = true; + timeSinceReset @23 :Float64; + excessiveResets @24 :Bool; + + enum Status { + uninitialized @0; + uncalibrated @1; + valid @2; + } + + struct Measurement { + value @0 : List(Float64); + std @1 : List(Float64); + valid @2 : Bool; + } +} + +struct ProcLog { + cpuTimes @0 :List(CPUTimes); + mem @1 :Mem; + procs @2 :List(Process); + + struct Process { + pid @0 :Int32; + name @1 :Text; + state @2 :UInt8; + ppid @3 :Int32; + + cpuUser @4 :Float32; + cpuSystem @5 :Float32; + cpuChildrenUser @6 :Float32; + cpuChildrenSystem @7 :Float32; + priority @8 :Int64; + nice @9 :Int32; + numThreads @10 :Int32; + startTime @11 :Float64; + + memVms @12 :UInt64; + memRss @13 :UInt64; + + processor @14 :Int32; + + cmdline @15 :List(Text); + exe @16 :Text; + } + + struct CPUTimes { + cpuNum @0 :Int64; + user @1 :Float32; + nice @2 :Float32; + system @3 :Float32; + idle @4 :Float32; + iowait @5 :Float32; + irq @6 :Float32; + softirq @7 :Float32; + } + + struct Mem { + total @0 :UInt64; + free @1 :UInt64; + available @2 :UInt64; + buffers @3 :UInt64; + cached @4 :UInt64; + active @5 :UInt64; + inactive @6 :UInt64; + shared @7 :UInt64; + } +} + +struct UbloxGnss { + union { + measurementReport @0 :MeasurementReport; + ephemeris @1 :Ephemeris; + ionoData @2 :IonoData; + hwStatus @3 :HwStatus; + hwStatus2 @4 :HwStatus2; + } + + struct MeasurementReport { + #received time of week in gps time in seconds and gps week + rcvTow @0 :Float64; + gpsWeek @1 :UInt16; + # leap seconds in seconds + leapSeconds @2 :UInt16; + # receiver status + receiverStatus @3 :ReceiverStatus; + # num of measurements to follow + numMeas @4 :UInt8; + measurements @5 :List(Measurement); + + struct ReceiverStatus { + # leap seconds have been determined + leapSecValid @0 :Bool; + # Clock reset applied + clkReset @1 :Bool; + } + + struct Measurement { + svId @0 :UInt8; + trackingStatus @1 :TrackingStatus; + # pseudorange in meters + pseudorange @2 :Float64; + # carrier phase measurement in cycles + carrierCycles @3 :Float64; + # doppler measurement in Hz + doppler @4 :Float32; + # GNSS id, 0 is gps + gnssId @5 :UInt8; + glonassFrequencyIndex @6 :UInt8; + # carrier phase locktime counter in ms + locktime @7 :UInt16; + # Carrier-to-noise density ratio (signal strength) in dBHz + cno @8 :UInt8; + # pseudorange standard deviation in meters + pseudorangeStdev @9 :Float32; + # carrier phase standard deviation in cycles + carrierPhaseStdev @10 :Float32; + # doppler standard deviation in Hz + dopplerStdev @11 :Float32; + sigId @12 :UInt8; + + struct TrackingStatus { + # pseudorange valid + pseudorangeValid @0 :Bool; + # carrier phase valid + carrierPhaseValid @1 :Bool; + # half cycle valid + halfCycleValid @2 :Bool; + # half sycle subtracted from phase + halfCycleSubtracted @3 :Bool; + } + } + } + + struct Ephemeris { + # This is according to the rinex (2?) format + svId @0 :UInt16; + year @1 :UInt16; + month @2 :UInt16; + day @3 :UInt16; + hour @4 :UInt16; + minute @5 :UInt16; + second @6 :Float32; + af0 @7 :Float64; + af1 @8 :Float64; + af2 @9 :Float64; + + iode @10 :Float64; + crs @11 :Float64; + deltaN @12 :Float64; + m0 @13 :Float64; + + cuc @14 :Float64; + ecc @15 :Float64; + cus @16 :Float64; + a @17 :Float64; # note that this is not the root!! + + toe @18 :Float64; + cic @19 :Float64; + omega0 @20 :Float64; + cis @21 :Float64; + + i0 @22 :Float64; + crc @23 :Float64; + omega @24 :Float64; + omegaDot @25 :Float64; + + iDot @26 :Float64; + codesL2 @27 :Float64; + gpsWeek @28 :Float64; + l2 @29 :Float64; + + svAcc @30 :Float64; + svHealth @31 :Float64; + tgd @32 :Float64; + iodc @33 :Float64; + + transmissionTime @34 :Float64; + fitInterval @35 :Float64; + + toc @36 :Float64; + + ionoCoeffsValid @37 :Bool; + ionoAlpha @38 :List(Float64); + ionoBeta @39 :List(Float64); + + } + + struct IonoData { + svHealth @0 :UInt32; + tow @1 :Float64; + gpsWeek @2 :Float64; + + ionoAlpha @3 :List(Float64); + ionoBeta @4 :List(Float64); + + healthValid @5 :Bool; + ionoCoeffsValid @6 :Bool; + } + + struct HwStatus { + noisePerMS @0 :UInt16; + agcCnt @1 :UInt16; + aStatus @2 :AntennaSupervisorState; + aPower @3 :AntennaPowerStatus; + jamInd @4 :UInt8; + flags @5 :UInt8; + + enum AntennaSupervisorState { + init @0; + dontknow @1; + ok @2; + short @3; + open @4; + } + + enum AntennaPowerStatus { + off @0; + on @1; + dontknow @2; + } + } + + struct HwStatus2 { + ofsI @0 :Int8; + magI @1 :UInt8; + ofsQ @2 :Int8; + magQ @3 :UInt8; + cfgSource @4 :ConfigSource; + lowLevCfg @5 :UInt32; + postStatus @6 :UInt32; + + enum ConfigSource { + undefined @0; + rom @1; + otp @2; + configpins @3; + flash @4; + } + } +} + +struct Clocks { + bootTimeNanos @0 :UInt64; + monotonicNanos @1 :UInt64; + monotonicRawNanos @2 :UInt64; + wallTimeNanos @3 :UInt64; + modemUptimeMillis @4 :UInt64; +} + +struct LiveMpcData { + x @0 :List(Float32); + y @1 :List(Float32); + psi @2 :List(Float32); + curvature @3 :List(Float32); + qpIterations @4 :UInt32; + calculationTime @5 :UInt64; + cost @6 :Float64; +} + +struct LiveLongitudinalMpcData { + xEgo @0 :List(Float32); + vEgo @1 :List(Float32); + aEgo @2 :List(Float32); + xLead @3 :List(Float32); + vLead @4 :List(Float32); + aLead @5 :List(Float32); + aLeadTau @6 :Float32; # lead accel time constant + qpIterations @7 :UInt32; + mpcId @8 :UInt32; + calculationTime @9 :UInt64; + cost @10 :Float64; +} + +struct Joystick { + # convenient for debug and live tuning + axes @0: List(Float32); + buttons @1: List(Bool); +} + +struct DriverState { + frameId @0 :UInt32; + modelExecutionTime @14 :Float32; + dspExecutionTime @16 :Float32; + rawPredictions @15 :Data; + + faceOrientation @3 :List(Float32); + facePosition @4 :List(Float32); + faceProb @5 :Float32; + leftEyeProb @6 :Float32; + rightEyeProb @7 :Float32; + leftBlinkProb @8 :Float32; + rightBlinkProb @9 :Float32; + faceOrientationStd @11 :List(Float32); + facePositionStd @12 :List(Float32); + sunglassesProb @13 :Float32; + poorVision @17 :Float32; + partialFace @18 :Float32; + distractedPose @19 :Float32; + distractedEyes @20 :Float32; + eyesOnRoad @21 :Float32; + phoneUse @22 :Float32; + occludedProb @23 :Float32; + + irPwrDEPRECATED @10 :Float32; + descriptorDEPRECATED @1 :List(Float32); + stdDEPRECATED @2 :Float32; +} + +struct DriverMonitoringState @0xb83cda094a1da284 { + events @0 :List(Car.CarEvent); + faceDetected @1 :Bool; + isDistracted @2 :Bool; + awarenessStatus @3 :Float32; + posePitchOffset @6 :Float32; + posePitchValidCount @7 :UInt32; + poseYawOffset @8 :Float32; + poseYawValidCount @9 :UInt32; + stepChange @10 :Float32; + awarenessActive @11 :Float32; + awarenessPassive @12 :Float32; + isLowStd @13 :Bool; + hiStdCount @14 :UInt32; + isActiveMode @16 :Bool; + + isRHDDEPRECATED @4 :Bool; + isPreviewDEPRECATED @15 :Bool; + rhdCheckedDEPRECATED @5 :Bool; +} + +struct Boot { + wallTimeNanos @0 :UInt64; + pstore @4 :Map(Text, Data); + commands @5 :Map(Text, Data); + launchLog @3 :Text; + + lastKmsgDEPRECATED @1 :Data; + lastPmsgDEPRECATED @2 :Data; +} + +struct LiveParametersData { + valid @0 :Bool; + gyroBias @1 :Float32; + angleOffsetDeg @2 :Float32; + angleOffsetAverageDeg @3 :Float32; + stiffnessFactor @4 :Float32; + steerRatio @5 :Float32; + sensorValid @6 :Bool; + yawRate @7 :Float32; + posenetSpeed @8 :Float32; + posenetValid @9 :Bool; + angleOffsetFastStd @10 :Float32; + angleOffsetAverageStd @11 :Float32; + stiffnessFactorStd @12 :Float32; + steerRatioStd @13 :Float32; + roll @14 :Float32; +} + +struct LiveMapDataDEPRECATED { + speedLimitValid @0 :Bool; + speedLimit @1 :Float32; + speedAdvisoryValid @12 :Bool; + speedAdvisory @13 :Float32; + speedLimitAheadValid @14 :Bool; + speedLimitAhead @15 :Float32; + speedLimitAheadDistance @16 :Float32; + curvatureValid @2 :Bool; + curvature @3 :Float32; + wayId @4 :UInt64; + roadX @5 :List(Float32); + roadY @6 :List(Float32); + lastGps @7: GpsLocationData; + roadCurvatureX @8 :List(Float32); + roadCurvature @9 :List(Float32); + distToTurn @10 :Float32; + mapValid @11 :Bool; +} + +struct CameraOdometry { + frameId @4 :UInt32; + timestampEof @5 :UInt64; + trans @0 :List(Float32); # m/s in device frame + rot @1 :List(Float32); # rad/s in device frame + transStd @2 :List(Float32); # std m/s in device frame + rotStd @3 :List(Float32); # std rad/s in device frame +} + +struct Sentinel { + enum SentinelType { + endOfSegment @0; + endOfRoute @1; + startOfSegment @2; + startOfRoute @3; + } + type @0 :SentinelType; + signal @1 :Int32; +} + +struct ManagerState { + processes @0 :List(ProcessState); + + struct ProcessState { + name @0 :Text; + pid @1 :Int32; + running @2 :Bool; + shouldBeRunning @4 :Bool; + exitCode @3 :Int32; + } +} + +struct UploaderState { + immediateQueueSize @0 :UInt32; + immediateQueueCount @1 :UInt32; + rawQueueSize @2 :UInt32; + rawQueueCount @3 :UInt32; + + # stats for last successfully uploaded file + lastTime @4 :Float32; # s + lastSpeed @5 :Float32; # MB/s + lastFilename @6 :Text; +} + +struct NavInstruction { + maneuverPrimaryText @0 :Text; + maneuverSecondaryText @1 :Text; + maneuverDistance @2 :Float32; # m + maneuverType @3 :Text; # TODO: Make Enum + maneuverModifier @4 :Text; # TODO: Make Enum + + distanceRemaining @5 :Float32; # m + timeRemaining @6 :Float32; # s + timeRemainingTypical @7 :Float32; # s + + lanes @8 :List(Lane); + showFull @9 :Bool; + + struct Lane { + directions @0 :List(Direction); + active @1 :Bool; + activeDirection @2 :Direction; + } + + enum Direction { + none @0; + left @1; + right @2; + straight @3; + } + +} + +struct NavRoute { + coordinates @0 :List(Coordinate); + + struct Coordinate { + latitude @0 :Float32; + longitude @1 :Float32; + } +} + +struct Event { + logMonoTime @0 :UInt64; # nanoseconds + valid @67 :Bool = true; + + union { + # *********** log metadata *********** + initData @1 :InitData; + sentinel @73 :Sentinel; + + # *********** bootlog *********** + boot @60 :Boot; + + # ********** openpilot daemon msgs ********** + gpsNMEA @3 :GPSNMEAData; + can @5 :List(CanData); + controlsState @7 :ControlsState; + sensorEvents @11 :List(SensorEventData); + pandaStates @81 :List(PandaState); + peripheralState @80 :PeripheralState; + radarState @13 :RadarState; + liveTracks @16 :List(LiveTracks); + sendcan @17 :List(CanData); + liveCalibration @19 :LiveCalibrationData; + carState @22 :Car.CarState; + carControl @23 :Car.CarControl; + longitudinalPlan @24 :LongitudinalPlan; + lateralPlan @64 :LateralPlan; + ubloxGnss @34 :UbloxGnss; + ubloxRaw @39 :Data; + gpsLocationExternal @48 :GpsLocationData; + driverState @59 :DriverState; + liveParameters @61 :LiveParametersData; + cameraOdometry @63 :CameraOdometry; + thumbnail @66: Thumbnail; + carEvents @68: List(Car.CarEvent); + carParams @69: Car.CarParams; + driverMonitoringState @71: DriverMonitoringState; + liveLocationKalman @72 :LiveLocationKalman; + modelV2 @75 :ModelDataV2; + + # camera stuff, each camera state has a matching encode idx + roadCameraState @2 :FrameData; + driverCameraState @70: FrameData; + wideRoadCameraState @74: FrameData; + roadEncodeIdx @15 :EncodeIndex; + driverEncodeIdx @76 :EncodeIndex; + wideRoadEncodeIdx @77 :EncodeIndex; + + # systems stuff + androidLog @20 :AndroidLogEntry; + managerState @78 :ManagerState; + uploaderState @79 :UploaderState; + procLog @33 :ProcLog; + clocks @35 :Clocks; + deviceState @6 :DeviceState; + logMessage @18 :Text; + errorLogMessage @85 :Text; + + # navigation + navInstruction @82 :NavInstruction; + navRoute @83 :NavRoute; + navThumbnail @84: Thumbnail; + + # *********** debug *********** + testJoystick @52 :Joystick; + + # *********** legacy + deprecated *********** + model @9 :Legacy.ModelData; # TODO: rename modelV2 and mark this as deprecated + liveMpcDEPRECATED @36 :LiveMpcData; + liveLongitudinalMpcDEPRECATED @37 :LiveLongitudinalMpcData; + liveLocationKalmanDEPRECATED @51 :Legacy.LiveLocationData; + orbslamCorrectionDEPRECATED @45 :Legacy.OrbslamCorrection; + liveUIDEPRECATED @14 :Legacy.LiveUI; + sensorEventDEPRECATED @4 :SensorEventData; + liveEventDEPRECATED @8 :List(Legacy.LiveEventData); + liveLocationDEPRECATED @25 :Legacy.LiveLocationData; + ethernetDataDEPRECATED @26 :List(Legacy.EthernetPacket); + cellInfoDEPRECATED @28 :List(Legacy.CellInfo); + wifiScanDEPRECATED @29 :List(Legacy.WifiScan); + uiNavigationEventDEPRECATED @50 :Legacy.UiNavigationEvent; + liveMapDataDEPRECATED @62 :LiveMapDataDEPRECATED; + gpsPlannerPointsDEPRECATED @40 :Legacy.GPSPlannerPoints; + gpsPlannerPlanDEPRECATED @41 :Legacy.GPSPlannerPlan; + applanixRawDEPRECATED @42 :Data; + androidGnssDEPRECATED @30 :Legacy.AndroidGnss; + qcomGnssDEPRECATD @31 :Legacy.QcomGnss; + lidarPtsDEPRECATED @32 :Legacy.LidarPts; + navStatusDEPRECATED @38 :Legacy.NavStatus; + trafficEventsDEPRECATED @43 :List(Legacy.TrafficEvent); + liveLocationTimingDEPRECATED @44 :Legacy.LiveLocationData; + liveLocationCorrectedDEPRECATED @46 :Legacy.LiveLocationData; + navUpdateDEPRECATED @27 :Legacy.NavUpdate; + orbObservationDEPRECATED @47 :List(Legacy.OrbObservation); + locationDEPRECATED @49 :Legacy.LiveLocationData; + orbOdometryDEPRECATED @53 :Legacy.OrbOdometry; + orbFeaturesDEPRECATED @54 :Legacy.OrbFeatures; + applanixLocationDEPRECATED @55 :Legacy.LiveLocationData; + orbKeyFrameDEPRECATED @56 :Legacy.OrbKeyFrame; + orbFeaturesSummaryDEPRECATED @58 :Legacy.OrbFeaturesSummary; + featuresDEPRECATED @10 :Legacy.CalibrationFeatures; + kalmanOdometryDEPRECATED @65 :Legacy.KalmanOdometry; + gpsLocationDEPRECATED @21 :GpsLocationData; + uiLayoutStateDEPRECATED @57 :Legacy.UiLayoutState; + pandaStateDEPRECATED @12 :PandaState; + } +} diff --git a/cereal/logger/logger.h b/cereal/logger/logger.h new file mode 100644 index 000000000..e21509352 --- /dev/null +++ b/cereal/logger/logger.h @@ -0,0 +1,20 @@ +#pragma once + +#ifdef SWAGLOG +#include "selfdrive/common/swaglog.h" +#else + +#define CLOUDLOG_DEBUG 10 +#define CLOUDLOG_INFO 20 +#define CLOUDLOG_WARNING 30 +#define CLOUDLOG_ERROR 40 +#define CLOUDLOG_CRITICAL 50 + +#define cloudlog(lvl, fmt, ...) printf(fmt "\n", ## __VA_ARGS__) + +#define LOGD(fmt, ...) cloudlog(CLOUDLOG_DEBUG, fmt, ## __VA_ARGS__) +#define LOG(fmt, ...) cloudlog(CLOUDLOG_INFO, fmt, ## __VA_ARGS__) +#define LOGW(fmt, ...) cloudlog(CLOUDLOG_WARNING, fmt, ## __VA_ARGS__) +#define LOGE(fmt, ...) cloudlog(CLOUDLOG_ERROR, fmt, ## __VA_ARGS__) + +#endif diff --git a/cereal/messaging/.gitignore b/cereal/messaging/.gitignore new file mode 100644 index 000000000..dbbe8e22a --- /dev/null +++ b/cereal/messaging/.gitignore @@ -0,0 +1,10 @@ +demo +bridge +test_runner +*.o +*.os +*.d +*.a +*.so +messaging_pyx.cpp +build/ diff --git a/cereal/messaging/__init__.py b/cereal/messaging/__init__.py new file mode 100644 index 000000000..0440104eb --- /dev/null +++ b/cereal/messaging/__init__.py @@ -0,0 +1,251 @@ +# must be build with scons +from .messaging_pyx import Context, Poller, SubSocket, PubSocket # pylint: disable=no-name-in-module, import-error +from .messaging_pyx import MultiplePublishersError, MessagingError # pylint: disable=no-name-in-module, import-error +import os +import capnp + +from typing import Optional, List, Union +from collections import deque + +from cereal import log +from cereal.services import service_list + +assert MultiplePublishersError +assert MessagingError + +NO_TRAVERSAL_LIMIT = 2**64-1 +AVG_FREQ_HISTORY = 100 +SIMULATION = "SIMULATION" in os.environ + +# sec_since_boot is faster, but allow to run standalone too +try: + from common.realtime import sec_since_boot +except ImportError: + import time + sec_since_boot = time.time + print("Warning, using python time.time() instead of faster sec_since_boot") + +context = Context() + +def log_from_bytes(dat: bytes) -> capnp.lib.capnp._DynamicStructReader: + return log.Event.from_bytes(dat, traversal_limit_in_words=NO_TRAVERSAL_LIMIT) + +def new_message(service: Optional[str] = None, size: Optional[int] = None) -> capnp.lib.capnp._DynamicStructBuilder: + dat = log.Event.new_message() + dat.logMonoTime = int(sec_since_boot() * 1e9) + dat.valid = True + if service is not None: + if size is None: + dat.init(service) + else: + dat.init(service, size) + return dat + +def pub_sock(endpoint: str) -> PubSocket: + sock = PubSocket() + sock.connect(context, endpoint) + return sock + +def sub_sock(endpoint: str, poller: Optional[Poller] = None, addr: str = "127.0.0.1", + conflate: bool = False, timeout: Optional[int] = None) -> SubSocket: + sock = SubSocket() + sock.connect(context, endpoint, addr.encode('utf8'), conflate) + + if timeout is not None: + sock.setTimeout(timeout) + + if poller is not None: + poller.registerSocket(sock) + return sock + + +def drain_sock_raw(sock: SubSocket, wait_for_one: bool = False) -> List[bytes]: + """Receive all message currently available on the queue""" + ret: List[bytes] = [] + while 1: + if wait_for_one and len(ret) == 0: + dat = sock.receive() + else: + dat = sock.receive(non_blocking=True) + + if dat is None: + break + + ret.append(dat) + + return ret + +def drain_sock(sock: SubSocket, wait_for_one: bool = False) -> List[capnp.lib.capnp._DynamicStructReader]: + """Receive all message currently available on the queue""" + ret: List[capnp.lib.capnp._DynamicStructReader] = [] + while 1: + if wait_for_one and len(ret) == 0: + dat = sock.receive() + else: + dat = sock.receive(non_blocking=True) + + if dat is None: # Timeout hit + break + + dat = log_from_bytes(dat) + ret.append(dat) + + return ret + + +# TODO: print when we drop packets? +def recv_sock(sock: SubSocket, wait: bool = False) -> Union[None, capnp.lib.capnp._DynamicStructReader]: + """Same as drain sock, but only returns latest message. Consider using conflate instead.""" + dat = None + + while 1: + if wait and dat is None: + rcv = sock.receive() + else: + rcv = sock.receive(non_blocking=True) + + if rcv is None: # Timeout hit + break + + dat = rcv + + if dat is not None: + dat = log_from_bytes(dat) + + return dat + +def recv_one(sock: SubSocket) -> Union[None, capnp.lib.capnp._DynamicStructReader]: + dat = sock.receive() + if dat is not None: + dat = log_from_bytes(dat) + return dat + +def recv_one_or_none(sock: SubSocket) -> Union[None, capnp.lib.capnp._DynamicStructReader]: + dat = sock.receive(non_blocking=True) + if dat is not None: + dat = log_from_bytes(dat) + return dat + +def recv_one_retry(sock: SubSocket) -> capnp.lib.capnp._DynamicStructReader: + """Keep receiving until we get a message""" + while True: + dat = sock.receive() + if dat is not None: + return log_from_bytes(dat) + +class SubMaster(): + def __init__(self, services: List[str], poll: Optional[List[str]] = None, + ignore_alive: Optional[List[str]] = None, ignore_avg_freq: Optional[List[str]] = None, + addr: str = "127.0.0.1"): + self.frame = -1 + self.updated = {s: False for s in services} + self.rcv_time = {s: 0. for s in services} + self.rcv_frame = {s: 0 for s in services} + self.alive = {s: False for s in services} + self.recv_dts = {s: deque([0.0] * AVG_FREQ_HISTORY, maxlen=AVG_FREQ_HISTORY) for s in services} + self.sock = {} + self.freq = {} + self.data = {} + self.valid = {} + self.logMonoTime = {} + + self.poller = Poller() + self.non_polled_services = [s for s in services if poll is not None and + len(poll) and s not in poll] + + self.ignore_average_freq = [] if ignore_avg_freq is None else ignore_avg_freq + self.ignore_alive = [] if ignore_alive is None else ignore_alive + + for s in services: + if addr is not None: + p = self.poller if s not in self.non_polled_services else None + self.sock[s] = sub_sock(s, poller=p, addr=addr, conflate=True) + self.freq[s] = service_list[s].frequency + + try: + data = new_message(s) + except capnp.lib.capnp.KjException: # pylint: disable=c-extension-no-member + data = new_message(s, 0) # lists + + self.data[s] = getattr(data, s) + self.logMonoTime[s] = 0 + self.valid[s] = data.valid + + def __getitem__(self, s: str) -> capnp.lib.capnp._DynamicStructReader: + return self.data[s] + + def update(self, timeout: int = 1000) -> None: + msgs = [] + for sock in self.poller.poll(timeout): + msgs.append(recv_one_or_none(sock)) + + # non-blocking receive for non-polled sockets + for s in self.non_polled_services: + msgs.append(recv_one_or_none(self.sock[s])) + self.update_msgs(sec_since_boot(), msgs) + + def update_msgs(self, cur_time: float, msgs: List[capnp.lib.capnp._DynamicStructReader]) -> None: + self.frame += 1 + self.updated = dict.fromkeys(self.updated, False) + for msg in msgs: + if msg is None: + continue + + s = msg.which() + self.updated[s] = True + + if self.rcv_time[s] > 1e-5 and self.freq[s] > 1e-5 and (s not in self.non_polled_services) \ + and (s not in self.ignore_average_freq): + self.recv_dts[s].append(cur_time - self.rcv_time[s]) + + self.rcv_time[s] = cur_time + self.rcv_frame[s] = self.frame + self.data[s] = getattr(msg, s) + self.logMonoTime[s] = msg.logMonoTime + self.valid[s] = msg.valid + + if SIMULATION: + self.alive[s] = True + + if not SIMULATION: + for s in self.data: + # arbitrary small number to avoid float comparison. If freq is 0, we can skip the check + if self.freq[s] > 1e-5: + # alive if delay is within 10x the expected frequency + self.alive[s] = (cur_time - self.rcv_time[s]) < (10. / self.freq[s]) + + # alive if average frequency is higher than 90% of expected frequency + avg_dt = sum(self.recv_dts[s]) / AVG_FREQ_HISTORY + expected_dt = 1 / (self.freq[s] * 0.90) + self.alive[s] = self.alive[s] and (avg_dt < expected_dt) + else: + self.alive[s] = True + + def all_alive(self, service_list=None) -> bool: + if service_list is None: # check all + service_list = self.alive.keys() + return all(self.alive[s] for s in service_list if s not in self.ignore_alive) + + def all_valid(self, service_list=None) -> bool: + if service_list is None: # check all + service_list = self.valid.keys() + return all(self.valid[s] for s in service_list) + + def all_alive_and_valid(self, service_list=None) -> bool: + if service_list is None: # check all + service_list = self.alive.keys() + return self.all_alive(service_list=service_list) and self.all_valid(service_list=service_list) + +class PubMaster(): + def __init__(self, services: List[str]): + self.sock = {} + for s in services: + self.sock[s] = pub_sock(s) + + def send(self, s: str, dat: Union[bytes, capnp.lib.capnp._DynamicStructBuilder]) -> None: + if not isinstance(dat, bytes): + dat = dat.to_bytes() + self.sock[s].send(dat) + + def all_readers_updated(self, s: str) -> bool: + return self.sock[s].all_readers_updated() diff --git a/cereal/messaging/bridge b/cereal/messaging/bridge new file mode 100755 index 000000000..239ed5b25 Binary files /dev/null and b/cereal/messaging/bridge differ diff --git a/cereal/messaging/bridge.cc b/cereal/messaging/bridge.cc new file mode 100644 index 000000000..d4bdfcea7 --- /dev/null +++ b/cereal/messaging/bridge.cc @@ -0,0 +1,79 @@ +#include +#include +#include +#include +#include +#include + +typedef void (*sighandler_t)(int sig); + +#include "impl_msgq.h" +#include "impl_zmq.h" +#include "services.h" + +void sigpipe_handler(int sig) { + assert(sig == SIGPIPE); + std::cout << "SIGPIPE received" << std::endl; +} + +static std::vector get_services(std::string whitelist_str, bool zmq_to_msgq) { + std::vector service_list; + for (const auto& it : services) { + std::string name = it.name; + bool in_whitelist = whitelist_str.find(name) != std::string::npos; + if (name == "plusFrame" || name == "uiLayoutState" || (zmq_to_msgq && !in_whitelist)) { + continue; + } + service_list.push_back(name); + } + return service_list; +} + +int main(int argc, char** argv) { + signal(SIGPIPE, (sighandler_t)sigpipe_handler); + + bool zmq_to_msgq = argc > 2; + std::string ip = zmq_to_msgq ? argv[1] : "127.0.0.1"; + std::string whitelist_str = zmq_to_msgq ? std::string(argv[2]) : ""; + + Poller *poller; + Context *pub_context; + Context *sub_context; + if (zmq_to_msgq) { // republishes zmq debugging messages as msgq + poller = new ZMQPoller(); + pub_context = new MSGQContext(); + sub_context = new ZMQContext(); + } else { + poller = new MSGQPoller(); + pub_context = new ZMQContext(); + sub_context = new MSGQContext(); + } + + std::map sub2pub; + for (auto endpoint: get_services(whitelist_str, zmq_to_msgq)) { + PubSocket * pub_sock; + SubSocket * sub_sock; + if (zmq_to_msgq) { + pub_sock = new MSGQPubSocket(); + sub_sock = new ZMQSubSocket(); + } else { + pub_sock = new ZMQPubSocket(); + sub_sock = new MSGQSubSocket(); + } + pub_sock->connect(pub_context, endpoint); + sub_sock->connect(sub_context, endpoint, ip, false); + + poller->registerSocket(sub_sock); + sub2pub[sub_sock] = pub_sock; + } + + while (true) { + for (auto sub_sock : poller->poll(100)) { + Message * msg = sub_sock->receive(); + if (msg == NULL) continue; + sub2pub[sub_sock]->sendMessage(msg); + delete msg; + } + } + return 0; +} diff --git a/cereal/messaging/impl_msgq.cc b/cereal/messaging/impl_msgq.cc new file mode 100644 index 000000000..862c94cb3 --- /dev/null +++ b/cereal/messaging/impl_msgq.cc @@ -0,0 +1,230 @@ +#include +#include +#include +#include +#include +#include + +#include "services.h" +#include "impl_msgq.h" + + +volatile sig_atomic_t msgq_do_exit = 0; + +void sig_handler(int signal) { + assert(signal == SIGINT || signal == SIGTERM); + msgq_do_exit = 1; +} + +static bool service_exists(std::string path){ + for (const auto& it : services) { + if (it.name == path) { + return true; + } + } + return false; +} + +static size_t get_size(std::string endpoint){ + size_t sz = DEFAULT_SEGMENT_SIZE; + + if (endpoint == "roadCameraState" || endpoint == "driverCameraState" || endpoint == "wideRoadCameraState"){ + sz *= 10; + } + + return sz; +} + + +MSGQContext::MSGQContext() { +} + +MSGQContext::~MSGQContext() { +} + +void MSGQMessage::init(size_t sz) { + size = sz; + data = new char[size]; +} + +void MSGQMessage::init(char * d, size_t sz) { + size = sz; + data = new char[size]; + memcpy(data, d, size); +} + +void MSGQMessage::takeOwnership(char * d, size_t sz) { + size = sz; + data = d; +} + +void MSGQMessage::close() { + if (size > 0){ + delete[] data; + } + size = 0; +} + +MSGQMessage::~MSGQMessage() { + this->close(); +} + +int MSGQSubSocket::connect(Context *context, std::string endpoint, std::string address, bool conflate, bool check_endpoint){ + assert(context); + assert(address == "127.0.0.1"); + + if (check_endpoint && !service_exists(std::string(endpoint))){ + std::cout << "Warning, " << std::string(endpoint) << " is not in service list." << std::endl; + } + + q = new msgq_queue_t; + int r = msgq_new_queue(q, endpoint.c_str(), get_size(endpoint)); + if (r != 0){ + return r; + } + + msgq_init_subscriber(q); + + if (conflate){ + q->read_conflate = true; + } + + timeout = -1; + + return 0; +} + + +Message * MSGQSubSocket::receive(bool non_blocking){ + msgq_do_exit = 0; + + void (*prev_handler_sigint)(int); + void (*prev_handler_sigterm)(int); + if (!non_blocking){ + prev_handler_sigint = std::signal(SIGINT, sig_handler); + prev_handler_sigterm = std::signal(SIGTERM, sig_handler); + } + + msgq_msg_t msg; + + MSGQMessage *r = NULL; + + int rc = msgq_msg_recv(&msg, q); + + // Hack to implement blocking read with a poller. Don't use this + while (!non_blocking && rc == 0 && msgq_do_exit == 0){ + msgq_pollitem_t items[1]; + items[0].q = q; + + int t = (timeout != -1) ? timeout : 100; + + int n = msgq_poll(items, 1, t); + rc = msgq_msg_recv(&msg, q); + + // The poll indicated a message was ready, but the receive failed. Try again + if (n == 1 && rc == 0){ + continue; + } + + if (timeout != -1){ + break; + } + } + + + if (!non_blocking){ + std::signal(SIGINT, prev_handler_sigint); + std::signal(SIGTERM, prev_handler_sigterm); + } + + errno = msgq_do_exit ? EINTR : 0; + + if (rc > 0){ + if (msgq_do_exit){ + msgq_msg_close(&msg); // Free unused message on exit + } else { + r = new MSGQMessage; + r->takeOwnership(msg.data, msg.size); + } + } + + return (Message*)r; +} + +void MSGQSubSocket::setTimeout(int t){ + timeout = t; +} + +MSGQSubSocket::~MSGQSubSocket(){ + if (q != NULL){ + msgq_close_queue(q); + delete q; + } +} + +int MSGQPubSocket::connect(Context *context, std::string endpoint, bool check_endpoint){ + assert(context); + + if (check_endpoint && !service_exists(std::string(endpoint))){ + std::cout << "Warning, " << std::string(endpoint) << " is not in service list." << std::endl; + } + + q = new msgq_queue_t; + int r = msgq_new_queue(q, endpoint.c_str(), get_size(endpoint)); + if (r != 0){ + return r; + } + + msgq_init_publisher(q); + + return 0; +} + +int MSGQPubSocket::sendMessage(Message *message){ + msgq_msg_t msg; + msg.data = message->getData(); + msg.size = message->getSize(); + + return msgq_msg_send(&msg, q); +} + +int MSGQPubSocket::send(char *data, size_t size){ + msgq_msg_t msg; + msg.data = data; + msg.size = size; + + return msgq_msg_send(&msg, q); +} + +bool MSGQPubSocket::all_readers_updated() { + return msgq_all_readers_updated(q); +} + +MSGQPubSocket::~MSGQPubSocket(){ + if (q != NULL){ + msgq_close_queue(q); + delete q; + } +} + + +void MSGQPoller::registerSocket(SubSocket * socket){ + assert(num_polls + 1 < MAX_POLLERS); + polls[num_polls].q = (msgq_queue_t*)socket->getRawSocket(); + + sockets.push_back(socket); + num_polls++; +} + +std::vector MSGQPoller::poll(int timeout){ + std::vector r; + + msgq_poll(polls, num_polls, timeout); + for (size_t i = 0; i < num_polls; i++){ + if (polls[i].revents){ + r.push_back(sockets[i]); + } + } + + return r; +} diff --git a/cereal/messaging/impl_msgq.h b/cereal/messaging/impl_msgq.h new file mode 100644 index 000000000..b67aae622 --- /dev/null +++ b/cereal/messaging/impl_msgq.h @@ -0,0 +1,65 @@ +#pragma once +#include "messaging.h" +#include "msgq.h" +#include +#include + +#define MAX_POLLERS 128 + +class MSGQContext : public Context { +private: + void * context = NULL; +public: + MSGQContext(); + void * getRawContext() {return context;} + ~MSGQContext(); +}; + +class MSGQMessage : public Message { +private: + char * data; + size_t size; +public: + void init(size_t size); + void init(char *data, size_t size); + void takeOwnership(char *data, size_t size); + size_t getSize(){return size;} + char * getData(){return data;} + void close(); + ~MSGQMessage(); +}; + +class MSGQSubSocket : public SubSocket { +private: + msgq_queue_t * q = NULL; + int timeout; +public: + int connect(Context *context, std::string endpoint, std::string address, bool conflate=false, bool check_endpoint=true); + void setTimeout(int timeout); + void * getRawSocket() {return (void*)q;} + Message *receive(bool non_blocking=false); + ~MSGQSubSocket(); +}; + +class MSGQPubSocket : public PubSocket { +private: + msgq_queue_t * q = NULL; +public: + int connect(Context *context, std::string endpoint, bool check_endpoint=true); + int sendMessage(Message *message); + int send(char *data, size_t size); + bool all_readers_updated(); + ~MSGQPubSocket(); +}; + +class MSGQPoller : public Poller { +private: + std::vector sockets; + msgq_pollitem_t polls[MAX_POLLERS]; + size_t num_polls = 0; + +public: + void registerSocket(SubSocket *socket); + std::vector poll(int timeout); + ~MSGQPoller(){}; +}; diff --git a/cereal/messaging/impl_zmq.cc b/cereal/messaging/impl_zmq.cc new file mode 100644 index 000000000..aeed176ae --- /dev/null +++ b/cereal/messaging/impl_zmq.cc @@ -0,0 +1,168 @@ +#include +#include +#include +#include +#include + +#include + +#include "services.h" +#include "impl_zmq.h" + +static int get_port(std::string endpoint) { + int port = -1; + for (const auto& it : services) { + std::string name = it.name; + if (name == endpoint) { + port = it.port; + break; + } + } + + assert(port >= 0); + return port; +} + +ZMQContext::ZMQContext() { + context = zmq_ctx_new(); +} + +ZMQContext::~ZMQContext() { + zmq_ctx_term(context); +} + +void ZMQMessage::init(size_t sz) { + size = sz; + data = new char[size]; +} + +void ZMQMessage::init(char * d, size_t sz) { + size = sz; + data = new char[size]; + memcpy(data, d, size); +} + +void ZMQMessage::close() { + if (size > 0){ + delete[] data; + } + size = 0; +} + +ZMQMessage::~ZMQMessage() { + this->close(); +} + + +int ZMQSubSocket::connect(Context *context, std::string endpoint, std::string address, bool conflate, bool check_endpoint){ + sock = zmq_socket(context->getRawContext(), ZMQ_SUB); + if (sock == NULL){ + return -1; + } + + zmq_setsockopt(sock, ZMQ_SUBSCRIBE, "", 0); + + if (conflate){ + int arg = 1; + zmq_setsockopt(sock, ZMQ_CONFLATE, &arg, sizeof(int)); + } + + int reconnect_ivl = 500; + zmq_setsockopt(sock, ZMQ_RECONNECT_IVL_MAX, &reconnect_ivl, sizeof(reconnect_ivl)); + + full_endpoint = "tcp://" + address + ":"; + if (check_endpoint){ + full_endpoint += std::to_string(get_port(endpoint)); + } else { + full_endpoint += endpoint; + } + + return zmq_connect(sock, full_endpoint.c_str()); +} + + +Message * ZMQSubSocket::receive(bool non_blocking){ + zmq_msg_t msg; + assert(zmq_msg_init(&msg) == 0); + + int flags = non_blocking ? ZMQ_DONTWAIT : 0; + int rc = zmq_msg_recv(&msg, sock, flags); + Message *r = NULL; + + if (rc >= 0){ + // Make a copy to ensure the data is aligned + r = new ZMQMessage; + r->init((char*)zmq_msg_data(&msg), zmq_msg_size(&msg)); + } + + zmq_msg_close(&msg); + return r; +} + +void ZMQSubSocket::setTimeout(int timeout){ + zmq_setsockopt(sock, ZMQ_RCVTIMEO, &timeout, sizeof(int)); +} + +ZMQSubSocket::~ZMQSubSocket(){ + zmq_close(sock); +} + +int ZMQPubSocket::connect(Context *context, std::string endpoint, bool check_endpoint){ + sock = zmq_socket(context->getRawContext(), ZMQ_PUB); + if (sock == NULL){ + return -1; + } + + full_endpoint = "tcp://*:"; + if (check_endpoint){ + full_endpoint += std::to_string(get_port(endpoint)); + } else { + full_endpoint += endpoint; + } + + return zmq_bind(sock, full_endpoint.c_str()); +} + +int ZMQPubSocket::sendMessage(Message *message){ + return zmq_send(sock, message->getData(), message->getSize(), ZMQ_DONTWAIT); +} + +int ZMQPubSocket::send(char *data, size_t size){ + return zmq_send(sock, data, size, ZMQ_DONTWAIT); +} + +bool ZMQPubSocket::all_readers_updated() { + assert(false); // TODO not implemented + return false; +} + +ZMQPubSocket::~ZMQPubSocket(){ + zmq_close(sock); +} + + +void ZMQPoller::registerSocket(SubSocket * socket){ + assert(num_polls + 1 < MAX_POLLERS); + polls[num_polls].socket = socket->getRawSocket(); + polls[num_polls].events = ZMQ_POLLIN; + + sockets.push_back(socket); + num_polls++; +} + +std::vector ZMQPoller::poll(int timeout){ + std::vector r; + + int rc = zmq_poll(polls, num_polls, timeout); + if (rc < 0){ + return r; + } + + for (size_t i = 0; i < num_polls; i++){ + if (polls[i].revents){ + r.push_back(sockets[i]); + } + } + + return r; +} diff --git a/cereal/messaging/impl_zmq.h b/cereal/messaging/impl_zmq.h new file mode 100644 index 000000000..bb232049e --- /dev/null +++ b/cereal/messaging/impl_zmq.h @@ -0,0 +1,64 @@ +#pragma once +#include "messaging.h" +#include +#include + +#define MAX_POLLERS 128 + +class ZMQContext : public Context { +private: + void * context = NULL; +public: + ZMQContext(); + void * getRawContext() {return context;} + ~ZMQContext(); +}; + +class ZMQMessage : public Message { +private: + char * data; + size_t size; +public: + void init(size_t size); + void init(char *data, size_t size); + size_t getSize(){return size;} + char * getData(){return data;} + void close(); + ~ZMQMessage(); +}; + +class ZMQSubSocket : public SubSocket { +private: + void * sock; + std::string full_endpoint; +public: + int connect(Context *context, std::string endpoint, std::string address, bool conflate=false, bool check_endpoint=true); + void setTimeout(int timeout); + void * getRawSocket() {return sock;} + Message *receive(bool non_blocking=false); + ~ZMQSubSocket(); +}; + +class ZMQPubSocket : public PubSocket { +private: + void * sock; + std::string full_endpoint; +public: + int connect(Context *context, std::string endpoint, bool check_endpoint=true); + int sendMessage(Message *message); + int send(char *data, size_t size); + bool all_readers_updated(); + ~ZMQPubSocket(); +}; + +class ZMQPoller : public Poller { +private: + std::vector sockets; + zmq_pollitem_t polls[MAX_POLLERS]; + size_t num_polls = 0; + +public: + void registerSocket(SubSocket *socket); + std::vector poll(int timeout); + ~ZMQPoller(){}; +}; diff --git a/cereal/messaging/messaging.cc b/cereal/messaging/messaging.cc new file mode 100644 index 000000000..bfa634e61 --- /dev/null +++ b/cereal/messaging/messaging.cc @@ -0,0 +1,103 @@ +#include "messaging.h" +#include "impl_zmq.h" +#include "impl_msgq.h" + +#ifdef __APPLE__ +const bool MUST_USE_ZMQ = true; +#else +const bool MUST_USE_ZMQ = false; +#endif + +bool messaging_use_zmq(){ + return std::getenv("ZMQ") || MUST_USE_ZMQ; +} + +Context * Context::create(){ + Context * c; + if (messaging_use_zmq()){ + c = new ZMQContext(); + } else { + c = new MSGQContext(); + } + return c; +} + +SubSocket * SubSocket::create(){ + SubSocket * s; + if (messaging_use_zmq()){ + s = new ZMQSubSocket(); + } else { + s = new MSGQSubSocket(); + } + return s; +} + +SubSocket * SubSocket::create(Context * context, std::string endpoint, std::string address, bool conflate, bool check_endpoint){ + SubSocket *s = SubSocket::create(); + int r = s->connect(context, endpoint, address, conflate, check_endpoint); + + if (r == 0) { + return s; + } else { + delete s; + return NULL; + } +} + +PubSocket * PubSocket::create(){ + PubSocket * s; + if (messaging_use_zmq()){ + s = new ZMQPubSocket(); + } else { + s = new MSGQPubSocket(); + } + return s; +} + +PubSocket * PubSocket::create(Context * context, std::string endpoint, bool check_endpoint){ + PubSocket *s = PubSocket::create(); + int r = s->connect(context, endpoint, check_endpoint); + + if (r == 0) { + return s; + } else { + delete s; + return NULL; + } +} + +Poller * Poller::create(){ + Poller * p; + if (messaging_use_zmq()){ + p = new ZMQPoller(); + } else { + p = new MSGQPoller(); + } + return p; +} + +Poller * Poller::create(std::vector sockets){ + Poller * p = Poller::create(); + + for (auto s : sockets){ + p->registerSocket(s); + } + return p; +} + +extern "C" Context * messaging_context_create() { + return Context::create(); +} + +extern "C" SubSocket * messaging_subsocket_create(Context* context, const char* endpoint) { + return SubSocket::create(context, std::string(endpoint)); +} + +extern "C" PubSocket * messaging_pubsocket_create(Context* context, const char* endpoint) { + return PubSocket::create(context, std::string(endpoint)); +} + +extern "C" Poller * messaging_poller_create(SubSocket** sockets, int size) { + std::vector socketsVec(sockets, sockets + size); + return Poller::create(socketsVec); +} diff --git a/cereal/messaging/messaging.h b/cereal/messaging/messaging.h new file mode 100644 index 000000000..4a184ff70 --- /dev/null +++ b/cereal/messaging/messaging.h @@ -0,0 +1,145 @@ +#pragma once +#include +#include +#include +#include +#include +#include "../gen/cpp/log.capnp.h" + +#ifdef __APPLE__ +#define CLOCK_BOOTTIME CLOCK_MONOTONIC +#endif + +#define MSG_MULTIPLE_PUBLISHERS 100 + +bool messaging_use_zmq(); + +class Context { +public: + virtual void * getRawContext() = 0; + static Context * create(); + virtual ~Context(){}; +}; + +class Message { +public: + virtual void init(size_t size) = 0; + virtual void init(char * data, size_t size) = 0; + virtual void close() = 0; + virtual size_t getSize() = 0; + virtual char * getData() = 0; + virtual ~Message(){}; +}; + + +class SubSocket { +public: + virtual int connect(Context *context, std::string endpoint, std::string address, bool conflate=false, bool check_endpoint=true) = 0; + virtual void setTimeout(int timeout) = 0; + virtual Message *receive(bool non_blocking=false) = 0; + virtual void * getRawSocket() = 0; + static SubSocket * create(); + static SubSocket * create(Context * context, std::string endpoint, std::string address="127.0.0.1", bool conflate=false, bool check_endpoint=true); + virtual ~SubSocket(){}; +}; + +class PubSocket { +public: + virtual int connect(Context *context, std::string endpoint, bool check_endpoint=true) = 0; + virtual int sendMessage(Message *message) = 0; + virtual int send(char *data, size_t size) = 0; + virtual bool all_readers_updated() = 0; + static PubSocket * create(); + static PubSocket * create(Context * context, std::string endpoint, bool check_endpoint=true); + static PubSocket * create(Context * context, std::string endpoint, int port, bool check_endpoint=true); + virtual ~PubSocket(){}; +}; + +class Poller { +public: + virtual void registerSocket(SubSocket *socket) = 0; + virtual std::vector poll(int timeout) = 0; + static Poller * create(); + static Poller * create(std::vector sockets); + virtual ~Poller(){}; +}; + +class SubMaster { +public: + SubMaster(const std::vector &service_list, + const char *address = nullptr, const std::vector &ignore_alive = {}); + void update(int timeout = 1000); + void update_msgs(uint64_t current_time, const std::vector> &messages); + inline bool allAlive(const std::vector &service_list = {}) { return all_(service_list, false, true); } + inline bool allValid(const std::vector &service_list = {}) { return all_(service_list, true, false); } + inline bool allAliveAndValid(const std::vector &service_list = {}) { return all_(service_list, true, true); } + void drain(); + ~SubMaster(); + + uint64_t frame = 0; + bool updated(const char *name) const; + bool alive(const char *name) const; + bool valid(const char *name) const; + uint64_t rcv_frame(const char *name) const; + uint64_t rcv_time(const char *name) const; + cereal::Event::Reader &operator[](const char *name) const; + +private: + bool all_(const std::vector &service_list, bool valid, bool alive); + Poller *poller_ = nullptr; + struct SubMessage; + std::map messages_; + std::map services_; +}; + +class MessageBuilder : public capnp::MallocMessageBuilder { +public: + MessageBuilder() = default; + + cereal::Event::Builder initEvent(bool valid = true) { + cereal::Event::Builder event = initRoot(); + struct timespec t; + clock_gettime(CLOCK_BOOTTIME, &t); + uint64_t current_time = t.tv_sec * 1000000000ULL + t.tv_nsec; + event.setLogMonoTime(current_time); + event.setValid(valid); + return event; + } + + kj::ArrayPtr toBytes() { + heapArray_ = capnp::messageToFlatArray(*this); + return heapArray_.asBytes(); + } + +private: + kj::Array heapArray_; +}; + +class PubMaster { +public: + PubMaster(const std::vector &service_list); + inline int send(const char *name, capnp::byte *data, size_t size) { return sockets_.at(name)->send((char *)data, size); } + int send(const char *name, MessageBuilder &msg); + ~PubMaster(); + +private: + std::map sockets_; +}; + +class AlignedBuffer { +public: + kj::ArrayPtr align(const char *data, const size_t size) { + words_size = size / sizeof(capnp::word) + 1; + if (aligned_buf.size() < words_size) { + aligned_buf = kj::heapArray(words_size < 512 ? 512 : words_size); + } + memcpy(aligned_buf.begin(), data, size); + return aligned_buf.slice(0, words_size); + } + inline kj::ArrayPtr align(Message *m) { + return align(m->getData(), m->getSize()); + } +private: + kj::Array aligned_buf; + size_t words_size; +}; diff --git a/cereal/messaging/messaging.pxd b/cereal/messaging/messaging.pxd new file mode 100644 index 000000000..de232da5f --- /dev/null +++ b/cereal/messaging/messaging.pxd @@ -0,0 +1,40 @@ +# distutils: language = c++ +#cython: language_level=3 + +from libcpp.string cimport string +from libcpp.vector cimport vector +from libcpp cimport bool + + +cdef extern from "messaging.h": + cdef cppclass Context: + @staticmethod + Context * create() + + cdef cppclass Message: + void init(size_t) + void init(char *, size_t) + void close() + size_t getSize() + char *getData() + + cdef cppclass SubSocket: + @staticmethod + SubSocket * create() + int connect(Context *, string, string, bool) + Message * receive(bool) + void setTimeout(int) + + cdef cppclass PubSocket: + @staticmethod + PubSocket * create() + int connect(Context *, string) + int sendMessage(Message *) + int send(char *, size_t) + bool all_readers_updated() + + cdef cppclass Poller: + @staticmethod + Poller * create() + void registerSocket(SubSocket *) + vector[SubSocket*] poll(int) nogil diff --git a/cereal/messaging/messaging_pyx.cpp b/cereal/messaging/messaging_pyx.cpp new file mode 100644 index 000000000..534740c01 --- /dev/null +++ b/cereal/messaging/messaging_pyx.cpp @@ -0,0 +1,7181 @@ +/* Generated by Cython 0.29.26 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "cereal/messaging/messaging.h" + ], + "include_dirs": [ + "./cereal/messaging" + ], + "language": "c++", + "name": "cereal.messaging.messaging_pyx", + "sources": [ + "/data/openpilot/cereal/messaging/messaging_pyx.pyx" + ] + }, + "module_name": "cereal.messaging.messaging_pyx" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_26" +#define CYTHON_HEX_VERSION 0x001D1AF0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } + private: + T *ptr; +}; + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject* co=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(0))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too; + if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here + if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too; + Py_XDECREF((PyObject*)co); + co = (PyCodeObject*)call_result; + call_result = NULL; + if (0) { + cleanup_code_too: + Py_XDECREF((PyObject*)co); + co = NULL; + } + end: + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(call_result); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return co; + } +#else + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if defined(PyUnicode_IS_READY) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #else + #define __Pyx_PyUnicode_READY(op) (0) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__cereal__messaging__messaging_pyx +#define __PYX_HAVE_API__cereal__messaging__messaging_pyx +/* Early includes */ +#include +#include +#include "ios" +#include "new" +#include "stdexcept" +#include "typeinfo" +#include +#include +#include "messaging.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 1 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "ascii" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "stringsource", + "cereal/messaging/messaging_pyx.pyx", +}; +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context; +struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller; +struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket; +struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket; + +/* "cereal/messaging/messaging_pyx.pyx":25 + * + * + * cdef class Context: # <<<<<<<<<<<<<< + * cdef cppContext * context + * + */ +struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context { + PyObject_HEAD + Context *context; +}; + + +/* "cereal/messaging/messaging_pyx.pyx":42 + * + * + * cdef class Poller: # <<<<<<<<<<<<<< + * cdef cppPoller * poller + * cdef list sub_sockets + */ +struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller { + PyObject_HEAD + Poller *poller; + PyObject *sub_sockets; +}; + + +/* "cereal/messaging/messaging_pyx.pyx":71 + * return sockets + * + * cdef class SubSocket: # <<<<<<<<<<<<<< + * cdef cppSubSocket * socket + * cdef bool is_owner + */ +struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket { + PyObject_HEAD + struct __pyx_vtabstruct_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_vtab; + SubSocket *socket; + bool is_owner; +}; + + +/* "cereal/messaging/messaging_pyx.pyx":123 + * + * + * cdef class PubSocket: # <<<<<<<<<<<<<< + * cdef cppPubSocket * socket + * + */ +struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket { + PyObject_HEAD + PubSocket *socket; +}; + + + +/* "cereal/messaging/messaging_pyx.pyx":71 + * return sockets + * + * cdef class SubSocket: # <<<<<<<<<<<<<< + * cdef cppSubSocket * socket + * cdef bool is_owner + */ + +struct __pyx_vtabstruct_6cereal_9messaging_13messaging_pyx_SubSocket { + PyObject *(*setPtr)(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *, SubSocket *); +}; +static struct __pyx_vtabstruct_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_vtabptr_6cereal_9messaging_13messaging_pyx_SubSocket; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if CYTHON_FAST_PYCALL + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif // CYTHON_FAST_PYCALL +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* CalculateMetaclass.proto */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +/* Py3ClassCreate.proto */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* GCCDiagnostics.proto */ +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6cereal_9messaging_13messaging_pyx_9SubSocket_setPtr(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self, SubSocket *__pyx_v_ptr); /* proto*/ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libcpp.string' */ + +/* Module declarations from 'libcpp' */ + +/* Module declarations from 'libc' */ + +/* Module declarations from 'libc.errno' */ + +/* Module declarations from 'libcpp.vector' */ + +/* Module declarations from 'cereal.messaging.messaging' */ + +/* Module declarations from 'cereal.messaging.messaging_pyx' */ +static PyTypeObject *__pyx_ptype_6cereal_9messaging_13messaging_pyx_Context = 0; +static PyTypeObject *__pyx_ptype_6cereal_9messaging_13messaging_pyx_Poller = 0; +static PyTypeObject *__pyx_ptype_6cereal_9messaging_13messaging_pyx_SubSocket = 0; +static PyTypeObject *__pyx_ptype_6cereal_9messaging_13messaging_pyx_PubSocket = 0; +static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/ +#define __Pyx_MODULE_NAME "cereal.messaging.messaging_pyx" +extern int __pyx_module_is_main_cereal__messaging__messaging_pyx; +int __pyx_module_is_main_cereal__messaging__messaging_pyx = 0; + +/* Implementation of 'cereal.messaging.messaging_pyx' */ +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_print; +static const char __pyx_k_doc[] = "__doc__"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_exit[] = "exit"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_print[] = "print"; +static const char __pyx_k_Poller[] = "Poller"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_module[] = "__module__"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_Context[] = "Context"; +static const char __pyx_k_address[] = "address"; +static const char __pyx_k_context[] = "context"; +static const char __pyx_k_prepare[] = "__prepare__"; +static const char __pyx_k_conflate[] = "conflate"; +static const char __pyx_k_endpoint[] = "endpoint"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_127_0_0_1[] = "127.0.0.1"; +static const char __pyx_k_PubSocket[] = "PubSocket"; +static const char __pyx_k_SubSocket[] = "SubSocket"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_metaclass[] = "__metaclass__"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_non_blocking[] = "non_blocking"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_MessagingError[] = "MessagingError"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_MultiplePublishersError[] = "MultiplePublishersError"; +static const char __pyx_k_SIGINT_received_exiting[] = "SIGINT received, exiting"; +static const char __pyx_k_cereal_messaging_messaging_pyx[] = "cereal.messaging.messaging_pyx"; +static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +static PyObject *__pyx_kp_b_127_0_0_1; +static PyObject *__pyx_n_s_Context; +static PyObject *__pyx_n_s_MessagingError; +static PyObject *__pyx_n_s_MultiplePublishersError; +static PyObject *__pyx_n_s_Poller; +static PyObject *__pyx_n_s_PubSocket; +static PyObject *__pyx_kp_u_SIGINT_received_exiting; +static PyObject *__pyx_n_s_SubSocket; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_address; +static PyObject *__pyx_n_s_cereal_messaging_messaging_pyx; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_conflate; +static PyObject *__pyx_n_s_context; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_endpoint; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; +static PyObject *__pyx_n_s_non_blocking; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_reduce_ex; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static int __pyx_pf_6cereal_9messaging_13messaging_pyx_7Context___cinit__(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_7Context_2term(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_self); /* proto */ +static void __pyx_pf_6cereal_9messaging_13messaging_pyx_7Context_4__dealloc__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_7Context_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_7Context_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller___cinit__(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *__pyx_v_self); /* proto */ +static void __pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_2__dealloc__(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_4registerSocket(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *__pyx_v_self, struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_socket); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_6poll(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket___cinit__(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self); /* proto */ +static void __pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_2__dealloc__(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_4connect(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self, struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_context, std::string __pyx_v_endpoint, std::string __pyx_v_address, bool __pyx_v_conflate); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_6setTimeout(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self, int __pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_8receive(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self, bool __pyx_v_non_blocking); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket___cinit__(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *__pyx_v_self); /* proto */ +static void __pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_2__dealloc__(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_4connect(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *__pyx_v_self, struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_context, std::string __pyx_v_endpoint); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_6send(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_8all_readers_updated(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_6cereal_9messaging_13messaging_pyx_Context(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6cereal_9messaging_13messaging_pyx_Poller(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6cereal_9messaging_13messaging_pyx_SubSocket(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6cereal_9messaging_13messaging_pyx_PubSocket(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_1; +static std::string __pyx_k__5; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +/* Late includes */ + +/* "cereal/messaging/messaging_pyx.pyx":28 + * cdef cppContext * context + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.context = cppContext.create() + * + */ + +/* Python wrapper */ +static int __pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_7Context___cinit__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6cereal_9messaging_13messaging_pyx_7Context___cinit__(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "cereal/messaging/messaging_pyx.pyx":29 + * + * def __cinit__(self): + * self.context = cppContext.create() # <<<<<<<<<<<<<< + * + * def term(self): + */ + __pyx_v_self->context = Context::create(); + + /* "cereal/messaging/messaging_pyx.pyx":28 + * cdef cppContext * context + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.context = cppContext.create() + * + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/messaging/messaging_pyx.pyx":31 + * self.context = cppContext.create() + * + * def term(self): # <<<<<<<<<<<<<< + * del self.context + * self.context = NULL + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_3term(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_3term(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("term (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_7Context_2term(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_7Context_2term(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("term", 0); + + /* "cereal/messaging/messaging_pyx.pyx":32 + * + * def term(self): + * del self.context # <<<<<<<<<<<<<< + * self.context = NULL + * + */ + delete __pyx_v_self->context; + + /* "cereal/messaging/messaging_pyx.pyx":33 + * def term(self): + * del self.context + * self.context = NULL # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_v_self->context = NULL; + + /* "cereal/messaging/messaging_pyx.pyx":31 + * self.context = cppContext.create() + * + * def term(self): # <<<<<<<<<<<<<< + * del self.context + * self.context = NULL + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/messaging/messaging_pyx.pyx":35 + * self.context = NULL + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * pass + * # Deleting the context will hang if sockets are still active + */ + +/* Python wrapper */ +static void __pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_5__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6cereal_9messaging_13messaging_pyx_7Context_4__dealloc__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6cereal_9messaging_13messaging_pyx_7Context_4__dealloc__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_7Context_6__reduce_cython__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_7Context_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.Context.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_7Context_8__setstate_cython__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_7Context_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.Context.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/messaging/messaging_pyx.pyx":46 + * cdef list sub_sockets + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.sub_sockets = [] + * self.poller = cppPoller.create() + */ + +/* Python wrapper */ +static int __pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller___cinit__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller___cinit__(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "cereal/messaging/messaging_pyx.pyx":47 + * + * def __cinit__(self): + * self.sub_sockets = [] # <<<<<<<<<<<<<< + * self.poller = cppPoller.create() + * + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->sub_sockets); + __Pyx_DECREF(__pyx_v_self->sub_sockets); + __pyx_v_self->sub_sockets = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "cereal/messaging/messaging_pyx.pyx":48 + * def __cinit__(self): + * self.sub_sockets = [] + * self.poller = cppPoller.create() # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_v_self->poller = Poller::create(); + + /* "cereal/messaging/messaging_pyx.pyx":46 + * cdef list sub_sockets + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.sub_sockets = [] + * self.poller = cppPoller.create() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.Poller.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/messaging/messaging_pyx.pyx":50 + * self.poller = cppPoller.create() + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del self.poller + * + */ + +/* Python wrapper */ +static void __pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_2__dealloc__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_2__dealloc__(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "cereal/messaging/messaging_pyx.pyx":51 + * + * def __dealloc__(self): + * del self.poller # <<<<<<<<<<<<<< + * + * def registerSocket(self, SubSocket socket): + */ + delete __pyx_v_self->poller; + + /* "cereal/messaging/messaging_pyx.pyx":50 + * self.poller = cppPoller.create() + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del self.poller + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "cereal/messaging/messaging_pyx.pyx":53 + * del self.poller + * + * def registerSocket(self, SubSocket socket): # <<<<<<<<<<<<<< + * self.sub_sockets.append(socket) + * self.poller.registerSocket(socket.socket) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_5registerSocket(PyObject *__pyx_v_self, PyObject *__pyx_v_socket); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_5registerSocket(PyObject *__pyx_v_self, PyObject *__pyx_v_socket) { + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("registerSocket (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_socket), __pyx_ptype_6cereal_9messaging_13messaging_pyx_SubSocket, 1, "socket", 0))) __PYX_ERR(1, 53, __pyx_L1_error) + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_4registerSocket(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *)__pyx_v_self), ((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *)__pyx_v_socket)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_4registerSocket(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *__pyx_v_self, struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_socket) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("registerSocket", 0); + + /* "cereal/messaging/messaging_pyx.pyx":54 + * + * def registerSocket(self, SubSocket socket): + * self.sub_sockets.append(socket) # <<<<<<<<<<<<<< + * self.poller.registerSocket(socket.socket) + * + */ + if (unlikely(__pyx_v_self->sub_sockets == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); + __PYX_ERR(1, 54, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->sub_sockets, ((PyObject *)__pyx_v_socket)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 54, __pyx_L1_error) + + /* "cereal/messaging/messaging_pyx.pyx":55 + * def registerSocket(self, SubSocket socket): + * self.sub_sockets.append(socket) + * self.poller.registerSocket(socket.socket) # <<<<<<<<<<<<<< + * + * def poll(self, timeout): + */ + __pyx_v_self->poller->registerSocket(__pyx_v_socket->socket); + + /* "cereal/messaging/messaging_pyx.pyx":53 + * del self.poller + * + * def registerSocket(self, SubSocket socket): # <<<<<<<<<<<<<< + * self.sub_sockets.append(socket) + * self.poller.registerSocket(socket.socket) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.Poller.registerSocket", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/messaging/messaging_pyx.pyx":57 + * self.poller.registerSocket(socket.socket) + * + * def poll(self, timeout): # <<<<<<<<<<<<<< + * sockets = [] + * cdef int t = timeout + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_7poll(PyObject *__pyx_v_self, PyObject *__pyx_v_timeout); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_7poll(PyObject *__pyx_v_self, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("poll (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_6poll(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *)__pyx_v_self), ((PyObject *)__pyx_v_timeout)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_6poll(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *__pyx_v_self, PyObject *__pyx_v_timeout) { + PyObject *__pyx_v_sockets = NULL; + int __pyx_v_t; + std::vector __pyx_v_result; + SubSocket *__pyx_v_s; + struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_socket = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + std::vector ::iterator __pyx_t_3; + SubSocket *__pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("poll", 0); + + /* "cereal/messaging/messaging_pyx.pyx":58 + * + * def poll(self, timeout): + * sockets = [] # <<<<<<<<<<<<<< + * cdef int t = timeout + * + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sockets = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "cereal/messaging/messaging_pyx.pyx":59 + * def poll(self, timeout): + * sockets = [] + * cdef int t = timeout # <<<<<<<<<<<<<< + * + * with nogil: + */ + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_timeout); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 59, __pyx_L1_error) + __pyx_v_t = __pyx_t_2; + + /* "cereal/messaging/messaging_pyx.pyx":61 + * cdef int t = timeout + * + * with nogil: # <<<<<<<<<<<<<< + * result = self.poller.poll(t) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "cereal/messaging/messaging_pyx.pyx":62 + * + * with nogil: + * result = self.poller.poll(t) # <<<<<<<<<<<<<< + * + * for s in result: + */ + __pyx_v_result = __pyx_v_self->poller->poll(__pyx_v_t); + } + + /* "cereal/messaging/messaging_pyx.pyx":61 + * cdef int t = timeout + * + * with nogil: # <<<<<<<<<<<<<< + * result = self.poller.poll(t) + * + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "cereal/messaging/messaging_pyx.pyx":64 + * result = self.poller.poll(t) + * + * for s in result: # <<<<<<<<<<<<<< + * socket = SubSocket() + * socket.setPtr(s) + */ + __pyx_t_3 = __pyx_v_result.begin(); + for (;;) { + if (!(__pyx_t_3 != __pyx_v_result.end())) break; + __pyx_t_4 = *__pyx_t_3; + ++__pyx_t_3; + __pyx_v_s = __pyx_t_4; + + /* "cereal/messaging/messaging_pyx.pyx":65 + * + * for s in result: + * socket = SubSocket() # <<<<<<<<<<<<<< + * socket.setPtr(s) + * sockets.append(socket) + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6cereal_9messaging_13messaging_pyx_SubSocket)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_socket, ((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "cereal/messaging/messaging_pyx.pyx":66 + * for s in result: + * socket = SubSocket() + * socket.setPtr(s) # <<<<<<<<<<<<<< + * sockets.append(socket) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6cereal_9messaging_13messaging_pyx_SubSocket *)__pyx_v_socket->__pyx_vtab)->setPtr(__pyx_v_socket, __pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "cereal/messaging/messaging_pyx.pyx":67 + * socket = SubSocket() + * socket.setPtr(s) + * sockets.append(socket) # <<<<<<<<<<<<<< + * + * return sockets + */ + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_sockets, ((PyObject *)__pyx_v_socket)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 67, __pyx_L1_error) + + /* "cereal/messaging/messaging_pyx.pyx":64 + * result = self.poller.poll(t) + * + * for s in result: # <<<<<<<<<<<<<< + * socket = SubSocket() + * socket.setPtr(s) + */ + } + + /* "cereal/messaging/messaging_pyx.pyx":69 + * sockets.append(socket) + * + * return sockets # <<<<<<<<<<<<<< + * + * cdef class SubSocket: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_sockets); + __pyx_r = __pyx_v_sockets; + goto __pyx_L0; + + /* "cereal/messaging/messaging_pyx.pyx":57 + * self.poller.registerSocket(socket.socket) + * + * def poll(self, timeout): # <<<<<<<<<<<<<< + * sockets = [] + * cdef int t = timeout + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.Poller.poll", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_sockets); + __Pyx_XDECREF((PyObject *)__pyx_v_socket); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_8__reduce_cython__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.Poller.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_10__setstate_cython__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_6Poller_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.Poller.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/messaging/messaging_pyx.pyx":75 + * cdef bool is_owner + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.socket = cppSubSocket.create() + * self.is_owner = True + */ + +/* Python wrapper */ +static int __pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket___cinit__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket___cinit__(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "cereal/messaging/messaging_pyx.pyx":76 + * + * def __cinit__(self): + * self.socket = cppSubSocket.create() # <<<<<<<<<<<<<< + * self.is_owner = True + * + */ + __pyx_v_self->socket = SubSocket::create(); + + /* "cereal/messaging/messaging_pyx.pyx":77 + * def __cinit__(self): + * self.socket = cppSubSocket.create() + * self.is_owner = True # <<<<<<<<<<<<<< + * + * if self.socket == NULL: + */ + __pyx_v_self->is_owner = 1; + + /* "cereal/messaging/messaging_pyx.pyx":79 + * self.is_owner = True + * + * if self.socket == NULL: # <<<<<<<<<<<<<< + * raise MessagingError + * + */ + __pyx_t_1 = ((__pyx_v_self->socket == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "cereal/messaging/messaging_pyx.pyx":80 + * + * if self.socket == NULL: + * raise MessagingError # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MessagingError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 80, __pyx_L1_error) + + /* "cereal/messaging/messaging_pyx.pyx":79 + * self.is_owner = True + * + * if self.socket == NULL: # <<<<<<<<<<<<<< + * raise MessagingError + * + */ + } + + /* "cereal/messaging/messaging_pyx.pyx":75 + * cdef bool is_owner + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.socket = cppSubSocket.create() + * self.is_owner = True + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.SubSocket.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/messaging/messaging_pyx.pyx":82 + * raise MessagingError + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.is_owner: + * del self.socket + */ + +/* Python wrapper */ +static void __pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_2__dealloc__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_2__dealloc__(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "cereal/messaging/messaging_pyx.pyx":83 + * + * def __dealloc__(self): + * if self.is_owner: # <<<<<<<<<<<<<< + * del self.socket + * + */ + __pyx_t_1 = (__pyx_v_self->is_owner != 0); + if (__pyx_t_1) { + + /* "cereal/messaging/messaging_pyx.pyx":84 + * def __dealloc__(self): + * if self.is_owner: + * del self.socket # <<<<<<<<<<<<<< + * + * cdef setPtr(self, cppSubSocket * ptr): + */ + delete __pyx_v_self->socket; + + /* "cereal/messaging/messaging_pyx.pyx":83 + * + * def __dealloc__(self): + * if self.is_owner: # <<<<<<<<<<<<<< + * del self.socket + * + */ + } + + /* "cereal/messaging/messaging_pyx.pyx":82 + * raise MessagingError + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.is_owner: + * del self.socket + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "cereal/messaging/messaging_pyx.pyx":86 + * del self.socket + * + * cdef setPtr(self, cppSubSocket * ptr): # <<<<<<<<<<<<<< + * if self.is_owner: + * del self.socket + */ + +static PyObject *__pyx_f_6cereal_9messaging_13messaging_pyx_9SubSocket_setPtr(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self, SubSocket *__pyx_v_ptr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("setPtr", 0); + + /* "cereal/messaging/messaging_pyx.pyx":87 + * + * cdef setPtr(self, cppSubSocket * ptr): + * if self.is_owner: # <<<<<<<<<<<<<< + * del self.socket + * + */ + __pyx_t_1 = (__pyx_v_self->is_owner != 0); + if (__pyx_t_1) { + + /* "cereal/messaging/messaging_pyx.pyx":88 + * cdef setPtr(self, cppSubSocket * ptr): + * if self.is_owner: + * del self.socket # <<<<<<<<<<<<<< + * + * self.is_owner = False + */ + delete __pyx_v_self->socket; + + /* "cereal/messaging/messaging_pyx.pyx":87 + * + * cdef setPtr(self, cppSubSocket * ptr): + * if self.is_owner: # <<<<<<<<<<<<<< + * del self.socket + * + */ + } + + /* "cereal/messaging/messaging_pyx.pyx":90 + * del self.socket + * + * self.is_owner = False # <<<<<<<<<<<<<< + * self.socket = ptr + * + */ + __pyx_v_self->is_owner = 0; + + /* "cereal/messaging/messaging_pyx.pyx":91 + * + * self.is_owner = False + * self.socket = ptr # <<<<<<<<<<<<<< + * + * def connect(self, Context context, string endpoint, string address=b"127.0.0.1", bool conflate=False): + */ + __pyx_v_self->socket = __pyx_v_ptr; + + /* "cereal/messaging/messaging_pyx.pyx":86 + * del self.socket + * + * cdef setPtr(self, cppSubSocket * ptr): # <<<<<<<<<<<<<< + * if self.is_owner: + * del self.socket + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/messaging/messaging_pyx.pyx":93 + * self.socket = ptr + * + * def connect(self, Context context, string endpoint, string address=b"127.0.0.1", bool conflate=False): # <<<<<<<<<<<<<< + * r = self.socket.connect(context.context, endpoint, address, conflate) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_5connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_5connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_context = 0; + std::string __pyx_v_endpoint; + std::string __pyx_v_address; + bool __pyx_v_conflate; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("connect (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_endpoint,&__pyx_n_s_address,&__pyx_n_s_conflate,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_endpoint)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("connect", 0, 2, 4, 1); __PYX_ERR(1, 93, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_address); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_conflate); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "connect") < 0)) __PYX_ERR(1, 93, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_context = ((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *)values[0]); + __pyx_v_endpoint = __pyx_convert_string_from_py_std__in_string(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 93, __pyx_L3_error) + if (values[2]) { + __pyx_v_address = __pyx_convert_string_from_py_std__in_string(values[2]); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 93, __pyx_L3_error) + } else { + __pyx_v_address = __pyx_k__5; + } + if (values[3]) { + __pyx_v_conflate = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conflate == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 93, __pyx_L3_error) + } else { + __pyx_v_conflate = ((bool)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("connect", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 93, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.SubSocket.connect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_6cereal_9messaging_13messaging_pyx_Context, 1, "context", 0))) __PYX_ERR(1, 93, __pyx_L1_error) + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_4connect(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *)__pyx_v_self), __pyx_v_context, __pyx_v_endpoint, __pyx_v_address, __pyx_v_conflate); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_4connect(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self, struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_context, std::string __pyx_v_endpoint, std::string __pyx_v_address, bool __pyx_v_conflate) { + int __pyx_v_r; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("connect", 0); + + /* "cereal/messaging/messaging_pyx.pyx":94 + * + * def connect(self, Context context, string endpoint, string address=b"127.0.0.1", bool conflate=False): + * r = self.socket.connect(context.context, endpoint, address, conflate) # <<<<<<<<<<<<<< + * + * if r != 0: + */ + __pyx_v_r = __pyx_v_self->socket->connect(__pyx_v_context->context, __pyx_v_endpoint, __pyx_v_address, __pyx_v_conflate); + + /* "cereal/messaging/messaging_pyx.pyx":96 + * r = self.socket.connect(context.context, endpoint, address, conflate) + * + * if r != 0: # <<<<<<<<<<<<<< + * if errno.errno == errno.EADDRINUSE: + * raise MultiplePublishersError + */ + __pyx_t_1 = ((__pyx_v_r != 0) != 0); + if (__pyx_t_1) { + + /* "cereal/messaging/messaging_pyx.pyx":97 + * + * if r != 0: + * if errno.errno == errno.EADDRINUSE: # <<<<<<<<<<<<<< + * raise MultiplePublishersError + * else: + */ + __pyx_t_1 = ((errno == EADDRINUSE) != 0); + if (unlikely(__pyx_t_1)) { + + /* "cereal/messaging/messaging_pyx.pyx":98 + * if r != 0: + * if errno.errno == errno.EADDRINUSE: + * raise MultiplePublishersError # <<<<<<<<<<<<<< + * else: + * raise MessagingError + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MultiplePublishersError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 98, __pyx_L1_error) + + /* "cereal/messaging/messaging_pyx.pyx":97 + * + * if r != 0: + * if errno.errno == errno.EADDRINUSE: # <<<<<<<<<<<<<< + * raise MultiplePublishersError + * else: + */ + } + + /* "cereal/messaging/messaging_pyx.pyx":100 + * raise MultiplePublishersError + * else: + * raise MessagingError # <<<<<<<<<<<<<< + * + * def setTimeout(self, int timeout): + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MessagingError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 100, __pyx_L1_error) + } + + /* "cereal/messaging/messaging_pyx.pyx":96 + * r = self.socket.connect(context.context, endpoint, address, conflate) + * + * if r != 0: # <<<<<<<<<<<<<< + * if errno.errno == errno.EADDRINUSE: + * raise MultiplePublishersError + */ + } + + /* "cereal/messaging/messaging_pyx.pyx":93 + * self.socket = ptr + * + * def connect(self, Context context, string endpoint, string address=b"127.0.0.1", bool conflate=False): # <<<<<<<<<<<<<< + * r = self.socket.connect(context.context, endpoint, address, conflate) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.SubSocket.connect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/messaging/messaging_pyx.pyx":102 + * raise MessagingError + * + * def setTimeout(self, int timeout): # <<<<<<<<<<<<<< + * self.socket.setTimeout(timeout) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_7setTimeout(PyObject *__pyx_v_self, PyObject *__pyx_arg_timeout); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_7setTimeout(PyObject *__pyx_v_self, PyObject *__pyx_arg_timeout) { + int __pyx_v_timeout; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("setTimeout (wrapper)", 0); + assert(__pyx_arg_timeout); { + __pyx_v_timeout = __Pyx_PyInt_As_int(__pyx_arg_timeout); if (unlikely((__pyx_v_timeout == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 102, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.SubSocket.setTimeout", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_6setTimeout(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *)__pyx_v_self), ((int)__pyx_v_timeout)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_6setTimeout(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self, int __pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("setTimeout", 0); + + /* "cereal/messaging/messaging_pyx.pyx":103 + * + * def setTimeout(self, int timeout): + * self.socket.setTimeout(timeout) # <<<<<<<<<<<<<< + * + * def receive(self, bool non_blocking=False): + */ + __pyx_v_self->socket->setTimeout(__pyx_v_timeout); + + /* "cereal/messaging/messaging_pyx.pyx":102 + * raise MessagingError + * + * def setTimeout(self, int timeout): # <<<<<<<<<<<<<< + * self.socket.setTimeout(timeout) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/messaging/messaging_pyx.pyx":105 + * self.socket.setTimeout(timeout) + * + * def receive(self, bool non_blocking=False): # <<<<<<<<<<<<<< + * msg = self.socket.receive(non_blocking) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_9receive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_9receive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + bool __pyx_v_non_blocking; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("receive (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_non_blocking,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_non_blocking); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "receive") < 0)) __PYX_ERR(1, 105, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + if (values[0]) { + __pyx_v_non_blocking = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_non_blocking == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 105, __pyx_L3_error) + } else { + __pyx_v_non_blocking = ((bool)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("receive", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 105, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.SubSocket.receive", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_8receive(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *)__pyx_v_self), __pyx_v_non_blocking); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_8receive(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self, bool __pyx_v_non_blocking) { + Message *__pyx_v_msg; + size_t __pyx_v_sz; + PyObject *__pyx_v_m = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("receive", 0); + + /* "cereal/messaging/messaging_pyx.pyx":106 + * + * def receive(self, bool non_blocking=False): + * msg = self.socket.receive(non_blocking) # <<<<<<<<<<<<<< + * + * if msg == NULL: + */ + __pyx_v_msg = __pyx_v_self->socket->receive(__pyx_v_non_blocking); + + /* "cereal/messaging/messaging_pyx.pyx":108 + * msg = self.socket.receive(non_blocking) + * + * if msg == NULL: # <<<<<<<<<<<<<< + * # If a blocking read returns no message check errno if SIGINT was caught in the C++ code + * if errno.errno == errno.EINTR: + */ + __pyx_t_1 = ((__pyx_v_msg == NULL) != 0); + if (__pyx_t_1) { + + /* "cereal/messaging/messaging_pyx.pyx":110 + * if msg == NULL: + * # If a blocking read returns no message check errno if SIGINT was caught in the C++ code + * if errno.errno == errno.EINTR: # <<<<<<<<<<<<<< + * print("SIGINT received, exiting") + * sys.exit(1) + */ + __pyx_t_1 = ((errno == EINTR) != 0); + if (__pyx_t_1) { + + /* "cereal/messaging/messaging_pyx.pyx":111 + * # If a blocking read returns no message check errno if SIGINT was caught in the C++ code + * if errno.errno == errno.EINTR: + * print("SIGINT received, exiting") # <<<<<<<<<<<<<< + * sys.exit(1) + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "cereal/messaging/messaging_pyx.pyx":112 + * if errno.errno == errno.EINTR: + * print("SIGINT received, exiting") + * sys.exit(1) # <<<<<<<<<<<<<< + * + * return None + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_1); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "cereal/messaging/messaging_pyx.pyx":110 + * if msg == NULL: + * # If a blocking read returns no message check errno if SIGINT was caught in the C++ code + * if errno.errno == errno.EINTR: # <<<<<<<<<<<<<< + * print("SIGINT received, exiting") + * sys.exit(1) + */ + } + + /* "cereal/messaging/messaging_pyx.pyx":114 + * sys.exit(1) + * + * return None # <<<<<<<<<<<<<< + * else: + * sz = msg.getSize() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "cereal/messaging/messaging_pyx.pyx":108 + * msg = self.socket.receive(non_blocking) + * + * if msg == NULL: # <<<<<<<<<<<<<< + * # If a blocking read returns no message check errno if SIGINT was caught in the C++ code + * if errno.errno == errno.EINTR: + */ + } + + /* "cereal/messaging/messaging_pyx.pyx":116 + * return None + * else: + * sz = msg.getSize() # <<<<<<<<<<<<<< + * m = msg.getData()[:sz] + * del msg + */ + /*else*/ { + __pyx_v_sz = __pyx_v_msg->getSize(); + + /* "cereal/messaging/messaging_pyx.pyx":117 + * else: + * sz = msg.getSize() + * m = msg.getData()[:sz] # <<<<<<<<<<<<<< + * del msg + * + */ + __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_msg->getData() + 0, __pyx_v_sz - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_m = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "cereal/messaging/messaging_pyx.pyx":118 + * sz = msg.getSize() + * m = msg.getData()[:sz] + * del msg # <<<<<<<<<<<<<< + * + * return m + */ + delete __pyx_v_msg; + + /* "cereal/messaging/messaging_pyx.pyx":120 + * del msg + * + * return m # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_m); + __pyx_r = __pyx_v_m; + goto __pyx_L0; + } + + /* "cereal/messaging/messaging_pyx.pyx":105 + * self.socket.setTimeout(timeout) + * + * def receive(self, bool non_blocking=False): # <<<<<<<<<<<<<< + * msg = self.socket.receive(non_blocking) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.SubSocket.receive", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_m); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_10__reduce_cython__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.SubSocket.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_12__setstate_cython__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9SubSocket_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.SubSocket.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/messaging/messaging_pyx.pyx":126 + * cdef cppPubSocket * socket + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.socket = cppPubSocket.create() + * if self.socket == NULL: + */ + +/* Python wrapper */ +static int __pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket___cinit__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket___cinit__(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "cereal/messaging/messaging_pyx.pyx":127 + * + * def __cinit__(self): + * self.socket = cppPubSocket.create() # <<<<<<<<<<<<<< + * if self.socket == NULL: + * raise MessagingError + */ + __pyx_v_self->socket = PubSocket::create(); + + /* "cereal/messaging/messaging_pyx.pyx":128 + * def __cinit__(self): + * self.socket = cppPubSocket.create() + * if self.socket == NULL: # <<<<<<<<<<<<<< + * raise MessagingError + * + */ + __pyx_t_1 = ((__pyx_v_self->socket == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "cereal/messaging/messaging_pyx.pyx":129 + * self.socket = cppPubSocket.create() + * if self.socket == NULL: + * raise MessagingError # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MessagingError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 129, __pyx_L1_error) + + /* "cereal/messaging/messaging_pyx.pyx":128 + * def __cinit__(self): + * self.socket = cppPubSocket.create() + * if self.socket == NULL: # <<<<<<<<<<<<<< + * raise MessagingError + * + */ + } + + /* "cereal/messaging/messaging_pyx.pyx":126 + * cdef cppPubSocket * socket + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.socket = cppPubSocket.create() + * if self.socket == NULL: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.PubSocket.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/messaging/messaging_pyx.pyx":131 + * raise MessagingError + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del self.socket + * + */ + +/* Python wrapper */ +static void __pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_2__dealloc__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_2__dealloc__(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "cereal/messaging/messaging_pyx.pyx":132 + * + * def __dealloc__(self): + * del self.socket # <<<<<<<<<<<<<< + * + * def connect(self, Context context, string endpoint): + */ + delete __pyx_v_self->socket; + + /* "cereal/messaging/messaging_pyx.pyx":131 + * raise MessagingError + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del self.socket + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "cereal/messaging/messaging_pyx.pyx":134 + * del self.socket + * + * def connect(self, Context context, string endpoint): # <<<<<<<<<<<<<< + * r = self.socket.connect(context.context, endpoint) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_5connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_5connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_context = 0; + std::string __pyx_v_endpoint; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("connect (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_endpoint,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_endpoint)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("connect", 1, 2, 2, 1); __PYX_ERR(1, 134, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "connect") < 0)) __PYX_ERR(1, 134, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_context = ((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *)values[0]); + __pyx_v_endpoint = __pyx_convert_string_from_py_std__in_string(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 134, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("connect", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 134, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.PubSocket.connect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_6cereal_9messaging_13messaging_pyx_Context, 1, "context", 0))) __PYX_ERR(1, 134, __pyx_L1_error) + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_4connect(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *)__pyx_v_self), __pyx_v_context, __pyx_v_endpoint); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_4connect(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *__pyx_v_self, struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context *__pyx_v_context, std::string __pyx_v_endpoint) { + int __pyx_v_r; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("connect", 0); + + /* "cereal/messaging/messaging_pyx.pyx":135 + * + * def connect(self, Context context, string endpoint): + * r = self.socket.connect(context.context, endpoint) # <<<<<<<<<<<<<< + * + * if r != 0: + */ + __pyx_v_r = __pyx_v_self->socket->connect(__pyx_v_context->context, __pyx_v_endpoint); + + /* "cereal/messaging/messaging_pyx.pyx":137 + * r = self.socket.connect(context.context, endpoint) + * + * if r != 0: # <<<<<<<<<<<<<< + * if errno.errno == errno.EADDRINUSE: + * raise MultiplePublishersError + */ + __pyx_t_1 = ((__pyx_v_r != 0) != 0); + if (__pyx_t_1) { + + /* "cereal/messaging/messaging_pyx.pyx":138 + * + * if r != 0: + * if errno.errno == errno.EADDRINUSE: # <<<<<<<<<<<<<< + * raise MultiplePublishersError + * else: + */ + __pyx_t_1 = ((errno == EADDRINUSE) != 0); + if (unlikely(__pyx_t_1)) { + + /* "cereal/messaging/messaging_pyx.pyx":139 + * if r != 0: + * if errno.errno == errno.EADDRINUSE: + * raise MultiplePublishersError # <<<<<<<<<<<<<< + * else: + * raise MessagingError + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MultiplePublishersError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 139, __pyx_L1_error) + + /* "cereal/messaging/messaging_pyx.pyx":138 + * + * if r != 0: + * if errno.errno == errno.EADDRINUSE: # <<<<<<<<<<<<<< + * raise MultiplePublishersError + * else: + */ + } + + /* "cereal/messaging/messaging_pyx.pyx":141 + * raise MultiplePublishersError + * else: + * raise MessagingError # <<<<<<<<<<<<<< + * + * def send(self, bytes data): + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MessagingError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 141, __pyx_L1_error) + } + + /* "cereal/messaging/messaging_pyx.pyx":137 + * r = self.socket.connect(context.context, endpoint) + * + * if r != 0: # <<<<<<<<<<<<<< + * if errno.errno == errno.EADDRINUSE: + * raise MultiplePublishersError + */ + } + + /* "cereal/messaging/messaging_pyx.pyx":134 + * del self.socket + * + * def connect(self, Context context, string endpoint): # <<<<<<<<<<<<<< + * r = self.socket.connect(context.context, endpoint) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.PubSocket.connect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/messaging/messaging_pyx.pyx":143 + * raise MessagingError + * + * def send(self, bytes data): # <<<<<<<<<<<<<< + * length = len(data) + * r = self.socket.send(data, length) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_7send(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_7send(PyObject *__pyx_v_self, PyObject *__pyx_v_data) { + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("send (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 1, "data", 1))) __PYX_ERR(1, 143, __pyx_L1_error) + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_6send(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *)__pyx_v_self), ((PyObject*)__pyx_v_data)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_6send(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *__pyx_v_self, PyObject *__pyx_v_data) { + Py_ssize_t __pyx_v_length; + int __pyx_v_r; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + char *__pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("send", 0); + + /* "cereal/messaging/messaging_pyx.pyx":144 + * + * def send(self, bytes data): + * length = len(data) # <<<<<<<<<<<<<< + * r = self.socket.send(data, length) + * + */ + if (unlikely(__pyx_v_data == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 144, __pyx_L1_error) + } + __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 144, __pyx_L1_error) + __pyx_v_length = __pyx_t_1; + + /* "cereal/messaging/messaging_pyx.pyx":145 + * def send(self, bytes data): + * length = len(data) + * r = self.socket.send(data, length) # <<<<<<<<<<<<<< + * + * if r != length: + */ + if (unlikely(__pyx_v_data == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(1, 145, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_data); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 145, __pyx_L1_error) + __pyx_v_r = __pyx_v_self->socket->send(((char *)__pyx_t_2), __pyx_v_length); + + /* "cereal/messaging/messaging_pyx.pyx":147 + * r = self.socket.send(data, length) + * + * if r != length: # <<<<<<<<<<<<<< + * if errno.errno == errno.EADDRINUSE: + * raise MultiplePublishersError + */ + __pyx_t_3 = ((__pyx_v_r != __pyx_v_length) != 0); + if (__pyx_t_3) { + + /* "cereal/messaging/messaging_pyx.pyx":148 + * + * if r != length: + * if errno.errno == errno.EADDRINUSE: # <<<<<<<<<<<<<< + * raise MultiplePublishersError + * else: + */ + __pyx_t_3 = ((errno == EADDRINUSE) != 0); + if (unlikely(__pyx_t_3)) { + + /* "cereal/messaging/messaging_pyx.pyx":149 + * if r != length: + * if errno.errno == errno.EADDRINUSE: + * raise MultiplePublishersError # <<<<<<<<<<<<<< + * else: + * raise MessagingError + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MultiplePublishersError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 149, __pyx_L1_error) + + /* "cereal/messaging/messaging_pyx.pyx":148 + * + * if r != length: + * if errno.errno == errno.EADDRINUSE: # <<<<<<<<<<<<<< + * raise MultiplePublishersError + * else: + */ + } + + /* "cereal/messaging/messaging_pyx.pyx":151 + * raise MultiplePublishersError + * else: + * raise MessagingError # <<<<<<<<<<<<<< + * + * def all_readers_updated(self): + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MessagingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 151, __pyx_L1_error) + } + + /* "cereal/messaging/messaging_pyx.pyx":147 + * r = self.socket.send(data, length) + * + * if r != length: # <<<<<<<<<<<<<< + * if errno.errno == errno.EADDRINUSE: + * raise MultiplePublishersError + */ + } + + /* "cereal/messaging/messaging_pyx.pyx":143 + * raise MessagingError + * + * def send(self, bytes data): # <<<<<<<<<<<<<< + * length = len(data) + * r = self.socket.send(data, length) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.PubSocket.send", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/messaging/messaging_pyx.pyx":153 + * raise MessagingError + * + * def all_readers_updated(self): # <<<<<<<<<<<<<< + * return self.socket.all_readers_updated() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_9all_readers_updated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_9all_readers_updated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("all_readers_updated (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_8all_readers_updated(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_8all_readers_updated(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("all_readers_updated", 0); + + /* "cereal/messaging/messaging_pyx.pyx":154 + * + * def all_readers_updated(self): + * return self.socket.all_readers_updated() # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->socket->all_readers_updated()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cereal/messaging/messaging_pyx.pyx":153 + * raise MessagingError + * + * def all_readers_updated(self): # <<<<<<<<<<<<<< + * return self.socket.all_readers_updated() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.PubSocket.all_readers_updated", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_10__reduce_cython__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.PubSocket.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_12__setstate_cython__(((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9messaging_13messaging_pyx_9PubSocket_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.messaging.messaging_pyx.PubSocket.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + +static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) { + Py_ssize_t __pyx_v_length; + char const *__pyx_v_data; + std::string __pyx_r; + __Pyx_RefNannyDeclarations + char const *__pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0); + + /* "string.from_py":14 + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<< + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) + */ + __pyx_v_length = 0; + + /* "string.from_py":15 + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<< + * return string(data, length) + * + */ + __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_v_data = __pyx_t_1; + + /* "string.from_py":16 + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = std::string(__pyx_v_data, __pyx_v_length); + goto __pyx_L0; + + /* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6cereal_9messaging_13messaging_pyx_Context(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6cereal_9messaging_13messaging_pyx_Context(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_5__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6cereal_9messaging_13messaging_pyx_Context[] = { + {"term", (PyCFunction)__pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_3term, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6cereal_9messaging_13messaging_pyx_7Context_9__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6cereal_9messaging_13messaging_pyx_Context = { + PyVarObject_HEAD_INIT(0, 0) + "cereal.messaging.messaging_pyx.Context", /*tp_name*/ + sizeof(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Context), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6cereal_9messaging_13messaging_pyx_Context, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6cereal_9messaging_13messaging_pyx_Context, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6cereal_9messaging_13messaging_pyx_Context, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyObject *__pyx_tp_new_6cereal_9messaging_13messaging_pyx_Poller(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *)o); + p->sub_sockets = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6cereal_9messaging_13messaging_pyx_Poller(PyObject *o) { + struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *p = (struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_3__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->sub_sockets); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6cereal_9messaging_13messaging_pyx_Poller(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *p = (struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *)o; + if (p->sub_sockets) { + e = (*v)(p->sub_sockets, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6cereal_9messaging_13messaging_pyx_Poller(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *p = (struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller *)o; + tmp = ((PyObject*)p->sub_sockets); + p->sub_sockets = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6cereal_9messaging_13messaging_pyx_Poller[] = { + {"registerSocket", (PyCFunction)__pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_5registerSocket, METH_O, 0}, + {"poll", (PyCFunction)__pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_7poll, METH_O, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_9__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6cereal_9messaging_13messaging_pyx_6Poller_11__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6cereal_9messaging_13messaging_pyx_Poller = { + PyVarObject_HEAD_INIT(0, 0) + "cereal.messaging.messaging_pyx.Poller", /*tp_name*/ + sizeof(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_Poller), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6cereal_9messaging_13messaging_pyx_Poller, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6cereal_9messaging_13messaging_pyx_Poller, /*tp_traverse*/ + __pyx_tp_clear_6cereal_9messaging_13messaging_pyx_Poller, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6cereal_9messaging_13messaging_pyx_Poller, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6cereal_9messaging_13messaging_pyx_Poller, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; +static struct __pyx_vtabstruct_6cereal_9messaging_13messaging_pyx_SubSocket __pyx_vtable_6cereal_9messaging_13messaging_pyx_SubSocket; + +static PyObject *__pyx_tp_new_6cereal_9messaging_13messaging_pyx_SubSocket(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *)o); + p->__pyx_vtab = __pyx_vtabptr_6cereal_9messaging_13messaging_pyx_SubSocket; + if (unlikely(__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6cereal_9messaging_13messaging_pyx_SubSocket(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_3__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6cereal_9messaging_13messaging_pyx_SubSocket[] = { + {"connect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_5connect, METH_VARARGS|METH_KEYWORDS, 0}, + {"setTimeout", (PyCFunction)__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_7setTimeout, METH_O, 0}, + {"receive", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_9receive, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_11__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6cereal_9messaging_13messaging_pyx_9SubSocket_13__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6cereal_9messaging_13messaging_pyx_SubSocket = { + PyVarObject_HEAD_INIT(0, 0) + "cereal.messaging.messaging_pyx.SubSocket", /*tp_name*/ + sizeof(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6cereal_9messaging_13messaging_pyx_SubSocket, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6cereal_9messaging_13messaging_pyx_SubSocket, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6cereal_9messaging_13messaging_pyx_SubSocket, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyObject *__pyx_tp_new_6cereal_9messaging_13messaging_pyx_PubSocket(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6cereal_9messaging_13messaging_pyx_PubSocket(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_3__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6cereal_9messaging_13messaging_pyx_PubSocket[] = { + {"connect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_5connect, METH_VARARGS|METH_KEYWORDS, 0}, + {"send", (PyCFunction)__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_7send, METH_O, 0}, + {"all_readers_updated", (PyCFunction)__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_9all_readers_updated, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_11__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6cereal_9messaging_13messaging_pyx_9PubSocket_13__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6cereal_9messaging_13messaging_pyx_PubSocket = { + PyVarObject_HEAD_INIT(0, 0) + "cereal.messaging.messaging_pyx.PubSocket", /*tp_name*/ + sizeof(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_PubSocket), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6cereal_9messaging_13messaging_pyx_PubSocket, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6cereal_9messaging_13messaging_pyx_PubSocket, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6cereal_9messaging_13messaging_pyx_PubSocket, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_messaging_pyx(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_messaging_pyx}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "messaging_pyx", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_b_127_0_0_1, __pyx_k_127_0_0_1, sizeof(__pyx_k_127_0_0_1), 0, 0, 0, 0}, + {&__pyx_n_s_Context, __pyx_k_Context, sizeof(__pyx_k_Context), 0, 0, 1, 1}, + {&__pyx_n_s_MessagingError, __pyx_k_MessagingError, sizeof(__pyx_k_MessagingError), 0, 0, 1, 1}, + {&__pyx_n_s_MultiplePublishersError, __pyx_k_MultiplePublishersError, sizeof(__pyx_k_MultiplePublishersError), 0, 0, 1, 1}, + {&__pyx_n_s_Poller, __pyx_k_Poller, sizeof(__pyx_k_Poller), 0, 0, 1, 1}, + {&__pyx_n_s_PubSocket, __pyx_k_PubSocket, sizeof(__pyx_k_PubSocket), 0, 0, 1, 1}, + {&__pyx_kp_u_SIGINT_received_exiting, __pyx_k_SIGINT_received_exiting, sizeof(__pyx_k_SIGINT_received_exiting), 0, 1, 0, 0}, + {&__pyx_n_s_SubSocket, __pyx_k_SubSocket, sizeof(__pyx_k_SubSocket), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1}, + {&__pyx_n_s_cereal_messaging_messaging_pyx, __pyx_k_cereal_messaging_messaging_pyx, sizeof(__pyx_k_cereal_messaging_messaging_pyx), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_conflate, __pyx_k_conflate, sizeof(__pyx_k_conflate), 0, 0, 1, 1}, + {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_endpoint, __pyx_k_endpoint, sizeof(__pyx_k_endpoint), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, + {&__pyx_n_s_non_blocking, __pyx_k_non_blocking, sizeof(__pyx_k_non_blocking), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) + __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(1, 111, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "cereal/messaging/messaging_pyx.pyx":111 + * # If a blocking read returns no message check errno if SIGINT was caught in the C++ code + * if errno.errno == errno.EINTR: + * print("SIGINT received, exiting") # <<<<<<<<<<<<<< + * sys.exit(1) + * + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_SIGINT_received_exiting); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6cereal_9messaging_13messaging_pyx_Context) < 0) __PYX_ERR(1, 25, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6cereal_9messaging_13messaging_pyx_Context.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cereal_9messaging_13messaging_pyx_Context.tp_dictoffset && __pyx_type_6cereal_9messaging_13messaging_pyx_Context.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6cereal_9messaging_13messaging_pyx_Context.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Context, (PyObject *)&__pyx_type_6cereal_9messaging_13messaging_pyx_Context) < 0) __PYX_ERR(1, 25, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6cereal_9messaging_13messaging_pyx_Context) < 0) __PYX_ERR(1, 25, __pyx_L1_error) + __pyx_ptype_6cereal_9messaging_13messaging_pyx_Context = &__pyx_type_6cereal_9messaging_13messaging_pyx_Context; + if (PyType_Ready(&__pyx_type_6cereal_9messaging_13messaging_pyx_Poller) < 0) __PYX_ERR(1, 42, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6cereal_9messaging_13messaging_pyx_Poller.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cereal_9messaging_13messaging_pyx_Poller.tp_dictoffset && __pyx_type_6cereal_9messaging_13messaging_pyx_Poller.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6cereal_9messaging_13messaging_pyx_Poller.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Poller, (PyObject *)&__pyx_type_6cereal_9messaging_13messaging_pyx_Poller) < 0) __PYX_ERR(1, 42, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6cereal_9messaging_13messaging_pyx_Poller) < 0) __PYX_ERR(1, 42, __pyx_L1_error) + __pyx_ptype_6cereal_9messaging_13messaging_pyx_Poller = &__pyx_type_6cereal_9messaging_13messaging_pyx_Poller; + __pyx_vtabptr_6cereal_9messaging_13messaging_pyx_SubSocket = &__pyx_vtable_6cereal_9messaging_13messaging_pyx_SubSocket; + __pyx_vtable_6cereal_9messaging_13messaging_pyx_SubSocket.setPtr = (PyObject *(*)(struct __pyx_obj_6cereal_9messaging_13messaging_pyx_SubSocket *, SubSocket *))__pyx_f_6cereal_9messaging_13messaging_pyx_9SubSocket_setPtr; + if (PyType_Ready(&__pyx_type_6cereal_9messaging_13messaging_pyx_SubSocket) < 0) __PYX_ERR(1, 71, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6cereal_9messaging_13messaging_pyx_SubSocket.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cereal_9messaging_13messaging_pyx_SubSocket.tp_dictoffset && __pyx_type_6cereal_9messaging_13messaging_pyx_SubSocket.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6cereal_9messaging_13messaging_pyx_SubSocket.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6cereal_9messaging_13messaging_pyx_SubSocket.tp_dict, __pyx_vtabptr_6cereal_9messaging_13messaging_pyx_SubSocket) < 0) __PYX_ERR(1, 71, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SubSocket, (PyObject *)&__pyx_type_6cereal_9messaging_13messaging_pyx_SubSocket) < 0) __PYX_ERR(1, 71, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6cereal_9messaging_13messaging_pyx_SubSocket) < 0) __PYX_ERR(1, 71, __pyx_L1_error) + __pyx_ptype_6cereal_9messaging_13messaging_pyx_SubSocket = &__pyx_type_6cereal_9messaging_13messaging_pyx_SubSocket; + if (PyType_Ready(&__pyx_type_6cereal_9messaging_13messaging_pyx_PubSocket) < 0) __PYX_ERR(1, 123, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6cereal_9messaging_13messaging_pyx_PubSocket.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cereal_9messaging_13messaging_pyx_PubSocket.tp_dictoffset && __pyx_type_6cereal_9messaging_13messaging_pyx_PubSocket.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6cereal_9messaging_13messaging_pyx_PubSocket.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PubSocket, (PyObject *)&__pyx_type_6cereal_9messaging_13messaging_pyx_PubSocket) < 0) __PYX_ERR(1, 123, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6cereal_9messaging_13messaging_pyx_PubSocket) < 0) __PYX_ERR(1, 123, __pyx_L1_error) + __pyx_ptype_6cereal_9messaging_13messaging_pyx_PubSocket = &__pyx_type_6cereal_9messaging_13messaging_pyx_PubSocket; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initmessaging_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initmessaging_pyx(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_messaging_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_messaging_pyx(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_messaging_pyx(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + std::string __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'messaging_pyx' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_messaging_pyx(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("messaging_pyx", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_cereal__messaging__messaging_pyx) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "cereal.messaging.messaging_pyx")) { + if (unlikely(PyDict_SetItemString(modules, "cereal.messaging.messaging_pyx", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + + /* "cereal/messaging/messaging_pyx.pyx":4 + * # cython: c_string_encoding=ascii, language_level=3 + * + * import sys # <<<<<<<<<<<<<< + * from libcpp.string cimport string + * from libcpp cimport bool + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "cereal/messaging/messaging_pyx.pyx":17 + * + * + * class MessagingError(Exception): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_MessagingError, __pyx_n_s_MessagingError, (PyObject *) NULL, __pyx_n_s_cereal_messaging_messaging_pyx, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MessagingError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MessagingError, __pyx_t_4) < 0) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "cereal/messaging/messaging_pyx.pyx":21 + * + * + * class MultiplePublishersError(MessagingError): # <<<<<<<<<<<<<< + * pass + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MessagingError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_MultiplePublishersError, __pyx_n_s_MultiplePublishersError, (PyObject *) NULL, __pyx_n_s_cereal_messaging_messaging_pyx, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_MultiplePublishersError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MultiplePublishersError, __pyx_t_4) < 0) __PYX_ERR(1, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "cereal/messaging/messaging_pyx.pyx":93 + * self.socket = ptr + * + * def connect(self, Context context, string endpoint, string address=b"127.0.0.1", bool conflate=False): # <<<<<<<<<<<<<< + * r = self.socket.connect(context.context, endpoint, address, conflate) + * + */ + __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_127_0_0_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 93, __pyx_L1_error) + __pyx_k__5 = __pyx_t_5; + + /* "cereal/messaging/messaging_pyx.pyx":1 + * # distutils: language = c++ # <<<<<<<<<<<<<< + * # cython: c_string_encoding=ascii, language_level=3 + * + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init cereal.messaging.messaging_pyx", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init cereal.messaging.messaging_pyx"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (__Pyx_PyFastCFunction_Check(func)) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* PyObjectGetAttrStrNoError */ +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* SetupReduce */ +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#else + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#endif +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); + if (likely(reduce_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (reduce == object_reduce || PyErr_Occurred()) { + goto __PYX_BAD; + } + setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); + if (likely(setstate_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (!setstate || PyErr_Occurred()) { + goto __PYX_BAD; + } + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto __PYX_GOOD; +__PYX_BAD: + if (!PyErr_Occurred()) + PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +__PYX_GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* CalculateMetaclass */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +/* Py3ClassCreate */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; ip) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/cereal/messaging/messaging_pyx.pyx b/cereal/messaging/messaging_pyx.pyx new file mode 100644 index 000000000..eed548bb8 --- /dev/null +++ b/cereal/messaging/messaging_pyx.pyx @@ -0,0 +1,154 @@ +# distutils: language = c++ +# cython: c_string_encoding=ascii, language_level=3 + +import sys +from libcpp.string cimport string +from libcpp cimport bool +from libc cimport errno + + +from .messaging cimport Context as cppContext +from .messaging cimport SubSocket as cppSubSocket +from .messaging cimport PubSocket as cppPubSocket +from .messaging cimport Poller as cppPoller +from .messaging cimport Message as cppMessage + + +class MessagingError(Exception): + pass + + +class MultiplePublishersError(MessagingError): + pass + + +cdef class Context: + cdef cppContext * context + + def __cinit__(self): + self.context = cppContext.create() + + def term(self): + del self.context + self.context = NULL + + def __dealloc__(self): + pass + # Deleting the context will hang if sockets are still active + # TODO: Figure out a way to make sure the context is closed last + # del self.context + + +cdef class Poller: + cdef cppPoller * poller + cdef list sub_sockets + + def __cinit__(self): + self.sub_sockets = [] + self.poller = cppPoller.create() + + def __dealloc__(self): + del self.poller + + def registerSocket(self, SubSocket socket): + self.sub_sockets.append(socket) + self.poller.registerSocket(socket.socket) + + def poll(self, timeout): + sockets = [] + cdef int t = timeout + + with nogil: + result = self.poller.poll(t) + + for s in result: + socket = SubSocket() + socket.setPtr(s) + sockets.append(socket) + + return sockets + +cdef class SubSocket: + cdef cppSubSocket * socket + cdef bool is_owner + + def __cinit__(self): + self.socket = cppSubSocket.create() + self.is_owner = True + + if self.socket == NULL: + raise MessagingError + + def __dealloc__(self): + if self.is_owner: + del self.socket + + cdef setPtr(self, cppSubSocket * ptr): + if self.is_owner: + del self.socket + + self.is_owner = False + self.socket = ptr + + def connect(self, Context context, string endpoint, string address=b"127.0.0.1", bool conflate=False): + r = self.socket.connect(context.context, endpoint, address, conflate) + + if r != 0: + if errno.errno == errno.EADDRINUSE: + raise MultiplePublishersError + else: + raise MessagingError + + def setTimeout(self, int timeout): + self.socket.setTimeout(timeout) + + def receive(self, bool non_blocking=False): + msg = self.socket.receive(non_blocking) + + if msg == NULL: + # If a blocking read returns no message check errno if SIGINT was caught in the C++ code + if errno.errno == errno.EINTR: + print("SIGINT received, exiting") + sys.exit(1) + + return None + else: + sz = msg.getSize() + m = msg.getData()[:sz] + del msg + + return m + + +cdef class PubSocket: + cdef cppPubSocket * socket + + def __cinit__(self): + self.socket = cppPubSocket.create() + if self.socket == NULL: + raise MessagingError + + def __dealloc__(self): + del self.socket + + def connect(self, Context context, string endpoint): + r = self.socket.connect(context.context, endpoint) + + if r != 0: + if errno.errno == errno.EADDRINUSE: + raise MultiplePublishersError + else: + raise MessagingError + + def send(self, bytes data): + length = len(data) + r = self.socket.send(data, length) + + if r != length: + if errno.errno == errno.EADDRINUSE: + raise MultiplePublishersError + else: + raise MessagingError + + def all_readers_updated(self): + return self.socket.all_readers_updated() diff --git a/cereal/messaging/messaging_pyx.so b/cereal/messaging/messaging_pyx.so new file mode 100755 index 000000000..1848a8a22 Binary files /dev/null and b/cereal/messaging/messaging_pyx.so differ diff --git a/cereal/messaging/msgq.cc b/cereal/messaging/msgq.cc new file mode 100644 index 000000000..cabf8aaba --- /dev/null +++ b/cereal/messaging/msgq.cc @@ -0,0 +1,464 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "msgq.h" + +void sigusr2_handler(int signal) { + assert(signal == SIGUSR2); +} + +uint64_t msgq_get_uid(void){ + std::random_device rd("/dev/urandom"); + std::uniform_int_distribution distribution(0,std::numeric_limits::max()); + + #ifdef __APPLE__ + // TODO: this doesn't work + uint64_t uid = distribution(rd) << 32 | getpid(); + #else + uint64_t uid = distribution(rd) << 32 | syscall(SYS_gettid); + #endif + + return uid; +} + +int msgq_msg_init_size(msgq_msg_t * msg, size_t size){ + msg->size = size; + msg->data = new(std::nothrow) char[size]; + + return (msg->data == NULL) ? -1 : 0; +} + + +int msgq_msg_init_data(msgq_msg_t * msg, char * data, size_t size) { + int r = msgq_msg_init_size(msg, size); + + if (r == 0) + memcpy(msg->data, data, size); + + return r; +} + +int msgq_msg_close(msgq_msg_t * msg){ + if (msg->size > 0) + delete[] msg->data; + + msg->size = 0; + + return 0; +} + +void msgq_reset_reader(msgq_queue_t * q){ + int id = q->reader_id; + q->read_valids[id]->store(true); + q->read_pointers[id]->store(*q->write_pointer); +} + +void msgq_wait_for_subscriber(msgq_queue_t *q){ + while (*q->num_readers == 0){ + ; + } + + return; +} + + +int msgq_new_queue(msgq_queue_t * q, const char * path, size_t size){ + assert(size < 0xFFFFFFFF); // Buffer must be smaller than 2^32 bytes + std::signal(SIGUSR2, sigusr2_handler); + + const char * prefix = "/dev/shm/"; + char * full_path = new char[strlen(path) + strlen(prefix) + 1]; + strcpy(full_path, prefix); + strcat(full_path, path); + + auto fd = open(full_path, O_RDWR | O_CREAT, 0664); + if (fd < 0) { + std::cout << "Warning, could not open: " << full_path << std::endl; + delete[] full_path; + return -1; + } + delete[] full_path; + + int rc = ftruncate(fd, size + sizeof(msgq_header_t)); + if (rc < 0){ + close(fd); + return -1; + } + char * mem = (char*)mmap(NULL, size + sizeof(msgq_header_t), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + close(fd); + + if (mem == NULL){ + return -1; + } + q->mmap_p = mem; + + msgq_header_t *header = (msgq_header_t *)mem; + + // Setup pointers to header segment + q->num_readers = reinterpret_cast*>(&header->num_readers); + q->write_pointer = reinterpret_cast*>(&header->write_pointer); + q->write_uid = reinterpret_cast*>(&header->write_uid); + + for (size_t i = 0; i < NUM_READERS; i++){ + q->read_pointers[i] = reinterpret_cast*>(&header->read_pointers[i]); + q->read_valids[i] = reinterpret_cast*>(&header->read_valids[i]); + q->read_uids[i] = reinterpret_cast*>(&header->read_uids[i]); + } + + q->data = mem + sizeof(msgq_header_t); + q->size = size; + q->reader_id = -1; + + q->endpoint = path; + q->read_conflate = false; + + return 0; +} + +void msgq_close_queue(msgq_queue_t *q){ + if (q->mmap_p != NULL){ + munmap(q->mmap_p, q->size + sizeof(msgq_header_t)); + } +} + + +void msgq_init_publisher(msgq_queue_t * q) { + //std::cout << "Starting publisher" << std::endl; + uint64_t uid = msgq_get_uid(); + + *q->write_uid = uid; + *q->num_readers = 0; + + for (size_t i = 0; i < NUM_READERS; i++){ + *q->read_valids[i] = false; + *q->read_uids[i] = 0; + } + + q->write_uid_local = uid; +} + +static void thread_signal(uint32_t tid) { + #ifndef SYS_tkill + // TODO: this won't work for multithreaded programs + kill(tid, SIGUSR2); + #else + syscall(SYS_tkill, tid, SIGUSR2); + #endif +} + +void msgq_init_subscriber(msgq_queue_t * q) { + assert(q != NULL); + assert(q->num_readers != NULL); + + uint64_t uid = msgq_get_uid(); + + // Get reader id + while (true){ + uint64_t cur_num_readers = *q->num_readers; + uint64_t new_num_readers = cur_num_readers + 1; + + // No more slots available. Reset all subscribers to kick out inactive ones + if (new_num_readers > NUM_READERS){ + std::cout << "Warning, evicting all subscribers!" << std::endl; + *q->num_readers = 0; + + for (size_t i = 0; i < NUM_READERS; i++){ + *q->read_valids[i] = false; + + uint64_t old_uid = *q->read_uids[i]; + *q->read_uids[i] = 0; + + // Wake up reader in case they are in a poll + thread_signal(old_uid & 0xFFFFFFFF); + } + + continue; + } + + // Use atomic compare and swap to handle race condition + // where two subscribers start at the same time + if (std::atomic_compare_exchange_strong(q->num_readers, + &cur_num_readers, + new_num_readers)){ + q->reader_id = cur_num_readers; + q->read_uid_local = uid; + + // We start with read_valid = false, + // on the first read the read pointer will be synchronized with the write pointer + *q->read_valids[cur_num_readers] = false; + *q->read_pointers[cur_num_readers] = 0; + *q->read_uids[cur_num_readers] = uid; + break; + } + } + + //std::cout << "New subscriber id: " << q->reader_id << " uid: " << q->read_uid_local << " " << q->endpoint << std::endl; + msgq_reset_reader(q); +} + +int msgq_msg_send(msgq_msg_t * msg, msgq_queue_t *q){ + // Die if we are no longer the active publisher + if (q->write_uid_local != *q->write_uid){ + std::cout << "Killing old publisher: " << q->endpoint << std::endl; + errno = EADDRINUSE; + return -1; + } + + uint64_t total_msg_size = ALIGN(msg->size + sizeof(int64_t)); + + // We need to fit at least three messages in the queue, + // then we can always safely access the last message + assert(3 * total_msg_size <= q->size); + + uint64_t num_readers = *q->num_readers; + + uint32_t write_cycles, write_pointer; + UNPACK64(write_cycles, write_pointer, *q->write_pointer); + + char *p = q->data + write_pointer; // add base offset + + // Check remaining space + // Always leave space for a wraparound tag for the next message, including alignment + int64_t remaining_space = q->size - write_pointer - total_msg_size - sizeof(int64_t); + if (remaining_space <= 0){ + // Write -1 size tag indicating wraparound + *(int64_t*)p = -1; + + // Invalidate all readers that are beyond the write pointer + // TODO: should we handle the case where a new reader shows up while this is running? + for (uint64_t i = 0; i < num_readers; i++){ + uint64_t read_pointer = *q->read_pointers[i]; + uint64_t read_cycles = read_pointer >> 32; + read_pointer &= 0xFFFFFFFF; + + if ((read_pointer > write_pointer) && (read_cycles != write_cycles)) { + *q->read_valids[i] = false; + } + } + + // Update global and local copies of write pointer and write_cycles + write_pointer = 0; + write_cycles = write_cycles + 1; + PACK64(*q->write_pointer, write_cycles, write_pointer); + + // Set actual pointer to the beginning of the data segment + p = q->data; + } + + // Invalidate readers that are in the area that will be written + uint64_t start = write_pointer; + uint64_t end = ALIGN(start + sizeof(int64_t) + msg->size); + + for (uint64_t i = 0; i < num_readers; i++){ + uint32_t read_cycles, read_pointer; + UNPACK64(read_cycles, read_pointer, *q->read_pointers[i]); + + if ((read_pointer >= start) && (read_pointer < end) && (read_cycles != write_cycles)) { + *q->read_valids[i] = false; + } + } + + + // Write size tag + std::atomic *size_p = reinterpret_cast*>(p); + *size_p = msg->size; + + // Copy data + memcpy(p + sizeof(int64_t), msg->data, msg->size); + __sync_synchronize(); + + // Update write pointer + uint32_t new_ptr = ALIGN(write_pointer + msg->size + sizeof(int64_t)); + PACK64(*q->write_pointer, write_cycles, new_ptr); + + // Notify readers + for (uint64_t i = 0; i < num_readers; i++){ + uint64_t reader_uid = *q->read_uids[i]; + thread_signal(reader_uid & 0xFFFFFFFF); + } + + return msg->size; +} + + +int msgq_msg_ready(msgq_queue_t * q){ + start: + int id = q->reader_id; + assert(id >= 0); // Make sure subscriber is initialized + + if (q->read_uid_local != *q->read_uids[id]){ + std::cout << q->endpoint << ": Reader was evicted, reconnecting" << std::endl; + msgq_init_subscriber(q); + goto start; + } + + // Check valid + if (!*q->read_valids[id]){ + msgq_reset_reader(q); + goto start; + } + + uint32_t read_cycles, read_pointer; + UNPACK64(read_cycles, read_pointer, *q->read_pointers[id]); + + uint32_t write_cycles, write_pointer; + UNPACK64(write_cycles, write_pointer, *q->write_pointer); + + // Check if new message is available + return (read_pointer != write_pointer); +} + +int msgq_msg_recv(msgq_msg_t * msg, msgq_queue_t * q){ + start: + int id = q->reader_id; + assert(id >= 0); // Make sure subscriber is initialized + + if (q->read_uid_local != *q->read_uids[id]){ + std::cout << q->endpoint << ": Reader was evicted, reconnecting" << std::endl; + msgq_init_subscriber(q); + goto start; + } + + // Check valid + if (!*q->read_valids[id]){ + msgq_reset_reader(q); + goto start; + } + + uint32_t read_cycles, read_pointer; + UNPACK64(read_cycles, read_pointer, *q->read_pointers[id]); + + uint32_t write_cycles, write_pointer; + UNPACK64(write_cycles, write_pointer, *q->write_pointer); + + char * p = q->data + read_pointer; + + // Check if new message is available + if (read_pointer == write_pointer) { + msg->size = 0; + return 0; + } + + // Read potential message size + std::atomic *size_p = reinterpret_cast*>(p); + std::int64_t size = *size_p; + + // Check if the size that was read is valid + if (!*q->read_valids[id]){ + msgq_reset_reader(q); + goto start; + } + + // If size is -1 the buffer was full, and we need to wrap around + if (size == -1){ + read_cycles++; + PACK64(*q->read_pointers[id], read_cycles, 0); + goto start; + } + + // crashing is better than passing garbage data to the consumer + // the size will have weird value if it was overwritten by data accidentally + assert((uint64_t)size < q->size); + assert(size > 0); + + uint32_t new_read_pointer = ALIGN(read_pointer + sizeof(std::int64_t) + size); + + // If conflate is true, check if this is the latest message, else start over + if (q->read_conflate){ + if (new_read_pointer != write_pointer){ + // Update read pointer + PACK64(*q->read_pointers[id], read_cycles, new_read_pointer); + goto start; + } + } + + // Copy message + if (msgq_msg_init_size(msg, size) < 0) + return -1; + + __sync_synchronize(); + memcpy(msg->data, p + sizeof(int64_t), size); + __sync_synchronize(); + + // Update read pointer + PACK64(*q->read_pointers[id], read_cycles, new_read_pointer); + + // Check if the actual data that was copied is valid + if (!*q->read_valids[id]){ + msgq_msg_close(msg); + msgq_reset_reader(q); + goto start; + } + + + return msg->size; +} + + + +int msgq_poll(msgq_pollitem_t * items, size_t nitems, int timeout){ + int num = 0; + + // Check if messages ready + for (size_t i = 0; i < nitems; i++) { + items[i].revents = msgq_msg_ready(items[i].q); + if (items[i].revents) num++; + } + + int ms = (timeout == -1) ? 100 : timeout; + struct timespec ts; + ts.tv_sec = ms / 1000; + ts.tv_nsec = (ms % 1000) * 1000 * 1000; + + + while (num == 0) { + int ret; + + ret = nanosleep(&ts, &ts); + + // Check if messages ready + for (size_t i = 0; i < nitems; i++) { + if (items[i].revents == 0 && msgq_msg_ready(items[i].q)){ + num += 1; + items[i].revents = 1; + } + } + + // exit if we had a timeout and the sleep finished + if (timeout != -1 && ret == 0){ + break; + } + } + + return num; +} + +bool msgq_all_readers_updated(msgq_queue_t *q) { + uint64_t num_readers = *q->num_readers; + for (uint64_t i = 0; i < num_readers; i++) { + if (*q->read_valids[i] && *q->write_pointer != *q->read_pointers[i]) { + return false; + } + } + return num_readers > 0; +} diff --git a/cereal/messaging/msgq.h b/cereal/messaging/msgq.h new file mode 100644 index 000000000..90a20acdd --- /dev/null +++ b/cereal/messaging/msgq.h @@ -0,0 +1,68 @@ +#pragma once +#include +#include +#include +#include + +#define DEFAULT_SEGMENT_SIZE (10 * 1024 * 1024) +#define NUM_READERS 10 +#define ALIGN(n) ((n + (8 - 1)) & -8) + +#define UNPACK64(higher, lower, input) do {uint64_t tmp = input; higher = tmp >> 32; lower = tmp & 0xFFFFFFFF;} while (0) +#define PACK64(output, higher, lower) output = ((uint64_t)higher << 32 ) | ((uint64_t)lower & 0xFFFFFFFF) + +struct msgq_header_t { + uint64_t num_readers; + uint64_t write_pointer; + uint64_t write_uid; + uint64_t read_pointers[NUM_READERS]; + uint64_t read_valids[NUM_READERS]; + uint64_t read_uids[NUM_READERS]; +}; + +struct msgq_queue_t { + std::atomic *num_readers; + std::atomic *write_pointer; + std::atomic *write_uid; + std::atomic *read_pointers[NUM_READERS]; + std::atomic *read_valids[NUM_READERS]; + std::atomic *read_uids[NUM_READERS]; + char * mmap_p; + char * data; + size_t size; + int reader_id; + uint64_t read_uid_local; + uint64_t write_uid_local; + + bool read_conflate; + std::string endpoint; +}; + +struct msgq_msg_t { + size_t size; + char * data; +}; + +struct msgq_pollitem_t { + msgq_queue_t *q; + int revents; +}; + +void msgq_wait_for_subscriber(msgq_queue_t *q); +void msgq_reset_reader(msgq_queue_t *q); + +int msgq_msg_init_size(msgq_msg_t *msg, size_t size); +int msgq_msg_init_data(msgq_msg_t *msg, char * data, size_t size); +int msgq_msg_close(msgq_msg_t *msg); + +int msgq_new_queue(msgq_queue_t * q, const char * path, size_t size); +void msgq_close_queue(msgq_queue_t *q); +void msgq_init_publisher(msgq_queue_t * q); +void msgq_init_subscriber(msgq_queue_t * q); + +int msgq_msg_send(msgq_msg_t *msg, msgq_queue_t *q); +int msgq_msg_recv(msgq_msg_t *msg, msgq_queue_t *q); +int msgq_msg_ready(msgq_queue_t * q); +int msgq_poll(msgq_pollitem_t * items, size_t nitems, int timeout); + +bool msgq_all_readers_updated(msgq_queue_t *q); diff --git a/cereal/messaging/socketmaster.cc b/cereal/messaging/socketmaster.cc new file mode 100644 index 000000000..56698dc2e --- /dev/null +++ b/cereal/messaging/socketmaster.cc @@ -0,0 +1,205 @@ +#include +#include +#include +#include +#include + +#include "services.h" +#include "messaging.h" + +const bool SIMULATION = (getenv("SIMULATION") != nullptr) && (std::string(getenv("SIMULATION")) == "1"); + +static inline uint64_t nanos_since_boot() { + struct timespec t; + clock_gettime(CLOCK_BOOTTIME, &t); + return t.tv_sec * 1000000000ULL + t.tv_nsec; +} + +static const service *get_service(const char *name) { + for (const auto &it : services) { + if (strcmp(it.name, name) == 0) return ⁢ + } + return nullptr; +} + +static inline bool inList(const std::vector &list, const char *value) { + for (auto &v : list) { + if (strcmp(value, v) == 0) return true; + } + return false; +} + +class MessageContext { +public: + MessageContext() : ctx_(nullptr) {}; + ~MessageContext() { delete ctx_; } + inline Context *context() { + std::call_once(init_flag, [=]() { ctx_ = Context::create(); }); + return ctx_; + } +private: + Context *ctx_; + std::once_flag init_flag; +}; + +MessageContext message_context; + +struct SubMaster::SubMessage { + std::string name; + SubSocket *socket = nullptr; + int freq = 0; + bool updated = false, alive = false, valid = true, ignore_alive; + uint64_t rcv_time = 0, rcv_frame = 0; + void *allocated_msg_reader = nullptr; + capnp::FlatArrayMessageReader *msg_reader = nullptr; + AlignedBuffer aligned_buf; + cereal::Event::Reader event; +}; + +SubMaster::SubMaster(const std::vector &service_list, const char *address, + const std::vector &ignore_alive) { + poller_ = Poller::create(); + for (auto name : service_list) { + const service *serv = get_service(name); + assert(serv != nullptr); + SubSocket *socket = SubSocket::create(message_context.context(), name, address ? address : "127.0.0.1", true); + assert(socket != 0); + poller_->registerSocket(socket); + SubMessage *m = new SubMessage{ + .name = name, + .socket = socket, + .freq = serv->frequency, + .ignore_alive = inList(ignore_alive, name), + .allocated_msg_reader = malloc(sizeof(capnp::FlatArrayMessageReader))}; + m->msg_reader = new (m->allocated_msg_reader) capnp::FlatArrayMessageReader({}); + messages_[socket] = m; + services_[name] = m; + } +} + +void SubMaster::update(int timeout) { + for (auto &kv : messages_) kv.second->updated = false; + + auto sockets = poller_->poll(timeout); + uint64_t current_time = nanos_since_boot(); + + std::vector> messages; + + for (auto s : sockets) { + Message *msg = s->receive(true); + if (msg == nullptr) continue; + + SubMessage *m = messages_.at(s); + + m->msg_reader->~FlatArrayMessageReader(); + capnp::ReaderOptions options; + options.traversalLimitInWords = kj::maxValue; // Don't limit + m->msg_reader = new (m->allocated_msg_reader) capnp::FlatArrayMessageReader(m->aligned_buf.align(msg), options); + delete msg; + messages.push_back({m->name, m->msg_reader->getRoot()}); + } + + update_msgs(current_time, messages); +} + +void SubMaster::update_msgs(uint64_t current_time, const std::vector> &messages){ + if (++frame == UINT64_MAX) frame = 1; + + for(auto &kv : messages) { + auto m_find = services_.find(kv.first); + if (m_find == services_.end()){ + continue; + } + SubMessage *m = m_find->second; + m->event = kv.second; + m->updated = true; + m->rcv_time = current_time; + m->rcv_frame = frame; + m->valid = m->event.getValid(); + if (SIMULATION) m->alive = true; + } + + if (!SIMULATION) { + for (auto &kv : messages_) { + SubMessage *m = kv.second; + m->alive = (m->freq <= (1e-5) || ((current_time - m->rcv_time) * (1e-9)) < (10.0 / m->freq)); + } + } +} + +bool SubMaster::all_(const std::vector &service_list, bool valid, bool alive) { + int found = 0; + for (auto &kv : messages_) { + SubMessage *m = kv.second; + if (service_list.size() == 0 || inList(service_list, m->name.c_str())) { + found += (!valid || m->valid) && (!alive || (m->alive || m->ignore_alive)); + } + } + return service_list.size() == 0 ? found == messages_.size() : found == service_list.size(); +} + +void SubMaster::drain() { + while (true) { + auto polls = poller_->poll(0); + if (polls.size() == 0) + break; + + for (auto sock : polls) { + Message *msg = sock->receive(true); + delete msg; + } + } +} + +bool SubMaster::updated(const char *name) const { + return services_.at(name)->updated; +} + +bool SubMaster::alive(const char *name) const { + return services_.at(name)->alive; +} + +bool SubMaster::valid(const char *name) const { + return services_.at(name)->valid; +} + +uint64_t SubMaster::rcv_frame(const char *name) const { + return services_.at(name)->rcv_frame; +} + +uint64_t SubMaster::rcv_time(const char *name) const { + return services_.at(name)->rcv_time; +} + +cereal::Event::Reader &SubMaster::operator[](const char *name) const { + return services_.at(name)->event; +}; + +SubMaster::~SubMaster() { + delete poller_; + for (auto &kv : messages_) { + SubMessage *m = kv.second; + m->msg_reader->~FlatArrayMessageReader(); + free(m->allocated_msg_reader); + delete m->socket; + delete m; + } +} + +PubMaster::PubMaster(const std::vector &service_list) { + for (auto name : service_list) { + assert(get_service(name) != nullptr); + PubSocket *socket = PubSocket::create(message_context.context(), name); + assert(socket); + sockets_[name] = socket; + } +} + +int PubMaster::send(const char *name, MessageBuilder &msg) { + auto bytes = msg.toBytes(); + return send(name, bytes.begin(), bytes.size()); +} + +PubMaster::~PubMaster() { + for (auto s : sockets_) delete s.second; +} diff --git a/cereal/services.h b/cereal/services.h new file mode 100644 index 000000000..ca8e2a35d --- /dev/null +++ b/cereal/services.h @@ -0,0 +1,52 @@ +/* THIS IS AN AUTOGENERATED FILE, PLEASE EDIT services.py */ +#ifndef __SERVICES_H +#define __SERVICES_H +struct service { char name[0x100]; int port; bool should_log; int frequency; int decimation; }; +static struct service services[] = { + { "sensorEvents", 8001, true, 100, 100 }, + { "gpsNMEA", 8002, true, 9, -1 }, + { "deviceState", 8003, true, 2, 1 }, + { "can", 8004, true, 100, -1 }, + { "controlsState", 8005, true, 100, 10 }, + { "pandaStates", 8006, true, 2, 1 }, + { "peripheralState", 8007, true, 2, 1 }, + { "radarState", 8008, true, 20, 5 }, + { "roadEncodeIdx", 8009, true, 20, 1 }, + { "liveTracks", 8010, true, 20, -1 }, + { "sendcan", 8011, true, 100, 139 }, + { "logMessage", 8012, true, 0, -1 }, + { "errorLogMessage", 8013, true, 0, 1 }, + { "liveCalibration", 8014, true, 4, 4 }, + { "androidLog", 8015, true, 0, -1 }, + { "carState", 8016, true, 100, 10 }, + { "carControl", 8017, true, 100, 10 }, + { "longitudinalPlan", 8018, true, 20, 5 }, + { "procLog", 8019, true, 0, -1 }, + { "gpsLocationExternal", 8020, true, 10, 10 }, + { "ubloxGnss", 8021, true, 10, -1 }, + { "clocks", 8023, true, 1, 1 }, + { "ubloxRaw", 8024, true, 20, -1 }, + { "liveLocationKalman", 8025, true, 20, 5 }, + { "liveParameters", 8026, true, 20, 5 }, + { "cameraOdometry", 8027, true, 20, 5 }, + { "lateralPlan", 8028, true, 20, 5 }, + { "thumbnail", 8029, true, 0, 1 }, + { "carEvents", 8030, true, 1, 1 }, + { "carParams", 8031, true, 0, 1 }, + { "roadCameraState", 8032, true, 20, 20 }, + { "driverCameraState", 8033, true, 10, 10 }, + { "driverEncodeIdx", 8034, true, 10, 1 }, + { "driverState", 8035, true, 10, 5 }, + { "driverMonitoringState", 8036, true, 10, 5 }, + { "wideRoadEncodeIdx", 8037, true, 20, 1 }, + { "wideRoadCameraState", 8038, true, 20, 20 }, + { "modelV2", 8039, true, 20, 40 }, + { "managerState", 8040, true, 2, 1 }, + { "uploaderState", 8041, true, 0, 1 }, + { "navInstruction", 8042, true, 0, -1 }, + { "navRoute", 8043, true, 0, -1 }, + { "navThumbnail", 8044, true, 0, -1 }, + { "testJoystick", 8045, false, 0, -1 }, +}; +#endif + diff --git a/cereal/services.py b/cereal/services.py new file mode 100755 index 000000000..c8fc3d5cc --- /dev/null +++ b/cereal/services.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python3 +import os +from typing import Optional + +TICI = os.path.isfile('/TICI') +RESERVED_PORT = 8022 # sshd +STARTING_PORT = 8001 + + +def new_port(port: int): + port += STARTING_PORT + return port + 1 if port >= RESERVED_PORT else port + + +class Service: + def __init__(self, port: int, should_log: bool, frequency: float, decimation: Optional[int] = None): + self.port = port + self.should_log = should_log + self.frequency = frequency + self.decimation = decimation + +DCAM_FREQ = 10. if not TICI else 20. + +services = { + # service: (should_log, frequency, qlog decimation (optional)) + "sensorEvents": (True, 100., 100), + "gpsNMEA": (True, 9.), + "deviceState": (True, 2., 1), + "can": (True, 100.), + "controlsState": (True, 100., 10), + "pandaStates": (True, 2., 1), + "peripheralState": (True, 2., 1), + "radarState": (True, 20., 5), + "roadEncodeIdx": (True, 20., 1), + "liveTracks": (True, 20.), + "sendcan": (True, 100., 139), + "logMessage": (True, 0.), + "errorLogMessage": (True, 0., 1), + "liveCalibration": (True, 4., 4), + "androidLog": (True, 0.), + "carState": (True, 100., 10), + "carControl": (True, 100., 10), + "longitudinalPlan": (True, 20., 5), + "procLog": (True, 0.5), + "gpsLocationExternal": (True, 10., 10), + "ubloxGnss": (True, 10.), + "clocks": (True, 1., 1), + "ubloxRaw": (True, 20.), + "liveLocationKalman": (True, 20., 5), + "liveParameters": (True, 20., 5), + "cameraOdometry": (True, 20., 5), + "lateralPlan": (True, 20., 5), + "thumbnail": (True, 0.2, 1), + "carEvents": (True, 1., 1), + "carParams": (True, 0.02, 1), + "roadCameraState": (True, 20., 20), + "driverCameraState": (True, DCAM_FREQ, DCAM_FREQ), + "driverEncodeIdx": (True, DCAM_FREQ, 1), + "driverState": (True, DCAM_FREQ, DCAM_FREQ / 2), + "driverMonitoringState": (True, DCAM_FREQ, DCAM_FREQ / 2), + "wideRoadEncodeIdx": (True, 20., 1), + "wideRoadCameraState": (True, 20., 20), + "modelV2": (True, 20., 40), + "managerState": (True, 2., 1), + "uploaderState": (True, 0., 1), + "navInstruction": (True, 0.), + "navRoute": (True, 0.), + "navThumbnail": (True, 0.), + + # debug + "testJoystick": (False, 0.), +} +service_list = {name: Service(new_port(idx), *vals) for # type: ignore + idx, (name, vals) in enumerate(services.items())} + + +def build_header(): + h = "" + h += "/* THIS IS AN AUTOGENERATED FILE, PLEASE EDIT services.py */\n" + h += "#ifndef __SERVICES_H\n" + h += "#define __SERVICES_H\n" + h += "struct service { char name[0x100]; int port; bool should_log; int frequency; int decimation; };\n" + h += "static struct service services[] = {\n" + for k, v in service_list.items(): + should_log = "true" if v.should_log else "false" + decimation = -1 if v.decimation is None else v.decimation + h += ' { "%s", %d, %s, %d, %d },\n' % \ + (k, v.port, should_log, v.frequency, decimation) + h += "};\n" + h += "#endif\n" + return h + + +if __name__ == "__main__": + print(build_header()) diff --git a/cereal/visionipc/.gitignore b/cereal/visionipc/.gitignore new file mode 100644 index 000000000..fa5a2b9f3 --- /dev/null +++ b/cereal/visionipc/.gitignore @@ -0,0 +1,2 @@ +visionipc_pyx.cpp +*.so diff --git a/cereal/visionipc/__init__.py b/cereal/visionipc/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/cereal/visionipc/ipc.cc b/cereal/visionipc/ipc.cc new file mode 100644 index 000000000..29c4c9c37 --- /dev/null +++ b/cereal/visionipc/ipc.cc @@ -0,0 +1,121 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef __APPLE__ +#define getsocket() socket(AF_UNIX, SOCK_STREAM, 0) +#else +#define getsocket() socket(AF_UNIX, SOCK_SEQPACKET, 0) +#endif + +#include "ipc.h" + +int ipc_connect(const char* socket_path) { + int err; + + int sock = getsocket(); + + if (sock < 0) return -1; + struct sockaddr_un addr = { + .sun_family = AF_UNIX, + }; + snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socket_path); + err = connect(sock, (struct sockaddr*)&addr, sizeof(addr)); + if (err != 0) { + close(sock); + return -1; + } + + return sock; +} + +int ipc_bind(const char* socket_path) { + int err; + + unlink(socket_path); + + int sock = getsocket(); + + struct sockaddr_un addr = { + .sun_family = AF_UNIX, + }; + snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socket_path); + err = bind(sock, (struct sockaddr *)&addr, sizeof(addr)); + assert(err == 0); + + err = listen(sock, 3); + assert(err == 0); + + return sock; +} + + +int ipc_sendrecv_with_fds(bool send, int fd, void *buf, size_t buf_size, int* fds, int num_fds, + int *out_num_fds) { + char control_buf[CMSG_SPACE(sizeof(int) * num_fds)]; + memset(control_buf, 0, CMSG_SPACE(sizeof(int) * num_fds)); + + struct iovec iov = { + .iov_base = buf, + .iov_len = buf_size, + }; + struct msghdr msg = { + .msg_iov = &iov, + .msg_iovlen = 1, + }; + + if (num_fds > 0) { + assert(fds); + + msg.msg_control = control_buf; + msg.msg_controllen = CMSG_SPACE(sizeof(int) * num_fds); + } + + if (send) { + if (num_fds) { + struct cmsghdr *cmsg = CMSG_FIRSTHDR(&msg); + assert(cmsg); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN(sizeof(int) * num_fds); + memcpy(CMSG_DATA(cmsg), fds, sizeof(int) * num_fds); + } + return sendmsg(fd, &msg, 0); + } else { + int r = recvmsg(fd, &msg, 0); + if (r < 0) return r; + + int recv_fds = 0; + if (msg.msg_controllen > 0) { + struct cmsghdr *cmsg = CMSG_FIRSTHDR(&msg); + assert(cmsg); + assert(cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS); + recv_fds = (cmsg->cmsg_len - CMSG_LEN(0)); + assert(recv_fds > 0 && (recv_fds % sizeof(int)) == 0); + recv_fds /= sizeof(int); + + assert(fds && recv_fds <= num_fds); + memcpy(fds, CMSG_DATA(cmsg), sizeof(int) * recv_fds); + } + + if (msg.msg_flags) { + for (int i=0; i + +int ipc_connect(const char* socket_path); +int ipc_bind(const char* socket_path); +int ipc_sendrecv_with_fds(bool send, int fd, void *buf, size_t buf_size, int* fds, int num_fds, + int *out_num_fds); diff --git a/cereal/visionipc/test_runner.cc b/cereal/visionipc/test_runner.cc new file mode 100644 index 000000000..62bf7476a --- /dev/null +++ b/cereal/visionipc/test_runner.cc @@ -0,0 +1,2 @@ +#define CATCH_CONFIG_MAIN +#include "catch2/catch.hpp" diff --git a/cereal/visionipc/visionbuf.cc b/cereal/visionipc/visionbuf.cc new file mode 100644 index 000000000..e94a8bbc0 --- /dev/null +++ b/cereal/visionipc/visionbuf.cc @@ -0,0 +1,49 @@ +#include "visionbuf.h" + +#define ALIGN(x, align) (((x) + (align)-1) & ~((align)-1)) + +#ifdef QCOM +// from libadreno_utils.so +extern "C" void compute_aligned_width_and_height(int width, + int height, + int bpp, + int tile_mode, + int raster_mode, + int padding_threshold, + int *aligned_w, + int *aligned_h); +#endif + +void visionbuf_compute_aligned_width_and_height(int width, int height, int *aligned_w, int *aligned_h) { +#ifdef QCOM + compute_aligned_width_and_height(ALIGN(width, 32), ALIGN(height, 32), 3, 0, 0, 512, aligned_w, aligned_h); +#else + *aligned_w = width; *aligned_h = height; +#endif +} + +void VisionBuf::init_rgb(size_t init_width, size_t init_height, size_t init_stride) { + this->rgb = true; + this->width = init_width; + this->height = init_height; + this->stride = init_stride; +} + +void VisionBuf::init_yuv(size_t init_width, size_t init_height){ + this->rgb = false; + this->width = init_width; + this->height = init_height; + + this->y = (uint8_t *)this->addr; + this->u = this->y + (this->width * this->height); + this->v = this->u + (this->width / 2 * this->height / 2); +} + + +uint64_t VisionBuf::get_frame_id() { + return *frame_id; +} + +void VisionBuf::set_frame_id(uint64_t id) { + *frame_id = id; +} diff --git a/cereal/visionipc/visionbuf.h b/cereal/visionipc/visionbuf.h new file mode 100644 index 000000000..b27a08b26 --- /dev/null +++ b/cereal/visionipc/visionbuf.h @@ -0,0 +1,67 @@ +#pragma once +#include "visionipc.h" + +#define CL_USE_DEPRECATED_OPENCL_1_2_APIS +#ifdef __APPLE__ +#include +#else +#include +#endif + +#define VISIONBUF_SYNC_FROM_DEVICE 0 +#define VISIONBUF_SYNC_TO_DEVICE 1 + +enum VisionStreamType { + VISION_STREAM_RGB_BACK, + VISION_STREAM_RGB_FRONT, + VISION_STREAM_RGB_WIDE, + VISION_STREAM_ROAD, + VISION_STREAM_DRIVER, + VISION_STREAM_WIDE_ROAD, + VISION_STREAM_RGB_MAP, + VISION_STREAM_MAX, +}; + +class VisionBuf { + public: + size_t len = 0; + size_t mmap_len = 0; + void * addr = nullptr; + uint64_t *frame_id; + int fd = 0; + + bool rgb = false; + size_t width = 0; + size_t height = 0; + size_t stride = 0; + + // YUV + uint8_t * y = nullptr; + uint8_t * u = nullptr; + uint8_t * v = nullptr; + + // Visionipc + uint64_t server_id = 0; + size_t idx = 0; + VisionStreamType type; + + // OpenCL + cl_mem buf_cl = nullptr; + cl_command_queue copy_q = nullptr; + + // ion + int handle = 0; + + void allocate(size_t len); + void import(); + void init_cl(cl_device_id device_id, cl_context ctx); + void init_rgb(size_t width, size_t height, size_t stride); + void init_yuv(size_t width, size_t height); + int sync(int dir); + int free(); + + void set_frame_id(uint64_t id); + uint64_t get_frame_id(); +}; + +void visionbuf_compute_aligned_width_and_height(int width, int height, int *aligned_w, int *aligned_h); diff --git a/cereal/visionipc/visionbuf_cl.cc b/cereal/visionipc/visionbuf_cl.cc new file mode 100644 index 000000000..0286d28fd --- /dev/null +++ b/cereal/visionipc/visionbuf_cl.cc @@ -0,0 +1,94 @@ +#include "visionbuf.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +std::atomic offset = 0; + +static void *malloc_with_fd(size_t len, int *fd) { + char full_path[0x100]; + +#ifdef __APPLE__ + snprintf(full_path, sizeof(full_path)-1, "/tmp/visionbuf_%d_%d", getpid(), offset++); +#else + snprintf(full_path, sizeof(full_path)-1, "/dev/shm/visionbuf_%d_%d", getpid(), offset++); +#endif + + *fd = open(full_path, O_RDWR | O_CREAT, 0664); + assert(*fd >= 0); + + unlink(full_path); + + ftruncate(*fd, len); + void *addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, *fd, 0); + assert(addr != MAP_FAILED); + + return addr; +} + +void VisionBuf::allocate(size_t length) { + this->len = length; + this->mmap_len = this->len; + this->addr = malloc_with_fd(this->len, &this->fd); + this->frame_id = (uint64_t*)((uint8_t*)this->addr + this->len); +} + +void VisionBuf::init_cl(cl_device_id device_id, cl_context ctx){ + int err; + + this->copy_q = clCreateCommandQueue(ctx, device_id, 0, &err); + assert(err == 0); + + this->buf_cl = clCreateBuffer(ctx, CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, this->len, this->addr, &err); + assert(err == 0); +} + + +void VisionBuf::import(){ + assert(this->fd >= 0); + this->addr = mmap(NULL, this->mmap_len, PROT_READ | PROT_WRITE, MAP_SHARED, this->fd, 0); + assert(this->addr != MAP_FAILED); + + this->frame_id = (uint64_t*)((uint8_t*)this->addr + this->len); +} + + +int VisionBuf::sync(int dir) { + int err = 0; + if (!this->buf_cl) return 0; + + if (dir == VISIONBUF_SYNC_FROM_DEVICE) { + err = clEnqueueReadBuffer(this->copy_q, this->buf_cl, CL_FALSE, 0, this->len, this->addr, 0, NULL, NULL); + } else { + err = clEnqueueWriteBuffer(this->copy_q, this->buf_cl, CL_FALSE, 0, this->len, this->addr, 0, NULL, NULL); + } + + if (err == 0){ + err = clFinish(this->copy_q); + } + + return err; +} + +int VisionBuf::free() { + int err = 0; + if (this->buf_cl){ + err = clReleaseMemObject(this->buf_cl); + if (err != 0) return err; + + err = clReleaseCommandQueue(this->copy_q); + if (err != 0) return err; + } + + err = munmap(this->addr, this->len); + if (err != 0) return err; + + err = close(this->fd); + return err; +} diff --git a/cereal/visionipc/visionbuf_ion.cc b/cereal/visionipc/visionbuf_ion.cc new file mode 100644 index 000000000..c66b668c6 --- /dev/null +++ b/cereal/visionipc/visionbuf_ion.cc @@ -0,0 +1,158 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "visionbuf.h" + +// keep trying if x gets interrupted by a signal +#define HANDLE_EINTR(x) \ + ({ \ + decltype(x) ret; \ + int try_cnt = 0; \ + do { \ + ret = (x); \ + } while (ret == -1 && errno == EINTR && try_cnt++ < 100); \ + ret; \ + }) + +// just hard-code these for convenience +// size_t device_page_size = 0; +// clGetDeviceInfo(device_id, CL_DEVICE_PAGE_SIZE_QCOM, +// sizeof(device_page_size), &device_page_size, +// NULL); + +// size_t padding_cl = 0; +// clGetDeviceInfo(device_id, CL_DEVICE_EXT_MEM_PADDING_IN_BYTES_QCOM, +// sizeof(padding_cl), &padding_cl, +// NULL); +#define DEVICE_PAGE_SIZE_CL 4096 +#define PADDING_CL 0 + +static int ion_fd = -1; +static void ion_init() { + if (ion_fd == -1) { + ion_fd = open("/dev/ion", O_RDWR | O_NONBLOCK); + } +} + +void VisionBuf::allocate(size_t length) { + int err; + + ion_init(); + + struct ion_allocation_data ion_alloc = {0}; + ion_alloc.len = length + PADDING_CL + sizeof(uint64_t); + ion_alloc.align = 4096; + ion_alloc.heap_id_mask = 1 << ION_IOMMU_HEAP_ID; + ion_alloc.flags = ION_FLAG_CACHED; + + err = HANDLE_EINTR(ioctl(ion_fd, ION_IOC_ALLOC, &ion_alloc)); + assert(err == 0); + + struct ion_fd_data ion_fd_data = {0}; + ion_fd_data.handle = ion_alloc.handle; + err = HANDLE_EINTR(ioctl(ion_fd, ION_IOC_SHARE, &ion_fd_data)); + assert(err == 0); + + void *mmap_addr = mmap(NULL, ion_alloc.len, + PROT_READ | PROT_WRITE, + MAP_SHARED, ion_fd_data.fd, 0); + assert(mmap_addr != MAP_FAILED); + + memset(mmap_addr, 0, ion_alloc.len); + + this->len = length; + this->mmap_len = ion_alloc.len; + this->addr = mmap_addr; + this->handle = ion_alloc.handle; + this->fd = ion_fd_data.fd; + this->frame_id = (uint64_t*)((uint8_t*)this->addr + this->len + PADDING_CL); +} + +void VisionBuf::import(){ + int err; + assert(this->fd >= 0); + + ion_init(); + + // Get handle + struct ion_fd_data fd_data = {0}; + fd_data.fd = this->fd; + err = HANDLE_EINTR(ioctl(ion_fd, ION_IOC_IMPORT, &fd_data)); + assert(err == 0); + + this->handle = fd_data.handle; + this->addr = mmap(NULL, this->mmap_len, PROT_READ | PROT_WRITE, MAP_SHARED, this->fd, 0); + assert(this->addr != MAP_FAILED); + + this->frame_id = (uint64_t*)((uint8_t*)this->addr + this->len + PADDING_CL); +} + +void VisionBuf::init_cl(cl_device_id device_id, cl_context ctx) { + int err; + + assert(((uintptr_t)this->addr % DEVICE_PAGE_SIZE_CL) == 0); + + cl_mem_ion_host_ptr ion_cl = {0}; + ion_cl.ext_host_ptr.allocation_type = CL_MEM_ION_HOST_PTR_QCOM; + ion_cl.ext_host_ptr.host_cache_policy = CL_MEM_HOST_UNCACHED_QCOM; + ion_cl.ion_filedesc = this->fd; + ion_cl.ion_hostptr = this->addr; + + this->buf_cl = clCreateBuffer(ctx, + CL_MEM_USE_HOST_PTR | CL_MEM_EXT_HOST_PTR_QCOM, + this->len, &ion_cl, &err); + assert(err == 0); +} + + +int VisionBuf::sync(int dir) { + struct ion_flush_data flush_data = {0}; + flush_data.handle = this->handle; + flush_data.vaddr = this->addr; + flush_data.offset = 0; + flush_data.length = this->len; + + // ION_IOC_INV_CACHES ~= DMA_FROM_DEVICE + // ION_IOC_CLEAN_CACHES ~= DMA_TO_DEVICE + // ION_IOC_CLEAN_INV_CACHES ~= DMA_BIDIRECTIONAL + + struct ion_custom_data custom_data = {0}; + + assert(dir == VISIONBUF_SYNC_FROM_DEVICE || dir == VISIONBUF_SYNC_TO_DEVICE); + custom_data.cmd = (dir == VISIONBUF_SYNC_FROM_DEVICE) ? + ION_IOC_INV_CACHES : ION_IOC_CLEAN_CACHES; + + custom_data.arg = (unsigned long)&flush_data; + return HANDLE_EINTR(ioctl(ion_fd, ION_IOC_CUSTOM, &custom_data)); +} + +int VisionBuf::free() { + int err = 0; + + if (this->buf_cl){ + err = clReleaseMemObject(this->buf_cl); + if (err != 0) return err; + } + + err = munmap(this->addr, this->mmap_len); + if (err != 0) return err; + + err = close(this->fd); + if (err != 0) return err; + + struct ion_handle_data handle_data = {.handle = this->handle}; + return HANDLE_EINTR(ioctl(ion_fd, ION_IOC_FREE, &handle_data)); +} diff --git a/cereal/visionipc/visionipc.h b/cereal/visionipc/visionipc.h new file mode 100644 index 000000000..fb640692c --- /dev/null +++ b/cereal/visionipc/visionipc.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include + +constexpr int VISIONIPC_MAX_FDS = 128; + +struct VisionIpcBufExtra { + uint32_t frame_id; + uint64_t timestamp_sof; + uint64_t timestamp_eof; +}; + +struct VisionIpcPacket { + uint64_t server_id; + size_t idx; + struct VisionIpcBufExtra extra; +}; diff --git a/cereal/visionipc/visionipc.pxd b/cereal/visionipc/visionipc.pxd new file mode 100644 index 000000000..5cb729f7e --- /dev/null +++ b/cereal/visionipc/visionipc.pxd @@ -0,0 +1,39 @@ +# distutils: language = c++ +#cython: language_level=3 + +from libcpp.string cimport string +from libcpp.vector cimport vector +from libc.stdint cimport uint32_t, uint64_t +from libcpp cimport bool + +cdef extern from "visionbuf.h": + cdef enum VisionStreamType: + pass + + cdef cppclass VisionBuf: + void * addr + size_t len + size_t width + size_t height + size_t stride + +cdef extern from "visionipc.h": + struct VisionIpcBufExtra: + uint32_t frame_id + uint64_t timestamp_sof + uint64_t timestamp_eof + +cdef extern from "visionipc_server.h": + cdef cppclass VisionIpcServer: + VisionIpcServer(string, void*, void*) + void create_buffers(VisionStreamType, size_t, bool, size_t, size_t) + VisionBuf * get_buffer(VisionStreamType) + void send(VisionBuf *, VisionIpcBufExtra *, bool) + void start_listener() + +cdef extern from "visionipc_client.h": + cdef cppclass VisionIpcClient: + VisionIpcClient(string, VisionStreamType, bool, void*, void*) + VisionBuf * recv(VisionIpcBufExtra *, int) + bool connect(bool) + bool is_connected() diff --git a/cereal/visionipc/visionipc_client.cc b/cereal/visionipc/visionipc_client.cc new file mode 100644 index 000000000..ece239356 --- /dev/null +++ b/cereal/visionipc/visionipc_client.cc @@ -0,0 +1,129 @@ +#include +#include +#include +#include + +#include "visionipc/ipc.h" +#include "visionipc/visionipc_client.h" +#include "visionipc/visionipc_server.h" +#include "logger/logger.h" + +VisionIpcClient::VisionIpcClient(std::string name, VisionStreamType type, bool conflate, cl_device_id device_id, cl_context ctx) : name(name), type(type), device_id(device_id), ctx(ctx) { + msg_ctx = Context::create(); + sock = SubSocket::create(msg_ctx, get_endpoint_name(name, type), "127.0.0.1", conflate, false); + + poller = Poller::create(); + poller->registerSocket(sock); +} + +// Connect is not thread safe. Do not use the buffers while calling connect +bool VisionIpcClient::connect(bool blocking){ + connected = false; + + // Cleanup old buffers on reconnect + for (size_t i = 0; i < num_buffers; i++){ + if (buffers[i].free() != 0) { + LOGE("Failed to free buffer %zu", i); + } + } + + num_buffers = 0; + + // Connect to server socket and ask for all FDs of type + std::string path = "/tmp/visionipc_" + name; + + int socket_fd = -1; + while (socket_fd < 0) { + socket_fd = ipc_connect(path.c_str()); + + if (socket_fd < 0) { + if (blocking){ + std::cout << "VisionIpcClient connecting" << std::endl; + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + } else { + return false; + } + } + } + + // Send stream type to server to request FDs + int r = ipc_sendrecv_with_fds(true, socket_fd, &type, sizeof(type), nullptr, 0, nullptr); + assert(r == sizeof(type)); + + // Get FDs + int fds[VISIONIPC_MAX_FDS]; + VisionBuf bufs[VISIONIPC_MAX_FDS]; + r = ipc_sendrecv_with_fds(false, socket_fd, &bufs, sizeof(bufs), fds, VISIONIPC_MAX_FDS, &num_buffers); + + assert(num_buffers >= 0); + assert(r == sizeof(VisionBuf) * num_buffers); + + // Import buffers + for (size_t i = 0; i < num_buffers; i++){ + buffers[i] = bufs[i]; + buffers[i].fd = fds[i]; + buffers[i].import(); + if (buffers[i].rgb) { + buffers[i].init_rgb(buffers[i].width, buffers[i].height, buffers[i].stride); + } else { + buffers[i].init_yuv(buffers[i].width, buffers[i].height); + } + + if (device_id) buffers[i].init_cl(device_id, ctx); + } + + close(socket_fd); + connected = true; + return true; +} + +VisionBuf * VisionIpcClient::recv(VisionIpcBufExtra * extra, const int timeout_ms){ + auto p = poller->poll(timeout_ms); + + if (!p.size()){ + return nullptr; + } + + Message * r = sock->receive(true); + if (r == nullptr){ + return nullptr; + } + + // Get buffer + assert(r->getSize() == sizeof(VisionIpcPacket)); + VisionIpcPacket *packet = (VisionIpcPacket*)r->getData(); + + assert(packet->idx < num_buffers); + VisionBuf * buf = &buffers[packet->idx]; + + if (buf->server_id != packet->server_id){ + connected = false; + delete r; + return nullptr; + } + + if (extra) { + *extra = packet->extra; + } + + if (buf->sync(VISIONBUF_SYNC_TO_DEVICE) != 0) { + LOGE("Failed to sync buffer"); + } + + delete r; + return buf; +} + + + +VisionIpcClient::~VisionIpcClient(){ + for (size_t i = 0; i < num_buffers; i++){ + if (buffers[i].free() != 0) { + LOGE("Failed to free buffer %zu", i); + } + } + + delete sock; + delete poller; + delete msg_ctx; +} diff --git a/cereal/visionipc/visionipc_client.h b/cereal/visionipc/visionipc_client.h new file mode 100644 index 000000000..a6426ce92 --- /dev/null +++ b/cereal/visionipc/visionipc_client.h @@ -0,0 +1,33 @@ +#pragma once +#include +#include +#include + +#include "messaging/messaging.h" +#include "visionipc/visionipc.h" +#include "visionipc/visionbuf.h" + +class VisionIpcClient { +private: + std::string name; + Context * msg_ctx; + SubSocket * sock; + Poller * poller; + + VisionStreamType type; + + cl_device_id device_id = nullptr; + cl_context ctx = nullptr; + + void init_msgq(bool conflate); + +public: + bool connected = false; + int num_buffers = 0; + VisionBuf buffers[VISIONIPC_MAX_FDS]; + VisionIpcClient(std::string name, VisionStreamType type, bool conflate, cl_device_id device_id=nullptr, cl_context ctx=nullptr); + ~VisionIpcClient(); + VisionBuf * recv(VisionIpcBufExtra * extra=nullptr, const int timeout_ms=100); + bool connect(bool blocking=true); + bool is_connected() { return connected; } +}; diff --git a/cereal/visionipc/visionipc_pyx.cpp b/cereal/visionipc/visionipc_pyx.cpp new file mode 100644 index 000000000..50a1d2832 --- /dev/null +++ b/cereal/visionipc/visionipc_pyx.cpp @@ -0,0 +1,29180 @@ +/* Generated by Cython 0.29.26 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "cereal/visionipc/visionbuf.h", + "cereal/visionipc/visionipc.h", + "cereal/visionipc/visionipc_client.h", + "cereal/visionipc/visionipc_server.h" + ], + "include_dirs": [ + "./cereal/visionipc" + ], + "language": "c++", + "name": "cereal.visionipc.visionipc_pyx", + "sources": [ + "/data/openpilot/cereal/visionipc/visionipc_pyx.pyx" + ] + }, + "module_name": "cereal.visionipc.visionipc_pyx" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_26" +#define CYTHON_HEX_VERSION 0x001D1AF0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } + private: + T *ptr; +}; + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject* co=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(0))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too; + if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here + if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too; + Py_XDECREF((PyObject*)co); + co = (PyCodeObject*)call_result; + call_result = NULL; + if (0) { + cleanup_code_too: + Py_XDECREF((PyObject*)co); + co = NULL; + } + end: + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(call_result); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return co; + } +#else + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if defined(PyUnicode_IS_READY) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #else + #define __Pyx_PyUnicode_READY(op) (0) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__cereal__visionipc__visionipc_pyx +#define __PYX_HAVE_API__cereal__visionipc__visionipc_pyx +/* Early includes */ +#include +#include +#include "numpy/arrayobject.h" +#include "numpy/ndarrayobject.h" +#include "numpy/ndarraytypes.h" +#include "numpy/arrayscalars.h" +#include "numpy/ufuncobject.h" + + /* NumPy API declarations from "numpy/__init__.pxd" */ + +#include +#include +#include "ios" +#include "new" +#include "stdexcept" +#include "typeinfo" +#include +#include "visionbuf.h" +#include "visionipc.h" +#include "visionipc_server.h" +#include "visionipc_client.h" +#include "pythread.h" +#include +#include "pystate.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 1 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "ascii" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +/* Header.proto */ +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "stringsource", + "cereal/visionipc/visionipc_pyx.pyx", + "__init__.pxd", + "type.pxd", +}; +/* MemviewSliceStruct.proto */ +struct __pyx_memoryview_obj; +typedef struct { + struct __pyx_memoryview_obj *memview; + char *data; + Py_ssize_t shape[8]; + Py_ssize_t strides[8]; + Py_ssize_t suboffsets[8]; +} __Pyx_memviewslice; +#define __Pyx_MemoryView_Len(m) (m.shape[0]) + +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __pyx_atomic_int_type int +#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\ + !defined(__i386__) + #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0 + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type LONG + #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 + #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using Intel atomics" + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #warning "Not using atomics" + #endif +#endif +typedef volatile __pyx_atomic_int_type __pyx_atomic_int; +#if CYTHON_ATOMICS + #define __pyx_add_acquisition_count(memview)\ + __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) +#else + #define __pyx_add_acquisition_count(memview)\ + __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) +#endif + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + +/* BufferFormatStructs.proto */ +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; + struct __Pyx_StructField_* fields; + size_t size; + size_t arraysize[8]; + int ndim; + char typegroup; + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":690 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":691 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":692 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":693 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":697 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":698 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":699 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":700 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":704 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":705 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":714 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":715 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":716 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":718 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":719 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":720 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":722 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":723 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":725 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":726 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":727 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + + +/*--- Type declarations ---*/ +struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer; +struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient; +struct __pyx_obj___Pyx_EnumMeta; +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":729 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":730 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":731 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":733 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* "cereal/visionipc/visionipc_pyx.pyx":18 + * from .visionipc cimport VisionIpcBufExtra + * + * cpdef enum VisionStreamType: # <<<<<<<<<<<<<< + * VISION_STREAM_RGB_BACK + * VISION_STREAM_RGB_FRONT + */ +enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType { + __pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_RGB_BACK, + __pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_RGB_FRONT, + __pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_RGB_WIDE, + __pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_ROAD, + __pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_DRIVER, + __pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_WIDE_ROAD +}; + +/* "cereal/visionipc/visionipc_pyx.pyx":27 + * + * + * cdef class VisionIpcServer: # <<<<<<<<<<<<<< + * cdef cppVisionIpcServer * server + * + */ +struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer { + PyObject_HEAD + VisionIpcServer *server; +}; + + +/* "cereal/visionipc/visionipc_pyx.pyx":57 + * + * + * cdef class VisionIpcClient: # <<<<<<<<<<<<<< + * cdef cppVisionBuf * buf + * cdef cppVisionIpcClient * client + */ +struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient { + PyObject_HEAD + VisionBuf *buf; + VisionIpcClient *client; +}; + + +/* "EnumBase":15 + * + * @cython.internal + * cdef class __Pyx_EnumMeta(type): # <<<<<<<<<<<<<< + * def __init__(cls, name, parents, dct): + * type.__init__(cls, name, parents, dct) + */ +struct __pyx_obj___Pyx_EnumMeta { + PyHeapTypeObject __pyx_base; +}; + + +/* "View.MemoryView":105 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_array_obj { + PyObject_HEAD + struct __pyx_vtabstruct_array *__pyx_vtab; + char *data; + Py_ssize_t len; + char *format; + int ndim; + Py_ssize_t *_shape; + Py_ssize_t *_strides; + Py_ssize_t itemsize; + PyObject *mode; + PyObject *_format; + void (*callback_free_data)(void *); + int free_data; + int dtype_is_object; +}; + + +/* "View.MemoryView":279 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":330 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ +struct __pyx_memoryview_obj { + PyObject_HEAD + struct __pyx_vtabstruct_memoryview *__pyx_vtab; + PyObject *obj; + PyObject *_size; + PyObject *_array_interface; + PyThread_type_lock lock; + __pyx_atomic_int acquisition_count[2]; + __pyx_atomic_int *acquisition_count_aligned_p; + Py_buffer view; + int flags; + int dtype_is_object; + __Pyx_TypeInfo *typeinfo; +}; + + +/* "View.MemoryView":965 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ +struct __pyx_memoryviewslice_obj { + struct __pyx_memoryview_obj __pyx_base; + __Pyx_memviewslice from_slice; + PyObject *from_object; + PyObject *(*to_object_func)(char *); + int (*to_dtype_func)(char *, PyObject *); +}; + + + +/* "View.MemoryView":105 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_array { + PyObject *(*get_memview)(struct __pyx_array_obj *); +}; +static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; + + +/* "View.MemoryView":330 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ + +struct __pyx_vtabstruct_memoryview { + char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); + PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); +}; +static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; + + +/* "View.MemoryView":965 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ + +struct __pyx_vtabstruct__memoryviewslice { + struct __pyx_vtabstruct_memoryview __pyx_base; +}; +static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* BufferIndexError.proto */ +static void __Pyx_RaiseBufferIndexError(int axis); + +/* MemviewSliceInit.proto */ +#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d +#define __Pyx_MEMVIEW_DIRECT 1 +#define __Pyx_MEMVIEW_PTR 2 +#define __Pyx_MEMVIEW_FULL 4 +#define __Pyx_MEMVIEW_CONTIG 8 +#define __Pyx_MEMVIEW_STRIDED 16 +#define __Pyx_MEMVIEW_FOLLOW 32 +#define __Pyx_IS_C_CONTIG 1 +#define __Pyx_IS_F_CONTIG 2 +static int __Pyx_init_memviewslice( + struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference); +static CYTHON_INLINE int __pyx_add_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +static CYTHON_INLINE int __pyx_sub_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) +#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) +#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) +#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) +static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if CYTHON_FAST_PYCALL + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif // CYTHON_FAST_PYCALL +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* None.proto */ +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); + +/* UnaryNegOverflows.proto */ +#define UNARY_NEG_WOULD_OVERFLOW(x)\ + (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/ +/* decode_c_string_utf16.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 0; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = -1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} + +/* decode_c_string.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + +/* ListExtend.proto */ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject* none = _PyList_Extend((PyListObject*)L, v); + if (unlikely(!none)) + return -1; + Py_DECREF(none); + return 0; +#else + return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); +#endif +} + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* None.proto */ +static CYTHON_INLINE long __Pyx_div_long(long, long); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* CalculateMetaclass.proto */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +/* SetNameInClass.proto */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) +#elif CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) +#else +#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) +#endif + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + size_t defaults_size; // used by FusedFunction for copying defaults + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + +/* Py3ClassCreate.proto */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +/* BufferStructDeclare.proto */ +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +/* MemviewSliceIsContig.proto */ +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim); + +/* OverlappingSlices.proto */ +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +/* Capsule.proto */ +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +/* GCCDiagnostics.proto */ +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* IsLittleEndian.proto */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); + +/* BufferFormatCheck.proto */ +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* TypeInfoCompare.proto */ +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +/* MemviewSliceValidateAndInit.proto */ +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_char(PyObject *, int writable_flag); + +/* RealImag.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if defined(__cplusplus) && CYTHON_CCOMPLEX\ + && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_float(a, b) ((a)==(b)) + #define __Pyx_c_sum_float(a, b) ((a)+(b)) + #define __Pyx_c_diff_float(a, b) ((a)-(b)) + #define __Pyx_c_prod_float(a, b) ((a)*(b)) + #define __Pyx_c_quot_float(a, b) ((a)/(b)) + #define __Pyx_c_neg_float(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_float(z) ((z)==(float)0) + #define __Pyx_c_conj_float(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_float(z) (::std::abs(z)) + #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_float(z) ((z)==0) + #define __Pyx_c_conj_float(z) (conjf(z)) + #if 1 + #define __Pyx_c_abs_float(z) (cabsf(z)) + #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_double(a, b) ((a)==(b)) + #define __Pyx_c_sum_double(a, b) ((a)+(b)) + #define __Pyx_c_diff_double(a, b) ((a)-(b)) + #define __Pyx_c_prod_double(a, b) ((a)*(b)) + #define __Pyx_c_quot_double(a, b) ((a)/(b)) + #define __Pyx_c_neg_double(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_double(z) ((z)==(double)0) + #define __Pyx_c_conj_double(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (::std::abs(z)) + #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_double(z) ((z)==0) + #define __Pyx_c_conj_double(z) (conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (cabs(z)) + #define __Pyx_c_pow_double(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +/* MemviewSliceCopyTemplate.proto */ +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object); + +/* CIntFromPy.proto */ +static CYTHON_INLINE enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType __Pyx_PyInt_As_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType value); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/ +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/ +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/ +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_generic = 0; +static PyTypeObject *__pyx_ptype_5numpy_number = 0; +static PyTypeObject *__pyx_ptype_5numpy_integer = 0; +static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_inexact = 0; +static PyTypeObject *__pyx_ptype_5numpy_floating = 0; +static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0; +static PyTypeObject *__pyx_ptype_5numpy_flexible = 0; +static PyTypeObject *__pyx_ptype_5numpy_character = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; + +/* Module declarations from 'cython.view' */ + +/* Module declarations from 'libc.stdint' */ + +/* Module declarations from 'libcpp' */ + +/* Module declarations from 'libcpp.string' */ + +/* Module declarations from 'libcpp.vector' */ + +/* Module declarations from 'cereal.visionipc.visionipc' */ + +/* Module declarations from 'cereal.visionipc.visionipc_pyx' */ +static PyTypeObject *__pyx_ptype_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer = 0; +static PyTypeObject *__pyx_ptype_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient = 0; +static PyTypeObject *__pyx_ptype___Pyx_EnumMeta = 0; +static PyTypeObject *__pyx_array_type = 0; +static PyTypeObject *__pyx_MemviewEnum_type = 0; +static PyTypeObject *__pyx_memoryview_type = 0; +static PyTypeObject *__pyx_memoryviewslice_type = 0; +static PyObject *__Pyx_OrderedDict = 0; +static PyObject *__Pyx_EnumBase = 0; +static PyObject *generic = 0; +static PyObject *strided = 0; +static PyObject *indirect = 0; +static PyObject *contiguous = 0; +static PyObject *indirect_contiguous = 0; +static int __pyx_memoryview_thread_locks_used; +static PyThread_type_lock __pyx_memoryview_thread_locks[8]; +static PyObject *__Pyx_globals = 0; +static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/ +static PyObject *__pyx_unpickle___Pyx_EnumMeta__set_state(struct __pyx_obj___Pyx_EnumMeta *, PyObject *); /*proto*/ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ +static void *__pyx_align_pointer(void *, size_t); /*proto*/ +static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/ +static PyObject *_unellipsify(PyObject *, int); /*proto*/ +static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/ +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/ +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/ +static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/ +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/ +static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/ +static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/ +static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/ +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/ +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/ +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/ +static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/ +static int __pyx_memoryview_err(PyObject *, char *); /*proto*/ +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/ +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ +static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_char = { "char", NULL, sizeof(char), { 0 }, 0, 'H', IS_UNSIGNED(char), 0 }; +#define __Pyx_MODULE_NAME "cereal.visionipc.visionipc_pyx" +extern int __pyx_module_is_main_cereal__visionipc__visionipc_pyx; +int __pyx_module_is_main_cereal__visionipc__visionipc_pyx = 0; + +/* Implementation of 'cereal.visionipc.visionipc_pyx' */ +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_Ellipsis; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_IndexError; +static const char __pyx_k_O[] = "O"; +static const char __pyx_k_c[] = "c"; +static const char __pyx_k_v[] = "v"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_np[] = "np"; +static const char __pyx_k_tp[] = "tp"; +static const char __pyx_k_cls[] = "cls"; +static const char __pyx_k_dct[] = "dct"; +static const char __pyx_k_doc[] = "__doc__"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_obj[] = "obj"; +static const char __pyx_k_res[] = "res"; +static const char __pyx_k_rgb[] = "rgb"; +static const char __pyx_k_s_s[] = "%s.%s"; +static const char __pyx_k_str[] = "__str__"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_base[] = "base"; +static const char __pyx_k_data[] = "data"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_enum[] = "enum"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_mode[] = "mode"; +static const char __pyx_k_name[] = "name"; +static const char __pyx_k_ndim[] = "ndim"; +static const char __pyx_k_pack[] = "pack"; +static const char __pyx_k_repr[] = "__repr__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_size[] = "size"; +static const char __pyx_k_step[] = "step"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_ASCII[] = "ASCII"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_dtype[] = "dtype"; +static const char __pyx_k_empty[] = "empty"; +static const char __pyx_k_error[] = "error"; +static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_s_s_d[] = "<%s.%s: %d>"; +static const char __pyx_k_shape[] = "shape"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_uint8[] = "uint8"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_width[] = "width"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_format[] = "format"; +static const char __pyx_k_height[] = "height"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_module[] = "__module__"; +static const char __pyx_k_name_2[] = "__name__"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_stream[] = "stream"; +static const char __pyx_k_struct[] = "struct"; +static const char __pyx_k_unpack[] = "unpack"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_values[] = "values"; +static const char __pyx_k_IntEnum[] = "IntEnum"; +static const char __pyx_k_fortran[] = "fortran"; +static const char __pyx_k_members[] = "__members__"; +static const char __pyx_k_memview[] = "memview"; +static const char __pyx_k_parents[] = "parents"; +static const char __pyx_k_prepare[] = "__prepare__"; +static const char __pyx_k_Ellipsis[] = "Ellipsis"; +static const char __pyx_k_EnumBase[] = "EnumBase"; +static const char __pyx_k_EnumType[] = "EnumType"; +static const char __pyx_k_conflate[] = "conflate"; +static const char __pyx_k_frame_id[] = "frame_id"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_metaclass[] = "__metaclass__"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_IndexError[] = "IndexError"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_pyx_result[] = "__pyx_result"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_timeout_ms[] = "timeout_ms"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_OrderedDict[] = "OrderedDict"; +static const char __pyx_k_PickleError[] = "PickleError"; +static const char __pyx_k_collections[] = "collections"; +static const char __pyx_k_num_buffers[] = "num_buffers"; +static const char __pyx_k_Pyx_EnumBase[] = "__Pyx_EnumBase"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_stringsource[] = "stringsource"; +static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_timestamp_eof[] = "timestamp_eof"; +static const char __pyx_k_timestamp_sof[] = "timestamp_sof"; +static const char __pyx_k_View_MemoryView[] = "View.MemoryView"; +static const char __pyx_k_VisionIpcClient[] = "VisionIpcClient"; +static const char __pyx_k_VisionIpcServer[] = "VisionIpcServer"; +static const char __pyx_k_allocate_buffer[] = "allocate_buffer"; +static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; +static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_VisionStreamType[] = "VisionStreamType"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_Pyx_EnumBase___new[] = "__Pyx_EnumBase.__new__"; +static const char __pyx_k_Pyx_EnumBase___str[] = "__Pyx_EnumBase.__str__"; +static const char __pyx_k_VISION_STREAM_ROAD[] = "VISION_STREAM_ROAD"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_strided_and_direct[] = ""; +static const char __pyx_k_Pyx_EnumBase___repr[] = "__Pyx_EnumBase.__repr__"; +static const char __pyx_k_Unknown_enum_value_s[] = "Unknown enum value: '%s'"; +static const char __pyx_k_VISION_STREAM_DRIVER[] = "VISION_STREAM_DRIVER"; +static const char __pyx_k_strided_and_indirect[] = ""; +static const char __pyx_k_contiguous_and_direct[] = ""; +static const char __pyx_k_MemoryView_of_r_object[] = ""; +static const char __pyx_k_VISION_STREAM_RGB_BACK[] = "VISION_STREAM_RGB_BACK"; +static const char __pyx_k_VISION_STREAM_RGB_WIDE[] = "VISION_STREAM_RGB_WIDE"; +static const char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; +static const char __pyx_k_VISION_STREAM_RGB_FRONT[] = "VISION_STREAM_RGB_FRONT"; +static const char __pyx_k_VISION_STREAM_WIDE_ROAD[] = "VISION_STREAM_WIDE_ROAD"; +static const char __pyx_k_contiguous_and_indirect[] = ""; +static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; +static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; +static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; +static const char __pyx_k_pyx_unpickle___Pyx_EnumMeta[] = "__pyx_unpickle___Pyx_EnumMeta"; +static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; +static const char __pyx_k_strided_and_direct_or_indirect[] = ""; +static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; +static const char __pyx_k_self_server_cannot_be_converted[] = "self.server cannot be converted to a Python object for pickling"; +static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; +static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; +static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview"; +static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview"; +static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xd4[] = "Incompatible checksums (%s vs 0xd41d8cd = ())"; +static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; +static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; +static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; +static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; +static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; +static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; +static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; +static PyObject *__pyx_n_s_ASCII; +static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; +static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; +static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor; +static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi; +static PyObject *__pyx_kp_s_Cannot_index_with_type_s; +static PyObject *__pyx_n_s_Ellipsis; +static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; +static PyObject *__pyx_n_s_EnumBase; +static PyObject *__pyx_n_s_EnumType; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xd4; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; +static PyObject *__pyx_n_s_IntEnum; +static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; +static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; +static PyObject *__pyx_kp_s_MemoryView_of_r_object; +static PyObject *__pyx_n_b_O; +static PyObject *__pyx_n_s_OrderedDict; +static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; +static PyObject *__pyx_n_s_PickleError; +static PyObject *__pyx_n_s_Pyx_EnumBase; +static PyObject *__pyx_n_s_Pyx_EnumBase___new; +static PyObject *__pyx_n_s_Pyx_EnumBase___repr; +static PyObject *__pyx_n_s_Pyx_EnumBase___str; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; +static PyObject *__pyx_kp_s_Unknown_enum_value_s; +static PyObject *__pyx_n_s_VISION_STREAM_DRIVER; +static PyObject *__pyx_n_s_VISION_STREAM_RGB_BACK; +static PyObject *__pyx_n_s_VISION_STREAM_RGB_FRONT; +static PyObject *__pyx_n_s_VISION_STREAM_RGB_WIDE; +static PyObject *__pyx_n_s_VISION_STREAM_ROAD; +static PyObject *__pyx_n_s_VISION_STREAM_WIDE_ROAD; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; +static PyObject *__pyx_n_s_VisionIpcClient; +static PyObject *__pyx_n_s_VisionIpcServer; +static PyObject *__pyx_n_s_VisionStreamType; +static PyObject *__pyx_n_s_allocate_buffer; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_cls; +static PyObject *__pyx_n_s_collections; +static PyObject *__pyx_n_s_conflate; +static PyObject *__pyx_kp_s_contiguous_and_direct; +static PyObject *__pyx_kp_s_contiguous_and_indirect; +static PyObject *__pyx_n_s_data; +static PyObject *__pyx_n_s_dct; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dtype_is_object; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_enum; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_n_s_frame_id; +static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_s_height; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_itemsize; +static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_members; +static PyObject *__pyx_n_s_memview; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_num_buffers; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to; +static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_parents; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_pyx_PickleError; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_result; +static PyObject *__pyx_n_s_pyx_state; +static PyObject *__pyx_n_s_pyx_type; +static PyObject *__pyx_n_s_pyx_unpickle_Enum; +static PyObject *__pyx_n_s_pyx_unpickle___Pyx_EnumMeta; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_reduce_ex; +static PyObject *__pyx_n_s_repr; +static PyObject *__pyx_n_s_res; +static PyObject *__pyx_n_s_rgb; +static PyObject *__pyx_kp_s_s_s; +static PyObject *__pyx_kp_s_s_s_d; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_kp_s_self_server_cannot_be_converted; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_n_s_str; +static PyObject *__pyx_n_s_stream; +static PyObject *__pyx_kp_s_strided_and_direct; +static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; +static PyObject *__pyx_kp_s_strided_and_indirect; +static PyObject *__pyx_kp_s_stringsource; +static PyObject *__pyx_n_s_struct; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_timeout_ms; +static PyObject *__pyx_n_s_timestamp_eof; +static PyObject *__pyx_n_s_timestamp_sof; +static PyObject *__pyx_n_s_tp; +static PyObject *__pyx_n_s_uint8; +static PyObject *__pyx_kp_s_unable_to_allocate_array_data; +static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; +static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_n_s_v; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_width; +static int __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer___init__(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *__pyx_v_self, std::string __pyx_v_name); /* proto */ +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_2create_buffers(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *__pyx_v_self, enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType __pyx_v_tp, size_t __pyx_v_num_buffers, bool __pyx_v_rgb, size_t __pyx_v_width, size_t __pyx_v_height); /* proto */ +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_4send(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *__pyx_v_self, enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType __pyx_v_tp, PyObject *__pyx_v_data, uint32_t __pyx_v_frame_id, uint64_t __pyx_v_timestamp_sof, uint64_t __pyx_v_timestamp_eof); /* proto */ +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_6start_listener(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *__pyx_v_self); /* proto */ +static void __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_8__dealloc__(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient___cinit__(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self, std::string __pyx_v_name, enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType __pyx_v_stream, bool __pyx_v_conflate); /* proto */ +static void __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_2__dealloc__(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_5width___get__(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6height___get__(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6stride___get__(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_4recv(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self, int __pyx_v_timeout_ms); /* proto */ +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6connect(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self, bool __pyx_v_blocking); /* proto */ +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_8is_connected(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_8EnumBase_14__Pyx_EnumMeta___init__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_parents, PyObject *__pyx_v_dct); /* proto */ +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_2__iter__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls); /* proto */ +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_4__getitem__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_6__reduce_cython__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_8__setstate_cython__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_value, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase_4__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_8EnumBase___pyx_unpickle___Pyx_EnumMeta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */ +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new___Pyx_EnumMeta(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_184977713; +static PyObject *__pyx_int_222419149; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_slice__21; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_codeobj__26; +static PyObject *__pyx_codeobj__29; +static PyObject *__pyx_codeobj__31; +static PyObject *__pyx_codeobj__33; +static PyObject *__pyx_codeobj__40; +/* Late includes */ + +/* "cereal/visionipc/visionipc_pyx.pyx":30 + * cdef cppVisionIpcServer * server + * + * def __init__(self, string name): # <<<<<<<<<<<<<< + * self.server = new cppVisionIpcServer(name, NULL, NULL) + * + */ + +/* Python wrapper */ +static int __pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + std::string __pyx_v_name; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 30, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_name = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 30, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcServer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer___init__(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *)__pyx_v_self), __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer___init__(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *__pyx_v_self, std::string __pyx_v_name) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "cereal/visionipc/visionipc_pyx.pyx":31 + * + * def __init__(self, string name): + * self.server = new cppVisionIpcServer(name, NULL, NULL) # <<<<<<<<<<<<<< + * + * def create_buffers(self, VisionStreamType tp, size_t num_buffers, bool rgb, size_t width, size_t height): + */ + __pyx_v_self->server = new VisionIpcServer(__pyx_v_name, NULL, NULL); + + /* "cereal/visionipc/visionipc_pyx.pyx":30 + * cdef cppVisionIpcServer * server + * + * def __init__(self, string name): # <<<<<<<<<<<<<< + * self.server = new cppVisionIpcServer(name, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/visionipc/visionipc_pyx.pyx":33 + * self.server = new cppVisionIpcServer(name, NULL, NULL) + * + * def create_buffers(self, VisionStreamType tp, size_t num_buffers, bool rgb, size_t width, size_t height): # <<<<<<<<<<<<<< + * self.server.create_buffers(tp, num_buffers, rgb, width, height) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_3create_buffers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_3create_buffers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType __pyx_v_tp; + size_t __pyx_v_num_buffers; + bool __pyx_v_rgb; + size_t __pyx_v_width; + size_t __pyx_v_height; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("create_buffers (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tp,&__pyx_n_s_num_buffers,&__pyx_n_s_rgb,&__pyx_n_s_width,&__pyx_n_s_height,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tp)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_buffers)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("create_buffers", 1, 5, 5, 1); __PYX_ERR(1, 33, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rgb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("create_buffers", 1, 5, 5, 2); __PYX_ERR(1, 33, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("create_buffers", 1, 5, 5, 3); __PYX_ERR(1, 33, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_height)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("create_buffers", 1, 5, 5, 4); __PYX_ERR(1, 33, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_buffers") < 0)) __PYX_ERR(1, 33, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_tp = ((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)__Pyx_PyInt_As_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(values[0])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 33, __pyx_L3_error) + __pyx_v_num_buffers = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_num_buffers == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 33, __pyx_L3_error) + __pyx_v_rgb = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_rgb == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 33, __pyx_L3_error) + __pyx_v_width = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_width == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 33, __pyx_L3_error) + __pyx_v_height = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_height == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 33, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("create_buffers", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 33, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcServer.create_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_2create_buffers(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *)__pyx_v_self), __pyx_v_tp, __pyx_v_num_buffers, __pyx_v_rgb, __pyx_v_width, __pyx_v_height); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_2create_buffers(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *__pyx_v_self, enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType __pyx_v_tp, size_t __pyx_v_num_buffers, bool __pyx_v_rgb, size_t __pyx_v_width, size_t __pyx_v_height) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("create_buffers", 0); + + /* "cereal/visionipc/visionipc_pyx.pyx":34 + * + * def create_buffers(self, VisionStreamType tp, size_t num_buffers, bool rgb, size_t width, size_t height): + * self.server.create_buffers(tp, num_buffers, rgb, width, height) # <<<<<<<<<<<<<< + * + * def send(self, VisionStreamType tp, bytes data, uint32_t frame_id=0, uint64_t timestamp_sof=0, uint64_t timestamp_eof=0): + */ + __pyx_v_self->server->create_buffers(((enum VisionStreamType)__pyx_v_tp), __pyx_v_num_buffers, __pyx_v_rgb, __pyx_v_width, __pyx_v_height); + + /* "cereal/visionipc/visionipc_pyx.pyx":33 + * self.server = new cppVisionIpcServer(name, NULL, NULL) + * + * def create_buffers(self, VisionStreamType tp, size_t num_buffers, bool rgb, size_t width, size_t height): # <<<<<<<<<<<<<< + * self.server.create_buffers(tp, num_buffers, rgb, width, height) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/visionipc/visionipc_pyx.pyx":36 + * self.server.create_buffers(tp, num_buffers, rgb, width, height) + * + * def send(self, VisionStreamType tp, bytes data, uint32_t frame_id=0, uint64_t timestamp_sof=0, uint64_t timestamp_eof=0): # <<<<<<<<<<<<<< + * cdef cppVisionBuf * buf = self.server.get_buffer(tp) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_5send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_5send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType __pyx_v_tp; + PyObject *__pyx_v_data = 0; + uint32_t __pyx_v_frame_id; + uint64_t __pyx_v_timestamp_sof; + uint64_t __pyx_v_timestamp_eof; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("send (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tp,&__pyx_n_s_data,&__pyx_n_s_frame_id,&__pyx_n_s_timestamp_sof,&__pyx_n_s_timestamp_eof,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tp)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("send", 0, 2, 5, 1); __PYX_ERR(1, 36, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frame_id); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timestamp_sof); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timestamp_eof); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "send") < 0)) __PYX_ERR(1, 36, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_tp = ((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)__Pyx_PyInt_As_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(values[0])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 36, __pyx_L3_error) + __pyx_v_data = ((PyObject*)values[1]); + if (values[2]) { + __pyx_v_frame_id = __Pyx_PyInt_As_uint32_t(values[2]); if (unlikely((__pyx_v_frame_id == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 36, __pyx_L3_error) + } else { + __pyx_v_frame_id = ((uint32_t)0); + } + if (values[3]) { + __pyx_v_timestamp_sof = __Pyx_PyInt_As_uint64_t(values[3]); if (unlikely((__pyx_v_timestamp_sof == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 36, __pyx_L3_error) + } else { + __pyx_v_timestamp_sof = ((uint64_t)0); + } + if (values[4]) { + __pyx_v_timestamp_eof = __Pyx_PyInt_As_uint64_t(values[4]); if (unlikely((__pyx_v_timestamp_eof == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 36, __pyx_L3_error) + } else { + __pyx_v_timestamp_eof = ((uint64_t)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("send", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 36, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcServer.send", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 1, "data", 1))) __PYX_ERR(1, 36, __pyx_L1_error) + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_4send(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *)__pyx_v_self), __pyx_v_tp, __pyx_v_data, __pyx_v_frame_id, __pyx_v_timestamp_sof, __pyx_v_timestamp_eof); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_4send(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *__pyx_v_self, enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType __pyx_v_tp, PyObject *__pyx_v_data, uint32_t __pyx_v_frame_id, uint64_t __pyx_v_timestamp_sof, uint64_t __pyx_v_timestamp_eof) { + VisionBuf *__pyx_v_buf; + struct VisionIpcBufExtra __pyx_v_extra; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + char *__pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("send", 0); + + /* "cereal/visionipc/visionipc_pyx.pyx":37 + * + * def send(self, VisionStreamType tp, bytes data, uint32_t frame_id=0, uint64_t timestamp_sof=0, uint64_t timestamp_eof=0): + * cdef cppVisionBuf * buf = self.server.get_buffer(tp) # <<<<<<<<<<<<<< + * + * # Populate buffer + */ + __pyx_v_buf = __pyx_v_self->server->get_buffer(((enum VisionStreamType)__pyx_v_tp)); + + /* "cereal/visionipc/visionipc_pyx.pyx":40 + * + * # Populate buffer + * assert buf.len == len(data) # <<<<<<<<<<<<<< + * memcpy(buf.addr, data, len(data)) + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(__pyx_v_data == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 40, __pyx_L1_error) + } + __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 40, __pyx_L1_error) + if (unlikely(!((__pyx_v_buf->len == __pyx_t_1) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 40, __pyx_L1_error) + } + } + #endif + + /* "cereal/visionipc/visionipc_pyx.pyx":41 + * # Populate buffer + * assert buf.len == len(data) + * memcpy(buf.addr, data, len(data)) # <<<<<<<<<<<<<< + * + * cdef VisionIpcBufExtra extra + */ + if (unlikely(__pyx_v_data == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(1, 41, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_data); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L1_error) + if (unlikely(__pyx_v_data == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 41, __pyx_L1_error) + } + __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 41, __pyx_L1_error) + (void)(memcpy(__pyx_v_buf->addr, ((char *)__pyx_t_2), __pyx_t_1)); + + /* "cereal/visionipc/visionipc_pyx.pyx":44 + * + * cdef VisionIpcBufExtra extra + * extra.frame_id = frame_id # <<<<<<<<<<<<<< + * extra.timestamp_sof = timestamp_sof + * extra.timestamp_eof = timestamp_eof + */ + __pyx_v_extra.frame_id = __pyx_v_frame_id; + + /* "cereal/visionipc/visionipc_pyx.pyx":45 + * cdef VisionIpcBufExtra extra + * extra.frame_id = frame_id + * extra.timestamp_sof = timestamp_sof # <<<<<<<<<<<<<< + * extra.timestamp_eof = timestamp_eof + * + */ + __pyx_v_extra.timestamp_sof = __pyx_v_timestamp_sof; + + /* "cereal/visionipc/visionipc_pyx.pyx":46 + * extra.frame_id = frame_id + * extra.timestamp_sof = timestamp_sof + * extra.timestamp_eof = timestamp_eof # <<<<<<<<<<<<<< + * + * self.server.send(buf, &extra, False) + */ + __pyx_v_extra.timestamp_eof = __pyx_v_timestamp_eof; + + /* "cereal/visionipc/visionipc_pyx.pyx":48 + * extra.timestamp_eof = timestamp_eof + * + * self.server.send(buf, &extra, False) # <<<<<<<<<<<<<< + * + * def start_listener(self): + */ + __pyx_v_self->server->send(__pyx_v_buf, (&__pyx_v_extra), 0); + + /* "cereal/visionipc/visionipc_pyx.pyx":36 + * self.server.create_buffers(tp, num_buffers, rgb, width, height) + * + * def send(self, VisionStreamType tp, bytes data, uint32_t frame_id=0, uint64_t timestamp_sof=0, uint64_t timestamp_eof=0): # <<<<<<<<<<<<<< + * cdef cppVisionBuf * buf = self.server.get_buffer(tp) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcServer.send", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/visionipc/visionipc_pyx.pyx":50 + * self.server.send(buf, &extra, False) + * + * def start_listener(self): # <<<<<<<<<<<<<< + * self.server.start_listener() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_7start_listener(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_7start_listener(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start_listener (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_6start_listener(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_6start_listener(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start_listener", 0); + + /* "cereal/visionipc/visionipc_pyx.pyx":51 + * + * def start_listener(self): + * self.server.start_listener() # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_v_self->server->start_listener(); + + /* "cereal/visionipc/visionipc_pyx.pyx":50 + * self.server.send(buf, &extra, False) + * + * def start_listener(self): # <<<<<<<<<<<<<< + * self.server.start_listener() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/visionipc/visionipc_pyx.pyx":53 + * self.server.start_listener() + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del self.server + * + */ + +/* Python wrapper */ +static void __pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_9__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_9__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_8__dealloc__(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_8__dealloc__(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "cereal/visionipc/visionipc_pyx.pyx":54 + * + * def __dealloc__(self): + * del self.server # <<<<<<<<<<<<<< + * + * + */ + delete __pyx_v_self->server; + + /* "cereal/visionipc/visionipc_pyx.pyx":53 + * self.server.start_listener() + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del self.server + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.server cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_10__reduce_cython__(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.server cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.server cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.server cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcServer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.server cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.server cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_12__setstate_cython__(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("self.server cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.server cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.server cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.server cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcServer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/visionipc/visionipc_pyx.pyx":61 + * cdef cppVisionIpcClient * client + * + * def __cinit__(self, string name, VisionStreamType stream, bool conflate): # <<<<<<<<<<<<<< + * self.client = new cppVisionIpcClient(name, stream, conflate, NULL, NULL) + * self.buf = NULL + */ + +/* Python wrapper */ +static int __pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + std::string __pyx_v_name; + enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType __pyx_v_stream; + bool __pyx_v_conflate; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_stream,&__pyx_n_s_conflate,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(1, 61, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_conflate)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(1, 61, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 61, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_name = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 61, __pyx_L3_error) + __pyx_v_stream = ((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)__Pyx_PyInt_As_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 61, __pyx_L3_error) + __pyx_v_conflate = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_conflate == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 61, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 61, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcClient.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient___cinit__(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *)__pyx_v_self), __pyx_v_name, __pyx_v_stream, __pyx_v_conflate); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient___cinit__(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self, std::string __pyx_v_name, enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType __pyx_v_stream, bool __pyx_v_conflate) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "cereal/visionipc/visionipc_pyx.pyx":62 + * + * def __cinit__(self, string name, VisionStreamType stream, bool conflate): + * self.client = new cppVisionIpcClient(name, stream, conflate, NULL, NULL) # <<<<<<<<<<<<<< + * self.buf = NULL + * + */ + __pyx_v_self->client = new VisionIpcClient(__pyx_v_name, ((enum VisionStreamType)__pyx_v_stream), __pyx_v_conflate, NULL, NULL); + + /* "cereal/visionipc/visionipc_pyx.pyx":63 + * def __cinit__(self, string name, VisionStreamType stream, bool conflate): + * self.client = new cppVisionIpcClient(name, stream, conflate, NULL, NULL) + * self.buf = NULL # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_v_self->buf = NULL; + + /* "cereal/visionipc/visionipc_pyx.pyx":61 + * cdef cppVisionIpcClient * client + * + * def __cinit__(self, string name, VisionStreamType stream, bool conflate): # <<<<<<<<<<<<<< + * self.client = new cppVisionIpcClient(name, stream, conflate, NULL, NULL) + * self.buf = NULL + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/visionipc/visionipc_pyx.pyx":65 + * self.buf = NULL + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del self.client + * + */ + +/* Python wrapper */ +static void __pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_2__dealloc__(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_2__dealloc__(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "cereal/visionipc/visionipc_pyx.pyx":66 + * + * def __dealloc__(self): + * del self.client # <<<<<<<<<<<<<< + * + * @property + */ + delete __pyx_v_self->client; + + /* "cereal/visionipc/visionipc_pyx.pyx":65 + * self.buf = NULL + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del self.client + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "cereal/visionipc/visionipc_pyx.pyx":69 + * + * @property + * def width(self): # <<<<<<<<<<<<<< + * return None if not self.buf else self.buf.width + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_5width_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_5width_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_5width___get__(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_5width___get__(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "cereal/visionipc/visionipc_pyx.pyx":70 + * @property + * def width(self): + * return None if not self.buf else self.buf.width # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + if (((!(__pyx_v_self->buf != 0)) != 0)) { + __Pyx_INCREF(Py_None); + __pyx_t_1 = Py_None; + } else { + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->buf->width); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cereal/visionipc/visionipc_pyx.pyx":69 + * + * @property + * def width(self): # <<<<<<<<<<<<<< + * return None if not self.buf else self.buf.width + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcClient.width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/visionipc/visionipc_pyx.pyx":73 + * + * @property + * def height(self): # <<<<<<<<<<<<<< + * return None if not self.buf else self.buf.height + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6height_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6height_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6height___get__(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6height___get__(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "cereal/visionipc/visionipc_pyx.pyx":74 + * @property + * def height(self): + * return None if not self.buf else self.buf.height # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + if (((!(__pyx_v_self->buf != 0)) != 0)) { + __Pyx_INCREF(Py_None); + __pyx_t_1 = Py_None; + } else { + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->buf->height); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cereal/visionipc/visionipc_pyx.pyx":73 + * + * @property + * def height(self): # <<<<<<<<<<<<<< + * return None if not self.buf else self.buf.height + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcClient.height.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/visionipc/visionipc_pyx.pyx":77 + * + * @property + * def stride(self): # <<<<<<<<<<<<<< + * return None if not self.buf else self.buf.stride + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6stride_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6stride_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6stride___get__(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6stride___get__(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "cereal/visionipc/visionipc_pyx.pyx":78 + * @property + * def stride(self): + * return None if not self.buf else self.buf.stride # <<<<<<<<<<<<<< + * + * def recv(self, int timeout_ms=100): + */ + __Pyx_XDECREF(__pyx_r); + if (((!(__pyx_v_self->buf != 0)) != 0)) { + __Pyx_INCREF(Py_None); + __pyx_t_1 = Py_None; + } else { + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->buf->stride); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cereal/visionipc/visionipc_pyx.pyx":77 + * + * @property + * def stride(self): # <<<<<<<<<<<<<< + * return None if not self.buf else self.buf.stride + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcClient.stride.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/visionipc/visionipc_pyx.pyx":80 + * return None if not self.buf else self.buf.stride + * + * def recv(self, int timeout_ms=100): # <<<<<<<<<<<<<< + * self.buf = self.client.recv(NULL, timeout_ms) + * if not self.buf: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_5recv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_5recv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_timeout_ms; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("recv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout_ms,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_ms); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "recv") < 0)) __PYX_ERR(1, 80, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + if (values[0]) { + __pyx_v_timeout_ms = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_timeout_ms == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 80, __pyx_L3_error) + } else { + __pyx_v_timeout_ms = ((int)0x64); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("recv", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 80, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcClient.recv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_4recv(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *)__pyx_v_self), __pyx_v_timeout_ms); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_4recv(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self, int __pyx_v_timeout_ms) { + PyArrayObject *__pyx_v_dat = 0; + __Pyx_memviewslice __pyx_v_dat_view = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("recv", 0); + + /* "cereal/visionipc/visionipc_pyx.pyx":81 + * + * def recv(self, int timeout_ms=100): + * self.buf = self.client.recv(NULL, timeout_ms) # <<<<<<<<<<<<<< + * if not self.buf: + * return None + */ + __pyx_v_self->buf = __pyx_v_self->client->recv(NULL, __pyx_v_timeout_ms); + + /* "cereal/visionipc/visionipc_pyx.pyx":82 + * def recv(self, int timeout_ms=100): + * self.buf = self.client.recv(NULL, timeout_ms) + * if not self.buf: # <<<<<<<<<<<<<< + * return None + * cdef cnp.ndarray dat = np.empty(self.buf.len, dtype=np.uint8) + */ + __pyx_t_1 = ((!(__pyx_v_self->buf != 0)) != 0); + if (__pyx_t_1) { + + /* "cereal/visionipc/visionipc_pyx.pyx":83 + * self.buf = self.client.recv(NULL, timeout_ms) + * if not self.buf: + * return None # <<<<<<<<<<<<<< + * cdef cnp.ndarray dat = np.empty(self.buf.len, dtype=np.uint8) + * cdef char[:] dat_view = dat + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "cereal/visionipc/visionipc_pyx.pyx":82 + * def recv(self, int timeout_ms=100): + * self.buf = self.client.recv(NULL, timeout_ms) + * if not self.buf: # <<<<<<<<<<<<<< + * return None + * cdef cnp.ndarray dat = np.empty(self.buf.len, dtype=np.uint8) + */ + } + + /* "cereal/visionipc/visionipc_pyx.pyx":84 + * if not self.buf: + * return None + * cdef cnp.ndarray dat = np.empty(self.buf.len, dtype=np.uint8) # <<<<<<<<<<<<<< + * cdef char[:] dat_view = dat + * memcpy(&dat_view[0], self.buf.addr, self.buf.len) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->buf->len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(1, 84, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 84, __pyx_L1_error) + __pyx_v_dat = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "cereal/visionipc/visionipc_pyx.pyx":85 + * return None + * cdef cnp.ndarray dat = np.empty(self.buf.len, dtype=np.uint8) + * cdef char[:] dat_view = dat # <<<<<<<<<<<<<< + * memcpy(&dat_view[0], self.buf.addr, self.buf.len) + * return dat + */ + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_char(((PyObject *)__pyx_v_dat), PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(1, 85, __pyx_L1_error) + __pyx_v_dat_view = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.data = NULL; + + /* "cereal/visionipc/visionipc_pyx.pyx":86 + * cdef cnp.ndarray dat = np.empty(self.buf.len, dtype=np.uint8) + * cdef char[:] dat_view = dat + * memcpy(&dat_view[0], self.buf.addr, self.buf.len) # <<<<<<<<<<<<<< + * return dat + * + */ + __pyx_t_8 = 0; + __pyx_t_9 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_v_dat_view.shape[0]; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_v_dat_view.shape[0])) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + __PYX_ERR(1, 86, __pyx_L1_error) + } + (void)(memcpy((&(*((char *) ( /* dim=0 */ (__pyx_v_dat_view.data + __pyx_t_8 * __pyx_v_dat_view.strides[0]) )))), __pyx_v_self->buf->addr, __pyx_v_self->buf->len)); + + /* "cereal/visionipc/visionipc_pyx.pyx":87 + * cdef char[:] dat_view = dat + * memcpy(&dat_view[0], self.buf.addr, self.buf.len) + * return dat # <<<<<<<<<<<<<< + * + * def connect(self, bool blocking): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_dat)); + __pyx_r = ((PyObject *)__pyx_v_dat); + goto __pyx_L0; + + /* "cereal/visionipc/visionipc_pyx.pyx":80 + * return None if not self.buf else self.buf.stride + * + * def recv(self, int timeout_ms=100): # <<<<<<<<<<<<<< + * self.buf = self.client.recv(NULL, timeout_ms) + * if not self.buf: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcClient.recv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_dat); + __PYX_XDEC_MEMVIEW(&__pyx_v_dat_view, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/visionipc/visionipc_pyx.pyx":89 + * return dat + * + * def connect(self, bool blocking): # <<<<<<<<<<<<<< + * return self.client.connect(blocking) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_7connect(PyObject *__pyx_v_self, PyObject *__pyx_arg_blocking); /*proto*/ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_7connect(PyObject *__pyx_v_self, PyObject *__pyx_arg_blocking) { + bool __pyx_v_blocking; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("connect (wrapper)", 0); + assert(__pyx_arg_blocking); { + __pyx_v_blocking = __Pyx_PyObject_IsTrue(__pyx_arg_blocking); if (unlikely((__pyx_v_blocking == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcClient.connect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6connect(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *)__pyx_v_self), ((bool)__pyx_v_blocking)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6connect(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self, bool __pyx_v_blocking) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("connect", 0); + + /* "cereal/visionipc/visionipc_pyx.pyx":90 + * + * def connect(self, bool blocking): + * return self.client.connect(blocking) # <<<<<<<<<<<<<< + * + * def is_connected(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->client->connect(__pyx_v_blocking)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cereal/visionipc/visionipc_pyx.pyx":89 + * return dat + * + * def connect(self, bool blocking): # <<<<<<<<<<<<<< + * return self.client.connect(blocking) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcClient.connect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cereal/visionipc/visionipc_pyx.pyx":92 + * return self.client.connect(blocking) + * + * def is_connected(self): # <<<<<<<<<<<<<< + * return self.client.is_connected() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_9is_connected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_9is_connected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_connected (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_8is_connected(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_8is_connected(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_connected", 0); + + /* "cereal/visionipc/visionipc_pyx.pyx":93 + * + * def is_connected(self): + * return self.client.is_connected() # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->client->is_connected()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cereal/visionipc/visionipc_pyx.pyx":92 + * return self.client.connect(blocking) + * + * def is_connected(self): # <<<<<<<<<<<<<< + * return self.client.is_connected() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcClient.is_connected", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_10__reduce_cython__(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcClient.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_12__setstate_cython__(((struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cereal.visionipc.visionipc_pyx.VisionIpcClient.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":735 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":736 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":735 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":738 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":739 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":738 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":741 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":742 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":741 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":744 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":745 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":744 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":747 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":748 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":747 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":750 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":751 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); + if (__pyx_t_1) { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":752 + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape # <<<<<<<<<<<<<< + * else: + * return () + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); + __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":751 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":754 + * return d.subarray.shape + * else: + * return () # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_r = __pyx_empty_tuple; + goto __pyx_L0; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":750 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":929 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":930 + * + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< + * PyArray_SetBaseObject(arr, base) + * + */ + Py_INCREF(__pyx_v_base); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":931 + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":929 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":933 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_v_base; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":934 + * + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< + * if base is NULL: + * return None + */ + __pyx_v_base = PyArray_BASE(__pyx_v_arr); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":935 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + __pyx_t_1 = ((__pyx_v_base == NULL) != 0); + if (__pyx_t_1) { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":936 + * base = PyArray_BASE(arr) + * if base is NULL: + * return None # <<<<<<<<<<<<<< + * return base + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":935 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":937 + * if base is NULL: + * return None + * return base # <<<<<<<<<<<<<< + * + * # Versions of the import_* functions which are more suitable for + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_base)); + __pyx_r = ((PyObject *)__pyx_v_base); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":933 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":941 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":943 + * cdef inline int import_array() except -1: + * try: + * __pyx_import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":944 + * try: + * __pyx_import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":945 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 945, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":941 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":947 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":949 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":950 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":951 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 951, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":947 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":953 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":955 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":956 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":957 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef extern from *: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 957, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":953 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":967 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timedelta64_object", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":979 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":967 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":982 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_datetime64_object", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":994 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":982 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":997 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + +static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { + npy_datetime __pyx_r; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1004 + * also needed. That can be found using `get_datetime64_unit`. + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":997 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1007 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + +static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { + npy_timedelta __pyx_r; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1011 + * returns the int64 value underlying scalar numpy timedelta64 object + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1007 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1014 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + +static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { + NPY_DATETIMEUNIT __pyx_r; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1018 + * returns the unit part of the dtype for a numpy datetime64 object. + * """ + * return (obj).obmeta.base # <<<<<<<<<<<<<< + */ + __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1014 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + +static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) { + Py_ssize_t __pyx_v_length; + char const *__pyx_v_data; + std::string __pyx_r; + __Pyx_RefNannyDeclarations + char const *__pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0); + + /* "string.from_py":14 + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<< + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) + */ + __pyx_v_length = 0; + + /* "string.from_py":15 + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<< + * return string(data, length) + * + */ + __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_v_data = __pyx_t_1; + + /* "string.from_py":16 + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = std::string(__pyx_v_data, __pyx_v_length); + goto __pyx_L0; + + /* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "EnumBase":16 + * @cython.internal + * cdef class __Pyx_EnumMeta(type): + * def __init__(cls, name, parents, dct): # <<<<<<<<<<<<<< + * type.__init__(cls, name, parents, dct) + * cls.__members__ = __Pyx_OrderedDict() + */ + +/* Python wrapper */ +static int __pyx_pw_8EnumBase_14__Pyx_EnumMeta_1__init__(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_8EnumBase_14__Pyx_EnumMeta_1__init__(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_parents = 0; + PyObject *__pyx_v_dct = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_parents,&__pyx_n_s_dct,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parents)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 16, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dct)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 16, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 16, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_name = values[0]; + __pyx_v_parents = values[1]; + __pyx_v_dct = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 16, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta___init__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_cls), __pyx_v_name, __pyx_v_parents, __pyx_v_dct); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_8EnumBase_14__Pyx_EnumMeta___init__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_parents, PyObject *__pyx_v_dct) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "EnumBase":17 + * cdef class __Pyx_EnumMeta(type): + * def __init__(cls, name, parents, dct): + * type.__init__(cls, name, parents, dct) # <<<<<<<<<<<<<< + * cls.__members__ = __Pyx_OrderedDict() + * def __iter__(cls): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyType_Type)), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_cls), __pyx_v_name, __pyx_v_parents, __pyx_v_dct}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_cls), __pyx_v_name, __pyx_v_parents, __pyx_v_dct}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_cls)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cls)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_cls)); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_name); + __Pyx_INCREF(__pyx_v_parents); + __Pyx_GIVEREF(__pyx_v_parents); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_parents); + __Pyx_INCREF(__pyx_v_dct); + __Pyx_GIVEREF(__pyx_v_dct); + PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_dct); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumBase":18 + * def __init__(cls, name, parents, dct): + * type.__init__(cls, name, parents, dct) + * cls.__members__ = __Pyx_OrderedDict() # <<<<<<<<<<<<<< + * def __iter__(cls): + * return iter(cls.__members__.values()) + */ + __Pyx_INCREF(__Pyx_OrderedDict); + __pyx_t_2 = __Pyx_OrderedDict; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_members, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumBase":16 + * @cython.internal + * cdef class __Pyx_EnumMeta(type): + * def __init__(cls, name, parents, dct): # <<<<<<<<<<<<<< + * type.__init__(cls, name, parents, dct) + * cls.__members__ = __Pyx_OrderedDict() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "EnumBase":19 + * type.__init__(cls, name, parents, dct) + * cls.__members__ = __Pyx_OrderedDict() + * def __iter__(cls): # <<<<<<<<<<<<<< + * return iter(cls.__members__.values()) + * def __getitem__(cls, name): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_3__iter__(PyObject *__pyx_v_cls); /*proto*/ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_3__iter__(PyObject *__pyx_v_cls) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta_2__iter__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_cls)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_2__iter__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "EnumBase":20 + * cls.__members__ = __Pyx_OrderedDict() + * def __iter__(cls): + * return iter(cls.__members__.values()) # <<<<<<<<<<<<<< + * def __getitem__(cls, name): + * return cls.__members__[name] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_members); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "EnumBase":19 + * type.__init__(cls, name, parents, dct) + * cls.__members__ = __Pyx_OrderedDict() + * def __iter__(cls): # <<<<<<<<<<<<<< + * return iter(cls.__members__.values()) + * def __getitem__(cls, name): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "EnumBase":21 + * def __iter__(cls): + * return iter(cls.__members__.values()) + * def __getitem__(cls, name): # <<<<<<<<<<<<<< + * return cls.__members__[name] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_5__getitem__(PyObject *__pyx_v_cls, PyObject *__pyx_v_name); /*proto*/ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_5__getitem__(PyObject *__pyx_v_cls, PyObject *__pyx_v_name) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta_4__getitem__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_cls), ((PyObject *)__pyx_v_name)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_4__getitem__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls, PyObject *__pyx_v_name) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "EnumBase":22 + * return iter(cls.__members__.values()) + * def __getitem__(cls, name): + * return cls.__members__[name] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_members); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "EnumBase":21 + * def __iter__(cls): + * return iter(cls.__members__.values()) + * def __getitem__(cls, name): # <<<<<<<<<<<<<< + * return cls.__members__[name] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta_6__reduce_cython__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_6__reduce_cython__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_self) { + PyObject *__pyx_v_state = 0; + PyObject *__pyx_v__dict = 0; + int __pyx_v_use_setstate; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":5 + * cdef object _dict + * cdef bint use_setstate + * state = () # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_v_state = __pyx_empty_tuple; + + /* "(tree fragment)":6 + * cdef bint use_setstate + * state = () + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":7 + * state = () + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":8 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "(tree fragment)":9 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":7 + * state = () + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":11 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":12 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, None), state + * else: + */ + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":13 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, state) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle___Pyx_EnumMeta); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_222419149); + __Pyx_GIVEREF(__pyx_int_222419149); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":12 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, None), state + * else: + */ + } + + /* "(tree fragment)":15 + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, None), state + * else: + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle___Pyx_EnumMeta); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_222419149); + __Pyx_GIVEREF(__pyx_int_222419149); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":16 + * else: + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta_8__setstate_cython__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_8__setstate_cython__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":17 + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_unpickle___Pyx_EnumMeta__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "EnumBase":28 + * class __Pyx_EnumBase(int): + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): # <<<<<<<<<<<<<< + * for v in cls: + * if v == value: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_8EnumBase_14__Pyx_EnumBase_1__new__ = {"__new__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8EnumBase_14__Pyx_EnumBase_1__new__, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_value,&__pyx_n_s_name,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 3, 1); __PYX_ERR(0, 28, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 28, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_value = values[1]; + __pyx_v_name = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 28, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("EnumBase.__Pyx_EnumBase.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumBase___new__(__pyx_self, __pyx_v_cls, __pyx_v_value, __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_value, PyObject *__pyx_v_name) { + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_v_res = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "EnumBase":29 + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): + * for v in cls: # <<<<<<<<<<<<<< + * if v == value: + * return v + */ + if (likely(PyList_CheckExact(__pyx_v_cls)) || PyTuple_CheckExact(__pyx_v_cls)) { + __pyx_t_1 = __pyx_v_cls; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_cls); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 29, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 29, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 29, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); + __pyx_t_4 = 0; + + /* "EnumBase":30 + * def __new__(cls, value, name=None): + * for v in cls: + * if v == value: # <<<<<<<<<<<<<< + * return v + * if name is None: + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_v, __pyx_v_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "EnumBase":31 + * for v in cls: + * if v == value: + * return v # <<<<<<<<<<<<<< + * if name is None: + * raise ValueError("Unknown enum value: '%s'" % value) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_v); + __pyx_r = __pyx_v_v; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + + /* "EnumBase":30 + * def __new__(cls, value, name=None): + * for v in cls: + * if v == value: # <<<<<<<<<<<<<< + * return v + * if name is None: + */ + } + + /* "EnumBase":29 + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): + * for v in cls: # <<<<<<<<<<<<<< + * if v == value: + * return v + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumBase":32 + * if v == value: + * return v + * if name is None: # <<<<<<<<<<<<<< + * raise ValueError("Unknown enum value: '%s'" % value) + * res = int.__new__(cls, value) + */ + __pyx_t_5 = (__pyx_v_name == Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (unlikely(__pyx_t_6)) { + + /* "EnumBase":33 + * return v + * if name is None: + * raise ValueError("Unknown enum value: '%s'" % value) # <<<<<<<<<<<<<< + * res = int.__new__(cls, value) + * res.name = name + */ + __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Unknown_enum_value_s, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 33, __pyx_L1_error) + + /* "EnumBase":32 + * if v == value: + * return v + * if name is None: # <<<<<<<<<<<<<< + * raise ValueError("Unknown enum value: '%s'" % value) + * res = int.__new__(cls, value) + */ + } + + /* "EnumBase":34 + * if name is None: + * raise ValueError("Unknown enum value: '%s'" % value) + * res = int.__new__(cls, value) # <<<<<<<<<<<<<< + * res.name = name + * setattr(cls, name, res) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyInt_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_cls, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_cls, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_INCREF(__pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_cls); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_value); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_res = __pyx_t_4; + __pyx_t_4 = 0; + + /* "EnumBase":35 + * raise ValueError("Unknown enum value: '%s'" % value) + * res = int.__new__(cls, value) + * res.name = name # <<<<<<<<<<<<<< + * setattr(cls, name, res) + * cls.__members__[name] = res + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_res, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + + /* "EnumBase":36 + * res = int.__new__(cls, value) + * res.name = name + * setattr(cls, name, res) # <<<<<<<<<<<<<< + * cls.__members__[name] = res + * return res + */ + __pyx_t_10 = PyObject_SetAttr(__pyx_v_cls, __pyx_v_name, __pyx_v_res); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 36, __pyx_L1_error) + + /* "EnumBase":37 + * res.name = name + * setattr(cls, name, res) + * cls.__members__[name] = res # <<<<<<<<<<<<<< + * return res + * def __repr__(self): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_members); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_v_name, __pyx_v_res) < 0)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "EnumBase":38 + * setattr(cls, name, res) + * cls.__members__[name] = res + * return res # <<<<<<<<<<<<<< + * def __repr__(self): + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "EnumBase":28 + * class __Pyx_EnumBase(int): + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): # <<<<<<<<<<<<<< + * for v in cls: + * if v == value: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumBase.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "EnumBase":39 + * cls.__members__[name] = res + * return res + * def __repr__(self): # <<<<<<<<<<<<<< + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_8EnumBase_14__Pyx_EnumBase_3__repr__ = {"__repr__", (PyCFunction)__pyx_pw_8EnumBase_14__Pyx_EnumBase_3__repr__, METH_O, 0}; +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumBase_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "EnumBase":40 + * return res + * def __repr__(self): + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) # <<<<<<<<<<<<<< + * def __str__(self): + * return "%s.%s" % (self.__class__.__name__, self.name) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s_d, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "EnumBase":39 + * cls.__members__[name] = res + * return res + * def __repr__(self): # <<<<<<<<<<<<<< + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumBase.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "EnumBase":41 + * def __repr__(self): + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): # <<<<<<<<<<<<<< + * return "%s.%s" % (self.__class__.__name__, self.name) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_5__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_8EnumBase_14__Pyx_EnumBase_5__str__ = {"__str__", (PyCFunction)__pyx_pw_8EnumBase_14__Pyx_EnumBase_5__str__, METH_O, 0}; +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_5__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumBase_4__str__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase_4__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "EnumBase":42 + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): + * return "%s.%s" % (self.__class__.__name__, self.name) # <<<<<<<<<<<<<< + * + * if PY_VERSION_HEX >= 0x03040000: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "EnumBase":41 + * def __repr__(self): + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): # <<<<<<<<<<<<<< + * return "%s.%s" % (self.__class__.__name__, self.name) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumBase.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __pyx_unpickle___Pyx_EnumMeta(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta = {"__pyx_unpickle___Pyx_EnumMeta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle___Pyx_EnumMeta (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle___Pyx_EnumMeta", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle___Pyx_EnumMeta", 1, 3, 3, 2); __PYX_ERR(0, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle___Pyx_EnumMeta") < 0)) __PYX_ERR(0, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle___Pyx_EnumMeta", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("EnumBase.__pyx_unpickle___Pyx_EnumMeta", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_8EnumBase___pyx_unpickle___Pyx_EnumMeta(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase___pyx_unpickle___Pyx_EnumMeta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = 0; + PyObject *__pyx_v___pyx_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle___Pyx_EnumMeta", 0); + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd41d8cd) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":5 + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * if __pyx_checksum != 0xd41d8cd: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 6, __pyx_L1_error) + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + */ + } + + /* "(tree fragment)":7 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype___Pyx_EnumMeta), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "(tree fragment)":9 + * __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_t_3 = __pyx_unpickle___Pyx_EnumMeta__set_state(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":10 + * if __pyx_state is not None: + * __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle___Pyx_EnumMeta(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("EnumBase.__pyx_unpickle___Pyx_EnumMeta", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":11 + * __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + +static PyObject *__pyx_unpickle___Pyx_EnumMeta__set_state(struct __pyx_obj___Pyx_EnumMeta *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle___Pyx_EnumMeta__set_state", 0); + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 12, __pyx_L1_error) + } + __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_3 = ((__pyx_t_2 > 0) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "(tree fragment)":13 + * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 13, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + } + + /* "(tree fragment)":11 + * __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("EnumBase.__pyx_unpickle___Pyx_EnumMeta__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":122 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + +/* Python wrapper */ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_shape = 0; + Py_ssize_t __pyx_v_itemsize; + PyObject *__pyx_v_format = 0; + PyObject *__pyx_v_mode = 0; + int __pyx_v_allocate_buffer; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)__pyx_n_s_c); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 122, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 122, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 122, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_shape = ((PyObject*)values[0]); + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L3_error) + } else { + + /* "View.MemoryView":123 + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, + * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< + * + * cdef int idx + */ + __pyx_v_allocate_buffer = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 122, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(0, 122, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(0, 122, __pyx_L1_error) + } + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); + + /* "View.MemoryView":122 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) { + int __pyx_v_idx; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_dim; + PyObject **__pyx_v_p; + char __pyx_v_order; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":129 + * cdef PyObject **p + * + * self.ndim = len(shape) # <<<<<<<<<<<<<< + * self.itemsize = itemsize + * + */ + if (unlikely(__pyx_v_shape == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 129, __pyx_L1_error) + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":130 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":132 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":133 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 133, __pyx_L1_error) + + /* "View.MemoryView":132 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + } + + /* "View.MemoryView":135 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":136 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 136, __pyx_L1_error) + + /* "View.MemoryView":135 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + } + + /* "View.MemoryView":138 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + __pyx_t_2 = PyBytes_Check(__pyx_v_format); + __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":139 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":138 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + } + + /* "View.MemoryView":140 + * if not isinstance(format, bytes): + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_3 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":141 + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * + * + */ + if (unlikely(__pyx_v_self->_format == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(0, 141, __pyx_L1_error) + } + __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_7; + + /* "View.MemoryView":144 + * + * + * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< + * self._strides = self._shape + self.ndim + * + */ + __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); + + /* "View.MemoryView":145 + * + * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) + * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< + * + * if not self._shape: + */ + __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); + + /* "View.MemoryView":147 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":148 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 148, __pyx_L1_error) + + /* "View.MemoryView":147 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + } + + /* "View.MemoryView":151 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + __pyx_t_8 = 0; + __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + for (;;) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 151, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_9; + __pyx_v_idx = __pyx_t_8; + __pyx_t_8 = (__pyx_t_8 + 1); + + /* "View.MemoryView":152 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":153 + * for idx, dim in enumerate(shape): + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< + * self._shape[idx] = dim + * + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6); + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(0, 153, __pyx_L1_error) + + /* "View.MemoryView":152 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + } + + /* "View.MemoryView":154 + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim # <<<<<<<<<<<<<< + * + * cdef char order + */ + (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; + + /* "View.MemoryView":151 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":157 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 157, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":158 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":159 + * if mode == 'fortran': + * order = b'F' + * self.mode = u'fortran' # <<<<<<<<<<<<<< + * elif mode == 'c': + * order = b'C' + */ + __Pyx_INCREF(__pyx_n_u_fortran); + __Pyx_GIVEREF(__pyx_n_u_fortran); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_fortran; + + /* "View.MemoryView":157 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":160 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 160, __pyx_L1_error) + if (likely(__pyx_t_4)) { + + /* "View.MemoryView":161 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":162 + * elif mode == 'c': + * order = b'C' + * self.mode = u'c' # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + */ + __Pyx_INCREF(__pyx_n_u_c); + __Pyx_GIVEREF(__pyx_n_u_c); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_c; + + /* "View.MemoryView":160 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":164 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< + * + * self.len = fill_contig_strides_array(self._shape, self._strides, + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(0, 164, __pyx_L1_error) + } + __pyx_L10:; + + /* "View.MemoryView":166 + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + * + * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< + * itemsize, self.ndim, order) + * + */ + __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); + + /* "View.MemoryView":169 + * itemsize, self.ndim, order) + * + * self.free_data = allocate_buffer # <<<<<<<<<<<<<< + * self.dtype_is_object = format == b'O' + * if allocate_buffer: + */ + __pyx_v_self->free_data = __pyx_v_allocate_buffer; + + /* "View.MemoryView":170 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: + * + */ + __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":171 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = (__pyx_v_allocate_buffer != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":174 + * + * + * self.data = malloc(self.len) # <<<<<<<<<<<<<< + * if not self.data: + * raise MemoryError("unable to allocate array data.") + */ + __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); + + /* "View.MemoryView":175 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":176 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(0, 176, __pyx_L1_error) + + /* "View.MemoryView":175 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + } + + /* "View.MemoryView":178 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":179 + * + * if self.dtype_is_object: + * p = self.data # <<<<<<<<<<<<<< + * for i in range(self.len / itemsize): + * p[i] = Py_None + */ + __pyx_v_p = ((PyObject **)__pyx_v_self->data); + + /* "View.MemoryView":180 + * if self.dtype_is_object: + * p = self.data + * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< + * p[i] = Py_None + * Py_INCREF(Py_None) + */ + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(0, 180, __pyx_L1_error) + } + else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(0, 180, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + __pyx_t_9 = __pyx_t_1; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "View.MemoryView":181 + * p = self.data + * for i in range(self.len / itemsize): + * p[i] = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + (__pyx_v_p[__pyx_v_i]) = Py_None; + + /* "View.MemoryView":182 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + + /* "View.MemoryView":178 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + } + + /* "View.MemoryView":171 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":122 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":185 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_bufmode; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + char *__pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "View.MemoryView":186 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 # <<<<<<<<<<<<<< + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = -1; + + /* "View.MemoryView":187 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":188 + * cdef int bufmode = -1 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + + /* "View.MemoryView":187 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + goto __pyx_L3; + } + + /* "View.MemoryView":189 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":190 + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + */ + __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + + /* "View.MemoryView":189 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + } + __pyx_L3:; + + /* "View.MemoryView":191 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":192 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 192, __pyx_L1_error) + + /* "View.MemoryView":191 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + } + + /* "View.MemoryView":193 + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data # <<<<<<<<<<<<<< + * info.len = self.len + * info.ndim = self.ndim + */ + __pyx_t_4 = __pyx_v_self->data; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":194 + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + * info.len = self.len # <<<<<<<<<<<<<< + * info.ndim = self.ndim + * info.shape = self._shape + */ + __pyx_t_5 = __pyx_v_self->len; + __pyx_v_info->len = __pyx_t_5; + + /* "View.MemoryView":195 + * info.buf = self.data + * info.len = self.len + * info.ndim = self.ndim # <<<<<<<<<<<<<< + * info.shape = self._shape + * info.strides = self._strides + */ + __pyx_t_6 = __pyx_v_self->ndim; + __pyx_v_info->ndim = __pyx_t_6; + + /* "View.MemoryView":196 + * info.len = self.len + * info.ndim = self.ndim + * info.shape = self._shape # <<<<<<<<<<<<<< + * info.strides = self._strides + * info.suboffsets = NULL + */ + __pyx_t_7 = __pyx_v_self->_shape; + __pyx_v_info->shape = __pyx_t_7; + + /* "View.MemoryView":197 + * info.ndim = self.ndim + * info.shape = self._shape + * info.strides = self._strides # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = self.itemsize + */ + __pyx_t_7 = __pyx_v_self->_strides; + __pyx_v_info->strides = __pyx_t_7; + + /* "View.MemoryView":198 + * info.shape = self._shape + * info.strides = self._strides + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = self.itemsize + * info.readonly = 0 + */ + __pyx_v_info->suboffsets = NULL; + + /* "View.MemoryView":199 + * info.strides = self._strides + * info.suboffsets = NULL + * info.itemsize = self.itemsize # <<<<<<<<<<<<<< + * info.readonly = 0 + * + */ + __pyx_t_5 = __pyx_v_self->itemsize; + __pyx_v_info->itemsize = __pyx_t_5; + + /* "View.MemoryView":200 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":202 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":203 + * + * if flags & PyBUF_FORMAT: + * info.format = self.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_4 = __pyx_v_self->format; + __pyx_v_info->format = __pyx_t_4; + + /* "View.MemoryView":202 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":205 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":207 + * info.format = NULL + * + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":185 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":211 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + +/* Python wrapper */ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":212 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":213 + * def __dealloc__(array self): + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) # <<<<<<<<<<<<<< + * elif self.free_data: + * if self.dtype_is_object: + */ + __pyx_v_self->callback_free_data(__pyx_v_self->data); + + /* "View.MemoryView":212 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":214 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":215 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":216 + * elif self.free_data: + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< + * self._strides, self.ndim, False) + * free(self.data) + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); + + /* "View.MemoryView":215 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + } + + /* "View.MemoryView":218 + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + * free(self.data) # <<<<<<<<<<<<<< + * PyObject_Free(self._shape) + * + */ + free(__pyx_v_self->data); + + /* "View.MemoryView":214 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + } + __pyx_L3:; + + /* "View.MemoryView":219 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< + * + * @property + */ + PyObject_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":211 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":222 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":223 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< + * + * @cname('get_memview') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":222 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":226 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_memview", 0); + + /* "View.MemoryView":227 + * @cname('get_memview') + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":228 + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":226 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":230 + * return memoryview(self, flags, self.dtype_is_object) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self._shape[0] + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":231 + * + * def __len__(self): + * return self._shape[0] # <<<<<<<<<<<<<< + * + * def __getattr__(self, attr): + */ + __pyx_r = (__pyx_v_self->_shape[0]); + goto __pyx_L0; + + /* "View.MemoryView":230 + * return memoryview(self, flags, self.dtype_is_object) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self._shape[0] + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":233 + * return self._shape[0] + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":234 + * + * def __getattr__(self, attr): + * return getattr(self.memview, attr) # <<<<<<<<<<<<<< + * + * def __getitem__(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":233 + * return self._shape[0] + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":236 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":237 + * + * def __getitem__(self, item): + * return self.memview[item] # <<<<<<<<<<<<<< + * + * def __setitem__(self, item, value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":236 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":239 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + +/* Python wrapper */ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":240 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":239 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":244 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + +static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) { + struct __pyx_array_obj *__pyx_v_result = 0; + struct __pyx_array_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_cwrapper", 0); + + /* "View.MemoryView":248 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":249 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":248 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":251 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":252 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(0, 252, __pyx_L1_error) + + /* "View.MemoryView":251 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":253 + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) + * result.data = buf # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->data = __pyx_v_buf; + } + __pyx_L3:; + + /* "View.MemoryView":255 + * result.data = buf + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":244 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":281 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + +/* Python wrapper */ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 281, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 281, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "View.MemoryView":282 + * cdef object name + * def __init__(self, name): + * self.name = name # <<<<<<<<<<<<<< + * def __repr__(self): + * return self.name + */ + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_name; + + /* "View.MemoryView":281 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":283 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + +/* Python wrapper */ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":284 + * self.name = name + * def __repr__(self): + * return self.name # <<<<<<<<<<<<<< + * + * cdef generic = Enum("") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* "View.MemoryView":283 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_v_state = 0; + PyObject *__pyx_v__dict = 0; + int __pyx_v_use_setstate; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":5 + * cdef object _dict + * cdef bint use_setstate + * state = (self.name,) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->name); + __Pyx_GIVEREF(__pyx_v_self->name); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name); + __pyx_v_state = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "(tree fragment)":6 + * cdef bint use_setstate + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":7 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":8 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "(tree fragment)":9 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self.name is not None + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":7 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":11 + * use_setstate = True + * else: + * use_setstate = self.name is not None # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_self->name != Py_None); + __pyx_v_use_setstate = __pyx_t_3; + } + __pyx_L3:; + + /* "(tree fragment)":12 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":13 + * use_setstate = self.name is not None + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184977713); + __Pyx_GIVEREF(__pyx_int_184977713); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":12 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + } + + /* "(tree fragment)":15 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184977713); + __Pyx_GIVEREF(__pyx_int_184977713); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":16 + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":17 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":298 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + +static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) { + Py_intptr_t __pyx_v_aligned_p; + size_t __pyx_v_offset; + void *__pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":300 + * cdef void *align_pointer(void *memory, size_t alignment) nogil: + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< + * cdef size_t offset + * + */ + __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); + + /* "View.MemoryView":304 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":306 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + __pyx_t_1 = ((__pyx_v_offset > 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":307 + * + * if offset > 0: + * aligned_p += alignment - offset # <<<<<<<<<<<<<< + * + * return aligned_p + */ + __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); + + /* "View.MemoryView":306 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + } + + /* "View.MemoryView":309 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":298 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":345 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + +/* Python wrapper */ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_obj = 0; + int __pyx_v_flags; + int __pyx_v_dtype_is_object; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(0, 345, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 345, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_obj = values[0]; + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 345, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "View.MemoryView":346 + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj # <<<<<<<<<<<<<< + * self.flags = flags + * if type(self) is memoryview or obj is not None: + */ + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __Pyx_GOTREF(__pyx_v_self->obj); + __Pyx_DECREF(__pyx_v_self->obj); + __pyx_v_self->obj = __pyx_v_obj; + + /* "View.MemoryView":347 + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj + * self.flags = flags # <<<<<<<<<<<<<< + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + */ + __pyx_v_self->flags = __pyx_v_flags; + + /* "View.MemoryView":348 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_obj != Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "View.MemoryView":349 + * self.flags = flags + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + */ + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 349, __pyx_L1_error) + + /* "View.MemoryView":350 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":351 + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; + + /* "View.MemoryView":352 + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * global __pyx_memoryview_thread_locks_used + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":350 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + } + + /* "View.MemoryView":348 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + } + + /* "View.MemoryView":355 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":356 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + */ + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + + /* "View.MemoryView":357 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + + /* "View.MemoryView":355 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + } + + /* "View.MemoryView":358 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":359 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":360 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":361 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); __PYX_ERR(0, 361, __pyx_L1_error) + + /* "View.MemoryView":360 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } + + /* "View.MemoryView":358 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + } + + /* "View.MemoryView":363 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":364 + * + * if flags & PyBUF_FORMAT: + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< + * else: + * self.dtype_is_object = dtype_is_object + */ + __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L11_bool_binop_done:; + __pyx_v_self->dtype_is_object = __pyx_t_1; + + /* "View.MemoryView":363 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + goto __pyx_L10; + } + + /* "View.MemoryView":366 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L10:; + + /* "View.MemoryView":368 + * self.dtype_is_object = dtype_is_object + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL + */ + __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); + + /* "View.MemoryView":370 + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL # <<<<<<<<<<<<<< + * + * def __dealloc__(memoryview self): + */ + __pyx_v_self->typeinfo = NULL; + + /* "View.MemoryView":345 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":372 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + +/* Python wrapper */ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyThread_type_lock __pyx_t_6; + PyThread_type_lock __pyx_t_7; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":373 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + */ + __pyx_t_1 = (__pyx_v_self->obj != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":374 + * def __dealloc__(memoryview self): + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + * + */ + __Pyx_ReleaseBuffer((&__pyx_v_self->view)); + + /* "View.MemoryView":373 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":375 + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< + * + * (<__pyx_buffer *> &self.view).obj = NULL + */ + __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":377 + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + * + * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<< + * Py_DECREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL; + + /* "View.MemoryView":378 + * + * (<__pyx_buffer *> &self.view).obj = NULL + * Py_DECREF(Py_None) # <<<<<<<<<<<<<< + * + * cdef int i + */ + Py_DECREF(Py_None); + + /* "View.MemoryView":375 + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< + * + * (<__pyx_buffer *> &self.view).obj = NULL + */ + } + __pyx_L3:; + + /* "View.MemoryView":382 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":383 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":384 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":385 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + + /* "View.MemoryView":386 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":388 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]); + + /* "View.MemoryView":387 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break + */ + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7; + + /* "View.MemoryView":386 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + } + + /* "View.MemoryView":389 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< + * else: + * PyThread_free_lock(self.lock) + */ + goto __pyx_L6_break; + + /* "View.MemoryView":384 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + } + } + /*else*/ { + + /* "View.MemoryView":391 + * break + * else: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + */ + PyThread_free_lock(__pyx_v_self->lock); + } + __pyx_L6_break:; + + /* "View.MemoryView":382 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + } + + /* "View.MemoryView":372 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":393 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + Py_ssize_t __pyx_v_dim; + char *__pyx_v_itemp; + PyObject *__pyx_v_idx = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + char *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item_pointer", 0); + + /* "View.MemoryView":395 + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< + * + * for dim, idx in enumerate(index): + */ + __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); + + /* "View.MemoryView":397 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + */ + __pyx_t_1 = 0; + if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) { + __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 397, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_1; + __pyx_t_1 = (__pyx_t_1 + 1); + + /* "View.MemoryView":398 + * + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + * + * return itemp + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; + + /* "View.MemoryView":397 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":400 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":393 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":403 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_indices = NULL; + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":404 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":405 + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: + * return self # <<<<<<<<<<<<<< + * + * have_slices, indices = _unellipsify(index, self.view.ndim) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "View.MemoryView":404 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + } + + /* "View.MemoryView":407 + * return self + * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp + */ + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 407, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 407, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":410 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 410, __pyx_L1_error) + if (__pyx_t_2) { + + /* "View.MemoryView":411 + * cdef char *itemp + * if have_slices: + * return memview_slice(self, indices) # <<<<<<<<<<<<<< + * else: + * itemp = self.get_item_pointer(indices) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":410 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + } + + /* "View.MemoryView":413 + * return memview_slice(self, indices) + * else: + * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< + * return self.convert_item_to_object(itemp) + * + */ + /*else*/ { + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":414 + * else: + * itemp = self.get_item_pointer(indices) + * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< + * + * def __setitem__(memoryview self, object index, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":403 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":416 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_obj = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":417 + * + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: # <<<<<<<<<<<<<< + * raise TypeError("Cannot assign to read-only memoryview") + * + */ + __pyx_t_1 = (__pyx_v_self->view.readonly != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":418 + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< + * + * have_slices, index = _unellipsify(index, self.view.ndim) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 418, __pyx_L1_error) + + /* "View.MemoryView":417 + * + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: # <<<<<<<<<<<<<< + * raise TypeError("Cannot assign to read-only memoryview") + * + */ + } + + /* "View.MemoryView":420 + * raise TypeError("Cannot assign to read-only memoryview") + * + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: + */ + __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(__pyx_t_2 != Py_None)) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 420, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 420, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":422 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 422, __pyx_L1_error) + if (__pyx_t_1) { + + /* "View.MemoryView":423 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_obj = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":424 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 424, __pyx_L1_error) + if (__pyx_t_1) { + + /* "View.MemoryView":425 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "View.MemoryView":424 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":427 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L5:; + + /* "View.MemoryView":422 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":429 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + /*else*/ { + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L4:; + + /* "View.MemoryView":416 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":431 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_slice", 0); + __Pyx_INCREF(__pyx_v_obj); + + /* "View.MemoryView":432 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":433 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "View.MemoryView":434 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 434, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":435 + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":434 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 434, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + + /* "View.MemoryView":433 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "View.MemoryView":436 + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + * except TypeError: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 436, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":437 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "View.MemoryView":433 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":432 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + */ + } + + /* "View.MemoryView":439 + * return None + * + * return obj # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assignment(self, dst, src): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + + /* "View.MemoryView":431 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":441 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) { + __Pyx_memviewslice __pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_src_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + __Pyx_memviewslice *__pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); + + /* "View.MemoryView":445 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 445, __pyx_L1_error) + + /* "View.MemoryView":446 + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) + * + */ + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(0, 446, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 446, __pyx_L1_error) + + /* "View.MemoryView":447 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":445 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 445, __pyx_L1_error) + + /* "View.MemoryView":441 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":449 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) { + int __pyx_v_array[0x80]; + void *__pyx_v_tmp; + void *__pyx_v_item; + __Pyx_memviewslice *__pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_tmp_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + char const *__pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); + + /* "View.MemoryView":451 + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * cdef int array[128] + * cdef void *tmp = NULL # <<<<<<<<<<<<<< + * cdef void *item + * + */ + __pyx_v_tmp = NULL; + + /* "View.MemoryView":456 + * cdef __Pyx_memviewslice *dst_slice + * cdef __Pyx_memviewslice tmp_slice + * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< + * + * if self.view.itemsize > sizeof(array): + */ + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_v_dst_slice = __pyx_t_1; + + /* "View.MemoryView":458 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":459 + * + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< + * if tmp == NULL: + * raise MemoryError + */ + __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); + + /* "View.MemoryView":460 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":461 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); __PYX_ERR(0, 461, __pyx_L1_error) + + /* "View.MemoryView":460 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + } + + /* "View.MemoryView":462 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + + /* "View.MemoryView":458 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":464 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":466 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":467 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":468 + * try: + * if self.dtype_is_object: + * ( item)[0] = value # <<<<<<<<<<<<<< + * else: + * self.assign_item_from_object( item, value) + */ + (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); + + /* "View.MemoryView":467 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":470 + * ( item)[0] = value + * else: + * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":474 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":475 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":474 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + } + + /* "View.MemoryView":476 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * item, self.dtype_is_object) + * finally: + */ + __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); + } + + /* "View.MemoryView":479 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + __pyx_L6_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; + { + PyMem_Free(__pyx_v_tmp); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "View.MemoryView":449 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":481 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + char *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_indexed", 0); + + /* "View.MemoryView":482 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":483 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":481 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":485 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_v_struct = NULL; + PyObject *__pyx_v_bytesitem = 0; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + size_t __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":488 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":491 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":492 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "View.MemoryView":493 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":492 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + } + + /* "View.MemoryView":497 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { + + /* "View.MemoryView":498 + * else: + * if len(self.view.format) == 1: + * return result[0] # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; + + /* "View.MemoryView":497 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + } + + /* "View.MemoryView":499 + * if len(self.view.format) == 1: + * return result[0] + * return result # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L6_except_return; + } + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "View.MemoryView":494 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9); + __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 494, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_1); + + /* "View.MemoryView":495 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 495, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(0, 495, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "View.MemoryView":492 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } + + /* "View.MemoryView":485 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesitem); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":501 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_v_struct = NULL; + char __pyx_v_c; + PyObject *__pyx_v_bytesvalue = 0; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + char *__pyx_t_11; + char *__pyx_t_12; + char *__pyx_t_13; + char *__pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":504 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":509 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":510 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 510, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":509 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":512 + * bytesvalue = struct.pack(self.view.format, *value) + * else: + * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< + * + * for i, c in enumerate(bytesvalue): + */ + /*else*/ { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":514 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_9 = 0; + if (unlikely(__pyx_v_bytesvalue == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); + __PYX_ERR(0, 514, __pyx_L1_error) + } + __Pyx_INCREF(__pyx_v_bytesvalue); + __pyx_t_10 = __pyx_v_bytesvalue; + __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10); + __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10)); + for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) { + __pyx_t_11 = __pyx_t_14; + __pyx_v_c = (__pyx_t_11[0]); + + /* "View.MemoryView":515 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_9; + + /* "View.MemoryView":514 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_9 = (__pyx_t_9 + 1); + + /* "View.MemoryView":515 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "View.MemoryView":501 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesvalue); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":518 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t *__pyx_t_4; + char *__pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "View.MemoryView":519 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + */ + __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_self->view.readonly != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":520 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< + * + * if flags & PyBUF_ND: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 520, __pyx_L1_error) + + /* "View.MemoryView":519 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + */ + } + + /* "View.MemoryView":522 + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + * if flags & PyBUF_ND: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":523 + * + * if flags & PyBUF_ND: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_4 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_4; + + /* "View.MemoryView":522 + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + * if flags & PyBUF_ND: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":525 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + /*else*/ { + __pyx_v_info->shape = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":527 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":528 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_4 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_4; + + /* "View.MemoryView":527 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + goto __pyx_L7; + } + + /* "View.MemoryView":530 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L7:; + + /* "View.MemoryView":532 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":533 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_4 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_4; + + /* "View.MemoryView":532 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":535 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L8:; + + /* "View.MemoryView":537 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":538 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_5 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_5; + + /* "View.MemoryView":537 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":540 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L9:; + + /* "View.MemoryView":542 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_6 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_6; + + /* "View.MemoryView":543 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_7 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_7; + + /* "View.MemoryView":544 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = self.view.readonly + */ + __pyx_t_8 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_8; + + /* "View.MemoryView":545 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = self.view.readonly + * info.obj = self + */ + __pyx_t_8 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_8; + + /* "View.MemoryView":546 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = self.view.readonly # <<<<<<<<<<<<<< + * info.obj = self + * + */ + __pyx_t_1 = __pyx_v_self->view.readonly; + __pyx_v_info->readonly = __pyx_t_1; + + /* "View.MemoryView":547 + * info.len = self.view.len + * info.readonly = self.view.readonly + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":518 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":553 + * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":554 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":555 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(0, 555, __pyx_L1_error) + + /* "View.MemoryView":556 + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + * return result # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":553 + * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":559 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":560 + * @property + * def base(self): + * return self.obj # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->obj); + __pyx_r = __pyx_v_self->obj; + goto __pyx_L0; + + /* "View.MemoryView":559 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":563 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_length; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":564 + * @property + * def shape(self): + * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); + for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { + __pyx_t_2 = __pyx_t_4; + __pyx_v_length = (__pyx_t_2[0]); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":563 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":567 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_stride; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":568 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":570 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 570, __pyx_L1_error) + + /* "View.MemoryView":568 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + } + + /* "View.MemoryView":572 + * raise ValueError("Buffer view does not expose strides") + * + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); + for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { + __pyx_t_3 = __pyx_t_5; + __pyx_v_stride = (__pyx_t_3[0]); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "View.MemoryView":567 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":575 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + Py_ssize_t *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":576 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":577 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__18, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":576 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + } + + /* "View.MemoryView":579 + * return (-1,) * self.view.ndim + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":575 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":582 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":583 + * @property + * def ndim(self): + * return self.view.ndim # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":582 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":586 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":587 + * @property + * def itemsize(self): + * return self.view.itemsize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":586 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":590 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":591 + * @property + * def nbytes(self): + * return self.size * self.view.itemsize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":590 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":594 + * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":595 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":596 + * def size(self): + * if self._size is None: + * result = 1 # <<<<<<<<<<<<<< + * + * for length in self.view.shape[:self.view.ndim]: + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_result = __pyx_int_1; + + /* "View.MemoryView":598 + * result = 1 + * + * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< + * result *= length + * + */ + __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); + for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { + __pyx_t_3 = __pyx_t_5; + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; + + /* "View.MemoryView":599 + * + * for length in self.view.shape[:self.view.ndim]: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + } + + /* "View.MemoryView":601 + * result *= length + * + * self._size = result # <<<<<<<<<<<<<< + * + * return self._size + */ + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_GOTREF(__pyx_v_self->_size); + __Pyx_DECREF(__pyx_v_self->_size); + __pyx_v_self->_size = __pyx_v_result; + + /* "View.MemoryView":595 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + } + + /* "View.MemoryView":603 + * self._size = result + * + * return self._size # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_size); + __pyx_r = __pyx_v_self->_size; + goto __pyx_L0; + + /* "View.MemoryView":594 + * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":605 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":606 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":607 + * def __len__(self): + * if self.view.ndim >= 1: + * return self.view.shape[0] # <<<<<<<<<<<<<< + * + * return 0 + */ + __pyx_r = (__pyx_v_self->view.shape[0]); + goto __pyx_L0; + + /* "View.MemoryView":606 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + } + + /* "View.MemoryView":609 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":605 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":611 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":612 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":613 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "View.MemoryView":612 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":611 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":615 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "View.MemoryView":616 + * + * def __str__(self): + * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":615 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":619 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_c_contig", 0); + + /* "View.MemoryView":622 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + */ + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 622, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":623 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< + * + * def is_f_contig(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":619 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":625 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_f_contig", 0); + + /* "View.MemoryView":628 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + */ + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":629 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< + * + * def copy(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":625 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":631 + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_mslice; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy", 0); + + /* "View.MemoryView":633 + * def copy(self): + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &mslice) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); + + /* "View.MemoryView":635 + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * + * slice_copy(self, &mslice) # <<<<<<<<<<<<<< + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); + + /* "View.MemoryView":636 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":641 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< + * + * def copy_fortran(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":631 + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":643 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy_fortran", 0); + + /* "View.MemoryView":645 + * def copy_fortran(self): + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &src) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); + + /* "View.MemoryView":647 + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + * + * slice_copy(self, &src) # <<<<<<<<<<<<<< + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); + + /* "View.MemoryView":648 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":653 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":643 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":657 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + +static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) { + struct __pyx_memoryview_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + + /* "View.MemoryView":658 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":659 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":660 + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_check') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":657 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":663 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("memoryview_check", 0); + + /* "View.MemoryView":664 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + * + * cdef tuple _unellipsify(object index, int ndim): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":663 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":666 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + +static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { + PyObject *__pyx_v_tup = NULL; + PyObject *__pyx_v_result = NULL; + int __pyx_v_have_slices; + int __pyx_v_seen_ellipsis; + CYTHON_UNUSED PyObject *__pyx_v_idx = NULL; + PyObject *__pyx_v_item = NULL; + Py_ssize_t __pyx_v_nslices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_unellipsify", 0); + + /* "View.MemoryView":671 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":672 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + + /* "View.MemoryView":671 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":674 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":676 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":677 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":678 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":679 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; + if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) { + __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 679, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 679, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 679, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 679, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":680 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":681 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":682 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__21); + __Pyx_GIVEREF(__pyx_slice__21); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__21); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":683 + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True # <<<<<<<<<<<<<< + * else: + * result.append(slice(None)) + */ + __pyx_v_seen_ellipsis = 1; + + /* "View.MemoryView":681 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + goto __pyx_L7; + } + + /* "View.MemoryView":685 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__21); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 685, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":686 + * else: + * result.append(slice(None)) + * have_slices = True # <<<<<<<<<<<<<< + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + */ + __pyx_v_have_slices = 1; + + /* "View.MemoryView":680 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + goto __pyx_L6; + } + + /* "View.MemoryView":688 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + /*else*/ { + __pyx_t_2 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_1 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":689 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_11, 0, 0, 0); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __PYX_ERR(0, 689, __pyx_L1_error) + + /* "View.MemoryView":688 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + } + + /* "View.MemoryView":691 + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< + * result.append(item) + * + */ + __pyx_t_10 = (__pyx_v_have_slices != 0); + if (!__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = (__pyx_t_10 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L11_bool_binop_done:; + __pyx_v_have_slices = __pyx_t_1; + + /* "View.MemoryView":692 + * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 692, __pyx_L1_error) + } + __pyx_L6:; + + /* "View.MemoryView":679 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":694 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 694, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":695 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":696 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__21); + __Pyx_GIVEREF(__pyx_slice__21); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__21); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 696, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":695 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + } + + /* "View.MemoryView":698 + * result.extend([slice(None)] * nslices) + * + * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + */ + __Pyx_XDECREF(__pyx_r); + if (!__pyx_v_have_slices) { + } else { + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_11); + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "View.MemoryView":666 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":700 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + */ + +static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) { + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); + + /* "View.MemoryView":701 + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") + */ + __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim); + for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) { + __pyx_t_1 = __pyx_t_3; + __pyx_v_suboffset = (__pyx_t_1[0]); + + /* "View.MemoryView":702 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":703 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 703, __pyx_L1_error) + + /* "View.MemoryView":702 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + } + } + + /* "View.MemoryView":700 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":710 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) { + int __pyx_v_new_ndim; + int __pyx_v_suboffset_dim; + int __pyx_v_dim; + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + __Pyx_memviewslice *__pyx_v_p_src; + struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0; + __Pyx_memviewslice *__pyx_v_p_dst; + int *__pyx_v_p_suboffset_dim; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + int __pyx_v_have_start; + int __pyx_v_have_stop; + int __pyx_v_have_step; + PyObject *__pyx_v_index = NULL; + struct __pyx_memoryview_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + struct __pyx_memoryview_obj *__pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memview_slice", 0); + + /* "View.MemoryView":711 + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): + * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< + * cdef bint negative_step + * cdef __Pyx_memviewslice src, dst + */ + __pyx_v_new_ndim = 0; + __pyx_v_suboffset_dim = -1; + + /* "View.MemoryView":718 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); + + /* "View.MemoryView":722 + * cdef _memoryviewslice memviewsliceobj + * + * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 722, __pyx_L1_error) + } + } + #endif + + /* "View.MemoryView":724 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":725 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":726 + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, &src) + */ + __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); + + /* "View.MemoryView":724 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + goto __pyx_L3; + } + + /* "View.MemoryView":728 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":729 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":735 + * + * + * dst.memview = p_src.memview # <<<<<<<<<<<<<< + * dst.data = p_src.data + * + */ + __pyx_t_4 = __pyx_v_p_src->memview; + __pyx_v_dst.memview = __pyx_t_4; + + /* "View.MemoryView":736 + * + * dst.memview = p_src.memview + * dst.data = p_src.data # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_v_p_src->data; + __pyx_v_dst.data = __pyx_t_5; + + /* "View.MemoryView":741 + * + * + * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< + * cdef int *p_suboffset_dim = &suboffset_dim + * cdef Py_ssize_t start, stop, step + */ + __pyx_v_p_dst = (&__pyx_v_dst); + + /* "View.MemoryView":742 + * + * cdef __Pyx_memviewslice *p_dst = &dst + * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step + * cdef bint have_start, have_stop, have_step + */ + __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); + + /* "View.MemoryView":746 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + __pyx_t_6 = 0; + if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) { + __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 746, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 746, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 746, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 746, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_v_dim = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":747 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":751 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L1_error) + + /* "View.MemoryView":748 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 748, __pyx_L1_error) + + /* "View.MemoryView":747 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + goto __pyx_L6; + } + + /* "View.MemoryView":754 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":755 + * False) + * elif index is None: + * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + */ + (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; + + /* "View.MemoryView":756 + * elif index is None: + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 + */ + (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; + + /* "View.MemoryView":757 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + + /* "View.MemoryView":758 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 # <<<<<<<<<<<<<< + * else: + * start = index.start or 0 + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + + /* "View.MemoryView":754 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + goto __pyx_L6; + } + + /* "View.MemoryView":760 + * new_ndim += 1 + * else: + * start = index.start or 0 # <<<<<<<<<<<<<< + * stop = index.stop or 0 + * step = index.step or 0 + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 760, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 760, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":761 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 761, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 761, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":762 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 762, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":764 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 764, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":765 + * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":766 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< + * + * slice_memviewslice( + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":768 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 768, __pyx_L1_error) + + /* "View.MemoryView":774 + * have_start, have_stop, have_step, + * True) + * new_ndim += 1 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + } + __pyx_L6:; + + /* "View.MemoryView":746 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":776 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":777 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":778 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(0, 778, __pyx_L1_error) } + + /* "View.MemoryView":779 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(0, 779, __pyx_L1_error) } + + /* "View.MemoryView":777 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":776 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + } + + /* "View.MemoryView":782 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":783 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":782 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":710 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":807 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) { + Py_ssize_t __pyx_v_new_shape; + int __pyx_v_negative_step; + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":827 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":829 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + __pyx_t_1 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":830 + * + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":829 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + } + + /* "View.MemoryView":831 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_t_1 = (0 <= __pyx_v_start); + if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_start < __pyx_v_shape); + } + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":832 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 832, __pyx_L1_error) + + /* "View.MemoryView":831 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + } + + /* "View.MemoryView":827 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":835 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + /*else*/ { + __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); + if (__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_1 = ((__pyx_v_step < 0) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L6_bool_binop_done:; + __pyx_v_negative_step = __pyx_t_2; + + /* "View.MemoryView":837 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + __pyx_t_1 = (__pyx_v_have_step != 0); + if (__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_1 = ((__pyx_v_step == 0) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L9_bool_binop_done:; + if (__pyx_t_2) { + + /* "View.MemoryView":838 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 838, __pyx_L1_error) + + /* "View.MemoryView":837 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + } + + /* "View.MemoryView":841 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":842 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":843 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":844 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":845 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":844 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":842 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + goto __pyx_L12; + } + + /* "View.MemoryView":846 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":847 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":848 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":847 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } + + /* "View.MemoryView":850 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; + + /* "View.MemoryView":846 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + } + __pyx_L12:; + + /* "View.MemoryView":841 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; + } + + /* "View.MemoryView":852 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":853 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":852 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L15; + } + + /* "View.MemoryView":855 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; + + /* "View.MemoryView":857 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":858 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":859 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":860 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":861 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + + /* "View.MemoryView":860 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + } + + /* "View.MemoryView":858 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + goto __pyx_L17; + } + + /* "View.MemoryView":862 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":863 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + + /* "View.MemoryView":862 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + } + __pyx_L17:; + + /* "View.MemoryView":857 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + goto __pyx_L16; + } + + /* "View.MemoryView":865 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":866 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1L; + + /* "View.MemoryView":865 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + goto __pyx_L19; + } + + /* "View.MemoryView":868 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + /*else*/ { + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L19:; + } + __pyx_L16:; + + /* "View.MemoryView":870 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":871 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + + /* "View.MemoryView":870 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + } + + /* "View.MemoryView":875 + * + * with cython.cdivision(True): + * new_shape = (stop - start) // step # <<<<<<<<<<<<<< + * + * if (stop - start) - step * new_shape: + */ + __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); + + /* "View.MemoryView":877 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":878 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + + /* "View.MemoryView":877 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + } + + /* "View.MemoryView":880 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":881 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + + /* "View.MemoryView":880 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + } + + /* "View.MemoryView":884 + * + * + * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset + */ + (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); + + /* "View.MemoryView":885 + * + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< + * dst.suboffsets[new_ndim] = suboffset + * + */ + (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; + + /* "View.MemoryView":886 + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; + } + __pyx_L3:; + + /* "View.MemoryView":889 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":890 + * + * if suboffset_dim[0] < 0: + * dst.data += start * stride # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride + */ + __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); + + /* "View.MemoryView":889 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + goto __pyx_L23; + } + + /* "View.MemoryView":892 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L23:; + + /* "View.MemoryView":894 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":895 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":896 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":897 + * if not is_slice: + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + */ + __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); + + /* "View.MemoryView":896 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + goto __pyx_L26; + } + + /* "View.MemoryView":899 + * dst.data = ( dst.data)[0] + suboffset + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< + * "must be indexed and not sliced", dim) + * else: + */ + /*else*/ { + + /* "View.MemoryView":900 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 899, __pyx_L1_error) + } + __pyx_L26:; + + /* "View.MemoryView":895 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + goto __pyx_L25; + } + + /* "View.MemoryView":902 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; + + /* "View.MemoryView":894 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + } + + /* "View.MemoryView":904 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":807 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":910 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + +static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_suboffset; + Py_ssize_t __pyx_v_itemsize; + char *__pyx_v_resultp; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pybuffer_index", 0); + + /* "View.MemoryView":912 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1L; + + /* "View.MemoryView":913 + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< + * cdef char *resultp + * + */ + __pyx_t_1 = __pyx_v_view->itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":916 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":917 + * + * if view.ndim == 0: + * shape = view.len / itemsize # <<<<<<<<<<<<<< + * stride = itemsize + * else: + */ + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(0, 917, __pyx_L1_error) + } + else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(0, 917, __pyx_L1_error) + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":918 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":916 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + goto __pyx_L3; + } + + /* "View.MemoryView":920 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":921 + * else: + * shape = view.shape[dim] + * stride = view.strides[dim] # <<<<<<<<<<<<<< + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] + */ + __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); + + /* "View.MemoryView":922 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":923 + * stride = view.strides[dim] + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< + * + * if index < 0: + */ + __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); + + /* "View.MemoryView":922 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + } + } + __pyx_L3:; + + /* "View.MemoryView":925 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":926 + * + * if index < 0: + * index += view.shape[dim] # <<<<<<<<<<<<<< + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + */ + __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); + + /* "View.MemoryView":927 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":928 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 928, __pyx_L1_error) + + /* "View.MemoryView":927 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":925 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + } + + /* "View.MemoryView":930 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":931 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 931, __pyx_L1_error) + + /* "View.MemoryView":930 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":933 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * resultp = bufp + index * stride # <<<<<<<<<<<<<< + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset + */ + __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); + + /* "View.MemoryView":934 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":935 + * resultp = bufp + index * stride + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< + * + * return resultp + */ + __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); + + /* "View.MemoryView":934 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + } + + /* "View.MemoryView":937 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":910 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":943 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + long __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":944 + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: + * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t *shape = memslice.shape + */ + __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; + __pyx_v_ndim = __pyx_t_1; + + /* "View.MemoryView":946 + * cdef int ndim = memslice.memview.view.ndim + * + * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< + * cdef Py_ssize_t *strides = memslice.strides + * + */ + __pyx_t_2 = __pyx_v_memslice->shape; + __pyx_v_shape = __pyx_t_2; + + /* "View.MemoryView":947 + * + * cdef Py_ssize_t *shape = memslice.shape + * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_v_memslice->strides; + __pyx_v_strides = __pyx_t_2; + + /* "View.MemoryView":951 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":952 + * cdef int i, j + * for i in range(ndim / 2): + * j = ndim - 1 - i # <<<<<<<<<<<<<< + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] + */ + __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); + + /* "View.MemoryView":953 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6; + + /* "View.MemoryView":954 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":956 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L6_bool_binop_done:; + if (__pyx_t_7) { + + /* "View.MemoryView":957 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 957, __pyx_L1_error) + + /* "View.MemoryView":956 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + } + } + + /* "View.MemoryView":959 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":943 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":976 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + +/* Python wrapper */ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":977 + * + * def __dealloc__(self): + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); + + /* "View.MemoryView":976 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":979 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":980 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":981 + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) # <<<<<<<<<<<<<< + * else: + * return memoryview.convert_item_to_object(self, itemp) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":980 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + } + + /* "View.MemoryView":983 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":979 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":985 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":986 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":987 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(0, 987, __pyx_L1_error) + + /* "View.MemoryView":986 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":989 + * self.to_dtype_func(itemp, value) + * else: + * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< + * + * @property + */ + /*else*/ { + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":985 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":992 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":993 + * @property + * def base(self): + * return self.from_object # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->from_object); + __pyx_r = __pyx_v_self->from_object; + goto __pyx_L0; + + /* "View.MemoryView":992 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":999 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_TypeInfo *__pyx_t_4; + Py_buffer __pyx_t_5; + Py_ssize_t *__pyx_t_6; + Py_ssize_t *__pyx_t_7; + Py_ssize_t *__pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_fromslice", 0); + + /* "View.MemoryView":1007 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1008 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "View.MemoryView":1007 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "View.MemoryView":1013 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1015 + * result = _memoryviewslice(None, 0, dtype_is_object) + * + * result.from_slice = memviewslice # <<<<<<<<<<<<<< + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + */ + __pyx_v_result->from_slice = __pyx_v_memviewslice; + + /* "View.MemoryView":1016 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":1018 + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< + * result.typeinfo = memviewslice.memview.typeinfo + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_result->from_object); + __Pyx_DECREF(__pyx_v_result->from_object); + __pyx_v_result->from_object = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":1019 + * + * result.from_object = ( memviewslice.memview).base + * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< + * + * result.view = memviewslice.memview.view + */ + __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; + __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; + + /* "View.MemoryView":1021 + * result.typeinfo = memviewslice.memview.typeinfo + * + * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + */ + __pyx_t_5 = __pyx_v_memviewslice.memview->view; + __pyx_v_result->__pyx_base.view = __pyx_t_5; + + /* "View.MemoryView":1022 + * + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + */ + __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); + + /* "View.MemoryView":1023 + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data + * result.view.ndim = ndim # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; + + /* "View.MemoryView":1024 + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; + + /* "View.MemoryView":1025 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":1027 + * Py_INCREF(Py_None) + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< + * result.flags = PyBUF_RECORDS + * else: + */ + __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1028 + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * else: + * result.flags = PyBUF_RECORDS_RO + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1027 + * Py_INCREF(Py_None) + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< + * result.flags = PyBUF_RECORDS + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1030 + * result.flags = PyBUF_RECORDS + * else: + * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + /*else*/ { + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO; + } + __pyx_L4:; + + /* "View.MemoryView":1032 + * result.flags = PyBUF_RECORDS_RO + * + * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< + * result.view.strides = result.from_slice.strides + * + */ + __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); + + /* "View.MemoryView":1033 + * + * result.view.shape = result.from_slice.shape + * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); + + /* "View.MemoryView":1036 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1037 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1038 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1039 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":1040 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L6_break; + + /* "View.MemoryView":1038 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L6_break:; + + /* "View.MemoryView":1042 + * break + * + * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< + * for length in result.view.shape[:ndim]: + * result.view.len *= length + */ + __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + + /* "View.MemoryView":1043 + * + * result.view.len = result.view.itemsize + * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< + * result.view.len *= length + * + */ + __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1044 + * result.view.len = result.view.itemsize + * for length in result.view.shape[:ndim]: + * result.view.len *= length # <<<<<<<<<<<<<< + * + * result.to_object_func = to_object_func + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1044, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1046 + * result.view.len *= length + * + * result.to_object_func = to_object_func # <<<<<<<<<<<<<< + * result.to_dtype_func = to_dtype_func + * + */ + __pyx_v_result->to_object_func = __pyx_v_to_object_func; + + /* "View.MemoryView":1047 + * + * result.to_object_func = to_object_func + * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; + + /* "View.MemoryView":1049 + * result.to_dtype_func = to_dtype_func + * + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":999 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1052 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + */ + +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) { + struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0; + __Pyx_memviewslice *__pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_slice_from_memview", 0); + + /* "View.MemoryView":1055 + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1056 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(0, 1056, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1057 + * if isinstance(memview, _memoryviewslice): + * obj = memview + * return &obj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, mslice) + */ + __pyx_r = (&__pyx_v_obj->from_slice); + goto __pyx_L0; + + /* "View.MemoryView":1055 + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1059 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1060 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1052 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1063 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) { + int __pyx_v_dim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + Py_ssize_t *__pyx_v_suboffsets; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1067 + * cdef (Py_ssize_t*) shape, strides, suboffsets + * + * shape = memview.view.shape # <<<<<<<<<<<<<< + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets + */ + __pyx_t_1 = __pyx_v_memview->view.shape; + __pyx_v_shape = __pyx_t_1; + + /* "View.MemoryView":1068 + * + * shape = memview.view.shape + * strides = memview.view.strides # <<<<<<<<<<<<<< + * suboffsets = memview.view.suboffsets + * + */ + __pyx_t_1 = __pyx_v_memview->view.strides; + __pyx_v_strides = __pyx_t_1; + + /* "View.MemoryView":1069 + * shape = memview.view.shape + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< + * + * dst.memview = <__pyx_memoryview *> memview + */ + __pyx_t_1 = __pyx_v_memview->view.suboffsets; + __pyx_v_suboffsets = __pyx_t_1; + + /* "View.MemoryView":1071 + * suboffsets = memview.view.suboffsets + * + * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< + * dst.data = memview.view.buf + * + */ + __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); + + /* "View.MemoryView":1072 + * + * dst.memview = <__pyx_memoryview *> memview + * dst.data = memview.view.buf # <<<<<<<<<<<<<< + * + * for dim in range(memview.view.ndim): + */ + __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); + + /* "View.MemoryView":1074 + * dst.data = memview.view.buf + * + * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + */ + __pyx_t_2 = __pyx_v_memview->view.ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_dim = __pyx_t_4; + + /* "View.MemoryView":1075 + * + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< + * dst.strides[dim] = strides[dim] + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 + */ + (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); + + /* "View.MemoryView":1076 + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 + * + */ + (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); + + /* "View.MemoryView":1077 + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object') + */ + if ((__pyx_v_suboffsets != 0)) { + __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_5 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5; + } + + /* "View.MemoryView":1063 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1080 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) { + __Pyx_memviewslice __pyx_v_memviewslice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy", 0); + + /* "View.MemoryView":1083 + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< + * return memoryview_copy_from_slice(memview, &memviewslice) + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); + + /* "View.MemoryView":1084 + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) + * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object_from_slice') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1080 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1087 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) { + PyObject *(*__pyx_v_to_object_func)(char *); + int (*__pyx_v_to_dtype_func)(char *, PyObject *); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *(*__pyx_t_3)(char *); + int (*__pyx_t_4)(char *, PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); + + /* "View.MemoryView":1094 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1095 + * + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + */ + __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; + __pyx_v_to_object_func = __pyx_t_3; + + /* "View.MemoryView":1096 + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< + * else: + * to_object_func = NULL + */ + __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; + __pyx_v_to_dtype_func = __pyx_t_4; + + /* "View.MemoryView":1094 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1098 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1099 + * else: + * to_object_func = NULL + * to_dtype_func = NULL # <<<<<<<<<<<<<< + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + */ + __pyx_v_to_dtype_func = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":1101 + * to_dtype_func = NULL + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< + * to_object_func, to_dtype_func, + * memview.dtype_is_object) + */ + __Pyx_XDECREF(__pyx_r); + + /* "View.MemoryView":1103 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1087 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1109 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + +static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { + Py_ssize_t __pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":1110 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + __pyx_t_1 = ((__pyx_v_arg < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1111 + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: + * return -arg # <<<<<<<<<<<<<< + * else: + * return arg + */ + __pyx_r = (-__pyx_v_arg); + goto __pyx_L0; + + /* "View.MemoryView":1110 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1113 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1109 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1116 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1121 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1122 + * cdef int i + * cdef Py_ssize_t c_stride = 0 + * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_f_stride = 0; + + /* "View.MemoryView":1124 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1125 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1126 + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1127 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1125 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1129 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_1; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1130 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1131 + * for i in range(ndim): + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1132 + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + */ + goto __pyx_L7_break; + + /* "View.MemoryView":1130 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1134 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1135 + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + * return 'C' # <<<<<<<<<<<<<< + * else: + * return 'F' + */ + __pyx_r = 'C'; + goto __pyx_L0; + + /* "View.MemoryView":1134 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1137 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1116 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1140 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + + /* "View.MemoryView":1147 + * + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + */ + __pyx_v_src_extent = (__pyx_v_src_shape[0]); + + /* "View.MemoryView":1148 + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] + */ + __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); + + /* "View.MemoryView":1149 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1150 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1152 + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1153 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + + /* "View.MemoryView":1154 + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + */ + __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride)); + } + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L5_bool_binop_done:; + + /* "View.MemoryView":1153 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + if (__pyx_t_1) { + + /* "View.MemoryView":1155 + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); + + /* "View.MemoryView":1153 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1157 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1158 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize)); + + /* "View.MemoryView":1159 + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * else: + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1160 + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L4:; + + /* "View.MemoryView":1152 + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1162 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1163 + * else: + * for i in range(dst_extent): + * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< + * dst_data, dst_strides + 1, + * src_shape + 1, dst_shape + 1, + */ + _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); + + /* "View.MemoryView":1167 + * src_shape + 1, dst_shape + 1, + * ndim - 1, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1168 + * ndim - 1, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1140 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + + /* function exit code */ +} + +/* "View.MemoryView":1170 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + +static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + + /* "View.MemoryView":1173 + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< + * src.shape, dst.shape, ndim, itemsize) + * + */ + _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1170 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1177 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef Py_ssize_t shape, size = src.memview.view.itemsize + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + + /* "View.MemoryView":1179 + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for shape in src.shape[:ndim]: + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1181 + * cdef Py_ssize_t shape, size = src.memview.view.itemsize + * + * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<< + * size *= shape + * + */ + __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim); + for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { + __pyx_t_2 = __pyx_t_4; + __pyx_v_shape = (__pyx_t_2[0]); + + /* "View.MemoryView":1182 + * + * for shape in src.shape[:ndim]: + * size *= shape # <<<<<<<<<<<<<< + * + * return size + */ + __pyx_v_size = (__pyx_v_size * __pyx_v_shape); + } + + /* "View.MemoryView":1184 + * size *= shape + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1177 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef Py_ssize_t shape, size = src.memview.view.itemsize + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1187 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1196 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + __pyx_t_1 = ((__pyx_v_order == 'F') != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1197 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride *= shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_idx = __pyx_t_4; + + /* "View.MemoryView":1198 + * if order == 'F': + * for idx in range(ndim): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride *= shape[idx] + * else: + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1199 + * for idx in range(ndim): + * strides[idx] = stride + * stride *= shape[idx] # <<<<<<<<<<<<<< + * else: + * for idx in range(ndim - 1, -1, -1): + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + + /* "View.MemoryView":1196 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1201 + * stride *= shape[idx] + * else: + * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride *= shape[idx] + */ + /*else*/ { + for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1202 + * else: + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride *= shape[idx] + * + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1203 + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride + * stride *= shape[idx] # <<<<<<<<<<<<<< + * + * return stride + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + } + __pyx_L3:; + + /* "View.MemoryView":1205 + * stride *= shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1187 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1208 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) { + int __pyx_v_i; + void *__pyx_v_result; + size_t __pyx_v_itemsize; + size_t __pyx_v_size; + void *__pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + struct __pyx_memoryview_obj *__pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":1219 + * cdef void *result + * + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef size_t size = slice_get_size(src, ndim) + * + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1220 + * + * cdef size_t itemsize = src.memview.view.itemsize + * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< + * + * result = malloc(size) + */ + __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); + + /* "View.MemoryView":1222 + * cdef size_t size = slice_get_size(src, ndim) + * + * result = malloc(size) # <<<<<<<<<<<<<< + * if not result: + * _err(MemoryError, NULL) + */ + __pyx_v_result = malloc(__pyx_v_size); + + /* "View.MemoryView":1223 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1224 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1224, __pyx_L1_error) + + /* "View.MemoryView":1223 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1227 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1228 + * + * tmpslice.data = result + * tmpslice.memview = src.memview # <<<<<<<<<<<<<< + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + */ + __pyx_t_4 = __pyx_v_src->memview; + __pyx_v_tmpslice->memview = __pyx_t_4; + + /* "View.MemoryView":1229 + * tmpslice.data = result + * tmpslice.memview = src.memview + * for i in range(ndim): # <<<<<<<<<<<<<< + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 + */ + __pyx_t_3 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_3; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1230 + * tmpslice.memview = src.memview + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< + * tmpslice.suboffsets[i] = -1 + * + */ + (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); + + /* "View.MemoryView":1231 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1233 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order)); + + /* "View.MemoryView":1237 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_3; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1238 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1239 + * for i in range(ndim): + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< + * + * if slice_is_contig(src[0], order, ndim): + */ + (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; + + /* "View.MemoryView":1238 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1241 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1242 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size)); + + /* "View.MemoryView":1241 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1244 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1246 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1208 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = NULL; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1251 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + +static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_extents", 0); + + /* "View.MemoryView":1254 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":1253 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 1253, __pyx_L1_error) + + /* "View.MemoryView":1251 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1257 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + +static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_dim", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1258 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 1258, __pyx_L1_error) + + /* "View.MemoryView":1257 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1261 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + +static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1262 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":1263 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1263, __pyx_L1_error) + + /* "View.MemoryView":1262 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1265 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(0, 1265, __pyx_L1_error) + } + + /* "View.MemoryView":1261 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1268 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + void *__pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":1276 + * Check for overlapping memory and verify the shapes. + * """ + * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + */ + __pyx_v_tmpdata = NULL; + + /* "View.MemoryView":1277 + * """ + * cdef void *tmpdata = NULL + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + */ + __pyx_t_1 = __pyx_v_src.memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1279 + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< + * cdef bint broadcasting = False + * cdef bint direct_copy = False + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); + + /* "View.MemoryView":1280 + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False # <<<<<<<<<<<<<< + * cdef bint direct_copy = False + * cdef __Pyx_memviewslice tmp + */ + __pyx_v_broadcasting = 0; + + /* "View.MemoryView":1281 + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False + * cdef bint direct_copy = False # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice tmp + * + */ + __pyx_v_direct_copy = 0; + + /* "View.MemoryView":1284 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1285 + * + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); + + /* "View.MemoryView":1284 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1286 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1287 + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< + * + * cdef int ndim = max(src_ndim, dst_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); + + /* "View.MemoryView":1286 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1289 + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_3 = __pyx_v_dst_ndim; + __pyx_t_4 = __pyx_v_src_ndim; + if (((__pyx_t_3 > __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_v_ndim = __pyx_t_5; + + /* "View.MemoryView":1291 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_5; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1292 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1293 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1294 + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + * broadcasting = True # <<<<<<<<<<<<<< + * src.strides[i] = 0 + * else: + */ + __pyx_v_broadcasting = 1; + + /* "View.MemoryView":1295 + * if src.shape[i] == 1: + * broadcasting = True + * src.strides[i] = 0 # <<<<<<<<<<<<<< + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) + */ + (__pyx_v_src.strides[__pyx_v_i]) = 0; + + /* "View.MemoryView":1293 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1297 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1297, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1292 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1299 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1300, __pyx_L1_error) + + /* "View.MemoryView":1299 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + } + } + + /* "View.MemoryView":1302 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1304 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1305 + * + * if not slice_is_contig(src, order, ndim): + * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); + + /* "View.MemoryView":1304 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1307 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(0, 1307, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_7; + + /* "View.MemoryView":1308 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1302 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + } + + /* "View.MemoryView":1310 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1313 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1314 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1313 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1315 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1316 + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); + + /* "View.MemoryView":1315 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1318 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_2 = (__pyx_v_direct_copy != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1320 + * if direct_copy: + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1321 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim))); + + /* "View.MemoryView":1322 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1323 + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1324 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * if order == 'F' == get_best_order(&dst, ndim): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1318 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1310 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1326 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_8 = (__pyx_t_2 != 0); + if (__pyx_t_8) { + + /* "View.MemoryView":1329 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(0, 1329, __pyx_L1_error) + + /* "View.MemoryView":1330 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(0, 1330, __pyx_L1_error) + + /* "View.MemoryView":1326 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1332 + * transpose_memslice(&dst) + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1333 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + */ + copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1334 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1336 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1337 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1268 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1340 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) { + int __pyx_v_i; + int __pyx_v_offset; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1344 + * int ndim_other) nogil: + * cdef int i + * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); + + /* "View.MemoryView":1346 + * cdef int offset = ndim_other - ndim + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1347 + * + * for i in range(ndim - 1, -1, -1): + * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + */ + (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); + + /* "View.MemoryView":1348 + * for i in range(ndim - 1, -1, -1): + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<< + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + * + */ + (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1349 + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1351 + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + * + * for i in range(offset): # <<<<<<<<<<<<<< + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + */ + __pyx_t_1 = __pyx_v_offset; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1352 + * + * for i in range(offset): + * mslice.shape[i] = 1 # <<<<<<<<<<<<<< + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 + */ + (__pyx_v_mslice->shape[__pyx_v_i]) = 1; + + /* "View.MemoryView":1353 + * for i in range(offset): + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< + * mslice.suboffsets[i] = -1 + * + */ + (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); + + /* "View.MemoryView":1354 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1340 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1362 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { + int __pyx_t_1; + + /* "View.MemoryView":1366 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + __pyx_t_1 = (__pyx_v_dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1367 + * + * if dtype_is_object: + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< + * dst.strides, ndim, inc) + * + */ + __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); + + /* "View.MemoryView":1366 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1362 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + + /* function exit code */ +} + +/* "View.MemoryView":1371 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + __Pyx_RefNannyDeclarations + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); + + /* "View.MemoryView":1374 + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); + + /* "View.MemoryView":1371 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif +} + +/* "View.MemoryView":1377 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1381 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1382 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_4 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1383 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_4 = (__pyx_v_inc != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1384 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1383 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1386 + * Py_INCREF(( data)[0]) + * else: + * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + */ + /*else*/ { + Py_DECREF((((PyObject **)__pyx_v_data)[0])); + } + __pyx_L6:; + + /* "View.MemoryView":1382 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1388 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1389 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1391 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1377 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1397 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { + + /* "View.MemoryView":1400 + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1401 + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1403 + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1397 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1407 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + + /* "View.MemoryView":1411 + * size_t itemsize, void *item) nogil: + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t extent = shape[0] + * + */ + __pyx_v_stride = (__pyx_v_strides[0]); + + /* "View.MemoryView":1412 + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] + * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_extent = (__pyx_v_shape[0]); + + /* "View.MemoryView":1414 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1415 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1416 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize)); + + /* "View.MemoryView":1417 + * for i in range(extent): + * memcpy(data, item, itemsize) + * data += stride # <<<<<<<<<<<<<< + * else: + * for i in range(extent): + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + + /* "View.MemoryView":1414 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1419 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1420 + * else: + * for i in range(extent): + * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, itemsize, item) + * data += stride + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1422 + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + * data += stride # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1407 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* function exit code */ +} + +/* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(0, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(0, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = 0; + PyObject *__pyx_v___pyx_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0); + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":5 + * cdef object __pyx_result + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 6, __pyx_L1_error) + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":7 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "(tree fragment)":9 + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":10 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":11 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v___pyx_result->name); + __Pyx_DECREF(__pyx_v___pyx_result->name); + __pyx_v___pyx_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 13, __pyx_L1_error) + } + __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 > 1) != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_5 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_5; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "(tree fragment)":14 + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 14, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":11 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_9__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer[] = { + {"create_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_3create_buffers, METH_VARARGS|METH_KEYWORDS, 0}, + {"send", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_5send, METH_VARARGS|METH_KEYWORDS, 0}, + {"start_listener", (PyCFunction)__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_7start_listener, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_11__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_13__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer = { + PyVarObject_HEAD_INIT(0, 0) + "cereal.visionipc.visionipc_pyx.VisionIpcServer", /*tp_name*/ + sizeof(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcServer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyObject *__pyx_tp_new_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_3__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_getprop_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_width(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_5width_1__get__(o); +} + +static PyObject *__pyx_getprop_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_height(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6height_1__get__(o); +} + +static PyObject *__pyx_getprop_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_stride(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_6stride_1__get__(o); +} + +static PyMethodDef __pyx_methods_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient[] = { + {"recv", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_5recv, METH_VARARGS|METH_KEYWORDS, 0}, + {"connect", (PyCFunction)__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_7connect, METH_O, 0}, + {"is_connected", (PyCFunction)__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_9is_connected, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_11__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_13__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient[] = { + {(char *)"width", __pyx_getprop_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_width, 0, (char *)0, 0}, + {(char *)"height", __pyx_getprop_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_height, 0, (char *)0, 0}, + {(char *)"stride", __pyx_getprop_6cereal_9visionipc_13visionipc_pyx_15VisionIpcClient_stride, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient = { + PyVarObject_HEAD_INIT(0, 0) + "cereal.visionipc.visionipc_pyx.VisionIpcClient", /*tp_name*/ + sizeof(struct __pyx_obj_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyObject *__pyx_tp_new___Pyx_EnumMeta(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = (&PyType_Type)->tp_new(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc___Pyx_EnumMeta(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + PyObject_GC_Track(o); + (&PyType_Type)->tp_dealloc(o); +} + +static int __pyx_tp_traverse___Pyx_EnumMeta(PyObject *o, visitproc v, void *a) { + int e; + if (!(&PyType_Type)->tp_traverse); else { e = (&PyType_Type)->tp_traverse(o,v,a); if (e) return e; } + return 0; +} + +static int __pyx_tp_clear___Pyx_EnumMeta(PyObject *o) { + if (!(&PyType_Type)->tp_clear); else (&PyType_Type)->tp_clear(o); + return 0; +} +static PyObject *__pyx_sq_item___Pyx_EnumMeta(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static PyMethodDef __pyx_methods___Pyx_EnumMeta[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_8EnumBase_14__Pyx_EnumMeta_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_8EnumBase_14__Pyx_EnumMeta_9__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence___Pyx_EnumMeta = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item___Pyx_EnumMeta, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping___Pyx_EnumMeta = { + 0, /*mp_length*/ + __pyx_pw_8EnumBase_14__Pyx_EnumMeta_5__getitem__, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __Pyx_EnumMeta = { + PyVarObject_HEAD_INIT(0, 0) + "cereal.visionipc.visionipc_pyx.__Pyx_EnumMeta", /*tp_name*/ + sizeof(struct __pyx_obj___Pyx_EnumMeta), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc___Pyx_EnumMeta, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence___Pyx_EnumMeta, /*tp_as_sequence*/ + &__pyx_tp_as_mapping___Pyx_EnumMeta, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse___Pyx_EnumMeta, /*tp_traverse*/ + __pyx_tp_clear___Pyx_EnumMeta, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_8EnumBase_14__Pyx_EnumMeta_3__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods___Pyx_EnumMeta, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_8EnumBase_14__Pyx_EnumMeta_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new___Pyx_EnumMeta, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; +static struct __pyx_vtabstruct_array __pyx_vtable_array; + +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_array_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_array_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_array; + p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_array(PyObject *o) { + struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_array___dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->mode); + Py_CLEAR(p->_format); + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_array___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { + PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n); + if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + v = __pyx_array___getattr__(o, n); + } + return v; +} + +static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o); +} + +static PyMethodDef __pyx_methods_array[] = { + {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_array[] = { + {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_array = { + __pyx_array___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + __pyx_array___len__, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_array_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + "cereal.visionipc.visionipc_pyx.array", /*tp_name*/ + sizeof(struct __pyx_array_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_array, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + __pyx_tp_getattro_array, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_array, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_array, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_array, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_MemviewEnum_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_MemviewEnum_obj *)o); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_Enum(PyObject *o) { + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_Enum(PyObject *o) { + PyObject* tmp; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_Enum[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_MemviewEnum = { + PyVarObject_HEAD_INIT(0, 0) + "cereal.visionipc.visionipc_pyx.Enum", /*tp_name*/ + sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_Enum, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_MemviewEnum___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_Enum, /*tp_traverse*/ + __pyx_tp_clear_Enum, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_Enum, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_MemviewEnum___init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_Enum, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; +static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; + +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryview_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryview_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_memoryview; + p->obj = Py_None; Py_INCREF(Py_None); + p->_size = Py_None; Py_INCREF(Py_None); + p->_array_interface = Py_None; Py_INCREF(Py_None); + p->view.obj = NULL; + if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_memoryview(PyObject *o) { + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_memoryview___dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->obj); + Py_CLEAR(p->_size); + Py_CLEAR(p->_array_interface); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + if (p->obj) { + e = (*v)(p->obj, a); if (e) return e; + } + if (p->_size) { + e = (*v)(p->_size, a); if (e) return e; + } + if (p->_array_interface) { + e = (*v)(p->_array_interface, a); if (e) return e; + } + if (p->view.obj) { + e = (*v)(p->view.obj, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_memoryview(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + tmp = ((PyObject*)p->obj); + p->obj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_size); + p->_size = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_array_interface); + p->_array_interface = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + Py_CLEAR(p->view.obj); + return 0; +} +static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_memoryview___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o); +} + +static PyMethodDef __pyx_methods_memoryview[] = { + {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0}, + {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0}, + {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0}, + {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_memoryview[] = { + {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0}, + {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0}, + {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0}, + {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0}, + {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0}, + {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0}, + {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0}, + {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0}, + {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_memoryview = { + __pyx_memoryview___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_memoryview, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_memoryview = { + __pyx_memoryview___len__, /*mp_length*/ + __pyx_memoryview___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_memoryview = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_memoryview_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_memoryview = { + PyVarObject_HEAD_INIT(0, 0) + "cereal.visionipc.visionipc_pyx.memoryview", /*tp_name*/ + sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_memoryview___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_memoryview___str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_memoryview, /*tp_traverse*/ + __pyx_tp_clear_memoryview, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_memoryview, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_memoryview, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_memoryview, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; +static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; + +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryviewslice_obj *p; + PyObject *o = __pyx_tp_new_memoryview(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryviewslice_obj *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice; + p->from_object = Py_None; Py_INCREF(Py_None); + p->from_slice.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_memoryviewslice___dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->from_object); + PyObject_GC_Track(o); + __pyx_tp_dealloc_memoryview(o); +} + +static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e; + if (p->from_object) { + e = (*v)(p->from_object, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear__memoryviewslice(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + __pyx_tp_clear_memoryview(o); + tmp = ((PyObject*)p->from_object); + p->from_object = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + __PYX_XDEC_MEMVIEW(&p->from_slice, 1); + return 0; +} + +static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o); +} + +static PyMethodDef __pyx_methods__memoryviewslice[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = { + {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_memoryviewslice = { + PyVarObject_HEAD_INIT(0, 0) + "cereal.visionipc.visionipc_pyx._memoryviewslice", /*tp_name*/ + sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Internal class for passing memoryview slices to Python", /*tp_doc*/ + __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/ + __pyx_tp_clear__memoryviewslice, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods__memoryviewslice, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets__memoryviewslice, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new__memoryviewslice, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_visionipc_pyx(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_visionipc_pyx}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "visionipc_pyx", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, + {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, + {&__pyx_n_s_EnumBase, __pyx_k_EnumBase, sizeof(__pyx_k_EnumBase), 0, 0, 1, 1}, + {&__pyx_n_s_EnumType, __pyx_k_EnumType, sizeof(__pyx_k_EnumType), 0, 0, 1, 1}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_k_Incompatible_checksums_s_vs_0xd4, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xd4), 0, 0, 1, 0}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, + {&__pyx_n_s_IntEnum, __pyx_k_IntEnum, sizeof(__pyx_k_IntEnum), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, + {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0}, + {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, + {&__pyx_n_s_OrderedDict, __pyx_k_OrderedDict, sizeof(__pyx_k_OrderedDict), 0, 0, 1, 1}, + {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0}, + {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_Pyx_EnumBase, __pyx_k_Pyx_EnumBase, sizeof(__pyx_k_Pyx_EnumBase), 0, 0, 1, 1}, + {&__pyx_n_s_Pyx_EnumBase___new, __pyx_k_Pyx_EnumBase___new, sizeof(__pyx_k_Pyx_EnumBase___new), 0, 0, 1, 1}, + {&__pyx_n_s_Pyx_EnumBase___repr, __pyx_k_Pyx_EnumBase___repr, sizeof(__pyx_k_Pyx_EnumBase___repr), 0, 0, 1, 1}, + {&__pyx_n_s_Pyx_EnumBase___str, __pyx_k_Pyx_EnumBase___str, sizeof(__pyx_k_Pyx_EnumBase___str), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, + {&__pyx_kp_s_Unknown_enum_value_s, __pyx_k_Unknown_enum_value_s, sizeof(__pyx_k_Unknown_enum_value_s), 0, 0, 1, 0}, + {&__pyx_n_s_VISION_STREAM_DRIVER, __pyx_k_VISION_STREAM_DRIVER, sizeof(__pyx_k_VISION_STREAM_DRIVER), 0, 0, 1, 1}, + {&__pyx_n_s_VISION_STREAM_RGB_BACK, __pyx_k_VISION_STREAM_RGB_BACK, sizeof(__pyx_k_VISION_STREAM_RGB_BACK), 0, 0, 1, 1}, + {&__pyx_n_s_VISION_STREAM_RGB_FRONT, __pyx_k_VISION_STREAM_RGB_FRONT, sizeof(__pyx_k_VISION_STREAM_RGB_FRONT), 0, 0, 1, 1}, + {&__pyx_n_s_VISION_STREAM_RGB_WIDE, __pyx_k_VISION_STREAM_RGB_WIDE, sizeof(__pyx_k_VISION_STREAM_RGB_WIDE), 0, 0, 1, 1}, + {&__pyx_n_s_VISION_STREAM_ROAD, __pyx_k_VISION_STREAM_ROAD, sizeof(__pyx_k_VISION_STREAM_ROAD), 0, 0, 1, 1}, + {&__pyx_n_s_VISION_STREAM_WIDE_ROAD, __pyx_k_VISION_STREAM_WIDE_ROAD, sizeof(__pyx_k_VISION_STREAM_WIDE_ROAD), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, + {&__pyx_n_s_VisionIpcClient, __pyx_k_VisionIpcClient, sizeof(__pyx_k_VisionIpcClient), 0, 0, 1, 1}, + {&__pyx_n_s_VisionIpcServer, __pyx_k_VisionIpcServer, sizeof(__pyx_k_VisionIpcServer), 0, 0, 1, 1}, + {&__pyx_n_s_VisionStreamType, __pyx_k_VisionStreamType, sizeof(__pyx_k_VisionStreamType), 0, 0, 1, 1}, + {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, + {&__pyx_n_s_conflate, __pyx_k_conflate, sizeof(__pyx_k_conflate), 0, 0, 1, 1}, + {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, + {&__pyx_n_s_dct, __pyx_k_dct, sizeof(__pyx_k_dct), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_n_s_frame_id, __pyx_k_frame_id, sizeof(__pyx_k_frame_id), 0, 0, 1, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, + {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_members, __pyx_k_members, sizeof(__pyx_k_members), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_num_buffers, __pyx_k_num_buffers, sizeof(__pyx_k_num_buffers), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0}, + {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_s_parents, __pyx_k_parents, sizeof(__pyx_k_parents), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle___Pyx_EnumMeta, __pyx_k_pyx_unpickle___Pyx_EnumMeta, sizeof(__pyx_k_pyx_unpickle___Pyx_EnumMeta), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, + {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1}, + {&__pyx_n_s_rgb, __pyx_k_rgb, sizeof(__pyx_k_rgb), 0, 0, 1, 1}, + {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s_d, __pyx_k_s_s_d, sizeof(__pyx_k_s_s_d), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_kp_s_self_server_cannot_be_converted, __pyx_k_self_server_cannot_be_converted, sizeof(__pyx_k_self_server_cannot_be_converted), 0, 0, 1, 0}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1}, + {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_timeout_ms, __pyx_k_timeout_ms, sizeof(__pyx_k_timeout_ms), 0, 0, 1, 1}, + {&__pyx_n_s_timestamp_eof, __pyx_k_timestamp_eof, sizeof(__pyx_k_timestamp_eof), 0, 0, 1, 1}, + {&__pyx_n_s_timestamp_sof, __pyx_k_timestamp_sof, sizeof(__pyx_k_timestamp_sof), 0, 0, 1, 1}, + {&__pyx_n_s_tp, __pyx_k_tp, sizeof(__pyx_k_tp), 0, 0, 1, 1}, + {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, + {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, + {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, + {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 832, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.server cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.server cannot be converted to a Python object for pickling") + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self_server_cannot_be_converted); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(tree fragment)":4 + * raise TypeError("self.server cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.server cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_server_cannot_be_converted); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":945 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 945, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":951 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "View.MemoryView":133 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "View.MemoryView":136 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "View.MemoryView":148 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "View.MemoryView":176 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "View.MemoryView":192 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "View.MemoryView":418 + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< + * + * have_slices, index = _unellipsify(index, self.view.ndim) + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "View.MemoryView":495 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "View.MemoryView":520 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< + * + * if flags & PyBUF_ND: + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "View.MemoryView":570 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "View.MemoryView":577 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __pyx_tuple__18 = PyTuple_New(1); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_tuple__18, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "View.MemoryView":682 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__21); + __Pyx_GIVEREF(__pyx_slice__21); + + /* "View.MemoryView":703 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "EnumBase":28 + * class __Pyx_EnumBase(int): + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): # <<<<<<<<<<<<<< + * for v in cls: + * if v == value: + */ + __pyx_tuple__25 = PyTuple_Pack(5, __pyx_n_s_cls, __pyx_n_s_value, __pyx_n_s_name, __pyx_n_s_v, __pyx_n_s_res); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_new, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_tuple__27 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "EnumBase":39 + * cls.__members__[name] = res + * return res + * def __repr__(self): # <<<<<<<<<<<<<< + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_repr, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 39, __pyx_L1_error) + + /* "EnumBase":41 + * def __repr__(self): + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): # <<<<<<<<<<<<<< + * return "%s.%s" % (self.__class__.__name__, self.name) + * + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_str, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 41, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __pyx_unpickle___Pyx_EnumMeta(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_tuple__32 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle___Pyx_EnumMeta, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 1, __pyx_L1_error) + + /* "View.MemoryView":286 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "View.MemoryView":287 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "View.MemoryView":288 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "View.MemoryView":291 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "View.MemoryView":292 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_tuple__39 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_int_222419149 = PyInt_FromLong(222419149L); if (unlikely(!__pyx_int_222419149)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_OrderedDict = Py_None; Py_INCREF(Py_None); + __Pyx_EnumBase = Py_None; Py_INCREF(Py_None); + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + __Pyx_globals = ((PyObject*)Py_None); Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer) < 0) __PYX_ERR(1, 27, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer.tp_dictoffset && __pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_VisionIpcServer, (PyObject *)&__pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer) < 0) __PYX_ERR(1, 27, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer) < 0) __PYX_ERR(1, 27, __pyx_L1_error) + __pyx_ptype_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer = &__pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcServer; + if (PyType_Ready(&__pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient) < 0) __PYX_ERR(1, 57, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient.tp_dictoffset && __pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_VisionIpcClient, (PyObject *)&__pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient) < 0) __PYX_ERR(1, 57, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient) < 0) __PYX_ERR(1, 57, __pyx_L1_error) + __pyx_ptype_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient = &__pyx_type_6cereal_9visionipc_13visionipc_pyx_VisionIpcClient; + __Pyx_EnumMeta.tp_base = (&PyType_Type); + if (PyType_Ready(&__Pyx_EnumMeta) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __Pyx_EnumMeta.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__Pyx_EnumMeta.tp_dictoffset && __Pyx_EnumMeta.tp_getattro == PyObject_GenericGetAttr)) { + __Pyx_EnumMeta.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_setup_reduce((PyObject*)&__Pyx_EnumMeta) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_ptype___Pyx_EnumMeta = &__Pyx_EnumMeta; + __pyx_vtabptr_array = &__pyx_vtable_array; + __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_array.tp_print = 0; + #endif + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 279, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_MemviewEnum.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; + __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; + __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; + __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; + __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment; + __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar; + __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; + __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; + __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_memoryview.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_memoryviewslice.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error) + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initvisionipc_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initvisionipc_pyx(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_visionipc_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_visionipc_pyx(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_visionipc_pyx(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + static PyThread_type_lock __pyx_t_6[8]; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'visionipc_pyx' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_visionipc_pyx(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("visionipc_pyx", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_cereal__visionipc__visionipc_pyx) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "cereal.visionipc.visionipc_pyx")) { + if (unlikely(PyDict_SetItemString(modules, "cereal.visionipc.visionipc_pyx", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error) + if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error) + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + + /* "cereal/visionipc/visionipc_pyx.pyx":4 + * # cython: c_string_encoding=ascii, language_level=3 + * + * import sys # <<<<<<<<<<<<<< + * import numpy as np + * cimport numpy as cnp + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "cereal/visionipc/visionipc_pyx.pyx":5 + * + * import sys + * import numpy as np # <<<<<<<<<<<<<< + * cimport numpy as cnp + * from cython.view cimport array + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "cereal/visionipc/visionipc_pyx.pyx":1 + * # distutils: language = c++ # <<<<<<<<<<<<<< + * # cython: c_string_encoding=ascii, language_level=3 + * + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumBase":9 + * + * cdef object __Pyx_OrderedDict + * if PY_VERSION_HEX >= 0x02070000: # <<<<<<<<<<<<<< + * from collections import OrderedDict as __Pyx_OrderedDict + * else: + */ + __pyx_t_2 = ((PY_VERSION_HEX >= 0x02070000) != 0); + if (__pyx_t_2) { + + /* "EnumBase":10 + * cdef object __Pyx_OrderedDict + * if PY_VERSION_HEX >= 0x02070000: + * from collections import OrderedDict as __Pyx_OrderedDict # <<<<<<<<<<<<<< + * else: + * __Pyx_OrderedDict = dict + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_OrderedDict); + __Pyx_GIVEREF(__pyx_n_s_OrderedDict); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_OrderedDict); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__Pyx_OrderedDict); + __Pyx_DECREF_SET(__Pyx_OrderedDict, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "EnumBase":9 + * + * cdef object __Pyx_OrderedDict + * if PY_VERSION_HEX >= 0x02070000: # <<<<<<<<<<<<<< + * from collections import OrderedDict as __Pyx_OrderedDict + * else: + */ + goto __pyx_L2; + } + + /* "EnumBase":12 + * from collections import OrderedDict as __Pyx_OrderedDict + * else: + * __Pyx_OrderedDict = dict # <<<<<<<<<<<<<< + * + * @cython.internal + */ + /*else*/ { + __Pyx_INCREF(((PyObject *)(&PyDict_Type))); + __Pyx_XGOTREF(__Pyx_OrderedDict); + __Pyx_DECREF_SET(__Pyx_OrderedDict, ((PyObject *)(&PyDict_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyDict_Type))); + } + __pyx_L2:; + + /* "EnumBase":26 + * + * cdef object __Pyx_EnumBase + * class __Pyx_EnumBase(int): # <<<<<<<<<<<<<< + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)(&PyInt_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&PyInt_Type))); + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_3, __pyx_n_s_Pyx_EnumBase, __pyx_n_s_Pyx_EnumBase, (PyObject *) NULL, __pyx_n_s_EnumBase, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "EnumBase":27 + * cdef object __Pyx_EnumBase + * class __Pyx_EnumBase(int): + * __metaclass__ = __Pyx_EnumMeta # <<<<<<<<<<<<<< + * def __new__(cls, value, name=None): + * for v in cls: + */ + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_metaclass, ((PyObject *)__pyx_ptype___Pyx_EnumMeta)) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + + /* "EnumBase":28 + * class __Pyx_EnumBase(int): + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): # <<<<<<<<<<<<<< + * for v in cls: + * if v == value: + */ + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_14__Pyx_EnumBase_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Pyx_EnumBase___new, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__27); + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_new, __pyx_t_5) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "EnumBase":39 + * cls.__members__[name] = res + * return res + * def __repr__(self): # <<<<<<<<<<<<<< + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): + */ + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_14__Pyx_EnumBase_3__repr__, 0, __pyx_n_s_Pyx_EnumBase___repr, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_repr, __pyx_t_5) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "EnumBase":41 + * def __repr__(self): + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): # <<<<<<<<<<<<<< + * return "%s.%s" % (self.__class__.__name__, self.name) + * + */ + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_14__Pyx_EnumBase_5__str__, 0, __pyx_n_s_Pyx_EnumBase___str, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_str, __pyx_t_5) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "EnumBase":26 + * + * cdef object __Pyx_EnumBase + * class __Pyx_EnumBase(int): # <<<<<<<<<<<<<< + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): + */ + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Pyx_EnumBase, __pyx_t_3, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XGOTREF(__Pyx_EnumBase); + __Pyx_DECREF_SET(__Pyx_EnumBase, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "EnumBase":44 + * return "%s.%s" % (self.__class__.__name__, self.name) + * + * if PY_VERSION_HEX >= 0x03040000: # <<<<<<<<<<<<<< + * from enum import IntEnum as __Pyx_EnumBase + * + */ + __pyx_t_2 = ((PY_VERSION_HEX >= 0x03040000) != 0); + if (__pyx_t_2) { + + /* "EnumBase":45 + * + * if PY_VERSION_HEX >= 0x03040000: + * from enum import IntEnum as __Pyx_EnumBase # <<<<<<<<<<<<<< + * + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_IntEnum); + __Pyx_GIVEREF(__pyx_n_s_IntEnum); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_IntEnum); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_enum, __pyx_t_3, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_3); + __Pyx_XGOTREF(__Pyx_EnumBase); + __Pyx_DECREF_SET(__Pyx_EnumBase, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumBase":44 + * return "%s.%s" % (self.__class__.__name__, self.name) + * + * if PY_VERSION_HEX >= 0x03040000: # <<<<<<<<<<<<<< + * from enum import IntEnum as __Pyx_EnumBase + * + */ + } + + /* "(tree fragment)":1 + * def __pyx_unpickle___Pyx_EnumMeta(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta, NULL, __pyx_n_s_EnumBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle___Pyx_EnumMeta, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":209 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * def __dealloc__(array self): + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":286 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":287 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":288 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":291 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":292 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":316 + * + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ + * PyThread_allocate_lock(), + */ + __pyx_memoryview_thread_locks_used = 0; + + /* "View.MemoryView":317 + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< + * PyThread_allocate_lock(), + * PyThread_allocate_lock(), + */ + __pyx_t_6[0] = PyThread_allocate_lock(); + __pyx_t_6[1] = PyThread_allocate_lock(); + __pyx_t_6[2] = PyThread_allocate_lock(); + __pyx_t_6[3] = PyThread_allocate_lock(); + __pyx_t_6[4] = PyThread_allocate_lock(); + __pyx_t_6[5] = PyThread_allocate_lock(); + __pyx_t_6[6] = PyThread_allocate_lock(); + __pyx_t_6[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_6, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + + /* "View.MemoryView":549 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":995 + * return self.from_object + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_memoryviewslice_type); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumType":50 + * + * + * cdef dict __Pyx_globals = globals() # <<<<<<<<<<<<<< + * if PY_VERSION_HEX >= 0x03040000: + * + */ + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_XGOTREF(__Pyx_globals); + __Pyx_DECREF_SET(__Pyx_globals, ((PyObject*)__pyx_t_1)); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "EnumType":51 + * + * cdef dict __Pyx_globals = globals() + * if PY_VERSION_HEX >= 0x03040000: # <<<<<<<<<<<<<< + * + * VisionStreamType = __Pyx_EnumBase('VisionStreamType', __Pyx_OrderedDict([ + */ + __pyx_t_2 = ((PY_VERSION_HEX >= 0x03040000) != 0); + if (__pyx_t_2) { + + /* "EnumType":54 + * + * VisionStreamType = __Pyx_EnumBase('VisionStreamType', __Pyx_OrderedDict([ + * ('VISION_STREAM_RGB_BACK', VISION_STREAM_RGB_BACK), # <<<<<<<<<<<<<< + * ('VISION_STREAM_RGB_FRONT', VISION_STREAM_RGB_FRONT), + * ('VISION_STREAM_RGB_WIDE', VISION_STREAM_RGB_WIDE), + */ + __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(__pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_RGB_BACK); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_VISION_STREAM_RGB_BACK); + __Pyx_GIVEREF(__pyx_n_s_VISION_STREAM_RGB_BACK); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_VISION_STREAM_RGB_BACK); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __pyx_t_1 = 0; + + /* "EnumType":55 + * VisionStreamType = __Pyx_EnumBase('VisionStreamType', __Pyx_OrderedDict([ + * ('VISION_STREAM_RGB_BACK', VISION_STREAM_RGB_BACK), + * ('VISION_STREAM_RGB_FRONT', VISION_STREAM_RGB_FRONT), # <<<<<<<<<<<<<< + * ('VISION_STREAM_RGB_WIDE', VISION_STREAM_RGB_WIDE), + * ('VISION_STREAM_ROAD', VISION_STREAM_ROAD), + */ + __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(__pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_RGB_FRONT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_VISION_STREAM_RGB_FRONT); + __Pyx_GIVEREF(__pyx_n_s_VISION_STREAM_RGB_FRONT); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_VISION_STREAM_RGB_FRONT); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_1 = 0; + + /* "EnumType":56 + * ('VISION_STREAM_RGB_BACK', VISION_STREAM_RGB_BACK), + * ('VISION_STREAM_RGB_FRONT', VISION_STREAM_RGB_FRONT), + * ('VISION_STREAM_RGB_WIDE', VISION_STREAM_RGB_WIDE), # <<<<<<<<<<<<<< + * ('VISION_STREAM_ROAD', VISION_STREAM_ROAD), + * ('VISION_STREAM_DRIVER', VISION_STREAM_DRIVER), + */ + __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(__pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_RGB_WIDE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_VISION_STREAM_RGB_WIDE); + __Pyx_GIVEREF(__pyx_n_s_VISION_STREAM_RGB_WIDE); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_VISION_STREAM_RGB_WIDE); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __pyx_t_1 = 0; + + /* "EnumType":57 + * ('VISION_STREAM_RGB_FRONT', VISION_STREAM_RGB_FRONT), + * ('VISION_STREAM_RGB_WIDE', VISION_STREAM_RGB_WIDE), + * ('VISION_STREAM_ROAD', VISION_STREAM_ROAD), # <<<<<<<<<<<<<< + * ('VISION_STREAM_DRIVER', VISION_STREAM_DRIVER), + * ('VISION_STREAM_WIDE_ROAD', VISION_STREAM_WIDE_ROAD), + */ + __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(__pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_ROAD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_n_s_VISION_STREAM_ROAD); + __Pyx_GIVEREF(__pyx_n_s_VISION_STREAM_ROAD); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_VISION_STREAM_ROAD); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); + __pyx_t_1 = 0; + + /* "EnumType":58 + * ('VISION_STREAM_RGB_WIDE', VISION_STREAM_RGB_WIDE), + * ('VISION_STREAM_ROAD', VISION_STREAM_ROAD), + * ('VISION_STREAM_DRIVER', VISION_STREAM_DRIVER), # <<<<<<<<<<<<<< + * ('VISION_STREAM_WIDE_ROAD', VISION_STREAM_WIDE_ROAD), + * ])) + */ + __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(__pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_DRIVER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_n_s_VISION_STREAM_DRIVER); + __Pyx_GIVEREF(__pyx_n_s_VISION_STREAM_DRIVER); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_VISION_STREAM_DRIVER); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1); + __pyx_t_1 = 0; + + /* "EnumType":59 + * ('VISION_STREAM_ROAD', VISION_STREAM_ROAD), + * ('VISION_STREAM_DRIVER', VISION_STREAM_DRIVER), + * ('VISION_STREAM_WIDE_ROAD', VISION_STREAM_WIDE_ROAD), # <<<<<<<<<<<<<< + * ])) + * __Pyx_globals['VISION_STREAM_RGB_BACK'] = VisionStreamType.VISION_STREAM_RGB_BACK + */ + __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(__pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_WIDE_ROAD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_n_s_VISION_STREAM_WIDE_ROAD); + __Pyx_GIVEREF(__pyx_n_s_VISION_STREAM_WIDE_ROAD); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_VISION_STREAM_WIDE_ROAD); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1); + __pyx_t_1 = 0; + + /* "EnumType":53 + * if PY_VERSION_HEX >= 0x03040000: + * + * VisionStreamType = __Pyx_EnumBase('VisionStreamType', __Pyx_OrderedDict([ # <<<<<<<<<<<<<< + * ('VISION_STREAM_RGB_BACK', VISION_STREAM_RGB_BACK), + * ('VISION_STREAM_RGB_FRONT', VISION_STREAM_RGB_FRONT), + */ + __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_t_9); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_CallOneArg(__Pyx_OrderedDict, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_VisionStreamType); + __Pyx_GIVEREF(__pyx_n_s_VisionStreamType); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_VisionStreamType); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__Pyx_EnumBase, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_VisionStreamType, __pyx_t_9) < 0) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "EnumType":61 + * ('VISION_STREAM_WIDE_ROAD', VISION_STREAM_WIDE_ROAD), + * ])) + * __Pyx_globals['VISION_STREAM_RGB_BACK'] = VisionStreamType.VISION_STREAM_RGB_BACK # <<<<<<<<<<<<<< + * __Pyx_globals['VISION_STREAM_RGB_FRONT'] = VisionStreamType.VISION_STREAM_RGB_FRONT + * __Pyx_globals['VISION_STREAM_RGB_WIDE'] = VisionStreamType.VISION_STREAM_RGB_WIDE + */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_VisionStreamType); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_VISION_STREAM_RGB_BACK); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 61, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_VISION_STREAM_RGB_BACK, __pyx_t_1) < 0)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumType":62 + * ])) + * __Pyx_globals['VISION_STREAM_RGB_BACK'] = VisionStreamType.VISION_STREAM_RGB_BACK + * __Pyx_globals['VISION_STREAM_RGB_FRONT'] = VisionStreamType.VISION_STREAM_RGB_FRONT # <<<<<<<<<<<<<< + * __Pyx_globals['VISION_STREAM_RGB_WIDE'] = VisionStreamType.VISION_STREAM_RGB_WIDE + * __Pyx_globals['VISION_STREAM_ROAD'] = VisionStreamType.VISION_STREAM_ROAD + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_VisionStreamType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_VISION_STREAM_RGB_FRONT); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 62, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_VISION_STREAM_RGB_FRONT, __pyx_t_9) < 0)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "EnumType":63 + * __Pyx_globals['VISION_STREAM_RGB_BACK'] = VisionStreamType.VISION_STREAM_RGB_BACK + * __Pyx_globals['VISION_STREAM_RGB_FRONT'] = VisionStreamType.VISION_STREAM_RGB_FRONT + * __Pyx_globals['VISION_STREAM_RGB_WIDE'] = VisionStreamType.VISION_STREAM_RGB_WIDE # <<<<<<<<<<<<<< + * __Pyx_globals['VISION_STREAM_ROAD'] = VisionStreamType.VISION_STREAM_ROAD + * __Pyx_globals['VISION_STREAM_DRIVER'] = VisionStreamType.VISION_STREAM_DRIVER + */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_VisionStreamType); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_VISION_STREAM_RGB_WIDE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 63, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_VISION_STREAM_RGB_WIDE, __pyx_t_1) < 0)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumType":64 + * __Pyx_globals['VISION_STREAM_RGB_FRONT'] = VisionStreamType.VISION_STREAM_RGB_FRONT + * __Pyx_globals['VISION_STREAM_RGB_WIDE'] = VisionStreamType.VISION_STREAM_RGB_WIDE + * __Pyx_globals['VISION_STREAM_ROAD'] = VisionStreamType.VISION_STREAM_ROAD # <<<<<<<<<<<<<< + * __Pyx_globals['VISION_STREAM_DRIVER'] = VisionStreamType.VISION_STREAM_DRIVER + * __Pyx_globals['VISION_STREAM_WIDE_ROAD'] = VisionStreamType.VISION_STREAM_WIDE_ROAD + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_VisionStreamType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_VISION_STREAM_ROAD); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 64, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_VISION_STREAM_ROAD, __pyx_t_9) < 0)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "EnumType":65 + * __Pyx_globals['VISION_STREAM_RGB_WIDE'] = VisionStreamType.VISION_STREAM_RGB_WIDE + * __Pyx_globals['VISION_STREAM_ROAD'] = VisionStreamType.VISION_STREAM_ROAD + * __Pyx_globals['VISION_STREAM_DRIVER'] = VisionStreamType.VISION_STREAM_DRIVER # <<<<<<<<<<<<<< + * __Pyx_globals['VISION_STREAM_WIDE_ROAD'] = VisionStreamType.VISION_STREAM_WIDE_ROAD + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_VisionStreamType); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_VISION_STREAM_DRIVER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 65, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_VISION_STREAM_DRIVER, __pyx_t_1) < 0)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumType":66 + * __Pyx_globals['VISION_STREAM_ROAD'] = VisionStreamType.VISION_STREAM_ROAD + * __Pyx_globals['VISION_STREAM_DRIVER'] = VisionStreamType.VISION_STREAM_DRIVER + * __Pyx_globals['VISION_STREAM_WIDE_ROAD'] = VisionStreamType.VISION_STREAM_WIDE_ROAD # <<<<<<<<<<<<<< + * else: + * class VisionStreamType(__Pyx_EnumBase): + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_VisionStreamType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_VISION_STREAM_WIDE_ROAD); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 66, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_VISION_STREAM_WIDE_ROAD, __pyx_t_9) < 0)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "EnumType":51 + * + * cdef dict __Pyx_globals = globals() + * if PY_VERSION_HEX >= 0x03040000: # <<<<<<<<<<<<<< + * + * VisionStreamType = __Pyx_EnumBase('VisionStreamType', __Pyx_OrderedDict([ + */ + goto __pyx_L4; + } + + /* "EnumType":68 + * __Pyx_globals['VISION_STREAM_WIDE_ROAD'] = VisionStreamType.VISION_STREAM_WIDE_ROAD + * else: + * class VisionStreamType(__Pyx_EnumBase): # <<<<<<<<<<<<<< + * pass + * __Pyx_globals['VISION_STREAM_RGB_BACK'] = VisionStreamType(VISION_STREAM_RGB_BACK, 'VISION_STREAM_RGB_BACK') + */ + /*else*/ { + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__Pyx_EnumBase); + __Pyx_GIVEREF(__Pyx_EnumBase); + PyTuple_SET_ITEM(__pyx_t_9, 0, __Pyx_EnumBase); + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_9, __pyx_n_s_VisionStreamType, __pyx_n_s_VisionStreamType, (PyObject *) NULL, __pyx_n_s_EnumType, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_VisionStreamType, __pyx_t_9, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_VisionStreamType, __pyx_t_7) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "EnumType":70 + * class VisionStreamType(__Pyx_EnumBase): + * pass + * __Pyx_globals['VISION_STREAM_RGB_BACK'] = VisionStreamType(VISION_STREAM_RGB_BACK, 'VISION_STREAM_RGB_BACK') # <<<<<<<<<<<<<< + * __Pyx_globals['VISION_STREAM_RGB_FRONT'] = VisionStreamType(VISION_STREAM_RGB_FRONT, 'VISION_STREAM_RGB_FRONT') + * __Pyx_globals['VISION_STREAM_RGB_WIDE'] = VisionStreamType(VISION_STREAM_RGB_WIDE, 'VISION_STREAM_RGB_WIDE') + */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_VisionStreamType); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(__pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_RGB_BACK); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_n_s_VISION_STREAM_RGB_BACK); + __Pyx_GIVEREF(__pyx_n_s_VISION_STREAM_RGB_BACK); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_VISION_STREAM_RGB_BACK); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 70, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_VISION_STREAM_RGB_BACK, __pyx_t_1) < 0)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumType":71 + * pass + * __Pyx_globals['VISION_STREAM_RGB_BACK'] = VisionStreamType(VISION_STREAM_RGB_BACK, 'VISION_STREAM_RGB_BACK') + * __Pyx_globals['VISION_STREAM_RGB_FRONT'] = VisionStreamType(VISION_STREAM_RGB_FRONT, 'VISION_STREAM_RGB_FRONT') # <<<<<<<<<<<<<< + * __Pyx_globals['VISION_STREAM_RGB_WIDE'] = VisionStreamType(VISION_STREAM_RGB_WIDE, 'VISION_STREAM_RGB_WIDE') + * __Pyx_globals['VISION_STREAM_ROAD'] = VisionStreamType(VISION_STREAM_ROAD, 'VISION_STREAM_ROAD') + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_VisionStreamType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(__pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_RGB_FRONT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_INCREF(__pyx_n_s_VISION_STREAM_RGB_FRONT); + __Pyx_GIVEREF(__pyx_n_s_VISION_STREAM_RGB_FRONT); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_VISION_STREAM_RGB_FRONT); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 71, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_VISION_STREAM_RGB_FRONT, __pyx_t_8) < 0)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "EnumType":72 + * __Pyx_globals['VISION_STREAM_RGB_BACK'] = VisionStreamType(VISION_STREAM_RGB_BACK, 'VISION_STREAM_RGB_BACK') + * __Pyx_globals['VISION_STREAM_RGB_FRONT'] = VisionStreamType(VISION_STREAM_RGB_FRONT, 'VISION_STREAM_RGB_FRONT') + * __Pyx_globals['VISION_STREAM_RGB_WIDE'] = VisionStreamType(VISION_STREAM_RGB_WIDE, 'VISION_STREAM_RGB_WIDE') # <<<<<<<<<<<<<< + * __Pyx_globals['VISION_STREAM_ROAD'] = VisionStreamType(VISION_STREAM_ROAD, 'VISION_STREAM_ROAD') + * __Pyx_globals['VISION_STREAM_DRIVER'] = VisionStreamType(VISION_STREAM_DRIVER, 'VISION_STREAM_DRIVER') + */ + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_VisionStreamType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(__pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_RGB_WIDE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); + __Pyx_INCREF(__pyx_n_s_VISION_STREAM_RGB_WIDE); + __Pyx_GIVEREF(__pyx_n_s_VISION_STREAM_RGB_WIDE); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_VISION_STREAM_RGB_WIDE); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 72, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_VISION_STREAM_RGB_WIDE, __pyx_t_9) < 0)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "EnumType":73 + * __Pyx_globals['VISION_STREAM_RGB_FRONT'] = VisionStreamType(VISION_STREAM_RGB_FRONT, 'VISION_STREAM_RGB_FRONT') + * __Pyx_globals['VISION_STREAM_RGB_WIDE'] = VisionStreamType(VISION_STREAM_RGB_WIDE, 'VISION_STREAM_RGB_WIDE') + * __Pyx_globals['VISION_STREAM_ROAD'] = VisionStreamType(VISION_STREAM_ROAD, 'VISION_STREAM_ROAD') # <<<<<<<<<<<<<< + * __Pyx_globals['VISION_STREAM_DRIVER'] = VisionStreamType(VISION_STREAM_DRIVER, 'VISION_STREAM_DRIVER') + * __Pyx_globals['VISION_STREAM_WIDE_ROAD'] = VisionStreamType(VISION_STREAM_WIDE_ROAD, 'VISION_STREAM_WIDE_ROAD') + */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_VisionStreamType); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(__pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_ROAD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_n_s_VISION_STREAM_ROAD); + __Pyx_GIVEREF(__pyx_n_s_VISION_STREAM_ROAD); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_VISION_STREAM_ROAD); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 73, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_VISION_STREAM_ROAD, __pyx_t_1) < 0)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumType":74 + * __Pyx_globals['VISION_STREAM_RGB_WIDE'] = VisionStreamType(VISION_STREAM_RGB_WIDE, 'VISION_STREAM_RGB_WIDE') + * __Pyx_globals['VISION_STREAM_ROAD'] = VisionStreamType(VISION_STREAM_ROAD, 'VISION_STREAM_ROAD') + * __Pyx_globals['VISION_STREAM_DRIVER'] = VisionStreamType(VISION_STREAM_DRIVER, 'VISION_STREAM_DRIVER') # <<<<<<<<<<<<<< + * __Pyx_globals['VISION_STREAM_WIDE_ROAD'] = VisionStreamType(VISION_STREAM_WIDE_ROAD, 'VISION_STREAM_WIDE_ROAD') + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_VisionStreamType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(__pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_DRIVER); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_INCREF(__pyx_n_s_VISION_STREAM_DRIVER); + __Pyx_GIVEREF(__pyx_n_s_VISION_STREAM_DRIVER); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_VISION_STREAM_DRIVER); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 74, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_VISION_STREAM_DRIVER, __pyx_t_8) < 0)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "EnumType":75 + * __Pyx_globals['VISION_STREAM_ROAD'] = VisionStreamType(VISION_STREAM_ROAD, 'VISION_STREAM_ROAD') + * __Pyx_globals['VISION_STREAM_DRIVER'] = VisionStreamType(VISION_STREAM_DRIVER, 'VISION_STREAM_DRIVER') + * __Pyx_globals['VISION_STREAM_WIDE_ROAD'] = VisionStreamType(VISION_STREAM_WIDE_ROAD, 'VISION_STREAM_WIDE_ROAD') # <<<<<<<<<<<<<< + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_VisionStreamType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(__pyx_e_6cereal_9visionipc_13visionipc_pyx_VISION_STREAM_WIDE_ROAD); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); + __Pyx_INCREF(__pyx_n_s_VISION_STREAM_WIDE_ROAD); + __Pyx_GIVEREF(__pyx_n_s_VISION_STREAM_WIDE_ROAD); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_VISION_STREAM_WIDE_ROAD); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 75, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_VISION_STREAM_WIDE_ROAD, __pyx_t_9) < 0)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_L4:; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init cereal.visionipc.visionipc_pyx", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init cereal.visionipc.visionipc_pyx"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* BufferIndexError */ +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +/* MemviewSliceInit */ +static int +__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference) +{ + __Pyx_RefNannyDeclarations + int i, retval=-1; + Py_buffer *buf = &memview->view; + __Pyx_RefNannySetupContext("init_memviewslice", 0); + if (unlikely(memviewslice->memview || memviewslice->data)) { + PyErr_SetString(PyExc_ValueError, + "memviewslice is already initialized!"); + goto fail; + } + if (buf->strides) { + for (i = 0; i < ndim; i++) { + memviewslice->strides[i] = buf->strides[i]; + } + } else { + Py_ssize_t stride = buf->itemsize; + for (i = ndim - 1; i >= 0; i--) { + memviewslice->strides[i] = stride; + stride *= buf->shape[i]; + } + } + for (i = 0; i < ndim; i++) { + memviewslice->shape[i] = buf->shape[i]; + if (buf->suboffsets) { + memviewslice->suboffsets[i] = buf->suboffsets[i]; + } else { + memviewslice->suboffsets[i] = -1; + } + } + memviewslice->memview = memview; + memviewslice->data = (char *)buf->buf; + if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { + Py_INCREF(memview); + } + retval = 0; + goto no_fail; +fail: + memviewslice->memview = 0; + memviewslice->data = 0; + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} +#ifndef Py_NO_RETURN +#define Py_NO_RETURN +#endif +static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN { + va_list vargs; + char msg[200]; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + va_end(vargs); + Py_FatalError(msg); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (unlikely(!memview || (PyObject *) memview == Py_None)) + return; + if (unlikely(__pyx_get_slice_count(memview) < 0)) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (unlikely(first_time)) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (unlikely(!memview || (PyObject *) memview == Py_None)) { + memslice->memview = NULL; + return; + } + if (unlikely(__pyx_get_slice_count(memview) <= 0)) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (unlikely(last_time)) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (__Pyx_PyFastCFunction_Check(func)) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* HasAttr */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* None */ +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +/* decode_c_string */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + size_t slen = strlen(cstring); + if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, + "c-string too long to convert to Python"); + return NULL; + } + length = (Py_ssize_t) slen; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + if (unlikely(stop <= start)) + return __Pyx_NewRef(__pyx_empty_unicode); + length = stop - start; + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* RaiseNoneIterError */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* None */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* None */ +static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* SetupReduce */ +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#else + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#endif +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); + if (likely(reduce_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (reduce == object_reduce || PyErr_Occurred()) { + goto __PYX_BAD; + } + setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); + if (likely(setstate_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (!setstate || PyErr_Occurred()) { + goto __PYX_BAD; + } + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto __PYX_GOOD; +__PYX_BAD: + if (!PyErr_Occurred()) + PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +__PYX_GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* CalculateMetaclass */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunctionShared */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + Py_INCREF(m->func_qualname); + return m->func_qualname; +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + if (unlikely(op == NULL)) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults_size = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ +#if PY_MAJOR_VERSION < 3 + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; +#endif + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + m->defaults_size = size; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + +/* Py3ClassCreate */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if ((0)) {} + view->obj = NULL; + Py_DECREF(obj); +} +#endif + + +/* MemviewSliceIsContig */ +static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs.memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) + return 0; + itemsize *= mvs.shape[index]; + } + return 1; +} + +/* OverlappingSlices */ +static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +/* Capsule */ +static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* IsLittleEndian */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + +/* BufferFormatCheck */ +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t <= '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case '?': return "'bool'"; + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case '?': case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number, ndim; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ndim = ctx->head->field->type->ndim; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + CYTHON_FALLTHROUGH; + case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) && + (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + CYTHON_FALLTHROUGH; + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} + +/* TypeInfoCompare */ + static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + if (!a || !b) + return 0; + if (a == b) + return 1; + if (a->size != b->size || a->typegroup != b->typegroup || + a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { + if (a->typegroup == 'H' || b->typegroup == 'H') { + return a->size == b->size; + } else { + return 0; + } + } + if (a->ndim) { + for (i = 0; i < a->ndim; i++) + if (a->arraysize[i] != b->arraysize[i]) + return 0; + } + if (a->typegroup == 'S') { + if (a->flags != b->flags) + return 0; + if (a->fields || b->fields) { + if (!(a->fields && b->fields)) + return 0; + for (i = 0; a->fields[i].type && b->fields[i].type; i++) { + __Pyx_StructField *field_a = a->fields + i; + __Pyx_StructField *field_b = b->fields + i; + if (field_a->offset != field_b->offset || + !__pyx_typeinfo_cmp(field_a->type, field_b->type)) + return 0; + } + return !a->fields[i].type && !b->fields[i].type; + } + } + return 1; +} + +/* MemviewSliceValidateAndInit */ + static int +__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) +{ + if (buf->shape[dim] <= 1) + return 1; + if (buf->strides) { + if (spec & __Pyx_MEMVIEW_CONTIG) { + if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { + if (unlikely(buf->strides[dim] != sizeof(void *))) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly contiguous " + "in dimension %d.", dim); + goto fail; + } + } else if (unlikely(buf->strides[dim] != buf->itemsize)) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_FOLLOW) { + Py_ssize_t stride = buf->strides[dim]; + if (stride < 0) + stride = -stride; + if (unlikely(stride < buf->itemsize)) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + } else { + if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not contiguous in " + "dimension %d", dim); + goto fail; + } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not indirect in " + "dimension %d", dim); + goto fail; + } else if (unlikely(buf->suboffsets)) { + PyErr_SetString(PyExc_ValueError, + "Buffer exposes suboffsets but no strides"); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec) +{ + if (spec & __Pyx_MEMVIEW_DIRECT) { + if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) { + PyErr_Format(PyExc_ValueError, + "Buffer not compatible with direct access " + "in dimension %d.", dim); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_PTR) { + if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly accessible " + "in dimension %d.", dim); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) +{ + int i; + if (c_or_f_flag & __Pyx_IS_F_CONTIG) { + Py_ssize_t stride = 1; + for (i = 0; i < ndim; i++) { + if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) { + PyErr_SetString(PyExc_ValueError, + "Buffer not fortran contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { + Py_ssize_t stride = 1; + for (i = ndim - 1; i >- 1; i--) { + if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) { + PyErr_SetString(PyExc_ValueError, + "Buffer not C contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } + return 1; +fail: + return 0; +} +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj) +{ + struct __pyx_memoryview_obj *memview, *new_memview; + __Pyx_RefNannyDeclarations + Py_buffer *buf; + int i, spec = 0, retval = -1; + __Pyx_BufFmt_Context ctx; + int from_memoryview = __pyx_memoryview_check(original_obj); + __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); + if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) + original_obj)->typeinfo)) { + memview = (struct __pyx_memoryview_obj *) original_obj; + new_memview = NULL; + } else { + memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + original_obj, buf_flags, 0, dtype); + new_memview = memview; + if (unlikely(!memview)) + goto fail; + } + buf = &memview->view; + if (unlikely(buf->ndim != ndim)) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + ndim, buf->ndim); + goto fail; + } + if (new_memview) { + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail; + } + if (unlikely((unsigned) buf->itemsize != dtype->size)) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " + "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", + buf->itemsize, + (buf->itemsize > 1) ? "s" : "", + dtype->name, + dtype->size, + (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->len > 0) { + for (i = 0; i < ndim; i++) { + spec = axes_specs[i]; + if (unlikely(!__pyx_check_strides(buf, i, ndim, spec))) + goto fail; + if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec))) + goto fail; + } + if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))) + goto fail; + } + if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, + new_memview != NULL) == -1)) { + goto fail; + } + retval = 0; + goto no_fail; +fail: + Py_XDECREF(new_memview); + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_char(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS_RO | writable_flag, 1, + &__Pyx_TypeInfo_char, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = (float)(1.0) / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + float r = b.real / b.imag; + float s = (float)(1.0) / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_float(a, a); + case 3: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); + case 4: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_float(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = (double)(1.0) / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = (double)(1.0) / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_double(a, a); + case 3: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); + case 4: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_double(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +/* MemviewSliceCopyTemplate */ + static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object) +{ + __Pyx_RefNannyDeclarations + int i; + __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_memoryview_obj *from_memview = from_mvs->memview; + Py_buffer *buf = &from_memview->view; + PyObject *shape_tuple = NULL; + PyObject *temp_int = NULL; + struct __pyx_array_obj *array_obj = NULL; + struct __pyx_memoryview_obj *memview_obj = NULL; + __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); + for (i = 0; i < ndim; i++) { + if (unlikely(from_mvs->suboffsets[i] >= 0)) { + PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " + "indirect dimensions (axis %d)", i); + goto fail; + } + } + shape_tuple = PyTuple_New(ndim); + if (unlikely(!shape_tuple)) { + goto fail; + } + __Pyx_GOTREF(shape_tuple); + for(i = 0; i < ndim; i++) { + temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); + if(unlikely(!temp_int)) { + goto fail; + } else { + PyTuple_SET_ITEM(shape_tuple, i, temp_int); + temp_int = NULL; + } + } + array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); + if (unlikely(!array_obj)) { + goto fail; + } + __Pyx_GOTREF(array_obj); + memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + (PyObject *) array_obj, contig_flag, + dtype_is_object, + from_mvs->memview->typeinfo); + if (unlikely(!memview_obj)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) + goto fail; + if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, + dtype_is_object) < 0)) + goto fail; + goto no_fail; +fail: + __Pyx_XDECREF(new_mvs.memview); + new_mvs.memview = NULL; + new_mvs.data = NULL; +no_fail: + __Pyx_XDECREF(shape_tuple); + __Pyx_XDECREF(temp_int); + __Pyx_XDECREF(array_obj); + __Pyx_RefNannyFinishContext(); + return new_mvs; +} + +/* CIntFromPy */ + static CYTHON_INLINE enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType __Pyx_PyInt_As_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType neg_one = (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) -1, const_zero = (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) 0; + case 1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, digit, digits[0]) + case 2: + if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) >= 2 * PyLong_SHIFT) { + return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) (((((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) >= 3 * PyLong_SHIFT) { + return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) (((((((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) >= 4 * PyLong_SHIFT) { + return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) (((((((((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) 0; + case -1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, digit, +digits[0]) + case -2: + if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) - 1 > 2 * PyLong_SHIFT) { + return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) (((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)-1)*(((((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) - 1 > 2 * PyLong_SHIFT) { + return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) ((((((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) - 1 > 3 * PyLong_SHIFT) { + return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) (((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)-1)*(((((((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) - 1 > 3 * PyLong_SHIFT) { + return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) ((((((((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) - 1 > 4 * PyLong_SHIFT) { + return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) (((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)-1)*(((((((((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) - 1 > 4 * PyLong_SHIFT) { + return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) ((((((((((enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType)digits[0]))); + } + } + break; + } +#endif + if (sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) -1; + } + } else { + enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) -1; + val = __Pyx_PyInt_As_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType"); + return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType"); + return (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { + return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { + return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { + return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) + case -2: + if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(uint32_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (uint32_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (uint32_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) + case 2: + if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { + return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { + return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { + return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (uint32_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(uint32_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (uint32_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) + case -2: + if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { + return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { + return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { + return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { + return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { + return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { + return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(uint32_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + uint32_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (uint32_t) -1; + } + } else { + uint32_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (uint32_t) -1; + val = __Pyx_PyInt_As_uint32_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to uint32_t"); + return (uint32_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to uint32_t"); + return (uint32_t) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(uint64_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (uint64_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (uint64_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, digits[0]) + case 2: + if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT) { + return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT) { + return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint64_t) >= 4 * PyLong_SHIFT) { + return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (uint64_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(uint64_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (uint64_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(uint64_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, +digits[0]) + case -2: + if (8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) { + return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) { + return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) { + return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) { + return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT) { + return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT) { + return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(uint64_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + uint64_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (uint64_t) -1; + } + } else { + uint64_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (uint64_t) -1; + val = __Pyx_PyInt_As_uint64_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to uint64_t"); + return (uint64_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to uint64_t"); + return (uint64_t) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPy */ + static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const char neg_one = (char) -1, const_zero = (char) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (char) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) { + return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) { + return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) { + return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (char) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0]) + case -2: + if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + } +#endif + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + char val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (char) -1; + } + } else { + char val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to char"); + return (char) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType neg_one = (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) -1, const_zero = (enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_6cereal_9visionipc_13visionipc_pyx_VisionStreamType), + little, !is_unsigned); + } +} + +/* CheckBinaryVersion */ + static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/cereal/visionipc/visionipc_pyx.pyx b/cereal/visionipc/visionipc_pyx.pyx new file mode 100644 index 000000000..3168f1e66 --- /dev/null +++ b/cereal/visionipc/visionipc_pyx.pyx @@ -0,0 +1,93 @@ +# distutils: language = c++ +# cython: c_string_encoding=ascii, language_level=3 + +import sys +import numpy as np +cimport numpy as cnp +from cython.view cimport array +from libc.string cimport memcpy +from libc.stdint cimport uint32_t, uint64_t +from libcpp cimport bool +from libcpp.string cimport string + +from .visionipc cimport VisionIpcServer as cppVisionIpcServer +from .visionipc cimport VisionIpcClient as cppVisionIpcClient +from .visionipc cimport VisionBuf as cppVisionBuf +from .visionipc cimport VisionIpcBufExtra + +cpdef enum VisionStreamType: + VISION_STREAM_RGB_BACK + VISION_STREAM_RGB_FRONT + VISION_STREAM_RGB_WIDE + VISION_STREAM_ROAD + VISION_STREAM_DRIVER + VISION_STREAM_WIDE_ROAD + + +cdef class VisionIpcServer: + cdef cppVisionIpcServer * server + + def __init__(self, string name): + self.server = new cppVisionIpcServer(name, NULL, NULL) + + def create_buffers(self, VisionStreamType tp, size_t num_buffers, bool rgb, size_t width, size_t height): + self.server.create_buffers(tp, num_buffers, rgb, width, height) + + def send(self, VisionStreamType tp, bytes data, uint32_t frame_id=0, uint64_t timestamp_sof=0, uint64_t timestamp_eof=0): + cdef cppVisionBuf * buf = self.server.get_buffer(tp) + + # Populate buffer + assert buf.len == len(data) + memcpy(buf.addr, data, len(data)) + + cdef VisionIpcBufExtra extra + extra.frame_id = frame_id + extra.timestamp_sof = timestamp_sof + extra.timestamp_eof = timestamp_eof + + self.server.send(buf, &extra, False) + + def start_listener(self): + self.server.start_listener() + + def __dealloc__(self): + del self.server + + +cdef class VisionIpcClient: + cdef cppVisionBuf * buf + cdef cppVisionIpcClient * client + + def __cinit__(self, string name, VisionStreamType stream, bool conflate): + self.client = new cppVisionIpcClient(name, stream, conflate, NULL, NULL) + self.buf = NULL + + def __dealloc__(self): + del self.client + + @property + def width(self): + return None if not self.buf else self.buf.width + + @property + def height(self): + return None if not self.buf else self.buf.height + + @property + def stride(self): + return None if not self.buf else self.buf.stride + + def recv(self, int timeout_ms=100): + self.buf = self.client.recv(NULL, timeout_ms) + if not self.buf: + return None + cdef cnp.ndarray dat = np.empty(self.buf.len, dtype=np.uint8) + cdef char[:] dat_view = dat + memcpy(&dat_view[0], self.buf.addr, self.buf.len) + return dat + + def connect(self, bool blocking): + return self.client.connect(blocking) + + def is_connected(self): + return self.client.is_connected() diff --git a/cereal/visionipc/visionipc_pyx.so b/cereal/visionipc/visionipc_pyx.so new file mode 100755 index 000000000..3f08bfc89 Binary files /dev/null and b/cereal/visionipc/visionipc_pyx.so differ diff --git a/cereal/visionipc/visionipc_server.cc b/cereal/visionipc/visionipc_server.cc new file mode 100644 index 000000000..e15c1aee4 --- /dev/null +++ b/cereal/visionipc/visionipc_server.cc @@ -0,0 +1,184 @@ +#include +#include +#include +#include + +#include +#include +#include + +#include "messaging/messaging.h" +#include "visionipc/ipc.h" +#include "visionipc/visionipc_server.h" +#include "logger/logger.h" + +std::string get_endpoint_name(std::string name, VisionStreamType type){ + if (messaging_use_zmq()){ + assert(name == "camerad"); + return std::to_string(9000 + static_cast(type)); + } else { + return "visionipc_" + name + "_" + std::to_string(type); + } +} + +VisionIpcServer::VisionIpcServer(std::string name, cl_device_id device_id, cl_context ctx) : name(name), device_id(device_id), ctx(ctx) { + msg_ctx = Context::create(); + + std::random_device rd("/dev/urandom"); + std::uniform_int_distribution distribution(0,std::numeric_limits::max()); + server_id = distribution(rd); +} + +void VisionIpcServer::create_buffers(VisionStreamType type, size_t num_buffers, bool rgb, size_t width, size_t height){ + // TODO: assert that this type is not created yet + assert(num_buffers < VISIONIPC_MAX_FDS); + int aligned_w = 0, aligned_h = 0; + + size_t size = 0; + size_t stride = 0; // Only used for RGB + + if (rgb) { + visionbuf_compute_aligned_width_and_height(width, height, &aligned_w, &aligned_h); + size = (size_t)aligned_w * (size_t)aligned_h * 3; + stride = aligned_w * 3; + } else { + size = width * height * 3 / 2; + } + + // Create map + alloc requested buffers + for (size_t i = 0; i < num_buffers; i++){ + VisionBuf* buf = new VisionBuf(); + buf->allocate(size); + buf->idx = i; + buf->type = type; + + if (device_id) buf->init_cl(device_id, ctx); + + rgb ? buf->init_rgb(width, height, stride) : buf->init_yuv(width, height); + + buffers[type].push_back(buf); + } + + cur_idx[type] = 0; + + // Create msgq publisher for each of the `name` + type combos + // TODO: compute port number directly if using zmq + sockets[type] = PubSocket::create(msg_ctx, get_endpoint_name(name, type), false); +} + + +void VisionIpcServer::start_listener(){ + listener_thread = std::thread(&VisionIpcServer::listener, this); +} + + +void VisionIpcServer::listener(){ + std::cout << "Starting listener for: " << name << std::endl; + + std::string path = "/tmp/visionipc_" + name; + int sock = ipc_bind(path.c_str()); + assert(sock >= 0); + + while (!should_exit){ + // Wait for incoming connection + struct pollfd polls[1] = {{0}}; + polls[0].fd = sock; + polls[0].events = POLLIN; + + int ret = poll(polls, 1, 100); + if (ret < 0) { + if (errno == EINTR || errno == EAGAIN) continue; + std::cout << "poll failed, stopping listener" << std::endl; + break; + } + + if (should_exit) break; + if (!polls[0].revents) { + continue; + } + + // Handle incoming request + int fd = accept(sock, NULL, NULL); + assert(fd >= 0); + + VisionStreamType type = VisionStreamType::VISION_STREAM_MAX; + int r = ipc_sendrecv_with_fds(false, fd, &type, sizeof(type), nullptr, 0, nullptr); + assert(r == sizeof(type)); + if (buffers.count(type) <= 0) { + std::cout << "got request for invalid buffer type: " << type << std::endl; + close(fd); + continue; + } + + int fds[VISIONIPC_MAX_FDS]; + int num_fds = buffers[type].size(); + VisionBuf bufs[VISIONIPC_MAX_FDS]; + + for (int i = 0; i < num_fds; i++){ + fds[i] = buffers[type][i]->fd; + bufs[i] = *buffers[type][i]; + + // Remove some private openCL/ion metadata + bufs[i].buf_cl = 0; + bufs[i].copy_q = 0; + bufs[i].handle = 0; + + bufs[i].server_id = server_id; + } + + r = ipc_sendrecv_with_fds(true, fd, &bufs, sizeof(VisionBuf) * num_fds, fds, num_fds, nullptr); + + close(fd); + } + + std::cout << "Stopping listener for: " << name << std::endl; + close(sock); +} + + + +VisionBuf * VisionIpcServer::get_buffer(VisionStreamType type){ + // Do we want to keep track if the buffer has been sent out yet and warn user? + assert(buffers.count(type)); + auto b = buffers[type]; + return b[cur_idx[type]++ % b.size()]; +} + +void VisionIpcServer::send(VisionBuf * buf, VisionIpcBufExtra * extra, bool sync){ + if (sync) { + if (buf->sync(VISIONBUF_SYNC_FROM_DEVICE) != 0) { + LOGE("Failed to sync buffer"); + } + } + assert(buffers.count(buf->type)); + assert(buf->idx < buffers[buf->type].size()); + + // Send over correct msgq socket + VisionIpcPacket packet = {0}; + packet.server_id = server_id; + packet.idx = buf->idx; + packet.extra = *extra; + + sockets[buf->type]->send((char*)&packet, sizeof(packet)); +} + +VisionIpcServer::~VisionIpcServer(){ + should_exit = true; + listener_thread.join(); + + // VisionBuf cleanup + for( auto const& [type, buf] : buffers ) { + for (VisionBuf* b : buf){ + if (b->free() != 0) { + LOGE("Failed to free buffer"); + } + delete b; + } + } + + // Messaging cleanup + for( auto const& [type, sock] : sockets ) { + delete sock; + } + delete msg_ctx; +} diff --git a/cereal/visionipc/visionipc_server.h b/cereal/visionipc/visionipc_server.h new file mode 100644 index 000000000..01409f78d --- /dev/null +++ b/cereal/visionipc/visionipc_server.h @@ -0,0 +1,42 @@ +#pragma once +#include +#include +#include +#include +#include + +#include "messaging/messaging.h" +#include "visionipc/visionipc.h" +#include "visionipc/visionbuf.h" + +std::string get_endpoint_name(std::string name, VisionStreamType type); + +class VisionIpcServer { + private: + cl_device_id device_id = nullptr; + cl_context ctx = nullptr; + uint64_t server_id; + + std::atomic should_exit = false; + std::string name; + std::thread listener_thread; + + std::map > cur_idx; + std::map > buffers; + std::map > idxs; + + Context * msg_ctx; + std::map sockets; + + void listener(void); + + public: + VisionIpcServer(std::string name, cl_device_id device_id=nullptr, cl_context ctx=nullptr); + ~VisionIpcServer(); + + VisionBuf * get_buffer(VisionStreamType type); + + void create_buffers(VisionStreamType type, size_t num_buffers, bool rgb, size_t width, size_t height); + void send(VisionBuf * buf, VisionIpcBufExtra * extra, bool sync=true); + void start_listener(); +}; diff --git a/cereal/visionipc/visionipc_tests.cc b/cereal/visionipc/visionipc_tests.cc new file mode 100644 index 000000000..4d1df05f5 --- /dev/null +++ b/cereal/visionipc/visionipc_tests.cc @@ -0,0 +1,137 @@ +#include +#include + +#include "catch2/catch.hpp" +#include "visionipc_server.h" +#include "visionipc_client.h" + +static void zmq_sleep(int milliseconds=1000){ + if (messaging_use_zmq()){ + std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds)); + } +} + +TEST_CASE("Connecting"){ + VisionIpcServer server("camerad"); + server.create_buffers(VISION_STREAM_ROAD, 1, false, 100, 100); + server.start_listener(); + + VisionIpcClient client = VisionIpcClient("camerad", VISION_STREAM_ROAD, false); + REQUIRE(client.connect()); + + REQUIRE(client.connected); +} + +TEST_CASE("Check buffers"){ + size_t width = 100, height = 200, num_buffers = 5; + VisionIpcServer server("camerad"); + server.create_buffers(VISION_STREAM_ROAD, num_buffers, false, width, height); + server.start_listener(); + + VisionIpcClient client = VisionIpcClient("camerad", VISION_STREAM_ROAD, false); + REQUIRE(client.connect()); + + REQUIRE(client.buffers[0].width == width); + REQUIRE(client.buffers[0].height == height); + REQUIRE(client.buffers[0].len); + REQUIRE(client.num_buffers == num_buffers); +} + +TEST_CASE("Check yuv/rgb"){ + VisionIpcServer server("camerad"); + server.create_buffers(VISION_STREAM_ROAD, 1, false, 100, 100); + server.create_buffers(VISION_STREAM_RGB_BACK, 1, true, 100, 100); + server.start_listener(); + + VisionIpcClient client_yuv = VisionIpcClient("camerad", VISION_STREAM_ROAD, false); + VisionIpcClient client_rgb = VisionIpcClient("camerad", VISION_STREAM_RGB_BACK, false); + client_yuv.connect(); + client_rgb.connect(); + + REQUIRE(client_rgb.buffers[0].rgb == true); + REQUIRE(client_yuv.buffers[0].rgb == false); +} + +TEST_CASE("Send single buffer"){ + VisionIpcServer server("camerad"); + server.create_buffers(VISION_STREAM_ROAD, 1, true, 100, 100); + server.start_listener(); + + VisionIpcClient client = VisionIpcClient("camerad", VISION_STREAM_ROAD, false); + REQUIRE(client.connect()); + zmq_sleep(); + + VisionBuf * buf = server.get_buffer(VISION_STREAM_ROAD); + REQUIRE(buf != nullptr); + + *((uint64_t*)buf->addr) = 1234; + + VisionIpcBufExtra extra = {0}; + extra.frame_id = 1337; + buf->set_frame_id(extra.frame_id); + + server.send(buf, &extra); + + VisionIpcBufExtra extra_recv = {0}; + VisionBuf * recv_buf = client.recv(&extra_recv); + REQUIRE(recv_buf != nullptr); + REQUIRE(*(uint64_t*)recv_buf->addr == 1234); + REQUIRE(extra_recv.frame_id == extra.frame_id); + REQUIRE(recv_buf->get_frame_id() == extra.frame_id); +} + + +TEST_CASE("Test no conflate"){ + VisionIpcServer server("camerad"); + server.create_buffers(VISION_STREAM_ROAD, 1, true, 100, 100); + server.start_listener(); + + VisionIpcClient client = VisionIpcClient("camerad", VISION_STREAM_ROAD, false); + REQUIRE(client.connect()); + zmq_sleep(); + + VisionBuf * buf = server.get_buffer(VISION_STREAM_ROAD); + REQUIRE(buf != nullptr); + + VisionIpcBufExtra extra = {0}; + extra.frame_id = 1; + server.send(buf, &extra); + extra.frame_id = 2; + server.send(buf, &extra); + + VisionIpcBufExtra extra_recv = {0}; + VisionBuf * recv_buf = client.recv(&extra_recv); + REQUIRE(recv_buf != nullptr); + REQUIRE(extra_recv.frame_id == 1); + + recv_buf = client.recv(&extra_recv); + REQUIRE(recv_buf != nullptr); + REQUIRE(extra_recv.frame_id == 2); +} + +TEST_CASE("Test conflate"){ + VisionIpcServer server("camerad"); + server.create_buffers(VISION_STREAM_ROAD, 1, true, 100, 100); + server.start_listener(); + + VisionIpcClient client = VisionIpcClient("camerad", VISION_STREAM_ROAD, true); + REQUIRE(client.connect()); + zmq_sleep(); + + VisionBuf * buf = server.get_buffer(VISION_STREAM_ROAD); + REQUIRE(buf != nullptr); + + VisionIpcBufExtra extra = {0}; + extra.frame_id = 1; + server.send(buf, &extra); + extra.frame_id = 2; + server.send(buf, &extra); + + VisionIpcBufExtra extra_recv = {0}; + VisionBuf * recv_buf = client.recv(&extra_recv); + REQUIRE(recv_buf != nullptr); + REQUIRE(extra_recv.frame_id == 2); + + recv_buf = client.recv(&extra_recv); + REQUIRE(recv_buf == nullptr); +} diff --git a/common/.gitignore b/common/.gitignore new file mode 100644 index 000000000..ce1da4c53 --- /dev/null +++ b/common/.gitignore @@ -0,0 +1 @@ +*.cpp diff --git a/common/SConscript b/common/SConscript new file mode 100644 index 000000000..a41fc8b7e --- /dev/null +++ b/common/SConscript @@ -0,0 +1,4 @@ +Import('envCython', 'common') + +envCython.Program('clock.so', 'clock.pyx') +envCython.Program('params_pyx.so', 'params_pyx.pyx', LIBS=envCython['LIBS'] + [common, 'zmq']) diff --git a/common/__init__.py b/common/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/common/api/__init__.py b/common/api/__init__.py new file mode 100644 index 000000000..8b83dfc64 --- /dev/null +++ b/common/api/__init__.py @@ -0,0 +1,46 @@ +import jwt +import os +import requests +from datetime import datetime, timedelta +from common.basedir import PERSIST +from selfdrive.version import get_version + +API_HOST = os.getenv('API_HOST', 'https://api.commadotai.com') + +class Api(): + def __init__(self, dongle_id): + self.dongle_id = dongle_id + with open(PERSIST+'/comma/id_rsa') as f: + self.private_key = f.read() + + def get(self, *args, **kwargs): + return self.request('GET', *args, **kwargs) + + def post(self, *args, **kwargs): + return self.request('POST', *args, **kwargs) + + def request(self, method, endpoint, timeout=None, access_token=None, **params): + return api_get(endpoint, method=method, timeout=timeout, access_token=access_token, **params) + + def get_token(self): + now = datetime.utcnow() + payload = { + 'identity': self.dongle_id, + 'nbf': now, + 'iat': now, + 'exp': now + timedelta(hours=1) + } + token = jwt.encode(payload, self.private_key, algorithm='RS256') + if isinstance(token, bytes): + token = token.decode('utf8') + return token + + +def api_get(endpoint, method='GET', timeout=None, access_token=None, **params): + headers = {} + if access_token is not None: + headers['Authorization'] = "JWT " + access_token + + headers['User-Agent'] = "openpilot-" + get_version() + + return requests.request(method, API_HOST + "/" + endpoint, timeout=timeout, headers=headers, params=params) diff --git a/common/basedir.py b/common/basedir.py new file mode 100644 index 000000000..8be1cf6af --- /dev/null +++ b/common/basedir.py @@ -0,0 +1,11 @@ +import os +from pathlib import Path + +from selfdrive.hardware import PC + +BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../")) + +if PC: + PERSIST = os.path.join(str(Path.home()), ".comma", "persist") +else: + PERSIST = "/persist" diff --git a/common/clock.cpp b/common/clock.cpp new file mode 100644 index 000000000..c2a5b2412 --- /dev/null +++ b/common/clock.cpp @@ -0,0 +1,2889 @@ +/* Generated by Cython 0.29.26 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [], + "language": "c++", + "name": "common.clock", + "sources": [ + "/data/openpilot/common/clock.pyx" + ] + }, + "module_name": "common.clock" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_26" +#define CYTHON_HEX_VERSION 0x001D1AF0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } + private: + T *ptr; +}; + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject* co=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(0))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too; + if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here + if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too; + Py_XDECREF((PyObject*)co); + co = (PyCodeObject*)call_result; + call_result = NULL; + if (0) { + cleanup_code_too: + Py_XDECREF((PyObject*)co); + co = NULL; + } + end: + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(call_result); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return co; + } +#else + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if defined(PyUnicode_IS_READY) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #else + #define __Pyx_PyUnicode_READY(op) (0) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__common__clock +#define __PYX_HAVE_API__common__clock +/* Early includes */ +#include +#include +#include +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "common/clock.pyx", +}; + +/*--- Type declarations ---*/ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* GCCDiagnostics.proto */ +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + + +/* Module declarations from 'posix.types' */ + +/* Module declarations from 'posix.signal' */ + +/* Module declarations from 'posix.time' */ + +/* Module declarations from 'common.clock' */ +static double __pyx_f_6common_5clock_readclock(clockid_t); /*proto*/ +#define __Pyx_MODULE_NAME "common.clock" +extern int __pyx_module_is_main_common__clock; +int __pyx_module_is_main_common__clock = 0; + +/* Implementation of 'common.clock' */ +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_common_clock[] = "common.clock"; +static const char __pyx_k_monotonic_time[] = "monotonic_time"; +static const char __pyx_k_sec_since_boot[] = "sec_since_boot"; +static const char __pyx_k_common_clock_pyx[] = "common/clock.pyx"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_common_clock; +static PyObject *__pyx_kp_s_common_clock_pyx; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_monotonic_time; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_sec_since_boot; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_pf_6common_5clock_monotonic_time(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6common_5clock_2sec_since_boot(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_codeobj_; +static PyObject *__pyx_codeobj__2; +/* Late includes */ + +/* "common/clock.pyx":11 + * from posix.time cimport CLOCK_BOOTTIME + * + * cdef double readclock(clockid_t clock_id): # <<<<<<<<<<<<<< + * cdef timespec ts + * cdef double current + */ + +static double __pyx_f_6common_5clock_readclock(clockid_t __pyx_v_clock_id) { + struct timespec __pyx_v_ts; + double __pyx_v_current; + double __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("readclock", 0); + + /* "common/clock.pyx":15 + * cdef double current + * + * clock_gettime(clock_id, &ts) # <<<<<<<<<<<<<< + * current = ts.tv_sec + (ts.tv_nsec / 1000000000.) + * return current + */ + (void)(clock_gettime(__pyx_v_clock_id, (&__pyx_v_ts))); + + /* "common/clock.pyx":16 + * + * clock_gettime(clock_id, &ts) + * current = ts.tv_sec + (ts.tv_nsec / 1000000000.) # <<<<<<<<<<<<<< + * return current + * + */ + __pyx_v_current = (__pyx_v_ts.tv_sec + (((double)__pyx_v_ts.tv_nsec) / 1000000000.)); + + /* "common/clock.pyx":17 + * clock_gettime(clock_id, &ts) + * current = ts.tv_sec + (ts.tv_nsec / 1000000000.) + * return current # <<<<<<<<<<<<<< + * + * def monotonic_time(): + */ + __pyx_r = __pyx_v_current; + goto __pyx_L0; + + /* "common/clock.pyx":11 + * from posix.time cimport CLOCK_BOOTTIME + * + * cdef double readclock(clockid_t clock_id): # <<<<<<<<<<<<<< + * cdef timespec ts + * cdef double current + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/clock.pyx":19 + * return current + * + * def monotonic_time(): # <<<<<<<<<<<<<< + * return readclock(CLOCK_MONOTONIC_RAW) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_5clock_1monotonic_time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6common_5clock_1monotonic_time = {"monotonic_time", (PyCFunction)__pyx_pw_6common_5clock_1monotonic_time, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6common_5clock_1monotonic_time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("monotonic_time (wrapper)", 0); + __pyx_r = __pyx_pf_6common_5clock_monotonic_time(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_5clock_monotonic_time(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("monotonic_time", 0); + + /* "common/clock.pyx":20 + * + * def monotonic_time(): + * return readclock(CLOCK_MONOTONIC_RAW) # <<<<<<<<<<<<<< + * + * def sec_since_boot(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_f_6common_5clock_readclock(CLOCK_MONOTONIC_RAW)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "common/clock.pyx":19 + * return current + * + * def monotonic_time(): # <<<<<<<<<<<<<< + * return readclock(CLOCK_MONOTONIC_RAW) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.clock.monotonic_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/clock.pyx":22 + * return readclock(CLOCK_MONOTONIC_RAW) + * + * def sec_since_boot(): # <<<<<<<<<<<<<< + * return readclock(CLOCK_BOOTTIME) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_5clock_3sec_since_boot(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6common_5clock_3sec_since_boot = {"sec_since_boot", (PyCFunction)__pyx_pw_6common_5clock_3sec_since_boot, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6common_5clock_3sec_since_boot(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sec_since_boot (wrapper)", 0); + __pyx_r = __pyx_pf_6common_5clock_2sec_since_boot(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_5clock_2sec_since_boot(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sec_since_boot", 0); + + /* "common/clock.pyx":23 + * + * def sec_since_boot(): + * return readclock(CLOCK_BOOTTIME) # <<<<<<<<<<<<<< + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_f_6common_5clock_readclock(CLOCK_BOOTTIME)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "common/clock.pyx":22 + * return readclock(CLOCK_MONOTONIC_RAW) + * + * def sec_since_boot(): # <<<<<<<<<<<<<< + * return readclock(CLOCK_BOOTTIME) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.clock.sec_since_boot", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_clock(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_clock}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "clock", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_common_clock, __pyx_k_common_clock, sizeof(__pyx_k_common_clock), 0, 0, 1, 1}, + {&__pyx_kp_s_common_clock_pyx, __pyx_k_common_clock_pyx, sizeof(__pyx_k_common_clock_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_monotonic_time, __pyx_k_monotonic_time, sizeof(__pyx_k_monotonic_time), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_sec_since_boot, __pyx_k_sec_since_boot, sizeof(__pyx_k_sec_since_boot), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + return 0; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "common/clock.pyx":19 + * return current + * + * def monotonic_time(): # <<<<<<<<<<<<<< + * return readclock(CLOCK_MONOTONIC_RAW) + * + */ + __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_clock_pyx, __pyx_n_s_monotonic_time, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 19, __pyx_L1_error) + + /* "common/clock.pyx":22 + * return readclock(CLOCK_MONOTONIC_RAW) + * + * def sec_since_boot(): # <<<<<<<<<<<<<< + * return readclock(CLOCK_BOOTTIME) + * + */ + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_clock_pyx, __pyx_n_s_sec_since_boot, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initclock(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initclock(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_clock(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_clock(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_clock(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'clock' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_clock(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("clock", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_common__clock) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "common.clock")) { + if (unlikely(PyDict_SetItemString(modules, "common.clock", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + (void)__Pyx_modinit_type_init_code(); + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "common/clock.pyx":19 + * return current + * + * def monotonic_time(): # <<<<<<<<<<<<<< + * return readclock(CLOCK_MONOTONIC_RAW) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_5clock_1monotonic_time, NULL, __pyx_n_s_common_clock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_monotonic_time, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/clock.pyx":22 + * return readclock(CLOCK_MONOTONIC_RAW) + * + * def sec_since_boot(): # <<<<<<<<<<<<<< + * return readclock(CLOCK_BOOTTIME) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_5clock_3sec_since_boot, NULL, __pyx_n_s_common_clock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sec_since_boot, __pyx_t_1) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/clock.pyx":1 + * # distutils: language = c++ # <<<<<<<<<<<<<< + * # cython: language_level = 3 + * from posix.time cimport clock_gettime, timespec, CLOCK_MONOTONIC_RAW, clockid_t + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init common.clock", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init common.clock"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; ip) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/common/clock.pyx b/common/clock.pyx new file mode 100644 index 000000000..81333565c --- /dev/null +++ b/common/clock.pyx @@ -0,0 +1,24 @@ +# distutils: language = c++ +# cython: language_level = 3 +from posix.time cimport clock_gettime, timespec, CLOCK_MONOTONIC_RAW, clockid_t + +IF UNAME_SYSNAME == "Darwin": + # Darwin doesn't have a CLOCK_BOOTTIME + CLOCK_BOOTTIME = CLOCK_MONOTONIC_RAW +ELSE: + from posix.time cimport CLOCK_BOOTTIME + +cdef double readclock(clockid_t clock_id): + cdef timespec ts + cdef double current + + clock_gettime(clock_id, &ts) + current = ts.tv_sec + (ts.tv_nsec / 1000000000.) + return current + +def monotonic_time(): + return readclock(CLOCK_MONOTONIC_RAW) + +def sec_since_boot(): + return readclock(CLOCK_BOOTTIME) + diff --git a/common/clock.so b/common/clock.so new file mode 100755 index 000000000..93fbdf0cb Binary files /dev/null and b/common/clock.so differ diff --git a/common/dict_helpers.py b/common/dict_helpers.py new file mode 100644 index 000000000..62cff63b5 --- /dev/null +++ b/common/dict_helpers.py @@ -0,0 +1,9 @@ +# remove all keys that end in DEPRECATED +def strip_deprecated_keys(d): + for k in list(d.keys()): + if isinstance(k, str): + if k.endswith('DEPRECATED'): + d.pop(k) + elif isinstance(d[k], dict): + strip_deprecated_keys(d[k]) + return d diff --git a/common/ffi_wrapper.py b/common/ffi_wrapper.py new file mode 100644 index 000000000..a228b4025 --- /dev/null +++ b/common/ffi_wrapper.py @@ -0,0 +1,55 @@ +import os +import sys +import fcntl +import hashlib +import platform +from cffi import FFI + +def suffix(): + if platform.system() == "Darwin": + return ".dylib" + else: + return ".so" + +def ffi_wrap(name, c_code, c_header, tmpdir="/tmp/ccache", cflags="", libraries=None): + if libraries is None: + libraries = [] + + cache = name + "_" + hashlib.sha1(c_code.encode('utf-8')).hexdigest() + try: + os.mkdir(tmpdir) + except OSError: + pass + + fd = os.open(tmpdir, 0) + fcntl.flock(fd, fcntl.LOCK_EX) + try: + sys.path.append(tmpdir) + try: + mod = __import__(cache) + except Exception: + print(f"cache miss {cache}") + compile_code(cache, c_code, c_header, tmpdir, cflags, libraries) + mod = __import__(cache) + finally: + os.close(fd) + + return mod.ffi, mod.lib + + +def compile_code(name, c_code, c_header, directory, cflags="", libraries=None): + if libraries is None: + libraries = [] + + ffibuilder = FFI() + ffibuilder.set_source(name, c_code, source_extension='.cpp', libraries=libraries) + ffibuilder.cdef(c_header) + os.environ['OPT'] = "-fwrapv -O2 -DNDEBUG -std=c++1z" + os.environ['CFLAGS'] = cflags + ffibuilder.compile(verbose=True, debug=False, tmpdir=directory) + + +def wrap_compiled(name, directory): + sys.path.append(directory) + mod = __import__(name) + return mod.ffi, mod.lib diff --git a/common/file_helpers.py b/common/file_helpers.py new file mode 100644 index 000000000..592b2a199 --- /dev/null +++ b/common/file_helpers.py @@ -0,0 +1,113 @@ +import os +import shutil +import tempfile +from atomicwrites import AtomicWriter + + +def mkdirs_exists_ok(path): + if path.startswith('http://') or path.startswith('https://'): + raise ValueError('URL path') + try: + os.makedirs(path) + except OSError: + if not os.path.isdir(path): + raise + + +def rm_not_exists_ok(path): + try: + os.remove(path) + except OSError: + if os.path.exists(path): + raise + + +def rm_tree_or_link(path): + if os.path.islink(path): + os.unlink(path) + elif os.path.isdir(path): + shutil.rmtree(path) + + +def get_tmpdir_on_same_filesystem(path): + normpath = os.path.normpath(path) + parts = normpath.split("/") + if len(parts) > 1 and parts[1] == "scratch": + return "/scratch/tmp" + elif len(parts) > 2 and parts[2] == "runner": + return f"/{parts[1]}/runner/tmp" + return "/tmp" + + +class NamedTemporaryDir(): + def __init__(self, temp_dir=None): + self._path = tempfile.mkdtemp(dir=temp_dir) + + @property + def name(self): + return self._path + + def close(self): + shutil.rmtree(self._path) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + +class CallbackReader: + """Wraps a file, but overrides the read method to also + call a callback function with the number of bytes read so far.""" + def __init__(self, f, callback, *args): + self.f = f + self.callback = callback + self.cb_args = args + self.total_read = 0 + + def __getattr__(self, attr): + return getattr(self.f, attr) + + def read(self, *args, **kwargs): + chunk = self.f.read(*args, **kwargs) + self.total_read += len(chunk) + self.callback(*self.cb_args, self.total_read) + return chunk + + +def _get_fileobject_func(writer, temp_dir): + def _get_fileobject(): + return writer.get_fileobject(dir=temp_dir) + return _get_fileobject + +def monkeypatch_os_link(): + # This is neccesary on EON/C2, where os.link is patched out of python + if not hasattr(os, 'link'): + from cffi import FFI + ffi = FFI() + ffi.cdef("int link(const char *oldpath, const char *newpath);") + libc = ffi.dlopen(None) + + def link(src, dest): + return libc.link(src.encode(), dest.encode()) + os.link = link + +def atomic_write_on_fs_tmp(path, **kwargs): + """Creates an atomic writer using a temporary file in a temporary directory + on the same filesystem as path. + """ + # TODO(mgraczyk): This use of AtomicWriter relies on implementation details to set the temp + # directory. + monkeypatch_os_link() + writer = AtomicWriter(path, **kwargs) + return writer._open(_get_fileobject_func(writer, get_tmpdir_on_same_filesystem(path))) + + +def atomic_write_in_dir(path, **kwargs): + """Creates an atomic writer using a temporary file in the same directory + as the destination file. + """ + monkeypatch_os_link() + writer = AtomicWriter(path, **kwargs) + return writer._open(_get_fileobject_func(writer, os.path.dirname(path))) diff --git a/common/filter_simple.py b/common/filter_simple.py new file mode 100644 index 000000000..0ec7a5156 --- /dev/null +++ b/common/filter_simple.py @@ -0,0 +1,18 @@ +class FirstOrderFilter: + # first order filter + def __init__(self, x0, rc, dt, initialized=True): + self.x = x0 + self.dt = dt + self.update_alpha(rc) + self.initialized = initialized + + def update_alpha(self, rc): + self.alpha = self.dt / (rc + self.dt) + + def update(self, x): + if self.initialized: + self.x = (1. - self.alpha) * self.x + self.alpha * x + else: + self.initialized = True + self.x = x + return self.x diff --git a/common/gpio.py b/common/gpio.py new file mode 100644 index 000000000..cb0322146 --- /dev/null +++ b/common/gpio.py @@ -0,0 +1,14 @@ +def gpio_init(pin, output): + try: + with open(f"/sys/class/gpio/gpio{pin}/direction", 'wb') as f: + f.write(b"out" if output else b"in") + except Exception as e: + print(f"Failed to set gpio {pin} direction: {e}") + + +def gpio_set(pin, high): + try: + with open(f"/sys/class/gpio/gpio{pin}/value", 'wb') as f: + f.write(b"1" if high else b"0") + except Exception as e: + print(f"Failed to set gpio {pin} value: {e}") diff --git a/common/kalman/.gitignore b/common/kalman/.gitignore new file mode 100644 index 000000000..d86912e7d --- /dev/null +++ b/common/kalman/.gitignore @@ -0,0 +1 @@ +simple_kalman_impl.c diff --git a/common/kalman/SConscript b/common/kalman/SConscript new file mode 100644 index 000000000..d60354c98 --- /dev/null +++ b/common/kalman/SConscript @@ -0,0 +1,3 @@ +Import('envCython') + +envCython.Program('simple_kalman_impl.so', 'simple_kalman_impl.pyx') diff --git a/common/kalman/__init__.py b/common/kalman/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/common/kalman/simple_kalman.py b/common/kalman/simple_kalman.py new file mode 100644 index 000000000..33289e4f5 --- /dev/null +++ b/common/kalman/simple_kalman.py @@ -0,0 +1,3 @@ +# pylint: skip-file +from common.kalman.simple_kalman_impl import KF1D as KF1D +assert KF1D diff --git a/common/kalman/simple_kalman_impl.cpp b/common/kalman/simple_kalman_impl.cpp new file mode 100644 index 000000000..faa41d50f --- /dev/null +++ b/common/kalman/simple_kalman_impl.cpp @@ -0,0 +1,6965 @@ +/* Generated by Cython 0.29.26 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "language": "c++", + "name": "common.kalman.simple_kalman_impl", + "sources": [ + "/data/openpilot/common/kalman/simple_kalman_impl.pyx" + ] + }, + "module_name": "common.kalman.simple_kalman_impl" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_26" +#define CYTHON_HEX_VERSION 0x001D1AF0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } + private: + T *ptr; +}; + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject* co=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(0))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too; + if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here + if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too; + Py_XDECREF((PyObject*)co); + co = (PyCodeObject*)call_result; + call_result = NULL; + if (0) { + cleanup_code_too: + Py_XDECREF((PyObject*)co); + co = NULL; + } + end: + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(call_result); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return co; + } +#else + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if defined(PyUnicode_IS_READY) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #else + #define __Pyx_PyUnicode_READY(op) (0) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__common__kalman__simple_kalman_impl +#define __PYX_HAVE_API__common__kalman__simple_kalman_impl +/* Early includes */ +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "common/kalman/simple_kalman_impl.pyx", + "common/kalman/simple_kalman_impl.pxd", + "stringsource", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D; + +/* "common/kalman/simple_kalman_impl.pxd":3 + * # cython: language_level = 3 + * + * cdef class KF1D: # <<<<<<<<<<<<<< + * cdef public: + * double x0_0 + */ +struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D { + PyObject_HEAD + double x0_0; + double x1_0; + double K0_0; + double K1_0; + double A0_0; + double A0_1; + double A1_0; + double A1_1; + double C0_0; + double C0_1; + double A_K_0; + double A_K_1; + double A_K_2; + double A_K_3; +}; + + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if CYTHON_FAST_PYCALL + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif // CYTHON_FAST_PYCALL +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* GCCDiagnostics.proto */ +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + + +/* Module declarations from 'common.kalman.simple_kalman_impl' */ +static PyTypeObject *__pyx_ptype_6common_6kalman_18simple_kalman_impl_KF1D = 0; +static PyObject *__pyx_f_6common_6kalman_18simple_kalman_impl___pyx_unpickle_KF1D__set_state(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *, PyObject *); /*proto*/ +#define __Pyx_MODULE_NAME "common.kalman.simple_kalman_impl" +extern int __pyx_module_is_main_common__kalman__simple_kalman_impl; +int __pyx_module_is_main_common__kalman__simple_kalman_impl = 0; + +/* Implementation of 'common.kalman.simple_kalman_impl' */ +static const char __pyx_k_A[] = "A"; +static const char __pyx_k_C[] = "C"; +static const char __pyx_k_K[] = "K"; +static const char __pyx_k_x0[] = "x0"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_KF1D[] = "KF1D"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_pyx_result[] = "__pyx_result"; +static const char __pyx_k_PickleError[] = "PickleError"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_stringsource[] = "stringsource"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_pyx_unpickle_KF1D[] = "__pyx_unpickle_KF1D"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_Incompatible_checksums_s_vs_0x34[] = "Incompatible checksums (%s vs 0x3439d7a = (A0_0, A0_1, A1_0, A1_1, A_K_0, A_K_1, A_K_2, A_K_3, C0_0, C0_1, K0_0, K1_0, x0_0, x1_0))"; +static const char __pyx_k_common_kalman_simple_kalman_impl[] = "common.kalman.simple_kalman_impl"; +static PyObject *__pyx_n_s_A; +static PyObject *__pyx_n_s_C; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x34; +static PyObject *__pyx_n_s_K; +static PyObject *__pyx_n_s_KF1D; +static PyObject *__pyx_n_s_PickleError; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_common_kalman_simple_kalman_impl; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_pyx_PickleError; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_result; +static PyObject *__pyx_n_s_pyx_state; +static PyObject *__pyx_n_s_pyx_type; +static PyObject *__pyx_n_s_pyx_unpickle_KF1D; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_reduce_ex; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_kp_s_stringsource; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_n_s_x0; +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D___init__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_x0, PyObject *__pyx_v_A, PyObject *__pyx_v_C, PyObject *__pyx_v_K); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_2update(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_meas); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_1x___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_1x_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_x); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4x0_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4x0_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4x1_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4x1_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4K0_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4K0_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4K1_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4K1_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_1___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_1_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_1___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_1_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_1___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_1_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_1___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_1_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_2___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_2_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_3___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_3_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4__reduce_cython__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_6__setstate_cython__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl___pyx_unpickle_KF1D(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_6common_6kalman_18simple_kalman_impl_KF1D(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_54762874; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_codeobj__2; +/* Late includes */ + +/* "common/kalman/simple_kalman_impl.pyx":5 + * + * cdef class KF1D: + * def __init__(self, x0, A, C, K): # <<<<<<<<<<<<<< + * self.x0_0 = x0[0][0] + * self.x1_0 = x0[1][0] + */ + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_x0 = 0; + PyObject *__pyx_v_A = 0; + PyObject *__pyx_v_C = 0; + PyObject *__pyx_v_K = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_A,&__pyx_n_s_C,&__pyx_n_s_K,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 5, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 5, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_K)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 5, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 5, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x0 = values[0]; + __pyx_v_A = values[1]; + __pyx_v_C = values[2]; + __pyx_v_K = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D___init__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), __pyx_v_x0, __pyx_v_A, __pyx_v_C, __pyx_v_K); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D___init__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_x0, PyObject *__pyx_v_A, PyObject *__pyx_v_C, PyObject *__pyx_v_K) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + double __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "common/kalman/simple_kalman_impl.pyx":6 + * cdef class KF1D: + * def __init__(self, x0, A, C, K): + * self.x0_0 = x0[0][0] # <<<<<<<<<<<<<< + * self.x1_0 = x0[1][0] + * self.A0_0 = A[0][0] + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x0, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->x0_0 = __pyx_t_3; + + /* "common/kalman/simple_kalman_impl.pyx":7 + * def __init__(self, x0, A, C, K): + * self.x0_0 = x0[0][0] + * self.x1_0 = x0[1][0] # <<<<<<<<<<<<<< + * self.A0_0 = A[0][0] + * self.A0_1 = A[0][1] + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x0, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->x1_0 = __pyx_t_3; + + /* "common/kalman/simple_kalman_impl.pyx":8 + * self.x0_0 = x0[0][0] + * self.x1_0 = x0[1][0] + * self.A0_0 = A[0][0] # <<<<<<<<<<<<<< + * self.A0_1 = A[0][1] + * self.A1_0 = A[1][0] + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_A, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->A0_0 = __pyx_t_3; + + /* "common/kalman/simple_kalman_impl.pyx":9 + * self.x1_0 = x0[1][0] + * self.A0_0 = A[0][0] + * self.A0_1 = A[0][1] # <<<<<<<<<<<<<< + * self.A1_0 = A[1][0] + * self.A1_1 = A[1][1] + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_A, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->A0_1 = __pyx_t_3; + + /* "common/kalman/simple_kalman_impl.pyx":10 + * self.A0_0 = A[0][0] + * self.A0_1 = A[0][1] + * self.A1_0 = A[1][0] # <<<<<<<<<<<<<< + * self.A1_1 = A[1][1] + * self.C0_0 = C[0] + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_A, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->A1_0 = __pyx_t_3; + + /* "common/kalman/simple_kalman_impl.pyx":11 + * self.A0_1 = A[0][1] + * self.A1_0 = A[1][0] + * self.A1_1 = A[1][1] # <<<<<<<<<<<<<< + * self.C0_0 = C[0] + * self.C0_1 = C[1] + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_A, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->A1_1 = __pyx_t_3; + + /* "common/kalman/simple_kalman_impl.pyx":12 + * self.A1_0 = A[1][0] + * self.A1_1 = A[1][1] + * self.C0_0 = C[0] # <<<<<<<<<<<<<< + * self.C0_1 = C[1] + * self.K0_0 = K[0][0] + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_C, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->C0_0 = __pyx_t_3; + + /* "common/kalman/simple_kalman_impl.pyx":13 + * self.A1_1 = A[1][1] + * self.C0_0 = C[0] + * self.C0_1 = C[1] # <<<<<<<<<<<<<< + * self.K0_0 = K[0][0] + * self.K1_0 = K[1][0] + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_C, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->C0_1 = __pyx_t_3; + + /* "common/kalman/simple_kalman_impl.pyx":14 + * self.C0_0 = C[0] + * self.C0_1 = C[1] + * self.K0_0 = K[0][0] # <<<<<<<<<<<<<< + * self.K1_0 = K[1][0] + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_K, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->K0_0 = __pyx_t_3; + + /* "common/kalman/simple_kalman_impl.pyx":15 + * self.C0_1 = C[1] + * self.K0_0 = K[0][0] + * self.K1_0 = K[1][0] # <<<<<<<<<<<<<< + * + * self.A_K_0 = self.A0_0 - self.K0_0 * self.C0_0 + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_K, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->K1_0 = __pyx_t_3; + + /* "common/kalman/simple_kalman_impl.pyx":17 + * self.K1_0 = K[1][0] + * + * self.A_K_0 = self.A0_0 - self.K0_0 * self.C0_0 # <<<<<<<<<<<<<< + * self.A_K_1 = self.A0_1 - self.K0_0 * self.C0_1 + * self.A_K_2 = self.A1_0 - self.K1_0 * self.C0_0 + */ + __pyx_v_self->A_K_0 = (__pyx_v_self->A0_0 - (__pyx_v_self->K0_0 * __pyx_v_self->C0_0)); + + /* "common/kalman/simple_kalman_impl.pyx":18 + * + * self.A_K_0 = self.A0_0 - self.K0_0 * self.C0_0 + * self.A_K_1 = self.A0_1 - self.K0_0 * self.C0_1 # <<<<<<<<<<<<<< + * self.A_K_2 = self.A1_0 - self.K1_0 * self.C0_0 + * self.A_K_3 = self.A1_1 - self.K1_0 * self.C0_1 + */ + __pyx_v_self->A_K_1 = (__pyx_v_self->A0_1 - (__pyx_v_self->K0_0 * __pyx_v_self->C0_1)); + + /* "common/kalman/simple_kalman_impl.pyx":19 + * self.A_K_0 = self.A0_0 - self.K0_0 * self.C0_0 + * self.A_K_1 = self.A0_1 - self.K0_0 * self.C0_1 + * self.A_K_2 = self.A1_0 - self.K1_0 * self.C0_0 # <<<<<<<<<<<<<< + * self.A_K_3 = self.A1_1 - self.K1_0 * self.C0_1 + * + */ + __pyx_v_self->A_K_2 = (__pyx_v_self->A1_0 - (__pyx_v_self->K1_0 * __pyx_v_self->C0_0)); + + /* "common/kalman/simple_kalman_impl.pyx":20 + * self.A_K_1 = self.A0_1 - self.K0_0 * self.C0_1 + * self.A_K_2 = self.A1_0 - self.K1_0 * self.C0_0 + * self.A_K_3 = self.A1_1 - self.K1_0 * self.C0_1 # <<<<<<<<<<<<<< + * + * def update(self, meas): + */ + __pyx_v_self->A_K_3 = (__pyx_v_self->A1_1 - (__pyx_v_self->K1_0 * __pyx_v_self->C0_1)); + + /* "common/kalman/simple_kalman_impl.pyx":5 + * + * cdef class KF1D: + * def __init__(self, x0, A, C, K): # <<<<<<<<<<<<<< + * self.x0_0 = x0[0][0] + * self.x1_0 = x0[1][0] + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pyx":22 + * self.A_K_3 = self.A1_1 - self.K1_0 * self.C0_1 + * + * def update(self, meas): # <<<<<<<<<<<<<< + * cdef double x0_0 = self.A_K_0 * self.x0_0 + self.A_K_1 * self.x1_0 + self.K0_0 * meas + * cdef double x1_0 = self.A_K_2 * self.x0_0 + self.A_K_3 * self.x1_0 + self.K1_0 * meas + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_3update(PyObject *__pyx_v_self, PyObject *__pyx_v_meas); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_3update(PyObject *__pyx_v_self, PyObject *__pyx_v_meas) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("update (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_2update(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_meas)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_2update(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_meas) { + double __pyx_v_x0_0; + double __pyx_v_x1_0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + double __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("update", 0); + + /* "common/kalman/simple_kalman_impl.pyx":23 + * + * def update(self, meas): + * cdef double x0_0 = self.A_K_0 * self.x0_0 + self.A_K_1 * self.x1_0 + self.K0_0 * meas # <<<<<<<<<<<<<< + * cdef double x1_0 = self.A_K_2 * self.x0_0 + self.A_K_3 * self.x1_0 + self.K1_0 * meas + * self.x0_0 = x0_0 + */ + __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->A_K_0 * __pyx_v_self->x0_0) + (__pyx_v_self->A_K_1 * __pyx_v_self->x1_0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->K0_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_v_meas); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_x0_0 = __pyx_t_4; + + /* "common/kalman/simple_kalman_impl.pyx":24 + * def update(self, meas): + * cdef double x0_0 = self.A_K_0 * self.x0_0 + self.A_K_1 * self.x1_0 + self.K0_0 * meas + * cdef double x1_0 = self.A_K_2 * self.x0_0 + self.A_K_3 * self.x1_0 + self.K1_0 * meas # <<<<<<<<<<<<<< + * self.x0_0 = x0_0 + * self.x1_0 = x1_0 + */ + __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_self->A_K_2 * __pyx_v_self->x0_0) + (__pyx_v_self->A_K_3 * __pyx_v_self->x1_0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->K1_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_meas); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_x1_0 = __pyx_t_4; + + /* "common/kalman/simple_kalman_impl.pyx":25 + * cdef double x0_0 = self.A_K_0 * self.x0_0 + self.A_K_1 * self.x1_0 + self.K0_0 * meas + * cdef double x1_0 = self.A_K_2 * self.x0_0 + self.A_K_3 * self.x1_0 + self.K1_0 * meas + * self.x0_0 = x0_0 # <<<<<<<<<<<<<< + * self.x1_0 = x1_0 + * + */ + __pyx_v_self->x0_0 = __pyx_v_x0_0; + + /* "common/kalman/simple_kalman_impl.pyx":26 + * cdef double x1_0 = self.A_K_2 * self.x0_0 + self.A_K_3 * self.x1_0 + self.K1_0 * meas + * self.x0_0 = x0_0 + * self.x1_0 = x1_0 # <<<<<<<<<<<<<< + * + * return [self.x0_0, self.x1_0] + */ + __pyx_v_self->x1_0 = __pyx_v_x1_0; + + /* "common/kalman/simple_kalman_impl.pyx":28 + * self.x1_0 = x1_0 + * + * return [self.x0_0, self.x1_0] # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->x0_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->x1_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "common/kalman/simple_kalman_impl.pyx":22 + * self.A_K_3 = self.A1_1 - self.K1_0 * self.C0_1 + * + * def update(self, meas): # <<<<<<<<<<<<<< + * cdef double x0_0 = self.A_K_0 * self.x0_0 + self.A_K_1 * self.x1_0 + self.K0_0 * meas + * cdef double x1_0 = self.A_K_2 * self.x0_0 + self.A_K_3 * self.x1_0 + self.K1_0 * meas + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.update", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pyx":31 + * + * @property + * def x(self): # <<<<<<<<<<<<<< + * return [[self.x0_0], [self.x1_0]] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_1x_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_1x_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_1x___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_1x___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "common/kalman/simple_kalman_impl.pyx":32 + * @property + * def x(self): + * return [[self.x0_0], [self.x1_0]] # <<<<<<<<<<<<<< + * + * @x.setter + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->x0_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->x1_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "common/kalman/simple_kalman_impl.pyx":31 + * + * @property + * def x(self): # <<<<<<<<<<<<<< + * return [[self.x0_0], [self.x1_0]] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.x.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pyx":35 + * + * @x.setter + * def x(self, x): # <<<<<<<<<<<<<< + * self.x0_0 = x[0][0] + * self.x1_0 = x[1][0] + */ + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_1x_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_1x_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_1x_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_x)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_1x_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_x) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + double __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + + /* "common/kalman/simple_kalman_impl.pyx":36 + * @x.setter + * def x(self, x): + * self.x0_0 = x[0][0] # <<<<<<<<<<<<<< + * self.x1_0 = x[1][0] + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->x0_0 = __pyx_t_3; + + /* "common/kalman/simple_kalman_impl.pyx":37 + * def x(self, x): + * self.x0_0 = x[0][0] + * self.x1_0 = x[1][0] # <<<<<<<<<<<<<< + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->x1_0 = __pyx_t_3; + + /* "common/kalman/simple_kalman_impl.pyx":35 + * + * @x.setter + * def x(self, x): # <<<<<<<<<<<<<< + * self.x0_0 = x[0][0] + * self.x1_0 = x[1][0] + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.x.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pxd":5 + * cdef class KF1D: + * cdef public: + * double x0_0 # <<<<<<<<<<<<<< + * double x1_0 + * double K0_0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4x0_0_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4x0_0_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4x0_0___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4x0_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->x0_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.x0_0.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4x0_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4x0_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4x0_0_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4x0_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 5, __pyx_L1_error) + __pyx_v_self->x0_0 = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.x0_0.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pxd":6 + * cdef public: + * double x0_0 + * double x1_0 # <<<<<<<<<<<<<< + * double K0_0 + * double K1_0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4x1_0_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4x1_0_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4x1_0___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4x1_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->x1_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.x1_0.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4x1_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4x1_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4x1_0_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4x1_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 6, __pyx_L1_error) + __pyx_v_self->x1_0 = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.x1_0.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pxd":7 + * double x0_0 + * double x1_0 + * double K0_0 # <<<<<<<<<<<<<< + * double K1_0 + * double A0_0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4K0_0_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4K0_0_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4K0_0___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4K0_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->K0_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.K0_0.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4K0_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4K0_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4K0_0_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4K0_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 7, __pyx_L1_error) + __pyx_v_self->K0_0 = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.K0_0.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pxd":8 + * double x1_0 + * double K0_0 + * double K1_0 # <<<<<<<<<<<<<< + * double A0_0 + * double A0_1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4K1_0_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4K1_0_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4K1_0___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4K1_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->K1_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.K1_0.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4K1_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4K1_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4K1_0_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4K1_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 8, __pyx_L1_error) + __pyx_v_self->K1_0 = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.K1_0.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pxd":9 + * double K0_0 + * double K1_0 + * double A0_0 # <<<<<<<<<<<<<< + * double A0_1 + * double A1_0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_0_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_0_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_0___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->A0_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A0_0.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_0_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 9, __pyx_L1_error) + __pyx_v_self->A0_0 = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A0_0.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pxd":10 + * double K1_0 + * double A0_0 + * double A0_1 # <<<<<<<<<<<<<< + * double A1_0 + * double A1_1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_1_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_1_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_1___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_1___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->A0_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A0_1.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_1_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_1_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_1_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_1_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_v_self->A0_1 = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A0_1.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pxd":11 + * double A0_0 + * double A0_1 + * double A1_0 # <<<<<<<<<<<<<< + * double A1_1 + * double C0_0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_0_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_0_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_0___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->A1_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A1_0.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_0_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_v_self->A1_0 = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A1_0.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pxd":12 + * double A0_1 + * double A1_0 + * double A1_1 # <<<<<<<<<<<<<< + * double C0_0 + * double C0_1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_1_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_1_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_1___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_1___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->A1_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A1_1.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_1_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_1_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_1_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_1_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_v_self->A1_1 = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A1_1.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pxd":13 + * double A1_0 + * double A1_1 + * double C0_0 # <<<<<<<<<<<<<< + * double C0_1 + * double A_K_0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_0_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_0_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_0___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->C0_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.C0_0.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_0_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 13, __pyx_L1_error) + __pyx_v_self->C0_0 = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.C0_0.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pxd":14 + * double A1_1 + * double C0_0 + * double C0_1 # <<<<<<<<<<<<<< + * double A_K_0 + * double A_K_1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_1_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_1_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_1___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_1___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->C0_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.C0_1.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_1_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_1_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_1_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_1_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 14, __pyx_L1_error) + __pyx_v_self->C0_1 = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.C0_1.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pxd":15 + * double C0_0 + * double C0_1 + * double A_K_0 # <<<<<<<<<<<<<< + * double A_K_1 + * double A_K_2 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_0_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_0_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_0___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_0___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->A_K_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A_K_0.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_0_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_0_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 15, __pyx_L1_error) + __pyx_v_self->A_K_0 = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A_K_0.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pxd":16 + * double C0_1 + * double A_K_0 + * double A_K_1 # <<<<<<<<<<<<<< + * double A_K_2 + * double A_K_3 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_1_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_1_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_1___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_1___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->A_K_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A_K_1.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_1_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_1_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_1_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_1_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L1_error) + __pyx_v_self->A_K_1 = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A_K_1.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pxd":17 + * double A_K_0 + * double A_K_1 + * double A_K_2 # <<<<<<<<<<<<<< + * double A_K_3 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_2_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_2_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_2___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_2___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->A_K_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A_K_2.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_2_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_2_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_2_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_2_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_v_self->A_K_2 = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A_K_2.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/kalman/simple_kalman_impl.pxd":18 + * double A_K_1 + * double A_K_2 + * double A_K_3 # <<<<<<<<<<<<<< + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_3_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_3_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_3___get__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_3___get__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->A_K_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A_K_3.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_3_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_3_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_3_2__set__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_3_2__set__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 18, __pyx_L1_error) + __pyx_v_self->A_K_3 = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.A_K_3.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4__reduce_cython__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_4__reduce_cython__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self) { + PyObject *__pyx_v_state = 0; + PyObject *__pyx_v__dict = 0; + int __pyx_v_use_setstate; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + int __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":5 + * cdef object _dict + * cdef bint use_setstate + * state = (self.A0_0, self.A0_1, self.A1_0, self.A1_1, self.A_K_0, self.A_K_1, self.A_K_2, self.A_K_3, self.C0_0, self.C0_1, self.K0_0, self.K1_0, self.x0_0, self.x1_0) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->A0_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->A0_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->A1_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->A1_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->A_K_0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->A_K_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->A_K_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->A_K_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyFloat_FromDouble(__pyx_v_self->C0_0); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyFloat_FromDouble(__pyx_v_self->C0_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_self->K0_0); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyFloat_FromDouble(__pyx_v_self->K1_0); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PyFloat_FromDouble(__pyx_v_self->x0_0); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->x1_0); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = PyTuple_New(14); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_15, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_15, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_15, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_15, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_15, 10, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 11, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_15, 12, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_15, 13, __pyx_t_14); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_v_state = ((PyObject*)__pyx_t_15); + __pyx_t_15 = 0; + + /* "(tree fragment)":6 + * cdef bint use_setstate + * state = (self.A0_0, self.A0_1, self.A1_0, self.A1_1, self.A_K_0, self.A_K_1, self.A_K_2, self.A_K_3, self.C0_0, self.C0_1, self.K0_0, self.K1_0, self.x0_0, self.x1_0) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_15 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_v__dict = __pyx_t_15; + __pyx_t_15 = 0; + + /* "(tree fragment)":7 + * state = (self.A0_0, self.A0_1, self.A1_0, self.A1_1, self.A_K_0, self.A_K_1, self.A_K_2, self.A_K_3, self.C0_0, self.C0_1, self.K0_0, self.K1_0, self.x0_0, self.x1_0) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_16 = (__pyx_v__dict != Py_None); + __pyx_t_17 = (__pyx_t_16 != 0); + if (__pyx_t_17) { + + /* "(tree fragment)":8 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v__dict); + __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_14)); + __pyx_t_14 = 0; + + /* "(tree fragment)":9 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":7 + * state = (self.A0_0, self.A0_1, self.A1_0, self.A1_1, self.A_K_0, self.A_K_1, self.A_K_2, self.A_K_3, self.C0_0, self.C0_1, self.K0_0, self.K1_0, self.x0_0, self.x1_0) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":11 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_KF1D, (type(self), 0x3439d7a, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":12 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_KF1D, (type(self), 0x3439d7a, None), state + * else: + */ + __pyx_t_17 = (__pyx_v_use_setstate != 0); + if (__pyx_t_17) { + + /* "(tree fragment)":13 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_KF1D, (type(self), 0x3439d7a, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_KF1D, (type(self), 0x3439d7a, state) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_pyx_unpickle_KF1D); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_54762874); + __Pyx_GIVEREF(__pyx_int_54762874); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_int_54762874); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_15, 2, Py_None); + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_15); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_state); + __pyx_t_14 = 0; + __pyx_t_15 = 0; + __pyx_r = __pyx_t_13; + __pyx_t_13 = 0; + goto __pyx_L0; + + /* "(tree fragment)":12 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_KF1D, (type(self), 0x3439d7a, None), state + * else: + */ + } + + /* "(tree fragment)":15 + * return __pyx_unpickle_KF1D, (type(self), 0x3439d7a, None), state + * else: + * return __pyx_unpickle_KF1D, (type(self), 0x3439d7a, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_KF1D__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_pyx_unpickle_KF1D); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_54762874); + __Pyx_GIVEREF(__pyx_int_54762874); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_int_54762874); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_state); + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_15); + __pyx_t_13 = 0; + __pyx_t_15 = 0; + __pyx_r = __pyx_t_14; + __pyx_t_14 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":16 + * else: + * return __pyx_unpickle_KF1D, (type(self), 0x3439d7a, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_KF1D__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_6__setstate_cython__(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl_4KF1D_6__setstate_cython__(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":17 + * return __pyx_unpickle_KF1D, (type(self), 0x3439d7a, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_KF1D__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6common_6kalman_18simple_kalman_impl___pyx_unpickle_KF1D__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle_KF1D, (type(self), 0x3439d7a, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_KF1D__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.KF1D.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __pyx_unpickle_KF1D(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_1__pyx_unpickle_KF1D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6common_6kalman_18simple_kalman_impl_1__pyx_unpickle_KF1D = {"__pyx_unpickle_KF1D", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6common_6kalman_18simple_kalman_impl_1__pyx_unpickle_KF1D, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6common_6kalman_18simple_kalman_impl_1__pyx_unpickle_KF1D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle_KF1D (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_KF1D", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_KF1D", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_KF1D") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_KF1D", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.__pyx_unpickle_KF1D", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6common_6kalman_18simple_kalman_impl___pyx_unpickle_KF1D(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_6kalman_18simple_kalman_impl___pyx_unpickle_KF1D(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = 0; + PyObject *__pyx_v___pyx_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle_KF1D", 0); + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0x3439d7a: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0x3439d7a = (A0_0, A0_1, A1_0, A1_1, A_K_0, A_K_1, A_K_2, A_K_3, C0_0, C0_1, K0_0, K1_0, x0_0, x1_0))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x3439d7a) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":5 + * cdef object __pyx_result + * if __pyx_checksum != 0x3439d7a: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0x3439d7a = (A0_0, A0_1, A1_0, A1_1, A_K_0, A_K_1, A_K_2, A_K_3, C0_0, C0_1, K0_0, K1_0, x0_0, x1_0))" % __pyx_checksum) + * __pyx_result = KF1D.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * if __pyx_checksum != 0x3439d7a: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0x3439d7a = (A0_0, A0_1, A1_0, A1_1, A_K_0, A_K_1, A_K_2, A_K_3, C0_0, C0_1, K0_0, K1_0, x0_0, x1_0))" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = KF1D.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x34, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 6, __pyx_L1_error) + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0x3439d7a: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0x3439d7a = (A0_0, A0_1, A1_0, A1_1, A_K_0, A_K_1, A_K_2, A_K_3, C0_0, C0_1, K0_0, K1_0, x0_0, x1_0))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":7 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0x3439d7a = (A0_0, A0_1, A1_0, A1_1, A_K_0, A_K_1, A_K_2, A_K_3, C0_0, C0_1, K0_0, K1_0, x0_0, x1_0))" % __pyx_checksum) + * __pyx_result = KF1D.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_KF1D__set_state( __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6common_6kalman_18simple_kalman_impl_KF1D), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0x3439d7a = (A0_0, A0_1, A1_0, A1_1, A_K_0, A_K_1, A_K_2, A_K_3, C0_0, C0_1, K0_0, K1_0, x0_0, x1_0))" % __pyx_checksum) + * __pyx_result = KF1D.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_KF1D__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "(tree fragment)":9 + * __pyx_result = KF1D.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_KF1D__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle_KF1D__set_state(KF1D __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error) + __pyx_t_3 = __pyx_f_6common_6kalman_18simple_kalman_impl___pyx_unpickle_KF1D__set_state(((struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0x3439d7a = (A0_0, A0_1, A1_0, A1_1, A_K_0, A_K_1, A_K_2, A_K_3, C0_0, C0_1, K0_0, K1_0, x0_0, x1_0))" % __pyx_checksum) + * __pyx_result = KF1D.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_KF1D__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":10 + * if __pyx_state is not None: + * __pyx_unpickle_KF1D__set_state( __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_KF1D__set_state(KF1D __pyx_result, tuple __pyx_state): + * __pyx_result.A0_0 = __pyx_state[0]; __pyx_result.A0_1 = __pyx_state[1]; __pyx_result.A1_0 = __pyx_state[2]; __pyx_result.A1_1 = __pyx_state[3]; __pyx_result.A_K_0 = __pyx_state[4]; __pyx_result.A_K_1 = __pyx_state[5]; __pyx_result.A_K_2 = __pyx_state[6]; __pyx_result.A_K_3 = __pyx_state[7]; __pyx_result.C0_0 = __pyx_state[8]; __pyx_result.C0_1 = __pyx_state[9]; __pyx_result.K0_0 = __pyx_state[10]; __pyx_result.K1_0 = __pyx_state[11]; __pyx_result.x0_0 = __pyx_state[12]; __pyx_result.x1_0 = __pyx_state[13] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_KF1D(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.__pyx_unpickle_KF1D", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":11 + * __pyx_unpickle_KF1D__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_KF1D__set_state(KF1D __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.A0_0 = __pyx_state[0]; __pyx_result.A0_1 = __pyx_state[1]; __pyx_result.A1_0 = __pyx_state[2]; __pyx_result.A1_1 = __pyx_state[3]; __pyx_result.A_K_0 = __pyx_state[4]; __pyx_result.A_K_1 = __pyx_state[5]; __pyx_result.A_K_2 = __pyx_state[6]; __pyx_result.A_K_3 = __pyx_state[7]; __pyx_result.C0_0 = __pyx_state[8]; __pyx_result.C0_1 = __pyx_state[9]; __pyx_result.K0_0 = __pyx_state[10]; __pyx_result.K1_0 = __pyx_state[11]; __pyx_result.x0_0 = __pyx_state[12]; __pyx_result.x1_0 = __pyx_state[13] + * if len(__pyx_state) > 14 and hasattr(__pyx_result, '__dict__'): + */ + +static PyObject *__pyx_f_6common_6kalman_18simple_kalman_impl___pyx_unpickle_KF1D__set_state(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle_KF1D__set_state", 0); + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle_KF1D__set_state(KF1D __pyx_result, tuple __pyx_state): + * __pyx_result.A0_0 = __pyx_state[0]; __pyx_result.A0_1 = __pyx_state[1]; __pyx_result.A1_0 = __pyx_state[2]; __pyx_result.A1_1 = __pyx_state[3]; __pyx_result.A_K_0 = __pyx_state[4]; __pyx_result.A_K_1 = __pyx_state[5]; __pyx_result.A_K_2 = __pyx_state[6]; __pyx_result.A_K_3 = __pyx_state[7]; __pyx_result.C0_0 = __pyx_state[8]; __pyx_result.C0_1 = __pyx_state[9]; __pyx_result.K0_0 = __pyx_state[10]; __pyx_result.K1_0 = __pyx_state[11]; __pyx_result.x0_0 = __pyx_state[12]; __pyx_result.x1_0 = __pyx_state[13] # <<<<<<<<<<<<<< + * if len(__pyx_state) > 14 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[14]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->A0_0 = __pyx_t_2; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->A0_1 = __pyx_t_2; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->A1_0 = __pyx_t_2; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->A1_1 = __pyx_t_2; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->A_K_0 = __pyx_t_2; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->A_K_1 = __pyx_t_2; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->A_K_2 = __pyx_t_2; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->A_K_3 = __pyx_t_2; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->C0_0 = __pyx_t_2; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->C0_1 = __pyx_t_2; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->K0_0 = __pyx_t_2; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->K1_0 = __pyx_t_2; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->x0_0 = __pyx_t_2; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->x1_0 = __pyx_t_2; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle_KF1D__set_state(KF1D __pyx_result, tuple __pyx_state): + * __pyx_result.A0_0 = __pyx_state[0]; __pyx_result.A0_1 = __pyx_state[1]; __pyx_result.A1_0 = __pyx_state[2]; __pyx_result.A1_1 = __pyx_state[3]; __pyx_result.A_K_0 = __pyx_state[4]; __pyx_result.A_K_1 = __pyx_state[5]; __pyx_result.A_K_2 = __pyx_state[6]; __pyx_result.A_K_3 = __pyx_state[7]; __pyx_result.C0_0 = __pyx_state[8]; __pyx_result.C0_1 = __pyx_state[9]; __pyx_result.K0_0 = __pyx_state[10]; __pyx_result.K1_0 = __pyx_state[11]; __pyx_result.x0_0 = __pyx_state[12]; __pyx_result.x1_0 = __pyx_state[13] + * if len(__pyx_state) > 14 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[14]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(2, 13, __pyx_L1_error) + } + __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error) + __pyx_t_5 = ((__pyx_t_4 > 14) != 0); + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error) + __pyx_t_6 = (__pyx_t_5 != 0); + __pyx_t_3 = __pyx_t_6; + __pyx_L4_bool_binop_done:; + if (__pyx_t_3) { + + /* "(tree fragment)":14 + * __pyx_result.A0_0 = __pyx_state[0]; __pyx_result.A0_1 = __pyx_state[1]; __pyx_result.A1_0 = __pyx_state[2]; __pyx_result.A1_1 = __pyx_state[3]; __pyx_result.A_K_0 = __pyx_state[4]; __pyx_result.A_K_1 = __pyx_state[5]; __pyx_result.A_K_2 = __pyx_state[6]; __pyx_result.A_K_3 = __pyx_state[7]; __pyx_result.C0_0 = __pyx_state[8]; __pyx_result.C0_1 = __pyx_state[9]; __pyx_result.K0_0 = __pyx_state[10]; __pyx_result.K1_0 = __pyx_state[11]; __pyx_result.x0_0 = __pyx_state[12]; __pyx_result.x1_0 = __pyx_state[13] + * if len(__pyx_state) > 14 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[14]) # <<<<<<<<<<<<<< + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 14, __pyx_L1_error) + } + __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle_KF1D__set_state(KF1D __pyx_result, tuple __pyx_state): + * __pyx_result.A0_0 = __pyx_state[0]; __pyx_result.A0_1 = __pyx_state[1]; __pyx_result.A1_0 = __pyx_state[2]; __pyx_result.A1_1 = __pyx_state[3]; __pyx_result.A_K_0 = __pyx_state[4]; __pyx_result.A_K_1 = __pyx_state[5]; __pyx_result.A_K_2 = __pyx_state[6]; __pyx_result.A_K_3 = __pyx_state[7]; __pyx_result.C0_0 = __pyx_state[8]; __pyx_result.C0_1 = __pyx_state[9]; __pyx_result.K0_0 = __pyx_state[10]; __pyx_result.K1_0 = __pyx_state[11]; __pyx_result.x0_0 = __pyx_state[12]; __pyx_result.x1_0 = __pyx_state[13] + * if len(__pyx_state) > 14 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[14]) + */ + } + + /* "(tree fragment)":11 + * __pyx_unpickle_KF1D__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_KF1D__set_state(KF1D __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.A0_0 = __pyx_state[0]; __pyx_result.A0_1 = __pyx_state[1]; __pyx_result.A1_0 = __pyx_state[2]; __pyx_result.A1_1 = __pyx_state[3]; __pyx_result.A_K_0 = __pyx_state[4]; __pyx_result.A_K_1 = __pyx_state[5]; __pyx_result.A_K_2 = __pyx_state[6]; __pyx_result.A_K_3 = __pyx_state[7]; __pyx_result.C0_0 = __pyx_state[8]; __pyx_result.C0_1 = __pyx_state[9]; __pyx_result.K0_0 = __pyx_state[10]; __pyx_result.K1_0 = __pyx_state[11]; __pyx_result.x0_0 = __pyx_state[12]; __pyx_result.x1_0 = __pyx_state[13] + * if len(__pyx_state) > 14 and hasattr(__pyx_result, '__dict__'): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("common.kalman.simple_kalman_impl.__pyx_unpickle_KF1D__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6common_6kalman_18simple_kalman_impl_KF1D(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6common_6kalman_18simple_kalman_impl_KF1D(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_x(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_1x_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_x(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_1x_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_x0_0(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4x0_0_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_x0_0(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4x0_0_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_x1_0(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4x1_0_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_x1_0(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4x1_0_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_K0_0(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4K0_0_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_K0_0(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4K0_0_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_K1_0(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4K1_0_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_K1_0(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4K1_0_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A0_0(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_0_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A0_0(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_0_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A0_1(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_1_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A0_1(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A0_1_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A1_0(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_0_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A1_0(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_0_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A1_1(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_1_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A1_1(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4A1_1_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_C0_0(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_0_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_C0_0(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_0_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_C0_1(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_1_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_C0_1(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_4C0_1_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_0(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_0_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_0(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_0_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_1(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_1_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_1(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_1_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_2(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_2_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_2(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_2_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_3(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_3_1__get__(o); +} + +static int __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_3(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5A_K_3_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_6common_6kalman_18simple_kalman_impl_KF1D[] = { + {"update", (PyCFunction)__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_3update, METH_O, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_7__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6common_6kalman_18simple_kalman_impl_KF1D[] = { + {(char *)"x", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_x, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_x, (char *)0, 0}, + {(char *)"x0_0", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_x0_0, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_x0_0, (char *)0, 0}, + {(char *)"x1_0", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_x1_0, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_x1_0, (char *)0, 0}, + {(char *)"K0_0", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_K0_0, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_K0_0, (char *)0, 0}, + {(char *)"K1_0", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_K1_0, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_K1_0, (char *)0, 0}, + {(char *)"A0_0", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A0_0, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A0_0, (char *)0, 0}, + {(char *)"A0_1", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A0_1, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A0_1, (char *)0, 0}, + {(char *)"A1_0", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A1_0, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A1_0, (char *)0, 0}, + {(char *)"A1_1", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A1_1, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A1_1, (char *)0, 0}, + {(char *)"C0_0", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_C0_0, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_C0_0, (char *)0, 0}, + {(char *)"C0_1", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_C0_1, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_C0_1, (char *)0, 0}, + {(char *)"A_K_0", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_0, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_0, (char *)0, 0}, + {(char *)"A_K_1", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_1, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_1, (char *)0, 0}, + {(char *)"A_K_2", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_2, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_2, (char *)0, 0}, + {(char *)"A_K_3", __pyx_getprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_3, __pyx_setprop_6common_6kalman_18simple_kalman_impl_4KF1D_A_K_3, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6common_6kalman_18simple_kalman_impl_KF1D = { + PyVarObject_HEAD_INIT(0, 0) + "common.kalman.simple_kalman_impl.KF1D", /*tp_name*/ + sizeof(struct __pyx_obj_6common_6kalman_18simple_kalman_impl_KF1D), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6common_6kalman_18simple_kalman_impl_KF1D, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6common_6kalman_18simple_kalman_impl_KF1D, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6common_6kalman_18simple_kalman_impl_KF1D, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6common_6kalman_18simple_kalman_impl_4KF1D_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6common_6kalman_18simple_kalman_impl_KF1D, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_simple_kalman_impl(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_simple_kalman_impl}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "simple_kalman_impl", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1}, + {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0x34, __pyx_k_Incompatible_checksums_s_vs_0x34, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x34), 0, 0, 1, 0}, + {&__pyx_n_s_K, __pyx_k_K, sizeof(__pyx_k_K), 0, 0, 1, 1}, + {&__pyx_n_s_KF1D, __pyx_k_KF1D, sizeof(__pyx_k_KF1D), 0, 0, 1, 1}, + {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_common_kalman_simple_kalman_impl, __pyx_k_common_kalman_simple_kalman_impl, sizeof(__pyx_k_common_kalman_simple_kalman_impl), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_KF1D, __pyx_k_pyx_unpickle_KF1D, sizeof(__pyx_k_pyx_unpickle_KF1D), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_n_s_x0, __pyx_k_x0, sizeof(__pyx_k_x0), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + return 0; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "(tree fragment)":1 + * def __pyx_unpickle_KF1D(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_tuple_ = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple_)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_KF1D, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_54762874 = PyInt_FromLong(54762874L); if (unlikely(!__pyx_int_54762874)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6common_6kalman_18simple_kalman_impl_KF1D) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6common_6kalman_18simple_kalman_impl_KF1D.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6common_6kalman_18simple_kalman_impl_KF1D.tp_dictoffset && __pyx_type_6common_6kalman_18simple_kalman_impl_KF1D.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6common_6kalman_18simple_kalman_impl_KF1D.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_KF1D, (PyObject *)&__pyx_type_6common_6kalman_18simple_kalman_impl_KF1D) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6common_6kalman_18simple_kalman_impl_KF1D) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_ptype_6common_6kalman_18simple_kalman_impl_KF1D = &__pyx_type_6common_6kalman_18simple_kalman_impl_KF1D; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initsimple_kalman_impl(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initsimple_kalman_impl(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_simple_kalman_impl(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_simple_kalman_impl(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_simple_kalman_impl(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'simple_kalman_impl' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_simple_kalman_impl(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("simple_kalman_impl", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_common__kalman__simple_kalman_impl) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "common.kalman.simple_kalman_impl")) { + if (unlikely(PyDict_SetItemString(modules, "common.kalman.simple_kalman_impl", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "(tree fragment)":1 + * def __pyx_unpickle_KF1D(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_6kalman_18simple_kalman_impl_1__pyx_unpickle_KF1D, NULL, __pyx_n_s_common_kalman_simple_kalman_impl); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_KF1D, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/kalman/simple_kalman_impl.pyx":1 + * # distutils: language = c++ # <<<<<<<<<<<<<< + * # cython: language_level=3 + * + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init common.kalman.simple_kalman_impl", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init common.kalman.simple_kalman_impl"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (__Pyx_PyFastCFunction_Check(func)) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* HasAttr */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* SetupReduce */ +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#else + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#endif +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); + if (likely(reduce_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (reduce == object_reduce || PyErr_Occurred()) { + goto __PYX_BAD; + } + setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); + if (likely(setstate_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (!setstate || PyErr_Occurred()) { + goto __PYX_BAD; + } + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto __PYX_GOOD; +__PYX_BAD: + if (!PyErr_Occurred()) + PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +__PYX_GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; ip) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/common/kalman/simple_kalman_impl.pxd b/common/kalman/simple_kalman_impl.pxd new file mode 100644 index 000000000..cb39a45bc --- /dev/null +++ b/common/kalman/simple_kalman_impl.pxd @@ -0,0 +1,18 @@ +# cython: language_level = 3 + +cdef class KF1D: + cdef public: + double x0_0 + double x1_0 + double K0_0 + double K1_0 + double A0_0 + double A0_1 + double A1_0 + double A1_1 + double C0_0 + double C0_1 + double A_K_0 + double A_K_1 + double A_K_2 + double A_K_3 diff --git a/common/kalman/simple_kalman_impl.pyx b/common/kalman/simple_kalman_impl.pyx new file mode 100644 index 000000000..16aefba2e --- /dev/null +++ b/common/kalman/simple_kalman_impl.pyx @@ -0,0 +1,37 @@ +# distutils: language = c++ +# cython: language_level=3 + +cdef class KF1D: + def __init__(self, x0, A, C, K): + self.x0_0 = x0[0][0] + self.x1_0 = x0[1][0] + self.A0_0 = A[0][0] + self.A0_1 = A[0][1] + self.A1_0 = A[1][0] + self.A1_1 = A[1][1] + self.C0_0 = C[0] + self.C0_1 = C[1] + self.K0_0 = K[0][0] + self.K1_0 = K[1][0] + + self.A_K_0 = self.A0_0 - self.K0_0 * self.C0_0 + self.A_K_1 = self.A0_1 - self.K0_0 * self.C0_1 + self.A_K_2 = self.A1_0 - self.K1_0 * self.C0_0 + self.A_K_3 = self.A1_1 - self.K1_0 * self.C0_1 + + def update(self, meas): + cdef double x0_0 = self.A_K_0 * self.x0_0 + self.A_K_1 * self.x1_0 + self.K0_0 * meas + cdef double x1_0 = self.A_K_2 * self.x0_0 + self.A_K_3 * self.x1_0 + self.K1_0 * meas + self.x0_0 = x0_0 + self.x1_0 = x1_0 + + return [self.x0_0, self.x1_0] + + @property + def x(self): + return [[self.x0_0], [self.x1_0]] + + @x.setter + def x(self, x): + self.x0_0 = x[0][0] + self.x1_0 = x[1][0] diff --git a/common/kalman/simple_kalman_impl.so b/common/kalman/simple_kalman_impl.so new file mode 100755 index 000000000..4fb04cb93 Binary files /dev/null and b/common/kalman/simple_kalman_impl.so differ diff --git a/common/kalman/simple_kalman_old.py b/common/kalman/simple_kalman_old.py new file mode 100644 index 000000000..d11770faf --- /dev/null +++ b/common/kalman/simple_kalman_old.py @@ -0,0 +1,23 @@ +import numpy as np + + +class KF1D: + # this EKF assumes constant covariance matrix, so calculations are much simpler + # the Kalman gain also needs to be precomputed using the control module + + def __init__(self, x0, A, C, K): + self.x = x0 + self.A = A + self.C = np.atleast_2d(C) + self.K = K + + self.A_K = self.A - np.dot(self.K, self.C) + + # K matrix needs to be pre-computed as follow: + # import control + # (x, l, K) = control.dare(np.transpose(self.A), np.transpose(self.C), Q, R) + # self.K = np.transpose(K) + + def update(self, meas): + self.x = np.dot(self.A_K, self.x) + np.dot(self.K, meas) + return self.x diff --git a/common/kalman/tests/__init__.py b/common/kalman/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/common/kalman/tests/test_simple_kalman.py b/common/kalman/tests/test_simple_kalman.py new file mode 100644 index 000000000..7b327918a --- /dev/null +++ b/common/kalman/tests/test_simple_kalman.py @@ -0,0 +1,87 @@ +import unittest +import random +import timeit +import numpy as np + +from common.kalman.simple_kalman import KF1D +from common.kalman.simple_kalman_old import KF1D as KF1D_old + + +class TestSimpleKalman(unittest.TestCase): + def setUp(self): + dt = 0.01 + x0_0 = 0.0 + x1_0 = 0.0 + A0_0 = 1.0 + A0_1 = dt + A1_0 = 0.0 + A1_1 = 1.0 + C0_0 = 1.0 + C0_1 = 0.0 + K0_0 = 0.12287673 + K1_0 = 0.29666309 + + self.kf_old = KF1D_old(x0=np.array([[x0_0], [x1_0]]), + A=np.array([[A0_0, A0_1], [A1_0, A1_1]]), + C=np.array([C0_0, C0_1]), + K=np.array([[K0_0], [K1_0]])) + + self.kf = KF1D(x0=[[x0_0], [x1_0]], + A=[[A0_0, A0_1], [A1_0, A1_1]], + C=[C0_0, C0_1], + K=[[K0_0], [K1_0]]) + + def test_getter_setter(self): + self.kf.x = [[1.0], [1.0]] + self.assertEqual(self.kf.x, [[1.0], [1.0]]) + + def update_returns_state(self): + x = self.kf.update(100) + self.assertEqual(x, self.kf.x) + + def test_old_equal_new(self): + for _ in range(1000): + v_wheel = random.uniform(0, 200) + + x_old = self.kf_old.update(v_wheel) + x = self.kf.update(v_wheel) + + # Compare the output x, verify that the error is less than 1e-4 + np.testing.assert_almost_equal(x_old[0], x[0]) + np.testing.assert_almost_equal(x_old[1], x[1]) + + def test_new_is_faster(self): + setup = """ +import numpy as np + +from common.kalman.simple_kalman import KF1D +from common.kalman.simple_kalman_old import KF1D as KF1D_old + +dt = 0.01 +x0_0 = 0.0 +x1_0 = 0.0 +A0_0 = 1.0 +A0_1 = dt +A1_0 = 0.0 +A1_1 = 1.0 +C0_0 = 1.0 +C0_1 = 0.0 +K0_0 = 0.12287673 +K1_0 = 0.29666309 + +kf_old = KF1D_old(x0=np.array([[x0_0], [x1_0]]), + A=np.array([[A0_0, A0_1], [A1_0, A1_1]]), + C=np.array([C0_0, C0_1]), + K=np.array([[K0_0], [K1_0]])) + +kf = KF1D(x0=[[x0_0], [x1_0]], + A=[[A0_0, A0_1], [A1_0, A1_1]], + C=[C0_0, C0_1], + K=[[K0_0], [K1_0]]) + """ + kf_speed = timeit.timeit("kf.update(1234)", setup=setup, number=10000) + kf_old_speed = timeit.timeit("kf_old.update(1234)", setup=setup, number=10000) + self.assertTrue(kf_speed < kf_old_speed / 4) + +if __name__ == "__main__": + unittest.main() diff --git a/common/logging_extra.py b/common/logging_extra.py new file mode 100644 index 000000000..d3a75d0f4 --- /dev/null +++ b/common/logging_extra.py @@ -0,0 +1,235 @@ +import io +import os +import sys +import copy +import json +import uuid +import socket +import logging +import traceback +from threading import local +from collections import OrderedDict +from contextlib import contextmanager + +def json_handler(obj): + # if isinstance(obj, (datetime.date, datetime.time)): + # return obj.isoformat() + return repr(obj) + +def json_robust_dumps(obj): + return json.dumps(obj, default=json_handler) + +class NiceOrderedDict(OrderedDict): + def __str__(self): + return json_robust_dumps(self) + +class SwagFormatter(logging.Formatter): + def __init__(self, swaglogger): + logging.Formatter.__init__(self, None, '%a %b %d %H:%M:%S %Z %Y') + + self.swaglogger = swaglogger + self.host = socket.gethostname() + + def format_dict(self, record): + record_dict = NiceOrderedDict() + + if isinstance(record.msg, dict): + record_dict['msg'] = record.msg + else: + try: + record_dict['msg'] = record.getMessage() + except (ValueError, TypeError): + record_dict['msg'] = [record.msg]+record.args + + record_dict['ctx'] = self.swaglogger.get_ctx() + + if record.exc_info: + record_dict['exc_info'] = self.formatException(record.exc_info) + + record_dict['level'] = record.levelname + record_dict['levelnum'] = record.levelno + record_dict['name'] = record.name + record_dict['filename'] = record.filename + record_dict['lineno'] = record.lineno + record_dict['pathname'] = record.pathname + record_dict['module'] = record.module + record_dict['funcName'] = record.funcName + record_dict['host'] = self.host + record_dict['process'] = record.process + record_dict['thread'] = record.thread + record_dict['threadName'] = record.threadName + record_dict['created'] = record.created + + return record_dict + + def format(self, record): + if self.swaglogger is None: + raise Exception("must set swaglogger before calling format()") + return json_robust_dumps(self.format_dict(record)) + +class SwagLogFileFormatter(SwagFormatter): + def fix_kv(self, k, v): + # append type to names to preserve legacy naming in logs + # avoids overlapping key namespaces with different types + # e.g. log.info() creates 'msg' -> 'msg$s' + # log.event() creates 'msg.health.logMonoTime' -> 'msg.health.logMonoTime$i' + # because overlapping namespace 'msg' caused problems + if isinstance(v, (str, bytes)): + k += "$s" + elif isinstance(v, float): + k += "$f" + elif isinstance(v, bool): + k += "$b" + elif isinstance(v, int): + k += "$i" + elif isinstance(v, dict): + nv = {} + for ik, iv in v.items(): + ik, iv = self.fix_kv(ik, iv) + nv[ik] = iv + v = nv + elif isinstance(v, list): + k += "$a" + return k, v + + def format(self, record): + if isinstance(record, str): + v = json.loads(record) + else: + v = self.format_dict(record) + + mk, mv = self.fix_kv('msg', v['msg']) + del v['msg'] + v[mk] = mv + v['id'] = uuid.uuid4().hex + + return json_robust_dumps(v) + +class SwagErrorFilter(logging.Filter): + def filter(self, record): + return record.levelno < logging.ERROR + +def _tmpfunc(): + return 0 + +def _srcfile(): + return os.path.normcase(_tmpfunc.__code__.co_filename) + +class SwagLogger(logging.Logger): + def __init__(self): + logging.Logger.__init__(self, "swaglog") + + self.global_ctx = {} + + self.log_local = local() + self.log_local.ctx = {} + + def local_ctx(self): + try: + return self.log_local.ctx + except AttributeError: + self.log_local.ctx = {} + return self.log_local.ctx + + def get_ctx(self): + return dict(self.local_ctx(), **self.global_ctx) + + @contextmanager + def ctx(self, **kwargs): + old_ctx = self.local_ctx() + self.log_local.ctx = copy.copy(old_ctx) or {} + self.log_local.ctx.update(kwargs) + try: + yield + finally: + self.log_local.ctx = old_ctx + + def bind(self, **kwargs): + self.local_ctx().update(kwargs) + + def bind_global(self, **kwargs): + self.global_ctx.update(kwargs) + + def event(self, event_name, *args, **kwargs): + evt = NiceOrderedDict() + evt['event'] = event_name + if args: + evt['args'] = args + evt.update(kwargs) + if 'error' in kwargs: + self.error(evt) + elif 'debug' in kwargs: + self.debug(evt) + else: + self.info(evt) + + def findCaller(self, stack_info=False, stacklevel=1): + """ + Find the stack frame of the caller so that we can note the source + file name, line number and function name. + """ + f = sys._getframe(3) + #On some versions of IronPython, currentframe() returns None if + #IronPython isn't run with -X:Frames. + if f is not None: + f = f.f_back + orig_f = f + while f and stacklevel > 1: + f = f.f_back + stacklevel -= 1 + if not f: + f = orig_f + rv = "(unknown file)", 0, "(unknown function)", None + while hasattr(f, "f_code"): + co = f.f_code + filename = os.path.normcase(co.co_filename) + + # TODO: is this pylint exception correct? + if filename == _srcfile: # pylint: disable=comparison-with-callable + f = f.f_back + continue + sinfo = None + if stack_info: + sio = io.StringIO() + sio.write('Stack (most recent call last):\n') + traceback.print_stack(f, file=sio) + sinfo = sio.getvalue() + if sinfo[-1] == '\n': + sinfo = sinfo[:-1] + sio.close() + rv = (co.co_filename, f.f_lineno, co.co_name, sinfo) + break + return rv + +if __name__ == "__main__": + log = SwagLogger() + + stdout_handler = logging.StreamHandler(sys.stdout) + stdout_handler.setLevel(logging.INFO) + stdout_handler.addFilter(SwagErrorFilter()) + log.addHandler(stdout_handler) + + stderr_handler = logging.StreamHandler(sys.stderr) + stderr_handler.setLevel(logging.ERROR) + log.addHandler(stderr_handler) + + log.info("asdasd %s", "a") + log.info({'wut': 1}) + log.warning("warning") + log.error("error") + log.critical("critical") + log.event("test", x="y") + + with log.ctx(): + stdout_handler.setFormatter(SwagFormatter(log)) + stderr_handler.setFormatter(SwagFormatter(log)) + log.bind(user="some user") + log.info("in req") + print("") + log.warning("warning") + print("") + log.error("error") + print("") + log.critical("critical") + print("") + log.event("do_req", a=1, b="c") diff --git a/common/markdown.py b/common/markdown.py new file mode 100755 index 000000000..30c5bc2c0 --- /dev/null +++ b/common/markdown.py @@ -0,0 +1,48 @@ +from typing import List + +HTML_REPLACEMENTS = [ + (r'&', r'&'), + (r'"', r'"'), +] + + +def parse_markdown(text: str, tab_length: int = 2) -> str: + lines = text.split("\n") + output: List[str] = [] + list_level = 0 + + def end_outstanding_lists(level: int, end_level: int) -> int: + while level > end_level: + level -= 1 + output.append("") + if level > 0: + output.append("") + return end_level + + for i, line in enumerate(lines): + if i + 1 < len(lines) and lines[i + 1].startswith("==="): # heading + output.append(f"

{line}

") + elif line.startswith("==="): + pass + elif line.lstrip().startswith("* "): # list + line_level = 1 + line.count(" " * tab_length, 0, line.index("*")) + if list_level >= line_level: + list_level = end_outstanding_lists(list_level, line_level) + else: + list_level += 1 + if list_level > 1: + output[-1] = output[-1].replace("", "") + output.append("
    ") + output.append(f"
  • {line.replace('*', '', 1).lstrip()}
  • ") + else: + list_level = end_outstanding_lists(list_level, 0) + if len(line) > 0: + output.append(line) + + end_outstanding_lists(list_level, 0) + output_str = "\n".join(output) + "\n" + + for (fr, to) in HTML_REPLACEMENTS: + output_str = output_str.replace(fr, to) + + return output_str diff --git a/common/numpy_fast.py b/common/numpy_fast.py new file mode 100644 index 000000000..878c0005c --- /dev/null +++ b/common/numpy_fast.py @@ -0,0 +1,19 @@ +def clip(x, lo, hi): + return max(lo, min(hi, x)) + +def interp(x, xp, fp): + N = len(xp) + + def get_interp(xv): + hi = 0 + while hi < N and xv > xp[hi]: + hi += 1 + low = hi - 1 + return fp[-1] if hi == N and xv > xp[low] else ( + fp[0] if hi == 0 else + (xv - xp[low]) * (fp[hi] - fp[low]) / (xp[hi] - xp[low]) + fp[low]) + + return [get_interp(v) for v in x] if hasattr(x, '__iter__') else get_interp(x) + +def mean(x): + return sum(x) / len(x) diff --git a/common/params.py b/common/params.py new file mode 100644 index 000000000..2cfca3712 --- /dev/null +++ b/common/params.py @@ -0,0 +1,19 @@ +from common.params_pyx import Params, ParamKeyType, UnknownKeyName, put_nonblocking # pylint: disable=no-name-in-module, import-error +assert Params +assert ParamKeyType +assert UnknownKeyName +assert put_nonblocking + +if __name__ == "__main__": + import sys + + params = Params() + key = sys.argv[1] + assert params.check_key(key), f"unknown param: {key}" + + if len(sys.argv) == 3: + val = sys.argv[2] + print(f"SET: {key} = {val}") + params.put(key, val) + elif len(sys.argv) == 2: + print(f"GET: {key} = {params.get(key)}") diff --git a/common/params_pyx.cpp b/common/params_pyx.cpp new file mode 100644 index 000000000..6f9295aed --- /dev/null +++ b/common/params_pyx.cpp @@ -0,0 +1,10606 @@ +/* Generated by Cython 0.29.26 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "selfdrive/common/params.h" + ], + "language": "c++", + "name": "common.params_pyx", + "sources": [ + "/data/openpilot/common/params_pyx.pyx" + ] + }, + "module_name": "common.params_pyx" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_26" +#define CYTHON_HEX_VERSION 0x001D1AF0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } + private: + T *ptr; +}; + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject* co=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(0))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too; + if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here + if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too; + Py_XDECREF((PyObject*)co); + co = (PyCodeObject*)call_result; + call_result = NULL; + if (0) { + cleanup_code_too: + Py_XDECREF((PyObject*)co); + co = NULL; + } + end: + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(call_result); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return co; + } +#else + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if defined(PyUnicode_IS_READY) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #else + #define __Pyx_PyUnicode_READY(op) (0) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__common__params_pyx +#define __PYX_HAVE_API__common__params_pyx +/* Early includes */ +#include +#include +#include "ios" +#include "new" +#include "stdexcept" +#include "typeinfo" +#include "selfdrive/common/params.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "common/params_pyx.pyx", + "stringsource", +}; +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6common_10params_pyx_Params; +struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking; +struct __pyx_obj___Pyx_EnumMeta; + +/* "common/params_pyx.pyx":32 + * pass + * + * cdef class Params: # <<<<<<<<<<<<<< + * cdef c_Params* p + * + */ +struct __pyx_obj_6common_10params_pyx_Params { + PyObject_HEAD + Params *p; +}; + + +/* "common/params_pyx.pyx":97 + * self.p.remove(k) + * + * def put_nonblocking(key, val, d=""): # <<<<<<<<<<<<<< + * def f(key, val): + * params = Params(d) + */ +struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking { + PyObject_HEAD + PyObject *__pyx_v_d; +}; + + +/* "EnumBase":15 + * + * @cython.internal + * cdef class __Pyx_EnumMeta(type): # <<<<<<<<<<<<<< + * def __init__(cls, name, parents, dct): + * type.__init__(cls, name, parents, dct) + */ +struct __pyx_obj___Pyx_EnumMeta { + PyHeapTypeObject __pyx_base; +}; + + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if CYTHON_FAST_PYCALL + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif // CYTHON_FAST_PYCALL +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + size_t defaults_size; // used by FusedFunction for copying defaults + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* IncludeStringH.proto */ +#include + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CalculateMetaclass.proto */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +/* Py3ClassCreate.proto */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); + +/* SetNameInClass.proto */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) +#elif CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) +#else +#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) +#endif + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* GCCDiagnostics.proto */ +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ParamKeyType(enum ParamKeyType value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE enum ParamKeyType __Pyx_PyInt_As_enum__ParamKeyType(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + + +/* Module declarations from 'libcpp' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libcpp.string' */ + +/* Module declarations from 'common.params_pyx' */ +static PyTypeObject *__pyx_ptype_6common_10params_pyx_Params = 0; +static PyTypeObject *__pyx_ptype_6common_10params_pyx___pyx_scope_struct__put_nonblocking = 0; +static PyTypeObject *__pyx_ptype___Pyx_EnumMeta = 0; +static PyObject *__Pyx_OrderedDict = 0; +static PyObject *__Pyx_EnumBase = 0; +static PyObject *__Pyx_globals = 0; +static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/ +static PyObject *__pyx_unpickle___Pyx_EnumMeta__set_state(struct __pyx_obj___Pyx_EnumMeta *, PyObject *); /*proto*/ +#define __Pyx_MODULE_NAME "common.params_pyx" +extern int __pyx_module_is_main_common__params_pyx; +int __pyx_module_is_main_common__params_pyx = 0; + +/* Implementation of 'common.params_pyx' */ +static PyObject *__pyx_builtin_KeyboardInterrupt; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_ValueError; +static const char __pyx_k_[] = ""; +static const char __pyx_k_d[] = "d"; +static const char __pyx_k_f[] = "f"; +static const char __pyx_k_k[] = "k"; +static const char __pyx_k_t[] = "t"; +static const char __pyx_k_v[] = "v"; +static const char __pyx_k_ALL[] = "ALL"; +static const char __pyx_k_cls[] = "cls"; +static const char __pyx_k_dat[] = "dat"; +static const char __pyx_k_dct[] = "dct"; +static const char __pyx_k_doc[] = "__doc__"; +static const char __pyx_k_key[] = "key"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_put[] = "put"; +static const char __pyx_k_res[] = "res"; +static const char __pyx_k_s_s[] = "%s.%s"; +static const char __pyx_k_str[] = "__str__"; +static const char __pyx_k_val[] = "val"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_enum[] = "enum"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "name"; +static const char __pyx_k_repr[] = "__repr__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_block[] = "block"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_s_s_d[] = "<%s.%s: %d>"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_Params[] = "Params"; +static const char __pyx_k_Thread[] = "Thread"; +static const char __pyx_k_decode[] = "decode"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_module[] = "__module__"; +static const char __pyx_k_name_2[] = "__name__"; +static const char __pyx_k_params[] = "params"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_target[] = "target"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_values[] = "values"; +static const char __pyx_k_IntEnum[] = "IntEnum"; +static const char __pyx_k_members[] = "__members__"; +static const char __pyx_k_parents[] = "parents"; +static const char __pyx_k_prepare[] = "__prepare__"; +static const char __pyx_k_tx_type[] = "tx_type"; +static const char __pyx_k_EnumBase[] = "EnumBase"; +static const char __pyx_k_EnumType[] = "EnumType"; +static const char __pyx_k_encoding[] = "encoding"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_check_key[] = "check_key"; +static const char __pyx_k_metaclass[] = "__metaclass__"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_threading[] = "threading"; +static const char __pyx_k_PERSISTENT[] = "PERSISTENT"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_pyx_result[] = "__pyx_result"; +static const char __pyx_k_OrderedDict[] = "OrderedDict"; +static const char __pyx_k_PickleError[] = "PickleError"; +static const char __pyx_k_collections[] = "collections"; +static const char __pyx_k_ParamKeyType[] = "ParamKeyType"; +static const char __pyx_k_Pyx_EnumBase[] = "__Pyx_EnumBase"; +static const char __pyx_k_ensure_bytes[] = "ensure_bytes"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_stringsource[] = "stringsource"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_UnknownKeyName[] = "UnknownKeyName"; +static const char __pyx_k_put_nonblocking[] = "put_nonblocking"; +static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_KeyboardInterrupt[] = "KeyboardInterrupt"; +static const char __pyx_k_common_params_pyx[] = "common.params_pyx"; +static const char __pyx_k_Pyx_EnumBase___new[] = "__Pyx_EnumBase.__new__"; +static const char __pyx_k_Pyx_EnumBase___str[] = "__Pyx_EnumBase.__str__"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_Pyx_EnumBase___repr[] = "__Pyx_EnumBase.__repr__"; +static const char __pyx_k_CLEAR_ON_IGNITION_ON[] = "CLEAR_ON_IGNITION_ON"; +static const char __pyx_k_Unknown_enum_value_s[] = "Unknown enum value: '%s'"; +static const char __pyx_k_CLEAR_ON_IGNITION_OFF[] = "CLEAR_ON_IGNITION_OFF"; +static const char __pyx_k_common_params_pyx_pyx[] = "common/params_pyx.pyx"; +static const char __pyx_k_CLEAR_ON_MANAGER_START[] = "CLEAR_ON_MANAGER_START"; +static const char __pyx_k_put_nonblocking_locals_f[] = "put_nonblocking..f"; +static const char __pyx_k_pyx_unpickle___Pyx_EnumMeta[] = "__pyx_unpickle___Pyx_EnumMeta"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xd4[] = "Incompatible checksums (%s vs 0xd41d8cd = ())"; +static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +static PyObject *__pyx_kp_u_; +static PyObject *__pyx_n_s_ALL; +static PyObject *__pyx_n_s_CLEAR_ON_IGNITION_OFF; +static PyObject *__pyx_n_s_CLEAR_ON_IGNITION_ON; +static PyObject *__pyx_n_s_CLEAR_ON_MANAGER_START; +static PyObject *__pyx_n_s_EnumBase; +static PyObject *__pyx_n_s_EnumType; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xd4; +static PyObject *__pyx_n_s_IntEnum; +static PyObject *__pyx_n_s_KeyboardInterrupt; +static PyObject *__pyx_n_s_OrderedDict; +static PyObject *__pyx_n_s_PERSISTENT; +static PyObject *__pyx_n_s_ParamKeyType; +static PyObject *__pyx_n_s_Params; +static PyObject *__pyx_n_s_PickleError; +static PyObject *__pyx_n_s_Pyx_EnumBase; +static PyObject *__pyx_n_s_Pyx_EnumBase___new; +static PyObject *__pyx_n_s_Pyx_EnumBase___repr; +static PyObject *__pyx_n_s_Pyx_EnumBase___str; +static PyObject *__pyx_n_s_Thread; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_UnknownKeyName; +static PyObject *__pyx_kp_s_Unknown_enum_value_s; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_block; +static PyObject *__pyx_n_s_check_key; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_cls; +static PyObject *__pyx_n_s_collections; +static PyObject *__pyx_n_s_common_params_pyx; +static PyObject *__pyx_kp_s_common_params_pyx_pyx; +static PyObject *__pyx_n_s_d; +static PyObject *__pyx_n_s_dat; +static PyObject *__pyx_n_s_dct; +static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_encoding; +static PyObject *__pyx_n_s_ensure_bytes; +static PyObject *__pyx_n_s_enum; +static PyObject *__pyx_n_s_f; +static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_k; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_members; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; +static PyObject *__pyx_n_s_params; +static PyObject *__pyx_n_s_parents; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_put; +static PyObject *__pyx_n_s_put_nonblocking; +static PyObject *__pyx_n_s_put_nonblocking_locals_f; +static PyObject *__pyx_n_s_pyx_PickleError; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_result; +static PyObject *__pyx_n_s_pyx_state; +static PyObject *__pyx_n_s_pyx_type; +static PyObject *__pyx_n_s_pyx_unpickle___Pyx_EnumMeta; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_reduce_ex; +static PyObject *__pyx_n_s_repr; +static PyObject *__pyx_n_s_res; +static PyObject *__pyx_kp_s_s_s; +static PyObject *__pyx_kp_s_s_s_d; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_str; +static PyObject *__pyx_kp_s_stringsource; +static PyObject *__pyx_n_s_t; +static PyObject *__pyx_n_s_target; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_threading; +static PyObject *__pyx_n_s_tx_type; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_n_s_v; +static PyObject *__pyx_n_s_val; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_pf_6common_10params_pyx_ensure_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v); /* proto */ +static int __pyx_pf_6common_10params_pyx_6Params___cinit__(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_d); /* proto */ +static void __pyx_pf_6common_10params_pyx_6Params_2__dealloc__(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6common_10params_pyx_6Params_4clear_all(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_tx_type); /* proto */ +static PyObject *__pyx_pf_6common_10params_pyx_6Params_6check_key(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ +static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key, bool __pyx_v_block, PyObject *__pyx_v_encoding); /* proto */ +static PyObject *__pyx_pf_6common_10params_pyx_6Params_10get_bool(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ +static PyObject *__pyx_pf_6common_10params_pyx_6Params_12put(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_dat); /* proto */ +static PyObject *__pyx_pf_6common_10params_pyx_6Params_14put_bool(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key, bool __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6common_10params_pyx_6Params_16delete(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ +static PyObject *__pyx_pf_6common_10params_pyx_6Params_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6common_10params_pyx_6Params_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_6common_10params_pyx_15put_nonblocking_f(PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6common_10params_pyx_2put_nonblocking(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val, PyObject *__pyx_v_d); /* proto */ +static int __pyx_pf_8EnumBase_14__Pyx_EnumMeta___init__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_parents, PyObject *__pyx_v_dct); /* proto */ +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_2__iter__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls); /* proto */ +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_4__getitem__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_6__reduce_cython__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_8__setstate_cython__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_value, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase_4__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_8EnumBase___pyx_unpickle___Pyx_EnumMeta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_6common_10params_pyx_Params(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6common_10params_pyx___pyx_scope_struct__put_nonblocking(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new___Pyx_EnumMeta(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_222419149; +static PyObject *__pyx_k__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__15; +static PyObject *__pyx_codeobj__17; +static PyObject *__pyx_codeobj__19; +/* Late includes */ + +/* "common/params_pyx.pyx":26 + * + * + * def ensure_bytes(v): # <<<<<<<<<<<<<< + * return v.encode() if isinstance(v, str) else v; + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_10params_pyx_1ensure_bytes(PyObject *__pyx_self, PyObject *__pyx_v_v); /*proto*/ +static PyMethodDef __pyx_mdef_6common_10params_pyx_1ensure_bytes = {"ensure_bytes", (PyCFunction)__pyx_pw_6common_10params_pyx_1ensure_bytes, METH_O, 0}; +static PyObject *__pyx_pw_6common_10params_pyx_1ensure_bytes(PyObject *__pyx_self, PyObject *__pyx_v_v) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_bytes (wrapper)", 0); + __pyx_r = __pyx_pf_6common_10params_pyx_ensure_bytes(__pyx_self, ((PyObject *)__pyx_v_v)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_10params_pyx_ensure_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_bytes", 0); + + /* "common/params_pyx.pyx":27 + * + * def ensure_bytes(v): + * return v.encode() if isinstance(v, str) else v; # <<<<<<<<<<<<<< + * + * class UnknownKeyName(Exception): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyUnicode_Check(__pyx_v_v); + if ((__pyx_t_2 != 0)) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __Pyx_INCREF(__pyx_v_v); + __pyx_t_1 = __pyx_v_v; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "common/params_pyx.pyx":26 + * + * + * def ensure_bytes(v): # <<<<<<<<<<<<<< + * return v.encode() if isinstance(v, str) else v; + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("common.params_pyx.ensure_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/params_pyx.pyx":35 + * cdef c_Params* p + * + * def __cinit__(self, d=""): # <<<<<<<<<<<<<< + * cdef string path = d.encode() + * with nogil: + */ + +/* Python wrapper */ +static int __pyx_pw_6common_10params_pyx_6Params_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6common_10params_pyx_6Params_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_d = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_d,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_kp_u_); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 35, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_d = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 35, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("common.params_pyx.Params.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6common_10params_pyx_6Params___cinit__(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self), __pyx_v_d); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_10params_pyx_6Params___cinit__(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_d) { + std::string __pyx_v_path; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + std::string __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "common/params_pyx.pyx":36 + * + * def __cinit__(self, d=""): + * cdef string path = d.encode() # <<<<<<<<<<<<<< + * with nogil: + * self.p = new c_Params(path) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_path = ((std::string)__pyx_t_4); + + /* "common/params_pyx.pyx":37 + * def __cinit__(self, d=""): + * cdef string path = d.encode() + * with nogil: # <<<<<<<<<<<<<< + * self.p = new c_Params(path) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "common/params_pyx.pyx":38 + * cdef string path = d.encode() + * with nogil: + * self.p = new c_Params(path) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_v_self->p = new Params(__pyx_v_path); + } + + /* "common/params_pyx.pyx":37 + * def __cinit__(self, d=""): + * cdef string path = d.encode() + * with nogil: # <<<<<<<<<<<<<< + * self.p = new c_Params(path) + * + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "common/params_pyx.pyx":35 + * cdef c_Params* p + * + * def __cinit__(self, d=""): # <<<<<<<<<<<<<< + * cdef string path = d.encode() + * with nogil: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("common.params_pyx.Params.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/params_pyx.pyx":40 + * self.p = new c_Params(path) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del self.p + * + */ + +/* Python wrapper */ +static void __pyx_pw_6common_10params_pyx_6Params_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6common_10params_pyx_6Params_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6common_10params_pyx_6Params_2__dealloc__(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6common_10params_pyx_6Params_2__dealloc__(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "common/params_pyx.pyx":41 + * + * def __dealloc__(self): + * del self.p # <<<<<<<<<<<<<< + * + * def clear_all(self, tx_type=ParamKeyType.ALL): + */ + delete __pyx_v_self->p; + + /* "common/params_pyx.pyx":40 + * self.p = new c_Params(path) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del self.p + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "common/params_pyx.pyx":43 + * del self.p + * + * def clear_all(self, tx_type=ParamKeyType.ALL): # <<<<<<<<<<<<<< + * self.p.clearAll(tx_type) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_5clear_all(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_5clear_all(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_tx_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clear_all (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tx_type,0}; + PyObject* values[1] = {0}; + values[0] = __pyx_k__2; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tx_type); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clear_all") < 0)) __PYX_ERR(0, 43, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_tx_type = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("clear_all", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 43, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("common.params_pyx.Params.clear_all", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6common_10params_pyx_6Params_4clear_all(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self), __pyx_v_tx_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_10params_pyx_6Params_4clear_all(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_tx_type) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + enum ParamKeyType __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("clear_all", 0); + + /* "common/params_pyx.pyx":44 + * + * def clear_all(self, tx_type=ParamKeyType.ALL): + * self.p.clearAll(tx_type) # <<<<<<<<<<<<<< + * + * def check_key(self, key): + */ + __pyx_t_1 = ((enum ParamKeyType)__Pyx_PyInt_As_enum__ParamKeyType(__pyx_v_tx_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_v_self->p->clearAll(__pyx_t_1); + + /* "common/params_pyx.pyx":43 + * del self.p + * + * def clear_all(self, tx_type=ParamKeyType.ALL): # <<<<<<<<<<<<<< + * self.p.clearAll(tx_type) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.params_pyx.Params.clear_all", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/params_pyx.pyx":46 + * self.p.clearAll(tx_type) + * + * def check_key(self, key): # <<<<<<<<<<<<<< + * key = ensure_bytes(key) + * if not self.p.checkKey(key): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_7check_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_7check_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("check_key (wrapper)", 0); + __pyx_r = __pyx_pf_6common_10params_pyx_6Params_6check_key(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self), ((PyObject *)__pyx_v_key)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_10params_pyx_6Params_6check_key(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + std::string __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("check_key", 0); + __Pyx_INCREF(__pyx_v_key); + + /* "common/params_pyx.pyx":47 + * + * def check_key(self, key): + * key = ensure_bytes(key) # <<<<<<<<<<<<<< + * if not self.p.checkKey(key): + * raise UnknownKeyName(key) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "common/params_pyx.pyx":48 + * def check_key(self, key): + * key = ensure_bytes(key) + * if not self.p.checkKey(key): # <<<<<<<<<<<<<< + * raise UnknownKeyName(key) + * return key + */ + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_5 = ((!(__pyx_v_self->p->checkKey(__pyx_t_4) != 0)) != 0); + if (unlikely(__pyx_t_5)) { + + /* "common/params_pyx.pyx":49 + * key = ensure_bytes(key) + * if not self.p.checkKey(key): + * raise UnknownKeyName(key) # <<<<<<<<<<<<<< + * return key + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnknownKeyName); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 49, __pyx_L1_error) + + /* "common/params_pyx.pyx":48 + * def check_key(self, key): + * key = ensure_bytes(key) + * if not self.p.checkKey(key): # <<<<<<<<<<<<<< + * raise UnknownKeyName(key) + * return key + */ + } + + /* "common/params_pyx.pyx":50 + * if not self.p.checkKey(key): + * raise UnknownKeyName(key) + * return key # <<<<<<<<<<<<<< + * + * def get(self, key, bool block=False, encoding=None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_key); + __pyx_r = __pyx_v_key; + goto __pyx_L0; + + /* "common/params_pyx.pyx":46 + * self.p.clearAll(tx_type) + * + * def check_key(self, key): # <<<<<<<<<<<<<< + * key = ensure_bytes(key) + * if not self.p.checkKey(key): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("common.params_pyx.Params.check_key", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/params_pyx.pyx":52 + * return key + * + * def get(self, key, bool block=False, encoding=None): # <<<<<<<<<<<<<< + * cdef string k = self.check_key(key) + * cdef string val + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_9get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_9get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + bool __pyx_v_block; + PyObject *__pyx_v_encoding = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_block,&__pyx_n_s_encoding,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 52, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_key = values[0]; + if (values[1]) { + __pyx_v_block = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_block == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L3_error) + } else { + __pyx_v_block = ((bool)0); + } + __pyx_v_encoding = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("common.params_pyx.Params.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6common_10params_pyx_6Params_8get(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self), __pyx_v_key, __pyx_v_block, __pyx_v_encoding); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key, bool __pyx_v_block, PyObject *__pyx_v_encoding) { + std::string __pyx_v_k; + std::string __pyx_v_val; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + std::string __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get", 0); + + /* "common/params_pyx.pyx":53 + * + * def get(self, key, bool block=False, encoding=None): + * cdef string k = self.check_key(key) # <<<<<<<<<<<<<< + * cdef string val + * with nogil: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_k = __pyx_t_4; + + /* "common/params_pyx.pyx":55 + * cdef string k = self.check_key(key) + * cdef string val + * with nogil: # <<<<<<<<<<<<<< + * val = self.p.get(k, block) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "common/params_pyx.pyx":56 + * cdef string val + * with nogil: + * val = self.p.get(k, block) # <<<<<<<<<<<<<< + * + * if val == b"": + */ + __pyx_v_val = __pyx_v_self->p->get(__pyx_v_k, __pyx_v_block); + } + + /* "common/params_pyx.pyx":55 + * cdef string k = self.check_key(key) + * cdef string val + * with nogil: # <<<<<<<<<<<<<< + * val = self.p.get(k, block) + * + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "common/params_pyx.pyx":58 + * val = self.p.get(k, block) + * + * if val == b"": # <<<<<<<<<<<<<< + * if block: + * # If we got no value while running in blocked mode + */ + __pyx_t_5 = ((__pyx_v_val == ((char const *)"")) != 0); + if (__pyx_t_5) { + + /* "common/params_pyx.pyx":59 + * + * if val == b"": + * if block: # <<<<<<<<<<<<<< + * # If we got no value while running in blocked mode + * # it means we got an interrupt while waiting + */ + __pyx_t_5 = (__pyx_v_block != 0); + if (unlikely(__pyx_t_5)) { + + /* "common/params_pyx.pyx":62 + * # If we got no value while running in blocked mode + * # it means we got an interrupt while waiting + * raise KeyboardInterrupt # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_Raise(__pyx_builtin_KeyboardInterrupt, 0, 0, 0); + __PYX_ERR(0, 62, __pyx_L1_error) + + /* "common/params_pyx.pyx":59 + * + * if val == b"": + * if block: # <<<<<<<<<<<<<< + * # If we got no value while running in blocked mode + * # it means we got an interrupt while waiting + */ + } + + /* "common/params_pyx.pyx":64 + * raise KeyboardInterrupt + * else: + * return None # <<<<<<<<<<<<<< + * + * return val if encoding is None else val.decode(encoding) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "common/params_pyx.pyx":58 + * val = self.p.get(k, block) + * + * if val == b"": # <<<<<<<<<<<<<< + * if block: + * # If we got no value while running in blocked mode + */ + } + + /* "common/params_pyx.pyx":66 + * return None + * + * return val if encoding is None else val.decode(encoding) # <<<<<<<<<<<<<< + * + * def get_bool(self, key): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = (__pyx_v_encoding == Py_None); + if ((__pyx_t_5 != 0)) { + __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } else { + __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_encoding) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_encoding); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "common/params_pyx.pyx":52 + * return key + * + * def get(self, key, bool block=False, encoding=None): # <<<<<<<<<<<<<< + * cdef string k = self.check_key(key) + * cdef string val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("common.params_pyx.Params.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/params_pyx.pyx":68 + * return val if encoding is None else val.decode(encoding) + * + * def get_bool(self, key): # <<<<<<<<<<<<<< + * cdef string k = self.check_key(key) + * cdef bool r + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_11get_bool(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_11get_bool(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_bool (wrapper)", 0); + __pyx_r = __pyx_pf_6common_10params_pyx_6Params_10get_bool(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self), ((PyObject *)__pyx_v_key)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_10params_pyx_6Params_10get_bool(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key) { + std::string __pyx_v_k; + bool __pyx_v_r; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + std::string __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_bool", 0); + + /* "common/params_pyx.pyx":69 + * + * def get_bool(self, key): + * cdef string k = self.check_key(key) # <<<<<<<<<<<<<< + * cdef bool r + * with nogil: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_k = __pyx_t_4; + + /* "common/params_pyx.pyx":71 + * cdef string k = self.check_key(key) + * cdef bool r + * with nogil: # <<<<<<<<<<<<<< + * r = self.p.getBool(k) + * return r + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "common/params_pyx.pyx":72 + * cdef bool r + * with nogil: + * r = self.p.getBool(k) # <<<<<<<<<<<<<< + * return r + * + */ + __pyx_v_r = __pyx_v_self->p->getBool(__pyx_v_k); + } + + /* "common/params_pyx.pyx":71 + * cdef string k = self.check_key(key) + * cdef bool r + * with nogil: # <<<<<<<<<<<<<< + * r = self.p.getBool(k) + * return r + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "common/params_pyx.pyx":73 + * with nogil: + * r = self.p.getBool(k) + * return r # <<<<<<<<<<<<<< + * + * def put(self, key, dat): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "common/params_pyx.pyx":68 + * return val if encoding is None else val.decode(encoding) + * + * def get_bool(self, key): # <<<<<<<<<<<<<< + * cdef string k = self.check_key(key) + * cdef bool r + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("common.params_pyx.Params.get_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/params_pyx.pyx":75 + * return r + * + * def put(self, key, dat): # <<<<<<<<<<<<<< + * """ + * Warning: This function blocks until the param is written to disk! + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_13put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6common_10params_pyx_6Params_12put[] = "\n Warning: This function blocks until the param is written to disk!\n In very rare cases this can take over a second, and your code will hang.\n Use the put_nonblocking helper function in time sensitive code, but\n in general try to avoid writing params as much as possible.\n "; +static PyObject *__pyx_pw_6common_10params_pyx_6Params_13put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_dat = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_dat,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dat)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, 1); __PYX_ERR(0, 75, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 75, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = values[0]; + __pyx_v_dat = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 75, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("common.params_pyx.Params.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6common_10params_pyx_6Params_12put(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self), __pyx_v_key, __pyx_v_dat); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_10params_pyx_6Params_12put(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_dat) { + std::string __pyx_v_k; + std::string __pyx_v_dat_bytes; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + std::string __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("put", 0); + + /* "common/params_pyx.pyx":82 + * in general try to avoid writing params as much as possible. + * """ + * cdef string k = self.check_key(key) # <<<<<<<<<<<<<< + * cdef string dat_bytes = ensure_bytes(dat) + * with nogil: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_k = __pyx_t_4; + + /* "common/params_pyx.pyx":83 + * """ + * cdef string k = self.check_key(key) + * cdef string dat_bytes = ensure_bytes(dat) # <<<<<<<<<<<<<< + * with nogil: + * self.p.put(k, dat_bytes) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_dat) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dat); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dat_bytes = __pyx_t_4; + + /* "common/params_pyx.pyx":84 + * cdef string k = self.check_key(key) + * cdef string dat_bytes = ensure_bytes(dat) + * with nogil: # <<<<<<<<<<<<<< + * self.p.put(k, dat_bytes) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "common/params_pyx.pyx":85 + * cdef string dat_bytes = ensure_bytes(dat) + * with nogil: + * self.p.put(k, dat_bytes) # <<<<<<<<<<<<<< + * + * def put_bool(self, key, bool val): + */ + (void)(__pyx_v_self->p->put(__pyx_v_k, __pyx_v_dat_bytes)); + } + + /* "common/params_pyx.pyx":84 + * cdef string k = self.check_key(key) + * cdef string dat_bytes = ensure_bytes(dat) + * with nogil: # <<<<<<<<<<<<<< + * self.p.put(k, dat_bytes) + * + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "common/params_pyx.pyx":75 + * return r + * + * def put(self, key, dat): # <<<<<<<<<<<<<< + * """ + * Warning: This function blocks until the param is written to disk! + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("common.params_pyx.Params.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/params_pyx.pyx":87 + * self.p.put(k, dat_bytes) + * + * def put_bool(self, key, bool val): # <<<<<<<<<<<<<< + * cdef string k = self.check_key(key) + * with nogil: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_15put_bool(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_15put_bool(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + bool __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_val,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put_bool", 1, 2, 2, 1); __PYX_ERR(0, 87, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put_bool") < 0)) __PYX_ERR(0, 87, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = values[0]; + __pyx_v_val = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_val == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put_bool", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 87, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("common.params_pyx.Params.put_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6common_10params_pyx_6Params_14put_bool(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self), __pyx_v_key, __pyx_v_val); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_10params_pyx_6Params_14put_bool(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key, bool __pyx_v_val) { + std::string __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + std::string __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("put_bool", 0); + + /* "common/params_pyx.pyx":88 + * + * def put_bool(self, key, bool val): + * cdef string k = self.check_key(key) # <<<<<<<<<<<<<< + * with nogil: + * self.p.putBool(k, val) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_k = __pyx_t_4; + + /* "common/params_pyx.pyx":89 + * def put_bool(self, key, bool val): + * cdef string k = self.check_key(key) + * with nogil: # <<<<<<<<<<<<<< + * self.p.putBool(k, val) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "common/params_pyx.pyx":90 + * cdef string k = self.check_key(key) + * with nogil: + * self.p.putBool(k, val) # <<<<<<<<<<<<<< + * + * def delete(self, key): + */ + (void)(__pyx_v_self->p->putBool(__pyx_v_k, __pyx_v_val)); + } + + /* "common/params_pyx.pyx":89 + * def put_bool(self, key, bool val): + * cdef string k = self.check_key(key) + * with nogil: # <<<<<<<<<<<<<< + * self.p.putBool(k, val) + * + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "common/params_pyx.pyx":87 + * self.p.put(k, dat_bytes) + * + * def put_bool(self, key, bool val): # <<<<<<<<<<<<<< + * cdef string k = self.check_key(key) + * with nogil: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("common.params_pyx.Params.put_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/params_pyx.pyx":92 + * self.p.putBool(k, val) + * + * def delete(self, key): # <<<<<<<<<<<<<< + * cdef string k = self.check_key(key) + * with nogil: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_17delete(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_17delete(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("delete (wrapper)", 0); + __pyx_r = __pyx_pf_6common_10params_pyx_6Params_16delete(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self), ((PyObject *)__pyx_v_key)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_10params_pyx_6Params_16delete(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key) { + std::string __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + std::string __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("delete", 0); + + /* "common/params_pyx.pyx":93 + * + * def delete(self, key): + * cdef string k = self.check_key(key) # <<<<<<<<<<<<<< + * with nogil: + * self.p.remove(k) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_k = __pyx_t_4; + + /* "common/params_pyx.pyx":94 + * def delete(self, key): + * cdef string k = self.check_key(key) + * with nogil: # <<<<<<<<<<<<<< + * self.p.remove(k) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "common/params_pyx.pyx":95 + * cdef string k = self.check_key(key) + * with nogil: + * self.p.remove(k) # <<<<<<<<<<<<<< + * + * def put_nonblocking(key, val, d=""): + */ + (void)(__pyx_v_self->p->remove(__pyx_v_k)); + } + + /* "common/params_pyx.pyx":94 + * def delete(self, key): + * cdef string k = self.check_key(key) + * with nogil: # <<<<<<<<<<<<<< + * self.p.remove(k) + * + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "common/params_pyx.pyx":92 + * self.p.putBool(k, val) + * + * def delete(self, key): # <<<<<<<<<<<<<< + * cdef string k = self.check_key(key) + * with nogil: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("common.params_pyx.Params.delete", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_10params_pyx_6Params_18__reduce_cython__(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_10params_pyx_6Params_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.params_pyx.Params.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_10params_pyx_6Params_20__setstate_cython__(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_10params_pyx_6Params_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.params_pyx.Params.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/params_pyx.pyx":97 + * self.p.remove(k) + * + * def put_nonblocking(key, val, d=""): # <<<<<<<<<<<<<< + * def f(key, val): + * params = Params(d) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_10params_pyx_3put_nonblocking(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6common_10params_pyx_3put_nonblocking = {"put_nonblocking", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6common_10params_pyx_3put_nonblocking, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6common_10params_pyx_3put_nonblocking(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_d = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put_nonblocking (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_val,&__pyx_n_s_d,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)__pyx_kp_u_); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put_nonblocking", 0, 2, 3, 1); __PYX_ERR(0, 97, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put_nonblocking") < 0)) __PYX_ERR(0, 97, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_key = values[0]; + __pyx_v_val = values[1]; + __pyx_v_d = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put_nonblocking", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 97, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("common.params_pyx.put_nonblocking", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6common_10params_pyx_2put_nonblocking(__pyx_self, __pyx_v_key, __pyx_v_val, __pyx_v_d); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/params_pyx.pyx":98 + * + * def put_nonblocking(key, val, d=""): + * def f(key, val): # <<<<<<<<<<<<<< + * params = Params(d) + * cdef string k = ensure_bytes(key) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_10params_pyx_15put_nonblocking_1f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6common_10params_pyx_15put_nonblocking_1f = {"f", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6common_10params_pyx_15put_nonblocking_1f, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6common_10params_pyx_15put_nonblocking_1f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_val = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("f (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_val,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("f", 1, 2, 2, 1); __PYX_ERR(0, 98, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "f") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = values[0]; + __pyx_v_val = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("f", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 98, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("common.params_pyx.put_nonblocking.f", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6common_10params_pyx_15put_nonblocking_f(__pyx_self, __pyx_v_key, __pyx_v_val); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_10params_pyx_15put_nonblocking_f(PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { + struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *__pyx_cur_scope; + struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *__pyx_outer_scope; + struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_params = NULL; + std::string __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + std::string __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("f", 0); + __pyx_outer_scope = (struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "common/params_pyx.pyx":99 + * def put_nonblocking(key, val, d=""): + * def f(key, val): + * params = Params(d) # <<<<<<<<<<<<<< + * cdef string k = ensure_bytes(key) + * params.put(k, val) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_d)) { __Pyx_RaiseClosureNameError("d"); __PYX_ERR(0, 99, __pyx_L1_error) } + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6common_10params_pyx_Params), __pyx_cur_scope->__pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_params = ((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "common/params_pyx.pyx":100 + * def f(key, val): + * params = Params(d) + * cdef string k = ensure_bytes(key) # <<<<<<<<<<<<<< + * params.put(k, val) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_k = __pyx_t_4; + + /* "common/params_pyx.pyx":101 + * params = Params(d) + * cdef string k = ensure_bytes(key) + * params.put(k, val) # <<<<<<<<<<<<<< + * + * t = threading.Thread(target=f, args=(key, val)) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_params), __pyx_n_s_put); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_val}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_val}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3); + __Pyx_INCREF(__pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_val); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/params_pyx.pyx":98 + * + * def put_nonblocking(key, val, d=""): + * def f(key, val): # <<<<<<<<<<<<<< + * params = Params(d) + * cdef string k = ensure_bytes(key) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("common.params_pyx.put_nonblocking.f", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_params); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/params_pyx.pyx":97 + * self.p.remove(k) + * + * def put_nonblocking(key, val, d=""): # <<<<<<<<<<<<<< + * def f(key, val): + * params = Params(d) + */ + +static PyObject *__pyx_pf_6common_10params_pyx_2put_nonblocking(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val, PyObject *__pyx_v_d) { + struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *__pyx_cur_scope; + PyObject *__pyx_v_f = 0; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("put_nonblocking", 0); + __pyx_cur_scope = (struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *)__pyx_tp_new_6common_10params_pyx___pyx_scope_struct__put_nonblocking(__pyx_ptype_6common_10params_pyx___pyx_scope_struct__put_nonblocking, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 97, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_d = __pyx_v_d; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_d); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_d); + + /* "common/params_pyx.pyx":98 + * + * def put_nonblocking(key, val, d=""): + * def f(key, val): # <<<<<<<<<<<<<< + * params = Params(d) + * cdef string k = ensure_bytes(key) + */ + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6common_10params_pyx_15put_nonblocking_1f, 0, __pyx_n_s_put_nonblocking_locals_f, ((PyObject*)__pyx_cur_scope), __pyx_n_s_common_params_pyx, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_f = __pyx_t_1; + __pyx_t_1 = 0; + + /* "common/params_pyx.pyx":103 + * params.put(k, val) + * + * t = threading.Thread(target=f, args=(key, val)) # <<<<<<<<<<<<<< + * t.start() + * return t + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_threading); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Thread); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_target, __pyx_v_f) < 0) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); + __Pyx_INCREF(__pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_val); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_args, __pyx_t_3) < 0) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_t = __pyx_t_3; + __pyx_t_3 = 0; + + /* "common/params_pyx.pyx":104 + * + * t = threading.Thread(target=f, args=(key, val)) + * t.start() # <<<<<<<<<<<<<< + * return t + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "common/params_pyx.pyx":105 + * t = threading.Thread(target=f, args=(key, val)) + * t.start() + * return t # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_t); + __pyx_r = __pyx_v_t; + goto __pyx_L0; + + /* "common/params_pyx.pyx":97 + * self.p.remove(k) + * + * def put_nonblocking(key, val, d=""): # <<<<<<<<<<<<<< + * def f(key, val): + * params = Params(d) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("common.params_pyx.put_nonblocking", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + +static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) { + Py_ssize_t __pyx_v_length; + char const *__pyx_v_data; + std::string __pyx_r; + __Pyx_RefNannyDeclarations + char const *__pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0); + + /* "string.from_py":14 + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<< + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) + */ + __pyx_v_length = 0; + + /* "string.from_py":15 + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<< + * return string(data, length) + * + */ + __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(1, 15, __pyx_L1_error) + __pyx_v_data = __pyx_t_1; + + /* "string.from_py":16 + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = std::string(__pyx_v_data, __pyx_v_length); + goto __pyx_L0; + + /* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":31 + * + * @cname("__pyx_convert_PyObject_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0); + + /* "string.to_py":32 + * @cname("__pyx_convert_PyObject_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): + * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * cdef extern from *: + * cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":31 + * + * @cname("__pyx_convert_PyObject_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":37 + * + * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0); + + /* "string.to_py":38 + * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): + * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * cdef extern from *: + * cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":37 + * + * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":43 + * + * @cname("__pyx_convert_PyStr_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0); + + /* "string.to_py":44 + * @cname("__pyx_convert_PyStr_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): + * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * cdef extern from *: + * cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":43 + * + * @cname("__pyx_convert_PyStr_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":49 + * + * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0); + + /* "string.to_py":50 + * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): + * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * cdef extern from *: + * cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":49 + * + * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":55 + * + * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) + * + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0); + + /* "string.to_py":56 + * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): + * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":55 + * + * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "EnumBase":16 + * @cython.internal + * cdef class __Pyx_EnumMeta(type): + * def __init__(cls, name, parents, dct): # <<<<<<<<<<<<<< + * type.__init__(cls, name, parents, dct) + * cls.__members__ = __Pyx_OrderedDict() + */ + +/* Python wrapper */ +static int __pyx_pw_8EnumBase_14__Pyx_EnumMeta_1__init__(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_8EnumBase_14__Pyx_EnumMeta_1__init__(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_parents = 0; + PyObject *__pyx_v_dct = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_parents,&__pyx_n_s_dct,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parents)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(1, 16, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dct)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(1, 16, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_name = values[0]; + __pyx_v_parents = values[1]; + __pyx_v_dct = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 16, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta___init__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_cls), __pyx_v_name, __pyx_v_parents, __pyx_v_dct); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_8EnumBase_14__Pyx_EnumMeta___init__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_parents, PyObject *__pyx_v_dct) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "EnumBase":17 + * cdef class __Pyx_EnumMeta(type): + * def __init__(cls, name, parents, dct): + * type.__init__(cls, name, parents, dct) # <<<<<<<<<<<<<< + * cls.__members__ = __Pyx_OrderedDict() + * def __iter__(cls): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyType_Type)), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_cls), __pyx_v_name, __pyx_v_parents, __pyx_v_dct}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_cls), __pyx_v_name, __pyx_v_parents, __pyx_v_dct}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_cls)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cls)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_cls)); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_name); + __Pyx_INCREF(__pyx_v_parents); + __Pyx_GIVEREF(__pyx_v_parents); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_parents); + __Pyx_INCREF(__pyx_v_dct); + __Pyx_GIVEREF(__pyx_v_dct); + PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_dct); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumBase":18 + * def __init__(cls, name, parents, dct): + * type.__init__(cls, name, parents, dct) + * cls.__members__ = __Pyx_OrderedDict() # <<<<<<<<<<<<<< + * def __iter__(cls): + * return iter(cls.__members__.values()) + */ + __Pyx_INCREF(__Pyx_OrderedDict); + __pyx_t_2 = __Pyx_OrderedDict; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_members, __pyx_t_1) < 0) __PYX_ERR(1, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumBase":16 + * @cython.internal + * cdef class __Pyx_EnumMeta(type): + * def __init__(cls, name, parents, dct): # <<<<<<<<<<<<<< + * type.__init__(cls, name, parents, dct) + * cls.__members__ = __Pyx_OrderedDict() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "EnumBase":19 + * type.__init__(cls, name, parents, dct) + * cls.__members__ = __Pyx_OrderedDict() + * def __iter__(cls): # <<<<<<<<<<<<<< + * return iter(cls.__members__.values()) + * def __getitem__(cls, name): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_3__iter__(PyObject *__pyx_v_cls); /*proto*/ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_3__iter__(PyObject *__pyx_v_cls) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta_2__iter__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_cls)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_2__iter__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "EnumBase":20 + * cls.__members__ = __Pyx_OrderedDict() + * def __iter__(cls): + * return iter(cls.__members__.values()) # <<<<<<<<<<<<<< + * def __getitem__(cls, name): + * return cls.__members__[name] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_members); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "EnumBase":19 + * type.__init__(cls, name, parents, dct) + * cls.__members__ = __Pyx_OrderedDict() + * def __iter__(cls): # <<<<<<<<<<<<<< + * return iter(cls.__members__.values()) + * def __getitem__(cls, name): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "EnumBase":21 + * def __iter__(cls): + * return iter(cls.__members__.values()) + * def __getitem__(cls, name): # <<<<<<<<<<<<<< + * return cls.__members__[name] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_5__getitem__(PyObject *__pyx_v_cls, PyObject *__pyx_v_name); /*proto*/ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_5__getitem__(PyObject *__pyx_v_cls, PyObject *__pyx_v_name) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta_4__getitem__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_cls), ((PyObject *)__pyx_v_name)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_4__getitem__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls, PyObject *__pyx_v_name) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "EnumBase":22 + * return iter(cls.__members__.values()) + * def __getitem__(cls, name): + * return cls.__members__[name] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_members); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "EnumBase":21 + * def __iter__(cls): + * return iter(cls.__members__.values()) + * def __getitem__(cls, name): # <<<<<<<<<<<<<< + * return cls.__members__[name] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta_6__reduce_cython__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_6__reduce_cython__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_self) { + PyObject *__pyx_v_state = 0; + PyObject *__pyx_v__dict = 0; + int __pyx_v_use_setstate; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":5 + * cdef object _dict + * cdef bint use_setstate + * state = () # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_v_state = __pyx_empty_tuple; + + /* "(tree fragment)":6 + * cdef bint use_setstate + * state = () + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":7 + * state = () + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":8 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "(tree fragment)":9 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":7 + * state = () + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":11 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":12 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, None), state + * else: + */ + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":13 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, state) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle___Pyx_EnumMeta); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_222419149); + __Pyx_GIVEREF(__pyx_int_222419149); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":12 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, None), state + * else: + */ + } + + /* "(tree fragment)":15 + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, None), state + * else: + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle___Pyx_EnumMeta); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_222419149); + __Pyx_GIVEREF(__pyx_int_222419149); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":16 + * else: + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta_8__setstate_cython__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_8__setstate_cython__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":17 + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_unpickle___Pyx_EnumMeta__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "EnumBase":28 + * class __Pyx_EnumBase(int): + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): # <<<<<<<<<<<<<< + * for v in cls: + * if v == value: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_8EnumBase_14__Pyx_EnumBase_1__new__ = {"__new__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8EnumBase_14__Pyx_EnumBase_1__new__, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_value,&__pyx_n_s_name,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 3, 1); __PYX_ERR(1, 28, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(1, 28, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_value = values[1]; + __pyx_v_name = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 28, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("EnumBase.__Pyx_EnumBase.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumBase___new__(__pyx_self, __pyx_v_cls, __pyx_v_value, __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_value, PyObject *__pyx_v_name) { + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_v_res = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "EnumBase":29 + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): + * for v in cls: # <<<<<<<<<<<<<< + * if v == value: + * return v + */ + if (likely(PyList_CheckExact(__pyx_v_cls)) || PyTuple_CheckExact(__pyx_v_cls)) { + __pyx_t_1 = __pyx_v_cls; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_cls); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 29, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 29, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 29, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 29, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); + __pyx_t_4 = 0; + + /* "EnumBase":30 + * def __new__(cls, value, name=None): + * for v in cls: + * if v == value: # <<<<<<<<<<<<<< + * return v + * if name is None: + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_v, __pyx_v_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 30, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 30, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "EnumBase":31 + * for v in cls: + * if v == value: + * return v # <<<<<<<<<<<<<< + * if name is None: + * raise ValueError("Unknown enum value: '%s'" % value) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_v); + __pyx_r = __pyx_v_v; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + + /* "EnumBase":30 + * def __new__(cls, value, name=None): + * for v in cls: + * if v == value: # <<<<<<<<<<<<<< + * return v + * if name is None: + */ + } + + /* "EnumBase":29 + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): + * for v in cls: # <<<<<<<<<<<<<< + * if v == value: + * return v + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumBase":32 + * if v == value: + * return v + * if name is None: # <<<<<<<<<<<<<< + * raise ValueError("Unknown enum value: '%s'" % value) + * res = int.__new__(cls, value) + */ + __pyx_t_5 = (__pyx_v_name == Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (unlikely(__pyx_t_6)) { + + /* "EnumBase":33 + * return v + * if name is None: + * raise ValueError("Unknown enum value: '%s'" % value) # <<<<<<<<<<<<<< + * res = int.__new__(cls, value) + * res.name = name + */ + __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Unknown_enum_value_s, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 33, __pyx_L1_error) + + /* "EnumBase":32 + * if v == value: + * return v + * if name is None: # <<<<<<<<<<<<<< + * raise ValueError("Unknown enum value: '%s'" % value) + * res = int.__new__(cls, value) + */ + } + + /* "EnumBase":34 + * if name is None: + * raise ValueError("Unknown enum value: '%s'" % value) + * res = int.__new__(cls, value) # <<<<<<<<<<<<<< + * res.name = name + * setattr(cls, name, res) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyInt_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_cls, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 34, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_cls, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 34, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_INCREF(__pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_cls); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_value); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_res = __pyx_t_4; + __pyx_t_4 = 0; + + /* "EnumBase":35 + * raise ValueError("Unknown enum value: '%s'" % value) + * res = int.__new__(cls, value) + * res.name = name # <<<<<<<<<<<<<< + * setattr(cls, name, res) + * cls.__members__[name] = res + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_res, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(1, 35, __pyx_L1_error) + + /* "EnumBase":36 + * res = int.__new__(cls, value) + * res.name = name + * setattr(cls, name, res) # <<<<<<<<<<<<<< + * cls.__members__[name] = res + * return res + */ + __pyx_t_10 = PyObject_SetAttr(__pyx_v_cls, __pyx_v_name, __pyx_v_res); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 36, __pyx_L1_error) + + /* "EnumBase":37 + * res.name = name + * setattr(cls, name, res) + * cls.__members__[name] = res # <<<<<<<<<<<<<< + * return res + * def __repr__(self): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_members); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_v_name, __pyx_v_res) < 0)) __PYX_ERR(1, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "EnumBase":38 + * setattr(cls, name, res) + * cls.__members__[name] = res + * return res # <<<<<<<<<<<<<< + * def __repr__(self): + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "EnumBase":28 + * class __Pyx_EnumBase(int): + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): # <<<<<<<<<<<<<< + * for v in cls: + * if v == value: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumBase.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "EnumBase":39 + * cls.__members__[name] = res + * return res + * def __repr__(self): # <<<<<<<<<<<<<< + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_8EnumBase_14__Pyx_EnumBase_3__repr__ = {"__repr__", (PyCFunction)__pyx_pw_8EnumBase_14__Pyx_EnumBase_3__repr__, METH_O, 0}; +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumBase_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "EnumBase":40 + * return res + * def __repr__(self): + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) # <<<<<<<<<<<<<< + * def __str__(self): + * return "%s.%s" % (self.__class__.__name__, self.name) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s_d, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "EnumBase":39 + * cls.__members__[name] = res + * return res + * def __repr__(self): # <<<<<<<<<<<<<< + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumBase.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "EnumBase":41 + * def __repr__(self): + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): # <<<<<<<<<<<<<< + * return "%s.%s" % (self.__class__.__name__, self.name) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_5__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_8EnumBase_14__Pyx_EnumBase_5__str__ = {"__str__", (PyCFunction)__pyx_pw_8EnumBase_14__Pyx_EnumBase_5__str__, METH_O, 0}; +static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_5__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumBase_4__str__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase_4__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "EnumBase":42 + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): + * return "%s.%s" % (self.__class__.__name__, self.name) # <<<<<<<<<<<<<< + * + * if PY_VERSION_HEX >= 0x03040000: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "EnumBase":41 + * def __repr__(self): + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): # <<<<<<<<<<<<<< + * return "%s.%s" % (self.__class__.__name__, self.name) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("EnumBase.__Pyx_EnumBase.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __pyx_unpickle___Pyx_EnumMeta(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta = {"__pyx_unpickle___Pyx_EnumMeta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle___Pyx_EnumMeta (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle___Pyx_EnumMeta", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle___Pyx_EnumMeta", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle___Pyx_EnumMeta") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle___Pyx_EnumMeta", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("EnumBase.__pyx_unpickle___Pyx_EnumMeta", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_8EnumBase___pyx_unpickle___Pyx_EnumMeta(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_8EnumBase___pyx_unpickle___Pyx_EnumMeta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = 0; + PyObject *__pyx_v___pyx_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle___Pyx_EnumMeta", 0); + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd41d8cd) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":5 + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * if __pyx_checksum != 0xd41d8cd: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 6, __pyx_L1_error) + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + */ + } + + /* "(tree fragment)":7 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype___Pyx_EnumMeta), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "(tree fragment)":9 + * __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) + __pyx_t_3 = __pyx_unpickle___Pyx_EnumMeta__set_state(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":10 + * if __pyx_state is not None: + * __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle___Pyx_EnumMeta(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("EnumBase.__pyx_unpickle___Pyx_EnumMeta", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":11 + * __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + +static PyObject *__pyx_unpickle___Pyx_EnumMeta__set_state(struct __pyx_obj___Pyx_EnumMeta *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle___Pyx_EnumMeta__set_state", 0); + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 12, __pyx_L1_error) + } + __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_3 = ((__pyx_t_2 > 0) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "(tree fragment)":13 + * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 13, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + } + + /* "(tree fragment)":11 + * __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("EnumBase.__pyx_unpickle___Pyx_EnumMeta__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6common_10params_pyx_Params(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6common_10params_pyx_6Params_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6common_10params_pyx_Params(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_6common_10params_pyx_6Params_3__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6common_10params_pyx_Params[] = { + {"clear_all", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6common_10params_pyx_6Params_5clear_all, METH_VARARGS|METH_KEYWORDS, 0}, + {"check_key", (PyCFunction)__pyx_pw_6common_10params_pyx_6Params_7check_key, METH_O, 0}, + {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6common_10params_pyx_6Params_9get, METH_VARARGS|METH_KEYWORDS, 0}, + {"get_bool", (PyCFunction)__pyx_pw_6common_10params_pyx_6Params_11get_bool, METH_O, 0}, + {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6common_10params_pyx_6Params_13put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6common_10params_pyx_6Params_12put}, + {"put_bool", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6common_10params_pyx_6Params_15put_bool, METH_VARARGS|METH_KEYWORDS, 0}, + {"delete", (PyCFunction)__pyx_pw_6common_10params_pyx_6Params_17delete, METH_O, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6common_10params_pyx_6Params_19__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6common_10params_pyx_6Params_21__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6common_10params_pyx_Params = { + PyVarObject_HEAD_INIT(0, 0) + "common.params_pyx.Params", /*tp_name*/ + sizeof(struct __pyx_obj_6common_10params_pyx_Params), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6common_10params_pyx_Params, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6common_10params_pyx_Params, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6common_10params_pyx_Params, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *__pyx_freelist_6common_10params_pyx___pyx_scope_struct__put_nonblocking[8]; +static int __pyx_freecount_6common_10params_pyx___pyx_scope_struct__put_nonblocking = 0; + +static PyObject *__pyx_tp_new_6common_10params_pyx___pyx_scope_struct__put_nonblocking(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6common_10params_pyx___pyx_scope_struct__put_nonblocking > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking)))) { + o = (PyObject*)__pyx_freelist_6common_10params_pyx___pyx_scope_struct__put_nonblocking[--__pyx_freecount_6common_10params_pyx___pyx_scope_struct__put_nonblocking]; + memset(o, 0, sizeof(struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6common_10params_pyx___pyx_scope_struct__put_nonblocking(PyObject *o) { + struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *p = (struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_d); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6common_10params_pyx___pyx_scope_struct__put_nonblocking < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking)))) { + __pyx_freelist_6common_10params_pyx___pyx_scope_struct__put_nonblocking[__pyx_freecount_6common_10params_pyx___pyx_scope_struct__put_nonblocking++] = ((struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6common_10params_pyx___pyx_scope_struct__put_nonblocking(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *p = (struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *)o; + if (p->__pyx_v_d) { + e = (*v)(p->__pyx_v_d, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6common_10params_pyx___pyx_scope_struct__put_nonblocking(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *p = (struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *)o; + tmp = ((PyObject*)p->__pyx_v_d); + p->__pyx_v_d = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6common_10params_pyx___pyx_scope_struct__put_nonblocking = { + PyVarObject_HEAD_INIT(0, 0) + "common.params_pyx.__pyx_scope_struct__put_nonblocking", /*tp_name*/ + sizeof(struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6common_10params_pyx___pyx_scope_struct__put_nonblocking, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6common_10params_pyx___pyx_scope_struct__put_nonblocking, /*tp_traverse*/ + __pyx_tp_clear_6common_10params_pyx___pyx_scope_struct__put_nonblocking, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6common_10params_pyx___pyx_scope_struct__put_nonblocking, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyObject *__pyx_tp_new___Pyx_EnumMeta(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = (&PyType_Type)->tp_new(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc___Pyx_EnumMeta(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + PyObject_GC_Track(o); + (&PyType_Type)->tp_dealloc(o); +} + +static int __pyx_tp_traverse___Pyx_EnumMeta(PyObject *o, visitproc v, void *a) { + int e; + if (!(&PyType_Type)->tp_traverse); else { e = (&PyType_Type)->tp_traverse(o,v,a); if (e) return e; } + return 0; +} + +static int __pyx_tp_clear___Pyx_EnumMeta(PyObject *o) { + if (!(&PyType_Type)->tp_clear); else (&PyType_Type)->tp_clear(o); + return 0; +} +static PyObject *__pyx_sq_item___Pyx_EnumMeta(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static PyMethodDef __pyx_methods___Pyx_EnumMeta[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_8EnumBase_14__Pyx_EnumMeta_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_8EnumBase_14__Pyx_EnumMeta_9__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence___Pyx_EnumMeta = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item___Pyx_EnumMeta, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping___Pyx_EnumMeta = { + 0, /*mp_length*/ + __pyx_pw_8EnumBase_14__Pyx_EnumMeta_5__getitem__, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __Pyx_EnumMeta = { + PyVarObject_HEAD_INIT(0, 0) + "common.params_pyx.__Pyx_EnumMeta", /*tp_name*/ + sizeof(struct __pyx_obj___Pyx_EnumMeta), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc___Pyx_EnumMeta, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence___Pyx_EnumMeta, /*tp_as_sequence*/ + &__pyx_tp_as_mapping___Pyx_EnumMeta, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse___Pyx_EnumMeta, /*tp_traverse*/ + __pyx_tp_clear___Pyx_EnumMeta, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_8EnumBase_14__Pyx_EnumMeta_3__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods___Pyx_EnumMeta, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_8EnumBase_14__Pyx_EnumMeta_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new___Pyx_EnumMeta, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_params_pyx(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_params_pyx}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "params_pyx", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, + {&__pyx_n_s_ALL, __pyx_k_ALL, sizeof(__pyx_k_ALL), 0, 0, 1, 1}, + {&__pyx_n_s_CLEAR_ON_IGNITION_OFF, __pyx_k_CLEAR_ON_IGNITION_OFF, sizeof(__pyx_k_CLEAR_ON_IGNITION_OFF), 0, 0, 1, 1}, + {&__pyx_n_s_CLEAR_ON_IGNITION_ON, __pyx_k_CLEAR_ON_IGNITION_ON, sizeof(__pyx_k_CLEAR_ON_IGNITION_ON), 0, 0, 1, 1}, + {&__pyx_n_s_CLEAR_ON_MANAGER_START, __pyx_k_CLEAR_ON_MANAGER_START, sizeof(__pyx_k_CLEAR_ON_MANAGER_START), 0, 0, 1, 1}, + {&__pyx_n_s_EnumBase, __pyx_k_EnumBase, sizeof(__pyx_k_EnumBase), 0, 0, 1, 1}, + {&__pyx_n_s_EnumType, __pyx_k_EnumType, sizeof(__pyx_k_EnumType), 0, 0, 1, 1}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_k_Incompatible_checksums_s_vs_0xd4, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xd4), 0, 0, 1, 0}, + {&__pyx_n_s_IntEnum, __pyx_k_IntEnum, sizeof(__pyx_k_IntEnum), 0, 0, 1, 1}, + {&__pyx_n_s_KeyboardInterrupt, __pyx_k_KeyboardInterrupt, sizeof(__pyx_k_KeyboardInterrupt), 0, 0, 1, 1}, + {&__pyx_n_s_OrderedDict, __pyx_k_OrderedDict, sizeof(__pyx_k_OrderedDict), 0, 0, 1, 1}, + {&__pyx_n_s_PERSISTENT, __pyx_k_PERSISTENT, sizeof(__pyx_k_PERSISTENT), 0, 0, 1, 1}, + {&__pyx_n_s_ParamKeyType, __pyx_k_ParamKeyType, sizeof(__pyx_k_ParamKeyType), 0, 0, 1, 1}, + {&__pyx_n_s_Params, __pyx_k_Params, sizeof(__pyx_k_Params), 0, 0, 1, 1}, + {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_Pyx_EnumBase, __pyx_k_Pyx_EnumBase, sizeof(__pyx_k_Pyx_EnumBase), 0, 0, 1, 1}, + {&__pyx_n_s_Pyx_EnumBase___new, __pyx_k_Pyx_EnumBase___new, sizeof(__pyx_k_Pyx_EnumBase___new), 0, 0, 1, 1}, + {&__pyx_n_s_Pyx_EnumBase___repr, __pyx_k_Pyx_EnumBase___repr, sizeof(__pyx_k_Pyx_EnumBase___repr), 0, 0, 1, 1}, + {&__pyx_n_s_Pyx_EnumBase___str, __pyx_k_Pyx_EnumBase___str, sizeof(__pyx_k_Pyx_EnumBase___str), 0, 0, 1, 1}, + {&__pyx_n_s_Thread, __pyx_k_Thread, sizeof(__pyx_k_Thread), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_UnknownKeyName, __pyx_k_UnknownKeyName, sizeof(__pyx_k_UnknownKeyName), 0, 0, 1, 1}, + {&__pyx_kp_s_Unknown_enum_value_s, __pyx_k_Unknown_enum_value_s, sizeof(__pyx_k_Unknown_enum_value_s), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_block, __pyx_k_block, sizeof(__pyx_k_block), 0, 0, 1, 1}, + {&__pyx_n_s_check_key, __pyx_k_check_key, sizeof(__pyx_k_check_key), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, + {&__pyx_n_s_common_params_pyx, __pyx_k_common_params_pyx, sizeof(__pyx_k_common_params_pyx), 0, 0, 1, 1}, + {&__pyx_kp_s_common_params_pyx_pyx, __pyx_k_common_params_pyx_pyx, sizeof(__pyx_k_common_params_pyx_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, + {&__pyx_n_s_dat, __pyx_k_dat, sizeof(__pyx_k_dat), 0, 0, 1, 1}, + {&__pyx_n_s_dct, __pyx_k_dct, sizeof(__pyx_k_dct), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_ensure_bytes, __pyx_k_ensure_bytes, sizeof(__pyx_k_ensure_bytes), 0, 0, 1, 1}, + {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_members, __pyx_k_members, sizeof(__pyx_k_members), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, + {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1}, + {&__pyx_n_s_parents, __pyx_k_parents, sizeof(__pyx_k_parents), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1}, + {&__pyx_n_s_put_nonblocking, __pyx_k_put_nonblocking, sizeof(__pyx_k_put_nonblocking), 0, 0, 1, 1}, + {&__pyx_n_s_put_nonblocking_locals_f, __pyx_k_put_nonblocking_locals_f, sizeof(__pyx_k_put_nonblocking_locals_f), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle___Pyx_EnumMeta, __pyx_k_pyx_unpickle___Pyx_EnumMeta, sizeof(__pyx_k_pyx_unpickle___Pyx_EnumMeta), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, + {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1}, + {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s_d, __pyx_k_s_s_d, sizeof(__pyx_k_s_s_d), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1}, + {&__pyx_n_s_tx_type, __pyx_k_tx_type, sizeof(__pyx_k_tx_type), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_KeyboardInterrupt = __Pyx_GetBuiltinName(__pyx_n_s_KeyboardInterrupt); if (!__pyx_builtin_KeyboardInterrupt) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 33, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "common/params_pyx.pyx":98 + * + * def put_nonblocking(key, val, d=""): + * def f(key, val): # <<<<<<<<<<<<<< + * params = Params(d) + * cdef string k = ensure_bytes(key) + */ + __pyx_tuple__5 = PyTuple_Pack(4, __pyx_n_s_key, __pyx_n_s_val, __pyx_n_s_params, __pyx_n_s_k); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_params_pyx_pyx, __pyx_n_s_f, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 98, __pyx_L1_error) + + /* "common/params_pyx.pyx":26 + * + * + * def ensure_bytes(v): # <<<<<<<<<<<<<< + * return v.encode() if isinstance(v, str) else v; + * + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_v); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_params_pyx_pyx, __pyx_n_s_ensure_bytes, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 26, __pyx_L1_error) + + /* "common/params_pyx.pyx":97 + * self.p.remove(k) + * + * def put_nonblocking(key, val, d=""): # <<<<<<<<<<<<<< + * def f(key, val): + * params = Params(d) + */ + __pyx_tuple__9 = PyTuple_Pack(6, __pyx_n_s_key, __pyx_n_s_val, __pyx_n_s_d, __pyx_n_s_f, __pyx_n_s_f, __pyx_n_s_t); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_params_pyx_pyx, __pyx_n_s_put_nonblocking, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 97, __pyx_L1_error) + + /* "EnumBase":28 + * class __Pyx_EnumBase(int): + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): # <<<<<<<<<<<<<< + * for v in cls: + * if v == value: + */ + __pyx_tuple__11 = PyTuple_Pack(5, __pyx_n_s_cls, __pyx_n_s_value, __pyx_n_s_name, __pyx_n_s_v, __pyx_n_s_res); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_new, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 28, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "EnumBase":39 + * cls.__members__[name] = res + * return res + * def __repr__(self): # <<<<<<<<<<<<<< + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_repr, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 39, __pyx_L1_error) + + /* "EnumBase":41 + * def __repr__(self): + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): # <<<<<<<<<<<<<< + * return "%s.%s" % (self.__class__.__name__, self.name) + * + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_str, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 41, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __pyx_unpickle___Pyx_EnumMeta(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_tuple__18 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle___Pyx_EnumMeta, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_222419149 = PyInt_FromLong(222419149L); if (unlikely(!__pyx_int_222419149)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_OrderedDict = Py_None; Py_INCREF(Py_None); + __Pyx_EnumBase = Py_None; Py_INCREF(Py_None); + __Pyx_globals = ((PyObject*)Py_None); Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6common_10params_pyx_Params) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6common_10params_pyx_Params.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6common_10params_pyx_Params.tp_dictoffset && __pyx_type_6common_10params_pyx_Params.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6common_10params_pyx_Params.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Params, (PyObject *)&__pyx_type_6common_10params_pyx_Params) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6common_10params_pyx_Params) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_ptype_6common_10params_pyx_Params = &__pyx_type_6common_10params_pyx_Params; + if (PyType_Ready(&__pyx_type_6common_10params_pyx___pyx_scope_struct__put_nonblocking) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6common_10params_pyx___pyx_scope_struct__put_nonblocking.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6common_10params_pyx___pyx_scope_struct__put_nonblocking.tp_dictoffset && __pyx_type_6common_10params_pyx___pyx_scope_struct__put_nonblocking.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6common_10params_pyx___pyx_scope_struct__put_nonblocking.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + __pyx_ptype_6common_10params_pyx___pyx_scope_struct__put_nonblocking = &__pyx_type_6common_10params_pyx___pyx_scope_struct__put_nonblocking; + __Pyx_EnumMeta.tp_base = (&PyType_Type); + if (PyType_Ready(&__Pyx_EnumMeta) < 0) __PYX_ERR(1, 15, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __Pyx_EnumMeta.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__Pyx_EnumMeta.tp_dictoffset && __Pyx_EnumMeta.tp_getattro == PyObject_GenericGetAttr)) { + __Pyx_EnumMeta.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_setup_reduce((PyObject*)&__Pyx_EnumMeta) < 0) __PYX_ERR(1, 15, __pyx_L1_error) + __pyx_ptype___Pyx_EnumMeta = &__Pyx_EnumMeta; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initparams_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initparams_pyx(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_params_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_params_pyx(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_params_pyx(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'params_pyx' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_params_pyx(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("params_pyx", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_common__params_pyx) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "common.params_pyx")) { + if (unlikely(PyDict_SetItemString(modules, "common.params_pyx", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "common/params_pyx.pyx":5 + * from libcpp cimport bool + * from libcpp.string cimport string + * import threading # <<<<<<<<<<<<<< + * + * cdef extern from "selfdrive/common/params.h": + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_threading, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/params_pyx.pyx":26 + * + * + * def ensure_bytes(v): # <<<<<<<<<<<<<< + * return v.encode() if isinstance(v, str) else v; + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_10params_pyx_1ensure_bytes, NULL, __pyx_n_s_common_params_pyx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ensure_bytes, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/params_pyx.pyx":29 + * return v.encode() if isinstance(v, str) else v; + * + * class UnknownKeyName(Exception): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_UnknownKeyName, __pyx_n_s_UnknownKeyName, (PyObject *) NULL, __pyx_n_s_common_params_pyx, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_UnknownKeyName, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnknownKeyName, __pyx_t_4) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/params_pyx.pyx":43 + * del self.p + * + * def clear_all(self, tx_type=ParamKeyType.ALL): # <<<<<<<<<<<<<< + * self.p.clearAll(tx_type) + * + */ + __pyx_t_1 = __Pyx_PyInt_From_enum__ParamKeyType(ALL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__2 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "common/params_pyx.pyx":97 + * self.p.remove(k) + * + * def put_nonblocking(key, val, d=""): # <<<<<<<<<<<<<< + * def f(key, val): + * params = Params(d) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_10params_pyx_3put_nonblocking, NULL, __pyx_n_s_common_params_pyx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_put_nonblocking, __pyx_t_1) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/params_pyx.pyx":1 + * # distutils: language = c++ # <<<<<<<<<<<<<< + * # cython: language_level = 3 + * from libcpp cimport bool + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumBase":9 + * + * cdef object __Pyx_OrderedDict + * if PY_VERSION_HEX >= 0x02070000: # <<<<<<<<<<<<<< + * from collections import OrderedDict as __Pyx_OrderedDict + * else: + */ + __pyx_t_5 = ((PY_VERSION_HEX >= 0x02070000) != 0); + if (__pyx_t_5) { + + /* "EnumBase":10 + * cdef object __Pyx_OrderedDict + * if PY_VERSION_HEX >= 0x02070000: + * from collections import OrderedDict as __Pyx_OrderedDict # <<<<<<<<<<<<<< + * else: + * __Pyx_OrderedDict = dict + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_OrderedDict); + __Pyx_GIVEREF(__pyx_n_s_OrderedDict); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_OrderedDict); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__Pyx_OrderedDict); + __Pyx_DECREF_SET(__Pyx_OrderedDict, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "EnumBase":9 + * + * cdef object __Pyx_OrderedDict + * if PY_VERSION_HEX >= 0x02070000: # <<<<<<<<<<<<<< + * from collections import OrderedDict as __Pyx_OrderedDict + * else: + */ + goto __pyx_L2; + } + + /* "EnumBase":12 + * from collections import OrderedDict as __Pyx_OrderedDict + * else: + * __Pyx_OrderedDict = dict # <<<<<<<<<<<<<< + * + * @cython.internal + */ + /*else*/ { + __Pyx_INCREF(((PyObject *)(&PyDict_Type))); + __Pyx_XGOTREF(__Pyx_OrderedDict); + __Pyx_DECREF_SET(__Pyx_OrderedDict, ((PyObject *)(&PyDict_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyDict_Type))); + } + __pyx_L2:; + + /* "EnumBase":26 + * + * cdef object __Pyx_EnumBase + * class __Pyx_EnumBase(int): # <<<<<<<<<<<<<< + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)(&PyInt_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type))); + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Pyx_EnumBase, __pyx_n_s_Pyx_EnumBase, (PyObject *) NULL, __pyx_n_s_EnumBase, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "EnumBase":27 + * cdef object __Pyx_EnumBase + * class __Pyx_EnumBase(int): + * __metaclass__ = __Pyx_EnumMeta # <<<<<<<<<<<<<< + * def __new__(cls, value, name=None): + * for v in cls: + */ + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_metaclass, ((PyObject *)__pyx_ptype___Pyx_EnumMeta)) < 0) __PYX_ERR(1, 27, __pyx_L1_error) + + /* "EnumBase":28 + * class __Pyx_EnumBase(int): + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): # <<<<<<<<<<<<<< + * for v in cls: + * if v == value: + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_14__Pyx_EnumBase_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Pyx_EnumBase___new, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__13); + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_new, __pyx_t_4) < 0) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "EnumBase":39 + * cls.__members__[name] = res + * return res + * def __repr__(self): # <<<<<<<<<<<<<< + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_14__Pyx_EnumBase_3__repr__, 0, __pyx_n_s_Pyx_EnumBase___repr, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_repr, __pyx_t_4) < 0) __PYX_ERR(1, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "EnumBase":41 + * def __repr__(self): + * return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self) + * def __str__(self): # <<<<<<<<<<<<<< + * return "%s.%s" % (self.__class__.__name__, self.name) + * + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_14__Pyx_EnumBase_5__str__, 0, __pyx_n_s_Pyx_EnumBase___str, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_str, __pyx_t_4) < 0) __PYX_ERR(1, 41, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "EnumBase":26 + * + * cdef object __Pyx_EnumBase + * class __Pyx_EnumBase(int): # <<<<<<<<<<<<<< + * __metaclass__ = __Pyx_EnumMeta + * def __new__(cls, value, name=None): + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Pyx_EnumBase, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__Pyx_EnumBase); + __Pyx_DECREF_SET(__Pyx_EnumBase, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "EnumBase":44 + * return "%s.%s" % (self.__class__.__name__, self.name) + * + * if PY_VERSION_HEX >= 0x03040000: # <<<<<<<<<<<<<< + * from enum import IntEnum as __Pyx_EnumBase + * + */ + __pyx_t_5 = ((PY_VERSION_HEX >= 0x03040000) != 0); + if (__pyx_t_5) { + + /* "EnumBase":45 + * + * if PY_VERSION_HEX >= 0x03040000: + * from enum import IntEnum as __Pyx_EnumBase # <<<<<<<<<<<<<< + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_IntEnum); + __Pyx_GIVEREF(__pyx_n_s_IntEnum); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_IntEnum); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_enum, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__Pyx_EnumBase); + __Pyx_DECREF_SET(__Pyx_EnumBase, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumBase":44 + * return "%s.%s" % (self.__class__.__name__, self.name) + * + * if PY_VERSION_HEX >= 0x03040000: # <<<<<<<<<<<<<< + * from enum import IntEnum as __Pyx_EnumBase + * + */ + } + + /* "(tree fragment)":1 + * def __pyx_unpickle___Pyx_EnumMeta(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta, NULL, __pyx_n_s_EnumBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle___Pyx_EnumMeta, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumType":50 + * + * + * cdef dict __Pyx_globals = globals() # <<<<<<<<<<<<<< + * if PY_VERSION_HEX >= 0x03040000: + * + */ + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 50, __pyx_L1_error) + __Pyx_XGOTREF(__Pyx_globals); + __Pyx_DECREF_SET(__Pyx_globals, ((PyObject*)__pyx_t_1)); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "EnumType":51 + * + * cdef dict __Pyx_globals = globals() + * if PY_VERSION_HEX >= 0x03040000: # <<<<<<<<<<<<<< + * + * ParamKeyType = __Pyx_EnumBase('ParamKeyType', __Pyx_OrderedDict([ + */ + __pyx_t_5 = ((PY_VERSION_HEX >= 0x03040000) != 0); + if (__pyx_t_5) { + + /* "EnumType":54 + * + * ParamKeyType = __Pyx_EnumBase('ParamKeyType', __Pyx_OrderedDict([ + * ('PERSISTENT', PERSISTENT), # <<<<<<<<<<<<<< + * ('CLEAR_ON_MANAGER_START', CLEAR_ON_MANAGER_START), + * ('CLEAR_ON_IGNITION_ON', CLEAR_ON_IGNITION_ON), + */ + __pyx_t_1 = __Pyx_PyInt_From_enum__ParamKeyType(PERSISTENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PERSISTENT); + __Pyx_GIVEREF(__pyx_n_s_PERSISTENT); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PERSISTENT); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_1 = 0; + + /* "EnumType":55 + * ParamKeyType = __Pyx_EnumBase('ParamKeyType', __Pyx_OrderedDict([ + * ('PERSISTENT', PERSISTENT), + * ('CLEAR_ON_MANAGER_START', CLEAR_ON_MANAGER_START), # <<<<<<<<<<<<<< + * ('CLEAR_ON_IGNITION_ON', CLEAR_ON_IGNITION_ON), + * ('CLEAR_ON_IGNITION_OFF', CLEAR_ON_IGNITION_OFF), + */ + __pyx_t_1 = __Pyx_PyInt_From_enum__ParamKeyType(CLEAR_ON_MANAGER_START); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_CLEAR_ON_MANAGER_START); + __Pyx_GIVEREF(__pyx_n_s_CLEAR_ON_MANAGER_START); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_CLEAR_ON_MANAGER_START); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __pyx_t_1 = 0; + + /* "EnumType":56 + * ('PERSISTENT', PERSISTENT), + * ('CLEAR_ON_MANAGER_START', CLEAR_ON_MANAGER_START), + * ('CLEAR_ON_IGNITION_ON', CLEAR_ON_IGNITION_ON), # <<<<<<<<<<<<<< + * ('CLEAR_ON_IGNITION_OFF', CLEAR_ON_IGNITION_OFF), + * ('ALL', ALL), + */ + __pyx_t_1 = __Pyx_PyInt_From_enum__ParamKeyType(CLEAR_ON_IGNITION_ON); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_CLEAR_ON_IGNITION_ON); + __Pyx_GIVEREF(__pyx_n_s_CLEAR_ON_IGNITION_ON); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_CLEAR_ON_IGNITION_ON); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_1 = 0; + + /* "EnumType":57 + * ('CLEAR_ON_MANAGER_START', CLEAR_ON_MANAGER_START), + * ('CLEAR_ON_IGNITION_ON', CLEAR_ON_IGNITION_ON), + * ('CLEAR_ON_IGNITION_OFF', CLEAR_ON_IGNITION_OFF), # <<<<<<<<<<<<<< + * ('ALL', ALL), + * ])) + */ + __pyx_t_1 = __Pyx_PyInt_From_enum__ParamKeyType(CLEAR_ON_IGNITION_OFF); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_n_s_CLEAR_ON_IGNITION_OFF); + __Pyx_GIVEREF(__pyx_n_s_CLEAR_ON_IGNITION_OFF); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_CLEAR_ON_IGNITION_OFF); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); + __pyx_t_1 = 0; + + /* "EnumType":58 + * ('CLEAR_ON_IGNITION_ON', CLEAR_ON_IGNITION_ON), + * ('CLEAR_ON_IGNITION_OFF', CLEAR_ON_IGNITION_OFF), + * ('ALL', ALL), # <<<<<<<<<<<<<< + * ])) + * __Pyx_globals['PERSISTENT'] = ParamKeyType.PERSISTENT + */ + __pyx_t_1 = __Pyx_PyInt_From_enum__ParamKeyType(ALL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_n_s_ALL); + __Pyx_GIVEREF(__pyx_n_s_ALL); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_ALL); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); + __pyx_t_1 = 0; + + /* "EnumType":53 + * if PY_VERSION_HEX >= 0x03040000: + * + * ParamKeyType = __Pyx_EnumBase('ParamKeyType', __Pyx_OrderedDict([ # <<<<<<<<<<<<<< + * ('PERSISTENT', PERSISTENT), + * ('CLEAR_ON_MANAGER_START', CLEAR_ON_MANAGER_START), + */ + __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_t_7); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__Pyx_OrderedDict, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_ParamKeyType); + __Pyx_GIVEREF(__pyx_n_s_ParamKeyType); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ParamKeyType); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__Pyx_EnumBase, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ParamKeyType, __pyx_t_7) < 0) __PYX_ERR(1, 53, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "EnumType":60 + * ('ALL', ALL), + * ])) + * __Pyx_globals['PERSISTENT'] = ParamKeyType.PERSISTENT # <<<<<<<<<<<<<< + * __Pyx_globals['CLEAR_ON_MANAGER_START'] = ParamKeyType.CLEAR_ON_MANAGER_START + * __Pyx_globals['CLEAR_ON_IGNITION_ON'] = ParamKeyType.CLEAR_ON_IGNITION_ON + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ParamKeyType); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_PERSISTENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 60, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_PERSISTENT, __pyx_t_1) < 0)) __PYX_ERR(1, 60, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumType":61 + * ])) + * __Pyx_globals['PERSISTENT'] = ParamKeyType.PERSISTENT + * __Pyx_globals['CLEAR_ON_MANAGER_START'] = ParamKeyType.CLEAR_ON_MANAGER_START # <<<<<<<<<<<<<< + * __Pyx_globals['CLEAR_ON_IGNITION_ON'] = ParamKeyType.CLEAR_ON_IGNITION_ON + * __Pyx_globals['CLEAR_ON_IGNITION_OFF'] = ParamKeyType.CLEAR_ON_IGNITION_OFF + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ParamKeyType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CLEAR_ON_MANAGER_START); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 61, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_CLEAR_ON_MANAGER_START, __pyx_t_7) < 0)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "EnumType":62 + * __Pyx_globals['PERSISTENT'] = ParamKeyType.PERSISTENT + * __Pyx_globals['CLEAR_ON_MANAGER_START'] = ParamKeyType.CLEAR_ON_MANAGER_START + * __Pyx_globals['CLEAR_ON_IGNITION_ON'] = ParamKeyType.CLEAR_ON_IGNITION_ON # <<<<<<<<<<<<<< + * __Pyx_globals['CLEAR_ON_IGNITION_OFF'] = ParamKeyType.CLEAR_ON_IGNITION_OFF + * __Pyx_globals['ALL'] = ParamKeyType.ALL + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ParamKeyType); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_CLEAR_ON_IGNITION_ON); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 62, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_CLEAR_ON_IGNITION_ON, __pyx_t_1) < 0)) __PYX_ERR(1, 62, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumType":63 + * __Pyx_globals['CLEAR_ON_MANAGER_START'] = ParamKeyType.CLEAR_ON_MANAGER_START + * __Pyx_globals['CLEAR_ON_IGNITION_ON'] = ParamKeyType.CLEAR_ON_IGNITION_ON + * __Pyx_globals['CLEAR_ON_IGNITION_OFF'] = ParamKeyType.CLEAR_ON_IGNITION_OFF # <<<<<<<<<<<<<< + * __Pyx_globals['ALL'] = ParamKeyType.ALL + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ParamKeyType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CLEAR_ON_IGNITION_OFF); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 63, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_CLEAR_ON_IGNITION_OFF, __pyx_t_7) < 0)) __PYX_ERR(1, 63, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "EnumType":64 + * __Pyx_globals['CLEAR_ON_IGNITION_ON'] = ParamKeyType.CLEAR_ON_IGNITION_ON + * __Pyx_globals['CLEAR_ON_IGNITION_OFF'] = ParamKeyType.CLEAR_ON_IGNITION_OFF + * __Pyx_globals['ALL'] = ParamKeyType.ALL # <<<<<<<<<<<<<< + * else: + * class ParamKeyType(__Pyx_EnumBase): + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ParamKeyType); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ALL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 64, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_ALL, __pyx_t_1) < 0)) __PYX_ERR(1, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumType":51 + * + * cdef dict __Pyx_globals = globals() + * if PY_VERSION_HEX >= 0x03040000: # <<<<<<<<<<<<<< + * + * ParamKeyType = __Pyx_EnumBase('ParamKeyType', __Pyx_OrderedDict([ + */ + goto __pyx_L4; + } + + /* "EnumType":66 + * __Pyx_globals['ALL'] = ParamKeyType.ALL + * else: + * class ParamKeyType(__Pyx_EnumBase): # <<<<<<<<<<<<<< + * pass + * __Pyx_globals['PERSISTENT'] = ParamKeyType(PERSISTENT, 'PERSISTENT') + */ + /*else*/ { + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_EnumBase); + __Pyx_GIVEREF(__Pyx_EnumBase); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_EnumBase); + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_1, __pyx_n_s_ParamKeyType, __pyx_n_s_ParamKeyType, (PyObject *) NULL, __pyx_n_s_EnumType, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_ParamKeyType, __pyx_t_1, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ParamKeyType, __pyx_t_4) < 0) __PYX_ERR(1, 66, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumType":68 + * class ParamKeyType(__Pyx_EnumBase): + * pass + * __Pyx_globals['PERSISTENT'] = ParamKeyType(PERSISTENT, 'PERSISTENT') # <<<<<<<<<<<<<< + * __Pyx_globals['CLEAR_ON_MANAGER_START'] = ParamKeyType(CLEAR_ON_MANAGER_START, 'CLEAR_ON_MANAGER_START') + * __Pyx_globals['CLEAR_ON_IGNITION_ON'] = ParamKeyType(CLEAR_ON_IGNITION_ON, 'CLEAR_ON_IGNITION_ON') + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ParamKeyType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_From_enum__ParamKeyType(PERSISTENT); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); + __Pyx_INCREF(__pyx_n_s_PERSISTENT); + __Pyx_GIVEREF(__pyx_n_s_PERSISTENT); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_PERSISTENT); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 68, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_PERSISTENT, __pyx_t_7) < 0)) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "EnumType":69 + * pass + * __Pyx_globals['PERSISTENT'] = ParamKeyType(PERSISTENT, 'PERSISTENT') + * __Pyx_globals['CLEAR_ON_MANAGER_START'] = ParamKeyType(CLEAR_ON_MANAGER_START, 'CLEAR_ON_MANAGER_START') # <<<<<<<<<<<<<< + * __Pyx_globals['CLEAR_ON_IGNITION_ON'] = ParamKeyType(CLEAR_ON_IGNITION_ON, 'CLEAR_ON_IGNITION_ON') + * __Pyx_globals['CLEAR_ON_IGNITION_OFF'] = ParamKeyType(CLEAR_ON_IGNITION_OFF, 'CLEAR_ON_IGNITION_OFF') + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ParamKeyType); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyInt_From_enum__ParamKeyType(CLEAR_ON_MANAGER_START); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_INCREF(__pyx_n_s_CLEAR_ON_MANAGER_START); + __Pyx_GIVEREF(__pyx_n_s_CLEAR_ON_MANAGER_START); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_CLEAR_ON_MANAGER_START); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 69, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_CLEAR_ON_MANAGER_START, __pyx_t_6) < 0)) __PYX_ERR(1, 69, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "EnumType":70 + * __Pyx_globals['PERSISTENT'] = ParamKeyType(PERSISTENT, 'PERSISTENT') + * __Pyx_globals['CLEAR_ON_MANAGER_START'] = ParamKeyType(CLEAR_ON_MANAGER_START, 'CLEAR_ON_MANAGER_START') + * __Pyx_globals['CLEAR_ON_IGNITION_ON'] = ParamKeyType(CLEAR_ON_IGNITION_ON, 'CLEAR_ON_IGNITION_ON') # <<<<<<<<<<<<<< + * __Pyx_globals['CLEAR_ON_IGNITION_OFF'] = ParamKeyType(CLEAR_ON_IGNITION_OFF, 'CLEAR_ON_IGNITION_OFF') + * __Pyx_globals['ALL'] = ParamKeyType(ALL, 'ALL') + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ParamKeyType); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyInt_From_enum__ParamKeyType(CLEAR_ON_IGNITION_ON); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_n_s_CLEAR_ON_IGNITION_ON); + __Pyx_GIVEREF(__pyx_n_s_CLEAR_ON_IGNITION_ON); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_CLEAR_ON_IGNITION_ON); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 70, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_CLEAR_ON_IGNITION_ON, __pyx_t_1) < 0)) __PYX_ERR(1, 70, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "EnumType":71 + * __Pyx_globals['CLEAR_ON_MANAGER_START'] = ParamKeyType(CLEAR_ON_MANAGER_START, 'CLEAR_ON_MANAGER_START') + * __Pyx_globals['CLEAR_ON_IGNITION_ON'] = ParamKeyType(CLEAR_ON_IGNITION_ON, 'CLEAR_ON_IGNITION_ON') + * __Pyx_globals['CLEAR_ON_IGNITION_OFF'] = ParamKeyType(CLEAR_ON_IGNITION_OFF, 'CLEAR_ON_IGNITION_OFF') # <<<<<<<<<<<<<< + * __Pyx_globals['ALL'] = ParamKeyType(ALL, 'ALL') + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ParamKeyType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_From_enum__ParamKeyType(CLEAR_ON_IGNITION_OFF); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); + __Pyx_INCREF(__pyx_n_s_CLEAR_ON_IGNITION_OFF); + __Pyx_GIVEREF(__pyx_n_s_CLEAR_ON_IGNITION_OFF); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_CLEAR_ON_IGNITION_OFF); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 71, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_CLEAR_ON_IGNITION_OFF, __pyx_t_7) < 0)) __PYX_ERR(1, 71, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "EnumType":72 + * __Pyx_globals['CLEAR_ON_IGNITION_ON'] = ParamKeyType(CLEAR_ON_IGNITION_ON, 'CLEAR_ON_IGNITION_ON') + * __Pyx_globals['CLEAR_ON_IGNITION_OFF'] = ParamKeyType(CLEAR_ON_IGNITION_OFF, 'CLEAR_ON_IGNITION_OFF') + * __Pyx_globals['ALL'] = ParamKeyType(ALL, 'ALL') # <<<<<<<<<<<<<< + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ParamKeyType); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyInt_From_enum__ParamKeyType(ALL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_INCREF(__pyx_n_s_ALL); + __Pyx_GIVEREF(__pyx_n_s_ALL); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ALL); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_globals == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 72, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__Pyx_globals, __pyx_n_s_ALL, __pyx_t_6) < 0)) __PYX_ERR(1, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_L4:; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init common.params_pyx", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init common.params_pyx"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (__Pyx_PyFastCFunction_Check(func)) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* None */ +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { + PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunctionShared */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + Py_INCREF(m->func_qualname); + return m->func_qualname; +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + if (unlikely(op == NULL)) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults_size = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ +#if PY_MAJOR_VERSION < 3 + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; +#endif + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + m->defaults_size = size; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* HasAttr */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* SetupReduce */ +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#else + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#endif +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); + if (likely(reduce_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (reduce == object_reduce || PyErr_Occurred()) { + goto __PYX_BAD; + } + setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); + if (likely(setstate_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (!setstate || PyErr_Occurred()) { + goto __PYX_BAD; + } + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto __PYX_GOOD; +__PYX_BAD: + if (!PyErr_Occurred()) + PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +__PYX_GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CalculateMetaclass */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +/* Py3ClassCreate */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ParamKeyType(enum ParamKeyType value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const enum ParamKeyType neg_one = (enum ParamKeyType) -1, const_zero = (enum ParamKeyType) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(enum ParamKeyType) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(enum ParamKeyType) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum ParamKeyType) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(enum ParamKeyType) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum ParamKeyType) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(enum ParamKeyType), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE enum ParamKeyType __Pyx_PyInt_As_enum__ParamKeyType(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const enum ParamKeyType neg_one = (enum ParamKeyType) -1, const_zero = (enum ParamKeyType) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(enum ParamKeyType) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(enum ParamKeyType, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (enum ParamKeyType) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (enum ParamKeyType) 0; + case 1: __PYX_VERIFY_RETURN_INT(enum ParamKeyType, digit, digits[0]) + case 2: + if (8 * sizeof(enum ParamKeyType) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum ParamKeyType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum ParamKeyType) >= 2 * PyLong_SHIFT) { + return (enum ParamKeyType) (((((enum ParamKeyType)digits[1]) << PyLong_SHIFT) | (enum ParamKeyType)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(enum ParamKeyType) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum ParamKeyType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum ParamKeyType) >= 3 * PyLong_SHIFT) { + return (enum ParamKeyType) (((((((enum ParamKeyType)digits[2]) << PyLong_SHIFT) | (enum ParamKeyType)digits[1]) << PyLong_SHIFT) | (enum ParamKeyType)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(enum ParamKeyType) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum ParamKeyType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum ParamKeyType) >= 4 * PyLong_SHIFT) { + return (enum ParamKeyType) (((((((((enum ParamKeyType)digits[3]) << PyLong_SHIFT) | (enum ParamKeyType)digits[2]) << PyLong_SHIFT) | (enum ParamKeyType)digits[1]) << PyLong_SHIFT) | (enum ParamKeyType)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (enum ParamKeyType) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(enum ParamKeyType) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(enum ParamKeyType, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum ParamKeyType) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(enum ParamKeyType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (enum ParamKeyType) 0; + case -1: __PYX_VERIFY_RETURN_INT(enum ParamKeyType, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(enum ParamKeyType, digit, +digits[0]) + case -2: + if (8 * sizeof(enum ParamKeyType) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum ParamKeyType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum ParamKeyType) - 1 > 2 * PyLong_SHIFT) { + return (enum ParamKeyType) (((enum ParamKeyType)-1)*(((((enum ParamKeyType)digits[1]) << PyLong_SHIFT) | (enum ParamKeyType)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(enum ParamKeyType) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum ParamKeyType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum ParamKeyType) - 1 > 2 * PyLong_SHIFT) { + return (enum ParamKeyType) ((((((enum ParamKeyType)digits[1]) << PyLong_SHIFT) | (enum ParamKeyType)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(enum ParamKeyType) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum ParamKeyType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum ParamKeyType) - 1 > 3 * PyLong_SHIFT) { + return (enum ParamKeyType) (((enum ParamKeyType)-1)*(((((((enum ParamKeyType)digits[2]) << PyLong_SHIFT) | (enum ParamKeyType)digits[1]) << PyLong_SHIFT) | (enum ParamKeyType)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(enum ParamKeyType) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum ParamKeyType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum ParamKeyType) - 1 > 3 * PyLong_SHIFT) { + return (enum ParamKeyType) ((((((((enum ParamKeyType)digits[2]) << PyLong_SHIFT) | (enum ParamKeyType)digits[1]) << PyLong_SHIFT) | (enum ParamKeyType)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(enum ParamKeyType) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum ParamKeyType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum ParamKeyType) - 1 > 4 * PyLong_SHIFT) { + return (enum ParamKeyType) (((enum ParamKeyType)-1)*(((((((((enum ParamKeyType)digits[3]) << PyLong_SHIFT) | (enum ParamKeyType)digits[2]) << PyLong_SHIFT) | (enum ParamKeyType)digits[1]) << PyLong_SHIFT) | (enum ParamKeyType)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(enum ParamKeyType) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(enum ParamKeyType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(enum ParamKeyType) - 1 > 4 * PyLong_SHIFT) { + return (enum ParamKeyType) ((((((((((enum ParamKeyType)digits[3]) << PyLong_SHIFT) | (enum ParamKeyType)digits[2]) << PyLong_SHIFT) | (enum ParamKeyType)digits[1]) << PyLong_SHIFT) | (enum ParamKeyType)digits[0]))); + } + } + break; + } +#endif + if (sizeof(enum ParamKeyType) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(enum ParamKeyType, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum ParamKeyType) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(enum ParamKeyType, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + enum ParamKeyType val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (enum ParamKeyType) -1; + } + } else { + enum ParamKeyType val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (enum ParamKeyType) -1; + val = __Pyx_PyInt_As_enum__ParamKeyType(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to enum ParamKeyType"); + return (enum ParamKeyType) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to enum ParamKeyType"); + return (enum ParamKeyType) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; ip) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/common/params_pyx.pyx b/common/params_pyx.pyx new file mode 100755 index 000000000..a8c43c2f2 --- /dev/null +++ b/common/params_pyx.pyx @@ -0,0 +1,105 @@ +# distutils: language = c++ +# cython: language_level = 3 +from libcpp cimport bool +from libcpp.string cimport string +import threading + +cdef extern from "selfdrive/common/params.h": + cpdef enum ParamKeyType: + PERSISTENT + CLEAR_ON_MANAGER_START + CLEAR_ON_IGNITION_ON + CLEAR_ON_IGNITION_OFF + ALL + + cdef cppclass c_Params "Params": + c_Params(string) nogil + string get(string, bool) nogil + bool getBool(string) nogil + int remove(string) nogil + int put(string, string) nogil + int putBool(string, bool) nogil + bool checkKey(string) nogil + void clearAll(ParamKeyType) + + +def ensure_bytes(v): + return v.encode() if isinstance(v, str) else v; + +class UnknownKeyName(Exception): + pass + +cdef class Params: + cdef c_Params* p + + def __cinit__(self, d=""): + cdef string path = d.encode() + with nogil: + self.p = new c_Params(path) + + def __dealloc__(self): + del self.p + + def clear_all(self, tx_type=ParamKeyType.ALL): + self.p.clearAll(tx_type) + + def check_key(self, key): + key = ensure_bytes(key) + if not self.p.checkKey(key): + raise UnknownKeyName(key) + return key + + def get(self, key, bool block=False, encoding=None): + cdef string k = self.check_key(key) + cdef string val + with nogil: + val = self.p.get(k, block) + + if val == b"": + if block: + # If we got no value while running in blocked mode + # it means we got an interrupt while waiting + raise KeyboardInterrupt + else: + return None + + return val if encoding is None else val.decode(encoding) + + def get_bool(self, key): + cdef string k = self.check_key(key) + cdef bool r + with nogil: + r = self.p.getBool(k) + return r + + def put(self, key, dat): + """ + Warning: This function blocks until the param is written to disk! + In very rare cases this can take over a second, and your code will hang. + Use the put_nonblocking helper function in time sensitive code, but + in general try to avoid writing params as much as possible. + """ + cdef string k = self.check_key(key) + cdef string dat_bytes = ensure_bytes(dat) + with nogil: + self.p.put(k, dat_bytes) + + def put_bool(self, key, bool val): + cdef string k = self.check_key(key) + with nogil: + self.p.putBool(k, val) + + def delete(self, key): + cdef string k = self.check_key(key) + with nogil: + self.p.remove(k) + +def put_nonblocking(key, val, d=""): + def f(key, val): + params = Params(d) + cdef string k = ensure_bytes(key) + params.put(k, val) + + t = threading.Thread(target=f, args=(key, val)) + t.start() + return t diff --git a/common/params_pyx.so b/common/params_pyx.so new file mode 100755 index 000000000..3f4eee2db Binary files /dev/null and b/common/params_pyx.so differ diff --git a/common/profiler.py b/common/profiler.py new file mode 100644 index 000000000..8b1a7a8cf --- /dev/null +++ b/common/profiler.py @@ -0,0 +1,45 @@ +import time + +class Profiler(): + def __init__(self, enabled=False): + self.enabled = enabled + self.cp = {} + self.cp_ignored = [] + self.iter = 0 + self.start_time = time.time() + self.last_time = self.start_time + self.tot = 0. + + def reset(self, enabled=False): + self.enabled = enabled + self.cp = {} + self.cp_ignored = [] + self.iter = 0 + self.start_time = time.time() + self.last_time = self.start_time + + def checkpoint(self, name, ignore=False): + # ignore flag needed when benchmarking threads with ratekeeper + if not self.enabled: + return + tt = time.time() + if name not in self.cp: + self.cp[name] = 0. + if ignore: + self.cp_ignored.append(name) + self.cp[name] += tt - self.last_time + if not ignore: + self.tot += tt - self.last_time + self.last_time = tt + + def display(self): + if not self.enabled: + return + self.iter += 1 + print("******* Profiling %d *******" % self.iter) + for n, ms in sorted(self.cp.items(), key=lambda x: -x[1]): + if n in self.cp_ignored: + print("%30s: %9.2f avg: %7.2f percent: %3.0f IGNORED" % (n, ms*1000.0, ms*1000.0/self.iter, ms/self.tot*100)) + else: + print("%30s: %9.2f avg: %7.2f percent: %3.0f" % (n, ms*1000.0, ms*1000.0/self.iter, ms/self.tot*100)) + print(f"Iter clock: {self.tot / self.iter:2.6f} TOTAL: {self.tot:2.2f}") diff --git a/common/realtime.py b/common/realtime.py new file mode 100644 index 000000000..d577680ae --- /dev/null +++ b/common/realtime.py @@ -0,0 +1,86 @@ +"""Utilities for reading real time clocks and keeping soft real time constraints.""" +import gc +import os +import time +import multiprocessing +from typing import Optional + +from common.clock import sec_since_boot # pylint: disable=no-name-in-module, import-error +from selfdrive.hardware import PC, TICI + + +# time step for each process +DT_CTRL = 0.01 # controlsd +DT_MDL = 0.05 # model +DT_TRML = 0.5 # thermald and manager + +# driver monitoring +if TICI: + DT_DMON = 0.05 +else: + DT_DMON = 0.1 + + +class Priority: + # CORE 2 + # - modeld = 55 + # - camerad = 54 + CTRL_LOW = 51 # plannerd & radard + + # CORE 3 + # - boardd = 55 + CTRL_HIGH = 53 + + +def set_realtime_priority(level: int) -> None: + if not PC: + os.sched_setscheduler(0, os.SCHED_FIFO, os.sched_param(level)) # type: ignore[attr-defined] + + +def set_core_affinity(core: int) -> None: + if not PC: + os.sched_setaffinity(0, [core,]) # type: ignore[attr-defined] + + +def config_realtime_process(core: int, priority: int) -> None: + gc.disable() + set_realtime_priority(priority) + set_core_affinity(core) + + +class Ratekeeper: + def __init__(self, rate: int, print_delay_threshold: Optional[float] = 0.0) -> None: + """Rate in Hz for ratekeeping. print_delay_threshold must be nonnegative.""" + self._interval = 1. / rate + self._next_frame_time = sec_since_boot() + self._interval + self._print_delay_threshold = print_delay_threshold + self._frame = 0 + self._remaining = 0.0 + self._process_name = multiprocessing.current_process().name + + @property + def frame(self) -> int: + return self._frame + + @property + def remaining(self) -> float: + return self._remaining + + # Maintain loop rate by calling this at the end of each loop + def keep_time(self) -> bool: + lagged = self.monitor_time() + if self._remaining > 0: + time.sleep(self._remaining) + return lagged + + # this only monitor the cumulative lag, but does not enforce a rate + def monitor_time(self) -> bool: + lagged = False + remaining = self._next_frame_time - sec_since_boot() + self._next_frame_time += self._interval + if self._print_delay_threshold is not None and remaining < -self._print_delay_threshold: + print(f"{self._process_name} lagging by {-remaining * 1000:.2f} ms") + lagged = True + self._frame += 1 + self._remaining = remaining + return lagged diff --git a/common/spinner.py b/common/spinner.py new file mode 100644 index 000000000..57242d644 --- /dev/null +++ b/common/spinner.py @@ -0,0 +1,52 @@ +import os +import subprocess +from common.basedir import BASEDIR + + +class Spinner(): + def __init__(self): + try: + self.spinner_proc = subprocess.Popen(["./spinner"], + stdin=subprocess.PIPE, + cwd=os.path.join(BASEDIR, "selfdrive", "ui"), + close_fds=True) + except OSError: + self.spinner_proc = None + + def __enter__(self): + return self + + def update(self, spinner_text: str): + if self.spinner_proc is not None: + self.spinner_proc.stdin.write(spinner_text.encode('utf8') + b"\n") + try: + self.spinner_proc.stdin.flush() + except BrokenPipeError: + pass + + def update_progress(self, cur: float, total: float): + self.update(str(round(100 * cur / total))) + + def close(self): + if self.spinner_proc is not None: + try: + self.spinner_proc.stdin.close() + except BrokenPipeError: + pass + self.spinner_proc.terminate() + self.spinner_proc = None + + def __del__(self): + self.close() + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + +if __name__ == "__main__": + import time + with Spinner() as s: + s.update("Spinner text") + time.sleep(5.0) + print("gone") + time.sleep(5.0) diff --git a/common/stat_live.py b/common/stat_live.py new file mode 100644 index 000000000..a91c1819b --- /dev/null +++ b/common/stat_live.py @@ -0,0 +1,73 @@ +import numpy as np + +class RunningStat(): + # tracks realtime mean and standard deviation without storing any data + def __init__(self, priors=None, max_trackable=-1): + self.max_trackable = max_trackable + if priors is not None: + # initialize from history + self.M = priors[0] + self.S = priors[1] + self.n = priors[2] + self.M_last = self.M + self.S_last = self.S + + else: + self.reset() + + def reset(self): + self.M = 0. + self.S = 0. + self.M_last = 0. + self.S_last = 0. + self.n = 0 + + def push_data(self, new_data): + # short term memory hack + if self.max_trackable < 0 or self.n < self.max_trackable: + self.n += 1 + if self.n == 0: + self.M_last = new_data + self.M = self.M_last + self.S_last = 0. + else: + self.M = self.M_last + (new_data - self.M_last) / self.n + self.S = self.S_last + (new_data - self.M_last) * (new_data - self.M) + self.M_last = self.M + self.S_last = self.S + + def mean(self): + return self.M + + def variance(self): + if self.n >= 2: + return self.S / (self.n - 1.) + else: + return 0 + + def std(self): + return np.sqrt(self.variance()) + + def params_to_save(self): + return [self.M, self.S, self.n] + +class RunningStatFilter(): + def __init__(self, raw_priors=None, filtered_priors=None, max_trackable=-1): + self.raw_stat = RunningStat(raw_priors, -1) + self.filtered_stat = RunningStat(filtered_priors, max_trackable) + + def reset(self): + self.raw_stat.reset() + self.filtered_stat.reset() + + def push_and_update(self, new_data): + _std_last = self.raw_stat.std() + self.raw_stat.push_data(new_data) + _delta_std = self.raw_stat.std() - _std_last + if _delta_std <= 0: + self.filtered_stat.push_data(new_data) + else: + pass + # self.filtered_stat.push_data(self.filtered_stat.mean()) + +# class SequentialBayesian(): diff --git a/common/text_window.py b/common/text_window.py new file mode 100755 index 000000000..bea3a149f --- /dev/null +++ b/common/text_window.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +import os +import time +import subprocess +from common.basedir import BASEDIR + + +class TextWindow: + def __init__(self, text): + try: + self.text_proc = subprocess.Popen(["./text", text], + stdin=subprocess.PIPE, + cwd=os.path.join(BASEDIR, "selfdrive", "ui"), + close_fds=True) + except OSError: + self.text_proc = None + + def get_status(self): + if self.text_proc is not None: + self.text_proc.poll() + return self.text_proc.returncode + return None + + def __enter__(self): + return self + + def close(self): + if self.text_proc is not None: + self.text_proc.terminate() + self.text_proc = None + + def wait_for_exit(self): + if self.text_proc is not None: + while True: + if self.get_status() == 1: + return + time.sleep(0.1) + + def __del__(self): + self.close() + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + +if __name__ == "__main__": + text = """Traceback (most recent call last): + File "./controlsd.py", line 608, in + main() + File "./controlsd.py", line 604, in main + controlsd_thread(sm, pm, logcan) + File "./controlsd.py", line 455, in controlsd_thread + 1/0 +ZeroDivisionError: division by zero""" + print(text) + + with TextWindow(text) as s: + for _ in range(100): + if s.get_status() == 1: + print("Got exit button") + break + time.sleep(0.1) + print("gone") diff --git a/common/timeout.py b/common/timeout.py new file mode 100644 index 000000000..d0b0ce063 --- /dev/null +++ b/common/timeout.py @@ -0,0 +1,27 @@ +import signal + +class TimeoutException(Exception): + pass + +class Timeout: + """ + Timeout context manager. + For example this code will raise a TimeoutException: + with Timeout(seconds=5, error_msg="Sleep was too long"): + time.sleep(10) + """ + def __init__(self, seconds, error_msg=None): + if error_msg is None: + error_msg = f'Timed out after {seconds} seconds' + self.seconds = seconds + self.error_msg = error_msg + + def handle_timeout(self, signume, frame): + raise TimeoutException(self.error_msg) + + def __enter__(self): + signal.signal(signal.SIGALRM, self.handle_timeout) + signal.alarm(self.seconds) + + def __exit__(self, exc_type, exc_val, exc_tb): + signal.alarm(0) diff --git a/common/transformations/SConscript b/common/transformations/SConscript new file mode 100644 index 000000000..ee9b9a2b7 --- /dev/null +++ b/common/transformations/SConscript @@ -0,0 +1,6 @@ +Import('env', 'envCython') + +transformations = env.Library('transformations', ['orientation.cc', 'coordinates.cc']) +Export('transformations') + +envCython.Program('transformations.so', 'transformations.pyx') diff --git a/common/transformations/__init__.py b/common/transformations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/common/transformations/camera.py b/common/transformations/camera.py new file mode 100644 index 000000000..7573877a3 --- /dev/null +++ b/common/transformations/camera.py @@ -0,0 +1,179 @@ +import numpy as np + +import common.transformations.orientation as orient +from selfdrive.hardware import TICI + +## -- hardcoded hardware params -- +eon_f_focal_length = 910.0 +eon_d_focal_length = 650.0 +tici_f_focal_length = 2648.0 +tici_e_focal_length = tici_d_focal_length = 567.0 # probably wrong? magnification is not consistent across frame + +eon_f_frame_size = (1164, 874) +eon_d_frame_size = (816, 612) +tici_f_frame_size = tici_e_frame_size = tici_d_frame_size = (1928, 1208) + +# aka 'K' aka camera_frame_from_view_frame +eon_fcam_intrinsics = np.array([ + [eon_f_focal_length, 0.0, float(eon_f_frame_size[0])/2], + [0.0, eon_f_focal_length, float(eon_f_frame_size[1])/2], + [0.0, 0.0, 1.0]]) +eon_intrinsics = eon_fcam_intrinsics # xx + +eon_dcam_intrinsics = np.array([ + [eon_d_focal_length, 0.0, float(eon_d_frame_size[0])/2], + [0.0, eon_d_focal_length, float(eon_d_frame_size[1])/2], + [0.0, 0.0, 1.0]]) + +tici_fcam_intrinsics = np.array([ + [tici_f_focal_length, 0.0, float(tici_f_frame_size[0])/2], + [0.0, tici_f_focal_length, float(tici_f_frame_size[1])/2], + [0.0, 0.0, 1.0]]) + +tici_dcam_intrinsics = np.array([ + [tici_d_focal_length, 0.0, float(tici_d_frame_size[0])/2], + [0.0, tici_d_focal_length, float(tici_d_frame_size[1])/2], + [0.0, 0.0, 1.0]]) + +tici_ecam_intrinsics = tici_dcam_intrinsics + +# aka 'K_inv' aka view_frame_from_camera_frame +eon_fcam_intrinsics_inv = np.linalg.inv(eon_fcam_intrinsics) +eon_intrinsics_inv = eon_fcam_intrinsics_inv # xx + +tici_fcam_intrinsics_inv = np.linalg.inv(tici_fcam_intrinsics) +tici_ecam_intrinsics_inv = np.linalg.inv(tici_ecam_intrinsics) + + +if not TICI: + FULL_FRAME_SIZE = eon_f_frame_size + FOCAL = eon_f_focal_length + fcam_intrinsics = eon_fcam_intrinsics +else: + FULL_FRAME_SIZE = tici_f_frame_size + FOCAL = tici_f_focal_length + fcam_intrinsics = tici_fcam_intrinsics + +W, H = FULL_FRAME_SIZE[0], FULL_FRAME_SIZE[1] + + +# device/mesh : x->forward, y-> right, z->down +# view : x->right, y->down, z->forward +device_frame_from_view_frame = np.array([ + [ 0., 0., 1.], + [ 1., 0., 0.], + [ 0., 1., 0.] +]) +view_frame_from_device_frame = device_frame_from_view_frame.T + + +def get_calib_from_vp(vp): + vp_norm = normalize(vp) + yaw_calib = np.arctan(vp_norm[0]) + pitch_calib = -np.arctan(vp_norm[1]*np.cos(yaw_calib)) + roll_calib = 0 + return roll_calib, pitch_calib, yaw_calib + + +# aka 'extrinsic_matrix' +# road : x->forward, y -> left, z->up +def get_view_frame_from_road_frame(roll, pitch, yaw, height): + device_from_road = orient.rot_from_euler([roll, pitch, yaw]).dot(np.diag([1, -1, -1])) + view_from_road = view_frame_from_device_frame.dot(device_from_road) + return np.hstack((view_from_road, [[0], [height], [0]])) + + +# aka 'extrinsic_matrix' +def get_view_frame_from_calib_frame(roll, pitch, yaw, height): + device_from_calib= orient.rot_from_euler([roll, pitch, yaw]) + view_from_calib = view_frame_from_device_frame.dot(device_from_calib) + return np.hstack((view_from_calib, [[0], [height], [0]])) + + +def vp_from_ke(m): + """ + Computes the vanishing point from the product of the intrinsic and extrinsic + matrices C = KE. + + The vanishing point is defined as lim x->infinity C (x, 0, 0, 1).T + """ + return (m[0, 0]/m[2, 0], m[1, 0]/m[2, 0]) + + +def vp_from_rpy(rpy, intrinsics=fcam_intrinsics): + e = get_view_frame_from_road_frame(rpy[0], rpy[1], rpy[2], 1.22) + ke = np.dot(intrinsics, e) + return vp_from_ke(ke) + + +def roll_from_ke(m): + # note: different from calibration.h/RollAnglefromKE: i think that one's just wrong + return np.arctan2(-(m[1, 0] - m[1, 1] * m[2, 0] / m[2, 1]), + -(m[0, 0] - m[0, 1] * m[2, 0] / m[2, 1])) + + +def normalize(img_pts, intrinsics=fcam_intrinsics): + # normalizes image coordinates + # accepts single pt or array of pts + intrinsics_inv = np.linalg.inv(intrinsics) + img_pts = np.array(img_pts) + input_shape = img_pts.shape + img_pts = np.atleast_2d(img_pts) + img_pts = np.hstack((img_pts, np.ones((img_pts.shape[0], 1)))) + img_pts_normalized = img_pts.dot(intrinsics_inv.T) + img_pts_normalized[(img_pts < 0).any(axis=1)] = np.nan + return img_pts_normalized[:, :2].reshape(input_shape) + + +def denormalize(img_pts, intrinsics=fcam_intrinsics, width=np.inf, height=np.inf): + # denormalizes image coordinates + # accepts single pt or array of pts + img_pts = np.array(img_pts) + input_shape = img_pts.shape + img_pts = np.atleast_2d(img_pts) + img_pts = np.hstack((img_pts, np.ones((img_pts.shape[0], 1), dtype=img_pts.dtype))) + img_pts_denormalized = img_pts.dot(intrinsics.T) + if np.isfinite(width): + img_pts_denormalized[img_pts_denormalized[:, 0] > width] = np.nan + img_pts_denormalized[img_pts_denormalized[:, 0] < 0] = np.nan + if np.isfinite(height): + img_pts_denormalized[img_pts_denormalized[:, 1] > height] = np.nan + img_pts_denormalized[img_pts_denormalized[:, 1] < 0] = np.nan + return img_pts_denormalized[:, :2].reshape(input_shape) + + +def device_from_ecef(pos_ecef, orientation_ecef, pt_ecef): + # device from ecef frame + # device frame is x -> forward, y-> right, z -> down + # accepts single pt or array of pts + input_shape = pt_ecef.shape + pt_ecef = np.atleast_2d(pt_ecef) + ecef_from_device_rot = orient.rotations_from_quats(orientation_ecef) + device_from_ecef_rot = ecef_from_device_rot.T + pt_ecef_rel = pt_ecef - pos_ecef + pt_device = np.einsum('jk,ik->ij', device_from_ecef_rot, pt_ecef_rel) + return pt_device.reshape(input_shape) + + +def img_from_device(pt_device): + # img coordinates from pts in device frame + # first transforms to view frame, then to img coords + # accepts single pt or array of pts + input_shape = pt_device.shape + pt_device = np.atleast_2d(pt_device) + pt_view = np.einsum('jk,ik->ij', view_frame_from_device_frame, pt_device) + + # This function should never return negative depths + pt_view[pt_view[:, 2] < 0] = np.nan + + pt_img = pt_view/pt_view[:, 2:3] + return pt_img.reshape(input_shape)[:, :2] + + +def get_camera_frame_from_calib_frame(camera_frame_from_road_frame, intrinsics=fcam_intrinsics): + camera_frame_from_ground = camera_frame_from_road_frame[:, (0, 1, 3)] + calib_frame_from_ground = np.dot(intrinsics, + get_view_frame_from_road_frame(0, 0, 0, 1.22))[:, (0, 1, 3)] + ground_from_calib_frame = np.linalg.inv(calib_frame_from_ground) + camera_frame_from_calib_frame = np.dot(camera_frame_from_ground, ground_from_calib_frame) + return camera_frame_from_calib_frame diff --git a/common/transformations/coordinates.cc b/common/transformations/coordinates.cc new file mode 100644 index 000000000..b729ac3d8 --- /dev/null +++ b/common/transformations/coordinates.cc @@ -0,0 +1,102 @@ +#define _USE_MATH_DEFINES + +#include +#include +#include + +#include "coordinates.hpp" + + + +double a = 6378137; // lgtm [cpp/short-global-name] +double b = 6356752.3142; // lgtm [cpp/short-global-name] +double esq = 6.69437999014 * 0.001; // lgtm [cpp/short-global-name] +double e1sq = 6.73949674228 * 0.001; + + +static Geodetic to_degrees(Geodetic geodetic){ + geodetic.lat = RAD2DEG(geodetic.lat); + geodetic.lon = RAD2DEG(geodetic.lon); + return geodetic; +} + +static Geodetic to_radians(Geodetic geodetic){ + geodetic.lat = DEG2RAD(geodetic.lat); + geodetic.lon = DEG2RAD(geodetic.lon); + return geodetic; +} + + +ECEF geodetic2ecef(Geodetic g){ + g = to_radians(g); + double xi = sqrt(1.0 - esq * pow(sin(g.lat), 2)); + double x = (a / xi + g.alt) * cos(g.lat) * cos(g.lon); + double y = (a / xi + g.alt) * cos(g.lat) * sin(g.lon); + double z = (a / xi * (1.0 - esq) + g.alt) * sin(g.lat); + return {x, y, z}; +} + +Geodetic ecef2geodetic(ECEF e){ + // Convert from ECEF to geodetic using Ferrari's methods + // https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#Ferrari.27s_solution + double x = e.x; + double y = e.y; + double z = e.z; + + double r = sqrt(x * x + y * y); + double Esq = a * a - b * b; + double F = 54 * b * b * z * z; + double G = r * r + (1 - esq) * z * z - esq * Esq; + double C = (esq * esq * F * r * r) / (pow(G, 3)); + double S = cbrt(1 + C + sqrt(C * C + 2 * C)); + double P = F / (3 * pow((S + 1 / S + 1), 2) * G * G); + double Q = sqrt(1 + 2 * esq * esq * P); + double r_0 = -(P * esq * r) / (1 + Q) + sqrt(0.5 * a * a*(1 + 1.0 / Q) - P * (1 - esq) * z * z / (Q * (1 + Q)) - 0.5 * P * r * r); + double U = sqrt(pow((r - esq * r_0), 2) + z * z); + double V = sqrt(pow((r - esq * r_0), 2) + (1 - esq) * z * z); + double Z_0 = b * b * z / (a * V); + double h = U * (1 - b * b / (a * V)); + + double lat = atan((z + e1sq * Z_0) / r); + double lon = atan2(y, x); + + return to_degrees({lat, lon, h}); +} + +LocalCoord::LocalCoord(Geodetic g, ECEF e){ + init_ecef << e.x, e.y, e.z; + + g = to_radians(g); + + ned2ecef_matrix << + -sin(g.lat)*cos(g.lon), -sin(g.lon), -cos(g.lat)*cos(g.lon), + -sin(g.lat)*sin(g.lon), cos(g.lon), -cos(g.lat)*sin(g.lon), + cos(g.lat), 0, -sin(g.lat); + ecef2ned_matrix = ned2ecef_matrix.transpose(); +} + +NED LocalCoord::ecef2ned(ECEF e) { + Eigen::Vector3d ecef; + ecef << e.x, e.y, e.z; + + Eigen::Vector3d ned = (ecef2ned_matrix * (ecef - init_ecef)); + return {ned[0], ned[1], ned[2]}; +} + +ECEF LocalCoord::ned2ecef(NED n) { + Eigen::Vector3d ned; + ned << n.n, n.e, n.d; + + Eigen::Vector3d ecef = (ned2ecef_matrix * ned) + init_ecef; + return {ecef[0], ecef[1], ecef[2]}; +} + +NED LocalCoord::geodetic2ned(Geodetic g) { + ECEF e = ::geodetic2ecef(g); + return ecef2ned(e); +} + +Geodetic LocalCoord::ned2geodetic(NED n){ + ECEF e = ned2ecef(n); + return ::ecef2geodetic(e); +} diff --git a/common/transformations/coordinates.hpp b/common/transformations/coordinates.hpp new file mode 100644 index 000000000..f5ba0d3fe --- /dev/null +++ b/common/transformations/coordinates.hpp @@ -0,0 +1,41 @@ +#pragma once + +#define DEG2RAD(x) ((x) * M_PI / 180.0) +#define RAD2DEG(x) ((x) * 180.0 / M_PI) + +struct ECEF { + double x, y, z; + Eigen::Vector3d to_vector(){ + return Eigen::Vector3d(x, y, z); + } +}; + +struct NED { + double n, e, d; + Eigen::Vector3d to_vector(){ + return Eigen::Vector3d(n, e, d); + } +}; + +struct Geodetic { + double lat, lon, alt; + bool radians=false; +}; + +ECEF geodetic2ecef(Geodetic g); +Geodetic ecef2geodetic(ECEF e); + +class LocalCoord { +public: + Eigen::Matrix3d ned2ecef_matrix; + Eigen::Matrix3d ecef2ned_matrix; + Eigen::Vector3d init_ecef; + LocalCoord(Geodetic g, ECEF e); + LocalCoord(Geodetic g) : LocalCoord(g, ::geodetic2ecef(g)) {} + LocalCoord(ECEF e) : LocalCoord(::ecef2geodetic(e), e) {} + + NED ecef2ned(ECEF e); + ECEF ned2ecef(NED n); + NED geodetic2ned(Geodetic g); + Geodetic ned2geodetic(NED n); +}; diff --git a/common/transformations/coordinates.py b/common/transformations/coordinates.py new file mode 100644 index 000000000..46cc0ded0 --- /dev/null +++ b/common/transformations/coordinates.py @@ -0,0 +1,19 @@ +# pylint: skip-file +from common.transformations.orientation import numpy_wrap +from common.transformations.transformations import (ecef2geodetic_single, + geodetic2ecef_single) +from common.transformations.transformations import LocalCoord as LocalCoord_single + + +class LocalCoord(LocalCoord_single): + ecef2ned = numpy_wrap(LocalCoord_single.ecef2ned_single, (3,), (3,)) + ned2ecef = numpy_wrap(LocalCoord_single.ned2ecef_single, (3,), (3,)) + geodetic2ned = numpy_wrap(LocalCoord_single.geodetic2ned_single, (3,), (3,)) + ned2geodetic = numpy_wrap(LocalCoord_single.ned2geodetic_single, (3,), (3,)) + + +geodetic2ecef = numpy_wrap(geodetic2ecef_single, (3,), (3,)) +ecef2geodetic = numpy_wrap(ecef2geodetic_single, (3,), (3,)) + +geodetic_from_ecef = ecef2geodetic +ecef_from_geodetic = geodetic2ecef diff --git a/common/transformations/model.py b/common/transformations/model.py new file mode 100644 index 000000000..5d6458fad --- /dev/null +++ b/common/transformations/model.py @@ -0,0 +1,178 @@ +import numpy as np + +from common.transformations.camera import (FULL_FRAME_SIZE, + FOCAL, + get_view_frame_from_road_frame, + get_view_frame_from_calib_frame, + vp_from_ke) + +# segnet +SEGNET_SIZE = (512, 384) + +def get_segnet_frame_from_camera_frame(segnet_size=SEGNET_SIZE, full_frame_size=FULL_FRAME_SIZE): + return np.array([[float(segnet_size[0]) / full_frame_size[0], 0.0], + [0.0, float(segnet_size[1]) / full_frame_size[1]]]) +segnet_frame_from_camera_frame = get_segnet_frame_from_camera_frame() # xx + +# model +MODEL_INPUT_SIZE = (320, 160) +MODEL_YUV_SIZE = (MODEL_INPUT_SIZE[0], MODEL_INPUT_SIZE[1] * 3 // 2) +MODEL_CX = MODEL_INPUT_SIZE[0] / 2. +MODEL_CY = 21. + +model_fl = 728.0 +model_height = 1.22 + +# canonical model transform +model_intrinsics = np.array([ + [model_fl, 0.0, MODEL_CX], + [0.0, model_fl, MODEL_CY], + [0.0, 0.0, 1.0]]) + + +# MED model +MEDMODEL_INPUT_SIZE = (512, 256) +MEDMODEL_YUV_SIZE = (MEDMODEL_INPUT_SIZE[0], MEDMODEL_INPUT_SIZE[1] * 3 // 2) +MEDMODEL_CY = 47.6 + +medmodel_fl = 910.0 +medmodel_intrinsics = np.array([ + [medmodel_fl, 0.0, 0.5 * MEDMODEL_INPUT_SIZE[0]], + [0.0, medmodel_fl, MEDMODEL_CY], + [0.0, 0.0, 1.0]]) + + +# CAL model +CALMODEL_INPUT_SIZE = (512, 256) +CALMODEL_YUV_SIZE = (CALMODEL_INPUT_SIZE[0], CALMODEL_INPUT_SIZE[1] * 3 // 2) +CALMODEL_CY = 47.6 + +calmodel_fl = 606.7 +calmodel_intrinsics = np.array([ + [calmodel_fl, 0.0, 0.5 * CALMODEL_INPUT_SIZE[0]], + [0.0, calmodel_fl, CALMODEL_CY], + [0.0, 0.0, 1.0]]) + + +# BIG model +BIGMODEL_INPUT_SIZE = (1024, 512) +BIGMODEL_YUV_SIZE = (BIGMODEL_INPUT_SIZE[0], BIGMODEL_INPUT_SIZE[1] * 3 // 2) + +bigmodel_fl = 910.0 +bigmodel_intrinsics = np.array([ + [bigmodel_fl, 0.0, 0.5 * BIGMODEL_INPUT_SIZE[0]], + [0.0, bigmodel_fl, 256 + MEDMODEL_CY], + [0.0, 0.0, 1.0]]) + + +# SBIG model (big model with the size of small model) +SBIGMODEL_INPUT_SIZE = (512, 256) +SBIGMODEL_YUV_SIZE = (SBIGMODEL_INPUT_SIZE[0], SBIGMODEL_INPUT_SIZE[1] * 3 // 2) + +sbigmodel_fl = 455.0 +sbigmodel_intrinsics = np.array([ + [sbigmodel_fl, 0.0, 0.5 * SBIGMODEL_INPUT_SIZE[0]], + [0.0, sbigmodel_fl, 0.5 * (256 + MEDMODEL_CY)], + [0.0, 0.0, 1.0]]) + +model_frame_from_road_frame = np.dot(model_intrinsics, + get_view_frame_from_road_frame(0, 0, 0, model_height)) + +bigmodel_frame_from_road_frame = np.dot(bigmodel_intrinsics, + get_view_frame_from_road_frame(0, 0, 0, model_height)) + +bigmodel_frame_from_calib_frame = np.dot(bigmodel_intrinsics, + get_view_frame_from_calib_frame(0, 0, 0, 0)) + +sbigmodel_frame_from_road_frame = np.dot(sbigmodel_intrinsics, + get_view_frame_from_road_frame(0, 0, 0, model_height)) + +sbigmodel_frame_from_calib_frame = np.dot(sbigmodel_intrinsics, + get_view_frame_from_calib_frame(0, 0, 0, 0)) + +medmodel_frame_from_road_frame = np.dot(medmodel_intrinsics, + get_view_frame_from_road_frame(0, 0, 0, model_height)) + +medmodel_frame_from_calib_frame = np.dot(medmodel_intrinsics, + get_view_frame_from_calib_frame(0, 0, 0, 0)) + +model_frame_from_bigmodel_frame = np.dot(model_intrinsics, np.linalg.inv(bigmodel_intrinsics)) +medmodel_frame_from_bigmodel_frame = np.dot(medmodel_intrinsics, np.linalg.inv(bigmodel_intrinsics)) + + +# 'camera from model camera' +def get_model_height_transform(camera_frame_from_road_frame, height): + camera_frame_from_road_ground = np.dot(camera_frame_from_road_frame, np.array([ + [1, 0, 0], + [0, 1, 0], + [0, 0, 0], + [0, 0, 1], + ])) + + camera_frame_from_road_high = np.dot(camera_frame_from_road_frame, np.array([ + [1, 0, 0], + [0, 1, 0], + [0, 0, height - model_height], + [0, 0, 1], + ])) + + road_high_from_camera_frame = np.linalg.inv(camera_frame_from_road_high) + high_camera_from_low_camera = np.dot(camera_frame_from_road_ground, road_high_from_camera_frame) + + return high_camera_from_low_camera + + +# camera_frame_from_model_frame aka 'warp matrix' +# was: calibration.h/CalibrationTransform +def get_camera_frame_from_model_frame(camera_frame_from_road_frame, height=model_height, camera_fl=FOCAL): + vp = vp_from_ke(camera_frame_from_road_frame) + + model_zoom = camera_fl / model_fl + model_camera_from_model_frame = np.array([ + [model_zoom, 0.0, vp[0] - MODEL_CX * model_zoom], + [0.0, model_zoom, vp[1] - MODEL_CY * model_zoom], + [0.0, 0.0, 1.0], + ]) + + # This function is super slow, so skip it if height is very close to canonical + # TODO: speed it up! + if abs(height - model_height) > 0.001: + camera_from_model_camera = get_model_height_transform(camera_frame_from_road_frame, height) + else: + camera_from_model_camera = np.eye(3) + + return np.dot(camera_from_model_camera, model_camera_from_model_frame) + + +def get_camera_frame_from_medmodel_frame(camera_frame_from_road_frame): + camera_frame_from_ground = camera_frame_from_road_frame[:, (0, 1, 3)] + medmodel_frame_from_ground = medmodel_frame_from_road_frame[:, (0, 1, 3)] + + ground_from_medmodel_frame = np.linalg.inv(medmodel_frame_from_ground) + camera_frame_from_medmodel_frame = np.dot(camera_frame_from_ground, ground_from_medmodel_frame) + + return camera_frame_from_medmodel_frame + + +def get_camera_frame_from_bigmodel_frame(camera_frame_from_road_frame): + camera_frame_from_ground = camera_frame_from_road_frame[:, (0, 1, 3)] + bigmodel_frame_from_ground = bigmodel_frame_from_road_frame[:, (0, 1, 3)] + + ground_from_bigmodel_frame = np.linalg.inv(bigmodel_frame_from_ground) + camera_frame_from_bigmodel_frame = np.dot(camera_frame_from_ground, ground_from_bigmodel_frame) + + return camera_frame_from_bigmodel_frame + + +def get_model_frame(snu_full, camera_frame_from_model_frame, size): + idxs = camera_frame_from_model_frame.dot(np.column_stack([np.tile(np.arange(size[0]), size[1]), + np.tile(np.arange(size[1]), (size[0], 1)).T.flatten(), + np.ones(size[0] * size[1])]).T).T.astype(int) + calib_flat = snu_full[idxs[:, 1], idxs[:, 0]] + if len(snu_full.shape) == 3: + calib = calib_flat.reshape((size[1], size[0], 3)) + elif len(snu_full.shape) == 2: + calib = calib_flat.reshape((size[1], size[0])) + else: + raise ValueError("shape of input img is weird") + return calib diff --git a/common/transformations/orientation.cc b/common/transformations/orientation.cc new file mode 100644 index 000000000..7909c0aff --- /dev/null +++ b/common/transformations/orientation.cc @@ -0,0 +1,144 @@ +#define _USE_MATH_DEFINES + +#include +#include +#include + +#include "orientation.hpp" +#include "coordinates.hpp" + +Eigen::Quaterniond ensure_unique(Eigen::Quaterniond quat){ + if (quat.w() > 0){ + return quat; + } else { + return Eigen::Quaterniond(-quat.w(), -quat.x(), -quat.y(), -quat.z()); + } +} + +Eigen::Quaterniond euler2quat(Eigen::Vector3d euler){ + Eigen::Quaterniond q; + + q = Eigen::AngleAxisd(euler(2), Eigen::Vector3d::UnitZ()) + * Eigen::AngleAxisd(euler(1), Eigen::Vector3d::UnitY()) + * Eigen::AngleAxisd(euler(0), Eigen::Vector3d::UnitX()); + return ensure_unique(q); +} + + +Eigen::Vector3d quat2euler(Eigen::Quaterniond quat){ + // TODO: switch to eigen implementation if the range of the Euler angles doesn't matter anymore + // Eigen::Vector3d euler = quat.toRotationMatrix().eulerAngles(2, 1, 0); + // return {euler(2), euler(1), euler(0)}; + double gamma = atan2(2 * (quat.w() * quat.x() + quat.y() * quat.z()), 1 - 2 * (quat.x()*quat.x() + quat.y()*quat.y())); + double asin_arg_clipped = std::clamp(2 * (quat.w() * quat.y() - quat.z() * quat.x()), -1.0, 1.0); + double theta = asin(asin_arg_clipped); + double psi = atan2(2 * (quat.w() * quat.z() + quat.x() * quat.y()), 1 - 2 * (quat.y()*quat.y() + quat.z()*quat.z())); + return {gamma, theta, psi}; +} + +Eigen::Matrix3d quat2rot(Eigen::Quaterniond quat){ + return quat.toRotationMatrix(); +} + +Eigen::Quaterniond rot2quat(const Eigen::Matrix3d &rot){ + return ensure_unique(Eigen::Quaterniond(rot)); +} + +Eigen::Matrix3d euler2rot(Eigen::Vector3d euler){ + return quat2rot(euler2quat(euler)); +} + +Eigen::Vector3d rot2euler(const Eigen::Matrix3d &rot){ + return quat2euler(rot2quat(rot)); +} + +Eigen::Matrix3d rot_matrix(double roll, double pitch, double yaw){ + return euler2rot({roll, pitch, yaw}); +} + +Eigen::Matrix3d rot(Eigen::Vector3d axis, double angle){ + Eigen::Quaterniond q; + q = Eigen::AngleAxisd(angle, axis); + return q.toRotationMatrix(); +} + + +Eigen::Vector3d ecef_euler_from_ned(ECEF ecef_init, Eigen::Vector3d ned_pose) { + /* + Using Rotations to Build Aerospace Coordinate Systems + Don Koks + https://apps.dtic.mil/dtic/tr/fulltext/u2/a484864.pdf + */ + LocalCoord converter = LocalCoord(ecef_init); + Eigen::Vector3d zero = ecef_init.to_vector(); + + Eigen::Vector3d x0 = converter.ned2ecef({1, 0, 0}).to_vector() - zero; + Eigen::Vector3d y0 = converter.ned2ecef({0, 1, 0}).to_vector() - zero; + Eigen::Vector3d z0 = converter.ned2ecef({0, 0, 1}).to_vector() - zero; + + Eigen::Vector3d x1 = rot(z0, ned_pose(2)) * x0; + Eigen::Vector3d y1 = rot(z0, ned_pose(2)) * y0; + Eigen::Vector3d z1 = rot(z0, ned_pose(2)) * z0; + + Eigen::Vector3d x2 = rot(y1, ned_pose(1)) * x1; + Eigen::Vector3d y2 = rot(y1, ned_pose(1)) * y1; + Eigen::Vector3d z2 = rot(y1, ned_pose(1)) * z1; + + Eigen::Vector3d x3 = rot(x2, ned_pose(0)) * x2; + Eigen::Vector3d y3 = rot(x2, ned_pose(0)) * y2; + + + x0 = Eigen::Vector3d(1, 0, 0); + y0 = Eigen::Vector3d(0, 1, 0); + z0 = Eigen::Vector3d(0, 0, 1); + + double psi = atan2(x3.dot(y0), x3.dot(x0)); + double theta = atan2(-x3.dot(z0), sqrt(pow(x3.dot(x0), 2) + pow(x3.dot(y0), 2))); + + y2 = rot(z0, psi) * y0; + z2 = rot(y2, theta) * z0; + + double phi = atan2(y3.dot(z2), y3.dot(y2)); + + return {phi, theta, psi}; +} + +Eigen::Vector3d ned_euler_from_ecef(ECEF ecef_init, Eigen::Vector3d ecef_pose){ + /* + Using Rotations to Build Aerospace Coordinate Systems + Don Koks + https://apps.dtic.mil/dtic/tr/fulltext/u2/a484864.pdf + */ + LocalCoord converter = LocalCoord(ecef_init); + + Eigen::Vector3d x0 = Eigen::Vector3d(1, 0, 0); + Eigen::Vector3d y0 = Eigen::Vector3d(0, 1, 0); + Eigen::Vector3d z0 = Eigen::Vector3d(0, 0, 1); + + Eigen::Vector3d x1 = rot(z0, ecef_pose(2)) * x0; + Eigen::Vector3d y1 = rot(z0, ecef_pose(2)) * y0; + Eigen::Vector3d z1 = rot(z0, ecef_pose(2)) * z0; + + Eigen::Vector3d x2 = rot(y1, ecef_pose(1)) * x1; + Eigen::Vector3d y2 = rot(y1, ecef_pose(1)) * y1; + Eigen::Vector3d z2 = rot(y1, ecef_pose(1)) * z1; + + Eigen::Vector3d x3 = rot(x2, ecef_pose(0)) * x2; + Eigen::Vector3d y3 = rot(x2, ecef_pose(0)) * y2; + + Eigen::Vector3d zero = ecef_init.to_vector(); + x0 = converter.ned2ecef({1, 0, 0}).to_vector() - zero; + y0 = converter.ned2ecef({0, 1, 0}).to_vector() - zero; + z0 = converter.ned2ecef({0, 0, 1}).to_vector() - zero; + + double psi = atan2(x3.dot(y0), x3.dot(x0)); + double theta = atan2(-x3.dot(z0), sqrt(pow(x3.dot(x0), 2) + pow(x3.dot(y0), 2))); + + y2 = rot(z0, psi) * y0; + z2 = rot(y2, theta) * z0; + + double phi = atan2(y3.dot(z2), y3.dot(y2)); + + return {phi, theta, psi}; +} + diff --git a/common/transformations/orientation.hpp b/common/transformations/orientation.hpp new file mode 100644 index 000000000..ebd7da0ae --- /dev/null +++ b/common/transformations/orientation.hpp @@ -0,0 +1,17 @@ +#pragma once +#include +#include "coordinates.hpp" + + +Eigen::Quaterniond ensure_unique(Eigen::Quaterniond quat); + +Eigen::Quaterniond euler2quat(Eigen::Vector3d euler); +Eigen::Vector3d quat2euler(Eigen::Quaterniond quat); +Eigen::Matrix3d quat2rot(Eigen::Quaterniond quat); +Eigen::Quaterniond rot2quat(const Eigen::Matrix3d &rot); +Eigen::Matrix3d euler2rot(Eigen::Vector3d euler); +Eigen::Vector3d rot2euler(const Eigen::Matrix3d &rot); +Eigen::Matrix3d rot_matrix(double roll, double pitch, double yaw); +Eigen::Matrix3d rot(Eigen::Vector3d axis, double angle); +Eigen::Vector3d ecef_euler_from_ned(ECEF ecef_init, Eigen::Vector3d ned_pose); +Eigen::Vector3d ned_euler_from_ecef(ECEF ecef_init, Eigen::Vector3d ecef_pose); diff --git a/common/transformations/orientation.py b/common/transformations/orientation.py new file mode 100644 index 000000000..415e247ab --- /dev/null +++ b/common/transformations/orientation.py @@ -0,0 +1,52 @@ +# pylint: skip-file +import numpy as np + +from common.transformations.transformations import (ecef_euler_from_ned_single, + euler2quat_single, + euler2rot_single, + ned_euler_from_ecef_single, + quat2euler_single, + quat2rot_single, + rot2euler_single, + rot2quat_single) + + +def numpy_wrap(function, input_shape, output_shape): + """Wrap a function to take either an input or list of inputs and return the correct shape""" + def f(*inps): + *args, inp = inps + inp = np.array(inp) + shape = inp.shape + + if len(shape) == len(input_shape): + out_shape = output_shape + else: + out_shape = (shape[0],) + output_shape + + # Add empty dimension if inputs is not a list + if len(shape) == len(input_shape): + inp.shape = (1, ) + inp.shape + + result = np.asarray([function(*args, i) for i in inp]) + result.shape = out_shape + return result + return f + + +euler2quat = numpy_wrap(euler2quat_single, (3,), (4,)) +quat2euler = numpy_wrap(quat2euler_single, (4,), (3,)) +quat2rot = numpy_wrap(quat2rot_single, (4,), (3, 3)) +rot2quat = numpy_wrap(rot2quat_single, (3, 3), (4,)) +euler2rot = numpy_wrap(euler2rot_single, (3,), (3, 3)) +rot2euler = numpy_wrap(rot2euler_single, (3, 3), (3,)) +ecef_euler_from_ned = numpy_wrap(ecef_euler_from_ned_single, (3,), (3,)) +ned_euler_from_ecef = numpy_wrap(ned_euler_from_ecef_single, (3,), (3,)) + +quats_from_rotations = rot2quat +quat_from_rot = rot2quat +rotations_from_quats = quat2rot +rot_from_quat = quat2rot +euler_from_rot = rot2euler +euler_from_quat = quat2euler +rot_from_euler = euler2rot +quat_from_euler = euler2quat diff --git a/common/transformations/transformations.cpp b/common/transformations/transformations.cpp new file mode 100644 index 000000000..4080d4a8b --- /dev/null +++ b/common/transformations/transformations.cpp @@ -0,0 +1,10462 @@ +/* Generated by Cython 0.29.26 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "common/transformations/coordinates.cc", + "common/transformations/coordinates.hpp", + "common/transformations/orientation.cc", + "common/transformations/orientation.hpp" + ], + "include_dirs": [ + "common/transformations", + "./common/transformations" + ], + "language": "c++", + "name": "common.transformations.transformations", + "sources": [ + "/data/openpilot/common/transformations/transformations.pyx" + ] + }, + "module_name": "common.transformations.transformations" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_26" +#define CYTHON_HEX_VERSION 0x001D1AF0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } + private: + T *ptr; +}; + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject* co=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(0))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too; + if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here + if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too; + Py_XDECREF((PyObject*)co); + co = (PyCodeObject*)call_result; + call_result = NULL; + if (0) { + cleanup_code_too: + Py_XDECREF((PyObject*)co); + co = NULL; + } + end: + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(call_result); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return co; + } +#else + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if defined(PyUnicode_IS_READY) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #else + #define __Pyx_PyUnicode_READY(op) (0) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__common__transformations__transformations +#define __PYX_HAVE_API__common__transformations__transformations +/* Early includes */ +#include "orientation.cc" +#include "orientation.hpp" +#include "coordinates.cc" +#include "coordinates.hpp" +#include +#include +#include "numpy/arrayobject.h" +#include "numpy/ndarrayobject.h" +#include "numpy/ndarraytypes.h" +#include "numpy/arrayscalars.h" +#include "numpy/ufuncobject.h" + + /* NumPy API declarations from "numpy/__init__.pxd" */ + +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +/* Header.proto */ +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "stringsource", + "common/transformations/transformations.pyx", + "__init__.pxd", + "type.pxd", +}; +/* BufferFormatStructs.proto */ +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; + struct __Pyx_StructField_* fields; + size_t size; + size_t arraysize[8]; + int ndim; + char typegroup; + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":690 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":691 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":692 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":693 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":697 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":698 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":699 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":700 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":704 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":705 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":714 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":715 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":716 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":718 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":719 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":720 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":722 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":723 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":725 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":726 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":727 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + + +/*--- Type declarations ---*/ +struct __pyx_obj_6common_15transformations_15transformations_LocalCoord; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":729 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":730 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":731 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":733 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* "common/transformations/transformations.pyx":115 + * + * + * cdef class LocalCoord: # <<<<<<<<<<<<<< + * cdef LocalCoord_c * lc + * + */ +struct __pyx_obj_6common_15transformations_15transformations_LocalCoord { + PyObject_HEAD + LocalCoord *lc; +}; + + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if CYTHON_FAST_PYCALL + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif // CYTHON_FAST_PYCALL +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* IsLittleEndian.proto */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); + +/* BufferFormatCheck.proto */ +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* BufferGetAndValidate.proto */ +#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\ + ((obj == Py_None || obj == NULL) ?\ + (__Pyx_ZeroBuffer(buf), 0) :\ + __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)) +static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static void __Pyx_ZeroBuffer(Py_buffer* buf); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); +static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 }; +static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ClassMethod.proto */ +#include "descrobject.h" +static CYTHON_UNUSED PyObject* __Pyx_Method_ClassMethod(PyObject *method); + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* BufferStructDeclare.proto */ +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +/* GCCDiagnostics.proto */ +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* RealImag.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if defined(__cplusplus) && CYTHON_CCOMPLEX\ + && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_float(a, b) ((a)==(b)) + #define __Pyx_c_sum_float(a, b) ((a)+(b)) + #define __Pyx_c_diff_float(a, b) ((a)-(b)) + #define __Pyx_c_prod_float(a, b) ((a)*(b)) + #define __Pyx_c_quot_float(a, b) ((a)/(b)) + #define __Pyx_c_neg_float(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_float(z) ((z)==(float)0) + #define __Pyx_c_conj_float(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_float(z) (::std::abs(z)) + #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_float(z) ((z)==0) + #define __Pyx_c_conj_float(z) (conjf(z)) + #if 1 + #define __Pyx_c_abs_float(z) (cabsf(z)) + #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_double(a, b) ((a)==(b)) + #define __Pyx_c_sum_double(a, b) ((a)+(b)) + #define __Pyx_c_diff_double(a, b) ((a)-(b)) + #define __Pyx_c_prod_double(a, b) ((a)*(b)) + #define __Pyx_c_quot_double(a, b) ((a)/(b)) + #define __Pyx_c_neg_double(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_double(z) ((z)==(double)0) + #define __Pyx_c_conj_double(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (::std::abs(z)) + #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_double(z) ((z)==0) + #define __Pyx_c_conj_double(z) (conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (cabs(z)) + #define __Pyx_c_pow_double(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + + +/* Module declarations from 'libcpp' */ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_generic = 0; +static PyTypeObject *__pyx_ptype_5numpy_number = 0; +static PyTypeObject *__pyx_ptype_5numpy_integer = 0; +static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_inexact = 0; +static PyTypeObject *__pyx_ptype_5numpy_floating = 0; +static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0; +static PyTypeObject *__pyx_ptype_5numpy_flexible = 0; +static PyTypeObject *__pyx_ptype_5numpy_character = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; + +/* Module declarations from 'common.transformations.transformations' */ +static PyTypeObject *__pyx_ptype_6common_15transformations_15transformations_LocalCoord = 0; +static PyArrayObject *__pyx_f_6common_15transformations_15transformations_matrix2numpy(Eigen::Matrix3d); /*proto*/ +static Eigen::Matrix3d __pyx_f_6common_15transformations_15transformations_numpy2matrix(PyArrayObject *); /*proto*/ +static struct ECEF __pyx_f_6common_15transformations_15transformations_list2ecef(PyObject *); /*proto*/ +static struct NED __pyx_f_6common_15transformations_15transformations_list2ned(PyObject *); /*proto*/ +static struct Geodetic __pyx_f_6common_15transformations_15transformations_list2geodetic(PyObject *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 }; +#define __Pyx_MODULE_NAME "common.transformations.transformations" +extern int __pyx_module_is_main_common__transformations__transformations; +int __pyx_module_is_main_common__transformations__transformations = 0; + +/* Implementation of 'common.transformations.transformations' */ +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_ImportError; +static const char __pyx_k_e[] = "e"; +static const char __pyx_k_g[] = "g"; +static const char __pyx_k_q[] = "q"; +static const char __pyx_k_r[] = "r"; +static const char __pyx_k_np[] = "np"; +static const char __pyx_k_rot[] = "rot"; +static const char __pyx_k_yaw[] = "yaw"; +static const char __pyx_k_ecef[] = "ecef"; +static const char __pyx_k_init[] = "init"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_pose[] = "pose"; +static const char __pyx_k_quat[] = "quat"; +static const char __pyx_k_roll[] = "roll"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_array[] = "array"; +static const char __pyx_k_dtype[] = "dtype"; +static const char __pyx_k_euler[] = "euler"; +static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_pitch[] = "pitch"; +static const char __pyx_k_double[] = "double"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_geodetic[] = "geodetic"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_ned_pose[] = "ned_pose"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_ecef_init[] = "ecef_init"; +static const char __pyx_k_ecef_pose[] = "ecef_pose"; +static const char __pyx_k_from_ecef[] = "from_ecef"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_LocalCoord[] = "LocalCoord"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_from_geodetic[] = "from_geodetic"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_asfortranarray[] = "asfortranarray"; +static const char __pyx_k_ecef2ned_matrix[] = "ecef2ned_matrix"; +static const char __pyx_k_ned2ecef_matrix[] = "ned2ecef_matrix"; +static const char __pyx_k_quat2rot_single[] = "quat2rot_single"; +static const char __pyx_k_rot2quat_single[] = "rot2quat_single"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_euler2rot_single[] = "euler2rot_single"; +static const char __pyx_k_rot2euler_single[] = "rot2euler_single"; +static const char __pyx_k_euler2quat_single[] = "euler2quat_single"; +static const char __pyx_k_quat2euler_single[] = "quat2euler_single"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_ecef2geodetic_single[] = "ecef2geodetic_single"; +static const char __pyx_k_geodetic2ecef_single[] = "geodetic2ecef_single"; +static const char __pyx_k_ecef_euler_from_ned_single[] = "ecef_euler_from_ned_single"; +static const char __pyx_k_ned_euler_from_ecef_single[] = "ned_euler_from_ecef_single"; +static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; +static const char __pyx_k_common_transformations_transform[] = "common/transformations/transformations.pyx"; +static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; +static const char __pyx_k_self_lc_cannot_be_converted_to_a[] = "self.lc cannot be converted to a Python object for pickling"; +static const char __pyx_k_common_transformations_transform_2[] = "common.transformations.transformations"; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_n_s_LocalCoord; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_array; +static PyObject *__pyx_n_s_asfortranarray; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_kp_s_common_transformations_transform; +static PyObject *__pyx_n_s_common_transformations_transform_2; +static PyObject *__pyx_n_s_double; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_ecef; +static PyObject *__pyx_n_s_ecef2geodetic_single; +static PyObject *__pyx_n_s_ecef2ned_matrix; +static PyObject *__pyx_n_s_ecef_euler_from_ned_single; +static PyObject *__pyx_n_s_ecef_init; +static PyObject *__pyx_n_s_ecef_pose; +static PyObject *__pyx_n_s_euler; +static PyObject *__pyx_n_s_euler2quat_single; +static PyObject *__pyx_n_s_euler2rot_single; +static PyObject *__pyx_n_s_from_ecef; +static PyObject *__pyx_n_s_from_geodetic; +static PyObject *__pyx_n_s_g; +static PyObject *__pyx_n_s_geodetic; +static PyObject *__pyx_n_s_geodetic2ecef_single; +static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_ned2ecef_matrix; +static PyObject *__pyx_n_s_ned_euler_from_ecef_single; +static PyObject *__pyx_n_s_ned_pose; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to; +static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor; +static PyObject *__pyx_n_s_pitch; +static PyObject *__pyx_n_s_pose; +static PyObject *__pyx_n_s_q; +static PyObject *__pyx_n_s_quat; +static PyObject *__pyx_n_s_quat2euler_single; +static PyObject *__pyx_n_s_quat2rot_single; +static PyObject *__pyx_n_s_r; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_reduce_ex; +static PyObject *__pyx_n_s_roll; +static PyObject *__pyx_n_s_rot; +static PyObject *__pyx_n_s_rot2euler_single; +static PyObject *__pyx_n_s_rot2quat_single; +static PyObject *__pyx_kp_s_self_lc_cannot_be_converted_to_a; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_yaw; +static PyObject *__pyx_pf_6common_15transformations_15transformations_euler2quat_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_euler); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_2quat2euler_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_quat); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_4quat2rot_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_quat); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_6rot2quat_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rot); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_8euler2rot_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_euler); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_10rot2euler_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rot); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_12rot_matrix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_roll, PyObject *__pyx_v_pitch, PyObject *__pyx_v_yaw); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_14ecef_euler_from_ned_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ecef_init, PyObject *__pyx_v_ned_pose); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_16ned_euler_from_ecef_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ecef_init, PyObject *__pyx_v_ecef_pose); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_18geodetic2ecef_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_geodetic); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_20ecef2geodetic_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ecef); /* proto */ +static int __pyx_pf_6common_15transformations_15transformations_10LocalCoord___init__(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self, PyObject *__pyx_v_geodetic, PyObject *__pyx_v_ecef); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_15ned2ecef_matrix___get__(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_15ecef2ned_matrix___get__(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_20ned_from_ecef_matrix___get__(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_20ecef_from_ned_matrix___get__(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_2from_geodetic(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_geodetic); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_4from_ecef(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_ecef); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_6ecef2ned_single(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self, PyObject *__pyx_v_ecef); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_8ned2ecef_single(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self, PyObject *__pyx_v_ned); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_10geodetic2ned_single(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self, PyObject *__pyx_v_geodetic); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_12ned2geodetic_single(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self, PyObject *__pyx_v_ned); /* proto */ +static void __pyx_pf_6common_15transformations_15transformations_10LocalCoord_14__dealloc__(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_6common_15transformations_15transformations_LocalCoord(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__24; +/* Late includes */ + +/* "common/transformations/transformations.pyx":24 + * cimport numpy as np + * + * cdef np.ndarray[double, ndim=2] matrix2numpy(Matrix3 m): # <<<<<<<<<<<<<< + * return np.array([ + * [m(0, 0), m(0, 1), m(0, 2)], + */ + +static PyArrayObject *__pyx_f_6common_15transformations_15transformations_matrix2numpy(Eigen::Matrix3d __pyx_v_m) { + PyArrayObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("matrix2numpy", 0); + + /* "common/transformations/transformations.pyx":25 + * + * cdef np.ndarray[double, ndim=2] matrix2numpy(Matrix3 m): + * return np.array([ # <<<<<<<<<<<<<< + * [m(0, 0), m(0, 1), m(0, 2)], + * [m(1, 0), m(1, 1), m(1, 2)], + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "common/transformations/transformations.pyx":26 + * cdef np.ndarray[double, ndim=2] matrix2numpy(Matrix3 m): + * return np.array([ + * [m(0, 0), m(0, 1), m(0, 2)], # <<<<<<<<<<<<<< + * [m(1, 0), m(1, 1), m(1, 2)], + * [m(2, 0), m(2, 1), m(2, 2)], + */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_m(0, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_m(0, 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_m(0, 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + + /* "common/transformations/transformations.pyx":27 + * return np.array([ + * [m(0, 0), m(0, 1), m(0, 2)], + * [m(1, 0), m(1, 1), m(1, 2)], # <<<<<<<<<<<<<< + * [m(2, 0), m(2, 1), m(2, 2)], + * ]) + */ + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_m(1, 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_m(1, 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_m(1, 2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_2); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_2 = 0; + + /* "common/transformations/transformations.pyx":28 + * [m(0, 0), m(0, 1), m(0, 2)], + * [m(1, 0), m(1, 1), m(1, 2)], + * [m(2, 0), m(2, 1), m(2, 2)], # <<<<<<<<<<<<<< + * ]) + * + */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_m(2, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_m(2, 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_m(2, 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = PyList_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_5); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + + /* "common/transformations/transformations.pyx":25 + * + * cdef np.ndarray[double, ndim=2] matrix2numpy(Matrix3 m): + * return np.array([ # <<<<<<<<<<<<<< + * [m(0, 0), m(0, 1), m(0, 2)], + * [m(1, 0), m(1, 1), m(1, 2)], + */ + __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_8); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 25, __pyx_L1_error) + __pyx_r = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":24 + * cimport numpy as np + * + * cdef np.ndarray[double, ndim=2] matrix2numpy(Matrix3 m): # <<<<<<<<<<<<<< + * return np.array([ + * [m(0, 0), m(0, 1), m(0, 2)], + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("common.transformations.transformations.matrix2numpy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":31 + * ]) + * + * cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m): # <<<<<<<<<<<<<< + * assert m.shape[0] == 3 + * assert m.shape[1] == 3 + */ + +static Eigen::Matrix3d __pyx_f_6common_15transformations_15transformations_numpy2matrix(PyArrayObject *__pyx_v_m) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_m; + __Pyx_Buffer __pyx_pybuffer_m; + Eigen::Matrix3d __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("numpy2matrix", 0); + __pyx_pybuffer_m.pybuffer.buf = NULL; + __pyx_pybuffer_m.refcount = 0; + __pyx_pybuffernd_m.data = NULL; + __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 31, __pyx_L1_error) + } + __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1]; + + /* "common/transformations/transformations.pyx":32 + * + * cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m): + * assert m.shape[0] == 3 # <<<<<<<<<<<<<< + * assert m.shape[1] == 3 + * return Matrix3(m.data) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!(((__pyx_v_m->dimensions[0]) == 3) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 32, __pyx_L1_error) + } + } + #endif + + /* "common/transformations/transformations.pyx":33 + * cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m): + * assert m.shape[0] == 3 + * assert m.shape[1] == 3 # <<<<<<<<<<<<<< + * return Matrix3(m.data) + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!(((__pyx_v_m->dimensions[1]) == 3) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 33, __pyx_L1_error) + } + } + #endif + + /* "common/transformations/transformations.pyx":34 + * assert m.shape[0] == 3 + * assert m.shape[1] == 3 + * return Matrix3(m.data) # <<<<<<<<<<<<<< + * + * cdef ECEF list2ecef(ecef): + */ + __pyx_r = Eigen::Matrix3d(((double *)__pyx_v_m->data)); + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":31 + * ]) + * + * cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m): # <<<<<<<<<<<<<< + * assert m.shape[0] == 3 + * assert m.shape[1] == 3 + */ + + /* function exit code */ + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_WriteUnraisable("common.transformations.transformations.numpy2matrix", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __Pyx_pretend_to_initialize(&__pyx_r); + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":36 + * return Matrix3(m.data) + * + * cdef ECEF list2ecef(ecef): # <<<<<<<<<<<<<< + * cdef ECEF e; + * e.x = ecef[0] + */ + +static struct ECEF __pyx_f_6common_15transformations_15transformations_list2ecef(PyObject *__pyx_v_ecef) { + struct ECEF __pyx_v_e; + struct ECEF __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list2ecef", 0); + + /* "common/transformations/transformations.pyx":38 + * cdef ECEF list2ecef(ecef): + * cdef ECEF e; + * e.x = ecef[0] # <<<<<<<<<<<<<< + * e.y = ecef[1] + * e.z = ecef[2] + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ecef, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_e.x = __pyx_t_2; + + /* "common/transformations/transformations.pyx":39 + * cdef ECEF e; + * e.x = ecef[0] + * e.y = ecef[1] # <<<<<<<<<<<<<< + * e.z = ecef[2] + * return e + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ecef, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_e.y = __pyx_t_2; + + /* "common/transformations/transformations.pyx":40 + * e.x = ecef[0] + * e.y = ecef[1] + * e.z = ecef[2] # <<<<<<<<<<<<<< + * return e + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ecef, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_e.z = __pyx_t_2; + + /* "common/transformations/transformations.pyx":41 + * e.y = ecef[1] + * e.z = ecef[2] + * return e # <<<<<<<<<<<<<< + * + * cdef NED list2ned(ned): + */ + __pyx_r = __pyx_v_e; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":36 + * return Matrix3(m.data) + * + * cdef ECEF list2ecef(ecef): # <<<<<<<<<<<<<< + * cdef ECEF e; + * e.x = ecef[0] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("common.transformations.transformations.list2ecef", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":43 + * return e + * + * cdef NED list2ned(ned): # <<<<<<<<<<<<<< + * cdef NED n; + * n.n = ned[0] + */ + +static struct NED __pyx_f_6common_15transformations_15transformations_list2ned(PyObject *__pyx_v_ned) { + struct NED __pyx_v_n; + struct NED __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list2ned", 0); + + /* "common/transformations/transformations.pyx":45 + * cdef NED list2ned(ned): + * cdef NED n; + * n.n = ned[0] # <<<<<<<<<<<<<< + * n.e = ned[1] + * n.d = ned[2] + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ned, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n.n = __pyx_t_2; + + /* "common/transformations/transformations.pyx":46 + * cdef NED n; + * n.n = ned[0] + * n.e = ned[1] # <<<<<<<<<<<<<< + * n.d = ned[2] + * return n + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ned, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n.e = __pyx_t_2; + + /* "common/transformations/transformations.pyx":47 + * n.n = ned[0] + * n.e = ned[1] + * n.d = ned[2] # <<<<<<<<<<<<<< + * return n + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ned, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n.d = __pyx_t_2; + + /* "common/transformations/transformations.pyx":48 + * n.e = ned[1] + * n.d = ned[2] + * return n # <<<<<<<<<<<<<< + * + * cdef Geodetic list2geodetic(geodetic): + */ + __pyx_r = __pyx_v_n; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":43 + * return e + * + * cdef NED list2ned(ned): # <<<<<<<<<<<<<< + * cdef NED n; + * n.n = ned[0] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("common.transformations.transformations.list2ned", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":50 + * return n + * + * cdef Geodetic list2geodetic(geodetic): # <<<<<<<<<<<<<< + * cdef Geodetic g + * g.lat = geodetic[0] + */ + +static struct Geodetic __pyx_f_6common_15transformations_15transformations_list2geodetic(PyObject *__pyx_v_geodetic) { + struct Geodetic __pyx_v_g; + struct Geodetic __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list2geodetic", 0); + + /* "common/transformations/transformations.pyx":52 + * cdef Geodetic list2geodetic(geodetic): + * cdef Geodetic g + * g.lat = geodetic[0] # <<<<<<<<<<<<<< + * g.lon = geodetic[1] + * g.alt = geodetic[2] + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_geodetic, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_g.lat = __pyx_t_2; + + /* "common/transformations/transformations.pyx":53 + * cdef Geodetic g + * g.lat = geodetic[0] + * g.lon = geodetic[1] # <<<<<<<<<<<<<< + * g.alt = geodetic[2] + * return g + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_geodetic, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 53, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_g.lon = __pyx_t_2; + + /* "common/transformations/transformations.pyx":54 + * g.lat = geodetic[0] + * g.lon = geodetic[1] + * g.alt = geodetic[2] # <<<<<<<<<<<<<< + * return g + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_geodetic, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 54, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_g.alt = __pyx_t_2; + + /* "common/transformations/transformations.pyx":55 + * g.lon = geodetic[1] + * g.alt = geodetic[2] + * return g # <<<<<<<<<<<<<< + * + * def euler2quat_single(euler): + */ + __pyx_r = __pyx_v_g; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":50 + * return n + * + * cdef Geodetic list2geodetic(geodetic): # <<<<<<<<<<<<<< + * cdef Geodetic g + * g.lat = geodetic[0] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("common.transformations.transformations.list2geodetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":57 + * return g + * + * def euler2quat_single(euler): # <<<<<<<<<<<<<< + * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) + * cdef Quaternion q = euler2quat_c(e) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_1euler2quat_single(PyObject *__pyx_self, PyObject *__pyx_v_euler); /*proto*/ +static PyMethodDef __pyx_mdef_6common_15transformations_15transformations_1euler2quat_single = {"euler2quat_single", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_1euler2quat_single, METH_O, 0}; +static PyObject *__pyx_pw_6common_15transformations_15transformations_1euler2quat_single(PyObject *__pyx_self, PyObject *__pyx_v_euler) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("euler2quat_single (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_euler2quat_single(__pyx_self, ((PyObject *)__pyx_v_euler)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_euler2quat_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_euler) { + Eigen::Vector3d __pyx_v_e; + Eigen::Quaterniond __pyx_v_q; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + double __pyx_t_3; + double __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("euler2quat_single", 0); + + /* "common/transformations/transformations.pyx":58 + * + * def euler2quat_single(euler): + * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) # <<<<<<<<<<<<<< + * cdef Quaternion q = euler2quat_c(e) + * return [q.w(), q.x(), q.y(), q.z()] + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_e = Eigen::Vector3d(__pyx_t_2, __pyx_t_3, __pyx_t_4); + + /* "common/transformations/transformations.pyx":59 + * def euler2quat_single(euler): + * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) + * cdef Quaternion q = euler2quat_c(e) # <<<<<<<<<<<<<< + * return [q.w(), q.x(), q.y(), q.z()] + * + */ + __pyx_v_q = euler2quat(__pyx_v_e); + + /* "common/transformations/transformations.pyx":60 + * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) + * cdef Quaternion q = euler2quat_c(e) + * return [q.w(), q.x(), q.y(), q.z()] # <<<<<<<<<<<<<< + * + * def quat2euler_single(quat): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_q.w()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q.x()); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_q.y()); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_q.z()); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyList_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_8, 3, __pyx_t_7); + __pyx_t_1 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":57 + * return g + * + * def euler2quat_single(euler): # <<<<<<<<<<<<<< + * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) + * cdef Quaternion q = euler2quat_c(e) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("common.transformations.transformations.euler2quat_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":62 + * return [q.w(), q.x(), q.y(), q.z()] + * + * def quat2euler_single(quat): # <<<<<<<<<<<<<< + * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) + * cdef Vector3 e = quat2euler_c(q); + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_3quat2euler_single(PyObject *__pyx_self, PyObject *__pyx_v_quat); /*proto*/ +static PyMethodDef __pyx_mdef_6common_15transformations_15transformations_3quat2euler_single = {"quat2euler_single", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_3quat2euler_single, METH_O, 0}; +static PyObject *__pyx_pw_6common_15transformations_15transformations_3quat2euler_single(PyObject *__pyx_self, PyObject *__pyx_v_quat) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("quat2euler_single (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_2quat2euler_single(__pyx_self, ((PyObject *)__pyx_v_quat)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_2quat2euler_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_quat) { + Eigen::Quaterniond __pyx_v_q; + Eigen::Vector3d __pyx_v_e; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + double __pyx_t_3; + double __pyx_t_4; + double __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("quat2euler_single", 0); + + /* "common/transformations/transformations.pyx":63 + * + * def quat2euler_single(quat): + * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) # <<<<<<<<<<<<<< + * cdef Vector3 e = quat2euler_c(q); + * return [e(0), e(1), e(2)] + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 63, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 63, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 63, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 63, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_q = Eigen::Quaterniond(__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5); + + /* "common/transformations/transformations.pyx":64 + * def quat2euler_single(quat): + * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) + * cdef Vector3 e = quat2euler_c(q); # <<<<<<<<<<<<<< + * return [e(0), e(1), e(2)] + * + */ + __pyx_v_e = quat2euler(__pyx_v_q); + + /* "common/transformations/transformations.pyx":65 + * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) + * cdef Vector3 e = quat2euler_c(q); + * return [e(0), e(1), e(2)] # <<<<<<<<<<<<<< + * + * def quat2rot_single(quat): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_e(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e(1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_e(2)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyList_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __pyx_t_1 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":62 + * return [q.w(), q.x(), q.y(), q.z()] + * + * def quat2euler_single(quat): # <<<<<<<<<<<<<< + * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) + * cdef Vector3 e = quat2euler_c(q); + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("common.transformations.transformations.quat2euler_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":67 + * return [e(0), e(1), e(2)] + * + * def quat2rot_single(quat): # <<<<<<<<<<<<<< + * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) + * cdef Matrix3 r = quat2rot_c(q) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_5quat2rot_single(PyObject *__pyx_self, PyObject *__pyx_v_quat); /*proto*/ +static PyMethodDef __pyx_mdef_6common_15transformations_15transformations_5quat2rot_single = {"quat2rot_single", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_5quat2rot_single, METH_O, 0}; +static PyObject *__pyx_pw_6common_15transformations_15transformations_5quat2rot_single(PyObject *__pyx_self, PyObject *__pyx_v_quat) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("quat2rot_single (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_4quat2rot_single(__pyx_self, ((PyObject *)__pyx_v_quat)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_4quat2rot_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_quat) { + Eigen::Quaterniond __pyx_v_q; + Eigen::Matrix3d __pyx_v_r; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + double __pyx_t_3; + double __pyx_t_4; + double __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("quat2rot_single", 0); + + /* "common/transformations/transformations.pyx":68 + * + * def quat2rot_single(quat): + * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) # <<<<<<<<<<<<<< + * cdef Matrix3 r = quat2rot_c(q) + * return matrix2numpy(r) + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_q = Eigen::Quaterniond(__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5); + + /* "common/transformations/transformations.pyx":69 + * def quat2rot_single(quat): + * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) + * cdef Matrix3 r = quat2rot_c(q) # <<<<<<<<<<<<<< + * return matrix2numpy(r) + * + */ + __pyx_v_r = quat2rot(__pyx_v_q); + + /* "common/transformations/transformations.pyx":70 + * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) + * cdef Matrix3 r = quat2rot_c(q) + * return matrix2numpy(r) # <<<<<<<<<<<<<< + * + * def rot2quat_single(rot): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(__pyx_v_r)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":67 + * return [e(0), e(1), e(2)] + * + * def quat2rot_single(quat): # <<<<<<<<<<<<<< + * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) + * cdef Matrix3 r = quat2rot_c(q) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.transformations.transformations.quat2rot_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":72 + * return matrix2numpy(r) + * + * def rot2quat_single(rot): # <<<<<<<<<<<<<< + * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) + * cdef Quaternion q = rot2quat_c(r) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_7rot2quat_single(PyObject *__pyx_self, PyObject *__pyx_v_rot); /*proto*/ +static PyMethodDef __pyx_mdef_6common_15transformations_15transformations_7rot2quat_single = {"rot2quat_single", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_7rot2quat_single, METH_O, 0}; +static PyObject *__pyx_pw_6common_15transformations_15transformations_7rot2quat_single(PyObject *__pyx_self, PyObject *__pyx_v_rot) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rot2quat_single (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_6rot2quat_single(__pyx_self, ((PyObject *)__pyx_v_rot)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_6rot2quat_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rot) { + Eigen::Matrix3d __pyx_v_r; + Eigen::Quaterniond __pyx_v_q; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rot2quat_single", 0); + + /* "common/transformations/transformations.pyx":73 + * + * def rot2quat_single(rot): + * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) # <<<<<<<<<<<<<< + * cdef Quaternion q = rot2quat_c(r) + * return [q.w(), q.x(), q.y(), q.z()] + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_rot); + __Pyx_GIVEREF(__pyx_v_rot); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_rot); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(1, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 73, __pyx_L1_error) + __pyx_v_r = __pyx_f_6common_15transformations_15transformations_numpy2matrix(((PyArrayObject *)__pyx_t_5)); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "common/transformations/transformations.pyx":74 + * def rot2quat_single(rot): + * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) + * cdef Quaternion q = rot2quat_c(r) # <<<<<<<<<<<<<< + * return [q.w(), q.x(), q.y(), q.z()] + * + */ + __pyx_v_q = rot2quat(__pyx_v_r); + + /* "common/transformations/transformations.pyx":75 + * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) + * cdef Quaternion q = rot2quat_c(r) + * return [q.w(), q.x(), q.y(), q.z()] # <<<<<<<<<<<<<< + * + * def euler2rot_single(euler): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q.w()); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q.x()); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_q.y()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_q.z()); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyList_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_4, 3, __pyx_t_2); + __pyx_t_5 = 0; + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":72 + * return matrix2numpy(r) + * + * def rot2quat_single(rot): # <<<<<<<<<<<<<< + * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) + * cdef Quaternion q = rot2quat_c(r) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("common.transformations.transformations.rot2quat_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":77 + * return [q.w(), q.x(), q.y(), q.z()] + * + * def euler2rot_single(euler): # <<<<<<<<<<<<<< + * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) + * cdef Matrix3 r = euler2rot_c(e) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_9euler2rot_single(PyObject *__pyx_self, PyObject *__pyx_v_euler); /*proto*/ +static PyMethodDef __pyx_mdef_6common_15transformations_15transformations_9euler2rot_single = {"euler2rot_single", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_9euler2rot_single, METH_O, 0}; +static PyObject *__pyx_pw_6common_15transformations_15transformations_9euler2rot_single(PyObject *__pyx_self, PyObject *__pyx_v_euler) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("euler2rot_single (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_8euler2rot_single(__pyx_self, ((PyObject *)__pyx_v_euler)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_8euler2rot_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_euler) { + Eigen::Vector3d __pyx_v_e; + Eigen::Matrix3d __pyx_v_r; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + double __pyx_t_3; + double __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("euler2rot_single", 0); + + /* "common/transformations/transformations.pyx":78 + * + * def euler2rot_single(euler): + * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) # <<<<<<<<<<<<<< + * cdef Matrix3 r = euler2rot_c(e) + * return matrix2numpy(r) + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 78, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 78, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 78, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_e = Eigen::Vector3d(__pyx_t_2, __pyx_t_3, __pyx_t_4); + + /* "common/transformations/transformations.pyx":79 + * def euler2rot_single(euler): + * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) + * cdef Matrix3 r = euler2rot_c(e) # <<<<<<<<<<<<<< + * return matrix2numpy(r) + * + */ + __pyx_v_r = euler2rot(__pyx_v_e); + + /* "common/transformations/transformations.pyx":80 + * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) + * cdef Matrix3 r = euler2rot_c(e) + * return matrix2numpy(r) # <<<<<<<<<<<<<< + * + * def rot2euler_single(rot): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(__pyx_v_r)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":77 + * return [q.w(), q.x(), q.y(), q.z()] + * + * def euler2rot_single(euler): # <<<<<<<<<<<<<< + * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) + * cdef Matrix3 r = euler2rot_c(e) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.transformations.transformations.euler2rot_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":82 + * return matrix2numpy(r) + * + * def rot2euler_single(rot): # <<<<<<<<<<<<<< + * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) + * cdef Vector3 e = rot2euler_c(r) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_11rot2euler_single(PyObject *__pyx_self, PyObject *__pyx_v_rot); /*proto*/ +static PyMethodDef __pyx_mdef_6common_15transformations_15transformations_11rot2euler_single = {"rot2euler_single", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_11rot2euler_single, METH_O, 0}; +static PyObject *__pyx_pw_6common_15transformations_15transformations_11rot2euler_single(PyObject *__pyx_self, PyObject *__pyx_v_rot) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rot2euler_single (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_10rot2euler_single(__pyx_self, ((PyObject *)__pyx_v_rot)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_10rot2euler_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rot) { + Eigen::Matrix3d __pyx_v_r; + Eigen::Vector3d __pyx_v_e; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rot2euler_single", 0); + + /* "common/transformations/transformations.pyx":83 + * + * def rot2euler_single(rot): + * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) # <<<<<<<<<<<<<< + * cdef Vector3 e = rot2euler_c(r) + * return [e(0), e(1), e(2)] + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_rot); + __Pyx_GIVEREF(__pyx_v_rot); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_rot); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(1, 83, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 83, __pyx_L1_error) + __pyx_v_r = __pyx_f_6common_15transformations_15transformations_numpy2matrix(((PyArrayObject *)__pyx_t_5)); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "common/transformations/transformations.pyx":84 + * def rot2euler_single(rot): + * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) + * cdef Vector3 e = rot2euler_c(r) # <<<<<<<<<<<<<< + * return [e(0), e(1), e(2)] + * + */ + __pyx_v_e = rot2euler(__pyx_v_r); + + /* "common/transformations/transformations.pyx":85 + * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) + * cdef Vector3 e = rot2euler_c(r) + * return [e(0), e(1), e(2)] # <<<<<<<<<<<<<< + * + * def rot_matrix(roll, pitch, yaw): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_e(0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_e(1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_e(2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":82 + * return matrix2numpy(r) + * + * def rot2euler_single(rot): # <<<<<<<<<<<<<< + * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) + * cdef Vector3 e = rot2euler_c(r) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("common.transformations.transformations.rot2euler_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":87 + * return [e(0), e(1), e(2)] + * + * def rot_matrix(roll, pitch, yaw): # <<<<<<<<<<<<<< + * return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_13rot_matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6common_15transformations_15transformations_13rot_matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_roll = 0; + PyObject *__pyx_v_pitch = 0; + PyObject *__pyx_v_yaw = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rot_matrix (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_roll,&__pyx_n_s_pitch,&__pyx_n_s_yaw,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_roll)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pitch)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("rot_matrix", 1, 3, 3, 1); __PYX_ERR(1, 87, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yaw)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("rot_matrix", 1, 3, 3, 2); __PYX_ERR(1, 87, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rot_matrix") < 0)) __PYX_ERR(1, 87, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_roll = values[0]; + __pyx_v_pitch = values[1]; + __pyx_v_yaw = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rot_matrix", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 87, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("common.transformations.transformations.rot_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6common_15transformations_15transformations_12rot_matrix(__pyx_self, __pyx_v_roll, __pyx_v_pitch, __pyx_v_yaw); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_12rot_matrix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_roll, PyObject *__pyx_v_pitch, PyObject *__pyx_v_yaw) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + double __pyx_t_2; + double __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rot_matrix", 0); + + /* "common/transformations/transformations.pyx":88 + * + * def rot_matrix(roll, pitch, yaw): + * return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) # <<<<<<<<<<<<<< + * + * def ecef_euler_from_ned_single(ecef_init, ned_pose): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_roll); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 88, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_pitch); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 88, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_yaw); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 88, __pyx_L1_error) + __pyx_t_4 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(rot_matrix(__pyx_t_1, __pyx_t_2, __pyx_t_3))); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":87 + * return [e(0), e(1), e(2)] + * + * def rot_matrix(roll, pitch, yaw): # <<<<<<<<<<<<<< + * return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("common.transformations.transformations.rot_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":90 + * return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) + * + * def ecef_euler_from_ned_single(ecef_init, ned_pose): # <<<<<<<<<<<<<< + * cdef ECEF init = list2ecef(ecef_init) + * cdef Vector3 pose = Vector3(ned_pose[0], ned_pose[1], ned_pose[2]) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_15ecef_euler_from_ned_single(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6common_15transformations_15transformations_15ecef_euler_from_ned_single = {"ecef_euler_from_ned_single", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6common_15transformations_15transformations_15ecef_euler_from_ned_single, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6common_15transformations_15transformations_15ecef_euler_from_ned_single(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ecef_init = 0; + PyObject *__pyx_v_ned_pose = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ecef_euler_from_ned_single (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ecef_init,&__pyx_n_s_ned_pose,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ecef_init)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ned_pose)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ecef_euler_from_ned_single", 1, 2, 2, 1); __PYX_ERR(1, 90, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ecef_euler_from_ned_single") < 0)) __PYX_ERR(1, 90, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_ecef_init = values[0]; + __pyx_v_ned_pose = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ecef_euler_from_ned_single", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 90, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("common.transformations.transformations.ecef_euler_from_ned_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6common_15transformations_15transformations_14ecef_euler_from_ned_single(__pyx_self, __pyx_v_ecef_init, __pyx_v_ned_pose); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_14ecef_euler_from_ned_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ecef_init, PyObject *__pyx_v_ned_pose) { + struct ECEF __pyx_v_init; + Eigen::Vector3d __pyx_v_pose; + Eigen::Vector3d __pyx_v_e; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + double __pyx_t_3; + double __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ecef_euler_from_ned_single", 0); + + /* "common/transformations/transformations.pyx":91 + * + * def ecef_euler_from_ned_single(ecef_init, ned_pose): + * cdef ECEF init = list2ecef(ecef_init) # <<<<<<<<<<<<<< + * cdef Vector3 pose = Vector3(ned_pose[0], ned_pose[1], ned_pose[2]) + * + */ + __pyx_v_init = __pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef_init); + + /* "common/transformations/transformations.pyx":92 + * def ecef_euler_from_ned_single(ecef_init, ned_pose): + * cdef ECEF init = list2ecef(ecef_init) + * cdef Vector3 pose = Vector3(ned_pose[0], ned_pose[1], ned_pose[2]) # <<<<<<<<<<<<<< + * + * cdef Vector3 e = ecef_euler_from_ned_c(init, pose) + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ned_pose, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ned_pose, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ned_pose, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_pose = Eigen::Vector3d(__pyx_t_2, __pyx_t_3, __pyx_t_4); + + /* "common/transformations/transformations.pyx":94 + * cdef Vector3 pose = Vector3(ned_pose[0], ned_pose[1], ned_pose[2]) + * + * cdef Vector3 e = ecef_euler_from_ned_c(init, pose) # <<<<<<<<<<<<<< + * return [e(0), e(1), e(2)] + * + */ + __pyx_v_e = ecef_euler_from_ned(__pyx_v_init, __pyx_v_pose); + + /* "common/transformations/transformations.pyx":95 + * + * cdef Vector3 e = ecef_euler_from_ned_c(init, pose) + * return [e(0), e(1), e(2)] # <<<<<<<<<<<<<< + * + * def ned_euler_from_ecef_single(ecef_init, ecef_pose): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_e(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_e(1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e(2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_6); + __pyx_t_1 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":90 + * return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) + * + * def ecef_euler_from_ned_single(ecef_init, ned_pose): # <<<<<<<<<<<<<< + * cdef ECEF init = list2ecef(ecef_init) + * cdef Vector3 pose = Vector3(ned_pose[0], ned_pose[1], ned_pose[2]) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("common.transformations.transformations.ecef_euler_from_ned_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":97 + * return [e(0), e(1), e(2)] + * + * def ned_euler_from_ecef_single(ecef_init, ecef_pose): # <<<<<<<<<<<<<< + * cdef ECEF init = list2ecef(ecef_init) + * cdef Vector3 pose = Vector3(ecef_pose[0], ecef_pose[1], ecef_pose[2]) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_17ned_euler_from_ecef_single(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6common_15transformations_15transformations_17ned_euler_from_ecef_single = {"ned_euler_from_ecef_single", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6common_15transformations_15transformations_17ned_euler_from_ecef_single, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6common_15transformations_15transformations_17ned_euler_from_ecef_single(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ecef_init = 0; + PyObject *__pyx_v_ecef_pose = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ned_euler_from_ecef_single (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ecef_init,&__pyx_n_s_ecef_pose,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ecef_init)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ecef_pose)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ned_euler_from_ecef_single", 1, 2, 2, 1); __PYX_ERR(1, 97, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ned_euler_from_ecef_single") < 0)) __PYX_ERR(1, 97, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_ecef_init = values[0]; + __pyx_v_ecef_pose = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ned_euler_from_ecef_single", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 97, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("common.transformations.transformations.ned_euler_from_ecef_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6common_15transformations_15transformations_16ned_euler_from_ecef_single(__pyx_self, __pyx_v_ecef_init, __pyx_v_ecef_pose); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_16ned_euler_from_ecef_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ecef_init, PyObject *__pyx_v_ecef_pose) { + struct ECEF __pyx_v_init; + Eigen::Vector3d __pyx_v_pose; + Eigen::Vector3d __pyx_v_e; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + double __pyx_t_3; + double __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ned_euler_from_ecef_single", 0); + + /* "common/transformations/transformations.pyx":98 + * + * def ned_euler_from_ecef_single(ecef_init, ecef_pose): + * cdef ECEF init = list2ecef(ecef_init) # <<<<<<<<<<<<<< + * cdef Vector3 pose = Vector3(ecef_pose[0], ecef_pose[1], ecef_pose[2]) + * + */ + __pyx_v_init = __pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef_init); + + /* "common/transformations/transformations.pyx":99 + * def ned_euler_from_ecef_single(ecef_init, ecef_pose): + * cdef ECEF init = list2ecef(ecef_init) + * cdef Vector3 pose = Vector3(ecef_pose[0], ecef_pose[1], ecef_pose[2]) # <<<<<<<<<<<<<< + * + * cdef Vector3 e = ned_euler_from_ecef_c(init, pose) + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ecef_pose, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 99, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ecef_pose, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 99, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ecef_pose, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 99, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_pose = Eigen::Vector3d(__pyx_t_2, __pyx_t_3, __pyx_t_4); + + /* "common/transformations/transformations.pyx":101 + * cdef Vector3 pose = Vector3(ecef_pose[0], ecef_pose[1], ecef_pose[2]) + * + * cdef Vector3 e = ned_euler_from_ecef_c(init, pose) # <<<<<<<<<<<<<< + * return [e(0), e(1), e(2)] + * + */ + __pyx_v_e = ned_euler_from_ecef(__pyx_v_init, __pyx_v_pose); + + /* "common/transformations/transformations.pyx":102 + * + * cdef Vector3 e = ned_euler_from_ecef_c(init, pose) + * return [e(0), e(1), e(2)] # <<<<<<<<<<<<<< + * + * def geodetic2ecef_single(geodetic): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_e(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_e(1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e(2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_6); + __pyx_t_1 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":97 + * return [e(0), e(1), e(2)] + * + * def ned_euler_from_ecef_single(ecef_init, ecef_pose): # <<<<<<<<<<<<<< + * cdef ECEF init = list2ecef(ecef_init) + * cdef Vector3 pose = Vector3(ecef_pose[0], ecef_pose[1], ecef_pose[2]) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("common.transformations.transformations.ned_euler_from_ecef_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":104 + * return [e(0), e(1), e(2)] + * + * def geodetic2ecef_single(geodetic): # <<<<<<<<<<<<<< + * cdef Geodetic g = list2geodetic(geodetic) + * cdef ECEF e = geodetic2ecef_c(g) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_19geodetic2ecef_single(PyObject *__pyx_self, PyObject *__pyx_v_geodetic); /*proto*/ +static PyMethodDef __pyx_mdef_6common_15transformations_15transformations_19geodetic2ecef_single = {"geodetic2ecef_single", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_19geodetic2ecef_single, METH_O, 0}; +static PyObject *__pyx_pw_6common_15transformations_15transformations_19geodetic2ecef_single(PyObject *__pyx_self, PyObject *__pyx_v_geodetic) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("geodetic2ecef_single (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_18geodetic2ecef_single(__pyx_self, ((PyObject *)__pyx_v_geodetic)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_18geodetic2ecef_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_geodetic) { + struct Geodetic __pyx_v_g; + struct ECEF __pyx_v_e; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("geodetic2ecef_single", 0); + + /* "common/transformations/transformations.pyx":105 + * + * def geodetic2ecef_single(geodetic): + * cdef Geodetic g = list2geodetic(geodetic) # <<<<<<<<<<<<<< + * cdef ECEF e = geodetic2ecef_c(g) + * return [e.x, e.y, e.z] + */ + __pyx_v_g = __pyx_f_6common_15transformations_15transformations_list2geodetic(__pyx_v_geodetic); + + /* "common/transformations/transformations.pyx":106 + * def geodetic2ecef_single(geodetic): + * cdef Geodetic g = list2geodetic(geodetic) + * cdef ECEF e = geodetic2ecef_c(g) # <<<<<<<<<<<<<< + * return [e.x, e.y, e.z] + * + */ + __pyx_v_e = geodetic2ecef(__pyx_v_g); + + /* "common/transformations/transformations.pyx":107 + * cdef Geodetic g = list2geodetic(geodetic) + * cdef ECEF e = geodetic2ecef_c(g) + * return [e.x, e.y, e.z] # <<<<<<<<<<<<<< + * + * def ecef2geodetic_single(ecef): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_e.x); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e.y); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_e.z); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":104 + * return [e(0), e(1), e(2)] + * + * def geodetic2ecef_single(geodetic): # <<<<<<<<<<<<<< + * cdef Geodetic g = list2geodetic(geodetic) + * cdef ECEF e = geodetic2ecef_c(g) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("common.transformations.transformations.geodetic2ecef_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":109 + * return [e.x, e.y, e.z] + * + * def ecef2geodetic_single(ecef): # <<<<<<<<<<<<<< + * cdef ECEF e = list2ecef(ecef) + * cdef Geodetic g = ecef2geodetic_c(e) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_21ecef2geodetic_single(PyObject *__pyx_self, PyObject *__pyx_v_ecef); /*proto*/ +static PyMethodDef __pyx_mdef_6common_15transformations_15transformations_21ecef2geodetic_single = {"ecef2geodetic_single", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_21ecef2geodetic_single, METH_O, 0}; +static PyObject *__pyx_pw_6common_15transformations_15transformations_21ecef2geodetic_single(PyObject *__pyx_self, PyObject *__pyx_v_ecef) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ecef2geodetic_single (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_20ecef2geodetic_single(__pyx_self, ((PyObject *)__pyx_v_ecef)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_20ecef2geodetic_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ecef) { + struct ECEF __pyx_v_e; + struct Geodetic __pyx_v_g; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ecef2geodetic_single", 0); + + /* "common/transformations/transformations.pyx":110 + * + * def ecef2geodetic_single(ecef): + * cdef ECEF e = list2ecef(ecef) # <<<<<<<<<<<<<< + * cdef Geodetic g = ecef2geodetic_c(e) + * return [g.lat, g.lon, g.alt] + */ + __pyx_v_e = __pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef); + + /* "common/transformations/transformations.pyx":111 + * def ecef2geodetic_single(ecef): + * cdef ECEF e = list2ecef(ecef) + * cdef Geodetic g = ecef2geodetic_c(e) # <<<<<<<<<<<<<< + * return [g.lat, g.lon, g.alt] + * + */ + __pyx_v_g = ecef2geodetic(__pyx_v_e); + + /* "common/transformations/transformations.pyx":112 + * cdef ECEF e = list2ecef(ecef) + * cdef Geodetic g = ecef2geodetic_c(e) + * return [g.lat, g.lon, g.alt] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_g.lat); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_g.lon); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_g.alt); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":109 + * return [e.x, e.y, e.z] + * + * def ecef2geodetic_single(ecef): # <<<<<<<<<<<<<< + * cdef ECEF e = list2ecef(ecef) + * cdef Geodetic g = ecef2geodetic_c(e) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("common.transformations.transformations.ecef2geodetic_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":118 + * cdef LocalCoord_c * lc + * + * def __init__(self, geodetic=None, ecef=None): # <<<<<<<<<<<<<< + * assert (geodetic is not None) or (ecef is not None) + * if geodetic is not None: + */ + +/* Python wrapper */ +static int __pyx_pw_6common_15transformations_15transformations_10LocalCoord_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6common_15transformations_15transformations_10LocalCoord_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_geodetic = 0; + PyObject *__pyx_v_ecef = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_geodetic,&__pyx_n_s_ecef,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_geodetic); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ecef); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 118, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_geodetic = values[0]; + __pyx_v_ecef = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 118, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("common.transformations.transformations.LocalCoord.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6common_15transformations_15transformations_10LocalCoord___init__(((struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *)__pyx_v_self), __pyx_v_geodetic, __pyx_v_ecef); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6common_15transformations_15transformations_10LocalCoord___init__(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self, PyObject *__pyx_v_geodetic, PyObject *__pyx_v_ecef) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "common/transformations/transformations.pyx":119 + * + * def __init__(self, geodetic=None, ecef=None): + * assert (geodetic is not None) or (ecef is not None) # <<<<<<<<<<<<<< + * if geodetic is not None: + * self.lc = new LocalCoord_c(list2geodetic(geodetic)) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_2 = (__pyx_v_geodetic != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_ecef != Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L3_bool_binop_done:; + if (unlikely(!__pyx_t_1)) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 119, __pyx_L1_error) + } + } + #endif + + /* "common/transformations/transformations.pyx":120 + * def __init__(self, geodetic=None, ecef=None): + * assert (geodetic is not None) or (ecef is not None) + * if geodetic is not None: # <<<<<<<<<<<<<< + * self.lc = new LocalCoord_c(list2geodetic(geodetic)) + * elif ecef is not None: + */ + __pyx_t_1 = (__pyx_v_geodetic != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "common/transformations/transformations.pyx":121 + * assert (geodetic is not None) or (ecef is not None) + * if geodetic is not None: + * self.lc = new LocalCoord_c(list2geodetic(geodetic)) # <<<<<<<<<<<<<< + * elif ecef is not None: + * self.lc = new LocalCoord_c(list2ecef(ecef)) + */ + __pyx_v_self->lc = new LocalCoord(__pyx_f_6common_15transformations_15transformations_list2geodetic(__pyx_v_geodetic)); + + /* "common/transformations/transformations.pyx":120 + * def __init__(self, geodetic=None, ecef=None): + * assert (geodetic is not None) or (ecef is not None) + * if geodetic is not None: # <<<<<<<<<<<<<< + * self.lc = new LocalCoord_c(list2geodetic(geodetic)) + * elif ecef is not None: + */ + goto __pyx_L5; + } + + /* "common/transformations/transformations.pyx":122 + * if geodetic is not None: + * self.lc = new LocalCoord_c(list2geodetic(geodetic)) + * elif ecef is not None: # <<<<<<<<<<<<<< + * self.lc = new LocalCoord_c(list2ecef(ecef)) + * + */ + __pyx_t_2 = (__pyx_v_ecef != Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "common/transformations/transformations.pyx":123 + * self.lc = new LocalCoord_c(list2geodetic(geodetic)) + * elif ecef is not None: + * self.lc = new LocalCoord_c(list2ecef(ecef)) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_v_self->lc = new LocalCoord(__pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef)); + + /* "common/transformations/transformations.pyx":122 + * if geodetic is not None: + * self.lc = new LocalCoord_c(list2geodetic(geodetic)) + * elif ecef is not None: # <<<<<<<<<<<<<< + * self.lc = new LocalCoord_c(list2ecef(ecef)) + * + */ + } + __pyx_L5:; + + /* "common/transformations/transformations.pyx":118 + * cdef LocalCoord_c * lc + * + * def __init__(self, geodetic=None, ecef=None): # <<<<<<<<<<<<<< + * assert (geodetic is not None) or (ecef is not None) + * if geodetic is not None: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("common.transformations.transformations.LocalCoord.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":126 + * + * @property + * def ned2ecef_matrix(self): # <<<<<<<<<<<<<< + * return matrix2numpy(self.lc.ned2ecef_matrix) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_15ned2ecef_matrix_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_15ned2ecef_matrix_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_10LocalCoord_15ned2ecef_matrix___get__(((struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_15ned2ecef_matrix___get__(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "common/transformations/transformations.pyx":127 + * @property + * def ned2ecef_matrix(self): + * return matrix2numpy(self.lc.ned2ecef_matrix) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(__pyx_v_self->lc->ned2ecef_matrix)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":126 + * + * @property + * def ned2ecef_matrix(self): # <<<<<<<<<<<<<< + * return matrix2numpy(self.lc.ned2ecef_matrix) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.transformations.transformations.LocalCoord.ned2ecef_matrix.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":130 + * + * @property + * def ecef2ned_matrix(self): # <<<<<<<<<<<<<< + * return matrix2numpy(self.lc.ecef2ned_matrix) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_15ecef2ned_matrix_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_15ecef2ned_matrix_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_10LocalCoord_15ecef2ned_matrix___get__(((struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_15ecef2ned_matrix___get__(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "common/transformations/transformations.pyx":131 + * @property + * def ecef2ned_matrix(self): + * return matrix2numpy(self.lc.ecef2ned_matrix) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(__pyx_v_self->lc->ecef2ned_matrix)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":130 + * + * @property + * def ecef2ned_matrix(self): # <<<<<<<<<<<<<< + * return matrix2numpy(self.lc.ecef2ned_matrix) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.transformations.transformations.LocalCoord.ecef2ned_matrix.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":134 + * + * @property + * def ned_from_ecef_matrix(self): # <<<<<<<<<<<<<< + * return self.ecef2ned_matrix + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_20ned_from_ecef_matrix_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_20ned_from_ecef_matrix_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_10LocalCoord_20ned_from_ecef_matrix___get__(((struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_20ned_from_ecef_matrix___get__(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "common/transformations/transformations.pyx":135 + * @property + * def ned_from_ecef_matrix(self): + * return self.ecef2ned_matrix # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ecef2ned_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":134 + * + * @property + * def ned_from_ecef_matrix(self): # <<<<<<<<<<<<<< + * return self.ecef2ned_matrix + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.transformations.transformations.LocalCoord.ned_from_ecef_matrix.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":138 + * + * @property + * def ecef_from_ned_matrix(self): # <<<<<<<<<<<<<< + * return self.ned2ecef_matrix + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_20ecef_from_ned_matrix_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_20ecef_from_ned_matrix_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_10LocalCoord_20ecef_from_ned_matrix___get__(((struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_20ecef_from_ned_matrix___get__(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "common/transformations/transformations.pyx":139 + * @property + * def ecef_from_ned_matrix(self): + * return self.ned2ecef_matrix # <<<<<<<<<<<<<< + * + * @classmethod + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ned2ecef_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":138 + * + * @property + * def ecef_from_ned_matrix(self): # <<<<<<<<<<<<<< + * return self.ned2ecef_matrix + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.transformations.transformations.LocalCoord.ecef_from_ned_matrix.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":142 + * + * @classmethod + * def from_geodetic(cls, geodetic): # <<<<<<<<<<<<<< + * return cls(geodetic=geodetic) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_3from_geodetic(PyObject *__pyx_v_cls, PyObject *__pyx_v_geodetic); /*proto*/ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_3from_geodetic(PyObject *__pyx_v_cls, PyObject *__pyx_v_geodetic) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("from_geodetic (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_10LocalCoord_2from_geodetic(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_geodetic)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_2from_geodetic(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_geodetic) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("from_geodetic", 0); + + /* "common/transformations/transformations.pyx":143 + * @classmethod + * def from_geodetic(cls, geodetic): + * return cls(geodetic=geodetic) # <<<<<<<<<<<<<< + * + * @classmethod + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_geodetic, __pyx_v_geodetic) < 0) __PYX_ERR(1, 143, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":142 + * + * @classmethod + * def from_geodetic(cls, geodetic): # <<<<<<<<<<<<<< + * return cls(geodetic=geodetic) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("common.transformations.transformations.LocalCoord.from_geodetic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":146 + * + * @classmethod + * def from_ecef(cls, ecef): # <<<<<<<<<<<<<< + * return cls(ecef=ecef) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_5from_ecef(PyObject *__pyx_v_cls, PyObject *__pyx_v_ecef); /*proto*/ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_5from_ecef(PyObject *__pyx_v_cls, PyObject *__pyx_v_ecef) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("from_ecef (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_10LocalCoord_4from_ecef(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_ecef)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_4from_ecef(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_ecef) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("from_ecef", 0); + + /* "common/transformations/transformations.pyx":147 + * @classmethod + * def from_ecef(cls, ecef): + * return cls(ecef=ecef) # <<<<<<<<<<<<<< + * + * def ecef2ned_single(self, ecef): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ecef, __pyx_v_ecef) < 0) __PYX_ERR(1, 147, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":146 + * + * @classmethod + * def from_ecef(cls, ecef): # <<<<<<<<<<<<<< + * return cls(ecef=ecef) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("common.transformations.transformations.LocalCoord.from_ecef", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":149 + * return cls(ecef=ecef) + * + * def ecef2ned_single(self, ecef): # <<<<<<<<<<<<<< + * assert self.lc + * cdef ECEF e = list2ecef(ecef) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_7ecef2ned_single(PyObject *__pyx_v_self, PyObject *__pyx_v_ecef); /*proto*/ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_7ecef2ned_single(PyObject *__pyx_v_self, PyObject *__pyx_v_ecef) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ecef2ned_single (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_10LocalCoord_6ecef2ned_single(((struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *)__pyx_v_self), ((PyObject *)__pyx_v_ecef)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_6ecef2ned_single(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self, PyObject *__pyx_v_ecef) { + struct ECEF __pyx_v_e; + struct NED __pyx_v_n; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ecef2ned_single", 0); + + /* "common/transformations/transformations.pyx":150 + * + * def ecef2ned_single(self, ecef): + * assert self.lc # <<<<<<<<<<<<<< + * cdef ECEF e = list2ecef(ecef) + * cdef NED n = self.lc.ecef2ned(e) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!(__pyx_v_self->lc != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 150, __pyx_L1_error) + } + } + #endif + + /* "common/transformations/transformations.pyx":151 + * def ecef2ned_single(self, ecef): + * assert self.lc + * cdef ECEF e = list2ecef(ecef) # <<<<<<<<<<<<<< + * cdef NED n = self.lc.ecef2ned(e) + * return [n.n, n.e, n.d] + */ + __pyx_v_e = __pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef); + + /* "common/transformations/transformations.pyx":152 + * assert self.lc + * cdef ECEF e = list2ecef(ecef) + * cdef NED n = self.lc.ecef2ned(e) # <<<<<<<<<<<<<< + * return [n.n, n.e, n.d] + * + */ + __pyx_v_n = __pyx_v_self->lc->ecef2ned(__pyx_v_e); + + /* "common/transformations/transformations.pyx":153 + * cdef ECEF e = list2ecef(ecef) + * cdef NED n = self.lc.ecef2ned(e) + * return [n.n, n.e, n.d] # <<<<<<<<<<<<<< + * + * def ned2ecef_single(self, ned): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_n.n); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_n.e); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_n.d); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":149 + * return cls(ecef=ecef) + * + * def ecef2ned_single(self, ecef): # <<<<<<<<<<<<<< + * assert self.lc + * cdef ECEF e = list2ecef(ecef) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("common.transformations.transformations.LocalCoord.ecef2ned_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":155 + * return [n.n, n.e, n.d] + * + * def ned2ecef_single(self, ned): # <<<<<<<<<<<<<< + * assert self.lc + * cdef NED n = list2ned(ned) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_9ned2ecef_single(PyObject *__pyx_v_self, PyObject *__pyx_v_ned); /*proto*/ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_9ned2ecef_single(PyObject *__pyx_v_self, PyObject *__pyx_v_ned) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ned2ecef_single (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_10LocalCoord_8ned2ecef_single(((struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *)__pyx_v_self), ((PyObject *)__pyx_v_ned)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_8ned2ecef_single(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self, PyObject *__pyx_v_ned) { + struct NED __pyx_v_n; + struct ECEF __pyx_v_e; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ned2ecef_single", 0); + + /* "common/transformations/transformations.pyx":156 + * + * def ned2ecef_single(self, ned): + * assert self.lc # <<<<<<<<<<<<<< + * cdef NED n = list2ned(ned) + * cdef ECEF e = self.lc.ned2ecef(n) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!(__pyx_v_self->lc != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 156, __pyx_L1_error) + } + } + #endif + + /* "common/transformations/transformations.pyx":157 + * def ned2ecef_single(self, ned): + * assert self.lc + * cdef NED n = list2ned(ned) # <<<<<<<<<<<<<< + * cdef ECEF e = self.lc.ned2ecef(n) + * return [e.x, e.y, e.z] + */ + __pyx_v_n = __pyx_f_6common_15transformations_15transformations_list2ned(__pyx_v_ned); + + /* "common/transformations/transformations.pyx":158 + * assert self.lc + * cdef NED n = list2ned(ned) + * cdef ECEF e = self.lc.ned2ecef(n) # <<<<<<<<<<<<<< + * return [e.x, e.y, e.z] + * + */ + __pyx_v_e = __pyx_v_self->lc->ned2ecef(__pyx_v_n); + + /* "common/transformations/transformations.pyx":159 + * cdef NED n = list2ned(ned) + * cdef ECEF e = self.lc.ned2ecef(n) + * return [e.x, e.y, e.z] # <<<<<<<<<<<<<< + * + * def geodetic2ned_single(self, geodetic): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_e.x); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e.y); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_e.z); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":155 + * return [n.n, n.e, n.d] + * + * def ned2ecef_single(self, ned): # <<<<<<<<<<<<<< + * assert self.lc + * cdef NED n = list2ned(ned) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("common.transformations.transformations.LocalCoord.ned2ecef_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":161 + * return [e.x, e.y, e.z] + * + * def geodetic2ned_single(self, geodetic): # <<<<<<<<<<<<<< + * assert self.lc + * cdef Geodetic g = list2geodetic(geodetic) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_11geodetic2ned_single(PyObject *__pyx_v_self, PyObject *__pyx_v_geodetic); /*proto*/ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_11geodetic2ned_single(PyObject *__pyx_v_self, PyObject *__pyx_v_geodetic) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("geodetic2ned_single (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_10LocalCoord_10geodetic2ned_single(((struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *)__pyx_v_self), ((PyObject *)__pyx_v_geodetic)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_10geodetic2ned_single(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self, PyObject *__pyx_v_geodetic) { + struct Geodetic __pyx_v_g; + struct NED __pyx_v_n; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("geodetic2ned_single", 0); + + /* "common/transformations/transformations.pyx":162 + * + * def geodetic2ned_single(self, geodetic): + * assert self.lc # <<<<<<<<<<<<<< + * cdef Geodetic g = list2geodetic(geodetic) + * cdef NED n = self.lc.geodetic2ned(g) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!(__pyx_v_self->lc != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 162, __pyx_L1_error) + } + } + #endif + + /* "common/transformations/transformations.pyx":163 + * def geodetic2ned_single(self, geodetic): + * assert self.lc + * cdef Geodetic g = list2geodetic(geodetic) # <<<<<<<<<<<<<< + * cdef NED n = self.lc.geodetic2ned(g) + * return [n.n, n.e, n.d] + */ + __pyx_v_g = __pyx_f_6common_15transformations_15transformations_list2geodetic(__pyx_v_geodetic); + + /* "common/transformations/transformations.pyx":164 + * assert self.lc + * cdef Geodetic g = list2geodetic(geodetic) + * cdef NED n = self.lc.geodetic2ned(g) # <<<<<<<<<<<<<< + * return [n.n, n.e, n.d] + * + */ + __pyx_v_n = __pyx_v_self->lc->geodetic2ned(__pyx_v_g); + + /* "common/transformations/transformations.pyx":165 + * cdef Geodetic g = list2geodetic(geodetic) + * cdef NED n = self.lc.geodetic2ned(g) + * return [n.n, n.e, n.d] # <<<<<<<<<<<<<< + * + * def ned2geodetic_single(self, ned): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_n.n); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_n.e); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_n.d); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":161 + * return [e.x, e.y, e.z] + * + * def geodetic2ned_single(self, geodetic): # <<<<<<<<<<<<<< + * assert self.lc + * cdef Geodetic g = list2geodetic(geodetic) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("common.transformations.transformations.LocalCoord.geodetic2ned_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":167 + * return [n.n, n.e, n.d] + * + * def ned2geodetic_single(self, ned): # <<<<<<<<<<<<<< + * assert self.lc + * cdef NED n = list2ned(ned) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_13ned2geodetic_single(PyObject *__pyx_v_self, PyObject *__pyx_v_ned); /*proto*/ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_13ned2geodetic_single(PyObject *__pyx_v_self, PyObject *__pyx_v_ned) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ned2geodetic_single (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_10LocalCoord_12ned2geodetic_single(((struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *)__pyx_v_self), ((PyObject *)__pyx_v_ned)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_12ned2geodetic_single(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self, PyObject *__pyx_v_ned) { + struct NED __pyx_v_n; + struct Geodetic __pyx_v_g; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ned2geodetic_single", 0); + + /* "common/transformations/transformations.pyx":168 + * + * def ned2geodetic_single(self, ned): + * assert self.lc # <<<<<<<<<<<<<< + * cdef NED n = list2ned(ned) + * cdef Geodetic g = self.lc.ned2geodetic(n) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!(__pyx_v_self->lc != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 168, __pyx_L1_error) + } + } + #endif + + /* "common/transformations/transformations.pyx":169 + * def ned2geodetic_single(self, ned): + * assert self.lc + * cdef NED n = list2ned(ned) # <<<<<<<<<<<<<< + * cdef Geodetic g = self.lc.ned2geodetic(n) + * return [g.lat, g.lon, g.alt] + */ + __pyx_v_n = __pyx_f_6common_15transformations_15transformations_list2ned(__pyx_v_ned); + + /* "common/transformations/transformations.pyx":170 + * assert self.lc + * cdef NED n = list2ned(ned) + * cdef Geodetic g = self.lc.ned2geodetic(n) # <<<<<<<<<<<<<< + * return [g.lat, g.lon, g.alt] + * + */ + __pyx_v_g = __pyx_v_self->lc->ned2geodetic(__pyx_v_n); + + /* "common/transformations/transformations.pyx":171 + * cdef NED n = list2ned(ned) + * cdef Geodetic g = self.lc.ned2geodetic(n) + * return [g.lat, g.lon, g.alt] # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_g.lat); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_g.lon); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_g.alt); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "common/transformations/transformations.pyx":167 + * return [n.n, n.e, n.d] + * + * def ned2geodetic_single(self, ned): # <<<<<<<<<<<<<< + * assert self.lc + * cdef NED n = list2ned(ned) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("common.transformations.transformations.LocalCoord.ned2geodetic_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "common/transformations/transformations.pyx":173 + * return [g.lat, g.lon, g.alt] + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del self.lc + */ + +/* Python wrapper */ +static void __pyx_pw_6common_15transformations_15transformations_10LocalCoord_15__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6common_15transformations_15transformations_10LocalCoord_15__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6common_15transformations_15transformations_10LocalCoord_14__dealloc__(((struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6common_15transformations_15transformations_10LocalCoord_14__dealloc__(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "common/transformations/transformations.pyx":174 + * + * def __dealloc__(self): + * del self.lc # <<<<<<<<<<<<<< + */ + delete __pyx_v_self->lc; + + /* "common/transformations/transformations.pyx":173 + * return [g.lat, g.lon, g.alt] + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del self.lc + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.lc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_10LocalCoord_16__reduce_cython__(((struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.lc cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.lc cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.lc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.transformations.transformations.LocalCoord.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.lc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.lc cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6common_15transformations_15transformations_10LocalCoord_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6common_15transformations_15transformations_10LocalCoord_18__setstate_cython__(((struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoord_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("self.lc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.lc cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.lc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.lc cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.transformations.transformations.LocalCoord.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":735 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":736 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":735 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":738 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":739 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":738 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":741 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":742 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":741 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":744 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":745 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":744 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":747 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":748 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":747 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":750 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":751 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); + if (__pyx_t_1) { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":752 + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape # <<<<<<<<<<<<<< + * else: + * return () + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); + __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":751 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":754 + * return d.subarray.shape + * else: + * return () # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_r = __pyx_empty_tuple; + goto __pyx_L0; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":750 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":929 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":930 + * + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< + * PyArray_SetBaseObject(arr, base) + * + */ + Py_INCREF(__pyx_v_base); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":931 + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":929 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":933 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_v_base; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":934 + * + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< + * if base is NULL: + * return None + */ + __pyx_v_base = PyArray_BASE(__pyx_v_arr); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":935 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + __pyx_t_1 = ((__pyx_v_base == NULL) != 0); + if (__pyx_t_1) { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":936 + * base = PyArray_BASE(arr) + * if base is NULL: + * return None # <<<<<<<<<<<<<< + * return base + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":935 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":937 + * if base is NULL: + * return None + * return base # <<<<<<<<<<<<<< + * + * # Versions of the import_* functions which are more suitable for + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_base)); + __pyx_r = ((PyObject *)__pyx_v_base); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":933 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":941 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":943 + * cdef inline int import_array() except -1: + * try: + * __pyx_import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":944 + * try: + * __pyx_import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":945 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 945, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":941 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":947 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":949 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":950 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":951 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 951, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":947 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":953 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":955 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":956 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":957 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef extern from *: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 957, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":953 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":967 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timedelta64_object", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":979 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":967 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":982 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_datetime64_object", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":994 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":982 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":997 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + +static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { + npy_datetime __pyx_r; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1004 + * also needed. That can be found using `get_datetime64_unit`. + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":997 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1007 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + +static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { + npy_timedelta __pyx_r; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1011 + * returns the int64 value underlying scalar numpy timedelta64 object + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1007 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1014 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + +static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { + NPY_DATETIMEUNIT __pyx_r; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1018 + * returns the unit part of the dtype for a numpy datetime64 object. + * """ + * return (obj).obmeta.base # <<<<<<<<<<<<<< + */ + __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1014 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6common_15transformations_15transformations_LocalCoord(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6common_15transformations_15transformations_LocalCoord(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_6common_15transformations_15transformations_10LocalCoord_15__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_getprop_6common_15transformations_15transformations_10LocalCoord_ned2ecef_matrix(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_15transformations_15transformations_10LocalCoord_15ned2ecef_matrix_1__get__(o); +} + +static PyObject *__pyx_getprop_6common_15transformations_15transformations_10LocalCoord_ecef2ned_matrix(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_15transformations_15transformations_10LocalCoord_15ecef2ned_matrix_1__get__(o); +} + +static PyObject *__pyx_getprop_6common_15transformations_15transformations_10LocalCoord_ned_from_ecef_matrix(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_15transformations_15transformations_10LocalCoord_20ned_from_ecef_matrix_1__get__(o); +} + +static PyObject *__pyx_getprop_6common_15transformations_15transformations_10LocalCoord_ecef_from_ned_matrix(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6common_15transformations_15transformations_10LocalCoord_20ecef_from_ned_matrix_1__get__(o); +} + +static PyMethodDef __pyx_methods_6common_15transformations_15transformations_LocalCoord[] = { + {"from_geodetic", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_10LocalCoord_3from_geodetic, METH_O, 0}, + {"from_ecef", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_10LocalCoord_5from_ecef, METH_O, 0}, + {"ecef2ned_single", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_10LocalCoord_7ecef2ned_single, METH_O, 0}, + {"ned2ecef_single", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_10LocalCoord_9ned2ecef_single, METH_O, 0}, + {"geodetic2ned_single", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_10LocalCoord_11geodetic2ned_single, METH_O, 0}, + {"ned2geodetic_single", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_10LocalCoord_13ned2geodetic_single, METH_O, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_10LocalCoord_17__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6common_15transformations_15transformations_10LocalCoord_19__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6common_15transformations_15transformations_LocalCoord[] = { + {(char *)"ned2ecef_matrix", __pyx_getprop_6common_15transformations_15transformations_10LocalCoord_ned2ecef_matrix, 0, (char *)0, 0}, + {(char *)"ecef2ned_matrix", __pyx_getprop_6common_15transformations_15transformations_10LocalCoord_ecef2ned_matrix, 0, (char *)0, 0}, + {(char *)"ned_from_ecef_matrix", __pyx_getprop_6common_15transformations_15transformations_10LocalCoord_ned_from_ecef_matrix, 0, (char *)0, 0}, + {(char *)"ecef_from_ned_matrix", __pyx_getprop_6common_15transformations_15transformations_10LocalCoord_ecef_from_ned_matrix, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6common_15transformations_15transformations_LocalCoord = { + PyVarObject_HEAD_INIT(0, 0) + "common.transformations.transformations.LocalCoord", /*tp_name*/ + sizeof(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6common_15transformations_15transformations_LocalCoord, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6common_15transformations_15transformations_LocalCoord, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6common_15transformations_15transformations_LocalCoord, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6common_15transformations_15transformations_10LocalCoord_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6common_15transformations_15transformations_LocalCoord, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {"rot_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6common_15transformations_15transformations_13rot_matrix, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_transformations(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_transformations}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "transformations", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_n_s_LocalCoord, __pyx_k_LocalCoord, sizeof(__pyx_k_LocalCoord), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, + {&__pyx_n_s_asfortranarray, __pyx_k_asfortranarray, sizeof(__pyx_k_asfortranarray), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_kp_s_common_transformations_transform, __pyx_k_common_transformations_transform, sizeof(__pyx_k_common_transformations_transform), 0, 0, 1, 0}, + {&__pyx_n_s_common_transformations_transform_2, __pyx_k_common_transformations_transform_2, sizeof(__pyx_k_common_transformations_transform_2), 0, 0, 1, 1}, + {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_ecef, __pyx_k_ecef, sizeof(__pyx_k_ecef), 0, 0, 1, 1}, + {&__pyx_n_s_ecef2geodetic_single, __pyx_k_ecef2geodetic_single, sizeof(__pyx_k_ecef2geodetic_single), 0, 0, 1, 1}, + {&__pyx_n_s_ecef2ned_matrix, __pyx_k_ecef2ned_matrix, sizeof(__pyx_k_ecef2ned_matrix), 0, 0, 1, 1}, + {&__pyx_n_s_ecef_euler_from_ned_single, __pyx_k_ecef_euler_from_ned_single, sizeof(__pyx_k_ecef_euler_from_ned_single), 0, 0, 1, 1}, + {&__pyx_n_s_ecef_init, __pyx_k_ecef_init, sizeof(__pyx_k_ecef_init), 0, 0, 1, 1}, + {&__pyx_n_s_ecef_pose, __pyx_k_ecef_pose, sizeof(__pyx_k_ecef_pose), 0, 0, 1, 1}, + {&__pyx_n_s_euler, __pyx_k_euler, sizeof(__pyx_k_euler), 0, 0, 1, 1}, + {&__pyx_n_s_euler2quat_single, __pyx_k_euler2quat_single, sizeof(__pyx_k_euler2quat_single), 0, 0, 1, 1}, + {&__pyx_n_s_euler2rot_single, __pyx_k_euler2rot_single, sizeof(__pyx_k_euler2rot_single), 0, 0, 1, 1}, + {&__pyx_n_s_from_ecef, __pyx_k_from_ecef, sizeof(__pyx_k_from_ecef), 0, 0, 1, 1}, + {&__pyx_n_s_from_geodetic, __pyx_k_from_geodetic, sizeof(__pyx_k_from_geodetic), 0, 0, 1, 1}, + {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, + {&__pyx_n_s_geodetic, __pyx_k_geodetic, sizeof(__pyx_k_geodetic), 0, 0, 1, 1}, + {&__pyx_n_s_geodetic2ecef_single, __pyx_k_geodetic2ecef_single, sizeof(__pyx_k_geodetic2ecef_single), 0, 0, 1, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_ned2ecef_matrix, __pyx_k_ned2ecef_matrix, sizeof(__pyx_k_ned2ecef_matrix), 0, 0, 1, 1}, + {&__pyx_n_s_ned_euler_from_ecef_single, __pyx_k_ned_euler_from_ecef_single, sizeof(__pyx_k_ned_euler_from_ecef_single), 0, 0, 1, 1}, + {&__pyx_n_s_ned_pose, __pyx_k_ned_pose, sizeof(__pyx_k_ned_pose), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0}, + {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0}, + {&__pyx_n_s_pitch, __pyx_k_pitch, sizeof(__pyx_k_pitch), 0, 0, 1, 1}, + {&__pyx_n_s_pose, __pyx_k_pose, sizeof(__pyx_k_pose), 0, 0, 1, 1}, + {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1}, + {&__pyx_n_s_quat, __pyx_k_quat, sizeof(__pyx_k_quat), 0, 0, 1, 1}, + {&__pyx_n_s_quat2euler_single, __pyx_k_quat2euler_single, sizeof(__pyx_k_quat2euler_single), 0, 0, 1, 1}, + {&__pyx_n_s_quat2rot_single, __pyx_k_quat2rot_single, sizeof(__pyx_k_quat2rot_single), 0, 0, 1, 1}, + {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_n_s_roll, __pyx_k_roll, sizeof(__pyx_k_roll), 0, 0, 1, 1}, + {&__pyx_n_s_rot, __pyx_k_rot, sizeof(__pyx_k_rot), 0, 0, 1, 1}, + {&__pyx_n_s_rot2euler_single, __pyx_k_rot2euler_single, sizeof(__pyx_k_rot2euler_single), 0, 0, 1, 1}, + {&__pyx_n_s_rot2quat_single, __pyx_k_rot2quat_single, sizeof(__pyx_k_rot2quat_single), 0, 0, 1, 1}, + {&__pyx_kp_s_self_lc_cannot_be_converted_to_a, __pyx_k_self_lc_cannot_be_converted_to_a, sizeof(__pyx_k_self_lc_cannot_be_converted_to_a), 0, 0, 1, 0}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_yaw, __pyx_k_yaw, sizeof(__pyx_k_yaw), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.lc cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.lc cannot be converted to a Python object for pickling") + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self_lc_cannot_be_converted_to_a); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(tree fragment)":4 + * raise TypeError("self.lc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.lc cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_lc_cannot_be_converted_to_a); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":945 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 945, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":951 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "common/transformations/transformations.pyx":57 + * return g + * + * def euler2quat_single(euler): # <<<<<<<<<<<<<< + * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) + * cdef Quaternion q = euler2quat_c(e) + */ + __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_euler, __pyx_n_s_e, __pyx_n_s_q); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_euler2quat_single, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(1, 57, __pyx_L1_error) + + /* "common/transformations/transformations.pyx":62 + * return [q.w(), q.x(), q.y(), q.z()] + * + * def quat2euler_single(quat): # <<<<<<<<<<<<<< + * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) + * cdef Vector3 e = quat2euler_c(q); + */ + __pyx_tuple__7 = PyTuple_Pack(3, __pyx_n_s_quat, __pyx_n_s_q, __pyx_n_s_e); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_quat2euler_single, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 62, __pyx_L1_error) + + /* "common/transformations/transformations.pyx":67 + * return [e(0), e(1), e(2)] + * + * def quat2rot_single(quat): # <<<<<<<<<<<<<< + * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) + * cdef Matrix3 r = quat2rot_c(q) + */ + __pyx_tuple__9 = PyTuple_Pack(3, __pyx_n_s_quat, __pyx_n_s_q, __pyx_n_s_r); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_quat2rot_single, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 67, __pyx_L1_error) + + /* "common/transformations/transformations.pyx":72 + * return matrix2numpy(r) + * + * def rot2quat_single(rot): # <<<<<<<<<<<<<< + * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) + * cdef Quaternion q = rot2quat_c(r) + */ + __pyx_tuple__11 = PyTuple_Pack(3, __pyx_n_s_rot, __pyx_n_s_r, __pyx_n_s_q); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_rot2quat_single, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 72, __pyx_L1_error) + + /* "common/transformations/transformations.pyx":77 + * return [q.w(), q.x(), q.y(), q.z()] + * + * def euler2rot_single(euler): # <<<<<<<<<<<<<< + * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) + * cdef Matrix3 r = euler2rot_c(e) + */ + __pyx_tuple__13 = PyTuple_Pack(3, __pyx_n_s_euler, __pyx_n_s_e, __pyx_n_s_r); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_euler2rot_single, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 77, __pyx_L1_error) + + /* "common/transformations/transformations.pyx":82 + * return matrix2numpy(r) + * + * def rot2euler_single(rot): # <<<<<<<<<<<<<< + * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) + * cdef Vector3 e = rot2euler_c(r) + */ + __pyx_tuple__15 = PyTuple_Pack(3, __pyx_n_s_rot, __pyx_n_s_r, __pyx_n_s_e); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_rot2euler_single, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 82, __pyx_L1_error) + + /* "common/transformations/transformations.pyx":90 + * return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) + * + * def ecef_euler_from_ned_single(ecef_init, ned_pose): # <<<<<<<<<<<<<< + * cdef ECEF init = list2ecef(ecef_init) + * cdef Vector3 pose = Vector3(ned_pose[0], ned_pose[1], ned_pose[2]) + */ + __pyx_tuple__17 = PyTuple_Pack(5, __pyx_n_s_ecef_init, __pyx_n_s_ned_pose, __pyx_n_s_init, __pyx_n_s_pose, __pyx_n_s_e); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ecef_euler_from_ned_single, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 90, __pyx_L1_error) + + /* "common/transformations/transformations.pyx":97 + * return [e(0), e(1), e(2)] + * + * def ned_euler_from_ecef_single(ecef_init, ecef_pose): # <<<<<<<<<<<<<< + * cdef ECEF init = list2ecef(ecef_init) + * cdef Vector3 pose = Vector3(ecef_pose[0], ecef_pose[1], ecef_pose[2]) + */ + __pyx_tuple__19 = PyTuple_Pack(5, __pyx_n_s_ecef_init, __pyx_n_s_ecef_pose, __pyx_n_s_init, __pyx_n_s_pose, __pyx_n_s_e); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ned_euler_from_ecef_single, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 97, __pyx_L1_error) + + /* "common/transformations/transformations.pyx":104 + * return [e(0), e(1), e(2)] + * + * def geodetic2ecef_single(geodetic): # <<<<<<<<<<<<<< + * cdef Geodetic g = list2geodetic(geodetic) + * cdef ECEF e = geodetic2ecef_c(g) + */ + __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_geodetic, __pyx_n_s_g, __pyx_n_s_e); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_geodetic2ecef_single, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(1, 104, __pyx_L1_error) + + /* "common/transformations/transformations.pyx":109 + * return [e.x, e.y, e.z] + * + * def ecef2geodetic_single(ecef): # <<<<<<<<<<<<<< + * cdef ECEF e = list2ecef(ecef) + * cdef Geodetic g = ecef2geodetic_c(e) + */ + __pyx_tuple__23 = PyTuple_Pack(3, __pyx_n_s_ecef, __pyx_n_s_e, __pyx_n_s_g); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ecef2geodetic_single, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(1, 109, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6common_15transformations_15transformations_LocalCoord) < 0) __PYX_ERR(1, 115, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6common_15transformations_15transformations_LocalCoord.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6common_15transformations_15transformations_LocalCoord.tp_dictoffset && __pyx_type_6common_15transformations_15transformations_LocalCoord.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6common_15transformations_15transformations_LocalCoord.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LocalCoord, (PyObject *)&__pyx_type_6common_15transformations_15transformations_LocalCoord) < 0) __PYX_ERR(1, 115, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6common_15transformations_15transformations_LocalCoord) < 0) __PYX_ERR(1, 115, __pyx_L1_error) + __pyx_ptype_6common_15transformations_15transformations_LocalCoord = &__pyx_type_6common_15transformations_15transformations_LocalCoord; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC inittransformations(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC inittransformations(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_transformations(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_transformations(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_transformations(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'transformations' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_transformations(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("transformations", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_common__transformations__transformations) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "common.transformations.transformations")) { + if (unlikely(PyDict_SetItemString(modules, "common.transformations.transformations", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error) + if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error) + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + + /* "common/transformations/transformations.pyx":21 + * + * import cython + * import numpy as np # <<<<<<<<<<<<<< + * cimport numpy as np + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/transformations/transformations.pyx":57 + * return g + * + * def euler2quat_single(euler): # <<<<<<<<<<<<<< + * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) + * cdef Quaternion q = euler2quat_c(e) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_15transformations_15transformations_1euler2quat_single, NULL, __pyx_n_s_common_transformations_transform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_euler2quat_single, __pyx_t_1) < 0) __PYX_ERR(1, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/transformations/transformations.pyx":62 + * return [q.w(), q.x(), q.y(), q.z()] + * + * def quat2euler_single(quat): # <<<<<<<<<<<<<< + * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) + * cdef Vector3 e = quat2euler_c(q); + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_15transformations_15transformations_3quat2euler_single, NULL, __pyx_n_s_common_transformations_transform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_quat2euler_single, __pyx_t_1) < 0) __PYX_ERR(1, 62, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/transformations/transformations.pyx":67 + * return [e(0), e(1), e(2)] + * + * def quat2rot_single(quat): # <<<<<<<<<<<<<< + * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) + * cdef Matrix3 r = quat2rot_c(q) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_15transformations_15transformations_5quat2rot_single, NULL, __pyx_n_s_common_transformations_transform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_quat2rot_single, __pyx_t_1) < 0) __PYX_ERR(1, 67, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/transformations/transformations.pyx":72 + * return matrix2numpy(r) + * + * def rot2quat_single(rot): # <<<<<<<<<<<<<< + * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) + * cdef Quaternion q = rot2quat_c(r) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_15transformations_15transformations_7rot2quat_single, NULL, __pyx_n_s_common_transformations_transform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rot2quat_single, __pyx_t_1) < 0) __PYX_ERR(1, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/transformations/transformations.pyx":77 + * return [q.w(), q.x(), q.y(), q.z()] + * + * def euler2rot_single(euler): # <<<<<<<<<<<<<< + * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) + * cdef Matrix3 r = euler2rot_c(e) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_15transformations_15transformations_9euler2rot_single, NULL, __pyx_n_s_common_transformations_transform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_euler2rot_single, __pyx_t_1) < 0) __PYX_ERR(1, 77, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/transformations/transformations.pyx":82 + * return matrix2numpy(r) + * + * def rot2euler_single(rot): # <<<<<<<<<<<<<< + * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) + * cdef Vector3 e = rot2euler_c(r) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_15transformations_15transformations_11rot2euler_single, NULL, __pyx_n_s_common_transformations_transform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rot2euler_single, __pyx_t_1) < 0) __PYX_ERR(1, 82, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/transformations/transformations.pyx":90 + * return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) + * + * def ecef_euler_from_ned_single(ecef_init, ned_pose): # <<<<<<<<<<<<<< + * cdef ECEF init = list2ecef(ecef_init) + * cdef Vector3 pose = Vector3(ned_pose[0], ned_pose[1], ned_pose[2]) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_15transformations_15transformations_15ecef_euler_from_ned_single, NULL, __pyx_n_s_common_transformations_transform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ecef_euler_from_ned_single, __pyx_t_1) < 0) __PYX_ERR(1, 90, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/transformations/transformations.pyx":97 + * return [e(0), e(1), e(2)] + * + * def ned_euler_from_ecef_single(ecef_init, ecef_pose): # <<<<<<<<<<<<<< + * cdef ECEF init = list2ecef(ecef_init) + * cdef Vector3 pose = Vector3(ecef_pose[0], ecef_pose[1], ecef_pose[2]) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_15transformations_15transformations_17ned_euler_from_ecef_single, NULL, __pyx_n_s_common_transformations_transform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ned_euler_from_ecef_single, __pyx_t_1) < 0) __PYX_ERR(1, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/transformations/transformations.pyx":104 + * return [e(0), e(1), e(2)] + * + * def geodetic2ecef_single(geodetic): # <<<<<<<<<<<<<< + * cdef Geodetic g = list2geodetic(geodetic) + * cdef ECEF e = geodetic2ecef_c(g) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_15transformations_15transformations_19geodetic2ecef_single, NULL, __pyx_n_s_common_transformations_transform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_geodetic2ecef_single, __pyx_t_1) < 0) __PYX_ERR(1, 104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/transformations/transformations.pyx":109 + * return [e.x, e.y, e.z] + * + * def ecef2geodetic_single(ecef): # <<<<<<<<<<<<<< + * cdef ECEF e = list2ecef(ecef) + * cdef Geodetic g = ecef2geodetic_c(e) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_15transformations_15transformations_21ecef2geodetic_single, NULL, __pyx_n_s_common_transformations_transform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ecef2geodetic_single, __pyx_t_1) < 0) __PYX_ERR(1, 109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "common/transformations/transformations.pyx":142 + * + * @classmethod + * def from_geodetic(cls, geodetic): # <<<<<<<<<<<<<< + * return cls(geodetic=geodetic) + * + */ + __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_from_geodetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "common/transformations/transformations.pyx":141 + * return self.ned2ecef_matrix + * + * @classmethod # <<<<<<<<<<<<<< + * def from_geodetic(cls, geodetic): + * return cls(geodetic=geodetic) + */ + __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord->tp_dict, __pyx_n_s_from_geodetic, __pyx_t_2) < 0) __PYX_ERR(1, 142, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6common_15transformations_15transformations_LocalCoord); + + /* "common/transformations/transformations.pyx":146 + * + * @classmethod + * def from_ecef(cls, ecef): # <<<<<<<<<<<<<< + * return cls(ecef=ecef) + * + */ + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_from_ecef); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "common/transformations/transformations.pyx":145 + * return cls(geodetic=geodetic) + * + * @classmethod # <<<<<<<<<<<<<< + * def from_ecef(cls, ecef): + * return cls(ecef=ecef) + */ + __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord->tp_dict, __pyx_n_s_from_ecef, __pyx_t_1) < 0) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6common_15transformations_15transformations_LocalCoord); + + /* "common/transformations/transformations.pyx":1 + * # distutils: language = c++ # <<<<<<<<<<<<<< + * # cython: language_level = 3 + * from common.transformations.transformations cimport Matrix3, Vector3, Quaternion + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1014 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init common.transformations.transformations", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init common.transformations.transformations"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (__Pyx_PyFastCFunction_Check(func)) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* IsLittleEndian */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + +/* BufferFormatCheck */ +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t <= '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case '?': return "'bool'"; + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case '?': case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number, ndim; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ndim = ctx->head->field->type->ndim; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + CYTHON_FALLTHROUGH; + case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) && + (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + CYTHON_FALLTHROUGH; + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} + +/* BufferGetAndValidate */ + static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (unlikely(info->buf == NULL)) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} +static void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static int __Pyx__GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + buf->buf = NULL; + if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) { + __Pyx_ZeroBuffer(buf); + return -1; + } + if (unlikely(buf->ndim != nd)) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if (unlikely((size_t)buf->itemsize != dtype->size)) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_SafeReleaseBuffer(buf); + return -1; +} + +/* PyErrFetchRestore */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* WriteUnraisableException */ + static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* GetItemInt */ + static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* RaiseArgTupleInvalid */ + static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ + static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ + static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseException */ + #if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* GetTopmostException */ + #if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* PyObject_GenericGetAttrNoDict */ + #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ + #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ + static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* SetupReduce */ + static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#else + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#endif +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); + if (likely(reduce_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (reduce == object_reduce || PyErr_Occurred()) { + goto __PYX_BAD; + } + setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); + if (likely(setstate_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (!setstate || PyErr_Occurred()) { + goto __PYX_BAD; + } + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto __PYX_GOOD; +__PYX_BAD: + if (!PyErr_Occurred()) + PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +__PYX_GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* TypeImport */ + #ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ClassMethod */ + static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { +#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000 + if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { + return PyClassMethod_New(method); + } +#else +#if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY + if (PyMethodDescr_Check(method)) +#else + #if PY_MAJOR_VERSION == 2 + static PyTypeObject *methoddescr_type = NULL; + if (methoddescr_type == NULL) { + PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append"); + if (!meth) return NULL; + methoddescr_type = Py_TYPE(meth); + Py_DECREF(meth); + } + #else + PyTypeObject *methoddescr_type = &PyMethodDescr_Type; + #endif + if (__Pyx_TypeCheck(method, methoddescr_type)) +#endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject *)method; + #if PY_VERSION_HEX < 0x03020000 + PyTypeObject *d_type = descr->d_type; + #else + PyTypeObject *d_type = descr->d_common.d_type; + #endif + return PyDescr_NewClassMethod(d_type, descr->d_method); + } +#endif + else if (PyMethod_Check(method)) { + return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); + } + else { + return PyClassMethod_New(method); + } +} + +/* GetNameInClass */ + static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* CLineInTraceback */ + #ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ + #include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if ((0)) {} + view->obj = NULL; + Py_DECREF(obj); +} +#endif + + + /* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = (float)(1.0) / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + float r = b.real / b.imag; + float s = (float)(1.0) / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_float(a, a); + case 3: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); + case 4: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_float(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = (double)(1.0) / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = (double)(1.0) / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_double(a, a); + case 3: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); + case 4: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_double(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ + #if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; ip) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/common/transformations/transformations.pxd b/common/transformations/transformations.pxd new file mode 100644 index 000000000..7af009870 --- /dev/null +++ b/common/transformations/transformations.pxd @@ -0,0 +1,72 @@ +#cython: language_level=3 +from libcpp cimport bool + +cdef extern from "orientation.cc": + pass + +cdef extern from "orientation.hpp": + cdef cppclass Quaternion "Eigen::Quaterniond": + Quaternion() + Quaternion(double, double, double, double) + double w() + double x() + double y() + double z() + + cdef cppclass Vector3 "Eigen::Vector3d": + Vector3() + Vector3(double, double, double) + double operator()(int) + + cdef cppclass Matrix3 "Eigen::Matrix3d": + Matrix3() + Matrix3(double*) + + double operator()(int, int) + + Quaternion euler2quat(Vector3) + Vector3 quat2euler(Quaternion) + Matrix3 quat2rot(Quaternion) + Quaternion rot2quat(Matrix3) + Vector3 rot2euler(Matrix3) + Matrix3 euler2rot(Vector3) + Matrix3 rot_matrix(double, double, double) + Vector3 ecef_euler_from_ned(ECEF, Vector3) + Vector3 ned_euler_from_ecef(ECEF, Vector3) + + +cdef extern from "coordinates.cc": + cdef struct ECEF: + double x + double y + double z + + cdef struct NED: + double n + double e + double d + + cdef struct Geodetic: + double lat + double lon + double alt + bool radians + + ECEF geodetic2ecef(Geodetic) + Geodetic ecef2geodetic(ECEF) + + cdef cppclass LocalCoord_c "LocalCoord": + Matrix3 ned2ecef_matrix + Matrix3 ecef2ned_matrix + + LocalCoord_c(Geodetic, ECEF) + LocalCoord_c(Geodetic) + LocalCoord_c(ECEF) + + NED ecef2ned(ECEF) + ECEF ned2ecef(NED) + NED geodetic2ned(Geodetic) + Geodetic ned2geodetic(NED) + +cdef extern from "coordinates.hpp": + pass diff --git a/common/transformations/transformations.pyx b/common/transformations/transformations.pyx new file mode 100644 index 000000000..ce80d90d2 --- /dev/null +++ b/common/transformations/transformations.pyx @@ -0,0 +1,174 @@ +# distutils: language = c++ +# cython: language_level = 3 +from common.transformations.transformations cimport Matrix3, Vector3, Quaternion +from common.transformations.transformations cimport ECEF, NED, Geodetic + +from common.transformations.transformations cimport euler2quat as euler2quat_c +from common.transformations.transformations cimport quat2euler as quat2euler_c +from common.transformations.transformations cimport quat2rot as quat2rot_c +from common.transformations.transformations cimport rot2quat as rot2quat_c +from common.transformations.transformations cimport euler2rot as euler2rot_c +from common.transformations.transformations cimport rot2euler as rot2euler_c +from common.transformations.transformations cimport rot_matrix as rot_matrix_c +from common.transformations.transformations cimport ecef_euler_from_ned as ecef_euler_from_ned_c +from common.transformations.transformations cimport ned_euler_from_ecef as ned_euler_from_ecef_c +from common.transformations.transformations cimport geodetic2ecef as geodetic2ecef_c +from common.transformations.transformations cimport ecef2geodetic as ecef2geodetic_c +from common.transformations.transformations cimport LocalCoord_c + + +import cython +import numpy as np +cimport numpy as np + +cdef np.ndarray[double, ndim=2] matrix2numpy(Matrix3 m): + return np.array([ + [m(0, 0), m(0, 1), m(0, 2)], + [m(1, 0), m(1, 1), m(1, 2)], + [m(2, 0), m(2, 1), m(2, 2)], + ]) + +cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m): + assert m.shape[0] == 3 + assert m.shape[1] == 3 + return Matrix3(m.data) + +cdef ECEF list2ecef(ecef): + cdef ECEF e; + e.x = ecef[0] + e.y = ecef[1] + e.z = ecef[2] + return e + +cdef NED list2ned(ned): + cdef NED n; + n.n = ned[0] + n.e = ned[1] + n.d = ned[2] + return n + +cdef Geodetic list2geodetic(geodetic): + cdef Geodetic g + g.lat = geodetic[0] + g.lon = geodetic[1] + g.alt = geodetic[2] + return g + +def euler2quat_single(euler): + cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) + cdef Quaternion q = euler2quat_c(e) + return [q.w(), q.x(), q.y(), q.z()] + +def quat2euler_single(quat): + cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) + cdef Vector3 e = quat2euler_c(q); + return [e(0), e(1), e(2)] + +def quat2rot_single(quat): + cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) + cdef Matrix3 r = quat2rot_c(q) + return matrix2numpy(r) + +def rot2quat_single(rot): + cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) + cdef Quaternion q = rot2quat_c(r) + return [q.w(), q.x(), q.y(), q.z()] + +def euler2rot_single(euler): + cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) + cdef Matrix3 r = euler2rot_c(e) + return matrix2numpy(r) + +def rot2euler_single(rot): + cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) + cdef Vector3 e = rot2euler_c(r) + return [e(0), e(1), e(2)] + +def rot_matrix(roll, pitch, yaw): + return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) + +def ecef_euler_from_ned_single(ecef_init, ned_pose): + cdef ECEF init = list2ecef(ecef_init) + cdef Vector3 pose = Vector3(ned_pose[0], ned_pose[1], ned_pose[2]) + + cdef Vector3 e = ecef_euler_from_ned_c(init, pose) + return [e(0), e(1), e(2)] + +def ned_euler_from_ecef_single(ecef_init, ecef_pose): + cdef ECEF init = list2ecef(ecef_init) + cdef Vector3 pose = Vector3(ecef_pose[0], ecef_pose[1], ecef_pose[2]) + + cdef Vector3 e = ned_euler_from_ecef_c(init, pose) + return [e(0), e(1), e(2)] + +def geodetic2ecef_single(geodetic): + cdef Geodetic g = list2geodetic(geodetic) + cdef ECEF e = geodetic2ecef_c(g) + return [e.x, e.y, e.z] + +def ecef2geodetic_single(ecef): + cdef ECEF e = list2ecef(ecef) + cdef Geodetic g = ecef2geodetic_c(e) + return [g.lat, g.lon, g.alt] + + +cdef class LocalCoord: + cdef LocalCoord_c * lc + + def __init__(self, geodetic=None, ecef=None): + assert (geodetic is not None) or (ecef is not None) + if geodetic is not None: + self.lc = new LocalCoord_c(list2geodetic(geodetic)) + elif ecef is not None: + self.lc = new LocalCoord_c(list2ecef(ecef)) + + @property + def ned2ecef_matrix(self): + return matrix2numpy(self.lc.ned2ecef_matrix) + + @property + def ecef2ned_matrix(self): + return matrix2numpy(self.lc.ecef2ned_matrix) + + @property + def ned_from_ecef_matrix(self): + return self.ecef2ned_matrix + + @property + def ecef_from_ned_matrix(self): + return self.ned2ecef_matrix + + @classmethod + def from_geodetic(cls, geodetic): + return cls(geodetic=geodetic) + + @classmethod + def from_ecef(cls, ecef): + return cls(ecef=ecef) + + def ecef2ned_single(self, ecef): + assert self.lc + cdef ECEF e = list2ecef(ecef) + cdef NED n = self.lc.ecef2ned(e) + return [n.n, n.e, n.d] + + def ned2ecef_single(self, ned): + assert self.lc + cdef NED n = list2ned(ned) + cdef ECEF e = self.lc.ned2ecef(n) + return [e.x, e.y, e.z] + + def geodetic2ned_single(self, geodetic): + assert self.lc + cdef Geodetic g = list2geodetic(geodetic) + cdef NED n = self.lc.geodetic2ned(g) + return [n.n, n.e, n.d] + + def ned2geodetic_single(self, ned): + assert self.lc + cdef NED n = list2ned(ned) + cdef Geodetic g = self.lc.ned2geodetic(n) + return [g.lat, g.lon, g.alt] + + def __dealloc__(self): + del self.lc diff --git a/common/transformations/transformations.so b/common/transformations/transformations.so new file mode 100755 index 000000000..dd810f7f0 Binary files /dev/null and b/common/transformations/transformations.so differ diff --git a/common/xattr.py b/common/xattr.py new file mode 100644 index 000000000..fa61b9e0f --- /dev/null +++ b/common/xattr.py @@ -0,0 +1,45 @@ +import os +from cffi import FFI + +# Workaround for the EON/termux build of Python having os.*xattr removed. +ffi = FFI() +ffi.cdef(""" +int setxattr(const char *path, const char *name, const void *value, size_t size, int flags); +ssize_t getxattr(const char *path, const char *name, void *value, size_t size); +ssize_t listxattr(const char *path, char *list, size_t size); +int removexattr(const char *path, const char *name); +""") +libc = ffi.dlopen(None) + +def setxattr(path, name, value, flags=0): + path = path.encode() + name = name.encode() + if libc.setxattr(path, name, value, len(value), flags) == -1: + raise OSError(ffi.errno, f"{os.strerror(ffi.errno)}: setxattr({path}, {name}, {value}, {flags})") + +def getxattr(path, name, size=128): + path = path.encode() + name = name.encode() + value = ffi.new(f"char[{size}]") + l = libc.getxattr(path, name, value, size) + if l == -1: + # errno 61 means attribute hasn't been set + if ffi.errno == 61: + return None + raise OSError(ffi.errno, f"{os.strerror(ffi.errno)}: getxattr({path}, {name}, {size})") + return ffi.buffer(value)[:l] + +def listxattr(path, size=128): + path = path.encode() + attrs = ffi.new(f"char[{size}]") + l = libc.listxattr(path, attrs, size) + if l == -1: + raise OSError(ffi.errno, f"{os.strerror(ffi.errno)}: listxattr({path}, {size})") + # attrs is b'\0' delimited values (so chop off trailing empty item) + return [a.decode() for a in ffi.buffer(attrs)[:l].split(b"\0")[0:-1]] + +def removexattr(path, name): + path = path.encode() + name = name.encode() + if libc.removexattr(path, name) == -1: + raise OSError(ffi.errno, f"{os.strerror(ffi.errno)}: removexattr({path}, {name})") diff --git a/docs/CARS.md b/docs/CARS.md new file mode 100644 index 000000000..5f14a9278 --- /dev/null +++ b/docs/CARS.md @@ -0,0 +1,185 @@ +# Supported Cars + +## comma.ai supported cars + +| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below | +| ----------| ------------------------------| ------------------| -----------------| -------------------| ------------------| +| Acura | ILX 2016-19 | AcuraWatch Plus | openpilot | 25mph1 | 25mph | +| Acura | RDX 2016-18 | AcuraWatch Plus | openpilot | 25mph1 | 12mph | +| Acura | RDX 2019-21 | All | Stock | 0mph | 3mph | +| Honda | Accord 2018-21 | All | Stock | 0mph | 3mph | +| Honda | Accord Hybrid 2018-21 | All | Stock | 0mph | 3mph | +| Honda | Civic Hatchback 2017-21 | Honda Sensing | Stock | 0mph | 12mph | +| Honda | Civic Coupe 2016-18 | Honda Sensing | openpilot | 0mph | 12mph | +| Honda | Civic Coupe 2019-20 | All | Stock | 0mph | 2mph2 | +| Honda | Civic Sedan 2016-18 | Honda Sensing | openpilot | 0mph | 12mph | +| Honda | Civic Sedan 2019-20 | All | Stock | 0mph | 2mph2 | +| Honda | CR-V 2015-16 | Touring | openpilot | 25mph1 | 12mph | +| Honda | CR-V 2017-21 | Honda Sensing | Stock | 0mph | 12mph | +| Honda | CR-V Hybrid 2017-2019 | Honda Sensing | Stock | 0mph | 12mph | +| Honda | e 2020 | All | Stock | 0mph | 3mph | +| Honda | Fit 2018-19 | Honda Sensing | openpilot | 25mph1 | 12mph | +| Honda | Freed 2020 | Honda Sensing | openpilot | 25mph1 | 12mph | +| Honda | HR-V 2019-20 | Honda Sensing | openpilot | 25mph1 | 12mph | +| Honda | Insight 2019-21 | All | Stock | 0mph | 3mph | +| Honda | Inspire 2018 | All | Stock | 0mph | 3mph | +| Honda | Odyssey 2018-20 | Honda Sensing | openpilot | 25mph1 | 0mph | +| Honda | Passport 2019-21 | All | openpilot | 25mph1 | 12mph | +| Honda | Pilot 2016-21 | Honda Sensing | openpilot | 25mph1 | 12mph | +| Honda | Ridgeline 2017-21 | Honda Sensing | openpilot | 25mph1 | 12mph | +| Hyundai | Palisade 2020-21 | All | Stock | 0mph | 0mph | +| Hyundai | Sonata 2020-22 | All | Stock | 0mph | 0mph | +| Lexus | CT Hybrid 2017-18 | LSS | Stock3| 0mph | 0mph | +| Lexus | ES 2019-21 | All | openpilot | 0mph | 0mph | +| Lexus | ES Hybrid 2017-18 | LSS | Stock3| 0mph | 0mph | +| Lexus | ES Hybrid 2019-21 | All | openpilot | 0mph | 0mph | +| Lexus | IS 2017-2019 | All | Stock | 22mph | 0mph | +| Lexus | NX 2018-2019 | All | Stock3| 0mph | 0mph | +| Lexus | NX 2020 | All | openpilot | 0mph | 0mph | +| Lexus | NX Hybrid 2018-19 | All | Stock3| 0mph | 0mph | +| Lexus | RC 2020 | All | Stock | 22mph | 0mph | +| Lexus | RX 2016-18 | All | Stock3| 0mph | 0mph | +| Lexus | RX 2020-21 | All | openpilot | 0mph | 0mph | +| Lexus | RX Hybrid 2016-19 | All | Stock3| 0mph | 0mph | +| Lexus | RX Hybrid 2020-21 | All | openpilot | 0mph | 0mph | +| Lexus | UX Hybrid 2019-21 | All | openpilot | 0mph | 0mph | +| Toyota | Alphard 2019-20 | All | openpilot | 0mph | 0mph | +| Toyota | Avalon 2016-21 | TSS-P | Stock3| 20mph1 | 0mph | +| Toyota | Avalon 2022 | All | openpilot | 0mph | 0mph | +| Toyota | Avalon Hybrid 2019-21 | TSS-P | Stock3| 20mph1 | 0mph | +| Toyota | Camry 2018-20 | All | Stock | 0mph4 | 0mph | +| Toyota | Camry 2021-22 | All | openpilot | 0mph4 | 0mph | +| Toyota | Camry Hybrid 2018-20 | All | Stock | 0mph4 | 0mph | +| Toyota | Camry Hybrid 2021-22 | All | openpilot | 0mph | 0mph | +| Toyota | C-HR 2017-21 | All | Stock | 0mph | 0mph | +| Toyota | C-HR Hybrid 2017-19 | All | Stock | 0mph | 0mph | +| Toyota | Corolla 2017-19 | All | Stock3| 20mph1 | 0mph | +| Toyota | Corolla 2020-22 | All | openpilot | 0mph | 0mph | +| Toyota | Corolla Hatchback 2019-22 | All | openpilot | 0mph | 0mph | +| Toyota | Corolla Hybrid 2020-22 | All | openpilot | 0mph | 0mph | +| Toyota | Highlander 2017-19 | All | Stock3| 0mph | 0mph | +| Toyota | Highlander 2020-22 | All | openpilot | 0mph | 0mph | +| Toyota | Highlander Hybrid 2017-19 | All | Stock3| 0mph | 0mph | +| Toyota | Highlander Hybrid 2020-22 | All | openpilot | 0mph | 0mph | +| Toyota | Mirai 2021 | All | openpilot | 0mph | 0mph | +| Toyota | Prius 2016-20 | TSS-P | Stock3| 0mph | 0mph | +| Toyota | Prius 2021-22 | All | openpilot | 0mph | 0mph | +| Toyota | Prius v 2017 | TSS-P | Stock3| 20mph1 | 0mph | +| Toyota | Prius Prime 2017-20 | All | Stock3| 0mph | 0mph | +| Toyota | Prius Prime 2021-22 | All | openpilot | 0mph | 0mph | +| Toyota | Rav4 2016-18 | TSS-P | Stock3| 20mph1 | 0mph | +| Toyota | Rav4 2019-21 | All | openpilot | 0mph | 0mph | +| Toyota | Rav4 Hybrid 2016-18 | TSS-P | Stock3| 0mph | 0mph | +| Toyota | Rav4 Hybrid 2019-21 | All | openpilot | 0mph | 0mph | +| Toyota | Sienna 2018-20 | All | Stock3| 0mph | 0mph | + +1[Comma Pedal](https://github.com/commaai/openpilot/wiki/comma-pedal) is used to provide stop-and-go capability to some of the openpilot-supported cars that don't currently support stop-and-go. ***NOTE: The Comma Pedal is not officially supported by [comma](https://comma.ai).***
    +22019 Honda Civic 1.6L Diesel Sedan does not have ALC below 12mph.
    +3When disconnecting the Driver Support Unit (DSU), openpilot ACC will replace stock ACC. ***NOTE: disconnecting the DSU disables Automatic Emergency Braking (AEB).***
    +428mph for Camry 4CYL L, 4CYL LE and 4CYL SE which don't have Full-Speed Range Dynamic Radar Cruise Control.
    + +## Community Maintained Cars and Features + +| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below | +| ----------| --------------------------------| ------------------| -----------------| -------------------| -------------| +| Audi | A3 2014-19 | ACC + Lane Assist | Stock | 0mph | 0mph | +| Audi | A3 Sportback e-tron 2017-18 | ACC + Lane Assist | Stock | 0mph | 0mph | +| Audi | Q2 2018 | ACC + Lane Assist | Stock | 0mph | 0mph | +| Audi | Q3 2020-21 | ACC + Lane Assist | Stock | 0mph | 0mph | +| Audi | S3 2015 | ACC + Lane Assist | Stock | 0mph | 0mph | +| Cadillac | Escalade ESV 20161 | ACC + LKAS | openpilot | 0mph | 7mph | +| Chevrolet | Volt 2017-181 | Adaptive Cruise | openpilot | 0mph | 7mph | +| Chrysler | Pacifica 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph | +| Chrysler | Pacifica 2020 | Adaptive Cruise | Stock | 0mph | 39mph | +| Chrysler | Pacifica Hybrid 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph | +| Chrysler | Pacifica Hybrid 2019-21 | Adaptive Cruise | Stock | 0mph | 39mph | +| Genesis | G70 2018 | All | Stock | 0mph | 0mph | +| Genesis | G70 2020 | All | Stock | 0mph | 0mph | +| Genesis | G80 2018 | All | Stock | 0mph | 0mph | +| Genesis | G90 2018 | All | Stock | 0mph | 0mph | +| GMC | Acadia 20181 | Adaptive Cruise | openpilot | 0mph | 7mph | +| Hyundai | Elantra 2017-19 | SCC + LKAS | Stock | 19mph | 34mph | +| Hyundai | Elantra 2021 | SCC + LKAS | Stock | 0mph | 0mph | +| Hyundai | Elantra Hybrid 2021 | SCC + LKAS | Stock | 0mph | 0mph | +| Hyundai | Genesis 2015-16 | SCC + LKAS | Stock | 19mph | 37mph | +| Hyundai | Ioniq Electric 2019 | SCC + LKAS | Stock | 0mph | 32mph | +| Hyundai | Ioniq Electric 2020 | SCC + LKAS | Stock | 0mph | 0mph | +| Hyundai | Ioniq Hybrid 2017-19 | SCC + LKAS | Stock | 0mph | 32mph | +| Hyundai | Ioniq Hybrid 2020-22 | SCC + LFA | Stock | 0mph | 0mph | +| Hyundai | Ioniq PHEV 2020-21 | SCC + LKAS | Stock | 0mph | 0mph | +| Hyundai | Kona 2020 | SCC + LKAS | Stock | 0mph | 0mph | +| Hyundai | Kona EV 2018-19 | SCC + LKAS | Stock | 0mph | 0mph | +| Hyundai | Kona Hybrid 2020 | SCC + LKAS | Stock | 0mph | 0mph | +| Hyundai | Santa Fe 2019-20 | All | Stock | 0mph | 0mph | +| Hyundai | Santa Fe 2021-22 | All | Stock | 0mph | 0mph | +| Hyundai | Santa Fe Hybrid 2022 | All | Stock | 0mph | 0mph | +| Hyundai | Santa Fe Plug-in Hybrid 2022 | All | Stock | 0mph | 0mph | +| Hyundai | Sonata 2018-2019 | SCC + LKAS | Stock | 0mph | 0mph | +| Hyundai | Sonata Hybrid 2021-22 | All | Stock | 0mph | 0mph | +| Hyundai | Veloster 2019-20 | SCC + LKAS | Stock | 5mph | 0mph | +| Jeep | Grand Cherokee 2016-18 | Adaptive Cruise | Stock | 0mph | 9mph | +| Jeep | Grand Cherokee 2019-20 | Adaptive Cruise | Stock | 0mph | 39mph | +| Kia | Ceed 2019 | SCC + LKAS | Stock | 0mph | 0mph | +| Kia | Forte 2018-21 | SCC + LKAS | Stock | 0mph | 0mph | +| Kia | K5 2021-22 | SCC + LFA | Stock | 0mph | 0mph | +| Kia | Niro EV 2019-22 | All | Stock | 0mph | 0mph | +| Kia | Niro Hybrid 2021 | SCC + LKAS | Stock | 0mph | 0mph | +| Kia | Niro PHEV 2019 | SCC + LKAS | Stock | 10mph | 32mph | +| Kia | Optima 2017 | SCC + LKAS | Stock | 0mph | 32mph | +| Kia | Optima 2019 | SCC + LKAS | Stock | 0mph | 0mph | +| Kia | Seltos 2021 | SCC + LKAS | Stock | 0mph | 0mph | +| Kia | Sorento 2018-19 | SCC + LKAS | Stock | 0mph | 0mph | +| Kia | Stinger 2018 | SCC + LKAS | Stock | 0mph | 0mph | +| Kia | Telluride 2020 | SCC + LKAS | Stock | 0mph | 0mph | +| Mazda | CX-5 2022 | All | Stock | 0mph | 0mph | +| Mazda | CX-9 2021 | All | Stock | 0mph | 28mph | +| Nissan | Altima 2019-20 | ProPILOT | Stock | 0mph | 0mph | +| Nissan | Leaf 2018-22 | ProPILOT | Stock | 0mph | 0mph | +| Nissan | Rogue 2018-20 | ProPILOT | Stock | 0mph | 0mph | +| Nissan | X-Trail 2017 | ProPILOT | Stock | 0mph | 0mph | +| SEAT | Ateca 2018 | Driver Assistance | Stock | 0mph | 0mph | +| SEAT | Leon 2014-2020 | Driver Assistance | Stock | 0mph | 0mph | +| Subaru | Ascent 2019 | EyeSight | Stock | 0mph | 0mph | +| Subaru | Crosstrek 2018-20 | EyeSight | Stock | 0mph | 0mph | +| Subaru | Forester 2019-21 | EyeSight | Stock | 0mph | 0mph | +| Subaru | Impreza 2017-19 | EyeSight | Stock | 0mph | 0mph | +| Škoda | Kamiq 20212 | Driver Assistance | Stock | 0mph | 0mph | +| Škoda | Karoq 2019 | Driver Assistance | Stock | 0mph | 0mph | +| Škoda | Kodiaq 2018-19 | Driver Assistance | Stock | 0mph | 0mph | +| Škoda | Octavia 2015, 2018-19 | Driver Assistance | Stock | 0mph | 0mph | +| Škoda | Octavia RS 2016 | Driver Assistance | Stock | 0mph | 0mph | +| Škoda | Scala 2020 | Driver Assistance | Stock | 0mph | 0mph | +| Škoda | Superb 2015-18 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Arteon 2018, 20214 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Atlas 2018-19, 20224 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Caravelle 20204 | Driver Assistance | Stock | 0mph | 32mph | +| Volkswagen| California 20214 | Driver Assistance | Stock | 0mph | 32mph | +| Volkswagen| e-Golf 2014, 2019-20 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Golf 2015-20 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Golf Alltrack 2017-18 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Golf GTE 2016 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Golf GTI 2018-20 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Golf R 2016-19 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Golf SportsVan 2016 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Golf SportWagen 2015 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Jetta 2018-20 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Jetta GLI 2021 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Passat 2016-183 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Polo 2020 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| T-Cross 20214 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| T-Roc 20214 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Taos 20224 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Tiguan 2020 | Driver Assistance | Stock | 0mph | 0mph | +| Volkswagen| Touran 2017 | Driver Assistance | Stock | 0mph | 0mph | + +1Requires an [OBD-II car harness](https://comma.ai/shop/products/comma-car-harness) and [community built ASCM harness](https://github.com/commaai/openpilot/wiki/GM#hardware). ***NOTE: disconnecting the ASCM disables Automatic Emergency Braking (AEB).***
    +2Not including the China market Kamiq, which is based on the (currently) unsupported PQ34 platform.
    +3Not including the USA/China market Passat, which is based on the (currently) unsupported PQ35/NMS platform.
    +4Model-years 2021 and beyond may have a new camera harness design, which isn't yet available from the comma store. Before ordering, +remove the Lane Assist camera cover and check to see if the connector is black (older design) or light brown (newer design). For the newer design, +in the interim, choose "VW J533 Development" from the vehicle drop-down for a harness that integrates at the CAN gateway inside the dashboard.
    +Community Maintained Cars and Features are not verified by comma to meet our [safety model](SAFETY.md). Be extra cautious using them. + +To promote a car from community maintained, it must meet a few requirements. We must own one from the brand, we must sell the harness for it, has full ISO26262 in both panda and openpilot, there must be a path forward for longitudinal control, it must have AEB still enabled, and it must support fingerprinting 2.0 + +Although they're not upstream, the community has openpilot running on other makes and models. See the 'Community Supported Models' section of each make [on our wiki](https://wiki.comma.ai/). diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 000000000..7a074f12d --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,48 @@ +# How to contribute + +Our software is open source so you can solve your own problems without needing help from others. And if you solve a problem and are so kind, you can upstream it for the rest of the world to use. Check out our [post about externalization](https://blog.comma.ai/a-2020-theme-externalization/). + +Most open source development activity is coordinated through our [GitHub Discussions](https://github.com/commaai/openpilot/discussions) and [Discord](https://discord.comma.ai). A lot of documentation is available at https://docs.comma.ai and on our [blog](https://blog.comma.ai/). + +### Getting Started + + * Setup your [development environment](../tools/) + * Join our [Discord](https://discord.comma.ai) + * Make sure you have a [GitHub account](https://github.com/signup/free) + * Fork [our repositories](https://github.com/commaai) on GitHub + +### First contribution +Try out some of these first pull requests ideas to dive into the codebase: + +* Increase our [mypy](http://mypy-lang.org/) coverage +* Write some documentation +* Tackle an open [good first issue](https://github.com/commaai/openpilot/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) + +## Pull Requests + +Pull requests should be against the master branch. Welcomed contributions include bug reports, car ports, and any [open issue](https://github.com/commaai/openpilot/issues). If you're unsure about a contribution, feel free to open a discussion, issue, or draft PR to discuss the problem you're trying to solve. + +A good pull request has all of the following: +* a clearly stated purpose +* every line changed directly contributes to the stated purpose +* verification, i.e. how did you test your PR? +* justification + * if you've optimized something, post benchmarks to prove it's better + * if you've improved your car's tuning, post before and after plots +* passes the CI tests + +### Car Ports + +We've released a [Model Port guide](https://blog.comma.ai/openpilot-port-guide-for-toyota-models/) for porting to Toyota/Lexus models. + +If you port openpilot to a substantially new car brand, see this more generic [Brand Port guide](https://blog.comma.ai/how-to-write-a-car-port-for-openpilot/). + +## Testing + +### Automated Testing + +All PRs and commits are automatically checked by GitHub Actions. Check out `.github/workflows/` for what GitHub Actions runs. Any new tests should be added to GitHub Actions. + +### Code Style and Linting + +Code is automatically checked for style by GitHub Actions as part of the automated tests. You can also run these tests yourself by running `pre-commit run --all`. diff --git a/docs/INTEGRATION.md b/docs/INTEGRATION.md new file mode 100644 index 000000000..97b72e39d --- /dev/null +++ b/docs/INTEGRATION.md @@ -0,0 +1,11 @@ +# Integration with Stock Features + +In all supported cars: +* Stock Lane Keep Assist (LKA) and stock ALC are replaced by openpilot ALC, which only functions when openpilot is engaged by the user. +* Stock LDW is replaced by openpilot LDW. + +Additionally, on specific supported cars (see ACC column in [supported cars](CARS.md)): +* Stock ACC is replaced by openpilot ACC. +* openpilot FCW operates in addition to stock FCW. + +openpilot should preserve all other vehicle's stock features, including, but are not limited to: FCW, Automatic Emergency Braking (AEB), auto high-beam, blind spot warning, and side collision warning. diff --git a/docs/LIMITATIONS.md b/docs/LIMITATIONS.md new file mode 100644 index 000000000..8c112659c --- /dev/null +++ b/docs/LIMITATIONS.md @@ -0,0 +1,58 @@ +# Limitations +## Limitations of openpilot ALC and LDW + +openpilot ALC and openpilot LDW do not automatically drive the vehicle or reduce the amount of attention that must be paid to operate your vehicle. The driver must always keep control of the steering wheel and be ready to correct the openpilot ALC action at all times. + +While changing lanes, openpilot is not capable of looking next to you or checking your blind spot. Only nudge the wheel to initiate a lane change after you have confirmed it's safe to do so. + +Many factors can impact the performance of openpilot ALC and openpilot LDW, causing them to be unable to function as intended. These include, but are not limited to: + +* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation. +* The road facing camera is obstructed, covered or damaged by mud, ice, snow, etc. +* Obstruction caused by applying excessive paint or adhesive products (such as wraps, stickers, rubber coating, etc.) onto the vehicle. +* The device is mounted incorrectly. +* When in sharp curves, like on-off ramps, intersections etc...; openpilot is designed to be limited in the amount of steering torque it can produce. +* In the presence of restricted lanes or construction zones. +* When driving on highly banked roads or in presence of strong cross-wind. +* Extremely hot or cold temperatures. +* Bright light (due to oncoming headlights, direct sunlight, etc.). +* Driving on hills, narrow, or winding roads. + +The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. It is the driver's responsibility to be in control of the vehicle at all times. + +## Limitations of openpilot ACC and FCW + +openpilot ACC and openpilot FCW are not systems that allow careless or inattentive driving. It is still necessary for the driver to pay close attention to the vehicle’s surroundings and to be ready to re-take control of the gas and the brake at all times. + +Many factors can impact the performance of openpilot ACC and openpilot FCW, causing them to be unable to function as intended. These include, but are not limited to: + +* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation. +* The road facing camera or radar are obstructed, covered, or damaged by mud, ice, snow, etc. +* Obstruction caused by applying excessive paint or adhesive products (such as wraps, stickers, rubber coating, etc.) onto the vehicle. +* The device is mounted incorrectly. +* Approaching a toll booth, a bridge or a large metal plate. +* When driving on roads with pedestrians, cyclists, etc... +* In presence of traffic signs or stop lights, which are not detected by openpilot at this time. +* When the posted speed limit is below the user selected set speed. openpilot does not detect speed limits at this time. +* In presence of vehicles in the same lane that are not moving. +* When abrupt braking maneuvers are required. openpilot is designed to be limited in the amount of deceleration and acceleration that it can produce. +* When surrounding vehicles perform close cut-ins from neighbor lanes. +* Driving on hills, narrow, or winding roads. +* Extremely hot or cold temperatures. +* Bright light (due to oncoming headlights, direct sunlight, etc.). +* Interference from other equipment that generates radar waves. + +The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. It is the driver's responsibility to be in control of the vehicle at all times. + +## Limitations of openpilot DM + +openpilot DM should not be considered an exact measurement of the alertness of the driver. + +Many factors can impact the performance of openpilot DM, causing it to be unable to function as intended. These include, but are not limited to: + +* Low light conditions, such as driving at night or in dark tunnels. +* Bright light (due to oncoming headlights, direct sunlight, etc.). +* The driver's face is partially or completely outside field of view of the driver facing camera. +* The driver facing camera is obstructed, covered, or damaged. + +The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. A driver should not rely on openpilot DM to assess their level of attention. diff --git a/installer/updater/updater b/installer/updater/updater new file mode 100755 index 000000000..8bf40708a --- /dev/null +++ b/installer/updater/updater @@ -0,0 +1,2 @@ +#!/usr/bin/bash +echo "this is a compatability shim for old updaters" diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh new file mode 100755 index 000000000..c65bccea6 --- /dev/null +++ b/launch_chffrplus.sh @@ -0,0 +1,208 @@ +#!/usr/bin/bash + +if [ -z "$BASEDIR" ]; then + BASEDIR="/data/openpilot" +fi + +source "$BASEDIR/launch_env.sh" + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + +# Handle tinkla spinner deploy + +if [ -f "/system/media/.tinkla_splash" ]; then + echo "Tinkla splash exists." +else + echo "Tinkla splash not deployed yet" + mount -o rw,remount /system + cp /data/openpilot/selfdrive/car/tesla/tinkla/bootanimation.zip /system/media/ + touch /system/media/.tinkla_splash + mount -o ro,remount /system + reboot +fi + +function two_init { + + # set IO scheduler + setprop sys.io.scheduler noop + for f in /sys/block/*/queue/scheduler; do + echo noop > $f + done + + # *** shield cores 2-3 *** + + # TODO: should we enable this? + # offline cores 2-3 to force recurring timers onto the other cores + #echo 0 > /sys/devices/system/cpu/cpu2/online + #echo 0 > /sys/devices/system/cpu/cpu3/online + #echo 1 > /sys/devices/system/cpu/cpu2/online + #echo 1 > /sys/devices/system/cpu/cpu3/online + + # android gets two cores + echo 0-1 > /dev/cpuset/background/cpus + echo 0-1 > /dev/cpuset/system-background/cpus + echo 0-1 > /dev/cpuset/foreground/cpus + echo 0-1 > /dev/cpuset/foreground/boost/cpus + echo 0-1 > /dev/cpuset/android/cpus + + # openpilot gets all the cores + echo 0-3 > /dev/cpuset/app/cpus + + # mask off 2-3 from RPS and XPS - Receive/Transmit Packet Steering + echo 3 | tee /sys/class/net/*/queues/*/rps_cpus + echo 3 | tee /sys/class/net/*/queues/*/xps_cpus + + # *** set up governors *** + + # +50mW offroad, +500mW onroad for 30% more RAM bandwidth + echo "performance" > /sys/class/devfreq/soc:qcom,cpubw/governor + echo 1056000 > /sys/class/devfreq/soc:qcom,m4m/max_freq + echo "performance" > /sys/class/devfreq/soc:qcom,m4m/governor + + # unclear if these help, but they don't seem to hurt + echo "performance" > /sys/class/devfreq/soc:qcom,memlat-cpu0/governor + echo "performance" > /sys/class/devfreq/soc:qcom,memlat-cpu2/governor + + # GPU + echo "performance" > /sys/class/devfreq/b00000.qcom,kgsl-3d0/governor + + # /sys/class/devfreq/soc:qcom,mincpubw is the only one left at "powersave" + # it seems to gain nothing but a wasted 500mW + + # *** set up IRQ affinities *** + + # Collect RIL and other possibly long-running I/O interrupts onto CPU 1 + echo 1 > /proc/irq/78/smp_affinity_list # qcom,smd-modem (LTE radio) + echo 1 > /proc/irq/33/smp_affinity_list # ufshcd (flash storage) + echo 1 > /proc/irq/35/smp_affinity_list # wifi (wlan_pci) + echo 1 > /proc/irq/6/smp_affinity_list # MDSS + + # USB traffic needs realtime handling on cpu 3 + [ -d "/proc/irq/733" ] && echo 3 > /proc/irq/733/smp_affinity_list + + # GPU and camera get cpu 2 + CAM_IRQS="177 178 179 180 181 182 183 184 185 186 192" + for irq in $CAM_IRQS; do + echo 2 > /proc/irq/$irq/smp_affinity_list + done + echo 2 > /proc/irq/193/smp_affinity_list # GPU + + # give GPU threads RT priority + for pid in $(pgrep "kgsl"); do + chrt -f -p 52 $pid + done + + # the flippening! + LD_LIBRARY_PATH="" content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1 + + # disable bluetooth + service call bluetooth_manager 8 + + # wifi scan + wpa_cli IFNAME=wlan0 SCAN + + # Check for NEOS update + if [ $(< /VERSION) != "$REQUIRED_NEOS_VERSION" ]; then + echo "Installing NEOS update" + NEOS_PY="$DIR/selfdrive/hardware/eon/neos.py" + MANIFEST="$DIR/selfdrive/hardware/eon/neos.json" + $NEOS_PY --swap-if-ready $MANIFEST + $DIR/selfdrive/hardware/eon/updater $NEOS_PY $MANIFEST + fi +} + +function tici_init { + # wait longer for weston to come up + if [ -f "$BASEDIR/prebuilt" ]; then + sleep 3 + fi + + # setup governors + sudo su -c 'echo "performance" > /sys/class/devfreq/soc:qcom,memlat-cpu0/governor' + sudo su -c 'echo "performance" > /sys/class/devfreq/soc:qcom,memlat-cpu4/governor' + + # TODO: move this to agnos + # network manager config + nmcli connection modify --temporary lte gsm.auto-config yes + nmcli connection modify --temporary lte gsm.home-only yes + sudo rm -f /data/etc/NetworkManager/system-connections/*.nmmeta + + # set success flag for current boot slot + sudo abctl --set_success + + # Check if AGNOS update is required + if [ $(< /VERSION) != "$AGNOS_VERSION" ]; then + AGNOS_PY="$DIR/selfdrive/hardware/tici/agnos.py" + MANIFEST="$DIR/selfdrive/hardware/tici/agnos.json" + if $AGNOS_PY --verify $MANIFEST; then + sudo reboot + fi + $DIR/selfdrive/hardware/tici/updater $AGNOS_PY $MANIFEST + fi +} + +function launch { + # Remove orphaned git lock if it exists on boot + [ -f "$DIR/.git/index.lock" ] && rm -f $DIR/.git/index.lock + + # Pull time from panda + $DIR/selfdrive/boardd/set_time.py + + # Check to see if there's a valid overlay-based update available. Conditions + # are as follows: + # + # 1. The BASEDIR init file has to exist, with a newer modtime than anything in + # the BASEDIR Git repo. This checks for local development work or the user + # switching branches/forks, which should not be overwritten. + # 2. The FINALIZED consistent file has to exist, indicating there's an update + # that completed successfully and synced to disk. + + if [ -f "${BASEDIR}/.overlay_init" ]; then + find ${BASEDIR}/.git -newer ${BASEDIR}/.overlay_init | grep -q '.' 2> /dev/null + if [ $? -eq 0 ]; then + echo "${BASEDIR} has been modified, skipping overlay update installation" + else + if [ -f "${STAGING_ROOT}/finalized/.overlay_consistent" ]; then + if [ ! -d /data/safe_staging/old_openpilot ]; then + echo "Valid overlay update found, installing" + LAUNCHER_LOCATION="${BASH_SOURCE[0]}" + + mv $BASEDIR /data/safe_staging/old_openpilot + mv "${STAGING_ROOT}/finalized" $BASEDIR + cd $BASEDIR + + echo "Restarting launch script ${LAUNCHER_LOCATION}" + unset REQUIRED_NEOS_VERSION + unset AGNOS_VERSION + exec "${LAUNCHER_LOCATION}" + else + echo "openpilot backup found, not updating" + # TODO: restore backup? This means the updater didn't start after swapping + fi + fi + fi + fi + + # handle pythonpath + ln -sfn $(pwd) /data/pythonpath + export PYTHONPATH="$PWD:$PWD/pyextra" + + # hardware specific init + if [ -f /EON ]; then + two_init + elif [ -f /TICI ]; then + tici_init + fi + + # write tmux scrollback to a file + tmux capture-pane -pq -S-1000 > /tmp/launch_log + + # start manager + cd selfdrive/manager + ./build.py && ./manager.py + + # if broken, keep on screen error + while true; do sleep 1; done +} + +launch diff --git a/launch_env.sh b/launch_env.sh new file mode 100755 index 000000000..cd0c27f64 --- /dev/null +++ b/launch_env.sh @@ -0,0 +1,21 @@ +#!/usr/bin/bash + +export OMP_NUM_THREADS=1 +export MKL_NUM_THREADS=1 +export NUMEXPR_NUM_THREADS=1 +export OPENBLAS_NUM_THREADS=1 +export VECLIB_MAXIMUM_THREADS=1 + +if [ -z "$REQUIRED_NEOS_VERSION" ]; then + export REQUIRED_NEOS_VERSION="19.1" +fi + +if [ -z "$AGNOS_VERSION" ]; then + export AGNOS_VERSION="4" +fi + +if [ -z "$PASSIVE" ]; then + export PASSIVE="1" +fi + +export STAGING_ROOT="/data/safe_staging" diff --git a/launch_openpilot.sh b/launch_openpilot.sh new file mode 100755 index 000000000..1525e1715 --- /dev/null +++ b/launch_openpilot.sh @@ -0,0 +1,5 @@ +#!/usr/bin/bash + +export PASSIVE="0" +exec ./launch_chffrplus.sh + diff --git a/models/dmonitoring_model_q.dlc b/models/dmonitoring_model_q.dlc new file mode 100644 index 000000000..be61a6c30 Binary files /dev/null and b/models/dmonitoring_model_q.dlc differ diff --git a/models/supercombo.thneed b/models/supercombo.thneed new file mode 100644 index 000000000..1aa214424 Binary files /dev/null and b/models/supercombo.thneed differ diff --git a/opendbc/.gitignore b/opendbc/.gitignore new file mode 100644 index 000000000..bf8570d8b --- /dev/null +++ b/opendbc/.gitignore @@ -0,0 +1,17 @@ +.mypy_cache/ +*.pyc +*.os +*.o +*.tmp +*.dylib +.*.swp +.DS_Store +.sconsign.dblite + +can/*.so +can/build/ +can/obj/ +can/packer_pyx.cpp +can/parser_pyx.cpp +can/packer_pyx.html +can/parser_pyx.html diff --git a/opendbc/__init__.py b/opendbc/__init__.py new file mode 100644 index 000000000..a74a06029 --- /dev/null +++ b/opendbc/__init__.py @@ -0,0 +1,2 @@ +import os +DBC_PATH = os.path.dirname(os.path.abspath(__file__)) diff --git a/opendbc/acura_ilx_2016_can_generated.dbc b/opendbc/acura_ilx_2016_can_generated.dbc new file mode 100644 index 000000000..56770bca2 --- /dev/null +++ b/opendbc/acura_ilx_2016_can_generated.dbc @@ -0,0 +1,328 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + +BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-83.3) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + +VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + + +CM_ "Imported file _honda_common.dbc starts here"; +BO_ 304 GAS_PEDAL_2: 8 PCM + SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 316 GAS_PEDAL: 8 PCM + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 344 ENGINE_DATA: 8 PCM + SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 380 POWERTRAIN_DATA: 8 PCM + SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON + SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON + SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON + SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON + SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON + SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON + SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 420 VSA_STATUS: 8 VSA + SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON + SG_ COMPUTER_BRAKING : 23|1@0+ (1,0) [0|1] "" EON + SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 427 STEER_MOTOR_TORQUE: 3 EPS + SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON + SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON + SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON + +BO_ 464 WHEEL_SPEEDS: 8 VSA + SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 490 VEHICLE_DYNAMICS: 8 VSA + SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 773 SEATBELT_STATUS: 7 BDY + SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 804 CRUISE: 8 PCM + SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON + SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON + SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON + SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON + SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 829 LKAS_HUD: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 884 STALK_STATUS: 8 XXX + SG_ DASHBOARD_ALERT : 39|8@0+ (1,0) [0|255] "" EON + SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON + SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON + SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 891 STALK_STATUS_2: 8 XXX + SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON + SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX + SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 1029 DOORS_STATUS: 8 BDY + SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON + SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 304 "Seems to be platform-agnostic"; +CM_ SG_ 316 "Should exist on Nidec"; +CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged"; +CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping"; +CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light"; +CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light"; +CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed"; +CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; + +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 884 DASHBOARD_ALERT 0 "none" 51 "acc_problem" 55 "cmbs_problem" 75 "key_not_detected" 79 "fasten_seatbelt" 111 "lkas_problem" 131 "brake_system_problem" 132 "brake_hold_problem" 139 "tbd" 161 "door_open"; +VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off"; + + +CM_ "Imported file _honda_2017.dbc starts here"; +BO_ 145 KINEMATICS: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 148 KINEMATICS_ALT: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 24|9@0- (-0.02,0) [-20|20] "m/s2" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +BO_ 432 STANDSTILL: 7 VSA + SG_ CONTROLLED_STANDSTILL : 0|1@0+ (1,0) [0|1] "" EON + SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 487 BRAKE_PRESSURE: 4 VSA + SG_ BRAKE_PRESSURE1 : 7|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ BRAKE_PRESSURE2 : 9|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + +BO_ 506 BRAKE_COMMAND: 8 ADAS + SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00 : 13|5@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_2 : 23|3@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_3 : 19|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_1 : 31|1@0+ (1,0) [0|1] "" EBCM + SG_ AEB_REQ_1 : 29|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_REQ_2 : 26|3@0+ (1,0) [0|7] "" XXX + SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM + SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM + SG_ SET_ME_X00_4 : 44|1@0+ (1,0) [0|1] "" EBCM + SG_ FCW : 43|2@0+ (1,0) [0|3] "" EBCM + SG_ AEB_STATUS : 41|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X00_5 : 55|8@0+ (1,0) [0|0] "" EBCM + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EBCM + +BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA + SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON + SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" EON + SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 777 LOCK_STATUS: 8 XXX + SG_ DOORS_UNLOCKED : 54|1@0+ (1,0) [0|1] "" EON + SG_ DOORS_LOCKED : 55|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 780 ACC_HUD: 8 ADAS + SG_ PCM_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" BDY + SG_ PCM_GAS : 23|8@0+ (1,0) [0|127] "" BDY + SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY + SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY + SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF_2 : 35|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY + SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY + SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY + SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY + SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY + SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY + SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY + SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY + SG_ CHIME : 51|3@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 48|1@0+ (1,0) [0|1] "" BDY + SG_ ICONS : 63|2@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY + +BO_ 892 CRUISE_PARAMS: 8 PCM + SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +CM_ SG_ 506 AEB_REQ_1 "set for duration of suspected AEB event"; +CM_ SG_ 780 CRUISE_SPEED "255 = no speed"; + +VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw"; +VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime"; +VAL_ 506 AEB_STATUS 3 "aeb_prepare" 2 "aeb_ready" 1 "aeb_braking" 0 "no_aeb"; +VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped"; +VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car"; + +CM_ "acura_ilx_2016_can.dbc starts here"; + +BO_ 228 STEERING_CONTROL: 5 ADAS + SG_ STEER_TORQUE : 7|16@0- (1,0) [-3840|3840] "" EPS + SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|0] "" EPS + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS + SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" EPS + +BO_ 342 STEERING_SENSORS: 6 EPS + SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" EON + +BO_ 399 STEER_STATUS: 7 EPS + SG_ STEER_TORQUE_SENSOR : 7|16@0- (-1,0) [-31000|31000] "tbd" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON + SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" EON + SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON + SG_ STEER_CONFIG_INDEX : 43|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 419 GEARBOX: 8 PCM + SG_ GEAR : 7|8@0+ (1,0) [0|256] "" EON + SG_ GEAR_SHIFTER : 35|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 422 SCM_BUTTONS: 8 SCM + SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON + SG_ LIGHTS_SETTING : 1|2@0+ (1,0) [0|3] "" EON + SG_ MAIN_ON : 47|1@0+ (1,0) [0|1] "" EON + SG_ CRUISE_SETTING : 43|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 660 SCM_FEEDBACK: 8 SCM + SG_ RIGHT_BLINKER : 6|1@0+ (1,0) [0|1] "" EON + SG_ LEFT_BLINKER : 5|1@0+ (1,0) [0|1] "" EON + SG_ WIPERS_SPEED : 4|2@0+ (1,0) [0|3] "" EON + +CM_ SG_ 419 GEAR "10 = reverse, 11 = transition"; +CM_ SG_ 780 CRUISE_SPEED "255 = no speed"; + +VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ; +VAL_ 419 GEAR_SHIFTER 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ; +VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ; +VAL_ 422 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights" ; +VAL_ 422 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ; +VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime" ; +VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw" ; +VAL_ 780 HUD_LEAD 3 "no_car" 2 "solid_car" 1 "dashed_car" 0 "no_car" ; diff --git a/opendbc/acura_ilx_2016_nidec.dbc b/opendbc/acura_ilx_2016_nidec.dbc new file mode 100644 index 000000000..e73fcc422 --- /dev/null +++ b/opendbc/acura_ilx_2016_nidec.dbc @@ -0,0 +1,185 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: ADAS RADAR NEO XXX + + +BO_ 768 VEHICLE_STATE: 8 ADAS + SG_ SET_ME_XF9 : 7|8@0+ (1,0) [0|255] "" Vector__XXX + SG_ VEHICLE_SPEED : 15|8@0+ (1,0) [0|255] "kph" Vector__XXX + +BO_ 769 VEHICLE_STATE2: 8 ADAS + SG_ SET_ME_0F18510 : 7|28@0+ (1,0) [0|268435455] "" Vector__XXX + SG_ SET_ME_25A0000 : 27|28@0+ (1,0) [0|268435455] "" Vector__XXX + +BO_ 1024 RADAR_DIAGNOSTIC: 8 RADAR + SG_ RADAR_STATE : 7|8@0+ (1,0) [0|255] "" NEO + +BO_ 1040 XXX_101: 8 RADAR + +BO_ 1041 XXX_102: 8 RADAR + +BO_ 1042 XXX_103: 8 RADAR + +BO_ 1043 XXX_104: 8 RADAR + +BO_ 1044 XXX_105: 8 RADAR + +BO_ 1045 XXX_106: 8 RADAR + +BO_ 1046 XXX_107: 8 RADAR + +BO_ 1047 XXX_108: 8 RADAR + +BO_ 1056 XXX_109: 8 RADAR + +BO_ 1057 XXX_110: 8 RADAR + +BO_ 1058 XXX_111: 8 RADAR + +BO_ 1059 XXX_112: 8 RADAR + +BO_ 1060 XXX_113: 8 RADAR + +BO_ 1072 TRACK_0: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1073 TRACK_1: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1074 TRACK_2: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1075 TRACK_3: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1076 TRACK_4: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1077 TRACK_5: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1078 TRACK_6: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1079 TRACK_7: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1080 TRACK_8: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1081 TRACK_9: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1088 TRACK_10: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1089 TRACK_11: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1090 TRACK_12: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1091 TRACK_13: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1092 TRACK_14: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1093 TRACK_15: 8 RADAR + SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO + SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO + SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO + SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO + +BO_ 1279 XXX_114: 8 RADAR + +BO_ 1280 XXX_115: 8 RADAR + +BO_ 1296 XXX_116: 8 RADAR + +BO_ 1297 XXX_117: 8 RADAR + +BO_TX_BU_ 768 : NEO,ADAS; +BO_TX_BU_ 769 : NEO,ADAS; + + +CM_ SG_ 1024 RADAR_STATE "need to find out more diagnostic values"; +VAL_ 1024 RADAR_STATE 121 "ok" 110 "faulted" 105 "wrong_config"; diff --git a/opendbc/acura_rdx_2018_can_generated.dbc b/opendbc/acura_rdx_2018_can_generated.dbc new file mode 100644 index 000000000..49ae84234 --- /dev/null +++ b/opendbc/acura_rdx_2018_can_generated.dbc @@ -0,0 +1,324 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + +BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-83.3) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + +VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + + +CM_ "Imported file _honda_common.dbc starts here"; +BO_ 304 GAS_PEDAL_2: 8 PCM + SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 316 GAS_PEDAL: 8 PCM + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 344 ENGINE_DATA: 8 PCM + SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 380 POWERTRAIN_DATA: 8 PCM + SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON + SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON + SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON + SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON + SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON + SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON + SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 420 VSA_STATUS: 8 VSA + SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON + SG_ COMPUTER_BRAKING : 23|1@0+ (1,0) [0|1] "" EON + SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 427 STEER_MOTOR_TORQUE: 3 EPS + SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON + SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON + SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON + +BO_ 464 WHEEL_SPEEDS: 8 VSA + SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 490 VEHICLE_DYNAMICS: 8 VSA + SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 773 SEATBELT_STATUS: 7 BDY + SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 804 CRUISE: 8 PCM + SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON + SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON + SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON + SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON + SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 829 LKAS_HUD: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 884 STALK_STATUS: 8 XXX + SG_ DASHBOARD_ALERT : 39|8@0+ (1,0) [0|255] "" EON + SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON + SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON + SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 891 STALK_STATUS_2: 8 XXX + SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON + SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX + SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 1029 DOORS_STATUS: 8 BDY + SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON + SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 304 "Seems to be platform-agnostic"; +CM_ SG_ 316 "Should exist on Nidec"; +CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged"; +CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping"; +CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light"; +CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light"; +CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed"; +CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; + +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 884 DASHBOARD_ALERT 0 "none" 51 "acc_problem" 55 "cmbs_problem" 75 "key_not_detected" 79 "fasten_seatbelt" 111 "lkas_problem" 131 "brake_system_problem" 132 "brake_hold_problem" 139 "tbd" 161 "door_open"; +VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off"; + + +CM_ "Imported file _honda_2017.dbc starts here"; +BO_ 145 KINEMATICS: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 148 KINEMATICS_ALT: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 24|9@0- (-0.02,0) [-20|20] "m/s2" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +BO_ 432 STANDSTILL: 7 VSA + SG_ CONTROLLED_STANDSTILL : 0|1@0+ (1,0) [0|1] "" EON + SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 487 BRAKE_PRESSURE: 4 VSA + SG_ BRAKE_PRESSURE1 : 7|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ BRAKE_PRESSURE2 : 9|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + +BO_ 506 BRAKE_COMMAND: 8 ADAS + SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00 : 13|5@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_2 : 23|3@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_3 : 19|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_1 : 31|1@0+ (1,0) [0|1] "" EBCM + SG_ AEB_REQ_1 : 29|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_REQ_2 : 26|3@0+ (1,0) [0|7] "" XXX + SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM + SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM + SG_ SET_ME_X00_4 : 44|1@0+ (1,0) [0|1] "" EBCM + SG_ FCW : 43|2@0+ (1,0) [0|3] "" EBCM + SG_ AEB_STATUS : 41|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X00_5 : 55|8@0+ (1,0) [0|0] "" EBCM + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EBCM + +BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA + SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON + SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" EON + SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 777 LOCK_STATUS: 8 XXX + SG_ DOORS_UNLOCKED : 54|1@0+ (1,0) [0|1] "" EON + SG_ DOORS_LOCKED : 55|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 780 ACC_HUD: 8 ADAS + SG_ PCM_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" BDY + SG_ PCM_GAS : 23|8@0+ (1,0) [0|127] "" BDY + SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY + SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY + SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF_2 : 35|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY + SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY + SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY + SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY + SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY + SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY + SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY + SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY + SG_ CHIME : 51|3@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 48|1@0+ (1,0) [0|1] "" BDY + SG_ ICONS : 63|2@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY + +BO_ 892 CRUISE_PARAMS: 8 PCM + SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +CM_ SG_ 506 AEB_REQ_1 "set for duration of suspected AEB event"; +CM_ SG_ 780 CRUISE_SPEED "255 = no speed"; + +VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw"; +VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime"; +VAL_ 506 AEB_STATUS 3 "aeb_prepare" 2 "aeb_ready" 1 "aeb_braking" 0 "no_aeb"; +VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped"; +VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car"; + +CM_ "acura_rdx_2018_can.dbc starts here"; + +BO_ 342 STEERING_SENSORS: 6 EPS + SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON + +BO_ 392 GEARBOX: 6 XXX + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" XXX + SG_ GEAR_SHIFTER : 27|4@0+ (1,0) [0|15] "" EON + SG_ GEAR : 36|5@0+ (1,0) [0|31] "" EON + +BO_ 399 STEER_STATUS: 6 EPS + SG_ STEER_TORQUE_SENSOR : 7|12@0- (-1,0) [-2047.5|2047.5] "tbd" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON + SG_ STEER_STATUS : 35|4@0+ (1,0) [0|15] "" EON + SG_ STEER_CONTROL_ACTIVE : 36|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON + +BO_ 404 STEERING_CONTROL: 4 EON + SG_ STEER_TORQUE : 7|12@0- (1,0) [-768|768] "" EPS + SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS + SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS + SG_ COUNTER : 29|2@0+ (1,0) [0|15] "" EPS + SG_ CHECKSUM : 27|4@0+ (1,0) [0|3] "" EPS + +BO_ 422 SCM_BUTTONS: 8 SCM + SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON + SG_ LIGHTS_SETTING : 1|2@0+ (1,0) [0|3] "" EON + SG_ PARKING_BRAKE_LIGHT : 2|1@0+ (1,0) [0|1] "" EON + SG_ MAIN_ON : 47|1@0+ (1,0) [0|1] "" EON + SG_ CRUISE_SETTING : 43|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 660 SCM_FEEDBACK: 8 SCM + SG_ RIGHT_BLINKER : 6|1@0+ (1,0) [0|1] "" EON + SG_ LEFT_BLINKER : 5|1@0+ (1,0) [0|1] "" EON + SG_ WIPERS_SPEED : 4|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 422 PARKING_BRAKE_LIGHT "Believe this is just the dash light for the parking break"; +VAL_ 392 GEAR_SHIFTER 0 "S" 1 "P" 2 "R" 4 "N" 8 "D" ; +VAL_ 392 GEAR 26 "S" 4 "D" 3 "N" 2 "R" 1 "P" ; +VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ; +VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ; diff --git a/opendbc/acura_rdx_2020_can_generated.dbc b/opendbc/acura_rdx_2020_can_generated.dbc new file mode 100644 index 000000000..7d0f2188f --- /dev/null +++ b/opendbc/acura_rdx_2020_can_generated.dbc @@ -0,0 +1,477 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _honda_common.dbc starts here"; +BO_ 304 GAS_PEDAL_2: 8 PCM + SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 316 GAS_PEDAL: 8 PCM + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 344 ENGINE_DATA: 8 PCM + SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 380 POWERTRAIN_DATA: 8 PCM + SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON + SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON + SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON + SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON + SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON + SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON + SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 420 VSA_STATUS: 8 VSA + SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON + SG_ COMPUTER_BRAKING : 23|1@0+ (1,0) [0|1] "" EON + SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 427 STEER_MOTOR_TORQUE: 3 EPS + SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON + SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON + SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON + +BO_ 464 WHEEL_SPEEDS: 8 VSA + SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 490 VEHICLE_DYNAMICS: 8 VSA + SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 773 SEATBELT_STATUS: 7 BDY + SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 804 CRUISE: 8 PCM + SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON + SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON + SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON + SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON + SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 829 LKAS_HUD: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 884 STALK_STATUS: 8 XXX + SG_ DASHBOARD_ALERT : 39|8@0+ (1,0) [0|255] "" EON + SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON + SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON + SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 891 STALK_STATUS_2: 8 XXX + SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON + SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX + SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 1029 DOORS_STATUS: 8 BDY + SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON + SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 304 "Seems to be platform-agnostic"; +CM_ SG_ 316 "Should exist on Nidec"; +CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged"; +CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping"; +CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light"; +CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light"; +CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed"; +CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; + +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 884 DASHBOARD_ALERT 0 "none" 51 "acc_problem" 55 "cmbs_problem" 75 "key_not_detected" 79 "fasten_seatbelt" 111 "lkas_problem" 131 "brake_system_problem" 132 "brake_hold_problem" 139 "tbd" 161 "door_open"; +VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off"; + + +CM_ "Imported file _bosch_2018.dbc starts here"; +BO_ 148 KINEMATICS: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (-0.035,17.92) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 25|10@0+ (-0.035,17.92) [-20|20] "m/s2" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +BO_ 228 STEERING_CONTROL: 5 EON + SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS + SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS + SG_ SET_ME_X00_2 : 31|8@0+ (1,0) [0|0] "" EPS + SG_ STEER_TORQUE : 7|16@0- (1,0) [-4096|4096] "" EPS + SG_ STEER_DOWN_TO_ZERO : 38|1@0+ (1,0) [0|1] "" EPS + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" EPS + +BO_ 229 BOSCH_SUPPLEMENTAL_1: 8 XXX + SG_ SET_ME_X04 : 0|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 8|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X80 : 16|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X10 : 24|8@1+ (1,0) [0|255] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 232 BRAKE_HOLD: 7 XXX + SG_ XMISSION_SPEED : 7|14@0- (1,0) [1|0] "" XXX + SG_ COMPUTER_BRAKE : 39|16@0+ (1,0) [0|0] "" XXX + SG_ COMPUTER_BRAKE_REQUEST : 29|1@0+ (1,0) [0|0] "" XXX + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" XXX + +BO_ 399 STEER_STATUS: 7 EPS + SG_ STEER_TORQUE_SENSOR : 7|16@0- (-1,0) [-31000|31000] "tbd" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON + SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" EON + SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON + SG_ STEER_CONFIG_INDEX : 43|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON + +BO_ 450 EPB_STATUS: 8 EPB + SG_ EPB_ACTIVE : 3|1@0+ (1,0) [0|1] "" EON + SG_ EPB_STATE : 29|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 479 ACC_CONTROL: 8 EON + SG_ SET_TO_0 : 20|5@0+ (1,0) [0|1] "" XXX + SG_ CONTROL_ON : 23|3@0+ (1,0) [0|5] "" XXX + SG_ GAS_COMMAND : 7|16@0- (1,0) [0|0] "" XXX + SG_ ACCEL_COMMAND : 31|11@0- (0.01,0) [0|0] "m/s2" XXX + SG_ BRAKE_LIGHTS : 62|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_REQUEST : 34|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL : 35|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL_RELEASE : 36|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_STATUS : 33|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_BRAKING : 47|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_PREPARE : 43|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 495 ACC_CONTROL_ON: 8 XXX + SG_ SET_TO_75 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_30 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ ZEROS_BOH : 23|8@0+ (1,0) [0|255] "" XXX + SG_ ZEROS_BOH2 : 47|16@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_FF : 15|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_3 : 6|7@0+ (1,0) [0|4095] "" XXX + SG_ CONTROL_ON : 7|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 545 XXX_16: 6 SCM + SG_ ECON_ON : 23|1@0+ (1,0) [0|1] "" XXX + SG_ DRIVE_MODE : 37|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" BDY + +BO_ 576 LEFT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 577 LEFT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 579 RIGHT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 580 RIGHT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 582 ADJACENT_LEFT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 583 ADJACENT_LEFT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 585 ADJACENT_RIGHT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 586 ADJACENT_RIGHT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA + SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON + SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON + SG_ LONG_COUNTER : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 662 SCM_BUTTONS: 4 SCM + SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON + SG_ CRUISE_SETTING : 3|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON + +BO_ 777 CAR_SPEED: 8 PCM + SG_ ROUGH_CAR_SPEED : 23|8@0+ (1,0) [0|255] "mph" XXX + SG_ CAR_SPEED : 7|16@0+ (0.01,0) [0|65535] "kph" XXX + SG_ ROUGH_CAR_SPEED_3 : 39|16@0+ (0.01,0) [0|65535] "kph" XXX + SG_ ROUGH_CAR_SPEED_2 : 31|8@0+ (1,0) [0|255] "mph" XXX + SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ IMPERIAL_UNIT : 63|1@0+ (1,0) [0|1] "" XXX + +BO_ 780 ACC_HUD: 8 ADAS + SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "kph" BDY + SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY + SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY + SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY + SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY + SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY + SG_ ZEROS_BOH : 7|24@0+ (0.002759506,0) [0|100] "m/s" BDY + SG_ FCM_OFF : 35|1@0+ (1,0) [0|1] "" BDY + SG_ SET_TO_1 : 36|1@0+ (1,0) [0|1] "" XXX + SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY + SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY + SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY + SG_ ACC_ON : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BOH_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ SET_TO_X1 : 55|1@0+ (1,0) [0|1] "" XXX + SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 806 SCM_FEEDBACK: 8 SCM + SG_ DRIVERS_DOOR_OPEN : 17|1@0+ (1,0) [0|1] "" XXX + SG_ MAIN_ON : 28|1@0+ (1,0) [0|1] "" EON + SG_ RIGHT_BLINKER : 27|1@0+ (1,0) [0|1] "" EON + SG_ LEFT_BLINKER : 26|1@0+ (1,0) [0|1] "" EON + SG_ CMBS_STATES : 22|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 862 CAMERA_MESSAGES: 8 CAM + SG_ ZEROS_BOH : 7|50@0+ (1,0) [0|127] "" BDY + SG_ AUTO_HIGHBEAMS_ACTIVE : 53|1@0+ (1,0) [0|1] "" XXX + SG_ HIGHBEAMS_ON : 52|1@0+ (1,0) [0|1] "" XXX + SG_ ZEROS_BOH_2 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 13274 LKAS_HUD_A: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 13275 LKAS_HUD_B: 8 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" BDY + +CM_ SG_ 450 EPB_STATE "3: On, 2: Disengaging, 1: Engaging, 0: Off"; +CM_ SG_ 479 CONTROL_ON "Set to 5 when car is being controlled"; +CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event"; +CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event"; +CM_ SG_ 479 AEB_PREPARE "set 1s before AEB"; +CM_ SG_ 576 LINE_DISTANCE_VISIBLE "Length of line visible, undecoded"; +CM_ SG_ 577 LINE_FAR_EDGE_POSITION "Appears to be a measure of line thickness, indicates location of the portion of the line furthest from the car, undecoded"; +CM_ SG_ 577 LINE_PARAMETER "Unclear if this is low quality line curvature rate or if this is something else, but it is correlated with line curvature, undecoded"; +CM_ SG_ 577 LINE_DASHED "1 = line is dashed"; +CM_ SG_ 577 LINE_SOLID "1 = line is solid"; + +VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal"; + +CM_ "acura_rdx_2020_can.dbc starts here"; + +BO_ 342 STEERING_SENSORS: 6 EPS + SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON + +BO_ 419 GEARBOX: 8 PCM + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ GEAR_SHIFTER : 29|6@0+ (1,0) [0|63] "" EON + SG_ GEAR : 7|8@0+ (1,0) [0|255] "" EON + +BO_ 432 STANDSTILL: 7 VSA + SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON + +BO_ 446 BRAKE_MODULE: 3 VSA + SG_ BRAKE_PRESSED : 4|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" XXX + +BO_ 927 RADAR_HUD: 8 RADAR + SG_ ZEROS_BOH : 7|10@0+ (1,0) [0|127] "" BDY + SG_ CMBS_OFF : 12|1@0+ (1,0) [0|1] "" BDY + SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_TO_1 : 13|1@0+ (1,0) [0|1] "" BDY + SG_ ZEROS_BOH2 : 11|4@0+ (1,0) [0|1] "" XXX + SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|1] "" XXX + SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|1] "" BDY + SG_ SET_TO_0 : 22|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|255] "" XXX + SG_ BOH : 40|1@0+ (1,0) [0|1] "" XXX + SG_ BOH_2 : 30|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 1302 ODOMETER: 8 XXX + SG_ ODOMETER : 7|24@0+ (1,0) [0|16777215] "km" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +VAL_ 419 GEAR_SHIFTER 32 "D" 8 "R" 4 "P" ; +VAL_ 545 ECON_ON_2 0 "off" 3 "on" ; +VAL_ 662 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ; +VAL_ 662 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ; +VAL_ 806 CMBS_BUTTON 3 "pressed" 0 "released" ; diff --git a/opendbc/can/SConscript b/opendbc/can/SConscript new file mode 100644 index 000000000..309404734 --- /dev/null +++ b/opendbc/can/SConscript @@ -0,0 +1,25 @@ +Import('env', 'envCython', 'cereal') + +import os +from opendbc.can.process_dbc import process + +dbcs = [] +for x in sorted(os.listdir('../')): + if x.endswith(".dbc"): + def compile_dbc(target, source, env): + process(source[0].path, target[0].path) + in_fn = [os.path.join('../', x), 'dbc_template.cc'] + out_fn = os.path.join('dbc_out', x.replace(".dbc", ".cc")) + dbc = env.Command(out_fn, in_fn, compile_dbc) + dbcs.append(dbc) + +libdbc = env.SharedLibrary('libdbc', ["dbc.cc", "parser.cc", "packer.cc", "common.cc"]+dbcs, LIBS=["capnp", "kj"]) + +# Build packer and parser +lenv = envCython.Clone() +lenv["LINKFLAGS"] += [libdbc[0].get_labspath()] +parser = lenv.Program('parser_pyx.so', 'parser_pyx.pyx') +packer = lenv.Program('packer_pyx.so', 'packer_pyx.pyx') + +lenv.Depends(parser, libdbc) +lenv.Depends(packer, libdbc) diff --git a/opendbc/can/__init__.py b/opendbc/can/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/opendbc/can/can_define.py b/opendbc/can/can_define.py new file mode 100644 index 000000000..ad79432a7 --- /dev/null +++ b/opendbc/can/can_define.py @@ -0,0 +1,2 @@ +from opendbc.can.parser_pyx import CANDefine # pylint: disable=no-name-in-module, import-error +assert CANDefine diff --git a/opendbc/can/common.cc b/opendbc/can/common.cc new file mode 100644 index 000000000..2a089980c --- /dev/null +++ b/opendbc/can/common.cc @@ -0,0 +1,221 @@ +#include "common.h" + +unsigned int honda_checksum(unsigned int address, uint64_t d, int l) { + d >>= ((8-l)*8); // remove padding + d >>= 4; // remove checksum + + int s = 0; + bool extended = address > 0x7FF; // extended can + while (address) { s += (address & 0xF); address >>= 4; } + while (d) { s += (d & 0xF); d >>= 4; } + s = 8-s; + if (extended) s += 3; + s &= 0xF; + + return s; +} + +unsigned int toyota_checksum(unsigned int address, uint64_t d, int l) { + d >>= ((8-l)*8); // remove padding + d >>= 8; // remove checksum + + unsigned int s = l; + while (address) { s += address & 0xFF; address >>= 8; } + while (d) { s += d & 0xFF; d >>= 8; } + + return s & 0xFF; +} + +unsigned int subaru_checksum(unsigned int address, uint64_t d, int l) { + d >>= ((8-l)*8); // remove padding + + unsigned int s = 0; + while (address) { s += address & 0xFF; address >>= 8; } + l -= 1; // checksum is first byte + while (l) { s += d & 0xFF; d >>= 8; l -= 1; } + + return s & 0xFF; +} + +unsigned int chrysler_checksum(unsigned int address, uint64_t d, int l) { + /* This function does not want the checksum byte in the input data. + jeep chrysler canbus checksum from http://illmatics.com/Remote%20Car%20Hacking.pdf */ + uint8_t checksum = 0xFF; + for (int j = 0; j < (l - 1); j++) { + uint8_t shift = 0x80; + uint8_t curr = (d >> 8*j) & 0xFF; + for (int i=0; i<8; i++) { + uint8_t bit_sum = curr & shift; + uint8_t temp_chk = checksum & 0x80U; + if (bit_sum != 0U) { + bit_sum = 0x1C; + if (temp_chk != 0U) { + bit_sum = 1; + } + checksum = checksum << 1; + temp_chk = checksum | 1U; + bit_sum ^= temp_chk; + } else { + if (temp_chk != 0U) { + bit_sum = 0x1D; + } + checksum = checksum << 1; + bit_sum ^= checksum; + } + checksum = bit_sum; + shift = shift >> 1; + } + } + return ~checksum & 0xFF; +} + +// Static lookup table for fast computation of CRC8 poly 0x2F, aka 8H2F/AUTOSAR +uint8_t crc8_lut_8h2f[256]; + +void gen_crc_lookup_table(uint8_t poly, uint8_t crc_lut[]) { + uint8_t crc; + int i, j; + + for (i = 0; i < 256; i++) { + crc = i; + for (j = 0; j < 8; j++) { + if ((crc & 0x80) != 0) + crc = (uint8_t)((crc << 1) ^ poly); + else + crc <<= 1; + } + crc_lut[i] = crc; + } +} + +void init_crc_lookup_tables() { + // At init time, set up static lookup tables for fast CRC computation. + + gen_crc_lookup_table(0x2F, crc8_lut_8h2f); // CRC-8 8H2F/AUTOSAR for Volkswagen +} + +unsigned int volkswagen_crc(unsigned int address, uint64_t d, int l) { + // Volkswagen uses standard CRC8 8H2F/AUTOSAR, but they compute it with + // a magic variable padding byte tacked onto the end of the payload. + // https://www.autosar.org/fileadmin/user_upload/standards/classic/4-3/AUTOSAR_SWS_CRCLibrary.pdf + + uint8_t crc = 0xFF; // Standard init value for CRC8 8H2F/AUTOSAR + + // CRC the payload first, skipping over the first byte where the CRC lives. + for (int i = 1; i < l; i++) { + crc ^= (d >> (i*8)) & 0xFF; + crc = crc8_lut_8h2f[crc]; + } + + // Look up and apply the magic final CRC padding byte, which permutes by CAN + // address, and additionally (for SOME addresses) by the message counter. + uint8_t counter = ((d >> 8) & 0xFF) & 0x0F; + switch(address) { + case 0x86: // LWI_01 Steering Angle + crc ^= (uint8_t[]){0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86}[counter]; + break; + case 0x9F: // LH_EPS_03 Electric Power Steering + crc ^= (uint8_t[]){0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5}[counter]; + break; + case 0xAD: // Getriebe_11 Automatic Gearbox + crc ^= (uint8_t[]){0x3F,0x69,0x39,0xDC,0x94,0xF9,0x14,0x64,0xD8,0x6A,0x34,0xCE,0xA2,0x55,0xB5,0x2C}[counter]; + break; + case 0xFD: // ESP_21 Electronic Stability Program + crc ^= (uint8_t[]){0xB4,0xEF,0xF8,0x49,0x1E,0xE5,0xC2,0xC0,0x97,0x19,0x3C,0xC9,0xF1,0x98,0xD6,0x61}[counter]; + break; + case 0x106: // ESP_05 Electronic Stability Program + crc ^= (uint8_t[]){0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07}[counter]; + break; + case 0x117: // ACC_10 Automatic Cruise Control + crc ^= (uint8_t[]){0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16}[counter]; + break; + case 0x120: // TSK_06 Drivetrain Coordinator + crc ^= (uint8_t[]){0xC4,0xE2,0x4F,0xE4,0xF8,0x2F,0x56,0x81,0x9F,0xE5,0x83,0x44,0x05,0x3F,0x97,0xDF}[counter]; + break; + case 0x121: // Motor_20 Driver Throttle Inputs + crc ^= (uint8_t[]){0xE9,0x65,0xAE,0x6B,0x7B,0x35,0xE5,0x5F,0x4E,0xC7,0x86,0xA2,0xBB,0xDD,0xEB,0xB4}[counter]; + break; + case 0x122: // ACC_06 Automatic Cruise Control + crc ^= (uint8_t[]){0x37,0x7D,0xF3,0xA9,0x18,0x46,0x6D,0x4D,0x3D,0x71,0x92,0x9C,0xE5,0x32,0x10,0xB9}[counter]; + break; + case 0x126: // HCA_01 Heading Control Assist + crc ^= (uint8_t[]){0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA}[counter]; + break; + case 0x12B: // GRA_ACC_01 Steering wheel controls for ACC + crc ^= (uint8_t[]){0x6A,0x38,0xB4,0x27,0x22,0xEF,0xE1,0xBB,0xF8,0x80,0x84,0x49,0xC7,0x9E,0x1E,0x2B}[counter]; + break; + case 0x12E: // ACC_07 Automatic Cruise Control + crc ^= (uint8_t[]){0xF8,0xE5,0x97,0xC9,0xD6,0x07,0x47,0x21,0x66,0xDD,0xCF,0x6F,0xA1,0x94,0x74,0x63}[counter]; + break; + case 0x187: // EV_Gearshift "Gear" selection data for EVs with no gearbox + crc ^= (uint8_t[]){0x7F,0xED,0x17,0xC2,0x7C,0xEB,0x44,0x21,0x01,0xFA,0xDB,0x15,0x4A,0x6B,0x23,0x05}[counter]; + break; + case 0x30C: // ACC_02 Automatic Cruise Control + crc ^= (uint8_t[]){0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F}[counter]; + break; + case 0x30F: // SWA_01 Lane Change Assist (SpurWechselAssistent) + crc ^= (uint8_t[]){0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C}[counter]; + break; + case 0x324: // ACC_04 Automatic Cruise Control + crc ^= (uint8_t[]){0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27}[counter]; + break; + case 0x3C0: // Klemmen_Status_01 ignition and starting status + crc ^= (uint8_t[]){0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3}[counter]; + break; + case 0x65D: // ESP_20 Electronic Stability Program + crc ^= (uint8_t[]){0xAC,0xB3,0xAB,0xEB,0x7A,0xE1,0x3B,0xF7,0x73,0xBA,0x7C,0x9E,0x06,0x5F,0x02,0xD9}[counter]; + break; + default: // As-yet undefined CAN message, CRC check expected to fail + printf("Attempt to CRC check undefined Volkswagen message 0x%02X\n", address); + crc ^= (uint8_t[]){0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}[counter]; + break; + } + crc = crc8_lut_8h2f[crc]; + + return crc ^ 0xFF; // Return after standard final XOR for CRC8 8H2F/AUTOSAR +} + +unsigned int pedal_checksum(uint64_t d, int l) { + uint8_t crc = 0xFF; + uint8_t poly = 0xD5; // standard crc8 + + d >>= ((8-l)*8); // remove padding + d >>= 8; // remove checksum + + int i, j; + for (i = 0; i < l - 1; i++) { + crc ^= (d >> (i*8)) & 0xFF; + for (j = 0; j < 8; j++) { + if ((crc & 0x80) != 0) { + crc = (uint8_t)((crc << 1) ^ poly); + } + else { + crc <<= 1; + } + } + } + return crc; +} + + +uint64_t read_u64_be(const uint8_t* v) { + return (((uint64_t)v[0] << 56) + | ((uint64_t)v[1] << 48) + | ((uint64_t)v[2] << 40) + | ((uint64_t)v[3] << 32) + | ((uint64_t)v[4] << 24) + | ((uint64_t)v[5] << 16) + | ((uint64_t)v[6] << 8) + | (uint64_t)v[7]); +} + +uint64_t read_u64_le(const uint8_t* v) { + return ((uint64_t)v[0] + | ((uint64_t)v[1] << 8) + | ((uint64_t)v[2] << 16) + | ((uint64_t)v[3] << 24) + | ((uint64_t)v[4] << 32) + | ((uint64_t)v[5] << 40) + | ((uint64_t)v[6] << 48) + | ((uint64_t)v[7] << 56)); +} diff --git a/opendbc/can/common.h b/opendbc/can/common.h new file mode 100644 index 000000000..be9089ef0 --- /dev/null +++ b/opendbc/can/common.h @@ -0,0 +1,85 @@ +#pragma once + +#include +#include +#include + +#include "common_dbc.h" +#include +#include + +#ifndef DYNAMIC_CAPNP +#include "cereal/gen/cpp/log.capnp.h" +#endif + +#define MAX_BAD_COUNTER 5 + +// Helper functions +unsigned int honda_checksum(unsigned int address, uint64_t d, int l); +unsigned int toyota_checksum(unsigned int address, uint64_t d, int l); +unsigned int subaru_checksum(unsigned int address, uint64_t d, int l); +unsigned int chrysler_checksum(unsigned int address, uint64_t d, int l); +void init_crc_lookup_tables(); +unsigned int volkswagen_crc(unsigned int address, uint64_t d, int l); +unsigned int pedal_checksum(uint64_t d, int l); +uint64_t read_u64_be(const uint8_t* v); +uint64_t read_u64_le(const uint8_t* v); + +class MessageState { +public: + uint32_t address; + unsigned int size; + + std::vector parse_sigs; + std::vector vals; + std::vector> all_vals; + + uint64_t seen; + uint64_t check_threshold; + + uint8_t counter; + uint8_t counter_fail; + + bool ignore_checksum = false; + bool ignore_counter = false; + + bool parse(uint64_t sec, uint8_t * dat); + bool update_counter_generic(int64_t v, int cnt_size); +}; + +class CANParser { +private: + const int bus; + kj::Array aligned_buf; + + const DBC *dbc = NULL; + std::unordered_map message_states; + +public: + bool can_valid = false; + uint64_t last_sec = 0; + + CANParser(int abus, const std::string& dbc_name, + const std::vector &options, + const std::vector &sigoptions); + CANParser(int abus, const std::string& dbc_name, bool ignore_checksum, bool ignore_counter); + #ifndef DYNAMIC_CAPNP + void update_string(const std::string &data, bool sendcan); + void UpdateCans(uint64_t sec, const capnp::List::Reader& cans); + #endif + void UpdateCans(uint64_t sec, const capnp::DynamicStruct::Reader& cans); + void UpdateValid(uint64_t sec); + std::vector query_latest(); +}; + +class CANPacker { +private: + const DBC *dbc = NULL; + std::map, Signal> signal_lookup; + std::map message_lookup; + +public: + CANPacker(const std::string& dbc_name); + uint64_t pack(uint32_t address, const std::vector &values, int counter); + Msg* lookup_message(uint32_t address); +}; diff --git a/opendbc/can/common.pxd b/opendbc/can/common.pxd new file mode 100644 index 000000000..dd54a0e6a --- /dev/null +++ b/opendbc/can/common.pxd @@ -0,0 +1,83 @@ +# distutils: language = c++ +#cython: language_level=3 + +from libc.stdint cimport uint32_t, uint64_t, uint16_t +from libcpp.vector cimport vector +from libcpp.map cimport map +from libcpp.string cimport string +from libcpp.unordered_set cimport unordered_set +from libcpp cimport bool + + +cdef extern from "common_dbc.h": + ctypedef enum SignalType: + DEFAULT, + HONDA_CHECKSUM, + HONDA_COUNTER, + TOYOTA_CHECKSUM, + PEDAL_CHECKSUM, + PEDAL_COUNTER, + VOLKSWAGEN_CHECKSUM, + VOLKSWAGEN_COUNTER, + SUBARU_CHECKSUM, + CHRYSLER_CHECKSUM + + cdef struct Signal: + const char* name + int b1, b2, bo + bool is_signed + double factor, offset + SignalType type + + cdef struct Msg: + const char* name + uint32_t address + unsigned int size + size_t num_sigs + const Signal *sigs + + cdef struct Val: + const char* name + uint32_t address + const char* def_val + const Signal *sigs + + cdef struct DBC: + const char* name + size_t num_msgs + const Msg *msgs + const Val *vals + size_t num_vals + + cdef struct SignalParseOptions: + uint32_t address + const char* name + + + cdef struct MessageParseOptions: + uint32_t address + int check_frequency + + cdef struct SignalValue: + uint32_t address + const char* name + double value + vector[double] all_values + + cdef struct SignalPackValue: + string name + double value + + +cdef extern from "common.h": + cdef const DBC* dbc_lookup(const string); + + cdef cppclass CANParser: + bool can_valid + CANParser(int, string, vector[MessageParseOptions], vector[SignalParseOptions]) + void update_string(string, bool) + vector[SignalValue] query_latest() + + cdef cppclass CANPacker: + CANPacker(string) + uint64_t pack(uint32_t, vector[SignalPackValue], int counter) diff --git a/opendbc/can/common_dbc.h b/opendbc/can/common_dbc.h new file mode 100644 index 000000000..2464ddea2 --- /dev/null +++ b/opendbc/can/common_dbc.h @@ -0,0 +1,85 @@ +#pragma once + +#include +#include +#include +#include + +#define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0])) + +struct SignalPackValue { + std::string name; + double value; +}; + +struct SignalParseOptions { + uint32_t address; + const char* name; +}; + +struct MessageParseOptions { + uint32_t address; + int check_frequency; +}; + +struct SignalValue { + uint32_t address; + const char* name; + double value; // latest value + std::vector all_values; // all values from this cycle +}; + +enum SignalType { + DEFAULT, + HONDA_CHECKSUM, + HONDA_COUNTER, + TOYOTA_CHECKSUM, + PEDAL_CHECKSUM, + PEDAL_COUNTER, + VOLKSWAGEN_CHECKSUM, + VOLKSWAGEN_COUNTER, + SUBARU_CHECKSUM, + CHRYSLER_CHECKSUM, +}; + +struct Signal { + const char* name; + int b1, b2, bo; + bool is_signed; + double factor, offset; + bool is_little_endian; + SignalType type; +}; + +struct Msg { + const char* name; + uint32_t address; + unsigned int size; + size_t num_sigs; + const Signal *sigs; +}; + +struct Val { + const char* name; + uint32_t address; + const char* def_val; + const Signal *sigs; +}; + +struct DBC { + const char* name; + size_t num_msgs; + const Msg *msgs; + const Val *vals; + size_t num_vals; +}; + +std::vector& get_dbcs(); +const DBC* dbc_lookup(const std::string& dbc_name); + +void dbc_register(const DBC* dbc); + +#define dbc_init(dbc) \ +static void __attribute__((constructor)) do_dbc_init_ ## dbc(void) { \ + dbc_register(&dbc); \ +} diff --git a/opendbc/can/dbc.cc b/opendbc/can/dbc.cc new file mode 100644 index 000000000..5747c7c6b --- /dev/null +++ b/opendbc/can/dbc.cc @@ -0,0 +1,27 @@ +#include + +#include "common_dbc.h" + +std::vector& get_dbcs() { + static std::vector vec; + return vec; +} + +const DBC* dbc_lookup(const std::string& dbc_name) { + for (const auto& dbci : get_dbcs()) { + if (dbc_name == dbci->name) { + return dbci; + } + } + return NULL; +} + +void dbc_register(const DBC* dbc) { + get_dbcs().push_back(dbc); +} + +extern "C" { + const DBC* dbc_lookup(const char* dbc_name) { + return dbc_lookup(std::string(dbc_name)); + } +} diff --git a/opendbc/can/dbc.py b/opendbc/can/dbc.py new file mode 100755 index 000000000..043a674a3 --- /dev/null +++ b/opendbc/can/dbc.py @@ -0,0 +1,257 @@ +#!/usr/bin/env python3 +import re +import os +import struct +import sys +import numbers +from collections import namedtuple, defaultdict + +def int_or_float(s): + # return number, trying to maintain int format + if s.isdigit(): + return int(s, 10) + else: + return float(s) + + +DBCSignal = namedtuple( + "DBCSignal", ["name", "start_bit", "size", "is_little_endian", "is_signed", + "factor", "offset", "tmin", "tmax", "units"]) + + +class dbc(): + def __init__(self, fn): + self.name, _ = os.path.splitext(os.path.basename(fn)) + with open(fn, encoding="ascii") as f: + self.txt = f.readlines() + self._warned_addresses = set() + + # regexps from https://github.com/ebroecker/canmatrix/blob/master/canmatrix/importdbc.py + bo_regexp = re.compile(r"^BO\_ (\w+) (\w+) *: (\w+) (\w+)") + sg_regexp = re.compile(r"^SG\_ (\w+) : (\d+)\|(\d+)@(\d+)([\+|\-]) \(([0-9.+\-eE]+),([0-9.+\-eE]+)\) \[([0-9.+\-eE]+)\|([0-9.+\-eE]+)\] \"(.*)\" (.*)") + sgm_regexp = re.compile(r"^SG\_ (\w+) (\w+) *: (\d+)\|(\d+)@(\d+)([\+|\-]) \(([0-9.+\-eE]+),([0-9.+\-eE]+)\) \[([0-9.+\-eE]+)\|([0-9.+\-eE]+)\] \"(.*)\" (.*)") + val_regexp = re.compile(r"VAL\_ (\w+) (\w+) (\s*[-+]?[0-9]+\s+\".+?\"[^;]*)") + + # A dictionary which maps message ids to tuples ((name, size), signals). + # name is the ASCII name of the message. + # size is the size of the message in bytes. + # signals is a list signals contained in the message. + # signals is a list of DBCSignal in order of increasing start_bit. + self.msgs = {} + + # A dictionary which maps message ids to a list of tuples (signal name, definition value pairs) + self.def_vals = defaultdict(list) + + # lookup to bit reverse each byte + self.bits_index = [(i & ~0b111) + ((-i - 1) & 0b111) for i in range(64)] + + for l in self.txt: + l = l.strip() + + if l.startswith("BO_ "): + # new group + dat = bo_regexp.match(l) + + if dat is None: + print("bad BO {0}".format(l)) + + name = dat.group(2) + size = int(dat.group(3)) + ids = int(dat.group(1), 0) # could be hex + if ids in self.msgs: + sys.exit("Duplicate address detected %d %s" % (ids, self.name)) + + self.msgs[ids] = ((name, size), []) + + if l.startswith("SG_ "): + # new signal + dat = sg_regexp.match(l) + go = 0 + if dat is None: + dat = sgm_regexp.match(l) + go = 1 + + if dat is None: + print("bad SG {0}".format(l)) + + sgname = dat.group(1) + start_bit = int(dat.group(go + 2)) + signal_size = int(dat.group(go + 3)) + is_little_endian = int(dat.group(go + 4)) == 1 + is_signed = dat.group(go + 5) == '-' + factor = int_or_float(dat.group(go + 6)) + offset = int_or_float(dat.group(go + 7)) + tmin = int_or_float(dat.group(go + 8)) + tmax = int_or_float(dat.group(go + 9)) + units = dat.group(go + 10) + + self.msgs[ids][1].append( + DBCSignal(sgname, start_bit, signal_size, is_little_endian, + is_signed, factor, offset, tmin, tmax, units)) + + if l.startswith("VAL_ "): + # new signal value/definition + dat = val_regexp.match(l) + + if dat is None: + print("bad VAL {0}".format(l)) + + ids = int(dat.group(1), 0) # could be hex + sgname = dat.group(2) + defvals = dat.group(3) + + defvals = defvals.replace("?", r"\?") # escape sequence in C++ + defvals = defvals.split('"')[:-1] + + # convert strings to UPPER_CASE_WITH_UNDERSCORES + defvals[1::2] = [d.strip().upper().replace(" ", "_") for d in defvals[1::2]] + defvals = '"' + "".join(str(i) for i in defvals) + '"' + + self.def_vals[ids].append((sgname, defvals)) + + for msg in self.msgs.values(): + msg[1].sort(key=lambda x: x.start_bit) + + self.msg_name_to_address = {} + for address, m in self.msgs.items(): + name = m[0][0] + self.msg_name_to_address[name] = address + + def lookup_msg_id(self, msg_id): + if not isinstance(msg_id, numbers.Number): + msg_id = self.msg_name_to_address[msg_id] + return msg_id + + def reverse_bytes(self, x): + return ((x & 0xff00000000000000) >> 56) | \ + ((x & 0x00ff000000000000) >> 40) | \ + ((x & 0x0000ff0000000000) >> 24) | \ + ((x & 0x000000ff00000000) >> 8) | \ + ((x & 0x00000000ff000000) << 8) | \ + ((x & 0x0000000000ff0000) << 24) | \ + ((x & 0x000000000000ff00) << 40) | \ + ((x & 0x00000000000000ff) << 56) + + def encode(self, msg_id, dd): + """Encode a CAN message using the dbc. + + Inputs: + msg_id: The message ID. + dd: A dictionary mapping signal name to signal data. + """ + msg_id = self.lookup_msg_id(msg_id) + + msg_def = self.msgs[msg_id] + size = msg_def[0][1] + + result = 0 + for s in msg_def[1]: + ival = dd.get(s.name) + if ival is not None: + + ival = (ival - s.offset) / s.factor + ival = int(round(ival)) + + if s.is_signed and ival < 0: + ival = (1 << s.size) + ival + + if s.is_little_endian: + shift = s.start_bit + else: + b1 = (s.start_bit // 8) * 8 + (-s.start_bit - 1) % 8 + shift = 64 - (b1 + s.size) + + mask = ((1 << s.size) - 1) << shift + dat = (ival & ((1 << s.size) - 1)) << shift + + if s.is_little_endian: + mask = self.reverse_bytes(mask) + dat = self.reverse_bytes(dat) + + result &= ~mask + result |= dat + + result = struct.pack('>Q', result) + return result[:size] + + def decode(self, x, arr=None, debug=False): + """Decode a CAN message using the dbc. + + Inputs: + x: A collection with elements (address, time, data), where address is + the CAN address, time is the bus time, and data is the CAN data as a + hex string. + arr: Optional list of signals which should be decoded and returned. + debug: True to print debugging statements. + + Returns: + A tuple (name, data), where name is the name of the CAN message and data + is the decoded result. If arr is None, data is a dict of properties. + Otherwise data is a list of the same length as arr. + + Returns (None, None) if the message could not be decoded. + """ + + if arr is None: + out = {} + else: + out = [None] * len(arr) + + msg = self.msgs.get(x[0]) + if msg is None: + if x[0] not in self._warned_addresses: + # print("WARNING: Unknown message address {}".format(x[0])) + self._warned_addresses.add(x[0]) + return None, None + + name = msg[0][0] + if debug: + print(name) + + st = x[2].ljust(8, b'\x00') + le, be = None, None + + for s in msg[1]: + if arr is not None and s[0] not in arr: + continue + + start_bit = s[1] + signal_size = s[2] + little_endian = s[3] + signed = s[4] + factor = s[5] + offset = s[6] + + if little_endian: + if le is None: + le = struct.unpack("Q", st)[0] + tmp = be + b1 = (start_bit // 8) * 8 + (-start_bit - 1) % 8 + shift_amount = 64 - (b1 + signal_size) + + if shift_amount < 0: + continue + + tmp = (tmp >> shift_amount) & ((1 << signal_size) - 1) + if signed and (tmp >> (signal_size - 1)): + tmp -= (1 << signal_size) + + tmp = tmp * factor + offset + + # if debug: + # print("%40s %2d %2d %7.2f %s" % (s[0], s[1], s[2], tmp, s[-1])) + + if arr is None: + out[s[0]] = tmp + else: + out[arr.index(s[0])] = tmp + return name, out + + def get_signals(self, msg): + msg = self.lookup_msg_id(msg) + return [sgs.name for sgs in self.msgs[msg][1]] diff --git a/opendbc/can/dbc_out/.gitignore b/opendbc/can/dbc_out/.gitignore new file mode 100644 index 000000000..4625581a8 --- /dev/null +++ b/opendbc/can/dbc_out/.gitignore @@ -0,0 +1,2 @@ +*.cc + diff --git a/opendbc/can/dbc_out/.gitkeep b/opendbc/can/dbc_out/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/opendbc/can/dbc_out/acura_ilx_2016_can_generated.cc b/opendbc/can/dbc_out/acura_ilx_2016_can_generated.cc new file mode 100644 index 000000000..bc6499403 --- /dev/null +++ b/opendbc/can/dbc_out/acura_ilx_2016_can_generated.cc @@ -0,0 +1,2822 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_145[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_148[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 31, + .b2 = 9, + .bo = 24, + .is_signed = true, + .factor = -0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_228[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_REQUEST", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ENGINE_TORQUE_ESTIMATE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_TORQUE_REQUEST", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_316[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_342[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_344[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "XMISSION_SPEED2", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_380[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PEDAL_GAS", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_SWITCH", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_17C", + .b1 = 34, + .b2 = 5, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_STATUS", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PRESSED", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2_17C", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3_17C", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE_SENSOR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONTROL_ACTIVE", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_STATUS", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONFIG_INDEX", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_419[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GEAR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR_SHIFTER", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_420[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "USER_BRAKE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.015625, + .offset = -1.609375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKING", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_DISABLED", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_RELATED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_422[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LIGHTS_SETTING", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_BUTTONS", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SETTING", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_427[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "MOTOR_TORQUE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONFIG_VALID", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OUTPUT_DISABLED", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_432[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CONTROLLED_STANDSTILL", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_2", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_1", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEELS_MOVING", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_464[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 15, + .b2 = 15, + .bo = 34, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 30, + .b2 = 15, + .bo = 19, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 45, + .b2 = 15, + .bo = 4, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_487[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_PRESSURE1", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSURE2", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_490[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_506[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "COMPUTER_BRAKE", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PUMP_REQUEST", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 10, + .b2 = 5, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE_REQUEST", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CANCEL_CMD", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_FAULT_CMD", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_3", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_OVERRIDE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_2", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_1", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATES", + .b1 = 33, + .b2 = 7, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_STATUS", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCW", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_4", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_5", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_597[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_660[] = { + { + .name = "WIPERS_SPEED", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_773[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SEATBELT_DRIVER_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_UNLATCHED", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_LATCHED", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_OFF", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOORS_UNLOCKED", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOORS_LOCKED", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_780[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PCM_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCM_GAS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE_MINI_CAR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_OBSTRUCTED", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_PROBLEM", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF_2", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_PROBLEM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC_MODE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_LABEL", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_5", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_4", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_3", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_LEAD", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 52, + .b2 = 3, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE_3", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01_2", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ICONS", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_804[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "HUD_SPEED_KPH", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_SPEED_MPH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_FUEL_CONSUMED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED_PCM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_829[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X48", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DASHBOARD_ALERT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_FLASH", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HEADLIGHTS", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_HOLD", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_SWITCH", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HEADLIGHTS_ON", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_891[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAMS", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAMS", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_LIGHTS", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_892[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SPEED_OFFSET", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1029[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRUNK_OPEN", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "KINEMATICS", + .address = 0x91, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_145), + .sigs = sigs_145, + }, + { + .name = "KINEMATICS_ALT", + .address = 0x94, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_148), + .sigs = sigs_148, + }, + { + .name = "STEERING_CONTROL", + .address = 0xE4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_228), + .sigs = sigs_228, + }, + { + .name = "GAS_PEDAL_2", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "GAS_PEDAL", + .address = 0x13C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_316), + .sigs = sigs_316, + }, + { + .name = "STEERING_SENSORS", + .address = 0x156, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_342), + .sigs = sigs_342, + }, + { + .name = "ENGINE_DATA", + .address = 0x158, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_344), + .sigs = sigs_344, + }, + { + .name = "POWERTRAIN_DATA", + .address = 0x17C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_380), + .sigs = sigs_380, + }, + { + .name = "STEER_STATUS", + .address = 0x18F, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "GEARBOX", + .address = 0x1A3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_419), + .sigs = sigs_419, + }, + { + .name = "VSA_STATUS", + .address = 0x1A4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_420), + .sigs = sigs_420, + }, + { + .name = "SCM_BUTTONS", + .address = 0x1A6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_422), + .sigs = sigs_422, + }, + { + .name = "STEER_MOTOR_TORQUE", + .address = 0x1AB, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_427), + .sigs = sigs_427, + }, + { + .name = "STANDSTILL", + .address = 0x1B0, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_432), + .sigs = sigs_432, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x1D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_464), + .sigs = sigs_464, + }, + { + .name = "BRAKE_PRESSURE", + .address = 0x1E7, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_487), + .sigs = sigs_487, + }, + { + .name = "VEHICLE_DYNAMICS", + .address = 0x1EA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_490), + .sigs = sigs_490, + }, + { + .name = "BRAKE_COMMAND", + .address = 0x1FA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_506), + .sigs = sigs_506, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "ROUGH_WHEEL_SPEED", + .address = 0x255, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_597), + .sigs = sigs_597, + }, + { + .name = "SCM_FEEDBACK", + .address = 0x294, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_660), + .sigs = sigs_660, + }, + { + .name = "SEATBELT_STATUS", + .address = 0x305, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_773), + .sigs = sigs_773, + }, + { + .name = "LOCK_STATUS", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "ACC_HUD", + .address = 0x30C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_780), + .sigs = sigs_780, + }, + { + .name = "CRUISE", + .address = 0x324, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_804), + .sigs = sigs_804, + }, + { + .name = "LKAS_HUD", + .address = 0x33D, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_829), + .sigs = sigs_829, + }, + { + .name = "STALK_STATUS", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "STALK_STATUS_2", + .address = 0x37B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_891), + .sigs = sigs_891, + }, + { + .name = "CRUISE_PARAMS", + .address = 0x37C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_892), + .sigs = sigs_892, + }, + { + .name = "DOORS_STATUS", + .address = 0x405, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1029), + .sigs = sigs_1029, + }, +}; + +const Val vals[] = { + { + .name = "STEER_STATUS", + .address = 0x18F, + .def_val = "6 TMP_FAULT 5 FAULT_1 4 NO_TORQUE_ALERT_2 3 LOW_SPEED_LOCKOUT 2 NO_TORQUE_ALERT_1 0 NORMAL", + .sigs = sigs_399, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x1A3, + .def_val = "10 S 4 D 3 N 2 R 1 P", + .sigs = sigs_419, + }, + { + .name = "CRUISE_BUTTONS", + .address = 0x1A6, + .def_val = "7 TBD 6 TBD 5 TBD 4 ACCEL_RES 3 DECEL_SET 2 CANCEL 1 MAIN 0 NONE", + .sigs = sigs_422, + }, + { + .name = "CRUISE_SETTING", + .address = 0x1A6, + .def_val = "3 DISTANCE_ADJ 2 TBD 1 LKAS_BUTTON 0 NONE", + .sigs = sigs_422, + }, + { + .name = "LIGHTS_SETTING", + .address = 0x1A6, + .def_val = "3 HIGH_BEAM 2 LOW_BEAM 1 POSITION 0 NO_LIGHTS", + .sigs = sigs_422, + }, + { + .name = "AEB_STATUS", + .address = 0x1FA, + .def_val = "3 AEB_PREPARE 2 AEB_READY 1 AEB_BRAKING 0 NO_AEB", + .sigs = sigs_506, + }, + { + .name = "CHIME", + .address = 0x1FA, + .def_val = "4 DOUBLE_CHIME 3 SINGLE_CHIME 2 CONTINUOUS_CHIME 1 REPEATING_CHIME 0 NO_CHIME", + .sigs = sigs_506, + }, + { + .name = "FCW", + .address = 0x1FA, + .def_val = "3 FCW 2 FCW 1 FCW 0 NO_FCW", + .sigs = sigs_506, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "CRUISE_SPEED", + .address = 0x30C, + .def_val = "255 NO_SPEED 252 STOPPED", + .sigs = sigs_780, + }, + { + .name = "HUD_LEAD", + .address = 0x30C, + .def_val = "3 ACC_OFF 2 SOLID_CAR 1 DASHED_CAR 0 NO_CAR", + .sigs = sigs_780, + }, + { + .name = "HUD_LEAD", + .address = 0x30C, + .def_val = "3 NO_CAR 2 SOLID_CAR 1 DASHED_CAR 0 NO_CAR", + .sigs = sigs_780, + }, + { + .name = "BEEP", + .address = 0x33D, + .def_val = "3 SINGLE_BEEP 2 TRIPLE_BEEP 1 REPEATED_BEEP 0 NO_BEEP", + .sigs = sigs_829, + }, + { + .name = "DASHBOARD_ALERT", + .address = 0x374, + .def_val = "0 NONE 51 ACC_PROBLEM 55 CMBS_PROBLEM 75 KEY_NOT_DETECTED 79 FASTEN_SEATBELT 111 LKAS_PROBLEM 131 BRAKE_SYSTEM_PROBLEM 132 BRAKE_HOLD_PROBLEM 139 TBD 161 DOOR_OPEN", + .sigs = sigs_884, + }, + { + .name = "WIPERS", + .address = 0x37B, + .def_val = "4 HIGH 2 LOW 0 OFF", + .sigs = sigs_891, + }, +}; + +} + +const DBC acura_ilx_2016_can_generated = { + .name = "acura_ilx_2016_can_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(acura_ilx_2016_can_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/acura_ilx_2016_nidec.cc b/opendbc/can/dbc_out/acura_ilx_2016_nidec.cc new file mode 100644 index 000000000..7a4ca13f3 --- /dev/null +++ b/opendbc/can/dbc_out/acura_ilx_2016_nidec.cc @@ -0,0 +1,958 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_768[] = { + { + .name = "SET_ME_XF9", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VEHICLE_SPEED", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_769[] = { + { + .name = "SET_ME_0F18510", + .b1 = 0, + .b2 = 28, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_25A0000", + .b1 = 28, + .b2 = 28, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1024[] = { + { + .name = "RADAR_STATE", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1072[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1073[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1074[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1075[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1076[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1077[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1078[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1079[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1080[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1081[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1088[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1089[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1090[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1091[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1092[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1093[] = { + { + .name = "LONG_DIST", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = true, + .factor = 0.03125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "VEHICLE_STATE", + .address = 0x300, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_768), + .sigs = sigs_768, + }, + { + .name = "VEHICLE_STATE2", + .address = 0x301, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_769), + .sigs = sigs_769, + }, + { + .name = "RADAR_DIAGNOSTIC", + .address = 0x400, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1024), + .sigs = sigs_1024, + }, + { + .name = "TRACK_0", + .address = 0x430, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1072), + .sigs = sigs_1072, + }, + { + .name = "TRACK_1", + .address = 0x431, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1073), + .sigs = sigs_1073, + }, + { + .name = "TRACK_2", + .address = 0x432, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1074), + .sigs = sigs_1074, + }, + { + .name = "TRACK_3", + .address = 0x433, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1075), + .sigs = sigs_1075, + }, + { + .name = "TRACK_4", + .address = 0x434, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1076), + .sigs = sigs_1076, + }, + { + .name = "TRACK_5", + .address = 0x435, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1077), + .sigs = sigs_1077, + }, + { + .name = "TRACK_6", + .address = 0x436, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1078), + .sigs = sigs_1078, + }, + { + .name = "TRACK_7", + .address = 0x437, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1079), + .sigs = sigs_1079, + }, + { + .name = "TRACK_8", + .address = 0x438, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1080), + .sigs = sigs_1080, + }, + { + .name = "TRACK_9", + .address = 0x439, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1081), + .sigs = sigs_1081, + }, + { + .name = "TRACK_10", + .address = 0x440, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1088), + .sigs = sigs_1088, + }, + { + .name = "TRACK_11", + .address = 0x441, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1089), + .sigs = sigs_1089, + }, + { + .name = "TRACK_12", + .address = 0x442, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1090), + .sigs = sigs_1090, + }, + { + .name = "TRACK_13", + .address = 0x443, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1091), + .sigs = sigs_1091, + }, + { + .name = "TRACK_14", + .address = 0x444, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1092), + .sigs = sigs_1092, + }, + { + .name = "TRACK_15", + .address = 0x445, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1093), + .sigs = sigs_1093, + }, +}; + +const Val vals[] = { + { + .name = "RADAR_STATE", + .address = 0x400, + .def_val = "121 OK 110 FAULTED 105 WRONG_CONFIG", + .sigs = sigs_1024, + }, +}; + +} + +const DBC acura_ilx_2016_nidec = { + .name = "acura_ilx_2016_nidec", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(acura_ilx_2016_nidec) \ No newline at end of file diff --git a/opendbc/can/dbc_out/acura_rdx_2018_can_generated.cc b/opendbc/can/dbc_out/acura_rdx_2018_can_generated.cc new file mode 100644 index 000000000..90c77ed41 --- /dev/null +++ b/opendbc/can/dbc_out/acura_rdx_2018_can_generated.cc @@ -0,0 +1,2832 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_145[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_148[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 31, + .b2 = 9, + .bo = 24, + .is_signed = true, + .factor = -0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ENGINE_TORQUE_ESTIMATE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_TORQUE_REQUEST", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_316[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_342[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_344[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "XMISSION_SPEED2", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_380[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PEDAL_GAS", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_SWITCH", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_17C", + .b1 = 34, + .b2 = 5, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_STATUS", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PRESSED", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2_17C", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3_17C", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_392[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GEAR_SHIFTER", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE_SENSOR", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_STATUS", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONTROL_ACTIVE", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_404[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_REQUEST", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_420[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "USER_BRAKE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.015625, + .offset = -1.609375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKING", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_DISABLED", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_RELATED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_422[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LIGHTS_SETTING", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARKING_BRAKE_LIGHT", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_BUTTONS", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SETTING", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_427[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "MOTOR_TORQUE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONFIG_VALID", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OUTPUT_DISABLED", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_432[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CONTROLLED_STANDSTILL", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_2", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_1", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEELS_MOVING", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_464[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 15, + .b2 = 15, + .bo = 34, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 30, + .b2 = 15, + .bo = 19, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 45, + .b2 = 15, + .bo = 4, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_487[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_PRESSURE1", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSURE2", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_490[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_506[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "COMPUTER_BRAKE", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PUMP_REQUEST", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 10, + .b2 = 5, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE_REQUEST", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CANCEL_CMD", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_FAULT_CMD", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_3", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_OVERRIDE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_2", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_1", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATES", + .b1 = 33, + .b2 = 7, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_STATUS", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCW", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_4", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_5", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_597[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_660[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS_SPEED", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_773[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SEATBELT_DRIVER_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_UNLATCHED", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_LATCHED", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_OFF", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOORS_UNLOCKED", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOORS_LOCKED", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_780[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PCM_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCM_GAS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE_MINI_CAR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_OBSTRUCTED", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_PROBLEM", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF_2", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_PROBLEM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC_MODE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_LABEL", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_5", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_4", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_3", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_LEAD", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 52, + .b2 = 3, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE_3", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01_2", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ICONS", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_804[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "HUD_SPEED_KPH", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_SPEED_MPH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_FUEL_CONSUMED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED_PCM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_829[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X48", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DASHBOARD_ALERT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_FLASH", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HEADLIGHTS", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_HOLD", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_SWITCH", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HEADLIGHTS_ON", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_891[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAMS", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAMS", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_LIGHTS", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_892[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SPEED_OFFSET", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1029[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRUNK_OPEN", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "KINEMATICS", + .address = 0x91, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_145), + .sigs = sigs_145, + }, + { + .name = "KINEMATICS_ALT", + .address = 0x94, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_148), + .sigs = sigs_148, + }, + { + .name = "GAS_PEDAL_2", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "GAS_PEDAL", + .address = 0x13C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_316), + .sigs = sigs_316, + }, + { + .name = "STEERING_SENSORS", + .address = 0x156, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_342), + .sigs = sigs_342, + }, + { + .name = "ENGINE_DATA", + .address = 0x158, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_344), + .sigs = sigs_344, + }, + { + .name = "POWERTRAIN_DATA", + .address = 0x17C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_380), + .sigs = sigs_380, + }, + { + .name = "GEARBOX", + .address = 0x188, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_392), + .sigs = sigs_392, + }, + { + .name = "STEER_STATUS", + .address = 0x18F, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "STEERING_CONTROL", + .address = 0x194, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_404), + .sigs = sigs_404, + }, + { + .name = "VSA_STATUS", + .address = 0x1A4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_420), + .sigs = sigs_420, + }, + { + .name = "SCM_BUTTONS", + .address = 0x1A6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_422), + .sigs = sigs_422, + }, + { + .name = "STEER_MOTOR_TORQUE", + .address = 0x1AB, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_427), + .sigs = sigs_427, + }, + { + .name = "STANDSTILL", + .address = 0x1B0, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_432), + .sigs = sigs_432, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x1D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_464), + .sigs = sigs_464, + }, + { + .name = "BRAKE_PRESSURE", + .address = 0x1E7, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_487), + .sigs = sigs_487, + }, + { + .name = "VEHICLE_DYNAMICS", + .address = 0x1EA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_490), + .sigs = sigs_490, + }, + { + .name = "BRAKE_COMMAND", + .address = 0x1FA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_506), + .sigs = sigs_506, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "ROUGH_WHEEL_SPEED", + .address = 0x255, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_597), + .sigs = sigs_597, + }, + { + .name = "SCM_FEEDBACK", + .address = 0x294, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_660), + .sigs = sigs_660, + }, + { + .name = "SEATBELT_STATUS", + .address = 0x305, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_773), + .sigs = sigs_773, + }, + { + .name = "LOCK_STATUS", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "ACC_HUD", + .address = 0x30C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_780), + .sigs = sigs_780, + }, + { + .name = "CRUISE", + .address = 0x324, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_804), + .sigs = sigs_804, + }, + { + .name = "LKAS_HUD", + .address = 0x33D, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_829), + .sigs = sigs_829, + }, + { + .name = "STALK_STATUS", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "STALK_STATUS_2", + .address = 0x37B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_891), + .sigs = sigs_891, + }, + { + .name = "CRUISE_PARAMS", + .address = 0x37C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_892), + .sigs = sigs_892, + }, + { + .name = "DOORS_STATUS", + .address = 0x405, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1029), + .sigs = sigs_1029, + }, +}; + +const Val vals[] = { + { + .name = "GEAR", + .address = 0x188, + .def_val = "26 S 4 D 3 N 2 R 1 P", + .sigs = sigs_392, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x188, + .def_val = "0 S 1 P 2 R 4 N 8 D", + .sigs = sigs_392, + }, + { + .name = "STEER_STATUS", + .address = 0x18F, + .def_val = "6 TMP_FAULT 5 FAULT_1 4 NO_TORQUE_ALERT_2 3 LOW_SPEED_LOCKOUT 2 NO_TORQUE_ALERT_1 0 NORMAL", + .sigs = sigs_399, + }, + { + .name = "CRUISE_BUTTONS", + .address = 0x1A6, + .def_val = "7 TBD 6 TBD 5 TBD 4 ACCEL_RES 3 DECEL_SET 2 CANCEL 1 MAIN 0 NONE", + .sigs = sigs_422, + }, + { + .name = "AEB_STATUS", + .address = 0x1FA, + .def_val = "3 AEB_PREPARE 2 AEB_READY 1 AEB_BRAKING 0 NO_AEB", + .sigs = sigs_506, + }, + { + .name = "CHIME", + .address = 0x1FA, + .def_val = "4 DOUBLE_CHIME 3 SINGLE_CHIME 2 CONTINUOUS_CHIME 1 REPEATING_CHIME 0 NO_CHIME", + .sigs = sigs_506, + }, + { + .name = "FCW", + .address = 0x1FA, + .def_val = "3 FCW 2 FCW 1 FCW 0 NO_FCW", + .sigs = sigs_506, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "CRUISE_SPEED", + .address = 0x30C, + .def_val = "255 NO_SPEED 252 STOPPED", + .sigs = sigs_780, + }, + { + .name = "HUD_LEAD", + .address = 0x30C, + .def_val = "3 ACC_OFF 2 SOLID_CAR 1 DASHED_CAR 0 NO_CAR", + .sigs = sigs_780, + }, + { + .name = "BEEP", + .address = 0x33D, + .def_val = "3 SINGLE_BEEP 2 TRIPLE_BEEP 1 REPEATED_BEEP 0 NO_BEEP", + .sigs = sigs_829, + }, + { + .name = "DASHBOARD_ALERT", + .address = 0x374, + .def_val = "0 NONE 51 ACC_PROBLEM 55 CMBS_PROBLEM 75 KEY_NOT_DETECTED 79 FASTEN_SEATBELT 111 LKAS_PROBLEM 131 BRAKE_SYSTEM_PROBLEM 132 BRAKE_HOLD_PROBLEM 139 TBD 161 DOOR_OPEN", + .sigs = sigs_884, + }, + { + .name = "WIPERS", + .address = 0x37B, + .def_val = "4 HIGH 2 LOW 0 OFF", + .sigs = sigs_891, + }, +}; + +} + +const DBC acura_rdx_2018_can_generated = { + .name = "acura_rdx_2018_can_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(acura_rdx_2018_can_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/acura_rdx_2020_can_generated.cc b/opendbc/can/dbc_out/acura_rdx_2020_can_generated.cc new file mode 100644 index 000000000..31a87f093 --- /dev/null +++ b/opendbc/can/dbc_out/acura_rdx_2020_can_generated.cc @@ -0,0 +1,4309 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_148[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = -0.035, + .offset = 17.92, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 30, + .b2 = 10, + .bo = 24, + .is_signed = false, + .factor = -0.035, + .offset = 17.92, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_228[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_REQUEST", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_DOWN_TO_ZERO", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_229[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X04", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X80", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_232[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 14, + .bo = 50, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE_REQUEST", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ENGINE_TORQUE_ESTIMATE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_TORQUE_REQUEST", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_316[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_342[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_344[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "XMISSION_SPEED2", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_380[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PEDAL_GAS", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_SWITCH", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_17C", + .b1 = 34, + .b2 = 5, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_STATUS", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PRESSED", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2_17C", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3_17C", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE_SENSOR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONTROL_ACTIVE", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_STATUS", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONFIG_INDEX", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_419[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GEAR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR_SHIFTER", + .b1 = 26, + .b2 = 6, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_420[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "USER_BRAKE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.015625, + .offset = -1.609375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKING", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_DISABLED", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_RELATED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_427[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "MOTOR_TORQUE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONFIG_VALID", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OUTPUT_DISABLED", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_432[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_ERROR_2", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_1", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_446[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_450[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "EPB_ACTIVE", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_STATE", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_464[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 15, + .b2 = 15, + .bo = 34, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 30, + .b2 = 15, + .bo = 19, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 45, + .b2 = 15, + .bo = 4, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_479[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_0", + .b1 = 19, + .b2 = 5, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONTROL_ON", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_COMMAND", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_STATUS", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_REQUEST", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL_RELEASE", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_PREPARE", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_BRAKING", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_490[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_495[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_TO_3", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONTROL_ON", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_FF", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_75", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_30", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH2", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_545[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ECON_ON", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DRIVE_MODE", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_576[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_577[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_579[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_580[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_582[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_583[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_585[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_586[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_597[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_COUNTER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_662[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SETTING", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_BUTTONS", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_773[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SEATBELT_DRIVER_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_UNLATCHED", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_LATCHED", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_OFF", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED_3", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOCK_STATUS", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_780[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = false, + .factor = 0.002759506, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE_MINI_CAR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_OBSTRUCTED", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_PROBLEM", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_1", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_PROBLEM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC_MODE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_LABEL", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_5", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_4", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_3", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_LEAD", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_6", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ON", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X1", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_804[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "HUD_SPEED_KPH", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_SPEED_MPH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_FUEL_CONSUMED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED_PCM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_806[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DRIVERS_DOOR_OPEN", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CMBS_STATES", + .b1 = 17, + .b2 = 2, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_829[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X48", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_862[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 50, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH_2", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGHBEAMS_ON", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGHBEAMS_ACTIVE", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DASHBOARD_ALERT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_FLASH", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HEADLIGHTS", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_HOLD", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_SWITCH", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HEADLIGHTS_ON", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_891[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAMS", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAMS", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_LIGHTS", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_927[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH2", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CMBS_OFF", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_1", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ALERTS", + .b1 = 19, + .b2 = 5, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RESUME_INSTRUCTION", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_0", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "APPLY_BRAKES_FOR_CANC", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_2", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_DISTANCE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1029[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRUNK_OPEN", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1302[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ODOMETER", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_13274[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_13275[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "KINEMATICS", + .address = 0x94, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_148), + .sigs = sigs_148, + }, + { + .name = "STEERING_CONTROL", + .address = 0xE4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_228), + .sigs = sigs_228, + }, + { + .name = "BOSCH_SUPPLEMENTAL_1", + .address = 0xE5, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_229), + .sigs = sigs_229, + }, + { + .name = "BRAKE_HOLD", + .address = 0xE8, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_232), + .sigs = sigs_232, + }, + { + .name = "GAS_PEDAL_2", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "GAS_PEDAL", + .address = 0x13C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_316), + .sigs = sigs_316, + }, + { + .name = "STEERING_SENSORS", + .address = 0x156, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_342), + .sigs = sigs_342, + }, + { + .name = "ENGINE_DATA", + .address = 0x158, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_344), + .sigs = sigs_344, + }, + { + .name = "POWERTRAIN_DATA", + .address = 0x17C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_380), + .sigs = sigs_380, + }, + { + .name = "STEER_STATUS", + .address = 0x18F, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "GEARBOX", + .address = 0x1A3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_419), + .sigs = sigs_419, + }, + { + .name = "VSA_STATUS", + .address = 0x1A4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_420), + .sigs = sigs_420, + }, + { + .name = "STEER_MOTOR_TORQUE", + .address = 0x1AB, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_427), + .sigs = sigs_427, + }, + { + .name = "STANDSTILL", + .address = 0x1B0, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_432), + .sigs = sigs_432, + }, + { + .name = "BRAKE_MODULE", + .address = 0x1BE, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_446), + .sigs = sigs_446, + }, + { + .name = "EPB_STATUS", + .address = 0x1C2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_450), + .sigs = sigs_450, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x1D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_464), + .sigs = sigs_464, + }, + { + .name = "ACC_CONTROL", + .address = 0x1DF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_479), + .sigs = sigs_479, + }, + { + .name = "VEHICLE_DYNAMICS", + .address = 0x1EA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_490), + .sigs = sigs_490, + }, + { + .name = "ACC_CONTROL_ON", + .address = 0x1EF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_495), + .sigs = sigs_495, + }, + { + .name = "XXX_16", + .address = 0x221, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_545), + .sigs = sigs_545, + }, + { + .name = "LEFT_LANE_LINE_1", + .address = 0x240, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_576), + .sigs = sigs_576, + }, + { + .name = "LEFT_LANE_LINE_2", + .address = 0x241, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_577), + .sigs = sigs_577, + }, + { + .name = "RIGHT_LANE_LINE_1", + .address = 0x243, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_579), + .sigs = sigs_579, + }, + { + .name = "RIGHT_LANE_LINE_2", + .address = 0x244, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_580), + .sigs = sigs_580, + }, + { + .name = "ADJACENT_LEFT_LANE_LINE_1", + .address = 0x246, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_582), + .sigs = sigs_582, + }, + { + .name = "ADJACENT_LEFT_LANE_LINE_2", + .address = 0x247, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_583), + .sigs = sigs_583, + }, + { + .name = "ADJACENT_RIGHT_LANE_LINE_1", + .address = 0x249, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_585), + .sigs = sigs_585, + }, + { + .name = "ADJACENT_RIGHT_LANE_LINE_2", + .address = 0x24A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_586), + .sigs = sigs_586, + }, + { + .name = "ROUGH_WHEEL_SPEED", + .address = 0x255, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_597), + .sigs = sigs_597, + }, + { + .name = "SCM_BUTTONS", + .address = 0x296, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_662), + .sigs = sigs_662, + }, + { + .name = "SEATBELT_STATUS", + .address = 0x305, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_773), + .sigs = sigs_773, + }, + { + .name = "CAR_SPEED", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "ACC_HUD", + .address = 0x30C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_780), + .sigs = sigs_780, + }, + { + .name = "CRUISE", + .address = 0x324, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_804), + .sigs = sigs_804, + }, + { + .name = "SCM_FEEDBACK", + .address = 0x326, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_806), + .sigs = sigs_806, + }, + { + .name = "LKAS_HUD", + .address = 0x33D, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_829), + .sigs = sigs_829, + }, + { + .name = "CAMERA_MESSAGES", + .address = 0x35E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_862), + .sigs = sigs_862, + }, + { + .name = "STALK_STATUS", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "STALK_STATUS_2", + .address = 0x37B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_891), + .sigs = sigs_891, + }, + { + .name = "RADAR_HUD", + .address = 0x39F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_927), + .sigs = sigs_927, + }, + { + .name = "DOORS_STATUS", + .address = 0x405, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1029), + .sigs = sigs_1029, + }, + { + .name = "ODOMETER", + .address = 0x516, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1302), + .sigs = sigs_1302, + }, + { + .name = "LKAS_HUD_A", + .address = 0x33DA, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_13274), + .sigs = sigs_13274, + }, + { + .name = "LKAS_HUD_B", + .address = 0x33DB, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_13275), + .sigs = sigs_13275, + }, +}; + +const Val vals[] = { + { + .name = "STEER_STATUS", + .address = 0x18F, + .def_val = "6 TMP_FAULT 5 FAULT_1 4 NO_TORQUE_ALERT_2 3 LOW_SPEED_LOCKOUT 2 NO_TORQUE_ALERT_1 0 NORMAL", + .sigs = sigs_399, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x1A3, + .def_val = " 32 D 8 R 4 P", + .sigs = sigs_419, + }, + { + .name = "ECON_ON_2", + .address = 0x221, + .def_val = "0 OFF 3 ON", + .sigs = sigs_545, + }, + { + .name = "CRUISE_BUTTONS", + .address = 0x296, + .def_val = "7 TBD 6 TBD 5 TBD 4 ACCEL_RES 3 DECEL_SET 2 CANCEL 1 MAIN 0 NONE", + .sigs = sigs_662, + }, + { + .name = "CRUISE_SETTING", + .address = 0x296, + .def_val = "3 DISTANCE_ADJ 2 TBD 1 LKAS_BUTTON 0 NONE", + .sigs = sigs_662, + }, + { + .name = "CMBS_BUTTON", + .address = 0x326, + .def_val = "3 PRESSED 0 RELEASED", + .sigs = sigs_806, + }, + { + .name = "BEEP", + .address = 0x33D, + .def_val = "3 SINGLE_BEEP 2 TRIPLE_BEEP 1 REPEATED_BEEP 0 NO_BEEP", + .sigs = sigs_829, + }, + { + .name = "DASHBOARD_ALERT", + .address = 0x374, + .def_val = "0 NONE 51 ACC_PROBLEM 55 CMBS_PROBLEM 75 KEY_NOT_DETECTED 79 FASTEN_SEATBELT 111 LKAS_PROBLEM 131 BRAKE_SYSTEM_PROBLEM 132 BRAKE_HOLD_PROBLEM 139 TBD 161 DOOR_OPEN", + .sigs = sigs_884, + }, + { + .name = "WIPERS", + .address = 0x37B, + .def_val = "4 HIGH 2 LOW 0 OFF", + .sigs = sigs_891, + }, +}; + +} + +const DBC acura_rdx_2020_can_generated = { + .name = "acura_rdx_2020_can_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(acura_rdx_2020_can_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/chrysler_pacifica_2017_hybrid.cc b/opendbc/can/dbc_out/chrysler_pacifica_2017_hybrid.cc new file mode 100644 index 000000000..1d76ab323 --- /dev/null +++ b/opendbc/can/dbc_out/chrysler_pacifica_2017_hybrid.cc @@ -0,0 +1,2500 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_168[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "ACCEL_RELATED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_257[] = { + { + .name = "ENERGY_OR_RPM", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_258[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "STEER_ANGLE", + .b1 = 3, + .b2 = 13, + .bo = 48, + .is_signed = false, + .factor = 0.3187251, + .offset = -1307.888, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_RATE", + .b1 = 19, + .b2 = 13, + .bo = 32, + .is_signed = false, + .factor = 0.3187251, + .offset = -1305.498, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_STEERING", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_264[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "ACCEL_PEDAL", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_268[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "BRAKE_PERHAPS", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_270[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "ACCEL_OR_RPM", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ELECTRIC_MOTOR", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_284[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "BRAKE_RELATED_1_1", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_RELATED_1_2", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED_RELATED_1", + .b1 = 34, + .b2 = 14, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_288[] = { + { + .name = "COUNTER", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "ACCEL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_ENGINE_RPM_MAYBE", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_291[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "ENERGY_GAIN_LOSS", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENERGY_SMOOTHER_CURVE", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_294[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "UNKNOWN_126_1", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENERGY_GAIN_LOSS_NOISY", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_126_2", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_308[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_134", + .b1 = 41, + .b2 = 7, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_320[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "BRAKE_PRESSED_2", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED_ACC", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED_RELATED_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_324[] = { + { + .name = "SPEED_2", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_331[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "BRAKE_RELATED_3", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_332[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_2", + .b1 = 0, + .b2 = 13, + .bo = 51, + .is_signed = false, + .factor = 0.3187251, + .offset = -1307.888, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENERGY_RELATED", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_344[] = { + { + .name = "WHEEL_SPEED_FL", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = false, + .factor = 0.0189408, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 0.0189408, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = false, + .factor = 0.0189408, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 52, + .b2 = 12, + .bo = 0, + .is_signed = false, + .factor = 0.0189408, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_384[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_464[] = { + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_500[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "ACC_STATUS_1", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_MAYBE", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_STATUS_2", + .b1 = 18, + .b2 = 3, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_BOOL_1", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_501[] = { + { + .name = "ACC_DISTANCE_CONFIG_1", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_SPEED_CONFIG_KPH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_SPEED_CONFIG_MPH", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATE", + .b1 = 33, + .b2 = 3, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_DISTANCE_CONFIG_2", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED_DIGITAL", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "COUNTER", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INCREASING", + .b1 = 28, + .b2 = 12, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_514[] = { + { + .name = "SPEED_LEFT", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.071028, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED_RIGHT", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.071028, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_532[] = { + { + .name = "ENERGY_RELATED", + .b1 = 7, + .b2 = 9, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NOISY_SLOWLY_DECREASING", + .b1 = 23, + .b2 = 9, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_544[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "TORQUE_DRIVER", + .b1 = 5, + .b2 = 11, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -1024.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TORQUE_MOTOR_RAW", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -2048.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_STATE", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TORQUE_MOTOR", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = -1024.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_PARK_HAS_CONTROL_2", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_559[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "ACCEL_22F", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_571[] = { + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "ACC_CANCEL", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_FOLLOW_DEC", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_SPEED_INC", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_SPEED_DEC", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_RESUME", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_FOLLOW_INC", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_608[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "IN_REVERSE", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_PARK_HAS_CONTROL_1", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUMAN_HAS_CONTROL", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARKSENSE_DISABLED", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_625[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_PERHAPS", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_639[] = { + { + .name = "INCREASING", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_653[] = { + { + .name = "BRAKE_PRESSED", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSURE", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_655[] = { + { + .name = "CHARGING", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_658[] = { + { + .name = "COUNTER", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "LKAS_STEERING_TORQUE", + .b1 = 5, + .b2 = 11, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -1024.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_HIGH_TORQUE", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_660[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "BRAKE_PERHAPS_294", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_669[] = { + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, +}; +const Signal sigs_671[] = { + { + .name = "AUTO_PARK_CMD", + .b1 = 5, + .b2 = 11, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -1024.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_PARK_STATUS", + .b1 = 0, + .b2 = 5, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_PARK_MODE", + .b1 = 17, + .b2 = 2, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_PARK_COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_PARK_CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_678[] = { + { + .name = "LKAS_ICON_COLOR", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAR_MODEL", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_LANE_LINES", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_ALERTS", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_701[] = { + { + .name = "unknown_1", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_705[] = { + { + .name = "AUTO_PARK_TOGGLE_2", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_PARK_TOGGLE_1", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INCREASING_UNKNOWN", + .b1 = 33, + .b2 = 7, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_719[] = { + { + .name = "AUTO_PARK_UNKNOWN_1", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_720[] = { + { + .name = "BLIND_SPOT_LEFT", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BLIND_SPOT_RIGHT", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_729[] = { + { + .name = "LKAS_STATUS_OK", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_736[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_746[] = { + { + .name = "COUNTER", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PRNDL", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR_CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_764[] = { + { + .name = "ACCEL_2FC", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_784[] = { + { + .name = "INCREASING_UNKNOWN", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_PARK_PERPENDICULAR_2", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_792[] = { + { + .name = "TURN_SIGNALS", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_PUSHED_IN", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_FLASH", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_816[] = { + { + .name = "TRACTION_OFF", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TOGGLE_PARKSENSE", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_820[] = { + { + .name = "DOOR_OPEN_FL", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_TRUNK", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TURN_LIGHT_RIGHT", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TURN_LIGHT_LEFT", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_DISPLAY", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_825[] = { + { + .name = "BEEP_339", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_826[] = { + { + .name = "AUTO_PARK_HAS_CONTROL_3", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUMAN_HAS_CONTROL", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_PARK_GEAR_1", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_PARK_GEAR_2", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_PARK_GEAR_3", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_832[] = { + { + .name = "SPEED_DIGITAL", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_848[] = { + { + .name = "INCREASING_LSB", + .b1 = 2, + .b2 = 6, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INCREASING_MSB", + .b1 = 11, + .b2 = 5, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_878[] = { + { + .name = "ACCEL_OR_RPM_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_OR_RPM_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_908[] = { + { + .name = "INCREASING_MSB", + .b1 = 43, + .b2 = 5, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INCREASING_LSB", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_938[] = { + { + .name = "INCREASING_UNKNOWN_1", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INCREASING_UNKNOWN_2", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_940[] = { + { + .name = "INCREASING_1", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INCREASING_2", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_941[] = { + { + .name = "INCREASING_1", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INCREASING_2", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "ACCEL_RELATED_a8", + .address = 0xA8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_168), + .sigs = sigs_168, + }, + { + .name = "ACCEL_RELATED_101", + .address = 0x101, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_257), + .sigs = sigs_257, + }, + { + .name = "STEERING", + .address = 0x102, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_258), + .sigs = sigs_258, + }, + { + .name = "ACCEL_PEDAL_MSG", + .address = 0x108, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_264), + .sigs = sigs_264, + }, + { + .name = "ACC_10c", + .address = 0x10C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_268), + .sigs = sigs_268, + }, + { + .name = "ACCEL_RELATED_10e", + .address = 0x10E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_270), + .sigs = sigs_270, + }, + { + .name = "BRAKE_1", + .address = 0x11C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_284), + .sigs = sigs_284, + }, + { + .name = "ACCEL_RELATED_120", + .address = 0x120, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_288), + .sigs = sigs_288, + }, + { + .name = "ENERGY_RELATED_123", + .address = 0x123, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_291), + .sigs = sigs_291, + }, + { + .name = "ENERGY_RELATED_126", + .address = 0x126, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_294), + .sigs = sigs_294, + }, + { + .name = "ACCEL_GAS_134", + .address = 0x134, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_308), + .sigs = sigs_308, + }, + { + .name = "BRAKE_2", + .address = 0x140, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_320), + .sigs = sigs_320, + }, + { + .name = "SPEED_2", + .address = 0x144, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_324), + .sigs = sigs_324, + }, + { + .name = "BRAKE_3", + .address = 0x14B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_331), + .sigs = sigs_331, + }, + { + .name = "STEERING_2", + .address = 0x14C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_332), + .sigs = sigs_332, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x158, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_344), + .sigs = sigs_344, + }, + { + .name = "NEW_MSG_180", + .address = 0x180, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_384), + .sigs = sigs_384, + }, + { + .name = "SEATBELT_STATUS", + .address = 0x1D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_464), + .sigs = sigs_464, + }, + { + .name = "ACC_2", + .address = 0x1F4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_500), + .sigs = sigs_500, + }, + { + .name = "DASHBOARD", + .address = 0x1F5, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_501), + .sigs = sigs_501, + }, + { + .name = "NEW_MSG_200", + .address = 0x200, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "SPEED_1", + .address = 0x202, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_514), + .sigs = sigs_514, + }, + { + .name = "ENERGY_RELATED_214", + .address = 0x214, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_532), + .sigs = sigs_532, + }, + { + .name = "EPS_STATUS", + .address = 0x220, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_544), + .sigs = sigs_544, + }, + { + .name = "ACCEL_GAS_22F", + .address = 0x22F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_559), + .sigs = sigs_559, + }, + { + .name = "WHEEL_BUTTONS", + .address = 0x23B, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_571), + .sigs = sigs_571, + }, + { + .name = "PARKSENSE_SIGNAL", + .address = 0x260, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_608), + .sigs = sigs_608, + }, + { + .name = "ACC_1", + .address = 0x271, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_625), + .sigs = sigs_625, + }, + { + .name = "NEW_MSG_27f", + .address = 0x27F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_639), + .sigs = sigs_639, + }, + { + .name = "BRAKE_MODULE", + .address = 0x28D, + .size = 2, + .num_sigs = ARRAYSIZE(sigs_653), + .sigs = sigs_653, + }, + { + .name = "CHARGING_MAYBE_28F", + .address = 0x28F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_655), + .sigs = sigs_655, + }, + { + .name = "LKAS_COMMAND", + .address = 0x292, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_658), + .sigs = sigs_658, + }, + { + .name = "BRAKE_RELATED_294", + .address = 0x294, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_660), + .sigs = sigs_660, + }, + { + .name = "NEW_MSG_29d", + .address = 0x29D, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_669), + .sigs = sigs_669, + }, + { + .name = "AUTO_PARK_REQUEST", + .address = 0x29F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_671), + .sigs = sigs_671, + }, + { + .name = "LKAS_HUD", + .address = 0x2A6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_678), + .sigs = sigs_678, + }, + { + .name = "NEW_MSG_2bd", + .address = 0x2BD, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_701), + .sigs = sigs_701, + }, + { + .name = "AUTO_PARK_BUTTON", + .address = 0x2C1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_705), + .sigs = sigs_705, + }, + { + .name = "AUTO_PARK_SIGNALS_1", + .address = 0x2CF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_719), + .sigs = sigs_719, + }, + { + .name = "BLIND_SPOT_WARNINGS", + .address = 0x2D0, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_720), + .sigs = sigs_720, + }, + { + .name = "LKAS_HEARTBIT", + .address = 0x2D9, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_729), + .sigs = sigs_729, + }, + { + .name = "TRIP", + .address = 0x2E0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_736), + .sigs = sigs_736, + }, + { + .name = "GEAR", + .address = 0x2EA, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_746), + .sigs = sigs_746, + }, + { + .name = "ACCEL_RELATED_2FC", + .address = 0x2FC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_764), + .sigs = sigs_764, + }, + { + .name = "AUTO_PARK_LESS_INTERESTING", + .address = 0x310, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_784), + .sigs = sigs_784, + }, + { + .name = "STEERING_LEVERS", + .address = 0x318, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_792), + .sigs = sigs_792, + }, + { + .name = "TRACTION_BUTTON", + .address = 0x330, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_816), + .sigs = sigs_816, + }, + { + .name = "DOORS", + .address = 0x334, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_820), + .sigs = sigs_820, + }, + { + .name = "AUDIBLE_BEEP_339", + .address = 0x339, + .size = 2, + .num_sigs = ARRAYSIZE(sigs_825), + .sigs = sigs_825, + }, + { + .name = "AUTO_PARK_SIGNALS_3", + .address = 0x33A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_826), + .sigs = sigs_826, + }, + { + .name = "UNKNOWN_340", + .address = 0x340, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_832), + .sigs = sigs_832, + }, + { + .name = "UNKNOWN_350", + .address = 0x350, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_848), + .sigs = sigs_848, + }, + { + .name = "ACCEL_RELATED_36E", + .address = 0x36E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_878), + .sigs = sigs_878, + }, + { + .name = "NEW_MSG_38c", + .address = 0x38C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_908), + .sigs = sigs_908, + }, + { + .name = "NEW_MSG_3aa", + .address = 0x3AA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_938), + .sigs = sigs_938, + }, + { + .name = "NEW_MSG_3ac", + .address = 0x3AC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_940), + .sigs = sigs_940, + }, + { + .name = "NEW_MSG_3ad", + .address = 0x3AD, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_941), + .sigs = sigs_941, + }, +}; + +const Val vals[] = { + { + .name = "CRUISE_STATE", + .address = 0x1F5, + .def_val = "0 OFF 1 CC_ON 2 CC_ENGAGED 3 ACC_ON 4 ACC_ENGAGED", + .sigs = sigs_501, + }, + { + .name = "PRNDL", + .address = 0x2EA, + .def_val = "5 L 4 D 3 N 2 R 1 P", + .sigs = sigs_746, + }, + { + .name = "TURN_SIGNALS", + .address = 0x318, + .def_val = "2 RIGHT 1 LEFT", + .sigs = sigs_792, + }, +}; + +} + +const DBC chrysler_pacifica_2017_hybrid = { + .name = "chrysler_pacifica_2017_hybrid", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(chrysler_pacifica_2017_hybrid) \ No newline at end of file diff --git a/opendbc/can/dbc_out/chrysler_pacifica_2017_hybrid_private_fusion.cc b/opendbc/can/dbc_out/chrysler_pacifica_2017_hybrid_private_fusion.cc new file mode 100644 index 000000000..0f8d2c08a --- /dev/null +++ b/opendbc/can/dbc_out/chrysler_pacifica_2017_hybrid_private_fusion.cc @@ -0,0 +1,1643 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_512[] = { + { + .name = "COUNTER", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "zeros_0", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "status0", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown_0", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "increasing", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "zeros_1", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_514[] = { + { + .name = "COUNTER", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "sig3", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "increasing", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_544[] = { + { + .name = "COUNTER", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "track_id", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "status1", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "sig2", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "status2", + .b1 = 32, + .b2 = 6, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "zeros", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_576[] = { + { + .name = "COUNTER", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "sig0", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "sig1", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "sig2", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "zeros", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_608[] = { + { + .name = "COUNTER", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "track_id", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "status1", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "sig2", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "status2", + .b1 = 32, + .b2 = 6, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "zeros", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_640[] = { + { + .name = "COUNTER", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "sig0", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "sig1", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "sig2", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "zeros", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_644[] = { + { + .name = "COUNTER", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "track_id", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "status1", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "sig2", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "status2", + .b1 = 32, + .b2 = 6, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "zeros", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_648[] = { + { + .name = "COUNTER", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "sig0", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "sig1", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "sig2", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "zeros", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_652[] = { + { + .name = "COUNTER", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "track_id", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "status1", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "sig2", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "status2", + .b1 = 32, + .b2 = 6, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "zeros", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_656[] = { + { + .name = "COUNTER", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "sig0", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "sig1", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "sig2", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "zeros", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_672[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 42, + .b2 = 10, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_674[] = { + { + .name = "REL_SPEED", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 0.2857, + .offset = -146.278, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_676[] = { + { + .name = "REL_SPEED", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 0.2857, + .offset = -146.278, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_678[] = { + { + .name = "REL_SPEED", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 0.2857, + .offset = -146.278, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_680[] = { + { + .name = "REL_SPEED", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 0.2857, + .offset = -146.278, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_682[] = { + { + .name = "REL_SPEED", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 0.2857, + .offset = -146.278, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_684[] = { + { + .name = "REL_SPEED", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 0.2857, + .offset = -146.278, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_686[] = { + { + .name = "REL_SPEED", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 0.2857, + .offset = -146.278, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_688[] = { + { + .name = "REL_SPEED", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 0.2857, + .offset = -146.278, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_690[] = { + { + .name = "REL_SPEED", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 0.2857, + .offset = -146.278, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_692[] = { + { + .name = "REL_SPEED", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 0.2857, + .offset = -146.278, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_706[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "LAT_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.005, + .offset = -1000.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = false, + .factor = 0.073, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_708[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "LAT_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.005, + .offset = -1000.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = false, + .factor = 0.073, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_710[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "LAT_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.005, + .offset = -1000.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = false, + .factor = 0.073, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_712[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "LAT_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.005, + .offset = -1000.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = false, + .factor = 0.073, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_714[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "LAT_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.005, + .offset = -1000.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = false, + .factor = 0.073, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_716[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "LAT_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.005, + .offset = -1000.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = false, + .factor = 0.073, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_718[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "LAT_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.005, + .offset = -1000.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = false, + .factor = 0.073, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_720[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "LAT_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.005, + .offset = -1000.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = false, + .factor = 0.073, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_722[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "LAT_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.005, + .offset = -1000.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = false, + .factor = 0.073, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_724[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::CHRYSLER_CHECKSUM, + }, + { + .name = "LAT_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.005, + .offset = -1000.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = false, + .factor = 0.073, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "unknown_200", + .address = 0x200, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "unknown_202", + .address = 0x202, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_514), + .sigs = sigs_514, + }, + { + .name = "a_1", + .address = 0x220, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_544), + .sigs = sigs_544, + }, + { + .name = "b_1", + .address = 0x240, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_576), + .sigs = sigs_576, + }, + { + .name = "a_2", + .address = 0x260, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_608), + .sigs = sigs_608, + }, + { + .name = "b_2", + .address = 0x280, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_640), + .sigs = sigs_640, + }, + { + .name = "a_3", + .address = 0x284, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_644), + .sigs = sigs_644, + }, + { + .name = "b_3", + .address = 0x288, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_648), + .sigs = sigs_648, + }, + { + .name = "a_4", + .address = 0x28C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_652), + .sigs = sigs_652, + }, + { + .name = "b_4", + .address = 0x290, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_656), + .sigs = sigs_656, + }, + { + .name = "NEW_MSG_5", + .address = 0x2A0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_672), + .sigs = sigs_672, + }, + { + .name = "d_1", + .address = 0x2A2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_674), + .sigs = sigs_674, + }, + { + .name = "d_2", + .address = 0x2A4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_676), + .sigs = sigs_676, + }, + { + .name = "d_3", + .address = 0x2A6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_678), + .sigs = sigs_678, + }, + { + .name = "d_4", + .address = 0x2A8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_680), + .sigs = sigs_680, + }, + { + .name = "d_5", + .address = 0x2AA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_682), + .sigs = sigs_682, + }, + { + .name = "d_6", + .address = 0x2AC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_684), + .sigs = sigs_684, + }, + { + .name = "d_7", + .address = 0x2AE, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_686), + .sigs = sigs_686, + }, + { + .name = "d_8", + .address = 0x2B0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_688), + .sigs = sigs_688, + }, + { + .name = "d_9", + .address = 0x2B2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_690), + .sigs = sigs_690, + }, + { + .name = "d_10", + .address = 0x2B4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_692), + .sigs = sigs_692, + }, + { + .name = "c_1", + .address = 0x2C2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_706), + .sigs = sigs_706, + }, + { + .name = "c_2", + .address = 0x2C4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_708), + .sigs = sigs_708, + }, + { + .name = "c_3", + .address = 0x2C6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_710), + .sigs = sigs_710, + }, + { + .name = "c_4", + .address = 0x2C8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_712), + .sigs = sigs_712, + }, + { + .name = "c_5", + .address = 0x2CA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_714), + .sigs = sigs_714, + }, + { + .name = "c_6", + .address = 0x2CC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_716), + .sigs = sigs_716, + }, + { + .name = "c_7", + .address = 0x2CE, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_718), + .sigs = sigs_718, + }, + { + .name = "c_8", + .address = 0x2D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_720), + .sigs = sigs_720, + }, + { + .name = "c_9", + .address = 0x2D2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_722), + .sigs = sigs_722, + }, + { + .name = "c_10", + .address = 0x2D4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_724), + .sigs = sigs_724, + }, +}; + +const Val vals[] = { +}; + +} + +const DBC chrysler_pacifica_2017_hybrid_private_fusion = { + .name = "chrysler_pacifica_2017_hybrid_private_fusion", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(chrysler_pacifica_2017_hybrid_private_fusion) \ No newline at end of file diff --git a/opendbc/can/dbc_out/ford_fusion_2018_adas.cc b/opendbc/can/dbc_out/ford_fusion_2018_adas.cc new file mode 100644 index 000000000..00172c876 --- /dev/null +++ b/opendbc/can/dbc_out/ford_fusion_2018_adas.cc @@ -0,0 +1,3414 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_1280[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1281[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1282[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1283[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1284[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1285[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1286[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1287[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1288[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1289[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1290[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1291[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1292[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1293[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1294[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1295[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1296[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1297[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1298[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1299[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1300[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1301[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1302[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1303[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1304[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1305[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1306[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1307[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1308[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1309[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1310[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1311[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1312[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1313[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1314[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1315[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1316[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1317[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1318[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1319[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1320[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1321[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1322[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1323[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1324[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1325[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1326[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1327[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1328[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1329[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1330[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1331[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1332[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1333[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1334[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1335[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1336[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1337[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1338[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1339[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1340[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1341[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1342[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1343[] = { + { + .name = "Angle", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "X_Rel", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "A_Rel", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "V_Rel", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "Object_00", + .address = 0x500, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1280), + .sigs = sigs_1280, + }, + { + .name = "Object_01", + .address = 0x501, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1281), + .sigs = sigs_1281, + }, + { + .name = "Object_02", + .address = 0x502, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1282), + .sigs = sigs_1282, + }, + { + .name = "Object_03", + .address = 0x503, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1283), + .sigs = sigs_1283, + }, + { + .name = "Object_04", + .address = 0x504, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1284), + .sigs = sigs_1284, + }, + { + .name = "Object_05", + .address = 0x505, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1285), + .sigs = sigs_1285, + }, + { + .name = "Object_06", + .address = 0x506, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1286), + .sigs = sigs_1286, + }, + { + .name = "Object_07", + .address = 0x507, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1287), + .sigs = sigs_1287, + }, + { + .name = "Object_08", + .address = 0x508, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1288), + .sigs = sigs_1288, + }, + { + .name = "Object_09", + .address = 0x509, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1289), + .sigs = sigs_1289, + }, + { + .name = "Object_10", + .address = 0x50A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1290), + .sigs = sigs_1290, + }, + { + .name = "Object_11", + .address = 0x50B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1291), + .sigs = sigs_1291, + }, + { + .name = "Object_12", + .address = 0x50C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1292), + .sigs = sigs_1292, + }, + { + .name = "Object_13", + .address = 0x50D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1293), + .sigs = sigs_1293, + }, + { + .name = "Object_14", + .address = 0x50E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1294), + .sigs = sigs_1294, + }, + { + .name = "Object_15", + .address = 0x50F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1295), + .sigs = sigs_1295, + }, + { + .name = "Object_16", + .address = 0x510, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1296), + .sigs = sigs_1296, + }, + { + .name = "Object_17", + .address = 0x511, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1297), + .sigs = sigs_1297, + }, + { + .name = "Object_18", + .address = 0x512, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1298), + .sigs = sigs_1298, + }, + { + .name = "Object_19", + .address = 0x513, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1299), + .sigs = sigs_1299, + }, + { + .name = "Object_20", + .address = 0x514, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1300), + .sigs = sigs_1300, + }, + { + .name = "Object_21", + .address = 0x515, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1301), + .sigs = sigs_1301, + }, + { + .name = "Object_22", + .address = 0x516, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1302), + .sigs = sigs_1302, + }, + { + .name = "Object_23", + .address = 0x517, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1303), + .sigs = sigs_1303, + }, + { + .name = "Object_24", + .address = 0x518, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1304), + .sigs = sigs_1304, + }, + { + .name = "Object_25", + .address = 0x519, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1305), + .sigs = sigs_1305, + }, + { + .name = "Object_26", + .address = 0x51A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1306), + .sigs = sigs_1306, + }, + { + .name = "Object_27", + .address = 0x51B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1307), + .sigs = sigs_1307, + }, + { + .name = "Object_28", + .address = 0x51C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1308), + .sigs = sigs_1308, + }, + { + .name = "Object_29", + .address = 0x51D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1309), + .sigs = sigs_1309, + }, + { + .name = "Object_30", + .address = 0x51E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1310), + .sigs = sigs_1310, + }, + { + .name = "Object_31", + .address = 0x51F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1311), + .sigs = sigs_1311, + }, + { + .name = "Object_32", + .address = 0x520, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1312), + .sigs = sigs_1312, + }, + { + .name = "Object_33", + .address = 0x521, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1313), + .sigs = sigs_1313, + }, + { + .name = "Object_34", + .address = 0x522, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1314), + .sigs = sigs_1314, + }, + { + .name = "Object_35", + .address = 0x523, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1315), + .sigs = sigs_1315, + }, + { + .name = "Object_36", + .address = 0x524, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1316), + .sigs = sigs_1316, + }, + { + .name = "Object_37", + .address = 0x525, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1317), + .sigs = sigs_1317, + }, + { + .name = "Object_38", + .address = 0x526, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1318), + .sigs = sigs_1318, + }, + { + .name = "Object_39", + .address = 0x527, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1319), + .sigs = sigs_1319, + }, + { + .name = "Object_40", + .address = 0x528, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1320), + .sigs = sigs_1320, + }, + { + .name = "Object_41", + .address = 0x529, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1321), + .sigs = sigs_1321, + }, + { + .name = "Object_42", + .address = 0x52A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1322), + .sigs = sigs_1322, + }, + { + .name = "Object_43", + .address = 0x52B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1323), + .sigs = sigs_1323, + }, + { + .name = "Object_44", + .address = 0x52C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1324), + .sigs = sigs_1324, + }, + { + .name = "Object_45", + .address = 0x52D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1325), + .sigs = sigs_1325, + }, + { + .name = "Object_46", + .address = 0x52E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1326), + .sigs = sigs_1326, + }, + { + .name = "Object_47", + .address = 0x52F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1327), + .sigs = sigs_1327, + }, + { + .name = "Object_48", + .address = 0x530, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1328), + .sigs = sigs_1328, + }, + { + .name = "Object_49", + .address = 0x531, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1329), + .sigs = sigs_1329, + }, + { + .name = "Object_50", + .address = 0x532, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1330), + .sigs = sigs_1330, + }, + { + .name = "Object_51", + .address = 0x533, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1331), + .sigs = sigs_1331, + }, + { + .name = "Object_52", + .address = 0x534, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1332), + .sigs = sigs_1332, + }, + { + .name = "Object_53", + .address = 0x535, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1333), + .sigs = sigs_1333, + }, + { + .name = "Object_54", + .address = 0x536, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1334), + .sigs = sigs_1334, + }, + { + .name = "Object_55", + .address = 0x537, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1335), + .sigs = sigs_1335, + }, + { + .name = "Object_56", + .address = 0x538, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1336), + .sigs = sigs_1336, + }, + { + .name = "Object_57", + .address = 0x539, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1337), + .sigs = sigs_1337, + }, + { + .name = "Object_58", + .address = 0x53A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1338), + .sigs = sigs_1338, + }, + { + .name = "Object_59", + .address = 0x53B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1339), + .sigs = sigs_1339, + }, + { + .name = "Object_60", + .address = 0x53C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1340), + .sigs = sigs_1340, + }, + { + .name = "Object_61", + .address = 0x53D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1341), + .sigs = sigs_1341, + }, + { + .name = "Object_62", + .address = 0x53E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1342), + .sigs = sigs_1342, + }, + { + .name = "Object_63", + .address = 0x53F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1343), + .sigs = sigs_1343, + }, +}; + +const Val vals[] = { +}; + +} + +const DBC ford_fusion_2018_adas = { + .name = "ford_fusion_2018_adas", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(ford_fusion_2018_adas) \ No newline at end of file diff --git a/opendbc/can/dbc_out/ford_fusion_2018_pt.cc b/opendbc/can/dbc_out/ford_fusion_2018_pt.cc new file mode 100644 index 000000000..54099e7a3 --- /dev/null +++ b/opendbc/can/dbc_out/ford_fusion_2018_pt.cc @@ -0,0 +1,915 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_118[] = { + { + .name = "SteWhlRelInit_An_Sns", + .b1 = 1, + .b2 = 15, + .bo = 48, + .is_signed = false, + .factor = 0.1, + .offset = -1600.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SteWhlRelCalib_An_Sns", + .b1 = 16, + .b2 = 15, + .bo = 33, + .is_signed = false, + .factor = 0.1, + .offset = -1600.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SteWhlAn_No_Cs", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SteWhlAn_No_Cnt", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SteWhlRelInit2_An_Sns", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.1, + .offset = -3200.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_130[] = { + { + .name = "SteeringColumnTorque", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.0625, + .offset = -8.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_FAILURE", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SAPPAngleControlStat2", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SAPPAngleControlStat3", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SAPPAngleControlStat4", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SAPPAngleControlStat5", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SAPPAngleControlStat6", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SteMdule_I_Est", + .b1 = 18, + .b2 = 12, + .bo = 34, + .is_signed = false, + .factor = 0.05, + .offset = -64.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SAPPAngleControlStat1", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SteMdule_U_Meas", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.05, + .offset = 6.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_131[] = { + { + .name = "Left_Turn_Light", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Right_Turn_Light", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Cancel", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Dist_Incr", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Dist_Decr", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Set", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Resume", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Main", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_145[] = { + { + .name = "VehPtch_W_Actl", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.0002, + .offset = -6.5, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VehRol_W_Actl", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.0002, + .offset = -6.5, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VehYaw_W_Actl", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.0002, + .offset = -6.5, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_146[] = { + { + .name = "VehLat_A_Actl", + .b1 = 3, + .b2 = 13, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = -40.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VehLatAActl_D_Qf", + .b1 = 1, + .b2 = 2, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VehLong_A_Actl", + .b1 = 19, + .b2 = 13, + .bo = 32, + .is_signed = false, + .factor = 0.01, + .offset = -40.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VehLongAActl_D_Qf", + .b1 = 17, + .b2 = 2, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VehVert_A_Actl", + .b1 = 35, + .b2 = 13, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = -40.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VehVertAActl_D_Qf", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_357[] = { + { + .name = "Brake_Drv_Appl", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_State", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Set_Speed", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_516[] = { + { + .name = "ApedPosScal_Pc_Actl", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_534[] = { + { + .name = "WhlRotatFr_No_Cnt", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WhlRotatFl_No_Cnt", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WhlRotatRr_No_Cnt", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WhlRotatRl_No_Cnt", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WhlDirRr_D_Actl", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WhlDirFl_D_Actl", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WhlDirFr_D_Actl", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WhlDirRl_D_Actl", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_ROLLING_TIMESTAMP", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_535[] = { + { + .name = "WhlFl_W_Meas", + .b1 = 0, + .b2 = 14, + .bo = 50, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WhlFr_W_Meas", + .b1 = 16, + .b2 = 14, + .bo = 34, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WhlRl_W_Meas", + .b1 = 32, + .b2 = 14, + .bo = 18, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WhlRr_W_Meas", + .b1 = 48, + .b2 = 14, + .bo = 2, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_947[] = { + { + .name = "Door_RL_Open", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Door_RR_Open", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Door_FR_Open", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Door_FL_Open", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_963[] = { + { + .name = "Brake_Lights", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_970[] = { + { + .name = "Lkas_Alert", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Lkas_Action", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Lane_Curvature", + .b1 = 8, + .b2 = 12, + .bo = 44, + .is_signed = false, + .factor = 5e-06, + .offset = -0.01, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Angle_Req", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 0.04297, + .offset = -88.00445, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_972[] = { + { + .name = "LaActAvail_D_Actl", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LaActDeny_B_Actl", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LaHandsOff_B_Actl", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_984[] = { + { + .name = "Set_Me_X80", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Set_Me_X45", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Hands_Warning", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Hands_Warning_W_Chime", + .b1 = 53, + .b2 = 1, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Lines_Hud", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Set_Me_X30", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "Steering_Wheel_Data_CG1", + .address = 0x76, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_118), + .sigs = sigs_118, + }, + { + .name = "EPAS_INFO", + .address = 0x82, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_130), + .sigs = sigs_130, + }, + { + .name = "Steering_Buttons", + .address = 0x83, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_131), + .sigs = sigs_131, + }, + { + .name = "Yaw_Data", + .address = 0x91, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_145), + .sigs = sigs_145, + }, + { + .name = "Accel_Data", + .address = 0x92, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_146), + .sigs = sigs_146, + }, + { + .name = "Cruise_Status", + .address = 0x165, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_357), + .sigs = sigs_357, + }, + { + .name = "EngineData_14", + .address = 0x204, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_516), + .sigs = sigs_516, + }, + { + .name = "WheelData", + .address = 0x216, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_534), + .sigs = sigs_534, + }, + { + .name = "WheelSpeed_CG1", + .address = 0x217, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_535), + .sigs = sigs_535, + }, + { + .name = "Doors", + .address = 0x3B3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_947), + .sigs = sigs_947, + }, + { + .name = "BCM_to_HS_Body", + .address = 0x3C3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_963), + .sigs = sigs_963, + }, + { + .name = "Lane_Keep_Assist_Control", + .address = 0x3CA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_970), + .sigs = sigs_970, + }, + { + .name = "Lane_Keep_Assist_Status", + .address = 0x3CC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_972), + .sigs = sigs_972, + }, + { + .name = "Lane_Keep_Assist_Ui", + .address = 0x3D8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_984), + .sigs = sigs_984, + }, +}; + +const Val vals[] = { + { + .name = "Cruise_State", + .address = 0x165, + .def_val = "4 ACTIVE 3 STANDBY 0 OFF", + .sigs = sigs_357, + }, + { + .name = "Lkas_Action", + .address = 0x3CA, + .def_val = "15 OFF 9 ABRUPT 8 ABRUPT2 5 SMOOTH 4 SMOOTH2", + .sigs = sigs_970, + }, + { + .name = "Lkas_Alert", + .address = 0x3CA, + .def_val = "15 NO_ALERT 3 HIGH_INTENSITY 2 MID_INTENSITY 1 LOW_INTENSITY", + .sigs = sigs_970, + }, + { + .name = "LaActAvail_D_Actl", + .address = 0x3CC, + .def_val = "3 AVAILABLE 2 TBD 1 NOT_AVAILABLE 0 FAULT", + .sigs = sigs_972, + }, + { + .name = "Lines_Hud", + .address = 0x3D8, + .def_val = "15 NONE 11 GREY_YELLOW 8 GREEN_RED 7 YELLOW_GREY 6 GREY_GREY 4 RED_GREEN 3 GREEN_GREEN", + .sigs = sigs_984, + }, +}; + +} + +const DBC ford_fusion_2018_pt = { + .name = "ford_fusion_2018_pt", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(ford_fusion_2018_pt) \ No newline at end of file diff --git a/opendbc/can/dbc_out/gm_global_a_chassis.cc b/opendbc/can/dbc_out/gm_global_a_chassis.cc new file mode 100644 index 000000000..84666b79c --- /dev/null +++ b/opendbc/can/dbc_out/gm_global_a_chassis.cc @@ -0,0 +1,157 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_368[] = { + { + .name = "FrictionBrakePressure", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_560[] = { + { + .name = "Regen", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_789[] = { + { + .name = "FrictionBrakeCmd", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrictionBrakeMode", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrictionBrakeChecksum", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RollingCounter", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_823[] = { + { + .name = "SteeringWheelCmd", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RollingCounter", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SteeringWheelChecksum", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "EBCMFrictionBrakeStatus", + .address = 0x170, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_368), + .sigs = sigs_368, + }, + { + .name = "EBCMRegen", + .address = 0x230, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_560), + .sigs = sigs_560, + }, + { + .name = "EBCMFrictionBrakeCmd", + .address = 0x315, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_789), + .sigs = sigs_789, + }, + { + .name = "PACMParkAssitCmd", + .address = 0x337, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_823), + .sigs = sigs_823, + }, +}; + +const Val vals[] = { +}; + +} + +const DBC gm_global_a_chassis = { + .name = "gm_global_a_chassis", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(gm_global_a_chassis) \ No newline at end of file diff --git a/opendbc/can/dbc_out/gm_global_a_object.cc b/opendbc/can/dbc_out/gm_global_a_object.cc new file mode 100644 index 000000000..b31ec81a2 --- /dev/null +++ b/opendbc/can/dbc_out/gm_global_a_object.cc @@ -0,0 +1,6294 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_161[] = { + { + .name = "TimeStatus", + .b1 = 0, + .b2 = 28, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RollingCounter", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_309[] = { + { + .name = "CtLghtDet", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HiBmRecmnd", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_774[] = { + { + .name = "RollingCounter", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AlwaysF0", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Always20", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ASCMSterringStatusChecksum", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_776[] = { + { + .name = "AlwaysOne", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VehicleSpeed", + .b1 = 8, + .b2 = 12, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VehicleAcceleration", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AccSpeedChecksum", + .b1 = 45, + .b2 = 11, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NearRangeMode", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FarRangeMode", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RollingCounter", + .b1 = 41, + .b2 = 2, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_784[] = { + { + .name = "Always42", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Always4", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_848[] = { + { + .name = "LnSnsRLnPosValid", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsTngtOfHdngLnRtV", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LaneSnsLLnPosValid", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LaneSenseSystemOKV", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LaneSenseSystemOK", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LaneSenseTimeStampV", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LaneSenseRollingCount", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSenseDistToLLnEdge", + .b1 = 9, + .b2 = 7, + .bo = 48, + .is_signed = false, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsDistToRLnEdge", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsTngtOfHdngLnRt", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = true, + .factor = 0.002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LaneSenseTimeStamp", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnEnvIllum", + .b1 = 34, + .b2 = 3, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsLnChngStatus", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsBurstChecksum", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_849[] = { + { + .name = "LnSnsLnCrvtrRghtV", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsBurstID", + .b1 = 5, + .b2 = 2, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsLatVRelToLftMrkg", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsLatVRelToRgtMrkg", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsCrvtGrdntRt", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = true, + .factor = 5.96e-08, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsLnCrvtrRght", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = 9.53e-07, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsLtAnchrLn", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsRtAnchrLn", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsRtLnMrkgTypChgDst", + .b1 = 58, + .b2 = 4, + .bo = 2, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsLnMrkgWdthRt", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsCrvtGrdntRtV", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_850[] = { + { + .name = "LnPrvwDstncRght", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnPrvwDstncLft", + .b1 = 2, + .b2 = 3, + .bo = 59, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsBurstID1", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnQltyCnfdncLvlLft", + .b1 = 9, + .b2 = 7, + .bo = 48, + .is_signed = false, + .factor = 0.7874016, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsLnCrvtrLftV", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnQltyCnfdncLvlRght", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 0.7874016, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsTngtOfHdngLnLftV", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsTngtOfHdngLnLft", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = true, + .factor = 0.002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsLnCrvtrLft", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = true, + .factor = 9.53e-07, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkrTypRght", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkrTypLft", + .b1 = 50, + .b2 = 3, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkrElvtdRght", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkrElvtdLft", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsTtlNmLnMrkgDetLt", + .b1 = 61, + .b2 = 3, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsLtLnMrkgTypChgDst", + .b1 = 57, + .b2 = 4, + .bo = 3, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsLtLnMrkgWdth", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_851[] = { + { + .name = "LnSnsBurstID2", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsTtlNmLnMrkgDetRt", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsCrvtGrdntLft", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 5.96e-08, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsRtLinCrsTm", + .b1 = 30, + .b2 = 5, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsLtLinCrsTm", + .b1 = 25, + .b2 = 5, + .bo = 34, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsCrvtGrdntLftV", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsNumPrlLnsDetRt", + .b1 = 38, + .b2 = 3, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnSnsNumPrlLnsDetLt", + .b1 = 35, + .b2 = 3, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3LnMrkgTypChgDst", + .b1 = 47, + .b2 = 4, + .bo = 13, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3LnMrkgWdth", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3LnPrvwDst", + .b1 = 42, + .b2 = 4, + .bo = 18, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3LnMarkrElvtd", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4LnPrvwDst", + .b1 = 53, + .b2 = 4, + .bo = 7, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4LnMarkrElvtd", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3AnchrLnLin", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4AnchrLnLin", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4LnMrkgTypChgDst", + .b1 = 58, + .b2 = 4, + .bo = 2, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4LnMrkgWdth", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_852[] = { + { + .name = "LnSnsBrstID3", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3LnMrkrTyp", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3LnSnsLnCrvtGradV", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3LnSnsLnCrvtV", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3LnSnsLnHdngTngtV", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3LnSnsLnDst", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3LnSnsLnHdngTngt", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = true, + .factor = 0.002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3LnSnsLnCrvt", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = true, + .factor = 9.53e-07, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3LnSnsLnCrvtGrad", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = 5.96e-08, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3LnSnsLnDstV", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg3LnQltyConfLvl", + .b1 = 56, + .b2 = 7, + .bo = 1, + .is_signed = false, + .factor = 0.7874016, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_853[] = { + { + .name = "LnSnsBrstID4", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4LnMrkrTyp", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4LnSnsLnCrvtGradV", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4LnSnsLnCrvtV", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4LnSnsLnHdngTngtV", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4LnSnsLnDst", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4LnSnsLnHdngTngt", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = true, + .factor = 0.002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4LnSnsLnCrvt", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = true, + .factor = 9.53e-07, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4LnSnsLnCrvtGrad", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = 5.96e-08, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4LnSnsLnDstV", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LnMrkg4LnQltyConfLvl", + .b1 = 56, + .b2 = 7, + .bo = 1, + .is_signed = false, + .factor = 0.7874016, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_854[] = { + { + .name = "LnSnsBrstID5", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnRdTypDet", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnCnstrctAreaDst", + .b1 = 10, + .b2 = 4, + .bo = 50, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnCnstrctZnDet", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnEgoVehLnPos", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnTunnlDst", + .b1 = 18, + .b2 = 4, + .bo = 42, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnTunnlDetd", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1056[] = { + { + .name = "FVisionRollingCnt", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVISModeCmdFdbk", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnIniDiagSuccCmpt", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnFld", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnUnvlbl", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionTimeStamp", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionNumValidTrgts", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnSrvAlgnInPrcs", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVsnSnsrBlckd", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ClstInPathVehObjID", + .b1 = 25, + .b2 = 6, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionTimeStampV", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VISBurstChecksum", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1057[] = { + { + .name = "FVisBurstIDTrk1", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionObjectIDTrk1", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnAzmthTrk1Rev", + .b1 = 13, + .b2 = 10, + .bo = 41, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjTypTr1Rev", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ObjDirTrk1", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnRngTrk1Rev", + .b1 = 23, + .b2 = 12, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionAzRateTrk1", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionConfTrk1", + .b1 = 35, + .b2 = 2, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnVertPosTrk1", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 0.25, + .offset = -2.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionRelLaneTrk1", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionWidthTrk1", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionMeasStatTrk1", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1058[] = { + { + .name = "FVisBurstIDTrk2", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionObjectIDTrk2", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnAzmthTrk2Rev", + .b1 = 13, + .b2 = 10, + .bo = 41, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjTypTr2Rev", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ObjDirTrk2", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnRngTrk2Rev", + .b1 = 23, + .b2 = 12, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionAzRateTrk2", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionConfTrk2", + .b1 = 35, + .b2 = 2, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnVertPosTrk2", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 0.25, + .offset = -2.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionRelLaneTrk2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionWidthTrk2", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionMeasStatTrk2", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1059[] = { + { + .name = "FVisBurstIDTrk3", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionObjectIDTrk3", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnAzmthTrk3Rev", + .b1 = 13, + .b2 = 10, + .bo = 41, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjTypTr3Rev", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ObjDirTrk3", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnRngTrk3Rev", + .b1 = 23, + .b2 = 12, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionAzRateTrk3", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionConfTrk3", + .b1 = 35, + .b2 = 2, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnVertPosTrk3", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 0.25, + .offset = -2.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionRelLaneTrk3", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionWidthTrk3", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionMeasStatTrk3", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1060[] = { + { + .name = "FVisBurstIDTrk4", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionObjectIDTrk4", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnAzmthTrk4Rev", + .b1 = 13, + .b2 = 10, + .bo = 41, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjTypTr4Rev", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ObjDirTrk4", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnRngTrk4Rev", + .b1 = 23, + .b2 = 12, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionAzRateTrk4", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionConfTrk4", + .b1 = 35, + .b2 = 2, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnVertPosTrk4", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 0.25, + .offset = -2.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionRelLaneTrk4", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionWidthTrk4", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionMeasStatTrk4", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1061[] = { + { + .name = "FVisBurstIDTrk5", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionObjectIDTrk5", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnAzmthTrk5Rev", + .b1 = 13, + .b2 = 10, + .bo = 41, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjTypTr5Rev", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ObjDirTrk5", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnRngTrk5Rev", + .b1 = 23, + .b2 = 12, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionAzRateTrk5", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionConfTrk5", + .b1 = 35, + .b2 = 2, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnVertPosTrk5", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 0.25, + .offset = -2.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionRelLaneTrk5", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionWidthTrk5", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionMeasStatTrk5", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1062[] = { + { + .name = "FVisBurstIDTrk6", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionObjectIDTrk6", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnAzmthTrk6Rev", + .b1 = 13, + .b2 = 10, + .bo = 41, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjTypTr6Rev", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ObjDirTrk6", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnRngTrk6Rev", + .b1 = 23, + .b2 = 12, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionAzRateTrk6", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionConfTrk6", + .b1 = 35, + .b2 = 2, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnVertPosTrk6", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 0.25, + .offset = -2.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionRelLaneTrk6", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionWidthTrk6", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionMeasStatTrk6", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1063[] = { + { + .name = "FwVsnCinCoutPotT1Rev", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnBrstIDAddInfo1", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjSclChgTrk1", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.0002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnTrnSigStatTr1", + .b1 = 30, + .b2 = 3, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLatOfstTrk1", + .b1 = 35, + .b2 = 10, + .bo = 19, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnBrkLtStatTrk1", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLongVlctyTrk1", + .b1 = 45, + .b2 = 12, + .bo = 7, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjAgeTrk1", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1064[] = { + { + .name = "FwVsnCinCoutPotT2Rev", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnBrstIDAddInfo2", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjSclChgTrk2", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.0002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnTrnSigStatTr2", + .b1 = 30, + .b2 = 3, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLatOfstTrk2", + .b1 = 35, + .b2 = 10, + .bo = 19, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnBrkLtStatTrk2", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLongVlctyTrk2", + .b1 = 45, + .b2 = 12, + .bo = 7, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjAgeTrk2", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1065[] = { + { + .name = "FwVsnCinCoutPotT3Rev", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnBrstIDAddInfo3", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjSclChgTrk3", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.0002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnTrnSigStatTr3", + .b1 = 30, + .b2 = 3, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLatOfstTrk3", + .b1 = 35, + .b2 = 10, + .bo = 19, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnBrkLtStatTrk3", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLongVlctyTrk3", + .b1 = 45, + .b2 = 12, + .bo = 7, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjAgeTrk3", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1066[] = { + { + .name = "FwVsnCinCoutPotT4Rev", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnBrstIDAddInfo4", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjSclChgTrk4", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.0002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnTrnSigStatTr4", + .b1 = 30, + .b2 = 3, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLatOfstTrk4", + .b1 = 35, + .b2 = 10, + .bo = 19, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnBrkLtStatTrk4", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLongVlctyTrk4", + .b1 = 45, + .b2 = 12, + .bo = 7, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjAgeTrk4", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1067[] = { + { + .name = "FwVsnCinCoutPotT5Rev", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnBrstIDAddInfo5", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjSclChgTrk5", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.0002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnTrnSigStatTr5", + .b1 = 30, + .b2 = 3, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLatOfstTrk5", + .b1 = 35, + .b2 = 10, + .bo = 19, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnBrkLtStatTrk5", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLongVlctyTrk5", + .b1 = 45, + .b2 = 12, + .bo = 7, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjAgeTrk5", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1068[] = { + { + .name = "FwVsnCinCoutPotT6Rev", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnBrstIDAddInfo6", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjSclChgTrk6", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.0002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnTrnSigStatTr6", + .b1 = 30, + .b2 = 3, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLatOfstTrk6", + .b1 = 35, + .b2 = 10, + .bo = 19, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnBrkLtStatTrk6", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLongVlctyTrk6", + .b1 = 45, + .b2 = 12, + .bo = 7, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjAgeTrk6", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1088[] = { + { + .name = "FrtVsnRollCnt2", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrntVsnInPthVehAlrtNwFlg", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnTmStmp2", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnVldTgtNum2", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrntVsnClostPedNotftnFlg", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrntVsnClostPedObjID", + .b1 = 26, + .b2 = 6, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrntVsnClostPedAlrtNwFlg", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnTmStmp2V", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrntVsnInPthVehBrkNwSt", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrntVsnClostPedBrkNwSt", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnBrstChksum2", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1089[] = { + { + .name = "FVisBurstIDTrk7", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionObjectIDTrk7", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnAzmthTrk7Rev", + .b1 = 13, + .b2 = 10, + .bo = 41, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjTypTr7Rev", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ObjDirTrk7", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnRngTrk7Rev", + .b1 = 23, + .b2 = 12, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionAzRateTrk7", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionConfTrk7", + .b1 = 35, + .b2 = 2, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnVertPosTrk7", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 0.25, + .offset = -2.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionRelLaneTrk7", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionWidthTrk7", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionMeasStatTrk7", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1090[] = { + { + .name = "FVisBurstIDTrk8", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionObjectIDTrk8", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnAzmthTrk8Rev", + .b1 = 13, + .b2 = 10, + .bo = 41, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjTypTr8Rev", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ObjDirTrk8", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnRngTrk8Rev", + .b1 = 23, + .b2 = 12, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionAzRateTrk8", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionConfTrk8", + .b1 = 35, + .b2 = 2, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnVertPosTrk8", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 0.25, + .offset = -2.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionRelLaneTrk8", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionWidthTrk8", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionMeasStatTrk8", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1091[] = { + { + .name = "FVisBurstIDTrk9", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionObjectIDTrk9", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnAzmthTrk9Rev", + .b1 = 13, + .b2 = 10, + .bo = 41, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjTypTr9Rev", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ObjDirTrk9", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnRngTrk9Rev", + .b1 = 23, + .b2 = 12, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionAzRateTrk9", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionConfTrk9", + .b1 = 35, + .b2 = 2, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnVertPosTrk9", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 0.25, + .offset = -2.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionRelLaneTrk9", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionWidthTrk9", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionMeasStatTrk9", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1092[] = { + { + .name = "FVisBurstIDTrk10", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionObjectIDTrk10", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnAzmthTrk10Rev", + .b1 = 13, + .b2 = 10, + .bo = 41, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjTypTr10Rev", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ObjDirTrk10", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnRngTrk10Rev", + .b1 = 23, + .b2 = 12, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionAzRateTrk10", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionConfTrk10", + .b1 = 35, + .b2 = 2, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnVertPosTrk10", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 0.25, + .offset = -2.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionRelLaneTrk10", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionWidthTrk10", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionMeasStatTrk10", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1093[] = { + { + .name = "FVisBurstIDTrk11", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionObjectIDTrk11", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnAzmthTrk11Rev", + .b1 = 13, + .b2 = 10, + .bo = 41, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjTypTr11Rev", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ObjDirTrk11", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnRngTrk11Rev", + .b1 = 23, + .b2 = 12, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionAzRateTrk11", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionConfTrk11", + .b1 = 35, + .b2 = 2, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnVertPosTrk11", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 0.25, + .offset = -2.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionRelLaneTrk11", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionWidthTrk11", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionMeasStatTrk11", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1094[] = { + { + .name = "FVisBurstIDTrk12", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionObjectIDTrk12", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnAzmthTrk12Rev", + .b1 = 13, + .b2 = 10, + .bo = 41, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjTypTr12Rev", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ObjDirTrk12", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnRngTrk12Rev", + .b1 = 23, + .b2 = 12, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionAzRateTrk12", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionConfTrk12", + .b1 = 35, + .b2 = 2, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnVertPosTrk12", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 0.25, + .offset = -2.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionRelLaneTrk12", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionWidthTrk12", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FVisionMeasStatTrk12", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1095[] = { + { + .name = "FwVsnCinCoutPotT7Rev", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnBrstIDAddInfo7", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjSclChgTrk7", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.0002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnTrnSigStatTr7", + .b1 = 30, + .b2 = 3, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLatOfstTrk7", + .b1 = 35, + .b2 = 10, + .bo = 19, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnBrkLtStatTrk7", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLongVlctyTrk7", + .b1 = 45, + .b2 = 12, + .bo = 7, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjAgeTrk7", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1096[] = { + { + .name = "FwVsnCinCoutPotT8Rev", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnBrstIDAddInfo8", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjSclChgTrk8", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.0002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnTrnSigStatTr8", + .b1 = 30, + .b2 = 3, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLatOfstTrk8", + .b1 = 35, + .b2 = 10, + .bo = 19, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnBrkLtStatTrk8", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLongVlctyTrk8", + .b1 = 45, + .b2 = 12, + .bo = 7, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjAgeTrk8", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1097[] = { + { + .name = "FwVsnCinCoutPotT9Rev", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnBrstIDAddInfo9", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjSclChgTrk9", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.0002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnTrnSigStatTr9", + .b1 = 30, + .b2 = 3, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLatOfstTrk9", + .b1 = 35, + .b2 = 10, + .bo = 19, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnBrkLtStatTrk9", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLongVlctyTrk9", + .b1 = 45, + .b2 = 12, + .bo = 7, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjAgeTrk9", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1098[] = { + { + .name = "FwVsnCinCoutPotT10Rev", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnBrstIDAddInfo10", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjSclChgTrk10", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.0002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnTrnSigStatTr10", + .b1 = 30, + .b2 = 3, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLatOfstTrk10", + .b1 = 35, + .b2 = 10, + .bo = 19, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnBrkLtStatTrk10", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLongVlctyTrk10", + .b1 = 45, + .b2 = 12, + .bo = 7, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjAgeTrk10", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1099[] = { + { + .name = "FwVsnCinCoutPotT11Rev", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnBrstIDAddInfo11", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjSclChgTrk11", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.0002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnTrnSigStatTr11", + .b1 = 30, + .b2 = 3, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLatOfstTrk11", + .b1 = 35, + .b2 = 10, + .bo = 19, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnBrkLtStatTrk11", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLongVlctyTrk11", + .b1 = 45, + .b2 = 12, + .bo = 7, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjAgeTrk11", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1100[] = { + { + .name = "FwVsnCinCoutPotT12Rev", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrtVsnBrstIDAddInfo12", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjSclChgTrk12", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.0002, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnTrnSigStatTr12", + .b1 = 30, + .b2 = 3, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLatOfstTrk12", + .b1 = 35, + .b2 = 10, + .bo = 19, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnBrkLtStatTrk12", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnLongVlctyTrk12", + .b1 = 45, + .b2 = 12, + .bo = 7, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FwdVsnObjAgeTrk12", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1120[] = { + { + .name = "FLRRTimeStamp", + .b1 = 5, + .b2 = 11, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRRoadTypeInfo", + .b1 = 2, + .b2 = 3, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRRollingCount", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRNumValidTargets", + .b1 = 19, + .b2 = 5, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRModeCmdFdbk", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRSnstvFltPrsntInt", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRHWFltPrsntInt", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRAntTngFltPrsnt", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRTunlDtctd", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRCANRxErr", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRCANSgnlSpvFld", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRDiagSpare", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRTimeStampV", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRMsalgnPtchUp", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRMsalgnPtchDn", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRYawRtPlsblityFlt", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRLonVelPlsblityFlt", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRExtIntrfrnc", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRPlntAlgnInProc", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRSvcAlgnInPrcs", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRAlgnFltPrsnt", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRInitDiagCmplt", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRAmbTmpOutRngHi", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRAmbTmpOutRngLw", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRVltgOutRngHi", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRVltgOutRngLo", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRSnsrBlckd", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRMsalgnYawLt", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRMsalgnYawRt", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLRRBurstChecksum", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1121[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1122[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1123[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1124[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1125[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1126[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1127[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1128[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1129[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1130[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1131[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1132[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1133[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1134[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1135[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1136[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1137[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1138[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1139[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1140[] = { + { + .name = "TrkRange", + .b1 = 2, + .b2 = 11, + .bo = 51, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeRate", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkRangeAccel", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkAzimuth", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkWidth", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TrkObjectID", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_3221225472[] = { + { + .name = "Always12", + .b1 = 7, + .b2 = 8, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TimeStatusChecksum", + .b1 = 7, + .b2 = 12, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "ASCMTimeStatus", + .address = 0xA1, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_161), + .sigs = sigs_161, + }, + { + .name = "LHT_CameraObjConfirmation_FO", + .address = 0x135, + .size = 1, + .num_sigs = ARRAYSIZE(sigs_309), + .sigs = sigs_309, + }, + { + .name = "ASCMSteeringStatus", + .address = 0x306, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_774), + .sigs = sigs_774, + }, + { + .name = "ASCMAccSpeedStatus", + .address = 0x308, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_776), + .sigs = sigs_776, + }, + { + .name = "ASCMHeadlight", + .address = 0x310, + .size = 2, + .num_sigs = ARRAYSIZE(sigs_784), + .sigs = sigs_784, + }, + { + .name = "F_Vision_Environment", + .address = 0x350, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_848), + .sigs = sigs_848, + }, + { + .name = "F_Vision_Environment_2", + .address = 0x351, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_849), + .sigs = sigs_849, + }, + { + .name = "F_Vision_Environment_3", + .address = 0x352, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_850), + .sigs = sigs_850, + }, + { + .name = "F_Vision_Environment_4", + .address = 0x353, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_851), + .sigs = sigs_851, + }, + { + .name = "F_Vision_Environment_5", + .address = 0x354, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_852), + .sigs = sigs_852, + }, + { + .name = "F_Vision_Environment_6", + .address = 0x355, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_853), + .sigs = sigs_853, + }, + { + .name = "F_Vision_Environment_7", + .address = 0x356, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_854), + .sigs = sigs_854, + }, + { + .name = "F_Vision_Obj_Header", + .address = 0x420, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_1056), + .sigs = sigs_1056, + }, + { + .name = "F_Vision_Obj_Track_1", + .address = 0x421, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1057), + .sigs = sigs_1057, + }, + { + .name = "F_Vision_Obj_Track_2", + .address = 0x422, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1058), + .sigs = sigs_1058, + }, + { + .name = "F_Vision_Obj_Track_3", + .address = 0x423, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1059), + .sigs = sigs_1059, + }, + { + .name = "F_Vision_Obj_Track_4", + .address = 0x424, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1060), + .sigs = sigs_1060, + }, + { + .name = "F_Vision_Obj_Track_5", + .address = 0x425, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1061), + .sigs = sigs_1061, + }, + { + .name = "F_Vision_Obj_Track_6", + .address = 0x426, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1062), + .sigs = sigs_1062, + }, + { + .name = "F_Vision_Obj_Track_1_B", + .address = 0x427, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1063), + .sigs = sigs_1063, + }, + { + .name = "F_Vision_Obj_Track_2_B", + .address = 0x428, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1064), + .sigs = sigs_1064, + }, + { + .name = "F_Vision_Obj_Track_3_B", + .address = 0x429, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1065), + .sigs = sigs_1065, + }, + { + .name = "F_Vision_Obj_Track_4_B", + .address = 0x42A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1066), + .sigs = sigs_1066, + }, + { + .name = "F_Vision_Obj_Track_5_B", + .address = 0x42B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1067), + .sigs = sigs_1067, + }, + { + .name = "F_Vision_Obj_Track_6_B", + .address = 0x42C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1068), + .sigs = sigs_1068, + }, + { + .name = "F_Vision_Obj_Header_2", + .address = 0x440, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1088), + .sigs = sigs_1088, + }, + { + .name = "F_Vision_Obj_Track_7", + .address = 0x441, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1089), + .sigs = sigs_1089, + }, + { + .name = "F_Vision_Obj_Track_8", + .address = 0x442, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1090), + .sigs = sigs_1090, + }, + { + .name = "F_Vision_Obj_Track_9", + .address = 0x443, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1091), + .sigs = sigs_1091, + }, + { + .name = "F_Vision_Obj_Track_10", + .address = 0x444, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1092), + .sigs = sigs_1092, + }, + { + .name = "F_Vision_Obj_Track_11", + .address = 0x445, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1093), + .sigs = sigs_1093, + }, + { + .name = "F_Vision_Obj_Track_12", + .address = 0x446, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1094), + .sigs = sigs_1094, + }, + { + .name = "F_Vision_Obj_Track_7_B", + .address = 0x447, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1095), + .sigs = sigs_1095, + }, + { + .name = "F_Vision_Obj_Track_8_B", + .address = 0x448, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1096), + .sigs = sigs_1096, + }, + { + .name = "F_Vision_Obj_Track_9_B", + .address = 0x449, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1097), + .sigs = sigs_1097, + }, + { + .name = "F_Vision_Obj_Track_10_B", + .address = 0x44A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1098), + .sigs = sigs_1098, + }, + { + .name = "F_Vision_Obj_Track_11_B", + .address = 0x44B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1099), + .sigs = sigs_1099, + }, + { + .name = "F_Vision_Obj_Track_12_B", + .address = 0x44C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1100), + .sigs = sigs_1100, + }, + { + .name = "F_LRR_Obj_Header", + .address = 0x460, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1120), + .sigs = sigs_1120, + }, + { + .name = "LRRObject01", + .address = 0x461, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1121), + .sigs = sigs_1121, + }, + { + .name = "LRRObject02", + .address = 0x462, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1122), + .sigs = sigs_1122, + }, + { + .name = "LRRObject03", + .address = 0x463, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1123), + .sigs = sigs_1123, + }, + { + .name = "LRRObject04", + .address = 0x464, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1124), + .sigs = sigs_1124, + }, + { + .name = "LRRObject05", + .address = 0x465, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1125), + .sigs = sigs_1125, + }, + { + .name = "LRRObject06", + .address = 0x466, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1126), + .sigs = sigs_1126, + }, + { + .name = "LRRObject07", + .address = 0x467, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1127), + .sigs = sigs_1127, + }, + { + .name = "LRRObject08", + .address = 0x468, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1128), + .sigs = sigs_1128, + }, + { + .name = "LRRObject09", + .address = 0x469, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1129), + .sigs = sigs_1129, + }, + { + .name = "LRRObject10", + .address = 0x46A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1130), + .sigs = sigs_1130, + }, + { + .name = "LRRObject11", + .address = 0x46B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1131), + .sigs = sigs_1131, + }, + { + .name = "LRRObject12", + .address = 0x46C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1132), + .sigs = sigs_1132, + }, + { + .name = "LRRObject13", + .address = 0x46D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1133), + .sigs = sigs_1133, + }, + { + .name = "LRRObject14", + .address = 0x46E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1134), + .sigs = sigs_1134, + }, + { + .name = "LRRObject15", + .address = 0x46F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1135), + .sigs = sigs_1135, + }, + { + .name = "LRRObject16", + .address = 0x470, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1136), + .sigs = sigs_1136, + }, + { + .name = "LRRObject17", + .address = 0x471, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1137), + .sigs = sigs_1137, + }, + { + .name = "LRRObject18", + .address = 0x472, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1138), + .sigs = sigs_1138, + }, + { + .name = "LRRObject19", + .address = 0x473, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1139), + .sigs = sigs_1139, + }, + { + .name = "LRRObject20", + .address = 0x474, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1140), + .sigs = sigs_1140, + }, + { + .name = "VECTOR__INDEPENDENT_SIG_MSG", + .address = 0xC0000000, + .size = 0, + .num_sigs = ARRAYSIZE(sigs_3221225472), + .sigs = sigs_3221225472, + }, +}; + +const Val vals[] = { + { + .name = "FarRangeMode", + .address = 0x308, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_776, + }, + { + .name = "NearRangeMode", + .address = 0x308, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_776, + }, +}; + +} + +const DBC gm_global_a_object = { + .name = "gm_global_a_object", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(gm_global_a_object) \ No newline at end of file diff --git a/opendbc/can/dbc_out/gm_global_a_powertrain_generated.cc b/opendbc/can/dbc_out/gm_global_a_powertrain_generated.cc new file mode 100644 index 000000000..c40cee27f --- /dev/null +++ b/opendbc/can/dbc_out/gm_global_a_powertrain_generated.cc @@ -0,0 +1,1673 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_189[] = { + { + .name = "RegenPaddle", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_190[] = { + { + .name = "BrakePedalPos", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GasPedalAndAcc", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_201[] = { + { + .name = "Standstill", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EngineRPM", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CruiseMainOn", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EngineTPS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.392156863, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pressed", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_209[] = { + { + .name = "BrakePedalPosition1", + .b1 = 2, + .b2 = 14, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter1", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BrakePedalPosition2", + .b1 = 18, + .b2 = 14, + .bo = 32, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter2", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BrakeNormalized1", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BrakeNormalized2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_241[] = { + { + .name = "BrakePedalPosition", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_298[] = { + { + .name = "RearLeftDoor", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrontLeftDoor", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrontRightDoor", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LeftSeatBelt", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RearRightDoor", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RightSeatBelt", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_309[] = { + { + .name = "PRNDL", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESPButton", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_320[] = { + { + .name = "HighBeamsTemporary", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HighBeamsActive", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Intellibeam", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TurnSignals", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_352[] = { + { + .name = "Ignition", + .b1 = 0, + .b2 = 32, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_381[] = { + { + .name = "TractionControlOn", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MSG17D_AccPower", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_384[] = { + { + .name = "LKASteeringCmd", + .b1 = 5, + .b2 = 11, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKASteeringCmdActive", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RollingCounter", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKASteeringCmdChecksum", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_388[] = { + { + .name = "LKATotalTorqueDelivered", + .b1 = 5, + .b2 = 11, + .bo = 48, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKATorqueDeliveredStatus", + .b1 = 2, + .b2 = 3, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKATorqueDelivered", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HandsOffSWDetectionMode", + .b1 = 19, + .b2 = 2, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HandsOffSWlDetectionStatus", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKADriverAppldTrq", + .b1 = 53, + .b2 = 11, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_417[] = { + { + .name = "AcceleratorPedal", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_451[] = { + { + .name = "GasPedalAndAcc2", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_452[] = { + { + .name = "CruiseState", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AcceleratorPedal2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_481[] = { + { + .name = "DistanceButton", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAButton", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DriveModeButton", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCButtons", + .b1 = 41, + .b2 = 3, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_485[] = { + { + .name = "SteeringWheelAngle", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SteeringWheelRate", + .b1 = 28, + .b2 = 12, + .bo = 24, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_489[] = { + { + .name = "LateralAcceleration", + .b1 = 4, + .b2 = 10, + .bo = 50, + .is_signed = true, + .factor = 0.161, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BrakePedalPressed", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "YawRate", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 0.625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "YawRate2", + .b1 = 52, + .b2 = 12, + .bo = 0, + .is_signed = true, + .factor = 0.0625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_497[] = { + { + .name = "Ignition", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_501[] = { + { + .name = "PRNDL2", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ManualMode", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TransmissionState", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.125677, + .offset = -75.909, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.251976, + .offset = -76.601, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.125677, + .offset = -75.909, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.251976, + .offset = -76.601, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_560[] = { + { + .name = "EPBClosed", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_711[] = { + { + .name = "HVBatteryCurrent", + .b1 = 11, + .b2 = 13, + .bo = 40, + .is_signed = true, + .factor = 0.15, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HVBatteryVoltage", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_715[] = { + { + .name = "GasRegenCmdActive", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RollingCounter", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GasRegenAlwaysOne2", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GasRegenFullStopActive", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GasRegenAlwaysOne", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GasRegenCmd", + .b1 = 17, + .b2 = 12, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GasRegenAlwaysOne3", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GasRegenCmdActiveInv", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GasRegenChecksum", + .b1 = 40, + .b2 = 24, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_789[] = { + { + .name = "FrictionBrakeCmd", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrictionBrakeMode", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FrictionBrakeChecksum", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RollingCounter", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_800[] = { + { + .name = "BrakingForce", + .b1 = 5, + .b2 = 7, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BrakeCmdActive", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RollingCounter", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 28, + .b2 = 20, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_810[] = { + { + .name = "GPSLatitude", + .b1 = 0, + .b2 = 32, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GPSLongitude", + .b1 = 32, + .b2 = 32, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = -2147483648.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_840[] = { + { + .name = "FLWheelSpd", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.0311, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRWheelSpd", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.0311, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_842[] = { + { + .name = "RLWheelSpd", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.0311, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RRWheelSpd", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.0311, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_880[] = { + { + .name = "ACCAlwaysOne", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCResumeButton", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCSpeedSetpoint", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCGapLevel", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCCmdActive", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCAlwaysOne2", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCWAlert", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCLeadCar", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1001[] = { + { + .name = "VehicleSpeed", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1033[] = { + { + .name = "ASCMKeepAliveAllZero", + .b1 = 0, + .b2 = 56, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1217[] = { + { + .name = "EngineCoolantTemp", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = -40.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1249[] = { + { + .name = "VINPart2", + .b1 = 0, + .b2 = 64, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1300[] = { + { + .name = "VINPart1", + .b1 = 0, + .b2 = 64, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "EBCMRegenPaddle", + .address = 0xBD, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_189), + .sigs = sigs_189, + }, + { + .name = "ECMAcceleratorPos", + .address = 0xBE, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_190), + .sigs = sigs_190, + }, + { + .name = "ECMEngineStatus", + .address = 0xC9, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_201), + .sigs = sigs_201, + }, + { + .name = "EBCMBrakePedalSensors", + .address = 0xD1, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_209), + .sigs = sigs_209, + }, + { + .name = "EBCMBrakePedalPosition", + .address = 0xF1, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_241), + .sigs = sigs_241, + }, + { + .name = "BCMDoorBeltStatus", + .address = 0x12A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_298), + .sigs = sigs_298, + }, + { + .name = "ECMPRDNL", + .address = 0x135, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_309), + .sigs = sigs_309, + }, + { + .name = "BCMTurnSignals", + .address = 0x140, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_320), + .sigs = sigs_320, + }, + { + .name = "VehicleIgnition", + .address = 0x160, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_352), + .sigs = sigs_352, + }, + { + .name = "ESPStatus", + .address = 0x17D, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_381), + .sigs = sigs_381, + }, + { + .name = "ASCMLKASteeringCmd", + .address = 0x180, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_384), + .sigs = sigs_384, + }, + { + .name = "PSCMStatus", + .address = 0x184, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_388), + .sigs = sigs_388, + }, + { + .name = "AcceleratorPedal", + .address = 0x1A1, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_417), + .sigs = sigs_417, + }, + { + .name = "GasAndAcc", + .address = 0x1C3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_451), + .sigs = sigs_451, + }, + { + .name = "AcceleratorPedal2", + .address = 0x1C4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_452), + .sigs = sigs_452, + }, + { + .name = "ASCMSteeringButton", + .address = 0x1E1, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_481), + .sigs = sigs_481, + }, + { + .name = "PSCMSteeringAngle", + .address = 0x1E5, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_485), + .sigs = sigs_485, + }, + { + .name = "EBCMVehicleDynamic", + .address = 0x1E9, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_489), + .sigs = sigs_489, + }, + { + .name = "VehicleIgnitionAlt", + .address = 0x1F1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_497), + .sigs = sigs_497, + }, + { + .name = "ECMPRDNL2", + .address = 0x1F5, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_501), + .sigs = sigs_501, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "EPBStatus", + .address = 0x230, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_560), + .sigs = sigs_560, + }, + { + .name = "BECMBatteryVoltageCurrent", + .address = 0x2C7, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_711), + .sigs = sigs_711, + }, + { + .name = "ASCMGasRegenCmd", + .address = 0x2CB, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_715), + .sigs = sigs_715, + }, + { + .name = "EBCMFrictionBrakeCmd", + .address = 0x315, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_789), + .sigs = sigs_789, + }, + { + .name = "AEBCmd", + .address = 0x320, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_800), + .sigs = sigs_800, + }, + { + .name = "TCICOnStarGPSPosition", + .address = 0x32A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_810), + .sigs = sigs_810, + }, + { + .name = "EBCMWheelSpdFront", + .address = 0x348, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_840), + .sigs = sigs_840, + }, + { + .name = "EBCMWheelSpdRear", + .address = 0x34A, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_842), + .sigs = sigs_842, + }, + { + .name = "ASCMActiveCruiseControlStatus", + .address = 0x370, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_880), + .sigs = sigs_880, + }, + { + .name = "ECMVehicleSpeed", + .address = 0x3E9, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1001), + .sigs = sigs_1001, + }, + { + .name = "ASCMKeepAlive", + .address = 0x409, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_1033), + .sigs = sigs_1033, + }, + { + .name = "ECMEngineCoolantTemp", + .address = 0x4C1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1217), + .sigs = sigs_1217, + }, + { + .name = "VIN_Part2", + .address = 0x4E1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1249), + .sigs = sigs_1249, + }, + { + .name = "VIN_Part1", + .address = 0x514, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1300), + .sigs = sigs_1300, + }, +}; + +const Val vals[] = { + { + .name = "ESPButton", + .address = 0x135, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_309, + }, + { + .name = "PRNDL", + .address = 0x135, + .def_val = "3 R 2 D 1 N 0 P", + .sigs = sigs_309, + }, + { + .name = "HighBeamsActive", + .address = 0x140, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_320, + }, + { + .name = "HighBeamsTemporary", + .address = 0x140, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_320, + }, + { + .name = "Intellibeam", + .address = 0x140, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_320, + }, + { + .name = "LKASteeringCmdActive", + .address = 0x180, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_384, + }, + { + .name = "HandsOffSWDetectionMode", + .address = 0x184, + .def_val = "2 FAILED 1 ENABLED 0 DISABLED", + .sigs = sigs_388, + }, + { + .name = "HandsOffSWlDetectionStatus", + .address = 0x184, + .def_val = "1 HANDS_ON 0 HANDS_OFF", + .sigs = sigs_388, + }, + { + .name = "LKATorqueDeliveredStatus", + .address = 0x184, + .def_val = "3 FAILED 2 TEMP._LIMITED 1 ACTIVE 0 INACTIVE", + .sigs = sigs_388, + }, + { + .name = "CruiseState", + .address = 0x1C4, + .def_val = "4 STANDSTILL 3 FAULTED 1 ACTIVE 0 OFF", + .sigs = sigs_452, + }, + { + .name = "ACCButtons", + .address = 0x1E1, + .def_val = "6 CANCEL 5 MAIN 3 SET 2 RESUME 1 NONE", + .sigs = sigs_481, + }, + { + .name = "DistanceButton", + .address = 0x1E1, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_481, + }, + { + .name = "DriveModeButton", + .address = 0x1E1, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_481, + }, + { + .name = "LKAButton", + .address = 0x1E1, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_481, + }, + { + .name = "BrakePedalPressed", + .address = 0x1E9, + .def_val = "1 PRESSED 0 DEPRESSED", + .sigs = sigs_489, + }, + { + .name = "ManualMode", + .address = 0x1F5, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_501, + }, + { + .name = "PRNDL2", + .address = 0x1F5, + .def_val = "6 L 4 D 3 N 2 R 1 P 0 SHIFTING", + .sigs = sigs_501, + }, + { + .name = "TransmissionState", + .address = 0x1F5, + .def_val = "11 SHIFTING 10 REVERSE 9 FORWARD 8 DISENGAGED", + .sigs = sigs_501, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "GasRegenCmdActive", + .address = 0x2CB, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_715, + }, + { + .name = "GasRegenCmdActiveInv", + .address = 0x2CB, + .def_val = "1 INACTIVE 0 ACTIVE", + .sigs = sigs_715, + }, + { + .name = "ACCCmdActive", + .address = 0x370, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_880, + }, + { + .name = "ACCGapLevel", + .address = 0x370, + .def_val = "3 FAR 2 MED 1 NEAR 0 INACTIVE", + .sigs = sigs_880, + }, + { + .name = "ACCLeadCar", + .address = 0x370, + .def_val = "1 PRESENT 0 NOT_PRESENT", + .sigs = sigs_880, + }, + { + .name = "ACCResumeButton", + .address = 0x370, + .def_val = "1 PRESSED 0 DEPRESSED", + .sigs = sigs_880, + }, +}; + +} + +const DBC gm_global_a_powertrain_generated = { + .name = "gm_global_a_powertrain_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(gm_global_a_powertrain_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/honda_accord_2018_can_generated.cc b/opendbc/can/dbc_out/honda_accord_2018_can_generated.cc new file mode 100644 index 000000000..11f042c77 --- /dev/null +++ b/opendbc/can/dbc_out/honda_accord_2018_can_generated.cc @@ -0,0 +1,4563 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_148[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = -0.035, + .offset = 17.92, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 30, + .b2 = 10, + .bo = 24, + .is_signed = false, + .factor = -0.035, + .offset = 17.92, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_228[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_REQUEST", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_DOWN_TO_ZERO", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_229[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X04", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X80", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_232[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 14, + .bo = 50, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE_REQUEST", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ENGINE_TORQUE_ESTIMATE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_TORQUE_REQUEST", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_316[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_330[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_3", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_2", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_1", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_WHEEL_ANGLE", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_344[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "XMISSION_SPEED2", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_380[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PEDAL_GAS", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_SWITCH", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_17C", + .b1 = 34, + .b2 = 5, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_STATUS", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PRESSED", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2_17C", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3_17C", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE_SENSOR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONTROL_ACTIVE", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_STATUS", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONFIG_INDEX", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_401[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GEAR_SHIFTER", + .b1 = 2, + .b2 = 6, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_419[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GEAR_SHIFTER", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_420[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "USER_BRAKE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.015625, + .offset = -1.609375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKING", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_DISABLED", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_RELATED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_427[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "MOTOR_TORQUE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONFIG_VALID", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OUTPUT_DISABLED", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_432[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_ERROR_2", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_1", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEELS_MOVING", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_446[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_450[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "EPB_ACTIVE", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_STATE", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_464[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 15, + .b2 = 15, + .bo = 34, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 30, + .b2 = 15, + .bo = 19, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 45, + .b2 = 15, + .bo = 4, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_479[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_0", + .b1 = 19, + .b2 = 5, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONTROL_ON", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_COMMAND", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_STATUS", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_REQUEST", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL_RELEASE", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_PREPARE", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_BRAKING", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_490[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_495[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_TO_3", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONTROL_ON", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_FF", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_75", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_30", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH2", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_506[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CHIME", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_545[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ECON_ON", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DRIVE_MODE", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_576[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_577[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_579[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_580[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_582[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_583[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_585[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_586[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_597[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_COUNTER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_662[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SETTING", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_BUTTONS", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_773[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SEATBELT_DRIVER_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_UNLATCHED", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_LATCHED", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_OFF", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED_3", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOCK_STATUS", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_780[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = false, + .factor = 0.002759506, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE_MINI_CAR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_OBSTRUCTED", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_PROBLEM", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_1", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_PROBLEM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC_MODE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_LABEL", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_5", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_4", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_3", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_LEAD", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_6", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ON", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X1", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_804[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "HUD_SPEED_KPH", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_SPEED_MPH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_FUEL_CONSUMED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED_PCM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_806[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DRIVERS_DOOR_OPEN", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CMBS_STATES", + .b1 = 17, + .b2 = 2, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_829[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X48", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_862[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 50, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH_2", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGHBEAMS_ON", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGHBEAMS_ACTIVE", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DASHBOARD_ALERT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_FLASH", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HEADLIGHTS", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_HOLD", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_SWITCH", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HEADLIGHTS_ON", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_891[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAMS", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAMS", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_LIGHTS", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_892[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SPEED_OFFSET", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_927[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH2", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CMBS_OFF", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_1", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ALERTS", + .b1 = 19, + .b2 = 5, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RESUME_INSTRUCTION", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_0", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "APPLY_BRAKES_FOR_CANC", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_2", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH3", + .b1 = 24, + .b2 = 32, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_DISTANCE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1029[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRUNK_OPEN", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1302[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ODOMETER", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_13274[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_13275[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "KINEMATICS", + .address = 0x94, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_148), + .sigs = sigs_148, + }, + { + .name = "STEERING_CONTROL", + .address = 0xE4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_228), + .sigs = sigs_228, + }, + { + .name = "BOSCH_SUPPLEMENTAL_1", + .address = 0xE5, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_229), + .sigs = sigs_229, + }, + { + .name = "BRAKE_HOLD", + .address = 0xE8, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_232), + .sigs = sigs_232, + }, + { + .name = "GAS_PEDAL_2", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "GAS_PEDAL", + .address = 0x13C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_316), + .sigs = sigs_316, + }, + { + .name = "STEERING_SENSORS", + .address = 0x14A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_330), + .sigs = sigs_330, + }, + { + .name = "ENGINE_DATA", + .address = 0x158, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_344), + .sigs = sigs_344, + }, + { + .name = "POWERTRAIN_DATA", + .address = 0x17C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_380), + .sigs = sigs_380, + }, + { + .name = "STEER_STATUS", + .address = 0x18F, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "GEARBOX_15T", + .address = 0x191, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_401), + .sigs = sigs_401, + }, + { + .name = "GEARBOX", + .address = 0x1A3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_419), + .sigs = sigs_419, + }, + { + .name = "VSA_STATUS", + .address = 0x1A4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_420), + .sigs = sigs_420, + }, + { + .name = "STEER_MOTOR_TORQUE", + .address = 0x1AB, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_427), + .sigs = sigs_427, + }, + { + .name = "STANDSTILL", + .address = 0x1B0, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_432), + .sigs = sigs_432, + }, + { + .name = "BRAKE_MODULE", + .address = 0x1BE, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_446), + .sigs = sigs_446, + }, + { + .name = "EPB_STATUS", + .address = 0x1C2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_450), + .sigs = sigs_450, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x1D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_464), + .sigs = sigs_464, + }, + { + .name = "ACC_CONTROL", + .address = 0x1DF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_479), + .sigs = sigs_479, + }, + { + .name = "VEHICLE_DYNAMICS", + .address = 0x1EA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_490), + .sigs = sigs_490, + }, + { + .name = "ACC_CONTROL_ON", + .address = 0x1EF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_495), + .sigs = sigs_495, + }, + { + .name = "LEGACY_BRAKE_COMMAND", + .address = 0x1FA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_506), + .sigs = sigs_506, + }, + { + .name = "XXX_16", + .address = 0x221, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_545), + .sigs = sigs_545, + }, + { + .name = "LEFT_LANE_LINE_1", + .address = 0x240, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_576), + .sigs = sigs_576, + }, + { + .name = "LEFT_LANE_LINE_2", + .address = 0x241, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_577), + .sigs = sigs_577, + }, + { + .name = "RIGHT_LANE_LINE_1", + .address = 0x243, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_579), + .sigs = sigs_579, + }, + { + .name = "RIGHT_LANE_LINE_2", + .address = 0x244, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_580), + .sigs = sigs_580, + }, + { + .name = "ADJACENT_LEFT_LANE_LINE_1", + .address = 0x246, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_582), + .sigs = sigs_582, + }, + { + .name = "ADJACENT_LEFT_LANE_LINE_2", + .address = 0x247, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_583), + .sigs = sigs_583, + }, + { + .name = "ADJACENT_RIGHT_LANE_LINE_1", + .address = 0x249, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_585), + .sigs = sigs_585, + }, + { + .name = "ADJACENT_RIGHT_LANE_LINE_2", + .address = 0x24A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_586), + .sigs = sigs_586, + }, + { + .name = "ROUGH_WHEEL_SPEED", + .address = 0x255, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_597), + .sigs = sigs_597, + }, + { + .name = "SCM_BUTTONS", + .address = 0x296, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_662), + .sigs = sigs_662, + }, + { + .name = "SEATBELT_STATUS", + .address = 0x305, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_773), + .sigs = sigs_773, + }, + { + .name = "CAR_SPEED", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "ACC_HUD", + .address = 0x30C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_780), + .sigs = sigs_780, + }, + { + .name = "CRUISE", + .address = 0x324, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_804), + .sigs = sigs_804, + }, + { + .name = "SCM_FEEDBACK", + .address = 0x326, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_806), + .sigs = sigs_806, + }, + { + .name = "LKAS_HUD", + .address = 0x33D, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_829), + .sigs = sigs_829, + }, + { + .name = "CAMERA_MESSAGES", + .address = 0x35E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_862), + .sigs = sigs_862, + }, + { + .name = "STALK_STATUS", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "STALK_STATUS_2", + .address = 0x37B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_891), + .sigs = sigs_891, + }, + { + .name = "CRUISE_PARAMS", + .address = 0x37C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_892), + .sigs = sigs_892, + }, + { + .name = "RADAR_HUD", + .address = 0x39F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_927), + .sigs = sigs_927, + }, + { + .name = "DOORS_STATUS", + .address = 0x405, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1029), + .sigs = sigs_1029, + }, + { + .name = "ODOMETER", + .address = 0x516, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1302), + .sigs = sigs_1302, + }, + { + .name = "LKAS_HUD_A", + .address = 0x33DA, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_13274), + .sigs = sigs_13274, + }, + { + .name = "LKAS_HUD_B", + .address = 0x33DB, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_13275), + .sigs = sigs_13275, + }, +}; + +const Val vals[] = { + { + .name = "STEER_STATUS", + .address = 0x18F, + .def_val = "6 TMP_FAULT 5 FAULT_1 4 NO_TORQUE_ALERT_2 3 LOW_SPEED_LOCKOUT 2 NO_TORQUE_ALERT_1 0 NORMAL", + .sigs = sigs_399, + }, + { + .name = "GEAR", + .address = 0x191, + .def_val = "7 L 10 S 4 D 3 N 2 R 1 P", + .sigs = sigs_401, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x191, + .def_val = "32 L 16 S 8 D 4 N 2 R 1 P", + .sigs = sigs_401, + }, + { + .name = "GEAR", + .address = 0x1A3, + .def_val = "26 S 20 D 19 N 18 R 17 P", + .sigs = sigs_419, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x1A3, + .def_val = "2 S 32 D 16 N 8 R 4 P", + .sigs = sigs_419, + }, + { + .name = "ECON_ON_2", + .address = 0x221, + .def_val = "0 OFF 3 ON", + .sigs = sigs_545, + }, + { + .name = "CRUISE_BUTTONS", + .address = 0x296, + .def_val = "7 TBD 6 TBD 5 TBD 4 ACCEL_RES 3 DECEL_SET 2 CANCEL 1 MAIN 0 NONE", + .sigs = sigs_662, + }, + { + .name = "CRUISE_SETTING", + .address = 0x296, + .def_val = "3 DISTANCE_ADJ 2 TBD 1 LKAS_BUTTON 0 NONE", + .sigs = sigs_662, + }, + { + .name = "CMBS_BUTTON", + .address = 0x326, + .def_val = "3 PRESSED 0 RELEASED", + .sigs = sigs_806, + }, + { + .name = "BEEP", + .address = 0x33D, + .def_val = "3 SINGLE_BEEP 2 TRIPLE_BEEP 1 REPEATED_BEEP 0 NO_BEEP", + .sigs = sigs_829, + }, + { + .name = "DASHBOARD_ALERT", + .address = 0x374, + .def_val = "0 NONE 51 ACC_PROBLEM 55 CMBS_PROBLEM 75 KEY_NOT_DETECTED 79 FASTEN_SEATBELT 111 LKAS_PROBLEM 131 BRAKE_SYSTEM_PROBLEM 132 BRAKE_HOLD_PROBLEM 139 TBD 161 DOOR_OPEN", + .sigs = sigs_884, + }, + { + .name = "WIPERS", + .address = 0x37B, + .def_val = "4 HIGH 2 LOW 0 OFF", + .sigs = sigs_891, + }, +}; + +} + +const DBC honda_accord_2018_can_generated = { + .name = "honda_accord_2018_can_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(honda_accord_2018_can_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/honda_civic_hatchback_ex_2017_can_generated.cc b/opendbc/can/dbc_out/honda_civic_hatchback_ex_2017_can_generated.cc new file mode 100644 index 000000000..90521ed2e --- /dev/null +++ b/opendbc/can/dbc_out/honda_civic_hatchback_ex_2017_can_generated.cc @@ -0,0 +1,4381 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_148[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = -0.035, + .offset = 17.92, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 30, + .b2 = 10, + .bo = 24, + .is_signed = false, + .factor = -0.035, + .offset = 17.92, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_228[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_REQUEST", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_DOWN_TO_ZERO", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_229[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X04", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X80", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_232[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 14, + .bo = 50, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE_REQUEST", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ENGINE_TORQUE_ESTIMATE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_TORQUE_REQUEST", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_316[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_330[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_3", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_2", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_1", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_WHEEL_ANGLE", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_344[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "XMISSION_SPEED2", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_380[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PEDAL_GAS", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_SWITCH", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_17C", + .b1 = 34, + .b2 = 5, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_STATUS", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PRESSED", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2_17C", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3_17C", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE_SENSOR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONTROL_ACTIVE", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_STATUS", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONFIG_INDEX", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_401[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GEAR_SHIFTER", + .b1 = 2, + .b2 = 6, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_420[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "USER_BRAKE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.015625, + .offset = -1.609375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKING", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_DISABLED", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_RELATED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_427[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "MOTOR_TORQUE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONFIG_VALID", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OUTPUT_DISABLED", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_432[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_ERROR_2", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_1", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEELS_MOVING", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_450[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "EPB_ACTIVE", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_STATE", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_464[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 15, + .b2 = 15, + .bo = 34, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 30, + .b2 = 15, + .bo = 19, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 45, + .b2 = 15, + .bo = 4, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_479[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_0", + .b1 = 19, + .b2 = 5, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONTROL_ON", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_COMMAND", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_STATUS", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_REQUEST", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL_RELEASE", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_PREPARE", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_BRAKING", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_490[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_495[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_TO_3", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONTROL_ON", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_FF", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_75", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_30", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH2", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_506[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CHIME", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_545[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ECON_ON", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DRIVE_MODE", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_576[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_577[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_579[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_580[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_582[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_583[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_585[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_586[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_597[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_COUNTER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_662[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SETTING", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_BUTTONS", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_773[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SEATBELT_DRIVER_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_UNLATCHED", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_LATCHED", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_OFF", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED_3", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOCK_STATUS", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_780[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = false, + .factor = 0.002759506, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE_MINI_CAR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_OBSTRUCTED", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_PROBLEM", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_1", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_PROBLEM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC_MODE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_LABEL", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_5", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_4", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_3", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_LEAD", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_6", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ON", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X1", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_804[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "HUD_SPEED_KPH", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_SPEED_MPH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_FUEL_CONSUMED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED_PCM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_806[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DRIVERS_DOOR_OPEN", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CMBS_STATES", + .b1 = 17, + .b2 = 2, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_829[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X48", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_862[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 50, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH_2", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGHBEAMS_ON", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGHBEAMS_ACTIVE", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DASHBOARD_ALERT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_FLASH", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HEADLIGHTS", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_HOLD", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_SWITCH", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HEADLIGHTS_ON", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_891[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAMS", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAMS", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_LIGHTS", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_892[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SPEED_OFFSET", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_927[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH2", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CMBS_OFF", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_1", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ALERTS", + .b1 = 19, + .b2 = 5, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RESUME_INSTRUCTION", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_0", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "APPLY_BRAKES_FOR_CANC", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH3", + .b1 = 24, + .b2 = 32, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1029[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRUNK_OPEN", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_13274[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_13275[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "KINEMATICS", + .address = 0x94, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_148), + .sigs = sigs_148, + }, + { + .name = "STEERING_CONTROL", + .address = 0xE4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_228), + .sigs = sigs_228, + }, + { + .name = "BOSCH_SUPPLEMENTAL_1", + .address = 0xE5, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_229), + .sigs = sigs_229, + }, + { + .name = "BRAKE_HOLD", + .address = 0xE8, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_232), + .sigs = sigs_232, + }, + { + .name = "GAS_PEDAL_2", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "GAS_PEDAL", + .address = 0x13C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_316), + .sigs = sigs_316, + }, + { + .name = "STEERING_SENSORS", + .address = 0x14A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_330), + .sigs = sigs_330, + }, + { + .name = "ENGINE_DATA", + .address = 0x158, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_344), + .sigs = sigs_344, + }, + { + .name = "POWERTRAIN_DATA", + .address = 0x17C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_380), + .sigs = sigs_380, + }, + { + .name = "STEER_STATUS", + .address = 0x18F, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "GEARBOX", + .address = 0x191, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_401), + .sigs = sigs_401, + }, + { + .name = "VSA_STATUS", + .address = 0x1A4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_420), + .sigs = sigs_420, + }, + { + .name = "STEER_MOTOR_TORQUE", + .address = 0x1AB, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_427), + .sigs = sigs_427, + }, + { + .name = "STANDSTILL", + .address = 0x1B0, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_432), + .sigs = sigs_432, + }, + { + .name = "EPB_STATUS", + .address = 0x1C2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_450), + .sigs = sigs_450, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x1D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_464), + .sigs = sigs_464, + }, + { + .name = "ACC_CONTROL", + .address = 0x1DF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_479), + .sigs = sigs_479, + }, + { + .name = "VEHICLE_DYNAMICS", + .address = 0x1EA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_490), + .sigs = sigs_490, + }, + { + .name = "ACC_CONTROL_ON", + .address = 0x1EF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_495), + .sigs = sigs_495, + }, + { + .name = "LEGACY_BRAKE_COMMAND", + .address = 0x1FA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_506), + .sigs = sigs_506, + }, + { + .name = "XXX_16", + .address = 0x221, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_545), + .sigs = sigs_545, + }, + { + .name = "LEFT_LANE_LINE_1", + .address = 0x240, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_576), + .sigs = sigs_576, + }, + { + .name = "LEFT_LANE_LINE_2", + .address = 0x241, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_577), + .sigs = sigs_577, + }, + { + .name = "RIGHT_LANE_LINE_1", + .address = 0x243, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_579), + .sigs = sigs_579, + }, + { + .name = "RIGHT_LANE_LINE_2", + .address = 0x244, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_580), + .sigs = sigs_580, + }, + { + .name = "ADJACENT_LEFT_LANE_LINE_1", + .address = 0x246, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_582), + .sigs = sigs_582, + }, + { + .name = "ADJACENT_LEFT_LANE_LINE_2", + .address = 0x247, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_583), + .sigs = sigs_583, + }, + { + .name = "ADJACENT_RIGHT_LANE_LINE_1", + .address = 0x249, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_585), + .sigs = sigs_585, + }, + { + .name = "ADJACENT_RIGHT_LANE_LINE_2", + .address = 0x24A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_586), + .sigs = sigs_586, + }, + { + .name = "ROUGH_WHEEL_SPEED", + .address = 0x255, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_597), + .sigs = sigs_597, + }, + { + .name = "SCM_BUTTONS", + .address = 0x296, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_662), + .sigs = sigs_662, + }, + { + .name = "SEATBELT_STATUS", + .address = 0x305, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_773), + .sigs = sigs_773, + }, + { + .name = "CAR_SPEED", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "ACC_HUD", + .address = 0x30C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_780), + .sigs = sigs_780, + }, + { + .name = "CRUISE", + .address = 0x324, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_804), + .sigs = sigs_804, + }, + { + .name = "SCM_FEEDBACK", + .address = 0x326, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_806), + .sigs = sigs_806, + }, + { + .name = "LKAS_HUD", + .address = 0x33D, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_829), + .sigs = sigs_829, + }, + { + .name = "CAMERA_MESSAGES", + .address = 0x35E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_862), + .sigs = sigs_862, + }, + { + .name = "STALK_STATUS", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "STALK_STATUS_2", + .address = 0x37B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_891), + .sigs = sigs_891, + }, + { + .name = "CRUISE_PARAMS", + .address = 0x37C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_892), + .sigs = sigs_892, + }, + { + .name = "RADAR_HUD", + .address = 0x39F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_927), + .sigs = sigs_927, + }, + { + .name = "DOORS_STATUS", + .address = 0x405, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1029), + .sigs = sigs_1029, + }, + { + .name = "LKAS_HUD_A", + .address = 0x33DA, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_13274), + .sigs = sigs_13274, + }, + { + .name = "LKAS_HUD_B", + .address = 0x33DB, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_13275), + .sigs = sigs_13275, + }, +}; + +const Val vals[] = { + { + .name = "STEER_STATUS", + .address = 0x18F, + .def_val = "6 TMP_FAULT 5 FAULT_1 4 NO_TORQUE_ALERT_2 3 LOW_SPEED_LOCKOUT 2 NO_TORQUE_ALERT_1 0 NORMAL", + .sigs = sigs_399, + }, + { + .name = "GEAR", + .address = 0x191, + .def_val = "7 L 10 S 4 D 3 N 2 R 1 P", + .sigs = sigs_401, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x191, + .def_val = "32 L 16 S 8 D 4 N 2 R 1 P", + .sigs = sigs_401, + }, + { + .name = "ECON_ON_2", + .address = 0x221, + .def_val = "0 OFF 3 ON", + .sigs = sigs_545, + }, + { + .name = "CRUISE_BUTTONS", + .address = 0x296, + .def_val = "7 TBD 6 TBD 5 TBD 4 ACCEL_RES 3 DECEL_SET 2 CANCEL 1 MAIN 0 NONE", + .sigs = sigs_662, + }, + { + .name = "CRUISE_SETTING", + .address = 0x296, + .def_val = "3 DISTANCE_ADJ 2 TBD 1 LKAS_BUTTON 0 NONE", + .sigs = sigs_662, + }, + { + .name = "CMBS_BUTTON", + .address = 0x326, + .def_val = "3 PRESSED 0 RELEASED", + .sigs = sigs_806, + }, + { + .name = "BEEP", + .address = 0x33D, + .def_val = "3 SINGLE_BEEP 2 TRIPLE_BEEP 1 REPEATED_BEEP 0 NO_BEEP", + .sigs = sigs_829, + }, + { + .name = "DASHBOARD_ALERT", + .address = 0x374, + .def_val = "0 NONE 51 ACC_PROBLEM 55 CMBS_PROBLEM 75 KEY_NOT_DETECTED 79 FASTEN_SEATBELT 111 LKAS_PROBLEM 131 BRAKE_SYSTEM_PROBLEM 132 BRAKE_HOLD_PROBLEM 139 TBD 161 DOOR_OPEN", + .sigs = sigs_884, + }, + { + .name = "WIPERS", + .address = 0x37B, + .def_val = "4 HIGH 2 LOW 0 OFF", + .sigs = sigs_891, + }, +}; + +} + +const DBC honda_civic_hatchback_ex_2017_can_generated = { + .name = "honda_civic_hatchback_ex_2017_can_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(honda_civic_hatchback_ex_2017_can_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/honda_civic_touring_2016_can_generated.cc b/opendbc/can/dbc_out/honda_civic_touring_2016_can_generated.cc new file mode 100644 index 000000000..1a46724c8 --- /dev/null +++ b/opendbc/can/dbc_out/honda_civic_touring_2016_can_generated.cc @@ -0,0 +1,3290 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_145[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_148[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 31, + .b2 = 9, + .bo = 24, + .is_signed = true, + .factor = -0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_228[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_REQUEST", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ENGINE_TORQUE_ESTIMATE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_TORQUE_REQUEST", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_316[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_330[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_3", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_2", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_1", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_WHEEL_ANGLE", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_344[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "XMISSION_SPEED2", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_380[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PEDAL_GAS", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_SWITCH", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_17C", + .b1 = 34, + .b2 = 5, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_STATUS", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PRESSED", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2_17C", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3_17C", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE_SENSOR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONTROL_ACTIVE", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_STATUS", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONFIG_INDEX", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_401[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GEAR_SHIFTER", + .b1 = 2, + .b2 = 6, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_420[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "USER_BRAKE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.015625, + .offset = -1.609375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKING", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_DISABLED", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_RELATED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_427[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "MOTOR_TORQUE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONFIG_VALID", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OUTPUT_DISABLED", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_432[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CONTROLLED_STANDSTILL", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_2", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_1", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEELS_MOVING", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_450[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "EPB_ACTIVE", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_STATE", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_464[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 15, + .b2 = 15, + .bo = 34, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 30, + .b2 = 15, + .bo = 19, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 45, + .b2 = 15, + .bo = 4, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_487[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_PRESSURE1", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSURE2", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_490[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_493[] = { + { + .name = "IMPERIAL_UNIT", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_506[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "COMPUTER_BRAKE", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PUMP_REQUEST", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 10, + .b2 = 5, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE_REQUEST", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CANCEL_CMD", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_FAULT_CMD", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_3", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_OVERRIDE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_2", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_1", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATES", + .b1 = 33, + .b2 = 7, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_STATUS", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCW", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_4", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_5", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_545[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ECON_ON", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ECON_ON_2", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_597[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_662[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SETTING", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_BUTTONS", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_773[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SEATBELT_DRIVER_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_UNLATCHED", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_LATCHED", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_OFF", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOORS_UNLOCKED", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOORS_LOCKED", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_780[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PCM_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCM_GAS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE_MINI_CAR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_OBSTRUCTED", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_PROBLEM", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF_2", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_PROBLEM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC_MODE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_LABEL", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_5", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_4", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_3", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_LEAD", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 52, + .b2 = 3, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE_3", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01_2", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ICONS", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_804[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "HUD_SPEED_KPH", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_SPEED_MPH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_FUEL_CONSUMED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED_PCM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_806[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "REVERSE_LIGHT", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CMBS_BUTTON", + .b1 = 17, + .b2 = 2, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_829[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X48", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_862[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 50, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH_2", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGHBEAMS_ON", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGHBEAMS_ACTIVE", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DASHBOARD_ALERT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_FLASH", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HEADLIGHTS", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_HOLD", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_SWITCH", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HEADLIGHTS_ON", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_891[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAMS", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAMS", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_LIGHTS", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_892[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SPEED_OFFSET", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_927[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 17, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ALERTS", + .b1 = 19, + .b2 = 5, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RESUME_INSTRUCTION", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "APPLY_BRAKES_FOR_CANC", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_SPEED", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_DISTANCE", + .b1 = 44, + .b2 = 5, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_STATE", + .b1 = 41, + .b2 = 3, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH3", + .b1 = 49, + .b2 = 7, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1029[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRUNK_OPEN", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1302[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ODOMETER", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "KINEMATICS", + .address = 0x91, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_145), + .sigs = sigs_145, + }, + { + .name = "KINEMATICS_ALT", + .address = 0x94, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_148), + .sigs = sigs_148, + }, + { + .name = "STEERING_CONTROL", + .address = 0xE4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_228), + .sigs = sigs_228, + }, + { + .name = "GAS_PEDAL_2", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "GAS_PEDAL", + .address = 0x13C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_316), + .sigs = sigs_316, + }, + { + .name = "STEERING_SENSORS", + .address = 0x14A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_330), + .sigs = sigs_330, + }, + { + .name = "ENGINE_DATA", + .address = 0x158, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_344), + .sigs = sigs_344, + }, + { + .name = "POWERTRAIN_DATA", + .address = 0x17C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_380), + .sigs = sigs_380, + }, + { + .name = "STEER_STATUS", + .address = 0x18F, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "GEARBOX", + .address = 0x191, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_401), + .sigs = sigs_401, + }, + { + .name = "VSA_STATUS", + .address = 0x1A4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_420), + .sigs = sigs_420, + }, + { + .name = "STEER_MOTOR_TORQUE", + .address = 0x1AB, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_427), + .sigs = sigs_427, + }, + { + .name = "STANDSTILL", + .address = 0x1B0, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_432), + .sigs = sigs_432, + }, + { + .name = "EPB_STATUS", + .address = 0x1C2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_450), + .sigs = sigs_450, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x1D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_464), + .sigs = sigs_464, + }, + { + .name = "BRAKE_PRESSURE", + .address = 0x1E7, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_487), + .sigs = sigs_487, + }, + { + .name = "VEHICLE_DYNAMICS", + .address = 0x1EA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_490), + .sigs = sigs_490, + }, + { + .name = "HUD_SETTING", + .address = 0x1ED, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_493), + .sigs = sigs_493, + }, + { + .name = "BRAKE_COMMAND", + .address = 0x1FA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_506), + .sigs = sigs_506, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "ECON_STATUS", + .address = 0x221, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_545), + .sigs = sigs_545, + }, + { + .name = "ROUGH_WHEEL_SPEED", + .address = 0x255, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_597), + .sigs = sigs_597, + }, + { + .name = "SCM_BUTTONS", + .address = 0x296, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_662), + .sigs = sigs_662, + }, + { + .name = "SEATBELT_STATUS", + .address = 0x305, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_773), + .sigs = sigs_773, + }, + { + .name = "LOCK_STATUS", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "ACC_HUD", + .address = 0x30C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_780), + .sigs = sigs_780, + }, + { + .name = "CRUISE", + .address = 0x324, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_804), + .sigs = sigs_804, + }, + { + .name = "SCM_FEEDBACK", + .address = 0x326, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_806), + .sigs = sigs_806, + }, + { + .name = "LKAS_HUD", + .address = 0x33D, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_829), + .sigs = sigs_829, + }, + { + .name = "HIGHBEAM_CONTROL", + .address = 0x35E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_862), + .sigs = sigs_862, + }, + { + .name = "STALK_STATUS", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "STALK_STATUS_2", + .address = 0x37B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_891), + .sigs = sigs_891, + }, + { + .name = "CRUISE_PARAMS", + .address = 0x37C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_892), + .sigs = sigs_892, + }, + { + .name = "RADAR_HUD", + .address = 0x39F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_927), + .sigs = sigs_927, + }, + { + .name = "DOORS_STATUS", + .address = 0x405, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1029), + .sigs = sigs_1029, + }, + { + .name = "ODOMETER", + .address = 0x516, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1302), + .sigs = sigs_1302, + }, +}; + +const Val vals[] = { + { + .name = "STEER_STATUS", + .address = 0x18F, + .def_val = "6 TMP_FAULT 5 FAULT_1 4 NO_TORQUE_ALERT_2 3 LOW_SPEED_LOCKOUT 2 NO_TORQUE_ALERT_1 0 NORMAL", + .sigs = sigs_399, + }, + { + .name = "GEAR", + .address = 0x191, + .def_val = "7 L 10 S 4 D 3 N 2 R 1 P", + .sigs = sigs_401, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x191, + .def_val = "32 L 16 S 8 D 4 N 2 R 1 P", + .sigs = sigs_401, + }, + { + .name = "EPB_STATE", + .address = 0x1C2, + .def_val = "3 ENGAGED 2 DISENGAGING 1 ENGAGING 0 DISENGAGED", + .sigs = sigs_450, + }, + { + .name = "AEB_STATUS", + .address = 0x1FA, + .def_val = "3 AEB_PREPARE 2 AEB_READY 1 AEB_BRAKING 0 NO_AEB", + .sigs = sigs_506, + }, + { + .name = "CHIME", + .address = 0x1FA, + .def_val = "4 DOUBLE_CHIME 3 SINGLE_CHIME 2 CONTINUOUS_CHIME 1 REPEATING_CHIME 0 NO_CHIME", + .sigs = sigs_506, + }, + { + .name = "FCW", + .address = 0x1FA, + .def_val = "3 FCW 2 FCW 1 FCW 0 NO_FCW", + .sigs = sigs_506, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "ECON_ON_2", + .address = 0x221, + .def_val = "0 OFF 3 ON", + .sigs = sigs_545, + }, + { + .name = "CRUISE_BUTTONS", + .address = 0x296, + .def_val = "7 TBD 6 TBD 5 TBD 4 ACCEL_RES 3 DECEL_SET 2 CANCEL 1 MAIN 0 NONE", + .sigs = sigs_662, + }, + { + .name = "CRUISE_SETTING", + .address = 0x296, + .def_val = "3 DISTANCE_ADJ 2 TBD 1 LKAS_BUTTON 0 NONE", + .sigs = sigs_662, + }, + { + .name = "CRUISE_SPEED", + .address = 0x30C, + .def_val = "255 NO_SPEED 252 STOPPED", + .sigs = sigs_780, + }, + { + .name = "HUD_LEAD", + .address = 0x30C, + .def_val = "3 ACC_OFF 2 SOLID_CAR 1 DASHED_CAR 0 NO_CAR", + .sigs = sigs_780, + }, + { + .name = "CMBS_BUTTON", + .address = 0x326, + .def_val = "3 PRESSED 0 RELEASED", + .sigs = sigs_806, + }, + { + .name = "BEEP", + .address = 0x33D, + .def_val = "3 SINGLE_BEEP 2 TRIPLE_BEEP 1 REPEATED_BEEP 0 NO_BEEP", + .sigs = sigs_829, + }, + { + .name = "DASHBOARD_ALERT", + .address = 0x374, + .def_val = "0 NONE 51 ACC_PROBLEM 55 CMBS_PROBLEM 75 KEY_NOT_DETECTED 79 FASTEN_SEATBELT 111 LKAS_PROBLEM 131 BRAKE_SYSTEM_PROBLEM 132 BRAKE_HOLD_PROBLEM 139 TBD 161 DOOR_OPEN", + .sigs = sigs_884, + }, + { + .name = "WIPERS", + .address = 0x37B, + .def_val = "4 HIGH 2 LOW 0 OFF", + .sigs = sigs_891, + }, + { + .name = "ACC_ALERTS", + .address = 0x39F, + .def_val = "29 ESP_ACTIVE_ACC_CANCELED 10 B_PEDAL_APPLIED 9 SPEED_TOO_LOW 8 SPEED_TOO_HIGH 7 P_BRAKE_APPLIED 6 GEAR_NO_D 5 SEATBELT 4 TOO_STEEP_DOWNHILL 3 TOO_STEEP_UPHILL 2 TOO_CLOSE 1 NO_VEHICLE_AHEAD", + .sigs = sigs_927, + }, +}; + +} + +const DBC honda_civic_touring_2016_can_generated = { + .name = "honda_civic_touring_2016_can_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(honda_civic_touring_2016_can_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/honda_crv_ex_2017_body_generated.cc b/opendbc/can/dbc_out/honda_crv_ex_2017_body_generated.cc new file mode 100644 index 000000000..790028a57 --- /dev/null +++ b/opendbc/can/dbc_out/honda_crv_ex_2017_body_generated.cc @@ -0,0 +1,96 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_318291615[] = { + { + .name = "BSM_ALERT", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BSM_MODE", + .b1 = 1, + .b2 = 2, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_318291879[] = { + { + .name = "BSM_ALERT", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BSM_MODE", + .b1 = 1, + .b2 = 2, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "BSM_STATUS_LEFT", + .address = 0x12F8BE9F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_318291615), + .sigs = sigs_318291615, + }, + { + .name = "BSM_STATUS_RIGHT", + .address = 0x12F8BFA7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_318291879), + .sigs = sigs_318291879, + }, +}; + +const Val vals[] = { + { + .name = "BSM_MODE", + .address = 0x12F8BE9F, + .def_val = "2 BLIND_SPOT 1 CROSS_TRAFFIC 0 OFF", + .sigs = sigs_318291615, + }, + { + .name = "BSM_MODE", + .address = 0x12F8BFA7, + .def_val = "2 BLIND_SPOT 1 CROSS_TRAFFIC 0 OFF", + .sigs = sigs_318291879, + }, +}; + +} + +const DBC honda_crv_ex_2017_body_generated = { + .name = "honda_crv_ex_2017_body_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(honda_crv_ex_2017_body_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/honda_crv_ex_2017_can_generated.cc b/opendbc/can/dbc_out/honda_crv_ex_2017_can_generated.cc new file mode 100644 index 000000000..b0f3f40a9 --- /dev/null +++ b/opendbc/can/dbc_out/honda_crv_ex_2017_can_generated.cc @@ -0,0 +1,4381 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_148[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = -0.035, + .offset = 17.92, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 30, + .b2 = 10, + .bo = 24, + .is_signed = false, + .factor = -0.035, + .offset = 17.92, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_228[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_REQUEST", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_DOWN_TO_ZERO", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_229[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X04", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X80", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_232[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 14, + .bo = 50, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE_REQUEST", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ENGINE_TORQUE_ESTIMATE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_TORQUE_REQUEST", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_316[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_330[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_3", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_2", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_1", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_WHEEL_ANGLE", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_344[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "XMISSION_SPEED2", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_380[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PEDAL_GAS", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_SWITCH", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_17C", + .b1 = 34, + .b2 = 5, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_STATUS", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PRESSED", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2_17C", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3_17C", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE_SENSOR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONTROL_ACTIVE", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_STATUS", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONFIG_INDEX", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_401[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GEAR_SHIFTER", + .b1 = 2, + .b2 = 6, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_420[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "USER_BRAKE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.015625, + .offset = -1.609375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKING", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_DISABLED", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_RELATED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_427[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "MOTOR_TORQUE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONFIG_VALID", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OUTPUT_DISABLED", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_432[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_ERROR_2", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_1", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEELS_MOVING", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_446[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_450[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "EPB_ACTIVE", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_STATE", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_464[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 15, + .b2 = 15, + .bo = 34, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 30, + .b2 = 15, + .bo = 19, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 45, + .b2 = 15, + .bo = 4, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_479[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_0", + .b1 = 19, + .b2 = 5, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONTROL_ON", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_COMMAND", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_STATUS", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_REQUEST", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL_RELEASE", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_PREPARE", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_BRAKING", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_490[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_495[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_TO_3", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONTROL_ON", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_FF", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_75", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_30", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH2", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_545[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ECON_ON", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DRIVE_MODE", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_576[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_577[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_579[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_580[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_582[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_583[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_585[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_586[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_597[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_COUNTER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_662[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SETTING", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_BUTTONS", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_773[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SEATBELT_DRIVER_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_UNLATCHED", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_LATCHED", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_OFF", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED_3", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOCK_STATUS", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_780[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = false, + .factor = 0.002759506, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE_MINI_CAR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_OBSTRUCTED", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_PROBLEM", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_1", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_PROBLEM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC_MODE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_LABEL", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_5", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_4", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_3", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_LEAD", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_6", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ON", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X1", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_804[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "HUD_SPEED_KPH", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_SPEED_MPH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_FUEL_CONSUMED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED_PCM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_806[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DRIVERS_DOOR_OPEN", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CMBS_STATES", + .b1 = 17, + .b2 = 2, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_829[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X48", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_862[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 50, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH_2", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGHBEAMS_ON", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGHBEAMS_ACTIVE", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DASHBOARD_ALERT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_FLASH", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HEADLIGHTS", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_HOLD", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_SWITCH", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HEADLIGHTS_ON", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_891[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAMS", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAMS", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_LIGHTS", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_927[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH2", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CMBS_OFF", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_1", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ALERTS", + .b1 = 19, + .b2 = 5, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RESUME_INSTRUCTION", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_0", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "APPLY_BRAKES_FOR_CANC", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH3", + .b1 = 24, + .b2 = 32, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1029[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRUNK_OPEN", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1302[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ODOMETER", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_13274[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_13275[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "KINEMATICS", + .address = 0x94, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_148), + .sigs = sigs_148, + }, + { + .name = "STEERING_CONTROL", + .address = 0xE4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_228), + .sigs = sigs_228, + }, + { + .name = "BOSCH_SUPPLEMENTAL_1", + .address = 0xE5, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_229), + .sigs = sigs_229, + }, + { + .name = "BRAKE_HOLD", + .address = 0xE8, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_232), + .sigs = sigs_232, + }, + { + .name = "GAS_PEDAL_2", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "GAS_PEDAL", + .address = 0x13C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_316), + .sigs = sigs_316, + }, + { + .name = "STEERING_SENSORS", + .address = 0x14A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_330), + .sigs = sigs_330, + }, + { + .name = "ENGINE_DATA", + .address = 0x158, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_344), + .sigs = sigs_344, + }, + { + .name = "POWERTRAIN_DATA", + .address = 0x17C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_380), + .sigs = sigs_380, + }, + { + .name = "STEER_STATUS", + .address = 0x18F, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "GEARBOX", + .address = 0x191, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_401), + .sigs = sigs_401, + }, + { + .name = "VSA_STATUS", + .address = 0x1A4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_420), + .sigs = sigs_420, + }, + { + .name = "STEER_MOTOR_TORQUE", + .address = 0x1AB, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_427), + .sigs = sigs_427, + }, + { + .name = "STANDSTILL", + .address = 0x1B0, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_432), + .sigs = sigs_432, + }, + { + .name = "BRAKE_MODULE", + .address = 0x1BE, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_446), + .sigs = sigs_446, + }, + { + .name = "EPB_STATUS", + .address = 0x1C2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_450), + .sigs = sigs_450, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x1D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_464), + .sigs = sigs_464, + }, + { + .name = "ACC_CONTROL", + .address = 0x1DF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_479), + .sigs = sigs_479, + }, + { + .name = "VEHICLE_DYNAMICS", + .address = 0x1EA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_490), + .sigs = sigs_490, + }, + { + .name = "ACC_CONTROL_ON", + .address = 0x1EF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_495), + .sigs = sigs_495, + }, + { + .name = "XXX_16", + .address = 0x221, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_545), + .sigs = sigs_545, + }, + { + .name = "LEFT_LANE_LINE_1", + .address = 0x240, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_576), + .sigs = sigs_576, + }, + { + .name = "LEFT_LANE_LINE_2", + .address = 0x241, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_577), + .sigs = sigs_577, + }, + { + .name = "RIGHT_LANE_LINE_1", + .address = 0x243, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_579), + .sigs = sigs_579, + }, + { + .name = "RIGHT_LANE_LINE_2", + .address = 0x244, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_580), + .sigs = sigs_580, + }, + { + .name = "ADJACENT_LEFT_LANE_LINE_1", + .address = 0x246, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_582), + .sigs = sigs_582, + }, + { + .name = "ADJACENT_LEFT_LANE_LINE_2", + .address = 0x247, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_583), + .sigs = sigs_583, + }, + { + .name = "ADJACENT_RIGHT_LANE_LINE_1", + .address = 0x249, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_585), + .sigs = sigs_585, + }, + { + .name = "ADJACENT_RIGHT_LANE_LINE_2", + .address = 0x24A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_586), + .sigs = sigs_586, + }, + { + .name = "ROUGH_WHEEL_SPEED", + .address = 0x255, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_597), + .sigs = sigs_597, + }, + { + .name = "SCM_BUTTONS", + .address = 0x296, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_662), + .sigs = sigs_662, + }, + { + .name = "SEATBELT_STATUS", + .address = 0x305, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_773), + .sigs = sigs_773, + }, + { + .name = "CAR_SPEED", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "ACC_HUD", + .address = 0x30C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_780), + .sigs = sigs_780, + }, + { + .name = "CRUISE", + .address = 0x324, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_804), + .sigs = sigs_804, + }, + { + .name = "SCM_FEEDBACK", + .address = 0x326, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_806), + .sigs = sigs_806, + }, + { + .name = "LKAS_HUD", + .address = 0x33D, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_829), + .sigs = sigs_829, + }, + { + .name = "CAMERA_MESSAGES", + .address = 0x35E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_862), + .sigs = sigs_862, + }, + { + .name = "STALK_STATUS", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "STALK_STATUS_2", + .address = 0x37B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_891), + .sigs = sigs_891, + }, + { + .name = "RADAR_HUD", + .address = 0x39F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_927), + .sigs = sigs_927, + }, + { + .name = "DOORS_STATUS", + .address = 0x405, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1029), + .sigs = sigs_1029, + }, + { + .name = "ODOMETER", + .address = 0x516, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1302), + .sigs = sigs_1302, + }, + { + .name = "LKAS_HUD_A", + .address = 0x33DA, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_13274), + .sigs = sigs_13274, + }, + { + .name = "LKAS_HUD_B", + .address = 0x33DB, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_13275), + .sigs = sigs_13275, + }, +}; + +const Val vals[] = { + { + .name = "STEER_STATUS", + .address = 0x18F, + .def_val = "6 TMP_FAULT 5 FAULT_1 4 NO_TORQUE_ALERT_2 3 LOW_SPEED_LOCKOUT 2 NO_TORQUE_ALERT_1 0 NORMAL", + .sigs = sigs_399, + }, + { + .name = "GEAR", + .address = 0x191, + .def_val = "7 L 10 S 4 D 3 N 2 R 1 P", + .sigs = sigs_401, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x191, + .def_val = "32 L 16 S 8 D 4 N 2 R 1 P", + .sigs = sigs_401, + }, + { + .name = "ECON_ON_2", + .address = 0x221, + .def_val = "0 OFF 3 ON", + .sigs = sigs_545, + }, + { + .name = "CRUISE_BUTTONS", + .address = 0x296, + .def_val = "7 TBD 6 TBD 5 TBD 4 ACCEL_RES 3 DECEL_SET 2 CANCEL 1 MAIN 0 NONE", + .sigs = sigs_662, + }, + { + .name = "CRUISE_SETTING", + .address = 0x296, + .def_val = "3 DISTANCE_ADJ 2 TBD 1 LKAS_BUTTON 0 NONE", + .sigs = sigs_662, + }, + { + .name = "CMBS_BUTTON", + .address = 0x326, + .def_val = "3 PRESSED 0 RELEASED", + .sigs = sigs_806, + }, + { + .name = "BEEP", + .address = 0x33D, + .def_val = "3 SINGLE_BEEP 2 TRIPLE_BEEP 1 REPEATED_BEEP 0 NO_BEEP", + .sigs = sigs_829, + }, + { + .name = "DASHBOARD_ALERT", + .address = 0x374, + .def_val = "0 NONE 51 ACC_PROBLEM 55 CMBS_PROBLEM 75 KEY_NOT_DETECTED 79 FASTEN_SEATBELT 111 LKAS_PROBLEM 131 BRAKE_SYSTEM_PROBLEM 132 BRAKE_HOLD_PROBLEM 139 TBD 161 DOOR_OPEN", + .sigs = sigs_884, + }, + { + .name = "WIPERS", + .address = 0x37B, + .def_val = "4 HIGH 2 LOW 0 OFF", + .sigs = sigs_891, + }, +}; + +} + +const DBC honda_crv_ex_2017_can_generated = { + .name = "honda_crv_ex_2017_can_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(honda_crv_ex_2017_can_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/honda_crv_executive_2016_can_generated.cc b/opendbc/can/dbc_out/honda_crv_executive_2016_can_generated.cc new file mode 100644 index 000000000..7f6473c9c --- /dev/null +++ b/opendbc/can/dbc_out/honda_crv_executive_2016_can_generated.cc @@ -0,0 +1,2838 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_145[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_148[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 31, + .b2 = 9, + .bo = 24, + .is_signed = true, + .factor = -0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ENGINE_TORQUE_ESTIMATE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_TORQUE_REQUEST", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_316[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_342[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_344[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "XMISSION_SPEED2", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_380[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PEDAL_GAS", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_SWITCH", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_17C", + .b1 = 34, + .b2 = 5, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_STATUS", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PRESSED", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2_17C", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3_17C", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE_SENSOR", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_MOTOR", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_STATUS", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONTROL_ACTIVE", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_404[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_REQUEST", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_419[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GEAR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR_SHIFTER", + .b1 = 26, + .b2 = 6, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_420[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "USER_BRAKE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.015625, + .offset = -1.609375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKING", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_DISABLED", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_RELATED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_422[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LIGHTS_SETTING", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_BUTTONS", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SETTING", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_427[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "MOTOR_TORQUE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONFIG_VALID", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OUTPUT_DISABLED", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_432[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CONTROLLED_STANDSTILL", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_2", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_1", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEELS_MOVING", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_464[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 15, + .b2 = 15, + .bo = 34, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 30, + .b2 = 15, + .bo = 19, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 45, + .b2 = 15, + .bo = 4, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_487[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_PRESSURE1", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSURE2", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_490[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_506[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "COMPUTER_BRAKE", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PUMP_REQUEST", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 10, + .b2 = 5, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE_REQUEST", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CANCEL_CMD", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_FAULT_CMD", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_3", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_OVERRIDE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_2", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_1", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATES", + .b1 = 33, + .b2 = 7, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_STATUS", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCW", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_4", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_5", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_597[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_660[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS_SPEED", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_773[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SEATBELT_DRIVER_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_UNLATCHED", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_LATCHED", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_OFF", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOORS_UNLOCKED", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOORS_LOCKED", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_780[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PCM_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCM_GAS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE_MINI_CAR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_OBSTRUCTED", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_PROBLEM", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF_2", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_PROBLEM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC_MODE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_LABEL", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_5", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_4", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_3", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_LEAD", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 52, + .b2 = 3, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE_3", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01_2", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ICONS", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_804[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "HUD_SPEED_KPH", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_SPEED_MPH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_FUEL_CONSUMED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED_PCM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_829[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X48", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DASHBOARD_ALERT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_FLASH", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HEADLIGHTS", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_HOLD", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_SWITCH", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HEADLIGHTS_ON", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_891[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAMS", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAMS", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_LIGHTS", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_892[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SPEED_OFFSET", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1029[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRUNK_OPEN", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "KINEMATICS", + .address = 0x91, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_145), + .sigs = sigs_145, + }, + { + .name = "KINEMATICS_ALT", + .address = 0x94, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_148), + .sigs = sigs_148, + }, + { + .name = "GAS_PEDAL_2", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "GAS_PEDAL", + .address = 0x13C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_316), + .sigs = sigs_316, + }, + { + .name = "STEERING_SENSORS", + .address = 0x156, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_342), + .sigs = sigs_342, + }, + { + .name = "ENGINE_DATA", + .address = 0x158, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_344), + .sigs = sigs_344, + }, + { + .name = "POWERTRAIN_DATA", + .address = 0x17C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_380), + .sigs = sigs_380, + }, + { + .name = "STEER_STATUS", + .address = 0x18F, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "STEERING_CONTROL", + .address = 0x194, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_404), + .sigs = sigs_404, + }, + { + .name = "GEARBOX", + .address = 0x1A3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_419), + .sigs = sigs_419, + }, + { + .name = "VSA_STATUS", + .address = 0x1A4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_420), + .sigs = sigs_420, + }, + { + .name = "SCM_BUTTONS", + .address = 0x1A6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_422), + .sigs = sigs_422, + }, + { + .name = "STEER_MOTOR_TORQUE", + .address = 0x1AB, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_427), + .sigs = sigs_427, + }, + { + .name = "STANDSTILL", + .address = 0x1B0, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_432), + .sigs = sigs_432, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x1D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_464), + .sigs = sigs_464, + }, + { + .name = "BRAKE_PRESSURE", + .address = 0x1E7, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_487), + .sigs = sigs_487, + }, + { + .name = "VEHICLE_DYNAMICS", + .address = 0x1EA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_490), + .sigs = sigs_490, + }, + { + .name = "BRAKE_COMMAND", + .address = 0x1FA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_506), + .sigs = sigs_506, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "ROUGH_WHEEL_SPEED", + .address = 0x255, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_597), + .sigs = sigs_597, + }, + { + .name = "SCM_FEEDBACK", + .address = 0x294, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_660), + .sigs = sigs_660, + }, + { + .name = "SEATBELT_STATUS", + .address = 0x305, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_773), + .sigs = sigs_773, + }, + { + .name = "LOCK_STATUS", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "ACC_HUD", + .address = 0x30C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_780), + .sigs = sigs_780, + }, + { + .name = "CRUISE", + .address = 0x324, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_804), + .sigs = sigs_804, + }, + { + .name = "LKAS_HUD", + .address = 0x33D, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_829), + .sigs = sigs_829, + }, + { + .name = "STALK_STATUS", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "STALK_STATUS_2", + .address = 0x37B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_891), + .sigs = sigs_891, + }, + { + .name = "CRUISE_PARAMS", + .address = 0x37C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_892), + .sigs = sigs_892, + }, + { + .name = "DOORS_STATUS", + .address = 0x405, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1029), + .sigs = sigs_1029, + }, +}; + +const Val vals[] = { + { + .name = "STEER_STATUS", + .address = 0x18F, + .def_val = "6 TMP_FAULT 5 FAULT_1 4 NO_TORQUE_ALERT_2 3 LOW_SPEED_LOCKOUT 2 NO_TORQUE_ALERT_1 0 NORMAL", + .sigs = sigs_399, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x1A3, + .def_val = " 32 D 8 R 4 P", + .sigs = sigs_419, + }, + { + .name = "CRUISE_BUTTONS", + .address = 0x1A6, + .def_val = "7 TBD 6 TBD 5 TBD 4 ACCEL_RES 3 DECEL_SET 2 CANCEL 1 MAIN 0 NONE", + .sigs = sigs_422, + }, + { + .name = "CRUISE_SETTING", + .address = 0x1A6, + .def_val = "3 DISTANCE_ADJ 2 TBD 1 LKAS_BUTTON 0 NONE", + .sigs = sigs_422, + }, + { + .name = "LIGHTS_SETTING", + .address = 0x1A6, + .def_val = "3 HIGH_BEAM 2 LOW_BEAM 1 POSITION 0 NO_LIGHTS", + .sigs = sigs_422, + }, + { + .name = "AEB_STATUS", + .address = 0x1FA, + .def_val = "3 AEB_PREPARE 2 AEB_READY 1 AEB_BRAKING 0 NO_AEB", + .sigs = sigs_506, + }, + { + .name = "CHIME", + .address = 0x1FA, + .def_val = "4 DOUBLE_CHIME 3 SINGLE_CHIME 2 CONTINUOUS_CHIME 1 REPEATING_CHIME 0 NO_CHIME", + .sigs = sigs_506, + }, + { + .name = "FCW", + .address = 0x1FA, + .def_val = "3 FCW 2 FCW 1 FCW 0 NO_FCW", + .sigs = sigs_506, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "CRUISE_SPEED", + .address = 0x30C, + .def_val = "255 NO_SPEED 252 STOPPED", + .sigs = sigs_780, + }, + { + .name = "HUD_LEAD", + .address = 0x30C, + .def_val = "3 ACC_OFF 2 SOLID_CAR 1 DASHED_CAR 0 NO_CAR", + .sigs = sigs_780, + }, + { + .name = "BEEP", + .address = 0x33D, + .def_val = "3 SINGLE_BEEP 2 TRIPLE_BEEP 1 REPEATED_BEEP 0 NO_BEEP", + .sigs = sigs_829, + }, + { + .name = "DASHBOARD_ALERT", + .address = 0x374, + .def_val = "0 NONE 51 ACC_PROBLEM 55 CMBS_PROBLEM 75 KEY_NOT_DETECTED 79 FASTEN_SEATBELT 111 LKAS_PROBLEM 131 BRAKE_SYSTEM_PROBLEM 132 BRAKE_HOLD_PROBLEM 139 TBD 161 DOOR_OPEN", + .sigs = sigs_884, + }, + { + .name = "WIPERS", + .address = 0x37B, + .def_val = "4 HIGH 2 LOW 0 OFF", + .sigs = sigs_891, + }, +}; + +} + +const DBC honda_crv_executive_2016_can_generated = { + .name = "honda_crv_executive_2016_can_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(honda_crv_executive_2016_can_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/honda_crv_touring_2016_can_generated.cc b/opendbc/can/dbc_out/honda_crv_touring_2016_can_generated.cc new file mode 100644 index 000000000..c7f4244b9 --- /dev/null +++ b/opendbc/can/dbc_out/honda_crv_touring_2016_can_generated.cc @@ -0,0 +1,2844 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_145[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_148[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 31, + .b2 = 9, + .bo = 24, + .is_signed = true, + .factor = -0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ENGINE_TORQUE_ESTIMATE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_TORQUE_REQUEST", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_316[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_342[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_344[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "XMISSION_SPEED2", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_380[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PEDAL_GAS", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_SWITCH", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_17C", + .b1 = 34, + .b2 = 5, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_STATUS", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PRESSED", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2_17C", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3_17C", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE_SENSOR", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_STATUS", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONTROL_ACTIVE", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_401[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GEAR_SHIFTER", + .b1 = 2, + .b2 = 6, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_404[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_REQUEST", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_420[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "USER_BRAKE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.015625, + .offset = -1.609375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKING", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_DISABLED", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_RELATED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_422[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LIGHTS_SETTING", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_BUTTONS", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SETTING", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_427[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "MOTOR_TORQUE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONFIG_VALID", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OUTPUT_DISABLED", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_432[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CONTROLLED_STANDSTILL", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_2", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_1", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEELS_MOVING", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_464[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 15, + .b2 = 15, + .bo = 34, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 30, + .b2 = 15, + .bo = 19, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 45, + .b2 = 15, + .bo = 4, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_487[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_PRESSURE1", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSURE2", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_490[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_506[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "COMPUTER_BRAKE", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PUMP_REQUEST", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 10, + .b2 = 5, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE_REQUEST", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CANCEL_CMD", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_FAULT_CMD", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_3", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_OVERRIDE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_2", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_1", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATES", + .b1 = 33, + .b2 = 7, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_STATUS", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCW", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_4", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_5", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_597[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_660[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS_SPEED", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_773[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SEATBELT_DRIVER_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_UNLATCHED", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_LATCHED", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_OFF", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOORS_UNLOCKED", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOORS_LOCKED", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_780[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PCM_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCM_GAS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE_MINI_CAR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_OBSTRUCTED", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_PROBLEM", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF_2", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_PROBLEM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC_MODE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_LABEL", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_5", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_4", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_3", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_LEAD", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 52, + .b2 = 3, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE_3", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01_2", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ICONS", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_804[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "HUD_SPEED_KPH", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_SPEED_MPH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_FUEL_CONSUMED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED_PCM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_829[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X48", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DASHBOARD_ALERT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_FLASH", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HEADLIGHTS", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_HOLD", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_SWITCH", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HEADLIGHTS_ON", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_891[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAMS", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAMS", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_LIGHTS", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_892[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SPEED_OFFSET", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1029[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRUNK_OPEN", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "KINEMATICS", + .address = 0x91, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_145), + .sigs = sigs_145, + }, + { + .name = "KINEMATICS_ALT", + .address = 0x94, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_148), + .sigs = sigs_148, + }, + { + .name = "GAS_PEDAL_2", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "GAS_PEDAL", + .address = 0x13C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_316), + .sigs = sigs_316, + }, + { + .name = "STEERING_SENSORS", + .address = 0x156, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_342), + .sigs = sigs_342, + }, + { + .name = "ENGINE_DATA", + .address = 0x158, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_344), + .sigs = sigs_344, + }, + { + .name = "POWERTRAIN_DATA", + .address = 0x17C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_380), + .sigs = sigs_380, + }, + { + .name = "STEER_STATUS", + .address = 0x18F, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "GEARBOX", + .address = 0x191, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_401), + .sigs = sigs_401, + }, + { + .name = "STEERING_CONTROL", + .address = 0x194, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_404), + .sigs = sigs_404, + }, + { + .name = "VSA_STATUS", + .address = 0x1A4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_420), + .sigs = sigs_420, + }, + { + .name = "SCM_BUTTONS", + .address = 0x1A6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_422), + .sigs = sigs_422, + }, + { + .name = "STEER_MOTOR_TORQUE", + .address = 0x1AB, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_427), + .sigs = sigs_427, + }, + { + .name = "STANDSTILL", + .address = 0x1B0, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_432), + .sigs = sigs_432, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x1D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_464), + .sigs = sigs_464, + }, + { + .name = "BRAKE_PRESSURE", + .address = 0x1E7, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_487), + .sigs = sigs_487, + }, + { + .name = "VEHICLE_DYNAMICS", + .address = 0x1EA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_490), + .sigs = sigs_490, + }, + { + .name = "BRAKE_COMMAND", + .address = 0x1FA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_506), + .sigs = sigs_506, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "ROUGH_WHEEL_SPEED", + .address = 0x255, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_597), + .sigs = sigs_597, + }, + { + .name = "SCM_FEEDBACK", + .address = 0x294, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_660), + .sigs = sigs_660, + }, + { + .name = "SEATBELT_STATUS", + .address = 0x305, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_773), + .sigs = sigs_773, + }, + { + .name = "LOCK_STATUS", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "ACC_HUD", + .address = 0x30C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_780), + .sigs = sigs_780, + }, + { + .name = "CRUISE", + .address = 0x324, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_804), + .sigs = sigs_804, + }, + { + .name = "LKAS_HUD", + .address = 0x33D, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_829), + .sigs = sigs_829, + }, + { + .name = "STALK_STATUS", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "STALK_STATUS_2", + .address = 0x37B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_891), + .sigs = sigs_891, + }, + { + .name = "CRUISE_PARAMS", + .address = 0x37C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_892), + .sigs = sigs_892, + }, + { + .name = "DOORS_STATUS", + .address = 0x405, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1029), + .sigs = sigs_1029, + }, +}; + +const Val vals[] = { + { + .name = "STEER_STATUS", + .address = 0x18F, + .def_val = "6 TMP_FAULT 5 FAULT_1 4 NO_TORQUE_ALERT_2 3 LOW_SPEED_LOCKOUT 2 NO_TORQUE_ALERT_1 0 NORMAL", + .sigs = sigs_399, + }, + { + .name = "GEAR", + .address = 0x191, + .def_val = "7 L 10 S 4 D 3 N 2 R 1 P", + .sigs = sigs_401, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x191, + .def_val = "32 L 16 S 8 D 4 N 2 R 1 P", + .sigs = sigs_401, + }, + { + .name = "CRUISE_BUTTONS", + .address = 0x1A6, + .def_val = "7 TBD 6 TBD 5 TBD 4 ACCEL_RES 3 DECEL_SET 2 CANCEL 1 MAIN 0 NONE", + .sigs = sigs_422, + }, + { + .name = "CRUISE_SETTING", + .address = 0x1A6, + .def_val = "3 DISTANCE_ADJ 2 TBD 1 LKAS_BUTTON 0 NONE", + .sigs = sigs_422, + }, + { + .name = "LIGHTS_SETTING", + .address = 0x1A6, + .def_val = "3 HIGH_BEAM 2 LOW_BEAM 1 POSITION 0 NO_LIGHTS", + .sigs = sigs_422, + }, + { + .name = "AEB_STATUS", + .address = 0x1FA, + .def_val = "3 AEB_PREPARE 2 AEB_READY 1 AEB_BRAKING 0 NO_AEB", + .sigs = sigs_506, + }, + { + .name = "CHIME", + .address = 0x1FA, + .def_val = "4 DOUBLE_CHIME 3 SINGLE_CHIME 2 CONTINUOUS_CHIME 1 REPEATING_CHIME 0 NO_CHIME", + .sigs = sigs_506, + }, + { + .name = "FCW", + .address = 0x1FA, + .def_val = "3 FCW 2 FCW 1 FCW 0 NO_FCW", + .sigs = sigs_506, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "CRUISE_SPEED", + .address = 0x30C, + .def_val = "255 NO_SPEED 252 STOPPED", + .sigs = sigs_780, + }, + { + .name = "HUD_LEAD", + .address = 0x30C, + .def_val = "3 ACC_OFF 2 SOLID_CAR 1 DASHED_CAR 0 NO_CAR", + .sigs = sigs_780, + }, + { + .name = "BEEP", + .address = 0x33D, + .def_val = "3 SINGLE_BEEP 2 TRIPLE_BEEP 1 REPEATED_BEEP 0 NO_BEEP", + .sigs = sigs_829, + }, + { + .name = "DASHBOARD_ALERT", + .address = 0x374, + .def_val = "0 NONE 51 ACC_PROBLEM 55 CMBS_PROBLEM 75 KEY_NOT_DETECTED 79 FASTEN_SEATBELT 111 LKAS_PROBLEM 131 BRAKE_SYSTEM_PROBLEM 132 BRAKE_HOLD_PROBLEM 139 TBD 161 DOOR_OPEN", + .sigs = sigs_884, + }, + { + .name = "WIPERS", + .address = 0x37B, + .def_val = "4 HIGH 2 LOW 0 OFF", + .sigs = sigs_891, + }, +}; + +} + +const DBC honda_crv_touring_2016_can_generated = { + .name = "honda_crv_touring_2016_can_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(honda_crv_touring_2016_can_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/honda_fit_ex_2018_can_generated.cc b/opendbc/can/dbc_out/honda_fit_ex_2018_can_generated.cc new file mode 100644 index 000000000..79eb68237 --- /dev/null +++ b/opendbc/can/dbc_out/honda_fit_ex_2018_can_generated.cc @@ -0,0 +1,2941 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_145[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_148[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 31, + .b2 = 9, + .bo = 24, + .is_signed = true, + .factor = -0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_228[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_REQUEST", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ENGINE_TORQUE_ESTIMATE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_TORQUE_REQUEST", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_316[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_342[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_344[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "XMISSION_SPEED2", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_380[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PEDAL_GAS", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_SWITCH", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_17C", + .b1 = 34, + .b2 = 5, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_STATUS", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PRESSED", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2_17C", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3_17C", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE_SENSOR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONTROL_ACTIVE", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_STATUS", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONFIG_INDEX", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_401[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GEAR_SHIFTER", + .b1 = 2, + .b2 = 6, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_420[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "USER_BRAKE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.015625, + .offset = -1.609375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKING", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_DISABLED", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_RELATED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_422[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LIGHTS_SETTING", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_BUTTONS", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SETTING", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DRIVERS_DOOR_OPEN", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_427[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "MOTOR_TORQUE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONFIG_VALID", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OUTPUT_DISABLED", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_432[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CONTROLLED_STANDSTILL", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_2", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_1", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEELS_MOVING", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_464[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 15, + .b2 = 15, + .bo = 34, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 30, + .b2 = 15, + .bo = 19, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 45, + .b2 = 15, + .bo = 4, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_487[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_PRESSURE1", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSURE2", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_490[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_506[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "COMPUTER_BRAKE", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PUMP_REQUEST", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 10, + .b2 = 5, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE_REQUEST", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CANCEL_CMD", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_FAULT_CMD", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_3", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_OVERRIDE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_2", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_1", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATES", + .b1 = 33, + .b2 = 7, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_STATUS", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCW", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_4", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_5", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_597[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_660[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS_SPEED", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_773[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SEATBELT_DRIVER_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_UNLATCHED", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_LATCHED", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_OFF", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOORS_UNLOCKED", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOORS_LOCKED", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_780[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PCM_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCM_GAS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE_MINI_CAR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_OBSTRUCTED", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_PROBLEM", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF_2", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_PROBLEM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC_MODE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_LABEL", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_5", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_4", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_3", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_LEAD", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 52, + .b2 = 3, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE_3", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01_2", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ICONS", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_804[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "HUD_SPEED_KPH", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_SPEED_MPH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_FUEL_CONSUMED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED_PCM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_829[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X48", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_862[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 50, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH_2", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGHBEAMS_ON", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGHBEAMS_ACTIVE", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DASHBOARD_ALERT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_FLASH", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HEADLIGHTS", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_HOLD", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_SWITCH", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HEADLIGHTS_ON", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_891[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAMS", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAMS", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_LIGHTS", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_892[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SPEED_OFFSET", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1029[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRUNK_OPEN", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "KINEMATICS", + .address = 0x91, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_145), + .sigs = sigs_145, + }, + { + .name = "KINEMATICS_ALT", + .address = 0x94, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_148), + .sigs = sigs_148, + }, + { + .name = "STEERING_CONTROL", + .address = 0xE4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_228), + .sigs = sigs_228, + }, + { + .name = "GAS_PEDAL_2", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "GAS_PEDAL", + .address = 0x13C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_316), + .sigs = sigs_316, + }, + { + .name = "STEERING_SENSORS", + .address = 0x156, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_342), + .sigs = sigs_342, + }, + { + .name = "ENGINE_DATA", + .address = 0x158, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_344), + .sigs = sigs_344, + }, + { + .name = "POWERTRAIN_DATA", + .address = 0x17C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_380), + .sigs = sigs_380, + }, + { + .name = "STEER_STATUS", + .address = 0x18F, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "GEARBOX", + .address = 0x191, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_401), + .sigs = sigs_401, + }, + { + .name = "VSA_STATUS", + .address = 0x1A4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_420), + .sigs = sigs_420, + }, + { + .name = "SCM_BUTTONS", + .address = 0x1A6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_422), + .sigs = sigs_422, + }, + { + .name = "STEER_MOTOR_TORQUE", + .address = 0x1AB, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_427), + .sigs = sigs_427, + }, + { + .name = "STANDSTILL", + .address = 0x1B0, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_432), + .sigs = sigs_432, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x1D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_464), + .sigs = sigs_464, + }, + { + .name = "BRAKE_PRESSURE", + .address = 0x1E7, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_487), + .sigs = sigs_487, + }, + { + .name = "VEHICLE_DYNAMICS", + .address = 0x1EA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_490), + .sigs = sigs_490, + }, + { + .name = "BRAKE_COMMAND", + .address = 0x1FA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_506), + .sigs = sigs_506, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "ROUGH_WHEEL_SPEED", + .address = 0x255, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_597), + .sigs = sigs_597, + }, + { + .name = "SCM_FEEDBACK", + .address = 0x294, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_660), + .sigs = sigs_660, + }, + { + .name = "SEATBELT_STATUS", + .address = 0x305, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_773), + .sigs = sigs_773, + }, + { + .name = "LOCK_STATUS", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "ACC_HUD", + .address = 0x30C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_780), + .sigs = sigs_780, + }, + { + .name = "CRUISE", + .address = 0x324, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_804), + .sigs = sigs_804, + }, + { + .name = "LKAS_HUD", + .address = 0x33D, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_829), + .sigs = sigs_829, + }, + { + .name = "HIGHBEAM_CONTROL", + .address = 0x35E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_862), + .sigs = sigs_862, + }, + { + .name = "STALK_STATUS", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "STALK_STATUS_2", + .address = 0x37B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_891), + .sigs = sigs_891, + }, + { + .name = "CRUISE_PARAMS", + .address = 0x37C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_892), + .sigs = sigs_892, + }, + { + .name = "DOORS_STATUS", + .address = 0x405, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1029), + .sigs = sigs_1029, + }, +}; + +const Val vals[] = { + { + .name = "STEER_STATUS", + .address = 0x18F, + .def_val = "6 TMP_FAULT 5 FAULT_1 4 NO_TORQUE_ALERT_2 3 LOW_SPEED_LOCKOUT 2 NO_TORQUE_ALERT_1 0 NORMAL", + .sigs = sigs_399, + }, + { + .name = "GEAR", + .address = 0x191, + .def_val = "7 L 10 S 4 D 3 N 2 R 1 P", + .sigs = sigs_401, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x191, + .def_val = "32 L 16 S 8 D 4 N 2 R 1 P", + .sigs = sigs_401, + }, + { + .name = "CRUISE_BUTTONS", + .address = 0x1A6, + .def_val = "7 TBD 6 TBD 5 TBD 4 ACCEL_RES 3 DECEL_SET 2 CANCEL 1 MAIN 0 NONE", + .sigs = sigs_422, + }, + { + .name = "CRUISE_SETTING", + .address = 0x1A6, + .def_val = "3 DISTANCE_ADJ 2 TBD 1 LKAS_BUTTON 0 NONE", + .sigs = sigs_422, + }, + { + .name = "LIGHTS_SETTING", + .address = 0x1A6, + .def_val = "3 HIGH_BEAM 2 LOW_BEAM 1 POSITION 0 NO_LIGHTS", + .sigs = sigs_422, + }, + { + .name = "AEB_STATUS", + .address = 0x1FA, + .def_val = "3 AEB_PREPARE 2 AEB_READY 1 AEB_BRAKING 0 NO_AEB", + .sigs = sigs_506, + }, + { + .name = "CHIME", + .address = 0x1FA, + .def_val = "4 DOUBLE_CHIME 3 SINGLE_CHIME 2 CONTINUOUS_CHIME 1 REPEATING_CHIME 0 NO_CHIME", + .sigs = sigs_506, + }, + { + .name = "FCW", + .address = 0x1FA, + .def_val = "3 FCW 2 FCW 1 FCW 0 NO_FCW", + .sigs = sigs_506, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "CRUISE_SPEED", + .address = 0x30C, + .def_val = "255 NO_SPEED 252 STOPPED", + .sigs = sigs_780, + }, + { + .name = "HUD_LEAD", + .address = 0x30C, + .def_val = "3 ACC_OFF 2 SOLID_CAR 1 DASHED_CAR 0 NO_CAR", + .sigs = sigs_780, + }, + { + .name = "BEEP", + .address = 0x33D, + .def_val = "3 SINGLE_BEEP 2 TRIPLE_BEEP 1 REPEATED_BEEP 0 NO_BEEP", + .sigs = sigs_829, + }, + { + .name = "DASHBOARD_ALERT", + .address = 0x374, + .def_val = "0 NONE 51 ACC_PROBLEM 55 CMBS_PROBLEM 75 KEY_NOT_DETECTED 79 FASTEN_SEATBELT 111 LKAS_PROBLEM 131 BRAKE_SYSTEM_PROBLEM 132 BRAKE_HOLD_PROBLEM 139 TBD 161 DOOR_OPEN", + .sigs = sigs_884, + }, + { + .name = "WIPERS", + .address = 0x37B, + .def_val = "4 HIGH 2 LOW 0 OFF", + .sigs = sigs_891, + }, +}; + +} + +const DBC honda_fit_ex_2018_can_generated = { + .name = "honda_fit_ex_2018_can_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(honda_fit_ex_2018_can_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/honda_insight_ex_2019_can_generated.cc b/opendbc/can/dbc_out/honda_insight_ex_2019_can_generated.cc new file mode 100644 index 000000000..e7f8c8f01 --- /dev/null +++ b/opendbc/can/dbc_out/honda_insight_ex_2019_can_generated.cc @@ -0,0 +1,4273 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_148[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = -0.035, + .offset = 17.92, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 30, + .b2 = 10, + .bo = 24, + .is_signed = false, + .factor = -0.035, + .offset = 17.92, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_228[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_REQUEST", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_DOWN_TO_ZERO", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_229[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X04", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X80", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_232[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 14, + .bo = 50, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE_REQUEST", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ENGINE_TORQUE_ESTIMATE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_TORQUE_REQUEST", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_316[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_330[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_3", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_2", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_SENSOR_STATUS_1", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_WHEEL_ANGLE", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_344[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "XMISSION_SPEED2", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_380[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PEDAL_GAS", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_SWITCH", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_17C", + .b1 = 34, + .b2 = 5, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_STATUS", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PRESSED", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2_17C", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3_17C", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE_SENSOR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONTROL_ACTIVE", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_STATUS", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONFIG_INDEX", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_419[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GEAR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR_SHIFTER", + .b1 = 26, + .b2 = 6, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_420[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "USER_BRAKE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.015625, + .offset = -1.609375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKING", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_DISABLED", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_RELATED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_427[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "MOTOR_TORQUE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONFIG_VALID", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OUTPUT_DISABLED", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_432[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_ERROR_2", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_1", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_450[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "EPB_ACTIVE", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_STATE", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_464[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 15, + .b2 = 15, + .bo = 34, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 30, + .b2 = 15, + .bo = 19, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 45, + .b2 = 15, + .bo = 4, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_479[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_0", + .b1 = 19, + .b2 = 5, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONTROL_ON", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_COMMAND", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_STATUS", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_REQUEST", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL_RELEASE", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_PREPARE", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_BRAKING", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_490[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_495[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_TO_3", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONTROL_ON", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_FF", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_75", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_30", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH2", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_545[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ECON_ON", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DRIVE_MODE", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_576[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_577[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_579[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_580[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_582[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_583[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_585[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LINE_ANGLE", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0005, + .offset = -1.024, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRAME_INDEX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_OFFSET", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.004, + .offset = -8.192, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DISTANCE_VISIBLE", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PROBABILITY", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 0.015625, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_586[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "FRAME_INDEX", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_SOLID", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_DASHED", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_CURVATURE", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1e-05, + .offset = -0.02048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_PARAMETER", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_FAR_EDGE_POSITION", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_597[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_COUNTER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_662[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SETTING", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_BUTTONS", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_773[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SEATBELT_DRIVER_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_UNLATCHED", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_LATCHED", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_OFF", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ROUGH_CAR_SPEED_3", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOCK_STATUS", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_780[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = false, + .factor = 0.002759506, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE_MINI_CAR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_OBSTRUCTED", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_PROBLEM", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_1", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_PROBLEM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC_MODE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_LABEL", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_5", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_4", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_3", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_LEAD", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_6", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ON", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X1", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_804[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "HUD_SPEED_KPH", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_SPEED_MPH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_FUEL_CONSUMED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED_PCM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_806[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DRIVERS_DOOR_OPEN", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CMBS_STATES", + .b1 = 17, + .b2 = 2, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_829[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X48", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_862[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 50, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH_2", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGHBEAMS_ON", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGHBEAMS_ACTIVE", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DASHBOARD_ALERT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_FLASH", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HEADLIGHTS", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_HOLD", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_SWITCH", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HEADLIGHTS_ON", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_891[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAMS", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAMS", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_LIGHTS", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_927[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH2", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CMBS_OFF", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_1", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ALERTS", + .b1 = 19, + .b2 = 5, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RESUME_INSTRUCTION", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_0", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "APPLY_BRAKES_FOR_CANC", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_64", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_DISTANCE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_LEAD", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH3", + .b1 = 40, + .b2 = 7, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH4", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1029[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRUNK_OPEN", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_13274[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_13275[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "KINEMATICS", + .address = 0x94, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_148), + .sigs = sigs_148, + }, + { + .name = "STEERING_CONTROL", + .address = 0xE4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_228), + .sigs = sigs_228, + }, + { + .name = "BOSCH_SUPPLEMENTAL_1", + .address = 0xE5, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_229), + .sigs = sigs_229, + }, + { + .name = "BRAKE_HOLD", + .address = 0xE8, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_232), + .sigs = sigs_232, + }, + { + .name = "GAS_PEDAL_2", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "GAS_PEDAL", + .address = 0x13C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_316), + .sigs = sigs_316, + }, + { + .name = "STEERING_SENSORS", + .address = 0x14A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_330), + .sigs = sigs_330, + }, + { + .name = "ENGINE_DATA", + .address = 0x158, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_344), + .sigs = sigs_344, + }, + { + .name = "POWERTRAIN_DATA", + .address = 0x17C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_380), + .sigs = sigs_380, + }, + { + .name = "STEER_STATUS", + .address = 0x18F, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "GEARBOX", + .address = 0x1A3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_419), + .sigs = sigs_419, + }, + { + .name = "VSA_STATUS", + .address = 0x1A4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_420), + .sigs = sigs_420, + }, + { + .name = "STEER_MOTOR_TORQUE", + .address = 0x1AB, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_427), + .sigs = sigs_427, + }, + { + .name = "STANDSTILL", + .address = 0x1B0, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_432), + .sigs = sigs_432, + }, + { + .name = "EPB_STATUS", + .address = 0x1C2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_450), + .sigs = sigs_450, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x1D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_464), + .sigs = sigs_464, + }, + { + .name = "ACC_CONTROL", + .address = 0x1DF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_479), + .sigs = sigs_479, + }, + { + .name = "VEHICLE_DYNAMICS", + .address = 0x1EA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_490), + .sigs = sigs_490, + }, + { + .name = "ACC_CONTROL_ON", + .address = 0x1EF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_495), + .sigs = sigs_495, + }, + { + .name = "XXX_16", + .address = 0x221, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_545), + .sigs = sigs_545, + }, + { + .name = "LEFT_LANE_LINE_1", + .address = 0x240, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_576), + .sigs = sigs_576, + }, + { + .name = "LEFT_LANE_LINE_2", + .address = 0x241, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_577), + .sigs = sigs_577, + }, + { + .name = "RIGHT_LANE_LINE_1", + .address = 0x243, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_579), + .sigs = sigs_579, + }, + { + .name = "RIGHT_LANE_LINE_2", + .address = 0x244, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_580), + .sigs = sigs_580, + }, + { + .name = "ADJACENT_LEFT_LANE_LINE_1", + .address = 0x246, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_582), + .sigs = sigs_582, + }, + { + .name = "ADJACENT_LEFT_LANE_LINE_2", + .address = 0x247, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_583), + .sigs = sigs_583, + }, + { + .name = "ADJACENT_RIGHT_LANE_LINE_1", + .address = 0x249, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_585), + .sigs = sigs_585, + }, + { + .name = "ADJACENT_RIGHT_LANE_LINE_2", + .address = 0x24A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_586), + .sigs = sigs_586, + }, + { + .name = "ROUGH_WHEEL_SPEED", + .address = 0x255, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_597), + .sigs = sigs_597, + }, + { + .name = "SCM_BUTTONS", + .address = 0x296, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_662), + .sigs = sigs_662, + }, + { + .name = "SEATBELT_STATUS", + .address = 0x305, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_773), + .sigs = sigs_773, + }, + { + .name = "CAR_SPEED", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "ACC_HUD", + .address = 0x30C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_780), + .sigs = sigs_780, + }, + { + .name = "CRUISE", + .address = 0x324, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_804), + .sigs = sigs_804, + }, + { + .name = "SCM_FEEDBACK", + .address = 0x326, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_806), + .sigs = sigs_806, + }, + { + .name = "LKAS_HUD", + .address = 0x33D, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_829), + .sigs = sigs_829, + }, + { + .name = "CAMERA_MESSAGES", + .address = 0x35E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_862), + .sigs = sigs_862, + }, + { + .name = "STALK_STATUS", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "STALK_STATUS_2", + .address = 0x37B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_891), + .sigs = sigs_891, + }, + { + .name = "RADAR_HUD", + .address = 0x39F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_927), + .sigs = sigs_927, + }, + { + .name = "DOORS_STATUS", + .address = 0x405, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1029), + .sigs = sigs_1029, + }, + { + .name = "LKAS_HUD_A", + .address = 0x33DA, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_13274), + .sigs = sigs_13274, + }, + { + .name = "LKAS_HUD_B", + .address = 0x33DB, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_13275), + .sigs = sigs_13275, + }, +}; + +const Val vals[] = { + { + .name = "STEER_STATUS", + .address = 0x18F, + .def_val = "6 TMP_FAULT 5 FAULT_1 4 NO_TORQUE_ALERT_2 3 LOW_SPEED_LOCKOUT 2 NO_TORQUE_ALERT_1 0 NORMAL", + .sigs = sigs_399, + }, + { + .name = "GEAR", + .address = 0x1A3, + .def_val = " 10 R 1 D 0 P", + .sigs = sigs_419, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x1A3, + .def_val = " 32 D 16 N 8 R 4 P", + .sigs = sigs_419, + }, + { + .name = "BEEP", + .address = 0x33D, + .def_val = "3 SINGLE_BEEP 2 TRIPLE_BEEP 1 REPEATED_BEEP 0 NO_BEEP", + .sigs = sigs_829, + }, + { + .name = "DASHBOARD_ALERT", + .address = 0x374, + .def_val = "0 NONE 51 ACC_PROBLEM 55 CMBS_PROBLEM 75 KEY_NOT_DETECTED 79 FASTEN_SEATBELT 111 LKAS_PROBLEM 131 BRAKE_SYSTEM_PROBLEM 132 BRAKE_HOLD_PROBLEM 139 TBD 161 DOOR_OPEN", + .sigs = sigs_884, + }, + { + .name = "WIPERS", + .address = 0x37B, + .def_val = "4 HIGH 2 LOW 0 OFF", + .sigs = sigs_891, + }, +}; + +} + +const DBC honda_insight_ex_2019_can_generated = { + .name = "honda_insight_ex_2019_can_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(honda_insight_ex_2019_can_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/honda_odyssey_exl_2018_generated.cc b/opendbc/can/dbc_out/honda_odyssey_exl_2018_generated.cc new file mode 100644 index 000000000..a7025cb70 --- /dev/null +++ b/opendbc/can/dbc_out/honda_odyssey_exl_2018_generated.cc @@ -0,0 +1,3167 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_145[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_148[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 31, + .b2 = 9, + .bo = 24, + .is_signed = true, + .factor = -0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_228[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_REQUEST", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ENGINE_TORQUE_ESTIMATE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_TORQUE_REQUEST", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_316[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_342[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_344[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "XMISSION_SPEED2", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_380[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PEDAL_GAS", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_SWITCH", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_17C", + .b1 = 34, + .b2 = 5, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_STATUS", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PRESSED", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2_17C", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3_17C", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE_SENSOR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONTROL_ACTIVE", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_STATUS", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONFIG_INDEX", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_419[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GEAR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR_SHIFTER", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_420[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "USER_BRAKE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.015625, + .offset = -1.609375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKING", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_DISABLED", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_RELATED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_427[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "MOTOR_TORQUE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONFIG_VALID", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OUTPUT_DISABLED", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_432[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CONTROLLED_STANDSTILL", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_2", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_1", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEELS_MOVING", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_450[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "EPB_ACTIVE", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_BRAKE_AND_PULL", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_STATE", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_464[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 15, + .b2 = 15, + .bo = 34, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 30, + .b2 = 15, + .bo = 19, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 45, + .b2 = 15, + .bo = 4, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_487[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_PRESSURE1", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSURE2", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_490[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_506[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "COMPUTER_BRAKE", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PUMP_REQUEST", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 10, + .b2 = 5, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE_REQUEST", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CANCEL_CMD", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_FAULT_CMD", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_3", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_OVERRIDE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_2", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_1", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATES", + .b1 = 33, + .b2 = 7, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_STATUS", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCW", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_4", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_5", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_597[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_662[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SETTING", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_BUTTONS", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_773[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SEATBELT_DRIVER_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_UNLATCHED", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_LATCHED", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_OFF", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOORS_UNLOCKED", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOORS_LOCKED", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_780[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PCM_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCM_GAS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE_MINI_CAR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_OBSTRUCTED", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_PROBLEM", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF_2", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_PROBLEM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC_MODE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_LABEL", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_5", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_4", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_3", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_LEAD", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 52, + .b2 = 3, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE_3", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01_2", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ICONS", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_804[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "HUD_SPEED_KPH", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_SPEED_MPH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_FUEL_CONSUMED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED_PCM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_806[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "REVERSE_LIGHT", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CMBS_BUTTON", + .b1 = 17, + .b2 = 2, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_829[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X48", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_862[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 50, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH_2", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGHBEAMS_ON", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGHBEAMS_ACTIVE", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DASHBOARD_ALERT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_FLASH", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HEADLIGHTS", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_HOLD", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_SWITCH", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HEADLIGHTS_ON", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_891[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAMS", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAMS", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_LIGHTS", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_892[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SPEED_OFFSET", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_927[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 17, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ALERTS", + .b1 = 19, + .b2 = 5, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RESUME_INSTRUCTION", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "APPLY_BRAKES_FOR_CANC", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_SPEED", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_DISTANCE", + .b1 = 44, + .b2 = 5, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_STATE", + .b1 = 41, + .b2 = 3, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH3", + .b1 = 49, + .b2 = 7, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1029[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRUNK_OPEN", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1302[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ODOMETER", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "KINEMATICS", + .address = 0x91, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_145), + .sigs = sigs_145, + }, + { + .name = "KINEMATICS_ALT", + .address = 0x94, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_148), + .sigs = sigs_148, + }, + { + .name = "STEERING_CONTROL", + .address = 0xE4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_228), + .sigs = sigs_228, + }, + { + .name = "GAS_PEDAL_2", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "GAS_PEDAL", + .address = 0x13C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_316), + .sigs = sigs_316, + }, + { + .name = "STEERING_SENSORS", + .address = 0x156, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_342), + .sigs = sigs_342, + }, + { + .name = "ENGINE_DATA", + .address = 0x158, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_344), + .sigs = sigs_344, + }, + { + .name = "POWERTRAIN_DATA", + .address = 0x17C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_380), + .sigs = sigs_380, + }, + { + .name = "STEER_STATUS", + .address = 0x18F, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "GEARBOX", + .address = 0x1A3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_419), + .sigs = sigs_419, + }, + { + .name = "VSA_STATUS", + .address = 0x1A4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_420), + .sigs = sigs_420, + }, + { + .name = "STEER_MOTOR_TORQUE", + .address = 0x1AB, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_427), + .sigs = sigs_427, + }, + { + .name = "STANDSTILL", + .address = 0x1B0, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_432), + .sigs = sigs_432, + }, + { + .name = "EPB_STATUS", + .address = 0x1C2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_450), + .sigs = sigs_450, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x1D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_464), + .sigs = sigs_464, + }, + { + .name = "BRAKE_PRESSURE", + .address = 0x1E7, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_487), + .sigs = sigs_487, + }, + { + .name = "VEHICLE_DYNAMICS", + .address = 0x1EA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_490), + .sigs = sigs_490, + }, + { + .name = "BRAKE_COMMAND", + .address = 0x1FA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_506), + .sigs = sigs_506, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "ROUGH_WHEEL_SPEED", + .address = 0x255, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_597), + .sigs = sigs_597, + }, + { + .name = "SCM_BUTTONS", + .address = 0x296, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_662), + .sigs = sigs_662, + }, + { + .name = "SEATBELT_STATUS", + .address = 0x305, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_773), + .sigs = sigs_773, + }, + { + .name = "LOCK_STATUS", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "ACC_HUD", + .address = 0x30C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_780), + .sigs = sigs_780, + }, + { + .name = "CRUISE", + .address = 0x324, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_804), + .sigs = sigs_804, + }, + { + .name = "SCM_FEEDBACK", + .address = 0x326, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_806), + .sigs = sigs_806, + }, + { + .name = "LKAS_HUD", + .address = 0x33D, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_829), + .sigs = sigs_829, + }, + { + .name = "HIGHBEAM_CONTROL", + .address = 0x35E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_862), + .sigs = sigs_862, + }, + { + .name = "STALK_STATUS", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "STALK_STATUS_2", + .address = 0x37B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_891), + .sigs = sigs_891, + }, + { + .name = "CRUISE_PARAMS", + .address = 0x37C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_892), + .sigs = sigs_892, + }, + { + .name = "RADAR_HUD", + .address = 0x39F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_927), + .sigs = sigs_927, + }, + { + .name = "DOORS_STATUS", + .address = 0x405, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1029), + .sigs = sigs_1029, + }, + { + .name = "ODOMETER", + .address = 0x516, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1302), + .sigs = sigs_1302, + }, +}; + +const Val vals[] = { + { + .name = "STEER_STATUS", + .address = 0x18F, + .def_val = "6 TMP_FAULT 5 FAULT_1 4 NO_TORQUE_ALERT_2 3 LOW_SPEED_LOCKOUT 2 NO_TORQUE_ALERT_1 0 NORMAL", + .sigs = sigs_399, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x1A3, + .def_val = "10 S 4 D 3 N 2 R 1 P", + .sigs = sigs_419, + }, + { + .name = "EPB_STATE", + .address = 0x1C2, + .def_val = "3 ENGAGED 2 DISENGAGING 1 ENGAGING 0 DISENGAGED", + .sigs = sigs_450, + }, + { + .name = "AEB_STATUS", + .address = 0x1FA, + .def_val = "3 AEB_PREPARE 2 AEB_READY 1 AEB_BRAKING 0 NO_AEB", + .sigs = sigs_506, + }, + { + .name = "CHIME", + .address = 0x1FA, + .def_val = "4 DOUBLE_CHIME 3 SINGLE_CHIME 2 CONTINUOUS_CHIME 1 REPEATING_CHIME 0 NO_CHIME", + .sigs = sigs_506, + }, + { + .name = "FCW", + .address = 0x1FA, + .def_val = "3 FCW 2 FCW 1 FCW 0 NO_FCW", + .sigs = sigs_506, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "CRUISE_BUTTONS", + .address = 0x296, + .def_val = "7 TBD 6 TBD 5 TBD 4 ACCEL_RES 3 DECEL_SET 2 CANCEL 1 MAIN 0 NONE", + .sigs = sigs_662, + }, + { + .name = "CRUISE_SETTING", + .address = 0x296, + .def_val = "3 DISTANCE_ADJ 2 TBD 1 LKAS_BUTTON 0 NONE", + .sigs = sigs_662, + }, + { + .name = "CRUISE_SPEED", + .address = 0x30C, + .def_val = "255 NO_SPEED 252 STOPPED", + .sigs = sigs_780, + }, + { + .name = "HUD_LEAD", + .address = 0x30C, + .def_val = "3 ACC_OFF 2 SOLID_CAR 1 DASHED_CAR 0 NO_CAR", + .sigs = sigs_780, + }, + { + .name = "HUD_LEAD", + .address = 0x30C, + .def_val = "3 NO_CAR 2 SOLID_CAR 1 DASHED_CAR 0 NO_CAR", + .sigs = sigs_780, + }, + { + .name = "CMBS_BUTTON", + .address = 0x326, + .def_val = "3 PRESSED 0 RELEASED", + .sigs = sigs_806, + }, + { + .name = "BEEP", + .address = 0x33D, + .def_val = "3 SINGLE_BEEP 2 TRIPLE_BEEP 1 REPEATED_BEEP 0 NO_BEEP", + .sigs = sigs_829, + }, + { + .name = "DASHBOARD_ALERT", + .address = 0x374, + .def_val = "0 NONE 51 ACC_PROBLEM 55 CMBS_PROBLEM 75 KEY_NOT_DETECTED 79 FASTEN_SEATBELT 111 LKAS_PROBLEM 131 BRAKE_SYSTEM_PROBLEM 132 BRAKE_HOLD_PROBLEM 139 TBD 161 DOOR_OPEN", + .sigs = sigs_884, + }, + { + .name = "WIPERS", + .address = 0x37B, + .def_val = "4 HIGH 2 LOW 0 OFF", + .sigs = sigs_891, + }, + { + .name = "ACC_ALERTS", + .address = 0x39F, + .def_val = "29 ESP_ACTIVE_ACC_CANCELED 10 B_PEDAL_APPLIED 9 SPEED_TOO_LOW 8 SPEED_TOO_HIGH 7 P_BRAKE_APPLIED 6 GEAR_NO_D 5 SEATBELT 4 TOO_STEEP_DOWNHILL 3 TOO_STEEP_UPHILL 2 TOO_CLOSE 1 NO_VEHICLE_AHEAD", + .sigs = sigs_927, + }, +}; + +} + +const DBC honda_odyssey_exl_2018_generated = { + .name = "honda_odyssey_exl_2018_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(honda_odyssey_exl_2018_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/honda_odyssey_extreme_edition_2018_china_can_generated.cc b/opendbc/can/dbc_out/honda_odyssey_extreme_edition_2018_china_can_generated.cc new file mode 100644 index 000000000..b52379b76 --- /dev/null +++ b/opendbc/can/dbc_out/honda_odyssey_extreme_edition_2018_china_can_generated.cc @@ -0,0 +1,3036 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_145[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_148[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.02, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 31, + .b2 = 9, + .bo = 24, + .is_signed = true, + .factor = -0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ENGINE_TORQUE_ESTIMATE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_TORQUE_REQUEST", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_316[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CAR_GAS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_342[] = { + { + .name = "CHECKSUM", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_344[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "XMISSION_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "XMISSION_SPEED2", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_380[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PEDAL_GAS", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENGINE_RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_SWITCH", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_17C", + .b1 = 34, + .b2 = 5, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_STATUS", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PRESSED", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2_17C", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3_17C", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE_SENSOR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONTROL_ACTIVE", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_STATUS", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_CONFIG_INDEX", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_401[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "GEAR_SHIFTER", + .b1 = 2, + .b2 = 6, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_404[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "STEER_TORQUE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_REQUEST", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_420[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "USER_BRAKE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.015625, + .offset = -1.609375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKING", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_DISABLED", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_RELATED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_422[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LIGHTS_SETTING", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_BUTTONS", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SETTING", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DRIVERS_DOOR_OPEN", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_427[] = { + { + .name = "CHECKSUM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "MOTOR_TORQUE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CONFIG_VALID", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OUTPUT_DISABLED", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_432[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CONTROLLED_STANDSTILL", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_2", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ERROR_1", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEELS_MOVING", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_450[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "EPB_ACTIVE", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_BRAKE_AND_PULL", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_STATE", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_464[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 15, + .b2 = 15, + .bo = 34, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 30, + .b2 = 15, + .bo = 19, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 45, + .b2 = 15, + .bo = 4, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_487[] = { + { + .name = "CHECKSUM", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "BRAKE_PRESSURE1", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSURE2", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = false, + .factor = 0.015625, + .offset = -103.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_490[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.0015, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_506[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "COMPUTER_BRAKE", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PUMP_REQUEST", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 10, + .b2 = 5, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COMPUTER_BRAKE_REQUEST", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CANCEL_CMD", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_FAULT_CMD", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_3", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_OVERRIDE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_2", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_2", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_REQ_1", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATES", + .b1 = 33, + .b2 = 7, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_STATUS", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCW", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_4", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_5", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.253984064, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.126992032, + .offset = -83.3, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_597[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_TO_X55_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_660[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS_SPEED", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_773[] = { + { + .name = "CHECKSUM", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SEATBELT_DRIVER_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_UNLATCHED", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_PASS_LATCHED", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_OFF", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASS_AIRBAG_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOORS_UNLOCKED", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOORS_LOCKED", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_780[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "PCM_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCM_GAS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE_MINI_CAR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_OBSTRUCTED", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_PROBLEM", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF_2", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FCM_OFF", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_PROBLEM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC_MODE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_LABEL", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_5", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_4", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH_3", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_LEAD", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHIME", + .b1 = 52, + .b2 = 3, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_DISTANCE_3", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IMPERIAL_UNIT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01_2", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ICONS", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_804[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "HUD_SPEED_KPH", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HUD_SPEED_MPH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_FUEL_CONSUMED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_SPEED_PCM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_829[] = { + { + .name = "CHECKSUM", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "SET_ME_X41", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAM_TEMP_HIGH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_REQUIRED", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_RIGHT", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SOLID_LANES", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_OFF", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_PROBLEM", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DTC", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DASHED_LANES", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BEEP", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_PROBLEM", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEAN_WINDSHIELD", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_OFF", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_ON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X48", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_862[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ZEROS_BOH", + .b1 = 0, + .b2 = 50, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS_BOH_2", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGHBEAMS_ON", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGHBEAMS_ACTIVE", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DASHBOARD_ALERT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_FLASH", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HEADLIGHTS", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM_HOLD", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_SWITCH", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HEADLIGHTS_ON", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_891[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "WIPERS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAMS", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAMS", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_LIGHTS", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_892[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "CRUISE_SPEED_OFFSET", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1029[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRUNK_OPEN", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1302[] = { + { + .name = "CHECKSUM", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::HONDA_COUNTER, + }, + { + .name = "ODOMETER", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "KINEMATICS", + .address = 0x91, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_145), + .sigs = sigs_145, + }, + { + .name = "KINEMATICS_ALT", + .address = 0x94, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_148), + .sigs = sigs_148, + }, + { + .name = "GAS_PEDAL_2", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "GAS_PEDAL", + .address = 0x13C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_316), + .sigs = sigs_316, + }, + { + .name = "STEERING_SENSORS", + .address = 0x156, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_342), + .sigs = sigs_342, + }, + { + .name = "ENGINE_DATA", + .address = 0x158, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_344), + .sigs = sigs_344, + }, + { + .name = "POWERTRAIN_DATA", + .address = 0x17C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_380), + .sigs = sigs_380, + }, + { + .name = "STEER_STATUS", + .address = 0x18F, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "GEARBOX", + .address = 0x191, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_401), + .sigs = sigs_401, + }, + { + .name = "STEERING_CONTROL", + .address = 0x194, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_404), + .sigs = sigs_404, + }, + { + .name = "VSA_STATUS", + .address = 0x1A4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_420), + .sigs = sigs_420, + }, + { + .name = "SCM_BUTTONS", + .address = 0x1A6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_422), + .sigs = sigs_422, + }, + { + .name = "STEER_MOTOR_TORQUE", + .address = 0x1AB, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_427), + .sigs = sigs_427, + }, + { + .name = "STANDSTILL", + .address = 0x1B0, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_432), + .sigs = sigs_432, + }, + { + .name = "EPB_STATUS", + .address = 0x1C2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_450), + .sigs = sigs_450, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x1D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_464), + .sigs = sigs_464, + }, + { + .name = "BRAKE_PRESSURE", + .address = 0x1E7, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_487), + .sigs = sigs_487, + }, + { + .name = "VEHICLE_DYNAMICS", + .address = 0x1EA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_490), + .sigs = sigs_490, + }, + { + .name = "BRAKE_COMMAND", + .address = 0x1FA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_506), + .sigs = sigs_506, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "ROUGH_WHEEL_SPEED", + .address = 0x255, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_597), + .sigs = sigs_597, + }, + { + .name = "SCM_FEEDBACK", + .address = 0x294, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_660), + .sigs = sigs_660, + }, + { + .name = "SEATBELT_STATUS", + .address = 0x305, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_773), + .sigs = sigs_773, + }, + { + .name = "LOCK_STATUS", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "ACC_HUD", + .address = 0x30C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_780), + .sigs = sigs_780, + }, + { + .name = "CRUISE", + .address = 0x324, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_804), + .sigs = sigs_804, + }, + { + .name = "LKAS_HUD", + .address = 0x33D, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_829), + .sigs = sigs_829, + }, + { + .name = "HIGHBEAM_CONTROL", + .address = 0x35E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_862), + .sigs = sigs_862, + }, + { + .name = "STALK_STATUS", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "STALK_STATUS_2", + .address = 0x37B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_891), + .sigs = sigs_891, + }, + { + .name = "CRUISE_PARAMS", + .address = 0x37C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_892), + .sigs = sigs_892, + }, + { + .name = "DOORS_STATUS", + .address = 0x405, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1029), + .sigs = sigs_1029, + }, + { + .name = "ODOMETER", + .address = 0x516, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1302), + .sigs = sigs_1302, + }, +}; + +const Val vals[] = { + { + .name = "STEER_STATUS", + .address = 0x18F, + .def_val = "5 FAULT 4 NO_TORQUE_ALERT_2 2 NO_TORQUE_ALERT_1 0 NORMAL", + .sigs = sigs_399, + }, + { + .name = "GEAR", + .address = 0x191, + .def_val = "7 L 10 S 4 D 3 N 2 R 1 P", + .sigs = sigs_401, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x191, + .def_val = "32 L 16 S 8 D 4 N 2 R 1 P", + .sigs = sigs_401, + }, + { + .name = "CRUISE_BUTTONS", + .address = 0x1A6, + .def_val = "7 TBD 6 TBD 5 TBD 4 ACCEL_RES 3 DECEL_SET 2 CANCEL 1 MAIN 0 NONE", + .sigs = sigs_422, + }, + { + .name = "CRUISE_SETTING", + .address = 0x1A6, + .def_val = "3 DISTANCE_ADJ 2 TBD 1 LKAS_BUTTON 0 NONE", + .sigs = sigs_422, + }, + { + .name = "LIGHTS_SETTING", + .address = 0x1A6, + .def_val = "3 HIGH_BEAM 2 LOW_BEAM 1 POSITION 0 NO_LIGHTS", + .sigs = sigs_422, + }, + { + .name = "AEB_STATUS", + .address = 0x1FA, + .def_val = "3 AEB_PREPARE 2 AEB_READY 1 AEB_BRAKING 0 NO_AEB", + .sigs = sigs_506, + }, + { + .name = "CHIME", + .address = 0x1FA, + .def_val = "4 DOUBLE_CHIME 3 SINGLE_CHIME 2 CONTINUOUS_CHIME 1 REPEATING_CHIME 0 NO_CHIME", + .sigs = sigs_506, + }, + { + .name = "FCW", + .address = 0x1FA, + .def_val = "3 FCW 2 FCW 1 FCW 0 NO_FCW", + .sigs = sigs_506, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "CRUISE_SPEED", + .address = 0x30C, + .def_val = "255 NO_SPEED 252 STOPPED", + .sigs = sigs_780, + }, + { + .name = "HUD_LEAD", + .address = 0x30C, + .def_val = "3 ACC_OFF 2 SOLID_CAR 1 DASHED_CAR 0 NO_CAR", + .sigs = sigs_780, + }, + { + .name = "BEEP", + .address = 0x33D, + .def_val = "3 SINGLE_BEEP 2 TRIPLE_BEEP 1 REPEATED_BEEP 0 NO_BEEP", + .sigs = sigs_829, + }, + { + .name = "DASHBOARD_ALERT", + .address = 0x374, + .def_val = "0 NONE 51 ACC_PROBLEM 55 CMBS_PROBLEM 75 KEY_NOT_DETECTED 79 FASTEN_SEATBELT 111 LKAS_PROBLEM 131 BRAKE_SYSTEM_PROBLEM 132 BRAKE_HOLD_PROBLEM 139 TBD 161 DOOR_OPEN", + .sigs = sigs_884, + }, + { + .name = "WIPERS", + .address = 0x37B, + .def_val = "4 HIGH 2 LOW 0 OFF", + .sigs = sigs_891, + }, +}; + +} + +const DBC honda_odyssey_extreme_edition_2018_china_can_generated = { + .name = "honda_odyssey_extreme_edition_2018_china_can_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(honda_odyssey_extreme_edition_2018_china_can_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/hyundai_kia_generic.cc b/opendbc/can/dbc_out/hyundai_kia_generic.cc new file mode 100644 index 000000000..2c124d370 --- /dev/null +++ b/opendbc/can/dbc_out/hyundai_kia_generic.cc @@ -0,0 +1,15882 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_16[] = { + { + .name = "CF_Acu_CshAct", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_48[] = { + { + .name = "CF_Ems_DC1NumPerMSV", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_DC2NumPerMSV", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ems_DutyCyc1MSV", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.1953, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ems_DutyCyc2MSV", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.13725, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ems_DutyCyc3MSV", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.392, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_64[] = { + { + .name = "CF_Datc_AqsLevelOut", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_DiagMode", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Datc_SelfDiagCode", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = -1.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DATC_SyncDisp", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DATC_OffDisp", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DATC_SmartVentDisp", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DATC_SmartVentOnOffStatus", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DATC_AutoDefogSysOff_Disp", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DATC_ADSDisp", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_66[] = { + { + .name = "CR_Datc_DrTempDispC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.5, + .offset = 14.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Datc_DrTempDispF", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 56.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Datc_PsTempDispC", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.5, + .offset = 14.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Datc_PsTempDispF", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 56.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Datc_RearDrTempDispC", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.5, + .offset = 14.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Datc_RearDrTempDispF", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 58.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_CO2_Warning", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_67[] = { + { + .name = "CF_Datc_TempDispUnit", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_ModDisp", + .b1 = 2, + .b2 = 4, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_IonClean", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_ChgReqDisp", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_IntakeDisp", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_AutoDisp", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_FrDefLed", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_AutoDefogBlink", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_ClmScanDisp", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_AqsDisp", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_AcDisp", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_OpSts", + .b1 = 25, + .b2 = 3, + .bo = 36, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mtc_MaxAcDisp", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_DualDisp", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_PwrInf", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_RearManual", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_RearAutoDisp", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_RearOffDisp", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_RearClimateScnDisp", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_RearChgReqDisp", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_RearModDisp", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_RearBlwDisp", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_PSModDisp", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_FrontBlwDisp", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_68[] = { + { + .name = "CF_Datc_Type", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_VerMaj", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_VerMin", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Datc_OutTempC", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.5, + .offset = -41.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Datc_OutTempF", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = -42.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Datc_IncarTemp", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.5, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_127[] = { + { + .name = "C_StopLampLhOpenSts", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_StopLampRhOpenSts", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_HMSLOpenSts", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_HLampLowLhOpenSts", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_HLampLowRhOpenSts", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_HLampHighLhOpenSts", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_HLampHighRhOpenSts", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_DRLLampLhOpenSts", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_DRLLampRhOpenSts", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_RearFOGLhOpenSts", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_RearFOGRhOpenSts", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_FrontFOGLhOpenSts", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_FrontFOGRhOpenSts", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_RearEXTTailLhOpenSts", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_RearEXTTailRhOpenSts", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_FrontEXTTailLhOpenSts", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_FrontEXTTailRhOpenSts", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_RearTSIGLhOpenSts", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_RearTSIGRhOpenSts", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_FrontTSIGLhOpenSts", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_FrontTSIGRhOpenSts", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_SBendingLhOpenSts", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_SBendingRhOpenSts", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_LicensePlateLhOpenSts", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_LicensePlateRhOpenSts", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_128[] = { + { + .name = "PV_AV_CAN", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.3906, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQ_STND", + .b1 = 8, + .b2 = 6, + .bo = 50, + .is_signed = false, + .factor = 10.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "F_N_ENG", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "F_SUB_TQI", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "N", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.25, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQI_ACOR", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQFR", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQI", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_Alive", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_ChkSum", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_129[] = { + { + .name = "CR_Ems_SoakTimeExt", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 5.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ACT", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_EngOperStat", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ems_IndAirTemp", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.75, + .offset = -48.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_Alive2", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_ChkSum2", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_273[] = { + { + .name = "TQI_TCU_INC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "G_SEL_DISP", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "F_TCU", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TCU_TYPE", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TCU_OBD", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWI_GS", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR_TYPE", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQI_TCU", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TEMP_AT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "N_TC", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 0.25, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWI_CC", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_Alive1", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_ChkSum1", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_274[] = { + { + .name = "ETL_TCU", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 2.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CUR_GR", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_Alive", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_ChkSum", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VS_TCU", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FUEL_CUT_TCU", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "INH_FUEL_CUT", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IDLE_UP_TCU", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "N_INC_TCU", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SPK_RTD_TCU", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.375, + .offset = -23.625, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "N_TC_RAW", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 0.25, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VS_TCU_DECIMAL", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.0078125, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_275[] = { + { + .name = "N_TGT_LUP", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 10.0, + .offset = 500.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SLOPE_TCU", + .b1 = 8, + .b2 = 6, + .bo = 50, + .is_signed = false, + .factor = 0.5, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_InhCda", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_IsgInhib", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_BkeOnReq", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_NCStat", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_TarGr", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_ShfPatt", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_InhVis", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_PRelReq", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_ITPhase", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_ActEcoRdy", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_TqGrdLim", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 10.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Tcu_IsgTgtRPM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 20.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_SptRdy", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_SbwPInfo", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_Alive3", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_ChkSum3", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "CR_Yrs_Yr", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.005, + .offset = -163.84, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Yrs_LatAc", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.000127465, + .offset = -4.17677312, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Yrs_YrStat", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Yrs_LatAcStat", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Yrs_MCUStat", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Yrs_MsgCnt1", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Yrs_Crc1", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_320[] = { + { + .name = "CR_Yrs_LongAc", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.000127465, + .offset = -4.17677312, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Yrs_LongAcStat", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_IMU_ResetStat", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "YRS_Temp", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -68.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "YRS_TempStat", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Yrs_Type", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Yrs_MsgCnt2", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Yrs_Crc2", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_339[] = { + { + .name = "TCS_REQ", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MSR_C_REQ", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TCS_PAS", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TCS_GSC", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Esc_LimoInfo", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ABS_DIAG", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ABS_DEF", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TCS_DEF", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TCS_CTL", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ABS_ACT", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EBD_DEF", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_PAS", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_DEF", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_CTL", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TCS_MFRN", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DBC_CTL", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DBC_PAS", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DBC_DEF", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HAC_CTL", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HAC_PAS", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HAC_DEF", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESS_STAT", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQI_TCS", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQI_MSR", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQI_SLW_TCS", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Esc_BrkCtl", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BLA_CTL", + .b1 = 49, + .b2 = 2, + .bo = 13, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AliveCounter_TCS1", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CheckSum_TCS1", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_352[] = { + { + .name = "CF_Ahb_SLmp", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ahb_Def", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ahb_Act", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ahb_Diag", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ahb_WLmp", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ahb_StDep_mm", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ahb_SnsFail", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ahb_PedalCalStat", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ahb_Bzzr", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ahb_ChkSum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_354[] = { + { + .name = "Clutch_Driving_Tq", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = -512.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cluster_Engine_RPM", + .b1 = 10, + .b2 = 13, + .bo = 41, + .is_signed = false, + .factor = 0.9766, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cluster_Engine_RPM_Flag", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_356[] = { + { + .name = "CR_Esc_StrTqReq", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.01, + .offset = -20.48, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Esc_Act", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Esc_CtrMode", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Esc_Def", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Esc_AliveCnt", + .b1 = 17, + .b2 = 4, + .bo = 43, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Esc_Chksum", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_357[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_387[] = { + { + .name = "CF_EndBst_PwmDuH", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_EndBst_PwmDuL", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_EndBst_PwmFqOutRng", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_EndBst_HbriOverCur", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_EndBst_HbriOverTemp", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_EndBst_PosSnsKOR", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_EndBst_PosSnsOSOR", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_EndBst_EepFlt", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_EndBst_RomFlt", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_EndBst_RamFlt", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_EndBst_CanFlt", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_EndBst_AgH", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_EndBst_AgL", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_EndBst_ORVol", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_EndBst_ActPos", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.117, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_EndBst_DemPos", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.117, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_EndBst_HbriPwr", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.045, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "R_TqAcnApvC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.2, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "R_PAcnC", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 125.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQI_B", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SLD_VS", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_CdaStat", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_IsgStat", + .b1 = 35, + .b2 = 3, + .bo = 26, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_OilChg", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_EtcLimpMod", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "R_NEngIdlTgC", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 10.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_UpTarGr", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_DownTarGr", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_DesCurGr", + .b1 = 50, + .b2 = 4, + .bo = 10, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_SldAct", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_SldPosAct", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_HPresStat", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_IsgBuz", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_IdlStpFCO", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_FCopen", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_ActEcoAct", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_EngRunNorm", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_IsgStat2", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 2.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "FCO", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.128, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_PumpTPres", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 3.137254902, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Split_Stat", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_544[] = { + { + .name = "LAT_ACCEL", + .b1 = 0, + .b2 = 11, + .bo = 53, + .is_signed = false, + .factor = 0.01, + .offset = -10.23, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_ACCEL_STAT", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_ACCEL_DIAG", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL", + .b1 = 13, + .b2 = 11, + .bo = 40, + .is_signed = false, + .factor = 0.01, + .offset = -10.23, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL_STAT", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_ACCEL_DIAG", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CYL_PRES", + .b1 = 26, + .b2 = 12, + .bo = 26, + .is_signed = false, + .factor = 0.1, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CYL_PRES_STAT", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CYL_PRESS_DIAG", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "YAW_RATE", + .b1 = 40, + .b2 = 13, + .bo = 11, + .is_signed = false, + .factor = 0.01, + .offset = -40.95, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "YAW_RATE_STAT", + .b1 = 53, + .b2 = 1, + .bo = 10, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "YAW_RATE_DIAG", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP12_Checksum", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP12_AliveCounter", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_593[] = { + { + .name = "CR_Mdps_StrColTq", + .b1 = 0, + .b2 = 11, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = -1024.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_Def", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_ToiUnavail", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_ToiActive", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_ToiFlt", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_FailStat", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_MsgCount2", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_Chksum2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_SErr", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Mdps_StrTq", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = false, + .factor = 0.01, + .offset = -20.48, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Mdps_OutTq", + .b1 = 52, + .b2 = 12, + .bo = 0, + .is_signed = false, + .factor = 0.1, + .offset = -204.8, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_608[] = { + { + .name = "TQI_MIN", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQI", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQI_TARGET", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GLOW_STAT", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_LAMP_M", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_LAMP_S", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PRE_FUEL_CUT_IN", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ENG_STAT", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SOAK_TIME_ERROR", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SOAK_TIME", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQI_MAX", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SPK_TIME_CUR", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.375, + .offset = -35.625, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AliveCounter", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_AclAct", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_625[] = { + { + .name = "FUP_LPG_MMV", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 128.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LV_FUEL_TYPE_BOX", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LV_BFS_IN_PROGRESS", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LV_GAS_OK", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LV_FUP_ENA_THD", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LPI_OBD", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ERR_GAS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FAC_TI_GAS_COR", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = false, + .factor = 3.05e-05, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FTL_AFU", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.392, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BFS_CYL", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LV_PRE_CDN_LEAK", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LV_CONF_INJECTION_DELAY", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LV_LPG_SW_DRIVER_REQ", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_640[] = { + { + .name = "LV_FUEL_TYPE_ECU", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LV_BFS_CFIRM", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LV_CRASH", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LV_VB_OFF_ACT", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LV_GSL_MAP", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LV_ENG_TURN", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ERR_FUEL", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EOS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TCO", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.75, + .offset = -48.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "N_32", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 32.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MAF", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 5.447, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TIA", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.75, + .offset = -48.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MAP", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.47058, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AMP", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 21.22, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_688[] = { + { + .name = "SAS_Angle", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.1, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SAS_Speed", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 4.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SAS_Stat", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MsgCount", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CheckSum", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_790[] = { + { + .name = "SWI_IGK", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "F_N_ENG", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACK_TCS", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PUC_STAT", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQ_COR_STAT", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RLY_AC", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "F_SUB_TQI", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQI_ACOR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "N", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.25, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQI", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQFR", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VS", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RATIO_TQI_BAS_MAX_STND", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.0078, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_809[] = { + { + .name = "CONF_TCU", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CAN_VERS", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQ_STND", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 10.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_FRF_ACK", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MUL_CODE", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TEMP_ENG", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.75, + .offset = -48.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MAF_FAC_ALTI_MMV", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.00781, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VB_OFF_ACT", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACK_ES", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CONF_MIL_FMY", + .b1 = 26, + .b2 = 3, + .bo = 35, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OD_OFF_REQ", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ACT", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CLU_ACK", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ACT", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ENG_CHR", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GP_CTL", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TPS", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.4694836, + .offset = -15.0234742, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PV_AV_CAN", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.3906, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ENG_VOL", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.1, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_832[] = { + { + .name = "CF_Lkas_LdwsActivemode", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_LdwsSysState", + .b1 = 2, + .b2 = 4, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_SysWarning", + .b1 = 6, + .b2 = 4, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_LdwsLHWarning", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_LdwsRHWarning", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_HbaLamp", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_FcwBasReq", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Lkas_StrToqReq", + .b1 = 16, + .b2 = 11, + .bo = 37, + .is_signed = false, + .factor = 1.0, + .offset = -1024.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_ActToi", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_ToiFlt", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_HbaSysState", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_FcwOpt", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_HbaOpt", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_MsgCount", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_FcwSysState", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_FcwCollisionWarning", + .b1 = 43, + .b2 = 2, + .bo = 19, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_FusionState", + .b1 = 45, + .b2 = 2, + .bo = 17, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_Unknown1", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_Chksum", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_FcwOpt_USM", + .b1 = 56, + .b2 = 3, + .bo = 5, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_LdwsOpt_USM", + .b1 = 59, + .b2 = 3, + .bo = 2, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_Unknown2", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_854[] = { + { + .name = "PAINT1", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PAINT2", + .b1 = 37, + .b2 = 2, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PAINT3", + .b1 = 35, + .b2 = 2, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PAINT4", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_865[] = { + { + .name = "CF_PCA_BrkReq", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_PCA_DclTrgtVal", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PCA_ALIVE_CNT", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PCA_CHECK_SUM", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_870[] = { + { + .name = "TQI_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.390625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "N", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = false, + .factor = 0.25, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQI_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.390625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VS", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWI_IGK", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_871[] = { + { + .name = "CF_Lvr_CruiseSet", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lvr_Gear", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_872[] = { + { + .name = "CF_Lvr_GearInf", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lvr_PRelStat", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lvr_BkeAct", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lvr_NFnStat", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lvr_PosInf", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lvr_PosCpl", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lvr_UlkButStat", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lvr_PNStat", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lvr_ShtLkStat", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lvr_ShfErrInf", + .b1 = 28, + .b2 = 20, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lvr_AC", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lvr_CS", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_881[] = { + { + .name = "Brake_Pedal_Pos", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IG_Reactive_Stat", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Gear_Change", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Limit_Status", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Limit_Target", + .b1 = 23, + .b2 = 8, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Accel_Pedal_Pos", + .b1 = 31, + .b2 = 8, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Vcu_AccPedDep_Pos", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_882[] = { + { + .name = "Elect_Gear_Shifter", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_896[] = { + { + .name = "CF_DiBox_HPreInjVConfStat", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_HPreInjVStat1", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_HPreInjVStat2", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_HPreInjVPkp", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_HPreInjVBpt", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_ErrRegFrtMSV", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_ErrRegSedMSV", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_SPIErrSedMSV", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_SPIErrFrtMSV", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_IDErrSedMSV", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_IDErrFrtMSV", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_IniStatMSV", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_897[] = { + { + .name = "CF_Mdps_WLmp", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_Flex", + .b1 = 2, + .b2 = 3, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_FlexDisp", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_Stat", + .b1 = 7, + .b2 = 4, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Mdps_DrvTq", + .b1 = 11, + .b2 = 12, + .bo = 41, + .is_signed = false, + .factor = 1.0, + .offset = -2048.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_ALTRequest", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Mdps_StrAng", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = true, + .factor = 0.1, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_AliveCnt", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_Chksum", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_MDPS_VSM_FUNC", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_SPAS_FUNC", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_LKAS_FUNC", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_CurrMode", + .b1 = 59, + .b2 = 2, + .bo = 3, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_Type", + .b1 = 61, + .b2 = 2, + .bo = 1, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_899[] = { + { + .name = "CR_Fatc_TqAcnOut", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.2, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_AcnRqSwi", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_AcnCltEnRq", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_EcvFlt", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_BlwrOn", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_FATC_Iden", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_BlwrMax", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_EngStartReq", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_IsgStopReq", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_CtrInf", + .b1 = 17, + .b2 = 3, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_MsgCnt", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Fatc_OutTemp", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.5, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Fatc_OutTempSns", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.5, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_Compload", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_ActiveEco", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_AutoActivation", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_DefSw", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_PtcRlyStat", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fatc_ChkSum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_900[] = { + { + .name = "CF_Ems_PkpCurMSV", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_HolCurMSV", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_InjVBnkAct", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_InjVActSet", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_DiagFulHDEV", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_SwiOffIC1", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_SwiOffIC2", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_DiagReqHDEV", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ems_DutyCycMSV", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.3921568627, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ems_BatVolRly", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.1, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_902[] = { + { + .name = "WHL_SPD_FL", + .b1 = 0, + .b2 = 14, + .bo = 50, + .is_signed = false, + .factor = 0.03125, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_SPD_AliveCounter_LSB", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_SPD_FR", + .b1 = 16, + .b2 = 14, + .bo = 34, + .is_signed = false, + .factor = 0.03125, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_SPD_AliveCounter_MSB", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_SPD_RL", + .b1 = 32, + .b2 = 14, + .bo = 18, + .is_signed = false, + .factor = 0.03125, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_SPD_Checksum_LSB", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_SPD_RR", + .b1 = 48, + .b2 = 14, + .bo = 2, + .is_signed = false, + .factor = 0.03125, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_SPD_Checksum_MSB", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_903[] = { + { + .name = "WHL_PUL_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.5, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_PUL_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.5, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_PUL_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.5, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_PUL_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.5, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_DIR_FL", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_DIR_FR", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_DIR_RL", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_DIR_RR", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_PUL_Chksum", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_905[] = { + { + .name = "ComfortBandUpper", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 0.02, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ComfortBandLower", + .b1 = 6, + .b2 = 6, + .bo = 52, + .is_signed = false, + .factor = 0.02, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "JerkUpperLimit", + .b1 = 12, + .b2 = 7, + .bo = 45, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "JerkLowerLimit", + .b1 = 19, + .b2 = 7, + .bo = 38, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCMode", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ObjGap", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_906[] = { + { + .name = "ABS_DEF", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EBD_DEF", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ABS_ACT", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ABS_W_LAMP", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EBD_W_LAMP", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ABS_DIAG", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESS_STAT", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_908[] = { + { + .name = "CF_RSPA_State", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_RSPA_Act", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_RSPA_DecCmd", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_RSPA_Trgt_Spd", + .b1 = 8, + .b2 = 10, + .bo = 46, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_RSPA_StopReq", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_RSPA_EPB_Req", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_RSPA_ACC_ACT", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_RSPA_AliveCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_RSPA_CRC", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_909[] = { + { + .name = "CF_VSM_Prefill", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_VSM_HBACmd", + .b1 = 1, + .b2 = 2, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_VSM_Warn", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_VSM_BeltCmd", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_VSM_DecCmd", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PAINT1_Status", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FCA_Status", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FCA_CmdAct", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FCA_StopReq", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FCA_DrvSetStatus", + .b1 = 22, + .b2 = 3, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_VSM_DecCmdAct", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FCA_Failinfo", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Supplemental_Counter", + .b1 = 35, + .b2 = 4, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FCA_RelativeVelocity", + .b1 = 39, + .b2 = 9, + .bo = 16, + .is_signed = false, + .factor = 0.1, + .offset = -25.5, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FCA_TimetoCollision", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_FCA_Alive", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_FCA_ChkSum", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_910[] = { + { + .name = "CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_SPD12_AliveCounter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_SPD_FL", + .b1 = 12, + .b2 = 14, + .bo = 38, + .is_signed = false, + .factor = 0.03125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_SPD_FR", + .b1 = 26, + .b2 = 14, + .bo = 24, + .is_signed = false, + .factor = 0.03125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_911[] = { + { + .name = "CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_SPD13_AliveCounter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_SPD_RL", + .b1 = 12, + .b2 = 14, + .bo = 38, + .is_signed = false, + .factor = 0.03125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHL_SPD_RR", + .b1 = 26, + .b2 = 14, + .bo = 24, + .is_signed = false, + .factor = 0.03125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_912[] = { + { + .name = "CF_Spas_Stat", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_TestMode", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Spas_StrAngCmd", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.1, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_BeepAlarm", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_Mode_Seq", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_AliveCnt", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_Chksum", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_PasVol", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_913[] = { + { + .name = "LFA_Pressed", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM_Door_Dri_Status", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM_Shift_R_MT_SW_Status", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_914[] = { + { + .name = "CF_Mdps_Stat", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Mdps_DrvTq", + .b1 = 8, + .b2 = 12, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Mdps_StrAng", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_AliveCnt", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Mdps_Chksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_915[] = { + { + .name = "SA_COUNT", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 2.0, + .offset = -32768.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SA_Z_COUNT", + .b1 = 16, + .b2 = 15, + .bo = 33, + .is_signed = false, + .factor = 2.0, + .offset = -32768.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SA_Z_FLAG", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_916[] = { + { + .name = "aBasis", + .b1 = 0, + .b2 = 11, + .bo = 53, + .is_signed = false, + .factor = 0.01, + .offset = -10.23, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BrakeLight", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DCEnable", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AliveCounterTCS", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Pre_TCS_CTL", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EBA_ACK", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FCA_ACK", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DF_BF_STAT", + .b1 = 19, + .b2 = 2, + .bo = 43, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCCReqLim", + .b1 = 21, + .b2 = 2, + .bo = 41, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TQI_SCC", + .b1 = 23, + .b2 = 9, + .bo = 32, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_REF_ACC", + .b1 = 32, + .b2 = 11, + .bo = 21, + .is_signed = false, + .factor = 0.01, + .offset = -10.23, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEnable", + .b1 = 43, + .b2 = 2, + .bo = 19, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DriverOverride", + .b1 = 45, + .b2 = 2, + .bo = 17, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StandStill", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CheckSum_TCS3", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_EQUIP", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PBRAKE_ACT", + .b1 = 53, + .b2 = 1, + .bo = 10, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_REQ", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DriverBraking", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_VSM_Coded", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_VSM_Avail", + .b1 = 57, + .b2 = 2, + .bo = 5, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_VSM_Handshake", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DriBkeStat", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_VSM_ConfSwi", + .b1 = 61, + .b2 = 2, + .bo = 1, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_EQUIP", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1017[] = { + { + .name = "Height_FL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Height_FR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Height_RL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Height_RR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1024[] = { + { + .name = "Vehicle_Type", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1040[] = { + { + .name = "CF_Gway_ATTurnRValue", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PTGMRValue", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_EscortHLRValue", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_TTUnlockRValue", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_ADrLRValue", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_ADrURValue", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_SCMRValue", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_WlightRValue", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PSMRValue", + .b1 = 18, + .b2 = 3, + .bo = 43, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_OTTurnRValue", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_DrLockSoundRValue", + .b1 = 24, + .b2 = 3, + .bo = 37, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_HAnBRValue", + .b1 = 27, + .b2 = 3, + .bo = 34, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_MoodLpRValue", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_HfreeTrunkRValue", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_AutoLightRValue", + .b1 = 35, + .b2 = 3, + .bo = 26, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RearWiperRValue", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PasSpkrLvRValue", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1042[] = { + { + .name = "T_Outside_input", + .b1 = 7, + .b2 = 9, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WarningSoundOutput_1Group", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WarningSoundOutput_2Group", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WarningSoundOutput_3Group", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_A_DT_Display_clock", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_A_DT_Display_minute", + .b1 = 26, + .b2 = 6, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_B_DT_Display_clock", + .b1 = 33, + .b2 = 7, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TRIP_B_DT_Display_minute", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PopupMessageOutput_1Level", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PopupMessageOutput_2Level", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PopupMessageOutput_3Level", + .b1 = 53, + .b2 = 1, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PopupMessageOutput_4Level", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PopupMessageOutput_5Level", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PopupMessageOutput_6Level", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PopupMessageOutput_7Level", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PopupMessageOutput_8Level", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1056[] = { + { + .name = "MainMode_ACC", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCCInfoDisplay", + .b1 = 1, + .b2 = 3, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AliveCounterACC", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VSetDis", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ObjValid", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DriverAlertDisplay", + .b1 = 17, + .b2 = 2, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TauGapSet", + .b1 = 19, + .b2 = 3, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ObjStatus", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ObjLatPos", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = false, + .factor = 0.1, + .offset = -20.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ObjDist", + .b1 = 33, + .b2 = 11, + .bo = 20, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ObjRelSpd", + .b1 = 44, + .b2 = 12, + .bo = 8, + .is_signed = false, + .factor = 0.1, + .offset = -170.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Navi_SCC_Curve_Status", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Navi_SCC_Curve_Act", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Navi_SCC_Camera_Act", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Navi_SCC_Camera_Status", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1057[] = { + { + .name = "CF_VSM_Prefill", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_VSM_DecCmdAct", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_VSM_HBACmd", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_VSM_Warn", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_VSM_Stat", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_VSM_BeltCmd", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCFailInfo", + .b1 = 11, + .b2 = 2, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCMode", + .b1 = 13, + .b2 = 2, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StopReq", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_VSM_DecCmd", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "aReqRaw", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.01, + .offset = -10.23, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TakeOverReq", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PreFill", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "aReqValue", + .b1 = 37, + .b2 = 11, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = -10.23, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_VSM_ConfMode", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_Failinfo", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_Status", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_CmdAct", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_StopReq", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_VSM_Alive", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_VSM_ChkSum", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1064[] = { + { + .name = "_4WD_TYPE", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "_4WD_SUPPORT", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "_4WD_ERR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CLU_DUTY", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "R_TIRE", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 200.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "_4WD_SW", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "_2H_ACT", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "_4H_ACT", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_ACT", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_ACT", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LOCK_ACT", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "_4WD_TQC_CUR", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1065[] = { + { + .name = "Ster_Pos", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = -600.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FRSS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FLSS", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RRSS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RLSS", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CLU_PRES", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.0625, + .offset = -50.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1066[] = { + { + .name = "_4WD_CURRENT", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "_4WD_POSITION", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = false, + .factor = 0.015625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "_4WD_CLU_THERM_STR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "_4WD_STATUS", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1078[] = { + { + .name = "CF_Gway_PASDisplayFLH", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PASDisplayFRH", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PASRsound", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PASDisplayFCTR", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PASDisplayRCTR", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PASFsound", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PASDisplayRLH", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PASDisplayRRH", + .b1 = 19, + .b2 = 3, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PASCheckSound", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PASSystemOn", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PASOption", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PASDistance", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1136[] = { + { + .name = "HCU1_STS", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HCU5_STS", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 58, + .b2 = 4, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1151[] = { + { + .name = "AVH_STAT", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDM_STAT", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "REQ_EPB_ACT", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "REQ_EPB_STAT", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ECD_ACT", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "_4WD_LIM_REQ", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ROL_CNT_ESP", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "_4WD_TQC_LIM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "_4WD_CLU_LIM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.390625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "_4WD_OPEN", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "_4WD_LIM_MODE", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1155[] = { + { + .name = "FCA_USM", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FCA_DrvSetState", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1156[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 2, + .b2 = 4, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 18, + .b2 = 14, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_7", + .b1 = 34, + .b2 = 14, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_8", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_9", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 1, + .offset = -4095.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1157[] = { + { + .name = "HDA_USM", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HDA_Active", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HDA_Icon_State", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HDA_Chime", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HDA_VSetReq", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LFA_SysWarning", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 20, + .b2 = 3, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LFA_Icon_State", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LFA_USM", + .b1 = 27, + .b2 = 2, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HDA_SysWarning", + .b1 = 29, + .b2 = 2, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1162[] = { + { + .name = "CF_BCA_State", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_BCA_Warning", + .b1 = 19, + .b2 = 2, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AliveCounter", + .b1 = 21, + .b2 = 4, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RCCA_Brake_Command", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Check_Sum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1168[] = { + { + .name = "EPB_I_LAMP", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_F_LAMP", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_ALARM", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_CLU", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_SWITCH", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_RBL", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_STATUS", + .b1 = 19, + .b2 = 3, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_FRC_ERR", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_DBF_STAT", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_ACK", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_DBF_REQ", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_FAIL", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_FORCE", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1.0, + .offset = -1000.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_DBF_DECEL", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.01, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1170[] = { + { + .name = "CF_Ems_BrkReq", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_DnShftReq", + .b1 = 1, + .b2 = 4, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_RepModChk", + .b1 = 5, + .b2 = 2, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_AAFOpenReq", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_DecelReq", + .b1 = 8, + .b2 = 12, + .bo = 44, + .is_signed = false, + .factor = 0.001, + .offset = -4.094, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ems_BstPre", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 1.322, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ems_EngOilTemp", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.75, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DPF_LAMP_STAT", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BAT_LAMP_STAT", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_ModeledAmbTemp", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.5, + .offset = -41.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_OPSFail", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_AliveCounterEMS9", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_ChecksumEMS9", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1173[] = { + { + .name = "YRS_SeralNo", + .b1 = 16, + .b2 = 48, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1186[] = { + { + .name = "CF_FCA_Equip_Front_Radar", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1191[] = { + { + .name = "PAINT1", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1265[] = { + { + .name = "CF_Clu_CruiseSwState", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_CruiseSwMain", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_SldMainSW", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_ParityBit1", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_VanzDecimal", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 0.125, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_Vanz", + .b1 = 8, + .b2 = 9, + .bo = 47, + .is_signed = false, + .factor = 0.5, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_SPEED_UNIT", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_DetentOut", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_RheostatLevel", + .b1 = 19, + .b2 = 5, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_CluInfo", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_AmpInfo", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_AliveCnt1", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1268[] = { + { + .name = "CF_Spas_HMI_Stat", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_Disp", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_FIL_Ind", + .b1 = 10, + .b2 = 3, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_FIR_Ind", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_FOL_Ind", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_FOR_Ind", + .b1 = 19, + .b2 = 3, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_VolDown", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_RIL_Ind", + .b1 = 24, + .b2 = 3, + .bo = 37, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_RIR_Ind", + .b1 = 27, + .b2 = 3, + .bo = 34, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_FLS_Alarm", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_ROL_Ind", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_ROR_Ind", + .b1 = 35, + .b2 = 3, + .bo = 26, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_FCS_Alarm", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_FI_Ind", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_RI_Ind", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_FRS_Alarm", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_FR_Alarm", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_RR_Alarm", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_BEEP_Alarm", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_StatAlarm", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_RLS_Alarm", + .b1 = 57, + .b2 = 2, + .bo = 5, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_RCS_Alarm", + .b1 = 59, + .b2 = 2, + .bo = 3, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Spas_RRS_Alarm", + .b1 = 61, + .b2 = 2, + .bo = 1, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1280[] = { + { + .name = "CF_SWL_Ind", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_TTL_Ind", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_SBR_Ind", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1281[] = { + { + .name = "ECS_W_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SYS_NA", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ECS_DEF", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ECS_DIAG", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "L_CHG_NA", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Leveling_Off", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LC_overheat", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Lifting", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Lowering", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Damping_Mode", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "REQ_Damping", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "REQ_Height", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "REQ_level", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACT_Height", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1282[] = { + { + .name = "CF_TCU_WarnMsg", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_TCU_WarnImg", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_TCU_WarnSnd", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_GSel_BlinkReq", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_StRelStat", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_DriWarn1", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tcu_DriWarn2", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1287[] = { + { + .name = "ABS_W_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TCS_OFF_LAMP", + .b1 = 1, + .b2 = 2, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TCS_LAMP", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DBC_W_LAMP", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DBC_F_LAMP", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESC_Off_Step", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVH_CLU", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVH_I_LAMP", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EBD_W_LAMP", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVH_ALARM", + .b1 = 27, + .b2 = 2, + .bo = 35, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVH_LAMP", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1290[] = { + { + .name = "SCCDrvModeRValue", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCC_Equip", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AebDrvSetStatus", + .b1 = 4, + .b2 = 3, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Lead_Veh_Dep_Alert_USM", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1292[] = { + { + .name = "CF_Clu_LowfuelWarn", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_RefDetMod", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_AvgFCU", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_AvsmCur", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_AvgFCI", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 0.1, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_DrivingModeSwi", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_FuelDispLvl", + .b1 = 18, + .b2 = 5, + .bo = 41, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_FlexSteerSW", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_DTE", + .b1 = 24, + .b2 = 10, + .bo = 30, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_TripUnit", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_SWL_Stat", + .b1 = 36, + .b2 = 3, + .bo = 25, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_ActiveEcoSW", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_EcoDriveInf", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_IsaMainSW", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_LdwsLkasSW", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_AltLStatus", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_AliveCnt2", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1301[] = { + { + .name = "CF_Clu_ADrUNValueSet", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_ADrLNValueSet", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_EscortHLNValueSet", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_DoorLSNValueSet", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_PSMNValueSet", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_TTUnlockNValueSet", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_PTGMNValueSet", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_SCMNValueSet", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_WlightNValueSet", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_TempUnitNValueSet", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_MoodLpNValueSet", + .b1 = 24, + .b2 = 3, + .bo = 37, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_TrfChgSet", + .b1 = 27, + .b2 = 2, + .bo = 35, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_OTTurnNValueSet", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_LcaNValueSet", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_RctaNValueSet", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_RcwNValueSet", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_EscOffNValueSet", + .b1 = 38, + .b2 = 3, + .bo = 23, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_SccNaviCrvNValueSet", + .b1 = 41, + .b2 = 2, + .bo = 21, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_SccNaviCamNValueSet", + .b1 = 43, + .b2 = 2, + .bo = 19, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_SccAebNValueSet", + .b1 = 45, + .b2 = 2, + .bo = 17, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_LkasModeNValueSet", + .b1 = 47, + .b2 = 2, + .bo = 15, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_FcwNValueSet", + .b1 = 51, + .b2 = 2, + .bo = 11, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_PasSpkrLvNValueSet", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_SccDrvModeNValueSet", + .b1 = 56, + .b2 = 3, + .bo = 5, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_HAnBNValueSet", + .b1 = 59, + .b2 = 2, + .bo = 3, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_HfreeTrunkTgNValueSet", + .b1 = 61, + .b2 = 3, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1307[] = { + { + .name = "CF_Clu_TirePressUnitNValueSet", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_SlifNValueSet", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_RearWiperNValueSet", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1312[] = { + { + .name = "CR_Photosensor_LH", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 78.125, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Photosensor_RH", + .b1 = 10, + .b2 = 8, + .bo = 46, + .is_signed = false, + .factor = 78.125, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Hoodsw_memory", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_MirOutTempSns", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.5, + .offset = -40.5, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1313[] = { + { + .name = "C_DRVDoorStatus", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_ASTDoorStatus", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_RLDoorStatus", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_RRDoorStatus", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_TrunkStatus", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_OSMirrorStatus", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1314[] = { + { + .name = "C_AV_Tail", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_ParkingBrakeSW", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_RKECMD", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_BAState", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_IGNSW", + .b1 = 12, + .b2 = 3, + .bo = 49, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_CountryCfg", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_TailLampActivity", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RearSW_RSELockOnOff", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_SMKTeleCrankingState", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_SMKTeleCrankingFailRes", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1315[] = { + { + .name = "C_ModeSW", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_MuteSW", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_SeekDnSW", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_SeekUpSW", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_BTPhoneCallSW", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_BTPhoneHangUpSW", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_DISCDownSW", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_DISCUpSW", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_SdsSW", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_MTSSW", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_VolDnSW", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_VolUpSW", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1316[] = { + { + .name = "C_ADrLUNValueConf", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_TwUnNValueConf", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_AlarmNValueConf", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_PSMNValueConf", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_SCMNValueConf", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_HLEscortNValueConf", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_WELNValueConf", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_TriTurnLNValueConf", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1317[] = { + { + .name = "C_ADrLRValue", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_ADrURValue", + .b1 = 4, + .b2 = 3, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_TwUnRValue", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_ABuzzerRValue", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_ArmWKeyRValue", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_PSMRValue", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_SCMRValue", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_HLEscortRValue", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_WELRValue", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_TriTurnLRValue", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1318[] = { + { + .name = "C_ADrLURValueReq", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_TwUnRValueReq", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_AlarmRValueReq", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_IMSRValueReq", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_HLEscortRValueReq", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_WELRValueReq", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_TriTurnLRValueReq", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_SNVWarnRValueReq", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_LkasWarnRValueReq", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1319[] = { + { + .name = "C_ADrLNValueSet", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_ADrUNValueSet", + .b1 = 4, + .b2 = 3, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_TwUnNValueSet", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_ABuzzerNValueSet", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_ArmWKeyNValueSet", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_PSMNValueSet", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_SCMNValueSet", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_HLEscortNValueSet", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_WELNValueSet", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_TriTurnLNValueSet", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_SNVWarnNValueSet", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_LkasWarnNValueSet", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1322[] = { + { + .name = "CF_Clu_VehicleSpeed", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_Gear", + .b1 = 9, + .b2 = 4, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_HudInfoSet", + .b1 = 13, + .b2 = 7, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_HudFontColorSet", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_HudBrightUpSW", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_HudBrightDnSW", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_HudHeightUpSW", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_HudHeightDnSW", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_HudSet", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_HudFontSizeSet", + .b1 = 31, + .b2 = 2, + .bo = 31, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_LanguageInfo", + .b1 = 33, + .b2 = 5, + .bo = 26, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_ClusterSound", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = true, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Clu_VehicleSpeed2", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1338[] = { + { + .name = "CF_Gway_TeleReqDrLock", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_TeleReqDrUnlock", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_TeleReqHazard", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_TeleReqHorn", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_TeleReqEngineOperate", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1342[] = { + { + .name = "CF_Lkas_TsrSlifOpt", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_LkasTsrStatus", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_TsrSpeed_Display_Clu", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_LkasTsrSpeed_Display_Navi", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_TsrAddinfo_Display", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lkas_Daw_USM", + .b1 = 37, + .b2 = 3, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_LkasDawStatus", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1345[] = { + { + .name = "CF_Gway_IGNSw", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RKECmd", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_DrvKeyLockSw", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_DrvKeyUnlockSw", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_DrvDrSw", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_DrvSeatBeltSw", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_TrunkTgSw", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_AstSeatBeltSw", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_SMKOption", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_HoodSw", + .b1 = 17, + .b2 = 2, + .bo = 45, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_TurnSigLh", + .b1 = 19, + .b2 = 2, + .bo = 43, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_WiperIntT", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_WiperIntSw", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_WiperLowSw", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_WiperHighSw", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_WiperAutoSw", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RainSnsState", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_HeadLampLow", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_HeadLampHigh", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_HazardSw", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_AstDrSw", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_DefoggerRly", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_ALightStat", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_LightSwState", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_Frt_Fog_Act", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_TSigRHSw", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_TSigLHSw", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_DriveTypeOption", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_StarterRlyState", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PassiveAccessLock", + .b1 = 45, + .b2 = 2, + .bo = 17, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_WiperMistSw", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PassiveAccessUnlock", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RrSunRoofOpenState", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PassingSW", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_HBAControlMode", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_HLpHighSw", + .b1 = 53, + .b2 = 1, + .bo = 10, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_InhibitRMT", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RainSnsOption", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "C_SunRoofOpenState", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_Ign1", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_Ign2", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_ParkBrakeSw", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_TurnSigRh", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1348[] = { + { + .name = "SpeedLim_Nav_Clu", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1349[] = { + { + .name = "IMMO_LAMP_STAT", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "L_MIL", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IM_STAT", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AMP_CAN", + .b1 = 3, + .b2 = 5, + .bo = 56, + .is_signed = false, + .factor = 10.731613, + .offset = 458.98, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BAT_Alt_FR_Duty", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.4, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VB", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.1015625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EMS_VS", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 0.0625, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TEMP_FUEL", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.75, + .offset = -48.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1350[] = { + { + .name = "CF_DiBox_FrtInjVDiagReg0", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_FrtInjVDiagReg1", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_FrtInjVDiagReg2", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_SedInjVDiagReg0", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_SedInjVDiagReg1", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_SedInjVDiagReg2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_DiBox_BatVol", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.1, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_SedInjVChg", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_FrtInjVChg", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_SedInjVErrSPI", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DiBox_FrtInjVErrSPI", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1351[] = { + { + .name = "ECGPOvrd", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "QECACC", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ECFail", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SwitchOffCondExt", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BLECFail", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ems_IsaAct", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FA_PV_CAN", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.3906, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IntAirTemp", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.75, + .offset = -48.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_DC_OBD", + .b1 = 24, + .b2 = 7, + .bo = 33, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "INH_DC_OBD", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR_IG_CYC_OBD", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR_CDN_OBD", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1353[] = { + { + .name = "BAT_SNSR_I", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = -327.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BAT_SOC", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BAT_SNSR_V", + .b1 = 24, + .b2 = 14, + .bo = 26, + .is_signed = false, + .factor = 0.001, + .offset = 6.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BAT_SNSR_Temp", + .b1 = 38, + .b2 = 9, + .bo = 17, + .is_signed = true, + .factor = 0.5, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BAT_SNSR_State", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BAT_SOH", + .b1 = 48, + .b2 = 7, + .bo = 9, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BAT_SNSR_Invalid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BAT_SOF", + .b1 = 56, + .b2 = 7, + .bo = 1, + .is_signed = false, + .factor = 0.1, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BAT_SNSR_Error", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1355[] = { + { + .name = "CF_Vcu_SbwWarnMsg", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1356[] = { + { + .name = "Vehicle_Stop_Time", + .b1 = 0, + .b2 = 5, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HILL_HOLD_WARNING", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1360[] = { + { + .name = "CF_Iap_EcoPmodSwi", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Iap_EcoPmodAct", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Iap_ReqWarn", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1362[] = { + { + .name = "CF_SNV_DisplayControl", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Snv_BeepWarning", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Snv_WarningMessage", + .b1 = 4, + .b2 = 3, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Snv_DetectionEnable", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Snv_PedestrianDetect", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Snv_IRLampControl", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1363[] = { + { + .name = "CF_Gway_GwayDiagState", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_DDMDiagState", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_SCMDiagState", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PSMDiagState", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_SJBDiagState", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_IPMDiagState", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_LDMFail", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_CLUSwGuiCtrl", + .b1 = 10, + .b2 = 3, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_CLUSwGroup", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_CLUSwMode", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_CLUSwEnter", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_AutoLightValue", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_BrakeFluidSw", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_DrvSeatBeltInd", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_AvTail", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RearFogAct", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_ExtTailAct", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RRDrSw", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RLDrSw", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_IntTailAct", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_CountryCfg", + .b1 = 26, + .b2 = 3, + .bo = 35, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_WiperParkPosition", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_HLLowLHFail", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_HLLowRHFail", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_ESCLFailWarn", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_ESCLNotLockedWarn", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_ESCLNotUnlockWarn", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_IDoutWarn", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_ImmoLp", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_BCMRKEID", + .b1 = 41, + .b2 = 3, + .bo = 20, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_VehicleNotPWarn", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_DeactivationWarn", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_KeyBATDischargeWarn", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_SSBWarn", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_SMKFobID", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_SMKRKECmd", + .b1 = 51, + .b2 = 3, + .bo = 10, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_AutoLightOption", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_SJBDeliveryMode", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_KeyoutLp", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_SMKDispWarn", + .b1 = 57, + .b2 = 4, + .bo = 3, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_WngBuz", + .b1 = 61, + .b2 = 3, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1365[] = { + { + .name = "CR_Fpcm_LPActPre", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 3.137254902, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fpcm_LPPumpOverCur", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fpcm_PreSnrHi", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fpcm_PreSnrDisc", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fpcm_PreSnrShort", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fpcm_LPPumpDiscShort", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fpcm_LP_System_Error", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fpcm_PreSnrSigErr", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Fpcm_LPCtrCirFlt", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1366[] = { + { + .name = "PID_04h", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.3921568627, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PID_05h", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PID_0Ch", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.25, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PID_0Dh", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PID_11h", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.3921568627, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PID_03h", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1367[] = { + { + .name = "PID_06h", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.78125, + .offset = -100.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PID_07h", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.78125, + .offset = -100.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PID_08h", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.78125, + .offset = -100.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PID_09h", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.78125, + .offset = -100.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PID_0Bh", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PID_23h", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 10.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1369[] = { + { + .name = "CF_Gway_MemoryP1Cmd", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_MemoryP2Cmd", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PBackP1Cmd", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PBackP2Cmd", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_StrgWhlHeatedState", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PBackStopCmd", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_StaticBendLhAct", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_StaticBendRhAct", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_DrvWdwStat", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RLWdwState", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RRWdwState", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_AstWdwStat", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_MemoryEnable", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PBACKStopCmd", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_PBACKStop", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_IMSBuzzer", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_DrvSeatBeltInd", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_AstSeatBeltInd", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RCSeatBeltInd", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RLSeatBeltInd", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RRSeatBeltInd", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RrWiperHighSw", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Gway_RrWiperLowSw", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1370[] = { + { + .name = "HU_AVM_Status", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1371[] = { + { + .name = "AVM_View", + .b1 = 0, + .b2 = 5, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVM_ParkingAssist_BtnSts", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVM_Display_Message", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVM_Popup_Msg", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVM_Ready", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVM_ParkingAssist_Step", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVM_FrontBtn_Type", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVM_Option", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVM_HU_FrontViewPointOpt", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVM_HU_RearView_Option", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVM_HU_FrontView_Option", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AVM_Version", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1378[] = { + { + .name = "CF_Hud_HeightStaus", + .b1 = 0, + .b2 = 5, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Hud_PBackStatus", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Hud_Brightness", + .b1 = 8, + .b2 = 5, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1379[] = { + { + .name = "PGS_State", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PGS_ParkGuideState", + .b1 = 8, + .b2 = 5, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PGS_Option", + .b1 = 16, + .b2 = 5, + .bo = 43, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PGS_Version", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1393[] = { + { + .name = "CR_Opi_Spd_Rpm", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 20.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Opi_Over_Temp", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Opi_Over_Cur", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Opi_Over_Vol", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Opi_Hall_Fail", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Opi_Flt", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Opi_Motor_Dir", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Opi_Romver", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Opi_PWM_Rate", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1395[] = { + { + .name = "HU_PGSSelectedMenu", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_PGSOption", + .b1 = 8, + .b2 = 5, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_AVM_ParkingAssistMenu", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_AVM_ParkingAssistSB", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1397[] = { + { + .name = "HU_AVM_Cal_Cmd", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_AVM_Cal_Method", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_AVM_Save_Controlpoint", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_AVM_PT_X", + .b1 = 8, + .b2 = 12, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_AVM_RearViewPointOpt", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_AVM_PT_Y", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_AVM_FrontViewPointOpt", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_AVM_SelectedMenu", + .b1 = 40, + .b2 = 5, + .bo = 19, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_AVM_CameraOff", + .b1 = 45, + .b2 = 2, + .bo = 17, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_AVM_Option", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_AVM_CrossLineMove_Cmd", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_AVM_RearView_Option", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_AVM_FrontView_Option", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1407[] = { + { + .name = "HU_Type", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1411[] = { + { + .name = "CF_Cubis_HUDisp", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1412[] = { + { + .name = "CF_Aaf_ActFlapStatus", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Aaf_ModeStatus", + .b1 = 2, + .b2 = 3, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Aaf_WrnLamp", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Aaf_ErrStatus", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Aaf_OpenRqSysAct", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Aaf_PStatus", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Aaf_OpenRqSysSol", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Aaf_SolFlapStatus", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Aaf_MilOnReq", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1414[] = { + { + .name = "CF_Evp_Stat", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1415[] = { + { + .name = "CF_Tmu_VehSld", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tmu_VehImmo", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tmu_ReqRepCnd", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tmu_AirconCtr", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tmu_TempMd", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tmu_TempSet", + .b1 = 6, + .b2 = 16, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tmu_DefrostCtr", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Tmu_AliveCnt1", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1419[] = { + { + .name = "CF_Lca_Stat", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Rcta_Stat", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lca_IndLeft", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Rcw_Stat", + .b1 = 10, + .b2 = 4, + .bo = 50, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_RCW_Warning", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lca_IndRight", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lca_SndWan_Stat", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_FR_SndWan", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_FL_SndWan", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_RR_SndWan", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_RL_SndWan", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lca_IndBriLeft", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Lca_IndBriRight", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_RCTA_IndBriLeft", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_RCTA_IndBriRight", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_RCTA_IndLeft", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_RCTA_IndRight", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_SndWarnForClu", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1425[] = { + { + .name = "AFLS_STAT", + .b1 = 1, + .b2 = 2, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Afls_TrfChgStat", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Afls_LedHLStat", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1426[] = { + { + .name = "CC_React", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1427[] = { + { + .name = "TPMS_W_LAMP", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TREAD_W_LAMP", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "POS_FL_W_LAMP", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "POS_FR_W_LAMP", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "POS_RL_W_LAMP", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "POS_RR_W_LAMP", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STATUS_TPMS", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UNIT", + .b1 = 11, + .b2 = 2, + .bo = 51, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PRESSURE_FL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PRESSURE_FR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PRESSURE_RL", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PRESSURE_RR", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1430[] = { + { + .name = "CR_Ldc_ActVol_LS_V", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1434[] = { + { + .name = "PSB_LH_FAIL", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PSB_LH_TGL", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PSB_LH_ACT", + .b1 = 3, + .b2 = 4, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PSB_RH_FAIL", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PSB_RH_TGL", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PSB_RH_ACT", + .b1 = 11, + .b2 = 4, + .bo = 49, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1437[] = { + { + .name = "CF_Ahls_WarnLamp", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ahls_WarnMsg", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1440[] = { + { + .name = "CF_Ods_SNRcv", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ods_IDRcv", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ods_RZReq", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Abg_DepInhEnt", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Abg_DepEnt", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_PasBkl_FltStat", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DriBkl_FltStat", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_PasBkl_Stat", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_DriBkl_Stat", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_SWL_Ind", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Acu_FltStat", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Acu_ExtOfSab", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Acu_Dtc", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Acu_NumOfFlt", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1441[] = { + { + .name = "CR_Acu_SN", + .b1 = 0, + .b2 = 64, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1456[] = { + { + .name = "CF_Clu_Odometer", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = false, + .factor = 0.1, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1472[] = { + { + .name = "Audio_VolumeDown", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Pas_Spkr_Flh_Alarm", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Pas_Spkr_Fcnt_Alarm", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Pas_Spkr_Frh_Alarm", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Pas_Spkr_Rlh_Alarm", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Pas_Spkr_Rcnt_Alarm", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Pas_Spkr_Rrh_Alarm", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1479[] = { + { + .name = "SCR_LEVEL_WARN_LAMP", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_LEVEL_WARN", + .b1 = 1, + .b2 = 3, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_SYS_ERROR_WARN", + .b1 = 4, + .b2 = 3, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_SYSTEM_WARN_LAMP", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_INDUCEMENT_EXIT_COND", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_UREA_LEVEL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.5, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_NO_REMAINING_RESTARTS", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_REMAINING_DISTANCE", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1490[] = { + { + .name = "HU_DATC_RearOnOffSet", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_DATC_ADSOnOffSet", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1491[] = { + { + .name = "HU_VRActivity", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HU_PhoneActivity", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BlowerNoiseControl", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1492[] = { + { + .name = "TMU_IVRActivity", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TMU_PhoneActivity", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1530[] = { + { + .name = "CF_Ods_PrcCmd", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ods_BtsFail", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ods_AcuRcvSN", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ods_EolCal", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ods_PsFail", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ods_EcuFail", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ods_WgtStat", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CF_Ods_OccStat", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Wcs_ErrStat", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Wcs_ClassStat", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1531[] = { + { + .name = "CR_Ods_SerNum0", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ods_SerNum1", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ods_SerNum2", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ods_SerNum3", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ods_SerNum4", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ods_SerNum5", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ods_SerNum6", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ods_SerNum7", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1532[] = { + { + .name = "CR_Ods_ID", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ods_Chksum_H", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ods_Chksum_L", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ods_RomID_H", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CR_Ods_RomID_L", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1535[] = { + { + .name = "CF_Vcu_EpbRequest", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1984[] = { + { + .name = "CCW", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SAS_CID", + .b1 = 4, + .b2 = 11, + .bo = 49, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "ACU13", + .address = 0x10, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_16), + .sigs = sigs_16, + }, + { + .name = "EMS18", + .address = 0x30, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_48), + .sigs = sigs_48, + }, + { + .name = "DATC14", + .address = 0x40, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_64), + .sigs = sigs_64, + }, + { + .name = "DATC12", + .address = 0x42, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_66), + .sigs = sigs_66, + }, + { + .name = "DATC13", + .address = 0x43, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_67), + .sigs = sigs_67, + }, + { + .name = "DATC11", + .address = 0x44, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_68), + .sigs = sigs_68, + }, + { + .name = "CGW5", + .address = 0x7F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_127), + .sigs = sigs_127, + }, + { + .name = "EMS_DCT11", + .address = 0x80, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_128), + .sigs = sigs_128, + }, + { + .name = "EMS_DCT12", + .address = 0x81, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_129), + .sigs = sigs_129, + }, + { + .name = "TCU11", + .address = 0x111, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_273), + .sigs = sigs_273, + }, + { + .name = "TCU12", + .address = 0x112, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_274), + .sigs = sigs_274, + }, + { + .name = "TCU13", + .address = 0x113, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_275), + .sigs = sigs_275, + }, + { + .name = "YRS11", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "YRS12", + .address = 0x140, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_320), + .sigs = sigs_320, + }, + { + .name = "TCS11", + .address = 0x153, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_339), + .sigs = sigs_339, + }, + { + .name = "AHB1", + .address = 0x160, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_352), + .sigs = sigs_352, + }, + { + .name = "TCU_DCT13", + .address = 0x162, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_354), + .sigs = sigs_354, + }, + { + .name = "VSM11", + .address = 0x164, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_356), + .sigs = sigs_356, + }, + { + .name = "S_MDPS12", + .address = 0x165, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_357), + .sigs = sigs_357, + }, + { + .name = "REA11", + .address = 0x183, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_387), + .sigs = sigs_387, + }, + { + .name = "EMS_H12", + .address = 0x18F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "EMS20", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "ESP12", + .address = 0x220, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_544), + .sigs = sigs_544, + }, + { + .name = "MDPS12", + .address = 0x251, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_593), + .sigs = sigs_593, + }, + { + .name = "EMS16", + .address = 0x260, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_608), + .sigs = sigs_608, + }, + { + .name = "LPI11", + .address = 0x271, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_625), + .sigs = sigs_625, + }, + { + .name = "EMS13", + .address = 0x280, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_640), + .sigs = sigs_640, + }, + { + .name = "SAS11", + .address = 0x2B0, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_688), + .sigs = sigs_688, + }, + { + .name = "EMS11", + .address = 0x316, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_790), + .sigs = sigs_790, + }, + { + .name = "EMS12", + .address = 0x329, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_809), + .sigs = sigs_809, + }, + { + .name = "LKAS11", + .address = 0x340, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_832), + .sigs = sigs_832, + }, + { + .name = "M_356", + .address = 0x356, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_854), + .sigs = sigs_854, + }, + { + .name = "ADAS_PRK_11", + .address = 0x361, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_865), + .sigs = sigs_865, + }, + { + .name = "EMS_366", + .address = 0x366, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_870), + .sigs = sigs_870, + }, + { + .name = "LVR12", + .address = 0x367, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_871), + .sigs = sigs_871, + }, + { + .name = "LVR11", + .address = 0x368, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_872), + .sigs = sigs_872, + }, + { + .name = "E_EMS11", + .address = 0x371, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_881), + .sigs = sigs_881, + }, + { + .name = "ELECT_GEAR", + .address = 0x372, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_882), + .sigs = sigs_882, + }, + { + .name = "DI_BOX13", + .address = 0x380, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_896), + .sigs = sigs_896, + }, + { + .name = "MDPS11", + .address = 0x381, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_897), + .sigs = sigs_897, + }, + { + .name = "FATC11", + .address = 0x383, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_899), + .sigs = sigs_899, + }, + { + .name = "EMS17", + .address = 0x384, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_900), + .sigs = sigs_900, + }, + { + .name = "WHL_SPD11", + .address = 0x386, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_902), + .sigs = sigs_902, + }, + { + .name = "WHL_PUL11", + .address = 0x387, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_903), + .sigs = sigs_903, + }, + { + .name = "SCC14", + .address = 0x389, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_905), + .sigs = sigs_905, + }, + { + .name = "ABS11", + .address = 0x38A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_906), + .sigs = sigs_906, + }, + { + .name = "RSPA11", + .address = 0x38C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_908), + .sigs = sigs_908, + }, + { + .name = "FCA11", + .address = 0x38D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_909), + .sigs = sigs_909, + }, + { + .name = "WHL_SPD12_FS", + .address = 0x38E, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_910), + .sigs = sigs_910, + }, + { + .name = "WHL_SPD13_FS", + .address = 0x38F, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_911), + .sigs = sigs_911, + }, + { + .name = "SPAS11", + .address = 0x390, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_912), + .sigs = sigs_912, + }, + { + .name = "BCM_PO_11", + .address = 0x391, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_913), + .sigs = sigs_913, + }, + { + .name = "S_MDPS11", + .address = 0x392, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_914), + .sigs = sigs_914, + }, + { + .name = "TCS12", + .address = 0x393, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_915), + .sigs = sigs_915, + }, + { + .name = "TCS13", + .address = 0x394, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_916), + .sigs = sigs_916, + }, + { + .name = "ECS12", + .address = 0x3F9, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_1017), + .sigs = sigs_1017, + }, + { + .name = "CLU_CFG11", + .address = 0x400, + .size = 2, + .num_sigs = ARRAYSIZE(sigs_1024), + .sigs = sigs_1024, + }, + { + .name = "CGW_USM1", + .address = 0x410, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1040), + .sigs = sigs_1040, + }, + { + .name = "ICM_412h", + .address = 0x412, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1042), + .sigs = sigs_1042, + }, + { + .name = "SCC11", + .address = 0x420, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1056), + .sigs = sigs_1056, + }, + { + .name = "SCC12", + .address = 0x421, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1057), + .sigs = sigs_1057, + }, + { + .name = "_4WD11", + .address = 0x428, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1064), + .sigs = sigs_1064, + }, + { + .name = "_4WD12", + .address = 0x429, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1065), + .sigs = sigs_1065, + }, + { + .name = "_4WD13", + .address = 0x42A, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_1066), + .sigs = sigs_1066, + }, + { + .name = "PAS11", + .address = 0x436, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_1078), + .sigs = sigs_1078, + }, + { + .name = "P_STS", + .address = 0x470, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1136), + .sigs = sigs_1136, + }, + { + .name = "ESP11", + .address = 0x47F, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_1151), + .sigs = sigs_1151, + }, + { + .name = "FCA12", + .address = 0x483, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1155), + .sigs = sigs_1155, + }, + { + .name = "HDA11_MFC", + .address = 0x484, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1156), + .sigs = sigs_1156, + }, + { + .name = "LFAHDA_MFC", + .address = 0x485, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_1157), + .sigs = sigs_1157, + }, + { + .name = "BCA11", + .address = 0x48A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1162), + .sigs = sigs_1162, + }, + { + .name = "EPB11", + .address = 0x490, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_1168), + .sigs = sigs_1168, + }, + { + .name = "EMS19", + .address = 0x492, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1170), + .sigs = sigs_1170, + }, + { + .name = "YRS13", + .address = 0x495, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1173), + .sigs = sigs_1173, + }, + { + .name = "FRT_RADAR11", + .address = 0x4A2, + .size = 2, + .num_sigs = ARRAYSIZE(sigs_1186), + .sigs = sigs_1186, + }, + { + .name = "MFC_4a7", + .address = 0x4A7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1191), + .sigs = sigs_1191, + }, + { + .name = "CLU11", + .address = 0x4F1, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_1265), + .sigs = sigs_1265, + }, + { + .name = "SPAS12", + .address = 0x4F4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1268), + .sigs = sigs_1268, + }, + { + .name = "ACU14", + .address = 0x500, + .size = 1, + .num_sigs = ARRAYSIZE(sigs_1280), + .sigs = sigs_1280, + }, + { + .name = "ECS11", + .address = 0x501, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_1281), + .sigs = sigs_1281, + }, + { + .name = "TCU14", + .address = 0x502, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_1282), + .sigs = sigs_1282, + }, + { + .name = "TCS15", + .address = 0x507, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_1287), + .sigs = sigs_1287, + }, + { + .name = "SCC13", + .address = 0x50A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1290), + .sigs = sigs_1290, + }, + { + .name = "CLU13", + .address = 0x50C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1292), + .sigs = sigs_1292, + }, + { + .name = "CLU14", + .address = 0x515, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1301), + .sigs = sigs_1301, + }, + { + .name = "CLU16", + .address = 0x51B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1307), + .sigs = sigs_1307, + }, + { + .name = "CGW3", + .address = 0x520, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1312), + .sigs = sigs_1312, + }, + { + .name = "GW_DDM_PE", + .address = 0x521, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1313), + .sigs = sigs_1313, + }, + { + .name = "GW_IPM_PE_1", + .address = 0x522, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1314), + .sigs = sigs_1314, + }, + { + .name = "GW_SWRC_PE", + .address = 0x523, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1315), + .sigs = sigs_1315, + }, + { + .name = "GW_HU_E_00", + .address = 0x524, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1316), + .sigs = sigs_1316, + }, + { + .name = "GW_HU_E_01", + .address = 0x525, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1317), + .sigs = sigs_1317, + }, + { + .name = "HU_GW_E_00", + .address = 0x526, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1318), + .sigs = sigs_1318, + }, + { + .name = "HU_GW_E_01", + .address = 0x527, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1319), + .sigs = sigs_1319, + }, + { + .name = "CLU15", + .address = 0x52A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1322), + .sigs = sigs_1322, + }, + { + .name = "TMU_GW_E_01", + .address = 0x53A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1338), + .sigs = sigs_1338, + }, + { + .name = "LKAS12", + .address = 0x53E, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_1342), + .sigs = sigs_1342, + }, + { + .name = "CGW1", + .address = 0x541, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1345), + .sigs = sigs_1345, + }, + { + .name = "Navi_HU", + .address = 0x544, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1348), + .sigs = sigs_1348, + }, + { + .name = "EMS14", + .address = 0x545, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1349), + .sigs = sigs_1349, + }, + { + .name = "DI_BOX12", + .address = 0x546, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1350), + .sigs = sigs_1350, + }, + { + .name = "EMS15", + .address = 0x547, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1351), + .sigs = sigs_1351, + }, + { + .name = "BAT11", + .address = 0x549, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1353), + .sigs = sigs_1353, + }, + { + .name = "EV_PC6", + .address = 0x54B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1355), + .sigs = sigs_1355, + }, + { + .name = "TCU_DCT14", + .address = 0x54C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1356), + .sigs = sigs_1356, + }, + { + .name = "IAP11", + .address = 0x550, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_1360), + .sigs = sigs_1360, + }, + { + .name = "SNV11", + .address = 0x552, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_1362), + .sigs = sigs_1362, + }, + { + .name = "CGW2", + .address = 0x553, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1363), + .sigs = sigs_1363, + }, + { + .name = "FPCM11", + .address = 0x555, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1365), + .sigs = sigs_1365, + }, + { + .name = "EngFrzFrm11", + .address = 0x556, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1366), + .sigs = sigs_1366, + }, + { + .name = "EngFrzFrm12", + .address = 0x557, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1367), + .sigs = sigs_1367, + }, + { + .name = "CGW4", + .address = 0x559, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1369), + .sigs = sigs_1369, + }, + { + .name = "HU_AVM_PE_00", + .address = 0x55A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1370), + .sigs = sigs_1370, + }, + { + .name = "AVM_HU_PE_00", + .address = 0x55B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1371), + .sigs = sigs_1371, + }, + { + .name = "HUD11", + .address = 0x562, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_1378), + .sigs = sigs_1378, + }, + { + .name = "PGS_HU_PE_01", + .address = 0x563, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1379), + .sigs = sigs_1379, + }, + { + .name = "OPI11", + .address = 0x571, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_1393), + .sigs = sigs_1393, + }, + { + .name = "HU_AVM_E_01", + .address = 0x573, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1395), + .sigs = sigs_1395, + }, + { + .name = "HU_AVM_E_00", + .address = 0x575, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1397), + .sigs = sigs_1397, + }, + { + .name = "HU_MON_PE_01", + .address = 0x57F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1407), + .sigs = sigs_1407, + }, + { + .name = "CUBIS11", + .address = 0x583, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1411), + .sigs = sigs_1411, + }, + { + .name = "AAF11", + .address = 0x584, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1412), + .sigs = sigs_1412, + }, + { + .name = "EVP11", + .address = 0x586, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_1414), + .sigs = sigs_1414, + }, + { + .name = "TMU11", + .address = 0x587, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1415), + .sigs = sigs_1415, + }, + { + .name = "LCA11", + .address = 0x58B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1419), + .sigs = sigs_1419, + }, + { + .name = "AFLS11", + .address = 0x591, + .size = 2, + .num_sigs = ARRAYSIZE(sigs_1425), + .sigs = sigs_1425, + }, + { + .name = "LABEL11", + .address = 0x592, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1426), + .sigs = sigs_1426, + }, + { + .name = "TPMS11", + .address = 0x593, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_1427), + .sigs = sigs_1427, + }, + { + .name = "EV_PC2", + .address = 0x596, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1430), + .sigs = sigs_1430, + }, + { + .name = "PSB11", + .address = 0x59A, + .size = 2, + .num_sigs = ARRAYSIZE(sigs_1434), + .sigs = sigs_1434, + }, + { + .name = "AHLS11", + .address = 0x59D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1437), + .sigs = sigs_1437, + }, + { + .name = "ACU11", + .address = 0x5A0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1440), + .sigs = sigs_1440, + }, + { + .name = "ACU12", + .address = 0x5A1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1441), + .sigs = sigs_1441, + }, + { + .name = "CLU12", + .address = 0x5B0, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_1456), + .sigs = sigs_1456, + }, + { + .name = "GW_Warning_PE", + .address = 0x5C0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1472), + .sigs = sigs_1472, + }, + { + .name = "EMS21", + .address = 0x5C7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1479), + .sigs = sigs_1479, + }, + { + .name = "HU_DATC_E_02", + .address = 0x5D2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1490), + .sigs = sigs_1490, + }, + { + .name = "HU_DATC_PE_00", + .address = 0x5D3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1491), + .sigs = sigs_1491, + }, + { + .name = "TMU_GW_PE_01", + .address = 0x5D4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1492), + .sigs = sigs_1492, + }, + { + .name = "ODS11", + .address = 0x5FA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1530), + .sigs = sigs_1530, + }, + { + .name = "ODS12", + .address = 0x5FB, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1531), + .sigs = sigs_1531, + }, + { + .name = "ODS13", + .address = 0x5FC, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_1532), + .sigs = sigs_1532, + }, + { + .name = "EV_PC10", + .address = 0x5FF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1535), + .sigs = sigs_1535, + }, + { + .name = "CAL_SAS11", + .address = 0x7C0, + .size = 2, + .num_sigs = ARRAYSIZE(sigs_1984), + .sigs = sigs_1984, + }, +}; + +const Val vals[] = { + { + .name = "CUR_GR", + .address = 0x112, + .def_val = "1 D 2 D 3 D 4 D 5 D 6 D 7 D 8 D 14 R 0 P", + .sigs = sigs_274, + }, + { + .name = "CF_Lvr_Gear", + .address = 0x367, + .def_val = "5 D 8 S 6 N 7 R 0 P", + .sigs = sigs_871, + }, + { + .name = "Elect_Gear_Shifter", + .address = 0x372, + .def_val = "5 D 8 S 6 N 7 R 0 P", + .sigs = sigs_882, + }, + { + .name = "ACCMode", + .address = 0x389, + .def_val = "0 OFF 1 ENABLED 2 DRIVER_OVERRIDE 3 OFF_MAYBE_FAULT 4 CANCELLED", + .sigs = sigs_905, + }, + { + .name = "CF_VSM_Warn", + .address = 0x38D, + .def_val = "2 FCW 3 AEB", + .sigs = sigs_909, + }, + { + .name = "ACCMode", + .address = 0x421, + .def_val = "0 OFF 1 ENABLED 2 DRIVER_OVERRIDE 3 OFF_MAYBE_FAULT", + .sigs = sigs_1057, + }, + { + .name = "HDA_Icon_State", + .address = 0x485, + .def_val = "0 NO_HDA 1 WHITE_HDA 2 GREEN_HDA", + .sigs = sigs_1157, + }, + { + .name = "HDA_SysWarning", + .address = 0x485, + .def_val = "0 NO_MESSAGE 1 DRIVING_CONVENIENCE_SYSTEMS_CANCELLED 2 HIGHWAY_DRIVE_ASSIST_SYSTEM_CANCELLED", + .sigs = sigs_1157, + }, + { + .name = "LFA_Icon_State", + .address = 0x485, + .def_val = "0 NO_WHEEL 1 WHITE_WHEEL 2 GREEN_WHEEL 3 GREEN_WHEEL_BLINK", + .sigs = sigs_1157, + }, + { + .name = "LFA_SysWarning", + .address = 0x485, + .def_val = "0 NO_MESSAGE 1 SWITCHING_TO_HDA 2 SWITCHING_TO_SCC 3 LFA_ERROR 4 CHECK_HDA 5 KEEP_HANDS_ON_WHEEL_ORANGE 6 KEEP_HANDS_ON_WHEEL_RED", + .sigs = sigs_1157, + }, + { + .name = "CF_Clu_Gear", + .address = 0x52A, + .def_val = "1 P 2 R 4 N 8 D", + .sigs = sigs_1322, + }, +}; + +} + +const DBC hyundai_kia_generic = { + .name = "hyundai_kia_generic", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(hyundai_kia_generic) \ No newline at end of file diff --git a/opendbc/can/dbc_out/hyundai_kia_mando_front_radar.cc b/opendbc/can/dbc_out/hyundai_kia_mando_front_radar.cc new file mode 100644 index 000000000..1f7fcdecf --- /dev/null +++ b/opendbc/can/dbc_out/hyundai_kia_mando_front_radar.cc @@ -0,0 +1,3830 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_1280[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1281[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1282[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1283[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1284[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1285[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1286[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1287[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1288[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1289[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1290[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1291[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1292[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1293[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1294[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1295[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1296[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1297[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1298[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1299[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1300[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1301[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1302[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1303[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1304[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1305[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1306[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1307[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1308[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1309[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1310[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1311[] = { + { + .name = "COUNTER", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UNKNOWN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AZIMUTH", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LONG_DIST", + .b1 = 21, + .b2 = 11, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_ACCEL", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZEROS", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_3", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 50, + .b2 = 14, + .bo = 0, + .is_signed = true, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE_2", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "RADAR_TRACK_500", + .address = 0x500, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1280), + .sigs = sigs_1280, + }, + { + .name = "RADAR_TRACK_501", + .address = 0x501, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1281), + .sigs = sigs_1281, + }, + { + .name = "RADAR_TRACK_502", + .address = 0x502, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1282), + .sigs = sigs_1282, + }, + { + .name = "RADAR_TRACK_503", + .address = 0x503, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1283), + .sigs = sigs_1283, + }, + { + .name = "RADAR_TRACK_504", + .address = 0x504, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1284), + .sigs = sigs_1284, + }, + { + .name = "RADAR_TRACK_505", + .address = 0x505, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1285), + .sigs = sigs_1285, + }, + { + .name = "RADAR_TRACK_506", + .address = 0x506, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1286), + .sigs = sigs_1286, + }, + { + .name = "RADAR_TRACK_507", + .address = 0x507, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1287), + .sigs = sigs_1287, + }, + { + .name = "RADAR_TRACK_508", + .address = 0x508, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1288), + .sigs = sigs_1288, + }, + { + .name = "RADAR_TRACK_509", + .address = 0x509, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1289), + .sigs = sigs_1289, + }, + { + .name = "RADAR_TRACK_50a", + .address = 0x50A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1290), + .sigs = sigs_1290, + }, + { + .name = "RADAR_TRACK_50b", + .address = 0x50B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1291), + .sigs = sigs_1291, + }, + { + .name = "RADAR_TRACK_50c", + .address = 0x50C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1292), + .sigs = sigs_1292, + }, + { + .name = "RADAR_TRACK_50d", + .address = 0x50D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1293), + .sigs = sigs_1293, + }, + { + .name = "RADAR_TRACK_50e", + .address = 0x50E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1294), + .sigs = sigs_1294, + }, + { + .name = "RADAR_TRACK_50f", + .address = 0x50F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1295), + .sigs = sigs_1295, + }, + { + .name = "RADAR_TRACK_510", + .address = 0x510, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1296), + .sigs = sigs_1296, + }, + { + .name = "RADAR_TRACK_511", + .address = 0x511, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1297), + .sigs = sigs_1297, + }, + { + .name = "RADAR_TRACK_512", + .address = 0x512, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1298), + .sigs = sigs_1298, + }, + { + .name = "RADAR_TRACK_513", + .address = 0x513, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1299), + .sigs = sigs_1299, + }, + { + .name = "RADAR_TRACK_514", + .address = 0x514, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1300), + .sigs = sigs_1300, + }, + { + .name = "RADAR_TRACK_515", + .address = 0x515, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1301), + .sigs = sigs_1301, + }, + { + .name = "RADAR_TRACK_516", + .address = 0x516, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1302), + .sigs = sigs_1302, + }, + { + .name = "RADAR_TRACK_517", + .address = 0x517, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1303), + .sigs = sigs_1303, + }, + { + .name = "RADAR_TRACK_518", + .address = 0x518, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1304), + .sigs = sigs_1304, + }, + { + .name = "RADAR_TRACK_519", + .address = 0x519, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1305), + .sigs = sigs_1305, + }, + { + .name = "RADAR_TRACK_51a", + .address = 0x51A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1306), + .sigs = sigs_1306, + }, + { + .name = "RADAR_TRACK_51b", + .address = 0x51B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1307), + .sigs = sigs_1307, + }, + { + .name = "RADAR_TRACK_51c", + .address = 0x51C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1308), + .sigs = sigs_1308, + }, + { + .name = "RADAR_TRACK_51d", + .address = 0x51D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1309), + .sigs = sigs_1309, + }, + { + .name = "RADAR_TRACK_51e", + .address = 0x51E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1310), + .sigs = sigs_1310, + }, + { + .name = "RADAR_TRACK_51f", + .address = 0x51F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1311), + .sigs = sigs_1311, + }, +}; + +const Val vals[] = { +}; + +} + +const DBC hyundai_kia_mando_front_radar = { + .name = "hyundai_kia_mando_front_radar", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(hyundai_kia_mando_front_radar) \ No newline at end of file diff --git a/opendbc/can/dbc_out/lexus_rx_350_2016_pt_generated.cc b/opendbc/can/dbc_out/lexus_rx_350_2016_pt_generated.cc new file mode 100644 index 000000000..f2063fdde --- /dev/null +++ b/opendbc/can/dbc_out/lexus_rx_350_2016_pt_generated.cc @@ -0,0 +1,3207 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_35[] = { + { + .name = "ZORRO_STEER", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = true, + .factor = 0.004901594652, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_36[] = { + { + .name = "YAW_RATE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 0.244, + .offset = -125.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_TORQUE", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Y", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = false, + .factor = 0.03589, + .offset = -18.375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_37[] = { + { + .name = "STEER_ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_RATE", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_FRACTION", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_166[] = { + { + .name = "BRAKE_AMOUNT", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PEDAL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_170[] = { + { + .name = "WHEEL_SPEED_FR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_180[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ENCODER", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_241[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X3", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_242[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "DECELERATION", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DS1STBK2", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DS1STAT2", + .b1 = 10, + .b2 = 3, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSOPR", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSALM", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSWAR", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IRLT_REQ", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEXTRGR", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IBTRGR", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PPTRGR", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBATRGR", + .b1 = 25, + .b2 = 2, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSABK", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBRTRGR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PREFILL", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VGRSTRGR", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AVSTRGR", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRKHLD", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBPREPMP", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSDIS", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_353[] = { + { + .name = "FORWARD_SPEED", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.00390625, + .offset = -30.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_359[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_452[] = { + { + .name = "RPM", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.78125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_466[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "GAS_RELEASED", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_ACTIVE", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL_ON", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_NET", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATE", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_467[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_550[] = { + { + .name = "BRAKE_PRESSURE", + .b1 = 7, + .b2 = 9, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_POSITION", + .b1 = 23, + .b2 = 9, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_552[] = { + { + .name = "ACCEL_X", + .b1 = 1, + .b2 = 15, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Z", + .b1 = 17, + .b2 = 15, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_560[] = { + { + .name = "BRAKE_PRESSED", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_608[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_OVERRIDE", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_DRIVER", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = true, + .factor = 0.0573, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_EPS", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = 0.73, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_610[] = { + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "IPAS_STATE", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TYPE", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 7, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_614[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_643[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "SET_ME_X00", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FORCE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X002", + .b1 = 38, + .b2 = 8, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 35, + .b2 = 3, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_STATUS", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X003", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PRECOLLISION_ACTIVE", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_705[] = { + { + .name = "GAS_PEDAL", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_740[] = { + { + .name = "COUNTER", + .b1 = 1, + .b2 = 6, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_REQUEST", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_CMD", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_742[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LEAD_LONG_DIST", + .b1 = 0, + .b2 = 13, + .bo = 51, + .is_signed = false, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_REL_SPEED", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_835[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X3", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_836[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, +}; +const Signal sigs_869[] = { + { + .name = "MAIN_ON", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_BTN", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_BTN", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RES_BTN", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_REQUEST", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 100, + .offset = -12800.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_DISTANCE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_921[] = { + { + .name = "MAIN_ON", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_STATE", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE_LINES", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_SET_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_951[] = { + { + .name = "VSC_DISABLED", + .b1 = 11, + .b2 = 2, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TC_DISABLED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS_ACC", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_956[] = { + { + .name = "SPORT_ON", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ECON_ON", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1041[] = { + { + .name = "FCW", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X20", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X80", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1042[] = { + { + .name = "BARRIERS", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_LINE", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_LINE", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_ALERT", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01_2", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TWO_BEEPS", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ADJUSTING_CAMERA", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_MALFUNCTION", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X0C", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REPEATED_BEEPS", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X2C", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X38", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X02", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1043[] = { + { + .name = "YEAR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MONTH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAY", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HOUR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINUTE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_MINUTES", + .b1 = 53, + .b2 = 6, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_HOURS", + .b1 = 49, + .b2 = 4, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMT_DIFF", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SUMMER", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1161[] = { + { + .name = "TSGN1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT1", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY1", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL1", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN2", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN1", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN2", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT2", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY2", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL2", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID1", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_A", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_P", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1162[] = { + { + .name = "TSGN3", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT3", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY3", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN4", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN3", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN4", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT4", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY4", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMA", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMP", + .b1 = 50, + .b2 = 3, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DPSGNREQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID2", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRWMSG", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDUNT", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1163[] = { + { + .name = "OVSPNTM", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NTLVLSPD", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OTSGNNTM", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRMSW", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSREQPD", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALL", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALH", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRSPU", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1408[] = { + { + .name = "VIN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_3", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_4", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_5", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_6", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_7", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_8", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1409[] = { + { + .name = "VIN_9", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_10", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_11", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_12", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_13", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_14", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_15", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_16", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1410[] = { + { + .name = "VIN_17", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1553[] = { + { + .name = "UNITS", + .b1 = 29, + .b2 = 2, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 44, + .b2 = 20, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1556[] = { + { + .name = "HAZARD_LIGHT", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TURN_SIGNALS", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1568[] = { + { + .name = "DOOR_OPEN_RL", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1570[] = { + { + .name = "FRONT_FOG", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARKING_LIGHT", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAM", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGH_BEAM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "SECONDARY_STEER_ANGLE", + .address = 0x23, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_35), + .sigs = sigs_35, + }, + { + .name = "KINEMATICS", + .address = 0x24, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_36), + .sigs = sigs_36, + }, + { + .name = "STEER_ANGLE_SENSOR", + .address = 0x25, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_37), + .sigs = sigs_37, + }, + { + .name = "BRAKE", + .address = 0xA6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_166), + .sigs = sigs_166, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0xAA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_170), + .sigs = sigs_170, + }, + { + .name = "SPEED", + .address = 0xB4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_180), + .sigs = sigs_180, + }, + { + .name = "ACC_CONTROL_ALT", + .address = 0xF1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_241), + .sigs = sigs_241, + }, + { + .name = "PRECOLLISION_2_ALT", + .address = 0xF2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_242), + .sigs = sigs_242, + }, + { + .name = "DSU_SPEED", + .address = 0x161, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_353), + .sigs = sigs_353, + }, + { + .name = "STEERING_IPAS_COMMA", + .address = 0x167, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_359), + .sigs = sigs_359, + }, + { + .name = "ENGINE_RPM", + .address = 0x1C4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_452), + .sigs = sigs_452, + }, + { + .name = "PCM_CRUISE", + .address = 0x1D2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_466), + .sigs = sigs_466, + }, + { + .name = "PCM_CRUISE_2", + .address = 0x1D3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_467), + .sigs = sigs_467, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "BRAKE_MODULE", + .address = 0x226, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_550), + .sigs = sigs_550, + }, + { + .name = "ACCELEROMETER", + .address = 0x228, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_552), + .sigs = sigs_552, + }, + { + .name = "BRAKE_MODULE2", + .address = 0x230, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_560), + .sigs = sigs_560, + }, + { + .name = "STEER_TORQUE_SENSOR", + .address = 0x260, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_608), + .sigs = sigs_608, + }, + { + .name = "EPS_STATUS", + .address = 0x262, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_610), + .sigs = sigs_610, + }, + { + .name = "STEERING_IPAS", + .address = 0x266, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_614), + .sigs = sigs_614, + }, + { + .name = "PRE_COLLISION", + .address = 0x283, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_643), + .sigs = sigs_643, + }, + { + .name = "GAS_PEDAL", + .address = 0x2C1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_705), + .sigs = sigs_705, + }, + { + .name = "STEERING_LKA", + .address = 0x2E4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_740), + .sigs = sigs_740, + }, + { + .name = "LEAD_INFO", + .address = 0x2E6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_742), + .sigs = sigs_742, + }, + { + .name = "ACC_CONTROL", + .address = 0x343, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_835), + .sigs = sigs_835, + }, + { + .name = "PRE_COLLISION_2", + .address = 0x344, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_836), + .sigs = sigs_836, + }, + { + .name = "DSU_CRUISE", + .address = 0x365, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_869), + .sigs = sigs_869, + }, + { + .name = "PCM_CRUISE_SM", + .address = 0x399, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_921), + .sigs = sigs_921, + }, + { + .name = "ESP_CONTROL", + .address = 0x3B7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_951), + .sigs = sigs_951, + }, + { + .name = "GEAR_PACKET", + .address = 0x3BC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_956), + .sigs = sigs_956, + }, + { + .name = "ACC_HUD", + .address = 0x411, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1041), + .sigs = sigs_1041, + }, + { + .name = "LKAS_HUD", + .address = 0x412, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1042), + .sigs = sigs_1042, + }, + { + .name = "TIME", + .address = 0x413, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1043), + .sigs = sigs_1043, + }, + { + .name = "RSA1", + .address = 0x489, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1161), + .sigs = sigs_1161, + }, + { + .name = "RSA2", + .address = 0x48A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1162), + .sigs = sigs_1162, + }, + { + .name = "RSA3", + .address = 0x48B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1163), + .sigs = sigs_1163, + }, + { + .name = "VIN_PART_1", + .address = 0x580, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1408), + .sigs = sigs_1408, + }, + { + .name = "VIN_PART_2", + .address = 0x581, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1409), + .sigs = sigs_1409, + }, + { + .name = "VIN_PART_3", + .address = 0x582, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1410), + .sigs = sigs_1410, + }, + { + .name = "UI_SETTING", + .address = 0x611, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1553), + .sigs = sigs_1553, + }, + { + .name = "STEERING_LEVERS", + .address = 0x614, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1556), + .sigs = sigs_1556, + }, + { + .name = "SEATS_DOORS", + .address = 0x620, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1568), + .sigs = sigs_1568, + }, + { + .name = "LIGHT_STALK", + .address = 0x622, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1570), + .sigs = sigs_1570, + }, +}; + +const Val vals[] = { + { + .name = "CRUISE_STATE", + .address = 0x1D2, + .def_val = "11 TIMER_3SEC 10 ADAPTIVE_CLICK_DOWN 9 ADAPTIVE_CLICK_UP 8 ADAPTIVE_ENGAGED 7 STANDSTILL 6 NON-ADAPTIVE_CLICK_UP 5 NON-ADAPTIVE_CLICK_DOWN 4 NON-ADAPTIVE_HOLD_DOWN 3 NON-ADAPTIVE_HOLD_UP 2 NON-ADAPTIVE_BEING_ENGAGED 1 NON-ADAPTIVE_ENGAGED 0 OFF", + .sigs = sigs_466, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .address = 0x1D3, + .def_val = "2 LOW_SPEED_LOCKED 1 OK", + .sigs = sigs_467, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "IPAS_STATE", + .address = 0x262, + .def_val = "5 OVERRIDE 3 ENABLED 1 DISABLED", + .sigs = sigs_610, + }, + { + .name = "LKA_STATE", + .address = 0x262, + .def_val = "25 TEMPORARY_FAULT 9 TEMPORARY_FAULT2 5 ACTIVE 1 STANDBY", + .sigs = sigs_610, + }, + { + .name = "DIRECTION_CMD", + .address = 0x266, + .def_val = "3 RIGHT 2 CENTER 1 LEFT", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x266, + .def_val = "3 ENABLED 1 DISABLED", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x283, + .def_val = "0 NORMAL 1 ADAPTIVE_CRUISE_CONTROL 3 EMERGENCY_BRAKING", + .sigs = sigs_643, + }, + { + .name = "CRUISE_CONTROL_STATE", + .address = 0x399, + .def_val = "2 DISABLED 11 HOLD 10 HOLD_WAITING_USER_CMD 6 ENABLED 5 FAULTED", + .sigs = sigs_921, + }, + { + .name = "ECON_ON", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "GEAR", + .address = 0x3BC, + .def_val = "0 D 1 S 8 N 16 R 32 P", + .sigs = sigs_956, + }, + { + .name = "SPORT_ON", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "BARRIERS", + .address = 0x412, + .def_val = "3 BOTH 2 RIGHT 1 LEFT 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LDA_ALERT", + .address = 0x412, + .def_val = "3 HOLD_WITH_CONTINUOUS_BEEP 2 LDA_UNAVAILABLE 1 HOLD 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LEFT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "RIGHT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "SPLSGN2", + .address = 0x489, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN1", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN2", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "SPLSGN3", + .address = 0x48A, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1162, + }, + { + .name = "TSGN3", + .address = 0x48A, + .def_val = "0 NONE 1 SPEED_SIGN 2 0_UNLIMITED 7 UNLIMITED 16 HIGHWAY 17 NO_HIGHWAY 18 MOTORWAY 19 NO_MOTORWAY 20 IN_CITY 21 OUTSIDE_CITY 22 PEDESTRIAN_AREA 23 NO_PEDESTRIAN_AREA 65 NO_OVERTAKING_LEFT 66 NO_OVERTAKING_RIGHT 67 OVERTAKING_ALLOWED_AGAIN 81 NO_RIGHT_TURN 97 STOP 105 YIELD 113 STOP 114 YIELD_US 129 NO_ENTRY 138 NO_ENTRY_TSS2 145 DO_NOT_ENTER", + .sigs = sigs_1162, + }, + { + .name = "UNITS", + .address = 0x611, + .def_val = "1 KM 2 MILES", + .sigs = sigs_1553, + }, + { + .name = "TURN_SIGNALS", + .address = 0x614, + .def_val = "3 NONE 2 RIGHT 1 LEFT", + .sigs = sigs_1556, + }, +}; + +} + +const DBC lexus_rx_350_2016_pt_generated = { + .name = "lexus_rx_350_2016_pt_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(lexus_rx_350_2016_pt_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/lexus_rx_hybrid_2017_pt_generated.cc b/opendbc/can/dbc_out/lexus_rx_hybrid_2017_pt_generated.cc new file mode 100644 index 000000000..0a2dc2a12 --- /dev/null +++ b/opendbc/can/dbc_out/lexus_rx_hybrid_2017_pt_generated.cc @@ -0,0 +1,3207 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_35[] = { + { + .name = "ZORRO_STEER", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = true, + .factor = 0.004901594652, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_36[] = { + { + .name = "YAW_RATE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 0.244, + .offset = -125.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_TORQUE", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Y", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = false, + .factor = 0.03589, + .offset = -18.375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_37[] = { + { + .name = "STEER_ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_RATE", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_FRACTION", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_166[] = { + { + .name = "BRAKE_AMOUNT", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PEDAL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_170[] = { + { + .name = "WHEEL_SPEED_FR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_180[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ENCODER", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_241[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X3", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_242[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "DECELERATION", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DS1STBK2", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DS1STAT2", + .b1 = 10, + .b2 = 3, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSOPR", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSALM", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSWAR", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IRLT_REQ", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEXTRGR", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IBTRGR", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PPTRGR", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBATRGR", + .b1 = 25, + .b2 = 2, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSABK", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBRTRGR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PREFILL", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VGRSTRGR", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AVSTRGR", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRKHLD", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBPREPMP", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSDIS", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_353[] = { + { + .name = "FORWARD_SPEED", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.00390625, + .offset = -30.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_359[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_452[] = { + { + .name = "RPM", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.78125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_466[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "GAS_RELEASED", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_ACTIVE", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL_ON", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_NET", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATE", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_467[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_550[] = { + { + .name = "BRAKE_PRESSURE", + .b1 = 7, + .b2 = 9, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_POSITION", + .b1 = 23, + .b2 = 9, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_552[] = { + { + .name = "ACCEL_X", + .b1 = 1, + .b2 = 15, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Z", + .b1 = 17, + .b2 = 15, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_560[] = { + { + .name = "BRAKE_PRESSED", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_581[] = { + { + .name = "GAS_PEDAL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_608[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_OVERRIDE", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_DRIVER", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = true, + .factor = 0.0573, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_EPS", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = 0.73, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_610[] = { + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "IPAS_STATE", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TYPE", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 7, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_614[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_643[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "SET_ME_X00", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FORCE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X002", + .b1 = 38, + .b2 = 8, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 35, + .b2 = 3, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_STATUS", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X003", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PRECOLLISION_ACTIVE", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_740[] = { + { + .name = "COUNTER", + .b1 = 1, + .b2 = 6, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_REQUEST", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_CMD", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_742[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LEAD_LONG_DIST", + .b1 = 0, + .b2 = 13, + .bo = 51, + .is_signed = false, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_REL_SPEED", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_835[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X3", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_836[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, +}; +const Signal sigs_869[] = { + { + .name = "MAIN_ON", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_BTN", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_BTN", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RES_BTN", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_REQUEST", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 100, + .offset = -12800.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_DISTANCE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_921[] = { + { + .name = "MAIN_ON", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_STATE", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE_LINES", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_SET_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_951[] = { + { + .name = "VSC_DISABLED", + .b1 = 11, + .b2 = 2, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TC_DISABLED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS_ACC", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_956[] = { + { + .name = "SPORT_ON", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ECON_ON", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1041[] = { + { + .name = "FCW", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X20", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X80", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1042[] = { + { + .name = "BARRIERS", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_LINE", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_LINE", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_ALERT", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01_2", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TWO_BEEPS", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ADJUSTING_CAMERA", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_MALFUNCTION", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X0C", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REPEATED_BEEPS", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X2C", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X38", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X02", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1043[] = { + { + .name = "YEAR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MONTH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAY", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HOUR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINUTE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_MINUTES", + .b1 = 53, + .b2 = 6, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_HOURS", + .b1 = 49, + .b2 = 4, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMT_DIFF", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SUMMER", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1161[] = { + { + .name = "TSGN1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT1", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY1", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL1", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN2", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN1", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN2", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT2", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY2", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL2", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID1", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_A", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_P", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1162[] = { + { + .name = "TSGN3", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT3", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY3", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN4", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN3", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN4", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT4", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY4", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMA", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMP", + .b1 = 50, + .b2 = 3, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DPSGNREQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID2", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRWMSG", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDUNT", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1163[] = { + { + .name = "OVSPNTM", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NTLVLSPD", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OTSGNNTM", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRMSW", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSREQPD", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALL", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALH", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRSPU", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1408[] = { + { + .name = "VIN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_3", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_4", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_5", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_6", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_7", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_8", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1409[] = { + { + .name = "VIN_9", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_10", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_11", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_12", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_13", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_14", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_15", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_16", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1410[] = { + { + .name = "VIN_17", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1553[] = { + { + .name = "UNITS", + .b1 = 29, + .b2 = 2, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 44, + .b2 = 20, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1556[] = { + { + .name = "HAZARD_LIGHT", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TURN_SIGNALS", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1568[] = { + { + .name = "DOOR_OPEN_RL", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1570[] = { + { + .name = "FRONT_FOG", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARKING_LIGHT", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAM", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGH_BEAM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "SECONDARY_STEER_ANGLE", + .address = 0x23, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_35), + .sigs = sigs_35, + }, + { + .name = "KINEMATICS", + .address = 0x24, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_36), + .sigs = sigs_36, + }, + { + .name = "STEER_ANGLE_SENSOR", + .address = 0x25, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_37), + .sigs = sigs_37, + }, + { + .name = "BRAKE", + .address = 0xA6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_166), + .sigs = sigs_166, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0xAA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_170), + .sigs = sigs_170, + }, + { + .name = "SPEED", + .address = 0xB4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_180), + .sigs = sigs_180, + }, + { + .name = "ACC_CONTROL_ALT", + .address = 0xF1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_241), + .sigs = sigs_241, + }, + { + .name = "PRECOLLISION_2_ALT", + .address = 0xF2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_242), + .sigs = sigs_242, + }, + { + .name = "DSU_SPEED", + .address = 0x161, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_353), + .sigs = sigs_353, + }, + { + .name = "STEERING_IPAS_COMMA", + .address = 0x167, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_359), + .sigs = sigs_359, + }, + { + .name = "ENGINE_RPM", + .address = 0x1C4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_452), + .sigs = sigs_452, + }, + { + .name = "PCM_CRUISE", + .address = 0x1D2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_466), + .sigs = sigs_466, + }, + { + .name = "PCM_CRUISE_2", + .address = 0x1D3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_467), + .sigs = sigs_467, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "BRAKE_MODULE", + .address = 0x226, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_550), + .sigs = sigs_550, + }, + { + .name = "ACCELEROMETER", + .address = 0x228, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_552), + .sigs = sigs_552, + }, + { + .name = "BRAKE_MODULE2", + .address = 0x230, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_560), + .sigs = sigs_560, + }, + { + .name = "GAS_PEDAL", + .address = 0x245, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_581), + .sigs = sigs_581, + }, + { + .name = "STEER_TORQUE_SENSOR", + .address = 0x260, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_608), + .sigs = sigs_608, + }, + { + .name = "EPS_STATUS", + .address = 0x262, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_610), + .sigs = sigs_610, + }, + { + .name = "STEERING_IPAS", + .address = 0x266, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_614), + .sigs = sigs_614, + }, + { + .name = "PRE_COLLISION", + .address = 0x283, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_643), + .sigs = sigs_643, + }, + { + .name = "STEERING_LKA", + .address = 0x2E4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_740), + .sigs = sigs_740, + }, + { + .name = "LEAD_INFO", + .address = 0x2E6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_742), + .sigs = sigs_742, + }, + { + .name = "ACC_CONTROL", + .address = 0x343, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_835), + .sigs = sigs_835, + }, + { + .name = "PRE_COLLISION_2", + .address = 0x344, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_836), + .sigs = sigs_836, + }, + { + .name = "DSU_CRUISE", + .address = 0x365, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_869), + .sigs = sigs_869, + }, + { + .name = "PCM_CRUISE_SM", + .address = 0x399, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_921), + .sigs = sigs_921, + }, + { + .name = "ESP_CONTROL", + .address = 0x3B7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_951), + .sigs = sigs_951, + }, + { + .name = "GEAR_PACKET", + .address = 0x3BC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_956), + .sigs = sigs_956, + }, + { + .name = "ACC_HUD", + .address = 0x411, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1041), + .sigs = sigs_1041, + }, + { + .name = "LKAS_HUD", + .address = 0x412, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1042), + .sigs = sigs_1042, + }, + { + .name = "TIME", + .address = 0x413, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1043), + .sigs = sigs_1043, + }, + { + .name = "RSA1", + .address = 0x489, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1161), + .sigs = sigs_1161, + }, + { + .name = "RSA2", + .address = 0x48A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1162), + .sigs = sigs_1162, + }, + { + .name = "RSA3", + .address = 0x48B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1163), + .sigs = sigs_1163, + }, + { + .name = "VIN_PART_1", + .address = 0x580, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1408), + .sigs = sigs_1408, + }, + { + .name = "VIN_PART_2", + .address = 0x581, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1409), + .sigs = sigs_1409, + }, + { + .name = "VIN_PART_3", + .address = 0x582, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1410), + .sigs = sigs_1410, + }, + { + .name = "UI_SETTING", + .address = 0x611, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1553), + .sigs = sigs_1553, + }, + { + .name = "STEERING_LEVERS", + .address = 0x614, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1556), + .sigs = sigs_1556, + }, + { + .name = "SEATS_DOORS", + .address = 0x620, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1568), + .sigs = sigs_1568, + }, + { + .name = "LIGHT_STALK", + .address = 0x622, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1570), + .sigs = sigs_1570, + }, +}; + +const Val vals[] = { + { + .name = "CRUISE_STATE", + .address = 0x1D2, + .def_val = "11 TIMER_3SEC 10 ADAPTIVE_CLICK_DOWN 9 ADAPTIVE_CLICK_UP 8 ADAPTIVE_ENGAGED 7 STANDSTILL 6 NON-ADAPTIVE_CLICK_UP 5 NON-ADAPTIVE_CLICK_DOWN 4 NON-ADAPTIVE_HOLD_DOWN 3 NON-ADAPTIVE_HOLD_UP 2 NON-ADAPTIVE_BEING_ENGAGED 1 NON-ADAPTIVE_ENGAGED 0 OFF", + .sigs = sigs_466, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .address = 0x1D3, + .def_val = "2 LOW_SPEED_LOCKED 1 OK", + .sigs = sigs_467, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "IPAS_STATE", + .address = 0x262, + .def_val = "5 OVERRIDE 3 ENABLED 1 DISABLED", + .sigs = sigs_610, + }, + { + .name = "LKA_STATE", + .address = 0x262, + .def_val = "25 TEMPORARY_FAULT 9 TEMPORARY_FAULT2 5 ACTIVE 1 STANDBY", + .sigs = sigs_610, + }, + { + .name = "DIRECTION_CMD", + .address = 0x266, + .def_val = "3 RIGHT 2 CENTER 1 LEFT", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x266, + .def_val = "3 ENABLED 1 DISABLED", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x283, + .def_val = "0 NORMAL 1 ADAPTIVE_CRUISE_CONTROL 3 EMERGENCY_BRAKING", + .sigs = sigs_643, + }, + { + .name = "CRUISE_CONTROL_STATE", + .address = 0x399, + .def_val = "2 DISABLED 11 HOLD 10 HOLD_WAITING_USER_CMD 6 ENABLED 5 FAULTED", + .sigs = sigs_921, + }, + { + .name = "ECON_ON", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "GEAR", + .address = 0x3BC, + .def_val = "0 D 1 S 8 N 16 R 32 P", + .sigs = sigs_956, + }, + { + .name = "SPORT_ON", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "BARRIERS", + .address = 0x412, + .def_val = "3 BOTH 2 RIGHT 1 LEFT 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LDA_ALERT", + .address = 0x412, + .def_val = "3 HOLD_WITH_CONTINUOUS_BEEP 2 LDA_UNAVAILABLE 1 HOLD 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LEFT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "RIGHT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "SPLSGN2", + .address = 0x489, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN1", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN2", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "SPLSGN3", + .address = 0x48A, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1162, + }, + { + .name = "TSGN3", + .address = 0x48A, + .def_val = "0 NONE 1 SPEED_SIGN 2 0_UNLIMITED 7 UNLIMITED 16 HIGHWAY 17 NO_HIGHWAY 18 MOTORWAY 19 NO_MOTORWAY 20 IN_CITY 21 OUTSIDE_CITY 22 PEDESTRIAN_AREA 23 NO_PEDESTRIAN_AREA 65 NO_OVERTAKING_LEFT 66 NO_OVERTAKING_RIGHT 67 OVERTAKING_ALLOWED_AGAIN 81 NO_RIGHT_TURN 97 STOP 105 YIELD 113 STOP 114 YIELD_US 129 NO_ENTRY 138 NO_ENTRY_TSS2 145 DO_NOT_ENTER", + .sigs = sigs_1162, + }, + { + .name = "UNITS", + .address = 0x611, + .def_val = "1 KM 2 MILES", + .sigs = sigs_1553, + }, + { + .name = "TURN_SIGNALS", + .address = 0x614, + .def_val = "3 NONE 2 RIGHT 1 LEFT", + .sigs = sigs_1556, + }, +}; + +} + +const DBC lexus_rx_hybrid_2017_pt_generated = { + .name = "lexus_rx_hybrid_2017_pt_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(lexus_rx_hybrid_2017_pt_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/mazda_2017.cc b/opendbc/can/dbc_out/mazda_2017.cc new file mode 100644 index 000000000..d62928634 --- /dev/null +++ b/opendbc/can/dbc_out/mazda_2017.cc @@ -0,0 +1,6320 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_64[] = { + { + .name = "NEW_SIGNAL_6", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_7", + .b1 = 10, + .b2 = 3, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_8", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_9", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_10", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_11", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_70[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 1, + .b2 = 3, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 9, + .b2 = 6, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 25, + .b2 = 6, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 33, + .b2 = 6, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_80[] = { + { + .name = "SIGNAL", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_117[] = { + { + .name = "CTR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -2000.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_2", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.1, + .offset = -1800.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 53, + .b2 = 1, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 49, + .b2 = 4, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_118[] = { + { + .name = "CTR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_120[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSURE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_121[] = { + { + .name = "NEW_SIGNAL_2", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 3, + .b2 = 4, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_ACTIVE", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_8", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_11", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_10", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_9", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_7", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_130[] = { + { + .name = "STEER_ANGLE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.05, + .offset = -1600.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHKSUM_MAYBE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_134[] = { + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.1, + .offset = -1600.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 17, + .b2 = 4, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_ROUGH", + .b1 = 29, + .b2 = 11, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = -1000.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR_2", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_145[] = { + { + .name = "HAZARD", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TURN_RIGHT_SWITCH", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TURN_LEFT_SWITCH", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_154[] = { + { + .name = "REAR_WIPER_ON", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAMS", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAMS", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LBEAM1", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINK", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINK", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_LO", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPER_HI", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LBEAM2", + .b1 = 53, + .b2 = 1, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LBEAM3", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_157[] = { + { + .name = "CAN_OFF", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RES", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_P", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_M", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE_MORE", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE_LESS", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE_LESS_INV", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MODE_Y", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MODE_X", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BIT1", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CAN_OFF_INV", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BIT2", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RES_INV", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BIT3", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_P_INV", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_M_INV", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE_MORE_INV", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 26, + .b2 = 4, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MODE_Y_INV", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MODE_X_INV", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_158[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_159[] = { + { + .name = "INCREASEING", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 50, + .b2 = 4, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_253[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_CMD", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRZ_NOT_ACTIVE", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_304[] = { + { + .name = "NEW_SIGNAL_2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_305[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_357[] = { + { + .name = "ACC_OFF", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ACTIVE", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ON", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NO_BRAKE", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_ON_2", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_7", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NO_BRAKE_2", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_359[] = { + { + .name = "NEW_SIGNAL_2", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_8", + .b1 = 33, + .b2 = 7, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_7", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_9", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_10", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 52, + .b2 = 3, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_11", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_514[] = { + { + .name = "RPM", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PEDAL_GAS", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_515[] = { + { + .name = "START1", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "START2", + .b1 = 27, + .b2 = 5, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHKSUM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_529[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 17, + .b2 = 5, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR_2", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_533[] = { + { + .name = "FL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = -100.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FR", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.01, + .offset = -100.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RL", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = -100.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RR", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.01, + .offset = -100.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_535[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR_A_1", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR_A_2", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_MAYBE", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR_B_1", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR_B_2", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NO_SEATBELT_MAYBE", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR_C_1", + .b1 = 19, + .b2 = 3, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR_C_2", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_7", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_8", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR_D_1", + .b1 = 27, + .b2 = 3, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR_D_2", + .b1 = 24, + .b2 = 3, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHK_MAYBE", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_539[] = { + { + .name = "ERROR_STATUS", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATIC_1", + .b1 = 8, + .b2 = 11, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD", + .b1 = 22, + .b2 = 13, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = -4096.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATIC_2", + .b1 = 18, + .b2 = 3, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ACTIVE", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_SET_ALLOWED", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRZ_ENDED", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_7", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_540[] = { + { + .name = "MSG_1", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MSG_1_INV", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRZ_ACTIVE", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MSG_1_INV_COPY", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MSG_1_COPY", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRZ_AVAILABLE", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE_SETTING", + .b1 = 19, + .b2 = 3, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_GAS_MAYBE", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_GAS_MAYBE2", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_10", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_9", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "5_SEC_DISABLE_TIMER", + .b1 = 42, + .b2 = 3, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HANDS_OFF_STEERING", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_ACTIVE_2", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HANDS_ON_STEER_WARN", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_542[] = { + { + .name = "CTR", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR2", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_543[] = { + { + .name = "CRZ_SPEED", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.005, + .offset = -0.5, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_ACTIVE_CAR_MOVING", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PLUS_ONE_CRZ", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRZ_STARTED", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PLUS_ONE_CRZ_2", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_MAYBE", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_21", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_LOW_RES", + .b1 = 26, + .b2 = 8, + .bo = 30, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD", + .b1 = 41, + .b2 = 8, + .bo = 15, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_552[] = { + { + .name = "GEAR", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MORE_GEAR", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 24, + .b2 = 5, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR_BOX", + .b1 = 35, + .b2 = 4, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_7", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_576[] = { + { + .name = "STEER_TORQUE_SENSOR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = -127.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SENSOR1", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_MOTOR", + .b1 = 41, + .b2 = 15, + .bo = 8, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 57, + .b2 = 4, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_577[] = { + { + .name = "LKAS_REQUEST", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -2048.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.25, + .offset = -8192.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_EFFECTIVE", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = -2048.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_BLOCK", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HANDS_OFF_5_SECONDS", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_TRACK_STATE", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_578[] = { + { + .name = "LINE1", + .b1 = 4, + .b2 = 10, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = -686.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE2", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = -686.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_CURVE", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -127.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIG1", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIG2", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ZERO", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIG3", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_579[] = { + { + .name = "LKAS_REQUEST", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -2048.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ERR_BIT_1", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_NOT_VISIBLE", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BIT_1", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ERR_BIT_2", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_ANGLE", + .b1 = 38, + .b2 = 12, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = -2048.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ANGLE_ENABLED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_580[] = { + { + .name = "S1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "S2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "S3", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "S4", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "S5", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "S6", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_581[] = { + { + .name = "S1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "S2", + .b1 = 8, + .b2 = 6, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "S3", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "S4", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "S5", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "S6", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "S7", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "S8", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "S9", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_582[] = { + { + .name = "CTR", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_605[] = { + { + .name = "PED_BRAKE", + .b1 = 4, + .b2 = 3, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PED_WARNING", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AEB_NOT_ENGAGED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 22, + .b2 = 4, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RST_CTR", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_WARNING", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "S1", + .b1 = 26, + .b2 = 4, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_606[] = { + { + .name = "SPEED_TBD", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_608[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 8, + .b2 = 5, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_832[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR1", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR2", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PASSENGER_SEATBELT", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DRIVER_SEATBELT", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_836[] = { + { + .name = "CTR", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR2", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_863[] = { + { + .name = "SPEED_SIGN", + .b1 = 3, + .b2 = 7, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED_SIGN_ON", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STOP_SIGN", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED_SIGN_CAM", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FORWARD_COLLISION", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_865[] = { + { + .name = "DISTANCE_LEAD", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELATIVE_VEL_LEAD", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE_RELATED", + .b1 = 38, + .b2 = 4, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATIC", + .b1 = 35, + .b2 = 3, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED_INVERSE", + .b1 = 44, + .b2 = 12, + .bo = 8, + .is_signed = true, + .factor = -0.225, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_866[] = { + { + .name = "CURVE_1", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CURVE_2", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CURVE_3", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 38, + .b2 = 4, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 34, + .b2 = 3, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE", + .b1 = 44, + .b2 = 12, + .bo = 8, + .is_signed = false, + .factor = -1.0, + .offset = 2048, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLIPPY_1", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATIC_2", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_867[] = { + { + .name = "CURVE_1", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CURVE_2", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CURVE_3", + .b1 = 27, + .b2 = 13, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLIPPY_1", + .b1 = 24, + .b2 = 3, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATIC_4", + .b1 = 44, + .b2 = 16, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLIPPY_4", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLIPPY_3", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLIPPY_2", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_868[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 28, + .b2 = 12, + .bo = 24, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FLIPPERS_1", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATIC_2", + .b1 = 44, + .b2 = 16, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FLIPPY_1", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATIC_1", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_869[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 0, + .b2 = 14, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELATED_1", + .b1 = 14, + .b2 = 18, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELATED_2", + .b1 = 38, + .b2 = 18, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 32, + .b2 = 6, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATIC", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_870[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_7", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_976[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_977[] = { + { + .name = "NEW_SIGNAL_4", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_7", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_8", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_978[] = { + { + .name = "CTR", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_7", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_8", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1034[] = { + { + .name = "NEW_SIGNAL_2", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 1, + .b2 = 3, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_9", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_8", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_7", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1045[] = { + { + .name = "ABS_MALFUNCTION", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_WARNING", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DSC_OFF", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TCS_DCS_MALFUNCTION", + .b1 = 1, + .b2 = 2, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR3", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IS_MOVING", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR2", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOUD_BEEP", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TPMS_WARNING_DOUBLE_BLINK", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR1", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1056[] = { + { + .name = "COOLANT_TEMP", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "counter_or_GEAR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 26, + .b2 = 6, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHARGING_SYSTEM_MALFUNCTION", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECK_FUEL_CAP", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_ENGINE_OIL_PRESSURE", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OUTDOOR_TEMP", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.25, + .offset = -63.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1067[] = { + { + .name = "NEW_SIGNAL_4", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_9", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_8", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_7", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1078[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 63, + .b2 = 5, + .bo = -4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1085[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1086[] = { + { + .name = "KEYFOB_HORN", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "KEYFOB_LOCK", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "KEYFOB_UNLOCK", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR1", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR2", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOORS_UNLOCKED", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFTGATE", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BR", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BL", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FR", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1087[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1088[] = { + { + .name = "LINE_VISIBLE", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LINE_NOT_VISIBLE", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BIT1", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_LINES", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BIT2", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NO_ERR_BIT", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ERR_BIT", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HANDS_WARN_3_BITS", + .b1 = 52, + .b2 = 3, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "S1", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "S1_HBEAM", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HANDS_ON_STEER_WARN", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_WARN_LL", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_WARN_RL", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HANDS_ON_STEER_WARN_2", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BIT3", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1115[] = { + { + .name = "CTR", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1143[] = { + { + .name = "BSM_OFF", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IS_MOVING", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BS1", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BS1", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REAR_CT_ALERT", + .b1 = 16, + .b2 = 5, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BS_DISTANCE", + .b1 = 36, + .b2 = 3, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BS_SIDE", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BS_3", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BS3", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BS4", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BS_BEHIND", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1157[] = { + { + .name = "LKAS_SENSETIVITY", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WARNING", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BIT1", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_ASSIT_TIMING", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BIT2", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_INERVENTION_ON1", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANEE_DEPARTURE_ALERT", + .b1 = 23, + .b2 = 2, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ILKAS_NTERVENTION_ON2", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BIT3", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SBS_WARNING_DISTANCE", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SBS_SCBC", + .b1 = 27, + .b2 = 2, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1160[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 40, + .b2 = 24, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1178[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 0, + .b2 = 64, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1179[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 0, + .b2 = 64, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1180[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1238[] = { + { + .name = "TEMPERATURE_MAYBE", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1243[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 0, + .b2 = 64, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1266[] = { + { + .name = "NEW_SIGNAL_2", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1267[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1269[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1274[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CTR", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1275[] = { + { + .name = "counter", + .b1 = 3, + .b2 = 5, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1277[] = { + { + .name = "counter", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1278[] = { + { + .name = "MILAGE_MAYBE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_4", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_5", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_6", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_7", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "MOB2", + .address = 0x40, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_64), + .sigs = sigs_64, + }, + { + .name = "MOB1", + .address = 0x46, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_70), + .sigs = sigs_70, + }, + { + .name = "MSG_04", + .address = 0x50, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_80), + .sigs = sigs_80, + }, + { + .name = "STEER_RELATED", + .address = 0x75, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_117), + .sigs = sigs_117, + }, + { + .name = "RPM_RELATED", + .address = 0x76, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_118), + .sigs = sigs_118, + }, + { + .name = "BRAKE", + .address = 0x78, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_120), + .sigs = sigs_120, + }, + { + .name = "EPB", + .address = 0x79, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_121), + .sigs = sigs_121, + }, + { + .name = "STEER", + .address = 0x82, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_130), + .sigs = sigs_130, + }, + { + .name = "STEER2", + .address = 0x86, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_134), + .sigs = sigs_134, + }, + { + .name = "TURN_SWITCH", + .address = 0x91, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_145), + .sigs = sigs_145, + }, + { + .name = "BLINK_INFO", + .address = 0x9A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_154), + .sigs = sigs_154, + }, + { + .name = "CRZ_BTNS", + .address = 0x9D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_157), + .sigs = sigs_157, + }, + { + .name = "MSG_05", + .address = 0x9E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_158), + .sigs = sigs_158, + }, + { + .name = "MSG_11", + .address = 0x9F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_159), + .sigs = sigs_159, + }, + { + .name = "GAS", + .address = 0xFD, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_253), + .sigs = sigs_253, + }, + { + .name = "GEAR_RELATED", + .address = 0x130, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_304), + .sigs = sigs_304, + }, + { + .name = "NEW_MSG_6", + .address = 0x131, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_305), + .sigs = sigs_305, + }, + { + .name = "PEDALS", + .address = 0x165, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_357), + .sigs = sigs_357, + }, + { + .name = "MORE_GAS", + .address = 0x167, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_359), + .sigs = sigs_359, + }, + { + .name = "NEW_MSG_30", + .address = 0x200, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "ENGINE_DATA", + .address = 0x202, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_514), + .sigs = sigs_514, + }, + { + .name = "MSG_01", + .address = 0x203, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_515), + .sigs = sigs_515, + }, + { + .name = "NEW_MSG_36", + .address = 0x211, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_529), + .sigs = sigs_529, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0x215, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_533), + .sigs = sigs_533, + }, + { + .name = "CURVE_CTRS", + .address = 0x217, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_535), + .sigs = sigs_535, + }, + { + .name = "CRZ_INFO", + .address = 0x21B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_539), + .sigs = sigs_539, + }, + { + .name = "CRZ_CTRL", + .address = 0x21C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_540), + .sigs = sigs_540, + }, + { + .name = "NEW_MSG_33", + .address = 0x21E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_542), + .sigs = sigs_542, + }, + { + .name = "CRZ_EVENTS", + .address = 0x21F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_543), + .sigs = sigs_543, + }, + { + .name = "GEAR", + .address = 0x228, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_552), + .sigs = sigs_552, + }, + { + .name = "STEER_TORQUE", + .address = 0x240, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_576), + .sigs = sigs_576, + }, + { + .name = "STEER_RATE", + .address = 0x241, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_577), + .sigs = sigs_577, + }, + { + .name = "CAM_LANETRACK", + .address = 0x242, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_578), + .sigs = sigs_578, + }, + { + .name = "CAM_LKAS", + .address = 0x243, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_579), + .sigs = sigs_579, + }, + { + .name = "CAM_DISTANCE", + .address = 0x244, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_580), + .sigs = sigs_580, + }, + { + .name = "CAM_IDK3", + .address = 0x245, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_581), + .sigs = sigs_581, + }, + { + .name = "CAM_LANEMAYBE", + .address = 0x246, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_582), + .sigs = sigs_582, + }, + { + .name = "CAM_PEDESTRIAN", + .address = 0x25D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_605), + .sigs = sigs_605, + }, + { + .name = "SPEED_TBD", + .address = 0x25E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_606), + .sigs = sigs_606, + }, + { + .name = "NEW_MSG_29", + .address = 0x260, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_608), + .sigs = sigs_608, + }, + { + .name = "SEATBELT", + .address = 0x340, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_832), + .sigs = sigs_832, + }, + { + .name = "NEW_MSG_19", + .address = 0x344, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_836), + .sigs = sigs_836, + }, + { + .name = "CAM_TRAFFIC_SIGNS", + .address = 0x35F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_863), + .sigs = sigs_863, + }, + { + .name = "RADAR_DISTANCE", + .address = 0x361, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_865), + .sigs = sigs_865, + }, + { + .name = "RADAR_TURN", + .address = 0x362, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_866), + .sigs = sigs_866, + }, + { + .name = "RADAR_363", + .address = 0x363, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_867), + .sigs = sigs_867, + }, + { + .name = "RADAR_364", + .address = 0x364, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_868), + .sigs = sigs_868, + }, + { + .name = "RADAR_365", + .address = 0x365, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_869), + .sigs = sigs_869, + }, + { + .name = "RADAR_366_STATIC", + .address = 0x366, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_870), + .sigs = sigs_870, + }, + { + .name = "MSG_15", + .address = 0x3D0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_976), + .sigs = sigs_976, + }, + { + .name = "TWO_STATES", + .address = 0x3D1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_977), + .sigs = sigs_977, + }, + { + .name = "MSG_03", + .address = 0x3D2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_978), + .sigs = sigs_978, + }, + { + .name = "MSG_07", + .address = 0x40A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1034), + .sigs = sigs_1034, + }, + { + .name = "TRACTION", + .address = 0x415, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1045), + .sigs = sigs_1045, + }, + { + .name = "CHECK_AND_TEMP", + .address = 0x420, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1056), + .sigs = sigs_1056, + }, + { + .name = "NEW_MSG_27", + .address = 0x42B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1067), + .sigs = sigs_1067, + }, + { + .name = "HVAC", + .address = 0x436, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1078), + .sigs = sigs_1078, + }, + { + .name = "MSG_12", + .address = 0x43D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1085), + .sigs = sigs_1085, + }, + { + .name = "DOORS", + .address = 0x43E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1086), + .sigs = sigs_1086, + }, + { + .name = "NEW_MSG_1", + .address = 0x43F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1087), + .sigs = sigs_1087, + }, + { + .name = "CAM_LANEINFO", + .address = 0x440, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1088), + .sigs = sigs_1088, + }, + { + .name = "MSG_02", + .address = 0x45B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1115), + .sigs = sigs_1115, + }, + { + .name = "BSM", + .address = 0x477, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1143), + .sigs = sigs_1143, + }, + { + .name = "CAM_SETTINGS", + .address = 0x485, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1157), + .sigs = sigs_1157, + }, + { + .name = "CAM_Empty3", + .address = 0x488, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1160), + .sigs = sigs_1160, + }, + { + .name = "2017_6", + .address = 0x49A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1178), + .sigs = sigs_1178, + }, + { + .name = "2017_7", + .address = 0x49B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1179), + .sigs = sigs_1179, + }, + { + .name = "last_byte_roughRPM", + .address = 0x49C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1180), + .sigs = sigs_1180, + }, + { + .name = "TEMPERATURE", + .address = 0x4D6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1238), + .sigs = sigs_1238, + }, + { + .name = "2017_3", + .address = 0x4DB, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1243), + .sigs = sigs_1243, + }, + { + .name = "MSG_09", + .address = 0x4F2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1266), + .sigs = sigs_1266, + }, + { + .name = "MSG_10", + .address = 0x4F3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1267), + .sigs = sigs_1267, + }, + { + .name = "MSG_2017_4", + .address = 0x4F5, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1269), + .sigs = sigs_1269, + }, + { + .name = "NEW_MSG_12", + .address = 0x4FA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1274), + .sigs = sigs_1274, + }, + { + .name = "2017_5", + .address = 0x4FB, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1275), + .sigs = sigs_1275, + }, + { + .name = "NEW_MSG_10", + .address = 0x4FD, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1277), + .sigs = sigs_1277, + }, + { + .name = "NEW_MSG_3", + .address = 0x4FE, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1278), + .sigs = sigs_1278, + }, +}; + +const Val vals[] = { + { + .name = "GEAR", + .address = 0x228, + .def_val = "1 P 2 R 3 N 4 D", + .sigs = sigs_552, + }, +}; + +} + +const DBC mazda_2017 = { + .name = "mazda_2017", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(mazda_2017) \ No newline at end of file diff --git a/opendbc/can/dbc_out/nissan_leaf_2018.cc b/opendbc/can/dbc_out/nissan_leaf_2018.cc new file mode 100644 index 000000000..a5ba52068 --- /dev/null +++ b/opendbc/can/dbc_out/nissan_leaf_2018.cc @@ -0,0 +1,1656 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_2[] = { + { + .name = "COUNTER", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X07", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_42[] = { + { + .name = "unknown1", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown3", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown2", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown4", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_361[] = { + { + .name = "COUNTER", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DESIRED_ANGLE", + .b1 = 0, + .b2 = 18, + .bo = 46, + .is_signed = false, + .factor = -0.01, + .offset = 1310, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_0x80_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAX_TORQUE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_0x80", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_ACTIVE", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_389[] = { + { + .name = "COUNTER", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_DRIVER", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = -0.01, + .offset = 20.47, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE", + .b1 = 16, + .b2 = 18, + .bo = 30, + .is_signed = false, + .factor = -0.01, + .offset = 1310, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_ACTIVE", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_LKAS", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_460[] = { + { + .name = "BRAKE_PEDAL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_569[] = { + { + .name = "COUNTER", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PEDAL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PEDAL_INVERTED", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unsure2", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_AVAILABLE", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unsure1", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PROPILOT_BUTTON", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_BUTTON", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FOLLOW_DISTANCE_BUTTON", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_BUTTON", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RES_BUTTON", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NO_BUTTON_PRESSED", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unsure3", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "USER_BRAKE_PRESSED", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unsure5", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unsure6", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unsure7", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_640[] = { + { + .name = "NEW_SIGNAL_2", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_SEATBELT", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_1", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_3", + .b1 = 8, + .b2 = 56, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_644[] = { + { + .name = "WHEEL_SPEED_FR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_645[] = { + { + .name = "WHEEL_SPEED_RR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_689[] = { + { + .name = "unknown02", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FOLLOW_DISTANCE", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown05", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED_SET_ICON", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown08", + .b1 = 15, + .b2 = 7, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LARGE_WARNING_FLASHING", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_RADAR_ERROR_FLASHING1", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_RADAR_ERROR_FLASHING2", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_LANE_YELLOW_FLASH", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_LANE_YELLOW_FLASH", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_CAR", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_CAR_ERROR", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRONT_RADAR_ERROR", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRONT_RADAR_ERROR_FLASHING", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_LANE_GREEN", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_LANE_GREEN", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown26", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_RADAR_ERROR_FLASHING3", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown28", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_ERROR_FLASHING", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown31", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SMALL_STEERING_WHEEL_ICON", + .b1 = 45, + .b2 = 3, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown43", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SAFETY_SHIELD_ACTIVE", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUDIBLE_TONE", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown55", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown59", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LARGE_STEERING_WHEEL_ICON", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_LANE_GREEN_FLASH", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_LANE_GREEN_FLASH", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_783[] = { + { + .name = "CRUISE_ENABLED", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_852[] = { + { + .name = "ESP_DISABLED", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_853[] = { + { + .name = "SPEED_MPH", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_856[] = { + { + .name = "LEFT_BLINKER", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1057[] = { + { + .name = "GEAR_SHIFTER", + .b1 = 2, + .b2 = 3, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1227[] = { + { + .name = "LKAS_ENABLED", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1228[] = { + { + .name = "NA_HIGH_ACCEL_TEMP", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown07", + .b1 = 0, + .b2 = 7, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_RADAR_NA_HIGH_CABIN_TEMP", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown10", + .b1 = 13, + .b2 = 2, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_RADAR_MALFUNCTION", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_MALFUNCTION", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRONT_RADAR_MALFUNCTION", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_RADAR_NA_CLEAN_REAR_CAMERA", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown15", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NA_POOR_ROAD_CONDITIONS", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CURRENTLY_UNAVAILABLE", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SAFETY_SHIELD_OFF", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown19", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRONT_COLLISION_NA_FRONT_RADAR_OBSTRUCTION", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown23", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PEDAL_MISSAPPLICATION_SYSTEM_ACTIVATED", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_IMPACT_NA_RADAR_OBSTRUCTION", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown31", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown32", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WARNING_DO_NOT_ENTER", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_IMPACT_SYSTEM_OFF", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_IMPACT_MALFUNCTION", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRONT_COLLISION_MALFUNCTION", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_RADAR_MALFUNCTION2", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_MALFUNCTION2", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRONT_RADAR_MALFUNCTION2", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PROPILOT_NA_MSGS", + .b1 = 45, + .b2 = 3, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOTTOM_MSG", + .b1 = 42, + .b2 = 3, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown46", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HANDS_ON_WHEEL_WARNING", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown50", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WARNING_STEP_ON_BRAKE_NOW", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PROPILOT_NA_FRONT_CAMERA_OBSTRUCTED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PROPILOT_NA_HIGH_CABIN_TEMP", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WARNING_PROPILOT_MALFUNCTION", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown55", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown61", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_UNAVAILABLE_HIGH_CABIN_TEMP", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_NA_FRONT_CAMERA_IMPARED", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1549[] = { + { + .name = "DOOR_OPEN_FL", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "STEER_ANGLE_SENSOR", + .address = 0x2, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_2), + .sigs = sigs_2, + }, + { + .name = "SEATBELT", + .address = 0x2A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_42), + .sigs = sigs_42, + }, + { + .name = "LKAS", + .address = 0x169, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_361), + .sigs = sigs_361, + }, + { + .name = "STEER_TORQUE_SENSOR", + .address = 0x185, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_389), + .sigs = sigs_389, + }, + { + .name = "BRAKE_PEDAL", + .address = 0x1CC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_460), + .sigs = sigs_460, + }, + { + .name = "CRUISE_THROTTLE", + .address = 0x239, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_569), + .sigs = sigs_569, + }, + { + .name = "CANCEL_MSG", + .address = 0x280, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_640), + .sigs = sigs_640, + }, + { + .name = "WHEEL_SPEEDS_FRONT", + .address = 0x284, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_644), + .sigs = sigs_644, + }, + { + .name = "WHEEL_SPEEDS_REAR", + .address = 0x285, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_645), + .sigs = sigs_645, + }, + { + .name = "PROPILOT_HUD", + .address = 0x2B1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_689), + .sigs = sigs_689, + }, + { + .name = "CRUISE_STATE", + .address = 0x30F, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_783), + .sigs = sigs_783, + }, + { + .name = "ESP", + .address = 0x354, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_852), + .sigs = sigs_852, + }, + { + .name = "HUD_SETTINGS", + .address = 0x355, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_853), + .sigs = sigs_853, + }, + { + .name = "LIGHTS", + .address = 0x358, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_856), + .sigs = sigs_856, + }, + { + .name = "GEARBOX", + .address = 0x421, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_1057), + .sigs = sigs_1057, + }, + { + .name = "LKAS_SETTINGS", + .address = 0x4CB, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1227), + .sigs = sigs_1227, + }, + { + .name = "PROPILOT_HUD_INFO_MSG", + .address = 0x4CC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1228), + .sigs = sigs_1228, + }, + { + .name = "DOORS_LIGHTS", + .address = 0x60D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1549), + .sigs = sigs_1549, + }, +}; + +const Val vals[] = { + { + .name = "AUDIBLE_TONE", + .address = 0x2B1, + .def_val = "0 NO_TONE 1 CONT 2 FAST_BEEP_CONT 3 TRIPLE_FAST_BEEP_CONT 4 SLOW_BEEP_CONT 5 QUAD_SLOW_BEEP_CONT 6 SINGLE_BEEP_ONCE 7 DOUBLE_BEEP_ONCE", + .sigs = sigs_689, + }, + { + .name = "FOLLOW_DISTANCE", + .address = 0x2B1, + .def_val = "0 NO_FOLLOW_DISTANCE 1 FOLLOW_DISTANCE_1 2 FOLLOW_DISTANCE_2 3 FOLLOW_DISANCE_3", + .sigs = sigs_689, + }, + { + .name = "LARGE_STEERING_WHEEL_ICON", + .address = 0x2B1, + .def_val = "0 NO_STEERINGWHEEL 1 GRAY_STEERINGWHEEL 2 GREEN_STEERINGWHEEL 3 GREEN_STEERINGWHEEL_FLASHING", + .sigs = sigs_689, + }, + { + .name = "SMALL_STEERING_WHEEL_ICON", + .address = 0x2B1, + .def_val = "0 NO_ICON 1 GRAY_ICON 2 GRAY_ICON_FLASHING 3 GREEN_ICON 4 GREEN_ICON_FLASHING 5 RED_ICON 6 RED_ICON_FLASHING 7 YELLOW_ICON", + .sigs = sigs_689, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x421, + .def_val = "7 B 4 D 3 N 2 R 1 P", + .sigs = sigs_1057, + }, + { + .name = "BOTTOM_MSG", + .address = 0x4CC, + .def_val = "0 OK_STEER_ASSIST_SETTINGS 1 NO_MSG 2 PRESS_SET_TO_SET_SPEED 3 PRESS_RES_SET_TO_CHANGE_SPEED 4 PRESS_RES_TO_RESTART 5 NO_MSG 6 CRUISE_NOT_AVAIL 7 NO_MSG", + .sigs = sigs_1228, + }, + { + .name = "PROPILOT_NA_MSGS", + .address = 0x4CC, + .def_val = "0 NO_MSG 1 NA_FRONT_CAMERA_IMPARED 2 STEERING_ASSIST_ON_STANDBY 3 NA_PARKING_ASSIST_ENABLED 4 STEER_ASSIST_CURRENTLY_NA 5 NA_BAD_WEATHER 6 NA_PARK_BRAKE_ON 7 NA_SEATBELT_NOT_FASTENED", + .sigs = sigs_1228, + }, +}; + +} + +const DBC nissan_leaf_2018 = { + .name = "nissan_leaf_2018", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(nissan_leaf_2018) \ No newline at end of file diff --git a/opendbc/can/dbc_out/nissan_x_trail_2017.cc b/opendbc/can/dbc_out/nissan_x_trail_2017.cc new file mode 100644 index 000000000..6b714d3da --- /dev/null +++ b/opendbc/can/dbc_out/nissan_x_trail_2017.cc @@ -0,0 +1,1733 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_2[] = { + { + .name = "COUNTER", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_RATE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X07", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_348[] = { + { + .name = "GAS_PEDAL_RAW", + .b1 = 29, + .b2 = 11, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PEDAL", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_361[] = { + { + .name = "COUNTER", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DESIRED_ANGLE", + .b1 = 0, + .b2 = 18, + .bo = 46, + .is_signed = false, + .factor = -0.01, + .offset = 1310, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_0x80_2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAX_TORQUE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_0x80", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_ACTIVE", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_389[] = { + { + .name = "COUNTER", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_DRIVER", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = -0.01, + .offset = 20.47, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE", + .b1 = 16, + .b2 = 18, + .bo = 30, + .is_signed = false, + .factor = -0.01, + .offset = 1310, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_ACTIVE", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_LKAS", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_438[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X03", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_ON", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_ACTIVATED", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_STATUS", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_523[] = { + { + .name = "COUNTER", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unsure1", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PROPILOT_BUTTON", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_BUTTON", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FOLLOW_DISTANCE_BUTTON", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_BUTTON", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RES_BUTTON", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NO_BUTTON_PRESSED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unsure3", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PRESSED_INVERTED", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "USER_BRAKE_PRESSED", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "USER_BRAKE_PRESSED_INVERTED", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PEDAL", + .b1 = 24, + .b2 = 10, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PEDAL_INVERTED", + .b1 = 34, + .b2 = 10, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unsure2", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_645[] = { + { + .name = "WHEEL_SPEED_RR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_665[] = { + { + .name = "ESP_DISABLED", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_666[] = { + { + .name = "WHEEL_SPEED_FR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_689[] = { + { + .name = "unknown02", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FOLLOW_DISTANCE", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown05", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED_SET_ICON", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown08", + .b1 = 15, + .b2 = 7, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LARGE_WARNING_FLASHING", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_RADAR_ERROR_FLASHING1", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_RADAR_ERROR_FLASHING2", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_LANE_YELLOW_FLASH", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_LANE_YELLOW_FLASH", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_CAR", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_CAR_ERROR", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRONT_RADAR_ERROR", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRONT_RADAR_ERROR_FLASHING", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_LANE_GREEN", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_LANE_GREEN", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown26", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_RADAR_ERROR_FLASHING3", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown28", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_ERROR_FLASHING", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown31", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SMALL_STEERING_WHEEL_ICON", + .b1 = 45, + .b2 = 3, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown43", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SAFETY_SHIELD_ACTIVE", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUDIBLE_TONE", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown55", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown59", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LARGE_STEERING_WHEEL_ICON", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_LANE_GREEN_FLASH", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_LANE_GREEN_FLASH", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_768[] = { + { + .name = "STEERING_TORQUE", + .b1 = 1, + .b2 = 7, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_PRESSED", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = -1.0, + .offset = 1, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_783[] = { + { + .name = "CRUISE_ENABLED", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1055[] = { + { + .name = "GEAR_SHIFTER", + .b1 = 2, + .b2 = 3, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPORTS_MODE", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1107[] = { + { + .name = "HEADLIGHTS", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1108[] = { + { + .name = "USER_BRAKE_PRESSED", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_CLOSED_RR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_CLOSED_RL", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_CLOSED_FL", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_CLOSED_FR", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOOT_OPEN", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1227[] = { + { + .name = "LKAS_ENABLED", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1228[] = { + { + .name = "NA_HIGH_ACCEL_TEMP", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown07", + .b1 = 0, + .b2 = 7, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_RADAR_NA_HIGH_CABIN_TEMP", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown10", + .b1 = 13, + .b2 = 2, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_RADAR_MALFUNCTION", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_MALFUNCTION", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRONT_RADAR_MALFUNCTION", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_RADAR_NA_CLEAN_REAR_CAMERA", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown15", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NA_POOR_ROAD_CONDITIONS", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CURRENTLY_UNAVAILABLE", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SAFETY_SHIELD_OFF", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown19", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRONT_COLLISION_NA_FRONT_RADAR_OBSTRUCTION", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown23", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PEDAL_MISSAPPLICATION_SYSTEM_ACTIVATED", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_IMPACT_NA_RADAR_OBSTRUCTION", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown31", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown32", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WARNING_DO_NOT_ENTER", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_IMPACT_SYSTEM_OFF", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_IMPACT_MALFUNCTION", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRONT_COLLISION_MALFUNCTION", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SIDE_RADAR_MALFUNCTION2", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_MALFUNCTION2", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FRONT_RADAR_MALFUNCTION2", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PROPILOT_NA_MSGS", + .b1 = 45, + .b2 = 3, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BOTTOM_MSG", + .b1 = 42, + .b2 = 3, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown46", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HANDS_ON_WHEEL_WARNING", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown50", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WARNING_STEP_ON_BRAKE_NOW", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PROPILOT_NA_FRONT_CAMERA_OBSTRUCTED", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PROPILOT_NA_HIGH_CABIN_TEMP", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WARNING_PROPILOT_MALFUNCTION", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown55", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "unknown61", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_UNAVAILABLE_HIGH_CABIN_TEMP", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_NA_FRONT_CAMERA_IMPARED", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1273[] = { + { + .name = "SPEED_MPH", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_LATCHED", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "STEER_ANGLE_SENSOR", + .address = 0x2, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_2), + .sigs = sigs_2, + }, + { + .name = "GAS_PEDAL", + .address = 0x15C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_348), + .sigs = sigs_348, + }, + { + .name = "LKAS", + .address = 0x169, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_361), + .sigs = sigs_361, + }, + { + .name = "STEER_TORQUE_SENSOR", + .address = 0x185, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_389), + .sigs = sigs_389, + }, + { + .name = "PRO_PILOT", + .address = 0x1B6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_438), + .sigs = sigs_438, + }, + { + .name = "CRUISE_THROTTLE", + .address = 0x20B, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_523), + .sigs = sigs_523, + }, + { + .name = "WHEEL_SPEEDS_REAR", + .address = 0x285, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_645), + .sigs = sigs_645, + }, + { + .name = "ESP", + .address = 0x299, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_665), + .sigs = sigs_665, + }, + { + .name = "WHEEL_SPEEDS_FRONT", + .address = 0x29A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_666), + .sigs = sigs_666, + }, + { + .name = "PROPILOT_HUD", + .address = 0x2B1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_689), + .sigs = sigs_689, + }, + { + .name = "STEER_TORQUE_SENSOR2", + .address = 0x300, + .size = 2, + .num_sigs = ARRAYSIZE(sigs_768), + .sigs = sigs_768, + }, + { + .name = "CRUISE_STATE", + .address = 0x30F, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_783), + .sigs = sigs_783, + }, + { + .name = "GEARBOX", + .address = 0x41F, + .size = 2, + .num_sigs = ARRAYSIZE(sigs_1055), + .sigs = sigs_1055, + }, + { + .name = "LIGHTS", + .address = 0x453, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1107), + .sigs = sigs_1107, + }, + { + .name = "DOORS_LIGHTS", + .address = 0x454, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1108), + .sigs = sigs_1108, + }, + { + .name = "LKAS_SETTINGS", + .address = 0x4CB, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1227), + .sigs = sigs_1227, + }, + { + .name = "PROPILOT_HUD_INFO_MSG", + .address = 0x4CC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1228), + .sigs = sigs_1228, + }, + { + .name = "HUD", + .address = 0x4F9, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_1273), + .sigs = sigs_1273, + }, +}; + +const Val vals[] = { + { + .name = "AUDIBLE_TONE", + .address = 0x2B1, + .def_val = "0 NO_TONE 1 CONT 2 FAST_BEEP_CONT 3 TRIPLE_FAST_BEEP_CONT 4 SLOW_BEEP_CONT 5 QUAD_SLOW_BEEP_CONT 6 SINGLE_BEEP_ONCE 7 DOUBLE_BEEP_ONCE", + .sigs = sigs_689, + }, + { + .name = "FOLLOW_DISTANCE", + .address = 0x2B1, + .def_val = "0 NO_FOLLOW_DISTANCE 1 FOLLOW_DISTANCE_1 2 FOLLOW_DISTANCE_2 3 FOLLOW_DISANCE_3", + .sigs = sigs_689, + }, + { + .name = "LARGE_STEERING_WHEEL_ICON", + .address = 0x2B1, + .def_val = "0 NO_STEERINGWHEEL 1 GRAY_STEERINGWHEEL 2 GREEN_STEERINGWHEEL 3 GREEN_STEERINGWHEEL_FLASHING", + .sigs = sigs_689, + }, + { + .name = "SMALL_STEERING_WHEEL_ICON", + .address = 0x2B1, + .def_val = "0 NO_ICON 1 GRAY_ICON 2 GRAY_ICON_FLASHING 3 GREEN_ICON 4 GREEN_ICON_FLASHING 5 RED_ICON 6 RED_ICON_FLASHING 7 YELLOW_ICON", + .sigs = sigs_689, + }, + { + .name = "GEAR_SHIFTER", + .address = 0x41F, + .def_val = "6 L 4 D 3 N 2 R 1 P", + .sigs = sigs_1055, + }, + { + .name = "BOTTOM_MSG", + .address = 0x4CC, + .def_val = "0 OK_STEER_ASSIST_SETTINGS 1 NO_MSG 2 PRESS_SET_TO_SET_SPEED 3 PRESS_RES_SET_TO_CHANGE_SPEED 4 PRESS_RES_TO_RESTART 5 NO_MSG 6 CRUISE_NOT_AVAIL 7 NO_MSG", + .sigs = sigs_1228, + }, + { + .name = "PROPILOT_NA_MSGS", + .address = 0x4CC, + .def_val = "0 NO_MSG 1 NA_FRONT_CAMERA_IMPARED 2 STEERING_ASSIST_ON_STANDBY 3 NA_PARKING_ASSIST_ENABLED 4 STEER_ASSIST_CURRENTLY_NA 5 NA_BAD_WEATHER 6 NA_PARK_BRAKE_ON 7 NA_SEATBELT_NOT_FASTENED", + .sigs = sigs_1228, + }, +}; + +} + +const DBC nissan_x_trail_2017 = { + .name = "nissan_x_trail_2017", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(nissan_x_trail_2017) \ No newline at end of file diff --git a/opendbc/can/dbc_out/subaru_forester_2017_generated.cc b/opendbc/can/dbc_out/subaru_forester_2017_generated.cc new file mode 100644 index 000000000..e04977069 --- /dev/null +++ b/opendbc/can/dbc_out/subaru_forester_2017_generated.cc @@ -0,0 +1,1846 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_2[] = { + { + .name = "Steering_Angle", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_208[] = { + { + .name = "Steering_Angle", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Lateral", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.0035, + .offset = 1, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Longitudinal", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = true, + .factor = -0.00035, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_209[] = { + { + .name = "Speed", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.05625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pedal", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_210[] = { + { + .name = "Brake_Light", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Related", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Right_Brake", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Left_Brake", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_211[] = { + { + .name = "Brake_Light", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Speed_Counter", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Cruise_On", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pedal_On", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_212[] = { + { + .name = "FL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.0592, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FR", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.0592, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RL", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.0592, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RR", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.0592, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_320[] = { + { + .name = "Throttle_Pedal", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.392157, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Not_Full_Throttle", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Engine_RPM", + .b1 = 16, + .b2 = 14, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Off_Throttle", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal3", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Throttle_Cruise", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Throttle_Combo", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Throttle_Body", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Off_Throttle_2", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal4", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_321[] = { + { + .name = "Engine_Torque", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Engine_Stop", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Wheel_Torque", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Engine_RPM", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_324[] = { + { + .name = "OnOffButton", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_BUTTON", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RES_BUTTON", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Button", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_On", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pedal_On", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_328[] = { + { + .name = "Manual_Gear", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Transmission_Engine", + .b1 = 16, + .b2 = 15, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Gear", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Gear_2", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Paddle_Shift", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_336[] = { + { + .name = "Brake_Pressure_Right", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pressure_Left", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_338[] = { + { + .name = "Counter", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Light", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Runlights", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Headlights", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Highbeam", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Wiper", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_352[] = { + { + .name = "Brake_Pressure", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Light", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Fault", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_On", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_353[] = { + { + .name = "Cruise_Throttle", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Car_Follow", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 17, + .b2 = 3, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_On", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Distance_Swap", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Standstill", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal3", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Close_Distance", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.0196, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal4", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Standstill_2", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Fault", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal5", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 44, + .b2 = 3, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal6", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Button", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal7", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_354[] = { + { + .name = "Brake", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_355[] = { + { + .name = "Not_Ready_Startup", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_On", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Set_Speed", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 40, + .b2 = 3, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Car_Follow", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Far_Distance", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_356[] = { + { + .name = "Counter", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Command", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Active", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_359[] = { + { + .name = "All_depart_2015", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Right_Line_2017", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Left_Line_2017", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig1All_Depart", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig2All_Depart", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Inactive_2017", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Active", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig1Right_Depart", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig1Right_Depart_Front", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig2Right_Depart", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Left_Depart_Front", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig3All_Depart", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_604[] = { + { + .name = "Counter", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "State", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "R_ADJACENT", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "L_ADJACENT", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "R_APPROACHING", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "L_APPROACHING", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "R_RCTA", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "L_RCTA", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_642[] = { + { + .name = "Counter", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_FL", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_864[] = { + { + .name = "Oil_Temp", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Coolant_Temp", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Saved_Speed", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_880[] = { + { + .name = "Steering_Voltage_Flat", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Torque_Sensor", + .b1 = 29, + .b2 = 11, + .bo = 24, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_881[] = { + { + .name = "Steering_Motor_Flat", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 32, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Torque_Output", + .b1 = 16, + .b2 = 11, + .bo = 37, + .is_signed = true, + .factor = -32.0, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Error_1", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Torque_Sensor", + .b1 = 29, + .b2 = 11, + .bo = 24, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steering_Angle", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = -0.033, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "DOOR_OPEN_FR", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_Hatch", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_977[] = { + { + .name = "UNITS", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1745[] = { + { + .name = "Units", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "Steering", + .address = 0x2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2), + .sigs = sigs_2, + }, + { + .name = "G_Sensor", + .address = 0xD0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_208), + .sigs = sigs_208, + }, + { + .name = "Brake_Pedal", + .address = 0xD1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_209), + .sigs = sigs_209, + }, + { + .name = "Brake_2", + .address = 0xD2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_210), + .sigs = sigs_210, + }, + { + .name = "Brake_Type", + .address = 0xD3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_211), + .sigs = sigs_211, + }, + { + .name = "Wheel_Speeds", + .address = 0xD4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_212), + .sigs = sigs_212, + }, + { + .name = "Throttle", + .address = 0x140, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_320), + .sigs = sigs_320, + }, + { + .name = "Engine", + .address = 0x141, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_321), + .sigs = sigs_321, + }, + { + .name = "CruiseControl", + .address = 0x144, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_324), + .sigs = sigs_324, + }, + { + .name = "Transmission", + .address = 0x148, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_328), + .sigs = sigs_328, + }, + { + .name = "Brake_Pressure", + .address = 0x150, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_336), + .sigs = sigs_336, + }, + { + .name = "Stalk", + .address = 0x152, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_338), + .sigs = sigs_338, + }, + { + .name = "ES_Brake", + .address = 0x160, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_352), + .sigs = sigs_352, + }, + { + .name = "ES_Distance", + .address = 0x161, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_353), + .sigs = sigs_353, + }, + { + .name = "ES_RPM", + .address = 0x162, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_354), + .sigs = sigs_354, + }, + { + .name = "ES_DashStatus", + .address = 0x163, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_355), + .sigs = sigs_355, + }, + { + .name = "ES_LKAS", + .address = 0x164, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_356), + .sigs = sigs_356, + }, + { + .name = "ES_LDW", + .address = 0x167, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_359), + .sigs = sigs_359, + }, + { + .name = "BSD_RCTA", + .address = 0x25C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_604), + .sigs = sigs_604, + }, + { + .name = "Dashlights", + .address = 0x282, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_642), + .sigs = sigs_642, + }, + { + .name = "Engine_Temp", + .address = 0x360, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_864), + .sigs = sigs_864, + }, + { + .name = "Steering_Torque_2", + .address = 0x370, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_880), + .sigs = sigs_880, + }, + { + .name = "Steering_Torque", + .address = 0x371, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_881), + .sigs = sigs_881, + }, + { + .name = "BodyInfo", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "Dash_State2", + .address = 0x3D1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_977), + .sigs = sigs_977, + }, + { + .name = "Dash_State", + .address = 0x6D1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1745), + .sigs = sigs_1745, + }, +}; + +const Val vals[] = { + { + .name = "Gear", + .address = 0x148, + .def_val = "0 N 1 D 2 D 3 D 4 D 5 D 6 D 14 R 15 P", + .sigs = sigs_328, + }, +}; + +} + +const DBC subaru_forester_2017_generated = { + .name = "subaru_forester_2017_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(subaru_forester_2017_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/subaru_global_2017_generated.cc b/opendbc/can/dbc_out/subaru_global_2017_generated.cc new file mode 100644 index 000000000..52bbd3012 --- /dev/null +++ b/opendbc/can/dbc_out/subaru_global_2017_generated.cc @@ -0,0 +1,2462 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_2[] = { + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Steering_Angle", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 25, + .b2 = 3, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_64[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Engine_RPM", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Throttle_Pedal", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Throttle_Cruise", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Throttle_Combo", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal3", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Off_Accel", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_72[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Gear", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RPM", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_73[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CVT_Gear", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_280[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "State", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_281[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Error_1", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Torque_Sensor", + .b1 = 16, + .b2 = 11, + .bo = 37, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Error_2", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Warning", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steering_Angle", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = true, + .factor = -0.0217, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Torque_Output", + .b1 = 48, + .b2 = 11, + .bo = 5, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_290[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_1", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Output", + .b1 = 16, + .b2 = 13, + .bo = 35, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Request", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_312[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_2", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_313[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Speed", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.05625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 28, + .b2 = 6, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Lights", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal3", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pedal", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal4", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_314[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FR", + .b1 = 12, + .b2 = 13, + .bo = 39, + .is_signed = false, + .factor = 0.057, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RR", + .b1 = 25, + .b2 = 13, + .bo = 26, + .is_signed = false, + .factor = 0.057, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RL", + .b1 = 38, + .b2 = 13, + .bo = 13, + .is_signed = false, + .factor = 0.057, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FL", + .b1 = 51, + .b2 = 13, + .bo = 0, + .is_signed = false, + .factor = 0.057, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_315[] = { + { + .name = "Lateral", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Longitudinal", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_316[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 12, + .b2 = 46, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ES_Brake", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 59, + .b2 = 3, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal3", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_326[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 12, + .b2 = 30, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Main", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Set", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Resume", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 45, + .b2 = 19, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_372[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STOP_START_STATE", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_544[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pressure", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Brake_Lights", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Brake_Fault", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Brake_Active", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal3", + .b1 = 40, + .b2 = 24, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_545[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 12, + .b2 = 3, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Fault", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Throttle", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Car_Follow", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal3", + .b1 = 33, + .b2 = 3, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Brake_Active", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Distance_Swap", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_EPB", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal4", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Close_Distance", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal5", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Cancel", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Set", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Resume", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal6", + .b1 = 59, + .b2 = 5, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_546[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 12, + .b2 = 3, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Fault", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_RPM", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Lights", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Hold", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal3", + .b1 = 32, + .b2 = 32, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_552[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "R_ADJACENT", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "L_ADJACENT", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "R_APPROACHING", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "L_APPROACHING", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_576[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 12, + .b2 = 28, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_On", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 42, + .b2 = 22, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_577[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_On", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Active", + .b1 = 57, + .b2 = 4, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_722[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AC_ON", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AC_Mode", + .b1 = 37, + .b2 = 3, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_801[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PCB_Off", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Off", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_State_Msg", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_State_Msg", + .b1 = 20, + .b2 = 3, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Soft_Disable", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Status_Msg", + .b1 = 25, + .b2 = 2, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal3", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Distance", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal4", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Conventional_Cruise", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal5", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Disengaged", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal6", + .b1 = 37, + .b2 = 3, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Set_Speed", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Fault", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_On", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Display_Own_Car", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Lights", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Car_Follow", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal7", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Far_Distance", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_State", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_802[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Alert_Msg", + .b1 = 12, + .b2 = 3, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 15, + .b2 = 2, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_ACTIVE", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Dash_State", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 20, + .b2 = 3, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Backward_Speed_Limit_Menu", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Left_Line_Enable", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Left_Line_Light_Blink", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Right_Line_Enable", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Right_Line_Light_Blink", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Left_Line_Visible", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Right_Line_Visible", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Alert", + .b1 = 32, + .b2 = 5, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal3", + .b1 = 37, + .b2 = 27, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_912[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UNITS", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ICY_ROAD", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_FL", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STOP_START", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_940[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_TRUNK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DASH_BTN_LIGHTS", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOWBEAM", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGHBEAM", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FOG_LIGHTS", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIPERS", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1677[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::SUBARU_CHECKSUM, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Units", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "Steering", + .address = 0x2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2), + .sigs = sigs_2, + }, + { + .name = "Throttle", + .address = 0x40, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_64), + .sigs = sigs_64, + }, + { + .name = "Transmission", + .address = 0x48, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_72), + .sigs = sigs_72, + }, + { + .name = "CVT", + .address = 0x49, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_73), + .sigs = sigs_73, + }, + { + .name = "STOP_START", + .address = 0x118, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_280), + .sigs = sigs_280, + }, + { + .name = "Steering_Torque", + .address = 0x119, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_281), + .sigs = sigs_281, + }, + { + .name = "ES_LKAS", + .address = 0x122, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_290), + .sigs = sigs_290, + }, + { + .name = "Brake_Pressure_L_R", + .address = 0x138, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_312), + .sigs = sigs_312, + }, + { + .name = "Brake_Pedal", + .address = 0x139, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_313), + .sigs = sigs_313, + }, + { + .name = "Wheel_Speeds", + .address = 0x13A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_314), + .sigs = sigs_314, + }, + { + .name = "G_Sensor", + .address = 0x13B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_315), + .sigs = sigs_315, + }, + { + .name = "Brake_Status", + .address = 0x13C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_316), + .sigs = sigs_316, + }, + { + .name = "Cruise_Buttons", + .address = 0x146, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_326), + .sigs = sigs_326, + }, + { + .name = "Engine_Stop_Start", + .address = 0x174, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_372), + .sigs = sigs_372, + }, + { + .name = "ES_Brake", + .address = 0x220, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_544), + .sigs = sigs_544, + }, + { + .name = "ES_Distance", + .address = 0x221, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_545), + .sigs = sigs_545, + }, + { + .name = "ES_Status", + .address = 0x222, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_546), + .sigs = sigs_546, + }, + { + .name = "BSD_RCTA", + .address = 0x228, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_552), + .sigs = sigs_552, + }, + { + .name = "CruiseControl", + .address = 0x240, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_576), + .sigs = sigs_576, + }, + { + .name = "Cruise_Status", + .address = 0x241, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_577), + .sigs = sigs_577, + }, + { + .name = "AC_State", + .address = 0x2D2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_722), + .sigs = sigs_722, + }, + { + .name = "ES_DashStatus", + .address = 0x321, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_801), + .sigs = sigs_801, + }, + { + .name = "ES_LKAS_State", + .address = 0x322, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_802), + .sigs = sigs_802, + }, + { + .name = "Dashlights", + .address = 0x390, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_912), + .sigs = sigs_912, + }, + { + .name = "BodyInfo", + .address = 0x3AC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_940), + .sigs = sigs_940, + }, + { + .name = "Dash_State", + .address = 0x68D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1677), + .sigs = sigs_1677, + }, +}; + +const Val vals[] = { + { + .name = "Gear", + .address = 0x48, + .def_val = "2 N 3 R 4 P 121 D 137 1 145 2 153 3 161 4 169 5 177 6", + .sigs = sigs_72, + }, +}; + +} + +const DBC subaru_global_2017_generated = { + .name = "subaru_global_2017_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(subaru_global_2017_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/subaru_outback_2015_generated.cc b/opendbc/can/dbc_out/subaru_outback_2015_generated.cc new file mode 100644 index 000000000..885b26c8a --- /dev/null +++ b/opendbc/can/dbc_out/subaru_outback_2015_generated.cc @@ -0,0 +1,1934 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_2[] = { + { + .name = "Steering_Angle", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_208[] = { + { + .name = "Steering_Angle", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Lateral", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.0035, + .offset = 1, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Longitudinal", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = true, + .factor = -0.00035, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_209[] = { + { + .name = "Speed", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.05625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pedal", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_210[] = { + { + .name = "Brake_Light", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Related", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Right_Brake", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Left_Brake", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_211[] = { + { + .name = "Brake_Light", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Speed_Counter", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Cruise_On", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pedal_On", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_212[] = { + { + .name = "FL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.0592, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FR", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.0592, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RL", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.0592, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RR", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.0592, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_320[] = { + { + .name = "Throttle_Pedal", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.392157, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Not_Full_Throttle", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Engine_RPM", + .b1 = 16, + .b2 = 14, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Off_Throttle", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal3", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Throttle_Cruise", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Throttle_Combo", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Throttle_Body", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Off_Throttle_2", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal4", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_321[] = { + { + .name = "Engine_Torque", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Engine_Stop", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Wheel_Torque", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Engine_RPM", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_324[] = { + { + .name = "OnOffButton", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_BUTTON", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RES_BUTTON", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Button", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_On", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pedal_On", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_328[] = { + { + .name = "Manual_Gear", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Transmission_Engine", + .b1 = 16, + .b2 = 15, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Gear", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Gear_2", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Paddle_Shift", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_336[] = { + { + .name = "Brake_Pressure_Right", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pressure_Left", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_338[] = { + { + .name = "Counter", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Light", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Runlights", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Headlights", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Highbeam", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Wiper", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_352[] = { + { + .name = "Brake_Pressure", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Light", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Fault", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_On", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_353[] = { + { + .name = "Cruise_Throttle", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Car_Follow", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 17, + .b2 = 3, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_On", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Distance_Swap", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Standstill", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal3", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Close_Distance", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.0196, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal4", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Standstill_2", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Fault", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal5", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 44, + .b2 = 3, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal6", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Button", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal7", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_354[] = { + { + .name = "Brake", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_356[] = { + { + .name = "Counter", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Command", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Active", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_358[] = { + { + .name = "Not_Ready_Startup", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Seatbelt_Disengage", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Disengage_Alert", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_On", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEELS_MOVING_2015", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Driver_Input", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Distance", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Set_Speed", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Fault", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_On_2", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 37, + .b2 = 3, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steep_Hill_Disengage", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Car_Follow", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Far_Distance", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_359[] = { + { + .name = "All_depart_2015", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Right_Line_2017", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Left_Line_2017", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig1All_Depart", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig2All_Depart", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Inactive_2017", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Active", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig1Right_Depart", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig1Right_Depart_Front", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig2Right_Depart", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Left_Depart_Front", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig3All_Depart", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_604[] = { + { + .name = "Counter", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "State", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "R_ADJACENT", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "L_ADJACENT", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "R_APPROACHING", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "L_APPROACHING", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "R_RCTA", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "L_RCTA", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_642[] = { + { + .name = "Counter", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_FL", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_864[] = { + { + .name = "Oil_Temp", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Coolant_Temp", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Saved_Speed", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_880[] = { + { + .name = "Steering_Voltage_Flat", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Torque_Sensor", + .b1 = 29, + .b2 = 11, + .bo = 24, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_881[] = { + { + .name = "Steering_Motor_Flat", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 32, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Torque_Output", + .b1 = 16, + .b2 = 11, + .bo = 37, + .is_signed = true, + .factor = -32.0, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Error_1", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Torque_Sensor", + .b1 = 29, + .b2 = 11, + .bo = 24, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steering_Angle", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = -0.033, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "DOOR_OPEN_FR", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_Hatch", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_977[] = { + { + .name = "UNITS", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1745[] = { + { + .name = "Units", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "Steering", + .address = 0x2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2), + .sigs = sigs_2, + }, + { + .name = "G_Sensor", + .address = 0xD0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_208), + .sigs = sigs_208, + }, + { + .name = "Brake_Pedal", + .address = 0xD1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_209), + .sigs = sigs_209, + }, + { + .name = "Brake_2", + .address = 0xD2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_210), + .sigs = sigs_210, + }, + { + .name = "Brake_Type", + .address = 0xD3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_211), + .sigs = sigs_211, + }, + { + .name = "Wheel_Speeds", + .address = 0xD4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_212), + .sigs = sigs_212, + }, + { + .name = "Throttle", + .address = 0x140, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_320), + .sigs = sigs_320, + }, + { + .name = "Engine", + .address = 0x141, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_321), + .sigs = sigs_321, + }, + { + .name = "CruiseControl", + .address = 0x144, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_324), + .sigs = sigs_324, + }, + { + .name = "Transmission", + .address = 0x148, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_328), + .sigs = sigs_328, + }, + { + .name = "Brake_Pressure", + .address = 0x150, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_336), + .sigs = sigs_336, + }, + { + .name = "Stalk", + .address = 0x152, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_338), + .sigs = sigs_338, + }, + { + .name = "ES_Brake", + .address = 0x160, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_352), + .sigs = sigs_352, + }, + { + .name = "ES_Distance", + .address = 0x161, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_353), + .sigs = sigs_353, + }, + { + .name = "ES_RPM", + .address = 0x162, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_354), + .sigs = sigs_354, + }, + { + .name = "ES_LKAS", + .address = 0x164, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_356), + .sigs = sigs_356, + }, + { + .name = "ES_DashStatus", + .address = 0x166, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_358), + .sigs = sigs_358, + }, + { + .name = "ES_LDW", + .address = 0x167, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_359), + .sigs = sigs_359, + }, + { + .name = "BSD_RCTA", + .address = 0x25C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_604), + .sigs = sigs_604, + }, + { + .name = "Dashlights", + .address = 0x282, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_642), + .sigs = sigs_642, + }, + { + .name = "Engine_Temp", + .address = 0x360, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_864), + .sigs = sigs_864, + }, + { + .name = "Steering_Torque_2", + .address = 0x370, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_880), + .sigs = sigs_880, + }, + { + .name = "Steering_Torque", + .address = 0x371, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_881), + .sigs = sigs_881, + }, + { + .name = "BodyInfo", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "Dash_State2", + .address = 0x3D1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_977), + .sigs = sigs_977, + }, + { + .name = "Dash_State", + .address = 0x6D1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1745), + .sigs = sigs_1745, + }, +}; + +const Val vals[] = { + { + .name = "Gear", + .address = 0x148, + .def_val = "0 N 1 D 2 D 3 D 4 D 5 D 6 D 14 R 15 P", + .sigs = sigs_328, + }, +}; + +} + +const DBC subaru_outback_2015_generated = { + .name = "subaru_outback_2015_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(subaru_outback_2015_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/subaru_outback_2019_generated.cc b/opendbc/can/dbc_out/subaru_outback_2019_generated.cc new file mode 100644 index 000000000..4e48ee14d --- /dev/null +++ b/opendbc/can/dbc_out/subaru_outback_2019_generated.cc @@ -0,0 +1,1934 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_2[] = { + { + .name = "Steering_Angle", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_208[] = { + { + .name = "Steering_Angle", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = -0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Lateral", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = -0.0035, + .offset = 1, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Longitudinal", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = true, + .factor = -0.00035, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_209[] = { + { + .name = "Speed", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.05625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pedal", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_210[] = { + { + .name = "Brake_Light", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Related", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Right_Brake", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Left_Brake", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_211[] = { + { + .name = "Brake_Light", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Speed_Counter", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Cruise_On", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pedal_On", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_212[] = { + { + .name = "FL", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.0592, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "FR", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.0592, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RL", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.0592, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RR", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.0592, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_320[] = { + { + .name = "Throttle_Pedal", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.392157, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Not_Full_Throttle", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Engine_RPM", + .b1 = 16, + .b2 = 14, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Off_Throttle", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal3", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Throttle_Cruise", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Throttle_Combo", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Throttle_Body", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Off_Throttle_2", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal4", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_321[] = { + { + .name = "Engine_Torque", + .b1 = 0, + .b2 = 15, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Engine_Stop", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Wheel_Torque", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Engine_RPM", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_324[] = { + { + .name = "OnOffButton", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_BUTTON", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RES_BUTTON", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Button", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_On", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pedal_On", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_328[] = { + { + .name = "Manual_Gear", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Transmission_Engine", + .b1 = 16, + .b2 = 15, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Gear", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Gear_2", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Paddle_Shift", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_336[] = { + { + .name = "Brake_Pressure_Right", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Pressure_Left", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_338[] = { + { + .name = "Counter", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Light", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Runlights", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Headlights", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Highbeam", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Wiper", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_352[] = { + { + .name = "Brake_Pressure", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Light", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Fault", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_On", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_353[] = { + { + .name = "Cruise_Throttle", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Car_Follow", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal2", + .b1 = 17, + .b2 = 3, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_On", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Distance_Swap", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Standstill", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal3", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Close_Distance", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.0196, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal4", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Standstill_2", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Fault", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal5", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 44, + .b2 = 3, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal6", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Button", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal7", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_354[] = { + { + .name = "Brake", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RPM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_356[] = { + { + .name = "Counter", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Command", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Active", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_358[] = { + { + .name = "Not_Ready_Startup", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Seatbelt_Disengage", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Disengage_Alert", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_On", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Signal1", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEELS_MOVING_2015", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Driver_Input", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Distance", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Set_Speed", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Fault", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_On_2", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 37, + .b2 = 3, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steep_Hill_Disengage", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Car_Follow", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Far_Distance", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_359[] = { + { + .name = "All_depart_2015", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Right_Line_2017", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Left_Line_2017", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig1All_Depart", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig2All_Depart", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Inactive_2017", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_Active", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig1Right_Depart", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig1Right_Depart_Front", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig2Right_Depart", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Left_Depart_Front", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Sig3All_Depart", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_604[] = { + { + .name = "Counter", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "State", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "R_ADJACENT", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "L_ADJACENT", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "R_APPROACHING", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "L_APPROACHING", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "R_RCTA", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "L_RCTA", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_642[] = { + { + .name = "Counter", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_FL", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_BLINKER", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_BLINKER", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_864[] = { + { + .name = "Oil_Temp", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Coolant_Temp", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Cruise_Activated", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Saved_Speed", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_880[] = { + { + .name = "Steering_Voltage_Flat", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Torque_Sensor", + .b1 = 29, + .b2 = 11, + .bo = 24, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Counter", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_881[] = { + { + .name = "Steering_Motor_Flat", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 32, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Torque_Output", + .b1 = 16, + .b2 = 11, + .bo = 37, + .is_signed = true, + .factor = -32.0, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Error_1", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steer_Torque_Sensor", + .b1 = 29, + .b2 = 11, + .bo = 24, + .is_signed = true, + .factor = -1.0, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Steering_Angle", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = -0.033, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "DOOR_OPEN_FR", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_Hatch", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_977[] = { + { + .name = "UNITS", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1745[] = { + { + .name = "Units", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "Steering", + .address = 0x2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2), + .sigs = sigs_2, + }, + { + .name = "G_Sensor", + .address = 0xD0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_208), + .sigs = sigs_208, + }, + { + .name = "Brake_Pedal", + .address = 0xD1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_209), + .sigs = sigs_209, + }, + { + .name = "Brake_2", + .address = 0xD2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_210), + .sigs = sigs_210, + }, + { + .name = "Brake_Type", + .address = 0xD3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_211), + .sigs = sigs_211, + }, + { + .name = "Wheel_Speeds", + .address = 0xD4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_212), + .sigs = sigs_212, + }, + { + .name = "Throttle", + .address = 0x140, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_320), + .sigs = sigs_320, + }, + { + .name = "Engine", + .address = 0x141, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_321), + .sigs = sigs_321, + }, + { + .name = "CruiseControl", + .address = 0x144, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_324), + .sigs = sigs_324, + }, + { + .name = "Transmission", + .address = 0x148, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_328), + .sigs = sigs_328, + }, + { + .name = "Brake_Pressure", + .address = 0x150, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_336), + .sigs = sigs_336, + }, + { + .name = "Stalk", + .address = 0x152, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_338), + .sigs = sigs_338, + }, + { + .name = "ES_Brake", + .address = 0x160, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_352), + .sigs = sigs_352, + }, + { + .name = "ES_Distance", + .address = 0x161, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_353), + .sigs = sigs_353, + }, + { + .name = "ES_RPM", + .address = 0x162, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_354), + .sigs = sigs_354, + }, + { + .name = "ES_LKAS", + .address = 0x164, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_356), + .sigs = sigs_356, + }, + { + .name = "ES_DashStatus", + .address = 0x166, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_358), + .sigs = sigs_358, + }, + { + .name = "ES_LDW", + .address = 0x167, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_359), + .sigs = sigs_359, + }, + { + .name = "BSD_RCTA", + .address = 0x25C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_604), + .sigs = sigs_604, + }, + { + .name = "Dashlights", + .address = 0x282, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_642), + .sigs = sigs_642, + }, + { + .name = "Engine_Temp", + .address = 0x360, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_864), + .sigs = sigs_864, + }, + { + .name = "Steering_Torque_2", + .address = 0x370, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_880), + .sigs = sigs_880, + }, + { + .name = "Steering_Torque", + .address = 0x371, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_881), + .sigs = sigs_881, + }, + { + .name = "BodyInfo", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "Dash_State2", + .address = 0x3D1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_977), + .sigs = sigs_977, + }, + { + .name = "Dash_State", + .address = 0x6D1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1745), + .sigs = sigs_1745, + }, +}; + +const Val vals[] = { + { + .name = "Gear", + .address = 0x148, + .def_val = "0 N 1 D 2 D 3 D 4 D 5 D 6 D 14 R 15 P", + .sigs = sigs_328, + }, +}; + +} + +const DBC subaru_outback_2019_generated = { + .name = "subaru_outback_2019_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(subaru_outback_2019_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/tesla_can.cc b/opendbc/can/dbc_out/tesla_can.cc new file mode 100644 index 000000000..4d2bd3735 --- /dev/null +++ b/opendbc/can/dbc_out/tesla_can.cc @@ -0,0 +1,13296 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_3[] = { + { + .name = "StW_Angl", + .b1 = 2, + .b2 = 14, + .bo = 48, + .is_signed = false, + .factor = 0.5, + .offset = -2048.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_AnglSpd", + .b1 = 18, + .b2 = 14, + .bo = 32, + .is_signed = false, + .factor = 0.5, + .offset = -2048.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_AnglSens_Stat", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_AnglSens_Id", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MC_STW_ANGL_STAT", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRC_STW_ANGL_STAT", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_14[] = { + { + .name = "StW_AnglHP", + .b1 = 2, + .b2 = 14, + .bo = 48, + .is_signed = false, + .factor = 0.1, + .offset = -819.2, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_AnglHP_Spd", + .b1 = 18, + .b2 = 14, + .bo = 32, + .is_signed = false, + .factor = 0.5, + .offset = -4096.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_AnglHP_Sens_Stat", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_AnglHP_Sens_Id", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MC_STW_ANGLHP_STAT", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRC_STW_ANGLHP_STAT", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_69[] = { + { + .name = "SpdCtrlLvr_Stat", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VSL_Enbl_Rq", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SpdCtrlLvrStat_Inv", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DTR_Dist_Rq", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TurnIndLvr_Stat", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HiBmLvr_Stat", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WprWashSw_Psd", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WprWash_R_Sw_Posn_V2", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Lvr_Stat", + .b1 = 24, + .b2 = 3, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Cond_Flt", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Cond_Psd", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HrnSw_Psd", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw00_Psd", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw01_Psd", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw02_Psd", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw03_Psd", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw04_Psd", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw05_Psd", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw06_Psd", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw07_Psd", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw08_Psd", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw09_Psd", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw10_Psd", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw11_Psd", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw12_Psd", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw13_Psd", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw14_Psd", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw15_Psd", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WprSw6Posn", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MC_STW_ACTN_RQ", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRC_STW_ACTN_RQ", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_104[] = { + { + .name = "MCU_elevation", + .b1 = 0, + .b2 = 32, + .bo = 32, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_navigonExpectedSpeed", + .b1 = 32, + .b2 = 7, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_109[] = { + { + .name = "StW_Sw_Stat3", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MsgTxmtId", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSL_RND_Posn_StW", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSL_P_Psd_StW", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MC_SBW_RQ_SCCM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRC_SBW_RQ_SCCM", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_257[] = { + { + .name = "GTW_epasTuneRequest", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_epasPowerMode", + .b1 = 1, + .b2 = 4, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_epasEmergencyOn", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_epasControlCounter", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_epasLDWEnabled", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_epasControlType", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_epasControlChecksum", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_264[] = { + { + .name = "DI_torqueDriver", + .b1 = 0, + .b2 = 13, + .bo = 51, + .is_signed = true, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torque1Counter", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torqueMotor", + .b1 = 16, + .b2 = 13, + .bo = 35, + .is_signed = true, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_soptState", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_motorRPM", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_pedalPos", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.4, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torque1Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_280[] = { + { + .name = "DI_torqueEstimate", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = true, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_gear", + .b1 = 12, + .b2 = 3, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_brakePedal", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_vehicleSpeed", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.05, + .offset = -25.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_gearRequest", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torqueInterfaceFailure", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torque2Counter", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_brakePedalState", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_epbParkRequest", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_epbInterfaceReady", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torque2Checksum", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_309[] = { + { + .name = "ESP_hillStartAssistActive", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_absBrakeEvent", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_brakeLamp", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_brakeDiscWipingActive", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_tcLampFlash", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_espFaultLamp", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_espLampFlash", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_135hCounter", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_stabilityControlSts", + .b1 = 9, + .b2 = 3, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_tcOffLamp", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_135hChecksum", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_messagePumpService", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_messagePumpFailure", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_messageEBDFailure", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_absFaultLamp", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_tcDisabledByFault", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_messageDynoModeActive", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_hydraulicBoostEnabled", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_espOffLamp", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_341[] = { + { + .name = "ESP_wheelPulseCountFrL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_wheelPulseCountFrR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_wheelPulseCountReL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_wheelPulseCountReR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_BChecksum", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_vehicleSpeed", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 0.00999999978, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_vehicleSpeedQF", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_BCounter", + .b1 = 57, + .b2 = 4, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_513[] = { + { + .name = "SDM_bcklPassStatus", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SDM_bcklDrivStatus", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_521[] = { + { + .name = "DAS_locMode", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_locState", + .b1 = 2, + .b2 = 3, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_locRequest", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_locJerkMin", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.034, + .offset = -8.67, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_locJerkMax", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.034, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_locSpeed", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_locAccelMin", + .b1 = 35, + .b2 = 9, + .bo = 20, + .is_signed = false, + .factor = 0.04, + .offset = -15.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_locAccelMax", + .b1 = 44, + .b2 = 9, + .bo = 11, + .is_signed = false, + .factor = 0.04, + .offset = -15.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_longControlCounter", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_longControlChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_522[] = { + { + .name = "driverBrakeStatus", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_529[] = { + { + .name = "RCM_driverOrientationInitStatus", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_armStatus", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_warningIndicatorState", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_tellTalePassengerState", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_bucklePassengerStatus", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_tellTaleDriverState", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_buckleDriverStatus", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_seatTrackPositionDrvr", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_passAirbagRequest", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_chimeState1stRow", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_vinLearnFlag", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_hwConfigPin58", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_hwConfigPin57", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_hwConfigPin56", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_passOccupantStatus", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_airbagCutoffSwStatus", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_privateCANStatus", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_publicCANStatus", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_edr2State", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_edr1State", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_buckle2ndRowStatus", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_statusCounter", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_statusChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_532[] = { + { + .name = "EPB_epasEACAllow", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_epasControlCounter", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_epasControlChecksum", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_536[] = { + { + .name = "MCU_dasDebugEnable", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_parkBrakeRequest", + .b1 = 1, + .b2 = 2, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_trailerModeCH", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_fcwSensitivity", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_fcwEnable", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_latControlEnable", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_accOvertakeEnable", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_ldwEnable", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_aebEnable", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_bsdEnable", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_ahlbEnable", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_parkSetting", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_pedalSafetyEnable", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_frontDefrostReq_das", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_autoParkRequest", + .b1 = 26, + .b2 = 4, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_redLightStopSignEnable", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_enableCreepTorqueCH", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_narrowGarages", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_rebootAutopilot", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_enableAutowipers", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_overPaintedUSS", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_selfParkTune", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_towModeEnable", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_zeroSpeedConfirmed", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_aesEnable", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_autoLaneChangeEnable", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_chassisControlCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_chassisControlChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_537[] = { + { + .name = "DAS_pscControlCounter", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pscParkState", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_eacState", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pscControlChecksum", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_568[] = { + { + .name = "UI_roadSign", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_dummyData", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_stopSignStopLineDist", + .b1 = 8, + .b2 = 10, + .bo = 46, + .is_signed = false, + .factor = 0.25, + .offset = -8.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_trafficLightStopLineDist", + .b1 = 8, + .b2 = 10, + .bo = 46, + .is_signed = false, + .factor = 0.25, + .offset = -8.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_baseMapSpeedLimitMPS", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_meanFleetSplineSpeedMPS", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_currSplineIdFull", + .b1 = 8, + .b2 = 32, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_bottomQrtlFleetSpeedMPS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_medianFleetSpeedMPS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_stopSignStopLineConf", + .b1 = 18, + .b2 = 7, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_trafficLightStopLineConf", + .b1 = 18, + .b2 = 7, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_topQrtlFleetSpeedMPS", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_meanFleetSplineAccelMPS2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.05, + .offset = -6.35, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rampType", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_splineLocConfidence", + .b1 = 40, + .b2 = 7, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_splineID", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadSignCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadSignChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_569[] = { + { + .name = "DAS_leftLaneExists", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightLaneExists", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_virtualLaneWidth", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 0.3125, + .offset = 2, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_virtualLaneViewRange", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_virtualLaneC0", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.035, + .offset = -3.5, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_virtualLaneC1", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.0016, + .offset = -0.2, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_virtualLaneC2", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 2e-05, + .offset = -0.0025, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_virtualLaneC3", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 2.4e-07, + .offset = -3e-05, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftLineUsage", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightLineUsage", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftFork", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightFork", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_lanesCounter", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_582[] = { + { + .name = "UI_solarAzimuthAngle", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_solarAzimuthAngleCarRef", + .b1 = 16, + .b2 = 9, + .bo = 39, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_isSunUp", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_solarElevationAngle", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_643[] = { + { + .name = "DrRLtch_FL_Stat", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DrRLtch_FR_Stat", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DrRLtch_RL_Stat", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DrRLtch_RR_Stat", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DL_RLtch_Stat", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EngHd_Stat", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VTA_Alm_Actv", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LgtSens_Twlgt", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LgtSens_SNA", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LgtSens_Tunnel", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LgtSens_Flt", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LgtSens_Night", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ADL_LoBm_On_Rq", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Trlr_Stat", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Hrn_On", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Term54_Actv", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MPkBrk_Stat", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WprOutsdPkPosn", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LoBm_On_Rq", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HiBm_On", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IrLmp_D_Lt_Flt", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IrLmp_P_Rt_Flt", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LoBm_D_Lt_Flt", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LoBm_P_Rt_Flt", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RevGr_Engg", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AirTemp_Insd", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Bckl_Sw_RL_Stat_SAM_R", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Bckl_Sw_RR_Stat_SAM_R", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Bckl_Sw_RM_Stat_SAM_R", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Cond_Stat", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AirTemp_Outsd", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.5, + .offset = -40.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_696[] = { + { + .name = "UI_radarTargetDx", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = -95.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_radarTargetDxEnd", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_radarTargetTrustMap", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_radarEnableBraking", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_radarMapDataCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_radarMapDataChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_697[] = { + { + .name = "DAS_setSpeed", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_accState", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_aebEvent", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_jerkMin", + .b1 = 18, + .b2 = 9, + .bo = 37, + .is_signed = false, + .factor = 0.03, + .offset = -15.232, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_jerkMax", + .b1 = 27, + .b2 = 8, + .bo = 29, + .is_signed = false, + .factor = 0.059, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_accelMin", + .b1 = 35, + .b2 = 9, + .bo = 20, + .is_signed = false, + .factor = 0.04, + .offset = -15.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_accelMax", + .b1 = 44, + .b2 = 9, + .bo = 11, + .is_signed = false, + .factor = 0.04, + .offset = -15.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_controlCounter", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_controlChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_712[] = { + { + .name = "UI_roadCurvC0", + .b1 = 0, + .b2 = 11, + .bo = 53, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadCurvC1", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.00075, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadCurvC2", + .b1 = 21, + .b2 = 14, + .bo = 29, + .is_signed = true, + .factor = 7.5e-06, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadCurvC3", + .b1 = 35, + .b2 = 13, + .bo = 16, + .is_signed = true, + .factor = 3e-08, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadCurvRange", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 4, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadCurvHealth", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadCurvChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_728[] = { + { + .name = "UI_csaOfframpCurvC2", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1e-06, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaOfframpCurvC3", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 4e-09, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaOfframpCurvRange", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaOfframpCurvCounter", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaOfframpCurvUsingTspline", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaOfframpCurvReserved", + .b1 = 49, + .b2 = 7, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaOfframpCurvChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_744[] = { + { + .name = "UI_csaRoadCurvC2", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1e-06, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaRoadCurvC3", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 4e-09, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaRoadCurvRange", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaRoadCurvCounter", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaRoadCurvUsingTspline", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaRoadCurvReserved", + .b1 = 49, + .b2 = 7, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaRoadCurvChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_760[] = { + { + .name = "UI_gpsHDOP", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_gpsVehicleHeading", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = false, + .factor = 0.0078125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_gpsVehicleSpeed", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = false, + .factor = 0.00390625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_userSpeedOffset", + .b1 = 40, + .b2 = 6, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = -30.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_mapSpeedLimitUnits", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_userSpeedOffsetUnits", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_mppSpeedLimit", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_gpsNmeaMIA", + .b1 = 53, + .b2 = 1, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "DAS_objectId", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVehType", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVehRelevantForControl", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVehDx", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVehVxRel", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 4, + .offset = -30.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVehDy", + .b1 = 20, + .b2 = 7, + .bo = 37, + .is_signed = false, + .factor = 0.35, + .offset = -22.05, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVehId", + .b1 = 27, + .b2 = 7, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVeh2Type", + .b1 = 34, + .b2 = 3, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVeh2RelevantForControl", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVeh2Dx", + .b1 = 39, + .b2 = 8, + .bo = 17, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVeh2VxRel", + .b1 = 47, + .b2 = 4, + .bo = 13, + .is_signed = false, + .factor = 4, + .offset = -30.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVeh2Dy", + .b1 = 51, + .b2 = 7, + .bo = 6, + .is_signed = false, + .factor = 0.35, + .offset = -22.05, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVeh2Id", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_782[] = { + { + .name = "PARK_frontSVACharID", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_pscRightCurbType", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_rearSVACharID", + .b1 = 8, + .b2 = 6, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_pscLeftCurbType", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_autoCalComplete", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_geometryType", + .b1 = 17, + .b2 = 2, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_tireFitment", + .b1 = 19, + .b2 = 2, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_rackDetected", + .b1 = 21, + .b2 = 2, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_sdiActive", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_sdiNoise", + .b1 = 25, + .b2 = 2, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_sdiBlindSpotRight", + .b1 = 27, + .b2 = 2, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_sdiBlindSpotLeft", + .b1 = 29, + .b2 = 2, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_status2Counter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_status2Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_792[] = { + { + .name = "YEAR", + .b1 = 0, + .b2 = 7, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 2000, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CERRD", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MONTH", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_STATE_FL", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_STATE_FR", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SECOND", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_STATE_RL", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Hour", + .b1 = 24, + .b2 = 5, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_STATE_RR", + .b1 = 29, + .b2 = 2, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAY", + .b1 = 32, + .b2 = 5, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MINUTE", + .b1 = 40, + .b2 = 6, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BOOT_STATE", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_updateInProgress", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_STATE_FrontTrunk", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_factoryMode", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_transportModeOn", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BC_headLightLStatus", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BC_headLightRStatus", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BC_indicatorLStatus", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BC_indicatorRStatus", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_813[] = { + { + .name = "IBST_infoIndex", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_buildType", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_udsProtocolVersion", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_pcbaId", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_assemblyId", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_usageId", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_bootloaderCrc", + .b1 = 32, + .b2 = 32, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_applicationCrc", + .b1 = 32, + .b2 = 32, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_variantCrc", + .b1 = 32, + .b2 = 32, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_componentId", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_824[] = { + { + .name = "UI_touchActive", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_audioActive", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_bluetoothActive", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_cellActive", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_displayReady", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_gpsActive", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_wifiConnected", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_systemActive", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_xmActive", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_displayOn", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_readyForDrive", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_cellConnected", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_vpnActive", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_wifiActive", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_cameraActive", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_usbActive", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_screenshotActive", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_monitorModemPower", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_factoryReset", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_cellNetworkTechnology", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_tegraCoreTemperature", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_tegraAmbientTemperature", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_googleWifiUsages", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_autopilotTrial", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_cellSignalBars", + .b1 = 50, + .b2 = 3, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_hardwareType", + .b1 = 53, + .b2 = 2, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_developmentCar", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_cellReceiverPower", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_840[] = { + { + .name = "GTW_driveRailReq", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_brakePressed", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_driverPresent", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_notEnough12VForDrive", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_icPowerOff", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_driverIsLeaving", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_accGoingDown", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_driveGoingDown", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_accRailReq", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_hvacRailReq", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_preconditionRequest", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_hvacGoingDown", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_statusCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_statusChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_861[] = { + { + .name = "IBST_dtcIndex", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d000_bmsInitTestFail", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d028_ecuWdErrCntContErr", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d056_ibNotShutDownRight", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d084_inputStroke2Grad", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d112_motPosTrvlReadEmpty", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d140_pdmOutOfMemory", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d168_comsclEspIb2CsErr", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d196_sclEspIb1pEstMax", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d001_bmcSingleTransTest", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d029_bmcShortedGateTest", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d057_cdmHardUndrvolt", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d085_pts2Err", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d113_motAngBoundReadEmpt", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d141_pdmFieldSizeMis", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d169_comsclEspIb2DlcErr", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d197_sclEspIb1VehSpd", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d002_tle5012SsccrcFail", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d030_controllerDevTooBig", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d058_cdmHardOvrvolt", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d086_pts2LineGnd", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d114_motShaftShiftDetect", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d142_pdmHwAcsErr", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d170_comsclEspIb2Tout", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d198_sclEspIb2pLimExt", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d003_tle5012Config", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d031_ibDtrFail", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d059_maxTrvlAdjstUpdFail", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d087_pts2LineHigh", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d115_osErrHook", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d143_pdmInternalHWErr", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d171_comsclEspIb3CntErr", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d199_sclEspIb2qTarExt", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d004_deadlMonTaskx1Ovr", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d032_oc6InitTestFail", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d060_ltmLimitReached", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d088_faildevInputStroke", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d116_pdurEInitFail", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d144_ptsCalHysWritFail", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d172_comsclEspIb3CsErr", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d200_sclEspIb3pFBlend", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d005_ecuWdFltCntTstFls", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d033_oc6Monitor", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d061_dcomEcuDefect", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d089_ptsOffsTooHigh", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d117_pdurEPduInstLost", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d145_ptsCalValuesChkFail", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d173_comsclEspIb3DlcErr", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d201_sclEspIb3pMc1", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d006_ecuWdScheduleTout", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d034_motorOscillationDet", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d062_inputStroke1RngHigh", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d090_pbistErr", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d118_pts1OffsEeReadEmpty", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d146_pts1CalEeReadFail", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d174_comsclEspIb3Tout", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d202_sclEspIb3pTarDriver", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d007_ecuWdStarttestFls", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d035_rpsOffsEeReadFail", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d063_inputStroke1RngLow", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d091_ramInitErr", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d119_pts2OffsEeReadEmpty", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d147_pts1CalEeWriteFail", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d175_comsclGtwEsp1CntErr", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d203_netBusOffNet0", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d008_ecuWdStatusContErr", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d036_sysErrHook", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d064_inputStroke2RngHigh", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d092_ramsinlgeFlt", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d120_rpsOffsXEeReadFail", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d148_rpsFailCompErr", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d176_comsclGtwEsp1CsErr", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d204_netErrPassivNet0", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d009_netOvrvolt", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d037_calIdlePosNotPlaus", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d065_inputStroke2RngLow", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d093_bertFlt", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d121_rpsOffsYEeReadFail", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d149_pts1OffsEeWriteFail", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d177_comsclGtwEsp1Corrpt", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d205_netBusOffNet1", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d010_micSpiTout", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d038_boostSupUndrvolt", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d066_ibSupVoltDivDrift", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d094_CalDataNotPlaus", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d122_rpsSynchEeReadFail", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d150_pts2CalEeReadFail", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d178_comsclGtwEsp1Tout", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d206_netErrPassivNet1", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d011_micSpiTransferErr", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d039_calRoutineAbort", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d067_sOutRodToPressVal", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d095_canEHwError", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d123_rpsAnglRecalcErr", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d151_pts2CalEeWriteFail", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d179_dcomSmrtActuNotInit", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d207_maxStrokeReached", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d012_netUndvolt", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d040_bmcGateUndervoltPro", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d068_tle5012LifeCnt", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d096_canETout", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d124_motTrvlRelWriteFail", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d152_pts2OffsEeReadFail", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d180_rpsLengthAbsolHigh", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d208_sysSwClockMismatch", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d013_xpassToutErr", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d041_hswInitPhseUndrvolt", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d069_cdmExtendedUndrvolt", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d097_cpuException", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d125_motTrvlRelReadEmpty", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d153_pts2OffsEeWriteFail", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d181_rpsLengthAbsolLow", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d209_comsclGtwOdoCorrpt", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d014_rpsOffsEeReadEmpty", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d042_ltmWarnLevelReached", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d070_cdmExtendedOvrvolt", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d098_ecuBandGap", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d126_ptsEeReadEmpty", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d154_rpsOffsXEeReadEmpty", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d182_shutDownEeReadFail", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d210_comsclGtwStatCorrpt", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d015_rtpEnaHigh", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d043_rpsVctrLengthRelErr", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d071_tempB6Ch1LineHigh", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d099_ecuBmsOnWhileWdTout", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d127_ecuAdcConversionErr", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d155_rpsOffsXEeWriteFail", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d183_shutDownEeWriteFail", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d211_comsclEpbStatCorrpt", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d016_xpassEchoCountErr", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d044_b6TempDegradeLevel1", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d072_tempB6Ch1LineLow", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d100_ecuErrpinCntTstFls", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d128_ecuAdcSelftestErr", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d156_rpsOffsYEeReadEmpty", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d184_maxTrvlAdjstReadErr", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d212_comsclGtwOdoTout", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d017_preDriveChckFail", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d045_B6TempDegradeLevel2", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d073_tempB6Ch2LineHigh", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d101_ecuHetException", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d129_ccmFlt", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d157_rpsOffsYEeWriteFail", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d185_psOffsMcEeReadFail", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d213_comsclGtwStatTout", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d018_ucSafetyFlt", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d046_spiAnglOrRawNotUp", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d074_tempB6Ch2LineLow", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d102_ecuHetTuAddErr", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d130_ecuRomCheck", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d158_rpsSynchEeReadEmpty", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d186_psOffsMcEeWriteFail", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d214_comsclEpbStatTout", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d019_unsupportedHw", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d047_dcomIboosterNotInit", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d075_hevSwitchOffDcom", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d103_ecuHetTuBusErr", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d131_esmNmiFlt", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d159_rpsSynchEeWriteFail", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d187_ltmSelfProtDeact", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d215_comSclEpbStatCsErr", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d020_voltPreRegModeFld", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d048_unintendMotorReturn", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d076_tle5012VoltFail", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d104_ecuHetTuBusyErr", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d132_esmSafetyFlt", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d160_assertionFail", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d188_pts1OffsEeReadFail", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d216_comSclEpbStatCntFlt", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d021_ubbSupplyLine", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d049_cdmOvrvoltLevel1", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d077_bcsFltCurrentHigh", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d105_ecuHetTuException", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d133_motPosTrvlReadFail", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d161_comsclBrkPrsPduLen", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d189_diffStrokeRange", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d217_comSclDiTrq1Tout", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d022_stmAswSysTout", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d050_cdmUndrvoltLevel2", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d078_bcsFltCurrentLow", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d106_ecuTaskMissing", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d134_motPosTrvlWriteFail", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d162_comsclBrkPrsPduTout", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d190_notProgVin", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d218_comSclDiTrq1Corrpt", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d023_stackOvrUndFlow", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d051_cdmUndrvoltLevel1", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d079_ecuSupVoltDivDrift", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d107_hetRefError", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d135_motAnglBndReadErr", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d163_comsclEspIb1CntErr", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d191_plausVin", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d219_comSclDiTrq1CsErr", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d024_smmOneReqsInit", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d052_motTrvlRelReadFail", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d080_inputstroke1Grad", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d108_micInitSpiTstFld", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d136_motAnglBndWriteErr", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d164_comsclEspIb1CsErr", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d192_dlCorCSumVin", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d220_comSclDiTrq1CntFlt", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d025_ptsSupply", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d053_tle5012UnexpReset", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d081_pts1Err", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d109_micInitSpiTransfErr", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d137_motAnglGradTooLarge", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d165_comsclEspIb1DlcErr", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d193_ToutVin", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d026_ptsSupplyUndvolt", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d054_bmsGateUndrvolt", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d082_pts1LineGnd", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d110_micIntMonGenBitMon", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d138_pdmCustomerIdMis", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d166_comsclEspIb1Tout", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d194_ecuEnableB6Fail", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d027_tempB6Plaus", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d055_kl15HwPlausSw", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d083_pts1LineHigh", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d111_micIntVoltMonFld", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d139_pdmDtFormatMis", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d167_comsclEspIb2CntErr", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_d195_ecuIbEnContErr", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_872[] = { + { + .name = "DI_systemState", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_vehicleHoldState", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_proximity", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_driveReady", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_regenLight", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_state", + .b1 = 9, + .b2 = 3, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_cruiseState", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_analogSpeed", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_immobilizerState", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_speedUnits", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_digitalSpeed", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_aebState", + .b1 = 41, + .b2 = 3, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_stateCounter", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_cruiseSet", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_stateChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_880[] = { + { + .name = "EPAS_steeringRackForce", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 50, + .offset = -25575.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_steeringFault", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_steeringReduced", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_currentTuneMode", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_torsionBarTorque", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 0.01, + .offset = -20.5, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_eacErrorCode", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_internalSAS", + .b1 = 34, + .b2 = 14, + .bo = 16, + .is_signed = false, + .factor = 0.1, + .offset = -819.200012, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_handsOnLevel", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_sysStatusCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_eacStatus", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_sysStatusChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_904[] = { + { + .name = "MCU_clusterReadyForPowerOff", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_clusterReadyForDrive", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_clusterBacklightOn", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_clusterBrightnessLevel", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_905[] = { + { + .name = "DAS_accSpeedLimit", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pmmObstacleSeverity", + .b1 = 10, + .b2 = 3, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pmmLoggingRequest", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_activationFailureStatus", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pmmUltrasonicsFaultReason", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pmmRadarFaultReason", + .b1 = 19, + .b2 = 2, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pmmSysFaultReason", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pmmCameraFaultReason", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_ACC_report", + .b1 = 26, + .b2 = 5, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_relaxCruiseLimits", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_csaState", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_radarTelemetry", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_robState", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_driverInteractionLevel", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_ppOffsetDesiredRamp", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = -1.28, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_longCollisionWarning", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_status2Counter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_status2Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_920[] = { + { + .name = "GTW_performanceConfig", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_fourWheelDrive", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_unknown1", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_dasHw", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_parkAssistInstalled", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_forwardRadarHw", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_airSuspensionInstalled", + .b1 = 9, + .b2 = 3, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_unknown2", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_country", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_parkSensorGeometryType", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_rhd", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_bodyControlsType", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_radarPosition", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_rearCornerRadarHw", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_frontCornerRadarHw", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_epasType", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_chassisType", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_wheelType", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_rearSeatControllerMask", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_euVehicle", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_foldingMirrorsInstalled", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_brakeHwType", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_autopilot", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_unknown3", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_921[] = { + { + .name = "DAS_autopilotState", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_blindSpotRearLeft", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_blindSpotRearRight", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_fusedSpeedLimit", + .b1 = 8, + .b2 = 5, + .bo = 51, + .is_signed = false, + .factor = 5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_suppressSpeedWarning", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_summonObstacle", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_summonClearedGate", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_visionOnlySpeedLimit", + .b1 = 16, + .b2 = 5, + .bo = 43, + .is_signed = false, + .factor = 5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_heaterState", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_forwardCollisionWarning", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_autoparkReady", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_autoParked", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_autoparkWaitingForBrake", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_summonFwdLeashReached", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_summonRvsLeashReached", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_lssState", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_sideCollisionAvoid", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_sideCollisionWarning", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_sideCollisionInhibit", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_laneDepartureWarning", + .b1 = 37, + .b2 = 3, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_fleetSpeedState", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_autopilotHandsOnState", + .b1 = 42, + .b2 = 4, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_autoLaneChangeState", + .b1 = 46, + .b2 = 5, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_summonAvailable", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_statusCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_statusChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_925[] = { + { + .name = "IBST_pedalCalCurrentChecksum", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_pedalCalCurrentCounter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_pedalCalCurrentCurve", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_pedalCalTxEnabled", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_iBoosterStatus", + .b1 = 17, + .b2 = 3, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "IBST_brakeInputStroke", + .b1 = 20, + .b2 = 10, + .bo = 34, + .is_signed = false, + .factor = 0.05, + .offset = -0.5, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_937[] = { + { + .name = "DAS_telemetryMultiplexer", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telLeftLaneType", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telRightLaneType", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telLeftMarkerQuality", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telRightMarkerQuality", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telLeftMarkerColor", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telRightMarkerColor", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telLeftLaneCrossing", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telRightLaneCrossing", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_938[] = { + { + .name = "DAS_telemetryMultiplexerM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telLeftLaneType", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_MCPObserved", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignLongitudinalDist", + .b1 = 8, + .b2 = 10, + .bo = 46, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soCamCipvStatus", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_assPrevSetSpeed", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_accReengaged", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pedestrianInFOVBeforeIntr", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_csaOverride", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad5Status", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telRightLaneType", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pedestrianInFOVAfterIntr", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_csaIntState", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_camFreeSpaceBeforeIntr", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad1Status", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_camFreeSpaceAfterIntr", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telLeftMarkerQuality", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_timeOfIntervention", + .b1 = 14, + .b2 = 6, + .bo = 44, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_csaEnableSpeed", + .b1 = 14, + .b2 = 12, + .bo = 38, + .is_signed = false, + .factor = 0.05, + .offset = -25.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soCamCipvDx", + .b1 = 14, + .b2 = 6, + .bo = 44, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telRightMarkerQuality", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_assNewSetSpeed", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telLeftMarkerColor", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignLateralDist", + .b1 = 18, + .b2 = 8, + .bo = 38, + .is_signed = false, + .factor = 0.25, + .offset = -32.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telRightMarkerColor", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_timeOfFirstPedestrian", + .b1 = 20, + .b2 = 6, + .bo = 38, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad1Dx", + .b1 = 20, + .b2 = 6, + .bo = 38, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telLeftLaneCrossing", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telRightLaneCrossing", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_assFusedSpeedLimit", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_timeOfACCReengaging", + .b1 = 26, + .b2 = 6, + .bo = 32, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignHeight", + .b1 = 26, + .b2 = 6, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_csaDisableSpeed", + .b1 = 26, + .b2 = 12, + .bo = 26, + .is_signed = false, + .factor = 0.05, + .offset = -25.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad5Dx", + .b1 = 26, + .b2 = 6, + .bo = 32, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_assAutosteerActive", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_assSmartSpeedActive", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_durationOfPrevACCStandstill", + .b1 = 32, + .b2 = 6, + .bo = 26, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignStopLineDistance", + .b1 = 32, + .b2 = 10, + .bo = 22, + .is_signed = false, + .factor = 0.1, + .offset = -20.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soCamCipvDy", + .b1 = 32, + .b2 = 5, + .bo = 27, + .is_signed = false, + .factor = 0.4, + .offset = -6.4, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad5Dy", + .b1 = 37, + .b2 = 5, + .bo = 22, + .is_signed = false, + .factor = 0.4, + .offset = -6.4, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_maxAbsSteeringWheelAngle", + .b1 = 38, + .b2 = 7, + .bo = 19, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_csaFiltCurv", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = 1e-06, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignCIPVDistance", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soCamCipvVx", + .b1 = 42, + .b2 = 5, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_targetRelvelAtIntervention", + .b1 = 45, + .b2 = 6, + .bo = 13, + .is_signed = false, + .factor = 0.25, + .offset = -2.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad5ObstProb", + .b1 = 47, + .b2 = 4, + .bo = 13, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignHostAccel", + .b1 = 48, + .b2 = 10, + .bo = 6, + .is_signed = false, + .factor = 0.01, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_targetDistAtIntervention", + .b1 = 51, + .b2 = 6, + .bo = 7, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad5Dz", + .b1 = 51, + .b2 = 6, + .bo = 7, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_csaMeasLatAccel", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.08, + .offset = -10.24, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_egoSpeedAtIntervention", + .b1 = 57, + .b2 = 6, + .bo = 1, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad5powerdB", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignCrossingWarning", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignIndex", + .b1 = 59, + .b2 = 4, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_968[] = { + { + .name = "UI_mapSpeedLimitDependency", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadClass", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_inSuperchargerGeofence", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_mapSpeedUnits", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_mapSpeedLimit", + .b1 = 8, + .b2 = 5, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_mapSpeedLimitType", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_countryCode", + .b1 = 16, + .b2 = 10, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_streetCount", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_gpsRoadMatch", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_navRouteActive", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_parallelAutoparkEnabled", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_perpendicularAutoparkEnabled", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_nextBranchDist", + .b1 = 32, + .b2 = 5, + .bo = 27, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_controlledAccess", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_nextBranchLeftOffRamp", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_nextBranchRightOffRamp", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectLeftLane", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectRightLane", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectHPP", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectNav", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectLeftFreeSpace", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectRightFreeSpace", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectAutosteer", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectHandsOn", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_acceptBottsDots", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_autosteerRestricted", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_pmmEnabled", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_scaEnabled", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_mapDataCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_mapDataChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_984[] = { + { + .name = "MCU_latitude", + .b1 = 0, + .b2 = 28, + .bo = 36, + .is_signed = true, + .factor = 1e-06, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_longitude", + .b1 = 28, + .b2 = 29, + .bo = 7, + .is_signed = true, + .factor = 1e-06, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_gpsAccuracy", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 0.2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1000[] = { + { + .name = "UI_autopilotControlRequest", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_ulcStalkConfirm", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_summonHeartbeat", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_curvSpeedAdaptDisable", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_dasDeveloper", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableVinAssociation", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_lssLkaEnabled", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_lssLdwEnabled", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_autoSummonEnable", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_exceptionListEnable", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadCheckDisable", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_driveOnMapsEnable", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_handsOnRequirementDisable", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_forksEnable", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_fuseLanesDisable", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_fuseHPPDisable", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_fuseVehiclesDisable", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableNextGenACC", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_visionSpeedType", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_curvatureDatabaseOnly", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_lssElkEnabled", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_summonExitType", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_summonEntryType", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_selfParkRequest", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_summonReverseDist", + .b1 = 32, + .b2 = 6, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_undertakeAssistEnable", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_adaptiveSetSpeedEnable", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_drivingSide", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableClipTelemetry", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableTripTelemetry", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableRoadSegmentTelemetry", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_followNavRouteEnable", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_ulcSpeedConfig", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_ulcBlindSpotConfig", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_autopilotAlwaysOn", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_accFromZero", + .b1 = 53, + .b2 = 1, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcOffHighwayEnable", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_validationLoop", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_ulcOffHighway", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableNavRouteCSA", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableCutinExperiments", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_source3D", + .b1 = 60, + .b2 = 3, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableVisionOnlyStops", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1001[] = { + { + .name = "DAS_headlightRequest", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_hazardLightRequest", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_wiperSpeed", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_turnIndicatorRequest", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_highLowBeamDecision", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_highLowBeamOffReason", + .b1 = 12, + .b2 = 3, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_turnIndicatorRequestReason", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_bodyControlsCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_bodyControlsChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1006[] = { + { + .name = "UI_autopilotControlIndex", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_hovEnabled", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_camBlockLaneCheckDisable", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_donDisableAutoWiperDuration", + .b1 = 4, + .b2 = 3, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_camBlockLaneCheckThreshold", + .b1 = 4, + .b2 = 6, + .bo = 54, + .is_signed = false, + .factor = 0.01587, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_donDisableOnAutoWiperSpeed", + .b1 = 7, + .b2 = 4, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_camBlockBlurDisable", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_blindspotMinSpeed", + .b1 = 11, + .b2 = 4, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_camBlockBlurThreshold", + .b1 = 11, + .b2 = 6, + .bo = 47, + .is_signed = false, + .factor = 0.01587, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_blindspotDistance", + .b1 = 15, + .b2 = 3, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_blindspotTTC", + .b1 = 18, + .b2 = 3, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_donStopEndOfRampBuffer", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_donDisableCutin", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_donMinGoreWidthForAbortMap", + .b1 = 25, + .b2 = 4, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_donAlcProgGoreAbortThres", + .b1 = 29, + .b2 = 4, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_donMinGoreWidthForAbortNotMap", + .b1 = 33, + .b2 = 4, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcDisableUltrasonicCheck", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcUltrasonicDistance", + .b1 = 38, + .b2 = 4, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcUltrasonicWaitTime", + .b1 = 42, + .b2 = 3, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcEgoLeadingReactionAccel", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcMergIntervalRearDHyst", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcMergingIntervalHeadwayHyst", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcAssertivenessRate", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcViewRangeSensitivity", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1064[] = { + { + .name = "UI_TCR_enable", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_moveStateStanding", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_moveStateStopped", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_moveStateMoving", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_moveStateIndeterm", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_classConstElem", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_classMovingPed", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_classMovingTwoWheel", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_classMovingFourWheel", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_classUnknown", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_downSampleFactor", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_wExist", + .b1 = 24, + .b2 = 5, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_vehSpeed", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_minRCS", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.25, + .offset = -14.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_maxDy", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_maxObjects", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_maxRoadClass", + .b1 = 61, + .b2 = 3, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1080[] = { + { + .name = "UI_anonDebugParam1", + .b1 = 0, + .b2 = 7, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugFlag1", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugParam2", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugFlag2", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugParam3", + .b1 = 16, + .b2 = 7, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugFlag3", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugParam4", + .b1 = 24, + .b2 = 7, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugFlag4", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugParam5", + .b1 = 32, + .b2 = 7, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugParam6", + .b1 = 40, + .b2 = 7, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugParam7", + .b1 = 48, + .b2 = 7, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_visionSpeedSlider", + .b1 = 56, + .b2 = 7, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1160[] = { + { + .name = "DAS_steeringAngleRequest", + .b1 = 1, + .b2 = 15, + .bo = 48, + .is_signed = false, + .factor = 0.1, + .offset = -1638.35, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_steeringHapticRequest", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_steeringControlCounter", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_steeringControlType", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_steeringControlChecksum", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1361[] = { + { + .name = "CHECKSUM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.0507968128, + .offset = -22.85856576, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.1015936256, + .offset = -22.85856576, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IDX", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1362[] = { + { + .name = "CHECKSUM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.0507968128, + .offset = -22.85856576, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.1015936256, + .offset = -22.85856576, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IDX", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1363[] = { + { + .name = "Brake_Checksum", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BrakeMode", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BrakeRelativeCommand", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.0078125, + .offset = -252.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BrakePositionCommand", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 0.015625, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1364[] = { + { + .name = "Brake_Checksum", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Brake_Counter", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Status", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BrakeOK", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DriverBrakeApplied", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BrakeApplied", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BrakePedalPosition", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 0.015625, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "STW_ANGL_STAT", + .address = 0x3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_3), + .sigs = sigs_3, + }, + { + .name = "STW_ANGLHP_STAT", + .address = 0xE, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_14), + .sigs = sigs_14, + }, + { + .name = "STW_ACTN_RQ", + .address = 0x45, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_69), + .sigs = sigs_69, + }, + { + .name = "MCU_locationStatus2", + .address = 0x68, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_104), + .sigs = sigs_104, + }, + { + .name = "SBW_RQ_SCCM", + .address = 0x6D, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_109), + .sigs = sigs_109, + }, + { + .name = "GTW_epasControl", + .address = 0x101, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_257), + .sigs = sigs_257, + }, + { + .name = "DI_torque1", + .address = 0x108, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_264), + .sigs = sigs_264, + }, + { + .name = "DI_torque2", + .address = 0x118, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_280), + .sigs = sigs_280, + }, + { + .name = "ESP_135h", + .address = 0x135, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_309), + .sigs = sigs_309, + }, + { + .name = "ESP_B", + .address = 0x155, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_341), + .sigs = sigs_341, + }, + { + .name = "SDM1", + .address = 0x201, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "DAS_longControl", + .address = 0x209, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_521), + .sigs = sigs_521, + }, + { + .name = "BrakeMessage", + .address = 0x20A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_522), + .sigs = sigs_522, + }, + { + .name = "RCM_status", + .address = 0x211, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_529), + .sigs = sigs_529, + }, + { + .name = "EPB_epasControl", + .address = 0x214, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_532), + .sigs = sigs_532, + }, + { + .name = "MCU_chassisControl", + .address = 0x218, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_536), + .sigs = sigs_536, + }, + { + .name = "DAS_pscControl", + .address = 0x219, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_537), + .sigs = sigs_537, + }, + { + .name = "UI_driverAssistRoadSign", + .address = 0x238, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_568), + .sigs = sigs_568, + }, + { + .name = "DAS_lanes", + .address = 0x239, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_569), + .sigs = sigs_569, + }, + { + .name = "UI_solarData", + .address = 0x246, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_582), + .sigs = sigs_582, + }, + { + .name = "BODY_R1", + .address = 0x283, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_643), + .sigs = sigs_643, + }, + { + .name = "UI_radarMapData", + .address = 0x2B8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_696), + .sigs = sigs_696, + }, + { + .name = "DAS_control", + .address = 0x2B9, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_697), + .sigs = sigs_697, + }, + { + .name = "UI_roadCurvature", + .address = 0x2C8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_712), + .sigs = sigs_712, + }, + { + .name = "UI_csaOfframpCurvature", + .address = 0x2D8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_728), + .sigs = sigs_728, + }, + { + .name = "UI_csaRoadCurvature", + .address = 0x2E8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_744), + .sigs = sigs_744, + }, + { + .name = "UI_gpsVehicleSpeed", + .address = 0x2F8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_760), + .sigs = sigs_760, + }, + { + .name = "DAS_object", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "PARK_status2", + .address = 0x30E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_782), + .sigs = sigs_782, + }, + { + .name = "GTW_carState", + .address = 0x318, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_792), + .sigs = sigs_792, + }, + { + .name = "IBST_info", + .address = 0x32D, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_813), + .sigs = sigs_813, + }, + { + .name = "UI_status", + .address = 0x338, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_824), + .sigs = sigs_824, + }, + { + .name = "GTW_status", + .address = 0x348, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_840), + .sigs = sigs_840, + }, + { + .name = "IBST_dtcMatrix", + .address = 0x35D, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_861), + .sigs = sigs_861, + }, + { + .name = "DI_state", + .address = 0x368, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_872), + .sigs = sigs_872, + }, + { + .name = "EPAS_sysStatus", + .address = 0x370, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_880), + .sigs = sigs_880, + }, + { + .name = "MCU_clusterBacklightRequest", + .address = 0x388, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_904), + .sigs = sigs_904, + }, + { + .name = "DAS_status2", + .address = 0x389, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_905), + .sigs = sigs_905, + }, + { + .name = "GTW_carConfig", + .address = 0x398, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_920), + .sigs = sigs_920, + }, + { + .name = "DAS_status", + .address = 0x399, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_921), + .sigs = sigs_921, + }, + { + .name = "IBST_status", + .address = 0x39D, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_925), + .sigs = sigs_925, + }, + { + .name = "DAS_telemetry", + .address = 0x3A9, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_937), + .sigs = sigs_937, + }, + { + .name = "DAS_telemetryM", + .address = 0x3AA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_938), + .sigs = sigs_938, + }, + { + .name = "UI_driverAssistMapData", + .address = 0x3C8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_968), + .sigs = sigs_968, + }, + { + .name = "MCU_locationStatus", + .address = 0x3D8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_984), + .sigs = sigs_984, + }, + { + .name = "UI_driverAssistControl", + .address = 0x3E8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1000), + .sigs = sigs_1000, + }, + { + .name = "DAS_bodyControls", + .address = 0x3E9, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1001), + .sigs = sigs_1001, + }, + { + .name = "UI_autopilotControl", + .address = 0x3EE, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1006), + .sigs = sigs_1006, + }, + { + .name = "UI_telemetryControl", + .address = 0x428, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1064), + .sigs = sigs_1064, + }, + { + .name = "UI_driverAssistAnonDebugParams", + .address = 0x438, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1080), + .sigs = sigs_1080, + }, + { + .name = "DAS_steeringControl", + .address = 0x488, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_1160), + .sigs = sigs_1160, + }, + { + .name = "GAS_COMMAND", + .address = 0x551, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_1361), + .sigs = sigs_1361, + }, + { + .name = "GAS_SENSOR", + .address = 0x552, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_1362), + .sigs = sigs_1362, + }, + { + .name = "ECU_BrakeCommand", + .address = 0x553, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_1363), + .sigs = sigs_1363, + }, + { + .name = "ECU_BrakeStatus", + .address = 0x554, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_1364), + .sigs = sigs_1364, + }, +}; + +const Val vals[] = { + { + .name = "StW_Angl", + .address = 0x3, + .def_val = "16383 SNA", + .sigs = sigs_3, + }, + { + .name = "StW_AnglSens_Id", + .address = 0x3, + .def_val = "2 MUST 0 PSBL 1 SELF", + .sigs = sigs_3, + }, + { + .name = "StW_AnglSens_Stat", + .address = 0x3, + .def_val = "2 ERR 3 ERR_INI 1 INI 0 OK", + .sigs = sigs_3, + }, + { + .name = "StW_AnglSpd", + .address = 0x3, + .def_val = "16383 SNA", + .sigs = sigs_3, + }, + { + .name = "StW_AnglHP", + .address = 0xE, + .def_val = "16383 SNA", + .sigs = sigs_14, + }, + { + .name = "StW_AnglHP_Sens_Id", + .address = 0xE, + .def_val = "3 SNA 2 KOSTAL 1 DELPHI 0 TEST", + .sigs = sigs_14, + }, + { + .name = "StW_AnglHP_Sens_Stat", + .address = 0xE, + .def_val = "3 SNA 2 ERR 1 INI 0 OK", + .sigs = sigs_14, + }, + { + .name = "StW_AnglHP_Spd", + .address = 0xE, + .def_val = "16383 SNA", + .sigs = sigs_14, + }, + { + .name = "DTR_Dist_Rq", + .address = 0x45, + .def_val = "255 SNA 200 ACC_DIST_7 166 ACC_DIST_6 133 ACC_DIST_5 100 ACC_DIST_4 66 ACC_DIST_3 33 ACC_DIST_2 0 ACC_DIST_1", + .sigs = sigs_69, + }, + { + .name = "HiBmLvr_Stat", + .address = 0x45, + .def_val = "3 SNA 2 HIBM_FLSH_ON_PSD 1 HIBM_ON_PSD 0 IDLE", + .sigs = sigs_69, + }, + { + .name = "HrnSw_Psd", + .address = 0x45, + .def_val = "3 SNA 2 NDEF2 1 PSD 0 NPSD", + .sigs = sigs_69, + }, + { + .name = "SpdCtrlLvr_Stat", + .address = 0x45, + .def_val = "32 DN_1ST 16 UP_1ST 8 DN_2ND 4 UP_2ND 2 RWD 1 FWD 0 IDLE", + .sigs = sigs_69, + }, + { + .name = "StW_Cond_Psd", + .address = 0x45, + .def_val = "3 SNA 2 DOWN 1 UP 0 NPSD", + .sigs = sigs_69, + }, + { + .name = "StW_Lvr_Stat", + .address = 0x45, + .def_val = "4 STW_BACK 3 STW_FWD 2 STW_DOWN 1 STW_UP 0 NPSD", + .sigs = sigs_69, + }, + { + .name = "StW_Sw00_Psd", + .address = 0x45, + .def_val = "1 PRESSED 0 NOT_PRESSED_SNA", + .sigs = sigs_69, + }, + { + .name = "StW_Sw01_Psd", + .address = 0x45, + .def_val = "1 PRESSED 0 NOT_PRESSED_SNA", + .sigs = sigs_69, + }, + { + .name = "StW_Sw03_Psd", + .address = 0x45, + .def_val = "1 PRESSED 0 NOT_PRESSED_SNA", + .sigs = sigs_69, + }, + { + .name = "StW_Sw04_Psd", + .address = 0x45, + .def_val = "1 PRESSED 0 NOT_PRESSED_SNA", + .sigs = sigs_69, + }, + { + .name = "TurnIndLvr_Stat", + .address = 0x45, + .def_val = "3 SNA 2 RIGHT 1 LEFT 0 IDLE", + .sigs = sigs_69, + }, + { + .name = "WprSw6Posn", + .address = 0x45, + .def_val = "7 SNA 6 STAGE2 5 STAGE1 4 INTERVAL4 3 INTERVAL3 2 INTERVAL2 1 INTERVAL1 0 OFF", + .sigs = sigs_69, + }, + { + .name = "WprWashSw_Psd", + .address = 0x45, + .def_val = "3 SNA 2 WASH 1 TIPWIPE 0 NPSD", + .sigs = sigs_69, + }, + { + .name = "WprWash_R_Sw_Posn_V2", + .address = 0x45, + .def_val = "3 SNA 2 WASH 1 INTERVAL 0 OFF", + .sigs = sigs_69, + }, + { + .name = "MsgTxmtId", + .address = 0x6D, + .def_val = "3 NDEF3 2 NDEF2 1 SCCM 0 EWM", + .sigs = sigs_109, + }, + { + .name = "StW_Sw_Stat3", + .address = 0x6D, + .def_val = "7 SNA 6 NDEF6 5 NDEF5 4 NDEF4 3 PLUS_MINUS 2 MINUS 1 PLUS 0 NPSD", + .sigs = sigs_109, + }, + { + .name = "TSL_P_Psd_StW", + .address = 0x6D, + .def_val = "3 SNA 2 INI 1 PSD 0 IDLE", + .sigs = sigs_109, + }, + { + .name = "TSL_RND_Posn_StW", + .address = 0x6D, + .def_val = "15 SNA 8 D 6 INI 4 N_DOWN 2 N_UP 1 R 0 IDLE", + .sigs = sigs_109, + }, + { + .name = "GTW_epasControlType", + .address = 0x101, + .def_val = "0 WITHOUT 1 WITH_ANGLE 3 WITH_BOTH 2 WITH_TORQUE", + .sigs = sigs_257, + }, + { + .name = "GTW_epasEmergencyOn", + .address = 0x101, + .def_val = "1 EMERGENCY_POWER 0 NONE", + .sigs = sigs_257, + }, + { + .name = "GTW_epasLDWEnabled", + .address = 0x101, + .def_val = "1 ALLOWED 0 INHIBITED", + .sigs = sigs_257, + }, + { + .name = "GTW_epasPowerMode", + .address = 0x101, + .def_val = "0 DRIVE_OFF 1 DRIVE_ON 3 LOAD_SHED 2 SHUTTING_DOWN 15 SNA", + .sigs = sigs_257, + }, + { + .name = "GTW_epasTuneRequest", + .address = 0x101, + .def_val = "1 DM_COMFORT 3 DM_SPORT 2 DM_STANDARD 0 FAIL_SAFE_DEFAULT 4 RWD_COMFORT 6 RWD_SPORT 5 RWD_STANDARD 7 SNA", + .sigs = sigs_257, + }, + { + .name = "DI_motorRPM", + .address = 0x108, + .def_val = "-32768 SNA", + .sigs = sigs_264, + }, + { + .name = "DI_pedalPos", + .address = 0x108, + .def_val = "255 SNA", + .sigs = sigs_264, + }, + { + .name = "DI_soptState", + .address = 0x108, + .def_val = "7 SOPT_TEST_SNA 4 SOPT_TEST_NOT_RUN 3 SOPT_TEST_PASSED 2 SOPT_TEST_FAILED 1 SOPT_TEST_IN_PROGRESS 0 SOPT_PRE_TEST", + .sigs = sigs_264, + }, + { + .name = "DI_torqueDriver", + .address = 0x108, + .def_val = "-4096 SNA", + .sigs = sigs_264, + }, + { + .name = "DI_torqueMotor", + .address = 0x108, + .def_val = "-4096 SNA", + .sigs = sigs_264, + }, + { + .name = "DI_brakePedal", + .address = 0x118, + .def_val = "1 APPLIED 0 NOT_APPLIED", + .sigs = sigs_280, + }, + { + .name = "DI_brakePedalState", + .address = 0x118, + .def_val = "3 SNA 2 INVALID 1 ON 0 OFF", + .sigs = sigs_280, + }, + { + .name = "DI_epbInterfaceReady", + .address = 0x118, + .def_val = "1 EPB_INTERFACE_READY 0 EPB_INTERFACE_NOT_READY", + .sigs = sigs_280, + }, + { + .name = "DI_epbParkRequest", + .address = 0x118, + .def_val = "1 PARK_REQUESTED 0 NO_REQUEST", + .sigs = sigs_280, + }, + { + .name = "DI_gear", + .address = 0x118, + .def_val = "7 DI_GEAR_SNA 4 DI_GEAR_D 3 DI_GEAR_N 2 DI_GEAR_R 1 DI_GEAR_P 0 DI_GEAR_INVALID", + .sigs = sigs_280, + }, + { + .name = "DI_gearRequest", + .address = 0x118, + .def_val = "7 DI_GEAR_SNA 4 DI_GEAR_D 3 DI_GEAR_N 2 DI_GEAR_R 1 DI_GEAR_P 0 DI_GEAR_INVALID", + .sigs = sigs_280, + }, + { + .name = "DI_torqueEstimate", + .address = 0x118, + .def_val = "-2048 SNA", + .sigs = sigs_280, + }, + { + .name = "DI_torqueInterfaceFailure", + .address = 0x118, + .def_val = "1 TORQUE_INTERFACE_FAILED 0 TORQUE_INTERFACE_NORMAL", + .sigs = sigs_280, + }, + { + .name = "DI_vehicleSpeed", + .address = 0x118, + .def_val = "4095 SNA", + .sigs = sigs_280, + }, + { + .name = "ESP_absBrakeEvent", + .address = 0x135, + .def_val = "1 ACTIVE 0 NOT_ACTIVE", + .sigs = sigs_309, + }, + { + .name = "ESP_absFaultLamp", + .address = 0x135, + .def_val = "0 OFF 1 ON", + .sigs = sigs_309, + }, + { + .name = "ESP_brakeDiscWipingActive", + .address = 0x135, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_309, + }, + { + .name = "ESP_brakeLamp", + .address = 0x135, + .def_val = "0 OFF 1 ON", + .sigs = sigs_309, + }, + { + .name = "ESP_espFaultLamp", + .address = 0x135, + .def_val = "0 OFF 1 ON", + .sigs = sigs_309, + }, + { + .name = "ESP_espLampFlash", + .address = 0x135, + .def_val = "1 FLASH 0 OFF", + .sigs = sigs_309, + }, + { + .name = "ESP_espOffLamp", + .address = 0x135, + .def_val = "0 OFF 1 ON", + .sigs = sigs_309, + }, + { + .name = "ESP_hillStartAssistActive", + .address = 0x135, + .def_val = "1 ACTIVE 0 INACTIVE 2 NOT_AVAILABLE 3 SNA", + .sigs = sigs_309, + }, + { + .name = "ESP_stabilityControlSts", + .address = 0x135, + .def_val = "2 ENGAGED 3 FAULTED 5 INIT 4 NOT_CONFIGURED 0 OFF 1 ON", + .sigs = sigs_309, + }, + { + .name = "ESP_tcLampFlash", + .address = 0x135, + .def_val = "1 FLASH 0 OFF", + .sigs = sigs_309, + }, + { + .name = "DAS_locAccelMax", + .address = 0x209, + .def_val = "511 SNA", + .sigs = sigs_521, + }, + { + .name = "DAS_locAccelMin", + .address = 0x209, + .def_val = "511 SNA", + .sigs = sigs_521, + }, + { + .name = "DAS_locJerkMax", + .address = 0x209, + .def_val = "255 SNA", + .sigs = sigs_521, + }, + { + .name = "DAS_locJerkMin", + .address = 0x209, + .def_val = "255 SNA", + .sigs = sigs_521, + }, + { + .name = "DAS_locMode", + .address = 0x209, + .def_val = "3 DAS_LOC_DRIVERLESS 2 DAS_LOC_RESTRICTED 1 DAS_LOC_NORMAL 0 DAS_LOC_OFF", + .sigs = sigs_521, + }, + { + .name = "DAS_locRequest", + .address = 0x209, + .def_val = "4 DAS_RQ_PARK 3 DAS_RQ_HOLD 2 DAS_RQ_BACKWARD 1 DAS_RQ_FORWARD 0 DAS_RQ_IDLE", + .sigs = sigs_521, + }, + { + .name = "DAS_locSpeed", + .address = 0x209, + .def_val = "2047 SNA", + .sigs = sigs_521, + }, + { + .name = "DAS_locState", + .address = 0x209, + .def_val = "7 DAS_LOC_FAULT_SNA 6 DAS_LOC_AEB_ACTIVE 2 DAS_LOC_CANCEL_SILENT 1 DAS_LOC_CANCEL_GENERIC 0 DAS_LOC_HEALTHY", + .sigs = sigs_521, + }, + { + .name = "driverBrakeStatus", + .address = 0x20A, + .def_val = "2 APPLIED 1 NOT_APPLIED", + .sigs = sigs_522, + }, + { + .name = "DAS_eacState", + .address = 0x219, + .def_val = "4 SNA 3 EAC_FAULT 2 EAC_ACTIVE 1 EAC_AVAILABLE 0 EAC_INHIBITED", + .sigs = sigs_537, + }, + { + .name = "DAS_pscParkState", + .address = 0x219, + .def_val = "15 SNA 14 SUMMON 10 PAUSE 9 SEARCH 8 COMPLETE 7 ABORT 6 PARALLEL_PULL_OUT_TO_RIGHT 5 PARALLEL_PULL_OUT_TO_LEFT 4 PARK_RIGHT_CROSS 3 PARK_RIGHT_PARALLEL 2 PARK_LEFT_CROSS 1 PARK_LEFT_PARALLEL 0 NONE", + .sigs = sigs_537, + }, + { + .name = "UI_mapSpeedLimit", + .address = 0x238, + .def_val = "31 SNA 30 UNLIMITED 29 LESS_OR_EQ_160 28 LESS_OR_EQ_150 27 LESS_OR_EQ_140 26 LESS_OR_EQ_130 25 LESS_OR_EQ_120 24 LESS_OR_EQ_115 23 LESS_OR_EQ_110 22 LESS_OR_EQ_105 21 LESS_OR_EQ_100 20 LESS_OR_EQ_95 19 LESS_OR_EQ_90 18 LESS_OR_EQ_85 17 LESS_OR_EQ_80 16 LESS_OR_EQ_75 15 LESS_OR_EQ_70 14 LESS_OR_EQ_65 13 LESS_OR_EQ_60 12 LESS_OR_EQ_55 11 LESS_OR_EQ_50 10 LESS_OR_EQ_45 9 LESS_OR_EQ_40 8 LESS_OR_EQ_35 7 LESS_OR_EQ_30 6 LESS_OR_EQ_25 5 LESS_OR_EQ_20 4 LESS_OR_EQ_15 3 LESS_OR_EQ_10 2 LESS_OR_EQ_7 1 LESS_OR_EQ_5 0 UNKNOWN", + .sigs = sigs_568, + }, + { + .name = "DAS_leftFork", + .address = 0x239, + .def_val = "3 LEFT_FORK_UNAVAILABLE 2 LEFT_FORK_SELECTED 1 LEFT_FORK_AVAILABLE 0 LEFT_FORK_NONE", + .sigs = sigs_569, + }, + { + .name = "DAS_leftLineUsage", + .address = 0x239, + .def_val = "3 BLACKLISTED 2 FUSED 1 AVAILABLE 0 REJECTED_UNAVAILABLE", + .sigs = sigs_569, + }, + { + .name = "DAS_rightFork", + .address = 0x239, + .def_val = "3 RIGHT_FORK_UNAVAILABLE 2 RIGHT_FORK_SELECTED 1 RIGHT_FORK_AVAILABLE 0 RIGHT_FORK_NONE", + .sigs = sigs_569, + }, + { + .name = "DAS_rightLineUsage", + .address = 0x239, + .def_val = "3 BLACKLISTED 2 FUSED 1 AVAILABLE 0 REJECTED_UNAVAILABLE", + .sigs = sigs_569, + }, + { + .name = "AirTemp_Insd", + .address = 0x283, + .def_val = "255 SNA", + .sigs = sigs_643, + }, + { + .name = "AirTemp_Outsd", + .address = 0x283, + .def_val = "254 INIT 255 SNA", + .sigs = sigs_643, + }, + { + .name = "Bckl_Sw_RL_Stat_SAM_R", + .address = 0x283, + .def_val = "2 FLT 1 NOT 0 OK 3 SNA", + .sigs = sigs_643, + }, + { + .name = "Bckl_Sw_RM_Stat_SAM_R", + .address = 0x283, + .def_val = "2 FLT 1 NOT 0 OK 3 SNA", + .sigs = sigs_643, + }, + { + .name = "Bckl_Sw_RR_Stat_SAM_R", + .address = 0x283, + .def_val = "2 FLT 1 NOT 0 OK 3 SNA", + .sigs = sigs_643, + }, + { + .name = "DL_RLtch_Stat", + .address = 0x283, + .def_val = "1 CLS 0 NDEF0 2 OPN 3 SNA", + .sigs = sigs_643, + }, + { + .name = "DrRLtch_FL_Stat", + .address = 0x283, + .def_val = "1 CLS 0 NDEF0 2 OPN 3 SNA", + .sigs = sigs_643, + }, + { + .name = "DrRLtch_FR_Stat", + .address = 0x283, + .def_val = "1 CLS 0 NDEF0 2 OPN 3 SNA", + .sigs = sigs_643, + }, + { + .name = "DrRLtch_RL_Stat", + .address = 0x283, + .def_val = "1 CLS 0 NDEF0 2 OPN 3 SNA", + .sigs = sigs_643, + }, + { + .name = "DrRLtch_RR_Stat", + .address = 0x283, + .def_val = "1 CLS 0 NDEF0 2 OPN 3 SNA", + .sigs = sigs_643, + }, + { + .name = "EngHd_Stat", + .address = 0x283, + .def_val = "1 CLS 0 NDEF0 2 OPN 3 SNA", + .sigs = sigs_643, + }, + { + .name = "LgtSens_Night", + .address = 0x283, + .def_val = "0 DAY 1 NIGHT", + .sigs = sigs_643, + }, + { + .name = "MPkBrk_Stat", + .address = 0x283, + .def_val = "1 ENGG 0 RELS", + .sigs = sigs_643, + }, + { + .name = "RevGr_Engg", + .address = 0x283, + .def_val = "0 DISENGG 1 ENGG 2 NDEF2 3 SNA", + .sigs = sigs_643, + }, + { + .name = "StW_Cond_Stat", + .address = 0x283, + .def_val = "3 BLINK 1 NDEF1 0 OFF 2 ON", + .sigs = sigs_643, + }, + { + .name = "Trlr_Stat", + .address = 0x283, + .def_val = "2 NDEF2 0 NONE 1 OK 3 SNA", + .sigs = sigs_643, + }, + { + .name = "DAS_accState", + .address = 0x2B9, + .def_val = "15 FAULT_SNA 14 ACC_CANCEL_OUT_OF_CALIBRATION 13 ACC_CANCEL_GENERIC_SILENT 12 ACC_CANCEL_PATH_NOT_CLEAR 11 APC_SELFPARK_START 10 APC_UNPARK_COMPLETE 9 APC_PAUSE 8 APC_ABORT 7 APC_COMPLETE 6 APC_FORWARD 5 APC_BACKWARD 4 ACC_ON 3 ACC_HOLD 2 ACC_CANCEL_RADAR_BLIND 1 ACC_CANCEL_CAMERA_BLIND 0 ACC_CANCEL_GENERIC", + .sigs = sigs_697, + }, + { + .name = "DAS_accelMax", + .address = 0x2B9, + .def_val = "511 SNA", + .sigs = sigs_697, + }, + { + .name = "DAS_accelMin", + .address = 0x2B9, + .def_val = "511 SNA", + .sigs = sigs_697, + }, + { + .name = "DAS_aebEvent", + .address = 0x2B9, + .def_val = "3 AEB_SNA 2 AEB_FAULT 1 AEB_ACTIVE 0 AEB_NOT_ACTIVE", + .sigs = sigs_697, + }, + { + .name = "DAS_jerkMax", + .address = 0x2B9, + .def_val = "255 SNA", + .sigs = sigs_697, + }, + { + .name = "DAS_jerkMin", + .address = 0x2B9, + .def_val = "511 SNA", + .sigs = sigs_697, + }, + { + .name = "DAS_setSpeed", + .address = 0x2B9, + .def_val = "4095 SNA", + .sigs = sigs_697, + }, + { + .name = "UI_mapSpeedLimitUnits", + .address = 0x2F8, + .def_val = "1 KPH 0 MPH", + .sigs = sigs_760, + }, + { + .name = "UI_userSpeedOffsetUnits", + .address = 0x2F8, + .def_val = "1 KPH 0 MPH", + .sigs = sigs_760, + }, + { + .name = "PARK_autoCalComplete", + .address = 0x30E, + .def_val = "1 COMPLETE 0 INCOMPLETE", + .sigs = sigs_782, + }, + { + .name = "PARK_geometryType", + .address = 0x30E, + .def_val = "2 MODELX 1 MODELS_2 0 MODELS", + .sigs = sigs_782, + }, + { + .name = "PARK_pscLeftCurbType", + .address = 0x30E, + .def_val = "2 HIGH_CURB 1 LOW_CURB 0 VIRTUAL_CURB", + .sigs = sigs_782, + }, + { + .name = "PARK_pscRightCurbType", + .address = 0x30E, + .def_val = "2 HIGH_CURB 1 LOW_CURB 0 VIRTUAL_CURB", + .sigs = sigs_782, + }, + { + .name = "PARK_rackDetected", + .address = 0x30E, + .def_val = "3 SNA 2 RACK_DETECTED 1 NO_RACK 0 UNKNOWN", + .sigs = sigs_782, + }, + { + .name = "PARK_sdiActive", + .address = 0x30E, + .def_val = "1 SDI_ENABLED 0 SDI_DISABLED", + .sigs = sigs_782, + }, + { + .name = "PARK_sdiBlindSpotLeft", + .address = 0x30E, + .def_val = "3 SNA 2 UNUSED 1 WARNING 0 NO_WARNING", + .sigs = sigs_782, + }, + { + .name = "PARK_sdiBlindSpotRight", + .address = 0x30E, + .def_val = "3 SNA 2 UNUSED 1 WARNING 0 NO_WARNING", + .sigs = sigs_782, + }, + { + .name = "PARK_sdiNoise", + .address = 0x30E, + .def_val = "3 SDI_NOISE_SNA 2 SDI_NOISE_RAIN 1 SDI_NOISE_HIGH 0 SDI_NOISE_NOMINAL", + .sigs = sigs_782, + }, + { + .name = "PARK_tireFitment", + .address = 0x30E, + .def_val = "3 SNA 1 STAGGERED 0 SQUARE", + .sigs = sigs_782, + }, + { + .name = "BOOT_STATE", + .address = 0x318, + .def_val = "2 INIT 3 SNA 0 CLOSED 1 OPEN", + .sigs = sigs_792, + }, + { + .name = "CERRD", + .address = 0x318, + .def_val = "1 CAN_ERROR_DETECT 0 NO_CAN_ERROR_DETECTED", + .sigs = sigs_792, + }, + { + .name = "DAY", + .address = 0x318, + .def_val = "1 INIT 0 SNA", + .sigs = sigs_792, + }, + { + .name = "DOOR_STATE_FL", + .address = 0x318, + .def_val = "2 INIT 3 SNA 0 CLOSED 1 OPEN", + .sigs = sigs_792, + }, + { + .name = "DOOR_STATE_FR", + .address = 0x318, + .def_val = "2 INIT 3 SNA 0 CLOSED 1 OPEN", + .sigs = sigs_792, + }, + { + .name = "DOOR_STATE_FrontTrunk", + .address = 0x318, + .def_val = "2 INIT 3 SNA 0 CLOSED 1 OPEN", + .sigs = sigs_792, + }, + { + .name = "DOOR_STATE_RL", + .address = 0x318, + .def_val = "2 INIT 3 SNA 0 CLOSED 1 OPEN", + .sigs = sigs_792, + }, + { + .name = "DOOR_STATE_RR", + .address = 0x318, + .def_val = "2 INIT 3 SNA 0 CLOSED 1 OPEN", + .sigs = sigs_792, + }, + { + .name = "GTW_updateInProgress", + .address = 0x318, + .def_val = "1 IN_PROGRESS 2 IN_PROGRESS_NOT_USED 3 IN_PROGRESS_SNA 0 NOT_IN_PROGRESS", + .sigs = sigs_792, + }, + { + .name = "Hour", + .address = 0x318, + .def_val = "30 INIT 31 SNA", + .sigs = sigs_792, + }, + { + .name = "MCU_factoryMode", + .address = 0x318, + .def_val = "1 FACTORY_MODE 0 NORMAL_MODE", + .sigs = sigs_792, + }, + { + .name = "MCU_transportModeOn", + .address = 0x318, + .def_val = "0 NORMAL_MODE", + .sigs = sigs_792, + }, + { + .name = "MINUTE", + .address = 0x318, + .def_val = "62 INIT 63 SNA", + .sigs = sigs_792, + }, + { + .name = "MONTH", + .address = 0x318, + .def_val = "1 INIT 15 SNA", + .sigs = sigs_792, + }, + { + .name = "SECOND", + .address = 0x318, + .def_val = "62 INIT 63 SNA", + .sigs = sigs_792, + }, + { + .name = "YEAR", + .address = 0x318, + .def_val = "126 INIT 127 SNA", + .sigs = sigs_792, + }, + { + .name = "IBST_infoIndex", + .address = 0x32D, + .def_val = "0 DEPRECATED_0 1 DEPRECATED_1 2 DEPRECATED_2 3 DEPRECATED_3 4 DEPRECATED_4 5 DEPRECATED_5 6 DEPRECATED_6 7 DEPRECATED_7 8 DEPRECATED_8 9 DEPRECATED_9 10 BUILD_HWID_COMPONENTID 11 PCBAID_ASSYID_USAGEID 13 APP_CRC 14 BOOTLOADER_SVN 15 BOOTLOADER_CRC 16 SUBCOMPONENT 17 APP_GITHASH 18 BOOTLOADER_GITHASH 19 VERSION_DEPRECATED 20 UDS_PROTOCOL_BOOTCRC 22 VARIANT_CRC 255 END", + .sigs = sigs_813, + }, + { + .name = "IBST_d000_bmsInitTestFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d001_bmcSingleTransTest", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d002_tle5012SsccrcFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d003_tle5012Config", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d004_deadlMonTaskx1Ovr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d005_ecuWdFltCntTstFls", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d006_ecuWdScheduleTout", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d007_ecuWdStarttestFls", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d008_ecuWdStatusContErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d009_netOvrvolt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d010_micSpiTout", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d011_micSpiTransferErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d012_netUndvolt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d013_xpassToutErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d014_rpsOffsEeReadEmpty", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d015_rtpEnaHigh", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d016_xpassEchoCountErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d017_preDriveChckFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d018_ucSafetyFlt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d019_unsupportedHw", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d020_voltPreRegModeFld", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d021_ubbSupplyLine", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d022_stmAswSysTout", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d023_stackOvrUndFlow", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d024_smmOneReqsInit", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d025_ptsSupply", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d026_ptsSupplyUndvolt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d027_tempB6Plaus", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d028_ecuWdErrCntContErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d029_bmcShortedGateTest", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d030_controllerDevTooBig", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d031_ibDtrFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d032_oc6InitTestFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d033_oc6Monitor", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d034_motorOscillationDet", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d035_rpsOffsEeReadFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d036_sysErrHook", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d037_calIdlePosNotPlaus", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d038_boostSupUndrvolt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d039_calRoutineAbort", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d040_bmcGateUndervoltPro", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d041_hswInitPhseUndrvolt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d042_ltmWarnLevelReached", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d043_rpsVctrLengthRelErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d044_b6TempDegradeLevel1", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d045_B6TempDegradeLevel2", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d046_spiAnglOrRawNotUp", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d047_dcomIboosterNotInit", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d048_unintendMotorReturn", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d049_cdmOvrvoltLevel1", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d050_cdmUndrvoltLevel2", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d051_cdmUndrvoltLevel1", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d052_motTrvlRelReadFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d053_tle5012UnexpReset", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d054_bmsGateUndrvolt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d055_kl15HwPlausSw", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d056_ibNotShutDownRight", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d057_cdmHardUndrvolt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d058_cdmHardOvrvolt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d059_maxTrvlAdjstUpdFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d060_ltmLimitReached", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d061_dcomEcuDefect", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d062_inputStroke1RngHigh", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d063_inputStroke1RngLow", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d064_inputStroke2RngHigh", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d065_inputStroke2RngLow", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d066_ibSupVoltDivDrift", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d067_sOutRodToPressVal", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d068_tle5012LifeCnt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d069_cdmExtendedUndrvolt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d070_cdmExtendedOvrvolt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d071_tempB6Ch1LineHigh", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d072_tempB6Ch1LineLow", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d073_tempB6Ch2LineHigh", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d074_tempB6Ch2LineLow", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d075_hevSwitchOffDcom", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d076_tle5012VoltFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d077_bcsFltCurrentHigh", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d078_bcsFltCurrentLow", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d079_ecuSupVoltDivDrift", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d080_inputstroke1Grad", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d081_pts1Err", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d082_pts1LineGnd", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d083_pts1LineHigh", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d084_inputStroke2Grad", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d085_pts2Err", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d086_pts2LineGnd", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d087_pts2LineHigh", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d088_faildevInputStroke", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d089_ptsOffsTooHigh", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d090_pbistErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d091_ramInitErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d092_ramsinlgeFlt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d093_bertFlt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d094_CalDataNotPlaus", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d095_canEHwError", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d096_canETout", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d097_cpuException", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d098_ecuBandGap", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d099_ecuBmsOnWhileWdTout", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d100_ecuErrpinCntTstFls", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d101_ecuHetException", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d102_ecuHetTuAddErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d103_ecuHetTuBusErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d104_ecuHetTuBusyErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d105_ecuHetTuException", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d106_ecuTaskMissing", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d107_hetRefError", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d108_micInitSpiTstFld", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d109_micInitSpiTransfErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d110_micIntMonGenBitMon", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d111_micIntVoltMonFld", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d112_motPosTrvlReadEmpty", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d113_motAngBoundReadEmpt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d114_motShaftShiftDetect", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d115_osErrHook", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d116_pdurEInitFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d117_pdurEPduInstLost", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d118_pts1OffsEeReadEmpty", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d119_pts2OffsEeReadEmpty", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d120_rpsOffsXEeReadFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d121_rpsOffsYEeReadFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d122_rpsSynchEeReadFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d123_rpsAnglRecalcErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d124_motTrvlRelWriteFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d125_motTrvlRelReadEmpty", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d126_ptsEeReadEmpty", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d127_ecuAdcConversionErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d128_ecuAdcSelftestErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d129_ccmFlt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d130_ecuRomCheck", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d131_esmNmiFlt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d132_esmSafetyFlt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d133_motPosTrvlReadFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d134_motPosTrvlWriteFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d135_motAnglBndReadErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d136_motAnglBndWriteErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d137_motAnglGradTooLarge", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d138_pdmCustomerIdMis", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d139_pdmDtFormatMis", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d140_pdmOutOfMemory", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d141_pdmFieldSizeMis", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d142_pdmHwAcsErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d143_pdmInternalHWErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d144_ptsCalHysWritFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d145_ptsCalValuesChkFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d146_pts1CalEeReadFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d147_pts1CalEeWriteFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d148_rpsFailCompErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d149_pts1OffsEeWriteFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d150_pts2CalEeReadFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d151_pts2CalEeWriteFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d152_pts2OffsEeReadFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d153_pts2OffsEeWriteFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d154_rpsOffsXEeReadEmpty", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d155_rpsOffsXEeWriteFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d156_rpsOffsYEeReadEmpty", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d157_rpsOffsYEeWriteFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d158_rpsSynchEeReadEmpty", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d159_rpsSynchEeWriteFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d160_assertionFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d161_comsclBrkPrsPduLen", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d162_comsclBrkPrsPduTout", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d163_comsclEspIb1CntErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d164_comsclEspIb1CsErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d165_comsclEspIb1DlcErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d166_comsclEspIb1Tout", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d167_comsclEspIb2CntErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d168_comsclEspIb2CsErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d169_comsclEspIb2DlcErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d170_comsclEspIb2Tout", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d171_comsclEspIb3CntErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d172_comsclEspIb3CsErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d173_comsclEspIb3DlcErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d174_comsclEspIb3Tout", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d175_comsclGtwEsp1CntErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d176_comsclGtwEsp1CsErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d177_comsclGtwEsp1Corrpt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d178_comsclGtwEsp1Tout", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d179_dcomSmrtActuNotInit", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d180_rpsLengthAbsolHigh", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d181_rpsLengthAbsolLow", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d182_shutDownEeReadFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d183_shutDownEeWriteFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d184_maxTrvlAdjstReadErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d185_psOffsMcEeReadFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d186_psOffsMcEeWriteFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d187_ltmSelfProtDeact", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d188_pts1OffsEeReadFail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d189_diffStrokeRange", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d190_notProgVin", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d191_plausVin", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d192_dlCorCSumVin", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d193_ToutVin", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d194_ecuEnableB6Fail", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d195_ecuIbEnContErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d196_sclEspIb1pEstMax", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d197_sclEspIb1VehSpd", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d198_sclEspIb2pLimExt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d199_sclEspIb2qTarExt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d200_sclEspIb3pFBlend", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d201_sclEspIb3pMc1", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d202_sclEspIb3pTarDriver", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d203_netBusOffNet0", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d204_netErrPassivNet0", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d205_netBusOffNet1", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d206_netErrPassivNet1", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d207_maxStrokeReached", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d208_sysSwClockMismatch", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d209_comsclGtwOdoCorrpt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d210_comsclGtwStatCorrpt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d211_comsclEpbStatCorrpt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d212_comsclGtwOdoTout", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d213_comsclGtwStatTout", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d214_comsclEpbStatTout", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d215_comSclEpbStatCsErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d216_comSclEpbStatCntFlt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d217_comSclDiTrq1Tout", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d218_comSclDiTrq1Corrpt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d219_comSclDiTrq1CsErr", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "IBST_d220_comSclDiTrq1CntFlt", + .address = 0x35D, + .def_val = "0 NOT_TESTED_DTC 1 PASSED_DTC 2 FAILED_DTC 3 UNABLE_TO_TEST_DTC", + .sigs = sigs_861, + }, + { + .name = "DI_aebState", + .address = 0x368, + .def_val = "2 ENABLED 4 FAULT 7 SNA 1 STANDBY 3 STANDSTILL 0 UNAVAILABLE", + .sigs = sigs_872, + }, + { + .name = "DI_analogSpeed", + .address = 0x368, + .def_val = "4095 SNA", + .sigs = sigs_872, + }, + { + .name = "DI_cruiseState", + .address = 0x368, + .def_val = "2 ENABLED 5 FAULT 0 OFF 4 OVERRIDE 7 PRE_CANCEL 6 PRE_FAULT 1 STANDBY 3 STANDSTILL", + .sigs = sigs_872, + }, + { + .name = "DI_digitalSpeed", + .address = 0x368, + .def_val = "255 SNA", + .sigs = sigs_872, + }, + { + .name = "DI_immobilizerState", + .address = 0x368, + .def_val = "2 AUTHENTICATING 3 DISARMED 6 FAULT 4 IDLE 0 INIT_SNA 1 REQUEST 5 RESET", + .sigs = sigs_872, + }, + { + .name = "DI_speedUnits", + .address = 0x368, + .def_val = "1 KPH 0 MPH", + .sigs = sigs_872, + }, + { + .name = "DI_state", + .address = 0x368, + .def_val = "3 ABORT 4 ENABLE 2 FAULT 1 STANDBY 0 UNAVAILABLE", + .sigs = sigs_872, + }, + { + .name = "DI_systemState", + .address = 0x368, + .def_val = "3 ABORT 4 ENABLE 2 FAULT 1 STANDBY 0 UNAVAILABLE", + .sigs = sigs_872, + }, + { + .name = "DI_vehicleHoldState", + .address = 0x368, + .def_val = "2 BLEND_IN 4 BLEND_OUT 6 FAULT 7 INIT 5 XXX 1 STANDBY 3 STANDSTILL 0 UNAVAILABLE", + .sigs = sigs_872, + }, + { + .name = "EPAS_currentTuneMode", + .address = 0x370, + .def_val = "1 DM_COMFORT 3 DM_SPORT 2 DM_STANDARD 0 FAIL_SAFE_DEFAULT 4 RWD_COMFORT 6 RWD_SPORT 5 RWD_STANDARD 7 UNAVAILABLE", + .sigs = sigs_880, + }, + { + .name = "EPAS_eacErrorCode", + .address = 0x370, + .def_val = "14 EAC_ERROR_EPB_INHIBIT 3 EAC_ERROR_HANDS_ON 7 EAC_ERROR_HIGH_ANGLE_RATE_REQ 9 EAC_ERROR_HIGH_ANGLE_RATE_SAFETY 6 EAC_ERROR_HIGH_ANGLE_REQ 8 EAC_ERROR_HIGH_ANGLE_SAFETY 10 EAC_ERROR_HIGH_MMOT_SAFETY 11 EAC_ERROR_HIGH_TORSION_SAFETY 0 EAC_ERROR_IDLE 12 EAC_ERROR_LOW_ASSIST 2 EAC_ERROR_MAX_SPEED 1 EAC_ERROR_MIN_SPEED 13 EAC_ERROR_PINION_VEL_DIFF 4 EAC_ERROR_TMP_FAULT 5 EAR_ERROR_MAX_STEER_DELTA 15 SNA", + .sigs = sigs_880, + }, + { + .name = "EPAS_eacStatus", + .address = 0x370, + .def_val = "2 EAC_ACTIVE 1 EAC_AVAILABLE 3 EAC_FAULT 0 EAC_INHIBITED 4 SNA", + .sigs = sigs_880, + }, + { + .name = "EPAS_handsOnLevel", + .address = 0x370, + .def_val = "0 0 1 1 2 2 3 3", + .sigs = sigs_880, + }, + { + .name = "EPAS_steeringFault", + .address = 0x370, + .def_val = "1 FAULT 0 NO_FAULT", + .sigs = sigs_880, + }, + { + .name = "EPAS_steeringRackForce", + .address = 0x370, + .def_val = "1022 NOT_IN_SPEC 1023 SNA", + .sigs = sigs_880, + }, + { + .name = "EPAS_steeringReduced", + .address = 0x370, + .def_val = "0 NORMAL_ASSIST 1 REDUCED_ASSIST", + .sigs = sigs_880, + }, + { + .name = "EPAS_torsionBarTorque", + .address = 0x370, + .def_val = "0 SEE_SPECIFICATION 4095 SNA 4094 UNDEFINABLE_DATA", + .sigs = sigs_880, + }, + { + .name = "MCU_clusterReadyForDrive", + .address = 0x388, + .def_val = "0 NO_SNA 1 YES", + .sigs = sigs_904, + }, + { + .name = "DAS_ACC_report", + .address = 0x389, + .def_val = "24 ACC_REPORT_BEHAVIOR_REPORT 23 ACC_REPORT_CAMERA_ONLY 22 ACC_REPORT_RADAR_OBJ_FIVE 21 ACC_REPORT_CIPV_CUTTING_OUT 20 ACC_REPORT_MCVLR_IN_PATH 19 ACC_REPORT_MCVLR_DPP 18 ACC_REPORT_FLEET_SPEEDS 17 ACC_REPORT_TARGET_MCP 16 ACC_REPORT_RADAR_OBJ_TWO 15 ACC_REPORT_RADAR_OBJ_ONE 14 ACC_REPORT_LC_EXTERNAL_STATE_ACTIVE_RESTRICTED 13 ACC_REPORT_LC_EXTERNAL_STATE_ABORTED 12 ACC_REPORT_LC_EXTERNAL_STATE_ABORTING 11 ACC_REPORT_LC_HANDS_ON_REQD_STRUCK_OUT 10 ACC_REPORT_CSA 9 ACC_REPORT_TARGET_TYPE_FAULT 8 ACC_REPORT_TARGET_TYPE_IPSO 7 ACC_REPORT_TARGET_TYPE_TRAFFIC_LIGHT 6 ACC_REPORT_TARGET_TYPE_STOP_SIGN 5 ACC_REPORT_TARGET_CUTIN 4 ACC_REPORT_TARGET_MCVR 3 ACC_REPORT_TARGET_MCVL 2 ACC_REPORT_TARGET_IN_FRONT_OF_CIPV 1 ACC_REPORT_TARGET_CIPV 0 ACC_REPORT_TARGET_NONE", + .sigs = sigs_905, + }, + { + .name = "DAS_accSpeedLimit", + .address = 0x389, + .def_val = "1023 SNA 0 NONE", + .sigs = sigs_905, + }, + { + .name = "DAS_activationFailureStatus", + .address = 0x389, + .def_val = "2 LC_ACTIVATION_FAILED_2 1 LC_ACTIVATION_FAILED_1 0 LC_ACTIVATION_IDLE", + .sigs = sigs_905, + }, + { + .name = "DAS_csaState", + .address = 0x389, + .def_val = "3 CSA_EXTERNAL_STATE_HOLD 2 CSA_EXTERNAL_STATE_ENABLE 1 CSA_EXTERNAL_STATE_AVAILABLE 0 CSA_EXTERNAL_STATE_UNAVAILABLE", + .sigs = sigs_905, + }, + { + .name = "DAS_driverInteractionLevel", + .address = 0x389, + .def_val = "2 CONTINUED_DRIVER_NOT_INTERACTING 1 DRIVER_NOT_INTERACTING 0 DRIVER_INTERACTING", + .sigs = sigs_905, + }, + { + .name = "DAS_longCollisionWarning", + .address = 0x389, + .def_val = "15 FCM_LONG_COLLISION_WARNING_SNA 12 FCM_LONG_COLLISION_WARNING_VEHICLE_CIPV2 11 FCM_LONG_COLLISION_WARNING_VEHICLE_MCVR2 10 FCM_LONG_COLLISION_WARNING_VEHICLE_MCVR 9 FCM_LONG_COLLISION_WARNING_VEHICLE_MCVL2 8 FCM_LONG_COLLISION_WARNING_VEHICLE_MCVL 7 FCM_LONG_COLLISION_WARNING_VEHICLE_CUTIN 6 FCM_LONG_COLLISION_WARNING_VEHICLE_CIPV 5 FCM_LONG_COLLISION_WARNING_TFL_STOPLINE 4 FCM_LONG_COLLISION_WARNING_STOPSIGN_STOPLINE 3 FCM_LONG_COLLISION_WARNING_IPSO 2 FCM_LONG_COLLISION_WARNING_PEDESTRIAN 1 FCM_LONG_COLLISION_WARNING_VEHICLE_UNKNOWN 0 FCM_LONG_COLLISION_WARNING_NONE", + .sigs = sigs_905, + }, + { + .name = "DAS_pmmCameraFaultReason", + .address = 0x389, + .def_val = "2 PMM_CAMERA_INVALID_MIA 1 PMM_CAMERA_BLOCKED_FRONT 0 PMM_CAMERA_NO_FAULT", + .sigs = sigs_905, + }, + { + .name = "DAS_pmmLoggingRequest", + .address = 0x389, + .def_val = "1 TRUE 0 FALSE", + .sigs = sigs_905, + }, + { + .name = "DAS_pmmObstacleSeverity", + .address = 0x389, + .def_val = "7 PMM_SNA 6 PMM_ACCEL_LIMIT 5 PMM_CRASH_FRONT 4 PMM_CRASH_REAR 3 PMM_BRAKE_REQUEST 2 PMM_IMMINENT_FRONT 1 PMM_IMMINENT_REAR 0 PMM_NONE", + .sigs = sigs_905, + }, + { + .name = "DAS_pmmRadarFaultReason", + .address = 0x389, + .def_val = "2 PMM_RADAR_INVALID_MIA 1 PMM_RADAR_BLOCKED_FRONT 0 PMM_RADAR_NO_FAULT", + .sigs = sigs_905, + }, + { + .name = "DAS_pmmSysFaultReason", + .address = 0x389, + .def_val = "7 PMM_FAULT_BRAKE_PEDAL_INHIBIT 6 PMM_FAULT_ROAD_TYPE 5 PMM_FAULT_DISABLED_BY_USER 4 PMM_FAULT_STEERING_ANGLE_RATE 3 PMM_FAULT_DI_FAULT 2 PMM_FAULT_SPEED 1 PMM_FAULT_DAS_DISABLED 0 PMM_FAULT_NONE", + .sigs = sigs_905, + }, + { + .name = "DAS_pmmUltrasonicsFaultReason", + .address = 0x389, + .def_val = "4 PMM_ULTRASONICS_INVALID_MIA 3 PMM_ULTRASONICS_BLOCKED_BOTH 2 PMM_ULTRASONICS_BLOCKED_REAR 1 PMM_ULTRASONICS_BLOCKED_FRONT 0 PMM_ULTRASONICS_NO_FAULT", + .sigs = sigs_905, + }, + { + .name = "DAS_ppOffsetDesiredRamp", + .address = 0x389, + .def_val = "128 PP_NO_OFFSET", + .sigs = sigs_905, + }, + { + .name = "DAS_radarTelemetry", + .address = 0x389, + .def_val = "2 RADAR_TELEMETRY_URGENT 1 RADAR_TELEMETRY_NORMAL 0 RADAR_TELEMETRY_IDLE", + .sigs = sigs_905, + }, + { + .name = "DAS_robState", + .address = 0x389, + .def_val = "3 ROB_STATE_MAPLESS 2 ROB_STATE_ACTIVE 1 ROB_STATE_MEASURE 0 ROB_STATE_INHIBITED", + .sigs = sigs_905, + }, + { + .name = "DAS_autoLaneChangeState", + .address = 0x399, + .def_val = "31 ALC_SNA 30 ALC_ABORT_MISSION_PLAN_INVALID 29 ALC_ABORT_TIMEOUT 28 ALC_WAITING_HANDS_ON 27 ALC_BLOCKED_LANE_TYPE_R 26 ALC_BLOCKED_LANE_TYPE_L 25 ALC_BLOCKED_VEH_TTC_AND_USS_R 24 ALC_BLOCKED_VEH_TTC_R 23 ALC_BLOCKED_VEH_TTC_AND_USS_L 22 ALC_BLOCKED_VEH_TTC_L 21 ALC_UNAVAILABLE_SOLID_LANE_LINE 20 ALC_ABORT_OTHER_REASON 19 ALC_ABORT_BLINKER_TURNED_OFF 18 ALC_ABORT_LC_HEALTH_BAD 17 ALC_ABORT_POOR_VIEW_RANGE 16 ALC_ABORT_SIDE_OBSTACLE_PRESENT_R 15 ALC_ABORT_SIDE_OBSTACLE_PRESENT_L 14 ALC_WAITING_FOR_FWD_OBST_TO_PASS_R 13 ALC_WAITING_FOR_FWD_OBST_TO_PASS_L 12 ALC_WAITING_FOR_SIDE_OBST_TO_PASS_R 11 ALC_WAITING_FOR_SIDE_OBST_TO_PASS_L 10 ALC_IN_PROGRESS_R 9 ALC_IN_PROGRESS_L 8 ALC_AVAILABLE_BOTH 7 ALC_AVAILABLE_ONLY_R 6 ALC_AVAILABLE_ONLY_L 5 ALC_UNAVAILABLE_VEHICLE_SPEED 4 ALC_UNAVAILABLE_EXITING_HIGHWAY 3 ALC_UNAVAILABLE_TP_FOLLOW 2 ALC_UNAVAILABLE_SONICS_INVALID 1 ALC_UNAVAILABLE_NO_LANES 0 ALC_UNAVAILABLE_DISABLED", + .sigs = sigs_921, + }, + { + .name = "DAS_autoparkReady", + .address = 0x399, + .def_val = "1 AUTOPARK_READY 0 AUTOPARK_UNAVAILABLE", + .sigs = sigs_921, + }, + { + .name = "DAS_autopilotHandsOnState", + .address = 0x399, + .def_val = "15 LC_HANDS_ON_SNA 8 LC_HANDS_ON_SUSPENDED 7 LC_HANDS_ON_REQD_STRUCK_OUT 5 LC_HANDS_ON_REQD_CHIME_2 4 LC_HANDS_ON_REQD_CHIME_1 3 LC_HANDS_ON_REQD_VISUAL 2 LC_HANDS_ON_REQD_NOT_DETECTED 1 LC_HANDS_ON_REQD_DETECTED 0 LC_HANDS_ON_NOT_REQD", + .sigs = sigs_921, + }, + { + .name = "DAS_autopilotState", + .address = 0x399, + .def_val = "5 ACTIVE_NAVIGATE_ON_AUTOPILOT 4 ACTIVE_2 3 ACTIVE_1 2 AVAILABLE 1 UNAVAILABLE 0 DISABLED", + .sigs = sigs_921, + }, + { + .name = "DAS_blindSpotRearLeft", + .address = 0x399, + .def_val = "3 SNA 2 WARNING_LEVEL_2 1 WARNING_LEVEL_1 0 NO_WARNING", + .sigs = sigs_921, + }, + { + .name = "DAS_blindSpotRearRight", + .address = 0x399, + .def_val = "3 SNA 2 WARNING_LEVEL_2 1 WARNING_LEVEL_1 0 NO_WARNING", + .sigs = sigs_921, + }, + { + .name = "DAS_fleetSpeedState", + .address = 0x399, + .def_val = "3 FLEETSPEED_HOLD 2 FLEETSPEED_ACTIVE 1 FLEETSPEED_AVAILABLE 0 FLEETSPEED_UNAVAILABLE", + .sigs = sigs_921, + }, + { + .name = "DAS_forwardCollisionWarning", + .address = 0x399, + .def_val = "3 SNA 1 FORWARD_COLLISION_WARNING 0 NONE", + .sigs = sigs_921, + }, + { + .name = "DAS_fusedSpeedLimit", + .address = 0x399, + .def_val = "31 NONE 0 UNKNOWN_SNA", + .sigs = sigs_921, + }, + { + .name = "DAS_heaterState", + .address = 0x399, + .def_val = "1 HEATER_ON 0 HEATER_OFF_SNA", + .sigs = sigs_921, + }, + { + .name = "DAS_laneDepartureWarning", + .address = 0x399, + .def_val = "5 SNA 4 RIGHT_WARNING_SEVERE 3 LEFT_WARNING_SEVERE 2 RIGHT_WARNING 1 LEFT_WARNING 0 NONE", + .sigs = sigs_921, + }, + { + .name = "DAS_lssState", + .address = 0x399, + .def_val = "7 LSS_STATE_OFF 6 LSS_STATE_ABORT 5 LSS_STATE_BLINDSPOT 4 LSS_STATE_MONITOR 3 LSS_STATE_ELK", + .sigs = sigs_921, + }, + { + .name = "DAS_sideCollisionAvoid", + .address = 0x399, + .def_val = "3 SNA 2 AVOID_RIGHT 1 AVOID_LEFT 0 NONE", + .sigs = sigs_921, + }, + { + .name = "DAS_sideCollisionInhibit", + .address = 0x399, + .def_val = "1 INHIBIT 0 NO_INHIBIT", + .sigs = sigs_921, + }, + { + .name = "DAS_sideCollisionWarning", + .address = 0x399, + .def_val = "3 WARN_LEFT_RIGHT 2 WARN_RIGHT 1 WARN_LEFT 0 NONE", + .sigs = sigs_921, + }, + { + .name = "DAS_suppressSpeedWarning", + .address = 0x399, + .def_val = "1 SUPPRESS_SPEED_WARNING 0 DO_NOT_SUPPRESS", + .sigs = sigs_921, + }, + { + .name = "DAS_visionOnlySpeedLimit", + .address = 0x399, + .def_val = "31 NONE 0 UNKNOWN_SNA", + .sigs = sigs_921, + }, + { + .name = "IBST_brakeInputStroke", + .address = 0x39D, + .def_val = "1022 NOT_VALID 1023 SNA", + .sigs = sigs_925, + }, + { + .name = "IBST_iBoosterStatus", + .address = 0x39D, + .def_val = "0 NOT_INITIALIZED_OR_SUP 1 FAILURE 2 DIAGNOSIS 3 MAX_STROKE 4 STANDALONE 5 REDUCED 6 POST_RUN_REDUCED 7 READY", + .sigs = sigs_925, + }, + { + .name = "DAS_hazardLightRequest", + .address = 0x3E9, + .def_val = "3 DAS_REQUEST_HAZARDS_SNA 2 DAS_REQUEST_HAZARDS_UNUSED 1 DAS_REQUEST_HAZARDS_ON 0 DAS_REQUEST_HAZARDS_OFF", + .sigs = sigs_1001, + }, + { + .name = "DAS_headlightRequest", + .address = 0x3E9, + .def_val = "3 DAS_HEADLIGHT_REQUEST_INVALID 1 DAS_HEADLIGHT_REQUEST_ON 0 DAS_HEADLIGHT_REQUEST_OFF", + .sigs = sigs_1001, + }, + { + .name = "DAS_highLowBeamDecision", + .address = 0x3E9, + .def_val = "3 DAS_HIGH_BEAM_SNA 2 DAS_HIGH_BEAM_ON 1 DAS_HIGH_BEAM_OFF 0 DAS_HIGH_BEAM_UNDECIDED", + .sigs = sigs_1001, + }, + { + .name = "DAS_highLowBeamOffReason", + .address = 0x3E9, + .def_val = "5 HIGH_BEAM_OFF_REASON_SNA 4 HIGH_BEAM_OFF_REASON_HEAD_LIGHT 3 HIGH_BEAM_OFF_REASON_AMBIENT_LIGHT 2 HIGH_BEAM_OFF_REASON_MOVING_RADAR_TARGET 1 HIGH_BEAM_OFF_REASON_MOVING_VISION_TARGET 0 HIGH_BEAM_ON", + .sigs = sigs_1001, + }, + { + .name = "DAS_turnIndicatorRequest", + .address = 0x3E9, + .def_val = "3 DAS_TURN_INDICATOR_CANCEL 2 DAS_TURN_INDICATOR_RIGHT 1 DAS_TURN_INDICATOR_LEFT 0 DAS_TURN_INDICATOR_NONE", + .sigs = sigs_1001, + }, + { + .name = "DAS_turnIndicatorRequestReason", + .address = 0x3E9, + .def_val = "6 DAS_ACTIVE_COMMANDED_LANE_CHANGE 5 DAS_CANCEL_FORK 4 DAS_CANCEL_LANE_CHANGE 3 DAS_ACTIVE_FORK 2 DAS_ACTIVE_SPEED_LANE_CHANGE 1 DAS_ACTIVE_NAV_LANE_CHANGE 0 DAS_NONE", + .sigs = sigs_1001, + }, + { + .name = "DAS_wiperSpeed", + .address = 0x3E9, + .def_val = "15 DAS_WIPER_SPEED_INVALID 14 DAS_WIPER_SPEED_14 13 DAS_WIPER_SPEED_13 12 DAS_WIPER_SPEED_12 11 DAS_WIPER_SPEED_11 10 DAS_WIPER_SPEED_10 9 DAS_WIPER_SPEED_9 8 DAS_WIPER_SPEED_8 7 DAS_WIPER_SPEED_7 6 DAS_WIPER_SPEED_6 5 DAS_WIPER_SPEED_5 4 DAS_WIPER_SPEED_4 3 DAS_WIPER_SPEED_3 2 DAS_WIPER_SPEED_2 1 DAS_WIPER_SPEED_1 0 DAS_WIPER_SPEED_OFF", + .sigs = sigs_1001, + }, + { + .name = "DAS_steeringAngleRequest", + .address = 0x488, + .def_val = "16384 ZERO_ANGLE", + .sigs = sigs_1160, + }, + { + .name = "DAS_steeringControlType", + .address = 0x488, + .def_val = "1 ANGLE_CONTROL 3 DISABLED 0 NONE 2 RESERVED", + .sigs = sigs_1160, + }, + { + .name = "DAS_steeringHapticRequest", + .address = 0x488, + .def_val = "1 ACTIVE 0 IDLE", + .sigs = sigs_1160, + }, + { + .name = "STATE", + .address = 0x552, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_1362, + }, + { + .name = "BrakeMode", + .address = 0x553, + .def_val = "3 RESERVED 2 POSITION_CONTROL 1 RELATIVE_CONTROL 0 DISENGADGED", + .sigs = sigs_1363, + }, + { + .name = "BrakeApplied", + .address = 0x554, + .def_val = "1 YES 0 NO", + .sigs = sigs_1364, + }, + { + .name = "BrakeOK", + .address = 0x554, + .def_val = "1 YES 0 NO", + .sigs = sigs_1364, + }, + { + .name = "DriverBrakeApplied", + .address = 0x554, + .def_val = "1 YES 0 NO", + .sigs = sigs_1364, + }, + { + .name = "Status", + .address = 0x554, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_1364, + }, +}; + +} + +const DBC tesla_can = { + .name = "tesla_can", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(tesla_can) \ No newline at end of file diff --git a/opendbc/can/dbc_out/tesla_can_pre1916.cc b/opendbc/can/dbc_out/tesla_can_pre1916.cc new file mode 100644 index 000000000..7af9d8ea2 --- /dev/null +++ b/opendbc/can/dbc_out/tesla_can_pre1916.cc @@ -0,0 +1,9607 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_3[] = { + { + .name = "StW_Angl", + .b1 = 2, + .b2 = 14, + .bo = 48, + .is_signed = false, + .factor = 0.5, + .offset = -2048.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_AnglSpd", + .b1 = 18, + .b2 = 14, + .bo = 32, + .is_signed = false, + .factor = 0.5, + .offset = -2048.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_AnglSens_Stat", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_AnglSens_Id", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MC_STW_ANGL_STAT", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRC_STW_ANGL_STAT", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_14[] = { + { + .name = "StW_AnglHP", + .b1 = 2, + .b2 = 14, + .bo = 48, + .is_signed = false, + .factor = 0.1, + .offset = -819.2, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_AnglHP_Spd", + .b1 = 18, + .b2 = 14, + .bo = 32, + .is_signed = false, + .factor = 0.5, + .offset = -4096.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_AnglHP_Sens_Stat", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_AnglHP_Sens_Id", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MC_STW_ANGLHP_STAT", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRC_STW_ANGLHP_STAT", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_69[] = { + { + .name = "SpdCtrlLvr_Stat", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VSL_Enbl_Rq", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SpdCtrlLvrStat_Inv", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DTR_Dist_Rq", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TurnIndLvr_Stat", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HiBmLvr_Stat", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WprWashSw_Psd", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WprWash_R_Sw_Posn_V2", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Lvr_Stat", + .b1 = 24, + .b2 = 3, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Cond_Flt", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Cond_Psd", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HrnSw_Psd", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw00_Psd", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw01_Psd", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw02_Psd", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw03_Psd", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw04_Psd", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw05_Psd", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw06_Psd", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw07_Psd", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw08_Psd", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw09_Psd", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw10_Psd", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw11_Psd", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw12_Psd", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw13_Psd", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw14_Psd", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw15_Psd", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WprSw6Posn", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MC_STW_ACTN_RQ", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRC_STW_ACTN_RQ", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_104[] = { + { + .name = "MCU_elevation", + .b1 = 0, + .b2 = 32, + .bo = 32, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_navigonExpectedSpeed", + .b1 = 32, + .b2 = 7, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_109[] = { + { + .name = "StW_Sw_Stat3", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MsgTxmtId", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSL_RND_Posn_StW", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSL_P_Psd_StW", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MC_SBW_RQ_SCCM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRC_SBW_RQ_SCCM", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_257[] = { + { + .name = "GTW_epasTuneRequest", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_epasPowerMode", + .b1 = 1, + .b2 = 4, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_epasEmergencyOn", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_epasControlCounter", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_epasLDWEnabled", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_epasControlType", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_epasControlChecksum", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_264[] = { + { + .name = "DI_torqueDriver", + .b1 = 0, + .b2 = 13, + .bo = 51, + .is_signed = true, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torque1Counter", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torqueMotor", + .b1 = 16, + .b2 = 13, + .bo = 35, + .is_signed = true, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_soptState", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_motorRPM", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_pedalPos", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.4, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torque1Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_280[] = { + { + .name = "DI_torqueEstimate", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = true, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_gear", + .b1 = 12, + .b2 = 3, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_brakePedal", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_vehicleSpeed", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.05, + .offset = -25.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_gearRequest", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torqueInterfaceFailure", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torque2Counter", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_brakePedalState", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_epbParkRequest", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_epbInterfaceReady", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torque2Checksum", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_309[] = { + { + .name = "ESP_hillStartAssistActive", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_absBrakeEvent", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_brakeLamp", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_brakeDiscWipingActive", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_tcLampFlash", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_espFaultLamp", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_espLampFlash", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_135hCounter", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_stabilityControlSts", + .b1 = 9, + .b2 = 3, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_tcOffLamp", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_135hChecksum", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_messagePumpService", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_messagePumpFailure", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_messageEBDFailure", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_absFaultLamp", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_tcDisabledByFault", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_messageDynoModeActive", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_hydraulicBoostEnabled", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_espOffLamp", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_341[] = { + { + .name = "ESP_wheelPulseCountFrL", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_wheelPulseCountFrR", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_wheelPulseCountReL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_wheelPulseCountReR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_BChecksum", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_vehicleSpeed", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 0.00999999978, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_vehicleSpeedQF", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_BCounter", + .b1 = 57, + .b2 = 4, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_513[] = { + { + .name = "SDM_bcklPassStatus", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SDM_bcklDrivStatus", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_521[] = { + { + .name = "DAS_locMode", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_locState", + .b1 = 2, + .b2 = 3, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_locRequest", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_locJerkMin", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.034, + .offset = -8.67, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_locJerkMax", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.034, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_locSpeed", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_locAccelMin", + .b1 = 35, + .b2 = 9, + .bo = 20, + .is_signed = false, + .factor = 0.04, + .offset = -15.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_locAccelMax", + .b1 = 44, + .b2 = 9, + .bo = 11, + .is_signed = false, + .factor = 0.04, + .offset = -15.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_longControlCounter", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_longControlChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_522[] = { + { + .name = "driverBrakeStatus", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_532[] = { + { + .name = "EPB_epasEACAllow", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_epasControlCounter", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_epasControlChecksum", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_536[] = { + { + .name = "MCU_dasDebugEnable", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_parkBrakeRequest", + .b1 = 1, + .b2 = 2, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_trailerModeCH", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_fcwSensitivity", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_fcwEnable", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_latControlEnable", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_accOvertakeEnable", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_ldwEnable", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_aebEnable", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_bsdEnable", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_ahlbEnable", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_parkSetting", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_pedalSafetyEnable", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_frontDefrostReq_das", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_autoParkRequest", + .b1 = 26, + .b2 = 4, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_redLightStopSignEnable", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_enableCreepTorqueCH", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_narrowGarages", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_rebootAutopilot", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_enableAutowipers", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_overPaintedUSS", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_selfParkTune", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_towModeEnable", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_zeroSpeedConfirmed", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_aesEnable", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_autoLaneChangeEnable", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_chassisControlCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_chassisControlChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_537[] = { + { + .name = "DAS_pscControlCounter", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pscParkState", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_eacState", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pscControlChecksum", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_568[] = { + { + .name = "UI_roadSign", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_dummyData", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_stopSignStopLineDist", + .b1 = 8, + .b2 = 10, + .bo = 46, + .is_signed = false, + .factor = 0.25, + .offset = -8.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_trafficLightStopLineDist", + .b1 = 8, + .b2 = 10, + .bo = 46, + .is_signed = false, + .factor = 0.25, + .offset = -8.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_baseMapSpeedLimitMPS", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_meanFleetSplineSpeedMPS", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_currSplineIdFull", + .b1 = 8, + .b2 = 32, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_bottomQrtlFleetSpeedMPS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_medianFleetSpeedMPS", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_stopSignStopLineConf", + .b1 = 18, + .b2 = 7, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_trafficLightStopLineConf", + .b1 = 18, + .b2 = 7, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_topQrtlFleetSpeedMPS", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_meanFleetSplineAccelMPS2", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.05, + .offset = -6.35, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rampType", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_splineLocConfidence", + .b1 = 40, + .b2 = 7, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_splineID", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadSignCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadSignChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_569[] = { + { + .name = "DAS_leftLaneExists", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightLaneExists", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_virtualLaneWidth", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 0.3125, + .offset = 2, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_virtualLaneViewRange", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_virtualLaneC0", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.035, + .offset = -3.5, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_virtualLaneC1", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.0016, + .offset = -0.2, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_virtualLaneC2", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 2e-05, + .offset = -0.0025, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_virtualLaneC3", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 2.4e-07, + .offset = -3e-05, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftLineUsage", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightLineUsage", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftFork", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightFork", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_lanesCounter", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_582[] = { + { + .name = "UI_solarAzimuthAngle", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_solarAzimuthAngleCarRef", + .b1 = 16, + .b2 = 9, + .bo = 39, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_isSunUp", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_solarElevationAngle", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_643[] = { + { + .name = "DrRLtch_FL_Stat", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DrRLtch_FR_Stat", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DrRLtch_RL_Stat", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DrRLtch_RR_Stat", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DL_RLtch_Stat", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EngHd_Stat", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VTA_Alm_Actv", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LgtSens_Twlgt", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LgtSens_SNA", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LgtSens_Tunnel", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LgtSens_Flt", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LgtSens_Night", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ADL_LoBm_On_Rq", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Trlr_Stat", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Hrn_On", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Term54_Actv", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MPkBrk_Stat", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WprOutsdPkPosn", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LoBm_On_Rq", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HiBm_On", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IrLmp_D_Lt_Flt", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IrLmp_P_Rt_Flt", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LoBm_D_Lt_Flt", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LoBm_P_Rt_Flt", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RevGr_Engg", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AirTemp_Insd", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Bckl_Sw_RL_Stat_SAM_R", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Bckl_Sw_RR_Stat_SAM_R", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "Bckl_Sw_RM_Stat_SAM_R", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Cond_Stat", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AirTemp_Outsd", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.5, + .offset = -40.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_696[] = { + { + .name = "UI_radarTargetDx", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = -95.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_radarTargetDxEnd", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_radarTargetTrustMap", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_radarEnableBraking", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_radarMapDataCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_radarMapDataChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_697[] = { + { + .name = "DAS_setSpeed", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_accState", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_aebEvent", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_jerkMin", + .b1 = 18, + .b2 = 9, + .bo = 37, + .is_signed = false, + .factor = 0.018, + .offset = -9.1, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_jerkMax", + .b1 = 27, + .b2 = 8, + .bo = 29, + .is_signed = false, + .factor = 0.034, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_accelMin", + .b1 = 35, + .b2 = 9, + .bo = 20, + .is_signed = false, + .factor = 0.04, + .offset = -15.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_accelMax", + .b1 = 44, + .b2 = 9, + .bo = 11, + .is_signed = false, + .factor = 0.04, + .offset = -15.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_controlCounter", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_controlChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_712[] = { + { + .name = "UI_roadCurvC0", + .b1 = 0, + .b2 = 11, + .bo = 53, + .is_signed = true, + .factor = 0.02, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadCurvC1", + .b1 = 11, + .b2 = 10, + .bo = 43, + .is_signed = true, + .factor = 0.00075, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadCurvC2", + .b1 = 21, + .b2 = 14, + .bo = 29, + .is_signed = true, + .factor = 7.5e-06, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadCurvC3", + .b1 = 35, + .b2 = 13, + .bo = 16, + .is_signed = true, + .factor = 3e-08, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadCurvRange", + .b1 = 48, + .b2 = 6, + .bo = 10, + .is_signed = false, + .factor = 4, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadCurvHealth", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadCurvChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_728[] = { + { + .name = "UI_csaOfframpCurvC2", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1e-06, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaOfframpCurvC3", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 4e-09, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaOfframpCurvRange", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaOfframpCurvCounter", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaOfframpCurvUsingTspline", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaOfframpCurvReserved", + .b1 = 49, + .b2 = 7, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaOfframpCurvChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_744[] = { + { + .name = "UI_csaRoadCurvC2", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 1e-06, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaRoadCurvC3", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 4e-09, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaRoadCurvRange", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaRoadCurvCounter", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaRoadCurvUsingTspline", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaRoadCurvReserved", + .b1 = 49, + .b2 = 7, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_csaRoadCurvChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_760[] = { + { + .name = "UI_gpsHDOP", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_gpsVehicleHeading", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = false, + .factor = 0.0078125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_gpsVehicleSpeed", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = false, + .factor = 0.00390625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_userSpeedOffset", + .b1 = 40, + .b2 = 6, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = -30.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_mapSpeedLimitUnits", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_userSpeedOffsetUnits", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_mppSpeedLimit", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_gpsNmeaMIA", + .b1 = 53, + .b2 = 1, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_777[] = { + { + .name = "DAS_objectId", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVehType", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftVehType", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightVehType", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_cutinVehType", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_roadSignColor", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_roadSignId", + .b1 = 6, + .b2 = 8, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVehRelevantForControl", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftVehRelevantForControl", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightVehRelevantForControl", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_cutinVehRelevantForControl", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVehDx", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftVehDx", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightVehDx", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_cutinVehDx", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVehHeading", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.0245437, + .offset = -3.1415936, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_roadSignStopLineDist", + .b1 = 14, + .b2 = 10, + .bo = 40, + .is_signed = false, + .factor = 0.2, + .offset = -20.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVehVxRel", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 4, + .offset = -30.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftVehVxRel", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 4, + .offset = -30.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightVehVxRel", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 4, + .offset = -30.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_cutinVehVxRel", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 4, + .offset = -30.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVeh2Heading", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.0245437, + .offset = -3.1415936, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVehDy", + .b1 = 20, + .b2 = 7, + .bo = 37, + .is_signed = false, + .factor = 0.35, + .offset = -22.05, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftVehDy", + .b1 = 20, + .b2 = 7, + .bo = 37, + .is_signed = false, + .factor = 0.35, + .offset = -22.05, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightVehDy", + .b1 = 20, + .b2 = 7, + .bo = 37, + .is_signed = false, + .factor = 0.35, + .offset = -22.05, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_cutinVehDy", + .b1 = 20, + .b2 = 7, + .bo = 37, + .is_signed = false, + .factor = 0.35, + .offset = -22.05, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_roadSignControlActive", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftVehHeading", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.0245437, + .offset = -3.1415936, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_roadSignSource", + .b1 = 25, + .b2 = 2, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVehId", + .b1 = 27, + .b2 = 7, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftVehId", + .b1 = 27, + .b2 = 7, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightVehId", + .b1 = 27, + .b2 = 7, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_cutinVehId", + .b1 = 27, + .b2 = 7, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_roadSignArrow", + .b1 = 27, + .b2 = 3, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_roadSignOrientation", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftVeh2Heading", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.0245437, + .offset = -3.1415936, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVeh2Type", + .b1 = 34, + .b2 = 3, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftVeh2Type", + .b1 = 34, + .b2 = 3, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightVeh2Type", + .b1 = 34, + .b2 = 3, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVeh2RelevantForControl", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftVeh2RelevantForControl", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightVeh2RelevantForControl", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVeh2Dx", + .b1 = 39, + .b2 = 8, + .bo = 17, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftVeh2Dx", + .b1 = 39, + .b2 = 8, + .bo = 17, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightVeh2Dx", + .b1 = 39, + .b2 = 8, + .bo = 17, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightVehHeading", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.0245437, + .offset = -3.1415936, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVeh2VxRel", + .b1 = 47, + .b2 = 4, + .bo = 13, + .is_signed = false, + .factor = 4, + .offset = -30.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftVeh2VxRel", + .b1 = 47, + .b2 = 4, + .bo = 13, + .is_signed = false, + .factor = 4, + .offset = -30.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightVeh2VxRel", + .b1 = 47, + .b2 = 4, + .bo = 13, + .is_signed = false, + .factor = 4, + .offset = -30.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightVeh2Heading", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.0245437, + .offset = -3.1415936, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVeh2Dy", + .b1 = 51, + .b2 = 7, + .bo = 6, + .is_signed = false, + .factor = 0.35, + .offset = -22.05, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftVeh2Dy", + .b1 = 51, + .b2 = 7, + .bo = 6, + .is_signed = false, + .factor = 0.35, + .offset = -22.05, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightVeh2Dy", + .b1 = 51, + .b2 = 7, + .bo = 6, + .is_signed = false, + .factor = 0.35, + .offset = -22.05, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_cutinVehHeading", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.0245437, + .offset = -3.1415936, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leadVeh2Id", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_leftVeh2Id", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_rightVeh2Id", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_782[] = { + { + .name = "PARK_frontSVACharID", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_pscRightCurbType", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_rearSVACharID", + .b1 = 8, + .b2 = 6, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_pscLeftCurbType", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_autoCalComplete", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_geometryType", + .b1 = 17, + .b2 = 2, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_tireFitment", + .b1 = 19, + .b2 = 2, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_rackDetected", + .b1 = 21, + .b2 = 2, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_sdiActive", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_sdiNoise", + .b1 = 25, + .b2 = 2, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_sdiBlindSpotRight", + .b1 = 27, + .b2 = 2, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_sdiBlindSpotLeft", + .b1 = 29, + .b2 = 2, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_status2Counter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PARK_status2Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_792[] = { + { + .name = "YEAR", + .b1 = 0, + .b2 = 7, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 2000, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CERRD", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MONTH", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_STATE_FL", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_STATE_FR", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SECOND", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_STATE_RL", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Hour", + .b1 = 24, + .b2 = 5, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_STATE_RR", + .b1 = 29, + .b2 = 2, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAY", + .b1 = 32, + .b2 = 5, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MINUTE", + .b1 = 40, + .b2 = 6, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BOOT_STATE", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_updateInProgress", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_STATE_FrontTrunk", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_factoryMode", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_transportModeOn", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BC_headLightLStatus", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BC_headLightRStatus", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BC_indicatorLStatus", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BC_indicatorRStatus", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_824[] = { + { + .name = "UI_touchActive", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_audioActive", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_bluetoothActive", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_cellActive", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_displayReady", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_gpsActive", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_wifiConnected", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_systemActive", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_xmActive", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_displayOn", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_readyForDrive", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_cellConnected", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_vpnActive", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_wifiActive", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_cameraActive", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_usbActive", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_screenshotActive", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_monitorModemPower", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_factoryReset", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_cellNetworkTechnology", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_tegraCoreTemperature", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_tegraAmbientTemperature", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_googleWifiUsages", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_autopilotTrial", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_cellSignalBars", + .b1 = 50, + .b2 = 3, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_hardwareType", + .b1 = 53, + .b2 = 2, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_developmentCar", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_cellReceiverPower", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_840[] = { + { + .name = "GTW_driveRailReq", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_brakePressed", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_driverPresent", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_notEnough12VForDrive", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_icPowerOff", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_driverIsLeaving", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_accGoingDown", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_driveGoingDown", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_accRailReq", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_hvacRailReq", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_preconditionRequest", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_hvacGoingDown", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_statusCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_statusChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_872[] = { + { + .name = "DI_systemState", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_vehicleHoldState", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_proximity", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_driveReady", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_regenLight", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_state", + .b1 = 9, + .b2 = 3, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_cruiseState", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_analogSpeed", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_immobilizerState", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_speedUnits", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_cruiseSet", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_aebState", + .b1 = 41, + .b2 = 3, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_stateCounter", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_digitalSpeed", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_stateChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_880[] = { + { + .name = "EPAS_steeringRackForce", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 50, + .offset = -25575.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_steeringFault", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_steeringReduced", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_currentTuneMode", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_torsionBarTorque", + .b1 = 20, + .b2 = 12, + .bo = 32, + .is_signed = false, + .factor = 0.01, + .offset = -20.5, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_eacErrorCode", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_internalSAS", + .b1 = 34, + .b2 = 14, + .bo = 16, + .is_signed = false, + .factor = 0.1, + .offset = -819.200012, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_handsOnLevel", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_sysStatusCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_eacStatus", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "EPAS_sysStatusChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_904[] = { + { + .name = "MCU_clusterReadyForPowerOff", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_clusterReadyForDrive", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_clusterBacklightOn", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_clusterBrightnessLevel", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_905[] = { + { + .name = "DAS_accSpeedLimit", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pmmObstacleSeverity", + .b1 = 10, + .b2 = 3, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pmmLoggingRequest", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_activationFailureStatus", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pmmUltrasonicsFaultReason", + .b1 = 16, + .b2 = 3, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pmmRadarFaultReason", + .b1 = 19, + .b2 = 2, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pmmSysFaultReason", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pmmCameraFaultReason", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_ACC_report", + .b1 = 26, + .b2 = 5, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_relaxCruiseLimits", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_csaState", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_radarTelemetry", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_robState", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_driverInteractionLevel", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_ppOffsetDesiredRamp", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = -1.28, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_longCollisionWarning", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_status2Counter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_status2Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_920[] = { + { + .name = "GTW_performanceConfig", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_fourWheelDrive", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_unknown1", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_dasHw", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_parkAssistInstalled", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_forwardRadarHw", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_airSuspensionInstalled", + .b1 = 9, + .b2 = 3, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_unknown2", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_country", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_parkSensorGeometryType", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_rhd", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_bodyControlsType", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_radarPosition", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_rearCornerRadarHw", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_frontCornerRadarHw", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_epasType", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_chassisType", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_wheelType", + .b1 = 51, + .b2 = 5, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_rearSeatControllerMask", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_euVehicle", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_foldingMirrorsInstalled", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_brakeHwType", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_autopilot", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GTW_unknown3", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_921[] = { + { + .name = "DAS_autopilotState", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_blindSpotRearLeft", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_blindSpotRearRight", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_fusedSpeedLimit", + .b1 = 8, + .b2 = 5, + .bo = 51, + .is_signed = false, + .factor = 5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_suppressSpeedWarning", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_summonObstacle", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_summonClearedGate", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_visionOnlySpeedLimit", + .b1 = 16, + .b2 = 5, + .bo = 43, + .is_signed = false, + .factor = 5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_heaterState", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_forwardCollisionWarning", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_autoparkReady", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_autoParked", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_autoparkWaitingForBrake", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_summonFwdLeashReached", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_summonRvsLeashReached", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_lssState", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_sideCollisionAvoid", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_sideCollisionWarning", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_sideCollisionInhibit", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_laneDepartureWarning", + .b1 = 37, + .b2 = 3, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_fleetSpeedState", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_autopilotHandsOnState", + .b1 = 42, + .b2 = 4, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_autoLaneChangeState", + .b1 = 46, + .b2 = 5, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_summonAvailable", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_statusCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_statusChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_937[] = { + { + .name = "DAS_telemetryMultiplexer", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telLeftLaneType", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_MCPObserved", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignLongitudinalDist", + .b1 = 8, + .b2 = 10, + .bo = 46, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soCamCipvStatus", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_assPrevSetSpeed", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_accReengaged", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pedestrianInFOVBeforeIntr", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_csaOverride", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad5Status", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telRightLaneType", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_pedestrianInFOVAfterIntr", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_csaIntState", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_camFreeSpaceBeforeIntr", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad1Status", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_camFreeSpaceAfterIntr", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telLeftMarkerQuality", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_timeOfIntervention", + .b1 = 14, + .b2 = 6, + .bo = 44, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_csaEnableSpeed", + .b1 = 14, + .b2 = 12, + .bo = 38, + .is_signed = false, + .factor = 0.05, + .offset = -25.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soCamCipvDx", + .b1 = 14, + .b2 = 6, + .bo = 44, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telRightMarkerQuality", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_assNewSetSpeed", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telLeftMarkerColor", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignLateralDist", + .b1 = 18, + .b2 = 8, + .bo = 38, + .is_signed = false, + .factor = 0.25, + .offset = -32.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telRightMarkerColor", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_timeOfFirstPedestrian", + .b1 = 20, + .b2 = 6, + .bo = 38, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad1Dx", + .b1 = 20, + .b2 = 6, + .bo = 38, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telLeftLaneCrossing", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_telRightLaneCrossing", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_assFusedSpeedLimit", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_timeOfACCReengaging", + .b1 = 26, + .b2 = 6, + .bo = 32, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignHeight", + .b1 = 26, + .b2 = 6, + .bo = 32, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_csaDisableSpeed", + .b1 = 26, + .b2 = 12, + .bo = 26, + .is_signed = false, + .factor = 0.05, + .offset = -25.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad5Dx", + .b1 = 26, + .b2 = 6, + .bo = 32, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_assAutosteerActive", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_assSmartSpeedActive", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_durationOfPrevACCStandstill", + .b1 = 32, + .b2 = 6, + .bo = 26, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignStopLineDistance", + .b1 = 32, + .b2 = 10, + .bo = 22, + .is_signed = false, + .factor = 0.1, + .offset = -20.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soCamCipvDy", + .b1 = 32, + .b2 = 5, + .bo = 27, + .is_signed = false, + .factor = 0.4, + .offset = -6.4, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad5Dy", + .b1 = 37, + .b2 = 5, + .bo = 22, + .is_signed = false, + .factor = 0.4, + .offset = -6.4, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_maxAbsSteeringWheelAngle", + .b1 = 38, + .b2 = 7, + .bo = 19, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_csaFiltCurv", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = 1e-06, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignCIPVDistance", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soCamCipvVx", + .b1 = 42, + .b2 = 5, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_targetRelvelAtIntervention", + .b1 = 45, + .b2 = 6, + .bo = 13, + .is_signed = false, + .factor = 0.25, + .offset = -2.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad5ObstProb", + .b1 = 47, + .b2 = 4, + .bo = 13, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignHostAccel", + .b1 = 48, + .b2 = 10, + .bo = 6, + .is_signed = false, + .factor = 0.01, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_targetDistAtIntervention", + .b1 = 51, + .b2 = 6, + .bo = 7, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad5Dz", + .b1 = 51, + .b2 = 6, + .bo = 7, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_csaMeasLatAccel", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.08, + .offset = -10.24, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_egoSpeedAtIntervention", + .b1 = 57, + .b2 = 6, + .bo = 1, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_soRad5powerdB", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignCrossingWarning", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_stopSignIndex", + .b1 = 59, + .b2 = 4, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_968[] = { + { + .name = "UI_mapSpeedLimitDependency", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadClass", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_inSuperchargerGeofence", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_mapSpeedUnits", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_mapSpeedLimit", + .b1 = 8, + .b2 = 5, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_mapSpeedLimitType", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_countryCode", + .b1 = 16, + .b2 = 10, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_streetCount", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_gpsRoadMatch", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_navRouteActive", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_parallelAutoparkEnabled", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_perpendicularAutoparkEnabled", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_nextBranchDist", + .b1 = 32, + .b2 = 5, + .bo = 27, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_controlledAccess", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_nextBranchLeftOffRamp", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_nextBranchRightOffRamp", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectLeftLane", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectRightLane", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectHPP", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectNav", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectLeftFreeSpace", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectRightFreeSpace", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectAutosteer", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_rejectHandsOn", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_acceptBottsDots", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_autosteerRestricted", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_pmmEnabled", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_scaEnabled", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_mapDataCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_mapDataChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_984[] = { + { + .name = "MCU_latitude", + .b1 = 0, + .b2 = 28, + .bo = 36, + .is_signed = true, + .factor = 1e-06, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_longitude", + .b1 = 28, + .b2 = 29, + .bo = 7, + .is_signed = true, + .factor = 1e-06, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MCU_gpsAccuracy", + .b1 = 57, + .b2 = 7, + .bo = 0, + .is_signed = false, + .factor = 0.2, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1000[] = { + { + .name = "UI_autopilotControlRequest", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_ulcStalkConfirm", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_summonHeartbeat", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_curvSpeedAdaptDisable", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_dasDeveloper", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableVinAssociation", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_lssLkaEnabled", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_lssLdwEnabled", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_autoSummonEnable", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_exceptionListEnable", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_roadCheckDisable", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_driveOnMapsEnable", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_handsOnRequirementDisable", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_forksEnable", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_fuseLanesDisable", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_fuseHPPDisable", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_fuseVehiclesDisable", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableNextGenACC", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_visionSpeedType", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_curvatureDatabaseOnly", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_lssElkEnabled", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_summonExitType", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_summonEntryType", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_selfParkRequest", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_summonReverseDist", + .b1 = 32, + .b2 = 6, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_undertakeAssistEnable", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_adaptiveSetSpeedEnable", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_drivingSide", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableClipTelemetry", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableTripTelemetry", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableRoadSegmentTelemetry", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_followNavRouteEnable", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_ulcSpeedConfig", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_ulcBlindSpotConfig", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_autopilotAlwaysOn", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_accFromZero", + .b1 = 53, + .b2 = 1, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcOffHighwayEnable", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_validationLoop", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_ulcOffHighway", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableNavRouteCSA", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableCutinExperiments", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_source3D", + .b1 = 60, + .b2 = 3, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_enableVisionOnlyStops", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1001[] = { + { + .name = "DAS_headlightRequest", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_hazardLightRequest", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_wiperSpeed", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_turnIndicatorRequest", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_highLowBeamDecision", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_highLowBeamOffReason", + .b1 = 12, + .b2 = 3, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_turnIndicatorRequestReason", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_bodyControlsCounter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_bodyControlsChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1006[] = { + { + .name = "UI_autopilotControlIndex", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_hovEnabled", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_camBlockLaneCheckDisable", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_donDisableAutoWiperDuration", + .b1 = 4, + .b2 = 3, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_camBlockLaneCheckThreshold", + .b1 = 4, + .b2 = 6, + .bo = 54, + .is_signed = false, + .factor = 0.01587, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_donDisableOnAutoWiperSpeed", + .b1 = 7, + .b2 = 4, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_camBlockBlurDisable", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_blindspotMinSpeed", + .b1 = 11, + .b2 = 4, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_camBlockBlurThreshold", + .b1 = 11, + .b2 = 6, + .bo = 47, + .is_signed = false, + .factor = 0.01587, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_blindspotDistance", + .b1 = 15, + .b2 = 3, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_blindspotTTC", + .b1 = 18, + .b2 = 3, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_donStopEndOfRampBuffer", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_donDisableCutin", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_donMinGoreWidthForAbortMap", + .b1 = 25, + .b2 = 4, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_donAlcProgGoreAbortThres", + .b1 = 29, + .b2 = 4, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_donMinGoreWidthForAbortNotMap", + .b1 = 33, + .b2 = 4, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcDisableUltrasonicCheck", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcUltrasonicDistance", + .b1 = 38, + .b2 = 4, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcUltrasonicWaitTime", + .b1 = 42, + .b2 = 3, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcEgoLeadingReactionAccel", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcMergIntervalRearDHyst", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcMergingIntervalHeadwayHyst", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcAssertivenessRate", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_alcViewRangeSensitivity", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1064[] = { + { + .name = "UI_TCR_enable", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_moveStateStanding", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_moveStateStopped", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_moveStateMoving", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_moveStateIndeterm", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_classConstElem", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_classMovingPed", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_classMovingTwoWheel", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_classMovingFourWheel", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_classUnknown", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_downSampleFactor", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_wExist", + .b1 = 24, + .b2 = 5, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_vehSpeed", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_minRCS", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.25, + .offset = -14.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_maxDy", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_maxObjects", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_TCR_maxRoadClass", + .b1 = 61, + .b2 = 3, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1080[] = { + { + .name = "UI_anonDebugParam1", + .b1 = 0, + .b2 = 7, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugFlag1", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugParam2", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugFlag2", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugParam3", + .b1 = 16, + .b2 = 7, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugFlag3", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugParam4", + .b1 = 24, + .b2 = 7, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugFlag4", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugParam5", + .b1 = 32, + .b2 = 7, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugParam6", + .b1 = 40, + .b2 = 7, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_anonDebugParam7", + .b1 = 48, + .b2 = 7, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_visionSpeedSlider", + .b1 = 56, + .b2 = 7, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1160[] = { + { + .name = "DAS_steeringAngleRequest", + .b1 = 1, + .b2 = 15, + .bo = 48, + .is_signed = false, + .factor = 0.1, + .offset = -1638.35, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_steeringHapticRequest", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_steeringControlCounter", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_steeringControlType", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_steeringControlChecksum", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1361[] = { + { + .name = "CHECKSUM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.0507968128, + .offset = -22.85856576, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.1015936256, + .offset = -22.85856576, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IDX", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1362[] = { + { + .name = "CHECKSUM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.0507968128, + .offset = -22.85856576, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.1015936256, + .offset = -22.85856576, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IDX", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "STW_ANGL_STAT", + .address = 0x3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_3), + .sigs = sigs_3, + }, + { + .name = "STW_ANGLHP_STAT", + .address = 0xE, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_14), + .sigs = sigs_14, + }, + { + .name = "STW_ACTN_RQ", + .address = 0x45, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_69), + .sigs = sigs_69, + }, + { + .name = "MCU_locationStatus2", + .address = 0x68, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_104), + .sigs = sigs_104, + }, + { + .name = "SBW_RQ_SCCM", + .address = 0x6D, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_109), + .sigs = sigs_109, + }, + { + .name = "GTW_epasControl", + .address = 0x101, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_257), + .sigs = sigs_257, + }, + { + .name = "DI_torque1", + .address = 0x108, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_264), + .sigs = sigs_264, + }, + { + .name = "DI_torque2", + .address = 0x118, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_280), + .sigs = sigs_280, + }, + { + .name = "ESP_135h", + .address = 0x135, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_309), + .sigs = sigs_309, + }, + { + .name = "ESP_B", + .address = 0x155, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_341), + .sigs = sigs_341, + }, + { + .name = "SDM1", + .address = 0x201, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "DAS_longControl", + .address = 0x209, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_521), + .sigs = sigs_521, + }, + { + .name = "BrakeMessage", + .address = 0x20A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_522), + .sigs = sigs_522, + }, + { + .name = "EPB_epasControl", + .address = 0x214, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_532), + .sigs = sigs_532, + }, + { + .name = "MCU_chassisControl", + .address = 0x218, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_536), + .sigs = sigs_536, + }, + { + .name = "DAS_pscControl", + .address = 0x219, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_537), + .sigs = sigs_537, + }, + { + .name = "UI_driverAssistRoadSign", + .address = 0x238, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_568), + .sigs = sigs_568, + }, + { + .name = "DAS_lanes", + .address = 0x239, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_569), + .sigs = sigs_569, + }, + { + .name = "UI_solarData", + .address = 0x246, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_582), + .sigs = sigs_582, + }, + { + .name = "BODY_R1", + .address = 0x283, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_643), + .sigs = sigs_643, + }, + { + .name = "UI_radarMapData", + .address = 0x2B8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_696), + .sigs = sigs_696, + }, + { + .name = "DAS_control", + .address = 0x2B9, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_697), + .sigs = sigs_697, + }, + { + .name = "UI_roadCurvature", + .address = 0x2C8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_712), + .sigs = sigs_712, + }, + { + .name = "UI_csaOfframpCurvature", + .address = 0x2D8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_728), + .sigs = sigs_728, + }, + { + .name = "UI_csaRoadCurvature", + .address = 0x2E8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_744), + .sigs = sigs_744, + }, + { + .name = "UI_gpsVehicleSpeed", + .address = 0x2F8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_760), + .sigs = sigs_760, + }, + { + .name = "DAS_object", + .address = 0x309, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_777), + .sigs = sigs_777, + }, + { + .name = "PARK_status2", + .address = 0x30E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_782), + .sigs = sigs_782, + }, + { + .name = "GTW_carState", + .address = 0x318, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_792), + .sigs = sigs_792, + }, + { + .name = "UI_status", + .address = 0x338, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_824), + .sigs = sigs_824, + }, + { + .name = "GTW_status", + .address = 0x348, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_840), + .sigs = sigs_840, + }, + { + .name = "DI_state", + .address = 0x368, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_872), + .sigs = sigs_872, + }, + { + .name = "EPAS_sysStatus", + .address = 0x370, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_880), + .sigs = sigs_880, + }, + { + .name = "MCU_clusterBacklightRequest", + .address = 0x388, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_904), + .sigs = sigs_904, + }, + { + .name = "DAS_status2", + .address = 0x389, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_905), + .sigs = sigs_905, + }, + { + .name = "GTW_carConfig", + .address = 0x398, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_920), + .sigs = sigs_920, + }, + { + .name = "DAS_status", + .address = 0x399, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_921), + .sigs = sigs_921, + }, + { + .name = "DAS_telemetry", + .address = 0x3A9, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_937), + .sigs = sigs_937, + }, + { + .name = "UI_driverAssistMapData", + .address = 0x3C8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_968), + .sigs = sigs_968, + }, + { + .name = "MCU_locationStatus", + .address = 0x3D8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_984), + .sigs = sigs_984, + }, + { + .name = "UI_driverAssistControl", + .address = 0x3E8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1000), + .sigs = sigs_1000, + }, + { + .name = "DAS_bodyControls", + .address = 0x3E9, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1001), + .sigs = sigs_1001, + }, + { + .name = "UI_autopilotControl", + .address = 0x3EE, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1006), + .sigs = sigs_1006, + }, + { + .name = "UI_telemetryControl", + .address = 0x428, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1064), + .sigs = sigs_1064, + }, + { + .name = "UI_driverAssistAnonDebugParams", + .address = 0x438, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1080), + .sigs = sigs_1080, + }, + { + .name = "DAS_steeringControl", + .address = 0x488, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_1160), + .sigs = sigs_1160, + }, + { + .name = "GAS_COMMAND", + .address = 0x551, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_1361), + .sigs = sigs_1361, + }, + { + .name = "GAS_SENSOR", + .address = 0x552, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_1362), + .sigs = sigs_1362, + }, +}; + +const Val vals[] = { + { + .name = "StW_Angl", + .address = 0x3, + .def_val = "16383 SNA", + .sigs = sigs_3, + }, + { + .name = "StW_AnglSens_Id", + .address = 0x3, + .def_val = "2 MUST 0 PSBL 1 SELF", + .sigs = sigs_3, + }, + { + .name = "StW_AnglSens_Stat", + .address = 0x3, + .def_val = "2 ERR 3 ERR_INI 1 INI 0 OK", + .sigs = sigs_3, + }, + { + .name = "StW_AnglSpd", + .address = 0x3, + .def_val = "16383 SNA", + .sigs = sigs_3, + }, + { + .name = "StW_AnglHP", + .address = 0xE, + .def_val = "16383 SNA", + .sigs = sigs_14, + }, + { + .name = "StW_AnglHP_Sens_Id", + .address = 0xE, + .def_val = "3 SNA 2 KOSTAL 1 DELPHI 0 TEST", + .sigs = sigs_14, + }, + { + .name = "StW_AnglHP_Sens_Stat", + .address = 0xE, + .def_val = "3 SNA 2 ERR 1 INI 0 OK", + .sigs = sigs_14, + }, + { + .name = "StW_AnglHP_Spd", + .address = 0xE, + .def_val = "16383 SNA", + .sigs = sigs_14, + }, + { + .name = "DTR_Dist_Rq", + .address = 0x45, + .def_val = "255 SNA 200 ACC_DIST_7 166 ACC_DIST_6 133 ACC_DIST_5 100 ACC_DIST_4 66 ACC_DIST_3 33 ACC_DIST_2 0 ACC_DIST_1", + .sigs = sigs_69, + }, + { + .name = "HiBmLvr_Stat", + .address = 0x45, + .def_val = "3 SNA 2 HIBM_FLSH_ON_PSD 1 HIBM_ON_PSD 0 IDLE", + .sigs = sigs_69, + }, + { + .name = "HrnSw_Psd", + .address = 0x45, + .def_val = "3 SNA 2 NDEF2 1 PSD 0 NPSD", + .sigs = sigs_69, + }, + { + .name = "SpdCtrlLvr_Stat", + .address = 0x45, + .def_val = "32 DN_1ST 16 UP_1ST 8 DN_2ND 4 UP_2ND 2 RWD 1 FWD 0 IDLE", + .sigs = sigs_69, + }, + { + .name = "StW_Cond_Psd", + .address = 0x45, + .def_val = "3 SNA 2 DOWN 1 UP 0 NPSD", + .sigs = sigs_69, + }, + { + .name = "StW_Lvr_Stat", + .address = 0x45, + .def_val = "4 STW_BACK 3 STW_FWD 2 STW_DOWN 1 STW_UP 0 NPSD", + .sigs = sigs_69, + }, + { + .name = "StW_Sw00_Psd", + .address = 0x45, + .def_val = "1 PRESSED 0 NOT_PRESSED_SNA", + .sigs = sigs_69, + }, + { + .name = "StW_Sw01_Psd", + .address = 0x45, + .def_val = "1 PRESSED 0 NOT_PRESSED_SNA", + .sigs = sigs_69, + }, + { + .name = "StW_Sw03_Psd", + .address = 0x45, + .def_val = "1 PRESSED 0 NOT_PRESSED_SNA", + .sigs = sigs_69, + }, + { + .name = "StW_Sw04_Psd", + .address = 0x45, + .def_val = "1 PRESSED 0 NOT_PRESSED_SNA", + .sigs = sigs_69, + }, + { + .name = "TurnIndLvr_Stat", + .address = 0x45, + .def_val = "3 SNA 2 RIGHT 1 LEFT 0 IDLE", + .sigs = sigs_69, + }, + { + .name = "WprSw6Posn", + .address = 0x45, + .def_val = "7 SNA 6 STAGE2 5 STAGE1 4 INTERVAL4 3 INTERVAL3 2 INTERVAL2 1 INTERVAL1 0 OFF", + .sigs = sigs_69, + }, + { + .name = "WprWashSw_Psd", + .address = 0x45, + .def_val = "3 SNA 2 WASH 1 TIPWIPE 0 NPSD", + .sigs = sigs_69, + }, + { + .name = "WprWash_R_Sw_Posn_V2", + .address = 0x45, + .def_val = "3 SNA 2 WASH 1 INTERVAL 0 OFF", + .sigs = sigs_69, + }, + { + .name = "MsgTxmtId", + .address = 0x6D, + .def_val = "3 NDEF3 2 NDEF2 1 SCCM 0 EWM", + .sigs = sigs_109, + }, + { + .name = "StW_Sw_Stat3", + .address = 0x6D, + .def_val = "7 SNA 6 NDEF6 5 NDEF5 4 NDEF4 3 PLUS_MINUS 2 MINUS 1 PLUS 0 NPSD", + .sigs = sigs_109, + }, + { + .name = "TSL_P_Psd_StW", + .address = 0x6D, + .def_val = "3 SNA 2 INI 1 PSD 0 IDLE", + .sigs = sigs_109, + }, + { + .name = "TSL_RND_Posn_StW", + .address = 0x6D, + .def_val = "15 SNA 8 D 6 INI 4 N_DOWN 2 N_UP 1 R 0 IDLE", + .sigs = sigs_109, + }, + { + .name = "GTW_epasControlType", + .address = 0x101, + .def_val = "0 WITHOUT 1 WITH_ANGLE 3 WITH_BOTH 2 WITH_TORQUE", + .sigs = sigs_257, + }, + { + .name = "GTW_epasEmergencyOn", + .address = 0x101, + .def_val = "1 EMERGENCY_POWER 0 NONE", + .sigs = sigs_257, + }, + { + .name = "GTW_epasLDWEnabled", + .address = 0x101, + .def_val = "1 ALLOWED 0 INHIBITED", + .sigs = sigs_257, + }, + { + .name = "GTW_epasPowerMode", + .address = 0x101, + .def_val = "0 DRIVE_OFF 1 DRIVE_ON 3 LOAD_SHED 2 SHUTTING_DOWN 15 SNA", + .sigs = sigs_257, + }, + { + .name = "GTW_epasTuneRequest", + .address = 0x101, + .def_val = "1 DM_COMFORT 3 DM_SPORT 2 DM_STANDARD 0 FAIL_SAFE_DEFAULT 4 RWD_COMFORT 6 RWD_SPORT 5 RWD_STANDARD 7 SNA", + .sigs = sigs_257, + }, + { + .name = "DI_motorRPM", + .address = 0x108, + .def_val = "-32768 SNA", + .sigs = sigs_264, + }, + { + .name = "DI_pedalPos", + .address = 0x108, + .def_val = "255 SNA", + .sigs = sigs_264, + }, + { + .name = "DI_soptState", + .address = 0x108, + .def_val = "7 SOPT_TEST_SNA 4 SOPT_TEST_NOT_RUN 3 SOPT_TEST_PASSED 2 SOPT_TEST_FAILED 1 SOPT_TEST_IN_PROGRESS 0 SOPT_PRE_TEST", + .sigs = sigs_264, + }, + { + .name = "DI_torqueDriver", + .address = 0x108, + .def_val = "-4096 SNA", + .sigs = sigs_264, + }, + { + .name = "DI_torqueMotor", + .address = 0x108, + .def_val = "-4096 SNA", + .sigs = sigs_264, + }, + { + .name = "DI_brakePedal", + .address = 0x118, + .def_val = "1 APPLIED 0 NOT_APPLIED", + .sigs = sigs_280, + }, + { + .name = "DI_brakePedalState", + .address = 0x118, + .def_val = "3 SNA 2 INVALID 1 ON 0 OFF", + .sigs = sigs_280, + }, + { + .name = "DI_epbInterfaceReady", + .address = 0x118, + .def_val = "1 EPB_INTERFACE_READY 0 EPB_INTERFACE_NOT_READY", + .sigs = sigs_280, + }, + { + .name = "DI_epbParkRequest", + .address = 0x118, + .def_val = "1 PARK_REQUESTED 0 NO_REQUEST", + .sigs = sigs_280, + }, + { + .name = "DI_gear", + .address = 0x118, + .def_val = "7 DI_GEAR_SNA 4 DI_GEAR_D 3 DI_GEAR_N 2 DI_GEAR_R 1 DI_GEAR_P 0 DI_GEAR_INVALID", + .sigs = sigs_280, + }, + { + .name = "DI_gearRequest", + .address = 0x118, + .def_val = "7 DI_GEAR_SNA 4 DI_GEAR_D 3 DI_GEAR_N 2 DI_GEAR_R 1 DI_GEAR_P 0 DI_GEAR_INVALID", + .sigs = sigs_280, + }, + { + .name = "DI_torqueEstimate", + .address = 0x118, + .def_val = "-2048 SNA", + .sigs = sigs_280, + }, + { + .name = "DI_torqueInterfaceFailure", + .address = 0x118, + .def_val = "1 TORQUE_INTERFACE_FAILED 0 TORQUE_INTERFACE_NORMAL", + .sigs = sigs_280, + }, + { + .name = "DI_vehicleSpeed", + .address = 0x118, + .def_val = "4095 SNA", + .sigs = sigs_280, + }, + { + .name = "ESP_absBrakeEvent", + .address = 0x135, + .def_val = "1 ACTIVE 0 NOT_ACTIVE", + .sigs = sigs_309, + }, + { + .name = "ESP_absFaultLamp", + .address = 0x135, + .def_val = "0 OFF 1 ON", + .sigs = sigs_309, + }, + { + .name = "ESP_brakeDiscWipingActive", + .address = 0x135, + .def_val = "1 ACTIVE 0 INACTIVE", + .sigs = sigs_309, + }, + { + .name = "ESP_brakeLamp", + .address = 0x135, + .def_val = "0 OFF 1 ON", + .sigs = sigs_309, + }, + { + .name = "ESP_espFaultLamp", + .address = 0x135, + .def_val = "0 OFF 1 ON", + .sigs = sigs_309, + }, + { + .name = "ESP_espLampFlash", + .address = 0x135, + .def_val = "1 FLASH 0 OFF", + .sigs = sigs_309, + }, + { + .name = "ESP_espOffLamp", + .address = 0x135, + .def_val = "0 OFF 1 ON", + .sigs = sigs_309, + }, + { + .name = "ESP_hillStartAssistActive", + .address = 0x135, + .def_val = "1 ACTIVE 0 INACTIVE 2 NOT_AVAILABLE 3 SNA", + .sigs = sigs_309, + }, + { + .name = "ESP_stabilityControlSts", + .address = 0x135, + .def_val = "2 ENGAGED 3 FAULTED 5 INIT 4 NOT_CONFIGURED 0 OFF 1 ON", + .sigs = sigs_309, + }, + { + .name = "ESP_tcLampFlash", + .address = 0x135, + .def_val = "1 FLASH 0 OFF", + .sigs = sigs_309, + }, + { + .name = "DAS_locAccelMax", + .address = 0x209, + .def_val = "511 SNA", + .sigs = sigs_521, + }, + { + .name = "DAS_locAccelMin", + .address = 0x209, + .def_val = "511 SNA", + .sigs = sigs_521, + }, + { + .name = "DAS_locJerkMax", + .address = 0x209, + .def_val = "255 SNA", + .sigs = sigs_521, + }, + { + .name = "DAS_locJerkMin", + .address = 0x209, + .def_val = "255 SNA", + .sigs = sigs_521, + }, + { + .name = "DAS_locMode", + .address = 0x209, + .def_val = "3 DAS_LOC_DRIVERLESS 2 DAS_LOC_RESTRICTED 1 DAS_LOC_NORMAL 0 DAS_LOC_OFF", + .sigs = sigs_521, + }, + { + .name = "DAS_locRequest", + .address = 0x209, + .def_val = "4 DAS_RQ_PARK 3 DAS_RQ_HOLD 2 DAS_RQ_BACKWARD 1 DAS_RQ_FORWARD 0 DAS_RQ_IDLE", + .sigs = sigs_521, + }, + { + .name = "DAS_locSpeed", + .address = 0x209, + .def_val = "2047 SNA", + .sigs = sigs_521, + }, + { + .name = "DAS_locState", + .address = 0x209, + .def_val = "7 DAS_LOC_FAULT_SNA 6 DAS_LOC_AEB_ACTIVE 2 DAS_LOC_CANCEL_SILENT 1 DAS_LOC_CANCEL_GENERIC 0 DAS_LOC_HEALTHY", + .sigs = sigs_521, + }, + { + .name = "driverBrakeStatus", + .address = 0x20A, + .def_val = "2 APPLIED 1 NOT_APPLIED", + .sigs = sigs_522, + }, + { + .name = "DAS_eacState", + .address = 0x219, + .def_val = "4 SNA 3 EAC_FAULT 2 EAC_ACTIVE 1 EAC_AVAILABLE 0 EAC_INHIBITED", + .sigs = sigs_537, + }, + { + .name = "DAS_pscParkState", + .address = 0x219, + .def_val = "15 SNA 14 SUMMON 10 PAUSE 9 SEARCH 8 COMPLETE 7 ABORT 6 PARALLEL_PULL_OUT_TO_RIGHT 5 PARALLEL_PULL_OUT_TO_LEFT 4 PARK_RIGHT_CROSS 3 PARK_RIGHT_PARALLEL 2 PARK_LEFT_CROSS 1 PARK_LEFT_PARALLEL 0 NONE", + .sigs = sigs_537, + }, + { + .name = "UI_mapSpeedLimit", + .address = 0x238, + .def_val = "31 SNA 30 UNLIMITED 29 LESS_OR_EQ_160 28 LESS_OR_EQ_150 27 LESS_OR_EQ_140 26 LESS_OR_EQ_130 25 LESS_OR_EQ_120 24 LESS_OR_EQ_115 23 LESS_OR_EQ_110 22 LESS_OR_EQ_105 21 LESS_OR_EQ_100 20 LESS_OR_EQ_95 19 LESS_OR_EQ_90 18 LESS_OR_EQ_85 17 LESS_OR_EQ_80 16 LESS_OR_EQ_75 15 LESS_OR_EQ_70 14 LESS_OR_EQ_65 13 LESS_OR_EQ_60 12 LESS_OR_EQ_55 11 LESS_OR_EQ_50 10 LESS_OR_EQ_45 9 LESS_OR_EQ_40 8 LESS_OR_EQ_35 7 LESS_OR_EQ_30 6 LESS_OR_EQ_25 5 LESS_OR_EQ_20 4 LESS_OR_EQ_15 3 LESS_OR_EQ_10 2 LESS_OR_EQ_7 1 LESS_OR_EQ_5 0 UNKNOWN", + .sigs = sigs_568, + }, + { + .name = "DAS_leftFork", + .address = 0x239, + .def_val = "3 LEFT_FORK_UNAVAILABLE 2 LEFT_FORK_SELECTED 1 LEFT_FORK_AVAILABLE 0 LEFT_FORK_NONE", + .sigs = sigs_569, + }, + { + .name = "DAS_leftLineUsage", + .address = 0x239, + .def_val = "3 BLACKLISTED 2 FUSED 1 AVAILABLE 0 REJECTED_UNAVAILABLE", + .sigs = sigs_569, + }, + { + .name = "DAS_rightFork", + .address = 0x239, + .def_val = "3 RIGHT_FORK_UNAVAILABLE 2 RIGHT_FORK_SELECTED 1 RIGHT_FORK_AVAILABLE 0 RIGHT_FORK_NONE", + .sigs = sigs_569, + }, + { + .name = "DAS_rightLineUsage", + .address = 0x239, + .def_val = "3 BLACKLISTED 2 FUSED 1 AVAILABLE 0 REJECTED_UNAVAILABLE", + .sigs = sigs_569, + }, + { + .name = "AirTemp_Insd", + .address = 0x283, + .def_val = "255 SNA", + .sigs = sigs_643, + }, + { + .name = "AirTemp_Outsd", + .address = 0x283, + .def_val = "254 INIT 255 SNA", + .sigs = sigs_643, + }, + { + .name = "Bckl_Sw_RL_Stat_SAM_R", + .address = 0x283, + .def_val = "2 FLT 1 NOT 0 OK 3 SNA", + .sigs = sigs_643, + }, + { + .name = "Bckl_Sw_RM_Stat_SAM_R", + .address = 0x283, + .def_val = "2 FLT 1 NOT 0 OK 3 SNA", + .sigs = sigs_643, + }, + { + .name = "Bckl_Sw_RR_Stat_SAM_R", + .address = 0x283, + .def_val = "2 FLT 1 NOT 0 OK 3 SNA", + .sigs = sigs_643, + }, + { + .name = "DL_RLtch_Stat", + .address = 0x283, + .def_val = "1 CLS 0 NDEF0 2 OPN 3 SNA", + .sigs = sigs_643, + }, + { + .name = "DrRLtch_FL_Stat", + .address = 0x283, + .def_val = "1 CLS 0 NDEF0 2 OPN 3 SNA", + .sigs = sigs_643, + }, + { + .name = "DrRLtch_FR_Stat", + .address = 0x283, + .def_val = "1 CLS 0 NDEF0 2 OPN 3 SNA", + .sigs = sigs_643, + }, + { + .name = "DrRLtch_RL_Stat", + .address = 0x283, + .def_val = "1 CLS 0 NDEF0 2 OPN 3 SNA", + .sigs = sigs_643, + }, + { + .name = "DrRLtch_RR_Stat", + .address = 0x283, + .def_val = "1 CLS 0 NDEF0 2 OPN 3 SNA", + .sigs = sigs_643, + }, + { + .name = "EngHd_Stat", + .address = 0x283, + .def_val = "1 CLS 0 NDEF0 2 OPN 3 SNA", + .sigs = sigs_643, + }, + { + .name = "LgtSens_Night", + .address = 0x283, + .def_val = "0 DAY 1 NIGHT", + .sigs = sigs_643, + }, + { + .name = "MPkBrk_Stat", + .address = 0x283, + .def_val = "1 ENGG 0 RELS", + .sigs = sigs_643, + }, + { + .name = "RevGr_Engg", + .address = 0x283, + .def_val = "0 DISENGG 1 ENGG 2 NDEF2 3 SNA", + .sigs = sigs_643, + }, + { + .name = "StW_Cond_Stat", + .address = 0x283, + .def_val = "3 BLINK 1 NDEF1 0 OFF 2 ON", + .sigs = sigs_643, + }, + { + .name = "Trlr_Stat", + .address = 0x283, + .def_val = "2 NDEF2 0 NONE 1 OK 3 SNA", + .sigs = sigs_643, + }, + { + .name = "DAS_accState", + .address = 0x2B9, + .def_val = "15 FAULT_SNA 14 ACC_CANCEL_OUT_OF_CALIBRATION 13 ACC_CANCEL_GENERIC_SILENT 12 ACC_CANCEL_PATH_NOT_CLEAR 11 APC_SELFPARK_START 10 APC_UNPARK_COMPLETE 9 APC_PAUSE 8 APC_ABORT 7 APC_COMPLETE 6 APC_FORWARD 5 APC_BACKWARD 4 ACC_ON 3 ACC_HOLD 2 ACC_CANCEL_RADAR_BLIND 1 ACC_CANCEL_CAMERA_BLIND 0 ACC_CANCEL_GENERIC", + .sigs = sigs_697, + }, + { + .name = "DAS_accelMax", + .address = 0x2B9, + .def_val = "511 SNA", + .sigs = sigs_697, + }, + { + .name = "DAS_accelMin", + .address = 0x2B9, + .def_val = "511 SNA", + .sigs = sigs_697, + }, + { + .name = "DAS_aebEvent", + .address = 0x2B9, + .def_val = "3 AEB_SNA 2 AEB_FAULT 1 AEB_ACTIVE 0 AEB_NOT_ACTIVE", + .sigs = sigs_697, + }, + { + .name = "DAS_jerkMax", + .address = 0x2B9, + .def_val = "255 SNA", + .sigs = sigs_697, + }, + { + .name = "DAS_jerkMin", + .address = 0x2B9, + .def_val = "511 SNA", + .sigs = sigs_697, + }, + { + .name = "DAS_setSpeed", + .address = 0x2B9, + .def_val = "4095 SNA", + .sigs = sigs_697, + }, + { + .name = "UI_mapSpeedLimitUnits", + .address = 0x2F8, + .def_val = "1 KPH 0 MPH", + .sigs = sigs_760, + }, + { + .name = "UI_userSpeedOffsetUnits", + .address = 0x2F8, + .def_val = "1 KPH 0 MPH", + .sigs = sigs_760, + }, + { + .name = "DAS_cutinVehDx", + .address = 0x309, + .def_val = "255 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_cutinVehHeading", + .address = 0x309, + .def_val = "255 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_cutinVehId", + .address = 0x309, + .def_val = "127 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_cutinVehType", + .address = 0x309, + .def_val = "5 PEDESTRIAN 4 BICYCLE 3 MOTORCYCLE 2 CAR 1 TRUCK 0 UNKNOWN", + .sigs = sigs_777, + }, + { + .name = "DAS_cutinVehVxRel", + .address = 0x309, + .def_val = "15 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leadVeh2Dx", + .address = 0x309, + .def_val = "255 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leadVeh2Heading", + .address = 0x309, + .def_val = "255 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leadVeh2Id", + .address = 0x309, + .def_val = "0 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leadVeh2Type", + .address = 0x309, + .def_val = "5 PEDESTRIAN 4 BICYCLE 3 MOTORCYCLE 2 CAR 1 TRUCK 0 UNKNOWN", + .sigs = sigs_777, + }, + { + .name = "DAS_leadVeh2VxRel", + .address = 0x309, + .def_val = "15 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leadVehDx", + .address = 0x309, + .def_val = "255 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leadVehHeading", + .address = 0x309, + .def_val = "255 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leadVehId", + .address = 0x309, + .def_val = "127 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leadVehType", + .address = 0x309, + .def_val = "6 IPSO 5 PEDESTRIAN 4 BICYCLE 3 MOTORCYCLE 2 CAR 1 TRUCK 0 UNKNOWN", + .sigs = sigs_777, + }, + { + .name = "DAS_leadVehVxRel", + .address = 0x309, + .def_val = "15 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leftVeh2Dx", + .address = 0x309, + .def_val = "255 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leftVeh2Heading", + .address = 0x309, + .def_val = "255 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leftVeh2Id", + .address = 0x309, + .def_val = "0 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leftVeh2Type", + .address = 0x309, + .def_val = "5 PEDESTRIAN 4 BICYCLE 3 MOTORCYCLE 2 CAR 1 TRUCK 0 UNKNOWN", + .sigs = sigs_777, + }, + { + .name = "DAS_leftVeh2VxRel", + .address = 0x309, + .def_val = "15 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leftVehDx", + .address = 0x309, + .def_val = "255 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leftVehHeading", + .address = 0x309, + .def_val = "255 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leftVehId", + .address = 0x309, + .def_val = "127 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_leftVehType", + .address = 0x309, + .def_val = "5 PEDESTRIAN 4 BICYCLE 3 MOTORCYCLE 2 CAR 1 TRUCK 0 UNKNOWN", + .sigs = sigs_777, + }, + { + .name = "DAS_leftVehVxRel", + .address = 0x309, + .def_val = "15 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_objectId", + .address = 0x309, + .def_val = "5 VEHICLE_HEADINGS 4 ROAD_SIGN 3 CUTIN_VEHICLE 2 RIGHT_VEHICLES 1 LEFT_VEHICLES 0 LEAD_VEHICLES", + .sigs = sigs_777, + }, + { + .name = "DAS_rightVeh2Dx", + .address = 0x309, + .def_val = "255 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_rightVeh2Heading", + .address = 0x309, + .def_val = "255 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_rightVeh2Id", + .address = 0x309, + .def_val = "0 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_rightVeh2Type", + .address = 0x309, + .def_val = "5 PEDESTRIAN 4 BICYCLE 3 MOTORCYCLE 2 CAR 1 TRUCK 0 UNKNOWN", + .sigs = sigs_777, + }, + { + .name = "DAS_rightVeh2VxRel", + .address = 0x309, + .def_val = "15 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_rightVehDx", + .address = 0x309, + .def_val = "255 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_rightVehHeading", + .address = 0x309, + .def_val = "255 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_rightVehId", + .address = 0x309, + .def_val = "127 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_rightVehType", + .address = 0x309, + .def_val = "5 PEDESTRIAN 4 BICYCLE 3 MOTORCYCLE 2 CAR 1 TRUCK 0 UNKNOWN", + .sigs = sigs_777, + }, + { + .name = "DAS_rightVehVxRel", + .address = 0x309, + .def_val = "15 SNA", + .sigs = sigs_777, + }, + { + .name = "DAS_roadSignArrow", + .address = 0x309, + .def_val = "4 UNKNOWN 3 STRAIGHT 2 RIGHT 1 LEFT 0 CIRCLE", + .sigs = sigs_777, + }, + { + .name = "DAS_roadSignColor", + .address = 0x309, + .def_val = "4 RED_YELLOW 3 GREEN 2 YELLOW 1 RED 0 NONE", + .sigs = sigs_777, + }, + { + .name = "DAS_roadSignId", + .address = 0x309, + .def_val = "255 SNA 1 TRAFFIC_LIGHT 0 STOP_SIGN", + .sigs = sigs_777, + }, + { + .name = "DAS_roadSignOrientation", + .address = 0x309, + .def_val = "2 HORIZONTAL_3_LIGHT 1 VERTICAL_3_LIGHT 0 UNKNOWN", + .sigs = sigs_777, + }, + { + .name = "DAS_roadSignSource", + .address = 0x309, + .def_val = "2 VISION 1 NAV 0 NONE", + .sigs = sigs_777, + }, + { + .name = "DAS_roadSignStopLineDist", + .address = 0x309, + .def_val = "1023 SNA", + .sigs = sigs_777, + }, + { + .name = "PARK_autoCalComplete", + .address = 0x30E, + .def_val = "1 COMPLETE 0 INCOMPLETE", + .sigs = sigs_782, + }, + { + .name = "PARK_geometryType", + .address = 0x30E, + .def_val = "2 MODELX 1 MODELS_2 0 MODELS", + .sigs = sigs_782, + }, + { + .name = "PARK_pscLeftCurbType", + .address = 0x30E, + .def_val = "2 HIGH_CURB 1 LOW_CURB 0 VIRTUAL_CURB", + .sigs = sigs_782, + }, + { + .name = "PARK_pscRightCurbType", + .address = 0x30E, + .def_val = "2 HIGH_CURB 1 LOW_CURB 0 VIRTUAL_CURB", + .sigs = sigs_782, + }, + { + .name = "PARK_rackDetected", + .address = 0x30E, + .def_val = "3 SNA 2 RACK_DETECTED 1 NO_RACK 0 UNKNOWN", + .sigs = sigs_782, + }, + { + .name = "PARK_sdiActive", + .address = 0x30E, + .def_val = "1 SDI_ENABLED 0 SDI_DISABLED", + .sigs = sigs_782, + }, + { + .name = "PARK_sdiBlindSpotLeft", + .address = 0x30E, + .def_val = "3 SNA 2 UNUSED 1 WARNING 0 NO_WARNING", + .sigs = sigs_782, + }, + { + .name = "PARK_sdiBlindSpotRight", + .address = 0x30E, + .def_val = "3 SNA 2 UNUSED 1 WARNING 0 NO_WARNING", + .sigs = sigs_782, + }, + { + .name = "PARK_sdiNoise", + .address = 0x30E, + .def_val = "3 SDI_NOISE_SNA 2 SDI_NOISE_RAIN 1 SDI_NOISE_HIGH 0 SDI_NOISE_NOMINAL", + .sigs = sigs_782, + }, + { + .name = "PARK_tireFitment", + .address = 0x30E, + .def_val = "3 SNA 1 STAGGERED 0 SQUARE", + .sigs = sigs_782, + }, + { + .name = "BOOT_STATE", + .address = 0x318, + .def_val = "2 INIT 3 SNA 0 CLOSED 1 OPEN", + .sigs = sigs_792, + }, + { + .name = "CERRD", + .address = 0x318, + .def_val = "1 CAN_ERROR_DETECT 0 NO_CAN_ERROR_DETECTED", + .sigs = sigs_792, + }, + { + .name = "DAY", + .address = 0x318, + .def_val = "1 INIT 0 SNA", + .sigs = sigs_792, + }, + { + .name = "DOOR_STATE_FL", + .address = 0x318, + .def_val = "2 INIT 3 SNA 0 CLOSED 1 OPEN", + .sigs = sigs_792, + }, + { + .name = "DOOR_STATE_FR", + .address = 0x318, + .def_val = "2 INIT 3 SNA 0 CLOSED 1 OPEN", + .sigs = sigs_792, + }, + { + .name = "DOOR_STATE_FrontTrunk", + .address = 0x318, + .def_val = "2 INIT 3 SNA 0 CLOSED 1 OPEN", + .sigs = sigs_792, + }, + { + .name = "DOOR_STATE_RL", + .address = 0x318, + .def_val = "2 INIT 3 SNA 0 CLOSED 1 OPEN", + .sigs = sigs_792, + }, + { + .name = "DOOR_STATE_RR", + .address = 0x318, + .def_val = "2 INIT 3 SNA 0 CLOSED 1 OPEN", + .sigs = sigs_792, + }, + { + .name = "GTW_updateInProgress", + .address = 0x318, + .def_val = "1 IN_PROGRESS 2 IN_PROGRESS_NOT_USED 3 IN_PROGRESS_SNA 0 NOT_IN_PROGRESS", + .sigs = sigs_792, + }, + { + .name = "Hour", + .address = 0x318, + .def_val = "30 INIT 31 SNA", + .sigs = sigs_792, + }, + { + .name = "MCU_factoryMode", + .address = 0x318, + .def_val = "1 FACTORY_MODE 0 NORMAL_MODE", + .sigs = sigs_792, + }, + { + .name = "MCU_transportModeOn", + .address = 0x318, + .def_val = "0 NORMAL_MODE", + .sigs = sigs_792, + }, + { + .name = "MINUTE", + .address = 0x318, + .def_val = "62 INIT 63 SNA", + .sigs = sigs_792, + }, + { + .name = "MONTH", + .address = 0x318, + .def_val = "1 INIT 15 SNA", + .sigs = sigs_792, + }, + { + .name = "SECOND", + .address = 0x318, + .def_val = "62 INIT 63 SNA", + .sigs = sigs_792, + }, + { + .name = "YEAR", + .address = 0x318, + .def_val = "126 INIT 127 SNA", + .sigs = sigs_792, + }, + { + .name = "DI_aebState", + .address = 0x368, + .def_val = "2 ENABLED 4 FAULT 7 SNA 1 STANDBY 3 STANDSTILL 0 UNAVAILABLE", + .sigs = sigs_872, + }, + { + .name = "DI_analogSpeed", + .address = 0x368, + .def_val = "4095 SNA", + .sigs = sigs_872, + }, + { + .name = "DI_cruiseState", + .address = 0x368, + .def_val = "2 ENABLED 5 FAULT 0 OFF 4 OVERRIDE 7 PRE_CANCEL 6 PRE_FAULT 1 STANDBY 3 STANDSTILL", + .sigs = sigs_872, + }, + { + .name = "DI_digitalSpeed", + .address = 0x368, + .def_val = "255 SNA", + .sigs = sigs_872, + }, + { + .name = "DI_immobilizerState", + .address = 0x368, + .def_val = "2 AUTHENTICATING 3 DISARMED 6 FAULT 4 IDLE 0 INIT_SNA 1 REQUEST 5 RESET", + .sigs = sigs_872, + }, + { + .name = "DI_speedUnits", + .address = 0x368, + .def_val = "1 KPH 0 MPH", + .sigs = sigs_872, + }, + { + .name = "DI_state", + .address = 0x368, + .def_val = "3 ABORT 4 ENABLE 2 FAULT 1 STANDBY 0 UNAVAILABLE", + .sigs = sigs_872, + }, + { + .name = "DI_systemState", + .address = 0x368, + .def_val = "3 ABORT 4 ENABLE 2 FAULT 1 STANDBY 0 UNAVAILABLE", + .sigs = sigs_872, + }, + { + .name = "DI_vehicleHoldState", + .address = 0x368, + .def_val = "2 BLEND_IN 4 BLEND_OUT 6 FAULT 7 INIT 5 XXX 1 STANDBY 3 STANDSTILL 0 UNAVAILABLE", + .sigs = sigs_872, + }, + { + .name = "EPAS_currentTuneMode", + .address = 0x370, + .def_val = "1 DM_COMFORT 3 DM_SPORT 2 DM_STANDARD 0 FAIL_SAFE_DEFAULT 4 RWD_COMFORT 6 RWD_SPORT 5 RWD_STANDARD 7 UNAVAILABLE", + .sigs = sigs_880, + }, + { + .name = "EPAS_eacErrorCode", + .address = 0x370, + .def_val = "14 EAC_ERROR_EPB_INHIBIT 3 EAC_ERROR_HANDS_ON 7 EAC_ERROR_HIGH_ANGLE_RATE_REQ 9 EAC_ERROR_HIGH_ANGLE_RATE_SAFETY 6 EAC_ERROR_HIGH_ANGLE_REQ 8 EAC_ERROR_HIGH_ANGLE_SAFETY 10 EAC_ERROR_HIGH_MMOT_SAFETY 11 EAC_ERROR_HIGH_TORSION_SAFETY 0 EAC_ERROR_IDLE 12 EAC_ERROR_LOW_ASSIST 2 EAC_ERROR_MAX_SPEED 1 EAC_ERROR_MIN_SPEED 13 EAC_ERROR_PINION_VEL_DIFF 4 EAC_ERROR_TMP_FAULT 5 EAR_ERROR_MAX_STEER_DELTA 15 SNA", + .sigs = sigs_880, + }, + { + .name = "EPAS_eacStatus", + .address = 0x370, + .def_val = "2 EAC_ACTIVE 1 EAC_AVAILABLE 3 EAC_FAULT 0 EAC_INHIBITED 4 SNA", + .sigs = sigs_880, + }, + { + .name = "EPAS_handsOnLevel", + .address = 0x370, + .def_val = "0 0 1 1 2 2 3 3", + .sigs = sigs_880, + }, + { + .name = "EPAS_steeringFault", + .address = 0x370, + .def_val = "1 FAULT 0 NO_FAULT", + .sigs = sigs_880, + }, + { + .name = "EPAS_steeringRackForce", + .address = 0x370, + .def_val = "1022 NOT_IN_SPEC 1023 SNA", + .sigs = sigs_880, + }, + { + .name = "EPAS_steeringReduced", + .address = 0x370, + .def_val = "0 NORMAL_ASSIST 1 REDUCED_ASSIST", + .sigs = sigs_880, + }, + { + .name = "EPAS_torsionBarTorque", + .address = 0x370, + .def_val = "0 SEE_SPECIFICATION 4095 SNA 4094 UNDEFINABLE_DATA", + .sigs = sigs_880, + }, + { + .name = "MCU_clusterReadyForDrive", + .address = 0x388, + .def_val = "0 NO_SNA 1 YES", + .sigs = sigs_904, + }, + { + .name = "DAS_ACC_report", + .address = 0x389, + .def_val = "24 ACC_REPORT_BEHAVIOR_REPORT 23 ACC_REPORT_CAMERA_ONLY 22 ACC_REPORT_RADAR_OBJ_FIVE 21 ACC_REPORT_CIPV_CUTTING_OUT 20 ACC_REPORT_MCVLR_IN_PATH 19 ACC_REPORT_MCVLR_DPP 18 ACC_REPORT_FLEET_SPEEDS 17 ACC_REPORT_TARGET_MCP 16 ACC_REPORT_RADAR_OBJ_TWO 15 ACC_REPORT_RADAR_OBJ_ONE 14 ACC_REPORT_LC_EXTERNAL_STATE_ACTIVE_RESTRICTED 13 ACC_REPORT_LC_EXTERNAL_STATE_ABORTED 12 ACC_REPORT_LC_EXTERNAL_STATE_ABORTING 11 ACC_REPORT_LC_HANDS_ON_REQD_STRUCK_OUT 10 ACC_REPORT_CSA 9 ACC_REPORT_TARGET_TYPE_FAULT 8 ACC_REPORT_TARGET_TYPE_IPSO 7 ACC_REPORT_TARGET_TYPE_TRAFFIC_LIGHT 6 ACC_REPORT_TARGET_TYPE_STOP_SIGN 5 ACC_REPORT_TARGET_CUTIN 4 ACC_REPORT_TARGET_MCVR 3 ACC_REPORT_TARGET_MCVL 2 ACC_REPORT_TARGET_IN_FRONT_OF_CIPV 1 ACC_REPORT_TARGET_CIPV 0 ACC_REPORT_TARGET_NONE", + .sigs = sigs_905, + }, + { + .name = "DAS_accSpeedLimit", + .address = 0x389, + .def_val = "1023 SNA 0 NONE", + .sigs = sigs_905, + }, + { + .name = "DAS_activationFailureStatus", + .address = 0x389, + .def_val = "2 LC_ACTIVATION_FAILED_2 1 LC_ACTIVATION_FAILED_1 0 LC_ACTIVATION_IDLE", + .sigs = sigs_905, + }, + { + .name = "DAS_csaState", + .address = 0x389, + .def_val = "3 CSA_EXTERNAL_STATE_HOLD 2 CSA_EXTERNAL_STATE_ENABLE 1 CSA_EXTERNAL_STATE_AVAILABLE 0 CSA_EXTERNAL_STATE_UNAVAILABLE", + .sigs = sigs_905, + }, + { + .name = "DAS_driverInteractionLevel", + .address = 0x389, + .def_val = "2 CONTINUED_DRIVER_NOT_INTERACTING 1 DRIVER_NOT_INTERACTING 0 DRIVER_INTERACTING", + .sigs = sigs_905, + }, + { + .name = "DAS_longCollisionWarning", + .address = 0x389, + .def_val = "15 FCM_LONG_COLLISION_WARNING_SNA 12 FCM_LONG_COLLISION_WARNING_VEHICLE_CIPV2 11 FCM_LONG_COLLISION_WARNING_VEHICLE_MCVR2 10 FCM_LONG_COLLISION_WARNING_VEHICLE_MCVR 9 FCM_LONG_COLLISION_WARNING_VEHICLE_MCVL2 8 FCM_LONG_COLLISION_WARNING_VEHICLE_MCVL 7 FCM_LONG_COLLISION_WARNING_VEHICLE_CUTIN 6 FCM_LONG_COLLISION_WARNING_VEHICLE_CIPV 5 FCM_LONG_COLLISION_WARNING_TFL_STOPLINE 4 FCM_LONG_COLLISION_WARNING_STOPSIGN_STOPLINE 3 FCM_LONG_COLLISION_WARNING_IPSO 2 FCM_LONG_COLLISION_WARNING_PEDESTRIAN 1 FCM_LONG_COLLISION_WARNING_VEHICLE_UNKNOWN 0 FCM_LONG_COLLISION_WARNING_NONE", + .sigs = sigs_905, + }, + { + .name = "DAS_pmmCameraFaultReason", + .address = 0x389, + .def_val = "2 PMM_CAMERA_INVALID_MIA 1 PMM_CAMERA_BLOCKED_FRONT 0 PMM_CAMERA_NO_FAULT", + .sigs = sigs_905, + }, + { + .name = "DAS_pmmLoggingRequest", + .address = 0x389, + .def_val = "1 TRUE 0 FALSE", + .sigs = sigs_905, + }, + { + .name = "DAS_pmmObstacleSeverity", + .address = 0x389, + .def_val = "7 PMM_SNA 6 PMM_ACCEL_LIMIT 5 PMM_CRASH_FRONT 4 PMM_CRASH_REAR 3 PMM_BRAKE_REQUEST 2 PMM_IMMINENT_FRONT 1 PMM_IMMINENT_REAR 0 PMM_NONE", + .sigs = sigs_905, + }, + { + .name = "DAS_pmmRadarFaultReason", + .address = 0x389, + .def_val = "2 PMM_RADAR_INVALID_MIA 1 PMM_RADAR_BLOCKED_FRONT 0 PMM_RADAR_NO_FAULT", + .sigs = sigs_905, + }, + { + .name = "DAS_pmmSysFaultReason", + .address = 0x389, + .def_val = "7 PMM_FAULT_BRAKE_PEDAL_INHIBIT 6 PMM_FAULT_ROAD_TYPE 5 PMM_FAULT_DISABLED_BY_USER 4 PMM_FAULT_STEERING_ANGLE_RATE 3 PMM_FAULT_DI_FAULT 2 PMM_FAULT_SPEED 1 PMM_FAULT_DAS_DISABLED 0 PMM_FAULT_NONE", + .sigs = sigs_905, + }, + { + .name = "DAS_pmmUltrasonicsFaultReason", + .address = 0x389, + .def_val = "4 PMM_ULTRASONICS_INVALID_MIA 3 PMM_ULTRASONICS_BLOCKED_BOTH 2 PMM_ULTRASONICS_BLOCKED_REAR 1 PMM_ULTRASONICS_BLOCKED_FRONT 0 PMM_ULTRASONICS_NO_FAULT", + .sigs = sigs_905, + }, + { + .name = "DAS_ppOffsetDesiredRamp", + .address = 0x389, + .def_val = "128 PP_NO_OFFSET", + .sigs = sigs_905, + }, + { + .name = "DAS_radarTelemetry", + .address = 0x389, + .def_val = "2 RADAR_TELEMETRY_URGENT 1 RADAR_TELEMETRY_NORMAL 0 RADAR_TELEMETRY_IDLE", + .sigs = sigs_905, + }, + { + .name = "DAS_robState", + .address = 0x389, + .def_val = "3 ROB_STATE_MAPLESS 2 ROB_STATE_ACTIVE 1 ROB_STATE_MEASURE 0 ROB_STATE_INHIBITED", + .sigs = sigs_905, + }, + { + .name = "DAS_autoLaneChangeState", + .address = 0x399, + .def_val = "31 ALC_SNA 30 ALC_ABORT_MISSION_PLAN_INVALID 29 ALC_ABORT_TIMEOUT 28 ALC_WAITING_HANDS_ON 27 ALC_BLOCKED_LANE_TYPE_R 26 ALC_BLOCKED_LANE_TYPE_L 25 ALC_BLOCKED_VEH_TTC_AND_USS_R 24 ALC_BLOCKED_VEH_TTC_R 23 ALC_BLOCKED_VEH_TTC_AND_USS_L 22 ALC_BLOCKED_VEH_TTC_L 21 ALC_UNAVAILABLE_SOLID_LANE_LINE 20 ALC_ABORT_OTHER_REASON 19 ALC_ABORT_BLINKER_TURNED_OFF 18 ALC_ABORT_LC_HEALTH_BAD 17 ALC_ABORT_POOR_VIEW_RANGE 16 ALC_ABORT_SIDE_OBSTACLE_PRESENT_R 15 ALC_ABORT_SIDE_OBSTACLE_PRESENT_L 14 ALC_WAITING_FOR_FWD_OBST_TO_PASS_R 13 ALC_WAITING_FOR_FWD_OBST_TO_PASS_L 12 ALC_WAITING_FOR_SIDE_OBST_TO_PASS_R 11 ALC_WAITING_FOR_SIDE_OBST_TO_PASS_L 10 ALC_IN_PROGRESS_R 9 ALC_IN_PROGRESS_L 8 ALC_AVAILABLE_BOTH 7 ALC_AVAILABLE_ONLY_R 6 ALC_AVAILABLE_ONLY_L 5 ALC_UNAVAILABLE_VEHICLE_SPEED 4 ALC_UNAVAILABLE_EXITING_HIGHWAY 3 ALC_UNAVAILABLE_TP_FOLLOW 2 ALC_UNAVAILABLE_SONICS_INVALID 1 ALC_UNAVAILABLE_NO_LANES 0 ALC_UNAVAILABLE_DISABLED", + .sigs = sigs_921, + }, + { + .name = "DAS_autoparkReady", + .address = 0x399, + .def_val = "1 AUTOPARK_READY 0 AUTOPARK_UNAVAILABLE", + .sigs = sigs_921, + }, + { + .name = "DAS_autopilotHandsOnState", + .address = 0x399, + .def_val = "15 LC_HANDS_ON_SNA 8 LC_HANDS_ON_SUSPENDED 7 LC_HANDS_ON_REQD_STRUCK_OUT 5 LC_HANDS_ON_REQD_CHIME_2 4 LC_HANDS_ON_REQD_CHIME_1 3 LC_HANDS_ON_REQD_VISUAL 2 LC_HANDS_ON_REQD_NOT_DETECTED 1 LC_HANDS_ON_REQD_DETECTED 0 LC_HANDS_ON_NOT_REQD", + .sigs = sigs_921, + }, + { + .name = "DAS_autopilotState", + .address = 0x399, + .def_val = "5 ACTIVE_NAVIGATE_ON_AUTOPILOT 4 ACTIVE_2 3 ACTIVE_1 2 AVAILABLE 1 UNAVAILABLE 0 DISABLED", + .sigs = sigs_921, + }, + { + .name = "DAS_blindSpotRearLeft", + .address = 0x399, + .def_val = "3 SNA 2 WARNING_LEVEL_2 1 WARNING_LEVEL_1 0 NO_WARNING", + .sigs = sigs_921, + }, + { + .name = "DAS_blindSpotRearRight", + .address = 0x399, + .def_val = "3 SNA 2 WARNING_LEVEL_2 1 WARNING_LEVEL_1 0 NO_WARNING", + .sigs = sigs_921, + }, + { + .name = "DAS_fleetSpeedState", + .address = 0x399, + .def_val = "3 FLEETSPEED_HOLD 2 FLEETSPEED_ACTIVE 1 FLEETSPEED_AVAILABLE 0 FLEETSPEED_UNAVAILABLE", + .sigs = sigs_921, + }, + { + .name = "DAS_forwardCollisionWarning", + .address = 0x399, + .def_val = "3 SNA 1 FORWARD_COLLISION_WARNING 0 NONE", + .sigs = sigs_921, + }, + { + .name = "DAS_fusedSpeedLimit", + .address = 0x399, + .def_val = "31 NONE 0 UNKNOWN_SNA", + .sigs = sigs_921, + }, + { + .name = "DAS_heaterState", + .address = 0x399, + .def_val = "1 HEATER_ON 0 HEATER_OFF_SNA", + .sigs = sigs_921, + }, + { + .name = "DAS_laneDepartureWarning", + .address = 0x399, + .def_val = "5 SNA 4 RIGHT_WARNING_SEVERE 3 LEFT_WARNING_SEVERE 2 RIGHT_WARNING 1 LEFT_WARNING 0 NONE", + .sigs = sigs_921, + }, + { + .name = "DAS_lssState", + .address = 0x399, + .def_val = "7 LSS_STATE_OFF 6 LSS_STATE_ABORT 5 LSS_STATE_BLINDSPOT 4 LSS_STATE_MONITOR 3 LSS_STATE_ELK", + .sigs = sigs_921, + }, + { + .name = "DAS_sideCollisionAvoid", + .address = 0x399, + .def_val = "3 SNA 2 AVOID_RIGHT 1 AVOID_LEFT 0 NONE", + .sigs = sigs_921, + }, + { + .name = "DAS_sideCollisionInhibit", + .address = 0x399, + .def_val = "1 INHIBIT 0 NO_INHIBIT", + .sigs = sigs_921, + }, + { + .name = "DAS_sideCollisionWarning", + .address = 0x399, + .def_val = "3 WARN_LEFT_RIGHT 2 WARN_RIGHT 1 WARN_LEFT 0 NONE", + .sigs = sigs_921, + }, + { + .name = "DAS_suppressSpeedWarning", + .address = 0x399, + .def_val = "1 SUPPRESS_SPEED_WARNING 0 DO_NOT_SUPPRESS", + .sigs = sigs_921, + }, + { + .name = "DAS_visionOnlySpeedLimit", + .address = 0x399, + .def_val = "31 NONE 0 UNKNOWN_SNA", + .sigs = sigs_921, + }, + { + .name = "DAS_csaIntState", + .address = 0x3A9, + .def_val = "4 CSA_INTERNAL_STATE_ENABLE_HOLD 3 CSA_INTERNAL_STATE_ENABLE_ACCELEROMETER 2 CSA_INTERNAL_STATE_ENABLE_PREDICTED 1 CSA_INTERNAL_STATE_AVAILABLE 0 CSA_INTERNAL_STATE_UNAVAILABLE", + .sigs = sigs_937, + }, + { + .name = "DAS_soCamCipvStatus", + .address = 0x3A9, + .def_val = "3 CAM_CIPV_FUSED_W_RAD5 2 CAM_CIPV_FUSED_W_OTHER_RAD_OBJ 1 CAM_CIPV_UNFUSED 0 CAM_CIPV_INVALID", + .sigs = sigs_937, + }, + { + .name = "DAS_soRad1Status", + .address = 0x3A9, + .def_val = "3 RAD1_FUSED_W_OTHER_CAMOBJ 2 RAD1_FUSED_W_CIPV 1 RAD1_UNFUSED 0 RAD1_INVALID", + .sigs = sigs_937, + }, + { + .name = "DAS_soRad5Status", + .address = 0x3A9, + .def_val = "3 RAD5_FUSED_W_OTHER_CAMOBJ 2 RAD5_FUSED_W_CIPV 1 RAD5_UNFUSED 0 RAD5_INVALID", + .sigs = sigs_937, + }, + { + .name = "DAS_stopSignCIPVDistance", + .address = 0x3A9, + .def_val = "63 SNA", + .sigs = sigs_937, + }, + { + .name = "DAS_stopSignHeight", + .address = 0x3A9, + .def_val = "63 SNA", + .sigs = sigs_937, + }, + { + .name = "DAS_stopSignHostAccel", + .address = 0x3A9, + .def_val = "1023 SNA", + .sigs = sigs_937, + }, + { + .name = "DAS_stopSignLateralDist", + .address = 0x3A9, + .def_val = "255 SNA", + .sigs = sigs_937, + }, + { + .name = "DAS_stopSignLongitudinalDist", + .address = 0x3A9, + .def_val = "1023 SNA", + .sigs = sigs_937, + }, + { + .name = "DAS_stopSignStopLineDistance", + .address = 0x3A9, + .def_val = "1023 SNA", + .sigs = sigs_937, + }, + { + .name = "DAS_telLeftLaneCrossing", + .address = 0x3A9, + .def_val = "1 CROSSING 0 NOT_CROSSING", + .sigs = sigs_937, + }, + { + .name = "DAS_telLeftLaneType", + .address = 0x3A9, + .def_val = "6 BARRIER 5 BOTTS_DOTS 4 DOUBLE 3 DASHED 2 ROAD_EDGE 1 SOLID 0 UNDECIDED", + .sigs = sigs_937, + }, + { + .name = "DAS_telLeftMarkerColor", + .address = 0x3A9, + .def_val = "3 BLUE 2 YELLOW 1 WHITE 0 UNKNOWN", + .sigs = sigs_937, + }, + { + .name = "DAS_telLeftMarkerQuality", + .address = 0x3A9, + .def_val = "3 HIGH 2 MEDIUM 1 LOW 0 LOWEST", + .sigs = sigs_937, + }, + { + .name = "DAS_telRightLaneCrossing", + .address = 0x3A9, + .def_val = "1 CROSSING 0 NOT_CROSSING", + .sigs = sigs_937, + }, + { + .name = "DAS_telRightLaneType", + .address = 0x3A9, + .def_val = "6 BARRIER 5 BOTTS_DOTS 4 DOUBLE 3 DASHED 2 ROAD_EDGE 1 SOLID 0 UNDECIDED", + .sigs = sigs_937, + }, + { + .name = "DAS_telRightMarkerColor", + .address = 0x3A9, + .def_val = "3 BLUE 2 YELLOW 1 WHITE 0 UNKNOWN", + .sigs = sigs_937, + }, + { + .name = "DAS_telRightMarkerQuality", + .address = 0x3A9, + .def_val = "3 HIGH 2 MEDIUM 1 LOW 0 LOWEST", + .sigs = sigs_937, + }, + { + .name = "DAS_telemetryMultiplexer", + .address = 0x3A9, + .def_val = "9 DAS_TELEMETRY_CRUISE_STALK_INPUT 8 DAS_TELEMETRY_STATIONARY_OBST 7 DAS_TELEMETRY_CSA_EVENT 2 DAS_TELEMETRY_TRAFFIC_SIGNS 1 DAS_TELEMETRY_ACC_DRIVER_MONITOR 0 DAS_TELEMETRY_ROAD_INFORMATION", + .sigs = sigs_937, + }, + { + .name = "DAS_hazardLightRequest", + .address = 0x3E9, + .def_val = "3 DAS_REQUEST_HAZARDS_SNA 2 DAS_REQUEST_HAZARDS_UNUSED 1 DAS_REQUEST_HAZARDS_ON 0 DAS_REQUEST_HAZARDS_OFF", + .sigs = sigs_1001, + }, + { + .name = "DAS_headlightRequest", + .address = 0x3E9, + .def_val = "3 DAS_HEADLIGHT_REQUEST_INVALID 1 DAS_HEADLIGHT_REQUEST_ON 0 DAS_HEADLIGHT_REQUEST_OFF", + .sigs = sigs_1001, + }, + { + .name = "DAS_highLowBeamDecision", + .address = 0x3E9, + .def_val = "3 DAS_HIGH_BEAM_SNA 2 DAS_HIGH_BEAM_ON 1 DAS_HIGH_BEAM_OFF 0 DAS_HIGH_BEAM_UNDECIDED", + .sigs = sigs_1001, + }, + { + .name = "DAS_highLowBeamOffReason", + .address = 0x3E9, + .def_val = "5 HIGH_BEAM_OFF_REASON_SNA 4 HIGH_BEAM_OFF_REASON_HEAD_LIGHT 3 HIGH_BEAM_OFF_REASON_AMBIENT_LIGHT 2 HIGH_BEAM_OFF_REASON_MOVING_RADAR_TARGET 1 HIGH_BEAM_OFF_REASON_MOVING_VISION_TARGET 0 HIGH_BEAM_ON", + .sigs = sigs_1001, + }, + { + .name = "DAS_turnIndicatorRequest", + .address = 0x3E9, + .def_val = "3 DAS_TURN_INDICATOR_CANCEL 2 DAS_TURN_INDICATOR_RIGHT 1 DAS_TURN_INDICATOR_LEFT 0 DAS_TURN_INDICATOR_NONE", + .sigs = sigs_1001, + }, + { + .name = "DAS_turnIndicatorRequestReason", + .address = 0x3E9, + .def_val = "6 DAS_ACTIVE_COMMANDED_LANE_CHANGE 5 DAS_CANCEL_FORK 4 DAS_CANCEL_LANE_CHANGE 3 DAS_ACTIVE_FORK 2 DAS_ACTIVE_SPEED_LANE_CHANGE 1 DAS_ACTIVE_NAV_LANE_CHANGE 0 DAS_NONE", + .sigs = sigs_1001, + }, + { + .name = "DAS_wiperSpeed", + .address = 0x3E9, + .def_val = "15 DAS_WIPER_SPEED_INVALID 14 DAS_WIPER_SPEED_14 13 DAS_WIPER_SPEED_13 12 DAS_WIPER_SPEED_12 11 DAS_WIPER_SPEED_11 10 DAS_WIPER_SPEED_10 9 DAS_WIPER_SPEED_9 8 DAS_WIPER_SPEED_8 7 DAS_WIPER_SPEED_7 6 DAS_WIPER_SPEED_6 5 DAS_WIPER_SPEED_5 4 DAS_WIPER_SPEED_4 3 DAS_WIPER_SPEED_3 2 DAS_WIPER_SPEED_2 1 DAS_WIPER_SPEED_1 0 DAS_WIPER_SPEED_OFF", + .sigs = sigs_1001, + }, + { + .name = "DAS_steeringAngleRequest", + .address = 0x488, + .def_val = "16384 ZERO_ANGLE", + .sigs = sigs_1160, + }, + { + .name = "DAS_steeringControlType", + .address = 0x488, + .def_val = "1 ANGLE_CONTROL 3 DISABLED 0 NONE 2 RESERVED", + .sigs = sigs_1160, + }, + { + .name = "DAS_steeringHapticRequest", + .address = 0x488, + .def_val = "1 ACTIVE 0 IDLE", + .sigs = sigs_1160, + }, + { + .name = "STATE", + .address = 0x552, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_1362, + }, +}; + +} + +const DBC tesla_can_pre1916 = { + .name = "tesla_can_pre1916", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(tesla_can_pre1916) \ No newline at end of file diff --git a/opendbc/can/dbc_out/tesla_powertrain.cc b/opendbc/can/dbc_out/tesla_powertrain.cc new file mode 100644 index 000000000..6536d7b50 --- /dev/null +++ b/opendbc/can/dbc_out/tesla_powertrain.cc @@ -0,0 +1,1160 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_262[] = { + { + .name = "DI_torqueDriver", + .b1 = 0, + .b2 = 13, + .bo = 51, + .is_signed = true, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torque1Counter", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torqueMotor", + .b1 = 16, + .b2 = 13, + .bo = 35, + .is_signed = true, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_soptState", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_motorRPM", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_pedalPos", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.4, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torque1Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_278[] = { + { + .name = "DI_torqueEstimate", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = true, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_gear", + .b1 = 12, + .b2 = 3, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_brakePedal", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_vehicleSpeed", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.05, + .offset = -25.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_gearRequest", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torqueInterfaceFailure", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torque2Counter", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_brakePedalState", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_epbParkRequest", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_epbInterfaceReady", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_torque2Checksum", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_504[] = { + { + .name = "driverBrakeStatus", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_568[] = { + { + .name = "SpdCtrlLvr_Stat", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VSL_Enbl_Rq", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SpdCtrlLvrStat_Inv", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DTR_Dist_Rq", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TurnIndLvr_Stat", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HiBmLvr_Stat", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WprWashSw_Psd", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WprWash_R_Sw_Posn_V2", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Lvr_Stat", + .b1 = 24, + .b2 = 3, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Cond_Flt", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Cond_Psd", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HrnSw_Psd", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw00_Psd", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw01_Psd", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw02_Psd", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw03_Psd", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw04_Psd", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw05_Psd", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw06_Psd", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw07_Psd", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw08_Psd", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw09_Psd", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw10_Psd", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw11_Psd", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw12_Psd", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw13_Psd", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw14_Psd", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "StW_Sw15_Psd", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WprSw6Posn", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MC_STW_ACTN_RQ", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRC_STW_ACTN_RQ", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_598[] = { + { + .name = "DI_systemState", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_vehicleHoldState", + .b1 = 3, + .b2 = 3, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_proximity", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_driveReady", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_regenLight", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_state", + .b1 = 9, + .b2 = 3, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_cruiseState", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_analogSpeed", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_immobilizerState", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_speedUnits", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_cruiseSet", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_aebState", + .b1 = 41, + .b2 = 3, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_stateCounter", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_digitalSpeed", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_stateChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_703[] = { + { + .name = "DAS_setSpeed", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_accState", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_aebEvent", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_jerkMin", + .b1 = 18, + .b2 = 9, + .bo = 37, + .is_signed = false, + .factor = 0.03, + .offset = -15.232, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_jerkMax", + .b1 = 27, + .b2 = 8, + .bo = 29, + .is_signed = false, + .factor = 0.059, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_accelMin", + .b1 = 35, + .b2 = 9, + .bo = 20, + .is_signed = false, + .factor = 0.04, + .offset = -15.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_accelMax", + .b1 = 44, + .b2 = 9, + .bo = 11, + .is_signed = false, + .factor = 0.04, + .offset = -15.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_controlCounter", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DAS_controlChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "DI_torque1", + .address = 0x106, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_262), + .sigs = sigs_262, + }, + { + .name = "DI_torque2", + .address = 0x116, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_278), + .sigs = sigs_278, + }, + { + .name = "BrakeMessage", + .address = 0x1F8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_504), + .sigs = sigs_504, + }, + { + .name = "STW_ACTN_RQ", + .address = 0x238, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_568), + .sigs = sigs_568, + }, + { + .name = "DI_state", + .address = 0x256, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_598), + .sigs = sigs_598, + }, + { + .name = "DAS_control", + .address = 0x2BF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_703), + .sigs = sigs_703, + }, +}; + +const Val vals[] = { + { + .name = "DI_motorRPM", + .address = 0x106, + .def_val = "-32768 SNA", + .sigs = sigs_262, + }, + { + .name = "DI_pedalPos", + .address = 0x106, + .def_val = "255 SNA", + .sigs = sigs_262, + }, + { + .name = "DI_soptState", + .address = 0x106, + .def_val = "7 SOPT_TEST_SNA 4 SOPT_TEST_NOT_RUN 3 SOPT_TEST_PASSED 2 SOPT_TEST_FAILED 1 SOPT_TEST_IN_PROGRESS 0 SOPT_PRE_TEST", + .sigs = sigs_262, + }, + { + .name = "DI_torqueDriver", + .address = 0x106, + .def_val = "-4096 SNA", + .sigs = sigs_262, + }, + { + .name = "DI_torqueMotor", + .address = 0x106, + .def_val = "-4096 SNA", + .sigs = sigs_262, + }, + { + .name = "DI_brakePedal", + .address = 0x116, + .def_val = "1 APPLIED 0 NOT_APPLIED", + .sigs = sigs_278, + }, + { + .name = "DI_brakePedalState", + .address = 0x116, + .def_val = "3 SNA 2 INVALID 1 ON 0 OFF", + .sigs = sigs_278, + }, + { + .name = "DI_epbInterfaceReady", + .address = 0x116, + .def_val = "1 EPB_INTERFACE_READY 0 EPB_INTERFACE_NOT_READY", + .sigs = sigs_278, + }, + { + .name = "DI_epbParkRequest", + .address = 0x116, + .def_val = "1 PARK_REQUESTED 0 NO_REQUEST", + .sigs = sigs_278, + }, + { + .name = "DI_gear", + .address = 0x116, + .def_val = "7 DI_GEAR_SNA 4 DI_GEAR_D 3 DI_GEAR_N 2 DI_GEAR_R 1 DI_GEAR_P 0 DI_GEAR_INVALID", + .sigs = sigs_278, + }, + { + .name = "DI_gearRequest", + .address = 0x116, + .def_val = "7 DI_GEAR_SNA 4 DI_GEAR_D 3 DI_GEAR_N 2 DI_GEAR_R 1 DI_GEAR_P 0 DI_GEAR_INVALID", + .sigs = sigs_278, + }, + { + .name = "DI_torqueEstimate", + .address = 0x116, + .def_val = "-2048 SNA", + .sigs = sigs_278, + }, + { + .name = "DI_torqueInterfaceFailure", + .address = 0x116, + .def_val = "1 TORQUE_INTERFACE_FAILED 0 TORQUE_INTERFACE_NORMAL", + .sigs = sigs_278, + }, + { + .name = "DI_vehicleSpeed", + .address = 0x116, + .def_val = "4095 SNA", + .sigs = sigs_278, + }, + { + .name = "driverBrakeStatus", + .address = 0x1F8, + .def_val = "2 APPLIED 1 NOT_APPLIED", + .sigs = sigs_504, + }, + { + .name = "DTR_Dist_Rq", + .address = 0x238, + .def_val = "255 SNA 200 ACC_DIST_7 166 ACC_DIST_6 133 ACC_DIST_5 100 ACC_DIST_4 66 ACC_DIST_3 33 ACC_DIST_2 0 ACC_DIST_1", + .sigs = sigs_568, + }, + { + .name = "HiBmLvr_Stat", + .address = 0x238, + .def_val = "3 SNA 2 HIBM_FLSH_ON_PSD 1 HIBM_ON_PSD 0 IDLE", + .sigs = sigs_568, + }, + { + .name = "HrnSw_Psd", + .address = 0x238, + .def_val = "3 SNA 2 NDEF2 1 PSD 0 NPSD", + .sigs = sigs_568, + }, + { + .name = "SpdCtrlLvr_Stat", + .address = 0x238, + .def_val = "32 DN_1ST 16 UP_1ST 8 DN_2ND 4 UP_2ND 2 RWD 1 FWD 0 IDLE", + .sigs = sigs_568, + }, + { + .name = "StW_Cond_Psd", + .address = 0x238, + .def_val = "3 SNA 2 DOWN 1 UP 0 NPSD", + .sigs = sigs_568, + }, + { + .name = "StW_Lvr_Stat", + .address = 0x238, + .def_val = "4 STW_BACK 3 STW_FWD 2 STW_DOWN 1 STW_UP 0 NPSD", + .sigs = sigs_568, + }, + { + .name = "StW_Sw00_Psd", + .address = 0x238, + .def_val = "1 PRESSED 0 NOT_PRESSED_SNA", + .sigs = sigs_568, + }, + { + .name = "StW_Sw01_Psd", + .address = 0x238, + .def_val = "1 PRESSED 0 NOT_PRESSED_SNA", + .sigs = sigs_568, + }, + { + .name = "StW_Sw03_Psd", + .address = 0x238, + .def_val = "1 PRESSED 0 NOT_PRESSED_SNA", + .sigs = sigs_568, + }, + { + .name = "StW_Sw04_Psd", + .address = 0x238, + .def_val = "1 PRESSED 0 NOT_PRESSED_SNA", + .sigs = sigs_568, + }, + { + .name = "TurnIndLvr_Stat", + .address = 0x238, + .def_val = "3 SNA 2 RIGHT 1 LEFT 0 IDLE", + .sigs = sigs_568, + }, + { + .name = "WprSw6Posn", + .address = 0x238, + .def_val = "7 SNA 6 STAGE2 5 STAGE1 4 INTERVAL4 3 INTERVAL3 2 INTERVAL2 1 INTERVAL1 0 OFF", + .sigs = sigs_568, + }, + { + .name = "WprWashSw_Psd", + .address = 0x238, + .def_val = "3 SNA 2 WASH 1 TIPWIPE 0 NPSD", + .sigs = sigs_568, + }, + { + .name = "WprWash_R_Sw_Posn_V2", + .address = 0x238, + .def_val = "3 SNA 2 WASH 1 INTERVAL 0 OFF", + .sigs = sigs_568, + }, + { + .name = "DI_aebState", + .address = 0x256, + .def_val = "2 ENABLED 4 FAULT 7 SNA 1 STANDBY 3 STANDSTILL 0 UNAVAILABLE", + .sigs = sigs_598, + }, + { + .name = "DI_analogSpeed", + .address = 0x256, + .def_val = "4095 SNA", + .sigs = sigs_598, + }, + { + .name = "DI_cruiseState", + .address = 0x256, + .def_val = "2 ENABLED 5 FAULT 0 OFF 4 OVERRIDE 7 PRE_CANCEL 6 PRE_FAULT 1 STANDBY 3 STANDSTILL", + .sigs = sigs_598, + }, + { + .name = "DI_digitalSpeed", + .address = 0x256, + .def_val = "255 SNA", + .sigs = sigs_598, + }, + { + .name = "DI_immobilizerState", + .address = 0x256, + .def_val = "2 AUTHENTICATING 3 DISARMED 6 FAULT 4 IDLE 0 INIT_SNA 1 REQUEST 5 RESET", + .sigs = sigs_598, + }, + { + .name = "DI_speedUnits", + .address = 0x256, + .def_val = "1 KPH 0 MPH", + .sigs = sigs_598, + }, + { + .name = "DI_state", + .address = 0x256, + .def_val = "3 ABORT 4 ENABLE 2 FAULT 1 STANDBY 0 UNAVAILABLE", + .sigs = sigs_598, + }, + { + .name = "DI_systemState", + .address = 0x256, + .def_val = "3 ABORT 4 ENABLE 2 FAULT 1 STANDBY 0 UNAVAILABLE", + .sigs = sigs_598, + }, + { + .name = "DI_vehicleHoldState", + .address = 0x256, + .def_val = "2 BLEND_IN 4 BLEND_OUT 6 FAULT 7 INIT 5 PARK 1 STANDBY 3 STANDSTILL 0 UNAVAILABLE", + .sigs = sigs_598, + }, + { + .name = "DAS_accState", + .address = 0x2BF, + .def_val = "15 FAULT_SNA 13 ACC_CANCEL_GENERIC_SILENT 11 APC_SELFPARK_START 10 APC_UNPARK_COMPLETE 9 APC_PAUSE 8 APC_ABORT 7 APC_COMPLETE 6 APC_FORWARD 5 APC_BACKWARD 4 ACC_ON 3 ACC_HOLD 0 ACC_CANCEL_GENERIC", + .sigs = sigs_703, + }, + { + .name = "DAS_accelMax", + .address = 0x2BF, + .def_val = "511 SNA", + .sigs = sigs_703, + }, + { + .name = "DAS_accelMin", + .address = 0x2BF, + .def_val = "511 SNA", + .sigs = sigs_703, + }, + { + .name = "DAS_aebEvent", + .address = 0x2BF, + .def_val = "3 AEB_SNA 2 AEB_FAULT 1 AEB_ACTIVE 0 AEB_NOT_ACTIVE", + .sigs = sigs_703, + }, + { + .name = "DAS_jerkMax", + .address = 0x2BF, + .def_val = "255 SNA", + .sigs = sigs_703, + }, + { + .name = "DAS_jerkMin", + .address = 0x2BF, + .def_val = "511 SNA", + .sigs = sigs_703, + }, + { + .name = "DAS_setSpeed", + .address = 0x2BF, + .def_val = "4095 SNA", + .sigs = sigs_703, + }, +}; + +} + +const DBC tesla_powertrain = { + .name = "tesla_powertrain", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(tesla_powertrain) \ No newline at end of file diff --git a/opendbc/can/dbc_out/tesla_radar.cc b/opendbc/can/dbc_out/tesla_radar.cc new file mode 100644 index 000000000..993e34b88 --- /dev/null +++ b/opendbc/can/dbc_out/tesla_radar.cc @@ -0,0 +1,12969 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_265[] = { + { + .name = "Msg109Counter", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg109Always0x80", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg109Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_281[] = { + { + .name = "Msg119Always0xFF", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg119Always0x1F", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg119Always0xF4", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg119Always0x11", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg119Counter", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg119Always0x8", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg119Checksum", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_297[] = { + { + .name = "Msg129Always0x20", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg129Counter", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg129Checksum", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_329[] = { + { + .name = "Msg149Always0x26", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg149Always0x02", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg149Always0x6A", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg149Always0xAA", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg149Always0x04", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg149Always0xF", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg149Counter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg149Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_345[] = { + { + .name = "Msg159Always0xA5", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg159Always0xF4", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg159Always0x3A", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg159Checksum", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg159Always0xCF", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg159Counter", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_361[] = { + { + .name = "ESP_wheelSpeedFrL_HS", + .b1 = 0, + .b2 = 13, + .bo = 51, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_wheelSpeedFrR_HS", + .b1 = 13, + .b2 = 13, + .bo = 38, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_wheelSpeedReL_HS", + .b1 = 26, + .b2 = 13, + .bo = 25, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_wheelSpeedReR_HS", + .b1 = 39, + .b2 = 13, + .bo = 12, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg169Counter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg169Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_409[] = { + { + .name = "Msg199Always0x2F", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg199Always0x67", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg199Always0x20", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg199Always0x04", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg199Always0xFF", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg199Counter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg199Checksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_425[] = { + { + .name = "Msg1A9Always0x0C", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg1A9Counter", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg1A9Checksum", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_521[] = { + { + .name = "Msg209Always0x61", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg209Always0x94", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg209Always0x52", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg209Always0x13", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg209Always0x03", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg209Always0x80", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_529[] = { + { + .name = "RCM_driverOrientationInitStatus", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_armStatus", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_warningIndicatorState", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_tellTalePassengerState", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_bucklePassengerStatus", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_tellTaleDriverState", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_buckleDriverStatus", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_seatTrackPositionDrvr", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_passAirbagRequest", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_chimeState1stRow", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_vinLearnFlag", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_hwConfigPin58", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_hwConfigPin57", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_hwConfigPin56", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_passOccupantStatus", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_airbagCutoffSwStatus", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_privateCANStatus", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_publicCANStatus", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_edr2State", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_edr1State", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_buckle2ndRowStatus", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_statusCounter", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RCM_statusChecksum", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_537[] = { + { + .name = "Msg219Counter", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg219CRC", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_681[] = { + { + .name = "Msg2A9_Value1_0x02", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg2A9_FourWheelDrive", + .b1 = 3, + .b2 = 2, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg2A9_Value2_0x02", + .b1 = 5, + .b2 = 3, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg2A9_Always0x16", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg2A9_Always0x43", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg2A9_Always0x41", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg2A9_Always0x02", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg2A9_Always0x10", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_697[] = { + { + .name = "VIN_MuxID", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_Part2", + .b1 = 8, + .b2 = 56, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_Part3", + .b1 = 8, + .b2 = 56, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_Part1", + .b1 = 40, + .b2 = 24, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_729[] = { + { + .name = "Msg2D9Always0x80", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg2D9Always0x40", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Msg2D9Always0x83", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_769[] = { + { + .name = "RADC_VerticalMisalignment", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_SCUTemperature", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_VMA_Plaus", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_SGU_ITC", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_HorizontMisalignment", + .b1 = 32, + .b2 = 12, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_SensorDirty", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_HWFail", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_SGUFail", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_SGUInfoConsistBit", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_770[] = { + { + .name = "RADC_ACCTargObj1_sguIndex", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_ACCTargObj2_sguIndex", + .b1 = 6, + .b2 = 6, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_ACCTargObj3_sguIndex", + .b1 = 12, + .b2 = 6, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_ACCTargObj4_sguIndex", + .b1 = 18, + .b2 = 6, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_ACCTargObj5_sguIndex", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "unused30", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_TGUInfoConsistBit", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_ACCTargObj1_dBPower", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_ACCTargObj5_dBPower", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_784[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_785[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_787[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_788[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_790[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_791[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_793[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_794[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_796[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_797[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_799[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_800[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_802[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_803[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_805[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_806[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_808[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_809[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_811[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_812[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_814[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_815[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_817[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_818[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_820[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_821[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_823[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_824[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_826[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_827[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_829[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_830[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_832[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_833[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_835[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_836[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_838[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_839[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_841[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_842[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_844[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_845[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_847[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_848[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_850[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_851[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_853[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_854[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_856[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_857[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_859[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_860[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_862[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_863[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_865[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_866[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_868[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_869[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_871[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_872[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_874[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_875[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_877[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_878[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_881[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_882[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_884[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_885[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_887[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_888[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_890[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_891[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_893[] = { + { + .name = "LongDist", + .b1 = 0, + .b2 = 12, + .bo = 52, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongSpeed", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 0.0625, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LatDist", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.125, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbExist", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LongAccel", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbObstacle", + .b1 = 50, + .b2 = 5, + .bo = 9, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Valid", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbNonObstacle", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Meas", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Tracked", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_894[] = { + { + .name = "LatSpeed", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = false, + .factor = 0.125, + .offset = -64.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Length", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dZ", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.25, + .offset = -5.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MovingState", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxSigma", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "vxSigma", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "axSigma", + .b1 = 36, + .b2 = 6, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dySigma", + .b1 = 42, + .b2 = 6, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ProbClass", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 3.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Class", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "dxRearEndLoss", + .b1 = 56, + .b2 = 6, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NotUsed", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Index2", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1281[] = { + { + .name = "RADC_a001_ecuInternalPerf", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a002_flashPerformance", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a003_vBatHigh", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a004_adjustmentNotDone", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a005_adjustmentReq", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a006_adjustmentNotOk", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a007_sensorBlinded", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a008_plantModeActive", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a009_configMismatch", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a010_canBusOff", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a011_bdyMIA", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a012_espMIA", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a013_gtwMIA", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a014_sccmMIA", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a015_adasMIA", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a016_bdyInvalidCount", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a017_adasInvalidCount", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a018_espInvalidCount", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a019_sccmInvalidCount", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a020_bdyInvalidChkSm", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a021_espInvalidChkSm", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a022_sccmInvalidChkSm", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a023_sccmInvalidChkSm", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a024_absValidity", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a025_ambTValidity", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a026_brakeValidity", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a027_CntryCdValidity", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a028_espValidity", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a029_longAccOffValidity", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a030_longAccValidity", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a031_odoValidity", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a032_gearValidity", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a033_steerAngValidity", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a034_steerAngSpdValidity", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a035_indctrValidity", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a036_vehStandStillValidity", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a037_vinValidity", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a038_whlRotValidity", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a039_whlSpdValidity", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a040_whlStandStillValidity", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a041_wiperValidity", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a042_xwdValidity", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a043_yawOffValidity", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a044_yawValidity", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a045_bsdSanity", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a046_rctaSanity", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a047_lcwSanity", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a048_steerAngOffSanity", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a049_tireSizeSanity", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a050_velocitySanity", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a051_yawSanity", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a052_radomeHtrInop", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a053_espmodValidity", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a054_gtwmodValidity", + .b1 = 53, + .b2 = 1, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a055_stwmodValidity", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a056_bcmodValidity", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a057_dimodValidity", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a058_opmodValidity", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a059_drmiInvalidChkSm", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a060_drmiInvalidCount", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a061_radPositionMismatch", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RADC_a062_strRackMismatch", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "unused62", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1601[] = { + { + .name = "UDS_radarRequestData", + .b1 = 0, + .b2 = 64, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1617[] = { + { + .name = "Radar_udsResponseData", + .b1 = 0, + .b2 = 64, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "Msg109_DI_torque1", + .address = 0x109, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_265), + .sigs = sigs_265, + }, + { + .name = "Msg119_DI_torque2", + .address = 0x119, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_281), + .sigs = sigs_281, + }, + { + .name = "Msg129_ESP_115h", + .address = 0x129, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_297), + .sigs = sigs_297, + }, + { + .name = "Msg149_ESP_145h", + .address = 0x149, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_329), + .sigs = sigs_329, + }, + { + .name = "Msg159_ESP_C", + .address = 0x159, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_345), + .sigs = sigs_345, + }, + { + .name = "Msg169_ESP_wheelSpeeds", + .address = 0x169, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_361), + .sigs = sigs_361, + }, + { + .name = "Msg199_STW_ANGLHP_STAT", + .address = 0x199, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_409), + .sigs = sigs_409, + }, + { + .name = "Msg1A9_DI_espControl", + .address = 0x1A9, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_425), + .sigs = sigs_425, + }, + { + .name = "Msg209_GTW_odo", + .address = 0x209, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_521), + .sigs = sigs_521, + }, + { + .name = "RCM_status", + .address = 0x211, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_529), + .sigs = sigs_529, + }, + { + .name = "Msg219_STW_ACTN_RQ", + .address = 0x219, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_537), + .sigs = sigs_537, + }, + { + .name = "Msg2A9_GTW_carConfig", + .address = 0x2A9, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_681), + .sigs = sigs_681, + }, + { + .name = "VIN_VIP_405HS", + .address = 0x2B9, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_697), + .sigs = sigs_697, + }, + { + .name = "Msg2D9_BC_status", + .address = 0x2D9, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_729), + .sigs = sigs_729, + }, + { + .name = "TeslaRadarSguInfo", + .address = 0x301, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_769), + .sigs = sigs_769, + }, + { + .name = "TeslaRadarTguInfo", + .address = 0x302, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_770), + .sigs = sigs_770, + }, + { + .name = "M_310hex", + .address = 0x310, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_784), + .sigs = sigs_784, + }, + { + .name = "M_310hex2", + .address = 0x311, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_785), + .sigs = sigs_785, + }, + { + .name = "M_313hex", + .address = 0x313, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_787), + .sigs = sigs_787, + }, + { + .name = "M_313hex2", + .address = 0x314, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_788), + .sigs = sigs_788, + }, + { + .name = "M_316hex", + .address = 0x316, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_790), + .sigs = sigs_790, + }, + { + .name = "M_316hex2", + .address = 0x317, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_791), + .sigs = sigs_791, + }, + { + .name = "M_319hex", + .address = 0x319, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_793), + .sigs = sigs_793, + }, + { + .name = "M_319hex2", + .address = 0x31A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_794), + .sigs = sigs_794, + }, + { + .name = "M_31Chex", + .address = 0x31C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_796), + .sigs = sigs_796, + }, + { + .name = "M_31Chex2", + .address = 0x31D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_797), + .sigs = sigs_797, + }, + { + .name = "M_31Fhex", + .address = 0x31F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_799), + .sigs = sigs_799, + }, + { + .name = "M_31Fhex2", + .address = 0x320, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_800), + .sigs = sigs_800, + }, + { + .name = "M_322hex", + .address = 0x322, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_802), + .sigs = sigs_802, + }, + { + .name = "M_322hex2", + .address = 0x323, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_803), + .sigs = sigs_803, + }, + { + .name = "M_325hex", + .address = 0x325, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_805), + .sigs = sigs_805, + }, + { + .name = "M_325hex2", + .address = 0x326, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_806), + .sigs = sigs_806, + }, + { + .name = "M_328hex", + .address = 0x328, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_808), + .sigs = sigs_808, + }, + { + .name = "M_328hex2", + .address = 0x329, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_809), + .sigs = sigs_809, + }, + { + .name = "M_32Bhex", + .address = 0x32B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_811), + .sigs = sigs_811, + }, + { + .name = "M_32Bhex2", + .address = 0x32C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_812), + .sigs = sigs_812, + }, + { + .name = "M_32Ehex", + .address = 0x32E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_814), + .sigs = sigs_814, + }, + { + .name = "M_32Ehex2", + .address = 0x32F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_815), + .sigs = sigs_815, + }, + { + .name = "M_331hex", + .address = 0x331, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_817), + .sigs = sigs_817, + }, + { + .name = "M_331hex2", + .address = 0x332, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_818), + .sigs = sigs_818, + }, + { + .name = "M_334hex", + .address = 0x334, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_820), + .sigs = sigs_820, + }, + { + .name = "M_334hex2", + .address = 0x335, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_821), + .sigs = sigs_821, + }, + { + .name = "M_337hex", + .address = 0x337, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_823), + .sigs = sigs_823, + }, + { + .name = "M_337hex2", + .address = 0x338, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_824), + .sigs = sigs_824, + }, + { + .name = "M_33Ahex", + .address = 0x33A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_826), + .sigs = sigs_826, + }, + { + .name = "M_33Ahex2", + .address = 0x33B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_827), + .sigs = sigs_827, + }, + { + .name = "M_33Dhex", + .address = 0x33D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_829), + .sigs = sigs_829, + }, + { + .name = "M_33Dhex2", + .address = 0x33E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_830), + .sigs = sigs_830, + }, + { + .name = "M_340hex", + .address = 0x340, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_832), + .sigs = sigs_832, + }, + { + .name = "M_340hex2", + .address = 0x341, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_833), + .sigs = sigs_833, + }, + { + .name = "M_343hex", + .address = 0x343, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_835), + .sigs = sigs_835, + }, + { + .name = "M_343hex2", + .address = 0x344, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_836), + .sigs = sigs_836, + }, + { + .name = "M_346hex", + .address = 0x346, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_838), + .sigs = sigs_838, + }, + { + .name = "M_346hex2", + .address = 0x347, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_839), + .sigs = sigs_839, + }, + { + .name = "M_349hex", + .address = 0x349, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_841), + .sigs = sigs_841, + }, + { + .name = "M_349hex2", + .address = 0x34A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_842), + .sigs = sigs_842, + }, + { + .name = "M_34Chex", + .address = 0x34C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_844), + .sigs = sigs_844, + }, + { + .name = "M_34Chex2", + .address = 0x34D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_845), + .sigs = sigs_845, + }, + { + .name = "M_34Fhex", + .address = 0x34F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_847), + .sigs = sigs_847, + }, + { + .name = "M_34Fhex2", + .address = 0x350, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_848), + .sigs = sigs_848, + }, + { + .name = "M_352hex", + .address = 0x352, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_850), + .sigs = sigs_850, + }, + { + .name = "M_352hex2", + .address = 0x353, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_851), + .sigs = sigs_851, + }, + { + .name = "M_355hex", + .address = 0x355, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_853), + .sigs = sigs_853, + }, + { + .name = "M_355hex2", + .address = 0x356, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_854), + .sigs = sigs_854, + }, + { + .name = "M_358hex", + .address = 0x358, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_856), + .sigs = sigs_856, + }, + { + .name = "M_358hex2", + .address = 0x359, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_857), + .sigs = sigs_857, + }, + { + .name = "M_35Bhex", + .address = 0x35B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_859), + .sigs = sigs_859, + }, + { + .name = "M_35Bhex2", + .address = 0x35C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_860), + .sigs = sigs_860, + }, + { + .name = "M_35Ehex", + .address = 0x35E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_862), + .sigs = sigs_862, + }, + { + .name = "M_35Ehex2", + .address = 0x35F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_863), + .sigs = sigs_863, + }, + { + .name = "M_361hex", + .address = 0x361, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_865), + .sigs = sigs_865, + }, + { + .name = "M_361hex2", + .address = 0x362, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_866), + .sigs = sigs_866, + }, + { + .name = "M_364hex", + .address = 0x364, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_868), + .sigs = sigs_868, + }, + { + .name = "M_364hex2", + .address = 0x365, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_869), + .sigs = sigs_869, + }, + { + .name = "M_367hex", + .address = 0x367, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_871), + .sigs = sigs_871, + }, + { + .name = "M_367hex2", + .address = 0x368, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_872), + .sigs = sigs_872, + }, + { + .name = "M_36Ahex", + .address = 0x36A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_874), + .sigs = sigs_874, + }, + { + .name = "M_36Ahex2", + .address = 0x36B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_875), + .sigs = sigs_875, + }, + { + .name = "M_36Dhex", + .address = 0x36D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_877), + .sigs = sigs_877, + }, + { + .name = "M_36Dhex2", + .address = 0x36E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_878), + .sigs = sigs_878, + }, + { + .name = "L_1_371hex", + .address = 0x371, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_881), + .sigs = sigs_881, + }, + { + .name = "L_1_371hex2", + .address = 0x372, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_882), + .sigs = sigs_882, + }, + { + .name = "L_2_374hex", + .address = 0x374, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_884), + .sigs = sigs_884, + }, + { + .name = "L_2_375hex2", + .address = 0x375, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_885), + .sigs = sigs_885, + }, + { + .name = "L_3_377hex", + .address = 0x377, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_887), + .sigs = sigs_887, + }, + { + .name = "L_3_378hex2", + .address = 0x378, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_888), + .sigs = sigs_888, + }, + { + .name = "L_4_37ahex", + .address = 0x37A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_890), + .sigs = sigs_890, + }, + { + .name = "L_4_37ahex2", + .address = 0x37B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_891), + .sigs = sigs_891, + }, + { + .name = "L_5_37dhex", + .address = 0x37D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_893), + .sigs = sigs_893, + }, + { + .name = "L_5_37dhex2", + .address = 0x37E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_894), + .sigs = sigs_894, + }, + { + .name = "TeslaRadarAlertMatrix", + .address = 0x501, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1281), + .sigs = sigs_1281, + }, + { + .name = "UDS_radarRequest", + .address = 0x641, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1601), + .sigs = sigs_1601, + }, + { + .name = "Radar_udsResponse", + .address = 0x651, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1617), + .sigs = sigs_1617, + }, +}; + +const Val vals[] = { + { + .name = "Msg2A9_FourWheelDrive", + .address = 0x2A9, + .def_val = "3 SNA 2 UNUSED 1 4WD 0 2WD", + .sigs = sigs_681, + }, + { + .name = "Class", + .address = 0x311, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_785, + }, + { + .name = "MovingState", + .address = 0x311, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_785, + }, + { + .name = "Class", + .address = 0x314, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_788, + }, + { + .name = "MovingState", + .address = 0x314, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_788, + }, + { + .name = "Class", + .address = 0x317, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_791, + }, + { + .name = "MovingState", + .address = 0x317, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_791, + }, + { + .name = "Class", + .address = 0x31A, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_794, + }, + { + .name = "MovingState", + .address = 0x31A, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_794, + }, + { + .name = "Class", + .address = 0x31D, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_797, + }, + { + .name = "MovingState", + .address = 0x31D, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_797, + }, + { + .name = "Class", + .address = 0x320, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_800, + }, + { + .name = "MovingState", + .address = 0x320, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_800, + }, + { + .name = "Class", + .address = 0x323, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_803, + }, + { + .name = "MovingState", + .address = 0x323, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_803, + }, + { + .name = "Class", + .address = 0x326, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_806, + }, + { + .name = "MovingState", + .address = 0x326, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_806, + }, + { + .name = "Class", + .address = 0x329, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_809, + }, + { + .name = "MovingState", + .address = 0x329, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_809, + }, + { + .name = "Class", + .address = 0x32C, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_812, + }, + { + .name = "MovingState", + .address = 0x32C, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_812, + }, + { + .name = "Class", + .address = 0x32F, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_815, + }, + { + .name = "MovingState", + .address = 0x32F, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_815, + }, + { + .name = "Class", + .address = 0x332, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_818, + }, + { + .name = "MovingState", + .address = 0x332, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_818, + }, + { + .name = "Class", + .address = 0x335, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_821, + }, + { + .name = "MovingState", + .address = 0x335, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_821, + }, + { + .name = "Class", + .address = 0x338, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_824, + }, + { + .name = "MovingState", + .address = 0x338, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_824, + }, + { + .name = "Class", + .address = 0x33B, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_827, + }, + { + .name = "MovingState", + .address = 0x33B, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_827, + }, + { + .name = "Class", + .address = 0x33E, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_830, + }, + { + .name = "MovingState", + .address = 0x33E, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_830, + }, + { + .name = "Class", + .address = 0x341, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_833, + }, + { + .name = "MovingState", + .address = 0x341, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_833, + }, + { + .name = "Class", + .address = 0x344, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_836, + }, + { + .name = "MovingState", + .address = 0x344, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_836, + }, + { + .name = "Class", + .address = 0x347, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_839, + }, + { + .name = "MovingState", + .address = 0x347, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_839, + }, + { + .name = "Class", + .address = 0x34A, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_842, + }, + { + .name = "MovingState", + .address = 0x34A, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_842, + }, + { + .name = "Class", + .address = 0x34D, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_845, + }, + { + .name = "MovingState", + .address = 0x34D, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_845, + }, + { + .name = "Class", + .address = 0x350, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_848, + }, + { + .name = "MovingState", + .address = 0x350, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_848, + }, + { + .name = "Class", + .address = 0x353, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_851, + }, + { + .name = "MovingState", + .address = 0x353, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_851, + }, + { + .name = "Class", + .address = 0x356, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_854, + }, + { + .name = "MovingState", + .address = 0x356, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_854, + }, + { + .name = "Class", + .address = 0x359, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_857, + }, + { + .name = "MovingState", + .address = 0x359, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_857, + }, + { + .name = "Class", + .address = 0x35C, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_860, + }, + { + .name = "MovingState", + .address = 0x35C, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_860, + }, + { + .name = "Class", + .address = 0x35F, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_863, + }, + { + .name = "MovingState", + .address = 0x35F, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_863, + }, + { + .name = "Class", + .address = 0x362, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_866, + }, + { + .name = "MovingState", + .address = 0x362, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_866, + }, + { + .name = "Class", + .address = 0x365, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_869, + }, + { + .name = "MovingState", + .address = 0x365, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_869, + }, + { + .name = "Class", + .address = 0x368, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_872, + }, + { + .name = "MovingState", + .address = 0x368, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_872, + }, + { + .name = "Class", + .address = 0x36B, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_875, + }, + { + .name = "MovingState", + .address = 0x36B, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_875, + }, + { + .name = "Class", + .address = 0x36E, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_878, + }, + { + .name = "MovingState", + .address = 0x36E, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_878, + }, + { + .name = "Class", + .address = 0x372, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_882, + }, + { + .name = "MovingState", + .address = 0x372, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_882, + }, + { + .name = "Class", + .address = 0x375, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_885, + }, + { + .name = "MovingState", + .address = 0x375, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_885, + }, + { + .name = "Class", + .address = 0x378, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_888, + }, + { + .name = "MovingState", + .address = 0x378, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_888, + }, + { + .name = "Class", + .address = 0x37B, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_891, + }, + { + .name = "MovingState", + .address = 0x37B, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_891, + }, + { + .name = "Class", + .address = 0x37E, + .def_val = "4 RADAR_CLASS_CONSTRUCTION_ELEMENT 3 RADAR_CLASS_MOVING_PEDESTRIAN 2 RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE 1 RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE 0 RADAR_CLASS_UNKNOWN", + .sigs = sigs_894, + }, + { + .name = "MovingState", + .address = 0x37E, + .def_val = "3 RADAR_MOVESTATE_STANDING 2 RADAR_MOVESTATE_STOPPED 1 RADAR_MOVESTATE_MOVING 0 RADAR_MOVESTATE_INDETERMINATE", + .sigs = sigs_894, + }, +}; + +} + +const DBC tesla_radar = { + .name = "tesla_radar", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(tesla_radar) \ No newline at end of file diff --git a/opendbc/can/dbc_out/toyota_adas.cc b/opendbc/can/dbc_out/toyota_adas.cc new file mode 100644 index 000000000..bacb5cb57 --- /dev/null +++ b/opendbc/can/dbc_out/toyota_adas.cc @@ -0,0 +1,2246 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_528[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_529[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_530[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_531[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_532[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_533[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_534[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_535[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_536[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_537[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_538[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_539[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_540[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_541[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_542[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_543[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_544[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_545[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_546[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_547[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_548[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_549[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_550[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_551[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_552[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_553[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_554[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_555[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_556[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_557[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_558[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_559[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "TRACK_A_0", + .address = 0x210, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_528), + .sigs = sigs_528, + }, + { + .name = "TRACK_A_1", + .address = 0x211, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_529), + .sigs = sigs_529, + }, + { + .name = "TRACK_A_2", + .address = 0x212, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_530), + .sigs = sigs_530, + }, + { + .name = "TRACK_A_3", + .address = 0x213, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_531), + .sigs = sigs_531, + }, + { + .name = "TRACK_A_4", + .address = 0x214, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_532), + .sigs = sigs_532, + }, + { + .name = "TRACK_A_5", + .address = 0x215, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_533), + .sigs = sigs_533, + }, + { + .name = "TRACK_A_6", + .address = 0x216, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_534), + .sigs = sigs_534, + }, + { + .name = "TRACK_A_7", + .address = 0x217, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_535), + .sigs = sigs_535, + }, + { + .name = "TRACK_A_8", + .address = 0x218, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_536), + .sigs = sigs_536, + }, + { + .name = "TRACK_A_9", + .address = 0x219, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_537), + .sigs = sigs_537, + }, + { + .name = "TRACK_A_10", + .address = 0x21A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_538), + .sigs = sigs_538, + }, + { + .name = "TRACK_A_11", + .address = 0x21B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_539), + .sigs = sigs_539, + }, + { + .name = "TRACK_A_12", + .address = 0x21C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_540), + .sigs = sigs_540, + }, + { + .name = "TRACK_A_13", + .address = 0x21D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_541), + .sigs = sigs_541, + }, + { + .name = "TRACK_A_14", + .address = 0x21E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_542), + .sigs = sigs_542, + }, + { + .name = "TRACK_A_15", + .address = 0x21F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_543), + .sigs = sigs_543, + }, + { + .name = "TRACK_B_0", + .address = 0x220, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_544), + .sigs = sigs_544, + }, + { + .name = "TRACK_B_1", + .address = 0x221, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_545), + .sigs = sigs_545, + }, + { + .name = "TRACK_B_2", + .address = 0x222, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_546), + .sigs = sigs_546, + }, + { + .name = "TRACK_B_3", + .address = 0x223, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_547), + .sigs = sigs_547, + }, + { + .name = "TRACK_B_4", + .address = 0x224, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_548), + .sigs = sigs_548, + }, + { + .name = "TRACK_B_5", + .address = 0x225, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_549), + .sigs = sigs_549, + }, + { + .name = "TRACK_B_6", + .address = 0x226, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_550), + .sigs = sigs_550, + }, + { + .name = "TRACK_B_7", + .address = 0x227, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_551), + .sigs = sigs_551, + }, + { + .name = "TRACK_B_8", + .address = 0x228, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_552), + .sigs = sigs_552, + }, + { + .name = "TRACK_B_9", + .address = 0x229, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_553), + .sigs = sigs_553, + }, + { + .name = "TRACK_B_10", + .address = 0x22A, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_554), + .sigs = sigs_554, + }, + { + .name = "TRACK_B_11", + .address = 0x22B, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_555), + .sigs = sigs_555, + }, + { + .name = "TRACK_B_12", + .address = 0x22C, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_556), + .sigs = sigs_556, + }, + { + .name = "TRACK_B_13", + .address = 0x22D, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_557), + .sigs = sigs_557, + }, + { + .name = "TRACK_B_14", + .address = 0x22E, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_558), + .sigs = sigs_558, + }, + { + .name = "TRACK_B_15", + .address = 0x22F, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_559), + .sigs = sigs_559, + }, +}; + +const Val vals[] = { +}; + +} + +const DBC toyota_adas = { + .name = "toyota_adas", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(toyota_adas) \ No newline at end of file diff --git a/opendbc/can/dbc_out/toyota_corolla_2017_pt_generated.cc b/opendbc/can/dbc_out/toyota_corolla_2017_pt_generated.cc new file mode 100644 index 000000000..9f130e8d7 --- /dev/null +++ b/opendbc/can/dbc_out/toyota_corolla_2017_pt_generated.cc @@ -0,0 +1,3184 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_35[] = { + { + .name = "ZORRO_STEER", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = true, + .factor = 0.004901594652, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_36[] = { + { + .name = "YAW_RATE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 0.244, + .offset = -125.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_TORQUE", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Y", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = false, + .factor = 0.03589, + .offset = -18.375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_37[] = { + { + .name = "STEER_ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_RATE", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_FRACTION", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_166[] = { + { + .name = "BRAKE_AMOUNT", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PEDAL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_170[] = { + { + .name = "WHEEL_SPEED_FR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_180[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ENCODER", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_241[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X3", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_242[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "DECELERATION", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DS1STBK2", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DS1STAT2", + .b1 = 10, + .b2 = 3, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSOPR", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSALM", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSWAR", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IRLT_REQ", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEXTRGR", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IBTRGR", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PPTRGR", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBATRGR", + .b1 = 25, + .b2 = 2, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSABK", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBRTRGR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PREFILL", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VGRSTRGR", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AVSTRGR", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRKHLD", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBPREPMP", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSDIS", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_353[] = { + { + .name = "FORWARD_SPEED", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.00390625, + .offset = -30.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_359[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_452[] = { + { + .name = "RPM", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.78125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_466[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "GAS_RELEASED", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_ACTIVE", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL_ON", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_NET", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATE", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_467[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_548[] = { + { + .name = "BRAKE_PRESSED", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSURE", + .b1 = 44, + .b2 = 12, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_552[] = { + { + .name = "ACCEL_X", + .b1 = 1, + .b2 = 15, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Z", + .b1 = 17, + .b2 = 15, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_560[] = { + { + .name = "BRAKE_PRESSED", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_608[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_OVERRIDE", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_DRIVER", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = true, + .factor = 0.0573, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_EPS", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = 0.88, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_610[] = { + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "IPAS_STATE", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TYPE", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 7, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_614[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_643[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "SET_ME_X00", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FORCE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X002", + .b1 = 38, + .b2 = 8, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 35, + .b2 = 3, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_STATUS", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X003", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PRECOLLISION_ACTIVE", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_705[] = { + { + .name = "GAS_RELEASED", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PEDAL", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_740[] = { + { + .name = "COUNTER", + .b1 = 1, + .b2 = 6, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_REQUEST", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_CMD", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_742[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LEAD_LONG_DIST", + .b1 = 0, + .b2 = 13, + .bo = 51, + .is_signed = false, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_REL_SPEED", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_835[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X3", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_836[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, +}; +const Signal sigs_869[] = { + { + .name = "MAIN_ON", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_BTN", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_BTN", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RES_BTN", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_REQUEST", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 100, + .offset = -12800.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_DISTANCE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_921[] = { + { + .name = "MAIN_ON", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_STATE", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE_LINES", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_SET_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_951[] = { + { + .name = "VSC_DISABLED", + .b1 = 11, + .b2 = 2, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TC_DISABLED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS_ACC", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_956[] = { + { + .name = "SPORT_ON", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1041[] = { + { + .name = "FCW", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X20", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X80", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1042[] = { + { + .name = "BARRIERS", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_LINE", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_LINE", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_ALERT", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01_2", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TWO_BEEPS", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ADJUSTING_CAMERA", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_MALFUNCTION", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X0C", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REPEATED_BEEPS", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X2C", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X38", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X02", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1043[] = { + { + .name = "YEAR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MONTH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAY", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HOUR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINUTE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_MINUTES", + .b1 = 53, + .b2 = 6, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_HOURS", + .b1 = 49, + .b2 = 4, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMT_DIFF", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SUMMER", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1161[] = { + { + .name = "TSGN1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT1", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY1", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL1", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN2", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN1", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN2", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT2", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY2", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL2", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID1", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_A", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_P", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1162[] = { + { + .name = "TSGN3", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT3", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY3", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN4", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN3", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN4", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT4", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY4", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMA", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMP", + .b1 = 50, + .b2 = 3, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DPSGNREQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID2", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRWMSG", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDUNT", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1163[] = { + { + .name = "OVSPNTM", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NTLVLSPD", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OTSGNNTM", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRMSW", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSREQPD", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALL", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALH", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRSPU", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1408[] = { + { + .name = "VIN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_3", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_4", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_5", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_6", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_7", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_8", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1409[] = { + { + .name = "VIN_9", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_10", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_11", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_12", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_13", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_14", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_15", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_16", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1410[] = { + { + .name = "VIN_17", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1553[] = { + { + .name = "UNITS", + .b1 = 29, + .b2 = 2, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 44, + .b2 = 20, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1556[] = { + { + .name = "HAZARD_LIGHT", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TURN_SIGNALS", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1568[] = { + { + .name = "DOOR_OPEN_RL", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1570[] = { + { + .name = "FRONT_FOG", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARKING_LIGHT", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAM", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGH_BEAM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "SECONDARY_STEER_ANGLE", + .address = 0x23, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_35), + .sigs = sigs_35, + }, + { + .name = "KINEMATICS", + .address = 0x24, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_36), + .sigs = sigs_36, + }, + { + .name = "STEER_ANGLE_SENSOR", + .address = 0x25, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_37), + .sigs = sigs_37, + }, + { + .name = "BRAKE", + .address = 0xA6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_166), + .sigs = sigs_166, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0xAA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_170), + .sigs = sigs_170, + }, + { + .name = "SPEED", + .address = 0xB4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_180), + .sigs = sigs_180, + }, + { + .name = "ACC_CONTROL_ALT", + .address = 0xF1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_241), + .sigs = sigs_241, + }, + { + .name = "PRECOLLISION_2_ALT", + .address = 0xF2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_242), + .sigs = sigs_242, + }, + { + .name = "DSU_SPEED", + .address = 0x161, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_353), + .sigs = sigs_353, + }, + { + .name = "STEERING_IPAS_COMMA", + .address = 0x167, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_359), + .sigs = sigs_359, + }, + { + .name = "ENGINE_RPM", + .address = 0x1C4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_452), + .sigs = sigs_452, + }, + { + .name = "PCM_CRUISE", + .address = 0x1D2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_466), + .sigs = sigs_466, + }, + { + .name = "PCM_CRUISE_2", + .address = 0x1D3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_467), + .sigs = sigs_467, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "BRAKE_MODULE", + .address = 0x224, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_548), + .sigs = sigs_548, + }, + { + .name = "ACCELEROMETER", + .address = 0x228, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_552), + .sigs = sigs_552, + }, + { + .name = "BRAKE_MODULE2", + .address = 0x230, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_560), + .sigs = sigs_560, + }, + { + .name = "STEER_TORQUE_SENSOR", + .address = 0x260, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_608), + .sigs = sigs_608, + }, + { + .name = "EPS_STATUS", + .address = 0x262, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_610), + .sigs = sigs_610, + }, + { + .name = "STEERING_IPAS", + .address = 0x266, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_614), + .sigs = sigs_614, + }, + { + .name = "PRE_COLLISION", + .address = 0x283, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_643), + .sigs = sigs_643, + }, + { + .name = "GAS_PEDAL", + .address = 0x2C1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_705), + .sigs = sigs_705, + }, + { + .name = "STEERING_LKA", + .address = 0x2E4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_740), + .sigs = sigs_740, + }, + { + .name = "LEAD_INFO", + .address = 0x2E6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_742), + .sigs = sigs_742, + }, + { + .name = "ACC_CONTROL", + .address = 0x343, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_835), + .sigs = sigs_835, + }, + { + .name = "PRE_COLLISION_2", + .address = 0x344, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_836), + .sigs = sigs_836, + }, + { + .name = "DSU_CRUISE", + .address = 0x365, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_869), + .sigs = sigs_869, + }, + { + .name = "PCM_CRUISE_SM", + .address = 0x399, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_921), + .sigs = sigs_921, + }, + { + .name = "ESP_CONTROL", + .address = 0x3B7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_951), + .sigs = sigs_951, + }, + { + .name = "GEAR_PACKET", + .address = 0x3BC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_956), + .sigs = sigs_956, + }, + { + .name = "ACC_HUD", + .address = 0x411, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1041), + .sigs = sigs_1041, + }, + { + .name = "LKAS_HUD", + .address = 0x412, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1042), + .sigs = sigs_1042, + }, + { + .name = "TIME", + .address = 0x413, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1043), + .sigs = sigs_1043, + }, + { + .name = "RSA1", + .address = 0x489, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1161), + .sigs = sigs_1161, + }, + { + .name = "RSA2", + .address = 0x48A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1162), + .sigs = sigs_1162, + }, + { + .name = "RSA3", + .address = 0x48B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1163), + .sigs = sigs_1163, + }, + { + .name = "VIN_PART_1", + .address = 0x580, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1408), + .sigs = sigs_1408, + }, + { + .name = "VIN_PART_2", + .address = 0x581, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1409), + .sigs = sigs_1409, + }, + { + .name = "VIN_PART_3", + .address = 0x582, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1410), + .sigs = sigs_1410, + }, + { + .name = "UI_SETTING", + .address = 0x611, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1553), + .sigs = sigs_1553, + }, + { + .name = "STEERING_LEVERS", + .address = 0x614, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1556), + .sigs = sigs_1556, + }, + { + .name = "SEATS_DOORS", + .address = 0x620, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1568), + .sigs = sigs_1568, + }, + { + .name = "LIGHT_STALK", + .address = 0x622, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1570), + .sigs = sigs_1570, + }, +}; + +const Val vals[] = { + { + .name = "CRUISE_STATE", + .address = 0x1D2, + .def_val = "11 TIMER_3SEC 10 ADAPTIVE_CLICK_DOWN 9 ADAPTIVE_CLICK_UP 8 ADAPTIVE_ENGAGED 7 STANDSTILL 6 NON-ADAPTIVE_CLICK_UP 5 NON-ADAPTIVE_CLICK_DOWN 4 NON-ADAPTIVE_HOLD_DOWN 3 NON-ADAPTIVE_HOLD_UP 2 NON-ADAPTIVE_BEING_ENGAGED 1 NON-ADAPTIVE_ENGAGED 0 OFF", + .sigs = sigs_466, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .address = 0x1D3, + .def_val = "2 LOW_SPEED_LOCKED 1 OK", + .sigs = sigs_467, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "IPAS_STATE", + .address = 0x262, + .def_val = "5 OVERRIDE 3 ENABLED 1 DISABLED", + .sigs = sigs_610, + }, + { + .name = "LKA_STATE", + .address = 0x262, + .def_val = "25 TEMPORARY_FAULT 9 TEMPORARY_FAULT2 5 ACTIVE 1 STANDBY", + .sigs = sigs_610, + }, + { + .name = "DIRECTION_CMD", + .address = 0x266, + .def_val = "3 RIGHT 2 CENTER 1 LEFT", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x266, + .def_val = "3 ENABLED 1 DISABLED", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x283, + .def_val = "0 NORMAL 1 ADAPTIVE_CRUISE_CONTROL 3 EMERGENCY_BRAKING", + .sigs = sigs_643, + }, + { + .name = "CRUISE_CONTROL_STATE", + .address = 0x399, + .def_val = "2 DISABLED 11 HOLD 10 HOLD_WAITING_USER_CMD 6 ENABLED 5 FAULTED", + .sigs = sigs_921, + }, + { + .name = "GEAR", + .address = 0x3BC, + .def_val = "0 D 1 S 8 N 16 R 32 P", + .sigs = sigs_956, + }, + { + .name = "BARRIERS", + .address = 0x412, + .def_val = "3 BOTH 2 RIGHT 1 LEFT 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LDA_ALERT", + .address = 0x412, + .def_val = "3 HOLD_WITH_CONTINUOUS_BEEP 2 LDA_UNAVAILABLE 1 HOLD 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LEFT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "RIGHT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "SPLSGN2", + .address = 0x489, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN1", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN2", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "SPLSGN3", + .address = 0x48A, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1162, + }, + { + .name = "TSGN3", + .address = 0x48A, + .def_val = "0 NONE 1 SPEED_SIGN 2 0_UNLIMITED 7 UNLIMITED 16 HIGHWAY 17 NO_HIGHWAY 18 MOTORWAY 19 NO_MOTORWAY 20 IN_CITY 21 OUTSIDE_CITY 22 PEDESTRIAN_AREA 23 NO_PEDESTRIAN_AREA 65 NO_OVERTAKING_LEFT 66 NO_OVERTAKING_RIGHT 67 OVERTAKING_ALLOWED_AGAIN 81 NO_RIGHT_TURN 97 STOP 105 YIELD 113 STOP 114 YIELD_US 129 NO_ENTRY 138 NO_ENTRY_TSS2 145 DO_NOT_ENTER", + .sigs = sigs_1162, + }, + { + .name = "UNITS", + .address = 0x611, + .def_val = "1 KM 2 MILES", + .sigs = sigs_1553, + }, + { + .name = "TURN_SIGNALS", + .address = 0x614, + .def_val = "3 NONE 2 RIGHT 1 LEFT", + .sigs = sigs_1556, + }, +}; + +} + +const DBC toyota_corolla_2017_pt_generated = { + .name = "toyota_corolla_2017_pt_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(toyota_corolla_2017_pt_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/toyota_new_mc_pt_generated.cc b/opendbc/can/dbc_out/toyota_new_mc_pt_generated.cc new file mode 100644 index 000000000..25578d1c0 --- /dev/null +++ b/opendbc/can/dbc_out/toyota_new_mc_pt_generated.cc @@ -0,0 +1,3610 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_35[] = { + { + .name = "ZORRO_STEER", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = true, + .factor = 0.004901594652, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_36[] = { + { + .name = "YAW_RATE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 0.244, + .offset = -125.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_TORQUE", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Y", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = false, + .factor = 0.03589, + .offset = -18.375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_37[] = { + { + .name = "STEER_ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_RATE", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_FRACTION", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_166[] = { + { + .name = "BRAKE_AMOUNT", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PEDAL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_170[] = { + { + .name = "WHEEL_SPEED_FR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_180[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ENCODER", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_295[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "CAR_MOVEMENT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_353[] = { + { + .name = "FORWARD_SPEED", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.00390625, + .offset = -30.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_359[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_452[] = { + { + .name = "RPM", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.78125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_466[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "GAS_RELEASED", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_ACTIVE", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL_ON", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_NET", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATE", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_467[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_548[] = { + { + .name = "BRAKE_PRESSED", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSURE", + .b1 = 44, + .b2 = 12, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_552[] = { + { + .name = "ACCEL_X", + .b1 = 1, + .b2 = 15, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Z", + .b1 = 17, + .b2 = 15, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_560[] = { + { + .name = "BRAKE_PRESSED", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_581[] = { + { + .name = "GAS_PEDAL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_608[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_OVERRIDE", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_DRIVER", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = true, + .factor = 0.0573, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_EPS", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_610[] = { + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "IPAS_STATE", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TYPE", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 7, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_614[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_643[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "SET_ME_X00", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FORCE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X002", + .b1 = 38, + .b2 = 8, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 35, + .b2 = 3, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_STATUS", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X003", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PRECOLLISION_ACTIVE", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_705[] = { + { + .name = "GAS_RELEASED", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PEDAL", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_740[] = { + { + .name = "COUNTER", + .b1 = 1, + .b2 = 6, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_REQUEST", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_CMD", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_742[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LEAD_LONG_DIST", + .b1 = 0, + .b2 = 13, + .bo = 51, + .is_signed = false, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_REL_SPEED", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_767[] = { + { + .name = "FD_BUTTON", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_835[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ALLOW_LONG_PRESS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_MALFUNCTION", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_DIRTY", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_TYPE", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_CUT_IN", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ITS_CONNECT_LEAD", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_836[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, +}; +const Signal sigs_869[] = { + { + .name = "MAIN_ON", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_BTN", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_BTN", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RES_BTN", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_REQUEST", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 100, + .offset = -12800.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_DISTANCE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_921[] = { + { + .name = "MAIN_ON", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_STATE", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE_LINES", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_SET_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_951[] = { + { + .name = "VSC_DISABLED", + .b1 = 11, + .b2 = 2, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TC_DISABLED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS_ACC", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_956[] = { + { + .name = "SPORT_ON", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPORT_GEAR_ON", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPORT_GEAR", + .b1 = 33, + .b2 = 3, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ECON_ON", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "B_GEAR_ENGAGED", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DRIVE_ENGAGED", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1005[] = { + { + .name = "REVERSE_CAMERA_GUIDELINES", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1009[] = { + { + .name = "CRUISE_STATE", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1020[] = { + { + .name = "LUX_SENSOR", + .b1 = 48, + .b2 = 13, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1041[] = { + { + .name = "FCW", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCS_INDICATOR", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X20", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCS_OFF", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCS_SENSITIVITY", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1042[] = { + { + .name = "BARRIERS", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_LINE", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_LINE", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_STATUS", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_ALERT", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_EXIST", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TWO_BEEPS", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ADJUSTING_CAMERA", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_UNAVAILABLE_QUIET", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_MALFUNCTION", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_UNAVAILABLE", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_SENSITIVITY", + .b1 = 21, + .b2 = 2, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_SA_TOGGLE", + .b1 = 19, + .b2 = 2, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_SPEED_TOO_LOW", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_ON_MESSAGE", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REPEATED_BEEPS", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_TOGGLE", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_SENSITIVITY", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TAKE_CONTROL", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_FRONT_CAMERA_BLOCKED", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_BUZZER", + .b1 = 53, + .b2 = 2, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_FLD", + .b1 = 50, + .b2 = 3, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_WARNING", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X02", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1043[] = { + { + .name = "YEAR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MONTH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAY", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HOUR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINUTE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_MINUTES", + .b1 = 53, + .b2 = 6, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_HOURS", + .b1 = 49, + .b2 = 4, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMT_DIFF", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SUMMER", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1083[] = { + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1161[] = { + { + .name = "TSGN1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT1", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY1", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL1", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN2", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN1", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN2", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT2", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY2", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL2", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID1", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_A", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_P", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1162[] = { + { + .name = "TSGN3", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT3", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY3", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN4", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN3", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN4", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT4", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY4", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMA", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMP", + .b1 = 50, + .b2 = 3, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DPSGNREQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID2", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRWMSG", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDUNT", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1163[] = { + { + .name = "OVSPNTM", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NTLVLSPD", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OTSGNNTM", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRMSW", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSREQPD", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALL", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALH", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRSPU", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1408[] = { + { + .name = "VIN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_3", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_4", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_5", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_6", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_7", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_8", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1409[] = { + { + .name = "VIN_9", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_10", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_11", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_12", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_13", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_14", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_15", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_16", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1410[] = { + { + .name = "VIN_17", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1552[] = { + { + .name = "METER_SLIDER_BRIGHTNESS_PCT", + .b1 = 25, + .b2 = 7, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "METER_SLIDER_LOW_BRIGHTNESS", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "METER_SLIDER_DIMMED", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1553[] = { + { + .name = "UNITS", + .b1 = 29, + .b2 = 2, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 44, + .b2 = 20, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1556[] = { + { + .name = "HAZARD_LIGHT", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TURN_SIGNALS", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1568[] = { + { + .name = "METER_DIMMED", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARKING_BRAKE", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1570[] = { + { + .name = "FRONT_FOG", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARKING_LIGHT", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAM", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAYTIME_RUNNING_LIGHT", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGH_BEAM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1571[] = { + { + .name = "DOOR_LOCK_FEEDBACK_LIGHT", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "KEYFOB_LOCKING_FEEDBACK_LIGHT", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "KEYFOB_UNLOCKING_FEEDBACK_LIGHT", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1592[] = { + { + .name = "LOCK_STATUS_CHANGED", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOCK_STATUS", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOCKED_VIA_KEYFOB", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "SECONDARY_STEER_ANGLE", + .address = 0x23, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_35), + .sigs = sigs_35, + }, + { + .name = "KINEMATICS", + .address = 0x24, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_36), + .sigs = sigs_36, + }, + { + .name = "STEER_ANGLE_SENSOR", + .address = 0x25, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_37), + .sigs = sigs_37, + }, + { + .name = "BRAKE", + .address = 0xA6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_166), + .sigs = sigs_166, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0xAA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_170), + .sigs = sigs_170, + }, + { + .name = "SPEED", + .address = 0xB4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_180), + .sigs = sigs_180, + }, + { + .name = "GEAR_PACKET_HYBRID", + .address = 0x127, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_295), + .sigs = sigs_295, + }, + { + .name = "DSU_SPEED", + .address = 0x161, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_353), + .sigs = sigs_353, + }, + { + .name = "STEERING_IPAS_COMMA", + .address = 0x167, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_359), + .sigs = sigs_359, + }, + { + .name = "ENGINE_RPM", + .address = 0x1C4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_452), + .sigs = sigs_452, + }, + { + .name = "PCM_CRUISE", + .address = 0x1D2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_466), + .sigs = sigs_466, + }, + { + .name = "PCM_CRUISE_2", + .address = 0x1D3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_467), + .sigs = sigs_467, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "BRAKE_MODULE", + .address = 0x224, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_548), + .sigs = sigs_548, + }, + { + .name = "ACCELEROMETER", + .address = 0x228, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_552), + .sigs = sigs_552, + }, + { + .name = "BRAKE_2", + .address = 0x230, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_560), + .sigs = sigs_560, + }, + { + .name = "GAS_PEDAL_HYBRID", + .address = 0x245, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_581), + .sigs = sigs_581, + }, + { + .name = "STEER_TORQUE_SENSOR", + .address = 0x260, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_608), + .sigs = sigs_608, + }, + { + .name = "EPS_STATUS", + .address = 0x262, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_610), + .sigs = sigs_610, + }, + { + .name = "STEERING_IPAS", + .address = 0x266, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_614), + .sigs = sigs_614, + }, + { + .name = "PRE_COLLISION", + .address = 0x283, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_643), + .sigs = sigs_643, + }, + { + .name = "GAS_PEDAL", + .address = 0x2C1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_705), + .sigs = sigs_705, + }, + { + .name = "STEERING_LKA", + .address = 0x2E4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_740), + .sigs = sigs_740, + }, + { + .name = "LEAD_INFO", + .address = 0x2E6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_742), + .sigs = sigs_742, + }, + { + .name = "SDSU", + .address = 0x2FF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_767), + .sigs = sigs_767, + }, + { + .name = "ACC_CONTROL", + .address = 0x343, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_835), + .sigs = sigs_835, + }, + { + .name = "PRE_COLLISION_2", + .address = 0x344, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_836), + .sigs = sigs_836, + }, + { + .name = "DSU_CRUISE", + .address = 0x365, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_869), + .sigs = sigs_869, + }, + { + .name = "PCM_CRUISE_SM", + .address = 0x399, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_921), + .sigs = sigs_921, + }, + { + .name = "ESP_CONTROL", + .address = 0x3B7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_951), + .sigs = sigs_951, + }, + { + .name = "GEAR_PACKET", + .address = 0x3BC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_956), + .sigs = sigs_956, + }, + { + .name = "REVERSE_CAMERA_STATE", + .address = 0x3ED, + .size = 2, + .num_sigs = ARRAYSIZE(sigs_1005), + .sigs = sigs_1005, + }, + { + .name = "PCM_CRUISE_ALT", + .address = 0x3F1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1009), + .sigs = sigs_1009, + }, + { + .name = "SOLAR_SENSOR", + .address = 0x3FC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1020), + .sigs = sigs_1020, + }, + { + .name = "ACC_HUD", + .address = 0x411, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1041), + .sigs = sigs_1041, + }, + { + .name = "LKAS_HUD", + .address = 0x412, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1042), + .sigs = sigs_1042, + }, + { + .name = "TIME", + .address = 0x413, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1043), + .sigs = sigs_1043, + }, + { + .name = "AUTOPARK_STATUS", + .address = 0x43B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1083), + .sigs = sigs_1083, + }, + { + .name = "RSA1", + .address = 0x489, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1161), + .sigs = sigs_1161, + }, + { + .name = "RSA2", + .address = 0x48A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1162), + .sigs = sigs_1162, + }, + { + .name = "RSA3", + .address = 0x48B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1163), + .sigs = sigs_1163, + }, + { + .name = "VIN_PART_1", + .address = 0x580, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1408), + .sigs = sigs_1408, + }, + { + .name = "VIN_PART_2", + .address = 0x581, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1409), + .sigs = sigs_1409, + }, + { + .name = "VIN_PART_3", + .address = 0x582, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1410), + .sigs = sigs_1410, + }, + { + .name = "BODY_CONTROL_STATE_2", + .address = 0x610, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1552), + .sigs = sigs_1552, + }, + { + .name = "UI_SETTING", + .address = 0x611, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1553), + .sigs = sigs_1553, + }, + { + .name = "BLINKERS_STATE", + .address = 0x614, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1556), + .sigs = sigs_1556, + }, + { + .name = "BODY_CONTROL_STATE", + .address = 0x620, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1568), + .sigs = sigs_1568, + }, + { + .name = "LIGHT_STALK", + .address = 0x622, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1570), + .sigs = sigs_1570, + }, + { + .name = "CERTIFICATION_ECU", + .address = 0x623, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1571), + .sigs = sigs_1571, + }, + { + .name = "DOOR_LOCKS", + .address = 0x638, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1592), + .sigs = sigs_1592, + }, +}; + +const Val vals[] = { + { + .name = "GEAR", + .address = 0x127, + .def_val = "0 P 1 R 2 N 3 D 4 B", + .sigs = sigs_295, + }, + { + .name = "CRUISE_STATE", + .address = 0x1D2, + .def_val = "11 TIMER_3SEC 10 ADAPTIVE_CLICK_DOWN 9 ADAPTIVE_CLICK_UP 8 ADAPTIVE_ENGAGED 7 STANDSTILL 6 NON-ADAPTIVE_CLICK_UP 5 NON-ADAPTIVE_CLICK_DOWN 4 NON-ADAPTIVE_HOLD_DOWN 3 NON-ADAPTIVE_HOLD_UP 2 NON-ADAPTIVE_BEING_ENGAGED 1 NON-ADAPTIVE_ENGAGED 0 OFF", + .sigs = sigs_466, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .address = 0x1D3, + .def_val = "2 LOW_SPEED_LOCKED 1 OK", + .sigs = sigs_467, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "IPAS_STATE", + .address = 0x262, + .def_val = "5 OVERRIDE 3 ENABLED 1 DISABLED", + .sigs = sigs_610, + }, + { + .name = "LKA_STATE", + .address = 0x262, + .def_val = "25 TEMPORARY_FAULT 9 TEMPORARY_FAULT2 5 ACTIVE 1 STANDBY", + .sigs = sigs_610, + }, + { + .name = "DIRECTION_CMD", + .address = 0x266, + .def_val = "3 RIGHT 2 CENTER 1 LEFT", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x266, + .def_val = "3 ENABLED 1 DISABLED", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x283, + .def_val = "0 NORMAL 1 ADAPTIVE_CRUISE_CONTROL 3 EMERGENCY_BRAKING", + .sigs = sigs_643, + }, + { + .name = "ACC_CUT_IN", + .address = 0x343, + .def_val = "1 CUT-IN_DETECTED 0 CLEAR", + .sigs = sigs_835, + }, + { + .name = "ACC_MALFUNCTION", + .address = 0x343, + .def_val = "1 FAULTED 0 OK", + .sigs = sigs_835, + }, + { + .name = "ACC_TYPE", + .address = 0x343, + .def_val = "2 PERMANENT_LOW_SPEED_LOCKOUT 1 OK", + .sigs = sigs_835, + }, + { + .name = "ALLOW_LONG_PRESS", + .address = 0x343, + .def_val = "2 SET_SPEED_INCREASE_BY_5_SPEED_UNITS_REGARDLESS 1 SET_SPEED_INCREASE_BY_1_SPEED_UNIT_ON_SHORT_PRESS,_5_SPEED_UNITS_ON_LONG_PRESS", + .sigs = sigs_835, + }, + { + .name = "CRUISE_CONTROL_STATE", + .address = 0x399, + .def_val = "2 DISABLED 11 HOLD 10 HOLD_WAITING_USER_CMD 6 ENABLED 5 FAULTED", + .sigs = sigs_921, + }, + { + .name = "B_GEAR_ENGAGED", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "DRIVE_ENGAGED", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "ECON_ON", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "GEAR", + .address = 0x3BC, + .def_val = "0 D 1 S 8 N 16 R 32 P", + .sigs = sigs_956, + }, + { + .name = "SPORT_GEAR", + .address = 0x3BC, + .def_val = "1 S1 2 S2 3 S3 4 S4 5 S5 6 S6", + .sigs = sigs_956, + }, + { + .name = "SPORT_GEAR_ON", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "SPORT_ON", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "REVERSE_CAMERA_GUIDELINES", + .address = 0x3ED, + .def_val = "3 NO_GUIDELINES 2 STATIC_GUIDELINES 1 ACTIVE_GUIDELINES", + .sigs = sigs_1005, + }, + { + .name = "PCS_INDICATOR", + .address = 0x411, + .def_val = "2 PCS_FAULTED 1 PCS_TURNED_OFF_BY_USER 0 PCS_ENABLED", + .sigs = sigs_1041, + }, + { + .name = "PCS_SENSITIVITY", + .address = 0x411, + .def_val = "64 HIGH_SENSITIVITY 128 MID_SENSITIVITY 192 LOW_SENSITIVITY 0 OFF", + .sigs = sigs_1041, + }, + { + .name = "BARRIERS", + .address = 0x412, + .def_val = "3 LEFT 2 RIGHT 1 BOTH 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LANE_SWAY_BUZZER", + .address = 0x412, + .def_val = "3 OK 2 BEEP_TWICE 1 BEEP_TWICE 0 OK", + .sigs = sigs_1042, + }, + { + .name = "LANE_SWAY_WARNING", + .address = 0x412, + .def_val = "3 OK 2 ORANGE_PLEASE_TAKE_A_BREAK 1 PROMPT_WOULD_YOU_LIKE_TO_TAKE_A_BREAK 0 OK", + .sigs = sigs_1042, + }, + { + .name = "LDA_ALERT", + .address = 0x412, + .def_val = "3 HOLD_WITH_CONTINUOUS_BEEP 2 LDA_UNAVAILABLE 1 HOLD 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LDA_FRONT_CAMERA_BLOCKED", + .address = 0x412, + .def_val = "1 LDA_UNAVAILABLE 0 OK", + .sigs = sigs_1042, + }, + { + .name = "LDA_ON_MESSAGE", + .address = 0x412, + .def_val = "2 LANE_DEPARTURE_ALERT_TURNED_ON,_STEERING_ASSIST_INACTIVE 1 LANE_DEPARTURE_ALERT_TURNED_ON,_STEERING_ASSIST_ACTIVE 0 CLEAR", + .sigs = sigs_1042, + }, + { + .name = "LDA_SA_TOGGLE", + .address = 0x412, + .def_val = " 2 STEERING_ASSIST_OFF 1 STEERING_ASSIST_ON", + .sigs = sigs_1042, + }, + { + .name = "LDA_SENSITIVITY", + .address = 0x412, + .def_val = "2 STANDARD 1 HIGH 0 UNDEFINED", + .sigs = sigs_1042, + }, + { + .name = "LDA_SPEED_TOO_LOW", + .address = 0x412, + .def_val = "1 LDA_UNAVAILABLE,_SPEED_TOO_LOW 0 OK", + .sigs = sigs_1042, + }, + { + .name = "LEFT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LKAS_STATUS", + .address = 0x412, + .def_val = "1 ON 0 OFF", + .sigs = sigs_1042, + }, + { + .name = "RIGHT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "TAKE_CONTROL", + .address = 0x412, + .def_val = "1 TAKE_CONTROL 0 OK", + .sigs = sigs_1042, + }, + { + .name = "SPLSGN2", + .address = 0x489, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN1", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN2", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "SPLSGN3", + .address = 0x48A, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1162, + }, + { + .name = "TSGN3", + .address = 0x48A, + .def_val = "0 NONE 1 SPEED_SIGN 2 0_UNLIMITED 7 UNLIMITED 16 HIGHWAY 17 NO_HIGHWAY 18 MOTORWAY 19 NO_MOTORWAY 20 IN_CITY 21 OUTSIDE_CITY 22 PEDESTRIAN_AREA 23 NO_PEDESTRIAN_AREA 65 NO_OVERTAKING_LEFT 66 NO_OVERTAKING_RIGHT 67 OVERTAKING_ALLOWED_AGAIN 81 NO_RIGHT_TURN 97 STOP 105 YIELD 113 STOP 114 YIELD_US 129 NO_ENTRY 138 NO_ENTRY_TSS2 145 DO_NOT_ENTER", + .sigs = sigs_1162, + }, + { + .name = "METER_SLIDER_DIMMED", + .address = 0x610, + .def_val = "1 DIMMED 0 NOT_DIMMED", + .sigs = sigs_1552, + }, + { + .name = "METER_SLIDER_LOW_BRIGHTNESS", + .address = 0x610, + .def_val = "1 LOW_BRIGHTNESS_MODE,_FOOTWELL_LIGHTS_OFF 0 NORMAL_MODE,_FOOTWELL_LIGHTS_ON", + .sigs = sigs_1552, + }, + { + .name = "UNITS", + .address = 0x611, + .def_val = "1 KM 2 MILES", + .sigs = sigs_1553, + }, + { + .name = "TURN_SIGNALS", + .address = 0x614, + .def_val = "3 NONE 2 RIGHT 1 LEFT", + .sigs = sigs_1556, + }, + { + .name = "LOCK_STATUS", + .address = 0x638, + .def_val = "0 LOCKED 1 UNLOCKED", + .sigs = sigs_1592, + }, +}; + +} + +const DBC toyota_new_mc_pt_generated = { + .name = "toyota_new_mc_pt_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(toyota_new_mc_pt_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/toyota_nodsu_pt_generated.cc b/opendbc/can/dbc_out/toyota_nodsu_pt_generated.cc new file mode 100644 index 000000000..c4b82ce73 --- /dev/null +++ b/opendbc/can/dbc_out/toyota_nodsu_pt_generated.cc @@ -0,0 +1,4174 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_35[] = { + { + .name = "ZORRO_STEER", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = true, + .factor = 0.004901594652, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_36[] = { + { + .name = "YAW_RATE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 0.244, + .offset = -125.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_TORQUE", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Y", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = false, + .factor = 0.03589, + .offset = -18.375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_37[] = { + { + .name = "STEER_ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_RATE", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_FRACTION", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_166[] = { + { + .name = "BRAKE_AMOUNT", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PEDAL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_170[] = { + { + .name = "WHEEL_SPEED_FR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_180[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ENCODER", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_241[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X3", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_242[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "DECELERATION", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DS1STBK2", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DS1STAT2", + .b1 = 10, + .b2 = 3, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSOPR", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSALM", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSWAR", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IRLT_REQ", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEXTRGR", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IBTRGR", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PPTRGR", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBATRGR", + .b1 = 25, + .b2 = 2, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSABK", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBRTRGR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PREFILL", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VGRSTRGR", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AVSTRGR", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRKHLD", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBPREPMP", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSDIS", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_295[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "CAR_MOVEMENT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_353[] = { + { + .name = "FORWARD_SPEED", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.00390625, + .offset = -30.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_359[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_401[] = { + { + .name = "COUNTER", + .b1 = 1, + .b2 = 6, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_REQUEST_2", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SETME_X1", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE_CMD", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.0573, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_REQUEST", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SETME_X3", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BIT", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERCENTAGE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SETME_X64", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ANGLE", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = true, + .factor = 0.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_452[] = { + { + .name = "RPM", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.78125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_466[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "GAS_RELEASED", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_ACTIVE", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL_ON", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_NET", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATE", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_467[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_550[] = { + { + .name = "BRAKE_PRESSURE", + .b1 = 7, + .b2 = 9, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_POSITION", + .b1 = 23, + .b2 = 9, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_552[] = { + { + .name = "ACCEL_X", + .b1 = 1, + .b2 = 15, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Z", + .b1 = 17, + .b2 = 15, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_560[] = { + { + .name = "BRAKE_PRESSED", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_581[] = { + { + .name = "GAS_PEDAL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_608[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_OVERRIDE", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_DRIVER", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = true, + .factor = 0.0573, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_EPS", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_610[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "IPAS_STATE", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TYPE", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 7, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_614[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_643[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "SET_ME_X00", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FORCE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X002", + .b1 = 38, + .b2 = 8, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 35, + .b2 = 3, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_STATUS", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X003", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PRECOLLISION_ACTIVE", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_705[] = { + { + .name = "GAS_RELEASED", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PEDAL", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_740[] = { + { + .name = "COUNTER", + .b1 = 1, + .b2 = 6, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_REQUEST", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_CMD", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_742[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LEAD_LONG_DIST", + .b1 = 0, + .b2 = 13, + .bo = 51, + .is_signed = false, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_REL_SPEED", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_767[] = { + { + .name = "FD_BUTTON", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_835[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ALLOW_LONG_PRESS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_MALFUNCTION", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_DIRTY", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_TYPE", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_CUT_IN", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ITS_CONNECT_LEAD", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_836[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, +}; +const Signal sigs_869[] = { + { + .name = "MAIN_ON", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_BTN", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_BTN", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RES_BTN", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_REQUEST", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 100, + .offset = -12800.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_DISTANCE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_921[] = { + { + .name = "MAIN_ON", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_STATE", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE_LINES", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_SET_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_951[] = { + { + .name = "VSC_DISABLED", + .b1 = 11, + .b2 = 2, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TC_DISABLED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS_ACC", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_956[] = { + { + .name = "SPORT_ON", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPORT_GEAR_ON", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPORT_GEAR", + .b1 = 33, + .b2 = 3, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ECON_ON", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "B_GEAR_ENGAGED", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DRIVE_ENGAGED", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1005[] = { + { + .name = "REVERSE_CAMERA_GUIDELINES", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1009[] = { + { + .name = "CRUISE_STATE", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1014[] = { + { + .name = "L_ADJACENT", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "R_ADJACENT", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ADJACENT_ENABLED", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "L_APPROACHING", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "R_APPROACHING", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "APPROACHING_ENABLED", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1020[] = { + { + .name = "LUX_SENSOR", + .b1 = 48, + .b2 = 13, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1041[] = { + { + .name = "FCW", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCS_INDICATOR", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X20", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCS_OFF", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCS_SENSITIVITY", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1042[] = { + { + .name = "BARRIERS", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_LINE", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_LINE", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_STATUS", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_ALERT", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_EXIST", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TWO_BEEPS", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ADJUSTING_CAMERA", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_UNAVAILABLE_QUIET", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_MALFUNCTION", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_UNAVAILABLE", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_SENSITIVITY", + .b1 = 21, + .b2 = 2, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_SA_TOGGLE", + .b1 = 19, + .b2 = 2, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_SPEED_TOO_LOW", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_ON_MESSAGE", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REPEATED_BEEPS", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_TOGGLE", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_SENSITIVITY", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TAKE_CONTROL", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_FRONT_CAMERA_BLOCKED", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_BUZZER", + .b1 = 53, + .b2 = 2, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_FLD", + .b1 = 50, + .b2 = 3, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_WARNING", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X02", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1043[] = { + { + .name = "YEAR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MONTH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAY", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HOUR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINUTE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_MINUTES", + .b1 = 53, + .b2 = 6, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_HOURS", + .b1 = 49, + .b2 = 4, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMT_DIFF", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SUMMER", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1083[] = { + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1161[] = { + { + .name = "TSGN1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT1", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY1", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL1", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN2", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN1", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN2", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT2", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY2", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL2", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID1", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_A", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_P", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1162[] = { + { + .name = "TSGN3", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT3", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY3", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN4", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN3", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN4", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT4", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY4", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMA", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMP", + .b1 = 50, + .b2 = 3, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DPSGNREQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID2", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRWMSG", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDUNT", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1163[] = { + { + .name = "OVSPNTM", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NTLVLSPD", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OTSGNNTM", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRMSW", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSREQPD", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALL", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALH", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRSPU", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1408[] = { + { + .name = "VIN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_3", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_4", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_5", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_6", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_7", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_8", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1409[] = { + { + .name = "VIN_9", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_10", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_11", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_12", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_13", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_14", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_15", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_16", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1410[] = { + { + .name = "VIN_17", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1552[] = { + { + .name = "METER_SLIDER_BRIGHTNESS_PCT", + .b1 = 25, + .b2 = 7, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "METER_SLIDER_LOW_BRIGHTNESS", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "METER_SLIDER_DIMMED", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1553[] = { + { + .name = "UNITS", + .b1 = 29, + .b2 = 2, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 44, + .b2 = 20, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1556[] = { + { + .name = "HAZARD_LIGHT", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TURN_SIGNALS", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1568[] = { + { + .name = "METER_DIMMED", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARKING_BRAKE", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1570[] = { + { + .name = "FRONT_FOG", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARKING_LIGHT", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAM", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAYTIME_RUNNING_LIGHT", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGH_BEAM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1571[] = { + { + .name = "DOOR_LOCK_FEEDBACK_LIGHT", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "KEYFOB_LOCKING_FEEDBACK_LIGHT", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "KEYFOB_UNLOCKING_FEEDBACK_LIGHT", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1592[] = { + { + .name = "LOCK_STATUS_CHANGED", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOCK_STATUS", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOCKED_VIA_KEYFOB", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "SECONDARY_STEER_ANGLE", + .address = 0x23, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_35), + .sigs = sigs_35, + }, + { + .name = "KINEMATICS", + .address = 0x24, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_36), + .sigs = sigs_36, + }, + { + .name = "STEER_ANGLE_SENSOR", + .address = 0x25, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_37), + .sigs = sigs_37, + }, + { + .name = "BRAKE", + .address = 0xA6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_166), + .sigs = sigs_166, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0xAA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_170), + .sigs = sigs_170, + }, + { + .name = "SPEED", + .address = 0xB4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_180), + .sigs = sigs_180, + }, + { + .name = "ACC_CONTROL_ALT", + .address = 0xF1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_241), + .sigs = sigs_241, + }, + { + .name = "PRECOLLISION_2_ALT", + .address = 0xF2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_242), + .sigs = sigs_242, + }, + { + .name = "GEAR_PACKET_HYBRID", + .address = 0x127, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_295), + .sigs = sigs_295, + }, + { + .name = "DSU_SPEED", + .address = 0x161, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_353), + .sigs = sigs_353, + }, + { + .name = "STEERING_IPAS_COMMA", + .address = 0x167, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_359), + .sigs = sigs_359, + }, + { + .name = "STEERING_LTA", + .address = 0x191, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_401), + .sigs = sigs_401, + }, + { + .name = "ENGINE_RPM", + .address = 0x1C4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_452), + .sigs = sigs_452, + }, + { + .name = "PCM_CRUISE", + .address = 0x1D2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_466), + .sigs = sigs_466, + }, + { + .name = "PCM_CRUISE_2", + .address = 0x1D3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_467), + .sigs = sigs_467, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "BRAKE_MODULE", + .address = 0x226, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_550), + .sigs = sigs_550, + }, + { + .name = "ACCELEROMETER", + .address = 0x228, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_552), + .sigs = sigs_552, + }, + { + .name = "BRAKE_2", + .address = 0x230, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_560), + .sigs = sigs_560, + }, + { + .name = "GAS_PEDAL_HYBRID", + .address = 0x245, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_581), + .sigs = sigs_581, + }, + { + .name = "STEER_TORQUE_SENSOR", + .address = 0x260, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_608), + .sigs = sigs_608, + }, + { + .name = "EPS_STATUS", + .address = 0x262, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_610), + .sigs = sigs_610, + }, + { + .name = "STEERING_IPAS", + .address = 0x266, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_614), + .sigs = sigs_614, + }, + { + .name = "PRE_COLLISION", + .address = 0x283, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_643), + .sigs = sigs_643, + }, + { + .name = "GAS_PEDAL", + .address = 0x2C1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_705), + .sigs = sigs_705, + }, + { + .name = "STEERING_LKA", + .address = 0x2E4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_740), + .sigs = sigs_740, + }, + { + .name = "LEAD_INFO", + .address = 0x2E6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_742), + .sigs = sigs_742, + }, + { + .name = "SDSU", + .address = 0x2FF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_767), + .sigs = sigs_767, + }, + { + .name = "ACC_CONTROL", + .address = 0x343, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_835), + .sigs = sigs_835, + }, + { + .name = "PRE_COLLISION_2", + .address = 0x344, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_836), + .sigs = sigs_836, + }, + { + .name = "DSU_CRUISE", + .address = 0x365, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_869), + .sigs = sigs_869, + }, + { + .name = "PCM_CRUISE_SM", + .address = 0x399, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_921), + .sigs = sigs_921, + }, + { + .name = "ESP_CONTROL", + .address = 0x3B7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_951), + .sigs = sigs_951, + }, + { + .name = "GEAR_PACKET", + .address = 0x3BC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_956), + .sigs = sigs_956, + }, + { + .name = "REVERSE_CAMERA_STATE", + .address = 0x3ED, + .size = 2, + .num_sigs = ARRAYSIZE(sigs_1005), + .sigs = sigs_1005, + }, + { + .name = "PCM_CRUISE_ALT", + .address = 0x3F1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1009), + .sigs = sigs_1009, + }, + { + .name = "BSM", + .address = 0x3F6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1014), + .sigs = sigs_1014, + }, + { + .name = "SOLAR_SENSOR", + .address = 0x3FC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1020), + .sigs = sigs_1020, + }, + { + .name = "ACC_HUD", + .address = 0x411, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1041), + .sigs = sigs_1041, + }, + { + .name = "LKAS_HUD", + .address = 0x412, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1042), + .sigs = sigs_1042, + }, + { + .name = "TIME", + .address = 0x413, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1043), + .sigs = sigs_1043, + }, + { + .name = "AUTOPARK_STATUS", + .address = 0x43B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1083), + .sigs = sigs_1083, + }, + { + .name = "RSA1", + .address = 0x489, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1161), + .sigs = sigs_1161, + }, + { + .name = "RSA2", + .address = 0x48A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1162), + .sigs = sigs_1162, + }, + { + .name = "RSA3", + .address = 0x48B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1163), + .sigs = sigs_1163, + }, + { + .name = "VIN_PART_1", + .address = 0x580, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1408), + .sigs = sigs_1408, + }, + { + .name = "VIN_PART_2", + .address = 0x581, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1409), + .sigs = sigs_1409, + }, + { + .name = "VIN_PART_3", + .address = 0x582, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1410), + .sigs = sigs_1410, + }, + { + .name = "BODY_CONTROL_STATE_2", + .address = 0x610, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1552), + .sigs = sigs_1552, + }, + { + .name = "UI_SETTING", + .address = 0x611, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1553), + .sigs = sigs_1553, + }, + { + .name = "BLINKERS_STATE", + .address = 0x614, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1556), + .sigs = sigs_1556, + }, + { + .name = "BODY_CONTROL_STATE", + .address = 0x620, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1568), + .sigs = sigs_1568, + }, + { + .name = "LIGHT_STALK", + .address = 0x622, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1570), + .sigs = sigs_1570, + }, + { + .name = "CERTIFICATION_ECU", + .address = 0x623, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1571), + .sigs = sigs_1571, + }, + { + .name = "DOOR_LOCKS", + .address = 0x638, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1592), + .sigs = sigs_1592, + }, +}; + +const Val vals[] = { + { + .name = "GEAR", + .address = 0x127, + .def_val = "0 P 1 R 2 N 3 D 4 B", + .sigs = sigs_295, + }, + { + .name = "CRUISE_STATE", + .address = 0x1D2, + .def_val = "11 TIMER_3SEC 10 ADAPTIVE_CLICK_DOWN 9 ADAPTIVE_CLICK_UP 8 ADAPTIVE_ENGAGED 7 STANDSTILL 6 NON-ADAPTIVE_CLICK_UP 5 NON-ADAPTIVE_CLICK_DOWN 4 NON-ADAPTIVE_HOLD_DOWN 3 NON-ADAPTIVE_HOLD_UP 2 NON-ADAPTIVE_BEING_ENGAGED 1 NON-ADAPTIVE_ENGAGED 0 OFF", + .sigs = sigs_466, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .address = 0x1D3, + .def_val = "2 LOW_SPEED_LOCKED 1 OK", + .sigs = sigs_467, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "IPAS_STATE", + .address = 0x262, + .def_val = "5 OVERRIDE 3 ENABLED 1 DISABLED", + .sigs = sigs_610, + }, + { + .name = "LKA_STATE", + .address = 0x262, + .def_val = "25 TEMPORARY_FAULT 9 TEMPORARY_FAULT2 5 ACTIVE 1 STANDBY", + .sigs = sigs_610, + }, + { + .name = "DIRECTION_CMD", + .address = 0x266, + .def_val = "3 RIGHT 2 CENTER 1 LEFT", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x266, + .def_val = "3 ENABLED 1 DISABLED", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x283, + .def_val = "0 NORMAL 1 ADAPTIVE_CRUISE_CONTROL 3 EMERGENCY_BRAKING", + .sigs = sigs_643, + }, + { + .name = "ACC_CUT_IN", + .address = 0x343, + .def_val = "1 CUT-IN_DETECTED 0 CLEAR", + .sigs = sigs_835, + }, + { + .name = "ACC_MALFUNCTION", + .address = 0x343, + .def_val = "1 FAULTED 0 OK", + .sigs = sigs_835, + }, + { + .name = "ACC_TYPE", + .address = 0x343, + .def_val = "2 PERMANENT_LOW_SPEED_LOCKOUT 1 OK", + .sigs = sigs_835, + }, + { + .name = "ALLOW_LONG_PRESS", + .address = 0x343, + .def_val = "2 SET_SPEED_INCREASE_BY_5_SPEED_UNITS_REGARDLESS 1 SET_SPEED_INCREASE_BY_1_SPEED_UNIT_ON_SHORT_PRESS,_5_SPEED_UNITS_ON_LONG_PRESS", + .sigs = sigs_835, + }, + { + .name = "CRUISE_CONTROL_STATE", + .address = 0x399, + .def_val = "2 DISABLED 11 HOLD 10 HOLD_WAITING_USER_CMD 6 ENABLED 5 FAULTED", + .sigs = sigs_921, + }, + { + .name = "B_GEAR_ENGAGED", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "DRIVE_ENGAGED", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "ECON_ON", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "GEAR", + .address = 0x3BC, + .def_val = "0 D 1 S 8 N 16 R 32 P", + .sigs = sigs_956, + }, + { + .name = "SPORT_GEAR", + .address = 0x3BC, + .def_val = "1 S1 2 S2 3 S3 4 S4 5 S5 6 S6", + .sigs = sigs_956, + }, + { + .name = "SPORT_GEAR_ON", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "SPORT_ON", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "REVERSE_CAMERA_GUIDELINES", + .address = 0x3ED, + .def_val = "3 NO_GUIDELINES 2 STATIC_GUIDELINES 1 ACTIVE_GUIDELINES", + .sigs = sigs_1005, + }, + { + .name = "PCS_INDICATOR", + .address = 0x411, + .def_val = "2 PCS_FAULTED 1 PCS_TURNED_OFF_BY_USER 0 PCS_ENABLED", + .sigs = sigs_1041, + }, + { + .name = "PCS_SENSITIVITY", + .address = 0x411, + .def_val = "64 HIGH_SENSITIVITY 128 MID_SENSITIVITY 192 LOW_SENSITIVITY 0 OFF", + .sigs = sigs_1041, + }, + { + .name = "BARRIERS", + .address = 0x412, + .def_val = "3 LEFT 2 RIGHT 1 BOTH 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LANE_SWAY_BUZZER", + .address = 0x412, + .def_val = "3 OK 2 BEEP_TWICE 1 BEEP_TWICE 0 OK", + .sigs = sigs_1042, + }, + { + .name = "LANE_SWAY_WARNING", + .address = 0x412, + .def_val = "3 OK 2 ORANGE_PLEASE_TAKE_A_BREAK 1 PROMPT_WOULD_YOU_LIKE_TO_TAKE_A_BREAK 0 OK", + .sigs = sigs_1042, + }, + { + .name = "LDA_ALERT", + .address = 0x412, + .def_val = "3 HOLD_WITH_CONTINUOUS_BEEP 2 LDA_UNAVAILABLE 1 HOLD 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LDA_FRONT_CAMERA_BLOCKED", + .address = 0x412, + .def_val = "1 LDA_UNAVAILABLE 0 OK", + .sigs = sigs_1042, + }, + { + .name = "LDA_ON_MESSAGE", + .address = 0x412, + .def_val = "2 LANE_DEPARTURE_ALERT_TURNED_ON,_STEERING_ASSIST_INACTIVE 1 LANE_DEPARTURE_ALERT_TURNED_ON,_STEERING_ASSIST_ACTIVE 0 CLEAR", + .sigs = sigs_1042, + }, + { + .name = "LDA_SA_TOGGLE", + .address = 0x412, + .def_val = " 2 STEERING_ASSIST_OFF 1 STEERING_ASSIST_ON", + .sigs = sigs_1042, + }, + { + .name = "LDA_SENSITIVITY", + .address = 0x412, + .def_val = "2 STANDARD 1 HIGH 0 UNDEFINED", + .sigs = sigs_1042, + }, + { + .name = "LDA_SPEED_TOO_LOW", + .address = 0x412, + .def_val = "1 LDA_UNAVAILABLE,_SPEED_TOO_LOW 0 OK", + .sigs = sigs_1042, + }, + { + .name = "LEFT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LKAS_STATUS", + .address = 0x412, + .def_val = "1 ON 0 OFF", + .sigs = sigs_1042, + }, + { + .name = "RIGHT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "TAKE_CONTROL", + .address = 0x412, + .def_val = "1 TAKE_CONTROL 0 OK", + .sigs = sigs_1042, + }, + { + .name = "SPLSGN2", + .address = 0x489, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN1", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN2", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "SPLSGN3", + .address = 0x48A, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1162, + }, + { + .name = "TSGN3", + .address = 0x48A, + .def_val = "0 NONE 1 SPEED_SIGN 2 0_UNLIMITED 7 UNLIMITED 16 HIGHWAY 17 NO_HIGHWAY 18 MOTORWAY 19 NO_MOTORWAY 20 IN_CITY 21 OUTSIDE_CITY 22 PEDESTRIAN_AREA 23 NO_PEDESTRIAN_AREA 65 NO_OVERTAKING_LEFT 66 NO_OVERTAKING_RIGHT 67 OVERTAKING_ALLOWED_AGAIN 81 NO_RIGHT_TURN 97 STOP 105 YIELD 113 STOP 114 YIELD_US 129 NO_ENTRY 138 NO_ENTRY_TSS2 145 DO_NOT_ENTER", + .sigs = sigs_1162, + }, + { + .name = "METER_SLIDER_DIMMED", + .address = 0x610, + .def_val = "1 DIMMED 0 NOT_DIMMED", + .sigs = sigs_1552, + }, + { + .name = "METER_SLIDER_LOW_BRIGHTNESS", + .address = 0x610, + .def_val = "1 LOW_BRIGHTNESS_MODE,_FOOTWELL_LIGHTS_OFF 0 NORMAL_MODE,_FOOTWELL_LIGHTS_ON", + .sigs = sigs_1552, + }, + { + .name = "UNITS", + .address = 0x611, + .def_val = "1 KM 2 MILES", + .sigs = sigs_1553, + }, + { + .name = "TURN_SIGNALS", + .address = 0x614, + .def_val = "3 NONE 2 RIGHT 1 LEFT", + .sigs = sigs_1556, + }, + { + .name = "LOCK_STATUS", + .address = 0x638, + .def_val = "0 LOCKED 1 UNLOCKED", + .sigs = sigs_1592, + }, +}; + +} + +const DBC toyota_nodsu_pt_generated = { + .name = "toyota_nodsu_pt_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(toyota_nodsu_pt_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/toyota_prius_2017_pt_generated.cc b/opendbc/can/dbc_out/toyota_prius_2017_pt_generated.cc new file mode 100644 index 000000000..25a949c8e --- /dev/null +++ b/opendbc/can/dbc_out/toyota_prius_2017_pt_generated.cc @@ -0,0 +1,3226 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_35[] = { + { + .name = "ZORRO_STEER", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = true, + .factor = 0.004901594652, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_36[] = { + { + .name = "YAW_RATE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 0.244, + .offset = -125.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_TORQUE", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Y", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = false, + .factor = 0.03589, + .offset = -18.375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_37[] = { + { + .name = "STEER_ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_RATE", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_FRACTION", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_166[] = { + { + .name = "BRAKE_AMOUNT", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PEDAL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_170[] = { + { + .name = "WHEEL_SPEED_FR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_180[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ENCODER", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_241[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X3", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_242[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "DECELERATION", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DS1STBK2", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DS1STAT2", + .b1 = 10, + .b2 = 3, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSOPR", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSALM", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSWAR", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IRLT_REQ", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEXTRGR", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IBTRGR", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PPTRGR", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBATRGR", + .b1 = 25, + .b2 = 2, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSABK", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBRTRGR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PREFILL", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VGRSTRGR", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AVSTRGR", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRKHLD", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBPREPMP", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSDIS", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_295[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "CAR_MOVEMENT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_353[] = { + { + .name = "FORWARD_SPEED", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.00390625, + .offset = -30.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_359[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_452[] = { + { + .name = "RPM", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.78125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_466[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "GAS_RELEASED", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_ACTIVE", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL_ON", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_NET", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATE", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_467[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_550[] = { + { + .name = "BRAKE_PRESSURE", + .b1 = 7, + .b2 = 9, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_POSITION", + .b1 = 23, + .b2 = 9, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_552[] = { + { + .name = "ACCEL_X", + .b1 = 1, + .b2 = 15, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Z", + .b1 = 17, + .b2 = 15, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_560[] = { + { + .name = "BRAKE_PRESSED", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_581[] = { + { + .name = "GAS_PEDAL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_608[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_OVERRIDE", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_DRIVER", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = true, + .factor = 0.0573, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_EPS", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = 0.66, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_610[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "IPAS_STATE", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TYPE", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 7, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_614[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_643[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "SET_ME_X00", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FORCE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X002", + .b1 = 38, + .b2 = 8, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 35, + .b2 = 3, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_STATUS", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X003", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PRECOLLISION_ACTIVE", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_740[] = { + { + .name = "COUNTER", + .b1 = 1, + .b2 = 6, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_REQUEST", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_CMD", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_742[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LEAD_LONG_DIST", + .b1 = 0, + .b2 = 13, + .bo = 51, + .is_signed = false, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_REL_SPEED", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_835[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X3", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_836[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, +}; +const Signal sigs_869[] = { + { + .name = "MAIN_ON", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_BTN", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_BTN", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RES_BTN", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_REQUEST", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 100, + .offset = -12800.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_DISTANCE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_921[] = { + { + .name = "MAIN_ON", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_STATE", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE_LINES", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_SET_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_951[] = { + { + .name = "VSC_DISABLED", + .b1 = 11, + .b2 = 2, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TC_DISABLED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS_ACC", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1041[] = { + { + .name = "FCW", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X20", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X80", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1042[] = { + { + .name = "BARRIERS", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_LINE", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_LINE", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_ALERT", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01_2", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TWO_BEEPS", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ADJUSTING_CAMERA", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_MALFUNCTION", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X0C", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REPEATED_BEEPS", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X2C", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X38", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X02", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1043[] = { + { + .name = "YEAR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MONTH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAY", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HOUR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINUTE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_MINUTES", + .b1 = 53, + .b2 = 6, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_HOURS", + .b1 = 49, + .b2 = 4, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMT_DIFF", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SUMMER", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1083[] = { + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1161[] = { + { + .name = "TSGN1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT1", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY1", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL1", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN2", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN1", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN2", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT2", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY2", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL2", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID1", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_A", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_P", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1162[] = { + { + .name = "TSGN3", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT3", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY3", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN4", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN3", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN4", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT4", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY4", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMA", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMP", + .b1 = 50, + .b2 = 3, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DPSGNREQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID2", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRWMSG", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDUNT", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1163[] = { + { + .name = "OVSPNTM", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NTLVLSPD", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OTSGNNTM", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRMSW", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSREQPD", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALL", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALH", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRSPU", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1408[] = { + { + .name = "VIN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_3", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_4", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_5", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_6", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_7", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_8", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1409[] = { + { + .name = "VIN_9", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_10", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_11", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_12", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_13", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_14", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_15", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_16", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1410[] = { + { + .name = "VIN_17", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1553[] = { + { + .name = "UNITS", + .b1 = 29, + .b2 = 2, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 44, + .b2 = 20, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1556[] = { + { + .name = "HAZARD_LIGHT", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TURN_SIGNALS", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1568[] = { + { + .name = "DOOR_OPEN_RL", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1570[] = { + { + .name = "FRONT_FOG", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARKING_LIGHT", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAM", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGH_BEAM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "SECONDARY_STEER_ANGLE", + .address = 0x23, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_35), + .sigs = sigs_35, + }, + { + .name = "KINEMATICS", + .address = 0x24, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_36), + .sigs = sigs_36, + }, + { + .name = "STEER_ANGLE_SENSOR", + .address = 0x25, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_37), + .sigs = sigs_37, + }, + { + .name = "BRAKE", + .address = 0xA6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_166), + .sigs = sigs_166, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0xAA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_170), + .sigs = sigs_170, + }, + { + .name = "SPEED", + .address = 0xB4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_180), + .sigs = sigs_180, + }, + { + .name = "ACC_CONTROL_ALT", + .address = 0xF1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_241), + .sigs = sigs_241, + }, + { + .name = "PRECOLLISION_2_ALT", + .address = 0xF2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_242), + .sigs = sigs_242, + }, + { + .name = "GEAR_PACKET", + .address = 0x127, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_295), + .sigs = sigs_295, + }, + { + .name = "DSU_SPEED", + .address = 0x161, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_353), + .sigs = sigs_353, + }, + { + .name = "STEERING_IPAS_COMMA", + .address = 0x167, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_359), + .sigs = sigs_359, + }, + { + .name = "ENGINE_RPM", + .address = 0x1C4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_452), + .sigs = sigs_452, + }, + { + .name = "PCM_CRUISE", + .address = 0x1D2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_466), + .sigs = sigs_466, + }, + { + .name = "PCM_CRUISE_2", + .address = 0x1D3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_467), + .sigs = sigs_467, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "BRAKE_MODULE", + .address = 0x226, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_550), + .sigs = sigs_550, + }, + { + .name = "ACCELEROMETER", + .address = 0x228, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_552), + .sigs = sigs_552, + }, + { + .name = "BRAKE_MODULE2", + .address = 0x230, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_560), + .sigs = sigs_560, + }, + { + .name = "GAS_PEDAL", + .address = 0x245, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_581), + .sigs = sigs_581, + }, + { + .name = "STEER_TORQUE_SENSOR", + .address = 0x260, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_608), + .sigs = sigs_608, + }, + { + .name = "EPS_STATUS", + .address = 0x262, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_610), + .sigs = sigs_610, + }, + { + .name = "STEERING_IPAS", + .address = 0x266, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_614), + .sigs = sigs_614, + }, + { + .name = "PRE_COLLISION", + .address = 0x283, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_643), + .sigs = sigs_643, + }, + { + .name = "STEERING_LKA", + .address = 0x2E4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_740), + .sigs = sigs_740, + }, + { + .name = "LEAD_INFO", + .address = 0x2E6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_742), + .sigs = sigs_742, + }, + { + .name = "ACC_CONTROL", + .address = 0x343, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_835), + .sigs = sigs_835, + }, + { + .name = "PRE_COLLISION_2", + .address = 0x344, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_836), + .sigs = sigs_836, + }, + { + .name = "DSU_CRUISE", + .address = 0x365, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_869), + .sigs = sigs_869, + }, + { + .name = "PCM_CRUISE_SM", + .address = 0x399, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_921), + .sigs = sigs_921, + }, + { + .name = "ESP_CONTROL", + .address = 0x3B7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_951), + .sigs = sigs_951, + }, + { + .name = "ACC_HUD", + .address = 0x411, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1041), + .sigs = sigs_1041, + }, + { + .name = "LKAS_HUD", + .address = 0x412, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1042), + .sigs = sigs_1042, + }, + { + .name = "TIME", + .address = 0x413, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1043), + .sigs = sigs_1043, + }, + { + .name = "AUTOPARK_STATUS", + .address = 0x43B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1083), + .sigs = sigs_1083, + }, + { + .name = "RSA1", + .address = 0x489, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1161), + .sigs = sigs_1161, + }, + { + .name = "RSA2", + .address = 0x48A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1162), + .sigs = sigs_1162, + }, + { + .name = "RSA3", + .address = 0x48B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1163), + .sigs = sigs_1163, + }, + { + .name = "VIN_PART_1", + .address = 0x580, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1408), + .sigs = sigs_1408, + }, + { + .name = "VIN_PART_2", + .address = 0x581, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1409), + .sigs = sigs_1409, + }, + { + .name = "VIN_PART_3", + .address = 0x582, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1410), + .sigs = sigs_1410, + }, + { + .name = "UI_SETTING", + .address = 0x611, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1553), + .sigs = sigs_1553, + }, + { + .name = "STEERING_LEVERS", + .address = 0x614, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1556), + .sigs = sigs_1556, + }, + { + .name = "SEATS_DOORS", + .address = 0x620, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1568), + .sigs = sigs_1568, + }, + { + .name = "LIGHT_STALK", + .address = 0x622, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1570), + .sigs = sigs_1570, + }, +}; + +const Val vals[] = { + { + .name = "GEAR", + .address = 0x127, + .def_val = "0 P 1 R 2 N 3 D 4 B", + .sigs = sigs_295, + }, + { + .name = "CRUISE_STATE", + .address = 0x1D2, + .def_val = "11 TIMER_3SEC 10 ADAPTIVE_CLICK_DOWN 9 ADAPTIVE_CLICK_UP 8 ADAPTIVE_ENGAGED 7 STANDSTILL 6 NON-ADAPTIVE_CLICK_UP 5 NON-ADAPTIVE_CLICK_DOWN 4 NON-ADAPTIVE_HOLD_DOWN 3 NON-ADAPTIVE_HOLD_UP 2 NON-ADAPTIVE_BEING_ENGAGED 1 NON-ADAPTIVE_ENGAGED 0 OFF", + .sigs = sigs_466, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .address = 0x1D3, + .def_val = "2 LOW_SPEED_LOCKED 1 OK", + .sigs = sigs_467, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "IPAS_STATE", + .address = 0x262, + .def_val = "5 OVERRIDE 3 ENABLED 1 DISABLED", + .sigs = sigs_610, + }, + { + .name = "LKA_STATE", + .address = 0x262, + .def_val = "25 TEMPORARY_FAULT 9 TEMPORARY_FAULT2 5 ACTIVE 1 STANDBY", + .sigs = sigs_610, + }, + { + .name = "DIRECTION_CMD", + .address = 0x266, + .def_val = "3 RIGHT 2 CENTER 1 LEFT", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x266, + .def_val = "3 ENABLED 1 DISABLED", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x283, + .def_val = "0 NORMAL 1 ADAPTIVE_CRUISE_CONTROL 3 EMERGENCY_BRAKING", + .sigs = sigs_643, + }, + { + .name = "CRUISE_CONTROL_STATE", + .address = 0x399, + .def_val = "2 DISABLED 11 HOLD 10 HOLD_WAITING_USER_CMD 6 ENABLED 5 FAULTED", + .sigs = sigs_921, + }, + { + .name = "BARRIERS", + .address = 0x412, + .def_val = "3 BOTH 2 RIGHT 1 LEFT 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LDA_ALERT", + .address = 0x412, + .def_val = "3 HOLD_WITH_CONTINUOUS_BEEP 2 LDA_UNAVAILABLE 1 HOLD 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LEFT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "RIGHT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "SPLSGN2", + .address = 0x489, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN1", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN2", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "SPLSGN3", + .address = 0x48A, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1162, + }, + { + .name = "TSGN3", + .address = 0x48A, + .def_val = "0 NONE 1 SPEED_SIGN 2 0_UNLIMITED 7 UNLIMITED 16 HIGHWAY 17 NO_HIGHWAY 18 MOTORWAY 19 NO_MOTORWAY 20 IN_CITY 21 OUTSIDE_CITY 22 PEDESTRIAN_AREA 23 NO_PEDESTRIAN_AREA 65 NO_OVERTAKING_LEFT 66 NO_OVERTAKING_RIGHT 67 OVERTAKING_ALLOWED_AGAIN 81 NO_RIGHT_TURN 97 STOP 105 YIELD 113 STOP 114 YIELD_US 129 NO_ENTRY 138 NO_ENTRY_TSS2 145 DO_NOT_ENTER", + .sigs = sigs_1162, + }, + { + .name = "UNITS", + .address = 0x611, + .def_val = "1 KM 2 MILES", + .sigs = sigs_1553, + }, + { + .name = "TURN_SIGNALS", + .address = 0x614, + .def_val = "3 NONE 2 RIGHT 1 LEFT", + .sigs = sigs_1556, + }, +}; + +} + +const DBC toyota_prius_2017_pt_generated = { + .name = "toyota_prius_2017_pt_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(toyota_prius_2017_pt_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/toyota_rav4_2017_pt_generated.cc b/opendbc/can/dbc_out/toyota_rav4_2017_pt_generated.cc new file mode 100644 index 000000000..d8c2de7c0 --- /dev/null +++ b/opendbc/can/dbc_out/toyota_rav4_2017_pt_generated.cc @@ -0,0 +1,3173 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_35[] = { + { + .name = "ZORRO_STEER", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = true, + .factor = 0.004901594652, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_36[] = { + { + .name = "YAW_RATE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 0.244, + .offset = -125.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_TORQUE", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Y", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = false, + .factor = 0.03589, + .offset = -18.375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_37[] = { + { + .name = "STEER_ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_RATE", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_FRACTION", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_166[] = { + { + .name = "BRAKE_AMOUNT", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PEDAL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_170[] = { + { + .name = "WHEEL_SPEED_FR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_180[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ENCODER", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_241[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X3", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_242[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "DECELERATION", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DS1STBK2", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DS1STAT2", + .b1 = 10, + .b2 = 3, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSOPR", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSALM", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSWAR", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IRLT_REQ", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEXTRGR", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IBTRGR", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PPTRGR", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBATRGR", + .b1 = 25, + .b2 = 2, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSABK", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBRTRGR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PREFILL", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VGRSTRGR", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AVSTRGR", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRKHLD", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBPREPMP", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSDIS", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_353[] = { + { + .name = "FORWARD_SPEED", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.00390625, + .offset = -30.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_359[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_452[] = { + { + .name = "RPM", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.78125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_466[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "GAS_RELEASED", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_ACTIVE", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL_ON", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_NET", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATE", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_467[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_548[] = { + { + .name = "BRAKE_PRESSED", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSURE", + .b1 = 44, + .b2 = 12, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_552[] = { + { + .name = "ACCEL_X", + .b1 = 1, + .b2 = 15, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Z", + .b1 = 17, + .b2 = 15, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_560[] = { + { + .name = "BRAKE_PRESSED", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_608[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_OVERRIDE", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_DRIVER", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = true, + .factor = 0.0573, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_EPS", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = 0.73, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_610[] = { + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "IPAS_STATE", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TYPE", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 7, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_614[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_643[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "SET_ME_X00", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FORCE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X002", + .b1 = 38, + .b2 = 8, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 35, + .b2 = 3, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_STATUS", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X003", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PRECOLLISION_ACTIVE", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_705[] = { + { + .name = "GAS_RELEASED", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PEDAL", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_740[] = { + { + .name = "COUNTER", + .b1 = 1, + .b2 = 6, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_REQUEST", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_CMD", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_742[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LEAD_LONG_DIST", + .b1 = 0, + .b2 = 13, + .bo = 51, + .is_signed = false, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_REL_SPEED", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_835[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X3", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_836[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, +}; +const Signal sigs_869[] = { + { + .name = "MAIN_ON", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_BTN", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_BTN", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RES_BTN", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_REQUEST", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 100, + .offset = -12800.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_DISTANCE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_921[] = { + { + .name = "MAIN_ON", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_STATE", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE_LINES", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_SET_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_951[] = { + { + .name = "VSC_DISABLED", + .b1 = 11, + .b2 = 2, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TC_DISABLED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS_ACC", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_956[] = { + { + .name = "GEAR", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1041[] = { + { + .name = "FCW", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X20", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X80", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1042[] = { + { + .name = "BARRIERS", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_LINE", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_LINE", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_ALERT", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01_2", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TWO_BEEPS", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ADJUSTING_CAMERA", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_MALFUNCTION", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X0C", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REPEATED_BEEPS", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X2C", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X38", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X02", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1043[] = { + { + .name = "YEAR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MONTH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAY", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HOUR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINUTE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_MINUTES", + .b1 = 53, + .b2 = 6, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_HOURS", + .b1 = 49, + .b2 = 4, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMT_DIFF", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SUMMER", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1161[] = { + { + .name = "TSGN1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT1", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY1", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL1", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN2", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN1", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN2", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT2", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY2", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL2", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID1", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_A", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_P", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1162[] = { + { + .name = "TSGN3", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT3", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY3", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN4", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN3", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN4", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT4", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY4", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMA", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMP", + .b1 = 50, + .b2 = 3, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DPSGNREQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID2", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRWMSG", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDUNT", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1163[] = { + { + .name = "OVSPNTM", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NTLVLSPD", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OTSGNNTM", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRMSW", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSREQPD", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALL", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALH", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRSPU", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1408[] = { + { + .name = "VIN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_3", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_4", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_5", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_6", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_7", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_8", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1409[] = { + { + .name = "VIN_9", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_10", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_11", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_12", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_13", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_14", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_15", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_16", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1410[] = { + { + .name = "VIN_17", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1553[] = { + { + .name = "UNITS", + .b1 = 29, + .b2 = 2, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 44, + .b2 = 20, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1556[] = { + { + .name = "HAZARD_LIGHT", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TURN_SIGNALS", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1568[] = { + { + .name = "DOOR_OPEN_RL", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1570[] = { + { + .name = "FRONT_FOG", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARKING_LIGHT", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAM", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGH_BEAM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "SECONDARY_STEER_ANGLE", + .address = 0x23, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_35), + .sigs = sigs_35, + }, + { + .name = "KINEMATICS", + .address = 0x24, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_36), + .sigs = sigs_36, + }, + { + .name = "STEER_ANGLE_SENSOR", + .address = 0x25, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_37), + .sigs = sigs_37, + }, + { + .name = "BRAKE", + .address = 0xA6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_166), + .sigs = sigs_166, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0xAA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_170), + .sigs = sigs_170, + }, + { + .name = "SPEED", + .address = 0xB4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_180), + .sigs = sigs_180, + }, + { + .name = "ACC_CONTROL_ALT", + .address = 0xF1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_241), + .sigs = sigs_241, + }, + { + .name = "PRECOLLISION_2_ALT", + .address = 0xF2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_242), + .sigs = sigs_242, + }, + { + .name = "DSU_SPEED", + .address = 0x161, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_353), + .sigs = sigs_353, + }, + { + .name = "STEERING_IPAS_COMMA", + .address = 0x167, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_359), + .sigs = sigs_359, + }, + { + .name = "ENGINE_RPM", + .address = 0x1C4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_452), + .sigs = sigs_452, + }, + { + .name = "PCM_CRUISE", + .address = 0x1D2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_466), + .sigs = sigs_466, + }, + { + .name = "PCM_CRUISE_2", + .address = 0x1D3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_467), + .sigs = sigs_467, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "BRAKE_MODULE", + .address = 0x224, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_548), + .sigs = sigs_548, + }, + { + .name = "ACCELEROMETER", + .address = 0x228, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_552), + .sigs = sigs_552, + }, + { + .name = "BRAKE_MODULE2", + .address = 0x230, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_560), + .sigs = sigs_560, + }, + { + .name = "STEER_TORQUE_SENSOR", + .address = 0x260, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_608), + .sigs = sigs_608, + }, + { + .name = "EPS_STATUS", + .address = 0x262, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_610), + .sigs = sigs_610, + }, + { + .name = "STEERING_IPAS", + .address = 0x266, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_614), + .sigs = sigs_614, + }, + { + .name = "PRE_COLLISION", + .address = 0x283, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_643), + .sigs = sigs_643, + }, + { + .name = "GAS_PEDAL", + .address = 0x2C1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_705), + .sigs = sigs_705, + }, + { + .name = "STEERING_LKA", + .address = 0x2E4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_740), + .sigs = sigs_740, + }, + { + .name = "LEAD_INFO", + .address = 0x2E6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_742), + .sigs = sigs_742, + }, + { + .name = "ACC_CONTROL", + .address = 0x343, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_835), + .sigs = sigs_835, + }, + { + .name = "PRE_COLLISION_2", + .address = 0x344, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_836), + .sigs = sigs_836, + }, + { + .name = "DSU_CRUISE", + .address = 0x365, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_869), + .sigs = sigs_869, + }, + { + .name = "PCM_CRUISE_SM", + .address = 0x399, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_921), + .sigs = sigs_921, + }, + { + .name = "ESP_CONTROL", + .address = 0x3B7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_951), + .sigs = sigs_951, + }, + { + .name = "GEAR_PACKET", + .address = 0x3BC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_956), + .sigs = sigs_956, + }, + { + .name = "ACC_HUD", + .address = 0x411, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1041), + .sigs = sigs_1041, + }, + { + .name = "LKAS_HUD", + .address = 0x412, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1042), + .sigs = sigs_1042, + }, + { + .name = "TIME", + .address = 0x413, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1043), + .sigs = sigs_1043, + }, + { + .name = "RSA1", + .address = 0x489, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1161), + .sigs = sigs_1161, + }, + { + .name = "RSA2", + .address = 0x48A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1162), + .sigs = sigs_1162, + }, + { + .name = "RSA3", + .address = 0x48B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1163), + .sigs = sigs_1163, + }, + { + .name = "VIN_PART_1", + .address = 0x580, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1408), + .sigs = sigs_1408, + }, + { + .name = "VIN_PART_2", + .address = 0x581, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1409), + .sigs = sigs_1409, + }, + { + .name = "VIN_PART_3", + .address = 0x582, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1410), + .sigs = sigs_1410, + }, + { + .name = "UI_SETTING", + .address = 0x611, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1553), + .sigs = sigs_1553, + }, + { + .name = "STEERING_LEVERS", + .address = 0x614, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1556), + .sigs = sigs_1556, + }, + { + .name = "SEATS_DOORS", + .address = 0x620, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1568), + .sigs = sigs_1568, + }, + { + .name = "LIGHT_STALK", + .address = 0x622, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1570), + .sigs = sigs_1570, + }, +}; + +const Val vals[] = { + { + .name = "CRUISE_STATE", + .address = 0x1D2, + .def_val = "11 TIMER_3SEC 10 ADAPTIVE_CLICK_DOWN 9 ADAPTIVE_CLICK_UP 8 ADAPTIVE_ENGAGED 7 STANDSTILL 6 NON-ADAPTIVE_CLICK_UP 5 NON-ADAPTIVE_CLICK_DOWN 4 NON-ADAPTIVE_HOLD_DOWN 3 NON-ADAPTIVE_HOLD_UP 2 NON-ADAPTIVE_BEING_ENGAGED 1 NON-ADAPTIVE_ENGAGED 0 OFF", + .sigs = sigs_466, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .address = 0x1D3, + .def_val = "2 LOW_SPEED_LOCKED 1 OK", + .sigs = sigs_467, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "IPAS_STATE", + .address = 0x262, + .def_val = "5 OVERRIDE 3 ENABLED 1 DISABLED", + .sigs = sigs_610, + }, + { + .name = "LKA_STATE", + .address = 0x262, + .def_val = "25 TEMPORARY_FAULT 9 TEMPORARY_FAULT2 5 ACTIVE 1 STANDBY", + .sigs = sigs_610, + }, + { + .name = "DIRECTION_CMD", + .address = 0x266, + .def_val = "3 RIGHT 2 CENTER 1 LEFT", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x266, + .def_val = "3 ENABLED 1 DISABLED", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x283, + .def_val = "0 NORMAL 1 ADAPTIVE_CRUISE_CONTROL 3 EMERGENCY_BRAKING", + .sigs = sigs_643, + }, + { + .name = "CRUISE_CONTROL_STATE", + .address = 0x399, + .def_val = "2 DISABLED 11 HOLD 10 HOLD_WAITING_USER_CMD 6 ENABLED 5 FAULTED", + .sigs = sigs_921, + }, + { + .name = "GEAR", + .address = 0x3BC, + .def_val = "0 D 1 S 8 N 16 R 32 P", + .sigs = sigs_956, + }, + { + .name = "BARRIERS", + .address = 0x412, + .def_val = "3 BOTH 2 RIGHT 1 LEFT 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LDA_ALERT", + .address = 0x412, + .def_val = "3 HOLD_WITH_CONTINUOUS_BEEP 2 LDA_UNAVAILABLE 1 HOLD 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LEFT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "RIGHT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "SPLSGN2", + .address = 0x489, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN1", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN2", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "SPLSGN3", + .address = 0x48A, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1162, + }, + { + .name = "TSGN3", + .address = 0x48A, + .def_val = "0 NONE 1 SPEED_SIGN 2 0_UNLIMITED 7 UNLIMITED 16 HIGHWAY 17 NO_HIGHWAY 18 MOTORWAY 19 NO_MOTORWAY 20 IN_CITY 21 OUTSIDE_CITY 22 PEDESTRIAN_AREA 23 NO_PEDESTRIAN_AREA 65 NO_OVERTAKING_LEFT 66 NO_OVERTAKING_RIGHT 67 OVERTAKING_ALLOWED_AGAIN 81 NO_RIGHT_TURN 97 STOP 105 YIELD 113 STOP 114 YIELD_US 129 NO_ENTRY 138 NO_ENTRY_TSS2 145 DO_NOT_ENTER", + .sigs = sigs_1162, + }, + { + .name = "UNITS", + .address = 0x611, + .def_val = "1 KM 2 MILES", + .sigs = sigs_1553, + }, + { + .name = "TURN_SIGNALS", + .address = 0x614, + .def_val = "3 NONE 2 RIGHT 1 LEFT", + .sigs = sigs_1556, + }, +}; + +} + +const DBC toyota_rav4_2017_pt_generated = { + .name = "toyota_rav4_2017_pt_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(toyota_rav4_2017_pt_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/toyota_tnga_k_pt_generated.cc b/opendbc/can/dbc_out/toyota_tnga_k_pt_generated.cc new file mode 100644 index 000000000..67ae69df5 --- /dev/null +++ b/opendbc/can/dbc_out/toyota_tnga_k_pt_generated.cc @@ -0,0 +1,3969 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_35[] = { + { + .name = "ZORRO_STEER", + .b1 = 0, + .b2 = 24, + .bo = 40, + .is_signed = true, + .factor = 0.004901594652, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_36[] = { + { + .name = "YAW_RATE", + .b1 = 6, + .b2 = 10, + .bo = 48, + .is_signed = false, + .factor = 0.244, + .offset = -125.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEERING_TORQUE", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -512.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Y", + .b1 = 38, + .b2 = 10, + .bo = 16, + .is_signed = false, + .factor = 0.03589, + .offset = -18.375, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_37[] = { + { + .name = "STEER_ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_RATE", + .b1 = 36, + .b2 = 12, + .bo = 16, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_FRACTION", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_166[] = { + { + .name = "BRAKE_AMOUNT", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PEDAL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_170[] = { + { + .name = "WHEEL_SPEED_FR", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_FL", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RR", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "WHEEL_SPEED_RL", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.01, + .offset = -67.67, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_180[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ENCODER", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPEED", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_241[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X3", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_242[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "DECELERATION", + .b1 = 0, + .b2 = 10, + .bo = 54, + .is_signed = true, + .factor = 0.1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DS1STBK2", + .b1 = 13, + .b2 = 3, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DS1STAT2", + .b1 = 10, + .b2 = 3, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSOPR", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSALM", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSWAR", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IRLT_REQ", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CLEXTRGR", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "IBTRGR", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PPTRGR", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBATRGR", + .b1 = 25, + .b2 = 2, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSABK", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBRTRGR", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PREFILL", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VGRSTRGR", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AVSTRGR", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRKHLD", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PBPREPMP", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCSDIS", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_295[] = { + { + .name = "COUNTER", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "CAR_MOVEMENT", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_353[] = { + { + .name = "FORWARD_SPEED", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 0.00390625, + .offset = -30.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_359[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_452[] = { + { + .name = "RPM", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.78125, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_466[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "GAS_RELEASED", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_ACTIVE", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STANDSTILL_ON", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_NET", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_STATE", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_467[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_512[] = { + { + .name = "GAS_COMMAND", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_COMMAND2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "ENABLE", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_513[] = { + { + .name = "INTERCEPTOR_GAS", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.159375, + .offset = -75.555, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "INTERCEPTOR_GAS2", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.159375, + .offset = -151.111, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "COUNTER_PEDAL", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_COUNTER, + }, + { + .name = "STATE", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM_PEDAL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::PEDAL_CHECKSUM, + }, +}; +const Signal sigs_550[] = { + { + .name = "BRAKE_PRESSURE", + .b1 = 7, + .b2 = 9, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_POSITION", + .b1 = 23, + .b2 = 9, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_PRESSED", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_552[] = { + { + .name = "ACCEL_X", + .b1 = 1, + .b2 = 15, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_Z", + .b1 = 17, + .b2 = 15, + .bo = 32, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_560[] = { + { + .name = "BRAKE_PRESSED", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_581[] = { + { + .name = "GAS_PEDAL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_608[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_OVERRIDE", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_DRIVER", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_ANGLE", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = true, + .factor = 0.0573, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_EPS", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_610[] = { + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "IPAS_STATE", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TYPE", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 7, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_614[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ANGLE", + .b1 = 4, + .b2 = 12, + .bo = 48, + .is_signed = true, + .factor = 1.5, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DIRECTION_CMD", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X40", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X00_1", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_643[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "SET_ME_X00", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "FORCE", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = true, + .factor = 2, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X002", + .b1 = 38, + .b2 = 8, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STATE", + .b1 = 35, + .b2 = 3, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_STATUS", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X003", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PRECOLLISION_ACTIVE", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_705[] = { + { + .name = "GAS_RELEASED", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GAS_PEDAL", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.005, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_740[] = { + { + .name = "COUNTER", + .b1 = 1, + .b2 = 6, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "STEER_REQUEST", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_1", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "STEER_TORQUE_CMD", + .b1 = 8, + .b2 = 16, + .bo = 40, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKA_STATE", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_742[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LEAD_LONG_DIST", + .b1 = 0, + .b2 = 13, + .bo = 51, + .is_signed = false, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_REL_SPEED", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_767[] = { + { + .name = "FD_BUTTON", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_835[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "ACCEL_CMD", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = true, + .factor = 0.001, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ALLOW_LONG_PRESS", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_MALFUNCTION", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RADAR_DIRTY", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINI_CAR", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_TYPE", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_REQ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_CUT_IN", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PERMIT_BRAKING", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RELEASE_STANDSTILL", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ITS_CONNECT_LEAD", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ACCEL_CMD_ALT", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = true, + .factor = 0.05, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_836[] = { + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, +}; +const Signal sigs_869[] = { + { + .name = "MAIN_ON", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CANCEL_BTN", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_BTN", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RES_BTN", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_REQUEST", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 100, + .offset = -12800.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEAD_DISTANCE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_921[] = { + { + .name = "MAIN_ON", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CRUISE_CONTROL_STATE", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DISTANCE_LINES", + .b1 = 9, + .b2 = 2, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "UI_SET_SPEED", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_951[] = { + { + .name = "VSC_DISABLED", + .b1 = 11, + .b2 = 2, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TC_DISABLED", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_LIGHTS_ACC", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ENABLED", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BRAKE_HOLD_ACTIVE", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_956[] = { + { + .name = "SPORT_ON", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GEAR", + .b1 = 10, + .b2 = 6, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPORT_GEAR_ON", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPORT_GEAR", + .b1 = 33, + .b2 = 3, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ECON_ON", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "B_GEAR_ENGAGED", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DRIVE_ENGAGED", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1005[] = { + { + .name = "REVERSE_CAMERA_GUIDELINES", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1009[] = { + { + .name = "CRUISE_STATE", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MAIN_ON", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_SPEED", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1020[] = { + { + .name = "LUX_SENSOR", + .b1 = 48, + .b2 = 13, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1041[] = { + { + .name = "FCW", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCS_INDICATOR", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X20", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X10", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCS_OFF", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PCS_SENSITIVITY", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1042[] = { + { + .name = "BARRIERS", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "RIGHT_LINE", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LEFT_LINE", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LKAS_STATUS", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_ALERT", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_EXIST", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TWO_BEEPS", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ADJUSTING_CAMERA", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_UNAVAILABLE_QUIET", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_MALFUNCTION", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_UNAVAILABLE", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_SENSITIVITY", + .b1 = 21, + .b2 = 2, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_SA_TOGGLE", + .b1 = 19, + .b2 = 2, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_SPEED_TOO_LOW", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_ON_MESSAGE", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REPEATED_BEEPS", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X01", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_TOGGLE", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_SENSITIVITY", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TAKE_CONTROL", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LDA_FRONT_CAMERA_BLOCKED", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_BUZZER", + .b1 = 53, + .b2 = 2, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_FLD", + .b1 = 50, + .b2 = 3, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LANE_SWAY_WARNING", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_X02", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1043[] = { + { + .name = "YEAR", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MONTH", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAY", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HOUR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "MINUTE", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_MINUTES", + .b1 = 53, + .b2 = 6, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMTDIFF_HOURS", + .b1 = 49, + .b2 = 4, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "GMT_DIFF", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SUMMER", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1083[] = { + { + .name = "STATE", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1161[] = { + { + .name = "TSGN1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT1", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY1", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL1", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN2", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN1", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN2", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT2", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY2", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDVAL2", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID1", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_A", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "BZRRQ_P", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1162[] = { + { + .name = "TSGN3", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT3", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY3", + .b1 = 11, + .b2 = 3, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN4", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPLSGN3", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGN4", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNHLT4", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSGNGRY4", + .b1 = 43, + .b2 = 3, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMA", + .b1 = 53, + .b2 = 3, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SGNNUMP", + .b1 = 50, + .b2 = 3, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DPSGNREQ", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SYNCID2", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRWMSG", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SPDUNT", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1163[] = { + { + .name = "OVSPNTM", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NTLVLSPD", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OTSGNNTM", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRMSW", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSREQPD", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALL", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALM", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "OVSPVALH", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -5.0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TSRSPU", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1408[] = { + { + .name = "VIN_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_3", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_4", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_5", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_6", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_7", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_8", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1409[] = { + { + .name = "VIN_9", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_10", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_11", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_12", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_13", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_14", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_15", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_16", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1410[] = { + { + .name = "VIN_17", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1552[] = { + { + .name = "METER_SLIDER_BRIGHTNESS_PCT", + .b1 = 25, + .b2 = 7, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "METER_SLIDER_LOW_BRIGHTNESS", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "METER_SLIDER_DIMMED", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1553[] = { + { + .name = "UNITS", + .b1 = 29, + .b2 = 2, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "ODOMETER", + .b1 = 44, + .b2 = 20, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1556[] = { + { + .name = "HAZARD_LIGHT", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "TURN_SIGNALS", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1568[] = { + { + .name = "METER_DIMMED", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RL", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_RR", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FR", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DOOR_OPEN_FL", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARKING_BRAKE", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SEATBELT_DRIVER_UNLATCHED", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1570[] = { + { + .name = "FRONT_FOG", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "PARKING_LIGHT", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOW_BEAM", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "HIGH_BEAM", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "DAYTIME_RUNNING_LIGHT", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "AUTO_HIGH_BEAM", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1571[] = { + { + .name = "DOOR_LOCK_FEEDBACK_LIGHT", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "KEYFOB_LOCKING_FEEDBACK_LIGHT", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "KEYFOB_UNLOCKING_FEEDBACK_LIGHT", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1592[] = { + { + .name = "LOCK_STATUS_CHANGED", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOCK_STATUS", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LOCKED_VIA_KEYFOB", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "SECONDARY_STEER_ANGLE", + .address = 0x23, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_35), + .sigs = sigs_35, + }, + { + .name = "KINEMATICS", + .address = 0x24, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_36), + .sigs = sigs_36, + }, + { + .name = "STEER_ANGLE_SENSOR", + .address = 0x25, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_37), + .sigs = sigs_37, + }, + { + .name = "BRAKE", + .address = 0xA6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_166), + .sigs = sigs_166, + }, + { + .name = "WHEEL_SPEEDS", + .address = 0xAA, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_170), + .sigs = sigs_170, + }, + { + .name = "SPEED", + .address = 0xB4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_180), + .sigs = sigs_180, + }, + { + .name = "ACC_CONTROL_ALT", + .address = 0xF1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_241), + .sigs = sigs_241, + }, + { + .name = "PRECOLLISION_2_ALT", + .address = 0xF2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_242), + .sigs = sigs_242, + }, + { + .name = "GEAR_PACKET_HYBRID", + .address = 0x127, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_295), + .sigs = sigs_295, + }, + { + .name = "DSU_SPEED", + .address = 0x161, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_353), + .sigs = sigs_353, + }, + { + .name = "STEERING_IPAS_COMMA", + .address = 0x167, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_359), + .sigs = sigs_359, + }, + { + .name = "ENGINE_RPM", + .address = 0x1C4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_452), + .sigs = sigs_452, + }, + { + .name = "PCM_CRUISE", + .address = 0x1D2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_466), + .sigs = sigs_466, + }, + { + .name = "PCM_CRUISE_2", + .address = 0x1D3, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_467), + .sigs = sigs_467, + }, + { + .name = "GAS_COMMAND", + .address = 0x200, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_512), + .sigs = sigs_512, + }, + { + .name = "GAS_SENSOR", + .address = 0x201, + .size = 6, + .num_sigs = ARRAYSIZE(sigs_513), + .sigs = sigs_513, + }, + { + .name = "BRAKE_MODULE", + .address = 0x226, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_550), + .sigs = sigs_550, + }, + { + .name = "ACCELEROMETER", + .address = 0x228, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_552), + .sigs = sigs_552, + }, + { + .name = "BRAKE_2", + .address = 0x230, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_560), + .sigs = sigs_560, + }, + { + .name = "GAS_PEDAL_HYBRID", + .address = 0x245, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_581), + .sigs = sigs_581, + }, + { + .name = "STEER_TORQUE_SENSOR", + .address = 0x260, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_608), + .sigs = sigs_608, + }, + { + .name = "EPS_STATUS", + .address = 0x262, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_610), + .sigs = sigs_610, + }, + { + .name = "STEERING_IPAS", + .address = 0x266, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_614), + .sigs = sigs_614, + }, + { + .name = "PRE_COLLISION", + .address = 0x283, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_643), + .sigs = sigs_643, + }, + { + .name = "GAS_PEDAL", + .address = 0x2C1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_705), + .sigs = sigs_705, + }, + { + .name = "STEERING_LKA", + .address = 0x2E4, + .size = 5, + .num_sigs = ARRAYSIZE(sigs_740), + .sigs = sigs_740, + }, + { + .name = "LEAD_INFO", + .address = 0x2E6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_742), + .sigs = sigs_742, + }, + { + .name = "SDSU", + .address = 0x2FF, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_767), + .sigs = sigs_767, + }, + { + .name = "ACC_CONTROL", + .address = 0x343, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_835), + .sigs = sigs_835, + }, + { + .name = "PRE_COLLISION_2", + .address = 0x344, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_836), + .sigs = sigs_836, + }, + { + .name = "DSU_CRUISE", + .address = 0x365, + .size = 7, + .num_sigs = ARRAYSIZE(sigs_869), + .sigs = sigs_869, + }, + { + .name = "PCM_CRUISE_SM", + .address = 0x399, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_921), + .sigs = sigs_921, + }, + { + .name = "ESP_CONTROL", + .address = 0x3B7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_951), + .sigs = sigs_951, + }, + { + .name = "GEAR_PACKET", + .address = 0x3BC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_956), + .sigs = sigs_956, + }, + { + .name = "REVERSE_CAMERA_STATE", + .address = 0x3ED, + .size = 2, + .num_sigs = ARRAYSIZE(sigs_1005), + .sigs = sigs_1005, + }, + { + .name = "PCM_CRUISE_ALT", + .address = 0x3F1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1009), + .sigs = sigs_1009, + }, + { + .name = "SOLAR_SENSOR", + .address = 0x3FC, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1020), + .sigs = sigs_1020, + }, + { + .name = "ACC_HUD", + .address = 0x411, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1041), + .sigs = sigs_1041, + }, + { + .name = "LKAS_HUD", + .address = 0x412, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1042), + .sigs = sigs_1042, + }, + { + .name = "TIME", + .address = 0x413, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1043), + .sigs = sigs_1043, + }, + { + .name = "AUTOPARK_STATUS", + .address = 0x43B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1083), + .sigs = sigs_1083, + }, + { + .name = "RSA1", + .address = 0x489, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1161), + .sigs = sigs_1161, + }, + { + .name = "RSA2", + .address = 0x48A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1162), + .sigs = sigs_1162, + }, + { + .name = "RSA3", + .address = 0x48B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1163), + .sigs = sigs_1163, + }, + { + .name = "VIN_PART_1", + .address = 0x580, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1408), + .sigs = sigs_1408, + }, + { + .name = "VIN_PART_2", + .address = 0x581, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1409), + .sigs = sigs_1409, + }, + { + .name = "VIN_PART_3", + .address = 0x582, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1410), + .sigs = sigs_1410, + }, + { + .name = "BODY_CONTROL_STATE_2", + .address = 0x610, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1552), + .sigs = sigs_1552, + }, + { + .name = "UI_SETTING", + .address = 0x611, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1553), + .sigs = sigs_1553, + }, + { + .name = "BLINKERS_STATE", + .address = 0x614, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1556), + .sigs = sigs_1556, + }, + { + .name = "BODY_CONTROL_STATE", + .address = 0x620, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1568), + .sigs = sigs_1568, + }, + { + .name = "LIGHT_STALK", + .address = 0x622, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1570), + .sigs = sigs_1570, + }, + { + .name = "CERTIFICATION_ECU", + .address = 0x623, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1571), + .sigs = sigs_1571, + }, + { + .name = "DOOR_LOCKS", + .address = 0x638, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1592), + .sigs = sigs_1592, + }, +}; + +const Val vals[] = { + { + .name = "GEAR", + .address = 0x127, + .def_val = "0 P 1 R 2 N 3 D 4 B", + .sigs = sigs_295, + }, + { + .name = "CRUISE_STATE", + .address = 0x1D2, + .def_val = "11 TIMER_3SEC 10 ADAPTIVE_CLICK_DOWN 9 ADAPTIVE_CLICK_UP 8 ADAPTIVE_ENGAGED 7 STANDSTILL 6 NON-ADAPTIVE_CLICK_UP 5 NON-ADAPTIVE_CLICK_DOWN 4 NON-ADAPTIVE_HOLD_DOWN 3 NON-ADAPTIVE_HOLD_UP 2 NON-ADAPTIVE_BEING_ENGAGED 1 NON-ADAPTIVE_ENGAGED 0 OFF", + .sigs = sigs_466, + }, + { + .name = "LOW_SPEED_LOCKOUT", + .address = 0x1D3, + .def_val = "2 LOW_SPEED_LOCKED 1 OK", + .sigs = sigs_467, + }, + { + .name = "STATE", + .address = 0x201, + .def_val = "5 FAULT_TIMEOUT 4 FAULT_STARTUP 3 FAULT_SCE 2 FAULT_SEND 1 FAULT_BAD_CHECKSUM 0 NO_FAULT", + .sigs = sigs_513, + }, + { + .name = "IPAS_STATE", + .address = 0x262, + .def_val = "5 OVERRIDE 3 ENABLED 1 DISABLED", + .sigs = sigs_610, + }, + { + .name = "LKA_STATE", + .address = 0x262, + .def_val = "25 TEMPORARY_FAULT 9 TEMPORARY_FAULT2 5 ACTIVE 1 STANDBY", + .sigs = sigs_610, + }, + { + .name = "DIRECTION_CMD", + .address = 0x266, + .def_val = "3 RIGHT 2 CENTER 1 LEFT", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x266, + .def_val = "3 ENABLED 1 DISABLED", + .sigs = sigs_614, + }, + { + .name = "STATE", + .address = 0x283, + .def_val = "0 NORMAL 1 ADAPTIVE_CRUISE_CONTROL 3 EMERGENCY_BRAKING", + .sigs = sigs_643, + }, + { + .name = "ACC_CUT_IN", + .address = 0x343, + .def_val = "1 CUT-IN_DETECTED 0 CLEAR", + .sigs = sigs_835, + }, + { + .name = "ACC_MALFUNCTION", + .address = 0x343, + .def_val = "1 FAULTED 0 OK", + .sigs = sigs_835, + }, + { + .name = "ACC_TYPE", + .address = 0x343, + .def_val = "2 PERMANENT_LOW_SPEED_LOCKOUT 1 OK", + .sigs = sigs_835, + }, + { + .name = "ALLOW_LONG_PRESS", + .address = 0x343, + .def_val = "2 SET_SPEED_INCREASE_BY_5_SPEED_UNITS_REGARDLESS 1 SET_SPEED_INCREASE_BY_1_SPEED_UNIT_ON_SHORT_PRESS,_5_SPEED_UNITS_ON_LONG_PRESS", + .sigs = sigs_835, + }, + { + .name = "CRUISE_CONTROL_STATE", + .address = 0x399, + .def_val = "2 DISABLED 11 HOLD 10 HOLD_WAITING_USER_CMD 6 ENABLED 5 FAULTED", + .sigs = sigs_921, + }, + { + .name = "B_GEAR_ENGAGED", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "DRIVE_ENGAGED", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "ECON_ON", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "GEAR", + .address = 0x3BC, + .def_val = "0 D 1 S 8 N 16 R 32 P", + .sigs = sigs_956, + }, + { + .name = "SPORT_GEAR", + .address = 0x3BC, + .def_val = "1 S1 2 S2 3 S3 4 S4 5 S5 6 S6", + .sigs = sigs_956, + }, + { + .name = "SPORT_GEAR_ON", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "SPORT_ON", + .address = 0x3BC, + .def_val = "0 OFF 1 ON", + .sigs = sigs_956, + }, + { + .name = "REVERSE_CAMERA_GUIDELINES", + .address = 0x3ED, + .def_val = "3 NO_GUIDELINES 2 STATIC_GUIDELINES 1 ACTIVE_GUIDELINES", + .sigs = sigs_1005, + }, + { + .name = "PCS_INDICATOR", + .address = 0x411, + .def_val = "2 PCS_FAULTED 1 PCS_TURNED_OFF_BY_USER 0 PCS_ENABLED", + .sigs = sigs_1041, + }, + { + .name = "PCS_SENSITIVITY", + .address = 0x411, + .def_val = "64 HIGH_SENSITIVITY 128 MID_SENSITIVITY 192 LOW_SENSITIVITY 0 OFF", + .sigs = sigs_1041, + }, + { + .name = "BARRIERS", + .address = 0x412, + .def_val = "3 LEFT 2 RIGHT 1 BOTH 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LANE_SWAY_BUZZER", + .address = 0x412, + .def_val = "3 OK 2 BEEP_TWICE 1 BEEP_TWICE 0 OK", + .sigs = sigs_1042, + }, + { + .name = "LANE_SWAY_WARNING", + .address = 0x412, + .def_val = "3 OK 2 ORANGE_PLEASE_TAKE_A_BREAK 1 PROMPT_WOULD_YOU_LIKE_TO_TAKE_A_BREAK 0 OK", + .sigs = sigs_1042, + }, + { + .name = "LDA_ALERT", + .address = 0x412, + .def_val = "3 HOLD_WITH_CONTINUOUS_BEEP 2 LDA_UNAVAILABLE 1 HOLD 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LDA_FRONT_CAMERA_BLOCKED", + .address = 0x412, + .def_val = "1 LDA_UNAVAILABLE 0 OK", + .sigs = sigs_1042, + }, + { + .name = "LDA_ON_MESSAGE", + .address = 0x412, + .def_val = "2 LANE_DEPARTURE_ALERT_TURNED_ON,_STEERING_ASSIST_INACTIVE 1 LANE_DEPARTURE_ALERT_TURNED_ON,_STEERING_ASSIST_ACTIVE 0 CLEAR", + .sigs = sigs_1042, + }, + { + .name = "LDA_SA_TOGGLE", + .address = 0x412, + .def_val = " 2 STEERING_ASSIST_OFF 1 STEERING_ASSIST_ON", + .sigs = sigs_1042, + }, + { + .name = "LDA_SENSITIVITY", + .address = 0x412, + .def_val = "2 STANDARD 1 HIGH 0 UNDEFINED", + .sigs = sigs_1042, + }, + { + .name = "LDA_SPEED_TOO_LOW", + .address = 0x412, + .def_val = "1 LDA_UNAVAILABLE,_SPEED_TOO_LOW 0 OK", + .sigs = sigs_1042, + }, + { + .name = "LEFT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "LKAS_STATUS", + .address = 0x412, + .def_val = "1 ON 0 OFF", + .sigs = sigs_1042, + }, + { + .name = "RIGHT_LINE", + .address = 0x412, + .def_val = "3 ORANGE 2 FADED 1 SOLID 0 NONE", + .sigs = sigs_1042, + }, + { + .name = "TAKE_CONTROL", + .address = 0x412, + .def_val = "1 TAKE_CONTROL 0 OK", + .sigs = sigs_1042, + }, + { + .name = "SPLSGN2", + .address = 0x489, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN1", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "TSGN2", + .address = 0x489, + .def_val = "1 SPEED_SIGN 0 NONE", + .sigs = sigs_1161, + }, + { + .name = "SPLSGN3", + .address = 0x48A, + .def_val = "15 CONDITIONAL_BLANK 4 WET_ROAD 5 RAIN 0 NONE", + .sigs = sigs_1162, + }, + { + .name = "TSGN3", + .address = 0x48A, + .def_val = "0 NONE 1 SPEED_SIGN 2 0_UNLIMITED 7 UNLIMITED 16 HIGHWAY 17 NO_HIGHWAY 18 MOTORWAY 19 NO_MOTORWAY 20 IN_CITY 21 OUTSIDE_CITY 22 PEDESTRIAN_AREA 23 NO_PEDESTRIAN_AREA 65 NO_OVERTAKING_LEFT 66 NO_OVERTAKING_RIGHT 67 OVERTAKING_ALLOWED_AGAIN 81 NO_RIGHT_TURN 97 STOP 105 YIELD 113 STOP 114 YIELD_US 129 NO_ENTRY 138 NO_ENTRY_TSS2 145 DO_NOT_ENTER", + .sigs = sigs_1162, + }, + { + .name = "METER_SLIDER_DIMMED", + .address = 0x610, + .def_val = "1 DIMMED 0 NOT_DIMMED", + .sigs = sigs_1552, + }, + { + .name = "METER_SLIDER_LOW_BRIGHTNESS", + .address = 0x610, + .def_val = "1 LOW_BRIGHTNESS_MODE,_FOOTWELL_LIGHTS_OFF 0 NORMAL_MODE,_FOOTWELL_LIGHTS_ON", + .sigs = sigs_1552, + }, + { + .name = "UNITS", + .address = 0x611, + .def_val = "1 KM 2 MILES", + .sigs = sigs_1553, + }, + { + .name = "TURN_SIGNALS", + .address = 0x614, + .def_val = "3 NONE 2 RIGHT 1 LEFT", + .sigs = sigs_1556, + }, + { + .name = "LOCK_STATUS", + .address = 0x638, + .def_val = "0 LOCKED 1 UNLOCKED", + .sigs = sigs_1592, + }, +}; + +} + +const DBC toyota_tnga_k_pt_generated = { + .name = "toyota_tnga_k_pt_generated", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(toyota_tnga_k_pt_generated) \ No newline at end of file diff --git a/opendbc/can/dbc_out/toyota_tss2_adas.cc b/opendbc/can/dbc_out/toyota_tss2_adas.cc new file mode 100644 index 000000000..d5070595a --- /dev/null +++ b/opendbc/can/dbc_out/toyota_tss2_adas.cc @@ -0,0 +1,2308 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_384[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_385[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_386[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_387[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_388[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_389[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_390[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_391[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_392[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_393[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_394[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_395[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_396[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_397[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_398[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_399[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "LONG_DIST", + .b1 = 8, + .b2 = 13, + .bo = 43, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "LAT_DIST", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = true, + .factor = 0.04, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_TRACK", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "REL_SPEED", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = true, + .factor = 0.025, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "VALID", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_400[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_401[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_402[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_403[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_404[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_405[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_406[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_407[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_408[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_409[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_410[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_411[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_412[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_413[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_414[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_415[] = { + { + .name = "COUNTER", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "CHECKSUM", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::TOYOTA_CHECKSUM, + }, + { + .name = "REL_ACCEL", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = true, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "SCORE", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_576[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_577[] = { + { + .name = "NEW_SIGNAL_1", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, + { + .name = "NEW_SIGNAL_2", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = false, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "TRACK_A_0", + .address = 0x180, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_384), + .sigs = sigs_384, + }, + { + .name = "TRACK_A_1", + .address = 0x181, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_385), + .sigs = sigs_385, + }, + { + .name = "TRACK_A_2", + .address = 0x182, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_386), + .sigs = sigs_386, + }, + { + .name = "TRACK_A_3", + .address = 0x183, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_387), + .sigs = sigs_387, + }, + { + .name = "TRACK_A_4", + .address = 0x184, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_388), + .sigs = sigs_388, + }, + { + .name = "TRACK_A_5", + .address = 0x185, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_389), + .sigs = sigs_389, + }, + { + .name = "TRACK_A_6", + .address = 0x186, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_390), + .sigs = sigs_390, + }, + { + .name = "TRACK_A_7", + .address = 0x187, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_391), + .sigs = sigs_391, + }, + { + .name = "TRACK_A_8", + .address = 0x188, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_392), + .sigs = sigs_392, + }, + { + .name = "TRACK_A_9", + .address = 0x189, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_393), + .sigs = sigs_393, + }, + { + .name = "TRACK_A_10", + .address = 0x18A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_394), + .sigs = sigs_394, + }, + { + .name = "TRACK_A_11", + .address = 0x18B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_395), + .sigs = sigs_395, + }, + { + .name = "TRACK_A_12", + .address = 0x18C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_396), + .sigs = sigs_396, + }, + { + .name = "TRACK_A_13", + .address = 0x18D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_397), + .sigs = sigs_397, + }, + { + .name = "TRACK_A_14", + .address = 0x18E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_398), + .sigs = sigs_398, + }, + { + .name = "TRACK_A_15", + .address = 0x18F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_399), + .sigs = sigs_399, + }, + { + .name = "TRACK_B_0", + .address = 0x190, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_400), + .sigs = sigs_400, + }, + { + .name = "TRACK_B_1", + .address = 0x191, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_401), + .sigs = sigs_401, + }, + { + .name = "TRACK_B_2", + .address = 0x192, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_402), + .sigs = sigs_402, + }, + { + .name = "TRACK_B_3", + .address = 0x193, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_403), + .sigs = sigs_403, + }, + { + .name = "TRACK_B_4", + .address = 0x194, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_404), + .sigs = sigs_404, + }, + { + .name = "TRACK_B_5", + .address = 0x195, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_405), + .sigs = sigs_405, + }, + { + .name = "TRACK_B_6", + .address = 0x196, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_406), + .sigs = sigs_406, + }, + { + .name = "TRACK_B_7", + .address = 0x197, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_407), + .sigs = sigs_407, + }, + { + .name = "TRACK_B_8", + .address = 0x198, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_408), + .sigs = sigs_408, + }, + { + .name = "TRACK_B_9", + .address = 0x199, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_409), + .sigs = sigs_409, + }, + { + .name = "TRACK_B_10", + .address = 0x19A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_410), + .sigs = sigs_410, + }, + { + .name = "TRACK_B_11", + .address = 0x19B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_411), + .sigs = sigs_411, + }, + { + .name = "TRACK_B_12", + .address = 0x19C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_412), + .sigs = sigs_412, + }, + { + .name = "TRACK_B_13", + .address = 0x19D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_413), + .sigs = sigs_413, + }, + { + .name = "TRACK_B_14", + .address = 0x19E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_414), + .sigs = sigs_414, + }, + { + .name = "TRACK_B_15", + .address = 0x19F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_415), + .sigs = sigs_415, + }, + { + .name = "NEW_MSG_1", + .address = 0x240, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_576), + .sigs = sigs_576, + }, + { + .name = "NEW_MSG_2", + .address = 0x241, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_577), + .sigs = sigs_577, + }, +}; + +const Val vals[] = { +}; + +} + +const DBC toyota_tss2_adas = { + .name = "toyota_tss2_adas", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(toyota_tss2_adas) \ No newline at end of file diff --git a/opendbc/can/dbc_out/vw_mqb_2010.cc b/opendbc/can/dbc_out/vw_mqb_2010.cc new file mode 100644 index 000000000..e184ec789 --- /dev/null +++ b/opendbc/can/dbc_out/vw_mqb_2010.cc @@ -0,0 +1,13201 @@ +#include "common_dbc.h" + +namespace { + +const Signal sigs_64[] = { + { + .name = "Airbag_01_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Airbag_01_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_RGS_Anst", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Front_Crash", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Heck_Crash", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_SF_Crash", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_SB_Crash", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Rollover_Crash", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Crash_Int", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Lampe", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Deaktiviert", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_VB_deaktiviert", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Systemfehler", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Diagnose", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Stellgliedtest", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Erh_Auf_VB", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Gurtwarn_VF", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Gurtwarn_VB", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Anzeige_Fussg", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Texte_AKS", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_PAO_Leuchte_Anf", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_MKB_gueltig", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_MKB_Anforderung", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Versorgungsspannung", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_65[] = { + { + .name = "Airbag_03_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Airbag_03_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_MKB_Safing", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_134[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "LWI_Sensorstatus", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LWI_QBit_Sub_Daten", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LWI_QBit_Lenkradwinkel", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LWI_Lenkradwinkel", + .b1 = 16, + .b2 = 13, + .bo = 35, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LWI_VZ_Lenkradwinkel", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LWI_VZ_Lenkradw_Geschw", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LWI_Lenkradw_Geschw", + .b1 = 31, + .b2 = 9, + .bo = 24, + .is_signed = false, + .factor = 5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LWI_Sub_Daten", + .b1 = 40, + .b2 = 16, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_157[] = { + { + .name = "Motor_Hybrid_01_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Motor_Hybrid_01_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_IstStatusK0", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_max_ind_VM_Mom", + .b1 = 16, + .b2 = 10, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Zielzustand", + .b1 = 26, + .b2 = 3, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Startmodus", + .b1 = 29, + .b2 = 3, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Startmodus_PQ3x", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Stoppmodus", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_VM_Mom_oE", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = -100.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_VM_aktiv", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Schaltverhinderung", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_158[] = { + { + .name = "Getriebe_Hybrid_01_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Getriebe_Hybrid_01_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_Fehlerstatus", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_Freigabe_K0", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_Freigabe_LL_Reg", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_Freig_sSchl_K0", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_Freig_VM_EM_Stop", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_Wiederstart", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_Filt_MomAufbau", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_nK0", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_MomEingriff_EM", + .b1 = 32, + .b2 = 6, + .bo = 26, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_VZ_MomEingriff_EM", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_Sportfaktor", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_VM_akt_halten", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_StartAnf", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_VM_Startkontr", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_159[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "EPS_DSR_Status", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPS_Berechneter_LW", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.15, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPS_BLW_QBit", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPS_VZ_BLW", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPS_HCA_Status", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPS_Lenkmoment", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPS_Lenkmoment_QBit", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPS_VZ_Lenkmoment", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPS_Lenkungstyp", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_167[] = { + { + .name = "Motor_11_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Motor_11_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Mom_Soll_Roh", + .b1 = 12, + .b2 = 10, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = -509.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Mom_Ist_Summe", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -509.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Mom_Traegheit_Summe", + .b1 = 32, + .b2 = 10, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = -509.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Mom_Soll_gefiltert", + .b1 = 42, + .b2 = 10, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = -509.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Mom_Schub", + .b1 = 52, + .b2 = 9, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = -509.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Status_Normalbetrieb_01", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_erste_Ungenauschwelle", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_QBit_Motormomente", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_168[] = { + { + .name = "Motor_12_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Motor_12_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Mom_neg_verfuegbar", + .b1 = 12, + .b2 = 9, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = -509.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Mom_Begr_stat", + .b1 = 21, + .b2 = 9, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Mom_Begr_dyn", + .b1 = 30, + .b2 = 10, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = -509.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Momentenintegral_02", + .b1 = 40, + .b2 = 7, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_QBit_Drehzahl_01", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Drehzahl_01", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_173[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTERXX", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_MMom_Soll_02", + .b1 = 12, + .b2 = 10, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = -509.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_MMom_Vorhalt_02", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -509.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Uefkt", + .b1 = 32, + .b2 = 10, + .bo = 22, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Fahrstufe", + .b1 = 42, + .b2 = 5, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Schaltvorgang", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Status_Kupplung", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_MMom_Status", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Freig_MMom_Vorhalt", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Verbot_Ausblendung", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Zielgang", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_174[] = { + { + .name = "Getriebe_12_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Getriebe_12_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Drehzahlmesser_Daempfung", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Schubabschalt_Unt", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Freigabe_Synchro", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Synchro_Wunschdrehz", + .b1 = 15, + .b2 = 9, + .bo = 40, + .is_signed = false, + .factor = 25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Synchro_Zeit", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 20, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Mom_Begr_Gradient", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Anheb_Solldrehz_Leerlauf", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Aufnahmemoment", + .b1 = 48, + .b2 = 10, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = -509.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Anf_Zylabsch", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_HYB_DZ_Eingriff", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_175[] = { + { + .name = "WH_Status_Sperre", + .b1 = 0, + .b2 = 3, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WH_Initialisierung", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WH_SensorPos_roh", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WH_03_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WH_SensorPos_roh_inv", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WH_Testergebnis", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WH_Test_Aktiv", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WH_Status", + .b1 = 25, + .b2 = 7, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_178[] = { + { + .name = "ESP_HL_Radgeschw_02", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 0.0075, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_HR_Radgeschw_02", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.0075, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_VL_Radgeschw_02", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.0075, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_VR_Radgeschw_02", + .b1 = 48, + .b2 = 16, + .bo = 0, + .is_signed = false, + .factor = 0.0075, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_253[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "BR_Eingriffsmoment", + .b1 = 12, + .b2 = 10, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = -509.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_v_Signal", + .b1 = 32, + .b2 = 16, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ASR_Tastung_passiv", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Tastung_passiv", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Systemstatus", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ASR_Schalteingriff", + .b1 = 51, + .b2 = 2, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Haltebestaetigung", + .b1 = 53, + .b2 = 1, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_QBit_v_Signal", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ABS_Bremsung", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ASR_Anf", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MSR_Anf", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EBV_Eingriff", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EDS_Eingriff", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Eingriff", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_ASP", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Anhaltevorgang_ACC_aktiv", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_257[] = { + { + .name = "ESP_02_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_02_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_QBit_Gierrate", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_QBit_Laengsbeschl", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_QBit_Querb", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Stillstandsflag", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Querbeschleunigung", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.01, + .offset = -1.27, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Laengsbeschl", + .b1 = 24, + .b2 = 10, + .bo = 30, + .is_signed = false, + .factor = 0.03125, + .offset = -16.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Verteil_Wankmom", + .b1 = 34, + .b2 = 5, + .bo = 25, + .is_signed = false, + .factor = 0.1, + .offset = -1.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_QBit_Anf_Vert_Wank", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Gierrate", + .b1 = 40, + .b2 = 14, + .bo = 10, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_VZ_Gierrate", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Notbremsanzeige", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_SpannungsAnf", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_PLA_Abbruch", + .b1 = 57, + .b2 = 3, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Status_ESP_PLA", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_260[] = { + { + .name = "EPB_01_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_01_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_QBit_Laengsbeschleunigung", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_QBit_Pedalweg_Kuppl", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_BCM2_Motor_Wakeup", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_Freig_Verzoeg_Anf", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_Verzoeg_Anf", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.048, + .offset = -7.968, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_Laengsbeschleunigung", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -128.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_Pedalweg_Kuppl", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.4, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_Anfahrwunsch_erkannt", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_DAA_Randbed_erf", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_Fehlerstatus", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_Schalterposition", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_QBit_Schalterpos", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_Konsistenz_ACC", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_Spannkraft", + .b1 = 56, + .b2 = 5, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPB_Status", + .b1 = 61, + .b2 = 2, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_262[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "ESP_QBit_Bremsdruck", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_QBit_Fahrer_bremst", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Schwelle_Unterdruck", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Bremsdruck", + .b1 = 16, + .b2 = 10, + .bo = 38, + .is_signed = false, + .factor = 0.3, + .offset = -30.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Fahrer_bremst", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Verz_TSK_aktiv", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Lenkeingriff_ADS", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Konsistenz_TSK", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Bremsruck_AWV2", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Konsistenz_AWV2", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ECD_Fehler", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ECD_nicht_verfuegbar", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Status_Bremsentemp", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Autohold_Standby", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_HDC_Standby", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_HBA_aktiv", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Prefill_ausgeloest", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Rueckwaertsfahrt_erkannt", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Status_Anfahrhilfe", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_HDC_aktiv", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_StartStopp_Info", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Eingr_HL", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Eingr_HR", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Eingr_VL", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Eingr_VR", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_BKV_Unterdruck", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 4, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Autohold_aktiv", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_FStatus_Anfahrhilfe", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Verz_EPB_aktiv", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ECD_Bremslicht", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Verzoeg_EPB_verf", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Status_Bremsdruck", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Anforderung_EPB", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_263[] = { + { + .name = "MO_Istgang", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Sollgang", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Oeldruck", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.04, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Anzeigedrehz", + .b1 = 24, + .b2 = 12, + .bo = 28, + .is_signed = false, + .factor = 3, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Schaltempf_verfbar", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Ladedruck", + .b1 = 39, + .b2 = 9, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_KVS", + .b1 = 48, + .b2 = 15, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_KVS_Ueberlauf", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_264[] = { + { + .name = "Fahrwerk_01_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Fahrwerk_01_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_278[] = { + { + .name = "ESP_10_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_10_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_QBit_Wegimpuls_VL", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_QBit_Wegimpuls_VR", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_QBit_Wegimpuls_HL", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_QBit_Wegimpuls_HR", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Wegimpuls_VL", + .b1 = 16, + .b2 = 10, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Wegimpuls_VR", + .b1 = 26, + .b2 = 10, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Wegimpuls_HL", + .b1 = 36, + .b2 = 10, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Wegimpuls_HR", + .b1 = 46, + .b2 = 10, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_VL_Fahrtrichtung", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_VR_Fahrtrichtung", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_HL_Fahrtrichtung", + .b1 = 60, + .b2 = 2, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_HR_Fahrtrichtung", + .b1 = 62, + .b2 = 2, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_279[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "AWV1_Anf_Prefill", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ANB_CM_Info", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AWV2_Freigabe", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AWV1_HBA_Param", + .b1 = 19, + .b2 = 2, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AWV2_Ruckprofil", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AWV2_Priowarnung", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ANB_CM_Anforderung", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ANB_Info_Teilbremsung", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ANB_Notfallblinken", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ANB_Teilbremsung_Freigabe", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ANB_Zielbrems_Teilbrems_Verz_Anf", + .b1 = 29, + .b2 = 10, + .bo = 25, + .is_signed = false, + .factor = 0.024, + .offset = -20.016, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ANB_Zielbremsung_Freigabe", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AWV_Vorstufe", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AWV_Halten", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_286[] = { + { + .name = "VehicleSpeed_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VehicleSpeed_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Speed", + .b1 = 52, + .b2 = 12, + .bo = 0, + .is_signed = false, + .factor = 0.125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_288[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "TSK_Radbremsmom", + .b1 = 12, + .b2 = 12, + .bo = 40, + .is_signed = false, + .factor = 8, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_Status", + .b1 = 24, + .b2 = 3, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_v_Begrenzung_aktiv", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_Standby_Anf_ESP", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_Freig_Verzoeg_Anf", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_Limiter_ausgewaehlt", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_ax_Getriebe_02", + .b1 = 48, + .b2 = 9, + .bo = 7, + .is_signed = false, + .factor = 0.024, + .offset = -2.016, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_Zwangszusch_ESP", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_zul_Regelabw", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 0.024, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_289[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "MO_Fahrpedalrohwert_01", + .b1 = 12, + .b2 = 8, + .bo = 44, + .is_signed = false, + .factor = 0.4, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_QBit_Fahrpedalwerte_01", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Fahrpedalgradient", + .b1 = 21, + .b2 = 8, + .bo = 35, + .is_signed = false, + .factor = 25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Sig_Fahrpedalgradient", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_rel_Saugrohrdruck", + .b1 = 30, + .b2 = 6, + .bo = 28, + .is_signed = false, + .factor = 18, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_rel_Saugrohrdruck_gem_err", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Moment_im_Leerlauf", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Schubabschaltung", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Solldrehz_Leerlauf", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_290[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "ACC_limitierte_Anfahrdyn", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_zul_Regelabw_unten", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 0.024, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_StartStopp_Info", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Sollbeschleunigung_02", + .b1 = 24, + .b2 = 11, + .bo = 29, + .is_signed = false, + .factor = 0.005, + .offset = -7.22, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_zul_Regelabw_oben", + .b1 = 35, + .b2 = 5, + .bo = 24, + .is_signed = false, + .factor = 0.0625, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_neg_Sollbeschl_Grad_02", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.05, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_pos_Sollbeschl_Grad_02", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.05, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Anfahren", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Anhalten", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Typ", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Status_ACC", + .b1 = 60, + .b2 = 3, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Minimale_Bremsung", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_294[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "SET_ME_0X3", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Assist_Torque", + .b1 = 16, + .b2 = 14, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Assist_Requested", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Assist_VZ", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HCA_Available", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HCA_Standby", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "HCA_Active", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_0XFE", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SET_ME_0X07", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_296[] = { + { + .name = "GE_WH_Sperre", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Ausleuchtungsmode", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Test_Freigabe", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Ist_Fahrstufe", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Testparameter_1", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Testparameter_2", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_299[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "GRA_Hauptschalter", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GRA_Abbrechen", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GRA_Typ_Hauptschalter", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GRA_Limiter", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GRA_Tip_Setzen", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GRA_Tip_Hoch", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GRA_Tip_Runter", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GRA_Tip_Wiederaufnahme", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GRA_Verstellung_Zeitluecke", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GRA_Codierung", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GRA_Fehler", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GRA_Typ468", + .b1 = 25, + .b2 = 2, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GRA_Tip_Stufe_2", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GRA_ButtonTypeInfo", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_301[] = { + { + .name = "Getriebe_13_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Getriebe_13_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_StartStopp_Info", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Langfr_Schutzmom_02", + .b1 = 14, + .b2 = 9, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Eingangsdrehz", + .b1 = 48, + .b2 = 14, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Notlauf", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Freig_Langfr_Schutzmom", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_302[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "ACC_Distance_to_Stop", + .b1 = 12, + .b2 = 11, + .bo = 41, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Hold_Request", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Boost_Request", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Freewheel_Request", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Freewheel_Type", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Hold_Type", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Hold_Release", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Accel_Secondary", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.03, + .offset = -4.6, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Accel_TSK", + .b1 = 53, + .b2 = 11, + .bo = 0, + .is_signed = false, + .factor = 0.005, + .offset = -7.22, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_391[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "RegenBrakingMode", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GearPosition", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_418[] = { + { + .name = "ESP_15_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_15_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_427[] = { + { + .name = "ESP_33_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_33_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_695[] = { + { + .name = "RCTA_01_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RCTA_01_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_779[] = { + { + .name = "KBI_ABS_Lampe", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_ESP_Lampe", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_BKL_Lampe", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Airbag_Lampe", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_SILA_gueltig", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Lenkung_Lampe", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Vorglueh_System_Lampe", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_NV_in_Anzeige", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Kombi_01_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Anzeigestatus_ACC", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Anzeigestatus_GRA", + .b1 = 13, + .b2 = 2, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Oeldruck_Schalter", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Tankwarnung", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_MFA_v_Einheit_01", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_im_Stellgliedtest", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Anzeigefehler_LDW", + .b1 = 19, + .b2 = 2, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Variante_USA", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Oeldruckwarnung", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Handbremse", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_V_Digital", + .b1 = 24, + .b2 = 9, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_PLA_in_Anzeige", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Anzeigefehler_NV", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Anzeigestatus_LIM", + .b1 = 35, + .b2 = 2, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_angez_Geschw", + .b1 = 48, + .b2 = 10, + .bo = 6, + .is_signed = false, + .factor = 0.32, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Einheit_Tacho", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Konsistenz_ACC", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Fehler_Anzeige_ACC", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Anzeigefehler_SWA", + .b1 = 61, + .b2 = 2, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_780[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "ACC_Wunschgeschw", + .b1 = 12, + .b2 = 10, + .bo = 42, + .is_signed = false, + .factor = 0.32, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Status_Prim_Anz", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Abstandsindex", + .b1 = 24, + .b2 = 10, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Akustik", + .b1 = 34, + .b2 = 3, + .bo = 27, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Gesetzte_Zeitluecke", + .b1 = 37, + .b2 = 3, + .bo = 24, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Optischer_Fahrerhinweis", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Typ_Tachokranz", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Anzeige_Zeitluecke", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Tachokranz", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Display_Prio", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Relevantes_Objekt", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Texte_Primaeranz", + .b1 = 48, + .b2 = 7, + .bo = 9, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Wunschgeschw_erreicht", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Status_Anzeige", + .b1 = 61, + .b2 = 3, + .bo = 0, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_783[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "SWA_Anzeigen", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_Blindheit_erkannt", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_rel_Nichtverf", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_rel_Fehler", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_Sta_aktiv", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_Sta_passiv", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_Standziele_li", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_Kolonne_li", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_Infostufe_SWA_li", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_Warnung_SWA_li", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_Kolonne_mi", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_Standziele_re", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_Kolonne_re", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_Infostufe_SWA_re", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_Warnung_SWA_re", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_Gischtzaehler", + .b1 = 48, + .b2 = 7, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SWA_KD_Fehler", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_798[] = { + { + .name = "TSK_07_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_07_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_Wunschgeschw", + .b1 = 12, + .b2 = 10, + .bo = 42, + .is_signed = false, + .factor = 0.32, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_Texte_Primaeranz", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_Limiter_Anzeige", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_Status_Anzeige", + .b1 = 61, + .b2 = 3, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_804[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "ACC_Texte_Zusatzanz", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Status_Zusatzanz", + .b1 = 22, + .b2 = 5, + .bo = 37, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Texte", + .b1 = 27, + .b2 = 5, + .bo = 32, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Texte_braking_guard", + .b1 = 32, + .b2 = 3, + .bo = 29, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Warnhinweis", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Geschw_Zielfahrzeug", + .b1 = 40, + .b2 = 10, + .bo = 14, + .is_signed = false, + .factor = 0.32, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Charisma_FahrPr", + .b1 = 56, + .b2 = 3, + .bo = 5, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Charisma_Status", + .b1 = 59, + .b2 = 2, + .bo = 3, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ACC_Charisma_Umschaltung", + .b1 = 61, + .b2 = 2, + .bo = 1, + .is_signed = false, + .factor = 1.0, + .offset = 0.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_811[] = { + { + .name = "MO_HYB_E_Faktor", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Drehzahl_VM", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_LowSpeedModus", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_812[] = { + { + .name = "MO_Prio_MAX_Wunschdrehzahl", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Prio_MIN_Wunschdrehzahl", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Luftpfad_aktiv", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_v_Begrenz_Aktivierbar", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Drehzahlbeeinflussung", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.39, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_MIN_Wunschdrehzahl", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_MAX_Wunschdrehzahl", + .b1 = 32, + .b2 = 9, + .bo = 23, + .is_signed = false, + .factor = 25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Charisma_FahrPr", + .b1 = 41, + .b2 = 4, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Charisma_Status", + .b1 = 45, + .b2 = 2, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_869[] = { + { + .name = "BEM_P_Generator", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 50, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BEM_n_LLA", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BEM_01_Abschaltstufen", + .b1 = 26, + .b2 = 3, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BEM_Anf_KL", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BEM_StartStopp_Info", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BEM_DFM", + .b1 = 32, + .b2 = 5, + .bo = 27, + .is_signed = false, + .factor = 3.225, + .offset = 0.025, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BEM_EMLIN_ungueltig", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BEM_Batt_Ab", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BEM_Segel_Info", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BEM_HYB_DC_uSollLV", + .b1 = 50, + .b2 = 6, + .bo = 8, + .is_signed = false, + .factor = 0.1, + .offset = 10.6, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BEM_HYB_DC_uMinLV", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_870[] = { + { + .name = "Hazard_Switch", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Comfort_Signal_Left", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Comfort_Signal_Right", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Left_Turn_Exterior_Bulb_1", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Right_Turn_Exterior_Bulb_1", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Left_Turn_Exterior_Bulb_2", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Right_Turn_Exterior_Bulb_2", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Fast_Send_Rate_Active", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_901[] = { + { + .name = "CHA_Ziel_FahrPr_ALR", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Ziel_FahrPr_ESP", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Ziel_FahrPr_FL", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Fahrer_Umschaltung", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Ziel_FahrPr_MO", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Ziel_FahrPr_GE", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Ziel_FahrPr_ST", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Ziel_FahrPr_SCU", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Ziel_FahrPr_DR", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Ziel_FahrPr_QS", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Ziel_FahrPr_AFS", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Ziel_FahrPr_RGS", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Ziel_FahrPr_EPS", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Ziel_FahrPr_ACC", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Ziel_FahrPr_SAK", + .b1 = 56, + .b2 = 4, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "CHA_Ziel_FahrPr_MStSt", + .b1 = 60, + .b2 = 4, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_913[] = { + { + .name = "OBD_Calc_Load_Val", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.39215686275, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_Eng_Cool_Temp", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_Abs_Throttle_Pos", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.39215686275, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_Abs_Load_Val", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = false, + .factor = 0.39215686275, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_Abs_Pedal_Pos", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.39215686275, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_Kaltstart_Denominator", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_Minimum_Trip", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_Driving_Cycle", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_Warm_Up_Cycle", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_Normed_Trip", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_914[] = { + { + .name = "ESP_07_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_07_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_ACC_LDE", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Quattro_Antrieb", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Codierung_ADS", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_RTA_HL", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 0.048828125, + .offset = -6.20117, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_RTA_HR", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.048828125, + .offset = -6.20117, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_RTA_VR", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.048828125, + .offset = -6.20117, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_Fehler_Radsensor_HL", + .b1 = 40, + .b2 = 4, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_Fehler_Radsensor_HR", + .b1 = 44, + .b2 = 4, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_Fehler_Radsensor_VL", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_Fehler_Radsensor_VR", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Qualifizierung_Antriebsart", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Offroad_Modus", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_MKB_ausloesbar", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_MKB_Status", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_CM_Variante", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_OBD_Status", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_916[] = { + { + .name = "WBA_03_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WBA_03_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WBA_Fahrstufe_02", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WBA_ZielFahrstufe", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WBA_GE_Warnung_02", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WBA_eing_Gang_02", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WBA_GE_Texte", + .b1 = 28, + .b2 = 3, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WBA_Segeln_aktiv", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WBA_Schaltschema", + .b1 = 32, + .b2 = 5, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_919[] = { + { + .name = "LDW_Gong", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_SW_Warnung_links", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_SW_Warnung_rechts", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Texte", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Seite_DLCTLC", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Lernmodus", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Anlaufsp_VLR", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Vib_Amp_VLR", + .b1 = 28, + .b2 = 4, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Anlaufzeit_VLR", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Lernmodus_rechts", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Lernmodus_links", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_DLC", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.01, + .offset = -1.25, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_TLC", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Warnung_links", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Warnung_rechts", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Codierinfo_fuer_VLR", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Frontscheibenheizung_aktiv", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Status_LED_gelb", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_Status_LED_gruen", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LDW_KD_Fehler", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_945[] = { + { + .name = "DC_HYB_iAktLV", + .b1 = 12, + .b2 = 10, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = -511.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DC_HYB_iAktReserveLV", + .b1 = 22, + .b2 = 10, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = -511.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DC_HYB_uAktLV", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DC_HYB_LangsRegelung", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DC_HYB_Abregelung_Temperatur", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DC_HYB_Fehler_RedLeistung", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DC_HYB_Fehler_intern", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DC_HYB_Fehler_Spannung", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DC_HYB_Auslastungsgrad", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.4, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_949[] = { + { + .name = "KL_Drehz_Anh", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Vorwarn_Komp_ein", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_AC_Schalter", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Komp_Moment_alt", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Zonen", + .b1 = 4, + .b2 = 2, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Vorwarn_Zuheizer_ein", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Zustand", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Comp_rev_rq", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 50, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Charisma_FahrPr", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Charisma_Status", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Comp_enable", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Last_Kompr", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.25, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Spannungs_Anf", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Thermomanagement", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_StartStopp_Info", + .b1 = 36, + .b2 = 2, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Anf_KL", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.4, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_el_Zuheizer_Stufe", + .b1 = 48, + .b2 = 3, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_958[] = { + { + .name = "MO_StartStopp_Status", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_StartStopp_Wiederstart", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_StartStopp_Motorstopp", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Freig_Reku", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Kl_75", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Kl_50", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Gangposition", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_StartStopp_Fahrerwunsch", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Fahrbereitschaft", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Ext_E_Fahrt_aktiv", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Fahrer_bremst", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_QBit_Fahrer_bremst", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_BLS", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Konsistenz_Bremsped", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Timeout_ESP", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Klima_Eingr", + .b1 = 33, + .b2 = 2, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Aussp_Anlass", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Freig_Anlass", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Kuppl_schalter", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Interlock", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Motor_laeuft", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Kickdown", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Status_Zylabschalt_01", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_EKlKomLeiRed", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Handshake_STH", + .b1 = 44, + .b2 = 1, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_BKV_Unterdruckwarnung", + .b1 = 45, + .b2 = 1, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Freigabe_Segeln", + .b1 = 46, + .b2 = 1, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_PTC_Status", + .b1 = 47, + .b2 = 3, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_QBit_Gangposition", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Signalquelle_Gangposition", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Remotestart_Betrieb", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_960[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "ZAS_Kl_S", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ZAS_Kl_15", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ZAS_Kl_X", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ZAS_Kl_50", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_967[] = { + { + .name = "MO_HYB_Status_HV_Ladung", + .b1 = 8, + .b2 = 3, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_Anzeige_aktiv", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_Oelmin_Warn", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_Sensorfehler", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_Schieflage", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_Oelstand", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 12.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Zustand_HWP", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_Oelsystem_aktiv", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_nicht_betriebswarm", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_Ueberfuell_Warn", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_laufender_Motor", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Text_1", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Text_2", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Text_3", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Text_4", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Text_Motorstart", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Text_5", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Text_6", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Text_7", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Text_Partikelfil_Reg", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_Oelmenge", + .b1 = 43, + .b2 = 5, + .bo = 16, + .is_signed = false, + .factor = 125, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Systemlampe", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_OBD2_Lampe", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Heissleuchte", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Partikel_Lampe", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Winterfahrprog", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_Oelstand_nicht_vorhanden", + .b1 = 53, + .b2 = 1, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_nachfuellanzeige_ein", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_Ueberfuell_deaktiv", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_Unterfuell_Warn", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Tankdeckel_Lampe", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Text_Tankdeckelwarn", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_Oeldr_Warn_Motor", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_968[] = { + { + .name = "GE_OBD_AbsperrVent", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_amax_moeglich", + .b1 = 16, + .b2 = 9, + .bo = 39, + .is_signed = false, + .factor = 0.024, + .offset = -2.016, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Charisma_FahrPr", + .b1 = 25, + .b2 = 4, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Charisma_Status", + .b1 = 29, + .b2 = 2, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Verlustmoment", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Freigabe_Verfallsinfo_WFS", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Codierung_MSG", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_LaunchControl", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Heizwunsch", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_OBD_Status", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_LFR_Adaption", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_Sumpftemperatur", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = -58.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_982[] = { + { + .name = "Licht_hinten_01_BZ", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM2_Bremsl_durch_ECD", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Aussenlicht_def", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Standlicht_H_aktiv", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Parklicht_HL_aktiv", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Parklicht_HR_aktiv", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Bremslicht_H_aktiv", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Nebelschluss_aktiv", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Rueckfahrlicht_aktiv", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Blinker_HL_akt", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Blinker_HR_akt", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Blinker_li_def", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Bremsl_li_def", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Schlusslicht_li_def", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Rueckf_li_def", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Nebel_li_def", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Schluss_Brems_Nebel_li_def", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Schluss_Brems_Nebel_re_def", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Schluss_Brems_li_def", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Schluss_Nebel_li_def", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_SL_BRL_BLK_li_def", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Brems_Blk_li_def", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Blinker_re_def", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Bremsl_re_def", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Schlusslicht_re_def", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Rueckf_re_def", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Nebel_re_def", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Schluss_Brems_re_def", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Schluss_Nebel_re_def", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_SL_BRL_BLK_re_def", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Brems_Blk_re_def", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Kennzl_def", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_3_Bremsl_def", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Nebel_mi_def", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Rueckf_mi_def", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Bremsl_li_ges_def", + .b1 = 54, + .b2 = 1, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LH_Bremsl_re_ges_def", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_984[] = { + { + .name = "RGS_VL_Texte", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RGS_VL_Charisma_FahrPr", + .b1 = 14, + .b2 = 4, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RGS_VL_Charisma_Status", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RGS_VL_aktiv", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RGS_VL_PC_Aktuator_Sitz", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RGS_VL_PC_Aktuator_Schiebedach", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RGS_VL_PC_Aktuator_Fenster", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RGS_VL_PC_Aktuator_Warnblinken", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RGS_VL_Precrash_Basis", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RGS_VL_Precrash_Front", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RGS_VL_Precrash_Rear", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_987[] = { + { + .name = "BCM_01_alt", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SMLS_01_alt", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ZV_02_alt", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Wischer_01_alt", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Anhaenger_01_alt", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Klima_Sensor_02_alt", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VSG_01_alt", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Klima_01_alt", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WFS_01_alt", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Licht_Anf_01_alt", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ZV_HFS_offen", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ZV_HBFS_offen", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VS_VD_offen_ver", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VS_VD_zu_ver", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ZV_BT_offen", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_Rueckfahrlicht_Schalter", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ZV_FT_offen", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Wischer_vorne_aktiv", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AAG_Anhaenger_erkannt", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_MH_Schalter", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ZV_HD_offen", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Waschen_vorne_aktiv", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Thermomanagement", + .b1 = 32, + .b2 = 2, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WFS_Schluessel_Fahrberecht", + .b1 = 34, + .b2 = 4, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_RFahrlicht_Fzg_Anf", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_RFahrlicht_Ahg_Anf", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BH_Fernlicht", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BH_Blinker_li", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BH_Blinker_re", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_OBD_FStatus_ATemp", + .b1 = 52, + .b2 = 4, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_Aussen_Temp_ungef", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.5, + .offset = -50.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_989[] = { + { + .name = "LH_EPS_01_alt", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Kessy_04_alt", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LIN_2_alt", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MFG_01_alt", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GW_74_va_14", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Klima_02_alt", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Parkhilfe_01_alt", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ELV_01_alt", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KY_StartStopp_Info", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "PH_StartStopp_Info", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EPS_Lenkerposition", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ELV_Anf_Klemme_50", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MF_StartStopp_Info", + .b1 = 25, + .b2 = 2, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Geblaesespannung_Soll", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.05, + .offset = 0.5, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KL_Umluftklappe_Status", + .b1 = 48, + .b2 = 4, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MFL_Tip_Down", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MFL_Tip_Up", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "LS_Tiptronic_Fehler", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_997[] = { + { + .name = "TSG_FT_02_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSG_FT_02_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1122[] = { + { + .name = "PSD_Object_Index", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1123[] = { + { + .name = "PSD_Current_Route_Index", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Route_Distance_Remaining", + .b1 = 8, + .b2 = 5, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1172[] = { + { + .name = "STS_01_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_01_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_Car_not_under_theft", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_Car_under_theft", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_Anlassersperre", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_Typencodierung", + .b1 = 16, + .b2 = 5, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_LIN_aktiv", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_Standlicht", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_Fahrlicht", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_Alarm_still", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_Texte", + .b1 = 27, + .b2 = 4, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_Laderelais", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_Summer", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_Alarm_Blinker", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_Notstart", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_Signalhorn", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STS_Leerlaufschaltung", + .b1 = 56, + .b2 = 1, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1312[] = { + { + .name = "AB_Belegung_VB", + .b1 = 26, + .b2 = 2, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Gurtschloss_FA", + .b1 = 40, + .b2 = 2, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Gurtschloss_BF", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Gurtschloss_Reihe2_FA", + .b1 = 44, + .b2 = 2, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Gurtschloss_Reihe2_MI", + .b1 = 46, + .b2 = 2, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Gurtschloss_Reihe2_BF", + .b1 = 48, + .b2 = 2, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Gurtschloss_Reihe3_FA", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Gurtschloss_Reihe3_MI", + .b1 = 52, + .b2 = 2, + .bo = 10, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Gurtschloss_Reihe3_BF", + .b1 = 54, + .b2 = 2, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Sitzpos_Sens_FA", + .b1 = 56, + .b2 = 2, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_Sitzpos_Sens_BF", + .b1 = 58, + .b2 = 2, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1313[] = { + { + .name = "STH_Funk_ein", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_Funk_aus", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_Zusatzheizung", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_LED", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_Pumpe_ein", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_Geblaese", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_EKP_Anst", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_Start_folgt", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_Ventiloeffnungszeit", + .b1 = 8, + .b2 = 6, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_Ventil_Status", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_Waermeeintrag", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_KVS", + .b1 = 24, + .b2 = 13, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_Fehlerstatus", + .b1 = 37, + .b2 = 3, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_Heizleistung", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_Wassertemp", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.75, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_Motorvorwaermung", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_Servicemode", + .b1 = 60, + .b2 = 1, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_war_aktiv", + .b1 = 61, + .b2 = 1, + .bo = 2, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_KVS_Ueberlauf", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "STH_KD_Fehler", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1413[] = { + { + .name = "SI_Sammel_SG_Fehler", + .b1 = 0, + .b2 = 6, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_Rollenmode", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_QRS_Mode", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_T_Mode", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_NWDF", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_NWDF_gueltig", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_Sammelfehler", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GW_KD_Fehler", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_01", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_02", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_03", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_04", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_05", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_06", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_07", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_08", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_09", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_10", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_11", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_12", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_13", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_14", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SI_BUS_15", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1437[] = { + { + .name = "RSF_Tastencode_1", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RSF_Tastencode_2", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "RSF_Tastencode_Maske", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1520[] = { + { + .name = "DI_KL_58xd", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_KL_58xs", + .b1 = 8, + .b2 = 7, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_Display_Nachtdesign", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_KL_58xt", + .b1 = 16, + .b2 = 7, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "DI_Fotosensor", + .b1 = 24, + .b2 = 16, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1528[] = { + { + .name = "SAK_Charisma_FahrPr", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SAK_Charisma_Status", + .b1 = 20, + .b2 = 2, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1600[] = { + { + .name = "MO_QBit_Ansaugluft_Temp", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_QBit_Oel_Temp", + .b1 = 1, + .b2 = 1, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_QBit_Kuehlmittel_Temp", + .b1 = 2, + .b2 = 1, + .bo = 61, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Stellgliedtest_Soundaktuator", + .b1 = 3, + .b2 = 1, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_HYB_Fehler_HV_Netz", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_aktives_Getriebeheizen", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Absperrventil_oeffnen", + .b1 = 6, + .b2 = 2, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Ansaugluft_Temp", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 0.75, + .offset = -48.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Oel_Temp", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = -60.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Kuehlmittel_Temp", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.75, + .offset = -48.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Hoeheninfo", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.00781, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Kennfeldk", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Versionsinfo", + .b1 = 41, + .b2 = 6, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Getriebe_kuehlen", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Mom_Traegheit_02", + .b1 = 48, + .b2 = 5, + .bo = 11, + .is_signed = false, + .factor = 0.01, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Heizungspumpenansteuerung", + .b1 = 53, + .b2 = 4, + .bo = 7, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_SpannungsAnf", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Nachlaufzeit_Heizungspumpe", + .b1 = 58, + .b2 = 6, + .bo = 0, + .is_signed = false, + .factor = 15, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1601[] = { + { + .name = "Motor_Code_01_CRC", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Motor_Code_01_BZ", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Faktor_Momente_02", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Hybridfahrzeug", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Code", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Getriebe_Code", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_StartStopp_Codiert", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Anzahl_Zyl", + .b1 = 32, + .b2 = 4, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Kraftstoffart", + .b1 = 36, + .b2 = 4, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Hubraum", + .b1 = 40, + .b2 = 7, + .bo = 17, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Ansaugsystem", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Leistung", + .b1 = 48, + .b2 = 9, + .bo = 7, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Abgastyp_EOBD", + .b1 = 57, + .b2 = 1, + .bo = 6, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Abgastyp_OBD", + .b1 = 58, + .b2 = 1, + .bo = 5, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_DPF_verbaut", + .b1 = 59, + .b2 = 1, + .bo = 4, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_Codierung", + .b1 = 60, + .b2 = 3, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Einspritzart", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1602[] = { + { + .name = "WIV_Verschleissindex", + .b1 = 0, + .b2 = 16, + .bo = 48, + .is_signed = false, + .factor = 2e-08, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_Russindex", + .b1 = 16, + .b2 = 16, + .bo = 32, + .is_signed = false, + .factor = 2e-08, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_t_min", + .b1 = 32, + .b2 = 6, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_t_max", + .b1 = 40, + .b2 = 6, + .bo = 18, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_W_min", + .b1 = 48, + .b2 = 7, + .bo = 9, + .is_signed = false, + .factor = 1000, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "WIV_W_max", + .b1 = 56, + .b2 = 7, + .bo = 1, + .is_signed = false, + .factor = 1000, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1603[] = { + { + .name = "KBI_Einheit_Datum", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Einheit_Druck", + .b1 = 2, + .b2 = 2, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Einheit_Streckenanz", + .b1 = 4, + .b2 = 1, + .bo = 59, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_MFA_v_Einheit_02", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Einheit_Temp", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Einheit_Uhrzeit", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Einheit_Verbrauch", + .b1 = 8, + .b2 = 2, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Einheit_Volumen", + .b1 = 10, + .b2 = 2, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Einheit_Sprache", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1607[] = { + { + .name = "MO_ITM_Kuehlmittel_Temp", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 0.75, + .offset = -48.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_E85_Sensor", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_Anz_Motorstarts", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_Reichweite", + .b1 = 16, + .b2 = 15, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_Warnstufe_1", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_Warnstufe_2", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_Text", + .b1 = 34, + .b2 = 3, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_Akustik", + .b1 = 37, + .b2 = 2, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Kraftstofffilter_Wasser", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_Systemfehler", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SCR_Inducement_Strategie", + .b1 = 42, + .b2 = 2, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_CO2_Faktor", + .b1 = 44, + .b2 = 12, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1625[] = { + { + .name = "EKL_KD_Fehler", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EKL_Comp_SCI_com_stat", + .b1 = 16, + .b2 = 2, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EKL_Comp_output_stat", + .b1 = 18, + .b2 = 2, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EKL_Comp_main_stat", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EKL_Comp_ovld_stat", + .b1 = 21, + .b2 = 3, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EKL_Comp_Inv_stat", + .b1 = 24, + .b2 = 2, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EKL_Comp_photo_temp_stat", + .b1 = 30, + .b2 = 2, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EKL_Comp_photo_temp", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EKL_Comp_current", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EKL_Comp_rev_stat", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 50, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1626[] = { + { + .name = "BCM_Bremsbelag_Sensor", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM_Bremsfluessigkeit_Sensor", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_Licht_Warn", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM_Waschwasser_Sensor", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM_Kuehlmittel_Sensor", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_Kl_15_HW_erkannt", + .b1 = 17, + .b2 = 1, + .bo = 46, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM_Eis_Offroad_Taste", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ZZH_Endlage_oben", + .b1 = 19, + .b2 = 1, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ZZH_Endlage_unten", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ZZH_Endlage_unplausibel", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM2_EZS_gedrueckt", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM2_SST_gedrueckt", + .b1 = 23, + .b2 = 1, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM_Hybrid_StartStopp_Taste", + .b1 = 24, + .b2 = 1, + .bo = 39, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_Warnblink_Taster", + .b1 = 25, + .b2 = 1, + .bo = 38, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_Valet_Parking_Taster", + .b1 = 26, + .b2 = 1, + .bo = 37, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM_Remotestart_Betrieb", + .b1 = 27, + .b2 = 1, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_HSK_Taster", + .b1 = 28, + .b2 = 1, + .bo = 35, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_Heckrollo_Taster", + .b1 = 29, + .b2 = 1, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_Rueckfahrlicht_Schalter", + .b1 = 30, + .b2 = 1, + .bo = 33, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_MH_Schalter", + .b1 = 31, + .b2 = 1, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_MH_WIV_Schalter", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM_Eco_Charisma_Taste", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM_Thermomanagement", + .b1 = 34, + .b2 = 2, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM_Thermomanagement_Fehler", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM_Thermomanagement_gueltig", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BCM1_Lichtwarn_Texte", + .b1 = 38, + .b2 = 2, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1628[] = { + { + .name = "BMS_HYB_ASV_hinten_Status", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BMS_HYB_ASV_vorne_Status", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BMS_HYB_KD_Fehler", + .b1 = 15, + .b2 = 1, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BMS_HYB_BattFanSpd", + .b1 = 16, + .b2 = 4, + .bo = 44, + .is_signed = false, + .factor = 10, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BMS_HYB_VentilationReq", + .b1 = 20, + .b2 = 1, + .bo = 43, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BMS_HYB_Spuelbetrieb_Status", + .b1 = 21, + .b2 = 1, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BMS_HYB_Kuehlung_Anf", + .b1 = 22, + .b2 = 2, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BMS_HYB_Temp_vor_Verd", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 0.5, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BMS_HYB_Temp_nach_Verd", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 0.5, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BMS_Temperatur", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 0.5, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BMS_Temperatur_Ansaugluft", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 0.5, + .offset = -40.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BMS_IstSpannung_HV", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 100, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1629[] = { + { + .name = "CHECKSUM", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_CHECKSUM, + }, + { + .name = "COUNTER", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::VOLKSWAGEN_COUNTER, + }, + { + .name = "BR_Systemart", + .b1 = 12, + .b2 = 2, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Zaehnezahl", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Charisma_FahrPr", + .b1 = 24, + .b2 = 4, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "ESP_Charisma_Status", + .b1 = 28, + .b2 = 2, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BR_QBit_Reifenumfang", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BR_Reifenumfang", + .b1 = 52, + .b2 = 12, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1630[] = { + { + .name = "OBD_TG_F_Status_1", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_TG_F_Status_2", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_TG_F_Status_3", + .b1 = 8, + .b2 = 4, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_TG_F_Status_4", + .b1 = 12, + .b2 = 4, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_TG_Sens_Rohwert_1", + .b1 = 16, + .b2 = 12, + .bo = 36, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_TG_Sens_Rohwert_2", + .b1 = 28, + .b2 = 12, + .bo = 24, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_TG_Sens_Rohwert_3", + .b1 = 40, + .b2 = 12, + .bo = 12, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "OBD_TG_Sens_Rohwert_4", + .b1 = 52, + .b2 = 12, + .bo = 0, + .is_signed = false, + .factor = 0.5, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1631[] = { + { + .name = "TSK_QBit_Steigung", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_QBit_Fahrzeugmasse", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_SpannungsAnf_02", + .b1 = 14, + .b2 = 2, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_DPF_reg", + .b1 = 16, + .b2 = 1, + .bo = 47, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Heizstrom_EKAT", + .b1 = 17, + .b2 = 7, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Heizstrom_SCR", + .b1 = 24, + .b2 = 6, + .bo = 34, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_Fahrzeugmasse_02", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 32, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "TSK_Steigung", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.8, + .offset = -101.6, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1633[] = { + { + .name = "AAG_BZ", + .b1 = 0, + .b2 = 4, + .bo = 60, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AAG_Bremsl_durch_ECD", + .b1 = 5, + .b2 = 1, + .bo = 58, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AAG_Anhaenger_abgesteckt", + .b1 = 6, + .b2 = 1, + .bo = 57, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AAG_NSL_aktiv", + .b1 = 7, + .b2 = 1, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AAG_Anhaenger_erkannt", + .b1 = 8, + .b2 = 1, + .bo = 55, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AAG_Blinker_H_aktiv", + .b1 = 9, + .b2 = 1, + .bo = 54, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AAG_Blinker_HL_def", + .b1 = 10, + .b2 = 1, + .bo = 53, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AAG_Blinker_HR_def", + .b1 = 11, + .b2 = 1, + .bo = 52, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AAG_Bremslicht_H_def", + .b1 = 12, + .b2 = 1, + .bo = 51, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AAG_Schlusslicht_HL_def", + .b1 = 13, + .b2 = 1, + .bo = 50, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AAG_Schlusslicht_HR_def", + .b1 = 14, + .b2 = 1, + .bo = 49, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AAG_AVS_Fehler_02", + .b1 = 18, + .b2 = 1, + .bo = 45, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AAG_AVS_Stati", + .b1 = 20, + .b2 = 4, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1648[] = { + { + .name = "MO_Hybrid_StartStopp_LED", + .b1 = 43, + .b2 = 2, + .bo = 19, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Eis_Offroad_LED", + .b1 = 45, + .b2 = 2, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Anzahl_Abgesch_Zyl", + .b1 = 47, + .b2 = 3, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Zylabsch_Texte", + .b1 = 50, + .b2 = 2, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_E85_BS_Texte", + .b1 = 52, + .b2 = 3, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_Drehzahl_Warnung", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_obere_Drehzahlgrenze", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 50, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1714[] = { + { + .name = "DGN_Verlernzaehler", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Kilometerstand", + .b1 = 8, + .b2 = 20, + .bo = 36, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UH_Jahr", + .b1 = 28, + .b2 = 7, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 2000, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UH_Monat", + .b1 = 35, + .b2 = 4, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UH_Tag", + .b1 = 39, + .b2 = 5, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UH_Stunde", + .b1 = 44, + .b2 = 5, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UH_Minute", + .b1 = 49, + .b2 = 6, + .bo = 9, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "UH_Sekunde", + .b1 = 55, + .b2 = 6, + .bo = 3, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Kombi_02_alt", + .b1 = 62, + .b2 = 1, + .bo = 1, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Uhrzeit_01_alt", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1716[] = { + { + .name = "VIN_01_MUX", + .b1 = 0, + .b2 = 2, + .bo = 62, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KS_Geheimnis_1", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_4", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_11", + .b1 = 8, + .b2 = 8, + .bo = 48, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KS_Geheimnis_2", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_5", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_12", + .b1 = 16, + .b2 = 8, + .bo = 40, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KS_Geheimnis_3", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_6", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_13", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KS_Geheimnis_4", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_7", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_14", + .b1 = 32, + .b2 = 8, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_1", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_8", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_15", + .b1 = 40, + .b2 = 8, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_2", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_9", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_16", + .b1 = 48, + .b2 = 8, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_3", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_10", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "VIN_17", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_1719[] = { + { + .name = "KBI_Kilometerstand", + .b1 = 0, + .b2 = 20, + .bo = 44, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Standzeit_02", + .b1 = 20, + .b2 = 17, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Inhalt_Tank", + .b1 = 40, + .b2 = 7, + .bo = 17, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_FStatus_Tank", + .b1 = 47, + .b2 = 1, + .bo = 16, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_QBit_Aussen_Temp_gef", + .b1 = 55, + .b2 = 1, + .bo = 8, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "KBI_Aussen_Temp_gef", + .b1 = 56, + .b2 = 8, + .bo = 0, + .is_signed = false, + .factor = 0.5, + .offset = -50.0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_2549088277[] = { + { + .name = "Airbag_01_KompSchutz", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Airbag_01_Nachlauftyp", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "AB_KD_Fehler", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_2549088284[] = { + { + .name = "SAK_KompSchutz", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SAK_Nachlauftyp", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "SAK_KD_Fehler", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_2549088374[] = { + { + .name = "Motor_KompSchutz", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Motor_Nachlauftyp", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "MO_KD_Fehler", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_2549088375[] = { + { + .name = "Getriebe_KompSchutz", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Getriebe_Nachlauftyp", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "GE_KD_Fehler", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_2549088379[] = { + { + .name = "Hybrid_KompSchutz", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "Hybrid_Nachlauftyp", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "BMS_HYB_KD_Fehler", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_2549088380[] = { + { + .name = "EMotor_KompSchutz", + .b1 = 0, + .b2 = 1, + .bo = 63, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EMotor_Nachlauftyp", + .b1 = 4, + .b2 = 4, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "EM_HYB_KD_Fehler", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_2600468496[] = { + { + .name = "NM_Gateway_SNI", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_NM_State", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_Car_Wakeup", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_Wakeup", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_NM_aktiv_KL15", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_NM_aktiv_Diagnose", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_NM_aktiv_Tmin", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_ACAN_Aktivitaet", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_FCAN_Aktivitaet", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_KCAN_Aktivitaet", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_ICAN_Aktivitaet", + .b1 = 38, + .b2 = 1, + .bo = 25, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_DiagCAN_Aktivitaet", + .b1 = 39, + .b2 = 1, + .bo = 24, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_ECAN_Aktivitaet", + .b1 = 40, + .b2 = 1, + .bo = 23, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_Energie_LIN_Aktivi000", + .b1 = 41, + .b2 = 1, + .bo = 22, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_Bedien_LIN_Aktivitaet", + .b1 = 42, + .b2 = 1, + .bo = 21, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_EM_Aktivitaet", + .b1 = 43, + .b2 = 1, + .bo = 20, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_NL_EM", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_NL_Shutdown", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_NL_Spg_Messung", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_NL_Wakeup_Monitor", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Gateway_UDS_CC", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_2600468501[] = { + { + .name = "NM_Airbag_01_SNI", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Airbag_01_NM_State", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Airbag_01_Car_Wakeup", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Airbag_01_Wakeup", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Airbag_01_NM_aktiv_KL15", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Airbag_01_NM_aktiv_Diagnose", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Airbag_01_NM_aktiv_Tmin", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Airbag_01_UDS_CC", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_2600468598[] = { + { + .name = "NM_MO_01_SNI", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_NM_State", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_Car_Wakeup", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_Wakeup", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_NM_aktiv_KL15", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_NM_aktiv_Diagnose", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_NM_aktiv_Tmin", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_NM_aktiv_HV_Abschaltung", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_NM_aktiv_EKP_Vorlauf", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_NM_aktiv_STH_Betrieb", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_NL_Kuehlerluefter", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_NL_Diagnose", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_NL_WFS", + .b1 = 50, + .b2 = 1, + .bo = 13, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_NL_EEPROM", + .b1 = 51, + .b2 = 1, + .bo = 12, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_NL_Sonstige", + .b1 = 52, + .b2 = 1, + .bo = 11, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_MO_01_UDS_CC", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_2600468599[] = { + { + .name = "NM_Getriebe_01_SNI", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Getriebe_01_NM_State", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Getriebe_01_Car_Wakeup", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Getriebe_01_Wakeup", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Getriebe_01_NM_aktiv_KL15", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Getriebe_01_NM_aktiv_Diagnose", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Getriebe_01_NM_aktiv_Tmin", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Getriebe_01_NM_aktiv_v_gr_0", + .b1 = 35, + .b2 = 1, + .bo = 28, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Getriebe_01_NM_aktiv_Pos_Erk", + .b1 = 36, + .b2 = 1, + .bo = 27, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Getriebe_01_NM_aktiv_Umg_Bed", + .b1 = 37, + .b2 = 1, + .bo = 26, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Getriebe_01_NL_Daten_EEPROM", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Getriebe_01_UDS_CC", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_2600468603[] = { + { + .name = "NM_Hybrid_01_SNI", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Hybrid_01_NM_State", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Hybrid_01_Car_Wakeup", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Hybrid_01_Wakeup", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Hybrid_01_NM_aktiv_KL15", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Hybrid_01_NM_aktiv_Diagnose", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Hybrid_01_NM_aktiv_Tmin", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Hybrid_01_NL_Daten_EEPROM", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Hybrid_01_NL_Luefter", + .b1 = 49, + .b2 = 1, + .bo = 14, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_Hybrid_01_UDS_CC", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; +const Signal sigs_2600468604[] = { + { + .name = "NM_EMotor_01_SNI", + .b1 = 0, + .b2 = 8, + .bo = 56, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_EMotor_01_NM_State", + .b1 = 16, + .b2 = 6, + .bo = 42, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_EMotor_01_Car_Wakeup", + .b1 = 22, + .b2 = 1, + .bo = 41, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_EMotor_01_Wakeup", + .b1 = 24, + .b2 = 8, + .bo = 32, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_EMotor_01_NM_aktiv_KL15", + .b1 = 32, + .b2 = 1, + .bo = 31, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_EMotor_01_NM_aktiv_Diagnose", + .b1 = 33, + .b2 = 1, + .bo = 30, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_EMotor_01_NM_aktiv_Tmin", + .b1 = 34, + .b2 = 1, + .bo = 29, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_EMotor_01_NL_Daten_EEPROM", + .b1 = 48, + .b2 = 1, + .bo = 15, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, + { + .name = "NM_EMotor_01_UDS_CC", + .b1 = 63, + .b2 = 1, + .bo = 0, + .is_signed = false, + .factor = 1, + .offset = 0, + .is_little_endian = true, + .type = SignalType::DEFAULT, + }, +}; + +const Msg msgs[] = { + { + .name = "Airbag_01", + .address = 0x40, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_64), + .sigs = sigs_64, + }, + { + .name = "Airbag_03", + .address = 0x41, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_65), + .sigs = sigs_65, + }, + { + .name = "LWI_01", + .address = 0x86, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_134), + .sigs = sigs_134, + }, + { + .name = "Motor_Hybrid_01", + .address = 0x9D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_157), + .sigs = sigs_157, + }, + { + .name = "Getriebe_Hybrid_01", + .address = 0x9E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_158), + .sigs = sigs_158, + }, + { + .name = "LH_EPS_03", + .address = 0x9F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_159), + .sigs = sigs_159, + }, + { + .name = "Motor_11", + .address = 0xA7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_167), + .sigs = sigs_167, + }, + { + .name = "Motor_12", + .address = 0xA8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_168), + .sigs = sigs_168, + }, + { + .name = "Getriebe_11", + .address = 0xAD, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_173), + .sigs = sigs_173, + }, + { + .name = "Getriebe_12", + .address = 0xAE, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_174), + .sigs = sigs_174, + }, + { + .name = "Waehlhebel_03", + .address = 0xAF, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_175), + .sigs = sigs_175, + }, + { + .name = "ESP_19", + .address = 0xB2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_178), + .sigs = sigs_178, + }, + { + .name = "ESP_21", + .address = 0xFD, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_253), + .sigs = sigs_253, + }, + { + .name = "ESP_02", + .address = 0x101, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_257), + .sigs = sigs_257, + }, + { + .name = "EPB_01", + .address = 0x104, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_260), + .sigs = sigs_260, + }, + { + .name = "ESP_05", + .address = 0x106, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_262), + .sigs = sigs_262, + }, + { + .name = "Motor_04", + .address = 0x107, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_263), + .sigs = sigs_263, + }, + { + .name = "Fahrwerk_01", + .address = 0x108, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_264), + .sigs = sigs_264, + }, + { + .name = "ESP_10", + .address = 0x116, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_278), + .sigs = sigs_278, + }, + { + .name = "ACC_10", + .address = 0x117, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_279), + .sigs = sigs_279, + }, + { + .name = "VehicleSpeed", + .address = 0x11E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_286), + .sigs = sigs_286, + }, + { + .name = "TSK_06", + .address = 0x120, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_288), + .sigs = sigs_288, + }, + { + .name = "Motor_20", + .address = 0x121, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_289), + .sigs = sigs_289, + }, + { + .name = "ACC_06", + .address = 0x122, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_290), + .sigs = sigs_290, + }, + { + .name = "HCA_01", + .address = 0x126, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_294), + .sigs = sigs_294, + }, + { + .name = "Getriebe_06", + .address = 0x128, + .size = 3, + .num_sigs = ARRAYSIZE(sigs_296), + .sigs = sigs_296, + }, + { + .name = "GRA_ACC_01", + .address = 0x12B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_299), + .sigs = sigs_299, + }, + { + .name = "Getriebe_13", + .address = 0x12D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_301), + .sigs = sigs_301, + }, + { + .name = "ACC_07", + .address = 0x12E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_302), + .sigs = sigs_302, + }, + { + .name = "EV_Gearshift", + .address = 0x187, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_391), + .sigs = sigs_391, + }, + { + .name = "ESP_15", + .address = 0x1A2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_418), + .sigs = sigs_418, + }, + { + .name = "ESP_33", + .address = 0x1AB, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_427), + .sigs = sigs_427, + }, + { + .name = "RCTA_01", + .address = 0x2B7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_695), + .sigs = sigs_695, + }, + { + .name = "Kombi_01", + .address = 0x30B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_779), + .sigs = sigs_779, + }, + { + .name = "ACC_02", + .address = 0x30C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_780), + .sigs = sigs_780, + }, + { + .name = "SWA_01", + .address = 0x30F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_783), + .sigs = sigs_783, + }, + { + .name = "TSK_07", + .address = 0x31E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_798), + .sigs = sigs_798, + }, + { + .name = "ACC_04", + .address = 0x324, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_804), + .sigs = sigs_804, + }, + { + .name = "Motor_Hybrid_02", + .address = 0x32B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_811), + .sigs = sigs_811, + }, + { + .name = "Motor_17", + .address = 0x32C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_812), + .sigs = sigs_812, + }, + { + .name = "BEM_05", + .address = 0x365, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_869), + .sigs = sigs_869, + }, + { + .name = "Blinkmodi_02", + .address = 0x366, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_870), + .sigs = sigs_870, + }, + { + .name = "Charisma_01", + .address = 0x385, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_901), + .sigs = sigs_901, + }, + { + .name = "OBD_01", + .address = 0x391, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_913), + .sigs = sigs_913, + }, + { + .name = "ESP_07", + .address = 0x392, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_914), + .sigs = sigs_914, + }, + { + .name = "WBA_03", + .address = 0x394, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_916), + .sigs = sigs_916, + }, + { + .name = "LDW_02", + .address = 0x397, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_919), + .sigs = sigs_919, + }, + { + .name = "DC_Hybrid_01", + .address = 0x3B1, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_945), + .sigs = sigs_945, + }, + { + .name = "Klima_11", + .address = 0x3B5, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_949), + .sigs = sigs_949, + }, + { + .name = "Motor_14", + .address = 0x3BE, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_958), + .sigs = sigs_958, + }, + { + .name = "Klemmen_Status_01", + .address = 0x3C0, + .size = 4, + .num_sigs = ARRAYSIZE(sigs_960), + .sigs = sigs_960, + }, + { + .name = "Motor_26", + .address = 0x3C7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_967), + .sigs = sigs_967, + }, + { + .name = "Getriebe_14", + .address = 0x3C8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_968), + .sigs = sigs_968, + }, + { + .name = "Licht_hinten_01", + .address = 0x3D6, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_982), + .sigs = sigs_982, + }, + { + .name = "RGS_VL_01", + .address = 0x3D8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_984), + .sigs = sigs_984, + }, + { + .name = "Gateway_72", + .address = 0x3DB, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_987), + .sigs = sigs_987, + }, + { + .name = "Gateway_74", + .address = 0x3DD, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_989), + .sigs = sigs_989, + }, + { + .name = "TSG_FT_02", + .address = 0x3E5, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_997), + .sigs = sigs_997, + }, + { + .name = "PSD_04", + .address = 0x462, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1122), + .sigs = sigs_1122, + }, + { + .name = "PSD_05", + .address = 0x463, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1123), + .sigs = sigs_1123, + }, + { + .name = "STS_01", + .address = 0x494, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1172), + .sigs = sigs_1172, + }, + { + .name = "Airbag_02", + .address = 0x520, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1312), + .sigs = sigs_1312, + }, + { + .name = "STH_01", + .address = 0x521, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1313), + .sigs = sigs_1313, + }, + { + .name = "Systeminfo_01", + .address = 0x585, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1413), + .sigs = sigs_1413, + }, + { + .name = "Remotestart_FFB", + .address = 0x59D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1437), + .sigs = sigs_1437, + }, + { + .name = "Dimmung_01", + .address = 0x5F0, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1520), + .sigs = sigs_1520, + }, + { + .name = "SAK_01", + .address = 0x5F8, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1528), + .sigs = sigs_1528, + }, + { + .name = "Motor_07", + .address = 0x640, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1600), + .sigs = sigs_1600, + }, + { + .name = "Motor_Code_01", + .address = 0x641, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1601), + .sigs = sigs_1601, + }, + { + .name = "WIV_01", + .address = 0x642, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1602), + .sigs = sigs_1602, + }, + { + .name = "Einheiten_01", + .address = 0x643, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1603), + .sigs = sigs_1603, + }, + { + .name = "Motor_09", + .address = 0x647, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1607), + .sigs = sigs_1607, + }, + { + .name = "Klimakomp_01", + .address = 0x659, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1625), + .sigs = sigs_1625, + }, + { + .name = "BCM_01", + .address = 0x65A, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1626), + .sigs = sigs_1626, + }, + { + .name = "BMS_Hybrid_01", + .address = 0x65C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1628), + .sigs = sigs_1628, + }, + { + .name = "ESP_20", + .address = 0x65D, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1629), + .sigs = sigs_1629, + }, + { + .name = "OBD_Tankgeber_01", + .address = 0x65E, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1630), + .sigs = sigs_1630, + }, + { + .name = "Motor_16", + .address = 0x65F, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1631), + .sigs = sigs_1631, + }, + { + .name = "Anhaenger_01", + .address = 0x661, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1633), + .sigs = sigs_1633, + }, + { + .name = "Motor_18", + .address = 0x670, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1648), + .sigs = sigs_1648, + }, + { + .name = "Diagnose_01", + .address = 0x6B2, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1714), + .sigs = sigs_1714, + }, + { + .name = "VIN_01", + .address = 0x6B4, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1716), + .sigs = sigs_1716, + }, + { + .name = "Kombi_02", + .address = 0x6B7, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_1719), + .sigs = sigs_1719, + }, + { + .name = "KN_Airbag_01", + .address = 0x97F00015, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2549088277), + .sigs = sigs_2549088277, + }, + { + .name = "KN_SAK", + .address = 0x97F0001C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2549088284), + .sigs = sigs_2549088284, + }, + { + .name = "KN_MO_01", + .address = 0x97F00076, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2549088374), + .sigs = sigs_2549088374, + }, + { + .name = "KN_Getriebe_01", + .address = 0x97F00077, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2549088375), + .sigs = sigs_2549088375, + }, + { + .name = "KN_Hybrid_01", + .address = 0x97F0007B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2549088379), + .sigs = sigs_2549088379, + }, + { + .name = "KN_EMotor_01", + .address = 0x97F0007C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2549088380), + .sigs = sigs_2549088380, + }, + { + .name = "NMH_Gateway", + .address = 0x9B000010, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2600468496), + .sigs = sigs_2600468496, + }, + { + .name = "NMH_Airbag_01", + .address = 0x9B000015, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2600468501), + .sigs = sigs_2600468501, + }, + { + .name = "NMH_MO_01", + .address = 0x9B000076, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2600468598), + .sigs = sigs_2600468598, + }, + { + .name = "NMH_Getriebe_01", + .address = 0x9B000077, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2600468599), + .sigs = sigs_2600468599, + }, + { + .name = "NMH_Hybrid_01", + .address = 0x9B00007B, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2600468603), + .sigs = sigs_2600468603, + }, + { + .name = "NMH_EMotor_01", + .address = 0x9B00007C, + .size = 8, + .num_sigs = ARRAYSIZE(sigs_2600468604), + .sigs = sigs_2600468604, + }, +}; + +const Val vals[] = { + { + .name = "EPS_HCA_Status", + .address = 0x9F, + .def_val = "0 DISABLED 1 INITIALIZING 2 FAULT 3 READY 4 REJECTED 5 ACTIVE", + .sigs = sigs_159, + }, + { + .name = "GE_Fahrstufe", + .address = 0xAD, + .def_val = "5 P 6 R 7 N 8 D 9 S 10 E 14 T", + .sigs = sigs_173, + }, + { + .name = "TSK_Status", + .address = 0x120, + .def_val = "0 INIT 1 DISABLED 2 ENABLED 3 REGULATING 4 ACCEL_PEDAL_OVERRIDE 5 BRAKE_ONLY 6 TEMP_FAULT 7 PERM_FAULT", + .sigs = sigs_288, + }, + { + .name = "ACC_Freewheel_Type", + .address = 0x12E, + .def_val = "0 FREEWHEEL_RELEASED 1 FREEWHEEL_NOT_PERMITTED 2 FREEWHEEL_NOT_RELEASED 3 FREEWHEEL_REQUESTED", + .sigs = sigs_302, + }, + { + .name = "ACC_Hold_Type", + .address = 0x12E, + .def_val = "0 NO_REQUEST 1 HOLD 2 PARK 3 HOLD_STANDBY 4 STARTUP 5 LOOSEN_OVER_RAMP", + .sigs = sigs_302, + }, + { + .name = "GearPosition", + .address = 0x187, + .def_val = "2 P 3 R 4 N 5 D 6 D", + .sigs = sigs_391, + }, + { + .name = "RegenBrakingMode", + .address = 0x187, + .def_val = "0 DEFAULT 1 B1 2 B2 3 B3", + .sigs = sigs_391, + }, + { + .name = "Fast_Send_Rate_Active", + .address = 0x366, + .def_val = "0 1_HZ 1 50_HZ", + .sigs = sigs_870, + }, +}; + +} + +const DBC vw_mqb_2010 = { + .name = "vw_mqb_2010", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init(vw_mqb_2010) \ No newline at end of file diff --git a/opendbc/can/dbc_template.cc b/opendbc/can/dbc_template.cc new file mode 100644 index 000000000..f6d498871 --- /dev/null +++ b/opendbc/can/dbc_template.cc @@ -0,0 +1,85 @@ +#include "common_dbc.h" + +namespace { + +{% for address, msg_name, msg_size, sigs in msgs %} +const Signal sigs_{{address}}[] = { + {% for sig in sigs %} + { + {% if sig.is_little_endian %} + {% set b1 = sig.start_bit %} + {% else %} + {% set b1 = (sig.start_bit//8)*8 + (-sig.start_bit-1) % 8 %} + {% endif %} + .name = "{{sig.name}}", + .b1 = {{b1}}, + .b2 = {{sig.size}}, + .bo = {{64 - (b1 + sig.size)}}, + .is_signed = {{"true" if sig.is_signed else "false"}}, + .factor = {{sig.factor}}, + .offset = {{sig.offset}}, + .is_little_endian = {{"true" if sig.is_little_endian else "false"}}, + {% if checksum_type == "honda" and sig.name == "CHECKSUM" %} + .type = SignalType::HONDA_CHECKSUM, + {% elif checksum_type == "honda" and sig.name == "COUNTER" %} + .type = SignalType::HONDA_COUNTER, + {% elif checksum_type == "toyota" and sig.name == "CHECKSUM" %} + .type = SignalType::TOYOTA_CHECKSUM, + {% elif checksum_type == "volkswagen" and sig.name == "CHECKSUM" %} + .type = SignalType::VOLKSWAGEN_CHECKSUM, + {% elif checksum_type == "volkswagen" and sig.name == "COUNTER" %} + .type = SignalType::VOLKSWAGEN_COUNTER, + {% elif checksum_type == "subaru" and sig.name == "CHECKSUM" %} + .type = SignalType::SUBARU_CHECKSUM, + {% elif checksum_type == "chrysler" and sig.name == "CHECKSUM" %} + .type = SignalType::CHRYSLER_CHECKSUM, + {% elif address in [512, 513] and sig.name == "CHECKSUM_PEDAL" %} + .type = SignalType::PEDAL_CHECKSUM, + {% elif address in [512, 513] and sig.name == "COUNTER_PEDAL" %} + .type = SignalType::PEDAL_COUNTER, + {% else %} + .type = SignalType::DEFAULT, + {% endif %} + }, + {% endfor %} +}; +{% endfor %} + +const Msg msgs[] = { +{% for address, msg_name, msg_size, sigs in msgs %} + {% set address_hex = "0x%X" % address %} + { + .name = "{{msg_name}}", + .address = {{address_hex}}, + .size = {{msg_size}}, + .num_sigs = ARRAYSIZE(sigs_{{address}}), + .sigs = sigs_{{address}}, + }, +{% endfor %} +}; + +const Val vals[] = { +{% for address, sig in def_vals %} + {% for sg_name, def_val in sig %} + {% set address_hex = "0x%X" % address %} + { + .name = "{{sg_name}}", + .address = {{address_hex}}, + .def_val = {{def_val}}, + .sigs = sigs_{{address}}, + }, + {% endfor %} +{% endfor %} +}; + +} + +const DBC {{dbc.name}} = { + .name = "{{dbc.name}}", + .num_msgs = ARRAYSIZE(msgs), + .msgs = msgs, + .vals = vals, + .num_vals = ARRAYSIZE(vals), +}; + +dbc_init({{dbc.name}}) diff --git a/opendbc/can/libdbc.so b/opendbc/can/libdbc.so new file mode 100755 index 000000000..4a395a141 Binary files /dev/null and b/opendbc/can/libdbc.so differ diff --git a/opendbc/can/packer.cc b/opendbc/can/packer.cc new file mode 100644 index 000000000..5a7312c60 --- /dev/null +++ b/opendbc/can/packer.cc @@ -0,0 +1,117 @@ +#include +#include +#include +#include +#include + +#include "common.h" + +#define WARN printf + +// this is the same as read_u64_le, but uses uint64_t as in/out +uint64_t ReverseBytes(uint64_t x) { + return ((x & 0xff00000000000000ull) >> 56) | + ((x & 0x00ff000000000000ull) >> 40) | + ((x & 0x0000ff0000000000ull) >> 24) | + ((x & 0x000000ff00000000ull) >> 8) | + ((x & 0x00000000ff000000ull) << 8) | + ((x & 0x0000000000ff0000ull) << 24) | + ((x & 0x000000000000ff00ull) << 40) | + ((x & 0x00000000000000ffull) << 56); +} + +static uint64_t set_value(uint64_t ret, const Signal& sig, int64_t ival) { + int shift = sig.is_little_endian? sig.b1 : sig.bo; + uint64_t mask = ((1ULL << sig.b2)-1) << shift; + uint64_t dat = (ival & ((1ULL << sig.b2)-1)) << shift; + if (sig.is_little_endian) { + dat = ReverseBytes(dat); + mask = ReverseBytes(mask); + } + ret &= ~mask; + ret |= dat; + return ret; +} + +CANPacker::CANPacker(const std::string& dbc_name) { + dbc = dbc_lookup(dbc_name); + assert(dbc); + + for (int i=0; inum_msgs; i++) { + const Msg* msg = &dbc->msgs[i]; + message_lookup[msg->address] = *msg; + for (int j=0; jnum_sigs; j++) { + const Signal* sig = &msg->sigs[j]; + signal_lookup[std::make_pair(msg->address, std::string(sig->name))] = *sig; + } + } + init_crc_lookup_tables(); +} + +uint64_t CANPacker::pack(uint32_t address, const std::vector &signals, int counter) { + uint64_t ret = 0; + for (const auto& sigval : signals) { + double value = sigval.value; + + auto sig_it = signal_lookup.find(std::make_pair(address, sigval.name)); + if (sig_it == signal_lookup.end()) { + WARN("undefined signal %s - %d\n", sigval.name.c_str(), address); + continue; + } + const auto& sig = sig_it->second; + + int64_t ival = (int64_t)(round((value - sig.offset) / sig.factor)); + if (ival < 0) { + ival = (1ULL << sig.b2) + ival; + } + + ret = set_value(ret, sig, ival); + } + + if (counter >= 0){ + auto sig_it = signal_lookup.find(std::make_pair(address, "COUNTER")); + if (sig_it == signal_lookup.end()) { + WARN("COUNTER not defined\n"); + return ret; + } + const auto& sig = sig_it->second; + + if ((sig.type != SignalType::HONDA_COUNTER) && (sig.type != SignalType::VOLKSWAGEN_COUNTER)) { + WARN("COUNTER signal type not valid\n"); + } + + ret = set_value(ret, sig, counter); + } + + auto sig_it_checksum = signal_lookup.find(std::make_pair(address, "CHECKSUM")); + if (sig_it_checksum != signal_lookup.end()) { + const auto& sig = sig_it_checksum->second; + if (sig.type == SignalType::HONDA_CHECKSUM) { + unsigned int chksm = honda_checksum(address, ret, message_lookup[address].size); + ret = set_value(ret, sig, chksm); + } else if (sig.type == SignalType::TOYOTA_CHECKSUM) { + unsigned int chksm = toyota_checksum(address, ret, message_lookup[address].size); + ret = set_value(ret, sig, chksm); + } else if (sig.type == SignalType::VOLKSWAGEN_CHECKSUM) { + // FIXME: Hackish fix for an endianness issue. The message is in reverse byte order + // until later in the pack process. Checksums can be run backwards, CRCs not so much. + // The correct fix is unclear but this works for the moment. + unsigned int chksm = volkswagen_crc(address, ReverseBytes(ret), message_lookup[address].size); + ret = set_value(ret, sig, chksm); + } else if (sig.type == SignalType::SUBARU_CHECKSUM) { + unsigned int chksm = subaru_checksum(address, ret, message_lookup[address].size); + ret = set_value(ret, sig, chksm); + } else if (sig.type == SignalType::CHRYSLER_CHECKSUM) { + unsigned int chksm = chrysler_checksum(address, ReverseBytes(ret), message_lookup[address].size); + ret = set_value(ret, sig, chksm); + } else { + //WARN("CHECKSUM signal type not valid\n"); + } + } + + return ret; +} + +Msg* CANPacker::lookup_message(uint32_t address) { + return &message_lookup[address]; +} diff --git a/opendbc/can/packer.py b/opendbc/can/packer.py new file mode 100644 index 000000000..fc22cce00 --- /dev/null +++ b/opendbc/can/packer.py @@ -0,0 +1,3 @@ +# pylint: skip-file +from opendbc.can.packer_pyx import CANPacker +assert CANPacker diff --git a/opendbc/can/packer_pyx.cpp b/opendbc/can/packer_pyx.cpp new file mode 100644 index 000000000..99a74cd91 --- /dev/null +++ b/opendbc/can/packer_pyx.cpp @@ -0,0 +1,5808 @@ +/* Generated by Cython 0.29.26 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "opendbc/can/common.h", + "opendbc/can/common_dbc.h" + ], + "include_dirs": [ + "./opendbc/can" + ], + "language": "c++", + "name": "opendbc.can.packer_pyx", + "sources": [ + "/data/openpilot/opendbc/can/packer_pyx.pyx" + ] + }, + "module_name": "opendbc.can.packer_pyx" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_26" +#define CYTHON_HEX_VERSION 0x001D1AF0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } + private: + T *ptr; +}; + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject* co=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(0))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too; + if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here + if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too; + Py_XDECREF((PyObject*)co); + co = (PyCodeObject*)call_result; + call_result = NULL; + if (0) { + cleanup_code_too: + Py_XDECREF((PyObject*)co); + co = NULL; + } + end: + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(call_result); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return co; + } +#else + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if defined(PyUnicode_IS_READY) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #else + #define __Pyx_PyUnicode_READY(op) (0) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__opendbc__can__packer_pyx +#define __PYX_HAVE_API__opendbc__can__packer_pyx +/* Early includes */ +#include +#include "ios" +#include "new" +#include "stdexcept" +#include "typeinfo" +#include +#include + + #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600) + // move should be defined for these versions of MSVC, but __cplusplus isn't set usefully + #include + + namespace cython_std { + template typename std::remove_reference::type&& move(T& t) noexcept { return std::move(t); } + template typename std::remove_reference::type&& move(T&& t) noexcept { return std::move(t); } + } + + #endif + +#include +#include +#include +#include +#include +#include "common_dbc.h" +#include "common.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 1 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "ascii" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "opendbc/can/packer_pyx.pyx", + "stringsource", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker; +struct __pyx_ctuple_int__and_int; +typedef struct __pyx_ctuple_int__and_int __pyx_ctuple_int__and_int; +struct __pyx_opt_args_7opendbc_3can_10packer_pyx_9CANPacker_make_can_msg; + +/* "opendbc/can/packer_pyx.pyx":19 + * cpp_CANPacker *packer + * const DBC *dbc + * map[string, (int, int)] name_to_address_and_size # <<<<<<<<<<<<<< + * map[int, int] address_to_size + * + */ +struct __pyx_ctuple_int__and_int { + int f0; + int f1; +}; + +/* "opendbc/can/packer_pyx.pyx":56 + * ((x & 0x00000000000000ffull) << 56)) + * + * cpdef make_can_msg(self, name_or_addr, bus, values, counter=-1): # <<<<<<<<<<<<<< + * cdef int addr, size + * if type(name_or_addr) == int: + */ +struct __pyx_opt_args_7opendbc_3can_10packer_pyx_9CANPacker_make_can_msg { + int __pyx_n; + PyObject *counter; +}; + +/* "opendbc/can/packer_pyx.pyx":15 + * + * + * cdef class CANPacker: # <<<<<<<<<<<<<< + * cdef: + * cpp_CANPacker *packer + */ +struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker { + PyObject_HEAD + struct __pyx_vtabstruct_7opendbc_3can_10packer_pyx_CANPacker *__pyx_vtab; + CANPacker *packer; + struct DBC const *dbc; + std::map name_to_address_and_size; + std::map address_to_size; +}; + + + +struct __pyx_vtabstruct_7opendbc_3can_10packer_pyx_CANPacker { + uint64_t (*pack)(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *, PyObject *, PyObject *, PyObject *); + uint64_t (*ReverseBytes)(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *, uint64_t); + PyObject *(*make_can_msg)(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7opendbc_3can_10packer_pyx_9CANPacker_make_can_msg *__pyx_optional_args); +}; +static struct __pyx_vtabstruct_7opendbc_3can_10packer_pyx_CANPacker *__pyx_vtabptr_7opendbc_3can_10packer_pyx_CANPacker; +static CYTHON_INLINE uint64_t __pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_ReverseBytes(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *, uint64_t); + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* PyObjectFormatSimple.proto */ +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#elif PY_MAJOR_VERSION < 3 + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ + PyObject_Format(s, f)) +#elif CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_str(s) :\ + likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_str(s) :\ + PyObject_Format(s, f)) +#else + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if CYTHON_FAST_PYCALL + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif // CYTHON_FAST_PYCALL +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* UnpackTupleError.proto */ +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); + +/* UnpackTuple2.proto */ +#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ + (likely(is_tuple || PyTuple_Check(tuple)) ?\ + (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ + __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ + (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ + __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( + PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); +static int __Pyx_unpack_tuple2_generic( + PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); + +/* dict_iter.proto */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* None.proto */ +#include + +/* GCCDiagnostics.proto */ +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CppExceptionConversion.proto */ +#ifndef __Pyx_CppExn2PyErr +#include +#include +#include +#include +static void __Pyx_CppExn2PyErr() { + try { + if (PyErr_Occurred()) + ; // let the latest Python exn pass through and ignore the current one + else + throw; + } catch (const std::bad_alloc& exn) { + PyErr_SetString(PyExc_MemoryError, exn.what()); + } catch (const std::bad_cast& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::bad_typeid& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::domain_error& exn) { + PyErr_SetString(PyExc_ValueError, exn.what()); + } catch (const std::invalid_argument& exn) { + PyErr_SetString(PyExc_ValueError, exn.what()); + } catch (const std::ios_base::failure& exn) { + PyErr_SetString(PyExc_IOError, exn.what()); + } catch (const std::out_of_range& exn) { + PyErr_SetString(PyExc_IndexError, exn.what()); + } catch (const std::overflow_error& exn) { + PyErr_SetString(PyExc_OverflowError, exn.what()); + } catch (const std::range_error& exn) { + PyErr_SetString(PyExc_ArithmeticError, exn.what()); + } catch (const std::underflow_error& exn) { + PyErr_SetString(PyExc_ArithmeticError, exn.what()); + } catch (const std::exception& exn) { + PyErr_SetString(PyExc_RuntimeError, exn.what()); + } + catch (...) + { + PyErr_SetString(PyExc_RuntimeError, "Unknown exception"); + } +} +#endif + +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static uint64_t __pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_pack(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *__pyx_v_self, PyObject *__pyx_v_addr, PyObject *__pyx_v_values, PyObject *__pyx_v_counter); /* proto*/ +static CYTHON_INLINE uint64_t __pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_ReverseBytes(CYTHON_UNUSED struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *__pyx_v_self, uint64_t __pyx_v_x); /* proto*/ +static PyObject *__pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_make_can_msg(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *__pyx_v_self, PyObject *__pyx_v_name_or_addr, PyObject *__pyx_v_bus, PyObject *__pyx_v_values, int __pyx_skip_dispatch, struct __pyx_opt_args_7opendbc_3can_10packer_pyx_9CANPacker_make_can_msg *__pyx_optional_args); /* proto*/ + +/* Module declarations from 'libc.stdint' */ + +/* Module declarations from 'libcpp.vector' */ + +/* Module declarations from 'libcpp.utility' */ + +/* Module declarations from 'libcpp.map' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libcpp.string' */ + +/* Module declarations from 'libcpp' */ + +/* Module declarations from 'posix.dlfcn' */ + +/* Module declarations from 'libcpp.unordered_set' */ + +/* Module declarations from 'opendbc.can.common' */ + +/* Module declarations from 'opendbc.can.packer_pyx' */ +static PyTypeObject *__pyx_ptype_7opendbc_3can_10packer_pyx_CANPacker = 0; +static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/ +#define __Pyx_MODULE_NAME "opendbc.can.packer_pyx" +extern int __pyx_module_is_main_opendbc__can__packer_pyx; +int __pyx_module_is_main_opendbc__can__packer_pyx = 0; + +/* Implementation of 'opendbc.can.packer_pyx' */ +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_TypeError; +static const char __pyx_k_bus[] = "bus"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_utf8[] = "utf8"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_values[] = "values"; +static const char __pyx_k_counter[] = "counter"; +static const char __pyx_k_dbc_name[] = "dbc_name"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_CANPacker[] = "CANPacker"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_iteritems[] = "iteritems"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_Can_t_lookup[] = "Can't lookup "; +static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_make_can_msg[] = "make_can_msg"; +static const char __pyx_k_name_or_addr[] = "name_or_addr"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_self_dbc_self_packer_cannot_be_c[] = "self.dbc,self.packer cannot be converted to a Python object for pickling"; +static PyObject *__pyx_n_s_CANPacker; +static PyObject *__pyx_kp_u_Can_t_lookup; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_bus; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_counter; +static PyObject *__pyx_n_s_dbc_name; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_n_s_iteritems; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_make_can_msg; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_or_addr; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_reduce_ex; +static PyObject *__pyx_kp_s_self_dbc_self_packer_cannot_be_c; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_u_utf8; +static PyObject *__pyx_n_s_values; +static int __pyx_pf_7opendbc_3can_10packer_pyx_9CANPacker___init__(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *__pyx_v_self, PyObject *__pyx_v_dbc_name); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10packer_pyx_9CANPacker_2make_can_msg(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *__pyx_v_self, PyObject *__pyx_v_name_or_addr, PyObject *__pyx_v_bus, PyObject *__pyx_v_values, PyObject *__pyx_v_counter); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10packer_pyx_9CANPacker_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10packer_pyx_9CANPacker_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_7opendbc_3can_10packer_pyx_CANPacker(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +/* Late includes */ + +/* "opendbc/can/packer_pyx.pyx":22 + * map[int, int] address_to_size + * + * def __init__(self, dbc_name): # <<<<<<<<<<<<<< + * self.dbc = dbc_lookup(dbc_name) + * if not self.dbc: + */ + +/* Python wrapper */ +static int __pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dbc_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dbc_name,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dbc_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 22, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_dbc_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 22, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("opendbc.can.packer_pyx.CANPacker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_7opendbc_3can_10packer_pyx_9CANPacker___init__(((struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *)__pyx_v_self), __pyx_v_dbc_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_7opendbc_3can_10packer_pyx_9CANPacker___init__(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *__pyx_v_self, PyObject *__pyx_v_dbc_name) { + size_t __pyx_v_num_msgs; + size_t __pyx_v_i; + struct Msg __pyx_v_msg; + int __pyx_r; + __Pyx_RefNannyDeclarations + std::string __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + size_t __pyx_t_5; + size_t __pyx_t_6; + size_t __pyx_t_7; + __pyx_ctuple_int__and_int __pyx_t_8; + unsigned int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "opendbc/can/packer_pyx.pyx":23 + * + * def __init__(self, dbc_name): + * self.dbc = dbc_lookup(dbc_name) # <<<<<<<<<<<<<< + * if not self.dbc: + * raise RuntimeError(f"Can't lookup {dbc_name}") + */ + __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_dbc_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_v_self->dbc = dbc_lookup(__pyx_t_1); + + /* "opendbc/can/packer_pyx.pyx":24 + * def __init__(self, dbc_name): + * self.dbc = dbc_lookup(dbc_name) + * if not self.dbc: # <<<<<<<<<<<<<< + * raise RuntimeError(f"Can't lookup {dbc_name}") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->dbc != 0)) != 0); + if (unlikely(__pyx_t_2)) { + + /* "opendbc/can/packer_pyx.pyx":25 + * self.dbc = dbc_lookup(dbc_name) + * if not self.dbc: + * raise RuntimeError(f"Can't lookup {dbc_name}") # <<<<<<<<<<<<<< + * + * self.packer = new cpp_CANPacker(dbc_name) + */ + __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_dbc_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Can_t_lookup, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 25, __pyx_L1_error) + + /* "opendbc/can/packer_pyx.pyx":24 + * def __init__(self, dbc_name): + * self.dbc = dbc_lookup(dbc_name) + * if not self.dbc: # <<<<<<<<<<<<<< + * raise RuntimeError(f"Can't lookup {dbc_name}") + * + */ + } + + /* "opendbc/can/packer_pyx.pyx":27 + * raise RuntimeError(f"Can't lookup {dbc_name}") + * + * self.packer = new cpp_CANPacker(dbc_name) # <<<<<<<<<<<<<< + * num_msgs = self.dbc[0].num_msgs + * for i in range(num_msgs): + */ + __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_dbc_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_v_self->packer = new CANPacker(__pyx_t_1); + + /* "opendbc/can/packer_pyx.pyx":28 + * + * self.packer = new cpp_CANPacker(dbc_name) + * num_msgs = self.dbc[0].num_msgs # <<<<<<<<<<<<<< + * for i in range(num_msgs): + * msg = self.dbc[0].msgs[i] + */ + __pyx_t_5 = (__pyx_v_self->dbc[0]).num_msgs; + __pyx_v_num_msgs = __pyx_t_5; + + /* "opendbc/can/packer_pyx.pyx":29 + * self.packer = new cpp_CANPacker(dbc_name) + * num_msgs = self.dbc[0].num_msgs + * for i in range(num_msgs): # <<<<<<<<<<<<<< + * msg = self.dbc[0].msgs[i] + * self.name_to_address_and_size[string(msg.name)] = (msg.address, msg.size) + */ + __pyx_t_5 = __pyx_v_num_msgs; + __pyx_t_6 = __pyx_t_5; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "opendbc/can/packer_pyx.pyx":30 + * num_msgs = self.dbc[0].num_msgs + * for i in range(num_msgs): + * msg = self.dbc[0].msgs[i] # <<<<<<<<<<<<<< + * self.name_to_address_and_size[string(msg.name)] = (msg.address, msg.size) + * self.address_to_size[msg.address] = msg.size + */ + __pyx_v_msg = ((__pyx_v_self->dbc[0]).msgs[__pyx_v_i]); + + /* "opendbc/can/packer_pyx.pyx":31 + * for i in range(num_msgs): + * msg = self.dbc[0].msgs[i] + * self.name_to_address_and_size[string(msg.name)] = (msg.address, msg.size) # <<<<<<<<<<<<<< + * self.address_to_size[msg.address] = msg.size + * + */ + __pyx_t_8.f0 = __pyx_v_msg.address; + __pyx_t_8.f1 = __pyx_v_msg.size; + try { + __pyx_t_1 = std::string(__pyx_v_msg.name); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 31, __pyx_L1_error) + } + (__pyx_v_self->name_to_address_and_size[__pyx_t_1]) = __pyx_t_8; + + /* "opendbc/can/packer_pyx.pyx":32 + * msg = self.dbc[0].msgs[i] + * self.name_to_address_and_size[string(msg.name)] = (msg.address, msg.size) + * self.address_to_size[msg.address] = msg.size # <<<<<<<<<<<<<< + * + * cdef uint64_t pack(self, addr, values, counter): + */ + __pyx_t_9 = __pyx_v_msg.size; + (__pyx_v_self->address_to_size[__pyx_v_msg.address]) = __pyx_t_9; + } + + /* "opendbc/can/packer_pyx.pyx":22 + * map[int, int] address_to_size + * + * def __init__(self, dbc_name): # <<<<<<<<<<<<<< + * self.dbc = dbc_lookup(dbc_name) + * if not self.dbc: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("opendbc.can.packer_pyx.CANPacker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/packer_pyx.pyx":34 + * self.address_to_size[msg.address] = msg.size + * + * cdef uint64_t pack(self, addr, values, counter): # <<<<<<<<<<<<<< + * cdef vector[SignalPackValue] values_thing + * values_thing.reserve(len(values)) + */ + +static uint64_t __pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_pack(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *__pyx_v_self, PyObject *__pyx_v_addr, PyObject *__pyx_v_values, PyObject *__pyx_v_counter) { + std::vector __pyx_v_values_thing; + struct SignalPackValue __pyx_v_spv; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_v_value = NULL; + uint64_t __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + std::string __pyx_t_9; + double __pyx_t_10; + uint32_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack", 0); + + /* "opendbc/can/packer_pyx.pyx":36 + * cdef uint64_t pack(self, addr, values, counter): + * cdef vector[SignalPackValue] values_thing + * values_thing.reserve(len(values)) # <<<<<<<<<<<<<< + * cdef SignalPackValue spv + * + */ + __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_v_values_thing.reserve(__pyx_t_1); + + /* "opendbc/can/packer_pyx.pyx":39 + * cdef SignalPackValue spv + * + * for name, value in values.iteritems(): # <<<<<<<<<<<<<< + * spv.name = name.encode('utf8') + * spv.value = value + */ + __pyx_t_1 = 0; + if (unlikely(__pyx_v_values == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems"); + __PYX_ERR(0, 39, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_values, 0, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_2); + __pyx_t_2 = __pyx_t_5; + __pyx_t_5 = 0; + while (1) { + __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_3, &__pyx_t_1, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); + if (unlikely(__pyx_t_7 == 0)) break; + if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); + __pyx_t_6 = 0; + + /* "opendbc/can/packer_pyx.pyx":40 + * + * for name, value in values.iteritems(): + * spv.name = name.encode('utf8') # <<<<<<<<<<<<<< + * spv.value = value + * values_thing.push_back(spv) + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_n_u_utf8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_utf8); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_spv.name = __pyx_t_9; + + /* "opendbc/can/packer_pyx.pyx":41 + * for name, value in values.iteritems(): + * spv.name = name.encode('utf8') + * spv.value = value # <<<<<<<<<<<<<< + * values_thing.push_back(spv) + * + */ + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_v_spv.value = __pyx_t_10; + + /* "opendbc/can/packer_pyx.pyx":42 + * spv.name = name.encode('utf8') + * spv.value = value + * values_thing.push_back(spv) # <<<<<<<<<<<<<< + * + * return self.packer.pack(addr, values_thing, counter) + */ + try { + __pyx_v_values_thing.push_back(__pyx_v_spv); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 42, __pyx_L1_error) + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "opendbc/can/packer_pyx.pyx":44 + * values_thing.push_back(spv) + * + * return self.packer.pack(addr, values_thing, counter) # <<<<<<<<<<<<<< + * + * cdef inline uint64_t ReverseBytes(self, uint64_t x): + */ + __pyx_t_11 = __Pyx_PyInt_As_uint32_t(__pyx_v_addr); if (unlikely((__pyx_t_11 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_counter); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_r = __pyx_v_self->packer->pack(__pyx_t_11, __pyx_v_values_thing, __pyx_t_4); + goto __pyx_L0; + + /* "opendbc/can/packer_pyx.pyx":34 + * self.address_to_size[msg.address] = msg.size + * + * cdef uint64_t pack(self, addr, values, counter): # <<<<<<<<<<<<<< + * cdef vector[SignalPackValue] values_thing + * values_thing.reserve(len(values)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_WriteUnraisable("opendbc.can.packer_pyx.CANPacker.pack", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/packer_pyx.pyx":46 + * return self.packer.pack(addr, values_thing, counter) + * + * cdef inline uint64_t ReverseBytes(self, uint64_t x): # <<<<<<<<<<<<<< + * return (((x & 0xff00000000000000ull) >> 56) | + * ((x & 0x00ff000000000000ull) >> 40) | + */ + +static CYTHON_INLINE uint64_t __pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_ReverseBytes(CYTHON_UNUSED struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *__pyx_v_self, uint64_t __pyx_v_x) { + uint64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ReverseBytes", 0); + + /* "opendbc/can/packer_pyx.pyx":53 + * ((x & 0x00000000ff000000ull) << 8) | + * ((x & 0x0000000000ff0000ull) << 24) | + * ((x & 0x000000000000ff00ull) << 40) | # <<<<<<<<<<<<<< + * ((x & 0x00000000000000ffull) << 56)) + * + */ + __pyx_r = (((((((((__pyx_v_x & 0xff00000000000000ULL) >> 56) | ((__pyx_v_x & 0x00ff000000000000ULL) >> 40)) | ((__pyx_v_x & 0x0000ff0000000000ULL) >> 24)) | ((__pyx_v_x & 0x000000ff00000000ULL) >> 8)) | ((__pyx_v_x & 0x00000000ff000000ULL) << 8)) | ((__pyx_v_x & 0x0000000000ff0000ULL) << 24)) | ((__pyx_v_x & 0x000000000000ff00ULL) << 40)) | ((__pyx_v_x & 0x00000000000000ffULL) << 56)); + goto __pyx_L0; + + /* "opendbc/can/packer_pyx.pyx":46 + * return self.packer.pack(addr, values_thing, counter) + * + * cdef inline uint64_t ReverseBytes(self, uint64_t x): # <<<<<<<<<<<<<< + * return (((x & 0xff00000000000000ull) >> 56) | + * ((x & 0x00ff000000000000ull) >> 40) | + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/packer_pyx.pyx":56 + * ((x & 0x00000000000000ffull) << 56)) + * + * cpdef make_can_msg(self, name_or_addr, bus, values, counter=-1): # <<<<<<<<<<<<<< + * cdef int addr, size + * if type(name_or_addr) == int: + */ + +static PyObject *__pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_3make_can_msg(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_make_can_msg(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *__pyx_v_self, PyObject *__pyx_v_name_or_addr, PyObject *__pyx_v_bus, PyObject *__pyx_v_values, int __pyx_skip_dispatch, struct __pyx_opt_args_7opendbc_3can_10packer_pyx_9CANPacker_make_can_msg *__pyx_optional_args) { + PyObject *__pyx_v_counter = ((PyObject *)__pyx_int_neg_1); + int __pyx_v_addr; + int __pyx_v_size; + uint64_t __pyx_v_val; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + std::string __pyx_t_8; + __pyx_ctuple_int__and_int __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("make_can_msg", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_counter = __pyx_optional_args->counter; + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS + static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; + if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { + PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_make_can_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_3make_can_msg)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_name_or_addr, __pyx_v_bus, __pyx_v_values, __pyx_v_counter}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_name_or_addr, __pyx_v_bus, __pyx_v_values, __pyx_v_counter}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_name_or_addr); + __Pyx_GIVEREF(__pyx_v_name_or_addr); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_name_or_addr); + __Pyx_INCREF(__pyx_v_bus); + __Pyx_GIVEREF(__pyx_v_bus); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_bus); + __Pyx_INCREF(__pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_values); + __Pyx_INCREF(__pyx_v_counter); + __Pyx_GIVEREF(__pyx_v_counter); + PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_counter); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS + __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); + __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); + if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { + __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS + } + #endif + } + + /* "opendbc/can/packer_pyx.pyx":58 + * cpdef make_can_msg(self, name_or_addr, bus, values, counter=-1): + * cdef int addr, size + * if type(name_or_addr) == int: # <<<<<<<<<<<<<< + * addr = name_or_addr + * size = self.address_to_size[name_or_addr] + */ + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_name_or_addr)), ((PyObject *)(&PyInt_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_7) { + + /* "opendbc/can/packer_pyx.pyx":59 + * cdef int addr, size + * if type(name_or_addr) == int: + * addr = name_or_addr # <<<<<<<<<<<<<< + * size = self.address_to_size[name_or_addr] + * else: + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_name_or_addr); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_v_addr = __pyx_t_5; + + /* "opendbc/can/packer_pyx.pyx":60 + * if type(name_or_addr) == int: + * addr = name_or_addr + * size = self.address_to_size[name_or_addr] # <<<<<<<<<<<<<< + * else: + * addr, size = self.name_to_address_and_size[name_or_addr.encode('utf8')] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_name_or_addr); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_v_size = (__pyx_v_self->address_to_size[__pyx_t_5]); + + /* "opendbc/can/packer_pyx.pyx":58 + * cpdef make_can_msg(self, name_or_addr, bus, values, counter=-1): + * cdef int addr, size + * if type(name_or_addr) == int: # <<<<<<<<<<<<<< + * addr = name_or_addr + * size = self.address_to_size[name_or_addr] + */ + goto __pyx_L3; + } + + /* "opendbc/can/packer_pyx.pyx":62 + * size = self.address_to_size[name_or_addr] + * else: + * addr, size = self.name_to_address_and_size[name_or_addr.encode('utf8')] # <<<<<<<<<<<<<< + * cdef uint64_t val = self.pack(addr, values, counter) + * val = self.ReverseBytes(val) + */ + /*else*/ { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name_or_addr, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_u_utf8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_utf8); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = (__pyx_v_self->name_to_address_and_size[__pyx_t_8]); + __pyx_t_5 = __pyx_t_9.f0; + __pyx_t_10 = __pyx_t_9.f1; + __pyx_v_addr = __pyx_t_5; + __pyx_v_size = __pyx_t_10; + } + __pyx_L3:; + + /* "opendbc/can/packer_pyx.pyx":63 + * else: + * addr, size = self.name_to_address_and_size[name_or_addr.encode('utf8')] + * cdef uint64_t val = self.pack(addr, values, counter) # <<<<<<<<<<<<<< + * val = self.ReverseBytes(val) + * return [addr, 0, (&val)[:size], bus] + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_addr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_val = ((struct __pyx_vtabstruct_7opendbc_3can_10packer_pyx_CANPacker *)__pyx_v_self->__pyx_vtab)->pack(__pyx_v_self, __pyx_t_1, __pyx_v_values, __pyx_v_counter); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "opendbc/can/packer_pyx.pyx":64 + * addr, size = self.name_to_address_and_size[name_or_addr.encode('utf8')] + * cdef uint64_t val = self.pack(addr, values, counter) + * val = self.ReverseBytes(val) # <<<<<<<<<<<<<< + * return [addr, 0, (&val)[:size], bus] + */ + __pyx_v_val = __pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_ReverseBytes(__pyx_v_self, __pyx_v_val); + + /* "opendbc/can/packer_pyx.pyx":65 + * cdef uint64_t val = self.pack(addr, values, counter) + * val = self.ReverseBytes(val) + * return [addr, 0, (&val)[:size], bus] # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_addr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char *)(&__pyx_v_val)) + 0, __pyx_v_size - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_INCREF(__pyx_v_bus); + __Pyx_GIVEREF(__pyx_v_bus); + PyList_SET_ITEM(__pyx_t_3, 3, __pyx_v_bus); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "opendbc/can/packer_pyx.pyx":56 + * ((x & 0x00000000000000ffull) << 56)) + * + * cpdef make_can_msg(self, name_or_addr, bus, values, counter=-1): # <<<<<<<<<<<<<< + * cdef int addr, size + * if type(name_or_addr) == int: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("opendbc.can.packer_pyx.CANPacker.make_can_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_3make_can_msg(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_3make_can_msg(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name_or_addr = 0; + PyObject *__pyx_v_bus = 0; + PyObject *__pyx_v_values = 0; + PyObject *__pyx_v_counter = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("make_can_msg (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name_or_addr,&__pyx_n_s_bus,&__pyx_n_s_values,&__pyx_n_s_counter,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = ((PyObject *)__pyx_int_neg_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_or_addr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bus)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("make_can_msg", 0, 3, 4, 1); __PYX_ERR(0, 56, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("make_can_msg", 0, 3, 4, 2); __PYX_ERR(0, 56, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_counter); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "make_can_msg") < 0)) __PYX_ERR(0, 56, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_name_or_addr = values[0]; + __pyx_v_bus = values[1]; + __pyx_v_values = values[2]; + __pyx_v_counter = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("make_can_msg", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("opendbc.can.packer_pyx.CANPacker.make_can_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_7opendbc_3can_10packer_pyx_9CANPacker_2make_can_msg(((struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *)__pyx_v_self), __pyx_v_name_or_addr, __pyx_v_bus, __pyx_v_values, __pyx_v_counter); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10packer_pyx_9CANPacker_2make_can_msg(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *__pyx_v_self, PyObject *__pyx_v_name_or_addr, PyObject *__pyx_v_bus, PyObject *__pyx_v_values, PyObject *__pyx_v_counter) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_7opendbc_3can_10packer_pyx_9CANPacker_make_can_msg __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("make_can_msg", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.counter = __pyx_v_counter; + __pyx_t_1 = __pyx_vtabptr_7opendbc_3can_10packer_pyx_CANPacker->make_can_msg(__pyx_v_self, __pyx_v_name_or_addr, __pyx_v_bus, __pyx_v_values, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("opendbc.can.packer_pyx.CANPacker.make_can_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.dbc,self.packer cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10packer_pyx_9CANPacker_4__reduce_cython__(((struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10packer_pyx_9CANPacker_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.dbc,self.packer cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.dbc,self.packer cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.dbc,self.packer cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("opendbc.can.packer_pyx.CANPacker.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.dbc,self.packer cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.dbc,self.packer cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10packer_pyx_9CANPacker_6__setstate_cython__(((struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10packer_pyx_9CANPacker_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("self.dbc,self.packer cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.dbc,self.packer cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.dbc,self.packer cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.dbc,self.packer cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("opendbc.can.packer_pyx.CANPacker.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + +static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) { + Py_ssize_t __pyx_v_length; + char const *__pyx_v_data; + std::string __pyx_r; + __Pyx_RefNannyDeclarations + char const *__pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0); + + /* "string.from_py":14 + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<< + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) + */ + __pyx_v_length = 0; + + /* "string.from_py":15 + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<< + * return string(data, length) + * + */ + __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(1, 15, __pyx_L1_error) + __pyx_v_data = __pyx_t_1; + + /* "string.from_py":16 + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = std::string(__pyx_v_data, __pyx_v_length); + goto __pyx_L0; + + /* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_7opendbc_3can_10packer_pyx_CANPacker __pyx_vtable_7opendbc_3can_10packer_pyx_CANPacker; + +static PyObject *__pyx_tp_new_7opendbc_3can_10packer_pyx_CANPacker(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *)o); + p->__pyx_vtab = __pyx_vtabptr_7opendbc_3can_10packer_pyx_CANPacker; + new((void*)&(p->name_to_address_and_size)) std::map (); + new((void*)&(p->address_to_size)) std::map (); + return o; +} + +static void __pyx_tp_dealloc_7opendbc_3can_10packer_pyx_CANPacker(PyObject *o) { + struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *p = (struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + __Pyx_call_destructor(p->name_to_address_and_size); + __Pyx_call_destructor(p->address_to_size); + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_7opendbc_3can_10packer_pyx_CANPacker[] = { + {"make_can_msg", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_3make_can_msg, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_7__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_7opendbc_3can_10packer_pyx_CANPacker = { + PyVarObject_HEAD_INIT(0, 0) + "opendbc.can.packer_pyx.CANPacker", /*tp_name*/ + sizeof(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7opendbc_3can_10packer_pyx_CANPacker, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_7opendbc_3can_10packer_pyx_CANPacker, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7opendbc_3can_10packer_pyx_CANPacker, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_packer_pyx(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_packer_pyx}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "packer_pyx", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_CANPacker, __pyx_k_CANPacker, sizeof(__pyx_k_CANPacker), 0, 0, 1, 1}, + {&__pyx_kp_u_Can_t_lookup, __pyx_k_Can_t_lookup, sizeof(__pyx_k_Can_t_lookup), 0, 1, 0, 0}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_bus, __pyx_k_bus, sizeof(__pyx_k_bus), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_counter, __pyx_k_counter, sizeof(__pyx_k_counter), 0, 0, 1, 1}, + {&__pyx_n_s_dbc_name, __pyx_k_dbc_name, sizeof(__pyx_k_dbc_name), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_make_can_msg, __pyx_k_make_can_msg, sizeof(__pyx_k_make_can_msg), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_or_addr, __pyx_k_name_or_addr, sizeof(__pyx_k_name_or_addr), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_kp_s_self_dbc_self_packer_cannot_be_c, __pyx_k_self_dbc_self_packer_cannot_be_c, sizeof(__pyx_k_self_dbc_self_packer_cannot_be_c), 0, 0, 1, 0}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_u_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 1, 0, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.dbc,self.packer cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.dbc,self.packer cannot be converted to a Python object for pickling") + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self_dbc_self_packer_cannot_be_c); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(tree fragment)":4 + * raise TypeError("self.dbc,self.packer cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.dbc,self.packer cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_dbc_self_packer_cannot_be_c); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_vtabptr_7opendbc_3can_10packer_pyx_CANPacker = &__pyx_vtable_7opendbc_3can_10packer_pyx_CANPacker; + __pyx_vtable_7opendbc_3can_10packer_pyx_CANPacker.pack = (uint64_t (*)(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *, PyObject *, PyObject *, PyObject *))__pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_pack; + __pyx_vtable_7opendbc_3can_10packer_pyx_CANPacker.ReverseBytes = (uint64_t (*)(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *, uint64_t))__pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_ReverseBytes; + __pyx_vtable_7opendbc_3can_10packer_pyx_CANPacker.make_can_msg = (PyObject *(*)(struct __pyx_obj_7opendbc_3can_10packer_pyx_CANPacker *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7opendbc_3can_10packer_pyx_9CANPacker_make_can_msg *__pyx_optional_args))__pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_make_can_msg; + if (PyType_Ready(&__pyx_type_7opendbc_3can_10packer_pyx_CANPacker) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_7opendbc_3can_10packer_pyx_CANPacker.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7opendbc_3can_10packer_pyx_CANPacker.tp_dictoffset && __pyx_type_7opendbc_3can_10packer_pyx_CANPacker.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_7opendbc_3can_10packer_pyx_CANPacker.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_7opendbc_3can_10packer_pyx_CANPacker.tp_dict, __pyx_vtabptr_7opendbc_3can_10packer_pyx_CANPacker) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CANPacker, (PyObject *)&__pyx_type_7opendbc_3can_10packer_pyx_CANPacker) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7opendbc_3can_10packer_pyx_CANPacker) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_ptype_7opendbc_3can_10packer_pyx_CANPacker = &__pyx_type_7opendbc_3can_10packer_pyx_CANPacker; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initpacker_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initpacker_pyx(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_packer_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_packer_pyx(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_packer_pyx(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'packer_pyx' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_packer_pyx(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("packer_pyx", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_opendbc__can__packer_pyx) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "opendbc.can.packer_pyx")) { + if (unlikely(PyDict_SetItemString(modules, "opendbc.can.packer_pyx", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "opendbc/can/packer_pyx.pyx":1 + * # distutils: language = c++ # <<<<<<<<<<<<<< + * # cython: c_string_encoding=ascii, language_level=3 + * + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init opendbc.can.packer_pyx", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init opendbc.can.packer_pyx"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (__Pyx_PyFastCFunction_Check(func)) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (descr != NULL) { + *method = descr; + return 0; + } + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); +#endif + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* RaiseNoneIterError */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* UnpackTupleError */ +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +/* UnpackTuple2 */ +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( + PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { + PyObject *value1 = NULL, *value2 = NULL; +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); + value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); +#endif + if (decref_tuple) { + Py_DECREF(tuple); + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +#if CYTHON_COMPILING_IN_PYPY +bad: + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +#endif +} +static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = Py_TYPE(iter)->tp_iternext; + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +/* dict_iter */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; + if (is_dict) { +#if !CYTHON_COMPILING_IN_PYPY + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; +#elif PY_MAJOR_VERSION >= 3 + static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; + PyObject **pp = NULL; + if (method_name) { + const char *name = PyUnicode_AsUTF8(method_name); + if (strcmp(name, "iteritems") == 0) pp = &py_items; + else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; + else if (strcmp(name, "itervalues") == 0) pp = &py_values; + if (pp) { + if (!*pp) { + *pp = PyUnicode_FromString(name + 4); + if (!*pp) + return NULL; + } + method_name = *pp; + } + } +#endif + } + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next( + PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; +} + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* PyObjectGetAttrStrNoError */ +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* SetupReduce */ +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#else + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#endif +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); + if (likely(reduce_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (reduce == object_reduce || PyErr_Occurred()) { + goto __PYX_BAD; + } + setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); + if (likely(setstate_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (!setstate || PyErr_Occurred()) { + goto __PYX_BAD; + } + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto __PYX_GOOD; +__PYX_BAD: + if (!PyErr_Occurred()) + PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +__PYX_GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { + return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { + return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { + return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) + case -2: + if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(uint32_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (uint32_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (uint32_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) + case 2: + if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { + return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { + return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { + return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (uint32_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(uint32_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (uint32_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) + case -2: + if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { + return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { + return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { + return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { + return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { + return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { + return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(uint32_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + uint32_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (uint32_t) -1; + } + } else { + uint32_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (uint32_t) -1; + val = __Pyx_PyInt_As_uint32_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to uint32_t"); + return (uint32_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to uint32_t"); + return (uint32_t) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; ip) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/opendbc/can/packer_pyx.pyx b/opendbc/can/packer_pyx.pyx new file mode 100644 index 000000000..4b8f3e36f --- /dev/null +++ b/opendbc/can/packer_pyx.pyx @@ -0,0 +1,65 @@ +# distutils: language = c++ +# cython: c_string_encoding=ascii, language_level=3 + +from libc.stdint cimport uint32_t, uint64_t +from libcpp.vector cimport vector +from libcpp.map cimport map +from libcpp.string cimport string +from libcpp cimport bool +from posix.dlfcn cimport dlopen, dlsym, RTLD_LAZY + +from .common cimport CANPacker as cpp_CANPacker +from .common cimport dbc_lookup, SignalPackValue, DBC + + +cdef class CANPacker: + cdef: + cpp_CANPacker *packer + const DBC *dbc + map[string, (int, int)] name_to_address_and_size + map[int, int] address_to_size + + def __init__(self, dbc_name): + self.dbc = dbc_lookup(dbc_name) + if not self.dbc: + raise RuntimeError(f"Can't lookup {dbc_name}") + + self.packer = new cpp_CANPacker(dbc_name) + num_msgs = self.dbc[0].num_msgs + for i in range(num_msgs): + msg = self.dbc[0].msgs[i] + self.name_to_address_and_size[string(msg.name)] = (msg.address, msg.size) + self.address_to_size[msg.address] = msg.size + + cdef uint64_t pack(self, addr, values, counter): + cdef vector[SignalPackValue] values_thing + values_thing.reserve(len(values)) + cdef SignalPackValue spv + + for name, value in values.iteritems(): + spv.name = name.encode('utf8') + spv.value = value + values_thing.push_back(spv) + + return self.packer.pack(addr, values_thing, counter) + + cdef inline uint64_t ReverseBytes(self, uint64_t x): + return (((x & 0xff00000000000000ull) >> 56) | + ((x & 0x00ff000000000000ull) >> 40) | + ((x & 0x0000ff0000000000ull) >> 24) | + ((x & 0x000000ff00000000ull) >> 8) | + ((x & 0x00000000ff000000ull) << 8) | + ((x & 0x0000000000ff0000ull) << 24) | + ((x & 0x000000000000ff00ull) << 40) | + ((x & 0x00000000000000ffull) << 56)) + + cpdef make_can_msg(self, name_or_addr, bus, values, counter=-1): + cdef int addr, size + if type(name_or_addr) == int: + addr = name_or_addr + size = self.address_to_size[name_or_addr] + else: + addr, size = self.name_to_address_and_size[name_or_addr.encode('utf8')] + cdef uint64_t val = self.pack(addr, values, counter) + val = self.ReverseBytes(val) + return [addr, 0, (&val)[:size], bus] diff --git a/opendbc/can/packer_pyx.so b/opendbc/can/packer_pyx.so new file mode 100755 index 000000000..58ab303c1 Binary files /dev/null and b/opendbc/can/packer_pyx.so differ diff --git a/opendbc/can/parser.cc b/opendbc/can/parser.cc new file mode 100644 index 000000000..dc1887c6e --- /dev/null +++ b/opendbc/can/parser.cc @@ -0,0 +1,306 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "common.h" + +#define DEBUG(...) +// #define DEBUG printf +#define INFO printf + +bool MessageState::parse(uint64_t sec, uint8_t * dat) { + uint64_t dat_le = read_u64_le(dat); + uint64_t dat_be = read_u64_be(dat); + + for (int i=0; i < parse_sigs.size(); i++) { + auto& sig = parse_sigs[i]; + int64_t tmp; + + if (sig.is_little_endian){ + tmp = (dat_le >> sig.b1) & ((1ULL << sig.b2)-1); + } else { + tmp = (dat_be >> sig.bo) & ((1ULL << sig.b2)-1); + } + + if (sig.is_signed) { + tmp -= (tmp >> (sig.b2-1)) ? (1ULL << sig.b2) : 0; //signed + } + + DEBUG("parse 0x%X %s -> %lld\n", address, sig.name, tmp); + + if (!ignore_checksum) { + if (sig.type == SignalType::HONDA_CHECKSUM) { + if (honda_checksum(address, dat_be, size) != tmp) { + INFO("0x%X CHECKSUM FAIL\n", address); + return false; + } + } else if (sig.type == SignalType::TOYOTA_CHECKSUM) { + if (toyota_checksum(address, dat_be, size) != tmp) { + INFO("0x%X CHECKSUM FAIL\n", address); + return false; + } + } else if (sig.type == SignalType::VOLKSWAGEN_CHECKSUM) { + if (volkswagen_crc(address, dat_le, size) != tmp) { + INFO("0x%X CRC FAIL\n", address); + return false; + } + } else if (sig.type == SignalType::SUBARU_CHECKSUM) { + if (subaru_checksum(address, dat_be, size) != tmp) { + INFO("0x%X CHECKSUM FAIL\n", address); + return false; + } + } else if (sig.type == SignalType::CHRYSLER_CHECKSUM) { + if (chrysler_checksum(address, dat_le, size) != tmp) { + INFO("0x%X CHECKSUM FAIL\n", address); + return false; + } + } else if (sig.type == SignalType::PEDAL_CHECKSUM) { + if (pedal_checksum(dat_be, size) != tmp) { + INFO("0x%X PEDAL CHECKSUM FAIL\n", address); + return false; + } + } + } + if (!ignore_counter) { + if (sig.type == SignalType::HONDA_COUNTER) { + if (!update_counter_generic(tmp, sig.b2)) { + return false; + } + } else if (sig.type == SignalType::VOLKSWAGEN_COUNTER) { + if (!update_counter_generic(tmp, sig.b2)) { + return false; + } + } else if (sig.type == SignalType::PEDAL_COUNTER) { + if (!update_counter_generic(tmp, sig.b2)) { + return false; + } + } + } + + vals[i] = tmp * sig.factor + sig.offset; + all_vals[i].push_back(vals[i]); + } + seen = sec; + + return true; +} + + +bool MessageState::update_counter_generic(int64_t v, int cnt_size) { + uint8_t old_counter = counter; + counter = v; + if (((old_counter+1) & ((1 << cnt_size) -1)) != v) { + counter_fail += 1; + if (counter_fail > 1) { + INFO("0x%X COUNTER FAIL %d -- %d vs %d\n", address, counter_fail, old_counter, (int)v); + } + if (counter_fail >= MAX_BAD_COUNTER) { + return false; + } + } else if (counter_fail > 0) { + counter_fail--; + } + return true; +} + + +CANParser::CANParser(int abus, const std::string& dbc_name, + const std::vector &options, + const std::vector &sigoptions) + : bus(abus), aligned_buf(kj::heapArray(1024)) { + + dbc = dbc_lookup(dbc_name); + assert(dbc); + init_crc_lookup_tables(); + + for (const auto& op : options) { + MessageState &state = message_states[op.address]; + state.address = op.address; + // state.check_frequency = op.check_frequency, + + // msg is not valid if a message isn't received for 10 consecutive steps + if (op.check_frequency > 0) { + state.check_threshold = (1000000000ULL / op.check_frequency) * 10; + } + + const Msg* msg = NULL; + for (int i = 0; i < dbc->num_msgs; i++) { + if (dbc->msgs[i].address == op.address) { + msg = &dbc->msgs[i]; + break; + } + } + if (!msg) { + fprintf(stderr, "CANParser: could not find message 0x%X in DBC %s\n", op.address, dbc_name.c_str()); + assert(false); + } + + state.size = msg->size; + + // track checksums and counters for this message + for (int i = 0; i < msg->num_sigs; i++) { + const Signal *sig = &msg->sigs[i]; + if (sig->type != SignalType::DEFAULT) { + state.parse_sigs.push_back(*sig); + state.vals.push_back(0); + state.all_vals.push_back({}); + } + } + + // track requested signals for this message + for (const auto& sigop : sigoptions) { + if (sigop.address != op.address) continue; + + for (int i = 0; i < msg->num_sigs; i++) { + const Signal *sig = &msg->sigs[i]; + if (strcmp(sig->name, sigop.name) == 0 + && sig->type == SignalType::DEFAULT) { + state.parse_sigs.push_back(*sig); + state.vals.push_back(0); + state.all_vals.push_back({}); + break; + } + } + } + } +} + +CANParser::CANParser(int abus, const std::string& dbc_name, bool ignore_checksum, bool ignore_counter) + : bus(abus) { + // Add all messages and signals + + dbc = dbc_lookup(dbc_name); + assert(dbc); + init_crc_lookup_tables(); + + for (int i = 0; i < dbc->num_msgs; i++) { + const Msg* msg = &dbc->msgs[i]; + MessageState state = { + .address = msg->address, + .size = msg->size, + .ignore_checksum = ignore_checksum, + .ignore_counter = ignore_counter, + }; + + for (int j = 0; j < msg->num_sigs; j++) { + const Signal *sig = &msg->sigs[j]; + state.parse_sigs.push_back(*sig); + state.vals.push_back(0); + state.all_vals.push_back({}); + } + + message_states[state.address] = state; + } +} + +#ifndef DYNAMIC_CAPNP +void CANParser::update_string(const std::string &data, bool sendcan) { + // format for board, make copy due to alignment issues. + const size_t buf_size = (data.length() / sizeof(capnp::word)) + 1; + if (aligned_buf.size() < buf_size) { + aligned_buf = kj::heapArray(buf_size); + } + memcpy(aligned_buf.begin(), data.data(), data.length()); + + // extract the messages + capnp::FlatArrayMessageReader cmsg(aligned_buf.slice(0, buf_size)); + cereal::Event::Reader event = cmsg.getRoot(); + + last_sec = event.getLogMonoTime(); + + auto cans = sendcan ? event.getSendcan() : event.getCan(); + UpdateCans(last_sec, cans); + + UpdateValid(last_sec); +} + +void CANParser::UpdateCans(uint64_t sec, const capnp::List::Reader& cans) { + int msg_count = cans.size(); + + DEBUG("got %d messages\n", msg_count); + + for (int i = 0; i < msg_count; i++) { + auto cmsg = cans[i]; + // parse the messages + if (cmsg.getSrc() != bus) { + // DEBUG("skip %d: wrong bus\n", cmsg.getAddress()); + continue; + } + auto state_it = message_states.find(cmsg.getAddress()); + if (state_it == message_states.end()) { + // DEBUG("skip %d: not specified\n", cmsg.getAddress()); + continue; + } + + if (cmsg.getDat().size() > 8) continue; //shouldn't ever happen + uint8_t dat[8] = {0}; + memcpy(dat, cmsg.getDat().begin(), cmsg.getDat().size()); + + state_it->second.parse(sec, dat); + } +} +#endif + +void CANParser::UpdateCans(uint64_t sec, const capnp::DynamicStruct::Reader& cmsg) { + // assume message struct is `cereal::CanData` and parse + assert(cmsg.has("address") && cmsg.has("src") && cmsg.has("dat") && cmsg.has("busTime")); + + if (cmsg.get("src").as() != bus) { + DEBUG("skip %d: wrong bus\n", cmsg.get("address").as()); + return; + } + + auto state_it = message_states.find(cmsg.get("address").as()); + if (state_it == message_states.end()) { + DEBUG("skip %d: not specified\n", cmsg.get("address").as()); + return; + } + + auto dat = cmsg.get("dat").as(); + if (dat.size() > 8) return; //shouldn't ever happen + uint8_t data[8] = {0}; + memcpy(data, dat.begin(), dat.size()); + state_it->second.parse(sec, data); +} + +void CANParser::UpdateValid(uint64_t sec) { + can_valid = true; + for (const auto& kv : message_states) { + const auto& state = kv.second; + if (state.check_threshold > 0 && (sec - state.seen) > state.check_threshold) { + if (state.seen > 0) { + DEBUG("0x%X TIMEOUT\n", state.address); + } else { + DEBUG("0x%X MISSING\n", state.address); + } + can_valid = false; + } + } +} + +std::vector CANParser::query_latest() { + std::vector ret; + + for (auto& kv : message_states) { + auto& state = kv.second; + if (last_sec != 0 && state.seen != last_sec) continue; + + for (int i = 0; i < state.parse_sigs.size(); i++) { + const Signal &sig = state.parse_sigs[i]; + ret.push_back((SignalValue){ + .address = state.address, + .name = sig.name, + .value = state.vals[i], + .all_values = state.all_vals[i], + }); + state.all_vals[i].clear(); + } + } + + return ret; +} diff --git a/opendbc/can/parser.py b/opendbc/can/parser.py new file mode 100644 index 000000000..04722115c --- /dev/null +++ b/opendbc/can/parser.py @@ -0,0 +1,2 @@ +from opendbc.can.parser_pyx import CANParser, CANDefine # pylint: disable=no-name-in-module, import-error +assert CANParser, CANDefine diff --git a/opendbc/can/parser_pyx.cpp b/opendbc/can/parser_pyx.cpp new file mode 100644 index 000000000..30ae9baee --- /dev/null +++ b/opendbc/can/parser_pyx.cpp @@ -0,0 +1,11677 @@ +/* Generated by Cython 0.29.26 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "opendbc/can/common.h", + "opendbc/can/common_dbc.h" + ], + "include_dirs": [ + "./opendbc/can" + ], + "language": "c++", + "name": "opendbc.can.parser_pyx", + "sources": [ + "/data/openpilot/opendbc/can/parser_pyx.pyx" + ] + }, + "module_name": "opendbc.can.parser_pyx" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_26" +#define CYTHON_HEX_VERSION 0x001D1AF0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } + private: + T *ptr; +}; + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject* co=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(0))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too; + if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here + if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too; + Py_XDECREF((PyObject*)co); + co = (PyCodeObject*)call_result; + call_result = NULL; + if (0) { + cleanup_code_too: + Py_XDECREF((PyObject*)co); + co = NULL; + } + end: + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(call_result); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return co; + } +#else + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if defined(PyUnicode_IS_READY) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #else + #define __Pyx_PyUnicode_READY(op) (0) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__opendbc__can__parser_pyx +#define __PYX_HAVE_API__opendbc__can__parser_pyx +/* Early includes */ +#include +#include +#include "ios" +#include "new" +#include "stdexcept" +#include "typeinfo" +#include +#include + + #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600) + // move should be defined for these versions of MSVC, but __cplusplus isn't set usefully + #include + + namespace cython_std { + template typename std::remove_reference::type&& move(T& t) noexcept { return std::move(t); } + template typename std::remove_reference::type&& move(T&& t) noexcept { return std::move(t); } + } + + #endif + +#include +#include +#include +#include "common_dbc.h" +#include "common.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 1 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "ascii" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "opendbc/can/parser_pyx.pyx", + "stringsource", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser; +struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine; +struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__; +struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr; +struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr; + +/* "opendbc/can/parser_pyx.pyx":21 + * + * + * cdef class CANParser: # <<<<<<<<<<<<<< + * cdef: + * cpp_CANParser *can + */ +struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser { + PyObject_HEAD + struct __pyx_vtabstruct_7opendbc_3can_10parser_pyx_CANParser *__pyx_vtab; + CANParser *can; + struct DBC const *dbc; + std::map msg_name_to_address; + std::map address_to_msg_name; + std::vector can_values; + PyObject *vl; + PyObject *vl_all; + bool can_valid; + std::string dbc_name; + int can_invalid_cnt; +}; + + +/* "opendbc/can/parser_pyx.pyx":143 + * + * + * cdef class CANDefine(): # <<<<<<<<<<<<<< + * cdef: + * const DBC *dbc + */ +struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine { + PyObject_HEAD + struct DBC const *dbc; + PyObject *dv; + std::string dbc_name; +}; + + +/* "opendbc/can/parser_pyx.pyx":36 + * int can_invalid_cnt + * + * def __init__(self, dbc_name, signals, checks=None, bus=0, enforce_checks=True): # <<<<<<<<<<<<<< + * if checks is None: + * checks = [] + */ +struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ { + PyObject_HEAD + struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self; + PyObject *__pyx_v_signals; + PyObject *__pyx_v_unchecked; +}; + + +/* "opendbc/can/parser_pyx.pyx":83 + * unchecked = signal_addrs - checked_addrs + * if len(unchecked): + * err_msg = ', '.join(f"{self.address_to_msg_name[addr].decode()} ({hex(addr)})" for addr in unchecked) # <<<<<<<<<<<<<< + * raise RuntimeError(f"Unchecked addrs: {err_msg}") + * + */ +struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr { + PyObject_HEAD + struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *__pyx_outer_scope; + PyObject *__pyx_v_addr; +}; + + +/* "opendbc/can/parser_pyx.pyx":93 + * signal_options_v.push_back(spo) + * + * message_options = dict((address, 0) for _, address in signals) # <<<<<<<<<<<<<< + * message_options.update(dict(checks)) + * + */ +struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr { + PyObject_HEAD + struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *__pyx_outer_scope; + PyObject *__pyx_v__; + PyObject *__pyx_v_address; +}; + + + +/* "opendbc/can/parser_pyx.pyx":21 + * + * + * cdef class CANParser: # <<<<<<<<<<<<<< + * cdef: + * cpp_CANParser *can + */ + +struct __pyx_vtabstruct_7opendbc_3can_10parser_pyx_CANParser { + std::unordered_set (*update_vl)(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *); +}; +static struct __pyx_vtabstruct_7opendbc_3can_10parser_pyx_CANParser *__pyx_vtabptr_7opendbc_3can_10parser_pyx_CANParser; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* IncludeCppStringH.proto */ +#include + +/* decode_c_string_utf16.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 0; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = -1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} + +/* decode_c_bytes.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( + const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* decode_cpp_string.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_cpp_string( + std::string cppstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + return __Pyx_decode_c_bytes( + cppstring.data(), cppstring.size(), start, stop, encoding, errors, decode_func); +} + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if CYTHON_FAST_PYCALL + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif // CYTHON_FAST_PYCALL +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectFormatSimple.proto */ +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#elif PY_MAJOR_VERSION < 3 + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ + PyObject_Format(s, f)) +#elif CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_str(s) :\ + likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_str(s) :\ + PyObject_Format(s, f)) +#else + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#endif + +/* IncludeStringH.proto */ +#include + +/* JoinPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char); + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* decode_c_string.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) +#else +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#endif + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* SetItemInt.proto */ +#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ + __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) +static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck); + +/* PyUnicode_Unicode.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod1.proto */ +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* UnpackTupleError.proto */ +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); + +/* UnpackTuple2.proto */ +#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ + (likely(is_tuple || PyTuple_Check(tuple)) ?\ + (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ + __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ + (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ + __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( + PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); +static int __Pyx_unpack_tuple2_generic( + PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); + +/* dict_iter.proto */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* None.proto */ +#include + +/* GCCDiagnostics.proto */ +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CppExceptionConversion.proto */ +#ifndef __Pyx_CppExn2PyErr +#include +#include +#include +#include +static void __Pyx_CppExn2PyErr() { + try { + if (PyErr_Occurred()) + ; // let the latest Python exn pass through and ignore the current one + else + throw; + } catch (const std::bad_alloc& exn) { + PyErr_SetString(PyExc_MemoryError, exn.what()); + } catch (const std::bad_cast& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::bad_typeid& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::domain_error& exn) { + PyErr_SetString(PyExc_ValueError, exn.what()); + } catch (const std::invalid_argument& exn) { + PyErr_SetString(PyExc_ValueError, exn.what()); + } catch (const std::ios_base::failure& exn) { + PyErr_SetString(PyExc_IOError, exn.what()); + } catch (const std::out_of_range& exn) { + PyErr_SetString(PyExc_IndexError, exn.what()); + } catch (const std::overflow_error& exn) { + PyErr_SetString(PyExc_OverflowError, exn.what()); + } catch (const std::range_error& exn) { + PyErr_SetString(PyExc_ArithmeticError, exn.what()); + } catch (const std::underflow_error& exn) { + PyErr_SetString(PyExc_ArithmeticError, exn.what()); + } catch (const std::exception& exn) { + PyErr_SetString(PyExc_RuntimeError, exn.what()); + } + catch (...) + { + PyErr_SetString(PyExc_RuntimeError, "Unknown exception"); + } +} +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* CoroutineBase.proto */ +typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_ExcInfoStruct _PyErr_StackItem +#else +typedef struct { + PyObject *exc_type; + PyObject *exc_value; + PyObject *exc_traceback; +} __Pyx_ExcInfoStruct; +#endif +typedef struct { + PyObject_HEAD + __pyx_coroutine_body_t body; + PyObject *closure; + __Pyx_ExcInfoStruct gi_exc_state; + PyObject *gi_weakreflist; + PyObject *classobj; + PyObject *yieldfrom; + PyObject *gi_name; + PyObject *gi_qualname; + PyObject *gi_modulename; + PyObject *gi_code; + PyObject *gi_frame; + int resume_label; + char is_running; +} __pyx_CoroutineObject; +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); +static int __Pyx_Coroutine_clear(PyObject *self); +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); +static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_Coroutine_SwapException(self) +#define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) +#else +#define __Pyx_Coroutine_SwapException(self) {\ + __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ + __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ + } +#define __Pyx_Coroutine_ResetAndClearException(self) {\ + __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ + (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ + } +#endif +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) +#endif +static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); + +/* PatchModuleWithCoroutine.proto */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); + +/* PatchGeneratorABC.proto */ +static int __Pyx_patch_abc(void); + +/* Generator.proto */ +#define __Pyx_Generator_USED +static PyTypeObject *__pyx_GeneratorType = 0; +#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) +#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ + __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) +static PyObject *__Pyx_Generator_Next(PyObject *self); +static int __pyx_Generator_init(void); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static std::unordered_set __pyx_f_7opendbc_3can_10parser_pyx_9CANParser_update_vl(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self); /* proto*/ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libcpp.string' */ + +/* Module declarations from 'libcpp.vector' */ + +/* Module declarations from 'libcpp.utility' */ + +/* Module declarations from 'libcpp.unordered_set' */ + +/* Module declarations from 'libc.stdint' */ + +/* Module declarations from 'libcpp' */ + +/* Module declarations from 'libcpp.map' */ + +/* Module declarations from 'opendbc.can.common' */ + +/* Module declarations from 'opendbc.can.parser_pyx' */ +static PyTypeObject *__pyx_ptype_7opendbc_3can_10parser_pyx_CANParser = 0; +static PyTypeObject *__pyx_ptype_7opendbc_3can_10parser_pyx_CANDefine = 0; +static PyTypeObject *__pyx_ptype_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ = 0; +static PyTypeObject *__pyx_ptype_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr = 0; +static PyTypeObject *__pyx_ptype_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr = 0; +static int __pyx_v_7opendbc_3can_10parser_pyx_CAN_INVALID_CNT; +static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/ +static PyObject *__pyx_convert_vector_to_py_double(const std::vector &); /*proto*/ +static PyObject *__pyx_convert_unordered_set_to_py_uint32_t(std::unordered_set const &); /*proto*/ +#define __Pyx_MODULE_NAME "opendbc.can.parser_pyx" +extern int __pyx_module_is_main_opendbc__can__parser_pyx; +int __pyx_module_is_main_opendbc__can__parser_pyx = 0; + +/* Implementation of 'opendbc.can.parser_pyx' */ +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_hex; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_zip; +static const char __pyx_k_[] = " ("; +static const char __pyx_k__2[] = ")"; +static const char __pyx_k__3[] = ", "; +static const char __pyx_k__6[] = "'"; +static const char __pyx_k_os[] = "os"; +static const char __pyx_k_bus[] = "bus"; +static const char __pyx_k_dat[] = "dat"; +static const char __pyx_k_hex[] = "hex"; +static const char __pyx_k_zip[] = "zip"; +static const char __pyx_k_None[] = "None"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_send[] = "send"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_utf8[] = "utf8"; +static const char __pyx_k_clear[] = "clear"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_items[] = "items"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_split[] = "split"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_Number[] = "Number"; +static const char __pyx_k_checks[] = "checks"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_extend[] = "extend"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_values[] = "values"; +static const char __pyx_k_genexpr[] = "genexpr"; +static const char __pyx_k_numbers[] = "numbers"; +static const char __pyx_k_sendcan[] = "sendcan"; +static const char __pyx_k_signals[] = "signals"; +static const char __pyx_k_strings[] = "strings"; +static const char __pyx_k_dbc_name[] = "dbc_name"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_CANDefine[] = "CANDefine"; +static const char __pyx_k_CANParser[] = "CANParser"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_collections[] = "collections"; +static const char __pyx_k_defaultdict[] = "defaultdict"; +static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_Can_t_find_DBC[] = "Can't find DBC: "; +static const char __pyx_k_enforce_checks[] = "enforce_checks"; +static const char __pyx_k_Unchecked_addrs[] = "Unchecked addrs: "; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_Can_t_find_DBC_2[] = "Can't find DBC: '"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_init___locals_genexpr[] = "__init__..genexpr"; +static const char __pyx_k_opendbc_can_parser_pyx[] = "opendbc.can.parser_pyx"; +static const char __pyx_k_self_dbc_cannot_be_converted_to[] = "self.dbc cannot be converted to a Python object for pickling"; +static const char __pyx_k_self_can_self_dbc_cannot_be_conv[] = "self.can,self.dbc cannot be converted to a Python object for pickling"; +static PyObject *__pyx_kp_u_; +static PyObject *__pyx_n_s_CANDefine; +static PyObject *__pyx_n_s_CANParser; +static PyObject *__pyx_kp_u_Can_t_find_DBC; +static PyObject *__pyx_kp_u_Can_t_find_DBC_2; +static PyObject *__pyx_kp_u_None; +static PyObject *__pyx_n_s_Number; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_u_Unchecked_addrs; +static PyObject *__pyx_kp_u__2; +static PyObject *__pyx_kp_u__3; +static PyObject *__pyx_kp_u__6; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_bus; +static PyObject *__pyx_n_s_checks; +static PyObject *__pyx_n_s_clear; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_collections; +static PyObject *__pyx_n_s_dat; +static PyObject *__pyx_n_s_dbc_name; +static PyObject *__pyx_n_s_defaultdict; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_enforce_checks; +static PyObject *__pyx_n_s_extend; +static PyObject *__pyx_n_s_genexpr; +static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_n_s_hex; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init___locals_genexpr; +static PyObject *__pyx_n_s_items; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_numbers; +static PyObject *__pyx_n_s_opendbc_can_parser_pyx; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_reduce_ex; +static PyObject *__pyx_kp_s_self_can_self_dbc_cannot_be_conv; +static PyObject *__pyx_kp_s_self_dbc_cannot_be_converted_to; +static PyObject *__pyx_n_s_send; +static PyObject *__pyx_n_s_sendcan; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_signals; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_n_s_strings; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_n_u_utf8; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_zip; +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_8__init___genexpr(PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_8__init___3genexpr(PyObject *__pyx_self); /* proto */ +static int __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser___init__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self, PyObject *__pyx_v_dbc_name, PyObject *__pyx_v_signals, PyObject *__pyx_v_checks, PyObject *__pyx_v_bus, PyObject *__pyx_v_enforce_checks); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_2update_string(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self, PyObject *__pyx_v_dat, PyObject *__pyx_v_sendcan); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_4update_strings(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self, PyObject *__pyx_v_strings, PyObject *__pyx_v_sendcan); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_2vl___get__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_6vl_all___get__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_9can_valid___get__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_8dbc_name___get__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_15can_invalid_cnt___get__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine___init__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self, PyObject *__pyx_v_dbc_name); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_2dv___get__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self); /* proto */ +static int __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_2dv_2__set__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_2dv_4__del__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_8dbc_name___get__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self); /* proto */ +static int __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_8dbc_name_2__set__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_7opendbc_3can_10parser_pyx_CANParser(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7opendbc_3can_10parser_pyx_CANDefine(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_update = {0, &__pyx_n_s_update, 0, 0, 0}; +static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_update = {0, &__pyx_n_s_update, 0, 0, 0}; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_slice__7; +static PyObject *__pyx_slice__8; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +/* Late includes */ + +/* "opendbc/can/parser_pyx.pyx":36 + * int can_invalid_cnt + * + * def __init__(self, dbc_name, signals, checks=None, bus=0, enforce_checks=True): # <<<<<<<<<<<<<< + * if checks is None: + * checks = [] + */ + +/* Python wrapper */ +static int __pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dbc_name = 0; + PyObject *__pyx_v_signals = 0; + PyObject *__pyx_v_checks = 0; + PyObject *__pyx_v_bus = 0; + PyObject *__pyx_v_enforce_checks = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dbc_name,&__pyx_n_s_signals,&__pyx_n_s_checks,&__pyx_n_s_bus,&__pyx_n_s_enforce_checks,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[2] = ((PyObject *)Py_None); + values[3] = ((PyObject *)__pyx_int_0); + values[4] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dbc_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signals)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 36, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_checks); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bus); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enforce_checks); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 36, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dbc_name = values[0]; + __pyx_v_signals = values[1]; + __pyx_v_checks = values[2]; + __pyx_v_bus = values[3]; + __pyx_v_enforce_checks = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser___init__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)__pyx_v_self), __pyx_v_dbc_name, __pyx_v_signals, __pyx_v_checks, __pyx_v_bus, __pyx_v_enforce_checks); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_7opendbc_3can_10parser_pyx_9CANParser_8__init___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "opendbc/can/parser_pyx.pyx":83 + * unchecked = signal_addrs - checked_addrs + * if len(unchecked): + * err_msg = ', '.join(f"{self.address_to_msg_name[addr].decode()} ({hex(addr)})" for addr in unchecked) # <<<<<<<<<<<<<< + * raise RuntimeError(f"Unchecked addrs: {err_msg}") + * + */ + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_8__init___genexpr(PyObject *__pyx_self) { + struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr *)__pyx_tp_new_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr(__pyx_ptype_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 83, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *) __pyx_self; + __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7opendbc_3can_10parser_pyx_9CANParser_8__init___2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr, __pyx_n_s_opendbc_can_parser_pyx); if (unlikely(!gen)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANParser.__init__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_7opendbc_3can_10parser_pyx_9CANParser_8__init___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + Py_UCS4 __pyx_t_6; + uint32_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_unchecked)) { __Pyx_RaiseClosureNameError("unchecked"); __PYX_ERR(0, 83, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_unchecked)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_unchecked)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_unchecked; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_unchecked); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 83, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 83, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 83, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_addr); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_addr, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_6 = 127; + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 83, __pyx_L1_error) } + __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_cur_scope->__pyx_v_addr); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_8 = __Pyx_decode_cpp_string((__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->address_to_msg_name[__pyx_t_7]), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6; + __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __pyx_t_8 = 0; + __Pyx_INCREF(__pyx_kp_u_); + __pyx_t_5 += 2; + __Pyx_GIVEREF(__pyx_kp_u_); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_u_); + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_cur_scope->__pyx_v_addr); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_6; + __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_9); + __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_kp_u__2); + __pyx_t_5 += 1; + __Pyx_GIVEREF(__pyx_kp_u__2); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_kp_u__2); + __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_7opendbc_3can_10parser_pyx_9CANParser_8__init___5generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "opendbc/can/parser_pyx.pyx":93 + * signal_options_v.push_back(spo) + * + * message_options = dict((address, 0) for _, address in signals) # <<<<<<<<<<<<<< + * message_options.update(dict(checks)) + * + */ + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_8__init___3genexpr(PyObject *__pyx_self) { + struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr *)__pyx_tp_new_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr(__pyx_ptype_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 93, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *) __pyx_self; + __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7opendbc_3can_10parser_pyx_9CANParser_8__init___5generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr, __pyx_n_s_opendbc_can_parser_pyx); if (unlikely(!gen)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANParser.__init__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_7opendbc_3can_10parser_pyx_9CANParser_8__init___5generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_signals)) { __Pyx_RaiseClosureNameError("signals"); __PYX_ERR(0, 93, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_signals)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_signals)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_signals; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_signals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 93, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 93, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 93, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 93, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_L7_unpacking_done:; + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v__); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_address); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_address, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_address, (PyObject*)__pyx_int_0))) __PYX_ERR(0, 93, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/parser_pyx.pyx":36 + * int can_invalid_cnt + * + * def __init__(self, dbc_name, signals, checks=None, bus=0, enforce_checks=True): # <<<<<<<<<<<<<< + * if checks is None: + * checks = [] + */ + +static int __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser___init__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self, PyObject *__pyx_v_dbc_name, PyObject *__pyx_v_signals, PyObject *__pyx_v_checks, PyObject *__pyx_v_bus, PyObject *__pyx_v_enforce_checks) { + struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *__pyx_cur_scope; + int __pyx_v_i; + int __pyx_v_num_msgs; + struct Msg __pyx_v_msg; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_v_s = NULL; + PyObject *__pyx_v_c = NULL; + PyObject *__pyx_v_checked_addrs = NULL; + PyObject *__pyx_v_signal_addrs = NULL; + PyObject *__pyx_v_err_msg = NULL; + std::vector __pyx_v_signal_options_v; + struct SignalParseOptions __pyx_v_spo; + PyObject *__pyx_v_sig_name = NULL; + PyObject *__pyx_v_sig_address = NULL; + PyObject *__pyx_v_message_options = NULL; + std::vector __pyx_v_message_options_v; + struct MessageParseOptions __pyx_v_mpo; + PyObject *__pyx_v_msg_address = NULL; + PyObject *__pyx_v_freq = NULL; + PyObject *__pyx_7genexpr__pyx_v_c = NULL; + PyObject *__pyx_8genexpr1__pyx_v_s = NULL; + PyObject *__pyx_gb_7opendbc_3can_10parser_pyx_9CANParser_8__init___2generator = 0; + PyObject *__pyx_gb_7opendbc_3can_10parser_pyx_9CANParser_8__init___5generator1 = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + std::string __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + size_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + char const *__pyx_t_10; + uint32_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject *(*__pyx_t_15)(PyObject *); + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *(*__pyx_t_18)(PyObject *); + char const *__pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + __pyx_cur_scope = (struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *)__pyx_tp_new_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__(__pyx_ptype_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 36, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_self = __pyx_v_self; + __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); + __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); + __pyx_cur_scope->__pyx_v_signals = __pyx_v_signals; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_signals); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_signals); + __Pyx_INCREF(__pyx_v_checks); + + /* "opendbc/can/parser_pyx.pyx":37 + * + * def __init__(self, dbc_name, signals, checks=None, bus=0, enforce_checks=True): + * if checks is None: # <<<<<<<<<<<<<< + * checks = [] + * + */ + __pyx_t_1 = (__pyx_v_checks == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "opendbc/can/parser_pyx.pyx":38 + * def __init__(self, dbc_name, signals, checks=None, bus=0, enforce_checks=True): + * if checks is None: + * checks = [] # <<<<<<<<<<<<<< + * + * self.dbc_name = dbc_name + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_checks, __pyx_t_3); + __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":37 + * + * def __init__(self, dbc_name, signals, checks=None, bus=0, enforce_checks=True): + * if checks is None: # <<<<<<<<<<<<<< + * checks = [] + * + */ + } + + /* "opendbc/can/parser_pyx.pyx":40 + * checks = [] + * + * self.dbc_name = dbc_name # <<<<<<<<<<<<<< + * self.dbc = dbc_lookup(dbc_name) + * if not self.dbc: + */ + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_v_dbc_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_cur_scope->__pyx_v_self->dbc_name = __pyx_t_4; + + /* "opendbc/can/parser_pyx.pyx":41 + * + * self.dbc_name = dbc_name + * self.dbc = dbc_lookup(dbc_name) # <<<<<<<<<<<<<< + * if not self.dbc: + * raise RuntimeError(f"Can't find DBC: {dbc_name}") + */ + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_v_dbc_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_cur_scope->__pyx_v_self->dbc = dbc_lookup(__pyx_t_4); + + /* "opendbc/can/parser_pyx.pyx":42 + * self.dbc_name = dbc_name + * self.dbc = dbc_lookup(dbc_name) + * if not self.dbc: # <<<<<<<<<<<<<< + * raise RuntimeError(f"Can't find DBC: {dbc_name}") + * + */ + __pyx_t_2 = ((!(__pyx_cur_scope->__pyx_v_self->dbc != 0)) != 0); + if (unlikely(__pyx_t_2)) { + + /* "opendbc/can/parser_pyx.pyx":43 + * self.dbc = dbc_lookup(dbc_name) + * if not self.dbc: + * raise RuntimeError(f"Can't find DBC: {dbc_name}") # <<<<<<<<<<<<<< + * + * self.vl = {} + */ + __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_dbc_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Can_t_find_DBC, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 43, __pyx_L1_error) + + /* "opendbc/can/parser_pyx.pyx":42 + * self.dbc_name = dbc_name + * self.dbc = dbc_lookup(dbc_name) + * if not self.dbc: # <<<<<<<<<<<<<< + * raise RuntimeError(f"Can't find DBC: {dbc_name}") + * + */ + } + + /* "opendbc/can/parser_pyx.pyx":45 + * raise RuntimeError(f"Can't find DBC: {dbc_name}") + * + * self.vl = {} # <<<<<<<<<<<<<< + * self.vl_all = {} + * self.can_valid = False + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->vl); + __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->vl); + __pyx_cur_scope->__pyx_v_self->vl = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":46 + * + * self.vl = {} + * self.vl_all = {} # <<<<<<<<<<<<<< + * self.can_valid = False + * self.can_invalid_cnt = CAN_INVALID_CNT + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->vl_all); + __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->vl_all); + __pyx_cur_scope->__pyx_v_self->vl_all = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":47 + * self.vl = {} + * self.vl_all = {} + * self.can_valid = False # <<<<<<<<<<<<<< + * self.can_invalid_cnt = CAN_INVALID_CNT + * + */ + __pyx_cur_scope->__pyx_v_self->can_valid = 0; + + /* "opendbc/can/parser_pyx.pyx":48 + * self.vl_all = {} + * self.can_valid = False + * self.can_invalid_cnt = CAN_INVALID_CNT # <<<<<<<<<<<<<< + * + * cdef int i + */ + __pyx_cur_scope->__pyx_v_self->can_invalid_cnt = __pyx_v_7opendbc_3can_10parser_pyx_CAN_INVALID_CNT; + + /* "opendbc/can/parser_pyx.pyx":51 + * + * cdef int i + * cdef int num_msgs = self.dbc[0].num_msgs # <<<<<<<<<<<<<< + * for i in range(num_msgs): + * msg = self.dbc[0].msgs[i] + */ + __pyx_t_6 = (__pyx_cur_scope->__pyx_v_self->dbc[0]).num_msgs; + __pyx_v_num_msgs = __pyx_t_6; + + /* "opendbc/can/parser_pyx.pyx":52 + * cdef int i + * cdef int num_msgs = self.dbc[0].num_msgs + * for i in range(num_msgs): # <<<<<<<<<<<<<< + * msg = self.dbc[0].msgs[i] + * name = msg.name.decode('utf8') + */ + __pyx_t_7 = __pyx_v_num_msgs; + __pyx_t_8 = __pyx_t_7; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "opendbc/can/parser_pyx.pyx":53 + * cdef int num_msgs = self.dbc[0].num_msgs + * for i in range(num_msgs): + * msg = self.dbc[0].msgs[i] # <<<<<<<<<<<<<< + * name = msg.name.decode('utf8') + * + */ + __pyx_v_msg = ((__pyx_cur_scope->__pyx_v_self->dbc[0]).msgs[__pyx_v_i]); + + /* "opendbc/can/parser_pyx.pyx":54 + * for i in range(num_msgs): + * msg = self.dbc[0].msgs[i] + * name = msg.name.decode('utf8') # <<<<<<<<<<<<<< + * + * self.msg_name_to_address[name] = msg.address + */ + __pyx_t_10 = __pyx_v_msg.name; + __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_10, 0, strlen(__pyx_t_10), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":56 + * name = msg.name.decode('utf8') + * + * self.msg_name_to_address[name] = msg.address # <<<<<<<<<<<<<< + * self.address_to_msg_name[msg.address] = name + * self.vl[msg.address] = {} + */ + __pyx_t_11 = __pyx_v_msg.address; + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_v_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error) + (__pyx_cur_scope->__pyx_v_self->msg_name_to_address[__pyx_t_4]) = __pyx_t_11; + + /* "opendbc/can/parser_pyx.pyx":57 + * + * self.msg_name_to_address[name] = msg.address + * self.address_to_msg_name[msg.address] = name # <<<<<<<<<<<<<< + * self.vl[msg.address] = {} + * self.vl[name] = self.vl[msg.address] + */ + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_v_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) + (__pyx_cur_scope->__pyx_v_self->address_to_msg_name[__pyx_v_msg.address]) = __pyx_t_4; + + /* "opendbc/can/parser_pyx.pyx":58 + * self.msg_name_to_address[name] = msg.address + * self.address_to_msg_name[msg.address] = name + * self.vl[msg.address] = {} # <<<<<<<<<<<<<< + * self.vl[name] = self.vl[msg.address] + * self.vl_all[msg.address] = defaultdict(list) + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_cur_scope->__pyx_v_self->vl == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 58, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_msg.address); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_self->vl, __pyx_t_5, __pyx_t_3) < 0)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":59 + * self.address_to_msg_name[msg.address] = name + * self.vl[msg.address] = {} + * self.vl[name] = self.vl[msg.address] # <<<<<<<<<<<<<< + * self.vl_all[msg.address] = defaultdict(list) + * self.vl_all[name] = self.vl_all[msg.address] + */ + if (unlikely(__pyx_cur_scope->__pyx_v_self->vl == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 59, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_msg.address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_self->vl, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_cur_scope->__pyx_v_self->vl == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 59, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_self->vl, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "opendbc/can/parser_pyx.pyx":60 + * self.vl[msg.address] = {} + * self.vl[name] = self.vl[msg.address] + * self.vl_all[msg.address] = defaultdict(list) # <<<<<<<<<<<<<< + * self.vl_all[name] = self.vl_all[msg.address] + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_5 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_12, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)(&PyList_Type))); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_cur_scope->__pyx_v_self->vl_all == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 60, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_msg.address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_self->vl_all, __pyx_t_3, __pyx_t_5) < 0)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "opendbc/can/parser_pyx.pyx":61 + * self.vl[name] = self.vl[msg.address] + * self.vl_all[msg.address] = defaultdict(list) + * self.vl_all[name] = self.vl_all[msg.address] # <<<<<<<<<<<<<< + * + * # Convert message names into addresses + */ + if (unlikely(__pyx_cur_scope->__pyx_v_self->vl_all == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 61, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_msg.address); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_self->vl_all, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(__pyx_cur_scope->__pyx_v_self->vl_all == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 61, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_self->vl_all, __pyx_v_name, __pyx_t_3) < 0)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + + /* "opendbc/can/parser_pyx.pyx":64 + * + * # Convert message names into addresses + * for i in range(len(signals)): # <<<<<<<<<<<<<< + * s = signals[i] + * if not isinstance(s[1], numbers.Number): + */ + __pyx_t_3 = __pyx_cur_scope->__pyx_v_signals; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_13 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_14; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "opendbc/can/parser_pyx.pyx":65 + * # Convert message names into addresses + * for i in range(len(signals)): + * s = signals[i] # <<<<<<<<<<<<<< + * if not isinstance(s[1], numbers.Number): + * name = s[1].encode('utf8') + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_signals, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3); + __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":66 + * for i in range(len(signals)): + * s = signals[i] + * if not isinstance(s[1], numbers.Number): # <<<<<<<<<<<<<< + * name = s[1].encode('utf8') + * s = (s[0], self.msg_name_to_address[name]) + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_s, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numbers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Number); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = PyObject_IsInstance(__pyx_t_3, __pyx_t_12); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_1) { + + /* "opendbc/can/parser_pyx.pyx":67 + * s = signals[i] + * if not isinstance(s[1], numbers.Number): + * name = s[1].encode('utf8') # <<<<<<<<<<<<<< + * s = (s[0], self.msg_name_to_address[name]) + * signals[i] = s + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_s, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_12 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_n_u_utf8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_utf8); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_12); + __pyx_t_12 = 0; + + /* "opendbc/can/parser_pyx.pyx":68 + * if not isinstance(s[1], numbers.Number): + * name = s[1].encode('utf8') + * s = (s[0], self.msg_name_to_address[name]) # <<<<<<<<<<<<<< + * signals[i] = s + * + */ + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_s, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_v_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((__pyx_cur_scope->__pyx_v_self->msg_name_to_address[__pyx_t_4])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); + __pyx_t_12 = 0; + __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_3); + __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":69 + * name = s[1].encode('utf8') + * s = (s[0], self.msg_name_to_address[name]) + * signals[i] = s # <<<<<<<<<<<<<< + * + * for i in range(len(checks)): + */ + if (unlikely(__Pyx_SetItemInt(__pyx_cur_scope->__pyx_v_signals, __pyx_v_i, __pyx_v_s, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 69, __pyx_L1_error) + + /* "opendbc/can/parser_pyx.pyx":66 + * for i in range(len(signals)): + * s = signals[i] + * if not isinstance(s[1], numbers.Number): # <<<<<<<<<<<<<< + * name = s[1].encode('utf8') + * s = (s[0], self.msg_name_to_address[name]) + */ + } + } + + /* "opendbc/can/parser_pyx.pyx":71 + * signals[i] = s + * + * for i in range(len(checks)): # <<<<<<<<<<<<<< + * c = checks[i] + * if not isinstance(c[0], numbers.Number): + */ + __pyx_t_13 = PyObject_Length(__pyx_v_checks); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_14; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "opendbc/can/parser_pyx.pyx":72 + * + * for i in range(len(checks)): + * c = checks[i] # <<<<<<<<<<<<<< + * if not isinstance(c[0], numbers.Number): + * name = c[0].encode('utf8') + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_checks, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3); + __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":73 + * for i in range(len(checks)): + * c = checks[i] + * if not isinstance(c[0], numbers.Number): # <<<<<<<<<<<<<< + * name = c[0].encode('utf8') + * c = (self.msg_name_to_address[name], c[1]) + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numbers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Number); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = PyObject_IsInstance(__pyx_t_3, __pyx_t_12); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "opendbc/can/parser_pyx.pyx":74 + * c = checks[i] + * if not isinstance(c[0], numbers.Number): + * name = c[0].encode('utf8') # <<<<<<<<<<<<<< + * c = (self.msg_name_to_address[name], c[1]) + * checks[i] = c + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_12 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_n_u_utf8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_utf8); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_12); + __pyx_t_12 = 0; + + /* "opendbc/can/parser_pyx.pyx":75 + * if not isinstance(c[0], numbers.Number): + * name = c[0].encode('utf8') + * c = (self.msg_name_to_address[name], c[1]) # <<<<<<<<<<<<<< + * checks[i] = c + * + */ + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_v_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_From_uint32_t((__pyx_cur_scope->__pyx_v_self->msg_name_to_address[__pyx_t_4])); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); + __pyx_t_12 = 0; + __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_c, __pyx_t_3); + __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":76 + * name = c[0].encode('utf8') + * c = (self.msg_name_to_address[name], c[1]) + * checks[i] = c # <<<<<<<<<<<<<< + * + * if enforce_checks: + */ + if (unlikely(__Pyx_SetItemInt(__pyx_v_checks, __pyx_v_i, __pyx_v_c, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 76, __pyx_L1_error) + + /* "opendbc/can/parser_pyx.pyx":73 + * for i in range(len(checks)): + * c = checks[i] + * if not isinstance(c[0], numbers.Number): # <<<<<<<<<<<<<< + * name = c[0].encode('utf8') + * c = (self.msg_name_to_address[name], c[1]) + */ + } + } + + /* "opendbc/can/parser_pyx.pyx":78 + * checks[i] = c + * + * if enforce_checks: # <<<<<<<<<<<<<< + * checked_addrs = {c[0] for c in checks} + * signal_addrs = {s[1] for s in signals} + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_enforce_checks); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 78, __pyx_L1_error) + if (__pyx_t_2) { + + /* "opendbc/can/parser_pyx.pyx":79 + * + * if enforce_checks: + * checked_addrs = {c[0] for c in checks} # <<<<<<<<<<<<<< + * signal_addrs = {s[1] for s in signals} + * unchecked = signal_addrs - checked_addrs + */ + { /* enter inner scope */ + __pyx_t_3 = PySet_New(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(PyList_CheckExact(__pyx_v_checks)) || PyTuple_CheckExact(__pyx_v_checks)) { + __pyx_t_5 = __pyx_v_checks; __Pyx_INCREF(__pyx_t_5); __pyx_t_13 = 0; + __pyx_t_15 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_checks); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 79, __pyx_L16_error) + } + for (;;) { + if (likely(!__pyx_t_15)) { + if (likely(PyList_CheckExact(__pyx_t_5))) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_12); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 79, __pyx_L16_error) + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 79, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_12); + #endif + } else { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_12); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 79, __pyx_L16_error) + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 79, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_12); + #endif + } + } else { + __pyx_t_12 = __pyx_t_15(__pyx_t_5); + if (unlikely(!__pyx_t_12)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 79, __pyx_L16_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_12); + } + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_c, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_GetItemInt(__pyx_7genexpr__pyx_v_c, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 79, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_12); + if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 79, __pyx_L16_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_c); __pyx_7genexpr__pyx_v_c = 0; + goto __pyx_L19_exit_scope; + __pyx_L16_error:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_c); __pyx_7genexpr__pyx_v_c = 0; + goto __pyx_L1_error; + __pyx_L19_exit_scope:; + } /* exit inner scope */ + __pyx_v_checked_addrs = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":80 + * if enforce_checks: + * checked_addrs = {c[0] for c in checks} + * signal_addrs = {s[1] for s in signals} # <<<<<<<<<<<<<< + * unchecked = signal_addrs - checked_addrs + * if len(unchecked): + */ + { /* enter inner scope */ + __pyx_t_3 = PySet_New(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_signals)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_signals)) { + __pyx_t_5 = __pyx_cur_scope->__pyx_v_signals; __Pyx_INCREF(__pyx_t_5); __pyx_t_13 = 0; + __pyx_t_15 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_signals); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 80, __pyx_L22_error) + } + for (;;) { + if (likely(!__pyx_t_15)) { + if (likely(PyList_CheckExact(__pyx_t_5))) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_12); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 80, __pyx_L22_error) + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 80, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_12); + #endif + } else { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_12); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 80, __pyx_L22_error) + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 80, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_12); + #endif + } + } else { + __pyx_t_12 = __pyx_t_15(__pyx_t_5); + if (unlikely(!__pyx_t_12)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 80, __pyx_L22_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_12); + } + __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_s, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_GetItemInt(__pyx_8genexpr1__pyx_v_s, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 80, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_12); + if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 80, __pyx_L22_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s); __pyx_8genexpr1__pyx_v_s = 0; + goto __pyx_L25_exit_scope; + __pyx_L22_error:; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s); __pyx_8genexpr1__pyx_v_s = 0; + goto __pyx_L1_error; + __pyx_L25_exit_scope:; + } /* exit inner scope */ + __pyx_v_signal_addrs = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":81 + * checked_addrs = {c[0] for c in checks} + * signal_addrs = {s[1] for s in signals} + * unchecked = signal_addrs - checked_addrs # <<<<<<<<<<<<<< + * if len(unchecked): + * err_msg = ', '.join(f"{self.address_to_msg_name[addr].decode()} ({hex(addr)})" for addr in unchecked) + */ + __pyx_t_3 = PyNumber_Subtract(__pyx_v_signal_addrs, __pyx_v_checked_addrs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_unchecked = __pyx_t_3; + __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":82 + * signal_addrs = {s[1] for s in signals} + * unchecked = signal_addrs - checked_addrs + * if len(unchecked): # <<<<<<<<<<<<<< + * err_msg = ', '.join(f"{self.address_to_msg_name[addr].decode()} ({hex(addr)})" for addr in unchecked) + * raise RuntimeError(f"Unchecked addrs: {err_msg}") + */ + __pyx_t_3 = __pyx_cur_scope->__pyx_v_unchecked; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_13 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = (__pyx_t_13 != 0); + if (unlikely(__pyx_t_2)) { + + /* "opendbc/can/parser_pyx.pyx":83 + * unchecked = signal_addrs - checked_addrs + * if len(unchecked): + * err_msg = ', '.join(f"{self.address_to_msg_name[addr].decode()} ({hex(addr)})" for addr in unchecked) # <<<<<<<<<<<<<< + * raise RuntimeError(f"Unchecked addrs: {err_msg}") + * + */ + __pyx_t_3 = __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__3, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_err_msg = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":84 + * if len(unchecked): + * err_msg = ', '.join(f"{self.address_to_msg_name[addr].decode()} ({hex(addr)})" for addr in unchecked) + * raise RuntimeError(f"Unchecked addrs: {err_msg}") # <<<<<<<<<<<<<< + * + * cdef vector[SignalParseOptions] signal_options_v + */ + __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_err_msg); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unchecked_addrs, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 84, __pyx_L1_error) + + /* "opendbc/can/parser_pyx.pyx":82 + * signal_addrs = {s[1] for s in signals} + * unchecked = signal_addrs - checked_addrs + * if len(unchecked): # <<<<<<<<<<<<<< + * err_msg = ', '.join(f"{self.address_to_msg_name[addr].decode()} ({hex(addr)})" for addr in unchecked) + * raise RuntimeError(f"Unchecked addrs: {err_msg}") + */ + } + + /* "opendbc/can/parser_pyx.pyx":78 + * checks[i] = c + * + * if enforce_checks: # <<<<<<<<<<<<<< + * checked_addrs = {c[0] for c in checks} + * signal_addrs = {s[1] for s in signals} + */ + } + + /* "opendbc/can/parser_pyx.pyx":88 + * cdef vector[SignalParseOptions] signal_options_v + * cdef SignalParseOptions spo + * for sig_name, sig_address in signals: # <<<<<<<<<<<<<< + * spo.address = sig_address + * spo.name = sig_name + */ + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_signals)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_signals)) { + __pyx_t_3 = __pyx_cur_scope->__pyx_v_signals; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; + __pyx_t_15 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_signals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 88, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_15)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 88, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 88, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_15(__pyx_t_3); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 88, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 88, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_12 = PyList_GET_ITEM(sequence, 0); + __pyx_t_16 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(__pyx_t_16); + #else + __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_17 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_18 = Py_TYPE(__pyx_t_17)->tp_iternext; + index = 0; __pyx_t_12 = __pyx_t_18(__pyx_t_17); if (unlikely(!__pyx_t_12)) goto __pyx_L29_unpacking_failed; + __Pyx_GOTREF(__pyx_t_12); + index = 1; __pyx_t_16 = __pyx_t_18(__pyx_t_17); if (unlikely(!__pyx_t_16)) goto __pyx_L29_unpacking_failed; + __Pyx_GOTREF(__pyx_t_16); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_17), 2) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_18 = NULL; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + goto __pyx_L30_unpacking_done; + __pyx_L29_unpacking_failed:; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_18 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_L30_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_sig_name, __pyx_t_12); + __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_sig_address, __pyx_t_16); + __pyx_t_16 = 0; + + /* "opendbc/can/parser_pyx.pyx":89 + * cdef SignalParseOptions spo + * for sig_name, sig_address in signals: + * spo.address = sig_address # <<<<<<<<<<<<<< + * spo.name = sig_name + * signal_options_v.push_back(spo) + */ + __pyx_t_11 = __Pyx_PyInt_As_uint32_t(__pyx_v_sig_address); if (unlikely((__pyx_t_11 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_v_spo.address = __pyx_t_11; + + /* "opendbc/can/parser_pyx.pyx":90 + * for sig_name, sig_address in signals: + * spo.address = sig_address + * spo.name = sig_name # <<<<<<<<<<<<<< + * signal_options_v.push_back(spo) + * + */ + __pyx_t_19 = __Pyx_PyObject_AsString(__pyx_v_sig_name); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_v_spo.name = __pyx_t_19; + + /* "opendbc/can/parser_pyx.pyx":91 + * spo.address = sig_address + * spo.name = sig_name + * signal_options_v.push_back(spo) # <<<<<<<<<<<<<< + * + * message_options = dict((address, 0) for _, address in signals) + */ + try { + __pyx_v_signal_options_v.push_back(__pyx_v_spo); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 91, __pyx_L1_error) + } + + /* "opendbc/can/parser_pyx.pyx":88 + * cdef vector[SignalParseOptions] signal_options_v + * cdef SignalParseOptions spo + * for sig_name, sig_address in signals: # <<<<<<<<<<<<<< + * spo.address = sig_address + * spo.name = sig_name + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":93 + * signal_options_v.push_back(spo) + * + * message_options = dict((address, 0) for _, address in signals) # <<<<<<<<<<<<<< + * message_options.update(dict(checks)) + * + */ + __pyx_t_3 = __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_8__init___3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_message_options = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "opendbc/can/parser_pyx.pyx":94 + * + * message_options = dict((address, 0) for _, address in signals) + * message_options.update(dict(checks)) # <<<<<<<<<<<<<< + * + * cdef vector[MessageParseOptions] message_options_v + */ + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_checks); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_message_options, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":98 + * cdef vector[MessageParseOptions] message_options_v + * cdef MessageParseOptions mpo + * for msg_address, freq in message_options.items(): # <<<<<<<<<<<<<< + * mpo.address = msg_address + * mpo.check_frequency = freq + */ + __pyx_t_13 = 0; + if (unlikely(__pyx_v_message_options == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); + __PYX_ERR(0, 98, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_message_options, 1, __pyx_n_s_items, (&__pyx_t_14), (&__pyx_t_7)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_5; + __pyx_t_5 = 0; + while (1) { + __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_14, &__pyx_t_13, &__pyx_t_5, &__pyx_t_16, NULL, __pyx_t_7); + if (unlikely(__pyx_t_8 == 0)) break; + if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_16); + __Pyx_XDECREF_SET(__pyx_v_msg_address, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_freq, __pyx_t_16); + __pyx_t_16 = 0; + + /* "opendbc/can/parser_pyx.pyx":99 + * cdef MessageParseOptions mpo + * for msg_address, freq in message_options.items(): + * mpo.address = msg_address # <<<<<<<<<<<<<< + * mpo.check_frequency = freq + * message_options_v.push_back(mpo) + */ + __pyx_t_11 = __Pyx_PyInt_As_uint32_t(__pyx_v_msg_address); if (unlikely((__pyx_t_11 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_v_mpo.address = __pyx_t_11; + + /* "opendbc/can/parser_pyx.pyx":100 + * for msg_address, freq in message_options.items(): + * mpo.address = msg_address + * mpo.check_frequency = freq # <<<<<<<<<<<<<< + * message_options_v.push_back(mpo) + * + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_freq); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_v_mpo.check_frequency = __pyx_t_8; + + /* "opendbc/can/parser_pyx.pyx":101 + * mpo.address = msg_address + * mpo.check_frequency = freq + * message_options_v.push_back(mpo) # <<<<<<<<<<<<<< + * + * self.can = new cpp_CANParser(bus, dbc_name, message_options_v, signal_options_v) + */ + try { + __pyx_v_message_options_v.push_back(__pyx_v_mpo); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 101, __pyx_L1_error) + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":103 + * message_options_v.push_back(mpo) + * + * self.can = new cpp_CANParser(bus, dbc_name, message_options_v, signal_options_v) # <<<<<<<<<<<<<< + * self.update_vl() + * + */ + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_bus); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_v_dbc_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_cur_scope->__pyx_v_self->can = new CANParser(__pyx_t_7, __pyx_t_4, __pyx_v_message_options_v, __pyx_v_signal_options_v); + + /* "opendbc/can/parser_pyx.pyx":104 + * + * self.can = new cpp_CANParser(bus, dbc_name, message_options_v, signal_options_v) + * self.update_vl() # <<<<<<<<<<<<<< + * + * cdef unordered_set[uint32_t] update_vl(self): + */ + (void)(((struct __pyx_vtabstruct_7opendbc_3can_10parser_pyx_CANParser *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->update_vl(__pyx_cur_scope->__pyx_v_self)); + + /* "opendbc/can/parser_pyx.pyx":36 + * int can_invalid_cnt + * + * def __init__(self, dbc_name, signals, checks=None, bus=0, enforce_checks=True): # <<<<<<<<<<<<<< + * if checks is None: + * checks = [] + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XDECREF(__pyx_v_c); + __Pyx_XDECREF(__pyx_v_checked_addrs); + __Pyx_XDECREF(__pyx_v_signal_addrs); + __Pyx_XDECREF(__pyx_v_err_msg); + __Pyx_XDECREF(__pyx_v_sig_name); + __Pyx_XDECREF(__pyx_v_sig_address); + __Pyx_XDECREF(__pyx_v_message_options); + __Pyx_XDECREF(__pyx_v_msg_address); + __Pyx_XDECREF(__pyx_v_freq); + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_c); + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s); + __Pyx_XDECREF(__pyx_gb_7opendbc_3can_10parser_pyx_9CANParser_8__init___2generator); + __Pyx_XDECREF(__pyx_gb_7opendbc_3can_10parser_pyx_9CANParser_8__init___5generator1); + __Pyx_XDECREF(__pyx_v_checks); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/parser_pyx.pyx":106 + * self.update_vl() + * + * cdef unordered_set[uint32_t] update_vl(self): # <<<<<<<<<<<<<< + * cdef unordered_set[uint32_t] updated_addrs + * + */ + +static std::unordered_set __pyx_f_7opendbc_3can_10parser_pyx_9CANParser_update_vl(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self) { + std::unordered_set __pyx_v_updated_addrs; + std::vector __pyx_v_new_vals; + struct SignalValue __pyx_v_cv; + PyObject *__pyx_v_cv_name = NULL; + std::unordered_set __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + std::vector ::iterator __pyx_t_2; + struct SignalValue __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("update_vl", 0); + + /* "opendbc/can/parser_pyx.pyx":110 + * + * # Update invalid flag + * self.can_invalid_cnt += 1 # <<<<<<<<<<<<<< + * if self.can.can_valid: + * self.can_invalid_cnt = 0 + */ + __pyx_v_self->can_invalid_cnt = (__pyx_v_self->can_invalid_cnt + 1); + + /* "opendbc/can/parser_pyx.pyx":111 + * # Update invalid flag + * self.can_invalid_cnt += 1 + * if self.can.can_valid: # <<<<<<<<<<<<<< + * self.can_invalid_cnt = 0 + * self.can_valid = self.can_invalid_cnt < CAN_INVALID_CNT + */ + __pyx_t_1 = (__pyx_v_self->can->can_valid != 0); + if (__pyx_t_1) { + + /* "opendbc/can/parser_pyx.pyx":112 + * self.can_invalid_cnt += 1 + * if self.can.can_valid: + * self.can_invalid_cnt = 0 # <<<<<<<<<<<<<< + * self.can_valid = self.can_invalid_cnt < CAN_INVALID_CNT + * + */ + __pyx_v_self->can_invalid_cnt = 0; + + /* "opendbc/can/parser_pyx.pyx":111 + * # Update invalid flag + * self.can_invalid_cnt += 1 + * if self.can.can_valid: # <<<<<<<<<<<<<< + * self.can_invalid_cnt = 0 + * self.can_valid = self.can_invalid_cnt < CAN_INVALID_CNT + */ + } + + /* "opendbc/can/parser_pyx.pyx":113 + * if self.can.can_valid: + * self.can_invalid_cnt = 0 + * self.can_valid = self.can_invalid_cnt < CAN_INVALID_CNT # <<<<<<<<<<<<<< + * + * new_vals = self.can.query_latest() + */ + __pyx_v_self->can_valid = (__pyx_v_self->can_invalid_cnt < __pyx_v_7opendbc_3can_10parser_pyx_CAN_INVALID_CNT); + + /* "opendbc/can/parser_pyx.pyx":115 + * self.can_valid = self.can_invalid_cnt < CAN_INVALID_CNT + * + * new_vals = self.can.query_latest() # <<<<<<<<<<<<<< + * for cv in new_vals: + * # Cast char * directly to unicode + */ + __pyx_v_new_vals = __pyx_v_self->can->query_latest(); + + /* "opendbc/can/parser_pyx.pyx":116 + * + * new_vals = self.can.query_latest() + * for cv in new_vals: # <<<<<<<<<<<<<< + * # Cast char * directly to unicode + * cv_name = cv.name + */ + __pyx_t_2 = __pyx_v_new_vals.begin(); + for (;;) { + if (!(__pyx_t_2 != __pyx_v_new_vals.end())) break; + __pyx_t_3 = *__pyx_t_2; + ++__pyx_t_2; + __pyx_v_cv = __pyx_t_3; + + /* "opendbc/can/parser_pyx.pyx":118 + * for cv in new_vals: + * # Cast char * directly to unicode + * cv_name = cv.name # <<<<<<<<<<<<<< + * self.vl[cv.address][cv_name] = cv.value + * self.vl_all[cv.address][cv_name].extend(cv.all_values) + */ + __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_cv.name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __pyx_t_4; + __Pyx_INCREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_cv_name, ((PyObject*)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "opendbc/can/parser_pyx.pyx":119 + * # Cast char * directly to unicode + * cv_name = cv.name + * self.vl[cv.address][cv_name] = cv.value # <<<<<<<<<<<<<< + * self.vl_all[cv.address][cv_name].extend(cv.all_values) + * updated_addrs.insert(cv.address) + */ + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_cv.value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__pyx_v_self->vl == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 119, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_cv.address); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->vl, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_cv_name, __pyx_t_5) < 0)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "opendbc/can/parser_pyx.pyx":120 + * cv_name = cv.name + * self.vl[cv.address][cv_name] = cv.value + * self.vl_all[cv.address][cv_name].extend(cv.all_values) # <<<<<<<<<<<<<< + * updated_addrs.insert(cv.address) + * + */ + if (unlikely(__pyx_v_self->vl_all == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 120, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_cv.address); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->vl_all, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_v_cv_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_extend); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_convert_vector_to_py_double(__pyx_v_cv.all_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "opendbc/can/parser_pyx.pyx":121 + * self.vl[cv.address][cv_name] = cv.value + * self.vl_all[cv.address][cv_name].extend(cv.all_values) + * updated_addrs.insert(cv.address) # <<<<<<<<<<<<<< + * + * return updated_addrs + */ + (void)(__pyx_v_updated_addrs.insert(__pyx_v_cv.address)); + + /* "opendbc/can/parser_pyx.pyx":116 + * + * new_vals = self.can.query_latest() + * for cv in new_vals: # <<<<<<<<<<<<<< + * # Cast char * directly to unicode + * cv_name = cv.name + */ + } + + /* "opendbc/can/parser_pyx.pyx":123 + * updated_addrs.insert(cv.address) + * + * return updated_addrs # <<<<<<<<<<<<<< + * + * def update_string(self, dat, sendcan=False): + */ + __pyx_r = __pyx_v_updated_addrs; + goto __pyx_L0; + + /* "opendbc/can/parser_pyx.pyx":106 + * self.update_vl() + * + * cdef unordered_set[uint32_t] update_vl(self): # <<<<<<<<<<<<<< + * cdef unordered_set[uint32_t] updated_addrs + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_WriteUnraisable("opendbc.can.parser_pyx.CANParser.update_vl", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cv_name); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/parser_pyx.pyx":125 + * return updated_addrs + * + * def update_string(self, dat, sendcan=False): # <<<<<<<<<<<<<< + * for v in self.vl_all.values(): + * v.clear() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_3update_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_3update_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dat = 0; + PyObject *__pyx_v_sendcan = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("update_string (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dat,&__pyx_n_s_sendcan,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dat)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sendcan); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update_string") < 0)) __PYX_ERR(0, 125, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dat = values[0]; + __pyx_v_sendcan = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("update_string", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 125, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANParser.update_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_2update_string(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)__pyx_v_self), __pyx_v_dat, __pyx_v_sendcan); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_2update_string(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self, PyObject *__pyx_v_dat, PyObject *__pyx_v_sendcan) { + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + std::string __pyx_t_9; + bool __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("update_string", 0); + + /* "opendbc/can/parser_pyx.pyx":126 + * + * def update_string(self, dat, sendcan=False): + * for v in self.vl_all.values(): # <<<<<<<<<<<<<< + * v.clear() + * + */ + __pyx_t_2 = 0; + if (unlikely(__pyx_v_self->vl_all == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); + __PYX_ERR(0, 126, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->vl_all, 1, __pyx_n_s_values, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + while (1) { + __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, NULL, &__pyx_t_5, NULL, __pyx_t_4); + if (unlikely(__pyx_t_6 == 0)) break; + if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); + __pyx_t_5 = 0; + + /* "opendbc/can/parser_pyx.pyx":127 + * def update_string(self, dat, sendcan=False): + * for v in self.vl_all.values(): + * v.clear() # <<<<<<<<<<<<<< + * + * self.can.update_string(dat, sendcan) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_clear); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "opendbc/can/parser_pyx.pyx":129 + * v.clear() + * + * self.can.update_string(dat, sendcan) # <<<<<<<<<<<<<< + * return self.update_vl() + * + */ + __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_v_dat); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_sendcan); if (unlikely((__pyx_t_10 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_v_self->can->update_string(__pyx_t_9, __pyx_t_10); + + /* "opendbc/can/parser_pyx.pyx":130 + * + * self.can.update_string(dat, sendcan) + * return self.update_vl() # <<<<<<<<<<<<<< + * + * def update_strings(self, strings, sendcan=False): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_convert_unordered_set_to_py_uint32_t(((struct __pyx_vtabstruct_7opendbc_3can_10parser_pyx_CANParser *)__pyx_v_self->__pyx_vtab)->update_vl(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "opendbc/can/parser_pyx.pyx":125 + * return updated_addrs + * + * def update_string(self, dat, sendcan=False): # <<<<<<<<<<<<<< + * for v in self.vl_all.values(): + * v.clear() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANParser.update_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/parser_pyx.pyx":132 + * return self.update_vl() + * + * def update_strings(self, strings, sendcan=False): # <<<<<<<<<<<<<< + * for v in self.vl_all.values(): + * v.clear() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_5update_strings(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_5update_strings(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_strings = 0; + PyObject *__pyx_v_sendcan = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("update_strings (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_strings,&__pyx_n_s_sendcan,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strings)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sendcan); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update_strings") < 0)) __PYX_ERR(0, 132, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_strings = values[0]; + __pyx_v_sendcan = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("update_strings", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 132, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANParser.update_strings", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_4update_strings(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)__pyx_v_self), __pyx_v_strings, __pyx_v_sendcan); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_4update_strings(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self, PyObject *__pyx_v_strings, PyObject *__pyx_v_sendcan) { + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_v_updated_addrs = NULL; + PyObject *__pyx_v_s = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + std::string __pyx_t_10; + bool __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("update_strings", 0); + + /* "opendbc/can/parser_pyx.pyx":133 + * + * def update_strings(self, strings, sendcan=False): + * for v in self.vl_all.values(): # <<<<<<<<<<<<<< + * v.clear() + * + */ + __pyx_t_2 = 0; + if (unlikely(__pyx_v_self->vl_all == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); + __PYX_ERR(0, 133, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->vl_all, 1, __pyx_n_s_values, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + while (1) { + __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, NULL, &__pyx_t_5, NULL, __pyx_t_4); + if (unlikely(__pyx_t_6 == 0)) break; + if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); + __pyx_t_5 = 0; + + /* "opendbc/can/parser_pyx.pyx":134 + * def update_strings(self, strings, sendcan=False): + * for v in self.vl_all.values(): + * v.clear() # <<<<<<<<<<<<<< + * + * updated_addrs = set() + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_clear); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "opendbc/can/parser_pyx.pyx":136 + * v.clear() + * + * updated_addrs = set() # <<<<<<<<<<<<<< + * for s in strings: + * self.can.update_string(s, sendcan) + */ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_updated_addrs = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "opendbc/can/parser_pyx.pyx":137 + * + * updated_addrs = set() + * for s in strings: # <<<<<<<<<<<<<< + * self.can.update_string(s, sendcan) + * updated_addrs.update(self.update_vl()) + */ + if (likely(PyList_CheckExact(__pyx_v_strings)) || PyTuple_CheckExact(__pyx_v_strings)) { + __pyx_t_1 = __pyx_v_strings; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_strings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 137, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 137, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 137, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_9(__pyx_t_1); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 137, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_5); + __pyx_t_5 = 0; + + /* "opendbc/can/parser_pyx.pyx":138 + * updated_addrs = set() + * for s in strings: + * self.can.update_string(s, sendcan) # <<<<<<<<<<<<<< + * updated_addrs.update(self.update_vl()) + * return updated_addrs + */ + __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_v_s); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_sendcan); if (unlikely((__pyx_t_11 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_v_self->can->update_string(__pyx_t_10, __pyx_t_11); + + /* "opendbc/can/parser_pyx.pyx":139 + * for s in strings: + * self.can.update_string(s, sendcan) + * updated_addrs.update(self.update_vl()) # <<<<<<<<<<<<<< + * return updated_addrs + * + */ + __pyx_t_5 = __pyx_convert_unordered_set_to_py_uint32_t(((struct __pyx_vtabstruct_7opendbc_3can_10parser_pyx_CANParser *)__pyx_v_self->__pyx_vtab)->update_vl(__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_updated_addrs, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "opendbc/can/parser_pyx.pyx":137 + * + * updated_addrs = set() + * for s in strings: # <<<<<<<<<<<<<< + * self.can.update_string(s, sendcan) + * updated_addrs.update(self.update_vl()) + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "opendbc/can/parser_pyx.pyx":140 + * self.can.update_string(s, sendcan) + * updated_addrs.update(self.update_vl()) + * return updated_addrs # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_updated_addrs); + __pyx_r = __pyx_v_updated_addrs; + goto __pyx_L0; + + /* "opendbc/can/parser_pyx.pyx":132 + * return self.update_vl() + * + * def update_strings(self, strings, sendcan=False): # <<<<<<<<<<<<<< + * for v in self.vl_all.values(): + * v.clear() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANParser.update_strings", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF(__pyx_v_updated_addrs); + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/parser_pyx.pyx":30 + * + * cdef readonly: + * dict vl # <<<<<<<<<<<<<< + * dict vl_all + * bool can_valid + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_2vl_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_2vl_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_2vl___get__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_2vl___get__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->vl); + __pyx_r = __pyx_v_self->vl; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/parser_pyx.pyx":31 + * cdef readonly: + * dict vl + * dict vl_all # <<<<<<<<<<<<<< + * bool can_valid + * string dbc_name + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_6vl_all_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_6vl_all_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_6vl_all___get__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_6vl_all___get__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->vl_all); + __pyx_r = __pyx_v_self->vl_all; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/parser_pyx.pyx":32 + * dict vl + * dict vl_all + * bool can_valid # <<<<<<<<<<<<<< + * string dbc_name + * int can_invalid_cnt + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_9can_valid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_9can_valid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_9can_valid___get__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_9can_valid___get__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->can_valid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANParser.can_valid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/parser_pyx.pyx":33 + * dict vl_all + * bool can_valid + * string dbc_name # <<<<<<<<<<<<<< + * int can_invalid_cnt + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_8dbc_name_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_8dbc_name_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_8dbc_name___get__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_8dbc_name___get__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->dbc_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANParser.dbc_name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/parser_pyx.pyx":34 + * bool can_valid + * string dbc_name + * int can_invalid_cnt # <<<<<<<<<<<<<< + * + * def __init__(self, dbc_name, signals, checks=None, bus=0, enforce_checks=True): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_15can_invalid_cnt_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_15can_invalid_cnt_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_15can_invalid_cnt___get__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_15can_invalid_cnt___get__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->can_invalid_cnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANParser.can_invalid_cnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.can,self.dbc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_6__reduce_cython__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.can,self.dbc cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.can,self.dbc cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.can,self.dbc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANParser.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.can,self.dbc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.can,self.dbc cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_8__setstate_cython__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANParser_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("self.can,self.dbc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.can,self.dbc cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.can,self.dbc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.can,self.dbc cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANParser.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/parser_pyx.pyx":151 + * string dbc_name + * + * def __init__(self, dbc_name): # <<<<<<<<<<<<<< + * self.dbc_name = dbc_name + * self.dbc = dbc_lookup(dbc_name) + */ + +/* Python wrapper */ +static int __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dbc_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dbc_name,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dbc_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 151, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_dbc_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 151, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANDefine.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine___init__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *)__pyx_v_self), __pyx_v_dbc_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine___init__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self, PyObject *__pyx_v_dbc_name) { + size_t __pyx_v_num_vals; + PyObject *__pyx_v_address_to_msg_name = NULL; + size_t __pyx_v_num_msgs; + size_t __pyx_v_i; + struct Msg __pyx_v_msg; + PyObject *__pyx_v_name = NULL; + uint32_t __pyx_v_address; + PyObject *__pyx_v_dv = NULL; + struct Val __pyx_v_val; + PyObject *__pyx_v_sgname = NULL; + PyObject *__pyx_v_def_val = NULL; + PyObject *__pyx_v_msgname = NULL; + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_defs = NULL; + PyObject *__pyx_8genexpr4__pyx_v_v = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + std::string __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_UCS4 __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + size_t __pyx_t_7; + size_t __pyx_t_8; + size_t __pyx_t_9; + char const *__pyx_t_10; + uint32_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + char const *__pyx_t_13; + char const *__pyx_t_14; + PyObject *(*__pyx_t_15)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "opendbc/can/parser_pyx.pyx":152 + * + * def __init__(self, dbc_name): + * self.dbc_name = dbc_name # <<<<<<<<<<<<<< + * self.dbc = dbc_lookup(dbc_name) + * if not self.dbc: + */ + __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_dbc_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_v_self->dbc_name = __pyx_t_1; + + /* "opendbc/can/parser_pyx.pyx":153 + * def __init__(self, dbc_name): + * self.dbc_name = dbc_name + * self.dbc = dbc_lookup(dbc_name) # <<<<<<<<<<<<<< + * if not self.dbc: + * raise RuntimeError(f"Can't find DBC: '{dbc_name}'") + */ + __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_dbc_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_v_self->dbc = dbc_lookup(__pyx_t_1); + + /* "opendbc/can/parser_pyx.pyx":154 + * self.dbc_name = dbc_name + * self.dbc = dbc_lookup(dbc_name) + * if not self.dbc: # <<<<<<<<<<<<<< + * raise RuntimeError(f"Can't find DBC: '{dbc_name}'") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->dbc != 0)) != 0); + if (unlikely(__pyx_t_2)) { + + /* "opendbc/can/parser_pyx.pyx":155 + * self.dbc = dbc_lookup(dbc_name) + * if not self.dbc: + * raise RuntimeError(f"Can't find DBC: '{dbc_name}'") # <<<<<<<<<<<<<< + * + * num_vals = self.dbc[0].num_vals + */ + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = 127; + __Pyx_INCREF(__pyx_kp_u_Can_t_find_DBC_2); + __pyx_t_4 += 17; + __Pyx_GIVEREF(__pyx_kp_u_Can_t_find_DBC_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Can_t_find_DBC_2); + __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_dbc_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5; + __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_kp_u__6); + __pyx_t_4 += 1; + __Pyx_GIVEREF(__pyx_kp_u__6); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__6); + __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 155, __pyx_L1_error) + + /* "opendbc/can/parser_pyx.pyx":154 + * self.dbc_name = dbc_name + * self.dbc = dbc_lookup(dbc_name) + * if not self.dbc: # <<<<<<<<<<<<<< + * raise RuntimeError(f"Can't find DBC: '{dbc_name}'") + * + */ + } + + /* "opendbc/can/parser_pyx.pyx":157 + * raise RuntimeError(f"Can't find DBC: '{dbc_name}'") + * + * num_vals = self.dbc[0].num_vals # <<<<<<<<<<<<<< + * + * address_to_msg_name = {} + */ + __pyx_t_7 = (__pyx_v_self->dbc[0]).num_vals; + __pyx_v_num_vals = __pyx_t_7; + + /* "opendbc/can/parser_pyx.pyx":159 + * num_vals = self.dbc[0].num_vals + * + * address_to_msg_name = {} # <<<<<<<<<<<<<< + * + * num_msgs = self.dbc[0].num_msgs + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_address_to_msg_name = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":161 + * address_to_msg_name = {} + * + * num_msgs = self.dbc[0].num_msgs # <<<<<<<<<<<<<< + * for i in range(num_msgs): + * msg = self.dbc[0].msgs[i] + */ + __pyx_t_7 = (__pyx_v_self->dbc[0]).num_msgs; + __pyx_v_num_msgs = __pyx_t_7; + + /* "opendbc/can/parser_pyx.pyx":162 + * + * num_msgs = self.dbc[0].num_msgs + * for i in range(num_msgs): # <<<<<<<<<<<<<< + * msg = self.dbc[0].msgs[i] + * name = msg.name.decode('utf8') + */ + __pyx_t_7 = __pyx_v_num_msgs; + __pyx_t_8 = __pyx_t_7; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "opendbc/can/parser_pyx.pyx":163 + * num_msgs = self.dbc[0].num_msgs + * for i in range(num_msgs): + * msg = self.dbc[0].msgs[i] # <<<<<<<<<<<<<< + * name = msg.name.decode('utf8') + * address = msg.address + */ + __pyx_v_msg = ((__pyx_v_self->dbc[0]).msgs[__pyx_v_i]); + + /* "opendbc/can/parser_pyx.pyx":164 + * for i in range(num_msgs): + * msg = self.dbc[0].msgs[i] + * name = msg.name.decode('utf8') # <<<<<<<<<<<<<< + * address = msg.address + * address_to_msg_name[address] = name + */ + __pyx_t_10 = __pyx_v_msg.name; + __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_10, 0, strlen(__pyx_t_10), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":165 + * msg = self.dbc[0].msgs[i] + * name = msg.name.decode('utf8') + * address = msg.address # <<<<<<<<<<<<<< + * address_to_msg_name[address] = name + * + */ + __pyx_t_11 = __pyx_v_msg.address; + __pyx_v_address = __pyx_t_11; + + /* "opendbc/can/parser_pyx.pyx":166 + * name = msg.name.decode('utf8') + * address = msg.address + * address_to_msg_name[address] = name # <<<<<<<<<<<<<< + * + * dv = defaultdict(dict) + */ + __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyDict_SetItem(__pyx_v_address_to_msg_name, __pyx_t_3, __pyx_v_name) < 0)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + + /* "opendbc/can/parser_pyx.pyx":168 + * address_to_msg_name[address] = name + * + * dv = defaultdict(dict) # <<<<<<<<<<<<<< + * + * for i in range(num_vals): + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_12 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_3 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_12, ((PyObject *)(&PyDict_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)(&PyDict_Type))); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_dv = __pyx_t_3; + __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":170 + * dv = defaultdict(dict) + * + * for i in range(num_vals): # <<<<<<<<<<<<<< + * val = self.dbc[0].vals[i] + * + */ + __pyx_t_7 = __pyx_v_num_vals; + __pyx_t_8 = __pyx_t_7; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "opendbc/can/parser_pyx.pyx":171 + * + * for i in range(num_vals): + * val = self.dbc[0].vals[i] # <<<<<<<<<<<<<< + * + * sgname = val.name.decode('utf8') + */ + __pyx_v_val = ((__pyx_v_self->dbc[0]).vals[__pyx_v_i]); + + /* "opendbc/can/parser_pyx.pyx":173 + * val = self.dbc[0].vals[i] + * + * sgname = val.name.decode('utf8') # <<<<<<<<<<<<<< + * def_val = val.def_val.decode('utf8') + * address = val.address + */ + __pyx_t_13 = __pyx_v_val.name; + __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_13, 0, strlen(__pyx_t_13), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_sgname, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":174 + * + * sgname = val.name.decode('utf8') + * def_val = val.def_val.decode('utf8') # <<<<<<<<<<<<<< + * address = val.address + * msgname = address_to_msg_name[address] + */ + __pyx_t_14 = __pyx_v_val.def_val; + __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_14, 0, strlen(__pyx_t_14), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_def_val, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "opendbc/can/parser_pyx.pyx":175 + * sgname = val.name.decode('utf8') + * def_val = val.def_val.decode('utf8') + * address = val.address # <<<<<<<<<<<<<< + * msgname = address_to_msg_name[address] + * + */ + __pyx_t_11 = __pyx_v_val.address; + __pyx_v_address = __pyx_t_11; + + /* "opendbc/can/parser_pyx.pyx":176 + * def_val = val.def_val.decode('utf8') + * address = val.address + * msgname = address_to_msg_name[address] # <<<<<<<<<<<<<< + * + * # separate definition/value pairs + */ + __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_address_to_msg_name, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_msgname, __pyx_t_6); + __pyx_t_6 = 0; + + /* "opendbc/can/parser_pyx.pyx":179 + * + * # separate definition/value pairs + * def_val = def_val.split() # <<<<<<<<<<<<<< + * values = [int(v) for v in def_val[::2]] + * defs = def_val[1::2] + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_def_val, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_6 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_def_val, __pyx_t_6); + __pyx_t_6 = 0; + + /* "opendbc/can/parser_pyx.pyx":180 + * # separate definition/value pairs + * def_val = def_val.split() + * values = [int(v) for v in def_val[::2]] # <<<<<<<<<<<<<< + * defs = def_val[1::2] + * + */ + { /* enter inner scope */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_def_val, __pyx_slice__7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_12 = __pyx_t_3; __Pyx_INCREF(__pyx_t_12); __pyx_t_4 = 0; + __pyx_t_15 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 180, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_15 = Py_TYPE(__pyx_t_12)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 180, __pyx_L10_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_15)) { + if (likely(PyList_CheckExact(__pyx_t_12))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_12)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 180, __pyx_L10_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_12, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_12)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 180, __pyx_L10_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_12, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_15(__pyx_t_12); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 180, __pyx_L10_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_v, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_8genexpr4__pyx_v_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 180, __pyx_L10_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_v); __pyx_8genexpr4__pyx_v_v = 0; + goto __pyx_L13_exit_scope; + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_v); __pyx_8genexpr4__pyx_v_v = 0; + goto __pyx_L1_error; + __pyx_L13_exit_scope:; + } /* exit inner scope */ + __Pyx_XDECREF_SET(__pyx_v_values, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "opendbc/can/parser_pyx.pyx":181 + * def_val = def_val.split() + * values = [int(v) for v in def_val[::2]] + * defs = def_val[1::2] # <<<<<<<<<<<<<< + * + * # two ways to lookup: address or msg name + */ + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_def_val, __pyx_slice__8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_defs, __pyx_t_6); + __pyx_t_6 = 0; + + /* "opendbc/can/parser_pyx.pyx":184 + * + * # two ways to lookup: address or msg name + * dv[address][sgname] = dict(zip(values, defs)) # <<<<<<<<<<<<<< + * dv[msgname][sgname] = dv[address][sgname] + * + */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_values); + __Pyx_INCREF(__pyx_v_defs); + __Pyx_GIVEREF(__pyx_v_defs); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_defs); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_6, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_dv, __pyx_v_address, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (unlikely(PyObject_SetItem(__pyx_t_12, __pyx_v_sgname, __pyx_t_6) < 0)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "opendbc/can/parser_pyx.pyx":185 + * # two ways to lookup: address or msg name + * dv[address][sgname] = dict(zip(values, defs)) + * dv[msgname][sgname] = dv[address][sgname] # <<<<<<<<<<<<<< + * + * self.dv = dict(dv) + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_dv, __pyx_v_address, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_sgname); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_dv, __pyx_v_msgname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_sgname, __pyx_t_12) < 0)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + + /* "opendbc/can/parser_pyx.pyx":187 + * dv[msgname][sgname] = dv[address][sgname] + * + * self.dv = dict(dv) # <<<<<<<<<<<<<< + */ + __pyx_t_12 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_dv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_v_self->dv); + __Pyx_DECREF(__pyx_v_self->dv); + __pyx_v_self->dv = ((PyObject*)__pyx_t_12); + __pyx_t_12 = 0; + + /* "opendbc/can/parser_pyx.pyx":151 + * string dbc_name + * + * def __init__(self, dbc_name): # <<<<<<<<<<<<<< + * self.dbc_name = dbc_name + * self.dbc = dbc_lookup(dbc_name) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANDefine.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_address_to_msg_name); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_dv); + __Pyx_XDECREF(__pyx_v_sgname); + __Pyx_XDECREF(__pyx_v_def_val); + __Pyx_XDECREF(__pyx_v_msgname); + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_defs); + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_v); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/parser_pyx.pyx":148 + * + * cdef public: + * dict dv # <<<<<<<<<<<<<< + * string dbc_name + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_2dv_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_2dv_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_2dv___get__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_2dv___get__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->dv); + __pyx_r = __pyx_v_self->dv; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_2dv_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_2dv_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_2dv_2__set__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_2dv_2__set__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->dv); + __Pyx_DECREF(__pyx_v_self->dv); + __pyx_v_self->dv = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANDefine.dv.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_2dv_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_2dv_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_2dv_4__del__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_2dv_4__del__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->dv); + __Pyx_DECREF(__pyx_v_self->dv); + __pyx_v_self->dv = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "opendbc/can/parser_pyx.pyx":149 + * cdef public: + * dict dv + * string dbc_name # <<<<<<<<<<<<<< + * + * def __init__(self, dbc_name): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_8dbc_name_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_8dbc_name_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_8dbc_name___get__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_8dbc_name___get__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->dbc_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANDefine.dbc_name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_8dbc_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_8dbc_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_8dbc_name_2__set__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_8dbc_name_2__set__(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + std::string __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_v_self->dbc_name = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANDefine.dbc_name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.dbc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_2__reduce_cython__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.dbc cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.dbc cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.dbc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANDefine.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.dbc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.dbc cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_4__setstate_cython__(((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7opendbc_3can_10parser_pyx_9CANDefine_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("self.dbc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.dbc cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.dbc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.dbc cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("opendbc.can.parser_pyx.CANDefine.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + +static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) { + Py_ssize_t __pyx_v_length; + char const *__pyx_v_data; + std::string __pyx_r; + __Pyx_RefNannyDeclarations + char const *__pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0); + + /* "string.from_py":14 + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<< + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) + */ + __pyx_v_length = 0; + + /* "string.from_py":15 + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<< + * return string(data, length) + * + */ + __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(1, 15, __pyx_L1_error) + __pyx_v_data = __pyx_t_1; + + /* "string.from_py":16 + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = std::string(__pyx_v_data, __pyx_v_length); + goto __pyx_L0; + + /* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":31 + * + * @cname("__pyx_convert_PyObject_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0); + + /* "string.to_py":32 + * @cname("__pyx_convert_PyObject_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): + * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * cdef extern from *: + * cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":31 + * + * @cname("__pyx_convert_PyObject_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":37 + * + * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0); + + /* "string.to_py":38 + * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): + * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * cdef extern from *: + * cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":37 + * + * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":43 + * + * @cname("__pyx_convert_PyStr_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0); + + /* "string.to_py":44 + * @cname("__pyx_convert_PyStr_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): + * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * cdef extern from *: + * cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":43 + * + * @cname("__pyx_convert_PyStr_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":49 + * + * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0); + + /* "string.to_py":50 + * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): + * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * cdef extern from *: + * cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":49 + * + * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":55 + * + * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) + * + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0); + + /* "string.to_py":56 + * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): + * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":55 + * + * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py_double") + * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + +static PyObject *__pyx_convert_vector_to_py_double(const std::vector &__pyx_v_v) { + size_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_double", 0); + + /* "vector.to_py":61 + * @cname("__pyx_convert_vector_to_py_double") + * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): + * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_v.size(); + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py_double") + * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "set.to_py":129 + * + * @cname("__pyx_convert_unordered_set_to_py_uint32_t") + * cdef object __pyx_convert_unordered_set_to_py_uint32_t(const cpp_set[X]& s): # <<<<<<<<<<<<<< + * o = set() + * cdef cpp_set[X].const_iterator iter = s.begin() + */ + +static PyObject *__pyx_convert_unordered_set_to_py_uint32_t(std::unordered_set const &__pyx_v_s) { + PyObject *__pyx_v_o = NULL; + std::unordered_set ::const_iterator __pyx_v_iter; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_unordered_set_to_py_uint32_t", 0); + + /* "set.to_py":130 + * @cname("__pyx_convert_unordered_set_to_py_uint32_t") + * cdef object __pyx_convert_unordered_set_to_py_uint32_t(const cpp_set[X]& s): + * o = set() # <<<<<<<<<<<<<< + * cdef cpp_set[X].const_iterator iter = s.begin() + * while iter != s.end(): + */ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_o = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "set.to_py":131 + * cdef object __pyx_convert_unordered_set_to_py_uint32_t(const cpp_set[X]& s): + * o = set() + * cdef cpp_set[X].const_iterator iter = s.begin() # <<<<<<<<<<<<<< + * while iter != s.end(): + * o.add(cython.operator.dereference(iter)) + */ + __pyx_v_iter = __pyx_v_s.begin(); + + /* "set.to_py":132 + * o = set() + * cdef cpp_set[X].const_iterator iter = s.begin() + * while iter != s.end(): # <<<<<<<<<<<<<< + * o.add(cython.operator.dereference(iter)) + * cython.operator.preincrement(iter) + */ + while (1) { + __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0); + if (!__pyx_t_2) break; + + /* "set.to_py":133 + * cdef cpp_set[X].const_iterator iter = s.begin() + * while iter != s.end(): + * o.add(cython.operator.dereference(iter)) # <<<<<<<<<<<<<< + * cython.operator.preincrement(iter) + * return o + */ + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__pyx_v_iter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PySet_Add(__pyx_v_o, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 133, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "set.to_py":134 + * while iter != s.end(): + * o.add(cython.operator.dereference(iter)) + * cython.operator.preincrement(iter) # <<<<<<<<<<<<<< + * return o + * + */ + (void)((++__pyx_v_iter)); + } + + /* "set.to_py":135 + * o.add(cython.operator.dereference(iter)) + * cython.operator.preincrement(iter) + * return o # <<<<<<<<<<<<<< + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_o); + __pyx_r = __pyx_v_o; + goto __pyx_L0; + + /* "set.to_py":129 + * + * @cname("__pyx_convert_unordered_set_to_py_uint32_t") + * cdef object __pyx_convert_unordered_set_to_py_uint32_t(const cpp_set[X]& s): # <<<<<<<<<<<<<< + * o = set() + * cdef cpp_set[X].const_iterator iter = s.begin() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("set.to_py.__pyx_convert_unordered_set_to_py_uint32_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_o); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_7opendbc_3can_10parser_pyx_CANParser __pyx_vtable_7opendbc_3can_10parser_pyx_CANParser; + +static PyObject *__pyx_tp_new_7opendbc_3can_10parser_pyx_CANParser(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)o); + p->__pyx_vtab = __pyx_vtabptr_7opendbc_3can_10parser_pyx_CANParser; + new((void*)&(p->msg_name_to_address)) std::map (); + new((void*)&(p->address_to_msg_name)) std::map (); + new((void*)&(p->can_values)) std::vector (); + new((void*)&(p->dbc_name)) std::string(); + p->vl = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->vl_all = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_7opendbc_3can_10parser_pyx_CANParser(PyObject *o) { + struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *p = (struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + __Pyx_call_destructor(p->msg_name_to_address); + __Pyx_call_destructor(p->address_to_msg_name); + __Pyx_call_destructor(p->can_values); + __Pyx_call_destructor(p->dbc_name); + Py_CLEAR(p->vl); + Py_CLEAR(p->vl_all); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_7opendbc_3can_10parser_pyx_CANParser(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *p = (struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)o; + if (p->vl) { + e = (*v)(p->vl, a); if (e) return e; + } + if (p->vl_all) { + e = (*v)(p->vl_all, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_7opendbc_3can_10parser_pyx_CANParser(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *p = (struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)o; + tmp = ((PyObject*)p->vl); + p->vl = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->vl_all); + p->vl_all = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_7opendbc_3can_10parser_pyx_9CANParser_vl(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_2vl_1__get__(o); +} + +static PyObject *__pyx_getprop_7opendbc_3can_10parser_pyx_9CANParser_vl_all(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_6vl_all_1__get__(o); +} + +static PyObject *__pyx_getprop_7opendbc_3can_10parser_pyx_9CANParser_can_valid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_9can_valid_1__get__(o); +} + +static PyObject *__pyx_getprop_7opendbc_3can_10parser_pyx_9CANParser_dbc_name(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_8dbc_name_1__get__(o); +} + +static PyObject *__pyx_getprop_7opendbc_3can_10parser_pyx_9CANParser_can_invalid_cnt(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_15can_invalid_cnt_1__get__(o); +} + +static PyMethodDef __pyx_methods_7opendbc_3can_10parser_pyx_CANParser[] = { + {"update_string", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_3update_string, METH_VARARGS|METH_KEYWORDS, 0}, + {"update_strings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_5update_strings, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_9__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_7opendbc_3can_10parser_pyx_CANParser[] = { + {(char *)"vl", __pyx_getprop_7opendbc_3can_10parser_pyx_9CANParser_vl, 0, (char *)0, 0}, + {(char *)"vl_all", __pyx_getprop_7opendbc_3can_10parser_pyx_9CANParser_vl_all, 0, (char *)0, 0}, + {(char *)"can_valid", __pyx_getprop_7opendbc_3can_10parser_pyx_9CANParser_can_valid, 0, (char *)0, 0}, + {(char *)"dbc_name", __pyx_getprop_7opendbc_3can_10parser_pyx_9CANParser_dbc_name, 0, (char *)0, 0}, + {(char *)"can_invalid_cnt", __pyx_getprop_7opendbc_3can_10parser_pyx_9CANParser_can_invalid_cnt, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_7opendbc_3can_10parser_pyx_CANParser = { + PyVarObject_HEAD_INIT(0, 0) + "opendbc.can.parser_pyx.CANParser", /*tp_name*/ + sizeof(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7opendbc_3can_10parser_pyx_CANParser, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_7opendbc_3can_10parser_pyx_CANParser, /*tp_traverse*/ + __pyx_tp_clear_7opendbc_3can_10parser_pyx_CANParser, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_7opendbc_3can_10parser_pyx_CANParser, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_7opendbc_3can_10parser_pyx_CANParser, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7opendbc_3can_10parser_pyx_CANParser, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyObject *__pyx_tp_new_7opendbc_3can_10parser_pyx_CANDefine(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *)o); + new((void*)&(p->dbc_name)) std::string(); + p->dv = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_7opendbc_3can_10parser_pyx_CANDefine(PyObject *o) { + struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *p = (struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + __Pyx_call_destructor(p->dbc_name); + Py_CLEAR(p->dv); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_7opendbc_3can_10parser_pyx_CANDefine(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *p = (struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *)o; + if (p->dv) { + e = (*v)(p->dv, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_7opendbc_3can_10parser_pyx_CANDefine(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *p = (struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine *)o; + tmp = ((PyObject*)p->dv); + p->dv = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_7opendbc_3can_10parser_pyx_9CANDefine_dv(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_2dv_1__get__(o); +} + +static int __pyx_setprop_7opendbc_3can_10parser_pyx_9CANDefine_dv(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_2dv_3__set__(o, v); + } + else { + return __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_2dv_5__del__(o); + } +} + +static PyObject *__pyx_getprop_7opendbc_3can_10parser_pyx_9CANDefine_dbc_name(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_8dbc_name_1__get__(o); +} + +static int __pyx_setprop_7opendbc_3can_10parser_pyx_9CANDefine_dbc_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_8dbc_name_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_7opendbc_3can_10parser_pyx_CANDefine[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_5__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_7opendbc_3can_10parser_pyx_CANDefine[] = { + {(char *)"dv", __pyx_getprop_7opendbc_3can_10parser_pyx_9CANDefine_dv, __pyx_setprop_7opendbc_3can_10parser_pyx_9CANDefine_dv, (char *)0, 0}, + {(char *)"dbc_name", __pyx_getprop_7opendbc_3can_10parser_pyx_9CANDefine_dbc_name, __pyx_setprop_7opendbc_3can_10parser_pyx_9CANDefine_dbc_name, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_7opendbc_3can_10parser_pyx_CANDefine = { + PyVarObject_HEAD_INIT(0, 0) + "opendbc.can.parser_pyx.CANDefine", /*tp_name*/ + sizeof(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANDefine), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7opendbc_3can_10parser_pyx_CANDefine, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_7opendbc_3can_10parser_pyx_CANDefine, /*tp_traverse*/ + __pyx_tp_clear_7opendbc_3can_10parser_pyx_CANDefine, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_7opendbc_3can_10parser_pyx_CANDefine, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_7opendbc_3can_10parser_pyx_CANDefine, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7opendbc_3can_10parser_pyx_CANDefine, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *__pyx_freelist_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__[8]; +static int __pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ = 0; + +static PyObject *__pyx_tp_new_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__)))) { + o = (PyObject*)__pyx_freelist_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__[--__pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__]; + memset(o, 0, sizeof(struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__(PyObject *o) { + struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *p = (struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_self); + Py_CLEAR(p->__pyx_v_signals); + Py_CLEAR(p->__pyx_v_unchecked); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__)))) { + __pyx_freelist_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__[__pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__++] = ((struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *p = (struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *)o; + if (p->__pyx_v_self) { + e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; + } + if (p->__pyx_v_signals) { + e = (*v)(p->__pyx_v_signals, a); if (e) return e; + } + if (p->__pyx_v_unchecked) { + e = (*v)(p->__pyx_v_unchecked, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *p = (struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ *)o; + tmp = ((PyObject*)p->__pyx_v_self); + p->__pyx_v_self = ((struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_signals); + p->__pyx_v_signals = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_unchecked); + p->__pyx_v_unchecked = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ = { + PyVarObject_HEAD_INIT(0, 0) + "opendbc.can.parser_pyx.__pyx_scope_struct____init__", /*tp_name*/ + sizeof(struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__, /*tp_traverse*/ + __pyx_tp_clear_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr *__pyx_freelist_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr[8]; +static int __pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr = 0; + +static PyObject *__pyx_tp_new_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr)))) { + o = (PyObject*)__pyx_freelist_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr[--__pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr(PyObject *o) { + struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_addr); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr)))) { + __pyx_freelist_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr[__pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_addr) { + e = (*v)(p->__pyx_v_addr, a); if (e) return e; + } + return 0; +} + +static PyTypeObject __pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "opendbc.can.parser_pyx.__pyx_scope_struct_1_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr *__pyx_freelist_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr[8]; +static int __pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr = 0; + +static PyObject *__pyx_tp_new_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr)))) { + o = (PyObject*)__pyx_freelist_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr[--__pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr(PyObject *o) { + struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v__); + Py_CLEAR(p->__pyx_v_address); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr)))) { + __pyx_freelist_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr[__pyx_freecount_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v__) { + e = (*v)(p->__pyx_v__, a); if (e) return e; + } + if (p->__pyx_v_address) { + e = (*v)(p->__pyx_v_address, a); if (e) return e; + } + return 0; +} + +static PyTypeObject __pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "opendbc.can.parser_pyx.__pyx_scope_struct_2_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_parser_pyx(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_parser_pyx}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "parser_pyx", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, + {&__pyx_n_s_CANDefine, __pyx_k_CANDefine, sizeof(__pyx_k_CANDefine), 0, 0, 1, 1}, + {&__pyx_n_s_CANParser, __pyx_k_CANParser, sizeof(__pyx_k_CANParser), 0, 0, 1, 1}, + {&__pyx_kp_u_Can_t_find_DBC, __pyx_k_Can_t_find_DBC, sizeof(__pyx_k_Can_t_find_DBC), 0, 1, 0, 0}, + {&__pyx_kp_u_Can_t_find_DBC_2, __pyx_k_Can_t_find_DBC_2, sizeof(__pyx_k_Can_t_find_DBC_2), 0, 1, 0, 0}, + {&__pyx_kp_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 0}, + {&__pyx_n_s_Number, __pyx_k_Number, sizeof(__pyx_k_Number), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_u_Unchecked_addrs, __pyx_k_Unchecked_addrs, sizeof(__pyx_k_Unchecked_addrs), 0, 1, 0, 0}, + {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, + {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, + {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_bus, __pyx_k_bus, sizeof(__pyx_k_bus), 0, 0, 1, 1}, + {&__pyx_n_s_checks, __pyx_k_checks, sizeof(__pyx_k_checks), 0, 0, 1, 1}, + {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, + {&__pyx_n_s_dat, __pyx_k_dat, sizeof(__pyx_k_dat), 0, 0, 1, 1}, + {&__pyx_n_s_dbc_name, __pyx_k_dbc_name, sizeof(__pyx_k_dbc_name), 0, 0, 1, 1}, + {&__pyx_n_s_defaultdict, __pyx_k_defaultdict, sizeof(__pyx_k_defaultdict), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_enforce_checks, __pyx_k_enforce_checks, sizeof(__pyx_k_enforce_checks), 0, 0, 1, 1}, + {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1}, + {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init___locals_genexpr, __pyx_k_init___locals_genexpr, sizeof(__pyx_k_init___locals_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_numbers, __pyx_k_numbers, sizeof(__pyx_k_numbers), 0, 0, 1, 1}, + {&__pyx_n_s_opendbc_can_parser_pyx, __pyx_k_opendbc_can_parser_pyx, sizeof(__pyx_k_opendbc_can_parser_pyx), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_kp_s_self_can_self_dbc_cannot_be_conv, __pyx_k_self_can_self_dbc_cannot_be_conv, sizeof(__pyx_k_self_can_self_dbc_cannot_be_conv), 0, 0, 1, 0}, + {&__pyx_kp_s_self_dbc_cannot_be_converted_to, __pyx_k_self_dbc_cannot_be_converted_to, sizeof(__pyx_k_self_dbc_cannot_be_converted_to), 0, 0, 1, 0}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_sendcan, __pyx_k_sendcan, sizeof(__pyx_k_sendcan), 0, 0, 1, 1}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_signals, __pyx_k_signals, sizeof(__pyx_k_signals), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_n_s_strings, __pyx_k_strings, sizeof(__pyx_k_strings), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_n_u_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 1, 0, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 184, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.can,self.dbc cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.can,self.dbc cannot be converted to a Python object for pickling") + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_can_self_dbc_cannot_be_conv); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "(tree fragment)":4 + * raise TypeError("self.can,self.dbc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.can,self.dbc cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_can_self_dbc_cannot_be_conv); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "opendbc/can/parser_pyx.pyx":180 + * # separate definition/value pairs + * def_val = def_val.split() + * values = [int(v) for v in def_val[::2]] # <<<<<<<<<<<<<< + * defs = def_val[1::2] + * + */ + __pyx_slice__7 = PySlice_New(Py_None, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__7); + __Pyx_GIVEREF(__pyx_slice__7); + + /* "opendbc/can/parser_pyx.pyx":181 + * def_val = def_val.split() + * values = [int(v) for v in def_val[::2]] + * defs = def_val[1::2] # <<<<<<<<<<<<<< + * + * # two ways to lookup: address or msg name + */ + __pyx_slice__8 = PySlice_New(__pyx_int_1, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__8)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__8); + __Pyx_GIVEREF(__pyx_slice__8); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.dbc cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.dbc cannot be converted to a Python object for pickling") + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_self_dbc_cannot_be_converted_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "(tree fragment)":4 + * raise TypeError("self.dbc cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.dbc cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_self_dbc_cannot_be_converted_to); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + __pyx_umethod_PyDict_Type_update.type = (PyObject*)&PyDict_Type; + __pyx_umethod_PySet_Type_update.type = (PyObject*)&PySet_Type; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_vtabptr_7opendbc_3can_10parser_pyx_CANParser = &__pyx_vtable_7opendbc_3can_10parser_pyx_CANParser; + __pyx_vtable_7opendbc_3can_10parser_pyx_CANParser.update_vl = (std::unordered_set (*)(struct __pyx_obj_7opendbc_3can_10parser_pyx_CANParser *))__pyx_f_7opendbc_3can_10parser_pyx_9CANParser_update_vl; + if (PyType_Ready(&__pyx_type_7opendbc_3can_10parser_pyx_CANParser) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_7opendbc_3can_10parser_pyx_CANParser.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7opendbc_3can_10parser_pyx_CANParser.tp_dictoffset && __pyx_type_7opendbc_3can_10parser_pyx_CANParser.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_7opendbc_3can_10parser_pyx_CANParser.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_7opendbc_3can_10parser_pyx_CANParser.tp_dict, __pyx_vtabptr_7opendbc_3can_10parser_pyx_CANParser) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CANParser, (PyObject *)&__pyx_type_7opendbc_3can_10parser_pyx_CANParser) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7opendbc_3can_10parser_pyx_CANParser) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_ptype_7opendbc_3can_10parser_pyx_CANParser = &__pyx_type_7opendbc_3can_10parser_pyx_CANParser; + if (PyType_Ready(&__pyx_type_7opendbc_3can_10parser_pyx_CANDefine) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_7opendbc_3can_10parser_pyx_CANDefine.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7opendbc_3can_10parser_pyx_CANDefine.tp_dictoffset && __pyx_type_7opendbc_3can_10parser_pyx_CANDefine.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_7opendbc_3can_10parser_pyx_CANDefine.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CANDefine, (PyObject *)&__pyx_type_7opendbc_3can_10parser_pyx_CANDefine) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7opendbc_3can_10parser_pyx_CANDefine) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_ptype_7opendbc_3can_10parser_pyx_CANDefine = &__pyx_type_7opendbc_3can_10parser_pyx_CANDefine; + if (PyType_Ready(&__pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__) < 0) __PYX_ERR(0, 36, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__.tp_dictoffset && __pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + __pyx_ptype_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__ = &__pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct____init__; + if (PyType_Ready(&__pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + __pyx_ptype_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr = &__pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct_1_genexpr; + if (PyType_Ready(&__pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr.tp_dictoffset && __pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + __pyx_ptype_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr = &__pyx_type_7opendbc_3can_10parser_pyx___pyx_scope_struct_2_genexpr; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initparser_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initparser_pyx(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_parser_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_parser_pyx(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_parser_pyx(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'parser_pyx' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_parser_pyx(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("parser_pyx", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_opendbc__can__parser_pyx) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "opendbc.can.parser_pyx")) { + if (unlikely(PyDict_SetItemString(modules, "opendbc.can.parser_pyx", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "opendbc/can/parser_pyx.pyx":14 + * from .common cimport SignalParseOptions, MessageParseOptions, dbc_lookup, SignalValue, DBC + * + * import os # <<<<<<<<<<<<<< + * import numbers + * from collections import defaultdict + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "opendbc/can/parser_pyx.pyx":15 + * + * import os + * import numbers # <<<<<<<<<<<<<< + * from collections import defaultdict + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "opendbc/can/parser_pyx.pyx":16 + * import os + * import numbers + * from collections import defaultdict # <<<<<<<<<<<<<< + * + * cdef int CAN_INVALID_CNT = 5 + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_defaultdict); + __Pyx_GIVEREF(__pyx_n_s_defaultdict); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_defaultdict); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_defaultdict, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "opendbc/can/parser_pyx.pyx":18 + * from collections import defaultdict + * + * cdef int CAN_INVALID_CNT = 5 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_7opendbc_3can_10parser_pyx_CAN_INVALID_CNT = 5; + + /* "opendbc/can/parser_pyx.pyx":1 + * # distutils: language = c++ # <<<<<<<<<<<<<< + * # cython: c_string_encoding=ascii, language_level=3 + * + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "set.to_py":129 + * + * @cname("__pyx_convert_unordered_set_to_py_uint32_t") + * cdef object __pyx_convert_unordered_set_to_py_uint32_t(const cpp_set[X]& s): # <<<<<<<<<<<<<< + * o = set() + * cdef cpp_set[X].const_iterator iter = s.begin() + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init opendbc.can.parser_pyx", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init opendbc.can.parser_pyx"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* None */ +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { + PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); +} + +/* decode_c_bytes */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( + const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + if (unlikely((start < 0) | (stop < 0))) { + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + if (stop > length) + stop = length; + if (unlikely(stop <= start)) + return __Pyx_NewRef(__pyx_empty_unicode); + length = stop - start; + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (__Pyx_PyFastCFunction_Check(func)) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* JoinPyUnicode */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + CYTHON_UNUSED Py_UCS4 max_char) { +#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyObject *result_uval; + int result_ukind; + Py_ssize_t i, char_pos; + void *result_udata; +#if CYTHON_PEP393_ENABLED + result_uval = PyUnicode_New(result_ulength, max_char); + if (unlikely(!result_uval)) return NULL; + result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; + result_udata = PyUnicode_DATA(result_uval); +#else + result_uval = PyUnicode_FromUnicode(NULL, result_ulength); + if (unlikely(!result_uval)) return NULL; + result_ukind = sizeof(Py_UNICODE); + result_udata = PyUnicode_AS_UNICODE(result_uval); +#endif + char_pos = 0; + for (i=0; i < value_count; i++) { + int ukind; + Py_ssize_t ulength; + void *udata; + PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); + if (unlikely(__Pyx_PyUnicode_READY(uval))) + goto bad; + ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + if (unlikely(!ulength)) + continue; + if (unlikely(char_pos + ulength < 0)) + goto overflow; + ukind = __Pyx_PyUnicode_KIND(uval); + udata = __Pyx_PyUnicode_DATA(uval); + if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind)); + } else { + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); + #else + Py_ssize_t j; + for (j=0; j < ulength; j++) { + Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); + __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); + } + #endif + } + char_pos += ulength; + } + return result_uval; +overflow: + PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); +bad: + Py_DECREF(result_uval); + return NULL; +#else + result_ulength++; + value_count++; + return PyUnicode_Join(__pyx_empty_unicode, value_tuple); +#endif +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* decode_c_string */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + size_t slen = strlen(cstring); + if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, + "c-string too long to convert to Python"); + return NULL; + } + length = (Py_ssize_t) slen; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + if (unlikely(stop <= start)) + return __Pyx_NewRef(__pyx_empty_unicode); + length = stop - start; + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* DictGetItem */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); + } + } else { + PyErr_SetObject(PyExc_KeyError, key); + } + } + return NULL; + } + Py_INCREF(value); + return value; +} +#endif + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* SetItemInt */ +static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + int r; + if (!j) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, + CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) { + PyObject* old = PyList_GET_ITEM(o, n); + Py_INCREF(v); + PyList_SET_ITEM(o, n, v); + Py_DECREF(old); + return 1; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_ass_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return -1; + PyErr_Clear(); + } + } + return m->sq_ass_item(o, i, v); + } + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) +#else + if (is_list || PySequence_Check(o)) +#endif + { + return PySequence_SetItem(o, i, v); + } +#endif + return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); +} + +/* PyUnicode_Unicode */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) { + if (unlikely(obj == Py_None)) + obj = __pyx_kp_u_None; + return __Pyx_NewRef(obj); +} + +/* UnpackUnboundCMethod */ +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } +#endif + return 0; +} + +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + if (likely(cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return (*(cfunc->func))(self, arg); + } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { + if (PY_VERSION_HEX >= 0x030700A0) { + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + } else { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } + return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(2, self, arg); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (descr != NULL) { + *method = descr; + return 0; + } + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); +#endif + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* RaiseNoneIterError */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* UnpackTupleError */ +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +/* UnpackTuple2 */ +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( + PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { + PyObject *value1 = NULL, *value2 = NULL; +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); + value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); +#endif + if (decref_tuple) { + Py_DECREF(tuple); + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +#if CYTHON_COMPILING_IN_PYPY +bad: + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +#endif +} +static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = Py_TYPE(iter)->tp_iternext; + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +/* dict_iter */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; + if (is_dict) { +#if !CYTHON_COMPILING_IN_PYPY + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; +#elif PY_MAJOR_VERSION >= 3 + static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; + PyObject **pp = NULL; + if (method_name) { + const char *name = PyUnicode_AsUTF8(method_name); + if (strcmp(name, "iteritems") == 0) pp = &py_items; + else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; + else if (strcmp(name, "itervalues") == 0) pp = &py_values; + if (pp) { + if (!*pp) { + *pp = PyUnicode_FromString(name + 4); + if (!*pp) + return NULL; + } + method_name = *pp; + } + } +#endif + } + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next( + PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; +} + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* PyObjectGetAttrStrNoError */ +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* SetupReduce */ +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#else + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#endif +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); + if (likely(reduce_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (reduce == object_reduce || PyErr_Occurred()) { + goto __PYX_BAD; + } + setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); + if (likely(setstate_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (!setstate || PyErr_Occurred()) { + goto __PYX_BAD; + } + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto __PYX_GOOD; +__PYX_BAD: + if (!PyErr_Occurred()) + PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +__PYX_GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(uint32_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(uint32_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(uint32_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(uint32_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (uint32_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (uint32_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) + case 2: + if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { + return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { + return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { + return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (uint32_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(uint32_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (uint32_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) + case -2: + if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { + return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { + return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { + return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { + return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { + return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { + return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(uint32_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + uint32_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (uint32_t) -1; + } + } else { + uint32_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (uint32_t) -1; + val = __Pyx_PyInt_As_uint32_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to uint32_t"); + return (uint32_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to uint32_t"); + return (uint32_t) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { + return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { + return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { + return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) + case -2: + if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* PyObjectCallMethod1 */ +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +} + +/* CoroutineBase */ +#include +#include +#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (likely(et == PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + value = Py_None; + } +#if PY_VERSION_HEX >= 0x030300A0 + else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) { + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); + } +#endif + else if (unlikely(PyTuple_Check(ev))) { + if (PyTuple_GET_SIZE(ev) >= 1) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + value = PyTuple_GET_ITEM(ev, 0); + Py_INCREF(value); +#else + value = PySequence_ITEM(ev, 0); +#endif + } else { + Py_INCREF(Py_None); + value = Py_None; + } + Py_DECREF(ev); + } + else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { + value = ev; + } + if (likely(value)) { + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = value; + return 0; + } + } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); + Py_DECREF(ev); + if (likely(args)) { + value = PySequence_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +static CYTHON_INLINE +void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { + PyObject *t, *v, *tb; + t = exc_state->exc_type; + v = exc_state->exc_value; + tb = exc_state->exc_traceback; + exc_state->exc_type = NULL; + exc_state->exc_value = NULL; + exc_state->exc_traceback = NULL; + Py_XDECREF(t); + Py_XDECREF(v); + Py_XDECREF(tb); +} +#define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) { + const char *msg; + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { + msg = "coroutine already executing"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { + msg = "async generator already executing"; + #endif + } else { + msg = "generator already executing"; + } + PyErr_SetString(PyExc_ValueError, msg); +} +#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) { + const char *msg; + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(gen)) { + msg = "can't send non-None value to a just-started coroutine"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(gen)) { + msg = "can't send non-None value to a just-started async generator"; + #endif + } else { + msg = "can't send non-None value to a just-started generator"; + } + PyErr_SetString(PyExc_TypeError, msg); +} +#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) { + #ifdef __Pyx_Coroutine_USED + if (!closing && __Pyx_Coroutine_Check(gen)) { + PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); + } else + #endif + if (value) { + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + else + #endif + PyErr_SetNone(PyExc_StopIteration); + } +} +static +PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { + __Pyx_PyThreadState_declare + PyThreadState *tstate; + __Pyx_ExcInfoStruct *exc_state; + PyObject *retval; + assert(!self->is_running); + if (unlikely(self->resume_label == 0)) { + if (unlikely(value && value != Py_None)) { + return __Pyx_Coroutine_NotStartedError((PyObject*)self); + } + } + if (unlikely(self->resume_label == -1)) { + return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + } +#if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + tstate = __pyx_tstate; +#else + tstate = __Pyx_PyThreadState_Current; +#endif + exc_state = &self->gi_exc_state; + if (exc_state->exc_type) { + #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON + #else + if (exc_state->exc_traceback) { + PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback; + PyFrameObject *f = tb->tb_frame; + assert(f->f_back == NULL); + #if PY_VERSION_HEX >= 0x030B00A1 + f->f_back = PyThreadState_GetFrame(tstate); + #else + Py_XINCREF(tstate->frame); + f->f_back = tstate->frame; + #endif + } + #endif + } +#if CYTHON_USE_EXC_INFO_STACK + exc_state->previous_item = tstate->exc_info; + tstate->exc_info = exc_state; +#else + if (exc_state->exc_type) { + __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } else { + __Pyx_Coroutine_ExceptionClear(exc_state); + __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } +#endif + self->is_running = 1; + retval = self->body((PyObject *) self, tstate, value); + self->is_running = 0; +#if CYTHON_USE_EXC_INFO_STACK + exc_state = &self->gi_exc_state; + tstate->exc_info = exc_state->previous_item; + exc_state->previous_item = NULL; + __Pyx_Coroutine_ResetFrameBackpointer(exc_state); +#endif + return retval; +} +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { + PyObject *exc_tb = exc_state->exc_traceback; + if (likely(exc_tb)) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON +#else + PyTracebackObject *tb = (PyTracebackObject *) exc_tb; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); +#endif + } +} +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) { + if (unlikely(!retval)) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (!__Pyx_PyErr_Occurred()) { + PyObject *exc = PyExc_StopIteration; + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + exc = __Pyx_PyExc_StopAsyncIteration; + #endif + __Pyx_PyErr_SetNone(exc); + } + } + return retval; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) +static CYTHON_INLINE +PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { +#if PY_VERSION_HEX <= 0x030A00A1 + return _PyGen_Send(gen, arg); +#else + PyObject *result; + if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) { + if (PyAsyncGen_CheckExact(gen)) { + assert(result == Py_None); + PyErr_SetNone(PyExc_StopAsyncIteration); + } + else if (result == Py_None) { + PyErr_SetNone(PyExc_StopIteration); + } + else { + _PyGen_SetStopIterationValue(result); + } + Py_CLEAR(result); + } + return result; +#endif +} +#endif +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Coroutine_Undelegate(gen); + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); + ret = __Pyx_Coroutine_SendEx(gen, val, 0); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { + PyObject *retval; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + ret = __Pyx_async_gen_asend_send(yf, value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyCoro_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + { + if (value == Py_None) + ret = Py_TYPE(yf)->tp_iternext(yf); + else + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + retval = __Pyx_Coroutine_FinishDelegation(gen); + } else { + retval = __Pyx_Coroutine_SendEx(gen, value, 0); + } + return __Pyx_Coroutine_MethodReturn(self, retval); +} +static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + if (__Pyx_CoroutineAwait_CheckExact(yf)) { + retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + retval = __Pyx_async_gen_asend_close(yf, NULL); + } else + if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { + retval = __Pyx_async_gen_athrow_close(yf, NULL); + } else + #endif + { + PyObject *meth; + gen->is_running = 1; + meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close); + if (unlikely(!meth)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_WriteUnraisable(yf); + } + PyErr_Clear(); + } else { + retval = PyObject_CallFunction(meth, NULL); + Py_DECREF(meth); + if (!retval) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Next(yf); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, Py_None); + } else + #endif + ret = Py_TYPE(yf)->tp_iternext(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_SendEx(gen, Py_None, 0); +} +static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) { + return __Pyx_Coroutine_Close(self); +} +static PyObject *__Pyx_Coroutine_Close(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + Py_INCREF(yf); + err = __Pyx_Coroutine_CloseIter(gen, yf); + __Pyx_Coroutine_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) + PyErr_SetNone(PyExc_GeneratorExit); + retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); + if (unlikely(retval)) { + const char *msg; + Py_DECREF(retval); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(self)) { + msg = "coroutine ignored GeneratorExit"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(self)) { +#if PY_VERSION_HEX < 0x03060000 + msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; +#else + msg = "async generator ignored GeneratorExit"; +#endif + #endif + } else { + msg = "generator ignored GeneratorExit"; + } + PyErr_SetString(PyExc_RuntimeError, msg); + return NULL; + } + raised_exception = PyErr_Occurred(); + if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { + if (raised_exception) PyErr_Clear(); + Py_INCREF(Py_None); + return Py_None; + } + return NULL; +} +static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, + PyObject *args, int close_on_genexit) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + Py_INCREF(yf); + if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { + int err = __Pyx_Coroutine_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Coroutine_Undelegate(gen); + if (err < 0) + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto throw_here; + } + gen->is_running = 1; + if (0 + #ifdef __Pyx_Generator_USED + || __Pyx_Generator_CheckExact(yf) + #endif + #ifdef __Pyx_Coroutine_USED + || __Pyx_Coroutine_Check(yf) + #endif + ) { + ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { + ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); + #endif + } else { + PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + gen->is_running = 0; + return NULL; + } + PyErr_Clear(); + __Pyx_Coroutine_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + if (likely(args)) { + ret = PyObject_CallObject(meth, args); + } else { + ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL); + } + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_MethodReturn(self, ret); + } +throw_here: + __Pyx_Raise(typ, val, tb, NULL); + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +} +static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { + PyObject *typ; + PyObject *val = NULL; + PyObject *tb = NULL; + if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) + return NULL; + return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); +} +static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { + Py_VISIT(exc_state->exc_type); + Py_VISIT(exc_state->exc_value); + Py_VISIT(exc_state->exc_traceback); + return 0; +} +static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + Py_VISIT(gen->closure); + Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); + return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); +} +static int __Pyx_Coroutine_clear(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); + } +#endif + Py_CLEAR(gen->gi_code); + Py_CLEAR(gen->gi_frame); + Py_CLEAR(gen->gi_name); + Py_CLEAR(gen->gi_qualname); + Py_CLEAR(gen->gi_modulename); + return 0; +} +static void __Pyx_Coroutine_dealloc(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject_GC_UnTrack(gen); + if (gen->gi_weakreflist != NULL) + PyObject_ClearWeakRefs(self); + if (gen->resume_label >= 0) { + PyObject_GC_Track(self); +#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE + if (PyObject_CallFinalizerFromDealloc(self)) +#else + Py_TYPE(gen)->tp_del(self); + if (Py_REFCNT(self) > 0) +#endif + { + return; + } + PyObject_GC_UnTrack(self); + } +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + /* We have to handle this case for asynchronous generators + right here, because this code has to be between UNTRACK + and GC_Del. */ + Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); + } +#endif + __Pyx_Coroutine_clear(self); + PyObject_GC_Del(gen); +} +static void __Pyx_Coroutine_del(PyObject *self) { + PyObject *error_type, *error_value, *error_traceback; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + __Pyx_PyThreadState_declare + if (gen->resume_label < 0) { + return; + } +#if !CYTHON_USE_TP_FINALIZE + assert(self->ob_refcnt == 0); + __Pyx_SET_REFCNT(self, 1); +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; + PyObject *finalizer = agen->ag_finalizer; + if (finalizer && !agen->ag_closed) { + PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); + if (unlikely(!res)) { + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); + return; + } + } +#endif + if (unlikely(gen->resume_label == 0 && !error_value)) { +#ifdef __Pyx_Coroutine_USED +#ifdef __Pyx_Generator_USED + if (!__Pyx_Generator_CheckExact(self)) +#endif + { + PyObject_GC_UnTrack(self); +#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) + if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) + PyErr_WriteUnraisable(self); +#else + {PyObject *msg; + char *cmsg; + #if CYTHON_COMPILING_IN_PYPY + msg = NULL; + cmsg = (char*) "coroutine was never awaited"; + #else + char *cname; + PyObject *qualname; + qualname = gen->gi_qualname; + cname = PyString_AS_STRING(qualname); + msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); + if (unlikely(!msg)) { + PyErr_Clear(); + cmsg = (char*) "coroutine was never awaited"; + } else { + cmsg = PyString_AS_STRING(msg); + } + #endif + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) + PyErr_WriteUnraisable(self); + Py_XDECREF(msg);} +#endif + PyObject_GC_Track(self); + } +#endif + } else { + PyObject *res = __Pyx_Coroutine_Close(self); + if (unlikely(!res)) { + if (PyErr_Occurred()) + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); +#if !CYTHON_USE_TP_FINALIZE + assert(Py_REFCNT(self) > 0); + if (--self->ob_refcnt == 0) { + return; + } + { + Py_ssize_t refcnt = Py_REFCNT(self); + _Py_NewReference(self); + __Pyx_SET_REFCNT(self, refcnt); + } +#if CYTHON_COMPILING_IN_CPYTHON + assert(PyType_IS_GC(Py_TYPE(self)) && + _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); + _Py_DEC_REFTOTAL; +#endif +#ifdef COUNT_ALLOCS + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; +#endif +#endif +} +static PyObject * +__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context) +{ + PyObject *name = self->gi_name; + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = self->gi_name; + Py_INCREF(value); + self->gi_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context) +{ + PyObject *name = self->gi_qualname; + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = self->gi_qualname; + Py_INCREF(value); + self->gi_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context) +{ + PyObject *frame = self->gi_frame; + if (!frame) { + if (unlikely(!self->gi_code)) { + Py_RETURN_NONE; + } + frame = (PyObject *) PyFrame_New( + PyThreadState_Get(), /*PyThreadState *tstate,*/ + (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (unlikely(!frame)) + return NULL; + self->gi_frame = frame; + } + Py_INCREF(frame); + return frame; +} +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); + if (unlikely(!gen)) + return NULL; + return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); +} +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + gen->body = body; + gen->closure = closure; + Py_XINCREF(closure); + gen->is_running = 0; + gen->resume_label = 0; + gen->classobj = NULL; + gen->yieldfrom = NULL; + gen->gi_exc_state.exc_type = NULL; + gen->gi_exc_state.exc_value = NULL; + gen->gi_exc_state.exc_traceback = NULL; +#if CYTHON_USE_EXC_INFO_STACK + gen->gi_exc_state.previous_item = NULL; +#endif + gen->gi_weakreflist = NULL; + Py_XINCREF(qualname); + gen->gi_qualname = qualname; + Py_XINCREF(name); + gen->gi_name = name; + Py_XINCREF(module_name); + gen->gi_modulename = module_name; + Py_XINCREF(code); + gen->gi_code = code; + gen->gi_frame = NULL; + PyObject_GC_Track(gen); + return gen; +} + +/* PatchModuleWithCoroutine */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + int result; + PyObject *globals, *result_obj; + globals = PyDict_New(); if (unlikely(!globals)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_coroutine_type", + #ifdef __Pyx_Coroutine_USED + (PyObject*)__pyx_CoroutineType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_generator_type", + #ifdef __Pyx_Generator_USED + (PyObject*)__pyx_GeneratorType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; + result_obj = PyRun_String(py_code, Py_file_input, globals, globals); + if (unlikely(!result_obj)) goto ignore; + Py_DECREF(result_obj); + Py_DECREF(globals); + return module; +ignore: + Py_XDECREF(globals); + PyErr_WriteUnraisable(module); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { + Py_DECREF(module); + module = NULL; + } +#else + py_code++; +#endif + return module; +} + +/* PatchGeneratorABC */ +#ifndef CYTHON_REGISTER_ABCS +#define CYTHON_REGISTER_ABCS 1 +#endif +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) +static PyObject* __Pyx_patch_abc_module(PyObject *module); +static PyObject* __Pyx_patch_abc_module(PyObject *module) { + module = __Pyx_Coroutine_patch_module( + module, "" +"if _cython_generator_type is not None:\n" +" try: Generator = _module.Generator\n" +" except AttributeError: pass\n" +" else: Generator.register(_cython_generator_type)\n" +"if _cython_coroutine_type is not None:\n" +" try: Coroutine = _module.Coroutine\n" +" except AttributeError: pass\n" +" else: Coroutine.register(_cython_coroutine_type)\n" + ); + return module; +} +#endif +static int __Pyx_patch_abc(void) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + static int abc_patched = 0; + if (CYTHON_REGISTER_ABCS && !abc_patched) { + PyObject *module; + module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); + if (!module) { + PyErr_WriteUnraisable(NULL); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, + ((PY_MAJOR_VERSION >= 3) ? + "Cython module failed to register with collections.abc module" : + "Cython module failed to register with collections module"), 1) < 0)) { + return -1; + } + } else { + module = __Pyx_patch_abc_module(module); + abc_patched = 1; + if (unlikely(!module)) + return -1; + Py_DECREF(module); + } + module = PyImport_ImportModule("backports_abc"); + if (module) { + module = __Pyx_patch_abc_module(module); + Py_XDECREF(module); + } + if (!module) { + PyErr_Clear(); + } + } +#else + if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); +#endif + return 0; +} + +/* Generator */ +static PyMethodDef __pyx_Generator_methods[] = { + {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, + (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, + (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, + (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + {0, 0, 0, 0} +}; +static PyMemberDef __pyx_Generator_memberlist[] = { + {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, + {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, + {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, + {0, 0, 0, 0, 0} +}; +static PyGetSetDef __pyx_Generator_getsets[] = { + {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + (char*) PyDoc_STR("name of the generator"), 0}, + {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + (char*) PyDoc_STR("qualified name of the generator"), 0}, + {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, + (char*) PyDoc_STR("Frame of the generator"), 0}, + {0, 0, 0, 0, 0} +}; +static PyTypeObject __pyx_GeneratorType_type = { + PyVarObject_HEAD_INIT(0, 0) + "generator", + sizeof(__pyx_CoroutineObject), + 0, + (destructor) __Pyx_Coroutine_dealloc, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + 0, + (traverseproc) __Pyx_Coroutine_traverse, + 0, + 0, + offsetof(__pyx_CoroutineObject, gi_weakreflist), + 0, + (iternextfunc) __Pyx_Generator_Next, + __pyx_Generator_methods, + __pyx_Generator_memberlist, + __pyx_Generator_getsets, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if CYTHON_USE_TP_FINALIZE + 0, +#else + __Pyx_Coroutine_del, +#endif + 0, +#if CYTHON_USE_TP_FINALIZE + __Pyx_Coroutine_del, +#elif PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, +#endif +}; +static int __pyx_Generator_init(void) { + __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); + if (unlikely(!__pyx_GeneratorType)) { + return -1; + } + return 0; +} + +/* CheckBinaryVersion */ +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/opendbc/can/parser_pyx.pyx b/opendbc/can/parser_pyx.pyx new file mode 100644 index 000000000..b5f381962 --- /dev/null +++ b/opendbc/can/parser_pyx.pyx @@ -0,0 +1,187 @@ +# distutils: language = c++ +# cython: c_string_encoding=ascii, language_level=3 + +from libcpp.string cimport string +from libcpp.vector cimport vector +from libcpp.unordered_set cimport unordered_set +from libc.stdint cimport uint32_t, uint64_t, uint16_t +from libcpp cimport bool +from libcpp.map cimport map + +from .common cimport CANParser as cpp_CANParser +from .common cimport SignalParseOptions, MessageParseOptions, dbc_lookup, SignalValue, DBC + +import os +import numbers +from collections import defaultdict + +cdef int CAN_INVALID_CNT = 5 + + +cdef class CANParser: + cdef: + cpp_CANParser *can + const DBC *dbc + map[string, uint32_t] msg_name_to_address + map[uint32_t, string] address_to_msg_name + vector[SignalValue] can_values + + cdef readonly: + dict vl + dict vl_all + bool can_valid + string dbc_name + int can_invalid_cnt + + def __init__(self, dbc_name, signals, checks=None, bus=0, enforce_checks=True): + if checks is None: + checks = [] + + self.dbc_name = dbc_name + self.dbc = dbc_lookup(dbc_name) + if not self.dbc: + raise RuntimeError(f"Can't find DBC: {dbc_name}") + + self.vl = {} + self.vl_all = {} + self.can_valid = False + self.can_invalid_cnt = CAN_INVALID_CNT + + cdef int i + cdef int num_msgs = self.dbc[0].num_msgs + for i in range(num_msgs): + msg = self.dbc[0].msgs[i] + name = msg.name.decode('utf8') + + self.msg_name_to_address[name] = msg.address + self.address_to_msg_name[msg.address] = name + self.vl[msg.address] = {} + self.vl[name] = self.vl[msg.address] + self.vl_all[msg.address] = defaultdict(list) + self.vl_all[name] = self.vl_all[msg.address] + + # Convert message names into addresses + for i in range(len(signals)): + s = signals[i] + if not isinstance(s[1], numbers.Number): + name = s[1].encode('utf8') + s = (s[0], self.msg_name_to_address[name]) + signals[i] = s + + for i in range(len(checks)): + c = checks[i] + if not isinstance(c[0], numbers.Number): + name = c[0].encode('utf8') + c = (self.msg_name_to_address[name], c[1]) + checks[i] = c + + if enforce_checks: + checked_addrs = {c[0] for c in checks} + signal_addrs = {s[1] for s in signals} + unchecked = signal_addrs - checked_addrs + if len(unchecked): + err_msg = ', '.join(f"{self.address_to_msg_name[addr].decode()} ({hex(addr)})" for addr in unchecked) + raise RuntimeError(f"Unchecked addrs: {err_msg}") + + cdef vector[SignalParseOptions] signal_options_v + cdef SignalParseOptions spo + for sig_name, sig_address in signals: + spo.address = sig_address + spo.name = sig_name + signal_options_v.push_back(spo) + + message_options = dict((address, 0) for _, address in signals) + message_options.update(dict(checks)) + + cdef vector[MessageParseOptions] message_options_v + cdef MessageParseOptions mpo + for msg_address, freq in message_options.items(): + mpo.address = msg_address + mpo.check_frequency = freq + message_options_v.push_back(mpo) + + self.can = new cpp_CANParser(bus, dbc_name, message_options_v, signal_options_v) + self.update_vl() + + cdef unordered_set[uint32_t] update_vl(self): + cdef unordered_set[uint32_t] updated_addrs + + # Update invalid flag + self.can_invalid_cnt += 1 + if self.can.can_valid: + self.can_invalid_cnt = 0 + self.can_valid = self.can_invalid_cnt < CAN_INVALID_CNT + + new_vals = self.can.query_latest() + for cv in new_vals: + # Cast char * directly to unicode + cv_name = cv.name + self.vl[cv.address][cv_name] = cv.value + self.vl_all[cv.address][cv_name].extend(cv.all_values) + updated_addrs.insert(cv.address) + + return updated_addrs + + def update_string(self, dat, sendcan=False): + for v in self.vl_all.values(): + v.clear() + + self.can.update_string(dat, sendcan) + return self.update_vl() + + def update_strings(self, strings, sendcan=False): + for v in self.vl_all.values(): + v.clear() + + updated_addrs = set() + for s in strings: + self.can.update_string(s, sendcan) + updated_addrs.update(self.update_vl()) + return updated_addrs + + +cdef class CANDefine(): + cdef: + const DBC *dbc + + cdef public: + dict dv + string dbc_name + + def __init__(self, dbc_name): + self.dbc_name = dbc_name + self.dbc = dbc_lookup(dbc_name) + if not self.dbc: + raise RuntimeError(f"Can't find DBC: '{dbc_name}'") + + num_vals = self.dbc[0].num_vals + + address_to_msg_name = {} + + num_msgs = self.dbc[0].num_msgs + for i in range(num_msgs): + msg = self.dbc[0].msgs[i] + name = msg.name.decode('utf8') + address = msg.address + address_to_msg_name[address] = name + + dv = defaultdict(dict) + + for i in range(num_vals): + val = self.dbc[0].vals[i] + + sgname = val.name.decode('utf8') + def_val = val.def_val.decode('utf8') + address = val.address + msgname = address_to_msg_name[address] + + # separate definition/value pairs + def_val = def_val.split() + values = [int(v) for v in def_val[::2]] + defs = def_val[1::2] + + # two ways to lookup: address or msg name + dv[address][sgname] = dict(zip(values, defs)) + dv[msgname][sgname] = dv[address][sgname] + + self.dv = dict(dv) diff --git a/opendbc/can/parser_pyx.so b/opendbc/can/parser_pyx.so new file mode 100755 index 000000000..201e31d6f Binary files /dev/null and b/opendbc/can/parser_pyx.so differ diff --git a/opendbc/can/process_dbc.py b/opendbc/can/process_dbc.py new file mode 100755 index 000000000..04a67db95 --- /dev/null +++ b/opendbc/can/process_dbc.py @@ -0,0 +1,131 @@ +#!/usr/bin/env python3 +from __future__ import print_function +import os +import sys + +import jinja2 + +from collections import Counter +from opendbc.can.dbc import dbc + +def process(in_fn, out_fn): + dbc_name = os.path.split(out_fn)[-1].replace('.cc', '') + # print("processing %s: %s -> %s" % (dbc_name, in_fn, out_fn)) + + template_fn = os.path.join(os.path.dirname(__file__), "dbc_template.cc") + + with open(template_fn, "r") as template_f: + template = jinja2.Template(template_f.read(), trim_blocks=True, lstrip_blocks=True) + + can_dbc = dbc(in_fn) + + # process counter and checksums first + msgs = [(address, msg_name, msg_size, sorted(msg_sigs, key=lambda s: s.name not in ("COUNTER", "CHECKSUM"))) + for address, ((msg_name, msg_size), msg_sigs) in sorted(can_dbc.msgs.items()) if msg_sigs] + + def_vals = {a: sorted(set(b)) for a, b in can_dbc.def_vals.items()} # remove duplicates + def_vals = sorted(def_vals.items()) + + if can_dbc.name.startswith(("honda_", "acura_")): + checksum_type = "honda" + checksum_size = 4 + counter_size = 2 + checksum_start_bit = 3 + counter_start_bit = 5 + little_endian = False + elif can_dbc.name.startswith(("toyota_", "lexus_")): + checksum_type = "toyota" + checksum_size = 8 + counter_size = None + checksum_start_bit = 7 + counter_start_bit = None + little_endian = False + elif can_dbc.name.startswith(("vw_", "volkswagen_", "audi_", "seat_", "skoda_")): + checksum_type = "volkswagen" + checksum_size = 8 + counter_size = 4 + checksum_start_bit = 0 + counter_start_bit = 0 + little_endian = True + elif can_dbc.name.startswith(("subaru_global_")): + checksum_type = "subaru" + checksum_size = 8 + counter_size = None + checksum_start_bit = 0 + counter_start_bit = None + little_endian = True + elif can_dbc.name.startswith(("chrysler_", "stellantis_")): + checksum_type = "chrysler" + checksum_size = 8 + counter_size = None + checksum_start_bit = 7 + counter_start_bit = None + little_endian = False + else: + checksum_type = None + checksum_size = None + counter_size = None + checksum_start_bit = None + counter_start_bit = None + little_endian = None + + # sanity checks on expected COUNTER and CHECKSUM rules, as packer and parser auto-compute those signals + for address, msg_name, _, sigs in msgs: + dbc_msg_name = dbc_name + " " + msg_name + for sig in sigs: + if checksum_type is not None: + # checksum rules + if sig.name == "CHECKSUM": + if sig.size != checksum_size: + sys.exit("%s: CHECKSUM is not %d bits long" % (dbc_msg_name, checksum_size)) + if sig.start_bit % 8 != checksum_start_bit: + sys.exit("%s: CHECKSUM starts at wrong bit" % dbc_msg_name) + if little_endian != sig.is_little_endian: + sys.exit("%s: CHECKSUM has wrong endianness" % dbc_msg_name) + # counter rules + if sig.name == "COUNTER": + if counter_size is not None and sig.size != counter_size: + sys.exit("%s: COUNTER is not %d bits long" % (dbc_msg_name, counter_size)) + if counter_start_bit is not None and sig.start_bit % 8 != counter_start_bit: + print(counter_start_bit, sig.start_bit) + sys.exit("%s: COUNTER starts at wrong bit" % dbc_msg_name) + if little_endian != sig.is_little_endian: + sys.exit("%s: COUNTER has wrong endianness" % dbc_msg_name) + # pedal rules + if address in [0x200, 0x201]: + if sig.name == "COUNTER_PEDAL" and sig.size != 4: + sys.exit("%s: PEDAL COUNTER is not 4 bits long" % dbc_msg_name) + if sig.name == "CHECKSUM_PEDAL" and sig.size != 8: + sys.exit("%s: PEDAL CHECKSUM is not 8 bits long" % dbc_msg_name) + + # Fail on duplicate message names + c = Counter([msg_name for address, msg_name, msg_size, sigs in msgs]) + for name, count in c.items(): + if count > 1: + sys.exit("%s: Duplicate message name in DBC file %s" % (dbc_name, name)) + + parser_code = template.render(dbc=can_dbc, checksum_type=checksum_type, msgs=msgs, def_vals=def_vals, len=len) + + with open(out_fn, "a+") as out_f: + out_f.seek(0) + if out_f.read() != parser_code: + out_f.seek(0) + out_f.truncate() + out_f.write(parser_code) + +def main(): + if len(sys.argv) != 3: + print("usage: %s dbc_directory output_filename" % (sys.argv[0],)) + sys.exit(0) + + dbc_dir = sys.argv[1] + out_fn = sys.argv[2] + + dbc_name = os.path.split(out_fn)[-1].replace('.cc', '') + in_fn = os.path.join(dbc_dir, dbc_name + '.dbc') + + process(in_fn, out_fn) + + +if __name__ == '__main__': + main() diff --git a/opendbc/chrysler_pacifica_2017_hybrid.dbc b/opendbc/chrysler_pacifica_2017_hybrid.dbc new file mode 100644 index 000000000..245eefb8b --- /dev/null +++ b/opendbc/chrysler_pacifica_2017_hybrid.dbc @@ -0,0 +1,436 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + + +BO_ 258 STEERING: 8 XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ UNKNOWN_STEERING : 50|3@0+ (1,0) [0|15] "" XXX + SG_ STEERING_RATE : 20|13@0+ (0.3187251,-1305.498) [0|8191] "deg/s" XXX + SG_ STEER_ANGLE : 4|13@0+ (0.3187251,-1307.888) [-360|360] "deg" XXX + +BO_ 514 SPEED_1: 8 XXX + SG_ SPEED_LEFT : 7|12@0+ (0.071028,0) [0|65535] "m/s" XXX + SG_ SPEED_RIGHT : 23|12@0+ (0.071028,0) [0|1023] "m/s" XXX + +BO_ 653 BRAKE_MODULE: 2 XXX + SG_ BRAKE_PRESSURE : 15|8@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_PRESSED : 4|1@0+ (1,0) [0|4] "" XXX + +BO_ 820 DOORS: 8 XXX + SG_ DOOR_OPEN_FR : 18|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 19|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 20|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_TRUNK : 22|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FL : 17|1@0+ (1,0) [0|1] "" XXX + SG_ TURN_LIGHT_LEFT : 31|1@0+ (1,0) [0|1] "" XXX + SG_ TURN_LIGHT_RIGHT : 30|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAM_DISPLAY : 58|1@0+ (1,0) [0|1] "" XXX + +BO_ 746 GEAR: 5 XXX + SG_ PRNDL : 2|3@0+ (1,0) [0|7] "" XXX + SG_ GEAR_CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 31|4@0+ (1,0) [0|15] "" XXX + +BO_ 284 BRAKE_1: 8 XXX + SG_ SPEED_RELATED_1 : 37|14@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_RELATED_1_2 : 18|11@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_RELATED_1_1 : 3|12@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 320 BRAKE_2: 8 XXX + SG_ SPEED_RELATED_2 : 47|8@0+ (1,0) [0|63] "" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_PRESSED_2 : 2|3@0+ (1,0) [0|7] "" XXX + SG_ BRAKE_PRESSED_ACC : 6|1@0+ (1,0) [0|3] "" XXX + +BO_ 736 TRIP: 8 XXX + SG_ COUNTER : 7|16@0+ (1,0) [0|65535] "Meters" XXX + SG_ COUNTER_2 : 23|16@0+ (1,0) [0|65535] "Meters" XXX + +BO_ 344 WHEEL_SPEEDS: 8 XXX + SG_ WHEEL_SPEED_FL : 3|12@0+ (0.0189408,0) [0|65535] "m/s" XXX + SG_ WHEEL_SPEED_RR : 51|12@0+ (0.0189408,0) [0|255] "m/s" XXX + SG_ WHEEL_SPEED_RL : 35|12@0+ (0.0189408,0) [0|3] "m/s" XXX + SG_ WHEEL_SPEED_FR : 19|12@0+ (0.0189408,0) [0|255] "m/s" XXX + +BO_ 792 STEERING_LEVERS: 8 XXX + SG_ HIGH_BEAM_PUSHED_IN : 2|1@0+ (1,0) [0|3] "" XXX + SG_ TURN_SIGNALS : 1|2@0+ (1,0) [0|3] "" XXX + SG_ HIGH_BEAM_FLASH : 3|1@0+ (1,0) [0|3] "" XXX + +BO_ 264 ACCEL_PEDAL_MSG: 8 XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_PEDAL : 35|1@0+ (1,0) [0|1] "" XXX + +BO_ 464 SEATBELT_STATUS: 8 XXX + SG_ SEATBELT_DRIVER_UNLATCHED : 13|1@0+ (1,0) [0|1] "" XXX + +BO_ 544 EPS_STATUS: 8 XXX + SG_ LKAS_STATE : 23|4@0+ (1,0) [0|15] "" XXX + SG_ TORQUE_DRIVER : 2|11@0+ (1,-1024) [-1024|1023] "" XXX + SG_ TORQUE_MOTOR_RAW : 19|12@0+ (1,-2048) [-2048|2047] "" XXX + SG_ TORQUE_MOTOR : 34|11@0+ (1,-1024) [-1024|1023] "" XXX + SG_ AUTO_PARK_HAS_CONTROL_2 : 51|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 658 LKAS_COMMAND: 6 XXX + SG_ COUNTER : 39|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 47|8@0+ (1,0) [0|255] "" XXX + SG_ LKAS_STEERING_TORQUE : 2|11@0+ (1,-1024) [0|1] "" XXX + SG_ LKAS_HIGH_TORQUE : 4|1@0+ (1,0) [0|1] "" XXX + +BO_ 678 LKAS_HUD: 8 XXX + SG_ LKAS_ICON_COLOR : 1|2@0+ (1,0) [0|3] "" XXX + SG_ LKAS_LANE_LINES : 19|4@0+ (1,0) [0|1] "" XXX + SG_ LKAS_ALERTS : 27|4@0+ (1,0) [0|1] "" XXX + SG_ CAR_MODEL : 15|8@0+ (1,0) [0|255] "" XXX + +BO_ 705 AUTO_PARK_BUTTON: 8 XXX + SG_ AUTO_PARK_TOGGLE_2 : 8|1@0+ (1,0) [0|1] "" XXX + SG_ AUTO_PARK_TOGGLE_1 : 11|1@0+ (1,0) [0|1] "" XXX + SG_ INCREASING_UNKNOWN : 38|7@0+ (1,0) [0|15] "" XXX + +BO_ 719 AUTO_PARK_SIGNALS_1: 8 XXX + SG_ AUTO_PARK_UNKNOWN_1 : 7|16@0+ (1,0) [0|31] "" XXX + +BO_ 671 AUTO_PARK_REQUEST: 8 XXX + SG_ AUTO_PARK_CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ AUTO_PARK_STATUS : 7|5@0+ (1,0) [0|15] "" XXX + SG_ AUTO_PARK_COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ AUTO_PARK_MODE : 22|2@0+ (1,0) [0|3] "" XXX + SG_ AUTO_PARK_CMD : 2|11@0+ (1,-1024) [0|1] "NM" XXX + +BO_ 784 AUTO_PARK_LESS_INTERESTING: 8 XXX + SG_ INCREASING_UNKNOWN : 55|8@0+ (1,0) [0|7] "" XXX + SG_ AUTO_PARK_PERPENDICULAR_2 : 61|1@0+ (1,0) [0|255] "" XXX + +BO_ 826 AUTO_PARK_SIGNALS_3: 8 XXX + SG_ AUTO_PARK_HAS_CONTROL_3 : 1|1@0+ (1,0) [0|1] "" XXX + SG_ HUMAN_HAS_CONTROL : 2|1@0+ (1,0) [0|1] "" XXX + SG_ AUTO_PARK_GEAR_1 : 27|4@0+ (1,0) [0|255] "" XXX + SG_ AUTO_PARK_GEAR_2 : 35|4@0+ (1,0) [0|15] "" XXX + SG_ AUTO_PARK_GEAR_3 : 51|4@0+ (1,0) [0|15] "" XXX + +BO_ 332 STEERING_2: 8 XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ ENERGY_RELATED : 39|16@0+ (1,0) [0|65535] "" XXX + SG_ STEER_ANGLE_2 : 7|13@0+ (0.3187251,-1307.888) [-360|360] "deg" XXX + +BO_ 720 BLIND_SPOT_WARNINGS: 6 XXX + SG_ BLIND_SPOT_RIGHT : 5|1@0+ (1,0) [0|1] "" XXX + SG_ BLIND_SPOT_LEFT : 2|1@0+ (1,0) [0|1] "" XXX + +BO_ 331 BRAKE_3: 8 XXX + SG_ BRAKE_RELATED_3 : 7|16@0+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 608 PARKSENSE_SIGNAL: 8 XXX + SG_ PARKSENSE_DISABLED : 34|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ IN_REVERSE : 10|1@0+ (1,0) [0|255] "" XXX + SG_ AUTO_PARK_HAS_CONTROL_1 : 16|1@0+ (1,0) [0|255] "" XXX + SG_ HUMAN_HAS_CONTROL : 17|1@0+ (1,0) [0|3] "" XXX + +BO_ 729 LKAS_HEARTBIT: 5 XXX + SG_ LKAS_STATUS_OK : 31|16@0+ (1,0) [0|65535] "" XXX + +BO_ 274 NEW_MSG_112: 2 XXX + +BO_ 290 NEW_MSG_122: 6 XXX + +BO_ 376 NEW_MSG_178: 3 XXX + +BO_ 288 ACCEL_RELATED_120: 7 XXX + SG_ COUNTER : 47|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 55|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL : 23|8@0+ (1,0) [0|255] "" XXX + SG_ GAS_ENGINE_RPM_MAYBE : 31|16@0+ (1,0) [0|65535] "" XXX + +BO_ 257 ACCEL_RELATED_101: 5 XXX + SG_ ENERGY_OR_RPM : 31|8@0+ (1,0) [0|255] "" XXX + +BO_ 388 NEW_MSG_184: 4 XXX + +BO_ 448 NEW_MSG_1c0: 6 XXX + +BO_ 456 NEW_MSG_1c8: 4 XXX + +BO_ 560 NEW_MSG_230: 4 XXX + +BO_ 564 NEW_MSG_234: 4 XXX + +BO_ 571 WHEEL_BUTTONS: 3 XXX + SG_ CHECKSUM : 23|8@0+ (1,0) [0|255] "" XXX + SG_ ACC_FOLLOW_DEC : 1|1@0+ (1,0) [0|3] "" XXX + SG_ ACC_SPEED_INC : 2|1@0+ (1,0) [0|255] "" XXX + SG_ ACC_SPEED_DEC : 3|1@0+ (1,0) [0|3] "" XXX + SG_ ACC_FOLLOW_INC : 8|1@0+ (1,0) [0|15] "" XXX + SG_ ACC_CANCEL : 0|1@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 15|4@0+ (1,0) [0|15] "" XXX + SG_ ACC_RESUME : 4|1@0+ (1,0) [0|15] "" XXX + +BO_ 669 NEW_MSG_29d: 3 XXX + SG_ COUNTER : 15|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 23|8@0+ (1,0) [0|255] "" XXX + +BO_ 825 AUDIBLE_BEEP_339: 2 XXX + SG_ BEEP_339 : 7|16@0+ (1,0) [0|65535] "" XXX + +BO_ 856 NEW_MSG_358: 4 XXX + +BO_ 860 NEW_MSG_35c: 6 XXX + +BO_ 924 NEW_MSG_39c: 3 XXX + +BO_ 969 NEW_MSG_3c9: 4 XXX + +BO_ 974 NEW_MSG_3ce: 5 XXX + +BO_ 993 NEW_MSG_3e1: 7 XXX + +BO_ 838 NEW_MSG_346: 2 XXX + +BO_ 926 NEW_MSG_39e: 3 XXX + +BO_ 168 ACCEL_RELATED_a8: 8 XXX + SG_ ACCEL_RELATED : 23|16@0+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 270 ACCEL_RELATED_10e: 8 XXX + SG_ ACCEL_OR_RPM : 7|16@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ELECTRIC_MOTOR : 23|16@0+ (1,0) [0|65535] "" XXX + +BO_ 291 ENERGY_RELATED_123: 8 XXX + SG_ ENERGY_GAIN_LOSS : 18|11@0- (1,0) [0|255] "" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ENERGY_SMOOTHER_CURVE : 35|12@0+ (1,0) [0|2047] "" XXX + +BO_ 294 ENERGY_RELATED_126: 8 XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ UNKNOWN_126_1 : 3|12@0+ (1,0) [0|4095] "" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ UNKNOWN_126_2 : 35|12@0+ (1,0) [0|4095] "" XXX + SG_ ENERGY_GAIN_LOSS_NOISY : 19|12@0+ (1,0) [0|2047] "" XXX + +BO_ 300 NEW_MSG_12C: 8 XXX + +BO_ 308 ACCEL_GAS_134: 8 XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ ACCEL_134 : 46|7@0+ (1,0) [0|127] "" XXX + +BO_ 532 ENERGY_RELATED_214: 8 XXX + SG_ NOISY_SLOWLY_DECREASING : 16|9@0+ (1,0) [0|255] "" XXX + SG_ ENERGY_RELATED : 0|9@0+ (1,0) [0|255] "" XXX + +BO_ 559 ACCEL_GAS_22F: 8 XXX + SG_ ACCEL_22F : 3|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 655 CHARGING_MAYBE_28F: 8 XXX + SG_ CHARGING : 1|2@0+ (1,0) [0|3] "" XXX + +BO_ 660 BRAKE_RELATED_294: 8 XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_PERHAPS_294 : 31|8@0+ (1,0) [0|255] "" XXX + +BO_ 764 ACCEL_RELATED_2FC: 8 XXX + SG_ ACCEL_2FC : 13|6@0+ (1,0) [0|255] "" XXX + +BO_ 816 TRACTION_BUTTON: 8 XXX + SG_ TRACTION_OFF : 19|1@0+ (1,0) [0|3] "" XXX + SG_ TOGGLE_PARKSENSE : 52|1@0+ (1,0) [0|3] "" XXX + +BO_ 878 ACCEL_RELATED_36E: 8 XXX + SG_ ACCEL_OR_RPM_2 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_OR_RPM_1 : 7|8@0+ (1,0) [0|255] "" XXX + +BO_ 324 SPEED_2: 8 XXX + SG_ SPEED_2 : 31|16@0+ (0.01,0) [0|255] "m/s" XXX + +BO_ 501 DASHBOARD: 8 XXX + SG_ ACC_SPEED_CONFIG_KPH : 15|8@0+ (1,0) [0|3] "km/h" XXX + SG_ ACC_SPEED_CONFIG_MPH : 23|8@0+ (1,0) [0|3] "mph" XXX + SG_ ACC_DISTANCE_CONFIG_1 : 1|2@0+ (1,0) [0|3] "" XXX + SG_ ACC_DISTANCE_CONFIG_2 : 41|2@0+ (1,0) [0|3] "" XXX + SG_ SPEED_DIGITAL : 63|8@0+ (1,0) [0|255] "mph" XXX + SG_ CRUISE_STATE : 38|3@0+ (1,0) [0|7] "" XXX + +BO_ 639 NEW_MSG_27f: 8 XXX + SG_ INCREASING : 47|8@0+ (1,0) [0|255] "" XXX + +BO_ 701 NEW_MSG_2bd: 8 XXX + SG_ unknown_1 : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 832 UNKNOWN_340: 8 XXX + SG_ SPEED_DIGITAL : 63|8@0+ (1,0) [0|255] "mph" XXX + +BO_ 848 UNKNOWN_350: 8 XXX + SG_ INCREASING_LSB : 5|6@0+ (1,0) [0|255] "" XXX + SG_ INCREASING_MSB : 12|5@0+ (1,0) [0|31] "" XXX + +BO_ 908 NEW_MSG_38c: 8 XXX + SG_ INCREASING_MSB : 44|5@0+ (1,0) [0|31] "" XXX + SG_ INCREASING_LSB : 61|6@0+ (1,0) [0|255] "" XXX + +BO_ 938 NEW_MSG_3aa: 8 XXX + SG_ INCREASING_UNKNOWN_1 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ INCREASING_UNKNOWN_2 : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 940 NEW_MSG_3ac: 8 XXX + SG_ INCREASING_1 : 35|4@0+ (1,0) [0|15] "" XXX + SG_ INCREASING_2 : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 941 NEW_MSG_3ad: 8 XXX + SG_ INCREASING_1 : 36|5@0+ (1,0) [0|31] "" XXX + SG_ INCREASING_2 : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 500 ACC_2: 8 XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ ACC_STATUS_1 : 7|3@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_MAYBE : 18|11@0+ (1,0) [0|255] "" XXX + SG_ ACC_STATUS_2 : 21|3@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_BOOL_1 : 36|1@0+ (1,0) [0|3] "" XXX + +BO_ 625 ACC_1: 8 XXX + SG_ SPEED : 31|8@0+ (1,0) [0|255] "km/h" XXX + SG_ ACCEL_PERHAPS : 39|16@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + +BO_ 268 ACC_10c: 8 XXX + SG_ BRAKE_PERHAPS : 48|1@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 384 NEW_MSG_180: 8 XXX + SG_ NEW_SIGNAL_2 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 7|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_3 : 39|8@0+ (1,0) [0|3] "" XXX + +BO_ 853 NEW_MSG_355: 8 XXX + +BO_ 939 NEW_MSG_3ab: 8 XXX + +BO_ 512 NEW_MSG_200: 8 XXX + SG_ NEW_SIGNAL_1 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ INCREASING : 27|12@0+ (1,0) [0|127] "" XXX + SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + + + + +CM_ SG_ 258 UNKNOWN_STEERING "never goes above 4. see if human-applied torque"; +CM_ SG_ 258 STEER_ANGLE "positive is left (counter-clockwise)"; +CM_ SG_ 514 SPEED_LEFT "TODO find upper limit"; +CM_ SG_ 653 BRAKE_PRESSURE "max seems to be 148"; +CM_ SG_ 820 TURN_LIGHT_LEFT "oscillates with the light blinking"; +CM_ SG_ 820 TURN_LIGHT_RIGHT "hazard blinks both right and left lights"; +CM_ SG_ 746 PRNDL "5=L, 4=D, 3=N, 2=R, 1=P"; +CM_ SG_ 746 GEAR_CHECKSUM "different than the LKAS checksum. unknown non-simple algorithm. just build a lookup table for it."; +CM_ SG_ 284 SPEED_RELATED_1 "Another Speed Signal, Maybe RPMs?"; +CM_ SG_ 284 BRAKE_RELATED_1_1 "Correlates with braking"; +CM_ SG_ 320 BRAKE_PRESSED_2 "Value is 5 when brake is pressed by human, 1 when ACC brake"; +CM_ SG_ 320 BRAKE_PRESSED_ACC "set when ACC brakes"; +CM_ SG_ 792 TURN_SIGNALS "1=Left, 2=Right"; +CM_ SG_ 792 HIGH_BEAM_FLASH "use this for genericToggle"; +CM_ SG_ 264 ACCEL_PEDAL "not in ACC so seems to be actual pedal. Use for gasPressed"; +CM_ SG_ 544 LKAS_STATE "2 when autopark has control, 8 when is actuatable by lkas, 4 when there is a fault"; +CM_ SG_ 544 TORQUE_MOTOR_RAW "has larger range than TORQUE_MOTOR but ut seems biased"; +CM_ SG_ 658 COUNTER "each message increments, 0..f"; +CM_ SG_ 658 CHECKSUM "checksum calculated with https://gist.github.com/adhintz/94bf8d19b9075539f50172ab0fb24ba1"; +CM_ SG_ 658 LKAS_STEERING_TORQUE "Most sent by stock system is 1024+-230. + is left. typically changes by 2 or 3 each 0.01s"; +CM_ SG_ 678 LKAS_ICON_COLOR "3 is yellow, 2 is green, 1 is white, 0 is null"; +CM_ SG_ 678 LKAS_LANE_LINES "0x01 transparent lines, 0x02 left white, 0x03 right white, 0x04 left yellow with car on top, 0x05 left yellow with car on top, 0x06 both white, 0x07 left yellow, 0x08 left yellow right white, 0x09 right yellow, 0x0a right yellow left white, 0x0b left yellow with car on top right white, 0x0c right yellow with car on top left white, (0x00, 0x0d, 0x0e, 0x0f) null"; +CM_ SG_ 678 LKAS_ALERTS "(0x01, 0x02) lane sense off, (0x03, 0x04, 0x06) place hands on steering wheel, 0x07 lane departure detected + place hands on steering wheel, (0x08, 0x09) lane sense unavailable + clean front windshield, 0x0b lane sense and auto high beam unavailable + clean front windshield, 0x0c lane sense unavailable + service required, (0x00, 0x05, 0x0a, 0x0d, 0x0e, 0x0f) null"; +CM_ SG_ 705 AUTO_PARK_TOGGLE_1 "set briefly when turning on or off self-parking"; +CM_ SG_ 705 INCREASING_UNKNOWN "sometimes decreasing"; +CM_ SG_ 671 AUTO_PARK_CMD "Request Appears to be in NM"; +CM_ SG_ 671 AUTO_PARK_STATUS "1 = IDLE / NO REQUEST 9 = START REQUEST 10 = REQUEST MODE 11 = REQUEST MODE"; +CM_ SG_ 784 INCREASING_UNKNOWN "perhaps distance traveled"; +CM_ SG_ 826 AUTO_PARK_GEAR_1 "Reverse=0, Forward=f"; +CM_ SG_ 826 AUTO_PARK_GEAR_2 "Reverse=0, Forward=f"; +CM_ SG_ 826 AUTO_PARK_GEAR_3 "Reverse=0, Forward=f"; +CM_ SG_ 332 STEER_ANGLE_2 "slightly lags the other steer_angle signal. also more noisy."; +CM_ SG_ 720 BLIND_SPOT_RIGHT "yellow triangle alert on side view mirror when a car is in your blind spot"; +CM_ SG_ 608 PARKSENSE_DISABLED "set if parksense is disabled"; +CM_ SG_ 729 LKAS_STATUS_OK "Set to 0x0820 when LKAS system is plugged in."; +CM_ SG_ 288 UNKNOWN_CHECKSUM "not the LKAS checksum"; +CM_ SG_ 288 GAS_ENGINE_RPM_MAYBE "lags acceleration, perhaps gas engine"; +CM_ SG_ 257 ENERGY_OR_RPM "perhaps energy consumption or RPMs"; +CM_ SG_ 571 CHECKSUM "standard checksum"; +CM_ SG_ 825 BEEP_339 "sent every 0.5s. 0050 is no beep. To beep send 4355 or 4155. Used by ParkSense warning."; +CM_ SG_ 270 ELECTRIC_MOTOR "0x7fff indicates electric motor not in use"; +CM_ SG_ 291 ENERGY_GAIN_LOSS "unsure what this actually is"; +CM_ SG_ 291 ENERGY_SMOOTHER_CURVE "unsure what it is, but smoother"; +CM_ SG_ 308 ACCEL_134 "only set when human presses accel pedal"; +CM_ SG_ 532 NOISY_SLOWLY_DECREASING "perhaps battery but do not know"; +CM_ SG_ 816 TRACTION_OFF "set when traction off button is enabled"; +CM_ SG_ 816 TOGGLE_PARKSENSE "sending 3000071ec0ff9000 enables or disables parksense"; +CM_ SG_ 324 SPEED_2 "signal is approx half other speeds"; +CM_ SG_ 501 ACC_SPEED_CONFIG_KPH "speed configured for ACC"; +CM_ SG_ 501 ACC_SPEED_CONFIG_MPH "speed configured for ACC"; +CM_ SG_ 639 INCREASING "perhaps number of seconds divided by two for this drive"; +CM_ SG_ 848 INCREASING_LSB "lower part of time counter"; +CM_ SG_ 848 INCREASING_MSB "upper part of time counter"; +CM_ SG_ 908 INCREASING_MSB "time based"; +CM_ SG_ 500 ACC_STATUS_1 "2 briefly (9 packets) when ACC goes to green, 1 help when ACC coming to a stop and at a stop"; +CM_ SG_ 500 BRAKE_MAYBE "2046 in non-ACC and non-decel. Signal on deceleration. 818 for already stopped break."; +CM_ SG_ 500 ACC_STATUS_2 "set to 1 in non-ACC, 3 when ACC enabled (white icon), and 7 when ACC in use (green icon)"; +CM_ SG_ 500 BRAKE_BOOL_1 "set to 1 when ACC decel. 0 on non-ACC and accel."; +CM_ SG_ 501 CRUISE_STATE "may just be an icon, but seems to indicate different cruise modes: ACC and Non-ACC and engaged state for both."; +CM_ SG_ 625 SPEED "zero on non-acc drives"; +CM_ SG_ 625 ACCEL_PERHAPS "set to 7767 on non-ACC drives. ACC drive 40k is constant speed, 42k is accelerating"; +CM_ SG_ 268 BRAKE_PERHAPS "triggers only on ACC braking"; +CM_ SG_ 384 NEW_SIGNAL_1 "set in ACC gas driving. not set in electric human. not sure about gas human driving."; +VAL_ 501 CRUISE_STATE 0 "Off" 1 "CC On" 2 "CC Engaged" 3 "ACC On" 4 "ACC Engaged"; +VAL_ 746 PRNDL 5 "L" 4 "D" 3 "N" 2 "R" 1 "P" ; +VAL_ 792 TURN_SIGNALS 2 "Right" 1 "Left" ; diff --git a/opendbc/chrysler_pacifica_2017_hybrid_private_fusion.dbc b/opendbc/chrysler_pacifica_2017_hybrid_private_fusion.dbc new file mode 100644 index 000000000..07c37e1fa --- /dev/null +++ b/opendbc/chrysler_pacifica_2017_hybrid_private_fusion.dbc @@ -0,0 +1,230 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + + +BO_ 544 a_1: 8 XXX + SG_ track_id : 7|4@0+ (1,0) [0|15] "" XXX + SG_ REL_ACCEL : 3|12@0+ (1,0) [0|31] "" XXX + SG_ status1 : 23|4@0+ (1,0) [0|15] "" XXX + SG_ REL_SPEED : 19|12@0+ (1,0) [0|65535] "" XXX + SG_ status2 : 39|6@0+ (1,0) [0|15] "" XXX + SG_ sig2 : 33|10@0+ (1,0) [0|255] "" XXX + SG_ zeros : 55|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 576 b_1: 8 XXX + SG_ sig0 : 7|8@0+ (1,0) [0|255] "" XXX + SG_ sig1 : 15|16@0+ (1,0) [0|65535] "" XXX + SG_ sig2 : 31|16@0+ (1,0) [0|255] "" XXX + SG_ zeros : 47|12@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 608 a_2: 8 XXX + SG_ track_id : 7|4@0+ (1,0) [0|15] "" XXX + SG_ REL_ACCEL : 3|12@0+ (1,0) [0|31] "" XXX + SG_ status1 : 23|4@0+ (1,0) [0|15] "" XXX + SG_ REL_SPEED : 19|12@0+ (1,0) [0|65535] "" XXX + SG_ status2 : 39|6@0+ (1,0) [0|15] "" XXX + SG_ sig2 : 33|10@0+ (1,0) [0|255] "" XXX + SG_ zeros : 55|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 640 b_2: 8 XXX + SG_ sig0 : 7|8@0+ (1,0) [0|255] "" XXX + SG_ sig1 : 15|16@0+ (1,0) [0|65535] "" XXX + SG_ sig2 : 31|16@0+ (1,0) [0|255] "" XXX + SG_ zeros : 47|12@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 644 a_3: 8 XXX + SG_ track_id : 7|4@0+ (1,0) [0|15] "" XXX + SG_ REL_ACCEL : 3|12@0+ (1,0) [0|31] "" XXX + SG_ status1 : 23|4@0+ (1,0) [0|15] "" XXX + SG_ REL_SPEED : 19|12@0+ (1,0) [0|65535] "" XXX + SG_ status2 : 39|6@0+ (1,0) [0|15] "" XXX + SG_ sig2 : 33|10@0+ (1,0) [0|255] "" XXX + SG_ zeros : 55|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 648 b_3: 8 XXX + SG_ sig0 : 7|8@0+ (1,0) [0|255] "" XXX + SG_ sig1 : 15|16@0+ (1,0) [0|65535] "" XXX + SG_ sig2 : 31|16@0+ (1,0) [0|255] "" XXX + SG_ zeros : 47|12@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 652 a_4: 8 XXX + SG_ track_id : 7|4@0+ (1,0) [0|15] "" XXX + SG_ REL_ACCEL : 3|12@0+ (1,0) [0|31] "" XXX + SG_ status1 : 23|4@0+ (1,0) [0|15] "" XXX + SG_ REL_SPEED : 19|12@0+ (1,0) [0|65535] "" XXX + SG_ status2 : 39|6@0+ (1,0) [0|15] "" XXX + SG_ sig2 : 33|10@0+ (1,0) [0|255] "" XXX + SG_ zeros : 55|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 656 b_4: 8 XXX + SG_ sig0 : 7|8@0+ (1,0) [0|255] "" XXX + SG_ sig1 : 15|16@0+ (1,0) [0|65535] "" XXX + SG_ sig2 : 31|16@0+ (1,0) [0|255] "" XXX + SG_ zeros : 47|12@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 512 unknown_200: 8 XXX + SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ increasing : 31|16@0+ (1,0) [0|255] "" XXX + SG_ zeros_0 : 3|12@0+ (1,0) [0|63] "" XXX + SG_ zeros_1 : 47|12@0+ (1,0) [0|63] "" XXX + SG_ status0 : 7|4@0+ (1,0) [0|15] "" XXX + SG_ unknown_0 : 23|8@0+ (1,0) [0|255] "" XXX + +BO_ 514 unknown_202: 8 XXX + SG_ COUNTER : 43|4@0+ (1,0) [0|15] "" XXX + SG_ sig3 : 31|8@0+ (1,0) [0|65535] "" XXX + SG_ increasing : 39|12@0+ (1,0) [0|15] "" XXX + +BO_ 706 c_1: 8 XXX + SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX + +BO_ 708 c_2: 8 XXX + SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX + SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 710 c_3: 8 XXX + SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX + SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 712 c_4: 8 XXX + SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX + SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 714 c_5: 8 XXX + SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX + SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 716 c_6: 8 XXX + SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX + SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 718 c_7: 8 XXX + SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX + SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 720 c_8: 8 XXX + SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX + SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 722 c_9: 8 XXX + SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX + SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 724 c_10: 8 XXX + SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX + SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 674 d_1: 8 XXX + SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX + +BO_ 676 d_2: 8 XXX + SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX + +BO_ 678 d_3: 8 XXX + SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX + +BO_ 680 d_4: 8 XXX + SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX + +BO_ 682 d_5: 8 XXX + SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX + +BO_ 684 d_6: 8 XXX + SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX + +BO_ 686 d_7: 8 XXX + SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX + +BO_ 688 d_8: 8 XXX + SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX + +BO_ 690 d_9: 8 XXX + SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX + +BO_ 692 d_10: 8 XXX + SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX + +BO_ 672 NEW_MSG_5: 8 XXX + SG_ NEW_SIGNAL_1 : 9|10@0+ (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_2 : 45|10@0+ (1,0) [0|1023] "" XXX + + + + +CM_ SG_ 544 track_id "for message a_1 track_id is always 1, similar for other messages and track_id"; +CM_ SG_ 544 REL_ACCEL "perhaps REL_ACCEL because it responds faster and before REL_SPEED"; +CM_ SG_ 544 sig2 "perhaps distance to object. LONG_DIST or REL_ACCEL or REL_SPEED"; +CM_ SG_ 576 zeros "not always zero, sometimes has value when another car changes lanes"; +CM_ SG_ 706 LAT_DIST "positive is to the right, negative is to the left"; diff --git a/opendbc/ford_fusion_2018_adas.dbc b/opendbc/ford_fusion_2018_adas.dbc new file mode 100644 index 000000000..2e1647b3d --- /dev/null +++ b/opendbc/ford_fusion_2018_adas.dbc @@ -0,0 +1,421 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + +BO_ 1280 Object_00: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1281 Object_01: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1282 Object_02: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1283 Object_03: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1284 Object_04: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1285 Object_05: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1286 Object_06: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1287 Object_07: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1288 Object_08: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1289 Object_09: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1290 Object_10: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1291 Object_11: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1292 Object_12: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1293 Object_13: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1294 Object_14: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1295 Object_15: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1296 Object_16: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1297 Object_17: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1298 Object_18: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1299 Object_19: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1300 Object_20: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1301 Object_21: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1302 Object_22: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1303 Object_23: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1304 Object_24: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1305 Object_25: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1306 Object_26: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1307 Object_27: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1308 Object_28: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1309 Object_29: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1310 Object_30: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1311 Object_31: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1312 Object_32: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1313 Object_33: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1314 Object_34: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1315 Object_35: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1316 Object_36: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1317 Object_37: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1318 Object_38: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1319 Object_39: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1320 Object_40: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1321 Object_41: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1322 Object_42: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1323 Object_43: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1324 Object_44: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1325 Object_45: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1326 Object_46: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1327 Object_47: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1328 Object_48: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1329 Object_49: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1330 Object_50: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1331 Object_51: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1332 Object_52: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1333 Object_53: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1334 Object_54: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1335 Object_55: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1336 Object_56: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1337 Object_57: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1338 Object_58: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1339 Object_59: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1340 Object_60: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1341 Object_61: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1342 Object_62: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + +BO_ 1343 Object_63: 8 XXX + SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX + SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX + SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX + SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX + diff --git a/opendbc/ford_fusion_2018_pt.dbc b/opendbc/ford_fusion_2018_pt.dbc new file mode 100644 index 000000000..c4b706d06 --- /dev/null +++ b/opendbc/ford_fusion_2018_pt.dbc @@ -0,0 +1,139 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + +BO_ 130 EPAS_INFO: 8 XXX + SG_ SteMdule_U_Meas : 39|8@0+ (0.05,6.0) [0|0] "Volts" XXX + SG_ SteMdule_I_Est : 21|12@0+ (0.05,-64.0) [0|0] "Amps" XXX + SG_ EPAS_FAILURE : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SteeringColumnTorque : 7|8@0+ (0.0625,-8.0) [0|0] "Nm" XXX + SG_ SAPPAngleControlStat6 : 15|1@0+ (1,0) [0|0] "" XXX + SG_ SAPPAngleControlStat5 : 14|1@0+ (1,0) [0|0] "" XXX + SG_ SAPPAngleControlStat4 : 13|1@0+ (1,0) [0|0] "" XXX + SG_ SAPPAngleControlStat3 : 12|1@0+ (1,0) [0|0] "" XXX + SG_ SAPPAngleControlStat2 : 11|1@0+ (1,0) [0|0] "" XXX + SG_ SAPPAngleControlStat1 : 23|2@0+ (1,0) [0|0] "" XXX + +BO_ 118 Steering_Wheel_Data_CG1: 8 XXX + SG_ SteWhlRelInit_An_Sns : 6|15@0+ (0.1,-1600.0) [0|0] "deg" XXX + SG_ SteWhlRelCalib_An_Sns : 23|15@0+ (0.1,-1600.0) [0|0] "deg" XXX + SG_ SteWhlRelInit2_An_Sns : 55|16@0+ (0.1,-3200.0) [0|0] "deg" XXX + SG_ SteWhlAn_No_Cs : 39|8@0+ (1,0) [0|0] "" XXX + SG_ SteWhlAn_No_Cnt : 47|4@0+ (1,0) [0|0] "Counts" XXX + +BO_ 131 Steering_Buttons: 8 XXX + SG_ Right_Turn_Light : 5|1@0+ (1,0) [0|0] "" XXX + SG_ Left_Turn_Light : 4|1@0+ (1,0) [0|0] "" XXX + SG_ Dist_Decr : 12|1@0+ (1,0) [0|0] "" XXX + SG_ Dist_Incr : 11|1@0+ (1,0) [0|0] "" XXX + SG_ Cancel : 8|1@0+ (1,0) [0|0] "" XXX + SG_ Resume : 29|1@0+ (1,0) [0|0] "" XXX + SG_ Set : 28|1@0+ (1,0) [0|0] "" XXX + SG_ Main : 38|1@0+ (1,0) [0|0] "" XXX + +BO_ 145 Yaw_Data: 8 XXX + SG_ VehYaw_W_Actl : 39|16@0+ (0.0002,-6.5) [0|0] "rad/s" XXX + SG_ VehRol_W_Actl : 23|16@0+ (0.0002,-6.5) [0|0] "rad/s" XXX + SG_ VehPtch_W_Actl : 7|16@0+ (0.0002,-6.5) [0|0] "rad/s" XXX + +BO_ 146 Accel_Data: 8 XXX + SG_ VehVertAActl_D_Qf : 38|2@0+ (1,0) [0|0] "" XXX + SG_ VehLongAActl_D_Qf : 22|2@0+ (1,0) [0|0] "" XXX + SG_ VehLatAActl_D_Qf : 6|2@0+ (1,0) [0|0] "" XXX + SG_ VehVert_A_Actl : 36|13@0+ (0.01,-40.0) [0|0] "m/s^2" XXX + SG_ VehLong_A_Actl : 20|13@0+ (0.01,-40.0) [0|0] "m/s^2" XXX + SG_ VehLat_A_Actl : 4|13@0+ (0.01,-40.0) [0|0] "m/s^2" XXX + +BO_ 357 Cruise_Status: 8 XXX + SG_ Brake_Drv_Appl : 5|1@0+ (1,0) [0|0] "" XXX + SG_ Cruise_State : 11|4@0+ (1,0) [0|0] "" XXX + SG_ Set_Speed : 23|8@0+ (1,0) [0|0] "" XXX + +BO_ 516 EngineData_14: 8 XXX + SG_ ApedPosScal_Pc_Actl : 1|10@0+ (0.1,0) [0|0] "%" XXX + +BO_ 535 WheelSpeed_CG1: 8 XXX + SG_ WhlRr_W_Meas : 55|14@0+ (0.04,0) [0|0] "rad/s" XXX + SG_ WhlRl_W_Meas : 39|14@0+ (0.04,0) [0|0] "rad/s" XXX + SG_ WhlFr_W_Meas : 23|14@0+ (0.04,0) [0|0] "rad/s" XXX + SG_ WhlFl_W_Meas : 7|14@0+ (0.04,0) [0|0] "rad/s" XXX + +BO_ 534 WheelData: 8 XXX + SG_ WhlRotatRr_No_Cnt : 23|8@0+ (1,0) [0|0] "" XXX + SG_ WhlDirRr_D_Actl : 33|2@0+ (1,0) [0|0] "" XXX + SG_ WhlDirRl_D_Actl : 39|2@0+ (1,0) [0|0] "" XXX + SG_ WhlDirFr_D_Actl : 37|2@0+ (1,0) [0|0] "" XXX + SG_ WhlDirFl_D_Actl : 35|2@0+ (1,0) [0|0] "" XXX + SG_ WhlRotatRl_No_Cnt : 31|8@0+ (1,0) [0|0] "" XXX + SG_ WhlRotatFr_No_Cnt : 7|8@0+ (1,0) [0|0] "" XXX + SG_ WhlRotatFl_No_Cnt : 15|8@0+ (1,0) [0|0] "" XXX + SG_ WHEEL_ROLLING_TIMESTAMP : 47|8@0+ (1,0) [0|0] "" XXX + +BO_ 947 Doors: 8 XXX + SG_ Door_FL_Open : 61|1@0+ (1,0) [0|0] "" XXX + SG_ Door_FR_Open : 60|1@0+ (1,0) [0|0] "" XXX + SG_ Door_RL_Open : 48|1@0+ (1,0) [0|0] "" XXX + SG_ Door_RR_Open : 49|1@0+ (1,0) [0|0] "" XXX + +BO_ 963 BCM_to_HS_Body: 8 XXX + SG_ Brake_Lights : 8|1@0+ (1,0) [0|0] "" XXX + +BO_ 970 Lane_Keep_Assist_Control: 8 XXX + SG_ Lkas_Action : 7|4@0+ (1,0) [0|15] "" XXX + SG_ Lkas_Alert : 3|4@0+ (1,0) [0|15] "" XXX + SG_ Lane_Curvature : 15|12@0+ (5e-06,-0.01) [0|0] "1/m" XXX + SG_ Steer_Angle_Req : 19|12@0+ (0.04297,-88.00445) [0|0] "deg" XXX + +BO_ 972 Lane_Keep_Assist_Status: 8 XXX + SG_ LaHandsOff_B_Actl : 7|1@0+ (1,0) [0|0] "" XXX + SG_ LaActDeny_B_Actl : 6|1@0+ (1,0) [0|0] "" XXX + SG_ LaActAvail_D_Actl : 5|2@0+ (1,0) [0|0] "" XXX + +BO_ 984 Lane_Keep_Assist_Ui: 8 XXX + SG_ Set_Me_X80 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ Set_Me_X45 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ Lines_Hud : 55|4@0+ (1,0) [0|15] "" XXX + SG_ Hands_Warning_W_Chime : 50|1@0+ (1,0) [0|1] "" XXX + SG_ Hands_Warning : 49|1@0+ (1,0) [0|1] "" XXX + SG_ Set_Me_X30 : 63|8@0+ (1,0) [0|255] "" XXX + +CM_ SG_ 970 Lkas_Action "only vals 4, 5, 8, 9 seem to work. 4 and 5 are a bit smoother" ; + +VAL_ 357 Cruise_State 4 "active" 3 "standby" 0 "off" ; +VAL_ 970 Lkas_Action 15 "off" 9 "abrupt" 8 "abrupt2" 5 "smooth" 4 "smooth2" ; +VAL_ 970 Lkas_Alert 15 "no_alert" 3 "high_intensity" 2 "mid_intensity" 1 "low_intensity" ; +VAL_ 972 LaActAvail_D_Actl 3 "available" 2 "tbd" 1 "not_available" 0 "fault" ; +VAL_ 984 Lines_Hud 15 "none" 11 "grey_yellow" 8 "green_red" 7 "yellow_grey" 6 "grey_grey" 4 "red_green" 3 "green_green" ; diff --git a/opendbc/gm_global_a_chassis.dbc b/opendbc/gm_global_a_chassis.dbc new file mode 100644 index 000000000..e1fc1ccbf --- /dev/null +++ b/opendbc/gm_global_a_chassis.dbc @@ -0,0 +1,75 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: K182_PACM K43_PSCM K17_EBCM NEO K124_ASCM + + + +BO_ 823 PACMParkAssitCmd: 7 NEO + SG_ RollingCounter : 35|2@0+ (1,0) [0|0] "" NEO + SG_ SteeringWheelChecksum : 47|16@0+ (1,0) [0|0] "" NEO + SG_ SteeringWheelCmd : 23|16@0+ (1,0) [0|0] "" NEO + +BO_ 560 EBCMRegen: 6 K17_EBCM + SG_ Regen : 1|10@0+ (1,0) [0|0] "" NEO + +BO_ 368 EBCMFrictionBrakeStatus: 8 K17_EBCM + SG_ FrictionBrakePressure : 23|16@0+ (1,0) [0|0] "" NEO + +BO_ 789 EBCMFrictionBrakeCmd: 5 K17_EBCM + SG_ RollingCounter : 33|2@0+ (1,0) [0|0] "" NEO + SG_ FrictionBrakeMode : 7|4@0+ (1,0) [0|0] "" NEO + SG_ FrictionBrakeChecksum : 23|16@0+ (1,0) [0|0] "" NEO + SG_ FrictionBrakeCmd : 3|12@0- (1,0) [0|0] "" NEO + +BO_TX_BU_ 823 : K43_PSCM,NEO; +BO_TX_BU_ 789 : NEO,K17_EBCM; + + +CM_ BU_ K182_PACM "Parking Assist Control Module"; +CM_ BU_ K43_PSCM "Power Steering Control Module"; +CM_ BU_ K17_EBCM "Electronic Brake Control Module"; +CM_ BU_ NEO "Comma NEO"; +CM_ BU_ K124_ASCM "Active Safety Control Module"; +BA_DEF_ "UseGMParameterIDs" INT 0 0; +BA_DEF_ "ProtocolType" STRING ; +BA_DEF_ "BusType" STRING ; +BA_DEF_DEF_ "UseGMParameterIDs" 1; +BA_DEF_DEF_ "ProtocolType" "GMLAN"; +BA_DEF_DEF_ "BusType" ""; +BA_ "UseGMParameterIDs" 0; +BA_ "BusType" "CAN"; +BA_ "ProtocolType" "GMLAN"; + diff --git a/opendbc/gm_global_a_object.dbc b/opendbc/gm_global_a_object.dbc new file mode 100644 index 000000000..4643a640a --- /dev/null +++ b/opendbc/gm_global_a_object.dbc @@ -0,0 +1,724 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: K109_FCM B233B_LRR NEO VIS_FO VIS2_FO K124_ASCM Vector__XXX EOCM_F_FO EOCM2A_IMX6_FO EOCM2A_K2_FO EOCM2A_K1_FO EOCM2B_IMX6_FO EOCM2B_K2_FO EOCM2B_K1_FO +VAL_TABLE_ RangeMode 1 "Active" 0 "Inactive" ; +VAL_TABLE_ TrkConf 3 "Confident" 2 "Speculative" 1 "Highly speculative" 0 "Invalid" ; +VAL_TABLE_ TrkMeasStatus 3 "Measured current cycle" 2 "Latent track not detected" 1 "New object" 0 "No object" ; +VAL_TABLE_ TrkDynProp 4 "Moving in opposite direction" 3 "Moving in same direction" 2 "Has moved but currently stopped" 1 "Has never moved," 0 "Unknown" ; +VAL_TABLE_ FrntVsnInPthVehBrkNwSt 10 "Active" 5 "Inactive" ; +VAL_TABLE_ FrntVsnClostPedBrkNwSt 10 "Active" 5 "Inactive" ; +VAL_TABLE_ LaneSnsLLnPosValid 1 "Invalid" 0 "Valid" ; +VAL_TABLE_ LnSnsRLnPosValid 1 "Invalid" 0 "Valid" ; +VAL_TABLE_ ObjectType 7 "no object present" 6 "fixed roadside object" 5 "fixed overhead object" 4 "pedestrian" 3 "motocycle / bicycle" 2 "Large vehicle (semi)" 1 "4 Wheel Vehicle (car, small trk)" 0 "Unknown" ; +VAL_TABLE_ FwVsnCinCoutPotT9Rev 2 "Right" 1 "Left" 0 "None" ; +VAL_TABLE_ FwVsnCinCoutPotT8Rev 2 "Right" 1 "Left" 0 "None" ; +VAL_TABLE_ FwVsnCinCoutPotT7Rev 2 "Right" 1 "Left" 0 "None" ; +VAL_TABLE_ FwVsnCinCoutPotT6Rev 2 "Right" 1 "Left" 0 "None" ; +VAL_TABLE_ FwVsnCinCoutPotT5Rev 2 "Right" 1 "Left" 0 "None" ; +VAL_TABLE_ FwVsnCinCoutPotT4Rev 2 "Right" 1 "Left" 0 "None" ; +VAL_TABLE_ FwVsnCinCoutPotT3Rev 2 "Right" 1 "Left" 0 "None" ; +VAL_TABLE_ FwVsnCinCoutPotT2Rev 2 "Right" 1 "Left" 0 "None" ; +VAL_TABLE_ FwVsnCinCoutPotT1Rev 2 "Right" 1 "Left" 0 "None" ; +VAL_TABLE_ FwVsnCinCoutPotT12Rev 2 "Right" 1 "Left" 0 "None" ; +VAL_TABLE_ FwVsnCinCoutPotT11Rev 2 "Right" 1 "Left" 0 "None" ; +VAL_TABLE_ FwVsnCinCoutPotT10Rev 2 "Right" 1 "Left" 0 "None" ; + + +BO_ 3221225472 VECTOR__INDEPENDENT_SIG_MSG: 0 Vector__XXX + SG_ Always12 : 0|8@0+ (1,0) [0|0] "" Vector__XXX + SG_ TimeStatusChecksum : 0|12@0+ (1,0) [0|0] "" Vector__XXX + +BO_ 161 ASCMTimeStatus: 7 NEO + SG_ TimeStatus : 7|28@0+ (1,0) [0|0] "" B233B_LRR + SG_ RollingCounter : 27|2@0+ (1,0) [0|0] "" B233B_LRR + +BO_ 774 ASCMSteeringStatus: 8 NEO + SG_ ASCMSterringStatusChecksum : 55|16@0+ (1,0) [0|0] "" B233B_LRR + SG_ AlwaysF0 : 15|8@0+ (1,0) [0|0] "" B233B_LRR + SG_ Always20 : 23|8@0+ (1,0) [0|0] "" B233B_LRR + SG_ RollingCounter : 7|2@0+ (1,0) [0|0] "" B233B_LRR + +BO_ 784 ASCMHeadlight: 2 NEO + SG_ Always42 : 7|8@0+ (1,0) [0|0] "" B233B_LRR + SG_ Always4 : 15|8@0+ (1,0) [0|0] "" B233B_LRR + +BO_ 776 ASCMAccSpeedStatus: 7 NEO + SG_ AccSpeedChecksum : 42|11@0+ (1,0) [0|0] "" B233B_LRR + SG_ RollingCounter : 46|2@0+ (1,0) [0|0] "" B233B_LRR + SG_ NearRangeMode : 43|1@0+ (1,0) [0|0] "" B233B_LRR + SG_ FarRangeMode : 44|1@0+ (1,0) [0|0] "" B233B_LRR + SG_ VehicleAcceleration : 19|12@0+ (1,0) [0|0] "" B233B_LRR + SG_ VehicleSpeed : 15|12@0+ (1,0) [0|0] "" B233B_LRR + SG_ AlwaysOne : 3|1@0+ (1,0) [0|0] "" B233B_LRR + +BO_ 1120 F_LRR_Obj_Header: 8 LRR_FO + SG_ FLRRRollingCount : 7|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FLRRModeCmdFdbk : 23|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FLRRNumValidTargets : 20|5@0+ (1,0) [0|31] "" EOCM_F_FO + SG_ FLRRTimeStampV : 31|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRTimeStamp : 2|11@0+ (1,0) [0|2047] "ms" EOCM_F_FO + SG_ FLRRRoadTypeInfo : 5|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FLRRBurstChecksum : 55|16@0+ (1,0) [0|65535] "" EOCM_F_FO + SG_ FLRRDiagSpare : 30|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRVltgOutRngLo : 44|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRVltgOutRngHi : 43|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRSvcAlgnInPrcs : 38|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRSnsrBlckd : 45|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRSnstvFltPrsntInt : 24|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRPlntAlgnInProc : 37|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRMsalgnYawRt : 47|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRMsalgnYawLt : 46|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRLonVelPlsblityFlt : 35|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRYawRtPlsblityFlt : 34|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRMsalgnPtchUp : 32|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRMsalgnPtchDn : 33|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRInitDiagCmplt : 40|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRHWFltPrsntInt : 25|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRExtIntrfrnc : 36|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRCANSgnlSpvFld : 29|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRCANRxErr : 28|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRTunlDtctd : 27|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRAmbTmpOutRngLw : 42|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRAmbTmpOutRngHi : 41|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRAntTngFltPrsnt : 26|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FLRRAlgnFltPrsnt : 39|1@0+ (1,0) [0|1] "" EOCM_F_FO + +BO_ 1134 LRRObject14: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1132 LRRObject12: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1131 LRRObject11: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1130 LRRObject10: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1129 LRRObject09: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1128 LRRObject08: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1127 LRRObject07: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1126 LRRObject06: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1125 LRRObject05: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1124 LRRObject04: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1123 LRRObject03: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1140 LRRObject20: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1139 LRRObject19: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1138 LRRObject18: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1137 LRRObject17: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1136 LRRObject16: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1135 LRRObject15: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1133 LRRObject13: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1122 LRRObject02: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + +BO_ 1121 LRRObject01: 8 B233B_LRR + SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO + SG_ TrkRangeRate : 10|11@0- (0.125,0) [-128|127.875] "m/s" NEO + SG_ TrkRangeAccel : 31|9@0- (0.125,0) [-32|31.875] "m/s^2" NEO + SG_ TrkAzimuth : 35|12@0- (0.125,0) [-256|255.875] "deg" NEO + SG_ TrkWidth : 55|6@0+ (0.25,0) [0|15.75] "m" NEO + SG_ TrkObjectID : 61|6@0+ (1,0) [0|63] "" NEO + + BO_ 1094 F_Vision_Obj_Track_12: 8 VIS2_FO + SG_ FwdVsnObjTypTr12Rev : 14|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ FwdVsnAzmthTrk12Rev : 10|10@0- (0.1,0) [-51.2|51.1] "deg" EOCM_F_FO + SG_ FwdVsnRngTrk12Rev : 16|12@0+ (0.1,0) [0|409.5] "m" EOCM_F_FO + SG_ FVisionWidthTrk12 : 61|6@0+ (0.25,0) [0|15.75] "m" EOCM_F_FO + SG_ FVisionMeasStatTrk12 : 63|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnVertPosTrk12 : 53|6@0+ (0.25,-2) [-2|13.75] "deg" EOCM_F_FO + SG_ FVisionRelLaneTrk12 : 55|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionAzRateTrk12 : 34|11@0- (0.125,0) [-128|127.875] "deg/sec" EOCM_F_FO + SG_ FVisionConfTrk12 : 36|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ ObjDirTrk12 : 15|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FVisBurstIDTrk12 : 1|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionObjectIDTrk12 : 7|6@0+ (1,0) [0|63] "" EOCM_F_FO + +BO_ 1093 F_Vision_Obj_Track_11: 8 VIS2_FO + SG_ FwdVsnObjTypTr11Rev : 14|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ FwdVsnAzmthTrk11Rev : 10|10@0- (0.1,0) [-51.2|51.1] "deg" EOCM_F_FO + SG_ FwdVsnRngTrk11Rev : 16|12@0+ (0.1,0) [0|409.5] "m" EOCM_F_FO + SG_ FVisionWidthTrk11 : 61|6@0+ (0.25,0) [0|15.75] "m" EOCM_F_FO + SG_ FVisionMeasStatTrk11 : 63|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnVertPosTrk11 : 53|6@0+ (0.25,-2) [-2|13.75] "deg" EOCM_F_FO + SG_ FVisionRelLaneTrk11 : 55|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionAzRateTrk11 : 34|11@0- (0.125,0) [-128|127.875] "deg/sec" EOCM_F_FO + SG_ FVisionConfTrk11 : 36|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ ObjDirTrk11 : 15|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FVisBurstIDTrk11 : 1|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionObjectIDTrk11 : 7|6@0+ (1,0) [0|63] "" EOCM_F_FO + +BO_ 1100 F_Vision_Obj_Track_12_B: 8 VIS2_FO + SG_ FwVsnCinCoutPotT12Rev : 5|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnObjAgeTrk12 : 62|7@0+ (1,0) [0|127] "" EOCM_F_FO + SG_ FwdVsnLongVlctyTrk12 : 42|12@0- (0.0625,0) [-128|127.9375] "m/sec" EOCM_F_FO + SG_ FwdVsnLatOfstTrk12 : 36|10@0- (0.125,0) [-64|63.875] "m" EOCM_F_FO + SG_ FwdVsnBrkLtStatTrk12 : 38|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnTrnSigStatTr12 : 25|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FwdVsnObjSclChgTrk12 : 15|16@0- (0.0002,0) [-6.5536|6.5534] "pix/sec" EOCM_F_FO + SG_ FrtVsnBrstIDAddInfo12 : 7|2@0+ (1,0) [0|3] "" EOCM_F_FO + +BO_ 1099 F_Vision_Obj_Track_11_B: 8 VIS2_FO + SG_ FwVsnCinCoutPotT11Rev : 5|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnObjAgeTrk11 : 62|7@0+ (1,0) [0|127] "" EOCM_F_FO + SG_ FwdVsnLongVlctyTrk11 : 42|12@0- (0.0625,0) [-128|127.9375] "m/sec" EOCM_F_FO + SG_ FwdVsnLatOfstTrk11 : 36|10@0- (0.125,0) [-64|63.875] "m" EOCM_F_FO + SG_ FwdVsnBrkLtStatTrk11 : 38|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnTrnSigStatTr11 : 25|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FwdVsnObjSclChgTrk11 : 15|16@0- (0.0002,0) [-6.5536|6.5534] "pix/sec" EOCM_F_FO + SG_ FrtVsnBrstIDAddInfo11 : 7|2@0+ (1,0) [0|3] "" EOCM_F_FO + +BO_ 1098 F_Vision_Obj_Track_10_B: 8 VIS2_FO + SG_ FwVsnCinCoutPotT10Rev : 5|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnObjAgeTrk10 : 62|7@0+ (1,0) [0|127] "" EOCM_F_FO + SG_ FwdVsnLongVlctyTrk10 : 42|12@0- (0.0625,0) [-128|127.9375] "m/sec" EOCM_F_FO + SG_ FwdVsnLatOfstTrk10 : 36|10@0- (0.125,0) [-64|63.875] "m" EOCM_F_FO + SG_ FwdVsnBrkLtStatTrk10 : 38|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnTrnSigStatTr10 : 25|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FwdVsnObjSclChgTrk10 : 15|16@0- (0.0002,0) [-6.5536|6.5534] "pix/sec" EOCM_F_FO + SG_ FrtVsnBrstIDAddInfo10 : 7|2@0+ (1,0) [0|3] "" EOCM_F_FO + +BO_ 1097 F_Vision_Obj_Track_9_B: 8 VIS2_FO + SG_ FwVsnCinCoutPotT9Rev : 5|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnObjAgeTrk9 : 62|7@0+ (1,0) [0|127] "" EOCM_F_FO + SG_ FwdVsnLongVlctyTrk9 : 42|12@0- (0.0625,0) [-128|127.9375] "m/sec" EOCM_F_FO + SG_ FwdVsnLatOfstTrk9 : 36|10@0- (0.125,0) [-64|63.875] "m" EOCM_F_FO + SG_ FwdVsnBrkLtStatTrk9 : 38|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnTrnSigStatTr9 : 25|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FwdVsnObjSclChgTrk9 : 15|16@0- (0.0002,0) [-6.5536|6.5534] "pix/sec" EOCM_F_FO + SG_ FrtVsnBrstIDAddInfo9 : 7|2@0+ (1,0) [0|3] "" EOCM_F_FO + +BO_ 1096 F_Vision_Obj_Track_8_B: 8 VIS2_FO + SG_ FwVsnCinCoutPotT8Rev : 5|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnObjAgeTrk8 : 62|7@0+ (1,0) [0|127] "" EOCM_F_FO + SG_ FwdVsnLongVlctyTrk8 : 42|12@0- (0.0625,0) [-128|127.9375] "m/sec" EOCM_F_FO + SG_ FwdVsnLatOfstTrk8 : 36|10@0- (0.125,0) [-64|63.875] "m" EOCM_F_FO + SG_ FwdVsnBrkLtStatTrk8 : 38|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnTrnSigStatTr8 : 25|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FwdVsnObjSclChgTrk8 : 15|16@0- (0.0002,0) [-6.5536|6.5534] "pix/sec" EOCM_F_FO + SG_ FrtVsnBrstIDAddInfo8 : 7|2@0+ (1,0) [0|3] "" EOCM_F_FO + +BO_ 1095 F_Vision_Obj_Track_7_B: 8 VIS2_FO + SG_ FwVsnCinCoutPotT7Rev : 5|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnObjAgeTrk7 : 62|7@0+ (1,0) [0|127] "" EOCM_F_FO + SG_ FwdVsnLongVlctyTrk7 : 42|12@0- (0.0625,0) [-128|127.9375] "m/sec" EOCM_F_FO + SG_ FwdVsnLatOfstTrk7 : 36|10@0- (0.125,0) [-64|63.875] "m" EOCM_F_FO + SG_ FwdVsnBrkLtStatTrk7 : 38|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnTrnSigStatTr7 : 25|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FwdVsnObjSclChgTrk7 : 15|16@0- (0.0002,0) [-6.5536|6.5534] "pix/sec" EOCM_F_FO + SG_ FrtVsnBrstIDAddInfo7 : 7|2@0+ (1,0) [0|3] "" EOCM_F_FO + +BO_ 1068 F_Vision_Obj_Track_6_B: 8 VIS2_FO + SG_ FwVsnCinCoutPotT6Rev : 5|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnObjAgeTrk6 : 62|7@0+ (1,0) [0|127] "" EOCM_F_FO + SG_ FwdVsnLongVlctyTrk6 : 42|12@0- (0.0625,0) [-128|127.9375] "m/sec" EOCM_F_FO + SG_ FwdVsnLatOfstTrk6 : 36|10@0- (0.125,0) [-64|63.875] "m" EOCM_F_FO + SG_ FwdVsnBrkLtStatTrk6 : 38|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnTrnSigStatTr6 : 25|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FwdVsnObjSclChgTrk6 : 15|16@0- (0.0002,0) [-6.5536|6.5534] "pix/sec" EOCM_F_FO + SG_ FrtVsnBrstIDAddInfo6 : 7|2@0+ (1,0) [0|3] "" EOCM_F_FO + +BO_ 1067 F_Vision_Obj_Track_5_B: 8 VIS2_FO + SG_ FwVsnCinCoutPotT5Rev : 5|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnObjAgeTrk5 : 62|7@0+ (1,0) [0|127] "" EOCM_F_FO + SG_ FwdVsnLongVlctyTrk5 : 42|12@0- (0.0625,0) [-128|127.9375] "m/sec" EOCM_F_FO + SG_ FwdVsnLatOfstTrk5 : 36|10@0- (0.125,0) [-64|63.875] "m" EOCM_F_FO + SG_ FwdVsnBrkLtStatTrk5 : 38|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnTrnSigStatTr5 : 25|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FwdVsnObjSclChgTrk5 : 15|16@0- (0.0002,0) [-6.5536|6.5534] "pix/sec" EOCM_F_FO + SG_ FrtVsnBrstIDAddInfo5 : 7|2@0+ (1,0) [0|3] "" EOCM_F_FO + +BO_ 1066 F_Vision_Obj_Track_4_B: 8 VIS2_FO + SG_ FwVsnCinCoutPotT4Rev : 5|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnObjAgeTrk4 : 62|7@0+ (1,0) [0|127] "" EOCM_F_FO + SG_ FwdVsnLongVlctyTrk4 : 42|12@0- (0.0625,0) [-128|127.9375] "m/sec" EOCM_F_FO + SG_ FwdVsnLatOfstTrk4 : 36|10@0- (0.125,0) [-64|63.875] "m" EOCM_F_FO + SG_ FwdVsnBrkLtStatTrk4 : 38|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnTrnSigStatTr4 : 25|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FwdVsnObjSclChgTrk4 : 15|16@0- (0.0002,0) [-6.5536|6.5534] "pix/sec" EOCM_F_FO + SG_ FrtVsnBrstIDAddInfo4 : 7|2@0+ (1,0) [0|3] "" EOCM_F_FO + +BO_ 1065 F_Vision_Obj_Track_3_B: 8 VIS2_FO + SG_ FwVsnCinCoutPotT3Rev : 5|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnObjAgeTrk3 : 62|7@0+ (1,0) [0|127] "" EOCM_F_FO + SG_ FwdVsnLongVlctyTrk3 : 42|12@0- (0.0625,0) [-128|127.9375] "m/sec" EOCM_F_FO + SG_ FwdVsnLatOfstTrk3 : 36|10@0- (0.125,0) [-64|63.875] "m" EOCM_F_FO + SG_ FwdVsnBrkLtStatTrk3 : 38|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnTrnSigStatTr3 : 25|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FwdVsnObjSclChgTrk3 : 15|16@0- (0.0002,0) [-6.5536|6.5534] "pix/sec" EOCM_F_FO + SG_ FrtVsnBrstIDAddInfo3 : 7|2@0+ (1,0) [0|3] "" EOCM_F_FO + +BO_ 1064 F_Vision_Obj_Track_2_B: 8 VIS2_FO + SG_ FwVsnCinCoutPotT2Rev : 5|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnObjAgeTrk2 : 62|7@0+ (1,0) [0|127] "" EOCM_F_FO + SG_ FwdVsnLongVlctyTrk2 : 42|12@0- (0.0625,0) [-128|127.9375] "m/sec" EOCM_F_FO + SG_ FwdVsnLatOfstTrk2 : 36|10@0- (0.125,0) [-64|63.875] "m" EOCM_F_FO + SG_ FwdVsnBrkLtStatTrk2 : 38|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnTrnSigStatTr2 : 25|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FwdVsnObjSclChgTrk2 : 15|16@0- (0.0002,0) [-6.5536|6.5534] "pix/sec" EOCM_F_FO + SG_ FrtVsnBrstIDAddInfo2 : 7|2@0+ (1,0) [0|3] "" EOCM_F_FO + +BO_ 1063 F_Vision_Obj_Track_1_B: 8 VIS2_FO + SG_ FwVsnCinCoutPotT1Rev : 5|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnObjSclChgTrk1 : 15|16@0- (0.0002,0) [-6.5536|6.5534] "pix/sec" EOCM_F_FO + SG_ FwdVsnObjAgeTrk1 : 62|7@0+ (1,0) [0|127] "" EOCM_F_FO + SG_ FwdVsnLongVlctyTrk1 : 42|12@0- (0.0625,0) [-128|127.9375] "m/sec" EOCM_F_FO + SG_ FwdVsnLatOfstTrk1 : 36|10@0- (0.125,0) [-64|63.875] "m" EOCM_F_FO + SG_ FwdVsnBrkLtStatTrk1 : 38|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FwdVsnTrnSigStatTr1 : 25|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FrtVsnBrstIDAddInfo1 : 7|2@0+ (1,0) [0|3] "" EOCM_F_FO + +BO_ 1088 F_Vision_Obj_Header_2: 8 VIS2_FO + SG_ FrntVsnInPthVehBrkNwSt : 35|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ FrntVsnClostPedBrkNwSt : 39|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ FrntVsnClostPedObjID : 29|6@0+ (1,0) [0|63] "" EOCM_F_FO + SG_ FrntVsnClostPedAlrtNwFlg : 30|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FrntVsnClostPedNotftnFlg : 15|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FrntVsnInPthVehAlrtNwFlg : 2|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FrtVsnVldTgtNum2 : 14|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ FrtVsnTmStmp2V : 31|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FrtVsnTmStmp2 : 10|11@0+ (1,0) [0|2047] "" EOCM_F_FO + SG_ FrtVsnRollCnt2 : 1|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FrtVsnBrstChksum2 : 55|16@0+ (1,0) [0|65535] "" EOCM_F_FO + +BO_ 854 F_Vision_Environment_7: 3 VIS2_FO + SG_ FwdVsnCnstrctAreaDst : 13|4@0+ (10,0) [0|150] "m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ FwdVsnCnstrctZnDet : 15|2@0+ (1,0) [0|3] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ FwdVsnEgoVehLnPos : 17|2@0+ (1,0) [0|3] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ FwdVsnRdTypDet : 9|2@0+ (1,0) [0|3] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ FwdVsnTunnlDetd : 23|2@0+ (1,0) [0|3] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ FwdVsnTunnlDst : 21|4@0+ (10,0) [0|150] "m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsBrstID5 : 1|2@0+ (1,0) [0|3] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + +BO_ 853 F_Vision_Environment_6: 8 VIS2_FO + SG_ LnMrkg4LnSnsLnHdngTngtV : 7|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg4LnSnsLnHdngTngt : 23|8@0- (0.002,0) [-0.256|0.254] "m/m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg4LnSnsLnDstV : 56|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg4LnSnsLnDst : 15|8@0- (0.1,0) [-12.8|12.7] "m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg4LnSnsLnCrvtV : 6|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg4LnSnsLnCrvtGradV : 5|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg4LnSnsLnCrvtGrad : 47|16@0- (5.96e-8,0) [-0.0019529728|0.0019529132] "1/(m*sec)" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg4LnSnsLnCrvt : 31|16@0- (9.53e-7,0) [-0.031227904|0.031226951] "1/m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg4LnQltyConfLvl : 63|7@0+ (0.7874016,0) [0|100.0000032] "%" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg4LnMrkrTyp : 4|3@0+ (1,0) [0|7] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsBrstID4 : 1|2@0+ (1,0) [0|3] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + +BO_ 852 F_Vision_Environment_5: 8 VIS2_FO + SG_ LnMrkg3LnSnsLnHdngTngtV : 7|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg3LnSnsLnHdngTngt : 23|8@0- (0.002,0) [-0.256|0.254] "m/m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg3LnSnsLnDstV : 56|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg3LnSnsLnDst : 15|8@0- (0.1,0) [-12.8|12.7] "m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg3LnSnsLnCrvtV : 6|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg3LnSnsLnCrvtGradV : 5|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg3LnSnsLnCrvtGrad : 47|16@0- (5.96e-8,0) [-0.0019529728|0.0019529132] "1/(m*sec)" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg3LnSnsLnCrvt : 31|16@0- (9.53e-7,0) [-0.031227904|0.031226951] "1/m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg3LnQltyConfLvl : 63|7@0+ (0.7874016,0) [0|100.0000032] "%" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg3LnMrkrTyp : 4|3@0+ (1,0) [0|7] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsBrstID3 : 1|2@0+ (1,0) [0|3] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + +BO_ 309 LHT_CameraObjConfirmation_FO: 1 VIS_FO + SG_ HiBmRecmnd : 1|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ CtLghtDet : 0|1@0+ (1,0) [0|1] "" EOCM_F_FO + +BO_ 848 F_Vision_Environment: 8 VIS_FO + SG_ FwdVsnEnvIllum : 37|3@0+ (1,0) [0|7] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsTngtOfHdngLnRtV : 1|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsTngtOfHdngLnRt : 31|8@0- (0.002,0) [-0.256|0.254] "m/m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsLnChngStatus : 39|2@0+ (1,0) [0|3] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsBurstChecksum : 55|16@0+ (1,0) [0|65535] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LaneSenseRollingCount : 7|2@0+ (1,0) [0|3] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LaneSenseSystemOK : 4|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LaneSnsLLnPosValid : 2|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSenseDistToLLnEdge : 14|7@0+ (0.05,0) [0|6.35] "m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsRLnPosValid : 0|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsDistToRLnEdge : 22|7@0+ (0.05,0) [0|6.35] "m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LaneSenseTimeStampV : 5|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LaneSenseTimeStamp : 34|11@0+ (1,0) [0|2047] "ms" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LaneSenseSystemOKV : 3|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + +BO_ 849 F_Vision_Environment_2: 8 VIS_FO + SG_ LnSnsLatVRelToRgtMrkg : 23|8@0- (0.02,0) [-2.56|2.54] "m/s" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM_F_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO + SG_ LnSnsRtLnMrkgTypChgDst : 61|4@0+ (10,0) [0|150] "m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsCrvtGrdntRtV : 63|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsLnMrkgWdthRt : 62|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsRtAnchrLn : 57|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsLtAnchrLn : 56|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsLnCrvtrRghtV : 0|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsLnCrvtrRght : 47|16@0- (9.53e-7,0) [-0.031227904|0.031226951] "1/m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsCrvtGrdntRt : 31|16@0- (5.96e-8,0) [-0.0019529728|0.0019529132] "1/rad/s" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsBurstID : 2|2@0+ (1,0) [0|3] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsLatVRelToLftMrkg : 15|8@0- (0.02,0) [-2.56|2.54] "m/s" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + +BO_ 1056 F_Vision_Obj_Header: 6 VIS_FO + SG_ FVsnSnsrBlckd : 24|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ ClstInPathVehObjID : 30|6@0+ (1,0) [0|63] "" EOCM_F_FO + SG_ FrtVsnFld : 6|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FrtVsnIniDiagSuccCmpt : 5|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FrtVsnSrvAlgnInPrcs : 15|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FrtVsnUnvlbl : 7|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FVisionRollingCnt : 1|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVISModeCmdFdbk : 4|3@0+ (1,0) [0|7] "" EOCM_F_FO + SG_ FVisionNumValidTrgts : 14|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ FVisionTimeStampV : 31|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FVisionTimeStamp : 10|11@0+ (1,0) [0|2047] "ms" EOCM_F_FO + SG_ VISBurstChecksum : 39|16@0+ (1,0) [0|65535] "" EOCM_F_FO + +BO_ 1057 F_Vision_Obj_Track_1: 8 VIS_FO + SG_ FwdVsnRngTrk1Rev : 16|12@0+ (0.1,0) [0|409.5] "m" EOCM_F_FO + SG_ FwdVsnAzmthTrk1Rev : 10|10@0- (0.1,0) [-51.2|51.1] "deg" EOCM_F_FO + SG_ FwdVsnObjTypTr1Rev : 14|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ FwdVsnVertPosTrk1 : 53|6@0+ (0.25,-2) [-2|13.75] "deg" EOCM_F_FO + SG_ FVisBurstIDTrk1 : 1|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionObjectIDTrk1 : 7|6@0+ (1,0) [0|63] "" EOCM_F_FO + SG_ FVisionConfTrk1 : 36|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionAzRateTrk1 : 34|11@0- (0.125,0) [-128|127.875] "deg/s" EOCM_F_FO + SG_ FVisionRelLaneTrk1 : 55|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionMeasStatTrk1 : 63|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionWidthTrk1 : 61|6@0+ (0.25,0) [0|15.75] "m" EOCM_F_FO + SG_ ObjDirTrk1 : 15|1@0+ (1,0) [0|1] "" EOCM_F_FO + +BO_ 1058 F_Vision_Obj_Track_2: 8 VIS_FO + SG_ FwdVsnVertPosTrk2 : 53|6@0+ (0.25,-2) [-2|13.75] "deg" EOCM_F_FO + SG_ FwdVsnRngTrk2Rev : 16|12@0+ (0.1,0) [0|409.5] "m" EOCM_F_FO + SG_ FwdVsnAzmthTrk2Rev : 10|10@0- (0.1,0) [-51.2|51.1] "deg" EOCM_F_FO + SG_ ObjDirTrk2 : 15|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FwdVsnObjTypTr2Rev : 14|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ FVisBurstIDTrk2 : 1|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionObjectIDTrk2 : 7|6@0+ (1,0) [0|63] "" EOCM_F_FO + SG_ FVisionConfTrk2 : 36|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionAzRateTrk2 : 34|11@0- (0.125,0) [-128|127.875] "deg/s" EOCM_F_FO + SG_ FVisionRelLaneTrk2 : 55|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionMeasStatTrk2 : 63|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionWidthTrk2 : 61|6@0+ (0.25,0) [0|15.75] "m" EOCM_F_FO + +BO_ 1059 F_Vision_Obj_Track_3: 8 VIS_FO + SG_ FwdVsnVertPosTrk3 : 53|6@0+ (0.25,-2) [-2|13.75] "deg" EOCM_F_FO + SG_ FwdVsnRngTrk3Rev : 16|12@0+ (0.1,0) [0|409.5] "m" EOCM_F_FO + SG_ FwdVsnAzmthTrk3Rev : 10|10@0- (0.1,0) [-51.2|51.1] "deg" EOCM_F_FO + SG_ FwdVsnObjTypTr3Rev : 14|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ ObjDirTrk3 : 15|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FVisBurstIDTrk3 : 1|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionObjectIDTrk3 : 7|6@0+ (1,0) [0|63] "" EOCM_F_FO + SG_ FVisionConfTrk3 : 36|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionAzRateTrk3 : 34|11@0- (0.125,0) [-128|127.875] "deg/s" EOCM_F_FO + SG_ FVisionRelLaneTrk3 : 55|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionMeasStatTrk3 : 63|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionWidthTrk3 : 61|6@0+ (0.25,0) [0|15.75] "m" EOCM_F_FO + +BO_ 1060 F_Vision_Obj_Track_4: 8 VIS_FO + SG_ FwdVsnVertPosTrk4 : 53|6@0+ (0.25,-2) [-2|13.75] "deg" EOCM_F_FO + SG_ FVisionMeasStatTrk4 : 63|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionWidthTrk4 : 61|6@0+ (0.25,0) [0|15.75] "m" EOCM_F_FO + SG_ FwdVsnRngTrk4Rev : 16|12@0+ (0.1,0) [0|409.5] "m" EOCM_F_FO + SG_ FwdVsnAzmthTrk4Rev : 10|10@0- (0.1,0) [-51.2|51.1] "deg" EOCM_F_FO + SG_ FwdVsnObjTypTr4Rev : 14|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ FVisBurstIDTrk4 : 1|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionObjectIDTrk4 : 7|6@0+ (1,0) [0|63] "" EOCM_F_FO + SG_ ObjDirTrk4 : 15|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FVisionConfTrk4 : 36|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionAzRateTrk4 : 34|11@0- (0.125,0) [-128|127.875] "deg/s" EOCM_F_FO + SG_ FVisionRelLaneTrk4 : 55|2@0+ (1,0) [0|3] "" EOCM_F_FO + +BO_ 1061 F_Vision_Obj_Track_5: 8 VIS_FO + SG_ FwdVsnVertPosTrk5 : 53|6@0+ (0.25,-2) [-2|13.75] "deg" EOCM_F_FO + SG_ FwdVsnRngTrk5Rev : 16|12@0+ (0.1,0) [0|409.5] "m" EOCM_F_FO + SG_ FwdVsnAzmthTrk5Rev : 10|10@0- (0.1,0) [-51.2|51.1] "deg" EOCM_F_FO + SG_ FwdVsnObjTypTr5Rev : 14|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ ObjDirTrk5 : 15|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FVisBurstIDTrk5 : 1|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionObjectIDTrk5 : 7|6@0+ (1,0) [0|63] "" EOCM_F_FO + SG_ FVisionConfTrk5 : 36|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionAzRateTrk5 : 34|11@0- (0.125,0) [-128|127.875] "deg/s" EOCM_F_FO + SG_ FVisionRelLaneTrk5 : 55|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionMeasStatTrk5 : 63|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionWidthTrk5 : 61|6@0+ (0.25,0) [0|15.75] "m" EOCM_F_FO + +BO_ 1062 F_Vision_Obj_Track_6: 8 VIS_FO + SG_ FwdVsnVertPosTrk6 : 53|6@0+ (0.25,-2) [-2|13.75] "deg" EOCM_F_FO + SG_ FwdVsnRngTrk6Rev : 16|12@0+ (0.1,0) [0|409.5] "m" EOCM_F_FO + SG_ FwdVsnAzmthTrk6Rev : 10|10@0- (0.1,0) [-51.2|51.1] "deg" EOCM_F_FO + SG_ FwdVsnObjTypTr6Rev : 14|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ ObjDirTrk6 : 15|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FVisBurstIDTrk6 : 1|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionObjectIDTrk6 : 7|6@0+ (1,0) [0|63] "" EOCM_F_FO + SG_ FVisionConfTrk6 : 36|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionAzRateTrk6 : 34|11@0- (0.125,0) [-128|127.875] "deg/s" EOCM_F_FO + SG_ FVisionRelLaneTrk6 : 55|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionMeasStatTrk6 : 63|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionWidthTrk6 : 61|6@0+ (0.25,0) [0|15.75] "m" EOCM_F_FO + +BO_ 1089 F_Vision_Obj_Track_7: 8 VIS2_FO + SG_ FVisBurstIDTrk7 : 1|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionObjectIDTrk7 : 7|6@0+ (1,0) [0|63] "" EOCM_F_FO + SG_ FVisionConfTrk7 : 36|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionAzRateTrk7 : 34|11@0- (0.125,0) [-128|127.875] "deg/s" EOCM_F_FO + SG_ FVisionRelLaneTrk7 : 55|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionMeasStatTrk7 : 63|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionWidthTrk7 : 61|6@0+ (0.25,0) [0|15.75] "m" EOCM_F_FO + SG_ FwdVsnRngTrk7Rev : 16|12@0+ (0.1,0) [0|409.5] "m" EOCM_F_FO + SG_ FwdVsnObjTypTr7Rev : 14|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ FwdVsnAzmthTrk7Rev : 10|10@0- (0.1,0) [-51.2|51.1] "deg" EOCM_F_FO + SG_ FwdVsnVertPosTrk7 : 53|6@0+ (0.25,-2) [-2|13.75] "deg" EOCM_F_FO + SG_ ObjDirTrk7 : 15|1@0+ (1,0) [0|1] "" EOCM_F_FO + +BO_ 1090 F_Vision_Obj_Track_8: 8 VIS2_FO + SG_ FVisBurstIDTrk8 : 1|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionObjectIDTrk8 : 7|6@0+ (1,0) [0|63] "" EOCM_F_FO + SG_ FwdVsnAzmthTrk8Rev : 10|10@0- (0.1,0) [-51.2|51.1] "deg" EOCM_F_FO + SG_ FwdVsnVertPosTrk8 : 53|6@0+ (0.25,-2) [-2|13.75] "deg" EOCM_F_FO + SG_ FwdVsnRngTrk8Rev : 16|12@0+ (0.1,0) [0|409.5] "m" EOCM_F_FO + SG_ FwdVsnObjTypTr8Rev : 14|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ ObjDirTrk8 : 15|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FVisionConfTrk8 : 36|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionAzRateTrk8 : 34|11@0- (0.125,0) [-128|127.875] "deg/s" EOCM_F_FO + SG_ FVisionRelLaneTrk8 : 55|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionMeasStatTrk8 : 63|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionWidthTrk8 : 61|6@0+ (0.25,0) [0|15.75] "m" EOCM_F_FO + +BO_ 1091 F_Vision_Obj_Track_9: 8 VIS2_FO + SG_ FwdVsnVertPosTrk9 : 53|6@0+ (0.25,-2) [-2|13.75] "deg" EOCM_F_FO + SG_ FwdVsnRngTrk9Rev : 16|12@0+ (0.1,0) [0|409.5] "m" EOCM_F_FO + SG_ FwdVsnAzmthTrk9Rev : 10|10@0- (0.1,0) [-51.2|51.1] "deg" EOCM_F_FO + SG_ FwdVsnObjTypTr9Rev : 14|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ ObjDirTrk9 : 15|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FVisBurstIDTrk9 : 1|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionObjectIDTrk9 : 7|6@0+ (1,0) [0|63] "" EOCM_F_FO + SG_ FVisionConfTrk9 : 36|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionAzRateTrk9 : 34|11@0- (0.125,0) [-128|127.875] "deg/s" EOCM_F_FO + SG_ FVisionRelLaneTrk9 : 55|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionMeasStatTrk9 : 63|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionWidthTrk9 : 61|6@0+ (0.25,0) [0|15.75] "m" EOCM_F_FO + +BO_ 1092 F_Vision_Obj_Track_10: 8 VIS2_FO + SG_ FwdVsnRngTrk10Rev : 16|12@0+ (0.1,0) [0|409.5] "m" EOCM_F_FO + SG_ FwdVsnAzmthTrk10Rev : 10|10@0- (0.1,0) [-51.2|51.1] "deg" EOCM_F_FO + SG_ FwdVsnObjTypTr10Rev : 14|4@0+ (1,0) [0|15] "" EOCM_F_FO + SG_ FwdVsnVertPosTrk10 : 53|6@0+ (0.25,-2) [-2|13.75] "deg" EOCM_F_FO + SG_ ObjDirTrk10 : 15|1@0+ (1,0) [0|1] "" EOCM_F_FO + SG_ FVisBurstIDTrk10 : 1|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionObjectIDTrk10 : 7|6@0+ (1,0) [0|63] "" EOCM_F_FO + SG_ FVisionConfTrk10 : 36|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionAzRateTrk10 : 34|11@0- (0.125,0) [-128|127.875] "deg/s" EOCM_F_FO + SG_ FVisionRelLaneTrk10 : 55|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionMeasStatTrk10 : 63|2@0+ (1,0) [0|3] "" EOCM_F_FO + SG_ FVisionWidthTrk10 : 61|6@0+ (0.25,0) [0|15.75] "m" EOCM_F_FO + +BO_ 851 F_Vision_Environment_4: 8 VIS_FO + SG_ LnMrkg3LnPrvwDst : 45|4@0+ (10,0) [0|150] "m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsTtlNmLnMrkgDetRt : 4|3@0+ (1,0) [0|7] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsRtLinCrsTm : 25|5@0+ (0.1,0) [0|3.1] "s" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsNumPrlLnsDetRt : 33|3@0+ (1,0) [0|7] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsNumPrlLnsDetLt : 36|3@0+ (1,0) [0|7] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsCrvtGrdntLftV : 31|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsLtLinCrsTm : 30|5@0+ (0.1,0) [0|3.1] "s" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg4LnPrvwDst : 50|4@0+ (10,0) [0|150] "m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg4LnMrkgTypChgDst : 61|4@0+ (10,0) [0|150] "m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg3LnMrkgTypChgDst : 40|4@0+ (10,0) [0|150] "m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg4LnMrkgWdth : 62|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg4LnMarkrElvtd : 51|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg4AnchrLnLin : 57|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg3LnMrkgWdth : 41|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg3LnMarkrElvtd : 46|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkg3AnchrLnLin : 52|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsBurstID2 : 1|2@0+ (1,0) [0|3] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsCrvtGrdntLft : 15|16@0- (5.96e-8,0) [-0.0019529728|0.0019529132] "1/rad/s" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + + BO_ 850 F_Vision_Environment_3: 8 VIS_FO + SG_ LnSnsTtlNmLnMrkgDetLt : 58|3@0+ (1,0) [0|7] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsLtLnMrkgWdth : 63|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsLtLnMrkgTypChgDst : 62|4@0+ (10,0) [0|150] "m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsTngtOfHdngLnLftV : 23|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsTngtOfHdngLnLft : 31|8@0- (0.002,0) [-0.256|0.254] "m/m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsLnCrvtrLftV : 15|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsLnCrvtrLft : 39|16@0- (9.53e-7,0) [-0.031227904|0.031226951] "1/m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkrTypRght : 50|3@0+ (1,0) [0|7] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkrTypLft : 53|3@0+ (1,0) [0|7] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkrElvtdRght : 54|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnMrkrElvtdLft : 55|1@0+ (1,0) [0|1] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnSnsBurstID1 : 7|2@0+ (1,0) [0|3] "" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnQltyCnfdncLvlRght : 22|7@0+ (0.7874016,0) [0|100.0000032] "%" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnQltyCnfdncLvlLft : 14|7@0+ (0.7874016,0) [0|100.0000032] "%" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnPrvwDstncRght : 2|3@0+ (10,0) [0|70] "m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + SG_ LnPrvwDstncLft : 5|3@0+ (10,0) [0|70] "m" EOCM2A_IMX6_FO,EOCM2A_K2_FO,EOCM2A_K1_FO,EOCM2B_IMX6_FO,EOCM2B_K2_FO,EOCM2B_K1_FO,EOCM_F_FO + + +BO_TX_BU_ 161 : K124_ASCM,NEO; +BO_TX_BU_ 774 : K124_ASCM,NEO; +BO_TX_BU_ 784 : K124_ASCM,NEO; +BO_TX_BU_ 776 : K124_ASCM,NEO; + + +CM_ BU_ K109_FCM "Frontview Camera Module"; +CM_ BU_ B233B_LRR "Radar Sensor Module Long Range"; +CM_ BU_ NEO "Comma NEO"; +CM_ BU_ VIS_FO "Front Camera Data"; +CM_ BU_ VIS2_FO "Front Camera Data2"; +CM_ BU_ K124_ASCM "Active Safety Control Module"; +CM_ BO_ 3221225472 "This is a message for not used signals, created by Vector CANdb++ DBC OLE DB Provider."; +BA_DEF_ "UseGMParameterIDs" INT 0 0; +BA_DEF_ "ProtocolType" STRING ; +BA_DEF_ "BusType" STRING ; +BA_DEF_DEF_ "UseGMParameterIDs" 1; +BA_DEF_DEF_ "ProtocolType" "GMLAN"; +BA_DEF_DEF_ "BusType" ""; +BA_ "BusType" "CAN"; +BA_ "ProtocolType" "GMLAN"; +BA_ "UseGMParameterIDs" 0; +VAL_ 776 NearRangeMode 1 "Active" 0 "Inactive"; +VAL_ 776 FarRangeMode 1 "Active" 0 "Inactive"; diff --git a/opendbc/gm_global_a_powertrain_generated.dbc b/opendbc/gm_global_a_powertrain_generated.dbc new file mode 100644 index 000000000..db42343f6 --- /dev/null +++ b/opendbc/gm_global_a_powertrain_generated.dbc @@ -0,0 +1,317 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 512 GAS_COMMAND: 6 NEO + SG_ GAS_COMMAND : 7|16@0+ (0.125677,-75.909) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.251976,-76.601) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + +BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.125677,-75.909) [0|1] "" NEO + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.251976,-76.601) [0|1] "" NEO + SG_ STATE : 39|4@0+ (1,0) [0|15] "" NEO + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" NEO + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" NEO + +VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + +CM_ "gm_global_a_powertrain.dbc starts here"; + +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: K16_BECM K73_TCIC K9_BCM K43_PSCM K17_EBCM K20_ECM K114B_HPCM NEO K124_ASCM EPB +VAL_TABLE_ TurnSignals 2 "Right Turn" 1 "Left Turn" 0 "None" ; +VAL_TABLE_ Intellibeam 1 "Active" 0 "Inactive" ; +VAL_TABLE_ HighBeamsActive 1 "Active" 0 "Inactive" ; +VAL_TABLE_ HighBeamsTemporary 1 "Active" 0 "Inactive" ; +VAL_TABLE_ ACCLeadCar 1 "Present" 0 "Not Present" ; +VAL_TABLE_ ACCCmdActive 1 "Active" 0 "Inactive" ; +VAL_TABLE_ BrakePedalPressed 1 "Pressed" 0 "Depressed" ; +VAL_TABLE_ DistanceButton 1 "Active" 0 "Inactive" ; +VAL_TABLE_ LKAButton 1 "Active" 0 "Inactive" ; +VAL_TABLE_ ACCButtons 6 "Cancel" 5 "Main" 3 "Set" 2 "Resume" 1 "None" ; +VAL_TABLE_ DriveModeButton 1 "Active" 0 "Inactive" ; +VAL_TABLE_ PRNDL 3 "Reverse" 2 "Drive" 1 "Neutral" 0 "Park" ; +VAL_TABLE_ ESPButton 1 "Active" 0 "Inactive" ; +VAL_TABLE_ DoorStatus 1 "Opened" 0 "Closed" ; +VAL_TABLE_ SeatBeltStatus 1 "Latched" 0 "Unlatched" ; +VAL_TABLE_ LKASteeringCmdActive 1 "Active" 0 "Inactive" ; +VAL_TABLE_ ACCGapLevel 3 "Far" 2 "Med" 1 "Near" 0 "Inactive" ; +VAL_TABLE_ GasRegenCmdActiveInv 1 "Inactive" 0 "Active" ; +VAL_TABLE_ GasRegenCmdActive 1 "Active" 0 "Inactive" ; +VAL_TABLE_ LKATorqueDeliveredStatus 3 "Failed" 2 "Temp. Limited" 1 "Active" 0 "Inactive" ; +VAL_TABLE_ HandsOffSWDetectionStatus 1 "Hands On" 0 "Hands Off" ; +VAL_TABLE_ HandsOffSWDetectionMode 2 "Failed" 1 "Enabled" 0 "Disabled" ; + + +BO_ 189 EBCMRegenPaddle: 7 K17_EBCM + SG_ RegenPaddle : 7|4@0+ (1,0) [0|0] "" NEO + +BO_ 190 ECMAcceleratorPos: 6 K20_ECM + SG_ BrakePedalPos : 15|8@0+ (1,0) [0|0] "sticky" NEO + SG_ GasPedalAndAcc : 23|8@0+ (1,0) [0|0] "" NEO + +BO_ 201 ECMEngineStatus: 8 K20_ECM + SG_ EngineTPS : 39|8@0+ (0.392156863,0) [0|100.000000065] "%" NEO + SG_ EngineRPM : 15|16@0+ (0.25,0) [0|0] "RPM" NEO + SG_ CruiseMainOn : 29|1@0+ (1,0) [0|1] "" NEO + SG_ Brake_Pressed : 40|1@0+ (1,0) [0|1] "" NEO + SG_ Standstill : 2|1@0+ (1,0) [0|1] "" NEO + +BO_ 209 EBCMBrakePedalSensors: 7 K17_EBCM + SG_ Counter1 : 7|2@0+ (1,0) [0|3] "" XXX + SG_ Counter2 : 23|2@0+ (1,0) [0|3] "" XXX + SG_ BrakePedalPosition1 : 5|14@0+ (1,0) [0|16383] "" XXX + SG_ BrakePedalPosition2 : 21|14@0- (-1,0) [0|16383] "" XXX + SG_ BrakeNormalized1 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ BrakeNormalized2 : 47|8@0- (-1,0) [0|255] "" XXX + +BO_ 241 EBCMBrakePedalPosition: 6 K17_EBCM + SG_ BrakePedalPosition : 15|8@0+ (1,0) [0|255] "" NEO + +BO_ 298 BCMDoorBeltStatus: 8 K9_BCM + SG_ RearLeftDoor : 8|1@0+ (1,0) [0|0] "" NEO + SG_ FrontLeftDoor : 9|1@0+ (1,0) [0|0] "" NEO + SG_ FrontRightDoor : 10|1@0+ (1,0) [0|0] "" NEO + SG_ RearRightDoor : 23|1@0+ (1,0) [0|0] "" NEO + SG_ LeftSeatBelt : 12|1@0+ (1,0) [0|0] "" NEO + SG_ RightSeatBelt : 53|1@0+ (1,0) [0|0] "" NEO + +BO_ 309 ECMPRDNL: 8 K20_ECM + SG_ PRNDL : 2|3@0+ (1,0) [0|0] "" NEO + SG_ ESPButton : 4|1@0+ (1,0) [0|1] "" XXX + +BO_ 320 BCMTurnSignals: 3 K9_BCM + SG_ TurnSignals : 19|2@0+ (1,0) [0|0] "" NEO + SG_ Intellibeam : 13|1@0+ (1,0) [0|1] "" XXX + SG_ HighBeamsActive : 7|1@0+ (1,0) [0|1] "" XXX + SG_ HighBeamsTemporary : 5|1@0+ (1,0) [0|1] "" XXX + +BO_ 328 PSCM_148: 1 K43_PSCM + +BO_ 381 ESPStatus: 6 K20_ECM + SG_ TractionControlOn : 5|1@0+ (1,0) [0|0] "" NEO + SG_ MSG17D_AccPower : 35|12@0- (1,0) [0|0] "" NEO + +BO_ 384 ASCMLKASteeringCmd: 4 NEO + SG_ RollingCounter : 5|2@0+ (1,0) [0|0] "" NEO + SG_ LKASteeringCmdChecksum : 19|12@0+ (1,0) [0|0] "" NEO + SG_ LKASteeringCmdActive : 3|1@0+ (1,0) [0|0] "" NEO + SG_ LKASteeringCmd : 2|11@0- (1,0) [0|0] "" NEO + +BO_ 388 PSCMStatus: 8 K43_PSCM + SG_ HandsOffSWDetectionMode : 20|2@0+ (1,0) [0|3] "" NEO + SG_ HandsOffSWlDetectionStatus : 21|1@0+ (1,0) [0|1] "" NEO + SG_ LKATorqueDeliveredStatus : 5|3@0+ (1,0) [0|7] "" NEO + SG_ LKADriverAppldTrq : 50|11@0- (0.01,0) [-10.24|10.23] "Nm" NEO + SG_ LKATorqueDelivered : 18|11@0- (0.01,0) [0|1] "" NEO + SG_ LKATotalTorqueDelivered : 2|11@0- (0.01,0) [-10.24|10.23] "Nm" NEO + +BO_ 417 AcceleratorPedal: 7 XXX + SG_ AcceleratorPedal : 55|8@0+ (1,0) [0|0] "" NEO + +BO_ 451 GasAndAcc: 8 XXX + SG_ GasPedalAndAcc2 : 55|8@0+ (1,0) [0|0] "" NEO + +BO_ 452 AcceleratorPedal2: 8 XXX + SG_ CruiseState : 15|3@0+ (1,0) [0|7] "" NEO + SG_ AcceleratorPedal2 : 47|8@0+ (1,0) [0|0] "" NEO + +BO_ 481 ASCMSteeringButton: 7 K124_ASCM + SG_ DistanceButton : 22|1@0+ (1,0) [0|0] "" NEO + SG_ LKAButton : 23|1@0+ (1,0) [0|0] "" NEO + SG_ ACCButtons : 46|3@0+ (1,0) [0|0] "" NEO + SG_ DriveModeButton : 39|1@0+ (1,0) [0|1] "" XXX + +BO_ 485 PSCMSteeringAngle: 8 K43_PSCM + SG_ SteeringWheelAngle : 15|16@0- (0.0625,0) [-2047|2047] "deg" NEO + SG_ SteeringWheelRate : 27|12@0- (1,0) [-2047|2047] "deg/s" NEO + +BO_ 489 EBCMVehicleDynamic: 8 K17_EBCM + SG_ BrakePedalPressed : 6|1@0+ (1,0) [0|0] "" NEO + SG_ LateralAcceleration : 3|10@0- (0.161,0) [-2047|2047] "m/s2" NEO + SG_ YawRate : 35|12@0- (0.625,0) [0|1] "" NEO + SG_ YawRate2 : 51|12@0- (0.0625,0) [-2047|2047] "grad/s" NEO + +BO_ 352 VehicleIgnition: 5 XXX + SG_ Ignition : 7|32@0+ (1,0) [0|4294967295] "" XXX + +BO_ 497 VehicleIgnitionAlt: 8 XXX + SG_ Ignition : 5|1@0+ (1,0) [0|1] "" XXX + +BO_ 501 ECMPRDNL2: 8 K20_ECM + SG_ TransmissionState : 48|4@1+ (1,0) [0|7] "" NEO + SG_ PRNDL2 : 27|4@0+ (1,0) [0|255] "" NEO + SG_ ManualMode : 41|1@0+ (1,0) [0|1] "" NEO + +BO_ 560 EPBStatus: 8 EPB + SG_ EPBClosed : 12|1@0+ (1,0) [0|1] "" NEO + +BO_ 711 BECMBatteryVoltageCurrent: 6 K17_EBCM + SG_ HVBatteryVoltage : 31|12@0+ (0.125,0) [0|511.875] "V" NEO + SG_ HVBatteryCurrent : 12|13@0- (0.15,0) [-614.4|614.25] "A" NEO + +BO_ 715 ASCMGasRegenCmd: 8 K124_ASCM + SG_ GasRegenAlwaysOne2 : 9|1@0+ (1,0) [0|1] "" NEO + SG_ GasRegenAlwaysOne : 14|1@0+ (1,0) [0|1] "" NEO + SG_ GasRegenChecksum : 47|24@0+ (1,0) [0|0] "" NEO + SG_ GasRegenCmdActiveInv : 32|1@0+ (1,0) [0|0] "" NEO + SG_ GasRegenFullStopActive : 13|1@0+ (1,0) [0|0] "" NEO + SG_ GasRegenCmdActive : 0|1@0+ (1,0) [0|0] "" NEO + SG_ RollingCounter : 7|2@0+ (1,0) [0|0] "" NEO + SG_ GasRegenAlwaysOne3 : 23|1@0+ (1,0) [0|1] "" NEO + SG_ GasRegenCmd : 22|12@0+ (1,0) [0|0] "" NEO + +BO_ 717 ASCM_2CD: 5 K124_ASCM + +BO_ 789 EBCMFrictionBrakeCmd: 5 K124_ASCM + SG_ RollingCounter : 33|2@0+ (1,0) [0|0] "" NEO + SG_ FrictionBrakeMode : 7|4@0+ (1,0) [0|0] "" NEO + SG_ FrictionBrakeChecksum : 23|16@0+ (1,0) [0|0] "" NEO + SG_ FrictionBrakeCmd : 3|12@0- (1,0) [0|0] "" NEO + +BO_ 800 AEBCmd: 6 K124_ASCM + SG_ RollingCounter : 5|2@0+ (1,0) [0|3] "" NEO + SG_ Checksum : 27|20@0+ (1,0) [0|2047] "" NEO + SG_ BrakeCmdActive : 3|1@1+ (1,0) [0|1] "" NEO + SG_ BrakingForce : 2|7@0+ (1,0) [0|7] "" NEO + +BO_ 810 TCICOnStarGPSPosition: 8 K73_TCIC + SG_ GPSLongitude : 39|32@0+ (1,-2147483648) [0|0] "milliarcsecond" NEO + SG_ GPSLatitude : 7|32@0+ (1,0) [0|0] "milliarcsecond" NEO + +BO_ 840 EBCMWheelSpdFront: 4 K17_EBCM + SG_ FLWheelSpd : 7|16@0+ (0.0311,0) [0|255] "km/h" NEO + SG_ FRWheelSpd : 23|16@0+ (0.0311,0) [0|255] "km/h" NEO + +BO_ 842 EBCMWheelSpdRear: 5 K17_EBCM + SG_ RLWheelSpd : 7|16@0+ (0.0311,0) [0|255] "km/h" NEO + SG_ RRWheelSpd : 23|16@0+ (0.0311,0) [0|255] "km/h" NEO + +BO_ 869 ASCM_365: 4 K124_ASCM + +BO_ 880 ASCMActiveCruiseControlStatus: 6 K124_ASCM + SG_ ACCLeadCar : 44|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ ACCAlwaysOne2 : 32|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ ACCAlwaysOne : 0|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ ACCSpeedSetpoint : 19|12@0+ (1,0) [0|0] "km/h" NEO + SG_ ACCGapLevel : 21|2@0+ (1,0) [0|0] "" NEO + SG_ ACCResumeButton : 1|1@0+ (1,0) [0|0] "" NEO + SG_ ACCCmdActive : 23|1@0+ (1,0) [0|0] "" NEO + SG_ FCWAlert : 41|2@0+ (1,0) [0|3] "" XXX + +BO_ 1001 ECMVehicleSpeed: 8 K20_ECM + SG_ VehicleSpeed : 7|16@0+ (0.01,0) [0|0] "mph" NEO + +BO_ 1033 ASCMKeepAlive: 7 NEO + SG_ ASCMKeepAliveAllZero : 7|56@0+ (1,0) [0|0] "" NEO + +BO_ 1034 ASCM_40A: 7 K124_ASCM + +BO_ 1217 ECMEngineCoolantTemp: 8 K20_ECM + SG_ EngineCoolantTemp : 23|8@0+ (1,-40) [0|0] "C" NEO + +BO_ 1249 VIN_Part2: 8 K20_ECM + SG_ VINPart2 : 7|64@0+ (1,0) [0|0] "" NEO + +BO_ 1296 ASCM_510: 4 K124_ASCM + +BO_ 1300 VIN_Part1: 8 K20_ECM + SG_ VINPart1 : 7|64@0+ (1,0) [0|0] "" NEO + +BO_ 1912 PSCM_778: 8 K43_PSCM + +BO_ 1930 ASCM_78A: 7 K124_ASCM + +BO_TX_BU_ 384 : K124_ASCM,NEO; +BO_TX_BU_ 880 : NEO,K124_ASCM; +BO_TX_BU_ 1033 : K124_ASCM,NEO; +BO_TX_BU_ 715 : NEO,K124_ASCM; +BO_TX_BU_ 789 : NEO,K124_ASCM; +BO_TX_BU_ 800 : NEO,K124_ASCM; + + +CM_ BU_ K16_BECM "Battery Energy Control Module"; +CM_ BU_ K73_TCIC "Telematics Communication Control Module"; +CM_ BU_ K9_BCM "Body Control Module"; +CM_ BU_ K43_PSCM "Power Steering Control Module"; +CM_ BU_ K17_EBCM "Electronic Brake Control Module"; +CM_ BU_ K20_ECM "Engine Control Module"; +CM_ BU_ K114B_HPCM "Hybrid Powertrain Control Module"; +CM_ BU_ NEO "Comma NEO"; +CM_ BU_ K124_ASCM "Active Safety Control Module"; +CM_ SG_ 381 MSG17D_AccPower "Need to investigate"; +CM_ SG_ 190 GasPedalAndAcc "ACC baseline is 62"; +CM_ SG_ 352 Ignition "Non-zero when ignition is on"; +CM_ SG_ 451 GasPedalAndAcc2 "ACC baseline is 62"; +CM_ SG_ 497 Ignition "Describes ignition + preconditioning mode, noisy"; +CM_ SG_ 501 PRNDL2 "When ManualMode is Active, Value is 13=L1 12=L2 11=L3 ... 4=L10"; +BA_DEF_ "UseGMParameterIDs" INT 0 0; +BA_DEF_ "ProtocolType" STRING ; +BA_DEF_ "BusType" STRING ; +BA_DEF_DEF_ "UseGMParameterIDs" 1; +BA_DEF_DEF_ "ProtocolType" "GMLAN"; +BA_DEF_DEF_ "BusType" ""; +BA_ "BusType" "CAN"; +BA_ "ProtocolType" "GMLAN"; +BA_ "UseGMParameterIDs" 0; +VAL_ 481 DistanceButton 1 "Active" 0 "Inactive" ; +VAL_ 481 LKAButton 1 "Active" 0 "Inactive" ; +VAL_ 481 ACCButtons 6 "Cancel" 5 "Main" 3 "Set" 2 "Resume" 1 "None" ; +VAL_ 481 DriveModeButton 1 "Active" 0 "Inactive" ; +VAL_ 452 CruiseState 4 "Standstill" 3 "Faulted" 1 "Active" 0 "Off" ; +VAL_ 309 PRNDL 3 "R" 2 "D" 1 "N" 0 "P" ; +VAL_ 309 ESPButton 1 "Active" 0 "Inactive" ; +VAL_ 384 LKASteeringCmdActive 1 "Active" 0 "Inactive" ; +VAL_ 880 ACCLeadCar 1 "Present" 0 "Not Present" ; +VAL_ 880 ACCGapLevel 3 "Far" 2 "Med" 1 "Near" 0 "Inactive" ; +VAL_ 880 ACCResumeButton 1 "Pressed" 0 "Depressed" ; +VAL_ 880 ACCCmdActive 1 "Active" 0 "Inactive" ; +VAL_ 388 HandsOffSWDetectionMode 2 "Failed" 1 "Enabled" 0 "Disabled" ; +VAL_ 388 HandsOffSWlDetectionStatus 1 "Hands On" 0 "Hands Off" ; +VAL_ 388 LKATorqueDeliveredStatus 3 "Failed" 2 "Temp. Limited" 1 "Active" 0 "Inactive" ; +VAL_ 489 BrakePedalPressed 1 "Pressed" 0 "Depressed" ; +VAL_ 715 GasRegenCmdActiveInv 1 "Inactive" 0 "Active" ; +VAL_ 715 GasRegenCmdActive 1 "Active" 0 "Inactive" ; +VAL_ 320 Intellibeam 1 "Active" 0 "Inactive" ; +VAL_ 320 HighBeamsActive 1 "Active" 0 "Inactive" ; +VAL_ 320 HighBeamsTemporary 1 "Active" 0 "Inactive" ; +VAL_ 501 PRNDL2 6 "L" 4 "D" 3 "N" 2 "R" 1 "P" 0 "Shifting"; +VAL_ 501 TransmissionState 11 "Shifting" 10 "Reverse" 9 "Forward" 8 "Disengaged"; +VAL_ 501 ManualMode 1 "Active" 0 "Inactive" diff --git a/opendbc/honda_accord_2018_can_generated.dbc b/opendbc/honda_accord_2018_can_generated.dbc new file mode 100644 index 000000000..12b66c6ec --- /dev/null +++ b/opendbc/honda_accord_2018_can_generated.dbc @@ -0,0 +1,505 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _honda_common.dbc starts here"; +BO_ 304 GAS_PEDAL_2: 8 PCM + SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 316 GAS_PEDAL: 8 PCM + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 344 ENGINE_DATA: 8 PCM + SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 380 POWERTRAIN_DATA: 8 PCM + SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON + SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON + SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON + SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON + SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON + SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON + SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 420 VSA_STATUS: 8 VSA + SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON + SG_ COMPUTER_BRAKING : 23|1@0+ (1,0) [0|1] "" EON + SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 427 STEER_MOTOR_TORQUE: 3 EPS + SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON + SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON + SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON + +BO_ 464 WHEEL_SPEEDS: 8 VSA + SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 490 VEHICLE_DYNAMICS: 8 VSA + SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 773 SEATBELT_STATUS: 7 BDY + SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 804 CRUISE: 8 PCM + SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON + SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON + SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON + SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON + SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 829 LKAS_HUD: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 884 STALK_STATUS: 8 XXX + SG_ DASHBOARD_ALERT : 39|8@0+ (1,0) [0|255] "" EON + SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON + SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON + SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 891 STALK_STATUS_2: 8 XXX + SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON + SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX + SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 1029 DOORS_STATUS: 8 BDY + SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON + SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 304 "Seems to be platform-agnostic"; +CM_ SG_ 316 "Should exist on Nidec"; +CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged"; +CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping"; +CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light"; +CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light"; +CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed"; +CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; + +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 884 DASHBOARD_ALERT 0 "none" 51 "acc_problem" 55 "cmbs_problem" 75 "key_not_detected" 79 "fasten_seatbelt" 111 "lkas_problem" 131 "brake_system_problem" 132 "brake_hold_problem" 139 "tbd" 161 "door_open"; +VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off"; + + +CM_ "Imported file _bosch_2018.dbc starts here"; +BO_ 148 KINEMATICS: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (-0.035,17.92) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 25|10@0+ (-0.035,17.92) [-20|20] "m/s2" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +BO_ 228 STEERING_CONTROL: 5 EON + SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS + SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS + SG_ SET_ME_X00_2 : 31|8@0+ (1,0) [0|0] "" EPS + SG_ STEER_TORQUE : 7|16@0- (1,0) [-4096|4096] "" EPS + SG_ STEER_DOWN_TO_ZERO : 38|1@0+ (1,0) [0|1] "" EPS + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" EPS + +BO_ 229 BOSCH_SUPPLEMENTAL_1: 8 XXX + SG_ SET_ME_X04 : 0|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 8|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X80 : 16|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X10 : 24|8@1+ (1,0) [0|255] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 232 BRAKE_HOLD: 7 XXX + SG_ XMISSION_SPEED : 7|14@0- (1,0) [1|0] "" XXX + SG_ COMPUTER_BRAKE : 39|16@0+ (1,0) [0|0] "" XXX + SG_ COMPUTER_BRAKE_REQUEST : 29|1@0+ (1,0) [0|0] "" XXX + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" XXX + +BO_ 399 STEER_STATUS: 7 EPS + SG_ STEER_TORQUE_SENSOR : 7|16@0- (-1,0) [-31000|31000] "tbd" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON + SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" EON + SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON + SG_ STEER_CONFIG_INDEX : 43|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON + +BO_ 450 EPB_STATUS: 8 EPB + SG_ EPB_ACTIVE : 3|1@0+ (1,0) [0|1] "" EON + SG_ EPB_STATE : 29|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 479 ACC_CONTROL: 8 EON + SG_ SET_TO_0 : 20|5@0+ (1,0) [0|1] "" XXX + SG_ CONTROL_ON : 23|3@0+ (1,0) [0|5] "" XXX + SG_ GAS_COMMAND : 7|16@0- (1,0) [0|0] "" XXX + SG_ ACCEL_COMMAND : 31|11@0- (0.01,0) [0|0] "m/s2" XXX + SG_ BRAKE_LIGHTS : 62|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_REQUEST : 34|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL : 35|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL_RELEASE : 36|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_STATUS : 33|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_BRAKING : 47|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_PREPARE : 43|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 495 ACC_CONTROL_ON: 8 XXX + SG_ SET_TO_75 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_30 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ ZEROS_BOH : 23|8@0+ (1,0) [0|255] "" XXX + SG_ ZEROS_BOH2 : 47|16@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_FF : 15|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_3 : 6|7@0+ (1,0) [0|4095] "" XXX + SG_ CONTROL_ON : 7|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 545 XXX_16: 6 SCM + SG_ ECON_ON : 23|1@0+ (1,0) [0|1] "" XXX + SG_ DRIVE_MODE : 37|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" BDY + +BO_ 576 LEFT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 577 LEFT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 579 RIGHT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 580 RIGHT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 582 ADJACENT_LEFT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 583 ADJACENT_LEFT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 585 ADJACENT_RIGHT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 586 ADJACENT_RIGHT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA + SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON + SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON + SG_ LONG_COUNTER : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 662 SCM_BUTTONS: 4 SCM + SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON + SG_ CRUISE_SETTING : 3|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON + +BO_ 777 CAR_SPEED: 8 PCM + SG_ ROUGH_CAR_SPEED : 23|8@0+ (1,0) [0|255] "mph" XXX + SG_ CAR_SPEED : 7|16@0+ (0.01,0) [0|65535] "kph" XXX + SG_ ROUGH_CAR_SPEED_3 : 39|16@0+ (0.01,0) [0|65535] "kph" XXX + SG_ ROUGH_CAR_SPEED_2 : 31|8@0+ (1,0) [0|255] "mph" XXX + SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ IMPERIAL_UNIT : 63|1@0+ (1,0) [0|1] "" XXX + +BO_ 780 ACC_HUD: 8 ADAS + SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "kph" BDY + SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY + SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY + SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY + SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY + SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY + SG_ ZEROS_BOH : 7|24@0+ (0.002759506,0) [0|100] "m/s" BDY + SG_ FCM_OFF : 35|1@0+ (1,0) [0|1] "" BDY + SG_ SET_TO_1 : 36|1@0+ (1,0) [0|1] "" XXX + SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY + SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY + SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY + SG_ ACC_ON : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BOH_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ SET_TO_X1 : 55|1@0+ (1,0) [0|1] "" XXX + SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 806 SCM_FEEDBACK: 8 SCM + SG_ DRIVERS_DOOR_OPEN : 17|1@0+ (1,0) [0|1] "" XXX + SG_ MAIN_ON : 28|1@0+ (1,0) [0|1] "" EON + SG_ RIGHT_BLINKER : 27|1@0+ (1,0) [0|1] "" EON + SG_ LEFT_BLINKER : 26|1@0+ (1,0) [0|1] "" EON + SG_ CMBS_STATES : 22|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 862 CAMERA_MESSAGES: 8 CAM + SG_ ZEROS_BOH : 7|50@0+ (1,0) [0|127] "" BDY + SG_ AUTO_HIGHBEAMS_ACTIVE : 53|1@0+ (1,0) [0|1] "" XXX + SG_ HIGHBEAMS_ON : 52|1@0+ (1,0) [0|1] "" XXX + SG_ ZEROS_BOH_2 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 13274 LKAS_HUD_A: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 13275 LKAS_HUD_B: 8 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" BDY + +CM_ SG_ 450 EPB_STATE "3: On, 2: Disengaging, 1: Engaging, 0: Off"; +CM_ SG_ 479 CONTROL_ON "Set to 5 when car is being controlled"; +CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event"; +CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event"; +CM_ SG_ 479 AEB_PREPARE "set 1s before AEB"; +CM_ SG_ 576 LINE_DISTANCE_VISIBLE "Length of line visible, undecoded"; +CM_ SG_ 577 LINE_FAR_EDGE_POSITION "Appears to be a measure of line thickness, indicates location of the portion of the line furthest from the car, undecoded"; +CM_ SG_ 577 LINE_PARAMETER "Unclear if this is low quality line curvature rate or if this is something else, but it is correlated with line curvature, undecoded"; +CM_ SG_ 577 LINE_DASHED "1 = line is dashed"; +CM_ SG_ 577 LINE_SOLID "1 = line is solid"; + +VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal"; + +CM_ "honda_accord_2018_can.dbc starts here"; + +BO_ 330 STEERING_SENSORS: 8 EPS + SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON + SG_ STEER_SENSOR_STATUS_1 : 34|1@0+ (1,0) [0|1] "" EON + SG_ STEER_SENSOR_STATUS_2 : 33|1@0+ (1,0) [0|1] "" EON + SG_ STEER_SENSOR_STATUS_3 : 32|1@0+ (1,0) [0|1] "" EON + SG_ STEER_WHEEL_ANGLE : 47|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 401 GEARBOX_15T: 8 PCM + SG_ GEAR_SHIFTER : 5|6@0+ (1,0) [0|63] "" EON + SG_ BOH : 45|6@0+ (1,0) [0|63] "" XXX + SG_ GEAR2 : 31|8@0+ (1,0) [0|1] "" XXX + SG_ GEAR : 39|8@0+ (1,0) [0|255] "" XXX + SG_ ZEROS_BOH : 47|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 419 GEARBOX: 8 XXX + SG_ GEAR_SHIFTER : 24|8@1+ (1,0) [0|255] "" XXX + SG_ GEAR : 32|8@1+ (1,0) [0|255] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 432 STANDSTILL: 7 VSA + SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON + +BO_ 446 BRAKE_MODULE: 3 VSA + SG_ BRAKE_PRESSED : 4|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" XXX + +BO_ 506 LEGACY_BRAKE_COMMAND: 8 ADAS + SG_ CHIME : 40|8@1+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 892 CRUISE_PARAMS: 8 PCM + SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|15] "" EON + +BO_ 927 RADAR_HUD: 8 RADAR + SG_ ZEROS_BOH : 7|10@0+ (1,0) [0|127] "" BDY + SG_ CMBS_OFF : 12|1@0+ (1,0) [0|1] "" BDY + SG_ ZEROS_BOH3 : 31|32@0+ (1,0) [0|4294967295] "" XXX + SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_TO_1 : 13|1@0+ (1,0) [0|1] "" BDY + SG_ ZEROS_BOH2 : 11|4@0+ (1,0) [0|1] "" XXX + SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|1] "" XXX + SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|1] "" BDY + SG_ SET_TO_0 : 22|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|255] "" XXX + SG_ BOH : 40|1@0+ (1,0) [0|1] "" XXX + SG_ BOH_2 : 30|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 1302 ODOMETER: 8 XXX + SG_ ODOMETER : 7|24@0+ (1,0) [0|16777215] "km" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P"; +VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P"; +VAL_ 419 GEAR_SHIFTER 2 "S" 32 "D" 16 "N" 8 "R" 4 "P"; +VAL_ 419 GEAR 26 "S" 20 "D" 19 "N" 18 "R" 17 "P"; +VAL_ 545 ECON_ON_2 0 "off" 3 "on"; +VAL_ 662 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none"; +VAL_ 662 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none"; +VAL_ 806 CMBS_BUTTON 3 "pressed" 0 "released"; diff --git a/opendbc/honda_civic_hatchback_ex_2017_can_generated.dbc b/opendbc/honda_civic_hatchback_ex_2017_can_generated.dbc new file mode 100644 index 000000000..bd972f7f8 --- /dev/null +++ b/opendbc/honda_civic_hatchback_ex_2017_can_generated.dbc @@ -0,0 +1,484 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _honda_common.dbc starts here"; +BO_ 304 GAS_PEDAL_2: 8 PCM + SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 316 GAS_PEDAL: 8 PCM + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 344 ENGINE_DATA: 8 PCM + SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 380 POWERTRAIN_DATA: 8 PCM + SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON + SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON + SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON + SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON + SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON + SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON + SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 420 VSA_STATUS: 8 VSA + SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON + SG_ COMPUTER_BRAKING : 23|1@0+ (1,0) [0|1] "" EON + SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 427 STEER_MOTOR_TORQUE: 3 EPS + SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON + SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON + SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON + +BO_ 464 WHEEL_SPEEDS: 8 VSA + SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 490 VEHICLE_DYNAMICS: 8 VSA + SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 773 SEATBELT_STATUS: 7 BDY + SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 804 CRUISE: 8 PCM + SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON + SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON + SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON + SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON + SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 829 LKAS_HUD: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 884 STALK_STATUS: 8 XXX + SG_ DASHBOARD_ALERT : 39|8@0+ (1,0) [0|255] "" EON + SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON + SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON + SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 891 STALK_STATUS_2: 8 XXX + SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON + SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX + SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 1029 DOORS_STATUS: 8 BDY + SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON + SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 304 "Seems to be platform-agnostic"; +CM_ SG_ 316 "Should exist on Nidec"; +CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged"; +CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping"; +CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light"; +CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light"; +CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed"; +CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; + +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 884 DASHBOARD_ALERT 0 "none" 51 "acc_problem" 55 "cmbs_problem" 75 "key_not_detected" 79 "fasten_seatbelt" 111 "lkas_problem" 131 "brake_system_problem" 132 "brake_hold_problem" 139 "tbd" 161 "door_open"; +VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off"; + + +CM_ "Imported file _bosch_2018.dbc starts here"; +BO_ 148 KINEMATICS: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (-0.035,17.92) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 25|10@0+ (-0.035,17.92) [-20|20] "m/s2" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +BO_ 228 STEERING_CONTROL: 5 EON + SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS + SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS + SG_ SET_ME_X00_2 : 31|8@0+ (1,0) [0|0] "" EPS + SG_ STEER_TORQUE : 7|16@0- (1,0) [-4096|4096] "" EPS + SG_ STEER_DOWN_TO_ZERO : 38|1@0+ (1,0) [0|1] "" EPS + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" EPS + +BO_ 229 BOSCH_SUPPLEMENTAL_1: 8 XXX + SG_ SET_ME_X04 : 0|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 8|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X80 : 16|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X10 : 24|8@1+ (1,0) [0|255] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 232 BRAKE_HOLD: 7 XXX + SG_ XMISSION_SPEED : 7|14@0- (1,0) [1|0] "" XXX + SG_ COMPUTER_BRAKE : 39|16@0+ (1,0) [0|0] "" XXX + SG_ COMPUTER_BRAKE_REQUEST : 29|1@0+ (1,0) [0|0] "" XXX + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" XXX + +BO_ 399 STEER_STATUS: 7 EPS + SG_ STEER_TORQUE_SENSOR : 7|16@0- (-1,0) [-31000|31000] "tbd" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON + SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" EON + SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON + SG_ STEER_CONFIG_INDEX : 43|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON + +BO_ 450 EPB_STATUS: 8 EPB + SG_ EPB_ACTIVE : 3|1@0+ (1,0) [0|1] "" EON + SG_ EPB_STATE : 29|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 479 ACC_CONTROL: 8 EON + SG_ SET_TO_0 : 20|5@0+ (1,0) [0|1] "" XXX + SG_ CONTROL_ON : 23|3@0+ (1,0) [0|5] "" XXX + SG_ GAS_COMMAND : 7|16@0- (1,0) [0|0] "" XXX + SG_ ACCEL_COMMAND : 31|11@0- (0.01,0) [0|0] "m/s2" XXX + SG_ BRAKE_LIGHTS : 62|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_REQUEST : 34|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL : 35|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL_RELEASE : 36|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_STATUS : 33|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_BRAKING : 47|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_PREPARE : 43|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 495 ACC_CONTROL_ON: 8 XXX + SG_ SET_TO_75 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_30 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ ZEROS_BOH : 23|8@0+ (1,0) [0|255] "" XXX + SG_ ZEROS_BOH2 : 47|16@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_FF : 15|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_3 : 6|7@0+ (1,0) [0|4095] "" XXX + SG_ CONTROL_ON : 7|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 545 XXX_16: 6 SCM + SG_ ECON_ON : 23|1@0+ (1,0) [0|1] "" XXX + SG_ DRIVE_MODE : 37|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" BDY + +BO_ 576 LEFT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 577 LEFT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 579 RIGHT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 580 RIGHT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 582 ADJACENT_LEFT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 583 ADJACENT_LEFT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 585 ADJACENT_RIGHT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 586 ADJACENT_RIGHT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA + SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON + SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON + SG_ LONG_COUNTER : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 662 SCM_BUTTONS: 4 SCM + SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON + SG_ CRUISE_SETTING : 3|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON + +BO_ 777 CAR_SPEED: 8 PCM + SG_ ROUGH_CAR_SPEED : 23|8@0+ (1,0) [0|255] "mph" XXX + SG_ CAR_SPEED : 7|16@0+ (0.01,0) [0|65535] "kph" XXX + SG_ ROUGH_CAR_SPEED_3 : 39|16@0+ (0.01,0) [0|65535] "kph" XXX + SG_ ROUGH_CAR_SPEED_2 : 31|8@0+ (1,0) [0|255] "mph" XXX + SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ IMPERIAL_UNIT : 63|1@0+ (1,0) [0|1] "" XXX + +BO_ 780 ACC_HUD: 8 ADAS + SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "kph" BDY + SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY + SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY + SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY + SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY + SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY + SG_ ZEROS_BOH : 7|24@0+ (0.002759506,0) [0|100] "m/s" BDY + SG_ FCM_OFF : 35|1@0+ (1,0) [0|1] "" BDY + SG_ SET_TO_1 : 36|1@0+ (1,0) [0|1] "" XXX + SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY + SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY + SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY + SG_ ACC_ON : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BOH_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ SET_TO_X1 : 55|1@0+ (1,0) [0|1] "" XXX + SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 806 SCM_FEEDBACK: 8 SCM + SG_ DRIVERS_DOOR_OPEN : 17|1@0+ (1,0) [0|1] "" XXX + SG_ MAIN_ON : 28|1@0+ (1,0) [0|1] "" EON + SG_ RIGHT_BLINKER : 27|1@0+ (1,0) [0|1] "" EON + SG_ LEFT_BLINKER : 26|1@0+ (1,0) [0|1] "" EON + SG_ CMBS_STATES : 22|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 862 CAMERA_MESSAGES: 8 CAM + SG_ ZEROS_BOH : 7|50@0+ (1,0) [0|127] "" BDY + SG_ AUTO_HIGHBEAMS_ACTIVE : 53|1@0+ (1,0) [0|1] "" XXX + SG_ HIGHBEAMS_ON : 52|1@0+ (1,0) [0|1] "" XXX + SG_ ZEROS_BOH_2 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 13274 LKAS_HUD_A: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 13275 LKAS_HUD_B: 8 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" BDY + +CM_ SG_ 450 EPB_STATE "3: On, 2: Disengaging, 1: Engaging, 0: Off"; +CM_ SG_ 479 CONTROL_ON "Set to 5 when car is being controlled"; +CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event"; +CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event"; +CM_ SG_ 479 AEB_PREPARE "set 1s before AEB"; +CM_ SG_ 576 LINE_DISTANCE_VISIBLE "Length of line visible, undecoded"; +CM_ SG_ 577 LINE_FAR_EDGE_POSITION "Appears to be a measure of line thickness, indicates location of the portion of the line furthest from the car, undecoded"; +CM_ SG_ 577 LINE_PARAMETER "Unclear if this is low quality line curvature rate or if this is something else, but it is correlated with line curvature, undecoded"; +CM_ SG_ 577 LINE_DASHED "1 = line is dashed"; +CM_ SG_ 577 LINE_SOLID "1 = line is solid"; + +VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal"; + +CM_ "honda_civic_hatchback_ex_2017_can.dbc starts here"; + +BO_ 330 STEERING_SENSORS: 8 EPS + SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON + SG_ STEER_SENSOR_STATUS_1 : 34|1@0+ (1,0) [0|1] "" EON + SG_ STEER_SENSOR_STATUS_2 : 33|1@0+ (1,0) [0|1] "" EON + SG_ STEER_SENSOR_STATUS_3 : 32|1@0+ (1,0) [0|1] "" EON + SG_ STEER_WHEEL_ANGLE : 47|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 401 GEARBOX: 8 PCM + SG_ GEAR_SHIFTER : 5|6@0+ (1,0) [0|63] "" EON + SG_ BOH : 45|6@0+ (1,0) [0|63] "" XXX + SG_ GEAR2 : 31|8@0+ (1,0) [0|1] "" XXX + SG_ GEAR : 39|8@0+ (1,0) [0|255] "" XXX + SG_ ZEROS_BOH : 47|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 432 STANDSTILL: 7 VSA + SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON + +BO_ 506 LEGACY_BRAKE_COMMAND: 8 ADAS + SG_ CHIME : 40|8@1+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 892 CRUISE_PARAMS: 8 PCM + SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|15] "" EON + +BO_ 927 RADAR_HUD: 8 RADAR + SG_ ZEROS_BOH : 7|10@0+ (1,0) [0|127] "" BDY + SG_ CMBS_OFF : 12|1@0+ (1,0) [0|1] "" BDY + SG_ ZEROS_BOH3 : 31|32@0+ (1,0) [0|4294967295] "" XXX + SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_TO_1 : 13|1@0+ (1,0) [0|1] "" BDY + SG_ ZEROS_BOH2 : 11|4@0+ (1,0) [0|1] "" XXX + SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|1] "" XXX + SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|1] "" BDY + SG_ SET_TO_0 : 22|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P" ; +VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ; +VAL_ 545 ECON_ON_2 0 "off" 3 "on" ; +VAL_ 662 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ; +VAL_ 662 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ; +VAL_ 806 CMBS_BUTTON 3 "pressed" 0 "released" ; diff --git a/opendbc/honda_civic_touring_2016_can_generated.dbc b/opendbc/honda_civic_touring_2016_can_generated.dbc new file mode 100644 index 000000000..3a2a196fd --- /dev/null +++ b/opendbc/honda_civic_touring_2016_can_generated.dbc @@ -0,0 +1,378 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + +BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-83.3) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + +VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + + +CM_ "Imported file _honda_common.dbc starts here"; +BO_ 304 GAS_PEDAL_2: 8 PCM + SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 316 GAS_PEDAL: 8 PCM + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 344 ENGINE_DATA: 8 PCM + SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 380 POWERTRAIN_DATA: 8 PCM + SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON + SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON + SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON + SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON + SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON + SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON + SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 420 VSA_STATUS: 8 VSA + SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON + SG_ COMPUTER_BRAKING : 23|1@0+ (1,0) [0|1] "" EON + SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 427 STEER_MOTOR_TORQUE: 3 EPS + SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON + SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON + SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON + +BO_ 464 WHEEL_SPEEDS: 8 VSA + SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 490 VEHICLE_DYNAMICS: 8 VSA + SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 773 SEATBELT_STATUS: 7 BDY + SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 804 CRUISE: 8 PCM + SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON + SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON + SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON + SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON + SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 829 LKAS_HUD: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 884 STALK_STATUS: 8 XXX + SG_ DASHBOARD_ALERT : 39|8@0+ (1,0) [0|255] "" EON + SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON + SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON + SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 891 STALK_STATUS_2: 8 XXX + SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON + SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX + SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 1029 DOORS_STATUS: 8 BDY + SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON + SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 304 "Seems to be platform-agnostic"; +CM_ SG_ 316 "Should exist on Nidec"; +CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged"; +CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping"; +CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light"; +CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light"; +CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed"; +CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; + +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 884 DASHBOARD_ALERT 0 "none" 51 "acc_problem" 55 "cmbs_problem" 75 "key_not_detected" 79 "fasten_seatbelt" 111 "lkas_problem" 131 "brake_system_problem" 132 "brake_hold_problem" 139 "tbd" 161 "door_open"; +VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off"; + + +CM_ "Imported file _honda_2017.dbc starts here"; +BO_ 145 KINEMATICS: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 148 KINEMATICS_ALT: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 24|9@0- (-0.02,0) [-20|20] "m/s2" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +BO_ 432 STANDSTILL: 7 VSA + SG_ CONTROLLED_STANDSTILL : 0|1@0+ (1,0) [0|1] "" EON + SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 487 BRAKE_PRESSURE: 4 VSA + SG_ BRAKE_PRESSURE1 : 7|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ BRAKE_PRESSURE2 : 9|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + +BO_ 506 BRAKE_COMMAND: 8 ADAS + SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00 : 13|5@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_2 : 23|3@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_3 : 19|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_1 : 31|1@0+ (1,0) [0|1] "" EBCM + SG_ AEB_REQ_1 : 29|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_REQ_2 : 26|3@0+ (1,0) [0|7] "" XXX + SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM + SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM + SG_ SET_ME_X00_4 : 44|1@0+ (1,0) [0|1] "" EBCM + SG_ FCW : 43|2@0+ (1,0) [0|3] "" EBCM + SG_ AEB_STATUS : 41|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X00_5 : 55|8@0+ (1,0) [0|0] "" EBCM + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EBCM + +BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA + SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON + SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" EON + SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 777 LOCK_STATUS: 8 XXX + SG_ DOORS_UNLOCKED : 54|1@0+ (1,0) [0|1] "" EON + SG_ DOORS_LOCKED : 55|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 780 ACC_HUD: 8 ADAS + SG_ PCM_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" BDY + SG_ PCM_GAS : 23|8@0+ (1,0) [0|127] "" BDY + SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY + SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY + SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF_2 : 35|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY + SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY + SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY + SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY + SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY + SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY + SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY + SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY + SG_ CHIME : 51|3@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 48|1@0+ (1,0) [0|1] "" BDY + SG_ ICONS : 63|2@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY + +BO_ 892 CRUISE_PARAMS: 8 PCM + SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +CM_ SG_ 506 AEB_REQ_1 "set for duration of suspected AEB event"; +CM_ SG_ 780 CRUISE_SPEED "255 = no speed"; + +VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw"; +VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime"; +VAL_ 506 AEB_STATUS 3 "aeb_prepare" 2 "aeb_ready" 1 "aeb_braking" 0 "no_aeb"; +VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped"; +VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car"; + +CM_ "honda_civic_touring_2016_can.dbc starts here"; + +BO_ 228 STEERING_CONTROL: 5 ADAS + SG_ STEER_TORQUE : 7|16@0- (1,0) [-3840|3840] "" EPS + SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS + SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS + SG_ SET_ME_X00_2 : 31|8@0+ (1,0) [0|0] "" EPS + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" EPS + +BO_ 330 STEERING_SENSORS: 8 EPS + SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON + SG_ STEER_SENSOR_STATUS_1 : 34|1@0+ (1,0) [0|1] "" EON + SG_ STEER_SENSOR_STATUS_2 : 33|1@0+ (1,0) [0|1] "" EON + SG_ STEER_SENSOR_STATUS_3 : 32|1@0+ (1,0) [0|1] "" EON + SG_ STEER_WHEEL_ANGLE : 47|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 399 STEER_STATUS: 7 EPS + SG_ STEER_TORQUE_SENSOR : 7|16@0- (-1,0) [-31000|31000] "tbd" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON + SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" EON + SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON + SG_ STEER_CONFIG_INDEX : 43|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 401 GEARBOX: 8 PCM + SG_ GEAR_SHIFTER : 5|6@0+ (1,0) [0|63] "" EON + SG_ GEAR : 43|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 450 EPB_STATUS: 8 EPB + SG_ EPB_ACTIVE : 3|1@0+ (1,0) [0|1] "" EON + SG_ EPB_STATE : 29|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 493 HUD_SETTING: 5 XXX + SG_ IMPERIAL_UNIT : 5|1@0+ (1,0) [0|1] "" EON + +BO_ 545 ECON_STATUS: 6 XXX + SG_ ECON_ON_2 : 37|2@0+ (1,0) [0|3] "" EON + SG_ ECON_ON : 23|1@0+ (1,0) [0|1] "" EON + SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON + +BO_ 662 SCM_BUTTONS: 4 SCM + SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON + SG_ CRUISE_SETTING : 3|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + +BO_ 806 SCM_FEEDBACK: 8 SCM + SG_ CMBS_BUTTON : 22|2@0+ (1,0) [0|3] "" EON + SG_ MAIN_ON : 28|1@0+ (1,0) [0|1] "" EON + SG_ RIGHT_BLINKER : 27|1@0+ (1,0) [0|1] "" EON + SG_ LEFT_BLINKER : 26|1@0+ (1,0) [0|1] "" EON + SG_ REVERSE_LIGHT : 18|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 862 HIGHBEAM_CONTROL: 8 ADAS + SG_ ZEROS_BOH : 7|50@0+ (1,0) [0|127] "" BDY + SG_ ZEROS_BOH_2 : 48|4@1+ (1,0) [0|15] "" XXX + SG_ HIGHBEAMS_ON : 52|1@0+ (1,0) [0|1] "" XXX + SG_ AUTO_HIGHBEAMS_ACTIVE : 53|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 927 RADAR_HUD: 8 ADAS + SG_ ZEROS_BOH : 7|17@0+ (1,0) [0|127] "" BDY + SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|15] "" BDY + SG_ ZEROS_BOH2 : 31|8@0+ (1,0) [0|127] "" BDY + SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|15] "" BDY + SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|15] "" BDY + SG_ LEAD_SPEED : 39|9@0+ (1,0) [0|127] "" BDY + SG_ LEAD_STATE : 46|3@0+ (1,0) [0|127] "" BDY + SG_ LEAD_DISTANCE : 43|5@0+ (1,0) [0|31] "" BDY + SG_ ZEROS_BOH3 : 54|7@0+ (1,0) [0|127] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY + +BO_ 1302 ODOMETER: 8 XXX + SG_ ODOMETER : 7|24@0+ (1,0) [0|16777215] "km" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +CM_ SG_ 401 GEAR "10 = reverse, 11 = transition"; +CM_ SG_ 450 EPB_STATE "3 \"engaged\" 2 \"disengaging\" 1 \"engaging\" 0 \"disengaged\""; +CM_ SG_ 806 REVERSE_LIGHT "Might be reverse gear selected and not the lights"; + +VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ; +VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P" ; +VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ; +VAL_ 450 EPB_STATE 3 "engaged" 2 "disengaging" 1 "engaging" 0 "disengaged" ; +VAL_ 545 ECON_ON_2 0 "off" 3 "on" ; +VAL_ 662 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ; +VAL_ 662 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ; +VAL_ 806 CMBS_BUTTON 3 "pressed" 0 "released" ; +VAL_ 927 ACC_ALERTS 29 "esp_active_acc_canceled" 10 "b_pedal_applied" 9 "speed_too_low" 8 "speed_too_high" 7 "p_brake_applied" 6 "gear_no_d" 5 "seatbelt" 4 "too_steep_downhill" 3 "too_steep_uphill" 2 "too_close" 1 "no_vehicle_ahead" ; diff --git a/opendbc/honda_crv_ex_2017_body_generated.dbc b/opendbc/honda_crv_ex_2017_body_generated.dbc new file mode 100644 index 000000000..4d154e53f --- /dev/null +++ b/opendbc/honda_crv_ex_2017_body_generated.dbc @@ -0,0 +1,13 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + +CM_ "honda_crv_ex_2017_body.dbc starts here"; +BO_ 318291879 BSM_STATUS_RIGHT: 8 XXX + SG_ BSM_ALERT : 4|1@0+ (1,0) [0|1] "" XXX + SG_ BSM_MODE : 6|2@0+ (1,0) [0|3] "" XXX + +BO_ 318291615 BSM_STATUS_LEFT: 8 XXX + SG_ BSM_ALERT : 4|1@0+ (1,0) [0|1] "" XXX + SG_ BSM_MODE : 6|2@0+ (1,0) [0|3] "" XXX + +VAL_ 318291879 BSM_MODE 2 "blind_spot" 1 "cross_traffic" 0 "off"; +VAL_ 318291615 BSM_MODE 2 "blind_spot" 1 "cross_traffic" 0 "off"; diff --git a/opendbc/honda_crv_ex_2017_can_generated.dbc b/opendbc/honda_crv_ex_2017_can_generated.dbc new file mode 100644 index 000000000..95b0f46ba --- /dev/null +++ b/opendbc/honda_crv_ex_2017_can_generated.dbc @@ -0,0 +1,487 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _honda_common.dbc starts here"; +BO_ 304 GAS_PEDAL_2: 8 PCM + SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 316 GAS_PEDAL: 8 PCM + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 344 ENGINE_DATA: 8 PCM + SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 380 POWERTRAIN_DATA: 8 PCM + SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON + SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON + SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON + SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON + SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON + SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON + SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 420 VSA_STATUS: 8 VSA + SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON + SG_ COMPUTER_BRAKING : 23|1@0+ (1,0) [0|1] "" EON + SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 427 STEER_MOTOR_TORQUE: 3 EPS + SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON + SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON + SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON + +BO_ 464 WHEEL_SPEEDS: 8 VSA + SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 490 VEHICLE_DYNAMICS: 8 VSA + SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 773 SEATBELT_STATUS: 7 BDY + SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 804 CRUISE: 8 PCM + SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON + SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON + SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON + SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON + SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 829 LKAS_HUD: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 884 STALK_STATUS: 8 XXX + SG_ DASHBOARD_ALERT : 39|8@0+ (1,0) [0|255] "" EON + SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON + SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON + SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 891 STALK_STATUS_2: 8 XXX + SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON + SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX + SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 1029 DOORS_STATUS: 8 BDY + SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON + SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 304 "Seems to be platform-agnostic"; +CM_ SG_ 316 "Should exist on Nidec"; +CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged"; +CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping"; +CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light"; +CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light"; +CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed"; +CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; + +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 884 DASHBOARD_ALERT 0 "none" 51 "acc_problem" 55 "cmbs_problem" 75 "key_not_detected" 79 "fasten_seatbelt" 111 "lkas_problem" 131 "brake_system_problem" 132 "brake_hold_problem" 139 "tbd" 161 "door_open"; +VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off"; + + +CM_ "Imported file _bosch_2018.dbc starts here"; +BO_ 148 KINEMATICS: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (-0.035,17.92) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 25|10@0+ (-0.035,17.92) [-20|20] "m/s2" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +BO_ 228 STEERING_CONTROL: 5 EON + SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS + SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS + SG_ SET_ME_X00_2 : 31|8@0+ (1,0) [0|0] "" EPS + SG_ STEER_TORQUE : 7|16@0- (1,0) [-4096|4096] "" EPS + SG_ STEER_DOWN_TO_ZERO : 38|1@0+ (1,0) [0|1] "" EPS + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" EPS + +BO_ 229 BOSCH_SUPPLEMENTAL_1: 8 XXX + SG_ SET_ME_X04 : 0|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 8|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X80 : 16|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X10 : 24|8@1+ (1,0) [0|255] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 232 BRAKE_HOLD: 7 XXX + SG_ XMISSION_SPEED : 7|14@0- (1,0) [1|0] "" XXX + SG_ COMPUTER_BRAKE : 39|16@0+ (1,0) [0|0] "" XXX + SG_ COMPUTER_BRAKE_REQUEST : 29|1@0+ (1,0) [0|0] "" XXX + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" XXX + +BO_ 399 STEER_STATUS: 7 EPS + SG_ STEER_TORQUE_SENSOR : 7|16@0- (-1,0) [-31000|31000] "tbd" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON + SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" EON + SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON + SG_ STEER_CONFIG_INDEX : 43|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON + +BO_ 450 EPB_STATUS: 8 EPB + SG_ EPB_ACTIVE : 3|1@0+ (1,0) [0|1] "" EON + SG_ EPB_STATE : 29|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 479 ACC_CONTROL: 8 EON + SG_ SET_TO_0 : 20|5@0+ (1,0) [0|1] "" XXX + SG_ CONTROL_ON : 23|3@0+ (1,0) [0|5] "" XXX + SG_ GAS_COMMAND : 7|16@0- (1,0) [0|0] "" XXX + SG_ ACCEL_COMMAND : 31|11@0- (0.01,0) [0|0] "m/s2" XXX + SG_ BRAKE_LIGHTS : 62|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_REQUEST : 34|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL : 35|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL_RELEASE : 36|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_STATUS : 33|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_BRAKING : 47|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_PREPARE : 43|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 495 ACC_CONTROL_ON: 8 XXX + SG_ SET_TO_75 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_30 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ ZEROS_BOH : 23|8@0+ (1,0) [0|255] "" XXX + SG_ ZEROS_BOH2 : 47|16@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_FF : 15|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_3 : 6|7@0+ (1,0) [0|4095] "" XXX + SG_ CONTROL_ON : 7|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 545 XXX_16: 6 SCM + SG_ ECON_ON : 23|1@0+ (1,0) [0|1] "" XXX + SG_ DRIVE_MODE : 37|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" BDY + +BO_ 576 LEFT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 577 LEFT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 579 RIGHT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 580 RIGHT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 582 ADJACENT_LEFT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 583 ADJACENT_LEFT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 585 ADJACENT_RIGHT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 586 ADJACENT_RIGHT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA + SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON + SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON + SG_ LONG_COUNTER : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 662 SCM_BUTTONS: 4 SCM + SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON + SG_ CRUISE_SETTING : 3|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON + +BO_ 777 CAR_SPEED: 8 PCM + SG_ ROUGH_CAR_SPEED : 23|8@0+ (1,0) [0|255] "mph" XXX + SG_ CAR_SPEED : 7|16@0+ (0.01,0) [0|65535] "kph" XXX + SG_ ROUGH_CAR_SPEED_3 : 39|16@0+ (0.01,0) [0|65535] "kph" XXX + SG_ ROUGH_CAR_SPEED_2 : 31|8@0+ (1,0) [0|255] "mph" XXX + SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ IMPERIAL_UNIT : 63|1@0+ (1,0) [0|1] "" XXX + +BO_ 780 ACC_HUD: 8 ADAS + SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "kph" BDY + SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY + SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY + SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY + SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY + SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY + SG_ ZEROS_BOH : 7|24@0+ (0.002759506,0) [0|100] "m/s" BDY + SG_ FCM_OFF : 35|1@0+ (1,0) [0|1] "" BDY + SG_ SET_TO_1 : 36|1@0+ (1,0) [0|1] "" XXX + SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY + SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY + SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY + SG_ ACC_ON : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BOH_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ SET_TO_X1 : 55|1@0+ (1,0) [0|1] "" XXX + SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 806 SCM_FEEDBACK: 8 SCM + SG_ DRIVERS_DOOR_OPEN : 17|1@0+ (1,0) [0|1] "" XXX + SG_ MAIN_ON : 28|1@0+ (1,0) [0|1] "" EON + SG_ RIGHT_BLINKER : 27|1@0+ (1,0) [0|1] "" EON + SG_ LEFT_BLINKER : 26|1@0+ (1,0) [0|1] "" EON + SG_ CMBS_STATES : 22|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 862 CAMERA_MESSAGES: 8 CAM + SG_ ZEROS_BOH : 7|50@0+ (1,0) [0|127] "" BDY + SG_ AUTO_HIGHBEAMS_ACTIVE : 53|1@0+ (1,0) [0|1] "" XXX + SG_ HIGHBEAMS_ON : 52|1@0+ (1,0) [0|1] "" XXX + SG_ ZEROS_BOH_2 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 13274 LKAS_HUD_A: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 13275 LKAS_HUD_B: 8 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" BDY + +CM_ SG_ 450 EPB_STATE "3: On, 2: Disengaging, 1: Engaging, 0: Off"; +CM_ SG_ 479 CONTROL_ON "Set to 5 when car is being controlled"; +CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event"; +CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event"; +CM_ SG_ 479 AEB_PREPARE "set 1s before AEB"; +CM_ SG_ 576 LINE_DISTANCE_VISIBLE "Length of line visible, undecoded"; +CM_ SG_ 577 LINE_FAR_EDGE_POSITION "Appears to be a measure of line thickness, indicates location of the portion of the line furthest from the car, undecoded"; +CM_ SG_ 577 LINE_PARAMETER "Unclear if this is low quality line curvature rate or if this is something else, but it is correlated with line curvature, undecoded"; +CM_ SG_ 577 LINE_DASHED "1 = line is dashed"; +CM_ SG_ 577 LINE_SOLID "1 = line is solid"; + +VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal"; + +CM_ "honda_crv_ex_2017_can.dbc starts here"; + +BO_ 330 STEERING_SENSORS: 8 EPS + SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON + SG_ STEER_SENSOR_STATUS_1 : 34|1@0+ (1,0) [0|1] "" EON + SG_ STEER_SENSOR_STATUS_2 : 33|1@0+ (1,0) [0|1] "" EON + SG_ STEER_SENSOR_STATUS_3 : 32|1@0+ (1,0) [0|1] "" EON + SG_ STEER_WHEEL_ANGLE : 47|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 401 GEARBOX: 8 PCM + SG_ GEAR_SHIFTER : 5|6@0+ (1,0) [0|63] "" EON + SG_ BOH : 45|6@0+ (1,0) [0|63] "" XXX + SG_ GEAR2 : 31|8@0+ (1,0) [0|1] "" XXX + SG_ GEAR : 39|8@0+ (1,0) [0|255] "" XXX + SG_ ZEROS_BOH : 47|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 432 STANDSTILL: 7 VSA + SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON + +BO_ 446 BRAKE_MODULE: 3 VSA + SG_ BRAKE_PRESSED : 4|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" XXX + +BO_ 927 RADAR_HUD: 8 RADAR + SG_ ZEROS_BOH : 7|10@0+ (1,0) [0|127] "" BDY + SG_ CMBS_OFF : 12|1@0+ (1,0) [0|1] "" BDY + SG_ ZEROS_BOH3 : 31|32@0+ (1,0) [0|4294967295] "" XXX + SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_TO_1 : 13|1@0+ (1,0) [0|1] "" BDY + SG_ ZEROS_BOH2 : 11|4@0+ (1,0) [0|1] "" XXX + SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|1] "" XXX + SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|1] "" BDY + SG_ SET_TO_0 : 22|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 1302 ODOMETER: 8 XXX + SG_ ODOMETER : 7|24@0+ (1,0) [0|16777215] "km" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +CM_ SG_ 479 RELATED_TO_GAS "bits 7, 3, and 1 set to 1 when gas not applied"; +CM_ SG_ 479 GAS_BRAKE "Signed value, negative when braking and positive when applying gas"; + +VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P" ; +VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ; +VAL_ 545 ECON_ON_2 0 "off" 3 "on" ; +VAL_ 662 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ; +VAL_ 662 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ; +VAL_ 806 CMBS_BUTTON 3 "pressed" 0 "released" ; diff --git a/opendbc/honda_crv_executive_2016_can_generated.dbc b/opendbc/honda_crv_executive_2016_can_generated.dbc new file mode 100644 index 000000000..aa11f190c --- /dev/null +++ b/opendbc/honda_crv_executive_2016_can_generated.dbc @@ -0,0 +1,324 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + +BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-83.3) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + +VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + + +CM_ "Imported file _honda_common.dbc starts here"; +BO_ 304 GAS_PEDAL_2: 8 PCM + SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 316 GAS_PEDAL: 8 PCM + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 344 ENGINE_DATA: 8 PCM + SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 380 POWERTRAIN_DATA: 8 PCM + SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON + SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON + SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON + SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON + SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON + SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON + SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 420 VSA_STATUS: 8 VSA + SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON + SG_ COMPUTER_BRAKING : 23|1@0+ (1,0) [0|1] "" EON + SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 427 STEER_MOTOR_TORQUE: 3 EPS + SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON + SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON + SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON + +BO_ 464 WHEEL_SPEEDS: 8 VSA + SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 490 VEHICLE_DYNAMICS: 8 VSA + SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 773 SEATBELT_STATUS: 7 BDY + SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 804 CRUISE: 8 PCM + SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON + SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON + SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON + SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON + SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 829 LKAS_HUD: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 884 STALK_STATUS: 8 XXX + SG_ DASHBOARD_ALERT : 39|8@0+ (1,0) [0|255] "" EON + SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON + SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON + SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 891 STALK_STATUS_2: 8 XXX + SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON + SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX + SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 1029 DOORS_STATUS: 8 BDY + SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON + SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 304 "Seems to be platform-agnostic"; +CM_ SG_ 316 "Should exist on Nidec"; +CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged"; +CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping"; +CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light"; +CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light"; +CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed"; +CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; + +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 884 DASHBOARD_ALERT 0 "none" 51 "acc_problem" 55 "cmbs_problem" 75 "key_not_detected" 79 "fasten_seatbelt" 111 "lkas_problem" 131 "brake_system_problem" 132 "brake_hold_problem" 139 "tbd" 161 "door_open"; +VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off"; + + +CM_ "Imported file _honda_2017.dbc starts here"; +BO_ 145 KINEMATICS: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 148 KINEMATICS_ALT: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 24|9@0- (-0.02,0) [-20|20] "m/s2" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +BO_ 432 STANDSTILL: 7 VSA + SG_ CONTROLLED_STANDSTILL : 0|1@0+ (1,0) [0|1] "" EON + SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 487 BRAKE_PRESSURE: 4 VSA + SG_ BRAKE_PRESSURE1 : 7|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ BRAKE_PRESSURE2 : 9|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + +BO_ 506 BRAKE_COMMAND: 8 ADAS + SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00 : 13|5@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_2 : 23|3@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_3 : 19|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_1 : 31|1@0+ (1,0) [0|1] "" EBCM + SG_ AEB_REQ_1 : 29|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_REQ_2 : 26|3@0+ (1,0) [0|7] "" XXX + SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM + SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM + SG_ SET_ME_X00_4 : 44|1@0+ (1,0) [0|1] "" EBCM + SG_ FCW : 43|2@0+ (1,0) [0|3] "" EBCM + SG_ AEB_STATUS : 41|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X00_5 : 55|8@0+ (1,0) [0|0] "" EBCM + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EBCM + +BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA + SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON + SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" EON + SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 777 LOCK_STATUS: 8 XXX + SG_ DOORS_UNLOCKED : 54|1@0+ (1,0) [0|1] "" EON + SG_ DOORS_LOCKED : 55|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 780 ACC_HUD: 8 ADAS + SG_ PCM_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" BDY + SG_ PCM_GAS : 23|8@0+ (1,0) [0|127] "" BDY + SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY + SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY + SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF_2 : 35|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY + SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY + SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY + SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY + SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY + SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY + SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY + SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY + SG_ CHIME : 51|3@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 48|1@0+ (1,0) [0|1] "" BDY + SG_ ICONS : 63|2@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY + +BO_ 892 CRUISE_PARAMS: 8 PCM + SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +CM_ SG_ 506 AEB_REQ_1 "set for duration of suspected AEB event"; +CM_ SG_ 780 CRUISE_SPEED "255 = no speed"; + +VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw"; +VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime"; +VAL_ 506 AEB_STATUS 3 "aeb_prepare" 2 "aeb_ready" 1 "aeb_braking" 0 "no_aeb"; +VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped"; +VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car"; + +CM_ "honda_crv_executive_2016_can.dbc starts here"; + +BO_ 342 STEERING_SENSORS: 6 EPS + SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON + +BO_ 399 STEER_STATUS: 6 EPS + SG_ STEER_TORQUE_SENSOR : 7|12@0- (-1,0) [-2047.5|2047.5] "tbd" EON + SG_ STEER_TORQUE_MOTOR : 23|16@0- (-1,0) [-31000|31000] "tbd" EON + SG_ STEER_CONTROL_ACTIVE : 36|1@0+ (1,0) [0|1] "" EON + SG_ STEER_STATUS : 35|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON + +BO_ 419 GEARBOX: 8 PCM + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ GEAR_SHIFTER : 29|6@0+ (1,0) [0|63] "" EON + SG_ GEAR : 7|8@0+ (1,0) [0|255] "" EON + +BO_ 404 STEERING_CONTROL: 4 EON + SG_ STEER_TORQUE : 7|12@0- (1,0) [-768|768] "" EPS + SG_ SET_ME_X00 : 11|4@0+ (1,0) [0|15] "" EPS + SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS + SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS + SG_ COUNTER : 29|2@0+ (1,0) [0|15] "" EPS + SG_ CHECKSUM : 27|4@0+ (1,0) [0|3] "" EPS + +BO_ 422 SCM_BUTTONS: 8 SCM + SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON + SG_ LIGHTS_SETTING : 1|2@0+ (1,0) [0|3] "" EON + SG_ MAIN_ON : 47|1@0+ (1,0) [0|1] "" EON + SG_ CRUISE_SETTING : 43|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 660 SCM_FEEDBACK: 8 SCM + SG_ RIGHT_BLINKER : 6|1@0+ (1,0) [0|1] "" EON + SG_ LEFT_BLINKER : 5|1@0+ (1,0) [0|1] "" EON + SG_ WIPERS_SPEED : 4|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ; +VAL_ 419 GEAR_SHIFTER 32 "D" 8 "R" 4 "P" ; +VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ; +VAL_ 422 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights" ; +VAL_ 422 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ; diff --git a/opendbc/honda_crv_touring_2016_can_generated.dbc b/opendbc/honda_crv_touring_2016_can_generated.dbc new file mode 100644 index 000000000..b32b6cb59 --- /dev/null +++ b/opendbc/honda_crv_touring_2016_can_generated.dbc @@ -0,0 +1,327 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + +BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-83.3) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + +VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + + +CM_ "Imported file _honda_common.dbc starts here"; +BO_ 304 GAS_PEDAL_2: 8 PCM + SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 316 GAS_PEDAL: 8 PCM + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 344 ENGINE_DATA: 8 PCM + SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 380 POWERTRAIN_DATA: 8 PCM + SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON + SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON + SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON + SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON + SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON + SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON + SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 420 VSA_STATUS: 8 VSA + SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON + SG_ COMPUTER_BRAKING : 23|1@0+ (1,0) [0|1] "" EON + SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 427 STEER_MOTOR_TORQUE: 3 EPS + SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON + SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON + SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON + +BO_ 464 WHEEL_SPEEDS: 8 VSA + SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 490 VEHICLE_DYNAMICS: 8 VSA + SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 773 SEATBELT_STATUS: 7 BDY + SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 804 CRUISE: 8 PCM + SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON + SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON + SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON + SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON + SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 829 LKAS_HUD: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 884 STALK_STATUS: 8 XXX + SG_ DASHBOARD_ALERT : 39|8@0+ (1,0) [0|255] "" EON + SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON + SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON + SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 891 STALK_STATUS_2: 8 XXX + SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON + SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX + SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 1029 DOORS_STATUS: 8 BDY + SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON + SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 304 "Seems to be platform-agnostic"; +CM_ SG_ 316 "Should exist on Nidec"; +CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged"; +CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping"; +CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light"; +CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light"; +CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed"; +CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; + +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 884 DASHBOARD_ALERT 0 "none" 51 "acc_problem" 55 "cmbs_problem" 75 "key_not_detected" 79 "fasten_seatbelt" 111 "lkas_problem" 131 "brake_system_problem" 132 "brake_hold_problem" 139 "tbd" 161 "door_open"; +VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off"; + + +CM_ "Imported file _honda_2017.dbc starts here"; +BO_ 145 KINEMATICS: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 148 KINEMATICS_ALT: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 24|9@0- (-0.02,0) [-20|20] "m/s2" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +BO_ 432 STANDSTILL: 7 VSA + SG_ CONTROLLED_STANDSTILL : 0|1@0+ (1,0) [0|1] "" EON + SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 487 BRAKE_PRESSURE: 4 VSA + SG_ BRAKE_PRESSURE1 : 7|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ BRAKE_PRESSURE2 : 9|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + +BO_ 506 BRAKE_COMMAND: 8 ADAS + SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00 : 13|5@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_2 : 23|3@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_3 : 19|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_1 : 31|1@0+ (1,0) [0|1] "" EBCM + SG_ AEB_REQ_1 : 29|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_REQ_2 : 26|3@0+ (1,0) [0|7] "" XXX + SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM + SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM + SG_ SET_ME_X00_4 : 44|1@0+ (1,0) [0|1] "" EBCM + SG_ FCW : 43|2@0+ (1,0) [0|3] "" EBCM + SG_ AEB_STATUS : 41|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X00_5 : 55|8@0+ (1,0) [0|0] "" EBCM + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EBCM + +BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA + SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON + SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" EON + SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 777 LOCK_STATUS: 8 XXX + SG_ DOORS_UNLOCKED : 54|1@0+ (1,0) [0|1] "" EON + SG_ DOORS_LOCKED : 55|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 780 ACC_HUD: 8 ADAS + SG_ PCM_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" BDY + SG_ PCM_GAS : 23|8@0+ (1,0) [0|127] "" BDY + SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY + SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY + SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF_2 : 35|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY + SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY + SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY + SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY + SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY + SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY + SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY + SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY + SG_ CHIME : 51|3@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 48|1@0+ (1,0) [0|1] "" BDY + SG_ ICONS : 63|2@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY + +BO_ 892 CRUISE_PARAMS: 8 PCM + SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +CM_ SG_ 506 AEB_REQ_1 "set for duration of suspected AEB event"; +CM_ SG_ 780 CRUISE_SPEED "255 = no speed"; + +VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw"; +VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime"; +VAL_ 506 AEB_STATUS 3 "aeb_prepare" 2 "aeb_ready" 1 "aeb_braking" 0 "no_aeb"; +VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped"; +VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car"; + +CM_ "honda_crv_touring_2016_can.dbc starts here"; + +BO_ 342 STEERING_SENSORS: 6 EPS + SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON + +BO_ 399 STEER_STATUS: 6 EPS + SG_ STEER_TORQUE_SENSOR : 7|12@0- (-1,0) [-2047.5|2047.5] "tbd" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON + SG_ STEER_CONTROL_ACTIVE : 36|1@0+ (1,0) [0|1] "" EON + SG_ STEER_STATUS : 35|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON + +BO_ 401 GEARBOX: 8 PCM + SG_ GEAR_SHIFTER : 5|6@0+ (1,0) [0|63] "" EON + SG_ GEAR : 35|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 404 STEERING_CONTROL: 4 EON + SG_ STEER_TORQUE : 7|12@0- (1,0) [-768|768] "" EPS + SG_ SET_ME_X00 : 11|4@0+ (1,0) [0|15] "" EPS + SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS + SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS + SG_ COUNTER : 29|2@0+ (1,0) [0|15] "" EPS + SG_ CHECKSUM : 27|4@0+ (1,0) [0|3] "" EPS + +BO_ 422 SCM_BUTTONS: 8 SCM + SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON + SG_ LIGHTS_SETTING : 1|2@0+ (1,0) [0|3] "" EON + SG_ MAIN_ON : 47|1@0+ (1,0) [0|1] "" EON + SG_ CRUISE_SETTING : 43|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 660 SCM_FEEDBACK: 8 SCM + SG_ RIGHT_BLINKER : 6|1@0+ (1,0) [0|1] "" EON + SG_ LEFT_BLINKER : 5|1@0+ (1,0) [0|1] "" EON + SG_ WIPERS_SPEED : 4|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 401 GEAR "10 = reverse, 11 = transition"; + +VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ; +VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P" ; +VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ; +VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ; +VAL_ 422 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights" ; +VAL_ 422 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ; diff --git a/opendbc/honda_fit_ex_2018_can_generated.dbc b/opendbc/honda_fit_ex_2018_can_generated.dbc new file mode 100644 index 000000000..e41b529b5 --- /dev/null +++ b/opendbc/honda_fit_ex_2018_can_generated.dbc @@ -0,0 +1,337 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + +BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-83.3) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + +VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + + +CM_ "Imported file _honda_common.dbc starts here"; +BO_ 304 GAS_PEDAL_2: 8 PCM + SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 316 GAS_PEDAL: 8 PCM + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 344 ENGINE_DATA: 8 PCM + SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 380 POWERTRAIN_DATA: 8 PCM + SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON + SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON + SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON + SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON + SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON + SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON + SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 420 VSA_STATUS: 8 VSA + SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON + SG_ COMPUTER_BRAKING : 23|1@0+ (1,0) [0|1] "" EON + SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 427 STEER_MOTOR_TORQUE: 3 EPS + SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON + SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON + SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON + +BO_ 464 WHEEL_SPEEDS: 8 VSA + SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 490 VEHICLE_DYNAMICS: 8 VSA + SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 773 SEATBELT_STATUS: 7 BDY + SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 804 CRUISE: 8 PCM + SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON + SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON + SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON + SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON + SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 829 LKAS_HUD: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 884 STALK_STATUS: 8 XXX + SG_ DASHBOARD_ALERT : 39|8@0+ (1,0) [0|255] "" EON + SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON + SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON + SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 891 STALK_STATUS_2: 8 XXX + SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON + SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX + SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 1029 DOORS_STATUS: 8 BDY + SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON + SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 304 "Seems to be platform-agnostic"; +CM_ SG_ 316 "Should exist on Nidec"; +CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged"; +CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping"; +CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light"; +CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light"; +CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed"; +CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; + +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 884 DASHBOARD_ALERT 0 "none" 51 "acc_problem" 55 "cmbs_problem" 75 "key_not_detected" 79 "fasten_seatbelt" 111 "lkas_problem" 131 "brake_system_problem" 132 "brake_hold_problem" 139 "tbd" 161 "door_open"; +VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off"; + + +CM_ "Imported file _honda_2017.dbc starts here"; +BO_ 145 KINEMATICS: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 148 KINEMATICS_ALT: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 24|9@0- (-0.02,0) [-20|20] "m/s2" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +BO_ 432 STANDSTILL: 7 VSA + SG_ CONTROLLED_STANDSTILL : 0|1@0+ (1,0) [0|1] "" EON + SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 487 BRAKE_PRESSURE: 4 VSA + SG_ BRAKE_PRESSURE1 : 7|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ BRAKE_PRESSURE2 : 9|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + +BO_ 506 BRAKE_COMMAND: 8 ADAS + SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00 : 13|5@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_2 : 23|3@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_3 : 19|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_1 : 31|1@0+ (1,0) [0|1] "" EBCM + SG_ AEB_REQ_1 : 29|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_REQ_2 : 26|3@0+ (1,0) [0|7] "" XXX + SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM + SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM + SG_ SET_ME_X00_4 : 44|1@0+ (1,0) [0|1] "" EBCM + SG_ FCW : 43|2@0+ (1,0) [0|3] "" EBCM + SG_ AEB_STATUS : 41|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X00_5 : 55|8@0+ (1,0) [0|0] "" EBCM + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EBCM + +BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA + SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON + SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" EON + SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 777 LOCK_STATUS: 8 XXX + SG_ DOORS_UNLOCKED : 54|1@0+ (1,0) [0|1] "" EON + SG_ DOORS_LOCKED : 55|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 780 ACC_HUD: 8 ADAS + SG_ PCM_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" BDY + SG_ PCM_GAS : 23|8@0+ (1,0) [0|127] "" BDY + SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY + SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY + SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF_2 : 35|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY + SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY + SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY + SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY + SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY + SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY + SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY + SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY + SG_ CHIME : 51|3@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 48|1@0+ (1,0) [0|1] "" BDY + SG_ ICONS : 63|2@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY + +BO_ 892 CRUISE_PARAMS: 8 PCM + SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +CM_ SG_ 506 AEB_REQ_1 "set for duration of suspected AEB event"; +CM_ SG_ 780 CRUISE_SPEED "255 = no speed"; + +VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw"; +VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime"; +VAL_ 506 AEB_STATUS 3 "aeb_prepare" 2 "aeb_ready" 1 "aeb_braking" 0 "no_aeb"; +VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped"; +VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car"; + +CM_ "honda_fit_ex_2018_can.dbc starts here"; + +BO_ 228 STEERING_CONTROL: 5 ADAS + SG_ STEER_TORQUE : 7|16@0- (1,0) [-3840|3840] "" EPS + SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS + SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS + SG_ SET_ME_X00_2 : 31|8@0+ (1,0) [0|0] "" EPS + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" EPS + +BO_ 342 STEERING_SENSORS: 6 EPS + SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" EON + +BO_ 399 STEER_STATUS: 7 EPS + SG_ STEER_TORQUE_SENSOR : 7|16@0- (-1,0) [-31000|31000] "tbd" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON + SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" EON + SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON + SG_ STEER_CONFIG_INDEX : 43|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 401 GEARBOX: 8 PCM + SG_ GEAR_SHIFTER : 5|6@0+ (1,0) [0|63] "" EON + SG_ GEAR : 43|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 422 SCM_BUTTONS: 8 SCM + SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON + SG_ LIGHTS_SETTING : 1|2@0+ (1,0) [0|3] "" EON + SG_ MAIN_ON : 47|1@0+ (1,0) [0|1] "" EON + SG_ CRUISE_SETTING : 43|2@0+ (1,0) [0|3] "" EON + SG_ DRIVERS_DOOR_OPEN : 63|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 660 SCM_FEEDBACK: 8 SCM + SG_ RIGHT_BLINKER : 6|1@0+ (1,0) [0|1] "" EON + SG_ LEFT_BLINKER : 5|1@0+ (1,0) [0|1] "" EON + SG_ WIPERS_SPEED : 4|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 862 HIGHBEAM_CONTROL: 8 ADAS + SG_ ZEROS_BOH : 7|50@0+ (1,0) [0|127] "" BDY + SG_ ZEROS_BOH_2 : 48|4@1+ (1,0) [0|15] "" XXX + SG_ HIGHBEAMS_ON : 52|1@0+ (1,0) [0|1] "" XXX + SG_ AUTO_HIGHBEAMS_ACTIVE : 53|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +CM_ SG_ 401 GEAR "10 = reverse, 11 = transition"; + +VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ; +VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P" ; +VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ; +VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ; +VAL_ 422 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights" ; +VAL_ 422 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ; diff --git a/opendbc/honda_insight_ex_2019_can_generated.dbc b/opendbc/honda_insight_ex_2019_can_generated.dbc new file mode 100644 index 000000000..12ccc0873 --- /dev/null +++ b/opendbc/honda_insight_ex_2019_can_generated.dbc @@ -0,0 +1,470 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _honda_common.dbc starts here"; +BO_ 304 GAS_PEDAL_2: 8 PCM + SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 316 GAS_PEDAL: 8 PCM + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 344 ENGINE_DATA: 8 PCM + SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 380 POWERTRAIN_DATA: 8 PCM + SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON + SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON + SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON + SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON + SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON + SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON + SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 420 VSA_STATUS: 8 VSA + SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON + SG_ COMPUTER_BRAKING : 23|1@0+ (1,0) [0|1] "" EON + SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 427 STEER_MOTOR_TORQUE: 3 EPS + SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON + SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON + SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON + +BO_ 464 WHEEL_SPEEDS: 8 VSA + SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 490 VEHICLE_DYNAMICS: 8 VSA + SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 773 SEATBELT_STATUS: 7 BDY + SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 804 CRUISE: 8 PCM + SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON + SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON + SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON + SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON + SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 829 LKAS_HUD: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 884 STALK_STATUS: 8 XXX + SG_ DASHBOARD_ALERT : 39|8@0+ (1,0) [0|255] "" EON + SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON + SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON + SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 891 STALK_STATUS_2: 8 XXX + SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON + SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX + SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 1029 DOORS_STATUS: 8 BDY + SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON + SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 304 "Seems to be platform-agnostic"; +CM_ SG_ 316 "Should exist on Nidec"; +CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged"; +CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping"; +CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light"; +CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light"; +CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed"; +CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; + +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 884 DASHBOARD_ALERT 0 "none" 51 "acc_problem" 55 "cmbs_problem" 75 "key_not_detected" 79 "fasten_seatbelt" 111 "lkas_problem" 131 "brake_system_problem" 132 "brake_hold_problem" 139 "tbd" 161 "door_open"; +VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off"; + + +CM_ "Imported file _bosch_2018.dbc starts here"; +BO_ 148 KINEMATICS: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (-0.035,17.92) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 25|10@0+ (-0.035,17.92) [-20|20] "m/s2" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +BO_ 228 STEERING_CONTROL: 5 EON + SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS + SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS + SG_ SET_ME_X00_2 : 31|8@0+ (1,0) [0|0] "" EPS + SG_ STEER_TORQUE : 7|16@0- (1,0) [-4096|4096] "" EPS + SG_ STEER_DOWN_TO_ZERO : 38|1@0+ (1,0) [0|1] "" EPS + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" EPS + +BO_ 229 BOSCH_SUPPLEMENTAL_1: 8 XXX + SG_ SET_ME_X04 : 0|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 8|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X80 : 16|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X10 : 24|8@1+ (1,0) [0|255] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 232 BRAKE_HOLD: 7 XXX + SG_ XMISSION_SPEED : 7|14@0- (1,0) [1|0] "" XXX + SG_ COMPUTER_BRAKE : 39|16@0+ (1,0) [0|0] "" XXX + SG_ COMPUTER_BRAKE_REQUEST : 29|1@0+ (1,0) [0|0] "" XXX + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" XXX + +BO_ 399 STEER_STATUS: 7 EPS + SG_ STEER_TORQUE_SENSOR : 7|16@0- (-1,0) [-31000|31000] "tbd" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON + SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" EON + SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON + SG_ STEER_CONFIG_INDEX : 43|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON + +BO_ 450 EPB_STATUS: 8 EPB + SG_ EPB_ACTIVE : 3|1@0+ (1,0) [0|1] "" EON + SG_ EPB_STATE : 29|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 479 ACC_CONTROL: 8 EON + SG_ SET_TO_0 : 20|5@0+ (1,0) [0|1] "" XXX + SG_ CONTROL_ON : 23|3@0+ (1,0) [0|5] "" XXX + SG_ GAS_COMMAND : 7|16@0- (1,0) [0|0] "" XXX + SG_ ACCEL_COMMAND : 31|11@0- (0.01,0) [0|0] "m/s2" XXX + SG_ BRAKE_LIGHTS : 62|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_REQUEST : 34|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL : 35|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL_RELEASE : 36|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_STATUS : 33|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_BRAKING : 47|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_PREPARE : 43|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 495 ACC_CONTROL_ON: 8 XXX + SG_ SET_TO_75 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_30 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ ZEROS_BOH : 23|8@0+ (1,0) [0|255] "" XXX + SG_ ZEROS_BOH2 : 47|16@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_FF : 15|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_3 : 6|7@0+ (1,0) [0|4095] "" XXX + SG_ CONTROL_ON : 7|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 545 XXX_16: 6 SCM + SG_ ECON_ON : 23|1@0+ (1,0) [0|1] "" XXX + SG_ DRIVE_MODE : 37|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" BDY + +BO_ 576 LEFT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 577 LEFT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 579 RIGHT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 580 RIGHT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 582 ADJACENT_LEFT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 583 ADJACENT_LEFT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 585 ADJACENT_RIGHT_LANE_LINE_1: 8 CAM + SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX + SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX + SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX + SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX + SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 586 ADJACENT_RIGHT_LANE_LINE_2: 8 CAM + SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX + SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX + SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX + SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX + +BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA + SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON + SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON + SG_ LONG_COUNTER : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 662 SCM_BUTTONS: 4 SCM + SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON + SG_ CRUISE_SETTING : 3|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON + +BO_ 777 CAR_SPEED: 8 PCM + SG_ ROUGH_CAR_SPEED : 23|8@0+ (1,0) [0|255] "mph" XXX + SG_ CAR_SPEED : 7|16@0+ (0.01,0) [0|65535] "kph" XXX + SG_ ROUGH_CAR_SPEED_3 : 39|16@0+ (0.01,0) [0|65535] "kph" XXX + SG_ ROUGH_CAR_SPEED_2 : 31|8@0+ (1,0) [0|255] "mph" XXX + SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ IMPERIAL_UNIT : 63|1@0+ (1,0) [0|1] "" XXX + +BO_ 780 ACC_HUD: 8 ADAS + SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "kph" BDY + SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY + SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY + SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY + SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY + SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY + SG_ ZEROS_BOH : 7|24@0+ (0.002759506,0) [0|100] "m/s" BDY + SG_ FCM_OFF : 35|1@0+ (1,0) [0|1] "" BDY + SG_ SET_TO_1 : 36|1@0+ (1,0) [0|1] "" XXX + SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY + SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY + SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY + SG_ ACC_ON : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BOH_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ SET_TO_X1 : 55|1@0+ (1,0) [0|1] "" XXX + SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 806 SCM_FEEDBACK: 8 SCM + SG_ DRIVERS_DOOR_OPEN : 17|1@0+ (1,0) [0|1] "" XXX + SG_ MAIN_ON : 28|1@0+ (1,0) [0|1] "" EON + SG_ RIGHT_BLINKER : 27|1@0+ (1,0) [0|1] "" EON + SG_ LEFT_BLINKER : 26|1@0+ (1,0) [0|1] "" EON + SG_ CMBS_STATES : 22|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 862 CAMERA_MESSAGES: 8 CAM + SG_ ZEROS_BOH : 7|50@0+ (1,0) [0|127] "" BDY + SG_ AUTO_HIGHBEAMS_ACTIVE : 53|1@0+ (1,0) [0|1] "" XXX + SG_ HIGHBEAMS_ON : 52|1@0+ (1,0) [0|1] "" XXX + SG_ ZEROS_BOH_2 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 13274 LKAS_HUD_A: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 13275 LKAS_HUD_B: 8 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" BDY + +CM_ SG_ 450 EPB_STATE "3: On, 2: Disengaging, 1: Engaging, 0: Off"; +CM_ SG_ 479 CONTROL_ON "Set to 5 when car is being controlled"; +CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event"; +CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event"; +CM_ SG_ 479 AEB_PREPARE "set 1s before AEB"; +CM_ SG_ 576 LINE_DISTANCE_VISIBLE "Length of line visible, undecoded"; +CM_ SG_ 577 LINE_FAR_EDGE_POSITION "Appears to be a measure of line thickness, indicates location of the portion of the line furthest from the car, undecoded"; +CM_ SG_ 577 LINE_PARAMETER "Unclear if this is low quality line curvature rate or if this is something else, but it is correlated with line curvature, undecoded"; +CM_ SG_ 577 LINE_DASHED "1 = line is dashed"; +CM_ SG_ 577 LINE_SOLID "1 = line is solid"; + +VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal"; + +CM_ "honda_insight_ex_2019_can.dbc starts here"; + +BO_ 330 STEERING_SENSORS: 8 EPS + SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON + SG_ STEER_SENSOR_STATUS_1 : 34|1@0+ (1,0) [0|1] "" EON + SG_ STEER_SENSOR_STATUS_2 : 33|1@0+ (1,0) [0|1] "" EON + SG_ STEER_SENSOR_STATUS_3 : 32|1@0+ (1,0) [0|1] "" EON + SG_ STEER_WHEEL_ANGLE : 47|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 419 GEARBOX: 8 PCM + SG_ GEAR : 7|8@0+ (1,0) [0|255] "" EON + SG_ GEAR_SHIFTER : 29|6@0+ (1,0) [0|63] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 432 STANDSTILL: 7 VSA + SG_ BRAKE_ERROR_1 : 13|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_2 : 12|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON + +BO_ 927 RADAR_HUD: 8 RADAR + SG_ ZEROS_BOH : 7|10@0+ (1,0) [0|127] "" BDY + SG_ CMBS_OFF : 12|1@0+ (1,0) [0|1] "" BDY + SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_TO_1 : 13|1@0+ (1,0) [0|1] "" BDY + SG_ ZEROS_BOH2 : 11|4@0+ (1,0) [0|1] "" XXX + SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|1] "" XXX + SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|1] "" BDY + SG_ SET_TO_0 : 22|1@0+ (1,0) [0|1] "" XXX + SG_ HUD_LEAD : 40|1@0+ (1,0) [0|1] "" XXX + SG_ SET_TO_64 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|255] "" XXX + SG_ ZEROS_BOH3 : 47|7@0+ (1,0) [0|127] "" XXX + SG_ ZEROS_BOH4 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +VAL_ 419 GEAR 10 "R" 1 "D" 0 "P"; +VAL_ 419 GEAR_SHIFTER 32 "D" 16 "N" 8 "R" 4 "P"; diff --git a/opendbc/honda_odyssey_exl_2018_generated.dbc b/opendbc/honda_odyssey_exl_2018_generated.dbc new file mode 100644 index 000000000..a684234c5 --- /dev/null +++ b/opendbc/honda_odyssey_exl_2018_generated.dbc @@ -0,0 +1,364 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + +BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-83.3) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + +VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + + +CM_ "Imported file _honda_common.dbc starts here"; +BO_ 304 GAS_PEDAL_2: 8 PCM + SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 316 GAS_PEDAL: 8 PCM + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 344 ENGINE_DATA: 8 PCM + SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 380 POWERTRAIN_DATA: 8 PCM + SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON + SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON + SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON + SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON + SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON + SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON + SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 420 VSA_STATUS: 8 VSA + SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON + SG_ COMPUTER_BRAKING : 23|1@0+ (1,0) [0|1] "" EON + SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 427 STEER_MOTOR_TORQUE: 3 EPS + SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON + SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON + SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON + +BO_ 464 WHEEL_SPEEDS: 8 VSA + SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 490 VEHICLE_DYNAMICS: 8 VSA + SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 773 SEATBELT_STATUS: 7 BDY + SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 804 CRUISE: 8 PCM + SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON + SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON + SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON + SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON + SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 829 LKAS_HUD: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 884 STALK_STATUS: 8 XXX + SG_ DASHBOARD_ALERT : 39|8@0+ (1,0) [0|255] "" EON + SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON + SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON + SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 891 STALK_STATUS_2: 8 XXX + SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON + SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX + SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 1029 DOORS_STATUS: 8 BDY + SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON + SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 304 "Seems to be platform-agnostic"; +CM_ SG_ 316 "Should exist on Nidec"; +CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged"; +CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping"; +CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light"; +CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light"; +CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed"; +CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; + +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 884 DASHBOARD_ALERT 0 "none" 51 "acc_problem" 55 "cmbs_problem" 75 "key_not_detected" 79 "fasten_seatbelt" 111 "lkas_problem" 131 "brake_system_problem" 132 "brake_hold_problem" 139 "tbd" 161 "door_open"; +VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off"; + + +CM_ "Imported file _honda_2017.dbc starts here"; +BO_ 145 KINEMATICS: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 148 KINEMATICS_ALT: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 24|9@0- (-0.02,0) [-20|20] "m/s2" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +BO_ 432 STANDSTILL: 7 VSA + SG_ CONTROLLED_STANDSTILL : 0|1@0+ (1,0) [0|1] "" EON + SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 487 BRAKE_PRESSURE: 4 VSA + SG_ BRAKE_PRESSURE1 : 7|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ BRAKE_PRESSURE2 : 9|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + +BO_ 506 BRAKE_COMMAND: 8 ADAS + SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00 : 13|5@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_2 : 23|3@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_3 : 19|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_1 : 31|1@0+ (1,0) [0|1] "" EBCM + SG_ AEB_REQ_1 : 29|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_REQ_2 : 26|3@0+ (1,0) [0|7] "" XXX + SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM + SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM + SG_ SET_ME_X00_4 : 44|1@0+ (1,0) [0|1] "" EBCM + SG_ FCW : 43|2@0+ (1,0) [0|3] "" EBCM + SG_ AEB_STATUS : 41|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X00_5 : 55|8@0+ (1,0) [0|0] "" EBCM + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EBCM + +BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA + SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON + SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" EON + SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 777 LOCK_STATUS: 8 XXX + SG_ DOORS_UNLOCKED : 54|1@0+ (1,0) [0|1] "" EON + SG_ DOORS_LOCKED : 55|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 780 ACC_HUD: 8 ADAS + SG_ PCM_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" BDY + SG_ PCM_GAS : 23|8@0+ (1,0) [0|127] "" BDY + SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY + SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY + SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF_2 : 35|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY + SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY + SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY + SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY + SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY + SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY + SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY + SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY + SG_ CHIME : 51|3@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 48|1@0+ (1,0) [0|1] "" BDY + SG_ ICONS : 63|2@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY + +BO_ 892 CRUISE_PARAMS: 8 PCM + SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +CM_ SG_ 506 AEB_REQ_1 "set for duration of suspected AEB event"; +CM_ SG_ 780 CRUISE_SPEED "255 = no speed"; + +VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw"; +VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime"; +VAL_ 506 AEB_STATUS 3 "aeb_prepare" 2 "aeb_ready" 1 "aeb_braking" 0 "no_aeb"; +VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped"; +VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car"; + +CM_ "honda_odyssey_exl_2018.dbc starts here"; + +BO_ 228 STEERING_CONTROL: 5 ADAS + SG_ STEER_TORQUE : 7|16@0- (1,0) [-3840|3840] "" EPS + SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|0] "" EPS + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS + SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" EPS + +BO_ 342 STEERING_SENSORS: 6 EPS + SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" EON + +BO_ 399 STEER_STATUS: 7 EPS + SG_ STEER_TORQUE_SENSOR : 7|16@0- (-1,0) [-31000|31000] "tbd" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON + SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" EON + SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON + SG_ STEER_CONFIG_INDEX : 43|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 419 GEARBOX: 8 PCM + SG_ GEAR : 7|8@0+ (1,0) [0|256] "" EON + SG_ GEAR_SHIFTER : 35|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 450 EPB_STATUS: 8 XXX + SG_ EPB_BRAKE_AND_PULL : 6|1@0+ (1,0) [0|1] "" XXX + SG_ EPB_ACTIVE : 3|1@0+ (1,0) [0|1] "" XXX + SG_ EPB_STATE : 29|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 662 SCM_BUTTONS: 4 SCM + SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON + SG_ CRUISE_SETTING : 3|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + +BO_ 806 SCM_FEEDBACK: 8 SCM + SG_ CMBS_BUTTON : 22|2@0+ (1,0) [0|3] "" EON + SG_ MAIN_ON : 28|1@0+ (1,0) [0|1] "" EON + SG_ RIGHT_BLINKER : 27|1@0+ (1,0) [0|1] "" EON + SG_ LEFT_BLINKER : 26|1@0+ (1,0) [0|1] "" EON + SG_ REVERSE_LIGHT : 18|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 862 HIGHBEAM_CONTROL: 8 ADAS + SG_ ZEROS_BOH : 7|50@0+ (1,0) [0|127] "" BDY + SG_ ZEROS_BOH_2 : 48|4@1+ (1,0) [0|15] "" XXX + SG_ HIGHBEAMS_ON : 52|1@0+ (1,0) [0|1] "" XXX + SG_ AUTO_HIGHBEAMS_ACTIVE : 53|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 927 RADAR_HUD: 8 ADAS + SG_ ZEROS_BOH : 7|17@0+ (1,0) [0|127] "" BDY + SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|15] "" BDY + SG_ ZEROS_BOH2 : 31|8@0+ (1,0) [0|127] "" BDY + SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|15] "" BDY + SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|15] "" BDY + SG_ LEAD_SPEED : 39|9@0+ (1,0) [0|127] "" BDY + SG_ LEAD_STATE : 46|3@0+ (1,0) [0|127] "" BDY + SG_ LEAD_DISTANCE : 43|5@0+ (1,0) [0|31] "" BDY + SG_ ZEROS_BOH3 : 54|7@0+ (1,0) [0|127] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY + +BO_ 1302 ODOMETER: 8 XXX + SG_ ODOMETER : 7|24@0+ (1,0) [0|16777215] "km" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +CM_ SG_ 419 GEAR "10 = reverse, 11 = transition"; +CM_ SG_ 780 CRUISE_SPEED "255 = no speed"; +CM_ SG_ 806 REVERSE_LIGHT "Might be reverse gear selected and not the lights"; + +VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ; +VAL_ 419 GEAR_SHIFTER 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ; +VAL_ 450 EPB_STATE 3 "engaged" 2 "disengaging" 1 "engaging" 0 "disengaged" ; +VAL_ 662 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ; +VAL_ 662 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ; +VAL_ 780 HUD_LEAD 3 "no_car" 2 "solid_car" 1 "dashed_car" 0 "no_car" ; +VAL_ 927 ACC_ALERTS 29 "esp_active_acc_canceled" 10 "b_pedal_applied" 9 "speed_too_low" 8 "speed_too_high" 7 "p_brake_applied" 6 "gear_no_d" 5 "seatbelt" 4 "too_steep_downhill" 3 "too_steep_uphill" 2 "too_close" 1 "no_vehicle_ahead" ; +VAL_ 806 CMBS_BUTTON 3 "pressed" 0 "released" ; diff --git a/opendbc/honda_odyssey_extreme_edition_2018_china_can_generated.dbc b/opendbc/honda_odyssey_extreme_edition_2018_china_can_generated.dbc new file mode 100644 index 000000000..f0c5c2708 --- /dev/null +++ b/opendbc/honda_odyssey_extreme_edition_2018_china_can_generated.dbc @@ -0,0 +1,347 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + +BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-83.3) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + +VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + + +CM_ "Imported file _honda_common.dbc starts here"; +BO_ 304 GAS_PEDAL_2: 8 PCM + SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 316 GAS_PEDAL: 8 PCM + SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 344 ENGINE_DATA: 8 PCM + SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON + SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 380 POWERTRAIN_DATA: 8 PCM + SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON + SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON + SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON + SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON + SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON + SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON + SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 420 VSA_STATUS: 8 VSA + SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON + SG_ COMPUTER_BRAKING : 23|1@0+ (1,0) [0|1] "" EON + SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 427 STEER_MOTOR_TORQUE: 3 EPS + SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON + SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON + SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON + +BO_ 464 WHEEL_SPEEDS: 8 VSA + SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 490 VEHICLE_DYNAMICS: 8 VSA + SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 773 SEATBELT_STATUS: 7 BDY + SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 804 CRUISE: 8 PCM + SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON + SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON + SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON + SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON + SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 829 LKAS_HUD: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 884 STALK_STATUS: 8 XXX + SG_ DASHBOARD_ALERT : 39|8@0+ (1,0) [0|255] "" EON + SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON + SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON + SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON + SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 891 STALK_STATUS_2: 8 XXX + SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON + SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX + SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 1029 DOORS_STATUS: 8 BDY + SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON + SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +CM_ SG_ 304 "Seems to be platform-agnostic"; +CM_ SG_ 316 "Should exist on Nidec"; +CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged"; +CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping"; +CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light"; +CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light"; +CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed"; +CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; + +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 884 DASHBOARD_ALERT 0 "none" 51 "acc_problem" 55 "cmbs_problem" 75 "key_not_detected" 79 "fasten_seatbelt" 111 "lkas_problem" 131 "brake_system_problem" 132 "brake_hold_problem" 139 "tbd" 161 "door_open"; +VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off"; + + +CM_ "Imported file _honda_2017.dbc starts here"; +BO_ 145 KINEMATICS: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 148 KINEMATICS_ALT: 8 XXX + SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON + SG_ LONG_ACCEL : 24|9@0- (-0.02,0) [-20|20] "m/s2" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +BO_ 432 STANDSTILL: 7 VSA + SG_ CONTROLLED_STANDSTILL : 0|1@0+ (1,0) [0|1] "" EON + SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 487 BRAKE_PRESSURE: 4 VSA + SG_ BRAKE_PRESSURE1 : 7|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ BRAKE_PRESSURE2 : 9|10@0+ (0.015625,-103) [0|1000] "" EON + SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON + +BO_ 506 BRAKE_COMMAND: 8 ADAS + SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00 : 13|5@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_2 : 23|3@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_X00_3 : 19|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_1 : 31|1@0+ (1,0) [0|1] "" EBCM + SG_ AEB_REQ_1 : 29|1@0+ (1,0) [0|1] "" XXX + SG_ AEB_REQ_2 : 26|3@0+ (1,0) [0|7] "" XXX + SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM + SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM + SG_ SET_ME_X00_4 : 44|1@0+ (1,0) [0|1] "" EBCM + SG_ FCW : 43|2@0+ (1,0) [0|3] "" EBCM + SG_ AEB_STATUS : 41|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X00_5 : 55|8@0+ (1,0) [0|0] "" EBCM + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EBCM + +BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA + SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON + SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" EON + SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 777 LOCK_STATUS: 8 XXX + SG_ DOORS_UNLOCKED : 54|1@0+ (1,0) [0|1] "" EON + SG_ DOORS_LOCKED : 55|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 780 ACC_HUD: 8 ADAS + SG_ PCM_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" BDY + SG_ PCM_GAS : 23|8@0+ (1,0) [0|127] "" BDY + SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY + SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY + SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF_2 : 35|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY + SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY + SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY + SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY + SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY + SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY + SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY + SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY + SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY + SG_ CHIME : 51|3@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X01 : 48|1@0+ (1,0) [0|1] "" BDY + SG_ ICONS : 63|2@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY + +BO_ 892 CRUISE_PARAMS: 8 PCM + SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +CM_ SG_ 506 AEB_REQ_1 "set for duration of suspected AEB event"; +CM_ SG_ 780 CRUISE_SPEED "255 = no speed"; + +VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw"; +VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime"; +VAL_ 506 AEB_STATUS 3 "aeb_prepare" 2 "aeb_ready" 1 "aeb_braking" 0 "no_aeb"; +VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped"; +VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car"; + +CM_ "honda_odyssey_extreme_edition_2018_china_can.dbc starts here"; + +BO_ 342 STEERING_SENSORS: 6 EPS + SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON + SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON + +BO_ 399 STEER_STATUS: 7 EPS + SG_ STEER_TORQUE_SENSOR : 7|16@0- (-1,0) [-2985|2985] "tbd" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON + SG_ STEER_STATUS : 43|4@0+ (1,0) [0|15] "" EON + SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON + SG_ STEER_CONFIG_INDEX : 43|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + +BO_ 401 GEARBOX: 8 PCM + SG_ GEAR_SHIFTER : 5|6@0+ (1,0) [0|63] "" EON + SG_ GEAR : 35|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 404 STEERING_CONTROL: 4 EON + SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS + SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS + SG_ COUNTER : 29|2@0+ (1,0) [0|15] "" EPS + SG_ CHECKSUM : 27|4@0+ (1,0) [0|3] "" EPS + SG_ STEER_TORQUE : 7|16@0- (-1,0) [-32767|32767] "" EPS + +BO_ 422 SCM_BUTTONS: 8 SCM + SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON + SG_ LIGHTS_SETTING : 1|2@0+ (1,0) [0|3] "" EON + SG_ MAIN_ON : 47|1@0+ (1,0) [0|1] "" EON + SG_ CRUISE_SETTING : 43|2@0+ (1,0) [0|3] "" EON + SG_ DRIVERS_DOOR_OPEN : 63|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 450 EPB_STATUS: 8 XXX + SG_ EPB_BRAKE_AND_PULL : 6|1@0+ (1,0) [0|1] "" XXX + SG_ EPB_ACTIVE : 3|1@0+ (1,0) [0|1] "" XXX + SG_ EPB_STATE : 29|2@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 660 SCM_FEEDBACK: 8 SCM + SG_ RIGHT_BLINKER : 6|1@0+ (1,0) [0|1] "" EON + SG_ LEFT_BLINKER : 5|1@0+ (1,0) [0|1] "" EON + SG_ WIPERS_SPEED : 4|2@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + +BO_ 862 HIGHBEAM_CONTROL: 8 ADAS + SG_ ZEROS_BOH : 7|50@0+ (1,0) [0|127] "" BDY + SG_ ZEROS_BOH_2 : 48|4@1+ (1,0) [0|15] "" XXX + SG_ HIGHBEAMS_ON : 52|1@0+ (1,0) [0|1] "" XXX + SG_ AUTO_HIGHBEAMS_ACTIVE : 53|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 1302 ODOMETER: 8 XXX + SG_ ODOMETER : 7|24@0+ (1,0) [0|16777215] "km" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +CM_ SG_ 401 GEAR "10 = reverse, 11 = transition"; +VAL_ 399 STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal" ; +VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P" ; +VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ; +VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ; +VAL_ 422 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights" ; +VAL_ 422 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ; diff --git a/opendbc/hyundai_kia_generic.dbc b/opendbc/hyundai_kia_generic.dbc new file mode 100644 index 000000000..4f54bac54 --- /dev/null +++ b/opendbc/hyundai_kia_generic.dbc @@ -0,0 +1,1657 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: IAP ODS _4WD BCM HUD DATC MDPS AAF_Tester AEMC SMK _4WD EPB CUBIS MTS TMU EVP CGW TPMS LPI DI_BOX SPAS EMS LCA TCU IBOX FATC AFLS FPCM SCC AHLS AVM ABS SNV OPI PGS SAS AAF Dummy LDWS_LKAS LVR ESC PSB CLU ECS ACU REA + +BO_ 1532 ODS13: 5 ODS + SG_ CR_Ods_ID : 0|8@1+ (1.0,0.0) [0.0|255.0] "" ACU + SG_ CR_Ods_Chksum_H : 8|8@1+ (1.0,0.0) [0.0|255.0] "" Dummy + SG_ CR_Ods_Chksum_L : 16|8@1+ (1.0,0.0) [0.0|255.0] "" Dummy + SG_ CR_Ods_RomID_H : 24|8@1+ (1.0,0.0) [0.0|255.0] "" Dummy + SG_ CR_Ods_RomID_L : 32|8@1+ (1.0,0.0) [0.0|255.0] "" Dummy + +BO_ 1531 ODS12: 8 ODS + SG_ CR_Ods_SerNum0 : 0|8@1+ (1.0,0.0) [0.0|255.0] "" ACU + SG_ CR_Ods_SerNum1 : 8|8@1+ (1.0,0.0) [0.0|255.0] "" ACU + SG_ CR_Ods_SerNum2 : 16|8@1+ (1.0,0.0) [0.0|255.0] "" ACU + SG_ CR_Ods_SerNum3 : 24|8@1+ (1.0,0.0) [0.0|255.0] "" ACU + SG_ CR_Ods_SerNum4 : 32|8@1+ (1.0,0.0) [0.0|255.0] "" ACU + SG_ CR_Ods_SerNum5 : 40|8@1+ (1.0,0.0) [0.0|255.0] "" ACU + SG_ CR_Ods_SerNum6 : 48|8@1+ (1.0,0.0) [0.0|255.0] "" ACU + SG_ CR_Ods_SerNum7 : 56|8@1+ (1.0,0.0) [0.0|255.0] "" ACU + +BO_ 1530 ODS11: 8 ODS + SG_ CF_Ods_PrcCmd : 1|1@1+ (1.0,0.0) [0.0|1.0] "" Dummy + SG_ CF_Ods_BtsFail : 3|1@1+ (1.0,0.0) [0.0|1.0] "" Dummy + SG_ CF_Ods_AcuRcvSN : 4|1@1+ (1.0,0.0) [0.0|1.0] "" ACU + SG_ CF_Ods_EolCal : 5|1@1+ (1.0,0.0) [0.0|1.0] "" ACU + SG_ CF_Ods_PsFail : 6|1@1+ (1.0,0.0) [0.0|1.0] "" ACU + SG_ CF_Ods_EcuFail : 7|1@1+ (1.0,0.0) [0.0|1.0] "" ACU + SG_ CF_Ods_WgtStat : 8|1@1+ (1.0,0.0) [0.0|1.0] "" ACU + SG_ CF_Ods_OccStat : 16|1@1+ (1.0,0.0) [0.0|1.0] "" ACU + SG_ CR_Wcs_ErrStat : 32|8@1+ (1.0,0.0) [0.0|63.0] "" ACU + SG_ CR_Wcs_ClassStat : 40|8@1+ (1.0,0.0) [0.0|4.0] "" ACU,BCM + +BO_ 1017 ECS12: 4 ECS + SG_ Height_FL : 0|8@1+ (1.0,-128.0) [-128.0|127.0] "mm" AFLS + SG_ Height_FR : 8|8@1+ (1.0,-128.0) [-128.0|127.0] "mm" AFLS + SG_ Height_RL : 16|8@1+ (1.0,-128.0) [-128.0|127.0] "mm" AFLS + SG_ Height_RR : 24|8@1+ (1.0,-128.0) [-128.0|127.0] "mm" AFLS + +BO_ 1268 SPAS12: 8 SPAS + SG_ CF_Spas_HMI_Stat : 0|8@1+ (1.0,0.0) [0.0|255.0] "" CLU + SG_ CF_Spas_Disp : 8|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,EMS + SG_ CF_Spas_FIL_Ind : 10|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU + SG_ CF_Spas_FIR_Ind : 13|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU + SG_ CF_Spas_FOL_Ind : 16|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU + SG_ CF_Spas_FOR_Ind : 19|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU + SG_ CF_Spas_VolDown : 22|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Spas_RIL_Ind : 24|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU + SG_ CF_Spas_RIR_Ind : 27|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU + SG_ CF_Spas_FLS_Alarm : 30|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Spas_ROL_Ind : 32|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU + SG_ CF_Spas_ROR_Ind : 35|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU + SG_ CF_Spas_FCS_Alarm : 38|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Spas_FI_Ind : 40|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU + SG_ CF_Spas_RI_Ind : 43|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU + SG_ CF_Spas_FRS_Alarm : 46|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Spas_FR_Alarm : 48|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU + SG_ CF_Spas_RR_Alarm : 50|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU + SG_ CF_Spas_BEEP_Alarm : 52|4@1+ (1.0,0.0) [0.0|15.0] "" BCM,CLU + SG_ CF_Spas_StatAlarm : 56|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Spas_RLS_Alarm : 57|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Spas_RCS_Alarm : 59|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Spas_RRS_Alarm : 61|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + +BO_ 1265 CLU11: 4 CLU + SG_ CF_Clu_CruiseSwState : 0|3@1+ (1.0,0.0) [0.0|7.0] "" EMS,LDWS_LKAS,SCC + SG_ CF_Clu_CruiseSwMain : 3|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,LDWS_LKAS,SCC + SG_ CF_Clu_SldMainSW : 4|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_Clu_ParityBit1 : 5|1@1+ (1.0,0.0) [0.0|1.0] "pulse count" EMS + SG_ CF_Clu_VanzDecimal : 6|2@1+ (0.125,0.0) [0.0|0.375] "" EMS + SG_ CF_Clu_Vanz : 8|9@1+ (0.5,0.0) [0.0|255.5] "km/h or MPH" BCM,CUBIS,EMS,IBOX,LDWS_LKAS,MDPS,SCC + SG_ CF_Clu_SPEED_UNIT : 17|1@1+ (1.0,0.0) [0.0|1.0] "" BCM,CUBIS,EMS,IBOX,LDWS_LKAS,MDPS,SCC + SG_ CF_Clu_DetentOut : 18|1@1+ (1.0,0.0) [0.0|1.0] "" AVM,BCM,LCA,PGS,SPAS + SG_ CF_Clu_RheostatLevel : 19|5@1+ (1.0,0.0) [0.0|31.0] "" AVM,BCM,LCA,PGS,SPAS + SG_ CF_Clu_CluInfo : 24|1@1+ (1.0,0.0) [0.0|1.0] "" BCM + SG_ CF_Clu_AmpInfo : 25|1@1+ (1.0,0.0) [0.0|1.0] "" BCM + SG_ CF_Clu_AliveCnt1 : 28|4@1+ (1.0,0.0) [0.0|15.0] "" AHLS,EMS,EPB,LDWS_LKAS,MDPS,SCC + +BO_ 1492 TMU_GW_PE_01: 8 CLU + SG_ TMU_IVRActivity : 0|2@1+ (1.0,0.0) [0.0|3.0] "" DATC + SG_ TMU_PhoneActivity : 2|2@1+ (1.0,0.0) [0.0|3.0] "" DATC + +BO_ 1491 HU_DATC_PE_00: 8 CLU + SG_ HU_VRActivity : 0|2@1+ (1.0,0.0) [0.0|3.0] "" DATC + SG_ HU_PhoneActivity : 2|2@1+ (1.0,0.0) [0.0|3.0] "" DATC + SG_ BlowerNoiseControl : 4|2@1+ (1.0,0.0) [0.0|3.0] "" DATC + +BO_ 1490 HU_DATC_E_02: 8 CLU + SG_ HU_DATC_RearOnOffSet : 6|2@1+ (1.0,0.0) [0.0|3.0] "" DATC + SG_ HU_DATC_ADSOnOffSet : 8|2@1+ (1.0,0.0) [0.0|3.0] "" DATC + +BO_ 1479 EMS21: 8 EMS + SG_ SCR_LEVEL_WARN_LAMP : 0|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ SCR_LEVEL_WARN : 1|3@1+ (1.0,0.0) [0.0|4.0] "" CLU + SG_ SCR_SYS_ERROR_WARN : 4|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ SCR_SYSTEM_WARN_LAMP : 7|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ SCR_INDUCEMENT_EXIT_COND : 8|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ SCR_UREA_LEVEL : 16|8@1+ (0.5,0.0) [0.0|100.0] "%" CLU + SG_ SCR_NO_REMAINING_RESTARTS : 24|8@1+ (1.0,0.0) [0.0|255.0] "" CLU + SG_ SCR_REMAINING_DISTANCE : 32|16@1+ (1.0,0.0) [0.0|25000.0] "km" CLU + +BO_ 1472 GW_Warning_PE: 8 BCM + SG_ Audio_VolumeDown : 38|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ Pas_Spkr_Flh_Alarm : 48|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ Pas_Spkr_Fcnt_Alarm : 50|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ Pas_Spkr_Frh_Alarm : 52|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ Pas_Spkr_Rlh_Alarm : 56|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,PGS + SG_ Pas_Spkr_Rcnt_Alarm : 58|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ Pas_Spkr_Rrh_Alarm : 60|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,PGS + +BO_ 1984 CAL_SAS11: 2 ESC + SG_ CCW : 0|4@1+ (1.0,0.0) [0.0|15.0] "" SAS + SG_ SAS_CID : 4|11@1+ (1.0,0.0) [0.0|2047.0] "" SAS + +BO_ 1456 CLU12: 4 CLU + SG_ CF_Clu_Odometer : 0|24@1+ (0.1,0.0) [0.0|1677721.4] "km" _4WD,AAF,BCM,CUBIS,EMS,EPB,IBOX,LDWS_LKAS,SCC,TPMS + +BO_ 688 SAS11: 5 MDPS + SG_ SAS_Angle : 0|16@1- (0.1,0.0) [-3276.8|3276.7] "Deg" _4WD,ACU,AFLS,AVM,CLU,ECS,EMS,ESC,IBOX,LCA,LDWS_LKAS,PGS,PSB,SCC,SPAS,TCU,_4WD,ACU,AFLS,AVM,BCM,CLU,ECS,EMS,ESC,IBOX,LCA,LDWS_LKAS,PGS,PSB,SCC,SPAS,TCU + SG_ SAS_Speed : 16|8@1+ (4.0,0.0) [0.0|1016.0] "" AFLS,ECS,ESC,IBOX,LDWS_LKAS,SCC,SPAS,TCU,AFLS,ECS,ESC,IBOX,LDWS_LKAS,SCC,SPAS,TCU + SG_ SAS_Stat : 24|8@1+ (1.0,0.0) [0.0|255.0] "" ECS,ESC,IBOX,LDWS_LKAS,PSB,SCC,SPAS,TCU,ECS,ESC,IBOX,LDWS_LKAS,PSB,SCC,SPAS,TCU + SG_ MsgCount : 32|4@1+ (1.0,0.0) [0.0|15.0] "" ECS,ESC,IBOX,LDWS_LKAS,PSB,SCC,SPAS,ECS,ESC,IBOX,LDWS_LKAS,PSB,SCC,SPAS + SG_ CheckSum : 36|4@1+ (1.0,0.0) [0.0|15.0] "" ECS,EMS,ESC,IBOX,LDWS_LKAS,PSB,SCC,SPAS,ECS,EMS,ESC,IBOX,LDWS_LKAS,PSB,SCC,SPAS + +BO_ 1441 ACU12: 8 ACU + SG_ CR_Acu_SN : 0|64@1+ (1.0,0.0) [0.0|0.0] "" ODS + +BO_ 1440 ACU11: 8 ACU + SG_ CF_Ods_SNRcv : 1|1@1+ (1.0,0.0) [0.0|1.0] "" ODS + SG_ CF_Ods_IDRcv : 2|1@1+ (1.0,0.0) [0.0|1.0] "" ODS + SG_ CF_Ods_RZReq : 4|1@1+ (1.0,0.0) [0.0|1.0] "" ODS + SG_ CF_Abg_DepInhEnt : 6|1@1+ (1.0,0.0) [0.0|1.0] "" ODS + SG_ CF_Abg_DepEnt : 7|1@1+ (1.0,0.0) [0.0|1.0] "" ODS + SG_ CF_PasBkl_FltStat : 28|1@1+ (1.0,0.0) [0.0|1.0] "" ODS,PSB + SG_ CF_DriBkl_FltStat : 29|1@1+ (1.0,0.0) [0.0|1.0] "" ODS,PSB + SG_ CF_PasBkl_Stat : 30|1@1+ (1.0,0.0) [0.0|1.0] "" IBOX,ODS,PSB,TMU + SG_ CF_DriBkl_Stat : 31|1@1+ (1.0,0.0) [0.0|1.0] "" ODS,PSB + SG_ CF_SWL_Ind : 32|2@1+ (1.0,0.0) [0.0|3.0] "" CUBIS,IBOX + SG_ CF_Acu_FltStat : 34|2@1+ (1.0,0.0) [0.0|3.0] "" CUBIS,IBOX + SG_ CF_Acu_ExtOfSab : 36|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU,CUBIS,IBOX + SG_ CF_Acu_Dtc : 40|16@1+ (1.0,0.0) [0.0|65535.0] "" CUBIS,IBOX + SG_ CF_Acu_NumOfFlt : 56|8@1+ (1.0,0.0) [0.0|255.0] "" CUBIS,IBOX + +BO_ 1437 AHLS11: 8 AHLS + SG_ CF_Ahls_WarnLamp : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Ahls_WarnMsg : 2|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + +BO_ 1434 PSB11: 2 PSB + SG_ PSB_LH_FAIL : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ PSB_LH_TGL : 2|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ PSB_LH_ACT : 3|4@1+ (1.0,0.0) [0.0|4.0] "" Dummy + SG_ PSB_RH_FAIL : 8|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ PSB_RH_TGL : 10|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ PSB_RH_ACT : 11|4@1+ (1.0,0.0) [0.0|4.0] "" Dummy + +BO_ 916 TCS13: 8 ESC + SG_ aBasis : 0|11@1+ (0.01,-10.23) [-10.23|10.24] "m/s^2" EMS,SCC + SG_ BrakeLight : 11|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,EMS,SCC + SG_ DCEnable : 12|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,SCC + SG_ AliveCounterTCS : 13|3@1+ (1.0,0.0) [0.0|7.0] "" EMS,SCC + SG_ Pre_TCS_CTL : 16|1@1+ (1.0,0.0) [0.0|1.0] "" Vector__XXX + SG_ EBA_ACK : 17|1@1+ (1.0,0.0) [0.0|1.0] "" Vector__XXX + SG_ FCA_ACK : 18|1@1+ (1.0,0.0) [0.0|1.0] "" Vector__XXX + SG_ DF_BF_STAT : 19|2@1+ (1.0,0.0) [0.0|3.0] "" BCW + SG_ SCCReqLim : 21|2@1+ (1.0,0.0) [0.0|3.0] "" SCC + SG_ TQI_SCC : 23|9@1+ (0.390625,0.0) [0.0|199.609375] "%" Vector__XXX + SG_ ACCEL_REF_ACC : 32|11@1+ (0.01,-10.23) [-10.23|10.24] "m/s^2" EMS,SCC + SG_ ACCEnable : 43|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,SCC + SG_ DriverOverride : 45|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,SCC + SG_ StandStill : 47|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,SCC + SG_ CheckSum_TCS3 : 48|4@1+ (1.0,0.0) [0.0|15.0] "" EMS,SCC + SG_ ACC_EQUIP : 52|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,SCC + SG_ PBRAKE_ACT : 53|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,SCC + SG_ ACC_REQ : 54|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ DriverBraking : 55|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,SCC + SG_ CF_VSM_Coded : 56|1@1+ (1.0,0.0) [0.0|1.0] "" SCC + SG_ CF_VSM_Avail : 57|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,SCC + SG_ CF_VSM_Handshake : 59|1@1+ (1.0,0.0) [0.0|1.0] "" SCC + SG_ CF_DriBkeStat : 60|1@1+ (1.0,0.0) [0.0|1.0] "" SCC + SG_ CF_VSM_ConfSwi : 61|2@1+ (1.0,0.0) [0.0|3.0] "" SCC + SG_ AEB_EQUIP : 63|1@1+ (1.0,0.0) [0.0|1.0] "" SCC + +BO_ 1427 TPMS11: 6 BCM + SG_ TPMS_W_LAMP : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,CUBIS,HUD,IBOX,CLU,CUBIS,HUD,IBOX + SG_ TREAD_W_LAMP : 2|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,CUBIS,HUD,IBOX,CLU,CUBIS,HUD,IBOX + SG_ POS_FL_W_LAMP : 4|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,CUBIS,HUD,IBOX + SG_ POS_FR_W_LAMP : 5|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,CUBIS,HUD,IBOX + SG_ POS_RL_W_LAMP : 6|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,CUBIS,HUD,IBOX + SG_ POS_RR_W_LAMP : 7|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,CUBIS,HUD,IBOX + SG_ STATUS_TPMS : 8|3@1+ (1.0,0.0) [0.0|0.0] "" CLU + SG_ UNIT : 11|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ PRESSURE_FL : 16|8@1+ (1.0,0.0) [0.0|255.0] "" CLU + SG_ PRESSURE_FR : 24|8@1+ (1.0,0.0) [0.0|255.0] "" CLU + SG_ PRESSURE_RL : 32|8@1+ (1.0,0.0) [0.0|255.0] "" CLU + SG_ PRESSURE_RR : 40|8@1+ (1.0,0.0) [0.0|255.0] "" CLU + +BO_ 915 TCS12: 4 ESC + SG_ SA_COUNT : 0|16@1+ (2.0,-32768.0) [-32768.0|98302.0] "" _4WD,ACU,MDPS + SG_ SA_Z_COUNT : 16|15@1+ (2.0,-32768.0) [-32768.0|32766.0] "" _4WD,ACU,MDPS + SG_ SA_Z_FLAG : 31|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ACU,MDPS + +BO_ 1170 EMS19: 8 EMS + SG_ CF_Ems_BrkReq : 0|1@1+ (1.0,0.0) [0.0|1.0] "" ESC,IBOX,TCU + SG_ CF_Ems_DnShftReq : 1|4@1+ (1.0,0.0) [0.0|14.0] "" IBOX,TCU + SG_ CF_Ems_RepModChk : 5|2@1+ (1.0,0.0) [0.0|3.0] "" IBOX + SG_ CF_Ems_AAFOpenReq : 7|1@1+ (1.0,0.0) [0.0|1.0] "" AAF,IBOX + SG_ CF_Ems_DecelReq : 8|12@1+ (0.0010,-4.094) [-4.094|0.0] "m/s^2" ESC,IBOX,TCU + SG_ CR_Ems_BstPre : 20|12@1+ (1.322,0.0) [0.0|4094.0] "hPa" CLU,IBOX + SG_ CR_Ems_EngOilTemp : 32|8@1+ (0.75,-40.0) [0.0|254.0] "deg" CLU,IBOX + SG_ DPF_LAMP_STAT : 40|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,IBOX + SG_ BAT_LAMP_STAT : 42|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ CF_Ems_ModeledAmbTemp : 48|8@1+ (0.5,-41.0) [-41.0|85.5] "deg" AAF,IBOX + SG_ CF_Ems_OPSFail : 56|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ CF_Ems_AliveCounterEMS9 : 58|2@1+ (1.0,0.0) [0.0|3.0] "" AAF,ABS,CUBIS,ECS,EPB,IBOX,MDPS,REA,SCC,SMK,TCU + SG_ CF_Ems_ChecksumEMS9 : 60|4@1+ (1.0,0.0) [0.0|15.0] "" AAF,ABS,CUBIS,ECS,EPB,IBOX,MDPS,REA,SCC,SMK,TCU + +BO_ 1425 AFLS11: 2 AFLS + SG_ AFLS_STAT : 1|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Afls_TrfChgStat : 3|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Afls_LedHLStat : 4|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + +BO_ 912 SPAS11: 7 SPAS + SG_ CF_Spas_Stat : 0|4@1+ (1.0,0.0) [0.0|15.0] "" ESC,MDPS + SG_ CF_Spas_TestMode : 4|2@1+ (1.0,0.0) [0.0|3.0] "" MDPS + SG_ CR_Spas_StrAngCmd : 8|16@1- (0.1,0.0) [-3276.8|3276.7] "" MDPS + SG_ CF_Spas_BeepAlarm : 24|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ CF_Spas_Mode_Seq : 28|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Spas_AliveCnt : 32|8@1+ (1.0,0.0) [0.0|255.0] "" MDPS + SG_ CF_Spas_Chksum : 40|8@1+ (1.0,0.0) [0.0|255.0] "" MDPS + SG_ CF_Spas_PasVol : 48|3@1+ (1.0,0.0) [0.0|7.0] "" CGW,CLU + +BO_ 1168 EPB11: 7 EPB + SG_ EPB_I_LAMP : 0|4@1+ (1.0,0.0) [0.0|15.0] "" BCM,CLU,CUBIS,ESC,IBOX + SG_ EPB_F_LAMP : 4|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,CUBIS,ESC,IBOX + SG_ EPB_ALARM : 6|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,ESC + SG_ EPB_CLU : 8|8@1+ (1.0,0.0) [0.0|255.0] "" CLU,ESC + SG_ EPB_SWITCH : 16|2@1+ (1.0,0.0) [0.0|3.0] "" ESC,SCC + SG_ EPB_RBL : 18|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,ESC + SG_ EPB_STATUS : 19|3@1+ (1.0,0.0) [0.0|7.0] "" CLU,EMS,ESC,SCC,TCU + SG_ EPB_FRC_ERR : 22|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,ESC,SCC,TCU + SG_ EPB_DBF_STAT : 24|1@1+ (1.0,0.0) [0.0|1.0] "" ESC + SG_ ESP_ACK : 25|1@1+ (1.0,0.0) [0.0|1.0] "" ESC + SG_ EPB_DBF_REQ : 26|1@1+ (1.0,0.0) [0.0|1.0] "" ESC + SG_ EPB_FAIL : 29|3@1+ (1.0,0.0) [0.0|7.0] "" ESC,SCC + SG_ EPB_FORCE : 32|12@1+ (1.0,-1000.0) [-1000.0|3000.0] "" ESC + SG_ EPB_DBF_DECEL : 48|8@1+ (0.01,0.0) [0.0|2.54] "g" ESC + +BO_ 399 EMS_H12: 8 EMS + SG_ R_TqAcnApvC : 0|8@1+ (0.2,0.0) [0.0|51.0] "Nm" DATC,IBOX + SG_ R_PAcnC : 8|8@1+ (125.0,0.0) [0.0|31875.0] "hPa" DATC,IBOX + SG_ TQI_B : 16|8@1+ (0.390625,0.0) [0.0|99.609375] "%" ABS,ESC,IBOX + SG_ SLD_VS : 24|8@1+ (1.0,0.0) [0.0|255.0] "km/h" CLU,IBOX + SG_ CF_CdaStat : 32|3@1+ (1.0,0.0) [0.0|7.0] "" AEMC,IBOX,TCU + SG_ CF_Ems_IsgStat : 35|3@1+ (1.0,0.0) [0.0|7.0] "" ABS,BCM,CLU,DATC,EPB,ESC,IBOX,LDWS_LKAS,MDPS,SMK,TCU + SG_ CF_Ems_OilChg : 38|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ CF_Ems_EtcLimpMod : 39|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ R_NEngIdlTgC : 40|8@1+ (10.0,0.0) [0.0|2550.0] "rpm" DATC,IBOX,TCU + SG_ CF_Ems_UpTarGr : 48|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ CF_Ems_DownTarGr : 49|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ CF_Ems_DesCurGr : 50|4@1+ (1.0,0.0) [0.0|15.0] "" CLU,IBOX + SG_ CF_Ems_SldAct : 54|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ CF_Ems_SldPosAct : 55|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ CF_Ems_HPresStat : 56|1@1+ (1.0,0.0) [0.0|1.0] "" IBOX,TCU + SG_ CF_Ems_IsgBuz : 57|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ CF_Ems_IdlStpFCO : 58|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ CF_Ems_FCopen : 59|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ CF_Ems_ActEcoAct : 60|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX,TCU + SG_ CF_Ems_EngRunNorm : 61|1@1+ (1.0,0.0) [0.0|1.0] "" ABS,ESC,IBOX,TCU + SG_ CF_Ems_IsgStat2 : 62|2@1+ (2.0,0.0) [0.0|3.0] "" CLU,IBOX,TCU + +BO_ 1419 LCA11: 8 LCA + SG_ CF_Lca_Stat : 0|4@1+ (1.0,0.0) [0.0|15.0] "" BCM,CLU + SG_ CF_Rcta_Stat : 4|4@1+ (1.0,0.0) [0.0|15.0] "" BCM,CLU + SG_ CF_Lca_IndLeft : 8|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU + SG_ CF_Rcw_Stat : 10|4@1+ (1.0,0.0) [0.0|15.0] "" BCM,CLU + SG_ CF_RCW_Warning : 14|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU + SG_ CF_Lca_IndRight : 16|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU + SG_ CF_Lca_SndWan_Stat : 18|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU + SG_ CF_FR_SndWan : 20|1@1+ (1.0,0.0) [0.0|1.0] "" BCM,CLU + SG_ CF_FL_SndWan : 21|1@1+ (1.0,0.0) [0.0|1.0] "" BCM,CLU + SG_ CF_RR_SndWan : 22|1@1+ (1.0,0.0) [0.0|1.0] "" BCM,CLU + SG_ CF_RL_SndWan : 23|1@1+ (1.0,0.0) [0.0|1.0] "" BCM,CLU + SG_ CF_Lca_IndBriLeft : 24|8@1+ (1.0,0.0) [0.0|255.0] "" BCM,CLU + SG_ CF_Lca_IndBriRight : 32|8@1+ (1.0,0.0) [0.0|255.0] "" BCM,CLU + SG_ CF_RCTA_IndBriLeft : 40|8@1+ (1.0,0.0) [0.0|255.0] "" BCM,CLU + SG_ CF_RCTA_IndBriRight : 48|8@1+ (1.0,0.0) [0.0|255.0] "" BCM,CLU + SG_ CF_RCTA_IndLeft : 56|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU + SG_ CF_RCTA_IndRight : 58|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU + SG_ CF_SndWarnForClu : 60|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + +BO_ 906 ABS11: 8 ABS + SG_ ABS_DEF : 0|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ACU,EMS,SPAS,TCU + SG_ EBD_DEF : 1|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,EMS,SPAS,TCU + SG_ ABS_ACT : 2|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ACU,EPB,SPAS,TCU + SG_ ABS_W_LAMP : 3|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,CLU,CUBIS,MTS,TMU + SG_ EBD_W_LAMP : 4|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,CLU + SG_ ABS_DIAG : 5|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,CLU + SG_ ESS_STAT : 6|2@1+ (1.0,0.0) [0.0|3.0] "" _4WD,BCM,CLU,EMS + +BO_ 903 WHL_PUL11: 6 ABS + SG_ WHL_PUL_FL : 0|8@1+ (0.5,0.0) [0.0|127.5] "pulse count" CUBIS,EPB,IBOX,SPAS,TMU,TPMS,CUBIS,EPB,IBOX,LDWS_LKAS,SPAS,TMU,TPMS + SG_ WHL_PUL_FR : 8|8@1+ (0.5,0.0) [0.0|127.5] "pulse count" CUBIS,EPB,IBOX,SPAS,TMU,TPMS,CUBIS,EPB,IBOX,LDWS_LKAS,SPAS,TMU,TPMS + SG_ WHL_PUL_RL : 16|8@1+ (0.5,0.0) [0.0|127.5] "pulse count" CUBIS,EPB,IBOX,SPAS,TMU,TPMS,CUBIS,EPB,IBOX,LDWS_LKAS,SPAS,TMU,TPMS + SG_ WHL_PUL_RR : 24|8@1+ (0.5,0.0) [0.0|127.5] "pulse count" CUBIS,EPB,IBOX,SPAS,TMU,TPMS,CUBIS,EPB,IBOX,LDWS_LKAS,SPAS,TMU,TPMS + SG_ WHL_DIR_FL : 32|2@1+ (1.0,0.0) [0.0|3.0] "" EPB,SPAS,TPMS,EPB,LCA,SPAS,TPMS + SG_ WHL_DIR_FR : 34|2@1+ (1.0,0.0) [0.0|3.0] "" EPB,SPAS,TPMS,EPB,LCA,SPAS,TPMS + SG_ WHL_DIR_RL : 36|2@1+ (1.0,0.0) [0.0|3.0] "" EPB,SPAS,TPMS,EPB,LCA,SPAS,TPMS + SG_ WHL_DIR_RR : 38|2@1+ (1.0,0.0) [0.0|3.0] "" EPB,SPAS,TPMS,EPB,LCA,SPAS,TPMS + SG_ WHL_PUL_Chksum : 40|8@1+ (1.0,0.0) [0.0|255.0] "" EPB,SPAS,TPMS,EPB,LCA,LDWS_LKAS,SPAS,TPMS + +BO_ 1415 TMU11: 8 IBOX + SG_ CF_Tmu_VehSld : 0|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_Tmu_VehImmo : 1|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_Tmu_ReqRepCnd : 2|2@1+ (1.0,0.0) [0.0|3.0] "" EMS + SG_ CF_Tmu_AirconCtr : 4|1@1+ (1.0,0.0) [0.0|1.0] "" DATC + SG_ CF_Tmu_TempMd : 5|1@1+ (1.0,0.0) [0.0|1.0] "" DATC + SG_ CF_Tmu_TempSet : 6|16@1+ (1.0,0.0) [0.0|20.0] "" DATC + SG_ CF_Tmu_DefrostCtr : 22|1@1+ (1.0,0.0) [0.0|1.0] "" DATC,FATC + SG_ CF_Tmu_AliveCnt1 : 56|4@1+ (1.0,0.0) [0.0|15.0] "" EMS + +BO_ 902 WHL_SPD11: 8 ABS + SG_ WHL_SPD_FL : 0|14@1+ (0.03125,0.0) [0.0|511.96875] "km/h" _4WD,AFLS,AHLS,AVM,CLU,CUBIS,ECS,EMS,EPB,IBOX,LDWS_LKAS,PGS,PSB,SCC,SMK,SPAS,TCU,TPMS,_4WD,ACU,AFLS,AHLS,AVM,CLU,ECS,EMS,EPB,IBOX,LCA,LDWS_LKAS,PGS,PSB,SCC,SMK,SPAS,TCU,TPMS + SG_ WHL_SPD_FR : 16|14@1+ (0.03125,0.0) [0.0|511.96875] "km/h" _4WD,ACU,AFLS,AHLS,AVM,CLU,CUBIS,ECS,EMS,EPB,IBOX,LDWS_LKAS,PGS,PSB,SCC,SMK,SPAS,TCU,TPMS,_4WD,ACU,AFLS,AHLS,AVM,CLU,ECS,EMS,EPB,IBOX,LCA,LDWS_LKAS,PGS,PSB,SCC,SMK,SPAS,TCU,TPMS + SG_ WHL_SPD_RL : 32|14@1+ (0.03125,0.0) [0.0|511.96875] "km/h" _4WD,AFLS,AHLS,AVM,BCM,CLU,CUBIS,ECS,EMS,EPB,IBOX,LDWS_LKAS,PGS,PSB,SCC,SMK,SPAS,TCU,TPMS,_4WD,ACU,AFLS,AHLS,AVM,BCM,CLU,ECS,EMS,EPB,IBOX,LCA,LDWS_LKAS,PGS,PSB,SCC,SMK,SPAS,TCU,TPMS + SG_ WHL_SPD_RR : 48|14@1+ (0.03125,0.0) [0.0|511.96875] "km/h" _4WD,AFLS,AHLS,AVM,CLU,CUBIS,ECS,EMS,EPB,IBOX,LDWS_LKAS,PGS,PSB,SCC,SMK,SPAS,TCU,TPMS,_4WD,ACU,AFLS,AHLS,AVM,CLU,ECS,EMS,EPB,IBOX,LCA,LDWS_LKAS,PGS,PSB,SCC,SMK,SPAS,TCU,TPMS + SG_ WHL_SPD_AliveCounter_LSB : 14|2@1+ (1.0,0.0) [0.0|15.0] "" _4WD,EMS,LPI,TCU,TMU + SG_ WHL_SPD_AliveCounter_MSB : 30|2@1+ (1.0,0.0) [0.0|15.0] "" _4WD,EMS,LPI,TCU,TMU + SG_ WHL_SPD_Checksum_LSB : 46|2@1+ (1.0,0.0) [0.0|15.0] "" _4WD,EMS,LPI,TCU,TMU + SG_ WHL_SPD_Checksum_MSB : 62|2@1+ (1.0,0.0) [0.0|15.0] "" _4WD,EMS,LPI,TCU,TMU + +BO_ 1414 EVP11: 3 EVP + SG_ CF_Evp_Stat : 0|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + +BO_ 1412 AAF11: 8 AAF + SG_ CF_Aaf_ActFlapStatus : 0|2@1+ (1.0,0.0) [0.0|3.0] "" AAF_Tester + SG_ CF_Aaf_ModeStatus : 2|3@1+ (1.0,0.0) [0.0|7.0] "" AAF_Tester + SG_ CF_Aaf_WrnLamp : 5|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Aaf_ErrStatus : 6|10@1+ (1.0,0.0) [0.0|1023.0] "" AAF_Tester,EMS + SG_ CF_Aaf_OpenRqSysAct : 16|8@1+ (1.0,0.0) [0.0|255.0] "" AAF_Tester + SG_ CF_Aaf_PStatus : 24|8@1+ (1.0,0.0) [0.0|100.0] "%" AAF_Tester + SG_ CF_Aaf_OpenRqSysSol : 32|8@1+ (1.0,0.0) [0.0|255.0] "" AAF_Tester + SG_ CF_Aaf_SolFlapStatus : 40|2@1+ (1.0,0.0) [0.0|3.0] "" AAF_Tester + SG_ CF_Aaf_MilOnReq : 42|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + +BO_ 900 EMS17: 8 EMS + SG_ CF_Ems_PkpCurMSV : 0|8@1+ (1.0,0.0) [0.0|255.0] "" DI_BOX + SG_ CF_Ems_HolCurMSV : 8|8@1+ (1.0,0.0) [0.0|255.0] "" DI_BOX + SG_ CF_Ems_InjVBnkAct : 16|8@1+ (1.0,0.0) [0.0|255.0] "" DI_BOX + SG_ CF_Ems_InjVActSet : 24|8@1+ (1.0,0.0) [0.0|255.0] "" DI_BOX + SG_ CF_Ems_DiagFulHDEV : 32|1@1+ (1.0,0.0) [0.0|1.0] "" DI_BOX + SG_ CF_Ems_SwiOffIC1 : 33|1@1+ (1.0,0.0) [0.0|1.0] "" DI_BOX + SG_ CF_Ems_SwiOffIC2 : 34|1@1+ (1.0,0.0) [0.0|1.0] "" DI_BOX + SG_ CF_Ems_DiagReqHDEV : 38|1@1+ (1.0,0.0) [0.0|1.0] "" DI_BOX + SG_ CR_Ems_DutyCycMSV : 40|8@1+ (0.3921568627,0.0) [0.0|100.0] "%" DI_BOX + SG_ CR_Ems_BatVolRly : 48|8@1+ (0.1,0.0) [0.0|25.5] "V" DI_BOX + +BO_ 387 REA11: 8 REA + SG_ CF_EndBst_PwmDuH : 0|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_EndBst_PwmDuL : 1|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_EndBst_PwmFqOutRng : 2|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_EndBst_HbriOverCur : 3|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_EndBst_HbriOverTemp : 4|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_EndBst_PosSnsKOR : 6|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_EndBst_PosSnsOSOR : 7|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_EndBst_EepFlt : 8|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_EndBst_RomFlt : 9|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_EndBst_RamFlt : 10|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_EndBst_CanFlt : 11|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_EndBst_AgH : 12|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_EndBst_AgL : 13|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_EndBst_ORVol : 14|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CR_EndBst_ActPos : 16|16@1+ (0.117,0.0) [1.989|118.053] "" EMS + SG_ CR_EndBst_DemPos : 32|16@1+ (0.117,0.0) [0.0|119.691] "" EMS + SG_ CR_EndBst_HbriPwr : 48|16@1+ (0.045,0.0) [0.0|99.99] "%" EMS + +BO_ 1411 CUBIS11: 8 CUBIS + SG_ CF_Cubis_HUDisp : 0|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + +BO_ 899 FATC11: 8 DATC + SG_ CR_Fatc_TqAcnOut : 0|8@1+ (0.2,0.0) [0.0|50.8] "Nm" EMS,IBOX + SG_ CF_Fatc_AcnRqSwi : 8|1@1+ (1.0,0.0) [0.0|1.0] "" AAF,EMS,IBOX + SG_ CF_Fatc_AcnCltEnRq : 9|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ CF_Fatc_EcvFlt : 10|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ CF_Fatc_BlwrOn : 11|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ CF_FATC_Iden : 12|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,IBOX + SG_ CF_Fatc_BlwrMax : 14|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,EMS,IBOX + SG_ CF_Fatc_EngStartReq : 15|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ CF_Fatc_IsgStopReq : 16|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ CF_Fatc_CtrInf : 17|3@1+ (1.0,0.0) [0.0|7.0] "" EMS,IBOX + SG_ CF_Fatc_MsgCnt : 20|4@1+ (1.0,0.0) [0.0|15.0] "" EMS,IBOX + SG_ CR_Fatc_OutTemp : 24|8@1+ (0.5,-40.0) [-40.0|60.0] "deg" BCM,CLU,EMS,IBOX,SPAS,TCU,TPMS + SG_ CR_Fatc_OutTempSns : 32|8@1+ (0.5,-40.0) [-40.0|60.0] "deg" AAF,AHLS,CLU,EMS,IBOX,SPAS,TCU + SG_ CF_Fatc_Compload : 40|3@1+ (1.0,0.0) [0.0|7.0] "" EMS,IBOX + SG_ CF_Fatc_ActiveEco : 43|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ CF_Fatc_AutoActivation : 44|1@1+ (1.0,0.0) [0.0|1.0] "" IBOX + SG_ CF_Fatc_DefSw : 45|1@1+ (1.0,0.0) [0.0|1.0] "" BCM,IBOX + SG_ CF_Fatc_PtcRlyStat : 46|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ CF_Fatc_ChkSum : 56|8@1+ (1.0,0.0) [0.0|255.0] "" EMS,IBOX,SPAS + +BO_ 129 EMS_DCT12: 8 EMS + SG_ CR_Ems_SoakTimeExt : 0|6@1+ (5.0,0.0) [0.0|315.0] "Min" TCU + SG_ BRAKE_ACT : 6|2@1+ (1.0,0.0) [0.0|3.0] "" TCU + SG_ CF_Ems_EngOperStat : 8|8@1+ (1.0,0.0) [0.0|255.0] "" TCU + SG_ CR_Ems_IndAirTemp : 16|8@1+ (0.75,-48.0) [-48.0|143.25] "deg" TCU + SG_ CF_Ems_Alive2 : 56|4@1+ (1.0,0.0) [0.0|15.0] "" TCU + SG_ CF_Ems_ChkSum2 : 60|4@1+ (1.0,0.0) [0.0|15.0] "" TCU + +BO_ 897 MDPS11: 8 MDPS + SG_ CF_Mdps_WLmp : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,CUBIS,EMS,IBOX,SPAS + SG_ CF_Mdps_Flex : 2|3@1+ (1.0,0.0) [0.0|3.0] "" CLU,LDWS_LKAS + SG_ CF_Mdps_FlexDisp : 5|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Mdps_Stat : 7|4@1+ (1.0,0.0) [0.0|15.0] "" SPAS + SG_ CR_Mdps_DrvTq : 11|12@1+ (1.0,-2048.0) [-2048.0|2046.0] "" SPAS + SG_ CF_Mdps_ALTRequest : 23|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CR_Mdps_StrAng : 24|16@1- (0.1,0.0) [-3276.8|3276.7] "Deg" SPAS + SG_ CF_Mdps_AliveCnt : 40|8@1+ (1.0,0.0) [0.0|255.0] "" LDWS_LKAS,SPAS + SG_ CF_Mdps_Chksum : 48|8@1+ (1.0,0.0) [0.0|255.0] "" LDWS_LKAS,SPAS + SG_ CF_Mdps_SPAS_FUNC : 57|1@1+ (1.0,0.0) [0.0|1.0] "flag" SPAS + SG_ CF_Mdps_LKAS_FUNC : 58|1@1+ (1.0,0.0) [0.0|1.0] "flag" LDWS_LKAS + SG_ CF_Mdps_CurrMode : 59|2@1+ (1.0,0.0) [0.0|3.0] "" LDWS_LKAS + SG_ CF_Mdps_Type : 61|2@1+ (1.0,0.0) [0.0|2.0] "" LDWS_LKAS,SPAS + SG_ CF_MDPS_VSM_FUNC : 56|1@0+ (1.0,0.0) [0.0|1.0] "" XXX + +BO_ 896 DI_BOX13: 8 DI_BOX + SG_ CF_DiBox_HPreInjVConfStat : 0|8@1+ (1.0,0.0) [0.0|255.0] "" EMS + SG_ CF_DiBox_HPreInjVStat1 : 8|8@1+ (1.0,0.0) [0.0|255.0] "" EMS + SG_ CF_DiBox_HPreInjVStat2 : 16|8@1+ (1.0,0.0) [0.0|255.0] "" EMS + SG_ CF_DiBox_HPreInjVPkp : 24|8@1+ (1.0,0.0) [0.0|255.0] "" EMS + SG_ CF_DiBox_HPreInjVBpt : 32|8@1+ (1.0,0.0) [0.0|255.0] "" EMS + SG_ CF_DiBox_ErrRegFrtMSV : 40|8@1+ (1.0,0.0) [0.0|255.0] "" EMS + SG_ CF_DiBox_ErrRegSedMSV : 48|8@1+ (1.0,0.0) [0.0|255.0] "" EMS + SG_ CF_DiBox_SPIErrSedMSV : 56|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_DiBox_SPIErrFrtMSV : 57|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_DiBox_IDErrSedMSV : 58|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_DiBox_IDErrFrtMSV : 59|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_DiBox_IniStatMSV : 60|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + +BO_ 640 EMS13: 8 EMS + SG_ LV_FUEL_TYPE_ECU : 0|1@1+ (1.0,0.0) [0.0|1.0] "" BCM,CLU,LPI,SMK + SG_ LV_BFS_CFIRM : 1|1@1+ (1.0,0.0) [0.0|1.0] "" LPI + SG_ LV_CRASH : 2|1@1+ (1.0,0.0) [0.0|1.0] "" LPI + SG_ LV_VB_OFF_ACT : 3|1@1+ (1.0,0.0) [0.0|1.0] "" LPI + SG_ LV_GSL_MAP M : 4|1@1+ (1.0,0.0) [0.0|1.0] "" LPI + SG_ LV_ENG_TURN : 5|1@1+ (1.0,0.0) [0.0|1.0] "" LPI + SG_ ERR_FUEL : 8|8@1+ (1.0,0.0) [0.0|255.0] "" LPI + SG_ EOS : 16|8@1+ (1.0,0.0) [0.0|255.0] "" LPI + SG_ TCO : 24|8@1+ (0.75,-48.0) [-48.0|143.25] "deg" LPI + SG_ N_32 : 32|8@1+ (32.0,0.0) [0.0|8160.0] "rpm" LPI + SG_ MAF : 40|8@1+ (5.447,0.0) [0.0|1388.985] "mg/TDC" LPI + SG_ TIA : 48|8@1+ (0.75,-48.0) [-48.0|143.25] "deg" LPI + SG_ MAP m1 : 56|8@1+ (0.47058,0.0) [0.0|119.9979] "kPa" LPI + SG_ AMP m0 : 56|8@1+ (21.22,0.0) [0.0|5411.1] "hPa" LPI + +BO_ 128 EMS_DCT11: 8 EMS + SG_ PV_AV_CAN : 0|8@1+ (0.3906,0.0) [0.0|99.603] "%" TCU + SG_ TQ_STND : 8|6@1+ (10.0,0.0) [0.0|630.0] "Nm" TCU + SG_ F_N_ENG : 14|1@1+ (1.0,0.0) [0.0|1.0] "" TCU + SG_ F_SUB_TQI : 15|1@1+ (1.0,0.0) [0.0|1.0] "" TCU + SG_ N : 16|16@1+ (0.25,0.0) [0.0|16383.75] "rpm" TCU + SG_ TQI_ACOR : 32|8@1+ (0.390625,0.0) [0.0|99.6094] "%" IBOX,TCU + SG_ TQFR : 40|8@1+ (0.390625,0.0) [0.0|99.6094] "%" TCU + SG_ TQI : 48|8@1+ (0.390625,0.0) [0.0|99.609375] "%" TCU + SG_ CF_Ems_Alive : 56|4@1+ (1.0,0.0) [0.0|15.0] "" TCU + SG_ CF_Ems_ChkSum : 60|4@1+ (1.0,0.0) [0.0|15.0] "" TCU + +BO_ 1407 HU_MON_PE_01: 8 CLU + SG_ HU_Type : 0|8@1+ (1.0,0.0) [0.0|255.0] "" AVM,PGS + +BO_ 127 CGW5: 8 BCM + SG_ C_StopLampLhOpenSts : 0|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_StopLampRhOpenSts : 1|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_HMSLOpenSts : 2|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_HLampLowLhOpenSts : 3|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_HLampLowRhOpenSts : 4|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_HLampHighLhOpenSts : 5|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_HLampHighRhOpenSts : 6|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_DRLLampLhOpenSts : 7|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_DRLLampRhOpenSts : 8|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_RearFOGLhOpenSts : 9|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_RearFOGRhOpenSts : 10|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_FrontFOGLhOpenSts : 11|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_FrontFOGRhOpenSts : 12|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_RearEXTTailLhOpenSts : 13|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_RearEXTTailRhOpenSts : 14|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_FrontEXTTailLhOpenSts : 15|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_FrontEXTTailRhOpenSts : 16|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_RearTSIGLhOpenSts : 17|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_RearTSIGRhOpenSts : 18|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_FrontTSIGLhOpenSts : 19|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_FrontTSIGRhOpenSts : 20|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_SBendingLhOpenSts : 21|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_SBendingRhOpenSts : 22|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_LicensePlateLhOpenSts : 23|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_LicensePlateRhOpenSts : 24|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + +BO_ 1151 ESP11: 6 ESC + SG_ AVH_STAT : 0|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,EPB,TCU + SG_ LDM_STAT : 2|1@1+ (1.0,0.0) [0.0|1.0] "" EPB,TCU + SG_ REQ_EPB_ACT : 3|2@1+ (1.0,0.0) [0.0|3.0] "" EPB,TCU + SG_ REQ_EPB_STAT : 5|1@1+ (1.0,0.0) [0.0|1.0] "" EPB + SG_ ECD_ACT : 6|1@1+ (1.0,0.0) [0.0|1.0] "" EPB + SG_ _4WD_LIM_REQ : 7|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,EMS + SG_ ROL_CNT_ESP : 8|8@1+ (1.0,0.0) [0.0|255.0] "" EPB,TCU + SG_ _4WD_TQC_LIM : 16|16@1+ (1.0,0.0) [0.0|65535.0] "Nm" _4WD,EMS + SG_ _4WD_CLU_LIM : 32|8@1+ (0.390625,0.0) [0.0|99.609375] "%" _4WD,EMS + SG_ _4WD_OPEN : 40|2@1+ (1.0,0.0) [0.0|3.0] "" _4WD,EMS + SG_ _4WD_LIM_MODE : 42|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD + +BO_ 1397 HU_AVM_E_00: 8 CLU + SG_ HU_AVM_Cal_Cmd : 0|4@1+ (1.0,0.0) [0.0|15.0] "" AVM,PGS + SG_ HU_AVM_Cal_Method : 4|2@1+ (1.0,0.0) [0.0|3.0] "" AVM,PGS + SG_ HU_AVM_Save_Controlpoint : 6|2@1+ (1.0,0.0) [0.0|3.0] "" AVM,PGS + SG_ HU_AVM_PT_X : 8|12@1+ (1.0,0.0) [0.0|15.0] "" AVM,PGS + SG_ HU_AVM_RearViewPointOpt : 20|4@1+ (1.0,0.0) [0.0|15.0] "" AVM,PGS + SG_ HU_AVM_PT_Y : 24|12@1+ (1.0,0.0) [0.0|4095.0] "" AVM,PGS + SG_ HU_AVM_FrontViewPointOpt : 36|4@1+ (1.0,0.0) [0.0|15.0] "" AVM,PGS + SG_ HU_AVM_SelectedMenu : 40|5@1+ (1.0,0.0) [0.0|31.0] "" AVM,PGS + SG_ HU_AVM_CameraOff : 45|2@1+ (1.0,0.0) [0.0|3.0] "" AVM,PGS + SG_ HU_AVM_Option : 48|4@1+ (1.0,0.0) [0.0|15.0] "" AVM,PGS + SG_ HU_AVM_CrossLineMove_Cmd : 52|4@1+ (1.0,0.0) [0.0|15.0] "" AVM,PGS + SG_ HU_AVM_RearView_Option : 56|4@1+ (1.0,0.0) [0.0|15.0] "" AVM,PGS + SG_ HU_AVM_FrontView_Option : 60|4@1+ (1.0,0.0) [0.0|15.0] "" AVM,PGS + +BO_ 1395 HU_AVM_E_01: 8 CLU + SG_ HU_PGSSelectedMenu : 0|4@1+ (1.0,0.0) [0.0|15.0] "" AVM,PGS + SG_ HU_PGSOption : 8|5@1+ (1.0,0.0) [0.0|31.0] "" AVM,PGS + SG_ HU_AVM_ParkingAssistMenu : 56|4@1+ (1.0,0.0) [0.0|15.0] "" AVM,PGS + SG_ HU_AVM_ParkingAssistSB : 60|4@1+ (1.0,0.0) [0.0|15.0] "" AVM,PGS + +BO_ 1393 OPI11: 5 OPI + SG_ CR_Opi_Spd_Rpm : 0|8@1+ (20.0,0.0) [0.0|3500.0] "rpm" TCU + SG_ CF_Opi_Over_Temp : 8|1@1+ (1.0,0.0) [0.0|1.0] "" TCU + SG_ CF_Opi_Over_Cur : 9|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,TCU + SG_ CF_Opi_Over_Vol : 10|1@1+ (1.0,0.0) [0.0|1.0] "" TCU + SG_ CF_Opi_Hall_Fail : 11|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,TCU + SG_ CF_Opi_Flt : 12|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,TCU + SG_ CF_Opi_Motor_Dir : 15|1@1+ (1.0,0.0) [0.0|1.0] "" TCU + SG_ CF_Opi_Romver : 16|8@1+ (1.0,0.0) [0.0|255.0] "" TCU + SG_ CF_Opi_PWM_Rate : 24|12@1+ (1.0,0.0) [0.0|100.0] "%" TCU + +BO_ 625 LPI11: 8 LPI + SG_ FUP_LPG_MMV : 0|8@1+ (128.0,0.0) [0.0|32640.0] "hPa" EMS + SG_ LV_FUEL_TYPE_BOX : 8|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ LV_BFS_IN_PROGRESS : 9|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ LV_GAS_OK : 10|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ LV_FUP_ENA_THD : 11|1@1+ (1.0,0.0) [0.0|1.0] "" BCM,CLU,EMS,SMK + SG_ LPI_OBD : 12|4@1+ (1.0,0.0) [0.0|15.0] "" EMS + SG_ ERR_GAS : 16|8@1+ (1.0,0.0) [0.0|255.0] "" EMS + SG_ FAC_TI_GAS_COR : 24|16@1+ (3.05E-5,0.0) [0.0|1.9988175] "" EMS + SG_ FTL_AFU : 40|8@1+ (0.392,0.0) [0.0|99.96] "%" EMS + SG_ BFS_CYL : 48|8@1+ (1.0,0.0) [0.0|6.0] "Cyl Nr." EMS + SG_ LV_PRE_CDN_LEAK : 56|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ LV_CONF_INJECTION_DELAY : 57|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ LV_LPG_SW_DRIVER_REQ : 58|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + +BO_ 356 VSM11: 4 ESC + SG_ CR_Esc_StrTqReq : 0|12@1+ (0.01,-20.48) [-20.48|20.47] "Nm" MDPS + SG_ CF_Esc_Act : 12|1@1+ (1.0,0.0) [0.0|1.0] "" LDWS_LKAS,MDPS + SG_ CF_Esc_CtrMode : 13|3@1+ (1.0,0.0) [0.0|7.0] "" MDPS + SG_ CF_Esc_Def : 16|1@1+ (1.0,0.0) [0.0|1.0] "" MDPS + SG_ CF_Esc_AliveCnt : 17|4@1+ (1.0,0.0) [0.0|15.0] "" LDWS_LKAS,MDPS + SG_ CF_Esc_Chksum : 24|8@1+ (1.0,0.0) [0.0|255.0] "" LDWS_LKAS,MDPS + +BO_ 1379 PGS_HU_PE_01: 8 PGS + SG_ PGS_State : 0|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ PGS_ParkGuideState : 8|5@1+ (1.0,0.0) [0.0|31.0] "" CLU + SG_ PGS_Option : 16|5@1+ (1.0,0.0) [0.0|31.0] "" CLU + SG_ PGS_Version : 32|16@1+ (1.0,0.0) [0.0|65535.0] "" CLU + +BO_ 354 TCU_DCT13: 3 TCU + SG_ Clutch_Driving_Tq : 0|10@1+ (1.0,-512.0) [0.0|0.0] "Nm" ESC + SG_ Cluster_Engine_RPM : 10|13@1+ (0.9766,0.0) [0.0|0.0] "" CLU + SG_ Cluster_Engine_RPM_Flag : 23|1@1+ (1.0,0.0) [0.0|0.0] "" CLU + +BO_ 1378 HUD11: 4 HUD + SG_ CF_Hud_HeightStaus : 0|5@1+ (1.0,0.0) [0.0|31.0] "" CLU + SG_ CF_Hud_PBackStatus : 6|2@1+ (1.0,0.0) [0.0|0.0] "" BCM,CLU + SG_ CF_Hud_Brightness : 8|5@1+ (1.0,0.0) [0.0|31.0] "" CLU + +BO_ 608 EMS16: 8 EMS + SG_ TQI_MIN : 0|8@1+ (0.390625,0.0) [0.0|99.609375] "%" ESC,IBOX,TCU + SG_ TQI : 8|8@1+ (0.390625,0.0) [0.0|99.609375] "%" ESC,IBOX,TCU + SG_ TQI_TARGET : 16|8@1+ (0.390625,0.0) [0.0|99.609375] "%" EPB,ESC,IBOX,TCU + SG_ GLOW_STAT : 24|1@1+ (1.0,0.0) [0.0|1.0] "" BCM,CLU,IBOX,SMK + SG_ CRUISE_LAMP_M : 25|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX,TCU + SG_ CRUISE_LAMP_S : 26|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX,TCU + SG_ PRE_FUEL_CUT_IN : 27|1@1+ (1.0,0.0) [0.0|1.0] "" IBOX,TCU + SG_ ENG_STAT : 28|3@1+ (1.0,0.0) [0.0|7.0] "" ABS,AHLS,AVM,BCM,CLU,EPB,ESC,EVP,FPCM,IBOX,LCA,LDWS_LKAS,MDPS,SCC,SMK,TCU + SG_ SOAK_TIME_ERROR : 31|1@1+ (1.0,0.0) [0.0|1.0] "" DATC,EPB,IBOX,TCU + SG_ SOAK_TIME : 32|8@1+ (1.0,0.0) [0.0|255.0] "Min" _4WD,DATC,EPB,IBOX,TCU + SG_ TQI_MAX : 40|8@1+ (0.390625,0.0) [0.0|99.609375] "%" ESC,IBOX,TCU + SG_ SPK_TIME_CUR : 48|8@1+ (0.375,-35.625) [-35.625|60.0] "" IBOX,TCU + SG_ Checksum : 56|4@1+ (1.0,0.0) [0.0|15.0] "" ECS,IBOX,LDWS_LKAS,MDPS,SCC + SG_ AliveCounter : 60|2@1+ (1.0,0.0) [0.0|3.0] "" IBOX,LDWS_LKAS,MDPS,SCC + SG_ CF_Ems_AclAct : 62|2@1+ (1.0,0.0) [0.0|3.0] "" IBOX,SCC + +BO_ 1371 AVM_HU_PE_00: 8 AVM + SG_ AVM_View : 0|5@1+ (1.0,0.0) [0.0|31.0] "" CLU + SG_ AVM_ParkingAssist_BtnSts : 5|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ AVM_Display_Message : 8|8@1+ (1.0,0.0) [0.0|255.0] "" CLU + SG_ AVM_Popup_Msg : 16|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ AVM_Ready : 20|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ AVM_ParkingAssist_Step : 24|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ AVM_FrontBtn_Type : 28|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ AVM_Option : 32|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ AVM_HU_FrontViewPointOpt : 36|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ AVM_HU_RearView_Option : 40|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ AVM_HU_FrontView_Option : 44|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ AVM_Version : 48|16@1+ (1.0,0.0) [0.0|65535.0] "" CLU + +BO_ 1370 HU_AVM_PE_00: 8 CLU + SG_ HU_AVM_Status : 0|2@1+ (1.0,0.0) [0.0|3.0] "" AVM,PGS + +BO_ 1369 CGW4: 8 BCM + SG_ CF_Gway_MemoryP1Cmd : 0|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_MemoryP2Cmd : 1|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_PBackP1Cmd : 2|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_PBackP2Cmd : 3|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_StrgWhlHeatedState : 4|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_PBackStopCmd : 5|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,HUD + SG_ CF_Gway_StaticBendLhAct : 6|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_StaticBendRhAct : 7|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_DrvWdwStat : 8|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_RLWdwState : 9|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_RRWdwState : 10|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_AstWdwStat : 11|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_MemoryEnable : 12|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_PBACKStopCmd : 13|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_PBACKStop : 14|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,HUD + SG_ CF_Gway_IMSBuzzer : 15|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_DrvSeatBeltInd : 36|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,Dummy + SG_ CF_Gway_AstSeatBeltInd : 38|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Gway_RCSeatBeltInd : 40|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Gway_RLSeatBeltInd : 42|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Gway_RRSeatBeltInd : 44|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Gway_RrWiperHighSw : 46|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_RrWiperLowSw : 47|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + +BO_ 1367 EngFrzFrm12: 8 EMS + SG_ PID_06h : 0|8@1+ (0.78125,-100.0) [-100.0|99.22] "%" AAF,IBOX,TCU + SG_ PID_07h : 8|8@1+ (0.78125,-100.0) [-100.0|99.22] "%" AAF,IBOX,TCU + SG_ PID_08h : 16|8@1+ (0.78125,-100.0) [-100.0|99.22] "%" AAF,IBOX,TCU + SG_ PID_09h : 24|8@1+ (0.78125,-100.0) [-100.0|99.22] "%" AAF,IBOX,TCU + SG_ PID_0Bh : 32|8@1+ (1.0,0.0) [0.0|255.0] "kPa" AAF,IBOX,TCU + SG_ PID_23h : 40|16@1+ (10.0,0.0) [0.0|655350.0] "kPa" AAF,IBOX,TCU + +BO_ 1366 EngFrzFrm11: 8 EMS + SG_ PID_04h : 0|8@1+ (0.3921568627,0.0) [0.0|100.0] "%" AAF,TCU + SG_ PID_05h : 8|8@1+ (1.0,-40.0) [-40.0|215.0] "deg" AAF,TCU + SG_ PID_0Ch : 16|16@1+ (0.25,0.0) [0.0|16383.75] "rpm" AAF,TCU + SG_ PID_0Dh : 32|8@1+ (1.0,0.0) [0.0|255.0] "km/h" AAF,TCU + SG_ PID_11h : 40|8@1+ (0.3921568627,0.0) [0.0|100.0] "%" AAF,TCU + SG_ PID_03h : 48|16@1+ (1.0,0.0) [0.0|65535.0] "" AAF,TCU + +BO_ 1365 FPCM11: 8 FPCM + SG_ CR_Fpcm_LPActPre : 0|8@1+ (3.137254902,0.0) [0.0|800.0] "kPa" EMS + SG_ CF_Fpcm_LPPumpOverCur : 8|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_Fpcm_PreSnrHi : 9|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_Fpcm_PreSnrDisc : 10|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_Fpcm_PreSnrShort : 11|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_Fpcm_LPPumpDiscShort : 12|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_Fpcm_LP_System_Error : 13|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_Fpcm_PreSnrSigErr : 14|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_Fpcm_LPCtrCirFlt : 15|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + +BO_ 871 LVR12: 8 LVR + SG_ CF_Lvr_CruiseSet : 0|8@1+ (1.0,0.0) [0.0|255.0] "" CLU,TCU + SG_ CF_Lvr_Gear : 32|4@1+ (1.0,0.0) [0.0|15.0] "" CLU,TCU + +BO_ 872 LVR11: 8 LVR + SG_ CF_Lvr_GearInf : 0|4@1+ (1.0,0.0) [0.0|15.0] "" CLU,TCU + SG_ CF_Lvr_PRelStat : 4|1@1+ (1.0,0.0) [0.0|1.0] "" BCM,CLU,SMK,TCU + SG_ CF_Lvr_BkeAct : 5|1@1+ (1.0,0.0) [0.0|1.0] "" TCU + SG_ CF_Lvr_NFnStat : 6|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Lvr_PosInf : 8|4@1+ (1.0,0.0) [0.0|15.0] "" TCU + SG_ CF_Lvr_PosCpl : 12|4@1+ (1.0,0.0) [0.0|15.0] "" TCU + SG_ CF_Lvr_UlkButStat : 18|2@1+ (1.0,0.0) [0.0|3.0] "" TCU + SG_ CF_Lvr_PNStat : 20|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Lvr_ShtLkStat : 24|4@1+ (1.0,0.0) [0.0|15.0] "" TCU + SG_ CF_Lvr_ShfErrInf : 28|20@1+ (1.0,0.0) [0.0|8191.0] "" CLU,TCU + SG_ CF_Lvr_AC : 48|4@1+ (1.0,0.0) [0.0|15.0] "" TCU + SG_ CF_Lvr_CS : 52|4@1+ (1.0,0.0) [0.0|15.0] "" TCU + +BO_ 1363 CGW2: 8 BCM + SG_ CF_Gway_GwayDiagState : 0|1@1+ (1.0,0.0) [0.0|3.0] "" CLU,Dummy + SG_ CF_Gway_DDMDiagState : 1|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_SCMDiagState : 2|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_PSMDiagState : 3|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_SJBDiagState : 4|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_IPMDiagState : 5|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_LDMFail : 6|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,LDWS_LKAS,LDWS_LKAS + SG_ CF_Gway_CLUSwGuiCtrl : 10|3@1+ (1.0,0.0) [0.0|63.0] "" CLU,Dummy + SG_ CF_Gway_CLUSwGroup : 13|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_CLUSwMode : 14|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_CLUSwEnter : 15|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_AutoLightValue : 16|1@1+ (1.0,0.0) [0.0|1.0] "" LCA,LCA + SG_ CF_Gway_BrakeFluidSw : 17|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_DrvSeatBeltInd : 18|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Gway_AvTail : 20|1@1+ (1.0,0.0) [0.0|3.0] "" CLU,SNV,SNV + SG_ CF_Gway_RearFogAct : 21|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_ExtTailAct : 22|1@1+ (1.0,0.0) [0.0|1.0] "" AVM,CLU,LCA,PGS,SPAS,AVM,LCA,PGS,SPAS + SG_ CF_Gway_RRDrSw : 23|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_RLDrSw : 24|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_IntTailAct : 25|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_CountryCfg : 26|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU,PGS,Dummy + SG_ CF_Gway_WiperParkPosition : 32|1@1+ (1.0,0.0) [0.0|1.0] "" AFLS,EMS,LDWS_LKAS,AFLS,EMS,LDWS_LKAS + SG_ CF_Gway_HLLowLHFail : 33|1@1+ (1.0,0.0) [0.0|1.0] "" LDWS_LKAS,SNV,LDWS_LKAS,SNV + SG_ CF_Gway_HLLowRHFail : 34|1@1+ (1.0,0.0) [0.0|1.0] "" LDWS_LKAS,SNV,LDWS_LKAS,SNV + SG_ CF_Gway_ESCLFailWarn : 35|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_ESCLNotLockedWarn : 36|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_ESCLNotUnlockWarn : 37|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_IDoutWarn : 38|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_ImmoLp : 40|1@1+ (1.0,0.0) [0.0|3.0] "" CLU,Dummy + SG_ CF_Gway_BCMRKEID : 41|3@1+ (1.0,0.0) [0.0|7.0] "" CLU,Dummy + SG_ CF_Gway_VehicleNotPWarn : 44|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_DeactivationWarn : 45|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_KeyBATDischargeWarn : 46|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_SSBWarn : 47|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_SMKFobID : 48|3@1+ (1.0,0.0) [0.0|7.0] "" CLU,Dummy + SG_ CF_Gway_SMKRKECmd : 51|3@1+ (1.0,0.0) [0.0|7.0] "" CLU,Dummy + SG_ CF_Gway_AutoLightOption : 54|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_SJBDeliveryMode : 55|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_KeyoutLp : 56|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,Dummy + SG_ CF_Gway_SMKDispWarn : 57|4@1+ (1.0,0.0) [0.0|15.0] "" CLU,Dummy + SG_ CF_Gway_WngBuz : 61|3@1+ (1.0,0.0) [0.0|7.0] "" CLU,Dummy + +BO_ 339 TCS11: 8 ESC + SG_ TCS_REQ : 0|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,EMS,EPB,TCU + SG_ MSR_C_REQ : 1|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,EPB,SCC,TCU + SG_ TCS_PAS : 2|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,CLU,EMS,SCC,SPAS,TCU + SG_ TCS_GSC : 3|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,EMS,TCU + SG_ CF_Esc_LimoInfo : 4|2@1+ (1.0,0.0) [0.0|3.0] "" _4WD,SCC + SG_ ABS_DIAG : 6|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,CLU,EMS,EPB + SG_ ABS_DEF : 7|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ACU,ECS,EMS,EPB,SCC,SPAS,TCU + SG_ TCS_DEF : 8|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,EMS,EPB,SCC,SPAS,TCU + SG_ TCS_CTL : 9|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,EMS,EPB,SCC,SPAS,TCU + SG_ ABS_ACT : 10|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ACU,ECS,EMS,EPB,LDWS_LKAS,SCC,SPAS,TCU + SG_ EBD_DEF : 11|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,EMS,EPB,SPAS,TCU + SG_ ESP_PAS : 12|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ACU,CLU,EMS,EPB,LDWS_LKAS,SCC,TCU + SG_ ESP_DEF : 13|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ACU,ECS,EMS,EPB,LDWS_LKAS,SCC,TCU + SG_ ESP_CTL : 14|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ACU,ECS,EMS,EPB,LDWS_LKAS,SCC,SPAS,TCU + SG_ TCS_MFRN : 15|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,EPB,TCU + SG_ DBC_CTL : 16|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,EMS,EPB + SG_ DBC_PAS : 17|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,EMS,EPB + SG_ DBC_DEF : 18|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,EMS,EPB + SG_ HAC_CTL : 19|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,CLU,EMS,EPB,TCU + SG_ HAC_PAS : 20|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,CLU,EMS,EPB,TCU + SG_ HAC_DEF : 21|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,CLU,EMS,EPB,TCU + SG_ ESS_STAT : 22|2@1+ (1.0,0.0) [0.0|3.0] "" _4WD,BCM,CLU,EMS,EPB + SG_ TQI_TCS : 24|8@1+ (0.390625,0.0) [0.0|99.609375] "%" EMS,EPB,TCU + SG_ TQI_MSR : 32|8@1+ (0.390625,0.0) [0.0|99.609375] "%" EMS,EPB,TCU + SG_ TQI_SLW_TCS : 40|8@1+ (0.390625,0.0) [0.0|99.609375] "%" EMS,EPB,TCU + SG_ CF_Esc_BrkCtl : 48|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ BLA_CTL : 49|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CGW,CLU + SG_ AliveCounter_TCS1 : 52|4@1+ (1.0,0.0) [0.0|14.0] "" EMS,EPB,LDWS_LKAS + SG_ CheckSum_TCS1 : 56|8@1+ (1.0,0.0) [0.0|255.0] "" EMS,EPB,LDWS_LKAS + +BO_ 1362 SNV11: 4 SNV + SG_ CF_SNV_DisplayControl : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,HUD + SG_ CF_Snv_BeepWarning : 2|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,HUD + SG_ CF_Snv_WarningMessage : 4|3@1+ (1.0,0.0) [0.0|7.0] "" CLU,HUD + SG_ CF_Snv_DetectionEnable : 7|1@1+ (1.0,0.0) [0.0|1.0] "" BCM,CLU,HUD + SG_ CF_Snv_PedestrianDetect : 8|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU,HUD + SG_ CF_Snv_IRLampControl : 10|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU,HUD + +BO_ 593 MDPS12: 8 MDPS + SG_ CR_Mdps_StrColTq : 0|11@1+ (1.0,-1024.0) [-1024.0|1024.0] "" LDWS_LKAS + SG_ CF_Mdps_Def : 11|1@1+ (1.0,0.0) [0.0|1.0] "" ESC + SG_ CF_Mdps_ToiUnavail : 12|1@1+ (1.0,0.0) [0.0|1.0] "" LDWS_LKAS + SG_ CF_Mdps_ToiActive : 13|1@1+ (1.0,0.0) [0.0|1.0] "" LDWS_LKAS + SG_ CF_Mdps_ToiFlt : 14|1@1+ (1.0,0.0) [0.0|1.0] "" LDWS_LKAS + SG_ CF_Mdps_FailStat : 15|1@1+ (1.0,0.0) [0.0|1.0] "" LDWS_LKAS + SG_ CF_Mdps_MsgCount2 : 16|8@1+ (1.0,0.0) [0.0|255.0] "" ESC,LDWS_LKAS + SG_ CF_Mdps_Chksum2 : 24|8@1+ (1.0,0.0) [0.0|255.0] "" ESC,LDWS_LKAS + SG_ CF_Mdps_SErr : 37|1@1+ (1.0,0.0) [0.0|1.0] "" ESC + SG_ CR_Mdps_StrTq : 40|12@1+ (0.01,-20.48) [-20.48|20.47] "Nm" ESC + SG_ CR_Mdps_OutTq : 52|12@1+ (0.1,-204.8) [-204.8|204.7] "" ESC,LDWS_LKAS + +BO_ 1360 IAP11: 3 IAP + SG_ CF_Iap_EcoPmodSwi : 0|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Iap_EcoPmodAct : 1|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Iap_ReqWarn : 2|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + +BO_ 1356 TCU_DCT14: 8 TCU + SG_ Vehicle_Stop_Time : 0|5@1+ (1.0,0.0) [0.0|0.0] "" CLU + SG_ HILL_HOLD_WARNING : 5|1@1+ (1.0,0.0) [0.0|0.0] "" CLU + +BO_ 1353 BAT11: 8 EMS + SG_ BAT_SNSR_I : 0|16@1+ (0.01,-327.0) [-327.0|328.0] "A" CGW,CUBIS,IBOX,TMU + SG_ BAT_SOC : 16|8@1+ (1.0,0.0) [0.0|100.0] "%" CGW,CUBIS,IBOX,TMU + SG_ BAT_SNSR_V : 24|14@1+ (0.0010,6.0) [6.0|18.0] "V" CGW,CUBIS,IBOX,TMU + SG_ BAT_SNSR_Temp : 38|9@1- (0.5,-40.0) [-40.0|125.0] "deg" CGW,CUBIS,IBOX,TMU + SG_ BAT_SNSR_State : 47|1@1+ (1.0,0.0) [0.0|1.0] "" CGW,CUBIS,IBOX,TMU + SG_ BAT_SOH : 48|7@1+ (1.0,0.0) [0.0|100.0] "%" CGW,CUBIS,IBOX,TMU + SG_ BAT_SNSR_Invalid : 55|1@1+ (1.0,0.0) [0.0|1.0] "" CGW,CUBIS,IBOX,TMU + SG_ BAT_SOF : 56|7@1+ (0.1,0.0) [0.0|12.0] "V" CGW,CUBIS,IBOX,TMU + SG_ BAT_SNSR_Error : 63|1@1+ (1.0,0.0) [0.0|1.0] "" CGW,CUBIS,IBOX,TMU + +BO_ 1351 EMS15: 8 EMS + SG_ ECGPOvrd : 0|1@1+ (1.0,0.0) [0.0|1.0] "" ESC,IBOX,SCC + SG_ QECACC : 1|1@1+ (1.0,0.0) [0.0|1.0] "" ESC,IBOX + SG_ ECFail : 2|1@1+ (1.0,0.0) [0.0|1.0] "" ESC,IBOX + SG_ SwitchOffCondExt : 3|1@1+ (1.0,0.0) [0.0|1.0] "" ESC,IBOX + SG_ BLECFail : 4|1@1+ (1.0,0.0) [0.0|1.0] "" ESC,IBOX + SG_ CF_Ems_IsaAct : 5|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ FA_PV_CAN : 8|8@1+ (0.3906,0.0) [0.0|99.2] "%" IBOX,LDWS_LKAS,TCU + SG_ IntAirTemp : 16|8@1+ (0.75,-48.0) [-48.0|143.25] "deg" _4WD,ECS,EPB,IBOX,TCU + SG_ STATE_DC_OBD : 24|7@1+ (1.0,0.0) [0.0|127.0] "" IBOX,TCU + SG_ INH_DC_OBD : 31|1@1+ (1.0,0.0) [0.0|1.0] "" IBOX,TCU + SG_ CTR_IG_CYC_OBD : 32|16@1+ (1.0,0.0) [0.0|65535.0] "" ACU,IBOX,TCU + SG_ CTR_CDN_OBD : 48|16@1+ (1.0,0.0) [0.0|65535.0] "" IBOX,TCU + +BO_ 1350 DI_BOX12: 8 DI_BOX + SG_ CF_DiBox_FrtInjVDiagReg0 : 0|8@1+ (1.0,0.0) [0.0|255.0] "" EMS + SG_ CF_DiBox_FrtInjVDiagReg1 : 8|8@1+ (1.0,0.0) [0.0|255.0] "" EMS + SG_ CF_DiBox_FrtInjVDiagReg2 : 16|8@1+ (1.0,0.0) [0.0|255.0] "" EMS + SG_ CF_DiBox_SedInjVDiagReg0 : 24|8@1+ (1.0,0.0) [0.0|255.0] "" EMS + SG_ CF_DiBox_SedInjVDiagReg1 : 32|8@1+ (1.0,0.0) [0.0|255.0] "" EMS + SG_ CF_DiBox_SedInjVDiagReg2 : 40|8@1+ (1.0,0.0) [0.0|255.0] "" EMS + SG_ CR_DiBox_BatVol : 48|8@1+ (0.1,0.0) [0.0|25.5] "V" EMS + SG_ CF_DiBox_SedInjVChg : 56|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_DiBox_FrtInjVChg : 57|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_DiBox_SedInjVErrSPI : 58|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_DiBox_FrtInjVErrSPI : 59|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + +BO_ 1349 EMS14: 8 EMS + SG_ IMMO_LAMP_STAT : 0|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ L_MIL : 1|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,CUBIS,IBOX + SG_ IM_STAT : 2|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ AMP_CAN : 3|5@1+ (10.731613,458.98) [458.98|791.660003] "mmHg" CLU,IBOX,TCU,TPMS + SG_ BAT_Alt_FR_Duty : 8|8@1+ (0.4,0.0) [0.0|100.0] "%" CGW,CUBIS,IBOX,TMU + SG_ VB : 24|8@1+ (0.1015625,0.0) [0.0|25.8984375] "V" CLU,CUBIS,DATC,EPB,FPCM,IBOX + SG_ EMS_VS : 32|12@1+ (0.0625,0.0) [0.0|255.875] "km/h" CLU + SG_ TEMP_FUEL : 56|8@1+ (0.75,-48.0) [-48.0|143.25] "deg" FPCM + +BO_ 68 DATC11: 8 DATC + SG_ CF_Datc_Type : 0|8@1+ (1.0,0.0) [0.0|255.0] "" CLU + SG_ CF_Datc_VerMaj : 8|8@1+ (1.0,0.0) [0.0|255.0] "" CLU + SG_ CF_Datc_VerMin : 16|8@1+ (1.0,0.0) [0.0|255.0] "" CLU + SG_ CR_Datc_OutTempC : 24|8@1+ (0.5,-41.0) [-41.0|86.5] "deg" CLU,FPCM + SG_ CR_Datc_OutTempF : 32|8@1+ (1.0,-42.0) [-42.0|213.0] "deg" CLU + SG_ CF_Datc_IncarTemp : 40|8@1+ (0.5,-40.0) [-40.0|60.0] "deg" BCM,CLU + +BO_ 67 DATC13: 8 DATC + SG_ CF_Datc_TempDispUnit : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,IBOX + SG_ CF_Datc_ModDisp : 2|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ CF_Datc_IonClean : 6|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_ChgReqDisp : 8|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_IntakeDisp : 10|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_AutoDisp : 12|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_FrDefLed : 14|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,IBOX + SG_ CF_Datc_AutoDefogBlink : 16|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_ClmScanDisp : 18|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_AqsDisp : 20|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_AcDisp : 22|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_OpSts : 25|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ CF_Mtc_MaxAcDisp : 28|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_DualDisp : 30|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_PwrInf : 32|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ CF_Datc_RearManual : 38|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_RearAutoDisp : 40|2@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Datc_RearOffDisp : 42|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_RearClimateScnDisp : 44|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_RearChgReqDisp : 46|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_RearModDisp : 48|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ CF_Datc_RearBlwDisp : 52|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ CF_Datc_PSModDisp : 56|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ CF_Datc_FrontBlwDisp : 60|4@1+ (1.0,0.0) [0.0|15.0] "" CLU,IBOX + +BO_ 66 DATC12: 8 DATC + SG_ CR_Datc_DrTempDispC : 0|8@1+ (0.5,14.0) [15.0|32.0] "deg" CLU,IBOX + SG_ CR_Datc_DrTempDispF : 8|8@1+ (1.0,56.0) [58.0|90.0] "deg" CLU,IBOX + SG_ CR_Datc_PsTempDispC : 16|8@1+ (0.5,14.0) [15.0|32.0] "deg" CLU,IBOX + SG_ CR_Datc_PsTempDispF : 24|8@1+ (1.0,56.0) [58.0|90.0] "deg" CLU,IBOX + SG_ CR_Datc_RearDrTempDispC : 40|8@1+ (0.5,14.0) [15.0|32.0] "deg" CLU + SG_ CR_Datc_RearDrTempDispF : 48|8@1+ (1.0,58.0) [58.0|90.0] "deg" CLU + SG_ CF_Datc_CO2_Warning : 56|8@1+ (1.0,0.0) [0.0|3.0] "" CLU + +BO_ 1345 CGW1: 8 BCM + SG_ CF_Gway_IGNSw : 0|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU,ECS,EMS,EPB,ESC,IBOX,LVR,MDPS,SAS,SCC,ECS,EMS,EPB,ESC,IBOX,LVR,MDPS,SAS,SCC + SG_ CF_Gway_RKECmd : 3|3@1+ (1.0,0.0) [0.0|7.0] "" CLU,ECS,EMS,IBOX,ECS,EMS,IBOX + SG_ CF_Gway_DrvKeyLockSw : 6|1@1+ (1.0,0.0) [0.0|1.0] "" ECS,EMS,IBOX,ECS,EMS,IBOX + SG_ CF_Gway_DrvKeyUnlockSw : 7|1@1+ (1.0,0.0) [0.0|1.0] "" ECS,EMS,IBOX,ECS,EMS,IBOX + SG_ CF_Gway_DrvDrSw : 8|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,ECS,EMS,EPB,ESC,IBOX,SCC,TCU,ECS,EMS,EPB,ESC,IBOX,SCC,TCU + SG_ CF_Gway_DrvSeatBeltSw : 10|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,EPB,ESC,IBOX,PSB,TCU,EMS,EPB,ESC,IBOX,PSB,TCU + SG_ CF_Gway_TrunkTgSw : 12|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,ECS,EMS,EPB,ESC,IBOX,ECS,EMS,EPB,ESC,IBOX + SG_ CF_Gway_AstSeatBeltSw : 14|2@1+ (1.0,0.0) [0.0|3.0] "" IBOX,PSB,IBOX,PSB + SG_ CF_Gway_SMKOption : 16|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,EMS,IBOX,EMS,IBOX,SMK + SG_ CF_Gway_HoodSw : 17|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,EMS,EPB,ESC,IBOX,EMS,EPB,ESC,IBOX + SG_ CF_Gway_TurnSigLh : 19|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,EMS,IBOX,LCA,LDWS_LKAS,SCC,EMS,IBOX,LCA,LDWS_LKAS,SCC + SG_ CF_Gway_WiperIntT : 21|3@1+ (1.0,0.0) [0.0|7.0] "" CLU,EMS,IBOX,LDWS_LKAS,EMS,ESC,IBOX,LDWS_LKAS + SG_ CF_Gway_WiperIntSw : 24|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,EMS,IBOX,LDWS_LKAS,EMS,ESC,IBOX,LDWS_LKAS + SG_ CF_Gway_WiperLowSw : 25|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,EMS,IBOX,LDWS_LKAS,EMS,ESC,IBOX,LDWS_LKAS + SG_ CF_Gway_WiperHighSw : 26|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,EMS,IBOX,LDWS_LKAS,EMS,ESC,IBOX,LDWS_LKAS + SG_ CF_Gway_WiperAutoSw : 27|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,EMS,IBOX,LDWS_LKAS,EMS,ESC,IBOX,LDWS_LKAS + SG_ CF_Gway_RainSnsState : 28|3@1+ (1.0,0.0) [0.0|7.0] "" AFLS,EMS,IBOX,LDWS_LKAS,AFLS,EMS,ESC,IBOX,LDWS_LKAS + SG_ CF_Gway_HeadLampLow : 31|1@1+ (1.0,0.0) [0.0|1.0] "" AFLS,CLU,EMS,IBOX,LDWS_LKAS,SNV,AFLS,EMS,IBOX,LDWS_LKAS,SNV + SG_ CF_Gway_HeadLampHigh : 32|1@1+ (1.0,0.0) [0.0|1.0] "" AFLS,CLU,EMS,IBOX,LDWS_LKAS,AFLS,EMS,IBOX,LDWS_LKAS + SG_ CF_Gway_HazardSw : 33|2@1+ (1.0,0.0) [0.0|3.0] "" ABS,EMS,ESC,IBOX,LCA,LDWS_LKAS,ABS,EMS,ESC,IBOX,LCA,LDWS_LKAS + SG_ CF_Gway_AstDrSw : 35|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX,IBOX + SG_ CF_Gway_DefoggerRly : 36|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX,EMS,IBOX + SG_ CF_Gway_ALightStat : 37|1@1+ (1.0,0.0) [0.0|1.0] "" AFLS,IBOX,LDWS_LKAS,AFLS,IBOX,LDWS_LKAS + SG_ CF_Gway_LightSwState : 38|2@1+ (1.0,0.0) [0.0|3.0] "" AFLS,IBOX,LDWS_LKAS,AFLS,IBOX,LDWS_LKAS + SG_ CF_Gway_Frt_Fog_Act : 40|1@1+ (1.0,0.0) [0.0|1.0] "" AFLS,CLU,IBOX,LDWS_LKAS,AFLS,IBOX,LDWS_LKAS + SG_ CF_Gway_TSigRHSw : 41|1@1+ (1.0,0.0) [0.0|1.0] "" IBOX,LDWS_LKAS,IBOX,LDWS_LKAS + SG_ CF_Gway_TSigLHSw : 42|1@1+ (1.0,0.0) [0.0|1.0] "" IBOX,LDWS_LKAS,IBOX,LDWS_LKAS + SG_ CF_Gway_DriveTypeOption : 43|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX,LDWS_LKAS,IBOX,LDWS_LKAS + SG_ CF_Gway_StarterRlyState : 44|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX,EMS,IBOX,SMK + SG_ CF_Gway_PassiveAccessLock : 45|2@1+ (1.0,0.0) [0.0|7.0] "" CLU,ECS,EMS,IBOX,ECS,EMS,IBOX,SMK + SG_ CF_Gway_WiperMistSw : 47|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,EMS,IBOX,LDWS_LKAS + SG_ CF_Gway_PassiveAccessUnlock : 48|2@1+ (1.0,0.0) [0.0|7.0] "" CLU,ECS,EMS,IBOX,ECS,EMS,IBOX,SMK + SG_ CF_Gway_RrSunRoofOpenState : 50|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,DATC,IBOX + SG_ CF_Gway_PassingSW : 51|1@1+ (1.0,0.0) [0.0|1.0] "" AFLS,IBOX,LDWS_LKAS,AFLS,IBOX,LDWS_LKAS + SG_ CF_Gway_HBAControlMode : 52|1@1+ (1.0,0.0) [0.0|1.0] "" IBOX,LDWS_LKAS,IBOX,LDWS_LKAS + SG_ CF_Gway_HLpHighSw : 53|1@1+ (1.0,0.0) [0.0|1.0] "" IBOX,LDWS_LKAS,IBOX,LDWS_LKAS + SG_ CF_Gway_InhibitRMT : 54|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,EPB,ESC,IBOX,LCA,LDWS_LKAS,MDPS,PGS,SCC,SPAS,TPMS,EPB,ESC,IBOX,LCA,LDWS_LKAS,PGS,SCC,SPAS,TPMS + SG_ CF_Gway_RainSnsOption : 56|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ C_SunRoofOpenState : 57|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,DATC,IBOX,DATC,IBOX + SG_ CF_Gway_Ign1 : 58|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_Ign2 : 59|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Gway_ParkBrakeSw : 60|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,ESC,IBOX,SCC,ESC,IBOX,SCC + SG_ CF_Gway_TurnSigRh : 62|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,EMS,IBOX,LCA,LDWS_LKAS,SCC,EMS,IBOX,LCA,LDWS_LKAS,SCC + +BO_ 64 DATC14: 8 DATC + SG_ CF_Datc_AqsLevelOut : 0|4@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Datc_DiagMode : 6|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CR_Datc_SelfDiagCode : 8|8@1+ (1.0,-1.0) [0.0|254.0] "" CLU + SG_ DATC_SyncDisp : 16|4@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ DATC_OffDisp : 20|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ DATC_SmartVentDisp : 22|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ DATC_SmartVentOnOffStatus : 24|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ DATC_AutoDefogSysOff_Disp : 26|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ DATC_ADSDisp : 28|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + +BO_ 832 LKAS11: 8 LDWS_LKAS + SG_ CF_Lkas_LdwsActivemode : 0|2@1+ (1,0) [0|3] "" CLU,IBOX,PSB + SG_ CF_Lkas_LdwsSysState : 2|4@1+ (1.0,0.0) [0.0|15.0] "" CLU,IBOX,PSB + SG_ CF_Lkas_SysWarning : 6|4@1+ (1.0,0.0) [0.0|15.0] "" BCM,CLU + SG_ CF_Lkas_LdwsLHWarning : 10|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU,PSB + SG_ CF_Lkas_LdwsRHWarning : 12|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU,PSB + SG_ CF_Lkas_HbaLamp : 14|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Lkas_FcwBasReq : 15|1@1+ (1.0,0.0) [0.0|1.0] "" ABS,ESC + SG_ CR_Lkas_StrToqReq : 16|11@1+ (1.0,-1024.0) [-1024.0|1024.0] "" MDPS + SG_ CF_Lkas_ActToi : 27|1@1+ (1.0,0.0) [0.0|1.0] "" MDPS + SG_ CF_Lkas_ToiFlt : 28|1@1+ (1.0,0.0) [0.0|1.0] "" MDPS + SG_ CF_Lkas_HbaSysState : 29|3@1+ (1.0,0.0) [0.0|7.0] "" BCM,CLU + SG_ CF_Lkas_FcwOpt : 32|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Lkas_HbaOpt : 34|2@1+ (1.0,0.0) [0.0|1.0] "" BCM,CGW + SG_ CF_Lkas_MsgCount : 36|4@1+ (1.0,0.0) [0.0|15.0] "" CLU,MDPS + SG_ CF_Lkas_FcwSysState : 40|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ CF_Lkas_FcwCollisionWarning : 43|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Lkas_FusionState : 45|2@1+ (1.0,0.0) [0.0|3.0] "" SCC + SG_ CF_Lkas_Unknown1 : 47|1@1+ (1.0,0.0) [0.0|1.0] "" XXX + SG_ CF_Lkas_Chksum : 48|8@1+ (1.0,0.0) [0.0|255.0] "" MDPS + SG_ CF_Lkas_FcwOpt_USM : 56|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ CF_Lkas_LdwsOpt_USM : 59|3@1+ (1.0,0.0) [0.0|7.0] "" CLU,MDPS + SG_ CF_Lkas_Unknown2 : 62|2@1+ (1.0,0.0) [0.0|1.0] "" XXX + +BO_ 1342 LKAS12: 6 LDWS_LKAS + SG_ CF_Lkas_TsrSlifOpt : 10|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_LkasTsrStatus : 12|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Lkas_TsrSpeed_Display_Clu : 16|8@1+ (1.0,0.0) [0.0|255.0] "" CLU + SG_ CF_LkasTsrSpeed_Display_Navi : 24|8@1+ (1.0,0.0) [0.0|255.0] "" BCM,CLU + SG_ CF_Lkas_TsrAddinfo_Display : 32|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_LkasDawStatus : 40|3@1+ (1,0) [0|7] "" CLU + SG_ CF_Lkas_Daw_USM : 37|3@1+ (1,0) [0|7] "" CLU + +BO_ 1338 TMU_GW_E_01: 8 CLU + SG_ CF_Gway_TeleReqDrLock : 0|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ CF_Gway_TeleReqDrUnlock : 2|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ CF_Gway_TeleReqHazard : 4|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ CF_Gway_TeleReqHorn : 6|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ CF_Gway_TeleReqEngineOperate : 8|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + +BO_ 1078 PAS11: 4 BCM + SG_ CF_Gway_PASDisplayFLH : 0|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU,AVM + SG_ CF_Gway_PASDisplayFRH : 3|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU,AVM + SG_ CF_Gway_PASRsound : 6|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,Dummy + SG_ CF_Gway_PASDisplayFCTR : 8|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU,AVM + SG_ CF_Gway_PASDisplayRCTR : 11|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU,PGS,AVM + SG_ CF_Gway_PASFsound : 14|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,Dummy + SG_ CF_Gway_PASDisplayRLH : 16|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU,PGS,AVM + SG_ CF_Gway_PASDisplayRRH : 19|3@1+ (1.0,0.0) [0.0|7.0] "" AVM,CLU,PGS,AVM + SG_ CF_Gway_PASCheckSound : 22|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,Dummy + SG_ CF_Gway_PASSystemOn : 24|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,Dummy + SG_ CF_Gway_PASOption : 26|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Gway_PASDistance : 28|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + +BO_ 48 EMS18: 6 EMS + SG_ CF_Ems_DC1NumPerMSV : 0|8@1+ (1.0,0.0) [0.0|255.0] "" DI_BOX + SG_ CF_Ems_DC2NumPerMSV : 8|16@1+ (1.0,0.0) [0.0|65535.0] "" DI_BOX + SG_ CR_Ems_DutyCyc1MSV : 24|8@1+ (0.1953,0.0) [0.0|49.8] "%" DI_BOX + SG_ CR_Ems_DutyCyc2MSV : 32|8@1+ (0.13725,0.0) [0.0|35.0] "%" DI_BOX + SG_ CR_Ems_DutyCyc3MSV : 40|8@1+ (0.392,0.0) [0.0|100.0] "%" DI_BOX + +BO_ 1322 CLU15: 8 CLU + SG_ CF_Clu_VehicleSpeed : 0|8@1+ (1.0,0.0) [0.0|255.0] "" BCM + SG_ CF_Clu_Gear : 9|4@1+ (1,0) [0|15] "" BCM + SG_ CF_Clu_HudInfoSet : 13|7@1+ (1.0,0.0) [0.0|127.0] "" HUD + SG_ CF_Clu_HudFontColorSet : 20|2@1+ (1.0,0.0) [0.0|3.0] "" HUD + SG_ CF_Clu_HudBrightUpSW : 22|2@1+ (1.0,0.0) [0.0|3.0] "" HUD + SG_ CF_Clu_HudBrightDnSW : 24|2@1+ (1.0,0.0) [0.0|3.0] "" HUD + SG_ CF_Clu_HudHeightUpSW : 26|2@1+ (1.0,0.0) [0.0|3.0] "" HUD + SG_ CF_Clu_HudHeightDnSW : 28|2@1+ (1.0,0.0) [0.0|3.0] "" HUD + SG_ CF_Clu_HudSet : 30|1@1+ (1.0,0.0) [0.0|1.0] "" HUD + SG_ CF_Clu_HudFontSizeSet : 31|2@1+ (1.0,0.0) [0.0|3.0] "" HUD + SG_ CF_Clu_LanguageInfo : 33|5@1+ (1.0,0.0) [0.0|31.0] "" BCM,PGS + SG_ CF_Clu_ClusterSound : 38|1@1- (1.0,0.0) [0.0|0.0] "" BCM,CGW,FATC + SG_ CF_Clu_VehicleSpeed2 : 48|8@1+ (1,0) [0|255] "" XXX + +BO_ 1066 _4WD13: 6 _4WD + SG_ _4WD_CURRENT : 0|8@1+ (0.390625,0.0) [-50.0|50.0] "A" TCU + SG_ _4WD_POSITION : 8|16@1+ (0.015625,0.0) [-180.0|180.0] "Deg" TCU + SG_ _4WD_CLU_THERM_STR : 24|8@1+ (1.0,0.0) [0.0|100.0] "%" TCU + SG_ _4WD_STATUS : 32|8@1+ (1.0,0.0) [0.0|15.0] "" ESC,TCU + +BO_ 1065 _4WD12: 8 _4WD + SG_ Ster_Pos : 0|16@1+ (1.0,-600.0) [-600.0|600.0] "Deg" ESC + SG_ FRSS : 16|8@1+ (1.0,0.0) [0.0|254.0] "km/h" ESC + SG_ FLSS : 24|8@1+ (1.0,0.0) [0.0|254.0] "km/h" ESC + SG_ RRSS : 32|8@1+ (1.0,0.0) [0.0|254.0] "km/h" ESC + SG_ RLSS : 40|8@1+ (1.0,0.0) [0.0|254.0] "km/h" ESC + SG_ CLU_PRES : 48|16@1+ (0.0625,-50.0) [-50.0|50.0] "Bar" ESC + +BO_ 809 EMS12: 8 EMS + SG_ CONF_TCU m1 : 0|6@1+ (1.0,0.0) [0.0|63.0] "" _4WD,ACU,BCM,CLU,DATC,EPB,ESC,IBOX,LCA,SMK + SG_ CAN_VERS m0 : 0|6@1+ (1.0,0.0) [0.0|7.7] "" _4WD,ABS,ESC,IBOX + SG_ TQ_STND m3 : 0|6@1+ (10.0,0.0) [0.0|630.0] "Nm" _4WD,DATC,ECS,EPB,ESC,FATC,IBOX + SG_ OBD_FRF_ACK m2 : 0|6@1+ (1.0,0.0) [0.0|63.0] "" _4WD,ESC,IBOX + SG_ MUL_CODE M : 6|2@1+ (1.0,0.0) [0.0|3.0] "" _4WD,ABS,ACU,BCM,CLU,DATC,ECS,EPB,ESC,IBOX,LCA,SMK,TCU + SG_ TEMP_ENG : 8|8@1+ (0.75,-48.0) [-48.0|143.25] "deg" _4WD,BCM,CLU,DATC,EPB,ESC,IBOX,SMK,TCU + SG_ MAF_FAC_ALTI_MMV : 16|8@1+ (0.00781,0.0) [0.0|1.99155] "" IBOX,TCU + SG_ VB_OFF_ACT : 24|1@1+ (1.0,0.0) [0.0|1.0] "" IBOX,TCU + SG_ ACK_ES : 25|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ACU,IBOX + SG_ CONF_MIL_FMY : 26|3@1+ (1.0,0.0) [0.0|7.0] "" ESC,IBOX,TCU + SG_ OD_OFF_REQ : 29|1@1+ (1.0,0.0) [0.0|1.0] "" IBOX,TCU + SG_ ACC_ACT : 30|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ABS,CLU,ESC,IAP,IBOX,SCC,TCU + SG_ CLU_ACK : 31|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,EPB,ESC,IBOX + SG_ BRAKE_ACT : 32|2@1+ (1.0,0.0) [0.0|3.0] "" _4WD,ABS,ACU,AFLS,CLU,DATC,ECS,EPB,ESC,IBOX,LDWS_LKAS,TCU + SG_ ENG_CHR : 34|4@1+ (1.0,0.0) [0.0|15.0] "" _4WD,ABS,ACU,CLU,DATC,EPB,ESC,FATC,IBOX,SCC,SMK,TCU + SG_ GP_CTL : 38|2@1+ (1.0,0.0) [0.0|3.0] "" IBOX + SG_ TPS : 40|8@1+ (0.4694836,-15.0234742) [-15.0234742|104.6948357] "%" _4WD,ABS,ACU,CLU,DATC,ECS,EPB,ESC,IBOX,TCU + SG_ PV_AV_CAN : 48|8@1+ (0.3906,0.0) [0.0|99.603] "%" _4WD,AAF,ABS,ACU,AFLS,CLU,DATC,EPB,ESC,IAP,IBOX,LDWS_LKAS,SCC,TCU + SG_ ENG_VOL : 56|8@1+ (0.1,0.0) [0.0|25.5] "liter" _4WD,ABS,ACU,BCM,CLU,DATC,EPB,ESC,IBOX,LDWS_LKAS,SCC,SMK + +BO_ 1064 _4WD11: 8 _4WD + SG_ _4WD_TYPE : 0|2@1+ (1.0,0.0) [0.0|3.0] "" ACU,ESC,TPMS + SG_ _4WD_SUPPORT : 2|2@1+ (1.0,0.0) [0.0|3.0] "" ABS,ESC,TPMS + SG_ _4WD_ERR : 8|8@1+ (1.0,0.0) [0.0|255.0] "" CLU,ESC + SG_ CLU_DUTY : 16|8@1+ (1.0,0.0) [0.0|64.0] "%" ABS,ESC + SG_ R_TIRE : 24|8@1+ (1.0,200.0) [200.0|455.0] "mm" ABS,ESC,TPMS + SG_ _4WD_SW : 32|8@1+ (1.0,0.0) [0.0|9.9] "" ESC + SG_ _2H_ACT : 40|1@1+ (1.0,0.0) [0.0|1.0] "" ABS,ESC + SG_ _4H_ACT : 41|1@1+ (1.0,0.0) [0.0|1.0] "" ABS,CLU,ESC,TPMS + SG_ LOW_ACT : 42|1@1+ (1.0,0.0) [0.0|1.0] "" ABS,ESC,TCU,TPMS + SG_ AUTO_ACT : 43|1@1+ (1.0,0.0) [0.0|1.0] "" ABS,ESC,TPMS + SG_ LOCK_ACT : 44|1@1+ (1.0,0.0) [0.0|1.0] "" ABS,CLU,ESC,TPMS + SG_ _4WD_TQC_CUR : 48|16@1+ (1.0,0.0) [0.0|65535.0] "Nm" ABS,ESC + +BO_ 1319 HU_GW_E_01: 8 CLU + SG_ C_ADrLNValueSet : 0|3@1+ (1.0,0.0) [0.0|7.0] "" BCM + SG_ C_ADrUNValueSet : 4|3@1+ (1.0,0.0) [0.0|7.0] "" BCM + SG_ C_TwUnNValueSet : 8|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_ABuzzerNValueSet : 10|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_ArmWKeyNValueSet : 12|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_PSMNValueSet : 14|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_SCMNValueSet : 16|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_HLEscortNValueSet : 18|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_WELNValueSet : 20|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_TriTurnLNValueSet : 22|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_SNVWarnNValueSet : 24|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_LkasWarnNValueSet : 26|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + +BO_ 1318 HU_GW_E_00: 8 CLU + SG_ C_ADrLURValueReq : 0|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_TwUnRValueReq : 2|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_AlarmRValueReq : 4|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_IMSRValueReq : 6|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_HLEscortRValueReq : 8|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_WELRValueReq : 10|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_TriTurnLRValueReq : 12|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_SNVWarnRValueReq : 14|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ C_LkasWarnRValueReq : 16|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + +BO_ 1317 GW_HU_E_01: 8 BCM + SG_ C_ADrLRValue : 0|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ C_ADrURValue : 4|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ C_TwUnRValue : 8|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_ABuzzerRValue : 10|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_ArmWKeyRValue : 12|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_PSMRValue : 14|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_SCMRValue : 16|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_HLEscortRValue : 18|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_WELRValue : 20|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_TriTurnLRValue : 22|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + +BO_ 1316 GW_HU_E_00: 8 BCM + SG_ C_ADrLUNValueConf : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_TwUnNValueConf : 2|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_AlarmNValueConf : 4|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_PSMNValueConf : 6|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_SCMNValueConf : 8|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_HLEscortNValueConf : 10|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_WELNValueConf : 12|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_TriTurnLNValueConf : 14|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + +BO_ 1315 GW_SWRC_PE: 8 BCM + SG_ C_ModeSW : 2|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_MuteSW : 4|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_SeekDnSW : 6|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_SeekUpSW : 8|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_BTPhoneCallSW : 10|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_BTPhoneHangUpSW : 12|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_DISCDownSW : 14|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_DISCUpSW : 16|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_SdsSW : 18|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_MTSSW : 20|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_VolDnSW : 22|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_VolUpSW : 24|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + +BO_ 1314 GW_IPM_PE_1: 8 BCM + SG_ C_AV_Tail : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_ParkingBrakeSW : 2|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_RKECMD : 4|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ C_BAState : 8|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_IGNSW : 12|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ C_CountryCfg : 16|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ C_TailLampActivity : 26|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ RearSW_RSELockOnOff : 28|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_SMKTeleCrankingState : 32|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_SMKTeleCrankingFailRes : 34|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + +BO_ 1057 SCC12: 8 SCC + SG_ CF_VSM_Prefill : 0|1@1+ (1,0) [0|1] "" ESC + SG_ CF_VSM_DecCmdAct : 1|1@1+ (1,0) [0|1] "" ESC + SG_ CF_VSM_HBACmd : 2|2@1+ (1,0) [0|3] "" ESC + SG_ CF_VSM_Warn : 4|2@1+ (1,0) [0|3] "" CLU,ESC,IAP + SG_ CF_VSM_Stat : 6|2@1+ (1,0) [0|3] "" CLU,ESC,PSB + SG_ CF_VSM_BeltCmd : 8|3@1+ (1,0) [0|7] "" ESC,PSB + SG_ ACCFailInfo : 11|2@1+ (1,0) [0|3] "" CLU,CUBIS,ESC,IBOX + SG_ ACCMode : 13|2@1+ (1,0) [0|3] "" CLU,ESC,IBOX,TCU + SG_ StopReq : 15|1@1+ (1,0) [0|1] "" EPB,ESC + SG_ CR_VSM_DecCmd : 16|8@1+ (0.01,0) [0|2.55] "g" ESC + SG_ TakeOverReq : 35|1@1+ (1,0) [0|1] "" CLU,ESC,TCU + SG_ PreFill : 36|1@1+ (1,0) [0|1] "" ESC,TCU + SG_ CF_VSM_ConfMode : 48|2@1+ (1,0) [0|3] "" CLU,ESC + SG_ AEB_Failinfo : 50|2@1+ (1,0) [0|3] "" CLU,ESC + SG_ AEB_Status : 52|2@1+ (1,0) [0|3] "" CLU,ESC + SG_ AEB_CmdAct : 54|1@1+ (1,0) [0|1] "" ESC + SG_ AEB_StopReq : 55|1@1+ (1,0) [0|1] "" CLU,ESC + SG_ CR_VSM_Alive : 56|4@1+ (1,0) [0|15] "" ESC,PSB + SG_ CR_VSM_ChkSum : 60|4@1+ (1,0) [0|15] "" ESC,PSB + SG_ aReqValue : 37|11@1+ (0.01,-10.23) [-10.23|10.24] "m/s^2" Vector__XXX + SG_ aReqRaw : 24|11@1+ (0.01,-10.23) [-10.23|10.24] "m/s^2" Vector__XXX + +BO_ 1313 GW_DDM_PE: 8 BCM + SG_ C_DRVDoorStatus : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_ASTDoorStatus : 2|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_RLDoorStatus : 4|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_RRDoorStatus : 6|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_TrunkStatus : 8|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ C_OSMirrorStatus : 10|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + +BO_ 1056 SCC11: 8 SCC + SG_ MainMode_ACC : 0|1@1+ (1,0) [0|1] "" CLU,EMS,ESC + SG_ SCCInfoDisplay : 1|3@1+ (1,0) [0|7] "" CLU,ESC + SG_ AliveCounterACC : 4|4@1+ (1,0) [0|15] "" CLU,EMS,ESC,TCU + SG_ VSetDis : 8|8@1+ (1,0) [0|255] "km/h or MPH" CLU,ESC,TCU + SG_ ObjValid : 16|1@1+ (1,0) [0|1] "" CLU,ESC,TCU + SG_ DriverAlertDisplay : 17|2@1+ (1,0) [0|3] "" CLU,ESC + SG_ TauGapSet : 19|3@1+ (1,0) [0|7] "" CLU,ESC,TCU + SG_ Navi_SCC_Curve_Status : 56|2@1+ (1,0) [0|3] "" CLU + SG_ Navi_SCC_Curve_Act : 58|2@1+ (1,0) [0|3] "" CLU + SG_ Navi_SCC_Camera_Act : 60|2@1+ (1,0) [0|3] "" CLU + SG_ Navi_SCC_Camera_Status : 62|2@1+ (1,0) [0|3] "" CLU + SG_ ACC_ObjStatus : 22|2@1+ (1,0) [0|3] "" ABS,ESC + SG_ ACC_ObjLatPos : 24|9@1+ (0.1,-20) [-20|31.1] "m" ABS,ESC + SG_ ACC_ObjRelSpd : 44|12@1+ (0.1,-170) [-170|239.5] "m/s" ABS,ESC + SG_ ACC_ObjDist : 33|11@1+ (0.1,0) [0|204.7] "m" ABS,ESC + +BO_ 1312 CGW3: 8 BCM + SG_ CR_Photosensor_LH : 0|8@1+ (78.125,0.0) [0.0|20000.0] "" DATC,DATC + SG_ CR_Photosensor_RH : 10|8@1+ (78.125,0.0) [0.0|20000.0] "" DATC,DATC + SG_ CF_Hoodsw_memory : 22|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,EMS + SG_ C_MirOutTempSns : 24|8@1+ (0.5,-40.5) [-40.0|60.0] "deg" AAF,CLU,DATC,EMS,SPAS,AAF,DATC,EMS,SPAS + +BO_ 544 ESP12: 8 ESC + SG_ LAT_ACCEL : 0|11@1+ (0.01,-10.23) [-10.23|10.24] "m/s^2" _4WD,ECS,IBOX,LCA,LDWS_LKAS,MDPS,PSB,SCC,TCU + SG_ LAT_ACCEL_STAT : 11|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,IBOX,LDWS_LKAS,MDPS,PSB,SCC,TCU + SG_ LAT_ACCEL_DIAG : 12|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,IBOX,LDWS_LKAS,MDPS,PSB,SCC,TCU + SG_ LONG_ACCEL : 13|11@1+ (0.01,-10.23) [-10.23|10.24] "m/s^2" _4WD,ECS,EMS,EPB,IBOX,LCA,LDWS_LKAS,PSB,SCC,SPAS,TCU + SG_ LONG_ACCEL_STAT : 24|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,EMS,EPB,IBOX,LDWS_LKAS,PSB,SCC,SPAS,TCU + SG_ LONG_ACCEL_DIAG : 25|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,EMS,EPB,IBOX,LDWS_LKAS,PSB,SCC,SPAS,TCU + SG_ CYL_PRES : 26|12@1+ (0.1,0.0) [0.0|409.5] "Bar" _4WD,ECS,EMS,EPB,IBOX,LDWS_LKAS,PSB,SCC,TCU + SG_ CYL_PRES_STAT : 38|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ECS,EMS,EPB,IBOX,LDWS_LKAS,PSB,SCC,TCU + SG_ CYL_PRESS_DIAG : 39|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ECS,EMS,EPB,IBOX,PSB,SCC,TCU + SG_ YAW_RATE : 40|13@1+ (0.01,-40.95) [-40.95|40.96] "" _4WD,AFLS,IBOX,LCA,LDWS_LKAS,MDPS,PSB,SCC,SPAS,TCU + SG_ YAW_RATE_STAT : 53|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,AFLS,IBOX,LCA,LDWS_LKAS,MDPS,PSB,SCC,SPAS,TCU + SG_ YAW_RATE_DIAG : 54|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,AFLS,IBOX,LCA,LDWS_LKAS,MDPS,PSB,SCC,SPAS,TCU + SG_ ESP12_Checksum : 56|4@1+ (1.0,0.0) [0.0|15.0] "" _4WD,EMS,LPI,TCU,TMU + SG_ ESP12_AliveCounter : 60|4@1+ (1.0,0.0) [0.0|15.0] "" _4WD,EMS,LPI,TCU,TMU + +BO_ 1307 CLU16: 8 CLU + SG_ CF_Clu_TirePressUnitNValueSet : 0|3@1+ (1.0,0.0) [0.0|7.0] "" TPMS + SG_ CF_Clu_SlifNValueSet : 3|2@1+ (1.0,0.0) [0.0|3.0] "" LDWS_LKAS + SG_ CF_Clu_RearWiperNValueSet : 12|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + +BO_ 790 EMS11: 8 EMS + SG_ SWI_IGK : 0|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ABS,ACU,AHLS,CUBIS,DI_BOX,ECS,EPB,ESC,IBOX,LDWS_LKAS,MDPS,REA,SAS,SCC,TCU + SG_ F_N_ENG : 1|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ACU,AFLS,CLU,CUBIS,DATC,ECS,EPB,ESC,IBOX,MDPS,SCC,TCU + SG_ ACK_TCS : 2|1@1+ (1.0,0.0) [0.0|1.0] "" ESC,IBOX + SG_ PUC_STAT : 3|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,CLU,DATC,IBOX,TCU + SG_ TQ_COR_STAT : 4|2@1+ (1.0,0.0) [0.0|3.0] "" _4WD,ESC,IBOX,TCU + SG_ RLY_AC : 6|1@1+ (1.0,0.0) [0.0|1.0] "" DATC,IBOX,TCU + SG_ F_SUB_TQI : 7|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ECS,EPB,ESC,IBOX,TCU + SG_ TQI_ACOR : 8|8@1+ (0.390625,0.0) [0.0|99.6094] "%" _4WD,EPB,ESC,IBOX,TCU + SG_ N : 16|16@1+ (0.25,0.0) [0.0|16383.75] "rpm" _4WD,ACU,AFLS,CLU,CUBIS,DATC,ECS,EPB,ESC,FPCM,IBOX,MDPS,SCC,TCU + SG_ TQI : 32|8@1+ (0.390625,0.0) [0.0|99.6094] "%" _4WD,ECS,EPB,ESC,IBOX,TCU + SG_ TQFR : 40|8@1+ (0.390625,0.0) [0.0|99.6094] "%" _4WD,EPB,ESC,IBOX,TCU + SG_ VS : 48|8@1+ (1.0,0.0) [0.0|254.0] "km/h" _4WD,AAF,ACU,AHLS,BCM,CLU,DATC,ECS,EPB,IBOX,LCA,LDWS_LKAS,LVR,MDPS,ODS,SCC,SMK,SPAS,TCU,TPMS + SG_ RATIO_TQI_BAS_MAX_STND : 56|8@1+ (0.0078,0.0) [0.0|2.0] "" _4WD,IBOX,TCU + +BO_ 1301 CLU14: 8 CLU + SG_ CF_Clu_ADrUNValueSet : 0|3@1+ (1.0,0.0) [0.0|7.0] "" BCM + SG_ CF_Clu_ADrLNValueSet : 3|3@1+ (1.0,0.0) [0.0|7.0] "" BCM + SG_ CF_Clu_EscortHLNValueSet : 6|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ CF_Clu_DoorLSNValueSet : 8|3@1+ (1.0,0.0) [0.0|7.0] "" BCM + SG_ CF_Clu_PSMNValueSet : 11|3@1+ (1.0,0.0) [0.0|7.0] "" BCM + SG_ CF_Clu_TTUnlockNValueSet : 14|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ CF_Clu_PTGMNValueSet : 16|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ CF_Clu_SCMNValueSet : 18|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ CF_Clu_WlightNValueSet : 20|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ CF_Clu_TempUnitNValueSet : 22|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,DATC + SG_ CF_Clu_MoodLpNValueSet : 24|3@1+ (1.0,0.0) [0.0|7.0] "" BCM + SG_ CF_Clu_TrfChgSet : 27|2@1+ (1.0,0.0) [0.0|3.0] "" AFLS + SG_ CF_Clu_OTTurnNValueSet : 29|3@1+ (1.0,0.0) [0.0|7.0] "" BCM + SG_ CF_Clu_LcaNValueSet : 32|2@1+ (1.0,0.0) [0.0|3.0] "" LCA + SG_ CF_Clu_RctaNValueSet : 34|2@1+ (1.0,0.0) [0.0|3.0] "" LCA + SG_ CF_Clu_RcwNValueSet : 36|2@1+ (1.0,0.0) [0.0|3.0] "" LCA + SG_ CF_Clu_EscOffNValueSet : 38|3@1+ (1.0,0.0) [0.0|7.0] "" ESC + SG_ CF_Clu_SccNaviCrvNValueSet : 41|2@1+ (1.0,0.0) [0.0|3.0] "" SCC + SG_ CF_Clu_SccNaviCamNValueSet : 43|2@1+ (1.0,0.0) [0.0|3.0] "" SCC + SG_ CF_Clu_SccAebNValueSet : 45|2@1+ (1.0,0.0) [0.0|3.0] "" SCC + SG_ CF_Clu_LkasModeNValueSet : 47|2@1+ (1.0,0.0) [0.0|3.0] "" LDWS_LKAS + SG_ CF_Clu_FcwNValueSet : 51|2@1+ (1.0,0.0) [0.0|3.0] "" LDWS_LKAS + SG_ CF_Clu_PasSpkrLvNValueSet : 53|3@1+ (1.0,0.0) [0.0|7.0] "" BCM + SG_ CF_Clu_SccDrvModeNValueSet : 56|3@1+ (1.0,0.0) [0.0|7.0] "" SCC + SG_ CF_Clu_HAnBNValueSet : 59|2@1+ (1.0,0.0) [0.0|3.0] "" BCM + SG_ CF_Clu_HfreeTrunkTgNValueSet : 61|3@1+ (1.0,0.0) [0.0|7.0] "" BCM + +BO_ 275 TCU13: 8 TCU + SG_ N_TGT_LUP : 0|8@1+ (10.0,500.0) [500.0|3040.0] "rpm" EMS,IBOX + SG_ SLOPE_TCU : 8|6@1+ (0.5,-16.0) [-16.0|15.5] "%" CLU,CUBIS,EMS,IBOX + SG_ CF_Tcu_InhCda : 14|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ CF_Tcu_IsgInhib : 15|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ CF_Tcu_BkeOnReq : 16|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,IBOX + SG_ CF_Tcu_NCStat : 18|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,IBOX + SG_ CF_Tcu_TarGr : 20|4@1+ (1.0,0.0) [0.0|15.0] "" _4WD,CLU,DATC,EMS,EPB,ESC,IBOX,SCC + SG_ CF_Tcu_ShfPatt : 24|4@1+ (1.0,0.0) [0.0|15.0] "" CLU,CUBIS,EMS,IBOX + SG_ CF_Tcu_InhVis : 28|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ CF_Tcu_PRelReq : 29|1@1+ (1.0,0.0) [0.0|1.0] "" IBOX,LVR + SG_ CF_Tcu_ITPhase : 30|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ CF_Tcu_ActEcoRdy : 31|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ CF_Tcu_TqGrdLim : 32|8@1+ (10.0,0.0) [0.0|2540.0] "Nm/s" EMS,IBOX + SG_ CR_Tcu_IsgTgtRPM : 40|8@1+ (20.0,0.0) [0.0|3500.0] "rpm" EMS,IBOX + SG_ CF_Tcu_SptRdy : 48|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,IBOX + SG_ CF_Tcu_SbwPInfo : 56|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ CF_Tcu_Alive3 : 58|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,IBOX + SG_ CF_Tcu_ChkSum3 : 60|4@1+ (1.0,0.0) [0.0|15.0] "" EMS,IBOX + +BO_ 274 TCU12: 8 TCU + SG_ ETL_TCU : 0|8@1+ (2.0,0.0) [0.0|508.0] "Nm" EMS,IBOX + SG_ CUR_GR : 8|4@1+ (1.0,0.0) [0.0|15.0] "" _4WD,EMS,ESC,IBOX,SCC,TPMS + SG_ CF_Tcu_Alive : 12|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,ESC,IBOX,SCC + SG_ CF_Tcu_ChkSum : 14|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,ESC,IBOX,SCC + SG_ VS_TCU : 16|8@1+ (1.0,0.0) [0.0|254.0] "km/h" BCM,CLU,DATC,EMS,IBOX,LCA,LVR,PGS,SMK,SNV + SG_ FUEL_CUT_TCU : 28|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ INH_FUEL_CUT : 29|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ IDLE_UP_TCU : 30|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ N_INC_TCU : 31|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,IBOX + SG_ SPK_RTD_TCU : 32|8@1+ (0.375,-23.625) [-15.0|15.0] "" EMS,IBOX + SG_ N_TC_RAW : 40|16@1+ (0.25,0.0) [0.0|16383.5] "rpm" EMS,IBOX + SG_ VS_TCU_DECIMAL : 56|8@1+ (0.0078125,0.0) [0.0|0.9921875] "km/h" CLU,EMS,IBOX,LCA + +BO_ 273 TCU11: 8 TCU + SG_ TQI_TCU_INC : 0|8@1+ (0.390625,0.0) [0.0|99.609375] "%" EMS,ESC,IBOX + SG_ G_SEL_DISP : 8|4@1+ (1.0,0.0) [0.0|15.0] "" _4WD,AFLS,AVM,BCM,CGW,CLU,CUBIS,ECS,EMS,EPB,ESC,IAP,IBOX,LCA,LDWS_LKAS,LVR,MDPS,PGS,SCC,SMK,SNV,SPAS,TPMS + SG_ F_TCU : 12|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,ESC,IBOX + SG_ TCU_TYPE : 14|2@1+ (1.0,0.0) [0.0|3.0] "" _4WD,EMS,ESC,IBOX + SG_ TCU_OBD : 16|3@1+ (1.0,0.0) [0.0|7.0] "" EMS,ESC,IBOX + SG_ SWI_GS : 19|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,EMS,EPB,ESC,IBOX,SCC + SG_ GEAR_TYPE : 20|4@1+ (1.0,0.0) [0.0|15.0] "" _4WD,CLU,EMS,ESC,IBOX,SCC + SG_ TQI_TCU : 24|8@1+ (0.390625,0.0) [0.0|99.609375] "%" EMS,ESC,IBOX + SG_ TEMP_AT : 32|8@1+ (1.0,-40.0) [-40.0|214.0] "deg" AAF,CLU,CUBIS,EMS,ESC,IBOX + SG_ N_TC : 40|16@1+ (0.25,0.0) [0.0|16383.5] "rpm" _4WD,EMS,EPB,ESC,IBOX + SG_ SWI_CC : 56|2@1+ (1.0,0.0) [0.0|3.0] "" _4WD,CLU,EMS,ESC,IBOX + SG_ CF_Tcu_Alive1 : 58|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,IBOX + SG_ CF_Tcu_ChkSum1 : 60|4@1+ (1.0,0.0) [0.0|15.0] "" EMS,IBOX + +BO_ 16 ACU13: 8 ACU + SG_ CF_Acu_CshAct : 0|1@1+ (1.0,0.0) [0.0|1.0] "" CUBIS,IBOX,ODS + +BO_ 1040 CGW_USM1: 8 BCM + SG_ CF_Gway_ATTurnRValue : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Gway_PTGMRValue : 2|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Gway_EscortHLRValue : 4|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Gway_TTUnlockRValue : 6|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Gway_ADrLRValue : 8|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ CF_Gway_ADrURValue : 11|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ CF_Gway_SCMRValue : 14|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Gway_WlightRValue : 16|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Gway_PSMRValue : 18|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ CF_Gway_OTTurnRValue : 21|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ CF_Gway_DrLockSoundRValue : 24|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ CF_Gway_HAnBRValue : 27|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ CF_Gway_MoodLpRValue : 30|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Gway_HfreeTrunkRValue : 32|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ CF_Gway_AutoLightRValue : 35|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ CF_Gway_RearWiperRValue : 38|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_Gway_PasSpkrLvRValue : 40|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + +BO_ 1292 CLU13: 8 CLU + SG_ CF_Clu_LowfuelWarn : 0|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,FPCM,IBOX + SG_ CF_Clu_RefDetMod : 2|1@1+ (1.0,0.0) [0.0|1.0] "" IBOX + SG_ CF_Clu_AvgFCU : 3|2@1+ (1.0,0.0) [0.0|3.0] "" IBOX + SG_ CF_Clu_AvsmCur : 5|1@1+ (1.0,0.0) [0.0|1.0] "" ESC,SCC + SG_ CF_Clu_AvgFCI : 6|10@1+ (0.1,0.0) [0.0|102.2] "" IBOX + SG_ CF_Clu_DrivingModeSwi : 16|2@1+ (1.0,0.0) [0.0|3.0] "" DATC,ECS,EMS,ESC,IAP,MDPS,TCU + SG_ CF_Clu_FuelDispLvl : 18|5@1+ (1.0,0.0) [0.0|31.0] "" CGW,IBOX + SG_ CF_Clu_FlexSteerSW : 23|1@1+ (1.0,0.0) [0.0|1.0] "" MDPS + SG_ CF_Clu_DTE : 24|10@1+ (1.0,0.0) [0.0|1023.0] "" DATC + SG_ CF_Clu_TripUnit : 34|2@1+ (1.0,0.0) [0.0|3.0] "" DATC + SG_ CF_Clu_SWL_Stat : 36|3@1+ (1.0,0.0) [0.0|7.0] "" ACU,EMS + SG_ CF_Clu_ActiveEcoSW : 39|1@1+ (1.0,0.0) [0.0|1.0] "" DATC,EMS,TCU + SG_ CF_Clu_EcoDriveInf : 40|3@1+ (1.0,0.0) [0.0|7.0] "" CUBIS,EMS,IAP,IBOX + SG_ CF_Clu_IsaMainSW : 43|1@1+ (1.0,0.0) [0.0|1.0] "" EMS + SG_ CF_Clu_LdwsLkasSW : 56|1@1+ (1.0,0.0) [0.0|1.0] "" LDWS_LKAS + SG_ CF_Clu_AltLStatus : 59|1@1+ (1.0,0.0) [0.0|1.0] "" BCM,DATC,EMS + SG_ CF_Clu_AliveCnt2 : 60|4@1+ (1.0,0.0) [0.0|15.0] "" EMS,LDWS_LKAS + +BO_ 1290 SCC13: 8 SCC + SG_ SCCDrvModeRValue : 0|3@1+ (1,0) [0|7] "" CLU + SG_ SCC_Equip : 3|1@1+ (1,0) [0|1] "" ESC + SG_ AebDrvSetStatus : 4|3@1+ (1,0) [0|7] "" CLU,ESC + SG_ Lead_Veh_Dep_Alert_USM : 13|2@0+ (1,0) [0|3] "" XXX + +BO_ 1287 TCS15: 4 ESC + SG_ ABS_W_LAMP : 0|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,CLU,CUBIS,IBOX + SG_ TCS_OFF_LAMP : 1|2@1+ (1.0,0.0) [0.0|1.0] "" _4WD,ACU,CLU + SG_ TCS_LAMP : 3|2@1+ (1.0,0.0) [0.0|3.0] "" _4WD,ACU,CLU,CUBIS,IBOX,SCC + SG_ DBC_W_LAMP : 5|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,CLU + SG_ DBC_F_LAMP : 6|2@1+ (1.0,0.0) [0.0|3.0] "" _4WD,CLU + SG_ ESC_Off_Step : 8|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ AVH_CLU : 16|8@1+ (1.0,0.0) [0.0|255.0] "" CLU,EPB + SG_ AVH_I_LAMP : 24|2@1+ (1.0,0.0) [0.0|3.0] "" EPB + SG_ EBD_W_LAMP : 26|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,CLU + SG_ AVH_ALARM : 27|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ AVH_LAMP : 29|3@1+ (1.0,0.0) [0.0|7.0] "" CLU,EPB,SPAS + +BO_ 1282 TCU14: 4 TCU + SG_ CF_TCU_WarnMsg : 0|3@1+ (1.0,0.0) [0.0|7.0] "" CLU + SG_ CF_TCU_WarnImg : 3|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_TCU_WarnSnd : 4|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ CF_Tcu_GSel_BlinkReq : 5|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,LVR + SG_ CF_Tcu_StRelStat : 12|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,EMS,ESC + SG_ CF_Tcu_DriWarn1 : 13|3@1+ (1.0,0.0) [0.0|7.0] "" CLU,EMS,ESC + SG_ CF_Tcu_DriWarn2 : 16|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,EMS,ESC + +BO_ 1281 ECS11: 3 ECS + SG_ ECS_W_LAMP : 0|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,CUBIS,IBOX + SG_ SYS_NA : 1|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ ECS_DEF : 2|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ ECS_DIAG : 3|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ L_CHG_NA : 4|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ Leveling_Off : 5|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ LC_overheat : 6|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ Lifting : 8|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ Lowering : 9|1@1+ (1.0,0.0) [0.0|1.0] "" CLU + SG_ Damping_Mode : 10|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ REQ_Damping : 12|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ REQ_Height : 14|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ REQ_level : 16|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + SG_ ACT_Height : 20|4@1+ (1.0,0.0) [0.0|15.0] "" CLU + +BO_ 1024 CLU_CFG11: 2 CLU + SG_ Vehicle_Type : 0|16@1+ (1.0,0.0) [0.0|65536.0] "" _4WD + +BO_ 1280 ACU14: 1 ACU + SG_ CF_SWL_Ind : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_TTL_Ind : 2|2@1+ (1.0,0.0) [0.0|3.0] "" CLU + SG_ CF_SBR_Ind : 4|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU + +BO_ 512 EMS20: 6 EMS + SG_ FCO : 0|16@1+ (0.128,0.0) [0.0|8388.48] "ul" CLU,CUBIS,FPCM,IBOX + SG_ CF_Ems_PumpTPres : 16|8@1+ (3.137254902,0.0) [0.0|800.0] "kPa" FPCM,IBOX + SG_ Split_Stat : 32|1@1+ (1.0,0.0) [0.0|1.0] "" FPCM + +BO_ 909 FCA11: 8 FCA + SG_ CF_VSM_Prefill : 0|1@1+ (1,0) [0|1] "" ESC + SG_ CF_VSM_HBACmd : 1|2@1+ (1,0) [0|3] "" ESC + SG_ CF_VSM_Warn : 3|2@1+ (1,0) [0|3] "" ACU,CLU,ESC + SG_ CF_VSM_BeltCmd : 5|3@1+ (1,0) [0|7] "" ESC + SG_ CR_VSM_DecCmd : 8|8@1+ (0.01,0) [0|2.55] "g" ESC + SG_ FCA_Status : 18|2@1+ (1,0) [0|3] "" ACU,CLU,ESC + SG_ FCA_CmdAct : 20|1@1+ (1,0) [0|1] "" ESC + SG_ FCA_StopReq : 21|1@1+ (1,0) [0|1] "" CLU,ESC + SG_ FCA_DrvSetStatus : 22|3@1+ (1,0) [0|7] "" CLU,ESC + SG_ CF_VSM_DecCmdAct : 31|1@1+ (1,0) [0|1] "" ESC + SG_ FCA_Failinfo : 32|3@1+ (1,0) [0|7] "" ACU,CLU,ESC + SG_ FCA_RelativeVelocity : 39|9@1+ (0.1,-25.5) [-25.5|25.5] "m/s" iBAU + SG_ FCA_TimetoCollision : 48|8@1+ (10,0) [0|2540] "ms" iBAU + SG_ CR_FCA_Alive : 56|4@1+ (1,0) [0|15] "" ESC + SG_ CR_FCA_ChkSum : 60|4@1+ (1,0) [0|15] "" ESC + SG_ Supplemental_Counter : 35|4@1+ (1,0) [0|15] "" XXX + SG_ PAINT1_Status : 16|2@1+ (1,0) [0|1] "" XXX + +BO_ 1156 HDA11_MFC: 8 XXX + SG_ Counter : 5|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1 : 1|2@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_2 : 7|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 16|2@1+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_5 : 18|14@1+ (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_6 : 33|2@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_7 : 34|14@1+ (1,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_8 : 49|2@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_9 : 50|14@1- (1,-4095) [0|16383] "" XXX + +BO_ 1155 FCA12: 8 FCA + SG_ FCA_USM : 0|3@1+ (1,0) [0|7] "" CGW,CLU,ESC + SG_ FCA_DrvSetState : 3|3@1+ (1,0) [0|7] "" CGW + +BO_ 1186 FRT_RADAR11: 2 FCA + SG_ CF_FCA_Equip_Front_Radar : 0|3@1+ (1,0) [0|7] "" LDWS_LKAS,LDW_LKA,ESC + +BO_ 905 SCC14: 8 SCC + SG_ ComfortBandUpper : 0|6@1+ (0.02,0) [0|1.26] "m/s^2" ESC + SG_ ComfortBandLower : 6|6@1+ (0.02,0) [0|1.26] "m/s^2" ESC + SG_ JerkUpperLimit : 12|7@1+ (0.1,0) [0|12.7] "m/s^3" ESC + SG_ JerkLowerLimit : 19|7@1+ (0.1,0) [0|12.7] "m/s^3" ESC + SG_ ACCMode : 32|3@1+ (1,0) [0|7] "" CLU,HUD,LDWS_LKAS,ESC + SG_ ObjGap : 56|8@1+ (1,0) [0|255] "" CLU,HUD,ESC + +BO_ 1157 LFAHDA_MFC: 4 XXX + SG_ HDA_USM : 0|2@1+ (1,0) [0|3] "" XXX + SG_ HDA_Active : 2|1@1+ (1,0) [0|1] "" XXX + SG_ HDA_Icon_State : 3|2@1+ (1,0) [0|3] "" XXX + SG_ HDA_Chime : 7|1@1+ (1,0) [0|1] "" XXX + SG_ HDA_VSetReq : 8|8@1+ (1,0) [0|255] "km/h" XXX + SG_ LFA_SysWarning : 16|3@1+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_1 : 20|3@1+ (1,0) [0|7] "" XXX + SG_ LFA_Icon_State : 24|2@1+ (1,0) [0|3] "" XXX + SG_ LFA_USM : 27|2@1+ (1,0) [0|3] "" XXX + SG_ HDA_SysWarning : 29|2@1+ (1,0) [0|3] "" XXX + +BO_ 913 BCM_PO_11: 8 Vector__XXX + SG_ BCM_Door_Dri_Status : 5|1@0+ (1,0) [0|1] "" PT_ESC_ABS + SG_ BCM_Shift_R_MT_SW_Status : 39|2@0+ (1,0) [0|3] "" PT_ESC_ABS + SG_ LFA_Pressed : 4|1@0+ (1,0) [0|1] "" XXX + +BO_ 1426 LABEL11: 8 XXX + SG_ CC_React : 34|1@1+ (1,0) [0|1] "" XXX + +BO_ 910 WHL_SPD12_FS: 5 iBAU + SG_ CRC : 0|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ WHL_SPD12_AliveCounter : 8|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ WHL_SPD_FL : 12|14@1+ (0.03125,0) [0|511.96875] "km/h" Vector__XXX + SG_ WHL_SPD_FR : 26|14@1+ (0.03125,0) [0|511.96875] "km/h" Vector__XXX + +BO_ 911 WHL_SPD13_FS: 5 iBAU + SG_ CRC : 0|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ WHL_SPD13_AliveCounter : 8|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ WHL_SPD_RL : 12|14@1+ (0.03125,0) [0|511.96875] "km/h" Vector__XXX + SG_ WHL_SPD_RR : 26|14@1+ (0.03125,0) [0|511.96875] "km/h" Vector__XXX + +BO_ 865 ADAS_PRK_11: 8 ADAS_PRK + SG_ CF_PCA_BrkReq : 24|1@1+ (1,0) [0|0] "" Vector__XXX + SG_ CF_PCA_DclTrgtVal : 28|4@1+ (0.04,0) [0|0] "g" Vector__XXX + SG_ PCA_ALIVE_CNT : 40|4@1+ (1,0) [0|0] "" Vector__XXX + SG_ PCA_CHECK_SUM : 48|8@1+ (1,0) [0|0] "" Vector__XXX + +BO_ 882 ELECT_GEAR: 8 XXX + SG_ Elect_Gear_Shifter : 16|4@1+ (1,0) [0|7] "" CLU + +BO_ 881 E_EMS11: 8 XXX + SG_ Brake_Pedal_Pos : 0|8@1+ (1,0) [0|127] "" XXX + SG_ IG_Reactive_Stat : 8|3@1+ (1,0) [0|3] "" XXX + SG_ Gear_Change : 12|1@0+ (1,0) [0|31] "" XXX + SG_ Cruise_Limit_Status : 13|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Limit_Target : 23|8@1+ (1,0) [0|15] "" XXX + SG_ Accel_Pedal_Pos : 31|8@1+ (1,0) [0|254] "" XXX + SG_ CR_Vcu_AccPedDep_Pos : 56|8@1+ (1,0) [0|254] "" XXX + +BO_ 1355 EV_PC6: 8 CGW + SG_ CF_Vcu_SbwWarnMsg : 16|3@1+ (1,0) [0|7] "" Vector__XXX + +BO_ 1430 EV_PC2: 8 CGW + SG_ CR_Ldc_ActVol_LS_V : 32|8@1+ (0.1,0) [0|0] "V" Vector__XXX + +BO_ 1535 EV_PC10: 8 CGW + SG_ CF_Vcu_EpbRequest : 37|1@1+ (1,0) [0|0] "" Vector__XXX + +BO_ 908 RSPA11: 8 RSPA + SG_ CF_RSPA_State : 0|4@1+ (1,0) [0|15] "" XXX + SG_ CF_RSPA_Act : 4|2@1+ (1,0) [0|3] "" XXX + SG_ CF_RSPA_DecCmd : 6|2@1+ (1,0) [0|3] "" XXX + SG_ CF_RSPA_Trgt_Spd : 8|10@1+ (0.01,0) [0|10.23] "km/h" XXX + SG_ CF_RSPA_StopReq : 18|1@1+ (1,0) [0|2] "" XXX + SG_ CR_RSPA_EPB_Req : 22|2@1+ (1,0) [0|3] "" XXX + SG_ CF_RSPA_ACC_ACT : 50|1@1+ (1,0) [0|2] "" XXX + SG_ CF_RSPA_AliveCounter : 52|4@1+ (1,0) [0|15] "" XXX + SG_ CF_RSPA_CRC : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 914 S_MDPS11: 8 XXX + SG_ CF_Mdps_Stat : 0|4@1+ (1,0) [0|15] "" XXX + SG_ CR_Mdps_DrvTq : 8|12@1+ (1,0) [0|15] "" XXX + SG_ CR_Mdps_StrAng : 24|16@1- (1,0) [0|65535] "" XXX + SG_ CF_Mdps_AliveCnt : 47|8@0+ (1,0) [0|255] "" XXX + SG_ CF_Mdps_Chksum : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 357 S_MDPS12: 8 XXX + SG_ NEW_SIGNAL_1 : 0|12@1+ (1,0) [0|4095] "" XXX + SG_ NEW_SIGNAL_2 : 12|12@1+ (1,0) [0|4095] "" XXX + SG_ Counter : 48|4@1+ (1,0) [0|15] "" XXX + SG_ Checksum : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 352 AHB1: 8 iBAU + SG_ CF_Ahb_SLmp : 0|2@1+ (1,0) [0|3] "" CLU + SG_ CF_Ahb_Def : 2|2@1+ (1,0) [0|3] "" CGW + SG_ CF_Ahb_Act : 4|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ CF_Ahb_Diag : 6|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ CF_Ahb_WLmp : 7|1@1+ (1,0) [0|1] "" CLU + SG_ CR_Ahb_StDep_mm : 8|16@1- (0.1,0) [-3276.8|3276.7] "mm" Vector__XXX + SG_ CF_Ahb_SnsFail : 24|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ CF_Ahb_PedalCalStat : 25|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ CF_Ahb_Bzzr : 26|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ CF_Ahb_ChkSum : 56|8@1+ (1,0) [0|255] "" Vector__XXX + +BO_ 1191 MFC_4a7: 8 XXX + SG_ PAINT1 : 0|1@0+ (1,0) [0|1] "" XXX + +BO_ 1162 BCA11: 8 BCW + SG_ CF_BCA_State : 16|3@1+ (1,0) [0|7] "" CLU,iBAU + SG_ CF_BCA_Warning : 19|2@1+ (1,0) [0|3] "" CLU,iBAU + SG_ AliveCounter : 21|4@1+ (1,0) [0|15] "" CLU,iBAU + SG_ RCCA_Brake_Command : 29|1@1+ (1,0) [0|1] "" iBAU + SG_ Check_Sum : 56|8@1+ (1,0) [0|16] "" iBAU + +BO_ 1136 P_STS: 8 CGW + SG_ HCU1_STS : 6|2@1+ (1,0) [0|3] "" BCW,EPB,FCA,MDPS,SCC,iBAU + SG_ HCU5_STS : 8|2@1+ (1,0) [0|3] "" EPB,FCA,MDPS,iBAU + SG_ Counter : 58|4@1+ (1,0) [0|15] "" MDPS + SG_ Checksum : 62|2@1+ (1,0) [0|3] "" MDPS + +BO_ 304 YRS11: 8 ACU + SG_ CR_Yrs_Yr : 0|16@1+ (0.005,-163.84) [-163.84|163.83] "deg/s" CGW,iBAU + SG_ CR_Yrs_LatAc : 16|16@1+ (0.000127465,-4.17677312) [-4.17677312|4.17651819] "g" iBAU + SG_ CF_Yrs_YrStat : 32|4@1+ (1,0) [0|15] "" iBAU + SG_ CF_Yrs_LatAcStat : 36|4@1+ (1,0) [0|15] "" iBAU + SG_ CF_Yrs_MCUStat : 40|4@1+ (1,0) [0|15] "" iBAU + SG_ CR_Yrs_MsgCnt1 : 48|4@1+ (1,0) [0|15] "" iBAU + SG_ CR_Yrs_Crc1 : 56|8@1+ (1,0) [0|255] "" iBAU + +BO_ 320 YRS12: 8 ACU + SG_ CF_Yrs_LongAcStat : 16|4@1+ (1,0) [0|15] "" iBAU + SG_ CF_IMU_ResetStat : 20|4@1+ (1,0) [0|15] "" iBAU + SG_ YRS_Temp : 24|8@1+ (1,-68) [-68|187] "" iBAU + SG_ YRS_TempStat : 32|4@1+ (1,0) [0|15] "" iBAU + SG_ CF_Yrs_Type : 36|4@1+ (1,0) [0|15] "" iBAU + SG_ CR_Yrs_MsgCnt2 : 48|4@1+ (1,0) [0|15] "" iBAU + SG_ CR_Yrs_Crc2 : 56|8@1+ (1,0) [0|255] "" iBAU + SG_ CR_Yrs_LongAc : 0|16@1+ (0.000127465,-4.17677312) [-4.17677312|4.17651819] "g" CGW,iBAU + +BO_ 1173 YRS13: 8 ACU + SG_ YRS_SeralNo : 16|48@1+ (1,0) [0|281474976710655] "" iBAU + +BO_ 870 EMS_366: 8 EMS + SG_ TQI_1 : 0|8@1+ (0.390625,0) [0|99.6094] "%" MDPS + SG_ N : 8|16@1+ (0.25,0.0) [0.0|16383.75] "rpm" MDPS + SG_ TQI_2 : 24|8@1+ (0.390625,0) [0|99.6094] "%" MDPS + SG_ VS : 40|8@1+ (1,0) [0|255] "km/h" MDPS + SG_ SWI_IGK : 48|1@0+ (1,0) [0|1] "" XXX + +BO_ 854 M_356: 8 XXX + SG_ PAINT1 : 32|1@0+ (1,0) [0|1] "" XXX + SG_ PAINT2 : 34|2@0+ (1,0) [0|1] "" XXX + SG_ PAINT3 : 36|2@0+ (1,0) [0|3] "" XXX + SG_ PAINT4 : 38|1@0+ (1,0) [0|1] "" XXX + +BO_ 1042 ICM_412h: 8 ICM + SG_ T_Outside_input : 0|9@0+ (0.01,0) [0|5] "V" Vector__XXX + SG_ WarningSoundOutput_1Group : 5|1@0+ (1,0) [0|1] "" Vector__XXX + SG_ WarningSoundOutput_2Group : 6|1@0+ (1,0) [0|1] "" Vector__XXX + SG_ WarningSoundOutput_3Group : 7|1@0+ (1,0) [0|1] "" Vector__XXX + SG_ TRIP_A_DT_Display_clock : 22|7@0+ (1,0) [0|99] "clock" Vector__XXX + SG_ TRIP_A_DT_Display_minute : 29|6@0+ (1,0) [0|59] "minute" Vector__XXX + SG_ TRIP_B_DT_Display_clock : 38|7@0+ (1,0) [0|99] "clock" Vector__XXX + SG_ TRIP_B_DT_Display_minute : 45|6@0+ (1,0) [0|59] "minute" Vector__XXX + SG_ PopupMessageOutput_1Level : 48|1@0+ (1,0) [0|1] "" Vector__XXX + SG_ PopupMessageOutput_2Level : 49|1@0+ (1,0) [0|1] "" Vector__XXX + SG_ PopupMessageOutput_3Level : 50|1@0+ (1,0) [0|1] "" Vector__XXX + SG_ PopupMessageOutput_4Level : 51|1@0+ (1,0) [0|1] "" Vector__XXX + SG_ PopupMessageOutput_5Level : 52|1@0+ (1,0) [0|1] "" Vector__XXX + SG_ PopupMessageOutput_6Level : 53|1@0+ (1,0) [0|1] "" Vector__XXX + SG_ PopupMessageOutput_7Level : 54|1@0+ (1,0) [0|1] "" Vector__XXX + SG_ PopupMessageOutput_8Level : 55|1@0+ (1,0) [0|1] "" Vector__XXX + +BO_ 1348 Navi_HU: 8 XXX + SG_ SpeedLim_Nav_Clu : 7|8@0+ (1,0) [0|255] "" XXX + +CM_ "BO_ E_EMS11: All (plug-in) hybrids use this gas signal: CR_Vcu_AccPedDep_Pos, and all EVs use the Accel_Pedal_Pos signal. See hyundai/values.py for a specific car list"; +CM_ SG_ 1348 SpeedLim_Nav_Clu "Speed limit displayed on Nav, Cluster and HUD"; + +VAL_ 274 CUR_GR 1 "D" 2 "D" 3 "D" 4 "D" 5 "D" 6 "D" 7 "D" 8 "D" 14 "R" 0 "P"; +VAL_ 871 CF_Lvr_Gear 5 "D" 8 "S" 6 "N" 7 "R" 0 "P"; +VAL_ 882 Elect_Gear_Shifter 5 "D" 8 "S" 6 "N" 7 "R" 0 "P"; +VAL_ 905 ACCMode 0 "off" 1 "enabled" 2 "driver_override" 3 "off_maybe_fault" 4 "cancelled"; +VAL_ 909 CF_VSM_Warn 2 "FCW" 3 "AEB"; +VAL_ 1057 ACCMode 0 "off" 1 "enabled" 2 "driver_override" 3 "off_maybe_fault"; +VAL_ 1157 HDA_Icon_State 0 "no_hda" 1 "white_hda" 2 "green_hda"; +VAL_ 1157 LFA_SysWarning 0 "no_message" 1 "switching_to_hda" 2 "switching_to_scc" 3 "lfa_error" 4 "check_hda" 5 "keep_hands_on_wheel_orange" 6 "keep_hands_on_wheel_red"; +VAL_ 1157 LFA_Icon_State 0 "no_wheel" 1 "white_wheel" 2 "green_wheel" 3 "green_wheel_blink"; +VAL_ 1157 HDA_SysWarning 0 "no_message" 1 "driving_convenience_systems_cancelled" 2 "highway_drive_assist_system_cancelled"; +VAL_ 1322 CF_Clu_Gear 1 "P" 2 "R" 4 "N" 8 "D"; diff --git a/opendbc/hyundai_kia_mando_front_radar.dbc b/opendbc/hyundai_kia_mando_front_radar.dbc new file mode 100644 index 000000000..552cdddea --- /dev/null +++ b/opendbc/hyundai_kia_mando_front_radar.dbc @@ -0,0 +1,454 @@ + +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + + +BO_ 1280 RADAR_TRACK_500: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1281 RADAR_TRACK_501: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1282 RADAR_TRACK_502: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1283 RADAR_TRACK_503: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1284 RADAR_TRACK_504: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1285 RADAR_TRACK_505: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1286 RADAR_TRACK_506: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1287 RADAR_TRACK_507: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1288 RADAR_TRACK_508: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1289 RADAR_TRACK_509: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1290 RADAR_TRACK_50a: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1291 RADAR_TRACK_50b: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1292 RADAR_TRACK_50c: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1293 RADAR_TRACK_50d: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1294 RADAR_TRACK_50e: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1295 RADAR_TRACK_50f: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1296 RADAR_TRACK_510: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1297 RADAR_TRACK_511: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1298 RADAR_TRACK_512: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1299 RADAR_TRACK_513: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1300 RADAR_TRACK_514: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1301 RADAR_TRACK_515: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1302 RADAR_TRACK_516: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1303 RADAR_TRACK_517: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1304 RADAR_TRACK_518: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1305 RADAR_TRACK_519: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1306 RADAR_TRACK_51a: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1307 RADAR_TRACK_51b: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1308 RADAR_TRACK_51c: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1309 RADAR_TRACK_51d: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1310 RADAR_TRACK_51e: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + + +BO_ 1311 RADAR_TRACK_51f: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + diff --git a/opendbc/lexus_rx_350_2016_pt_generated.dbc b/opendbc/lexus_rx_350_2016_pt_generated.dbc new file mode 100644 index 000000000..4e2a8e179 --- /dev/null +++ b/opendbc/lexus_rx_350_2016_pt_generated.dbc @@ -0,0 +1,450 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 359 STEERING_IPAS_COMMA: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +CM_ "BO_ STEERING_IPAS_COMMA: Copy of msg 614 so we can do angle control while the Park Assist ECU is connected (Panda spoofs 614 with 359 on connector J70). Note that addresses 0x266 and 0x167 are checksum-invariant"; + + BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.159375,-75.555) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.159375,-151.111) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + + BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.159375,-75.555) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.159375,-151.111) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + + VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + +BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX + SG_ ZORRO_STEER : 7|24@0- (0.004901594652,0) [-500|500] "" XXX + +CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss"; + +BO_ 241 ACC_CONTROL_ALT: 8 EON + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU + SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + +BO_ 242 PRECOLLISION_2_ALT: 8 EON + SG_ DECELERATION : 7|10@0- (0.1,0) [0|0] "m/s^2" Vector__XXX + SG_ DS1STAT2 : 13|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ DS1STBK2 : 10|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSWAR : 18|1@0+ (1,0) [0|0] "" FCM + SG_ PCSALM : 17|1@0+ (1,0) [0|0] "" FCM + SG_ PCSOPR : 16|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSABK : 31|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBATRGR : 30|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PPTRGR : 28|1@0+ (1,0) [0|0] "" FCM + SG_ IBTRGR : 27|1@0+ (1,0) [0|0] "" FCM + SG_ CLEXTRGR : 26|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ IRLT_REQ : 25|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ BRKHLD : 37|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ AVSTRGR : 36|1@0+ (1,0) [0|0] "" SCS + SG_ VGRSTRGR : 35|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PREFILL : 33|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBRTRGR : 32|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSDIS : 43|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBPREPMP : 40|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" FCM + + +CM_ "Imported file _toyota_2017.dbc starts here"; +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX DSU HCU EPS IPAS CGW + +BO_ 36 KINEMATICS: 8 XXX + SG_ ACCEL_Y : 33|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX + SG_ YAW_RATE : 1|10@0+ (0.244,-125) [0|65535] "deg/sec" XXX + SG_ STEERING_TORQUE : 17|10@0+ (1,-512) [0|65535] "" XXX + +BO_ 37 STEER_ANGLE_SENSOR: 8 XXX + SG_ STEER_ANGLE : 3|12@0- (1.5,0) [-500|500] "deg" XXX + SG_ STEER_FRACTION : 39|4@0- (0.1,0) [-0.7|0.7] "deg" XXX + SG_ STEER_RATE : 35|12@0- (1,0) [-2000|2000] "deg/s" XXX + +BO_ 166 BRAKE: 8 XXX + SG_ BRAKE_AMOUNT : 7|8@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_PEDAL : 23|8@0+ (1,0) [0|255] "" XXX + +BO_ 170 WHEEL_SPEEDS: 8 XXX + SG_ WHEEL_SPEED_FR : 7|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_FL : 23|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_RR : 39|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_RL : 55|16@0+ (0.01,-67.67) [0|250] "kph" XXX + +BO_ 180 SPEED: 8 XXX + SG_ ENCODER : 39|8@0+ (1,0) [0|255] "" XXX + SG_ SPEED : 47|16@0+ (0.01,0) [0|250] "kph" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 353 DSU_SPEED: 7 XXX + SG_ FORWARD_SPEED : 15|16@0- (0.00390625,-30) [0|255] "kph" XXX + +BO_ 452 ENGINE_RPM: 8 CGW + SG_ RPM : 7|16@0- (0.78125,0) [0|0] "rpm" SCS + +BO_ 466 PCM_CRUISE: 8 XXX + SG_ GAS_RELEASED : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_ACTIVE : 5|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL_ON : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ACCEL_NET : 23|16@0- (0.001,0) [-20|20] "m/s2" XXX + SG_ CRUISE_STATE : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CANCEL_REQ : 49|1@1+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 467 PCM_CRUISE_2: 8 XXX + SG_ MAIN_ON : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_SPEED_LOCKOUT : 14|2@0+ (1,0) [0|3] "kph" XXX + SG_ SET_SPEED : 23|8@0+ (1,0) [0|255] "kph" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 552 ACCELEROMETER: 8 XXX + SG_ ACCEL_Z : 22|15@0- (1,0) [0|32767] "" XXX + SG_ ACCEL_X : 6|15@0- (0.001,0) [-20|20] "m/s2" XXX + +BO_ 560 BRAKE_MODULE2: 7 XXX + SG_ BRAKE_PRESSED : 26|1@0+ (1,0) [0|1] "" XXX + +BO_ 614 STEERING_IPAS: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 643 PRE_COLLISION: 7 DSU + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ FORCE : 23|16@0- (2,0) [0|255] "N" XXX + SG_ SET_ME_X002 : 33|8@0+ (1,0) [0|3] "" XXX + SG_ BRAKE_STATUS : 39|3@0+ (1,0) [0|255] "" XXX + SG_ STATE : 36|3@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X003 : 40|1@0+ (1,0) [0|1] "" XXX + SG_ PRECOLLISION_ACTIVE : 41|1@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 55|8@0+ (1,0) [0|255] "" XXX + +BO_ 740 STEERING_LKA: 5 XXX + SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 6|6@0+ (1,0) [0|63] "" XXX + SG_ SET_ME_1 : 7|1@0+ (1,0) [0|1] "" XXX + SG_ STEER_TORQUE_CMD : 15|16@0- (1,0) [0|65535] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 742 LEAD_INFO: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" HCU + SG_ LEAD_REL_SPEED : 23|12@0- (0.025,0) [-100|100] "m/s" HCU + SG_ LEAD_LONG_DIST : 7|13@0+ (0.05,0) [0|300] "m" HCU + +BO_ 835 ACC_CONTROL: 8 DSU + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU + SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + +BO_ 836 PRE_COLLISION_2: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 869 DSU_CRUISE : 7 DSU + SG_ RES_BTN : 3|1@0+ (1,0) [0|0] "" XXX + SG_ SET_BTN : 2|1@0+ (1,0) [0|0] "" XXX + SG_ CANCEL_BTN : 1|1@0+ (1,0) [0|0] "" XXX + SG_ MAIN_ON : 0|1@0+ (1,0) [0|0] "" XXX + SG_ SET_SPEED : 15|8@0+ (1,0) [0|0] "km/h" XXX + SG_ CRUISE_REQUEST : 31|8@0+ (100,-12800) [0|0] "N" XXX + SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|0] "m" XXX + +BO_ 921 PCM_CRUISE_SM: 8 XXX + SG_ MAIN_ON : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_CONTROL_STATE : 11|4@0+ (1,0) [0|15] "" XXX + SG_ DISTANCE_LINES : 14|2@0+ (1,0) [0|3] "" XXX + SG_ UI_SET_SPEED : 31|8@0+ (1,0) [0|255] "" XXX + +BO_ 951 ESP_CONTROL: 8 ESP + SG_ TC_DISABLED : 13|1@0+ (1,0) [0|1] "" XXX + SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX + +BO_ 1041 ACC_HUD: 8 DSU + SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX + +BO_ 1042 LKAS_HUD: 8 XXX + SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX + SG_ RIGHT_LINE : 3|2@0+ (1,0) [0|3] "" XXX + SG_ LEFT_LINE : 5|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X01 : 7|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X01_2 : 11|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_ALERT : 9|2@0+ (1,0) [0|3] "" XXX + SG_ TWO_BEEPS : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ADJUSTING_CAMERA : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_MALFUNCTION : 15|1@0+ (1,0) [0|1] "" XXX + SG_ REPEATED_BEEPS : 32|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X0C : 23|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X2C : 47|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X38 : 55|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X02 : 63|8@0+ (1,0) [0|1] "" XXX + +BO_ 1043 TIME : 8 CGW + SG_ YEAR : 7|8@0+ (1,0) [0|0] "year" XXX + SG_ MONTH : 15|8@0+ (1,0) [0|0] "month" XXX + SG_ DAY : 23|8@0+ (1,0) [0|0] "day" XXX + SG_ HOUR : 31|8@0+ (1,0) [0|0] "hour" XXX + SG_ MINUTE : 39|8@0+ (1,0) [0|0] "minute" XXX + SG_ GMT_DIFF : 55|1@0+ (1,0) [0|0] "" XXX + SG_ GMTDIFF_HOURS : 54|4@0+ (1,0) [0|0] "hours" XXX + SG_ GMTDIFF_MINUTES : 50|6@0+ (1,0) [0|0] "minutes" XXX + SG_ SUMMER : 60|1@0+ (1,0) [0|0] "" XXX + +BO_ 1408 VIN_PART_1: 8 CGW + SG_ VIN_1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_2 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_3 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_4 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_5 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_6 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_7 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_8 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1409 VIN_PART_2: 8 CGW + SG_ VIN_9 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_10 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_11 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_12 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_13 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_14 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_15 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_16 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1410 VIN_PART_3: 8 CGW + SG_ VIN_17 : 7|8@0+ (1,0) [0|0] "" XXX + +BO_ 1553 UI_SETTING: 8 XXX + SG_ UNITS : 26|2@0+ (1,0) [0|3] "" XXX + SG_ ODOMETER : 43|20@0+ (1,0) [0|1048575] "" XXX + +BO_ 1556 STEERING_LEVERS: 8 XXX + SG_ TURN_SIGNALS : 29|2@0+ (1,0) [0|3] "" XXX + SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX + +BO_ 1568 SEATS_DOORS: 8 XXX + SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 43|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FR : 44|1@0+ (1,0) [0|1] "" XXX + +BO_ 1570 LIGHT_STALK: 8 SCM + SG_ AUTO_HIGH_BEAM : 37|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_FOG : 27|1@0+ (1,0) [0|1] "" XXX + SG_ PARKING_LIGHT : 28|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_BEAM : 29|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAM : 30|1@0+ (1,0) [0|1] "" XXX + +BO_ 1161 RSA1: 8 FCM + SG_ TSGN1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY1 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT1 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL1 : 23|8@0+ (1,0) [0|0] "kph" XXX + SG_ SPLSGN1 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN2 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN2 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY2 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT2 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL2 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_P : 63|2@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_A : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID1 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1162 RSA2: 8 FCM + SG_ TSGN3 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY3 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT3 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN3 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN4 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN4 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY4 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT4 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ DPSGNREQ : 54|1@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMP : 53|3@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMA : 50|3@0+ (1,0) [0|0] "" XXX + SG_ SPDUNT : 63|2@0+ (1,0) [0|0] "" XXX + SG_ TSRWMSG : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID2 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1163 RSA3: 8 FCM + SG_ TSREQPD : 7|1@0+ (1,0) [0|0] "" XXX + SG_ TSRMSW : 6|1@0+ (1,0) [0|0] "" XXX + SG_ OTSGNNTM : 5|2@0+ (1,0) [0|0] "" XXX + SG_ NTLVLSPD : 3|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPNTM : 1|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPVALL : 11|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALM : 19|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALH : 27|4@0+ (1,-5) [0|0] "" XXX + SG_ TSRSPU : 33|2@0+ (1,0) [0|0] "" XXX + +CM_ SG_ 36 ACCEL_Y "unit is tbd"; +CM_ SG_ 36 YAW_RATE "verify"; +CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd"; +CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set"; +CM_ SG_ 37 STEER_RATE "factor is tbd"; +CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors"; +CM_ SG_ 466 CRUISE_STATE "Active state is 8, if standstill is requested will switch to state 11(3 sec timer), after timer is elapsed will switch into state 7(standstill). If plus button was pressed - status 9, minus button pressed - status 10"; +CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect"; +CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph"; +CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?"; +CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque"; +CM_ SG_ 608 STEER_OVERRIDE "set when driver torque exceeds a certain value"; +CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active"; +CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking"; +CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG."; +CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file."; +CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit"; +CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel"; +CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces"; +CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts"; +CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit."; +CM_ SG_ 1161 SYNCID1 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1161 SPDVAL2 "conditional speed value 70"; +CM_ SG_ 1162 SGNNUMP "1 if SPDVAL1 is set, otherwise 0"; +CM_ SG_ 1162 SYNCID2 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1163 TSREQPD "always 1"; +CM_ SG_ 1163 TSRMSW "always 1"; +CM_ SG_ 1163 OTSGNNTM "always 3"; +CM_ SG_ 1163 NTLVLSPD "always 3"; +CM_ SG_ 1163 OVSPNTM "always 3"; +CM_ SG_ 1163 OVSPVALL "-5 at start then 2 after 2 seconds"; +CM_ SG_ 1163 OVSPVALM "-5 at start then 5 after 2 seconds"; +CM_ SG_ 1163 OVSPVALH "-5 at start then 10 after 2 seconds"; +CM_ SG_ 1163 TSRSPU "always 1"; +CM_ SG_ 1553 ODOMETER "Unit is dependent upon units signal"; + +VAL_ 466 CRUISE_STATE 11 "timer_3sec" 10 "adaptive click down" 9 "adaptive click up" 8 "adaptive engaged" 7 "standstill" 6 "non-adaptive click up" 5 "non-adaptive click down" 4 "non-adaptive hold down" 3 "non-adaptive hold up" 2 "non-adaptive being engaged" 1 "non-adaptive engaged" 0 "off"; +VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok"; +VAL_ 614 STATE 3 "enabled" 1 "disabled"; +VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left"; +VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking"; +VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted"; +VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none"; +VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none"; +VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1042 LEFT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1553 UNITS 1 "km" 2 "miles"; +VAL_ 1556 TURN_SIGNALS 3 "none" 2 "right" 1 "left"; +VAL_ 1161 TSGN1 1 "speed sign" 0 "none"; +VAL_ 1161 TSGN2 1 "speed sign" 0 "none"; +VAL_ 1161 SPLSGN2 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; +VAL_ 1162 TSGN3 0 "none" 1 "speed sign" 2 "0 unlimited" 7 "unlimited" 16 "highway" 17 "no highway" 18 "motorway" 19 "no motorway" 20 "in city" 21 "outside city" 22 "pedestrian area" 23 "no pedestrian area" 65 "no overtaking left" 66 "no overtaking right" 67 "overtaking allowed again" 81 "no right turn" 97 "stop" 105 "yield" 113 "stop" 114 "yield us" 129 "no entry" 138 "no entry tss2" 145 "do not enter"; +VAL_ 1162 SPLSGN3 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; + + +CM_ "CHFFR_METRIC 37 STEER_ANGLE STEER_ANGLE 0.36 180"; + +CM_ "lexus_rx_350_2016_pt.dbc starts here"; + + + +BO_ 550 BRAKE_MODULE: 8 XXX + SG_ BRAKE_PRESSURE : 0|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_POSITION : 16|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_PRESSED : 37|1@0+ (1,0) [0|1] "" XXX + +BO_ 608 STEER_TORQUE_SENSOR: 8 XXX + SG_ STEER_TORQUE_EPS : 47|16@0- (0.73,0) [-20000|20000] "" XXX + SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX + SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_ANGLE : 31|16@0- (0.0573,0) [-500|500] "" XXX + +BO_ 610 EPS_STATUS: 5 EPS + SG_ IPAS_STATE : 3|4@0+ (1,0) [0|15] "" XXX + SG_ LKA_STATE : 31|7@0+ (1,0) [0|127] "" XXX + SG_ TYPE : 24|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 956 GEAR_PACKET: 8 XXX + SG_ SPORT_ON : 2|1@0+ (1,0) [0|1] "" XXX + SG_ GEAR : 13|6@0+ (1,0) [0|63] "" XXX + SG_ ECON_ON : 40|1@0+ (1,0) [0|1] "" XXX + +BO_ 705 GAS_PEDAL: 8 XXX + SG_ GAS_PEDAL : 55|8@0+ (1,0) [0|255] "" XXX + + +CM_ SG_ 550 BRAKE_PRESSURE "seems prop to pedal force"; +CM_ SG_ 550 BRAKE_POSITION "seems proportional to pedal displacement, unclear the max value of 0x1c8"; +CM_ SG_ 610 TYPE "seems 1 on Corolla, 0 on all others"; +VAL_ 610 IPAS_STATE 5 "override" 3 "enabled" 1 "disabled" ; +VAL_ 610 LKA_STATE 25 "temporary_fault" 9 "temporary_fault2" 5 "active" 1 "standby" ; +VAL_ 956 SPORT_ON 0 "off" 1 "on" ; +VAL_ 956 GEAR 0 "D" 1 "S" 8 "N" 16 "R" 32 "P" ; +VAL_ 956 ECON_ON 0 "off" 1 "on" ; diff --git a/opendbc/lexus_rx_hybrid_2017_pt_generated.dbc b/opendbc/lexus_rx_hybrid_2017_pt_generated.dbc new file mode 100644 index 000000000..41c3a0de8 --- /dev/null +++ b/opendbc/lexus_rx_hybrid_2017_pt_generated.dbc @@ -0,0 +1,450 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 359 STEERING_IPAS_COMMA: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +CM_ "BO_ STEERING_IPAS_COMMA: Copy of msg 614 so we can do angle control while the Park Assist ECU is connected (Panda spoofs 614 with 359 on connector J70). Note that addresses 0x266 and 0x167 are checksum-invariant"; + + BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.159375,-75.555) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.159375,-151.111) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + + BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.159375,-75.555) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.159375,-151.111) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + + VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + +BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX + SG_ ZORRO_STEER : 7|24@0- (0.004901594652,0) [-500|500] "" XXX + +CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss"; + +BO_ 241 ACC_CONTROL_ALT: 8 EON + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU + SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + +BO_ 242 PRECOLLISION_2_ALT: 8 EON + SG_ DECELERATION : 7|10@0- (0.1,0) [0|0] "m/s^2" Vector__XXX + SG_ DS1STAT2 : 13|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ DS1STBK2 : 10|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSWAR : 18|1@0+ (1,0) [0|0] "" FCM + SG_ PCSALM : 17|1@0+ (1,0) [0|0] "" FCM + SG_ PCSOPR : 16|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSABK : 31|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBATRGR : 30|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PPTRGR : 28|1@0+ (1,0) [0|0] "" FCM + SG_ IBTRGR : 27|1@0+ (1,0) [0|0] "" FCM + SG_ CLEXTRGR : 26|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ IRLT_REQ : 25|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ BRKHLD : 37|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ AVSTRGR : 36|1@0+ (1,0) [0|0] "" SCS + SG_ VGRSTRGR : 35|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PREFILL : 33|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBRTRGR : 32|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSDIS : 43|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBPREPMP : 40|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" FCM + + +CM_ "Imported file _toyota_2017.dbc starts here"; +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX DSU HCU EPS IPAS CGW + +BO_ 36 KINEMATICS: 8 XXX + SG_ ACCEL_Y : 33|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX + SG_ YAW_RATE : 1|10@0+ (0.244,-125) [0|65535] "deg/sec" XXX + SG_ STEERING_TORQUE : 17|10@0+ (1,-512) [0|65535] "" XXX + +BO_ 37 STEER_ANGLE_SENSOR: 8 XXX + SG_ STEER_ANGLE : 3|12@0- (1.5,0) [-500|500] "deg" XXX + SG_ STEER_FRACTION : 39|4@0- (0.1,0) [-0.7|0.7] "deg" XXX + SG_ STEER_RATE : 35|12@0- (1,0) [-2000|2000] "deg/s" XXX + +BO_ 166 BRAKE: 8 XXX + SG_ BRAKE_AMOUNT : 7|8@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_PEDAL : 23|8@0+ (1,0) [0|255] "" XXX + +BO_ 170 WHEEL_SPEEDS: 8 XXX + SG_ WHEEL_SPEED_FR : 7|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_FL : 23|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_RR : 39|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_RL : 55|16@0+ (0.01,-67.67) [0|250] "kph" XXX + +BO_ 180 SPEED: 8 XXX + SG_ ENCODER : 39|8@0+ (1,0) [0|255] "" XXX + SG_ SPEED : 47|16@0+ (0.01,0) [0|250] "kph" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 353 DSU_SPEED: 7 XXX + SG_ FORWARD_SPEED : 15|16@0- (0.00390625,-30) [0|255] "kph" XXX + +BO_ 452 ENGINE_RPM: 8 CGW + SG_ RPM : 7|16@0- (0.78125,0) [0|0] "rpm" SCS + +BO_ 466 PCM_CRUISE: 8 XXX + SG_ GAS_RELEASED : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_ACTIVE : 5|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL_ON : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ACCEL_NET : 23|16@0- (0.001,0) [-20|20] "m/s2" XXX + SG_ CRUISE_STATE : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CANCEL_REQ : 49|1@1+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 467 PCM_CRUISE_2: 8 XXX + SG_ MAIN_ON : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_SPEED_LOCKOUT : 14|2@0+ (1,0) [0|3] "kph" XXX + SG_ SET_SPEED : 23|8@0+ (1,0) [0|255] "kph" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 552 ACCELEROMETER: 8 XXX + SG_ ACCEL_Z : 22|15@0- (1,0) [0|32767] "" XXX + SG_ ACCEL_X : 6|15@0- (0.001,0) [-20|20] "m/s2" XXX + +BO_ 560 BRAKE_MODULE2: 7 XXX + SG_ BRAKE_PRESSED : 26|1@0+ (1,0) [0|1] "" XXX + +BO_ 614 STEERING_IPAS: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 643 PRE_COLLISION: 7 DSU + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ FORCE : 23|16@0- (2,0) [0|255] "N" XXX + SG_ SET_ME_X002 : 33|8@0+ (1,0) [0|3] "" XXX + SG_ BRAKE_STATUS : 39|3@0+ (1,0) [0|255] "" XXX + SG_ STATE : 36|3@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X003 : 40|1@0+ (1,0) [0|1] "" XXX + SG_ PRECOLLISION_ACTIVE : 41|1@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 55|8@0+ (1,0) [0|255] "" XXX + +BO_ 740 STEERING_LKA: 5 XXX + SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 6|6@0+ (1,0) [0|63] "" XXX + SG_ SET_ME_1 : 7|1@0+ (1,0) [0|1] "" XXX + SG_ STEER_TORQUE_CMD : 15|16@0- (1,0) [0|65535] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 742 LEAD_INFO: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" HCU + SG_ LEAD_REL_SPEED : 23|12@0- (0.025,0) [-100|100] "m/s" HCU + SG_ LEAD_LONG_DIST : 7|13@0+ (0.05,0) [0|300] "m" HCU + +BO_ 835 ACC_CONTROL: 8 DSU + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU + SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + +BO_ 836 PRE_COLLISION_2: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 869 DSU_CRUISE : 7 DSU + SG_ RES_BTN : 3|1@0+ (1,0) [0|0] "" XXX + SG_ SET_BTN : 2|1@0+ (1,0) [0|0] "" XXX + SG_ CANCEL_BTN : 1|1@0+ (1,0) [0|0] "" XXX + SG_ MAIN_ON : 0|1@0+ (1,0) [0|0] "" XXX + SG_ SET_SPEED : 15|8@0+ (1,0) [0|0] "km/h" XXX + SG_ CRUISE_REQUEST : 31|8@0+ (100,-12800) [0|0] "N" XXX + SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|0] "m" XXX + +BO_ 921 PCM_CRUISE_SM: 8 XXX + SG_ MAIN_ON : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_CONTROL_STATE : 11|4@0+ (1,0) [0|15] "" XXX + SG_ DISTANCE_LINES : 14|2@0+ (1,0) [0|3] "" XXX + SG_ UI_SET_SPEED : 31|8@0+ (1,0) [0|255] "" XXX + +BO_ 951 ESP_CONTROL: 8 ESP + SG_ TC_DISABLED : 13|1@0+ (1,0) [0|1] "" XXX + SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX + +BO_ 1041 ACC_HUD: 8 DSU + SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX + +BO_ 1042 LKAS_HUD: 8 XXX + SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX + SG_ RIGHT_LINE : 3|2@0+ (1,0) [0|3] "" XXX + SG_ LEFT_LINE : 5|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X01 : 7|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X01_2 : 11|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_ALERT : 9|2@0+ (1,0) [0|3] "" XXX + SG_ TWO_BEEPS : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ADJUSTING_CAMERA : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_MALFUNCTION : 15|1@0+ (1,0) [0|1] "" XXX + SG_ REPEATED_BEEPS : 32|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X0C : 23|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X2C : 47|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X38 : 55|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X02 : 63|8@0+ (1,0) [0|1] "" XXX + +BO_ 1043 TIME : 8 CGW + SG_ YEAR : 7|8@0+ (1,0) [0|0] "year" XXX + SG_ MONTH : 15|8@0+ (1,0) [0|0] "month" XXX + SG_ DAY : 23|8@0+ (1,0) [0|0] "day" XXX + SG_ HOUR : 31|8@0+ (1,0) [0|0] "hour" XXX + SG_ MINUTE : 39|8@0+ (1,0) [0|0] "minute" XXX + SG_ GMT_DIFF : 55|1@0+ (1,0) [0|0] "" XXX + SG_ GMTDIFF_HOURS : 54|4@0+ (1,0) [0|0] "hours" XXX + SG_ GMTDIFF_MINUTES : 50|6@0+ (1,0) [0|0] "minutes" XXX + SG_ SUMMER : 60|1@0+ (1,0) [0|0] "" XXX + +BO_ 1408 VIN_PART_1: 8 CGW + SG_ VIN_1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_2 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_3 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_4 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_5 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_6 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_7 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_8 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1409 VIN_PART_2: 8 CGW + SG_ VIN_9 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_10 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_11 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_12 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_13 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_14 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_15 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_16 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1410 VIN_PART_3: 8 CGW + SG_ VIN_17 : 7|8@0+ (1,0) [0|0] "" XXX + +BO_ 1553 UI_SETTING: 8 XXX + SG_ UNITS : 26|2@0+ (1,0) [0|3] "" XXX + SG_ ODOMETER : 43|20@0+ (1,0) [0|1048575] "" XXX + +BO_ 1556 STEERING_LEVERS: 8 XXX + SG_ TURN_SIGNALS : 29|2@0+ (1,0) [0|3] "" XXX + SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX + +BO_ 1568 SEATS_DOORS: 8 XXX + SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 43|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FR : 44|1@0+ (1,0) [0|1] "" XXX + +BO_ 1570 LIGHT_STALK: 8 SCM + SG_ AUTO_HIGH_BEAM : 37|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_FOG : 27|1@0+ (1,0) [0|1] "" XXX + SG_ PARKING_LIGHT : 28|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_BEAM : 29|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAM : 30|1@0+ (1,0) [0|1] "" XXX + +BO_ 1161 RSA1: 8 FCM + SG_ TSGN1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY1 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT1 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL1 : 23|8@0+ (1,0) [0|0] "kph" XXX + SG_ SPLSGN1 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN2 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN2 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY2 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT2 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL2 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_P : 63|2@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_A : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID1 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1162 RSA2: 8 FCM + SG_ TSGN3 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY3 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT3 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN3 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN4 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN4 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY4 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT4 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ DPSGNREQ : 54|1@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMP : 53|3@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMA : 50|3@0+ (1,0) [0|0] "" XXX + SG_ SPDUNT : 63|2@0+ (1,0) [0|0] "" XXX + SG_ TSRWMSG : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID2 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1163 RSA3: 8 FCM + SG_ TSREQPD : 7|1@0+ (1,0) [0|0] "" XXX + SG_ TSRMSW : 6|1@0+ (1,0) [0|0] "" XXX + SG_ OTSGNNTM : 5|2@0+ (1,0) [0|0] "" XXX + SG_ NTLVLSPD : 3|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPNTM : 1|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPVALL : 11|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALM : 19|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALH : 27|4@0+ (1,-5) [0|0] "" XXX + SG_ TSRSPU : 33|2@0+ (1,0) [0|0] "" XXX + +CM_ SG_ 36 ACCEL_Y "unit is tbd"; +CM_ SG_ 36 YAW_RATE "verify"; +CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd"; +CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set"; +CM_ SG_ 37 STEER_RATE "factor is tbd"; +CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors"; +CM_ SG_ 466 CRUISE_STATE "Active state is 8, if standstill is requested will switch to state 11(3 sec timer), after timer is elapsed will switch into state 7(standstill). If plus button was pressed - status 9, minus button pressed - status 10"; +CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect"; +CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph"; +CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?"; +CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque"; +CM_ SG_ 608 STEER_OVERRIDE "set when driver torque exceeds a certain value"; +CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active"; +CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking"; +CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG."; +CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file."; +CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit"; +CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel"; +CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces"; +CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts"; +CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit."; +CM_ SG_ 1161 SYNCID1 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1161 SPDVAL2 "conditional speed value 70"; +CM_ SG_ 1162 SGNNUMP "1 if SPDVAL1 is set, otherwise 0"; +CM_ SG_ 1162 SYNCID2 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1163 TSREQPD "always 1"; +CM_ SG_ 1163 TSRMSW "always 1"; +CM_ SG_ 1163 OTSGNNTM "always 3"; +CM_ SG_ 1163 NTLVLSPD "always 3"; +CM_ SG_ 1163 OVSPNTM "always 3"; +CM_ SG_ 1163 OVSPVALL "-5 at start then 2 after 2 seconds"; +CM_ SG_ 1163 OVSPVALM "-5 at start then 5 after 2 seconds"; +CM_ SG_ 1163 OVSPVALH "-5 at start then 10 after 2 seconds"; +CM_ SG_ 1163 TSRSPU "always 1"; +CM_ SG_ 1553 ODOMETER "Unit is dependent upon units signal"; + +VAL_ 466 CRUISE_STATE 11 "timer_3sec" 10 "adaptive click down" 9 "adaptive click up" 8 "adaptive engaged" 7 "standstill" 6 "non-adaptive click up" 5 "non-adaptive click down" 4 "non-adaptive hold down" 3 "non-adaptive hold up" 2 "non-adaptive being engaged" 1 "non-adaptive engaged" 0 "off"; +VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok"; +VAL_ 614 STATE 3 "enabled" 1 "disabled"; +VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left"; +VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking"; +VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted"; +VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none"; +VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none"; +VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1042 LEFT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1553 UNITS 1 "km" 2 "miles"; +VAL_ 1556 TURN_SIGNALS 3 "none" 2 "right" 1 "left"; +VAL_ 1161 TSGN1 1 "speed sign" 0 "none"; +VAL_ 1161 TSGN2 1 "speed sign" 0 "none"; +VAL_ 1161 SPLSGN2 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; +VAL_ 1162 TSGN3 0 "none" 1 "speed sign" 2 "0 unlimited" 7 "unlimited" 16 "highway" 17 "no highway" 18 "motorway" 19 "no motorway" 20 "in city" 21 "outside city" 22 "pedestrian area" 23 "no pedestrian area" 65 "no overtaking left" 66 "no overtaking right" 67 "overtaking allowed again" 81 "no right turn" 97 "stop" 105 "yield" 113 "stop" 114 "yield us" 129 "no entry" 138 "no entry tss2" 145 "do not enter"; +VAL_ 1162 SPLSGN3 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; + + +CM_ "CHFFR_METRIC 37 STEER_ANGLE STEER_ANGLE 0.36 180"; + +CM_ "lexus_rx_hybrid_2017_pt.dbc starts here"; + + + +BO_ 550 BRAKE_MODULE: 8 XXX + SG_ BRAKE_PRESSURE : 0|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_POSITION : 16|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_PRESSED : 37|1@0+ (1,0) [0|1] "" XXX + +BO_ 581 GAS_PEDAL: 5 XXX + SG_ GAS_PEDAL : 23|8@0+ (0.005,0) [0|1] "" XXX + +BO_ 608 STEER_TORQUE_SENSOR: 8 XXX + SG_ STEER_TORQUE_EPS : 47|16@0- (0.73,0) [-20000|20000] "" XXX + SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX + SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_ANGLE : 31|16@0- (0.0573,0) [-500|500] "" XXX + +BO_ 610 EPS_STATUS: 5 EPS + SG_ IPAS_STATE : 3|4@0+ (1,0) [0|15] "" XXX + SG_ LKA_STATE : 31|7@0+ (1,0) [0|127] "" XXX + SG_ TYPE : 24|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 956 GEAR_PACKET: 8 XXX + SG_ SPORT_ON : 2|1@0+ (1,0) [0|1] "" XXX + SG_ GEAR : 13|6@0+ (1,0) [0|63] "" XXX + SG_ ECON_ON : 40|1@0+ (1,0) [0|1] "" XXX + +CM_ SG_ 550 BRAKE_PRESSURE "seems prop to pedal force"; +CM_ SG_ 550 BRAKE_POSITION "seems proportional to pedal displacement, unclear the max value of 0x1c8"; +CM_ SG_ 581 GAS_PEDAL "it seems slightly filtered"; +CM_ SG_ 610 TYPE "seems 1 on Corolla, 0 on all others"; +VAL_ 610 IPAS_STATE 5 "override" 3 "enabled" 1 "disabled"; +VAL_ 610 LKA_STATE 25 "temporary_fault" 9 "temporary_fault2" 5 "active" 1 "standby"; +VAL_ 956 GEAR 0 "D" 1 "S" 8 "N" 16 "R" 32 "P"; +VAL_ 956 SPORT_ON 0 "off" 1 "on"; +VAL_ 956 ECON_ON 0 "off" 1 "on"; diff --git a/opendbc/mazda_2017.dbc b/opendbc/mazda_2017.dbc new file mode 100644 index 000000000..fbd11162a --- /dev/null +++ b/opendbc/mazda_2017.dbc @@ -0,0 +1,775 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + + +BO_ 117 STEER_RELATED: 8 XXX + SG_ CTR : 7|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 48|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_2 : 49|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_5 : 50|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_4 : 54|4@0+ (1,0) [0|31] "" XXX + SG_ NEW_SIGNAL_3 : 55|1@0+ (1,0) [0|63] "" XXX + SG_ STEER_ANGLE_2 : 39|16@0+ (0.1,-1800) [0|131071] "" XXX + SG_ STEER_TORQUE : 19|12@0+ (1,-2000) [0|255] "" XXX + +BO_ 118 RPM_RELATED: 8 XXX + SG_ CTR : 7|8@0+ (1,0) [0|127] "" XXX + SG_ NEW_SIGNAL_2 : 19|12@0+ (1,0) [0|4095] "" XXX + +BO_ 514 ENGINE_DATA: 8 XXX + SG_ CHKSUM : 63|8@0+ (1,0) [0|127] "" XXX + SG_ RPM : 7|16@0+ (0.25,0) [0|8500] "rpm" XXX + SG_ SPEED : 23|16@0+ (0.01,0) [0|32767] "kph" XXX + SG_ PEDAL_GAS : 39|12@0+ (1,0) [0|255] "%" XXX + +BO_ 357 PEDALS: 8 XXX + SG_ NEW_SIGNAL_6 : 31|4@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_7 : 8|3@1+ (1,0) [0|7] "" XXX + SG_ ACC_ACTIVE : 3|1@0+ (1,0) [0|1] "" XXX + SG_ ACC_OFF : 2|1@1+ (1,0) [0|15] "" XXX + SG_ CHKSUM : 63|8@0+ (1,0) [0|15] "" XXX + SG_ STANDSTILL : 26|1@0+ (1,0) [0|16777215] "" XXX + SG_ NEW_SIGNAL_3 : 23|8@0+ (1,0) [0|3] "" XXX + SG_ BRAKE_ON : 4|1@0+ (1,0) [0|1] "" XXX + SG_ NO_BRAKE : 6|1@0+ (1,0) [0|7] "" XXX + SG_ BRAKE_ON_2 : 7|1@1+ (1,0) [0|255] "" XXX + SG_ NO_BRAKE_2 : 15|1@0+ (1,0) [0|7] "" XXX + SG_ GEAR : 48|5@1+ (1,0) [0|255] "" XXX + +BO_ 533 WHEEL_SPEEDS: 8 XXX + SG_ FL : 7|16@0+ (0.01,-100) [0|16383] "kph" XXX + SG_ FR : 23|16@0+ (0.01,-100) [0|65535] "kph" XXX + SG_ RL : 39|16@0+ (0.01,-100) [0|15] "kph" XXX + SG_ RR : 55|16@0+ (0.01,-100) [0|65535] "kph" XXX + +BO_ 134 STEER2: 8 XXX + SG_ CTR : 22|4@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_4 : 23|1@0+ (1,0) [0|1] "" XXX + SG_ CTR_2 : 28|3@1+ (1,0) [0|7] "" XXX + SG_ STEER_ANGLE_ROUGH : 26|11@0+ (1,-1000) [0|15] "" XXX + SG_ NEW_SIGNAL_5 : 18|3@0+ (1,0) [0|1] "" XXX + SG_ STEER_ANGLE : 7|16@0+ (0.1,-1600) [-500|500] "deg" XXX + SG_ NEW_SIGNAL_1 : 63|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_2 : 47|8@0+ (1,0) [0|7] "" XXX + +BO_ 576 STEER_TORQUE: 8 XXX + SG_ NEW_SIGNAL_1 : 23|4@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_3 : 47|1@0+ (1,0) [0|1] "" XXX + SG_ SENSOR1 : 39|8@0+ (1,-128) [0|127] "" XXX + SG_ STEER_TORQUE_MOTOR : 46|15@0- (0.1,0) [-3000|3000] "tbd" XXX + SG_ NEW_SIGNAL_2 : 62|4@0+ (1,0) [0|31] "" XXX + SG_ NEW_SIGNAL_4 : 15|8@0+ (1,0) [0|127] "" XXX + SG_ STEER_TORQUE_SENSOR : 7|8@0+ (1,-127) [-85|85] "" XXX + +BO_ 577 STEER_RATE: 8 XXX + SG_ STEER_ANGLE_RATE : 23|16@0+ (0.25,-8192) [0|1] "deg/s" XXX + SG_ CTR : 7|4@0+ (1,0) [0|15] "" XXX + SG_ LKAS_REQUEST : 3|12@0+ (1,-2048) [0|15] "" XXX + SG_ LKAS_EFFECTIVE : 39|12@0+ (1,-2048) [0|255] "" XXX + SG_ HANDS_OFF_5_SECONDS : 51|1@0+ (1,0) [0|1] "" XXX + SG_ LKAS_BLOCK : 50|1@1+ (1,0) [0|3] "" XXX + SG_ LKAS_TRACK_STATE : 52|1@0+ (1,0) [0|3] "" XXX + SG_ CHKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 582 CAM_LANEMAYBE: 8 XXX + SG_ NEW_SIGNAL_4 : 40|8@1+ (1,0) [0|127] "" XXX + SG_ NEW_SIGNAL_1 : 31|16@0- (1,0) [0|65535] "" XXX + SG_ NEW_SIGNAL_2 : 55|16@0+ (1,0) [0|65535] "" XXX + SG_ CTR : 7|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 15|16@0+ (1,0) [0|65535] "" XXX + +BO_ 541 CAM_EMPTY: 8 XXX + +BO_ 605 CAM_PEDESTRIAN: 8 XXX + SG_ CTR : 17|4@0+ (1,0) [0|255] "" XXX + SG_ AEB_NOT_ENGAGED : 13|1@0+ (1,0) [0|1] "" XXX + SG_ PED_WARNING : 9|1@0+ (1,0) [0|255] "" XXX + SG_ PED_BRAKE : 3|3@0+ (1,0) [0|7] "" XXX + SG_ RST_CTR : 23|6@0+ (1,0) [0|63] "" XXX + SG_ S1 : 29|4@0+ (1,0) [0|31] "" XXX + SG_ BRAKE_WARNING : 25|1@0+ (1,0) [0|1] "" XXX + +BO_ 578 CAM_LANETRACK: 8 XXX + SG_ CHKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ZERO : 53|6@0+ (1,0) [0|63] "" XXX + SG_ CTR : 7|4@0+ (1,0) [0|15] "" XXX + SG_ LINE2 : 9|10@0+ (1,-686) [0|255] "" XXX + SG_ LANE_CURVE : 31|8@0+ (1,-127) [0|255] "" XXX + SG_ SIG1 : 39|8@0+ (1,-128) [0|255] "" XXX + SG_ SIG2 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SIG3 : 55|2@0+ (1,0) [0|3] "" XXX + SG_ LINE1 : 3|10@0+ (1,-686) [0|1] "" XXX + +BO_ 579 CAM_LKAS: 8 XXX + SG_ CTR : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ERR_BIT_1 : 16|1@0+ (1,0) [0|1] "" XXX + SG_ CHKSUM : 63|8@0+ (1,0) [0|15] "" XXX + SG_ LINE_NOT_VISIBLE : 19|1@0+ (1,0) [0|1] "" XXX + SG_ BIT_1 : 29|1@0+ (1,0) [0|1] "" XXX + SG_ LDW : 23|1@0+ (1,0) [0|1] "" XXX + SG_ LKAS_REQUEST : 3|12@0+ (1,-2048) [0|2048] "" XXX + SG_ ERR_BIT_2 : 30|1@0+ (1,0) [0|1] "" XXX + SG_ ANGLE_ENABLED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ STEERING_ANGLE : 33|12@0+ (1,-2048) [-2048|2047] "" XXX + +BO_ 580 CAM_DISTANCE: 8 XXX + SG_ S1 : 0|8@1+ (1,0) [0|127] "" XXX + SG_ S2 : 15|8@0+ (1,0) [0|1] "" XXX + SG_ S3 : 16|8@1+ (1,0) [0|3] "" XXX + SG_ S4 : 24|8@1+ (1,0) [0|31] "" XXX + SG_ S5 : 32|8@1+ (1,0) [0|255] "" XXX + SG_ DISTANCE : 47|8@0+ (1,0) [0|65535] "" XXX + SG_ S6 : 55|16@0+ (1,0) [0|255] "" XXX + +BO_ 581 CAM_IDK3: 8 XXX + SG_ S1 : 0|8@1+ (1,0) [0|15] "" XXX + SG_ S2 : 8|6@1+ (1,0) [0|255] "" XXX + SG_ S3 : 15|2@0+ (1,0) [0|3] "" XXX + SG_ S4 : 16|8@1+ (1,0) [0|15] "" XXX + SG_ S5 : 24|8@1+ (1,0) [0|255] "" XXX + SG_ S6 : 32|8@1+ (1,0) [0|255] "" XXX + SG_ S7 : 40|8@1+ (1,0) [0|3] "" XXX + SG_ S8 : 48|8@1+ (1,0) [0|255] "" XXX + SG_ S9 : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 863 CAM_TRAFFIC_SIGNS: 8 XXX + SG_ NEW_SIGNAL_3 : 55|1@0+ (1,0) [0|127] "" XXX + SG_ FORWARD_COLLISION : 40|8@1+ (1,0) [0|7] "" XXX + SG_ SPEED_SIGN : 4|7@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_2 : 52|5@0+ (1,0) [0|31] "" XXX + SG_ SPEED_SIGN_CAM : 32|1@0+ (1,0) [0|32767] "" XXX + SG_ SPEED_SIGN_ON : 12|1@0+ (1,0) [0|3] "" XXX + SG_ STOP_SIGN : 31|4@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_4 : 33|1@0+ (1,0) [0|1] "" XXX + +BO_ 1157 CAM_SETTINGS: 8 XXX + SG_ SBS_WARNING_DISTANCE : 25|2@0+ (1,0) [0|127] "" XXX + SG_ SBS_SCBC : 28|2@0+ (1,0) [0|7] "" XXX + SG_ LKAS_ASSIT_TIMING : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LKAS_SENSETIVITY : 10|1@0+ (1,0) [0|1] "" XXX + SG_ ILKAS_NTERVENTION_ON2 : 17|1@0+ (1,0) [0|255] "" XXX + SG_ LANEE_DEPARTURE_ALERT : 16|2@0+ (1,0) [0|1] "" XXX + SG_ LKAS_INERVENTION_ON1 : 15|1@0+ (1,0) [0|1] "" XXX + SG_ WARNING : 11|1@0+ (1,0) [0|1] "" XXX + SG_ BIT1 : 12|1@0+ (1,0) [0|7] "" XXX + SG_ BIT2 : 14|1@0+ (1,0) [0|1] "" XXX + SG_ BIT3 : 18|1@0+ (1,0) [0|1] "" XXX + +BO_ 1160 CAM_Empty3: 8 XXX + SG_ NEW_SIGNAL_1 : 47|24@0+ (1,0) [0|16777215] "" XXX + +BO_ 1088 CAM_LANEINFO: 8 XXX + SG_ BIT3 : 62|1@0+ (1,0) [0|3] "" XXX + SG_ HANDS_ON_STEER_WARN_2 : 59|1@0+ (1,0) [0|1] "" XXX + SG_ HANDS_ON_STEER_WARN : 56|1@0+ (1,0) [0|3] "" XXX + SG_ S1_HBEAM : 54|1@0+ (1,0) [0|31] "" XXX + SG_ S1 : 52|1@0+ (1,0) [0|1] "" XXX + SG_ HANDS_WARN_3_BITS : 51|3@0+ (1,0) [0|7] "" XXX + SG_ ERR_BIT : 40|1@0+ (1,0) [0|1] "" XXX + SG_ NO_ERR_BIT : 14|1@0+ (1,0) [0|1] "" XXX + SG_ BIT2 : 13|1@0+ (1,0) [0|15] "" XXX + SG_ LANE_LINES : 10|3@0+ (1,0) [0|3] "" XXX + SG_ BIT1 : 6|1@0+ (1,0) [0|65535] "" XXX + SG_ LINE_NOT_VISIBLE : 1|1@0+ (1,0) [0|1] "" XXX + SG_ LINE_VISIBLE : 0|1@0+ (1,0) [0|3] "" XXX + SG_ LDW_WARN_RL : 58|1@0+ (1,0) [0|1] "" XXX + SG_ LDW_WARN_LL : 57|1@0+ (1,0) [0|1] "" XXX + +BO_ 1479 NEW_MSG_470: 8 XXX + +BO_ 1456 NEW_MSG_300: 8 XXX + +BO_ 1446 NEW_MSG_a600: 8 XXX + +BO_ 1416 MSG_18: 8 XXX + +BO_ 1086 DOORS: 8 XXX + SG_ LEFTGATE : 32|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_3 : 53|1@0+ (1,0) [0|255] "" XXX + SG_ KEYFOB_HORN : 2|1@0+ (1,0) [0|1] "" XXX + SG_ KEYFOB_LOCK : 3|1@0+ (1,0) [0|1] "" XXX + SG_ KEYFOB_UNLOCK : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CTR1 : 8|4@1+ (1,0) [0|3] "" XXX + SG_ CTR2 : 16|4@1+ (1,0) [0|15] "" XXX + SG_ BR : 34|1@0+ (1,0) [0|1] "" XXX + SG_ BL : 35|1@0+ (1,0) [0|1] "" XXX + SG_ FR : 36|1@0+ (1,0) [0|1] "" XXX + SG_ FL : 37|1@0+ (1,0) [0|255] "" XXX + SG_ DOORS_UNLOCKED : 30|1@0+ (1,0) [0|255] "" XXX + +BO_ 977 TWO_STATES: 8 XXX + SG_ NEW_SIGNAL_1 : 50|1@1+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_2 : 56|4@1+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_3 : 28|1@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 24|4@1+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_5 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_6 : 36|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_7 : 47|8@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_8 : 51|1@0+ (1,0) [0|1] "" XXX + +BO_ 1085 MSG_12: 8 XXX + SG_ NEW_SIGNAL_3 : 36|1@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 16|8@1+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_2 : 48|8@1+ (1,0) [0|65535] "" XXX + SG_ NEW_SIGNAL_4 : 31|1@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_5 : 24|1@0+ (1,0) [0|127] "" XXX + SG_ NEW_SIGNAL_6 : 40|3@1+ (1,0) [0|7] "" XXX + +BO_ 159 MSG_11: 8 XXX + SG_ NEW_SIGNAL_1 : 50|4@1+ (1,0) [0|15] "" XXX + SG_ INCREASEING : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 1278 NEW_MSG_3: 8 XXX + SG_ NEW_SIGNAL_2 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_3 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_5 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_7 : 63|8@0+ (1,0) [0|255] "" XXX + SG_ MILAGE_MAYBE : 7|16@0+ (1,0) [0|255] "" XXX + +BO_ 1277 NEW_MSG_10: 8 XXX + SG_ NEW_SIGNAL_3 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_2 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ counter : 7|8@0+ (1,0) [0|255] "" XXX + +BO_ 1275 2017_5: 8 XXX + SG_ counter : 4|5@0+ (1,0) [0|255] "" XXX + +BO_ 1274 NEW_MSG_12: 8 XXX + SG_ NEW_SIGNAL_1 : 24|4@1+ (1,0) [0|15] "" XXX + SG_ CTR : 55|4@0+ (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_2 : 35|1@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_3 : 32|3@1+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_4 : 48|4@1+ (1,0) [0|7] "" XXX + +BO_ 1180 last_byte_roughRPM: 8 XXX + SG_ NEW_SIGNAL_1 : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 1078 HVAC: 8 XXX + SG_ NEW_SIGNAL_1 : 2|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_2 : 8|1@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_3 : 23|1@0+ (1,0) [0|65535] "" XXX + SG_ NEW_SIGNAL_4 : 56|5@0+ (1,0) [0|255] "" XXX + +BO_ 1056 CHECK_AND_TEMP: 8 XXX + SG_ NEW_SIGNAL_1 : 29|6@0+ (1,0) [0|255] "" XXX + SG_ counter_or_GEAR : 15|8@0+ (1,0) [0|255] "" XXX + SG_ CTR : 23|8@0+ (1,0) [0|255] "" XXX + SG_ STANDSTILL : 32|1@0+ (1,0) [0|255] "" XXX + SG_ COOLANT_TEMP : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LOW_ENGINE_OIL_PRESSURE : 43|1@0+ (1,0) [0|1] "" XXX + SG_ CHECK_FUEL_CAP : 40|1@0+ (1,0) [0|1] "" XXX + SG_ CHARGING_SYSTEM_MALFUNCTION : 38|1@0+ (1,0) [0|1] "" XXX + SG_ OUTDOOR_TEMP : 63|8@0+ (0.25,-63) [0|255] "cel" XXX + +BO_ 1045 TRACTION: 8 XXX + SG_ NEW_SIGNAL_2 : 20|1@0+ (1,0) [0|3] "" XXX + SG_ CTR2 : 19|4@0+ (1,0) [0|31] "" XXX + SG_ CTR3 : 8|4@1+ (1,0) [0|15] "" XXX + SG_ IS_MOVING : 12|1@0+ (1,0) [0|3] "" XXX + SG_ CTR1 : 53|6@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 54|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE : 55|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_WARNING : 2|1@0+ (1,0) [0|1] "" XXX + SG_ ABS_MALFUNCTION : 1|2@0+ (1,0) [0|3] "" XXX + SG_ DSC_OFF : 3|1@0+ (1,0) [0|1] "" XXX + SG_ TCS_DCS_MALFUNCTION : 6|2@0+ (1,0) [0|3] "" XXX + SG_ LOUD_BEEP : 28|1@0+ (1,0) [0|1] "" XXX + SG_ TPMS_WARNING_DOUBLE_BLINK : 31|1@0+ (1,0) [0|1] "" XXX + +BO_ 1034 MSG_07: 8 XXX + SG_ NEW_SIGNAL_1 : 6|3@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 0|4@1+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 15|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_4 : 63|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_5 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_7 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_8 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_9 : 31|8@0+ (1,0) [0|255] "" XXX + +BO_ 870 RADAR_366_STATIC: 8 XXX + SG_ NEW_SIGNAL_1 : 7|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_2 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_3 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_5 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_7 : 55|8@0+ (1,0) [0|255] "" XXX + +BO_ 867 RADAR_363: 8 XXX + SG_ CTR : 59|4@0+ (1,0) [0|255] "" XXX + SG_ STATIC_4 : 43|16@0+ (1,0) [0|255] "" XXX + SG_ FLIPPY_1 : 31|3@0+ (1,0) [0|7] "" XXX + SG_ FLIPPY_2 : 47|1@0+ (1,0) [0|15] "" XXX + SG_ FLIPPY_4 : 44|1@0+ (1,0) [0|3] "" XXX + SG_ FLIPPY_3 : 46|1@0+ (1,0) [0|3] "" XXX + SG_ CURVE_1 : 7|12@0+ (1,0) [0|255] "" XXX + SG_ CURVE_2 : 11|12@0+ (1,0) [0|255] "" XXX + SG_ CURVE_3 : 28|13@0+ (1,0) [0|255] "" XXX + +BO_ 130 STEER: 8 XXX + SG_ NEW_SIGNAL_5 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 63|8@0+ (1,0) [0|255] "" XXX + SG_ CTR : 47|4@0+ (1,0) [0|255] "" XXX + SG_ STEER_ANGLE : 23|16@0+ (0.05,-1600) [500|-500] "deg" XXX + SG_ CHKSUM_MAYBE : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 120 BRAKE: 8 XXX + SG_ NEW_SIGNAL_1 : 7|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_2 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_3 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ CTR : 55|8@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_PRESSURE : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 304 GEAR_RELATED: 8 XXX + SG_ NEW_SIGNAL_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_2 : 47|8@0+ (1,0) [0|255] "" XXX + +BO_ 865 RADAR_DISTANCE: 8 XXX + SG_ CTR : 56|4@1+ (1,0) [0|15] "" XXX + SG_ STATIC : 36|3@0+ (1,0) [0|31] "" XXX + SG_ DISTANCE_RELATED : 33|4@0+ (1,0) [0|3] "" XXX + SG_ SPEED_INVERSE : 43|12@0- (-0.225,0) [0|255] "kph" XXX + SG_ DISTANCE_LEAD : 7|24@0+ (1,0) [0|31] "" XXX + SG_ RELATIVE_VEL_LEAD : 31|11@0- (1,0) [0|255] "" XXX + +BO_ 836 NEW_MSG_19: 8 XXX + SG_ CTR : 48|4@1+ (1,0) [0|15] "" XXX + SG_ CTR2 : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 832 SEATBELT: 8 XXX + SG_ NEW_SIGNAL_1 : 7|8@0+ (1,0) [0|255] "" XXX + SG_ PASSENGER_SEATBELT : 26|1@1+ (1,0) [0|7] "" XXX + SG_ CTR1 : 15|4@0+ (1,0) [0|15] "" XXX + SG_ CTR2 : 23|4@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 8|4@1+ (1,0) [0|3] "" XXX + SG_ DRIVER_SEATBELT : 27|1@0+ (1,0) [0|1] "" XXX + +BO_ 866 RADAR_TURN: 8 XXX + SG_ CTR : 59|4@0+ (1,0) [0|15] "" XXX + SG_ STEER_ANGLE : 43|12@0+ (-1,2048) [0|7] "" XXX + SG_ STATIC_2 : 63|4@0+ (1,0) [0|15] "" XXX + SG_ CURVE_1 : 7|12@0+ (1,0) [0|131071] "" XXX + SG_ CURVE_2 : 11|12@0- (1,0) [0|127] "" XXX + SG_ FLIPPY_1 : 44|1@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_4 : 34|3@1+ (1,0) [0|3] "" XXX + SG_ CURVE_3 : 31|11@0- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_1 : 33|4@0+ (1,0) [0|3] "" XXX + +BO_ 158 MSG_05: 8 XXX + SG_ NEW_SIGNAL_1 : 23|8@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_2 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_3 : 55|8@0+ (1,0) [0|255] "" XXX + +BO_ 157 CRZ_BTNS: 8 XXX + SG_ BIT1 : 16|1@0+ (1,0) [0|1] "" XXX + SG_ BIT2 : 18|1@0+ (1,0) [0|1] "" XXX + SG_ BIT3 : 20|1@0+ (1,0) [0|1] "" XXX + SG_ SET_P_INV : 21|1@0+ (1,0) [0|1] "" XXX + SG_ CAN_OFF_INV : 17|1@0+ (1,0) [0|1] "" XXX + SG_ CAN_OFF : 0|1@0+ (1,0) [0|1] "" XXX + SG_ SET_M_INV : 22|1@0+ (1,0) [0|1] "" XXX + SG_ SET_M : 5|1@0+ (1,0) [0|1] "" XXX + SG_ SET_P : 4|1@0+ (1,0) [0|1] "" XXX + SG_ RES_INV : 19|1@0+ (1,0) [0|1] "" XXX + SG_ RES : 2|1@0+ (1,0) [0|1] "" XXX + SG_ DISTANCE_LESS : 7|1@0+ (1,0) [0|1] "" XXX + SG_ DISTANCE_LESS_INV : 8|1@0+ (1,0) [0|1] "" XXX + SG_ DISTANCE_MORE : 6|1@0+ (1,0) [0|1] "" XXX + SG_ DISTANCE_MORE_INV : 23|1@0+ (1,0) [0|1] "" XXX + SG_ MODE_Y : 13|1@0+ (1,0) [0|1] "" XXX + SG_ MODE_X : 14|1@0+ (1,0) [0|1] "" XXX + SG_ MODE_Y_INV : 30|1@0+ (1,0) [0|1] "" XXX + SG_ MODE_X_INV : 31|1@0+ (1,0) [0|1] "" XXX + SG_ CTR : 29|4@0+ (1,0) [0|15] "" XXX + +BO_ 154 BLINK_INFO: 8 XXX + SG_ LEFT_BLINK : 18|1@1+ (1,0) [0|3] "" XXX + SG_ RIGHT_BLINK : 19|1@0+ (1,0) [0|255] "" XXX + SG_ REAR_WIPER_ON : 0|1@0+ (1,0) [0|1] "" XXX + SG_ WIPER_LO : 33|1@1+ (1,0) [0|31] "" XXX + SG_ WIPER_HI : 34|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_BEAMS : 5|2@0+ (1,0) [0|3] "" XXX + SG_ HIGH_BEAMS : 7|2@0+ (1,0) [0|3] "" XXX + SG_ LBEAM1 : 17|1@0+ (1,0) [0|1] "" XXX + SG_ LBEAM2 : 50|1@0+ (1,0) [0|1] "" XXX + SG_ LBEAM3 : 60|1@0+ (1,0) [0|1] "" XXX + +BO_ 145 TURN_SWITCH: 8 XXX + SG_ HAZARD : 10|1@0+ (1,0) [0|1] "" XXX + SG_ TURN_RIGHT_SWITCH : 12|1@0+ (1,0) [0|3] "" XXX + SG_ TURN_LEFT_SWITCH : 13|1@0+ (1,0) [0|255] "" XXX + SG_ CTR : 27|4@0+ (1,0) [0|255] "" XXX + SG_ CHKSUM : 39|8@0+ (1,0) [0|15] "" XXX + +BO_ 80 MSG_04: 8 XXX + SG_ NEW_SIGNAL_1 : 25|1@0+ (1,0) [0|1] "" XXX + SG_ SIGNAL : 24|1@0+ (1,0) [0|1] "" XXX + +BO_ 978 MSG_03: 8 XXX + SG_ NEW_SIGNAL_2 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_3 : 23|8@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_4 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_5 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_7 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_8 : 63|8@0+ (1,0) [0|255] "" XXX + SG_ CTR : 1|2@0+ (1,0) [0|255] "" XXX + +BO_ 607 NEW_MSG_25: 8 XXX + +BO_ 1115 MSG_02: 8 XXX + SG_ NEW_SIGNAL_2 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 47|16@0+ (1,0) [0|65535] "" XXX + SG_ NEW_SIGNAL_3 : 63|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_4 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_5 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ CTR : 2|3@0+ (1,0) [0|255] "" XXX + +BO_ 1067 NEW_MSG_27: 8 XXX + SG_ NEW_SIGNAL_2 : 3|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_4 : 0|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_1 : 2|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_5 : 1|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_3 : 12|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_6 : 11|1@1+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_7 : 10|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_8 : 9|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_9 : 8|1@0+ (1,0) [0|1] "" XXX + +BO_ 358 NEW_MSG_28: 8 XXX + +BO_ 608 NEW_MSG_29: 8 XXX + SG_ NEW_SIGNAL_1 : 8|5@1+ (1,0) [0|7] "" XXX + +BO_ 606 SPEED_TBD: 8 XXX + SG_ SPEED_TBD : 7|12@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 23|12@0- (1,0) [0|65535] "" XXX + +BO_ 552 GEAR: 8 XXX + SG_ NEW_SIGNAL_3 : 11|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_5 : 26|3@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 31|5@0+ (1,0) [0|31] "" XXX + SG_ NEW_SIGNAL_7 : 39|1@0+ (1,0) [0|255] "" XXX + SG_ MORE_GEAR : 7|4@0+ (1,0) [0|15] "" XXX + SG_ GEAR : 2|3@0+ (1,0) [0|7] "" XXX + SG_ GEAR_BOX : 36|4@0+ (1,0) [0|15] "" XXX + +BO_ 543 CRZ_EVENTS: 8 XXX + SG_ CTR : 51|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_21 : 23|1@0+ (1,0) [0|15] "" XXX + SG_ GAS_MAYBE : 22|1@0+ (1,0) [0|1] "" XXX + SG_ ACCEL_CMD : 46|8@0- (1,0) [0|15] "" XXX + SG_ CRUISE_ACTIVE_CAR_MOVING : 16|1@0+ (1,0) [0|1] "" XXX + SG_ PLUS_ONE_CRZ : 17|1@0+ (1,0) [0|255] "" XXX + SG_ CRZ_STARTED : 18|1@0+ (1,0) [0|1] "" XXX + SG_ CHKSUM : 63|8@0+ (1,0) [0|15] "" XXX + SG_ PLUS_ONE_CRZ_2 : 19|1@0+ (1,0) [0|1] "" XXX + SG_ ACCEL_CMD_LOW_RES : 29|8@0- (1,0) [0|255] "" XXX + SG_ CRZ_SPEED : 7|16@0+ (0.005,-0.5) [0|328] "kph" XXX + +BO_ 542 NEW_MSG_33: 8 XXX + SG_ CTR : 48|4@1+ (1,0) [0|15] "" XXX + SG_ CTR2 : 56|4@1+ (1,0) [0|15] "" XXX + +BO_ 868 RADAR_364: 8 XXX + SG_ CTR : 59|4@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 7|12@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_2 : 11|12@0- (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_3 : 27|12@0- (1,0) [0|255] "" XXX + SG_ FLIPPERS_1 : 31|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_4 : 44|1@1+ (1,0) [0|3] "" XXX + SG_ FLIPPY_1 : 46|1@0+ (1,0) [0|3] "" XXX + SG_ STATIC_1 : 47|1@0+ (1,0) [0|15] "" XXX + SG_ STATIC_2 : 43|16@0+ (1,0) [0|7] "" XXX + +BO_ 869 RADAR_365: 8 XXX + SG_ CTR : 59|4@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 39|6@0+ (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_1 : 7|14@0+ (1,0) [0|65535] "" XXX + SG_ RELATED_1 : 9|18@0+ (1,0) [0|3] "" XXX + SG_ RELATED_2 : 33|18@0+ (1,0) [0|15] "" XXX + SG_ STATIC : 61|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 63|2@0+ (1,0) [0|15] "" XXX + +BO_ 1114 NEW_MSG_4: 8 XXX + +BO_ 535 CURVE_CTRS: 8 XXX + SG_ CTR_A_1 : 4|3@0+ (1,0) [0|31] "" XXX + SG_ CTR_A_2 : 7|3@0+ (1,0) [0|255] "" XXX + SG_ CTR_B_1 : 12|3@0+ (1,0) [0|7] "" XXX + SG_ CTR_B_2 : 15|3@0+ (1,0) [0|7] "" XXX + SG_ CTR_C_1 : 20|3@0+ (1,0) [0|7] "" XXX + SG_ CTR_C_2 : 23|3@0+ (1,0) [0|255] "" XXX + SG_ CTR_D_2 : 31|3@0+ (1,0) [0|7] "" XXX + SG_ CTR_D_1 : 28|3@0+ (1,0) [0|7] "" XXX + SG_ SPEED : 39|16@0+ (0.01,0) [0|7] "kph" XXX + SG_ CTR : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHK_MAYBE : 63|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 0|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_2 : 1|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_6 : 17|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_7 : 24|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_8 : 25|1@0+ (1,0) [0|1] "" XXX + SG_ SEATBELT_MAYBE : 8|1@0+ (1,0) [0|1] "" XXX + SG_ NO_SEATBELT_MAYBE : 16|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_4 : 9|1@0+ (1,0) [0|1] "" XXX + +BO_ 540 CRZ_CTRL: 8 XXX + SG_ NEW_SIGNAL_6 : 10|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_9 : 31|1@0+ (1,0) [0|255] "" XXX + SG_ ACC_GAS_MAYBE2 : 29|1@0+ (1,0) [0|1] "" XXX + SG_ HANDS_OFF_STEERING : 48|1@0+ (1,0) [0|1] "" XXX + SG_ HANDS_ON_STEER_WARN : 59|4@0+ (1,0) [0|255] "" XXX + SG_ CRZ_ACTIVE : 3|1@0+ (1,0) [0|1] "" XXX + SG_ CRZ_AVAILABLE : 17|1@0+ (1,0) [0|255] "" XXX + SG_ DISTANCE_SETTING : 20|3@0+ (1,0) [0|7] "" XXX + SG_ MSG_1_INV : 1|1@0+ (1,0) [0|1] "" XXX + SG_ MSG_1_COPY : 9|1@0+ (1,0) [0|1] "" XXX + SG_ ACC_GAS_MAYBE : 23|1@0+ (1,0) [0|31] "" XXX + SG_ ACC_ACTIVE_2 : 52|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_10 : 30|1@0+ (1,0) [0|1] "" XXX + SG_ MSG_1 : 0|1@0+ (1,0) [0|3] "" XXX + SG_ 5_SEC_DISABLE_TIMER : 45|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_3 : 13|1@0+ (1,0) [0|3] "" XXX + SG_ MSG_1_INV_COPY : 8|1@0+ (1,0) [0|7] "" XXX + +BO_ 539 CRZ_INFO: 8 XXX + SG_ CTR1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ ACC_ACTIVE : 33|1@0+ (1,0) [0|1] "" XXX + SG_ CHKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_7 : 47|1@0+ (1,0) [0|255] "" XXX + SG_ ACC_SET_ALLOWED : 34|1@0+ (1,0) [0|1] "" XXX + SG_ CRZ_ENDED : 36|1@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD : 17|13@0+ (1,-4096) [0|1] "" XXX + SG_ STATIC_1 : 15|11@0+ (1,0) [0|16383] "" XXX + SG_ STATIC_2 : 18|3@1+ (1,0) [0|3] "" XXX + SG_ ERROR_STATUS : 7|8@0+ (1,0) [0|255] "" XXX + +BO_ 121 EPB: 8 XXX + SG_ NEW_SIGNAL_1 : 4|4@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_2 : 0|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_3 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 25|2@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 39|8@0+ (1,0) [0|255] "" XXX + SG_ CTR : 55|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_7 : 63|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_8 : 41|2@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_9 : 47|1@0+ (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_10 : 46|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_11 : 45|1@0+ (1,0) [0|1] "" XXX + SG_ EPB_ACTIVE : 29|1@0+ (1,0) [0|15] "" XXX + +BO_ 1070 2017_1: 8 XXX + +BO_ 1183 2017_2: 8 XXX + +BO_ 1243 2017_3: 8 XXX + SG_ NEW_SIGNAL_1 : 7|64@0+ (1,0) [0|18446744073709552000] "" XXX + +BO_ 1269 MSG_2017_4: 8 XXX + SG_ NEW_SIGNAL_1 : 55|16@0+ (1,0) [0|18446744073709552000] "" XXX + +BO_ 1178 2017_6: 8 XXX + SG_ NEW_SIGNAL_1 : 7|64@0+ (1,0) [0|18446744073709552000] "" XXX + +BO_ 1179 2017_7: 8 XXX + SG_ NEW_SIGNAL_1 : 7|64@0+ (1,0) [0|18446744073709552000] "" XXX + +BO_ 1435 2017_8: 8 XXX + +BO_ 253 GAS: 8 XXX + SG_ NEW_SIGNAL_1 : 16|1@0+ (1,0) [0|65535] "" XXX + SG_ CTR : 23|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_2 : 41|1@0+ (1,0) [0|255] "" XXX + SG_ CRZ_NOT_ACTIVE : 61|1@0+ (1,0) [0|255] "" XXX + SG_ GAS_CMD : 55|8@0+ (1,0) [0|255] "" XXX + +BO_ 359 MORE_GAS: 8 XXX + SG_ NEW_SIGNAL_1 : 15|1@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_2 : 7|8@0+ (1,0) [0|255] "" XXX + SG_ CTR : 31|4@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_3 : 36|5@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 38|1@1+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_5 : 37|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_6 : 47|4@0+ (1,0) [0|255] "" XXX + +BO_ 512 NEW_MSG_30: 8 XXX + SG_ NEW_SIGNAL_1 : 6|7@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_2 : 7|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_3 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 23|1@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_5 : 22|7@0+ (1,0) [0|127] "" XXX + SG_ NEW_SIGNAL_6 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_7 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_8 : 38|7@0+ (1,0) [0|127] "" XXX + SG_ NEW_SIGNAL_9 : 40|4@1+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_10 : 47|4@0+ (1,0) [0|15] "" XXX + SG_ CTR : 51|3@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_11 : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 515 MSG_01: 8 XXX + SG_ CTR : 39|4@0+ (1,0) [0|65535] "" XXX + SG_ CHKSUM : 47|8@0+ (1,0) [0|255] "" XXX + SG_ START1 : 6|1@0+ (1,0) [0|1] "" XXX + SG_ START2 : 28|5@0+ (1,0) [0|255] "" XXX + +BO_ 529 NEW_MSG_36: 8 XXX + SG_ NEW_SIGNAL_1 : 22|5@0+ (1,0) [0|65535] "" XXX + SG_ NEW_SIGNAL_2 : 31|8@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_3 : 32|4@1+ (1,0) [0|3] "" XXX + SG_ CTR : 39|4@0+ (1,0) [0|255] "" XXX + SG_ CTR_2 : 47|4@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 40|4@1+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_5 : 53|1@0+ (1,0) [0|255] "" XXX + +BO_ 1242 NEW_MSG_37: 8 XXX + +BO_ 1266 MSG_09: 8 XXX + SG_ NEW_SIGNAL_1 : 20|1@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_2 : 19|4@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_3 : 31|1@0+ (1,0) [0|255] "" XXX + +BO_ 976 MSG_15: 8 XXX + SG_ NEW_SIGNAL_1 : 55|1@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_2 : 61|6@0+ (1,0) [0|1] "" XXX + +BO_ 155 MSG_14: 8 XXX + +BO_ 1267 MSG_10: 8 XXX + SG_ NEW_SIGNAL_1 : 40|1@0+ (1,0) [0|16777215] "" XXX + SG_ NEW_SIGNAL_2 : 42|1@0+ (1,0) [0|1] "" XXX + +BO_ 305 NEW_MSG_6: 8 XXX + SG_ NEW_SIGNAL_1 : 8|1@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_2 : 9|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_3 : 10|1@0+ (1,0) [0|1] "" XXX + +BO_ 1238 TEMPERATURE: 8 XXX + SG_ TEMPERATURE_MAYBE : 47|8@0+ (1,0) [0|4294967295] "" XXX + +BO_ 1087 NEW_MSG_1: 8 XXX + SG_ NEW_SIGNAL_1 : 7|8@0+ (1,0) [0|255] "" XXX + +BO_ 1143 BSM: 8 XXX + SG_ BSM_OFF : 0|1@0+ (1,0) [0|1] "" XXX + SG_ RIGHT_BS_3 : 37|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL : 8|1@0+ (1,0) [0|1] "" XXX + SG_ LEFT_BS1 : 12|1@0+ (1,0) [0|1] "" XXX + SG_ LEFT_BS3 : 38|1@0+ (1,0) [0|1] "" XXX + SG_ RIGHT_BS4 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ LEFT_BS_SIDE : 36|1@0+ (1,0) [0|1] "" XXX + SG_ IS_MOVING : 9|1@0+ (1,0) [0|1] "" XXX + SG_ LEFT_BS_BEHIND : 46|2@1+ (1,0) [0|16777215] "" XXX + SG_ RIGHT_BS1 : 14|1@0+ (1,0) [0|63] "" XXX + SG_ RIGHT_BS_DISTANCE : 35|3@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_1 : 32|1@0+ (1,0) [0|1] "" XXX + SG_ REAR_CT_ALERT : 23|5@0+ (1,0) [0|63] "" XXX + +BO_ 1361 KEY_POSITION: 8 XXX + +BO_ 1283 KEY_POSITION2: 8 XXX + +BO_ 628 MSG_06: 8 XXX + +BO_ 1154 MSG_08: 8 XXX + +BO_ 1139 MSG_13: 8 XXX + +BO_ 1270 MSG_16: 8 XXX + +BO_ 1272 MSG_17: 8 XXX + +BO_ 1425 MSG_19: 8 XXX + +BO_ 70 MOB1: 8 XXX + SG_ NEW_SIGNAL_1 : 1|3@1+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_2 : 14|6@0+ (1,0) [0|127] "" XXX + SG_ NEW_SIGNAL_3 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 30|6@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_5 : 38|6@0+ (1,0) [0|7] "" XXX + +BO_ 64 MOB2: 8 XXX + SG_ NEW_SIGNAL_1 : 7|2@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_2 : 10|3@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_3 : 16|1@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 24|1@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_5 : 35|4@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 0|3@1+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_7 : 13|3@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_8 : 15|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_9 : 19|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_10 : 31|6@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_11 : 37|1@0+ (1,0) [0|1] "" XXX + +BO_ 1171 MOB3: 8 XXX + +BO_ 1248 MOB4: 8 XXX + +BO_ 1177 RADAR_499_STATIC: 8 XXX + + + + +CM_ SG_ 357 GEAR "13P, 26R, 13N, 24D"; +CM_ SG_ 605 PED_BRAKE "3: no brake, 4: brake"; +CM_ SG_ 605 BRAKE_WARNING "Flashing brake warning and audible alert for potential forward collision"; +CM_ SG_ 579 STEERING_ANGLE "steering angle aligns with 0.022 factor and -45.06 offset"; +CM_ SG_ 863 SPEED_SIGN "speed limit in MPH"; +CM_ SG_ 863 SPEED_SIGN_CAM "1: The speed limit is recognized by the camera. 0: speed limit is map based or is not available"; +CM_ SG_ 863 STOP_SIGN "value 9 when stop sign is active"; +CM_ SG_ 1157 SBS_WARNING_DISTANCE "1 far, 2 mid, 3 near"; +CM_ SG_ 1157 SBS_SCBC "1 off, 2 on"; +CM_ SG_ 1157 LKAS_ASSIT_TIMING "1 at, 0 before"; +CM_ SG_ 1157 LKAS_SENSETIVITY "0 low, 1 high"; +CM_ SG_ 1157 LANEE_DEPARTURE_ALERT "1 off, 2 on"; +CM_ SG_ 1157 WARNING "1 Rare, 0 often"; +CM_ SG_ 1088 LANE_LINES "0 LKAS disabled, 1 no lines, 2 two lines, 3 left line, 4 right line"; +CM_ SG_ 1045 ABS_MALFUNCTION "off: 0, solid: 1, slow blink: 2, fast blink: 3"; +CM_ SG_ 157 CAN_OFF "Disengage Cruise if enabled, if already disabled TURN it OFF "; +CM_ SG_ 552 MORE_GEAR ""; +CM_ SG_ 552 GEAR "0 Shifting, 1 P, 2 R, 3 N, 4 D"; +CM_ SG_ 552 GEAR_BOX "0 P, 14 R, 1 though 6 D for speeds, 15 Shift"; +CM_ SG_ 540 HANDS_ON_STEER_WARN "0 no warning, b warning"; +CM_ SG_ 540 DISTANCE_SETTING "Radar distance 0: disabled, 1: 4 bars, 2: 3 bars, 3: 2 bars, 4: 1 bar"; +CM_ SG_ 1143 REAR_CT_ALERT "Rear Cross Traffic Alert"; +VAL_ 552 GEAR 1 "P" 2 "R" 3 "N" 4 "D" ; diff --git a/opendbc/nissan_leaf_2018.dbc b/opendbc/nissan_leaf_2018.dbc new file mode 100644 index 000000000..6483d9cbf --- /dev/null +++ b/opendbc/nissan_leaf_2018.dbc @@ -0,0 +1,211 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + + +BO_ 2 STEER_ANGLE_SENSOR: 5 XXX + SG_ STEER_ANGLE_RATE : 16|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X07 : 24|8@1+ (1,0) [0|255] "" XXX + SG_ STEER_ANGLE : 0|16@1- (-0.1,0) [0|65535] "" XXX + SG_ COUNTER : 32|4@1+ (1,0) [0|15] "" XXX + +BO_ 42 SEATBELT: 8 XXX + SG_ SEATBELT_DRIVER_LATCHED : 27|1@1+ (1,0) [0|3] "" XXX + SG_ SEATBELT_DRIVER_UNLATCHED : 26|1@0+ (1,0) [0|1] "" XXX + SG_ unknown2 : 31|4@0+ (1,0) [0|15] "" XXX + SG_ unknown3 : 24|2@1+ (1,0) [0|3] "" XXX + SG_ unknown1 : 7|24@0+ (1,0) [0|16777215] "" XXX + SG_ unknown4 : 39|16@0+ (1,0) [0|65535] "" XXX + +BO_ 361 LKAS: 8 XXX + SG_ MAX_TORQUE : 39|8@0+ (0.01,0) [0|255] "Nm" XXX + SG_ SET_0x80 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ LKA_ACTIVE : 52|1@0+ (1,0) [0|15] "" XXX + SG_ SET_0x80_2 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX + SG_ DESIRED_ANGLE : 7|18@0+ (-0.01,1310) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 389 STEER_TORQUE_SENSOR: 8 XXX + SG_ LKAS_ACTIVE : 37|1@0+ (1,0) [0|3] "" XXX + SG_ STEER_TORQUE_LKAS : 47|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_ANGLE : 23|18@0+ (-0.01,1310) [0|262143] "" XXX + SG_ STEER_TORQUE_DRIVER : 7|12@0+ (-0.01,20.47) [0|4095] "Nm" XXX + SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|127] "" XXX + +BO_ 460 BRAKE_PEDAL: 8 XXX + SG_ BRAKE_PEDAL : 7|8@0+ (1,0) [0|256] "" XXX + +BO_ 569 CRUISE_THROTTLE: 8 XXX + SG_ GAS_PEDAL_INVERTED : 15|8@0+ (1,0) [0|255] "" XXX + SG_ GAS_PEDAL : 7|8@0+ (1,0) [0|255] "" XXX + SG_ CRUISE_AVAILABLE : 17|1@0+ (1,0) [0|1] "" XXX + SG_ unsure1 : 23|6@0+ (1,0) [0|63] "" XXX + SG_ unsure2 : 16|1@0+ (1,0) [0|1] "" XXX + SG_ unsure3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NO_BUTTON_PRESSED : 29|1@0+ (1,0) [0|1] "" XXX + SG_ RES_BUTTON : 28|1@0+ (1,0) [0|1] "" XXX + SG_ SET_BUTTON : 27|1@0+ (1,0) [0|1] "" XXX + SG_ FOLLOW_DISTANCE_BUTTON : 26|1@0+ (1,0) [0|1] "" XXX + SG_ CANCEL_BUTTON : 25|1@0+ (1,0) [0|1] "" XXX + SG_ PROPILOT_BUTTON : 24|1@0+ (1,0) [0|1] "" XXX + SG_ USER_BRAKE_PRESSED : 37|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 32|2@1+ (1,0) [0|3] "" XXX + SG_ unsure5 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ unsure6 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ unsure7 : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 640 CANCEL_MSG: 8 XXX + SG_ CANCEL_SEATBELT : 1|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_1 : 7|6@0+ (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_2 : 0|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_3 : 15|56@0+ (1,0) [0|72057594037927940] "" XXX + +BO_ 644 WHEEL_SPEEDS_FRONT: 8 XXX + SG_ WHEEL_SPEED_FR : 7|16@0+ (0.005,0) [0|65535] "KPH" XXX + SG_ WHEEL_SPEED_FL : 23|16@0+ (0.005,0) [0|65535] "KPH" XXX + +BO_ 645 WHEEL_SPEEDS_REAR: 8 XXX + SG_ WHEEL_SPEED_RR : 7|16@0+ (0.005,0) [0|65535] "KPH" XXX + SG_ WHEEL_SPEED_RL : 23|16@0+ (0.005,0) [0|65535] "KPH" XXX + +BO_ 689 PROPILOT_HUD: 8 XXX + SG_ LARGE_WARNING_FLASHING : 9|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_RADAR_ERROR_FLASHING1 : 10|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_RADAR_ERROR_FLASHING2 : 11|1@0+ (1,0) [0|1] "" XXX + SG_ RIGHT_LANE_YELLOW_FLASH : 12|1@0+ (1,0) [0|1] "" XXX + SG_ LEFT_LANE_YELLOW_FLASH : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_CAR : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_CAR_ERROR : 15|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_RADAR_ERROR : 16|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_RADAR_ERROR_FLASHING : 17|1@0+ (1,0) [0|1] "" XXX + SG_ RIGHT_LANE_GREEN : 24|1@0+ (1,0) [0|1] "" XXX + SG_ LEFT_LANE_GREEN : 25|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_RADAR_ERROR_FLASHING3 : 27|1@0+ (1,0) [0|1] "" XXX + SG_ LKAS_ERROR_FLASHING : 29|1@0+ (1,0) [0|1] "" XXX + SG_ SAFETY_SHIELD_ACTIVE : 44|1@0+ (1,0) [0|1] "" XXX + SG_ LARGE_STEERING_WHEEL_ICON : 61|2@0+ (1,0) [0|3] "" XXX + SG_ RIGHT_LANE_GREEN_FLASH : 62|1@0+ (1,0) [0|1] "" XXX + SG_ LEFT_LANE_GREEN_FLASH : 63|1@0+ (1,0) [0|1] "" XXX + SG_ FOLLOW_DISTANCE : 3|2@0+ (1,0) [0|3] "" XXX + SG_ AUDIBLE_TONE : 47|3@0+ (1,0) [0|8] "" XXX + SG_ SPEED_SET_ICON : 7|2@0+ (1,0) [0|3] "" XXX + SG_ SMALL_STEERING_WHEEL_ICON : 42|3@0+ (1,0) [0|7] "" XXX + SG_ SET_SPEED : 39|8@0+ (1,0) [0|255] "" XXX + SG_ unknown02 : 1|2@0+ (1,0) [0|3] "" XXX + SG_ unknown05 : 5|2@0+ (1,0) [0|3] "" XXX + SG_ unknown08 : 8|7@0+ (1,0) [0|63] "" XXX + SG_ unknown26 : 26|1@0+ (1,0) [0|1] "" XXX + SG_ unknown28 : 28|1@0+ (1,0) [0|1] "" XXX + SG_ unknown31 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ unknown43 : 43|1@0+ (1,0) [0|1] "" XXX + SG_ unknown55 : 55|8@0+ (1,0) [0|63] "" XXX + SG_ unknown59 : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 783 CRUISE_STATE: 3 XXX + SG_ CRUISE_ENABLED : 3|1@0+ (1,0) [0|1] "" XXX + +BO_ 852 ESP: 8 XXX + SG_ ESP_DISABLED : 38|1@0+ (1,0) [0|1] "" XXX + +BO_ 853 HUD_SETTINGS: 8 XXX + SG_ SPEED_MPH : 37|1@0+ (1,0) [0|1] "" XXX + +BO_ 856 LIGHTS: 8 XXX + SG_ LEFT_BLINKER : 17|1@0+ (1,0) [0|1] "" XXX + SG_ RIGHT_BLINKER : 18|1@0+ (1,0) [0|1] "" XXX + +BO_ 1057 GEARBOX: 3 XXX + SG_ GEAR_SHIFTER : 5|3@0+ (1,0) [0|255] "" XXX + +BO_ 1228 PROPILOT_HUD_INFO_MSG: 8 XXX + SG_ NA_HIGH_ACCEL_TEMP : 0|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_RADAR_NA_HIGH_CABIN_TEMP : 8|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_RADAR_MALFUNCTION : 11|1@0+ (1,0) [0|1] "" XXX + SG_ LKAS_MALFUNCTION : 12|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_RADAR_MALFUNCTION : 13|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_RADAR_NA_CLEAN_REAR_CAMERA : 14|1@0+ (1,0) [0|1] "" XXX + SG_ NA_POOR_ROAD_CONDITIONS : 16|1@0+ (1,0) [0|1] "" XXX + SG_ CURRENTLY_UNAVAILABLE : 17|1@0+ (1,0) [0|1] "" XXX + SG_ SAFETY_SHIELD_OFF : 18|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_COLLISION_NA_FRONT_RADAR_OBSTRUCTION : 20|1@0+ (1,0) [0|1] "" XXX + SG_ PEDAL_MISSAPPLICATION_SYSTEM_ACTIVATED : 24|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_IMPACT_NA_RADAR_OBSTRUCTION : 25|1@0+ (1,0) [0|1] "" XXX + SG_ WARNING_DO_NOT_ENTER : 33|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_IMPACT_SYSTEM_OFF : 34|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_IMPACT_MALFUNCTION : 35|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_COLLISION_MALFUNCTION : 36|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_RADAR_MALFUNCTION2 : 37|1@0+ (1,0) [0|1] "" XXX + SG_ LKAS_MALFUNCTION2 : 38|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_RADAR_MALFUNCTION2 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ PROPILOT_NA_MSGS : 42|3@0+ (1,0) [0|7] "" XXX + SG_ BOTTOM_MSG : 45|3@0+ (1,0) [0|7] "" XXX + SG_ HANDS_ON_WHEEL_WARNING : 47|1@0+ (1,0) [0|1] "" XXX + SG_ WARNING_STEP_ON_BRAKE_NOW : 51|1@0+ (1,0) [0|1] "" XXX + SG_ PROPILOT_NA_FRONT_CAMERA_OBSTRUCTED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ PROPILOT_NA_HIGH_CABIN_TEMP : 53|1@0+ (1,0) [0|1] "" XXX + SG_ WARNING_PROPILOT_MALFUNCTION : 54|1@0+ (1,0) [0|3] "" XXX + SG_ ACC_UNAVAILABLE_HIGH_CABIN_TEMP : 62|1@0+ (1,0) [0|1] "" XXX + SG_ ACC_NA_FRONT_CAMERA_IMPARED : 63|1@0+ (1,0) [0|1] "" XXX + SG_ unknown07 : 7|7@0+ (1,0) [0|127] "" XXX + SG_ unknown10 : 10|2@0+ (1,0) [0|3] "" XXX + SG_ unknown15 : 15|1@0+ (1,0) [0|1] "" XXX + SG_ unknown23 : 23|3@0+ (1,0) [0|7] "" XXX + SG_ unknown19 : 19|1@0+ (1,0) [0|1] "" XXX + SG_ unknown31 : 31|6@0+ (1,0) [0|63] "" XXX + SG_ unknown32 : 32|1@0+ (1,0) [0|1] "" XXX + SG_ unknown46 : 46|1@0+ (1,0) [0|1] "" XXX + SG_ unknown50 : 50|3@0+ (1,0) [0|7] "" XXX + SG_ unknown55 : 55|1@0+ (1,0) [0|1] "" XXX + SG_ unknown61 : 61|6@0+ (1,0) [0|63] "" XXX + +BO_ 1549 DOORS_LIGHTS: 8 XXX + SG_ DOOR_OPEN_FL : 3|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FR : 4|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 5|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 6|1@0+ (1,0) [0|1] "" XXX + +BO_ 1227 LKAS_SETTINGS: 8 XXX + SG_ LKAS_ENABLED : 51|1@0+ (1,0) [0|1] "" XXX + +VAL_ 1057 GEAR_SHIFTER 7 "B" 4 "D" 3 "N" 2 "R" 1 "P" ; +VAL_ 1228 PROPILOT_NA_MSGS 0 "NO_MSG" 1 "NA_FRONT_CAMERA_IMPARED" 2 "STEERING_ASSIST_ON_STANDBY" 3 "NA_PARKING_ASSIST_ENABLED" 4 "STEER_ASSIST_CURRENTLY_NA" 5 "NA_BAD_WEATHER" 6 "NA_PARK_BRAKE_ON" 7 "NA_SEATBELT_NOT_FASTENED" ; +VAL_ 1228 BOTTOM_MSG 0 "OK_STEER_ASSIST_SETTINGS" 1 "NO_MSG" 2 "PRESS_SET_TO_SET_SPEED" 3 "PRESS_RES_SET_TO_CHANGE_SPEED" 4 "PRESS_RES_TO_RESTART" 5 "NO_MSG" 6 "CRUISE_NOT_AVAIL" 7 "NO_MSG" ; +VAL_ 689 FOLLOW_DISTANCE 0 "NO_FOLLOW_DISTANCE" 1 "FOLLOW_DISTANCE_1" 2 "FOLLOW_DISTANCE_2" 3 "FOLLOW_DISANCE_3" ; +VAL_ 689 AUDIBLE_TONE 0 "NO_TONE" 1 "CONT" 2 "FAST_BEEP_CONT" 3 "TRIPLE_FAST_BEEP_CONT" 4 "SLOW_BEEP_CONT" 5 "QUAD_SLOW_BEEP_CONT" 6 "SINGLE_BEEP_ONCE" 7 "DOUBLE_BEEP_ONCE" ; +VAL_ 689 SMALL_STEERING_WHEEL_ICON 0 "NO_ICON" 1 "GRAY_ICON" 2 "GRAY_ICON_FLASHING" 3 "GREEN_ICON" 4 "GREEN_ICON_FLASHING" 5 "RED_ICON" 6 "RED_ICON_FLASHING" 7 "YELLOW_ICON" ; +VAL_ 689 LARGE_STEERING_WHEEL_ICON 0 "NO_STEERINGWHEEL" 1 "GRAY_STEERINGWHEEL" 2 "GREEN_STEERINGWHEEL" 3 "GREEN_STEERINGWHEEL_FLASHING" ; diff --git a/opendbc/nissan_x_trail_2017.dbc b/opendbc/nissan_x_trail_2017.dbc new file mode 100644 index 000000000..ea27445d3 --- /dev/null +++ b/opendbc/nissan_x_trail_2017.dbc @@ -0,0 +1,218 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + + +BO_ 2 STEER_ANGLE_SENSOR: 5 XXX + SG_ STEER_ANGLE_RATE : 16|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_X07 : 24|8@1+ (1,0) [0|255] "" XXX + SG_ STEER_ANGLE : 0|16@1- (-0.1,0) [0|65535] "" XXX + SG_ COUNTER : 32|4@1+ (1,0) [0|15] "" XXX + +BO_ 348 GAS_PEDAL: 8 XXX + SG_ GAS_PEDAL_RAW : 26|11@0+ (1,0) [0|2047] "" XXX + SG_ GAS_PEDAL : 47|10@0+ (1,0) [0|1023] "" XXX + +BO_ 361 LKAS: 8 XXX + SG_ MAX_TORQUE : 39|8@0+ (0.01,0) [0|255] "Nm" XXX + SG_ SET_0x80 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ LKA_ACTIVE : 52|1@0+ (1,0) [0|15] "" XXX + SG_ SET_0x80_2 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX + SG_ DESIRED_ANGLE : 7|18@0+ (-0.01,1310) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 389 STEER_TORQUE_SENSOR: 8 XXX + SG_ LKAS_ACTIVE : 37|1@0+ (1,0) [0|3] "" XXX + SG_ STEER_TORQUE_LKAS : 47|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_ANGLE : 23|18@0+ (-0.01,1310) [0|262143] "" XXX + SG_ STEER_TORQUE_DRIVER : 7|12@0+ (-0.01,20.47) [0|4095] "Nm" XXX + SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|127] "" XXX + +BO_ 438 PRO_PILOT: 8 XXX + SG_ COUNTER : 55|4@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X03 : 33|2@0+ (1,0) [0|15] "" XXX + SG_ CRUISE_ACTIVATED : 38|1@0+ (1,0) [0|3] "" XXX + SG_ CRUISE_ON : 36|1@0+ (1,0) [0|255] "" XXX + SG_ STEER_STATUS : 51|1@0+ (1,0) [0|3] "" XXX + +BO_ 523 CRUISE_THROTTLE: 6 XXX + SG_ PROPILOT_BUTTON : 8|1@0+ (1,0) [0|1] "" XXX + SG_ CANCEL_BUTTON : 9|1@0+ (1,0) [0|1] "" XXX + SG_ GAS_PEDAL_INVERTED : 37|10@0+ (1,0) [0|1023] "" XXX + SG_ SET_BUTTON : 11|1@0+ (1,0) [0|1] "" XXX + SG_ RES_BUTTON : 12|1@0+ (1,0) [0|1] "" XXX + SG_ FOLLOW_DISTANCE_BUTTON : 10|1@0+ (1,0) [0|1] "" XXX + SG_ NO_BUTTON_PRESSED : 13|1@0+ (1,0) [0|1] "" XXX + SG_ GAS_PEDAL : 31|10@0+ (1,0) [0|255] "" XXX + SG_ USER_BRAKE_PRESSED : 21|1@0+ (1,0) [0|1] "" XXX + SG_ USER_BRAKE_PRESSED_INVERTED : 22|1@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 23|1@0+ (1,0) [0|1] "" XXX + SG_ GAS_PRESSED_INVERTED : 20|1@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 17|2@0+ (1,0) [0|3] "" XXX + SG_ unsure1 : 7|10@0+ (1,0) [0|1023] "" XXX + SG_ unsure2 : 43|4@0+ (1,0) [0|1] "" XXX + SG_ unsure3 : 19|2@0+ (1,0) [0|3] "" XXX + +BO_ 645 WHEEL_SPEEDS_REAR: 8 XXX + SG_ WHEEL_SPEED_RR : 7|16@0+ (0.005,0) [0|65535] "KPH" XXX + SG_ WHEEL_SPEED_RL : 23|16@0+ (0.005,0) [0|65535] "KPH" XXX + +BO_ 665 ESP: 8 XXX + SG_ ESP_DISABLED : 24|1@0+ (1,0) [0|1] "" XXX + +BO_ 666 WHEEL_SPEEDS_FRONT: 8 XXX + SG_ WHEEL_SPEED_FR : 7|16@0+ (0.005,0) [0|65535] "KPH" XXX + SG_ WHEEL_SPEED_FL : 23|16@0+ (0.005,0) [0|65535] "KPH" XXX + +BO_ 689 PROPILOT_HUD: 8 XXX + SG_ LARGE_WARNING_FLASHING : 9|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_RADAR_ERROR_FLASHING1 : 10|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_RADAR_ERROR_FLASHING2 : 11|1@0+ (1,0) [0|1] "" XXX + SG_ RIGHT_LANE_YELLOW_FLASH : 12|1@0+ (1,0) [0|1] "" XXX + SG_ LEFT_LANE_YELLOW_FLASH : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_CAR : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_CAR_ERROR : 15|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_RADAR_ERROR : 16|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_RADAR_ERROR_FLASHING : 17|1@0+ (1,0) [0|1] "" XXX + SG_ RIGHT_LANE_GREEN : 24|1@0+ (1,0) [0|1] "" XXX + SG_ LEFT_LANE_GREEN : 25|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_RADAR_ERROR_FLASHING3 : 27|1@0+ (1,0) [0|1] "" XXX + SG_ LKAS_ERROR_FLASHING : 29|1@0+ (1,0) [0|1] "" XXX + SG_ SAFETY_SHIELD_ACTIVE : 44|1@0+ (1,0) [0|1] "" XXX + SG_ LARGE_STEERING_WHEEL_ICON : 61|2@0+ (1,0) [0|3] "" XXX + SG_ RIGHT_LANE_GREEN_FLASH : 62|1@0+ (1,0) [0|1] "" XXX + SG_ LEFT_LANE_GREEN_FLASH : 63|1@0+ (1,0) [0|1] "" XXX + SG_ FOLLOW_DISTANCE : 3|2@0+ (1,0) [0|3] "" XXX + SG_ AUDIBLE_TONE : 47|3@0+ (1,0) [0|8] "" XXX + SG_ SPEED_SET_ICON : 7|2@0+ (1,0) [0|3] "" XXX + SG_ SMALL_STEERING_WHEEL_ICON : 42|3@0+ (1,0) [0|7] "" XXX + SG_ SET_SPEED : 39|8@0+ (1,0) [0|255] "" XXX + SG_ unknown02 : 1|2@0+ (1,0) [0|3] "" XXX + SG_ unknown05 : 5|2@0+ (1,0) [0|3] "" XXX + SG_ unknown08 : 8|7@0+ (1,0) [0|63] "" XXX + SG_ unknown26 : 26|1@0+ (1,0) [0|1] "" XXX + SG_ unknown28 : 28|1@0+ (1,0) [0|1] "" XXX + SG_ unknown31 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ unknown43 : 43|1@0+ (1,0) [0|1] "" XXX + SG_ unknown55 : 55|8@0+ (1,0) [0|63] "" XXX + SG_ unknown59 : 59|4@0+ (1,0) [0|15] "" XXX + +BO_ 768 STEER_TORQUE_SENSOR2: 2 XXX + SG_ STEERING_TORQUE : 6|7@0+ (1,0) [0|127] "" XXX + SG_ STEERING_PRESSED : 15|1@0+ (-1,1) [0|7] "" XXX + +BO_ 783 CRUISE_STATE: 3 XXX + SG_ CRUISE_ENABLED : 3|1@0+ (1,0) [0|1] "" XXX + +BO_ 1055 GEARBOX: 2 XXX + SG_ SPORTS_MODE : 13|1@0+ (1,0) [0|1] "" XXX + SG_ GEAR_SHIFTER : 5|3@0+ (1,0) [0|255] "" XXX + +BO_ 1107 LIGHTS: 8 XXX + SG_ RIGHT_BLINKER : 12|1@0+ (1,0) [0|1] "" XXX + SG_ LEFT_BLINKER : 11|1@0+ (1,0) [0|1] "" XXX + SG_ HEADLIGHTS : 5|1@0+ (1,0) [0|1] "" XXX + +BO_ 1108 DOORS_LIGHTS: 8 XXX + SG_ DOOR_CLOSED_RR : 40|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 41|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_CLOSED_RL : 42|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 43|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_CLOSED_FL : 44|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_CLOSED_FR : 46|1@0+ (1,0) [0|3] "" XXX + SG_ DOOR_OPEN_FR : 47|1@0+ (1,0) [0|3] "" XXX + SG_ BOOT_OPEN : 55|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_LIGHT : 54|1@0+ (1,0) [0|1] "" XXX + SG_ USER_BRAKE_PRESSED : 23|1@0+ (1,0) [0|1] "" XXX + +BO_ 1228 PROPILOT_HUD_INFO_MSG: 8 XXX + SG_ NA_HIGH_ACCEL_TEMP : 0|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_RADAR_NA_HIGH_CABIN_TEMP : 8|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_RADAR_MALFUNCTION : 11|1@0+ (1,0) [0|1] "" XXX + SG_ LKAS_MALFUNCTION : 12|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_RADAR_MALFUNCTION : 13|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_RADAR_NA_CLEAN_REAR_CAMERA : 14|1@0+ (1,0) [0|1] "" XXX + SG_ NA_POOR_ROAD_CONDITIONS : 16|1@0+ (1,0) [0|1] "" XXX + SG_ CURRENTLY_UNAVAILABLE : 17|1@0+ (1,0) [0|1] "" XXX + SG_ SAFETY_SHIELD_OFF : 18|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_COLLISION_NA_FRONT_RADAR_OBSTRUCTION : 20|1@0+ (1,0) [0|1] "" XXX + SG_ PEDAL_MISSAPPLICATION_SYSTEM_ACTIVATED : 24|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_IMPACT_NA_RADAR_OBSTRUCTION : 25|1@0+ (1,0) [0|1] "" XXX + SG_ WARNING_DO_NOT_ENTER : 33|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_IMPACT_SYSTEM_OFF : 34|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_IMPACT_MALFUNCTION : 35|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_COLLISION_MALFUNCTION : 36|1@0+ (1,0) [0|1] "" XXX + SG_ SIDE_RADAR_MALFUNCTION2 : 37|1@0+ (1,0) [0|1] "" XXX + SG_ LKAS_MALFUNCTION2 : 38|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_RADAR_MALFUNCTION2 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ PROPILOT_NA_MSGS : 42|3@0+ (1,0) [0|7] "" XXX + SG_ BOTTOM_MSG : 45|3@0+ (1,0) [0|7] "" XXX + SG_ HANDS_ON_WHEEL_WARNING : 47|1@0+ (1,0) [0|1] "" XXX + SG_ WARNING_STEP_ON_BRAKE_NOW : 51|1@0+ (1,0) [0|1] "" XXX + SG_ PROPILOT_NA_FRONT_CAMERA_OBSTRUCTED : 52|1@0+ (1,0) [0|1] "" XXX + SG_ PROPILOT_NA_HIGH_CABIN_TEMP : 53|1@0+ (1,0) [0|1] "" XXX + SG_ WARNING_PROPILOT_MALFUNCTION : 54|1@0+ (1,0) [0|3] "" XXX + SG_ ACC_UNAVAILABLE_HIGH_CABIN_TEMP : 62|1@0+ (1,0) [0|1] "" XXX + SG_ ACC_NA_FRONT_CAMERA_IMPARED : 63|1@0+ (1,0) [0|1] "" XXX + SG_ unknown07 : 7|7@0+ (1,0) [0|127] "" XXX + SG_ unknown10 : 10|2@0+ (1,0) [0|3] "" XXX + SG_ unknown15 : 15|1@0+ (1,0) [0|1] "" XXX + SG_ unknown23 : 23|3@0+ (1,0) [0|7] "" XXX + SG_ unknown19 : 19|1@0+ (1,0) [0|1] "" XXX + SG_ unknown31 : 31|6@0+ (1,0) [0|63] "" XXX + SG_ unknown32 : 32|1@0+ (1,0) [0|1] "" XXX + SG_ unknown46 : 46|1@0+ (1,0) [0|1] "" XXX + SG_ unknown50 : 50|3@0+ (1,0) [0|7] "" XXX + SG_ unknown55 : 55|1@0+ (1,0) [0|1] "" XXX + SG_ unknown61 : 61|6@0+ (1,0) [0|63] "" XXX + +BO_ 1227 LKAS_SETTINGS: 8 XXX + SG_ LKAS_ENABLED : 51|1@0+ (1,0) [0|1] "" XXX + +BO_ 1273 HUD: 7 XXX + SG_ SEATBELT_DRIVER_LATCHED : 25|1@0+ (1,0) [0|1] "" XXX + SG_ SPEED_MPH : 5|1@0+ (1,0) [0|1] "" XXX + +VAL_ 1055 GEAR_SHIFTER 6 "L" 4 "D" 3 "N" 2 "R" 1 "P" ; +VAL_ 1228 PROPILOT_NA_MSGS 0 "NO_MSG" 1 "NA_FRONT_CAMERA_IMPARED" 2 "STEERING_ASSIST_ON_STANDBY" 3 "NA_PARKING_ASSIST_ENABLED" 4 "STEER_ASSIST_CURRENTLY_NA" 5 "NA_BAD_WEATHER" 6 "NA_PARK_BRAKE_ON" 7 "NA_SEATBELT_NOT_FASTENED" ; +VAL_ 1228 BOTTOM_MSG 0 "OK_STEER_ASSIST_SETTINGS" 1 "NO_MSG" 2 "PRESS_SET_TO_SET_SPEED" 3 "PRESS_RES_SET_TO_CHANGE_SPEED" 4 "PRESS_RES_TO_RESTART" 5 "NO_MSG" 6 "CRUISE_NOT_AVAIL" 7 "NO_MSG" ; +VAL_ 689 FOLLOW_DISTANCE 0 "NO_FOLLOW_DISTANCE" 1 "FOLLOW_DISTANCE_1" 2 "FOLLOW_DISTANCE_2" 3 "FOLLOW_DISANCE_3" ; +VAL_ 689 AUDIBLE_TONE 0 "NO_TONE" 1 "CONT" 2 "FAST_BEEP_CONT" 3 "TRIPLE_FAST_BEEP_CONT" 4 "SLOW_BEEP_CONT" 5 "QUAD_SLOW_BEEP_CONT" 6 "SINGLE_BEEP_ONCE" 7 "DOUBLE_BEEP_ONCE" ; +VAL_ 689 SMALL_STEERING_WHEEL_ICON 0 "NO_ICON" 1 "GRAY_ICON" 2 "GRAY_ICON_FLASHING" 3 "GREEN_ICON" 4 "GREEN_ICON_FLASHING" 5 "RED_ICON" 6 "RED_ICON_FLASHING" 7 "YELLOW_ICON" ; +VAL_ 689 LARGE_STEERING_WHEEL_ICON 0 "NO_STEERINGWHEEL" 1 "GRAY_STEERINGWHEEL" 2 "GREEN_STEERINGWHEEL" 3 "GREEN_STEERINGWHEEL_FLASHING" ; diff --git a/opendbc/subaru_forester_2017_generated.dbc b/opendbc/subaru_forester_2017_generated.dbc new file mode 100644 index 000000000..78e97d2f0 --- /dev/null +++ b/opendbc/subaru_forester_2017_generated.dbc @@ -0,0 +1,267 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _subaru_preglobal_2015.dbc starts here"; +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX X + + +BO_ 2 Steering: 8 XXX + SG_ Steering_Angle : 7|16@0- (0.1,0) [-500|500] "degree" XXX + SG_ Counter : 27|3@0+ (1,0) [0|7] "" XXX + SG_ Checksum : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 208 G_Sensor: 8 XXX + SG_ Steering_Angle : 0|16@1- (-0.1,0) [-500|500] "" XXX + SG_ Lateral : 16|16@1- (-0.0035,1) [-255|255] "" XXX + SG_ Longitudinal : 48|16@1- (-0.00035,0) [-255|255] "" XXX + +BO_ 209 Brake_Pedal: 8 XXX + SG_ Speed : 0|16@1+ (0.05625,0) [0|255] "KPH" XXX + SG_ Brake_Pedal : 16|8@1+ (1,0) [0|255] "" XXX + +BO_ 210 Brake_2: 8 XXX + SG_ Brake_Light : 35|1@1+ (1,0) [0|1] "" XXX + SG_ Brake_Related : 36|1@1+ (1,0) [0|1] "" XXX + SG_ Right_Brake : 48|8@1+ (1,0) [0|255] "" XXX + SG_ Left_Brake : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 211 Brake_Type: 8 XXX + SG_ Brake_Light : 21|1@1+ (1,0) [0|1] "" XXX + SG_ Speed_Counter : 32|8@1+ (1,0) [0|255] "" XXX + SG_ Brake_Cruise_On : 42|1@1+ (1,0) [0|1] "" XXX + SG_ Brake_Pedal_On : 46|1@1+ (1,0) [0|1] "" XXX + SG_ Counter : 48|8@1+ (1,0) [0|255] "" XXX + +BO_ 212 Wheel_Speeds: 8 XXX + SG_ FL : 0|16@1+ (0.0592,0) [0|255] "KPH" XXX + SG_ FR : 16|16@1+ (0.0592,0) [0|255] "KPH" XXX + SG_ RL : 32|16@1+ (0.0592,0) [0|255] "KPH" XXX + SG_ RR : 48|16@1+ (0.0592,0) [0|255] "KPH" XXX + +BO_ 320 Throttle: 8 XXX + SG_ Throttle_Pedal : 0|8@1+ (0.392157,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Signal1 : 12|2@1+ (1,0) [0|7] "" XXX + SG_ Not_Full_Throttle : 14|1@1+ (1,0) [0|1] "" XXX + SG_ Signal2 : 15|1@1+ (1,0) [0|1] "" XXX + SG_ Engine_RPM : 16|14@1+ (1,0) [0|32767] "" XXX + SG_ Off_Throttle : 30|1@1+ (1,0) [0|1] "" XXX + SG_ Signal3 : 31|1@1+ (1,0) [0|1] "" XXX + SG_ Throttle_Cruise : 32|8@1+ (1,0) [0|255] "" XXX + SG_ Throttle_Combo : 40|8@1+ (1,0) [0|255] "" XXX + SG_ Throttle_Body : 48|8@1+ (1,0) [0|255] "" XXX + SG_ Off_Throttle_2 : 56|1@1+ (1,0) [0|1] "" XXX + SG_ Signal4 : 57|7@1+ (1,0) [0|127] "" XXX + +BO_ 321 Engine: 8 XXX + SG_ Engine_Torque : 0|15@1+ (1,0) [0|255] "" XXX + SG_ Engine_Stop : 15|1@1+ (1,0) [0|1] "" XXX + SG_ Wheel_Torque : 16|12@1+ (1,0) [0|4095] "" XXX + SG_ Engine_RPM : 32|12@1+ (1,0) [0|8191] "" XXX + +BO_ 324 CruiseControl: 8 XXX + SG_ OnOffButton : 2|1@1+ (1,0) [0|1] "" XXX + SG_ SET_BUTTON : 3|1@1+ (1,0) [0|1] "" XXX + SG_ RES_BUTTON : 4|1@1+ (1,0) [0|1] "" XXX + SG_ Button : 13|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_On : 48|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 49|1@1+ (1,0) [0|1] "" XXX + SG_ Brake_Pedal_On : 51|1@1+ (1,0) [0|1] "" XXX + +BO_ 328 Transmission: 8 XXX + SG_ Manual_Gear : 4|4@1+ (1,0) [0|15] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Transmission_Engine : 16|15@1+ (1,0) [0|65535] "" XXX + SG_ Gear : 48|4@1+ (1,0) [0|15] "" XXX + SG_ Gear_2 : 52|4@1+ (1,0) [0|15] "" XXX + SG_ Paddle_Shift : 60|2@1+ (1,0) [0|3] "" XXX + +BO_ 329 CVT_Ratio: 8 XXX + +BO_ 336 Brake_Pressure: 8 XXX + SG_ Brake_Pressure_Right : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Brake_Pressure_Left : 8|8@1+ (1,0) [0|255] "" XXX + +BO_ 338 Stalk: 8 XXX + SG_ Counter : 12|4@1+ (1,0) [0|15] "" XXX + SG_ Brake_Light : 52|1@1+ (1,0) [0|1] "" XXX + SG_ Runlights : 58|1@1+ (1,0) [0|1] "" XXX + SG_ Headlights : 59|1@1+ (1,0) [0|1] "" XXX + SG_ Highbeam : 60|1@1+ (1,0) [0|1] "" XXX + SG_ Wiper : 62|1@1+ (1,0) [0|1] "" XXX + +BO_ 352 ES_Brake: 8 XXX + SG_ Brake_Pressure : 0|16@1+ (1,0) [0|255] "" XXX + SG_ Brake_Light : 20|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Fault : 21|1@1+ (1,0) [0|1] "" XXX + SG_ Brake_On : 22|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 23|1@1+ (1,0) [0|1] "" XXX + SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX + SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 353 ES_Distance: 8 XXX + SG_ Cruise_Throttle : 0|12@1+ (1,0) [0|4095] "" XXX + SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX + SG_ Car_Follow : 16|1@1+ (1,0) [0|1] "" XXX + SG_ Signal2 : 17|3@1+ (1,0) [0|7] "" XXX + SG_ Brake_On : 20|1@1+ (1,0) [0|1] "" XXX + SG_ Distance_Swap : 21|1@1+ (1,0) [0|1] "" XXX + SG_ Standstill : 22|1@1+ (1,0) [0|1] "" XXX + SG_ Signal3 : 23|1@1+ (1,0) [0|1] "" XXX + SG_ Close_Distance : 24|8@1+ (0.0196,0) [0|255] "m" XXX + SG_ Signal4 : 32|9@1+ (1,0) [0|255] "" XXX + SG_ Standstill_2 : 41|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Fault : 42|1@1+ (1,0) [0|1] "" XXX + SG_ Signal5 : 43|1@1+ (1,0) [0|1] "" XXX + SG_ Counter : 44|3@1+ (1,0) [0|7] "" XXX + SG_ Signal6 : 47|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Button : 48|3@1+ (1,0) [0|7] "" XXX + SG_ Signal7 : 51|5@1+ (1,0) [0|31] "" XXX + SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 354 ES_RPM: 8 XXX + SG_ Brake : 8|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 9|1@1+ (1,0) [0|1] "" XXX + SG_ RPM : 16|16@1+ (1,0) [0|65535] "" XXX + SG_ Checksum : 32|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX + +BO_ 356 ES_LKAS: 8 XXX + SG_ Counter : 0|3@1+ (1,0) [0|7] "" XXX + SG_ LKAS_Command : 8|13@1- (-1,0) [-4096|4096] "" XXX + SG_ LKAS_Active : 24|1@1+ (1,0) [0|1] "" XXX + SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 359 ES_LDW: 8 XXX + SG_ All_depart_2015 : 0|1@1+ (1,0) [0|1] "" XXX + SG_ Right_Line_2017 : 24|1@1+ (1,0) [0|1] "" XXX + SG_ Left_Line_2017 : 25|1@1+ (1,0) [0|1] "" XXX + SG_ Sig1All_Depart : 28|1@1+ (1,0) [0|1] "" XXX + SG_ Sig2All_Depart : 31|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Inactive_2017 : 36|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Active : 37|1@1+ (1,0) [0|1] "" XXX + SG_ Sig1Right_Depart : 48|1@1+ (1,0) [0|1] "" XXX + SG_ Sig1Right_Depart_Front : 49|1@1+ (1,0) [0|1] "" XXX + SG_ Sig2Right_Depart : 50|1@1+ (1,0) [0|1] "" XXX + SG_ Left_Depart_Front : 51|1@1+ (1,0) [0|1] "" XXX + SG_ Sig3All_Depart : 52|1@1+ (1,0) [0|1] "" XXX + +BO_ 604 BSD_RCTA: 8 XXX + SG_ Counter : 0|3@1+ (1,0) [0|7] "" XXX + SG_ State : 5|1@1+ (1,0) [0|1] "" XXX + SG_ R_ADJACENT : 32|1@1+ (1,0) [0|1] "" XXX + SG_ L_ADJACENT : 33|1@1+ (1,0) [0|1] "" XXX + SG_ R_APPROACHING : 42|1@1+ (1,0) [0|1] "" XXX + SG_ L_APPROACHING : 43|1@1+ (1,0) [0|1] "" XXX + SG_ R_RCTA : 46|1@1+ (1,0) [0|1] "" XXX + SG_ L_RCTA : 47|1@1+ (1,0) [0|1] "" XXX + +BO_ 642 Dashlights: 8 XXX + SG_ Counter : 12|4@1+ (1,0) [0|15] "" XXX + SG_ SEATBELT_FL : 40|1@1+ (1,0) [0|1] "" XXX + SG_ LEFT_BLINKER : 44|1@1+ (1,0) [0|1] "" XXX + SG_ RIGHT_BLINKER : 45|1@1+ (1,0) [0|1] "" XXX + +BO_ 880 Steering_Torque_2: 8 XXX + SG_ Steering_Voltage_Flat : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Steer_Torque_Sensor : 29|11@1- (-1,0) [-1000|1000] "" XXX + SG_ Counter : 40|4@1+ (1,0) [0|15] "" XXX + +BO_ 884 BodyInfo: 8 XXX + SG_ DOOR_OPEN_FR : 24|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FL : 25|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 26|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 27|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_Hatch : 28|1@1+ (1,0) [0|1] "" XXX + +BO_ 864 Engine_Temp: 8 XXX + SG_ Oil_Temp : 16|8@1+ (1,-40) [0|255] "" XXX + SG_ Coolant_Temp : 24|8@1+ (1,-40) [0|255] "" XXX + SG_ Cruise_Activated : 45|1@1+ (1,0) [0|1] "" XXX + SG_ Saved_Speed : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 866 Fuel: 8 XXX + +BO_ 977 Dash_State2: 8 XXX + SG_ UNITS : 15|1@1+ (1,0) [0|1] "" XXX + +BO_ 1745 Dash_State: 8 XXX + SG_ Units : 15|1@1+ (1,0) [0|1] "" XXX + +CM_ SG_ 320 Off_Throttle_2 "Less sensitive"; +CM_ SG_ 320 Throttle_Body "Throttle related"; +CM_ SG_ 328 Gear "15 = P, 14 = R, 0 = N, 1-6=gear"; +CM_ SG_ 328 Gear_2 "15 = P, 14 = R, 0 = N, 1-6=gear"; +CM_ SG_ 353 Cruise_Button "1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 resume deep"; +CM_ SG_ 354 RPM "20hz version of Transmission_Engine under Transmission"; +CM_ SG_ 359 Sig1Right_Depart "right depart, hill steep and seatbelt disengage"; +CM_ SG_ 359 LKAS_Inactive_2017 "1 when not steering, 0 when lkas steering"; +CM_ SG_ 359 Sig1Right_Depart_Front "object in front, right depart, hill steep and seatbelt disengage alert "; +CM_ SG_ 359 Left_Depart_Front "warning after acceleration into car in front and left depart"; +CM_ SG_ 359 Sig1All_Depart "Left and right depart"; +CM_ SG_ 359 Sig2All_Depart "Left and right depart"; +CM_ SG_ 359 All_depart_2015 "always 1 on 2017"; +CM_ SG_ 604 R_APPROACHING "Faster car approaching in far right lane"; +CM_ SG_ 604 L_APPROACHING "Faster car approaching in far left lane"; +CM_ SG_ 604 R_RCTA "Rear cross traffic alert, only when in R gear"; +CM_ SG_ 604 L_RCTA "Rear cross traffic alert, only when in R gear"; +CM_ SG_ 642 Counter "Affected by signals"; +CM_ SG_ 642 SEATBELT_FL "Driver seatbelt"; +CM_ SG_ 880 Steering_Voltage_Flat "receives later than 371"; +CM_ SG_ 977 UNITS "0 = Metric, 1 = Imperial"; + +VAL_ 328 Gear 0 "N" 1 "D" 2 "D" 3 "D" 4 "D" 5 "D" 6 "D" 14 "R" 15 "P"; + +CM_ "subaru_forester_2017.dbc starts here"; + +BO_ 355 ES_DashStatus: 8 XXX + SG_ Not_Ready_Startup : 4|2@1+ (1,0) [0|3] "" XXX + SG_ Cruise_On : 16|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 17|1@0+ (1,0) [0|1] "" XXX + SG_ Cruise_Set_Speed : 24|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 40|3@1+ (1,0) [0|7] "" XXX + SG_ Brake : 43|1@1+ (1,0) [0|1] "" XXX + SG_ Car_Follow : 54|1@1+ (1,0) [0|1] "" XXX + SG_ Far_Distance : 56|4@1+ (1,0) [0|1] "" XXX + +BO_ 881 Steering_Torque: 8 XXX + SG_ Steering_Motor_Flat : 0|10@1+ (32,0) [0|1000] "" XXX + SG_ Steer_Torque_Output : 16|11@1- (-32,0) [-1000|1000] "" XXX + SG_ Steer_Error_1 : 27|1@1+ (1,0) [0|1] "" XXX + SG_ Steer_Torque_Sensor : 29|11@1- (-1,0) [-1000|1000] "" XXX + SG_ Steering_Angle : 40|16@1- (-0.033,0) [-600|600] "" XXX diff --git a/opendbc/subaru_global_2017_generated.dbc b/opendbc/subaru_global_2017_generated.dbc new file mode 100644 index 000000000..4c6327563 --- /dev/null +++ b/opendbc/subaru_global_2017_generated.dbc @@ -0,0 +1,322 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _subaru_global.dbc starts here"; +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX X + + +BO_ 2 Steering: 8 XXX + SG_ Steering_Angle : 7|16@0- (0.1,0) [0|65535] "" XXX + SG_ Counter : 25|3@1+ (1,0) [0|7] "" XXX + SG_ CHECKSUM : 32|8@1+ (1,0) [0|255] "" XXX + +BO_ 64 Throttle: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX + SG_ Engine_RPM : 16|12@1+ (1,0) [0|4095] "" XXX + SG_ Signal2 : 28|4@1+ (1,0) [0|15] "" XXX + SG_ Throttle_Pedal : 32|8@1+ (1,0) [0|255] "" XXX + SG_ Throttle_Cruise : 40|8@1+ (1,0) [0|255] "" XXX + SG_ Throttle_Combo : 48|8@1+ (1,0) [0|255] "" XXX + SG_ Signal3 : 56|4@1+ (1,0) [0|15] "" XXX + SG_ Off_Accel : 60|4@1+ (1,0) [0|15] "" XXX + +BO_ 316 Brake_Status: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Signal1 : 12|46@1+ (1,0) [0|1] "" XXX + SG_ ES_Brake : 58|1@1+ (1,0) [0|1] "" XXX + SG_ Signal2 : 59|3@1+ (1,0) [0|1] "" XXX + SG_ Brake : 62|1@1+ (1,0) [0|1] "" XXX + SG_ Signal3 : 63|1@1+ (1,0) [0|1] "" XXX + +BO_ 326 Cruise_Buttons: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Signal1 : 12|30@1+ (1,0) [0|1073741823] "" XXX + SG_ Main : 42|1@1+ (1,0) [0|1] "" XXX + SG_ Set : 43|1@1+ (1,0) [0|1] "" XXX + SG_ Resume : 44|1@1+ (1,0) [0|1] "" XXX + SG_ Signal2 : 45|19@1+ (1,0) [0|524287] "" XXX + +BO_ 315 G_Sensor: 8 XXX + SG_ Lateral : 48|8@1- (-0.1,0) [0|255] "m/s2" XXX + SG_ Longitudinal : 56|8@1- (-0.1,0) [0|255] "m/s2" XXX + +BO_ 314 Wheel_Speeds: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ FR : 12|13@1+ (0.057,0) [0|255] "kph" XXX + SG_ RR : 25|13@1+ (0.057,0) [0|255] "kph" XXX + SG_ FL : 51|13@1+ (0.057,0) [0|255] "kph" XXX + SG_ RL : 38|13@1+ (0.057,0) [0|255] "kph" XXX + +BO_ 280 STOP_START: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ State : 63|1@1+ (1,0) [0|1] "" XXX + +BO_ 281 Steering_Torque: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Steer_Error_1 : 12|1@0+ (1,0) [0|1] "" XXX + SG_ Steer_Torque_Sensor : 16|11@1- (-1,0) [-1000|1000] "" XXX + SG_ Steer_Error_2 : 28|1@1+ (1,0) [0|1] "" XXX + SG_ Steer_Warning : 29|1@1+ (1,0) [0|1] "" XXX + SG_ Steering_Angle : 32|16@1- (-0.0217,0) [-600|600] "" X + SG_ Steer_Torque_Output : 48|11@1- (-1,0) [-1000|1000] "" XXX + +BO_ 312 Brake_Pressure_L_R: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Brake_1 : 48|8@1+ (1,0) [0|255] "" XXX + SG_ Brake_2 : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 313 Brake_Pedal: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX + SG_ Speed : 16|12@1+ (0.05625,0) [0|255] "kph" XXX + SG_ Signal2 : 28|6@1+ (1,0) [0|63] "" XXX + SG_ Brake_Lights : 34|1@1+ (1,0) [0|1] "" XXX + SG_ Signal3 : 35|1@1+ (1,0) [0|1] "" XXX + SG_ Brake_Pedal : 36|12@1+ (1,0) [0|4095] "" XXX + SG_ Signal4 : 48|16@1+ (1,0) [0|65535] "" XXX + +BO_ 372 Engine_Stop_Start: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ STOP_START_STATE : 39|2@0+ (1,0) [0|3] "" XXX + +BO_ 290 ES_LKAS: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ SET_1 : 12|1@0+ (1,0) [0|1] "" XXX + SG_ LKAS_Output : 16|13@1- (-1,0) [-8191|8191] "" XXX + SG_ LKAS_Request : 29|1@0+ (1,0) [0|1] "" XXX + +BO_ 544 ES_Brake: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX + SG_ Brake_Pressure : 16|16@1+ (1,0) [0|65535] "" XXX + SG_ Signal2 : 32|4@1+ (1,0) [0|15] "" XXX + SG_ Cruise_Brake_Lights : 36|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Brake_Fault : 37|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Brake_Active : 38|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 39|1@1+ (1,0) [0|1] "" XXX + SG_ Signal3 : 40|24@1+ (1,0) [0|16777215] "" XXX + +BO_ 577 Cruise_Status: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Cruise_On : 54|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 55|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Active : 57|4@1+ (1,0) [0|15] "" XXX + +BO_ 552 BSD_RCTA: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ R_ADJACENT : 48|1@1+ (1,0) [0|1] "" XXX + SG_ L_ADJACENT : 49|1@1+ (1,0) [0|1] "" XXX + SG_ R_APPROACHING : 58|1@1+ (1,0) [0|1] "" XXX + SG_ L_APPROACHING : 59|1@1+ (1,0) [0|1] "" XXX + +BO_ 912 Dashlights: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ UNITS : 24|1@1+ (1,0) [0|1] "" XXX + SG_ ICY_ROAD : 32|2@1+ (1,0) [0|3] "" XXX + SG_ SEATBELT_FL : 48|1@1+ (1,0) [0|1] "" XXX + SG_ LEFT_BLINKER : 50|1@1+ (1,0) [0|1] "" XXX + SG_ RIGHT_BLINKER : 51|1@1+ (1,0) [0|1] "" XXX + SG_ STOP_START : 54|1@0+ (1,0) [0|1] "" XXX + +BO_ 940 BodyInfo: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ DOOR_OPEN_FL : 32|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FR : 33|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 34|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 35|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_TRUNK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE : 54|1@1+ (1,0) [0|1] "" XXX + SG_ DASH_BTN_LIGHTS : 56|1@0+ (1,0) [0|1] "" XXX + SG_ LOWBEAM : 57|1@1+ (1,0) [0|1] "" XXX + SG_ HIGHBEAM : 58|1@1+ (1,0) [0|1] "" XXX + SG_ FOG_LIGHTS : 60|1@1+ (1,0) [0|1] "" XXX + SG_ WIPERS : 62|1@0+ (1,0) [0|1] "" XXX + +BO_ 801 ES_DashStatus: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ PCB_Off : 12|1@1+ (1,0) [0|1] "" XXX + SG_ LDW_Off : 13|1@1+ (1,0) [0|1] "" XXX + SG_ Signal1 : 14|2@1+ (1,0) [0|3] "" XXX + SG_ Cruise_State_Msg : 16|4@1+ (1,0) [0|15] "" XXX + SG_ LKAS_State_Msg : 20|3@1+ (1,0) [0|7] "" XXX + SG_ Signal2 : 23|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Soft_Disable : 24|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Status_Msg : 25|2@1+ (1,0) [0|3] "" XXX + SG_ Signal3 : 27|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Distance : 28|3@1+ (1,0) [0|7] "" XXX + SG_ Signal4 : 31|1@1+ (1,0) [0|1] "" XXX + SG_ Conventional_Cruise : 32|1@1+ (1,0) [0|1] "" XXX + SG_ Signal5 : 33|2@1+ (1,0) [0|3] "" XXX + SG_ Cruise_Disengaged : 35|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 36|1@1+ (1,0) [0|1] "" XXX + SG_ Signal6 : 37|3@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Set_Speed : 40|8@1+ (1,0) [0|255] "" XXX + SG_ Cruise_Fault : 48|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_On : 49|1@1+ (1,0) [0|1] "" XXX + SG_ Display_Own_Car : 50|1@1+ (1,0) [0|1] "" XXX + SG_ Brake_Lights : 51|1@1+ (1,0) [0|1] "" XXX + SG_ Car_Follow : 52|1@1+ (1,0) [0|1] "" XXX + SG_ Signal7 : 53|3@1+ (1,0) [0|1] "" XXX + SG_ Far_Distance : 56|4@1+ (1,0) [0|15] "" XXX + SG_ Cruise_State : 60|4@1+ (1,0) [0|15] "" XXX + +BO_ 802 ES_LKAS_State: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ LKAS_Alert_Msg : 12|3@1+ (1,0) [0|7] "" XXX + SG_ Signal1 : 15|2@1+ (1,0) [0|3] "" XXX + SG_ LKAS_ACTIVE : 17|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Dash_State : 18|2@1+ (1,0) [0|2] "" XXX + SG_ Signal2 : 20|3@1+ (1,0) [0|7] "" XXX + SG_ Backward_Speed_Limit_Menu : 23|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Left_Line_Enable : 24|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Left_Line_Light_Blink : 25|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Right_Line_Enable : 26|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Right_Line_Light_Blink : 27|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Left_Line_Visible : 28|2@1+ (1,0) [0|3] "" XXX + SG_ LKAS_Right_Line_Visible : 30|2@1+ (1,0) [0|3] "" XXX + SG_ LKAS_Alert : 32|5@1+ (1,0) [0|31] "" XXX + SG_ Signal3 : 37|27@1+ (1,0) [0|1] "" XXX + +BO_ 722 AC_State: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ AC_Mode : 37|3@1+ (1,0) [0|1] "" XXX + SG_ AC_ON : 24|2@1+ (1,0) [0|1] "" XXX + +BO_ 1677 Dash_State: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Units : 29|3@1+ (1,0) [0|7] "" XXX + +CM_ SG_ 64 Throttle_Combo "Throttle Cruise + Pedal"; +CM_ SG_ 313 Brake_Lights "Driver or Cruise Brake on"; +CM_ SG_ 544 Cruise_Brake_Lights "1 = switch on brake lights"; +CM_ SG_ 801 PCB_Off "Pre-Collision Braking off"; +CM_ SG_ 801 Brake_Lights "Driver or Cruise brake on"; +CM_ SG_ 801 Cruise_State "0 = Normal, 1 = Hold+User Brake, 2 = Ready, 3 = Hold"; +CM_ SG_ 801 Far_Distance "1=0-5m, 2=5-10m, 3=10-15m, 4=15-20m, 5=20-25m, 6=25-30m, 7=30-35m, 8=35-40m, 9=40-45m, 10=45-50m, 11=50-55m, 12=55-60m, 13=60-65m, 14=65-70m, 15=75m+"; +CM_ SG_ 801 LKAS_State_Msg "1 = LKAS_Off_Sharp_Curve, 2 = Keep_Hands_On_Steering_wheel_disabled, 3 = LKAS_Off, 4 = LKAS_Off_Too_Slow, 5 = LKAS_Off_Too_Fast"; +CM_ SG_ 801 Cruise_State_Msg "1 = Cruise_Off_Steep_Slope, 2 = Cruise_lvl1_eco, 3 = Cruise_lvl2_comfort, 4 = Cruise_off_empty_reason, 5 = Cruise_off, 6 = Cruise_Unable_to_set, 7 = Cruise_Unable_to_set_brakes_applied, 8 = Eyesight_not_ready, 9 = Cruise_lvl3_standard, 10 = Cruise_lvl4_dynamic, 11 = Cruise_Unable_to_set_steep_slope"; +CM_ SG_ 801 Cruise_Soft_Disable "Eyesight soft disable (eg direct sunlight)"; +CM_ SG_ 801 Cruise_Status_Msg "1 = Disabled_Bad_Visibility, 2 = Disabled_Check_Manual"; +CM_ SG_ 802 LKAS_ACTIVE "Turns on the full LKAS dash display"; +CM_ SG_ 802 LKAS_Alert_Msg "1 = Keep_Hands_On_Wheel, 6 = Pre_Collision_Braking, 7 = Keep_Hands_On_Wheel_Off"; +CM_ SG_ 802 LKAS_Alert "1 = FCW_Cont_Beep, 2 = FCW_Repeated_Beep, 3 = Throttle_Management_Activated_Warning, 4 = Throttle_Management_Activated_Alert, 5 = Pre_Collision_Activated_Alert, 8 = Traffic_Light_Ahead, 9 = Apply_Brake_to_Hold Position, 11 = LDW_Right, 12 = LDW_Left, 13 = Stay_Alert, 14 = Lead_Vehicle_Start_Alert, 18 = Keep_Hands_On_Steering_Alert, 24 = Audio_Beep, 25 = Audio_Lead_Car_Change, 26 = Audio_ACC_Disengaged, 27 = Audio_LKAS_disabled, 28 = Audio_Ding_Ding, 30 = Audio_Repeated_Beep"; +CM_ SG_ 802 LKAS_Left_Line_Visible "0 = Off, 1 = White, 2 = Green, 3 = Orange"; +CM_ SG_ 802 LKAS_Dash_State "0 = Off, 1 = Ready, 2 = Active"; +CM_ SG_ 802 LKAS_Right_Line_Visible "0 = Off, 1 = White, 2 = Green, 3 = Orange"; +CM_ SG_ 912 UNITS "0 = Metric, 1 = Imperial"; +CM_ SG_ 912 ICY_ROAD "1 = DASHLIGHT ON, 2 = WARNING, 3 = OFF"; + +CM_ "subaru_global_2017.dbc starts here"; + +BO_ 72 Transmission: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Gear : 24|8@1+ (1,0) [0|255] "" XXX + SG_ RPM : 40|16@1+ (1,0) [0|65535] "" XXX + +BO_ 73 CVT: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ CVT_Gear : 24|8@1+ (1,0) [0|255] "" XXX + +BO_ 545 ES_Distance: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Signal1 : 12|3@1+ (1,0) [0|7] "" XXX + SG_ Cruise_Fault : 15|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Throttle : 16|12@1+ (1,0) [0|4095] "" XXX + SG_ Signal2 : 28|4@1+ (1,0) [0|15] "" XXX + SG_ Car_Follow : 32|1@1+ (1,0) [0|1] "" XXX + SG_ Signal3 : 33|3@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Brake_Active : 36|1@1+ (1,0) [0|1] "" XXX + SG_ Distance_Swap : 37|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_EPB : 38|1@1+ (1,0) [0|1] "" XXX + SG_ Signal4 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ Close_Distance : 40|8@1+ (1,0) [0|1] "" XXX + SG_ Signal5 : 48|8@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Cancel : 56|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Set : 57|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Resume : 58|1@1+ (1,0) [0|1] "" XXX + SG_ Signal6 : 59|5@1+ (1,0) [0|1] "" XXX + +BO_ 546 ES_Status: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Signal1 : 12|3@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Fault : 15|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_RPM : 16|12@1+ (1,0) [0|4095] "" XXX + SG_ Signal2 : 28|1@0+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 29|1@0+ (1,0) [0|1] "" XXX + SG_ Brake_Lights : 30|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Hold : 31|1@1+ (1,0) [0|1] "" XXX + SG_ Signal3 : 32|32@1+ (1,0) [0|1] "" XXX + +BO_ 576 CruiseControl: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Signal1 : 12|28@1+ (1,0) [0|268435455] "" XXX + SG_ Cruise_On : 40|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 41|1@1+ (1,0) [0|1] "" XXX + SG_ Signal2 : 42|22@1+ (1,0) [0|4194303] "" XXX + +CM_ SG_ 545 Cruise_Throttle "RPM-like output signal"; +CM_ SG_ 545 Cruise_EPB "1 = Electric Parking Brake set"; +CM_ SG_ 545 Distance_Swap "Switch from Close to Far distance"; +CM_ SG_ 546 Cruise_RPM "ES RPM output for ECM and TCM"; +CM_ SG_ 546 Signal3 "0 when cruise_activated = 1"; +VAL_ 72 Gear 2 "N" 3 "R" 4 "P" 121 "D" 137 "1" 145 "2" 153 "3" 161 "4" 169 "5" 177 "6"; diff --git a/opendbc/subaru_outback_2015_generated.dbc b/opendbc/subaru_outback_2015_generated.dbc new file mode 100644 index 000000000..a2fef697f --- /dev/null +++ b/opendbc/subaru_outback_2015_generated.dbc @@ -0,0 +1,279 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _subaru_preglobal_2015.dbc starts here"; +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX X + + +BO_ 2 Steering: 8 XXX + SG_ Steering_Angle : 7|16@0- (0.1,0) [-500|500] "degree" XXX + SG_ Counter : 27|3@0+ (1,0) [0|7] "" XXX + SG_ Checksum : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 208 G_Sensor: 8 XXX + SG_ Steering_Angle : 0|16@1- (-0.1,0) [-500|500] "" XXX + SG_ Lateral : 16|16@1- (-0.0035,1) [-255|255] "" XXX + SG_ Longitudinal : 48|16@1- (-0.00035,0) [-255|255] "" XXX + +BO_ 209 Brake_Pedal: 8 XXX + SG_ Speed : 0|16@1+ (0.05625,0) [0|255] "KPH" XXX + SG_ Brake_Pedal : 16|8@1+ (1,0) [0|255] "" XXX + +BO_ 210 Brake_2: 8 XXX + SG_ Brake_Light : 35|1@1+ (1,0) [0|1] "" XXX + SG_ Brake_Related : 36|1@1+ (1,0) [0|1] "" XXX + SG_ Right_Brake : 48|8@1+ (1,0) [0|255] "" XXX + SG_ Left_Brake : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 211 Brake_Type: 8 XXX + SG_ Brake_Light : 21|1@1+ (1,0) [0|1] "" XXX + SG_ Speed_Counter : 32|8@1+ (1,0) [0|255] "" XXX + SG_ Brake_Cruise_On : 42|1@1+ (1,0) [0|1] "" XXX + SG_ Brake_Pedal_On : 46|1@1+ (1,0) [0|1] "" XXX + SG_ Counter : 48|8@1+ (1,0) [0|255] "" XXX + +BO_ 212 Wheel_Speeds: 8 XXX + SG_ FL : 0|16@1+ (0.0592,0) [0|255] "KPH" XXX + SG_ FR : 16|16@1+ (0.0592,0) [0|255] "KPH" XXX + SG_ RL : 32|16@1+ (0.0592,0) [0|255] "KPH" XXX + SG_ RR : 48|16@1+ (0.0592,0) [0|255] "KPH" XXX + +BO_ 320 Throttle: 8 XXX + SG_ Throttle_Pedal : 0|8@1+ (0.392157,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Signal1 : 12|2@1+ (1,0) [0|7] "" XXX + SG_ Not_Full_Throttle : 14|1@1+ (1,0) [0|1] "" XXX + SG_ Signal2 : 15|1@1+ (1,0) [0|1] "" XXX + SG_ Engine_RPM : 16|14@1+ (1,0) [0|32767] "" XXX + SG_ Off_Throttle : 30|1@1+ (1,0) [0|1] "" XXX + SG_ Signal3 : 31|1@1+ (1,0) [0|1] "" XXX + SG_ Throttle_Cruise : 32|8@1+ (1,0) [0|255] "" XXX + SG_ Throttle_Combo : 40|8@1+ (1,0) [0|255] "" XXX + SG_ Throttle_Body : 48|8@1+ (1,0) [0|255] "" XXX + SG_ Off_Throttle_2 : 56|1@1+ (1,0) [0|1] "" XXX + SG_ Signal4 : 57|7@1+ (1,0) [0|127] "" XXX + +BO_ 321 Engine: 8 XXX + SG_ Engine_Torque : 0|15@1+ (1,0) [0|255] "" XXX + SG_ Engine_Stop : 15|1@1+ (1,0) [0|1] "" XXX + SG_ Wheel_Torque : 16|12@1+ (1,0) [0|4095] "" XXX + SG_ Engine_RPM : 32|12@1+ (1,0) [0|8191] "" XXX + +BO_ 324 CruiseControl: 8 XXX + SG_ OnOffButton : 2|1@1+ (1,0) [0|1] "" XXX + SG_ SET_BUTTON : 3|1@1+ (1,0) [0|1] "" XXX + SG_ RES_BUTTON : 4|1@1+ (1,0) [0|1] "" XXX + SG_ Button : 13|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_On : 48|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 49|1@1+ (1,0) [0|1] "" XXX + SG_ Brake_Pedal_On : 51|1@1+ (1,0) [0|1] "" XXX + +BO_ 328 Transmission: 8 XXX + SG_ Manual_Gear : 4|4@1+ (1,0) [0|15] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Transmission_Engine : 16|15@1+ (1,0) [0|65535] "" XXX + SG_ Gear : 48|4@1+ (1,0) [0|15] "" XXX + SG_ Gear_2 : 52|4@1+ (1,0) [0|15] "" XXX + SG_ Paddle_Shift : 60|2@1+ (1,0) [0|3] "" XXX + +BO_ 329 CVT_Ratio: 8 XXX + +BO_ 336 Brake_Pressure: 8 XXX + SG_ Brake_Pressure_Right : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Brake_Pressure_Left : 8|8@1+ (1,0) [0|255] "" XXX + +BO_ 338 Stalk: 8 XXX + SG_ Counter : 12|4@1+ (1,0) [0|15] "" XXX + SG_ Brake_Light : 52|1@1+ (1,0) [0|1] "" XXX + SG_ Runlights : 58|1@1+ (1,0) [0|1] "" XXX + SG_ Headlights : 59|1@1+ (1,0) [0|1] "" XXX + SG_ Highbeam : 60|1@1+ (1,0) [0|1] "" XXX + SG_ Wiper : 62|1@1+ (1,0) [0|1] "" XXX + +BO_ 352 ES_Brake: 8 XXX + SG_ Brake_Pressure : 0|16@1+ (1,0) [0|255] "" XXX + SG_ Brake_Light : 20|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Fault : 21|1@1+ (1,0) [0|1] "" XXX + SG_ Brake_On : 22|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 23|1@1+ (1,0) [0|1] "" XXX + SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX + SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 353 ES_Distance: 8 XXX + SG_ Cruise_Throttle : 0|12@1+ (1,0) [0|4095] "" XXX + SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX + SG_ Car_Follow : 16|1@1+ (1,0) [0|1] "" XXX + SG_ Signal2 : 17|3@1+ (1,0) [0|7] "" XXX + SG_ Brake_On : 20|1@1+ (1,0) [0|1] "" XXX + SG_ Distance_Swap : 21|1@1+ (1,0) [0|1] "" XXX + SG_ Standstill : 22|1@1+ (1,0) [0|1] "" XXX + SG_ Signal3 : 23|1@1+ (1,0) [0|1] "" XXX + SG_ Close_Distance : 24|8@1+ (0.0196,0) [0|255] "m" XXX + SG_ Signal4 : 32|9@1+ (1,0) [0|255] "" XXX + SG_ Standstill_2 : 41|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Fault : 42|1@1+ (1,0) [0|1] "" XXX + SG_ Signal5 : 43|1@1+ (1,0) [0|1] "" XXX + SG_ Counter : 44|3@1+ (1,0) [0|7] "" XXX + SG_ Signal6 : 47|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Button : 48|3@1+ (1,0) [0|7] "" XXX + SG_ Signal7 : 51|5@1+ (1,0) [0|31] "" XXX + SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 354 ES_RPM: 8 XXX + SG_ Brake : 8|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 9|1@1+ (1,0) [0|1] "" XXX + SG_ RPM : 16|16@1+ (1,0) [0|65535] "" XXX + SG_ Checksum : 32|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX + +BO_ 356 ES_LKAS: 8 XXX + SG_ Counter : 0|3@1+ (1,0) [0|7] "" XXX + SG_ LKAS_Command : 8|13@1- (-1,0) [-4096|4096] "" XXX + SG_ LKAS_Active : 24|1@1+ (1,0) [0|1] "" XXX + SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 359 ES_LDW: 8 XXX + SG_ All_depart_2015 : 0|1@1+ (1,0) [0|1] "" XXX + SG_ Right_Line_2017 : 24|1@1+ (1,0) [0|1] "" XXX + SG_ Left_Line_2017 : 25|1@1+ (1,0) [0|1] "" XXX + SG_ Sig1All_Depart : 28|1@1+ (1,0) [0|1] "" XXX + SG_ Sig2All_Depart : 31|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Inactive_2017 : 36|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Active : 37|1@1+ (1,0) [0|1] "" XXX + SG_ Sig1Right_Depart : 48|1@1+ (1,0) [0|1] "" XXX + SG_ Sig1Right_Depart_Front : 49|1@1+ (1,0) [0|1] "" XXX + SG_ Sig2Right_Depart : 50|1@1+ (1,0) [0|1] "" XXX + SG_ Left_Depart_Front : 51|1@1+ (1,0) [0|1] "" XXX + SG_ Sig3All_Depart : 52|1@1+ (1,0) [0|1] "" XXX + +BO_ 604 BSD_RCTA: 8 XXX + SG_ Counter : 0|3@1+ (1,0) [0|7] "" XXX + SG_ State : 5|1@1+ (1,0) [0|1] "" XXX + SG_ R_ADJACENT : 32|1@1+ (1,0) [0|1] "" XXX + SG_ L_ADJACENT : 33|1@1+ (1,0) [0|1] "" XXX + SG_ R_APPROACHING : 42|1@1+ (1,0) [0|1] "" XXX + SG_ L_APPROACHING : 43|1@1+ (1,0) [0|1] "" XXX + SG_ R_RCTA : 46|1@1+ (1,0) [0|1] "" XXX + SG_ L_RCTA : 47|1@1+ (1,0) [0|1] "" XXX + +BO_ 642 Dashlights: 8 XXX + SG_ Counter : 12|4@1+ (1,0) [0|15] "" XXX + SG_ SEATBELT_FL : 40|1@1+ (1,0) [0|1] "" XXX + SG_ LEFT_BLINKER : 44|1@1+ (1,0) [0|1] "" XXX + SG_ RIGHT_BLINKER : 45|1@1+ (1,0) [0|1] "" XXX + +BO_ 880 Steering_Torque_2: 8 XXX + SG_ Steering_Voltage_Flat : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Steer_Torque_Sensor : 29|11@1- (-1,0) [-1000|1000] "" XXX + SG_ Counter : 40|4@1+ (1,0) [0|15] "" XXX + +BO_ 884 BodyInfo: 8 XXX + SG_ DOOR_OPEN_FR : 24|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FL : 25|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 26|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 27|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_Hatch : 28|1@1+ (1,0) [0|1] "" XXX + +BO_ 864 Engine_Temp: 8 XXX + SG_ Oil_Temp : 16|8@1+ (1,-40) [0|255] "" XXX + SG_ Coolant_Temp : 24|8@1+ (1,-40) [0|255] "" XXX + SG_ Cruise_Activated : 45|1@1+ (1,0) [0|1] "" XXX + SG_ Saved_Speed : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 866 Fuel: 8 XXX + +BO_ 977 Dash_State2: 8 XXX + SG_ UNITS : 15|1@1+ (1,0) [0|1] "" XXX + +BO_ 1745 Dash_State: 8 XXX + SG_ Units : 15|1@1+ (1,0) [0|1] "" XXX + +CM_ SG_ 320 Off_Throttle_2 "Less sensitive"; +CM_ SG_ 320 Throttle_Body "Throttle related"; +CM_ SG_ 328 Gear "15 = P, 14 = R, 0 = N, 1-6=gear"; +CM_ SG_ 328 Gear_2 "15 = P, 14 = R, 0 = N, 1-6=gear"; +CM_ SG_ 353 Cruise_Button "1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 resume deep"; +CM_ SG_ 354 RPM "20hz version of Transmission_Engine under Transmission"; +CM_ SG_ 359 Sig1Right_Depart "right depart, hill steep and seatbelt disengage"; +CM_ SG_ 359 LKAS_Inactive_2017 "1 when not steering, 0 when lkas steering"; +CM_ SG_ 359 Sig1Right_Depart_Front "object in front, right depart, hill steep and seatbelt disengage alert "; +CM_ SG_ 359 Left_Depart_Front "warning after acceleration into car in front and left depart"; +CM_ SG_ 359 Sig1All_Depart "Left and right depart"; +CM_ SG_ 359 Sig2All_Depart "Left and right depart"; +CM_ SG_ 359 All_depart_2015 "always 1 on 2017"; +CM_ SG_ 604 R_APPROACHING "Faster car approaching in far right lane"; +CM_ SG_ 604 L_APPROACHING "Faster car approaching in far left lane"; +CM_ SG_ 604 R_RCTA "Rear cross traffic alert, only when in R gear"; +CM_ SG_ 604 L_RCTA "Rear cross traffic alert, only when in R gear"; +CM_ SG_ 642 Counter "Affected by signals"; +CM_ SG_ 642 SEATBELT_FL "Driver seatbelt"; +CM_ SG_ 880 Steering_Voltage_Flat "receives later than 371"; +CM_ SG_ 977 UNITS "0 = Metric, 1 = Imperial"; + +VAL_ 328 Gear 0 "N" 1 "D" 2 "D" 3 "D" 4 "D" 5 "D" 6 "D" 14 "R" 15 "P"; + +CM_ "subaru_outback_2015.dbc starts here"; + +BO_ 358 ES_DashStatus: 8 XXX + SG_ Not_Ready_Startup : 0|3@1+ (1,0) [0|7] "" XXX + SG_ Seatbelt_Disengage : 12|2@1+ (1,0) [0|3] "" XXX + SG_ Disengage_Alert : 14|2@1+ (1,0) [0|3] "" XXX + SG_ Cruise_On : 16|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 17|1@1+ (1,0) [0|1] "" XXX + SG_ Signal1 : 18|1@1+ (1,0) [0|1] "" XXX + SG_ WHEELS_MOVING_2015 : 19|1@1+ (1,0) [0|1] "" XXX + SG_ Driver_Input : 20|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Distance : 21|3@1+ (1,0) [0|7] "" XXX + SG_ Cruise_Set_Speed : 24|8@1+ (1,0) [0|255] "" XXX + SG_ Cruise_Fault : 32|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_On_2 : 34|1@1+ (1,0) [0|1] "" XXX + SG_ Counter : 37|3@1+ (1,0) [0|7] "" XXX + SG_ Steep_Hill_Disengage : 44|1@1+ (1,0) [0|3] "" XXX + SG_ Car_Follow : 46|1@1+ (1,0) [0|1] "" XXX + SG_ Far_Distance : 48|4@1+ (5,0) [0|15] "m" XXX + +BO_ 881 Steering_Torque: 8 XXX + SG_ Steering_Motor_Flat : 0|10@1+ (32,0) [0|1000] "" XXX + SG_ Steer_Torque_Output : 16|11@1- (-32,0) [-1000|1000] "" XXX + SG_ Steer_Error_1 : 27|1@1+ (1,0) [0|1] "" XXX + SG_ Steer_Torque_Sensor : 29|11@1- (1,0) [-1000|1000] "" XXX + SG_ Steering_Angle : 40|16@1- (-0.033,0) [-600|600] "" XXX + +CM_ SG_ 358 Disengage_Alert "seatbelt and steep hill disengage"; +CM_ SG_ 358 Cruise_Fault "No engagement until restart"; +CM_ SG_ 358 Car_Follow "lead car detected"; diff --git a/opendbc/subaru_outback_2019_generated.dbc b/opendbc/subaru_outback_2019_generated.dbc new file mode 100644 index 000000000..af6d7f416 --- /dev/null +++ b/opendbc/subaru_outback_2019_generated.dbc @@ -0,0 +1,279 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _subaru_preglobal_2015.dbc starts here"; +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX X + + +BO_ 2 Steering: 8 XXX + SG_ Steering_Angle : 7|16@0- (0.1,0) [-500|500] "degree" XXX + SG_ Counter : 27|3@0+ (1,0) [0|7] "" XXX + SG_ Checksum : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 208 G_Sensor: 8 XXX + SG_ Steering_Angle : 0|16@1- (-0.1,0) [-500|500] "" XXX + SG_ Lateral : 16|16@1- (-0.0035,1) [-255|255] "" XXX + SG_ Longitudinal : 48|16@1- (-0.00035,0) [-255|255] "" XXX + +BO_ 209 Brake_Pedal: 8 XXX + SG_ Speed : 0|16@1+ (0.05625,0) [0|255] "KPH" XXX + SG_ Brake_Pedal : 16|8@1+ (1,0) [0|255] "" XXX + +BO_ 210 Brake_2: 8 XXX + SG_ Brake_Light : 35|1@1+ (1,0) [0|1] "" XXX + SG_ Brake_Related : 36|1@1+ (1,0) [0|1] "" XXX + SG_ Right_Brake : 48|8@1+ (1,0) [0|255] "" XXX + SG_ Left_Brake : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 211 Brake_Type: 8 XXX + SG_ Brake_Light : 21|1@1+ (1,0) [0|1] "" XXX + SG_ Speed_Counter : 32|8@1+ (1,0) [0|255] "" XXX + SG_ Brake_Cruise_On : 42|1@1+ (1,0) [0|1] "" XXX + SG_ Brake_Pedal_On : 46|1@1+ (1,0) [0|1] "" XXX + SG_ Counter : 48|8@1+ (1,0) [0|255] "" XXX + +BO_ 212 Wheel_Speeds: 8 XXX + SG_ FL : 0|16@1+ (0.0592,0) [0|255] "KPH" XXX + SG_ FR : 16|16@1+ (0.0592,0) [0|255] "KPH" XXX + SG_ RL : 32|16@1+ (0.0592,0) [0|255] "KPH" XXX + SG_ RR : 48|16@1+ (0.0592,0) [0|255] "KPH" XXX + +BO_ 320 Throttle: 8 XXX + SG_ Throttle_Pedal : 0|8@1+ (0.392157,0) [0|255] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Signal1 : 12|2@1+ (1,0) [0|7] "" XXX + SG_ Not_Full_Throttle : 14|1@1+ (1,0) [0|1] "" XXX + SG_ Signal2 : 15|1@1+ (1,0) [0|1] "" XXX + SG_ Engine_RPM : 16|14@1+ (1,0) [0|32767] "" XXX + SG_ Off_Throttle : 30|1@1+ (1,0) [0|1] "" XXX + SG_ Signal3 : 31|1@1+ (1,0) [0|1] "" XXX + SG_ Throttle_Cruise : 32|8@1+ (1,0) [0|255] "" XXX + SG_ Throttle_Combo : 40|8@1+ (1,0) [0|255] "" XXX + SG_ Throttle_Body : 48|8@1+ (1,0) [0|255] "" XXX + SG_ Off_Throttle_2 : 56|1@1+ (1,0) [0|1] "" XXX + SG_ Signal4 : 57|7@1+ (1,0) [0|127] "" XXX + +BO_ 321 Engine: 8 XXX + SG_ Engine_Torque : 0|15@1+ (1,0) [0|255] "" XXX + SG_ Engine_Stop : 15|1@1+ (1,0) [0|1] "" XXX + SG_ Wheel_Torque : 16|12@1+ (1,0) [0|4095] "" XXX + SG_ Engine_RPM : 32|12@1+ (1,0) [0|8191] "" XXX + +BO_ 324 CruiseControl: 8 XXX + SG_ OnOffButton : 2|1@1+ (1,0) [0|1] "" XXX + SG_ SET_BUTTON : 3|1@1+ (1,0) [0|1] "" XXX + SG_ RES_BUTTON : 4|1@1+ (1,0) [0|1] "" XXX + SG_ Button : 13|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_On : 48|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 49|1@1+ (1,0) [0|1] "" XXX + SG_ Brake_Pedal_On : 51|1@1+ (1,0) [0|1] "" XXX + +BO_ 328 Transmission: 8 XXX + SG_ Manual_Gear : 4|4@1+ (1,0) [0|15] "" XXX + SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Transmission_Engine : 16|15@1+ (1,0) [0|65535] "" XXX + SG_ Gear : 48|4@1+ (1,0) [0|15] "" XXX + SG_ Gear_2 : 52|4@1+ (1,0) [0|15] "" XXX + SG_ Paddle_Shift : 60|2@1+ (1,0) [0|3] "" XXX + +BO_ 329 CVT_Ratio: 8 XXX + +BO_ 336 Brake_Pressure: 8 XXX + SG_ Brake_Pressure_Right : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Brake_Pressure_Left : 8|8@1+ (1,0) [0|255] "" XXX + +BO_ 338 Stalk: 8 XXX + SG_ Counter : 12|4@1+ (1,0) [0|15] "" XXX + SG_ Brake_Light : 52|1@1+ (1,0) [0|1] "" XXX + SG_ Runlights : 58|1@1+ (1,0) [0|1] "" XXX + SG_ Headlights : 59|1@1+ (1,0) [0|1] "" XXX + SG_ Highbeam : 60|1@1+ (1,0) [0|1] "" XXX + SG_ Wiper : 62|1@1+ (1,0) [0|1] "" XXX + +BO_ 352 ES_Brake: 8 XXX + SG_ Brake_Pressure : 0|16@1+ (1,0) [0|255] "" XXX + SG_ Brake_Light : 20|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Fault : 21|1@1+ (1,0) [0|1] "" XXX + SG_ Brake_On : 22|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 23|1@1+ (1,0) [0|1] "" XXX + SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX + SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 353 ES_Distance: 8 XXX + SG_ Cruise_Throttle : 0|12@1+ (1,0) [0|4095] "" XXX + SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX + SG_ Car_Follow : 16|1@1+ (1,0) [0|1] "" XXX + SG_ Signal2 : 17|3@1+ (1,0) [0|7] "" XXX + SG_ Brake_On : 20|1@1+ (1,0) [0|1] "" XXX + SG_ Distance_Swap : 21|1@1+ (1,0) [0|1] "" XXX + SG_ Standstill : 22|1@1+ (1,0) [0|1] "" XXX + SG_ Signal3 : 23|1@1+ (1,0) [0|1] "" XXX + SG_ Close_Distance : 24|8@1+ (0.0196,0) [0|255] "m" XXX + SG_ Signal4 : 32|9@1+ (1,0) [0|255] "" XXX + SG_ Standstill_2 : 41|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Fault : 42|1@1+ (1,0) [0|1] "" XXX + SG_ Signal5 : 43|1@1+ (1,0) [0|1] "" XXX + SG_ Counter : 44|3@1+ (1,0) [0|7] "" XXX + SG_ Signal6 : 47|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Button : 48|3@1+ (1,0) [0|7] "" XXX + SG_ Signal7 : 51|5@1+ (1,0) [0|31] "" XXX + SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 354 ES_RPM: 8 XXX + SG_ Brake : 8|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 9|1@1+ (1,0) [0|1] "" XXX + SG_ RPM : 16|16@1+ (1,0) [0|65535] "" XXX + SG_ Checksum : 32|8@1+ (1,0) [0|255] "" XXX + SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX + +BO_ 356 ES_LKAS: 8 XXX + SG_ Counter : 0|3@1+ (1,0) [0|7] "" XXX + SG_ LKAS_Command : 8|13@1- (-1,0) [-4096|4096] "" XXX + SG_ LKAS_Active : 24|1@1+ (1,0) [0|1] "" XXX + SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 359 ES_LDW: 8 XXX + SG_ All_depart_2015 : 0|1@1+ (1,0) [0|1] "" XXX + SG_ Right_Line_2017 : 24|1@1+ (1,0) [0|1] "" XXX + SG_ Left_Line_2017 : 25|1@1+ (1,0) [0|1] "" XXX + SG_ Sig1All_Depart : 28|1@1+ (1,0) [0|1] "" XXX + SG_ Sig2All_Depart : 31|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Inactive_2017 : 36|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Active : 37|1@1+ (1,0) [0|1] "" XXX + SG_ Sig1Right_Depart : 48|1@1+ (1,0) [0|1] "" XXX + SG_ Sig1Right_Depart_Front : 49|1@1+ (1,0) [0|1] "" XXX + SG_ Sig2Right_Depart : 50|1@1+ (1,0) [0|1] "" XXX + SG_ Left_Depart_Front : 51|1@1+ (1,0) [0|1] "" XXX + SG_ Sig3All_Depart : 52|1@1+ (1,0) [0|1] "" XXX + +BO_ 604 BSD_RCTA: 8 XXX + SG_ Counter : 0|3@1+ (1,0) [0|7] "" XXX + SG_ State : 5|1@1+ (1,0) [0|1] "" XXX + SG_ R_ADJACENT : 32|1@1+ (1,0) [0|1] "" XXX + SG_ L_ADJACENT : 33|1@1+ (1,0) [0|1] "" XXX + SG_ R_APPROACHING : 42|1@1+ (1,0) [0|1] "" XXX + SG_ L_APPROACHING : 43|1@1+ (1,0) [0|1] "" XXX + SG_ R_RCTA : 46|1@1+ (1,0) [0|1] "" XXX + SG_ L_RCTA : 47|1@1+ (1,0) [0|1] "" XXX + +BO_ 642 Dashlights: 8 XXX + SG_ Counter : 12|4@1+ (1,0) [0|15] "" XXX + SG_ SEATBELT_FL : 40|1@1+ (1,0) [0|1] "" XXX + SG_ LEFT_BLINKER : 44|1@1+ (1,0) [0|1] "" XXX + SG_ RIGHT_BLINKER : 45|1@1+ (1,0) [0|1] "" XXX + +BO_ 880 Steering_Torque_2: 8 XXX + SG_ Steering_Voltage_Flat : 0|8@1+ (1,0) [0|255] "" XXX + SG_ Steer_Torque_Sensor : 29|11@1- (-1,0) [-1000|1000] "" XXX + SG_ Counter : 40|4@1+ (1,0) [0|15] "" XXX + +BO_ 884 BodyInfo: 8 XXX + SG_ DOOR_OPEN_FR : 24|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FL : 25|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 26|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 27|1@1+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_Hatch : 28|1@1+ (1,0) [0|1] "" XXX + +BO_ 864 Engine_Temp: 8 XXX + SG_ Oil_Temp : 16|8@1+ (1,-40) [0|255] "" XXX + SG_ Coolant_Temp : 24|8@1+ (1,-40) [0|255] "" XXX + SG_ Cruise_Activated : 45|1@1+ (1,0) [0|1] "" XXX + SG_ Saved_Speed : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 866 Fuel: 8 XXX + +BO_ 977 Dash_State2: 8 XXX + SG_ UNITS : 15|1@1+ (1,0) [0|1] "" XXX + +BO_ 1745 Dash_State: 8 XXX + SG_ Units : 15|1@1+ (1,0) [0|1] "" XXX + +CM_ SG_ 320 Off_Throttle_2 "Less sensitive"; +CM_ SG_ 320 Throttle_Body "Throttle related"; +CM_ SG_ 328 Gear "15 = P, 14 = R, 0 = N, 1-6=gear"; +CM_ SG_ 328 Gear_2 "15 = P, 14 = R, 0 = N, 1-6=gear"; +CM_ SG_ 353 Cruise_Button "1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 resume deep"; +CM_ SG_ 354 RPM "20hz version of Transmission_Engine under Transmission"; +CM_ SG_ 359 Sig1Right_Depart "right depart, hill steep and seatbelt disengage"; +CM_ SG_ 359 LKAS_Inactive_2017 "1 when not steering, 0 when lkas steering"; +CM_ SG_ 359 Sig1Right_Depart_Front "object in front, right depart, hill steep and seatbelt disengage alert "; +CM_ SG_ 359 Left_Depart_Front "warning after acceleration into car in front and left depart"; +CM_ SG_ 359 Sig1All_Depart "Left and right depart"; +CM_ SG_ 359 Sig2All_Depart "Left and right depart"; +CM_ SG_ 359 All_depart_2015 "always 1 on 2017"; +CM_ SG_ 604 R_APPROACHING "Faster car approaching in far right lane"; +CM_ SG_ 604 L_APPROACHING "Faster car approaching in far left lane"; +CM_ SG_ 604 R_RCTA "Rear cross traffic alert, only when in R gear"; +CM_ SG_ 604 L_RCTA "Rear cross traffic alert, only when in R gear"; +CM_ SG_ 642 Counter "Affected by signals"; +CM_ SG_ 642 SEATBELT_FL "Driver seatbelt"; +CM_ SG_ 880 Steering_Voltage_Flat "receives later than 371"; +CM_ SG_ 977 UNITS "0 = Metric, 1 = Imperial"; + +VAL_ 328 Gear 0 "N" 1 "D" 2 "D" 3 "D" 4 "D" 5 "D" 6 "D" 14 "R" 15 "P"; + +CM_ "subaru_outback_2019.dbc starts here"; + +BO_ 358 ES_DashStatus: 8 XXX + SG_ Not_Ready_Startup : 0|3@1+ (1,0) [0|7] "" XXX + SG_ Seatbelt_Disengage : 12|2@1+ (1,0) [0|3] "" XXX + SG_ Disengage_Alert : 14|2@1+ (1,0) [0|3] "" XXX + SG_ Cruise_On : 16|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Activated : 17|1@1+ (1,0) [0|1] "" XXX + SG_ Signal1 : 18|1@1+ (1,0) [0|1] "" XXX + SG_ WHEELS_MOVING_2015 : 19|1@1+ (1,0) [0|1] "" XXX + SG_ Driver_Input : 20|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_Distance : 21|3@1+ (1,0) [0|7] "" XXX + SG_ Cruise_Set_Speed : 24|8@1+ (1,0) [0|255] "" XXX + SG_ Cruise_Fault : 32|1@1+ (1,0) [0|1] "" XXX + SG_ Cruise_On_2 : 34|1@1+ (1,0) [0|1] "" XXX + SG_ Counter : 37|3@1+ (1,0) [0|7] "" XXX + SG_ Steep_Hill_Disengage : 44|1@1+ (1,0) [0|3] "" XXX + SG_ Car_Follow : 46|1@1+ (1,0) [0|1] "" XXX + SG_ Far_Distance : 48|4@1+ (5,0) [0|15] "m" XXX + +BO_ 881 Steering_Torque: 8 XXX + SG_ Steering_Motor_Flat : 0|10@1+ (32,0) [0|1000] "" XXX + SG_ Steer_Torque_Output : 16|11@1- (-32,0) [-1000|1000] "" XXX + SG_ Steer_Error_1 : 27|1@1+ (1,0) [0|1] "" XXX + SG_ Steer_Torque_Sensor : 29|11@1- (-1,0) [-1000|1000] "" XXX + SG_ Steering_Angle : 40|16@1- (-0.033,0) [-600|600] "" XXX + +CM_ SG_ 358 Disengage_Alert "seatbelt and steep hill disengage"; +CM_ SG_ 358 Cruise_Fault "No engagement until restart"; +CM_ SG_ 358 Car_Follow "lead car detected"; diff --git a/opendbc/tesla_can.dbc b/opendbc/tesla_can.dbc new file mode 100644 index 000000000..923938dbe --- /dev/null +++ b/opendbc/tesla_can.dbc @@ -0,0 +1,1554 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: + NEO + MCU + GTW + EPAS + DI + ESP + SBW + STW + APP + DAS + iBooster + XXX + +VAL_TABLE_ StW_AnglHP_Spd 16383 "SNA" ; +VAL_TABLE_ DI_aebFaultReason 15 "DI_AEB_FAULT_DAS_REQ_DI_UNAVAIL" 14 "DI_AEB_FAULT_ACCEL_REQ_INVALID" 13 "DI_AEB_FAULT_MIN_TIME_BTWN_EVENTS" 12 "DI_AEB_FAULT_ESP_MIA" 11 "DI_AEB_FAULT_ESP_FAULT" 10 "DI_AEB_FAULT_EPB_NOT_PARKED" 9 "DI_AEB_FAULT_ACCEL_OUT_OF_BOUNDS" 8 "DI_AEB_FAULT_PM_REQUEST" 7 "DI_AEB_FAULT_VEL_EST_ABNORMAL" 6 "DI_AEB_FAULT_DAS_SNA" 5 "DI_AEB_FAULT_DAS_CONTROL_MIA" 4 "DI_AEB_FAULT_SPEED_DELTA" 3 "DI_AEB_FAULT_EBR_FAULT" 2 "DI_AEB_FAULT_PM_MIA" 1 "DI_AEB_FAULT_EPB_MIA" 0 "DI_AEB_FAULT_NONE" ; +VAL_TABLE_ DI_aebLockState 3 "AEB_LOCK_STATE_SNA" 2 "AEB_LOCK_STATE_UNUSED" 1 "AEB_LOCK_STATE_UNLOCKED" 0 "AEB_LOCK_STATE_LOCKED" ; +VAL_TABLE_ DI_aebSmState 7 "DI_AEB_STATE_FAULT" 6 "DI_AEB_STATE_EXIT" 5 "DI_AEB_STATE_STANDSTILL" 4 "DI_AEB_STATE_STOPPING" 3 "DI_AEB_STATE_ENABLE" 2 "DI_AEB_STATE_ENABLE_INIT" 1 "DI_AEB_STATE_STANDBY" 0 "DI_AEB_STATE_UNAVAILABLE" ; +VAL_TABLE_ DI_aebState 7 "AEB_CAN_STATE_SNA" 4 "AEB_CAN_STATE_FAULT" 3 "AEB_CAN_STATE_STANDSTILL" 2 "AEB_CAN_STATE_ENABLED" 1 "AEB_CAN_STATE_STANDBY" 0 "AEB_CAN_STATE_UNAVAILABLE" ; +VAL_TABLE_ DI_epbInterfaceReady 1 "EPB_INTERFACE_READY" 0 "EPB_INTERFACE_NOT_READY" ; +VAL_TABLE_ DI_gear 7 "DI_GEAR_SNA" 4 "DI_GEAR_D" 3 "DI_GEAR_N" 2 "DI_GEAR_R" 1 "DI_GEAR_P" 0 "DI_GEAR_INVALID" ; +VAL_TABLE_ DI_gpoReason 8 "DI_GPO_NUMREASONS" 7 "DI_GPO_CAPACITOR_OVERTEMP" 6 "DI_GPO_NOT_ENOUGH_12V" 5 "DI_GPO_NO_BATTERY_POWER" 4 "DI_GPO_AMBIENT_OVERTEMP" 3 "DI_GPO_FLUID_DELTAT" 2 "DI_GPO_STATOR_OVERTEMP" 1 "DI_GPO_HEATSINK_OVERTEMP" 0 "DI_GPO_OUTLET_OVERTEMP" ; +VAL_TABLE_ DI_immobilizerCondition 1 "DI_IMM_CONDITION_LEARNED" 0 "DI_IMM_CONDITION_VIRGIN_SNA" ; +VAL_TABLE_ DI_immobilizerState 7 "DI_IMM_STATE_FAULT" 6 "DI_IMM_STATE_FAULTRETRY" 5 "DI_IMM_STATE_RESET" 4 "DI_IMM_STATE_LEARN" 3 "DI_IMM_STATE_DISARMED" 2 "DI_IMM_STATE_AUTHENTICATING" 1 "DI_IMM_STATE_REQUEST" 0 "DI_IMM_STATE_INIT_SNA" ; +VAL_TABLE_ DI_limpReason 24 "DI_LIMP_NUMREASONS" 23 "DI_LIMP_CAPACITOR_OVERTEMP" 22 "DI_LIMP_GTW_MIA" 21 "DI_LIMP_TRQCMD_VALIDITY_UNKNOWN" 20 "DI_LIMP_DI_MIA" 19 "DI_LIMP_CONFIG_MISMATCH" 18 "DI_LIMP_HEATSINK_TEMP" 17 "DI_LIMP_PMREQUEST" 16 "DI_LIMP_PMHEARTBEAT" 15 "DI_LIMP_TRQ_CROSS_CHECK" 14 "DI_LIMP_EXTERNAL_COMMAND" 13 "DI_LIMP_WRONG_CS_CALIBRATION" 12 "DI_LIMP_STATOR_TEMP" 11 "DI_LIMP_DELTAT_TOO_NEGATIVE" 10 "DI_LIMP_DELTAT_TOO_POSITIVE" 9 "DI_LIMP_AMBIENT_TEMP" 8 "DI_LIMP_OUTLET_TEMP" 7 "DI_LIMP_LOW_FLOW" 6 "DI_LIMP_BMS_MIA" 5 "DI_LIMP_12V_SUPPLY_UNDERVOLTAGE" 4 "DI_LIMP_NO_FLUID" 3 "DI_LIMP_NO_FUNC_HEATSINK_SENSOR" 2 "DI_LIMP_NO_FUNC_STATORT_SENSOR" 1 "DI_LIMP_BUSV_SENSOR_IRRATIONAL" 0 "DI_LIMP_PHASE_IMBALANCE" ; +VAL_TABLE_ DI_mode 2 "DI_MODE_DYNO" 1 "DI_MODE_DRIVE" 0 "DI_MODE_UNDEF" ; +VAL_TABLE_ DI_motorType 14 "DI_MOTOR_F2AE" 13 "DI_MOTOR_F2AD" 12 "DI_MOTOR_F2AC" 11 "DI_MOTOR_F2AB" 10 "DI_MOTOR_F1AC" 9 "DI_MOTOR_SSR1A" 8 "DI_MOTOR_F1A" 7 "DI_MOTOR_M7M6" 6 "DI_MOTOR_M8A" 5 "DI_MOTOR_M7M5" 4 "DI_MOTOR_M7M4" 3 "DI_MOTOR_M7M3" 2 "DI_MOTOR_ROADSTER_SPORT" 1 "DI_MOTOR_ROADSTER_BASE" 0 "DI_MOTOR_SNA" ; +VAL_TABLE_ DI_speedUnits 1 "DI_SPEED_KPH" 0 "DI_SPEED_MPH" ; +VAL_TABLE_ DI_state 4 "DI_STATE_ENABLE" 3 "DI_STATE_FAULT" 2 "DI_STATE_CLEAR_FAULT" 1 "DI_STATE_STANDBY" 0 "DI_STATE_PREAUTH" ; +VAL_TABLE_ DI_velocityEstimatorState 4 "VE_STATE_BACKUP_MOTOR" 3 "VE_STATE_BACKUP_WHEELS_B" 2 "VE_STATE_BACKUP_WHEELS_A" 1 "VE_STATE_WHEELS_NORMAL" 0 "VE_STATE_NOT_INITIALIZED" ; +VAL_TABLE_ DAS_DepartureWarning 3 "SNA" 2 "RIGHT_WARNING" 1 "LEFT_WARNING" 0 "NONE" ; +VAL_TABLE_ DAS_LaneDepartureWarningStatus 3 "DEGRADED" 2 "FAILED" 1 "INACTIVE" 0 "ACTIVE" ; +VAL_TABLE_ DAS_LaneTypeColor 15 "SNA" 14 "INVALID_YELLOW" 13 "BOTTS_DOTS_YELLOW" 12 "DOUBLE_LANE_YELLOW" 11 "ROAD_EDGE_YELLOW" 10 "UNDECIDED_YELLOW" 9 "SOLID_YELLOW" 8 "DASHED_YELLOW" 6 "INVALID" 5 "BOTTS_DOTS" 4 "DOUBLE_LANE" 3 "ROAD_EDGE" 2 "UNDECIDED" 1 "SOLID" 0 "DASHED" ; +VAL_TABLE_ DAS_NM_keepAwakeReason 2 "DAS_KEEPAWAKE_REASON_TELEMETRY" 1 "DAS_KEEPAWAKE_REASON_PRECONDITIONING" 0 "DAS_KEEPAWAKE_REASON_NONE_SNA" ; +VAL_TABLE_ DAS_SignType 255 "E_INVALID_SIGN" 254 "NO_SIGN_DETECTED" 221 "STANDARD_ELECTR_END_OF_NO_PASSING" 220 "STANDARD_ELECTR_NO_PASSING_START" 201 "REGULAR_END_OF_NO_PASSING" 200 "REGULAR_NO_PASSING_START" 176 "REGULAR_END_OF_PLAYGROUND_AREA" 175 "REGULAR_PLAYGROUND_AREA_BEGIN" 174 "STANDARD_REGULAR_END_OF_EXPRESSWAY" 173 "STANDARD_REGULAR_EXPRESSWAY_BEGIN" 172 "STANDARD_REGULAR_END_OF_MOTORWAY" 171 "STANDARD_REGULAR_MOTORWAY_BEGIN" 129 "STANDARD_ELECTRONIC_145" 128 "STANDARD_ELECTRONIC_135" 127 "STANDARD_ELECTRONIC_125" 126 "STANDARD_ELECTRONIC_115" 125 "STANDARD_ELECTRONIC_105" 124 "STANDARD_ELECTRONIC_95" 123 "STANDARD_ELECTRONIC_85" 122 "STANDARD_ELECTRONIC_75" 121 "STANDARD_ELECTRONIC_65" 120 "STANDARD_ELECTRONIC_55" 119 "STANDARD_ELECTRONIC_45" 118 "STANDARD_ELECTRONIC_35" 117 "STANDARD_ELECTRONIC_25" 116 "STANDARD_ELECTRONIC_15" 115 "STANDARD_ELECTRONIC_5" 114 "STANDARD_REGULAR_145" 113 "STANDARD_REGULAR_135" 112 "STANDARD_REGULAR_125" 111 "STANDARD_REGULAR_115" 110 "STANDARD_REGULAR_105" 109 "STANDARD_REGULAR_95" 108 "STANDARD_REGULAR_85" 107 "STANDARD_REGULAR_75" 106 "STANDARD_REGULAR_65" 105 "STANDARD_REGULAR_55" 104 "STANDARD_REGULAR_45" 103 "STANDARD_REGULAR_35" 102 "STANDARD_REGULAR_25" 101 "STANDARD_REGULAR_15" 100 "STANDARD_REGULAR_5" 65 "ELECTRIC_GEN_END_ALL_RESTRICTION" 64 "REGULAR_GEN_END_ALL_RESTRICT" 50 "ELECTRONIC_END_OF_NUM_RESTRICT" 41 "STANDARD_ELECTRONIC_140" 40 "STANDARD_ELECTRONIC_130" 39 "STANDARD_ELECTRONIC_120" 38 "STANDARD_ELECTRONIC_110" 37 "STANDARD_ELECTRONIC_100" 36 "STANDARD_ELECTRONIC_90" 35 "STANDARD_ELECTRONIC_80" 34 "STANDARD_ELECTRONIC_70" 33 "STANDARD_ELECTRONIC_60" 32 "STANDARD_ELECTRONIC_50" 31 "STANDARD_ELECTRONIC_40" 30 "STANDARD_ELECTRONIC_30" 29 "STANDARD_ELECTRONIC_20" 28 "STANDARD_ELECTRONIC_10" 20 "STANDARD_END_OF_NUM_RESTRICTION" 13 "STANDARD_REGULAR_140" 12 "STANDARD_REGULAR_130" 11 "STANDARD_REGULAR_120" 10 "STANDARD_REGULAR_110" 9 "STANDARD_REGULAR_100" 8 "STANDARD_REGULAR_90" 7 "STANDARD_REGULAR_80" 6 "STANDARD_REGULAR_70" 5 "STANDARD_REGULAR_60" 4 "STANDARD_REGULAR_50" 3 "STANDARD_REGULAR_40" 2 "STANDARD_REGULAR_30" 1 "STANDARD_REGULAR_20" 0 "STANDARD_REGULAR_10" ; +VAL_TABLE_ DAS_SteeringAngleRequest 16384 "ZERO_ANGLE" ; +VAL_TABLE_ DAS_aebEvent 3 "AEB_SNA" 2 "AEB_FAULT" 1 "AEB_ACTIVE" 0 "AEB_NOT_ACTIVE" ; +VAL_TABLE_ DAS_csa_internal_state 4 "CSA_INTERNAL_STATE_ENABLE_HOLD" 3 "CSA_INTERNAL_STATE_ENABLE_ACCELEROMETER" 2 "CSA_INTERNAL_STATE_ENABLE_PREDICTED" 1 "CSA_INTERNAL_STATE_AVAILABLE" 0 "CSA_INTERNAL_STATE_UNAVAILABLE" ; +VAL_TABLE_ DAS_eyeqAlert 3 "a003_eyeq_watchdog_reset" 2 "a002_eyeq_communication_timeout" 1 "a001_eyeq_boot_failure" ; +VAL_TABLE_ DAS_hazardLightRequest 3 "DAS_REQUEST_HAZARDS_SNA" 2 "DAS_REQUEST_HAZARDS_UNUSED" 1 "DAS_REQUEST_HAZARDS_ON" 0 "DAS_REQUEST_HAZARDS_OFF" ; +VAL_TABLE_ DAS_headlightRequest 3 "DAS_HEADLIGHT_REQUEST_INVALID" 1 "DAS_HEADLIGHT_REQUEST_ON" 0 "DAS_HEADLIGHT_REQUEST_OFF" ; +VAL_TABLE_ DAS_highLowBeamDecision 3 "DAS_HIGH_BEAM_SNA" 2 "DAS_HIGH_BEAM_ON" 1 "DAS_HIGH_BEAM_OFF" 0 "DAS_HIGH_BEAM_UNDECIDED" ; +VAL_TABLE_ DAS_highLowBeamOffReason 5 "HIGH_BEAM_OFF_REASON_SNA" 4 "HIGH_BEAM_OFF_REASON_HEAD_LIGHT" 3 "HIGH_BEAM_OFF_REASON_AMBIENT_LIGHT" 2 "HIGH_BEAM_OFF_REASON_MOVING_RADAR_TARGET" 1 "HIGH_BEAM_OFF_REASON_MOVING_VISION_TARGET" 0 "HIGH_BEAM_ON" ; +VAL_TABLE_ DAS_infoIndex 255 "DAS_INFO_END" 24 "DAS_INFO_EYEQ_FFS" 23 "DAS_INFO_EYEQ_APP" 20 "DAS_INFO_UDS_PROTOCOL_BOOTCRC" 19 "DAS_INFO_VERSION_DEPRECATED" 18 "DAS_INFO_BOOTLOADER_GITHASH" 17 "DAS_INFO_APP_GITHASH" 16 "DAS_INFO_EYEQ_BOOT" 15 "DAS_INFO_BOOTLOADER_CRC" 14 "DAS_INFO_BOOTLOADER_SVN" 13 "DAS_INFO_APP_CRC" 11 "DAS_INFO_PCBAID_ASSYID_USAGEID" 10 "DAS_INFO_BUILD_HWID_COMPONENTID" 9 "DAS_INFO_DEPRECATED_9" 8 "DAS_INFO_DEPRECATED_8" 7 "DAS_INFO_DEPRECATED_7" 6 "DAS_INFO_DEPRECATED_6" 5 "DAS_INFO_DEPRECATED_5" 4 "DAS_INFO_DEPRECATED_4" 3 "DAS_INFO_DEPRECATED_3" 2 "DAS_INFO_DEPRECATED_2" 1 "DAS_INFO_DEPRECATED_1" 0 "DAS_INFO_DEPRECATED_0" ; +VAL_TABLE_ DAS_locMode 3 "DAS_LOC_DRIVERLESS" 2 "DAS_LOC_RESTRICTED" 1 "DAS_LOC_NORMAL" 0 "DAS_LOC_OFF" ; +VAL_TABLE_ DAS_locRequest 4 "DAS_RQ_PARK" 3 "DAS_RQ_HOLD" 2 "DAS_RQ_BACKWARD" 1 "DAS_RQ_FORWARD" 0 "DAS_RQ_IDLE" ; +VAL_TABLE_ DAS_locState 7 "DAS_LOC_FAULT_SNA" 6 "DAS_LOC_AEB_ACTIVE" 2 "DAS_LOC_CANCEL_SILENT" 1 "DAS_LOC_CANCEL_GENERIC" 0 "DAS_LOC_HEALTHY" ; +VAL_TABLE_ DAS_steeringLKAOperatingStatus 3 "Not_available" 2 "Not_used" 1 "Operating" 0 "Inhibited" ; +VAL_TABLE_ DAS_sw019_020_taskID 5 "TASKS_VEHICLE" 4 "TASKS_MOBILEYE" 3 "TASKS_UDS" 2 "TASKS_CAN" 1 "TASKS_INIT" 0 "TASKS_RESERVED" ; +VAL_TABLE_ DAS_sw021_tempSensorId 4 "DDR_TEMP_SENSOR" 3 "CAMERA_TEMP_SENSOR" 2 "EYE_Q_TEMP_SENSOR_1" 1 "EYE_Q_TEMP_SENSOR_0" 0 "EXTERNAL_TEMP_SENSOR" ; +VAL_TABLE_ DAS_sw022_operation 4 "Erase All" 3 "Delete" 2 "Read" 1 "Write" 0 "Initialize" ; +VAL_TABLE_ DAS_sw024_heaterState 2 "SHORT" 1 "OPEN" 0 "NORMAL" ; +VAL_TABLE_ DAS_sw037_issue 1 "Invalid parameters" 0 "Failed to read" ; +VAL_TABLE_ DAS_sw043_mesp_health_main_state 172 "EYEQ_MESP_MAIN_STATE_TAC2" 170 "EYEQ_MESP_MAIN_STATE_DV" 146 "EYEQ_MESP_MAIN_STATE_VISION_INIT_PENDING" 133 "EYEQ_MESP_MAIN_STATE_TAC2_INIT_PENDING" 130 "EYEQ_MESP_MAIN_STATE_SPC_INIT_PENDING" 129 "EYEQ_MESP_MAIN_STATE_SPTAC_INIT_PENDING" 34 "EYEQ_MESP_MAIN_STATE_SPC" 33 "EYEQ_MESP_MAIN_STATE_SPTAC" 2 "EYEQ_MESP_MAIN_STATE_VISION" ; +VAL_TABLE_ DAS_sw043_mobileye_status 24 "MOBILEYE_STATUS_UNDEFINED" 23 "MOBILEYE_STATUS_TEARDOWN_FLASH_ACCESS_MODE" 22 "MOBILEYE_STATUS_FLASH_READ_MODE" 21 "MOBILEYE_STATUS_SETUP_FLASH_ACCESS_MODE" 20 "MOBILEYE_STATUS_RUNNING_SPTAC_MODE" 19 "MOBILEYE_STATUS_SPTAC_INIT_SENT" 18 "MOBILEYE_STATUS_WAITING_FOR_SPTAC_INIT" 17 "MOBILEYE_STATUS_BURN_EDR_MODE" 16 "MOBILEYE_STATUS_SPC_INIT_SENT" 15 "MOBILEYE_STATUS_WAITING_FOR_SPC_INIT" 14 "MOBILEYE_STATUS_ERROR" 13 "MOBILEYE_STATUS_LATCHING_FAILURE" 12 "MOBILEYE_STATUS_UPDATING" 11 "MOBILEYE_STATUS_RUNNING_DV_MODE" 10 "MOBILEYE_STATUS_WAITING_FOR_DV" 9 "MOBILEYE_STATUS_RUNNING_TAC_MODE" 8 "MOBILEYE_STATUS_RUNNING_SPC_MODE" 7 "MOBILEYE_STATUS_RUNNING_VISION_MODE" 6 "MOBILEYE_STATUS_TAC_INIT_SENT" 5 "MOBILEYE_STATUS_WAITING_FOR_TAC_INIT" 4 "MOBILEYE_STATUS_VISION_INIT_SENT" 3 "MOBILEYE_STATUS_WAITING_FOR_VISION_INIT" 2 "MOBILEYE_STATUS_WAITING_FOR_BOOT" 1 "MOBILEYE_STATUS_POWER_OFF" 0 "MOBILEYE_STATUS_POWER_CYCLE" ; +VAL_TABLE_ DAS_turnIndicatorRequest 3 "DAS_TURN_INDICATOR_CANCEL" 2 "DAS_TURN_INDICATOR_RIGHT" 1 "DAS_TURN_INDICATOR_LEFT" 0 "DAS_TURN_INDICATOR_NONE" ; +VAL_TABLE_ DAS_turnIndicatorRequestReason 6 "DAS_ACTIVE_COMMANDED_LANE_CHANGE" 5 "DAS_CANCEL_FORK" 4 "DAS_CANCEL_LANE_CHANGE" 3 "DAS_ACTIVE_FORK" 2 "DAS_ACTIVE_SPEED_LANE_CHANGE" 1 "DAS_ACTIVE_NAV_LANE_CHANGE" 0 "DAS_NONE" ; +VAL_TABLE_ DAS_wiperSpeed 15 "DAS_WIPER_SPEED_INVALID" 14 "DAS_WIPER_SPEED_14" 13 "DAS_WIPER_SPEED_13" 12 "DAS_WIPER_SPEED_12" 11 "DAS_WIPER_SPEED_11" 10 "DAS_WIPER_SPEED_10" 9 "DAS_WIPER_SPEED_9" 8 "DAS_WIPER_SPEED_8" 7 "DAS_WIPER_SPEED_7" 6 "DAS_WIPER_SPEED_6" 5 "DAS_WIPER_SPEED_5" 4 "DAS_WIPER_SPEED_4" 3 "DAS_WIPER_SPEED_3" 2 "DAS_WIPER_SPEED_2" 1 "DAS_WIPER_SPEED_1" 0 "DAS_WIPER_SPEED_OFF" ; + +BO_ 3 STW_ANGL_STAT: 8 STW + SG_ StW_Angl : 5|14@0+ (0.5,-2048) [0|0] "deg" NEO + SG_ StW_AnglSpd : 21|14@0+ (0.5,-2048) [0|0] "/s" NEO + SG_ StW_AnglSens_Stat : 33|2@0+ (1,0) [-1|4] "" NEO + SG_ StW_AnglSens_Id : 35|2@0+ (1,0) [3|3] "" NEO + SG_ MC_STW_ANGL_STAT : 55|4@0+ (1,0) [0|15] "" NEO + SG_ CRC_STW_ANGL_STAT : 63|8@0+ (1,0) [0|255] "" NEO + +BO_ 14 STW_ANGLHP_STAT: 8 STW + SG_ StW_AnglHP : 5|14@0+ (0.1,-819.2) [-819.2|819] "deg" NEO + SG_ StW_AnglHP_Spd : 21|14@0+ (0.5,-4096) [-4096|4095.5] "deg/s" NEO + SG_ StW_AnglHP_Sens_Stat : 33|2@0+ (1,0) [0|0] "" NEO + SG_ StW_AnglHP_Sens_Id : 35|2@0+ (1,0) [0|0] "" NEO + SG_ MC_STW_ANGLHP_STAT : 55|4@0+ (1,0) [0|15] "" NEO + SG_ CRC_STW_ANGLHP_STAT : 63|8@0+ (1,0) [0|0] "" NEO + +BO_ 69 STW_ACTN_RQ: 8 XXX + SG_ SpdCtrlLvr_Stat : 0|6@1+ (1,0) [0|0] "" XXX + SG_ VSL_Enbl_Rq : 6|1@1+ (1,0) [0|0] "" XXX + SG_ SpdCtrlLvrStat_Inv : 7|1@1+ (1,0) [0|0] "" XXX + SG_ DTR_Dist_Rq : 8|8@1+ (1,0) [0|200] "" XXX + SG_ TurnIndLvr_Stat : 16|2@1+ (1,0) [0|0] "" XXX + SG_ HiBmLvr_Stat : 18|2@1+ (1,0) [0|0] "" XXX + SG_ WprWashSw_Psd : 20|2@1+ (1,0) [0|0] "" XXX + SG_ WprWash_R_Sw_Posn_V2 : 22|2@1+ (1,0) [0|0] "" XXX + SG_ StW_Lvr_Stat : 24|3@1+ (1,0) [0|0] "" XXX + SG_ StW_Cond_Flt : 27|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Cond_Psd : 28|2@1+ (1,0) [0|0] "" XXX + SG_ HrnSw_Psd : 30|2@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw00_Psd : 32|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw01_Psd : 33|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw02_Psd : 34|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw03_Psd : 35|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw04_Psd : 36|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw05_Psd : 37|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw06_Psd : 38|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw07_Psd : 39|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw08_Psd : 40|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw09_Psd : 41|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw10_Psd : 42|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw11_Psd : 43|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw12_Psd : 44|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw13_Psd : 45|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw14_Psd : 46|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw15_Psd : 47|1@1+ (1,0) [0|0] "" XXX + SG_ WprSw6Posn : 48|3@1+ (1,0) [0|0] "" XXX + SG_ MC_STW_ACTN_RQ : 52|4@1+ (1,0) [0|15] "" XXX + SG_ CRC_STW_ACTN_RQ : 56|8@1+ (1,0) [0|0] "" XXX + +BO_ 104 MCU_locationStatus2: 8 XXX + SG_ MCU_elevation : 0|32@1- (0.1,0) [0|0] "m" XXX + SG_ MCU_navigonExpectedSpeed : 32|7@1+ (1,0) [0|126] "mph" XXX + +BO_ 109 SBW_RQ_SCCM: 4 XXX + SG_ StW_Sw_Stat3 : 0|3@1+ (1,0) [0|0] "" XXX + SG_ MsgTxmtId : 6|2@1+ (1,0) [0|0] "" XXX + SG_ TSL_RND_Posn_StW : 8|4@1+ (1,0) [0|0] "" XXX + SG_ TSL_P_Psd_StW : 12|2@1+ (1,0) [0|0] "" XXX + SG_ MC_SBW_RQ_SCCM : 20|4@1+ (1,0) [0|15] "" XXX + SG_ CRC_SBW_RQ_SCCM : 24|8@1+ (1,0) [0|0] "" XXX + +BO_ 257 GTW_epasControl: 3 NEO + SG_ GTW_epasControlChecksum : 23|8@0+ (1,0) [0|255] "" NEO + SG_ GTW_epasControlCounter : 11|4@0+ (1,0) [0|15] "" NEO + SG_ GTW_epasControlType : 15|2@0+ (1,0) [-1|4] "" NEO + SG_ GTW_epasEmergencyOn : 7|1@0+ (1,0) [-1|2] "" NEO + SG_ GTW_epasLDWEnabled : 12|1@0+ (1,0) [-1|2] "" NEO + SG_ GTW_epasPowerMode : 6|4@0+ (1,0) [4|14] "" NEO + SG_ GTW_epasTuneRequest : 2|3@0+ (1,0) [-1|8] "" NEO + +BO_ 264 DI_torque1: 8 DI + SG_ DI_torqueDriver : 0|13@1- (0.25,0) [-750|750] "Nm" NEO + SG_ DI_torque1Counter : 13|3@1+ (1,0) [0|0] "" NEO + SG_ DI_torqueMotor : 16|13@1- (0.25,0) [-750|750] "Nm" NEO + SG_ DI_soptState : 29|3@1+ (1,0) [0|0] "" NEO + SG_ DI_motorRPM : 32|16@1- (1,0) [-17000|17000] "RPM" NEO + SG_ DI_pedalPos : 48|8@1+ (0.4,0) [0|100] "%" NEO + SG_ DI_torque1Checksum : 56|8@1+ (1,0) [0|0] "" NEO + +BO_ 280 DI_torque2: 6 DI + SG_ DI_torqueEstimate : 0|12@1- (0.5,0) [-750|750] "Nm" NEO + SG_ DI_gear : 12|3@1+ (1,0) [0|0] "" NEO + SG_ DI_brakePedal : 15|1@1+ (1,0) [0|0] "" NEO + SG_ DI_vehicleSpeed : 16|12@1+ (0.05,-25) [-25|179.75] "MPH" NEO + SG_ DI_gearRequest : 28|3@1+ (1,0) [0|0] "" NEO + SG_ DI_torqueInterfaceFailure : 31|1@1+ (1,0) [0|0] "" NEO + SG_ DI_torque2Counter : 32|4@1+ (1,0) [0|0] "" NEO + SG_ DI_brakePedalState : 36|2@1+ (1,0) [0|0] "" NEO + SG_ DI_epbParkRequest : 38|1@1+ (1,0) [0|0] "" NEO + SG_ DI_epbInterfaceReady : 39|1@1+ (1,0) [0|0] "" NEO + SG_ DI_torque2Checksum : 40|8@1+ (1,0) [0|0] "" NEO + +BO_ 309 ESP_135h: 5 ESP + SG_ ESP_135hChecksum : 23|8@0+ (1,0) [0|255] "" NEO + SG_ ESP_135hCounter : 11|4@0+ (1,0) [0|15] "" NEO + SG_ ESP_absBrakeEvent : 2|1@0+ (1,0) [-1|2] "" NEO + SG_ ESP_brakeDiscWipingActive : 4|1@0+ (1,0) [-1|2] "" NEO + SG_ ESP_brakeLamp : 3|1@0+ (1,0) [-1|2] "" NEO + SG_ ESP_espFaultLamp : 6|1@0+ (1,0) [-1|2] "" NEO + SG_ ESP_espLampFlash : 7|1@0+ (1,0) [-1|2] "" NEO + SG_ ESP_hillStartAssistActive : 1|2@0+ (1,0) [-1|4] "" NEO + SG_ ESP_messagePumpService : 24|1@0+ (1,0) [0|1] "" NEO + SG_ ESP_messagePumpFailure : 25|1@0+ (1,0) [0|1] "" NEO + SG_ ESP_messageEBDFailure : 26|1@0+ (1,0) [0|1] "" NEO + SG_ ESP_absFaultLamp : 27|1@0+ (1,0) [-1|2] "" NEO + SG_ ESP_tcDisabledByFault : 28|1@0+ (1,0) [0|1] "" NEO + SG_ ESP_messageDynoModeActive : 29|1@0+ (1,0) [0|1] "" NEO + SG_ ESP_hydraulicBoostEnabled : 30|1@0+ (1,0) [0|1] "" NEO + SG_ ESP_espOffLamp : 31|1@0+ (1,0) [-1|2] "" NEO + SG_ ESP_stabilityControlSts : 14|3@0+ (1,0) [6|7] "" NEO + SG_ ESP_tcLampFlash : 5|1@0+ (1,0) [-1|2] "" NEO + SG_ ESP_tcOffLamp : 15|1@0+ (1,0) [0|1] "" NEO + +BO_ 341 ESP_B: 8 ESP + SG_ ESP_BChecksum : 39|8@0+ (1,0) [0|255] "" NEO,EPAS + SG_ ESP_BCounter : 62|4@0+ (1,0) [1|15] "" NEO,EPAS + SG_ ESP_vehicleSpeed : 47|16@0+ (0.00999999978,0) [0|0] "kph" NEO,EPAS + SG_ ESP_vehicleSpeedQF : 57|2@0+ (1,0) [1|2] "" NEO,EPAS + SG_ ESP_wheelPulseCountFrL : 7|8@0+ (1,0) [0|254] "" NEO,EPAS + SG_ ESP_wheelPulseCountFrR : 15|8@0+ (1,0) [0|254] "" NEO,EPAS + SG_ ESP_wheelPulseCountReL : 23|8@0+ (1,0) [0|254] "" NEO,EPAS + SG_ ESP_wheelPulseCountReR : 31|8@0+ (1,0) [0|254] "" NEO,EPAS + +BO_ 513 SDM1: 5 GTW + SG_ SDM_bcklPassStatus : 3|2@0+ (1,0) [0|3] "" NEO + SG_ SDM_bcklDrivStatus : 5|2@0+ (1,0) [0|3] "" NEO + +BO_ 521 DAS_longControl: 8 XXX + SG_ DAS_locMode : 0|2@1+ (1,0) [0|0] "" XXX + SG_ DAS_locState : 2|3@1+ (1,0) [0|0] "" XXX + SG_ DAS_locRequest : 5|3@1+ (1,0) [0|0] "" XXX + SG_ DAS_locJerkMin : 8|8@1+ (0.034,-8.67) [-8.67|0] "m/s^3" XXX + SG_ DAS_locJerkMax : 16|8@1+ (0.034,0) [0|8.67] "m/s^3" XXX + SG_ DAS_locSpeed : 24|11@1+ (0.1,0) [0|204.7] "kph" XXX + SG_ DAS_locAccelMin : 35|9@1+ (0.04,-15) [-15|5.44] "m/s^2" XXX + SG_ DAS_locAccelMax : 44|9@1+ (0.04,-15) [-15|5.44] "m/s^2" XXX + SG_ DAS_longControlCounter : 53|3@1+ (1,0) [0|0] "" XXX + SG_ DAS_longControlChecksum : 56|8@1+ (1,0) [0|0] "" XXX + +BO_ 522 BrakeMessage: 8 XXX + SG_ driverBrakeStatus : 2|2@1+ (1,0) [0|3] "" XXX + +BO_ 529 RCM_status: 8 RCM + SG_ RCM_driverOrientationInitStatus : 2|3@0+ (1,0) [0|7] "" GTW,OCS + SG_ RCM_armStatus : 5|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_warningIndicatorState : 7|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_tellTalePassengerState : 9|2@0+ (1,0) [0|3] "" GTW,OCS,DAS + SG_ RCM_bucklePassengerStatus : 11|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_tellTaleDriverState : 13|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_buckleDriverStatus : 15|2@0+ (1,0) [0|3] "" GTW,OCS,DAS + SG_ RCM_seatTrackPositionDrvr : 19|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_passAirbagRequest : 21|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_chimeState1stRow : 23|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_vinLearnFlag : 25|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_hwConfigPin58 : 27|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_hwConfigPin57 : 29|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_hwConfigPin56 : 31|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_passOccupantStatus : 33|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_airbagCutoffSwStatus : 35|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_privateCANStatus : 37|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_publicCANStatus : 39|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_edr2State : 45|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_edr1State : 47|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_buckle2ndRowStatus : 50|3@0+ (1,0) [0|3] "" GTW,OCS,DAS + SG_ RCM_statusCounter : 55|4@0+ (1,0) [0|15] "" GTW,OCS,DAS + SG_ RCM_statusChecksum : 63|8@0+ (1,0) [0|255] "" GTW,OCS,DAS + +BO_ 532 EPB_epasControl: 3 EPB + SG_ EPB_epasControlChecksum : 23|8@0+ (1,0) [0|255] "" XXX + SG_ EPB_epasControlCounter : 11|4@0+ (1,0) [0|15] "" XXX + SG_ EPB_epasEACAllow : 2|3@0+ (1,0) [4|7] "" XXX + +BO_ 536 MCU_chassisControl: 8 XXX + SG_ MCU_dasDebugEnable : 0|1@1+ (1,0) [0|0] "" XXX + SG_ MCU_parkBrakeRequest : 1|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_trailerModeCH : 3|1@1+ (1,0) [0|0] "" XXX + SG_ MCU_fcwSensitivity : 4|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_fcwEnable : 6|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_latControlEnable : 8|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_accOvertakeEnable : 10|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_ldwEnable : 12|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_aebEnable : 14|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_bsdEnable : 16|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_ahlbEnable : 18|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_parkSetting : 20|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_pedalSafetyEnable : 22|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_frontDefrostReq_das : 24|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_autoParkRequest : 26|4@1+ (1,0) [0|0] "" XXX + SG_ MCU_redLightStopSignEnable : 30|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_enableCreepTorqueCH : 32|1@1+ (1,0) [0|0] "" XXX + SG_ MCU_narrowGarages : 33|1@1+ (1,0) [0|0] "" XXX + SG_ MCU_rebootAutopilot : 34|1@1+ (1,0) [0|0] "" XXX + SG_ MCU_enableAutowipers : 35|1@1+ (1,0) [0|0] "" XXX + SG_ MCU_overPaintedUSS : 38|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_selfParkTune : 40|4@1+ (1,0) [0|15] "" XXX + SG_ MCU_towModeEnable : 44|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_zeroSpeedConfirmed : 46|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_aesEnable : 48|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_autoLaneChangeEnable : 50|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_chassisControlCounter : 52|4@1+ (1,0) [0|0] "" XXX + SG_ MCU_chassisControlChecksum : 56|8@1+ (1,0) [0|0] "" XXX + +BO_ 537 DAS_pscControl: 3 DAS + SG_ DAS_pscControlCounter : 0|4@1+ (1,0) [0|15] "" PARK,APS + SG_ DAS_pscParkState : 4|4@1+ (1,0) [0|15] "" PARK,EPB,APS + SG_ DAS_eacState : 8|3@1+ (1,0) [0|3] "" PARK,APS + SG_ DAS_pscControlChecksum : 16|8@1+ (1,0) [0|255] "" PARK,APS + +BO_ 568 UI_driverAssistRoadSign: 8 XXX + SG_ UI_roadSign M : 0|8@1+ (1,0) [0|0] "" XXX + SG_ UI_splineLocConfidence : 40|7@1+ (1,0) [0|100] "" XXX + SG_ UI_splineID : 48|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ UI_roadSignCounter : 52|4@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_roadSignChecksum : 56|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_dummyData m0 : 8|1@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_stopSignStopLineDist m1 : 8|10@1+ (0.25,-8) [-8|247.5] "m" Vector__XXX + SG_ UI_stopSignStopLineConf m1 : 18|7@1+ (1,0) [0|100] "" Vector__XXX + SG_ UI_trafficLightStopLineDist m2 : 8|10@1+ (0.25,-8) [-8|247.5] "m" Vector__XXX + SG_ UI_trafficLightStopLineConf m2 : 18|7@1+ (1,0) [0|100] "" Vector__XXX + SG_ UI_baseMapSpeedLimitMPS m3 : 8|8@1+ (0.25,0) [0|63.75] "m/s" XXX + SG_ UI_bottomQrtlFleetSpeedMPS m3 : 16|8@1+ (0.25,0) [0|63.75] "m/s" XXX + SG_ UI_topQrtlFleetSpeedMPS m3 : 24|8@1+ (0.25,0) [0|63.75] "m/s" XXX + SG_ UI_meanFleetSplineSpeedMPS m4 : 8|8@1+ (0.25,0) [0|63.75] "m/s" XXX + SG_ UI_medianFleetSpeedMPS m4 : 16|8@1+ (0.25,0) [0|63.75] "m/s" XXX + SG_ UI_meanFleetSplineAccelMPS2 m4 : 24|8@1+ (0.05,-6.35) [-6.35|6.4] "m/s^2" XXX + SG_ UI_rampType m4 : 32|3@1+ (1,0) [0|7] "" XXX + SG_ UI_currSplineIdFull m5 : 8|32@1+ (1,0) [0|1] "" XXX + +BO_ 569 DAS_lanes: 8 XXX + SG_ DAS_leftLaneExists : 0|1@1+ (1,0) [0|0] "" XXX + SG_ DAS_rightLaneExists : 1|1@1+ (1,0) [0|0] "" XXX + SG_ DAS_virtualLaneWidth : 4|4@1+ (0.3125,2) [2|7] "m" XXX + SG_ DAS_virtualLaneViewRange : 8|8@1+ (1,0) [0|160] "m" XXX + SG_ DAS_virtualLaneC0 : 16|8@1+ (0.035,-3.5) [-3.5|3.5] "m" XXX + SG_ DAS_virtualLaneC1 : 24|8@1+ (0.0016,-0.2) [-0.2|0.2] "rad" XXX + SG_ DAS_virtualLaneC2 : 32|8@1+ (2E-05,-0.0025) [-0.0025|0.0025] "m-1" XXX + SG_ DAS_virtualLaneC3 : 40|8@1+ (2.4E-07,-3E-05) [-3E-05|3E-05] "m-2" XXX + SG_ DAS_leftLineUsage : 48|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_rightLineUsage : 50|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_leftFork : 52|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_rightFork : 54|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_lanesCounter : 60|4@1+ (1,0) [0|0] "" XXX + +BO_ 582 UI_solarData: 5 XXX + SG_ UI_solarAzimuthAngle : 0|16@1- (1,0) [0|360] "deg" XXX + SG_ UI_solarAzimuthAngleCarRef : 16|9@1- (1,0) [-180|180] "deg" XXX + SG_ UI_isSunUp : 25|1@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_solarElevationAngle : 32|8@1- (1,0) [-90|90] "deg" XXX + +BO_ 643 BODY_R1: 8 XXX + SG_ AirTemp_Insd : 47|8@0+ (0.25,0) [0|63.5] "C" XXX + SG_ AirTemp_Outsd : 63|8@0+ (0.5,-40) [-40|86.5] "C" XXX + SG_ Bckl_Sw_RL_Stat_SAM_R : 49|2@0+ (1,0) [-1|4] "" XXX + SG_ Bckl_Sw_RM_Stat_SAM_R : 53|2@0+ (1,0) [-1|4] "" XXX + SG_ Bckl_Sw_RR_Stat_SAM_R : 51|2@0+ (1,0) [-1|4] "" XXX + SG_ DL_RLtch_Stat : 9|2@0+ (1,0) [-1|4] "" XXX + SG_ DrRLtch_FL_Stat : 1|2@0+ (1,0) [-1|4] "" XXX + SG_ DrRLtch_FR_Stat : 3|2@0+ (1,0) [-1|4] "" XXX + SG_ DrRLtch_RL_Stat : 5|2@0+ (1,0) [-1|4] "" XXX + SG_ DrRLtch_RR_Stat : 7|2@0+ (1,0) [-1|4] "" XXX + SG_ EngHd_Stat : 11|2@0+ (1,0) [-1|4] "" XXX + SG_ LoBm_On_Rq : 32|1@0+ (1,0) [0|1] "" XXX + SG_ HiBm_On : 33|1@0+ (1,0) [0|1] "" XXX + SG_ Hrn_On : 26|1@0+ (1,0) [0|1] "" XXX + SG_ IrLmp_D_Lt_Flt : 34|1@0+ (1,0) [0|1] "" XXX + SG_ IrLmp_P_Rt_Flt : 35|1@0+ (1,0) [0|1] "" XXX + SG_ LgtSens_Twlgt : 18|3@0+ (1,0) [0|7] "Steps" XXX + SG_ LgtSens_SNA : 19|1@0+ (1,0) [0|1] "" XXX + SG_ LgtSens_Tunnel : 20|1@0+ (1,0) [0|1] "" XXX + SG_ LgtSens_Flt : 21|1@0+ (1,0) [0|1] "" XXX + SG_ LgtSens_Night : 22|1@0+ (1,0) [-1|2] "" XXX + SG_ ADL_LoBm_On_Rq : 23|1@0+ (1,0) [0|1] "" XXX + SG_ LoBm_D_Lt_Flt : 36|1@0+ (1,0) [0|1] "" XXX + SG_ LoBm_P_Rt_Flt : 37|1@0+ (1,0) [0|1] "" XXX + SG_ MPkBrk_Stat : 28|1@0+ (1,0) [-1|2] "" XXX + SG_ RevGr_Engg : 39|2@0+ (1,0) [-1|4] "" XXX + SG_ StW_Cond_Stat : 55|2@0+ (1,0) [-1|4] "" XXX + SG_ Term54_Actv : 27|1@0+ (1,0) [0|1] "" XXX + SG_ Trlr_Stat : 25|2@0+ (1,0) [-1|4] "" XXX + SG_ VTA_Alm_Actv : 13|1@0+ (1,0) [0|1] "" XXX + SG_ WprOutsdPkPosn : 29|1@0+ (1,0) [0|1] "" XXX + +BO_ 696 UI_radarMapData: 8 XXX + SG_ UI_radarTargetDx : 0|8@1+ (1,-95) [-95|160] "m" XXX + SG_ UI_radarTargetDxEnd : 8|8@1+ (1,0) [0|255] "m" XXX + SG_ UI_radarTargetTrustMap : 16|1@1+ (1,0) [0|1] "" XXX + SG_ UI_radarEnableBraking : 17|1@1+ (1,0) [0|1] "" XXX + SG_ UI_radarMapDataCounter : 52|4@1+ (1,0) [0|0] "" XXX + SG_ UI_radarMapDataChecksum : 56|8@1+ (1,0) [0|0] "" XXX + +BO_ 697 DAS_control: 8 NEO + SG_ DAS_setSpeed : 0|12@1+ (0.1,0) [0|409.4] "kph" NEO + SG_ DAS_accState : 12|4@1+ (1,0) [0|0] "" NEO + SG_ DAS_aebEvent : 16|2@1+ (1,0) [0|3] "" NEO + SG_ DAS_jerkMin : 18|9@1+ (0.03,-15.232) [-15.232|0.098] "m/s^3" NEO + SG_ DAS_jerkMax : 27|8@1+ (0.059,0) [0|15.045] "m/s^3" NEO + SG_ DAS_accelMin : 35|9@1+ (0.04,-15) [-15|5.44] "m/s^2" NEO + SG_ DAS_accelMax : 44|9@1+ (0.04,-15) [-15|5.44] "m/s^2" NEO + SG_ DAS_controlCounter : 53|3@1+ (1,0) [0|0] "" NEO + SG_ DAS_controlChecksum : 56|8@1+ (1,0) [0|0] "" NEO + +BO_ 712 UI_roadCurvature: 8 XXX + SG_ UI_roadCurvC0 : 0|11@1- (0.02,0) [-20.48|20.46] "m" XXX + SG_ UI_roadCurvC1 : 11|10@1- (0.00075,0) [-0.384|0.38325] "1" XXX + SG_ UI_roadCurvC2 : 21|14@1- (7.5E-06,0) [-0.03072|0.03071625] "1/m" XXX + SG_ UI_roadCurvC3 : 35|13@1- (3E-08,0) [-0.00012288|0.00012285] "1/m2" XXX + SG_ UI_roadCurvRange : 48|6@1+ (4,0) [0|252] "m" XXX + SG_ UI_roadCurvHealth : 54|2@1+ (1,0) [0|0] "" XXX + SG_ UI_roadCurvChecksum : 56|8@1+ (1,0) [0|0] "" Vector__XXX + +BO_ 728 UI_csaOfframpCurvature: 8 XXX + SG_ UI_csaOfframpCurvC2 : 0|16@1- (1E-06,0) [-0.032768|0.032767] "1/m" XXX + SG_ UI_csaOfframpCurvC3 : 16|16@1- (4E-09,0) [-0.000131072|0.000131068] "1/m2" XXX + SG_ UI_csaOfframpCurvRange : 32|8@1+ (2,0) [0|510] "m" XXX + SG_ UI_csaOfframpCurvCounter : 40|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ UI_csaOfframpCurvUsingTspline : 48|1@1+ (1,0) [0|1] "" XXX + SG_ UI_csaOfframpCurvReserved : 49|7@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_csaOfframpCurvChecksum : 56|8@1+ (1,0) [0|0] "" Vector__XXX + +BO_ 744 UI_csaRoadCurvature: 8 XXX + SG_ UI_csaRoadCurvC2 : 0|16@1- (1E-06,0) [-0.032768|0.032767] "1/m" XXX + SG_ UI_csaRoadCurvC3 : 16|16@1- (4E-09,0) [-0.000131072|0.000131068] "1/m2" XXX + SG_ UI_csaRoadCurvRange : 32|8@1+ (2,0) [0|510] "m" XXX + SG_ UI_csaRoadCurvCounter : 40|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ UI_csaRoadCurvUsingTspline : 48|1@1+ (1,0) [0|1] "" XXX + SG_ UI_csaRoadCurvReserved : 49|7@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_csaRoadCurvChecksum : 56|8@1+ (1,0) [0|0] "" Vector__XXX + +BO_ 760 UI_gpsVehicleSpeed: 8 XXX + SG_ UI_gpsHDOP : 0|8@1+ (0.1,0) [0|25.5] "1" XXX + SG_ UI_gpsVehicleHeading : 8|16@1+ (0.0078125,0) [0|511.9921875] "deg" XXX + SG_ UI_gpsVehicleSpeed : 24|16@1+ (0.00390625,0) [0|250.996] "km/hr" Vector__XXX + SG_ UI_userSpeedOffset : 40|6@1+ (1,-30) [-30|33] "kph/mph" XXX + SG_ UI_mapSpeedLimitUnits : 46|1@1+ (1,0) [0|1] "" XXX + SG_ UI_userSpeedOffsetUnits : 47|1@1+ (1,0) [0|1] "" XXX + SG_ UI_mppSpeedLimit : 48|5@1+ (5,0) [0|155] "kph/mph" XXX + SG_ UI_gpsNmeaMIA : 53|1@1+ (1,0) [0|0] "" XXX + +BO_ 777 DAS_object: 8 XXX + SG_ DAS_objectId : 0|3@1+ (1,0) [0|7] "" XXX + SG_ DAS_leadVehType : 3|3@1+ (1,0) [0|7] "" XXX + SG_ DAS_leadVehRelevantForControl : 7|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_leadVehDx : 8|8@1+ (0.5,0) [0|127] "m" XXX + SG_ DAS_leadVehVxRel : 16|4@1+ (4,-30) [-30|26] "m/s" XXX + SG_ DAS_leadVehDy : 20|7@1+ (0.35,-22.05) [-22.05|22.4] "m" XXX + SG_ DAS_leadVehId : 27|7@1+ (1,0) [0|126] "" XXX + SG_ DAS_leadVeh2Type : 34|3@1+ (1,0) [0|7] "" XXX + SG_ DAS_leadVeh2RelevantForControl : 38|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_leadVeh2Dx : 39|8@1+ (0.5,0) [0|127] "m" XXX + SG_ DAS_leadVeh2VxRel : 47|4@1+ (4,-30) [-30|26] "m/s" XXX + SG_ DAS_leadVeh2Dy : 51|7@1+ (0.35,-22.05) [-22.05|22.4] "m" XXX + SG_ DAS_leadVeh2Id : 58|6@1+ (1,0) [0|63] "" XXX + +BO_ 782 PARK_status2: 8 PARK + SG_ PARK_frontSVACharID : 0|6@1+ (1,0) [0|63] "" DAS,GTW + SG_ PARK_pscRightCurbType : 6|2@1+ (1,0) [0|3] "" DAS,GTW + SG_ PARK_rearSVACharID : 8|6@1+ (1,0) [0|63] "" DAS,GTW + SG_ PARK_pscLeftCurbType : 14|2@1+ (1,0) [0|3] "" DAS,GTW + SG_ PARK_autoCalComplete : 16|1@1+ (1,0) [0|1] "" DAS,GTW + SG_ PARK_geometryType : 17|2@1+ (1,0) [0|3] "" GTW + SG_ PARK_tireFitment : 19|2@1+ (1,0) [0|3] "" DAS,GTW + SG_ PARK_rackDetected : 21|2@1+ (1,0) [0|3] "" DAS,GTW + SG_ PARK_sdiActive : 24|1@1+ (1,0) [0|1] "" DAS,GTW + SG_ PARK_sdiNoise : 25|2@1+ (1,0) [0|3] "" DAS,GTW + SG_ PARK_sdiBlindSpotRight : 27|2@1+ (1,0) [0|3] "" DAS,GTW + SG_ PARK_sdiBlindSpotLeft : 29|2@1+ (1,0) [0|3] "" DAS,GTW + SG_ PARK_status2Counter : 52|4@1+ (1,0) [0|0] "" GTW,DAS + SG_ PARK_status2Checksum : 56|8@1+ (1,0) [0|0] "" GTW + +BO_ 792 GTW_carState: 8 XXX + SG_ YEAR : 0|7@1+ (1,2000) [2000|2127] "Year" XXX + SG_ CERRD : 7|1@1+ (1,0) [0|1] "" XXX + SG_ MONTH : 8|4@1+ (1,0) [1|12] "Month" XXX + SG_ DOOR_STATE_FL : 12|2@1+ (1,0) [0|3] "" XXX + SG_ DOOR_STATE_FR : 14|2@1+ (1,0) [0|3] "" XXX + SG_ SECOND : 16|6@1+ (1,0) [0|59] "s" XXX + SG_ DOOR_STATE_RL : 22|2@1+ (1,0) [0|3] "" XXX + SG_ Hour : 24|5@1+ (1,0) [0|23] "h" XXX + SG_ DOOR_STATE_RR : 29|2@1+ (1,0) [0|3] "" XXX + SG_ DAY : 32|5@1+ (1,0) [0|31] "" XXX + SG_ MINUTE : 40|6@1+ (1,0) [0|59] "min" XXX + SG_ BOOT_STATE : 46|2@1+ (1,0) [0|3] "" XXX + SG_ GTW_updateInProgress : 48|2@1+ (1,0) [0|3] "" XXX + SG_ DOOR_STATE_FrontTrunk : 50|2@1+ (1,0) [0|3] "" XXX + SG_ MCU_factoryMode : 52|1@1+ (1,0) [0|1] "" XXX + SG_ MCU_transportModeOn : 53|1@0+ (1,0) [0|1] "" XXX + SG_ BC_headLightLStatus : 55|2@0+ (1,0) [0|3] "" XXX + SG_ BC_headLightRStatus : 57|2@0+ (1,0) [0|3] "" XXX + SG_ BC_indicatorLStatus : 59|2@0+ (1,0) [0|3] "" XXX + SG_ BC_indicatorRStatus : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 824 UI_status: 8 XXX + SG_ UI_touchActive : 0|1@1+ (1,0) [0|0] "" IC + SG_ UI_audioActive : 1|1@1+ (1,0) [0|0] "" IC + SG_ UI_bluetoothActive : 2|1@1+ (1,0) [0|0] "" IC + SG_ UI_cellActive : 3|1@1+ (1,0) [0|0] "" IC + SG_ UI_displayReady : 4|1@1+ (1,0) [0|0] "" IC + SG_ UI_gpsActive : 5|1@1+ (1,0) [0|0] "" IC + SG_ UI_wifiConnected : 6|1@1+ (1,0) [0|0] "" IC,XXX + SG_ UI_systemActive : 7|1@1+ (1,0) [0|0] "" IC + SG_ UI_xmActive : 8|1@1+ (1,0) [0|0] "" IC + SG_ UI_displayOn : 9|1@1+ (1,0) [0|0] "" IC,XXX + SG_ UI_readyForDrive : 10|1@1+ (1,0) [0|0] "" IC + SG_ UI_cellConnected : 11|1@1+ (1,0) [0|0] "" IC,XXX + SG_ UI_vpnActive : 12|1@1+ (1,0) [0|0] "" IC,XXX + SG_ UI_wifiActive : 13|1@1+ (1,0) [0|0] "" IC + SG_ UI_cameraActive : 14|1@1+ (1,0) [0|0] "" IC,XXX + SG_ UI_usbActive : 15|1@1+ (1,0) [0|0] "" IC + SG_ UI_screenshotActive : 16|1@1+ (1,0) [0|0] "" IC,XXX + SG_ UI_monitorModemPower : 17|1@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_factoryReset : 18|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ UI_cellNetworkTechnology : 20|4@1+ (1,0) [0|15] "" XXX + SG_ UI_tegraCoreTemperature : 24|8@1+ (1,-64) [0|0] "deg C" IC + SG_ UI_tegraAmbientTemperature : 32|8@1+ (1,-64) [0|0] "deg C" IC + SG_ UI_googleWifiUsages : 40|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_autopilotTrial : 48|2@1+ (1,0) [0|0] "" XXX + SG_ UI_cellSignalBars : 50|3@1+ (1,0) [0|7] "" XXX + SG_ UI_hardwareType : 53|2@1+ (1,0) [0|3] "" XXX + SG_ UI_developmentCar : 55|1@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_cellReceiverPower : 56|8@1+ (1,-128) [-128|127] "dB" XXX + +BO_ 840 GTW_status: 8 XXX + SG_ GTW_accGoingDown : 6|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_accRailReq : 8|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_brakePressed : 1|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_driveGoingDown : 7|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_driveRailReq : 0|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_driverIsLeaving : 5|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_driverPresent : 2|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_hvacGoingDown : 11|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_hvacRailReq : 9|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_icPowerOff : 4|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_notEnough12VForDrive : 3|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_preconditionRequest : 10|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_statusChecksum : 63|8@0+ (1,0) [0|255] "" XXX + SG_ GTW_statusCounter : 51|4@0+ (1,0) [0|15] "" XXX + +BO_ 872 DI_state: 8 DI + SG_ DI_systemState : 0|3@1+ (1,0) [0|0] "" NEO + SG_ DI_vehicleHoldState : 3|3@1+ (1,0) [0|0] "" NEO + SG_ DI_proximity : 6|1@1+ (1,0) [0|0] "" NEO + SG_ DI_driveReady : 7|1@1+ (1,0) [0|0] "" NEO + SG_ DI_regenLight : 8|1@1+ (1,0) [0|0] "" NEO + SG_ DI_state : 9|3@1+ (1,0) [0|0] "" NEO + SG_ DI_cruiseState : 12|4@1+ (1,0) [0|0] "" NEO + SG_ DI_analogSpeed : 16|12@1+ (0.1,0) [0|150] "speed" NEO + SG_ DI_immobilizerState : 28|3@1+ (1,0) [0|0] "" NEO + SG_ DI_speedUnits : 31|1@1+ (1,0) [0|1] "" NEO + SG_ DI_digitalSpeed : 32|8@1+ (1,0) [0|255.5] "speed" NEO + SG_ DI_aebState : 41|3@1+ (1,0) [0|0] "" NEO + SG_ DI_stateCounter : 44|4@1+ (1,0) [0|0] "" NEO + SG_ DI_cruiseSet : 48|8@1+ (1,0) [0|250] "" NEO + SG_ DI_stateChecksum : 56|8@1+ (1,0) [0|0] "" NEO + +BO_ 880 EPAS_sysStatus: 8 EPAS + SG_ EPAS_currentTuneMode : 7|4@0+ (1,0) [8|15] "" NEO + SG_ EPAS_eacErrorCode : 23|4@0+ (1,0) [-1|16] "" NEO + SG_ EPAS_eacStatus : 55|3@0+ (1,0) [5|7] "" NEO + SG_ EPAS_handsOnLevel : 39|2@0+ (1,0) [-1|4] "" NEO + SG_ EPAS_internalSAS : 37|14@0+ (0.1,-819.200012) [0|0] "deg" NEO + SG_ EPAS_steeringFault : 2|1@0+ (1,0) [-1|2] "" NEO + SG_ EPAS_steeringRackForce : 1|10@0+ (50,-25575) [0|0] "N" NEO + SG_ EPAS_steeringReduced : 3|1@0+ (1,0) [-1|2] "" NEO + SG_ EPAS_sysStatusChecksum : 63|8@0+ (1,0) [0|255] "" NEO + SG_ EPAS_sysStatusCounter : 51|4@0+ (1,0) [0|15] "" NEO + SG_ EPAS_torsionBarTorque : 19|12@0+ (0.01,-20.5) [0|0] "Nm" NEO + +BO_ 904 MCU_clusterBacklightRequest: 3 XXX + SG_ MCU_clusterBacklightOn : 7|1@1+ (1,0) [0|1] "" XXX + SG_ MCU_clusterBrightnessLevel : 8|8@1+ (0.5,0) [0|127.5] "%" XXX + SG_ MCU_clusterReadyForDrive : 6|1@1+ (1,0) [-1|2] "" XXX + SG_ MCU_clusterReadyForPowerOff : 5|1@1+ (1,0) [0|1] "" XXX + +BO_ 905 DAS_status2: 8 XXX + SG_ DAS_accSpeedLimit : 0|10@1+ (0.2,0) [0|204.6] "mph" GTW,APS + SG_ DAS_pmmObstacleSeverity : 10|3@1+ (1,0) [0|7] "" GTW,APS + SG_ DAS_pmmLoggingRequest : 13|1@1+ (1,0) [0|1] "" GTW,APS + SG_ DAS_activationFailureStatus : 14|2@1+ (1,0) [0|1] "" GTW,APS + SG_ DAS_pmmUltrasonicsFaultReason : 16|3@1+ (1,0) [0|7] "" GTW,APS + SG_ DAS_pmmRadarFaultReason : 19|2@1+ (1,0) [0|3] "" GTW,APS + SG_ DAS_pmmSysFaultReason : 21|3@1+ (1,0) [0|7] "" GTW,APS + SG_ DAS_pmmCameraFaultReason : 24|2@1+ (1,0) [0|3] "" GTW,APS + SG_ DAS_ACC_report : 26|5@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_relaxCruiseLimits : 31|1@1+ (1,0) [0|0] "" GTW,APS,APP + SG_ DAS_csaState : 32|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_radarTelemetry : 34|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_robState : 36|2@1+ (1,0) [0|3] "" GTW,APS + SG_ DAS_driverInteractionLevel : 38|2@1+ (1,0) [0|3] "" GTW,APS + SG_ DAS_ppOffsetDesiredRamp : 40|8@1+ (0.01,-1.28) [-1.28|1.27] "m" GTW,APS + SG_ DAS_longCollisionWarning : 48|4@1+ (1,0) [0|15] "" GTW,APS + SG_ DAS_status2Counter : 52|4@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_status2Checksum : 56|8@1+ (1,0) [0|0] "" GTW,APS + +BO_ 920 GTW_carConfig: 8 XXX + SG_ GTW_performanceConfig : 2|3@0+ (1,0) [0|0] "" XXX + SG_ GTW_fourWheelDrive : 4|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_unknown1 : 5|1@0+ (1,0) [0|0] "" XXX + SG_ GTW_dasHw : 7|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_parkAssistInstalled : 9|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_forwardRadarHw : 11|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_airSuspensionInstalled : 14|3@0+ (1,0) [0|0] "" XXX + SG_ GTW_unknown2 : 15|1@0+ (1,0) [0|0] "" XXX + SG_ GTW_country : 23|16@0+ (1,0) [0|0] "" XXX + SG_ GTW_parkSensorGeometryType : 33|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_rhd : 34|1@0+ (1,0) [0|0] "" XXX + SG_ GTW_bodyControlsType : 35|1@0+ (1,0) [0|0] "" XXX + SG_ GTW_radarPosition : 39|4@0+ (1,0) [0|0] "" XXX + SG_ GTW_rearCornerRadarHw : 41|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_frontCornerRadarHw : 43|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_epasType : 45|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_chassisType : 47|2@0+ (1,0) [0|2] "" XXX + SG_ GTW_wheelType : 52|5@0+ (1,0) [0|0] "" XXX + SG_ GTW_rearSeatControllerMask : 55|3@0+ (1,0) [0|7] "" XXX + SG_ GTW_euVehicle : 56|1@0+ (1,0) [0|0] "" XXX + SG_ GTW_foldingMirrorsInstalled : 57|1@0+ (1,0) [0|0] "" XXX + SG_ GTW_brakeHwType : 59|2@0+ (1,0) [0|2] "" XXX + SG_ GTW_autopilot : 61|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_unknown3 : 63|2@0+ (1,0) [0|0] "" XXX + +BO_ 921 DAS_status: 8 XXX + SG_ DAS_autopilotState : 0|4@1+ (1,0) [0|0] "" GTW,APS,TAS2 + SG_ DAS_blindSpotRearLeft : 4|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_blindSpotRearRight : 6|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_fusedSpeedLimit : 8|5@1+ (5,0) [0|150] "kph/mph" GTW,APS + SG_ DAS_suppressSpeedWarning : 13|1@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_summonObstacle : 14|1@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_summonClearedGate : 15|1@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_visionOnlySpeedLimit : 16|5@1+ (5,0) [0|150] "kph/mph" GTW,APS + SG_ DAS_heaterState : 21|1@1+ (1,0) [0|0] "" GTW + SG_ DAS_forwardCollisionWarning : 22|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_autoparkReady : 24|1@1+ (1,0) [0|1] "" GTW,APS + SG_ DAS_autoParked : 25|1@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_autoparkWaitingForBrake : 26|1@1+ (1,0) [0|1] "" GTW,APS + SG_ DAS_summonFwdLeashReached : 27|1@1+ (1,0) [0|1] "" GTW,APS + SG_ DAS_summonRvsLeashReached : 28|1@1+ (1,0) [0|1] "" GTW,APS + SG_ DAS_lssState : 29|3@1+ (1,0) [0|0] "" GTW,APS,EPB + SG_ DAS_sideCollisionAvoid : 32|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_sideCollisionWarning : 34|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_sideCollisionInhibit : 36|1@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_laneDepartureWarning : 37|3@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_fleetSpeedState : 40|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_autopilotHandsOnState : 42|4@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_autoLaneChangeState : 46|5@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_summonAvailable : 51|1@1+ (1,0) [0|1] "" GTW,APS + SG_ DAS_statusCounter : 52|4@1+ (1,0) [0|0] "" GTW,APS,TAS2 + SG_ DAS_statusChecksum : 56|8@1+ (1,0) [0|0] "" GTW,APS,TAS2 + +BO_ 937 DAS_telemetry: 8 XXX + SG_ DAS_telemetryMultiplexer : 0|8@1+ (1,0) [0|0] "" XXX + SG_ DAS_telLeftLaneType : 8|3@1+ (1,0) [0|0] "" XXX + SG_ DAS_telRightLaneType : 11|3@1+ (1,0) [0|0] "" XXX + SG_ DAS_telLeftMarkerQuality : 14|2@1+ (1,0) [0|0] "" XXX + SG_ DAS_telRightMarkerQuality : 16|2@1+ (1,0) [0|0] "" XXX + SG_ DAS_telLeftMarkerColor : 18|2@1+ (1,0) [0|0] "" XXX + SG_ DAS_telRightMarkerColor : 20|2@1+ (1,0) [0|0] "" XXX + SG_ DAS_telLeftLaneCrossing : 22|1@1+ (1,0) [0|0] "" XXX + SG_ DAS_telRightLaneCrossing : 23|1@1+ (1,0) [0|0] "" XXX + +BO_ 938 DAS_telemetryM: 8 XXX + SG_ DAS_telemetryMultiplexerM M : 0|8@1+ (1,0) [0|0] "" XXX + SG_ DAS_telLeftLaneType m0 : 8|3@1+ (1,0) [0|0] "" XXX + SG_ DAS_telRightLaneType m0 : 11|3@1+ (1,0) [0|0] "" XXX + SG_ DAS_telLeftMarkerQuality m0 : 14|2@1+ (1,0) [0|0] "" XXX + SG_ DAS_telRightMarkerQuality m0 : 16|2@1+ (1,0) [0|0] "" XXX + SG_ DAS_telLeftMarkerColor m0 : 18|2@1+ (1,0) [0|0] "" XXX + SG_ DAS_telRightMarkerColor m0 : 20|2@1+ (1,0) [0|0] "" XXX + SG_ DAS_telLeftLaneCrossing m0 : 22|1@1+ (1,0) [0|0] "" XXX + SG_ DAS_telRightLaneCrossing m0 : 23|1@1+ (1,0) [0|0] "" XXX + SG_ DAS_MCPObserved m1 : 8|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_accReengaged m1 : 9|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_pedestrianInFOVBeforeIntr m1 : 10|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_pedestrianInFOVAfterIntr m1 : 11|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_camFreeSpaceBeforeIntr m1 : 12|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_camFreeSpaceAfterIntr m1 : 13|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_timeOfIntervention m1 : 14|6@1+ (0.25,0) [0|16] "s" XXX + SG_ DAS_timeOfFirstPedestrian m1 : 20|6@1+ (0.25,0) [0|16] "s" XXX + SG_ DAS_timeOfACCReengaging m1 : 26|6@1+ (0.25,0) [0|16] "s" XXX + SG_ DAS_durationOfPrevACCStandstill m1 : 32|6@1+ (0.5,0) [0|30] "s" XXX + SG_ DAS_maxAbsSteeringWheelAngle m1 : 38|7@1+ (2,0) [0|256] "degrees" XXX + SG_ DAS_targetRelvelAtIntervention m1 : 45|6@1+ (0.25,-2) [-2|13.5] "m/s" XXX + SG_ DAS_targetDistAtIntervention m1 : 51|6@1+ (0.5,0) [0|32] "m" XXX + SG_ DAS_egoSpeedAtIntervention m1 : 57|6@1+ (0.5,0) [0|32] "m/s" XXX + SG_ DAS_stopSignLongitudinalDist m2 : 8|10@1+ (0.1,0) [0|102.2] "m" XXX + SG_ DAS_stopSignLateralDist m2 : 18|8@1+ (0.25,-32) [-32|31.5] "m" XXX + SG_ DAS_stopSignHeight m2 : 26|6@1+ (0.1,0) [0|6.2] "m" XXX + SG_ DAS_stopSignStopLineDistance m2 : 32|10@1+ (0.1,-20) [-20|82.2] "m" XXX + SG_ DAS_stopSignCIPVDistance m2 : 42|6@1+ (0.5,0) [0|31.5] "m" XXX + SG_ DAS_stopSignHostAccel m2 : 48|10@1+ (0.01,-5) [-5|5.23] "m/s^2" XXX + SG_ DAS_stopSignCrossingWarning m2 : 58|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_stopSignIndex m2 : 59|4@1+ (1,0) [0|15] "" XXX + SG_ DAS_csaOverride m7 : 10|1@1+ (1,0) [0|0] "" XXX + SG_ DAS_csaIntState m7 : 11|3@1+ (1,0) [0|3] "" XXX + SG_ DAS_csaEnableSpeed m7 : 14|12@1+ (0.05,-25) [-25|179.75] "MPH" XXX + SG_ DAS_csaDisableSpeed m7 : 26|12@1+ (0.05,-25) [-25|179.75] "MPH" XXX + SG_ DAS_csaFiltCurv m7 : 40|16@1- (1E-06,0) [-0.032768|0.032767] "1/m" XXX + SG_ DAS_csaMeasLatAccel m7 : 56|8@1+ (0.08,-10.24) [-10.24|10] "m/s^2" XXX + SG_ DAS_soCamCipvStatus m8 : 8|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_soRad5Status m8 : 10|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_soRad1Status m8 : 12|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_soCamCipvDx m8 : 14|6@1+ (2,0) [0|126] "m" XXX + SG_ DAS_soRad1Dx m8 : 20|6@1+ (2,0) [0|126] "m" XXX + SG_ DAS_soRad5Dx m8 : 26|6@1+ (2,0) [0|126] "m" XXX + SG_ DAS_soCamCipvDy m8 : 32|5@1+ (0.4,-6.4) [-6.4|6] "m" XXX + SG_ DAS_soRad5Dy m8 : 37|5@1+ (0.4,-6.4) [-6.4|6] "m" XXX + SG_ DAS_soCamCipvVx m8 : 42|5@1+ (1,0) [0|31] "m/s" XXX + SG_ DAS_soRad5ObstProb m8 : 47|4@1+ (0.0625,0) [0|0.9375] "probability" XXX + SG_ DAS_soRad5Dz m8 : 51|6@1+ (0.25,-5) [-5|10.75] "m" XXX + SG_ DAS_soRad5powerdB m8 : 57|7@1+ (2,0) [0|254] "dB" XXX + SG_ DAS_assPrevSetSpeed m9 : 8|8@1+ (0.25,0) [0|63.75] "m/s" XXX + SG_ DAS_assNewSetSpeed m9 : 16|8@1+ (0.25,0) [0|63.75] "m/s" XXX + SG_ DAS_assFusedSpeedLimit m9 : 24|6@1+ (1,0) [0|63] "m/s" XXX + SG_ DAS_assAutosteerActive m9 : 30|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_assSmartSpeedActive m9 : 31|1@1+ (2,0) [0|1] "" XXX + +BO_ 968 UI_driverAssistMapData: 8 XXX + SG_ UI_mapSpeedLimitDependency : 0|3@1+ (1,0) [0|0] "" XXX + SG_ UI_roadClass : 3|3@1+ (1,0) [0|0] "" XXX + SG_ UI_inSuperchargerGeofence : 6|1@1+ (1,0) [0|0] "" XXX + SG_ UI_mapSpeedUnits : 7|1@1+ (1,0) [0|0] "" XXX + SG_ UI_mapSpeedLimit : 8|5@1+ (1,0) [0|0] "" XXX + SG_ UI_mapSpeedLimitType : 13|3@1+ (1,0) [0|0] "" XXX + SG_ UI_countryCode : 16|10@1+ (1,0) [0|0] "" XXX + SG_ UI_streetCount : 26|2@1+ (1,0) [0|0] "" XXX + SG_ UI_gpsRoadMatch : 28|1@1+ (1,0) [0|0] "" XXX + SG_ UI_navRouteActive : 29|1@1+ (1,0) [0|0] "" XXX + SG_ UI_parallelAutoparkEnabled : 30|1@1+ (1,0) [0|1] "" XXX + SG_ UI_perpendicularAutoparkEnabled : 31|1@1+ (1,0) [0|1] "" XXX + SG_ UI_nextBranchDist : 32|5@1+ (10,0) [0|300] "m" XXX + SG_ UI_controlledAccess : 37|1@1+ (1,0) [0|0] "" XXX + SG_ UI_nextBranchLeftOffRamp : 38|1@1+ (1,0) [0|0] "" XXX + SG_ UI_nextBranchRightOffRamp : 39|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectLeftLane : 40|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectRightLane : 41|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectHPP : 42|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectNav : 43|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectLeftFreeSpace : 44|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectRightFreeSpace : 45|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectAutosteer : 46|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectHandsOn : 47|1@1+ (1,0) [0|0] "" XXX + SG_ UI_acceptBottsDots : 48|1@1+ (1,0) [0|0] "" XXX + SG_ UI_autosteerRestricted : 49|1@1+ (1,0) [0|0] "" XXX + SG_ UI_pmmEnabled : 50|1@1+ (1,0) [0|0] "" XXX + SG_ UI_scaEnabled : 51|1@1+ (1,0) [0|0] "" XXX + SG_ UI_mapDataCounter : 52|4@1+ (1,0) [0|0] "" XXX + SG_ UI_mapDataChecksum : 56|8@1+ (1,0) [0|0] "" XXX + +BO_ 984 MCU_locationStatus: 8 XXX + SG_ MCU_gpsAccuracy : 57|7@1+ (0.2,0) [0|0] "m" XXX + SG_ MCU_latitude : 0|28@1- (1E-06,0) [0|0] "deg" XXX + SG_ MCU_longitude : 28|29@1- (1E-06,0) [0|0] "deg" XXX + +BO_ 1000 UI_driverAssistControl: 8 XXX + SG_ UI_autopilotControlRequest : 0|1@1+ (1,0) [1|0] "" XXX + SG_ UI_ulcStalkConfirm : 1|1@1+ (1,0) [1|0] "" XXX + SG_ UI_summonHeartbeat : 2|2@1+ (1,0) [0|0] "" XXX + SG_ UI_curvSpeedAdaptDisable : 4|1@1+ (1,0) [0|0] "" XXX + SG_ UI_dasDeveloper : 5|1@1+ (1,0) [0|0] "" XXX + SG_ UI_enableVinAssociation : 6|1@1+ (1,0) [0|0] "" XXX + SG_ UI_lssLkaEnabled : 7|1@1+ (1,0) [0|0] "" XXX + SG_ UI_lssLdwEnabled : 8|1@1+ (1,0) [0|0] "" XXX + SG_ UI_autoSummonEnable : 10|1@1+ (1,0) [0|1] "" XXX + SG_ UI_exceptionListEnable : 11|1@1+ (1,0) [0|1] "" XXX + SG_ UI_roadCheckDisable : 12|1@1+ (1,0) [0|0] "" XXX + SG_ UI_driveOnMapsEnable : 13|1@1+ (1,0) [0|0] "" XXX + SG_ UI_handsOnRequirementDisable : 14|1@1+ (1,0) [0|0] "" XXX + SG_ UI_forksEnable : 15|1@1+ (1,0) [0|0] "" XXX + SG_ UI_fuseLanesDisable : 16|1@1+ (1,0) [0|0] "" XXX + SG_ UI_fuseHPPDisable : 17|1@1+ (1,0) [0|0] "" XXX + SG_ UI_fuseVehiclesDisable : 18|1@1+ (1,0) [0|0] "" XXX + SG_ UI_enableNextGenACC : 19|1@1+ (1,0) [0|1] "" XXX + SG_ UI_visionSpeedType : 20|2@1+ (1,0) [0|0] "" XXX + SG_ UI_curvatureDatabaseOnly : 22|1@1+ (1,0) [0|0] "" XXX + SG_ UI_lssElkEnabled : 23|1@1+ (1,0) [0|0] "" XXX + SG_ UI_summonExitType : 24|2@1+ (1,0) [0|3] "" XXX + SG_ UI_summonEntryType : 26|2@1+ (1,0) [0|3] "" XXX + SG_ UI_selfParkRequest : 28|4@1+ (1,0) [0|15] "" XXX + SG_ UI_summonReverseDist : 32|6@1+ (1,0) [0|63] "" XXX + SG_ UI_undertakeAssistEnable : 38|1@1+ (1,0) [0|0] "" XXX + SG_ UI_adaptiveSetSpeedEnable : 39|1@1+ (1,0) [0|0] "" XXX + SG_ UI_drivingSide : 40|2@1+ (1,0) [0|3] "" XXX + SG_ UI_enableClipTelemetry : 42|1@1+ (1,0) [0|0] "" XXX + SG_ UI_enableTripTelemetry : 43|1@1+ (1,0) [0|0] "" XXX + SG_ UI_enableRoadSegmentTelemetry : 44|1@1+ (1,0) [0|0] "" XXX + SG_ UI_followNavRouteEnable : 46|1@1+ (1,0) [0|0] "" XXX + SG_ UI_ulcSpeedConfig : 48|2@1+ (1,0) [0|3] "" XXX + SG_ UI_ulcBlindSpotConfig : 50|2@1+ (1,0) [0|3] "" XXX + SG_ UI_autopilotAlwaysOn : 52|1@1+ (1,0) [0|1] "" XXX + SG_ UI_accFromZero : 53|1@1+ (1,0) [0|1] "" XXX + SG_ UI_alcOffHighwayEnable : 54|1@1+ (1,0) [0|1] "" XXX + SG_ UI_validationLoop : 55|1@1+ (1,0) [0|1] "" XXX + SG_ UI_ulcOffHighway : 56|1@1+ (1,0) [0|1] "" XXX + SG_ UI_enableNavRouteCSA : 57|1@1+ (1,0) [0|1] "" XXX + SG_ UI_enableCutinExperiments : 58|1@1+ (1,0) [0|1] "" XXX + SG_ UI_source3D : 60|3@1+ (1,0) [0|7] "" XXX + SG_ UI_enableVisionOnlyStops : 63|1@1+ (1,0) [0|1] "" XXX + +BO_ 1001 DAS_bodyControls: 8 XXX + SG_ DAS_headlightRequest : 0|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_hazardLightRequest : 2|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_wiperSpeed : 4|4@1+ (1,0) [0|15] "" XXX + SG_ DAS_turnIndicatorRequest : 8|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_highLowBeamDecision : 10|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_highLowBeamOffReason : 12|3@1+ (1,0) [0|4] "" XXX + SG_ DAS_turnIndicatorRequestReason : 16|4@1+ (1,0) [0|15] "" XXX + SG_ DAS_bodyControlsCounter : 52|4@1+ (1,0) [0|15] "" XXX + SG_ DAS_bodyControlsChecksum : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 1006 UI_autopilotControl: 8 XXX + SG_ UI_autopilotControlIndex M : 0|3@1+ (1,0) [0|7] "" XXX + SG_ UI_hovEnabled m0 : 3|1@1+ (1,0) [0|0] "" XXX + SG_ UI_donDisableAutoWiperDuration m0 : 4|3@1+ (1,0) [0|0] "" XXX + SG_ UI_donDisableOnAutoWiperSpeed m0 : 7|4@1+ (1,0) [0|0] "" XXX + SG_ UI_blindspotMinSpeed m0 : 11|4@1+ (1,0) [0|0] "" XXX + SG_ UI_blindspotDistance m0 : 15|3@1+ (1,0) [0|0] "" XXX + SG_ UI_blindspotTTC m0 : 18|3@1+ (1,0) [0|0] "" XXX + SG_ UI_donStopEndOfRampBuffer m0 : 21|3@1+ (1,0) [0|0] "" XXX + SG_ UI_donDisableCutin m0 : 24|1@1+ (1,0) [0|0] "" XXX + SG_ UI_donMinGoreWidthForAbortMap m0 : 25|4@1+ (1,0) [0|0] "" XXX + SG_ UI_donAlcProgGoreAbortThres m0 : 29|4@1+ (1,0) [0|0] "" XXX + SG_ UI_donMinGoreWidthForAbortNotMap m0 : 33|4@1+ (1,0) [0|0] "" XXX + SG_ UI_alcDisableUltrasonicCheck m0 : 37|1@1+ (1,0) [0|0] "" XXX + SG_ UI_alcUltrasonicDistance m0 : 38|4@1+ (1,0) [0|0] "" XXX + SG_ UI_alcUltrasonicWaitTime m0 : 42|3@1+ (1,0) [0|0] "" XXX + SG_ UI_alcEgoLeadingReactionAccel m0 : 48|2@1+ (1,0) [0|0] "" XXX + SG_ UI_alcMergIntervalRearDHyst m0 : 50|2@1+ (1,0) [0|0] "" XXX + SG_ UI_alcMergingIntervalHeadwayHyst m0 : 52|2@1+ (1,0) [0|0] "" XXX + SG_ UI_alcAssertivenessRate m0 : 54|2@1+ (1,0) [0|0] "" XXX + SG_ UI_alcViewRangeSensitivity m0 : 56|2@1+ (1,0) [0|0] "" XXX + SG_ UI_camBlockLaneCheckDisable m1 : 3|1@1+ (1,0) [0|0] "" XXX + SG_ UI_camBlockLaneCheckThreshold m1 : 4|6@1+ (0.01587,0) [0|1] "%" XXX + SG_ UI_camBlockBlurDisable m1 : 10|1@1+ (1,0) [0|0] "" XXX + SG_ UI_camBlockBlurThreshold m1 : 11|6@1+ (0.01587,0) [0|1] "%" XXX + +BO_ 1064 UI_telemetryControl: 8 XXX + SG_ UI_TCR_enable : 0|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_moveStateStanding : 1|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_moveStateStopped : 2|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_moveStateMoving : 3|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_moveStateIndeterm : 4|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_classConstElem : 5|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_classMovingPed : 6|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_classMovingTwoWheel : 7|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_classMovingFourWheel : 8|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_classUnknown : 9|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_downSampleFactor : 16|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ UI_TCR_wExist : 24|5@1+ (1,0) [0|31] "" Vector__XXX + SG_ UI_TCR_vehSpeed : 32|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_TCR_minRCS : 40|8@1+ (0.25,-14) [-14|49.75] "dB" Vector__XXX + SG_ UI_TCR_maxDy : 48|5@1+ (0.5,0) [0|15.5] "m" Vector__XXX + SG_ UI_TCR_maxObjects : 56|5@1+ (1,0) [0|31] "" Vector__XXX + SG_ UI_TCR_maxRoadClass : 61|3@1+ (1,0) [0|7] "" Vector__XXX + +BO_ 1080 UI_driverAssistAnonDebugParams: 8 XXX + SG_ UI_anonDebugParam1 : 0|7@1+ (1,0) [0|100] "" XXX + SG_ UI_anonDebugFlag1 : 7|1@1+ (1,0) [0|0] "" XXX + SG_ UI_anonDebugParam2 : 8|7@1+ (1,0) [0|100] "" XXX + SG_ UI_anonDebugFlag2 : 15|1@1+ (1,0) [0|0] "" XXX + SG_ UI_anonDebugParam3 : 16|7@1+ (1,0) [0|100] "" XXX + SG_ UI_anonDebugFlag3 : 23|1@1+ (1,0) [0|0] "" XXX + SG_ UI_anonDebugParam4 : 24|7@1+ (1,0) [0|100] "" XXX + SG_ UI_anonDebugFlag4 : 31|1@1+ (1,0) [0|0] "" XXX + SG_ UI_anonDebugParam5 : 32|7@1+ (1,0) [0|100] "" XXX + SG_ UI_anonDebugParam6 : 40|7@1+ (1,0) [0|100] "" XXX + SG_ UI_anonDebugParam7 : 48|7@1+ (1,0) [0|100] "" XXX + SG_ UI_visionSpeedSlider : 56|7@1+ (1,0) [0|100] "" XXX + +BO_ 1160 DAS_steeringControl: 4 NEO + SG_ DAS_steeringControlType : 23|2@0+ (1,0) [0|0] "" EPAS + SG_ DAS_steeringControlChecksum : 31|8@0+ (1,0) [0|0] "" EPAS + SG_ DAS_steeringControlCounter : 19|4@0+ (1,0) [0|0] "" EPAS + SG_ DAS_steeringAngleRequest : 6|15@0+ (0.1,-1638.35) [-1638.35|1638.35] "deg" EPAS + SG_ DAS_steeringHapticRequest : 7|1@0+ (1,0) [0|0] "" EPAS + +BO_ 1361 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.0507968128,-22.85856576) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.1015936256,-22.85856576) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ IDX : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM : 47|8@0+ (1,0) [0|3] "" INTERCEPTOR + +BO_ 1362 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.0507968128,-22.85856576) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.1015936256,-22.85856576) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ IDX : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM : 47|8@0+ (1,0) [0|3] "" EON + +BO_ 1364 ECU_BrakeStatus: 5 iBooster + SG_ DriverBrakeApplied : 17|1@1+ (1,0) [0|1] "" EON + SG_ BrakePedalPosition : 20|12@1+ (0.015625,-5) [0|47] "mm" EON + SG_ BrakeApplied : 18|1@1+ (1,0) [0|1] "" EON + SG_ BrakeOK : 16|1@1+ (1,0) [0|1] "" EON + SG_ Status : 12|4@1+ (1,0) [0|15] "" EON + SG_ Brake_Counter : 8|4@1+ (1,0) [0|15] "" EON + SG_ Brake_Checksum : 0|8@1+ (1,0) [0|255] "" EON + +BO_ 1363 ECU_BrakeCommand: 6 EON + SG_ BrakePositionCommand : 32|12@1+ (0.015625,-5) [0|20] "mm" iBooster + SG_ BrakeRelativeCommand : 16|16@1+ (0.0078125,-252) [-252|252] "ml/s" iBooster + SG_ BrakeMode : 12|2@1+ (1,0) [0|3] "" iBooster + SG_ Brake_Counter : 8|4@1+ (1,0) [0|15] "" iBooster + SG_ Brake_Checksum : 0|8@1+ (1,0) [0|255] "" iBooster + +BO_ 861 IBST_dtcMatrix: 4 iBooster + SG_ IBST_dtcIndex M : 0|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d000_bmsInitTestFail m0 : 8|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d001_bmcSingleTransTest m0 : 10|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d002_tle5012SsccrcFail m0 : 12|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d003_tle5012Config m0 : 14|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d004_deadlMonTaskx1Ovr m0 : 16|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d005_ecuWdFltCntTstFls m0 : 18|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d006_ecuWdScheduleTout m0 : 20|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d007_ecuWdStarttestFls m0 : 22|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d008_ecuWdStatusContErr m0 : 24|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d009_netOvrvolt m0 : 26|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d010_micSpiTout m0 : 28|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d011_micSpiTransferErr m0 : 30|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d012_netUndvolt m0 : 32|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d013_xpassToutErr m0 : 34|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d014_rpsOffsEeReadEmpty m0 : 36|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d015_rtpEnaHigh m0 : 38|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d016_xpassEchoCountErr m0 : 40|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d017_preDriveChckFail m0 : 42|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d018_ucSafetyFlt m0 : 44|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d019_unsupportedHw m0 : 46|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d020_voltPreRegModeFld m0 : 48|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d021_ubbSupplyLine m0 : 50|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d022_stmAswSysTout m0 : 52|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d023_stackOvrUndFlow m0 : 54|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d024_smmOneReqsInit m0 : 56|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d025_ptsSupply m0 : 58|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d026_ptsSupplyUndvolt m0 : 60|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d027_tempB6Plaus m0 : 62|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d028_ecuWdErrCntContErr m1 : 8|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d029_bmcShortedGateTest m1 : 10|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d030_controllerDevTooBig m1 : 12|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d031_ibDtrFail m1 : 14|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d032_oc6InitTestFail m1 : 16|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d033_oc6Monitor m1 : 18|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d034_motorOscillationDet m1 : 20|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d035_rpsOffsEeReadFail m1 : 22|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d036_sysErrHook m1 : 24|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d037_calIdlePosNotPlaus m1 : 26|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d038_boostSupUndrvolt m1 : 28|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d039_calRoutineAbort m1 : 30|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d040_bmcGateUndervoltPro m1 : 32|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d041_hswInitPhseUndrvolt m1 : 34|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d042_ltmWarnLevelReached m1 : 36|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d043_rpsVctrLengthRelErr m1 : 38|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d044_b6TempDegradeLevel1 m1 : 40|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d045_B6TempDegradeLevel2 m1 : 42|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d046_spiAnglOrRawNotUp m1 : 44|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d047_dcomIboosterNotInit m1 : 46|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d048_unintendMotorReturn m1 : 48|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d049_cdmOvrvoltLevel1 m1 : 50|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d050_cdmUndrvoltLevel2 m1 : 52|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d051_cdmUndrvoltLevel1 m1 : 54|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d052_motTrvlRelReadFail m1 : 56|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d053_tle5012UnexpReset m1 : 58|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d054_bmsGateUndrvolt m1 : 60|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d055_kl15HwPlausSw m1 : 62|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d056_ibNotShutDownRight m2 : 8|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d057_cdmHardUndrvolt m2 : 10|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d058_cdmHardOvrvolt m2 : 12|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d059_maxTrvlAdjstUpdFail m2 : 14|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d060_ltmLimitReached m2 : 16|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d061_dcomEcuDefect m2 : 18|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d062_inputStroke1RngHigh m2 : 20|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d063_inputStroke1RngLow m2 : 22|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d064_inputStroke2RngHigh m2 : 24|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d065_inputStroke2RngLow m2 : 26|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d066_ibSupVoltDivDrift m2 : 28|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d067_sOutRodToPressVal m2 : 30|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d068_tle5012LifeCnt m2 : 32|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d069_cdmExtendedUndrvolt m2 : 34|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d070_cdmExtendedOvrvolt m2 : 36|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d071_tempB6Ch1LineHigh m2 : 38|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d072_tempB6Ch1LineLow m2 : 40|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d073_tempB6Ch2LineHigh m2 : 42|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d074_tempB6Ch2LineLow m2 : 44|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d075_hevSwitchOffDcom m2 : 46|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d076_tle5012VoltFail m2 : 48|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d077_bcsFltCurrentHigh m2 : 50|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d078_bcsFltCurrentLow m2 : 52|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d079_ecuSupVoltDivDrift m2 : 54|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d080_inputstroke1Grad m2 : 56|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d081_pts1Err m2 : 58|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d082_pts1LineGnd m2 : 60|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d083_pts1LineHigh m2 : 62|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d084_inputStroke2Grad m3 : 8|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d085_pts2Err m3 : 10|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d086_pts2LineGnd m3 : 12|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d087_pts2LineHigh m3 : 14|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d088_faildevInputStroke m3 : 16|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d089_ptsOffsTooHigh m3 : 18|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d090_pbistErr m3 : 20|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d091_ramInitErr m3 : 22|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d092_ramsinlgeFlt m3 : 24|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d093_bertFlt m3 : 26|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d094_CalDataNotPlaus m3 : 28|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d095_canEHwError m3 : 30|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d096_canETout m3 : 32|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d097_cpuException m3 : 34|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d098_ecuBandGap m3 : 36|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d099_ecuBmsOnWhileWdTout m3 : 38|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d100_ecuErrpinCntTstFls m3 : 40|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d101_ecuHetException m3 : 42|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d102_ecuHetTuAddErr m3 : 44|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d103_ecuHetTuBusErr m3 : 46|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d104_ecuHetTuBusyErr m3 : 48|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d105_ecuHetTuException m3 : 50|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d106_ecuTaskMissing m3 : 52|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d107_hetRefError m3 : 54|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d108_micInitSpiTstFld m3 : 56|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d109_micInitSpiTransfErr m3 : 58|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d110_micIntMonGenBitMon m3 : 60|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d111_micIntVoltMonFld m3 : 62|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d112_motPosTrvlReadEmpty m4 : 8|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d113_motAngBoundReadEmpt m4 : 10|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d114_motShaftShiftDetect m4 : 12|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d115_osErrHook m4 : 14|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d116_pdurEInitFail m4 : 16|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d117_pdurEPduInstLost m4 : 18|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d118_pts1OffsEeReadEmpty m4 : 20|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d119_pts2OffsEeReadEmpty m4 : 22|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d120_rpsOffsXEeReadFail m4 : 24|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d121_rpsOffsYEeReadFail m4 : 26|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d122_rpsSynchEeReadFail m4 : 28|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d123_rpsAnglRecalcErr m4 : 30|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d124_motTrvlRelWriteFail m4 : 32|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d125_motTrvlRelReadEmpty m4 : 34|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d126_ptsEeReadEmpty m4 : 36|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d127_ecuAdcConversionErr m4 : 38|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d128_ecuAdcSelftestErr m4 : 40|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d129_ccmFlt m4 : 42|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d130_ecuRomCheck m4 : 44|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d131_esmNmiFlt m4 : 46|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d132_esmSafetyFlt m4 : 48|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d133_motPosTrvlReadFail m4 : 50|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d134_motPosTrvlWriteFail m4 : 52|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d135_motAnglBndReadErr m4 : 54|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d136_motAnglBndWriteErr m4 : 56|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d137_motAnglGradTooLarge m4 : 58|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d138_pdmCustomerIdMis m4 : 60|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d139_pdmDtFormatMis m4 : 62|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d140_pdmOutOfMemory m5 : 8|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d141_pdmFieldSizeMis m5 : 10|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d142_pdmHwAcsErr m5 : 12|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d143_pdmInternalHWErr m5 : 14|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d144_ptsCalHysWritFail m5 : 16|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d145_ptsCalValuesChkFail m5 : 18|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d146_pts1CalEeReadFail m5 : 20|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d147_pts1CalEeWriteFail m5 : 22|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d148_rpsFailCompErr m5 : 24|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d149_pts1OffsEeWriteFail m5 : 26|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d150_pts2CalEeReadFail m5 : 28|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d151_pts2CalEeWriteFail m5 : 30|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d152_pts2OffsEeReadFail m5 : 32|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d153_pts2OffsEeWriteFail m5 : 34|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d154_rpsOffsXEeReadEmpty m5 : 36|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d155_rpsOffsXEeWriteFail m5 : 38|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d156_rpsOffsYEeReadEmpty m5 : 40|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d157_rpsOffsYEeWriteFail m5 : 42|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d158_rpsSynchEeReadEmpty m5 : 44|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d159_rpsSynchEeWriteFail m5 : 46|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d160_assertionFail m5 : 48|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d161_comsclBrkPrsPduLen m5 : 50|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d162_comsclBrkPrsPduTout m5 : 52|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d163_comsclEspIb1CntErr m5 : 54|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d164_comsclEspIb1CsErr m5 : 56|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d165_comsclEspIb1DlcErr m5 : 58|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d166_comsclEspIb1Tout m5 : 60|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d167_comsclEspIb2CntErr m5 : 62|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d168_comsclEspIb2CsErr m6 : 8|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d169_comsclEspIb2DlcErr m6 : 10|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d170_comsclEspIb2Tout m6 : 12|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d171_comsclEspIb3CntErr m6 : 14|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d172_comsclEspIb3CsErr m6 : 16|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d173_comsclEspIb3DlcErr m6 : 18|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d174_comsclEspIb3Tout m6 : 20|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d175_comsclGtwEsp1CntErr m6 : 22|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d176_comsclGtwEsp1CsErr m6 : 24|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d177_comsclGtwEsp1Corrpt m6 : 26|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d178_comsclGtwEsp1Tout m6 : 28|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d179_dcomSmrtActuNotInit m6 : 30|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d180_rpsLengthAbsolHigh m6 : 32|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d181_rpsLengthAbsolLow m6 : 34|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d182_shutDownEeReadFail m6 : 36|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d183_shutDownEeWriteFail m6 : 38|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d184_maxTrvlAdjstReadErr m6 : 40|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d185_psOffsMcEeReadFail m6 : 42|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d186_psOffsMcEeWriteFail m6 : 44|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d187_ltmSelfProtDeact m6 : 46|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d188_pts1OffsEeReadFail m6 : 48|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d189_diffStrokeRange m6 : 50|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d190_notProgVin m6 : 52|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d191_plausVin m6 : 54|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d192_dlCorCSumVin m6 : 56|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d193_ToutVin m6 : 58|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d194_ecuEnableB6Fail m6 : 60|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d195_ecuIbEnContErr m6 : 62|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d196_sclEspIb1pEstMax m7 : 8|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d197_sclEspIb1VehSpd m7 : 10|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d198_sclEspIb2pLimExt m7 : 12|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d199_sclEspIb2qTarExt m7 : 14|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d200_sclEspIb3pFBlend m7 : 16|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d201_sclEspIb3pMc1 m7 : 18|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d202_sclEspIb3pTarDriver m7 : 20|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d203_netBusOffNet0 m7 : 22|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d204_netErrPassivNet0 m7 : 24|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d205_netBusOffNet1 m7 : 26|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d206_netErrPassivNet1 m7 : 28|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d207_maxStrokeReached m7 : 30|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d208_sysSwClockMismatch m7 : 32|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d209_comsclGtwOdoCorrpt m7 : 34|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d210_comsclGtwStatCorrpt m7 : 36|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d211_comsclEpbStatCorrpt m7 : 38|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d212_comsclGtwOdoTout m7 : 40|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d213_comsclGtwStatTout m7 : 42|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d214_comsclEpbStatTout m7 : 44|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d215_comSclEpbStatCsErr m7 : 46|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d216_comSclEpbStatCntFlt m7 : 48|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d217_comSclDiTrq1Tout m7 : 50|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d218_comSclDiTrq1Corrpt m7 : 52|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d219_comSclDiTrq1CsErr m7 : 54|2@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_d220_comSclDiTrq1CntFlt m7 : 56|2@1+ (1,0) [0|0] "" Vector__XXX + +BO_ 813 IBST_info: 4 iBooster + SG_ IBST_infoIndex M : 0|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_buildType m10 : 8|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_componentId m10 : 48|16@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_pcbaId m11 : 16|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_assemblyId m11 : 24|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_usageId m11 : 32|16@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_udsProtocolVersion m20 : 8|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_bootloaderCrc m20 : 32|32@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_applicationCrc m13 : 32|32@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_variantCrc m22 : 32|32@1+ (1,0) [0|0] "" Vector__XXX + +BO_ 925 IBST_status: 4 iBooster + SG_ IBST_brakeInputStroke : 20|10@1+ (0.05,-0.5) [0|0] "mm" Vector__XXX + SG_ IBST_iBoosterStatus : 17|3@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_pedalCalCurrentChecksum : 0|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_pedalCalCurrentCounter : 8|4@1+ (1,0) [0|0] "" Vector__XXX + SG_ IBST_pedalCalCurrentCurve : 12|4@1+ (1,0) [0|0] "1" Vector__XXX + SG_ IBST_pedalCalTxEnabled : 16|1@1+ (1,0) [0|0] "1" Vector__XXX + + +VAL_ 3 StW_Angl 16383 "SNA" ; +VAL_ 3 StW_AnglSens_Id 2 "MUST" 0 "PSBL" 1 "SELF" ; +VAL_ 3 StW_AnglSens_Stat 2 "ERR" 3 "ERR_INI" 1 "INI" 0 "OK" ; +VAL_ 3 StW_AnglSpd 16383 "SNA" ; +VAL_ 14 StW_AnglHP 16383 "SNA" ; +VAL_ 14 StW_AnglHP_Spd 16383 "SNA" ; +VAL_ 14 StW_AnglHP_Sens_Stat 3 "SNA" 2 "ERR" 1 "INI" 0 "OK" ; +VAL_ 14 StW_AnglHP_Sens_Id 3 "SNA" 2 "KOSTAL" 1 "DELPHI" 0 "TEST" ; +VAL_ 69 SpdCtrlLvr_Stat 32 "DN_1ST" 16 "UP_1ST" 8 "DN_2ND" 4 "UP_2ND" 2 "RWD" 1 "FWD" 0 "IDLE" ; +VAL_ 69 DTR_Dist_Rq 255 "SNA" 200 "ACC_DIST_7" 166 "ACC_DIST_6" 133 "ACC_DIST_5" 100 "ACC_DIST_4" 66 "ACC_DIST_3" 33 "ACC_DIST_2" 0 "ACC_DIST_1" ; +VAL_ 69 TurnIndLvr_Stat 3 "SNA" 2 "RIGHT" 1 "LEFT" 0 "IDLE" ; +VAL_ 69 HiBmLvr_Stat 3 "SNA" 2 "HIBM_FLSH_ON_PSD" 1 "HIBM_ON_PSD" 0 "IDLE" ; +VAL_ 69 WprWashSw_Psd 3 "SNA" 2 "WASH" 1 "TIPWIPE" 0 "NPSD" ; +VAL_ 69 WprWash_R_Sw_Posn_V2 3 "SNA" 2 "WASH" 1 "INTERVAL" 0 "OFF" ; +VAL_ 69 StW_Lvr_Stat 4 "STW_BACK" 3 "STW_FWD" 2 "STW_DOWN" 1 "STW_UP" 0 "NPSD" ; +VAL_ 69 StW_Cond_Psd 3 "SNA" 2 "DOWN" 1 "UP" 0 "NPSD" ; +VAL_ 69 HrnSw_Psd 3 "SNA" 2 "NDEF2" 1 "PSD" 0 "NPSD" ; +VAL_ 69 StW_Sw00_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ; +VAL_ 69 StW_Sw01_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ; +VAL_ 69 StW_Sw03_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ; +VAL_ 69 StW_Sw04_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ; +VAL_ 69 WprSw6Posn 7 "SNA" 6 "STAGE2" 5 "STAGE1" 4 "INTERVAL4" 3 "INTERVAL3" 2 "INTERVAL2" 1 "INTERVAL1" 0 "OFF" ; +VAL_ 257 GTW_epasControlType 0 "WITHOUT" 1 "WITH_ANGLE" 3 "WITH_BOTH" 2 "WITH_TORQUE" ; +VAL_ 109 StW_Sw_Stat3 7 "SNA" 6 "NDEF6" 5 "NDEF5" 4 "NDEF4" 3 "PLUS_MINUS" 2 "MINUS" 1 "PLUS" 0 "NPSD" ; +VAL_ 109 MsgTxmtId 3 "NDEF3" 2 "NDEF2" 1 "SCCM" 0 "EWM" ; +VAL_ 109 TSL_RND_Posn_StW 15 "SNA" 8 "D" 6 "INI" 4 "N_DOWN" 2 "N_UP" 1 "R" 0 "IDLE" ; +VAL_ 109 TSL_P_Psd_StW 3 "SNA" 2 "INI" 1 "PSD" 0 "IDLE" ; +VAL_ 257 GTW_epasEmergencyOn 1 "EMERGENCY_POWER" 0 "NONE" ; +VAL_ 257 GTW_epasLDWEnabled 1 "ALLOWED" 0 "INHIBITED" ; +VAL_ 257 GTW_epasPowerMode 0 "DRIVE_OFF" 1 "DRIVE_ON" 3 "LOAD_SHED" 2 "SHUTTING_DOWN" 15 "SNA" ; +VAL_ 257 GTW_epasTuneRequest 1 "DM_COMFORT" 3 "DM_SPORT" 2 "DM_STANDARD" 0 "FAIL_SAFE_DEFAULT" 4 "RWD_COMFORT" 6 "RWD_SPORT" 5 "RWD_STANDARD" 7 "SNA" ; +VAL_ 264 DI_torqueDriver -4096 "SNA" ; +VAL_ 264 DI_torqueMotor -4096 "SNA" ; +VAL_ 264 DI_soptState 7 "SOPT_TEST_SNA" 4 "SOPT_TEST_NOT_RUN" 3 "SOPT_TEST_PASSED" 2 "SOPT_TEST_FAILED" 1 "SOPT_TEST_IN_PROGRESS" 0 "SOPT_PRE_TEST" ; +VAL_ 264 DI_motorRPM -32768 "SNA" ; +VAL_ 264 DI_pedalPos 255 "SNA" ; +VAL_ 280 DI_torqueEstimate -2048 "SNA" ; +VAL_ 280 DI_gear 7 "DI_GEAR_SNA" 4 "DI_GEAR_D" 3 "DI_GEAR_N" 2 "DI_GEAR_R" 1 "DI_GEAR_P" 0 "DI_GEAR_INVALID" ; +VAL_ 280 DI_brakePedal 1 "Applied" 0 "Not_applied" ; +VAL_ 280 DI_vehicleSpeed 4095 "SNA" ; +VAL_ 280 DI_gearRequest 7 "DI_GEAR_SNA" 4 "DI_GEAR_D" 3 "DI_GEAR_N" 2 "DI_GEAR_R" 1 "DI_GEAR_P" 0 "DI_GEAR_INVALID" ; +VAL_ 280 DI_torqueInterfaceFailure 1 "TORQUE_INTERFACE_FAILED" 0 "TORQUE_INTERFACE_NORMAL" ; +VAL_ 280 DI_brakePedalState 3 "SNA" 2 "INVALID" 1 "ON" 0 "OFF" ; +VAL_ 280 DI_epbParkRequest 1 "Park_requested" 0 "No_request" ; +VAL_ 280 DI_epbInterfaceReady 1 "EPB_INTERFACE_READY" 0 "EPB_INTERFACE_NOT_READY" ; +VAL_ 309 ESP_absBrakeEvent 1 "ACTIVE" 0 "NOT_ACTIVE" ; +VAL_ 309 ESP_brakeDiscWipingActive 1 "ACTIVE" 0 "INACTIVE" ; +VAL_ 309 ESP_brakeLamp 0 "OFF" 1 "ON" ; +VAL_ 309 ESP_espFaultLamp 0 "OFF" 1 "ON" ; +VAL_ 309 ESP_espLampFlash 1 "FLASH" 0 "OFF" ; +VAL_ 309 ESP_hillStartAssistActive 1 "ACTIVE" 0 "INACTIVE" 2 "NOT_AVAILABLE" 3 "SNA" ; +VAL_ 309 ESP_absFaultLamp 0 "OFF" 1 "ON" ; +VAL_ 309 ESP_espOffLamp 0 "OFF" 1 "ON" ; +VAL_ 309 ESP_stabilityControlSts 2 "ENGAGED" 3 "FAULTED" 5 "INIT" 4 "NOT_CONFIGURED" 0 "OFF" 1 "ON" ; +VAL_ 309 ESP_tcLampFlash 1 "FLASH" 0 "OFF" ; +VAL_ 537 DAS_pscParkState 15 "SNA" 14 "SUMMON" 10 "PAUSE" 9 "SEARCH" 8 "COMPLETE" 7 "ABORT" 6 "PARALLEL_PULL_OUT_TO_RIGHT" 5 "PARALLEL_PULL_OUT_TO_LEFT" 4 "PARK_RIGHT_CROSS" 3 "PARK_RIGHT_PARALLEL" 2 "PARK_LEFT_CROSS" 1 "PARK_LEFT_PARALLEL" 0 "NONE" ; +VAL_ 537 DAS_eacState 4 "SNA" 3 "EAC_FAULT" 2 "EAC_ACTIVE" 1 "EAC_AVAILABLE" 0 "EAC_INHIBITED" ; +VAL_ 568 UI_mapSpeedLimit 31 "SNA" 30 "UNLIMITED" 29 "LESS_OR_EQ_160" 28 "LESS_OR_EQ_150" 27 "LESS_OR_EQ_140" 26 "LESS_OR_EQ_130" 25 "LESS_OR_EQ_120" 24 "LESS_OR_EQ_115" 23 "LESS_OR_EQ_110" 22 "LESS_OR_EQ_105" 21 "LESS_OR_EQ_100" 20 "LESS_OR_EQ_95" 19 "LESS_OR_EQ_90" 18 "LESS_OR_EQ_85" 17 "LESS_OR_EQ_80" 16 "LESS_OR_EQ_75" 15 "LESS_OR_EQ_70" 14 "LESS_OR_EQ_65" 13 "LESS_OR_EQ_60" 12 "LESS_OR_EQ_55" 11 "LESS_OR_EQ_50" 10 "LESS_OR_EQ_45" 9 "LESS_OR_EQ_40" 8 "LESS_OR_EQ_35" 7 "LESS_OR_EQ_30" 6 "LESS_OR_EQ_25" 5 "LESS_OR_EQ_20" 4 "LESS_OR_EQ_15" 3 "LESS_OR_EQ_10" 2 "LESS_OR_EQ_7" 1 "LESS_OR_EQ_5" 0 "UNKNOWN" ; +VAL_ 569 DAS_leftLineUsage 3 "BLACKLISTED" 2 "FUSED" 1 "AVAILABLE" 0 "REJECTED_UNAVAILABLE" ; +VAL_ 569 DAS_rightLineUsage 3 "BLACKLISTED" 2 "FUSED" 1 "AVAILABLE" 0 "REJECTED_UNAVAILABLE" ; +VAL_ 569 DAS_leftFork 3 "LEFT_FORK_UNAVAILABLE" 2 "LEFT_FORK_SELECTED" 1 "LEFT_FORK_AVAILABLE" 0 "LEFT_FORK_NONE" ; +VAL_ 569 DAS_rightFork 3 "RIGHT_FORK_UNAVAILABLE" 2 "RIGHT_FORK_SELECTED" 1 "RIGHT_FORK_AVAILABLE" 0 "RIGHT_FORK_NONE" ; +VAL_ 521 DAS_locMode 3 "DAS_LOC_DRIVERLESS" 2 "DAS_LOC_RESTRICTED" 1 "DAS_LOC_NORMAL" 0 "DAS_LOC_OFF" ; +VAL_ 521 DAS_locState 7 "DAS_LOC_FAULT_SNA" 6 "DAS_LOC_AEB_ACTIVE" 2 "DAS_LOC_CANCEL_SILENT" 1 "DAS_LOC_CANCEL_GENERIC" 0 "DAS_LOC_HEALTHY" ; +VAL_ 521 DAS_locRequest 4 "DAS_RQ_PARK" 3 "DAS_RQ_HOLD" 2 "DAS_RQ_BACKWARD" 1 "DAS_RQ_FORWARD" 0 "DAS_RQ_IDLE" ; +VAL_ 521 DAS_locJerkMin 255 "SNA" ; +VAL_ 521 DAS_locJerkMax 255 "SNA" ; +VAL_ 521 DAS_locSpeed 2047 "SNA" ; +VAL_ 521 DAS_locAccelMin 511 "SNA" ; +VAL_ 521 DAS_locAccelMax 511 "SNA" ; +VAL_ 522 driverBrakeStatus 2 "APPLIED" 1 "NOT_APPLIED" ; +VAL_ 760 UI_mapSpeedLimitUnits 1 "KPH" 0 "MPH" ; +VAL_ 760 UI_userSpeedOffsetUnits 1 "KPH" 0 "MPH" ; +VAL_ 643 AirTemp_Insd 255 "SNA" ; +VAL_ 643 AirTemp_Outsd 254 "INIT" 255 "SNA" ; +VAL_ 643 Bckl_Sw_RL_Stat_SAM_R 2 "FLT" 1 "NOT" 0 "OK" 3 "SNA" ; +VAL_ 643 Bckl_Sw_RM_Stat_SAM_R 2 "FLT" 1 "NOT" 0 "OK" 3 "SNA" ; +VAL_ 643 Bckl_Sw_RR_Stat_SAM_R 2 "FLT" 1 "NOT" 0 "OK" 3 "SNA" ; +VAL_ 643 DL_RLtch_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ; +VAL_ 643 DrRLtch_FL_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ; +VAL_ 643 DrRLtch_FR_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ; +VAL_ 643 DrRLtch_RL_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ; +VAL_ 643 DrRLtch_RR_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ; +VAL_ 643 EngHd_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ; +VAL_ 643 LgtSens_Night 0 "DAY" 1 "NIGHT" ; +VAL_ 643 MPkBrk_Stat 1 "ENGG" 0 "RELS" ; +VAL_ 643 RevGr_Engg 0 "DISENGG" 1 "ENGG" 2 "NDEF2" 3 "SNA" ; +VAL_ 643 StW_Cond_Stat 3 "BLINK" 1 "NDEF1" 0 "OFF" 2 "ON" ; +VAL_ 643 Trlr_Stat 2 "NDEF2" 0 "NONE" 1 "OK" 3 "SNA" ; +VAL_ 697 DAS_setSpeed 4095 "SNA" ; +VAL_ 697 DAS_accState 15 "FAULT_SNA" 14 "ACC_CANCEL_OUT_OF_CALIBRATION" 13 "ACC_CANCEL_GENERIC_SILENT" 12 "ACC_CANCEL_PATH_NOT_CLEAR" 11 "APC_SELFPARK_START" 10 "APC_UNPARK_COMPLETE" 9 "APC_PAUSE" 8 "APC_ABORT" 7 "APC_COMPLETE" 6 "APC_FORWARD" 5 "APC_BACKWARD" 4 "ACC_ON" 3 "ACC_HOLD" 2 "ACC_CANCEL_RADAR_BLIND" 1 "ACC_CANCEL_CAMERA_BLIND" 0 "ACC_CANCEL_GENERIC" ; +VAL_ 697 DAS_aebEvent 3 "AEB_SNA" 2 "AEB_FAULT" 1 "AEB_ACTIVE" 0 "AEB_NOT_ACTIVE" ; +VAL_ 697 DAS_jerkMin 511 "SNA" ; +VAL_ 697 DAS_jerkMax 255 "SNA" ; +VAL_ 697 DAS_accelMin 511 "SNA" ; +VAL_ 697 DAS_accelMax 511 "SNA" ; +VAL_ 782 PARK_pscRightCurbType 2 "HIGH_CURB" 1 "LOW_CURB" 0 "VIRTUAL_CURB" ; +VAL_ 782 PARK_pscLeftCurbType 2 "HIGH_CURB" 1 "LOW_CURB" 0 "VIRTUAL_CURB" ; +VAL_ 782 PARK_autoCalComplete 1 "COMPLETE" 0 "INCOMPLETE" ; +VAL_ 782 PARK_geometryType 2 "MODELX" 1 "MODELS_2" 0 "MODELS" ; +VAL_ 782 PARK_tireFitment 3 "SNA" 1 "STAGGERED" 0 "SQUARE" ; +VAL_ 782 PARK_rackDetected 3 "SNA" 2 "RACK_DETECTED" 1 "NO_RACK" 0 "UNKNOWN" ; +VAL_ 782 PARK_sdiActive 1 "SDI_ENABLED" 0 "SDI_DISABLED" ; +VAL_ 782 PARK_sdiNoise 3 "SDI_NOISE_SNA" 2 "SDI_NOISE_RAIN" 1 "SDI_NOISE_HIGH" 0 "SDI_NOISE_NOMINAL" ; +VAL_ 782 PARK_sdiBlindSpotRight 3 "SNA" 2 "UNUSED" 1 "WARNING" 0 "NO_WARNING" ; +VAL_ 782 PARK_sdiBlindSpotLeft 3 "SNA" 2 "UNUSED" 1 "WARNING" 0 "NO_WARNING" ; +VAL_ 792 BOOT_STATE 2 "Init" 3 "SNA" 0 "closed" 1 "open" ; +VAL_ 792 CERRD 1 "CAN error detect" 0 "no Can error detected" ; +VAL_ 792 DAY 1 "Init" 0 "SNA" ; +VAL_ 792 DOOR_STATE_FL 2 "Init" 3 "SNA" 0 "closed" 1 "open" ; +VAL_ 792 DOOR_STATE_FR 2 "Init" 3 "SNA" 0 "closed" 1 "open" ; +VAL_ 792 DOOR_STATE_FrontTrunk 2 "Init" 3 "SNA" 0 "closed" 1 "open" ; +VAL_ 792 DOOR_STATE_RL 2 "Init" 3 "SNA" 0 "closed" 1 "open" ; +VAL_ 792 DOOR_STATE_RR 2 "Init" 3 "SNA" 0 "closed" 1 "open" ; +VAL_ 792 GTW_updateInProgress 1 "IN_PROGRESS" 2 "IN_PROGRESS_NOT_USED" 3 "IN_PROGRESS_SNA" 0 "NOT_IN_PROGRESS" ; +VAL_ 792 Hour 30 "Init" 31 "SNA" ; +VAL_ 792 MCU_factoryMode 1 "FACTORY_MODE" 0 "NORMAL_MODE" ; +VAL_ 792 MCU_transportModeOn 0 "NORMAL_MODE" ; +VAL_ 792 MINUTE 62 "Init" 63 "SNA" ; +VAL_ 792 MONTH 1 "Init" 15 "SNA" ; +VAL_ 792 SECOND 62 "Init" 63 "SNA" ; +VAL_ 792 YEAR 126 "Init" 127 "SNA" ; +VAL_ 872 DI_aebState 2 "ENABLED" 4 "FAULT" 7 "SNA" 1 "STANDBY" 3 "STANDSTILL" 0 "UNAVAILABLE" ; +VAL_ 872 DI_analogSpeed 4095 "SNA" ; +VAL_ 872 DI_cruiseState 2 "ENABLED" 5 "FAULT" 0 "OFF" 4 "OVERRIDE" 7 "PRE_CANCEL" 6 "PRE_FAULT" 1 "STANDBY" 3 "STANDSTILL" ; +VAL_ 872 DI_digitalSpeed 255 "SNA" ; +VAL_ 872 DI_immobilizerState 2 "AUTHENTICATING" 3 "DISARMED" 6 "FAULT" 4 "IDLE" 0 "INIT_SNA" 1 "REQUEST" 5 "RESET" ; +VAL_ 872 DI_speedUnits 1 "KPH" 0 "MPH" ; +VAL_ 872 DI_state 3 "ABORT" 4 "ENABLE" 2 "FAULT" 1 "STANDBY" 0 "UNAVAILABLE" ; +VAL_ 872 DI_systemState 3 "ABORT" 4 "ENABLE" 2 "FAULT" 1 "STANDBY" 0 "UNAVAILABLE" ; +VAL_ 872 DI_vehicleHoldState 2 "BLEND_IN" 4 "BLEND_OUT" 6 "FAULT" 7 "INIT" 5 "XXX" 1 "STANDBY" 3 "STANDSTILL" 0 "UNAVAILABLE" ; +VAL_ 880 EPAS_currentTuneMode 1 "DM_COMFORT" 3 "DM_SPORT" 2 "DM_STANDARD" 0 "FAIL_SAFE_DEFAULT" 4 "RWD_COMFORT" 6 "RWD_SPORT" 5 "RWD_STANDARD" 7 "UNAVAILABLE" ; +VAL_ 880 EPAS_eacErrorCode 14 "EAC_ERROR_EPB_INHIBIT" 3 "EAC_ERROR_HANDS_ON" 7 "EAC_ERROR_HIGH_ANGLE_RATE_REQ" 9 "EAC_ERROR_HIGH_ANGLE_RATE_SAFETY" 6 "EAC_ERROR_HIGH_ANGLE_REQ" 8 "EAC_ERROR_HIGH_ANGLE_SAFETY" 10 "EAC_ERROR_HIGH_MMOT_SAFETY" 11 "EAC_ERROR_HIGH_TORSION_SAFETY" 0 "EAC_ERROR_IDLE" 12 "EAC_ERROR_LOW_ASSIST" 2 "EAC_ERROR_MAX_SPEED" 1 "EAC_ERROR_MIN_SPEED" 13 "EAC_ERROR_PINION_VEL_DIFF" 4 "EAC_ERROR_TMP_FAULT" 5 "EAR_ERROR_MAX_STEER_DELTA" 15 "SNA" ; +VAL_ 880 EPAS_eacStatus 2 "EAC_ACTIVE" 1 "EAC_AVAILABLE" 3 "EAC_FAULT" 0 "EAC_INHIBITED" 4 "SNA" ; +VAL_ 880 EPAS_handsOnLevel 0 "0" 1 "1" 2 "2" 3 "3" ; +VAL_ 880 EPAS_steeringFault 1 "FAULT" 0 "NO_FAULT" ; +VAL_ 880 EPAS_steeringRackForce 1022 "NOT_IN_SPEC" 1023 "SNA" ; +VAL_ 880 EPAS_steeringReduced 0 "NORMAL_ASSIST" 1 "REDUCED_ASSIST" ; +VAL_ 880 EPAS_torsionBarTorque 0 "SEE_SPECIFICATION" 4095 "SNA" 4094 "UNDEFINABLE_DATA" ; +VAL_ 904 MCU_clusterReadyForDrive 0 "NO_SNA" 1 "YES" ; +VAL_ 905 DAS_accSpeedLimit 1023 "SNA" 0 "NONE" ; +VAL_ 905 DAS_pmmObstacleSeverity 7 "PMM_SNA" 6 "PMM_ACCEL_LIMIT" 5 "PMM_CRASH_FRONT" 4 "PMM_CRASH_REAR" 3 "PMM_BRAKE_REQUEST" 2 "PMM_IMMINENT_FRONT" 1 "PMM_IMMINENT_REAR" 0 "PMM_NONE" ; +VAL_ 905 DAS_pmmLoggingRequest 1 "TRUE" 0 "FALSE" ; +VAL_ 905 DAS_activationFailureStatus 2 "LC_ACTIVATION_FAILED_2" 1 "LC_ACTIVATION_FAILED_1" 0 "LC_ACTIVATION_IDLE" ; +VAL_ 905 DAS_pmmUltrasonicsFaultReason 4 "PMM_ULTRASONICS_INVALID_MIA" 3 "PMM_ULTRASONICS_BLOCKED_BOTH" 2 "PMM_ULTRASONICS_BLOCKED_REAR" 1 "PMM_ULTRASONICS_BLOCKED_FRONT" 0 "PMM_ULTRASONICS_NO_FAULT" ; +VAL_ 905 DAS_pmmRadarFaultReason 2 "PMM_RADAR_INVALID_MIA" 1 "PMM_RADAR_BLOCKED_FRONT" 0 "PMM_RADAR_NO_FAULT" ; +VAL_ 905 DAS_pmmSysFaultReason 7 "PMM_FAULT_BRAKE_PEDAL_INHIBIT" 6 "PMM_FAULT_ROAD_TYPE" 5 "PMM_FAULT_DISABLED_BY_USER" 4 "PMM_FAULT_STEERING_ANGLE_RATE" 3 "PMM_FAULT_DI_FAULT" 2 "PMM_FAULT_SPEED" 1 "PMM_FAULT_DAS_DISABLED" 0 "PMM_FAULT_NONE" ; +VAL_ 905 DAS_pmmCameraFaultReason 2 "PMM_CAMERA_INVALID_MIA" 1 "PMM_CAMERA_BLOCKED_FRONT" 0 "PMM_CAMERA_NO_FAULT" ; +VAL_ 905 DAS_ACC_report 24 "ACC_REPORT_BEHAVIOR_REPORT" 23 "ACC_REPORT_CAMERA_ONLY" 22 "ACC_REPORT_RADAR_OBJ_FIVE" 21 "ACC_REPORT_CIPV_CUTTING_OUT" 20 "ACC_REPORT_MCVLR_IN_PATH" 19 "ACC_REPORT_MCVLR_DPP" 18 "ACC_REPORT_FLEET_SPEEDS" 17 "ACC_REPORT_TARGET_MCP" 16 "ACC_REPORT_RADAR_OBJ_TWO" 15 "ACC_REPORT_RADAR_OBJ_ONE" 14 "ACC_REPORT_LC_EXTERNAL_STATE_ACTIVE_RESTRICTED" 13 "ACC_REPORT_LC_EXTERNAL_STATE_ABORTED" 12 "ACC_REPORT_LC_EXTERNAL_STATE_ABORTING" 11 "ACC_REPORT_LC_HANDS_ON_REQD_STRUCK_OUT" 10 "ACC_REPORT_CSA" 9 "ACC_REPORT_TARGET_TYPE_FAULT" 8 "ACC_REPORT_TARGET_TYPE_IPSO" 7 "ACC_REPORT_TARGET_TYPE_TRAFFIC_LIGHT" 6 "ACC_REPORT_TARGET_TYPE_STOP_SIGN" 5 "ACC_REPORT_TARGET_CUTIN" 4 "ACC_REPORT_TARGET_MCVR" 3 "ACC_REPORT_TARGET_MCVL" 2 "ACC_REPORT_TARGET_IN_FRONT_OF_CIPV" 1 "ACC_REPORT_TARGET_CIPV" 0 "ACC_REPORT_TARGET_NONE" ; +VAL_ 921 DAS_lssState 7 "LSS_STATE_OFF" 6 "LSS_STATE_ABORT" 5 "LSS_STATE_BLINDSPOT" 4 "LSS_STATE_MONITOR" 3 "LSS_STATE_ELK" 2 +VAL_ 905 DAS_radarTelemetry 2 "RADAR_TELEMETRY_URGENT" 1 "RADAR_TELEMETRY_NORMAL" 0 "RADAR_TELEMETRY_IDLE" ; +VAL_ 905 DAS_robState 3 "ROB_STATE_MAPLESS" 2 "ROB_STATE_ACTIVE" 1 "ROB_STATE_MEASURE" 0 "ROB_STATE_INHIBITED" ; +VAL_ 905 DAS_driverInteractionLevel 2 "CONTINUED_DRIVER_NOT_INTERACTING" 1 "DRIVER_NOT_INTERACTING" 0 "DRIVER_INTERACTING" ; +VAL_ 905 DAS_ppOffsetDesiredRamp 128 "PP_NO_OFFSET" ; +VAL_ 905 DAS_longCollisionWarning 15 "FCM_LONG_COLLISION_WARNING_SNA" 12 "FCM_LONG_COLLISION_WARNING_VEHICLE_CIPV2" 11 "FCM_LONG_COLLISION_WARNING_VEHICLE_MCVR2" 10 "FCM_LONG_COLLISION_WARNING_VEHICLE_MCVR" 9 "FCM_LONG_COLLISION_WARNING_VEHICLE_MCVL2" 8 "FCM_LONG_COLLISION_WARNING_VEHICLE_MCVL" 7 "FCM_LONG_COLLISION_WARNING_VEHICLE_CUTIN" 6 "FCM_LONG_COLLISION_WARNING_VEHICLE_CIPV" 5 "FCM_LONG_COLLISION_WARNING_TFL_STOPLINE" 4 "FCM_LONG_COLLISION_WARNING_STOPSIGN_STOPLINE" 3 "FCM_LONG_COLLISION_WARNING_IPSO" 2 "FCM_LONG_COLLISION_WARNING_PEDESTRIAN" 1 "FCM_LONG_COLLISION_WARNING_VEHICLE_UNKNOWN" 0 "FCM_LONG_COLLISION_WARNING_NONE" ; +VAL_ 921 DAS_autopilotState 5 "ACTIVE_NAVIGATE_ON_AUTOPILOT" 4 "ACTIVE_2" 3 "ACTIVE_1" 2 "AVAILABLE" 1 "UNAVAILABLE" 0 "DISABLED" ; +VAL_ 921 DAS_blindSpotRearLeft 3 "SNA" 2 "WARNING_LEVEL_2" 1 "WARNING_LEVEL_1" 0 "NO_WARNING" ; +VAL_ 921 DAS_blindSpotRearRight 3 "SNA" 2 "WARNING_LEVEL_2" 1 "WARNING_LEVEL_1" 0 "NO_WARNING" ; +VAL_ 921 DAS_fusedSpeedLimit 31 "NONE" 0 "UNKNOWN_SNA" ; +VAL_ 921 DAS_suppressSpeedWarning 1 "Suppress_Speed_Warning" 0 "Do_Not_Suppress" ; +VAL_ 921 DAS_visionOnlySpeedLimit 31 "NONE" 0 "UNKNOWN_SNA" ; +VAL_ 921 DAS_heaterState 1 "HEATER_ON" 0 "HEATER_OFF_SNA" ; +VAL_ 921 DAS_forwardCollisionWarning 3 "SNA" 1 "FORWARD_COLLISION_WARNING" 0 "NONE" ; +VAL_ 921 DAS_autoparkReady 1 "AUTOPARK_READY" 0 "AUTOPARK_UNAVAILABLE" ; +VAL_ 921 DAS_sideCollisionAvoid 3 "SNA" 2 "AVOID_RIGHT" 1 "AVOID_LEFT" 0 "NONE" ; +VAL_ 921 DAS_sideCollisionWarning 3 "WARN_LEFT_RIGHT" 2 "WARN_RIGHT" 1 "WARN_LEFT" 0 "NONE" ; +VAL_ 921 DAS_sideCollisionInhibit 1 "INHIBIT" 0 "NO_INHIBIT" ; +VAL_ 905 DAS_csaState 3 "CSA_EXTERNAL_STATE_HOLD" 2 "CSA_EXTERNAL_STATE_ENABLE" 1 "CSA_EXTERNAL_STATE_AVAILABLE" 0 "CSA_EXTERNAL_STATE_UNAVAILABLE" ; +VAL_ 921 DAS_laneDepartureWarning 5 "SNA" 4 "RIGHT_WARNING_SEVERE" 3 "LEFT_WARNING_SEVERE" 2 "RIGHT_WARNING" 1 "LEFT_WARNING" 0 "NONE" ; +VAL_ 921 DAS_fleetSpeedState 3 "FLEETSPEED_HOLD" 2 "FLEETSPEED_ACTIVE" 1 "FLEETSPEED_AVAILABLE" 0 "FLEETSPEED_UNAVAILABLE" ; +VAL_ 921 DAS_autopilotHandsOnState 15 "LC_HANDS_ON_SNA" 8 "LC_HANDS_ON_SUSPENDED" 7 "LC_HANDS_ON_REQD_STRUCK_OUT" 5 "LC_HANDS_ON_REQD_CHIME_2" 4 "LC_HANDS_ON_REQD_CHIME_1" 3 "LC_HANDS_ON_REQD_VISUAL" 2 "LC_HANDS_ON_REQD_NOT_DETECTED" 1 "LC_HANDS_ON_REQD_DETECTED" 0 "LC_HANDS_ON_NOT_REQD" ; +VAL_ 921 DAS_autoLaneChangeState 31 "ALC_SNA" 30 "ALC_ABORT_MISSION_PLAN_INVALID" 29 "ALC_ABORT_TIMEOUT" 28 "ALC_WAITING_HANDS_ON" 27 "ALC_BLOCKED_LANE_TYPE_R" 26 "ALC_BLOCKED_LANE_TYPE_L" 25 "ALC_BLOCKED_VEH_TTC_AND_USS_R" 24 "ALC_BLOCKED_VEH_TTC_R" 23 "ALC_BLOCKED_VEH_TTC_AND_USS_L" 22 "ALC_BLOCKED_VEH_TTC_L" 21 "ALC_UNAVAILABLE_SOLID_LANE_LINE" 20 "ALC_ABORT_OTHER_REASON" 19 "ALC_ABORT_BLINKER_TURNED_OFF" 18 "ALC_ABORT_LC_HEALTH_BAD" 17 "ALC_ABORT_POOR_VIEW_RANGE" 16 "ALC_ABORT_SIDE_OBSTACLE_PRESENT_R" 15 "ALC_ABORT_SIDE_OBSTACLE_PRESENT_L" 14 "ALC_WAITING_FOR_FWD_OBST_TO_PASS_R" 13 "ALC_WAITING_FOR_FWD_OBST_TO_PASS_L" 12 "ALC_WAITING_FOR_SIDE_OBST_TO_PASS_R" 11 "ALC_WAITING_FOR_SIDE_OBST_TO_PASS_L" 10 "ALC_IN_PROGRESS_R" 9 "ALC_IN_PROGRESS_L" 8 "ALC_AVAILABLE_BOTH" 7 "ALC_AVAILABLE_ONLY_R" 6 "ALC_AVAILABLE_ONLY_L" 5 "ALC_UNAVAILABLE_VEHICLE_SPEED" 4 "ALC_UNAVAILABLE_EXITING_HIGHWAY" 3 "ALC_UNAVAILABLE_TP_FOLLOW" 2 "ALC_UNAVAILABLE_SONICS_INVALID" 1 "ALC_UNAVAILABLE_NO_LANES" 0 "ALC_UNAVAILABLE_DISABLED" ; +VAL_ 1001 DAS_headlightRequest 3 "DAS_HEADLIGHT_REQUEST_INVALID" 1 "DAS_HEADLIGHT_REQUEST_ON" 0 "DAS_HEADLIGHT_REQUEST_OFF" ; +VAL_ 1001 DAS_hazardLightRequest 3 "DAS_REQUEST_HAZARDS_SNA" 2 "DAS_REQUEST_HAZARDS_UNUSED" 1 "DAS_REQUEST_HAZARDS_ON" 0 "DAS_REQUEST_HAZARDS_OFF" ; +VAL_ 1001 DAS_wiperSpeed 15 "DAS_WIPER_SPEED_INVALID" 14 "DAS_WIPER_SPEED_14" 13 "DAS_WIPER_SPEED_13" 12 "DAS_WIPER_SPEED_12" 11 "DAS_WIPER_SPEED_11" 10 "DAS_WIPER_SPEED_10" 9 "DAS_WIPER_SPEED_9" 8 "DAS_WIPER_SPEED_8" 7 "DAS_WIPER_SPEED_7" 6 "DAS_WIPER_SPEED_6" 5 "DAS_WIPER_SPEED_5" 4 "DAS_WIPER_SPEED_4" 3 "DAS_WIPER_SPEED_3" 2 "DAS_WIPER_SPEED_2" 1 "DAS_WIPER_SPEED_1" 0 "DAS_WIPER_SPEED_OFF" ; +VAL_ 1001 DAS_turnIndicatorRequest 3 "DAS_TURN_INDICATOR_CANCEL" 2 "DAS_TURN_INDICATOR_RIGHT" 1 "DAS_TURN_INDICATOR_LEFT" 0 "DAS_TURN_INDICATOR_NONE" ; +VAL_ 1001 DAS_highLowBeamDecision 3 "DAS_HIGH_BEAM_SNA" 2 "DAS_HIGH_BEAM_ON" 1 "DAS_HIGH_BEAM_OFF" 0 "DAS_HIGH_BEAM_UNDECIDED" ; +VAL_ 1001 DAS_highLowBeamOffReason 5 "HIGH_BEAM_OFF_REASON_SNA" 4 "HIGH_BEAM_OFF_REASON_HEAD_LIGHT" 3 "HIGH_BEAM_OFF_REASON_AMBIENT_LIGHT" 2 "HIGH_BEAM_OFF_REASON_MOVING_RADAR_TARGET" 1 "HIGH_BEAM_OFF_REASON_MOVING_VISION_TARGET" 0 "HIGH_BEAM_ON" ; +VAL_ 1001 DAS_turnIndicatorRequestReason 6 "DAS_ACTIVE_COMMANDED_LANE_CHANGE" 5 "DAS_CANCEL_FORK" 4 "DAS_CANCEL_LANE_CHANGE" 3 "DAS_ACTIVE_FORK" 2 "DAS_ACTIVE_SPEED_LANE_CHANGE" 1 "DAS_ACTIVE_NAV_LANE_CHANGE" 0 "DAS_NONE" ; +VAL_ 1160 DAS_steeringAngleRequest 16384 "ZERO_ANGLE" ; +VAL_ 1160 DAS_steeringControlType 1 "ANGLE_CONTROL" 3 "DISABLED" 0 "NONE" 2 "RESERVED" ; +VAL_ 1160 DAS_steeringHapticRequest 1 "ACTIVE" 0 "IDLE" ; +VAL_ 1362 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; +VAL_ 1364 DriverBrakeApplied 1 "Yes" 0 "No" ; +VAL_ 1364 BrakeApplied 1 "Yes" 0 "No" ; +VAL_ 1364 BrakeOK 1 "Yes" 0 "No" ; +VAL_ 1364 Status 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; +VAL_ 1363 BrakeMode 3 "Reserved" 2 "Position Control" 1 "Relative Control" 0 "Disengadged" ; +VAL_ 861 IBST_d000_bmsInitTestFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d001_bmcSingleTransTest 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d002_tle5012SsccrcFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d003_tle5012Config 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d004_deadlMonTaskx1Ovr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d005_ecuWdFltCntTstFls 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d006_ecuWdScheduleTout 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d007_ecuWdStarttestFls 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d008_ecuWdStatusContErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d009_netOvrvolt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d010_micSpiTout 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d011_micSpiTransferErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d012_netUndvolt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d013_xpassToutErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d014_rpsOffsEeReadEmpty 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d015_rtpEnaHigh 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d016_xpassEchoCountErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d017_preDriveChckFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d018_ucSafetyFlt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d019_unsupportedHw 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d020_voltPreRegModeFld 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d021_ubbSupplyLine 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d022_stmAswSysTout 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d023_stackOvrUndFlow 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d024_smmOneReqsInit 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d025_ptsSupply 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d026_ptsSupplyUndvolt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d027_tempB6Plaus 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d028_ecuWdErrCntContErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d029_bmcShortedGateTest 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d030_controllerDevTooBig 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d031_ibDtrFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d032_oc6InitTestFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d033_oc6Monitor 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d034_motorOscillationDet 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d035_rpsOffsEeReadFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d036_sysErrHook 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d037_calIdlePosNotPlaus 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d038_boostSupUndrvolt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d039_calRoutineAbort 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d040_bmcGateUndervoltPro 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d041_hswInitPhseUndrvolt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d042_ltmWarnLevelReached 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d043_rpsVctrLengthRelErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d044_b6TempDegradeLevel1 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d045_B6TempDegradeLevel2 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d046_spiAnglOrRawNotUp 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d047_dcomIboosterNotInit 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d048_unintendMotorReturn 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d049_cdmOvrvoltLevel1 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d050_cdmUndrvoltLevel2 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d051_cdmUndrvoltLevel1 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d052_motTrvlRelReadFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d053_tle5012UnexpReset 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d054_bmsGateUndrvolt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d055_kl15HwPlausSw 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d056_ibNotShutDownRight 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d057_cdmHardUndrvolt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d058_cdmHardOvrvolt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d059_maxTrvlAdjstUpdFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d060_ltmLimitReached 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d061_dcomEcuDefect 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d062_inputStroke1RngHigh 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d063_inputStroke1RngLow 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d064_inputStroke2RngHigh 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d065_inputStroke2RngLow 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d066_ibSupVoltDivDrift 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d067_sOutRodToPressVal 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d068_tle5012LifeCnt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d069_cdmExtendedUndrvolt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d070_cdmExtendedOvrvolt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d071_tempB6Ch1LineHigh 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d072_tempB6Ch1LineLow 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d073_tempB6Ch2LineHigh 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d074_tempB6Ch2LineLow 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d075_hevSwitchOffDcom 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d076_tle5012VoltFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d077_bcsFltCurrentHigh 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d078_bcsFltCurrentLow 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d079_ecuSupVoltDivDrift 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d080_inputstroke1Grad 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d081_pts1Err 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d082_pts1LineGnd 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d083_pts1LineHigh 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d084_inputStroke2Grad 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d085_pts2Err 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d086_pts2LineGnd 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d087_pts2LineHigh 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d088_faildevInputStroke 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d089_ptsOffsTooHigh 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d090_pbistErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d091_ramInitErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d092_ramsinlgeFlt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d093_bertFlt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d094_CalDataNotPlaus 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d095_canEHwError 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d096_canETout 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d097_cpuException 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d098_ecuBandGap 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d099_ecuBmsOnWhileWdTout 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d100_ecuErrpinCntTstFls 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d101_ecuHetException 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d102_ecuHetTuAddErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d103_ecuHetTuBusErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d104_ecuHetTuBusyErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d105_ecuHetTuException 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d106_ecuTaskMissing 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d107_hetRefError 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d108_micInitSpiTstFld 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d109_micInitSpiTransfErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d110_micIntMonGenBitMon 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d111_micIntVoltMonFld 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d112_motPosTrvlReadEmpty 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d113_motAngBoundReadEmpt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d114_motShaftShiftDetect 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d115_osErrHook 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d116_pdurEInitFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d117_pdurEPduInstLost 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d118_pts1OffsEeReadEmpty 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d119_pts2OffsEeReadEmpty 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d120_rpsOffsXEeReadFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d121_rpsOffsYEeReadFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d122_rpsSynchEeReadFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d123_rpsAnglRecalcErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d124_motTrvlRelWriteFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d125_motTrvlRelReadEmpty 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d126_ptsEeReadEmpty 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d127_ecuAdcConversionErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d128_ecuAdcSelftestErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d129_ccmFlt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d130_ecuRomCheck 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d131_esmNmiFlt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d132_esmSafetyFlt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d133_motPosTrvlReadFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d134_motPosTrvlWriteFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d135_motAnglBndReadErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d136_motAnglBndWriteErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d137_motAnglGradTooLarge 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d138_pdmCustomerIdMis 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d139_pdmDtFormatMis 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d140_pdmOutOfMemory 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d141_pdmFieldSizeMis 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d142_pdmHwAcsErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d143_pdmInternalHWErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d144_ptsCalHysWritFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d145_ptsCalValuesChkFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d146_pts1CalEeReadFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d147_pts1CalEeWriteFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d148_rpsFailCompErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d149_pts1OffsEeWriteFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d150_pts2CalEeReadFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d151_pts2CalEeWriteFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d152_pts2OffsEeReadFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d153_pts2OffsEeWriteFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d154_rpsOffsXEeReadEmpty 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d155_rpsOffsXEeWriteFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d156_rpsOffsYEeReadEmpty 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d157_rpsOffsYEeWriteFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d158_rpsSynchEeReadEmpty 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d159_rpsSynchEeWriteFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d160_assertionFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d161_comsclBrkPrsPduLen 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d162_comsclBrkPrsPduTout 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d163_comsclEspIb1CntErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d164_comsclEspIb1CsErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d165_comsclEspIb1DlcErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d166_comsclEspIb1Tout 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d167_comsclEspIb2CntErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d168_comsclEspIb2CsErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d169_comsclEspIb2DlcErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d170_comsclEspIb2Tout 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d171_comsclEspIb3CntErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d172_comsclEspIb3CsErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d173_comsclEspIb3DlcErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d174_comsclEspIb3Tout 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d175_comsclGtwEsp1CntErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d176_comsclGtwEsp1CsErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d177_comsclGtwEsp1Corrpt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d178_comsclGtwEsp1Tout 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d179_dcomSmrtActuNotInit 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d180_rpsLengthAbsolHigh 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d181_rpsLengthAbsolLow 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d182_shutDownEeReadFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d183_shutDownEeWriteFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d184_maxTrvlAdjstReadErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d185_psOffsMcEeReadFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d186_psOffsMcEeWriteFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d187_ltmSelfProtDeact 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d188_pts1OffsEeReadFail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d189_diffStrokeRange 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d190_notProgVin 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d191_plausVin 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d192_dlCorCSumVin 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d193_ToutVin 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d194_ecuEnableB6Fail 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d195_ecuIbEnContErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d196_sclEspIb1pEstMax 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d197_sclEspIb1VehSpd 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d198_sclEspIb2pLimExt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d199_sclEspIb2qTarExt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d200_sclEspIb3pFBlend 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d201_sclEspIb3pMc1 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d202_sclEspIb3pTarDriver 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d203_netBusOffNet0 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d204_netErrPassivNet0 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d205_netBusOffNet1 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d206_netErrPassivNet1 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d207_maxStrokeReached 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d208_sysSwClockMismatch 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d209_comsclGtwOdoCorrpt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d210_comsclGtwStatCorrpt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d211_comsclEpbStatCorrpt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d212_comsclGtwOdoTout 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d213_comsclGtwStatTout 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d214_comsclEpbStatTout 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d215_comSclEpbStatCsErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d216_comSclEpbStatCntFlt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d217_comSclDiTrq1Tout 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d218_comSclDiTrq1Corrpt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d219_comSclDiTrq1CsErr 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 861 IBST_d220_comSclDiTrq1CntFlt 0 "NOT_TESTED_DTC" 1 "PASSED_DTC" 2 "FAILED_DTC" 3 "UNABLE_TO_TEST_DTC" ; +VAL_ 813 IBST_infoIndex 0 "DEPRECATED_0" 1 "DEPRECATED_1" 2 "DEPRECATED_2" 3 "DEPRECATED_3" 4 "DEPRECATED_4" 5 "DEPRECATED_5" 6 "DEPRECATED_6" 7 "DEPRECATED_7" 8 "DEPRECATED_8" 9 "DEPRECATED_9" 10 "BUILD_HWID_COMPONENTID" 11 "PCBAID_ASSYID_USAGEID" 13 "APP_CRC" 14 "BOOTLOADER_SVN" 15 "BOOTLOADER_CRC" 16 "SUBCOMPONENT" 17 "APP_GITHASH" 18 "BOOTLOADER_GITHASH" 19 "VERSION_DEPRECATED" 20 "UDS_PROTOCOL_BOOTCRC" 22 "VARIANT_CRC" 255 "END" ; +VAL_ 925 IBST_brakeInputStroke 1022 "NOT_VALID" 1023 "SNA" ; +VAL_ 925 IBST_iBoosterStatus 0 "NOT_INITIALIZED_OR_SUP" 1 "FAILURE" 2 "DIAGNOSIS" 3 "MAX_STROKE" 4 "STANDALONE" 5 "REDUCED" 6 "POST_RUN_REDUCED" 7 "READY" ; \ No newline at end of file diff --git a/opendbc/tesla_can_pre1916.dbc b/opendbc/tesla_can_pre1916.dbc new file mode 100644 index 000000000..fcb126647 --- /dev/null +++ b/opendbc/tesla_can_pre1916.dbc @@ -0,0 +1,1128 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: + XXX + +VAL_TABLE_ StW_AnglHP_Spd 16383 "SNA" ; +VAL_TABLE_ DI_aebFaultReason 15 "DI_AEB_FAULT_DAS_REQ_DI_UNAVAIL" 14 "DI_AEB_FAULT_ACCEL_REQ_INVALID" 13 "DI_AEB_FAULT_MIN_TIME_BTWN_EVENTS" 12 "DI_AEB_FAULT_ESP_MIA" 11 "DI_AEB_FAULT_ESP_FAULT" 10 "DI_AEB_FAULT_EPB_NOT_PARKED" 9 "DI_AEB_FAULT_ACCEL_OUT_OF_BOUNDS" 8 "DI_AEB_FAULT_PM_REQUEST" 7 "DI_AEB_FAULT_VEL_EST_ABNORMAL" 6 "DI_AEB_FAULT_DAS_SNA" 5 "DI_AEB_FAULT_DAS_CONTROL_MIA" 4 "DI_AEB_FAULT_SPEED_DELTA" 3 "DI_AEB_FAULT_EBR_FAULT" 2 "DI_AEB_FAULT_PM_MIA" 1 "DI_AEB_FAULT_EPB_MIA" 0 "DI_AEB_FAULT_NONE" ; +VAL_TABLE_ DI_aebLockState 3 "AEB_LOCK_STATE_SNA" 2 "AEB_LOCK_STATE_UNUSED" 1 "AEB_LOCK_STATE_UNLOCKED" 0 "AEB_LOCK_STATE_LOCKED" ; +VAL_TABLE_ DI_aebSmState 7 "DI_AEB_STATE_FAULT" 6 "DI_AEB_STATE_EXIT" 5 "DI_AEB_STATE_STANDSTILL" 4 "DI_AEB_STATE_STOPPING" 3 "DI_AEB_STATE_ENABLE" 2 "DI_AEB_STATE_ENABLE_INIT" 1 "DI_AEB_STATE_STANDBY" 0 "DI_AEB_STATE_UNAVAILABLE" ; +VAL_TABLE_ DI_aebState 7 "AEB_CAN_STATE_SNA" 4 "AEB_CAN_STATE_FAULT" 3 "AEB_CAN_STATE_STANDSTILL" 2 "AEB_CAN_STATE_ENABLED" 1 "AEB_CAN_STATE_STANDBY" 0 "AEB_CAN_STATE_UNAVAILABLE" ; +VAL_TABLE_ DI_epbInterfaceReady 1 "EPB_INTERFACE_READY" 0 "EPB_INTERFACE_NOT_READY" ; +VAL_TABLE_ DI_gear 7 "DI_GEAR_SNA" 4 "DI_GEAR_D" 3 "DI_GEAR_N" 2 "DI_GEAR_R" 1 "DI_GEAR_P" 0 "DI_GEAR_INVALID" ; +VAL_TABLE_ DI_gpoReason 8 "DI_GPO_NUMREASONS" 7 "DI_GPO_CAPACITOR_OVERTEMP" 6 "DI_GPO_NOT_ENOUGH_12V" 5 "DI_GPO_NO_BATTERY_POWER" 4 "DI_GPO_AMBIENT_OVERTEMP" 3 "DI_GPO_FLUID_DELTAT" 2 "DI_GPO_STATOR_OVERTEMP" 1 "DI_GPO_HEATSINK_OVERTEMP" 0 "DI_GPO_OUTLET_OVERTEMP" ; +VAL_TABLE_ DI_immobilizerCondition 1 "DI_IMM_CONDITION_LEARNED" 0 "DI_IMM_CONDITION_VIRGIN_SNA" ; +VAL_TABLE_ DI_immobilizerState 7 "DI_IMM_STATE_FAULT" 6 "DI_IMM_STATE_FAULTRETRY" 5 "DI_IMM_STATE_RESET" 4 "DI_IMM_STATE_LEARN" 3 "DI_IMM_STATE_DISARMED" 2 "DI_IMM_STATE_AUTHENTICATING" 1 "DI_IMM_STATE_REQUEST" 0 "DI_IMM_STATE_INIT_SNA" ; +VAL_TABLE_ DI_limpReason 24 "DI_LIMP_NUMREASONS" 23 "DI_LIMP_CAPACITOR_OVERTEMP" 22 "DI_LIMP_GTW_MIA" 21 "DI_LIMP_TRQCMD_VALIDITY_UNKNOWN" 20 "DI_LIMP_DI_MIA" 19 "DI_LIMP_CONFIG_MISMATCH" 18 "DI_LIMP_HEATSINK_TEMP" 17 "DI_LIMP_PMREQUEST" 16 "DI_LIMP_PMHEARTBEAT" 15 "DI_LIMP_TRQ_CROSS_CHECK" 14 "DI_LIMP_EXTERNAL_COMMAND" 13 "DI_LIMP_WRONG_CS_CALIBRATION" 12 "DI_LIMP_STATOR_TEMP" 11 "DI_LIMP_DELTAT_TOO_NEGATIVE" 10 "DI_LIMP_DELTAT_TOO_POSITIVE" 9 "DI_LIMP_AMBIENT_TEMP" 8 "DI_LIMP_OUTLET_TEMP" 7 "DI_LIMP_LOW_FLOW" 6 "DI_LIMP_BMS_MIA" 5 "DI_LIMP_12V_SUPPLY_UNDERVOLTAGE" 4 "DI_LIMP_NO_FLUID" 3 "DI_LIMP_NO_FUNC_HEATSINK_SENSOR" 2 "DI_LIMP_NO_FUNC_STATORT_SENSOR" 1 "DI_LIMP_BUSV_SENSOR_IRRATIONAL" 0 "DI_LIMP_PHASE_IMBALANCE" ; +VAL_TABLE_ DI_mode 2 "DI_MODE_DYNO" 1 "DI_MODE_DRIVE" 0 "DI_MODE_UNDEF" ; +VAL_TABLE_ DI_motorType 14 "DI_MOTOR_F2AE" 13 "DI_MOTOR_F2AD" 12 "DI_MOTOR_F2AC" 11 "DI_MOTOR_F2AB" 10 "DI_MOTOR_F1AC" 9 "DI_MOTOR_SSR1A" 8 "DI_MOTOR_F1A" 7 "DI_MOTOR_M7M6" 6 "DI_MOTOR_M8A" 5 "DI_MOTOR_M7M5" 4 "DI_MOTOR_M7M4" 3 "DI_MOTOR_M7M3" 2 "DI_MOTOR_ROADSTER_SPORT" 1 "DI_MOTOR_ROADSTER_BASE" 0 "DI_MOTOR_SNA" ; +VAL_TABLE_ DI_speedUnits 1 "DI_SPEED_KPH" 0 "DI_SPEED_MPH" ; +VAL_TABLE_ DI_state 4 "DI_STATE_ENABLE" 3 "DI_STATE_FAULT" 2 "DI_STATE_CLEAR_FAULT" 1 "DI_STATE_STANDBY" 0 "DI_STATE_PREAUTH" ; +VAL_TABLE_ DI_velocityEstimatorState 4 "VE_STATE_BACKUP_MOTOR" 3 "VE_STATE_BACKUP_WHEELS_B" 2 "VE_STATE_BACKUP_WHEELS_A" 1 "VE_STATE_WHEELS_NORMAL" 0 "VE_STATE_NOT_INITIALIZED" ; +VAL_TABLE_ DAS_DepartureWarning 3 "SNA" 2 "RIGHT_WARNING" 1 "LEFT_WARNING" 0 "NONE" ; +VAL_TABLE_ DAS_LaneDepartureWarningStatus 3 "DEGRADED" 2 "FAILED" 1 "INACTIVE" 0 "ACTIVE" ; +VAL_TABLE_ DAS_LaneTypeColor 15 "SNA" 14 "INVALID_YELLOW" 13 "BOTTS_DOTS_YELLOW" 12 "DOUBLE_LANE_YELLOW" 11 "ROAD_EDGE_YELLOW" 10 "UNDECIDED_YELLOW" 9 "SOLID_YELLOW" 8 "DASHED_YELLOW" 6 "INVALID" 5 "BOTTS_DOTS" 4 "DOUBLE_LANE" 3 "ROAD_EDGE" 2 "UNDECIDED" 1 "SOLID" 0 "DASHED" ; +VAL_TABLE_ DAS_NM_keepAwakeReason 2 "DAS_KEEPAWAKE_REASON_TELEMETRY" 1 "DAS_KEEPAWAKE_REASON_PRECONDITIONING" 0 "DAS_KEEPAWAKE_REASON_NONE_SNA" ; +VAL_TABLE_ DAS_SignType 255 "E_INVALID_SIGN" 254 "NO_SIGN_DETECTED" 221 "STANDARD_ELECTR_END_OF_NO_PASSING" 220 "STANDARD_ELECTR_NO_PASSING_START" 201 "REGULAR_END_OF_NO_PASSING" 200 "REGULAR_NO_PASSING_START" 176 "REGULAR_END_OF_PLAYGROUND_AREA" 175 "REGULAR_PLAYGROUND_AREA_BEGIN" 174 "STANDARD_REGULAR_END_OF_EXPRESSWAY" 173 "STANDARD_REGULAR_EXPRESSWAY_BEGIN" 172 "STANDARD_REGULAR_END_OF_MOTORWAY" 171 "STANDARD_REGULAR_MOTORWAY_BEGIN" 129 "STANDARD_ELECTRONIC_145" 128 "STANDARD_ELECTRONIC_135" 127 "STANDARD_ELECTRONIC_125" 126 "STANDARD_ELECTRONIC_115" 125 "STANDARD_ELECTRONIC_105" 124 "STANDARD_ELECTRONIC_95" 123 "STANDARD_ELECTRONIC_85" 122 "STANDARD_ELECTRONIC_75" 121 "STANDARD_ELECTRONIC_65" 120 "STANDARD_ELECTRONIC_55" 119 "STANDARD_ELECTRONIC_45" 118 "STANDARD_ELECTRONIC_35" 117 "STANDARD_ELECTRONIC_25" 116 "STANDARD_ELECTRONIC_15" 115 "STANDARD_ELECTRONIC_5" 114 "STANDARD_REGULAR_145" 113 "STANDARD_REGULAR_135" 112 "STANDARD_REGULAR_125" 111 "STANDARD_REGULAR_115" 110 "STANDARD_REGULAR_105" 109 "STANDARD_REGULAR_95" 108 "STANDARD_REGULAR_85" 107 "STANDARD_REGULAR_75" 106 "STANDARD_REGULAR_65" 105 "STANDARD_REGULAR_55" 104 "STANDARD_REGULAR_45" 103 "STANDARD_REGULAR_35" 102 "STANDARD_REGULAR_25" 101 "STANDARD_REGULAR_15" 100 "STANDARD_REGULAR_5" 65 "ELECTRIC_GEN_END_ALL_RESTRICTION" 64 "REGULAR_GEN_END_ALL_RESTRICT" 50 "ELECTRONIC_END_OF_NUM_RESTRICT" 41 "STANDARD_ELECTRONIC_140" 40 "STANDARD_ELECTRONIC_130" 39 "STANDARD_ELECTRONIC_120" 38 "STANDARD_ELECTRONIC_110" 37 "STANDARD_ELECTRONIC_100" 36 "STANDARD_ELECTRONIC_90" 35 "STANDARD_ELECTRONIC_80" 34 "STANDARD_ELECTRONIC_70" 33 "STANDARD_ELECTRONIC_60" 32 "STANDARD_ELECTRONIC_50" 31 "STANDARD_ELECTRONIC_40" 30 "STANDARD_ELECTRONIC_30" 29 "STANDARD_ELECTRONIC_20" 28 "STANDARD_ELECTRONIC_10" 20 "STANDARD_END_OF_NUM_RESTRICTION" 13 "STANDARD_REGULAR_140" 12 "STANDARD_REGULAR_130" 11 "STANDARD_REGULAR_120" 10 "STANDARD_REGULAR_110" 9 "STANDARD_REGULAR_100" 8 "STANDARD_REGULAR_90" 7 "STANDARD_REGULAR_80" 6 "STANDARD_REGULAR_70" 5 "STANDARD_REGULAR_60" 4 "STANDARD_REGULAR_50" 3 "STANDARD_REGULAR_40" 2 "STANDARD_REGULAR_30" 1 "STANDARD_REGULAR_20" 0 "STANDARD_REGULAR_10" ; +VAL_TABLE_ DAS_SteeringAngleRequest 16384 "ZERO_ANGLE" ; +VAL_TABLE_ DAS_aebEvent 3 "AEB_SNA" 2 "AEB_FAULT" 1 "AEB_ACTIVE" 0 "AEB_NOT_ACTIVE" ; +VAL_TABLE_ DAS_csa_internal_state 4 "CSA_INTERNAL_STATE_ENABLE_HOLD" 3 "CSA_INTERNAL_STATE_ENABLE_ACCELEROMETER" 2 "CSA_INTERNAL_STATE_ENABLE_PREDICTED" 1 "CSA_INTERNAL_STATE_AVAILABLE" 0 "CSA_INTERNAL_STATE_UNAVAILABLE" ; +VAL_TABLE_ DAS_eyeqAlert 3 "a003_eyeq_watchdog_reset" 2 "a002_eyeq_communication_timeout" 1 "a001_eyeq_boot_failure" ; +VAL_TABLE_ DAS_hazardLightRequest 3 "DAS_REQUEST_HAZARDS_SNA" 2 "DAS_REQUEST_HAZARDS_UNUSED" 1 "DAS_REQUEST_HAZARDS_ON" 0 "DAS_REQUEST_HAZARDS_OFF" ; +VAL_TABLE_ DAS_headlightRequest 3 "DAS_HEADLIGHT_REQUEST_INVALID" 1 "DAS_HEADLIGHT_REQUEST_ON" 0 "DAS_HEADLIGHT_REQUEST_OFF" ; +VAL_TABLE_ DAS_highLowBeamDecision 3 "DAS_HIGH_BEAM_SNA" 2 "DAS_HIGH_BEAM_ON" 1 "DAS_HIGH_BEAM_OFF" 0 "DAS_HIGH_BEAM_UNDECIDED" ; +VAL_TABLE_ DAS_highLowBeamOffReason 5 "HIGH_BEAM_OFF_REASON_SNA" 4 "HIGH_BEAM_OFF_REASON_HEAD_LIGHT" 3 "HIGH_BEAM_OFF_REASON_AMBIENT_LIGHT" 2 "HIGH_BEAM_OFF_REASON_MOVING_RADAR_TARGET" 1 "HIGH_BEAM_OFF_REASON_MOVING_VISION_TARGET" 0 "HIGH_BEAM_ON" ; +VAL_TABLE_ DAS_infoIndex 255 "DAS_INFO_END" 24 "DAS_INFO_EYEQ_FFS" 23 "DAS_INFO_EYEQ_APP" 20 "DAS_INFO_UDS_PROTOCOL_BOOTCRC" 19 "DAS_INFO_VERSION_DEPRECATED" 18 "DAS_INFO_BOOTLOADER_GITHASH" 17 "DAS_INFO_APP_GITHASH" 16 "DAS_INFO_EYEQ_BOOT" 15 "DAS_INFO_BOOTLOADER_CRC" 14 "DAS_INFO_BOOTLOADER_SVN" 13 "DAS_INFO_APP_CRC" 11 "DAS_INFO_PCBAID_ASSYID_USAGEID" 10 "DAS_INFO_BUILD_HWID_COMPONENTID" 9 "DAS_INFO_DEPRECATED_9" 8 "DAS_INFO_DEPRECATED_8" 7 "DAS_INFO_DEPRECATED_7" 6 "DAS_INFO_DEPRECATED_6" 5 "DAS_INFO_DEPRECATED_5" 4 "DAS_INFO_DEPRECATED_4" 3 "DAS_INFO_DEPRECATED_3" 2 "DAS_INFO_DEPRECATED_2" 1 "DAS_INFO_DEPRECATED_1" 0 "DAS_INFO_DEPRECATED_0" ; +VAL_TABLE_ DAS_locMode 3 "DAS_LOC_DRIVERLESS" 2 "DAS_LOC_RESTRICTED" 1 "DAS_LOC_NORMAL" 0 "DAS_LOC_OFF" ; +VAL_TABLE_ DAS_locRequest 4 "DAS_RQ_PARK" 3 "DAS_RQ_HOLD" 2 "DAS_RQ_BACKWARD" 1 "DAS_RQ_FORWARD" 0 "DAS_RQ_IDLE" ; +VAL_TABLE_ DAS_locState 7 "DAS_LOC_FAULT_SNA" 6 "DAS_LOC_AEB_ACTIVE" 2 "DAS_LOC_CANCEL_SILENT" 1 "DAS_LOC_CANCEL_GENERIC" 0 "DAS_LOC_HEALTHY" ; +VAL_TABLE_ DAS_steeringLKAOperatingStatus 3 "Not_available" 2 "Not_used" 1 "Operating" 0 "Inhibited" ; +VAL_TABLE_ DAS_sw019_020_taskID 5 "TASKS_VEHICLE" 4 "TASKS_MOBILEYE" 3 "TASKS_UDS" 2 "TASKS_CAN" 1 "TASKS_INIT" 0 "TASKS_RESERVED" ; +VAL_TABLE_ DAS_sw021_tempSensorId 4 "DDR_TEMP_SENSOR" 3 "CAMERA_TEMP_SENSOR" 2 "EYE_Q_TEMP_SENSOR_1" 1 "EYE_Q_TEMP_SENSOR_0" 0 "EXTERNAL_TEMP_SENSOR" ; +VAL_TABLE_ DAS_sw022_operation 4 "Erase All" 3 "Delete" 2 "Read" 1 "Write" 0 "Initialize" ; +VAL_TABLE_ DAS_sw024_heaterState 2 "SHORT" 1 "OPEN" 0 "NORMAL" ; +VAL_TABLE_ DAS_sw037_issue 1 "Invalid parameters" 0 "Failed to read" ; +VAL_TABLE_ DAS_sw043_mesp_health_main_state 172 "EYEQ_MESP_MAIN_STATE_TAC2" 170 "EYEQ_MESP_MAIN_STATE_DV" 146 "EYEQ_MESP_MAIN_STATE_VISION_INIT_PENDING" 133 "EYEQ_MESP_MAIN_STATE_TAC2_INIT_PENDING" 130 "EYEQ_MESP_MAIN_STATE_SPC_INIT_PENDING" 129 "EYEQ_MESP_MAIN_STATE_SPTAC_INIT_PENDING" 34 "EYEQ_MESP_MAIN_STATE_SPC" 33 "EYEQ_MESP_MAIN_STATE_SPTAC" 2 "EYEQ_MESP_MAIN_STATE_VISION" ; +VAL_TABLE_ DAS_sw043_mobileye_status 24 "MOBILEYE_STATUS_UNDEFINED" 23 "MOBILEYE_STATUS_TEARDOWN_FLASH_ACCESS_MODE" 22 "MOBILEYE_STATUS_FLASH_READ_MODE" 21 "MOBILEYE_STATUS_SETUP_FLASH_ACCESS_MODE" 20 "MOBILEYE_STATUS_RUNNING_SPTAC_MODE" 19 "MOBILEYE_STATUS_SPTAC_INIT_SENT" 18 "MOBILEYE_STATUS_WAITING_FOR_SPTAC_INIT" 17 "MOBILEYE_STATUS_BURN_EDR_MODE" 16 "MOBILEYE_STATUS_SPC_INIT_SENT" 15 "MOBILEYE_STATUS_WAITING_FOR_SPC_INIT" 14 "MOBILEYE_STATUS_ERROR" 13 "MOBILEYE_STATUS_LATCHING_FAILURE" 12 "MOBILEYE_STATUS_UPDATING" 11 "MOBILEYE_STATUS_RUNNING_DV_MODE" 10 "MOBILEYE_STATUS_WAITING_FOR_DV" 9 "MOBILEYE_STATUS_RUNNING_TAC_MODE" 8 "MOBILEYE_STATUS_RUNNING_SPC_MODE" 7 "MOBILEYE_STATUS_RUNNING_VISION_MODE" 6 "MOBILEYE_STATUS_TAC_INIT_SENT" 5 "MOBILEYE_STATUS_WAITING_FOR_TAC_INIT" 4 "MOBILEYE_STATUS_VISION_INIT_SENT" 3 "MOBILEYE_STATUS_WAITING_FOR_VISION_INIT" 2 "MOBILEYE_STATUS_WAITING_FOR_BOOT" 1 "MOBILEYE_STATUS_POWER_OFF" 0 "MOBILEYE_STATUS_POWER_CYCLE" ; +VAL_TABLE_ DAS_turnIndicatorRequest 3 "DAS_TURN_INDICATOR_CANCEL" 2 "DAS_TURN_INDICATOR_RIGHT" 1 "DAS_TURN_INDICATOR_LEFT" 0 "DAS_TURN_INDICATOR_NONE" ; +VAL_TABLE_ DAS_turnIndicatorRequestReason 6 "DAS_ACTIVE_COMMANDED_LANE_CHANGE" 5 "DAS_CANCEL_FORK" 4 "DAS_CANCEL_LANE_CHANGE" 3 "DAS_ACTIVE_FORK" 2 "DAS_ACTIVE_SPEED_LANE_CHANGE" 1 "DAS_ACTIVE_NAV_LANE_CHANGE" 0 "DAS_NONE" ; +VAL_TABLE_ DAS_wiperSpeed 15 "DAS_WIPER_SPEED_INVALID" 14 "DAS_WIPER_SPEED_14" 13 "DAS_WIPER_SPEED_13" 12 "DAS_WIPER_SPEED_12" 11 "DAS_WIPER_SPEED_11" 10 "DAS_WIPER_SPEED_10" 9 "DAS_WIPER_SPEED_9" 8 "DAS_WIPER_SPEED_8" 7 "DAS_WIPER_SPEED_7" 6 "DAS_WIPER_SPEED_6" 5 "DAS_WIPER_SPEED_5" 4 "DAS_WIPER_SPEED_4" 3 "DAS_WIPER_SPEED_3" 2 "DAS_WIPER_SPEED_2" 1 "DAS_WIPER_SPEED_1" 0 "DAS_WIPER_SPEED_OFF" ; + +BO_ 1160 DAS_steeringControl: 4 XXX + SG_ DAS_steeringControlType : 23|2@0+ (1,0) [0|0] "" XXX + SG_ DAS_steeringControlChecksum : 31|8@0+ (1,0) [0|0] "" XXX + SG_ DAS_steeringControlCounter : 19|4@0+ (1,0) [0|0] "" XXX + SG_ DAS_steeringAngleRequest : 6|15@0+ (0.1,-1638.35) [-1638.35|1638.35] "deg" XXX + SG_ DAS_steeringHapticRequest : 7|1@0+ (1,0) [0|0] "" XXX + +BO_ 257 GTW_epasControl: 3 XXX + SG_ GTW_epasControlChecksum : 23|8@0+ (1,0) [0|255] "" XXX + SG_ GTW_epasControlCounter : 11|4@0+ (1,0) [0|15] "" XXX + SG_ GTW_epasControlType : 15|2@0+ (1,0) [-1|4] "" XXX + SG_ GTW_epasEmergencyOn : 7|1@0+ (1,0) [-1|2] "" XXX + SG_ GTW_epasLDWEnabled : 12|1@0+ (1,0) [-1|2] "" XXX + SG_ GTW_epasPowerMode : 6|4@0+ (1,0) [4|14] "" XXX + SG_ GTW_epasTuneRequest : 2|3@0+ (1,0) [-1|8] "" XXX + +BO_ 880 EPAS_sysStatus: 8 XXX + SG_ EPAS_currentTuneMode : 7|4@0+ (1,0) [8|15] "" XXX + SG_ EPAS_eacErrorCode : 23|4@0+ (1,0) [-1|16] "" XXX + SG_ EPAS_eacStatus : 55|3@0+ (1,0) [5|7] "" XXX + SG_ EPAS_handsOnLevel : 39|2@0+ (1,0) [-1|4] "" XXX + SG_ EPAS_internalSAS : 37|14@0+ (0.1,-819.200012) [0|0] "deg" XXX + SG_ EPAS_steeringFault : 2|1@0+ (1,0) [-1|2] "" XXX + SG_ EPAS_steeringRackForce : 1|10@0+ (50,-25575) [0|0] "N" XXX + SG_ EPAS_steeringReduced : 3|1@0+ (1,0) [-1|2] "" XXX + SG_ EPAS_sysStatusChecksum : 63|8@0+ (1,0) [0|255] "" XXX + SG_ EPAS_sysStatusCounter : 51|4@0+ (1,0) [0|15] "" XXX + SG_ EPAS_torsionBarTorque : 19|12@0+ (0.01,-20.5) [0|0] "Nm" XXX + +BO_ 3 STW_ANGL_STAT: 8 XXX + SG_ StW_Angl : 5|14@0+ (0.5,-2048) [0|0] "deg" XXX + SG_ StW_AnglSpd : 21|14@0+ (0.5,-2048) [0|0] "/s" XXX + SG_ StW_AnglSens_Stat : 33|2@0+ (1,0) [-1|4] "" XXX + SG_ StW_AnglSens_Id : 35|2@0+ (1,0) [3|3] "" XXX + SG_ MC_STW_ANGL_STAT : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CRC_STW_ANGL_STAT : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 14 STW_ANGLHP_STAT: 8 XXX + + SG_ StW_AnglHP : 5|14@0+ (0.1,-819.2) [-819.2|819] "deg" XXX + SG_ StW_AnglHP_Spd : 21|14@0+ (0.5,-4096) [-4096|4095.5] "deg/s" XXX + SG_ StW_AnglHP_Sens_Stat : 33|2@0+ (1,0) [0|0] "" XXX + SG_ StW_AnglHP_Sens_Id : 35|2@0+ (1,0) [0|0] "" XXX + SG_ MC_STW_ANGLHP_STAT : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CRC_STW_ANGLHP_STAT : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 264 DI_torque1: 8 XXX + SG_ DI_torqueDriver : 0|13@1- (0.25,0) [-750|750] "Nm" XXX + SG_ DI_torque1Counter : 13|3@1+ (1,0) [0|0] "" XXX + SG_ DI_torqueMotor : 16|13@1- (0.25,0) [-750|750] "Nm" XXX + SG_ DI_soptState : 29|3@1+ (1,0) [0|0] "" XXX + SG_ DI_motorRPM : 32|16@1- (1,0) [-17000|17000] "RPM" XXX + SG_ DI_pedalPos : 48|8@1+ (0.4,0) [0|100] "%" XXX + SG_ DI_torque1Checksum : 56|8@1+ (1,0) [0|0] "" XXX + +BO_ 280 DI_torque2: 6 XXX + SG_ DI_torqueEstimate : 0|12@1- (0.5,0) [-750|750] "Nm" XXX + SG_ DI_gear : 12|3@1+ (1,0) [0|0] "" XXX + SG_ DI_brakePedal : 15|1@1+ (1,0) [0|0] "" XXX + SG_ DI_vehicleSpeed : 16|12@1+ (0.05,-25) [-25|179.75] "MPH" XXX + SG_ DI_gearRequest : 28|3@1+ (1,0) [0|0] "" XXX + SG_ DI_torqueInterfaceFailure : 31|1@1+ (1,0) [0|0] "" XXX + SG_ DI_torque2Counter : 32|4@1+ (1,0) [0|0] "" XXX + SG_ DI_brakePedalState : 36|2@1+ (1,0) [0|0] "" XXX + SG_ DI_epbParkRequest : 38|1@1+ (1,0) [0|0] "" XXX + SG_ DI_epbInterfaceReady : 39|1@1+ (1,0) [0|0] "" XXX + SG_ DI_torque2Checksum : 40|8@1+ (1,0) [0|0] "" XXX + +BO_ 309 ESP_135h: 5 XXX + SG_ ESP_135hChecksum : 23|8@0+ (1,0) [0|255] "" XXX + SG_ ESP_135hCounter : 11|4@0+ (1,0) [0|15] "" XXX + SG_ ESP_absBrakeEvent : 2|1@0+ (1,0) [-1|2] "" XXX + SG_ ESP_brakeDiscWipingActive : 4|1@0+ (1,0) [-1|2] "" XXX + SG_ ESP_brakeLamp : 3|1@0+ (1,0) [-1|2] "" XXX + SG_ ESP_espFaultLamp : 6|1@0+ (1,0) [-1|2] "" XXX + SG_ ESP_espLampFlash : 7|1@0+ (1,0) [-1|2] "" XXX + SG_ ESP_hillStartAssistActive : 1|2@0+ (1,0) [-1|4] "" XXX + SG_ ESP_messagePumpService : 24|1@0+ (1,0) [0|1] "" XXX + SG_ ESP_messagePumpFailure : 25|1@0+ (1,0) [0|1] "" XXX + SG_ ESP_messageEBDFailure : 26|1@0+ (1,0) [0|1] "" XXX + SG_ ESP_absFaultLamp : 27|1@0+ (1,0) [-1|2] "" XXX + SG_ ESP_tcDisabledByFault : 28|1@0+ (1,0) [0|1] "" XXX + SG_ ESP_messageDynoModeActive : 29|1@0+ (1,0) [0|1] "" XXX + SG_ ESP_hydraulicBoostEnabled : 30|1@0+ (1,0) [0|1] "" XXX + SG_ ESP_espOffLamp : 31|1@0+ (1,0) [-1|2] "" XXX + SG_ ESP_stabilityControlSts : 14|3@0+ (1,0) [6|7] "" XXX + SG_ ESP_tcLampFlash : 5|1@0+ (1,0) [-1|2] "" XXX + SG_ ESP_tcOffLamp : 15|1@0+ (1,0) [0|1] "" XXX + +BO_ 341 ESP_B: 8 XXX + SG_ ESP_BChecksum : 39|8@0+ (1,0) [0|255] "" XXX + SG_ ESP_BCounter : 62|4@0+ (1,0) [1|15] "" XXX + SG_ ESP_vehicleSpeed : 47|16@0+ (0.00999999978,0) [0|0] "kph" XXX + SG_ ESP_vehicleSpeedQF : 57|2@0+ (1,0) [1|2] "" XXX + SG_ ESP_wheelPulseCountFrL : 7|8@0+ (1,0) [0|254] "" XXX + SG_ ESP_wheelPulseCountFrR : 15|8@0+ (1,0) [0|254] "" XXX + SG_ ESP_wheelPulseCountReL : 23|8@0+ (1,0) [0|254] "" XXX + SG_ ESP_wheelPulseCountReR : 31|8@0+ (1,0) [0|254] "" XXX + +BO_ 513 SDM1: 5 XXX + SG_ SDM_bcklPassStatus : 3|2@0+ (1,0) [0|3] "" XXX + SG_ SDM_bcklDrivStatus : 5|2@0+ (1,0) [0|3] "" XXX + +BO_ 532 EPB_epasControl: 3 EPB + SG_ EPB_epasControlChecksum : 23|8@0+ (1,0) [0|255] "" XXX + SG_ EPB_epasControlCounter : 11|4@0+ (1,0) [0|15] "" XXX + SG_ EPB_epasEACAllow : 2|3@0+ (1,0) [4|7] "" XXX + +BO_ 782 PARK_status2: 8 PARK + SG_ PARK_frontSVACharID : 0|6@1+ (1,0) [0|63] "" DAS,GTW + SG_ PARK_pscRightCurbType : 6|2@1+ (1,0) [0|3] "" DAS,GTW + SG_ PARK_rearSVACharID : 8|6@1+ (1,0) [0|63] "" DAS,GTW + SG_ PARK_pscLeftCurbType : 14|2@1+ (1,0) [0|3] "" DAS,GTW + SG_ PARK_autoCalComplete : 16|1@1+ (1,0) [0|1] "" DAS,GTW + SG_ PARK_geometryType : 17|2@1+ (1,0) [0|3] "" GTW + SG_ PARK_tireFitment : 19|2@1+ (1,0) [0|3] "" DAS,GTW + SG_ PARK_rackDetected : 21|2@1+ (1,0) [0|3] "" DAS,GTW + SG_ PARK_sdiActive : 24|1@1+ (1,0) [0|1] "" DAS,GTW + SG_ PARK_sdiNoise : 25|2@1+ (1,0) [0|3] "" DAS,GTW + SG_ PARK_sdiBlindSpotRight : 27|2@1+ (1,0) [0|3] "" DAS,GTW + SG_ PARK_sdiBlindSpotLeft : 29|2@1+ (1,0) [0|3] "" DAS,GTW + SG_ PARK_status2Counter : 52|4@1+ (1,0) [0|0] "" GTW,DAS + SG_ PARK_status2Checksum : 56|8@1+ (1,0) [0|0] "" GTW + +BO_ 792 GTW_carState: 8 XXX + SG_ YEAR : 0|7@1+ (1,2000) [2000|2127] "Year" XXX + SG_ CERRD : 7|1@1+ (1,0) [0|1] "" XXX + SG_ MONTH : 8|4@1+ (1,0) [1|12] "Month" XXX + SG_ DOOR_STATE_FL : 12|2@1+ (1,0) [0|3] "" XXX + SG_ DOOR_STATE_FR : 14|2@1+ (1,0) [0|3] "" XXX + SG_ SECOND : 16|6@1+ (1,0) [0|59] "s" XXX + SG_ DOOR_STATE_RL : 22|2@1+ (1,0) [0|3] "" XXX + SG_ Hour : 24|5@1+ (1,0) [0|23] "h" XXX + SG_ DOOR_STATE_RR : 29|2@1+ (1,0) [0|3] "" XXX + SG_ DAY : 32|5@1+ (1,0) [0|31] "" XXX + SG_ MINUTE : 40|6@1+ (1,0) [0|59] "min" XXX + SG_ BOOT_STATE : 46|2@1+ (1,0) [0|3] "" XXX + SG_ GTW_updateInProgress : 48|2@1+ (1,0) [0|3] "" XXX + SG_ DOOR_STATE_FrontTrunk : 50|2@1+ (1,0) [0|3] "" XXX + SG_ MCU_factoryMode : 52|1@1+ (1,0) [0|1] "" XXX + SG_ MCU_transportModeOn : 53|1@0+ (1,0) [0|1] "" XXX + SG_ BC_headLightLStatus : 55|2@0+ (1,0) [0|3] "" XXX + SG_ BC_headLightRStatus : 57|2@0+ (1,0) [0|3] "" XXX + SG_ BC_indicatorLStatus : 59|2@0+ (1,0) [0|3] "" XXX + SG_ BC_indicatorRStatus : 61|2@0+ (1,0) [0|3] "" XXX + +BO_ 872 DI_state: 8 XXX + SG_ DI_systemState : 0|3@1+ (1,0) [0|0] "" XXX + SG_ DI_vehicleHoldState : 3|3@1+ (1,0) [0|0] "" XXX + SG_ DI_proximity : 6|1@1+ (1,0) [0|0] "" XXX + SG_ DI_driveReady : 7|1@1+ (1,0) [0|0] "" XXX + SG_ DI_regenLight : 8|1@1+ (1,0) [0|0] "" XXX + SG_ DI_state : 9|3@1+ (1,0) [0|0] "" XXX + SG_ DI_cruiseState : 12|4@1+ (1,0) [0|0] "" XXX + SG_ DI_analogSpeed : 16|12@1+ (0.1,0) [0|150] "speed" XXX + SG_ DI_immobilizerState : 28|3@1+ (1,0) [0|0] "" XXX + SG_ DI_speedUnits : 31|1@1+ (1,0) [0|1] "" XXX + SG_ DI_cruiseSet : 32|9@1+ (0.5,0) [0|255.5] "speed" XXX + SG_ DI_aebState : 41|3@1+ (1,0) [0|0] "" XXX + SG_ DI_stateCounter : 44|4@1+ (1,0) [0|0] "" XXX + SG_ DI_digitalSpeed : 48|8@1+ (1,0) [0|250] "" XXX + SG_ DI_stateChecksum : 56|8@1+ (1,0) [0|0] "" XXX + + BO_ 697 DAS_control: 8 XXX + SG_ DAS_setSpeed : 0|12@1+ (0.1,0) [0|409.4] "kph" XXX + SG_ DAS_accState : 12|4@1+ (1,0) [0|0] "" XXX + SG_ DAS_aebEvent : 16|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_jerkMin : 18|9@1+ (0.018,-9.1) [-9.1|0.097999999999999] "m/s^3" XXX + SG_ DAS_jerkMax : 27|8@1+ (0.034,0) [0|8.67] "m/s^3" XXX + SG_ DAS_accelMin : 35|9@1+ (0.04,-15) [-15|5.44] "m/s^2" XXX + SG_ DAS_accelMax : 44|9@1+ (0.04,-15) [-15|5.44] "m/s^2" XXX + SG_ DAS_controlCounter : 53|3@1+ (1,0) [0|0] "" XXX + SG_ DAS_controlChecksum : 56|8@1+ (1,0) [0|0] "" XXX + + BO_ 521 DAS_longControl: 8 XXX + SG_ DAS_locMode : 0|2@1+ (1,0) [0|0] "" XXX + SG_ DAS_locState : 2|3@1+ (1,0) [0|0] "" XXX + SG_ DAS_locRequest : 5|3@1+ (1,0) [0|0] "" XXX + SG_ DAS_locJerkMin : 8|8@1+ (0.034,-8.67) [-8.67|0] "m/s^3" XXX + SG_ DAS_locJerkMax : 16|8@1+ (0.034,0) [0|8.67] "m/s^3" XXX + SG_ DAS_locSpeed : 24|11@1+ (0.1,0) [0|204.7] "kph" XXX + SG_ DAS_locAccelMin : 35|9@1+ (0.04,-15) [-15|5.44] "m/s^2" XXX + SG_ DAS_locAccelMax : 44|9@1+ (0.04,-15) [-15|5.44] "m/s^2" XXX + SG_ DAS_longControlCounter : 53|3@1+ (1,0) [0|0] "" XXX + SG_ DAS_longControlChecksum : 56|8@1+ (1,0) [0|0] "" XXX + +BO_ 569 DAS_lanes: 8 XXX + SG_ DAS_leftLaneExists : 0|1@1+ (1,0) [0|0] "" XXX + SG_ DAS_rightLaneExists : 1|1@1+ (1,0) [0|0] "" XXX + SG_ DAS_virtualLaneWidth : 4|4@1+ (0.3125,2) [2|7] "m" XXX + SG_ DAS_virtualLaneViewRange : 8|8@1+ (1,0) [0|160] "m" XXX + SG_ DAS_virtualLaneC0 : 16|8@1+ (0.035,-3.5) [-3.5|3.5] "m" XXX + SG_ DAS_virtualLaneC1 : 24|8@1+ (0.0016,-0.2) [-0.2|0.2] "rad" XXX + SG_ DAS_virtualLaneC2 : 32|8@1+ (2E-05,-0.0025) [-0.0025|0.0025] "m-1" XXX + SG_ DAS_virtualLaneC3 : 40|8@1+ (2.4E-07,-3E-05) [-3E-05|3E-05] "m-2" XXX + SG_ DAS_leftLineUsage : 48|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_rightLineUsage : 50|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_leftFork : 52|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_rightFork : 54|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_lanesCounter : 60|4@1+ (1,0) [0|0] "" XXX + +BO_ 109 SBW_RQ_SCCM: 4 XXX + SG_ StW_Sw_Stat3 : 0|3@1+ (1,0) [0|0] "" XXX + SG_ MsgTxmtId : 6|2@1+ (1,0) [0|0] "" XXX + SG_ TSL_RND_Posn_StW : 8|4@1+ (1,0) [0|0] "" XXX + SG_ TSL_P_Psd_StW : 12|2@1+ (1,0) [0|0] "" XXX + SG_ MC_SBW_RQ_SCCM : 20|4@1+ (1,0) [0|15] "" XXX + SG_ CRC_SBW_RQ_SCCM : 24|8@1+ (1,0) [0|0] "" XXX + +BO_ 69 STW_ACTN_RQ: 8 XXX + SG_ SpdCtrlLvr_Stat : 0|6@1+ (1,0) [0|0] "" XXX + SG_ VSL_Enbl_Rq : 6|1@1+ (1,0) [0|0] "" XXX + SG_ SpdCtrlLvrStat_Inv : 7|1@1+ (1,0) [0|0] "" XXX + SG_ DTR_Dist_Rq : 8|8@1+ (1,0) [0|200] "" XXX + SG_ TurnIndLvr_Stat : 16|2@1+ (1,0) [0|0] "" XXX + SG_ HiBmLvr_Stat : 18|2@1+ (1,0) [0|0] "" XXX + SG_ WprWashSw_Psd : 20|2@1+ (1,0) [0|0] "" XXX + SG_ WprWash_R_Sw_Posn_V2 : 22|2@1+ (1,0) [0|0] "" XXX + SG_ StW_Lvr_Stat : 24|3@1+ (1,0) [0|0] "" XXX + SG_ StW_Cond_Flt : 27|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Cond_Psd : 28|2@1+ (1,0) [0|0] "" XXX + SG_ HrnSw_Psd : 30|2@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw00_Psd : 32|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw01_Psd : 33|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw02_Psd : 34|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw03_Psd : 35|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw04_Psd : 36|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw05_Psd : 37|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw06_Psd : 38|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw07_Psd : 39|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw08_Psd : 40|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw09_Psd : 41|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw10_Psd : 42|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw11_Psd : 43|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw12_Psd : 44|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw13_Psd : 45|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw14_Psd : 46|1@1+ (1,0) [0|0] "" XXX + SG_ StW_Sw15_Psd : 47|1@1+ (1,0) [0|0] "" XXX + SG_ WprSw6Posn : 48|3@1+ (1,0) [0|0] "" XXX + SG_ MC_STW_ACTN_RQ : 52|4@1+ (1,0) [0|15] "" XXX + SG_ CRC_STW_ACTN_RQ : 56|8@1+ (1,0) [0|0] "" XXX + +BO_ 643 BODY_R1: 8 XXX + SG_ AirTemp_Insd : 47|8@0+ (0.25,0) [0|63.5] "C" XXX + SG_ AirTemp_Outsd : 63|8@0+ (0.5,-40) [-40|86.5] "C" XXX + SG_ Bckl_Sw_RL_Stat_SAM_R : 49|2@0+ (1,0) [-1|4] "" XXX + SG_ Bckl_Sw_RM_Stat_SAM_R : 53|2@0+ (1,0) [-1|4] "" XXX + SG_ Bckl_Sw_RR_Stat_SAM_R : 51|2@0+ (1,0) [-1|4] "" XXX + SG_ DL_RLtch_Stat : 9|2@0+ (1,0) [-1|4] "" XXX + SG_ DrRLtch_FL_Stat : 1|2@0+ (1,0) [-1|4] "" XXX + SG_ DrRLtch_FR_Stat : 3|2@0+ (1,0) [-1|4] "" XXX + SG_ DrRLtch_RL_Stat : 5|2@0+ (1,0) [-1|4] "" XXX + SG_ DrRLtch_RR_Stat : 7|2@0+ (1,0) [-1|4] "" XXX + SG_ EngHd_Stat : 11|2@0+ (1,0) [-1|4] "" XXX + SG_ LoBm_On_Rq : 32|1@0+ (1,0) [0|1] "" XXX + SG_ HiBm_On : 33|1@0+ (1,0) [0|1] "" XXX + SG_ Hrn_On : 26|1@0+ (1,0) [0|1] "" XXX + SG_ IrLmp_D_Lt_Flt : 34|1@0+ (1,0) [0|1] "" XXX + SG_ IrLmp_P_Rt_Flt : 35|1@0+ (1,0) [0|1] "" XXX + SG_ LgtSens_Twlgt : 18|3@0+ (1,0) [0|7] "Steps" XXX + SG_ LgtSens_SNA : 19|1@0+ (1,0) [0|1] "" XXX + SG_ LgtSens_Tunnel : 20|1@0+ (1,0) [0|1] "" XXX + SG_ LgtSens_Flt : 21|1@0+ (1,0) [0|1] "" XXX + SG_ LgtSens_Night : 22|1@0+ (1,0) [-1|2] "" XXX + SG_ ADL_LoBm_On_Rq : 23|1@0+ (1,0) [0|1] "" XXX + SG_ LoBm_D_Lt_Flt : 36|1@0+ (1,0) [0|1] "" XXX + SG_ LoBm_P_Rt_Flt : 37|1@0+ (1,0) [0|1] "" XXX + SG_ MPkBrk_Stat : 28|1@0+ (1,0) [-1|2] "" XXX + SG_ RevGr_Engg : 39|2@0+ (1,0) [-1|4] "" XXX + SG_ StW_Cond_Stat : 55|2@0+ (1,0) [-1|4] "" XXX + SG_ Term54_Actv : 27|1@0+ (1,0) [0|1] "" XXX + SG_ Trlr_Stat : 25|2@0+ (1,0) [-1|4] "" XXX + SG_ VTA_Alm_Actv : 13|1@0+ (1,0) [0|1] "" XXX + SG_ WprOutsdPkPosn : 29|1@0+ (1,0) [0|1] "" XXX + +BO_ 760 UI_gpsVehicleSpeed: 8 XXX + SG_ UI_gpsHDOP : 0|8@1+ (0.1,0) [0|25.5] "1" XXX + SG_ UI_gpsVehicleHeading : 8|16@1+ (0.0078125,0) [0|511.9921875] "deg" XXX + SG_ UI_gpsVehicleSpeed : 24|16@1+ (0.00390625,0) [0|250.996] "km/hr" Vector__XXX + SG_ UI_userSpeedOffset : 40|6@1+ (1,-30) [-30|33] "kph/mph" XXX + SG_ UI_mapSpeedLimitUnits : 46|1@1+ (1,0) [0|1] "" XXX + SG_ UI_userSpeedOffsetUnits : 47|1@1+ (1,0) [0|1] "" XXX + SG_ UI_mppSpeedLimit : 48|5@1+ (5,0) [0|155] "kph/mph" XXX + SG_ UI_gpsNmeaMIA : 53|1@1+ (1,0) [0|0] "" XXX + +BO_ 536 MCU_chassisControl: 8 XXX + SG_ MCU_dasDebugEnable : 0|1@1+ (1,0) [0|0] "" XXX + SG_ MCU_parkBrakeRequest : 1|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_trailerModeCH : 3|1@1+ (1,0) [0|0] "" XXX + SG_ MCU_fcwSensitivity : 4|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_fcwEnable : 6|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_latControlEnable : 8|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_accOvertakeEnable : 10|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_ldwEnable : 12|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_aebEnable : 14|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_bsdEnable : 16|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_ahlbEnable : 18|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_parkSetting : 20|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_pedalSafetyEnable : 22|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_frontDefrostReq_das : 24|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_autoParkRequest : 26|4@1+ (1,0) [0|0] "" XXX + SG_ MCU_redLightStopSignEnable : 30|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_enableCreepTorqueCH : 32|1@1+ (1,0) [0|0] "" XXX + SG_ MCU_narrowGarages : 33|1@1+ (1,0) [0|0] "" XXX + SG_ MCU_rebootAutopilot : 34|1@1+ (1,0) [0|0] "" XXX + SG_ MCU_enableAutowipers : 35|1@1+ (1,0) [0|0] "" XXX + SG_ MCU_overPaintedUSS : 38|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_selfParkTune : 40|4@1+ (1,0) [0|15] "" XXX + SG_ MCU_towModeEnable : 44|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_zeroSpeedConfirmed : 46|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_aesEnable : 48|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_autoLaneChangeEnable : 50|2@1+ (1,0) [0|0] "" XXX + SG_ MCU_chassisControlCounter : 52|4@1+ (1,0) [0|0] "" XXX + SG_ MCU_chassisControlChecksum : 56|8@1+ (1,0) [0|0] "" XXX + +BO_ 904 MCU_clusterBacklightRequest: 3 XXX + SG_ MCU_clusterBacklightOn : 7|1@1+ (1,0) [0|1] "" XXX + SG_ MCU_clusterBrightnessLevel : 8|8@1+ (0.5,0) [0|127.5] "%" XXX + SG_ MCU_clusterReadyForDrive : 6|1@1+ (1,0) [-1|2] "" XXX + SG_ MCU_clusterReadyForPowerOff : 5|1@1+ (1,0) [0|1] "" XXX + +BO_ 984 MCU_locationStatus: 8 XXX + SG_ MCU_gpsAccuracy : 57|7@1+ (0.2,0) [0|0] "m" XXX + SG_ MCU_latitude : 0|28@1- (1E-06,0) [0|0] "deg" XXX + SG_ MCU_longitude : 28|29@1- (1E-06,0) [0|0] "deg" XXX + +BO_ 104 MCU_locationStatus2: 8 XXX + SG_ MCU_elevation : 0|32@1- (0.1,0) [0|0] "m" XXX + SG_ MCU_navigonExpectedSpeed : 32|7@1+ (1,0) [0|126] "mph" XXX + +BO_ 840 GTW_status: 8 XXX + SG_ GTW_accGoingDown : 6|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_accRailReq : 8|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_brakePressed : 1|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_driveGoingDown : 7|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_driveRailReq : 0|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_driverIsLeaving : 5|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_driverPresent : 2|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_hvacGoingDown : 11|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_hvacRailReq : 9|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_icPowerOff : 4|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_notEnough12VForDrive : 3|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_preconditionRequest : 10|1@0+ (1,0) [0|1] "" XXX + SG_ GTW_statusChecksum : 63|8@0+ (1,0) [0|255] "" XXX + SG_ GTW_statusCounter : 51|4@0+ (1,0) [0|15] "" XXX + +BO_ 920 GTW_carConfig: 8 XXX + SG_ GTW_performanceConfig : 2|3@0+ (1,0) [0|0] "" XXX + SG_ GTW_fourWheelDrive : 4|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_unknown1 : 5|1@0+ (1,0) [0|0] "" XXX + SG_ GTW_dasHw : 7|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_parkAssistInstalled : 9|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_forwardRadarHw : 11|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_airSuspensionInstalled : 14|3@0+ (1,0) [0|0] "" XXX + SG_ GTW_unknown2 : 15|1@0+ (1,0) [0|0] "" XXX + SG_ GTW_country : 23|16@0+ (1,0) [0|0] "" XXX + SG_ GTW_parkSensorGeometryType : 33|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_rhd : 34|1@0+ (1,0) [0|0] "" XXX + SG_ GTW_bodyControlsType : 35|1@0+ (1,0) [0|0] "" XXX + SG_ GTW_radarPosition : 39|4@0+ (1,0) [0|0] "" XXX + SG_ GTW_rearCornerRadarHw : 41|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_frontCornerRadarHw : 43|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_epasType : 45|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_chassisType : 47|2@0+ (1,0) [0|2] "" XXX + SG_ GTW_wheelType : 52|5@0+ (1,0) [0|0] "" XXX + SG_ GTW_rearSeatControllerMask : 55|3@0+ (1,0) [0|7] "" XXX + SG_ GTW_euVehicle : 56|1@0+ (1,0) [0|0] "" XXX + SG_ GTW_foldingMirrorsInstalled : 57|1@0+ (1,0) [0|0] "" XXX + SG_ GTW_brakeHwType : 59|2@0+ (1,0) [0|2] "" XXX + SG_ GTW_autopilot : 61|2@0+ (1,0) [0|0] "" XXX + SG_ GTW_unknown3 : 63|2@0+ (1,0) [0|0] "" XXX + +BO_ 1006 UI_autopilotControl: 8 XXX + SG_ UI_autopilotControlIndex M : 0|3@1+ (1,0) [0|7] "" XXX + SG_ UI_hovEnabled m0 : 3|1@1+ (1,0) [0|0] "" XXX + SG_ UI_donDisableAutoWiperDuration m0 : 4|3@1+ (1,0) [0|0] "" XXX + SG_ UI_donDisableOnAutoWiperSpeed m0 : 7|4@1+ (1,0) [0|0] "" XXX + SG_ UI_blindspotMinSpeed m0 : 11|4@1+ (1,0) [0|0] "" XXX + SG_ UI_blindspotDistance m0 : 15|3@1+ (1,0) [0|0] "" XXX + SG_ UI_blindspotTTC m0 : 18|3@1+ (1,0) [0|0] "" XXX + SG_ UI_donStopEndOfRampBuffer m0 : 21|3@1+ (1,0) [0|0] "" XXX + SG_ UI_donDisableCutin m0 : 24|1@1+ (1,0) [0|0] "" XXX + SG_ UI_donMinGoreWidthForAbortMap m0 : 25|4@1+ (1,0) [0|0] "" XXX + SG_ UI_donAlcProgGoreAbortThres m0 : 29|4@1+ (1,0) [0|0] "" XXX + SG_ UI_donMinGoreWidthForAbortNotMap m0 : 33|4@1+ (1,0) [0|0] "" XXX + SG_ UI_alcDisableUltrasonicCheck m0 : 37|1@1+ (1,0) [0|0] "" XXX + SG_ UI_alcUltrasonicDistance m0 : 38|4@1+ (1,0) [0|0] "" XXX + SG_ UI_alcUltrasonicWaitTime m0 : 42|3@1+ (1,0) [0|0] "" XXX + SG_ UI_alcEgoLeadingReactionAccel m0 : 48|2@1+ (1,0) [0|0] "" XXX + SG_ UI_alcMergIntervalRearDHyst m0 : 50|2@1+ (1,0) [0|0] "" XXX + SG_ UI_alcMergingIntervalHeadwayHyst m0 : 52|2@1+ (1,0) [0|0] "" XXX + SG_ UI_alcAssertivenessRate m0 : 54|2@1+ (1,0) [0|0] "" XXX + SG_ UI_alcViewRangeSensitivity m0 : 56|2@1+ (1,0) [0|0] "" XXX + SG_ UI_camBlockLaneCheckDisable m1 : 3|1@1+ (1,0) [0|0] "" XXX + SG_ UI_camBlockLaneCheckThreshold m1 : 4|6@1+ (0.01587,0) [0|1] "%" XXX + SG_ UI_camBlockBlurDisable m1 : 10|1@1+ (1,0) [0|0] "" XXX + SG_ UI_camBlockBlurThreshold m1 : 11|6@1+ (0.01587,0) [0|1] "%" XXX + +BO_ 728 UI_csaOfframpCurvature: 8 XXX + SG_ UI_csaOfframpCurvC2 : 0|16@1- (1E-06,0) [-0.032768|0.032767] "1/m" XXX + SG_ UI_csaOfframpCurvC3 : 16|16@1- (4E-09,0) [-0.000131072|0.000131068] "1/m2" XXX + SG_ UI_csaOfframpCurvRange : 32|8@1+ (2,0) [0|510] "m" XXX + SG_ UI_csaOfframpCurvCounter : 40|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ UI_csaOfframpCurvUsingTspline : 48|1@1+ (1,0) [0|1] "" XXX + SG_ UI_csaOfframpCurvReserved : 49|7@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_csaOfframpCurvChecksum : 56|8@1+ (1,0) [0|0] "" Vector__XXX + +BO_ 744 UI_csaRoadCurvature: 8 XXX + SG_ UI_csaRoadCurvC2 : 0|16@1- (1E-06,0) [-0.032768|0.032767] "1/m" XXX + SG_ UI_csaRoadCurvC3 : 16|16@1- (4E-09,0) [-0.000131072|0.000131068] "1/m2" XXX + SG_ UI_csaRoadCurvRange : 32|8@1+ (2,0) [0|510] "m" XXX + SG_ UI_csaRoadCurvCounter : 40|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ UI_csaRoadCurvUsingTspline : 48|1@1+ (1,0) [0|1] "" XXX + SG_ UI_csaRoadCurvReserved : 49|7@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_csaRoadCurvChecksum : 56|8@1+ (1,0) [0|0] "" Vector__XXX + +BO_ 1080 UI_driverAssistAnonDebugParams: 8 XXX + SG_ UI_anonDebugParam1 : 0|7@1+ (1,0) [0|100] "" XXX + SG_ UI_anonDebugFlag1 : 7|1@1+ (1,0) [0|0] "" XXX + SG_ UI_anonDebugParam2 : 8|7@1+ (1,0) [0|100] "" XXX + SG_ UI_anonDebugFlag2 : 15|1@1+ (1,0) [0|0] "" XXX + SG_ UI_anonDebugParam3 : 16|7@1+ (1,0) [0|100] "" XXX + SG_ UI_anonDebugFlag3 : 23|1@1+ (1,0) [0|0] "" XXX + SG_ UI_anonDebugParam4 : 24|7@1+ (1,0) [0|100] "" XXX + SG_ UI_anonDebugFlag4 : 31|1@1+ (1,0) [0|0] "" XXX + SG_ UI_anonDebugParam5 : 32|7@1+ (1,0) [0|100] "" XXX + SG_ UI_anonDebugParam6 : 40|7@1+ (1,0) [0|100] "" XXX + SG_ UI_anonDebugParam7 : 48|7@1+ (1,0) [0|100] "" XXX + SG_ UI_visionSpeedSlider : 56|7@1+ (1,0) [0|100] "" XXX + +BO_ 1000 UI_driverAssistControl: 8 XXX + SG_ UI_autopilotControlRequest : 0|1@1+ (1,0) [1|0] "" XXX + SG_ UI_ulcStalkConfirm : 1|1@1+ (1,0) [1|0] "" XXX + SG_ UI_summonHeartbeat : 2|2@1+ (1,0) [0|0] "" XXX + SG_ UI_curvSpeedAdaptDisable : 4|1@1+ (1,0) [0|0] "" XXX + SG_ UI_dasDeveloper : 5|1@1+ (1,0) [0|0] "" XXX + SG_ UI_enableVinAssociation : 6|1@1+ (1,0) [0|0] "" XXX + SG_ UI_lssLkaEnabled : 7|1@1+ (1,0) [0|0] "" XXX + SG_ UI_lssLdwEnabled : 8|1@1+ (1,0) [0|0] "" XXX + SG_ UI_autoSummonEnable : 10|1@1+ (1,0) [0|1] "" XXX + SG_ UI_exceptionListEnable : 11|1@1+ (1,0) [0|1] "" XXX + SG_ UI_roadCheckDisable : 12|1@1+ (1,0) [0|0] "" XXX + SG_ UI_driveOnMapsEnable : 13|1@1+ (1,0) [0|0] "" XXX + SG_ UI_handsOnRequirementDisable : 14|1@1+ (1,0) [0|0] "" XXX + SG_ UI_forksEnable : 15|1@1+ (1,0) [0|0] "" XXX + SG_ UI_fuseLanesDisable : 16|1@1+ (1,0) [0|0] "" XXX + SG_ UI_fuseHPPDisable : 17|1@1+ (1,0) [0|0] "" XXX + SG_ UI_fuseVehiclesDisable : 18|1@1+ (1,0) [0|0] "" XXX + SG_ UI_enableNextGenACC : 19|1@1+ (1,0) [0|1] "" XXX + SG_ UI_visionSpeedType : 20|2@1+ (1,0) [0|0] "" XXX + SG_ UI_curvatureDatabaseOnly : 22|1@1+ (1,0) [0|0] "" XXX + SG_ UI_lssElkEnabled : 23|1@1+ (1,0) [0|0] "" XXX + SG_ UI_summonExitType : 24|2@1+ (1,0) [0|3] "" XXX + SG_ UI_summonEntryType : 26|2@1+ (1,0) [0|3] "" XXX + SG_ UI_selfParkRequest : 28|4@1+ (1,0) [0|15] "" XXX + SG_ UI_summonReverseDist : 32|6@1+ (1,0) [0|63] "" XXX + SG_ UI_undertakeAssistEnable : 38|1@1+ (1,0) [0|0] "" XXX + SG_ UI_adaptiveSetSpeedEnable : 39|1@1+ (1,0) [0|0] "" XXX + SG_ UI_drivingSide : 40|2@1+ (1,0) [0|3] "" XXX + SG_ UI_enableClipTelemetry : 42|1@1+ (1,0) [0|0] "" XXX + SG_ UI_enableTripTelemetry : 43|1@1+ (1,0) [0|0] "" XXX + SG_ UI_enableRoadSegmentTelemetry : 44|1@1+ (1,0) [0|0] "" XXX + SG_ UI_followNavRouteEnable : 46|1@1+ (1,0) [0|0] "" XXX + SG_ UI_ulcSpeedConfig : 48|2@1+ (1,0) [0|3] "" XXX + SG_ UI_ulcBlindSpotConfig : 50|2@1+ (1,0) [0|3] "" XXX + SG_ UI_autopilotAlwaysOn : 52|1@1+ (1,0) [0|1] "" XXX + SG_ UI_accFromZero : 53|1@1+ (1,0) [0|1] "" XXX + SG_ UI_alcOffHighwayEnable : 54|1@1+ (1,0) [0|1] "" XXX + SG_ UI_validationLoop : 55|1@1+ (1,0) [0|1] "" XXX + SG_ UI_ulcOffHighway : 56|1@1+ (1,0) [0|1] "" XXX + SG_ UI_enableNavRouteCSA : 57|1@1+ (1,0) [0|1] "" XXX + SG_ UI_enableCutinExperiments : 58|1@1+ (1,0) [0|1] "" XXX + SG_ UI_source3D : 60|3@1+ (1,0) [0|7] "" XXX + SG_ UI_enableVisionOnlyStops : 63|1@1+ (1,0) [0|1] "" XXX + +BO_ 968 UI_driverAssistMapData: 8 XXX + SG_ UI_mapSpeedLimitDependency : 0|3@1+ (1,0) [0|0] "" XXX + SG_ UI_roadClass : 3|3@1+ (1,0) [0|0] "" XXX + SG_ UI_inSuperchargerGeofence : 6|1@1+ (1,0) [0|0] "" XXX + SG_ UI_mapSpeedUnits : 7|1@1+ (1,0) [0|0] "" XXX + SG_ UI_mapSpeedLimit : 8|5@1+ (1,0) [0|0] "" XXX + SG_ UI_mapSpeedLimitType : 13|3@1+ (1,0) [0|0] "" XXX + SG_ UI_countryCode : 16|10@1+ (1,0) [0|0] "" XXX + SG_ UI_streetCount : 26|2@1+ (1,0) [0|0] "" XXX + SG_ UI_gpsRoadMatch : 28|1@1+ (1,0) [0|0] "" XXX + SG_ UI_navRouteActive : 29|1@1+ (1,0) [0|0] "" XXX + SG_ UI_parallelAutoparkEnabled : 30|1@1+ (1,0) [0|1] "" XXX + SG_ UI_perpendicularAutoparkEnabled : 31|1@1+ (1,0) [0|1] "" XXX + SG_ UI_nextBranchDist : 32|5@1+ (10,0) [0|300] "m" XXX + SG_ UI_controlledAccess : 37|1@1+ (1,0) [0|0] "" XXX + SG_ UI_nextBranchLeftOffRamp : 38|1@1+ (1,0) [0|0] "" XXX + SG_ UI_nextBranchRightOffRamp : 39|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectLeftLane : 40|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectRightLane : 41|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectHPP : 42|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectNav : 43|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectLeftFreeSpace : 44|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectRightFreeSpace : 45|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectAutosteer : 46|1@1+ (1,0) [0|0] "" XXX + SG_ UI_rejectHandsOn : 47|1@1+ (1,0) [0|0] "" XXX + SG_ UI_acceptBottsDots : 48|1@1+ (1,0) [0|0] "" XXX + SG_ UI_autosteerRestricted : 49|1@1+ (1,0) [0|0] "" XXX + SG_ UI_pmmEnabled : 50|1@1+ (1,0) [0|0] "" XXX + SG_ UI_scaEnabled : 51|1@1+ (1,0) [0|0] "" XXX + SG_ UI_mapDataCounter : 52|4@1+ (1,0) [0|0] "" XXX + SG_ UI_mapDataChecksum : 56|8@1+ (1,0) [0|0] "" XXX + +BO_ 568 UI_driverAssistRoadSign: 8 XXX + SG_ UI_roadSign M : 0|8@1+ (1,0) [0|0] "" XXX + SG_ UI_splineLocConfidence : 40|7@1+ (1,0) [0|100] "" XXX + SG_ UI_splineID : 48|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ UI_roadSignCounter : 52|4@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_roadSignChecksum : 56|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_dummyData m0 : 8|1@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_stopSignStopLineDist m1 : 8|10@1+ (0.25,-8) [-8|247.5] "m" Vector__XXX + SG_ UI_stopSignStopLineConf m1 : 18|7@1+ (1,0) [0|100] "" Vector__XXX + SG_ UI_trafficLightStopLineDist m2 : 8|10@1+ (0.25,-8) [-8|247.5] "m" Vector__XXX + SG_ UI_trafficLightStopLineConf m2 : 18|7@1+ (1,0) [0|100] "" Vector__XXX + SG_ UI_baseMapSpeedLimitMPS m3 : 8|8@1+ (0.25,0) [0|63.75] "m/s" XXX + SG_ UI_bottomQrtlFleetSpeedMPS m3 : 16|8@1+ (0.25,0) [0|63.75] "m/s" XXX + SG_ UI_topQrtlFleetSpeedMPS m3 : 24|8@1+ (0.25,0) [0|63.75] "m/s" XXX + SG_ UI_meanFleetSplineSpeedMPS m4 : 8|8@1+ (0.25,0) [0|63.75] "m/s" XXX + SG_ UI_medianFleetSpeedMPS m4 : 16|8@1+ (0.25,0) [0|63.75] "m/s" XXX + SG_ UI_meanFleetSplineAccelMPS2 m4 : 24|8@1+ (0.05,-6.35) [-6.35|6.4] "m/s^2" XXX + SG_ UI_rampType m4 : 32|3@1+ (1,0) [0|7] "" XXX + SG_ UI_currSplineIdFull m5 : 8|32@1+ (1,0) [0|1] "" XXX + + +BO_ 696 UI_radarMapData: 8 XXX + SG_ UI_radarTargetDx : 0|8@1+ (1,-95) [-95|160] "m" XXX + SG_ UI_radarTargetDxEnd : 8|8@1+ (1,0) [0|255] "m" XXX + SG_ UI_radarTargetTrustMap : 16|1@1+ (1,0) [0|1] "" XXX + SG_ UI_radarEnableBraking : 17|1@1+ (1,0) [0|1] "" XXX + SG_ UI_radarMapDataCounter : 52|4@1+ (1,0) [0|0] "" XXX + SG_ UI_radarMapDataChecksum : 56|8@1+ (1,0) [0|0] "" XXX + +BO_ 712 UI_roadCurvature: 8 XXX + SG_ UI_roadCurvC0 : 0|11@1- (0.02,0) [-20.48|20.46] "m" XXX + SG_ UI_roadCurvC1 : 11|10@1- (0.00075,0) [-0.384|0.38325] "1" XXX + SG_ UI_roadCurvC2 : 21|14@1- (7.5E-06,0) [-0.03072|0.03071625] "1/m" XXX + SG_ UI_roadCurvC3 : 35|13@1- (3E-08,0) [-0.00012288|0.00012285] "1/m2" XXX + SG_ UI_roadCurvRange : 48|6@1+ (4,0) [0|252] "m" XXX + SG_ UI_roadCurvHealth : 54|2@1+ (1,0) [0|0] "" XXX + SG_ UI_roadCurvChecksum : 56|8@1+ (1,0) [0|0] "" Vector__XXX + +BO_ 582 UI_solarData: 5 XXX + SG_ UI_solarAzimuthAngle : 0|16@1- (1,0) [0|360] "deg" XXX + SG_ UI_solarAzimuthAngleCarRef : 16|9@1- (1,0) [-180|180] "deg" XXX + SG_ UI_isSunUp : 25|1@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_solarElevationAngle : 32|8@1- (1,0) [-90|90] "deg" XXX + +BO_ 824 UI_status: 8 XXX + SG_ UI_touchActive : 0|1@1+ (1,0) [0|0] "" IC + SG_ UI_audioActive : 1|1@1+ (1,0) [0|0] "" IC + SG_ UI_bluetoothActive : 2|1@1+ (1,0) [0|0] "" IC + SG_ UI_cellActive : 3|1@1+ (1,0) [0|0] "" IC + SG_ UI_displayReady : 4|1@1+ (1,0) [0|0] "" IC + SG_ UI_gpsActive : 5|1@1+ (1,0) [0|0] "" IC + SG_ UI_wifiConnected : 6|1@1+ (1,0) [0|0] "" IC,XXX + SG_ UI_systemActive : 7|1@1+ (1,0) [0|0] "" IC + SG_ UI_xmActive : 8|1@1+ (1,0) [0|0] "" IC + SG_ UI_displayOn : 9|1@1+ (1,0) [0|0] "" IC,XXX + SG_ UI_readyForDrive : 10|1@1+ (1,0) [0|0] "" IC + SG_ UI_cellConnected : 11|1@1+ (1,0) [0|0] "" IC,XXX + SG_ UI_vpnActive : 12|1@1+ (1,0) [0|0] "" IC,XXX + SG_ UI_wifiActive : 13|1@1+ (1,0) [0|0] "" IC + SG_ UI_cameraActive : 14|1@1+ (1,0) [0|0] "" IC,XXX + SG_ UI_usbActive : 15|1@1+ (1,0) [0|0] "" IC + SG_ UI_screenshotActive : 16|1@1+ (1,0) [0|0] "" IC,XXX + SG_ UI_monitorModemPower : 17|1@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_factoryReset : 18|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ UI_cellNetworkTechnology : 20|4@1+ (1,0) [0|15] "" XXX + SG_ UI_tegraCoreTemperature : 24|8@1+ (1,-64) [0|0] "deg C" IC + SG_ UI_tegraAmbientTemperature : 32|8@1+ (1,-64) [0|0] "deg C" IC + SG_ UI_googleWifiUsages : 40|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_autopilotTrial : 48|2@1+ (1,0) [0|0] "" XXX + SG_ UI_cellSignalBars : 50|3@1+ (1,0) [0|7] "" XXX + SG_ UI_hardwareType : 53|2@1+ (1,0) [0|3] "" XXX + SG_ UI_developmentCar : 55|1@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_cellReceiverPower : 56|8@1+ (1,-128) [-128|127] "dB" XXX + +BO_ 1064 UI_telemetryControl: 8 XXX + SG_ UI_TCR_enable : 0|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_moveStateStanding : 1|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_moveStateStopped : 2|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_moveStateMoving : 3|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_moveStateIndeterm : 4|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_classConstElem : 5|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_classMovingPed : 6|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_classMovingTwoWheel : 7|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_classMovingFourWheel : 8|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_classUnknown : 9|1@1+ (1,0) [0|0] "" XXX + SG_ UI_TCR_downSampleFactor : 16|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ UI_TCR_wExist : 24|5@1+ (1,0) [0|31] "" Vector__XXX + SG_ UI_TCR_vehSpeed : 32|8@1+ (1,0) [0|0] "" Vector__XXX + SG_ UI_TCR_minRCS : 40|8@1+ (0.25,-14) [-14|49.75] "dB" Vector__XXX + SG_ UI_TCR_maxDy : 48|5@1+ (0.5,0) [0|15.5] "m" Vector__XXX + SG_ UI_TCR_maxObjects : 56|5@1+ (1,0) [0|31] "" Vector__XXX + SG_ UI_TCR_maxRoadClass : 61|3@1+ (1,0) [0|7] "" Vector__XXX + +BO_ 522 BrakeMessage: 8 XXX + SG_ driverBrakeStatus : 2|2@1+ (1,0) [0|3] "" XXX + +BO_ 921 DAS_status: 8 XXX + SG_ DAS_autopilotState : 0|4@1+ (1,0) [0|0] "" GTW,APS,TAS2 + SG_ DAS_blindSpotRearLeft : 4|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_blindSpotRearRight : 6|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_fusedSpeedLimit : 8|5@1+ (5,0) [0|150] "kph/mph" GTW,APS + SG_ DAS_suppressSpeedWarning : 13|1@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_summonObstacle : 14|1@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_summonClearedGate : 15|1@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_visionOnlySpeedLimit : 16|5@1+ (5,0) [0|150] "kph/mph" GTW,APS + SG_ DAS_heaterState : 21|1@1+ (1,0) [0|0] "" GTW + SG_ DAS_forwardCollisionWarning : 22|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_autoparkReady : 24|1@1+ (1,0) [0|1] "" GTW,APS + SG_ DAS_autoParked : 25|1@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_autoparkWaitingForBrake : 26|1@1+ (1,0) [0|1] "" GTW,APS + SG_ DAS_summonFwdLeashReached : 27|1@1+ (1,0) [0|1] "" GTW,APS + SG_ DAS_summonRvsLeashReached : 28|1@1+ (1,0) [0|1] "" GTW,APS + SG_ DAS_lssState : 29|3@1+ (1,0) [0|0] "" GTW,APS,EPB + SG_ DAS_sideCollisionAvoid : 32|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_sideCollisionWarning : 34|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_sideCollisionInhibit : 36|1@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_laneDepartureWarning : 37|3@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_fleetSpeedState : 40|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_autopilotHandsOnState : 42|4@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_autoLaneChangeState : 46|5@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_summonAvailable : 51|1@1+ (1,0) [0|1] "" GTW,APS + SG_ DAS_statusCounter : 52|4@1+ (1,0) [0|0] "" GTW,APS,TAS2 + SG_ DAS_statusChecksum : 56|8@1+ (1,0) [0|0] "" GTW,APS,TAS2 + +BO_ 537 DAS_pscControl: 3 DAS + SG_ DAS_pscControlCounter : 0|4@1+ (1,0) [0|15] "" PARK,APS + SG_ DAS_pscParkState : 4|4@1+ (1,0) [0|15] "" PARK,EPB,APS + SG_ DAS_eacState : 8|3@1+ (1,0) [0|3] "" PARK,APS + SG_ DAS_pscControlChecksum : 16|8@1+ (1,0) [0|255] "" PARK,APS + +BO_ 905 DAS_status2: 8 XXX + SG_ DAS_accSpeedLimit : 0|10@1+ (0.2,0) [0|204.6] "mph" GTW,APS + SG_ DAS_pmmObstacleSeverity : 10|3@1+ (1,0) [0|7] "" GTW,APS + SG_ DAS_pmmLoggingRequest : 13|1@1+ (1,0) [0|1] "" GTW,APS + SG_ DAS_activationFailureStatus : 14|2@1+ (1,0) [0|1] "" GTW,APS + SG_ DAS_pmmUltrasonicsFaultReason : 16|3@1+ (1,0) [0|7] "" GTW,APS + SG_ DAS_pmmRadarFaultReason : 19|2@1+ (1,0) [0|3] "" GTW,APS + SG_ DAS_pmmSysFaultReason : 21|3@1+ (1,0) [0|7] "" GTW,APS + SG_ DAS_pmmCameraFaultReason : 24|2@1+ (1,0) [0|3] "" GTW,APS + SG_ DAS_ACC_report : 26|5@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_relaxCruiseLimits : 31|1@1+ (1,0) [0|0] "" GTW,APS,APP + SG_ DAS_csaState : 32|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_radarTelemetry : 34|2@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_robState : 36|2@1+ (1,0) [0|3] "" GTW,APS + SG_ DAS_driverInteractionLevel : 38|2@1+ (1,0) [0|3] "" GTW,APS + SG_ DAS_ppOffsetDesiredRamp : 40|8@1+ (0.01,-1.28) [-1.28|1.27] "m" GTW,APS + SG_ DAS_longCollisionWarning : 48|4@1+ (1,0) [0|15] "" GTW,APS + SG_ DAS_status2Counter : 52|4@1+ (1,0) [0|0] "" GTW,APS + SG_ DAS_status2Checksum : 56|8@1+ (1,0) [0|0] "" GTW,APS + +BO_ 937 DAS_telemetry: 8 XXX + SG_ DAS_telemetryMultiplexer M : 0|8@1+ (1,0) [0|0] "" XXX + SG_ DAS_telLeftLaneType m0 : 8|3@1+ (1,0) [0|0] "" XXX + SG_ DAS_telRightLaneType m0 : 11|3@1+ (1,0) [0|0] "" XXX + SG_ DAS_telLeftMarkerQuality m0 : 14|2@1+ (1,0) [0|0] "" XXX + SG_ DAS_telRightMarkerQuality m0 : 16|2@1+ (1,0) [0|0] "" XXX + SG_ DAS_telLeftMarkerColor m0 : 18|2@1+ (1,0) [0|0] "" XXX + SG_ DAS_telRightMarkerColor m0 : 20|2@1+ (1,0) [0|0] "" XXX + SG_ DAS_telLeftLaneCrossing m0 : 22|1@1+ (1,0) [0|0] "" XXX + SG_ DAS_telRightLaneCrossing m0 : 23|1@1+ (1,0) [0|0] "" XXX + SG_ DAS_MCPObserved m1 : 8|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_accReengaged m1 : 9|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_pedestrianInFOVBeforeIntr m1 : 10|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_pedestrianInFOVAfterIntr m1 : 11|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_camFreeSpaceBeforeIntr m1 : 12|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_camFreeSpaceAfterIntr m1 : 13|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_timeOfIntervention m1 : 14|6@1+ (0.25,0) [0|16] "s" XXX + SG_ DAS_timeOfFirstPedestrian m1 : 20|6@1+ (0.25,0) [0|16] "s" XXX + SG_ DAS_timeOfACCReengaging m1 : 26|6@1+ (0.25,0) [0|16] "s" XXX + SG_ DAS_durationOfPrevACCStandstill m1 : 32|6@1+ (0.5,0) [0|30] "s" XXX + SG_ DAS_maxAbsSteeringWheelAngle m1 : 38|7@1+ (2,0) [0|256] "degrees" XXX + SG_ DAS_targetRelvelAtIntervention m1 : 45|6@1+ (0.25,-2) [-2|13.5] "m/s" XXX + SG_ DAS_targetDistAtIntervention m1 : 51|6@1+ (0.5,0) [0|32] "m" XXX + SG_ DAS_egoSpeedAtIntervention m1 : 57|6@1+ (0.5,0) [0|32] "m/s" XXX + SG_ DAS_stopSignLongitudinalDist m2 : 8|10@1+ (0.1,0) [0|102.2] "m" XXX + SG_ DAS_stopSignLateralDist m2 : 18|8@1+ (0.25,-32) [-32|31.5] "m" XXX + SG_ DAS_stopSignHeight m2 : 26|6@1+ (0.1,0) [0|6.2] "m" XXX + SG_ DAS_stopSignStopLineDistance m2 : 32|10@1+ (0.1,-20) [-20|82.2] "m" XXX + SG_ DAS_stopSignCIPVDistance m2 : 42|6@1+ (0.5,0) [0|31.5] "m" XXX + SG_ DAS_stopSignHostAccel m2 : 48|10@1+ (0.01,-5) [-5|5.23] "m/s^2" XXX + SG_ DAS_stopSignCrossingWarning m2 : 58|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_stopSignIndex m2 : 59|4@1+ (1,0) [0|15] "" XXX + SG_ DAS_csaOverride m7 : 10|1@1+ (1,0) [0|0] "" XXX + SG_ DAS_csaIntState m7 : 11|3@1+ (1,0) [0|3] "" XXX + SG_ DAS_csaEnableSpeed m7 : 14|12@1+ (0.05,-25) [-25|179.75] "MPH" XXX + SG_ DAS_csaDisableSpeed m7 : 26|12@1+ (0.05,-25) [-25|179.75] "MPH" XXX + SG_ DAS_csaFiltCurv m7 : 40|16@1- (1E-06,0) [-0.032768|0.032767] "1/m" XXX + SG_ DAS_csaMeasLatAccel m7 : 56|8@1+ (0.08,-10.24) [-10.24|10] "m/s^2" XXX + SG_ DAS_soCamCipvStatus m8 : 8|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_soRad5Status m8 : 10|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_soRad1Status m8 : 12|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_soCamCipvDx m8 : 14|6@1+ (2,0) [0|126] "m" XXX + SG_ DAS_soRad1Dx m8 : 20|6@1+ (2,0) [0|126] "m" XXX + SG_ DAS_soRad5Dx m8 : 26|6@1+ (2,0) [0|126] "m" XXX + SG_ DAS_soCamCipvDy m8 : 32|5@1+ (0.4,-6.4) [-6.4|6] "m" XXX + SG_ DAS_soRad5Dy m8 : 37|5@1+ (0.4,-6.4) [-6.4|6] "m" XXX + SG_ DAS_soCamCipvVx m8 : 42|5@1+ (1,0) [0|31] "m/s" XXX + SG_ DAS_soRad5ObstProb m8 : 47|4@1+ (0.0625,0) [0|0.9375] "probability" XXX + SG_ DAS_soRad5Dz m8 : 51|6@1+ (0.25,-5) [-5|10.75] "m" XXX + SG_ DAS_soRad5powerdB m8 : 57|7@1+ (2,0) [0|254] "dB" XXX + SG_ DAS_assPrevSetSpeed m9 : 8|8@1+ (0.25,0) [0|63.75] "m/s" XXX + SG_ DAS_assNewSetSpeed m9 : 16|8@1+ (0.25,0) [0|63.75] "m/s" XXX + SG_ DAS_assFusedSpeedLimit m9 : 24|6@1+ (1,0) [0|63] "m/s" XXX + SG_ DAS_assAutosteerActive m9 : 30|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_assSmartSpeedActive m9 : 31|1@1+ (2,0) [0|1] "" XXX + +BO_ 1001 DAS_bodyControls: 8 XXX + SG_ DAS_headlightRequest : 0|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_hazardLightRequest : 2|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_wiperSpeed : 4|4@1+ (1,0) [0|15] "" XXX + SG_ DAS_turnIndicatorRequest : 8|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_highLowBeamDecision : 10|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_highLowBeamOffReason : 12|3@1+ (1,0) [0|4] "" XXX + SG_ DAS_turnIndicatorRequestReason : 16|4@1+ (1,0) [0|15] "" XXX + SG_ DAS_bodyControlsCounter : 52|4@1+ (1,0) [0|15] "" XXX + SG_ DAS_bodyControlsChecksum : 56|8@1+ (1,0) [0|255] "" XXX + +BO_ 777 DAS_object: 8 XXX + SG_ DAS_objectId M : 0|3@1+ (1,0) [0|7] "" XXX + SG_ DAS_leadVehType m0 : 3|3@1+ (1,0) [0|7] "" XXX + SG_ DAS_leadVehRelevantForControl m0 : 7|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_leadVehDx m0 : 8|8@1+ (0.5,0) [0|127] "m" XXX + SG_ DAS_leadVehVxRel m0 : 16|4@1+ (4,-30) [-30|26] "m/s" XXX + SG_ DAS_leadVehDy m0 : 20|7@1+ (0.35,-22.05) [-22.05|22.4] "m" XXX + SG_ DAS_leadVehId m0 : 27|7@1+ (1,0) [0|126] "" XXX + SG_ DAS_leadVeh2Type m0 : 34|3@1+ (1,0) [0|7] "" XXX + SG_ DAS_leadVeh2RelevantForControl m0 : 38|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_leadVeh2Dx m0 : 39|8@1+ (0.5,0) [0|127] "m" XXX + SG_ DAS_leadVeh2VxRel m0 : 47|4@1+ (4,-30) [-30|26] "m/s" XXX + SG_ DAS_leadVeh2Dy m0 : 51|7@1+ (0.35,-22.05) [-22.05|22.4] "m" XXX + SG_ DAS_leadVeh2Id m0 : 58|6@1+ (1,0) [0|63] "" XXX + SG_ DAS_leftVehType m1 : 3|3@1+ (1,0) [0|7] "" XXX + SG_ DAS_leftVehRelevantForControl m1 : 7|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_leftVehDx m1 : 8|8@1+ (0.5,0) [0|127] "m" XXX + SG_ DAS_leftVehVxRel m1 : 16|4@1+ (4,-30) [-30|26] "m/s" XXX + SG_ DAS_leftVehDy m1 : 20|7@1+ (0.35,-22.05) [-22.05|22.4] "m" XXX + SG_ DAS_leftVehId m1 : 27|7@1+ (1,0) [0|126] "" XXX + SG_ DAS_leftVeh2Type m1 : 34|3@1+ (1,0) [0|7] "" XXX + SG_ DAS_leftVeh2RelevantForControl m1 : 38|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_leftVeh2Dx m1 : 39|8@1+ (0.5,0) [0|127] "m" XXX + SG_ DAS_leftVeh2VxRel m1 : 47|4@1+ (4,-30) [-30|26] "m/s" XXX + SG_ DAS_leftVeh2Dy m1 : 51|7@1+ (0.35,-22.05) [-22.05|22.4] "m" XXX + SG_ DAS_leftVeh2Id m1 : 58|6@1+ (1,0) [0|63] "" XXX + SG_ DAS_rightVehType m2 : 3|3@1+ (1,0) [0|7] "" XXX + SG_ DAS_rightVehRelevantForControl m2 : 7|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_rightVehDx m2 : 8|8@1+ (0.5,0) [0|127] "m" XXX + SG_ DAS_rightVehVxRel m2 : 16|4@1+ (4,-30) [-30|26] "m/s" XXX + SG_ DAS_rightVehDy m2 : 20|7@1+ (0.35,-22.05) [-22.05|22.4] "m" XXX + SG_ DAS_rightVehId m2 : 27|7@1+ (1,0) [0|126] "" XXX + SG_ DAS_rightVeh2Type m2 : 34|3@1+ (1,0) [0|7] "" XXX + SG_ DAS_rightVeh2RelevantForControl m2 : 38|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_rightVeh2Dx m2 : 39|8@1+ (0.5,0) [0|127] "m" XXX + SG_ DAS_rightVeh2VxRel m2 : 47|4@1+ (4,-30) [-30|26] "m/s" XXX + SG_ DAS_rightVeh2Dy m2 : 51|7@1+ (0.35,-22.05) [-22.05|22.4] "m" XXX + SG_ DAS_rightVeh2Id m2 : 58|6@1+ (1,0) [0|63] "" XXX + SG_ DAS_cutinVehType m3 : 3|3@1+ (1,0) [0|7] "" XXX + SG_ DAS_cutinVehRelevantForControl m3 : 7|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_cutinVehDx m3 : 8|8@1+ (0.5,0) [0|127] "m" XXX + SG_ DAS_cutinVehVxRel m3 : 16|4@1+ (4,-30) [-30|26] "m/s" XXX + SG_ DAS_cutinVehDy m3 : 20|7@1+ (0.35,-22.05) [-22.05|22.4] "m" XXX + SG_ DAS_cutinVehId m3 : 27|7@1+ (1,0) [0|126] "" XXX + SG_ DAS_roadSignColor m4 : 3|3@1+ (1,0) [0|7] "" XXX + SG_ DAS_roadSignId m4 : 6|8@1+ (1,0) [0|0] "" XXX + SG_ DAS_roadSignStopLineDist m4 : 14|10@1+ (0.2,-20) [-20|184.4] "m" XXX + SG_ DAS_roadSignControlActive m4 : 24|1@1+ (1,0) [0|1] "" XXX + SG_ DAS_roadSignSource m4 : 25|2@1+ (1,0) [0|3] "" XXX + SG_ DAS_roadSignArrow m4 : 27|3@1+ (1,0) [0|7] "" XXX + SG_ DAS_roadSignOrientation m4 : 30|2@1+ (1,0) [0|1] "" XXX + SG_ DAS_leadVehHeading m5 : 8|8@1+ (0.0245437,-3.1415936) [-3.1415936|3.0925062] "rad" XXX + SG_ DAS_leadVeh2Heading m5 : 16|8@1+ (0.0245437,-3.1415936) [-3.1415936|3.0925062] "rad" XXX + SG_ DAS_leftVehHeading m5 : 24|8@1+ (0.0245437,-3.1415936) [-3.1415936|3.0925062] "rad" XXX + SG_ DAS_leftVeh2Heading m5 : 32|8@1+ (0.0245437,-3.1415936) [-3.1415936|3.0925062] "rad" XXX + SG_ DAS_rightVehHeading m5 : 40|8@1+ (0.0245437,-3.1415936) [-3.1415936|3.0925062] "rad" XXX + SG_ DAS_rightVeh2Heading m5 : 48|8@1+ (0.0245437,-3.1415936) [-3.1415936|3.0925062] "rad" XXX + SG_ DAS_cutinVehHeading m5 : 56|8@1+ (0.0245437,-3.1415936) [-3.1415936|3.0925062] "rad" XXX + +BO_ 1361 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.0507968128,-22.85856576) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.1015936256,-22.85856576) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ IDX : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM : 47|8@0+ (1,0) [0|3] "" INTERCEPTOR + +BO_ 1362 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.0507968128,-22.85856576) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.1015936256,-22.85856576) [0|1] "" EON + SG_ STATE : 35|4@0+ (1,0) [0|15] "" EON + SG_ IDX : 39|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM : 47|8@0+ (1,0) [0|3] "" EON + + +VAL_ 3 StW_Angl 16383 "SNA" ; +VAL_ 3 StW_AnglSens_Id 2 "MUST" 0 "PSBL" 1 "SELF" ; +VAL_ 3 StW_AnglSens_Stat 2 "ERR" 3 "ERR_INI" 1 "INI" 0 "OK" ; +VAL_ 3 StW_AnglSpd 16383 "SNA" ; +VAL_ 14 StW_AnglHP 16383 "SNA" ; +VAL_ 14 StW_AnglHP_Spd 16383 "SNA" ; +VAL_ 14 StW_AnglHP_Sens_Stat 3 "SNA" 2 "ERR" 1 "INI" 0 "OK" ; +VAL_ 14 StW_AnglHP_Sens_Id 3 "SNA" 2 "KOSTAL" 1 "DELPHI" 0 "TEST" ; +VAL_ 69 SpdCtrlLvr_Stat 32 "DN_1ST" 16 "UP_1ST" 8 "DN_2ND" 4 "UP_2ND" 2 "RWD" 1 "FWD" 0 "IDLE" ; +VAL_ 69 DTR_Dist_Rq 255 "SNA" 200 "ACC_DIST_7" 166 "ACC_DIST_6" 133 "ACC_DIST_5" 100 "ACC_DIST_4" 66 "ACC_DIST_3" 33 "ACC_DIST_2" 0 "ACC_DIST_1" ; +VAL_ 69 TurnIndLvr_Stat 3 "SNA" 2 "RIGHT" 1 "LEFT" 0 "IDLE" ; +VAL_ 69 HiBmLvr_Stat 3 "SNA" 2 "HIBM_FLSH_ON_PSD" 1 "HIBM_ON_PSD" 0 "IDLE" ; +VAL_ 69 WprWashSw_Psd 3 "SNA" 2 "WASH" 1 "TIPWIPE" 0 "NPSD" ; +VAL_ 69 WprWash_R_Sw_Posn_V2 3 "SNA" 2 "WASH" 1 "INTERVAL" 0 "OFF" ; +VAL_ 69 StW_Lvr_Stat 4 "STW_BACK" 3 "STW_FWD" 2 "STW_DOWN" 1 "STW_UP" 0 "NPSD" ; +VAL_ 69 StW_Cond_Psd 3 "SNA" 2 "DOWN" 1 "UP" 0 "NPSD" ; +VAL_ 69 HrnSw_Psd 3 "SNA" 2 "NDEF2" 1 "PSD" 0 "NPSD" ; +VAL_ 69 StW_Sw00_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ; +VAL_ 69 StW_Sw01_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ; +VAL_ 69 StW_Sw03_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ; +VAL_ 69 StW_Sw04_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ; +VAL_ 69 WprSw6Posn 7 "SNA" 6 "STAGE2" 5 "STAGE1" 4 "INTERVAL4" 3 "INTERVAL3" 2 "INTERVAL2" 1 "INTERVAL1" 0 "OFF" ; +VAL_ 257 GTW_epasControlType 0 "WITHOUT" 1 "WITH_ANGLE" 3 "WITH_BOTH" 2 "WITH_TORQUE" ; +VAL_ 109 StW_Sw_Stat3 7 "SNA" 6 "NDEF6" 5 "NDEF5" 4 "NDEF4" 3 "PLUS_MINUS" 2 "MINUS" 1 "PLUS" 0 "NPSD" ; +VAL_ 109 MsgTxmtId 3 "NDEF3" 2 "NDEF2" 1 "SCCM" 0 "EWM" ; +VAL_ 109 TSL_RND_Posn_StW 15 "SNA" 8 "D" 6 "INI" 4 "N_DOWN" 2 "N_UP" 1 "R" 0 "IDLE" ; +VAL_ 109 TSL_P_Psd_StW 3 "SNA" 2 "INI" 1 "PSD" 0 "IDLE" ; +VAL_ 257 GTW_epasEmergencyOn 1 "EMERGENCY_POWER" 0 "NONE" ; +VAL_ 257 GTW_epasLDWEnabled 1 "ALLOWED" 0 "INHIBITED" ; +VAL_ 257 GTW_epasPowerMode 0 "DRIVE_OFF" 1 "DRIVE_ON" 3 "LOAD_SHED" 2 "SHUTTING_DOWN" 15 "SNA" ; +VAL_ 257 GTW_epasTuneRequest 1 "DM_COMFORT" 3 "DM_SPORT" 2 "DM_STANDARD" 0 "FAIL_SAFE_DEFAULT" 4 "RWD_COMFORT" 6 "RWD_SPORT" 5 "RWD_STANDARD" 7 "SNA" ; +VAL_ 264 DI_torqueDriver -4096 "SNA" ; +VAL_ 264 DI_torqueMotor -4096 "SNA" ; +VAL_ 264 DI_soptState 7 "SOPT_TEST_SNA" 4 "SOPT_TEST_NOT_RUN" 3 "SOPT_TEST_PASSED" 2 "SOPT_TEST_FAILED" 1 "SOPT_TEST_IN_PROGRESS" 0 "SOPT_PRE_TEST" ; +VAL_ 264 DI_motorRPM -32768 "SNA" ; +VAL_ 264 DI_pedalPos 255 "SNA" ; +VAL_ 280 DI_torqueEstimate -2048 "SNA" ; +VAL_ 280 DI_gear 7 "DI_GEAR_SNA" 4 "DI_GEAR_D" 3 "DI_GEAR_N" 2 "DI_GEAR_R" 1 "DI_GEAR_P" 0 "DI_GEAR_INVALID" ; +VAL_ 280 DI_brakePedal 1 "Applied" 0 "Not_applied" ; +VAL_ 280 DI_vehicleSpeed 4095 "SNA" ; +VAL_ 280 DI_gearRequest 7 "DI_GEAR_SNA" 4 "DI_GEAR_D" 3 "DI_GEAR_N" 2 "DI_GEAR_R" 1 "DI_GEAR_P" 0 "DI_GEAR_INVALID" ; +VAL_ 280 DI_torqueInterfaceFailure 1 "TORQUE_INTERFACE_FAILED" 0 "TORQUE_INTERFACE_NORMAL" ; +VAL_ 280 DI_brakePedalState 3 "SNA" 2 "INVALID" 1 "ON" 0 "OFF" ; +VAL_ 280 DI_epbParkRequest 1 "Park_requested" 0 "No_request" ; +VAL_ 280 DI_epbInterfaceReady 1 "EPB_INTERFACE_READY" 0 "EPB_INTERFACE_NOT_READY" ; +VAL_ 309 ESP_absBrakeEvent 1 "ACTIVE" 0 "NOT_ACTIVE" ; +VAL_ 309 ESP_brakeDiscWipingActive 1 "ACTIVE" 0 "INACTIVE" ; +VAL_ 309 ESP_brakeLamp 0 "OFF" 1 "ON" ; +VAL_ 309 ESP_espFaultLamp 0 "OFF" 1 "ON" ; +VAL_ 309 ESP_espLampFlash 1 "FLASH" 0 "OFF" ; +VAL_ 309 ESP_hillStartAssistActive 1 "ACTIVE" 0 "INACTIVE" 2 "NOT_AVAILABLE" 3 "SNA" ; +VAL_ 309 ESP_absFaultLamp 0 "OFF" 1 "ON" ; +VAL_ 309 ESP_espOffLamp 0 "OFF" 1 "ON" ; +VAL_ 309 ESP_stabilityControlSts 2 "ENGAGED" 3 "FAULTED" 5 "INIT" 4 "NOT_CONFIGURED" 0 "OFF" 1 "ON" ; +VAL_ 309 ESP_tcLampFlash 1 "FLASH" 0 "OFF" ; +VAL_ 537 DAS_pscParkState 15 "SNA" 14 "SUMMON" 10 "PAUSE" 9 "SEARCH" 8 "COMPLETE" 7 "ABORT" 6 "PARALLEL_PULL_OUT_TO_RIGHT" 5 "PARALLEL_PULL_OUT_TO_LEFT" 4 "PARK_RIGHT_CROSS" 3 "PARK_RIGHT_PARALLEL" 2 "PARK_LEFT_CROSS" 1 "PARK_LEFT_PARALLEL" 0 "NONE" ; +VAL_ 537 DAS_eacState 4 "SNA" 3 "EAC_FAULT" 2 "EAC_ACTIVE" 1 "EAC_AVAILABLE" 0 "EAC_INHIBITED" ; +VAL_ 568 UI_mapSpeedLimit 31 "SNA" 30 "UNLIMITED" 29 "LESS_OR_EQ_160" 28 "LESS_OR_EQ_150" 27 "LESS_OR_EQ_140" 26 "LESS_OR_EQ_130" 25 "LESS_OR_EQ_120" 24 "LESS_OR_EQ_115" 23 "LESS_OR_EQ_110" 22 "LESS_OR_EQ_105" 21 "LESS_OR_EQ_100" 20 "LESS_OR_EQ_95" 19 "LESS_OR_EQ_90" 18 "LESS_OR_EQ_85" 17 "LESS_OR_EQ_80" 16 "LESS_OR_EQ_75" 15 "LESS_OR_EQ_70" 14 "LESS_OR_EQ_65" 13 "LESS_OR_EQ_60" 12 "LESS_OR_EQ_55" 11 "LESS_OR_EQ_50" 10 "LESS_OR_EQ_45" 9 "LESS_OR_EQ_40" 8 "LESS_OR_EQ_35" 7 "LESS_OR_EQ_30" 6 "LESS_OR_EQ_25" 5 "LESS_OR_EQ_20" 4 "LESS_OR_EQ_15" 3 "LESS_OR_EQ_10" 2 "LESS_OR_EQ_7" 1 "LESS_OR_EQ_5" 0 "UNKNOWN" ; +VAL_ 569 DAS_leftLineUsage 3 "BLACKLISTED" 2 "FUSED" 1 "AVAILABLE" 0 "REJECTED_UNAVAILABLE" ; +VAL_ 569 DAS_rightLineUsage 3 "BLACKLISTED" 2 "FUSED" 1 "AVAILABLE" 0 "REJECTED_UNAVAILABLE" ; +VAL_ 569 DAS_leftFork 3 "LEFT_FORK_UNAVAILABLE" 2 "LEFT_FORK_SELECTED" 1 "LEFT_FORK_AVAILABLE" 0 "LEFT_FORK_NONE" ; +VAL_ 569 DAS_rightFork 3 "RIGHT_FORK_UNAVAILABLE" 2 "RIGHT_FORK_SELECTED" 1 "RIGHT_FORK_AVAILABLE" 0 "RIGHT_FORK_NONE" ; +VAL_ 521 DAS_locMode 3 "DAS_LOC_DRIVERLESS" 2 "DAS_LOC_RESTRICTED" 1 "DAS_LOC_NORMAL" 0 "DAS_LOC_OFF" ; +VAL_ 521 DAS_locState 7 "DAS_LOC_FAULT_SNA" 6 "DAS_LOC_AEB_ACTIVE" 2 "DAS_LOC_CANCEL_SILENT" 1 "DAS_LOC_CANCEL_GENERIC" 0 "DAS_LOC_HEALTHY" ; +VAL_ 521 DAS_locRequest 4 "DAS_RQ_PARK" 3 "DAS_RQ_HOLD" 2 "DAS_RQ_BACKWARD" 1 "DAS_RQ_FORWARD" 0 "DAS_RQ_IDLE" ; +VAL_ 521 DAS_locJerkMin 255 "SNA" ; +VAL_ 521 DAS_locJerkMax 255 "SNA" ; +VAL_ 521 DAS_locSpeed 2047 "SNA" ; +VAL_ 521 DAS_locAccelMin 511 "SNA" ; +VAL_ 521 DAS_locAccelMax 511 "SNA" ; +VAL_ 522 driverBrakeStatus 2 "APPLIED" 1 "NOT_APPLIED" ; +VAL_ 760 UI_mapSpeedLimitUnits 1 "KPH" 0 "MPH" ; +VAL_ 760 UI_userSpeedOffsetUnits 1 "KPH" 0 "MPH" ; +VAL_ 643 AirTemp_Insd 255 "SNA" ; +VAL_ 643 AirTemp_Outsd 254 "INIT" 255 "SNA" ; +VAL_ 643 Bckl_Sw_RL_Stat_SAM_R 2 "FLT" 1 "NOT" 0 "OK" 3 "SNA" ; +VAL_ 643 Bckl_Sw_RM_Stat_SAM_R 2 "FLT" 1 "NOT" 0 "OK" 3 "SNA" ; +VAL_ 643 Bckl_Sw_RR_Stat_SAM_R 2 "FLT" 1 "NOT" 0 "OK" 3 "SNA" ; +VAL_ 643 DL_RLtch_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ; +VAL_ 643 DrRLtch_FL_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ; +VAL_ 643 DrRLtch_FR_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ; +VAL_ 643 DrRLtch_RL_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ; +VAL_ 643 DrRLtch_RR_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ; +VAL_ 643 EngHd_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ; +VAL_ 643 LgtSens_Night 0 "DAY" 1 "NIGHT" ; +VAL_ 643 MPkBrk_Stat 1 "ENGG" 0 "RELS" ; +VAL_ 643 RevGr_Engg 0 "DISENGG" 1 "ENGG" 2 "NDEF2" 3 "SNA" ; +VAL_ 643 StW_Cond_Stat 3 "BLINK" 1 "NDEF1" 0 "OFF" 2 "ON" ; +VAL_ 643 Trlr_Stat 2 "NDEF2" 0 "NONE" 1 "OK" 3 "SNA" ; +VAL_ 697 DAS_setSpeed 4095 "SNA" ; +VAL_ 697 DAS_accState 15 "FAULT_SNA" 14 "ACC_CANCEL_OUT_OF_CALIBRATION" 13 "ACC_CANCEL_GENERIC_SILENT" 12 "ACC_CANCEL_PATH_NOT_CLEAR" 11 "APC_SELFPARK_START" 10 "APC_UNPARK_COMPLETE" 9 "APC_PAUSE" 8 "APC_ABORT" 7 "APC_COMPLETE" 6 "APC_FORWARD" 5 "APC_BACKWARD" 4 "ACC_ON" 3 "ACC_HOLD" 2 "ACC_CANCEL_RADAR_BLIND" 1 "ACC_CANCEL_CAMERA_BLIND" 0 "ACC_CANCEL_GENERIC" ; +VAL_ 697 DAS_aebEvent 3 "AEB_SNA" 2 "AEB_FAULT" 1 "AEB_ACTIVE" 0 "AEB_NOT_ACTIVE" ; +VAL_ 697 DAS_jerkMin 511 "SNA" ; +VAL_ 697 DAS_jerkMax 255 "SNA" ; +VAL_ 697 DAS_accelMin 511 "SNA" ; +VAL_ 697 DAS_accelMax 511 "SNA" ; +VAL_ 777 DAS_objectId 5 "VEHICLE_HEADINGS" 4 "ROAD_SIGN" 3 "CUTIN_VEHICLE" 2 "RIGHT_VEHICLES" 1 "LEFT_VEHICLES" 0 "LEAD_VEHICLES" ; +VAL_ 777 DAS_leadVehType 6 "IPSO" 5 "PEDESTRIAN" 4 "BICYCLE" 3 "MOTORCYCLE" 2 "CAR" 1 "TRUCK" 0 "UNKNOWN" ; +VAL_ 777 DAS_leadVehDx 255 "SNA" ; +VAL_ 777 DAS_leadVehVxRel 15 "SNA" ; +VAL_ 777 DAS_leadVehId 127 "SNA" ; +VAL_ 777 DAS_leadVeh2Type 5 "PEDESTRIAN" 4 "BICYCLE" 3 "MOTORCYCLE" 2 "CAR" 1 "TRUCK" 0 "UNKNOWN" ; +VAL_ 777 DAS_leadVeh2Dx 255 "SNA" ; +VAL_ 777 DAS_leadVeh2VxRel 15 "SNA" ; +VAL_ 777 DAS_leadVeh2Id 0 "SNA" ; +VAL_ 777 DAS_leftVehType 5 "PEDESTRIAN" 4 "BICYCLE" 3 "MOTORCYCLE" 2 "CAR" 1 "TRUCK" 0 "UNKNOWN" ; +VAL_ 777 DAS_leftVehDx 255 "SNA" ; +VAL_ 777 DAS_leftVehVxRel 15 "SNA" ; +VAL_ 777 DAS_leftVehId 127 "SNA" ; +VAL_ 777 DAS_leftVeh2Type 5 "PEDESTRIAN" 4 "BICYCLE" 3 "MOTORCYCLE" 2 "CAR" 1 "TRUCK" 0 "UNKNOWN" ; +VAL_ 777 DAS_leftVeh2Dx 255 "SNA" ; +VAL_ 777 DAS_leftVeh2VxRel 15 "SNA" ; +VAL_ 777 DAS_leftVeh2Id 0 "SNA" ; +VAL_ 777 DAS_rightVehType 5 "PEDESTRIAN" 4 "BICYCLE" 3 "MOTORCYCLE" 2 "CAR" 1 "TRUCK" 0 "UNKNOWN" ; +VAL_ 777 DAS_rightVehDx 255 "SNA" ; +VAL_ 777 DAS_rightVehVxRel 15 "SNA" ; +VAL_ 777 DAS_rightVehId 127 "SNA" ; +VAL_ 777 DAS_rightVeh2Type 5 "PEDESTRIAN" 4 "BICYCLE" 3 "MOTORCYCLE" 2 "CAR" 1 "TRUCK" 0 "UNKNOWN" ; +VAL_ 777 DAS_rightVeh2Dx 255 "SNA" ; +VAL_ 777 DAS_rightVeh2VxRel 15 "SNA" ; +VAL_ 777 DAS_rightVeh2Id 0 "SNA" ; +VAL_ 777 DAS_cutinVehType 5 "PEDESTRIAN" 4 "BICYCLE" 3 "MOTORCYCLE" 2 "CAR" 1 "TRUCK" 0 "UNKNOWN" ; +VAL_ 777 DAS_cutinVehDx 255 "SNA" ; +VAL_ 777 DAS_cutinVehVxRel 15 "SNA" ; +VAL_ 777 DAS_cutinVehId 127 "SNA" ; +VAL_ 777 DAS_roadSignColor 4 "RED_YELLOW" 3 "GREEN" 2 "YELLOW" 1 "RED" 0 "NONE" ; +VAL_ 777 DAS_roadSignId 255 "SNA" 1 "TRAFFIC_LIGHT" 0 "STOP_SIGN" ; +VAL_ 777 DAS_roadSignStopLineDist 1023 "SNA" ; +VAL_ 777 DAS_roadSignSource 2 "VISION" 1 "NAV" 0 "NONE" ; +VAL_ 777 DAS_roadSignArrow 4 "UNKNOWN" 3 "STRAIGHT" 2 "RIGHT" 1 "LEFT" 0 "CIRCLE" ; +VAL_ 777 DAS_roadSignOrientation 2 "HORIZONTAL_3_LIGHT" 1 "VERTICAL_3_LIGHT" 0 "UNKNOWN" ; +VAL_ 777 DAS_leadVehHeading 255 "SNA" ; +VAL_ 777 DAS_leadVeh2Heading 255 "SNA" ; +VAL_ 777 DAS_leftVehHeading 255 "SNA" ; +VAL_ 777 DAS_leftVeh2Heading 255 "SNA" ; +VAL_ 777 DAS_rightVehHeading 255 "SNA" ; +VAL_ 777 DAS_rightVeh2Heading 255 "SNA" ; +VAL_ 777 DAS_cutinVehHeading 255 "SNA" ; +VAL_ 782 PARK_pscRightCurbType 2 "HIGH_CURB" 1 "LOW_CURB" 0 "VIRTUAL_CURB" ; +VAL_ 782 PARK_pscLeftCurbType 2 "HIGH_CURB" 1 "LOW_CURB" 0 "VIRTUAL_CURB" ; +VAL_ 782 PARK_autoCalComplete 1 "COMPLETE" 0 "INCOMPLETE" ; +VAL_ 782 PARK_geometryType 2 "MODELX" 1 "MODELS_2" 0 "MODELS" ; +VAL_ 782 PARK_tireFitment 3 "SNA" 1 "STAGGERED" 0 "SQUARE" ; +VAL_ 782 PARK_rackDetected 3 "SNA" 2 "RACK_DETECTED" 1 "NO_RACK" 0 "UNKNOWN" ; +VAL_ 782 PARK_sdiActive 1 "SDI_ENABLED" 0 "SDI_DISABLED" ; +VAL_ 782 PARK_sdiNoise 3 "SDI_NOISE_SNA" 2 "SDI_NOISE_RAIN" 1 "SDI_NOISE_HIGH" 0 "SDI_NOISE_NOMINAL" ; +VAL_ 782 PARK_sdiBlindSpotRight 3 "SNA" 2 "UNUSED" 1 "WARNING" 0 "NO_WARNING" ; +VAL_ 782 PARK_sdiBlindSpotLeft 3 "SNA" 2 "UNUSED" 1 "WARNING" 0 "NO_WARNING" ; +VAL_ 792 BOOT_STATE 2 "Init" 3 "SNA" 0 "closed" 1 "open" ; +VAL_ 792 CERRD 1 "CAN error detect" 0 "no Can error detected" ; +VAL_ 792 DAY 1 "Init" 0 "SNA" ; +VAL_ 792 DOOR_STATE_FL 2 "Init" 3 "SNA" 0 "closed" 1 "open" ; +VAL_ 792 DOOR_STATE_FR 2 "Init" 3 "SNA" 0 "closed" 1 "open" ; +VAL_ 792 DOOR_STATE_FrontTrunk 2 "Init" 3 "SNA" 0 "closed" 1 "open" ; +VAL_ 792 DOOR_STATE_RL 2 "Init" 3 "SNA" 0 "closed" 1 "open" ; +VAL_ 792 DOOR_STATE_RR 2 "Init" 3 "SNA" 0 "closed" 1 "open" ; +VAL_ 792 GTW_updateInProgress 1 "IN_PROGRESS" 2 "IN_PROGRESS_NOT_USED" 3 "IN_PROGRESS_SNA" 0 "NOT_IN_PROGRESS" ; +VAL_ 792 Hour 30 "Init" 31 "SNA" ; +VAL_ 792 MCU_factoryMode 1 "FACTORY_MODE" 0 "NORMAL_MODE" ; +VAL_ 792 MCU_transportModeOn 0 "NORMAL_MODE" ; +VAL_ 792 MINUTE 62 "Init" 63 "SNA" ; +VAL_ 792 MONTH 1 "Init" 15 "SNA" ; +VAL_ 792 SECOND 62 "Init" 63 "SNA" ; +VAL_ 792 YEAR 126 "Init" 127 "SNA" ; +VAL_ 872 DI_aebState 2 "ENABLED" 4 "FAULT" 7 "SNA" 1 "STANDBY" 3 "STANDSTILL" 0 "UNAVAILABLE" ; +VAL_ 872 DI_analogSpeed 4095 "SNA" ; +VAL_ 872 DI_cruiseState 2 "ENABLED" 5 "FAULT" 0 "OFF" 4 "OVERRIDE" 7 "PRE_CANCEL" 6 "PRE_FAULT" 1 "STANDBY" 3 "STANDSTILL" ; +VAL_ 872 DI_digitalSpeed 255 "SNA" ; +VAL_ 872 DI_immobilizerState 2 "AUTHENTICATING" 3 "DISARMED" 6 "FAULT" 4 "IDLE" 0 "INIT_SNA" 1 "REQUEST" 5 "RESET" ; +VAL_ 872 DI_speedUnits 1 "KPH" 0 "MPH" ; +VAL_ 872 DI_state 3 "ABORT" 4 "ENABLE" 2 "FAULT" 1 "STANDBY" 0 "UNAVAILABLE" ; +VAL_ 872 DI_systemState 3 "ABORT" 4 "ENABLE" 2 "FAULT" 1 "STANDBY" 0 "UNAVAILABLE" ; +VAL_ 872 DI_vehicleHoldState 2 "BLEND_IN" 4 "BLEND_OUT" 6 "FAULT" 7 "INIT" 5 "XXX" 1 "STANDBY" 3 "STANDSTILL" 0 "UNAVAILABLE" ; +VAL_ 880 EPAS_currentTuneMode 1 "DM_COMFORT" 3 "DM_SPORT" 2 "DM_STANDARD" 0 "FAIL_SAFE_DEFAULT" 4 "RWD_COMFORT" 6 "RWD_SPORT" 5 "RWD_STANDARD" 7 "UNAVAILABLE" ; +VAL_ 880 EPAS_eacErrorCode 14 "EAC_ERROR_EPB_INHIBIT" 3 "EAC_ERROR_HANDS_ON" 7 "EAC_ERROR_HIGH_ANGLE_RATE_REQ" 9 "EAC_ERROR_HIGH_ANGLE_RATE_SAFETY" 6 "EAC_ERROR_HIGH_ANGLE_REQ" 8 "EAC_ERROR_HIGH_ANGLE_SAFETY" 10 "EAC_ERROR_HIGH_MMOT_SAFETY" 11 "EAC_ERROR_HIGH_TORSION_SAFETY" 0 "EAC_ERROR_IDLE" 12 "EAC_ERROR_LOW_ASSIST" 2 "EAC_ERROR_MAX_SPEED" 1 "EAC_ERROR_MIN_SPEED" 13 "EAC_ERROR_PINION_VEL_DIFF" 4 "EAC_ERROR_TMP_FAULT" 5 "EAR_ERROR_MAX_STEER_DELTA" 15 "SNA" ; +VAL_ 880 EPAS_eacStatus 2 "EAC_ACTIVE" 1 "EAC_AVAILABLE" 3 "EAC_FAULT" 0 "EAC_INHIBITED" 4 "SNA" ; +VAL_ 880 EPAS_handsOnLevel 0 "0" 1 "1" 2 "2" 3 "3" ; +VAL_ 880 EPAS_steeringFault 1 "FAULT" 0 "NO_FAULT" ; +VAL_ 880 EPAS_steeringRackForce 1022 "NOT_IN_SPEC" 1023 "SNA" ; +VAL_ 880 EPAS_steeringReduced 0 "NORMAL_ASSIST" 1 "REDUCED_ASSIST" ; +VAL_ 880 EPAS_torsionBarTorque 0 "SEE_SPECIFICATION" 4095 "SNA" 4094 "UNDEFINABLE_DATA" ; +VAL_ 904 MCU_clusterReadyForDrive 0 "NO_SNA" 1 "YES" ; +VAL_ 905 DAS_accSpeedLimit 1023 "SNA" 0 "NONE" ; +VAL_ 905 DAS_pmmObstacleSeverity 7 "PMM_SNA" 6 "PMM_ACCEL_LIMIT" 5 "PMM_CRASH_FRONT" 4 "PMM_CRASH_REAR" 3 "PMM_BRAKE_REQUEST" 2 "PMM_IMMINENT_FRONT" 1 "PMM_IMMINENT_REAR" 0 "PMM_NONE" ; +VAL_ 905 DAS_pmmLoggingRequest 1 "TRUE" 0 "FALSE" ; +VAL_ 905 DAS_activationFailureStatus 2 "LC_ACTIVATION_FAILED_2" 1 "LC_ACTIVATION_FAILED_1" 0 "LC_ACTIVATION_IDLE" ; +VAL_ 905 DAS_pmmUltrasonicsFaultReason 4 "PMM_ULTRASONICS_INVALID_MIA" 3 "PMM_ULTRASONICS_BLOCKED_BOTH" 2 "PMM_ULTRASONICS_BLOCKED_REAR" 1 "PMM_ULTRASONICS_BLOCKED_FRONT" 0 "PMM_ULTRASONICS_NO_FAULT" ; +VAL_ 905 DAS_pmmRadarFaultReason 2 "PMM_RADAR_INVALID_MIA" 1 "PMM_RADAR_BLOCKED_FRONT" 0 "PMM_RADAR_NO_FAULT" ; +VAL_ 905 DAS_pmmSysFaultReason 7 "PMM_FAULT_BRAKE_PEDAL_INHIBIT" 6 "PMM_FAULT_ROAD_TYPE" 5 "PMM_FAULT_DISABLED_BY_USER" 4 "PMM_FAULT_STEERING_ANGLE_RATE" 3 "PMM_FAULT_DI_FAULT" 2 "PMM_FAULT_SPEED" 1 "PMM_FAULT_DAS_DISABLED" 0 "PMM_FAULT_NONE" ; +VAL_ 905 DAS_pmmCameraFaultReason 2 "PMM_CAMERA_INVALID_MIA" 1 "PMM_CAMERA_BLOCKED_FRONT" 0 "PMM_CAMERA_NO_FAULT" ; +VAL_ 905 DAS_ACC_report 24 "ACC_REPORT_BEHAVIOR_REPORT" 23 "ACC_REPORT_CAMERA_ONLY" 22 "ACC_REPORT_RADAR_OBJ_FIVE" 21 "ACC_REPORT_CIPV_CUTTING_OUT" 20 "ACC_REPORT_MCVLR_IN_PATH" 19 "ACC_REPORT_MCVLR_DPP" 18 "ACC_REPORT_FLEET_SPEEDS" 17 "ACC_REPORT_TARGET_MCP" 16 "ACC_REPORT_RADAR_OBJ_TWO" 15 "ACC_REPORT_RADAR_OBJ_ONE" 14 "ACC_REPORT_LC_EXTERNAL_STATE_ACTIVE_RESTRICTED" 13 "ACC_REPORT_LC_EXTERNAL_STATE_ABORTED" 12 "ACC_REPORT_LC_EXTERNAL_STATE_ABORTING" 11 "ACC_REPORT_LC_HANDS_ON_REQD_STRUCK_OUT" 10 "ACC_REPORT_CSA" 9 "ACC_REPORT_TARGET_TYPE_FAULT" 8 "ACC_REPORT_TARGET_TYPE_IPSO" 7 "ACC_REPORT_TARGET_TYPE_TRAFFIC_LIGHT" 6 "ACC_REPORT_TARGET_TYPE_STOP_SIGN" 5 "ACC_REPORT_TARGET_CUTIN" 4 "ACC_REPORT_TARGET_MCVR" 3 "ACC_REPORT_TARGET_MCVL" 2 "ACC_REPORT_TARGET_IN_FRONT_OF_CIPV" 1 "ACC_REPORT_TARGET_CIPV" 0 "ACC_REPORT_TARGET_NONE" ; +VAL_ 921 DAS_lssState 7 "LSS_STATE_OFF" 6 "LSS_STATE_ABORT" 5 "LSS_STATE_BLINDSPOT" 4 "LSS_STATE_MONITOR" 3 "LSS_STATE_ELK" 2 +VAL_ 905 DAS_radarTelemetry 2 "RADAR_TELEMETRY_URGENT" 1 "RADAR_TELEMETRY_NORMAL" 0 "RADAR_TELEMETRY_IDLE" ; +VAL_ 905 DAS_robState 3 "ROB_STATE_MAPLESS" 2 "ROB_STATE_ACTIVE" 1 "ROB_STATE_MEASURE" 0 "ROB_STATE_INHIBITED" ; +VAL_ 905 DAS_driverInteractionLevel 2 "CONTINUED_DRIVER_NOT_INTERACTING" 1 "DRIVER_NOT_INTERACTING" 0 "DRIVER_INTERACTING" ; +VAL_ 905 DAS_ppOffsetDesiredRamp 128 "PP_NO_OFFSET" ; +VAL_ 905 DAS_longCollisionWarning 15 "FCM_LONG_COLLISION_WARNING_SNA" 12 "FCM_LONG_COLLISION_WARNING_VEHICLE_CIPV2" 11 "FCM_LONG_COLLISION_WARNING_VEHICLE_MCVR2" 10 "FCM_LONG_COLLISION_WARNING_VEHICLE_MCVR" 9 "FCM_LONG_COLLISION_WARNING_VEHICLE_MCVL2" 8 "FCM_LONG_COLLISION_WARNING_VEHICLE_MCVL" 7 "FCM_LONG_COLLISION_WARNING_VEHICLE_CUTIN" 6 "FCM_LONG_COLLISION_WARNING_VEHICLE_CIPV" 5 "FCM_LONG_COLLISION_WARNING_TFL_STOPLINE" 4 "FCM_LONG_COLLISION_WARNING_STOPSIGN_STOPLINE" 3 "FCM_LONG_COLLISION_WARNING_IPSO" 2 "FCM_LONG_COLLISION_WARNING_PEDESTRIAN" 1 "FCM_LONG_COLLISION_WARNING_VEHICLE_UNKNOWN" 0 "FCM_LONG_COLLISION_WARNING_NONE" ; +VAL_ 921 DAS_autopilotState 5 "ACTIVE_NAVIGATE_ON_AUTOPILOT" 4 "ACTIVE_2" 3 "ACTIVE_1" 2 "AVAILABLE" 1 "UNAVAILABLE" 0 "DISABLED" ; +VAL_ 921 DAS_blindSpotRearLeft 3 "SNA" 2 "WARNING_LEVEL_2" 1 "WARNING_LEVEL_1" 0 "NO_WARNING" ; +VAL_ 921 DAS_blindSpotRearRight 3 "SNA" 2 "WARNING_LEVEL_2" 1 "WARNING_LEVEL_1" 0 "NO_WARNING" ; +VAL_ 921 DAS_fusedSpeedLimit 31 "NONE" 0 "UNKNOWN_SNA" ; +VAL_ 921 DAS_suppressSpeedWarning 1 "Suppress_Speed_Warning" 0 "Do_Not_Suppress" ; +VAL_ 921 DAS_visionOnlySpeedLimit 31 "NONE" 0 "UNKNOWN_SNA" ; +VAL_ 921 DAS_heaterState 1 "HEATER_ON" 0 "HEATER_OFF_SNA" ; +VAL_ 921 DAS_forwardCollisionWarning 3 "SNA" 1 "FORWARD_COLLISION_WARNING" 0 "NONE" ; +VAL_ 921 DAS_autoparkReady 1 "AUTOPARK_READY" 0 "AUTOPARK_UNAVAILABLE" ; +VAL_ 921 DAS_sideCollisionAvoid 3 "SNA" 2 "AVOID_RIGHT" 1 "AVOID_LEFT" 0 "NONE" ; +VAL_ 921 DAS_sideCollisionWarning 3 "WARN_LEFT_RIGHT" 2 "WARN_RIGHT" 1 "WARN_LEFT" 0 "NONE" ; +VAL_ 921 DAS_sideCollisionInhibit 1 "INHIBIT" 0 "NO_INHIBIT" ; +VAL_ 905 DAS_csaState 3 "CSA_EXTERNAL_STATE_HOLD" 2 "CSA_EXTERNAL_STATE_ENABLE" 1 "CSA_EXTERNAL_STATE_AVAILABLE" 0 "CSA_EXTERNAL_STATE_UNAVAILABLE" ; +VAL_ 921 DAS_laneDepartureWarning 5 "SNA" 4 "RIGHT_WARNING_SEVERE" 3 "LEFT_WARNING_SEVERE" 2 "RIGHT_WARNING" 1 "LEFT_WARNING" 0 "NONE" ; +VAL_ 921 DAS_fleetSpeedState 3 "FLEETSPEED_HOLD" 2 "FLEETSPEED_ACTIVE" 1 "FLEETSPEED_AVAILABLE" 0 "FLEETSPEED_UNAVAILABLE" ; +VAL_ 921 DAS_autopilotHandsOnState 15 "LC_HANDS_ON_SNA" 8 "LC_HANDS_ON_SUSPENDED" 7 "LC_HANDS_ON_REQD_STRUCK_OUT" 5 "LC_HANDS_ON_REQD_CHIME_2" 4 "LC_HANDS_ON_REQD_CHIME_1" 3 "LC_HANDS_ON_REQD_VISUAL" 2 "LC_HANDS_ON_REQD_NOT_DETECTED" 1 "LC_HANDS_ON_REQD_DETECTED" 0 "LC_HANDS_ON_NOT_REQD" ; +VAL_ 921 DAS_autoLaneChangeState 31 "ALC_SNA" 30 "ALC_ABORT_MISSION_PLAN_INVALID" 29 "ALC_ABORT_TIMEOUT" 28 "ALC_WAITING_HANDS_ON" 27 "ALC_BLOCKED_LANE_TYPE_R" 26 "ALC_BLOCKED_LANE_TYPE_L" 25 "ALC_BLOCKED_VEH_TTC_AND_USS_R" 24 "ALC_BLOCKED_VEH_TTC_R" 23 "ALC_BLOCKED_VEH_TTC_AND_USS_L" 22 "ALC_BLOCKED_VEH_TTC_L" 21 "ALC_UNAVAILABLE_SOLID_LANE_LINE" 20 "ALC_ABORT_OTHER_REASON" 19 "ALC_ABORT_BLINKER_TURNED_OFF" 18 "ALC_ABORT_LC_HEALTH_BAD" 17 "ALC_ABORT_POOR_VIEW_RANGE" 16 "ALC_ABORT_SIDE_OBSTACLE_PRESENT_R" 15 "ALC_ABORT_SIDE_OBSTACLE_PRESENT_L" 14 "ALC_WAITING_FOR_FWD_OBST_TO_PASS_R" 13 "ALC_WAITING_FOR_FWD_OBST_TO_PASS_L" 12 "ALC_WAITING_FOR_SIDE_OBST_TO_PASS_R" 11 "ALC_WAITING_FOR_SIDE_OBST_TO_PASS_L" 10 "ALC_IN_PROGRESS_R" 9 "ALC_IN_PROGRESS_L" 8 "ALC_AVAILABLE_BOTH" 7 "ALC_AVAILABLE_ONLY_R" 6 "ALC_AVAILABLE_ONLY_L" 5 "ALC_UNAVAILABLE_VEHICLE_SPEED" 4 "ALC_UNAVAILABLE_EXITING_HIGHWAY" 3 "ALC_UNAVAILABLE_TP_FOLLOW" 2 "ALC_UNAVAILABLE_SONICS_INVALID" 1 "ALC_UNAVAILABLE_NO_LANES" 0 "ALC_UNAVAILABLE_DISABLED" ; +VAL_ 937 DAS_telemetryMultiplexer 9 "DAS_TELEMETRY_CRUISE_STALK_INPUT" 8 "DAS_TELEMETRY_STATIONARY_OBST" 7 "DAS_TELEMETRY_CSA_EVENT" 2 "DAS_TELEMETRY_TRAFFIC_SIGNS" 1 "DAS_TELEMETRY_ACC_DRIVER_MONITOR" 0 "DAS_TELEMETRY_ROAD_INFORMATION" ; +VAL_ 937 DAS_telLeftLaneType 6 "BARRIER" 5 "BOTTS DOTS" 4 "DOUBLE" 3 "DASHED" 2 "ROAD EDGE" 1 "SOLID" 0 "UNDECIDED" ; +VAL_ 937 DAS_telRightLaneType 6 "BARRIER" 5 "BOTTS DOTS" 4 "DOUBLE" 3 "DASHED" 2 "ROAD EDGE" 1 "SOLID" 0 "UNDECIDED" ; +VAL_ 937 DAS_telLeftMarkerQuality 3 "HIGH" 2 "MEDIUM" 1 "LOW" 0 "LOWEST" ; +VAL_ 937 DAS_telRightMarkerQuality 3 "HIGH" 2 "MEDIUM" 1 "LOW" 0 "LOWEST" ; +VAL_ 937 DAS_telLeftMarkerColor 3 "BLUE" 2 "YELLOW" 1 "WHITE" 0 "UNKNOWN" ; +VAL_ 937 DAS_telRightMarkerColor 3 "BLUE" 2 "YELLOW" 1 "WHITE" 0 "UNKNOWN" ; +VAL_ 937 DAS_telLeftLaneCrossing 1 "CROSSING" 0 "NOT_CROSSING" ; +VAL_ 937 DAS_telRightLaneCrossing 1 "CROSSING" 0 "NOT_CROSSING" ; +VAL_ 937 DAS_stopSignLongitudinalDist 1023 "SNA" ; +VAL_ 937 DAS_stopSignLateralDist 255 "SNA" ; +VAL_ 937 DAS_stopSignHeight 63 "SNA" ; +VAL_ 937 DAS_stopSignStopLineDistance 1023 "SNA" ; +VAL_ 937 DAS_stopSignCIPVDistance 63 "SNA" ; +VAL_ 937 DAS_stopSignHostAccel 1023 "SNA" ; +VAL_ 937 DAS_csaIntState 4 "CSA_INTERNAL_STATE_ENABLE_HOLD" 3 "CSA_INTERNAL_STATE_ENABLE_ACCELEROMETER" 2 "CSA_INTERNAL_STATE_ENABLE_PREDICTED" 1 "CSA_INTERNAL_STATE_AVAILABLE" 0 "CSA_INTERNAL_STATE_UNAVAILABLE" ; +VAL_ 937 DAS_soCamCipvStatus 3 "CAM_CIPV_FUSED_W_RAD5" 2 "CAM_CIPV_FUSED_W_OTHER_RAD_OBJ" 1 "CAM_CIPV_UNFUSED" 0 "CAM_CIPV_INVALID" ; +VAL_ 937 DAS_soRad5Status 3 "RAD5_FUSED_W_OTHER_CAMOBJ" 2 "RAD5_FUSED_W_CIPV" 1 "RAD5_UNFUSED" 0 "RAD5_INVALID" ; +VAL_ 937 DAS_soRad1Status 3 "RAD1_FUSED_W_OTHER_CAMOBJ" 2 "RAD1_FUSED_W_CIPV" 1 "RAD1_UNFUSED" 0 "RAD1_INVALID" ; +VAL_ 1001 DAS_headlightRequest 3 "DAS_HEADLIGHT_REQUEST_INVALID" 1 "DAS_HEADLIGHT_REQUEST_ON" 0 "DAS_HEADLIGHT_REQUEST_OFF" ; +VAL_ 1001 DAS_hazardLightRequest 3 "DAS_REQUEST_HAZARDS_SNA" 2 "DAS_REQUEST_HAZARDS_UNUSED" 1 "DAS_REQUEST_HAZARDS_ON" 0 "DAS_REQUEST_HAZARDS_OFF" ; +VAL_ 1001 DAS_wiperSpeed 15 "DAS_WIPER_SPEED_INVALID" 14 "DAS_WIPER_SPEED_14" 13 "DAS_WIPER_SPEED_13" 12 "DAS_WIPER_SPEED_12" 11 "DAS_WIPER_SPEED_11" 10 "DAS_WIPER_SPEED_10" 9 "DAS_WIPER_SPEED_9" 8 "DAS_WIPER_SPEED_8" 7 "DAS_WIPER_SPEED_7" 6 "DAS_WIPER_SPEED_6" 5 "DAS_WIPER_SPEED_5" 4 "DAS_WIPER_SPEED_4" 3 "DAS_WIPER_SPEED_3" 2 "DAS_WIPER_SPEED_2" 1 "DAS_WIPER_SPEED_1" 0 "DAS_WIPER_SPEED_OFF" ; +VAL_ 1001 DAS_turnIndicatorRequest 3 "DAS_TURN_INDICATOR_CANCEL" 2 "DAS_TURN_INDICATOR_RIGHT" 1 "DAS_TURN_INDICATOR_LEFT" 0 "DAS_TURN_INDICATOR_NONE" ; +VAL_ 1001 DAS_highLowBeamDecision 3 "DAS_HIGH_BEAM_SNA" 2 "DAS_HIGH_BEAM_ON" 1 "DAS_HIGH_BEAM_OFF" 0 "DAS_HIGH_BEAM_UNDECIDED" ; +VAL_ 1001 DAS_highLowBeamOffReason 5 "HIGH_BEAM_OFF_REASON_SNA" 4 "HIGH_BEAM_OFF_REASON_HEAD_LIGHT" 3 "HIGH_BEAM_OFF_REASON_AMBIENT_LIGHT" 2 "HIGH_BEAM_OFF_REASON_MOVING_RADAR_TARGET" 1 "HIGH_BEAM_OFF_REASON_MOVING_VISION_TARGET" 0 "HIGH_BEAM_ON" ; +VAL_ 1001 DAS_turnIndicatorRequestReason 6 "DAS_ACTIVE_COMMANDED_LANE_CHANGE" 5 "DAS_CANCEL_FORK" 4 "DAS_CANCEL_LANE_CHANGE" 3 "DAS_ACTIVE_FORK" 2 "DAS_ACTIVE_SPEED_LANE_CHANGE" 1 "DAS_ACTIVE_NAV_LANE_CHANGE" 0 "DAS_NONE" ; +VAL_ 1160 DAS_steeringAngleRequest 16384 "ZERO_ANGLE" ; +VAL_ 1160 DAS_steeringControlType 1 "ANGLE_CONTROL" 3 "DISABLED" 0 "NONE" 2 "RESERVED" ; +VAL_ 1160 DAS_steeringHapticRequest 1 "ACTIVE" 0 "IDLE" ; +VAL_ 1362 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + + +CM_ "CHFFR_METRIC 1160 DAS_steeringAngleRequest STEER_ANGLE 0.1098666 180; CHFFR_METRIC 264 DI_motorRPM ENGINE_RPM 1 0"; diff --git a/opendbc/tesla_powertrain.dbc b/opendbc/tesla_powertrain.dbc new file mode 100644 index 000000000..8572ee20f --- /dev/null +++ b/opendbc/tesla_powertrain.dbc @@ -0,0 +1,179 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: + NEO + MCU + GTW + EPAS + DI + ESP + SBW + STW + APP + DAS + XXX + +BO_ 262 DI_torque1: 8 DI + SG_ DI_torqueDriver : 0|13@1- (0.25,0) [-750|750] "Nm" NEO + SG_ DI_torque1Counter : 13|3@1+ (1,0) [0|0] "" NEO + SG_ DI_torqueMotor : 16|13@1- (0.25,0) [-750|750] "Nm" NEO + SG_ DI_soptState : 29|3@1+ (1,0) [0|0] "" NEO + SG_ DI_motorRPM : 32|16@1- (1,0) [-17000|17000] "RPM" NEO + SG_ DI_pedalPos : 48|8@1+ (0.4,0) [0|100] "%" NEO + SG_ DI_torque1Checksum : 56|8@1+ (1,0) [0|0] "" NEO + +BO_ 278 DI_torque2: 6 DI + SG_ DI_torqueEstimate : 0|12@1- (0.5,0) [-750|750] "Nm" NEO + SG_ DI_gear : 12|3@1+ (1,0) [0|0] "" NEO + SG_ DI_brakePedal : 15|1@1+ (1,0) [0|0] "" NEO + SG_ DI_vehicleSpeed : 16|12@1+ (0.05,-25) [-25|179.75] "MPH" NEO + SG_ DI_gearRequest : 28|3@1+ (1,0) [0|0] "" NEO + SG_ DI_torqueInterfaceFailure : 31|1@1+ (1,0) [0|0] "" NEO + SG_ DI_torque2Counter : 32|4@1+ (1,0) [0|0] "" NEO + SG_ DI_brakePedalState : 36|2@1+ (1,0) [0|0] "" NEO + SG_ DI_epbParkRequest : 38|1@1+ (1,0) [0|0] "" NEO + SG_ DI_epbInterfaceReady : 39|1@1+ (1,0) [0|0] "" NEO + SG_ DI_torque2Checksum : 40|8@1+ (1,0) [0|0] "" NEO + +BO_ 504 BrakeMessage: 8 XXX + SG_ driverBrakeStatus : 2|2@1+ (1,0) [0|3] "" XXX + +BO_ 568 STW_ACTN_RQ: 8 STW + SG_ SpdCtrlLvr_Stat : 0|6@1+ (1,0) [0|0] "" NEO + SG_ VSL_Enbl_Rq : 6|1@1+ (1,0) [0|0] "" NEO + SG_ SpdCtrlLvrStat_Inv : 7|1@1+ (1,0) [0|0] "" NEO + SG_ DTR_Dist_Rq : 8|8@1+ (1,0) [0|200] "" NEO + SG_ TurnIndLvr_Stat : 16|2@1+ (1,0) [0|0] "" NEO + SG_ HiBmLvr_Stat : 18|2@1+ (1,0) [0|0] "" NEO + SG_ WprWashSw_Psd : 20|2@1+ (1,0) [0|0] "" NEO + SG_ WprWash_R_Sw_Posn_V2 : 22|2@1+ (1,0) [0|0] "" NEO + SG_ StW_Lvr_Stat : 24|3@1+ (1,0) [0|0] "" NEO + SG_ StW_Cond_Flt : 27|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Cond_Psd : 28|2@1+ (1,0) [0|0] "" NEO + SG_ HrnSw_Psd : 30|2@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw00_Psd : 32|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw01_Psd : 33|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw02_Psd : 34|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw03_Psd : 35|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw04_Psd : 36|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw05_Psd : 37|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw06_Psd : 38|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw07_Psd : 39|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw08_Psd : 40|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw09_Psd : 41|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw10_Psd : 42|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw11_Psd : 43|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw12_Psd : 44|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw13_Psd : 45|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw14_Psd : 46|1@1+ (1,0) [0|0] "" NEO + SG_ StW_Sw15_Psd : 47|1@1+ (1,0) [0|0] "" NEO + SG_ WprSw6Posn : 48|3@1+ (1,0) [0|0] "" NEO + SG_ MC_STW_ACTN_RQ : 52|4@1+ (1,0) [0|15] "" NEO + SG_ CRC_STW_ACTN_RQ : 56|8@1+ (1,0) [0|0] "" NEO + +BO_ 598 DI_state: 8 DI + SG_ DI_systemState : 0|3@1+ (1,0) [0|0] "" NEO + SG_ DI_vehicleHoldState : 3|3@1+ (1,0) [0|0] "" NEO + SG_ DI_proximity : 6|1@1+ (1,0) [0|0] "" NEO + SG_ DI_driveReady : 7|1@1+ (1,0) [0|0] "" NEO + SG_ DI_regenLight : 8|1@1+ (1,0) [0|0] "" NEO + SG_ DI_state : 9|3@1+ (1,0) [0|0] "" NEO + SG_ DI_cruiseState : 12|4@1+ (1,0) [0|0] "" NEO + SG_ DI_analogSpeed : 16|12@1+ (0.1,0) [0|150] "speed" NEO + SG_ DI_immobilizerState : 28|3@1+ (1,0) [0|0] "" NEO + SG_ DI_speedUnits : 31|1@1+ (1,0) [0|1] "" NEO + SG_ DI_cruiseSet : 32|9@1+ (0.5,0) [0|255.5] "speed" NEO + SG_ DI_aebState : 41|3@1+ (1,0) [0|0] "" NEO + SG_ DI_stateCounter : 44|4@1+ (1,0) [0|0] "" NEO + SG_ DI_digitalSpeed : 48|8@1+ (1,0) [0|250] "" NEO + SG_ DI_stateChecksum : 56|8@1+ (1,0) [0|0] "" NEO + +BO_ 703 DAS_control: 8 GTW + SG_ DAS_setSpeed : 0|12@1+ (0.1,0) [0|409.4] "kph" DI,PM,APS + SG_ DAS_accState : 12|4@1+ (1,0) [0|0] "" DI,PM,APS + SG_ DAS_aebEvent : 16|2@1+ (1,0) [0|3] "" DI,PM,APS + SG_ DAS_jerkMin : 18|9@1+ (0.03,-15.232) [-15.232|0.098] "m/s^3" DI,PM,APS + SG_ DAS_jerkMax : 27|8@1+ (0.059,0) [0|15.045] "m/s^3" DI,PM,APS + SG_ DAS_accelMin : 35|9@1+ (0.04,-15) [-15|5.44] "m/s^2" DI,PM,APS + SG_ DAS_accelMax : 44|9@1+ (0.04,-15) [-15|5.44] "m/s^2" DI,PM,APS + SG_ DAS_controlCounter : 53|3@1+ (1,0) [0|0] "" DI,PM,APS + SG_ DAS_controlChecksum : 56|8@1+ (1,0) [0|0] "" DI,PM,APS + +VAL_ 262 DI_torqueDriver -4096 "SNA" ; +VAL_ 262 DI_torqueMotor -4096 "SNA" ; +VAL_ 262 DI_soptState 7 "SOPT_TEST_SNA" 4 "SOPT_TEST_NOT_RUN" 3 "SOPT_TEST_PASSED" 2 "SOPT_TEST_FAILED" 1 "SOPT_TEST_IN_PROGRESS" 0 "SOPT_PRE_TEST" ; +VAL_ 262 DI_motorRPM -32768 "SNA" ; +VAL_ 262 DI_pedalPos 255 "SNA" ; +VAL_ 278 DI_torqueEstimate -2048 "SNA" ; +VAL_ 278 DI_gear 7 "DI_GEAR_SNA" 4 "DI_GEAR_D" 3 "DI_GEAR_N" 2 "DI_GEAR_R" 1 "DI_GEAR_P" 0 "DI_GEAR_INVALID" ; +VAL_ 278 DI_brakePedal 1 "Applied" 0 "Not_applied" ; +VAL_ 278 DI_vehicleSpeed 4095 "SNA" ; +VAL_ 278 DI_gearRequest 7 "DI_GEAR_SNA" 4 "DI_GEAR_D" 3 "DI_GEAR_N" 2 "DI_GEAR_R" 1 "DI_GEAR_P" 0 "DI_GEAR_INVALID" ; +VAL_ 278 DI_torqueInterfaceFailure 1 "TORQUE_INTERFACE_FAILED" 0 "TORQUE_INTERFACE_NORMAL" ; +VAL_ 278 DI_brakePedalState 3 "SNA" 2 "INVALID" 1 "ON" 0 "OFF" ; +VAL_ 278 DI_epbParkRequest 1 "Park_requested" 0 "No_request" ; +VAL_ 278 DI_epbInterfaceReady 1 "EPB_INTERFACE_READY" 0 "EPB_INTERFACE_NOT_READY" ; +VAL_ 504 driverBrakeStatus 2 "APPLIED" 1 "NOT_APPLIED" ; +VAL_ 568 SpdCtrlLvr_Stat 32 "DN_1ST" 16 "UP_1ST" 8 "DN_2ND" 4 "UP_2ND" 2 "RWD" 1 "FWD" 0 "IDLE" ; +VAL_ 568 DTR_Dist_Rq 255 "SNA" 200 "ACC_DIST_7" 166 "ACC_DIST_6" 133 "ACC_DIST_5" 100 "ACC_DIST_4" 66 "ACC_DIST_3" 33 "ACC_DIST_2" 0 "ACC_DIST_1" ; +VAL_ 568 TurnIndLvr_Stat 3 "SNA" 2 "RIGHT" 1 "LEFT" 0 "IDLE" ; +VAL_ 568 HiBmLvr_Stat 3 "SNA" 2 "HIBM_FLSH_ON_PSD" 1 "HIBM_ON_PSD" 0 "IDLE" ; +VAL_ 568 WprWashSw_Psd 3 "SNA" 2 "WASH" 1 "TIPWIPE" 0 "NPSD" ; +VAL_ 568 WprWash_R_Sw_Posn_V2 3 "SNA" 2 "WASH" 1 "INTERVAL" 0 "OFF" ; +VAL_ 568 StW_Lvr_Stat 4 "STW_BACK" 3 "STW_FWD" 2 "STW_DOWN" 1 "STW_UP" 0 "NPSD" ; +VAL_ 568 StW_Cond_Psd 3 "SNA" 2 "DOWN" 1 "UP" 0 "NPSD" ; +VAL_ 568 HrnSw_Psd 3 "SNA" 2 "NDEF2" 1 "PSD" 0 "NPSD" ; +VAL_ 568 StW_Sw00_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ; +VAL_ 568 StW_Sw01_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ; +VAL_ 568 StW_Sw03_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ; +VAL_ 568 StW_Sw04_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ; +VAL_ 568 WprSw6Posn 7 "SNA" 6 "STAGE2" 5 "STAGE1" 4 "INTERVAL4" 3 "INTERVAL3" 2 "INTERVAL2" 1 "INTERVAL1" 0 "OFF" ; +VAL_ 598 DI_aebState 2 "ENABLED" 4 "FAULT" 7 "SNA" 1 "STANDBY" 3 "STANDSTILL" 0 "UNAVAILABLE" ; +VAL_ 598 DI_analogSpeed 4095 "SNA" ; +VAL_ 598 DI_cruiseState 2 "ENABLED" 5 "FAULT" 0 "OFF" 4 "OVERRIDE" 7 "PRE_CANCEL" 6 "PRE_FAULT" 1 "STANDBY" 3 "STANDSTILL" ; +VAL_ 598 DI_digitalSpeed 255 "SNA" ; +VAL_ 598 DI_immobilizerState 2 "AUTHENTICATING" 3 "DISARMED" 6 "FAULT" 4 "IDLE" 0 "INIT_SNA" 1 "REQUEST" 5 "RESET" ; +VAL_ 598 DI_speedUnits 1 "KPH" 0 "MPH" ; +VAL_ 598 DI_state 3 "ABORT" 4 "ENABLE" 2 "FAULT" 1 "STANDBY" 0 "UNAVAILABLE" ; +VAL_ 598 DI_systemState 3 "ABORT" 4 "ENABLE" 2 "FAULT" 1 "STANDBY" 0 "UNAVAILABLE" ; +VAL_ 598 DI_vehicleHoldState 2 "BLEND_IN" 4 "BLEND_OUT" 6 "FAULT" 7 "INIT" 5 "PARK" 1 "STANDBY" 3 "STANDSTILL" 0 "UNAVAILABLE" ; +VAL_ 703 DAS_setSpeed 4095 "SNA" ; +VAL_ 703 DAS_accState 15 "FAULT_SNA" 13 "ACC_CANCEL_GENERIC_SILENT" 11 "APC_SELFPARK_START" 10 "APC_UNPARK_COMPLETE" 9 "APC_PAUSE" 8 "APC_ABORT" 7 "APC_COMPLETE" 6 "APC_FORWARD" 5 "APC_BACKWARD" 4 "ACC_ON" 3 "ACC_HOLD" 0 "ACC_CANCEL_GENERIC" ; +VAL_ 703 DAS_aebEvent 3 "AEB_SNA" 2 "AEB_FAULT" 1 "AEB_ACTIVE" 0 "AEB_NOT_ACTIVE" ; +VAL_ 703 DAS_jerkMin 511 "SNA" ; +VAL_ 703 DAS_jerkMax 255 "SNA" ; +VAL_ 703 DAS_accelMin 511 "SNA" ; +VAL_ 703 DAS_accelMax 511 "SNA" ; \ No newline at end of file diff --git a/opendbc/tesla_radar.dbc b/opendbc/tesla_radar.dbc new file mode 100644 index 000000000..d50add3e4 --- /dev/null +++ b/opendbc/tesla_radar.dbc @@ -0,0 +1,1396 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: FrontCamera Radar + + +BO_ 769 TeslaRadarSguInfo: 8 Radar + SG_ RADC_VerticalMisalignment : 0|8@1+ (1,0) [0|255] "" FrontCamera + SG_ RADC_SCUTemperature : 8|8@1+ (1,-128) [-128|127] "" FrontCamera + SG_ RADC_VMA_Plaus : 16|8@1+ (1,0) [0|255] "" FrontCamera + SG_ RADC_SGU_ITC : 24|8@1+ (1,0) [0|255] "" FrontCamera + SG_ RADC_HorizontMisalignment : 32|12@1+ (1,0) [0|4096] "" FrontCamera + SG_ RADC_SensorDirty : 44|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_HWFail : 45|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_SGUFail : 46|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_SGUInfoConsistBit : 47|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 770 TeslaRadarTguInfo: 8 Radar + SG_ RADC_ACCTargObj1_sguIndex : 0|6@1+ (1,0) [0|63] "" FrontCamera + SG_ RADC_ACCTargObj2_sguIndex : 6|6@1+ (1,0) [0|63] "" FrontCamera + SG_ RADC_ACCTargObj3_sguIndex : 12|6@1+ (1,0) [0|63] "" FrontCamera + SG_ RADC_ACCTargObj4_sguIndex : 18|6@1+ (1,0) [0|63] "" FrontCamera + SG_ RADC_ACCTargObj5_sguIndex : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ unused30 : 30|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_TGUInfoConsistBit : 31|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_ACCTargObj1_dBPower : 32|16@1+ (1,0) [0|65535] "" FrontCamera + SG_ RADC_ACCTargObj5_dBPower : 48|16@1+ (1,0) [0|65535] "" FrontCamera + +BO_ 1281 TeslaRadarAlertMatrix: 8 Radar + SG_ RADC_a001_ecuInternalPerf : 0|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a002_flashPerformance : 1|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a003_vBatHigh : 2|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a004_adjustmentNotDone : 3|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a005_adjustmentReq : 4|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a006_adjustmentNotOk : 5|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a007_sensorBlinded : 6|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a008_plantModeActive : 7|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a009_configMismatch : 8|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a010_canBusOff : 9|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a011_bdyMIA : 10|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a012_espMIA : 11|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a013_gtwMIA : 12|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a014_sccmMIA : 13|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a015_adasMIA : 14|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a016_bdyInvalidCount : 15|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a017_adasInvalidCount : 16|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a018_espInvalidCount : 17|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a019_sccmInvalidCount : 18|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a020_bdyInvalidChkSm : 19|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a021_espInvalidChkSm : 20|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a022_sccmInvalidChkSm : 21|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a023_sccmInvalidChkSm : 22|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a024_absValidity : 23|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a025_ambTValidity : 24|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a026_brakeValidity : 25|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a027_CntryCdValidity : 26|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a028_espValidity : 27|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a029_longAccOffValidity : 28|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a030_longAccValidity : 29|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a031_odoValidity : 30|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a032_gearValidity : 31|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a033_steerAngValidity : 32|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a034_steerAngSpdValidity : 33|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a035_indctrValidity : 34|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a036_vehStandStillValidity : 35|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a037_vinValidity : 36|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a038_whlRotValidity : 37|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a039_whlSpdValidity : 38|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a040_whlStandStillValidity : 39|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a041_wiperValidity : 40|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a042_xwdValidity : 41|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a043_yawOffValidity : 42|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a044_yawValidity : 43|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a045_bsdSanity : 44|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a046_rctaSanity : 45|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a047_lcwSanity : 46|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a048_steerAngOffSanity : 47|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a049_tireSizeSanity : 48|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a050_velocitySanity : 49|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a051_yawSanity : 50|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a052_radomeHtrInop : 51|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a053_espmodValidity : 52|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a054_gtwmodValidity : 53|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a055_stwmodValidity : 54|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a056_bcmodValidity : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a057_dimodValidity : 56|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a058_opmodValidity : 57|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a059_drmiInvalidChkSm : 58|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a060_drmiInvalidCount : 59|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a061_radPositionMismatch : 60|1@1+ (1,0) [0|1] "" FrontCamera + SG_ RADC_a062_strRackMismatch : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ unused62 : 62|2@1+ (1,0) [0|3] "" FrontCamera + +BO_ 784 M_310hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 785 M_310hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 787 M_313hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 788 M_313hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 790 M_316hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 791 M_316hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 793 M_319hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 794 M_319hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 796 M_31Chex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 797 M_31Chex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 799 M_31Fhex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 800 M_31Fhex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 802 M_322hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 803 M_322hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 805 M_325hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 806 M_325hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 808 M_328hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 809 M_328hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 811 M_32Bhex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 812 M_32Bhex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 814 M_32Ehex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 815 M_32Ehex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 817 M_331hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 818 M_331hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 820 M_334hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 821 M_334hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 823 M_337hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 824 M_337hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 826 M_33Ahex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 827 M_33Ahex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 829 M_33Dhex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 830 M_33Dhex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 832 M_340hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 833 M_340hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 835 M_343hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 836 M_343hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 838 M_346hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 839 M_346hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 841 M_349hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 842 M_349hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 844 M_34Chex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 845 M_34Chex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 847 M_34Fhex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 848 M_34Fhex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 850 M_352hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 851 M_352hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 853 M_355hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 854 M_355hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 856 M_358hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 857 M_358hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 859 M_35Bhex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 860 M_35Bhex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 862 M_35Ehex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 863 M_35Ehex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 865 M_361hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 866 M_361hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 868 M_364hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 869 M_364hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 871 M_367hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 872 M_367hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 874 M_36Ahex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 875 M_36Ahex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 877 M_36Dhex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 878 M_36Dhex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 881 L_1_371hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 882 L_1_371hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 884 L_2_374hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 885 L_2_375hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 887 L_3_377hex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 888 L_3_378hex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 890 L_4_37ahex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 891 L_4_37ahex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 893 L_5_37dhex: 8 Radar + SG_ LongDist : 0|12@1+ (0.0625,0) [0|255.9] "meters" FrontCamera + SG_ LongSpeed : 12|12@1+ (0.0625,-128) [-128|128] "meters/sec" FrontCamera + SG_ LatDist : 24|11@1+ (0.125,-128) [-128|128] "meters" FrontCamera + SG_ ProbExist : 35|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ LongAccel : 40|10@1+ (0.03125,-16) [-16|16] "meters/sec/sec" FrontCamera + SG_ ProbObstacle : 50|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Valid : 55|1@1+ (1,0) [0|1] "" FrontCamera + SG_ ProbNonObstacle : 56|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Meas : 61|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Tracked : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 894 L_5_37dhex2: 8 Radar + SG_ LatSpeed : 0|10@1+ (0.125,-64) [-64|64] "meters/sec" FrontCamera + SG_ Length : 10|6@1+ (0.125,0) [0|7.875] "m" FrontCamera + SG_ dZ : 16|6@1+ (0.25,-5) [-5|10.75] "m" FrontCamera + SG_ MovingState : 22|2@1+ (1,0) [0|3] "" FrontCamera + SG_ dxSigma : 24|6@1+ (1,0) [0|63] "" FrontCamera + SG_ vxSigma : 30|6@1+ (1,0) [0|63] "" FrontCamera + SG_ axSigma : 36|6@1+ (1,0) [0|63] "" FrontCamera + SG_ dySigma : 42|6@1+ (1,0) [0|63] "" FrontCamera + SG_ ProbClass : 48|5@1+ (3.125,0) [0|96.875] "%" FrontCamera + SG_ Class : 53|3@1+ (1,0) [0|7] "" FrontCamera + SG_ dxRearEndLoss : 56|6@1+ (1,0) [0|63] "" FrontCamera + SG_ NotUsed : 62|1@1+ (1,0) [0|1] "" FrontCamera + SG_ Index2 : 63|1@1+ (1,0) [0|1] "" FrontCamera + +BO_ 697 VIN_VIP_405HS: 8 FrontCamera + SG_ VIN_MuxID M : 0|8@1+ (1,0) [0|0] "" Radar + SG_ VIN_Part1 m16 : 47|24@0+ (1,0) [0|16777215] "" Radar + SG_ VIN_Part2 m17 : 15|56@0+ (1,0) [0|7.2057594038E+16] "" Radar + SG_ VIN_Part3 m18 : 15|56@0+ (1,0) [0|7.2057594038E+16] "" Radar + +BO_ 681 Msg2A9_GTW_carConfig: 8 FrontCamera + SG_ Msg2A9_Always0x02 : 48|8@1+ (1,0) [0|0] "" Radar + SG_ Msg2A9_Always0x10 : 56|8@1+ (1,0) [0|0] "" Radar + SG_ Msg2A9_Always0x16 : 8|8@1+ (1,0) [0|0] "" Radar + SG_ Msg2A9_Always0x41 : 24|8@1+ (1,0) [0|0] "" Radar + SG_ Msg2A9_Value1_0x02 : 0|3@1+ (1,0) [0|0] "" Radar + SG_ Msg2A9_FourWheelDrive : 3|2@1+ (1,0) [0|0] "" Radar + SG_ Msg2A9_Value2_0x02 : 5|3@1+ (1,0) [0|0] "" Radar + SG_ Msg2A9_Always0x43 : 16|8@1+ (1,0) [0|0] "" Radar + +BO_ 409 Msg199_STW_ANGLHP_STAT: 8 FrontCamera + SG_ Msg199Always0x04 : 32|8@1+ (1,0) [0|0] "" Radar + SG_ Msg199Always0x20 : 16|8@1+ (1,0) [0|0] "" Radar + SG_ Msg199Always0x2F : 0|8@1+ (1,0) [0|0] "" Radar + SG_ Msg199Always0x67 : 8|8@1+ (1,0) [0|0] "" Radar + SG_ Msg199Always0xFF : 40|8@1+ (1,0) [0|0] "" Radar + SG_ Msg199Checksum : 56|8@1+ (1,0) [0|0] "" Radar + SG_ Msg199Counter : 52|4@1+ (1,0) [0|0] "" Radar + +BO_ 361 Msg169_ESP_wheelSpeeds: 8 FrontCamera + SG_ ESP_wheelSpeedFrL_HS : 0|13@1+ (0.04,0) [0|327.64] "km/h" Radar + SG_ ESP_wheelSpeedFrR_HS : 13|13@1+ (0.04,0) [0|327.64] "km/h" Radar + SG_ ESP_wheelSpeedReL_HS : 26|13@1+ (0.04,0) [0|327.64] "km/h" Radar + SG_ ESP_wheelSpeedReR_HS : 39|13@1+ (0.04,0) [0|327.64] "km/h" Radar + SG_ Msg169Checksum : 56|8@1+ (1,0) [0|0] "" Radar + SG_ Msg169Counter : 52|4@1+ (1,0) [0|0] "" Radar + +BO_ 345 Msg159_ESP_C: 8 FrontCamera + SG_ Msg159Always0x3A : 16|8@1+ (1,0) [0|0] "" Radar + SG_ Msg159Always0xA5 : 0|8@1+ (1,0) [0|0] "" Radar + SG_ Msg159Always0xCF : 32|8@1+ (1,0) [0|0] "" Radar + SG_ Msg159Always0xF4 : 8|8@1+ (1,0) [0|0] "" Radar + SG_ Msg159Counter : 44|4@1+ (1,0) [0|0] "" Radar + SG_ Msg159Checksum : 24|8@1+ (1,0) [0|0] "" Radar + +BO_ 329 Msg149_ESP_145h: 8 FrontCamera + SG_ Msg149Always0x02 : 16|8@1+ (1,0) [0|0] "" Radar + SG_ Msg149Always0x04 : 40|8@1+ (1,0) [0|0] "" Radar + SG_ Msg149Always0x26 : 8|8@1+ (1,0) [0|0] "" Radar + SG_ Msg149Always0x6A : 24|8@1+ (1,0) [0|0] "" Radar + SG_ Msg149Always0xAA : 32|8@1+ (1,0) [0|0] "" Radar + SG_ Msg149Always0xF : 48|4@1+ (1,0) [0|0] "" Radar + SG_ Msg149Checksum : 56|8@1+ (1,0) [0|0] "" Radar + SG_ Msg149Counter : 52|4@1+ (1,0) [0|0] "" Radar + +BO_ 297 Msg129_ESP_115h: 6 FrontCamera + SG_ Msg129Always0x20 : 24|8@1+ (1,0) [0|0] "" Radar + SG_ Msg129Checksum : 40|8@1+ (1,0) [0|0] "" Radar + SG_ Msg129Counter : 36|4@1+ (1,0) [0|0] "" Radar + +BO_ 281 Msg119_DI_torque2: 6 FrontCamera + SG_ Msg119Always0x11 : 24|8@1+ (1,0) [0|0] "" Radar + SG_ Msg119Always0x1F : 8|8@1+ (1,0) [0|0] "" Radar + SG_ Msg119Always0x8 : 36|4@1+ (1,0) [0|0] "" Radar + SG_ Msg119Always0xF4 : 16|8@1+ (1,0) [0|0] "" Radar + SG_ Msg119Always0xFF : 0|8@1+ (1,0) [0|0] "" Radar + SG_ Msg119Checksum : 40|8@1+ (1,0) [0|0] "" Radar + SG_ Msg119Counter : 32|4@1+ (1,0) [0|0] "" Radar + +BO_ 265 Msg109_DI_torque1: 8 FrontCamera + SG_ Msg109Always0x80 : 24|8@1+ (1,0) [0|0] "" Radar + SG_ Msg109Checksum : 56|8@1+ (1,0) [0|0] "" Radar + SG_ Msg109Counter : 13|3@1+ (1,0) [0|0] "" Radar + +BO_ 521 Msg209_GTW_odo: 8 FrontCamera + SG_ Msg209Always0x61 : 8|8@1+ (1,0) [0|0] "" Radar + SG_ Msg209Always0x94 : 16|8@1+ (1,0) [0|0] "" Radar + SG_ Msg209Always0x52 : 24|8@1+ (1,0) [0|0] "" Radar + SG_ Msg209Always0x13 : 32|8@1+ (1,0) [0|0] "" Radar + SG_ Msg209Always0x03 : 40|8@1+ (1,0) [0|0] "" Radar + SG_ Msg209Always0x80 : 48|8@1+ (1,0) [0|0] "" Radar + +BO_ 537 Msg219_STW_ACTN_RQ: 8 FrontCamera + SG_ Msg219Counter : 52|4@1+ (1,0) [0|15] "" Radar + SG_ Msg219CRC : 56|8@1+ (1,0) [0|0] "" Radar + +BO_ 425 Msg1A9_DI_espControl: 5 FrontCamera + SG_ Msg1A9Always0x0C : 16|8@1+ (1,0) [0|0] "" Radar + SG_ Msg1A9Counter : 28|4@1+ (1,0) [0|0] "" Radar + SG_ Msg1A9Checksum : 32|8@1+ (1,0) [0|0] "" Radar + +BO_ 729 Msg2D9_BC_status : 8 FrontCamera + SG_ Msg2D9Always0x80 : 0|8@1+ (1,0) [0|0] "" Radar + SG_ Msg2D9Always0x40 : 8|8@1+ (1,0) [0|0] "" Radar + SG_ Msg2D9Always0x83 : 16|8@1+ (1,0) [0|0] "" Radar + +BO_ 1601 UDS_radarRequest: 8 FrontCamera + SG_ UDS_radarRequestData : 7|64@0+ (1,0) [0|0] "" Radar + +BO_ 1617 Radar_udsResponse: 8 Radar + SG_ Radar_udsResponseData : 7|64@0+ (1,0) [0|0] "" FrontCamera + +BO_ 529 RCM_status: 8 RCM + SG_ RCM_driverOrientationInitStatus : 2|3@0+ (1,0) [0|7] "" GTW,OCS + SG_ RCM_armStatus : 5|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_warningIndicatorState : 7|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_tellTalePassengerState : 9|2@0+ (1,0) [0|3] "" GTW,OCS,DAS + SG_ RCM_bucklePassengerStatus : 11|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_tellTaleDriverState : 13|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_buckleDriverStatus : 15|2@0+ (1,0) [0|3] "" GTW,OCS,DAS + SG_ RCM_seatTrackPositionDrvr : 19|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_passAirbagRequest : 21|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_chimeState1stRow : 23|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_vinLearnFlag : 25|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_hwConfigPin58 : 27|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_hwConfigPin57 : 29|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_hwConfigPin56 : 31|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_passOccupantStatus : 33|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_airbagCutoffSwStatus : 35|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_privateCANStatus : 37|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_publicCANStatus : 39|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_edr2State : 45|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_edr1State : 47|2@0+ (1,0) [0|3] "" GTW,OCS + SG_ RCM_buckle2ndRowStatus : 50|3@0+ (1,0) [0|3] "" GTW,OCS,DAS + SG_ RCM_statusCounter : 55|4@0+ (1,0) [0|15] "" GTW,OCS,DAS + SG_ RCM_statusChecksum : 63|8@0+ (1,0) [0|255] "" GTW,OCS,DAS + +CM_ BO_ 697 "Start with MuxID 0x12, then 0x11 and finally 0x10 (VIN is then transmitted in the reverse order)"; +CM_ BO_ 681 "Message sent every 1000 ms. All fixed bytes, no checksum, the byte for RWD or AWD needs to match VIN config"; +CM_ BO_ 409 "Message sent every 10ms. Checksum : use all first 7 bytes with the SAE J1850 CRC algo"; +CM_ BO_ 361 "Message sent every 10ms. Checksum : Sum of all first 7 bytes + 0x76"; +CM_ BO_ 345 "Message sent every 20ms. Checksum : Sum of all first bytes + 0xc; place checksum in 4th octet"; +CM_ BO_ 329 "Message sent every 20ms. Checksum : Sum of all first 7 bytes + 0x46"; +CM_ BO_ 297 "Message sent every 20ms. Checksum : Sum of all first 5 bytes + 0x16"; +CM_ BO_ 281 "Message sent every 10ms. Checksum : Sum of all first 5 bytes + 0x17"; +CM_ BO_ 265 "Message sent every 10ms. Checksum : Sum of all first 7 bytes + 0x7"; +CM_ BO_ 521 "Message sent every 100ms. All fixed bytes, no checksum."; +CM_ BO_ 537 "Message sent every 100ms. Checksum : use all first 7 bytes with the SAE J1850 CRC algo"; +CM_ BO_ 425 "Message sent every 20ms. Checksum : Sum of all first 4 bytes + 0x38"; +CM_ BO_ 729 "Message sent every 1000ms. All fixed bytes, no checksum."; + +BA_DEF_ "BusType" STRING ; +BA_DEF_ BO_ "GenMsgCycleTime" INT 0 0; +BA_DEF_ SG_ "FieldType" STRING ; + +BA_DEF_DEF_ "BusType" "CAN"; +BA_DEF_DEF_ "FieldType" ""; +BA_DEF_DEF_ "GenMsgCycleTime" 0; + +BA_ "GenMsgCycleTime" BO_ 697 250; +BA_ "GenMsgCycleTime" BO_ 681 1000; +BA_ "GenMsgCycleTime" BO_ 409 10; +BA_ "GenMsgCycleTime" BO_ 361 10; +BA_ "GenMsgCycleTime" BO_ 345 20; +BA_ "GenMsgCycleTime" BO_ 329 20; +BA_ "GenMsgCycleTime" BO_ 297 20; +BA_ "GenMsgCycleTime" BO_ 281 10; +BA_ "GenMsgCycleTime" BO_ 265 10; +BA_ "GenMsgCycleTime" BO_ 521 100; +BA_ "GenMsgCycleTime" BO_ 537 100; +BA_ "GenMsgCycleTime" BO_ 425 20; +BA_ "GenMsgCycleTime" BO_ 729 1000; + +VAL_ 681 Msg2A9_FourWheelDrive 3 "SNA" 2 "UNUSED" 1 "4WD" 0 "2WD" ; +VAL_ 785 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 785 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 788 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 788 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 791 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 791 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 794 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 794 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 797 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 797 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 800 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 800 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 803 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 803 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 806 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 806 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 809 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 809 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 812 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 812 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 815 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 815 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 818 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 818 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 821 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 821 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 824 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 824 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 827 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 827 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 830 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 830 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 833 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 833 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 836 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 836 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 839 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 839 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 842 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 842 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 845 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 845 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 848 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 848 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 851 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 851 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 854 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 854 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 857 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 857 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 860 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 860 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 863 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 863 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 866 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 866 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 869 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 869 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 872 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 872 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 875 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 875 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 878 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 878 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 882 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 882 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 885 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 885 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 888 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 888 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 891 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 891 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; +VAL_ 894 MovingState 3 "RADAR_MOVESTATE_STANDING" 2 "RADAR_MOVESTATE_STOPPED" 1 "RADAR_MOVESTATE_MOVING" 0 "RADAR_MOVESTATE_INDETERMINATE" ; +VAL_ 894 Class 4 "RADAR_CLASS_CONSTRUCTION_ELEMENT" 3 "RADAR_CLASS_MOVING_PEDESTRIAN" 2 "RADAR_CLASS_MOVING_TWO_WHEEL_VEHICLE" 1 "RADAR_CLASS_MOVING_FOUR_WHEEL_VEHICLE" 0 "RADAR_CLASS_UNKNOWN" ; + diff --git a/opendbc/toyota_adas.dbc b/opendbc/toyota_adas.dbc new file mode 100644 index 000000000..4aae65aa4 --- /dev/null +++ b/opendbc/toyota_adas.dbc @@ -0,0 +1,276 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + +BO_ 528 TRACK_A_0: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 529 TRACK_A_1: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 530 TRACK_A_2: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 531 TRACK_A_3: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 532 TRACK_A_4: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 533 TRACK_A_5: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 534 TRACK_A_6: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 535 TRACK_A_7: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 536 TRACK_A_8: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 537 TRACK_A_9: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 538 TRACK_A_10: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 539 TRACK_A_11: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 540 TRACK_A_12: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 541 TRACK_A_13: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 542 TRACK_A_14: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 543 TRACK_A_15: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 544 TRACK_B_0: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 545 TRACK_B_1: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 546 TRACK_B_2: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 547 TRACK_B_3: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 548 TRACK_B_4: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 549 TRACK_B_5: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 550 TRACK_B_6: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 551 TRACK_B_7: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 552 TRACK_B_8: 6 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 47|8@0+ (1,0) [0|255] "" XXX + +BO_ 553 TRACK_B_9: 6 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 47|8@0+ (1,0) [0|255] "" XXX + +BO_ 554 TRACK_B_10: 6 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 47|8@0+ (1,0) [0|255] "" XXX + +BO_ 555 TRACK_B_11: 6 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 47|8@0+ (1,0) [0|255] "" XXX + +BO_ 556 TRACK_B_12: 6 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 47|8@0+ (1,0) [0|255] "" XXX + +BO_ 557 TRACK_B_13: 6 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 47|8@0+ (1,0) [0|255] "" XXX + +BO_ 558 TRACK_B_14: 6 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 47|8@0+ (1,0) [0|255] "" XXX + +BO_ 559 TRACK_B_15: 6 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 47|8@0+ (1,0) [0|255] "" XXX diff --git a/opendbc/toyota_corolla_2017_pt_generated.dbc b/opendbc/toyota_corolla_2017_pt_generated.dbc new file mode 100644 index 000000000..0a4f9b928 --- /dev/null +++ b/opendbc/toyota_corolla_2017_pt_generated.dbc @@ -0,0 +1,446 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 359 STEERING_IPAS_COMMA: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +CM_ "BO_ STEERING_IPAS_COMMA: Copy of msg 614 so we can do angle control while the Park Assist ECU is connected (Panda spoofs 614 with 359 on connector J70). Note that addresses 0x266 and 0x167 are checksum-invariant"; + + BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.159375,-75.555) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.159375,-151.111) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + + BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.159375,-75.555) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.159375,-151.111) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + + VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + +BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX + SG_ ZORRO_STEER : 7|24@0- (0.004901594652,0) [-500|500] "" XXX + +CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss"; + +BO_ 241 ACC_CONTROL_ALT: 8 EON + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU + SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + +BO_ 242 PRECOLLISION_2_ALT: 8 EON + SG_ DECELERATION : 7|10@0- (0.1,0) [0|0] "m/s^2" Vector__XXX + SG_ DS1STAT2 : 13|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ DS1STBK2 : 10|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSWAR : 18|1@0+ (1,0) [0|0] "" FCM + SG_ PCSALM : 17|1@0+ (1,0) [0|0] "" FCM + SG_ PCSOPR : 16|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSABK : 31|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBATRGR : 30|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PPTRGR : 28|1@0+ (1,0) [0|0] "" FCM + SG_ IBTRGR : 27|1@0+ (1,0) [0|0] "" FCM + SG_ CLEXTRGR : 26|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ IRLT_REQ : 25|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ BRKHLD : 37|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ AVSTRGR : 36|1@0+ (1,0) [0|0] "" SCS + SG_ VGRSTRGR : 35|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PREFILL : 33|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBRTRGR : 32|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSDIS : 43|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBPREPMP : 40|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" FCM + + +CM_ "Imported file _toyota_2017.dbc starts here"; +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX DSU HCU EPS IPAS CGW + +BO_ 36 KINEMATICS: 8 XXX + SG_ ACCEL_Y : 33|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX + SG_ YAW_RATE : 1|10@0+ (0.244,-125) [0|65535] "deg/sec" XXX + SG_ STEERING_TORQUE : 17|10@0+ (1,-512) [0|65535] "" XXX + +BO_ 37 STEER_ANGLE_SENSOR: 8 XXX + SG_ STEER_ANGLE : 3|12@0- (1.5,0) [-500|500] "deg" XXX + SG_ STEER_FRACTION : 39|4@0- (0.1,0) [-0.7|0.7] "deg" XXX + SG_ STEER_RATE : 35|12@0- (1,0) [-2000|2000] "deg/s" XXX + +BO_ 166 BRAKE: 8 XXX + SG_ BRAKE_AMOUNT : 7|8@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_PEDAL : 23|8@0+ (1,0) [0|255] "" XXX + +BO_ 170 WHEEL_SPEEDS: 8 XXX + SG_ WHEEL_SPEED_FR : 7|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_FL : 23|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_RR : 39|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_RL : 55|16@0+ (0.01,-67.67) [0|250] "kph" XXX + +BO_ 180 SPEED: 8 XXX + SG_ ENCODER : 39|8@0+ (1,0) [0|255] "" XXX + SG_ SPEED : 47|16@0+ (0.01,0) [0|250] "kph" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 353 DSU_SPEED: 7 XXX + SG_ FORWARD_SPEED : 15|16@0- (0.00390625,-30) [0|255] "kph" XXX + +BO_ 452 ENGINE_RPM: 8 CGW + SG_ RPM : 7|16@0- (0.78125,0) [0|0] "rpm" SCS + +BO_ 466 PCM_CRUISE: 8 XXX + SG_ GAS_RELEASED : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_ACTIVE : 5|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL_ON : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ACCEL_NET : 23|16@0- (0.001,0) [-20|20] "m/s2" XXX + SG_ CRUISE_STATE : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CANCEL_REQ : 49|1@1+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 467 PCM_CRUISE_2: 8 XXX + SG_ MAIN_ON : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_SPEED_LOCKOUT : 14|2@0+ (1,0) [0|3] "kph" XXX + SG_ SET_SPEED : 23|8@0+ (1,0) [0|255] "kph" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 552 ACCELEROMETER: 8 XXX + SG_ ACCEL_Z : 22|15@0- (1,0) [0|32767] "" XXX + SG_ ACCEL_X : 6|15@0- (0.001,0) [-20|20] "m/s2" XXX + +BO_ 560 BRAKE_MODULE2: 7 XXX + SG_ BRAKE_PRESSED : 26|1@0+ (1,0) [0|1] "" XXX + +BO_ 614 STEERING_IPAS: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 643 PRE_COLLISION: 7 DSU + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ FORCE : 23|16@0- (2,0) [0|255] "N" XXX + SG_ SET_ME_X002 : 33|8@0+ (1,0) [0|3] "" XXX + SG_ BRAKE_STATUS : 39|3@0+ (1,0) [0|255] "" XXX + SG_ STATE : 36|3@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X003 : 40|1@0+ (1,0) [0|1] "" XXX + SG_ PRECOLLISION_ACTIVE : 41|1@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 55|8@0+ (1,0) [0|255] "" XXX + +BO_ 740 STEERING_LKA: 5 XXX + SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 6|6@0+ (1,0) [0|63] "" XXX + SG_ SET_ME_1 : 7|1@0+ (1,0) [0|1] "" XXX + SG_ STEER_TORQUE_CMD : 15|16@0- (1,0) [0|65535] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 742 LEAD_INFO: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" HCU + SG_ LEAD_REL_SPEED : 23|12@0- (0.025,0) [-100|100] "m/s" HCU + SG_ LEAD_LONG_DIST : 7|13@0+ (0.05,0) [0|300] "m" HCU + +BO_ 835 ACC_CONTROL: 8 DSU + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU + SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + +BO_ 836 PRE_COLLISION_2: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 869 DSU_CRUISE : 7 DSU + SG_ RES_BTN : 3|1@0+ (1,0) [0|0] "" XXX + SG_ SET_BTN : 2|1@0+ (1,0) [0|0] "" XXX + SG_ CANCEL_BTN : 1|1@0+ (1,0) [0|0] "" XXX + SG_ MAIN_ON : 0|1@0+ (1,0) [0|0] "" XXX + SG_ SET_SPEED : 15|8@0+ (1,0) [0|0] "km/h" XXX + SG_ CRUISE_REQUEST : 31|8@0+ (100,-12800) [0|0] "N" XXX + SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|0] "m" XXX + +BO_ 921 PCM_CRUISE_SM: 8 XXX + SG_ MAIN_ON : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_CONTROL_STATE : 11|4@0+ (1,0) [0|15] "" XXX + SG_ DISTANCE_LINES : 14|2@0+ (1,0) [0|3] "" XXX + SG_ UI_SET_SPEED : 31|8@0+ (1,0) [0|255] "" XXX + +BO_ 951 ESP_CONTROL: 8 ESP + SG_ TC_DISABLED : 13|1@0+ (1,0) [0|1] "" XXX + SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX + +BO_ 1041 ACC_HUD: 8 DSU + SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX + +BO_ 1042 LKAS_HUD: 8 XXX + SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX + SG_ RIGHT_LINE : 3|2@0+ (1,0) [0|3] "" XXX + SG_ LEFT_LINE : 5|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X01 : 7|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X01_2 : 11|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_ALERT : 9|2@0+ (1,0) [0|3] "" XXX + SG_ TWO_BEEPS : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ADJUSTING_CAMERA : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_MALFUNCTION : 15|1@0+ (1,0) [0|1] "" XXX + SG_ REPEATED_BEEPS : 32|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X0C : 23|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X2C : 47|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X38 : 55|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X02 : 63|8@0+ (1,0) [0|1] "" XXX + +BO_ 1043 TIME : 8 CGW + SG_ YEAR : 7|8@0+ (1,0) [0|0] "year" XXX + SG_ MONTH : 15|8@0+ (1,0) [0|0] "month" XXX + SG_ DAY : 23|8@0+ (1,0) [0|0] "day" XXX + SG_ HOUR : 31|8@0+ (1,0) [0|0] "hour" XXX + SG_ MINUTE : 39|8@0+ (1,0) [0|0] "minute" XXX + SG_ GMT_DIFF : 55|1@0+ (1,0) [0|0] "" XXX + SG_ GMTDIFF_HOURS : 54|4@0+ (1,0) [0|0] "hours" XXX + SG_ GMTDIFF_MINUTES : 50|6@0+ (1,0) [0|0] "minutes" XXX + SG_ SUMMER : 60|1@0+ (1,0) [0|0] "" XXX + +BO_ 1408 VIN_PART_1: 8 CGW + SG_ VIN_1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_2 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_3 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_4 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_5 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_6 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_7 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_8 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1409 VIN_PART_2: 8 CGW + SG_ VIN_9 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_10 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_11 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_12 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_13 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_14 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_15 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_16 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1410 VIN_PART_3: 8 CGW + SG_ VIN_17 : 7|8@0+ (1,0) [0|0] "" XXX + +BO_ 1553 UI_SETTING: 8 XXX + SG_ UNITS : 26|2@0+ (1,0) [0|3] "" XXX + SG_ ODOMETER : 43|20@0+ (1,0) [0|1048575] "" XXX + +BO_ 1556 STEERING_LEVERS: 8 XXX + SG_ TURN_SIGNALS : 29|2@0+ (1,0) [0|3] "" XXX + SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX + +BO_ 1568 SEATS_DOORS: 8 XXX + SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 43|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FR : 44|1@0+ (1,0) [0|1] "" XXX + +BO_ 1570 LIGHT_STALK: 8 SCM + SG_ AUTO_HIGH_BEAM : 37|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_FOG : 27|1@0+ (1,0) [0|1] "" XXX + SG_ PARKING_LIGHT : 28|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_BEAM : 29|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAM : 30|1@0+ (1,0) [0|1] "" XXX + +BO_ 1161 RSA1: 8 FCM + SG_ TSGN1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY1 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT1 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL1 : 23|8@0+ (1,0) [0|0] "kph" XXX + SG_ SPLSGN1 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN2 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN2 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY2 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT2 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL2 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_P : 63|2@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_A : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID1 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1162 RSA2: 8 FCM + SG_ TSGN3 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY3 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT3 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN3 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN4 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN4 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY4 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT4 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ DPSGNREQ : 54|1@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMP : 53|3@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMA : 50|3@0+ (1,0) [0|0] "" XXX + SG_ SPDUNT : 63|2@0+ (1,0) [0|0] "" XXX + SG_ TSRWMSG : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID2 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1163 RSA3: 8 FCM + SG_ TSREQPD : 7|1@0+ (1,0) [0|0] "" XXX + SG_ TSRMSW : 6|1@0+ (1,0) [0|0] "" XXX + SG_ OTSGNNTM : 5|2@0+ (1,0) [0|0] "" XXX + SG_ NTLVLSPD : 3|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPNTM : 1|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPVALL : 11|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALM : 19|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALH : 27|4@0+ (1,-5) [0|0] "" XXX + SG_ TSRSPU : 33|2@0+ (1,0) [0|0] "" XXX + +CM_ SG_ 36 ACCEL_Y "unit is tbd"; +CM_ SG_ 36 YAW_RATE "verify"; +CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd"; +CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set"; +CM_ SG_ 37 STEER_RATE "factor is tbd"; +CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors"; +CM_ SG_ 466 CRUISE_STATE "Active state is 8, if standstill is requested will switch to state 11(3 sec timer), after timer is elapsed will switch into state 7(standstill). If plus button was pressed - status 9, minus button pressed - status 10"; +CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect"; +CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph"; +CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?"; +CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque"; +CM_ SG_ 608 STEER_OVERRIDE "set when driver torque exceeds a certain value"; +CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active"; +CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking"; +CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG."; +CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file."; +CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit"; +CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel"; +CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces"; +CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts"; +CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit."; +CM_ SG_ 1161 SYNCID1 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1161 SPDVAL2 "conditional speed value 70"; +CM_ SG_ 1162 SGNNUMP "1 if SPDVAL1 is set, otherwise 0"; +CM_ SG_ 1162 SYNCID2 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1163 TSREQPD "always 1"; +CM_ SG_ 1163 TSRMSW "always 1"; +CM_ SG_ 1163 OTSGNNTM "always 3"; +CM_ SG_ 1163 NTLVLSPD "always 3"; +CM_ SG_ 1163 OVSPNTM "always 3"; +CM_ SG_ 1163 OVSPVALL "-5 at start then 2 after 2 seconds"; +CM_ SG_ 1163 OVSPVALM "-5 at start then 5 after 2 seconds"; +CM_ SG_ 1163 OVSPVALH "-5 at start then 10 after 2 seconds"; +CM_ SG_ 1163 TSRSPU "always 1"; +CM_ SG_ 1553 ODOMETER "Unit is dependent upon units signal"; + +VAL_ 466 CRUISE_STATE 11 "timer_3sec" 10 "adaptive click down" 9 "adaptive click up" 8 "adaptive engaged" 7 "standstill" 6 "non-adaptive click up" 5 "non-adaptive click down" 4 "non-adaptive hold down" 3 "non-adaptive hold up" 2 "non-adaptive being engaged" 1 "non-adaptive engaged" 0 "off"; +VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok"; +VAL_ 614 STATE 3 "enabled" 1 "disabled"; +VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left"; +VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking"; +VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted"; +VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none"; +VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none"; +VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1042 LEFT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1553 UNITS 1 "km" 2 "miles"; +VAL_ 1556 TURN_SIGNALS 3 "none" 2 "right" 1 "left"; +VAL_ 1161 TSGN1 1 "speed sign" 0 "none"; +VAL_ 1161 TSGN2 1 "speed sign" 0 "none"; +VAL_ 1161 SPLSGN2 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; +VAL_ 1162 TSGN3 0 "none" 1 "speed sign" 2 "0 unlimited" 7 "unlimited" 16 "highway" 17 "no highway" 18 "motorway" 19 "no motorway" 20 "in city" 21 "outside city" 22 "pedestrian area" 23 "no pedestrian area" 65 "no overtaking left" 66 "no overtaking right" 67 "overtaking allowed again" 81 "no right turn" 97 "stop" 105 "yield" 113 "stop" 114 "yield us" 129 "no entry" 138 "no entry tss2" 145 "do not enter"; +VAL_ 1162 SPLSGN3 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; + + +CM_ "CHFFR_METRIC 37 STEER_ANGLE STEER_ANGLE 0.36 180"; + +CM_ "toyota_corolla_2017_pt.dbc starts here"; + + + +BO_ 548 BRAKE_MODULE: 8 XXX + SG_ BRAKE_PRESSURE : 43|12@0+ (1,0) [0|4047] "" XXX + SG_ BRAKE_PRESSED : 5|1@0+ (1,0) [0|1] "" XXX + +BO_ 705 GAS_PEDAL: 8 XXX + SG_ GAS_RELEASED : 3|1@0+ (1,0) [0|1] "" XXX + SG_ GAS_PEDAL : 55|8@0+ (0.005,0) [0|1] "" XXX + +BO_ 608 STEER_TORQUE_SENSOR: 8 XXX + SG_ STEER_TORQUE_EPS : 47|16@0- (0.88,0) [-20000|20000] "" XXX + SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX + SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_ANGLE : 31|16@0- (0.0573,0) [-500|500] "" XXX + +BO_ 610 EPS_STATUS: 5 EPS + SG_ IPAS_STATE : 3|4@0+ (1,0) [0|15] "" XXX + SG_ LKA_STATE : 31|7@0+ (1,0) [0|127] "" XXX + SG_ TYPE : 24|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 956 GEAR_PACKET: 8 XXX + SG_ GEAR : 13|6@0+ (1,0) [0|63] "" XXX + SG_ SPORT_ON : 3|1@0+ (1,0) [0|1] "" XXX + +CM_ SG_ 548 BRAKE_PRESSURE "seems prop to pedal force"; +CM_ SG_ 548 BRAKE_POSITION "seems proportional to pedal displacement, unclear the max value of 0x1c8"; +CM_ SG_ 610 TYPE "seems 1 on Corolla, 0 on all others"; +VAL_ 956 GEAR 0 "D" 1 "S" 8 "N" 16 "R" 32 "P"; +VAL_ 610 IPAS_STATE 5 "override" 3 "enabled" 1 "disabled"; +VAL_ 610 LKA_STATE 25 "temporary_fault" 9 "temporary_fault2" 5 "active" 1 "standby"; diff --git a/opendbc/toyota_new_mc_pt_generated.dbc b/opendbc/toyota_new_mc_pt_generated.dbc new file mode 100644 index 000000000..dcbf1bb99 --- /dev/null +++ b/opendbc/toyota_new_mc_pt_generated.dbc @@ -0,0 +1,535 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 359 STEERING_IPAS_COMMA: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +CM_ "BO_ STEERING_IPAS_COMMA: Copy of msg 614 so we can do angle control while the Park Assist ECU is connected (Panda spoofs 614 with 359 on connector J70). Note that addresses 0x266 and 0x167 are checksum-invariant"; + +BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.159375,-75.555) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.159375,-151.111) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + +BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.159375,-75.555) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.159375,-151.111) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + +VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + +BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX + SG_ ZORRO_STEER : 7|24@0- (0.004901594652,0) [-500|500] "" XXX + +CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss"; + +BO_ 767 SDSU: 8 XXX + SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX + +CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu"; +CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu"; + + +CM_ "Imported file _toyota_2017.dbc starts here"; +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX DSU HCU EPS IPAS CGW BGM + +BO_ 36 KINEMATICS: 8 XXX + SG_ ACCEL_Y : 33|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX + SG_ YAW_RATE : 1|10@0+ (0.244,-125) [0|65535] "deg/s" XXX + SG_ STEERING_TORQUE : 17|10@0+ (1,-512) [0|65535] "" XXX + +BO_ 37 STEER_ANGLE_SENSOR: 8 XXX + SG_ STEER_ANGLE : 3|12@0- (1.5,0) [-500|500] "deg" XXX + SG_ STEER_FRACTION : 39|4@0- (0.1,0) [-0.7|0.7] "deg" XXX + SG_ STEER_RATE : 35|12@0- (1,0) [-2000|2000] "deg/s" XXX + +BO_ 166 BRAKE: 8 XXX + SG_ BRAKE_AMOUNT : 7|8@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_PEDAL : 23|8@0+ (1,0) [0|255] "" XXX + +BO_ 170 WHEEL_SPEEDS: 8 XXX + SG_ WHEEL_SPEED_FR : 7|16@0+ (0.01,-67.67) [0|250] "km/h" XXX + SG_ WHEEL_SPEED_FL : 23|16@0+ (0.01,-67.67) [0|250] "km/h" XXX + SG_ WHEEL_SPEED_RR : 39|16@0+ (0.01,-67.67) [0|250] "km/h" XXX + SG_ WHEEL_SPEED_RL : 55|16@0+ (0.01,-67.67) [0|250] "km/h" XXX + +BO_ 180 SPEED: 8 XXX + SG_ ENCODER : 39|8@0+ (1,0) [0|255] "" XXX + SG_ SPEED : 47|16@0+ (0.01,0) [0|250] "km/h" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 295 GEAR_PACKET_HYBRID: 8 XXX + SG_ CAR_MOVEMENT : 39|8@0- (1,0) [0|255] "" XXX + SG_ COUNTER : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ GEAR : 47|4@0+ (1,0) [0|15] "" XXX + +BO_ 353 DSU_SPEED: 7 XXX + SG_ FORWARD_SPEED : 15|16@0- (0.00390625,-30) [0|255] "km/h" XXX + +BO_ 452 ENGINE_RPM: 8 CGW + SG_ RPM : 7|16@0- (0.78125,0) [0|0] "rpm" SCS + +BO_ 466 PCM_CRUISE: 8 XXX + SG_ GAS_RELEASED : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_ACTIVE : 5|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL_ON : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ACCEL_NET : 23|16@0- (0.001,0) [-20|20] "m/s^2" XXX + SG_ CRUISE_STATE : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CANCEL_REQ : 49|1@1+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 467 PCM_CRUISE_2: 8 XXX + SG_ MAIN_ON : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_SPEED_LOCKOUT : 14|2@0+ (1,0) [0|3] "" XXX + SG_ SET_SPEED : 23|8@0+ (1,0) [0|255] "km/h" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 552 ACCELEROMETER: 8 XXX + SG_ ACCEL_Z : 22|15@0- (1,0) [0|32767] "m/s^2" XXX + SG_ ACCEL_X : 6|15@0- (0.001,0) [-20|20] "m/s^2" XXX + +BO_ 560 BRAKE_2: 7 XXX + SG_ BRAKE_PRESSED : 26|1@0+ (1,0) [0|1] "" XXX + +BO_ 581 GAS_PEDAL_HYBRID: 8 XXX + SG_ GAS_PEDAL : 23|8@0+ (0.005,0) [0|1] "" XXX + +BO_ 608 STEER_TORQUE_SENSOR: 8 XXX + SG_ STEER_TORQUE_EPS : 47|16@0- (1,0) [-32768|32767] "" XXX + SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX + SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_ANGLE : 31|16@0- (0.0573,0) [-500|500] "" XXX + +BO_ 614 STEERING_IPAS: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 643 PRE_COLLISION: 7 DSU + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ FORCE : 23|16@0- (2,0) [0|255] "N" XXX + SG_ SET_ME_X002 : 33|8@0+ (1,0) [0|3] "" XXX + SG_ BRAKE_STATUS : 39|3@0+ (1,0) [0|255] "" XXX + SG_ STATE : 36|3@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X003 : 40|1@0+ (1,0) [0|1] "" XXX + SG_ PRECOLLISION_ACTIVE : 41|1@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 55|8@0+ (1,0) [0|255] "" XXX + +BO_ 705 GAS_PEDAL: 8 XXX + SG_ GAS_RELEASED : 3|1@0+ (1,0) [0|1] "" XXX + SG_ GAS_PEDAL : 55|8@0+ (0.005,0) [0|1] "" XXX + +BO_ 740 STEERING_LKA: 5 XXX + SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 6|6@0+ (1,0) [0|63] "" XXX + SG_ SET_ME_1 : 7|1@0+ (1,0) [0|1] "" XXX + SG_ STEER_TORQUE_CMD : 15|16@0- (1,0) [0|65535] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 742 LEAD_INFO: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" HCU + SG_ LEAD_REL_SPEED : 23|12@0- (0.025,0) [-100|100] "m/s" HCU + SG_ LEAD_LONG_DIST : 7|13@0+ (0.05,0) [0|300] "m" HCU + +BO_ 835 ACC_CONTROL: 8 DSU + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s^2" HCU + SG_ ACC_MALFUNCTION : 18|1@0+ (1,0) [0|0] "" XXX + SG_ ACC_CUT_IN : 25|1@0+ (1,0) [0|1] "" XXX + SG_ ALLOW_LONG_PRESS : 17|2@0+ (1,0) [0|2] "" XXX + SG_ ITS_CONNECT_LEAD : 39|8@0+ (1,0) [0|1] "" Vector__XXX + SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + SG_ RADAR_DIRTY : 19|1@0+ (1,0) [0|1] "" XXX + +BO_ 836 PRE_COLLISION_2: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 869 DSU_CRUISE : 7 DSU + SG_ RES_BTN : 3|1@0+ (1,0) [0|0] "" XXX + SG_ SET_BTN : 2|1@0+ (1,0) [0|0] "" XXX + SG_ CANCEL_BTN : 1|1@0+ (1,0) [0|0] "" XXX + SG_ MAIN_ON : 0|1@0+ (1,0) [0|0] "" XXX + SG_ SET_SPEED : 15|8@0+ (1,0) [0|0] "km/h" XXX + SG_ CRUISE_REQUEST : 31|8@0+ (100,-12800) [0|0] "N" XXX + SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|0] "m" XXX + +BO_ 921 PCM_CRUISE_SM: 8 XXX + SG_ MAIN_ON : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_CONTROL_STATE : 11|4@0+ (1,0) [0|15] "" XXX + SG_ DISTANCE_LINES : 14|2@0+ (1,0) [0|3] "" XXX + SG_ UI_SET_SPEED : 31|8@0+ (1,0) [0|255] "" XXX + +BO_ 951 ESP_CONTROL: 8 ESP + SG_ TC_DISABLED : 13|1@0+ (1,0) [0|1] "" XXX + SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ENABLED : 33|1@1+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 36|1@0+ (1,0) [0|1] "" XXX + +BO_ 956 GEAR_PACKET: 8 XXX + SG_ SPORT_ON : 2|1@0+ (1,0) [0|1] "" XXX + SG_ GEAR : 13|6@0+ (1,0) [0|63] "" XXX + SG_ SPORT_GEAR_ON : 33|1@0+ (1,0) [0|1] "" XXX + SG_ SPORT_GEAR : 38|3@0+ (1,0) [0|7] "" XXX + SG_ ECON_ON : 40|1@0+ (1,0) [0|1] "" XXX + SG_ B_GEAR_ENGAGED : 41|1@0+ (1,0) [0|1] "" XXX + SG_ DRIVE_ENGAGED : 47|1@0+ (1,0) [0|1] "" XXX + +BO_ 1005 REVERSE_CAMERA_STATE: 2 BGM + SG_ REVERSE_CAMERA_GUIDELINES : 9|2@0+ (1,0) [1|3] "" XXX + +BO_ 1009 PCM_CRUISE_ALT: 8 XXX + SG_ MAIN_ON : 13|1@0+ (1,0) [0|3] "" XXX + SG_ CRUISE_STATE : 10|1@0+ (1,0) [0|1] "" XXX + SG_ SET_SPEED : 23|8@0+ (1,0) [0|255] "mph" XXX + +BO_ 1020 SOLAR_SENSOR: 8 XXX + SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX + +BO_ 1041 ACC_HUD: 8 DSU + SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX + SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX + SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX + SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX + +BO_ 1042 LKAS_HUD: 8 DSU + SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX + SG_ RIGHT_LINE : 3|2@0+ (1,0) [0|3] "" XXX + SG_ LEFT_LINE : 5|2@0+ (1,0) [0|3] "" XXX + SG_ LKAS_STATUS : 7|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_ALERT : 9|2@0+ (1,0) [0|3] "" XXX + SG_ LDW_EXIST : 10|1@0+ (1,0) [0|1] "" XXX + SG_ TWO_BEEPS : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ADJUSTING_CAMERA : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_UNAVAILABLE_QUIET : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_MALFUNCTION : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_UNAVAILABLE : 16|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_SENSITIVITY : 18|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_SA_TOGGLE : 20|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_SPEED_TOO_LOW : 21|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_ON_MESSAGE : 31|2@0+ (1,0) [0|3] "" XXX + SG_ REPEATED_BEEPS : 32|1@0+ (1,0) [0|1] "" XXX + SG_ LANE_SWAY_TOGGLE : 43|1@0+ (1,0) [0|1] "" XXX + SG_ LANE_SWAY_SENSITIVITY : 45|2@0+ (1,0) [0|3] "" XXX + SG_ TAKE_CONTROL : 46|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_FRONT_CAMERA_BLOCKED : 47|1@0+ (1,0) [0|1] "" XXX + SG_ LANE_SWAY_BUZZER : 50|2@0+ (1,0) [0|0] "" XXX + SG_ LANE_SWAY_FLD : 53|3@0+ (1,0) [0|7] "" XXX + SG_ LANE_SWAY_WARNING : 55|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X01 : 42|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X02 : 63|8@0+ (1,0) [0|1] "" XXX + +BO_ 1043 TIME : 8 CGW + SG_ YEAR : 7|8@0+ (1,0) [0|0] "year" XXX + SG_ MONTH : 15|8@0+ (1,0) [0|0] "month" XXX + SG_ DAY : 23|8@0+ (1,0) [0|0] "day" XXX + SG_ HOUR : 31|8@0+ (1,0) [0|0] "hour" XXX + SG_ MINUTE : 39|8@0+ (1,0) [0|0] "minute" XXX + SG_ GMT_DIFF : 55|1@0+ (1,0) [0|0] "" XXX + SG_ GMTDIFF_HOURS : 54|4@0+ (1,0) [0|0] "hours" XXX + SG_ GMTDIFF_MINUTES : 50|6@0+ (1,0) [0|0] "minutes" XXX + SG_ SUMMER : 60|1@0+ (1,0) [0|0] "" XXX + +BO_ 1083 AUTOPARK_STATUS: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + +BO_ 1161 RSA1: 8 FCM + SG_ TSGN1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY1 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT1 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL1 : 23|8@0+ (1,0) [0|0] "km/h" XXX + SG_ SPLSGN1 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN2 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN2 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY2 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT2 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL2 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_P : 63|2@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_A : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID1 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1162 RSA2: 8 FCM + SG_ TSGN3 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY3 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT3 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN3 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN4 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN4 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY4 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT4 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ DPSGNREQ : 54|1@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMP : 53|3@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMA : 50|3@0+ (1,0) [0|0] "" XXX + SG_ SPDUNT : 63|2@0+ (1,0) [0|0] "" XXX + SG_ TSRWMSG : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID2 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1163 RSA3: 8 FCM + SG_ TSREQPD : 7|1@0+ (1,0) [0|0] "" XXX + SG_ TSRMSW : 6|1@0+ (1,0) [0|0] "" XXX + SG_ OTSGNNTM : 5|2@0+ (1,0) [0|0] "" XXX + SG_ NTLVLSPD : 3|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPNTM : 1|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPVALL : 11|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALM : 19|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALH : 27|4@0+ (1,-5) [0|0] "" XXX + SG_ TSRSPU : 33|2@0+ (1,0) [0|0] "" XXX + +BO_ 1408 VIN_PART_1: 8 CGW + SG_ VIN_1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_2 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_3 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_4 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_5 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_6 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_7 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_8 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1409 VIN_PART_2: 8 CGW + SG_ VIN_9 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_10 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_11 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_12 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_13 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_14 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_15 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_16 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1410 VIN_PART_3: 8 CGW + SG_ VIN_17 : 7|8@0+ (1,0) [0|0] "" XXX + +BO_ 1552 BODY_CONTROL_STATE_2: 8 XXX + SG_ METER_SLIDER_BRIGHTNESS_PCT : 30|7@0+ (1,0) [12|100] "%" XXX + SG_ METER_SLIDER_LOW_BRIGHTNESS : 37|1@0+ (1,0) [0|1] "" XXX + SG_ METER_SLIDER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX + +BO_ 1553 UI_SETTING: 8 XXX + SG_ UNITS : 26|2@0+ (1,0) [0|3] "" XXX + SG_ ODOMETER : 43|20@0+ (1,0) [0|1048575] "" XXX + +BO_ 1556 BLINKERS_STATE: 8 XXX + SG_ TURN_SIGNALS : 29|2@0+ (1,0) [0|3] "" XXX + SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX + +BO_ 1568 BODY_CONTROL_STATE: 8 XXX + SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX + SG_ PARKING_BRAKE : 60|1@0+ (1,0) [0|1] "" XXX + SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 43|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FR : 44|1@0+ (1,0) [0|1] "" XXX + +BO_ 1570 LIGHT_STALK: 8 SCM + SG_ AUTO_HIGH_BEAM : 37|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_FOG : 27|1@0+ (1,0) [0|1] "" XXX + SG_ PARKING_LIGHT : 28|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_BEAM : 29|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAM : 30|1@0+ (1,0) [0|1] "" XXX + SG_ DAYTIME_RUNNING_LIGHT : 31|1@0+ (1,0) [0|1] "" XXX + +BO_ 1571 CERTIFICATION_ECU: 8 CGW + SG_ DOOR_LOCK_FEEDBACK_LIGHT : 15|1@0+ (1,0) [0|0] "" XXX + SG_ KEYFOB_LOCKING_FEEDBACK_LIGHT : 61|1@0+ (1,0) [0|0] "" XXX + SG_ KEYFOB_UNLOCKING_FEEDBACK_LIGHT : 62|1@0+ (1,0) [0|0] "" XXX + +BO_ 1592 DOOR_LOCKS: 8 XXX + SG_ LOCK_STATUS_CHANGED : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LOCK_STATUS : 20|1@0+ (1,0) [0|1] "" XXX + SG_ LOCKED_VIA_KEYFOB : 23|1@0+ (1,0) [0|1] "" XXX + +CM_ SG_ 36 YAW_RATE "verify"; +CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd"; +CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set"; +CM_ SG_ 37 STEER_RATE "factor is tbd"; +CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors"; +CM_ SG_ 466 CRUISE_STATE "Active state is 8, if standstill is requested will switch to state 11(3 sec timer), after timer is elapsed will switch into state 7(standstill). If plus button was pressed - status 9, minus button pressed - status 10"; +CM_ SG_ 467 SET_SPEED "43 km/h are shown as 28 mph, so conversion isn't perfect"; +CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph"; +CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?"; +CM_ SG_ 581 GAS_PEDAL "it seems slightly filtered"; +CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque"; +CM_ SG_ 608 STEER_OVERRIDE "set when driver torque exceeds a certain value"; +CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active"; +CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking"; +CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok"; +CM_ SG_ 835 RADAR_DIRTY "Display Clean Radar Sensor message on HUD"; +CM_ SG_ 835 ACC_MALFUNCTION "display ACC fault on dash if set to 1"; +CM_ SG_ 835 ACC_CUT_IN "Display blinking yellow lead if set to 1"; +CM_ SG_ 835 DISTANCE "Display Distance Bars on HUD Permanently"; +CM_ SG_ 835 ITS_CONNECT_LEAD "Displayed when lead car is capable of ITS Connect"; +CM_ SG_ 835 ALLOW_LONG_PRESS "Enable Toyota's factory set speed increment behaviour, available on both metrics cars and imperial unit cars"; +CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG."; +CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file."; +CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit"; +CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel"; +CM_ SG_ 1009 SET_SPEED "units seem to be whatever the car is set to"; +CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator"; +CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity"; +CM_ SG_ 1042 LDA_SA_TOGGLE "LDA Steering Assist Toggle"; +CM_ SG_ 1042 LDW_EXIST "Unclear what this is, it's usually set to 0"; +CM_ SG_ 1042 LDA_SENSITIVITY "LDA Sensitivity"; +CM_ SG_ 1042 LDA_ON_MESSAGE "Display LDA Turned ON message"; +CM_ SG_ 1042 REPEATED_BEEPS "LDA audible warning"; +CM_ SG_ 1042 LDA_UNAVAILABLE_QUIET "LDA toggles and sensitivity settings are greyed out if set to 1"; +CM_ SG_ 1042 LDA_SPEED_TOO_LOW "length is 3 bits in the leaked DBC, displays LDA unavailable below approx 50 km/h if set to 1"; +CM_ SG_ 1042 LDA_FRONT_CAMERA_BLOCKED "originally LDAFCVB, LDA related settings are greyed out if set to 1"; +CM_ SG_ 1042 TAKE_CONTROL "Please Control Steering Wheel warning"; +CM_ SG_ 1042 LANE_SWAY_TOGGLE "Lane Sway Warning System SWS Switch"; +CM_ SG_ 1042 LANE_SWAY_WARNING "Lane Sway Warning System Triggered"; +CM_ SG_ 1042 LANE_SWAY_FLD "Unknown signal for Lane Sway Warning System, set to 7 on stock system when SWS is enabled, 0 when SWS is disabled"; +CM_ SG_ 1042 LANE_SWAY_BUZZER "Similar to TWO_BEEPS"; +CM_ SG_ 1042 SET_ME_X01 "empty bit on leaked dbc, always set to 1 during normal operations"; +CM_ SG_ 1042 SET_ME_X02 "empty bit on leaked dbc, always set to 2 during normal operations"; +CM_ SG_ 1083 STATE "when the dashboard button is pressed, the value changes from zero to non-zero"; +CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit."; +CM_ SG_ 1161 SYNCID1 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1161 SPDVAL2 "conditional speed value 70"; +CM_ SG_ 1162 SGNNUMP "1 if SPDVAL1 is set, otherwise 0"; +CM_ SG_ 1162 SYNCID2 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1163 TSREQPD "always 1"; +CM_ SG_ 1163 TSRMSW "always 1"; +CM_ SG_ 1163 OTSGNNTM "always 3"; +CM_ SG_ 1163 NTLVLSPD "always 3"; +CM_ SG_ 1163 OVSPNTM "always 3"; +CM_ SG_ 1163 OVSPVALL "-5 at start then 2 after 2 seconds"; +CM_ SG_ 1163 OVSPVALM "-5 at start then 5 after 2 seconds"; +CM_ SG_ 1163 OVSPVALH "-5 at start then 10 after 2 seconds"; +CM_ SG_ 1163 TSRSPU "always 1"; +CM_ SG_ 1552 METER_SLIDER_BRIGHTNESS_PCT "Combination display brightness setting, scales from 12 per cent to 100 per cent, reflects combination meter settings only, not linked with headlight state"; +CM_ SG_ 1552 METER_SLIDER_LOW_BRIGHTNESS "Combination display low brightness mode, also controls footwell lighting"; +CM_ SG_ 1552 METER_SLIDER_DIMMED "Combination display slider not at max, reflects combination meter settings only, not linked with headlight state"; +CM_ SG_ 1553 ODOMETER "Unit is dependent upon units signal"; +CM_ SG_ 1592 LOCK_STATUS_CHANGED "1 on rising edge of lock/unlocking"; +CM_ SG_ 1592 LOCK_STATUS "The next 3 bits always seem to follow this signal."; +CM_ SG_ 1592 LOCKED_VIA_KEYFOB "1 for as long as car is locked with key fob or door handle touch"; + +VAL_ 295 GEAR 0 "P" 1 "R" 2 "N" 3 "D" 4 "B"; +VAL_ 466 CRUISE_STATE 11 "timer_3sec" 10 "adaptive click down" 9 "adaptive click up" 8 "adaptive engaged" 7 "standstill" 6 "non-adaptive click up" 5 "non-adaptive click down" 4 "non-adaptive hold down" 3 "non-adaptive hold up" 2 "non-adaptive being engaged" 1 "non-adaptive engaged" 0 "off"; +VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok"; +VAL_ 614 STATE 3 "enabled" 1 "disabled"; +VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left"; +VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking"; +VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok"; +VAL_ 835 ACC_MALFUNCTION 1 "faulted" 0 "ok"; +VAL_ 835 ACC_CUT_IN 1 "CUT-IN Detected" 0 "clear"; +VAL_ 835 ALLOW_LONG_PRESS 2 "set speed increase by 5 speed units regardless" 1 "set speed increase by 1 speed unit on short press, 5 speed units on long press"; +VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted"; +VAL_ 956 SPORT_ON 0 "off" 1 "on"; +VAL_ 956 GEAR 0 "D" 1 "S" 8 "N" 16 "R" 32 "P"; +VAL_ 956 SPORT_GEAR_ON 0 "off" 1 "on"; +VAL_ 956 SPORT_GEAR 1 "S1" 2 "S2" 3 "S3" 4 "S4" 5 "S5" 6 "S6"; +VAL_ 956 ECON_ON 0 "off" 1 "on"; +VAL_ 956 B_GEAR_ENGAGED 0 "off" 1 "on"; +VAL_ 956 DRIVE_ENGAGED 0 "off" 1 "on"; +VAL_ 1005 REVERSE_CAMERA_GUIDELINES 3 "No guidelines" 2 "Static guidelines" 1 "Active guidelines"; +VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled"; +VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off"; +VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none"; +VAL_ 1042 BARRIERS 3 "left" 2 "right" 1 "both" 0 "none"; +VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1042 LKAS_STATUS 1 "on" 0 "off"; +VAL_ 1042 LEFT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1042 LDA_ON_MESSAGE 2 "Lane Departure Alert Turned ON, Steering Assist Inactive" 1 "Lane Departure Alert Turned ON, Steering Assist Active" 0 "clear"; +VAL_ 1042 LDA_SA_TOGGLE 2 "steering assist off" 1 "steering assist on"; +VAL_ 1042 LDA_SENSITIVITY 2 "standard" 1 "high" 0 "undefined"; +VAL_ 1042 LDA_SPEED_TOO_LOW 1 "lda unavailable, speed too low" 0 "ok"; +VAL_ 1042 LDA_FRONT_CAMERA_BLOCKED 1 "lda unavailable" 0 "ok"; +VAL_ 1042 TAKE_CONTROL 1 "take control" 0 "ok"; +VAL_ 1042 LANE_SWAY_WARNING 3 "ok" 2 "orange please take a break" 1 "prompt would you like to take a break" 0 "ok"; +VAL_ 1042 LANE_SWAY_BUZZER 3 "ok" 2 "beep twice" 1 "beep twice" 0 "ok"; +VAL_ 1161 TSGN1 1 "speed sign" 0 "none"; +VAL_ 1161 TSGN2 1 "speed sign" 0 "none"; +VAL_ 1161 SPLSGN2 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; +VAL_ 1162 TSGN3 0 "none" 1 "speed sign" 2 "0 unlimited" 7 "unlimited" 16 "highway" 17 "no highway" 18 "motorway" 19 "no motorway" 20 "in city" 21 "outside city" 22 "pedestrian area" 23 "no pedestrian area" 65 "no overtaking left" 66 "no overtaking right" 67 "overtaking allowed again" 81 "no right turn" 97 "stop" 105 "yield" 113 "stop" 114 "yield us" 129 "no entry" 138 "no entry tss2" 145 "do not enter"; +VAL_ 1162 SPLSGN3 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; +VAL_ 1552 METER_SLIDER_LOW_BRIGHTNESS 1 "Low brightness mode, footwell lights off" 0 "Normal mode, footwell lights on"; +VAL_ 1552 METER_SLIDER_DIMMED 1 "Dimmed" 0 "Not Dimmed"; +VAL_ 1553 UNITS 1 "km" 2 "miles"; +VAL_ 1556 TURN_SIGNALS 3 "none" 2 "right" 1 "left"; +VAL_ 1592 LOCK_STATUS 0 "locked" 1 "unlocked"; + +CM_ "toyota_new_mc_pt.dbc starts here"; + +BO_ 548 BRAKE_MODULE: 8 XXX + SG_ BRAKE_PRESSURE : 43|12@0+ (1,0) [0|4047] "" XXX + SG_ BRAKE_PRESSED : 5|1@0+ (1,0) [0|1] "" XXX + +BO_ 610 EPS_STATUS: 5 EPS + SG_ IPAS_STATE : 3|4@0+ (1,0) [0|15] "" XXX + SG_ LKA_STATE : 31|7@0+ (1,0) [0|127] "" XXX + SG_ TYPE : 24|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +CM_ SG_ 548 BRAKE_PRESSURE "seems prop to pedal force"; +CM_ SG_ 548 BRAKE_POSITION "seems proportional to pedal displacement, unclear the max value of 0x1c8"; +CM_ SG_ 610 TYPE "seems 1 on Corolla, 0 on all others"; + +VAL_ 610 IPAS_STATE 5 "override" 3 "enabled" 1 "disabled"; +VAL_ 610 LKA_STATE 25 "temporary_fault" 9 "temporary_fault2" 5 "active" 1 "standby"; diff --git a/opendbc/toyota_nodsu_pt_generated.dbc b/opendbc/toyota_nodsu_pt_generated.dbc new file mode 100644 index 000000000..803f60b54 --- /dev/null +++ b/opendbc/toyota_nodsu_pt_generated.dbc @@ -0,0 +1,596 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 359 STEERING_IPAS_COMMA: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +CM_ "BO_ STEERING_IPAS_COMMA: Copy of msg 614 so we can do angle control while the Park Assist ECU is connected (Panda spoofs 614 with 359 on connector J70). Note that addresses 0x266 and 0x167 are checksum-invariant"; + +BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.159375,-75.555) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.159375,-151.111) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + +BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.159375,-75.555) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.159375,-151.111) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + +VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + +BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX + SG_ ZORRO_STEER : 7|24@0- (0.004901594652,0) [-500|500] "" XXX + +CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss"; + +BO_ 241 ACC_CONTROL_ALT: 8 EON + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU + SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + +BO_ 242 PRECOLLISION_2_ALT: 8 EON + SG_ DECELERATION : 7|10@0- (0.1,0) [0|0] "m/s^2" Vector__XXX + SG_ DS1STAT2 : 13|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ DS1STBK2 : 10|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSWAR : 18|1@0+ (1,0) [0|0] "" FCM + SG_ PCSALM : 17|1@0+ (1,0) [0|0] "" FCM + SG_ PCSOPR : 16|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSABK : 31|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBATRGR : 30|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PPTRGR : 28|1@0+ (1,0) [0|0] "" FCM + SG_ IBTRGR : 27|1@0+ (1,0) [0|0] "" FCM + SG_ CLEXTRGR : 26|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ IRLT_REQ : 25|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ BRKHLD : 37|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ AVSTRGR : 36|1@0+ (1,0) [0|0] "" SCS + SG_ VGRSTRGR : 35|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PREFILL : 33|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBRTRGR : 32|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSDIS : 43|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBPREPMP : 40|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" FCM +BO_ 767 SDSU: 8 XXX + SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX + +CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu"; +CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu"; + + +CM_ "Imported file _toyota_2017.dbc starts here"; +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX DSU HCU EPS IPAS CGW BGM + +BO_ 36 KINEMATICS: 8 XXX + SG_ ACCEL_Y : 33|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX + SG_ YAW_RATE : 1|10@0+ (0.244,-125) [0|65535] "deg/s" XXX + SG_ STEERING_TORQUE : 17|10@0+ (1,-512) [0|65535] "" XXX + +BO_ 37 STEER_ANGLE_SENSOR: 8 XXX + SG_ STEER_ANGLE : 3|12@0- (1.5,0) [-500|500] "deg" XXX + SG_ STEER_FRACTION : 39|4@0- (0.1,0) [-0.7|0.7] "deg" XXX + SG_ STEER_RATE : 35|12@0- (1,0) [-2000|2000] "deg/s" XXX + +BO_ 166 BRAKE: 8 XXX + SG_ BRAKE_AMOUNT : 7|8@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_PEDAL : 23|8@0+ (1,0) [0|255] "" XXX + +BO_ 170 WHEEL_SPEEDS: 8 XXX + SG_ WHEEL_SPEED_FR : 7|16@0+ (0.01,-67.67) [0|250] "km/h" XXX + SG_ WHEEL_SPEED_FL : 23|16@0+ (0.01,-67.67) [0|250] "km/h" XXX + SG_ WHEEL_SPEED_RR : 39|16@0+ (0.01,-67.67) [0|250] "km/h" XXX + SG_ WHEEL_SPEED_RL : 55|16@0+ (0.01,-67.67) [0|250] "km/h" XXX + +BO_ 180 SPEED: 8 XXX + SG_ ENCODER : 39|8@0+ (1,0) [0|255] "" XXX + SG_ SPEED : 47|16@0+ (0.01,0) [0|250] "km/h" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 295 GEAR_PACKET_HYBRID: 8 XXX + SG_ CAR_MOVEMENT : 39|8@0- (1,0) [0|255] "" XXX + SG_ COUNTER : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ GEAR : 47|4@0+ (1,0) [0|15] "" XXX + +BO_ 353 DSU_SPEED: 7 XXX + SG_ FORWARD_SPEED : 15|16@0- (0.00390625,-30) [0|255] "km/h" XXX + +BO_ 452 ENGINE_RPM: 8 CGW + SG_ RPM : 7|16@0- (0.78125,0) [0|0] "rpm" SCS + +BO_ 466 PCM_CRUISE: 8 XXX + SG_ GAS_RELEASED : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_ACTIVE : 5|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL_ON : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ACCEL_NET : 23|16@0- (0.001,0) [-20|20] "m/s^2" XXX + SG_ CRUISE_STATE : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CANCEL_REQ : 49|1@1+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 467 PCM_CRUISE_2: 8 XXX + SG_ MAIN_ON : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_SPEED_LOCKOUT : 14|2@0+ (1,0) [0|3] "" XXX + SG_ SET_SPEED : 23|8@0+ (1,0) [0|255] "km/h" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 552 ACCELEROMETER: 8 XXX + SG_ ACCEL_Z : 22|15@0- (1,0) [0|32767] "m/s^2" XXX + SG_ ACCEL_X : 6|15@0- (0.001,0) [-20|20] "m/s^2" XXX + +BO_ 560 BRAKE_2: 7 XXX + SG_ BRAKE_PRESSED : 26|1@0+ (1,0) [0|1] "" XXX + +BO_ 581 GAS_PEDAL_HYBRID: 8 XXX + SG_ GAS_PEDAL : 23|8@0+ (0.005,0) [0|1] "" XXX + +BO_ 608 STEER_TORQUE_SENSOR: 8 XXX + SG_ STEER_TORQUE_EPS : 47|16@0- (1,0) [-32768|32767] "" XXX + SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX + SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_ANGLE : 31|16@0- (0.0573,0) [-500|500] "" XXX + +BO_ 614 STEERING_IPAS: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 643 PRE_COLLISION: 7 DSU + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ FORCE : 23|16@0- (2,0) [0|255] "N" XXX + SG_ SET_ME_X002 : 33|8@0+ (1,0) [0|3] "" XXX + SG_ BRAKE_STATUS : 39|3@0+ (1,0) [0|255] "" XXX + SG_ STATE : 36|3@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X003 : 40|1@0+ (1,0) [0|1] "" XXX + SG_ PRECOLLISION_ACTIVE : 41|1@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 55|8@0+ (1,0) [0|255] "" XXX + +BO_ 705 GAS_PEDAL: 8 XXX + SG_ GAS_RELEASED : 3|1@0+ (1,0) [0|1] "" XXX + SG_ GAS_PEDAL : 55|8@0+ (0.005,0) [0|1] "" XXX + +BO_ 740 STEERING_LKA: 5 XXX + SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 6|6@0+ (1,0) [0|63] "" XXX + SG_ SET_ME_1 : 7|1@0+ (1,0) [0|1] "" XXX + SG_ STEER_TORQUE_CMD : 15|16@0- (1,0) [0|65535] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 742 LEAD_INFO: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" HCU + SG_ LEAD_REL_SPEED : 23|12@0- (0.025,0) [-100|100] "m/s" HCU + SG_ LEAD_LONG_DIST : 7|13@0+ (0.05,0) [0|300] "m" HCU + +BO_ 835 ACC_CONTROL: 8 DSU + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s^2" HCU + SG_ ACC_MALFUNCTION : 18|1@0+ (1,0) [0|0] "" XXX + SG_ ACC_CUT_IN : 25|1@0+ (1,0) [0|1] "" XXX + SG_ ALLOW_LONG_PRESS : 17|2@0+ (1,0) [0|2] "" XXX + SG_ ITS_CONNECT_LEAD : 39|8@0+ (1,0) [0|1] "" Vector__XXX + SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + SG_ RADAR_DIRTY : 19|1@0+ (1,0) [0|1] "" XXX + +BO_ 836 PRE_COLLISION_2: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 869 DSU_CRUISE : 7 DSU + SG_ RES_BTN : 3|1@0+ (1,0) [0|0] "" XXX + SG_ SET_BTN : 2|1@0+ (1,0) [0|0] "" XXX + SG_ CANCEL_BTN : 1|1@0+ (1,0) [0|0] "" XXX + SG_ MAIN_ON : 0|1@0+ (1,0) [0|0] "" XXX + SG_ SET_SPEED : 15|8@0+ (1,0) [0|0] "km/h" XXX + SG_ CRUISE_REQUEST : 31|8@0+ (100,-12800) [0|0] "N" XXX + SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|0] "m" XXX + +BO_ 921 PCM_CRUISE_SM: 8 XXX + SG_ MAIN_ON : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_CONTROL_STATE : 11|4@0+ (1,0) [0|15] "" XXX + SG_ DISTANCE_LINES : 14|2@0+ (1,0) [0|3] "" XXX + SG_ UI_SET_SPEED : 31|8@0+ (1,0) [0|255] "" XXX + +BO_ 951 ESP_CONTROL: 8 ESP + SG_ TC_DISABLED : 13|1@0+ (1,0) [0|1] "" XXX + SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ENABLED : 33|1@1+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 36|1@0+ (1,0) [0|1] "" XXX + +BO_ 956 GEAR_PACKET: 8 XXX + SG_ SPORT_ON : 2|1@0+ (1,0) [0|1] "" XXX + SG_ GEAR : 13|6@0+ (1,0) [0|63] "" XXX + SG_ SPORT_GEAR_ON : 33|1@0+ (1,0) [0|1] "" XXX + SG_ SPORT_GEAR : 38|3@0+ (1,0) [0|7] "" XXX + SG_ ECON_ON : 40|1@0+ (1,0) [0|1] "" XXX + SG_ B_GEAR_ENGAGED : 41|1@0+ (1,0) [0|1] "" XXX + SG_ DRIVE_ENGAGED : 47|1@0+ (1,0) [0|1] "" XXX + +BO_ 1005 REVERSE_CAMERA_STATE: 2 BGM + SG_ REVERSE_CAMERA_GUIDELINES : 9|2@0+ (1,0) [1|3] "" XXX + +BO_ 1009 PCM_CRUISE_ALT: 8 XXX + SG_ MAIN_ON : 13|1@0+ (1,0) [0|3] "" XXX + SG_ CRUISE_STATE : 10|1@0+ (1,0) [0|1] "" XXX + SG_ SET_SPEED : 23|8@0+ (1,0) [0|255] "mph" XXX + +BO_ 1020 SOLAR_SENSOR: 8 XXX + SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX + +BO_ 1041 ACC_HUD: 8 DSU + SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX + SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX + SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX + SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX + +BO_ 1042 LKAS_HUD: 8 DSU + SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX + SG_ RIGHT_LINE : 3|2@0+ (1,0) [0|3] "" XXX + SG_ LEFT_LINE : 5|2@0+ (1,0) [0|3] "" XXX + SG_ LKAS_STATUS : 7|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_ALERT : 9|2@0+ (1,0) [0|3] "" XXX + SG_ LDW_EXIST : 10|1@0+ (1,0) [0|1] "" XXX + SG_ TWO_BEEPS : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ADJUSTING_CAMERA : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_UNAVAILABLE_QUIET : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_MALFUNCTION : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_UNAVAILABLE : 16|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_SENSITIVITY : 18|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_SA_TOGGLE : 20|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_SPEED_TOO_LOW : 21|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_ON_MESSAGE : 31|2@0+ (1,0) [0|3] "" XXX + SG_ REPEATED_BEEPS : 32|1@0+ (1,0) [0|1] "" XXX + SG_ LANE_SWAY_TOGGLE : 43|1@0+ (1,0) [0|1] "" XXX + SG_ LANE_SWAY_SENSITIVITY : 45|2@0+ (1,0) [0|3] "" XXX + SG_ TAKE_CONTROL : 46|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_FRONT_CAMERA_BLOCKED : 47|1@0+ (1,0) [0|1] "" XXX + SG_ LANE_SWAY_BUZZER : 50|2@0+ (1,0) [0|0] "" XXX + SG_ LANE_SWAY_FLD : 53|3@0+ (1,0) [0|7] "" XXX + SG_ LANE_SWAY_WARNING : 55|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X01 : 42|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X02 : 63|8@0+ (1,0) [0|1] "" XXX + +BO_ 1043 TIME : 8 CGW + SG_ YEAR : 7|8@0+ (1,0) [0|0] "year" XXX + SG_ MONTH : 15|8@0+ (1,0) [0|0] "month" XXX + SG_ DAY : 23|8@0+ (1,0) [0|0] "day" XXX + SG_ HOUR : 31|8@0+ (1,0) [0|0] "hour" XXX + SG_ MINUTE : 39|8@0+ (1,0) [0|0] "minute" XXX + SG_ GMT_DIFF : 55|1@0+ (1,0) [0|0] "" XXX + SG_ GMTDIFF_HOURS : 54|4@0+ (1,0) [0|0] "hours" XXX + SG_ GMTDIFF_MINUTES : 50|6@0+ (1,0) [0|0] "minutes" XXX + SG_ SUMMER : 60|1@0+ (1,0) [0|0] "" XXX + +BO_ 1083 AUTOPARK_STATUS: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + +BO_ 1161 RSA1: 8 FCM + SG_ TSGN1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY1 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT1 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL1 : 23|8@0+ (1,0) [0|0] "km/h" XXX + SG_ SPLSGN1 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN2 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN2 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY2 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT2 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL2 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_P : 63|2@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_A : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID1 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1162 RSA2: 8 FCM + SG_ TSGN3 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY3 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT3 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN3 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN4 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN4 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY4 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT4 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ DPSGNREQ : 54|1@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMP : 53|3@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMA : 50|3@0+ (1,0) [0|0] "" XXX + SG_ SPDUNT : 63|2@0+ (1,0) [0|0] "" XXX + SG_ TSRWMSG : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID2 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1163 RSA3: 8 FCM + SG_ TSREQPD : 7|1@0+ (1,0) [0|0] "" XXX + SG_ TSRMSW : 6|1@0+ (1,0) [0|0] "" XXX + SG_ OTSGNNTM : 5|2@0+ (1,0) [0|0] "" XXX + SG_ NTLVLSPD : 3|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPNTM : 1|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPVALL : 11|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALM : 19|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALH : 27|4@0+ (1,-5) [0|0] "" XXX + SG_ TSRSPU : 33|2@0+ (1,0) [0|0] "" XXX + +BO_ 1408 VIN_PART_1: 8 CGW + SG_ VIN_1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_2 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_3 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_4 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_5 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_6 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_7 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_8 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1409 VIN_PART_2: 8 CGW + SG_ VIN_9 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_10 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_11 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_12 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_13 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_14 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_15 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_16 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1410 VIN_PART_3: 8 CGW + SG_ VIN_17 : 7|8@0+ (1,0) [0|0] "" XXX + +BO_ 1552 BODY_CONTROL_STATE_2: 8 XXX + SG_ METER_SLIDER_BRIGHTNESS_PCT : 30|7@0+ (1,0) [12|100] "%" XXX + SG_ METER_SLIDER_LOW_BRIGHTNESS : 37|1@0+ (1,0) [0|1] "" XXX + SG_ METER_SLIDER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX + +BO_ 1553 UI_SETTING: 8 XXX + SG_ UNITS : 26|2@0+ (1,0) [0|3] "" XXX + SG_ ODOMETER : 43|20@0+ (1,0) [0|1048575] "" XXX + +BO_ 1556 BLINKERS_STATE: 8 XXX + SG_ TURN_SIGNALS : 29|2@0+ (1,0) [0|3] "" XXX + SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX + +BO_ 1568 BODY_CONTROL_STATE: 8 XXX + SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX + SG_ PARKING_BRAKE : 60|1@0+ (1,0) [0|1] "" XXX + SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 43|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FR : 44|1@0+ (1,0) [0|1] "" XXX + +BO_ 1570 LIGHT_STALK: 8 SCM + SG_ AUTO_HIGH_BEAM : 37|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_FOG : 27|1@0+ (1,0) [0|1] "" XXX + SG_ PARKING_LIGHT : 28|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_BEAM : 29|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAM : 30|1@0+ (1,0) [0|1] "" XXX + SG_ DAYTIME_RUNNING_LIGHT : 31|1@0+ (1,0) [0|1] "" XXX + +BO_ 1571 CERTIFICATION_ECU: 8 CGW + SG_ DOOR_LOCK_FEEDBACK_LIGHT : 15|1@0+ (1,0) [0|0] "" XXX + SG_ KEYFOB_LOCKING_FEEDBACK_LIGHT : 61|1@0+ (1,0) [0|0] "" XXX + SG_ KEYFOB_UNLOCKING_FEEDBACK_LIGHT : 62|1@0+ (1,0) [0|0] "" XXX + +BO_ 1592 DOOR_LOCKS: 8 XXX + SG_ LOCK_STATUS_CHANGED : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LOCK_STATUS : 20|1@0+ (1,0) [0|1] "" XXX + SG_ LOCKED_VIA_KEYFOB : 23|1@0+ (1,0) [0|1] "" XXX + +CM_ SG_ 36 YAW_RATE "verify"; +CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd"; +CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set"; +CM_ SG_ 37 STEER_RATE "factor is tbd"; +CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors"; +CM_ SG_ 466 CRUISE_STATE "Active state is 8, if standstill is requested will switch to state 11(3 sec timer), after timer is elapsed will switch into state 7(standstill). If plus button was pressed - status 9, minus button pressed - status 10"; +CM_ SG_ 467 SET_SPEED "43 km/h are shown as 28 mph, so conversion isn't perfect"; +CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph"; +CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?"; +CM_ SG_ 581 GAS_PEDAL "it seems slightly filtered"; +CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque"; +CM_ SG_ 608 STEER_OVERRIDE "set when driver torque exceeds a certain value"; +CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active"; +CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking"; +CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok"; +CM_ SG_ 835 RADAR_DIRTY "Display Clean Radar Sensor message on HUD"; +CM_ SG_ 835 ACC_MALFUNCTION "display ACC fault on dash if set to 1"; +CM_ SG_ 835 ACC_CUT_IN "Display blinking yellow lead if set to 1"; +CM_ SG_ 835 DISTANCE "Display Distance Bars on HUD Permanently"; +CM_ SG_ 835 ITS_CONNECT_LEAD "Displayed when lead car is capable of ITS Connect"; +CM_ SG_ 835 ALLOW_LONG_PRESS "Enable Toyota's factory set speed increment behaviour, available on both metrics cars and imperial unit cars"; +CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG."; +CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file."; +CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit"; +CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel"; +CM_ SG_ 1009 SET_SPEED "units seem to be whatever the car is set to"; +CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator"; +CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity"; +CM_ SG_ 1042 LDA_SA_TOGGLE "LDA Steering Assist Toggle"; +CM_ SG_ 1042 LDW_EXIST "Unclear what this is, it's usually set to 0"; +CM_ SG_ 1042 LDA_SENSITIVITY "LDA Sensitivity"; +CM_ SG_ 1042 LDA_ON_MESSAGE "Display LDA Turned ON message"; +CM_ SG_ 1042 REPEATED_BEEPS "LDA audible warning"; +CM_ SG_ 1042 LDA_UNAVAILABLE_QUIET "LDA toggles and sensitivity settings are greyed out if set to 1"; +CM_ SG_ 1042 LDA_SPEED_TOO_LOW "length is 3 bits in the leaked DBC, displays LDA unavailable below approx 50 km/h if set to 1"; +CM_ SG_ 1042 LDA_FRONT_CAMERA_BLOCKED "originally LDAFCVB, LDA related settings are greyed out if set to 1"; +CM_ SG_ 1042 TAKE_CONTROL "Please Control Steering Wheel warning"; +CM_ SG_ 1042 LANE_SWAY_TOGGLE "Lane Sway Warning System SWS Switch"; +CM_ SG_ 1042 LANE_SWAY_WARNING "Lane Sway Warning System Triggered"; +CM_ SG_ 1042 LANE_SWAY_FLD "Unknown signal for Lane Sway Warning System, set to 7 on stock system when SWS is enabled, 0 when SWS is disabled"; +CM_ SG_ 1042 LANE_SWAY_BUZZER "Similar to TWO_BEEPS"; +CM_ SG_ 1042 SET_ME_X01 "empty bit on leaked dbc, always set to 1 during normal operations"; +CM_ SG_ 1042 SET_ME_X02 "empty bit on leaked dbc, always set to 2 during normal operations"; +CM_ SG_ 1083 STATE "when the dashboard button is pressed, the value changes from zero to non-zero"; +CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit."; +CM_ SG_ 1161 SYNCID1 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1161 SPDVAL2 "conditional speed value 70"; +CM_ SG_ 1162 SGNNUMP "1 if SPDVAL1 is set, otherwise 0"; +CM_ SG_ 1162 SYNCID2 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1163 TSREQPD "always 1"; +CM_ SG_ 1163 TSRMSW "always 1"; +CM_ SG_ 1163 OTSGNNTM "always 3"; +CM_ SG_ 1163 NTLVLSPD "always 3"; +CM_ SG_ 1163 OVSPNTM "always 3"; +CM_ SG_ 1163 OVSPVALL "-5 at start then 2 after 2 seconds"; +CM_ SG_ 1163 OVSPVALM "-5 at start then 5 after 2 seconds"; +CM_ SG_ 1163 OVSPVALH "-5 at start then 10 after 2 seconds"; +CM_ SG_ 1163 TSRSPU "always 1"; +CM_ SG_ 1552 METER_SLIDER_BRIGHTNESS_PCT "Combination display brightness setting, scales from 12 per cent to 100 per cent, reflects combination meter settings only, not linked with headlight state"; +CM_ SG_ 1552 METER_SLIDER_LOW_BRIGHTNESS "Combination display low brightness mode, also controls footwell lighting"; +CM_ SG_ 1552 METER_SLIDER_DIMMED "Combination display slider not at max, reflects combination meter settings only, not linked with headlight state"; +CM_ SG_ 1553 ODOMETER "Unit is dependent upon units signal"; +CM_ SG_ 1592 LOCK_STATUS_CHANGED "1 on rising edge of lock/unlocking"; +CM_ SG_ 1592 LOCK_STATUS "The next 3 bits always seem to follow this signal."; +CM_ SG_ 1592 LOCKED_VIA_KEYFOB "1 for as long as car is locked with key fob or door handle touch"; + +VAL_ 295 GEAR 0 "P" 1 "R" 2 "N" 3 "D" 4 "B"; +VAL_ 466 CRUISE_STATE 11 "timer_3sec" 10 "adaptive click down" 9 "adaptive click up" 8 "adaptive engaged" 7 "standstill" 6 "non-adaptive click up" 5 "non-adaptive click down" 4 "non-adaptive hold down" 3 "non-adaptive hold up" 2 "non-adaptive being engaged" 1 "non-adaptive engaged" 0 "off"; +VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok"; +VAL_ 614 STATE 3 "enabled" 1 "disabled"; +VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left"; +VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking"; +VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok"; +VAL_ 835 ACC_MALFUNCTION 1 "faulted" 0 "ok"; +VAL_ 835 ACC_CUT_IN 1 "CUT-IN Detected" 0 "clear"; +VAL_ 835 ALLOW_LONG_PRESS 2 "set speed increase by 5 speed units regardless" 1 "set speed increase by 1 speed unit on short press, 5 speed units on long press"; +VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted"; +VAL_ 956 SPORT_ON 0 "off" 1 "on"; +VAL_ 956 GEAR 0 "D" 1 "S" 8 "N" 16 "R" 32 "P"; +VAL_ 956 SPORT_GEAR_ON 0 "off" 1 "on"; +VAL_ 956 SPORT_GEAR 1 "S1" 2 "S2" 3 "S3" 4 "S4" 5 "S5" 6 "S6"; +VAL_ 956 ECON_ON 0 "off" 1 "on"; +VAL_ 956 B_GEAR_ENGAGED 0 "off" 1 "on"; +VAL_ 956 DRIVE_ENGAGED 0 "off" 1 "on"; +VAL_ 1005 REVERSE_CAMERA_GUIDELINES 3 "No guidelines" 2 "Static guidelines" 1 "Active guidelines"; +VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled"; +VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off"; +VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none"; +VAL_ 1042 BARRIERS 3 "left" 2 "right" 1 "both" 0 "none"; +VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1042 LKAS_STATUS 1 "on" 0 "off"; +VAL_ 1042 LEFT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1042 LDA_ON_MESSAGE 2 "Lane Departure Alert Turned ON, Steering Assist Inactive" 1 "Lane Departure Alert Turned ON, Steering Assist Active" 0 "clear"; +VAL_ 1042 LDA_SA_TOGGLE 2 "steering assist off" 1 "steering assist on"; +VAL_ 1042 LDA_SENSITIVITY 2 "standard" 1 "high" 0 "undefined"; +VAL_ 1042 LDA_SPEED_TOO_LOW 1 "lda unavailable, speed too low" 0 "ok"; +VAL_ 1042 LDA_FRONT_CAMERA_BLOCKED 1 "lda unavailable" 0 "ok"; +VAL_ 1042 TAKE_CONTROL 1 "take control" 0 "ok"; +VAL_ 1042 LANE_SWAY_WARNING 3 "ok" 2 "orange please take a break" 1 "prompt would you like to take a break" 0 "ok"; +VAL_ 1042 LANE_SWAY_BUZZER 3 "ok" 2 "beep twice" 1 "beep twice" 0 "ok"; +VAL_ 1161 TSGN1 1 "speed sign" 0 "none"; +VAL_ 1161 TSGN2 1 "speed sign" 0 "none"; +VAL_ 1161 SPLSGN2 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; +VAL_ 1162 TSGN3 0 "none" 1 "speed sign" 2 "0 unlimited" 7 "unlimited" 16 "highway" 17 "no highway" 18 "motorway" 19 "no motorway" 20 "in city" 21 "outside city" 22 "pedestrian area" 23 "no pedestrian area" 65 "no overtaking left" 66 "no overtaking right" 67 "overtaking allowed again" 81 "no right turn" 97 "stop" 105 "yield" 113 "stop" 114 "yield us" 129 "no entry" 138 "no entry tss2" 145 "do not enter"; +VAL_ 1162 SPLSGN3 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; +VAL_ 1552 METER_SLIDER_LOW_BRIGHTNESS 1 "Low brightness mode, footwell lights off" 0 "Normal mode, footwell lights on"; +VAL_ 1552 METER_SLIDER_DIMMED 1 "Dimmed" 0 "Not Dimmed"; +VAL_ 1553 UNITS 1 "km" 2 "miles"; +VAL_ 1556 TURN_SIGNALS 3 "none" 2 "right" 1 "left"; +VAL_ 1592 LOCK_STATUS 0 "locked" 1 "unlocked"; + +CM_ "toyota_nodsu_pt.dbc starts here"; + +BO_ 401 STEERING_LTA: 8 XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ SETME_X3 : 29|2@0+ (1,0) [0|3] "" XXX + SG_ PERCENTAGE : 39|8@0+ (1,0) [0|255] "" XXX + SG_ SETME_X64 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ ANGLE : 55|8@0- (0.5,0) [0|255] "" XXX + SG_ STEER_ANGLE_CMD : 15|16@0- (0.0573,0) [-540|540] "" XXX + SG_ STEER_REQUEST : 25|1@0+ (1,0) [0|1] "" XXX + SG_ BIT : 30|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 6|6@0+ (1,0) [0|255] "" XXX + SG_ STEER_REQUEST_2 : 0|1@0+ (1,0) [0|1] "" XXX + SG_ SETME_X1 : 7|1@0+ (1,0) [0|1] "" XXX + +BO_ 550 BRAKE_MODULE: 8 XXX + SG_ BRAKE_PRESSURE : 0|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_POSITION : 16|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_PRESSED : 37|1@0+ (1,0) [0|1] "" XXX + +BO_ 610 EPS_STATUS: 8 EPS + SG_ IPAS_STATE : 3|4@0+ (1,0) [0|15] "" XXX + SG_ LKA_STATE : 31|7@0+ (1,0) [0|127] "" XXX + SG_ TYPE : 24|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 1014 BSM: 8 XXX + SG_ L_ADJACENT : 0|1@0+ (1,0) [0|1] "" XXX + SG_ L_APPROACHING : 8|1@0+ (1,0) [0|1] "" XXX + SG_ R_ADJACENT : 1|1@0+ (1,0) [0|1] "" XXX + SG_ R_APPROACHING : 10|1@0+ (1,0) [0|1] "" XXX + SG_ ADJACENT_ENABLED : 7|1@0+ (1,0) [0|1] "" XXX + SG_ APPROACHING_ENABLED : 15|1@0+ (1,0) [0|1] "" XXX + +CM_ SG_ 550 BRAKE_PRESSURE "seems prop to pedal force"; +CM_ SG_ 550 BRAKE_POSITION "seems proportional to pedal displacement, unclear the max value of 0x1c8"; +CM_ SG_ 610 TYPE "seems 1 on Corolla, 0 on all others"; +CM_ SG_ 1014 L_ADJACENT "vehicle adjacent left side of car. enabled above 10mph, regardless of ADJACENT_ENABLED or APPROACHING_ENABLED"; +CM_ SG_ 1014 L_APPROACHING "vehicle approaching from left side of car. enabled above 10mph, regardless of ADJACENT_ENABLED or APPROACHING_ENABLED"; +CM_ SG_ 1014 R_ADJACENT "vehicle adjacent right side of car. enabled above 10mph, regardless of ADJACENT_ENABLED or APPROACHING_ENABLED"; +CM_ SG_ 1014 R_APPROACHING "vehicle approaching from right side of car. enabled above 10mph, regardless of ADJACENT_ENABLED or APPROACHING_ENABLED"; +CM_ SG_ 1014 ADJACENT_ENABLED "when BSM is enabled in settings, this is on along with APPROACHING_ENABLED. this controls bsm alert visibility"; +CM_ SG_ 1014 APPROACHING_ENABLED "when BSM is enabled in settings, this is on along with ADJACENT_ENABLED. this controls bsm alert visibility"; + +VAL_ 610 IPAS_STATE 5 "override" 3 "enabled" 1 "disabled"; +VAL_ 610 LKA_STATE 25 "temporary_fault" 9 "temporary_fault2" 5 "active" 1 "standby"; diff --git a/opendbc/toyota_prius_2017_pt_generated.dbc b/opendbc/toyota_prius_2017_pt_generated.dbc new file mode 100644 index 000000000..d17df67d3 --- /dev/null +++ b/opendbc/toyota_prius_2017_pt_generated.dbc @@ -0,0 +1,453 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 359 STEERING_IPAS_COMMA: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +CM_ "BO_ STEERING_IPAS_COMMA: Copy of msg 614 so we can do angle control while the Park Assist ECU is connected (Panda spoofs 614 with 359 on connector J70). Note that addresses 0x266 and 0x167 are checksum-invariant"; + + BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.159375,-75.555) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.159375,-151.111) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + + BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.159375,-75.555) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.159375,-151.111) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + + VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + +BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX + SG_ ZORRO_STEER : 7|24@0- (0.004901594652,0) [-500|500] "" XXX + +CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss"; + +BO_ 241 ACC_CONTROL_ALT: 8 EON + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU + SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + +BO_ 242 PRECOLLISION_2_ALT: 8 EON + SG_ DECELERATION : 7|10@0- (0.1,0) [0|0] "m/s^2" Vector__XXX + SG_ DS1STAT2 : 13|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ DS1STBK2 : 10|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSWAR : 18|1@0+ (1,0) [0|0] "" FCM + SG_ PCSALM : 17|1@0+ (1,0) [0|0] "" FCM + SG_ PCSOPR : 16|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSABK : 31|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBATRGR : 30|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PPTRGR : 28|1@0+ (1,0) [0|0] "" FCM + SG_ IBTRGR : 27|1@0+ (1,0) [0|0] "" FCM + SG_ CLEXTRGR : 26|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ IRLT_REQ : 25|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ BRKHLD : 37|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ AVSTRGR : 36|1@0+ (1,0) [0|0] "" SCS + SG_ VGRSTRGR : 35|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PREFILL : 33|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBRTRGR : 32|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSDIS : 43|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBPREPMP : 40|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" FCM + + +CM_ "Imported file _toyota_2017.dbc starts here"; +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX DSU HCU EPS IPAS CGW + +BO_ 36 KINEMATICS: 8 XXX + SG_ ACCEL_Y : 33|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX + SG_ YAW_RATE : 1|10@0+ (0.244,-125) [0|65535] "deg/sec" XXX + SG_ STEERING_TORQUE : 17|10@0+ (1,-512) [0|65535] "" XXX + +BO_ 37 STEER_ANGLE_SENSOR: 8 XXX + SG_ STEER_ANGLE : 3|12@0- (1.5,0) [-500|500] "deg" XXX + SG_ STEER_FRACTION : 39|4@0- (0.1,0) [-0.7|0.7] "deg" XXX + SG_ STEER_RATE : 35|12@0- (1,0) [-2000|2000] "deg/s" XXX + +BO_ 166 BRAKE: 8 XXX + SG_ BRAKE_AMOUNT : 7|8@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_PEDAL : 23|8@0+ (1,0) [0|255] "" XXX + +BO_ 170 WHEEL_SPEEDS: 8 XXX + SG_ WHEEL_SPEED_FR : 7|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_FL : 23|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_RR : 39|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_RL : 55|16@0+ (0.01,-67.67) [0|250] "kph" XXX + +BO_ 180 SPEED: 8 XXX + SG_ ENCODER : 39|8@0+ (1,0) [0|255] "" XXX + SG_ SPEED : 47|16@0+ (0.01,0) [0|250] "kph" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 353 DSU_SPEED: 7 XXX + SG_ FORWARD_SPEED : 15|16@0- (0.00390625,-30) [0|255] "kph" XXX + +BO_ 452 ENGINE_RPM: 8 CGW + SG_ RPM : 7|16@0- (0.78125,0) [0|0] "rpm" SCS + +BO_ 466 PCM_CRUISE: 8 XXX + SG_ GAS_RELEASED : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_ACTIVE : 5|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL_ON : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ACCEL_NET : 23|16@0- (0.001,0) [-20|20] "m/s2" XXX + SG_ CRUISE_STATE : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CANCEL_REQ : 49|1@1+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 467 PCM_CRUISE_2: 8 XXX + SG_ MAIN_ON : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_SPEED_LOCKOUT : 14|2@0+ (1,0) [0|3] "kph" XXX + SG_ SET_SPEED : 23|8@0+ (1,0) [0|255] "kph" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 552 ACCELEROMETER: 8 XXX + SG_ ACCEL_Z : 22|15@0- (1,0) [0|32767] "" XXX + SG_ ACCEL_X : 6|15@0- (0.001,0) [-20|20] "m/s2" XXX + +BO_ 560 BRAKE_MODULE2: 7 XXX + SG_ BRAKE_PRESSED : 26|1@0+ (1,0) [0|1] "" XXX + +BO_ 614 STEERING_IPAS: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 643 PRE_COLLISION: 7 DSU + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ FORCE : 23|16@0- (2,0) [0|255] "N" XXX + SG_ SET_ME_X002 : 33|8@0+ (1,0) [0|3] "" XXX + SG_ BRAKE_STATUS : 39|3@0+ (1,0) [0|255] "" XXX + SG_ STATE : 36|3@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X003 : 40|1@0+ (1,0) [0|1] "" XXX + SG_ PRECOLLISION_ACTIVE : 41|1@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 55|8@0+ (1,0) [0|255] "" XXX + +BO_ 740 STEERING_LKA: 5 XXX + SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 6|6@0+ (1,0) [0|63] "" XXX + SG_ SET_ME_1 : 7|1@0+ (1,0) [0|1] "" XXX + SG_ STEER_TORQUE_CMD : 15|16@0- (1,0) [0|65535] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 742 LEAD_INFO: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" HCU + SG_ LEAD_REL_SPEED : 23|12@0- (0.025,0) [-100|100] "m/s" HCU + SG_ LEAD_LONG_DIST : 7|13@0+ (0.05,0) [0|300] "m" HCU + +BO_ 835 ACC_CONTROL: 8 DSU + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU + SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + +BO_ 836 PRE_COLLISION_2: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 869 DSU_CRUISE : 7 DSU + SG_ RES_BTN : 3|1@0+ (1,0) [0|0] "" XXX + SG_ SET_BTN : 2|1@0+ (1,0) [0|0] "" XXX + SG_ CANCEL_BTN : 1|1@0+ (1,0) [0|0] "" XXX + SG_ MAIN_ON : 0|1@0+ (1,0) [0|0] "" XXX + SG_ SET_SPEED : 15|8@0+ (1,0) [0|0] "km/h" XXX + SG_ CRUISE_REQUEST : 31|8@0+ (100,-12800) [0|0] "N" XXX + SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|0] "m" XXX + +BO_ 921 PCM_CRUISE_SM: 8 XXX + SG_ MAIN_ON : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_CONTROL_STATE : 11|4@0+ (1,0) [0|15] "" XXX + SG_ DISTANCE_LINES : 14|2@0+ (1,0) [0|3] "" XXX + SG_ UI_SET_SPEED : 31|8@0+ (1,0) [0|255] "" XXX + +BO_ 951 ESP_CONTROL: 8 ESP + SG_ TC_DISABLED : 13|1@0+ (1,0) [0|1] "" XXX + SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX + +BO_ 1041 ACC_HUD: 8 DSU + SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX + +BO_ 1042 LKAS_HUD: 8 XXX + SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX + SG_ RIGHT_LINE : 3|2@0+ (1,0) [0|3] "" XXX + SG_ LEFT_LINE : 5|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X01 : 7|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X01_2 : 11|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_ALERT : 9|2@0+ (1,0) [0|3] "" XXX + SG_ TWO_BEEPS : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ADJUSTING_CAMERA : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_MALFUNCTION : 15|1@0+ (1,0) [0|1] "" XXX + SG_ REPEATED_BEEPS : 32|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X0C : 23|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X2C : 47|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X38 : 55|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X02 : 63|8@0+ (1,0) [0|1] "" XXX + +BO_ 1043 TIME : 8 CGW + SG_ YEAR : 7|8@0+ (1,0) [0|0] "year" XXX + SG_ MONTH : 15|8@0+ (1,0) [0|0] "month" XXX + SG_ DAY : 23|8@0+ (1,0) [0|0] "day" XXX + SG_ HOUR : 31|8@0+ (1,0) [0|0] "hour" XXX + SG_ MINUTE : 39|8@0+ (1,0) [0|0] "minute" XXX + SG_ GMT_DIFF : 55|1@0+ (1,0) [0|0] "" XXX + SG_ GMTDIFF_HOURS : 54|4@0+ (1,0) [0|0] "hours" XXX + SG_ GMTDIFF_MINUTES : 50|6@0+ (1,0) [0|0] "minutes" XXX + SG_ SUMMER : 60|1@0+ (1,0) [0|0] "" XXX + +BO_ 1408 VIN_PART_1: 8 CGW + SG_ VIN_1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_2 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_3 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_4 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_5 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_6 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_7 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_8 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1409 VIN_PART_2: 8 CGW + SG_ VIN_9 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_10 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_11 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_12 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_13 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_14 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_15 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_16 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1410 VIN_PART_3: 8 CGW + SG_ VIN_17 : 7|8@0+ (1,0) [0|0] "" XXX + +BO_ 1553 UI_SETTING: 8 XXX + SG_ UNITS : 26|2@0+ (1,0) [0|3] "" XXX + SG_ ODOMETER : 43|20@0+ (1,0) [0|1048575] "" XXX + +BO_ 1556 STEERING_LEVERS: 8 XXX + SG_ TURN_SIGNALS : 29|2@0+ (1,0) [0|3] "" XXX + SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX + +BO_ 1568 SEATS_DOORS: 8 XXX + SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 43|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FR : 44|1@0+ (1,0) [0|1] "" XXX + +BO_ 1570 LIGHT_STALK: 8 SCM + SG_ AUTO_HIGH_BEAM : 37|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_FOG : 27|1@0+ (1,0) [0|1] "" XXX + SG_ PARKING_LIGHT : 28|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_BEAM : 29|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAM : 30|1@0+ (1,0) [0|1] "" XXX + +BO_ 1161 RSA1: 8 FCM + SG_ TSGN1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY1 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT1 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL1 : 23|8@0+ (1,0) [0|0] "kph" XXX + SG_ SPLSGN1 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN2 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN2 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY2 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT2 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL2 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_P : 63|2@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_A : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID1 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1162 RSA2: 8 FCM + SG_ TSGN3 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY3 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT3 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN3 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN4 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN4 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY4 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT4 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ DPSGNREQ : 54|1@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMP : 53|3@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMA : 50|3@0+ (1,0) [0|0] "" XXX + SG_ SPDUNT : 63|2@0+ (1,0) [0|0] "" XXX + SG_ TSRWMSG : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID2 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1163 RSA3: 8 FCM + SG_ TSREQPD : 7|1@0+ (1,0) [0|0] "" XXX + SG_ TSRMSW : 6|1@0+ (1,0) [0|0] "" XXX + SG_ OTSGNNTM : 5|2@0+ (1,0) [0|0] "" XXX + SG_ NTLVLSPD : 3|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPNTM : 1|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPVALL : 11|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALM : 19|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALH : 27|4@0+ (1,-5) [0|0] "" XXX + SG_ TSRSPU : 33|2@0+ (1,0) [0|0] "" XXX + +CM_ SG_ 36 ACCEL_Y "unit is tbd"; +CM_ SG_ 36 YAW_RATE "verify"; +CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd"; +CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set"; +CM_ SG_ 37 STEER_RATE "factor is tbd"; +CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors"; +CM_ SG_ 466 CRUISE_STATE "Active state is 8, if standstill is requested will switch to state 11(3 sec timer), after timer is elapsed will switch into state 7(standstill). If plus button was pressed - status 9, minus button pressed - status 10"; +CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect"; +CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph"; +CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?"; +CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque"; +CM_ SG_ 608 STEER_OVERRIDE "set when driver torque exceeds a certain value"; +CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active"; +CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking"; +CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG."; +CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file."; +CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit"; +CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel"; +CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces"; +CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts"; +CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit."; +CM_ SG_ 1161 SYNCID1 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1161 SPDVAL2 "conditional speed value 70"; +CM_ SG_ 1162 SGNNUMP "1 if SPDVAL1 is set, otherwise 0"; +CM_ SG_ 1162 SYNCID2 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1163 TSREQPD "always 1"; +CM_ SG_ 1163 TSRMSW "always 1"; +CM_ SG_ 1163 OTSGNNTM "always 3"; +CM_ SG_ 1163 NTLVLSPD "always 3"; +CM_ SG_ 1163 OVSPNTM "always 3"; +CM_ SG_ 1163 OVSPVALL "-5 at start then 2 after 2 seconds"; +CM_ SG_ 1163 OVSPVALM "-5 at start then 5 after 2 seconds"; +CM_ SG_ 1163 OVSPVALH "-5 at start then 10 after 2 seconds"; +CM_ SG_ 1163 TSRSPU "always 1"; +CM_ SG_ 1553 ODOMETER "Unit is dependent upon units signal"; + +VAL_ 466 CRUISE_STATE 11 "timer_3sec" 10 "adaptive click down" 9 "adaptive click up" 8 "adaptive engaged" 7 "standstill" 6 "non-adaptive click up" 5 "non-adaptive click down" 4 "non-adaptive hold down" 3 "non-adaptive hold up" 2 "non-adaptive being engaged" 1 "non-adaptive engaged" 0 "off"; +VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok"; +VAL_ 614 STATE 3 "enabled" 1 "disabled"; +VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left"; +VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking"; +VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted"; +VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none"; +VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none"; +VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1042 LEFT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1553 UNITS 1 "km" 2 "miles"; +VAL_ 1556 TURN_SIGNALS 3 "none" 2 "right" 1 "left"; +VAL_ 1161 TSGN1 1 "speed sign" 0 "none"; +VAL_ 1161 TSGN2 1 "speed sign" 0 "none"; +VAL_ 1161 SPLSGN2 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; +VAL_ 1162 TSGN3 0 "none" 1 "speed sign" 2 "0 unlimited" 7 "unlimited" 16 "highway" 17 "no highway" 18 "motorway" 19 "no motorway" 20 "in city" 21 "outside city" 22 "pedestrian area" 23 "no pedestrian area" 65 "no overtaking left" 66 "no overtaking right" 67 "overtaking allowed again" 81 "no right turn" 97 "stop" 105 "yield" 113 "stop" 114 "yield us" 129 "no entry" 138 "no entry tss2" 145 "do not enter"; +VAL_ 1162 SPLSGN3 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; + + +CM_ "CHFFR_METRIC 37 STEER_ANGLE STEER_ANGLE 0.36 180"; + +CM_ "toyota_prius_2017_pt.dbc starts here"; + + + +BO_ 295 GEAR_PACKET: 8 XXX + SG_ CAR_MOVEMENT : 39|8@0- (1,0) [0|255] "" XXX + SG_ COUNTER : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ GEAR : 47|4@0+ (1,0) [0|15] "" XXX + +BO_ 550 BRAKE_MODULE: 8 XXX + SG_ BRAKE_PRESSURE : 0|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_POSITION : 16|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_PRESSED : 37|1@0+ (1,0) [0|1] "" XXX + +BO_ 581 GAS_PEDAL: 8 XXX + SG_ GAS_PEDAL : 23|8@0+ (0.005,0) [0|1] "" XXX + +BO_ 608 STEER_TORQUE_SENSOR: 8 XXX + SG_ STEER_TORQUE_EPS : 47|16@0- (0.66,0) [-20000|20000] "" XXX + SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX + SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_ANGLE : 31|16@0- (0.0573,0) [-500|500] "" XXX + +BO_ 610 EPS_STATUS: 8 EPS + SG_ IPAS_STATE : 3|4@0+ (1,0) [0|15] "" XXX + SG_ LKA_STATE : 31|7@0+ (1,0) [0|127] "" XXX + SG_ TYPE : 24|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 1083 AUTOPARK_STATUS: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + +CM_ SG_ 550 BRAKE_PRESSURE "seems prop to pedal force"; +CM_ SG_ 550 BRAKE_POSITION "seems proportional to pedal displacement, unclear the max value of 0x1c8"; +CM_ SG_ 581 GAS_PEDAL "it seems slightly filtered"; +CM_ SG_ 610 TYPE "seems 1 on Corolla, 0 on all others"; +CM_ SG_ 1083 STATE "when the dashboard button is pressed, the value changes from zero to non-zero"; +VAL_ 295 GEAR 0 "P" 1 "R" 2 "N" 3 "D" 4 "B"; +VAL_ 610 IPAS_STATE 5 "override" 3 "enabled" 1 "disabled"; +VAL_ 610 LKA_STATE 25 "temporary_fault" 9 "temporary_fault2" 5 "active" 1 "standby"; diff --git a/opendbc/toyota_rav4_2017_pt_generated.dbc b/opendbc/toyota_rav4_2017_pt_generated.dbc new file mode 100644 index 000000000..d362440ad --- /dev/null +++ b/opendbc/toyota_rav4_2017_pt_generated.dbc @@ -0,0 +1,445 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 359 STEERING_IPAS_COMMA: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +CM_ "BO_ STEERING_IPAS_COMMA: Copy of msg 614 so we can do angle control while the Park Assist ECU is connected (Panda spoofs 614 with 359 on connector J70). Note that addresses 0x266 and 0x167 are checksum-invariant"; + + BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.159375,-75.555) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.159375,-151.111) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + + BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.159375,-75.555) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.159375,-151.111) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + + VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + +BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX + SG_ ZORRO_STEER : 7|24@0- (0.004901594652,0) [-500|500] "" XXX + +CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss"; + +BO_ 241 ACC_CONTROL_ALT: 8 EON + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU + SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + +BO_ 242 PRECOLLISION_2_ALT: 8 EON + SG_ DECELERATION : 7|10@0- (0.1,0) [0|0] "m/s^2" Vector__XXX + SG_ DS1STAT2 : 13|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ DS1STBK2 : 10|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSWAR : 18|1@0+ (1,0) [0|0] "" FCM + SG_ PCSALM : 17|1@0+ (1,0) [0|0] "" FCM + SG_ PCSOPR : 16|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSABK : 31|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBATRGR : 30|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PPTRGR : 28|1@0+ (1,0) [0|0] "" FCM + SG_ IBTRGR : 27|1@0+ (1,0) [0|0] "" FCM + SG_ CLEXTRGR : 26|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ IRLT_REQ : 25|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ BRKHLD : 37|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ AVSTRGR : 36|1@0+ (1,0) [0|0] "" SCS + SG_ VGRSTRGR : 35|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PREFILL : 33|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBRTRGR : 32|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSDIS : 43|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBPREPMP : 40|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" FCM + + +CM_ "Imported file _toyota_2017.dbc starts here"; +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX DSU HCU EPS IPAS CGW + +BO_ 36 KINEMATICS: 8 XXX + SG_ ACCEL_Y : 33|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX + SG_ YAW_RATE : 1|10@0+ (0.244,-125) [0|65535] "deg/sec" XXX + SG_ STEERING_TORQUE : 17|10@0+ (1,-512) [0|65535] "" XXX + +BO_ 37 STEER_ANGLE_SENSOR: 8 XXX + SG_ STEER_ANGLE : 3|12@0- (1.5,0) [-500|500] "deg" XXX + SG_ STEER_FRACTION : 39|4@0- (0.1,0) [-0.7|0.7] "deg" XXX + SG_ STEER_RATE : 35|12@0- (1,0) [-2000|2000] "deg/s" XXX + +BO_ 166 BRAKE: 8 XXX + SG_ BRAKE_AMOUNT : 7|8@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_PEDAL : 23|8@0+ (1,0) [0|255] "" XXX + +BO_ 170 WHEEL_SPEEDS: 8 XXX + SG_ WHEEL_SPEED_FR : 7|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_FL : 23|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_RR : 39|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_RL : 55|16@0+ (0.01,-67.67) [0|250] "kph" XXX + +BO_ 180 SPEED: 8 XXX + SG_ ENCODER : 39|8@0+ (1,0) [0|255] "" XXX + SG_ SPEED : 47|16@0+ (0.01,0) [0|250] "kph" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 353 DSU_SPEED: 7 XXX + SG_ FORWARD_SPEED : 15|16@0- (0.00390625,-30) [0|255] "kph" XXX + +BO_ 452 ENGINE_RPM: 8 CGW + SG_ RPM : 7|16@0- (0.78125,0) [0|0] "rpm" SCS + +BO_ 466 PCM_CRUISE: 8 XXX + SG_ GAS_RELEASED : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_ACTIVE : 5|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL_ON : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ACCEL_NET : 23|16@0- (0.001,0) [-20|20] "m/s2" XXX + SG_ CRUISE_STATE : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CANCEL_REQ : 49|1@1+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 467 PCM_CRUISE_2: 8 XXX + SG_ MAIN_ON : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_SPEED_LOCKOUT : 14|2@0+ (1,0) [0|3] "kph" XXX + SG_ SET_SPEED : 23|8@0+ (1,0) [0|255] "kph" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 552 ACCELEROMETER: 8 XXX + SG_ ACCEL_Z : 22|15@0- (1,0) [0|32767] "" XXX + SG_ ACCEL_X : 6|15@0- (0.001,0) [-20|20] "m/s2" XXX + +BO_ 560 BRAKE_MODULE2: 7 XXX + SG_ BRAKE_PRESSED : 26|1@0+ (1,0) [0|1] "" XXX + +BO_ 614 STEERING_IPAS: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 643 PRE_COLLISION: 7 DSU + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ FORCE : 23|16@0- (2,0) [0|255] "N" XXX + SG_ SET_ME_X002 : 33|8@0+ (1,0) [0|3] "" XXX + SG_ BRAKE_STATUS : 39|3@0+ (1,0) [0|255] "" XXX + SG_ STATE : 36|3@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X003 : 40|1@0+ (1,0) [0|1] "" XXX + SG_ PRECOLLISION_ACTIVE : 41|1@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 55|8@0+ (1,0) [0|255] "" XXX + +BO_ 740 STEERING_LKA: 5 XXX + SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 6|6@0+ (1,0) [0|63] "" XXX + SG_ SET_ME_1 : 7|1@0+ (1,0) [0|1] "" XXX + SG_ STEER_TORQUE_CMD : 15|16@0- (1,0) [0|65535] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 742 LEAD_INFO: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" HCU + SG_ LEAD_REL_SPEED : 23|12@0- (0.025,0) [-100|100] "m/s" HCU + SG_ LEAD_LONG_DIST : 7|13@0+ (0.05,0) [0|300] "m" HCU + +BO_ 835 ACC_CONTROL: 8 DSU + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU + SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + +BO_ 836 PRE_COLLISION_2: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 869 DSU_CRUISE : 7 DSU + SG_ RES_BTN : 3|1@0+ (1,0) [0|0] "" XXX + SG_ SET_BTN : 2|1@0+ (1,0) [0|0] "" XXX + SG_ CANCEL_BTN : 1|1@0+ (1,0) [0|0] "" XXX + SG_ MAIN_ON : 0|1@0+ (1,0) [0|0] "" XXX + SG_ SET_SPEED : 15|8@0+ (1,0) [0|0] "km/h" XXX + SG_ CRUISE_REQUEST : 31|8@0+ (100,-12800) [0|0] "N" XXX + SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|0] "m" XXX + +BO_ 921 PCM_CRUISE_SM: 8 XXX + SG_ MAIN_ON : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_CONTROL_STATE : 11|4@0+ (1,0) [0|15] "" XXX + SG_ DISTANCE_LINES : 14|2@0+ (1,0) [0|3] "" XXX + SG_ UI_SET_SPEED : 31|8@0+ (1,0) [0|255] "" XXX + +BO_ 951 ESP_CONTROL: 8 ESP + SG_ TC_DISABLED : 13|1@0+ (1,0) [0|1] "" XXX + SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX + +BO_ 1041 ACC_HUD: 8 DSU + SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX + +BO_ 1042 LKAS_HUD: 8 XXX + SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX + SG_ RIGHT_LINE : 3|2@0+ (1,0) [0|3] "" XXX + SG_ LEFT_LINE : 5|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X01 : 7|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X01_2 : 11|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_ALERT : 9|2@0+ (1,0) [0|3] "" XXX + SG_ TWO_BEEPS : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ADJUSTING_CAMERA : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_MALFUNCTION : 15|1@0+ (1,0) [0|1] "" XXX + SG_ REPEATED_BEEPS : 32|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X0C : 23|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X2C : 47|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X38 : 55|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X02 : 63|8@0+ (1,0) [0|1] "" XXX + +BO_ 1043 TIME : 8 CGW + SG_ YEAR : 7|8@0+ (1,0) [0|0] "year" XXX + SG_ MONTH : 15|8@0+ (1,0) [0|0] "month" XXX + SG_ DAY : 23|8@0+ (1,0) [0|0] "day" XXX + SG_ HOUR : 31|8@0+ (1,0) [0|0] "hour" XXX + SG_ MINUTE : 39|8@0+ (1,0) [0|0] "minute" XXX + SG_ GMT_DIFF : 55|1@0+ (1,0) [0|0] "" XXX + SG_ GMTDIFF_HOURS : 54|4@0+ (1,0) [0|0] "hours" XXX + SG_ GMTDIFF_MINUTES : 50|6@0+ (1,0) [0|0] "minutes" XXX + SG_ SUMMER : 60|1@0+ (1,0) [0|0] "" XXX + +BO_ 1408 VIN_PART_1: 8 CGW + SG_ VIN_1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_2 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_3 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_4 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_5 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_6 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_7 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_8 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1409 VIN_PART_2: 8 CGW + SG_ VIN_9 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_10 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_11 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_12 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_13 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_14 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_15 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_16 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1410 VIN_PART_3: 8 CGW + SG_ VIN_17 : 7|8@0+ (1,0) [0|0] "" XXX + +BO_ 1553 UI_SETTING: 8 XXX + SG_ UNITS : 26|2@0+ (1,0) [0|3] "" XXX + SG_ ODOMETER : 43|20@0+ (1,0) [0|1048575] "" XXX + +BO_ 1556 STEERING_LEVERS: 8 XXX + SG_ TURN_SIGNALS : 29|2@0+ (1,0) [0|3] "" XXX + SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX + +BO_ 1568 SEATS_DOORS: 8 XXX + SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 43|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FR : 44|1@0+ (1,0) [0|1] "" XXX + +BO_ 1570 LIGHT_STALK: 8 SCM + SG_ AUTO_HIGH_BEAM : 37|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_FOG : 27|1@0+ (1,0) [0|1] "" XXX + SG_ PARKING_LIGHT : 28|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_BEAM : 29|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAM : 30|1@0+ (1,0) [0|1] "" XXX + +BO_ 1161 RSA1: 8 FCM + SG_ TSGN1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY1 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT1 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL1 : 23|8@0+ (1,0) [0|0] "kph" XXX + SG_ SPLSGN1 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN2 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN2 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY2 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT2 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL2 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_P : 63|2@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_A : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID1 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1162 RSA2: 8 FCM + SG_ TSGN3 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY3 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT3 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN3 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN4 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN4 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY4 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT4 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ DPSGNREQ : 54|1@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMP : 53|3@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMA : 50|3@0+ (1,0) [0|0] "" XXX + SG_ SPDUNT : 63|2@0+ (1,0) [0|0] "" XXX + SG_ TSRWMSG : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID2 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1163 RSA3: 8 FCM + SG_ TSREQPD : 7|1@0+ (1,0) [0|0] "" XXX + SG_ TSRMSW : 6|1@0+ (1,0) [0|0] "" XXX + SG_ OTSGNNTM : 5|2@0+ (1,0) [0|0] "" XXX + SG_ NTLVLSPD : 3|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPNTM : 1|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPVALL : 11|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALM : 19|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALH : 27|4@0+ (1,-5) [0|0] "" XXX + SG_ TSRSPU : 33|2@0+ (1,0) [0|0] "" XXX + +CM_ SG_ 36 ACCEL_Y "unit is tbd"; +CM_ SG_ 36 YAW_RATE "verify"; +CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd"; +CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set"; +CM_ SG_ 37 STEER_RATE "factor is tbd"; +CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors"; +CM_ SG_ 466 CRUISE_STATE "Active state is 8, if standstill is requested will switch to state 11(3 sec timer), after timer is elapsed will switch into state 7(standstill). If plus button was pressed - status 9, minus button pressed - status 10"; +CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect"; +CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph"; +CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?"; +CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque"; +CM_ SG_ 608 STEER_OVERRIDE "set when driver torque exceeds a certain value"; +CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active"; +CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking"; +CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG."; +CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file."; +CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit"; +CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel"; +CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces"; +CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts"; +CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit."; +CM_ SG_ 1161 SYNCID1 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1161 SPDVAL2 "conditional speed value 70"; +CM_ SG_ 1162 SGNNUMP "1 if SPDVAL1 is set, otherwise 0"; +CM_ SG_ 1162 SYNCID2 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1163 TSREQPD "always 1"; +CM_ SG_ 1163 TSRMSW "always 1"; +CM_ SG_ 1163 OTSGNNTM "always 3"; +CM_ SG_ 1163 NTLVLSPD "always 3"; +CM_ SG_ 1163 OVSPNTM "always 3"; +CM_ SG_ 1163 OVSPVALL "-5 at start then 2 after 2 seconds"; +CM_ SG_ 1163 OVSPVALM "-5 at start then 5 after 2 seconds"; +CM_ SG_ 1163 OVSPVALH "-5 at start then 10 after 2 seconds"; +CM_ SG_ 1163 TSRSPU "always 1"; +CM_ SG_ 1553 ODOMETER "Unit is dependent upon units signal"; + +VAL_ 466 CRUISE_STATE 11 "timer_3sec" 10 "adaptive click down" 9 "adaptive click up" 8 "adaptive engaged" 7 "standstill" 6 "non-adaptive click up" 5 "non-adaptive click down" 4 "non-adaptive hold down" 3 "non-adaptive hold up" 2 "non-adaptive being engaged" 1 "non-adaptive engaged" 0 "off"; +VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok"; +VAL_ 614 STATE 3 "enabled" 1 "disabled"; +VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left"; +VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking"; +VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted"; +VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none"; +VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none"; +VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1042 LEFT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1553 UNITS 1 "km" 2 "miles"; +VAL_ 1556 TURN_SIGNALS 3 "none" 2 "right" 1 "left"; +VAL_ 1161 TSGN1 1 "speed sign" 0 "none"; +VAL_ 1161 TSGN2 1 "speed sign" 0 "none"; +VAL_ 1161 SPLSGN2 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; +VAL_ 1162 TSGN3 0 "none" 1 "speed sign" 2 "0 unlimited" 7 "unlimited" 16 "highway" 17 "no highway" 18 "motorway" 19 "no motorway" 20 "in city" 21 "outside city" 22 "pedestrian area" 23 "no pedestrian area" 65 "no overtaking left" 66 "no overtaking right" 67 "overtaking allowed again" 81 "no right turn" 97 "stop" 105 "yield" 113 "stop" 114 "yield us" 129 "no entry" 138 "no entry tss2" 145 "do not enter"; +VAL_ 1162 SPLSGN3 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; + + +CM_ "CHFFR_METRIC 37 STEER_ANGLE STEER_ANGLE 0.36 180"; + +CM_ "toyota_rav4_2017_pt.dbc starts here"; + + + +BO_ 548 BRAKE_MODULE: 8 XXX + SG_ BRAKE_PRESSURE : 43|12@0+ (1,0) [0|4047] "" XXX + SG_ BRAKE_PRESSED : 5|1@0+ (1,0) [0|1] "" XXX + +BO_ 705 GAS_PEDAL: 8 XXX + SG_ GAS_RELEASED : 3|1@0+ (1,0) [0|1] "" XXX + SG_ GAS_PEDAL : 55|8@0+ (0.005,0) [0|1] "" XXX + +BO_ 608 STEER_TORQUE_SENSOR: 8 XXX + SG_ STEER_TORQUE_EPS : 47|16@0- (0.73,0) [-20000|20000] "" XXX + SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX + SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_ANGLE : 31|16@0- (0.0573,0) [-500|500] "" XXX + +BO_ 610 EPS_STATUS: 5 EPS + SG_ IPAS_STATE : 3|4@0+ (1,0) [0|15] "" XXX + SG_ LKA_STATE : 31|7@0+ (1,0) [0|127] "" XXX + SG_ TYPE : 24|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 956 GEAR_PACKET: 8 XXX + SG_ GEAR : 13|6@0+ (1,0) [0|63] "" XXX + +CM_ SG_ 548 BRAKE_PRESSURE "seems prop to pedal force"; +CM_ SG_ 548 BRAKE_POSITION "seems proportional to pedal displacement, unclear the max value of 0x1c8"; +CM_ SG_ 610 TYPE "seems 1 on Corolla, 0 on all others"; +VAL_ 956 GEAR 0 "D" 1 "S" 8 "N" 16 "R" 32 "P"; +VAL_ 610 IPAS_STATE 5 "override" 3 "enabled" 1 "disabled"; +VAL_ 610 LKA_STATE 25 "temporary_fault" 9 "temporary_fault2" 5 "active" 1 "standby"; diff --git a/opendbc/toyota_tnga_k_pt_generated.dbc b/opendbc/toyota_tnga_k_pt_generated.dbc new file mode 100644 index 000000000..8db963e0a --- /dev/null +++ b/opendbc/toyota_tnga_k_pt_generated.dbc @@ -0,0 +1,569 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + + +CM_ "Imported file _comma.dbc starts here"; +BO_ 359 STEERING_IPAS_COMMA: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +CM_ "BO_ STEERING_IPAS_COMMA: Copy of msg 614 so we can do angle control while the Park Assist ECU is connected (Panda spoofs 614 with 359 on connector J70). Note that addresses 0x266 and 0x167 are checksum-invariant"; + +BO_ 512 GAS_COMMAND: 6 EON + SG_ GAS_COMMAND : 7|16@0+ (0.159375,-75.555) [0|1] "" INTERCEPTOR + SG_ GAS_COMMAND2 : 23|16@0+ (0.159375,-151.111) [0|1] "" INTERCEPTOR + SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR + +BO_ 513 GAS_SENSOR: 6 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.159375,-75.555) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.159375,-151.111) [0|1] "" EON + SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON + SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON + SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON + +VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ; + +BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX + SG_ ZORRO_STEER : 7|24@0- (0.004901594652,0) [-500|500] "" XXX + +CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss"; + +BO_ 241 ACC_CONTROL_ALT: 8 EON + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU + SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + +BO_ 242 PRECOLLISION_2_ALT: 8 EON + SG_ DECELERATION : 7|10@0- (0.1,0) [0|0] "m/s^2" Vector__XXX + SG_ DS1STAT2 : 13|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ DS1STBK2 : 10|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSWAR : 18|1@0+ (1,0) [0|0] "" FCM + SG_ PCSALM : 17|1@0+ (1,0) [0|0] "" FCM + SG_ PCSOPR : 16|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSABK : 31|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBATRGR : 30|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PPTRGR : 28|1@0+ (1,0) [0|0] "" FCM + SG_ IBTRGR : 27|1@0+ (1,0) [0|0] "" FCM + SG_ CLEXTRGR : 26|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ IRLT_REQ : 25|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ BRKHLD : 37|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ AVSTRGR : 36|1@0+ (1,0) [0|0] "" SCS + SG_ VGRSTRGR : 35|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PREFILL : 33|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBRTRGR : 32|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSDIS : 43|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBPREPMP : 40|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" FCM +BO_ 767 SDSU: 8 XXX + SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX + +CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu"; +CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu"; + + +CM_ "Imported file _toyota_2017.dbc starts here"; +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX DSU HCU EPS IPAS CGW BGM + +BO_ 36 KINEMATICS: 8 XXX + SG_ ACCEL_Y : 33|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX + SG_ YAW_RATE : 1|10@0+ (0.244,-125) [0|65535] "deg/s" XXX + SG_ STEERING_TORQUE : 17|10@0+ (1,-512) [0|65535] "" XXX + +BO_ 37 STEER_ANGLE_SENSOR: 8 XXX + SG_ STEER_ANGLE : 3|12@0- (1.5,0) [-500|500] "deg" XXX + SG_ STEER_FRACTION : 39|4@0- (0.1,0) [-0.7|0.7] "deg" XXX + SG_ STEER_RATE : 35|12@0- (1,0) [-2000|2000] "deg/s" XXX + +BO_ 166 BRAKE: 8 XXX + SG_ BRAKE_AMOUNT : 7|8@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_PEDAL : 23|8@0+ (1,0) [0|255] "" XXX + +BO_ 170 WHEEL_SPEEDS: 8 XXX + SG_ WHEEL_SPEED_FR : 7|16@0+ (0.01,-67.67) [0|250] "km/h" XXX + SG_ WHEEL_SPEED_FL : 23|16@0+ (0.01,-67.67) [0|250] "km/h" XXX + SG_ WHEEL_SPEED_RR : 39|16@0+ (0.01,-67.67) [0|250] "km/h" XXX + SG_ WHEEL_SPEED_RL : 55|16@0+ (0.01,-67.67) [0|250] "km/h" XXX + +BO_ 180 SPEED: 8 XXX + SG_ ENCODER : 39|8@0+ (1,0) [0|255] "" XXX + SG_ SPEED : 47|16@0+ (0.01,0) [0|250] "km/h" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 295 GEAR_PACKET_HYBRID: 8 XXX + SG_ CAR_MOVEMENT : 39|8@0- (1,0) [0|255] "" XXX + SG_ COUNTER : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ GEAR : 47|4@0+ (1,0) [0|15] "" XXX + +BO_ 353 DSU_SPEED: 7 XXX + SG_ FORWARD_SPEED : 15|16@0- (0.00390625,-30) [0|255] "km/h" XXX + +BO_ 452 ENGINE_RPM: 8 CGW + SG_ RPM : 7|16@0- (0.78125,0) [0|0] "rpm" SCS + +BO_ 466 PCM_CRUISE: 8 XXX + SG_ GAS_RELEASED : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_ACTIVE : 5|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL_ON : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ACCEL_NET : 23|16@0- (0.001,0) [-20|20] "m/s^2" XXX + SG_ CRUISE_STATE : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CANCEL_REQ : 49|1@1+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 467 PCM_CRUISE_2: 8 XXX + SG_ MAIN_ON : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_SPEED_LOCKOUT : 14|2@0+ (1,0) [0|3] "" XXX + SG_ SET_SPEED : 23|8@0+ (1,0) [0|255] "km/h" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 552 ACCELEROMETER: 8 XXX + SG_ ACCEL_Z : 22|15@0- (1,0) [0|32767] "m/s^2" XXX + SG_ ACCEL_X : 6|15@0- (0.001,0) [-20|20] "m/s^2" XXX + +BO_ 560 BRAKE_2: 7 XXX + SG_ BRAKE_PRESSED : 26|1@0+ (1,0) [0|1] "" XXX + +BO_ 581 GAS_PEDAL_HYBRID: 8 XXX + SG_ GAS_PEDAL : 23|8@0+ (0.005,0) [0|1] "" XXX + +BO_ 608 STEER_TORQUE_SENSOR: 8 XXX + SG_ STEER_TORQUE_EPS : 47|16@0- (1,0) [-32768|32767] "" XXX + SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX + SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_ANGLE : 31|16@0- (0.0573,0) [-500|500] "" XXX + +BO_ 614 STEERING_IPAS: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 643 PRE_COLLISION: 7 DSU + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 15|8@0+ (1,0) [0|255] "" XXX + SG_ FORCE : 23|16@0- (2,0) [0|255] "N" XXX + SG_ SET_ME_X002 : 33|8@0+ (1,0) [0|3] "" XXX + SG_ BRAKE_STATUS : 39|3@0+ (1,0) [0|255] "" XXX + SG_ STATE : 36|3@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X003 : 40|1@0+ (1,0) [0|1] "" XXX + SG_ PRECOLLISION_ACTIVE : 41|1@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 55|8@0+ (1,0) [0|255] "" XXX + +BO_ 705 GAS_PEDAL: 8 XXX + SG_ GAS_RELEASED : 3|1@0+ (1,0) [0|1] "" XXX + SG_ GAS_PEDAL : 55|8@0+ (0.005,0) [0|1] "" XXX + +BO_ 740 STEERING_LKA: 5 XXX + SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 6|6@0+ (1,0) [0|63] "" XXX + SG_ SET_ME_1 : 7|1@0+ (1,0) [0|1] "" XXX + SG_ STEER_TORQUE_CMD : 15|16@0- (1,0) [0|65535] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 742 LEAD_INFO: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" HCU + SG_ LEAD_REL_SPEED : 23|12@0- (0.025,0) [-100|100] "m/s" HCU + SG_ LEAD_LONG_DIST : 7|13@0+ (0.05,0) [0|300] "m" HCU + +BO_ 835 ACC_CONTROL: 8 DSU + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s^2" HCU + SG_ ACC_MALFUNCTION : 18|1@0+ (1,0) [0|0] "" XXX + SG_ ACC_CUT_IN : 25|1@0+ (1,0) [0|1] "" XXX + SG_ ALLOW_LONG_PRESS : 17|2@0+ (1,0) [0|2] "" XXX + SG_ ITS_CONNECT_LEAD : 39|8@0+ (1,0) [0|1] "" Vector__XXX + SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU + SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX + SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX + SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU + SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU + SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX + SG_ RADAR_DIRTY : 19|1@0+ (1,0) [0|1] "" XXX + +BO_ 836 PRE_COLLISION_2: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 869 DSU_CRUISE : 7 DSU + SG_ RES_BTN : 3|1@0+ (1,0) [0|0] "" XXX + SG_ SET_BTN : 2|1@0+ (1,0) [0|0] "" XXX + SG_ CANCEL_BTN : 1|1@0+ (1,0) [0|0] "" XXX + SG_ MAIN_ON : 0|1@0+ (1,0) [0|0] "" XXX + SG_ SET_SPEED : 15|8@0+ (1,0) [0|0] "km/h" XXX + SG_ CRUISE_REQUEST : 31|8@0+ (100,-12800) [0|0] "N" XXX + SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|0] "m" XXX + +BO_ 921 PCM_CRUISE_SM: 8 XXX + SG_ MAIN_ON : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_CONTROL_STATE : 11|4@0+ (1,0) [0|15] "" XXX + SG_ DISTANCE_LINES : 14|2@0+ (1,0) [0|3] "" XXX + SG_ UI_SET_SPEED : 31|8@0+ (1,0) [0|255] "" XXX + +BO_ 951 ESP_CONTROL: 8 ESP + SG_ TC_DISABLED : 13|1@0+ (1,0) [0|1] "" XXX + SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ENABLED : 33|1@1+ (1,0) [0|1] "" XXX + SG_ BRAKE_HOLD_ACTIVE : 36|1@0+ (1,0) [0|1] "" XXX + +BO_ 956 GEAR_PACKET: 8 XXX + SG_ SPORT_ON : 2|1@0+ (1,0) [0|1] "" XXX + SG_ GEAR : 13|6@0+ (1,0) [0|63] "" XXX + SG_ SPORT_GEAR_ON : 33|1@0+ (1,0) [0|1] "" XXX + SG_ SPORT_GEAR : 38|3@0+ (1,0) [0|7] "" XXX + SG_ ECON_ON : 40|1@0+ (1,0) [0|1] "" XXX + SG_ B_GEAR_ENGAGED : 41|1@0+ (1,0) [0|1] "" XXX + SG_ DRIVE_ENGAGED : 47|1@0+ (1,0) [0|1] "" XXX + +BO_ 1005 REVERSE_CAMERA_STATE: 2 BGM + SG_ REVERSE_CAMERA_GUIDELINES : 9|2@0+ (1,0) [1|3] "" XXX + +BO_ 1009 PCM_CRUISE_ALT: 8 XXX + SG_ MAIN_ON : 13|1@0+ (1,0) [0|3] "" XXX + SG_ CRUISE_STATE : 10|1@0+ (1,0) [0|1] "" XXX + SG_ SET_SPEED : 23|8@0+ (1,0) [0|255] "mph" XXX + +BO_ 1020 SOLAR_SENSOR: 8 XXX + SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX + +BO_ 1041 ACC_HUD: 8 DSU + SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX + SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX + SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX + SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX + +BO_ 1042 LKAS_HUD: 8 DSU + SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX + SG_ RIGHT_LINE : 3|2@0+ (1,0) [0|3] "" XXX + SG_ LEFT_LINE : 5|2@0+ (1,0) [0|3] "" XXX + SG_ LKAS_STATUS : 7|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_ALERT : 9|2@0+ (1,0) [0|3] "" XXX + SG_ LDW_EXIST : 10|1@0+ (1,0) [0|1] "" XXX + SG_ TWO_BEEPS : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ADJUSTING_CAMERA : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_UNAVAILABLE_QUIET : 14|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_MALFUNCTION : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_UNAVAILABLE : 16|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_SENSITIVITY : 18|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_SA_TOGGLE : 20|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_SPEED_TOO_LOW : 21|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_ON_MESSAGE : 31|2@0+ (1,0) [0|3] "" XXX + SG_ REPEATED_BEEPS : 32|1@0+ (1,0) [0|1] "" XXX + SG_ LANE_SWAY_TOGGLE : 43|1@0+ (1,0) [0|1] "" XXX + SG_ LANE_SWAY_SENSITIVITY : 45|2@0+ (1,0) [0|3] "" XXX + SG_ TAKE_CONTROL : 46|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_FRONT_CAMERA_BLOCKED : 47|1@0+ (1,0) [0|1] "" XXX + SG_ LANE_SWAY_BUZZER : 50|2@0+ (1,0) [0|0] "" XXX + SG_ LANE_SWAY_FLD : 53|3@0+ (1,0) [0|7] "" XXX + SG_ LANE_SWAY_WARNING : 55|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X01 : 42|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_X02 : 63|8@0+ (1,0) [0|1] "" XXX + +BO_ 1043 TIME : 8 CGW + SG_ YEAR : 7|8@0+ (1,0) [0|0] "year" XXX + SG_ MONTH : 15|8@0+ (1,0) [0|0] "month" XXX + SG_ DAY : 23|8@0+ (1,0) [0|0] "day" XXX + SG_ HOUR : 31|8@0+ (1,0) [0|0] "hour" XXX + SG_ MINUTE : 39|8@0+ (1,0) [0|0] "minute" XXX + SG_ GMT_DIFF : 55|1@0+ (1,0) [0|0] "" XXX + SG_ GMTDIFF_HOURS : 54|4@0+ (1,0) [0|0] "hours" XXX + SG_ GMTDIFF_MINUTES : 50|6@0+ (1,0) [0|0] "minutes" XXX + SG_ SUMMER : 60|1@0+ (1,0) [0|0] "" XXX + +BO_ 1083 AUTOPARK_STATUS: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + +BO_ 1161 RSA1: 8 FCM + SG_ TSGN1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY1 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT1 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL1 : 23|8@0+ (1,0) [0|0] "km/h" XXX + SG_ SPLSGN1 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN2 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN2 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY2 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT2 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ SPDVAL2 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_P : 63|2@0+ (1,0) [0|0] "" XXX + SG_ BZRRQ_A : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID1 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1162 RSA2: 8 FCM + SG_ TSGN3 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY3 : 12|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT3 : 9|2@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN3 : 31|4@0+ (1,0) [0|0] "" XXX + SG_ SPLSGN4 : 27|4@0+ (1,0) [0|0] "" XXX + SG_ TSGN4 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ TSGNGRY4 : 44|3@0+ (1,0) [0|0] "" XXX + SG_ TSGNHLT4 : 41|2@0+ (1,0) [0|0] "" XXX + SG_ DPSGNREQ : 54|1@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMP : 53|3@0+ (1,0) [0|0] "" XXX + SG_ SGNNUMA : 50|3@0+ (1,0) [0|0] "" XXX + SG_ SPDUNT : 63|2@0+ (1,0) [0|0] "" XXX + SG_ TSRWMSG : 61|2@0+ (1,0) [0|0] "" XXX + SG_ SYNCID2 : 59|4@0+ (1,0) [0|0] "" XXX + +BO_ 1163 RSA3: 8 FCM + SG_ TSREQPD : 7|1@0+ (1,0) [0|0] "" XXX + SG_ TSRMSW : 6|1@0+ (1,0) [0|0] "" XXX + SG_ OTSGNNTM : 5|2@0+ (1,0) [0|0] "" XXX + SG_ NTLVLSPD : 3|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPNTM : 1|2@0+ (1,0) [0|0] "" XXX + SG_ OVSPVALL : 11|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALM : 19|4@0+ (1,-5) [0|0] "" XXX + SG_ OVSPVALH : 27|4@0+ (1,-5) [0|0] "" XXX + SG_ TSRSPU : 33|2@0+ (1,0) [0|0] "" XXX + +BO_ 1408 VIN_PART_1: 8 CGW + SG_ VIN_1 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_2 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_3 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_4 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_5 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_6 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_7 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_8 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1409 VIN_PART_2: 8 CGW + SG_ VIN_9 : 7|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_10 : 15|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_11 : 23|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_12 : 31|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_13 : 39|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_14 : 47|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_15 : 55|8@0+ (1,0) [0|0] "" XXX + SG_ VIN_16 : 63|8@0+ (1,0) [0|0] "" XXX + +BO_ 1410 VIN_PART_3: 8 CGW + SG_ VIN_17 : 7|8@0+ (1,0) [0|0] "" XXX + +BO_ 1552 BODY_CONTROL_STATE_2: 8 XXX + SG_ METER_SLIDER_BRIGHTNESS_PCT : 30|7@0+ (1,0) [12|100] "%" XXX + SG_ METER_SLIDER_LOW_BRIGHTNESS : 37|1@0+ (1,0) [0|1] "" XXX + SG_ METER_SLIDER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX + +BO_ 1553 UI_SETTING: 8 XXX + SG_ UNITS : 26|2@0+ (1,0) [0|3] "" XXX + SG_ ODOMETER : 43|20@0+ (1,0) [0|1048575] "" XXX + +BO_ 1556 BLINKERS_STATE: 8 XXX + SG_ TURN_SIGNALS : 29|2@0+ (1,0) [0|3] "" XXX + SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX + +BO_ 1568 BODY_CONTROL_STATE: 8 XXX + SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX + SG_ PARKING_BRAKE : 60|1@0+ (1,0) [0|1] "" XXX + SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 43|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FR : 44|1@0+ (1,0) [0|1] "" XXX + +BO_ 1570 LIGHT_STALK: 8 SCM + SG_ AUTO_HIGH_BEAM : 37|1@0+ (1,0) [0|1] "" XXX + SG_ FRONT_FOG : 27|1@0+ (1,0) [0|1] "" XXX + SG_ PARKING_LIGHT : 28|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_BEAM : 29|1@0+ (1,0) [0|1] "" XXX + SG_ HIGH_BEAM : 30|1@0+ (1,0) [0|1] "" XXX + SG_ DAYTIME_RUNNING_LIGHT : 31|1@0+ (1,0) [0|1] "" XXX + +BO_ 1571 CERTIFICATION_ECU: 8 CGW + SG_ DOOR_LOCK_FEEDBACK_LIGHT : 15|1@0+ (1,0) [0|0] "" XXX + SG_ KEYFOB_LOCKING_FEEDBACK_LIGHT : 61|1@0+ (1,0) [0|0] "" XXX + SG_ KEYFOB_UNLOCKING_FEEDBACK_LIGHT : 62|1@0+ (1,0) [0|0] "" XXX + +BO_ 1592 DOOR_LOCKS: 8 XXX + SG_ LOCK_STATUS_CHANGED : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LOCK_STATUS : 20|1@0+ (1,0) [0|1] "" XXX + SG_ LOCKED_VIA_KEYFOB : 23|1@0+ (1,0) [0|1] "" XXX + +CM_ SG_ 36 YAW_RATE "verify"; +CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd"; +CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set"; +CM_ SG_ 37 STEER_RATE "factor is tbd"; +CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors"; +CM_ SG_ 466 CRUISE_STATE "Active state is 8, if standstill is requested will switch to state 11(3 sec timer), after timer is elapsed will switch into state 7(standstill). If plus button was pressed - status 9, minus button pressed - status 10"; +CM_ SG_ 467 SET_SPEED "43 km/h are shown as 28 mph, so conversion isn't perfect"; +CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph"; +CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?"; +CM_ SG_ 581 GAS_PEDAL "it seems slightly filtered"; +CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque"; +CM_ SG_ 608 STEER_OVERRIDE "set when driver torque exceeds a certain value"; +CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active"; +CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control"; +CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking"; +CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok"; +CM_ SG_ 835 RADAR_DIRTY "Display Clean Radar Sensor message on HUD"; +CM_ SG_ 835 ACC_MALFUNCTION "display ACC fault on dash if set to 1"; +CM_ SG_ 835 ACC_CUT_IN "Display blinking yellow lead if set to 1"; +CM_ SG_ 835 DISTANCE "Display Distance Bars on HUD Permanently"; +CM_ SG_ 835 ITS_CONNECT_LEAD "Displayed when lead car is capable of ITS Connect"; +CM_ SG_ 835 ALLOW_LONG_PRESS "Enable Toyota's factory set speed increment behaviour, available on both metrics cars and imperial unit cars"; +CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG."; +CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file."; +CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit"; +CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel"; +CM_ SG_ 1009 SET_SPEED "units seem to be whatever the car is set to"; +CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator"; +CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity"; +CM_ SG_ 1042 LDA_SA_TOGGLE "LDA Steering Assist Toggle"; +CM_ SG_ 1042 LDW_EXIST "Unclear what this is, it's usually set to 0"; +CM_ SG_ 1042 LDA_SENSITIVITY "LDA Sensitivity"; +CM_ SG_ 1042 LDA_ON_MESSAGE "Display LDA Turned ON message"; +CM_ SG_ 1042 REPEATED_BEEPS "LDA audible warning"; +CM_ SG_ 1042 LDA_UNAVAILABLE_QUIET "LDA toggles and sensitivity settings are greyed out if set to 1"; +CM_ SG_ 1042 LDA_SPEED_TOO_LOW "length is 3 bits in the leaked DBC, displays LDA unavailable below approx 50 km/h if set to 1"; +CM_ SG_ 1042 LDA_FRONT_CAMERA_BLOCKED "originally LDAFCVB, LDA related settings are greyed out if set to 1"; +CM_ SG_ 1042 TAKE_CONTROL "Please Control Steering Wheel warning"; +CM_ SG_ 1042 LANE_SWAY_TOGGLE "Lane Sway Warning System SWS Switch"; +CM_ SG_ 1042 LANE_SWAY_WARNING "Lane Sway Warning System Triggered"; +CM_ SG_ 1042 LANE_SWAY_FLD "Unknown signal for Lane Sway Warning System, set to 7 on stock system when SWS is enabled, 0 when SWS is disabled"; +CM_ SG_ 1042 LANE_SWAY_BUZZER "Similar to TWO_BEEPS"; +CM_ SG_ 1042 SET_ME_X01 "empty bit on leaked dbc, always set to 1 during normal operations"; +CM_ SG_ 1042 SET_ME_X02 "empty bit on leaked dbc, always set to 2 during normal operations"; +CM_ SG_ 1083 STATE "when the dashboard button is pressed, the value changes from zero to non-zero"; +CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit."; +CM_ SG_ 1161 SYNCID1 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1161 SPDVAL2 "conditional speed value 70"; +CM_ SG_ 1162 SGNNUMP "1 if SPDVAL1 is set, otherwise 0"; +CM_ SG_ 1162 SYNCID2 "counter from 1 to f at 1 Hz"; +CM_ SG_ 1163 TSREQPD "always 1"; +CM_ SG_ 1163 TSRMSW "always 1"; +CM_ SG_ 1163 OTSGNNTM "always 3"; +CM_ SG_ 1163 NTLVLSPD "always 3"; +CM_ SG_ 1163 OVSPNTM "always 3"; +CM_ SG_ 1163 OVSPVALL "-5 at start then 2 after 2 seconds"; +CM_ SG_ 1163 OVSPVALM "-5 at start then 5 after 2 seconds"; +CM_ SG_ 1163 OVSPVALH "-5 at start then 10 after 2 seconds"; +CM_ SG_ 1163 TSRSPU "always 1"; +CM_ SG_ 1552 METER_SLIDER_BRIGHTNESS_PCT "Combination display brightness setting, scales from 12 per cent to 100 per cent, reflects combination meter settings only, not linked with headlight state"; +CM_ SG_ 1552 METER_SLIDER_LOW_BRIGHTNESS "Combination display low brightness mode, also controls footwell lighting"; +CM_ SG_ 1552 METER_SLIDER_DIMMED "Combination display slider not at max, reflects combination meter settings only, not linked with headlight state"; +CM_ SG_ 1553 ODOMETER "Unit is dependent upon units signal"; +CM_ SG_ 1592 LOCK_STATUS_CHANGED "1 on rising edge of lock/unlocking"; +CM_ SG_ 1592 LOCK_STATUS "The next 3 bits always seem to follow this signal."; +CM_ SG_ 1592 LOCKED_VIA_KEYFOB "1 for as long as car is locked with key fob or door handle touch"; + +VAL_ 295 GEAR 0 "P" 1 "R" 2 "N" 3 "D" 4 "B"; +VAL_ 466 CRUISE_STATE 11 "timer_3sec" 10 "adaptive click down" 9 "adaptive click up" 8 "adaptive engaged" 7 "standstill" 6 "non-adaptive click up" 5 "non-adaptive click down" 4 "non-adaptive hold down" 3 "non-adaptive hold up" 2 "non-adaptive being engaged" 1 "non-adaptive engaged" 0 "off"; +VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok"; +VAL_ 614 STATE 3 "enabled" 1 "disabled"; +VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left"; +VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking"; +VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok"; +VAL_ 835 ACC_MALFUNCTION 1 "faulted" 0 "ok"; +VAL_ 835 ACC_CUT_IN 1 "CUT-IN Detected" 0 "clear"; +VAL_ 835 ALLOW_LONG_PRESS 2 "set speed increase by 5 speed units regardless" 1 "set speed increase by 1 speed unit on short press, 5 speed units on long press"; +VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted"; +VAL_ 956 SPORT_ON 0 "off" 1 "on"; +VAL_ 956 GEAR 0 "D" 1 "S" 8 "N" 16 "R" 32 "P"; +VAL_ 956 SPORT_GEAR_ON 0 "off" 1 "on"; +VAL_ 956 SPORT_GEAR 1 "S1" 2 "S2" 3 "S3" 4 "S4" 5 "S5" 6 "S6"; +VAL_ 956 ECON_ON 0 "off" 1 "on"; +VAL_ 956 B_GEAR_ENGAGED 0 "off" 1 "on"; +VAL_ 956 DRIVE_ENGAGED 0 "off" 1 "on"; +VAL_ 1005 REVERSE_CAMERA_GUIDELINES 3 "No guidelines" 2 "Static guidelines" 1 "Active guidelines"; +VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled"; +VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off"; +VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none"; +VAL_ 1042 BARRIERS 3 "left" 2 "right" 1 "both" 0 "none"; +VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1042 LKAS_STATUS 1 "on" 0 "off"; +VAL_ 1042 LEFT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; +VAL_ 1042 LDA_ON_MESSAGE 2 "Lane Departure Alert Turned ON, Steering Assist Inactive" 1 "Lane Departure Alert Turned ON, Steering Assist Active" 0 "clear"; +VAL_ 1042 LDA_SA_TOGGLE 2 "steering assist off" 1 "steering assist on"; +VAL_ 1042 LDA_SENSITIVITY 2 "standard" 1 "high" 0 "undefined"; +VAL_ 1042 LDA_SPEED_TOO_LOW 1 "lda unavailable, speed too low" 0 "ok"; +VAL_ 1042 LDA_FRONT_CAMERA_BLOCKED 1 "lda unavailable" 0 "ok"; +VAL_ 1042 TAKE_CONTROL 1 "take control" 0 "ok"; +VAL_ 1042 LANE_SWAY_WARNING 3 "ok" 2 "orange please take a break" 1 "prompt would you like to take a break" 0 "ok"; +VAL_ 1042 LANE_SWAY_BUZZER 3 "ok" 2 "beep twice" 1 "beep twice" 0 "ok"; +VAL_ 1161 TSGN1 1 "speed sign" 0 "none"; +VAL_ 1161 TSGN2 1 "speed sign" 0 "none"; +VAL_ 1161 SPLSGN2 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; +VAL_ 1162 TSGN3 0 "none" 1 "speed sign" 2 "0 unlimited" 7 "unlimited" 16 "highway" 17 "no highway" 18 "motorway" 19 "no motorway" 20 "in city" 21 "outside city" 22 "pedestrian area" 23 "no pedestrian area" 65 "no overtaking left" 66 "no overtaking right" 67 "overtaking allowed again" 81 "no right turn" 97 "stop" 105 "yield" 113 "stop" 114 "yield us" 129 "no entry" 138 "no entry tss2" 145 "do not enter"; +VAL_ 1162 SPLSGN3 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none"; +VAL_ 1552 METER_SLIDER_LOW_BRIGHTNESS 1 "Low brightness mode, footwell lights off" 0 "Normal mode, footwell lights on"; +VAL_ 1552 METER_SLIDER_DIMMED 1 "Dimmed" 0 "Not Dimmed"; +VAL_ 1553 UNITS 1 "km" 2 "miles"; +VAL_ 1556 TURN_SIGNALS 3 "none" 2 "right" 1 "left"; +VAL_ 1592 LOCK_STATUS 0 "locked" 1 "unlocked"; + +CM_ "toyota_tnga_k_pt.dbc starts here"; + +BO_ 550 BRAKE_MODULE: 8 XXX + SG_ BRAKE_PRESSURE : 0|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_POSITION : 16|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_PRESSED : 37|1@0+ (1,0) [0|1] "" XXX + +BO_ 610 EPS_STATUS: 5 EPS + SG_ IPAS_STATE : 3|4@0+ (1,0) [0|15] "" XXX + SG_ LKA_STATE : 31|7@0+ (1,0) [0|127] "" XXX + SG_ TYPE : 24|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +CM_ SG_ 550 BRAKE_PRESSURE "seems prop to pedal force"; +CM_ SG_ 550 BRAKE_POSITION "seems proportional to pedal displacement, unclear the max value of 0x1c8"; +CM_ SG_ 610 TYPE "seems 1 on Corolla, 0 on all others"; + +VAL_ 610 IPAS_STATE 5 "override" 3 "enabled" 1 "disabled"; +VAL_ 610 LKA_STATE 25 "temporary_fault" 9 "temporary_fault2" 5 "active" 1 "standby"; diff --git a/opendbc/toyota_tss2_adas.dbc b/opendbc/toyota_tss2_adas.dbc new file mode 100644 index 000000000..d472debd6 --- /dev/null +++ b/opendbc/toyota_tss2_adas.dbc @@ -0,0 +1,285 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + + +BO_ 384 TRACK_A_0: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 385 TRACK_A_1: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 386 TRACK_A_2: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 387 TRACK_A_3: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 388 TRACK_A_4: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 389 TRACK_A_5: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 390 TRACK_A_6: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 391 TRACK_A_7: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 392 TRACK_A_8: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 393 TRACK_A_9: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 394 TRACK_A_10: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 395 TRACK_A_11: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 396 TRACK_A_12: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 397 TRACK_A_13: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 398 TRACK_A_14: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 399 TRACK_A_15: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ LAT_DIST : 31|11@0- (0.04,0) [-50|50] "m" XXX + SG_ LONG_DIST : 15|13@0+ (0.04,0) [0|300] "m" XXX + SG_ NEW_TRACK : 36|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 47|12@0- (0.025,0) [-100|100] "m/s" XXX + SG_ VALID : 48|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 400 TRACK_B_0: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 401 TRACK_B_1: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 402 TRACK_B_2: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 403 TRACK_B_3: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 404 TRACK_B_4: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 405 TRACK_B_5: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 406 TRACK_B_6: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 407 TRACK_B_7: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 408 TRACK_B_8: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 409 TRACK_B_9: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 410 TRACK_B_10: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 411 TRACK_B_11: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 412 TRACK_B_12: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 413 TRACK_B_13: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 414 TRACK_B_14: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 415 TRACK_B_15: 8 XXX + SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX + SG_ REL_ACCEL : 15|7@0- (1,0) [-64|63] "" XXX + SG_ SCORE : 23|8@0+ (1,0) [0|100] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 576 NEW_MSG_1: 8 XXX + SG_ NEW_SIGNAL_1 : 15|7@0+ (1,0) [0|127] "" XXX + SG_ NEW_SIGNAL_2 : 23|8@0+ (1,0) [0|255] "" XXX + +BO_ 577 NEW_MSG_2: 8 XXX + SG_ NEW_SIGNAL_1 : 15|7@0+ (1,0) [0|127] "" XXX + SG_ NEW_SIGNAL_2 : 23|8@0+ (1,0) [0|255] "" XXX diff --git a/opendbc/vw_mqb_2010.dbc b/opendbc/vw_mqb_2010.dbc new file mode 100644 index 000000000..2302035d8 --- /dev/null +++ b/opendbc/vw_mqb_2010.dbc @@ -0,0 +1,1420 @@ +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: Airbag_MQB BAP_Tester_MQB BMS_MQB Datenlogger_MQB Gateway_MQB Getriebe_DQ_Hybrid_MQB Getriebe_DQ_MQB LEH_MQB Motor_Diesel_MQB Motor_Hybrid_MQB Motor_Otto_MQB SAK_MQB Waehlhebel_MQB Vector__XXX l c i XXX + + +BO_ 290 ACC_06: 8 Gateway_MQB + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ACC_limitierte_Anfahrdyn : 12|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ACC_zul_Regelabw_unten : 16|6@1+ (0.024,0) [0|1.512] "Unit_MeterPerSeconSquar" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ACC_StartStopp_Info : 22|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ ACC_Sollbeschleunigung_02 : 24|11@1+ (0.005,-7.22) [-7.22|3.005] "Unit_MeterPerSeconSquar" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ACC_zul_Regelabw_oben : 35|5@1+ (0.0625,0) [0|1.9375] "Unit_MeterPerSeconSquar" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ACC_neg_Sollbeschl_Grad_02 : 40|8@1+ (0.05,0) [0|12.75] "Unit_MeterPerCubicSecon" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ACC_pos_Sollbeschl_Grad_02 : 48|8@1+ (0.05,0) [0|12.75] "Unit_MeterPerCubicSecon" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ACC_Anfahren : 56|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ACC_Anhalten : 57|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ACC_Typ : 58|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ACC_Status_ACC : 60|3@1+ (1,0) [0|7] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ACC_Minimale_Bremsung : 63|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + +BO_ 279 ACC_10: 8 Gateway_MQB + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" Airbag_MQB + SG_ AWV1_Anf_Prefill : 16|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ ANB_CM_Info : 17|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ AWV2_Freigabe : 18|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ AWV1_HBA_Param : 19|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ AWV2_Ruckprofil : 21|3@1+ (1,0) [0|7] "" Vector__XXX + SG_ AWV2_Priowarnung : 24|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ANB_CM_Anforderung : 25|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ ANB_Info_Teilbremsung : 26|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ANB_Notfallblinken : 27|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ANB_Teilbremsung_Freigabe : 28|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ ANB_Zielbrems_Teilbrems_Verz_Anf : 29|10@1+ (0.024,-20.016) [-20.016|4.536] "Unit_MeterPerSeconSquar" Airbag_MQB + SG_ ANB_Zielbremsung_Freigabe : 39|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ AWV_Vorstufe : 40|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ AWV_Halten : 41|1@1+ (1,0) [0|1] "" Vector__XXX + +BO_ 64 Airbag_01: 8 Airbag_MQB + SG_ Airbag_01_CRC : 0|8@1+ (1,0) [0|255] "" BMS_MQB,Gateway_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ Airbag_01_BZ : 8|4@1+ (1,0) [0|15] "" BMS_MQB,Gateway_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ AB_RGS_Anst : 12|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ AB_Front_Crash : 16|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ AB_Heck_Crash : 17|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ AB_SF_Crash : 18|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ AB_SB_Crash : 19|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ AB_Rollover_Crash : 20|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ AB_Crash_Int : 21|3@1+ (1,0) [0|7] "" BMS_MQB,Gateway_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ AB_Lampe : 24|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ AB_Deaktiviert : 25|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ AB_VB_deaktiviert : 26|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ AB_Systemfehler : 27|1@1+ (1,0) [0|1] "" BMS_MQB,Gateway_MQB,LEH_MQB + SG_ AB_Diagnose : 28|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ AB_Stellgliedtest : 29|1@1+ (1,0) [0|1] "" BMS_MQB,Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ AB_Erh_Auf_VB : 30|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ AB_Gurtwarn_VF : 32|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ AB_Gurtwarn_VB : 33|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ AB_Anzeige_Fussg : 34|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ AB_Texte_AKS : 36|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ AB_PAO_Leuchte_Anf : 38|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ AB_MKB_gueltig : 39|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ AB_MKB_Anforderung : 40|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ AB_Versorgungsspannung : 41|1@1+ (1,0) [0|1] "" Gateway_MQB + +BO_ 1312 Airbag_02: 8 Airbag_MQB + SG_ AB_Belegung_VB : 26|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ AB_Gurtschloss_FA : 40|2@1+ (1,0) [0|3] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Otto_MQB + SG_ AB_Gurtschloss_BF : 42|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ AB_Gurtschloss_Reihe2_FA : 44|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ AB_Gurtschloss_Reihe2_MI : 46|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ AB_Gurtschloss_Reihe2_BF : 48|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ AB_Gurtschloss_Reihe3_FA : 50|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ AB_Gurtschloss_Reihe3_MI : 52|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ AB_Gurtschloss_Reihe3_BF : 54|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ AB_Sitzpos_Sens_FA : 56|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ AB_Sitzpos_Sens_BF : 58|2@1+ (1,0) [0|3] "" Gateway_MQB + +BO_ 65 Airbag_03: 8 Airbag_MQB + SG_ Airbag_03_CRC : 0|8@1+ (1,0) [0|255] "" Gateway_MQB + SG_ Airbag_03_BZ : 8|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ AB_MKB_Safing : 63|1@1+ (1,0) [0|1] "" Gateway_MQB + +BO_ 1633 Anhaenger_01: 8 Gateway_MQB + SG_ AAG_BZ : 0|4@1+ (1,0) [0|15] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ AAG_Bremsl_durch_ECD : 5|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ AAG_Anhaenger_abgesteckt : 6|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ AAG_NSL_aktiv : 7|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ AAG_Anhaenger_erkannt : 8|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ AAG_Blinker_H_aktiv : 9|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ AAG_Blinker_HL_def : 10|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ AAG_Blinker_HR_def : 11|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ AAG_Bremslicht_H_def : 12|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ AAG_Schlusslicht_HL_def : 13|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ AAG_Schlusslicht_HR_def : 14|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ AAG_AVS_Fehler_02 : 18|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ AAG_AVS_Stati : 20|4@1+ (1,0) [0|15] "" Vector__XXX + +BO_ 1626 BCM_01: 8 Gateway_MQB + SG_ BCM_Bremsbelag_Sensor : 12|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BCM_Bremsfluessigkeit_Sensor : 13|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BCM1_Licht_Warn : 14|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BCM_Waschwasser_Sensor : 15|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BCM_Kuehlmittel_Sensor : 16|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ BCM1_Kl_15_HW_erkannt : 17|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BCM_Eis_Offroad_Taste : 18|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Otto_MQB + SG_ ZZH_Endlage_oben : 19|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ZZH_Endlage_unten : 20|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ZZH_Endlage_unplausibel : 21|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BCM2_EZS_gedrueckt : 22|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BCM2_SST_gedrueckt : 23|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BCM_Hybrid_StartStopp_Taste : 24|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BCM1_Warnblink_Taster : 25|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BCM1_Valet_Parking_Taster : 26|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BCM_Remotestart_Betrieb : 27|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ BCM1_HSK_Taster : 28|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BCM1_Heckrollo_Taster : 29|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BCM1_Rueckfahrlicht_Schalter : 30|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BCM1_MH_Schalter : 31|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ BCM1_MH_WIV_Schalter : 32|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BCM_Eco_Charisma_Taste : 33|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ BCM_Thermomanagement : 34|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BCM_Thermomanagement_Fehler : 36|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BCM_Thermomanagement_gueltig : 37|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BCM1_Lichtwarn_Texte : 38|2@1+ (1,0) [0|3] "" Vector__XXX + +BO_ 869 BEM_05: 8 Gateway_MQB + SG_ BEM_P_Generator : 16|8@1+ (50,0) [0|12700] "Unit_Watt" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BEM_n_LLA : 24|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BEM_01_Abschaltstufen : 26|3@1+ (1,0) [0|7] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BEM_Anf_KL : 29|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BEM_StartStopp_Info : 30|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ BEM_DFM : 32|5@1+ (3.225,0.025) [0.025|100] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BEM_EMLIN_ungueltig : 37|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BEM_Batt_Ab : 38|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BEM_Segel_Info : 48|2@1+ (1,0) [0|3] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BEM_HYB_DC_uSollLV : 50|6@1+ (0.1,10.6) [10.6|16] "Unit_Volt" LEH_MQB + SG_ BEM_HYB_DC_uMinLV : 56|8@1+ (0.1,0) [0|25.3] "Unit_Volt" LEH_MQB + +BO_ 1628 BMS_Hybrid_01: 8 BMS_MQB + SG_ BMS_HYB_ASV_hinten_Status : 13|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ BMS_HYB_ASV_vorne_Status : 14|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ BMS_HYB_KD_Fehler : 15|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ BMS_HYB_BattFanSpd : 16|4@1+ (10,0) [0|100] "Unit_PerCent" Gateway_MQB + SG_ BMS_HYB_VentilationReq : 20|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ BMS_HYB_Spuelbetrieb_Status : 21|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ BMS_HYB_Kuehlung_Anf : 22|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ BMS_HYB_Temp_vor_Verd : 24|8@1+ (0.5,-40) [-40|86.5] "Unit_DegreCelsi" Gateway_MQB + SG_ BMS_HYB_Temp_nach_Verd : 32|8@1+ (0.5,-40) [-40|86.5] "Unit_DegreCelsi" Gateway_MQB + SG_ BMS_Temperatur : 40|8@1+ (0.5,-40) [-40|86.5] "Unit_DegreCelsi" Gateway_MQB + SG_ BMS_Temperatur_Ansaugluft : 48|8@1+ (0.5,-40) [-40|86.5] "Unit_DegreCelsi" Gateway_MQB + SG_ BMS_IstSpannung_HV : 56|8@1+ (1,100) [100|350] "Unit_Volt" Gateway_MQB + +BO_ 901 Charisma_01: 8 Gateway_MQB + SG_ CHA_Ziel_FahrPr_ALR : 0|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ CHA_Ziel_FahrPr_ESP : 4|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ CHA_Ziel_FahrPr_FL : 8|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ CHA_Fahrer_Umschaltung : 14|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB,SAK_MQB + SG_ CHA_Ziel_FahrPr_MO : 16|4@1+ (1,0) [0|15] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ CHA_Ziel_FahrPr_GE : 20|4@1+ (1,0) [0|15] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ CHA_Ziel_FahrPr_ST : 24|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ CHA_Ziel_FahrPr_SCU : 28|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ CHA_Ziel_FahrPr_DR : 32|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ CHA_Ziel_FahrPr_QS : 36|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ CHA_Ziel_FahrPr_AFS : 40|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ CHA_Ziel_FahrPr_RGS : 44|4@1+ (1,0) [0|15] "" Airbag_MQB + SG_ CHA_Ziel_FahrPr_EPS : 48|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ CHA_Ziel_FahrPr_ACC : 52|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ CHA_Ziel_FahrPr_SAK : 56|4@1+ (1,0) [0|15] "" SAK_MQB + SG_ CHA_Ziel_FahrPr_MStSt : 60|4@1+ (1,0) [0|15] "" Vector__XXX + +BO_ 945 DC_Hybrid_01: 8 LEH_MQB + SG_ DC_HYB_iAktLV : 12|10@1+ (1,-511) [-511|510] "Unit_Amper" Gateway_MQB + SG_ DC_HYB_iAktReserveLV : 22|10@1+ (1,-511) [-511|510] "Unit_Amper" Gateway_MQB + SG_ DC_HYB_uAktLV : 32|8@1+ (0.1,0) [0|25.3] "Unit_Volt" Gateway_MQB + SG_ DC_HYB_LangsRegelung : 40|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ DC_HYB_Abregelung_Temperatur : 41|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ DC_HYB_Fehler_RedLeistung : 42|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ DC_HYB_Fehler_intern : 43|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ DC_HYB_Fehler_Spannung : 44|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ DC_HYB_Auslastungsgrad : 56|8@1+ (0.4,0) [0|100] "Unit_PerCent" Gateway_MQB + +BO_ 1714 Diagnose_01: 8 Gateway_MQB + SG_ DGN_Verlernzaehler : 0|8@1+ (1,0) [0|254] "" Airbag_MQB,BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,SAK_MQB + SG_ KBI_Kilometerstand : 8|20@1+ (1,0) [0|1048573] "Unit_KiloMeter" Airbag_MQB,BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB,SAK_MQB + SG_ UH_Jahr : 28|7@1+ (1,2000) [2000|2127] "Unit_Year" Airbag_MQB,BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB,SAK_MQB + SG_ UH_Monat : 35|4@1+ (1,0) [1|12] "Unit_Month" Airbag_MQB,BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB,SAK_MQB + SG_ UH_Tag : 39|5@1+ (1,0) [1|31] "Unit_Day" Airbag_MQB,BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB,SAK_MQB + SG_ UH_Stunde : 44|5@1+ (1,0) [0|23] "Unit_Hours" Airbag_MQB,BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB,SAK_MQB + SG_ UH_Minute : 49|6@1+ (1,0) [0|59] "Unit_Minut" Airbag_MQB,BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB,SAK_MQB + SG_ UH_Sekunde : 55|6@1+ (1,0) [0|59] "Unit_Secon" Airbag_MQB,BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB,SAK_MQB + SG_ Kombi_02_alt : 62|1@1+ (1,0) [0|1] "" Airbag_MQB,BMS_MQB,LEH_MQB + SG_ Uhrzeit_01_alt : 63|1@1+ (1,0) [0|1] "" Airbag_MQB,BMS_MQB,LEH_MQB + +BO_ 1520 Dimmung_01: 8 Gateway_MQB + SG_ DI_KL_58xd : 0|8@1+ (1,0) [0|253] "" Airbag_MQB + SG_ DI_KL_58xs : 8|7@1+ (1,0) [0|100] "Unit_PerCent" Vector__XXX + SG_ DI_Display_Nachtdesign : 15|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ DI_KL_58xt : 16|7@1+ (1,0) [0|100] "Unit_PerCent" Vector__XXX + SG_ DI_Fotosensor : 24|16@1+ (1,0) [0|65535] "" Vector__XXX + +BO_ 1603 Einheiten_01: 8 Gateway_MQB + SG_ KBI_Einheit_Datum : 0|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ KBI_Einheit_Druck : 2|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ KBI_Einheit_Streckenanz : 4|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB + SG_ KBI_MFA_v_Einheit_02 : 5|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_Einheit_Temp : 6|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_Einheit_Uhrzeit : 7|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_Einheit_Verbrauch : 8|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ KBI_Einheit_Volumen : 10|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ KBI_Einheit_Sprache : 16|8@1+ (1,0) [0|255] "" Vector__XXX + +BO_ 260 EPB_01: 8 Gateway_MQB + SG_ EPB_01_CRC : 0|8@1+ (1,0) [0|255] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ EPB_01_BZ : 8|4@1+ (1,0) [0|15] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ EPB_QBit_Laengsbeschleunigung : 12|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ EPB_QBit_Pedalweg_Kuppl : 13|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ EPB_BCM2_Motor_Wakeup : 14|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ EPB_Freig_Verzoeg_Anf : 15|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ EPB_Verzoeg_Anf : 16|8@1+ (0.048,-7.968) [-7.968|4.224] "Unit_MeterPerSeconSquar" Vector__XXX + SG_ EPB_Laengsbeschleunigung : 24|8@1+ (1,-128) [-128|126] "Unit_PerCentOfForceOfGravi" Vector__XXX + SG_ EPB_Pedalweg_Kuppl : 32|8@1+ (0.4,0) [8|92] "Unit_PerCent" Vector__XXX + SG_ EPB_Anfahrwunsch_erkannt : 48|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ EPB_DAA_Randbed_erf : 49|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ EPB_Fehlerstatus : 50|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ EPB_Schalterposition : 52|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ EPB_QBit_Schalterpos : 54|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ EPB_Konsistenz_ACC : 55|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ EPB_Spannkraft : 56|5@1+ (1,0) [0|29] "Unit_KiloNewto" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ EPB_Status : 61|2@1+ (1,0) [0|3] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + +BO_ 257 ESP_02: 8 Gateway_MQB + SG_ ESP_02_CRC : 0|8@1+ (1,0) [0|255] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_02_BZ : 8|4@1+ (1,0) [0|15] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_QBit_Gierrate : 12|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ ESP_QBit_Laengsbeschl : 13|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_QBit_Querb : 14|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Stillstandsflag : 15|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_Querbeschleunigung : 16|8@1+ (0.01,-1.27) [-1.27|1.27] "Unit_ForceOfGravi" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Laengsbeschl : 24|10@1+ (0.03125,-16) [-16|15.90625] "Unit_MeterPerSeconSquar" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Verteil_Wankmom : 34|5@1+ (0.1,-1) [-1|1] "" Vector__XXX + SG_ ESP_QBit_Anf_Vert_Wank : 39|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_Gierrate : 40|14@1+ (0.01,0) [0|163.82] "Unit_DegreOfArcPerSecon" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ ESP_VZ_Gierrate : 54|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ ESP_Notbremsanzeige : 55|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ ESP_SpannungsAnf : 56|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_PLA_Abbruch : 57|3@1+ (1,0) [0|7] "" Vector__XXX + SG_ ESP_Status_ESP_PLA : 60|4@1+ (1,0) [0|15] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + +BO_ 262 ESP_05: 8 Gateway_MQB + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_QBit_Bremsdruck : 12|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_QBit_Fahrer_bremst : 13|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Schwelle_Unterdruck : 14|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Bremsdruck : 16|10@1+ (0.3,-30) [-30|276.6] "Unit_Bar" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Fahrer_bremst : 26|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Verz_TSK_aktiv : 27|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Lenkeingriff_ADS : 28|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Konsistenz_TSK : 29|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Bremsruck_AWV2 : 30|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Konsistenz_AWV2 : 31|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ECD_Fehler : 32|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ECD_nicht_verfuegbar : 33|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Status_Bremsentemp : 34|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Autohold_Standby : 35|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_HDC_Standby : 36|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ ESP_HBA_aktiv : 37|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_Prefill_ausgeloest : 38|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Rueckwaertsfahrt_erkannt : 39|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_Status_Anfahrhilfe : 40|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_HDC_aktiv : 41|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ ESP_StartStopp_Info : 42|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ ESP_Eingr_HL : 44|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_Eingr_HR : 45|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_Eingr_VL : 46|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_Eingr_VR : 47|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_BKV_Unterdruck : 48|8@1+ (4,0) [0|1012] "Unit_MilliBar" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Autohold_aktiv : 56|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_FStatus_Anfahrhilfe : 57|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ ESP_Verz_EPB_aktiv : 58|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ECD_Bremslicht : 59|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Verzoeg_EPB_verf : 60|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_Status_Bremsdruck : 61|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Anforderung_EPB : 62|2@1+ (1,0) [0|3] "" Vector__XXX + +BO_ 914 ESP_07: 8 Gateway_MQB + SG_ ESP_07_CRC : 0|8@1+ (1,0) [0|255] "" Airbag_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_07_BZ : 8|4@1+ (1,0) [0|15] "" Airbag_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_ACC_LDE : 12|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_Quattro_Antrieb : 13|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_Codierung_ADS : 14|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ ESP_RTA_HL : 16|8@1+ (0.048828125,-6.20117) [-6.20117|6.152345625] "Unit_PerCent" Vector__XXX + SG_ ESP_RTA_HR : 24|8@1+ (0.048828125,-6.20117) [-6.20117|6.152345625] "Unit_PerCent" Vector__XXX + SG_ ESP_RTA_VR : 32|8@1+ (0.048828125,-6.20117) [-6.20117|6.152345625] "Unit_PerCent" Vector__XXX + SG_ OBD_Fehler_Radsensor_HL : 40|4@1+ (1,0) [0|15] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ OBD_Fehler_Radsensor_HR : 44|4@1+ (1,0) [0|15] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ OBD_Fehler_Radsensor_VL : 48|4@1+ (1,0) [0|15] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ OBD_Fehler_Radsensor_VR : 52|4@1+ (1,0) [0|15] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Qualifizierung_Antriebsart : 56|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_Offroad_Modus : 57|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_MKB_ausloesbar : 58|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ ESP_MKB_Status : 59|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ ESP_CM_Variante : 60|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ESP_OBD_Status : 61|1@1+ (1,0) [0|1] "" Vector__XXX + +BO_ 278 ESP_10: 8 Gateway_MQB + SG_ ESP_10_CRC : 0|8@1+ (1,0) [0|255] "" Airbag_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_10_BZ : 8|4@1+ (1,0) [0|15] "" Airbag_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_QBit_Wegimpuls_VL : 12|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_QBit_Wegimpuls_VR : 13|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_QBit_Wegimpuls_HL : 14|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_QBit_Wegimpuls_HR : 15|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Wegimpuls_VL : 16|10@1+ (1,0) [0|1000] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Wegimpuls_VR : 26|10@1+ (1,0) [0|1000] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Wegimpuls_HL : 36|10@1+ (1,0) [0|1000] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Wegimpuls_HR : 46|10@1+ (1,0) [0|1000] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_VL_Fahrtrichtung : 56|2@1+ (1,0) [0|3] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_VR_Fahrtrichtung : 58|2@1+ (1,0) [0|3] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_HL_Fahrtrichtung : 60|2@1+ (1,0) [0|3] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_HR_Fahrtrichtung : 62|2@1+ (1,0) [0|3] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + +BO_ 178 ESP_19: 8 Gateway_MQB + SG_ ESP_HL_Radgeschw_02 : 0|16@1+ (0.0075,0) [0|491.49] "Unit_KiloMeterPerHour" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_HR_Radgeschw_02 : 16|16@1+ (0.0075,0) [0|491.49] "Unit_KiloMeterPerHour" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_VL_Radgeschw_02 : 32|16@1+ (0.0075,0) [0|491.49] "Unit_KiloMeterPerHour" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_VR_Radgeschw_02 : 48|16@1+ (0.0075,0) [0|491.49] "Unit_KiloMeterPerHour" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + +BO_ 1629 ESP_20: 8 Gateway_MQB + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ BR_Systemart : 12|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ ESP_Zaehnezahl : 16|8@1+ (1,0) [0|255] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ ESP_Charisma_FahrPr : 24|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ ESP_Charisma_Status : 28|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ BR_QBit_Reifenumfang : 51|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ BR_Reifenumfang : 52|12@1+ (1,0) [0|4095] "Unit_MilliMeter" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + +BO_ 253 ESP_21: 8 Gateway_MQB + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" Airbag_MQB,BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BR_Eingriffsmoment : 12|10@1+ (1,-509) [-509|509] "Unit_NewtoMeter" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_v_Signal : 32|16@1+ (0.01,0) [0|655.32] "Unit_KiloMeterPerHour" Airbag_MQB,BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB,SAK_MQB + SG_ ASR_Tastung_passiv : 48|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Tastung_passiv : 49|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Systemstatus : 50|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ASR_Schalteingriff : 51|2@1+ (1,0) [0|3] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ ESP_Haltebestaetigung : 53|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_QBit_v_Signal : 55|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ABS_Bremsung : 56|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ASR_Anf : 57|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ MSR_Anf : 58|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ EBV_Eingriff : 59|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ EDS_Eingriff : 60|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Eingriff : 61|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_ASP : 62|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ESP_Anhaltevorgang_ACC_aktiv : 63|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + +BO_ 987 Gateway_72: 8 Gateway_MQB + SG_ BCM_01_alt : 0|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ SMLS_01_alt : 1|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ ZV_02_alt : 2|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ Wischer_01_alt : 3|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ Anhaenger_01_alt : 4|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ Klima_Sensor_02_alt : 5|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ VSG_01_alt : 6|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ Klima_01_alt : 7|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ WFS_01_alt : 8|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ Licht_Anf_01_alt : 9|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ZV_HFS_offen : 20|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ZV_HBFS_offen : 21|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ VS_VD_offen_ver : 22|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ VS_VD_zu_ver : 23|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ZV_BT_offen : 24|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BCM1_Rueckfahrlicht_Schalter : 25|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ ZV_FT_offen : 26|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ Wischer_vorne_aktiv : 27|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ AAG_Anhaenger_erkannt : 28|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ BCM1_MH_Schalter : 29|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ZV_HD_offen : 30|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ Waschen_vorne_aktiv : 31|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KL_Thermomanagement : 32|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ WFS_Schluessel_Fahrberecht : 34|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ BCM1_RFahrlicht_Fzg_Anf : 38|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BCM1_RFahrlicht_Ahg_Anf : 39|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BH_Fernlicht : 49|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ BH_Blinker_li : 50|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ BH_Blinker_re : 51|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ BCM1_OBD_FStatus_ATemp : 52|4@1+ (1,0) [0|15] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BCM1_Aussen_Temp_ungef : 56|8@1+ (0.5,-50) [-50|76] "Unit_DegreCelsi" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + +BO_ 989 Gateway_74: 8 Gateway_MQB + SG_ LH_EPS_01_alt : 0|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB + SG_ Kessy_04_alt : 1|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ LIN_2_alt : 2|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MFG_01_alt : 3|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ GW_74_va_14 : 4|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ Klima_02_alt : 5|1@1+ (1,0) [0|1] "" BMS_MQB + SG_ Parkhilfe_01_alt : 6|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ ELV_01_alt : 7|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KY_StartStopp_Info : 16|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ PH_StartStopp_Info : 18|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ EPS_Lenkerposition : 20|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB + SG_ ELV_Anf_Klemme_50 : 22|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ MF_StartStopp_Info : 25|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ KL_Geblaesespannung_Soll : 40|8@1+ (0.05,0.5) [2|13] "Unit_Volt" BMS_MQB + SG_ KL_Umluftklappe_Status : 48|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ MFL_Tip_Down : 56|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MFL_Tip_Up : 57|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ LS_Tiptronic_Fehler : 58|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + +BO_ 296 Getriebe_06: 3 Getriebe_DQ_Hybrid_MQB + SG_ GE_WH_Sperre : 0|1@1+ (1,0) [0|1] "" Waehlhebel_MQB + SG_ GE_Ausleuchtungsmode : 1|1@1+ (1,0) [0|1] "" Waehlhebel_MQB + SG_ GE_Test_Freigabe : 2|1@1+ (1,0) [0|1] "" Waehlhebel_MQB + SG_ GE_Ist_Fahrstufe : 4|4@1+ (1,0) [0|15] "" Waehlhebel_MQB + SG_ GE_Testparameter_1 : 8|8@1+ (1,0) [0|255] "" Waehlhebel_MQB + SG_ GE_Testparameter_2 : 16|8@1+ (1,0) [0|255] "" Waehlhebel_MQB + +BO_ 173 Getriebe_11: 8 Getriebe_DQ_Hybrid_MQB + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ COUNTERXX : 8|4@1+ (1,0) [0|15] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_MMom_Soll_02 : 12|10@1+ (1,-509) [-509|509] "Unit_NewtoMeter" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_MMom_Vorhalt_02 : 22|10@1+ (1,-509) [-509|509] "Unit_NewtoMeter" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Uefkt : 32|10@1+ (0.1,0) [0|102.2] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Fahrstufe : 42|5@1+ (1,0) [0|31] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Schaltvorgang : 47|1@1+ (1,0) [0|1] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Status_Kupplung : 54|2@1+ (1,0) [0|3] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_MMom_Status : 56|2@1+ (1,0) [0|3] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Freig_MMom_Vorhalt : 58|1@1+ (1,0) [0|1] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Verbot_Ausblendung : 59|1@1+ (1,0) [0|1] "" Gateway_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Zielgang : 60|4@1+ (1,0) [0|15] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + +BO_ 174 Getriebe_12: 8 Getriebe_DQ_Hybrid_MQB + SG_ Getriebe_12_CRC : 0|8@1+ (1,0) [0|255] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ Getriebe_12_BZ : 8|4@1+ (1,0) [0|15] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Drehzahlmesser_Daempfung : 12|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Schubabschalt_Unt : 13|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Freigabe_Synchro : 14|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Synchro_Wunschdrehz : 15|9@1+ (25,0) [0|12750] "Unit_MinutInver" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Synchro_Zeit : 24|8@1+ (20,0) [0|5080] "Unit_MilliSecon" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Mom_Begr_Gradient : 32|8@1+ (10,0) [0|2540] "Unit_NewtoMeterPerSecon" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Anheb_Solldrehz_Leerlauf : 40|8@1+ (10,0) [0|2540] "Unit_MinutInver" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Aufnahmemoment : 48|10@1+ (1,-509) [-509|509] "Unit_NewtoMeter" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Anf_Zylabsch : 58|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ GE_HYB_DZ_Eingriff : 62|2@1+ (1,0) [0|3] "" Motor_Hybrid_MQB + +BO_ 301 Getriebe_13: 8 Getriebe_DQ_Hybrid_MQB + SG_ Getriebe_13_CRC : 0|8@1+ (1,0) [0|255] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ Getriebe_13_BZ : 8|4@1+ (1,0) [0|15] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_StartStopp_Info : 12|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ GE_Langfr_Schutzmom_02 : 14|9@1+ (1,0) [0|509] "Unit_NewtoMeter" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Eingangsdrehz : 48|14@1+ (1,0) [0|16381] "Unit_MinutInver" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Notlauf : 62|1@1+ (1,0) [0|1] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Freig_Langfr_Schutzmom : 63|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + +BO_ 968 Getriebe_14: 8 Getriebe_DQ_Hybrid_MQB + SG_ GE_OBD_AbsperrVent : 12|4@1+ (1,0) [0|15] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_amax_moeglich : 16|9@1+ (0.024,-2.016) [-2.016|10.224] "Unit_MeterPerSeconSquar" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Charisma_FahrPr : 25|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ GE_Charisma_Status : 29|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ GE_Verlustmoment : 32|8@1+ (1,0) [0|254] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Freigabe_Verfallsinfo_WFS : 49|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ GE_Codierung_MSG : 50|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ GE_LaunchControl : 51|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ GE_Heizwunsch : 52|2@1+ (1,0) [0|3] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_OBD_Status : 54|1@1+ (1,0) [0|1] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_LFR_Adaption : 55|1@1+ (1,0) [0|1] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GE_Sumpftemperatur : 56|8@1+ (1,-58) [-58|196] "Unit_DegreCelsi" Gateway_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + +BO_ 158 Getriebe_Hybrid_01: 8 Getriebe_DQ_Hybrid_MQB + SG_ Getriebe_Hybrid_01_CRC : 0|8@1+ (1,0) [0|255] "" Motor_Hybrid_MQB + SG_ Getriebe_Hybrid_01_BZ : 8|4@1+ (1,0) [0|15] "" Motor_Hybrid_MQB + SG_ GE_HYB_Fehlerstatus : 12|2@1+ (1,0) [0|3] "" Motor_Hybrid_MQB + SG_ GE_HYB_Freigabe_K0 : 16|1@1+ (1,0) [0|1] "" Motor_Hybrid_MQB + SG_ GE_HYB_Freigabe_LL_Reg : 17|1@1+ (1,0) [0|1] "" Motor_Hybrid_MQB + SG_ GE_HYB_Freig_sSchl_K0 : 18|1@1+ (1,0) [0|1] "" Motor_Hybrid_MQB + SG_ GE_HYB_Freig_VM_EM_Stop : 19|1@1+ (1,0) [0|1] "" Motor_Hybrid_MQB + SG_ GE_HYB_Wiederstart : 20|1@1+ (1,0) [0|1] "" Motor_Hybrid_MQB + SG_ GE_HYB_Filt_MomAufbau : 21|3@1+ (1,0) [0|7] "" Motor_Hybrid_MQB + SG_ GE_HYB_nK0 : 24|8@1+ (25,0) [0|6350] "Unit_MinutInver" Vector__XXX + SG_ GE_HYB_MomEingriff_EM : 32|6@1+ (0.5,0) [0|31.5] "Unit_NewtoMeter" LEH_MQB + SG_ GE_HYB_VZ_MomEingriff_EM : 38|1@1+ (1,0) [0|1] "" LEH_MQB + SG_ GE_HYB_Sportfaktor : 56|4@1+ (1,0) [0|15] "" Motor_Hybrid_MQB + SG_ GE_HYB_VM_akt_halten : 61|1@1+ (1,0) [0|1] "" Motor_Hybrid_MQB + SG_ GE_HYB_StartAnf : 62|1@1+ (1,0) [0|1] "" Motor_Hybrid_MQB + SG_ GE_HYB_VM_Startkontr : 63|1@1+ (1,0) [0|1] "" Motor_Hybrid_MQB + +BO_ 299 GRA_ACC_01: 8 Gateway_MQB + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GRA_Hauptschalter : 12|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GRA_Abbrechen : 13|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GRA_Typ_Hauptschalter : 14|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GRA_Limiter : 15|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GRA_Tip_Setzen : 16|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GRA_Tip_Hoch : 17|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GRA_Tip_Runter : 18|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GRA_Tip_Wiederaufnahme : 19|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GRA_Verstellung_Zeitluecke : 20|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GRA_Codierung : 22|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GRA_Fehler : 24|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GRA_Typ468 : 25|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GRA_Tip_Stufe_2 : 27|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ GRA_ButtonTypeInfo : 28|2@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + +BO_ 960 Klemmen_Status_01: 4 Gateway_MQB + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" Airbag_MQB,BMS_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" Airbag_MQB,BMS_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ZAS_Kl_S : 16|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ZAS_Kl_15 : 17|1@1+ (1,0) [0|1] "" Airbag_MQB,BMS_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ ZAS_Kl_X : 18|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ ZAS_Kl_50 : 19|1@1+ (1,0) [0|1] "" Vector__XXX + +BO_ 949 Klima_11: 8 Gateway_MQB + SG_ KL_Drehz_Anh : 0|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KL_Vorwarn_Komp_ein : 1|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KL_AC_Schalter : 2|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KL_Komp_Moment_alt : 3|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KL_Zonen : 4|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KL_Vorwarn_Zuheizer_ein : 6|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KL_Zustand : 7|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KL_Comp_rev_rq : 8|8@1+ (50,0) [0|8600] "Unit_MinutInver" Vector__XXX + SG_ KL_Charisma_FahrPr : 16|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ KL_Charisma_Status : 20|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ KL_Comp_enable : 23|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KL_Last_Kompr : 24|8@1+ (0.25,0) [0|63.5] "Unit_NewtoMeter" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KL_Spannungs_Anf : 32|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ KL_Thermomanagement : 34|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KL_StartStopp_Info : 36|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ KL_Anf_KL : 40|8@1+ (0.4,0) [0|101.6] "Unit_PerCent" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KL_el_Zuheizer_Stufe : 48|3@1+ (1,0) [0|7] "" Motor_Diesel_MQB + +BO_ 1625 Klimakomp_01: 8 Gateway_MQB + SG_ EKL_KD_Fehler : 15|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ EKL_Comp_SCI_com_stat : 16|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ EKL_Comp_output_stat : 18|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ EKL_Comp_main_stat : 20|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ EKL_Comp_ovld_stat : 21|3@1+ (1,0) [0|7] "" Vector__XXX + SG_ EKL_Comp_Inv_stat : 24|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ EKL_Comp_photo_temp_stat : 30|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ EKL_Comp_photo_temp : 32|8@1+ (1,0) [0|254] "Unit_DegreCelsi" Vector__XXX + SG_ EKL_Comp_current : 40|8@1+ (0.1,0) [0|25.4] "Unit_Amper" Motor_Hybrid_MQB + SG_ EKL_Comp_rev_stat : 48|8@1+ (50,0) [0|8600] "Unit_MinutInver" Vector__XXX + +BO_ 2549088277 KN_Airbag_01: 8 Airbag_MQB + SG_ Airbag_01_KompSchutz : 0|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ Airbag_01_Nachlauftyp : 4|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ AB_KD_Fehler : 63|1@1+ (1,0) [0|1] "" Gateway_MQB + +BO_ 2549088380 KN_EMotor_01: 8 LEH_MQB + SG_ EMotor_KompSchutz : 0|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ EMotor_Nachlauftyp : 4|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ EM_HYB_KD_Fehler : 63|1@1+ (1,0) [0|1] "" Gateway_MQB + +BO_ 2549088375 KN_Getriebe_01: 8 Getriebe_DQ_Hybrid_MQB + SG_ Getriebe_KompSchutz : 0|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ Getriebe_Nachlauftyp : 4|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ GE_KD_Fehler : 63|1@1+ (1,0) [0|1] "" Gateway_MQB + +BO_ 2549088379 KN_Hybrid_01: 8 BMS_MQB + SG_ Hybrid_KompSchutz : 0|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ Hybrid_Nachlauftyp : 4|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ BMS_HYB_KD_Fehler : 63|1@1+ (1,0) [0|1] "" Gateway_MQB + +BO_ 2549088374 KN_MO_01: 8 Motor_Diesel_MQB + SG_ Motor_KompSchutz : 0|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ Motor_Nachlauftyp : 4|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ MO_KD_Fehler : 63|1@1+ (1,0) [0|1] "" Gateway_MQB + +BO_ 2549088284 KN_SAK: 8 SAK_MQB + SG_ SAK_KompSchutz : 0|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SAK_Nachlauftyp : 4|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ SAK_KD_Fehler : 63|1@1+ (1,0) [0|1] "" Gateway_MQB + +BO_ 779 Kombi_01: 8 Gateway_MQB + SG_ KBI_ABS_Lampe : 0|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_ESP_Lampe : 1|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_BKL_Lampe : 2|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_Airbag_Lampe : 3|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ KBI_SILA_gueltig : 4|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ KBI_Lenkung_Lampe : 5|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_Vorglueh_System_Lampe : 6|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB + SG_ KBI_NV_in_Anzeige : 7|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ Kombi_01_BZ : 8|4@1+ (1,0) [0|15] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KBI_Anzeigestatus_ACC : 12|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_Anzeigestatus_GRA : 13|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KBI_Oeldruck_Schalter : 15|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_Tankwarnung : 16|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KBI_MFA_v_Einheit_01 : 17|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KBI_im_Stellgliedtest : 18|1@1+ (1,0) [0|1] "" Airbag_MQB + SG_ KBI_Anzeigefehler_LDW : 19|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ KBI_Variante_USA : 21|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_Oeldruckwarnung : 22|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_Handbremse : 23|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ KBI_V_Digital : 24|9@1+ (1,0) [0|511] "" Vector__XXX + SG_ KBI_PLA_in_Anzeige : 33|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_Anzeigefehler_NV : 34|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_Anzeigestatus_LIM : 35|2@1+ (1,0) [0|3] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KBI_angez_Geschw : 48|10@1+ (0.32,0) [0|325.12] "Unit_KiloMeterPerHour" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KBI_Einheit_Tacho : 58|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KBI_Konsistenz_ACC : 59|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_Fehler_Anzeige_ACC : 60|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ KBI_Anzeigefehler_SWA : 61|2@1+ (1,0) [0|3] "" Vector__XXX + +BO_ 1719 Kombi_02: 8 Gateway_MQB + SG_ KBI_Kilometerstand : 0|20@1+ (1,0) [0|1048573] "Unit_KiloMeter" Vector__XXX + SG_ KBI_Standzeit_02 : 20|17@1+ (1,0) [0|131068] "Unit_Secon" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KBI_Inhalt_Tank : 40|7@1+ (1,0) [0|125] "Unit_Liter" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KBI_FStatus_Tank : 47|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KBI_QBit_Aussen_Temp_gef : 55|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ KBI_Aussen_Temp_gef : 56|8@1+ (0.5,-50) [-50|75] "Unit_DegreCelsi" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + +BO_ 982 Licht_hinten_01: 8 Gateway_MQB + SG_ Licht_hinten_01_BZ : 0|4@1+ (1,0) [0|15] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ BCM2_Bremsl_durch_ECD : 5|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ LH_Aussenlicht_def : 7|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Standlicht_H_aktiv : 8|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Parklicht_HL_aktiv : 9|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Parklicht_HR_aktiv : 10|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Bremslicht_H_aktiv : 11|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Nebelschluss_aktiv : 12|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Rueckfahrlicht_aktiv : 13|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Blinker_HL_akt : 14|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Blinker_HR_akt : 15|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Blinker_li_def : 16|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Bremsl_li_def : 17|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Schlusslicht_li_def : 18|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Rueckf_li_def : 19|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Nebel_li_def : 20|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Schluss_Brems_Nebel_li_def : 21|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Schluss_Brems_Nebel_re_def : 22|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Schluss_Brems_li_def : 24|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Schluss_Nebel_li_def : 25|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_SL_BRL_BLK_li_def : 26|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Brems_Blk_li_def : 27|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Blinker_re_def : 32|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Bremsl_re_def : 33|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Schlusslicht_re_def : 34|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Rueckf_re_def : 35|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Nebel_re_def : 36|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Schluss_Brems_re_def : 40|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Schluss_Nebel_re_def : 41|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_SL_BRL_BLK_re_def : 42|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Brems_Blk_re_def : 43|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Kennzl_def : 48|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_3_Bremsl_def : 49|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ LH_Nebel_mi_def : 50|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Rueckf_mi_def : 51|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LH_Bremsl_li_ges_def : 54|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ LH_Bremsl_re_ges_def : 55|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + +BO_ 134 LWI_01: 8 Gateway_MQB + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ LWI_Sensorstatus : 12|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ LWI_QBit_Sub_Daten : 13|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LWI_QBit_Lenkradwinkel : 15|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ LWI_Lenkradwinkel : 16|13@1+ (0.1,0) [0|800] "Unit_DegreOfArc" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ LWI_VZ_Lenkradwinkel : 29|1@1+ (1,0) [0|1] "" Airbag_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ LWI_VZ_Lenkradw_Geschw : 30|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ LWI_Lenkradw_Geschw : 31|9@1+ (5,0) [0|2500] "Unit_DegreOfArcPerSecon" Vector__XXX + SG_ LWI_Sub_Daten : 40|16@1+ (1,0) [0|65535] "" Vector__XXX + +BO_ 263 Motor_04: 8 Motor_Diesel_MQB + SG_ MO_Istgang : 8|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ MO_Sollgang : 12|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ MO_Oeldruck : 16|8@1+ (0.04,0) [0|10] "Unit_Bar" Gateway_MQB + SG_ MO_Anzeigedrehz : 24|12@1+ (3,0) [0|12282] "Unit_MinutInver" Gateway_MQB + SG_ MO_Schaltempf_verfbar : 38|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Ladedruck : 39|9@1+ (0.01,0) [0|5.1] "Unit_Bar" Gateway_MQB + SG_ MO_KVS : 48|15@1+ (1,0) [0|32767] "Unit_MicroLiter" Gateway_MQB + SG_ MO_KVS_Ueberlauf : 63|1@1+ (1,0) [0|1] "" Gateway_MQB + +BO_ 1600 Motor_07: 8 Motor_Diesel_MQB + SG_ MO_QBit_Ansaugluft_Temp : 0|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_QBit_Oel_Temp : 1|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_QBit_Kuehlmittel_Temp : 2|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB + SG_ MO_Stellgliedtest_Soundaktuator : 3|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_HYB_Fehler_HV_Netz : 4|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_aktives_Getriebeheizen : 5|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Absperrventil_oeffnen : 6|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ MO_Ansaugluft_Temp : 8|8@1+ (0.75,-48) [-48|141.75] "Unit_DegreCelsi" Gateway_MQB + SG_ MO_Oel_Temp : 16|8@1+ (1,-60) [-60|192] "Unit_DegreCelsi" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Kuehlmittel_Temp : 24|8@1+ (0.75,-48) [-48|141.75] "Unit_DegreCelsi" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB + SG_ MO_Hoeheninfo : 32|8@1+ (0.00781,0) [0|1.98374] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Kennfeldk : 40|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Versionsinfo : 41|6@1+ (1,0) [0|63] "" Gateway_MQB + SG_ MO_Getriebe_kuehlen : 47|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Mom_Traegheit_02 : 48|5@1+ (0.01,0) [0|0.31] "Unit_KiloGramMeterSquar" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Heizungspumpenansteuerung : 53|4@1+ (10,0) [0|100] "Unit_PerCent" Gateway_MQB + SG_ MO_SpannungsAnf : 57|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Nachlaufzeit_Heizungspumpe : 58|6@1+ (15,0) [0|945] "Unit_Secon" Gateway_MQB + +BO_ 1607 Motor_09: 8 Motor_Diesel_MQB + SG_ MO_ITM_Kuehlmittel_Temp : 0|8@1+ (0.75,-48) [-45.75|143.25] "Unit_DegreCelsi" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_E85_Sensor : 8|4@1+ (10,0) [0|100] "Unit_PerCent" Gateway_MQB + SG_ SCR_Anz_Motorstarts : 12|4@1+ (1,0) [0|8] "" Gateway_MQB + SG_ SCR_Reichweite : 16|15@1+ (1,0) [0|32766] "" Gateway_MQB + SG_ SCR_Warnstufe_1 : 32|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ SCR_Warnstufe_2 : 33|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ SCR_Text : 34|3@1+ (1,0) [0|7] "" Gateway_MQB + SG_ SCR_Akustik : 37|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ MO_Kraftstofffilter_Wasser : 40|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ SCR_Systemfehler : 41|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ SCR_Inducement_Strategie : 42|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ MO_CO2_Faktor : 44|12@1+ (1,0) [1|4094] "Unit_GramPerLiter" Gateway_MQB + +BO_ 167 Motor_11: 8 Motor_Diesel_MQB + SG_ Motor_11_CRC : 0|8@1+ (1,0) [0|255] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ Motor_11_BZ : 8|4@1+ (1,0) [0|15] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Mom_Soll_Roh : 12|10@1+ (1,-509) [-509|509] "Unit_NewtoMeter" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Mom_Ist_Summe : 22|10@1+ (1,-509) [-509|509] "Unit_NewtoMeter" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,SAK_MQB + SG_ MO_Mom_Traegheit_Summe : 32|10@1+ (1,-509) [-509|509] "Unit_NewtoMeter" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Mom_Soll_gefiltert : 42|10@1+ (1,-509) [-509|509] "Unit_NewtoMeter" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Mom_Schub : 52|9@1+ (1,-509) [-509|0] "Unit_NewtoMeter" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Status_Normalbetrieb_01 : 61|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_erste_Ungenauschwelle : 62|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_QBit_Motormomente : 63|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + +BO_ 168 Motor_12: 8 Motor_Diesel_MQB + SG_ Motor_12_CRC : 0|8@1+ (1,0) [0|255] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB + SG_ Motor_12_BZ : 8|4@1+ (1,0) [0|15] "" BMS_MQB,Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB + SG_ MO_Mom_neg_verfuegbar : 12|9@1+ (1,-509) [-509|0] "Unit_NewtoMeter" Gateway_MQB + SG_ MO_Mom_Begr_stat : 21|9@1+ (1,0) [0|509] "Unit_NewtoMeter" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Mom_Begr_dyn : 30|10@1+ (1,-509) [-509|509] "Unit_NewtoMeter" Gateway_MQB + SG_ MO_Momentenintegral_02 : 40|7@1+ (1,0) [0|100] "Unit_PerCent" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_QBit_Drehzahl_01 : 47|1@1+ (1,0) [0|1] "" BMS_MQB,Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB + SG_ MO_Drehzahl_01 : 48|16@1+ (0.25,0) [0|16383] "Unit_MinutInver" BMS_MQB,Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,SAK_MQB + +BO_ 958 Motor_14: 8 Motor_Diesel_MQB + SG_ MO_StartStopp_Status : 12|2@1+ (1,0) [0|3] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_StartStopp_Wiederstart : 14|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_StartStopp_Motorstopp : 15|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Freig_Reku : 16|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ MO_Kl_75 : 18|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Kl_50 : 19|1@1+ (1,0) [0|1] "" Gateway_MQB,LEH_MQB + SG_ MO_Gangposition : 20|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ MO_StartStopp_Fahrerwunsch : 24|2@1+ (1,0) [0|3] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_HYB_Fahrbereitschaft : 26|1@1+ (1,0) [0|1] "" BMS_MQB,Gateway_MQB + SG_ MO_Ext_E_Fahrt_aktiv : 27|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Fahrer_bremst : 28|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_QBit_Fahrer_bremst : 29|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_BLS : 30|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Konsistenz_Bremsped : 31|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Timeout_ESP : 32|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Klima_Eingr : 33|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ MO_Aussp_Anlass : 35|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Freig_Anlass : 36|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Kuppl_schalter : 37|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Interlock : 38|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Motor_laeuft : 39|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Kickdown : 40|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Status_Zylabschalt_01 : 41|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_EKlKomLeiRed : 42|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ MO_Handshake_STH : 44|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_BKV_Unterdruckwarnung : 45|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Freigabe_Segeln : 46|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_PTC_Status : 47|3@1+ (1,0) [0|7] "" Gateway_MQB + SG_ MO_QBit_Gangposition : 50|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Signalquelle_Gangposition : 51|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Remotestart_Betrieb : 52|1@1+ (1,0) [0|1] "" Gateway_MQB + +BO_ 1631 Motor_16: 8 Motor_Diesel_MQB + SG_ TSK_QBit_Steigung : 12|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ TSK_QBit_Fahrzeugmasse : 13|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_SpannungsAnf_02 : 14|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ MO_DPF_reg : 16|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Heizstrom_EKAT : 17|7@1+ (1,0) [0|126] "Unit_Amper" Gateway_MQB + SG_ MO_Heizstrom_SCR : 24|6@1+ (1,0) [0|62] "Unit_Amper" Gateway_MQB + SG_ TSK_Fahrzeugmasse_02 : 48|8@1+ (32,0) [0|8128] "Unit_KiloGram" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ TSK_Steigung : 56|8@1+ (0.8,-101.6) [-101.6|101.6] "Unit_PerCent" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + +BO_ 812 Motor_17: 8 Motor_Diesel_MQB + SG_ MO_Prio_MAX_Wunschdrehzahl : 12|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Prio_MIN_Wunschdrehzahl : 13|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Luftpfad_aktiv : 14|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ MO_v_Begrenz_Aktivierbar : 15|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ MO_Drehzahlbeeinflussung : 16|8@1+ (0.39,0) [0|99.45] "Unit_PerCent" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_MIN_Wunschdrehzahl : 24|8@1+ (25,0) [0|6350] "Unit_MinutInver" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_MAX_Wunschdrehzahl : 32|9@1+ (25,0) [0|12750] "Unit_MinutInver" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Charisma_FahrPr : 41|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ MO_Charisma_Status : 45|2@1+ (1,0) [0|3] "" Gateway_MQB + +BO_ 1648 Motor_18: 8 Motor_Diesel_MQB + SG_ MO_Hybrid_StartStopp_LED : 43|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ MO_Eis_Offroad_LED : 45|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ MO_Anzahl_Abgesch_Zyl : 47|3@1+ (1,0) [0|7] "" Gateway_MQB + SG_ MO_Zylabsch_Texte : 50|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ MO_E85_BS_Texte : 52|3@1+ (1,0) [0|7] "" Gateway_MQB + SG_ MO_Drehzahl_Warnung : 55|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_obere_Drehzahlgrenze : 56|8@1+ (50,0) [50|12750] "Unit_MinutInver" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + +BO_ 289 Motor_20: 8 Motor_Diesel_MQB + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|255] "" XXX + SG_ MO_Fahrpedalrohwert_01 : 12|8@1+ (0.4,0) [0|101.6] "Unit_PerCent" Airbag_MQB,Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_QBit_Fahrpedalwerte_01 : 20|1@1+ (1,0) [0|1] "" Airbag_MQB,Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Fahrpedalgradient : 21|8@1+ (25,0) [0|6350] "Unit_PerCentPerSecon" Airbag_MQB,Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Sig_Fahrpedalgradient : 29|1@1+ (1,0) [0|1] "" Airbag_MQB,Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_rel_Saugrohrdruck : 30|6@1+ (18,0) [0|1116] "Unit_MilliBar" Gateway_MQB + SG_ MO_rel_Saugrohrdruck_gem_err : 36|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Moment_im_Leerlauf : 37|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Schubabschaltung : 38|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Solldrehz_Leerlauf : 40|8@1+ (10,0) [0|2540] "Unit_MinutInver" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + +BO_ 967 Motor_26: 8 Motor_Diesel_MQB + SG_ MO_HYB_Status_HV_Ladung : 8|3@1+ (1,0) [0|7] "" Gateway_MQB + SG_ WIV_Anzeige_aktiv : 12|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ WIV_Oelmin_Warn : 13|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ WIV_Sensorfehler : 14|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ WIV_Schieflage : 15|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ WIV_Oelstand : 16|4@1+ (12.5,0) [0|100] "Unit_PerCent" Gateway_MQB + SG_ MO_Zustand_HWP : 20|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ WIV_Oelsystem_aktiv : 24|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ WIV_nicht_betriebswarm : 25|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ WIV_Ueberfuell_Warn : 26|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ WIV_laufender_Motor : 27|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_HYB_Text_1 : 28|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_HYB_Text_2 : 29|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_HYB_Text_3 : 30|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_HYB_Text_4 : 31|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Text_Motorstart : 32|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ MO_HYB_Text_5 : 36|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_HYB_Text_6 : 37|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_HYB_Text_7 : 38|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Text_Partikelfil_Reg : 41|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ WIV_Oelmenge : 43|5@1+ (125,0) [0|3875] "Unit_MilliLiter" Gateway_MQB + SG_ MO_Systemlampe : 48|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_OBD2_Lampe : 49|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Heissleuchte : 50|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Partikel_Lampe : 51|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Winterfahrprog : 52|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ WIV_Oelstand_nicht_vorhanden : 53|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ WIV_nachfuellanzeige_ein : 54|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ WIV_Ueberfuell_deaktiv : 55|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ WIV_Unterfuell_Warn : 56|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Tankdeckel_Lampe : 57|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Text_Tankdeckelwarn : 58|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ WIV_Oeldr_Warn_Motor : 60|1@1+ (1,0) [0|1] "" Gateway_MQB + +BO_ 1601 Motor_Code_01: 8 Motor_Diesel_MQB + SG_ Motor_Code_01_CRC : 0|8@1+ (1,0) [0|255] "" Gateway_MQB + SG_ Motor_Code_01_BZ : 8|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ MO_Faktor_Momente_02 : 12|2@1+ (1,0) [0|3] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Hybridfahrzeug : 14|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ MO_Code : 16|8@1+ (1,0) [0|255] "" Gateway_MQB,SAK_MQB + SG_ MO_Getriebe_Code : 24|6@1+ (1,0) [0|63] "" Gateway_MQB + SG_ MO_StartStopp_Codiert : 30|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Anzahl_Zyl : 32|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ MO_Kraftstoffart : 36|4@1+ (1,0) [0|15] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Hubraum : 40|7@1+ (0.1,0) [0|12.7] "Unit_Liter" Gateway_MQB + SG_ MO_Ansaugsystem : 47|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ MO_Leistung : 48|9@1+ (1,0) [0|511] "Unit_KiloWatt" Gateway_MQB + SG_ MO_Abgastyp_EOBD : 57|1@1+ (1,0) [0|1] "" BMS_MQB,Gateway_MQB,LEH_MQB + SG_ MO_Abgastyp_OBD : 58|1@1+ (1,0) [0|1] "" BMS_MQB,Gateway_MQB,LEH_MQB + SG_ MO_DPF_verbaut : 59|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ TSK_Codierung : 60|3@1+ (1,0) [0|7] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ MO_Einspritzart : 63|1@1+ (1,0) [0|1] "" Gateway_MQB + +BO_ 157 Motor_Hybrid_01: 8 Motor_Hybrid_MQB + SG_ Motor_Hybrid_01_CRC : 0|8@1+ (1,0) [0|255] "" Getriebe_DQ_Hybrid_MQB + SG_ Motor_Hybrid_01_BZ : 8|4@1+ (1,0) [0|15] "" BMS_MQB,Getriebe_DQ_Hybrid_MQB + SG_ MO_HYB_IstStatusK0 : 12|2@1+ (1,0) [0|3] "" Getriebe_DQ_Hybrid_MQB + SG_ MO_HYB_max_ind_VM_Mom : 16|10@1+ (1,0) [0|1021] "Unit_NewtoMeter" Getriebe_DQ_Hybrid_MQB + SG_ MO_HYB_Zielzustand : 26|3@1+ (1,0) [0|7] "" BMS_MQB,Getriebe_DQ_Hybrid_MQB + SG_ MO_HYB_Startmodus : 29|3@1+ (1,0) [0|7] "" Vector__XXX + SG_ MO_HYB_Startmodus_PQ3x : 32|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB + SG_ MO_HYB_Stoppmodus : 33|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB + SG_ MO_HYB_VM_Mom_oE : 40|10@1+ (1,-100) [-100|922] "Unit_NewtoMeter" Getriebe_DQ_Hybrid_MQB + SG_ MO_HYB_VM_aktiv : 50|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB + SG_ MO_HYB_Schaltverhinderung : 51|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB + +BO_ 811 Motor_Hybrid_02: 8 Motor_Hybrid_MQB + SG_ MO_HYB_E_Faktor : 12|4@1+ (1,0) [0|15] "" Getriebe_DQ_Hybrid_MQB + SG_ MO_HYB_Drehzahl_VM : 16|16@1+ (0.25,0) [0|16256] "Unit_MinutInver" Getriebe_DQ_Hybrid_MQB + SG_ MO_HYB_LowSpeedModus : 32|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB + +BO_ 2600468501 NMH_Airbag_01: 8 Airbag_MQB + SG_ NM_Airbag_01_SNI : 0|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ NM_Airbag_01_NM_State : 16|6@1+ (1,0) [0|63] "" BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ NM_Airbag_01_Car_Wakeup : 22|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ NM_Airbag_01_Wakeup : 24|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ NM_Airbag_01_NM_aktiv_KL15 : 32|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Airbag_01_NM_aktiv_Diagnose : 33|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Airbag_01_NM_aktiv_Tmin : 34|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Airbag_01_UDS_CC : 63|1@1+ (1,0) [0|1] "" Vector__XXX + +BO_ 2600468604 NMH_EMotor_01: 8 LEH_MQB + SG_ NM_EMotor_01_SNI : 0|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ NM_EMotor_01_NM_State : 16|6@1+ (1,0) [0|63] "" BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ NM_EMotor_01_Car_Wakeup : 22|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ NM_EMotor_01_Wakeup : 24|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ NM_EMotor_01_NM_aktiv_KL15 : 32|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_EMotor_01_NM_aktiv_Diagnose : 33|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_EMotor_01_NM_aktiv_Tmin : 34|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_EMotor_01_NL_Daten_EEPROM : 48|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_EMotor_01_UDS_CC : 63|1@1+ (1,0) [0|1] "" Vector__XXX + +BO_ 2600468496 NMH_Gateway: 8 Gateway_MQB + SG_ NM_Gateway_SNI : 0|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ NM_Gateway_NM_State : 16|6@1+ (1,0) [0|63] "" BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ NM_Gateway_Car_Wakeup : 22|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_Wakeup : 24|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ NM_Gateway_NM_aktiv_KL15 : 32|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_NM_aktiv_Diagnose : 33|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_NM_aktiv_Tmin : 34|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_ACAN_Aktivitaet : 35|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_FCAN_Aktivitaet : 36|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_KCAN_Aktivitaet : 37|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_ICAN_Aktivitaet : 38|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_DiagCAN_Aktivitaet : 39|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_ECAN_Aktivitaet : 40|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_Energie_LIN_Aktivi000 : 41|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_Bedien_LIN_Aktivitaet : 42|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_EM_Aktivitaet : 43|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_NL_EM : 48|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_NL_Shutdown : 49|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_NL_Spg_Messung : 50|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_NL_Wakeup_Monitor : 51|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Gateway_UDS_CC : 63|1@1+ (1,0) [0|1] "" Vector__XXX + +BO_ 2600468599 NMH_Getriebe_01: 8 Getriebe_DQ_Hybrid_MQB + SG_ NM_Getriebe_01_SNI : 0|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ NM_Getriebe_01_NM_State : 16|6@1+ (1,0) [0|63] "" BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ NM_Getriebe_01_Car_Wakeup : 22|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ NM_Getriebe_01_Wakeup : 24|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ NM_Getriebe_01_NM_aktiv_KL15 : 32|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Getriebe_01_NM_aktiv_Diagnose : 33|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Getriebe_01_NM_aktiv_Tmin : 34|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Getriebe_01_NM_aktiv_v_gr_0 : 35|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Getriebe_01_NM_aktiv_Pos_Erk : 36|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Getriebe_01_NM_aktiv_Umg_Bed : 37|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Getriebe_01_NL_Daten_EEPROM : 48|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Getriebe_01_UDS_CC : 63|1@1+ (1,0) [0|1] "" Vector__XXX + +BO_ 2600468603 NMH_Hybrid_01: 8 BMS_MQB + SG_ NM_Hybrid_01_SNI : 0|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ NM_Hybrid_01_NM_State : 16|6@1+ (1,0) [0|63] "" BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ NM_Hybrid_01_Car_Wakeup : 22|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ NM_Hybrid_01_Wakeup : 24|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ NM_Hybrid_01_NM_aktiv_KL15 : 32|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Hybrid_01_NM_aktiv_Diagnose : 33|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Hybrid_01_NM_aktiv_Tmin : 34|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Hybrid_01_NL_Daten_EEPROM : 48|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Hybrid_01_NL_Luefter : 49|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_Hybrid_01_UDS_CC : 63|1@1+ (1,0) [0|1] "" Vector__XXX + +BO_ 2600468598 NMH_MO_01: 8 Motor_Diesel_MQB + SG_ NM_MO_01_SNI : 0|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ NM_MO_01_NM_State : 16|6@1+ (1,0) [0|63] "" BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB,Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ NM_MO_01_Car_Wakeup : 22|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ NM_MO_01_Wakeup : 24|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ NM_MO_01_NM_aktiv_KL15 : 32|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_MO_01_NM_aktiv_Diagnose : 33|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_MO_01_NM_aktiv_Tmin : 34|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_MO_01_NM_aktiv_HV_Abschaltung : 35|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_MO_01_NM_aktiv_EKP_Vorlauf : 36|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_MO_01_NM_aktiv_STH_Betrieb : 37|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_MO_01_NL_Kuehlerluefter : 48|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_MO_01_NL_Diagnose : 49|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_MO_01_NL_WFS : 50|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_MO_01_NL_EEPROM : 51|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_MO_01_NL_Sonstige : 52|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ NM_MO_01_UDS_CC : 63|1@1+ (1,0) [0|1] "" Vector__XXX + +BO_ 913 OBD_01: 8 Motor_Diesel_MQB + SG_ OBD_Calc_Load_Val : 0|8@1+ (0.39215686275,0) [0|100] "Unit_PerCent" BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB + SG_ OBD_Eng_Cool_Temp : 8|8@1+ (1,-40) [-40|215] "Unit_DegreCelsi" BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB + SG_ OBD_Abs_Throttle_Pos : 16|8@1+ (0.39215686275,0) [0|100] "Unit_PerCent" BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB + SG_ OBD_Abs_Load_Val : 24|16@1+ (0.39215686275,0) [0|25700] "Unit_PerCent" BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB + SG_ OBD_Abs_Pedal_Pos : 40|8@1+ (0.39215686275,0) [0|100] "Unit_PerCent" BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB + SG_ OBD_Kaltstart_Denominator : 59|1@1+ (1,0) [0|1] "" BMS_MQB,LEH_MQB + SG_ OBD_Minimum_Trip : 60|1@1+ (1,0) [0|1] "" BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB + SG_ OBD_Driving_Cycle : 61|1@1+ (1,0) [0|1] "" BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB + SG_ OBD_Warm_Up_Cycle : 62|1@1+ (1,0) [0|1] "" BMS_MQB,Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB + SG_ OBD_Normed_Trip : 63|1@1+ (1,0) [0|1] "" BMS_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB,LEH_MQB + +BO_ 1630 OBD_Tankgeber_01: 8 Gateway_MQB + SG_ OBD_TG_F_Status_1 : 0|4@1+ (1,0) [0|15] "" Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ OBD_TG_F_Status_2 : 4|4@1+ (1,0) [0|15] "" Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ OBD_TG_F_Status_3 : 8|4@1+ (1,0) [0|15] "" Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ OBD_TG_F_Status_4 : 12|4@1+ (1,0) [0|15] "" Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ OBD_TG_Sens_Rohwert_1 : 16|12@1+ (0.5,0) [0|2047.5] "Unit_Ohm" Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ OBD_TG_Sens_Rohwert_2 : 28|12@1+ (0.5,0) [0|2047.5] "Unit_Ohm" Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ OBD_TG_Sens_Rohwert_3 : 40|12@1+ (0.5,0) [0|2047.5] "Unit_Ohm" Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ OBD_TG_Sens_Rohwert_4 : 52|12@1+ (0.5,0) [0|2047.5] "Unit_Ohm" Motor_Hybrid_MQB,Motor_Otto_MQB + +BO_ 1437 Remotestart_FFB: 8 Gateway_MQB + SG_ RSF_Tastencode_1 : 0|8@1+ (1,0) [0|255] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ RSF_Tastencode_2 : 8|8@1+ (1,0) [0|255] "" Motor_Diesel_MQB,Motor_Otto_MQB + SG_ RSF_Tastencode_Maske : 16|8@1+ (1,0) [0|255] "" Motor_Diesel_MQB,Motor_Otto_MQB + +BO_ 984 RGS_VL_01: 8 Airbag_MQB + SG_ RGS_VL_Texte : 12|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ RGS_VL_Charisma_FahrPr : 14|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ RGS_VL_Charisma_Status : 18|2@1+ (1,0) [0|3] "" Gateway_MQB + SG_ RGS_VL_aktiv : 21|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ RGS_VL_PC_Aktuator_Sitz : 25|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ RGS_VL_PC_Aktuator_Schiebedach : 26|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ RGS_VL_PC_Aktuator_Fenster : 27|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ RGS_VL_PC_Aktuator_Warnblinken : 28|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ RGS_VL_Precrash_Basis : 32|8@1+ (1,0) [0|255] "" Gateway_MQB + SG_ RGS_VL_Precrash_Front : 40|8@1+ (1,0) [0|255] "" Gateway_MQB + SG_ RGS_VL_Precrash_Rear : 48|8@1+ (1,0) [0|255] "" Gateway_MQB + +BO_ 1528 SAK_01: 8 SAK_MQB + SG_ SAK_Charisma_FahrPr : 16|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ SAK_Charisma_Status : 20|2@1+ (1,0) [0|3] "" Gateway_MQB + +BO_ 1313 STH_01: 8 Gateway_MQB + SG_ STH_Funk_ein : 0|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STH_Funk_aus : 1|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STH_Zusatzheizung : 2|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STH_LED : 3|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ STH_Pumpe_ein : 4|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STH_Geblaese : 5|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STH_EKP_Anst : 6|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ STH_Start_folgt : 7|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STH_Ventiloeffnungszeit : 8|6@1+ (1,0) [0|63] "Unit_Minut" Vector__XXX + SG_ STH_Ventil_Status : 14|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STH_Waermeeintrag : 16|6@1+ (1,0) [0|63] "" Vector__XXX + SG_ STH_KVS : 24|13@1+ (1,0) [0|8191] "Unit_MilliLiter" Vector__XXX + SG_ STH_Fehlerstatus : 37|3@1+ (1,0) [0|7] "" Vector__XXX + SG_ STH_Heizleistung : 40|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ STH_Wassertemp : 48|8@1+ (0.75,-40) [-40|142.25] "Unit_DegreCelsi" Vector__XXX + SG_ STH_Motorvorwaermung : 59|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ STH_Servicemode : 60|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STH_war_aktiv : 61|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ STH_KVS_Ueberlauf : 62|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STH_KD_Fehler : 63|1@1+ (1,0) [0|1] "" Vector__XXX + +BO_ 1172 STS_01: 8 Gateway_MQB + SG_ STS_01_CRC : 0|8@1+ (1,0) [0|255] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ STS_01_BZ : 8|4@1+ (1,0) [0|15] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ STS_Car_not_under_theft : 12|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STS_Car_under_theft : 13|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STS_Anlassersperre : 15|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STS_Typencodierung : 16|5@1+ (1,0) [0|31] "" Vector__XXX + SG_ STS_LIN_aktiv : 23|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STS_Standlicht : 24|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STS_Fahrlicht : 25|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STS_Alarm_still : 26|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STS_Texte : 27|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ STS_Laderelais : 38|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STS_Summer : 48|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STS_Alarm_Blinker : 50|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STS_Notstart : 51|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STS_Signalhorn : 55|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ STS_Leerlaufschaltung : 56|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + +BO_ 1413 Systeminfo_01: 8 Gateway_MQB + SG_ SI_Sammel_SG_Fehler : 0|6@1+ (1,0) [0|60] "" Vector__XXX + SG_ SI_Rollenmode : 6|2@1+ (1,0) [0|3] "" Vector__XXX + SG_ SI_QRS_Mode : 8|1@1+ (1,0) [0|1] "" Motor_Diesel_MQB,Motor_Hybrid_MQB,Motor_Otto_MQB + SG_ SI_T_Mode : 9|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_NWDF : 10|1@1+ (1,0) [0|1] "" SAK_MQB + SG_ SI_NWDF_gueltig : 11|1@1+ (1,0) [0|1] "" SAK_MQB + SG_ SI_Sammelfehler : 12|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ GW_KD_Fehler : 13|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_01 : 16|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_02 : 17|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_03 : 18|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_04 : 19|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_05 : 20|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_06 : 21|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_07 : 22|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_08 : 23|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_09 : 24|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_10 : 25|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_11 : 26|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_12 : 27|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_13 : 28|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_14 : 29|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SI_BUS_15 : 30|1@1+ (1,0) [0|1] "" Vector__XXX + +BO_ 288 TSK_06: 8 Motor_Diesel_MQB + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ TSK_Radbremsmom : 12|12@1+ (8,0) [0|32760] "Unit_NewtoMeter" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ TSK_Status : 24|3@1+ (1,0) [0|7] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ TSK_v_Begrenzung_aktiv : 27|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ TSK_Standby_Anf_ESP : 28|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ TSK_Freig_Verzoeg_Anf : 30|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ TSK_Limiter_ausgewaehlt : 31|1@1+ (1,0) [0|1] "" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ TSK_ax_Getriebe_02 : 48|9@1+ (0.024,-2.016) [-2.016|10.224] "Unit_MeterPerSeconSquar" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ TSK_Zwangszusch_ESP : 57|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ TSK_zul_Regelabw : 58|6@1+ (0.024,0) [0|1.512] "Unit_MeterPerSeconSquar" Gateway_MQB,Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + +BO_ 798 TSK_07: 8 Motor_Diesel_MQB + SG_ TSK_07_CRC : 0|8@1+ (1,0) [0|255] "" Gateway_MQB + SG_ TSK_07_BZ : 8|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ TSK_Wunschgeschw : 12|10@1+ (0.32,0) [0|326.72] "Unit_KiloMeterPerHour" Gateway_MQB + SG_ TSK_Texte_Primaeranz : 48|5@1+ (1,0) [0|31] "" Gateway_MQB + SG_ TSK_Limiter_Anzeige : 55|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ TSK_Status_Anzeige : 61|3@1+ (1,0) [0|7] "" Gateway_MQB + +BO_ 1716 VIN_01: 8 Gateway_MQB + SG_ VIN_01_MUX M : 0|2@1+ (1,0) [0|3] "" Airbag_MQB + SG_ KS_Geheimnis_1 m0 : 8|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ VIN_4 m1 : 8|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ VIN_11 m2 : 8|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ KS_Geheimnis_2 m0 : 16|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ VIN_5 m1 : 16|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ VIN_12 m2 : 16|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ KS_Geheimnis_3 m0 : 24|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ VIN_6 m1 : 24|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ VIN_13 m2 : 24|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ KS_Geheimnis_4 m0 : 32|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ VIN_7 m1 : 32|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ VIN_14 m2 : 32|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ VIN_1 m0 : 40|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ VIN_8 m1 : 40|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ VIN_15 m2 : 40|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ VIN_2 m0 : 48|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ VIN_9 m1 : 48|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ VIN_16 m2 : 48|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ VIN_3 m0 : 56|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ VIN_10 m1 : 56|8@1+ (1,0) [0|255] "" Airbag_MQB + SG_ VIN_17 m2 : 56|8@1+ (1,0) [0|255] "" Airbag_MQB + +BO_ 175 Waehlhebel_03: 4 Waehlhebel_MQB + SG_ WH_Status_Sperre : 0|3@1+ (1,0) [0|7] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ WH_Initialisierung : 3|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ WH_SensorPos_roh : 4|4@1+ (1,0) [0|15] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ WH_03_BZ : 8|4@1+ (1,0) [0|15] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ WH_SensorPos_roh_inv : 12|4@1+ (1,0) [0|15] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ WH_Testergebnis : 16|8@1+ (1,0) [0|255] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ WH_Test_Aktiv : 24|1@1+ (1,0) [0|1] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + SG_ WH_Status : 25|7@1+ (1,0) [0|127] "" Getriebe_DQ_Hybrid_MQB,Getriebe_DQ_MQB + +BO_ 916 WBA_03: 8 Getriebe_DQ_Hybrid_MQB + SG_ WBA_03_CRC : 0|8@1+ (1,0) [0|255] "" Gateway_MQB + SG_ WBA_03_BZ : 8|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ WBA_Fahrstufe_02 : 12|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ WBA_ZielFahrstufe : 16|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ WBA_GE_Warnung_02 : 20|4@1+ (1,0) [0|15] "" Gateway_MQB + SG_ WBA_eing_Gang_02 : 24|4@1+ (1,0) [0|15] "" Gateway_MQB,Motor_Diesel_MQB,Motor_Otto_MQB + SG_ WBA_GE_Texte : 28|3@1+ (1,0) [0|7] "" Gateway_MQB + SG_ WBA_Segeln_aktiv : 31|1@1+ (1,0) [0|1] "" Gateway_MQB + SG_ WBA_Schaltschema : 32|5@1+ (1,0) [0|31] "" Gateway_MQB + +BO_ 1602 WIV_01: 8 Motor_Diesel_MQB + SG_ WIV_Verschleissindex : 0|16@1+ (2e-8,0) [0|0.00131068] "" Gateway_MQB + SG_ WIV_Russindex : 16|16@1+ (2e-8,0) [0|0.00131068] "" Gateway_MQB + SG_ WIV_t_min : 32|6@1+ (1,0) [0|63] "Unit_Month" Gateway_MQB + SG_ WIV_t_max : 40|6@1+ (1,0) [0|63] "Unit_Month" Gateway_MQB + SG_ WIV_W_min : 48|7@1+ (1000,0) [0|127000] "Unit_KiloMeter" Gateway_MQB + SG_ WIV_W_max : 56|7@1+ (1000,0) [0|127000] "Unit_KiloMeter" Gateway_MQB + +BO_ 294 HCA_01: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_0X3 : 12|4@1+ (1,0) [0|15] "" XXX + SG_ Assist_Torque : 16|14@1+ (1,0) [0|300] "Nm" XXX + SG_ Assist_Requested : 30|1@1+ (1,0) [0|1] "" XXX + SG_ Assist_VZ : 31|1@1+ (1,0) [0|1] "" XXX + SG_ HCA_Available : 32|1@1+ (1,0) [0|1] "" XXX + SG_ HCA_Standby : 33|1@1+ (1,0) [0|1] "" XXX + SG_ HCA_Active : 34|1@1+ (1,0) [0|1] "" XXX + SG_ SET_ME_0XFE : 40|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_0X07 : 48|8@1+ (1,0) [0|255] "" XXX + +BO_ 159 LH_EPS_03: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX + SG_ EPS_DSR_Status : 12|4@1+ (1,0) [0|15] "" XXX + SG_ EPS_Berechneter_LW : 16|12@1+ (0.15,0) [0|613.95] "Unit_DegreOfArc" XXX + SG_ EPS_BLW_QBit : 30|1@1+ (1,0) [0|1] "" XXX + SG_ EPS_VZ_BLW : 31|1@1+ (1,0) [0|1] "" XXX + SG_ EPS_HCA_Status : 32|4@1+ (1,0) [0|15] "" XXX + SG_ EPS_Lenkmoment : 40|10@1+ (1,0) [0|8] "Unit_centiNewtoMeter" XXX + SG_ EPS_Lenkmoment_QBit : 54|1@1+ (1,0) [0|1] "" XXX + SG_ EPS_VZ_Lenkmoment : 55|1@1+ (1,0) [0|1] "" XXX + SG_ EPS_Lenkungstyp : 60|4@1+ (1,0) [0|15] "" XXX + +BO_ 286 VehicleSpeed: 8 XXX + SG_ VehicleSpeed_CRC : 0|8@1+ (1,0) [0|255] "" XXX + SG_ VehicleSpeed_BZ : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Speed : 52|12@1+ (0.125,0) [0|1] "" XXX + +BO_ 919 LDW_02: 8 XXX + SG_ LDW_Gong : 12|2@1+ (1,0) [0|3] "" XXX + SG_ LDW_SW_Warnung_links : 14|1@1+ (1,0) [0|1] "" XXX + SG_ LDW_SW_Warnung_rechts : 15|1@1+ (1,0) [0|1] "" XXX + SG_ LDW_Texte : 16|4@1+ (1,0) [0|15] "" XXX + SG_ LDW_Seite_DLCTLC : 20|1@1+ (1,0) [0|1] "" XXX + SG_ LDW_Lernmodus : 21|3@1+ (1,0) [0|7] "" XXX + SG_ LDW_Anlaufsp_VLR : 24|4@1+ (1,0) [0|15] "" XXX + SG_ LDW_Vib_Amp_VLR : 28|4@1+ (1,0) [0|15] "" XXX + SG_ LDW_Anlaufzeit_VLR : 32|4@1+ (1,0) [0|15] "" XXX + SG_ LDW_Lernmodus_rechts : 36|2@1+ (1,0) [0|3] "" XXX + SG_ LDW_Lernmodus_links : 38|2@1+ (1,0) [0|3] "" XXX + SG_ LDW_DLC : 40|8@1+ (0.01,-1.25) [-1.25|1.25] "Unit_Meter" XXX + SG_ LDW_TLC : 48|5@1+ (0.1,0) [0|3] "Unit_Secon" XXX + SG_ LDW_Warnung_links : 56|1@1+ (1,0) [0|1] "" XXX + SG_ LDW_Warnung_rechts : 57|1@1+ (1,0) [0|1] "" XXX + SG_ LDW_Codierinfo_fuer_VLR : 58|2@1+ (1,0) [0|3] "" XXX + SG_ LDW_Frontscheibenheizung_aktiv : 60|1@1+ (1,0) [0|1] "" XXX + SG_ LDW_Status_LED_gelb : 61|1@1+ (1,0) [0|1] "" XXX + SG_ LDW_Status_LED_gruen : 62|1@1+ (1,0) [0|1] "" XXX + SG_ LDW_KD_Fehler : 63|1@1+ (1,0) [0|1] "" XXX + +BO_ 780 ACC_02: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX + SG_ ACC_Wunschgeschw : 12|10@1+ (0.32,0) [0.00|326.72] "Unit_KiloMeterPerHour" XXX + SG_ ACC_Status_Prim_Anz : 22|2@1+ (1.0,0.0) [0.0|3] "" XXX + SG_ ACC_Abstandsindex : 24|10@1+ (1,0) [1|1021] "" XXX + SG_ ACC_Akustik : 34|3@1+ (1.0,0.0) [0.0|7] "" XXX + SG_ ACC_Gesetzte_Zeitluecke : 37|3@1+ (1.0,0.0) [0.0|7] "" XXX + SG_ ACC_Optischer_Fahrerhinweis : 40|1@1+ (1.0,0.0) [0.0|1] "" XXX + SG_ ACC_Typ_Tachokranz : 41|1@1+ (1.0,0.0) [0.0|1] "" XXX + SG_ ACC_Anzeige_Zeitluecke : 42|1@1+ (1.0,0.0) [0.0|1] "" XXX + SG_ ACC_Tachokranz : 43|1@1+ (1.0,0.0) [0.0|1] "" XXX + SG_ ACC_Display_Prio : 44|2@1+ (1.0,0.0) [0.0|3] "" XXX + SG_ ACC_Relevantes_Objekt : 46|2@1+ (1.0,0.0) [0.0|3] "" XXX + SG_ ACC_Texte_Primaeranz : 48|7@1+ (1.0,0.0) [0.0|127] "" XXX + SG_ ACC_Wunschgeschw_erreicht : 55|1@1+ (1.0,0.0) [0.0|1] "" XXX + SG_ ACC_Status_Anzeige : 61|3@1+ (1.0,0.0) [0.0|7] "" XXX + +BO_ 302 ACC_07: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX + SG_ ACC_Distance_to_Stop : 12|11@1+ (0.01,0) [0|1] "m" XXX + SG_ ACC_Hold_Request : 23|1@1+ (1,0) [0|1] "x" XXX + SG_ ACC_Boost_Request : 24|1@1+ (1,0) [0|1] "" XXX + SG_ ACC_Freewheel_Request : 25|1@1+ (1,0) [0|1] "" XXX + SG_ ACC_Freewheel_Type : 26|2@1+ (1,0) [0|3] "enum" XXX + SG_ ACC_Hold_Type : 28|3@1+ (1,0) [0|15] "enum" XXX + SG_ ACC_Hold_Release : 31|1@1+ (1,0) [0|1] "" XXX + SG_ ACC_Accel_Secondary : 32|8@1+ (0.03,-4.6) [-4.6|2.99] "m/s2" XXX + SG_ ACC_Accel_TSK : 53|11@1+ (0.005,-7.22) [-7.22|3.005] "m/s2" XXX + +BO_ 264 Fahrwerk_01: 8 XXX + SG_ Fahrwerk_01_BZ : 8|4@1+ (1,0) [0|15] "" XXX + SG_ Fahrwerk_01_CRC : 0|8@1+ (1,0) [0|255] "" XXX + +BO_ 695 RCTA_01: 8 XXX + SG_ RCTA_01_BZ : 8|4@1+ (1,0) [0|15] "" XXX + SG_ RCTA_01_CRC : 0|8@1+ (1,0) [0|255] "" XXX + +BO_ 783 SWA_01: 8 Gateway_MQB + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ SWA_Anzeigen : 12|4@1+ (1,0) [0|15] "" Kombi_D4 + SG_ SWA_Blindheit_erkannt : 16|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_rel_Nichtverf : 17|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_rel_Fehler : 18|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Sta_aktiv : 19|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Sta_passiv : 20|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Standziele_li : 24|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Kolonne_li : 25|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Infostufe_SWA_li : 26|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Warnung_SWA_li : 27|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Kolonne_mi : 33|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Standziele_re : 40|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Kolonne_re : 41|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Infostufe_SWA_re : 42|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Warnung_SWA_re : 43|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Gischtzaehler : 48|7@1+ (1,0) [0|100] "Unit_PerCent" Vector__XXX + SG_ SWA_KD_Fehler : 59|1@1+ (1,0) [0|1] "" Vector__XXX + +BO_ 804 ACC_04: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX + SG_ ACC_Texte_Zusatzanz : 16|6@1+ (1.0,0.0) [0.0|63] "" XXX + SG_ ACC_Status_Zusatzanz : 22|5@1+ (1.0,0.0) [0.0|31] "" XXX + SG_ ACC_Texte : 27|5@1+ (1.0,0.0) [0.0|31] "" XXX + SG_ ACC_Texte_braking_guard : 32|3@1+ (1.0,0.0) [0.0|7] "" XXX + SG_ ACC_Warnhinweis : 35|1@1+ (1.0,0.0) [0.0|1] "" XXX + SG_ ACC_Geschw_Zielfahrzeug : 40|10@1+ (0.32,0) [0.00|326.72] "Unit_KiloMeterPerHour" XXX + SG_ ACC_Charisma_FahrPr : 56|3@1+ (1.0,0.0) [0.0|7] "" XXX + SG_ ACC_Charisma_Status : 59|2@1+ (1.0,0.0) [0.0|3] "" XXX + SG_ ACC_Charisma_Umschaltung : 61|2@1+ (1.0,0.0) [0.0|3] "" XXX + +BO_ 917 LWR_AFS_01: 8 XXX + +BO_ 991 Gateway_76: 8 XXX + +BO_ 997 TSG_FT_02: 8 XXX + SG_ TSG_FT_02_BZ : 8|4@1+ (1,0) [0|15] "" XXX + SG_ TSG_FT_02_CRC : 0|8@1+ (1,0) [0|255] "" XXX + +BO_ 1175 Parkhilfe_01: 8 XXX + +BO_ 427 ESP_33: 8 XXX + SG_ ESP_33_BZ : 8|4@1+ (1,0) [0|15] "" XXX + SG_ ESP_33_CRC : 0|8@1+ (1,0) [0|255] "" XXX + +BO_ 418 ESP_15: 8 XXX + SG_ ESP_15_CRC : 0|8@1+ (1,0) [0|255] "" XXX + SG_ ESP_15_BZ : 8|4@1+ (1,0) [0|15] "" XXX + +BO_ 1122 PSD_04: 8 XXX + SG_ PSD_Object_Index : 0|6@1+ (1,0) [0|63] "" XXX + +BO_ 1123 PSD_05: 8 XXX + SG_ PSD_Current_Route_Index : 0|6@1+ (1,0) [0|63] "" XXX + SG_ Route_Distance_Remaining : 8|5@1+ (1,0) [0|31] "" XXX + +BO_ 1124 PSD_06: 8 XXX + +BO_ 988 Gateway_73: 8 XXX + +BO_ 792 Kamera_Status: 8 XXX + +BO_ 981 Licht_Anf_01: 8 XXX + +BO_ 1440 RLS_01: 8 XXX + +BO_ 870 Blinkmodi_02: 8 XXX + SG_ Hazard_Switch : 20|1@1+ (1,0) [0|1] "" XXX + SG_ Comfort_Signal_Left : 23|1@1+ (1,0) [0|1] "" XXX + SG_ Comfort_Signal_Right : 24|1@1+ (1,0) [0|1] "" XXX + SG_ Left_Turn_Exterior_Bulb_1 : 25|1@1+ (1,0) [0|1] "" XXX + SG_ Right_Turn_Exterior_Bulb_1 : 26|1@1+ (1,0) [0|1] "" XXX + SG_ Left_Turn_Exterior_Bulb_2 : 27|1@1+ (1,0) [0|1] "" XXX + SG_ Right_Turn_Exterior_Bulb_2 : 28|1@1+ (1,0) [0|1] "" XXX + SG_ Fast_Send_Rate_Active : 37|1@1+ (1,0) [0|1] "" XXX + +BO_ 1385 HVEM_04: 8 XXX + +BO_ 1605 FLA_01: 8 XXX + +BO_ 1624 Licht_vorne_01: 8 XXX + +BO_ 1646 Klima_03: 8 XXX + +BO_ 1720 Kombi_03: 8 XXX + +BO_ 391 EV_Gearshift: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX + SG_ GearPosition : 16|4@1+ (1,0) [0|255] "" XXX + SG_ RegenBrakingMode : 12|2@1+ (1,0) [0|3] "" XXX + +CM_ SG_ 134 LWI_Lenkradwinkel "Steering angle WITH variable ratio effect included"; +CM_ SG_ 159 EPS_HCA_Status "Status of Heading Control Assist feature"; +CM_ SG_ 159 EPS_Lenkmoment "Steering input by driver, torque"; +CM_ SG_ 159 EPS_VZ_Lenkmoment "Steering input by driver, direction"; +CM_ SG_ 159 EPS_Berechneter_LW "Raw steering angle, degrees"; +CM_ SG_ 159 EPS_VZ_BLW "Raw steering angle, direction"; +CM_ SG_ 173 COUNTERXX "Message not renamed to COUNTER because J533 rate-limiting makes it look like messages are being lost"; +CM_ SG_ 294 SET_ME_0X3 "May be zero when sent by older cameras"; +CM_ SG_ 294 SET_ME_0X07 "May be zero when sent by older cameras"; +CM_ SG_ 294 SET_ME_0XFE "May be zero when sent by older cameras"; +CM_ SG_ 294 Assist_Torque "Heading control input, torque"; +CM_ SG_ 294 Assist_VZ "Heading control input, direction (sign)"; +CM_ SG_ 294 HCA_Available "Must be 1 for steering rack to accept HCA commands"; +CM_ SG_ 302 ACC_Hold_Request "Active request for ABS brake hold in ACC_Hold_Type"; +CM_ SG_ 302 ACC_Boost_Request "Hybrid engine start related"; +CM_ SG_ 302 ACC_Freewheel_Request "Active request for DSG sailing/coasting in ACC_Freewheel_Type"; +CM_ SG_ 302 ACC_Hold_Release "Request to ABS to release brake hold"; +CM_ SG_ 302 ACC_Accel_Secondary "Target acceleration of the secondary controller"; +CM_ SG_ 302 ACC_Accel_TSK "Mirror of request to TSK to implement a target acceleration"; +CM_ SG_ 870 Hazard_Switch "Four-way flashers active"; +CM_ SG_ 870 Comfort_Signal_Left "Comfort turn signal active, left"; +CM_ SG_ 870 Comfort_Signal_Right "Comfort turn signal active, right"; +CM_ SG_ 870 Left_Turn_Exterior_Bulb_1 "Probably front"; +CM_ SG_ 870 Right_Turn_Exterior_Bulb_1 "Probably front"; +CM_ SG_ 870 Left_Turn_Exterior_Bulb_2 "Probably rear"; +CM_ SG_ 870 Right_Turn_Exterior_Bulb_2 "Probably rear"; +CM_ SG_ 870 Fast_Send_Rate_Active "CAN message send rate"; +CM_ SG_ 919 LDW_DLC "Probable DLC (distance to line crossing)"; +CM_ SG_ 919 LDW_TLC "Probable TLC (time to line crossing)"; +CM_ SG_ 919 LDW_Unknown "Might be a steering pressed / driver active flag"; +CM_ SG_ 919 Alert_Message "Static table of alert messages to be invoked in the instrument cluster, some with or without beeps, 0 = no current message"; +CM_ SG_ 919 LDW_Direction "Left/right indicator for DLC and TLC"; +CM_ SG_ 919 Right_Lane_Status "Display brightness range, 0 = no lane, 3 = full brightness"; +CM_ SG_ 919 Left_Lane_Status "Display brightness range, 0 = no lane, 3 = full brightness"; +CM_ SG_ 919 Kombi_Lamp_Orange "Enables orange LDW light in instrument cluster"; +CM_ SG_ 919 Kombi_Lamp_Green "Enables green LDW light in instrument cluster"; +CM_ SG_ 780 Folgefahrt "Following another vehicle"; +CM_ SG_ 780 SetAbstand "Set following distance"; +CM_ SG_ 780 Abstand "Following distance"; +CM_ SG_ 780 SetSpeed "ACC set speed"; +CM_ SG_ 391 GearPosition "Traditional PRND plus B-mode aggressive regen, B-mode mapped to Drive"; +CM_ SG_ 960 ZAS_Kl_15 "Indicates ignition on"; +VAL_ 159 EPS_HCA_Status 0 "disabled" 1 "initializing" 2 "fault" 3 "ready" 4 "rejected" 5 "active"; +VAL_ 173 GE_Fahrstufe 5 "P" 6 "R" 7 "N" 8 "D" 9 "S" 10 "E" 14 "T"; +VAL_ 288 TSK_Status 0 "init" 1 "disabled" 2 "enabled" 3 "regulating" 4 "accel_pedal_override" 5 "brake_only" 6 "temp_fault" 7 "perm_fault"; +VAL_ 302 ACC_Freewheel_Type 0 "freewheel_released" 1 "freewheel_not_permitted" 2 "freewheel_not_released" 3 "freewheel_requested" ; +VAL_ 302 ACC_Hold_Type 0 "no_request" 1 "hold" 2 "park" 3 "hold_standby" 4 "startup" 5 "loosen_over_ramp" ; +VAL_ 391 GearPosition 2 "P" 3 "R" 4 "N" 5 "D" 6 "D"; +VAL_ 391 RegenBrakingMode 0 "default" 1 "B1" 2 "B2" 3 "B3"; +VAL_ 870 Fast_Send_Rate_Active 0 "1 Hz" 1 "50 Hz"; diff --git a/panda/.gitignore b/panda/.gitignore new file mode 100644 index 000000000..276b2c7f7 --- /dev/null +++ b/panda/.gitignore @@ -0,0 +1,22 @@ +*.pyc +.*.swp +.*.swo +*.o +*.so +*.os +*.d +*.dump +a.out +*~ +.#* +dist/ +pandacan.egg-info/ +board/obj/ +examples/output.csv +.DS_Store +.vscode* +nosetests.xml +.mypy_cache/ +.sconsign.dblite +board/flasher +board/pedal/flasher diff --git a/panda/__init__.py b/panda/__init__.py new file mode 100644 index 000000000..f93f7314d --- /dev/null +++ b/panda/__init__.py @@ -0,0 +1,9 @@ +# flake8: noqa +# pylint: skip-file +from .python import Panda, PandaDFU, flash_release, \ + BASEDIR, ensure_st_up_to_date, PandaSerial, pack_can_buffer, unpack_can_buffer, \ + DEFAULT_FW_FN, DEFAULT_H7_FW_FN, MCU_TYPE_H7, MCU_TYPE_F4, DLC_TO_LEN, LEN_TO_DLC + +from .python.config import BOOTSTUB_ADDRESS, BLOCK_SIZE_FX, APP_ADDRESS_FX, \ + BLOCK_SIZE_H7, APP_ADDRESS_H7, DEVICE_SERIAL_NUMBER_ADDR_H7, \ + DEVICE_SERIAL_NUMBER_ADDR_FX diff --git a/panda/board/flashPanda b/panda/board/flashPanda new file mode 100755 index 000000000..67a26421a --- /dev/null +++ b/panda/board/flashPanda @@ -0,0 +1,5 @@ +#! /bin/sh +tmux kill-session -t comma +cd /data/openpilot/panda/board +cp /data/openpilot/selfdrive/ui/qt/flasher ./flasher +exec ./flasher "Flash" recover.sh "-" flash.sh info.sh diff --git a/panda/board/info.sh b/panda/board/info.sh new file mode 100755 index 000000000..db3058be6 --- /dev/null +++ b/panda/board/info.sh @@ -0,0 +1,7 @@ +#! /bin/sh +echo "=================================" +echo "The Tinkla Panda Flasher" +echo "=================================" +echo "This app will flash the Panda so you can use OpenPilot." +echo "For best results please ensure your Tesla is in Car Off mode during this process." +echo " " \ No newline at end of file diff --git a/panda/board/obj/bootstub.panda.bin b/panda/board/obj/bootstub.panda.bin new file mode 100755 index 000000000..df4729464 Binary files /dev/null and b/panda/board/obj/bootstub.panda.bin differ diff --git a/panda/board/obj/bootstub.pedal.bin b/panda/board/obj/bootstub.pedal.bin new file mode 100755 index 000000000..b52923da3 Binary files /dev/null and b/panda/board/obj/bootstub.pedal.bin differ diff --git a/panda/board/obj/bootstub.pedal_usb.bin b/panda/board/obj/bootstub.pedal_usb.bin new file mode 100755 index 000000000..b52923da3 Binary files /dev/null and b/panda/board/obj/bootstub.pedal_usb.bin differ diff --git a/panda/board/obj/panda.bin.signed b/panda/board/obj/panda.bin.signed new file mode 100644 index 000000000..61259d5c0 Binary files /dev/null and b/panda/board/obj/panda.bin.signed differ diff --git a/panda/board/obj/pedal.bin.signed b/panda/board/obj/pedal.bin.signed new file mode 100644 index 000000000..83250e48f Binary files /dev/null and b/panda/board/obj/pedal.bin.signed differ diff --git a/panda/board/obj/pedal_usb.bin.signed b/panda/board/obj/pedal_usb.bin.signed new file mode 100644 index 000000000..a114cf41e Binary files /dev/null and b/panda/board/obj/pedal_usb.bin.signed differ diff --git a/panda/board/pedal/.gitignore b/panda/board/pedal/.gitignore new file mode 100644 index 000000000..94053f292 --- /dev/null +++ b/panda/board/pedal/.gitignore @@ -0,0 +1 @@ +obj/* diff --git a/panda/board/pedal/canhandle.py b/panda/board/pedal/canhandle.py new file mode 100644 index 000000000..dc9995415 --- /dev/null +++ b/panda/board/pedal/canhandle.py @@ -0,0 +1,42 @@ +import struct +import signal + + +class CanHandle(object): + def __init__(self, p, bus): + self.p = p + self.bus = bus + + def transact(self, dat): + self.p.isotp_send(1, dat, self.bus, recvaddr=2) + + def _handle_timeout(signum, frame): + # will happen on reset + raise Exception("timeout") + + signal.signal(signal.SIGALRM, _handle_timeout) + signal.alarm(1) + try: + ret = self.p.isotp_recv(2, self.bus, sendaddr=1) + finally: + signal.alarm(0) + + return ret + + def controlWrite(self, request_type, request, value, index, data, timeout=0): + # ignore data in reply, panda doesn't use it + return self.controlRead(request_type, request, value, index, 0, timeout) + + def controlRead(self, request_type, request, value, index, length, timeout=0): + dat = struct.pack("HHBBHHH", 0, 0, request_type, request, value, index, length) + return self.transact(dat) + + def bulkWrite(self, endpoint, data, timeout=0): + if len(data) > 0x10: + raise ValueError("Data must not be longer than 0x10") + dat = struct.pack("HH", endpoint, len(data)) + data + return self.transact(dat) + + def bulkRead(self, endpoint, length, timeout=0): + dat = struct.pack("HH", endpoint, 0) + return self.transact(dat) diff --git a/panda/board/pedal/enter_canloader.py b/panda/board/pedal/enter_canloader.py new file mode 100755 index 000000000..a83f42a78 --- /dev/null +++ b/panda/board/pedal/enter_canloader.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +import time +import argparse +from panda import Panda +from panda.board.pedal.canhandle import CanHandle +from selfdrive.car.modules.CFG_module import load_bool_param + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Flash pedal over can') + parser.add_argument('--recover', action='store_true') + parser.add_argument("fn", type=str, nargs='?', help="flash file") + args = parser.parse_args() + + p = Panda() + p.set_safety_mode(Panda.SAFETY_ALLOUTPUT) + pedalcan = 2 + if load_bool_param("TinklaPedalCanZero", False): + pedalcan = 0 + + while 1: + if len(p.can_recv()) == 0: + break + + if args.recover: + p.can_send(0x200, b"\xce\xfa\xad\xde\x1e\x0b\xb0\x02", pedalcan) + p.can_send(0x551, b"\xce\xfa\xad\xde\x1e\x0b\xb0\x02", pedalcan) + exit(0) + else: + p.can_send(0x200, b"\xce\xfa\xad\xde\x1e\x0b\xb0\x0a", pedalcan) + p.can_send(0x551, b"\xce\xfa\xad\xde\x1e\x0b\xb0\x0a", pedalcan) + + if args.fn: + time.sleep(0.1) + print("flashing", args.fn) + code = open(args.fn, "rb").read() + Panda.flash_static(CanHandle(p, pedalcan), code) + + print("can flash done") diff --git a/panda/board/pedal/flashPedal b/panda/board/pedal/flashPedal new file mode 100755 index 000000000..c5f29bf0a --- /dev/null +++ b/panda/board/pedal/flashPedal @@ -0,0 +1,5 @@ +#! /bin/sh +tmux kill-session -t comma +cd /data/openpilot/panda/board/pedal +cp /data/openpilot/selfdrive/ui/qt/flasher ./flasher +exec ./flasher "Flash" flash_can.sh "-" flash_can.sh info.sh diff --git a/panda/board/pedal/flash_can.sh b/panda/board/pedal/flash_can.sh new file mode 100755 index 000000000..08cb3d2c0 --- /dev/null +++ b/panda/board/pedal/flash_can.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +set -e + + +./enter_canloader.py ../obj/pedal.bin.signed diff --git a/panda/board/pedal/info.sh b/panda/board/pedal/info.sh new file mode 100755 index 000000000..7a8682b6c --- /dev/null +++ b/panda/board/pedal/info.sh @@ -0,0 +1,7 @@ +#! /bin/sh +echo "=================================" +echo "The Tinkla Pedal Flasher" +echo "=================================" +echo "This app will flash the Pedal so you can use it with OpenPilot for Tesla." +echo "For best results please ensure your Tesla is in Park (car is on) and keep foot on brake during this process." +echo " " \ No newline at end of file diff --git a/panda/board/pedal/recover.sh b/panda/board/pedal/recover.sh new file mode 100755 index 000000000..c08ab361f --- /dev/null +++ b/panda/board/pedal/recover.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +set -e + +DFU_UTIL="dfu-util" + +$DFU_UTIL -d 0483:df11 -a 0 -s 0x08004000 -D ../obj/pedal.bin.signed +$DFU_UTIL -d 0483:df11 -a 0 -s 0x08000000:leave -D ../obj/bootstub.pedal.bin diff --git a/panda/board/recover.sh b/panda/board/recover.sh new file mode 100755 index 000000000..8cb2d3903 --- /dev/null +++ b/panda/board/recover.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env sh +DFU_UTIL="dfu-util" + +echo "=================================" +echo "RECOVER PROCESS STARTED" +echo "=================================" +echo " " +echo "Starting the recover process..." +echo " " +PYTHONPATH=.. python3 -c "from python import Panda; Panda().reset(enter_bootstub=True); Panda().reset(enter_bootloader=True)" || true +ret=$? +if [ $ret -ne 0 ]; then + echo "=================================" + echo " RECOVER PROCESS FAILED" + echo "=================================" + echo " Please check logs above for errors" + echo " " + exit 1 +fi +sleep 1 +$DFU_UTIL -d 0483:df11 -a 0 -s 0x08004000 -D obj/panda.bin.signed +ret=$? +if [ $ret -ne 0 ]; then + echo "=================================" + echo " RECOVER PROCESS FAILED" + echo "=================================" + echo " Please check logs above for errors" + echo " " + exit 1 +fi +$DFU_UTIL -d 0483:df11 -a 0 -s 0x08000000:leave -D obj/bootstub.panda.bin +ret=$? +if [ $ret -ne 0 ]; then + echo "=================================" + echo " RECOVER PROCESS FAILED" + echo "=================================" + echo " Please check logs above for errors" + echo " " + exit 1 +fi +echo "=================================" +echo " RECOVER PROCESS COMPLETED" +echo "=================================" +echo " Please hit Reboot to return to OP" +exit 0 diff --git a/panda/examples/query_fw_versions.py b/panda/examples/query_fw_versions.py new file mode 100755 index 000000000..4132959be --- /dev/null +++ b/panda/examples/query_fw_versions.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python3 +import argparse +from tqdm import tqdm +from panda import Panda +from panda.python.uds import UdsClient, MessageTimeoutError, NegativeResponseError, SESSION_TYPE, DATA_IDENTIFIER_TYPE + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('--rxoffset', default="") + parser.add_argument('--nonstandard', action='store_true') + parser.add_argument('--debug', action='store_true') + parser.add_argument('--addr') + args = parser.parse_args() + + if args.addr: + addrs = [int(args.addr, base=16)] + else: + addrs = [0x700 + i for i in range(256)] + addrs += [0x18da0000 + (i << 8) + 0xf1 for i in range(256)] + results = {} + + uds_data_ids = {} + for std_id in DATA_IDENTIFIER_TYPE: + uds_data_ids[std_id.value] = std_id.name + if args.nonstandard: + for uds_id in range(0xf100,0xf180): + uds_data_ids[uds_id] = "IDENTIFICATION_OPTION_VEHICLE_MANUFACTURER_SPECIFIC_DATA_IDENTIFIER" + for uds_id in range(0xf1a0,0xf1f0): + uds_data_ids[uds_id] = "IDENTIFICATION_OPTION_VEHICLE_MANUFACTURER_SPECIFIC" + for uds_id in range(0xf1f0,0xf200): + uds_data_ids[uds_id] = "IDENTIFICATION_OPTION_SYSTEM_SUPPLIER_SPECIFIC" + + panda = Panda() + panda.set_safety_mode(Panda.SAFETY_ELM327) + print("querying addresses ...") + with tqdm(addrs) as t: + for addr in t: + # skip functional broadcast addrs + if addr == 0x7df or addr == 0x18db33f1: + continue + t.set_description(hex(addr)) + panda.send_heartbeat() + + bus = 1 if panda.has_obd() else 0 + rx_addr = addr + int(args.rxoffset, base=16) if args.rxoffset else None + uds_client = UdsClient(panda, addr, rx_addr, bus, timeout=0.2, debug=args.debug) + # Check for anything alive at this address, and switch to the highest + # available diagnostic session without security access + try: + uds_client.tester_present() + uds_client.diagnostic_session_control(SESSION_TYPE.DEFAULT) + uds_client.diagnostic_session_control(SESSION_TYPE.EXTENDED_DIAGNOSTIC) + except NegativeResponseError: + pass + except MessageTimeoutError: + continue + + # Run queries against all standard UDS data identifiers, plus selected + # non-standardized identifier ranges if requested + resp = {} + for uds_data_id in sorted(uds_data_ids): + try: + data = uds_client.read_data_by_identifier(uds_data_id) # type: ignore + if data: + resp[uds_data_id] = data + except (NegativeResponseError, MessageTimeoutError): + pass + + if resp.keys(): + results[addr] = resp + + if len(results.items()): + for addr, resp in results.items(): + print(f"\n\n*** Results for address 0x{addr:X} ***\n\n") + for rid, dat in resp.items(): + print(f"0x{rid:02X} {uds_data_ids[rid]}: {dat}") + else: + print("no fw versions found!") diff --git a/panda/python/__init__.py b/panda/python/__init__.py new file mode 100644 index 000000000..30808d769 --- /dev/null +++ b/panda/python/__init__.py @@ -0,0 +1,738 @@ +# python library to interface with panda +import datetime +import struct +import hashlib +import usb1 +import os +import time +import traceback +import sys +from functools import wraps +from .dfu import PandaDFU, MCU_TYPE_F2, MCU_TYPE_F4, MCU_TYPE_H7 # pylint: disable=import-error +from .flash_release import flash_release # noqa pylint: disable=import-error +from .update import ensure_st_up_to_date # noqa pylint: disable=import-error +from .serial import PandaSerial # noqa pylint: disable=import-error +from .isotp import isotp_send, isotp_recv # pylint: disable=import-error +from .config import DEFAULT_FW_FN, DEFAULT_H7_FW_FN # noqa pylint: disable=import-error + +__version__ = '0.0.10' + +BASEDIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../") + +DEBUG = os.getenv("PANDADEBUG") is not None + +CANPACKET_HEAD_SIZE = 0x5 +DLC_TO_LEN = [0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 20, 24, 32, 48, 64] +LEN_TO_DLC = {length: dlc for (dlc, length) in enumerate(DLC_TO_LEN)} + +def pack_can_buffer(arr): + snds = [b''] + idx = 0 + for address, _, dat, bus in arr: + assert len(dat) in LEN_TO_DLC + if DEBUG: + print(f" W 0x{address:x}: 0x{dat.hex()}") + extended = 1 if address >= 0x800 else 0 + data_len_code = LEN_TO_DLC[len(dat)] + header = bytearray(5) + word_4b = address << 3 | extended << 2 + header[0] = (data_len_code << 4) | (bus << 1) + header[1] = word_4b & 0xFF + header[2] = (word_4b >> 8) & 0xFF + header[3] = (word_4b >> 16) & 0xFF + header[4] = (word_4b >> 24) & 0xFF + snds[idx] += header + dat + if len(snds[idx]) > 256: # Limit chunks to 256 bytes + snds.append(b'') + idx += 1 + + #Apply counter to each 64 byte packet + for idx in range(len(snds)): + tx = b'' + counter = 0 + for i in range (0, len(snds[idx]), 63): + tx += bytes([counter]) + snds[idx][i:i+63] + counter += 1 + snds[idx] = tx + return snds + +def unpack_can_buffer(dat): + ret = [] + counter = 0 + tail = bytearray() + for i in range(0, len(dat), 64): + if counter != dat[i]: + print("CAN: LOST RECV PACKET COUNTER") + break + counter+=1 + chunk = tail + dat[i+1:i+64] + tail = bytearray() + pos = 0 + while pos>4)] + pckt_len = CANPACKET_HEAD_SIZE + data_len + if pckt_len <= len(chunk[pos:]): + header = chunk[pos:pos+CANPACKET_HEAD_SIZE] + if len(header) < 5: + print("CAN: MALFORMED USB RECV PACKET") + break + bus = (header[0] >> 1) & 0x7 + address = (header[4] << 24 | header[3] << 16 | header[2] << 8 | header[1]) >> 3 + returned = (header[1] >> 1) & 0x1 + rejected = header[1] & 0x1 + data = chunk[pos + CANPACKET_HEAD_SIZE:pos + CANPACKET_HEAD_SIZE + data_len] + if returned: + bus += 128 + if rejected: + bus += 192 + if DEBUG: + print(f" R 0x{address:x}: 0x{data.hex()}") + ret.append((address, 0, data, bus)) + pos += pckt_len + else: + tail = chunk[pos:] + break + return ret + +def ensure_health_packet_version(fn): + @wraps(fn) + def wrapper(self, *args, **kwargs): + if self.health_version < self.HEALTH_PACKET_VERSION: + raise RuntimeError("Panda firmware has outdated health packet definition. Reflash panda firmware.") + elif self.health_version > self.HEALTH_PACKET_VERSION: + raise RuntimeError("Panda python library has outdated health packet definition. Update panda python library.") + return fn(self, *args, **kwargs) + return wrapper + +def ensure_can_packet_version(fn): + @wraps(fn) + def wrapper(self, *args, **kwargs): + if self.can_version < self.CAN_PACKET_VERSION: + raise RuntimeError("Panda firmware has outdated CAN packet definition. Reflash panda firmware.") + elif self.can_version > self.CAN_PACKET_VERSION: + raise RuntimeError("Panda python library has outdated CAN packet definition. Update panda python library.") + return fn(self, *args, **kwargs) + return wrapper + +class Panda(object): + + # matches cereal.car.CarParams.SafetyModel + SAFETY_SILENT = 0 + SAFETY_HONDA_NIDEC = 1 + SAFETY_TOYOTA = 2 + SAFETY_ELM327 = 3 + SAFETY_GM = 4 + SAFETY_HONDA_BOSCH_GIRAFFE = 5 + SAFETY_FORD = 6 + SAFETY_HYUNDAI = 8 + SAFETY_CHRYSLER = 9 + SAFETY_TESLA = 10 + SAFETY_SUBARU = 11 + SAFETY_MAZDA = 13 + SAFETY_NISSAN = 14 + SAFETY_VOLKSWAGEN_MQB = 15 + SAFETY_ALLOUTPUT = 17 + SAFETY_GM_ASCM = 18 + SAFETY_NOOUTPUT = 19 + SAFETY_HONDA_BOSCH = 20 + SAFETY_VOLKSWAGEN_PQ = 21 + SAFETY_SUBARU_LEGACY = 22 + SAFETY_HYUNDAI_LEGACY = 23 + + SERIAL_DEBUG = 0 + SERIAL_ESP = 1 + SERIAL_LIN1 = 2 + SERIAL_LIN2 = 3 + + GMLAN_CAN2 = 1 + GMLAN_CAN3 = 2 + + REQUEST_IN = usb1.ENDPOINT_IN | usb1.TYPE_VENDOR | usb1.RECIPIENT_DEVICE + REQUEST_OUT = usb1.ENDPOINT_OUT | usb1.TYPE_VENDOR | usb1.RECIPIENT_DEVICE + + HW_TYPE_UNKNOWN = b'\x00' + HW_TYPE_WHITE_PANDA = b'\x01' + HW_TYPE_GREY_PANDA = b'\x02' + HW_TYPE_BLACK_PANDA = b'\x03' + HW_TYPE_PEDAL = b'\x04' + HW_TYPE_UNO = b'\x05' + HW_TYPE_DOS = b'\x06' + HW_TYPE_RED_PANDA = b'\x07' + + CAN_PACKET_VERSION = 2 + HEALTH_PACKET_VERSION = 3 + HEALTH_STRUCT = struct.Struct(" timeout: + return False + + dfu = PandaDFU(PandaDFU.st_serial_to_dfu_serial(self._serial, self._mcu_type)) + dfu.recover() + + # reflash after recover + self.connect(True, True) + self.flash() + return True + + @staticmethod + def list(): + context = usb1.USBContext() + ret = [] + try: + for device in context.getDeviceList(skip_on_error=True): + if device.getVendorID() == 0xbbaa and device.getProductID() in [0xddcc, 0xddee]: + try: + ret.append(device.getSerialNumber()) + except Exception: + continue + except Exception: + pass + return ret + + def call_control_api(self, msg): + self._handle.controlWrite(Panda.REQUEST_OUT, msg, 0, 0, b'') + + # ******************* health ******************* + + @ensure_health_packet_version + def health(self): + dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, self.HEALTH_STRUCT.size) + a = self.HEALTH_STRUCT.unpack(dat) + return { + "uptime": a[0], + "voltage": a[1], + "current": a[2], + "can_rx_errs": a[3], + "can_send_errs": a[4], + "can_fwd_errs": a[5], + "gmlan_send_errs": a[6], + "faults": a[7], + "ignition_line": a[8], + "ignition_can": a[9], + "controls_allowed": a[10], + "gas_interceptor_detected": a[11], + "car_harness_status": a[12], + "usb_power_mode": a[13], + "safety_mode": a[14], + "safety_param": a[15], + "fault_status": a[16], + "power_save_enabled": a[17], + "heartbeat_lost": a[18], + "unsafe_mode": a[19], + "blocked_msg_cnt": a[20], + } + + # ******************* control ******************* + + def enter_bootloader(self): + try: + self._handle.controlWrite(Panda.REQUEST_OUT, 0xd1, 0, 0, b'') + except Exception as e: + print(e) + + def get_version(self): + return self._handle.controlRead(Panda.REQUEST_IN, 0xd6, 0, 0, 0x40).decode('utf8') + + @staticmethod + def get_signature_from_firmware(fn): + f = open(fn, 'rb') + f.seek(-128, 2) # Seek from end of file + return f.read(128) + + def get_signature(self): + part_1 = self._handle.controlRead(Panda.REQUEST_IN, 0xd3, 0, 0, 0x40) + part_2 = self._handle.controlRead(Panda.REQUEST_IN, 0xd4, 0, 0, 0x40) + return bytes(part_1 + part_2) + + def get_type(self): + return self._handle.controlRead(Panda.REQUEST_IN, 0xc1, 0, 0, 0x40) + + # Returns tuple with health packet version and CAN packet/USB packet version + def get_packets_versions(self): + dat = self._handle.controlRead(Panda.REQUEST_IN, 0xdd, 0, 0, 2) + if dat: + a = struct.unpack("BB", dat) + return (a[0], a[1]) + else: + return (0, 0) + + def is_white(self): + return self.get_type() == Panda.HW_TYPE_WHITE_PANDA + + def is_grey(self): + return self.get_type() == Panda.HW_TYPE_GREY_PANDA + + def is_black(self): + return self.get_type() == Panda.HW_TYPE_BLACK_PANDA + + def is_pedal(self): + return self.get_type() == Panda.HW_TYPE_PEDAL + + def is_uno(self): + return self.get_type() == Panda.HW_TYPE_UNO + + def is_dos(self): + return self.get_type() == Panda.HW_TYPE_DOS + + def is_red(self): + return self.get_type() == Panda.HW_TYPE_RED_PANDA + + def get_mcu_type(self): + hw_type = self.get_type() + if hw_type in Panda.F2_DEVICES: + return MCU_TYPE_F2 + elif hw_type in Panda.F4_DEVICES: + return MCU_TYPE_F4 + elif hw_type in Panda.H7_DEVICES: + return MCU_TYPE_H7 + return None + + def has_obd(self): + return (self.is_uno() or self.is_dos() or self.is_black() or self.is_red()) + + def has_canfd(self): + return self._mcu_type in Panda.H7_DEVICES + + def is_internal(self): + return self.get_type() in [Panda.HW_TYPE_UNO, Panda.HW_TYPE_DOS] + + def get_serial(self): + dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd0, 0, 0, 0x20) + hashsig, calc_hash = dat[0x1c:], hashlib.sha1(dat[0:0x1c]).digest()[0:4] + assert(hashsig == calc_hash) + return [dat[0:0x10].decode("utf8"), dat[0x10:0x10 + 10].decode("utf8")] + + def get_usb_serial(self): + return self._serial + + def get_secret(self): + return self._handle.controlRead(Panda.REQUEST_IN, 0xd0, 1, 0, 0x10) + + # ******************* configuration ******************* + + def set_usb_power(self, on): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xe6, int(on), 0, b'') + + def set_power_save(self, power_save_enabled=0): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xe7, int(power_save_enabled), 0, b'') + + def set_esp_power(self, on): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xd9, int(on), 0, b'') + + def esp_reset(self, bootmode=0): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xda, int(bootmode), 0, b'') + time.sleep(0.2) + + def set_safety_mode(self, mode=SAFETY_SILENT, param=0, disable_checks=True): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xdc, mode, param, b'') + if disable_checks: + self.set_heartbeat_disabled() + self.set_power_save(0) + + def set_gmlan(self, bus=2): + # TODO: check panda type + if bus is None: + self._handle.controlWrite(Panda.REQUEST_OUT, 0xdb, 0, 0, b'') + elif bus in [Panda.GMLAN_CAN2, Panda.GMLAN_CAN3]: + self._handle.controlWrite(Panda.REQUEST_OUT, 0xdb, 1, bus, b'') + + def set_obd(self, obd): + # TODO: check panda type + self._handle.controlWrite(Panda.REQUEST_OUT, 0xdb, int(obd), 0, b'') + + def set_can_loopback(self, enable): + # set can loopback mode for all buses + self._handle.controlWrite(Panda.REQUEST_OUT, 0xe5, int(enable), 0, b'') + + def set_can_enable(self, bus_num, enable): + # sets the can transceiver enable pin + self._handle.controlWrite(Panda.REQUEST_OUT, 0xf4, int(bus_num), int(enable), b'') + + def set_can_speed_kbps(self, bus, speed): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xde, bus, int(speed * 10), b'') + + def set_can_data_speed_kbps(self, bus, speed): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xf9, bus, int(speed * 10), b'') + + # CAN FD and BRS status + def get_canfd_status(self, bus): + dat = self._handle.controlRead(Panda.REQUEST_IN, 0xfa, bus, 0, 2) + if dat: + a = struct.unpack("BB", dat) + return (a[0], a[1]) + else: + return (None, None) + + def set_uart_baud(self, uart, rate): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xe4, uart, int(rate / 300), b'') + + def set_uart_parity(self, uart, parity): + # parity, 0=off, 1=even, 2=odd + self._handle.controlWrite(Panda.REQUEST_OUT, 0xe2, uart, parity, b'') + + def set_uart_callback(self, uart, install): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xe3, uart, int(install), b'') + + # ******************* can ******************* + + # The panda will NAK CAN writes when there is CAN congestion. + # libusb will try to send it again, with a max timeout. + # Timeout is in ms. If set to 0, the timeout is infinite. + CAN_SEND_TIMEOUT_MS = 10 + + @ensure_can_packet_version + def can_send_many(self, arr, timeout=CAN_SEND_TIMEOUT_MS): + snds = pack_can_buffer(arr) + while True: + try: + for tx in snds: + while True: + bs = self._handle.bulkWrite(3, tx, timeout=timeout) + tx = tx[bs:] + if len(tx) == 0: + break + print("CAN: PARTIAL SEND MANY, RETRYING") + break + except (usb1.USBErrorIO, usb1.USBErrorOverflow): + print("CAN: BAD SEND MANY, RETRYING") + + def can_send(self, addr, dat, bus, timeout=CAN_SEND_TIMEOUT_MS): + self.can_send_many([[addr, None, dat, bus]], timeout=timeout) + + @ensure_can_packet_version + def can_recv(self): + dat = bytearray() + while True: + try: + dat = self._handle.bulkRead(1, 16384) # Max receive batch size + 2 extra reserve frames + break + except (usb1.USBErrorIO, usb1.USBErrorOverflow): + print("CAN: BAD RECV, RETRYING") + time.sleep(0.1) + return unpack_can_buffer(dat) + + def can_clear(self, bus): + """Clears all messages from the specified internal CAN ringbuffer as + though it were drained. + + Args: + bus (int): can bus number to clear a tx queue, or 0xFFFF to clear the + global can rx queue. + + """ + self._handle.controlWrite(Panda.REQUEST_OUT, 0xf1, bus, 0, b'') + + # ******************* isotp ******************* + + def isotp_send(self, addr, dat, bus, recvaddr=None, subaddr=None): + return isotp_send(self, dat, addr, bus, recvaddr, subaddr) + + def isotp_recv(self, addr, bus=0, sendaddr=None, subaddr=None): + return isotp_recv(self, addr, bus, sendaddr, subaddr) + + # ******************* serial ******************* + + def serial_read(self, port_number): + ret = [] + while 1: + lret = bytes(self._handle.controlRead(Panda.REQUEST_IN, 0xe0, port_number, 0, 0x40)) + if len(lret) == 0: + break + ret.append(lret) + return b''.join(ret) + + def serial_write(self, port_number, ln): + ret = 0 + for i in range(0, len(ln), 0x20): + ret += self._handle.bulkWrite(2, struct.pack("B", port_number) + ln[i:i + 0x20]) + return ret + + def serial_clear(self, port_number): + """Clears all messages (tx and rx) from the specified internal uart + ringbuffer as though it were drained. + + Args: + port_number (int): port number of the uart to clear. + + """ + self._handle.controlWrite(Panda.REQUEST_OUT, 0xf2, port_number, 0, b'') + + # ******************* kline ******************* + + # pulse low for wakeup + def kline_wakeup(self, k=True, l=True): + assert k or l, "must specify k-line, l-line, or both" + if DEBUG: + print("kline wakeup...") + self._handle.controlWrite(Panda.REQUEST_OUT, 0xf0, 2 if k and l else int(l), 0, b'') + if DEBUG: + print("kline wakeup done") + + def kline_5baud(self, addr, k=True, l=True): + assert k or l, "must specify k-line, l-line, or both" + if DEBUG: + print("kline 5 baud...") + self._handle.controlWrite(Panda.REQUEST_OUT, 0xf4, 2 if k and l else int(l), addr, b'') + if DEBUG: + print("kline 5 baud done") + + def kline_drain(self, bus=2): + # drain buffer + bret = bytearray() + while True: + ret = self._handle.controlRead(Panda.REQUEST_IN, 0xe0, bus, 0, 0x40) + if len(ret) == 0: + break + elif DEBUG: + print(f"kline drain: 0x{ret.hex()}") + bret += ret + return bytes(bret) + + def kline_ll_recv(self, cnt, bus=2): + echo = bytearray() + while len(echo) != cnt: + ret = self._handle.controlRead(Panda.REQUEST_OUT, 0xe0, bus, 0, cnt - len(echo)) + if DEBUG and len(ret) > 0: + print(f"kline recv: 0x{ret.hex()}") + echo += ret + return bytes(echo) + + def kline_send(self, x, bus=2, checksum=True): + self.kline_drain(bus=bus) + if checksum: + x += bytes([sum(x) % 0x100]) + for i in range(0, len(x), 0xf): + ts = x[i:i + 0xf] + if DEBUG: + print(f"kline send: 0x{ts.hex()}") + self._handle.bulkWrite(2, bytes([bus]) + ts) + echo = self.kline_ll_recv(len(ts), bus=bus) + if echo != ts: + print(f"**** ECHO ERROR {i} ****") + print(f"0x{echo.hex()}") + print(f"0x{ts.hex()}") + assert echo == ts + + def kline_recv(self, bus=2, header_len=4): + # read header (last byte is length) + msg = self.kline_ll_recv(header_len, bus=bus) + # read data (add one byte to length for checksum) + msg += self.kline_ll_recv(msg[-1]+1, bus=bus) + return msg + + def send_heartbeat(self, engaged=True): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xf3, engaged, 0, b'') + + # disable heartbeat checks for use outside of openpilot + # sending a heartbeat will reenable the checks + def set_heartbeat_disabled(self): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xf8, 0, 0, b'') + + # ******************* RTC ******************* + def set_datetime(self, dt): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xa1, int(dt.year), 0, b'') + self._handle.controlWrite(Panda.REQUEST_OUT, 0xa2, int(dt.month), 0, b'') + self._handle.controlWrite(Panda.REQUEST_OUT, 0xa3, int(dt.day), 0, b'') + self._handle.controlWrite(Panda.REQUEST_OUT, 0xa4, int(dt.isoweekday()), 0, b'') + self._handle.controlWrite(Panda.REQUEST_OUT, 0xa5, int(dt.hour), 0, b'') + self._handle.controlWrite(Panda.REQUEST_OUT, 0xa6, int(dt.minute), 0, b'') + self._handle.controlWrite(Panda.REQUEST_OUT, 0xa7, int(dt.second), 0, b'') + + def get_datetime(self): + dat = self._handle.controlRead(Panda.REQUEST_IN, 0xa0, 0, 0, 8) + a = struct.unpack("HBBBBBB", dat) + return datetime.datetime(a[0], a[1], a[2], a[4], a[5], a[6]) + + # ******************* IR ******************* + def set_ir_power(self, percentage): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xb0, int(percentage), 0, b'') + + # ******************* Fan ****************** + def set_fan_power(self, percentage): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xb1, int(percentage), 0, b'') + + def get_fan_rpm(self): + dat = self._handle.controlRead(Panda.REQUEST_IN, 0xb2, 0, 0, 2) + a = struct.unpack("H", dat) + return a[0] + + # ****************** Phone ***************** + def set_phone_power(self, enabled): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xb3, int(enabled), 0, b'') + + # ************** Clock Source ************** + def set_clock_source_mode(self, mode): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xf5, int(mode), 0, b'') + + # ****************** Siren ***************** + def set_siren(self, enabled): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xf6, int(enabled), 0, b'') + + # ****************** Debug ***************** + def set_green_led(self, enabled): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xf7, int(enabled), 0, b'') diff --git a/panda/python/ccp.py b/panda/python/ccp.py new file mode 100644 index 000000000..a8c00169f --- /dev/null +++ b/panda/python/ccp.py @@ -0,0 +1,362 @@ +#!/usr/bin/env python3 +import sys +import time +import struct +from enum import IntEnum, Enum + +class COMMAND_CODE(IntEnum): + CONNECT = 0x01 + SET_MTA = 0x02 + DNLOAD = 0x03 + UPLOAD = 0x04 + TEST = 0x05 + START_STOP = 0x06 + DISCONNECT = 0x07 + START_STOP_ALL = 0x08 + GET_ACTIVE_CAL_PAGE = 0x09 + SET_S_STATUS = 0x0C + GET_S_STATUS = 0x0D + BUILD_CHKSUM = 0x0E + SHORT_UP = 0x0F + CLEAR_MEMORY = 0x10 + SELECT_CAL_PAGE = 0x11 + GET_SEED = 0x12 + UNLOCK = 0x13 + GET_DAQ_SIZE = 0x14 + SET_DAQ_PTR = 0x15 + WRITE_DAQ = 0x16 + EXCHANGE_ID = 0x17 + PROGRAM = 0x18 + MOVE = 0x19 + GET_CCP_VERSION = 0x1B + DIAG_SERVICE = 0x20 + ACTION_SERVICE = 0x21 + PROGRAM_6 = 0x22 + DNLOAD_6 = 0x23 + +COMMAND_RETURN_CODES = { + 0x00: "acknowledge / no error", + 0x01: "DAQ processor overload", + 0x10: "command processor busy", + 0x11: "DAQ processor busy", + 0x12: "internal timeout", + 0x18: "key request", + 0x19: "session status request", + 0x20: "cold start request", + 0x21: "cal. data init. request", + 0x22: "DAQ list init. request", + 0x23: "code update request", + 0x30: "unknown command", + 0x31: "command syntax", + 0x32: "parameter(s) out of range", + 0x33: "access denied", + 0x34: "overload", + 0x35: "access locked", + 0x36: "resource/function not available", +} + +class BYTE_ORDER(Enum): + LITTLE_ENDIAN = '<' + BIG_ENDIAN = '>' + +class CommandTimeoutError(Exception): + pass + +class CommandCounterError(Exception): + pass + +class CommandResponseError(Exception): + def __init__(self, message, return_code): + super().__init__() + self.message = message + self.return_code = return_code + + def __str__(self): + return self.message + +class CcpClient(): + def __init__(self, panda, tx_addr: int, rx_addr: int, bus: int=0, byte_order: BYTE_ORDER=BYTE_ORDER.BIG_ENDIAN, debug=False): + self.tx_addr = tx_addr + self.rx_addr = rx_addr + self.can_bus = bus + self.byte_order = byte_order + self.debug = debug + self._panda = panda + self._command_counter = -1 + + def _send_cro(self, cmd: int, dat: bytes = b"") -> None: + self._command_counter = (self._command_counter + 1) & 0xFF + tx_data = (bytes([cmd, self._command_counter]) + dat).ljust(8, b"\x00") + if self.debug: + print(f"CAN-TX: {hex(self.tx_addr)} - 0x{bytes.hex(tx_data)}") + assert len(tx_data) == 8, "data is not 8 bytes" + self._panda.can_clear(self.can_bus) + self._panda.can_clear(0xFFFF) + self._panda.can_send(self.tx_addr, tx_data, self.can_bus) + + def _recv_dto(self, timeout: float) -> bytes: + start_time = time.time() + while time.time() - start_time < timeout: + msgs = self._panda.can_recv() or [] + if len(msgs) >= 256: + print("CAN RX buffer overflow!!!", file=sys.stderr) + for rx_addr, _, rx_data, rx_bus in msgs: + if rx_bus == self.can_bus and rx_addr == self.rx_addr: + rx_data = bytes(rx_data) # convert bytearray to bytes + if self.debug: + print(f"CAN-RX: {hex(rx_addr)} - 0x{bytes.hex(rx_data)}") + assert len(rx_data) == 8, f"message length not 8: {len(rx_data)}" + + pid = rx_data[0] + if pid == 0xFF or pid == 0xFE: + err = rx_data[1] + err_desc = COMMAND_RETURN_CODES.get(err, "unknown error") + ctr = rx_data[2] + dat = rx_data[3:] + + if pid == 0xFF and self._command_counter != ctr: + raise CommandCounterError(f"counter invalid: {ctr} != {self._command_counter}") + + if err >= 0x10 and err <= 0x12: + if self.debug: + print(f"CCP-WAIT: {hex(err)} - {err_desc}") + start_time = time.time() + continue + + if err >= 0x30: + raise CommandResponseError(f"{hex(err)} - {err_desc}", err) + else: + dat = rx_data[1:] + + return dat + time.sleep(0.001) + + raise CommandTimeoutError("timeout waiting for response") + + # commands + def connect(self, station_addr: int) -> None: + if station_addr > 65535: + raise ValueError("station address must be less than 65536") + # NOTE: station address is always little endian + self._send_cro(COMMAND_CODE.CONNECT, struct.pack(" dict: + self._send_cro(COMMAND_CODE.EXCHANGE_ID, device_id_info) + resp = self._recv_dto(0.025) + return { # TODO: define a type + "id_length": resp[0], + "data_type": resp[1], + "available": resp[2], + "protected": resp[3], + } + + def get_seed(self, resource_mask: int) -> bytes: + if resource_mask > 255: + raise ValueError("resource mask must be less than 256") + self._send_cro(COMMAND_CODE.GET_SEED) + resp = self._recv_dto(0.025) + # protected = resp[0] == 0 + seed = resp[1:] + return seed + + def unlock(self, key: bytes) -> int: + if len(key) > 6: + raise ValueError("max key size is 6 bytes") + self._send_cro(COMMAND_CODE.UNLOCK, key) + resp = self._recv_dto(0.025) + status = resp[0] + return status + + def set_memory_transfer_address(self, mta_num: int, addr_ext: int, addr: int) -> None: + if mta_num > 255: + raise ValueError("MTA number must be less than 256") + if addr_ext > 255: + raise ValueError("address extension must be less than 256") + self._send_cro(COMMAND_CODE.SET_MTA, bytes([mta_num, addr_ext]) + struct.pack(f"{self.byte_order.value}I", addr)) + self._recv_dto(0.025) + + def download(self, data: bytes) -> int: + if len(data) > 5: + raise ValueError("max data size is 5 bytes") + self._send_cro(COMMAND_CODE.DNLOAD, bytes([len(data)]) + data) + resp = self._recv_dto(0.025) + # mta_addr_ext = resp[0] + mta_addr = struct.unpack(f"{self.byte_order.value}I", resp[1:5])[0] + return mta_addr + + def download_6_bytes(self, data: bytes) -> int: + if len(data) != 6: + raise ValueError("data size must be 6 bytes") + self._send_cro(COMMAND_CODE.DNLOAD_6, data) + resp = self._recv_dto(0.025) + # mta_addr_ext = resp[0] + mta_addr = struct.unpack(f"{self.byte_order.value}I", resp[1:5])[0] + return mta_addr + + def upload(self, size: int) -> bytes: + if size > 5: + raise ValueError("size must be less than 6") + self._send_cro(COMMAND_CODE.UPLOAD, bytes([size])) + return self._recv_dto(0.025) + + def short_upload(self, size: int, addr_ext: int, addr: int) -> bytes: + if size > 5: + raise ValueError("size must be less than 6") + if addr_ext > 255: + raise ValueError("address extension must be less than 256") + self._send_cro(COMMAND_CODE.SHORT_UP, bytes([size, addr_ext]) + struct.pack(f"{self.byte_order.value}I", addr)) + return self._recv_dto(0.025) + + def select_calibration_page(self) -> None: + self._send_cro(COMMAND_CODE.SELECT_CAL_PAGE) + self._recv_dto(0.025) + + def get_daq_list_size(self, list_num: int, can_id: int = 0) -> dict: + if list_num > 255: + raise ValueError("list number must be less than 256") + self._send_cro(COMMAND_CODE.GET_DAQ_SIZE, bytes([list_num, 0]) + struct.pack(f"{self.byte_order.value}I", can_id)) + resp = self._recv_dto(0.025) + return { # TODO: define a type + "list_size": resp[0], + "first_pid": resp[1], + } + + def set_daq_list_pointer(self, list_num: int, odt_num: int, element_num: int) -> None: + if list_num > 255: + raise ValueError("list number must be less than 256") + if odt_num > 255: + raise ValueError("ODT number must be less than 256") + if element_num > 255: + raise ValueError("element number must be less than 256") + self._send_cro(COMMAND_CODE.SET_DAQ_PTR, bytes([list_num, odt_num, element_num])) + self._recv_dto(0.025) + + def write_daq_list_entry(self, size: int, addr_ext: int, addr: int) -> None: + if size > 255: + raise ValueError("size must be less than 256") + if addr_ext > 255: + raise ValueError("address extension must be less than 256") + self._send_cro(COMMAND_CODE.WRITE_DAQ, bytes([size, addr_ext]) + struct.pack(f"{self.byte_order.value}I", addr)) + self._recv_dto(0.025) + + def start_stop_transmission(self, mode: int, list_num: int, odt_num: int, channel_num: int, rate_prescaler: int = 0) -> None: + if mode > 255: + raise ValueError("mode must be less than 256") + if list_num > 255: + raise ValueError("list number must be less than 256") + if odt_num > 255: + raise ValueError("ODT number must be less than 256") + if channel_num > 255: + raise ValueError("channel number must be less than 256") + if rate_prescaler > 65535: + raise ValueError("rate prescaler must be less than 65536") + self._send_cro(COMMAND_CODE.START_STOP, bytes([mode, list_num, odt_num, channel_num]) + struct.pack(f"{self.byte_order.value}H", rate_prescaler)) + self._recv_dto(0.025) + + def disconnect(self, station_addr: int, temporary: bool = False) -> None: + if station_addr > 65535: + raise ValueError("station address must be less than 65536") + # NOTE: station address is always little endian + self._send_cro(COMMAND_CODE.DISCONNECT, bytes([int(not temporary), 0x00]) + struct.pack(" None: + if status > 255: + raise ValueError("status must be less than 256") + self._send_cro(COMMAND_CODE.SET_S_STATUS, bytes([status])) + self._recv_dto(0.025) + + def get_session_status(self) -> dict: + self._send_cro(COMMAND_CODE.GET_S_STATUS) + resp = self._recv_dto(0.025) + return { # TODO: define a type + "status": resp[0], + "info": resp[2] if resp[1] else None, + } + + def build_checksum(self, size: int) -> bytes: + self._send_cro(COMMAND_CODE.BUILD_CHKSUM, struct.pack(f"{self.byte_order.value}I", size)) + resp = self._recv_dto(30.0) + chksum_size = resp[0] + assert chksum_size <= 4, "checksum more than 4 bytes" + chksum = resp[1:1+chksum_size] + return chksum + + def clear_memory(self, size: int) -> None: + self._send_cro(COMMAND_CODE.CLEAR_MEMORY, struct.pack(f"{self.byte_order.value}I", size)) + self._recv_dto(30.0) + + def program(self, size: int, data: bytes) -> int: + if size > 5: + raise ValueError("size must be less than 6") + if len(data) > 5: + raise ValueError("max data size is 5 bytes") + self._send_cro(COMMAND_CODE.PROGRAM, bytes([size]) + data) + resp = self._recv_dto(0.1) + # mta_addr_ext = resp[0] + mta_addr = struct.unpack(f"{self.byte_order.value}I", resp[1:5])[0] + return mta_addr + + def program_6_bytes(self, data: bytes) -> int: + if len(data) != 6: + raise ValueError("data size must be 6 bytes") + self._send_cro(COMMAND_CODE.PROGRAM_6, data) + resp = self._recv_dto(0.1) + # mta_addr_ext = resp[0] + mta_addr = struct.unpack(f"{self.byte_order.value}I", resp[1:5])[0] + return mta_addr + + def move_memory_block(self, size: int) -> None: + self._send_cro(COMMAND_CODE.MOVE, struct.pack(f"{self.byte_order.value}I", size)) + self._recv_dto(0.025) + + def diagnostic_service(self, service_num: int, data: bytes = b"") -> dict: + if service_num > 65535: + raise ValueError("service number must be less than 65536") + if len(data) > 4: + raise ValueError("max data size is 4 bytes") + self._send_cro(COMMAND_CODE.DIAG_SERVICE, struct.pack(f"{self.byte_order.value}H", service_num) + data) + resp = self._recv_dto(0.025) + return { # TODO: define a type + "length": resp[0], + "type": resp[1], + } + + def action_service(self, service_num: int, data: bytes = b"") -> dict: + if service_num > 65535: + raise ValueError("service number must be less than 65536") + if len(data) > 4: + raise ValueError("max data size is 4 bytes") + self._send_cro(COMMAND_CODE.ACTION_SERVICE, struct.pack(f"{self.byte_order.value}H", service_num) + data) + resp = self._recv_dto(0.025) + return { # TODO: define a type + "length": resp[0], + "type": resp[1], + } + + def test_availability(self, station_addr: int) -> None: + if station_addr > 65535: + raise ValueError("station address must be less than 65536") + # NOTE: station address is always little endian + self._send_cro(COMMAND_CODE.TEST, struct.pack(" None: + if mode > 255: + raise ValueError("mode must be less than 256") + self._send_cro(COMMAND_CODE.START_STOP_ALL, bytes([mode])) + self._recv_dto(0.025) + + def get_active_calibration_page(self): + self._send_cro(COMMAND_CODE.GET_ACTIVE_CAL_PAGE) + resp = self._recv_dto(0.025) + # cal_addr_ext = resp[0] + cal_addr = struct.unpack(f"{self.byte_order.value}I", resp[1:5])[0] + return cal_addr + + def get_version(self, desired_version: float = 2.1) -> float: + major, minor = map(int, str(desired_version).split(".")) + self._send_cro(COMMAND_CODE.GET_CCP_VERSION, bytes([major, minor])) + resp = self._recv_dto(0.025) + return float(f"{resp[0]}.{resp[1]}") diff --git a/panda/python/config.py b/panda/python/config.py new file mode 100644 index 000000000..9b890a131 --- /dev/null +++ b/panda/python/config.py @@ -0,0 +1,18 @@ +import os + + +BASEDIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../") + +BOOTSTUB_ADDRESS = 0x8000000 + +BLOCK_SIZE_FX = 0x800 +APP_ADDRESS_FX = 0x8004000 +DEVICE_SERIAL_NUMBER_ADDR_FX = 0x1FFF79C0 +DEFAULT_FW_FN = os.path.join(BASEDIR, "board", "obj", "panda.bin.signed") +DEFAULT_BOOTSTUB_FN = os.path.join(BASEDIR, "board", "obj", "bootstub.panda.bin") + +BLOCK_SIZE_H7 = 0x400 +APP_ADDRESS_H7 = 0x8020000 +DEVICE_SERIAL_NUMBER_ADDR_H7 = 0x080FFFC0 +DEFAULT_H7_FW_FN = os.path.join(BASEDIR, "board", "obj", "panda_h7.bin.signed") +DEFAULT_H7_BOOTSTUB_FN = os.path.join(BASEDIR, "board", "obj", "bootstub.panda_h7.bin") diff --git a/panda/python/dfu.py b/panda/python/dfu.py new file mode 100644 index 000000000..317780ca8 --- /dev/null +++ b/panda/python/dfu.py @@ -0,0 +1,125 @@ +import usb1 +import struct +import binascii +from .config import BOOTSTUB_ADDRESS, APP_ADDRESS_H7, APP_ADDRESS_FX, BLOCK_SIZE_H7, BLOCK_SIZE_FX, DEFAULT_H7_BOOTSTUB_FN, DEFAULT_BOOTSTUB_FN + + +MCU_TYPE_F2 = 0 +MCU_TYPE_F4 = 1 +MCU_TYPE_H7 = 2 + +# *** DFU mode *** +DFU_DNLOAD = 1 +DFU_UPLOAD = 2 +DFU_GETSTATUS = 3 +DFU_CLRSTATUS = 4 +DFU_ABORT = 6 + +class PandaDFU(object): + def __init__(self, dfu_serial): + context = usb1.USBContext() + for device in context.getDeviceList(skip_on_error=True): + if device.getVendorID() == 0x0483 and device.getProductID() == 0xdf11: + try: + this_dfu_serial = device.open().getASCIIStringDescriptor(3) + except Exception: + continue + if this_dfu_serial == dfu_serial or dfu_serial is None: + self._mcu_type = self.get_mcu_type(device) + self._handle = device.open() + return + raise Exception("failed to open " + dfu_serial if dfu_serial is not None else "DFU device") + + @staticmethod + def list(): + context = usb1.USBContext() + dfu_serials = [] + try: + for device in context.getDeviceList(skip_on_error=True): + if device.getVendorID() == 0x0483 and device.getProductID() == 0xdf11: + try: + dfu_serials.append(device.open().getASCIIStringDescriptor(3)) + except Exception: + pass + except Exception: + pass + return dfu_serials + + @staticmethod + def st_serial_to_dfu_serial(st, mcu_type=MCU_TYPE_F4): + if st is None or st == "none": + return None + uid_base = struct.unpack("H" * 6, bytes.fromhex(st)) + if mcu_type == MCU_TYPE_H7: + return binascii.hexlify(struct.pack("!HHH", uid_base[1] + uid_base[5], uid_base[0] + uid_base[4], uid_base[3])).upper().decode("utf-8") + else: + return binascii.hexlify(struct.pack("!HHH", uid_base[1] + uid_base[5], uid_base[0] + uid_base[4] + 0xA, uid_base[3])).upper().decode("utf-8") + + # TODO: Find a way to detect F4 vs F2 + def get_mcu_type(self, dev): + return MCU_TYPE_H7 if dev.getbcdDevice() == 512 else MCU_TYPE_F4 + + def status(self): + while 1: + dat = self._handle.controlRead(0x21, DFU_GETSTATUS, 0, 0, 6) + if dat[1] == 0: + break + + def clear_status(self): + # Clear status + stat = self._handle.controlRead(0x21, DFU_GETSTATUS, 0, 0, 6) + if stat[4] == 0xa: + self._handle.controlRead(0x21, DFU_CLRSTATUS, 0, 0, 0) + elif stat[4] == 0x9: + self._handle.controlWrite(0x21, DFU_ABORT, 0, 0, b"") + self.status() + stat = str(self._handle.controlRead(0x21, DFU_GETSTATUS, 0, 0, 6)) + + def erase(self, address): + self._handle.controlWrite(0x21, DFU_DNLOAD, 0, 0, b"\x41" + struct.pack("I", address)) + self.status() + + def program(self, address, dat, block_size=None): + if block_size is None: + block_size = len(dat) + + # Set Address Pointer + self._handle.controlWrite(0x21, DFU_DNLOAD, 0, 0, b"\x21" + struct.pack("I", address)) + self.status() + + # Program + dat += b"\xFF" * ((block_size - len(dat)) % block_size) + for i in range(0, len(dat) // block_size): + ldat = dat[i * block_size:(i + 1) * block_size] + print("programming %d with length %d" % (i, len(ldat))) + self._handle.controlWrite(0x21, DFU_DNLOAD, 2 + i, 0, ldat) + self.status() + + def program_bootstub(self, code_bootstub): + self.clear_status() + self.erase(BOOTSTUB_ADDRESS) + if self._mcu_type == MCU_TYPE_H7: + self.erase(APP_ADDRESS_H7) + self.program(BOOTSTUB_ADDRESS, code_bootstub, BLOCK_SIZE_H7) + else: + self.erase(APP_ADDRESS_FX) + self.program(BOOTSTUB_ADDRESS, code_bootstub, BLOCK_SIZE_FX) + self.reset() + + def recover(self): + fn = DEFAULT_H7_BOOTSTUB_FN if self._mcu_type == MCU_TYPE_H7 else DEFAULT_BOOTSTUB_FN + + with open(fn, "rb") as f: + code = f.read() + + self.program_bootstub(code) + + def reset(self): + # **** Reset **** + self._handle.controlWrite(0x21, DFU_DNLOAD, 0, 0, b"\x21" + struct.pack("I", BOOTSTUB_ADDRESS)) + self.status() + try: + self._handle.controlWrite(0x21, DFU_DNLOAD, 2, 0, b"") + _ = str(self._handle.controlRead(0x21, DFU_GETSTATUS, 0, 0, 6)) + except Exception: + pass diff --git a/panda/python/flash_release.py b/panda/python/flash_release.py new file mode 100755 index 000000000..ae50e6dc0 --- /dev/null +++ b/panda/python/flash_release.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 + +import sys +import time +import requests +import json +import io + +def flash_release(path=None, st_serial=None): + from panda import Panda, PandaDFU + from zipfile import ZipFile + + def status(x): + print("\033[1;32;40m" + x + "\033[00m") + + if st_serial is not None: + # look for Panda + panda_list = Panda.list() + if len(panda_list) == 0: + raise Exception("panda not found, make sure it's connected and your user can access it") + elif len(panda_list) > 1: + raise Exception("Please only connect one panda") + st_serial = panda_list[0] + print("Using panda with serial %s" % st_serial) + + if path is None: + print("Fetching latest firmware from github.com/commaai/panda-artifacts") + r = requests.get("https://raw.githubusercontent.com/commaai/panda-artifacts/master/latest.json") + url = json.loads(r.text)['url'] + r = requests.get(url) + print("Fetching firmware from %s" % url) + path = io.BytesIO(r.content) + + zf = ZipFile(path) + zf.printdir() + + version = zf.read("version").decode().strip() + status("0. Preparing to flash " + str(version)) + + code_bootstub = zf.read("bootstub.panda.bin") + code_panda = zf.read("panda.bin") + + # enter DFU mode + status("1. Entering DFU mode") + panda = Panda(st_serial) + panda.reset(enter_bootstub=True) + panda.reset(enter_bootloader=True) + time.sleep(1) + + # program bootstub + status("2. Programming bootstub") + dfu = PandaDFU(PandaDFU.st_serial_to_dfu_serial(st_serial)) + dfu.program_bootstub(code_bootstub) + time.sleep(1) + + # flash main code + status("3. Flashing main code") + panda = Panda(st_serial) + panda.flash(code=code_panda) + panda.close() + + # check for connection + status("4. Verifying version") + panda = Panda(st_serial) + my_version = panda.get_version() + print("dongle id: %s" % panda.get_serial()[0]) + print(my_version, "should be", version) + assert(str(version) == str(my_version)) + + # done! + status("6. Success!") + +if __name__ == "__main__": + flash_release(*sys.argv[1:]) diff --git a/panda/python/isotp.py b/panda/python/isotp.py new file mode 100644 index 000000000..45acb6aba --- /dev/null +++ b/panda/python/isotp.py @@ -0,0 +1,142 @@ +import binascii +import time + +DEBUG = False + +def msg(x): + if DEBUG: + print("S:", binascii.hexlify(x)) + if len(x) <= 7: + ret = bytes([len(x)]) + x + else: + assert False + return ret.ljust(8, b"\x00") + +kmsgs = [] +def recv(panda, cnt, addr, nbus): + global kmsgs + ret = [] + + while len(ret) < cnt: + kmsgs += panda.can_recv() + nmsgs = [] + for ids, ts, dat, bus in kmsgs: + if ids == addr and bus == nbus and len(ret) < cnt: + ret.append(dat) + else: + # leave around + nmsgs.append((ids, ts, dat, bus)) + kmsgs = nmsgs[-256:] + return ret + +def isotp_recv_subaddr(panda, addr, bus, sendaddr, subaddr): + msg = recv(panda, 1, addr, bus)[0] + + # TODO: handle other subaddr also communicating + assert msg[0] == subaddr + + if msg[1] & 0xf0 == 0x10: + # first + tlen = ((msg[1] & 0xf) << 8) | msg[2] + dat = msg[3:] + + # 0 block size? + CONTINUE = bytes([subaddr]) + b"\x30" + b"\x00" * 6 + panda.can_send(sendaddr, CONTINUE, bus) + + idx = 1 + for mm in recv(panda, (tlen - len(dat) + 5) // 6, addr, bus): + assert mm[0] == subaddr + assert mm[1] == (0x20 | (idx & 0xF)) + dat += mm[2:] + idx += 1 + elif msg[1] & 0xf0 == 0x00: + # single + tlen = msg[1] & 0xf + dat = msg[2:] + else: + print(binascii.hexlify(msg)) + assert False + + return dat[0:tlen] + +# **** import below this line **** + +def isotp_send(panda, x, addr, bus=0, recvaddr=None, subaddr=None, rate=None): + if recvaddr is None: + recvaddr = addr + 8 + + if len(x) <= 7 and subaddr is None: + panda.can_send(addr, msg(x), bus) + elif len(x) <= 6 and subaddr is not None: + panda.can_send(addr, bytes([subaddr]) + msg(x)[0:7], bus) + else: + if subaddr: + ss = bytes([subaddr, 0x10 + (len(x) >> 8), len(x) & 0xFF]) + x[0:5] + x = x[5:] + else: + ss = bytes([0x10 + (len(x) >> 8), len(x) & 0xFF]) + x[0:6] + x = x[6:] + idx = 1 + sends = [] + while len(x) > 0: + if subaddr: + sends.append(((bytes([subaddr, 0x20 + (idx & 0xF)]) + x[0:6]).ljust(8, b"\x00"))) + x = x[6:] + else: + sends.append(((bytes([0x20 + (idx & 0xF)]) + x[0:7]).ljust(8, b"\x00"))) + x = x[7:] + idx += 1 + + # actually send + panda.can_send(addr, ss, bus) + rr = recv(panda, 1, recvaddr, bus)[0] + if rr.find(b"\x30\x01") != -1: + for s in sends[:-1]: + panda.can_send(addr, s, 0) + rr = recv(panda, 1, recvaddr, bus)[0] + panda.can_send(addr, sends[-1], 0) + else: + if rate is None: + panda.can_send_many([(addr, None, s, bus) for s in sends]) + else: + for dat in sends: + panda.can_send(addr, dat, bus) + time.sleep(rate) + +def isotp_recv(panda, addr, bus=0, sendaddr=None, subaddr=None): + if sendaddr is None: + sendaddr = addr - 8 + + if subaddr is not None: + dat = isotp_recv_subaddr(panda, addr, bus, sendaddr, subaddr) + else: + msg = recv(panda, 1, addr, bus)[0] + + if msg[0] & 0xf0 == 0x10: + # first + tlen = ((msg[0] & 0xf) << 8) | msg[1] + dat = msg[2:] + + # 0 block size? + CONTINUE = b"\x30" + b"\x00" * 7 + + panda.can_send(sendaddr, CONTINUE, bus) + + idx = 1 + for mm in recv(panda, (tlen - len(dat) + 6) // 7, addr, bus): + assert mm[0] == (0x20 | (idx & 0xF)) + dat += mm[1:] + idx += 1 + elif msg[0] & 0xf0 == 0x00: + # single + tlen = msg[0] & 0xf + dat = msg[1:] + else: + assert False + dat = dat[0:tlen] + + if DEBUG: + print("R:", binascii.hexlify(dat)) + + return dat diff --git a/panda/python/serial.py b/panda/python/serial.py new file mode 100644 index 000000000..97fe8f1d9 --- /dev/null +++ b/panda/python/serial.py @@ -0,0 +1,35 @@ +# mimic a python serial port +class PandaSerial(object): + def __init__(self, panda, port, baud): + self.panda = panda + self.port = port + self.panda.set_uart_parity(self.port, 0) + self._baudrate = baud + self.panda.set_uart_baud(self.port, baud) + self.buf = b"" + + def read(self, l=1): # noqa: E741 + tt = self.panda.serial_read(self.port) + if len(tt) > 0: + self.buf += tt + ret = self.buf[0:l] + self.buf = self.buf[l:] + return ret + + def write(self, dat): + return self.panda.serial_write(self.port, dat) + + def close(self): + pass + + def flush(self): + pass + + @property + def baudrate(self): + return self._baudrate + + @baudrate.setter + def baudrate(self, value): + self.panda.set_uart_baud(self.port, value) + self._baudrate = value diff --git a/panda/python/uds.py b/panda/python/uds.py new file mode 100644 index 000000000..d0119612c --- /dev/null +++ b/panda/python/uds.py @@ -0,0 +1,873 @@ +#!/usr/bin/env python3 +import time +import struct +from collections import deque +from typing import Callable, NamedTuple, Tuple, List, Deque, Generator, Optional, cast +from enum import IntEnum +from functools import partial + +class SERVICE_TYPE(IntEnum): + DIAGNOSTIC_SESSION_CONTROL = 0x10 + ECU_RESET = 0x11 + SECURITY_ACCESS = 0x27 + COMMUNICATION_CONTROL = 0x28 + TESTER_PRESENT = 0x3E + ACCESS_TIMING_PARAMETER = 0x83 + SECURED_DATA_TRANSMISSION = 0x84 + CONTROL_DTC_SETTING = 0x85 + RESPONSE_ON_EVENT = 0x86 + LINK_CONTROL = 0x87 + READ_DATA_BY_IDENTIFIER = 0x22 + READ_MEMORY_BY_ADDRESS = 0x23 + READ_SCALING_DATA_BY_IDENTIFIER = 0x24 + READ_DATA_BY_PERIODIC_IDENTIFIER = 0x2A + DYNAMICALLY_DEFINE_DATA_IDENTIFIER = 0x2C + WRITE_DATA_BY_IDENTIFIER = 0x2E + WRITE_MEMORY_BY_ADDRESS = 0x3D + CLEAR_DIAGNOSTIC_INFORMATION = 0x14 + READ_DTC_INFORMATION = 0x19 + INPUT_OUTPUT_CONTROL_BY_IDENTIFIER = 0x2F + ROUTINE_CONTROL = 0x31 + REQUEST_DOWNLOAD = 0x34 + REQUEST_UPLOAD = 0x35 + TRANSFER_DATA = 0x36 + REQUEST_TRANSFER_EXIT = 0x37 + +class SESSION_TYPE(IntEnum): + DEFAULT = 1 + PROGRAMMING = 2 + EXTENDED_DIAGNOSTIC = 3 + SAFETY_SYSTEM_DIAGNOSTIC = 4 + +class RESET_TYPE(IntEnum): + HARD = 1 + KEY_OFF_ON = 2 + SOFT = 3 + ENABLE_RAPID_POWER_SHUTDOWN = 4 + DISABLE_RAPID_POWER_SHUTDOWN = 5 + +class ACCESS_TYPE(IntEnum): + REQUEST_SEED = 1 + SEND_KEY = 2 + +class CONTROL_TYPE(IntEnum): + ENABLE_RX_ENABLE_TX = 0 + ENABLE_RX_DISABLE_TX = 1 + DISABLE_RX_ENABLE_TX = 2 + DISABLE_RX_DISABLE_TX = 3 + +class MESSAGE_TYPE(IntEnum): + NORMAL = 1 + NETWORK_MANAGEMENT = 2 + NORMAL_AND_NETWORK_MANAGEMENT = 3 + +class TIMING_PARAMETER_TYPE(IntEnum): + READ_EXTENDED_SET = 1 + SET_TO_DEFAULT_VALUES = 2 + READ_CURRENTLY_ACTIVE = 3 + SET_TO_GIVEN_VALUES = 4 + +class DTC_SETTING_TYPE(IntEnum): + ON = 1 + OFF = 2 + +class RESPONSE_EVENT_TYPE(IntEnum): + STOP_RESPONSE_ON_EVENT = 0 + ON_DTC_STATUS_CHANGE = 1 + ON_TIMER_INTERRUPT = 2 + ON_CHANGE_OF_DATA_IDENTIFIER = 3 + REPORT_ACTIVATED_EVENTS = 4 + START_RESPONSE_ON_EVENT = 5 + CLEAR_RESPONSE_ON_EVENT = 6 + ON_COMPARISON_OF_VALUES = 7 + +class LINK_CONTROL_TYPE(IntEnum): + VERIFY_BAUDRATE_TRANSITION_WITH_FIXED_BAUDRATE = 1 + VERIFY_BAUDRATE_TRANSITION_WITH_SPECIFIC_BAUDRATE = 2 + TRANSITION_BAUDRATE = 3 + +class BAUD_RATE_TYPE(IntEnum): + PC9600 = 1 + PC19200 = 2 + PC38400 = 3 + PC57600 = 4 + PC115200 = 5 + CAN125000 = 16 + CAN250000 = 17 + CAN500000 = 18 + CAN1000000 = 19 + +class DATA_IDENTIFIER_TYPE(IntEnum): + BOOT_SOFTWARE_IDENTIFICATION = 0xF180 + APPLICATION_SOFTWARE_IDENTIFICATION = 0xF181 + APPLICATION_DATA_IDENTIFICATION = 0xF182 + BOOT_SOFTWARE_FINGERPRINT = 0xF183 + APPLICATION_SOFTWARE_FINGERPRINT = 0xF184 + APPLICATION_DATA_FINGERPRINT = 0xF185 + ACTIVE_DIAGNOSTIC_SESSION = 0xF186 + VEHICLE_MANUFACTURER_SPARE_PART_NUMBER = 0xF187 + VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER = 0xF188 + VEHICLE_MANUFACTURER_ECU_SOFTWARE_VERSION_NUMBER = 0xF189 + SYSTEM_SUPPLIER_IDENTIFIER = 0xF18A + ECU_MANUFACTURING_DATE = 0xF18B + ECU_SERIAL_NUMBER = 0xF18C + SUPPORTED_FUNCTIONAL_UNITS = 0xF18D + VEHICLE_MANUFACTURER_KIT_ASSEMBLY_PART_NUMBER = 0xF18E + VIN = 0xF190 + VEHICLE_MANUFACTURER_ECU_HARDWARE_NUMBER = 0xF191 + SYSTEM_SUPPLIER_ECU_HARDWARE_NUMBER = 0xF192 + SYSTEM_SUPPLIER_ECU_HARDWARE_VERSION_NUMBER = 0xF193 + SYSTEM_SUPPLIER_ECU_SOFTWARE_NUMBER = 0xF194 + SYSTEM_SUPPLIER_ECU_SOFTWARE_VERSION_NUMBER = 0xF195 + EXHAUST_REGULATION_OR_TYPE_APPROVAL_NUMBER = 0xF196 + SYSTEM_NAME_OR_ENGINE_TYPE = 0xF197 + REPAIR_SHOP_CODE_OR_TESTER_SERIAL_NUMBER = 0xF198 + PROGRAMMING_DATE = 0xF199 + CALIBRATION_REPAIR_SHOP_CODE_OR_CALIBRATION_EQUIPMENT_SERIAL_NUMBER = 0xF19A + CALIBRATION_DATE = 0xF19B + CALIBRATION_EQUIPMENT_SOFTWARE_NUMBER = 0xF19C + ECU_INSTALLATION_DATE = 0xF19D + ODX_FILE = 0xF19E + ENTITY = 0xF19F + +class TRANSMISSION_MODE_TYPE(IntEnum): + SEND_AT_SLOW_RATE = 1 + SEND_AT_MEDIUM_RATE = 2 + SEND_AT_FAST_RATE = 3 + STOP_SENDING = 4 + +class DYNAMIC_DEFINITION_TYPE(IntEnum): + DEFINE_BY_IDENTIFIER = 1 + DEFINE_BY_MEMORY_ADDRESS = 2 + CLEAR_DYNAMICALLY_DEFINED_DATA_IDENTIFIER = 3 + +class DynamicSourceDefinition(NamedTuple): + data_identifier: int + position: int + memory_size: int + memory_address: int + +class DTC_GROUP_TYPE(IntEnum): + EMISSIONS = 0x000000 + ALL = 0xFFFFFF + +class DTC_REPORT_TYPE(IntEnum): + NUMBER_OF_DTC_BY_STATUS_MASK = 0x01 + DTC_BY_STATUS_MASK = 0x02 + DTC_SNAPSHOT_IDENTIFICATION = 0x03 + DTC_SNAPSHOT_RECORD_BY_DTC_NUMBER = 0x04 + DTC_SNAPSHOT_RECORD_BY_RECORD_NUMBER = 0x05 + DTC_EXTENDED_DATA_RECORD_BY_DTC_NUMBER = 0x06 + NUMBER_OF_DTC_BY_SEVERITY_MASK_RECORD = 0x07 + DTC_BY_SEVERITY_MASK_RECORD = 0x08 + SEVERITY_INFORMATION_OF_DTC = 0x09 + SUPPORTED_DTC = 0x0A + FIRST_TEST_FAILED_DTC = 0x0B + FIRST_CONFIRMED_DTC = 0x0C + MOST_RECENT_TEST_FAILED_DTC = 0x0D + MOST_RECENT_CONFIRMED_DTC = 0x0E + MIRROR_MEMORY_DTC_BY_STATUS_MASK = 0x0F + MIRROR_MEMORY_DTC_EXTENDED_DATA_RECORD_BY_DTC_NUMBER = 0x10 + NUMBER_OF_MIRROR_MEMORY_DTC_BY_STATUS_MASK = 0x11 + NUMBER_OF_EMISSIONS_RELATED_OBD_DTC_BY_STATUS_MASK = 0x12 + EMISSIONS_RELATED_OBD_DTC_BY_STATUS_MASK = 0x13 + DTC_FAULT_DETECTION_COUNTER = 0x14 + DTC_WITH_PERMANENT_STATUS = 0x15 + +class DTC_STATUS_MASK_TYPE(IntEnum): + TEST_FAILED = 0x01 + TEST_FAILED_THIS_OPERATION_CYCLE = 0x02 + PENDING_DTC = 0x04 + CONFIRMED_DTC = 0x08 + TEST_NOT_COMPLETED_SINCE_LAST_CLEAR = 0x10 + TEST_FAILED_SINCE_LAST_CLEAR = 0x20 + TEST_NOT_COMPLETED_THIS_OPERATION_CYCLE = 0x40 + WARNING_INDICATOR_REQUESTED = 0x80 + ALL = 0xFF + +class DTC_SEVERITY_MASK_TYPE(IntEnum): + MAINTENANCE_ONLY = 0x20 + CHECK_AT_NEXT_HALT = 0x40 + CHECK_IMMEDIATELY = 0x80 + ALL = 0xE0 + +class CONTROL_PARAMETER_TYPE(IntEnum): + RETURN_CONTROL_TO_ECU = 0 + RESET_TO_DEFAULT = 1 + FREEZE_CURRENT_STATE = 2 + SHORT_TERM_ADJUSTMENT = 3 + +class ROUTINE_CONTROL_TYPE(IntEnum): + START = 1 + STOP = 2 + REQUEST_RESULTS = 3 + +class ROUTINE_IDENTIFIER_TYPE(IntEnum): + ERASE_MEMORY = 0xFF00 + CHECK_PROGRAMMING_DEPENDENCIES = 0xFF01 + ERASE_MIRROR_MEMORY_DTCS = 0xFF02 + +class MessageTimeoutError(Exception): + pass + +class NegativeResponseError(Exception): + def __init__(self, message, service_id, error_code): + super().__init__() + self.message = message + self.service_id = service_id + self.error_code = error_code + + def __str__(self): + return self.message + +class InvalidServiceIdError(Exception): + pass + +class InvalidSubFunctioneError(Exception): + pass + +_negative_response_codes = { + 0x00: 'positive response', + 0x10: 'general reject', + 0x11: 'service not supported', + 0x12: 'sub-function not supported', + 0x13: 'incorrect message length or invalid format', + 0x14: 'response too long', + 0x21: 'busy repeat request', + 0x22: 'conditions not correct', + 0x24: 'request sequence error', + 0x25: 'no response from subnet component', + 0x26: 'failure prevents execution of requested action', + 0x31: 'request out of range', + 0x33: 'security access denied', + 0x35: 'invalid key', + 0x36: 'exceed number of attempts', + 0x37: 'required time delay not expired', + 0x70: 'upload download not accepted', + 0x71: 'transfer data suspended', + 0x72: 'general programming failure', + 0x73: 'wrong block sequence counter', + 0x78: 'request correctly received - response pending', + 0x7e: 'sub-function not supported in active session', + 0x7f: 'service not supported in active session', + 0x81: 'rpm too high', + 0x82: 'rpm too low', + 0x83: 'engine is running', + 0x84: 'engine is not running', + 0x85: 'engine run time too low', + 0x86: 'temperature too high', + 0x87: 'temperature too low', + 0x88: 'vehicle speed too high', + 0x89: 'vehicle speed too low', + 0x8a: 'throttle/pedal too high', + 0x8b: 'throttle/pedal too low', + 0x8c: 'transmission not in neutral', + 0x8d: 'transmission not in gear', + 0x8f: 'brake switch(es) not closed', + 0x90: 'shifter lever not in park', + 0x91: 'torque converter clutch locked', + 0x92: 'voltage too high', + 0x93: 'voltage too low', +} + + +class CanClient(): + def __init__(self, can_send: Callable[[int, bytes, int], None], can_recv: Callable[[], List[Tuple[int, int, bytes, int]]], + tx_addr: int, rx_addr: int, bus: int, sub_addr: int = None, debug: bool = False): + self.tx = can_send + self.rx = can_recv + self.tx_addr = tx_addr + self.rx_addr = rx_addr + self.rx_buff = deque() # type: Deque[bytes] + self.sub_addr = sub_addr + self.bus = bus + self.debug = debug + + def _recv_filter(self, bus: int, addr: int) -> bool: + # handle functional addresses (switch to first addr to respond) + if self.tx_addr == 0x7DF: + is_response = addr >= 0x7E8 and addr <= 0x7EF + if is_response: + if self.debug: + print(f"switch to physical addr {hex(addr)}") + self.tx_addr = addr - 8 + self.rx_addr = addr + return is_response + if self.tx_addr == 0x18DB33F1: + is_response = addr >= 0x18DAF100 and addr <= 0x18DAF1FF + if is_response: + if self.debug: + print(f"switch to physical addr {hex(addr)}") + self.tx_addr = 0x18DA00F1 + (addr << 8 & 0xFF00) + self.rx_addr = addr + return bus == self.bus and addr == self.rx_addr + + def _recv_buffer(self, drain: bool = False) -> None: + while True: + msgs = self.rx() + if drain: + if self.debug: + print("CAN-RX: drain - {}".format(len(msgs))) + self.rx_buff.clear() + else: + for rx_addr, _, rx_data, rx_bus in msgs or []: + if self._recv_filter(rx_bus, rx_addr) and len(rx_data) > 0: + rx_data = bytes(rx_data) # convert bytearray to bytes + + if self.debug: + print(f"CAN-RX: {hex(rx_addr)} - 0x{bytes.hex(rx_data)}") + + # Cut off sub addr in first byte + if self.sub_addr is not None: + rx_data = rx_data[1:] + + self.rx_buff.append(rx_data) + # break when non-full buffer is processed + if len(msgs) < 254: + return + + def recv(self, drain: bool = False) -> Generator[bytes, None, None]: + # buffer rx messages in case two response messages are received at once + # (e.g. response pending and success/failure response) + self._recv_buffer(drain) + try: + while True: + yield self.rx_buff.popleft() + except IndexError: + pass # empty + + def send(self, msgs: List[bytes], delay: float = 0) -> None: + for i, msg in enumerate(msgs): + if delay and i != 0: + if self.debug: + print(f"CAN-TX: delay - {delay}") + time.sleep(delay) + + if self.sub_addr is not None: + msg = bytes([self.sub_addr]) + msg + + if self.debug: + print(f"CAN-TX: {hex(self.tx_addr)} - 0x{bytes.hex(msg)}") + assert len(msg) <= 8 + + self.tx(self.tx_addr, msg, self.bus) + # prevent rx buffer from overflowing on large tx + if i % 10 == 9: + self._recv_buffer() + +class IsoTpMessage(): + def __init__(self, can_client: CanClient, timeout: float = 1, debug: bool = False, max_len: int = 8): + self._can_client = can_client + self.timeout = timeout + self.debug = debug + self.max_len = max_len + + def send(self, dat: bytes) -> None: + # throw away any stale data + self._can_client.recv(drain=True) + + self.tx_dat = dat + self.tx_len = len(dat) + self.tx_idx = 0 + self.tx_done = False + + self.rx_dat = b"" + self.rx_len = 0 + self.rx_idx = 0 + self.rx_done = False + + if self.debug: + print(f"ISO-TP: REQUEST - {hex(self._can_client.tx_addr)} 0x{bytes.hex(self.tx_dat)}") + self._tx_first_frame() + + def _tx_first_frame(self) -> None: + if self.tx_len < self.max_len: + # single frame (send all bytes) + if self.debug: + print(f"ISO-TP: TX - single frame - {hex(self._can_client.tx_addr)}") + msg = (bytes([self.tx_len]) + self.tx_dat).ljust(self.max_len, b"\x00") + self.tx_done = True + else: + # first frame (send first 6 bytes) + if self.debug: + print(f"ISO-TP: TX - first frame - {hex(self._can_client.tx_addr)}") + msg = (struct.pack("!H", 0x1000 | self.tx_len) + self.tx_dat[:self.max_len - 2]).ljust(self.max_len - 2, b"\x00") + self._can_client.send([msg]) + + def recv(self, timeout=None) -> Optional[bytes]: + if timeout is None: + timeout = self.timeout + + start_time = time.monotonic() + try: + while True: + for msg in self._can_client.recv(): + self._isotp_rx_next(msg) + start_time = time.monotonic() + if self.tx_done and self.rx_done: + return self.rx_dat + # no timeout indicates non-blocking + if timeout == 0: + return None + if time.monotonic() - start_time > timeout: + raise MessageTimeoutError("timeout waiting for response") + finally: + if self.debug and self.rx_dat: + print(f"ISO-TP: RESPONSE - {hex(self._can_client.rx_addr)} 0x{bytes.hex(self.rx_dat)}") + + def _isotp_rx_next(self, rx_data: bytes) -> None: + # single rx_frame + if rx_data[0] >> 4 == 0x0: + self.rx_len = rx_data[0] & 0xFF + self.rx_dat = rx_data[1:1 + self.rx_len] + self.rx_idx = 0 + self.rx_done = True + if self.debug: + print(f"ISO-TP: RX - single frame - {hex(self._can_client.rx_addr)} idx={self.rx_idx} done={self.rx_done}") + return + + # first rx_frame + if rx_data[0] >> 4 == 0x1: + self.rx_len = ((rx_data[0] & 0x0F) << 8) + rx_data[1] + self.rx_dat = rx_data[2:] + self.rx_idx = 0 + self.rx_done = False + if self.debug: + print(f"ISO-TP: RX - first frame - {hex(self._can_client.rx_addr)} idx={self.rx_idx} done={self.rx_done}") + if self.debug: + print(f"ISO-TP: TX - flow control continue - {hex(self._can_client.tx_addr)}") + # send flow control message (send all bytes) + msg = b"\x30\x00\x00".ljust(self.max_len, b"\x00") + self._can_client.send([msg]) + return + + # consecutive rx frame + if rx_data[0] >> 4 == 0x2: + assert not self.rx_done, "isotp - rx: consecutive frame with no active frame" + self.rx_idx += 1 + assert self.rx_idx & 0xF == rx_data[0] & 0xF, "isotp - rx: invalid consecutive frame index" + rx_size = self.rx_len - len(self.rx_dat) + self.rx_dat += rx_data[1:1 + rx_size] + if self.rx_len == len(self.rx_dat): + self.rx_done = True + if self.debug: + print(f"ISO-TP: RX - consecutive frame - {hex(self._can_client.rx_addr)} idx={self.rx_idx} done={self.rx_done}") + return + + # flow control + if rx_data[0] >> 4 == 0x3: + assert not self.tx_done, "isotp - rx: flow control with no active frame" + assert rx_data[0] != 0x32, "isotp - rx: flow-control overflow/abort" + assert rx_data[0] == 0x30 or rx_data[0] == 0x31, "isotp - rx: flow-control transfer state indicator invalid" + if rx_data[0] == 0x30: + if self.debug: + print(f"ISO-TP: RX - flow control continue - {hex(self._can_client.tx_addr)}") + delay_ts = rx_data[2] & 0x7F + # scale is 1 milliseconds if first bit == 0, 100 micro seconds if first bit == 1 + delay_div = 1000. if rx_data[2] & 0x80 == 0 else 10000. + delay_sec = delay_ts / delay_div + + # first frame = 6 bytes, each consecutive frame = 7 bytes + num_bytes = self.max_len - 1 + start = 6 + self.tx_idx * num_bytes + count = rx_data[1] + end = start + count * num_bytes if count > 0 else self.tx_len + tx_msgs = [] + for i in range(start, end, num_bytes): + self.tx_idx += 1 + # consecutive tx messages + msg = (bytes([0x20 | (self.tx_idx & 0xF)]) + self.tx_dat[i:i + num_bytes]).ljust(self.max_len, b"\x00") + tx_msgs.append(msg) + # send consecutive tx messages + self._can_client.send(tx_msgs, delay=delay_sec) + if end >= self.tx_len: + self.tx_done = True + if self.debug: + print(f"ISO-TP: TX - consecutive frame - {hex(self._can_client.tx_addr)} idx={self.tx_idx} done={self.tx_done}") + elif rx_data[0] == 0x31: + # wait (do nothing until next flow control message) + if self.debug: + print(f"ISO-TP: TX - flow control wait - {hex(self._can_client.tx_addr)}") + +FUNCTIONAL_ADDRS = [0x7DF, 0x18DB33F1] + +def get_rx_addr_for_tx_addr(tx_addr, rx_offset=0x8): + if tx_addr in FUNCTIONAL_ADDRS: + return None + + if tx_addr < 0xFFF8: + # pseudo-standard 11 bit response addr (add 8) works for most manufacturers + # allow override; some manufacturers use other offsets for non-OBD2 access + return tx_addr + rx_offset + + if tx_addr > 0x10000000 and tx_addr < 0xFFFFFFFF: + # standard 29 bit response addr (flip last two bytes) + return (tx_addr & 0xFFFF0000) + (tx_addr << 8 & 0xFF00) + (tx_addr >> 8 & 0xFF) + + raise ValueError("invalid tx_addr: {}".format(tx_addr)) + + +class UdsClient(): + def __init__(self, panda, tx_addr: int, rx_addr: int = None, bus: int = 0, timeout: float = 1, debug: bool = False, + tx_timeout: float = 1, response_pending_timeout: float = 10): + self.bus = bus + self.tx_addr = tx_addr + self.rx_addr = rx_addr if rx_addr is not None else get_rx_addr_for_tx_addr(tx_addr) + self.timeout = timeout + self.debug = debug + can_send_with_timeout = partial(panda.can_send, timeout=int(tx_timeout*1000)) + self._can_client = CanClient(can_send_with_timeout, panda.can_recv, self.tx_addr, self.rx_addr, self.bus, debug=self.debug) + self.response_pending_timeout = response_pending_timeout + + # generic uds request + def _uds_request(self, service_type: SERVICE_TYPE, subfunction: int = None, data: bytes = None) -> bytes: + req = bytes([service_type]) + if subfunction is not None: + req += bytes([subfunction]) + if data is not None: + req += data + + # send request, wait for response + isotp_msg = IsoTpMessage(self._can_client, self.timeout, self.debug) + isotp_msg.send(req) + response_pending = False + while True: + timeout = self.response_pending_timeout if response_pending else self.timeout + resp = isotp_msg.recv(timeout) + + if resp is None: + continue + + response_pending = False + resp_sid = resp[0] if len(resp) > 0 else None + + # negative response + if resp_sid == 0x7F: + service_id = resp[1] if len(resp) > 1 else -1 + try: + service_desc = SERVICE_TYPE(service_id).name + except BaseException: + service_desc = 'NON_STANDARD_SERVICE' + error_code = resp[2] if len(resp) > 2 else -1 + try: + error_desc = _negative_response_codes[error_code] + except BaseException: + error_desc = resp[3:].hex() + # wait for another message if response pending + if error_code == 0x78: + response_pending = True + if self.debug: + print("UDS-RX: response pending") + continue + raise NegativeResponseError('{} - {}'.format(service_desc, error_desc), service_id, error_code) + + # positive response + if service_type + 0x40 != resp_sid: + resp_sid_hex = hex(resp_sid) if resp_sid is not None else None + raise InvalidServiceIdError('invalid response service id: {}'.format(resp_sid_hex)) + + if subfunction is not None: + resp_sfn = resp[1] if len(resp) > 1 else None + if subfunction != resp_sfn: + resp_sfn_hex = hex(resp_sfn) if resp_sfn is not None else None + raise InvalidSubFunctioneError(f'invalid response subfunction: {resp_sfn_hex:x}') + + # return data (exclude service id and sub-function id) + return resp[(1 if subfunction is None else 2):] + + # services + def diagnostic_session_control(self, session_type: SESSION_TYPE): + self._uds_request(SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL, subfunction=session_type) + + def ecu_reset(self, reset_type: RESET_TYPE): + resp = self._uds_request(SERVICE_TYPE.ECU_RESET, subfunction=reset_type) + power_down_time = None + if reset_type == RESET_TYPE.ENABLE_RAPID_POWER_SHUTDOWN: + power_down_time = resp[0] + return power_down_time + + def security_access(self, access_type: ACCESS_TYPE, security_key: bytes = b'', data_record: bytes = b''): + request_seed = access_type % 2 != 0 + if request_seed and len(security_key) != 0: + raise ValueError('security_key not allowed') + if not request_seed and len(security_key) == 0: + raise ValueError('security_key is missing') + if not request_seed and len(data_record) != 0: + raise ValueError('data_record not allowed') + data = security_key + data_record + resp = self._uds_request(SERVICE_TYPE.SECURITY_ACCESS, subfunction=access_type, data=data) + if request_seed: + security_seed = resp + return security_seed + + def communication_control(self, control_type: CONTROL_TYPE, message_type: MESSAGE_TYPE): + data = bytes([message_type]) + self._uds_request(SERVICE_TYPE.COMMUNICATION_CONTROL, subfunction=control_type, data=data) + + def tester_present(self, ): + self._uds_request(SERVICE_TYPE.TESTER_PRESENT, subfunction=0x00) + + def access_timing_parameter(self, timing_parameter_type: TIMING_PARAMETER_TYPE, parameter_values: bytes = None): + write_custom_values = timing_parameter_type == TIMING_PARAMETER_TYPE.SET_TO_GIVEN_VALUES + read_values = (timing_parameter_type == TIMING_PARAMETER_TYPE.READ_CURRENTLY_ACTIVE or + timing_parameter_type == TIMING_PARAMETER_TYPE.READ_EXTENDED_SET) + if not write_custom_values and parameter_values is not None: + raise ValueError('parameter_values not allowed') + if write_custom_values and parameter_values is None: + raise ValueError('parameter_values is missing') + resp = self._uds_request(SERVICE_TYPE.ACCESS_TIMING_PARAMETER, subfunction=timing_parameter_type, data=parameter_values) + if read_values: + # TODO: parse response into values? + parameter_values = resp + return parameter_values + + def secured_data_transmission(self, data: bytes): + # TODO: split data into multiple input parameters? + resp = self._uds_request(SERVICE_TYPE.SECURED_DATA_TRANSMISSION, subfunction=None, data=data) + # TODO: parse response into multiple output values? + return resp + + def control_dtc_setting(self, dtc_setting_type: DTC_SETTING_TYPE): + self._uds_request(SERVICE_TYPE.CONTROL_DTC_SETTING, subfunction=dtc_setting_type) + + def response_on_event(self, response_event_type: RESPONSE_EVENT_TYPE, store_event: bool, window_time: int, + event_type_record: int, service_response_record: int): + if store_event: + response_event_type |= 0x20 # type: ignore + # TODO: split record parameters into arrays + data = bytes([window_time, event_type_record, service_response_record]) + resp = self._uds_request(SERVICE_TYPE.RESPONSE_ON_EVENT, subfunction=response_event_type, data=data) + + if response_event_type == RESPONSE_EVENT_TYPE.REPORT_ACTIVATED_EVENTS: + return { + "num_of_activated_events": resp[0], + "data": resp[1:], # TODO: parse the reset of response + } + + return { + "num_of_identified_events": resp[0], + "event_window_time": resp[1], + "data": resp[2:], # TODO: parse the reset of response + } + + def link_control(self, link_control_type: LINK_CONTROL_TYPE, baud_rate_type: BAUD_RATE_TYPE = None): + data: Optional[bytes] + + if link_control_type == LINK_CONTROL_TYPE.VERIFY_BAUDRATE_TRANSITION_WITH_FIXED_BAUDRATE: + # baud_rate_type = BAUD_RATE_TYPE + data = bytes([cast(int, baud_rate_type)]) + elif link_control_type == LINK_CONTROL_TYPE.VERIFY_BAUDRATE_TRANSITION_WITH_SPECIFIC_BAUDRATE: + # baud_rate_type = custom value (3 bytes big-endian) + data = struct.pack('!I', baud_rate_type)[1:] + else: + data = None + self._uds_request(SERVICE_TYPE.LINK_CONTROL, subfunction=link_control_type, data=data) + + def read_data_by_identifier(self, data_identifier_type: DATA_IDENTIFIER_TYPE): + # TODO: support list of identifiers + data = struct.pack('!H', data_identifier_type) + resp = self._uds_request(SERVICE_TYPE.READ_DATA_BY_IDENTIFIER, subfunction=None, data=data) + resp_id = struct.unpack('!H', resp[0:2])[0] if len(resp) >= 2 else None + if resp_id != data_identifier_type: + raise ValueError('invalid response data identifier: {} expected: {}'.format(hex(resp_id), hex(data_identifier_type))) + return resp[2:] + + def read_memory_by_address(self, memory_address: int, memory_size: int, memory_address_bytes: int = 4, memory_size_bytes: int = 1): + if memory_address_bytes < 1 or memory_address_bytes > 4: + raise ValueError('invalid memory_address_bytes: {}'.format(memory_address_bytes)) + if memory_size_bytes < 1 or memory_size_bytes > 4: + raise ValueError('invalid memory_size_bytes: {}'.format(memory_size_bytes)) + data = bytes([memory_size_bytes << 4 | memory_address_bytes]) + + if memory_address >= 1 << (memory_address_bytes * 8): + raise ValueError('invalid memory_address: {}'.format(memory_address)) + data += struct.pack('!I', memory_address)[4 - memory_address_bytes:] + if memory_size >= 1 << (memory_size_bytes * 8): + raise ValueError('invalid memory_size: {}'.format(memory_size)) + data += struct.pack('!I', memory_size)[4 - memory_size_bytes:] + + resp = self._uds_request(SERVICE_TYPE.READ_MEMORY_BY_ADDRESS, subfunction=None, data=data) + return resp + + def read_scaling_data_by_identifier(self, data_identifier_type: DATA_IDENTIFIER_TYPE): + data = struct.pack('!H', data_identifier_type) + resp = self._uds_request(SERVICE_TYPE.READ_SCALING_DATA_BY_IDENTIFIER, subfunction=None, data=data) + resp_id = struct.unpack('!H', resp[0:2])[0] if len(resp) >= 2 else None + if resp_id != data_identifier_type: + raise ValueError('invalid response data identifier: {}'.format(hex(resp_id))) + return resp[2:] # TODO: parse the response + + def read_data_by_periodic_identifier(self, transmission_mode_type: TRANSMISSION_MODE_TYPE, periodic_data_identifier: int): + # TODO: support list of identifiers + data = bytes([transmission_mode_type, periodic_data_identifier]) + self._uds_request(SERVICE_TYPE.READ_DATA_BY_PERIODIC_IDENTIFIER, subfunction=None, data=data) + + def dynamically_define_data_identifier(self, dynamic_definition_type: DYNAMIC_DEFINITION_TYPE, dynamic_data_identifier: int, + source_definitions: List[DynamicSourceDefinition], memory_address_bytes: int = 4, memory_size_bytes: int = 1): + if memory_address_bytes < 1 or memory_address_bytes > 4: + raise ValueError('invalid memory_address_bytes: {}'.format(memory_address_bytes)) + if memory_size_bytes < 1 or memory_size_bytes > 4: + raise ValueError('invalid memory_size_bytes: {}'.format(memory_size_bytes)) + + data = struct.pack('!H', dynamic_data_identifier) + if dynamic_definition_type == DYNAMIC_DEFINITION_TYPE.DEFINE_BY_IDENTIFIER: + for s in source_definitions: + data += struct.pack('!H', s.data_identifier) + bytes([s.position, s.memory_size]) + elif dynamic_definition_type == DYNAMIC_DEFINITION_TYPE.DEFINE_BY_MEMORY_ADDRESS: + data += bytes([memory_size_bytes << 4 | memory_address_bytes]) + for s in source_definitions: + if s.memory_address >= 1 << (memory_address_bytes * 8): + raise ValueError('invalid memory_address: {}'.format(s.memory_address)) + data += struct.pack('!I', s.memory_address)[4 - memory_address_bytes:] + if s.memory_size >= 1 << (memory_size_bytes * 8): + raise ValueError('invalid memory_size: {}'.format(s.memory_size)) + data += struct.pack('!I', s.memory_size)[4 - memory_size_bytes:] + elif dynamic_definition_type == DYNAMIC_DEFINITION_TYPE.CLEAR_DYNAMICALLY_DEFINED_DATA_IDENTIFIER: + pass + else: + raise ValueError('invalid dynamic identifier type: {}'.format(hex(dynamic_definition_type))) + self._uds_request(SERVICE_TYPE.DYNAMICALLY_DEFINE_DATA_IDENTIFIER, subfunction=dynamic_definition_type, data=data) + + def write_data_by_identifier(self, data_identifier_type: DATA_IDENTIFIER_TYPE, data_record: bytes): + data = struct.pack('!H', data_identifier_type) + data_record + resp = self._uds_request(SERVICE_TYPE.WRITE_DATA_BY_IDENTIFIER, subfunction=None, data=data) + resp_id = struct.unpack('!H', resp[0:2])[0] if len(resp) >= 2 else None + if resp_id != data_identifier_type: + raise ValueError('invalid response data identifier: {}'.format(hex(resp_id))) + + def write_memory_by_address(self, memory_address: int, memory_size: int, data_record: bytes, memory_address_bytes: int = 4, memory_size_bytes: int = 1): + if memory_address_bytes < 1 or memory_address_bytes > 4: + raise ValueError('invalid memory_address_bytes: {}'.format(memory_address_bytes)) + if memory_size_bytes < 1 or memory_size_bytes > 4: + raise ValueError('invalid memory_size_bytes: {}'.format(memory_size_bytes)) + data = bytes([memory_size_bytes << 4 | memory_address_bytes]) + + if memory_address >= 1 << (memory_address_bytes * 8): + raise ValueError('invalid memory_address: {}'.format(memory_address)) + data += struct.pack('!I', memory_address)[4 - memory_address_bytes:] + if memory_size >= 1 << (memory_size_bytes * 8): + raise ValueError('invalid memory_size: {}'.format(memory_size)) + data += struct.pack('!I', memory_size)[4 - memory_size_bytes:] + + data += data_record + self._uds_request(SERVICE_TYPE.WRITE_MEMORY_BY_ADDRESS, subfunction=0x00, data=data) + + def clear_diagnostic_information(self, dtc_group_type: DTC_GROUP_TYPE): + data = struct.pack('!I', dtc_group_type)[1:] # 3 bytes + self._uds_request(SERVICE_TYPE.CLEAR_DIAGNOSTIC_INFORMATION, subfunction=None, data=data) + + def read_dtc_information(self, dtc_report_type: DTC_REPORT_TYPE, dtc_status_mask_type: DTC_STATUS_MASK_TYPE = DTC_STATUS_MASK_TYPE.ALL, + dtc_severity_mask_type: DTC_SEVERITY_MASK_TYPE = DTC_SEVERITY_MASK_TYPE.ALL, dtc_mask_record: int = 0xFFFFFF, + dtc_snapshot_record_num: int = 0xFF, dtc_extended_record_num: int = 0xFF): + data = b'' + # dtc_status_mask_type + if dtc_report_type == DTC_REPORT_TYPE.NUMBER_OF_DTC_BY_STATUS_MASK or \ + dtc_report_type == DTC_REPORT_TYPE.DTC_BY_STATUS_MASK or \ + dtc_report_type == DTC_REPORT_TYPE.MIRROR_MEMORY_DTC_BY_STATUS_MASK or \ + dtc_report_type == DTC_REPORT_TYPE.NUMBER_OF_MIRROR_MEMORY_DTC_BY_STATUS_MASK or \ + dtc_report_type == DTC_REPORT_TYPE.NUMBER_OF_EMISSIONS_RELATED_OBD_DTC_BY_STATUS_MASK or \ + dtc_report_type == DTC_REPORT_TYPE.EMISSIONS_RELATED_OBD_DTC_BY_STATUS_MASK: + data += bytes([dtc_status_mask_type]) + # dtc_mask_record + if dtc_report_type == DTC_REPORT_TYPE.DTC_SNAPSHOT_IDENTIFICATION or \ + dtc_report_type == DTC_REPORT_TYPE.DTC_SNAPSHOT_RECORD_BY_DTC_NUMBER or \ + dtc_report_type == DTC_REPORT_TYPE.DTC_EXTENDED_DATA_RECORD_BY_DTC_NUMBER or \ + dtc_report_type == DTC_REPORT_TYPE.MIRROR_MEMORY_DTC_EXTENDED_DATA_RECORD_BY_DTC_NUMBER or \ + dtc_report_type == DTC_REPORT_TYPE.SEVERITY_INFORMATION_OF_DTC: + data += struct.pack('!I', dtc_mask_record)[1:] # 3 bytes + # dtc_snapshot_record_num + if dtc_report_type == DTC_REPORT_TYPE.DTC_SNAPSHOT_IDENTIFICATION or \ + dtc_report_type == DTC_REPORT_TYPE.DTC_SNAPSHOT_RECORD_BY_DTC_NUMBER or \ + dtc_report_type == DTC_REPORT_TYPE.DTC_SNAPSHOT_RECORD_BY_RECORD_NUMBER: + data += bytes([dtc_snapshot_record_num]) + # dtc_extended_record_num + if dtc_report_type == DTC_REPORT_TYPE.DTC_EXTENDED_DATA_RECORD_BY_DTC_NUMBER or \ + dtc_report_type == DTC_REPORT_TYPE.MIRROR_MEMORY_DTC_EXTENDED_DATA_RECORD_BY_DTC_NUMBER: + data += bytes([dtc_extended_record_num]) + # dtc_severity_mask_type + if dtc_report_type == DTC_REPORT_TYPE.NUMBER_OF_DTC_BY_SEVERITY_MASK_RECORD or \ + dtc_report_type == DTC_REPORT_TYPE.DTC_BY_SEVERITY_MASK_RECORD: + data += bytes([dtc_severity_mask_type, dtc_status_mask_type]) + + resp = self._uds_request(SERVICE_TYPE.READ_DTC_INFORMATION, subfunction=dtc_report_type, data=data) + + # TODO: parse response + return resp + + def input_output_control_by_identifier(self, data_identifier_type: DATA_IDENTIFIER_TYPE, control_parameter_type: CONTROL_PARAMETER_TYPE, + control_option_record: bytes = b'', control_enable_mask_record: bytes = b''): + data = struct.pack('!H', data_identifier_type) + bytes([control_parameter_type]) + control_option_record + control_enable_mask_record + resp = self._uds_request(SERVICE_TYPE.INPUT_OUTPUT_CONTROL_BY_IDENTIFIER, subfunction=None, data=data) + resp_id = struct.unpack('!H', resp[0:2])[0] if len(resp) >= 2 else None + if resp_id != data_identifier_type: + raise ValueError('invalid response data identifier: {}'.format(hex(resp_id))) + return resp[2:] + + def routine_control(self, routine_control_type: ROUTINE_CONTROL_TYPE, routine_identifier_type: ROUTINE_IDENTIFIER_TYPE, routine_option_record: bytes = b''): + data = struct.pack('!H', routine_identifier_type) + routine_option_record + resp = self._uds_request(SERVICE_TYPE.ROUTINE_CONTROL, subfunction=routine_control_type, data=data) + resp_id = struct.unpack('!H', resp[0:2])[0] if len(resp) >= 2 else None + if resp_id != routine_identifier_type: + raise ValueError('invalid response routine identifier: {}'.format(hex(resp_id))) + return resp[2:] + + def request_download(self, memory_address: int, memory_size: int, memory_address_bytes: int = 4, memory_size_bytes: int = 4, data_format: int = 0x00): + data = bytes([data_format]) + + if memory_address_bytes < 1 or memory_address_bytes > 4: + raise ValueError('invalid memory_address_bytes: {}'.format(memory_address_bytes)) + if memory_size_bytes < 1 or memory_size_bytes > 4: + raise ValueError('invalid memory_size_bytes: {}'.format(memory_size_bytes)) + data += bytes([memory_size_bytes << 4 | memory_address_bytes]) + + if memory_address >= 1 << (memory_address_bytes * 8): + raise ValueError('invalid memory_address: {}'.format(memory_address)) + data += struct.pack('!I', memory_address)[4 - memory_address_bytes:] + if memory_size >= 1 << (memory_size_bytes * 8): + raise ValueError('invalid memory_size: {}'.format(memory_size)) + data += struct.pack('!I', memory_size)[4 - memory_size_bytes:] + + resp = self._uds_request(SERVICE_TYPE.REQUEST_DOWNLOAD, subfunction=None, data=data) + max_num_bytes_len = resp[0] >> 4 if len(resp) > 0 else 0 + if max_num_bytes_len >= 1 and max_num_bytes_len <= 4: + max_num_bytes = struct.unpack('!I', (b"\x00" * (4 - max_num_bytes_len)) + resp[1:max_num_bytes_len + 1])[0] + else: + raise ValueError('invalid max_num_bytes_len: {}'.format(max_num_bytes_len)) + + return max_num_bytes # max number of bytes per transfer data request + + def request_upload(self, memory_address: int, memory_size: int, memory_address_bytes: int = 4, memory_size_bytes: int = 4, data_format: int = 0x00): + data = bytes([data_format]) + + if memory_address_bytes < 1 or memory_address_bytes > 4: + raise ValueError('invalid memory_address_bytes: {}'.format(memory_address_bytes)) + if memory_size_bytes < 1 or memory_size_bytes > 4: + raise ValueError('invalid memory_size_bytes: {}'.format(memory_size_bytes)) + data += bytes([memory_size_bytes << 4 | memory_address_bytes]) + + if memory_address >= 1 << (memory_address_bytes * 8): + raise ValueError('invalid memory_address: {}'.format(memory_address)) + data += struct.pack('!I', memory_address)[4 - memory_address_bytes:] + if memory_size >= 1 << (memory_size_bytes * 8): + raise ValueError('invalid memory_size: {}'.format(memory_size)) + data += struct.pack('!I', memory_size)[4 - memory_size_bytes:] + + resp = self._uds_request(SERVICE_TYPE.REQUEST_UPLOAD, subfunction=None, data=data) + max_num_bytes_len = resp[0] >> 4 if len(resp) > 0 else 0 + if max_num_bytes_len >= 1 and max_num_bytes_len <= 4: + max_num_bytes = struct.unpack('!I', (b"\x00" * (4 - max_num_bytes_len)) + resp[1:max_num_bytes_len + 1])[0] + else: + raise ValueError('invalid max_num_bytes_len: {}'.format(max_num_bytes_len)) + + return max_num_bytes # max number of bytes per transfer data request + + def transfer_data(self, block_sequence_count: int, data: bytes = b''): + data = bytes([block_sequence_count]) + data + resp = self._uds_request(SERVICE_TYPE.TRANSFER_DATA, subfunction=None, data=data) + resp_id = resp[0] if len(resp) > 0 else None + if resp_id != block_sequence_count: + raise ValueError('invalid block_sequence_count: {}'.format(resp_id)) + return resp[1:] + + def request_transfer_exit(self): + self._uds_request(SERVICE_TYPE.REQUEST_TRANSFER_EXIT, subfunction=None) diff --git a/panda/python/update.py b/panda/python/update.py new file mode 100755 index 000000000..f8e328044 --- /dev/null +++ b/panda/python/update.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +import os +import time + +def ensure_st_up_to_date(): + from panda import Panda, PandaDFU, BASEDIR + + with open(os.path.join(BASEDIR, "VERSION")) as f: + repo_version = f.read() + + repo_version += "-EON" if os.path.isfile('/EON') else "-DEV" + + panda = None + panda_dfu = None + + while 1: + # break on normal mode Panda + panda_list = Panda.list() + if len(panda_list) > 0: + panda = Panda(panda_list[0]) + break + + # flash on DFU mode Panda + panda_dfu = PandaDFU.list() + if len(panda_dfu) > 0: + panda_dfu = PandaDFU(panda_dfu[0]) + panda_dfu.recover() + + print("waiting for board...") + time.sleep(1) + + if panda.bootstub or not panda.get_version().startswith(repo_version): + panda.flash() + + if panda.bootstub: + panda.recover() + + assert(not panda.bootstub) + version = str(panda.get_version()) + print("%s should be %s" % (version, repo_version)) + assert(version.startswith(repo_version)) + +if __name__ == "__main__": + ensure_st_up_to_date() diff --git a/prebuilt b/prebuilt new file mode 100644 index 000000000..e69de29bb diff --git a/pyextra/.gitignore b/pyextra/.gitignore new file mode 100644 index 000000000..0d20b6487 --- /dev/null +++ b/pyextra/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/pyextra/acados_template/__init__.py b/pyextra/acados_template/__init__.py new file mode 100644 index 000000000..f33b75bb7 --- /dev/null +++ b/pyextra/acados_template/__init__.py @@ -0,0 +1,43 @@ +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + +from .acados_model import * +from .generate_c_code_explicit_ode import * +from .generate_c_code_implicit_ode import * +from .generate_c_code_constraint import * +from .generate_c_code_nls_cost import * +from .acados_ocp import * +from .acados_sim import * +from .acados_ocp_solver import * +from .acados_sim_solver import * +from .utils import * diff --git a/pyextra/acados_template/acados_layout.json b/pyextra/acados_template/acados_layout.json new file mode 100644 index 000000000..16fd45233 --- /dev/null +++ b/pyextra/acados_template/acados_layout.json @@ -0,0 +1,778 @@ +{ + "code_export_directory": [ + "str" + ], + "acados_include_path": [ + "str" + ], + "model": { + "name" : [ + "str" + ], + "dyn_ext_fun_type" : [ + "str" + ], + "dyn_source_discrete" : [ + "str" + ], + "dyn_disc_fun_jac_hess" : [ + "str" + ], + "dyn_disc_fun_jac" : [ + "str" + ], + "dyn_disc_fun" : [ + "str" + ] + }, + "parameter_values": [ + "ndarray", + [ + "np" + ] + ], + "acados_lib_path": [ + "str" + ], + "problem_class": [ + "str" + ], + "constraints": { + "constr_type": [ + "str" + ], + "constr_type_e": [ + "str" + ], + "lbx": [ + "ndarray", + [ + "nbx" + ] + ], + "lbu": [ + "ndarray", + [ + "nbu" + ] + ], + "ubx": [ + "ndarray", + [ + "nbx" + ] + ], + "ubu": [ + "ndarray", + [ + "nbu" + ] + ], + "idxbx": [ + "ndarray", + [ + "nbx" + ] + ], + "idxbu": [ + "ndarray", + [ + "nbu" + ] + ], + "lbx_e": [ + "ndarray", + [ + "nbx_e" + ] + ], + "ubx_e": [ + "ndarray", + [ + "nbx_e" + ] + ], + "idxbx_e": [ + "ndarray", + [ + "nbx_e" + ] + ], + "lbx_0": [ + "ndarray", + [ + "nbx_0" + ] + ], + "ubx_0": [ + "ndarray", + [ + "nbx_0" + ] + ], + "idxbx_0": [ + "ndarray", + [ + "nbx_0" + ] + ], + "idxbxe_0": [ + "ndarray", + [ + "nbxe_0" + ] + ], + "lg": [ + "ndarray", + [ + "ng" + ] + ], + "ug": [ + "ndarray", + [ + "ng" + ] + ], + "D": [ + "ndarray", + [ + "ng", + "nu" + ] + ], + "C": [ + "ndarray", + [ + "ng", + "nx" + ] + ], + "C_e": [ + "ndarray", + [ + "ng_e", + "nx" + ] + ], + "lg_e": [ + "ndarray", + [ + "ng_e" + ] + ], + "ug_e": [ + "ndarray", + [ + "ng_e" + ] + ], + "lh": [ + "ndarray", + [ + "nh" + ] + ], + "uh": [ + "ndarray", + [ + "nh" + ] + ], + "lh_e": [ + "ndarray", + [ + "nh_e" + ] + ], + "uh_e": [ + "ndarray", + [ + "nh_e" + ] + ], + "lphi": [ + "ndarray", + [ + "nphi" + ] + ], + "uphi": [ + "ndarray", + [ + "nphi" + ] + ], + "lphi_e": [ + "ndarray", + [ + "nphi_e" + ] + ], + "uphi_e": [ + "ndarray", + [ + "nphi_e" + ] + ], + "lsbx": [ + "ndarray", + [ + "nsbx" + ] + ], + "usbx": [ + "ndarray", + [ + "nsbx" + ] + ], + "lsbu": [ + "ndarray", + [ + "nsbu" + ] + ], + "usbu": [ + "ndarray", + [ + "nsbu" + ] + ], + "idxsbx": [ + "ndarray", + [ + "nsbx" + ] + ], + "idxsbu": [ + "ndarray", + [ + "nsbu" + ] + ], + "lsbx_e": [ + "ndarray", + [ + "nsbx_e" + ] + ], + "usbx_e": [ + "ndarray", + [ + "nsbx_e" + ] + ], + "idxsbx_e": [ + "ndarray", + [ + "nsbx_e" + ] + ], + "lsg": [ + "ndarray", + [ + "nsg" + ] + ], + "usg": [ + "ndarray", + [ + "nsg" + ] + ], + "idxsg": [ + "ndarray", + [ + "nsg" + ] + ], + "lsg_e": [ + "ndarray", + [ + "nsg_e" + ] + ], + "usg_e": [ + "ndarray", + [ + "nsg_e" + ] + ], + "idxsg_e": [ + "ndarray", + [ + "nsg_e" + ] + ], + "lsh": [ + "ndarray", + [ + "nsh" + ] + ], + "ush": [ + "ndarray", + [ + "nsh" + ] + ], + "idxsh": [ + "ndarray", + [ + "nsh" + ] + ], + "lsh_e": [ + "ndarray", + [ + "nsh_e" + ] + ], + "ush_e": [ + "ndarray", + [ + "nsh_e" + ] + ], + "idxsh_e": [ + "ndarray", + [ + "nsh_e" + ] + ], + "lsphi": [ + "ndarray", + [ + "nsphi" + ] + ], + "usphi": [ + "ndarray", + [ + "nsphi" + ] + ], + "idxsphi": [ + "ndarray", + [ + "nsphi" + ] + ], + "lsphi_e": [ + "ndarray", + [ + "nsphi_e" + ] + ], + "usphi_e": [ + "ndarray", + [ + "nsphi_e" + ] + ], + "idxsphi_e": [ + "ndarray", + [ + "nsphi_e" + ] + ] + }, + "cost": { + "cost_type_0": [ + "str" + ], + "cost_type": [ + "str" + ], + "cost_type_e": [ + "str" + ], + "cost_ext_fun_type_0": [ + "str" + ], + "cost_ext_fun_type": [ + "str" + ], + "cost_ext_fun_type_e": [ + "str" + ], + "Vu_0": [ + "ndarray", + [ + "ny_0", + "nu" + ] + ], + "Vu": [ + "ndarray", + [ + "ny", + "nu" + ] + ], + "Vx_0": [ + "ndarray", + [ + "ny_0", + "nx" + ] + ], + "Vx": [ + "ndarray", + [ + "ny", + "nx" + ] + ], + "Vx_e": [ + "ndarray", + [ + "ny_e", + "nx" + ] + ], + "Vz_0": [ + "ndarray", + [ + "ny_0", + "nz" + ] + ], + "Vz": [ + "ndarray", + [ + "ny", + "nz" + ] + ], + "W_0": [ + "ndarray", + [ + "ny_0", + "ny_0" + ] + ], + "W": [ + "ndarray", + [ + "ny", + "ny" + ] + ], + "Zl": [ + "ndarray", + [ + "ns" + ] + ], + "Zu": [ + "ndarray", + [ + "ns" + ] + ], + "zl": [ + "ndarray", + [ + "ns" + ] + ], + "zu": [ + "ndarray", + [ + "ns" + ] + ], + "W_e": [ + "ndarray", + [ + "ny_e", + "ny_e" + ] + ], + "yref_0": [ + "ndarray", + [ + "ny_0" + ] + ], + "yref": [ + "ndarray", + [ + "ny" + ] + ], + "yref_e": [ + "ndarray", + [ + "ny_e" + ] + ], + "Zl_e": [ + "ndarray", + [ + "ns_e" + ] + ], + "Zu_e": [ + "ndarray", + [ + "ns_e" + ] + ], + "zl_e": [ + "ndarray", + [ + "ns_e" + ] + ], + "zu_e": [ + "ndarray", + [ + "ns_e" + ] + ] + }, + "dims": { + "N": [ + "int" + ], + "nbu": [ + "int" + ], + "nbx": [ + "int" + ], + "nsbu": [ + "int" + ], + "nsbx": [ + "int" + ], + "nsbx_e": [ + "int" + ], + "nbx_0": [ + "int" + ], + "nbx_e": [ + "int" + ], + "nbxe_0": [ + "int" + ], + "nsg": [ + "int" + ], + "nsg_e": [ + "int" + ], + "nsh": [ + "int" + ], + "nsh_e": [ + "int" + ], + "nsphi": [ + "int" + ], + "nsphi_e": [ + "int" + ], + "ns": [ + "int" + ], + "ns_e": [ + "int" + ], + "ng": [ + "int" + ], + "ng_e": [ + "int" + ], + "np": [ + "int" + ], + "nr": [ + "int" + ], + "nr_e": [ + "int" + ], + "nh": [ + "int" + ], + "nh_e": [ + "int" + ], + "nphi": [ + "int" + ], + "nphi_e": [ + "int" + ], + "nu": [ + "int" + ], + "nx": [ + "int" + ], + "ny": [ + "int" + ], + "ny_0": [ + "int" + ], + "ny_e": [ + "int" + ], + "nz": [ + "int" + ], + "gnsf_nx1": [ + "int" + ], + "gnsf_nz1": [ + "int" + ], + "gnsf_nuhat": [ + "int" + ], + "gnsf_ny": [ + "int" + ], + "gnsf_nout": [ + "int" + ] + }, + "solver_options": { + "time_steps": [ + "ndarray", + [ + "N" + ] + ], + "hessian_approx": [ + "str" + ], + "regularize_method": [ + "str" + ], + "integrator_type": [ + "str" + ], + "nlp_solver_type": [ + "str" + ], + "collocation_type": [ + "str" + ], + "globalization": [ + "str" + ], + "nlp_solver_step_length": [ + "float" + ], + "levenberg_marquardt": [ + "float" + ], + "qp_solver": [ + "str" + ], + "tf": [ + "float" + ], + "Tsim": [ + "float" + ], + "alpha_min": [ + "float" + ], + "alpha_reduction": [ + "float" + ], + "sim_method_num_stages": [ + "ndarray", + [ + "N" + ] + ], + "sim_method_num_steps": [ + "ndarray", + [ + "N" + ] + ], + "sim_method_newton_iter": [ + "int" + ], + "sim_method_jac_reuse": [ + "ndarray", + [ + "N" + ] + ], + "qp_solver_cond_N": [ + "int" + ], + "qp_solver_warm_start": [ + "int" + ], + "qp_solver_tol_stat": [ + "float" + ], + "qp_solver_tol_eq": [ + "float" + ], + "qp_solver_tol_ineq": [ + "float" + ], + "qp_solver_tol_comp": [ + "float" + ], + "qp_solver_iter_max": [ + "int" + ], + "nlp_solver_tol_stat": [ + "float" + ], + "nlp_solver_tol_eq": [ + "float" + ], + "nlp_solver_tol_ineq": [ + "float" + ], + "nlp_solver_tol_comp": [ + "float" + ], + "nlp_solver_max_iter": [ + "int" + ], + "print_level": [ + "int" + ], + "initialize_t_slacks": [ + "int" + ], + "exact_hess_cost": [ + "int" + ], + "exact_hess_constr": [ + "int" + ], + "exact_hess_dyn": [ + "int" + ], + "ext_cost_num_hess": [ + "int" + ], + "model_external_shared_lib_dir": [ + "str" + ], + "model_external_shared_lib_name": [ + "str" + ] + } +} diff --git a/pyextra/acados_template/acados_model.py b/pyextra/acados_template/acados_model.py new file mode 100644 index 000000000..4871a2c0d --- /dev/null +++ b/pyextra/acados_template/acados_model.py @@ -0,0 +1,160 @@ +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + + +class AcadosModel(): + """ + Class containing all the information to code generate the external CasADi functions + that are needed when creating an acados ocp solver or acados integrator. + Thus, this class contains: + + a) the :py:attr:`name` of the model, + b) all CasADi variables/expressions needed in the CasADi function generation process. + """ + def __init__(self): + ## common for OCP and Integrator + self.name = None + """ + The model name is used for code generation. Type: string. Default: :code:`None` + """ + self.x = None #: CasADi variable describing the state of the system; Default: :code:`None` + self.xdot = None #: CasADi variable describing the derivative of the state wrt time; Default: :code:`None` + self.u = None #: CasADi variable describing the input of the system; Default: :code:`None` + self.z = [] #: CasADi variable describing the algebraic variables of the DAE; Default: :code:`empty` + self.p = [] #: CasADi variable describing parameters of the DAE; Default: :code:`empty` + # dynamics + self.f_impl_expr = None + """ + CasADi expression for the implicit dynamics :math:`f_\\text{impl}(\dot{x}, x, u, z, p) = 0`. + Used if :py:attr:`acados_template.acados_ocp.AcadosOcpOptions.integrator_type` == 'IRK'. + Default: :code:`None` + """ + self.f_expl_expr = None + """ + CasADi expression for the explicit dynamics :math:`\dot{x} = f_\\text{expl}(x, u, p)`. + Used if :py:attr:`acados_template.acados_ocp.AcadosOcpOptions.integrator_type` == 'ERK'. + Default: :code:`None` + """ + self.disc_dyn_expr = None + """ + CasADi expression for the discrete dynamics :math:`x_{+} = f_\\text{disc}(x, u, p)`. + Used if :py:attr:`acados_template.acados_ocp.AcadosOcpOptions.integrator_type` == 'DISCRETE'. + Default: :code:`None` + """ + + self.dyn_ext_fun_type = 'casadi' #: type of external functions for dynamics module; 'casadi' or 'generic'; Default: 'casadi' + self.dyn_source_discrete = None #: name of source file for discrete dyanamics; Default: :code:`None` + self.dyn_disc_fun_jac_hess = None #: name of function discrete dyanamics + jacobian and hessian; Default: :code:`None` + self.dyn_disc_fun_jac = None #: name of function discrete dyanamics + jacobian; Default: :code:`None` + self.dyn_disc_fun = None #: name of function discrete dyanamics; Default: :code:`None` + + ## for OCP + # constraints + self.con_h_expr = None #: CasADi expression for the constraint :math:`h`; Default: :code:`None` + self.con_phi_expr = None #: CasADi expression for the constraint phi; Default: :code:`None` + self.con_r_expr = None #: CasADi expression for the constraint phi(r); Default: :code:`None` + self.con_r_in_phi = None + # terminal + self.con_h_expr_e = None #: CasADi expression for the terminal constraint :math:`h^e`; Default: :code:`None` + self.con_r_expr_e = None #: CasADi expression for the terminal constraint; Default: :code:`None` + self.con_phi_expr_e = None #: CasADi expression for the terminal constraint; Default: :code:`None` + self.con_r_in_phi_e = None + # cost + self.cost_y_expr = None #: CasADi expression for nonlinear least squares; Default: :code:`None` + self.cost_y_expr_e = None #: CasADi expression for nonlinear least squares, terminal; Default: :code:`None` + self.cost_y_expr_0 = None #: CasADi expression for nonlinear least squares, initial; Default: :code:`None` + self.cost_expr_ext_cost = None #: CasADi expression for external cost; Default: :code:`None` + self.cost_expr_ext_cost_e = None #: CasADi expression for external cost, terminal; Default: :code:`None` + self.cost_expr_ext_cost_0 = None #: CasADi expression for external cost, initial; Default: :code:`None` + self.cost_expr_ext_cost_custom_hess = None #: CasADi expression for custom hessian (only for external cost); Default: :code:`None` + self.cost_expr_ext_cost_custom_hess_e = None #: CasADi expression for custom hessian (only for external cost), terminal; Default: :code:`None` + self.cost_expr_ext_cost_custom_hess_0 = None #: CasADi expression for custom hessian (only for external cost), initial; Default: :code:`None` + + +def acados_model_strip_casadi_symbolics(model): + out = model + if 'f_impl_expr' in out.keys(): + del out['f_impl_expr'] + if 'f_expl_expr' in out.keys(): + del out['f_expl_expr'] + if 'disc_dyn_expr' in out.keys(): + del out['disc_dyn_expr'] + if 'x' in out.keys(): + del out['x'] + if 'xdot' in out.keys(): + del out['xdot'] + if 'u' in out.keys(): + del out['u'] + if 'z' in out.keys(): + del out['z'] + if 'p' in out.keys(): + del out['p'] + # constraints + if 'con_phi_expr' in out.keys(): + del out['con_phi_expr'] + if 'con_h_expr' in out.keys(): + del out['con_h_expr'] + if 'con_r_expr' in out.keys(): + del out['con_r_expr'] + if 'con_r_in_phi' in out.keys(): + del out['con_r_in_phi'] + # terminal + if 'con_phi_expr_e' in out.keys(): + del out['con_phi_expr_e'] + if 'con_h_expr_e' in out.keys(): + del out['con_h_expr_e'] + if 'con_r_expr_e' in out.keys(): + del out['con_r_expr_e'] + if 'con_r_in_phi_e' in out.keys(): + del out['con_r_in_phi_e'] + # cost + if 'cost_y_expr' in out.keys(): + del out['cost_y_expr'] + if 'cost_y_expr_e' in out.keys(): + del out['cost_y_expr_e'] + if 'cost_y_expr_0' in out.keys(): + del out['cost_y_expr_0'] + if 'cost_expr_ext_cost' in out.keys(): + del out['cost_expr_ext_cost'] + if 'cost_expr_ext_cost_e' in out.keys(): + del out['cost_expr_ext_cost_e'] + if 'cost_expr_ext_cost_0' in out.keys(): + del out['cost_expr_ext_cost_0'] + if 'cost_expr_ext_cost_custom_hess' in out.keys(): + del out['cost_expr_ext_cost_custom_hess'] + if 'cost_expr_ext_cost_custom_hess_e' in out.keys(): + del out['cost_expr_ext_cost_custom_hess_e'] + if 'cost_expr_ext_cost_custom_hess_0' in out.keys(): + del out['cost_expr_ext_cost_custom_hess_0'] + + return out diff --git a/pyextra/acados_template/acados_ocp.py b/pyextra/acados_template/acados_ocp.py new file mode 100644 index 000000000..198ab033d --- /dev/null +++ b/pyextra/acados_template/acados_ocp.py @@ -0,0 +1,2842 @@ +# -*- coding: future_fstrings -*- +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + +import numpy as np +import os +from .acados_model import AcadosModel +from .utils import get_acados_path, J_to_idx, J_to_idx_slack + +class AcadosOcpDims: + """ + Class containing the dimensions of the optimal control problem. + """ + def __init__(self): + self.__nx = None + self.__nu = None + self.__nz = 0 + self.__np = 0 + self.__ny = 0 + self.__ny_e = 0 + self.__ny_0 = 0 + self.__nr = 0 + self.__nr_e = 0 + self.__nh = 0 + self.__nh_e = 0 + self.__nphi = 0 + self.__nphi_e = 0 + self.__nbx = 0 + self.__nbx_0 = 0 + self.__nbx_e = 0 + self.__nbu = 0 + self.__nsbx = 0 + self.__nsbx_e = 0 + self.__nsbu = 0 + self.__nsh = 0 + self.__nsh_e = 0 + self.__nsphi = 0 + self.__nsphi_e = 0 + self.__ns = 0 + self.__ns_e = 0 + self.__ng = 0 + self.__ng_e = 0 + self.__nsg = 0 + self.__nsg_e = 0 + self.__nbxe_0 = None + self.__N = None + + + @property + def nx(self): + """:math:`n_x` - number of states. + Type: int; default: None""" + return self.__nx + + @property + def nz(self): + """:math:`n_z` - number of algebraic variables. + Type: int; default: 0""" + return self.__nz + + @property + def nu(self): + """:math:`n_u` - number of inputs. + Type: int; default: None""" + return self.__nu + + @property + def np(self): + """:math:`n_p` - number of parameters. + Type: int; default: 0""" + return self.__np + + @property + def ny(self): + """:math:`n_y` - number of residuals in Lagrange term. + Type: int; default: 0""" + return self.__ny + + @property + def ny_0(self): + """:math:`n_{y}^0` - number of residuals in Mayer term. + Type: int; default: 0""" + return self.__ny_0 + + @property + def ny_e(self): + """:math:`n_{y}^e` - number of residuals in Mayer term. + Type: int; default: 0""" + return self.__ny_e + + @property + def nr(self): + """:math:`n_{\pi}` - dimension of the image of the inner nonlinear function in positive definite constraints. + Type: int; default: 0""" + return self.__nr + + @property + def nr_e(self): + """:math:`n_{\pi}^e` - dimension of the image of the inner nonlinear function in positive definite constraints. + Type: int; default: 0""" + return self.__nr_e + + @property + def nh(self): + """:math:`n_h` - number of nonlinear constraints. + Type: int; default: 0""" + return self.__nh + + @property + def nh_e(self): + """:math:`n_{h}^e` - number of nonlinear constraints at terminal shooting node N. + Type: int; default: 0""" + return self.__nh_e + + @property + def nphi(self): + """:math:`n_{\phi}` - number of convex-over-nonlinear constraints. + Type: int; default: 0""" + return self.__nphi + + @property + def nphi_e(self): + """:math:`n_{\phi}^e` - number of convex-over-nonlinear constraints at terminal shooting node N. + Type: int; default: 0""" + return self.__nphi_e + + @property + def nbx(self): + """:math:`n_{b_x}` - number of state bounds. + Type: int; default: 0""" + return self.__nbx + + @property + def nbxe_0(self): + """:math:`n_{be_{x0}}` - number of state bounds at initial shooting node that are equalities. + Type: int; default: None""" + return self.__nbxe_0 + + @property + def nbx_0(self): + """:math:`n_{b_{x0}}` - number of state bounds for initial state. + Type: int; default: 0""" + return self.__nbx_0 + + @property + def nbx_e(self): + """:math:`n_{b_x}` - number of state bounds at terminal shooting node N. + Type: int; default: 0""" + return self.__nbx_e + + @property + def nbu(self): + """:math:`n_{b_u}` - number of input bounds. + Type: int; default: 0""" + return self.__nbu + + @property + def nsbx(self): + """:math:`n_{{sb}_x}` - number of soft state bounds. + Type: int; default: 0""" + return self.__nsbx + + @property + def nsbx_e(self): + """:math:`n_{{sb}^e_{x}}` - number of soft state bounds at terminal shooting node N. + Type: int; default: 0""" + return self.__nsbx_e + + @property + def nsbu(self): + """:math:`n_{{sb}_u}` - number of soft input bounds. + Type: int; default: 0""" + return self.__nsbu + + @property + def nsg(self): + """:math:`n_{{sg}}` - number of soft general linear constraints. + Type: int; default: 0""" + return self.__nsg + + @property + def nsg_e(self): + """:math:`n_{{sg}^e}` - number of soft general linear constraints at terminal shooting node N. + Type: int; default: 0""" + return self.__nsg_e + + @property + def nsh(self): + """:math:`n_{{sh}}` - number of soft nonlinear constraints. + Type: int; default: 0""" + return self.__nsh + + @property + def nsh_e(self): + """:math:`n_{{sh}}^e` - number of soft nonlinear constraints at terminal shooting node N. + Type: int; default: 0""" + return self.__nsh_e + + @property + def nsphi(self): + """:math:`n_{{s\phi}}` - number of soft convex-over-nonlinear constraints. + Type: int; default: 0""" + return self.__nsphi + + @property + def nsphi_e(self): + """:math:`n_{{s\phi}^e}` - number of soft convex-over-nonlinear constraints at terminal shooting node N. + Type: int; default: 0""" + return self.__nsphi_e + + @property + def ns(self): + """:math:`n_{s}` - total number of slacks. + Type: int; default: 0""" + return self.__ns + + @property + def ns_e(self): + """:math:`n_{s}^e` - total number of slacks at terminal shooting node N. + Type: int; default: 0""" + return self.__ns_e + + @property + def ng(self): + """:math:`n_{g}` - number of general polytopic constraints. + Type: int; default: 0""" + return self.__ng + + @property + def ng_e(self): + """:math:`n_{g}^e` - number of general polytopic constraints at terminal shooting node N. + Type: int; default: 0""" + return self.__ng_e + + @property + def N(self): + """:math:`N` - prediction horizon. + Type: int; default: None""" + return self.__N + + @nx.setter + def nx(self, nx): + if type(nx) == int and nx > 0: + self.__nx = nx + else: + raise Exception('Invalid nx value, expected positive integer. Exiting.') + + @nz.setter + def nz(self, nz): + if type(nz) == int and nz > -1: + self.__nz = nz + else: + raise Exception('Invalid nz value, expected nonnegative integer. Exiting.') + + @nu.setter + def nu(self, nu): + if type(nu) == int and nu > -1: + self.__nu = nu + else: + raise Exception('Invalid nu value, expected nonnegative integer. Exiting.') + + @np.setter + def np(self, np): + if type(np) == int and np > -1: + self.__np = np + else: + raise Exception('Invalid np value, expected nonnegative integer. Exiting.') + + @ny_0.setter + def ny_0(self, ny_0): + if isinstance(ny_0, int) and ny_0 > -1: + self.__ny_0 = ny_0 + else: + raise Exception('Invalid ny_0 value, expected nonnegative integer. Exiting.') + + @ny.setter + def ny(self, ny): + if isinstance(ny, int) and ny > -1: + self.__ny = ny + else: + raise Exception('Invalid ny value, expected nonnegative integer. Exiting.') + + @ny_e.setter + def ny_e(self, ny_e): + if type(ny_e) == int and ny_e > -1: + self.__ny_e = ny_e + else: + raise Exception('Invalid ny_e value, expected nonnegative integer. Exiting.') + + @nr.setter + def nr(self, nr): + if type(nr) == int and nr > -1: + self.__nr = nr + else: + raise Exception('Invalid nr value, expected nonnegative integer. Exiting.') + + @nr_e.setter + def nr_e(self, nr_e): + if type(nr_e) == int and nr_e > -1: + self.__nr_e = nr_e + else: + raise Exception('Invalid nr_e value, expected nonnegative integer. Exiting.') + + @nh.setter + def nh(self, nh): + if type(nh) == int and nh > -1: + self.__nh = nh + else: + raise Exception('Invalid nh value, expected nonnegative integer. Exiting.') + + @nh_e.setter + def nh_e(self, nh_e): + if type(nh_e) == int and nh_e > -1: + self.__nh_e = nh_e + else: + raise Exception('Invalid nh_e value, expected nonnegative integer. Exiting.') + + @nphi.setter + def nphi(self, nphi): + if type(nphi) == int and nphi > -1: + self.__nphi = nphi + else: + raise Exception('Invalid nphi value, expected nonnegative integer. Exiting.') + + @nphi_e.setter + def nphi_e(self, nphi_e): + if type(nphi_e) == int and nphi_e > -1: + self.__nphi_e = nphi_e + else: + raise Exception('Invalid nphi_e value, expected nonnegative integer. Exiting.') + + @nbx.setter + def nbx(self, nbx): + if isinstance(nbx, int) and nbx > -1: + self.__nbx = nbx + else: + raise Exception('Invalid nbx value, expected nonnegative integer. Exiting.') + + @nbxe_0.setter + def nbxe_0(self, nbxe_0): + if isinstance(nbxe_0, int) and nbxe_0 > -1: + self.__nbxe_0 = nbxe_0 + else: + raise Exception('Invalid nbxe_0 value, expected nonnegative integer. Exiting.') + + @nbx_0.setter + def nbx_0(self, nbx_0): + if type(nbx_0) == int and nbx_0 > -1: + self.__nbx_0 = nbx_0 + else: + raise Exception('Invalid nbx_0 value, expected nonnegative integer. Exiting.') + + @nbx_e.setter + def nbx_e(self, nbx_e): + if type(nbx_e) == int and nbx_e > -1: + self.__nbx_e = nbx_e + else: + raise Exception('Invalid nbx_e value, expected nonnegative integer. Exiting.') + + @nbu.setter + def nbu(self, nbu): + if type(nbu) == int and nbu > -1: + self.__nbu = nbu + else: + raise Exception('Invalid nbu value, expected nonnegative integer. Exiting.') + + @nsbx.setter + def nsbx(self, nsbx): + if type(nsbx) == int and nsbx > -1: + self.__nsbx = nsbx + else: + raise Exception('Invalid nsbx value, expected nonnegative integer. Exiting.') + + @nsbx_e.setter + def nsbx_e(self, nsbx_e): + if type(nsbx_e) == int and nsbx_e > -1: + self.__nsbx_e = nsbx_e + else: + raise Exception('Invalid nsbx_e value, expected nonnegative integer. Exiting.') + + @nsbu.setter + def nsbu(self, nsbu): + if type(nsbu) == int and nsbu > -1: + self.__nsbu = nsbu + else: + raise Exception('Invalid nsbu value, expected nonnegative integer. Exiting.') + + @nsg.setter + def nsg(self, nsg): + if isinstance(nsg, int) and nsg > -1: + self.__nsg = nsg + else: + raise Exception('Invalid nsg value, expected nonnegative integer. Exiting.') + + @nsg_e.setter + def nsg_e(self, nsg_e): + if isinstance(nsg_e, int) and nsg_e > -1: + self.__nsg_e = nsg_e + else: + raise Exception('Invalid nsg_e value, expected nonnegative integer. Exiting.') + + @nsh.setter + def nsh(self, nsh): + if isinstance(nsh, int) and nsh > -1: + self.__nsh = nsh + else: + raise Exception('Invalid nsh value, expected nonnegative integer. Exiting.') + + @nsh_e.setter + def nsh_e(self, nsh_e): + if isinstance(nsh_e, int) and nsh_e > -1: + self.__nsh_e = nsh_e + else: + raise Exception('Invalid nsh_e value, expected nonnegative integer. Exiting.') + + @nsphi.setter + def nsphi(self, nsphi): + if isinstance(nsphi, int) and nsphi > -1: + self.__nsphi = nsphi + else: + raise Exception('Invalid nsphi value, expected nonnegative integer. Exiting.') + + @nsphi_e.setter + def nsphi_e(self, nsphi_e): + if isinstance(nsphi_e, int) and nsphi_e > -1: + self.__nsphi_e = nsphi_e + else: + raise Exception('Invalid nsphi_e value, expected nonnegative integer. Exiting.') + + @ns.setter + def ns(self, ns): + if isinstance(ns, int) and ns > -1: + self.__ns = ns + else: + raise Exception('Invalid ns value, expected nonnegative integer. Exiting.') + + @ns_e.setter + def ns_e(self, ns_e): + if isinstance(ns_e, int) and ns_e > -1: + self.__ns_e = ns_e + else: + raise Exception('Invalid ns_e value, expected nonnegative integer. Exiting.') + + @ng.setter + def ng(self, ng): + if isinstance(ng, int) and ng > -1: + self.__ng = ng + else: + raise Exception('Invalid ng value, expected nonnegative integer. Exiting.') + + @ng_e.setter + def ng_e(self, ng_e): + if isinstance(ng_e, int) and ng_e > -1: + self.__ng_e = ng_e + else: + raise Exception('Invalid ng_e value, expected nonnegative integer. Exiting.') + + @N.setter + def N(self, N): + if isinstance(N, int) and N > 0: + self.__N = N + else: + raise Exception('Invalid N value, expected positive integer. Exiting.') + + def set(self, attr, value): + setattr(self, attr, value) + + +class AcadosOcpCost: + """ + Class containing the numerical data of the cost: + + In case of LINEAR_LS: + stage cost is + :math:`l(x,u,z) = || V_x \, x + V_u \, u + V_z \, z - y_\\text{ref}||^2_W`, + terminal cost is + :math:`m(x) = || V^e_x \, x - y_\\text{ref}^e||^2_{W^e}` + + In case of NONLINEAR_LS: + stage cost is + :math:`l(x,u,z) = || y(x,u,z) - y_\\text{ref}||^2_W`, + terminal cost is + :math:`m(x) = || y^e(x) - y_\\text{ref}^e||^2_{W^e}` + """ + def __init__(self): + # initial stage + self.__cost_type_0 = None + self.__W_0 = None + self.__Vx_0 = None + self.__Vu_0 = None + self.__Vz_0 = None + self.__yref_0 = None + self.__cost_ext_fun_type_0 = 'casadi' + # Lagrange term + self.__cost_type = 'LINEAR_LS' # cost type + self.__W = np.zeros((0,0)) + self.__Vx = np.zeros((0,0)) + self.__Vu = np.zeros((0,0)) + self.__Vz = np.zeros((0,0)) + self.__yref = np.array([]) + self.__Zl = np.array([]) + self.__Zu = np.array([]) + self.__zl = np.array([]) + self.__zu = np.array([]) + self.__cost_ext_fun_type = 'casadi' + # Mayer term + self.__cost_type_e = 'LINEAR_LS' + self.__W_e = np.zeros((0,0)) + self.__Vx_e = np.zeros((0,0)) + self.__yref_e = np.array([]) + self.__Zl_e = np.array([]) + self.__Zu_e = np.array([]) + self.__zl_e = np.array([]) + self.__zu_e = np.array([]) + self.__cost_ext_fun_type_e = 'casadi' + + # initial stage + @property + def cost_type_0(self): + """Cost type at initial shooting node (0) + -- string in {EXTERNAL, LINEAR_LS, NONLINEAR_LS} or :code:`None`. + Default: :code:`None`. + + .. note:: Cost at initial stage is the same as for intermediate shooting nodes if not set differently explicitly. + + .. note:: If :py:attr:`cost_type_0` is set to :code:`None` values in :py:attr:`W_0`, :py:attr:`Vx_0`, :py:attr:`Vu_0`, :py:attr:`Vz_0` and :py:attr:`yref_0` are ignored (set to :code:`None`). + """ + return self.__cost_type_0 + + @property + def W_0(self): + """:math:`W_0` - weight matrix at initial shooting node (0). + Default: :code:`None`. + """ + return self.__W_0 + + @property + def Vx_0(self): + """:math:`V_x^0` - x matrix coefficient at initial shooting node (0). + Default: :code:`None`. + """ + return self.__Vx_0 + + @property + def Vu_0(self): + """:math:`V_u^0` - u matrix coefficient at initial shooting node (0). + Default: :code:`None`. + """ + return self.__Vu_0 + + @property + def Vz_0(self): + """:math:`V_z^0` - z matrix coefficient at initial shooting node (0). + Default: :code:`None`. + """ + return self.__Vz_0 + + @property + def yref_0(self): + """:math:`y_\\text{ref}^0` - reference at initial shooting node (0). + Default: :code:`None`. + """ + return self.__yref_0 + + @property + def cost_ext_fun_type_0(self): + """Type of external function for cost at initial shooting node (0) + -- string in {casadi, generic} or :code:`None` + Default: :code:'casadi'. + + .. note:: Cost at initial stage is the same as for intermediate shooting nodes if not set differently explicitly. + """ + return self.__cost_ext_fun_type_0 + + @yref_0.setter + def yref_0(self, yref_0): + if isinstance(yref_0, np.ndarray): + self.__yref_0 = yref_0 + else: + raise Exception('Invalid yref_0 value, expected numpy array. Exiting.') + + @W_0.setter + def W_0(self, W_0): + if isinstance(W_0, np.ndarray) and len(W_0.shape) == 2: + self.__W_0 = W_0 + else: + raise Exception('Invalid cost W_0 value. ' \ + + 'Should be 2 dimensional numpy array. Exiting.') + + @Vx_0.setter + def Vx_0(self, Vx_0): + if isinstance(Vx_0, np.ndarray) and len(Vx_0.shape) == 2: + self.__Vx_0 = Vx_0 + else: + raise Exception('Invalid cost Vx_0 value. ' \ + + 'Should be 2 dimensional numpy array. Exiting.') + + @Vu_0.setter + def Vu_0(self, Vu_0): + if isinstance(Vu_0, np.ndarray) and len(Vu_0.shape) == 2: + self.__Vu_0 = Vu_0 + else: + raise Exception('Invalid cost Vu_0 value. ' \ + + 'Should be 2 dimensional numpy array. Exiting.') + + @Vz_0.setter + def Vz_0(self, Vz_0): + if isinstance(Vz_0, np.ndarray) and len(Vz_0.shape) == 2: + self.__Vz_0 = Vz_0 + else: + raise Exception('Invalid cost Vz_0 value. ' \ + + 'Should be 2 dimensional numpy array. Exiting.') + + @cost_ext_fun_type_0.setter + def cost_ext_fun_type_0(self, cost_ext_fun_type_0): + if cost_ext_fun_type_0 in ['casadi', 'generic']: + self.__cost_ext_fun_type_0 = cost_ext_fun_type_0 + else: + raise Exception('Invalid cost_ext_fun_type_0 value, expected numpy array. Exiting.') + + # Lagrange term + @property + def cost_type(self): + """ + Cost type at intermediate shooting nodes (1 to N-1) + -- string in {EXTERNAL, LINEAR_LS, NONLINEAR_LS}. + Default: 'LINEAR_LS'. + """ + return self.__cost_type + + @property + def W(self): + """:math:`W` - weight matrix at intermediate shooting nodes (1 to N-1). + Default: :code:`np.zeros((0,0))`. + """ + return self.__W + + @property + def Vx(self): + """:math:`V_x` - x matrix coefficient at intermediate shooting nodes (1 to N-1). + Default: :code:`np.zeros((0,0))`. + """ + return self.__Vx + + @property + def Vu(self): + """:math:`V_u` - u matrix coefficient at intermediate shooting nodes (1 to N-1). + Default: :code:`np.zeros((0,0))`. + """ + return self.__Vu + + @property + def Vz(self): + """:math:`V_z` - z matrix coefficient at intermediate shooting nodes (1 to N-1). + Default: :code:`np.zeros((0,0))`. + """ + return self.__Vz + + @property + def yref(self): + """:math:`y_\\text{ref}` - reference at intermediate shooting nodes (1 to N-1). + Default: :code:`np.array([])`. + """ + return self.__yref + + @property + def Zl(self): + """:math:`Z_l` - diagonal of Hessian wrt lower slack at intermediate shooting nodes (1 to N-1). + Default: :code:`np.array([])`. + """ + return self.__Zl + + @property + def Zu(self): + """:math:`Z_u` - diagonal of Hessian wrt upper slack at intermediate shooting nodes (1 to N-1). + Default: :code:`np.array([])`. + """ + return self.__Zu + + @property + def zl(self): + """:math:`z_l` - gradient wrt lower slack at intermediate shooting nodes (1 to N-1). + Default: :code:`np.array([])`. + """ + return self.__zl + + @property + def zu(self): + """:math:`z_u` - gradient wrt upper slack at intermediate shooting nodes (1 to N-1). + Default: :code:`np.array([])`. + """ + return self.__zu + + @property + def cost_ext_fun_type(self): + """Type of external function for cost at intermediate shooting nodes (1 to N-1). + -- string in {casadi, generic} + Default: :code:'casadi'. + """ + return self.__cost_ext_fun_type + + @cost_type.setter + def cost_type(self, cost_type): + cost_types = ('LINEAR_LS', 'NONLINEAR_LS', 'EXTERNAL') + if cost_type in cost_types: + self.__cost_type = cost_type + else: + raise Exception('Invalid cost_type value. Exiting.') + + @cost_type_0.setter + def cost_type_0(self, cost_type_0): + cost_types = ('LINEAR_LS', 'NONLINEAR_LS', 'EXTERNAL') + if cost_type_0 in cost_types: + self.__cost_type_0 = cost_type_0 + else: + raise Exception('Invalid cost_type_0 value. Exiting.') + + @W.setter + def W(self, W): + if isinstance(W, np.ndarray) and len(W.shape) == 2: + self.__W = W + else: + raise Exception('Invalid cost W value. ' \ + + 'Should be 2 dimensional numpy array. Exiting.') + + + @Vx.setter + def Vx(self, Vx): + if isinstance(Vx, np.ndarray) and len(Vx.shape) == 2: + self.__Vx = Vx + else: + raise Exception('Invalid cost Vx value. ' \ + + 'Should be 2 dimensional numpy array. Exiting.') + + @Vu.setter + def Vu(self, Vu): + if isinstance(Vu, np.ndarray) and len(Vu.shape) == 2: + self.__Vu = Vu + else: + raise Exception('Invalid cost Vu value. ' \ + + 'Should be 2 dimensional numpy array. Exiting.') + + @Vz.setter + def Vz(self, Vz): + if isinstance(Vz, np.ndarray) and len(Vz.shape) == 2: + self.__Vz = Vz + else: + raise Exception('Invalid cost Vz value. ' \ + + 'Should be 2 dimensional numpy array. Exiting.') + + @yref.setter + def yref(self, yref): + if isinstance(yref, np.ndarray): + self.__yref = yref + else: + raise Exception('Invalid yref value, expected numpy array. Exiting.') + + @Zl.setter + def Zl(self, Zl): + if isinstance(Zl, np.ndarray): + self.__Zl = Zl + else: + raise Exception('Invalid Zl value, expected numpy array. Exiting.') + + @Zu.setter + def Zu(self, Zu): + if isinstance(Zu, np.ndarray): + self.__Zu = Zu + else: + raise Exception('Invalid Zu value, expected numpy array. Exiting.') + + @zl.setter + def zl(self, zl): + if isinstance(zl, np.ndarray): + self.__zl = zl + else: + raise Exception('Invalid zl value, expected numpy array. Exiting.') + + @zu.setter + def zu(self, zu): + if isinstance(zu, np.ndarray): + self.__zu = zu + else: + raise Exception('Invalid zu value, expected numpy array. Exiting.') + + @cost_ext_fun_type.setter + def cost_ext_fun_type(self, cost_ext_fun_type): + if cost_ext_fun_type in ['casadi', 'generic']: + self.__cost_ext_fun_type = cost_ext_fun_type + else: + raise Exception('Invalid cost_ext_fun_type value, expected numpy array. Exiting.') + + # Mayer term + @property + def cost_type_e(self): + """ + Cost type at terminal shooting node (N) + -- string in {EXTERNAL, LINEAR_LS, NONLINEAR_LS}. + Default: 'LINEAR_LS'. + """ + return self.__cost_type_e + + @property + def W_e(self): + """:math:`W_e` - weight matrix at terminal shooting node (N). + Default: :code:`np.zeros((0,0))`. + """ + return self.__W_e + + @property + def Vx_e(self): + """:math:`V_x^e` - x matrix coefficient for cost at terminal shooting node (N). + Default: :code:`np.zeros((0,0))`. + """ + return self.__Vx_e + + @property + def yref_e(self): + """:math:`y_\\text{ref}^e` - cost reference at terminal shooting node (N). + Default: :code:`np.array([])`. + """ + return self.__yref_e + + @property + def Zl_e(self): + """:math:`Z_l^e` - diagonal of Hessian wrt lower slack at terminal shooting node (N). + Default: :code:`np.array([])`. + """ + return self.__Zl_e + + @property + def Zu_e(self): + """:math:`Z_u^e` - diagonal of Hessian wrt upper slack at terminal shooting node (N). + Default: :code:`np.array([])`. + """ + return self.__Zu_e + + @property + def zl_e(self): + """:math:`z_l^e` - gradient wrt lower slack at terminal shooting node (N). + Default: :code:`np.array([])`. + """ + return self.__zl_e + + @property + def zu_e(self): + """:math:`z_u^e` - gradient wrt upper slack at terminal shooting node (N). + Default: :code:`np.array([])`. + """ + return self.__zu_e + + @property + def cost_ext_fun_type_e(self): + """Type of external function for cost at intermediate shooting nodes (1 to N-1). + -- string in {casadi, generic} + Default: :code:'casadi'. + """ + return self.__cost_ext_fun_type_e + + @cost_type_e.setter + def cost_type_e(self, cost_type_e): + cost_types = ('LINEAR_LS', 'NONLINEAR_LS', 'EXTERNAL') + + if cost_type_e in cost_types: + self.__cost_type_e = cost_type_e + else: + raise Exception('Invalid cost_type_e value. Exiting.') + + @W_e.setter + def W_e(self, W_e): + if isinstance(W_e, np.ndarray) and len(W_e.shape) == 2: + self.__W_e = W_e + else: + raise Exception('Invalid cost W_e value. ' \ + + 'Should be 2 dimensional numpy array. Exiting.') + + @Vx_e.setter + def Vx_e(self, Vx_e): + if isinstance(Vx_e, np.ndarray) and len(Vx_e.shape) == 2: + self.__Vx_e = Vx_e + else: + raise Exception('Invalid cost Vx_e value. ' \ + + 'Should be 2 dimensional numpy array. Exiting.') + + @yref_e.setter + def yref_e(self, yref_e): + if isinstance(yref_e, np.ndarray): + self.__yref_e = yref_e + else: + raise Exception('Invalid yref_e value, expected numpy array. Exiting.') + + @Zl_e.setter + def Zl_e(self, Zl_e): + if isinstance(Zl_e, np.ndarray): + self.__Zl_e = Zl_e + else: + raise Exception('Invalid Zl_e value, expected numpy array. Exiting.') + + @Zu_e.setter + def Zu_e(self, Zu_e): + if isinstance(Zu_e, np.ndarray): + self.__Zu_e = Zu_e + else: + raise Exception('Invalid Zu_e value, expected numpy array. Exiting.') + + @zl_e.setter + def zl_e(self, zl_e): + if isinstance(zl_e, np.ndarray): + self.__zl_e = zl_e + else: + raise Exception('Invalid zl_e value, expected numpy array. Exiting.') + + @zu_e.setter + def zu_e(self, zu_e): + if isinstance(zu_e, np.ndarray): + self.__zu_e = zu_e + else: + raise Exception('Invalid zu_e value, expected numpy array. Exiting.') + + @cost_ext_fun_type_e.setter + def cost_ext_fun_type_e(self, cost_ext_fun_type_e): + if cost_ext_fun_type_e in ['casadi', 'generic']: + self.__cost_ext_fun_type_e = cost_ext_fun_type_e + else: + raise Exception('Invalid cost_ext_fun_type_e value, expected numpy array. Exiting.') + + def set(self, attr, value): + setattr(self, attr, value) + + +def print_J_to_idx_note(): + print("NOTE: J* matrix is converted to zero based vector idx* vector, which is returned here.") + + +class AcadosOcpConstraints: + """ + class containing the description of the constraints + """ + def __init__(self): + self.__constr_type = 'BGH' + self.__constr_type_e = 'BGH' + # initial x + self.__lbx_0 = np.array([]) + self.__ubx_0 = np.array([]) + self.__idxbx_0 = np.array([]) + self.__idxbxe_0 = np.array([]) + # state bounds + self.__lbx = np.array([]) + self.__ubx = np.array([]) + self.__idxbx = np.array([]) + # bounds on x at shooting node N + self.__lbx_e = np.array([]) + self.__ubx_e = np.array([]) + self.__idxbx_e = np.array([]) + # bounds on u + self.__lbu = np.array([]) + self.__ubu = np.array([]) + self.__idxbu = np.array([]) + # polytopic constraints + self.__lg = np.array([]) + self.__ug = np.array([]) + self.__D = np.zeros((0,0)) + self.__C = np.zeros((0,0)) + # polytopic constraints at shooting node N + self.__C_e = np.zeros((0,0)) + self.__lg_e = np.array([]) + self.__ug_e = np.array([]) + # nonlinear constraints + self.__lh = np.array([]) + self.__uh = np.array([]) + # nonlinear constraints at shooting node N + self.__uh_e = np.array([]) + self.__lh_e = np.array([]) + # convex-over-nonlinear constraints + self.__lphi = np.array([]) + self.__uphi = np.array([]) + # nonlinear constraints at shooting node N + self.__uphi_e = np.array([]) + self.__lphi_e = np.array([]) + # SLACK BOUNDS + # soft bounds on x + self.__lsbx = np.array([]) + self.__usbx = np.array([]) + self.__idxsbx = np.array([]) + # soft bounds on u + self.__lsbu = np.array([]) + self.__usbu = np.array([]) + self.__idxsbu = np.array([]) + # soft bounds on x at shooting node N + self.__lsbx_e = np.array([]) + self.__usbx_e = np.array([]) + self.__idxsbx_e= np.array([]) + # soft bounds on general linear constraints + self.__lsg = np.array([]) + self.__usg = np.array([]) + self.__idxsg = np.array([]) + # soft bounds on nonlinear constraints + self.__lsh = np.array([]) + self.__ush = np.array([]) + self.__idxsh = np.array([]) + # soft bounds on nonlinear constraints + self.__lsphi = np.array([]) + self.__usphi = np.array([]) + self.__idxsphi = np.array([]) + # soft bounds on general linear constraints at shooting node N + self.__lsg_e = np.array([]) + self.__usg_e = np.array([]) + self.__idxsg_e = np.array([]) + # soft bounds on nonlinear constraints at shooting node N + self.__lsh_e = np.array([]) + self.__ush_e = np.array([]) + self.__idxsh_e = np.array([]) + # soft bounds on nonlinear constraints at shooting node N + self.__lsphi_e = np.array([]) + self.__usphi_e = np.array([]) + self.__idxsphi_e = np.array([]) + + + # types + @property + def constr_type(self): + """Constraints type for shooting nodes (0 to N-1). string in {BGH, BGP}. + Default: BGH; BGP is for convex over nonlinear.""" + return self.__constr_type + + @property + def constr_type_e(self): + """Constraints type for terminal shooting node N. string in {BGH, BGP}. + Default: BGH; BGP is for convex over nonlinear.""" + return self.__constr_type_e + + # initial bounds on x + @property + def lbx_0(self): + """:math:`\\underline{x_0}` - lower bounds on x at initial stage 0. + Type: :code:`np.ndarray`; default: :code:`np.array([])`.""" + return self.__lbx_0 + + @property + def ubx_0(self): + """:math:`\\bar{x_0}` - upper bounds on x at initial stage 0. + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__ubx_0 + + @property + def Jbx_0(self): + """:math:`J_{bx,0}` - matrix coefficient for bounds on x at initial stage 0. + Translated internally to :py:attr:`idxbx_0`""" + print_J_to_idx_note() + return self.__idxbx_0 + + @property + def idxbx_0(self): + """Indices of bounds on x at initial stage 0 + -- can be set automatically via x0. + Can be set by using :py:attr:`Jbx_0`. + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__idxbx_0 + + @property + def idxbxe_0(self): + """Indices of bounds on x0 that are equalities -- can be set automatically via :py:attr:`x0`. + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__idxbxe_0 + + # bounds on x + @property + def lbx(self): + """:math:`\\underline{x}` - lower bounds on x at intermediate shooting nodes (1 to N-1). + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__lbx + + @property + def ubx(self): + """:math:`\\bar{x}` - upper bounds on x at intermediate shooting nodes (1 to N-1). + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__ubx + + @property + def idxbx(self): + """indices of bounds on x (defines :math:`J_{bx}`) at intermediate shooting nodes (1 to N-1). + Can be set by using :py:attr:`Jbx`. + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__idxbx + + @property + def Jbx(self): + """:math:`J_{bx}` - matrix coefficient for bounds on x + at intermediate shooting nodes (1 to N-1). + Translated internally into :py:attr:`idxbx`.""" + print_J_to_idx_note() + return self.__idxbx + + # bounds on x at shooting node N + @property + def lbx_e(self): + """:math:`\\underline{x}^e` - lower bounds on x at terminal shooting node N. + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__lbx_e + + @property + def ubx_e(self): + """:math:`\\bar{x}^e` - upper bounds on x at terminal shooting node N. + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__ubx_e + + @property + def idxbx_e(self): + """Indices for bounds on x at terminal shooting node N (defines :math:`J_{bx}^e`). + Can be set by using :py:attr:`Jbx_e`. + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__idxbx_e + + @property + def Jbx_e(self): + """:math:`J_{bx}^e` matrix coefficient for bounds on x at terminal shooting node N. + Translated internally into :py:attr:`idxbx_e`.""" + print_J_to_idx_note() + return self.__idxbx_e + + # bounds on u + @property + def lbu(self): + """:math:`\\underline{u}` - lower bounds on u at shooting nodes (0 to N-1). + Type: :code:`np.ndarray`; default: :code:`np.array([])` + """ + return self.__lbu + + @property + def ubu(self): + """:math:`\\bar{u}` - upper bounds on u at shooting nodes (0 to N-1). + Type: :code:`np.ndarray`; default: :code:`np.array([])` + """ + return self.__ubu + + @property + def idxbu(self): + """Indices of bounds on u (defines :math:`J_{bu}`) at shooting nodes (0 to N-1). + Can be set by using :py:attr:`Jbu`. + Type: :code:`np.ndarray`; default: :code:`np.array([])` + """ + return self.__idxbu + + @property + def Jbu(self): + """:math:`J_{bu}` - matrix coefficient for bounds on u at shooting nodes (0 to N-1). + Translated internally to :py:attr:`idxbu`. + """ + print_J_to_idx_note() + return self.__idxbu + + # polytopic constraints + @property + def C(self): + """:math:`C` - C matrix in :math:`\\underline{g} \\leq D \, u + C \, x \\leq \\bar{g}` + at shooting nodes (0 to N-1). + Type: :code:`np.ndarray`; default: :code:`np.array((0,0))`. + """ + return self.__C + + @property + def D(self): + """:math:`D` - D matrix in :math:`\\underline{g} \\leq D \, u + C \, x \\leq \\bar{g}` + at shooting nodes (0 to N-1). + Type: :code:`np.ndarray`; default: :code:`np.array((0,0))` + """ + return self.__D + + @property + def lg(self): + """:math:`\\underline{g}` - lower bound for general polytopic inequalities + at shooting nodes (0 to N-1). + Type: :code:`np.ndarray`; default: :code:`np.array([])` + """ + return self.__lg + + @property + def ug(self): + """:math:`\\bar{g}` - upper bound for general polytopic inequalities + at shooting nodes (0 to N-1). + Type: :code:`np.ndarray`; default: :code:`np.array([])`. + """ + return self.__ug + + # polytopic constraints at shooting node N + @property + def C_e(self): + """:math:`C^e` - C matrix at terminal shooting node N. + Type: :code:`np.ndarray`; default: :code:`np.array((0,0))`. + """ + return self.__C_e + + @property + def lg_e(self): + """:math:`\\underline{g}^e` - lower bound on general polytopic inequalities + at terminal shooting node N. + Type: :code:`np.ndarray`; default: :code:`np.array([])`. + """ + return self.__lg_e + + @property + def ug_e(self): + """:math:`\\bar{g}^e` - upper bound on general polytopic inequalities + at terminal shooting node N. + Type: :code:`np.ndarray`; default: :code:`np.array([])`. + """ + return self.__ug_e + + + # nonlinear constraints + @property + def lh(self): + """:math:`\\underline{h}` - lower bound for nonlinear inequalities + at shooting nodes (0 to N-1). + Type: :code:`np.ndarray`; default: :code:`np.array([])`. + """ + return self.__lh + + @property + def uh(self): + """:math:`\\bar{h}` - upper bound for nonlinear inequalities + at shooting nodes (0 to N-1). + Type: :code:`np.ndarray`; default: :code:`np.array([])`. + """ + return self.__uh + + # nonlinear constraints at shooting node N + @property + def lh_e(self): + """:math:`\\underline{h}^e` - lower bound on nonlinear inequalities + at terminal shooting node N. + Type: :code:`np.ndarray`; default: :code:`np.array([])`. + """ + return self.__lh_e + + @property + def uh_e(self): + """:math:`\\bar{h}^e` - upper bound on nonlinear inequalities + at terminal shooting node N. + Type: :code:`np.ndarray`; default: :code:`np.array([])`. + """ + return self.__uh_e + + # convex-over-nonlinear constraints + @property + def lphi(self): + """:math:`\\underline{\phi}` - lower bound for convex-over-nonlinear inequalities + at shooting nodes (0 to N-1). + Type: :code:`np.ndarray`; default: :code:`np.array([])`. + """ + return self.__lphi + + @property + def uphi(self): + """:math:`\\bar{\phi}` - upper bound for convex-over-nonlinear inequalities + at shooting nodes (0 to N-1). + Type: :code:`np.ndarray`; default: :code:`np.array([])`. + """ + return self.__uphi + + # convex-over-nonlinear constraints at shooting node N + @property + def lphi_e(self): + """:math:`\\underline{\phi}^e` - lower bound on convex-over-nonlinear inequalities + at terminal shooting node N. + Type: :code:`np.ndarray`; default: :code:`np.array([])`. + """ + return self.__lphi_e + + @property + def uphi_e(self): + """:math:`\\bar{\phi}^e` - upper bound on convex-over-nonlinear inequalities + at terminal shooting node N. + Type: :code:`np.ndarray`; default: :code:`np.array([])`. + """ + return self.__uphi_e + + + # SLACK bounds + # soft bounds on x + @property + def lsbx(self): + """Lower bounds on slacks corresponding to soft lower bounds on x + at stages (1 to N-1); + not required - zeros by default""" + return self.__lsbx + + @property + def usbx(self): + """Lower bounds on slacks corresponding to soft upper bounds on x + at stages (1 to N-1); + not required - zeros by default""" + return self.__usbx + + @property + def idxsbx(self): + """Indices of soft bounds on x within the indices of bounds on x + at stages (1 to N-1). + Can be set by using :py:attr:`Jsbx`. + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__idxsbx + + @property + def Jsbx(self): + """:math:`J_{sbx}` - matrix coefficient for soft bounds on x + at stages (1 to N-1); + Translated internally into :py:attr:`idxsbx`.""" + print_J_to_idx_note() + return self.__idxsbx + + # soft bounds on u + @property + def lsbu(self): + """Lower bounds on slacks corresponding to soft lower bounds on u + at stages (0 to N-1). + Not required - zeros by default.""" + return self.__lsbu + + @property + def usbu(self): + """Lower bounds on slacks corresponding to soft upper bounds on u + at stages (0 to N-1); + not required - zeros by default""" + return self.__usbu + + @property + def idxsbu(self): + """Indices of soft bounds on u within the indices of bounds on u + at stages (0 to N-1). + Can be set by using :py:attr:`Jsbu`. + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__idxsbu + + @property + def Jsbu(self): + """:math:`J_{sbu}` - matrix coefficient for soft bounds on u + at stages (0 to N-1); + internally translated into :py:attr:`idxsbu`""" + print_J_to_idx_note() + return self.__idxsbu + + # soft bounds on x at shooting node N + @property + def lsbx_e(self): + """Lower bounds on slacks corresponding to soft lower bounds on x at shooting node N. + Not required - zeros by default""" + return self.__lsbx_e + + @property + def usbx_e(self): + """Lower bounds on slacks corresponding to soft upper bounds on x at shooting node N. + Not required - zeros by default""" + return self.__usbx_e + + @property + def idxsbx_e(self): + """Indices of soft bounds on x at shooting node N, within the indices of bounds on x at terminal shooting node N. + Can be set by using :py:attr:`Jsbx_e`. + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__idxsbx_e + + @property + def Jsbx_e(self): + """:math:`J_{sbx}^e` - matrix coefficient for soft bounds on x at terminal shooting node N. + Translated internally to :py:attr:`idxsbx_e`""" + print_J_to_idx_note() + return self.__idxsbx_e + + # soft general linear constraints + @property + def lsg(self): + """Lower bounds on slacks corresponding to soft lower bounds for general linear constraints + at stages (0 to N-1). + Type: :code:`np.ndarray`; default: :code:`np.array([])` + """ + return self.__lsg + + @property + def usg(self): + """Lower bounds on slacks corresponding to soft upper bounds for general linear constraints. + Not required - zeros by default""" + return self.__usg + + @property + def idxsg(self): + """Indices of soft general linear constraints within the indices of general linear constraints. + Can be set by using :py:attr:`Jsg`. + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__idxsg + + @property + def Jsg(self): + """:math:`J_{sg}` - matrix coefficient for soft bounds on general linear constraints. + Translated internally to :py:attr:`idxsg`""" + print_J_to_idx_note() + return self.__idxsg + + # soft nonlinear constraints + @property + def lsh(self): + """Lower bounds on slacks corresponding to soft lower bounds for nonlinear constraints. + Not required - zeros by default""" + return self.__lsh + + @property + def ush(self): + """Lower bounds on slacks corresponding to soft upper bounds for nonlinear constraints. + Not required - zeros by default""" + return self.__ush + + @property + def idxsh(self): + """Indices of soft nonlinear constraints within the indices of nonlinear constraints. + Can be set by using :py:attr:`Jbx`. + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__idxsh + + @property + def Jsh(self): + """:math:`J_{sh}` - matrix coefficient for soft bounds on nonlinear constraints. + Translated internally to :py:attr:`idxsh`""" + print_J_to_idx_note() + return self.__idxsh + + # soft bounds on convex-over-nonlinear constraints + @property + def lsphi(self): + """Lower bounds on slacks corresponding to soft lower bounds for convex-over-nonlinear constraints. + Not required - zeros by default""" + return self.__lsphi + + @property + def usphi(self): + """Lower bounds on slacks corresponding to soft upper bounds for convex-over-nonlinear constraints. + Not required - zeros by default""" + return self.__usphi + + @property + def idxsphi(self): + """Indices of soft convex-over-nonlinear constraints within the indices of nonlinear constraints. + Can be set by using :py:attr:`Jsphi`. + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__idxsphi + + @property + def Jsphi(self): + """:math:`J_{s, \phi}` - matrix coefficient for soft bounds on convex-over-nonlinear constraints. + Translated internally into :py:attr:`idxsphi`.""" + print_J_to_idx_note() + return self.__idxsphi + + + # soft bounds on general linear constraints at shooting node N + @property + def lsg_e(self): + """Lower bounds on slacks corresponding to soft lower bounds for general linear constraints at shooting node N. + Not required - zeros by default""" + return self.__lsg_e + + @property + def usg_e(self): + """Lower bounds on slacks corresponding to soft upper bounds for general linear constraints at shooting node N. + Not required - zeros by default""" + return self.__usg_e + + @property + def idxsg_e(self): + """Indices of soft general linear constraints at shooting node N within the indices of general linear constraints at shooting node N. + Can be set by using :py:attr:`Jsg_e`.""" + return self.__idxsg_e + + @property + def Jsg_e(self): + """:math:`J_{s,h}^e` - matrix coefficient for soft bounds on general linear constraints at terminal shooting node N. + Translated internally to :py:attr:`idxsg_e`""" + print_J_to_idx_note() + return self.__idxsg_e + + + # soft bounds on nonlinear constraints at shooting node N + @property + def lsh_e(self): + """Lower bounds on slacks corresponding to soft lower bounds for nonlinear constraints at terminal shooting node N. + Not required - zeros by default""" + return self.__lsh_e + + @property + def ush_e(self): + """Lower bounds on slacks corresponding to soft upper bounds for nonlinear constraints at terminal shooting node N. + Not required - zeros by default""" + return self.__ush_e + + @property + def idxsh_e(self): + """Indices of soft nonlinear constraints at shooting node N within the indices of nonlinear constraints at terminal shooting node N. + Can be set by using :py:attr:`Jsh_e`.""" + return self.__idxsh_e + + @property + def Jsh_e(self): + """:math:`J_{s,h}^e` - matrix coefficient for soft bounds on nonlinear constraints at terminal shooting node N; fills :py:attr:`idxsh_e`""" + print_J_to_idx_note() + return self.__idxsh_e + + # soft bounds on convex-over-nonlinear constraints at shooting node N + @property + def lsphi_e(self): + """Lower bounds on slacks corresponding to soft lower bounds for convex-over-nonlinear constraints at terminal shooting node N. + Not required - zeros by default""" + return self.__lsphi_e + + @property + def usphi_e(self): + """Lower bounds on slacks corresponding to soft upper bounds for convex-over-nonlinear constraints at terminal shooting node N. + Not required - zeros by default""" + return self.__usphi_e + + @property + def idxsphi_e(self): + """Indices of soft nonlinear constraints at shooting node N within the indices of nonlinear constraints at terminal shooting node N. + Can be set by using :py:attr:`Jsphi_e`. + Type: :code:`np.ndarray`; default: :code:`np.array([])`""" + return self.__idxsphi_e + + @property + def Jsphi_e(self): + """:math:`J_{sh}^e` - matrix coefficient for soft bounds on convex-over-nonlinear constraints at shooting node N. + Translated internally to :py:attr:`idxsphi_e`""" + print_J_to_idx_note() + return self.__idxsphi_e + + @property + def x0(self): + """:math:`x_0 \\in \mathbb{R}^{n_x}` - initial state -- + Translated internally to :py:attr:`idxbx_0`, :py:attr:`lbx_0`, :py:attr:`ubx_0`, :py:attr:`idxbxe_0` """ + print("x0 is converted to lbx_0, ubx_0, idxbx_0") + print("idxbx_0: ", self.__idxbx_0) + print("lbx_0: ", self.__lbx_0) + print("ubx_0: ", self.__ubx_0) + print("idxbxe_0: ", self.__idxbxe_0) + return None + + # SETTERS + @constr_type.setter + def constr_type(self, constr_type): + constr_types = ('BGH', 'BGP') + if constr_type in constr_types: + self.__constr_type = constr_type + else: + raise Exception('Invalid constr_type value. Possible values are:\n\n' \ + + ',\n'.join(constr_types) + '.\n\nYou have: ' + constr_type + '.\n\nExiting.') + + @constr_type_e.setter + def constr_type_e(self, constr_type_e): + constr_types = ('BGH', 'BGP') + if constr_type_e in constr_types: + self.__constr_type_e = constr_type_e + else: + raise Exception('Invalid constr_type_e value. Possible values are:\n\n' \ + + ',\n'.join(constr_types) + '.\n\nYou have: ' + constr_type_e + '.\n\nExiting.') + + # initial x + @lbx_0.setter + def lbx_0(self, lbx_0): + if type(lbx_0) == np.ndarray: + self.__lbx_0 = lbx_0 + else: + raise Exception('Invalid lbx_0 value. Exiting.') + + @ubx_0.setter + def ubx_0(self, ubx_0): + if type(ubx_0) == np.ndarray: + self.__ubx_0 = ubx_0 + else: + raise Exception('Invalid ubx_0 value. Exiting.') + + @idxbx_0.setter + def idxbx_0(self, idxbx_0): + if isinstance(idxbx_0, np.ndarray): + self.__idxbx_0 = idxbx_0 + else: + raise Exception('Invalid idxbx_0 value. Exiting.') + + @Jbx_0.setter + def Jbx_0(self, Jbx_0): + if type(Jbx_0) == np.ndarray: + self.__idxbx_0 = J_to_idx(Jbx_0) + else: + raise Exception('Invalid Jbx_0 value. Exiting.') + + @idxbxe_0.setter + def idxbxe_0(self, idxbxe_0): + if isinstance(idxbxe_0, np.ndarray): + self.__idxbxe_0 = idxbxe_0 + else: + raise Exception('Invalid idxbxe_0 value. Exiting.') + + + @x0.setter + def x0(self, x0): + if isinstance(x0, np.ndarray): + self.__lbx_0 = x0 + self.__ubx_0 = x0 + self.__idxbx_0 = np.arange(x0.size) + self.__idxbxe_0 = np.arange(x0.size) + else: + raise Exception('Invalid x0 value. Exiting.') + + # bounds on x + @lbx.setter + def lbx(self, lbx): + if type(lbx) == np.ndarray: + self.__lbx = lbx + else: + raise Exception('Invalid lbx value. Exiting.') + + @ubx.setter + def ubx(self, ubx): + if type(ubx) == np.ndarray: + self.__ubx = ubx + else: + raise Exception('Invalid ubx value. Exiting.') + + @idxbx.setter + def idxbx(self, idxbx): + if type(idxbx) == np.ndarray: + self.__idxbx = idxbx + else: + raise Exception('Invalid idxbx value. Exiting.') + + @Jbx.setter + def Jbx(self, Jbx): + if type(Jbx) == np.ndarray: + self.__idxbx = J_to_idx(Jbx) + else: + raise Exception('Invalid Jbx value. Exiting.') + + # bounds on u + @lbu.setter + def lbu(self, lbu): + if type(lbu) == np.ndarray: + self.__lbu = lbu + else: + raise Exception('Invalid lbu value. Exiting.') + + @ubu.setter + def ubu(self, ubu): + if type(ubu) == np.ndarray: + self.__ubu = ubu + else: + raise Exception('Invalid ubu value. Exiting.') + + @idxbu.setter + def idxbu(self, idxbu): + if type(idxbu) == np.ndarray: + self.__idxbu = idxbu + else: + raise Exception('Invalid idxbu value. Exiting.') + + @Jbu.setter + def Jbu(self, Jbu): + if type(Jbu) == np.ndarray: + self.__idxbu = J_to_idx(Jbu) + else: + raise Exception('Invalid Jbu value. Exiting.') + + # bounds on x at shooting node N + @lbx_e.setter + def lbx_e(self, lbx_e): + if type(lbx_e) == np.ndarray: + self.__lbx_e = lbx_e + else: + raise Exception('Invalid lbx_e value. Exiting.') + + @ubx_e.setter + def ubx_e(self, ubx_e): + if type(ubx_e) == np.ndarray: + self.__ubx_e = ubx_e + else: + raise Exception('Invalid ubx_e value. Exiting.') + + @idxbx_e.setter + def idxbx_e(self, idxbx_e): + if type(idxbx_e) == np.ndarray: + self.__idxbx_e = idxbx_e + else: + raise Exception('Invalid idxbx_e value. Exiting.') + + @Jbx_e.setter + def Jbx_e(self, Jbx_e): + if type(Jbx_e) == np.ndarray: + self.__idxbx_e = J_to_idx(Jbx_e) + else: + raise Exception('Invalid Jbx_e value. Exiting.') + + # polytopic constraints + @D.setter + def D(self, D): + if isinstance(D, np.ndarray) and len(D.shape) == 2: + self.__D = D + else: + raise Exception('Invalid constraint D value.' \ + + 'Should be 2 dimensional numpy array. Exiting.') + + @C.setter + def C(self, C): + if isinstance(C, np.ndarray) and len(C.shape) == 2: + self.__C = C + else: + raise Exception('Invalid constraint C value.' \ + + 'Should be 2 dimensional numpy array. Exiting.') + + @lg.setter + def lg(self, lg): + if type(lg) == np.ndarray: + self.__lg = lg + else: + raise Exception('Invalid lg value. Exiting.') + + @ug.setter + def ug(self, ug): + if type(ug) == np.ndarray: + self.__ug = ug + else: + raise Exception('Invalid ug value. Exiting.') + + # polytopic constraints at shooting node N + @C_e.setter + def C_e(self, C_e): + if isinstance(C_e, np.ndarray) and len(C_e.shape) == 2: + self.__C_e = C_e + else: + raise Exception('Invalid constraint C_e value.' \ + + 'Should be 2 dimensional numpy array. Exiting.') + + @lg_e.setter + def lg_e(self, lg_e): + if type(lg_e) == np.ndarray: + self.__lg_e = lg_e + else: + raise Exception('Invalid lg_e value. Exiting.') + + @ug_e.setter + def ug_e(self, ug_e): + if type(ug_e) == np.ndarray: + self.__ug_e = ug_e + else: + raise Exception('Invalid ug_e value. Exiting.') + + # nonlinear constraints + @lh.setter + def lh(self, lh): + if type(lh) == np.ndarray: + self.__lh = lh + else: + raise Exception('Invalid lh value. Exiting.') + + @uh.setter + def uh(self, uh): + if type(uh) == np.ndarray: + self.__uh = uh + else: + raise Exception('Invalid uh value. Exiting.') + + # convex-over-nonlinear constraints + @lphi.setter + def lphi(self, lphi): + if type(lphi) == np.ndarray: + self.__lphi = lphi + else: + raise Exception('Invalid lphi value. Exiting.') + + @uphi.setter + def uphi(self, uphi): + if type(uphi) == np.ndarray: + self.__uphi = uphi + else: + raise Exception('Invalid uphi value. Exiting.') + + # nonlinear constraints at shooting node N + @lh_e.setter + def lh_e(self, lh_e): + if type(lh_e) == np.ndarray: + self.__lh_e = lh_e + else: + raise Exception('Invalid lh_e value. Exiting.') + + @uh_e.setter + def uh_e(self, uh_e): + if type(uh_e) == np.ndarray: + self.__uh_e = uh_e + else: + raise Exception('Invalid uh_e value. Exiting.') + + # convex-over-nonlinear constraints at shooting node N + @lphi_e.setter + def lphi_e(self, lphi_e): + if type(lphi_e) == np.ndarray: + self.__lphi_e = lphi_e + else: + raise Exception('Invalid lphi_e value. Exiting.') + + @uphi_e.setter + def uphi_e(self, uphi_e): + if type(uphi_e) == np.ndarray: + self.__uphi_e = uphi_e + else: + raise Exception('Invalid uphi_e value. Exiting.') + + # SLACK bounds + # soft bounds on x + @lsbx.setter + def lsbx(self, lsbx): + if type(lsbx) == np.ndarray: + self.__lsbx = lsbx + else: + raise Exception('Invalid lsbx value. Exiting.') + + @usbx.setter + def usbx(self, usbx): + if type(usbx) == np.ndarray: + self.__usbx = usbx + else: + raise Exception('Invalid usbx value. Exiting.') + + @idxsbx.setter + def idxsbx(self, idxsbx): + if type(idxsbx) == np.ndarray: + self.__idxsbx = idxsbx + else: + raise Exception('Invalid idxsbx value. Exiting.') + + @Jsbx.setter + def Jsbx(self, Jsbx): + if isinstance(Jsbx, np.ndarray): + self.__idxsbx = J_to_idx_slack(Jsbx) + else: + raise Exception('Invalid Jsbx value, expected numpy array. Exiting.') + + # soft bounds on u + @lsbu.setter + def lsbu(self, lsbu): + if type(lsbu) == np.ndarray: + self.__lsbu = lsbu + else: + raise Exception('Invalid lsbu value. Exiting.') + + @usbu.setter + def usbu(self, usbu): + if type(usbu) == np.ndarray: + self.__usbu = usbu + else: + raise Exception('Invalid usbu value. Exiting.') + + @idxsbu.setter + def idxsbu(self, idxsbu): + if type(idxsbu) == np.ndarray: + self.__idxsbu = idxsbu + else: + raise Exception('Invalid idxsbu value. Exiting.') + + @Jsbu.setter + def Jsbu(self, Jsbu): + if type(Jsbu) == np.ndarray: + self.__idxsbu = J_to_idx_slack(Jsbu) + else: + raise Exception('Invalid Jsbu value. Exiting.') + + # soft bounds on x at shooting node N + @lsbx_e.setter + def lsbx_e(self, lsbx_e): + if type(lsbx_e) == np.ndarray: + self.__lsbx_e = lsbx_e + else: + raise Exception('Invalid lsbx_e value. Exiting.') + + @usbx_e.setter + def usbx_e(self, usbx_e): + if type(usbx_e) == np.ndarray: + self.__usbx_e = usbx_e + else: + raise Exception('Invalid usbx_e value. Exiting.') + + @idxsbx_e.setter + def idxsbx_e(self, idxsbx_e): + if type(idxsbx_e) == np.ndarray: + self.__idxsbx_e = idxsbx_e + else: + raise Exception('Invalid idxsbx_e value. Exiting.') + + @Jsbx_e.setter + def Jsbx_e(self, Jsbx_e): + if type(Jsbx_e) == np.ndarray: + self.__idxsbx_e = J_to_idx_slack(Jsbx_e) + else: + raise Exception('Invalid Jsbx_e value. Exiting.') + + + # soft bounds on general linear constraints + @lsg.setter + def lsg(self, lsg): + if isinstance(lsg, np.ndarray): + self.__lsg = lsg + else: + raise Exception('Invalid lsg value. Exiting.') + + @usg.setter + def usg(self, usg): + if isinstance(usg, np.ndarray): + self.__usg = usg + else: + raise Exception('Invalid usg value. Exiting.') + + @idxsg.setter + def idxsg(self, idxsg): + if isinstance(idxsg, np.ndarray): + self.__idxsg = idxsg + else: + raise Exception('Invalid idxsg value. Exiting.') + + @Jsg.setter + def Jsg(self, Jsg): + if isinstance(Jsg, np.ndarray): + self.__idxsg = J_to_idx_slack(Jsg) + else: + raise Exception('Invalid Jsg value, expected numpy array. Exiting.') + + + # soft bounds on nonlinear constraints + @lsh.setter + def lsh(self, lsh): + if type(lsh) == np.ndarray: + self.__lsh = lsh + else: + raise Exception('Invalid lsh value. Exiting.') + + @ush.setter + def ush(self, ush): + if type(ush) == np.ndarray: + self.__ush = ush + else: + raise Exception('Invalid ush value. Exiting.') + + @idxsh.setter + def idxsh(self, idxsh): + if type(idxsh) == np.ndarray: + self.__idxsh = idxsh + else: + raise Exception('Invalid idxsh value. Exiting.') + + + @Jsh.setter + def Jsh(self, Jsh): + if isinstance(Jsh, np.ndarray): + self.__idxsh = J_to_idx_slack(Jsh) + else: + raise Exception('Invalid Jsh value, expected numpy array. Exiting.') + + # soft bounds on convex-over-nonlinear constraints + @lsphi.setter + def lsphi(self, lsphi): + if type(lsphi) == np.ndarray: + self.__lsphi = lsphi + else: + raise Exception('Invalid lsphi value. Exiting.') + + @usphi.setter + def usphi(self, usphi): + if type(usphi) == np.ndarray: + self.__usphi = usphi + else: + raise Exception('Invalid usphi value. Exiting.') + + @idxsphi.setter + def idxsphi(self, idxsphi): + if type(idxsphi) == np.ndarray: + self.__idxsphi = idxsphi + else: + raise Exception('Invalid idxsphi value. Exiting.') + + @Jsphi.setter + def Jsphi(self, Jsphi): + if isinstance(Jsphi, np.ndarray): + self.__idxsphi = J_to_idx_slack(Jsphi) + else: + raise Exception('Invalid Jsphi value, expected numpy array. Exiting.') + + # soft bounds on general linear constraints at shooting node N + @lsg_e.setter + def lsg_e(self, lsg_e): + if isinstance(lsg_e, np.ndarray): + self.__lsg_e = lsg_e + else: + raise Exception('Invalid lsg_e value. Exiting.') + + @usg_e.setter + def usg_e(self, usg_e): + if isinstance(usg_e, np.ndarray): + self.__usg_e = usg_e + else: + raise Exception('Invalid usg_e value. Exiting.') + + @idxsg_e.setter + def idxsg_e(self, idxsg_e): + if isinstance(idxsg_e, np.ndarray): + self.__idxsg_e = idxsg_e + else: + raise Exception('Invalid idxsg_e value. Exiting.') + + @Jsg_e.setter + def Jsg_e(self, Jsg_e): + if isinstance(Jsg_e, np.ndarray): + self.__idxsg_e = J_to_idx_slack(Jsg_e) + else: + raise Exception('Invalid Jsg_e value, expected numpy array. Exiting.') + + # soft bounds on nonlinear constraints at shooting node N + @lsh_e.setter + def lsh_e(self, lsh_e): + if isinstance(lsh_e, np.ndarray): + self.__lsh_e = lsh_e + else: + raise Exception('Invalid lsh_e value. Exiting.') + + @ush_e.setter + def ush_e(self, ush_e): + if isinstance(ush_e, np.ndarray): + self.__ush_e = ush_e + else: + raise Exception('Invalid ush_e value. Exiting.') + + @idxsh_e.setter + def idxsh_e(self, idxsh_e): + if isinstance(idxsh_e, np.ndarray): + self.__idxsh_e = idxsh_e + else: + raise Exception('Invalid idxsh_e value. Exiting.') + + @Jsh_e.setter + def Jsh_e(self, Jsh_e): + if isinstance(Jsh_e, np.ndarray): + self.__idxsh_e = J_to_idx_slack(Jsh_e) + else: + raise Exception('Invalid Jsh_e value, expected numpy array. Exiting.') + + + # soft bounds on convex-over-nonlinear constraints at shooting node N + @lsphi_e.setter + def lsphi_e(self, lsphi_e): + if isinstance(lsphi_e, np.ndarray): + self.__lsphi_e = lsphi_e + else: + raise Exception('Invalid lsphi_e value. Exiting.') + + @usphi_e.setter + def usphi_e(self, usphi_e): + if isinstance(usphi_e, np.ndarray): + self.__usphi_e = usphi_e + else: + raise Exception('Invalid usphi_e value. Exiting.') + + @idxsphi_e.setter + def idxsphi_e(self, idxsphi_e): + if isinstance(idxsphi_e, np.ndarray): + self.__idxsphi_e = idxsphi_e + else: + raise Exception('Invalid idxsphi_e value. Exiting.') + + @Jsphi_e.setter + def Jsphi_e(self, Jsphi_e): + if isinstance(Jsphi_e, np.ndarray): + self.__idxsphi_e = J_to_idx_slack(Jsphi_e) + else: + raise Exception('Invalid Jsphi_e value. Exiting.') + + def set(self, attr, value): + setattr(self, attr, value) + + +class AcadosOcpOptions: + """ + class containing the description of the solver options + """ + def __init__(self): + self.__qp_solver = 'PARTIAL_CONDENSING_HPIPM' # qp solver to be used in the NLP solver + self.__hessian_approx = 'GAUSS_NEWTON' # hessian approximation + self.__integrator_type = 'ERK' # integrator type + self.__tf = None # prediction horizon + self.__nlp_solver_type = 'SQP_RTI' # NLP solver + self.__globalization = 'FIXED_STEP' + self.__nlp_solver_step_length = 1.0 # fixed Newton step length + self.__levenberg_marquardt = 0.0 + self.__collocation_type = 'GAUSS_LEGENDRE' + self.__sim_method_num_stages = 4 # number of stages in the integrator + self.__sim_method_num_steps = 1 # number of steps in the integrator + self.__sim_method_newton_iter = 3 # number of Newton iterations in simulation method + self.__sim_method_jac_reuse = 0 + self.__qp_solver_tol_stat = None # QP solver stationarity tolerance + self.__qp_solver_tol_eq = None # QP solver equality tolerance + self.__qp_solver_tol_ineq = None # QP solver inequality + self.__qp_solver_tol_comp = None # QP solver complementarity + self.__qp_solver_iter_max = 50 # QP solver max iter + self.__qp_solver_cond_N = None # QP solver: new horizon after partial condensing + self.__qp_solver_warm_start = 0 + self.__nlp_solver_tol_stat = 1e-6 # NLP solver stationarity tolerance + self.__nlp_solver_tol_eq = 1e-6 # NLP solver equality tolerance + self.__nlp_solver_tol_ineq = 1e-6 # NLP solver inequality + self.__nlp_solver_tol_comp = 1e-6 # NLP solver complementarity + self.__nlp_solver_max_iter = 100 # NLP solver maximum number of iterations + self.__Tsim = None # automatically calculated as tf/N + self.__print_level = 0 # print level + self.__initialize_t_slacks = 0 # possible values: 0, 1 + self.__model_external_shared_lib_dir = None # path to the the .so lib + self.__model_external_shared_lib_name = None # name of the the .so lib + self.__regularize_method = None + self.__time_steps = None + self.__shooting_nodes = None + self.__exact_hess_cost = 1 + self.__exact_hess_dyn = 1 + self.__exact_hess_constr = 1 + self.__ext_cost_num_hess = 0 + self.__alpha_min = 0.05 + self.__alpha_reduction = 0.7 + + + @property + def qp_solver(self): + """QP solver to be used in the NLP solver. + String in ('PARTIAL_CONDENSING_HPIPM', 'FULL_CONDENSING_QPOASES', 'FULL_CONDENSING_HPIPM', 'PARTIAL_CONDENSING_QPDUNES', 'PARTIAL_CONDENSING_OSQP'). + Default: 'PARTIAL_CONDENSING_HPIPM'. + """ + return self.__qp_solver + + @property + def hessian_approx(self): + """Hessian approximation. + String in ('GAUSS_NEWTON', 'EXACT'). + Default: 'GAUSS_NEWTON'. + """ + return self.__hessian_approx + + @property + def integrator_type(self): + """ + Integrator type. + String in ('ERK', 'IRK', 'GNSF', 'DISCRETE', 'LIFTED_IRK'). + Default: 'ERK'. + """ + return self.__integrator_type + + @property + def nlp_solver_type(self): + """NLP solver. + String in ('SQP', 'SQP_RTI'). + Default: 'SQP_RTI'. + """ + return self.__nlp_solver_type + + @property + def globalization(self): + """Globalization type. + String in ('FIXED_STEP', 'MERIT_BACKTRACKING'). + Default: 'FIXED_STEP'. + + .. note:: preliminary implementation. + """ + return self.__globalization + + @property + def collocation_type(self): + """Collocation type: relevant for implicit integrators + -- string in {GAUSS_RADAU_IIA, GAUSS_LEGENDRE}. + + Default: GAUSS_LEGENDRE + """ + return self.__collocation_type + + @property + def regularize_method(self): + """Regularization method for the Hessian. + String in ('NO_REGULARIZE', 'MIRROR', 'PROJECT', 'PROJECT_REDUC_HESS', 'CONVEXIFY') or :code:`None`. + + Default: :code:`None`. + """ + return self.__regularize_method + + @property + def nlp_solver_step_length(self): + """ + Fixed Newton step length. + Type: float > 0. + Default: 1.0. + """ + return self.__nlp_solver_step_length + + @property + def levenberg_marquardt(self): + """ + Factor for LM regularization. + Type: float >= 0 + Default: 0.0. + """ + return self.__levenberg_marquardt + + @property + def sim_method_num_stages(self): + """ + Number of stages in the integrator. + Type: int > 0 or ndarray of ints > 0 of shape (N,). + Default: 4 + """ + return self.__sim_method_num_stages + + @property + def sim_method_num_steps(self): + """ + Number of steps in the integrator. + Type: int > 0 or ndarray of ints > 0 of shape (N,). + Default: 1 + """ + return self.__sim_method_num_steps + + @property + def sim_method_newton_iter(self): + """ + Number of Newton iterations in simulation method. + Type: int > 0 + Default: 3 + """ + return self.__sim_method_newton_iter + + @property + def sim_method_jac_reuse(self): + """ + Integer determining if jacobians are reused within integrator or ndarray of ints > 0 of shape (N,). + 0: False (no reuse); 1: True (reuse) + Default: 0 + """ + return self.__sim_method_jac_reuse + + @property + def qp_solver_tol_stat(self): + """ + QP solver stationarity tolerance. + Default: :code:`None` + """ + return self.__qp_solver_tol_stat + + @property + def qp_solver_tol_eq(self): + """ + QP solver equality tolerance. + Default: :code:`None` + """ + return self.__qp_solver_tol_eq + + @property + def qp_solver_tol_ineq(self): + """ + QP solver inequality. + Default: :code:`None` + """ + return self.__qp_solver_tol_ineq + + @property + def qp_solver_tol_comp(self): + """ + QP solver complementarity. + Default: :code:`None` + """ + return self.__qp_solver_tol_comp + + @property + def qp_solver_cond_N(self): + """QP solver: New horizon after partial condensing. + Set to N by default -> no condensing.""" + return self.__qp_solver_cond_N + + @property + def qp_solver_warm_start(self): + """QP solver: Warm starting. + 0: no warm start; 1: warm start; 2: hot start.""" + return self.__qp_solver_warm_start + + @property + def qp_solver_iter_max(self): + """ + QP solver: maximum number of iterations. + Type: int > 0 + Default: 50 + """ + return self.__qp_solver_iter_max + + @property + def tol(self): + """ + NLP solver tolerance. Sets or gets the max of :py:attr:`nlp_solver_tol_eq`, + :py:attr:`nlp_solver_tol_ineq`, :py:attr:`nlp_solver_tol_comp` + and :py:attr:`nlp_solver_tol_stat`. + """ + return max([self.__nlp_solver_tol_eq, self.__nlp_solver_tol_ineq,\ + self.__nlp_solver_tol_comp, self.__nlp_solver_tol_stat]) + + @property + def qp_tol(self): + """ + QP solver tolerance. + Sets all of the following at once or gets the max of + :py:attr:`qp_solver_tol_eq`, :py:attr:`qp_solver_tol_ineq`, + :py:attr:`qp_solver_tol_comp` and + :py:attr:`qp_solver_tol_stat`. + """ + return max([self.__qp_solver_tol_eq, self.__qp_solver_tol_ineq,\ + self.__qp_solver_tol_comp, self.__qp_solver_tol_stat]) + + @property + def nlp_solver_tol_stat(self): + """ + NLP solver stationarity tolerance. + Type: float > 0 + Default: 1e-6 + """ + return self.__nlp_solver_tol_stat + + @property + def nlp_solver_tol_eq(self): + """NLP solver equality tolerance""" + return self.__nlp_solver_tol_eq + + @property + def alpha_min(self): + """Minimal step size for globalization MERIT_BACKTRACKING, default: 0.05.""" + return self.__alpha_min + + @property + def alpha_reduction(self): + """Step size reduction factor for globalization MERIT_BACKTRACKING, default: 0.7.""" + return self.__alpha_reduction + + @property + def nlp_solver_tol_ineq(self): + """NLP solver inequality tolerance""" + return self.__nlp_solver_tol_ineq + + @property + def nlp_solver_tol_comp(self): + """NLP solver complementarity tolerance""" + return self.__nlp_solver_tol_comp + + @property + def nlp_solver_max_iter(self): + """ + NLP solver maximum number of iterations. + Type: int > 0 + Default: 100 + """ + return self.__nlp_solver_max_iter + + @property + def time_steps(self): + """ + Vector with time steps between the shooting nodes. Set automatically to uniform discretization if :py:attr:`N` and :py:attr:`tf` are provided. + Default: :code:`None` + """ + return self.__time_steps + + @property + def shooting_nodes(self): + """ + Vector with the shooting nodes, time_steps will be computed from it automatically. + Default: :code:`None` + """ + return self.__shooting_nodes + + @property + def tf(self): + """ + Prediction horizon + Type: float > 0 + Default: :code:`None` + """ + return self.__tf + + @property + def Tsim(self): + """ + Time horizon for one integrator step. Automatically calculated as :py:attr:`tf`/:py:attr:`N`. + Default: :code:`None` + """ + return self.__Tsim + + @property + def print_level(self): + """ + Verbosity of printing. + Type: int >= 0 + Default: 0 + """ + return self.__print_level + + @property + def model_external_shared_lib_dir(self): + """Path to the .so lib""" + return self.__model_external_shared_lib_dir + + @property + def model_external_shared_lib_name(self): + """Name of the .so lib""" + return self.__model_external_shared_lib_name + + @property + def exact_hess_constr(self): + """ + Used in case of hessian_approx == 'EXACT'.\n + Can be used to turn off exact hessian contributions from the constraints module. + """ + return self.__exact_hess_constr + + @property + def exact_hess_cost(self): + """ + Used in case of hessian_approx == 'EXACT'.\n + Can be used to turn off exact hessian contributions from the cost module. + """ + return self.__exact_hess_cost + + @property + def exact_hess_dyn(self): + """ + Used in case of hessian_approx == 'EXACT'.\n + Can be used to turn off exact hessian contributions from the dynamics module. + """ + return self.__exact_hess_dyn + + @property + def ext_cost_num_hess(self): + """ + Determines if custom hessian approximation for cost contribution is used (> 0).\n + Or if hessian contribution is evaluated exactly using CasADi external function (=0 - default). + """ + return self.__ext_cost_num_hess + + @qp_solver.setter + def qp_solver(self, qp_solver): + qp_solvers = ('PARTIAL_CONDENSING_HPIPM', \ + 'FULL_CONDENSING_QPOASES', 'FULL_CONDENSING_HPIPM', \ + 'PARTIAL_CONDENSING_QPDUNES', 'PARTIAL_CONDENSING_OSQP') + if qp_solver in qp_solvers: + self.__qp_solver = qp_solver + else: + raise Exception('Invalid qp_solver value. Possible values are:\n\n' \ + + ',\n'.join(qp_solvers) + '.\n\nYou have: ' + qp_solver + '.\n\nExiting.') + + @regularize_method.setter + def regularize_method(self, regularize_method): + regularize_methods = ('NO_REGULARIZE', 'MIRROR', 'PROJECT', \ + 'PROJECT_REDUC_HESS', 'CONVEXIFY') + if regularize_method in regularize_methods: + self.__regularize_method = regularize_method + else: + raise Exception('Invalid regularize_method value. Possible values are:\n\n' \ + + ',\n'.join(regularize_methods) + '.\n\nYou have: ' + regularize_method + '.\n\nExiting.') + + @collocation_type.setter + def collocation_type(self, collocation_type): + collocation_types = ('GAUSS_RADAU_IIA', 'GAUSS_LEGENDRE') + if collocation_type in collocation_types: + self.__collocation_type = collocation_type + else: + raise Exception('Invalid collocation_type value. Possible values are:\n\n' \ + + ',\n'.join(collocation_types) + '.\n\nYou have: ' + collocation_type + '.\n\nExiting.') + + @hessian_approx.setter + def hessian_approx(self, hessian_approx): + hessian_approxs = ('GAUSS_NEWTON', 'EXACT') + if hessian_approx in hessian_approxs: + self.__hessian_approx = hessian_approx + else: + raise Exception('Invalid hessian_approx value. Possible values are:\n\n' \ + + ',\n'.join(hessian_approxs) + '.\n\nYou have: ' + hessian_approx + '.\n\nExiting.') + + @integrator_type.setter + def integrator_type(self, integrator_type): + integrator_types = ('ERK', 'IRK', 'GNSF', 'DISCRETE', 'LIFTED_IRK') + if integrator_type in integrator_types: + self.__integrator_type = integrator_type + else: + raise Exception('Invalid integrator_type value. Possible values are:\n\n' \ + + ',\n'.join(integrator_types) + '.\n\nYou have: ' + integrator_type + '.\n\nExiting.') + + @tf.setter + def tf(self, tf): + self.__tf = tf + + @time_steps.setter + def time_steps(self, time_steps): + self.__time_steps = time_steps + + @shooting_nodes.setter + def shooting_nodes(self, shooting_nodes): + self.__shooting_nodes = shooting_nodes + + + @Tsim.setter + def Tsim(self, Tsim): + self.__Tsim = Tsim + + @globalization.setter + def globalization(self, globalization): + self.__globalization = globalization + + @alpha_min.setter + def alpha_min(self, alpha_min): + self.__alpha_min = alpha_min + + @alpha_reduction.setter + def alpha_reduction(self, alpha_reduction): + self.__alpha_reduction = alpha_reduction + + @sim_method_num_stages.setter + def sim_method_num_stages(self, sim_method_num_stages): + + # if type(sim_method_num_stages) == int: + # self.__sim_method_num_stages = sim_method_num_stages + # else: + # raise Exception('Invalid sim_method_num_stages value. sim_method_num_stages must be an integer. Exiting.') + + self.__sim_method_num_stages = sim_method_num_stages + + @sim_method_num_steps.setter + def sim_method_num_steps(self, sim_method_num_steps): + + # if type(sim_method_num_steps) == int: + # self.__sim_method_num_steps = sim_method_num_steps + # else: + # raise Exception('Invalid sim_method_num_steps value. sim_method_num_steps must be an integer. Exiting.') + self.__sim_method_num_steps = sim_method_num_steps + + + @sim_method_newton_iter.setter + def sim_method_newton_iter(self, sim_method_newton_iter): + + if type(sim_method_newton_iter) == int: + self.__sim_method_newton_iter = sim_method_newton_iter + else: + raise Exception('Invalid sim_method_newton_iter value. sim_method_newton_iter must be an integer. Exiting.') + + @sim_method_jac_reuse.setter + def sim_method_jac_reuse(self, sim_method_jac_reuse): + # if sim_method_jac_reuse in (True, False): + self.__sim_method_jac_reuse = sim_method_jac_reuse + # else: + # raise Exception('Invalid sim_method_jac_reuse value. sim_method_jac_reuse must be a Boolean.') + + @nlp_solver_type.setter + def nlp_solver_type(self, nlp_solver_type): + nlp_solver_types = ('SQP', 'SQP_RTI') + if nlp_solver_type in nlp_solver_types: + self.__nlp_solver_type = nlp_solver_type + else: + raise Exception('Invalid nlp_solver_type value. Possible values are:\n\n' \ + + ',\n'.join(nlp_solver_types) + '.\n\nYou have: ' + nlp_solver_type + '.\n\nExiting.') + + @nlp_solver_step_length.setter + def nlp_solver_step_length(self, nlp_solver_step_length): + if type(nlp_solver_step_length) == float and nlp_solver_step_length > 0: + self.__nlp_solver_step_length = nlp_solver_step_length + else: + raise Exception('Invalid nlp_solver_step_length value. nlp_solver_step_length must be a positive float. Exiting') + + @levenberg_marquardt.setter + def levenberg_marquardt(self, levenberg_marquardt): + if isinstance(levenberg_marquardt, float) and levenberg_marquardt >= 0: + self.__levenberg_marquardt = levenberg_marquardt + else: + raise Exception('Invalid levenberg_marquardt value. levenberg_marquardt must be a positive float. Exiting') + + @qp_solver_iter_max.setter + def qp_solver_iter_max(self, qp_solver_iter_max): + if isinstance(qp_solver_iter_max, int) and qp_solver_iter_max > 0: + self.__qp_solver_iter_max = qp_solver_iter_max + else: + raise Exception('Invalid qp_solver_iter_max value. qp_solver_iter_max must be a positive int. Exiting') + + @qp_solver_cond_N.setter + def qp_solver_cond_N(self, qp_solver_cond_N): + if isinstance(qp_solver_cond_N, int) and qp_solver_cond_N > 0: + self.__qp_solver_cond_N = qp_solver_cond_N + else: + raise Exception('Invalid qp_solver_cond_N value. qp_solver_cond_N must be a positive int. Exiting') + + @qp_solver_warm_start.setter + def qp_solver_warm_start(self, qp_solver_warm_start): + if qp_solver_warm_start in [0, 1, 2]: + self.__qp_solver_warm_start = qp_solver_warm_start + else: + raise Exception('Invalid qp_solver_warm_start value. qp_solver_warm_start must be 0 or 1 or 2. Exiting') + + @qp_tol.setter + def qp_tol(self, qp_tol): + if isinstance(qp_tol, float) and qp_tol > 0: + self.__qp_solver_tol_eq = qp_tol + self.__qp_solver_tol_ineq = qp_tol + self.__qp_solver_tol_stat = qp_tol + self.__qp_solver_tol_comp = qp_tol + else: + raise Exception('Invalid qp_tol value. qp_tol must be a positive float. Exiting') + + @qp_solver_tol_stat.setter + def qp_solver_tol_stat(self, qp_solver_tol_stat): + if isinstance(qp_solver_tol_stat, float) and qp_solver_tol_stat > 0: + self.__qp_solver_tol_stat = qp_solver_tol_stat + else: + raise Exception('Invalid qp_solver_tol_stat value. qp_solver_tol_stat must be a positive float. Exiting') + + @qp_solver_tol_eq.setter + def qp_solver_tol_eq(self, qp_solver_tol_eq): + if isinstance(qp_solver_tol_eq, float) and qp_solver_tol_eq > 0: + self.__qp_solver_tol_eq = qp_solver_tol_eq + else: + raise Exception('Invalid qp_solver_tol_eq value. qp_solver_tol_eq must be a positive float. Exiting') + + @qp_solver_tol_ineq.setter + def qp_solver_tol_ineq(self, qp_solver_tol_ineq): + if isinstance(qp_solver_tol_ineq, float) and qp_solver_tol_ineq > 0: + self.__qp_solver_tol_ineq = qp_solver_tol_ineq + else: + raise Exception('Invalid qp_solver_tol_ineq value. qp_solver_tol_ineq must be a positive float. Exiting') + + @qp_solver_tol_comp.setter + def qp_solver_tol_comp(self, qp_solver_tol_comp): + if isinstance(qp_solver_tol_comp, float) and qp_solver_tol_comp > 0: + self.__qp_solver_tol_comp = qp_solver_tol_comp + else: + raise Exception('Invalid qp_solver_tol_comp value. qp_solver_tol_comp must be a positive float. Exiting') + + @tol.setter + def tol(self, tol): + if isinstance(tol, float) and tol > 0: + self.__nlp_solver_tol_eq = tol + self.__nlp_solver_tol_ineq = tol + self.__nlp_solver_tol_stat = tol + self.__nlp_solver_tol_comp = tol + else: + raise Exception('Invalid tol value. tol must be a positive float. Exiting') + + @nlp_solver_tol_stat.setter + def nlp_solver_tol_stat(self, nlp_solver_tol_stat): + if isinstance(nlp_solver_tol_stat, float) and nlp_solver_tol_stat > 0: + self.__nlp_solver_tol_stat = nlp_solver_tol_stat + else: + raise Exception('Invalid nlp_solver_tol_stat value. nlp_solver_tol_stat must be a positive float. Exiting') + + @nlp_solver_tol_eq.setter + def nlp_solver_tol_eq(self, nlp_solver_tol_eq): + if isinstance(nlp_solver_tol_eq, float) and nlp_solver_tol_eq > 0: + self.__nlp_solver_tol_eq = nlp_solver_tol_eq + else: + raise Exception('Invalid nlp_solver_tol_eq value. nlp_solver_tol_eq must be a positive float. Exiting') + + @nlp_solver_tol_ineq.setter + def nlp_solver_tol_ineq(self, nlp_solver_tol_ineq): + if isinstance(nlp_solver_tol_ineq, float) and nlp_solver_tol_ineq > 0: + self.__nlp_solver_tol_ineq = nlp_solver_tol_ineq + else: + raise Exception('Invalid nlp_solver_tol_ineq value. nlp_solver_tol_ineq must be a positive float. Exiting') + + @nlp_solver_tol_comp.setter + def nlp_solver_tol_comp(self, nlp_solver_tol_comp): + if isinstance(nlp_solver_tol_comp, float) and nlp_solver_tol_comp > 0: + self.__nlp_solver_tol_comp = nlp_solver_tol_comp + else: + raise Exception('Invalid nlp_solver_tol_comp value. nlp_solver_tol_comp must be a positive float. Exiting') + + @nlp_solver_max_iter.setter + def nlp_solver_max_iter(self, nlp_solver_max_iter): + + if type(nlp_solver_max_iter) == int and nlp_solver_max_iter > 0: + self.__nlp_solver_max_iter = nlp_solver_max_iter + else: + raise Exception('Invalid nlp_solver_max_iter value. nlp_solver_max_iter must be a positive int. Exiting') + + @print_level.setter + def print_level(self, print_level): + if type(print_level) == int and print_level >= 0: + self.__print_level = print_level + else: + raise Exception('Invalid print_level value. print_level takes one of the values >=0. Exiting') + + @model_external_shared_lib_dir.setter + def model_external_shared_lib_dir(self, model_external_shared_lib_dir): + if type(model_external_shared_lib_dir) == str : + self.__model_external_shared_lib_dir = model_external_shared_lib_dir + else: + raise Exception('Invalid model_external_shared_lib_dir value. Str expected.' \ + + '.\n\nYou have: ' + type(model_external_shared_lib_dir) + '.\n\nExiting.') + + @model_external_shared_lib_name.setter + def model_external_shared_lib_name(self, model_external_shared_lib_name): + if type(model_external_shared_lib_name) == str : + if model_external_shared_lib_name[-3:] == '.so' : + raise Exception('Invalid model_external_shared_lib_name value. Remove the .so extension.' \ + + '.\n\nYou have: ' + type(model_external_shared_lib_name) + '.\n\nExiting.') + else : + self.__model_external_shared_lib_name = model_external_shared_lib_name + else: + raise Exception('Invalid model_external_shared_lib_name value. Str expected.' \ + + '.\n\nYou have: ' + type(model_external_shared_lib_name) + '.\n\nExiting.') + + @exact_hess_constr.setter + def exact_hess_constr(self, exact_hess_constr): + if exact_hess_constr in [0, 1]: + self.__exact_hess_constr = exact_hess_constr + else: + raise Exception('Invalid exact_hess_constr value. exact_hess_constr takes one of the values 0, 1. Exiting') + + @exact_hess_cost.setter + def exact_hess_cost(self, exact_hess_cost): + if exact_hess_cost in [0, 1]: + self.__exact_hess_cost = exact_hess_cost + else: + raise Exception('Invalid exact_hess_cost value. exact_hess_cost takes one of the values 0, 1. Exiting') + + @exact_hess_dyn.setter + def exact_hess_dyn(self, exact_hess_dyn): + if exact_hess_dyn in [0, 1]: + self.__exact_hess_dyn = exact_hess_dyn + else: + raise Exception('Invalid exact_hess_dyn value. exact_hess_dyn takes one of the values 0, 1. Exiting') + + @ext_cost_num_hess.setter + def ext_cost_num_hess(self, ext_cost_num_hess): + if ext_cost_num_hess in [0, 1]: + self.__ext_cost_num_hess = ext_cost_num_hess + else: + raise Exception('Invalid ext_cost_num_hess value. ext_cost_num_hess takes one of the values 0, 1. Exiting') + + def set(self, attr, value): + setattr(self, attr, value) + + +class AcadosOcp: + """ + Class containing the full description of the optimal control problem. + This object can be used to create an :py:class:`acados_template.acados_ocp_solver.AcadosOcpSolver`. + + The class has the following properties that can be modified to formulate a specific OCP, see below: + + - :py:attr:`dims` of type :py:class:`acados_template.acados_ocp.AcadosOcpDims` + - :py:attr:`model` of type :py:class:`acados_template.acados_model.AcadosModel` + - :py:attr:`cost` of type :py:class:`acados_template.acados_ocp.AcadosOcpCost` + - :py:attr:`constraints` of type :py:class:`acados_template.acados_ocp.AcadosOcpConstraints` + - :py:attr:`solver_options` of type :py:class:`acados_template.acados_ocp.AcadosOcpOptions` + + - :py:attr:`acados_include_path` (set automatically) + - :py:attr:`acados_lib_path` (set automatically) + - :py:attr:`parameter_values` - used to initialize the parameters (can be changed) + """ + def __init__(self, acados_path=''): + """ + Keyword arguments: + acados_path -- path of your acados installation + """ + if acados_path == '': + acados_path = get_acados_path() + + self.dims = AcadosOcpDims() + """Dimension definitions, type :py:class:`acados_template.acados_ocp.AcadosOcpDims`""" + self.model = AcadosModel() + """Model definitions, type :py:class:`acados_template.acados_model.AcadosModel`""" + self.cost = AcadosOcpCost() + """Cost definitions, type :py:class:`acados_template.acados_ocp.AcadosOcpCost`""" + self.constraints = AcadosOcpConstraints() + """Constraints definitions, type :py:class:`acados_template.acados_ocp.AcadosOcpConstraints`""" + self.solver_options = AcadosOcpOptions() + """Solver Options, type :py:class:`acados_template.acados_ocp.AcadosOcpOptions`""" + + self.acados_include_path = f'{acados_path}/include' + """Path to acados include directory, type: string""" + self.acados_lib_path = f'{acados_path}/lib' + """Path to where acados library is located, type: string""" + + self.__parameter_values = np.array([]) + self.__problem_class = 'OCP' + + self.code_export_directory = 'c_generated_code' + """Path to where code will be exported. Default: `c_generated_code`.""" + + @property + def parameter_values(self): + """:math:`p` - initial values for parameter - can be updated stagewise""" + return self.__parameter_values + + @parameter_values.setter + def parameter_values(self, parameter_values): + if isinstance(parameter_values, np.ndarray): + self.__parameter_values = parameter_values + else: + raise Exception('Invalid parameter_values value. ' + + f'Expected numpy array, got {type(parameter_values)}.') + + def set(self, attr, value): + # tokenize string + tokens = attr.split('_', 1) + if len(tokens) > 1: + setter_to_call = getattr(getattr(self, tokens[0]), 'set') + else: + setter_to_call = getattr(self, 'set') + + setter_to_call(tokens[1], value) + + return diff --git a/pyextra/acados_template/acados_ocp_solver.py b/pyextra/acados_template/acados_ocp_solver.py new file mode 100644 index 000000000..b34b8fa84 --- /dev/null +++ b/pyextra/acados_template/acados_ocp_solver.py @@ -0,0 +1,1562 @@ +# -*- coding: future_fstrings -*- +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + +import sys +import os +import json +import numpy as np +from datetime import datetime +import ctypes +from ctypes import POINTER, cast, CDLL, c_void_p, c_char_p, c_double, c_int, c_int64, byref + +from copy import deepcopy + +from .generate_c_code_explicit_ode import generate_c_code_explicit_ode +from .generate_c_code_implicit_ode import generate_c_code_implicit_ode +from .generate_c_code_gnsf import generate_c_code_gnsf +from .generate_c_code_discrete_dynamics import generate_c_code_discrete_dynamics +from .generate_c_code_constraint import generate_c_code_constraint +from .generate_c_code_nls_cost import generate_c_code_nls_cost +from .generate_c_code_external_cost import generate_c_code_external_cost +from .acados_ocp import AcadosOcp +from .acados_model import acados_model_strip_casadi_symbolics +from .utils import is_column, is_empty, casadi_length, render_template, acados_class2dict,\ + format_class_dict, ocp_check_against_layout, np_array_to_list, make_model_consistent,\ + set_up_imported_gnsf_model, get_acados_path, get_ocp_nlp_layout, get_python_interface_path + + +def make_ocp_dims_consistent(acados_ocp): + dims = acados_ocp.dims + cost = acados_ocp.cost + constraints = acados_ocp.constraints + model = acados_ocp.model + opts = acados_ocp.solver_options + + # nx + if is_column(model.x): + dims.nx = casadi_length(model.x) + else: + raise Exception('model.x should be column vector!') + + # nu + if is_empty(model.u): + dims.nu = 0 + else: + dims.nu = casadi_length(model.u) + + # nz + if is_empty(model.z): + dims.nz = 0 + else: + dims.nz = casadi_length(model.z) + + # np + if is_empty(model.p): + dims.np = 0 + else: + dims.np = casadi_length(model.p) + if acados_ocp.parameter_values.shape[0] != dims.np: + raise Exception('inconsistent dimension np, regarding model.p and parameter_values.' + \ + f'\nGot np = {dims.np}, acados_ocp.parameter_values.shape = {acados_ocp.parameter_values.shape[0]}\n') + + # cost + # initial stage - if not set, copy fields from path constraints + if cost.cost_type_0 is None: + cost.cost_type_0 = cost.cost_type + cost.W_0 = cost.W + cost.Vx_0 = cost.Vx + cost.Vu_0 = cost.Vu + cost.Vz_0 = cost.Vz + cost.yref_0 = cost.yref + cost.cost_ext_fun_type_0 = cost.cost_ext_fun_type + model.cost_y_expr_0 = model.cost_y_expr + model.cost_expr_ext_cost_0 = model.cost_expr_ext_cost + model.cost_expr_ext_cost_custom_hess_0 = model.cost_expr_ext_cost_custom_hess + + if cost.cost_type_0 == 'LINEAR_LS': + ny_0 = cost.W_0.shape[0] + if cost.Vx_0.shape[0] != ny_0 or cost.Vu_0.shape[0] != ny_0: + raise Exception('inconsistent dimension ny_0, regarding W_0, Vx_0, Vu_0.' + \ + f'\nGot W_0[{cost.W_0.shape}], Vx_0[{cost.Vx_0.shape}], Vu_0[{cost.Vu_0.shape}]\n') + if dims.nz != 0 and cost.Vz_0.shape[0] != ny_0: + raise Exception('inconsistent dimension ny_0, regarding W_0, Vx_0, Vu_0, Vz_0.' + \ + f'\nGot W_0[{cost.W_0.shape}], Vx_0[{cost.Vx_0.shape}], Vu_0[{cost.Vu_0.shape}], Vz_0[{cost.Vz_0.shape}]\n') + if cost.Vx_0.shape[1] != dims.nx and ny_0 != 0: + raise Exception('inconsistent dimension: Vx_0 should have nx columns.') + if cost.Vu_0.shape[1] != dims.nu and ny_0 != 0: + raise Exception('inconsistent dimension: Vu_0 should have nu columns.') + if cost.yref_0.shape[0] != ny_0: + raise Exception('inconsistent dimension: regarding W_0, yref_0.' + \ + f'\nGot W_0[{cost.W_0.shape}], yref_0[{cost.yref_0.shape}]\n') + dims.ny_0 = ny_0 + + elif cost.cost_type_0 == 'NONLINEAR_LS': + ny_0 = cost.W_0.shape[0] + if is_empty(model.cost_y_expr_0) and ny_0 != 0: + raise Exception('inconsistent dimension ny_0: regarding W_0, cost_y_expr.') + elif casadi_length(model.cost_y_expr_0) != ny_0: + raise Exception('inconsistent dimension ny_0: regarding W_0, cost_y_expr.') + if cost.yref_0.shape[0] != ny_0: + raise Exception('inconsistent dimension: regarding W_0, yref_0.' + \ + f'\nGot W_0[{cost.W.shape}], yref_0[{cost.yref_0.shape}]\n') + dims.ny_0 = ny_0 + + # path + if cost.cost_type == 'LINEAR_LS': + ny = cost.W.shape[0] + if cost.Vx.shape[0] != ny or cost.Vu.shape[0] != ny: + raise Exception('inconsistent dimension ny, regarding W, Vx, Vu.' + \ + f'\nGot W[{cost.W.shape}], Vx[{cost.Vx.shape}], Vu[{cost.Vu.shape}]\n') + if dims.nz != 0 and cost.Vz.shape[0] != ny: + raise Exception('inconsistent dimension ny, regarding W, Vx, Vu, Vz.' + \ + f'\nGot W[{cost.W.shape}], Vx[{cost.Vx.shape}], Vu[{cost.Vu.shape}], Vz[{cost.Vz.shape}]\n') + if cost.Vx.shape[1] != dims.nx and ny != 0: + raise Exception('inconsistent dimension: Vx should have nx columns.') + if cost.Vu.shape[1] != dims.nu and ny != 0: + raise Exception('inconsistent dimension: Vu should have nu columns.') + if cost.yref.shape[0] != ny: + raise Exception('inconsistent dimension: regarding W, yref.' + \ + f'\nGot W[{cost.W.shape}], yref[{cost.yref.shape}]\n') + dims.ny = ny + + elif cost.cost_type == 'NONLINEAR_LS': + ny = cost.W.shape[0] + if is_empty(model.cost_y_expr) and ny != 0: + raise Exception('inconsistent dimension ny: regarding W, cost_y_expr.') + elif casadi_length(model.cost_y_expr) != ny: + raise Exception('inconsistent dimension ny: regarding W, cost_y_expr.') + if cost.yref.shape[0] != ny: + raise Exception('inconsistent dimension: regarding W, yref.' + \ + f'\nGot W[{cost.W.shape}], yref[{cost.yref.shape}]\n') + dims.ny = ny + + # terminal + if cost.cost_type_e == 'LINEAR_LS': + ny_e = cost.W_e.shape[0] + if cost.Vx_e.shape[0] != ny_e: + raise Exception('inconsistent dimension ny_e: regarding W_e, cost_y_expr_e.' + \ + f'\nGot W_e[{cost.W_e.shape}], Vx_e[{cost.Vx_e.shape}]') + if cost.Vx_e.shape[1] != dims.nx and ny_e != 0: + raise Exception('inconsistent dimension: Vx_e should have nx columns.') + if cost.yref_e.shape[0] != ny_e: + raise Exception('inconsistent dimension: regarding W_e, yref_e.') + dims.ny_e = ny_e + + elif cost.cost_type_e == 'NONLINEAR_LS': + ny_e = cost.W_e.shape[0] + if is_empty(model.cost_y_expr_e) and ny_e != 0: + raise Exception('inconsistent dimension ny_e: regarding W_e, cost_y_expr_e.') + elif casadi_length(model.cost_y_expr_e) != ny_e: + raise Exception('inconsistent dimension ny_e: regarding W_e, cost_y_expr_e.') + if cost.yref_e.shape[0] != ny_e: + raise Exception('inconsistent dimension: regarding W_e, yref_e.') + dims.ny_e = ny_e + + + ## constraints + # initial + if (constraints.lbx_0 == [] and constraints.ubx_0 == []): + dims.nbx_0 = 0 + else: + this_shape = constraints.lbx_0.shape + other_shape = constraints.ubx_0.shape + if not this_shape == other_shape: + raise Exception('lbx_0, ubx_0 have different shapes!') + if not is_column(constraints.lbx_0): + raise Exception('lbx_0, ubx_0 must be column vectors!') + dims.nbx_0 = constraints.lbx_0.size + + if all(constraints.lbx_0 == constraints.ubx_0) and dims.nbx_0 == dims.nx \ + and dims.nbxe_0 is None \ + and (constraints.idxbxe_0.shape == constraints.idxbx_0.shape)\ + and all(constraints.idxbxe_0 == constraints.idxbx_0): + # case: x0 was set: nbx0 are all equlities. + dims.nbxe_0 = dims.nbx_0 + elif dims.nbxe_0 is None: + # case: x0 was not set -> dont assume nbx0 to be equality constraints. + dims.nbxe_0 = 0 + + # path + nbx = constraints.idxbx.shape[0] + if constraints.ubx.shape[0] != nbx or constraints.lbx.shape[0] != nbx: + raise Exception('inconsistent dimension nbx, regarding idxbx, ubx, lbx.') + else: + dims.nbx = nbx + + nbu = constraints.idxbu.shape[0] + if constraints.ubu.shape[0] != nbu or constraints.lbu.shape[0] != nbu: + raise Exception('inconsistent dimension nbu, regarding idxbu, ubu, lbu.') + else: + dims.nbu = nbu + + ng = constraints.lg.shape[0] + if constraints.ug.shape[0] != ng or constraints.C.shape[0] != ng \ + or constraints.D.shape[0] != ng: + raise Exception('inconsistent dimension ng, regarding lg, ug, C, D.') + else: + dims.ng = ng + + if not is_empty(model.con_h_expr): + nh = casadi_length(model.con_h_expr) + else: + nh = 0 + + if constraints.uh.shape[0] != nh or constraints.lh.shape[0] != nh: + raise Exception('inconsistent dimension nh, regarding lh, uh, con_h_expr.') + else: + dims.nh = nh + + if is_empty(model.con_phi_expr): + dims.nphi = 0 + dims.nr = 0 + else: + dims.nphi = casadi_length(model.con_phi_expr) + if is_empty(model.con_r_expr): + raise Exception('convex over nonlinear constraints: con_r_expr but con_phi_expr is nonempty') + else: + dims.nr = casadi_length(model.con_r_expr) + + # terminal + nbx_e = constraints.idxbx_e.shape[0] + if constraints.ubx_e.shape[0] != nbx_e or constraints.lbx_e.shape[0] != nbx_e: + raise Exception('inconsistent dimension nbx_e, regarding idxbx_e, ubx_e, lbx_e.') + else: + dims.nbx_e = nbx_e + + ng_e = constraints.lg_e.shape[0] + if constraints.ug_e.shape[0] != ng_e or constraints.C_e.shape[0] != ng_e: + raise Exception('inconsistent dimension ng_e, regarding_e lg_e, ug_e, C_e.') + else: + dims.ng_e = ng_e + + if not is_empty(model.con_h_expr_e): + nh_e = casadi_length(model.con_h_expr_e) + else: + nh_e = 0 + + if constraints.uh_e.shape[0] != nh_e or constraints.lh_e.shape[0] != nh_e: + raise Exception('inconsistent dimension nh_e, regarding lh_e, uh_e, con_h_expr_e.') + else: + dims.nh_e = nh_e + + if is_empty(model.con_phi_expr_e): + dims.nphi_e = 0 + dims.nr_e = 0 + else: + dims.nphi_e = casadi_length(model.con_phi_expr_e) + if is_empty(model.con_r_expr_e): + raise Exception('convex over nonlinear constraints: con_r_expr_e but con_phi_expr_e is nonempty') + else: + dims.nr_e = casadi_length(model.con_r_expr_e) + + # Slack dimensions + nsbx = constraints.idxsbx.shape[0] + if is_empty(constraints.lsbx): + constraints.lsbx = np.zeros((nsbx,)) + elif constraints.lsbx.shape[0] != nsbx: + raise Exception('inconsistent dimension nsbx, regarding idxsbx, lsbx.') + if is_empty(constraints.usbx): + constraints.usbx = np.zeros((nsbx,)) + elif constraints.usbx.shape[0] != nsbx: + raise Exception('inconsistent dimension nsbx, regarding idxsbx, usbx.') + dims.nsbx = nsbx + + nsbu = constraints.idxsbu.shape[0] + if is_empty(constraints.lsbu): + constraints.lsbu = np.zeros((nsbu,)) + elif constraints.lsbu.shape[0] != nsbu: + raise Exception('inconsistent dimension nsbu, regarding idxsbu, lsbu.') + if is_empty(constraints.usbu): + constraints.usbu = np.zeros((nsbu,)) + elif constraints.usbu.shape[0] != nsbu: + raise Exception('inconsistent dimension nsbu, regarding idxsbu, usbu.') + dims.nsbu = nsbu + + nsh = constraints.idxsh.shape[0] + if is_empty(constraints.lsh): + constraints.lsh = np.zeros((nsh,)) + elif constraints.lsh.shape[0] != nsh: + raise Exception('inconsistent dimension nsh, regarding idxsh, lsh.') + if is_empty(constraints.ush): + constraints.ush = np.zeros((nsh,)) + elif constraints.ush.shape[0] != nsh: + raise Exception('inconsistent dimension nsh, regarding idxsh, ush.') + dims.nsh = nsh + + nsphi = constraints.idxsphi.shape[0] + if is_empty(constraints.lsphi): + constraints.lsphi = np.zeros((nsphi,)) + elif constraints.lsphi.shape[0] != nsphi: + raise Exception('inconsistent dimension nsphi, regarding idxsphi, lsphi.') + if is_empty(constraints.usphi): + constraints.usphi = np.zeros((nsphi,)) + elif constraints.usphi.shape[0] != nsphi: + raise Exception('inconsistent dimension nsphi, regarding idxsphi, usphi.') + dims.nsphi = nsphi + + nsg = constraints.idxsg.shape[0] + if is_empty(constraints.lsg): + constraints.lsg = np.zeros((nsg,)) + elif constraints.lsg.shape[0] != nsg: + raise Exception('inconsistent dimension nsg, regarding idxsg, lsg.') + if is_empty(constraints.usg): + constraints.usg = np.zeros((nsg,)) + elif constraints.usg.shape[0] != nsg: + raise Exception('inconsistent dimension nsg, regarding idxsg, usg.') + dims.nsg = nsg + + ns = nsbx + nsbu + nsh + nsg + nsphi + wrong_field = "" + if cost.Zl.shape[0] != ns: + wrong_field = "Zl" + dim = cost.Zl.shape[0] + elif cost.Zu.shape[0] != ns: + wrong_field = "Zu" + dim = cost.Zu.shape[0] + elif cost.zl.shape[0] != ns: + wrong_field = "zl" + dim = cost.zl.shape[0] + elif cost.zu.shape[0] != ns: + wrong_field = "zu" + dim = cost.zu.shape[0] + + if wrong_field != "": + raise Exception(f'Inconsistent size for field {wrong_field}, with dimension {dim}, \n\t'\ + + f'Detected ns = {ns} = nsbx + nsbu + nsg + nsh + nsphi.\n\t'\ + + f'With nsbx = {nsbx}, nsbu = {nsbu}, nsg = {nsg}, nsh = {nsh}, nsphi = {nsphi}') + + dims.ns = ns + + nsbx_e = constraints.idxsbx_e.shape[0] + if is_empty(constraints.lsbx_e): + constraints.lsbx_e = np.zeros((nsbx_e,)) + elif constraints.lsbx_e.shape[0] != nsbx_e: + raise Exception('inconsistent dimension nsbx_e, regarding idxsbx_e, lsbx_e.') + if is_empty(constraints.usbx_e): + constraints.usbx_e = np.zeros((nsbx_e,)) + elif constraints.usbx_e.shape[0] != nsbx_e: + raise Exception('inconsistent dimension nsbx_e, regarding idxsbx_e, usbx_e.') + dims.nsbx_e = nsbx_e + + nsh_e = constraints.idxsh_e.shape[0] + if is_empty(constraints.lsh_e): + constraints.lsh_e = np.zeros((nsh_e,)) + elif constraints.lsh_e.shape[0] != nsh_e: + raise Exception('inconsistent dimension nsh_e, regarding idxsh_e, lsh_e.') + if is_empty(constraints.ush_e): + constraints.ush_e = np.zeros((nsh_e,)) + elif constraints.ush_e.shape[0] != nsh_e: + raise Exception('inconsistent dimension nsh_e, regarding idxsh_e, ush_e.') + dims.nsh_e = nsh_e + + nsg_e = constraints.idxsg_e.shape[0] + if is_empty(constraints.lsg_e): + constraints.lsg_e = np.zeros((nsg_e,)) + elif constraints.lsg_e.shape[0] != nsg_e: + raise Exception('inconsistent dimension nsg_e, regarding idxsg_e, lsg_e.') + if is_empty(constraints.usg_e): + constraints.usg_e = np.zeros((nsg_e,)) + elif constraints.usg_e.shape[0] != nsg_e: + raise Exception('inconsistent dimension nsg_e, regarding idxsg_e, usg_e.') + dims.nsg_e = nsg_e + + nsphi_e = constraints.idxsphi_e.shape[0] + if is_empty(constraints.lsphi_e): + constraints.lsphi_e = np.zeros((nsphi_e,)) + elif constraints.lsphi_e.shape[0] != nsphi_e: + raise Exception('inconsistent dimension nsphi_e, regarding idxsphi_e, lsphi_e.') + if is_empty(constraints.usphi_e): + constraints.usphi_e = np.zeros((nsphi_e,)) + elif constraints.usphi_e.shape[0] != nsphi_e: + raise Exception('inconsistent dimension nsphi_e, regarding idxsphi_e, usphi_e.') + dims.nsphi_e = nsphi_e + + # terminal + ns_e = nsbx_e + nsh_e + nsg_e + nsphi_e + wrong_field = "" + if cost.Zl_e.shape[0] != ns_e: + wrong_field = "Zl_e" + dim = cost.Zl_e.shape[0] + elif cost.Zu_e.shape[0] != ns_e: + wrong_field = "Zu_e" + dim = cost.Zu_e.shape[0] + elif cost.zl_e.shape[0] != ns_e: + wrong_field = "zl_e" + dim = cost.zl_e.shape[0] + elif cost.zu_e.shape[0] != ns_e: + wrong_field = "zu_e" + dim = cost.zu_e.shape[0] + + if wrong_field != "": + raise Exception(f'Inconsistent size for field {wrong_field}, with dimension {dim}, \n\t'\ + + f'Detected ns_e = {ns_e} = nsbx_e + nsg_e + nsh_e + nsphi_e.\n\t'\ + + f'With nsbx_e = {nsbx_e}, nsg_e = {nsg_e}, nsh_e = {nsh_e}, nsphi_e = {nsphi_e}') + + dims.ns_e = ns_e + + # discretization + if is_empty(opts.time_steps) and is_empty(opts.shooting_nodes): + # uniform discretization + opts.time_steps = opts.tf / dims.N * np.ones((dims.N,)) + + elif not is_empty(opts.shooting_nodes): + if np.shape(opts.shooting_nodes)[0] != dims.N+1: + raise Exception('inconsistent dimension N, regarding shooting_nodes.') + + # time_steps = opts.shooting_nodes[1:] - opts.shooting_nodes[0:-1] + # # identify constant time-steps: due to numerical reasons the content of time_steps might vary a bit + # delta_time_steps = time_steps[1:] - time_steps[0:-1] + # avg_time_steps = np.average(time_steps) + # # criterion for constant time-step detection: the min/max difference in values normalized by the average + # check_const_time_step = np.max(delta_time_steps)-np.min(delta_time_steps) / avg_time_steps + # # if the criterion is small, we have a constant time-step + # if check_const_time_step < 1e-9: + # time_steps[:] = avg_time_steps # if we have a constant time-step: apply the average time-step + time_steps = np.zeros((dims.N,)) + for i in range(dims.N): + time_steps[i] = opts.shooting_nodes[i+1] - opts.shooting_nodes[i] # TODO use commented code above + + opts.time_steps = time_steps + + elif (not is_empty(opts.time_steps)) and (not is_empty(opts.shooting_nodes)): + Exception('Please provide either time_steps or shooting_nodes for nonuniform discretization') + + tf = np.sum(opts.time_steps) + if (tf - opts.tf) / tf > 1e-15: + raise Exception(f'Inconsistent discretization: {opts.tf}'\ + f' = tf != sum(opts.time_steps) = {tf}.') + + # num_steps + if isinstance(opts.sim_method_num_steps, np.ndarray) and opts.sim_method_num_steps.size == 1: + opts.sim_method_num_steps = opts.sim_method_num_steps.item() + + if isinstance(opts.sim_method_num_steps, (int, float)) and opts.sim_method_num_steps % 1 == 0: + opts.sim_method_num_steps = opts.sim_method_num_steps * np.ones((dims.N,), dtype=np.int64) + elif isinstance(opts.sim_method_num_steps, np.ndarray) and opts.sim_method_num_steps.size == dims.N \ + and np.all(np.equal(np.mod(opts.sim_method_num_steps, 1), 0)): + opts.sim_method_num_steps = np.reshape(opts.sim_method_num_steps, (dims.N,)).astype(np.int64) + else: + raise Exception("Wrong value for sim_method_num_steps. Should be either int or array of ints of shape (N,).") + + # num_stages + if isinstance(opts.sim_method_num_stages, np.ndarray) and opts.sim_method_num_stages.size == 1: + opts.sim_method_num_stages = opts.sim_method_num_stages.item() + + if isinstance(opts.sim_method_num_stages, (int, float)) and opts.sim_method_num_stages % 1 == 0: + opts.sim_method_num_stages = opts.sim_method_num_stages * np.ones((dims.N,), dtype=np.int64) + elif isinstance(opts.sim_method_num_stages, np.ndarray) and opts.sim_method_num_stages.size == dims.N \ + and np.all(np.equal(np.mod(opts.sim_method_num_stages, 1), 0)): + opts.sim_method_num_stages = np.reshape(opts.sim_method_num_stages, (dims.N,)).astype(np.int64) + else: + raise Exception("Wrong value for sim_method_num_stages. Should be either int or array of ints of shape (N,).") + + # jac_reuse + if isinstance(opts.sim_method_jac_reuse, np.ndarray) and opts.sim_method_jac_reuse.size == 1: + opts.sim_method_jac_reuse = opts.sim_method_jac_reuse.item() + + if isinstance(opts.sim_method_jac_reuse, (int, float)) and opts.sim_method_jac_reuse % 1 == 0: + opts.sim_method_jac_reuse = opts.sim_method_jac_reuse * np.ones((dims.N,), dtype=np.int64) + elif isinstance(opts.sim_method_jac_reuse, np.ndarray) and opts.sim_method_jac_reuse.size == dims.N \ + and np.all(np.equal(np.mod(opts.sim_method_jac_reuse, 1), 0)): + opts.sim_method_jac_reuse = np.reshape(opts.sim_method_jac_reuse, (dims.N,)).astype(np.int64) + else: + raise Exception("Wrong value for sim_method_jac_reuse. Should be either int or array of ints of shape (N,).") + + +def get_simulink_default_opts(): + python_interface_path = get_python_interface_path() + abs_path = os.path.join(python_interface_path, 'simulink_default_opts.json') + with open(abs_path , 'r') as f: + simulink_default_opts = json.load(f) + return simulink_default_opts + + +def ocp_formulation_json_dump(acados_ocp, simulink_opts, json_file='acados_ocp_nlp.json'): + # Load acados_ocp_nlp structure description + ocp_layout = get_ocp_nlp_layout() + + # Copy input ocp object dictionary + ocp_nlp_dict = dict(deepcopy(acados_ocp).__dict__) + # TODO: maybe make one function with formatting + + for acados_struct, v in ocp_layout.items(): + # skip non dict attributes + if not isinstance(v, dict): + continue + # setattr(ocp_nlp, acados_struct, dict(getattr(acados_ocp, acados_struct).__dict__)) + # Copy ocp object attributes dictionaries + ocp_nlp_dict[acados_struct]=dict(getattr(acados_ocp, acados_struct).__dict__) + + ocp_nlp_dict = format_class_dict(ocp_nlp_dict) + + # strip symbolics + ocp_nlp_dict['model'] = acados_model_strip_casadi_symbolics(ocp_nlp_dict['model']) + + # strip shooting_nodes + ocp_nlp_dict['solver_options'].pop('shooting_nodes', None) + + dims_dict = acados_class2dict(acados_ocp.dims) + + ocp_check_against_layout(ocp_nlp_dict, dims_dict) + + # add simulink options + ocp_nlp_dict['simulink_opts'] = simulink_opts + + with open(json_file, 'w') as f: + json.dump(ocp_nlp_dict, f, default=np_array_to_list, indent=4, sort_keys=True) + + + +def ocp_formulation_json_load(json_file='acados_ocp_nlp.json'): + # Load acados_ocp_nlp structure description + ocp_layout = get_ocp_nlp_layout() + + with open(json_file, 'r') as f: + ocp_nlp_json = json.load(f) + + ocp_nlp_dict = json2dict(ocp_nlp_json, ocp_nlp_json['dims']) + + # Instantiate AcadosOcp object + acados_ocp = AcadosOcp() + + # load class dict + acados_ocp.__dict__ = ocp_nlp_dict + + # load class attributes dict, dims, constraints, etc + for acados_struct, v in ocp_layout.items(): + # skip non dict attributes + if not isinstance(v, dict): + continue + acados_attribute = getattr(acados_ocp, acados_struct) + acados_attribute.__dict__ = ocp_nlp_dict[acados_struct] + setattr(acados_ocp, acados_struct, acados_attribute) + + return acados_ocp + + +def ocp_generate_external_functions(acados_ocp, model): + + model = make_model_consistent(model) + + if acados_ocp.solver_options.hessian_approx == 'EXACT': + opts = dict(generate_hess=1) + else: + opts = dict(generate_hess=0) + code_export_dir = acados_ocp.code_export_directory + opts['code_export_directory'] = code_export_dir + + if acados_ocp.model.dyn_ext_fun_type != 'casadi': + raise Exception("ocp_generate_external_functions: dyn_ext_fun_type only supports 'casadi' for now.\ + Extending the Python interface with generic function support is welcome.") + + if acados_ocp.solver_options.integrator_type == 'ERK': + # explicit model -- generate C code + generate_c_code_explicit_ode(model, opts) + elif acados_ocp.solver_options.integrator_type == 'IRK': + # implicit model -- generate C code + generate_c_code_implicit_ode(model, opts) + elif acados_ocp.solver_options.integrator_type == 'LIFTED_IRK': + generate_c_code_implicit_ode(model, opts) + elif acados_ocp.solver_options.integrator_type == 'GNSF': + generate_c_code_gnsf(model, opts) + elif acados_ocp.solver_options.integrator_type == 'DISCRETE': + generate_c_code_discrete_dynamics(model, opts) + else: + raise Exception("ocp_generate_external_functions: unknown integrator type.") + + if acados_ocp.dims.nphi > 0 or acados_ocp.dims.nh > 0: + generate_c_code_constraint(model, model.name, False, opts) + + if acados_ocp.dims.nphi_e > 0 or acados_ocp.dims.nh_e > 0: + generate_c_code_constraint(model, model.name, True, opts) + + # dummy matrices + if not acados_ocp.cost.cost_type_0 == 'LINEAR_LS': + acados_ocp.cost.Vx_0 = np.zeros((acados_ocp.dims.ny_0, acados_ocp.dims.nx)) + acados_ocp.cost.Vu_0 = np.zeros((acados_ocp.dims.ny_0, acados_ocp.dims.nu)) + if not acados_ocp.cost.cost_type == 'LINEAR_LS': + acados_ocp.cost.Vx = np.zeros((acados_ocp.dims.ny, acados_ocp.dims.nx)) + acados_ocp.cost.Vu = np.zeros((acados_ocp.dims.ny, acados_ocp.dims.nu)) + if not acados_ocp.cost.cost_type_e == 'LINEAR_LS': + acados_ocp.cost.Vx_e = np.zeros((acados_ocp.dims.ny_e, acados_ocp.dims.nx)) + + if acados_ocp.cost.cost_type_0 == 'NONLINEAR_LS': + generate_c_code_nls_cost(model, model.name, 'initial', opts) + elif acados_ocp.cost.cost_type_0 == 'EXTERNAL': + generate_c_code_external_cost(model, 'initial', opts) + + if acados_ocp.cost.cost_type == 'NONLINEAR_LS': + generate_c_code_nls_cost(model, model.name, 'path', opts) + elif acados_ocp.cost.cost_type == 'EXTERNAL': + generate_c_code_external_cost(model, 'path', opts) + + if acados_ocp.cost.cost_type_e == 'NONLINEAR_LS': + generate_c_code_nls_cost(model, model.name, 'terminal', opts) + elif acados_ocp.cost.cost_type_e == 'EXTERNAL': + generate_c_code_external_cost(model, 'terminal', opts) + + +def ocp_render_templates(acados_ocp, json_file): + + name = acados_ocp.model.name + + # setting up loader and environment + json_path = os.path.join(os.getcwd(), json_file) + + if not os.path.exists(json_path): + raise Exception('{} not found!'.format(json_path)) + + code_export_dir = acados_ocp.code_export_directory + template_dir = code_export_dir + + ## Render templates + in_file = 'main.in.c' + out_file = f'main_{name}.c' + render_template(in_file, out_file, template_dir, json_path) + + in_file = 'acados_solver.in.c' + out_file = f'acados_solver_{name}.c' + render_template(in_file, out_file, template_dir, json_path) + + in_file = 'acados_solver.in.h' + out_file = f'acados_solver_{name}.h' + render_template(in_file, out_file, template_dir, json_path) + + in_file = 'acados_solver.in.pxd' + out_file = f'acados_solver.pxd' + render_template(in_file, out_file, template_dir, json_path) + + in_file = 'Makefile.in' + out_file = 'Makefile' + render_template(in_file, out_file, template_dir, json_path) + + in_file = 'acados_solver_sfun.in.c' + out_file = f'acados_solver_sfunction_{name}.c' + render_template(in_file, out_file, template_dir, json_path) + + in_file = 'make_sfun.in.m' + out_file = f'make_sfun_{name}.m' + render_template(in_file, out_file, template_dir, json_path) + + # sim + in_file = 'acados_sim_solver.in.c' + out_file = f'acados_sim_solver_{name}.c' + render_template(in_file, out_file, template_dir, json_path) + + in_file = 'acados_sim_solver.in.h' + out_file = f'acados_sim_solver_{name}.h' + render_template(in_file, out_file, template_dir, json_path) + + in_file = 'main_sim.in.c' + out_file = f'main_sim_{name}.c' + render_template(in_file, out_file, template_dir, json_path) + + ## folder model + template_dir = os.path.join(code_export_dir, name + '_model') + in_file = 'model.in.h' + out_file = f'{name}_model.h' + render_template(in_file, out_file, template_dir, json_path) + + # constraints on convex over nonlinear function + if acados_ocp.constraints.constr_type == 'BGP' and acados_ocp.dims.nphi > 0: + # constraints on outer function + template_dir = os.path.join(code_export_dir, name + '_constraints') + in_file = 'phi_constraint.in.h' + out_file = f'{name}_phi_constraint.h' + render_template(in_file, out_file, template_dir, json_path) + + # terminal constraints on convex over nonlinear function + if acados_ocp.constraints.constr_type_e == 'BGP' and acados_ocp.dims.nphi_e > 0: + # terminal constraints on outer function + template_dir = os.path.join(code_export_dir, name + '_constraints') + in_file = 'phi_e_constraint.in.h' + out_file = f'{name}_phi_e_constraint.h' + render_template(in_file, out_file, template_dir, json_path) + + # nonlinear constraints + if acados_ocp.constraints.constr_type == 'BGH' and acados_ocp.dims.nh > 0: + template_dir = os.path.join(code_export_dir, name + '_constraints') + in_file = 'h_constraint.in.h' + out_file = f'{name}_h_constraint.h' + render_template(in_file, out_file, template_dir, json_path) + + # terminal nonlinear constraints + if acados_ocp.constraints.constr_type_e == 'BGH' and acados_ocp.dims.nh_e > 0: + template_dir = os.path.join(code_export_dir, name + '_constraints') + in_file = 'h_e_constraint.in.h' + out_file = f'{name}_h_e_constraint.h' + render_template(in_file, out_file, template_dir, json_path) + + # initial stage Nonlinear LS cost function + if acados_ocp.cost.cost_type_0 == 'NONLINEAR_LS': + template_dir = os.path.join(code_export_dir, name + '_cost') + in_file = 'cost_y_0_fun.in.h' + out_file = f'{name}_cost_y_0_fun.h' + render_template(in_file, out_file, template_dir, json_path) + # external cost - terminal + elif acados_ocp.cost.cost_type_0 == 'EXTERNAL': + template_dir = os.path.join(code_export_dir, name + '_cost') + in_file = 'external_cost_0.in.h' + out_file = f'{name}_external_cost_0.h' + render_template(in_file, out_file, template_dir, json_path) + + # path Nonlinear LS cost function + if acados_ocp.cost.cost_type == 'NONLINEAR_LS': + template_dir = os.path.join(code_export_dir, name + '_cost') + in_file = 'cost_y_fun.in.h' + out_file = f'{name}_cost_y_fun.h' + render_template(in_file, out_file, template_dir, json_path) + + # terminal Nonlinear LS cost function + if acados_ocp.cost.cost_type_e == 'NONLINEAR_LS': + template_dir = os.path.join(code_export_dir, name + '_cost') + in_file = 'cost_y_e_fun.in.h' + out_file = f'{name}_cost_y_e_fun.h' + render_template(in_file, out_file, template_dir, json_path) + + # external cost + if acados_ocp.cost.cost_type == 'EXTERNAL': + template_dir = os.path.join(code_export_dir, name + '_cost') + in_file = 'external_cost.in.h' + out_file = f'{name}_external_cost.h' + render_template(in_file, out_file, template_dir, json_path) + + # external cost - terminal + if acados_ocp.cost.cost_type_e == 'EXTERNAL': + template_dir = os.path.join(code_export_dir, name + '_cost') + in_file = 'external_cost_e.in.h' + out_file = f'{name}_external_cost_e.h' + render_template(in_file, out_file, template_dir, json_path) + + +def remove_x0_elimination(acados_ocp): + acados_ocp.constraints.idxbxe_0 = np.zeros((0,)) + acados_ocp.dims.nbxe_0 = 0 + + +class AcadosOcpSolver: + """ + Class to interact with the acados ocp solver C object. + + :param acados_ocp: type AcadosOcp - description of the OCP for acados + :param json_file: name for the json file used to render the templated code - default: acados_ocp_nlp.json + :param simulink_opts: Options to configure Simulink S-function blocks, mainly to activate possible Inputs and Outputs + """ + if sys.platform=="win32": + from ctypes import wintypes + dlclose = ctypes.WinDLL('kernel32', use_last_error=True).FreeLibrary + dlclose.argtypes = [wintypes.HMODULE] + else: + dlclose = CDLL(None).dlclose + dlclose.argtypes = [c_void_p] + + @classmethod + def generate(cls, acados_ocp, json_file='acados_ocp_nlp.json', simulink_opts=None, build=True): + model = acados_ocp.model + + if simulink_opts is None: + simulink_opts = get_simulink_default_opts() + + # make dims consistent + make_ocp_dims_consistent(acados_ocp) + + # module dependent post processing + if acados_ocp.solver_options.integrator_type == 'GNSF': + set_up_imported_gnsf_model(acados_ocp) + + if acados_ocp.solver_options.qp_solver == 'PARTIAL_CONDENSING_QPDUNES': + remove_x0_elimination(acados_ocp) + + # set integrator time automatically + acados_ocp.solver_options.Tsim = acados_ocp.solver_options.time_steps[0] + + # generate external functions + ocp_generate_external_functions(acados_ocp, model) + + # dump to json + ocp_formulation_json_dump(acados_ocp, simulink_opts, json_file) + + code_export_dir = acados_ocp.code_export_directory + # render templates + ocp_render_templates(acados_ocp, json_file) + + if build: + ## Compile solver + cwd=os.getcwd() + os.chdir(code_export_dir) + os.system('make clean_ocp_shared_lib') + os.system('make ocp_shared_lib') + os.chdir(cwd) + + def __init__(self, model_name, N, code_export_dir): + self.model_name = model_name + self.N = N + + self.solver_created = False + self.shared_lib_name = f'{code_export_dir}/libacados_ocp_solver_{self.model_name}.so' + + # get shared_lib + self.shared_lib = CDLL(self.shared_lib_name) + + # create capsule + getattr(self.shared_lib, f"{self.model_name}_acados_create_capsule").restype = c_void_p + self.capsule = getattr(self.shared_lib, f"{self.model_name}_acados_create_capsule")() + + # create solver + getattr(self.shared_lib, f"{self.model_name}_acados_create").argtypes = [c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_create").restype = c_int + assert getattr(self.shared_lib, f"{self.model_name}_acados_create")(self.capsule)==0 + self.solver_created = True + + # get pointers solver + self.__get_pointers_solver() + + + def __get_pointers_solver(self): + """ + Private function to get the pointers for solver + """ + # get pointers solver + getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_opts").argtypes = [c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_opts").restype = c_void_p + self.nlp_opts = getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_opts")(self.capsule) + + getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_dims").argtypes = [c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_dims").restype = c_void_p + self.nlp_dims = getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_dims")(self.capsule) + + getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_config").argtypes = [c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_config").restype = c_void_p + self.nlp_config = getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_config")(self.capsule) + + getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_out").argtypes = [c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_out").restype = c_void_p + self.nlp_out = getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_out")(self.capsule) + + getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_in").argtypes = [c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_in").restype = c_void_p + self.nlp_in = getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_in")(self.capsule) + + getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_solver").argtypes = [c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_solver").restype = c_void_p + self.nlp_solver = getattr(self.shared_lib, f"{self.model_name}_acados_get_nlp_solver")(self.capsule) + + # treat parameters separately + getattr(self.shared_lib, f"{self.model_name}_acados_update_params").argtypes = [c_void_p, c_int, POINTER(c_double)] + getattr(self.shared_lib, f"{self.model_name}_acados_update_params").restype = c_int + self._set_param = getattr(self.shared_lib, f"{self.model_name}_acados_update_params") + + self.shared_lib.ocp_nlp_constraint_dims_get_from_attr.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, POINTER(c_int)] + self.shared_lib.ocp_nlp_constraint_dims_get_from_attr.restype = c_int + + self.shared_lib.ocp_nlp_cost_dims_get_from_attr.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, POINTER(c_int)] + self.shared_lib.ocp_nlp_cost_dims_get_from_attr.restype = c_int + + self.shared_lib.ocp_nlp_constraints_model_set.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_cost_model_set.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_out_set.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_set.argtypes = \ + [c_void_p, c_void_p, c_int, c_char_p, c_void_p] + + def solve(self): + """ + Solve the ocp with current input. + """ + + getattr(self.shared_lib, f"{self.model_name}_acados_solve").argtypes = [c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_solve").restype = c_int + status = getattr(self.shared_lib, f"{self.model_name}_acados_solve")(self.capsule) + return status + + + def set_new_time_steps(self, new_time_steps): + """ + Set new time steps before solving. Only reload library without code generation but with new time steps. + + :param new_time_steps: vector of new time steps for the solver + + .. note:: This allows for different use-cases: either set a new size of time-steps or a new distribution of + the shooting nodes without changing the number, e.g., to reach a different final time. Both cases + do not require a new code export and compilation. + """ + + # unlikely but still possible + if not self.solver_created: + raise Exception('Solver was not yet created!') + + # check if time steps really changed in value + if np.array_equal(self.acados_ocp.solver_options.time_steps, new_time_steps): + return + + N = new_time_steps.size + model = self.acados_ocp.model + new_time_steps_data = cast(new_time_steps.ctypes.data, POINTER(c_double)) + + # check if recreation of acados is necessary (no need to recreate acados if sizes are identical) + if self.acados_ocp.solver_options.time_steps.size == N: + getattr(self.shared_lib, f"{self.model_name}_acados_update_time_steps").argtypes = [c_void_p, c_int, c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_update_time_steps").restype = c_int + assert getattr(self.shared_lib, f"{self.model_name}_acados_update_time_steps")(self.capsule, N, new_time_steps_data) == 0 + else: # recreate the solver with the new time steps + self.solver_created = False + + # delete old memory (analog to __del__) + getattr(self.shared_lib, f"{self.model_name}_acados_free").argtypes = [c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_free").restype = c_int + getattr(self.shared_lib, f"{self.model_name}_acados_free")(self.capsule) + + # store N and new time steps + self.N = self.acados_ocp.dims.N = N + self.acados_ocp.solver_options.time_steps = new_time_steps + self.acados_ocp.solver_options.Tsim = self.acados_ocp.solver_options.time_steps[0] + + # create solver with new time steps + getattr(self.shared_lib, f"{self.model_name}_acados_create_with_discretization").argtypes = [c_void_p, c_int, c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_create_with_discretization").restype = c_int + assert getattr(self.shared_lib, f"{self.model_name}_acados_create_with_discretization")(self.capsule, N, new_time_steps_data) == 0 + + self.solver_created = True + + # get pointers solver + self.__get_pointers_solver() + + + def get(self, stage_, field_): + """ + Get the last solution of the solver: + + :param stage: integer corresponding to shooting node + :param field: string in ['x', 'u', 'z', 'pi', 'lam', 't', 'sl', 'su',] + + .. note:: regarding lam, t: \n + the inequalities are internally organized in the following order: \n + [ lbu lbx lg lh lphi ubu ubx ug uh uphi; \n + lsbu lsbx lsg lsh lsphi usbu usbx usg ush usphi] + + .. note:: pi: multipliers for dynamics equality constraints \n + lam: multipliers for inequalities \n + t: slack variables corresponding to evaluation of all inequalities (at the solution) \n + sl: slack variables of soft lower inequality constraints \n + su: slack variables of soft upper inequality constraints \n + """ + + out_fields = ['x', 'u', 'z', 'pi', 'lam', 't', 'sl', 'su'] + # mem_fields = ['sl', 'su'] + field = field_ + field = field.encode('utf-8') + + if (field_ not in out_fields): + raise Exception('AcadosOcpSolver.get(): {} is an invalid argument.\ + \n Possible values are {}. Exiting.'.format(field_, out_fields)) + + if not isinstance(stage_, int): + raise Exception('AcadosOcpSolver.get(): stage index must be Integer.') + + if stage_ < 0 or stage_ > self.N: + raise Exception('AcadosOcpSolver.get(): stage index must be in [0, N], got: {}.'.format(self.N)) + + if stage_ == self.N and field_ == 'pi': + raise Exception('AcadosOcpSolver.get(): field {} does not exist at final stage {}.'\ + .format(field_, stage_)) + + self.shared_lib.ocp_nlp_dims_get_from_attr.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p] + self.shared_lib.ocp_nlp_dims_get_from_attr.restype = c_int + + dims = self.shared_lib.ocp_nlp_dims_get_from_attr(self.nlp_config, \ + self.nlp_dims, self.nlp_out, stage_, field) + + out = np.ascontiguousarray(np.zeros((dims,)), dtype=np.float64) + out_data = cast(out.ctypes.data, POINTER(c_double)) + + if (field_ in out_fields): + self.shared_lib.ocp_nlp_out_get.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_out_get(self.nlp_config, \ + self.nlp_dims, self.nlp_out, stage_, field, out_data) + # elif field_ in mem_fields: + # self.shared_lib.ocp_nlp_get_at_stage.argtypes = \ + # [c_void_p, c_void_p, c_void_p, c_int, c_char_p, c_void_p] + # self.shared_lib.ocp_nlp_get_at_stage(self.nlp_config, \ + # self.nlp_dims, self.nlp_solver, stage_, field, out_data) + + return out + + + def print_statistics(self): + """ + prints statistics of previous solver run as a table: + - iter: iteration number + - res_stat: stationarity residual + - res_eq: residual wrt equality constraints (dynamics) + - res_ineq: residual wrt inequality constraints (constraints) + - res_comp: residual wrt complementarity conditions + - qp_stat: status of QP solver + - qp_iter: number of QP iterations + - qp_res_stat: stationarity residual of the last QP solution + - qp_res_eq: residual wrt equality constraints (dynamics) of the last QP solution + - qp_res_ineq: residual wrt inequality constraints (constraints) of the last QP solution + - qp_res_comp: residual wrt complementarity conditions of the last QP solution + """ + stat = self.get_stats("statistics") + + if self.acados_ocp.solver_options.nlp_solver_type == 'SQP': + print('\niter\tres_stat\tres_eq\t\tres_ineq\tres_comp\tqp_stat\tqp_iter') + if stat.shape[0]>7: + print('\tqp_res_stat\tqp_res_eq\tqp_res_ineq\tqp_res_comp') + for jj in range(stat.shape[1]): + print('{:d}\t{:e}\t{:e}\t{:e}\t{:e}\t{:d}\t{:d}'.format( \ + int(stat[0][jj]), stat[1][jj], stat[2][jj], \ + stat[3][jj], stat[4][jj], int(stat[5][jj]), int(stat[6][jj]))) + if stat.shape[0]>7: + print('\t{:e}\t{:e}\t{:e}\t{:e}'.format( \ + stat[7][jj], stat[8][jj], stat[9][jj], stat[10][jj])) + print('\n') + elif self.acados_ocp.solver_options.nlp_solver_type == 'SQP_RTI': + print('\niter\tqp_stat\tqp_iter') + if stat.shape[0]>3: + print('\tqp_res_stat\tqp_res_eq\tqp_res_ineq\tqp_res_comp') + for jj in range(stat.shape[1]): + print('{:d}\t{:d}\t{:d}'.format( int(stat[0][jj]), int(stat[1][jj]), int(stat[2][jj]))) + if stat.shape[0]>3: + print('\t{:e}\t{:e}\t{:e}\t{:e}'.format( \ + stat[3][jj], stat[4][jj], stat[5][jj], stat[6][jj])) + print('\n') + + return + + + def store_iterate(self, filename='', overwrite=False): + """ + Stores the current iterate of the ocp solver in a json file. + + :param filename: if not set, use model_name + timestamp + '.json' + :param overwrite: if false and filename exists add timestamp to filename + """ + if filename == '': + filename += self.model_name + '_' + 'iterate' + '.json' + + if not overwrite: + # append timestamp + if os.path.isfile(filename): + filename = filename[:-5] + filename += datetime.utcnow().strftime('%Y-%m-%d-%H:%M:%S.%f') + '.json' + + # get iterate: + solution = dict() + + for i in range(self.N+1): + solution['x_'+str(i)] = self.get(i,'x') + solution['u_'+str(i)] = self.get(i,'u') + solution['z_'+str(i)] = self.get(i,'z') + solution['lam_'+str(i)] = self.get(i,'lam') + solution['t_'+str(i)] = self.get(i, 't') + solution['sl_'+str(i)] = self.get(i, 'sl') + solution['su_'+str(i)] = self.get(i, 'su') + for i in range(self.N): + solution['pi_'+str(i)] = self.get(i,'pi') + + # save + with open(filename, 'w') as f: + json.dump(solution, f, default=np_array_to_list, indent=4, sort_keys=True) + print("stored current iterate in ", os.path.join(os.getcwd(), filename)) + + + def load_iterate(self, filename): + """ + Loads the iterate stored in json file with filename into the ocp solver. + """ + if not os.path.isfile(filename): + raise Exception('load_iterate: failed, file does not exist: ' + os.path.join(os.getcwd(), filename)) + + with open(filename, 'r') as f: + solution = json.load(f) + + for key in solution.keys(): + (field, stage) = key.split('_') + self.set(int(stage), field, np.array(solution[key])) + + + def get_stats(self, field_): + """ + Get the information of the last solver call. + + :param field: string in ['statistics', 'time_tot', 'time_lin', 'time_sim', 'time_sim_ad', 'time_sim_la', 'time_qp', 'time_qp_solver_call', 'time_reg', 'sqp_iter'] + """ + + fields = ['time_tot', # total cpu time previous call + 'time_lin', # cpu time for linearization + 'time_sim', # cpu time for integrator + 'time_sim_ad', # cpu time for integrator contribution of external function calls + 'time_sim_la', # cpu time for integrator contribution of linear algebra + 'time_qp', # cpu time qp solution + 'time_qp_solver_call', # cpu time inside qp solver (without converting the QP) + 'time_qp_xcond', + 'time_glob', # cpu time globalization + 'time_reg', # cpu time regularization + 'sqp_iter', # number of SQP iterations + 'qp_iter', # vector of QP iterations for last SQP call + 'statistics', # table with info about last iteration + 'stat_m', + 'stat_n',] + + field = field_ + field = field.encode('utf-8') + if (field_ not in fields): + raise Exception('AcadosOcpSolver.get_stats(): {} is not a valid argument.\ + \n Possible values are {}. Exiting.'.format(fields, fields)) + + if field_ in ['sqp_iter', 'stat_m', 'stat_n']: + out = np.ascontiguousarray(np.zeros((1,)), dtype=np.int64) + out_data = cast(out.ctypes.data, POINTER(c_int64)) + + elif field_ == 'statistics': + sqp_iter = self.get_stats("sqp_iter") + stat_m = self.get_stats("stat_m") + stat_n = self.get_stats("stat_n") + + min_size = min([stat_m, sqp_iter+1]) + + out = np.ascontiguousarray( + np.zeros((stat_n[0]+1, min_size[0])), dtype=np.float64) + out_data = cast(out.ctypes.data, POINTER(c_double)) + + elif field_ == 'qp_iter': + full_stats = self.get_stats('statistics') + if self.acados_ocp.solver_options.nlp_solver_type == 'SQP': + out = full_stats[6, :] + elif self.acados_ocp.solver_options.nlp_solver_type == 'SQP_RTI': + out = full_stats[2, :] + + else: + out = np.ascontiguousarray(np.zeros((1,)), dtype=np.float64) + out_data = cast(out.ctypes.data, POINTER(c_double)) + + if not field_ == 'qp_iter': + self.shared_lib.ocp_nlp_get.argtypes = [c_void_p, c_void_p, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_get(self.nlp_config, self.nlp_solver, field, out_data) + + return out + + + def get_cost(self): + """ + Returns the cost value of the current solution. + """ + # compute cost internally + self.shared_lib.ocp_nlp_eval_cost.argtypes = [c_void_p, c_void_p, c_void_p] + self.shared_lib.ocp_nlp_eval_cost(self.nlp_solver, self.nlp_in, self.nlp_out) + + # create output array + out = np.ascontiguousarray(np.zeros((1,)), dtype=np.float64) + out_data = cast(out.ctypes.data, POINTER(c_double)) + + # call getter + self.shared_lib.ocp_nlp_get.argtypes = [c_void_p, c_void_p, c_char_p, c_void_p] + + field = "cost_value".encode('utf-8') + self.shared_lib.ocp_nlp_get(self.nlp_config, self.nlp_solver, field, out_data) + + return out[0] + + + def get_residuals(self): + """ + Returns an array of the form [res_stat, res_eq, res_ineq, res_comp]. + """ + # compute residuals if RTI + if self.acados_ocp.solver_options.nlp_solver_type == 'SQP_RTI': + self.shared_lib.ocp_nlp_eval_residuals.argtypes = [c_void_p, c_void_p, c_void_p] + self.shared_lib.ocp_nlp_eval_residuals(self.nlp_solver, self.nlp_in, self.nlp_out) + + # create output array + out = np.ascontiguousarray(np.zeros((4, 1)), dtype=np.float64) + out_data = cast(out.ctypes.data, POINTER(c_double)) + + # call getters + self.shared_lib.ocp_nlp_get.argtypes = [c_void_p, c_void_p, c_char_p, c_void_p] + + field = "res_stat".encode('utf-8') + self.shared_lib.ocp_nlp_get(self.nlp_config, self.nlp_solver, field, out_data) + + out_data = cast(out[1].ctypes.data, POINTER(c_double)) + field = "res_eq".encode('utf-8') + self.shared_lib.ocp_nlp_get(self.nlp_config, self.nlp_solver, field, out_data) + + out_data = cast(out[2].ctypes.data, POINTER(c_double)) + field = "res_ineq".encode('utf-8') + self.shared_lib.ocp_nlp_get(self.nlp_config, self.nlp_solver, field, out_data) + + out_data = cast(out[3].ctypes.data, POINTER(c_double)) + field = "res_comp".encode('utf-8') + self.shared_lib.ocp_nlp_get(self.nlp_config, self.nlp_solver, field, out_data) + return out.flatten() + + + # Note: this function should not be used anymore, better use cost_set, constraints_set + + def set(self, stage_, field_, value_): + + """ + Set numerical data inside the solver. + + :param stage: integer corresponding to shooting node + :param field: string in ['x', 'u', 'pi', 'lam', 't', 'p'] + + .. note:: regarding lam, t: \n + the inequalities are internally organized in the following order: \n + [ lbu lbx lg lh lphi ubu ubx ug uh uphi; \n + lsbu lsbx lsg lsh lsphi usbu usbx usg ush usphi] + + .. note:: pi: multipliers for dynamics equality constraints \n + lam: multipliers for inequalities \n + t: slack variables corresponding to evaluation of all inequalities (at the solution) \n + sl: slack variables of soft lower inequality constraints \n + su: slack variables of soft upper inequality constraints \n + """ + cost_fields = ['y_ref', 'yref'] + constraints_fields = ['lbx', 'ubx', 'lbu', 'ubu'] + out_fields = ['x', 'u', 'pi', 'lam', 't', 'z', 'sl', 'su'] + + # cast value_ to avoid conversion issues + if isinstance(value_, (float, int)): + value_ = np.array([value_]) + value_ = value_.astype(float) + + field = field_ + field = field.encode('utf-8') + + stage = c_int(stage_) + + # treat parameters separately + if field_ == 'p': + getattr(self.shared_lib, f"{self.model_name}_acados_update_params").argtypes = [c_void_p, c_int, POINTER(c_double)] + getattr(self.shared_lib, f"{self.model_name}_acados_update_params").restype = c_int + + value_data = cast(value_.ctypes.data, POINTER(c_double)) + + assert getattr(self.shared_lib, f"{self.model_name}_acados_update_params")(self.capsule, stage, value_data, value_.shape[0])==0 + else: + if field_ not in constraints_fields + cost_fields + out_fields: + raise Exception("AcadosOcpSolver.set(): {} is not a valid argument.\ + \nPossible values are {}. Exiting.".format(field, \ + constraints_fields + cost_fields + out_fields + ['p'])) + + self.shared_lib.ocp_nlp_dims_get_from_attr.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p] + self.shared_lib.ocp_nlp_dims_get_from_attr.restype = c_int + + dims = self.shared_lib.ocp_nlp_dims_get_from_attr(self.nlp_config, \ + self.nlp_dims, self.nlp_out, stage_, field) + + if value_.shape[0] != dims: + msg = 'AcadosOcpSolver.set(): mismatching dimension for field "{}" '.format(field_) + msg += 'with dimension {} (you have {})'.format(dims, value_.shape[0]) + raise Exception(msg) + + value_data = cast(value_.ctypes.data, POINTER(c_double)) + value_data_p = cast((value_data), c_void_p) + + if field_ in constraints_fields: + self.shared_lib.ocp_nlp_constraints_model_set(self.nlp_config, \ + self.nlp_dims, self.nlp_in, stage, field, value_data_p) + elif field_ in cost_fields: + self.shared_lib.ocp_nlp_cost_model_set(self.nlp_config, \ + self.nlp_dims, self.nlp_in, stage, field, value_data_p) + elif field_ in out_fields: + self.shared_lib.ocp_nlp_out_set(self.nlp_config, \ + self.nlp_dims, self.nlp_out, stage, field, value_data_p) + # elif field_ in mem_fields: + # self.shared_lib.ocp_nlp_set(self.nlp_config, \ + # self.nlp_solver, stage, field, value_data_p) + + return + + + def cost_set(self, stage_, field_, value_, api='warn'): + """ + Set numerical data in the cost module of the solver. + + :param stage: integer corresponding to shooting node + :param field: string, e.g. 'yref', 'W', 'ext_cost_num_hess' + :param value: of appropriate size + """ + # cast value_ to avoid conversion issues + if isinstance(value_, (float, int)): + value_ = np.array([value_]) + value_ = value_.astype(float) + + field = field_ + field = field.encode('utf-8') + + stage = c_int(stage_) + self.shared_lib.ocp_nlp_cost_dims_get_from_attr.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, POINTER(c_int)] + self.shared_lib.ocp_nlp_cost_dims_get_from_attr.restype = c_int + + dims = np.ascontiguousarray(np.zeros((2,)), dtype=np.intc) + dims_data = cast(dims.ctypes.data, POINTER(c_int)) + + self.shared_lib.ocp_nlp_cost_dims_get_from_attr(self.nlp_config, \ + self.nlp_dims, self.nlp_out, stage_, field, dims_data) + + value_shape = value_.shape + if len(value_shape) == 1: + value_shape = (value_shape[0], 0) + + elif len(value_shape) == 2: + if api=='old': + pass + elif api=='warn': + if not np.all(np.ravel(value_, order='F')==np.ravel(value_, order='K')): + raise Exception("Ambiguity in API detected.\n" + "Are you making an acados model from scrach? Add api='new' to cost_set and carry on.\n" + "Are you seeing this error suddenly in previously running code? Read on.\n" + " You are relying on a now-fixed bug in cost_set for field '{}'.\n".format(field_) + + " acados_template now correctly passes on any matrices to acados in column major format.\n" + + " Two options to fix this error: \n" + + " * Add api='old' to cost_set to restore old incorrect behaviour\n" + + " * Add api='new' to cost_set and remove any unnatural manipulation of the value argument " + + "such as non-mathematical transposes, reshaping, casting to fortran order, etc... " + + "If there is no such manipulation, then you have probably been getting an incorrect solution before.") + # Get elements in column major order + value_ = np.ravel(value_, order='F') + elif api=='new': + # Get elements in column major order + value_ = np.ravel(value_, order='F') + else: + raise Exception("Unknown api: '{}'".format(api)) + + if value_shape != tuple(dims): + raise Exception('AcadosOcpSolver.cost_set(): mismatching dimension', \ + ' for field "{}" with dimension {} (you have {})'.format( \ + field_, tuple(dims), value_shape)) + + value_data = cast(value_.ctypes.data, POINTER(c_double)) + value_data_p = cast((value_data), c_void_p) + + self.shared_lib.ocp_nlp_cost_model_set.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_cost_model_set(self.nlp_config, \ + self.nlp_dims, self.nlp_in, stage, field, value_data_p) + + return + + + def constraints_set(self, stage_, field_, value_, api='warn'): + """ + Set numerical data in the constraint module of the solver. + + :param stage: integer corresponding to shooting node + :param field: string in ['lbx', 'ubx', 'lbu', 'ubu', 'lg', 'ug', 'lh', 'uh', 'uphi', 'C', 'D'] + :param value: of appropriate size + """ + # cast value_ to avoid conversion issues + if isinstance(value_, (float, int)): + value_ = np.array([value_]) + value_ = value_.astype(float) + + field = field_ + field = field.encode('utf-8') + + stage = c_int(stage_) + self.shared_lib.ocp_nlp_constraint_dims_get_from_attr.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, POINTER(c_int)] + self.shared_lib.ocp_nlp_constraint_dims_get_from_attr.restype = c_int + + dims = np.ascontiguousarray(np.zeros((2,)), dtype=np.intc) + dims_data = cast(dims.ctypes.data, POINTER(c_int)) + + self.shared_lib.ocp_nlp_constraint_dims_get_from_attr(self.nlp_config, \ + self.nlp_dims, self.nlp_out, stage_, field, dims_data) + + value_shape = value_.shape + if len(value_shape) == 1: + value_shape = (value_shape[0], 0) + elif len(value_shape) == 2: + if api=='old': + pass + elif api=='warn': + if not np.all(np.ravel(value_, order='F')==np.ravel(value_, order='K')): + raise Exception("Ambiguity in API detected.\n" + "Are you making an acados model from scrach? Add api='new' to constraints_set and carry on.\n" + "Are you seeing this error suddenly in previously running code? Read on.\n" + " You are relying on a now-fixed bug in constraints_set for field '{}'.\n".format(field_) + + " acados_template now correctly passes on any matrices to acados in column major format.\n" + + " Two options to fix this error: \n" + + " * Add api='old' to constraints_set to restore old incorrect behaviour\n" + + " * Add api='new' to constraints_set and remove any unnatural manipulation of the value argument " + + "such as non-mathematical transposes, reshaping, casting to fortran order, etc... " + + "If there is no such manipulation, then you have probably been getting an incorrect solution before.") + # Get elements in column major order + value_ = np.ravel(value_, order='F') + elif api=='new': + # Get elements in column major order + value_ = np.ravel(value_, order='F') + else: + raise Exception("Unknown api: '{}'".format(api)) + + if value_shape != tuple(dims): + raise Exception('AcadosOcpSolver.constraints_set(): mismatching dimension' \ + ' for field "{}" with dimension {} (you have {})'.format(field_, tuple(dims), value_shape)) + + value_data = cast(value_.ctypes.data, POINTER(c_double)) + value_data_p = cast((value_data), c_void_p) + + self.shared_lib.ocp_nlp_constraints_model_set.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_constraints_model_set(self.nlp_config, \ + self.nlp_dims, self.nlp_in, stage, field, value_data_p) + + return + + + def dynamics_get(self, stage_, field_): + """ + Get numerical data from the dynamics module of the solver: + + :param stage: integer corresponding to shooting node + :param field: string, e.g. 'A' + """ + + field = field_ + field = field.encode('utf-8') + stage = c_int(stage_) + + # get dims + self.shared_lib.ocp_nlp_dynamics_dims_get_from_attr.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, POINTER(c_int)] + self.shared_lib.ocp_nlp_dynamics_dims_get_from_attr.restype = c_int + + dims = np.ascontiguousarray(np.zeros((2,)), dtype=np.intc) + dims_data = cast(dims.ctypes.data, POINTER(c_int)) + + self.shared_lib.ocp_nlp_dynamics_dims_get_from_attr(self.nlp_config, \ + self.nlp_dims, self.nlp_out, stage_, field, dims_data) + + # create output data + out = np.ascontiguousarray(np.zeros((np.prod(dims),)), dtype=np.float64) + out = out.reshape(dims[0], dims[1], order='F') + + out_data = cast(out.ctypes.data, POINTER(c_double)) + out_data_p = cast((out_data), c_void_p) + + # call getter + self.shared_lib.ocp_nlp_get_at_stage.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_get_at_stage(self.nlp_config, \ + self.nlp_dims, self.nlp_solver, stage, field, out_data_p) + + return out + + + def options_set(self, field_, value_): + """ + Set options of the solver. + + :param field: string, e.g. 'print_level', 'rti_phase', 'initialize_t_slacks', 'step_length', 'alpha_min', 'alpha_reduction' + :param value: of type int, float + """ + int_fields = ['print_level', 'rti_phase', 'initialize_t_slacks'] + double_fields = ['step_length', 'tol_eq', 'tol_stat', 'tol_ineq', 'tol_comp', 'alpha_min', 'alpha_reduction'] + string_fields = ['globalization'] + + # check field availability and type + if field_ in int_fields: + if not isinstance(value_, int): + raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) + else: + value_ctypes = c_int(value_) + + elif field_ in double_fields: + if not isinstance(value_, float): + raise Exception('solver option {} must be of type float. You have {}.'.format(field_, type(value_))) + else: + value_ctypes = c_double(value_) + + elif field_ in string_fields: + if not isinstance(value_, str): + raise Exception('solver option {} must be of type str. You have {}.'.format(field_, type(value_))) + else: + value_ctypes = value_.encode('utf-8') + else: + raise Exception('AcadosOcpSolver.options_set() does not support field {}.'\ + '\n Possible values are {}.'.format(field_, ', '.join(int_fields + double_fields + string_fields))) + + + if field_ == 'rti_phase': + if value_ < 0 or value_ > 2: + raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + 'take only values 0, 1, 2 for SQP-RTI-type solvers') + if self.acados_ocp.solver_options.nlp_solver_type != 'SQP_RTI' and value_ > 0: + raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + 'take only value 0 for SQP-type solvers') + + # encode + field = field_ + field = field.encode('utf-8') + + # call C interface + if field_ in string_fields: + self.shared_lib.ocp_nlp_solver_opts_set.argtypes = \ + [c_void_p, c_void_p, c_char_p, c_char_p] + self.shared_lib.ocp_nlp_solver_opts_set(self.nlp_config, \ + self.nlp_opts, field, value_ctypes) + else: + self.shared_lib.ocp_nlp_solver_opts_set.argtypes = \ + [c_void_p, c_void_p, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_solver_opts_set(self.nlp_config, \ + self.nlp_opts, field, byref(value_ctypes)) + return + + + def __del__(self): + if self.solver_created: + getattr(self.shared_lib, f"{self.model_name}_acados_free").argtypes = [c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_free").restype = c_int + getattr(self.shared_lib, f"{self.model_name}_acados_free")(self.capsule) + + getattr(self.shared_lib, f"{self.model_name}_acados_free_capsule").argtypes = [c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_free_capsule").restype = c_int + getattr(self.shared_lib, f"{self.model_name}_acados_free_capsule")(self.capsule) + + try: + self.dlclose(self.shared_lib._handle) + except: + pass diff --git a/pyextra/acados_template/acados_ocp_solver_fast.py b/pyextra/acados_template/acados_ocp_solver_fast.py new file mode 100644 index 000000000..656d288f1 --- /dev/null +++ b/pyextra/acados_template/acados_ocp_solver_fast.py @@ -0,0 +1,402 @@ +import sys +import os +import json +import numpy as np +from datetime import datetime + +from ctypes import POINTER, CDLL, c_void_p, c_int, cast, c_double, c_char_p + +from copy import deepcopy + +from .generate_c_code_explicit_ode import generate_c_code_explicit_ode +from .generate_c_code_implicit_ode import generate_c_code_implicit_ode +from .generate_c_code_gnsf import generate_c_code_gnsf +from .generate_c_code_discrete_dynamics import generate_c_code_discrete_dynamics +from .generate_c_code_constraint import generate_c_code_constraint +from .generate_c_code_nls_cost import generate_c_code_nls_cost +from .generate_c_code_external_cost import generate_c_code_external_cost +from .acados_ocp import AcadosOcp +from .acados_model import acados_model_strip_casadi_symbolics +from .utils import is_column, is_empty, casadi_length, render_template, acados_class2dict,\ + format_class_dict, ocp_check_against_layout, np_array_to_list, make_model_consistent,\ + set_up_imported_gnsf_model, get_acados_path + + +class AcadosOcpSolverFast: + dlclose = CDLL(None).dlclose + dlclose.argtypes = [c_void_p] + + def __init__(self, model_name, N, code_export_dir): + + self.solver_created = False + self.N = N + self.model_name = model_name + + self.shared_lib_name = f'{code_export_dir}/libacados_ocp_solver_{model_name}.so' + + # get shared_lib + self.shared_lib = CDLL(self.shared_lib_name) + + # create capsule + getattr(self.shared_lib, f"{model_name}_acados_create_capsule").restype = c_void_p + self.capsule = getattr(self.shared_lib, f"{model_name}_acados_create_capsule")() + + # create solver + getattr(self.shared_lib, f"{model_name}_acados_create").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_create").restype = c_int + assert getattr(self.shared_lib, f"{model_name}_acados_create")(self.capsule)==0 + self.solver_created = True + + # get pointers solver + getattr(self.shared_lib, f"{model_name}_acados_get_nlp_opts").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_get_nlp_opts").restype = c_void_p + self.nlp_opts = getattr(self.shared_lib, f"{model_name}_acados_get_nlp_opts")(self.capsule) + + getattr(self.shared_lib, f"{model_name}_acados_get_nlp_dims").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_get_nlp_dims").restype = c_void_p + self.nlp_dims = getattr(self.shared_lib, f"{model_name}_acados_get_nlp_dims")(self.capsule) + + getattr(self.shared_lib, f"{model_name}_acados_get_nlp_config").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_get_nlp_config").restype = c_void_p + self.nlp_config = getattr(self.shared_lib, f"{model_name}_acados_get_nlp_config")(self.capsule) + + getattr(self.shared_lib, f"{model_name}_acados_get_nlp_out").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_get_nlp_out").restype = c_void_p + self.nlp_out = getattr(self.shared_lib, f"{model_name}_acados_get_nlp_out")(self.capsule) + + getattr(self.shared_lib, f"{model_name}_acados_get_nlp_in").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_get_nlp_in").restype = c_void_p + self.nlp_in = getattr(self.shared_lib, f"{model_name}_acados_get_nlp_in")(self.capsule) + + getattr(self.shared_lib, f"{model_name}_acados_get_nlp_solver").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_get_nlp_solver").restype = c_void_p + self.nlp_solver = getattr(self.shared_lib, f"{model_name}_acados_get_nlp_solver")(self.capsule) + + + def solve(self): + """ + Solve the ocp with current input. + """ + model_name = self.model_name + + getattr(self.shared_lib, f"{model_name}_acados_solve").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_solve").restype = c_int + status = getattr(self.shared_lib, f"{model_name}_acados_solve")(self.capsule) + return status + + def cost_set(self, start_stage_, field_, value_, api='warn'): + self.cost_set_slice(start_stage_, start_stage_+1, field_, value_[None], api='warn') + return + + def cost_set_slice(self, start_stage_, end_stage_, field_, value_, api='warn'): + """ + Set numerical data in the cost module of the solver. + + :param stage: integer corresponding to shooting node + :param field: string, e.g. 'yref', 'W', 'ext_cost_num_hess' + :param value: of appropriate size + """ + # cast value_ to avoid conversion issues + if isinstance(value_, (float, int)): + value_ = np.array([value_]) + value_ = np.ascontiguousarray(np.copy(value_), dtype=np.float64) + field = field_ + field = field.encode('utf-8') + dim = np.product(value_.shape[1:]) + + start_stage = c_int(start_stage_) + end_stage = c_int(end_stage_) + self.shared_lib.ocp_nlp_cost_dims_get_from_attr.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, POINTER(c_int)] + self.shared_lib.ocp_nlp_cost_dims_get_from_attr.restype = c_int + + dims = np.ascontiguousarray(np.zeros((2,)), dtype=np.intc) + dims_data = cast(dims.ctypes.data, POINTER(c_int)) + + self.shared_lib.ocp_nlp_cost_dims_get_from_attr(self.nlp_config, + self.nlp_dims, self.nlp_out, start_stage_, field, dims_data) + + value_shape = value_.shape + expected_shape = tuple(np.concatenate([np.array([end_stage_ - start_stage_]), dims])) + if len(value_shape) == 2: + value_shape = (value_shape[0], value_shape[1], 0) + + elif len(value_shape) == 3: + if api=='old': + pass + elif api=='warn': + if not np.all(np.ravel(value_, order='F')==np.ravel(value_, order='K')): + raise Exception("Ambiguity in API detected.\n" + "Are you making an acados model from scrach? Add api='new' to cost_set and carry on.\n" + "Are you seeing this error suddenly in previously running code? Read on.\n" + " You are relying on a now-fixed bug in cost_set for field '{}'.\n".format(field_) + + " acados_template now correctly passes on any matrices to acados in column major format.\n" + + " Two options to fix this error: \n" + + " * Add api='old' to cost_set to restore old incorrect behaviour\n" + + " * Add api='new' to cost_set and remove any unnatural manipulation of the value argument " + + "such as non-mathematical transposes, reshaping, casting to fortran order, etc... " + + "If there is no such manipulation, then you have probably been getting an incorrect solution before.") + # Get elements in column major order + value_ = np.ravel(value_, order='F') + elif api=='new': + # Get elements in column major order + value_ = np.ravel(value_, order='F') + else: + raise Exception("Unknown api: '{}'".format(api)) + + if value_shape != expected_shape: + raise Exception('AcadosOcpSolver.cost_set(): mismatching dimension', + ' for field "{}" with dimension {} (you have {})'.format( + field_, expected_shape, value_shape)) + + + value_data = cast(value_.ctypes.data, POINTER(c_double)) + value_data_p = cast((value_data), c_void_p) + + self.shared_lib.ocp_nlp_cost_model_set_slice.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_int, c_char_p, c_void_p, c_int] + self.shared_lib.ocp_nlp_cost_model_set_slice(self.nlp_config, + self.nlp_dims, self.nlp_in, start_stage, end_stage, field, value_data_p, dim) + return + + def constraints_set(self, start_stage_, field_, value_, api='warn'): + self.constraints_set_slice(start_stage_, start_stage_+1, field_, value_[None], api='warn') + return + + def constraints_set_slice(self, start_stage_, end_stage_, field_, value_, api='warn'): + """ + Set numerical data in the constraint module of the solver. + + :param stage: integer corresponding to shooting node + :param field: string in ['lbx', 'ubx', 'lbu', 'ubu', 'lg', 'ug', 'lh', 'uh', 'uphi'] + :param value: of appropriate size + """ + # cast value_ to avoid conversion issues + if isinstance(value_, (float, int)): + value_ = np.array([value_]) + value_ = value_.astype(float) + + field = field_ + field = field.encode('utf-8') + dim = np.product(value_.shape[1:]) + + start_stage = c_int(start_stage_) + end_stage = c_int(end_stage_) + self.shared_lib.ocp_nlp_constraint_dims_get_from_attr.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, POINTER(c_int)] + self.shared_lib.ocp_nlp_constraint_dims_get_from_attr.restype = c_int + + dims = np.ascontiguousarray(np.zeros((2,)), dtype=np.intc) + dims_data = cast(dims.ctypes.data, POINTER(c_int)) + + self.shared_lib.ocp_nlp_constraint_dims_get_from_attr(self.nlp_config, \ + self.nlp_dims, self.nlp_out, start_stage_, field, dims_data) + + value_shape = value_.shape + expected_shape = tuple(np.concatenate([np.array([end_stage_ - start_stage_]), dims])) + if len(value_shape) == 2: + value_shape = (value_shape[0], value_shape[1], 0) + elif len(value_shape) == 3: + if api=='old': + pass + elif api=='warn': + if not np.all(np.ravel(value_, order='F')==np.ravel(value_, order='K')): + raise Exception("Ambiguity in API detected.\n" + "Are you making an acados model from scrach? Add api='new' to constraints_set and carry on.\n" + "Are you seeing this error suddenly in previously running code? Read on.\n" + " You are relying on a now-fixed bug in constraints_set for field '{}'.\n".format(field_) + + " acados_template now correctly passes on any matrices to acados in column major format.\n" + + " Two options to fix this error: \n" + + " * Add api='old' to constraints_set to restore old incorrect behaviour\n" + + " * Add api='new' to constraints_set and remove any unnatural manipulation of the value argument " + + "such as non-mathematical transposes, reshaping, casting to fortran order, etc... " + + "If there is no such manipulation, then you have probably been getting an incorrect solution before.") + # Get elements in column major order + value_ = np.ravel(value_, order='F') + elif api=='new': + # Get elements in column major order + value_ = np.ravel(value_, order='F') + else: + raise Exception("Unknown api: '{}'".format(api)) + if value_shape != expected_shape: + raise Exception('AcadosOcpSolver.constraints_set(): mismatching dimension' \ + ' for field "{}" with dimension {} (you have {})'.format(field_, expected_shape, value_shape)) + + value_data = cast(value_.ctypes.data, POINTER(c_double)) + value_data_p = cast((value_data), c_void_p) + + self.shared_lib.ocp_nlp_constraints_model_set_slice.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_int, c_char_p, c_void_p, c_int] + self.shared_lib.ocp_nlp_constraints_model_set_slice(self.nlp_config, \ + self.nlp_dims, self.nlp_in, start_stage, end_stage, field, value_data_p, dim) + return + + # Note: this function should not be used anymore, better use cost_set, constraints_set + def set(self, stage_, field_, value_): + """ + Set numerical data inside the solver. + + :param stage: integer corresponding to shooting node + :param field: string in ['x', 'u', 'pi', 'lam', 't', 'p'] + + .. note:: regarding lam, t: \n + the inequalities are internally organized in the following order: \n + [ lbu lbx lg lh lphi ubu ubx ug uh uphi; \n + lsbu lsbx lsg lsh lsphi usbu usbx usg ush usphi] + + .. note:: pi: multipliers for dynamics equality constraints \n + lam: multipliers for inequalities \n + t: slack variables corresponding to evaluation of all inequalities (at the solution) \n + sl: slack variables of soft lower inequality constraints \n + su: slack variables of soft upper inequality constraints \n + """ + cost_fields = ['y_ref', 'yref'] + constraints_fields = ['lbx', 'ubx', 'lbu', 'ubu'] + out_fields = ['x', 'u', 'pi', 'lam', 't', 'z'] + mem_fields = ['sl', 'su'] + + # cast value_ to avoid conversion issues + if isinstance(value_, (float, int)): + value_ = np.array([value_]) + value_ = value_.astype(float) + + model_name = self.model_name + + field = field_ + field = field.encode('utf-8') + + stage = c_int(stage_) + + # treat parameters separately + if field_ == 'p': + getattr(self.shared_lib, f"{model_name}_acados_update_params").argtypes = [c_void_p, c_int, POINTER(c_double)] + getattr(self.shared_lib, f"{model_name}_acados_update_params").restype = c_int + + value_data = cast(value_.ctypes.data, POINTER(c_double)) + + assert getattr(self.shared_lib, f"{model_name}_acados_update_params")(self.capsule, stage, value_data, value_.shape[0])==0 + else: + if field_ not in constraints_fields + cost_fields + out_fields + mem_fields: + raise Exception("AcadosOcpSolver.set(): {} is not a valid argument.\ + \nPossible values are {}. Exiting.".format(field, \ + constraints_fields + cost_fields + out_fields + ['p'])) + + self.shared_lib.ocp_nlp_dims_get_from_attr.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p] + self.shared_lib.ocp_nlp_dims_get_from_attr.restype = c_int + + dims = self.shared_lib.ocp_nlp_dims_get_from_attr(self.nlp_config, \ + self.nlp_dims, self.nlp_out, stage_, field) + + if value_.shape[0] != dims: + msg = 'AcadosOcpSolver.set(): mismatching dimension for field "{}" '.format(field_) + msg += 'with dimension {} (you have {})'.format(dims, value_.shape) + raise Exception(msg) + + value_data = cast(value_.ctypes.data, POINTER(c_double)) + value_data_p = cast((value_data), c_void_p) + + if field_ in constraints_fields: + self.shared_lib.ocp_nlp_constraints_model_set.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_constraints_model_set(self.nlp_config, \ + self.nlp_dims, self.nlp_in, stage, field, value_data_p) + elif field_ in cost_fields: + self.shared_lib.ocp_nlp_cost_model_set.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_cost_model_set(self.nlp_config, \ + self.nlp_dims, self.nlp_in, stage, field, value_data_p) + elif field_ in out_fields: + self.shared_lib.ocp_nlp_out_set.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_out_set(self.nlp_config, \ + self.nlp_dims, self.nlp_out, stage, field, value_data_p) + elif field_ in mem_fields: + self.shared_lib.ocp_nlp_set.argtypes = \ + [c_void_p, c_void_p, c_int, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_set(self.nlp_config, \ + self.nlp_solver, stage, field, value_data_p) + return + + + def get_slice(self, start_stage_, end_stage_, field_): + """ + Get the last solution of the solver: + + :param start_stage: integer corresponding to shooting node that indicates start of slice + :param end_stage: integer corresponding to shooting node that indicates end of slice + :param field: string in ['x', 'u', 'z', 'pi', 'lam', 't', 'sl', 'su',] + + .. note:: regarding lam, t: \n + the inequalities are internally organized in the following order: \n + [ lbu lbx lg lh lphi ubu ubx ug uh uphi; \n + lsbu lsbx lsg lsh lsphi usbu usbx usg ush usphi] + + .. note:: pi: multipliers for dynamics equality constraints \n + lam: multipliers for inequalities \n + t: slack variables corresponding to evaluation of all inequalities (at the solution) \n + sl: slack variables of soft lower inequality constraints \n + su: slack variables of soft upper inequality constraints \n + """ + out_fields = ['x', 'u', 'z', 'pi', 'lam', 't'] + mem_fields = ['sl', 'su'] + field = field_ + field = field.encode('utf-8') + + if (field_ not in out_fields + mem_fields): + raise Exception('AcadosOcpSolver.get_slice(): {} is an invalid argument.\ + \n Possible values are {}. Exiting.'.format(field_, out_fields)) + + if not isinstance(start_stage_, int): + raise Exception('AcadosOcpSolver.get_slice(): stage index must be Integer.') + + if not isinstance(end_stage_, int): + raise Exception('AcadosOcpSolver.get_slice(): stage index must be Integer.') + + if start_stage_ >= end_stage_: + raise Exception('AcadosOcpSolver.get_slice(): end stage index must be larger than start stage index') + + if start_stage_ < 0 or end_stage_ > self.N + 1: + raise Exception('AcadosOcpSolver.get_slice(): stage index must be in [0, N], got: {}.'.format(self.N)) + self.shared_lib.ocp_nlp_dims_get_from_attr.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p] + self.shared_lib.ocp_nlp_dims_get_from_attr.restype = c_int + + dims = self.shared_lib.ocp_nlp_dims_get_from_attr(self.nlp_config, \ + self.nlp_dims, self.nlp_out, start_stage_, field) + + out = np.ascontiguousarray(np.zeros((end_stage_ - start_stage_, dims)), dtype=np.float64) + out_data = cast(out.ctypes.data, POINTER(c_double)) + + if (field_ in out_fields): + self.shared_lib.ocp_nlp_out_get_slice.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_int, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_out_get_slice(self.nlp_config, \ + self.nlp_dims, self.nlp_out, start_stage_, end_stage_, field, out_data) + elif field_ in mem_fields: + self.shared_lib.ocp_nlp_get_at_stage.argtypes = \ + [c_void_p, c_void_p, c_void_p, c_int, c_char_p, c_void_p] + self.shared_lib.ocp_nlp_get_at_stage(self.nlp_config, \ + self.nlp_dims, self.nlp_solver, start_stage_, end_stage_, field, out_data) + + return out + + def get_cost(self): + """ + Returns the cost value of the current solution. + """ + # compute cost internally + self.shared_lib.ocp_nlp_eval_cost.argtypes = [c_void_p, c_void_p, c_void_p] + self.shared_lib.ocp_nlp_eval_cost(self.nlp_solver, self.nlp_in, self.nlp_out) + + # create output array + out = np.ascontiguousarray(np.zeros((1,)), dtype=np.float64) + out_data = cast(out.ctypes.data, POINTER(c_double)) + + # call getter + self.shared_lib.ocp_nlp_get.argtypes = [c_void_p, c_void_p, c_char_p, c_void_p] + + field = "cost_value".encode('utf-8') + self.shared_lib.ocp_nlp_get(self.nlp_config, self.nlp_solver, field, out_data) + + return out[0] diff --git a/pyextra/acados_template/acados_ocp_solver_pyx.pyx b/pyextra/acados_template/acados_ocp_solver_pyx.pyx new file mode 100644 index 000000000..9bcf5bb46 --- /dev/null +++ b/pyextra/acados_template/acados_ocp_solver_pyx.pyx @@ -0,0 +1,428 @@ +# -*- coding: future_fstrings -*- +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# +# cython: language_level=3 +# cython: profile=False +# distutils: language=c + +cimport cython +from libc cimport string + +cimport acados_solver_common +cimport acados_solver + +cimport numpy as cnp + +import os +import numpy as np + + +cdef class AcadosOcpSolverFast: + """ + Class to interact with the acados ocp solver C object. + + :param acados_ocp: type AcadosOcp - description of the OCP for acados + :param json_file: name for the json file used to render the templated code - default: acados_ocp_nlp.json + :param simulink_opts: Options to configure Simulink S-function blocks, mainly to activate possible Inputs and Outputs + """ + + cdef acados_solver.nlp_solver_capsule *capsule + cdef void *nlp_opts + cdef acados_solver_common.ocp_nlp_dims *nlp_dims + cdef acados_solver_common.ocp_nlp_config *nlp_config + cdef acados_solver_common.ocp_nlp_out *nlp_out + cdef acados_solver_common.ocp_nlp_in *nlp_in + cdef acados_solver_common.ocp_nlp_solver *nlp_solver + + cdef str model_name + cdef int N + cdef bint solver_created + + def __cinit__(self, str model_name, int N, str code_export_dir): + self.model_name = model_name + self.N = N + + self.solver_created = False + + # create capsule + self.capsule = acados_solver.acados_create_capsule() + + # create solver + assert acados_solver.acados_create(self.capsule) == 0 + self.solver_created = True + + # get pointers solver + self.nlp_opts = acados_solver.acados_get_nlp_opts(self.capsule) + self.nlp_dims = acados_solver.acados_get_nlp_dims(self.capsule) + self.nlp_config = acados_solver.acados_get_nlp_config(self.capsule) + self.nlp_out = acados_solver.acados_get_nlp_out(self.capsule) + self.nlp_in = acados_solver.acados_get_nlp_in(self.capsule) + self.nlp_solver = acados_solver.acados_get_nlp_solver(self.capsule) + + + def solve(self): + """ + Solve the ocp with current input. + """ + return acados_solver.acados_solve(self.capsule) + + + def set_new_time_steps(self, new_time_steps): + """ + Set new time steps before solving. Only reload library without code generation but with new time steps. + + :param new_time_steps: vector of new time steps for the solver + + .. note:: This allows for different use-cases: either set a new size of time-steps or a new distribution of + the shooting nodes without changing the number, e.g., to reach a different final time. Both cases + do not require a new code export and compilation. + """ + raise NotImplementedError() + + + def get(self, int stage, str field_): + """ + Get the last solution of the solver: + + :param stage: integer corresponding to shooting node + :param field: string in ['x', 'u', 'z', 'pi', 'lam', 't', 'sl', 'su',] + + .. note:: regarding lam, t: \n + the inequalities are internally organized in the following order: \n + [ lbu lbx lg lh lphi ubu ubx ug uh uphi; \n + lsbu lsbx lsg lsh lsphi usbu usbx usg ush usphi] + + .. note:: pi: multipliers for dynamics equality constraints \n + lam: multipliers for inequalities \n + t: slack variables corresponding to evaluation of all inequalities (at the solution) \n + sl: slack variables of soft lower inequality constraints \n + su: slack variables of soft upper inequality constraints \n + """ + + out_fields = ['x', 'u', 'z', 'pi', 'lam', 't', 'sl', 'su'] + field = field_.encode('utf-8') + + if field_ not in out_fields: + raise Exception('AcadosOcpSolver.get(): {} is an invalid argument.\ + \n Possible values are {}. Exiting.'.format(field_, out_fields)) + + if stage < 0 or stage > self.N: + raise Exception('AcadosOcpSolver.get(): stage index must be in [0, N], got: {}.'.format(self.N)) + + if stage == self.N and field_ == 'pi': + raise Exception('AcadosOcpSolver.get(): field {} does not exist at final stage {}.'\ + .format(field_, stage)) + + cdef int dims = acados_solver_common.ocp_nlp_dims_get_from_attr(self.nlp_config, + self.nlp_dims, self.nlp_out, stage, field) + + cdef cnp.ndarray[cnp.float64_t, ndim=1] out = np.zeros((dims,)) + acados_solver_common.ocp_nlp_out_get(self.nlp_config, \ + self.nlp_dims, self.nlp_out, stage, field, out.data) + + return out + + + def print_statistics(self): + """ + prints statistics of previous solver run as a table: + - iter: iteration number + - res_stat: stationarity residual + - res_eq: residual wrt equality constraints (dynamics) + - res_ineq: residual wrt inequality constraints (constraints) + - res_comp: residual wrt complementarity conditions + - qp_stat: status of QP solver + - qp_iter: number of QP iterations + - qp_res_stat: stationarity residual of the last QP solution + - qp_res_eq: residual wrt equality constraints (dynamics) of the last QP solution + - qp_res_ineq: residual wrt inequality constraints (constraints) of the last QP solution + - qp_res_comp: residual wrt complementarity conditions of the last QP solution + """ + raise NotImplementedError() + + + def store_iterate(self, filename='', overwrite=False): + """ + Stores the current iterate of the ocp solver in a json file. + + :param filename: if not set, use model_name + timestamp + '.json' + :param overwrite: if false and filename exists add timestamp to filename + """ + raise NotImplementedError() + + + def load_iterate(self, filename): + """ + Loads the iterate stored in json file with filename into the ocp solver. + """ + raise NotImplementedError() + + + def get_stats(self, field_): + """ + Get the information of the last solver call. + + :param field: string in ['statistics', 'time_tot', 'time_lin', 'time_sim', 'time_sim_ad', 'time_sim_la', 'time_qp', 'time_qp_solver_call', 'time_reg', 'sqp_iter'] + """ + raise NotImplementedError() + + + def get_cost(self): + """ + Returns the cost value of the current solution. + """ + # compute cost internally + acados_solver_common.ocp_nlp_eval_cost(self.nlp_solver, self.nlp_in, self.nlp_out) + + # create output + cdef double out + + # call getter + acados_solver_common.ocp_nlp_get(self.nlp_config, self.nlp_solver, "cost_value", &out) + + return out + + + def get_residuals(self): + """ + Returns an array of the form [res_stat, res_eq, res_ineq, res_comp]. + """ + raise NotImplementedError() + + + # Note: this function should not be used anymore, better use cost_set, constraints_set + def set(self, int stage, str field_, value_): + + """ + Set numerical data inside the solver. + + :param stage: integer corresponding to shooting node + :param field: string in ['x', 'u', 'pi', 'lam', 't', 'p'] + + .. note:: regarding lam, t: \n + the inequalities are internally organized in the following order: \n + [ lbu lbx lg lh lphi ubu ubx ug uh uphi; \n + lsbu lsbx lsg lsh lsphi usbu usbx usg ush usphi] + + .. note:: pi: multipliers for dynamics equality constraints \n + lam: multipliers for inequalities \n + t: slack variables corresponding to evaluation of all inequalities (at the solution) \n + sl: slack variables of soft lower inequality constraints \n + su: slack variables of soft upper inequality constraints \n + """ + cost_fields = ['y_ref', 'yref'] + constraints_fields = ['lbx', 'ubx', 'lbu', 'ubu'] + out_fields = ['x', 'u', 'pi', 'lam', 't', 'z', 'sl', 'su'] + + field = field_.encode('utf-8') + + cdef double[::1] value + + # treat parameters separately + if field_ == 'p': + value = np.ascontiguousarray(value_, dtype=np.double) + assert acados_solver.acados_update_params(self.capsule, stage, &value[0], value.shape[0]) == 0 + else: + if field_ not in constraints_fields + cost_fields + out_fields: + raise Exception("AcadosOcpSolver.set(): {} is not a valid argument.\ + \nPossible values are {}. Exiting.".format(field, \ + constraints_fields + cost_fields + out_fields + ['p'])) + + dims = acados_solver_common.ocp_nlp_dims_get_from_attr(self.nlp_config, + self.nlp_dims, self.nlp_out, stage, field) + + if value_.shape[0] != dims: + msg = 'AcadosOcpSolver.set(): mismatching dimension for field "{}" '.format(field_) + msg += 'with dimension {} (you have {})'.format(dims, value_.shape[0]) + raise Exception(msg) + + value = np.ascontiguousarray(value_, dtype=np.double) + if field_ in constraints_fields: + acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, + self.nlp_dims, self.nlp_in, stage, field, &value[0]) + elif field_ in cost_fields: + acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, + self.nlp_dims, self.nlp_in, stage, field, &value[0]) + elif field_ in out_fields: + acados_solver_common.ocp_nlp_out_set(self.nlp_config, + self.nlp_dims, self.nlp_out, stage, field, &value[0]) + + + def cost_set(self, int stage, str field_, value_): + """ + Set numerical data in the cost module of the solver. + + :param stage: integer corresponding to shooting node + :param field: string, e.g. 'yref', 'W', 'ext_cost_num_hess' + :param value: of appropriate size + """ + field = field_.encode('utf-8') + + cdef int dims[2] + acados_solver_common.ocp_nlp_cost_dims_get_from_attr(self.nlp_config, \ + self.nlp_dims, self.nlp_out, stage, field, &dims[0]) + + cdef double[::1,:] value + + value_shape = value_.shape + if len(value_shape) == 1: + value_shape = (value_shape[0], 0) + value = np.asfortranarray(value_[None,:]) + + elif len(value_shape) == 2: + # Get elements in column major order + value = np.asfortranarray(value_) + + if value_shape[0] != dims[0] or value_shape[1] != dims[1]: + raise Exception('AcadosOcpSolver.cost_set(): mismatching dimension', \ + ' for field "{}" with dimension {} (you have {})'.format( \ + field_, tuple(dims), value_shape)) + + acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, \ + self.nlp_dims, self.nlp_in, stage, field, &value[0][0]) + + + def constraints_set(self, int stage, str field_, value_): + """ + Set numerical data in the constraint module of the solver. + + :param stage: integer corresponding to shooting node + :param field: string in ['lbx', 'ubx', 'lbu', 'ubu', 'lg', 'ug', 'lh', 'uh', 'uphi', 'C', 'D'] + :param value: of appropriate size + """ + field = field_.encode('utf-8') + + cdef int dims[2] + acados_solver_common.ocp_nlp_constraint_dims_get_from_attr(self.nlp_config, \ + self.nlp_dims, self.nlp_out, stage, field, &dims[0]) + + cdef double[::1,:] value + + value_shape = value_.shape + if len(value_shape) == 1: + value_shape = (value_shape[0], 0) + value = np.asfortranarray(value_[None,:]) + + elif len(value_shape) == 2: + # Get elements in column major order + value = np.asfortranarray(value_) + + if value_shape[0] != dims[0] or value_shape[1] != dims[1]: + raise Exception('AcadosOcpSolver.constraints_set(): mismatching dimension' \ + ' for field "{}" with dimension {} (you have {})'.format(field_, tuple(dims), value_shape)) + + acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, \ + self.nlp_dims, self.nlp_in, stage, field, &value[0][0]) + + return + + + def dynamics_get(self, int stage, str field_): + """ + Get numerical data from the dynamics module of the solver: + + :param stage: integer corresponding to shooting node + :param field: string, e.g. 'A' + """ + field = field_.encode('utf-8') + + # get dims + cdef int[2] dims + acados_solver_common.ocp_nlp_dynamics_dims_get_from_attr(self.nlp_config, self.nlp_dims, self.nlp_out, stage, field, &dims[0]) + + # create output data + out = np.zeros((dims[0], dims[1]), order='F', dtype=np.float64) + + # call getter + acados_solver_common.ocp_nlp_get_at_stage(self.nlp_config, self.nlp_dims, self.nlp_solver, stage, field, out.data) + + return out + + + def options_set(self, str field_, value_): + """ + Set options of the solver. + + :param field: string, e.g. 'print_level', 'rti_phase', 'initialize_t_slacks', 'step_length', 'alpha_min', 'alpha_reduction' + :param value: of type int, float + """ + int_fields = ['print_level', 'rti_phase', 'initialize_t_slacks'] + double_fields = ['step_length', 'tol_eq', 'tol_stat', 'tol_ineq', 'tol_comp', 'alpha_min', 'alpha_reduction'] + string_fields = ['globalization'] + + # encode + field = field_.encode('utf-8') + + cdef int int_value + cdef double double_value + cdef unsigned char[::1] string_value + + # check field availability and type + if field_ in int_fields: + if not isinstance(value_, int): + raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) + + if field_ == 'rti_phase': + if value_ < 0 or value_ > 2: + raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + 'take only values 0, 1, 2 for SQP-RTI-type solvers') + if self.acados_ocp.solver_options.nlp_solver_type != 'SQP_RTI' and value_ > 0: + raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + 'take only value 0 for SQP-type solvers') + + int_value = value_ + acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &int_value) + + elif field_ in double_fields: + if not isinstance(value_, float): + raise Exception('solver option {} must be of type float. You have {}.'.format(field_, type(value_))) + + double_value = value_ + acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &double_value) + + elif field_ in string_fields: + if not isinstance(value_, bytes): + raise Exception('solver option {} must be of type str. You have {}.'.format(field_, type(value_))) + + string_value = value_.encode('utf-8') + acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &string_value[0]) + + else: + raise Exception('AcadosOcpSolver.options_set() does not support field {}.'\ + '\n Possible values are {}.'.format(field_, ', '.join(int_fields + double_fields + string_fields))) + + + def __del__(self): + if self.solver_created: + acados_solver.acados_free(self.capsule) + acados_solver.acados_free_capsule(self.capsule) diff --git a/pyextra/acados_template/acados_sim.py b/pyextra/acados_template/acados_sim.py new file mode 100644 index 000000000..d7ad1487d --- /dev/null +++ b/pyextra/acados_template/acados_sim.py @@ -0,0 +1,330 @@ +# -*- coding: future_fstrings -*- +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + +import numpy as np +import casadi as ca +import os +from .acados_model import AcadosModel +from .utils import get_acados_path + +class AcadosSimDims: + """ + Class containing the dimensions of the model to be simulated. + """ + def __init__(self): + self.__nx = None + self.__nu = None + self.__nz = 0 + self.__np = 0 + + @property + def nx(self): + """:math:`n_x` - number of states. Type: int > 0""" + return self.__nx + + @property + def nz(self): + """:math:`n_z` - number of algebraic variables. Type: int >= 0""" + return self.__nz + + @property + def nu(self): + """:math:`n_u` - number of inputs. Type: int >= 0""" + return self.__nu + + @property + def np(self): + """:math:`n_p` - number of parameters. Type: int >= 0""" + return self.__np + + @nx.setter + def nx(self, nx): + if type(nx) == int and nx > 0: + self.__nx = nx + else: + raise Exception('Invalid nx value, expected positive integer. Exiting.') + + @nz.setter + def nz(self, nz): + if type(nz) == int and nz > -1: + self.__nz = nz + else: + raise Exception('Invalid nz value, expected nonnegative integer. Exiting.') + + @nu.setter + def nu(self, nu): + if type(nu) == int and nu > -1: + self.__nu = nu + else: + raise Exception('Invalid nu value, expected nonnegative integer. Exiting.') + + @np.setter + def np(self, np): + if type(np) == int and np > -1: + self.__np = np + else: + raise Exception('Invalid np value, expected nonnegative integer. Exiting.') + + def set(self, attr, value): + setattr(self, attr, value) + + +class AcadosSimOpts: + """ + class containing the solver options + """ + def __init__(self): + self.__integrator_type = 'ERK' + self.__collocation_type = 'GAUSS_LEGENDRE' + self.__Tsim = None + # ints + self.__sim_method_num_stages = 1 + self.__sim_method_num_steps = 1 + self.__sim_method_newton_iter = 3 + # bools + self.__sens_forw = True + self.__sens_adj = False + self.__sens_algebraic = False + self.__sens_hess = False + self.__output_z = False + self.__sim_method_jac_reuse = 0 + + @property + def integrator_type(self): + """Integrator type. Default: 'ERK'.""" + return self.__integrator_type + + @property + def num_stages(self): + """Number of stages in the integrator. Default: 1""" + return self.__sim_method_num_stages + + @property + def num_steps(self): + """Number of steps in the integrator. Default: 1""" + return self.__sim_method_num_steps + + @property + def newton_iter(self): + """Number of Newton iterations in simulation method. Default: 3""" + return self.__sim_method_newton_iter + + @property + def sens_forw(self): + """Boolean determining if forward sensitivities are computed. Default: True""" + return self.__sens_forw + + @property + def sens_adj(self): + """Boolean determining if adjoint sensitivities are computed. Default: False""" + return self.__sens_adj + + @property + def sens_algebraic(self): + """Boolean determining if sensitivities wrt algebraic variables are computed. Default: False""" + return self.__sens_algebraic + + @property + def sens_hess(self): + """Boolean determining if hessians are computed. Default: False""" + return self.__sens_hess + + @property + def output_z(self): + """Boolean determining if values for algebraic variables (corresponding to start of simulation interval) are computed. Default: False""" + return self.__output_z + + @property + def sim_method_jac_reuse(self): + """Integer determining if jacobians are reused (0 or 1). Default: 0""" + return self.__sim_method_jac_reuse + + @property + def T(self): + """Time horizon""" + return self.__Tsim + + @property + def collocation_type(self): + """Collocation type: relevant for implicit integrators + -- string in {GAUSS_RADAU_IIA, GAUSS_LEGENDRE} + + Default: GAUSS_LEGENDRE + """ + return self.__collocation_type + + @integrator_type.setter + def integrator_type(self, integrator_type): + integrator_types = ('ERK', 'IRK', 'GNSF') + if integrator_type in integrator_types: + self.__integrator_type = integrator_type + else: + raise Exception('Invalid integrator_type value. Possible values are:\n\n' \ + + ',\n'.join(integrator_types) + '.\n\nYou have: ' + integrator_type + '.\n\nExiting.') + + @collocation_type.setter + def collocation_type(self, collocation_type): + collocation_types = ('GAUSS_RADAU_IIA', 'GAUSS_LEGENDRE') + if collocation_type in collocation_types: + self.__collocation_type = collocation_type + else: + raise Exception('Invalid collocation_type value. Possible values are:\n\n' \ + + ',\n'.join(collocation_types) + '.\n\nYou have: ' + collocation_type + '.\n\nExiting.') + + @T.setter + def T(self, T): + self.__Tsim = T + + @num_stages.setter + def num_stages(self, num_stages): + if isinstance(num_stages, int): + self.__sim_method_num_stages = num_stages + else: + raise Exception('Invalid num_stages value. num_stages must be an integer.') + + @num_steps.setter + def num_steps(self, num_steps): + if isinstance(num_steps, int): + self.__sim_method_num_steps = num_steps + else: + raise Exception('Invalid num_steps value. num_steps must be an integer.') + + @newton_iter.setter + def newton_iter(self, newton_iter): + if isinstance(newton_iter, int): + self.__sim_method_newton_iter = newton_iter + else: + raise Exception('Invalid newton_iter value. newton_iter must be an integer.') + + @sens_forw.setter + def sens_forw(self, sens_forw): + if sens_forw in (True, False): + self.__sens_forw = sens_forw + else: + raise Exception('Invalid sens_forw value. sens_forw must be a Boolean.') + + @sens_adj.setter + def sens_adj(self, sens_adj): + if sens_adj in (True, False): + self.__sens_adj = sens_adj + else: + raise Exception('Invalid sens_adj value. sens_adj must be a Boolean.') + + @sens_hess.setter + def sens_hess(self, sens_hess): + if sens_hess in (True, False): + self.__sens_hess = sens_hess + else: + raise Exception('Invalid sens_hess value. sens_hess must be a Boolean.') + + @sens_algebraic.setter + def sens_algebraic(self, sens_algebraic): + if sens_algebraic in (True, False): + self.__sens_algebraic = sens_algebraic + else: + raise Exception('Invalid sens_algebraic value. sens_algebraic must be a Boolean.') + + @output_z.setter + def output_z(self, output_z): + if output_z in (True, False): + self.__output_z = output_z + else: + raise Exception('Invalid output_z value. output_z must be a Boolean.') + + @sim_method_jac_reuse.setter + def sim_method_jac_reuse(self, sim_method_jac_reuse): + if sim_method_jac_reuse in (0, 1): + self.__sim_method_jac_reuse = sim_method_jac_reuse + else: + raise Exception('Invalid sim_method_jac_reuse value. sim_method_jac_reuse must be 0 or 1.') + +class AcadosSim: + """ + The class has the following properties that can be modified to formulate a specific simulation problem, see below: + + :param acados_path: string with the path to acados. It is used to generate the include and lib paths. + + - :py:attr:`dims` of type :py:class:`acados_template.acados_ocp.AcadosSimDims` - are automatically detected from model + - :py:attr:`model` of type :py:class:`acados_template.acados_model.AcadosModel` + - :py:attr:`solver_options` of type :py:class:`acados_template.acados_sim.AcadosSimOpts` + + - :py:attr:`acados_include_path` (set automatically) + - :py:attr:`acados_lib_path` (set automatically) + - :py:attr:`parameter_values` - used to initialize the parameters (can be changed) + + """ + def __init__(self, acados_path=''): + if acados_path == '': + acados_path = get_acados_path() + self.dims = AcadosSimDims() + """Dimension definitions, automatically detected from :py:attr:`model`. Type :py:class:`acados_template.acados_sim.AcadosSimDims`""" + self.model = AcadosModel() + """Model definitions, type :py:class:`acados_template.acados_model.AcadosModel`""" + self.solver_options = AcadosSimOpts() + """Solver Options, type :py:class:`acados_template.acados_sim.AcadosSimOpts`""" + + self.acados_include_path = f'{acados_path}/include' + """Path to acados include directors (set automatically), type: `string`""" + self.acados_lib_path = f'{acados_path}/lib' + """Path to where acados library is located (set automatically), type: `string`""" + + self.code_export_directory = 'c_generated_code' + """Path to where code will be exported. Default: `c_generated_code`.""" + + self.__parameter_values = np.array([]) + + @property + def parameter_values(self): + """:math:`p` - initial values for parameter - can be updated""" + return self.__parameter_values + + @parameter_values.setter + def parameter_values(self, parameter_values): + if isinstance(parameter_values, np.ndarray): + self.__parameter_values = parameter_values + else: + raise Exception('Invalid parameter_values value. ' + + f'Expected numpy array, got {type(parameter_values)}.') + + def set(self, attr, value): + # tokenize string + tokens = attr.split('_', 1) + if len(tokens) > 1: + setter_to_call = getattr(getattr(self, tokens[0]), 'set') + else: + setter_to_call = getattr(self, 'set') + + setter_to_call(tokens[1], value) + + return diff --git a/pyextra/acados_template/acados_sim_layout.json b/pyextra/acados_template/acados_sim_layout.json new file mode 100644 index 000000000..25b149613 --- /dev/null +++ b/pyextra/acados_template/acados_sim_layout.json @@ -0,0 +1,47 @@ +{ + "acados_include_path": [ + "str" + ], + "model": { + "name" : [ + "str" + ] + }, + "acados_lib_path": [ + "str" + ], + "dims": { + "np": [ + "int" + ], + "nu": [ + "int" + ], + "nx": [ + "int" + ], + "nz": [ + "int" + ] + }, + "solver_options": { + "integrator_type": [ + "str" + ], + "collocation_type": [ + "str" + ], + "Tsim": [ + "float" + ], + "sim_method_num_stages": [ + "int" + ], + "sim_method_num_steps": [ + "int" + ], + "sim_method_newton_iter": [ + "int" + ] + } +} diff --git a/pyextra/acados_template/acados_sim_solver.py b/pyextra/acados_template/acados_sim_solver.py new file mode 100644 index 000000000..145f90293 --- /dev/null +++ b/pyextra/acados_template/acados_sim_solver.py @@ -0,0 +1,404 @@ +# -*- coding: future_fstrings -*- +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + +import sys, os, json + +import numpy as np + +from ctypes import * +from copy import deepcopy + +from .generate_c_code_explicit_ode import generate_c_code_explicit_ode +from .generate_c_code_implicit_ode import generate_c_code_implicit_ode +from .generate_c_code_gnsf import generate_c_code_gnsf +from .acados_sim import AcadosSim +from .acados_ocp import AcadosOcp +from .acados_model import acados_model_strip_casadi_symbolics +from .utils import is_column, render_template, format_class_dict, np_array_to_list,\ + make_model_consistent, set_up_imported_gnsf_model, get_python_interface_path + + +def make_sim_dims_consistent(acados_sim): + dims = acados_sim.dims + model = acados_sim.model + # nx + if is_column(model.x): + dims.nx = model.x.shape[0] + else: + raise Exception("model.x should be column vector!") + + # nu + if is_column(model.u): + dims.nu = model.u.shape[0] + elif model.u == None or model.u == []: + dims.nu = 0 + else: + raise Exception("model.u should be column vector or None!") + + # nz + if is_column(model.z): + dims.nz = model.z.shape[0] + elif model.z == None or model.z == []: + dims.nz = 0 + else: + raise Exception("model.z should be column vector or None!") + + # np + if is_column(model.p): + dims.np = model.p.shape[0] + elif model.p == None or model.p == []: + dims.np = 0 + else: + raise Exception("model.p should be column vector or None!") + + +def get_sim_layout(): + python_interface_path = get_python_interface_path() + abs_path = os.path.join(python_interface_path, 'acados_sim_layout.json') + with open(abs_path, 'r') as f: + sim_layout = json.load(f) + return sim_layout + + +def sim_formulation_json_dump(acados_sim, json_file='acados_sim.json'): + # Load acados_sim structure description + sim_layout = get_sim_layout() + + # Copy input sim object dictionary + sim_dict = dict(deepcopy(acados_sim).__dict__) + + for key, v in sim_layout.items(): + # skip non dict attributes + if not isinstance(v, dict): continue + # Copy sim object attributes dictionaries + sim_dict[key]=dict(getattr(acados_sim, key).__dict__) + + sim_dict['model'] = acados_model_strip_casadi_symbolics(sim_dict['model']) + sim_json = format_class_dict(sim_dict) + + with open(json_file, 'w') as f: + json.dump(sim_json, f, default=np_array_to_list, indent=4, sort_keys=True) + + +def sim_render_templates(json_file, model_name, code_export_dir): + # setting up loader and environment + json_path = os.path.join(os.getcwd(), json_file) + + if not os.path.exists(json_path): + raise Exception(f"{json_path} not found!") + + template_dir = code_export_dir + + ## Render templates + in_file = 'acados_sim_solver.in.c' + out_file = f'acados_sim_solver_{model_name}.c' + render_template(in_file, out_file, template_dir, json_path) + + in_file = 'acados_sim_solver.in.h' + out_file = f'acados_sim_solver_{model_name}.h' + render_template(in_file, out_file, template_dir, json_path) + + in_file = 'Makefile.in' + out_file = f'Makefile' + render_template(in_file, out_file, template_dir, json_path) + + in_file = 'main_sim.in.c' + out_file = f'main_sim_{model_name}.c' + render_template(in_file, out_file, template_dir, json_path) + + ## folder model + template_dir = os.path.join(code_export_dir, model_name + '_model') + + in_file = 'model.in.h' + out_file = f'{model_name}_model.h' + render_template(in_file, out_file, template_dir, json_path) + + +def sim_generate_casadi_functions(acados_sim): + model = acados_sim.model + model = make_model_consistent(model) + + integrator_type = acados_sim.solver_options.integrator_type + + opts = dict(generate_hess = acados_sim.solver_options.sens_hess, + code_export_directory = acados_sim.code_export_directory) + # generate external functions + if integrator_type == 'ERK': + generate_c_code_explicit_ode(model, opts) + elif integrator_type == 'IRK': + generate_c_code_implicit_ode(model, opts) + elif integrator_type == 'GNSF': + generate_c_code_gnsf(model, opts) + +class AcadosSimSolver: + """ + Class to interact with the acados integrator C object. + + :param acados_sim: type :py:class:`acados_template.acados_ocp.AcadosOcp` (takes values to generate an instance :py:class:`acados_template.acados_sim.AcadosSim`) or :py:class:`acados_template.acados_sim.AcadosSim` + :param json_file: Default: 'acados_sim.json' + :param build: Default: True + """ + def __init__(self, acados_sim_, json_file='acados_sim.json', build=True): + + self.solver_created = False + + if isinstance(acados_sim_, AcadosOcp): + # set up acados_sim_ + acados_sim = AcadosSim() + acados_sim.model = acados_sim_.model + acados_sim.dims.nx = acados_sim_.dims.nx + acados_sim.dims.nu = acados_sim_.dims.nu + acados_sim.dims.nz = acados_sim_.dims.nz + acados_sim.dims.np = acados_sim_.dims.np + acados_sim.solver_options.integrator_type = acados_sim_.solver_options.integrator_type + acados_sim.code_export_directory = acados_sim_.code_export_directory + + elif isinstance(acados_sim_, AcadosSim): + acados_sim = acados_sim_ + + acados_sim.__problem_class = 'SIM' + + model_name = acados_sim.model.name + make_sim_dims_consistent(acados_sim) + + # reuse existing json and casadi functions, when creating integrator from ocp + if isinstance(acados_sim_, AcadosSim): + if acados_sim.solver_options.integrator_type == 'GNSF': + set_up_imported_gnsf_model(acados_sim) + + sim_generate_casadi_functions(acados_sim) + sim_formulation_json_dump(acados_sim, json_file) + + code_export_dir = acados_sim.code_export_directory + if build: + # render templates + sim_render_templates(json_file, model_name, code_export_dir) + + ## Compile solver + cwd = os.getcwd() + os.chdir(code_export_dir) + os.system('make sim_shared_lib') + os.chdir(cwd) + + self.sim_struct = acados_sim + model_name = self.sim_struct.model.name + self.model_name = model_name + + # Ctypes + shared_lib = f'{code_export_dir}/libacados_sim_solver_{model_name}.so' + self.shared_lib = CDLL(shared_lib) + + + # create capsule + getattr(self.shared_lib, f"{model_name}_acados_sim_solver_create_capsule").restype = c_void_p + self.capsule = getattr(self.shared_lib, f"{model_name}_acados_sim_solver_create_capsule")() + + # create solver + getattr(self.shared_lib, f"{model_name}_acados_sim_create").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_sim_create").restype = c_int + assert getattr(self.shared_lib, f"{model_name}_acados_sim_create")(self.capsule)==0 + self.solver_created = True + + getattr(self.shared_lib, f"{model_name}_acados_get_sim_opts").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_get_sim_opts").restype = c_void_p + self.sim_opts = getattr(self.shared_lib, f"{model_name}_acados_get_sim_opts")(self.capsule) + + getattr(self.shared_lib, f"{model_name}_acados_get_sim_dims").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_get_sim_dims").restype = c_void_p + self.sim_dims = getattr(self.shared_lib, f"{model_name}_acados_get_sim_dims")(self.capsule) + + getattr(self.shared_lib, f"{model_name}_acados_get_sim_config").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_get_sim_config").restype = c_void_p + self.sim_config = getattr(self.shared_lib, f"{model_name}_acados_get_sim_config")(self.capsule) + + getattr(self.shared_lib, f"{model_name}_acados_get_sim_out").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_get_sim_out").restype = c_void_p + self.sim_out = getattr(self.shared_lib, f"{model_name}_acados_get_sim_out")(self.capsule) + + getattr(self.shared_lib, f"{model_name}_acados_get_sim_in").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_get_sim_in").restype = c_void_p + self.sim_in = getattr(self.shared_lib, f"{model_name}_acados_get_sim_in")(self.capsule) + + getattr(self.shared_lib, f"{model_name}_acados_get_sim_solver").argtypes = [c_void_p] + getattr(self.shared_lib, f"{model_name}_acados_get_sim_solver").restype = c_void_p + self.sim_solver = getattr(self.shared_lib, f"{model_name}_acados_get_sim_solver")(self.capsule) + + nu = self.sim_struct.dims.nu + nx = self.sim_struct.dims.nx + nz = self.sim_struct.dims.nz + self.gettable = { + 'x': nx, + 'xn': nx, + 'u': nu, + 'z': nz, + 'S_forw': nx*(nx+nu), + 'Sx': nx*nx, + 'Su': nx*nu, + 'S_adj': nx+nu, + 'S_hess': (nx+nu)*(nx+nu), + 'S_algebraic': (nz)*(nx+nu), + } + + self.settable = ['S_adj', 'T', 'x', 'u', 'xdot', 'z', 'p'] # S_forw + + + def solve(self): + """ + Solve the simulation problem with current input. + """ + getattr(self.shared_lib, f"{self.model_name}_acados_sim_solve").argtypes = [c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_sim_solve").restype = c_int + + status = getattr(self.shared_lib, f"{self.model_name}_acados_sim_solve")(self.capsule) + return status + + + def get(self, field_): + """ + Get the last solution of the solver. + + :param str field: string in ['x', 'u', 'z', 'S_forw', 'Sx', 'Su', 'S_adj', 'S_hess', 'S_algebraic'] + """ + field = field_ + field = field.encode('utf-8') + + if field_ in self.gettable.keys(): + + # allocate array + dims = self.gettable[field_] + out = np.ascontiguousarray(np.zeros((dims,)), dtype=np.float64) + out_data = cast(out.ctypes.data, POINTER(c_double)) + + self.shared_lib.sim_out_get.argtypes = [c_void_p, c_void_p, c_void_p, c_char_p, c_void_p] + self.shared_lib.sim_out_get(self.sim_config, self.sim_dims, self.sim_out, field, out_data) + + if field_ == 'S_forw': + nu = self.sim_struct.dims.nu + nx = self.sim_struct.dims.nx + out = out.reshape(nx, nx+nu, order='F') + elif field_ == 'Sx': + nx = self.sim_struct.dims.nx + out = out.reshape(nx, nx, order='F') + elif field_ == 'Su': + nx = self.sim_struct.dims.nx + nu = self.sim_struct.dims.nu + out = out.reshape(nx, nu, order='F') + elif field_ == 'S_hess': + nx = self.sim_struct.dims.nx + nu = self.sim_struct.dims.nu + out = out.reshape(nx+nu, nx+nu, order='F') + elif field_ == 'S_algebraic': + nx = self.sim_struct.dims.nx + nu = self.sim_struct.dims.nu + nz = self.sim_struct.dims.nz + out = out.reshape(nz, nx+nu, order='F') + else: + raise Exception(f'AcadosSimSolver.get(): Unknown field {field_},' \ + f' available fields are {", ".join(self.gettable.keys())}') + + return out + + + def set(self, field_, value_): + """ + Set numerical data inside the solver. + + :param field: string in ['p', 'S_adj', 'T', 'x', 'u', 'xdot', 'z'] + :param value: the value with appropriate size. + """ + # cast value_ to avoid conversion issues + if isinstance(value_, (float, int)): + value_ = np.array([value_]) + + value_ = value_.astype(float) + value_data = cast(value_.ctypes.data, POINTER(c_double)) + value_data_p = cast((value_data), c_void_p) + + field = field_ + field = field.encode('utf-8') + + # treat parameters separately + if field_ == 'p': + model_name = self.sim_struct.model.name + getattr(self.shared_lib, f"{model_name}_acados_sim_update_params").argtypes = [c_void_p, POINTER(c_double), c_int] + value_data = cast(value_.ctypes.data, POINTER(c_double)) + getattr(self.shared_lib, f"{model_name}_acados_sim_update_params")(self.capsule, value_data, value_.shape[0]) + return + else: + # dimension check + dims = np.ascontiguousarray(np.zeros((2,)), dtype=np.intc) + dims_data = cast(dims.ctypes.data, POINTER(c_int)) + + self.shared_lib.sim_dims_get_from_attr.argtypes = [c_void_p, c_void_p, c_char_p, POINTER(c_int)] + self.shared_lib.sim_dims_get_from_attr(self.sim_config, self.sim_dims, field, dims_data) + + value_ = np.ravel(value_, order='F') + + value_shape = value_.shape + if len(value_shape) == 1: + value_shape = (value_shape[0], 0) + + if value_shape != tuple(dims): + raise Exception('AcadosSimSolver.set(): mismatching dimension' \ + ' for field "{}" with dimension {} (you have {})'.format(field_, tuple(dims), value_shape)) + + # set + if field_ in ['xdot', 'z']: + self.shared_lib.sim_solver_set.argtypes = [c_void_p, c_char_p, c_void_p] + self.shared_lib.sim_solver_set(self.sim_solver, field, value_data_p) + elif field_ in self.settable: + self.shared_lib.sim_in_set.argtypes = [c_void_p, c_void_p, c_void_p, c_char_p, c_void_p] + self.shared_lib.sim_in_set(self.sim_config, self.sim_dims, self.sim_in, field, value_data_p) + else: + raise Exception(f'AcadosSimSolver.set(): Unknown field {field_},' \ + f' available fields are {", ".join(self.settable)}') + + return + + + def __del__(self): + + if self.solver_created: + getattr(self.shared_lib, f"{self.model_name}_acados_sim_free").argtypes = [c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_sim_free").restype = c_int + getattr(self.shared_lib, f"{self.model_name}_acados_sim_free")(self.capsule) + + getattr(self.shared_lib, f"{self.model_name}_acados_sim_solver_free_capsule").argtypes = [c_void_p] + getattr(self.shared_lib, f"{self.model_name}_acados_sim_solver_free_capsule").restype = c_int + getattr(self.shared_lib, f"{self.model_name}_acados_sim_solver_free_capsule")(self.capsule) + + try: + self.dlclose(self.shared_lib._handle) + except: + pass diff --git a/pyextra/acados_template/acados_solver_common.pxd b/pyextra/acados_template/acados_solver_common.pxd new file mode 100644 index 000000000..9314802e6 --- /dev/null +++ b/pyextra/acados_template/acados_solver_common.pxd @@ -0,0 +1,102 @@ +# -*- coding: future_fstrings -*- +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + + +cdef extern from "acados/ocp_nlp/ocp_nlp_common.h": + ctypedef struct ocp_nlp_config: + pass + + ctypedef struct ocp_nlp_dims: + pass + + ctypedef struct ocp_nlp_in: + pass + + ctypedef struct ocp_nlp_out: + pass + + +cdef extern from "acados_c/ocp_nlp_interface.h": + ctypedef enum ocp_nlp_solver_t: + pass + + ctypedef enum ocp_nlp_cost_t: + pass + + ctypedef enum ocp_nlp_dynamics_t: + pass + + ctypedef enum ocp_nlp_constraints_t: + pass + + ctypedef enum ocp_nlp_reg_t: + pass + + ctypedef struct ocp_nlp_plan: + pass + + ctypedef struct ocp_nlp_solver: + pass + + int ocp_nlp_cost_model_set(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in_, + int start_stage, const char *field, void *value) + int ocp_nlp_constraints_model_set(ocp_nlp_config *config, ocp_nlp_dims *dims, + ocp_nlp_in *in_, int stage, const char *field, void *value) + + # out + void ocp_nlp_out_set(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_out *out, + int stage, const char *field, void *value) + void ocp_nlp_out_get(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_out *out, + int stage, const char *field, void *value) + void ocp_nlp_get_at_stage(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_solver *solver, + int stage, const char *field, void *value) + int ocp_nlp_dims_get_from_attr(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_out *out, + int stage, const char *field) + void ocp_nlp_constraint_dims_get_from_attr(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_out *out, + int stage, const char *field, int *dims_out) + void ocp_nlp_cost_dims_get_from_attr(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_out *out, + int stage, const char *field, int *dims_out) + void ocp_nlp_dynamics_dims_get_from_attr(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_out *out, + int stage, const char *field, int *dims_out) + + # opts + void ocp_nlp_solver_opts_set(ocp_nlp_config *config, void *opts_, const char *field, void* value) + + # solver + void ocp_nlp_eval_residuals(ocp_nlp_solver *solver, ocp_nlp_in *nlp_in, ocp_nlp_out *nlp_out) + void ocp_nlp_eval_cost(ocp_nlp_solver *solver, ocp_nlp_in *nlp_in_, ocp_nlp_out *nlp_out) + + # get/set + void ocp_nlp_get(ocp_nlp_config *config, ocp_nlp_solver *solver, const char *field, void *return_value_) + void ocp_nlp_set(ocp_nlp_config *config, ocp_nlp_solver *solver, int stage, const char *field, void *value) diff --git a/pyextra/acados_template/c_templates_tera/CPPLINT.cfg b/pyextra/acados_template/c_templates_tera/CPPLINT.cfg new file mode 100644 index 000000000..bbd1caf05 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/CPPLINT.cfg @@ -0,0 +1 @@ +exclude_files=[main, acados_solver, acados_solver_sfun, Makefile, model].*\.? diff --git a/pyextra/acados_template/c_templates_tera/Makefile.in b/pyextra/acados_template/c_templates_tera/Makefile.in new file mode 100644 index 000000000..487e66ab0 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/Makefile.in @@ -0,0 +1,524 @@ +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + +{%- if solver_options.qp_solver %} + {%- set qp_solver = solver_options.qp_solver %} +{%- else %} + {%- set qp_solver = "FULL_CONDENSING_HPIPM" %} +{%- endif %} + +{%- if solver_options.hessian_approx %} + {%- set hessian_approx = solver_options.hessian_approx %} +{%- elif solver_options.sens_hess %} + {%- set hessian_approx = "EXACT" %} +{%- else %} + {%- set hessian_approx = "GAUSS_NEWTON" %} +{%- endif %} + +{%- if constraints.constr_type %} + {%- set constr_type = constraints.constr_type %} +{%- else %} + {%- set constr_type = "NONE" %} +{%- endif %} + +{%- if constraints.constr_type_e %} + {%- set constr_type_e = constraints.constr_type_e %} +{%- else %} + {%- set constr_type_e = "NONE" %} +{%- endif %} + +{%- if cost.cost_type %} + {%- set cost_type = cost.cost_type %} +{%- else %} + {%- set cost_type = "NONE" %} +{%- endif %} + +{%- if cost.cost_type_e %} + {%- set cost_type_e = cost.cost_type_e %} +{%- else %} + {%- set cost_type_e = "NONE" %} +{%- endif %} + +{%- if cost.cost_type_0 %} + {%- set cost_type_0 = cost.cost_type_0 %} +{%- else %} + {%- set cost_type_0 = "NONE" %} +{%- endif %} + +{%- if dims.nh %} + {%- set dims_nh = dims.nh %} +{%- else %} + {%- set dims_nh = 0 %} +{%- endif %} + +{%- if dims.nphi %} + {%- set dims_nphi = dims.nphi %} +{%- else %} + {%- set dims_nphi = 0 %} +{%- endif %} + +{%- if dims.nh_e %} + {%- set dims_nh_e = dims.nh_e %} +{%- else %} + {%- set dims_nh_e = 0 %} +{%- endif %} + +{%- if dims.nphi_e %} + {%- set dims_nphi_e = dims.nphi_e %} +{%- else %} + {%- set dims_nphi_e = 0 %} +{%- endif %} +{%- if solver_options.model_external_shared_lib_dir %} + {%- set model_external_shared_lib_dir = solver_options.model_external_shared_lib_dir %} +{%- endif %} +{%- if solver_options.model_external_shared_lib_name %} + {%- set model_external_shared_lib_name = solver_options.model_external_shared_lib_name %} +{%- endif %} + +{# control operator #} +{%- if os and os == "pc" %} + {%- set control = "&" %} +{%- else %} + {%- set control = ";" %} +{%- endif %} + +{# acados linking libraries and flags #} +{%- if acados_link_libs and os and os == "pc" %} + {%- set link_libs = acados_link_libs.qpoases ~ " " ~ acados_link_libs.hpmpc ~ " " ~ acados_link_libs.osqp -%} + {%- set openmp_flag = acados_link_libs.openmp %} +{%- else %} + {%- set openmp_flag = " " %} + {%- if qp_solver == "FULL_CONDENSING_QPOASES" %} + {%- set link_libs = "-lqpOASES_e" %} + {%- else %} + {%- set link_libs = "" %} + {%- endif %} +{%- endif %} + +{# acados flags #} +ACADOS_FLAGS = -fPIC -std=c99 {{ openmp_flag }} #-fno-diagnostics-show-line-numbers -g +{%- if qp_solver == "FULL_CONDENSING_QPOASES" %} +ACADOS_FLAGS += -DACADOS_WITH_QPOASES +{%- endif %} +{%- if qp_solver == "PARTIAL_CONDENSING_OSQP" %} +ACADOS_FLAGS += -DACADOS_WITH_OSQP +{%- endif %} +{%- if qp_solver == "PARTIAL_CONDENSING_QPDUNES" %} +ACADOS_FLAGS += -DACADOS_WITH_QPDUNES +{%- endif %} +# # Debugging +# ACADOS_FLAGS += -g3 + +MODEL_OBJ= +{%- if solver_options.integrator_type == "ERK" %} +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_expl_ode_fun.o +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_expl_vde_forw.o +{%- if hessian_approx == "EXACT" %} +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_expl_ode_hess.o +{%- endif %} +{%- elif solver_options.integrator_type == "IRK" %} +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_impl_dae_fun.o +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_impl_dae_fun_jac_x_xdot_z.o +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_impl_dae_jac_x_xdot_u_z.o +{%- if hessian_approx == "EXACT" %} +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_impl_dae_hess.o +{%- endif %} +{%- elif solver_options.integrator_type == "LIFTED_IRK" %} +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_impl_dae_fun.o +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_impl_dae_fun_jac_x_xdot_u.o +{%- if hessian_approx == "EXACT" %} +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_impl_dae_hess.o +{%- endif %} +{%- elif solver_options.integrator_type == "GNSF" %} +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_gnsf_phi_fun.o +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_gnsf_phi_fun_jac_y.o +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_gnsf_phi_jac_y_uhat.o +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz.o +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_gnsf_get_matrices_fun.o +{%- elif solver_options.integrator_type == "DISCRETE" %} +{%- if model.dyn_ext_fun_type == "casadi" %} +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_dyn_disc_phi_fun.o +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_dyn_disc_phi_fun_jac.o +{%- if hessian_approx == "EXACT" %} +MODEL_OBJ+= {{ model.name }}_model/{{ model.name }}_dyn_disc_phi_fun_jac_hess.o +{%- endif %} +{%- else %} +MODEL_OBJ+= {{ model.name }}_model/{{ model.dyn_source_discrete }} +{%- endif %} +{%- endif %} + + +OCP_OBJ= +{%- if constr_type == "BGP" and dims_nphi > 0 %} +OCP_OBJ+= {{ model.name }}_constraints/{{ model.name }}_phi_constraint.o +{%- endif %} +{%- if constr_type_e == "BGP" and dims_nphi_e > 0 %} +OCP_OBJ+= {{ model.name }}_constraints/{{ model.name }}_phi_e_constraint.o +{%- endif %} + +{%- if constr_type == "BGH" and dims_nh > 0 %} +OCP_OBJ+= {{ model.name }}_constraints/{{ model.name }}_constr_h_fun_jac_uxt_zt.o +OCP_OBJ+= {{ model.name }}_constraints/{{ model.name }}_constr_h_fun.o +{%- if hessian_approx == "EXACT" %} +OCP_OBJ+= {{ model.name }}_constraints/{{ model.name }}_constr_h_fun_jac_uxt_zt_hess.o +{%- endif %} +{%- endif %} + +{%- if constr_type_e == "BGH" and dims_nh_e > 0 %} +OCP_OBJ+= {{ model.name }}_constraints/{{ model.name }}_constr_h_e_fun_jac_uxt_zt.o +OCP_OBJ+= {{ model.name }}_constraints/{{ model.name }}_constr_h_e_fun.o +{%- if hessian_approx == "EXACT" %} +OCP_OBJ+= {{ model.name }}_constraints/{{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess.o +{%- endif %} +{%- endif %} + +{%- if cost_type_0 == "NONLINEAR_LS" %} +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_y_0_fun.c +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_y_0_fun_jac_ut_xt.c +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_y_0_hess.c +{%- elif cost_type_0 == "EXTERNAL" %} +{% if cost.cost_ext_fun_type_0 == "casadi" %} +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_ext_cost_0_fun.c +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_ext_cost_0_fun_jac.c +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_ext_cost_0_fun_jac_hess.c +{% else %} +OCP_OBJ+= {{ model.name }}_cost/{{ cost.cost_source_ext_cost_0 }} +{% endif %} +{%- endif %} +{%- if cost_type == "NONLINEAR_LS" %} +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_y_fun.c +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_y_fun_jac_ut_xt.c +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_y_hess.c +{%- elif cost_type == "EXTERNAL" %} +{% if cost.cost_ext_fun_type == "casadi" %} +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_ext_cost_fun.c +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_ext_cost_fun_jac.c +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_ext_cost_fun_jac_hess.c +{% elif cost.cost_source_ext_cost != cost.cost_source_ext_cost_0 %} +OCP_OBJ+= {{ model.name }}_cost/{{ cost.cost_source_ext_cost }} +{% endif %} +{%- endif %} +{%- if cost_type_e == "NONLINEAR_LS" %} +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_y_e_fun.c +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_y_e_fun_jac_ut_xt.c +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_y_e_hess.c +{%- elif cost_type_e == "EXTERNAL" %} +{% if cost.cost_ext_fun_type_e == "casadi" %} +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_ext_cost_e_fun.c +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_ext_cost_e_fun_jac.c +OCP_OBJ+= {{ model.name }}_cost/{{ model.name }}_cost_ext_cost_e_fun_jac_hess.c +{% elif cost.cost_source_ext_cost_e != cost.cost_source_ext_cost_0 %} +OCP_OBJ+= {{ model.name }}_cost/{{ cost.cost_source_ext_cost_e }} +{% endif %} +{%- endif %} +OCP_OBJ+= acados_solver_{{ model.name }}.o + + +SIM_OBJ= +SIM_OBJ+= acados_sim_solver_{{ model.name }}.o + +EX_OBJ= +EX_OBJ+= main_{{ model.name }}.o + +EX_SIM_OBJ= +EX_SIM_OBJ+= main_sim_{{ model.name }}.o + +OBJ= +OBJ+= $(MODEL_OBJ) +{%- if solver_options.integrator_type != "DISCRETE" %} +OBJ+= $(SIM_OBJ) +{%- endif %} +OBJ+= $(OCP_OBJ) + +EXTERNAL_DIR= +EXTERNAL_LIB= + +{%- if model_external_shared_lib_dir and model_external_shared_lib_name %} +EXTERNAL_DIR+= {{ model_external_shared_lib_dir }} +EXTERNAL_LIB+= {{ model_external_shared_lib_name }} +{%- endif %} + +INCLUDE_PATH = {{ acados_include_path }} +LIB_PATH = {{ acados_lib_path }} + +{%- if solver_options.integrator_type == "DISCRETE" %} +all: clean casadi_fun example +shared_lib: ocp_shared_lib +{%- else %} +all: clean casadi_fun example_sim example +shared_lib: bundled_shared_lib ocp_shared_lib sim_shared_lib +{%- endif %} + +CASADI_MODEL_SOURCE= +{%- if solver_options.integrator_type == "ERK" %} +CASADI_MODEL_SOURCE+= {{ model.name }}_expl_ode_fun.c +CASADI_MODEL_SOURCE+= {{ model.name }}_expl_vde_forw.c +{%- if hessian_approx == "EXACT" %} +CASADI_MODEL_SOURCE+= {{ model.name }}_expl_ode_hess.c +{%- endif %} +{%- elif solver_options.integrator_type == "IRK" %} +CASADI_MODEL_SOURCE+= {{ model.name }}_impl_dae_fun.c +CASADI_MODEL_SOURCE+= {{ model.name }}_impl_dae_fun_jac_x_xdot_z.c +CASADI_MODEL_SOURCE+= {{ model.name }}_impl_dae_jac_x_xdot_u_z.c +{%- if hessian_approx == "EXACT" %} +CASADI_MODEL_SOURCE+= {{ model.name }}_impl_dae_hess.c +{%- endif %} +{%- elif solver_options.integrator_type == "LIFTED_IRK" %} +CASADI_MODEL_SOURCE+= {{ model.name }}_impl_dae_fun.c +# CASADI_MODEL_SOURCE+= {{ model.name }}_impl_dae_fun_jac_x_xdot_z.c +# CASADI_MODEL_SOURCE+= {{ model.name }}_impl_dae_jac_x_xdot_u_z.c +CASADI_MODEL_SOURCE+= {{ model.name }}_impl_dae_fun_jac_x_xdot_u.c +{%- if hessian_approx == "EXACT" %} +CASADI_MODEL_SOURCE+= {{ model.name }}_impl_dae_hess.c +{%- endif %} +{%- elif solver_options.integrator_type == "GNSF" %} +CASADI_MODEL_SOURCE+= {{ model.name }}_gnsf_phi_fun.c +CASADI_MODEL_SOURCE+= {{ model.name }}_gnsf_phi_fun_jac_y.c +CASADI_MODEL_SOURCE+= {{ model.name }}_gnsf_phi_jac_y_uhat.c +CASADI_MODEL_SOURCE+= {{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz.c +CASADI_MODEL_SOURCE+= {{ model.name }}_gnsf_get_matrices_fun.c +{%- elif solver_options.integrator_type == "DISCRETE" and model.dyn_ext_fun_type == "casadi" %} +CASADI_MODEL_SOURCE+= {{ model.name }}_dyn_disc_phi_fun.c +CASADI_MODEL_SOURCE+= {{ model.name }}_dyn_disc_phi_fun_jac.c +{%- if hessian_approx == "EXACT" %} +CASADI_MODEL_SOURCE+= {{ model.name }}_dyn_disc_phi_fun_jac_hess.c +{%- endif %} +{%- endif %} +{%- if constr_type == "BGP" and dims_nphi > 0 %} +CASADI_CON_PHI_SOURCE= +CASADI_CON_PHI_SOURCE+= {{ model.name }}_phi_constraint.c +{%- endif %} +{%- if constr_type_e == "BGP" and dims_nphi_e > 0 %} +CASADI_CON_PHI_E_SOURCE= +CASADI_CON_PHI_E_SOURCE+= {{ model.name }}_phi_e_constraint.c +{%- endif %} +{%- if constr_type == "BGH" and dims_nh > 0 %} +CASADI_CON_H_SOURCE= +CASADI_CON_H_SOURCE+= {{ model.name }}_constr_h_fun_jac_uxt_zt.c +CASADI_CON_H_SOURCE+= {{ model.name }}_constr_h_fun.c +{%- if hessian_approx == "EXACT" %} +CASADI_CON_H_SOURCE+= {{ model.name }}_constr_h_fun_jac_uxt_zt_hess.c +{%- endif %} +{%- endif %} + +{%- if dims_nh_e > 0 %} +CASADI_CON_H_E_SOURCE= +CASADI_CON_H_E_SOURCE+= {{ model.name }}_constr_h_e_fun_jac_uxt_zt.c +CASADI_CON_H_E_SOURCE+= {{ model.name }}_constr_h_e_fun.c +{%- if hessian_approx == "EXACT" %} +CASADI_CON_H_E_SOURCE+= {{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess.c +{%- endif %} +{%- endif %} + +{%- if cost_type == "NONLINEAR_LS" %} +CASADI_COST_Y_SOURCE= +CASADI_COST_Y_SOURCE+= {{ model.name }}_cost_y_fun.c +CASADI_COST_Y_SOURCE+= {{ model.name }}_cost_y_fun_jac_ut_xt.c +CASADI_COST_Y_SOURCE+= {{ model.name }}_cost_y_hess.c +{%- endif %} +{%- if cost_type_e == "NONLINEAR_LS" %} +CASADI_COST_Y_E_SOURCE= +CASADI_COST_Y_E_SOURCE+= {{ model.name }}_cost_y_e_fun.c +CASADI_COST_Y_E_SOURCE+= {{ model.name }}_cost_y_e_fun_jac_ut_xt.c +CASADI_COST_Y_E_SOURCE+= {{ model.name }}_cost_y_e_hess.c +{%- endif %} +{%- if cost_type_0 == "NONLINEAR_LS" %} +CASADI_COST_Y_0_SOURCE= +CASADI_COST_Y_0_SOURCE+= {{ model.name }}_cost_y_0_fun.c +CASADI_COST_Y_0_SOURCE+= {{ model.name }}_cost_y_0_fun_jac_ut_xt.c +CASADI_COST_Y_0_SOURCE+= {{ model.name }}_cost_y_0_hess.c +{%- endif %} + +casadi_fun: + {%- if model.dyn_ext_fun_type == "casadi" %} + ( cd {{ model.name }}_model {{ control }} gcc $(ACADOS_FLAGS) -c $(CASADI_MODEL_SOURCE)) + {%- endif %} + {%- if constr_type == "BGP" and dims_nphi > 0 %} + ( cd {{ model.name }}_constraints {{ control }} gcc $(ACADOS_FLAGS) -c $(CASADI_CON_PHI_SOURCE)) + {%- endif %} + {%- if constr_type_e == "BGP" and dims_nphi_e > 0 %} + ( cd {{ model.name }}_constraints {{ control }} gcc $(ACADOS_FLAGS) -c $(CASADI_CON_PHI_E_SOURCE)) + {%- endif %} + {%- if constr_type == "BGH" and dims_nh > 0 %} + ( cd {{ model.name }}_constraints {{ control }} gcc $(ACADOS_FLAGS) -c $(CASADI_CON_H_SOURCE)) + {%- endif %} + {%- if constr_type_e == "BGH" and dims_nh_e > 0 %} + ( cd {{ model.name }}_constraints {{ control }} gcc $(ACADOS_FLAGS) -c $(CASADI_CON_H_E_SOURCE)) + {%- endif %} + {%- if cost_type == "NONLINEAR_LS" %} + ( cd {{ model.name }}_cost {{ control }} gcc $(ACADOS_FLAGS) -c $(CASADI_COST_Y_SOURCE)) + {%- endif %} + {%- if cost_type_e == "NONLINEAR_LS" %} + ( cd {{ model.name }}_cost {{ control }} gcc $(ACADOS_FLAGS) -c $(CASADI_COST_Y_E_SOURCE)) + {%- endif %} + {%- if cost_type_0 == "NONLINEAR_LS" %} + ( cd {{ model.name }}_cost {{ control }} gcc $(ACADOS_FLAGS) -c $(CASADI_COST_Y_0_SOURCE)) + {%- endif %} + +main: + gcc $(ACADOS_FLAGS) -c main_{{ model.name }}.c -I $(INCLUDE_PATH)/blasfeo/include/ -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) -I $(INCLUDE_PATH)/acados/ \ + {%- if qp_solver == "FULL_CONDENSING_QPOASES" %} + -I $(INCLUDE_PATH)/qpOASES_e/ + {%- endif %} + +main_sim: + gcc $(ACADOS_FLAGS) -c main_sim_{{ model.name }}.c -I $(INCLUDE_PATH)/blasfeo/include/ -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) -I $(INCLUDE_PATH)/acados/ + +ocp_solver: + gcc $(ACADOS_FLAGS) -c acados_solver_{{ model.name }}.c -I $(INCLUDE_PATH)/blasfeo/include/ -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) -I $(INCLUDE_PATH)/acados/ \ + {%- if qp_solver == "FULL_CONDENSING_QPOASES" %} + -I $(INCLUDE_PATH)/qpOASES_e/ + {%- endif %} + +sim_solver: + gcc $(ACADOS_FLAGS) -c acados_sim_solver_{{ model.name }}.c -I $(INCLUDE_PATH)/blasfeo/include/ -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) -I $(INCLUDE_PATH)/acados/ \ + {%- if qp_solver == "FULL_CONDENSING_QPOASES" %} + -I $(INCLUDE_PATH)/qpOASES_e/ + {%- endif %} + +example: ocp_solver main + gcc $(ACADOS_FLAGS) -o main_{{ model.name }} $(EX_OBJ) $(OBJ) -L $(LIB_PATH) \ + -lacados -lhpipm -lblasfeo \ + {{ link_libs }} \ + -lm \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) \ + -I $(INCLUDE_PATH)/acados/ \ + {%- if qp_solver == "FULL_CONDENSING_QPOASES" %} + -I $(INCLUDE_PATH)/qpOASES_e/ + {%- endif %} + + +example_sim: sim_solver main_sim + gcc $(ACADOS_FLAGS) -o main_sim_{{ model.name }} $(EX_SIM_OBJ) $(MODEL_OBJ) $(SIM_OBJ) -L $(LIB_PATH) \ + -lacados -lhpipm -lblasfeo \ + {{ link_libs }} \ + -lm \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/acados/ \ + +{%- if solver_options.integrator_type != "DISCRETE" %} + +bundled_shared_lib: casadi_fun ocp_solver sim_solver + gcc $(ACADOS_FLAGS) -shared -o libacados_solver_{{ model.name }}.so $(OBJ) \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) \ + -L $(LIB_PATH) \ + -lacados -lhpipm -lblasfeo \ + {{ link_libs }} \ + -lm \ + +ocp_shared_lib: casadi_fun ocp_solver + gcc $(ACADOS_FLAGS) -shared -o libacados_ocp_solver_{{ model.name }}.so $(OCP_OBJ) $(MODEL_OBJ) \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) \ + -L$(EXTERNAL_DIR) -l$(EXTERNAL_LIB) \ + -L $(LIB_PATH) -lacados -lhpipm -lblasfeo \ + {{ link_libs }} \ + -lm \ + +{%- else %} + +ocp_shared_lib: casadi_fun ocp_solver + gcc $(ACADOS_FLAGS) -shared -o libacados_ocp_solver_{{ model.name }}.so $(OCP_OBJ) $(MODEL_OBJ) \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) \ + -L$(EXTERNAL_DIR) -l$(EXTERNAL_LIB) \ + -L $(LIB_PATH) -lacados -lhpipm -lblasfeo \ + {{ link_libs }} \ + -lm \ + +{%- endif %} + +ocp_cython_c: ocp_shared_lib + cython \ + -o acados_ocp_solver_pyx.c \ + -I $(INCLUDE_PATH)/../interfaces/acados_template/acados_template \ + $(INCLUDE_PATH)/../interfaces/acados_template/acados_template/acados_ocp_solver_pyx.pyx \ + +ocp_cython_o: ocp_cython_c + clang $(ACADOS_FLAGS) -c -O2 \ + -o acados_ocp_solver_pyx.o \ + -I /usr/include/python3.8 \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) \ + acados_ocp_solver_pyx.c \ + +ocp_cython: ocp_cython_o + clang $(ACADOS_FLAGS) -shared \ + -o acados_ocp_solver_pyx.so \ + -Wl,-rpath=$(LIB_PATH) \ + acados_ocp_solver_pyx.o \ + $(abspath .)/libacados_ocp_solver_{{ model.name }}.so \ + -L $(LIB_PATH) -lacados -lhpipm -lblasfeo -lqpOASES_e \ + {{ link_libs }} \ + -lm \ + +sim_shared_lib: casadi_fun sim_solver + gcc $(ACADOS_FLAGS) -shared -o libacados_sim_solver_{{ model.name }}.so $(SIM_OBJ) $(MODEL_OBJ) -L$(EXTERNAL_DIR) -l$(EXTERNAL_LIB) \ + -L $(LIB_PATH) -lacados -lhpipm -lblasfeo \ + {{ link_libs }} \ + -lm \ + +{%- if os and os == "pc" %} + +clean: + del \Q *.o 2>nul + del \Q *.so 2>nul + del \Q main_{{ model.name }} 2>nul + +clean_ocp_shared_lib: + del \Q libacados_ocp_solver_{{ model.name }}.so 2>nul + del \Q acados_solver_{{ model.name }}.o 2>nul + +{%- else %} + +clean: + rm -f *.o + rm -f *.so + rm -f main_{{ model.name }} + +clean_ocp_shared_lib: + rm -f libacados_ocp_solver_{{ model.name }}.so + rm -f acados_solver_{{ model.name }}.o + +{%- endif %} diff --git a/pyextra/acados_template/c_templates_tera/acados_mex_create.in.c b/pyextra/acados_template/c_templates_tera/acados_mex_create.in.c new file mode 100644 index 000000000..251b249b2 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/acados_mex_create.in.c @@ -0,0 +1,383 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +// standard +#include +#include +#include + +// acados +#include "acados/utils/print.h" +#include "acados_c/ocp_nlp_interface.h" +#include "acados_solver_{{ model.name }}.h" + +// mex +#include "mex.h" + + +void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) +{ + long long *l_ptr; + int status = 0; + + // create solver + {{ model.name }}_solver_capsule *acados_ocp_capsule = {{ model.name }}_acados_create_capsule(); + + status = {{ model.name }}_acados_create(acados_ocp_capsule); + + if (status) + { + mexPrintf("{{ model.name }}_acados_create() returned status %d.\n", status); + } + mexPrintf("{{ model.name }}_acados_create() -> success!\n"); + + // get pointers to nlp solver related objects + ocp_nlp_plan *nlp_plan = {{ model.name }}_acados_get_nlp_plan(acados_ocp_capsule); + ocp_nlp_config *nlp_config = {{ model.name }}_acados_get_nlp_config(acados_ocp_capsule); + ocp_nlp_dims *nlp_dims = {{ model.name }}_acados_get_nlp_dims(acados_ocp_capsule); + ocp_nlp_in *nlp_in = {{ model.name }}_acados_get_nlp_in(acados_ocp_capsule); + ocp_nlp_out *nlp_out = {{ model.name }}_acados_get_nlp_out(acados_ocp_capsule); + ocp_nlp_solver *nlp_solver = {{ model.name }}_acados_get_nlp_solver(acados_ocp_capsule); + void *nlp_opts = {{ model.name }}_acados_get_nlp_opts(acados_ocp_capsule); + + // mexPrintf("acados: got pointer to objectes!\n"); + + // field names of output struct + #define FIELDS_OCP 9 + #define FIELDS_EXT_FUN 25 + #define MAX_FIELDS 25 + char *fieldnames[MAX_FIELDS]; + + for (int i = 0; i < MAX_FIELDS; i++) + { + fieldnames[i] = (char*) mxMalloc(50); + } + + memcpy(fieldnames[0],"config",sizeof("config")); + memcpy(fieldnames[1],"dims",sizeof("dims")); + memcpy(fieldnames[2],"opts",sizeof("opts")); + memcpy(fieldnames[3],"in",sizeof("in")); + memcpy(fieldnames[4],"out",sizeof("out")); + memcpy(fieldnames[5],"solver",sizeof("solver")); + memcpy(fieldnames[6],"sens_out",sizeof("sens_out")); + memcpy(fieldnames[7],"plan",sizeof("plan")); + memcpy(fieldnames[8],"capsule",sizeof("capsule")); + + // create output struct - C_ocp + plhs[0] = mxCreateStructMatrix(1, 1, 9, (const char **) fieldnames); + + // MEX: config, dims, opts, in, out, solver, sens_out, plan + // plan + mxArray *plan_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(plan_mat); + l_ptr[0] = (long long) nlp_plan; + mxSetField(plhs[0], 0, "plan", plan_mat); + + // config + mxArray *config_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(config_mat); + l_ptr[0] = (long long) nlp_config; + mxSetField(plhs[0], 0, "config", config_mat); + + // dims + mxArray *dims_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(dims_mat); + l_ptr[0] = (long long) nlp_dims; + mxSetField(plhs[0], 0, "dims", dims_mat); + + // opts + mxArray *opts_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(opts_mat); + l_ptr[0] = (long long) nlp_opts; + mxSetField(plhs[0], 0, "opts", opts_mat); + + // in + mxArray *in_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(in_mat); + l_ptr[0] = (long long) nlp_in; + mxSetField(plhs[0], 0, "in", in_mat); + + // out + mxArray *out_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(out_mat); + l_ptr[0] = (long long) nlp_out; + mxSetField(plhs[0], 0, "out", out_mat); + + // solver + mxArray *solver_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(solver_mat); + l_ptr[0] = (long long) nlp_solver; + mxSetField(plhs[0], 0, "solver", solver_mat); + + // TODO: sens_out not actually implemented in templates.. + // sens_out + mxArray *sens_out_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(sens_out_mat); + l_ptr[0] = (long long) 1; + mxSetField(plhs[0], 0, "sens_out", sens_out_mat); + + // capsule + mxArray *capsule_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(capsule_mat); + l_ptr[0] = (long long) acados_ocp_capsule; + mxSetField(plhs[0], 0, "capsule", capsule_mat); + + /* store external function pointers */ + // dyn + memcpy(fieldnames[0],"expl_ode_fun",sizeof("expl_ode_fun")); + memcpy(fieldnames[1],"forw_vde",sizeof("forw_vde")); + memcpy(fieldnames[2],"hess_vde",sizeof("hess_vde")); + memcpy(fieldnames[3],"impl_dae_fun",sizeof("impl_dae_fun")); + memcpy(fieldnames[4],"impl_dae_fun_jac_x_xdot_z",sizeof("impl_dae_fun_jac_x_xdot_z")); + memcpy(fieldnames[5],"impl_dae_jac_x_xdot_u_z",sizeof("impl_dae_jac_x_xdot_u_z")); + memcpy(fieldnames[6],"impl_dae_hess",sizeof("impl_dae_hess")); + + memcpy(fieldnames[7],"gnsf_phi_fun",sizeof("gnsf_phi_fun")); + memcpy(fieldnames[8],"gnsf_phi_fun_jac_y",sizeof("gnsf_phi_fun_jac_y")); + memcpy(fieldnames[9],"gnsf_phi_jac_y_uhat",sizeof("gnsf_phi_jac_y_uhat")); + memcpy(fieldnames[10],"gnsf_f_lo_jac_x1_x1dot_u_z",sizeof("gnsf_f_lo_jac_x1_x1dot_u_z")); + memcpy(fieldnames[11],"gnsf_get_matrices_fun",sizeof("gnsf_get_matrices_fun")); + + memcpy(fieldnames[12],"disc_phi_fun",sizeof("disc_phi_fun")); + memcpy(fieldnames[13],"disc_phi_fun_jac",sizeof("disc_phi_fun_jac")); + memcpy(fieldnames[14],"disc_phi_fun_jac_hess",sizeof("disc_phi_fun_jac_hess")); + + // cost + memcpy(fieldnames[15],"cost_y_fun",sizeof("cost_y_fun")); + memcpy(fieldnames[16],"cost_y_fun_jac_ut_xt",sizeof("cost_y_fun_jac_ut_xt")); + memcpy(fieldnames[17],"cost_y_hess",sizeof("cost_y_hess")); + memcpy(fieldnames[18],"ext_cost_fun",sizeof("ext_cost_fun")); + memcpy(fieldnames[19],"ext_cost_fun_jac",sizeof("ext_cost_fun_jac")); + memcpy(fieldnames[20],"ext_cost_fun_jac_hess",sizeof("ext_cost_fun_jac_hess")); + + // constraints + memcpy(fieldnames[21],"phi_constraint",sizeof("phi_constraint")); + memcpy(fieldnames[22],"nl_constr_h_fun_jac",sizeof("nl_constr_h_fun_jac")); + memcpy(fieldnames[23],"nl_constr_h_fun",sizeof("nl_constr_h_fun")); + memcpy(fieldnames[24],"nl_constr_h_fun_jac_hess",sizeof("nl_constr_h_fun_jac_hess")); + + + // create output struct - C_ocp_ext_fun + plhs[1] = mxCreateStructMatrix(1, 1, FIELDS_EXT_FUN, (const char **) fieldnames); + + + for (int i = 0; i < FIELDS_EXT_FUN; i++) + { + mxFree( fieldnames[i] ); + } + +/* dynamics */ + mxArray *expl_ode_fun_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + mxArray *forw_vde_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + mxArray *hess_vde_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + mxArray *impl_dae_fun_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + mxArray *impl_dae_fun_jac_x_xdot_z_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + mxArray *impl_dae_jac_x_xdot_u_z_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + mxArray *impl_dae_hess_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + + mxArray *gnsf_phi_fun_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + mxArray *gnsf_phi_fun_jac_y_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + mxArray *gnsf_phi_jac_y_uhat_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + mxArray *gnsf_f_lo_jac_x1_x1dot_u_z_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + mxArray *gnsf_get_matrices_fun_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + + mxArray *disc_phi_fun_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + mxArray *disc_phi_fun_jac_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + mxArray *disc_phi_fun_jac_hess_mat = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); + +{% if solver_options.integrator_type == "ERK" %} + {# TODO: remove _casadi from these names.. #} + l_ptr = mxGetData(forw_vde_mat); + l_ptr[0] = (long long) acados_ocp_capsule->forw_vde_casadi; + l_ptr = mxGetData(expl_ode_fun_mat); + l_ptr[0] = (long long) acados_ocp_capsule->expl_ode_fun; +{% if solver_options.hessian_approx == "EXACT" %} + l_ptr = mxGetData(hess_vde_mat); + l_ptr[0] = (long long) acados_ocp_capsule->hess_vde_casadi; +{%- endif %} +{% elif solver_options.integrator_type == "IRK" %} + l_ptr = mxGetData(impl_dae_fun_mat); + l_ptr[0] = (long long) acados_ocp_capsule->impl_dae_fun; + l_ptr = mxGetData(impl_dae_fun_jac_x_xdot_z_mat); + l_ptr[0] = (long long) acados_ocp_capsule->impl_dae_fun_jac_x_xdot_z; + l_ptr = mxGetData(impl_dae_jac_x_xdot_u_z_mat); + l_ptr[0] = (long long) acados_ocp_capsule->impl_dae_jac_x_xdot_u_z; +{% if solver_options.hessian_approx == "EXACT" %} + l_ptr = mxGetData(impl_dae_hess_mat); + l_ptr[0] = (long long) acados_ocp_capsule->impl_dae_hess; +{%- endif %} +{% elif solver_options.integrator_type == "GNSF" %} + l_ptr = mxGetData(gnsf_phi_fun_mat); + l_ptr[0] = (long long) acados_ocp_capsule->gnsf_phi_fun; + l_ptr = mxGetData(gnsf_phi_fun_jac_y_mat); + l_ptr[0] = (long long) acados_ocp_capsule->gnsf_phi_fun_jac_y; + l_ptr = mxGetData(gnsf_phi_jac_y_uhat_mat); + l_ptr[0] = (long long) acados_ocp_capsule->gnsf_phi_jac_y_uhat; + l_ptr = mxGetData(gnsf_f_lo_jac_x1_x1dot_u_z_mat); + l_ptr[0] = (long long) acados_ocp_capsule->gnsf_f_lo_jac_x1_x1dot_u_z; + l_ptr = mxGetData(gnsf_get_matrices_fun_mat); + l_ptr[0] = (long long) acados_ocp_capsule->gnsf_get_matrices_fun; +{% elif solver_options.integrator_type == "DISCRETE" %} + l_ptr = mxGetData(disc_phi_fun_mat); + l_ptr[0] = (long long) acados_ocp_capsule->discr_dyn_phi_fun; + l_ptr = mxGetData(disc_phi_fun_jac_mat); + l_ptr[0] = (long long) acados_ocp_capsule->discr_dyn_phi_fun_jac_ut_xt; +{% if solver_options.hessian_approx == "EXACT" %} + l_ptr = mxGetData(disc_phi_fun_jac_hess_mat); + l_ptr[0] = (long long) acados_ocp_capsule->discr_dyn_phi_fun_jac_ut_xt_hess; +{%- endif %} +{%- endif %} + mxSetField(plhs[1], 0, "expl_ode_fun", expl_ode_fun_mat); + mxSetField(plhs[1], 0, "forw_vde", forw_vde_mat); + mxSetField(plhs[1], 0, "hess_vde", hess_vde_mat); + + mxSetField(plhs[1], 0, "gnsf_phi_fun", gnsf_phi_fun_mat); + mxSetField(plhs[1], 0, "gnsf_phi_fun_jac_y", gnsf_phi_fun_jac_y_mat); + mxSetField(plhs[1], 0, "gnsf_phi_jac_y_uhat", gnsf_phi_jac_y_uhat_mat); + mxSetField(plhs[1], 0, "gnsf_f_lo_jac_x1_x1dot_u_z", gnsf_f_lo_jac_x1_x1dot_u_z_mat); + mxSetField(plhs[1], 0, "gnsf_get_matrices_fun", gnsf_get_matrices_fun_mat); + + mxSetField(plhs[1], 0, "impl_dae_fun", impl_dae_fun_mat); + mxSetField(plhs[1], 0, "impl_dae_fun_jac_x_xdot_z", impl_dae_fun_jac_x_xdot_z_mat); + mxSetField(plhs[1], 0, "impl_dae_jac_x_xdot_u_z", impl_dae_jac_x_xdot_u_z_mat); + mxSetField(plhs[1], 0, "impl_dae_hess", impl_dae_hess_mat); + + mxSetField(plhs[1], 0, "disc_phi_fun", disc_phi_fun_mat); + mxSetField(plhs[1], 0, "disc_phi_fun_jac", disc_phi_fun_jac_mat); + mxSetField(plhs[1], 0, "disc_phi_fun_jac_hess", disc_phi_fun_jac_hess_mat); +/* constaints */ + mxArray *phi_constraint_mat = mxCreateNumericMatrix(1, 2, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(phi_constraint_mat); +{%- if constraints.constr_type == "BGP" %} + l_ptr[0] = (long long) acados_ocp_capsule->phi_constraint; +{% endif %} +{% if constraints.constr_type_e == "BGP" %} + l_ptr[1] = (long long) &acados_ocp_capsule->phi_e_constraint; +{% endif %} + mxSetField(plhs[1], 0, "phi_constraint", phi_constraint_mat); + + mxArray *nl_constr_h_fun_jac_mat = mxCreateNumericMatrix(1, 2, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(nl_constr_h_fun_jac_mat); +{% if constraints.constr_type == "BGH" and dims.nh > 0 %} + l_ptr[0] = (long long) acados_ocp_capsule->nl_constr_h_fun_jac; +{% endif %} +{% if constraints.constr_type_e == "BGH" and dims.nh_e > 0 %} + l_ptr[1] = (long long) &acados_ocp_capsule->nl_constr_h_e_fun_jac; +{%- endif %} + mxSetField(plhs[1], 0, "nl_constr_h_fun_jac", nl_constr_h_fun_jac_mat); + + mxArray *nl_constr_h_fun_mat = mxCreateNumericMatrix(1, 2, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(nl_constr_h_fun_mat); +{% if constraints.constr_type == "BGH" and dims.nh > 0 %} + l_ptr[0] = (long long) acados_ocp_capsule->nl_constr_h_fun; +{% endif %} +{% if constraints.constr_type_e == "BGH" and dims.nh_e > 0 %} + l_ptr[1] = (long long) &acados_ocp_capsule->nl_constr_h_e_fun; +{%- endif %} + mxSetField(plhs[1], 0, "nl_constr_h_fun", nl_constr_h_fun_mat); + + mxArray *nl_constr_h_fun_jac_hess_mat = mxCreateNumericMatrix(1, 2, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(nl_constr_h_fun_jac_hess_mat); +{% if constraints.constr_type == "BGH" and dims.nh > 0 and solver_options.hessian_approx == "EXACT" %} + l_ptr[0] = (long long) acados_ocp_capsule->nl_constr_h_fun_jac_hess; +{% endif %} +{% if constraints.constr_type_e == "BGH" and dims.nh_e > 0 and solver_options.hessian_approx == "EXACT" %} + l_ptr[1] = (long long) &acados_ocp_capsule->nl_constr_h_e_fun_jac_hess; +{%- endif %} + mxSetField(plhs[1], 0, "nl_constr_h_fun_jac_hess", nl_constr_h_fun_jac_hess_mat); + +/* cost */ + mxArray *cost_y_fun_mat = mxCreateNumericMatrix(1, 2, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(cost_y_fun_mat); +{% if cost.cost_type == "NONLINEAR_LS" %} + l_ptr[0] = (long long) acados_ocp_capsule->cost_y_fun; +{% endif %} +{% if cost.cost_type_e == "NONLINEAR_LS" %} + l_ptr[1] = (long long) &acados_ocp_capsule->cost_y_e_fun; +{%- endif %} + mxSetField(plhs[1], 0, "cost_y_fun", cost_y_fun_mat); + + mxArray *cost_y_fun_jac_ut_xt_mat = mxCreateNumericMatrix(1, 2, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(cost_y_fun_jac_ut_xt_mat); +{% if cost.cost_type == "NONLINEAR_LS" %} + l_ptr[0] = (long long) acados_ocp_capsule->cost_y_fun_jac_ut_xt; +{% endif %} +{% if cost.cost_type_e == "NONLINEAR_LS" %} + l_ptr[1] = (long long) &acados_ocp_capsule->cost_y_e_fun_jac_ut_xt; +{%- endif %} + mxSetField(plhs[1], 0, "cost_y_fun_jac_ut_xt", cost_y_fun_jac_ut_xt_mat); + + mxArray *cost_y_hess_mat = mxCreateNumericMatrix(1, 2, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(cost_y_hess_mat); +{% if cost.cost_type == "NONLINEAR_LS" %} + l_ptr[0] = (long long) acados_ocp_capsule->cost_y_hess; +{% endif %} +{% if cost.cost_type_e == "NONLINEAR_LS" %} + l_ptr[1] = (long long) &acados_ocp_capsule->cost_y_e_hess; +{%- endif %} + mxSetField(plhs[1], 0, "cost_y_hess", cost_y_hess_mat); + + mxArray *ext_cost_fun_mat = mxCreateNumericMatrix(1, 2, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(ext_cost_fun_mat); +{% if cost.cost_type == "EXTERNAL" %} + l_ptr[0] = (long long) acados_ocp_capsule->ext_cost_fun; +{% endif -%} +{% if cost.cost_type_e == "EXTERNAL" %} + l_ptr[1] = (long long) &acados_ocp_capsule->ext_cost_e_fun; +{%- endif %} + mxSetField(plhs[1], 0, "ext_cost_fun", ext_cost_fun_mat); + + mxArray *ext_cost_fun_jac_mat = mxCreateNumericMatrix(1, 2, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(ext_cost_fun_jac_mat); +{% if cost.cost_type == "EXTERNAL" %} + l_ptr[0] = (long long) acados_ocp_capsule->ext_cost_fun_jac; +{% endif -%} +{% if cost.cost_type_e == "EXTERNAL" %} + l_ptr[1] = (long long) &acados_ocp_capsule->ext_cost_e_fun_jac; +{%- endif %} + mxSetField(plhs[1], 0, "ext_cost_fun_jac", ext_cost_fun_jac_mat); + + mxArray *ext_cost_fun_jac_hess_mat = mxCreateNumericMatrix(1, 2, mxINT64_CLASS, mxREAL); + l_ptr = mxGetData(ext_cost_fun_jac_hess_mat); +{% if cost.cost_type == "EXTERNAL" %} + l_ptr[0] = (long long) acados_ocp_capsule->ext_cost_fun_jac_hess; +{% endif -%} +{% if cost.cost_type_e == "EXTERNAL" %} + l_ptr[1] = (long long) &acados_ocp_capsule->ext_cost_e_fun_jac_hess; +{%- endif %} + mxSetField(plhs[1], 0, "ext_cost_fun_jac_hess", ext_cost_fun_jac_hess_mat); + + + return; +} diff --git a/pyextra/acados_template/c_templates_tera/acados_mex_free.in.c b/pyextra/acados_template/c_templates_tera/acados_mex_free.in.c new file mode 100644 index 000000000..560adb0b9 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/acados_mex_free.in.c @@ -0,0 +1,70 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +// system +#include +#include +#include +// acados +#include "acados_solver_{{ model.name }}.h" + +// mex +#include "mex.h" + + +void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) +{ + int status = 0; + long long *ptr; + + // mexPrintf("\nin mex_acados_free\n"); + const mxArray *C_ocp = prhs[0]; + // capsule + ptr = (long long *) mxGetData( mxGetField( C_ocp, 0, "capsule" ) ); + {{ model.name }}_solver_capsule *capsule = ({{ model.name }}_solver_capsule *) ptr[0]; + + status = {{ model.name }}_acados_free(capsule); + if (status) + { + mexPrintf("{{ model.name }}_acados_free() returned status %d.\n", status); + } + + status = {{ model.name }}_acados_free_capsule(capsule); + if (status) + { + mexPrintf("{{ model.name }}_acados_free_capsule() returned status %d.\n", status); + } + + return; +} + diff --git a/pyextra/acados_template/c_templates_tera/acados_mex_set.in.c b/pyextra/acados_template/c_templates_tera/acados_mex_set.in.c new file mode 100644 index 000000000..ae8c31155 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/acados_mex_set.in.c @@ -0,0 +1,570 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +// standard +#include +#include +#include + +// acados +#include "acados/utils/print.h" +#include "acados_c/ocp_nlp_interface.h" +#include "acados_solver_{{ model.name }}.h" + +// mex +#include "mex.h" +#include "mex_macros.h" + + +void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) +{ + + long long *ptr; + int acados_size; + mxArray *mex_field; + char fun_name[20] = "ocp_set"; + char buffer [500]; // for error messages + + /* RHS */ + int min_nrhs = 6; + + char *ext_fun_type = mxArrayToString( prhs[0] ); + char *ext_fun_type_e = mxArrayToString( prhs[1] ); + + // C ocp + const mxArray *C_ocp = prhs[2]; + // capsule + ptr = (long long *) mxGetData( mxGetField( C_ocp, 0, "capsule" ) ); + {{ model.name }}_solver_capsule *capsule = ({{ model.name }}_solver_capsule *) ptr[0]; + // plan + ptr = (long long *) mxGetData( mxGetField( C_ocp, 0, "plan" ) ); + ocp_nlp_plan *plan = (ocp_nlp_plan *) ptr[0]; + // config + ptr = (long long *) mxGetData( mxGetField( C_ocp, 0, "config" ) ); + ocp_nlp_config *config = (ocp_nlp_config *) ptr[0]; + // dims + ptr = (long long *) mxGetData( mxGetField( C_ocp, 0, "dims" ) ); + ocp_nlp_dims *dims = (ocp_nlp_dims *) ptr[0]; + // opts + ptr = (long long *) mxGetData( mxGetField( C_ocp, 0, "opts" ) ); + void *opts = (void *) ptr[0]; + // in + ptr = (long long *) mxGetData( mxGetField( C_ocp, 0, "in" ) ); + ocp_nlp_in *in = (ocp_nlp_in *) ptr[0]; + // out + ptr = (long long *) mxGetData( mxGetField( C_ocp, 0, "out" ) ); + ocp_nlp_out *out = (ocp_nlp_out *) ptr[0]; + // solver + ptr = (long long *) mxGetData( mxGetField( C_ocp, 0, "solver" ) ); + ocp_nlp_solver *solver = (ocp_nlp_solver *) ptr[0]; + + const mxArray *C_ext_fun_pointers = prhs[3]; + // field + char *field = mxArrayToString( prhs[4] ); + // value + double *value = mxGetPr( prhs[5] ); + + // for checks + int matlab_size = (int) mxGetNumberOfElements( prhs[5] ); + int nrow = (int) mxGetM( prhs[5] ); + int ncol = (int) mxGetN( prhs[5] ); + + int N = dims->N; + int nu = dims->nu[0]; + int nx = dims->nx[0]; + + // stage + int s0, se; + if (nrhs==min_nrhs) + { + s0 = 0; + se = N; + } + else if (nrhs==min_nrhs+1) + { + s0 = mxGetScalar( prhs[6] ); + if (s0 > N) + { + sprintf(buffer, "ocp_set: N < specified stage = %d\n", s0); + mexErrMsgTxt(buffer); + } + se = s0 + 1; + } + else + { + sprintf(buffer, "ocp_set: wrong nrhs: %d\n", nrhs); + mexErrMsgTxt(buffer); + } + + /* Set value */ + // constraints + if (!strcmp(field, "constr_x0")) + { + acados_size = nx; + MEX_DIM_CHECK_VEC(fun_name, field, matlab_size, acados_size); + ocp_nlp_constraints_model_set(config, dims, in, 0, "lbx", value); + ocp_nlp_constraints_model_set(config, dims, in, 0, "ubx", value); + } + else if (!strcmp(field, "constr_C")) + { + for (int ii=s0; iinlp_cost[ii] == LINEAR_LS) || (plan->nlp_cost[ii] == NONLINEAR_LS)) + { + acados_size = ocp_nlp_dims_get_from_attr(config, dims, out, ii, "y_ref"); + MEX_DIM_CHECK_VEC(fun_name, field, matlab_size, acados_size); + ocp_nlp_cost_model_set(config, dims, in, ii, "y_ref", value); + } + else + { + MEX_FIELD_NOT_SUPPORTED_FOR_COST_STAGE(fun_name, field, plan->nlp_cost[ii], ii); + } + } + } + else if (!strcmp(field, "cost_y_ref_e")) + { + acados_size = ocp_nlp_dims_get_from_attr(config, dims, out, N, "y_ref"); + MEX_DIM_CHECK_VEC(fun_name, field, matlab_size, acados_size); + ocp_nlp_cost_model_set(config, dims, in, N, "y_ref", value); + } + else if (!strcmp(field, "cost_Vu")) + { + for (int ii=s0; iinlp_cost[ii] == LINEAR_LS) || (plan->nlp_cost[ii] == NONLINEAR_LS)) + { + int ny = ocp_nlp_dims_get_from_attr(config, dims, out, ii, "y_ref"); + int nu = ocp_nlp_dims_get_from_attr(config, dims, out, ii, "u"); + acados_size = ny * nu; + MEX_DIM_CHECK_VEC(fun_name, field, matlab_size, acados_size); + ocp_nlp_cost_model_set(config, dims, in, ii, "Vu", value); + } + else + { + MEX_FIELD_NOT_SUPPORTED_FOR_COST_STAGE(fun_name, field, plan->nlp_cost[ii], ii); + } + } + } + else if (!strcmp(field, "cost_Vx")) + { + for (int ii=s0; iinlp_cost[ii] == LINEAR_LS) || (plan->nlp_cost[ii] == NONLINEAR_LS)) + { + int ny = ocp_nlp_dims_get_from_attr(config, dims, out, ii, "y_ref"); + int nx = ocp_nlp_dims_get_from_attr(config, dims, out, ii, "x"); + acados_size = ny * nx; + MEX_DIM_CHECK_VEC(fun_name, field, matlab_size, acados_size); + ocp_nlp_cost_model_set(config, dims, in, ii, "Vx", value); + } + else + { + MEX_FIELD_NOT_SUPPORTED_FOR_COST_STAGE(fun_name, field, plan->nlp_cost[ii], ii); + } + } + } + else if (!strcmp(field, "cost_W")) + { + for (int ii=s0; iinlp_cost[ii] == LINEAR_LS) || (plan->nlp_cost[ii] == NONLINEAR_LS)) + { + int ny = ocp_nlp_dims_get_from_attr(config, dims, out, s0, "y_ref"); + acados_size = ny * ny; + MEX_DIM_CHECK_VEC(fun_name, field, matlab_size, acados_size); + ocp_nlp_cost_model_set(config, dims, in, ii, "W", value); + } + else + { + MEX_FIELD_NOT_SUPPORTED_FOR_COST_STAGE(fun_name, field, plan->nlp_cost[ii], ii); + } + } + } + else if (!strcmp(field, "cost_Z")) + { + acados_size = ocp_nlp_dims_get_from_attr(config, dims, out, s0, "cost_Z"); + MEX_DIM_CHECK_VEC(fun_name, field, matlab_size, acados_size); + for (int ii=s0; iisim_solver_plan[0]; + sim_solver_t type = sim_plan.sim_solver; + if (type == IRK) + { + int nz = ocp_nlp_dims_get_from_attr(config, dims, out, 0, "z"); + if (nrhs!=min_nrhs) + MEX_SETTER_NO_STAGE_SUPPORT(fun_name, field) + + acados_size = N*nz; + MEX_DIM_CHECK_VEC(fun_name, field, matlab_size, acados_size); + for (int ii=0; iisim_solver_plan[0]; + sim_solver_t type = sim_plan.sim_solver; + if (type == IRK) + { + int nx = ocp_nlp_dims_get_from_attr(config, dims, out, 0, "x"); + if (nrhs!=min_nrhs) + MEX_SETTER_NO_STAGE_SUPPORT(fun_name, field) + + acados_size = N*nx; + MEX_DIM_CHECK_VEC(fun_name, field, matlab_size, acados_size); + for (int ii=0; iisim_solver_plan[0]; + sim_solver_t type = sim_plan.sim_solver; + if (type == GNSF) + { + int nout = ocp_nlp_dims_get_from_attr(config, dims, out, 0, "init_gnsf_phi"); + + if (nrhs!=min_nrhs) + MEX_SETTER_NO_STAGE_SUPPORT(fun_name, field) + + acados_size = N*nout; + MEX_DIM_CHECK_VEC(fun_name, field, matlab_size, acados_size); + for (int ii=0; iinlp_solver == SQP && rti_phase != 0) + { + MEX_FIELD_ONLY_SUPPORTED_FOR_SOLVER(fun_name, field, "sqp_rti") + } + ocp_nlp_solver_opts_set(config, opts, "rti_phase", &rti_phase); + } + else if (!strcmp(field, "qp_warm_start")) + { + acados_size = 1; + MEX_DIM_CHECK_VEC(fun_name, field, matlab_size, acados_size); + int qp_warm_start = (int) value[0]; + ocp_nlp_solver_opts_set(config, opts, "qp_warm_start", &qp_warm_start); + } + else if (!strcmp(field, "warm_start_first_qp")) + { + acados_size = 1; + MEX_DIM_CHECK_VEC(fun_name, field, matlab_size, acados_size); + int warm_start_first_qp = (int) value[0]; + ocp_nlp_solver_opts_set(config, opts, "warm_start_first_qp", &warm_start_first_qp); + } + else if (!strcmp(field, "print_level")) + { + acados_size = 1; + MEX_DIM_CHECK_VEC(fun_name, field, matlab_size, acados_size); + int print_level = (int) value[0]; + ocp_nlp_solver_opts_set(config, opts, "print_level", &print_level); + } + else + { + MEX_FIELD_NOT_SUPPORTED_SUGGEST(fun_name, field, "p, constr_x0,\ + constr_lbx, constr_ubx, constr_C, constr_D, constr_lg, constr_ug, constr_lh, constr_uh\ + constr_lbu, constr_ubu, cost_y_ref[_e],\ + cost_Vu, cost_Vx, cost_Vz, cost_W, cost_Z, cost_Zl, cost_Zu, cost_z,\ + cost_zl, cost_zu, init_x, init_u, init_z, init_xdot, init_gnsf_phi,\ + init_pi, nlp_solver_max_iter, qp_warm_start, warm_start_first_qp, print_level"); + } + + return; +} + diff --git a/pyextra/acados_template/c_templates_tera/acados_mex_solve.in.c b/pyextra/acados_template/c_templates_tera/acados_mex_solve.in.c new file mode 100644 index 000000000..c673d4bf2 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/acados_mex_solve.in.c @@ -0,0 +1,59 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +// system +#include +#include +#include +// acados +#include "acados_solver_{{ model.name }}.h" + +// mex +#include "mex.h" + + + +void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) +{ + // C_ocp + long long *ptr; + const mxArray *C_ocp = prhs[0]; + + // capsule + ptr = (long long *) mxGetData( mxGetField( C_ocp, 0, "capsule" ) ); + {{ model.name }}_solver_capsule *capsule = ({{ model.name }}_solver_capsule *) ptr[0]; + + // solve + {{ model.name }}_acados_solve(capsule); + +} diff --git a/pyextra/acados_template/c_templates_tera/acados_sim_solver.in.c b/pyextra/acados_template/c_templates_tera/acados_sim_solver.in.c new file mode 100644 index 000000000..971fb8a78 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/acados_sim_solver.in.c @@ -0,0 +1,488 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +{%- if solver_options.hessian_approx %} + {%- set hessian_approx = solver_options.hessian_approx %} +{%- elif solver_options.sens_hess %} + {%- set hessian_approx = "EXACT" %} +{%- else %} + {%- set hessian_approx = "GAUSS_NEWTON" %} +{%- endif %} +// standard +#include +#include + +// acados +#include "acados_c/external_function_interface.h" +#include "acados_c/sim_interface.h" +#include "acados_c/external_function_interface.h" + +#include "acados/sim/sim_common.h" +#include "acados/utils/external_function_generic.h" +#include "acados/utils/print.h" + + +// example specific +#include "{{ model.name }}_model/{{ model.name }}_model.h" +#include "acados_sim_solver_{{ model.name }}.h" + + +// ** solver data ** + +sim_solver_capsule * {{ model.name }}_acados_sim_solver_create_capsule() +{ + void* capsule_mem = malloc(sizeof(sim_solver_capsule)); + sim_solver_capsule *capsule = (sim_solver_capsule *) capsule_mem; + + return capsule; +} + + +int {{ model.name }}_acados_sim_solver_free_capsule(sim_solver_capsule * capsule) +{ + free(capsule); + return 0; +} + + +int {{ model.name }}_acados_sim_create(sim_solver_capsule * capsule) +{ + // initialize + const int nx = {{ model.name | upper }}_NX; + const int nu = {{ model.name | upper }}_NU; + const int nz = {{ model.name | upper }}_NZ; + const int np = {{ model.name | upper }}_NP; + bool tmp_bool; + + {#// double Tsim = {{ solver_options.tf / dims.N }};#} + double Tsim = {{ solver_options.Tsim }}; + + {% if solver_options.integrator_type == "IRK" %} + capsule->sim_impl_dae_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)); + capsule->sim_impl_dae_fun_jac_x_xdot_z = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)); + capsule->sim_impl_dae_jac_x_xdot_u_z = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)); + + // external functions (implicit model) + capsule->sim_impl_dae_fun->casadi_fun = &{{ model.name }}_impl_dae_fun; + capsule->sim_impl_dae_fun->casadi_work = &{{ model.name }}_impl_dae_fun_work; + capsule->sim_impl_dae_fun->casadi_sparsity_in = &{{ model.name }}_impl_dae_fun_sparsity_in; + capsule->sim_impl_dae_fun->casadi_sparsity_out = &{{ model.name }}_impl_dae_fun_sparsity_out; + capsule->sim_impl_dae_fun->casadi_n_in = &{{ model.name }}_impl_dae_fun_n_in; + capsule->sim_impl_dae_fun->casadi_n_out = &{{ model.name }}_impl_dae_fun_n_out; + external_function_param_casadi_create(capsule->sim_impl_dae_fun, np); + + capsule->sim_impl_dae_fun_jac_x_xdot_z->casadi_fun = &{{ model.name }}_impl_dae_fun_jac_x_xdot_z; + capsule->sim_impl_dae_fun_jac_x_xdot_z->casadi_work = &{{ model.name }}_impl_dae_fun_jac_x_xdot_z_work; + capsule->sim_impl_dae_fun_jac_x_xdot_z->casadi_sparsity_in = &{{ model.name }}_impl_dae_fun_jac_x_xdot_z_sparsity_in; + capsule->sim_impl_dae_fun_jac_x_xdot_z->casadi_sparsity_out = &{{ model.name }}_impl_dae_fun_jac_x_xdot_z_sparsity_out; + capsule->sim_impl_dae_fun_jac_x_xdot_z->casadi_n_in = &{{ model.name }}_impl_dae_fun_jac_x_xdot_z_n_in; + capsule->sim_impl_dae_fun_jac_x_xdot_z->casadi_n_out = &{{ model.name }}_impl_dae_fun_jac_x_xdot_z_n_out; + external_function_param_casadi_create(capsule->sim_impl_dae_fun_jac_x_xdot_z, np); + + // external_function_param_casadi impl_dae_jac_x_xdot_u_z; + capsule->sim_impl_dae_jac_x_xdot_u_z->casadi_fun = &{{ model.name }}_impl_dae_jac_x_xdot_u_z; + capsule->sim_impl_dae_jac_x_xdot_u_z->casadi_work = &{{ model.name }}_impl_dae_jac_x_xdot_u_z_work; + capsule->sim_impl_dae_jac_x_xdot_u_z->casadi_sparsity_in = &{{ model.name }}_impl_dae_jac_x_xdot_u_z_sparsity_in; + capsule->sim_impl_dae_jac_x_xdot_u_z->casadi_sparsity_out = &{{ model.name }}_impl_dae_jac_x_xdot_u_z_sparsity_out; + capsule->sim_impl_dae_jac_x_xdot_u_z->casadi_n_in = &{{ model.name }}_impl_dae_jac_x_xdot_u_z_n_in; + capsule->sim_impl_dae_jac_x_xdot_u_z->casadi_n_out = &{{ model.name }}_impl_dae_jac_x_xdot_u_z_n_out; + external_function_param_casadi_create(capsule->sim_impl_dae_jac_x_xdot_u_z, np); + +{%- if hessian_approx == "EXACT" %} + capsule->sim_impl_dae_hess = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)); + // external_function_param_casadi impl_dae_jac_x_xdot_u_z; + capsule->sim_impl_dae_hess->casadi_fun = &{{ model.name }}_impl_dae_hess; + capsule->sim_impl_dae_hess->casadi_work = &{{ model.name }}_impl_dae_hess_work; + capsule->sim_impl_dae_hess->casadi_sparsity_in = &{{ model.name }}_impl_dae_hess_sparsity_in; + capsule->sim_impl_dae_hess->casadi_sparsity_out = &{{ model.name }}_impl_dae_hess_sparsity_out; + capsule->sim_impl_dae_hess->casadi_n_in = &{{ model.name }}_impl_dae_hess_n_in; + capsule->sim_impl_dae_hess->casadi_n_out = &{{ model.name }}_impl_dae_hess_n_out; + external_function_param_casadi_create(capsule->sim_impl_dae_hess, np); +{%- endif %} + + {% elif solver_options.integrator_type == "ERK" %} + // explicit ode + capsule->sim_forw_vde_casadi = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)); + capsule->sim_expl_ode_fun_casadi = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)); + + capsule->sim_forw_vde_casadi->casadi_fun = &{{ model.name }}_expl_vde_forw; + capsule->sim_forw_vde_casadi->casadi_n_in = &{{ model.name }}_expl_vde_forw_n_in; + capsule->sim_forw_vde_casadi->casadi_n_out = &{{ model.name }}_expl_vde_forw_n_out; + capsule->sim_forw_vde_casadi->casadi_sparsity_in = &{{ model.name }}_expl_vde_forw_sparsity_in; + capsule->sim_forw_vde_casadi->casadi_sparsity_out = &{{ model.name }}_expl_vde_forw_sparsity_out; + capsule->sim_forw_vde_casadi->casadi_work = &{{ model.name }}_expl_vde_forw_work; + external_function_param_casadi_create(capsule->sim_forw_vde_casadi, np); + + capsule->sim_expl_ode_fun_casadi->casadi_fun = &{{ model.name }}_expl_ode_fun; + capsule->sim_expl_ode_fun_casadi->casadi_n_in = &{{ model.name }}_expl_ode_fun_n_in; + capsule->sim_expl_ode_fun_casadi->casadi_n_out = &{{ model.name }}_expl_ode_fun_n_out; + capsule->sim_expl_ode_fun_casadi->casadi_sparsity_in = &{{ model.name }}_expl_ode_fun_sparsity_in; + capsule->sim_expl_ode_fun_casadi->casadi_sparsity_out = &{{ model.name }}_expl_ode_fun_sparsity_out; + capsule->sim_expl_ode_fun_casadi->casadi_work = &{{ model.name }}_expl_ode_fun_work; + external_function_param_casadi_create(capsule->sim_expl_ode_fun_casadi, np); + +{%- if hessian_approx == "EXACT" %} + capsule->sim_expl_ode_hess = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)); + // external_function_param_casadi impl_dae_jac_x_xdot_u_z; + capsule->sim_expl_ode_hess->casadi_fun = &{{ model.name }}_expl_ode_hess; + capsule->sim_expl_ode_hess->casadi_work = &{{ model.name }}_expl_ode_hess_work; + capsule->sim_expl_ode_hess->casadi_sparsity_in = &{{ model.name }}_expl_ode_hess_sparsity_in; + capsule->sim_expl_ode_hess->casadi_sparsity_out = &{{ model.name }}_expl_ode_hess_sparsity_out; + capsule->sim_expl_ode_hess->casadi_n_in = &{{ model.name }}_expl_ode_hess_n_in; + capsule->sim_expl_ode_hess->casadi_n_out = &{{ model.name }}_expl_ode_hess_n_out; + external_function_param_casadi_create(capsule->sim_expl_ode_hess, np); +{%- endif %} + + {% elif solver_options.integrator_type == "GNSF" -%} + capsule->sim_gnsf_phi_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)); + capsule->sim_gnsf_phi_fun_jac_y = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)); + capsule->sim_gnsf_phi_jac_y_uhat = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)); + capsule->sim_gnsf_f_lo_jac_x1_x1dot_u_z = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)); + capsule->sim_gnsf_get_matrices_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)); + + capsule->sim_gnsf_phi_fun->casadi_fun = &{{ model.name }}_gnsf_phi_fun; + capsule->sim_gnsf_phi_fun->casadi_n_in = &{{ model.name }}_gnsf_phi_fun_n_in; + capsule->sim_gnsf_phi_fun->casadi_n_out = &{{ model.name }}_gnsf_phi_fun_n_out; + capsule->sim_gnsf_phi_fun->casadi_sparsity_in = &{{ model.name }}_gnsf_phi_fun_sparsity_in; + capsule->sim_gnsf_phi_fun->casadi_sparsity_out = &{{ model.name }}_gnsf_phi_fun_sparsity_out; + capsule->sim_gnsf_phi_fun->casadi_work = &{{ model.name }}_gnsf_phi_fun_work; + external_function_param_casadi_create(capsule->sim_gnsf_phi_fun, np); + + capsule->sim_gnsf_phi_fun_jac_y->casadi_fun = &{{ model.name }}_gnsf_phi_fun_jac_y; + capsule->sim_gnsf_phi_fun_jac_y->casadi_n_in = &{{ model.name }}_gnsf_phi_fun_jac_y_n_in; + capsule->sim_gnsf_phi_fun_jac_y->casadi_n_out = &{{ model.name }}_gnsf_phi_fun_jac_y_n_out; + capsule->sim_gnsf_phi_fun_jac_y->casadi_sparsity_in = &{{ model.name }}_gnsf_phi_fun_jac_y_sparsity_in; + capsule->sim_gnsf_phi_fun_jac_y->casadi_sparsity_out = &{{ model.name }}_gnsf_phi_fun_jac_y_sparsity_out; + capsule->sim_gnsf_phi_fun_jac_y->casadi_work = &{{ model.name }}_gnsf_phi_fun_jac_y_work; + external_function_param_casadi_create(capsule->sim_gnsf_phi_fun_jac_y, np); + + capsule->sim_gnsf_phi_jac_y_uhat->casadi_fun = &{{ model.name }}_gnsf_phi_jac_y_uhat; + capsule->sim_gnsf_phi_jac_y_uhat->casadi_n_in = &{{ model.name }}_gnsf_phi_jac_y_uhat_n_in; + capsule->sim_gnsf_phi_jac_y_uhat->casadi_n_out = &{{ model.name }}_gnsf_phi_jac_y_uhat_n_out; + capsule->sim_gnsf_phi_jac_y_uhat->casadi_sparsity_in = &{{ model.name }}_gnsf_phi_jac_y_uhat_sparsity_in; + capsule->sim_gnsf_phi_jac_y_uhat->casadi_sparsity_out = &{{ model.name }}_gnsf_phi_jac_y_uhat_sparsity_out; + capsule->sim_gnsf_phi_jac_y_uhat->casadi_work = &{{ model.name }}_gnsf_phi_jac_y_uhat_work; + external_function_param_casadi_create(capsule->sim_gnsf_phi_jac_y_uhat, np); + + capsule->sim_gnsf_f_lo_jac_x1_x1dot_u_z->casadi_fun = &{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz; + capsule->sim_gnsf_f_lo_jac_x1_x1dot_u_z->casadi_n_in = &{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_n_in; + capsule->sim_gnsf_f_lo_jac_x1_x1dot_u_z->casadi_n_out = &{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_n_out; + capsule->sim_gnsf_f_lo_jac_x1_x1dot_u_z->casadi_sparsity_in = &{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_sparsity_in; + capsule->sim_gnsf_f_lo_jac_x1_x1dot_u_z->casadi_sparsity_out = &{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_sparsity_out; + capsule->sim_gnsf_f_lo_jac_x1_x1dot_u_z->casadi_work = &{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_work; + external_function_param_casadi_create(capsule->sim_gnsf_f_lo_jac_x1_x1dot_u_z, np); + + capsule->sim_gnsf_get_matrices_fun->casadi_fun = &{{ model.name }}_gnsf_get_matrices_fun; + capsule->sim_gnsf_get_matrices_fun->casadi_n_in = &{{ model.name }}_gnsf_get_matrices_fun_n_in; + capsule->sim_gnsf_get_matrices_fun->casadi_n_out = &{{ model.name }}_gnsf_get_matrices_fun_n_out; + capsule->sim_gnsf_get_matrices_fun->casadi_sparsity_in = &{{ model.name }}_gnsf_get_matrices_fun_sparsity_in; + capsule->sim_gnsf_get_matrices_fun->casadi_sparsity_out = &{{ model.name }}_gnsf_get_matrices_fun_sparsity_out; + capsule->sim_gnsf_get_matrices_fun->casadi_work = &{{ model.name }}_gnsf_get_matrices_fun_work; + external_function_param_casadi_create(capsule->sim_gnsf_get_matrices_fun, np); + {% endif %} + + // sim plan & config + sim_solver_plan plan; + plan.sim_solver = {{ solver_options.integrator_type }}; + + // create correct config based on plan + sim_config * {{ model.name }}_sim_config = sim_config_create(plan); + capsule->acados_sim_config = {{ model.name }}_sim_config; + + // sim dims + void *{{ model.name }}_sim_dims = sim_dims_create({{ model.name }}_sim_config); + capsule->acados_sim_dims = {{ model.name }}_sim_dims; + sim_dims_set({{ model.name }}_sim_config, {{ model.name }}_sim_dims, "nx", &nx); + sim_dims_set({{ model.name }}_sim_config, {{ model.name }}_sim_dims, "nu", &nu); + sim_dims_set({{ model.name }}_sim_config, {{ model.name }}_sim_dims, "nz", &nz); +{% if solver_options.integrator_type == "GNSF" %} + int gnsf_nx1 = {{ dims.gnsf_nx1 }}; + int gnsf_nz1 = {{ dims.gnsf_nz1 }}; + int gnsf_nout = {{ dims.gnsf_nout }}; + int gnsf_ny = {{ dims.gnsf_ny }}; + int gnsf_nuhat = {{ dims.gnsf_nuhat }}; + + sim_dims_set({{ model.name }}_sim_config, {{ model.name }}_sim_dims, "nx1", &gnsf_nx1); + sim_dims_set({{ model.name }}_sim_config, {{ model.name }}_sim_dims, "nz1", &gnsf_nz1); + sim_dims_set({{ model.name }}_sim_config, {{ model.name }}_sim_dims, "nout", &gnsf_nout); + sim_dims_set({{ model.name }}_sim_config, {{ model.name }}_sim_dims, "ny", &gnsf_ny); + sim_dims_set({{ model.name }}_sim_config, {{ model.name }}_sim_dims, "nuhat", &gnsf_nuhat); +{% endif %} + + // sim opts + sim_opts *{{ model.name }}_sim_opts = sim_opts_create({{ model.name }}_sim_config, {{ model.name }}_sim_dims); + capsule->acados_sim_opts = {{ model.name }}_sim_opts; + int tmp_int = {{ solver_options.sim_method_newton_iter }}; + sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "newton_iter", &tmp_int); + sim_collocation_type collocation_type = {{ solver_options.collocation_type }}; + sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "collocation_type", &collocation_type); + +{% if problem_class == "SIM" %} + tmp_int = {{ solver_options.sim_method_num_stages }}; + sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "num_stages", &tmp_int); + tmp_int = {{ solver_options.sim_method_num_steps }}; + sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "num_steps", &tmp_int); + + // options that are not available to AcadosOcpSolver + // (in OCP they will be determined by other options, like exact_hessian) + tmp_bool = {{ solver_options.sens_forw }}; + sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "sens_forw", &tmp_bool); + tmp_bool = {{ solver_options.sens_adj }}; + sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "sens_adj", &tmp_bool); + tmp_bool = {{ solver_options.sens_algebraic }}; + sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "sens_algebraic", &tmp_bool); + tmp_bool = {{ solver_options.sens_hess }}; + sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "sens_hess", &tmp_bool); + tmp_bool = {{ solver_options.output_z }}; + sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "output_z", &tmp_bool); + +{% else %} {# num_stages and num_steps of first shooting interval are used #} + tmp_int = {{ solver_options.sim_method_num_stages[0] }}; + sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "num_stages", &tmp_int); + tmp_int = {{ solver_options.sim_method_num_steps[0] }}; + sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "num_steps", &tmp_int); + tmp_bool = {{ solver_options.sim_method_jac_reuse[0] }}; + sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "jac_reuse", &tmp_bool); +{% endif %} + + // sim in / out + sim_in *{{ model.name }}_sim_in = sim_in_create({{ model.name }}_sim_config, {{ model.name }}_sim_dims); + capsule->acados_sim_in = {{ model.name }}_sim_in; + sim_out *{{ model.name }}_sim_out = sim_out_create({{ model.name }}_sim_config, {{ model.name }}_sim_dims); + capsule->acados_sim_out = {{ model.name }}_sim_out; + + sim_in_set({{ model.name }}_sim_config, {{ model.name }}_sim_dims, + {{ model.name }}_sim_in, "T", &Tsim); + + // model functions +{%- if solver_options.integrator_type == "IRK" %} + {{ model.name }}_sim_config->model_set({{ model.name }}_sim_in->model, + "impl_ode_fun", capsule->sim_impl_dae_fun); + {{ model.name }}_sim_config->model_set({{ model.name }}_sim_in->model, + "impl_ode_fun_jac_x_xdot", capsule->sim_impl_dae_fun_jac_x_xdot_z); + {{ model.name }}_sim_config->model_set({{ model.name }}_sim_in->model, + "impl_ode_jac_x_xdot_u", capsule->sim_impl_dae_jac_x_xdot_u_z); +{%- if hessian_approx == "EXACT" %} + {{ model.name }}_sim_config->model_set({{ model.name }}_sim_in->model, + "impl_dae_hess", capsule->sim_impl_dae_hess); +{%- endif %} + +{%- elif solver_options.integrator_type == "ERK" %} + {{ model.name }}_sim_config->model_set({{ model.name }}_sim_in->model, + "expl_vde_for", capsule->sim_forw_vde_casadi); + {{ model.name }}_sim_config->model_set({{ model.name }}_sim_in->model, + "expl_ode_fun", capsule->sim_expl_ode_fun_casadi); +{%- if hessian_approx == "EXACT" %} + {{ model.name }}_sim_config->model_set({{ model.name }}_sim_in->model, + "expl_ode_hess", capsule->sim_expl_ode_hess); +{%- endif %} +{%- elif solver_options.integrator_type == "GNSF" %} + {{ model.name }}_sim_config->model_set({{ model.name }}_sim_in->model, + "phi_fun", capsule->sim_gnsf_phi_fun); + {{ model.name }}_sim_config->model_set({{ model.name }}_sim_in->model, + "phi_fun_jac_y", capsule->sim_gnsf_phi_fun_jac_y); + {{ model.name }}_sim_config->model_set({{ model.name }}_sim_in->model, + "phi_jac_y_uhat", capsule->sim_gnsf_phi_jac_y_uhat); + {{ model.name }}_sim_config->model_set({{ model.name }}_sim_in->model, + "f_lo_jac_x1_x1dot_u_z", capsule->sim_gnsf_f_lo_jac_x1_x1dot_u_z); + {{ model.name }}_sim_config->model_set({{ model.name }}_sim_in->model, + "gnsf_get_matrices_fun", capsule->sim_gnsf_get_matrices_fun); +{%- endif %} + + // sim solver + sim_solver *{{ model.name }}_sim_solver = sim_solver_create({{ model.name }}_sim_config, + {{ model.name }}_sim_dims, {{ model.name }}_sim_opts); + capsule->acados_sim_solver = {{ model.name }}_sim_solver; + +{% if dims.np > 0 %} + /* initialize parameter values */ + double* p = calloc(np, sizeof(double)); + {% for item in parameter_values %} + {%- if item != 0 %} + p[{{ loop.index0 }}] = {{ item }}; + {%- endif %} + {%- endfor %} + + {{ model.name }}_acados_sim_update_params(capsule, p, np); + free(p); +{% endif %}{# if dims.np #} + + /* initialize input */ + // x + double x0[{{ dims.nx }}]; + for (int ii = 0; ii < {{ dims.nx }}; ii++) + x0[ii] = 0.0; + + sim_in_set({{ model.name }}_sim_config, {{ model.name }}_sim_dims, + {{ model.name }}_sim_in, "x", x0); + + + // u + double u0[{{ dims.nu }}]; + for (int ii = 0; ii < {{ dims.nu }}; ii++) + u0[ii] = 0.0; + + sim_in_set({{ model.name }}_sim_config, {{ model.name }}_sim_dims, + {{ model.name }}_sim_in, "u", u0); + + // S_forw + double S_forw[{{ dims.nx * (dims.nx + dims.nu) }}]; + for (int ii = 0; ii < {{ dims.nx * (dims.nx + dims.nu) }}; ii++) + S_forw[ii] = 0.0; + for (int ii = 0; ii < {{ dims.nx }}; ii++) + S_forw[ii + ii * {{ dims.nx }} ] = 1.0; + + + sim_in_set({{ model.name }}_sim_config, {{ model.name }}_sim_dims, + {{ model.name }}_sim_in, "S_forw", S_forw); + + int status = sim_precompute({{ model.name }}_sim_solver, {{ model.name }}_sim_in, {{ model.name }}_sim_out); + + return status; +} + + +int {{ model.name }}_acados_sim_solve(sim_solver_capsule *capsule) +{ + // integrate dynamics using acados sim_solver + int status = sim_solve(capsule->acados_sim_solver, + capsule->acados_sim_in, capsule->acados_sim_out); + if (status != 0) + printf("error in {{ model.name }}_acados_sim_solve()! Exiting.\n"); + + return status; +} + + +int {{ model.name }}_acados_sim_free(sim_solver_capsule *capsule) +{ + // free memory + sim_solver_destroy(capsule->acados_sim_solver); + sim_in_destroy(capsule->acados_sim_in); + sim_out_destroy(capsule->acados_sim_out); + sim_opts_destroy(capsule->acados_sim_opts); + sim_dims_destroy(capsule->acados_sim_dims); + sim_config_destroy(capsule->acados_sim_config); + + // free external function +{%- if solver_options.integrator_type == "IRK" %} + external_function_param_casadi_free(capsule->sim_impl_dae_fun); + external_function_param_casadi_free(capsule->sim_impl_dae_fun_jac_x_xdot_z); + external_function_param_casadi_free(capsule->sim_impl_dae_jac_x_xdot_u_z); +{%- if hessian_approx == "EXACT" %} + external_function_param_casadi_free(capsule->sim_impl_dae_hess); +{%- endif %} +{%- elif solver_options.integrator_type == "ERK" %} + external_function_param_casadi_free(capsule->sim_forw_vde_casadi); + external_function_param_casadi_free(capsule->sim_expl_ode_fun_casadi); +{%- if hessian_approx == "EXACT" %} + external_function_param_casadi_free(capsule->sim_expl_ode_hess); +{%- endif %} +{%- elif solver_options.integrator_type == "GNSF" %} + external_function_param_casadi_free(capsule->sim_gnsf_phi_fun); + external_function_param_casadi_free(capsule->sim_gnsf_phi_fun_jac_y); + external_function_param_casadi_free(capsule->sim_gnsf_phi_jac_y_uhat); + external_function_param_casadi_free(capsule->sim_gnsf_f_lo_jac_x1_x1dot_u_z); + external_function_param_casadi_free(capsule->sim_gnsf_get_matrices_fun); +{% endif %} + + return 0; +} + + +int {{ model.name }}_acados_sim_update_params(sim_solver_capsule *capsule, double *p, int np) +{ + int status = 0; + int casadi_np = {{ model.name | upper }}_NP; + + if (casadi_np != np) { + printf("{{ model.name }}_acados_sim_update_params: trying to set %i parameters for external functions." + " External function has %i parameters. Exiting.\n", np, casadi_np); + exit(1); + } + +{%- if solver_options.integrator_type == "ERK" %} + capsule->sim_forw_vde_casadi[0].set_param(capsule->sim_forw_vde_casadi, p); + capsule->sim_expl_ode_fun_casadi[0].set_param(capsule->sim_expl_ode_fun_casadi, p); +{%- if hessian_approx == "EXACT" %} + capsule->sim_expl_ode_hess[0].set_param(capsule->sim_expl_ode_hess, p); +{%- endif %} +{%- elif solver_options.integrator_type == "IRK" %} + capsule->sim_impl_dae_fun[0].set_param(capsule->sim_impl_dae_fun, p); + capsule->sim_impl_dae_fun_jac_x_xdot_z[0].set_param(capsule->sim_impl_dae_fun_jac_x_xdot_z, p); + capsule->sim_impl_dae_jac_x_xdot_u_z[0].set_param(capsule->sim_impl_dae_jac_x_xdot_u_z, p); +{%- if hessian_approx == "EXACT" %} + capsule->sim_impl_dae_hess[0].set_param(capsule->sim_impl_dae_hess, p); +{%- endif %} +{%- elif solver_options.integrator_type == "GNSF" %} + capsule->sim_gnsf_phi_fun[0].set_param(capsule->sim_gnsf_phi_fun, p); + capsule->sim_gnsf_phi_fun_jac_y[0].set_param(capsule->sim_gnsf_phi_fun_jac_y, p); + capsule->sim_gnsf_phi_jac_y_uhat[0].set_param(capsule->sim_gnsf_phi_jac_y_uhat, p); + capsule->sim_gnsf_f_lo_jac_x1_x1dot_u_z[0].set_param(capsule->sim_gnsf_f_lo_jac_x1_x1dot_u_z, p); + capsule->sim_gnsf_get_matrices_fun[0].set_param(capsule->sim_gnsf_get_matrices_fun, p); +{% endif %} + + return status; +} + +/* getters pointers to C objects*/ +sim_config * {{ model.name }}_acados_get_sim_config(sim_solver_capsule *capsule) +{ + return capsule->acados_sim_config; +}; + +sim_in * {{ model.name }}_acados_get_sim_in(sim_solver_capsule *capsule) +{ + return capsule->acados_sim_in; +}; + +sim_out * {{ model.name }}_acados_get_sim_out(sim_solver_capsule *capsule) +{ + return capsule->acados_sim_out; +}; + +void * {{ model.name }}_acados_get_sim_dims(sim_solver_capsule *capsule) +{ + return capsule->acados_sim_dims; +}; + +sim_opts * {{ model.name }}_acados_get_sim_opts(sim_solver_capsule *capsule) +{ + return capsule->acados_sim_opts; +}; + +sim_solver * {{ model.name }}_acados_get_sim_solver(sim_solver_capsule *capsule) +{ + return capsule->acados_sim_solver; +}; + diff --git a/pyextra/acados_template/c_templates_tera/acados_sim_solver.in.h b/pyextra/acados_template/c_templates_tera/acados_sim_solver.in.h new file mode 100644 index 000000000..4da8202d3 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/acados_sim_solver.in.h @@ -0,0 +1,103 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +#ifndef ACADOS_SIM_{{ model.name }}_H_ +#define ACADOS_SIM_{{ model.name }}_H_ + +#include "acados_c/sim_interface.h" +#include "acados_c/external_function_interface.h" + +#define {{ model.name | upper }}_NX {{ dims.nx }} +#define {{ model.name | upper }}_NZ {{ dims.nz }} +#define {{ model.name | upper }}_NU {{ dims.nu }} +#define {{ model.name | upper }}_NP {{ dims.np }} + +#ifdef __cplusplus +extern "C" { +#endif + + +// ** capsule for solver data ** +typedef struct sim_solver_capsule +{ + // acados objects + sim_in *acados_sim_in; + sim_out *acados_sim_out; + sim_solver *acados_sim_solver; + sim_opts *acados_sim_opts; + sim_config *acados_sim_config; + void *acados_sim_dims; + + /* external functions */ + // ERK + external_function_param_casadi * sim_forw_vde_casadi; + external_function_param_casadi * sim_expl_ode_fun_casadi; + external_function_param_casadi * sim_expl_ode_hess; + + // IRK + external_function_param_casadi * sim_impl_dae_fun; + external_function_param_casadi * sim_impl_dae_fun_jac_x_xdot_z; + external_function_param_casadi * sim_impl_dae_jac_x_xdot_u_z; + external_function_param_casadi * sim_impl_dae_hess; + + // GNSF + external_function_param_casadi * sim_gnsf_phi_fun; + external_function_param_casadi * sim_gnsf_phi_fun_jac_y; + external_function_param_casadi * sim_gnsf_phi_jac_y_uhat; + external_function_param_casadi * sim_gnsf_f_lo_jac_x1_x1dot_u_z; + external_function_param_casadi * sim_gnsf_get_matrices_fun; + +} sim_solver_capsule; + + +int {{ model.name }}_acados_sim_create(sim_solver_capsule *capsule); +int {{ model.name }}_acados_sim_solve(sim_solver_capsule *capsule); +int {{ model.name }}_acados_sim_free(sim_solver_capsule *capsule); +int {{ model.name }}_acados_sim_update_params(sim_solver_capsule *capsule, double *value, int np); + +sim_config * {{ model.name }}_acados_get_sim_config(sim_solver_capsule *capsule); +sim_in * {{ model.name }}_acados_get_sim_in(sim_solver_capsule *capsule); +sim_out * {{ model.name }}_acados_get_sim_out(sim_solver_capsule *capsule); +void * {{ model.name }}_acados_get_sim_dims(sim_solver_capsule *capsule); +sim_opts * {{ model.name }}_acados_get_sim_opts(sim_solver_capsule *capsule); +sim_solver * {{ model.name }}_acados_get_sim_solver(sim_solver_capsule *capsule); + + +sim_solver_capsule * {{ model.name }}_acados_sim_solver_create_capsule(void); +int {{ model.name }}_acados_sim_solver_free_capsule(sim_solver_capsule *capsule); + +#ifdef __cplusplus +} +#endif + +#endif // ACADOS_SIM_{{ model.name }}_H_ diff --git a/pyextra/acados_template/c_templates_tera/acados_sim_solver_sfun.in.c b/pyextra/acados_template/c_templates_tera/acados_sim_solver_sfun.in.c new file mode 100644 index 000000000..234295fa2 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/acados_sim_solver_sfun.in.c @@ -0,0 +1,233 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +#define S_FUNCTION_NAME acados_sim_solver_sfunction_{{ model.name }} +#define S_FUNCTION_LEVEL 2 + +#define MDL_START + +// acados +#include "acados/utils/print.h" +#include "acados_c/ocp_nlp_interface.h" +#include "acados_c/external_function_interface.h" + +// example specific +#include "{{ model.name }}_model/{{ model.name }}_model.h" +#include "acados_sim_solver_{{ model.name }}.h" + +#include "simstruc.h" + +#define SAMPLINGTIME {{ solver_options.Tsim }} + + +static void mdlInitializeSizes (SimStruct *S) +{ + // specify the number of continuous and discrete states + ssSetNumContStates(S, 0); + ssSetNumDiscStates(S, 0); + + {# compute number of input ports #} + {%- set n_inputs = 1 %} {# x0 #} + {%- if dims.nu > 0 %} {# u0 -#} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif %} + {%- if dims.np > 0 %} {# parameters #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif %} + + // specify the number of input ports + if ( !ssSetNumInputPorts(S, {{ n_inputs }}) ) + return; + + // specify the number of output ports + if ( !ssSetNumOutputPorts(S, 1) ) + return; + + // specify dimension information for the input ports + {%- set i_input = 0 %} + // x0 + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.nx }}); + + {%- if dims.nu > 0 %} + {%- set i_input = i_input + 1 %} + // u0 + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.nu }}); + {%- endif %} + + {%- if dims.np > 0 %} + {%- set i_input = i_input + 1 %} + // parameters + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.np }}); + {%- endif %} + + // specify dimension information for the output ports + ssSetOutputPortVectorDimension(S, 0, {{ dims.nx }} ); // xnext + + // specify the direct feedthrough status + // should be set to 1 for all inputs used in mdlOutputs + {%- for i in range(end=n_inputs) %} + ssSetInputPortDirectFeedThrough(S, {{ i }}, 1); + {%- endfor %} + + // one sample time + ssSetNumSampleTimes(S, 1); +} + + +#if defined(MATLAB_MEX_FILE) + +#define MDL_SET_INPUT_PORT_DIMENSION_INFO +#define MDL_SET_OUTPUT_PORT_DIMENSION_INFO + +static void mdlSetInputPortDimensionInfo(SimStruct *S, int_T port, const DimsInfo_T *dimsInfo) +{ + if ( !ssSetInputPortDimensionInfo(S, port, dimsInfo) ) + return; +} + +static void mdlSetOutputPortDimensionInfo(SimStruct *S, int_T port, const DimsInfo_T *dimsInfo) +{ + if ( !ssSetOutputPortDimensionInfo(S, port, dimsInfo) ) + return; +} + +#endif /* MATLAB_MEX_FILE */ + + +static void mdlInitializeSampleTimes(SimStruct *S) +{ + ssSetSampleTime(S, 0, SAMPLINGTIME); + ssSetOffsetTime(S, 0, 0.0); +} + + +static void mdlStart(SimStruct *S) +{ + sim_solver_capsule *capsule = {{ model.name }}_acados_sim_solver_create_capsule(); + {{ model.name }}_acados_sim_create(capsule); + + ssSetUserData(S, (void*)capsule); +} + +static void mdlOutputs(SimStruct *S, int_T tid) +{ + sim_solver_capsule *capsule = ssGetUserData(S); + + sim_config *acados_sim_config = {{ model.name }}_acados_get_sim_config(capsule); + sim_in *acados_sim_in = {{ model.name }}_acados_get_sim_in(capsule); + sim_out *acados_sim_out = {{ model.name }}_acados_get_sim_out(capsule); + void *acados_sim_dims = {{ model.name }}_acados_get_sim_dims(capsule); + // sim_opts * {{ model.name }}_acados_get_sim_opts(capsule); + // sim_solver * {{ model.name }}_acados_get_sim_solver(capsule); + + InputRealPtrsType in_sign; + {% set input_sizes = [dims.nx, dims.nu, dims.np] %} + + // local buffer + {%- set buffer_size = input_sizes | sort | last %} + real_t buffer[{{ buffer_size }}]; + + + /* go through inputs */ + {%- set i_input = 0 %} + // initial condition + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + for (int i = 0; i < {{ dims.nx }}; i++) + buffer[i] = (double)(*in_sign[i]); + + sim_in_set(acados_sim_config, acados_sim_dims, + acados_sim_in, "x", buffer); + + + // ssPrintf("\nin acados sim:\n"); + // for (int i = 0; i < {{ dims.nx }}; i++) ssPrintf("x0[%d] = %f\n", i, buffer[i]); + // ssPrintf("\n"); + +{% if dims.nu > 0 %} + // control input - u + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + + for (int i = 0; i < {{ dims.nu }}; i++) + buffer[i] = (double)(*in_sign[i]); + + sim_in_set(acados_sim_config, acados_sim_dims, + acados_sim_in, "u", buffer); +{%- endif %} + + +{% if dims.np > 0 %} + // parameters + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + + for (int i = 0; i < {{ dims.np }}; i++) + buffer[i] = (double)(*in_sign[i]); + + // update value of parameters + {{ model.name }}_acados_sim_update_params(capsule, buffer, {{ dims.np }}); +{%- endif %} + + + /* call solver */ + int acados_status = {{ model.name }}_acados_sim_solve(capsule); + + + /* set outputs */ + real_t *out_x = ssGetOutputPortRealSignal(S, 0); + + // get simulated state + sim_out_get(acados_sim_config, acados_sim_dims, acados_sim_out, + "xn", (void *) out_x); + + // ssPrintf("\nacados sim solve: returned %d\n", acados_status); + // for (int i = 0; i < {{ dims.nx }}; i++) ssPrintf("x_sim[%d] = %f\n", i, out_x[i]); + // ssPrintf("\n"); + +} + + +static void mdlTerminate(SimStruct *S) +{ + sim_solver_capsule *capsule = ssGetUserData(S); + + {{ model.name }}_acados_sim_free(capsule); + {{ model.name }}_acados_sim_solver_free_capsule(capsule); +} + + +#ifdef MATLAB_MEX_FILE +#include "simulink.c" +#else +#include "cg_sfun.h" +#endif diff --git a/pyextra/acados_template/c_templates_tera/acados_solver.in.c b/pyextra/acados_template/c_templates_tera/acados_solver.in.c new file mode 100644 index 000000000..6e13242a4 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/acados_solver.in.c @@ -0,0 +1,2491 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +// standard +#include +#include +// acados +#include "acados/utils/print.h" +#include "acados_c/ocp_nlp_interface.h" +#include "acados_c/external_function_interface.h" + +// example specific +#include "{{ model.name }}_model/{{ model.name }}_model.h" +{% if constraints.constr_type == "BGP" and dims.nphi %} +#include "{{ model.name }}_constraints/{{ model.name }}_phi_constraint.h" +{% endif %} +{% if constraints.constr_type_e == "BGP" and dims.nphi_e > 0 %} +#include "{{ model.name }}_constraints/{{ model.name }}_phi_e_constraint.h" +{% endif %} +{% if constraints.constr_type == "BGH" and dims.nh > 0 %} +#include "{{ model.name }}_constraints/{{ model.name }}_h_constraint.h" +{% endif %} +{% if constraints.constr_type_e == "BGH" and dims.nh_e > 0 %} +#include "{{ model.name }}_constraints/{{ model.name }}_h_e_constraint.h" +{% endif %} +{%- if cost.cost_type == "NONLINEAR_LS" %} +#include "{{ model.name }}_cost/{{ model.name }}_cost_y_fun.h" +{%- elif cost.cost_type == "EXTERNAL" %} +#include "{{ model.name }}_cost/{{ model.name }}_external_cost.h" +{%- endif %} +{%- if cost.cost_type_0 == "NONLINEAR_LS" %} +#include "{{ model.name }}_cost/{{ model.name }}_cost_y_0_fun.h" +{%- elif cost.cost_type_0 == "EXTERNAL" %} +#include "{{ model.name }}_cost/{{ model.name }}_external_cost_0.h" +{%- endif %} +{%- if cost.cost_type_e == "NONLINEAR_LS" %} +#include "{{ model.name }}_cost/{{ model.name }}_cost_y_e_fun.h" +{%- elif cost.cost_type_e == "EXTERNAL" %} +#include "{{ model.name }}_cost/{{ model.name }}_external_cost_e.h" +{%- endif %} + +#include "acados_solver_{{ model.name }}.h" + +#define NX {{ model.name | upper }}_NX +#define NZ {{ model.name | upper }}_NZ +#define NU {{ model.name | upper }}_NU +#define NP {{ model.name | upper }}_NP +#define NBX {{ model.name | upper }}_NBX +#define NBX0 {{ model.name | upper }}_NBX0 +#define NBU {{ model.name | upper }}_NBU +#define NSBX {{ model.name | upper }}_NSBX +#define NSBU {{ model.name | upper }}_NSBU +#define NSH {{ model.name | upper }}_NSH +#define NSG {{ model.name | upper }}_NSG +#define NSPHI {{ model.name | upper }}_NSPHI +#define NSHN {{ model.name | upper }}_NSHN +#define NSGN {{ model.name | upper }}_NSGN +#define NSPHIN {{ model.name | upper }}_NSPHIN +#define NSBXN {{ model.name | upper }}_NSBXN +#define NS {{ model.name | upper }}_NS +#define NSN {{ model.name | upper }}_NSN +#define NG {{ model.name | upper }}_NG +#define NBXN {{ model.name | upper }}_NBXN +#define NGN {{ model.name | upper }}_NGN +#define NY0 {{ model.name | upper }}_NY0 +#define NY {{ model.name | upper }}_NY +#define NYN {{ model.name | upper }}_NYN +// #define N {{ model.name | upper }}_N +#define NH {{ model.name | upper }}_NH +#define NPHI {{ model.name | upper }}_NPHI +#define NHN {{ model.name | upper }}_NHN +#define NPHIN {{ model.name | upper }}_NPHIN +#define NR {{ model.name | upper }}_NR + + +// ** solver data ** + +{{ model.name }}_solver_capsule * {{ model.name }}_acados_create_capsule(void) +{ + void* capsule_mem = malloc(sizeof({{ model.name }}_solver_capsule)); + {{ model.name }}_solver_capsule *capsule = ({{ model.name }}_solver_capsule *) capsule_mem; + + return capsule; +} + + +int {{ model.name }}_acados_free_capsule({{ model.name }}_solver_capsule *capsule) +{ + free(capsule); + return 0; +} + + +int {{ model.name }}_acados_create({{ model.name }}_solver_capsule * capsule) +{ + int N_shooting_intervals = {{ model.name | upper }}_N; + double* new_time_steps = NULL; // NULL -> don't alter the code generated time-steps + return {{ model.name }}_acados_create_with_discretization(capsule, N_shooting_intervals, new_time_steps); +} + +int {{ model.name }}_acados_update_time_steps({{ model.name }}_solver_capsule * capsule, int N, double* new_time_steps) +{ + if (N != capsule->nlp_solver_plan->N) { + fprintf(stderr, "{{ model.name }}_acados_update_time_steps: given number of time steps (= %d) " \ + "differs from the currently allocated number of " \ + "time steps (= %d)!\n" \ + "Please recreate with new discretization and provide a new vector of time_stamps!\n", + N, capsule->nlp_solver_plan->N); + return 1; + } + + ocp_nlp_config * nlp_config = capsule->nlp_config; + ocp_nlp_dims * nlp_dims = capsule->nlp_dims; + ocp_nlp_in * nlp_in = capsule->nlp_in; + + for (int i = 0; i < N; i++) + { + ocp_nlp_in_set(nlp_config, nlp_dims, nlp_in, i, "Ts", &new_time_steps[i]); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "scaling", &new_time_steps[i]); + } + return 0; +} + +int {{ model.name }}_acados_create_with_discretization({{ model.name }}_solver_capsule * capsule, int N, double* new_time_steps) +{ + int status = 0; + // If N does not match the number of shooting intervals used for code generation, new_time_steps must be given. + if (N != {{ model.name | upper }}_N && !new_time_steps) { + fprintf(stderr, "{{ model.name }}_acados_create_with_discretization: new_time_steps is NULL " \ + "but the number of shooting intervals (= %d) differs from the number of " \ + "shooting intervals (= %d) during code generation! Please provide a new vector of time_stamps!\n", \ + N, {{ model.name | upper }}_N); + return 1; + } + + // number of expected runtime parameters + capsule->nlp_np = NP; + + /************************************************ + * plan & config + ************************************************/ + ocp_nlp_plan * nlp_solver_plan = ocp_nlp_plan_create(N); + capsule->nlp_solver_plan = nlp_solver_plan; + + {%- if solver_options.nlp_solver_type == "SQP" %} + nlp_solver_plan->nlp_solver = SQP; + {% else %} + nlp_solver_plan->nlp_solver = SQP_RTI; + {%- endif %} + + nlp_solver_plan->ocp_qp_solver_plan.qp_solver = {{ solver_options.qp_solver }}; + + nlp_solver_plan->nlp_cost[0] = {{ cost.cost_type_0 }}; + for (int i = 1; i < N; i++) + nlp_solver_plan->nlp_cost[i] = {{ cost.cost_type }}; + + nlp_solver_plan->nlp_cost[N] = {{ cost.cost_type_e }}; + + for (int i = 0; i < N; i++) + { + {% if solver_options.integrator_type == "DISCRETE" %} + nlp_solver_plan->nlp_dynamics[i] = DISCRETE_MODEL; + // discrete dynamics does not need sim solver option, this field is ignored + nlp_solver_plan->sim_solver_plan[i].sim_solver = INVALID_SIM_SOLVER; + {% else %} + nlp_solver_plan->nlp_dynamics[i] = CONTINUOUS_MODEL; + nlp_solver_plan->sim_solver_plan[i].sim_solver = {{ solver_options.integrator_type }}; + {%- endif %} + } + + for (int i = 0; i < N; i++) + { + {% if constraints.constr_type == "BGP" %} + nlp_solver_plan->nlp_constraints[i] = BGP; + {%- else -%} + nlp_solver_plan->nlp_constraints[i] = BGH; + {%- endif %} + } + + {%- if constraints.constr_type_e == "BGP" %} + nlp_solver_plan->nlp_constraints[N] = BGP; + {% else %} + nlp_solver_plan->nlp_constraints[N] = BGH; + {%- endif %} + +{%- if solver_options.hessian_approx == "EXACT" %} + {%- if solver_options.regularize_method == "NO_REGULARIZE" %} + nlp_solver_plan->regularization = NO_REGULARIZE; + {%- elif solver_options.regularize_method == "MIRROR" %} + nlp_solver_plan->regularization = MIRROR; + {%- elif solver_options.regularize_method == "PROJECT" %} + nlp_solver_plan->regularization = PROJECT; + {%- elif solver_options.regularize_method == "PROJECT_REDUC_HESS" %} + nlp_solver_plan->regularization = PROJECT_REDUC_HESS; + {%- elif solver_options.regularize_method == "CONVEXIFY" %} + nlp_solver_plan->regularization = CONVEXIFY; + {%- endif %} +{%- endif %} + ocp_nlp_config * nlp_config = ocp_nlp_config_create(*nlp_solver_plan); + capsule->nlp_config = nlp_config; + + + /************************************************ + * dimensions + ************************************************/ + #define NINTNP1MEMS 17 + int* intNp1mem = (int*)malloc( (N+1)*sizeof(int)*NINTNP1MEMS ); + + int* nx = intNp1mem + (N+1)*0; + int* nu = intNp1mem + (N+1)*1; + int* nbx = intNp1mem + (N+1)*2; + int* nbu = intNp1mem + (N+1)*3; + int* nsbx = intNp1mem + (N+1)*4; + int* nsbu = intNp1mem + (N+1)*5; + int* nsg = intNp1mem + (N+1)*6; + int* nsh = intNp1mem + (N+1)*7; + int* nsphi = intNp1mem + (N+1)*8; + int* ns = intNp1mem + (N+1)*9; + int* ng = intNp1mem + (N+1)*10; + int* nh = intNp1mem + (N+1)*11; + int* nphi = intNp1mem + (N+1)*12; + int* nz = intNp1mem + (N+1)*13; + int* ny = intNp1mem + (N+1)*14; + int* nr = intNp1mem + (N+1)*15; + int* nbxe = intNp1mem + (N+1)*16; + + for (int i = 0; i < N+1; i++) + { + // common + nx[i] = NX; + nu[i] = NU; + nz[i] = NZ; + ns[i] = NS; + // cost + ny[i] = NY; + // constraints + nbx[i] = NBX; + nbu[i] = NBU; + nsbx[i] = NSBX; + nsbu[i] = NSBU; + nsg[i] = NSG; + nsh[i] = NSH; + nsphi[i] = NSPHI; + ng[i] = NG; + nh[i] = NH; + nphi[i] = NPHI; + nr[i] = NR; + nbxe[i] = 0; + } + + // for initial state + nbx[0] = NBX0; + nsbx[0] = 0; + ns[0] = NS - NSBX; + nbxe[0] = {{ dims.nbxe_0 }}; + ny[0] = NY0; + + // terminal - common + nu[N] = 0; + nz[N] = 0; + ns[N] = NSN; + // cost + ny[N] = NYN; + // constraint + nbx[N] = NBXN; + nbu[N] = 0; + ng[N] = NGN; + nh[N] = NHN; + nphi[N] = NPHIN; + nr[N] = {{ dims.nr_e }}; + + nsbx[N] = NSBXN; + nsbu[N] = 0; + nsg[N] = NSGN; + nsh[N] = NSHN; + nsphi[N] = NSPHIN; + + /* create and set ocp_nlp_dims */ + ocp_nlp_dims * nlp_dims = ocp_nlp_dims_create(nlp_config); + capsule->nlp_dims = nlp_dims; + + ocp_nlp_dims_set_opt_vars(nlp_config, nlp_dims, "nx", nx); + ocp_nlp_dims_set_opt_vars(nlp_config, nlp_dims, "nu", nu); + ocp_nlp_dims_set_opt_vars(nlp_config, nlp_dims, "nz", nz); + ocp_nlp_dims_set_opt_vars(nlp_config, nlp_dims, "ns", ns); + + for (int i = 0; i <= N; i++) + { + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nbx", &nbx[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nbu", &nbu[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nsbx", &nsbx[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nsbu", &nsbu[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "ng", &ng[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nsg", &nsg[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nbxe", &nbxe[i]); + } + + {%- if cost.cost_type_0 == "NONLINEAR_LS" or cost.cost_type_0 == "LINEAR_LS" %} + ocp_nlp_dims_set_cost(nlp_config, nlp_dims, 0, "ny", &ny[0]); + {%- endif %} + + {%- if cost.cost_type == "NONLINEAR_LS" or cost.cost_type == "LINEAR_LS" %} + for (int i = 1; i < N; i++) + ocp_nlp_dims_set_cost(nlp_config, nlp_dims, i, "ny", &ny[i]); + {%- endif %} + + for (int i = 0; i < N; i++) + { + {%- if constraints.constr_type == "BGH" and dims.nh > 0 %} + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nh", &nh[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nsh", &nsh[i]); + {%- elif constraints.constr_type == "BGP" and dims.nphi > 0 %} + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nr", &nr[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nphi", &nphi[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nsphi", &nsphi[i]); + {%- endif %} + } + + {%- if constraints.constr_type_e == "BGH" %} + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, N, "nh", &nh[N]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, N, "nsh", &nsh[N]); + {%- elif constraints.constr_type_e == "BGP" %} + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, N, "nr", &nr[N]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, N, "nphi", &nphi[N]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, N, "nsphi", &nsphi[N]); + {%- endif %} + {%- if cost.cost_type_e == "NONLINEAR_LS" or cost.cost_type_e == "LINEAR_LS" %} + ocp_nlp_dims_set_cost(nlp_config, nlp_dims, N, "ny", &ny[N]); + {%- endif %} + + free(intNp1mem); + +{% if solver_options.integrator_type == "GNSF" -%} + // GNSF specific dimensions + int gnsf_nx1 = {{ dims.gnsf_nx1 }}; + int gnsf_nz1 = {{ dims.gnsf_nz1 }}; + int gnsf_nout = {{ dims.gnsf_nout }}; + int gnsf_ny = {{ dims.gnsf_ny }}; + int gnsf_nuhat = {{ dims.gnsf_nuhat }}; + + for (int i = 0; i < N; i++) + { + if (nlp_solver_plan->sim_solver_plan[i].sim_solver == GNSF) + { + ocp_nlp_dims_set_dynamics(nlp_config, nlp_dims, i, "gnsf_nx1", &gnsf_nx1); + ocp_nlp_dims_set_dynamics(nlp_config, nlp_dims, i, "gnsf_nz1", &gnsf_nz1); + ocp_nlp_dims_set_dynamics(nlp_config, nlp_dims, i, "gnsf_nout", &gnsf_nout); + ocp_nlp_dims_set_dynamics(nlp_config, nlp_dims, i, "gnsf_ny", &gnsf_ny); + ocp_nlp_dims_set_dynamics(nlp_config, nlp_dims, i, "gnsf_nuhat", &gnsf_nuhat); + } + } +{%- endif %} + + /************************************************ + * external functions + ************************************************/ + {%- if constraints.constr_type == "BGP" %} + capsule->phi_constraint = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) + { + // nonlinear part of convex-composite constraint + capsule->phi_constraint[i].casadi_fun = &{{ model.name }}_phi_constraint; + capsule->phi_constraint[i].casadi_n_in = &{{ model.name }}_phi_constraint_n_in; + capsule->phi_constraint[i].casadi_n_out = &{{ model.name }}_phi_constraint_n_out; + capsule->phi_constraint[i].casadi_sparsity_in = &{{ model.name }}_phi_constraint_sparsity_in; + capsule->phi_constraint[i].casadi_sparsity_out = &{{ model.name }}_phi_constraint_sparsity_out; + capsule->phi_constraint[i].casadi_work = &{{ model.name }}_phi_constraint_work; + + external_function_param_casadi_create(&capsule->phi_constraint[i], {{ dims.np }}); + } + {%- endif %} + + {%- if constraints.constr_type_e == "BGP" %} + // nonlinear part of convex-composite constraint + capsule->phi_e_constraint.casadi_fun = &{{ model.name }}_phi_e_constraint; + capsule->phi_e_constraint.casadi_n_in = &{{ model.name }}_phi_e_constraint_n_in; + capsule->phi_e_constraint.casadi_n_out = &{{ model.name }}_phi_e_constraint_n_out; + capsule->phi_e_constraint.casadi_sparsity_in = &{{ model.name }}_phi_e_constraint_sparsity_in; + capsule->phi_e_constraint.casadi_sparsity_out = &{{ model.name }}_phi_e_constraint_sparsity_out; + capsule->phi_e_constraint.casadi_work = &{{ model.name }}_phi_e_constraint_work; + + external_function_param_casadi_create(&capsule->phi_e_constraint, {{ dims.np }}); + {% endif %} + + {%- if constraints.constr_type == "BGH" and dims.nh > 0 %} + capsule->nl_constr_h_fun_jac = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->nl_constr_h_fun_jac[i].casadi_fun = &{{ model.name }}_constr_h_fun_jac_uxt_zt; + capsule->nl_constr_h_fun_jac[i].casadi_n_in = &{{ model.name }}_constr_h_fun_jac_uxt_zt_n_in; + capsule->nl_constr_h_fun_jac[i].casadi_n_out = &{{ model.name }}_constr_h_fun_jac_uxt_zt_n_out; + capsule->nl_constr_h_fun_jac[i].casadi_sparsity_in = &{{ model.name }}_constr_h_fun_jac_uxt_zt_sparsity_in; + capsule->nl_constr_h_fun_jac[i].casadi_sparsity_out = &{{ model.name }}_constr_h_fun_jac_uxt_zt_sparsity_out; + capsule->nl_constr_h_fun_jac[i].casadi_work = &{{ model.name }}_constr_h_fun_jac_uxt_zt_work; + external_function_param_casadi_create(&capsule->nl_constr_h_fun_jac[i], {{ dims.np }}); + } + capsule->nl_constr_h_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->nl_constr_h_fun[i].casadi_fun = &{{ model.name }}_constr_h_fun; + capsule->nl_constr_h_fun[i].casadi_n_in = &{{ model.name }}_constr_h_fun_n_in; + capsule->nl_constr_h_fun[i].casadi_n_out = &{{ model.name }}_constr_h_fun_n_out; + capsule->nl_constr_h_fun[i].casadi_sparsity_in = &{{ model.name }}_constr_h_fun_sparsity_in; + capsule->nl_constr_h_fun[i].casadi_sparsity_out = &{{ model.name }}_constr_h_fun_sparsity_out; + capsule->nl_constr_h_fun[i].casadi_work = &{{ model.name }}_constr_h_fun_work; + external_function_param_casadi_create(&capsule->nl_constr_h_fun[i], {{ dims.np }}); + } + {% if solver_options.hessian_approx == "EXACT" %} + capsule->nl_constr_h_fun_jac_hess = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->nl_constr_h_fun_jac_hess[i].casadi_fun = &{{ model.name }}_constr_h_fun_jac_uxt_zt_hess; + capsule->nl_constr_h_fun_jac_hess[i].casadi_n_in = &{{ model.name }}_constr_h_fun_jac_uxt_zt_hess_n_in; + capsule->nl_constr_h_fun_jac_hess[i].casadi_n_out = &{{ model.name }}_constr_h_fun_jac_uxt_zt_hess_n_out; + capsule->nl_constr_h_fun_jac_hess[i].casadi_sparsity_in = &{{ model.name }}_constr_h_fun_jac_uxt_zt_hess_sparsity_in; + capsule->nl_constr_h_fun_jac_hess[i].casadi_sparsity_out = &{{ model.name }}_constr_h_fun_jac_uxt_zt_hess_sparsity_out; + capsule->nl_constr_h_fun_jac_hess[i].casadi_work = &{{ model.name }}_constr_h_fun_jac_uxt_zt_hess_work; + + external_function_param_casadi_create(&capsule->nl_constr_h_fun_jac_hess[i], {{ dims.np }}); + } + {% endif %} + {% endif %} + + {%- if constraints.constr_type_e == "BGH" and dims.nh_e > 0 %} + capsule->nl_constr_h_e_fun_jac.casadi_fun = &{{ model.name }}_constr_h_e_fun_jac_uxt_zt; + capsule->nl_constr_h_e_fun_jac.casadi_n_in = &{{ model.name }}_constr_h_e_fun_jac_uxt_zt_n_in; + capsule->nl_constr_h_e_fun_jac.casadi_n_out = &{{ model.name }}_constr_h_e_fun_jac_uxt_zt_n_out; + capsule->nl_constr_h_e_fun_jac.casadi_sparsity_in = &{{ model.name }}_constr_h_e_fun_jac_uxt_zt_sparsity_in; + capsule->nl_constr_h_e_fun_jac.casadi_sparsity_out = &{{ model.name }}_constr_h_e_fun_jac_uxt_zt_sparsity_out; + capsule->nl_constr_h_e_fun_jac.casadi_work = &{{ model.name }}_constr_h_e_fun_jac_uxt_zt_work; + external_function_param_casadi_create(&capsule->nl_constr_h_e_fun_jac, {{ dims.np }}); + + capsule->nl_constr_h_e_fun.casadi_fun = &{{ model.name }}_constr_h_e_fun; + capsule->nl_constr_h_e_fun.casadi_n_in = &{{ model.name }}_constr_h_e_fun_n_in; + capsule->nl_constr_h_e_fun.casadi_n_out = &{{ model.name }}_constr_h_e_fun_n_out; + capsule->nl_constr_h_e_fun.casadi_sparsity_in = &{{ model.name }}_constr_h_e_fun_sparsity_in; + capsule->nl_constr_h_e_fun.casadi_sparsity_out = &{{ model.name }}_constr_h_e_fun_sparsity_out; + capsule->nl_constr_h_e_fun.casadi_work = &{{ model.name }}_constr_h_e_fun_work; + external_function_param_casadi_create(&capsule->nl_constr_h_e_fun, {{ dims.np }}); + + {% if solver_options.hessian_approx == "EXACT" %} + capsule->nl_constr_h_e_fun_jac_hess.casadi_fun = &{{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess; + capsule->nl_constr_h_e_fun_jac_hess.casadi_n_in = &{{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess_n_in; + capsule->nl_constr_h_e_fun_jac_hess.casadi_n_out = &{{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess_n_out; + capsule->nl_constr_h_e_fun_jac_hess.casadi_sparsity_in = &{{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess_sparsity_in; + capsule->nl_constr_h_e_fun_jac_hess.casadi_sparsity_out = &{{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess_sparsity_out; + capsule->nl_constr_h_e_fun_jac_hess.casadi_work = &{{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess_work; + external_function_param_casadi_create(&capsule->nl_constr_h_e_fun_jac_hess, {{ dims.np }}); + {% endif %} + {%- endif %} + +{% if solver_options.integrator_type == "ERK" %} + // explicit ode + capsule->forw_vde_casadi = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->forw_vde_casadi[i].casadi_fun = &{{ model.name }}_expl_vde_forw; + capsule->forw_vde_casadi[i].casadi_n_in = &{{ model.name }}_expl_vde_forw_n_in; + capsule->forw_vde_casadi[i].casadi_n_out = &{{ model.name }}_expl_vde_forw_n_out; + capsule->forw_vde_casadi[i].casadi_sparsity_in = &{{ model.name }}_expl_vde_forw_sparsity_in; + capsule->forw_vde_casadi[i].casadi_sparsity_out = &{{ model.name }}_expl_vde_forw_sparsity_out; + capsule->forw_vde_casadi[i].casadi_work = &{{ model.name }}_expl_vde_forw_work; + external_function_param_casadi_create(&capsule->forw_vde_casadi[i], {{ dims.np }}); + } + + capsule->expl_ode_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->expl_ode_fun[i].casadi_fun = &{{ model.name }}_expl_ode_fun; + capsule->expl_ode_fun[i].casadi_n_in = &{{ model.name }}_expl_ode_fun_n_in; + capsule->expl_ode_fun[i].casadi_n_out = &{{ model.name }}_expl_ode_fun_n_out; + capsule->expl_ode_fun[i].casadi_sparsity_in = &{{ model.name }}_expl_ode_fun_sparsity_in; + capsule->expl_ode_fun[i].casadi_sparsity_out = &{{ model.name }}_expl_ode_fun_sparsity_out; + capsule->expl_ode_fun[i].casadi_work = &{{ model.name }}_expl_ode_fun_work; + external_function_param_casadi_create(&capsule->expl_ode_fun[i], {{ dims.np }}); + } + + {%- if solver_options.hessian_approx == "EXACT" %} + capsule->hess_vde_casadi = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->hess_vde_casadi[i].casadi_fun = &{{ model.name }}_expl_ode_hess; + capsule->hess_vde_casadi[i].casadi_n_in = &{{ model.name }}_expl_ode_hess_n_in; + capsule->hess_vde_casadi[i].casadi_n_out = &{{ model.name }}_expl_ode_hess_n_out; + capsule->hess_vde_casadi[i].casadi_sparsity_in = &{{ model.name }}_expl_ode_hess_sparsity_in; + capsule->hess_vde_casadi[i].casadi_sparsity_out = &{{ model.name }}_expl_ode_hess_sparsity_out; + capsule->hess_vde_casadi[i].casadi_work = &{{ model.name }}_expl_ode_hess_work; + external_function_param_casadi_create(&capsule->hess_vde_casadi[i], {{ dims.np }}); + } + {%- endif %} + +{% elif solver_options.integrator_type == "IRK" %} + // implicit dae + capsule->impl_dae_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->impl_dae_fun[i].casadi_fun = &{{ model.name }}_impl_dae_fun; + capsule->impl_dae_fun[i].casadi_work = &{{ model.name }}_impl_dae_fun_work; + capsule->impl_dae_fun[i].casadi_sparsity_in = &{{ model.name }}_impl_dae_fun_sparsity_in; + capsule->impl_dae_fun[i].casadi_sparsity_out = &{{ model.name }}_impl_dae_fun_sparsity_out; + capsule->impl_dae_fun[i].casadi_n_in = &{{ model.name }}_impl_dae_fun_n_in; + capsule->impl_dae_fun[i].casadi_n_out = &{{ model.name }}_impl_dae_fun_n_out; + external_function_param_casadi_create(&capsule->impl_dae_fun[i], {{ dims.np }}); + } + + capsule->impl_dae_fun_jac_x_xdot_z = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->impl_dae_fun_jac_x_xdot_z[i].casadi_fun = &{{ model.name }}_impl_dae_fun_jac_x_xdot_z; + capsule->impl_dae_fun_jac_x_xdot_z[i].casadi_work = &{{ model.name }}_impl_dae_fun_jac_x_xdot_z_work; + capsule->impl_dae_fun_jac_x_xdot_z[i].casadi_sparsity_in = &{{ model.name }}_impl_dae_fun_jac_x_xdot_z_sparsity_in; + capsule->impl_dae_fun_jac_x_xdot_z[i].casadi_sparsity_out = &{{ model.name }}_impl_dae_fun_jac_x_xdot_z_sparsity_out; + capsule->impl_dae_fun_jac_x_xdot_z[i].casadi_n_in = &{{ model.name }}_impl_dae_fun_jac_x_xdot_z_n_in; + capsule->impl_dae_fun_jac_x_xdot_z[i].casadi_n_out = &{{ model.name }}_impl_dae_fun_jac_x_xdot_z_n_out; + external_function_param_casadi_create(&capsule->impl_dae_fun_jac_x_xdot_z[i], {{ dims.np }}); + } + + capsule->impl_dae_jac_x_xdot_u_z = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->impl_dae_jac_x_xdot_u_z[i].casadi_fun = &{{ model.name }}_impl_dae_jac_x_xdot_u_z; + capsule->impl_dae_jac_x_xdot_u_z[i].casadi_work = &{{ model.name }}_impl_dae_jac_x_xdot_u_z_work; + capsule->impl_dae_jac_x_xdot_u_z[i].casadi_sparsity_in = &{{ model.name }}_impl_dae_jac_x_xdot_u_z_sparsity_in; + capsule->impl_dae_jac_x_xdot_u_z[i].casadi_sparsity_out = &{{ model.name }}_impl_dae_jac_x_xdot_u_z_sparsity_out; + capsule->impl_dae_jac_x_xdot_u_z[i].casadi_n_in = &{{ model.name }}_impl_dae_jac_x_xdot_u_z_n_in; + capsule->impl_dae_jac_x_xdot_u_z[i].casadi_n_out = &{{ model.name }}_impl_dae_jac_x_xdot_u_z_n_out; + external_function_param_casadi_create(&capsule->impl_dae_jac_x_xdot_u_z[i], {{ dims.np }}); + } + + {%- if solver_options.hessian_approx == "EXACT" %} + capsule->impl_dae_hess = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->impl_dae_hess[i].casadi_fun = &{{ model.name }}_impl_dae_hess; + capsule->impl_dae_hess[i].casadi_work = &{{ model.name }}_impl_dae_hess_work; + capsule->impl_dae_hess[i].casadi_sparsity_in = &{{ model.name }}_impl_dae_hess_sparsity_in; + capsule->impl_dae_hess[i].casadi_sparsity_out = &{{ model.name }}_impl_dae_hess_sparsity_out; + capsule->impl_dae_hess[i].casadi_n_in = &{{ model.name }}_impl_dae_hess_n_in; + capsule->impl_dae_hess[i].casadi_n_out = &{{ model.name }}_impl_dae_hess_n_out; + external_function_param_casadi_create(&capsule->impl_dae_hess[i], {{ dims.np }}); + } + {%- endif %} +{% elif solver_options.integrator_type == "LIFTED_IRK" %} + // external functions (implicit model) + capsule->impl_dae_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->impl_dae_fun[i].casadi_fun = &{{ model.name }}_impl_dae_fun; + capsule->impl_dae_fun[i].casadi_work = &{{ model.name }}_impl_dae_fun_work; + capsule->impl_dae_fun[i].casadi_sparsity_in = &{{ model.name }}_impl_dae_fun_sparsity_in; + capsule->impl_dae_fun[i].casadi_sparsity_out = &{{ model.name }}_impl_dae_fun_sparsity_out; + capsule->impl_dae_fun[i].casadi_n_in = &{{ model.name }}_impl_dae_fun_n_in; + capsule->impl_dae_fun[i].casadi_n_out = &{{ model.name }}_impl_dae_fun_n_out; + external_function_param_casadi_create(&capsule->impl_dae_fun[i], {{ dims.np }}); + } + + capsule->impl_dae_fun_jac_x_xdot_u = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); for (int i = 0; i < N; i++) { + capsule->impl_dae_fun_jac_x_xdot_u[i].casadi_fun = &{{ model.name }}_impl_dae_fun_jac_x_xdot_u; + capsule->impl_dae_fun_jac_x_xdot_u[i].casadi_work = &{{ model.name }}_impl_dae_fun_jac_x_xdot_u_work; + capsule->impl_dae_fun_jac_x_xdot_u[i].casadi_sparsity_in = &{{ model.name }}_impl_dae_fun_jac_x_xdot_u_sparsity_in; + capsule->impl_dae_fun_jac_x_xdot_u[i].casadi_sparsity_out = &{{ model.name }}_impl_dae_fun_jac_x_xdot_u_sparsity_out; + capsule->impl_dae_fun_jac_x_xdot_u[i].casadi_n_in = &{{ model.name }}_impl_dae_fun_jac_x_xdot_u_n_in; + capsule->impl_dae_fun_jac_x_xdot_u[i].casadi_n_out = &{{ model.name }}_impl_dae_fun_jac_x_xdot_u_n_out; + external_function_param_casadi_create(&capsule->impl_dae_fun_jac_x_xdot_u[i], {{ dims.np }}); + } + +{% elif solver_options.integrator_type == "GNSF" %} + capsule->gnsf_phi_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->gnsf_phi_fun[i].casadi_fun = &{{ model.name }}_gnsf_phi_fun; + capsule->gnsf_phi_fun[i].casadi_work = &{{ model.name }}_gnsf_phi_fun_work; + capsule->gnsf_phi_fun[i].casadi_sparsity_in = &{{ model.name }}_gnsf_phi_fun_sparsity_in; + capsule->gnsf_phi_fun[i].casadi_sparsity_out = &{{ model.name }}_gnsf_phi_fun_sparsity_out; + capsule->gnsf_phi_fun[i].casadi_n_in = &{{ model.name }}_gnsf_phi_fun_n_in; + capsule->gnsf_phi_fun[i].casadi_n_out = &{{ model.name }}_gnsf_phi_fun_n_out; + external_function_param_casadi_create(&capsule->gnsf_phi_fun[i], {{ dims.np }}); + } + + capsule->gnsf_phi_fun_jac_y = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->gnsf_phi_fun_jac_y[i].casadi_fun = &{{ model.name }}_gnsf_phi_fun_jac_y; + capsule->gnsf_phi_fun_jac_y[i].casadi_work = &{{ model.name }}_gnsf_phi_fun_jac_y_work; + capsule->gnsf_phi_fun_jac_y[i].casadi_sparsity_in = &{{ model.name }}_gnsf_phi_fun_jac_y_sparsity_in; + capsule->gnsf_phi_fun_jac_y[i].casadi_sparsity_out = &{{ model.name }}_gnsf_phi_fun_jac_y_sparsity_out; + capsule->gnsf_phi_fun_jac_y[i].casadi_n_in = &{{ model.name }}_gnsf_phi_fun_jac_y_n_in; + capsule->gnsf_phi_fun_jac_y[i].casadi_n_out = &{{ model.name }}_gnsf_phi_fun_jac_y_n_out; + external_function_param_casadi_create(&capsule->gnsf_phi_fun_jac_y[i], {{ dims.np }}); + } + + capsule->gnsf_phi_jac_y_uhat = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->gnsf_phi_jac_y_uhat[i].casadi_fun = &{{ model.name }}_gnsf_phi_jac_y_uhat; + capsule->gnsf_phi_jac_y_uhat[i].casadi_work = &{{ model.name }}_gnsf_phi_jac_y_uhat_work; + capsule->gnsf_phi_jac_y_uhat[i].casadi_sparsity_in = &{{ model.name }}_gnsf_phi_jac_y_uhat_sparsity_in; + capsule->gnsf_phi_jac_y_uhat[i].casadi_sparsity_out = &{{ model.name }}_gnsf_phi_jac_y_uhat_sparsity_out; + capsule->gnsf_phi_jac_y_uhat[i].casadi_n_in = &{{ model.name }}_gnsf_phi_jac_y_uhat_n_in; + capsule->gnsf_phi_jac_y_uhat[i].casadi_n_out = &{{ model.name }}_gnsf_phi_jac_y_uhat_n_out; + external_function_param_casadi_create(&capsule->gnsf_phi_jac_y_uhat[i], {{ dims.np }}); + } + + capsule->gnsf_f_lo_jac_x1_x1dot_u_z = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->gnsf_f_lo_jac_x1_x1dot_u_z[i].casadi_fun = &{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz; + capsule->gnsf_f_lo_jac_x1_x1dot_u_z[i].casadi_work = &{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_work; + capsule->gnsf_f_lo_jac_x1_x1dot_u_z[i].casadi_sparsity_in = &{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_sparsity_in; + capsule->gnsf_f_lo_jac_x1_x1dot_u_z[i].casadi_sparsity_out = &{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_sparsity_out; + capsule->gnsf_f_lo_jac_x1_x1dot_u_z[i].casadi_n_in = &{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_n_in; + capsule->gnsf_f_lo_jac_x1_x1dot_u_z[i].casadi_n_out = &{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_n_out; + external_function_param_casadi_create(&capsule->gnsf_f_lo_jac_x1_x1dot_u_z[i], {{ dims.np }}); + } + + capsule->gnsf_get_matrices_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->gnsf_get_matrices_fun[i].casadi_fun = &{{ model.name }}_gnsf_get_matrices_fun; + capsule->gnsf_get_matrices_fun[i].casadi_work = &{{ model.name }}_gnsf_get_matrices_fun_work; + capsule->gnsf_get_matrices_fun[i].casadi_sparsity_in = &{{ model.name }}_gnsf_get_matrices_fun_sparsity_in; + capsule->gnsf_get_matrices_fun[i].casadi_sparsity_out = &{{ model.name }}_gnsf_get_matrices_fun_sparsity_out; + capsule->gnsf_get_matrices_fun[i].casadi_n_in = &{{ model.name }}_gnsf_get_matrices_fun_n_in; + capsule->gnsf_get_matrices_fun[i].casadi_n_out = &{{ model.name }}_gnsf_get_matrices_fun_n_out; + external_function_param_casadi_create(&capsule->gnsf_get_matrices_fun[i], {{ dims.np }}); + } +{% elif solver_options.integrator_type == "DISCRETE" %} + // discrete dynamics + capsule->discr_dyn_phi_fun = (external_function_param_{{ model.dyn_ext_fun_type }} *) malloc(sizeof(external_function_param_{{ model.dyn_ext_fun_type }})*N); + for (int i = 0; i < N; i++) + { + {%- if model.dyn_ext_fun_type == "casadi" %} + capsule->discr_dyn_phi_fun[i].casadi_fun = &{{ model.name }}_dyn_disc_phi_fun; + capsule->discr_dyn_phi_fun[i].casadi_n_in = &{{ model.name }}_dyn_disc_phi_fun_n_in; + capsule->discr_dyn_phi_fun[i].casadi_n_out = &{{ model.name }}_dyn_disc_phi_fun_n_out; + capsule->discr_dyn_phi_fun[i].casadi_sparsity_in = &{{ model.name }}_dyn_disc_phi_fun_sparsity_in; + capsule->discr_dyn_phi_fun[i].casadi_sparsity_out = &{{ model.name }}_dyn_disc_phi_fun_sparsity_out; + capsule->discr_dyn_phi_fun[i].casadi_work = &{{ model.name }}_dyn_disc_phi_fun_work; + {%- else %} + capsule->discr_dyn_phi_fun[i].fun = &{{ model.dyn_disc_fun }}; + {%- endif %} + external_function_param_{{ model.dyn_ext_fun_type }}_create(&capsule->discr_dyn_phi_fun[i], {{ dims.np }}); + } + + capsule->discr_dyn_phi_fun_jac_ut_xt = (external_function_param_{{ model.dyn_ext_fun_type }} *) malloc(sizeof(external_function_param_{{ model.dyn_ext_fun_type }})*N); + for (int i = 0; i < N; i++) + { + {%- if model.dyn_ext_fun_type == "casadi" %} + capsule->discr_dyn_phi_fun_jac_ut_xt[i].casadi_fun = &{{ model.name }}_dyn_disc_phi_fun_jac; + capsule->discr_dyn_phi_fun_jac_ut_xt[i].casadi_n_in = &{{ model.name }}_dyn_disc_phi_fun_jac_n_in; + capsule->discr_dyn_phi_fun_jac_ut_xt[i].casadi_n_out = &{{ model.name }}_dyn_disc_phi_fun_jac_n_out; + capsule->discr_dyn_phi_fun_jac_ut_xt[i].casadi_sparsity_in = &{{ model.name }}_dyn_disc_phi_fun_jac_sparsity_in; + capsule->discr_dyn_phi_fun_jac_ut_xt[i].casadi_sparsity_out = &{{ model.name }}_dyn_disc_phi_fun_jac_sparsity_out; + capsule->discr_dyn_phi_fun_jac_ut_xt[i].casadi_work = &{{ model.name }}_dyn_disc_phi_fun_jac_work; + {%- else %} + capsule->discr_dyn_phi_fun_jac_ut_xt[i].fun = &{{ model.dyn_disc_fun_jac }}; + {%- endif %} + external_function_param_{{ model.dyn_ext_fun_type }}_create(&capsule->discr_dyn_phi_fun_jac_ut_xt[i], {{ dims.np }}); + } + + {%- if solver_options.hessian_approx == "EXACT" %} + capsule->discr_dyn_phi_fun_jac_ut_xt_hess = (external_function_param_{{ model.dyn_ext_fun_type }} *) malloc(sizeof(external_function_param_{{ model.dyn_ext_fun_type }})*N); + for (int i = 0; i < N; i++) + { + {%- if model.dyn_ext_fun_type == "casadi" %} + capsule->discr_dyn_phi_fun_jac_ut_xt_hess[i].casadi_fun = &{{ model.name }}_dyn_disc_phi_fun_jac_hess; + capsule->discr_dyn_phi_fun_jac_ut_xt_hess[i].casadi_n_in = &{{ model.name }}_dyn_disc_phi_fun_jac_hess_n_in; + capsule->discr_dyn_phi_fun_jac_ut_xt_hess[i].casadi_n_out = &{{ model.name }}_dyn_disc_phi_fun_jac_hess_n_out; + capsule->discr_dyn_phi_fun_jac_ut_xt_hess[i].casadi_sparsity_in = &{{ model.name }}_dyn_disc_phi_fun_jac_hess_sparsity_in; + capsule->discr_dyn_phi_fun_jac_ut_xt_hess[i].casadi_sparsity_out = &{{ model.name }}_dyn_disc_phi_fun_jac_hess_sparsity_out; + capsule->discr_dyn_phi_fun_jac_ut_xt_hess[i].casadi_work = &{{ model.name }}_dyn_disc_phi_fun_jac_hess_work; + {%- else %} + capsule->discr_dyn_phi_fun_jac_ut_xt_hess[i].fun = &{{ model.dyn_disc_fun_jac_hess }}; + {%- endif %} + external_function_param_{{ model.dyn_ext_fun_type }}_create(&capsule->discr_dyn_phi_fun_jac_ut_xt_hess[i], {{ dims.np }}); + } + {%- endif %} +{%- endif %} + + +{%- if cost.cost_type_0 == "NONLINEAR_LS" %} + // nonlinear least square function + capsule->cost_y_0_fun.casadi_fun = &{{ model.name }}_cost_y_0_fun; + capsule->cost_y_0_fun.casadi_n_in = &{{ model.name }}_cost_y_0_fun_n_in; + capsule->cost_y_0_fun.casadi_n_out = &{{ model.name }}_cost_y_0_fun_n_out; + capsule->cost_y_0_fun.casadi_sparsity_in = &{{ model.name }}_cost_y_0_fun_sparsity_in; + capsule->cost_y_0_fun.casadi_sparsity_out = &{{ model.name }}_cost_y_0_fun_sparsity_out; + capsule->cost_y_0_fun.casadi_work = &{{ model.name }}_cost_y_0_fun_work; + external_function_param_casadi_create(&capsule->cost_y_0_fun, {{ dims.np }}); + + capsule->cost_y_0_fun_jac_ut_xt.casadi_fun = &{{ model.name }}_cost_y_0_fun_jac_ut_xt; + capsule->cost_y_0_fun_jac_ut_xt.casadi_n_in = &{{ model.name }}_cost_y_0_fun_jac_ut_xt_n_in; + capsule->cost_y_0_fun_jac_ut_xt.casadi_n_out = &{{ model.name }}_cost_y_0_fun_jac_ut_xt_n_out; + capsule->cost_y_0_fun_jac_ut_xt.casadi_sparsity_in = &{{ model.name }}_cost_y_0_fun_jac_ut_xt_sparsity_in; + capsule->cost_y_0_fun_jac_ut_xt.casadi_sparsity_out = &{{ model.name }}_cost_y_0_fun_jac_ut_xt_sparsity_out; + capsule->cost_y_0_fun_jac_ut_xt.casadi_work = &{{ model.name }}_cost_y_0_fun_jac_ut_xt_work; + external_function_param_casadi_create(&capsule->cost_y_0_fun_jac_ut_xt, {{ dims.np }}); + + capsule->cost_y_0_hess.casadi_fun = &{{ model.name }}_cost_y_0_hess; + capsule->cost_y_0_hess.casadi_n_in = &{{ model.name }}_cost_y_0_hess_n_in; + capsule->cost_y_0_hess.casadi_n_out = &{{ model.name }}_cost_y_0_hess_n_out; + capsule->cost_y_0_hess.casadi_sparsity_in = &{{ model.name }}_cost_y_0_hess_sparsity_in; + capsule->cost_y_0_hess.casadi_sparsity_out = &{{ model.name }}_cost_y_0_hess_sparsity_out; + capsule->cost_y_0_hess.casadi_work = &{{ model.name }}_cost_y_0_hess_work; + external_function_param_casadi_create(&capsule->cost_y_0_hess, {{ dims.np }}); + +{%- elif cost.cost_type_0 == "EXTERNAL" %} + // external cost + {% if cost.cost_ext_fun_type_0 == "casadi" %} + capsule->ext_cost_0_fun.casadi_fun = &{{ model.name }}_cost_ext_cost_0_fun; + capsule->ext_cost_0_fun.casadi_n_in = &{{ model.name }}_cost_ext_cost_0_fun_n_in; + capsule->ext_cost_0_fun.casadi_n_out = &{{ model.name }}_cost_ext_cost_0_fun_n_out; + capsule->ext_cost_0_fun.casadi_sparsity_in = &{{ model.name }}_cost_ext_cost_0_fun_sparsity_in; + capsule->ext_cost_0_fun.casadi_sparsity_out = &{{ model.name }}_cost_ext_cost_0_fun_sparsity_out; + capsule->ext_cost_0_fun.casadi_work = &{{ model.name }}_cost_ext_cost_0_fun_work; + {% else %} + capsule->ext_cost_0_fun.fun = &{{ cost.cost_function_ext_cost_0 }}; + {% endif %} + external_function_param_{{ cost.cost_ext_fun_type_0 }}_create(&capsule->ext_cost_0_fun, {{ dims.np }}); + + // external cost + {% if cost.cost_ext_fun_type_0 == "casadi" %} + capsule->ext_cost_0_fun_jac.casadi_fun = &{{ model.name }}_cost_ext_cost_0_fun_jac; + capsule->ext_cost_0_fun_jac.casadi_n_in = &{{ model.name }}_cost_ext_cost_0_fun_jac_n_in; + capsule->ext_cost_0_fun_jac.casadi_n_out = &{{ model.name }}_cost_ext_cost_0_fun_jac_n_out; + capsule->ext_cost_0_fun_jac.casadi_sparsity_in = &{{ model.name }}_cost_ext_cost_0_fun_jac_sparsity_in; + capsule->ext_cost_0_fun_jac.casadi_sparsity_out = &{{ model.name }}_cost_ext_cost_0_fun_jac_sparsity_out; + capsule->ext_cost_0_fun_jac.casadi_work = &{{ model.name }}_cost_ext_cost_0_fun_jac_work; + {% else %} + capsule->ext_cost_0_fun_jac.fun = &{{ cost.cost_function_ext_cost_0 }}; + {% endif %} + external_function_param_{{ cost.cost_ext_fun_type_0 }}_create(&capsule->ext_cost_0_fun_jac, {{ dims.np }}); + + // external cost + {% if cost.cost_ext_fun_type_0 == "casadi" %} + capsule->ext_cost_0_fun_jac_hess.casadi_fun = &{{ model.name }}_cost_ext_cost_0_fun_jac_hess; + capsule->ext_cost_0_fun_jac_hess.casadi_n_in = &{{ model.name }}_cost_ext_cost_0_fun_jac_hess_n_in; + capsule->ext_cost_0_fun_jac_hess.casadi_n_out = &{{ model.name }}_cost_ext_cost_0_fun_jac_hess_n_out; + capsule->ext_cost_0_fun_jac_hess.casadi_sparsity_in = &{{ model.name }}_cost_ext_cost_0_fun_jac_hess_sparsity_in; + capsule->ext_cost_0_fun_jac_hess.casadi_sparsity_out = &{{ model.name }}_cost_ext_cost_0_fun_jac_hess_sparsity_out; + capsule->ext_cost_0_fun_jac_hess.casadi_work = &{{ model.name }}_cost_ext_cost_0_fun_jac_hess_work; + {% else %} + capsule->ext_cost_0_fun_jac_hess.fun = &{{ cost.cost_function_ext_cost_0 }}; + {% endif %} + external_function_param_{{ cost.cost_ext_fun_type_0 }}_create(&capsule->ext_cost_0_fun_jac_hess, {{ dims.np }}); +{%- endif %} + +{%- if cost.cost_type == "NONLINEAR_LS" %} + // nonlinear least squares cost + capsule->cost_y_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N-1; i++) + { + capsule->cost_y_fun[i].casadi_fun = &{{ model.name }}_cost_y_fun; + capsule->cost_y_fun[i].casadi_n_in = &{{ model.name }}_cost_y_fun_n_in; + capsule->cost_y_fun[i].casadi_n_out = &{{ model.name }}_cost_y_fun_n_out; + capsule->cost_y_fun[i].casadi_sparsity_in = &{{ model.name }}_cost_y_fun_sparsity_in; + capsule->cost_y_fun[i].casadi_sparsity_out = &{{ model.name }}_cost_y_fun_sparsity_out; + capsule->cost_y_fun[i].casadi_work = &{{ model.name }}_cost_y_fun_work; + + external_function_param_casadi_create(&capsule->cost_y_fun[i], {{ dims.np }}); + } + + capsule->cost_y_fun_jac_ut_xt = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N-1; i++) + { + capsule->cost_y_fun_jac_ut_xt[i].casadi_fun = &{{ model.name }}_cost_y_fun_jac_ut_xt; + capsule->cost_y_fun_jac_ut_xt[i].casadi_n_in = &{{ model.name }}_cost_y_fun_jac_ut_xt_n_in; + capsule->cost_y_fun_jac_ut_xt[i].casadi_n_out = &{{ model.name }}_cost_y_fun_jac_ut_xt_n_out; + capsule->cost_y_fun_jac_ut_xt[i].casadi_sparsity_in = &{{ model.name }}_cost_y_fun_jac_ut_xt_sparsity_in; + capsule->cost_y_fun_jac_ut_xt[i].casadi_sparsity_out = &{{ model.name }}_cost_y_fun_jac_ut_xt_sparsity_out; + capsule->cost_y_fun_jac_ut_xt[i].casadi_work = &{{ model.name }}_cost_y_fun_jac_ut_xt_work; + + external_function_param_casadi_create(&capsule->cost_y_fun_jac_ut_xt[i], {{ dims.np }}); + } + + capsule->cost_y_hess = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N-1; i++) + { + capsule->cost_y_hess[i].casadi_fun = &{{ model.name }}_cost_y_hess; + capsule->cost_y_hess[i].casadi_n_in = &{{ model.name }}_cost_y_hess_n_in; + capsule->cost_y_hess[i].casadi_n_out = &{{ model.name }}_cost_y_hess_n_out; + capsule->cost_y_hess[i].casadi_sparsity_in = &{{ model.name }}_cost_y_hess_sparsity_in; + capsule->cost_y_hess[i].casadi_sparsity_out = &{{ model.name }}_cost_y_hess_sparsity_out; + capsule->cost_y_hess[i].casadi_work = &{{ model.name }}_cost_y_hess_work; + + external_function_param_casadi_create(&capsule->cost_y_hess[i], {{ dims.np }}); + } +{%- elif cost.cost_type == "EXTERNAL" %} + // external cost + capsule->ext_cost_fun = (external_function_param_{{ cost.cost_ext_fun_type }} *) malloc(sizeof(external_function_param_{{ cost.cost_ext_fun_type }})*N); + for (int i = 0; i < N-1; i++) + { + {% if cost.cost_ext_fun_type == "casadi" %} + capsule->ext_cost_fun[i].casadi_fun = &{{ model.name }}_cost_ext_cost_fun; + capsule->ext_cost_fun[i].casadi_n_in = &{{ model.name }}_cost_ext_cost_fun_n_in; + capsule->ext_cost_fun[i].casadi_n_out = &{{ model.name }}_cost_ext_cost_fun_n_out; + capsule->ext_cost_fun[i].casadi_sparsity_in = &{{ model.name }}_cost_ext_cost_fun_sparsity_in; + capsule->ext_cost_fun[i].casadi_sparsity_out = &{{ model.name }}_cost_ext_cost_fun_sparsity_out; + capsule->ext_cost_fun[i].casadi_work = &{{ model.name }}_cost_ext_cost_fun_work; + {% else %} + capsule->ext_cost_fun[i].fun = &{{ cost.cost_function_ext_cost }}; + {% endif %} + external_function_param_{{ cost.cost_ext_fun_type }}_create(&capsule->ext_cost_fun[i], {{ dims.np }}); + } + + capsule->ext_cost_fun_jac = (external_function_param_{{ cost.cost_ext_fun_type }} *) malloc(sizeof(external_function_param_{{ cost.cost_ext_fun_type }})*N); + for (int i = 0; i < N-1; i++) + { + {% if cost.cost_ext_fun_type == "casadi" %} + capsule->ext_cost_fun_jac[i].casadi_fun = &{{ model.name }}_cost_ext_cost_fun_jac; + capsule->ext_cost_fun_jac[i].casadi_n_in = &{{ model.name }}_cost_ext_cost_fun_jac_n_in; + capsule->ext_cost_fun_jac[i].casadi_n_out = &{{ model.name }}_cost_ext_cost_fun_jac_n_out; + capsule->ext_cost_fun_jac[i].casadi_sparsity_in = &{{ model.name }}_cost_ext_cost_fun_jac_sparsity_in; + capsule->ext_cost_fun_jac[i].casadi_sparsity_out = &{{ model.name }}_cost_ext_cost_fun_jac_sparsity_out; + capsule->ext_cost_fun_jac[i].casadi_work = &{{ model.name }}_cost_ext_cost_fun_jac_work; + {% else %} + capsule->ext_cost_fun_jac[i].fun = &{{ cost.cost_function_ext_cost }}; + {% endif %} + external_function_param_{{ cost.cost_ext_fun_type }}_create(&capsule->ext_cost_fun_jac[i], {{ dims.np }}); + } + + capsule->ext_cost_fun_jac_hess = (external_function_param_{{ cost.cost_ext_fun_type }} *) malloc(sizeof(external_function_param_{{ cost.cost_ext_fun_type }})*N); + for (int i = 0; i < N-1; i++) + { + {% if cost.cost_ext_fun_type == "casadi" %} + capsule->ext_cost_fun_jac_hess[i].casadi_fun = &{{ model.name }}_cost_ext_cost_fun_jac_hess; + capsule->ext_cost_fun_jac_hess[i].casadi_n_in = &{{ model.name }}_cost_ext_cost_fun_jac_hess_n_in; + capsule->ext_cost_fun_jac_hess[i].casadi_n_out = &{{ model.name }}_cost_ext_cost_fun_jac_hess_n_out; + capsule->ext_cost_fun_jac_hess[i].casadi_sparsity_in = &{{ model.name }}_cost_ext_cost_fun_jac_hess_sparsity_in; + capsule->ext_cost_fun_jac_hess[i].casadi_sparsity_out = &{{ model.name }}_cost_ext_cost_fun_jac_hess_sparsity_out; + capsule->ext_cost_fun_jac_hess[i].casadi_work = &{{ model.name }}_cost_ext_cost_fun_jac_hess_work; + {% else %} + capsule->ext_cost_fun_jac_hess[i].fun = &{{ cost.cost_function_ext_cost }}; + {% endif %} + external_function_param_{{ cost.cost_ext_fun_type }}_create(&capsule->ext_cost_fun_jac_hess[i], {{ dims.np }}); + } +{%- endif %} + +{%- if cost.cost_type_e == "NONLINEAR_LS" %} + // nonlinear least square function + capsule->cost_y_e_fun.casadi_fun = &{{ model.name }}_cost_y_e_fun; + capsule->cost_y_e_fun.casadi_n_in = &{{ model.name }}_cost_y_e_fun_n_in; + capsule->cost_y_e_fun.casadi_n_out = &{{ model.name }}_cost_y_e_fun_n_out; + capsule->cost_y_e_fun.casadi_sparsity_in = &{{ model.name }}_cost_y_e_fun_sparsity_in; + capsule->cost_y_e_fun.casadi_sparsity_out = &{{ model.name }}_cost_y_e_fun_sparsity_out; + capsule->cost_y_e_fun.casadi_work = &{{ model.name }}_cost_y_e_fun_work; + external_function_param_casadi_create(&capsule->cost_y_e_fun, {{ dims.np }}); + + capsule->cost_y_e_fun_jac_ut_xt.casadi_fun = &{{ model.name }}_cost_y_e_fun_jac_ut_xt; + capsule->cost_y_e_fun_jac_ut_xt.casadi_n_in = &{{ model.name }}_cost_y_e_fun_jac_ut_xt_n_in; + capsule->cost_y_e_fun_jac_ut_xt.casadi_n_out = &{{ model.name }}_cost_y_e_fun_jac_ut_xt_n_out; + capsule->cost_y_e_fun_jac_ut_xt.casadi_sparsity_in = &{{ model.name }}_cost_y_e_fun_jac_ut_xt_sparsity_in; + capsule->cost_y_e_fun_jac_ut_xt.casadi_sparsity_out = &{{ model.name }}_cost_y_e_fun_jac_ut_xt_sparsity_out; + capsule->cost_y_e_fun_jac_ut_xt.casadi_work = &{{ model.name }}_cost_y_e_fun_jac_ut_xt_work; + external_function_param_casadi_create(&capsule->cost_y_e_fun_jac_ut_xt, {{ dims.np }}); + + capsule->cost_y_e_hess.casadi_fun = &{{ model.name }}_cost_y_e_hess; + capsule->cost_y_e_hess.casadi_n_in = &{{ model.name }}_cost_y_e_hess_n_in; + capsule->cost_y_e_hess.casadi_n_out = &{{ model.name }}_cost_y_e_hess_n_out; + capsule->cost_y_e_hess.casadi_sparsity_in = &{{ model.name }}_cost_y_e_hess_sparsity_in; + capsule->cost_y_e_hess.casadi_sparsity_out = &{{ model.name }}_cost_y_e_hess_sparsity_out; + capsule->cost_y_e_hess.casadi_work = &{{ model.name }}_cost_y_e_hess_work; + external_function_param_casadi_create(&capsule->cost_y_e_hess, {{ dims.np }}); + +{%- elif cost.cost_type_e == "EXTERNAL" %} + // external cost + {% if cost.cost_ext_fun_type_e == "casadi" %} + capsule->ext_cost_e_fun.casadi_fun = &{{ model.name }}_cost_ext_cost_e_fun; + capsule->ext_cost_e_fun.casadi_n_in = &{{ model.name }}_cost_ext_cost_e_fun_n_in; + capsule->ext_cost_e_fun.casadi_n_out = &{{ model.name }}_cost_ext_cost_e_fun_n_out; + capsule->ext_cost_e_fun.casadi_sparsity_in = &{{ model.name }}_cost_ext_cost_e_fun_sparsity_in; + capsule->ext_cost_e_fun.casadi_sparsity_out = &{{ model.name }}_cost_ext_cost_e_fun_sparsity_out; + capsule->ext_cost_e_fun.casadi_work = &{{ model.name }}_cost_ext_cost_e_fun_work; + {% else %} + capsule->ext_cost_e_fun.fun = &{{ cost.cost_function_ext_cost_e }}; + {% endif %} + external_function_param_{{ cost.cost_ext_fun_type_e }}_create(&capsule->ext_cost_e_fun, {{ dims.np }}); + + // external cost + {% if cost.cost_ext_fun_type_e == "casadi" %} + capsule->ext_cost_e_fun_jac.casadi_fun = &{{ model.name }}_cost_ext_cost_e_fun_jac; + capsule->ext_cost_e_fun_jac.casadi_n_in = &{{ model.name }}_cost_ext_cost_e_fun_jac_n_in; + capsule->ext_cost_e_fun_jac.casadi_n_out = &{{ model.name }}_cost_ext_cost_e_fun_jac_n_out; + capsule->ext_cost_e_fun_jac.casadi_sparsity_in = &{{ model.name }}_cost_ext_cost_e_fun_jac_sparsity_in; + capsule->ext_cost_e_fun_jac.casadi_sparsity_out = &{{ model.name }}_cost_ext_cost_e_fun_jac_sparsity_out; + capsule->ext_cost_e_fun_jac.casadi_work = &{{ model.name }}_cost_ext_cost_e_fun_jac_work; + {% else %} + capsule->ext_cost_e_fun_jac.fun = &{{ cost.cost_function_ext_cost_e }}; + {% endif %} + external_function_param_{{ cost.cost_ext_fun_type_e }}_create(&capsule->ext_cost_e_fun_jac, {{ dims.np }}); + + // external cost + {% if cost.cost_ext_fun_type_e == "casadi" %} + capsule->ext_cost_e_fun_jac_hess.casadi_fun = &{{ model.name }}_cost_ext_cost_e_fun_jac_hess; + capsule->ext_cost_e_fun_jac_hess.casadi_n_in = &{{ model.name }}_cost_ext_cost_e_fun_jac_hess_n_in; + capsule->ext_cost_e_fun_jac_hess.casadi_n_out = &{{ model.name }}_cost_ext_cost_e_fun_jac_hess_n_out; + capsule->ext_cost_e_fun_jac_hess.casadi_sparsity_in = &{{ model.name }}_cost_ext_cost_e_fun_jac_hess_sparsity_in; + capsule->ext_cost_e_fun_jac_hess.casadi_sparsity_out = &{{ model.name }}_cost_ext_cost_e_fun_jac_hess_sparsity_out; + capsule->ext_cost_e_fun_jac_hess.casadi_work = &{{ model.name }}_cost_ext_cost_e_fun_jac_hess_work; + {% else %} + capsule->ext_cost_e_fun_jac_hess.fun = &{{ cost.cost_function_ext_cost_e }}; + {% endif %} + external_function_param_{{ cost.cost_ext_fun_type_e }}_create(&capsule->ext_cost_e_fun_jac_hess, {{ dims.np }}); +{%- endif %} + + /************************************************ + * nlp_in + ************************************************/ + ocp_nlp_in * nlp_in = ocp_nlp_in_create(nlp_config, nlp_dims); + capsule->nlp_in = nlp_in; + + // set up time_steps + {% set all_equal = true -%} + {%- set val = solver_options.time_steps[0] %} + {%- for j in range(start=1, end=dims.N) %} + {%- if val != solver_options.time_steps[j] %} + {%- set_global all_equal = false %} + {%- break %} + {%- endif %} + {%- endfor %} + + if (new_time_steps) { + {{ model.name }}_acados_update_time_steps(capsule, N, new_time_steps); + } else { + {%- if all_equal == true -%} + // all time_steps are identical + double time_step = {{ solver_options.time_steps[0] }}; + for (int i = 0; i < N; i++) + { + ocp_nlp_in_set(nlp_config, nlp_dims, nlp_in, i, "Ts", &time_step); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "scaling", &time_step); + } + {%- else -%} + // time_steps are different + double* time_steps = malloc(N*sizeof(double)); + {%- for j in range(end=dims.N) %} + time_steps[{{ j }}] = {{ solver_options.time_steps[j] }}; + {%- endfor %} + {{ model.name }}_acados_update_time_steps(capsule, N, time_steps); + free(time_steps); + {%- endif %} + } + + /**** Dynamics ****/ + for (int i = 0; i < N; i++) + { + {%- if solver_options.integrator_type == "ERK" %} + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "expl_vde_forw", &capsule->forw_vde_casadi[i]); + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "expl_ode_fun", &capsule->expl_ode_fun[i]); + {%- if solver_options.hessian_approx == "EXACT" %} + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "expl_ode_hess", &capsule->hess_vde_casadi[i]); + {%- endif %} + {% elif solver_options.integrator_type == "IRK" %} + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "impl_dae_fun", &capsule->impl_dae_fun[i]); + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, + "impl_dae_fun_jac_x_xdot_z", &capsule->impl_dae_fun_jac_x_xdot_z[i]); + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, + "impl_dae_jac_x_xdot_u", &capsule->impl_dae_jac_x_xdot_u_z[i]); + {%- if solver_options.hessian_approx == "EXACT" %} + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "impl_dae_hess", &capsule->impl_dae_hess[i]); + {%- endif %} + {% elif solver_options.integrator_type == "LIFTED_IRK" %} + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "impl_dae_fun", &capsule->impl_dae_fun[i]); + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, + "impl_dae_fun_jac_x_xdot_u", &capsule->impl_dae_fun_jac_x_xdot_u[i]); + {% elif solver_options.integrator_type == "GNSF" %} + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "phi_fun", &capsule->gnsf_phi_fun[i]); + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "phi_fun_jac_y", &capsule->gnsf_phi_fun_jac_y[i]); + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "phi_jac_y_uhat", &capsule->gnsf_phi_jac_y_uhat[i]); + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "f_lo_jac_x1_x1dot_u_z", + &capsule->gnsf_f_lo_jac_x1_x1dot_u_z[i]); + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "gnsf_get_matrices_fun", + &capsule->gnsf_get_matrices_fun[i]); + {% elif solver_options.integrator_type == "DISCRETE" %} + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "disc_dyn_fun", &capsule->discr_dyn_phi_fun[i]); + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "disc_dyn_fun_jac", + &capsule->discr_dyn_phi_fun_jac_ut_xt[i]); + {%- if solver_options.hessian_approx == "EXACT" %} + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "disc_dyn_fun_jac_hess", + &capsule->discr_dyn_phi_fun_jac_ut_xt_hess[i]); + {%- endif %} + {%- endif %} + } + + + /**** Cost ****/ +{%- if cost.cost_type_0 == "NONLINEAR_LS" or cost.cost_type_0 == "LINEAR_LS" %} +{% if dims.ny_0 > 0 %} + double* W_0 = calloc(NY0*NY0, sizeof(double)); + // change only the non-zero elements: + {%- for j in range(end=dims.ny_0) %} + {%- for k in range(end=dims.ny_0) %} + {%- if cost.W_0[j][k] != 0 %} + W_0[{{ j }}+(NY0) * {{ k }}] = {{ cost.W_0[j][k] }}; + {%- endif %} + {%- endfor %} + {%- endfor %} + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "W", W_0); + free(W_0); + + double* yref_0 = calloc(NY0, sizeof(double)); + // change only the non-zero elements: + {%- for j in range(end=dims.ny_0) %} + {%- if cost.yref_0[j] != 0 %} + yref_0[{{ j }}] = {{ cost.yref_0[j] }}; + {%- endif %} + {%- endfor %} + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "yref", yref_0); + free(yref_0); +{% endif %} +{% endif %} + +{%- if cost.cost_type == "NONLINEAR_LS" or cost.cost_type == "LINEAR_LS" %} +{% if dims.ny > 0 %} + double* W = calloc(NY*NY, sizeof(double)); + // change only the non-zero elements: + {% for j in range(end=dims.ny) %} + {%- for k in range(end=dims.ny) %} + {%- if cost.W[j][k] != 0 %} + W[{{ j }}+(NY) * {{ k }}] = {{ cost.W[j][k] }}; + {%- endif %} + {%- endfor %} + {%- endfor %} + + double* yref = calloc(NY, sizeof(double)); + // change only the non-zero elements: + {%- for j in range(end=dims.ny) %} + {%- if cost.yref[j] != 0 %} + yref[{{ j }}] = {{ cost.yref[j] }}; + {%- endif %} + {%- endfor %} + + for (int i = 1; i < N; i++) + { + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "W", W); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "yref", yref); + } + free(W); + free(yref); +{% endif %} +{% endif %} + +{%- if cost.cost_type_0 == "LINEAR_LS" %} + double* Vx_0 = calloc(NY0*NX, sizeof(double)); + // change only the non-zero elements: + {% for j in range(end=dims.ny_0) %} + {%- for k in range(end=dims.nx) %} + {%- if cost.Vx_0[j][k] != 0 %} + Vx_0[{{ j }}+(NY0) * {{ k }}] = {{ cost.Vx_0[j][k] }}; + {%- endif %} + {%- endfor %} + {%- endfor %} + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "Vx", Vx_0); + free(Vx_0); + +{% if dims.ny_0 > 0 and dims.nu > 0 %} + double* Vu_0 = calloc(NY0*NU, sizeof(double)); + // change only the non-zero elements: + {% for j in range(end=dims.ny_0) %} + {%- for k in range(end=dims.nu) %} + {%- if cost.Vu_0[j][k] != 0 %} + Vu_0[{{ j }}+(NY0) * {{ k }}] = {{ cost.Vu_0[j][k] }}; + {%- endif %} + {%- endfor %} + {%- endfor %} + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "Vu", Vu_0); + free(Vu_0); +{% endif %} +{% if dims.ny_0 > 0 and dims.nz > 0 %} + double* Vz_0 = calloc(NY0*NZ, sizeof(double)); + // change only the non-zero elements: + {% for j in range(end=dims.ny_0) %} + {%- for k in range(end=dims.nz) %} + {%- if cost.Vz_0[j][k] != 0 %} + Vz_0[{{ j }}+(NY0) * {{ k }}] = {{ cost.Vz_0[j][k] }}; + {%- endif %} + {%- endfor %} + {%- endfor %} + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "Vz", Vz_0); + free(Vz_0); +{%- endif %} +{%- endif %}{# LINEAR LS #} + + +{%- if cost.cost_type == "LINEAR_LS" %} + double* Vx = calloc(NY*NX, sizeof(double)); + // change only the non-zero elements: + {% for j in range(end=dims.ny) %} + {%- for k in range(end=dims.nx) %} + {%- if cost.Vx[j][k] != 0 %} + Vx[{{ j }}+(NY) * {{ k }}] = {{ cost.Vx[j][k] }}; + {%- endif %} + {%- endfor %} + {%- endfor %} + for (int i = 1; i < N; i++) + { + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "Vx", Vx); + } + free(Vx); + +{% if dims.ny > 0 and dims.nu > 0 %} + double* Vu = calloc(NY*NU, sizeof(double)); + // change only the non-zero elements: + {% for j in range(end=dims.ny) %} + {%- for k in range(end=dims.nu) %} + {%- if cost.Vu[j][k] != 0 %} + Vu[{{ j }}+(NY) * {{ k }}] = {{ cost.Vu[j][k] }}; + {%- endif %} + {%- endfor %} + {%- endfor %} + + for (int i = 1; i < N; i++) + { + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "Vu", Vu); + } + free(Vu); +{% endif %} + +{% if dims.ny > 0 and dims.nz > 0 %} + double* Vz = calloc(NY*NZ, sizeof(double)); + // change only the non-zero elements: + {% for j in range(end=dims.ny) %} + {%- for k in range(end=dims.nz) %} + {%- if cost.Vz[j][k] != 0 %} + Vz[{{ j }}+(NY) * {{ k }}] = {{ cost.Vz[j][k] }}; + {%- endif %} + {%- endfor %} + {%- endfor %} + + for (int i = 1; i < N; i++) + { + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "Vz", Vz); + } + free(Vz); +{%- endif %} +{%- endif %}{# LINEAR LS #} + + +{%- if cost.cost_type_0 == "NONLINEAR_LS" %} + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "nls_y_fun", &capsule->cost_y_0_fun); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "nls_y_fun_jac", &capsule->cost_y_0_fun_jac_ut_xt); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "nls_y_hess", &capsule->cost_y_0_hess); +{%- elif cost.cost_type_0 == "EXTERNAL" %} + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "ext_cost_fun", &capsule->ext_cost_0_fun); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "ext_cost_fun_jac", &capsule->ext_cost_0_fun_jac); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "ext_cost_fun_jac_hess", &capsule->ext_cost_0_fun_jac_hess); +{%- endif %} + +{%- if cost.cost_type == "NONLINEAR_LS" %} + for (int i = 1; i < N; i++) + { + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "nls_y_fun", &capsule->cost_y_fun[i-1]); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "nls_y_fun_jac", &capsule->cost_y_fun_jac_ut_xt[i-1]); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "nls_y_hess", &capsule->cost_y_hess[i-1]); + } +{%- elif cost.cost_type == "EXTERNAL" %} + for (int i = 1; i < N; i++) + { + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "ext_cost_fun", &capsule->ext_cost_fun[i-1]); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "ext_cost_fun_jac", &capsule->ext_cost_fun_jac[i-1]); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "ext_cost_fun_jac_hess", &capsule->ext_cost_fun_jac_hess[i-1]); + } +{%- endif %} + + +{% if dims.ns > 0 %} + double* zlumem = calloc(4*NS, sizeof(double)); + double* Zl = zlumem+NS*0; + double* Zu = zlumem+NS*1; + double* zl = zlumem+NS*2; + double* zu = zlumem+NS*3; + // change only the non-zero elements: + {%- for j in range(end=dims.ns) %} + {%- if cost.Zl[j] != 0 %} + Zl[{{ j }}] = {{ cost.Zl[j] }}; + {%- endif %} + {%- endfor %} + + {%- for j in range(end=dims.ns) %} + {%- if cost.Zu[j] != 0 %} + Zu[{{ j }}] = {{ cost.Zu[j] }}; + {%- endif %} + {%- endfor %} + + {%- for j in range(end=dims.ns) %} + {%- if cost.zl[j] != 0 %} + zl[{{ j }}] = {{ cost.zl[j] }}; + {%- endif %} + {%- endfor %} + + {%- for j in range(end=dims.ns) %} + {%- if cost.zu[j] != 0 %} + zu[{{ j }}] = {{ cost.zu[j] }}; + {%- endif %} + {%- endfor %} + + for (int i = 0; i < N; i++) + { + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "Zl", Zl); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "Zu", Zu); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "zl", zl); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "zu", zu); + } + free(zlumem); +{% endif %} + + // terminal cost +{% if cost.cost_type_e == "LINEAR_LS" or cost.cost_type_e == "NONLINEAR_LS" %} +{% if dims.ny_e > 0 %} + double* yref_e = calloc(NYN, sizeof(double)); + // change only the non-zero elements: + {% for j in range(end=dims.ny_e) %} + {%- if cost.yref_e[j] != 0 %} + yref_e[{{ j }}] = {{ cost.yref_e[j] }}; + {%- endif %} + {%- endfor %} + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "yref", yref_e); + free(yref_e); + + double* W_e = calloc(NYN*NYN, sizeof(double)); + // change only the non-zero elements: + {% for j in range(end=dims.ny_e) %} + {%- for k in range(end=dims.ny_e) %} + {%- if cost.W_e[j][k] != 0 %} + W_e[{{ j }}+(NYN) * {{ k }}] = {{ cost.W_e[j][k] }}; + {%- endif %} + {%- endfor %} + {%- endfor %} + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "W", W_e); + free(W_e); + + {%- if cost.cost_type_e == "LINEAR_LS" %} + double* Vx_e = calloc(NYN*NX, sizeof(double)); + // change only the non-zero elements: + {% for j in range(end=dims.ny_e) %} + {%- for k in range(end=dims.nx) %} + {%- if cost.Vx_e[j][k] != 0 %} + Vx_e[{{ j }}+(NYN) * {{ k }}] = {{ cost.Vx_e[j][k] }}; + {%- endif %} + {%- endfor %} + {%- endfor %} + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "Vx", Vx_e); + free(Vx_e); + {%- endif %} + + {%- if cost.cost_type_e == "NONLINEAR_LS" %} + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "nls_y_fun", &capsule->cost_y_e_fun); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "nls_y_fun_jac", &capsule->cost_y_e_fun_jac_ut_xt); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "nls_y_hess", &capsule->cost_y_e_hess); + {%- endif %} +{%- endif %}{# ny_e > 0 #} + +{%- elif cost.cost_type_e == "EXTERNAL" %} + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "ext_cost_fun", &capsule->ext_cost_e_fun); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "ext_cost_fun_jac", &capsule->ext_cost_e_fun_jac); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "ext_cost_fun_jac_hess", &capsule->ext_cost_e_fun_jac_hess); +{%- endif %} + +{% if dims.ns_e > 0 %} + double* zluemem = calloc(4*NSN, sizeof(double)); + double* Zl_e = zluemem+NSN*0; + double* Zu_e = zluemem+NSN*1; + double* zl_e = zluemem+NSN*2; + double* zu_e = zluemem+NSN*3; + + // change only the non-zero elements: + {% for j in range(end=dims.ns_e) %} + {%- if cost.Zl_e[j] != 0 %} + Zl_e[{{ j }}] = {{ cost.Zl_e[j] }}; + {%- endif %} + {%- endfor %} + + {% for j in range(end=dims.ns_e) %} + {%- if cost.Zu_e[j] != 0 %} + Zu_e[{{ j }}] = {{ cost.Zu_e[j] }}; + {%- endif %} + {%- endfor %} + + {% for j in range(end=dims.ns_e) %} + {%- if cost.zl_e[j] != 0 %} + zl_e[{{ j }}] = {{ cost.zl_e[j] }}; + {%- endif %} + {%- endfor %} + + {% for j in range(end=dims.ns_e) %} + {%- if cost.zu_e[j] != 0 %} + zu_e[{{ j }}] = {{ cost.zu_e[j] }}; + {%- endif %} + {%- endfor %} + + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "Zl", Zl_e); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "Zu", Zu_e); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "zl", zl_e); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "zu", zu_e); + free(zluemem); +{%- endif %} + + /**** Constraints ****/ + + // bounds for initial stage +{% if dims.nbx_0 > 0 %} + // x0 + int* idxbx0 = malloc(NBX0 * sizeof(int)); + {%- for i in range(end=dims.nbx_0) %} + idxbx0[{{ i }}] = {{ constraints.idxbx_0[i] }}; + {%- endfor %} + + double* lubx0 = calloc(2*NBX0, sizeof(double)); + double* lbx0 = lubx0; + double* ubx0 = lubx0 + NBX0; + // change only the non-zero elements: + {%- for i in range(end=dims.nbx_0) %} + {%- if constraints.lbx_0[i] != 0 %} + lbx0[{{ i }}] = {{ constraints.lbx_0[i] }}; + {%- endif %} + {%- if constraints.ubx_0[i] != 0 %} + ubx0[{{ i }}] = {{ constraints.ubx_0[i] }}; + {%- endif %} + {%- endfor %} + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "idxbx", idxbx0); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "lbx", lbx0); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "ubx", ubx0); + free(idxbx0); + free(lubx0); +{% endif %} +{% if dims.nbxe_0 > 0 %} + // idxbxe_0 + int* idxbxe_0 = malloc({{ dims.nbxe_0 }} * sizeof(int)); + {% for i in range(end=dims.nbxe_0) %} + idxbxe_0[{{ i }}] = {{ constraints.idxbxe_0[i] }}; + {%- endfor %} + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "idxbxe", idxbxe_0); + free(idxbxe_0); +{% endif %} + + /* constraints that are the same for initial and intermediate */ +{%- if dims.nsbx > 0 %} +{# TODO: introduce nsbx0 & move this block down!! #} + // ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "idxsbx", idxsbx); + // ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "lsbx", lsbx); + // ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "usbx", usbx); + + // soft bounds on x + int* idxsbx = malloc(NSBX * sizeof(int)); + {% for i in range(end=dims.nsbx) %} + idxsbx[{{ i }}] = {{ constraints.idxsbx[i] }}; + {%- endfor %} + + double* lusbx = calloc(2*NSBX, sizeof(double)); + double* lsbx = lusbx; + double* usbx = lusbx + NSBX; + {% for i in range(end=dims.nsbx) %} + {%- if constraints.lsbx[i] != 0 %} + lsbx[{{ i }}] = {{ constraints.lsbx[i] }}; + {%- endif %} + {%- if constraints.usbx[i] != 0 %} + usbx[{{ i }}] = {{ constraints.usbx[i] }}; + {%- endif %} + {%- endfor %} + + for (int i = 1; i < N; i++) + { + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "idxsbx", idxsbx); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "lsbx", lsbx); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "usbx", usbx); + } + free(idxsbx); + free(lusbx); +{%- endif %} + + +{% if dims.nbu > 0 %} + // u + int* idxbu = malloc(NBU * sizeof(int)); + {% for i in range(end=dims.nbu) %} + idxbu[{{ i }}] = {{ constraints.idxbu[i] }}; + {%- endfor %} + double* lubu = calloc(2*NBU, sizeof(double)); + double* lbu = lubu; + double* ubu = lubu + NBU; + {% for i in range(end=dims.nbu) %} + {%- if constraints.lbu[i] != 0 %} + lbu[{{ i }}] = {{ constraints.lbu[i] }}; + {%- endif %} + {%- if constraints.ubu[i] != 0 %} + ubu[{{ i }}] = {{ constraints.ubu[i] }}; + {%- endif %} + {%- endfor %} + + for (int i = 0; i < N; i++) + { + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "idxbu", idxbu); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "lbu", lbu); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "ubu", ubu); + } + free(idxbu); + free(lubu); +{% endif %} + +{% if dims.nsbu > 0 %} + // set up soft bounds for u + int* idxsbu = malloc(NSBU * sizeof(int)); + {% for i in range(end=dims.nsbu) %} + idxsbu[{{ i }}] = {{ constraints.idxsbu[i] }}; + {%- endfor %} + double* lusbu = calloc(2*NSBU, sizeof(double)); + double* lsbu = lusbu; + double* usbu = lusbu + NSBU; + {% for i in range(end=dims.nsbu) %} + {%- if constraints.lsbu[i] != 0 %} + lsbu[{{ i }}] = {{ constraints.lsbu[i] }}; + {%- endif %} + {%- if constraints.usbu[i] != 0 %} + usbu[{{ i }}] = {{ constraints.usbu[i] }}; + {%- endif %} + {%- endfor %} + for (int i = 0; i < N; i++) + { + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "idxsbu", idxsbu); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "lsbu", lsbu); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "usbu", usbu); + } + free(idxsbu); + free(lusbu); +{% endif %} + +{% if dims.nsg > 0 %} + // set up soft bounds for general linear constraints + int* idxsg = malloc(NSG * sizeof(int)); + {% for i in range(end=dims.nsg) %} + idxsg[{{ i }}] = {{ constraints.idxsg[i] }}; + {%- endfor %} + double* lusg = calloc(2*NSG, sizeof(double)); + double* lsg = lusg; + double* usg = lusg + NSG; + {% for i in range(end=dims.nsg) %} + {%- if constraints.lsg[i] != 0 %} + lsg[{{ i }}] = {{ constraints.lsg[i] }}; + {%- endif %} + {%- if constraints.usg[i] != 0 %} + usg[{{ i }}] = {{ constraints.usg[i] }}; + {%- endif %} + {%- endfor %} + + for (int i = 0; i < N; i++) + { + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "idxsg", idxsg); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "lsg", lsg); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "usg", usg); + } + free(idxsg); + free(lusg); +{% endif %} + +{% if dims.nsh > 0 %} + // set up soft bounds for nonlinear constraints + int* idxsh = malloc(NSH * sizeof(int)); + {% for i in range(end=dims.nsh) %} + idxsh[{{ i }}] = {{ constraints.idxsh[i] }}; + {%- endfor %} + double* lush = calloc(2*NSH, sizeof(double)); + double* lsh = lush; + double* ush = lush + NSH; + {% for i in range(end=dims.nsh) %} + {%- if constraints.lsh[i] != 0 %} + lsh[{{ i }}] = {{ constraints.lsh[i] }}; + {%- endif %} + {%- if constraints.ush[i] != 0 %} + ush[{{ i }}] = {{ constraints.ush[i] }}; + {%- endif %} + {%- endfor %} + + for (int i = 0; i < N; i++) + { + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "idxsh", idxsh); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "lsh", lsh); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "ush", ush); + } + free(idxsh); + free(lush); +{% endif %} + +{% if dims.nsphi > 0 %} + // set up soft bounds for convex-over-nonlinear constraints + int* idxsphi = malloc(NSPHI * sizeof(int)); + {% for i in range(end=dims.nsphi) %} + idxsphi[{{ i }}] = {{ constraints.idxsphi[i] }}; + {%- endfor %} + double* lusphi = calloc(2*NSPHI, sizeof(double)); + double* lsphi = lusphi; + double* usphi = lusphi + NSPHI; + {% for i in range(end=dims.nsphi) %} + {%- if constraints.lsphi[i] != 0 %} + lsphi[{{ i }}] = {{ constraints.lsphi[i] }}; + {%- endif %} + {%- if constraints.usphi[i] != 0 %} + usphi[{{ i }}] = {{ constraints.usphi[i] }}; + {%- endif %} + {%- endfor %} + + for (int i = 0; i < N; i++) + { + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "idxsphi", idxsphi); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "lsphi", lsphi); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "usphi", usphi); + } + free(idxsphi); + free(lusphi); +{% endif %} + +{% if dims.nbx > 0 %} + // x + int* idxbx = malloc(NBX * sizeof(int)); + {% for i in range(end=dims.nbx) %} + idxbx[{{ i }}] = {{ constraints.idxbx[i] }}; + {%- endfor %} + double* lubx = calloc(2*NBX, sizeof(double)); + double* lbx = lubx; + double* ubx = lubx + NBX; + {% for i in range(end=dims.nbx) %} + {%- if constraints.lbx[i] != 0 %} + lbx[{{ i }}] = {{ constraints.lbx[i] }}; + {%- endif %} + {%- if constraints.ubx[i] != 0 %} + ubx[{{ i }}] = {{ constraints.ubx[i] }}; + {%- endif %} + {%- endfor %} + + for (int i = 1; i < N; i++) + { + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "idxbx", idxbx); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "lbx", lbx); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "ubx", ubx); + } + free(idxbx); + free(lubx); +{% endif %} + +{% if dims.ng > 0 %} + // set up general constraints for stage 0 to N-1 + double* D = calloc(NG*NU, sizeof(double)); + double* C = calloc(NG*NX, sizeof(double)); + double* lug = calloc(2*NG, sizeof(double)); + double* lg = lug; + double* ug = lug + NG; + + {% for j in range(end=dims.ng) -%} + {% for k in range(end=dims.nu) %} + {%- if constraints.D[j][k] != 0 %} + D[{{ j }}+NG * {{ k }}] = {{ constraints.D[j][k] }}; + {%- endif %} + {%- endfor %} + {%- endfor %} + + {% for j in range(end=dims.ng) -%} + {% for k in range(end=dims.nx) %} + {%- if constraints.C[j][k] != 0 %} + C[{{ j }}+NG * {{ k }}] = {{ constraints.C[j][k] }}; + {%- endif %} + {%- endfor %} + {%- endfor %} + + {% for i in range(end=dims.ng) %} + {%- if constraints.lg[i] != 0 %} + lg[{{ i }}] = {{ constraints.lg[i] }}; + {%- endif %} + {%- endfor %} + + {% for i in range(end=dims.ng) %} + {%- if constraints.ug[i] != 0 %} + ug[{{ i }}] = {{ constraints.ug[i] }}; + {%- endif %} + {%- endfor %} + + for (int i = 0; i < N; i++) + { + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "D", D); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "C", C); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "lg", lg); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "ug", ug); + } + free(D); + free(C); + free(lug); +{% endif %} + +{% if dims.nh > 0 %} + // set up nonlinear constraints for stage 0 to N-1 + double* luh = calloc(2*NH, sizeof(double)); + double* lh = luh; + double* uh = luh + NH; + + {% for i in range(end=dims.nh) %} + {%- if constraints.lh[i] != 0 %} + lh[{{ i }}] = {{ constraints.lh[i] }}; + {%- endif %} + {%- endfor %} + + {% for i in range(end=dims.nh) %} + {%- if constraints.uh[i] != 0 %} + uh[{{ i }}] = {{ constraints.uh[i] }}; + {%- endif %} + {%- endfor %} + + for (int i = 0; i < N; i++) + { + // nonlinear constraints for stages 0 to N-1 + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "nl_constr_h_fun_jac", + &capsule->nl_constr_h_fun_jac[i]); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "nl_constr_h_fun", + &capsule->nl_constr_h_fun[i]); + {% if solver_options.hessian_approx == "EXACT" %} + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, + "nl_constr_h_fun_jac_hess", &capsule->nl_constr_h_fun_jac_hess[i]); + {% endif %} + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "lh", lh); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "uh", uh); + } + free(luh); +{% endif %} + +{% if dims.nphi > 0 and constraints.constr_type == "BGP" %} + // set up convex-over-nonlinear constraints for stage 0 to N-1 + double* luphi = calloc(2*NPHI, sizeof(double)); + double* lphi = luphi; + double* uphi = luphi + NPHI; + {% for i in range(end=dims.nphi) %} + {%- if constraints.lphi[i] != 0 %} + lphi[{{ i }}] = {{ constraints.lphi[i] }}; + {%- endif %} + {%- endfor %} + + {% for i in range(end=dims.nphi) %} + {%- if constraints.uphi[i] != 0 %} + uphi[{{ i }}] = {{ constraints.uphi[i] }}; + {%- endif %} + {%- endfor %} + + for (int i = 0; i < N; i++) + { + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, + "nl_constr_phi_o_r_fun_phi_jac_ux_z_phi_hess_r_jac_ux", &capsule->phi_constraint[i]); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "lphi", lphi); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "uphi", uphi); + } + free(luphi); +{% endif %} + + /* terminal constraints */ +{% if dims.nbx_e > 0 %} + // set up bounds for last stage + // x + int* idxbx_e = malloc(NBXN * sizeof(int)); + {% for i in range(end=dims.nbx_e) %} + idxbx_e[{{ i }}] = {{ constraints.idxbx_e[i] }}; + {%- endfor %} + double* lubx_e = calloc(2*NBXN, sizeof(double)); + double* lbx_e = lubx_e; + double* ubx_e = lubx_e + NBXN; + {% for i in range(end=dims.nbx_e) %} + {%- if constraints.lbx_e[i] != 0 %} + lbx_e[{{ i }}] = {{ constraints.lbx_e[i] }}; + {%- endif %} + {%- if constraints.ubx_e[i] != 0 %} + ubx_e[{{ i }}] = {{ constraints.ubx_e[i] }}; + {%- endif %} + {%- endfor %} + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "idxbx", idxbx_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "lbx", lbx_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "ubx", ubx_e); + free(idxbx_e); + free(lubx_e); +{%- endif %} + +{% if dims.nsg_e > 0 %} + // set up soft bounds for general linear constraints + int* idxsg_e = calloc(NSGN, sizeof(int)); + {% for i in range(end=dims.nsg_e) %} + idxsg_e[{{ i }}] = {{ constraints.idxsg_e[i] }}; + {%- endfor %} + double* lusg_e = calloc(2*NSGN, sizeof(double)); + double* lsg_e = lusg_e; + double* usg_e = lusg_e + NSGN; + {% for i in range(end=dims.nsg_e) %} + {%- if constraints.lsg_e[i] != 0 %} + lsg_e[{{ i }}] = {{ constraints.lsg_e[i] }}; + {%- endif %} + {%- if constraints.usg_e[i] != 0 %} + usg_e[{{ i }}] = {{ constraints.usg_e[i] }}; + {%- endif %} + {%- endfor %} + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "idxsg", idxsg_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "lsg", lsg_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "usg", usg_e); + free(idxsg_e); + free(lusg_e); +{%- endif %} + +{% if dims.nsh_e > 0 %} + // set up soft bounds for nonlinear constraints + int* idxsh_e = malloc(NSHN * sizeof(int)); + {% for i in range(end=dims.nsh_e) %} + idxsh_e[{{ i }}] = {{ constraints.idxsh_e[i] }}; + {%- endfor %} + double* lush_e = calloc(2*NSHN, sizeof(double)); + double* lsh_e = lush_e; + double* ush_e = lush_e + NSHN; + {% for i in range(end=dims.nsh_e) %} + {%- if constraints.lsh_e[i] != 0 %} + lsh_e[{{ i }}] = {{ constraints.lsh_e[i] }}; + {%- endif %} + {%- if constraints.ush_e[i] != 0 %} + ush_e[{{ i }}] = {{ constraints.ush_e[i] }}; + {%- endif %} + {%- endfor %} + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "idxsh", idxsh_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "lsh", lsh_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "ush", ush_e); + free(idxsh_e); + free(lush_e); +{%- endif %} + +{% if dims.nsphi_e > 0 %} + // set up soft bounds for convex-over-nonlinear constraints + int* idxsphi_e = malloc(NSPHIN * sizeof(int)); + {% for i in range(end=dims.nsphi_e) %} + idxsphi_e[{{ i }}] = {{ constraints.idxsphi_e[i] }}; + {%- endfor %} + double* lusphi_e = calloc(2*NSPHIN, sizeof(double)); + double* lsphi_e = lusphi_e; + double* usphi_e = lusphi_e + NSPHIN; + {% for i in range(end=dims.nsphi_e) %} + {%- if constraints.lsphi_e[i] != 0 %} + lsphi_e[{{ i }}] = {{ constraints.lsphi_e[i] }}; + {%- endif %} + {%- if constraints.usphi_e[i] != 0 %} + usphi_e[{{ i }}] = {{ constraints.usphi_e[i] }}; + {%- endif %} + {%- endfor %} + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "idxsphi", idxsphi_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "lsphi", lsphi_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "usphi", usphi_e); + free(idxsphi_e); + free(lusphi_e); +{%- endif %} + +{% if dims.nsbx_e > 0 %} + // soft bounds on x + int* idxsbx_e = malloc(NSBXN * sizeof(int)); + {% for i in range(end=dims.nsbx_e) %} + idxsbx_e[{{ i }}] = {{ constraints.idxsbx_e[i] }}; + {%- endfor %} + double* lusbx_e = calloc(2*NSBXN, sizeof(double)); + double* lsbx_e = lusbx_e; + double* usbx_e = lusbx_e + NSBXN; + {% for i in range(end=dims.nsbx_e) %} + {%- if constraints.lsbx_e[i] != 0 %} + lsbx_e[{{ i }}] = {{ constraints.lsbx_e[i] }}; + {%- endif %} + {%- if constraints.usbx_e[i] != 0 %} + usbx_e[{{ i }}] = {{ constraints.usbx_e[i] }}; + {%- endif %} + {%- endfor %} + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "idxsbx", idxsbx_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "lsbx", lsbx_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "usbx", usbx_e); + free(idxsbx_e); + free(lusbx_e); +{% endif %} + +{% if dims.ng_e > 0 %} + // set up general constraints for last stage + double* C_e = calloc(NGN*NX, sizeof(double)); + double* lug_e = calloc(2*NGN, sizeof(double)); + double* lg_e = lug_e; + double* ug_e = lug_e + NGN; + + {% for j in range(end=dims.ng) %} + {%- for k in range(end=dims.nx) %} + {%- if constraints.C_e[j][k] != 0 %} + C_e[{{ j }}+NG * {{ k }}] = {{ constraints.C_e[j][k] }}; + {%- endif %} + {%- endfor %} + {%- endfor %} + + {% for i in range(end=dims.ng_e) %} + {%- if constraints.lg_e[i] != 0 %} + lg_e[{{ i }}] = {{ constraints.lg_e[i] }}; + {%- endif %} + {%- if constraints.ug_e[i] != 0 %} + ug_e[{{ i }}] = {{ constraints.ug_e[i] }}; + {%- endif %} + {%- endfor %} + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "C", C_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "lg", lg_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "ug", ug_e); + free(C_e); + free(lug_e); +{%- endif %} + +{% if dims.nh_e > 0 %} + // set up nonlinear constraints for last stage + double* luh_e = calloc(2*NHN, sizeof(double)); + double* lh_e = luh_e; + double* uh_e = luh_e + NHN; + {% for i in range(end=dims.nh_e) %} + {%- if constraints.lh_e[i] != 0 %} + lh_e[{{ i }}] = {{ constraints.lh_e[i] }}; + {%- endif %} + {%- endfor %} + + {% for i in range(end=dims.nh_e) %} + {%- if constraints.uh_e[i] != 0 %} + uh_e[{{ i }}] = {{ constraints.uh_e[i] }}; + {%- endif %} + {%- endfor %} + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "nl_constr_h_fun_jac", &capsule->nl_constr_h_e_fun_jac); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "nl_constr_h_fun", &capsule->nl_constr_h_e_fun); + {% if solver_options.hessian_approx == "EXACT" %} + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "nl_constr_h_fun_jac_hess", + &capsule->nl_constr_h_e_fun_jac_hess); + {% endif %} + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "lh", lh_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "uh", uh_e); + free(luh_e); +{%- endif %} + +{% if dims.nphi_e > 0 and constraints.constr_type_e == "BGP" %} + // set up convex-over-nonlinear constraints for last stage + double* luphi_e = calloc(2*NPHIN, sizeof(double)); + double* lphi_e = luphi_e; + double* uphi_e = luphi_e + NPHIN; + {% for i in range(end=dims.nphi_e) %} + {%- if constraints.lphi_e[i] != 0 %} + lphi_e[{{ i }}] = {{ constraints.lphi_e[i] }}; + {%- endif %} + {%- if constraints.uphi_e[i] != 0 %} + uphi_e[{{ i }}] = {{ constraints.uphi_e[i] }}; + {%- endif %} + {%- endfor %} + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "lphi", lphi_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "uphi", uphi_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, + "nl_constr_phi_o_r_fun_phi_jac_ux_z_phi_hess_r_jac_ux", &capsule->phi_e_constraint); + free(luphi_e); +{% endif %} + + + /************************************************ + * opts + ************************************************/ + + capsule->nlp_opts = ocp_nlp_solver_opts_create(nlp_config, nlp_dims); + +{% if solver_options.hessian_approx == "EXACT" %} + bool nlp_solver_exact_hessian = true; + // TODO: this if should not be needed! however, calling the setter with false leads to weird behavior. Investigate! + if (nlp_solver_exact_hessian) + { + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "exact_hess", &nlp_solver_exact_hessian); + } + int exact_hess_dyn = {{ solver_options.exact_hess_dyn }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "exact_hess_dyn", &exact_hess_dyn); + + int exact_hess_cost = {{ solver_options.exact_hess_cost }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "exact_hess_cost", &exact_hess_cost); + + int exact_hess_constr = {{ solver_options.exact_hess_constr }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "exact_hess_constr", &exact_hess_constr); +{%- endif -%} + +{%- if solver_options.globalization == "FIXED_STEP" %} + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "globalization", "fixed_step"); +{%- elif solver_options.globalization == "MERIT_BACKTRACKING" %} + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "globalization", "merit_backtracking"); + + double alpha_min = {{ solver_options.alpha_min }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "alpha_min", &alpha_min); + + double alpha_reduction = {{ solver_options.alpha_reduction }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "alpha_reduction", &alpha_reduction); +{%- endif -%} + +{%- if dims.nz > 0 %} + // TODO: these options are lower level -> should be encapsulated! maybe through hessian approx option. + bool output_z_val = true; + bool sens_algebraic_val = true; + + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_output_z", &output_z_val); + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_sens_algebraic", &sens_algebraic_val); +{%- endif %} + +{%- if solver_options.integrator_type != "DISCRETE" %} + + // set collocation type (relevant for implicit integrators) + sim_collocation_type collocation_type = {{ solver_options.collocation_type }}; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_collocation_type", &collocation_type); + + // set up sim_method_num_steps + {%- set all_equal = true %} + {%- set val = solver_options.sim_method_num_steps[0] %} + {%- for j in range(start=1, end=dims.N) %} + {%- if val != solver_options.sim_method_num_steps[j] %} + {%- set_global all_equal = false %} + {%- break %} + {%- endif %} + {%- endfor %} + + {%- if all_equal == true %} + // all sim_method_num_steps are identical + int sim_method_num_steps = {{ solver_options.sim_method_num_steps[0] }}; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_num_steps", &sim_method_num_steps); + {%- else %} + // sim_method_num_steps are different + int* sim_method_num_steps = malloc(N*sizeof(int)); + {%- for j in range(end=dims.N) %} + sim_method_num_steps[{{ j }}] = {{ solver_options.sim_method_num_steps[j] }}; + {%- endfor %} + + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_num_steps", &sim_method_num_steps[i]); + free(sim_method_num_steps); + {%- endif %} + + // set up sim_method_num_stages + {%- set all_equal = true %} + {%- set val = solver_options.sim_method_num_stages[0] %} + {%- for j in range(start=1, end=dims.N) %} + {%- if val != solver_options.sim_method_num_stages[j] %} + {%- set_global all_equal = false %} + {%- break %} + {%- endif %} + {%- endfor %} + + {%- if all_equal == true %} + // all sim_method_num_stages are identical + int sim_method_num_stages = {{ solver_options.sim_method_num_stages[0] }}; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_num_stages", &sim_method_num_stages); + {%- else %} + int* sim_method_num_stages = malloc(N*sizeof(int)); + {%- for j in range(end=dims.N) %} + sim_method_num_stages[{{ j }}] = {{ solver_options.sim_method_num_stages[j] }}; + {%- endfor %} + + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_num_stages", &sim_method_num_stages[i]); + free(sim_method_num_stages); + {%- endif %} + + int newton_iter_val = {{ solver_options.sim_method_newton_iter }}; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_newton_iter", &newton_iter_val); + + + // set up sim_method_jac_reuse + {%- set all_equal = true %} + {%- set val = solver_options.sim_method_jac_reuse[0] %} + {%- for j in range(start=1, end=dims.N) %} + {%- if val != solver_options.sim_method_jac_reuse[j] %} + {%- set_global all_equal = false %} + {%- break %} + {%- endif %} + {%- endfor %} + {%- if all_equal == true %} + bool tmp_bool = (bool) {{ solver_options.sim_method_jac_reuse[0] }}; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_jac_reuse", &tmp_bool); + {%- else %} + bool* sim_method_jac_reuse = malloc(N*sizeof(bool)); + {%- for j in range(end=dims.N) %} + sim_method_jac_reuse[{{ j }}] = (bool){{ solver_options.sim_method_jac_reuse[j] }}; + {%- endfor %} + + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_jac_reuse", &sim_method_jac_reuse[i]); + free(sim_method_jac_reuse); + {%- endif %} + +{%- endif %} + + double nlp_solver_step_length = {{ solver_options.nlp_solver_step_length }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "step_length", &nlp_solver_step_length); + + {%- if solver_options.nlp_solver_warm_start_first_qp %} + int nlp_solver_warm_start_first_qp = {{ solver_options.nlp_solver_warm_start_first_qp }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "warm_start_first_qp", &nlp_solver_warm_start_first_qp); + {%- endif %} + + double levenberg_marquardt = {{ solver_options.levenberg_marquardt }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "levenberg_marquardt", &levenberg_marquardt); + + /* options QP solver */ +{%- if solver_options.qp_solver is starting_with("PARTIAL_CONDENSING") %} + int qp_solver_cond_N; + + {%- if solver_options.qp_solver_cond_N %} + qp_solver_cond_N = {{ solver_options.qp_solver_cond_N }}; + {% else %} + // NOTE: there is no condensing happening here! + qp_solver_cond_N = N; + {%- endif %} + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "qp_cond_N", &qp_solver_cond_N); +{% endif %} + + int qp_solver_iter_max = {{ solver_options.qp_solver_iter_max }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "qp_iter_max", &qp_solver_iter_max); + + {%- if solver_options.qp_solver_tol_stat %} + double qp_solver_tol_stat = {{ solver_options.qp_solver_tol_stat }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "qp_tol_stat", &qp_solver_tol_stat); + {%- endif -%} + + {%- if solver_options.qp_solver_tol_eq %} + double qp_solver_tol_eq = {{ solver_options.qp_solver_tol_eq }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "qp_tol_eq", &qp_solver_tol_eq); + {%- endif -%} + + {%- if solver_options.qp_solver_tol_ineq %} + double qp_solver_tol_ineq = {{ solver_options.qp_solver_tol_ineq }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "qp_tol_ineq", &qp_solver_tol_ineq); + {%- endif -%} + + {%- if solver_options.qp_solver_tol_comp %} + double qp_solver_tol_comp = {{ solver_options.qp_solver_tol_comp }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "qp_tol_comp", &qp_solver_tol_comp); + {%- endif -%} + + {%- if solver_options.qp_solver_warm_start %} + int qp_solver_warm_start = {{ solver_options.qp_solver_warm_start }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "qp_warm_start", &qp_solver_warm_start); + {%- endif -%} + +{% if solver_options.nlp_solver_type == "SQP" %} + // set SQP specific options + double nlp_solver_tol_stat = {{ solver_options.nlp_solver_tol_stat }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "tol_stat", &nlp_solver_tol_stat); + + double nlp_solver_tol_eq = {{ solver_options.nlp_solver_tol_eq }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "tol_eq", &nlp_solver_tol_eq); + + double nlp_solver_tol_ineq = {{ solver_options.nlp_solver_tol_ineq }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "tol_ineq", &nlp_solver_tol_ineq); + + double nlp_solver_tol_comp = {{ solver_options.nlp_solver_tol_comp }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "tol_comp", &nlp_solver_tol_comp); + + int nlp_solver_max_iter = {{ solver_options.nlp_solver_max_iter }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "max_iter", &nlp_solver_max_iter); + + int initialize_t_slacks = {{ solver_options.initialize_t_slacks }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "initialize_t_slacks", &initialize_t_slacks); +{%- endif %} + + int print_level = {{ solver_options.print_level }}; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "print_level", &print_level); + + + int ext_cost_num_hess = {{ solver_options.ext_cost_num_hess }}; +{%- if cost.cost_type == "EXTERNAL" %} + for (int i = 0; i < N; i++) + { + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "cost_numerical_hessian", &ext_cost_num_hess); + } +{%- endif %} +{%- if cost.cost_type_e == "EXTERNAL" %} + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, N, "cost_numerical_hessian", &ext_cost_num_hess); +{%- endif %} + + + /* out */ + ocp_nlp_out * nlp_out = ocp_nlp_out_create(nlp_config, nlp_dims); + capsule->nlp_out = nlp_out; + + // initialize primal solution + double* xu0 = calloc(NX+NU, sizeof(double)); + double* x0 = xu0; +{% if dims.nbx_0 == dims.nx %} + // initialize with x0 + {% for item in constraints.lbx_0 %} + {%- if item != 0 %} + x0[{{ loop.index0 }}] = {{ item }}; + {%- endif %} + {%- endfor %} +{% else %} + // initialize with zeros +{%- endif %} + + double* u0 = xu0 + NX; + + for (int i = 0; i < N; i++) + { + // x0 + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, i, "x", x0); + // u0 + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, i, "u", u0); + } + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, N, "x", x0); + free(xu0); + + capsule->nlp_solver = ocp_nlp_solver_create(nlp_config, nlp_dims, capsule->nlp_opts); + + +{% if dims.np > 0 %} + // initialize parameters to nominal value + double* p = calloc(NP, sizeof(double)); + {% for item in parameter_values %} + {%- if item != 0 %} + p[{{ loop.index0 }}] = {{ item }}; + {%- endif %} + {%- endfor %} + + for (int i = 0; i <= N; i++) + { + {{ model.name }}_acados_update_params(capsule, i, p, NP); + } + free(p); +{%- endif %}{# if dims.np #} + + status = ocp_nlp_precompute(capsule->nlp_solver, nlp_in, nlp_out); + + if (status != ACADOS_SUCCESS) + { + printf("\nocp_precompute failed!\n\n"); + exit(1); + } + + return status; +} + + +int {{ model.name }}_acados_update_params({{ model.name }}_solver_capsule * capsule, int stage, double *p, int np) +{ + int solver_status = 0; + + int casadi_np = {{ dims.np }}; + if (casadi_np != np) { + printf("acados_update_params: trying to set %i parameters for external functions." + " External function has %i parameters. Exiting.\n", np, casadi_np); + exit(1); + } + +{%- if dims.np > 0 %} + const int N = capsule->nlp_solver_plan->N; + if (stage < N && stage >= 0) + { + {%- if solver_options.integrator_type == "IRK" %} + capsule->impl_dae_fun[stage].set_param(capsule->impl_dae_fun+stage, p); + capsule->impl_dae_fun_jac_x_xdot_z[stage].set_param(capsule->impl_dae_fun_jac_x_xdot_z+stage, p); + capsule->impl_dae_jac_x_xdot_u_z[stage].set_param(capsule->impl_dae_jac_x_xdot_u_z+stage, p); + + {%- if solver_options.hessian_approx == "EXACT" %} + capsule->impl_dae_hess[stage].set_param(capsule->impl_dae_hess+stage, p); + {%- endif %} + {% elif solver_options.integrator_type == "LIFTED_IRK" %} + capsule->impl_dae_fun[stage].set_param(capsule->impl_dae_fun+stage, p); + capsule->impl_dae_fun_jac_x_xdot_z[stage].set_param(capsule->impl_dae_fun_jac_x_xdot_z+stage, p); + {% elif solver_options.integrator_type == "ERK" %} + capsule->forw_vde_casadi[stage].set_param(capsule->forw_vde_casadi+stage, p); + capsule->expl_ode_fun[stage].set_param(capsule->expl_ode_fun+stage, p); + + {%- if solver_options.hessian_approx == "EXACT" %} + capsule->hess_vde_casadi[stage].set_param(capsule->hess_vde_casadi+stage, p); + {%- endif %} + {% elif solver_options.integrator_type == "GNSF" %} + capsule->gnsf_phi_fun[stage].set_param(capsule->gnsf_phi_fun+stage, p); + capsule->gnsf_phi_fun_jac_y[stage].set_param(capsule->gnsf_phi_fun_jac_y+stage, p); + capsule->gnsf_phi_jac_y_uhat[stage].set_param(capsule->gnsf_phi_jac_y_uhat+stage, p); + + capsule->gnsf_f_lo_jac_x1_x1dot_u_z[stage].set_param(capsule->gnsf_f_lo_jac_x1_x1dot_u_z+stage, p); + {% elif solver_options.integrator_type == "DISCRETE" %} + capsule->discr_dyn_phi_fun[stage].set_param(capsule->discr_dyn_phi_fun+stage, p); + capsule->discr_dyn_phi_fun_jac_ut_xt[stage].set_param(capsule->discr_dyn_phi_fun_jac_ut_xt+stage, p); + {%- if solver_options.hessian_approx == "EXACT" %} + capsule->discr_dyn_phi_fun_jac_ut_xt_hess[stage].set_param(capsule->discr_dyn_phi_fun_jac_ut_xt_hess+stage, p); + {% endif %} + {%- endif %}{# integrator_type #} + + // constraints + {% if constraints.constr_type == "BGP" %} + capsule->phi_constraint[stage].set_param(capsule->phi_constraint+stage, p); + {% elif constraints.constr_type == "BGH" and dims.nh > 0 %} + capsule->nl_constr_h_fun_jac[stage].set_param(capsule->nl_constr_h_fun_jac+stage, p); + capsule->nl_constr_h_fun[stage].set_param(capsule->nl_constr_h_fun+stage, p); + {%- if solver_options.hessian_approx == "EXACT" %} + capsule->nl_constr_h_fun_jac_hess[stage].set_param(capsule->nl_constr_h_fun_jac_hess+stage, p); + {%- endif %} + {%- endif %} + + // cost + if (stage == 0) + { + {%- if cost.cost_type_0 == "NONLINEAR_LS" %} + capsule->cost_y_0_fun.set_param(&capsule->cost_y_0_fun, p); + capsule->cost_y_0_fun_jac_ut_xt.set_param(&capsule->cost_y_0_fun_jac_ut_xt, p); + capsule->cost_y_0_hess.set_param(&capsule->cost_y_0_hess, p); + {%- elif cost.cost_type_0 == "EXTERNAL" %} + capsule->ext_cost_0_fun.set_param(&capsule->ext_cost_0_fun, p); + capsule->ext_cost_0_fun_jac.set_param(&capsule->ext_cost_0_fun_jac, p); + capsule->ext_cost_0_fun_jac_hess.set_param(&capsule->ext_cost_0_fun_jac_hess, p); + {% endif %} + } + else // 0 < stage < N + { + {%- if cost.cost_type == "NONLINEAR_LS" %} + capsule->cost_y_fun[stage-1].set_param(capsule->cost_y_fun+stage-1, p); + capsule->cost_y_fun_jac_ut_xt[stage-1].set_param(capsule->cost_y_fun_jac_ut_xt+stage-1, p); + capsule->cost_y_hess[stage-1].set_param(capsule->cost_y_hess+stage-1, p); + {%- elif cost.cost_type == "EXTERNAL" %} + capsule->ext_cost_fun[stage-1].set_param(capsule->ext_cost_fun+stage-1, p); + capsule->ext_cost_fun_jac[stage-1].set_param(capsule->ext_cost_fun_jac+stage-1, p); + capsule->ext_cost_fun_jac_hess[stage-1].set_param(capsule->ext_cost_fun_jac_hess+stage-1, p); + {%- endif %} + } + } + + else // stage == N + { + // terminal shooting node has no dynamics + // cost + {%- if cost.cost_type_e == "NONLINEAR_LS" %} + capsule->cost_y_e_fun.set_param(&capsule->cost_y_e_fun, p); + capsule->cost_y_e_fun_jac_ut_xt.set_param(&capsule->cost_y_e_fun_jac_ut_xt, p); + capsule->cost_y_e_hess.set_param(&capsule->cost_y_e_hess, p); + {%- elif cost.cost_type_e == "EXTERNAL" %} + capsule->ext_cost_e_fun.set_param(&capsule->ext_cost_e_fun, p); + capsule->ext_cost_e_fun_jac.set_param(&capsule->ext_cost_e_fun_jac, p); + capsule->ext_cost_e_fun_jac_hess.set_param(&capsule->ext_cost_e_fun_jac_hess, p); + {% endif %} + // constraints + {% if constraints.constr_type_e == "BGP" %} + capsule->phi_e_constraint.set_param(&capsule->phi_e_constraint, p); + {% elif constraints.constr_type_e == "BGH" and dims.nh_e > 0 %} + capsule->nl_constr_h_e_fun_jac.set_param(&capsule->nl_constr_h_e_fun_jac, p); + capsule->nl_constr_h_e_fun.set_param(&capsule->nl_constr_h_e_fun, p); + {%- if solver_options.hessian_approx == "EXACT" %} + capsule->nl_constr_h_e_fun_jac_hess.set_param(&capsule->nl_constr_h_e_fun_jac_hess, p); + {%- endif %} + {% endif %} + } +{% endif %}{# if dims.np #} + + return solver_status; +} + + + +int {{ model.name }}_acados_solve({{ model.name }}_solver_capsule * capsule) +{ + // solve NLP + int solver_status = ocp_nlp_solve(capsule->nlp_solver, capsule->nlp_in, capsule->nlp_out); + + return solver_status; +} + + +int {{ model.name }}_acados_free({{ model.name }}_solver_capsule * capsule) +{ + // before destroying, keep some info + const int N = capsule->nlp_solver_plan->N; + // free memory + ocp_nlp_solver_opts_destroy(capsule->nlp_opts); + ocp_nlp_in_destroy(capsule->nlp_in); + ocp_nlp_out_destroy(capsule->nlp_out); + ocp_nlp_solver_destroy(capsule->nlp_solver); + ocp_nlp_dims_destroy(capsule->nlp_dims); + ocp_nlp_config_destroy(capsule->nlp_config); + ocp_nlp_plan_destroy(capsule->nlp_solver_plan); + + /* free external function */ + // dynamics +{%- if solver_options.integrator_type == "IRK" %} + for (int i = 0; i < N; i++) + { + external_function_param_casadi_free(&capsule->impl_dae_fun[i]); + external_function_param_casadi_free(&capsule->impl_dae_fun_jac_x_xdot_z[i]); + external_function_param_casadi_free(&capsule->impl_dae_jac_x_xdot_u_z[i]); + {%- if solver_options.hessian_approx == "EXACT" %} + external_function_param_casadi_free(&capsule->impl_dae_hess[i]); + {%- endif %} + } + free(capsule->impl_dae_fun); + free(capsule->impl_dae_fun_jac_x_xdot_z); + free(capsule->impl_dae_jac_x_xdot_u_z); + {%- if solver_options.hessian_approx == "EXACT" %} + free(capsule->impl_dae_hess); + {%- endif %} + +{%- elif solver_options.integrator_type == "LIFTED_IRK" %} + for (int i = 0; i < N; i++) + { + external_function_param_casadi_free(&capsule->impl_dae_fun[i]); + external_function_param_casadi_free(&capsule->impl_dae_fun_jac_x_xdot_u[i]); + } + free(capsule->impl_dae_fun); + free(capsule->impl_dae_fun_jac_x_xdot_u); + +{%- elif solver_options.integrator_type == "ERK" %} + for (int i = 0; i < N; i++) + { + external_function_param_casadi_free(&capsule->forw_vde_casadi[i]); + external_function_param_casadi_free(&capsule->expl_ode_fun[i]); + {%- if solver_options.hessian_approx == "EXACT" %} + external_function_param_casadi_free(&capsule->hess_vde_casadi[i]); + {%- endif %} + } + free(capsule->forw_vde_casadi); + free(capsule->expl_ode_fun); + {%- if solver_options.hessian_approx == "EXACT" %} + free(capsule->hess_vde_casadi); + {%- endif %} + +{%- elif solver_options.integrator_type == "GNSF" %} + for (int i = 0; i < N; i++) + { + external_function_param_casadi_free(&capsule->gnsf_phi_fun[i]); + external_function_param_casadi_free(&capsule->gnsf_phi_fun_jac_y[i]); + external_function_param_casadi_free(&capsule->gnsf_phi_jac_y_uhat[i]); + external_function_param_casadi_free(&capsule->gnsf_f_lo_jac_x1_x1dot_u_z[i]); + external_function_param_casadi_free(&capsule->gnsf_get_matrices_fun[i]); + } + free(capsule->gnsf_phi_fun); + free(capsule->gnsf_phi_fun_jac_y); + free(capsule->gnsf_phi_jac_y_uhat); + free(capsule->gnsf_f_lo_jac_x1_x1dot_u_z); + free(capsule->gnsf_get_matrices_fun); +{%- elif solver_options.integrator_type == "DISCRETE" %} + for (int i = 0; i < N; i++) + { + external_function_param_{{ model.dyn_ext_fun_type }}_free(&capsule->discr_dyn_phi_fun[i]); + external_function_param_{{ model.dyn_ext_fun_type }}_free(&capsule->discr_dyn_phi_fun_jac_ut_xt[i]); + {%- if solver_options.hessian_approx == "EXACT" %} + external_function_param_{{ model.dyn_ext_fun_type }}_free(&capsule->discr_dyn_phi_fun_jac_ut_xt_hess[i]); + {%- endif %} + } + free(capsule->discr_dyn_phi_fun); + free(capsule->discr_dyn_phi_fun_jac_ut_xt); + {%- if solver_options.hessian_approx == "EXACT" %} + free(capsule->discr_dyn_phi_fun_jac_ut_xt_hess); + {%- endif %} + +{%- endif %} + + // cost +{%- if cost.cost_type_0 == "NONLINEAR_LS" %} + external_function_param_casadi_free(&capsule->cost_y_0_fun); + external_function_param_casadi_free(&capsule->cost_y_0_fun_jac_ut_xt); + external_function_param_casadi_free(&capsule->cost_y_0_hess); +{%- elif cost.cost_type_0 == "EXTERNAL" %} + external_function_param_{{ cost.cost_ext_fun_type_0 }}_free(&capsule->ext_cost_0_fun); + external_function_param_{{ cost.cost_ext_fun_type_0 }}_free(&capsule->ext_cost_0_fun_jac); + external_function_param_{{ cost.cost_ext_fun_type_0 }}_free(&capsule->ext_cost_0_fun_jac_hess); +{%- endif %} +{%- if cost.cost_type == "NONLINEAR_LS" %} + for (int i = 0; i < N - 1; i++) + { + external_function_param_casadi_free(&capsule->cost_y_fun[i]); + external_function_param_casadi_free(&capsule->cost_y_fun_jac_ut_xt[i]); + external_function_param_casadi_free(&capsule->cost_y_hess[i]); + } + free(capsule->cost_y_fun); + free(capsule->cost_y_fun_jac_ut_xt); + free(capsule->cost_y_hess); +{%- elif cost.cost_type == "EXTERNAL" %} + for (int i = 0; i < N - 1; i++) + { + external_function_param_{{ cost.cost_ext_fun_type }}_free(&capsule->ext_cost_fun[i]); + external_function_param_{{ cost.cost_ext_fun_type }}_free(&capsule->ext_cost_fun_jac[i]); + external_function_param_{{ cost.cost_ext_fun_type }}_free(&capsule->ext_cost_fun_jac_hess[i]); + } + free(capsule->ext_cost_fun); + free(capsule->ext_cost_fun_jac); + free(capsule->ext_cost_fun_jac_hess); +{%- endif %} +{%- if cost.cost_type_e == "NONLINEAR_LS" %} + external_function_param_casadi_free(&capsule->cost_y_e_fun); + external_function_param_casadi_free(&capsule->cost_y_e_fun_jac_ut_xt); + external_function_param_casadi_free(&capsule->cost_y_e_hess); +{%- elif cost.cost_type_e == "EXTERNAL" %} + external_function_param_{{ cost.cost_ext_fun_type_e }}_free(&capsule->ext_cost_e_fun); + external_function_param_{{ cost.cost_ext_fun_type_e }}_free(&capsule->ext_cost_e_fun_jac); + external_function_param_{{ cost.cost_ext_fun_type_e }}_free(&capsule->ext_cost_e_fun_jac_hess); +{%- endif %} + + // constraints +{%- if constraints.constr_type == "BGH" and dims.nh > 0 %} + for (int i = 0; i < N; i++) + { + external_function_param_casadi_free(&capsule->nl_constr_h_fun_jac[i]); + external_function_param_casadi_free(&capsule->nl_constr_h_fun[i]); + } + {%- if solver_options.hessian_approx == "EXACT" %} + for (int i = 0; i < N; i++) + { + external_function_param_casadi_free(&capsule->nl_constr_h_fun_jac_hess[i]); + } + {%- endif %} + free(capsule->nl_constr_h_fun_jac); + free(capsule->nl_constr_h_fun); + {%- if solver_options.hessian_approx == "EXACT" %} + free(capsule->nl_constr_h_fun_jac_hess); + {%- endif %} + +{%- elif constraints.constr_type == "BGP" and dims.nphi > 0 %} + for (int i = 0; i < N; i++) + { + external_function_param_casadi_free(&capsule->phi_constraint[i]); + } + free(capsule->phi_constraint); +{%- endif %} + +{%- if constraints.constr_type_e == "BGH" and dims.nh_e > 0 %} + external_function_param_casadi_free(&capsule->nl_constr_h_e_fun_jac); + external_function_param_casadi_free(&capsule->nl_constr_h_e_fun); +{%- if solver_options.hessian_approx == "EXACT" %} + external_function_param_casadi_free(&capsule->nl_constr_h_e_fun_jac_hess); +{%- endif %} +{%- elif constraints.constr_type_e == "BGP" and dims.nphi_e > 0 %} + external_function_param_casadi_free(&capsule->phi_e_constraint); +{%- endif %} + + return 0; +} + +ocp_nlp_in *{{ model.name }}_acados_get_nlp_in({{ model.name }}_solver_capsule * capsule) { return capsule->nlp_in; } +ocp_nlp_out *{{ model.name }}_acados_get_nlp_out({{ model.name }}_solver_capsule * capsule) { return capsule->nlp_out; } +ocp_nlp_solver *{{ model.name }}_acados_get_nlp_solver({{ model.name }}_solver_capsule * capsule) { return capsule->nlp_solver; } +ocp_nlp_config *{{ model.name }}_acados_get_nlp_config({{ model.name }}_solver_capsule * capsule) { return capsule->nlp_config; } +void *{{ model.name }}_acados_get_nlp_opts({{ model.name }}_solver_capsule * capsule) { return capsule->nlp_opts; } +ocp_nlp_dims *{{ model.name }}_acados_get_nlp_dims({{ model.name }}_solver_capsule * capsule) { return capsule->nlp_dims; } +ocp_nlp_plan *{{ model.name }}_acados_get_nlp_plan({{ model.name }}_solver_capsule * capsule) { return capsule->nlp_solver_plan; } + + +void {{ model.name }}_acados_print_stats({{ model.name }}_solver_capsule * capsule) +{ + int sqp_iter, stat_m, stat_n, tmp_int; + ocp_nlp_get(capsule->nlp_config, capsule->nlp_solver, "sqp_iter", &sqp_iter); + ocp_nlp_get(capsule->nlp_config, capsule->nlp_solver, "stat_n", &stat_n); + ocp_nlp_get(capsule->nlp_config, capsule->nlp_solver, "stat_m", &stat_m); + + {% set stat_n_max = 10 %} + double stat[{{ solver_options.nlp_solver_max_iter * stat_n_max }}]; + ocp_nlp_get(capsule->nlp_config, capsule->nlp_solver, "statistics", stat); + + int nrow = sqp_iter+1 < stat_m ? sqp_iter+1 : stat_m; + + printf("iter\tres_stat\tres_eq\t\tres_ineq\tres_comp\tqp_stat\tqp_iter\n"); + for (int i = 0; i < nrow; i++) + { + for (int j = 0; j < stat_n + 1; j++) + { + if (j == 0 || j > 4) + { + tmp_int = (int) stat[i + j * nrow]; + printf("%d\t", tmp_int); + } + else + { + printf("%e\t", stat[i + j * nrow]); + } + } + printf("\n"); + } +} + diff --git a/pyextra/acados_template/c_templates_tera/acados_solver.in.h b/pyextra/acados_template/c_templates_tera/acados_solver.in.h new file mode 100644 index 000000000..e8c0a38ca --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/acados_solver.in.h @@ -0,0 +1,206 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +#ifndef ACADOS_SOLVER_{{ model.name }}_H_ +#define ACADOS_SOLVER_{{ model.name }}_H_ + +#include "acados_c/ocp_nlp_interface.h" +#include "acados_c/external_function_interface.h" + +#define {{ model.name | upper }}_NX {{ dims.nx }} +#define {{ model.name | upper }}_NZ {{ dims.nz }} +#define {{ model.name | upper }}_NU {{ dims.nu }} +#define {{ model.name | upper }}_NP {{ dims.np }} +#define {{ model.name | upper }}_NBX {{ dims.nbx }} +#define {{ model.name | upper }}_NBX0 {{ dims.nbx_0 }} +#define {{ model.name | upper }}_NBU {{ dims.nbu }} +#define {{ model.name | upper }}_NSBX {{ dims.nsbx }} +#define {{ model.name | upper }}_NSBU {{ dims.nsbu }} +#define {{ model.name | upper }}_NSH {{ dims.nsh }} +#define {{ model.name | upper }}_NSG {{ dims.nsg }} +#define {{ model.name | upper }}_NSPHI {{ dims.nsphi }} +#define {{ model.name | upper }}_NSHN {{ dims.nsh_e }} +#define {{ model.name | upper }}_NSGN {{ dims.nsg_e }} +#define {{ model.name | upper }}_NSPHIN {{ dims.nsphi_e }} +#define {{ model.name | upper }}_NSBXN {{ dims.nsbx_e }} +#define {{ model.name | upper }}_NS {{ dims.ns }} +#define {{ model.name | upper }}_NSN {{ dims.ns_e }} +#define {{ model.name | upper }}_NG {{ dims.ng }} +#define {{ model.name | upper }}_NBXN {{ dims.nbx_e }} +#define {{ model.name | upper }}_NGN {{ dims.ng_e }} +#define {{ model.name | upper }}_NY0 {{ dims.ny_0 }} +#define {{ model.name | upper }}_NY {{ dims.ny }} +#define {{ model.name | upper }}_NYN {{ dims.ny_e }} +#define {{ model.name | upper }}_N {{ dims.N }} +#define {{ model.name | upper }}_NH {{ dims.nh }} +#define {{ model.name | upper }}_NPHI {{ dims.nphi }} +#define {{ model.name | upper }}_NHN {{ dims.nh_e }} +#define {{ model.name | upper }}_NPHIN {{ dims.nphi_e }} +#define {{ model.name | upper }}_NR {{ dims.nr }} + +#ifdef __cplusplus +extern "C" { +#endif + +// ** capsule for solver data ** +typedef struct {{ model.name }}_solver_capsule +{ + // acados objects + ocp_nlp_in *nlp_in; + ocp_nlp_out *nlp_out; + ocp_nlp_solver *nlp_solver; + void *nlp_opts; + ocp_nlp_plan *nlp_solver_plan; + ocp_nlp_config *nlp_config; + ocp_nlp_dims *nlp_dims; + + // number of expected runtime parameters + unsigned int nlp_np; + + /* external functions */ + // dynamics +{% if solver_options.integrator_type == "ERK" %} + external_function_param_casadi *forw_vde_casadi; + external_function_param_casadi *expl_ode_fun; +{% if solver_options.hessian_approx == "EXACT" %} + external_function_param_casadi *hess_vde_casadi; +{%- endif %} +{% elif solver_options.integrator_type == "IRK" %} + external_function_param_casadi *impl_dae_fun; + external_function_param_casadi *impl_dae_fun_jac_x_xdot_z; + external_function_param_casadi *impl_dae_jac_x_xdot_u_z; +{% if solver_options.hessian_approx == "EXACT" %} + external_function_param_casadi *impl_dae_hess; +{%- endif %} +{% elif solver_options.integrator_type == "LIFTED_IRK" %} + external_function_param_casadi *impl_dae_fun; + external_function_param_casadi *impl_dae_fun_jac_x_xdot_u; +{% elif solver_options.integrator_type == "GNSF" %} + external_function_param_casadi *gnsf_phi_fun; + external_function_param_casadi *gnsf_phi_fun_jac_y; + external_function_param_casadi *gnsf_phi_jac_y_uhat; + external_function_param_casadi *gnsf_f_lo_jac_x1_x1dot_u_z; + external_function_param_casadi *gnsf_get_matrices_fun; +{% elif solver_options.integrator_type == "DISCRETE" %} + external_function_param_{{ model.dyn_ext_fun_type }} *discr_dyn_phi_fun; + external_function_param_{{ model.dyn_ext_fun_type }} *discr_dyn_phi_fun_jac_ut_xt; +{%- if solver_options.hessian_approx == "EXACT" %} + external_function_param_{{ model.dyn_ext_fun_type }} *discr_dyn_phi_fun_jac_ut_xt_hess; +{%- endif %} +{%- endif %} + + + // cost +{% if cost.cost_type == "NONLINEAR_LS" %} + external_function_param_casadi *cost_y_fun; + external_function_param_casadi *cost_y_fun_jac_ut_xt; + external_function_param_casadi *cost_y_hess; +{%- elif cost.cost_type == "EXTERNAL" %} + external_function_param_{{ cost.cost_ext_fun_type }} *ext_cost_fun; + external_function_param_{{ cost.cost_ext_fun_type }} *ext_cost_fun_jac; + external_function_param_{{ cost.cost_ext_fun_type }} *ext_cost_fun_jac_hess; +{% endif %} + +{% if cost.cost_type_0 == "NONLINEAR_LS" %} + external_function_param_casadi cost_y_0_fun; + external_function_param_casadi cost_y_0_fun_jac_ut_xt; + external_function_param_casadi cost_y_0_hess; +{% elif cost.cost_type_0 == "EXTERNAL" %} + external_function_param_{{ cost.cost_ext_fun_type_0 }} ext_cost_0_fun; + external_function_param_{{ cost.cost_ext_fun_type_0 }} ext_cost_0_fun_jac; + external_function_param_{{ cost.cost_ext_fun_type_0 }} ext_cost_0_fun_jac_hess; +{%- endif %} + +{% if cost.cost_type_e == "NONLINEAR_LS" %} + external_function_param_casadi cost_y_e_fun; + external_function_param_casadi cost_y_e_fun_jac_ut_xt; + external_function_param_casadi cost_y_e_hess; +{% elif cost.cost_type_e == "EXTERNAL" %} + external_function_param_{{ cost.cost_ext_fun_type_e }} ext_cost_e_fun; + external_function_param_{{ cost.cost_ext_fun_type_e }} ext_cost_e_fun_jac; + external_function_param_{{ cost.cost_ext_fun_type_e }} ext_cost_e_fun_jac_hess; +{%- endif %} + + // constraints +{%- if constraints.constr_type == "BGP" %} + external_function_param_casadi *phi_constraint; +{% elif constraints.constr_type == "BGH" and dims.nh > 0 %} + external_function_param_casadi *nl_constr_h_fun_jac; + external_function_param_casadi *nl_constr_h_fun; + external_function_param_casadi *nl_constr_h_fun_jac_hess; +{%- endif %} + + +{% if constraints.constr_type_e == "BGP" %} + external_function_param_casadi phi_e_constraint; +{% elif constraints.constr_type_e == "BGH" and dims.nh_e > 0 %} + external_function_param_casadi nl_constr_h_e_fun_jac; + external_function_param_casadi nl_constr_h_e_fun; + external_function_param_casadi nl_constr_h_e_fun_jac_hess; +{%- endif %} + +} {{ model.name }}_solver_capsule; + +{{ model.name }}_solver_capsule * {{ model.name }}_acados_create_capsule(void); +int {{ model.name }}_acados_free_capsule({{ model.name }}_solver_capsule *capsule); + +int {{ model.name }}_acados_create({{ model.name }}_solver_capsule * capsule); +/** + * Generic version of {{ model.name }}_acados_create which allows to use a different number of shooting intervals than + * the number used for code generation. If new_time_steps=NULL and n_time_steps matches the number used for code + * generation, the time-steps from code generation is used. + */ +int {{ model.name }}_acados_create_with_discretization({{ model.name }}_solver_capsule * capsule, int n_time_steps, double* new_time_steps); +/** + * Update the time step vector. Number N must be identical to the currently set number of shooting nodes in the + * nlp_solver_plan. Returns 0 if no error occurred and a otherwise a value other than 0. + */ +int {{ model.name }}_acados_update_time_steps({{ model.name }}_solver_capsule * capsule, int N, double* new_time_steps); +int {{ model.name }}_acados_update_params({{ model.name }}_solver_capsule * capsule, int stage, double *value, int np); +int {{ model.name }}_acados_solve({{ model.name }}_solver_capsule * capsule); +int {{ model.name }}_acados_free({{ model.name }}_solver_capsule * capsule); +void {{ model.name }}_acados_print_stats({{ model.name }}_solver_capsule * capsule); + +ocp_nlp_in *{{ model.name }}_acados_get_nlp_in({{ model.name }}_solver_capsule * capsule); +ocp_nlp_out *{{ model.name }}_acados_get_nlp_out({{ model.name }}_solver_capsule * capsule); +ocp_nlp_solver *{{ model.name }}_acados_get_nlp_solver({{ model.name }}_solver_capsule * capsule); +ocp_nlp_config *{{ model.name }}_acados_get_nlp_config({{ model.name }}_solver_capsule * capsule); +void *{{ model.name }}_acados_get_nlp_opts({{ model.name }}_solver_capsule * capsule); +ocp_nlp_dims *{{ model.name }}_acados_get_nlp_dims({{ model.name }}_solver_capsule * capsule); +ocp_nlp_plan *{{ model.name }}_acados_get_nlp_plan({{ model.name }}_solver_capsule * capsule); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_SOLVER_{{ model.name }}_H_ diff --git a/pyextra/acados_template/c_templates_tera/acados_solver.in.pxd b/pyextra/acados_template/c_templates_tera/acados_solver.in.pxd new file mode 100644 index 000000000..8387980c2 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/acados_solver.in.pxd @@ -0,0 +1,22 @@ +cimport acados_solver_common + +cdef extern from "acados_solver_{{ model.name }}.h": + ctypedef struct nlp_solver_capsule "{{ model.name }}_solver_capsule": + pass + + nlp_solver_capsule * acados_create_capsule "{{ model.name }}_acados_create_capsule"() + int acados_free_capsule "{{ model.name }}_acados_free_capsule"(nlp_solver_capsule *capsule) + + int acados_create "{{ model.name }}_acados_create"(nlp_solver_capsule * capsule) + int acados_update_params "{{ model.name }}_acados_update_params"(nlp_solver_capsule * capsule, int stage, double *value, int np_) + int acados_solve "{{ model.name }}_acados_solve"(nlp_solver_capsule * capsule) + int acados_free "{{ model.name }}_acados_free"(nlp_solver_capsule * capsule) + void acados_print_stats "{{ model.name }}_acados_print_stats"(nlp_solver_capsule * capsule) + + acados_solver_common.ocp_nlp_in *acados_get_nlp_in "{{ model.name }}_acados_get_nlp_in"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_out *acados_get_nlp_out "{{ model.name }}_acados_get_nlp_out"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_solver *acados_get_nlp_solver "{{ model.name }}_acados_get_nlp_solver"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_config *acados_get_nlp_config "{{ model.name }}_acados_get_nlp_config"(nlp_solver_capsule * capsule) + void *acados_get_nlp_opts "{{ model.name }}_acados_get_nlp_opts"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_dims *acados_get_nlp_dims "{{ model.name }}_acados_get_nlp_dims"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_plan *acados_get_nlp_plan "{{ model.name }}_acados_get_nlp_plan"(nlp_solver_capsule * capsule) diff --git a/pyextra/acados_template/c_templates_tera/acados_solver_sfun.in.c b/pyextra/acados_template/c_templates_tera/acados_solver_sfun.in.c new file mode 100644 index 000000000..a6cd1faa8 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/acados_solver_sfun.in.c @@ -0,0 +1,761 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +#define S_FUNCTION_NAME acados_solver_sfunction_{{ model.name }} +#define S_FUNCTION_LEVEL 2 + +#define MDL_START + +// acados +#include "acados/utils/print.h" +#include "acados_c/sim_interface.h" +#include "acados_c/external_function_interface.h" + +// example specific +#include "{{ model.name }}_model/{{ model.name }}_model.h" +#include "acados_solver_{{ model.name }}.h" + +#include "simstruc.h" + +{% if simulink_opts.samplingtime == "t0" -%} +#define SAMPLINGTIME {{ solver_options.time_steps[0] }} +{%- elif simulink_opts.samplingtime == "-1" -%} +#define SAMPLINGTIME -1 +{%- else -%} + {{ throw(message = "simulink_opts.samplingtime must be '-1' or 't0', got val") }} +{%- endif %} + +static void mdlInitializeSizes (SimStruct *S) +{ + // specify the number of continuous and discrete states + ssSetNumContStates(S, 0); + ssSetNumDiscStates(S, 0); + + {%- for key, val in simulink_opts.inputs -%} + {%- if val != 0 and val != 1 -%} + {{ throw(message = "simulink_opts.inputs must be 0 or 1, got val") }} + {%- endif -%} + {%- endfor -%} + + {#- compute number of input ports #} + {%- set n_inputs = 0 -%} + {%- if dims.nbx_0 > 0 and simulink_opts.inputs.lbx_0 -%} {#- lbx_0 #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.nbx_0 > 0 and simulink_opts.inputs.ubx_0 -%} {#- ubx_0 #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.np > 0 and simulink_opts.inputs.parameter_traj -%} {#- parameter_traj #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.ny_0 > 0 and simulink_opts.inputs.y_ref_0 -%} {#- y_ref_0 -#} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.ny > 0 and dims.N > 1 and simulink_opts.inputs.y_ref -%} {#- y_ref -#} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.ny_e > 0 and dims.N > 0 and simulink_opts.inputs.y_ref_e -%} {#- y_ref_e #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.nbx > 0 and dims.N > 1 and simulink_opts.inputs.lbx -%} {#- lbx #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.nbx > 0 and dims.N > 1 and simulink_opts.inputs.ubx -%} {#- ubx #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.nbx_e > 0 and dims.N > 0 and simulink_opts.inputs.lbx_e -%} {#- lbx_e #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.nbx_e > 0 and dims.N > 0 and simulink_opts.inputs.ubx_e -%} {#- ubx_e #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.nbu > 0 and dims.N > 0 and simulink_opts.inputs.lbu -%} {#- lbu #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.nbu > 0 and dims.N > 0 and simulink_opts.inputs.ubu -%} {#- ubu #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.ng > 0 and simulink_opts.inputs.lg -%} {#- lg #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.ng > 0 and simulink_opts.inputs.ug -%} {#- ug #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.nh > 0 and simulink_opts.inputs.lh -%} {#- lh #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + {%- if dims.nh > 0 and simulink_opts.inputs.uh -%} {#- uh #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + + {%- for key, val in simulink_opts.inputs -%} + {%- if val != 0 and val != 1 -%} + {{ throw(message = "simulink_opts.inputs must be 0 or 1, got val") }} + {%- endif -%} + {%- endfor -%} + {%- if dims.ny_0 > 0 and simulink_opts.inputs.cost_W_0 %} {#- cost_W_0 #} + {%- set n_inputs = n_inputs + 1 %} + {%- endif -%} + {%- if dims.ny > 0 and simulink_opts.inputs.cost_W -%} {#- cost_W #} + {%- set n_inputs = n_inputs + 1 %} + {%- endif -%} + {%- if dims.ny_e > 0 and simulink_opts.inputs.cost_W_e -%} {#- cost_W_e #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + + {%- if simulink_opts.inputs.x_init -%} {#- x_init #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + + {%- if simulink_opts.inputs.u_init -%} {#- u_init #} + {%- set n_inputs = n_inputs + 1 -%} + {%- endif -%} + + // specify the number of input ports + if ( !ssSetNumInputPorts(S, {{ n_inputs }}) ) + return; + + // specify the number of output ports + {%- set_global n_outputs = 0 %} + {%- for key, val in simulink_opts.outputs %} + {%- if val == 1 %} + {%- set_global n_outputs = n_outputs + val %} + {%- elif val != 0 %} + {{ throw(message = "simulink_opts.outputs must be 0 or 1, got val") }} + {%- endif %} + {%- endfor %} + if ( !ssSetNumOutputPorts(S, {{ n_outputs }}) ) + return; + + // specify dimension information for the input ports + {%- set i_input = -1 %}{# note here i_input is 0-based #} + {%- if dims.nbx_0 > 0 and simulink_opts.inputs.lbx_0 -%} {#- lbx_0 #} + {%- set i_input = i_input + 1 %} + // lbx_0 + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.nbx_0 }}); + {%- endif %} + {%- if dims.nbx_0 > 0 and simulink_opts.inputs.ubx_0 -%} {#- ubx_0 #} + {%- set i_input = i_input + 1 %} + // ubx_0 + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.nbx_0 }}); + {%- endif %} + + {%- if dims.np > 0 and simulink_opts.inputs.parameter_traj -%} {#- parameter_traj #} + {%- set i_input = i_input + 1 %} + // parameters + ssSetInputPortVectorDimension(S, {{ i_input }}, ({{ dims.N }}+1) * {{ dims.np }}); + {%- endif %} + + {%- if dims.ny > 0 and simulink_opts.inputs.y_ref_0 %} + {%- set i_input = i_input + 1 %} + // y_ref_0 + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.ny_0 }}); + {%- endif %} + + {%- if dims.ny > 0 and dims.N > 1 and simulink_opts.inputs.y_ref %} + {%- set i_input = i_input + 1 %} + // y_ref + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ (dims.N-1) * dims.ny }}); + {%- endif %} + + {%- if dims.ny_e > 0 and dims.N > 0 and simulink_opts.inputs.y_ref_e %} + {%- set i_input = i_input + 1 %} + // y_ref_e + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.ny_e }}); + {%- endif %} + + {%- if dims.nbx > 0 and dims.N > 1 and simulink_opts.inputs.lbx -%} {#- lbx #} + {%- set i_input = i_input + 1 %} + // lbx + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ (dims.N-1) * dims.nbx }}); + {%- endif %} + {%- if dims.nbx > 0 and dims.N > 1 and simulink_opts.inputs.ubx -%} {#- ubx #} + {%- set i_input = i_input + 1 %} + // ubx + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ (dims.N-1) * dims.nbx }}); + {%- endif %} + + {%- if dims.nbx_e > 0 and dims.N > 0 and simulink_opts.inputs.lbx_e -%} {#- lbx_e #} + {%- set i_input = i_input + 1 %} + // lbx_e + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.nbx_e }}); + {%- endif %} + {%- if dims.nbx_e > 0 and dims.N > 0 and simulink_opts.inputs.ubx_e -%} {#- ubx_e #} + {%- set i_input = i_input + 1 %} + // ubx_e + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.nbx_e }}); + {%- endif %} + + {%- if dims.nbu > 0 and dims.N > 0 and simulink_opts.inputs.lbu -%} {#- lbu #} + {%- set i_input = i_input + 1 %} + // lbu + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.N*dims.nbu }}); + {%- endif -%} + {%- if dims.nbu > 0 and dims.N > 0 and simulink_opts.inputs.ubu -%} {#- ubu #} + {%- set i_input = i_input + 1 %} + // ubu + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.N*dims.nbu }}); + {%- endif -%} + + + {%- if dims.ng > 0 and simulink_opts.inputs.lg -%} {#- lg #} + {%- set i_input = i_input + 1 %} + // lg + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.ng }}); + {%- endif -%} + {%- if dims.ng > 0 and simulink_opts.inputs.ug -%} {#- ug #} + {%- set i_input = i_input + 1 %} + // ug + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.ng }}); + {%- endif -%} + + {%- if dims.nh > 0 and simulink_opts.inputs.lh -%} {#- lh #} + {%- set i_input = i_input + 1 %} + // lh + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.nh }}); + {%- endif -%} + {%- if dims.nh > 0 and simulink_opts.inputs.uh -%} {#- uh #} + {%- set i_input = i_input + 1 %} + // uh + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.nh }}); + {%- endif -%} + + {%- if dims.ny_0 > 0 and simulink_opts.inputs.cost_W_0 %} {#- cost_W_0 #} + {%- set i_input = i_input + 1 %} + // cost_W_0 + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.ny_0 * dims.ny_0 }}); + {%- endif %} + + {%- if dims.ny_0 > 0 and simulink_opts.inputs.cost_W %} {#- cost_W #} + {%- set i_input = i_input + 1 %} + // cost_W + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.ny * dims.ny }}); + {%- endif %} + + {%- if dims.ny_e > 0 and simulink_opts.inputs.cost_W_e %} {#- cost_W_e #} + {%- set i_input = i_input + 1 %} + // cost_W_e + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.ny_e * dims.ny_e }}); + {%- endif %} + + {%- if simulink_opts.inputs.x_init -%} {#- x_init #} + {%- set i_input = i_input + 1 %} + // x_init + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.nx * (dims.N+1) }}); + {%- endif -%} + + {%- if simulink_opts.inputs.u_init -%} {#- u_init #} + {%- set i_input = i_input + 1 %} + // u_init + ssSetInputPortVectorDimension(S, {{ i_input }}, {{ dims.nu * (dims.N) }}); + {%- endif -%} + + /* specify dimension information for the OUTPUT ports */ + {%- set i_output = -1 %}{# note here i_output is 0-based #} + {%- if dims.nu > 0 and simulink_opts.outputs.u0 == 1 %} + {%- set i_output = i_output + 1 %} + ssSetOutputPortVectorDimension(S, {{ i_output }}, {{ dims.nu }} ); + {%- endif %} + + {%- if simulink_opts.outputs.utraj == 1 %} + {%- set i_output = i_output + 1 %} + ssSetOutputPortVectorDimension(S, {{ i_output }}, {{ dims.nu * dims.N }} ); + {%- endif %} + + {%- if simulink_opts.outputs.xtraj == 1 %} + {%- set i_output = i_output + 1 %} + ssSetOutputPortVectorDimension(S, {{ i_output }}, {{ dims.nx * (dims.N+1) }} ); + {%- endif %} + + {%- if simulink_opts.outputs.solver_status == 1 %} + {%- set i_output = i_output + 1 %} + ssSetOutputPortVectorDimension(S, {{ i_output }}, 1 ); + {%- endif %} + + {%- if simulink_opts.outputs.KKT_residual == 1 %} + {%- set i_output = i_output + 1 %} + ssSetOutputPortVectorDimension(S, {{ i_output }}, 1 ); + {%- endif %} + + {%- if dims.N > 0 and simulink_opts.outputs.x1 == 1 %} + {%- set i_output = i_output + 1 %} + ssSetOutputPortVectorDimension(S, {{ i_output }}, {{ dims.nx }} ); // state at shooting node 1 + {%- endif %} + + {%- if simulink_opts.outputs.CPU_time == 1 %} + {%- set i_output = i_output + 1 %} + ssSetOutputPortVectorDimension(S, {{ i_output }}, 1); + {%- endif %} + + {%- if simulink_opts.outputs.CPU_time_sim == 1 %} + {%- set i_output = i_output + 1 %} + ssSetOutputPortVectorDimension(S, {{ i_output }}, 1); + {%- endif %} + + {%- if simulink_opts.outputs.CPU_time_qp == 1 %} + {%- set i_output = i_output + 1 %} + ssSetOutputPortVectorDimension(S, {{ i_output }}, 1); + {%- endif %} + + {%- if simulink_opts.outputs.CPU_time_lin == 1 %} + {%- set i_output = i_output + 1 %} + ssSetOutputPortVectorDimension(S, {{ i_output }}, 1); + {%- endif %} + + {%- if simulink_opts.outputs.sqp_iter == 1 %} + {%- set i_output = i_output + 1 %} + ssSetOutputPortVectorDimension(S, {{ i_output }}, 1 ); + {%- endif %} + + // specify the direct feedthrough status + // should be set to 1 for all inputs used in mdlOutputs + {%- for i in range(end=n_inputs) %} + ssSetInputPortDirectFeedThrough(S, {{ i }}, 1); + {%- endfor %} + + // one sample time + ssSetNumSampleTimes(S, 1); +} + + +#if defined(MATLAB_MEX_FILE) + +#define MDL_SET_INPUT_PORT_DIMENSION_INFO +#define MDL_SET_OUTPUT_PORT_DIMENSION_INFO + +static void mdlSetInputPortDimensionInfo(SimStruct *S, int_T port, const DimsInfo_T *dimsInfo) +{ + if ( !ssSetInputPortDimensionInfo(S, port, dimsInfo) ) + return; +} + +static void mdlSetOutputPortDimensionInfo(SimStruct *S, int_T port, const DimsInfo_T *dimsInfo) +{ + if ( !ssSetOutputPortDimensionInfo(S, port, dimsInfo) ) + return; +} + +#endif /* MATLAB_MEX_FILE */ + + +static void mdlInitializeSampleTimes(SimStruct *S) +{ + ssSetSampleTime(S, 0, SAMPLINGTIME); + ssSetOffsetTime(S, 0, 0.0); +} + + +static void mdlStart(SimStruct *S) +{ + {{ model.name }}_solver_capsule *capsule = {{ model.name }}_acados_create_capsule(); + {{ model.name }}_acados_create(capsule); + + ssSetUserData(S, (void*)capsule); +} + + +static void mdlOutputs(SimStruct *S, int_T tid) +{ + {{ model.name }}_solver_capsule *capsule = ssGetUserData(S); + ocp_nlp_config *nlp_config = {{ model.name }}_acados_get_nlp_config(capsule); + ocp_nlp_dims *nlp_dims = {{ model.name }}_acados_get_nlp_dims(capsule); + ocp_nlp_in *nlp_in = {{ model.name }}_acados_get_nlp_in(capsule); + ocp_nlp_out *nlp_out = {{ model.name }}_acados_get_nlp_out(capsule); + + InputRealPtrsType in_sign; + + {%- set buffer_sizes = [dims.nbx_0, dims.np, dims.nbx, dims.nbu, dims.ng, dims.nh, dims.nx] -%} + + {%- if dims.ny_0 > 0 and simulink_opts.inputs.y_ref_0 %} {# y_ref_0 #} + {%- set buffer_sizes = buffer_sizes | concat(with=(dims.ny_0)) %} + {%- endif %} + {%- if dims.ny > 0 and dims.N > 1 and simulink_opts.inputs.y_ref %} {# y_ref #} + {%- set buffer_sizes = buffer_sizes | concat(with=(dims.ny)) %} + {%- endif %} + {%- if dims.ny_e > 0 and dims.N > 0 and simulink_opts.inputs.y_ref_e %} {# y_ref_e #} + {%- set buffer_sizes = buffer_sizes | concat(with=(dims.ny_e)) %} + {%- endif %} + + {%- if dims.ny_0 > 0 and simulink_opts.inputs.cost_W_0 %} {# cost_W_0 #} + {%- set buffer_sizes = buffer_sizes | concat(with=(dims.ny_0 * dims.ny_0)) %} + {%- endif %} + {%- if dims.ny > 0 and simulink_opts.inputs.cost_W %} {# cost_W #} + {%- set buffer_sizes = buffer_sizes | concat(with=(dims.ny * dims.ny)) %} + {%- endif %} + {%- if dims.ny_e > 0 and simulink_opts.inputs.cost_W_e %} {# cost_W_e #} + {%- set buffer_sizes = buffer_sizes | concat(with=(dims.ny_e * dims.ny_e)) %} + {%- endif %} + + // local buffer + {%- set buffer_size = buffer_sizes | sort | last %} + real_t buffer[{{ buffer_size }}]; + + /* go through inputs */ + {%- set i_input = -1 %} + {%- if dims.nbx_0 > 0 and simulink_opts.inputs.lbx_0 -%} {#- lbx_0 #} + // lbx_0 + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + for (int i = 0; i < {{ dims.nbx_0 }}; i++) + buffer[i] = (double)(*in_sign[i]); + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "lbx", buffer); + {%- endif %} + + {%- if dims.nbx_0 > 0 and simulink_opts.inputs.ubx_0 -%} {#- ubx_0 #} + // ubx_0 + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + for (int i = 0; i < {{ dims.nbx_0 }}; i++) + buffer[i] = (double)(*in_sign[i]); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "ubx", buffer); + {%- endif %} + + {%- if dims.np > 0 and simulink_opts.inputs.parameter_traj -%} {#- parameter_traj #} + // parameters - stage-variant !!! + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + + // update value of parameters + for (int ii = 0; ii <= {{ dims.N }}; ii++) + { + for (int jj = 0; jj < {{ dims.np }}; jj++) + buffer[jj] = (double)(*in_sign[ii*{{dims.np}}+jj]); + {{ model.name }}_acados_update_params(capsule, ii, buffer, {{ dims.np }}); + } + {%- endif %} + + {% if dims.ny_0 > 0 and simulink_opts.inputs.y_ref_0 %} + // y_ref_0 + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + + for (int i = 0; i < {{ dims.ny_0 }}; i++) + buffer[i] = (double)(*in_sign[i]); + + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "yref", (void *) buffer); + {%- endif %} + + {% if dims.ny > 0 and dims.N > 1 and simulink_opts.inputs.y_ref %} + // y_ref - for stages 1 to N-1 + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + + for (int ii = 1; ii < {{ dims.N }}; ii++) + { + for (int jj = 0; jj < {{ dims.ny }}; jj++) + buffer[jj] = (double)(*in_sign[(ii-1)*{{ dims.ny }}+jj]); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, ii, "yref", (void *) buffer); + } + {%- endif %} + + {% if dims.ny_e > 0 and dims.N > 0 and simulink_opts.inputs.y_ref_e %} + // y_ref_e + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + + for (int i = 0; i < {{ dims.ny_e }}; i++) + buffer[i] = (double)(*in_sign[i]); + + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, {{ dims.N }}, "yref", (void *) buffer); + {%- endif %} + + {%- if dims.nbx > 0 and dims.N > 1 and simulink_opts.inputs.lbx -%} {#- lbx #} + // lbx + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + for (int ii = 1; ii < {{ dims.N }}; ii++) + { + for (int jj = 0; jj < {{ dims.nbx }}; jj++) + buffer[jj] = (double)(*in_sign[(ii-1)*{{ dims.nbx }}+jj]); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, ii, "lbx", (void *) buffer); + } + {%- endif %} + {%- if dims.nbx > 0 and dims.N > 1 and simulink_opts.inputs.ubx -%} {#- ubx #} + // ubx + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + for (int ii = 1; ii < {{ dims.N }}; ii++) + { + for (int jj = 0; jj < {{ dims.nbx }}; jj++) + buffer[jj] = (double)(*in_sign[(ii-1)*{{ dims.nbx }}+jj]); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, ii, "ubx", (void *) buffer); + } + {%- endif %} + + + {%- if dims.nbx_e > 0 and dims.N > 0 and simulink_opts.inputs.lbx_e -%} {#- lbx_e #} + // lbx_e + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + + for (int i = 0; i < {{ dims.nbx_e }}; i++) + buffer[i] = (double)(*in_sign[i]); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, {{ dims.N }}, "lbx", buffer); + {%- endif %} + {%- if dims.nbx_e > 0 and dims.N > 0 and simulink_opts.inputs.ubx_e -%} {#- ubx_e #} + // ubx_e + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + + for (int i = 0; i < {{ dims.nbx_e }}; i++) + buffer[i] = (double)(*in_sign[i]); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, {{ dims.N }}, "ubx", buffer); + {%- endif %} + + + {%- if dims.nbu > 0 and dims.N > 0 and simulink_opts.inputs.lbu -%} {#- lbu #} + // lbu + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + for (int ii = 0; ii < {{ dims.N }}; ii++) + { + for (int jj = 0; jj < {{ dims.nbu }}; jj++) + buffer[jj] = (double)(*in_sign[ii*{{ dims.nbu }}+jj]); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, ii, "lbu", (void *) buffer); + } + {%- endif -%} + {%- if dims.nbu > 0 and dims.N > 0 and simulink_opts.inputs.ubu -%} {#- ubu #} + // ubu + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + for (int ii = 0; ii < {{ dims.N }}; ii++) + { + for (int jj = 0; jj < {{ dims.nbu }}; jj++) + buffer[jj] = (double)(*in_sign[ii*{{ dims.nbu }}+jj]); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, ii, "ubu", (void *) buffer); + } + {%- endif -%} + + {%- if dims.ng > 0 and simulink_opts.inputs.lg -%} {#- lg #} + // lg + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + + for (int i = 0; i < {{ dims.ng }}; i++) + buffer[i] = (double)(*in_sign[i]); + + for (int ii = 0; ii < {{ dims.N }}; ii++) + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, ii, "lg", buffer); + {%- endif -%} + {%- if dims.ng > 0 and simulink_opts.inputs.ug -%} {#- ug #} + // ug + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + + for (int i = 0; i < {{ dims.ng }}; i++) + buffer[i] = (double)(*in_sign[i]); + + for (int ii = 0; ii < {{ dims.N }}; ii++) + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, ii, "ug", buffer); + {%- endif -%} + {%- if dims.nh > 0 and simulink_opts.inputs.lh -%} {#- lh #} + // lh + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + + for (int i = 0; i < {{ dims.nh }}; i++) + buffer[i] = (double)(*in_sign[i]); + + for (int ii = 0; ii < {{ dims.N }}; ii++) + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, ii, "lh", buffer); + {%- endif -%} + {%- if dims.nh > 0 and simulink_opts.inputs.uh -%} {#- uh #} + // uh + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + + for (int i = 0; i < {{ dims.nh }}; i++) + buffer[i] = (double)(*in_sign[i]); + + for (int ii = 0; ii < {{ dims.N }}; ii++) + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, ii, "uh", buffer); + {%- endif -%} + + {%- if dims.ny_0 > 0 and simulink_opts.inputs.cost_W_0 %} {# cost_W_0 #} + // cost_W_0 + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + for (int i = 0; i < {{ dims.ny_0 * dims.ny_0 }}; i++) + buffer[i] = (double)(*in_sign[i]); + + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "W", buffer); + {%- endif %} + + {%- if dims.ny > 0 and simulink_opts.inputs.cost_W %} {# cost_W #} + // cost_W + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + for (int i = 0; i < {{ dims.ny * dims.ny }}; i++) + buffer[i] = (double)(*in_sign[i]); + + for (int ii = 1; ii < {{ dims.N }}; ii++) + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, ii, "W", buffer); + {%- endif %} + + {%- if dims.ny_e > 0 and simulink_opts.inputs.cost_W_e %} {#- cost_W_e #} + // cost_W_e + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + for (int i = 0; i < {{ dims.ny_e * dims.ny_e }}; i++) + buffer[i] = (double)(*in_sign[i]); + + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, {{ dims.N }}, "W", buffer); + {%- endif %} + + {%- if simulink_opts.inputs.x_init %} {#- x_init #} + // x_init + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + for (int ii = 0; ii < {{ dims.N + 1 }}; ii++) + { + for (int jj = 0; jj < {{ dims.nx }}; jj++) + buffer[jj] = (double)(*in_sign[(ii)*{{ dims.nx }}+jj]); + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, ii, "x", (void *) buffer); + } + {%- endif %} + + {%- if simulink_opts.inputs.u_init %} {#- u_init #} + // u_init + {%- set i_input = i_input + 1 %} + in_sign = ssGetInputPortRealSignalPtrs(S, {{ i_input }}); + for (int ii = 0; ii < {{ dims.N }}; ii++) + { + for (int jj = 0; jj < {{ dims.nu }}; jj++) + buffer[jj] = (double)(*in_sign[(ii)*{{ dims.nu }}+jj]); + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, ii, "u", (void *) buffer); + } + {%- endif %} + + /* call solver */ + int rti_phase = 0; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "rti_phase", &rti_phase); + int acados_status = {{ model.name }}_acados_solve(capsule); + + + /* set outputs */ + // assign pointers to output signals + real_t *out_u0, *out_utraj, *out_xtraj, *out_status, *out_sqp_iter, *out_KKT_res, *out_x1, *out_cpu_time, *out_cpu_time_sim, *out_cpu_time_qp, *out_cpu_time_lin; + int tmp_int; + + {%- set i_output = -1 -%}{# note here i_output is 0-based #} + {%- if dims.nu > 0 and simulink_opts.outputs.u0 == 1 %} + {%- set i_output = i_output + 1 %} + out_u0 = ssGetOutputPortRealSignal(S, {{ i_output }}); + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, 0, "u", (void *) out_u0); + {%- endif %} + + {%- if simulink_opts.outputs.utraj == 1 %} + {%- set i_output = i_output + 1 %} + out_utraj = ssGetOutputPortRealSignal(S, {{ i_output }}); + for (int ii = 0; ii < {{ dims.N }}; ii++) + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, ii, + "u", (void *) (out_utraj + ii * {{ dims.nu }})); + {%- endif %} + + {% if simulink_opts.outputs.xtraj == 1 %} + {%- set i_output = i_output + 1 %} + + out_xtraj = ssGetOutputPortRealSignal(S, {{ i_output }}); + for (int ii = 0; ii < {{ dims.N + 1 }}; ii++) + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, ii, + "x", (void *) (out_xtraj + ii * {{ dims.nx }})); + {%- endif %} + + {%- if simulink_opts.outputs.solver_status == 1 %} + {%- set i_output = i_output + 1 %} + out_status = ssGetOutputPortRealSignal(S, {{ i_output }}); + *out_status = (real_t) acados_status; + {%- endif %} + + {%- if simulink_opts.outputs.KKT_residual == 1 %} + {%- set i_output = i_output + 1 %} + out_KKT_res = ssGetOutputPortRealSignal(S, {{ i_output }}); + *out_KKT_res = (real_t) nlp_out->inf_norm_res; + {%- endif %} + + {%- if dims.N > 0 and simulink_opts.outputs.x1 == 1 %} + {%- set i_output = i_output + 1 %} + out_x1 = ssGetOutputPortRealSignal(S, {{ i_output }}); + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, 1, "x", (void *) out_x1); + {%- endif %} + + {%- if simulink_opts.outputs.CPU_time == 1 %} + {%- set i_output = i_output + 1 %} + out_cpu_time = ssGetOutputPortRealSignal(S, {{ i_output }}); + // get solution time + ocp_nlp_get(nlp_config, capsule->nlp_solver, "time_tot", (void *) out_cpu_time); + {%- endif -%} + + {%- if simulink_opts.outputs.CPU_time_sim == 1 %} + {%- set i_output = i_output + 1 %} + out_cpu_time_sim = ssGetOutputPortRealSignal(S, {{ i_output }}); + ocp_nlp_get(nlp_config, capsule->nlp_solver, "time_sim", (void *) out_cpu_time_sim); + {%- endif -%} + + {%- if simulink_opts.outputs.CPU_time_qp == 1 %} + {%- set i_output = i_output + 1 %} + out_cpu_time_qp = ssGetOutputPortRealSignal(S, {{ i_output }}); + ocp_nlp_get(nlp_config, capsule->nlp_solver, "time_qp", (void *) out_cpu_time_qp); + {%- endif -%} + + {%- if simulink_opts.outputs.CPU_time_lin == 1 %} + {%- set i_output = i_output + 1 %} + out_cpu_time_lin = ssGetOutputPortRealSignal(S, {{ i_output }}); + ocp_nlp_get(nlp_config, capsule->nlp_solver, "time_lin", (void *) out_cpu_time_lin); + {%- endif -%} + + {%- if simulink_opts.outputs.sqp_iter == 1 %} + {%- set i_output = i_output + 1 %} + out_sqp_iter = ssGetOutputPortRealSignal(S, {{ i_output }}); + // get sqp iter + ocp_nlp_get(nlp_config, capsule->nlp_solver, "sqp_iter", (void *) &tmp_int); + *out_sqp_iter = (real_t) tmp_int; + {%- endif %} + +} + +static void mdlTerminate(SimStruct *S) +{ + {{ model.name }}_solver_capsule *capsule = ssGetUserData(S); + + {{ model.name }}_acados_free(capsule); + {{ model.name }}_acados_free_capsule(capsule); +} + + +#ifdef MATLAB_MEX_FILE +#include "simulink.c" +#else +#include "cg_sfun.h" +#endif diff --git a/pyextra/acados_template/c_templates_tera/cost_y_0_fun.in.h b/pyextra/acados_template/c_templates_tera/cost_y_0_fun.in.h new file mode 100644 index 000000000..347446e3f --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/cost_y_0_fun.in.h @@ -0,0 +1,69 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef {{ model.name }}_Y_0_COST +#define {{ model.name }}_Y_0_COST + +#ifdef __cplusplus +extern "C" { +#endif + +{% if cost.cost_type_0 == "NONLINEAR_LS" %} +int {{ model.name }}_cost_y_0_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_y_0_fun_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_y_0_fun_sparsity_in(int); +const int *{{ model.name }}_cost_y_0_fun_sparsity_out(int); +int {{ model.name }}_cost_y_0_fun_n_in(void); +int {{ model.name }}_cost_y_0_fun_n_out(void); + +int {{ model.name }}_cost_y_0_fun_jac_ut_xt(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_y_0_fun_jac_ut_xt_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_y_0_fun_jac_ut_xt_sparsity_in(int); +const int *{{ model.name }}_cost_y_0_fun_jac_ut_xt_sparsity_out(int); +int {{ model.name }}_cost_y_0_fun_jac_ut_xt_n_in(void); +int {{ model.name }}_cost_y_0_fun_jac_ut_xt_n_out(void); + +int {{ model.name }}_cost_y_0_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_y_0_hess_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_y_0_hess_sparsity_in(int); +const int *{{ model.name }}_cost_y_0_hess_sparsity_out(int); +int {{ model.name }}_cost_y_0_hess_n_in(void); +int {{ model.name }}_cost_y_0_hess_n_out(void); +{% endif %} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // {{ model.name }}_Y_0_COST diff --git a/pyextra/acados_template/c_templates_tera/cost_y_e_fun.in.h b/pyextra/acados_template/c_templates_tera/cost_y_e_fun.in.h new file mode 100644 index 000000000..acc99009f --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/cost_y_e_fun.in.h @@ -0,0 +1,69 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef {{ model.name }}_Y_E_COST +#define {{ model.name }}_Y_E_COST + +#ifdef __cplusplus +extern "C" { +#endif + +{% if cost.cost_type_e == "NONLINEAR_LS" %} +int {{ model.name }}_cost_y_e_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_y_e_fun_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_y_e_fun_sparsity_in(int); +const int *{{ model.name }}_cost_y_e_fun_sparsity_out(int); +int {{ model.name }}_cost_y_e_fun_n_in(void); +int {{ model.name }}_cost_y_e_fun_n_out(void); + +int {{ model.name }}_cost_y_e_fun_jac_ut_xt(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_y_e_fun_jac_ut_xt_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_y_e_fun_jac_ut_xt_sparsity_in(int); +const int *{{ model.name }}_cost_y_e_fun_jac_ut_xt_sparsity_out(int); +int {{ model.name }}_cost_y_e_fun_jac_ut_xt_n_in(void); +int {{ model.name }}_cost_y_e_fun_jac_ut_xt_n_out(void); + +int {{ model.name }}_cost_y_e_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_y_e_hess_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_y_e_hess_sparsity_in(int); +const int *{{ model.name }}_cost_y_e_hess_sparsity_out(int); +int {{ model.name }}_cost_y_e_hess_n_in(void); +int {{ model.name }}_cost_y_e_hess_n_out(void); +{% endif %} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // {{ model.name }}_Y_E_COST diff --git a/pyextra/acados_template/c_templates_tera/cost_y_fun.in.h b/pyextra/acados_template/c_templates_tera/cost_y_fun.in.h new file mode 100644 index 000000000..1e03780cc --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/cost_y_fun.in.h @@ -0,0 +1,69 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef {{ model.name }}_Y_COST +#define {{ model.name }}_Y_COST + +#ifdef __cplusplus +extern "C" { +#endif + +{% if cost.cost_type == "NONLINEAR_LS" %} +int {{ model.name }}_cost_y_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_y_fun_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_y_fun_sparsity_in(int); +const int *{{ model.name }}_cost_y_fun_sparsity_out(int); +int {{ model.name }}_cost_y_fun_n_in(void); +int {{ model.name }}_cost_y_fun_n_out(void); + +int {{ model.name }}_cost_y_fun_jac_ut_xt(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_y_fun_jac_ut_xt_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_y_fun_jac_ut_xt_sparsity_in(int); +const int *{{ model.name }}_cost_y_fun_jac_ut_xt_sparsity_out(int); +int {{ model.name }}_cost_y_fun_jac_ut_xt_n_in(void); +int {{ model.name }}_cost_y_fun_jac_ut_xt_n_out(void); + +int {{ model.name }}_cost_y_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_y_hess_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_y_hess_sparsity_in(int); +const int *{{ model.name }}_cost_y_hess_sparsity_out(int); +int {{ model.name }}_cost_y_hess_n_in(void); +int {{ model.name }}_cost_y_hess_n_out(void); +{% endif %} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // {{ model.name }}_Y_COST diff --git a/pyextra/acados_template/c_templates_tera/external_cost.in.h b/pyextra/acados_template/c_templates_tera/external_cost.in.h new file mode 100644 index 000000000..d200dba45 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/external_cost.in.h @@ -0,0 +1,74 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef {{ model.name }}_EXT_COST +#define {{ model.name }}_EXT_COST + +#ifdef __cplusplus +extern "C" { +#endif + +{% if cost.cost_ext_fun_type == "casadi" %} +{% if cost.cost_type == "EXTERNAL" %} +int {{ model.name }}_cost_ext_cost_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_ext_cost_fun_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_ext_cost_fun_sparsity_in(int); +const int *{{ model.name }}_cost_ext_cost_fun_sparsity_out(int); +int {{ model.name }}_cost_ext_cost_fun_n_in(void); +int {{ model.name }}_cost_ext_cost_fun_n_out(void); + +int {{ model.name }}_cost_ext_cost_fun_jac_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_ext_cost_fun_jac_hess_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_ext_cost_fun_jac_hess_sparsity_in(int); +const int *{{ model.name }}_cost_ext_cost_fun_jac_hess_sparsity_out(int); +int {{ model.name }}_cost_ext_cost_fun_jac_hess_n_in(void); +int {{ model.name }}_cost_ext_cost_fun_jac_hess_n_out(void); + +int {{ model.name }}_cost_ext_cost_fun_jac(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_ext_cost_fun_jac_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_ext_cost_fun_jac_sparsity_in(int); +const int *{{ model.name }}_cost_ext_cost_fun_jac_sparsity_out(int); +int {{ model.name }}_cost_ext_cost_fun_jac_n_in(void); +int {{ model.name }}_cost_ext_cost_fun_jac_n_out(void); +{% endif %} + +{% else %} +int {{ cost.cost_function_ext_cost }}(void **, void **, void *); +{% endif %} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // {{ model.name }}_EXT_COST diff --git a/pyextra/acados_template/c_templates_tera/external_cost_0.in.h b/pyextra/acados_template/c_templates_tera/external_cost_0.in.h new file mode 100644 index 000000000..8152447e5 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/external_cost_0.in.h @@ -0,0 +1,75 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef {{ model.name }}_EXT_COST_0 +#define {{ model.name }}_EXT_COST_0 + +#ifdef __cplusplus +extern "C" { +#endif + +{% if cost.cost_ext_fun_type_0 == "casadi" %} + +{% if cost.cost_type_0 == "EXTERNAL" %} +int {{ model.name }}_cost_ext_cost_0_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_ext_cost_0_fun_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_ext_cost_0_fun_sparsity_in(int); +const int *{{ model.name }}_cost_ext_cost_0_fun_sparsity_out(int); +int {{ model.name }}_cost_ext_cost_0_fun_n_in(void); +int {{ model.name }}_cost_ext_cost_0_fun_n_out(void); + +int {{ model.name }}_cost_ext_cost_0_fun_jac_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_ext_cost_0_fun_jac_hess_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_ext_cost_0_fun_jac_hess_sparsity_in(int); +const int *{{ model.name }}_cost_ext_cost_0_fun_jac_hess_sparsity_out(int); +int {{ model.name }}_cost_ext_cost_0_fun_jac_hess_n_in(void); +int {{ model.name }}_cost_ext_cost_0_fun_jac_hess_n_out(void); + +int {{ model.name }}_cost_ext_cost_0_fun_jac(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_ext_cost_0_fun_jac_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_ext_cost_0_fun_jac_sparsity_in(int); +const int *{{ model.name }}_cost_ext_cost_0_fun_jac_sparsity_out(int); +int {{ model.name }}_cost_ext_cost_0_fun_jac_n_in(void); +int {{ model.name }}_cost_ext_cost_0_fun_jac_n_out(void); +{% endif %} + +{% else %} +int {{ cost.cost_function_ext_cost_0 }}(void **, void **, void *); +{% endif %} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // {{ model.name }}_EXT_COST_0 diff --git a/pyextra/acados_template/c_templates_tera/external_cost_e.in.h b/pyextra/acados_template/c_templates_tera/external_cost_e.in.h new file mode 100644 index 000000000..56485db4c --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/external_cost_e.in.h @@ -0,0 +1,74 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef {{ model.name }}_EXT_COST_E +#define {{ model.name }}_EXT_COST_E + +#ifdef __cplusplus +extern "C" { +#endif + +{% if cost.cost_ext_fun_type_e == "casadi" %} +{% if cost.cost_type_e == "EXTERNAL" %} +int {{ model.name }}_cost_ext_cost_e_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_ext_cost_e_fun_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_ext_cost_e_fun_sparsity_in(int); +const int *{{ model.name }}_cost_ext_cost_e_fun_sparsity_out(int); +int {{ model.name }}_cost_ext_cost_e_fun_n_in(void); +int {{ model.name }}_cost_ext_cost_e_fun_n_out(void); + +int {{ model.name }}_cost_ext_cost_e_fun_jac_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_ext_cost_e_fun_jac_hess_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_ext_cost_e_fun_jac_hess_sparsity_in(int); +const int *{{ model.name }}_cost_ext_cost_e_fun_jac_hess_sparsity_out(int); +int {{ model.name }}_cost_ext_cost_e_fun_jac_hess_n_in(void); +int {{ model.name }}_cost_ext_cost_e_fun_jac_hess_n_out(void); + +int {{ model.name }}_cost_ext_cost_e_fun_jac(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_cost_ext_cost_e_fun_jac_work(int *, int *, int *, int *); +const int *{{ model.name }}_cost_ext_cost_e_fun_jac_sparsity_in(int); +const int *{{ model.name }}_cost_ext_cost_e_fun_jac_sparsity_out(int); +int {{ model.name }}_cost_ext_cost_e_fun_jac_n_in(void); +int {{ model.name }}_cost_ext_cost_e_fun_jac_n_out(void); +{% endif %} + +{% else %} +int {{ cost.cost_function_ext_cost_e }}(void **, void **, void *); +{% endif %} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // {{ model.name }}_EXT_COST_E diff --git a/pyextra/acados_template/c_templates_tera/h_constraint.in.h b/pyextra/acados_template/c_templates_tera/h_constraint.in.h new file mode 100644 index 000000000..e49176c6e --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/h_constraint.in.h @@ -0,0 +1,70 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +#ifndef {{ model.name }}_H_CONSTRAINT +#define {{ model.name }}_H_CONSTRAINT + +#ifdef __cplusplus +extern "C" { +#endif + +{% if dims.nh > 0 %} +int {{ model.name }}_constr_h_fun_jac_uxt_zt(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_constr_h_fun_jac_uxt_zt_work(int *, int *, int *, int *); +const int *{{ model.name }}_constr_h_fun_jac_uxt_zt_sparsity_in(int); +const int *{{ model.name }}_constr_h_fun_jac_uxt_zt_sparsity_out(int); +int {{ model.name }}_constr_h_fun_jac_uxt_zt_n_in(void); +int {{ model.name }}_constr_h_fun_jac_uxt_zt_n_out(void); + +int {{ model.name }}_constr_h_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_constr_h_fun_work(int *, int *, int *, int *); +const int *{{ model.name }}_constr_h_fun_sparsity_in(int); +const int *{{ model.name }}_constr_h_fun_sparsity_out(int); +int {{ model.name }}_constr_h_fun_n_in(void); +int {{ model.name }}_constr_h_fun_n_out(void); + +{% if solver_options.hessian_approx == "EXACT" -%} +int {{ model.name }}_constr_h_fun_jac_uxt_zt_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_constr_h_fun_jac_uxt_zt_hess_work(int *, int *, int *, int *); +const int *{{ model.name }}_constr_h_fun_jac_uxt_zt_hess_sparsity_in(int); +const int *{{ model.name }}_constr_h_fun_jac_uxt_zt_hess_sparsity_out(int); +int {{ model.name }}_constr_h_fun_jac_uxt_zt_hess_n_in(void); +int {{ model.name }}_constr_h_fun_jac_uxt_zt_hess_n_out(void); +{% endif %} +{% endif %} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // {{ model.name }}_H_CONSTRAINT diff --git a/pyextra/acados_template/c_templates_tera/h_e_constraint.in.h b/pyextra/acados_template/c_templates_tera/h_e_constraint.in.h new file mode 100644 index 000000000..a5dd71164 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/h_e_constraint.in.h @@ -0,0 +1,71 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef {{ model.name }}_H_E_CONSTRAINT +#define {{ model.name }}_H_E_CONSTRAINT + +#ifdef __cplusplus +extern "C" { +#endif + +{% if dims.nh_e > 0 %} +int {{ model.name }}_constr_h_e_fun_jac_uxt_zt(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_constr_h_e_fun_jac_uxt_zt_work(int *, int *, int *, int *); +const int *{{ model.name }}_constr_h_e_fun_jac_uxt_zt_sparsity_in(int); +const int *{{ model.name }}_constr_h_e_fun_jac_uxt_zt_sparsity_out(int); +int {{ model.name }}_constr_h_e_fun_jac_uxt_zt_n_in(void); +int {{ model.name }}_constr_h_e_fun_jac_uxt_zt_n_out(void); + +int {{ model.name }}_constr_h_e_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_constr_h_e_fun_work(int *, int *, int *, int *); +const int *{{ model.name }}_constr_h_e_fun_sparsity_in(int); +const int *{{ model.name }}_constr_h_e_fun_sparsity_out(int); +int {{ model.name }}_constr_h_e_fun_n_in(void); +int {{ model.name }}_constr_h_e_fun_n_out(void); + +{% if solver_options.hessian_approx == "EXACT" -%} +int {{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess_work(int *, int *, int *, int *); +const int *{{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess_sparsity_in(int); +const int *{{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess_sparsity_out(int); +int {{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess_n_in(void); +int {{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess_n_out(void); +{% endif %} +{% endif %} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // {{ model.name }}_H_E_CONSTRAINT diff --git a/pyextra/acados_template/c_templates_tera/main.in.c b/pyextra/acados_template/c_templates_tera/main.in.c new file mode 100644 index 000000000..3348eea5c --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/main.in.c @@ -0,0 +1,215 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +// standard +#include +#include +// acados +#include "acados/utils/print.h" +#include "acados/utils/math.h" +#include "acados_c/ocp_nlp_interface.h" +#include "acados_c/external_function_interface.h" +#include "acados_solver_{{ model.name }}.h" + +#define NX {{ model.name | upper }}_NX +#define NZ {{ model.name | upper }}_NZ +#define NU {{ model.name | upper }}_NU +#define NP {{ model.name | upper }}_NP +#define NBX {{ model.name | upper }}_NBX +#define NBX0 {{ model.name | upper }}_NBX0 +#define NBU {{ model.name | upper }}_NBU +#define NSBX {{ model.name | upper }}_NSBX +#define NSBU {{ model.name | upper }}_NSBU +#define NSH {{ model.name | upper }}_NSH +#define NSG {{ model.name | upper }}_NSG +#define NSPHI {{ model.name | upper }}_NSPHI +#define NSHN {{ model.name | upper }}_NSHN +#define NSGN {{ model.name | upper }}_NSGN +#define NSPHIN {{ model.name | upper }}_NSPHIN +#define NSBXN {{ model.name | upper }}_NSBXN +#define NS {{ model.name | upper }}_NS +#define NSN {{ model.name | upper }}_NSN +#define NG {{ model.name | upper }}_NG +#define NBXN {{ model.name | upper }}_NBXN +#define NGN {{ model.name | upper }}_NGN +#define NY0 {{ model.name | upper }}_NY0 +#define NY {{ model.name | upper }}_NY +#define NYN {{ model.name | upper }}_NYN +#define NH {{ model.name | upper }}_NH +#define NPHI {{ model.name | upper }}_NPHI +#define NHN {{ model.name | upper }}_NHN +#define NPHIN {{ model.name | upper }}_NPHIN +#define NR {{ model.name | upper }}_NR + + +int main() +{ + + {{ model.name }}_solver_capsule *acados_ocp_capsule = {{ model.name }}_acados_create_capsule(); + // there is an opportunity to change the number of shooting intervals in C without new code generation + int N = {{ model.name | upper }}_N; + // allocate the array and fill it accordingly + double* new_time_steps = NULL; + int status = {{ model.name }}_acados_create_with_discretization(acados_ocp_capsule, N, new_time_steps); + + if (status) + { + printf("{{ model.name }}_acados_create() returned status %d. Exiting.\n", status); + exit(1); + } + + ocp_nlp_config *nlp_config = {{ model.name }}_acados_get_nlp_config(acados_ocp_capsule); + ocp_nlp_dims *nlp_dims = {{ model.name }}_acados_get_nlp_dims(acados_ocp_capsule); + ocp_nlp_in *nlp_in = {{ model.name }}_acados_get_nlp_in(acados_ocp_capsule); + ocp_nlp_out *nlp_out = {{ model.name }}_acados_get_nlp_out(acados_ocp_capsule); + ocp_nlp_solver *nlp_solver = {{ model.name }}_acados_get_nlp_solver(acados_ocp_capsule); + void *nlp_opts = {{ model.name }}_acados_get_nlp_opts(acados_ocp_capsule); + + // initial condition + int idxbx0[NBX0]; + {%- for i in range(end=dims.nbx_0) %} + idxbx0[{{ i }}] = {{ constraints.idxbx_0[i] }}; + {%- endfor %} + + double lbx0[NBX0]; + double ubx0[NBX0]; + {%- for i in range(end=dims.nbx_0) %} + lbx0[{{ i }}] = {{ constraints.lbx_0[i] }}; + ubx0[{{ i }}] = {{ constraints.ubx_0[i] }}; + {%- endfor %} + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "idxbx", idxbx0); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "lbx", lbx0); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "ubx", ubx0); + + // initialization for state values + double x_init[NX]; + {%- for i in range(end=dims.nx) %} + x_init[{{ i }}] = 0.0; + {%- endfor %} + + // initial value for control input + double u0[NU]; + {%- for i in range(end=dims.nu) %} + u0[{{ i }}] = 0.0; + {%- endfor %} + + + {%- if dims.np > 0 %} + // set parameters + double p[NP]; + {%- for item in parameter_values %} + p[{{ loop.index0 }}] = {{ item }}; + {%- endfor %} + + for (int ii = 0; ii <= N; ii++) + { + {{ model.name }}_acados_update_params(acados_ocp_capsule, ii, p, NP); + } + {% endif %}{# if np > 0 #} + + // prepare evaluation + int NTIMINGS = 1; + double min_time = 1e12; + double kkt_norm_inf; + double elapsed_time; + int sqp_iter; + + double xtraj[NX * (N+1)]; + double utraj[NU * N]; + + + // solve ocp in loop + int rti_phase = 0; + + for (int ii = 0; ii < NTIMINGS; ii++) + { + // initialize solution + for (int i = 0; i <= nlp_dims->N; i++) + { + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, i, "x", x_init); + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, i, "u", u0); + } + ocp_nlp_solver_opts_set(nlp_config, nlp_opts, "rti_phase", &rti_phase); + status = {{ model.name }}_acados_solve(acados_ocp_capsule); + ocp_nlp_get(nlp_config, nlp_solver, "time_tot", &elapsed_time); + min_time = MIN(elapsed_time, min_time); + } + + /* print solution and statistics */ + for (int ii = 0; ii <= nlp_dims->N; ii++) + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, ii, "x", &xtraj[ii*NX]); + for (int ii = 0; ii < nlp_dims->N; ii++) + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, ii, "u", &utraj[ii*NU]); + + printf("\n--- xtraj ---\n"); + d_print_exp_tran_mat( NX, N+1, xtraj, NX); + printf("\n--- utraj ---\n"); + d_print_exp_tran_mat( NU, N, utraj, NU ); + // ocp_nlp_out_print(nlp_solver->dims, nlp_out); + + printf("\nsolved ocp %d times, solution printed above\n\n", NTIMINGS); + + if (status == ACADOS_SUCCESS) + { + printf("{{ model.name }}_acados_solve(): SUCCESS!\n"); + } + else + { + printf("{{ model.name }}_acados_solve() failed with status %d.\n", status); + } + + // get solution + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, 0, "kkt_norm_inf", &kkt_norm_inf); + ocp_nlp_get(nlp_config, nlp_solver, "sqp_iter", &sqp_iter); + + {{ model.name }}_acados_print_stats(acados_ocp_capsule); + + printf("\nSolver info:\n"); + printf(" SQP iterations %2d\n minimum time for %d solve %f [ms]\n KKT %e\n", + sqp_iter, NTIMINGS, min_time*1000, kkt_norm_inf); + + // free solver + status = {{ model.name }}_acados_free(acados_ocp_capsule); + if (status) { + printf("{{ model.name }}_acados_free() returned status %d. \n", status); + } + // free solver capsule + status = {{ model.name }}_acados_free_capsule(acados_ocp_capsule); + if (status) { + printf("{{ model.name }}_acados_free_capsule() returned status %d. \n", status); + } + + return status; +} diff --git a/pyextra/acados_template/c_templates_tera/main_mex.in.c b/pyextra/acados_template/c_templates_tera/main_mex.in.c new file mode 100644 index 000000000..8da5db29a --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/main_mex.in.c @@ -0,0 +1,184 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +// standard +#include +#include +// acados +#include "acados/utils/print.h" +#include "acados/utils/math.h" +#include "acados_c/ocp_nlp_interface.h" +#include "acados_solver_{{ model.name }}.h" +// mex +#include "mex.h" + +/* auxilary mex */ +// prints a matrix in column-major format (exponential notation) +void MEX_print_exp_mat(int m, int n, double *A, int lda) +{ + for (int i=0; iN; i++) + { + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, i, "x", x_init); + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, i, "u", u0); + } + status = {{ model.name }}_acados_solve(); + ocp_nlp_get(nlp_config, nlp_solver, "time_tot", &elapsed_time); + min_time = MIN(elapsed_time, min_time); + } + + /* print solution and statistics */ + for (int ii = 0; ii <= nlp_dims->N; ii++) + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, ii, "x", &xtraj[ii*{{ dims.nx }}]); + for (int ii = 0; ii < nlp_dims->N; ii++) + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, ii, "u", &utraj[ii*{{ dims.nu }}]); + + mexPrintf("\n--- xtraj ---\n"); + MEX_print_exp_tran_mat( {{ dims.nx }}, {{ dims.N }}+1, xtraj, {{ dims.nx }} ); + mexPrintf("\n--- utraj ---\n"); + MEX_print_exp_tran_mat( {{ dims.nu }}, {{ dims.N }}, utraj, {{ dims.nu }} ); + + mexPrintf("\nsolved ocp %d times, solution printed above\n\n", NTIMINGS); + + if (status == ACADOS_SUCCESS) + mexPrintf("{{ model.name }}_acados_solve(): SUCCESS!\n"); + else + mexPrintf("{{ model.name }}_acados_solve() failed with status %d.\n", status); + + // get solution + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, 0, "kkt_norm_inf", &kkt_norm_inf); + ocp_nlp_get(nlp_config, nlp_solver, "sqp_iter", &sqp_iter); + + mexPrintf("\nSolver info:\n"); + mexPrintf(" SQP iterations %2d\n minimum time for 1 solve %f [ms]\n KKT %e\n", + sqp_iter, min_time*1000, kkt_norm_inf); + + // free solver + status = {{ model.name }}_acados_free(); + if (status) + { + mexPrintf("{{ model.name }}_acados_free() returned status %d.\n", status); + } + + return; +} diff --git a/pyextra/acados_template/c_templates_tera/main_sim.in.c b/pyextra/acados_template/c_templates_tera/main_sim.in.c new file mode 100644 index 000000000..743e81d59 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/main_sim.in.c @@ -0,0 +1,135 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +// standard +#include +#include +// acados +#include "acados/utils/print.h" +#include "acados/utils/math.h" +#include "acados_c/sim_interface.h" +#include "acados_sim_solver_{{ model.name }}.h" + +#define NX {{ model.name | upper }}_NX +#define NZ {{ model.name | upper }}_NZ +#define NU {{ model.name | upper }}_NU +#define NP {{ model.name | upper }}_NP + + +int main() +{ + int status = 0; + sim_solver_capsule *capsule = {{ model.name }}_acados_sim_solver_create_capsule(); + status = {{ model.name }}_acados_sim_create(capsule); + + if (status) + { + printf("acados_create() returned status %d. Exiting.\n", status); + exit(1); + } + + sim_config *acados_sim_config = {{ model.name }}_acados_get_sim_config(capsule); + sim_in *acados_sim_in = {{ model.name }}_acados_get_sim_in(capsule); + sim_out *acados_sim_out = {{ model.name }}_acados_get_sim_out(capsule); + void *acados_sim_dims = {{ model.name }}_acados_get_sim_dims(capsule); + + // initial condition + double x_current[NX]; + {%- for i in range(end=dims.nx) %} + x_current[{{ i }}] = 0.0; + {%- endfor %} + + {% if constraints.lbx_0 %} + {%- for i in range(end=dims.nbx_0) %} + x_current[{{ constraints.idxbx_0[i] }}] = {{ constraints.lbx_0[i] }}; + {%- endfor %} + {% if dims.nbx_0 != dims.nx %} + printf("main_sim: NOTE: initial state not fully defined via lbx_0, using 0.0 for indices that are not in idxbx_0."); + {%- endif %} + {% else %} + printf("main_sim: initial state not defined, should be in lbx_0, using zero vector."); + {%- endif %} + + + // initial value for control input + double u0[NU]; + {%- for i in range(end=dims.nu) %} + u0[{{ i }}] = 0.0; + {%- endfor %} + + {%- if dims.np > 0 %} + // set parameters + double p[NP]; + {%- for item in parameter_values %} + p[{{ loop.index0 }}] = {{ item }}; + {%- endfor %} + + {{ model.name }}_acados_sim_update_params(capsule, p, NP); + {% endif %}{# if np > 0 #} + + int n_sim_steps = 3; + // solve ocp in loop + for (int ii = 0; ii < n_sim_steps; ii++) + { + sim_in_set(acados_sim_config, acados_sim_dims, + acados_sim_in, "x", x_current); + status = {{ model.name }}_acados_sim_solve(capsule); + + if (status != ACADOS_SUCCESS) + { + printf("acados_solve() failed with status %d.\n", status); + } + + sim_out_get(acados_sim_config, acados_sim_dims, + acados_sim_out, "x", x_current); + + printf("\nx_current, %d\n", ii); + for (int jj = 0; jj < NX; jj++) + { + printf("%e\n", x_current[jj]); + } + } + + printf("\nPerformed %d simulation steps with acados integrator successfully.\n\n", n_sim_steps); + + // free solver + status = {{ model.name }}_acados_sim_free(capsule); + if (status) { + printf("{{ model.name }}_acados_sim_free() returned status %d. \n", status); + } + + {{ model.name }}_acados_sim_solver_free_capsule(capsule); + + return status; +} diff --git a/pyextra/acados_template/c_templates_tera/make_main_mex.in.m b/pyextra/acados_template/c_templates_tera/make_main_mex.in.m new file mode 100644 index 000000000..9188686a0 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/make_main_mex.in.m @@ -0,0 +1,105 @@ +% +% Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +% Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +% Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +% Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +% +% This file is part of acados. +% +% The 2-Clause BSD License +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are met: +% +% 1. Redistributions of source code must retain the above copyright notice, +% this list of conditions and the following disclaimer. +% +% 2. Redistributions in binary form must reproduce the above copyright notice, +% this list of conditions and the following disclaimer in the documentation +% and/or other materials provided with the distribution. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +% POSSIBILITY OF SUCH DAMAGE.; +% + +function make_main_mex_{{ model.name }}() + + opts.output_dir = pwd; + + % get acados folder + acados_folder = getenv('ACADOS_INSTALL_DIR'); + + % set paths + acados_include = ['-I' fullfile(acados_folder, 'include')]; + template_lib_include = ['-l' 'acados_solver_{{ model.name }}']; + template_lib_path = ['-L' fullfile(pwd)]; + + acados_lib_path = ['-L' fullfile(acados_folder, 'lib')]; + external_include = ['-I', fullfile(acados_folder, 'external')]; + blasfeo_include = ['-I', fullfile(acados_folder, 'external', 'blasfeo', 'include')]; + hpipm_include = ['-I', fullfile(acados_folder, 'external', 'hpipm', 'include')]; + + mex_names = { ... + 'main_mex_{{ model.name }}' ... + }; + + mex_files = cell(length(mex_names), 1); + for k=1:length(mex_names) + mex_files{k} = fullfile([mex_names{k}, '.c']); + end + + %% octave C flags + if is_octave() + if ~exist(fullfile(opts.output_dir, 'cflags_octave.txt'), 'file') + diary(fullfile(opts.output_dir, 'cflags_octave.txt')); + diary on + mkoctfile -p CFLAGS + diary off + input_file = fopen(fullfile(opts.output_dir, 'cflags_octave.txt'), 'r'); + cflags_tmp = fscanf(input_file, '%[^\n]s'); + fclose(input_file); + if ~ismac() + cflags_tmp = [cflags_tmp, ' -std=c99 -fopenmp']; + else + cflags_tmp = [cflags_tmp, ' -std=c99']; + end + input_file = fopen(fullfile(opts.output_dir, 'cflags_octave.txt'), 'w'); + fprintf(input_file, '%s', cflags_tmp); + fclose(input_file); + end + % read cflags from file + input_file = fopen(fullfile(opts.output_dir, 'cflags_octave.txt'), 'r'); + cflags_tmp = fscanf(input_file, '%[^\n]s'); + fclose(input_file); + setenv('CFLAGS', cflags_tmp); + end + + %% compile mex + for ii=1:length(mex_files) + disp(['compiling ', mex_files{ii}]) + if is_octave() + % mkoctfile -p CFLAGS + mex(acados_include, template_lib_include, external_include, blasfeo_include, hpipm_include,... + acados_lib_path, template_lib_path, '-lacados', '-lhpipm', '-lblasfeo', mex_files{ii}) + else + if ismac() + FLAGS = 'CFLAGS=$CFLAGS -std=c99'; + else + FLAGS = 'CFLAGS=$CFLAGS -std=c99 -fopenmp'; + end + mex(FLAGS, acados_include, template_lib_include, external_include, blasfeo_include, hpipm_include,... + acados_lib_path, template_lib_path, '-lacados', '-lhpipm', '-lblasfeo', mex_files{ii}) + end + end + + +end \ No newline at end of file diff --git a/pyextra/acados_template/c_templates_tera/make_mex.in.m b/pyextra/acados_template/c_templates_tera/make_mex.in.m new file mode 100644 index 000000000..cde30f6f4 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/make_mex.in.m @@ -0,0 +1,110 @@ +% +% Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +% Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +% Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +% Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +% +% This file is part of acados. +% +% The 2-Clause BSD License +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are met: +% +% 1. Redistributions of source code must retain the above copyright notice, +% this list of conditions and the following disclaimer. +% +% 2. Redistributions in binary form must reproduce the above copyright notice, +% this list of conditions and the following disclaimer in the documentation +% and/or other materials provided with the distribution. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +% POSSIBILITY OF SUCH DAMAGE.; +% + +function make_mex_{{ model.name }}() + + opts.output_dir = pwd; + + % get acados folder + acados_folder = getenv('ACADOS_INSTALL_DIR'); + + % set paths + acados_include = ['-I' fullfile(acados_folder, 'include')]; + template_lib_include = ['-l' 'acados_ocp_solver_{{ model.name }}']; + template_lib_path = ['-L' fullfile(pwd)]; + + acados_lib_path = ['-L' fullfile(acados_folder, 'lib')]; + external_include = ['-I', fullfile(acados_folder, 'external')]; + blasfeo_include = ['-I', fullfile(acados_folder, 'external', 'blasfeo', 'include')]; + hpipm_include = ['-I', fullfile(acados_folder, 'external', 'hpipm', 'include')]; + + mex_include = ['-I', fullfile(acados_folder, 'interfaces', 'acados_matlab_octave')]; + + mex_names = { ... + 'acados_mex_create_{{ model.name }}' ... + 'acados_mex_free_{{ model.name }}' ... + 'acados_mex_solve_{{ model.name }}' ... + 'acados_mex_set_{{ model.name }}' ... + }; + + mex_files = cell(length(mex_names), 1); + for k=1:length(mex_names) + mex_files{k} = fullfile([mex_names{k}, '.c']); + end + + %% octave C flags + if is_octave() + if ~exist(fullfile(opts.output_dir, 'cflags_octave.txt'), 'file') + diary(fullfile(opts.output_dir, 'cflags_octave.txt')); + diary on + mkoctfile -p CFLAGS + diary off + input_file = fopen(fullfile(opts.output_dir, 'cflags_octave.txt'), 'r'); + cflags_tmp = fscanf(input_file, '%[^\n]s'); + fclose(input_file); + if ~ismac() + cflags_tmp = [cflags_tmp, ' -std=c99 -fopenmp']; + else + cflags_tmp = [cflags_tmp, ' -std=c99']; + end + input_file = fopen(fullfile(opts.output_dir, 'cflags_octave.txt'), 'w'); + fprintf(input_file, '%s', cflags_tmp); + fclose(input_file); + end + % read cflags from file + input_file = fopen(fullfile(opts.output_dir, 'cflags_octave.txt'), 'r'); + cflags_tmp = fscanf(input_file, '%[^\n]s'); + fclose(input_file); + setenv('CFLAGS', cflags_tmp); + end + + %% compile mex + for ii=1:length(mex_files) + disp(['compiling ', mex_files{ii}]) + if is_octave() + % mkoctfile -p CFLAGS + mex(acados_include, template_lib_include, external_include, blasfeo_include, hpipm_include,... + acados_lib_path, template_lib_path, mex_include, '-lacados', '-lhpipm', '-lblasfeo', mex_files{ii}) + else + if ismac() + FLAGS = 'CFLAGS=$CFLAGS -std=c99'; + else + FLAGS = 'CFLAGS=$CFLAGS -std=c99 -fopenmp'; + end + mex(FLAGS, acados_include, template_lib_include, external_include, blasfeo_include, hpipm_include,... + acados_lib_path, template_lib_path, mex_include, '-lacados', '-lhpipm', '-lblasfeo', mex_files{ii}) + end + end + + +end \ No newline at end of file diff --git a/pyextra/acados_template/c_templates_tera/make_sfun.in.m b/pyextra/acados_template/c_templates_tera/make_sfun.in.m new file mode 100644 index 000000000..172da654e --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/make_sfun.in.m @@ -0,0 +1,335 @@ +% +% Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +% Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +% Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +% Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +% +% This file is part of acados. +% +% The 2-Clause BSD License +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are met: +% +% 1. Redistributions of source code must retain the above copyright notice, +% this list of conditions and the following disclaimer. +% +% 2. Redistributions in binary form must reproduce the above copyright notice, +% this list of conditions and the following disclaimer in the documentation +% and/or other materials provided with the distribution. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +% POSSIBILITY OF SUCH DAMAGE.; +% + +SOURCES = { ... + {%- if solver_options.integrator_type == 'ERK' %} + '{{ model.name }}_model/{{ model.name }}_expl_ode_fun.c', ... + '{{ model.name }}_model/{{ model.name }}_expl_vde_forw.c',... + {%- if solver_options.hessian_approx == 'EXACT' %} + '{{ model.name }}_model/{{ model.name }}_expl_ode_hess.c',... + {%- endif %} + {%- elif solver_options.integrator_type == "IRK" %} + '{{ model.name }}_model/{{ model.name }}_impl_dae_fun.c', ... + '{{ model.name }}_model/{{ model.name }}_impl_dae_fun_jac_x_xdot_z.c', ... + '{{ model.name }}_model/{{ model.name }}_impl_dae_jac_x_xdot_u_z.c', ... + {%- if solver_options.hessian_approx == 'EXACT' %} + '{{ model.name }}_model/{{ model.name }}_impl_dae_hess.c',... + {%- endif %} + {%- elif solver_options.integrator_type == "GNSF" %} + '{{ model.name }}_model/{{ model.name }}_gnsf_phi_fun.c',... + '{{ model.name }}_model/{{ model.name }}_gnsf_phi_fun_jac_y.c',... + '{{ model.name }}_model/{{ model.name }}_gnsf_phi_jac_y_uhat.c',... + '{{ model.name }}_model/{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz.c',... + '{{ model.name }}_model/{{ model.name }}_gnsf_get_matrices_fun.c',... + {%- elif solver_options.integrator_type == "DISCRETE" %} + '{{ model.name }}_model/{{ model.name }}_dyn_disc_phi_fun.c',... + '{{ model.name }}_model/{{ model.name }}_dyn_disc_phi_fun_jac.c',... + {%- if solver_options.hessian_approx == "EXACT" %} + '{{ model.name }}_model/{{ model.name }}_dyn_disc_phi_fun_jac_hess.c',... + {%- endif %} + {%- endif %} + {%- if cost.cost_type_0 == "NONLINEAR_LS" %} + '{{ model.name }}_cost/{{ model.name }}_cost_y_0_fun.c',... + '{{ model.name }}_cost/{{ model.name }}_cost_y_0_fun_jac_ut_xt.c',... + '{{ model.name }}_cost/{{ model.name }}_cost_y_0_hess.c',... + {%- elif cost.cost_type_0 == "EXTERNAL" %} + '{{ model.name }}_cost/{{ model.name }}_cost_ext_cost_0_fun.c',... + '{{ model.name }}_cost/{{ model.name }}_cost_ext_cost_0_fun_jac.c',... + '{{ model.name }}_cost/{{ model.name }}_cost_ext_cost_0_fun_jac_hess.c',... + {%- endif %} + + {%- if cost.cost_type == "NONLINEAR_LS" %} + '{{ model.name }}_cost/{{ model.name }}_cost_y_fun.c',... + '{{ model.name }}_cost/{{ model.name }}_cost_y_fun_jac_ut_xt.c',... + '{{ model.name }}_cost/{{ model.name }}_cost_y_hess.c',... + {%- elif cost.cost_type == "EXTERNAL" %} + '{{ model.name }}_cost/{{ model.name }}_cost_ext_cost_fun.c',... + '{{ model.name }}_cost/{{ model.name }}_cost_ext_cost_fun_jac.c',... + '{{ model.name }}_cost/{{ model.name }}_cost_ext_cost_fun_jac_hess.c',... + {%- endif %} + {%- if cost.cost_type_e == "NONLINEAR_LS" %} + '{{ model.name }}_cost/{{ model.name }}_cost_y_e_fun.c',... + '{{ model.name }}_cost/{{ model.name }}_cost_y_e_fun_jac_ut_xt.c',... + '{{ model.name }}_cost/{{ model.name }}_cost_y_e_hess.c',... + {%- elif cost.cost_type_e == "EXTERNAL" %} + '{{ model.name }}_cost/{{ model.name }}_cost_ext_cost_e_fun.c',... + '{{ model.name }}_cost/{{ model.name }}_cost_ext_cost_e_fun_jac.c',... + '{{ model.name }}_cost/{{ model.name }}_cost_ext_cost_e_fun_jac_hess.c',... + {%- endif %} + {%- if constraints.constr_type == "BGH" and dims.nh > 0 %} + '{{ model.name }}_constraints/{{ model.name }}_constr_h_fun.c', ... + '{{ model.name }}_constraints/{{ model.name }}_constr_h_fun_jac_uxt_zt_hess.c', ... + '{{ model.name }}_constraints/{{ model.name }}_constr_h_fun_jac_uxt_zt.c', ... + {%- elif constraints.constr_type == "BGP" and dims.nphi > 0 %} + '{{ model.name }}_constraints/{{ model.name }}_phi_constraint.c', ... + {%- endif %} + {%- if constraints.constr_type_e == "BGH" and dims.nh_e > 0 %} + '{{ model.name }}_constraints/{{ model.name }}_constr_h_e_fun.c', ... + '{{ model.name }}_constraints/{{ model.name }}_constr_h_e_fun_jac_uxt_zt_hess.c', ... + '{{ model.name }}_constraints/{{ model.name }}_constr_h_e_fun_jac_uxt_zt.c', ... + {%- elif constraints.constr_type_e == "BGP" and dims.nphi_e > 0 %} + '{{ model.name }}_constraints/{{ model.name }}_phi_e_constraint.c', ... + {%- endif %} + 'acados_solver_sfunction_{{ model.name }}.c', ... + 'acados_solver_{{ model.name }}.c' + }; + +INC_PATH = '{{ acados_include_path }}'; + +INCS = {['-I', fullfile(INC_PATH, 'blasfeo', 'include')], ... + ['-I', fullfile(INC_PATH, 'hpipm', 'include')], ... + ['-I', fullfile(INC_PATH, 'acados')], ... + ['-I', fullfile(INC_PATH)]}; + +{% if solver_options.qp_solver is containing("QPOASES") %} +INCS{end+1} = ['-I', fullfile(INC_PATH, 'qpOASES_e')]; +{% endif %} + +CFLAGS = 'CFLAGS=$CFLAGS'; +LDFLAGS = 'LDFLAGS=$LDFLAGS'; +COMPFLAGS = 'COMPFLAGS=$COMPFLAGS'; +COMPDEFINES = 'COMPDEFINES=$COMPDEFINES'; + +{% if solver_options.qp_solver is containing("QPOASES") %} +CFLAGS = [ CFLAGS, ' -DACADOS_WITH_QPOASES ' ]; +COMPDEFINES = [ COMPDEFINES, ' -DACADOS_WITH_QPOASES ' ]; +{%- elif solver_options.qp_solver is containing("OSQP") %} +CFLAGS = [ CFLAGS, ' -DACADOS_WITH_OSQP ' ]; +COMPDEFINES = [ COMPDEFINES, ' -DACADOS_WITH_OSQP ' ]; +{%- elif solver_options.qp_solver is containing("QPDUNES") %} +CFLAGS = [ CFLAGS, ' -DACADOS_WITH_QPDUNES ' ]; +COMPDEFINES = [ COMPDEFINES, ' -DACADOS_WITH_QPDUNES ' ]; +{%- elif solver_options.qp_solver is containing("HPMPC") %} +CFLAGS = [ CFLAGS, ' -DACADOS_WITH_HPMPC ' ]; +COMPDEFINES = [ COMPDEFINES, ' -DACADOS_WITH_HPMPC ' ]; +{% endif %} + +LIB_PATH = ['-L', fullfile('{{ acados_lib_path }}')]; + +LIBS = {'-lacados', '-lhpipm', '-lblasfeo'}; + +% acados linking libraries and flags +{%- if acados_link_libs and os and os == "pc" %} +LDFLAGS = [LDFLAGS ' {{ acados_link_libs.openmp }}']; +COMPFLAGS = [COMPFLAGS ' {{ acados_link_libs.openmp }}']; +LIBS{end+1} = '{{ acados_link_libs.qpoases }}'; +LIBS{end+1} = '{{ acados_link_libs.hpmpc }}'; +LIBS{end+1} = '{{ acados_link_libs.osqp }}'; +{%- else %} + {% if solver_options.qp_solver is containing("QPOASES") %} +LIBS{end+1} = '-lqpOASES_e'; + {% endif %} +{%- endif %} + +mex('-v', '-O', CFLAGS, LDFLAGS, COMPFLAGS, COMPDEFINES, INCS{:}, ... + LIB_PATH, LIBS{:}, SOURCES{:}, ... + '-output', 'acados_solver_sfunction_{{ model.name }}' ); + +fprintf( [ '\n\nSuccessfully created sfunction:\nacados_solver_sfunction_{{ model.name }}', '.', ... + eval('mexext')] ); + + +%% print note on usage of s-function +fprintf('\n\nNote: Usage of Sfunction is as follows:\n') +input_note = 'Inputs are:\n'; +i_in = 1; + + +{%- if dims.nbx_0 > 0 and simulink_opts.inputs.lbx_0 -%} {#- lbx_0 #} +input_note = strcat(input_note, num2str(i_in), ') lbx_0 - lower bound on x for stage 0,',... + ' size [{{ dims.nbx_0 }}]\n '); +i_in = i_in + 1; +{%- endif %} + +{%- if dims.nbx_0 > 0 and simulink_opts.inputs.ubx_0 -%} {#- ubx_0 #} +input_note = strcat(input_note, num2str(i_in), ') ubx_0 - upper bound on x for stage 0,',... + ' size [{{ dims.nbx_0 }}]\n '); +i_in = i_in + 1; +{%- endif %} + +{%- if dims.np > 0 and simulink_opts.inputs.parameter_traj -%} {#- parameter_traj #} +input_note = strcat(input_note, num2str(i_in), ') parameters - concatenated for all shooting nodes 0 to N+1,',... + ' size [{{ (dims.N+1)*dims.np }}]\n '); +i_in = i_in + 1; +{%- endif %} + +{%- if dims.ny_0 > 0 and simulink_opts.inputs.y_ref_0 %} +input_note = strcat(input_note, num2str(i_in), ') y_ref_0, size [{{ dims.ny_0 }}]\n '); +i_in = i_in + 1; +{%- endif %} + +{%- if dims.ny > 0 and dims.N > 1 and simulink_opts.inputs.y_ref %} +input_note = strcat(input_note, num2str(i_in), ') y_ref - concatenated for shooting nodes 1 to N-1,',... + ' size [{{ (dims.N-1) * dims.ny }}]\n '); +i_in = i_in + 1; +{%- endif %} + +{%- if dims.ny_e > 0 and dims.N > 0 and simulink_opts.inputs.y_ref_e %} +input_note = strcat(input_note, num2str(i_in), ') y_ref_e, size [{{ dims.ny_e }}]\n '); +i_in = i_in + 1; +{%- endif %} + +{%- if dims.nbx > 0 and dims.N > 1 and simulink_opts.inputs.lbx -%} {#- lbx #} +input_note = strcat(input_note, num2str(i_in), ') lbx for shooting nodes 1 to N-1, size [{{ (dims.N-1) * dims.nbx }}]\n '); +i_in = i_in + 1; +{%- endif %} +{%- if dims.nbx > 0 and dims.N > 1 and simulink_opts.inputs.ubx -%} {#- ubx #} +input_note = strcat(input_note, num2str(i_in), ') ubx for shooting nodes 1 to N-1, size [{{ (dims.N-1) * dims.nbx }}]\n '); +i_in = i_in + 1; +{%- endif %} + + +{%- if dims.nbx_e > 0 and dims.N > 0 and simulink_opts.inputs.lbx_e -%} {#- lbx_e #} +input_note = strcat(input_note, num2str(i_in), ') lbx_e (lbx at shooting node N), size [{{ dims.nbx_e }}]\n '); +i_in = i_in + 1; +{%- endif %} +{%- if dims.nbx_e > 0 and dims.N > 0 and simulink_opts.inputs.ubx_e -%} {#- ubx_e #} +input_note = strcat(input_note, num2str(i_in), ') ubx_e (ubx at shooting node N), size [{{ dims.nbx_e }}]\n '); +i_in = i_in + 1; +{%- endif %} + +{%- if dims.nbu > 0 and dims.N > 0 and simulink_opts.inputs.lbu -%} {#- lbu #} +input_note = strcat(input_note, num2str(i_in), ') lbu for shooting nodes 0 to N-1, size [{{ dims.N*dims.nbu }}]\n '); +i_in = i_in + 1; +{%- endif -%} +{%- if dims.nbu > 0 and dims.N > 0 and simulink_opts.inputs.ubu -%} {#- ubu #} +input_note = strcat(input_note, num2str(i_in), ') ubu for shooting nodes 0 to N-1, size [{{ dims.N*dims.nbu }}]\n '); +i_in = i_in + 1; +{%- endif -%} + +{%- if dims.ng > 0 and simulink_opts.inputs.lg -%} {#- lg #} +input_note = strcat(input_note, num2str(i_in), ') lg, size [{{ dims.ng }}]\n '); +i_in = i_in + 1; +{%- endif %} +{%- if dims.ng > 0 and simulink_opts.inputs.ug -%} {#- ug #} +input_note = strcat(input_note, num2str(i_in), ') ug, size [{{ dims.ng }}]\n '); +i_in = i_in + 1; +{%- endif %} + +{%- if dims.nh > 0 and simulink_opts.inputs.lh -%} {#- lh #} +input_note = strcat(input_note, num2str(i_in), ') lh, size [{{ dims.nh }}]\n '); +i_in = i_in + 1; +{%- endif %} +{%- if dims.nh > 0 and simulink_opts.inputs.uh -%} {#- uh #} +input_note = strcat(input_note, num2str(i_in), ') uh, size [{{ dims.nh }}]\n '); +i_in = i_in + 1; +{%- endif %} + +{%- if dims.ny_0 > 0 and simulink_opts.inputs.cost_W_0 %} {#- cost_W_0 #} +input_note = strcat(input_note, num2str(i_in), ') cost_W_0 in column-major format, size [{{ dims.ny_0 * dims.ny_0 }}]\n '); +i_in = i_in + 1; +{%- endif %} + +{%- if dims.ny > 0 and simulink_opts.inputs.cost_W %} {#- cost_W #} +input_note = strcat(input_note, num2str(i_in), ') cost_W in column-major format, that is set for all intermediate shooting nodes: 1 to N-1, size [{{ dims.ny * dims.ny }}]\n '); +i_in = i_in + 1; +{%- endif %} + +{%- if dims.ny_e > 0 and simulink_opts.inputs.cost_W_e %} {#- cost_W_e #} +input_note = strcat(input_note, num2str(i_in), ') cost_W_e in column-major format, size [{{ dims.ny_e * dims.ny_e }}]\n '); +i_in = i_in + 1; +{%- endif %} + +{%- if simulink_opts.inputs.x_init %} {#- x_init #} +input_note = strcat(input_note, num2str(i_in), ') initialization of x for all shooting nodes, size [{{ dims.nx * (dims.N+1) }}]\n '); +i_in = i_in + 1; +{%- endif %} + +{%- if simulink_opts.inputs.u_init %} {#- u_init #} +input_note = strcat(input_note, num2str(i_in), ') initialization of u for shooting nodes 0 to N-1, size [{{ dims.nu * (dims.N) }}]\n '); +i_in = i_in + 1; +{%- endif %} + +fprintf(input_note) + +disp(' ') + +output_note = 'Outputs are:\n'; +i_out = 0; + +{%- if dims.nu > 0 and simulink_opts.outputs.u0 == 1 %} +i_out = i_out + 1; +output_note = strcat(output_note, num2str(i_out), ') u0, control input at node 0, size [{{ dims.nu }}]\n '); +{%- endif %} + +{%- if simulink_opts.outputs.utraj == 1 %} +i_out = i_out + 1; +output_note = strcat(output_note, num2str(i_out), ') utraj, control input concatenated for nodes 0 to N-1, size [{{ dims.nu * dims.N }}]\n '); +{%- endif %} + +{%- if simulink_opts.outputs.xtraj == 1 %} +i_out = i_out + 1; +output_note = strcat(output_note, num2str(i_out), ') xtraj, state concatenated for nodes 0 to N, size [{{ dims.nx * (dims.N + 1) }}]\n '); +{%- endif %} + +{%- if simulink_opts.outputs.solver_status == 1 %} +i_out = i_out + 1; +output_note = strcat(output_note, num2str(i_out), ') acados solver status (0 = SUCCESS)\n '); +{%- endif %} + +{%- if simulink_opts.outputs.KKT_residual == 1 %} +i_out = i_out + 1; +output_note = strcat(output_note, num2str(i_out), ') KKT residual\n '); +{%- endif %} + +{%- if dims.N > 0 and simulink_opts.outputs.x1 == 1 %} +i_out = i_out + 1; +output_note = strcat(output_note, num2str(i_out), ') x1, state at node 1\n '); +{%- endif %} + +{%- if simulink_opts.outputs.CPU_time == 1 %} +i_out = i_out + 1; +output_note = strcat(output_note, num2str(i_out), ') CPU time\n '); +{%- endif %} + +{%- if simulink_opts.outputs.CPU_time_sim == 1 %} +i_out = i_out + 1; +output_note = strcat(output_note, num2str(i_out), ') CPU time integrator\n '); +{%- endif %} + +{%- if simulink_opts.outputs.CPU_time_qp == 1 %} +i_out = i_out + 1; +output_note = strcat(output_note, num2str(i_out), ') CPU time QP solution\n '); +{%- endif %} + +{%- if simulink_opts.outputs.CPU_time_lin == 1 %} +i_out = i_out + 1; +output_note = strcat(output_note, num2str(i_out), ') CPU time linearization (including integrator)\n '); +{%- endif %} + +{%- if simulink_opts.outputs.sqp_iter == 1 %} +i_out = i_out + 1; +output_note = strcat(output_note, num2str(i_out), ') SQP iterations\n '); +{%- endif %} + +fprintf(output_note) diff --git a/pyextra/acados_template/c_templates_tera/make_sfun_sim.in.m b/pyextra/acados_template/c_templates_tera/make_sfun_sim.in.m new file mode 100644 index 000000000..1c5cf0b12 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/make_sfun_sim.in.m @@ -0,0 +1,99 @@ +% +% Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +% Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +% Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +% Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +% +% This file is part of acados. +% +% The 2-Clause BSD License +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are met: +% +% 1. Redistributions of source code must retain the above copyright notice, +% this list of conditions and the following disclaimer. +% +% 2. Redistributions in binary form must reproduce the above copyright notice, +% this list of conditions and the following disclaimer in the documentation +% and/or other materials provided with the distribution. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +% POSSIBILITY OF SUCH DAMAGE.; +% + +SOURCES = [ 'acados_sim_solver_sfunction_{{ model.name }}.c ', ... + 'acados_sim_solver_{{ model.name }}.c ', ... + {%- if solver_options.integrator_type == 'ERK' %} + '{{ model.name }}_model/{{ model.name }}_expl_ode_fun.c ', ... + '{{ model.name }}_model/{{ model.name }}_expl_vde_forw.c ',... + {%- if solver_options.hessian_approx == 'EXACT' %} + '{{ model.name }}_model/{{ model.name }}_expl_ode_hess.c ',... + {%- endif %} + {%- elif solver_options.integrator_type == "IRK" %} + '{{ model.name }}_model/{{ model.name }}_impl_dae_fun.c ', ... + '{{ model.name }}_model/{{ model.name }}_impl_dae_fun_jac_x_xdot_z.c ', ... + '{{ model.name }}_model/{{ model.name }}_impl_dae_jac_x_xdot_u_z.c ', ... + {%- if solver_options.hessian_approx == 'EXACT' %} + '{{ model.name }}_model/{{ model.name }}_impl_dae_hess.c ',... + {%- endif %} + {%- elif solver_options.integrator_type == "GNSF" %} + '{{ model.name }}_model/{{ model.name }}_gnsf_phi_fun.c ' + '{{ model.name }}_model/{{ model.name }}_gnsf_phi_fun_jac_y.c ' + '{{ model.name }}_model/{{ model.name }}_gnsf_phi_jac_y_uhat.c ' + '{{ model.name }}_model/{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz.c ' + '{{ model.name }}_model/{{ model.name }}_gnsf_get_matrices_fun.c ' + {%- endif %} + ]; + +INC_PATH = '{{ acados_include_path }}'; + +INCS = [ ' -I', fullfile(INC_PATH, 'blasfeo', 'include'), ... + ' -I', fullfile(INC_PATH, 'hpipm', 'include'), ... + ' -I', INC_PATH, ' -I', fullfile(INC_PATH, 'acados'), ' ']; + +CFLAGS = ' -O'; + +LIB_PATH = '{{ acados_lib_path }}'; + +LIBS = '-lacados -lblasfeo -lhpipm'; + +eval( [ 'mex -v -output acados_sim_solver_sfunction_{{ model.name }} ', ... + CFLAGS, INCS, ' ', SOURCES, ' -L', LIB_PATH, ' ', LIBS ]); + +fprintf( [ '\n\nSuccessfully created sfunction:\nacados_sim_solver_sfunction_{{ model.name }}', '.', ... + eval('mexext')] ); + + +%% print note on usage of s-function +fprintf('\n\nNote: Usage of Sfunction is as follows:\n') +input_note = 'Inputs are:\n1) x0, initial state, size [{{ dims.nx }}]\n '; +i_in = 2; +{%- if dims.nu > 0 %} +input_note = strcat(input_note, num2str(i_in), ') u, size [{{ dims.nu }}]\n '); +i_in = i_in + 1; +{%- endif %} + +{%- if dims.np > 0 %} +input_note = strcat(input_note, num2str(i_in), ') parameters, size [{{ dims.np }}]\n '); +i_in = i_in + 1; +{%- endif %} + + +fprintf(input_note) + +disp(' ') + +output_note = strcat('Outputs are:\n', ... + '1) x1 - simulated state, size [{{ dims.nx }}]\n'); + +fprintf(output_note) diff --git a/pyextra/acados_template/c_templates_tera/mex_solver.in.m b/pyextra/acados_template/c_templates_tera/mex_solver.in.m new file mode 100644 index 000000000..728741a46 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/mex_solver.in.m @@ -0,0 +1,166 @@ +% +% Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +% Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +% Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +% Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +% +% This file is part of acados. +% +% The 2-Clause BSD License +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are met: +% +% 1. Redistributions of source code must retain the above copyright notice, +% this list of conditions and the following disclaimer. +% +% 2. Redistributions in binary form must reproduce the above copyright notice, +% this list of conditions and the following disclaimer in the documentation +% and/or other materials provided with the distribution. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +% POSSIBILITY OF SUCH DAMAGE.; +% + +classdef {{ model.name }}_mex_solver < handle + + properties + C_ocp + C_ocp_ext_fun + cost_ext_fun_type + cost_ext_fun_type_e + end % properties + + + + methods + + % constructor + function obj = {{ model.name }}_mex_solver() + make_mex_{{ model.name }}(); + [obj.C_ocp, obj.C_ocp_ext_fun] = acados_mex_create_{{ model.name }}(); + % to have path to destructor when changing directory + addpath('.') + obj.cost_ext_fun_type = '{{ cost.cost_ext_fun_type }}'; + obj.cost_ext_fun_type_e = '{{ cost.cost_ext_fun_type_e }}'; + end + + % destructor + function delete(obj) + if ~isempty(obj.C_ocp) + acados_mex_free_{{ model.name }}(obj.C_ocp); + end + end + + % solve + function solve(obj) + acados_mex_solve_{{ model.name }}(obj.C_ocp); + end + + % set -- borrowed from MEX interface + function set(varargin) + obj = varargin{1}; + field = varargin{2}; + value = varargin{3}; + if ~isa(field, 'char') + error('field must be a char vector, use '' '''); + end + if nargin==3 + acados_mex_set_{{ model.name }}(obj.cost_ext_fun_type, obj.cost_ext_fun_type_e, obj.C_ocp, obj.C_ocp_ext_fun, field, value); + elseif nargin==4 + stage = varargin{4}; + acados_mex_set_{{ model.name }}(obj.cost_ext_fun_type, obj.cost_ext_fun_type_e, obj.C_ocp, obj.C_ocp_ext_fun, field, value, stage); + else + disp('acados_ocp.set: wrong number of input arguments (2 or 3 allowed)'); + end + end + + function value = get_cost(obj) + value = ocp_get_cost(obj.C_ocp); + end + + % get -- borrowed from MEX interface + function value = get(varargin) + % usage: + % obj.get(field, value, [stage]) + obj = varargin{1}; + field = varargin{2}; + if any(strfind('sens', field)) + error('field sens* (sensitivities of optimal solution) not yet supported for templated MEX.') + end + if ~isa(field, 'char') + error('field must be a char vector, use '' '''); + end + + if nargin==2 + value = ocp_get(obj.C_ocp, field); + elseif nargin==3 + stage = varargin{3}; + value = ocp_get(obj.C_ocp, field, stage); + else + disp('acados_ocp.get: wrong number of input arguments (1 or 2 allowed)'); + end + end + + + % print + function print(varargin) + if nargin < 2 + field = 'stat'; + else + field = varargin{2}; + end + + obj = varargin{1}; + + if strcmp(field, 'stat') + stat = obj.get('stat'); + {%- if solver_options.nlp_solver_type == "SQP" %} + fprintf('\niter\tres_stat\tres_eq\t\tres_ineq\tres_comp\tqp_stat\tqp_iter'); + if size(stat,2)>7 + fprintf('\tqp_res_stat\tqp_res_eq\tqp_res_ineq\tqp_res_comp'); + end + fprintf('\n'); + for jj=1:size(stat,1) + fprintf('%d\t%e\t%e\t%e\t%e\t%d\t%d', stat(jj,1), stat(jj,2), stat(jj,3), stat(jj,4), stat(jj,5), stat(jj,6), stat(jj,7)); + if size(stat,2)>7 + fprintf('\t%e\t%e\t%e\t%e', stat(jj,8), stat(jj,9), stat(jj,10), stat(jj,11)); + end + fprintf('\n'); + end + fprintf('\n'); + {%- else %} + fprintf('\niter\tqp_status\tqp_iter'); + if size(stat,2)>3 + fprintf('\tqp_res_stat\tqp_res_eq\tqp_res_ineq\tqp_res_comp'); + end + fprintf('\n'); + for jj=1:size(stat,1) + fprintf('%d\t%d\t\t%d', stat(jj,1), stat(jj,2), stat(jj,3)); + if size(stat,2)>3 + fprintf('\t%e\t%e\t%e\t%e', stat(jj,4), stat(jj,5), stat(jj,6), stat(jj,7)); + end + fprintf('\n'); + end + {% endif %} + + else + fprintf('unsupported field in function print of acados_ocp.print, got %s', field); + keyboard + end + + end + + end % methods + +end % class + diff --git a/pyextra/acados_template/c_templates_tera/model.in.h b/pyextra/acados_template/c_templates_tera/model.in.h new file mode 100644 index 000000000..661811232 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/model.in.h @@ -0,0 +1,209 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +#ifndef {{ model.name }}_MODEL +#define {{ model.name }}_MODEL + +#ifdef __cplusplus +extern "C" { +#endif + +{%- if solver_options.hessian_approx %} + {%- set hessian_approx = solver_options.hessian_approx %} +{%- elif solver_options.sens_hess %} + {%- set hessian_approx = "EXACT" %} +{%- else %} + {%- set hessian_approx = "GAUSS_NEWTON" %} +{%- endif %} + +{% if solver_options.integrator_type == "IRK" or solver_options.integrator_type == "LIFTED_IRK" %} +// implicit ODE +int {{ model.name }}_impl_dae_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_impl_dae_fun_work(int *, int *, int *, int *); +const int *{{ model.name }}_impl_dae_fun_sparsity_in(int); +const int *{{ model.name }}_impl_dae_fun_sparsity_out(int); +int {{ model.name }}_impl_dae_fun_n_in(void); +int {{ model.name }}_impl_dae_fun_n_out(void); + +// implicit ODE +int {{ model.name }}_impl_dae_fun_jac_x_xdot_z(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_impl_dae_fun_jac_x_xdot_z_work(int *, int *, int *, int *); +const int *{{ model.name }}_impl_dae_fun_jac_x_xdot_z_sparsity_in(int); +const int *{{ model.name }}_impl_dae_fun_jac_x_xdot_z_sparsity_out(int); +int {{ model.name }}_impl_dae_fun_jac_x_xdot_z_n_in(void); +int {{ model.name }}_impl_dae_fun_jac_x_xdot_z_n_out(void); + +// implicit ODE +int {{ model.name }}_impl_dae_jac_x_xdot_u_z(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_impl_dae_jac_x_xdot_u_z_work(int *, int *, int *, int *); +const int *{{ model.name }}_impl_dae_jac_x_xdot_u_z_sparsity_in(int); +const int *{{ model.name }}_impl_dae_jac_x_xdot_u_z_sparsity_out(int); +int {{ model.name }}_impl_dae_jac_x_xdot_u_z_n_in(void); +int {{ model.name }}_impl_dae_jac_x_xdot_u_z_n_out(void); + +// implicit ODE - for lifted_irk +int {{ model.name }}_impl_dae_fun_jac_x_xdot_u(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_impl_dae_fun_jac_x_xdot_u_work(int *, int *, int *, int *); +const int *{{ model.name }}_impl_dae_fun_jac_x_xdot_u_sparsity_in(int); +const int *{{ model.name }}_impl_dae_fun_jac_x_xdot_u_sparsity_out(int); +int {{ model.name }}_impl_dae_fun_jac_x_xdot_u_n_in(void); +int {{ model.name }}_impl_dae_fun_jac_x_xdot_u_n_out(void); + +{%- if hessian_approx == "EXACT" %} +int {{ model.name }}_impl_dae_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_impl_dae_hess_work(int *, int *, int *, int *); +const int *{{ model.name }}_impl_dae_hess_sparsity_in(int); +const int *{{ model.name }}_impl_dae_hess_sparsity_out(int); +int {{ model.name }}_impl_dae_hess_n_in(void); +int {{ model.name }}_impl_dae_hess_n_out(void); +{%- endif %} + +{% elif solver_options.integrator_type == "GNSF" %} +/* GNSF Functions */ +// used to import model matrices +int {{ model.name }}_gnsf_get_matrices_fun(const double** arg, double** res, int* iw, double* w, void *mem); +int {{ model.name }}_gnsf_get_matrices_fun_work(int *, int *, int *, int *); +const int *{{ model.name }}_gnsf_get_matrices_fun_sparsity_in(int); +const int *{{ model.name }}_gnsf_get_matrices_fun_sparsity_out(int); +int {{ model.name }}_gnsf_get_matrices_fun_n_in(void); +int {{ model.name }}_gnsf_get_matrices_fun_n_out(void); + +// phi_fun +int {{ model.name }}_gnsf_phi_fun(const double** arg, double** res, int* iw, double* w, void *mem); +int {{ model.name }}_gnsf_phi_fun_work(int *, int *, int *, int *); +const int *{{ model.name }}_gnsf_phi_fun_sparsity_in(int); +const int *{{ model.name }}_gnsf_phi_fun_sparsity_out(int); +int {{ model.name }}_gnsf_phi_fun_n_in(void); +int {{ model.name }}_gnsf_phi_fun_n_out(void); + +// phi_fun_jac_y +int {{ model.name }}_gnsf_phi_fun_jac_y(const double** arg, double** res, int* iw, double* w, void *mem); +int {{ model.name }}_gnsf_phi_fun_jac_y_work(int *, int *, int *, int *); +const int *{{ model.name }}_gnsf_phi_fun_jac_y_sparsity_in(int); +const int *{{ model.name }}_gnsf_phi_fun_jac_y_sparsity_out(int); +int {{ model.name }}_gnsf_phi_fun_jac_y_n_in(void); +int {{ model.name }}_gnsf_phi_fun_jac_y_n_out(void); + +// phi_jac_y_uhat +int {{ model.name }}_gnsf_phi_jac_y_uhat(const double** arg, double** res, int* iw, double* w, void *mem); +int {{ model.name }}_gnsf_phi_jac_y_uhat_work(int *, int *, int *, int *); +const int *{{ model.name }}_gnsf_phi_jac_y_uhat_sparsity_in(int); +const int *{{ model.name }}_gnsf_phi_jac_y_uhat_sparsity_out(int); +int {{ model.name }}_gnsf_phi_jac_y_uhat_n_in(void); +int {{ model.name }}_gnsf_phi_jac_y_uhat_n_out(void); + +// f_lo_fun_jac_x1k1uz +int {{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz(const double** arg, double** res, int* iw, double* w, void *mem); +int {{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_work(int *, int *, int *, int *); +const int *{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_sparsity_in(int); +const int *{{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_sparsity_out(int); +int {{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_n_in(void); +int {{ model.name }}_gnsf_f_lo_fun_jac_x1k1uz_n_out(void); + +{% elif solver_options.integrator_type == "ERK" %} +/* explicit ODE */ + +// explicit ODE +int {{ model.name }}_expl_ode_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_expl_ode_fun_work(int *, int *, int *, int *); +const int *{{ model.name }}_expl_ode_fun_sparsity_in(int); +const int *{{ model.name }}_expl_ode_fun_sparsity_out(int); +int {{ model.name }}_expl_ode_fun_n_in(void); +int {{ model.name }}_expl_ode_fun_n_out(void); + +// explicit forward VDE +int {{ model.name }}_expl_vde_forw(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_expl_vde_forw_work(int *, int *, int *, int *); +const int *{{ model.name }}_expl_vde_forw_sparsity_in(int); +const int *{{ model.name }}_expl_vde_forw_sparsity_out(int); +int {{ model.name }}_expl_vde_forw_n_in(void); +int {{ model.name }}_expl_vde_forw_n_out(void); + +// explicit adjoint VDE +int {{ model.name }}_expl_vde_adj(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_expl_vde_adj_work(int *, int *, int *, int *); +const int *{{ model.name }}_expl_vde_adj_sparsity_in(int); +const int *{{ model.name }}_expl_vde_adj_sparsity_out(int); +int {{ model.name }}_expl_vde_adj_n_in(void); +int {{ model.name }}_expl_vde_adj_n_out(void); + +{%- if hessian_approx == "EXACT" %} +int {{ model.name }}_expl_ode_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_expl_ode_hess_work(int *, int *, int *, int *); +const int *{{ model.name }}_expl_ode_hess_sparsity_in(int); +const int *{{ model.name }}_expl_ode_hess_sparsity_out(int); +int {{ model.name }}_expl_ode_hess_n_in(void); +int {{ model.name }}_expl_ode_hess_n_out(void); +{%- endif %} + +{% elif solver_options.integrator_type == "DISCRETE" %} + +{% if model.dyn_ext_fun_type == "casadi" %} +int {{ model.name }}_dyn_disc_phi_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_dyn_disc_phi_fun_work(int *, int *, int *, int *); +const int *{{ model.name }}_dyn_disc_phi_fun_sparsity_in(int); +const int *{{ model.name }}_dyn_disc_phi_fun_sparsity_out(int); +int {{ model.name }}_dyn_disc_phi_fun_n_in(void); +int {{ model.name }}_dyn_disc_phi_fun_n_out(void); + +int {{ model.name }}_dyn_disc_phi_fun_jac(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_dyn_disc_phi_fun_jac_work(int *, int *, int *, int *); +const int *{{ model.name }}_dyn_disc_phi_fun_jac_sparsity_in(int); +const int *{{ model.name }}_dyn_disc_phi_fun_jac_sparsity_out(int); +int {{ model.name }}_dyn_disc_phi_fun_jac_n_in(void); +int {{ model.name }}_dyn_disc_phi_fun_jac_n_out(void); + +{%- if hessian_approx == "EXACT" %} +int {{ model.name }}_dyn_disc_phi_fun_jac_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_dyn_disc_phi_fun_jac_hess_work(int *, int *, int *, int *); +const int *{{ model.name }}_dyn_disc_phi_fun_jac_hess_sparsity_in(int); +const int *{{ model.name }}_dyn_disc_phi_fun_jac_hess_sparsity_out(int); +int {{ model.name }}_dyn_disc_phi_fun_jac_hess_n_in(void); +int {{ model.name }}_dyn_disc_phi_fun_jac_hess_n_out(void); +{%- endif %} +{% else %} + {%- if hessian_approx == "EXACT" %} +int {{ model.dyn_disc_fun_jac_hess }}(void **, void **, void *); + {% endif %} +int {{ model.dyn_disc_fun_jac }}(void **, void **, void *); +int {{ model.dyn_disc_fun }}(void **, void **, void *); +{% endif %} + + +{% endif %} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // {{ model.name }}_MODEL diff --git a/pyextra/acados_template/c_templates_tera/phi_constraint.in.h b/pyextra/acados_template/c_templates_tera/phi_constraint.in.h new file mode 100644 index 000000000..283ed7f88 --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/phi_constraint.in.h @@ -0,0 +1,55 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +#ifndef {{ model.name }}_PHI_CONSTRAINT +#define {{ model.name }}_PHI_CONSTRAINT + +#ifdef __cplusplus +extern "C" { +#endif + +{% if dims.nphi > 0 %} +// implicit ODE +int {{ model.name }}_phi_constraint(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_phi_constraint_work(int *, int *, int *, int *); +const int *{{ model.name }}_phi_constraint_sparsity_in(int); +const int *{{ model.name }}_phi_constraint_sparsity_out(int); +int {{ model.name }}_phi_constraint_n_in(void); +int {{ model.name }}_phi_constraint_n_out(void); +{% endif %} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // {{ model.name }}_PHI_CONSTRAINT diff --git a/pyextra/acados_template/c_templates_tera/phi_e_constraint.in.h b/pyextra/acados_template/c_templates_tera/phi_e_constraint.in.h new file mode 100644 index 000000000..dc8e293ad --- /dev/null +++ b/pyextra/acados_template/c_templates_tera/phi_e_constraint.in.h @@ -0,0 +1,21 @@ +#ifndef {{ model.name }}_PHI_E_CONSTRAINT +#define {{ model.name }}_PHI_E_CONSTRAINT + +#ifdef __cplusplus +extern "C" { +#endif + +{% if dims.nphi_e > 0 %} +int {{ model.name }}_phi_e_constraint(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int {{ model.name }}_phi_e_constraint_work(int *, int *, int *, int *); +const int *{{ model.name }}_phi_e_constraint_sparsity_in(int); +const int *{{ model.name }}_phi_e_constraint_sparsity_out(int); +int {{ model.name }}_phi_e_constraint_n_in(void); +int {{ model.name }}_phi_e_constraint_n_out(void); +{% endif %} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // {{ model.name }}_PHI_E_CONSTRAINT diff --git a/pyextra/acados_template/generate_c_code_constraint.py b/pyextra/acados_template/generate_c_code_constraint.py new file mode 100644 index 000000000..c79ddc129 --- /dev/null +++ b/pyextra/acados_template/generate_c_code_constraint.py @@ -0,0 +1,180 @@ +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + +import os +from casadi import * +from .utils import ALLOWED_CASADI_VERSIONS, is_empty, casadi_length, casadi_version_warning + +def generate_c_code_constraint( model, con_name, is_terminal, opts ): + + casadi_version = CasadiMeta.version() + casadi_opts = dict(mex=False, casadi_int='int', casadi_real='double') + + if casadi_version not in (ALLOWED_CASADI_VERSIONS): + casadi_version_warning(casadi_version) + + # load constraint variables and expression + x = model.x + p = model.p + + if isinstance(x, casadi.MX): + symbol = MX.sym + else: + symbol = SX.sym + + if is_terminal: + con_h_expr = model.con_h_expr_e + con_phi_expr = model.con_phi_expr_e + # create dummy u, z + u = symbol('u', 0, 0) + z = symbol('z', 0, 0) + else: + con_h_expr = model.con_h_expr + con_phi_expr = model.con_phi_expr + u = model.u + z = model.z + + if (not is_empty(con_h_expr)) and (not is_empty(con_phi_expr)): + raise Exception("acados: you can either have constraint_h, or constraint_phi, not both.") + + if not (is_empty(con_h_expr) and is_empty(con_phi_expr)): + if is_empty(con_h_expr): + constr_type = 'BGP' + else: + constr_type = 'BGH' + + if is_empty(p): + p = symbol('p', 0, 0) + + if is_empty(z): + z = symbol('z', 0, 0) + + if not (is_empty(con_h_expr)) and opts['generate_hess']: + # multipliers for hessian + nh = casadi_length(con_h_expr) + lam_h = symbol('lam_h', nh, 1) + + # set up & change directory + code_export_dir = opts["code_export_directory"] + if not os.path.exists(code_export_dir): + os.makedirs(code_export_dir) + + cwd = os.getcwd() + os.chdir(code_export_dir) + gen_dir = con_name + '_constraints' + if not os.path.exists(gen_dir): + os.mkdir(gen_dir) + gen_dir_location = os.path.join('.', gen_dir) + os.chdir(gen_dir_location) + + # export casadi functions + if constr_type == 'BGH': + if is_terminal: + fun_name = con_name + '_constr_h_e_fun_jac_uxt_zt' + else: + fun_name = con_name + '_constr_h_fun_jac_uxt_zt' + + jac_ux_t = transpose(jacobian(con_h_expr, vertcat(u,x))) + jac_z_t = jacobian(con_h_expr, z) + constraint_fun_jac_tran = Function(fun_name, [x, u, z, p], \ + [con_h_expr, jac_ux_t, jac_z_t]) + + constraint_fun_jac_tran.generate(fun_name, casadi_opts) + if opts['generate_hess']: + + if is_terminal: + fun_name = con_name + '_constr_h_e_fun_jac_uxt_zt_hess' + else: + fun_name = con_name + '_constr_h_fun_jac_uxt_zt_hess' + + # adjoint + adj_ux = jtimes(con_h_expr, vertcat(u, x), lam_h, True) + # hessian + hess_ux = jacobian(adj_ux, vertcat(u, x)) + + adj_z = jtimes(con_h_expr, z, lam_h, True) + hess_z = jacobian(adj_z, z) + + # set up functions + constraint_fun_jac_tran_hess = \ + Function(fun_name, [x, u, lam_h, z, p], \ + [con_h_expr, jac_ux_t, hess_ux, jac_z_t, hess_z]) + + # generate C code + constraint_fun_jac_tran_hess.generate(fun_name, casadi_opts) + + if is_terminal: + fun_name = con_name + '_constr_h_e_fun' + else: + fun_name = con_name + '_constr_h_fun' + h_fun = Function(fun_name, [x, u, z, p], [con_h_expr]) + h_fun.generate(fun_name, casadi_opts) + + else: # BGP constraint + if is_terminal: + fun_name = con_name + '_phi_e_constraint' + r = model.con_r_in_phi_e + con_r_expr = model.con_r_expr_e + else: + fun_name = con_name + '_phi_constraint' + r = model.con_r_in_phi + con_r_expr = model.con_r_expr + + nphi = casadi_length(con_phi_expr) + con_phi_expr_x_u_z = substitute(con_phi_expr, r, con_r_expr) + phi_jac_u = jacobian(con_phi_expr_x_u_z, u) + phi_jac_x = jacobian(con_phi_expr_x_u_z, x) + phi_jac_z = jacobian(con_phi_expr_x_u_z, z) + + hess = hessian(con_phi_expr[0], r)[0] + for i in range(1, nphi): + hess = vertcat(hess, hessian(con_phi_expr[i], r)[0]) + + r_jac_u = jacobian(con_r_expr, u) + r_jac_x = jacobian(con_r_expr, x) + + constraint_phi = \ + Function(fun_name, [x, u, z, p], \ + [con_phi_expr_x_u_z, \ + vertcat(transpose(phi_jac_u), \ + transpose(phi_jac_x)), \ + transpose(phi_jac_z), \ + hess, vertcat(transpose(r_jac_u), \ + transpose(r_jac_x))]) + + constraint_phi.generate(fun_name, casadi_opts) + + # change directory back + os.chdir(cwd) + + return diff --git a/pyextra/acados_template/generate_c_code_discrete_dynamics.py b/pyextra/acados_template/generate_c_code_discrete_dynamics.py new file mode 100644 index 000000000..334e18dab --- /dev/null +++ b/pyextra/acados_template/generate_c_code_discrete_dynamics.py @@ -0,0 +1,99 @@ +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES LOSS OF USE, DATA, OR PROFITS OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +import os +from casadi import * +from .utils import ALLOWED_CASADI_VERSIONS, casadi_length, casadi_version_warning + +def generate_c_code_discrete_dynamics( model, opts ): + + casadi_version = CasadiMeta.version() + casadi_opts = dict(mex=False, casadi_int='int', casadi_real='double') + + if casadi_version not in (ALLOWED_CASADI_VERSIONS): + casadi_version_warning(casadi_version) + + # load model + x = model.x + u = model.u + p = model.p + phi = model.disc_dyn_expr + model_name = model.name + nx = x.size()[0] + + + if isinstance(phi, casadi.MX): + symbol = MX.sym + elif isinstance(phi, casadi.SX): + symbol = SX.sym + else: + Exception("generate_c_code_disc_dyn: disc_dyn_expr must be a CasADi expression, you have type: {}".format(type(phi))) + + # assume nx1 = nx !!! + lam = symbol('lam', nx, 1) + + # generate jacobians + ux = vertcat(u,x) + jac_ux = jacobian(phi, ux) + # generate adjoint + adj_ux = jtimes(phi, ux, lam, True) + # generate hessian + hess_ux = jacobian(adj_ux, ux) + + ## change directory + code_export_dir = opts["code_export_directory"] + if not os.path.exists(code_export_dir): + os.makedirs(code_export_dir) + + cwd = os.getcwd() + os.chdir(code_export_dir) + model_dir = model_name + '_model' + if not os.path.exists(model_dir): + os.mkdir(model_dir) + model_dir_location = os.path.join('.', model_dir) + os.chdir(model_dir_location) + + # set up & generate Functions + fun_name = model_name + '_dyn_disc_phi_fun' + phi_fun = Function(fun_name, [x, u, p], [phi]) + phi_fun.generate(fun_name, casadi_opts) + + fun_name = model_name + '_dyn_disc_phi_fun_jac' + phi_fun_jac_ut_xt = Function(fun_name, [x, u, p], [phi, jac_ux.T]) + phi_fun_jac_ut_xt.generate(fun_name, casadi_opts) + + fun_name = model_name + '_dyn_disc_phi_fun_jac_hess' + phi_fun_jac_ut_xt_hess = Function(fun_name, [x, u, lam, p], [phi, jac_ux.T, hess_ux]) + phi_fun_jac_ut_xt_hess.generate(fun_name, casadi_opts) + + os.chdir(cwd) diff --git a/pyextra/acados_template/generate_c_code_explicit_ode.py b/pyextra/acados_template/generate_c_code_explicit_ode.py new file mode 100644 index 000000000..76e640053 --- /dev/null +++ b/pyextra/acados_template/generate_c_code_explicit_ode.py @@ -0,0 +1,124 @@ +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + +import os +from casadi import * +from .utils import ALLOWED_CASADI_VERSIONS, is_empty, casadi_version_warning + +def generate_c_code_explicit_ode( model, opts ): + + casadi_version = CasadiMeta.version() + casadi_opts = dict(mex=False, casadi_int='int', casadi_real='double') + if casadi_version not in (ALLOWED_CASADI_VERSIONS): + casadi_version_warning(casadi_version) + + + generate_hess = opts["generate_hess"] + code_export_dir = opts["code_export_directory"] + + # load model + x = model.x + u = model.u + p = model.p + f_expl = model.f_expl_expr + model_name = model.name + + ## get model dimensions + nx = x.size()[0] + nu = u.size()[0] + + if isinstance(f_expl, casadi.MX): + symbol = MX.sym + elif isinstance(f_expl, casadi.SX): + symbol = SX.sym + else: + raise Exception("Invalid type for f_expl! Possible types are 'SX' and 'MX'. Exiting.") + ## set up functions to be exported + Sx = symbol('Sx', nx, nx) + Sp = symbol('Sp', nx, nu) + lambdaX = symbol('lambdaX', nx, 1) + + fun_name = model_name + '_expl_ode_fun' + + ## Set up functions + expl_ode_fun = Function(fun_name, [x, u, p], [f_expl]) + + vdeX = jtimes(f_expl,x,Sx) + vdeP = jacobian(f_expl,u) + jtimes(f_expl,x,Sp) + + fun_name = model_name + '_expl_vde_forw' + + expl_vde_forw = Function(fun_name, [x, Sx, Sp, u, p], [f_expl, vdeX, vdeP]) + + adj = jtimes(f_expl, vertcat(x, u), lambdaX, True) + + fun_name = model_name + '_expl_vde_adj' + expl_vde_adj = Function(fun_name, [x, lambdaX, u, p], [adj]) + + if generate_hess: + S_forw = vertcat(horzcat(Sx, Sp), horzcat(DM.zeros(nu,nx), DM.eye(nu))) + hess = mtimes(transpose(S_forw),jtimes(adj, vertcat(x,u), S_forw)) + hess2 = [] + for j in range(nx+nu): + for i in range(j,nx+nu): + hess2 = vertcat(hess2, hess[i,j]) + + fun_name = model_name + '_expl_ode_hess' + expl_ode_hess = Function(fun_name, [x, Sx, Sp, lambdaX, u, p], [adj, hess2]) + + ## generate C code + if not os.path.exists(code_export_dir): + os.makedirs(code_export_dir) + + cwd = os.getcwd() + os.chdir(code_export_dir) + model_dir = model_name + '_model' + if not os.path.exists(model_dir): + os.mkdir(model_dir) + model_dir_location = os.path.join('.', model_dir) + os.chdir(model_dir_location) + fun_name = model_name + '_expl_ode_fun' + expl_ode_fun.generate(fun_name, casadi_opts) + + fun_name = model_name + '_expl_vde_forw' + expl_vde_forw.generate(fun_name, casadi_opts) + + fun_name = model_name + '_expl_vde_adj' + expl_vde_adj.generate(fun_name, casadi_opts) + + if generate_hess: + fun_name = model_name + '_expl_ode_hess' + expl_ode_hess.generate(fun_name, casadi_opts) + os.chdir(cwd) + + return diff --git a/pyextra/acados_template/generate_c_code_external_cost.py b/pyextra/acados_template/generate_c_code_external_cost.py new file mode 100644 index 000000000..839652261 --- /dev/null +++ b/pyextra/acados_template/generate_c_code_external_cost.py @@ -0,0 +1,116 @@ +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + +import os +from casadi import SX, MX, Function, transpose, vertcat, horzcat, hessian, CasadiMeta +from .utils import ALLOWED_CASADI_VERSIONS, casadi_version_warning + + +def generate_c_code_external_cost(model, stage_type, opts): + + casadi_version = CasadiMeta.version() + casadi_opts = dict(mex=False, casadi_int="int", casadi_real="double") + + if casadi_version not in (ALLOWED_CASADI_VERSIONS): + casadi_version_warning(casadi_version) + + x = model.x + p = model.p + + if isinstance(x, MX): + symbol = MX.sym + else: + symbol = SX.sym + + if stage_type == 'terminal': + suffix_name = "_cost_ext_cost_e_fun" + suffix_name_hess = "_cost_ext_cost_e_fun_jac_hess" + suffix_name_jac = "_cost_ext_cost_e_fun_jac" + u = symbol("u", 0, 0) + ext_cost = model.cost_expr_ext_cost_e + custom_hess = model.cost_expr_ext_cost_custom_hess_e + + elif stage_type == 'path': + suffix_name = "_cost_ext_cost_fun" + suffix_name_hess = "_cost_ext_cost_fun_jac_hess" + suffix_name_jac = "_cost_ext_cost_fun_jac" + u = model.u + ext_cost = model.cost_expr_ext_cost + custom_hess = model.cost_expr_ext_cost_custom_hess + + elif stage_type == 'initial': + suffix_name = "_cost_ext_cost_0_fun" + suffix_name_hess = "_cost_ext_cost_0_fun_jac_hess" + suffix_name_jac = "_cost_ext_cost_0_fun_jac" + u = model.u + ext_cost = model.cost_expr_ext_cost_0 + custom_hess = model.cost_expr_ext_cost_custom_hess_0 + + # set up functions to be exported + fun_name = model.name + suffix_name + fun_name_hess = model.name + suffix_name_hess + fun_name_jac = model.name + suffix_name_jac + + # generate expression for full gradient and Hessian + full_hess, grad = hessian(ext_cost, vertcat(u, x)) + + if custom_hess is not None: + full_hess = custom_hess + + ext_cost_fun = Function(fun_name, [x, u, p], [ext_cost]) + ext_cost_fun_jac_hess = Function( + fun_name_hess, [x, u, p], [ext_cost, grad, full_hess] + ) + ext_cost_fun_jac = Function( + fun_name_jac, [x, u, p], [ext_cost, grad] + ) + + # generate C code + code_export_dir = opts["code_export_directory"] + if not os.path.exists(code_export_dir): + os.makedirs(code_export_dir) + + cwd = os.getcwd() + os.chdir(code_export_dir) + gen_dir = model.name + '_cost' + if not os.path.exists(gen_dir): + os.mkdir(gen_dir) + gen_dir_location = "./" + gen_dir + os.chdir(gen_dir_location) + + ext_cost_fun.generate(fun_name, casadi_opts) + ext_cost_fun_jac_hess.generate(fun_name_hess, casadi_opts) + ext_cost_fun_jac.generate(fun_name_jac, casadi_opts) + + os.chdir(cwd) + return diff --git a/pyextra/acados_template/generate_c_code_gnsf.py b/pyextra/acados_template/generate_c_code_gnsf.py new file mode 100644 index 000000000..97acb8e33 --- /dev/null +++ b/pyextra/acados_template/generate_c_code_gnsf.py @@ -0,0 +1,131 @@ +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + +import os +from casadi import * +from .utils import ALLOWED_CASADI_VERSIONS, is_empty, casadi_version_warning + +def generate_c_code_gnsf( model, opts ): + + casadi_version = CasadiMeta.version() + casadi_opts = dict(mex=False, casadi_int='int', casadi_real='double') + if casadi_version not in (ALLOWED_CASADI_VERSIONS): + casadi_version_warning(casadi_version) + + model_name = model.name + code_export_dir = opts["code_export_directory"] + + # set up directory + if not os.path.exists(code_export_dir): + os.makedirs(code_export_dir) + + cwd = os.getcwd() + os.chdir(code_export_dir) + model_dir = model_name + '_model' + if not os.path.exists(model_dir): + os.mkdir(model_dir) + model_dir_location = os.path.join('.', model_dir) + os.chdir(model_dir_location) + + # obtain gnsf dimensions + get_matrices_fun = model.get_matrices_fun + phi_fun = model.phi_fun + + size_gnsf_A = get_matrices_fun.size_out(0) + gnsf_nx1 = size_gnsf_A[1] + gnsf_nz1 = size_gnsf_A[0] - size_gnsf_A[1] + gnsf_nuhat = max(phi_fun.size_in(1)) + gnsf_ny = max(phi_fun.size_in(0)) + gnsf_nout = max(phi_fun.size_out(0)) + + # set up expressions + # if the model uses MX because of cost/constraints + # the DAE can be exported as SX -> detect GNSF in Matlab + # -> evaluated SX GNSF functions with MX. + u = model.u + + if isinstance(u, casadi.MX): + symbol = MX.sym + else: + symbol = SX.sym + + y = symbol("y", gnsf_ny, 1) + uhat = symbol("uhat", gnsf_nuhat, 1) + p = model.p + x1 = symbol("gnsf_x1", gnsf_nx1, 1) + x1dot = symbol("gnsf_x1dot", gnsf_nx1, 1) + z1 = symbol("gnsf_z1", gnsf_nz1, 1) + dummy = symbol("gnsf_dummy", 1, 1) + empty_var = symbol("gnsf_empty_var", 0, 0) + + ## generate C code + fun_name = model_name + '_gnsf_phi_fun' + phi_fun_ = Function(fun_name, [y, uhat, p], [phi_fun(y, uhat, p)]) + phi_fun_.generate(fun_name, casadi_opts) + + fun_name = model_name + '_gnsf_phi_fun_jac_y' + phi_fun_jac_y = model.phi_fun_jac_y + phi_fun_jac_y_ = Function(fun_name, [y, uhat, p], phi_fun_jac_y(y, uhat, p)) + phi_fun_jac_y_.generate(fun_name, casadi_opts) + + fun_name = model_name + '_gnsf_phi_jac_y_uhat' + phi_jac_y_uhat = model.phi_jac_y_uhat + phi_jac_y_uhat_ = Function(fun_name, [y, uhat, p], phi_jac_y_uhat(y, uhat, p)) + phi_jac_y_uhat_.generate(fun_name, casadi_opts) + + fun_name = model_name + '_gnsf_f_lo_fun_jac_x1k1uz' + f_lo_fun_jac_x1k1uz = model.f_lo_fun_jac_x1k1uz + f_lo_fun_jac_x1k1uz_eval = f_lo_fun_jac_x1k1uz(x1, x1dot, z1, u, p) + + # avoid codegeneration issue + if not isinstance(f_lo_fun_jac_x1k1uz_eval, tuple) and is_empty(f_lo_fun_jac_x1k1uz_eval): + f_lo_fun_jac_x1k1uz_eval = [empty_var] + + f_lo_fun_jac_x1k1uz_ = Function(fun_name, [x1, x1dot, z1, u, p], + f_lo_fun_jac_x1k1uz_eval) + f_lo_fun_jac_x1k1uz_.generate(fun_name, casadi_opts) + + fun_name = model_name + '_gnsf_get_matrices_fun' + get_matrices_fun_ = Function(fun_name, [dummy], get_matrices_fun(1)) + get_matrices_fun_.generate(fun_name, casadi_opts) + + # remove fields for json dump + del model.phi_fun + del model.phi_fun_jac_y + del model.phi_jac_y_uhat + del model.f_lo_fun_jac_x1k1uz + del model.get_matrices_fun + + os.chdir(cwd) + + return diff --git a/pyextra/acados_template/generate_c_code_implicit_ode.py b/pyextra/acados_template/generate_c_code_implicit_ode.py new file mode 100644 index 000000000..f2d50b43a --- /dev/null +++ b/pyextra/acados_template/generate_c_code_implicit_ode.py @@ -0,0 +1,139 @@ +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + +import os +from casadi import * +from .utils import ALLOWED_CASADI_VERSIONS, is_empty, casadi_length, casadi_version_warning + +def generate_c_code_implicit_ode( model, opts ): + + casadi_version = CasadiMeta.version() + casadi_opts = dict(mex=False, casadi_int='int', casadi_real='double') + if casadi_version not in (ALLOWED_CASADI_VERSIONS): + casadi_version_warning(casadi_version) + + generate_hess = opts["generate_hess"] + code_export_dir = opts["code_export_directory"] + + ## load model + x = model.x + xdot = model.xdot + u = model.u + z = model.z + p = model.p + f_impl = model.f_impl_expr + model_name = model.name + + ## get model dimensions + nx = casadi_length(x) + nu = casadi_length(u) + nz = casadi_length(z) + + ## generate jacobians + jac_x = jacobian(f_impl, x) + jac_xdot = jacobian(f_impl, xdot) + jac_u = jacobian(f_impl, u) + jac_z = jacobian(f_impl, z) + + ## generate hessian + x_xdot_z_u = vertcat(x, xdot, z, u) + + if isinstance(x, casadi.MX): + symbol = MX.sym + else: + symbol = SX.sym + + multiplier = symbol('multiplier', nx + nz) + + ADJ = jtimes(f_impl, x_xdot_z_u, multiplier, True) + HESS = jacobian(ADJ, x_xdot_z_u) + + ## Set up functions + p = model.p + fun_name = model_name + '_impl_dae_fun' + impl_dae_fun = Function(fun_name, [x, xdot, u, z, p], [f_impl]) + + fun_name = model_name + '_impl_dae_fun_jac_x_xdot_z' + impl_dae_fun_jac_x_xdot_z = Function(fun_name, [x, xdot, u, z, p], [f_impl, jac_x, jac_xdot, jac_z]) + + # fun_name = model_name + '_impl_dae_fun_jac_x_xdot_z' + # impl_dae_fun_jac_x_xdot = Function(fun_name, [x, xdot, u, z, p], [f_impl, jac_x, jac_xdot, jac_z]) + + # fun_name = model_name + '_impl_dae_jac_x_xdot_u' + # impl_dae_jac_x_xdot_u = Function(fun_name, [x, xdot, u, z, p], [jac_x, jac_xdot, jac_u, jac_z]) + + fun_name = model_name + '_impl_dae_fun_jac_x_xdot_u_z' + impl_dae_fun_jac_x_xdot_u_z = Function(fun_name, [x, xdot, u, z, p], [f_impl, jac_x, jac_xdot, jac_u, jac_z]) + + fun_name = model_name + '_impl_dae_fun_jac_x_xdot_u' + impl_dae_fun_jac_x_xdot_u = Function(fun_name, [x, xdot, u, z, p], [f_impl, jac_x, jac_xdot, jac_u]) + + fun_name = model_name + '_impl_dae_jac_x_xdot_u_z' + impl_dae_jac_x_xdot_u_z = Function(fun_name, [x, xdot, u, z, p], [jac_x, jac_xdot, jac_u, jac_z]) + + + fun_name = model_name + '_impl_dae_hess' + impl_dae_hess = Function(fun_name, [x, xdot, u, z, multiplier, p], [HESS]) + + # generate C code + if not os.path.exists(code_export_dir): + os.makedirs(code_export_dir) + + cwd = os.getcwd() + os.chdir(code_export_dir) + model_dir = model_name + '_model' + if not os.path.exists(model_dir): + os.mkdir(model_dir) + model_dir_location = os.path.join('.', model_dir) + os.chdir(model_dir_location) + + fun_name = model_name + '_impl_dae_fun' + impl_dae_fun.generate(fun_name, casadi_opts) + + fun_name = model_name + '_impl_dae_fun_jac_x_xdot_z' + impl_dae_fun_jac_x_xdot_z.generate(fun_name, casadi_opts) + + fun_name = model_name + '_impl_dae_jac_x_xdot_u_z' + impl_dae_jac_x_xdot_u_z.generate(fun_name, casadi_opts) + + fun_name = model_name + '_impl_dae_fun_jac_x_xdot_u_z' + impl_dae_fun_jac_x_xdot_u_z.generate(fun_name, casadi_opts) + + fun_name = model_name + '_impl_dae_fun_jac_x_xdot_u' + impl_dae_fun_jac_x_xdot_u.generate(fun_name, casadi_opts) + + if generate_hess: + fun_name = model_name + '_impl_dae_hess' + impl_dae_hess.generate(fun_name, casadi_opts) + + os.chdir(cwd) diff --git a/pyextra/acados_template/generate_c_code_nls_cost.py b/pyextra/acados_template/generate_c_code_nls_cost.py new file mode 100644 index 000000000..ffcd78ca7 --- /dev/null +++ b/pyextra/acados_template/generate_c_code_nls_cost.py @@ -0,0 +1,113 @@ +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + +import os +from casadi import * +from .utils import ALLOWED_CASADI_VERSIONS, casadi_length, casadi_version_warning + +def generate_c_code_nls_cost( model, cost_name, stage_type, opts ): + + casadi_version = CasadiMeta.version() + casadi_opts = dict(mex=False, casadi_int='int', casadi_real='double') + + if casadi_version not in (ALLOWED_CASADI_VERSIONS): + casadi_version_warning(casadi_version) + + x = model.x + p = model.p + + if isinstance(x, casadi.MX): + symbol = MX.sym + else: + symbol = SX.sym + + if stage_type == 'terminal': + middle_name = '_cost_y_e' + u = symbol('u', 0, 0) + cost_expr = model.cost_y_expr_e + + elif stage_type == 'initial': + middle_name = '_cost_y_0' + u = model.u + cost_expr = model.cost_y_expr_0 + + elif stage_type == 'path': + middle_name = '_cost_y' + u = model.u + cost_expr = model.cost_y_expr + + # set up directory + code_export_dir = opts["code_export_directory"] + if not os.path.exists(code_export_dir): + os.makedirs(code_export_dir) + + cwd = os.getcwd() + os.chdir(code_export_dir) + gen_dir = cost_name + '_cost' + if not os.path.exists(gen_dir): + os.mkdir(gen_dir) + gen_dir_location = os.path.join('.', gen_dir) + os.chdir(gen_dir_location) + + # set up expressions + cost_jac_expr = transpose(jacobian(cost_expr, vertcat(u, x))) + + ny = casadi_length(cost_expr) + + y = symbol('y', ny, 1) + + y_adj = jtimes(cost_expr, vertcat(u, x), y, True) + y_hess = jacobian(y_adj, vertcat(u, x)) + + ## generate C code + suffix_name = '_fun' + fun_name = cost_name + middle_name + suffix_name + y_fun = Function( fun_name, [x, u, p], \ + [ cost_expr ]) + y_fun.generate( fun_name, casadi_opts ) + + suffix_name = '_fun_jac_ut_xt' + fun_name = cost_name + middle_name + suffix_name + y_fun_jac_ut_xt = Function(fun_name, [x, u, p], \ + [ cost_expr, cost_jac_expr ]) + y_fun_jac_ut_xt.generate( fun_name, casadi_opts ) + + suffix_name = '_hess' + fun_name = cost_name + middle_name + suffix_name + y_hess = Function(fun_name, [x, u, y, p], [ y_hess ]) + y_hess.generate( fun_name, casadi_opts ) + + os.chdir(cwd) + + return + diff --git a/pyextra/acados_template/simulink_default_opts.json b/pyextra/acados_template/simulink_default_opts.json new file mode 100644 index 000000000..258a224cb --- /dev/null +++ b/pyextra/acados_template/simulink_default_opts.json @@ -0,0 +1,39 @@ +{ + "outputs": { + "u0": 1, + "utraj": 0, + "xtraj": 0, + "solver_status": 1, + "KKT_residual": 1, + "x1": 1, + "CPU_time": 1, + "CPU_time_sim": 0, + "CPU_time_qp": 0, + "CPU_time_lin": 0, + "sqp_iter": 1 + }, + "inputs": { + "lbx_0": 1, + "ubx_0": 1, + "parameter_traj": 1, + "y_ref_0": 1, + "y_ref": 1, + "y_ref_e": 1, + "lbx": 1, + "ubx": 1, + "lbx_e": 1, + "ubx_e": 1, + "lbu": 1, + "ubu": 1, + "lg": 1, + "ug": 1, + "lh": 1, + "uh": 1, + "cost_W_0": 0, + "cost_W": 0, + "cost_W_e": 0, + "x_init": 0, + "u_init": 0 + }, + "samplingtime": "t0" +} diff --git a/pyextra/acados_template/utils.py b/pyextra/acados_template/utils.py new file mode 100644 index 000000000..bf8ae4d5d --- /dev/null +++ b/pyextra/acados_template/utils.py @@ -0,0 +1,452 @@ +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + +import os, sys, json +import urllib.request +import shutil +import numpy as np +from casadi import SX, MX, DM, Function, CasadiMeta + +ALLOWED_CASADI_VERSIONS = ('3.5.5', '3.5.4', '3.5.3', '3.5.2', '3.5.1', '3.4.5', '3.4.0') + +TERA_VERSION = "0.0.34" + +def get_acados_path(): + ACADOS_PATH = os.environ.get('ACADOS_SOURCE_DIR') + if not ACADOS_PATH: + acados_template_path = os.path.dirname(os.path.abspath(__file__)) + acados_path = os.path.join(acados_template_path, '..','..','..') + ACADOS_PATH = os.path.realpath(acados_path) + msg = 'Warning: Did not find environment variable ACADOS_SOURCE_DIR, ' + msg += 'guessed ACADOS_PATH to be {}.\n'.format(ACADOS_PATH) + msg += 'Please export ACADOS_SOURCE_DIR to not avoid this warning.' + print(msg) + return ACADOS_PATH + + +def get_python_interface_path(): + ACADOS_PYTHON_INTERFACE_PATH = os.environ.get('ACADOS_PYTHON_INTERFACE_PATH') + if not ACADOS_PYTHON_INTERFACE_PATH: + acados_path = get_acados_path() + ACADOS_PYTHON_INTERFACE_PATH = os.path.join(acados_path, 'interfaces', 'acados_template', 'acados_template') + return ACADOS_PYTHON_INTERFACE_PATH + + +def get_tera_exec_path(): + TERA_PATH = os.environ.get('TERA_PATH') + if not TERA_PATH: + TERA_PATH = os.path.join(get_acados_path(), 'bin', 't_renderer') + if os.name == 'nt': + TERA_PATH += '.exe' + return TERA_PATH + + +platform2tera = { + "linux": "linux", + "darwin": "osx", + "win32": "window.exe" +} + + +def casadi_version_warning(casadi_version): + msg = 'Warning: Please note that the following versions of CasADi are ' + msg += 'officially supported: {}.\n '.format(" or ".join(ALLOWED_CASADI_VERSIONS)) + msg += 'If there is an incompatibility with the CasADi generated code, ' + msg += 'please consider changing your CasADi version.\n' + msg += 'Version {} currently in use.'.format(casadi_version) + print(msg) + + +def is_column(x): + if isinstance(x, np.ndarray): + if x.ndim == 1: + return True + elif x.ndim == 2 and x.shape[1] == 1: + return True + else: + return False + elif isinstance(x, (MX, SX, DM)): + if x.shape[1] == 1: + return True + elif x.shape[0] == 0 and x.shape[1] == 0: + return True + else: + return False + elif x == None or x == []: + return False + else: + raise Exception("is_column expects one of the following types: np.ndarray, casadi.MX, casadi.SX." + + " Got: " + str(type(x))) + + +def is_empty(x): + if isinstance(x, (MX, SX, DM)): + return x.is_empty() + elif isinstance(x, np.ndarray): + if np.prod(x.shape) == 0: + return True + else: + return False + elif x == None or x == []: + return True + else: + raise Exception("is_empty expects one of the following types: casadi.MX, casadi.SX, " + + "None, numpy array empty list. Got: " + str(type(x))) + + +def casadi_length(x): + if isinstance(x, (MX, SX, DM)): + return int(np.prod(x.shape)) + else: + raise Exception("casadi_length expects one of the following types: casadi.MX, casadi.SX." + + " Got: " + str(type(x))) + + +def make_model_consistent(model): + x = model.x + xdot = model.xdot + u = model.u + z = model.z + p = model.p + + if isinstance(x, MX): + symbol = MX.sym + elif isinstance(x, SX): + symbol = SX.sym + else: + raise Exception("model.x must be casadi.SX or casadi.MX, got {}".format(type(x))) + + if is_empty(p): + model.p = symbol('p', 0, 0) + + if is_empty(z): + model.z = symbol('z', 0, 0) + + return model + + +def get_tera(): + tera_path = get_tera_exec_path() + acados_path = get_acados_path() + + if os.path.exists(tera_path) and os.access(tera_path, os.X_OK): + return tera_path + + repo_url = "https://github.com/acados/tera_renderer/releases" + url = "{}/download/v{}/t_renderer-v{}-{}".format( + repo_url, TERA_VERSION, TERA_VERSION, platform2tera[sys.platform]) + + manual_install = 'For manual installation follow these instructions:\n' + manual_install += '1 Download binaries from {}\n'.format(url) + manual_install += '2 Copy them in {}/bin\n'.format(acados_path) + manual_install += '3 Strip the version and platform from the binaries: ' + manual_install += 'as t_renderer-v0.0.34-X -> t_renderer)\n' + manual_install += '4 Enable execution privilege on the file "t_renderer" with:\n' + manual_install += '"chmod +x {}"\n\n'.format(tera_path) + + msg = "\n" + msg += 'Tera template render executable not found, ' + msg += 'while looking in path:\n{}\n'.format(tera_path) + msg += 'In order to be able to render the templates, ' + msg += 'you need to download the tera renderer binaries from:\n' + msg += '{}\n\n'.format(repo_url) + msg += 'Do you wish to set up Tera renderer automatically?\n' + msg += 'y/N? (press y to download tera or any key for manual installation)\n' + + if input(msg) == 'y': + print("Dowloading {}".format(url)) + with urllib.request.urlopen(url) as response, open(tera_path, 'wb') as out_file: + shutil.copyfileobj(response, out_file) + print("Successfully downloaded t_renderer.") + os.chmod(tera_path, 0o755) + return tera_path + + msg_cancel = "\nYou cancelled automatic download.\n\n" + msg_cancel += manual_install + msg_cancel += "Once installed re-run your script.\n\n" + print(msg_cancel) + + sys.exit(1) + + +def render_template(in_file, out_file, template_dir, json_path): + cwd = os.getcwd() + if not os.path.exists(template_dir): + os.mkdir(template_dir) + os.chdir(template_dir) + + tera_path = get_tera() + + # setting up loader and environment + acados_path = os.path.dirname(os.path.abspath(__file__)) + template_glob = os.path.join(acados_path, 'c_templates_tera', '*') + + # call tera as system cmd + os_cmd = "{tera_path} '{template_glob}' '{in_file}' '{json_path}' '{out_file}'".format( + tera_path=tera_path, + template_glob=template_glob, + json_path=json_path, + in_file=in_file, + out_file=out_file + ) + status = os.system(os_cmd) + if (status != 0): + raise Exception('Rendering of {} failed!\n\nAttempted to execute OS command:\n{}\n\nExiting.\n'.format(in_file, os_cmd)) + + os.chdir(cwd) + + +## Conversion functions +def np_array_to_list(np_array): + if isinstance(np_array, (np.ndarray)): + return np_array.tolist() + elif isinstance(np_array, (SX)): + return DM(np_array).full() + elif isinstance(np_array, (DM)): + return np_array.full() + else: + raise(Exception( + "Cannot convert to list type {}".format(type(np_array)) + )) + + +def format_class_dict(d): + """ + removes the __ artifact from class to dict conversion + """ + out = {} + for k, v in d.items(): + if isinstance(v, dict): + v = format_class_dict(v) + + out_key = k.split('__', 1)[-1] + out[k.replace(k, out_key)] = v + return out + + +def acados_class2dict(class_instance): + """ + removes the __ artifact from class to dict conversion + """ + + d = dict(class_instance.__dict__) + out = {} + for k, v in d.items(): + if isinstance(v, dict): + v = format_class_dict(v) + + out_key = k.split('__', 1)[-1] + out[k.replace(k, out_key)] = v + return out + + +def get_ocp_nlp_layout(): + python_interface_path = get_python_interface_path() + abs_path = os.path.join(python_interface_path, 'acados_layout.json') + with open(abs_path, 'r') as f: + ocp_nlp_layout = json.load(f) + return ocp_nlp_layout + + +def ocp_check_against_layout(ocp_nlp, ocp_dims): + """ + Check dimensions against layout + Parameters + --------- + ocp_nlp : dict + dictionary loaded from JSON to be post-processed. + + ocp_dims : instance of AcadosOcpDims + """ + + ocp_nlp_layout = get_ocp_nlp_layout() + + ocp_check_against_layout_recursion(ocp_nlp, ocp_dims, ocp_nlp_layout) + return + + +def ocp_check_against_layout_recursion(ocp_nlp, ocp_dims, layout): + + for key, item in ocp_nlp.items(): + + try: + layout_of_key = layout[key] + except KeyError: + raise Exception("ocp_check_against_layout_recursion: field" \ + " '{0}' is not in layout but in OCP description.".format(key)) + + if isinstance(item, dict): + ocp_check_against_layout_recursion(item, ocp_dims, layout_of_key) + + if 'ndarray' in layout_of_key: + if isinstance(item, int) or isinstance(item, float): + item = np.array([item]) + if isinstance(item, (list, np.ndarray)) and (layout_of_key[0] != 'str'): + dim_layout = [] + dim_names = layout_of_key[1] + + for dim_name in dim_names: + dim_layout.append(ocp_dims[dim_name]) + + dims = tuple(dim_layout) + + item = np.array(item) + item_dims = item.shape + if len(item_dims) != len(dims): + raise Exception('Mismatching dimensions for field {0}. ' \ + 'Expected {1} dimensional array, got {2} dimensional array.' \ + .format(key, len(dims), len(item_dims))) + + if np.prod(item_dims) != 0 or np.prod(dims) != 0: + if dims != item_dims: + raise Exception('acados -- mismatching dimensions for field {0}. ' \ + 'Provided data has dimensions {1}, ' \ + 'while associated dimensions {2} are {3}' \ + .format(key, item_dims, dim_names, dims)) + return + + +def J_to_idx(J): + nrows = J.shape[0] + idx = np.zeros((nrows, )) + for i in range(nrows): + this_idx = np.nonzero(J[i,:])[0] + if len(this_idx) != 1: + raise Exception('Invalid J matrix structure detected, ' \ + 'must contain one nonzero element per row. Exiting.') + if this_idx.size > 0 and J[i,this_idx[0]] != 1: + raise Exception('J matrices can only contain 1s. Exiting.') + idx[i] = this_idx[0] + return idx + + +def J_to_idx_slack(J): + nrows = J.shape[0] + ncol = J.shape[1] + idx = np.zeros((ncol, )) + i_idx = 0 + for i in range(nrows): + this_idx = np.nonzero(J[i,:])[0] + if len(this_idx) == 1: + idx[i_idx] = i + i_idx = i_idx + 1 + elif len(this_idx) > 1: + raise Exception('J_to_idx_slack: Invalid J matrix. Exiting. ' \ + 'Found more than one nonzero in row ' + str(i)) + if this_idx.size > 0 and J[i,this_idx[0]] != 1: + raise Exception('J_to_idx_slack: J matrices can only contain 1s, ' \ + 'got J(' + str(i) + ', ' + str(this_idx[0]) + ') = ' + str(J[i,this_idx[0]]) ) + if not i_idx == ncol: + raise Exception('J_to_idx_slack: J must contain a 1 in every column!') + return idx + + +def acados_dae_model_json_dump(model): + + # load model + x = model.x + xdot = model.xdot + u = model.u + z = model.z + p = model.p + + f_impl = model.f_impl_expr + model_name = model.name + + # create struct with impl_dae_fun, casadi_version + fun_name = model_name + '_impl_dae_fun' + impl_dae_fun = Function(fun_name, [x, xdot, u, z, p], [f_impl]) + + casadi_version = CasadiMeta.version() + str_impl_dae_fun = impl_dae_fun.serialize() + + dae_dict = {"str_impl_dae_fun": str_impl_dae_fun, "casadi_version": casadi_version} + + # dump + json_file = model_name + '_acados_dae.json' + with open(json_file, 'w') as f: + json.dump(dae_dict, f, default=np_array_to_list, indent=4, sort_keys=True) + print("dumped ", model_name, " dae to file:", json_file, "\n") + + +def set_up_imported_gnsf_model(acados_formulation): + + gnsf = acados_formulation.gnsf_model + + # check CasADi version + # dump_casadi_version = gnsf['casadi_version'] + # casadi_version = CasadiMeta.version() + + # if not casadi_version == dump_casadi_version: + # print("WARNING: GNSF model was dumped with another CasADi version.\n" + # + "This might yield errors. Please use the same version for compatibility, serialize version: " + # + dump_casadi_version + " current Python CasADi verison: " + casadi_version) + # input("Press any key to attempt to continue...") + + # load model + phi_fun = Function.deserialize(gnsf['phi_fun']) + phi_fun_jac_y = Function.deserialize(gnsf['phi_fun_jac_y']) + phi_jac_y_uhat = Function.deserialize(gnsf['phi_jac_y_uhat']) + get_matrices_fun = Function.deserialize(gnsf['get_matrices_fun']) + + # obtain gnsf dimensions + size_gnsf_A = get_matrices_fun.size_out(0) + acados_formulation.dims.gnsf_nx1 = size_gnsf_A[1] + acados_formulation.dims.gnsf_nz1 = size_gnsf_A[0] - size_gnsf_A[1] + acados_formulation.dims.gnsf_nuhat = max(phi_fun.size_in(1)) + acados_formulation.dims.gnsf_ny = max(phi_fun.size_in(0)) + acados_formulation.dims.gnsf_nout = max(phi_fun.size_out(0)) + + # save gnsf functions in model + acados_formulation.model.phi_fun = phi_fun + acados_formulation.model.phi_fun_jac_y = phi_fun_jac_y + acados_formulation.model.phi_jac_y_uhat = phi_jac_y_uhat + acados_formulation.model.get_matrices_fun = get_matrices_fun + + if "f_lo_fun_jac_x1k1uz" in gnsf: + f_lo_fun_jac_x1k1uz = Function.deserialize(gnsf['f_lo_fun_jac_x1k1uz']) + acados_formulation.model.f_lo_fun_jac_x1k1uz = f_lo_fun_jac_x1k1uz + else: + dummy_var_x1 = SX.sym('dummy_var_x1', acados_formulation.dims.gnsf_nx1) + dummy_var_x1dot = SX.sym('dummy_var_x1dot', acados_formulation.dims.gnsf_nx1) + dummy_var_z1 = SX.sym('dummy_var_z1', acados_formulation.dims.gnsf_nz1) + dummy_var_u = SX.sym('dummy_var_z1', acados_formulation.dims.nu) + dummy_var_p = SX.sym('dummy_var_z1', acados_formulation.dims.np) + empty_var = SX.sym('empty_var', 0, 0) + + empty_fun = Function('empty_fun', \ + [dummy_var_x1, dummy_var_x1dot, dummy_var_z1, dummy_var_u, dummy_var_p], + [empty_var]) + acados_formulation.model.f_lo_fun_jac_x1k1uz = empty_fun + + del acados_formulation.gnsf_model diff --git a/rednose/SConscript b/rednose/SConscript new file mode 100644 index 000000000..ca1b28423 --- /dev/null +++ b/rednose/SConscript @@ -0,0 +1,41 @@ +Import('env', 'envCython', 'arch', 'rednose_config', 'common') + +generated_folder = rednose_config['generated_folder'] + +templates = Glob('#rednose/templates/*') + +sympy_helpers = "#rednose/helpers/sympy_helpers.py" +ekf_sym = "#rednose/helpers/ekf_sym.py" +ekf_sym_pyx = "#rednose/helpers/ekf_sym_pyx.pyx" +ekf_sym_cc = env.Object("#rednose/helpers/ekf_sym.cc") +common_ekf = "#rednose/helpers/common_ekf.cc" + +found = {} +for target, (command, combined_lib, extra_generated) in rednose_config['to_build'].items(): + if File(command).exists(): + found[target] = (command, combined_lib, extra_generated) + +lib_target = [common_ekf] +for target, (command, combined_lib, extra_generated) in found.items(): + target_files = File([f'{generated_folder}/{target}.cpp', f'{generated_folder}/{target}.h']) + extra_generated = [File(f'{generated_folder}/{x}') for x in extra_generated] + command_file = File(command) + + env.Command(target_files + extra_generated, + [templates, command_file, sympy_helpers, ekf_sym], + command_file.get_abspath() + " " + target + " " + Dir(generated_folder).get_abspath()) + + if combined_lib: + lib_target.append(target_files[0]) + else: + env.SharedLibrary(f'{generated_folder}/' + target, [target_files[0], common_ekf]) + +libkf = env.SharedLibrary(f'{generated_folder}/libkf', lib_target) + +lenv = envCython.Clone() +lenv["LINKFLAGS"] += [libkf[0].get_labspath()] +lenv["LIBS"] = ['zmq', common] + lenv["LIBS"] +ekf_sym_so = lenv.Program('#rednose/helpers/ekf_sym_pyx.so', [ekf_sym_pyx, ekf_sym_cc, common_ekf]) +lenv.Depends(ekf_sym_so, libkf) + +Export('libkf') diff --git a/rednose/helpers/__init__.py b/rednose/helpers/__init__.py new file mode 100644 index 000000000..bbd239b77 --- /dev/null +++ b/rednose/helpers/__init__.py @@ -0,0 +1,35 @@ +import os +import platform +from cffi import FFI + +TEMPLATE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'templates')) + + +def write_code(folder, name, code, header): + if not os.path.exists(folder): + os.mkdir(folder) + + open(os.path.join(folder, f"{name}.cpp"), 'w').write(code) + open(os.path.join(folder, f"{name}.h"), 'w').write(header) + + +def load_code(folder, name, lib_name=None): + if lib_name is None: + lib_name = name + shared_ext = "dylib" if platform.system() == "Darwin" else "so" + shared_fn = os.path.join(folder, f"lib{lib_name}.{shared_ext}") + header_fn = os.path.join(folder, f"{name}.h") + + with open(header_fn) as f: + header = f.read() + + # is the only thing that can be parsed by cffi + header = "\n".join([line for line in header.split("\n") if line.startswith("void ")]) + + ffi = FFI() + ffi.cdef(header) + return (ffi, ffi.dlopen(shared_fn)) + + +class KalmanError(Exception): + pass diff --git a/rednose/helpers/chi2_lookup.py b/rednose/helpers/chi2_lookup.py new file mode 100644 index 000000000..e22cc9729 --- /dev/null +++ b/rednose/helpers/chi2_lookup.py @@ -0,0 +1,22 @@ +import os + +import numpy as np + + +def gen_chi2_ppf_lookup(max_dim=200): + from scipy.stats import chi2 + table = np.zeros((max_dim, 98)) + for dim in range(1, max_dim): + table[dim] = chi2.ppf(np.arange(.01, .99, .01), dim) + + np.save('chi2_lookup_table', table) + + +def chi2_ppf(p, dim): + table = np.load(os.path.dirname(os.path.realpath(__file__)) + '/chi2_lookup_table.npy') + result = np.interp(p, np.arange(.01, .99, .01), table[dim]) + return result + + +if __name__ == "__main__": + gen_chi2_ppf_lookup() diff --git a/rednose/helpers/chi2_lookup_table.npy b/rednose/helpers/chi2_lookup_table.npy new file mode 100644 index 000000000..6f1bd959c Binary files /dev/null and b/rednose/helpers/chi2_lookup_table.npy differ diff --git a/rednose/helpers/common_ekf.cc b/rednose/helpers/common_ekf.cc new file mode 100644 index 000000000..1e6390250 --- /dev/null +++ b/rednose/helpers/common_ekf.cc @@ -0,0 +1,19 @@ +#include "common_ekf.h" + +std::vector& get_ekfs() { + static std::vector vec; + return vec; +} + +void ekf_register(const EKF* ekf) { + get_ekfs().push_back(ekf); +} + +const EKF* ekf_lookup(const std::string& ekf_name) { + for (const auto& ekfi : get_ekfs()) { + if (ekf_name == ekfi->name) { + return ekfi; + } + } + return NULL; +} diff --git a/rednose/helpers/common_ekf.h b/rednose/helpers/common_ekf.h new file mode 100644 index 000000000..5dfdd448b --- /dev/null +++ b/rednose/helpers/common_ekf.h @@ -0,0 +1,43 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +typedef void (*extra_routine_t)(double *, double *); + +struct EKF { + std::string name; + std::vector kinds; + std::vector feature_kinds; + + void (*f_fun)(double *, double, double *); + void (*F_fun)(double *, double, double *); + void (*err_fun)(double *, double *, double *); + void (*inv_err_fun)(double *, double *, double *); + void (*H_mod_fun)(double *, double *); + void (*predict)(double *, double *, double *, double); + std::unordered_map hs = {}; + std::unordered_map Hs = {}; + std::unordered_map updates = {}; + std::unordered_map Hes = {}; + std::unordered_map sets = {}; + std::unordered_map extra_routines = {}; +}; + +std::vector& get_ekfs(); +const EKF* ekf_lookup(const std::string& ekf_name); + +void ekf_register(const EKF* ekf); + +#define ekf_init(ekf) \ +static void __attribute__((constructor)) do_ekf_init_ ## ekf(void) { \ + ekf_register(&ekf); \ +} diff --git a/rednose/helpers/ekf_sym.cc b/rednose/helpers/ekf_sym.cc new file mode 100644 index 000000000..8a2f2b88a --- /dev/null +++ b/rednose/helpers/ekf_sym.cc @@ -0,0 +1,224 @@ +#include "ekf_sym.h" +#include "logger/logger.h" + +using namespace EKFS; +using namespace Eigen; + +EKFSym::EKFSym(std::string name, Map Q, Map x_initial, Map P_initial, int dim_main, + int dim_main_err, int N, int dim_augment, int dim_augment_err, std::vector maha_test_kinds, + std::vector quaternion_idxs, std::vector global_vars, double max_rewind_age) +{ + // TODO: add logger + + this->ekf = ekf_lookup(name); + assert(this->ekf); + + this->msckf = N > 0; + this->N = N; + this->dim_augment = dim_augment; + this->dim_augment_err = dim_augment_err; + this->dim_main = dim_main; + this->dim_main_err = dim_main_err; + + this->dim_x = x_initial.rows(); + this->dim_err = P_initial.rows(); + + assert(dim_main + dim_augment * N == dim_x); + assert(dim_main_err + dim_augment_err * N == this->dim_err); + assert(Q.rows() == P_initial.rows() && Q.cols() == P_initial.cols()); + + // kinds that should get mahalanobis distance + // tested for outlier rejection + this->maha_test_kinds = maha_test_kinds; + + // quaternions need normalization + this->quaternion_idxs = quaternion_idxs; + + this->global_vars = global_vars; + + // Process noise + this->Q = Q; + + this->max_rewind_age = max_rewind_age; + this->init_state(x_initial, P_initial, NAN); +} + +void EKFSym::init_state(Map state, Map covs, double init_filter_time) { + this->x = state; + this->P = covs; + this->filter_time = init_filter_time; + this->augment_times = VectorXd::Zero(this->N); + this->reset_rewind(); +} + +VectorXd EKFSym::state() { + return this->x; +} + +MatrixXdr EKFSym::covs() { + return this->P; +} + +void EKFSym::set_filter_time(double t) { + this->filter_time = t; +} + +double EKFSym::get_filter_time() { + return this->filter_time; +} + +void EKFSym::normalize_quaternions() { + for(std::size_t i = 0; i < this->quaternion_idxs.size(); ++i) { + this->normalize_slice(this->quaternion_idxs[i], this->quaternion_idxs[i] + 4); + } +} + +void EKFSym::normalize_slice(int slice_start, int slice_end_ex) { + this->x.block(slice_start, 0, slice_end_ex - slice_start, this->x.cols()).normalize(); +} + +void EKFSym::set_global(std::string global_var, double val) { + this->ekf->sets.at(global_var)(val); +} + +std::optional EKFSym::predict_and_update_batch(double t, int kind, std::vector> z_map, + std::vector> R_map, std::vector> extra_args, bool augment) +{ + // TODO handle rewinding at this level + + std::deque rewound; + if (!std::isnan(this->filter_time) && t < this->filter_time) { + if (this->rewind_t.empty() || t < this->rewind_t.front() || t < this->rewind_t.back() - this->max_rewind_age) { + LOGD("observation too old at %d with filter at %d, ignoring!", t, this->filter_time); + return std::nullopt; + } + rewound = this->rewind(t); + } + + Observation obs; + obs.t = t; + obs.kind = kind; + obs.extra_args = extra_args; + for (Map zi : z_map) { + obs.z.push_back(zi); + } + for (Map Ri : R_map) { + obs.R.push_back(Ri); + } + + std::optional res = std::make_optional(this->predict_and_update_batch(obs, augment)); + + // optional fast forward + while (!rewound.empty()) { + this->predict_and_update_batch(rewound.front(), false); + rewound.pop_front(); + } + + return res; +} + +void EKFSym::reset_rewind() { + this->rewind_obscache.clear(); + this->rewind_t.clear(); + this->rewind_states.clear(); +} + +std::deque EKFSym::rewind(double t) { + std::deque rewound; + + // rewind observations until t is after previous observation + while (this->rewind_t.back() > t) { + rewound.push_front(this->rewind_obscache.back()); + this->rewind_t.pop_back(); + this->rewind_states.pop_back(); + this->rewind_obscache.pop_back(); + } + + // set the state to the time right before that + this->filter_time = this->rewind_t.back(); + this->x = this->rewind_states.back().first; + this->P = this->rewind_states.back().second; + + return rewound; +} + +void EKFSym::checkpoint(Observation& obs) { + // push to rewinder + this->rewind_t.push_back(this->filter_time); + this->rewind_states.push_back(std::make_pair(this->x, this->P)); + this->rewind_obscache.push_back(obs); + + // only keep a certain number around + if (this->rewind_t.size() > REWIND_TO_KEEP) { + this->rewind_t.pop_front(); + this->rewind_states.pop_front(); + this->rewind_obscache.pop_front(); + } +} + +Estimate EKFSym::predict_and_update_batch(Observation& obs, bool augment) { + assert(obs.z.size() == obs.R.size()); + assert(obs.z.size() == obs.extra_args.size()); + + this->predict(obs.t); + + Estimate res; + res.t = obs.t; + res.kind = obs.kind; + res.z = obs.z; + res.extra_args = obs.extra_args; + res.xk1 = this->x; + res.Pk1 = this->P; + + // update batch + std::vector y; + for (int i = 0; i < obs.z.size(); i++) { + assert(obs.z[i].rows() == obs.R[i].rows()); + assert(obs.z[i].rows() == obs.R[i].cols()); + + // update state + y.push_back(this->update(obs.kind, obs.z[i], obs.R[i], obs.extra_args[i])); + } + + res.xk = this->x; + res.Pk = this->P; + res.y = y; + + assert(!augment); // TODO + // if (augment) { + // this->augment(); + // } + + this->checkpoint(obs); + + return res; +} + +void EKFSym::predict(double t) { + // initialize time + if (std::isnan(this->filter_time)) { + this->filter_time = t; + } + + // predict + double dt = t - this->filter_time; + assert(dt >= 0.0); + + this->ekf->predict(this->x.data(), this->P.data(), this->Q.data(), dt); + this->normalize_quaternions(); + this->filter_time = t; +} + +VectorXd EKFSym::update(int kind, VectorXd z, MatrixXdr R, std::vector extra_args) { + this->ekf->updates.at(kind)(this->x.data(), this->P.data(), z.data(), R.data(), extra_args.data()); + this->normalize_quaternions(); + + if (this->msckf && std::find(this->feature_track_kinds.begin(), this->feature_track_kinds.end(), kind) != this->feature_track_kinds.end()) { + return z.head(z.rows() - extra_args.size()); + } + return z; +} + +extra_routine_t EKFSym::get_extra_routine(const std::string& routine) { + return this->ekf->extra_routines.at(routine); +} diff --git a/rednose/helpers/ekf_sym.h b/rednose/helpers/ekf_sym.h new file mode 100644 index 000000000..86d6ca193 --- /dev/null +++ b/rednose/helpers/ekf_sym.h @@ -0,0 +1,112 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "common_ekf.h" + +#define REWIND_TO_KEEP 512 + +namespace EKFS { + +typedef Eigen::Matrix MatrixXdr; + +typedef struct Observation { + double t; + int kind; + std::vector z; + std::vector R; + std::vector> extra_args; +} Observation; + +typedef struct Estimate { + Eigen::VectorXd xk1; + Eigen::VectorXd xk; + MatrixXdr Pk1; + MatrixXdr Pk; + double t; + int kind; + std::vector y; + std::vector z; + std::vector> extra_args; +} Estimate; + +class EKFSym { +public: + EKFSym(std::string name, Eigen::Map Q, Eigen::Map x_initial, + Eigen::Map P_initial, int dim_main, int dim_main_err, int N = 0, int dim_augment = 0, + int dim_augment_err = 0, std::vector maha_test_kinds = std::vector(), + std::vector quaternion_idxs = std::vector(), + std::vector global_vars = std::vector(), double max_rewind_age = 1.0); + void init_state(Eigen::Map state, Eigen::Map covs, double filter_time); + + Eigen::VectorXd state(); + MatrixXdr covs(); + void set_filter_time(double t); + double get_filter_time(); + void normalize_quaternions(); + void normalize_slice(int slice_start, int slice_end_ex); + void set_global(std::string global_var, double val); + void reset_rewind(); + + void predict(double t); + std::optional predict_and_update_batch(double t, int kind, std::vector> z, + std::vector> R, std::vector> extra_args = {{}}, bool augment = false); + + extra_routine_t get_extra_routine(const std::string& routine); + +private: + std::deque rewind(double t); + void checkpoint(Observation& obs); + + Estimate predict_and_update_batch(Observation& obs, bool augment); + Eigen::VectorXd update(int kind, Eigen::VectorXd z, MatrixXdr R, std::vector extra_args); + + // stuct with linked sympy generated functions + const EKF *ekf = NULL; + + Eigen::VectorXd x; // state + MatrixXdr P; // covs + + bool msckf; + int N; + int dim_augment; + int dim_augment_err; + int dim_main; + int dim_main_err; + + // state + int dim_x; + int dim_err; + + double filter_time; + + std::vector maha_test_kinds; + std::vector quaternion_idxs; + + std::vector global_vars; + + // process noise + MatrixXdr Q; + + // rewind stuff + double max_rewind_age; + std::deque rewind_t; + std::deque> rewind_states; + std::deque rewind_obscache; + + Eigen::VectorXd augment_times; + + std::vector feature_track_kinds; +}; + +} diff --git a/rednose/helpers/ekf_sym.py b/rednose/helpers/ekf_sym.py new file mode 100644 index 000000000..c9cf0bc22 --- /dev/null +++ b/rednose/helpers/ekf_sym.py @@ -0,0 +1,687 @@ +import os +import logging +from bisect import bisect_right + +import numpy as np +import sympy as sp +from numpy import dot + +from rednose.helpers.sympy_helpers import sympy_into_c +from rednose.helpers import TEMPLATE_DIR, load_code +from rednose.helpers.chi2_lookup import chi2_ppf + + +def solve(a, b): + if a.shape[0] == 1 and a.shape[1] == 1: + return b / a[0][0] + else: + return np.linalg.solve(a, b) + + +def null(H, eps=1e-12): + _, s, vh = np.linalg.svd(H) + padding = max(0, np.shape(H)[1] - np.shape(s)[0]) + null_mask = np.concatenate(((s <= eps), np.ones((padding,), dtype=bool)), axis=0) + null_space = np.compress(null_mask, vh, axis=0) + return np.transpose(null_space) + + +def gen_code(folder, name, f_sym, dt_sym, x_sym, obs_eqs, dim_x, dim_err, eskf_params=None, msckf_params=None, # pylint: disable=dangerous-default-value + maha_test_kinds=[], quaternion_idxs=[], global_vars=None, extra_routines=[]): + # optional state transition matrix, H modifier + # and err_function if an error-state kalman filter (ESKF) + # is desired. Best described in "Quaternion kinematics + # for the error-state Kalman filter" by Joan Sola + + if eskf_params: + err_eqs = eskf_params[0] + inv_err_eqs = eskf_params[1] + H_mod_sym = eskf_params[2] + f_err_sym = eskf_params[3] + x_err_sym = eskf_params[4] + else: + nom_x = sp.MatrixSymbol('nom_x', dim_x, 1) + true_x = sp.MatrixSymbol('true_x', dim_x, 1) + delta_x = sp.MatrixSymbol('delta_x', dim_x, 1) + err_function_sym = sp.Matrix(nom_x + delta_x) + inv_err_function_sym = sp.Matrix(true_x - nom_x) + err_eqs = [err_function_sym, nom_x, delta_x] + inv_err_eqs = [inv_err_function_sym, nom_x, true_x] + + H_mod_sym = sp.Matrix(np.eye(dim_x)) + f_err_sym = f_sym + x_err_sym = x_sym + + # This configures the multi-state augmentation + # needed for EKF-SLAM with MSCKF (Mourikis et al 2007) + if msckf_params: + msckf = True + dim_main = msckf_params[0] # size of the main state + dim_augment = msckf_params[1] # size of one augment state chunk + dim_main_err = msckf_params[2] + dim_augment_err = msckf_params[3] + N = msckf_params[4] + feature_track_kinds = msckf_params[5] + assert dim_main + dim_augment * N == dim_x + assert dim_main_err + dim_augment_err * N == dim_err + else: + msckf = False + dim_main = dim_x + dim_augment = 0 + dim_main_err = dim_err + dim_augment_err = 0 + N = 0 + + # linearize with jacobians + F_sym = f_err_sym.jacobian(x_err_sym) + + if eskf_params: + for sym in x_err_sym: + F_sym = F_sym.subs(sym, 0) + + assert dt_sym in F_sym.free_symbols + + for i in range(len(obs_eqs)): + obs_eqs[i].append(obs_eqs[i][0].jacobian(x_sym)) + if msckf and obs_eqs[i][1] in feature_track_kinds: + obs_eqs[i].append(obs_eqs[i][0].jacobian(obs_eqs[i][2])) + else: + obs_eqs[i].append(None) + + # collect sympy functions + sympy_functions = [] + + # extra routines + sympy_functions += extra_routines + + # error functions + sympy_functions.append(('err_fun', err_eqs[0], [err_eqs[1], err_eqs[2]])) + sympy_functions.append(('inv_err_fun', inv_err_eqs[0], [inv_err_eqs[1], inv_err_eqs[2]])) + + # H modifier for ESKF updates + sympy_functions.append(('H_mod_fun', H_mod_sym, [x_sym])) + + # state propagation function + sympy_functions.append(('f_fun', f_sym, [x_sym, dt_sym])) + sympy_functions.append(('F_fun', F_sym, [x_sym, dt_sym])) + + # observation functions + for h_sym, kind, ea_sym, H_sym, He_sym in obs_eqs: + sympy_functions.append(('h_%d' % kind, h_sym, [x_sym, ea_sym])) + sympy_functions.append(('H_%d' % kind, H_sym, [x_sym, ea_sym])) + if msckf and kind in feature_track_kinds: + sympy_functions.append(('He_%d' % kind, He_sym, [x_sym, ea_sym])) + + # Generate and wrap all th c code + sympy_header, code = sympy_into_c(sympy_functions, global_vars) + + header = "#pragma once\n" + header += "#include \"rednose/helpers/common_ekf.h\"\n" + header += "extern \"C\" {\n" + + pre_code = f"#include \"{name}.h\"\n" + pre_code += "\nnamespace {\n" + pre_code += "#define DIM %d\n" % dim_x + pre_code += "#define EDIM %d\n" % dim_err + pre_code += "#define MEDIM %d\n" % dim_main_err + pre_code += "typedef void (*Hfun)(double *, double *, double *);\n" + + if global_vars is not None: + for var in global_vars: + pre_code += f"\ndouble {var.name};\n" + pre_code += f"\nvoid set_{var.name}(double x){{ {var.name} = x;}}\n" + + post_code = "\n}\n" # namespace + post_code += "extern \"C\" {\n\n" + + for h_sym, kind, ea_sym, H_sym, He_sym in obs_eqs: + if msckf and kind in feature_track_kinds: + He_str = 'He_%d' % kind + # ea_dim = ea_sym.shape[0] + else: + He_str = 'NULL' + # ea_dim = 1 # not really dim of ea but makes c function work + maha_thresh = chi2_ppf(0.95, int(h_sym.shape[0])) # mahalanobis distance for outlier detection + maha_test = kind in maha_test_kinds + + pre_code += f"const static double MAHA_THRESH_{kind} = {maha_thresh};\n" + + header += f"void {name}_update_{kind}(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);\n" + post_code += f"void {name}_update_{kind}(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {{\n" + post_code += f" update<{h_sym.shape[0]}, 3, {int(maha_test)}>(in_x, in_P, h_{kind}, H_{kind}, {He_str}, in_z, in_R, in_ea, MAHA_THRESH_{kind});\n" + post_code += "}\n" + + # For ffi loading of specific functions + for line in sympy_header.split("\n"): + if line.startswith("void "): # sympy functions + func_call = line[5: line.index(')') + 1] + header += f"void {name}_{func_call};\n" + post_code += f"void {name}_{func_call} {{\n" + post_code += f" {func_call.replace('double *', '').replace('double', '')};\n" + post_code += "}\n" + header += f"void {name}_predict(double *in_x, double *in_P, double *in_Q, double dt);\n" + post_code += f"void {name}_predict(double *in_x, double *in_P, double *in_Q, double dt) {{\n" + post_code += " predict(in_x, in_P, in_Q, dt);\n" + post_code += "}\n" + if global_vars is not None: + for var in global_vars: + header += f"void {name}_set_{var.name}(double x);\n" + post_code += f"void {name}_set_{var.name}(double x) {{\n" + post_code += f" set_{var.name}(x);\n" + post_code += "}\n" + + post_code += "}\n\n" # extern c + + funcs = ['f_fun', 'F_fun', 'err_fun', 'inv_err_fun', 'H_mod_fun', 'predict'] + func_lists = { + 'h': [kind for _, kind, _, _, _ in obs_eqs], + 'H': [kind for _, kind, _, _, _ in obs_eqs], + 'update': [kind for _, kind, _, _, _ in obs_eqs], + 'He': [kind for _, kind, _, _, _ in obs_eqs if msckf and kind in feature_track_kinds], + 'set': [var.name for var in global_vars] if global_vars is not None else [], + } + func_extra = [x[0] for x in extra_routines] + + # For dynamic loading of specific functions + post_code += f"const EKF {name} = {{\n" + post_code += f" .name = \"{name}\",\n" + post_code += f" .kinds = {{ {', '.join([str(kind) for _, kind, _, _, _ in obs_eqs])} }},\n" + post_code += f" .feature_kinds = {{ {', '.join([str(kind) for _, kind, _, _, _ in obs_eqs if msckf and kind in feature_track_kinds])} }},\n" + for func in funcs: + post_code += f" .{func} = {name}_{func},\n" + for group, kinds in func_lists.items(): + post_code += f" .{group}s = {{\n" + for kind in kinds: + str_kind = f"\"{kind}\"" if type(kind) == str else kind + post_code += f" {{ {str_kind}, {name}_{group}_{kind} }},\n" + post_code += " },\n" + post_code += " .extra_routines = {\n" + for f in func_extra: + post_code += f" {{ \"{f}\", {name}_{f} }},\n" + post_code += " },\n" + post_code += "};\n\n" + post_code += f"ekf_init({name});\n" + + # merge code blocks + header += "}" + code = "\n".join([pre_code, code, open(os.path.join(TEMPLATE_DIR, "ekf_c.c")).read(), post_code]) + + # write to file + if not os.path.exists(folder): + os.mkdir(folder) + + open(os.path.join(folder, f"{name}.h"), 'w').write(header) # header is used for ffi import + open(os.path.join(folder, f"{name}.cpp"), 'w').write(code) + + +class EKF_sym(): + def __init__(self, folder, name, Q, x_initial, P_initial, dim_main, dim_main_err, # pylint: disable=dangerous-default-value + N=0, dim_augment=0, dim_augment_err=0, maha_test_kinds=[], quaternion_idxs=[], global_vars=None, max_rewind_age=1.0, logger=logging): + """Generates process function and all observation functions for the kalman filter.""" + self.msckf = N > 0 + self.N = N + self.dim_augment = dim_augment + self.dim_augment_err = dim_augment_err + self.dim_main = dim_main + self.dim_main_err = dim_main_err + + self.logger = logger + + # state + x_initial = x_initial.reshape((-1, 1)) + self.dim_x = x_initial.shape[0] + self.dim_err = P_initial.shape[0] + assert dim_main + dim_augment * N == self.dim_x + assert dim_main_err + dim_augment_err * N == self.dim_err + assert Q.shape == P_initial.shape + + # kinds that should get mahalanobis distance + # tested for outlier rejection + self.maha_test_kinds = maha_test_kinds + + # quaternions need normalization + self.quaternion_idxs = quaternion_idxs + + # process noise + self.Q = Q + + # rewind stuff + self.max_rewind_age = max_rewind_age + self.rewind_t = [] + self.rewind_states = [] + self.rewind_obscache = [] + self.init_state(x_initial, P_initial, None) + + ffi, lib = load_code(folder, name, "kf") + kinds, self.feature_track_kinds = [], [] + for func in dir(lib): + if func[:len(name) + 3] == f'{name}_h_': + kinds.append(int(func[len(name) + 3:])) + if func[:len(name) + 4] == f'{name}_He_': + self.feature_track_kinds.append(int(func[len(name) + 4:])) + + # wrap all the sympy functions + def wrap_1lists(func_name): + func = eval(f"lib.{name}_{func_name}", {"lib": lib}) # pylint: disable=eval-used + + def ret(lst1, out): + func(ffi.cast("double *", lst1.ctypes.data), + ffi.cast("double *", out.ctypes.data)) + return ret + + def wrap_2lists(func_name): + func = eval(f"lib.{name}_{func_name}", {"lib": lib}) # pylint: disable=eval-used + + def ret(lst1, lst2, out): + func(ffi.cast("double *", lst1.ctypes.data), + ffi.cast("double *", lst2.ctypes.data), + ffi.cast("double *", out.ctypes.data)) + return ret + + def wrap_1list_1float(func_name): + func = eval(f"lib.{name}_{func_name}", {"lib": lib}) # pylint: disable=eval-used + + def ret(lst1, fl, out): + func(ffi.cast("double *", lst1.ctypes.data), + ffi.cast("double", fl), + ffi.cast("double *", out.ctypes.data)) + return ret + + self.f = wrap_1list_1float("f_fun") + self.F = wrap_1list_1float("F_fun") + + self.err_function = wrap_2lists("err_fun") + self.inv_err_function = wrap_2lists("inv_err_fun") + self.H_mod = wrap_1lists("H_mod_fun") + + self.hs, self.Hs, self.Hes = {}, {}, {} + for kind in kinds: + self.hs[kind] = wrap_2lists(f"h_{kind}") + self.Hs[kind] = wrap_2lists(f"H_{kind}") + if self.msckf and kind in self.feature_track_kinds: + self.Hes[kind] = wrap_2lists(f"He_{kind}") + + self.set_globals = {} + if global_vars is not None: + for global_var in global_vars: + self.set_globals[global_var] = getattr(lib, f"{name}_set_{global_var}") + + # wrap the C++ predict function + def _predict_blas(x, P, dt): + func = eval(f"lib.{name}_predict", {"lib": lib}) # pylint: disable=eval-used + func(ffi.cast("double *", x.ctypes.data), + ffi.cast("double *", P.ctypes.data), + ffi.cast("double *", self.Q.ctypes.data), + ffi.cast("double", dt)) + return x, P + + # wrap the C++ update function + def fun_wrapper(f, kind): + f = eval(f"lib.{name}_{f}", {"lib": lib}) # pylint: disable=eval-used + + def _update_inner_blas(x, P, z, R, extra_args): + f(ffi.cast("double *", x.ctypes.data), + ffi.cast("double *", P.ctypes.data), + ffi.cast("double *", z.ctypes.data), + ffi.cast("double *", R.ctypes.data), + ffi.cast("double *", extra_args.ctypes.data)) + if self.msckf and kind in self.feature_track_kinds: + y = z[:-len(extra_args)] + else: + y = z + return x, P, y + return _update_inner_blas + + self._updates = {} + for kind in kinds: + self._updates[kind] = fun_wrapper("update_%d" % kind, kind) + + def _update_blas(x, P, kind, z, R, extra_args=[]): # pylint: disable=dangerous-default-value + return self._updates[kind](x, P, z, R, extra_args) + + # assign the functions + self._predict = _predict_blas + # self._predict = self._predict_python + self._update = _update_blas + # self._update = self._update_python + + def init_state(self, state, covs, filter_time): + self.x = np.array(state.reshape((-1, 1))).astype(np.float64) + self.P = np.array(covs).astype(np.float64) + self.filter_time = filter_time + self.augment_times = [0] * self.N + self.rewind_obscache = [] + self.rewind_t = [] + self.rewind_states = [] + + def reset_rewind(self): + self.rewind_obscache = [] + self.rewind_t = [] + self.rewind_states = [] + + def augment(self): + # TODO this is not a generalized way of doing this and implies that the augmented states + # are simply the first (dim_augment_state) elements of the main state. + assert self.msckf + d1 = self.dim_main + d2 = self.dim_main_err + d3 = self.dim_augment + d4 = self.dim_augment_err + + # push through augmented states + self.x[d1:-d3] = self.x[d1 + d3:] + self.x[-d3:] = self.x[:d3] + assert self.x.shape == (self.dim_x, 1) + + # push through augmented covs + assert self.P.shape == (self.dim_err, self.dim_err) + P_reduced = self.P + P_reduced = np.delete(P_reduced, np.s_[d2:d2 + d4], axis=1) + P_reduced = np.delete(P_reduced, np.s_[d2:d2 + d4], axis=0) + assert P_reduced.shape == (self.dim_err - d4, self.dim_err - d4) + to_mult = np.zeros((self.dim_err, self.dim_err - d4)) + to_mult[:-d4, :] = np.eye(self.dim_err - d4) + to_mult[-d4:, :d4] = np.eye(d4) + self.P = to_mult.dot(P_reduced.dot(to_mult.T)) + self.augment_times = self.augment_times[1:] + self.augment_times.append(self.filter_time) + assert self.P.shape == (self.dim_err, self.dim_err) + + def state(self): + return np.array(self.x).flatten() + + def covs(self): + return self.P + + def set_filter_time(self, t): + self.filter_time = t + + def get_filter_time(self): + return self.filter_time + + def normalize_quaternions(self): + for idx in self.quaternion_idxs: + self.normalize_slice(idx, idx+4) + + def normalize_slice(self, slice_start, slice_end_ex): + self.x[slice_start:slice_end_ex] /= np.linalg.norm(self.x[slice_start:slice_end_ex]) + + def get_augment_times(self): + return self.augment_times + + def set_global(self, global_var, val): + self.set_globals[global_var](val) + + def rewind(self, t): + # find where we are rewinding to + idx = bisect_right(self.rewind_t, t) + assert self.rewind_t[idx - 1] <= t + assert self.rewind_t[idx] > t # must be true, or rewind wouldn't be called + + # set the state to the time right before that + self.filter_time = self.rewind_t[idx - 1] + self.x[:] = self.rewind_states[idx - 1][0] + self.P[:] = self.rewind_states[idx - 1][1] + + # return the observations we rewound over for fast forwarding + ret = self.rewind_obscache[idx:] + + # throw away the old future + # TODO: is this making a copy? + self.rewind_t = self.rewind_t[:idx] + self.rewind_states = self.rewind_states[:idx] + self.rewind_obscache = self.rewind_obscache[:idx] + + return ret + + def checkpoint(self, obs): + # push to rewinder + self.rewind_t.append(self.filter_time) + self.rewind_states.append((np.copy(self.x), np.copy(self.P))) + self.rewind_obscache.append(obs) + + # only keep a certain number around + REWIND_TO_KEEP = 512 + self.rewind_t = self.rewind_t[-REWIND_TO_KEEP:] + self.rewind_states = self.rewind_states[-REWIND_TO_KEEP:] + self.rewind_obscache = self.rewind_obscache[-REWIND_TO_KEEP:] + + def predict(self, t): + # initialize time + if self.filter_time is None: + self.filter_time = t + + # predict + dt = t - self.filter_time + assert dt >= 0 + self.x, self.P = self._predict(self.x, self.P, dt) + self.normalize_quaternions() + self.filter_time = t + + def predict_and_update_batch(self, t, kind, z, R, extra_args=[[]], augment=False): # pylint: disable=dangerous-default-value + # TODO handle rewinding at this level" + + # rewind + if self.filter_time is not None and t < self.filter_time: + if len(self.rewind_t) == 0 or t < self.rewind_t[0] or t < self.rewind_t[-1] - self.max_rewind_age: + self.logger.error("observation too old at %.3f with filter at %.3f, ignoring" % (t, self.filter_time)) + return None + rewound = self.rewind(t) + else: + rewound = [] + + ret = self._predict_and_update_batch(t, kind, z, R, extra_args, augment) + + # optional fast forward + for r in rewound: + self._predict_and_update_batch(*r) + + return ret + + def _predict_and_update_batch(self, t, kind, z, R, extra_args, augment=False): + """The main kalman filter function + Predicts the state and then updates a batch of observations + dim_x: dimensionality of the state space + dim_z: dimensionality of the observation and depends on kind + n: number of observations + Args: + t (float): Time of observation + kind (int): Type of observation + z (vec [n,dim_z]): Measurements + R (mat [n,dim_z, dim_z]): Measurement Noise + extra_args (list, [n]): Values used in H computations + """ + assert z.shape[0] == R.shape[0] + assert z.shape[1] == R.shape[1] + assert z.shape[1] == R.shape[2] + + # initialize time + if self.filter_time is None: + self.filter_time = t + + # predict + dt = t - self.filter_time + assert dt >= 0 + self.x, self.P = self._predict(self.x, self.P, dt) + self.filter_time = t + xk_km1, Pk_km1 = np.copy(self.x).flatten(), np.copy(self.P) + + # update batch + y = [] + for i in range(len(z)): + # these are from the user, so we canonicalize them + z_i = np.array(z[i], dtype=np.float64, order='F') + R_i = np.array(R[i], dtype=np.float64, order='F') + extra_args_i = np.array(extra_args[i], dtype=np.float64, order='F') + # update + self.x, self.P, y_i = self._update(self.x, self.P, kind, z_i, R_i, extra_args=extra_args_i) + self.normalize_quaternions() + y.append(y_i) + xk_k, Pk_k = np.copy(self.x).flatten(), np.copy(self.P) + + if augment: + self.augment() + + # checkpoint + self.checkpoint((t, kind, z, R, extra_args)) + + return xk_km1, xk_k, Pk_km1, Pk_k, t, kind, y, z, extra_args + + def _predict_python(self, x, P, dt): + x_new = np.zeros(x.shape, dtype=np.float64) + self.f(x, dt, x_new) + + F = np.zeros(P.shape, dtype=np.float64) + self.F(x, dt, F) + + if not self.msckf: + P = dot(dot(F, P), F.T) + else: + # Update the predicted state covariance: + # Pk+1|k = |F*Pii*FT + Q*dt F*Pij | + # |PijT*FT Pjj | + # Where F is the jacobian of the main state + # predict function, Pii is the main state's + # covariance and Q its process noise. Pij + # is the covariance between the augmented + # states and the main state. + # + d2 = self.dim_main_err # known at compile time + F_curr = F[:d2, :d2] + P[:d2, :d2] = (F_curr.dot(P[:d2, :d2])).dot(F_curr.T) + P[:d2, d2:] = F_curr.dot(P[:d2, d2:]) + P[d2:, :d2] = P[d2:, :d2].dot(F_curr.T) + + P += dt * self.Q + return x_new, P + + def _update_python(self, x, P, kind, z, R, extra_args=[]): # pylint: disable=dangerous-default-value + # init vars + z = z.reshape((-1, 1)) + h = np.zeros(z.shape, dtype=np.float64) + H = np.zeros((z.shape[0], self.dim_x), dtype=np.float64) + + # C functions + self.hs[kind](x, extra_args, h) + self.Hs[kind](x, extra_args, H) + + # y is the "loss" + y = z - h + + # *** same above this line *** + + if self.msckf and kind in self.Hes: + # Do some algebraic magic to decorrelate + He = np.zeros((z.shape[0], len(extra_args)), dtype=np.float64) + self.Hes[kind](x, extra_args, He) + + # TODO: Don't call a function here, do projection locally + A = null(He.T) + + y = A.T.dot(y) + H = A.T.dot(H) + R = A.T.dot(R.dot(A)) + + # TODO If nullspace isn't the dimension we want + if A.shape[1] + He.shape[1] != A.shape[0]: + self.logger.warning('Warning: null space projection failed, measurement ignored') + return x, P, np.zeros(A.shape[0] - He.shape[1]) + + # if using eskf + H_mod = np.zeros((x.shape[0], P.shape[0]), dtype=np.float64) + self.H_mod(x, H_mod) + H = H.dot(H_mod) + + # Do mahalobis distance test + # currently just runs on msckf observations + # could run on anything if needed + if self.msckf and kind in self.maha_test_kinds: + a = np.linalg.inv(H.dot(P).dot(H.T) + R) + maha_dist = y.T.dot(a.dot(y)) + if maha_dist > chi2_ppf(0.95, y.shape[0]): + R = 10e16 * R + + # *** same below this line *** + + # Outlier resilient weighting as described in: + # "A Kalman Filter for Robust Outlier Detection - Jo-Anne Ting, ..." + weight = 1 # (1.5)/(1 + np.sum(y**2)/np.sum(R)) + + S = dot(dot(H, P), H.T) + R / weight + K = solve(S, dot(H, P.T)).T + I_KH = np.eye(P.shape[0]) - dot(K, H) + + # update actual state + delta_x = dot(K, y) + P = dot(dot(I_KH, P), I_KH.T) + dot(dot(K, R), K.T) + + # inject observed error into state + x_new = np.zeros(x.shape, dtype=np.float64) + self.err_function(x, delta_x, x_new) + return x_new, P, y.flatten() + + def maha_test(self, x, P, kind, z, R, extra_args=[], maha_thresh=0.95): # pylint: disable=dangerous-default-value + # init vars + z = z.reshape((-1, 1)) + h = np.zeros(z.shape, dtype=np.float64) + H = np.zeros((z.shape[0], self.dim_x), dtype=np.float64) + + # C functions + self.hs[kind](x, extra_args, h) + self.Hs[kind](x, extra_args, H) + + # y is the "loss" + y = z - h + + # if using eskf + H_mod = np.zeros((x.shape[0], P.shape[0]), dtype=np.float64) + self.H_mod(x, H_mod) + H = H.dot(H_mod) + + a = np.linalg.inv(H.dot(P).dot(H.T) + R) + maha_dist = y.T.dot(a.dot(y)) + if maha_dist > chi2_ppf(maha_thresh, y.shape[0]): + return False + else: + return True + + def rts_smooth(self, estimates, norm_quats=False): + ''' + Returns rts smoothed results of + kalman filter estimates + If the kalman state is augmented with + old states only the main state is smoothed + ''' + xk_n = estimates[-1][0] + Pk_n = estimates[-1][2] + Fk_1 = np.zeros(Pk_n.shape, dtype=np.float64) + + states_smoothed = [xk_n] + covs_smoothed = [Pk_n] + for k in range(len(estimates) - 2, -1, -1): + xk1_n = xk_n + if norm_quats: + xk1_n[3:7] /= np.linalg.norm(xk1_n[3:7]) + Pk1_n = Pk_n + + xk1_k, _, Pk1_k, _, t2, _, _, _, _ = estimates[k + 1] + _, xk_k, _, Pk_k, t1, _, _, _, _ = estimates[k] + dt = t2 - t1 + self.F(xk_k, dt, Fk_1) + + d1 = self.dim_main + d2 = self.dim_main_err + Ck = np.linalg.solve(Pk1_k[:d2, :d2], Fk_1[:d2, :d2].dot(Pk_k[:d2, :d2].T)).T + xk_n = xk_k + delta_x = np.zeros((Pk_n.shape[0], 1), dtype=np.float64) + self.inv_err_function(xk1_k, xk1_n, delta_x) + delta_x[:d2] = Ck.dot(delta_x[:d2]) + x_new = np.zeros((xk_n.shape[0], 1), dtype=np.float64) + self.err_function(xk_k, delta_x, x_new) + xk_n[:d1] = x_new[:d1, 0] + Pk_n = Pk_k + Pk_n[:d2, :d2] = Pk_k[:d2, :d2] + Ck.dot(Pk1_n[:d2, :d2] - Pk1_k[:d2, :d2]).dot(Ck.T) + states_smoothed.append(xk_n) + covs_smoothed.append(Pk_n) + + return np.flipud(np.vstack(states_smoothed)), np.stack(covs_smoothed, 0)[::-1] diff --git a/rednose/helpers/ekf_sym_pyx.cpp b/rednose/helpers/ekf_sym_pyx.cpp new file mode 100644 index 000000000..189c13890 --- /dev/null +++ b/rednose/helpers/ekf_sym_pyx.cpp @@ -0,0 +1,28140 @@ +/* Generated by Cython 0.29.26 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "rednose/helpers/ekf_sym.h" + ], + "language": "c++", + "name": "helpers.ekf_sym_pyx", + "sources": [ + "/data/openpilot/rednose/helpers/ekf_sym_pyx.pyx" + ] + }, + "module_name": "helpers.ekf_sym_pyx" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_26" +#define CYTHON_HEX_VERSION 0x001D1AF0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } + private: + T *ptr; +}; + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject* co=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(0))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too; + if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here + if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too; + Py_XDECREF((PyObject*)co); + co = (PyCodeObject*)call_result; + call_result = NULL; + if (0) { + cleanup_code_too: + Py_XDECREF((PyObject*)co); + co = NULL; + } + end: + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(call_result); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return co; + } +#else + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if defined(PyUnicode_IS_READY) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #else + #define __Pyx_PyUnicode_READY(op) (0) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__helpers__ekf_sym_pyx +#define __PYX_HAVE_API__helpers__ekf_sym_pyx +/* Early includes */ +#include +#include +#include "ios" +#include "new" +#include "stdexcept" +#include "typeinfo" +#include +#include +#include "numpy/arrayobject.h" +#include "numpy/ndarrayobject.h" +#include "numpy/ndarraytypes.h" +#include "numpy/arrayscalars.h" +#include "numpy/ufuncobject.h" + + /* NumPy API declarations from "numpy/__init__.pxd" */ + +#include +#include "rednose/helpers/ekf_sym.h" +#include "pythread.h" +#include +#include "pystate.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +/* Header.proto */ +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "rednose/helpers/ekf_sym_pyx.pyx", + "stringsource", + "__init__.pxd", + "type.pxd", +}; +/* MemviewSliceStruct.proto */ +struct __pyx_memoryview_obj; +typedef struct { + struct __pyx_memoryview_obj *memview; + char *data; + Py_ssize_t shape[8]; + Py_ssize_t strides[8]; + Py_ssize_t suboffsets[8]; +} __Pyx_memviewslice; +#define __Pyx_MemoryView_Len(m) (m.shape[0]) + +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __pyx_atomic_int_type int +#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\ + !defined(__i386__) + #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0 + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type LONG + #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 + #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using Intel atomics" + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #warning "Not using atomics" + #endif +#endif +typedef volatile __pyx_atomic_int_type __pyx_atomic_int; +#if CYTHON_ATOMICS + #define __pyx_add_acquisition_count(memview)\ + __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) +#else + #define __pyx_add_acquisition_count(memview)\ + __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) +#endif + +/* BufferFormatStructs.proto */ +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; + struct __Pyx_StructField_* fields; + size_t size; + size_t arraysize[8]; + int ndim; + char typegroup; + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":690 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":691 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":692 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":693 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":697 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":698 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":699 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":700 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":704 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":705 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":714 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":715 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":716 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":718 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":719 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":720 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":722 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":723 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":725 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":726 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":727 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + + +/*--- Type declarations ---*/ +struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym; +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":729 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":730 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":731 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":733 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* "helpers/ekf_sym_pyx.pyx":81 + * return np.copy(np.asarray(mem_view, dtype=np.double, order="C")) + * + * cdef class EKF_sym: # <<<<<<<<<<<<<< + * cdef EKFSym* ekf + * def __cinit__(self, str gen_dir, str name, np.ndarray[np.float64_t, ndim=2] Q, + */ +struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym { + PyObject_HEAD + EKFS::EKFSym *ekf; +}; + + +/* "View.MemoryView":105 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_array_obj { + PyObject_HEAD + struct __pyx_vtabstruct_array *__pyx_vtab; + char *data; + Py_ssize_t len; + char *format; + int ndim; + Py_ssize_t *_shape; + Py_ssize_t *_strides; + Py_ssize_t itemsize; + PyObject *mode; + PyObject *_format; + void (*callback_free_data)(void *); + int free_data; + int dtype_is_object; +}; + + +/* "View.MemoryView":279 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":330 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ +struct __pyx_memoryview_obj { + PyObject_HEAD + struct __pyx_vtabstruct_memoryview *__pyx_vtab; + PyObject *obj; + PyObject *_size; + PyObject *_array_interface; + PyThread_type_lock lock; + __pyx_atomic_int acquisition_count[2]; + __pyx_atomic_int *acquisition_count_aligned_p; + Py_buffer view; + int flags; + int dtype_is_object; + __Pyx_TypeInfo *typeinfo; +}; + + +/* "View.MemoryView":965 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ +struct __pyx_memoryviewslice_obj { + struct __pyx_memoryview_obj __pyx_base; + __Pyx_memviewslice from_slice; + PyObject *from_object; + PyObject *(*to_object_func)(char *); + int (*to_dtype_func)(char *, PyObject *); +}; + + + +/* "View.MemoryView":105 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_array { + PyObject *(*get_memview)(struct __pyx_array_obj *); +}; +static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; + + +/* "View.MemoryView":330 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ + +struct __pyx_vtabstruct_memoryview { + char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); + PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); +}; +static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; + + +/* "View.MemoryView":965 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ + +struct __pyx_vtabstruct__memoryviewslice { + struct __pyx_vtabstruct_memoryview __pyx_base; +}; +static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* Profile.proto */ +#ifndef CYTHON_PROFILE +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON + #define CYTHON_PROFILE 0 +#else + #define CYTHON_PROFILE 1 +#endif +#endif +#ifndef CYTHON_TRACE_NOGIL + #define CYTHON_TRACE_NOGIL 0 +#else + #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) + #define CYTHON_TRACE 1 + #endif +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL(frame) + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) + #endif + #define __Pyx_TraceDeclarations\ + static PyCodeObject *__pyx_frame_code = NULL;\ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceFrameInit(codeobj)\ + if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; +#if PY_VERSION_HEX >= 0x030b00a2 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) + #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) +#elif PY_VERSION_HEX >= 0x030a00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#endif + #ifdef WITH_THREAD + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + }\ + PyGILState_Release(state);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #else + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + { PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #endif + #define __Pyx_TraceException()\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 1)) {\ + __Pyx_EnterTracing(tstate);\ + PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ + if (exc_info) {\ + if (CYTHON_TRACE && tstate->c_tracefunc)\ + tstate->c_tracefunc(\ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + tstate->c_profilefunc(\ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + Py_DECREF(exc_info);\ + }\ + __Pyx_LeaveTracing(tstate);\ + }\ + } + static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_EnterTracing(tstate); + if (CYTHON_TRACE && tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); + if (tstate->c_profilefunc) + tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); + CYTHON_FRAME_DEL(frame); + __Pyx_LeaveTracing(tstate); + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } + #ifdef WITH_THREAD + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + PyGILState_Release(state);\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + }\ + } + #else + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + } + #endif + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceFrameInit(codeobj) + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result, nogil) +#endif +#if CYTHON_TRACE + static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { + int ret; + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_PyFrame_SetLineNumber(frame, lineno); + __Pyx_EnterTracing(tstate); + ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); + __Pyx_LeaveTracing(tstate); + if (likely(!ret)) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + } + return ret; + } + #ifdef WITH_THREAD + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + int ret = 0;\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + }\ + PyGILState_Release(state);\ + if (unlikely(ret)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + }\ + } + #else + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + } + #endif +#else + #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; +#endif + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if CYTHON_FAST_PYCALL + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif // CYTHON_FAST_PYCALL +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* MemviewSliceInit.proto */ +#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d +#define __Pyx_MEMVIEW_DIRECT 1 +#define __Pyx_MEMVIEW_PTR 2 +#define __Pyx_MEMVIEW_FULL 4 +#define __Pyx_MEMVIEW_CONTIG 8 +#define __Pyx_MEMVIEW_STRIDED 16 +#define __Pyx_MEMVIEW_FOLLOW 32 +#define __Pyx_IS_C_CONTIG 1 +#define __Pyx_IS_F_CONTIG 2 +static int __Pyx_init_memviewslice( + struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference); +static CYTHON_INLINE int __pyx_add_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +static CYTHON_INLINE int __pyx_sub_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) +#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) +#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) +#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) +static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* IsLittleEndian.proto */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); + +/* BufferFormatCheck.proto */ +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* BufferGetAndValidate.proto */ +#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\ + ((obj == Py_None || obj == NULL) ?\ + (__Pyx_ZeroBuffer(buf), 0) :\ + __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)) +static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static void __Pyx_ZeroBuffer(Py_buffer* buf); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); +static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 }; +static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* BufferFallbackError.proto */ +static void __Pyx_RaiseBufferFallbackError(void); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* None.proto */ +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); + +/* UnaryNegOverflows.proto */ +#define UNARY_NEG_WOULD_OVERFLOW(x)\ + (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/ +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* decode_c_string_utf16.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 0; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = -1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} + +/* decode_c_string.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + +/* ListExtend.proto */ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject* none = _PyList_Extend((PyListObject*)L, v); + if (unlikely(!none)) + return -1; + Py_DECREF(none); + return 0; +#else + return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); +#endif +} + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* None.proto */ +static CYTHON_INLINE long __Pyx_div_long(long, long); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* StringJoin.proto */ +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); +#endif + +/* PyObject_Unicode.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyObject_Unicode(obj)\ + (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) +#else +#define __Pyx_PyObject_Unicode(obj)\ + (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj)) +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +/* BufferStructDeclare.proto */ +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +/* MemviewSliceIsContig.proto */ +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim); + +/* OverlappingSlices.proto */ +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +/* Capsule.proto */ +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +/* GCCDiagnostics.proto */ +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* TypeInfoCompare.proto */ +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +/* MemviewSliceValidateAndInit.proto */ +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_double(PyObject *, int writable_flag); + +/* MemviewDtypeToObject.proto */ +static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp); +static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag); + +/* CppExceptionConversion.proto */ +#ifndef __Pyx_CppExn2PyErr +#include +#include +#include +#include +static void __Pyx_CppExn2PyErr() { + try { + if (PyErr_Occurred()) + ; // let the latest Python exn pass through and ignore the current one + else + throw; + } catch (const std::bad_alloc& exn) { + PyErr_SetString(PyExc_MemoryError, exn.what()); + } catch (const std::bad_cast& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::bad_typeid& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::domain_error& exn) { + PyErr_SetString(PyExc_ValueError, exn.what()); + } catch (const std::invalid_argument& exn) { + PyErr_SetString(PyExc_ValueError, exn.what()); + } catch (const std::ios_base::failure& exn) { + PyErr_SetString(PyExc_IOError, exn.what()); + } catch (const std::out_of_range& exn) { + PyErr_SetString(PyExc_IndexError, exn.what()); + } catch (const std::overflow_error& exn) { + PyErr_SetString(PyExc_OverflowError, exn.what()); + } catch (const std::range_error& exn) { + PyErr_SetString(PyExc_ArithmeticError, exn.what()); + } catch (const std::underflow_error& exn) { + PyErr_SetString(PyExc_ArithmeticError, exn.what()); + } catch (const std::exception& exn) { + PyErr_SetString(PyExc_RuntimeError, exn.what()); + } + catch (...) + { + PyErr_SetString(PyExc_RuntimeError, "Unknown exception"); + } +} +#endif + +/* RealImag.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if defined(__cplusplus) && CYTHON_CCOMPLEX\ + && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_float(a, b) ((a)==(b)) + #define __Pyx_c_sum_float(a, b) ((a)+(b)) + #define __Pyx_c_diff_float(a, b) ((a)-(b)) + #define __Pyx_c_prod_float(a, b) ((a)*(b)) + #define __Pyx_c_quot_float(a, b) ((a)/(b)) + #define __Pyx_c_neg_float(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_float(z) ((z)==(float)0) + #define __Pyx_c_conj_float(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_float(z) (::std::abs(z)) + #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_float(z) ((z)==0) + #define __Pyx_c_conj_float(z) (conjf(z)) + #if 1 + #define __Pyx_c_abs_float(z) (cabsf(z)) + #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_double(a, b) ((a)==(b)) + #define __Pyx_c_sum_double(a, b) ((a)+(b)) + #define __Pyx_c_diff_double(a, b) ((a)-(b)) + #define __Pyx_c_prod_double(a, b) ((a)*(b)) + #define __Pyx_c_quot_double(a, b) ((a)/(b)) + #define __Pyx_c_neg_double(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_double(z) ((z)==(double)0) + #define __Pyx_c_conj_double(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (::std::abs(z)) + #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_double(z) ((z)==0) + #define __Pyx_c_conj_double(z) (conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (cabs(z)) + #define __Pyx_c_pow_double(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +/* MemviewSliceCopyTemplate.proto */ +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object); + +/* TypeInfoToFormat.proto */ +struct __pyx_typeinfo_string { + char string[3]; +}; +static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/ +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/ +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/ +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ + +/* Module declarations from 'cython.view' */ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libcpp.string' */ + +/* Module declarations from 'libcpp.vector' */ + +/* Module declarations from 'libcpp' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_generic = 0; +static PyTypeObject *__pyx_ptype_5numpy_number = 0; +static PyTypeObject *__pyx_ptype_5numpy_integer = 0; +static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_inexact = 0; +static PyTypeObject *__pyx_ptype_5numpy_floating = 0; +static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0; +static PyTypeObject *__pyx_ptype_5numpy_flexible = 0; +static PyTypeObject *__pyx_ptype_5numpy_character = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; + +/* Module declarations from 'helpers.ekf_sym_pyx' */ +static PyTypeObject *__pyx_ptype_7helpers_11ekf_sym_pyx_EKF_sym = 0; +static PyTypeObject *__pyx_array_type = 0; +static PyTypeObject *__pyx_MemviewEnum_type = 0; +static PyTypeObject *__pyx_memoryview_type = 0; +static PyTypeObject *__pyx_memoryviewslice_type = 0; +static PyObject *generic = 0; +static PyObject *strided = 0; +static PyObject *indirect = 0; +static PyObject *contiguous = 0; +static PyObject *indirect_contiguous = 0; +static int __pyx_memoryview_thread_locks_used; +static PyThread_type_lock __pyx_memoryview_thread_locks[8]; +static PyArrayObject *__pyx_f_7helpers_11ekf_sym_pyx_matrix_to_numpy(Eigen::Matrix); /*proto*/ +static PyArrayObject *__pyx_f_7helpers_11ekf_sym_pyx_vector_to_numpy(Eigen::VectorXd); /*proto*/ +static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/ +static std::vector __pyx_convert_vector_from_py_int(PyObject *); /*proto*/ +static std::vector __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *); /*proto*/ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ +static void *__pyx_align_pointer(void *, size_t); /*proto*/ +static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/ +static PyObject *_unellipsify(PyObject *, int); /*proto*/ +static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/ +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/ +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/ +static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/ +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/ +static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/ +static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/ +static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/ +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/ +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/ +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/ +static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/ +static int __pyx_memoryview_err(PyObject *, char *); /*proto*/ +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/ +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ +static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/ +static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +#define __Pyx_MODULE_NAME "helpers.ekf_sym_pyx" +extern int __pyx_module_is_main_helpers__ekf_sym_pyx; +int __pyx_module_is_main_helpers__ekf_sym_pyx = 0; + +/* Implementation of 'helpers.ekf_sym_pyx' */ +static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_Ellipsis; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_IndexError; +static const char __pyx_k_C[] = "C"; +static const char __pyx_k_N[] = "N"; +static const char __pyx_k_O[] = "O"; +static const char __pyx_k_P[] = "P"; +static const char __pyx_k_Q[] = "Q"; +static const char __pyx_k_R[] = "R"; +static const char __pyx_k_T[] = "T{"; + static const char __pyx_k_c[] = "c"; + static const char __pyx_k_s[] = "(%s)"; + static const char __pyx_k_t[] = "t"; + static const char __pyx_k_x[] = "x"; + static const char __pyx_k_z[] = "z"; + static const char __pyx_k_id[] = "id"; + static const char __pyx_k_np[] = "np"; + static const char __pyx_k__29[] = "^"; + static const char __pyx_k__30[] = ""; + static const char __pyx_k__31[] = ":"; +static const char __pyx_k__32[] = "}"; +static const char __pyx_k__33[] = ","; +static const char __pyx_k_nan[] = "nan"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_obj[] = "obj"; +static const char __pyx_k_val[] = "val"; +static const char __pyx_k_base[] = "base"; +static const char __pyx_k_copy[] = "copy"; +static const char __pyx_k_covs[] = "covs"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_join[] = "join"; +static const char __pyx_k_kind[] = "kind"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_mode[] = "mode"; +static const char __pyx_k_name[] = "name"; +static const char __pyx_k_ndim[] = "ndim"; +static const char __pyx_k_pack[] = "pack"; +static const char __pyx_k_size[] = "size"; +static const char __pyx_k_step[] = "step"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_utf8[] = "utf8"; +static const char __pyx_k_ASCII[] = "ASCII"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_dtype[] = "dtype"; +static const char __pyx_k_error[] = "error"; +static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_order[] = "order"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_shape[] = "shape"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_state[] = "state"; +static const char __pyx_k_double[] = "double"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_format[] = "format"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_logger[] = "logger"; +static const char __pyx_k_name_2[] = "__name__"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_struct[] = "struct"; +static const char __pyx_k_unpack[] = "unpack"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_EKF_sym[] = "EKF_sym"; +static const char __pyx_k_asarray[] = "asarray"; +static const char __pyx_k_augment[] = "augment"; +static const char __pyx_k_fortran[] = "fortran"; +static const char __pyx_k_gen_dir[] = "gen_dir"; +static const char __pyx_k_memview[] = "memview"; +static const char __pyx_k_Ellipsis[] = "Ellipsis"; +static const char __pyx_k_dim_main[] = "dim_main"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_P_initial[] = "P_initial"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_estimates[] = "estimates"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_x_initial[] = "x_initial"; +static const char __pyx_k_IndexError[] = "IndexError"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_extra_args[] = "extra_args"; +static const char __pyx_k_global_var[] = "global_var"; +static const char __pyx_k_norm_quats[] = "norm_quats"; +static const char __pyx_k_pyx_result[] = "__pyx_result"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; +static const char __pyx_k_dim_augment[] = "dim_augment"; +static const char __pyx_k_filter_time[] = "filter_time"; +static const char __pyx_k_global_vars[] = "global_vars"; +static const char __pyx_k_maha_thresh[] = "maha_thresh"; +static const char __pyx_k_dim_main_err[] = "dim_main_err"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_stringsource[] = "stringsource"; +static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_max_rewind_age[] = "max_rewind_age"; +static const char __pyx_k_View_MemoryView[] = "View.MemoryView"; +static const char __pyx_k_allocate_buffer[] = "allocate_buffer"; +static const char __pyx_k_dim_augment_err[] = "dim_augment_err"; +static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; +static const char __pyx_k_maha_test_kinds[] = "maha_test_kinds"; +static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; +static const char __pyx_k_quaternion_idxs[] = "quaternion_idxs"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_strided_and_direct[] = ""; +static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; +static const char __pyx_k_strided_and_indirect[] = ""; +static const char __pyx_k_contiguous_and_direct[] = ""; +static const char __pyx_k_MemoryView_of_r_object[] = ""; +static const char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; +static const char __pyx_k_contiguous_and_indirect[] = ""; +static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; +static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; +static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; +static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; +static const char __pyx_k_strided_and_direct_or_indirect[] = ""; +static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; +static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; +static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; +static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview"; +static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview"; +static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))"; +static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; +static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; +static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; +static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; +static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; +static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; +static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; +static PyObject *__pyx_n_s_ASCII; +static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; +static PyObject *__pyx_n_u_C; +static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; +static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor; +static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi; +static PyObject *__pyx_kp_s_Cannot_index_with_type_s; +static PyObject *__pyx_n_s_EKF_sym; +static PyObject *__pyx_n_s_Ellipsis; +static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; +static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; +static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; +static PyObject *__pyx_kp_s_MemoryView_of_r_object; +static PyObject *__pyx_n_s_N; +static PyObject *__pyx_n_s_NotImplementedError; +static PyObject *__pyx_n_b_O; +static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; +static PyObject *__pyx_n_s_P; +static PyObject *__pyx_n_s_P_initial; +static PyObject *__pyx_n_s_PickleError; +static PyObject *__pyx_n_s_Q; +static PyObject *__pyx_n_s_R; +static PyObject *__pyx_kp_b_T; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; +static PyObject *__pyx_kp_b__29; +static PyObject *__pyx_kp_b__30; +static PyObject *__pyx_kp_b__31; +static PyObject *__pyx_kp_b__32; +static PyObject *__pyx_kp_u__33; +static PyObject *__pyx_n_s_allocate_buffer; +static PyObject *__pyx_n_s_asarray; +static PyObject *__pyx_n_s_ascontiguousarray; +static PyObject *__pyx_n_s_augment; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_kp_s_contiguous_and_direct; +static PyObject *__pyx_kp_s_contiguous_and_indirect; +static PyObject *__pyx_n_s_copy; +static PyObject *__pyx_n_s_covs; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_dim_augment; +static PyObject *__pyx_n_s_dim_augment_err; +static PyObject *__pyx_n_s_dim_main; +static PyObject *__pyx_n_s_dim_main_err; +static PyObject *__pyx_n_s_double; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dtype_is_object; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_estimates; +static PyObject *__pyx_n_s_extra_args; +static PyObject *__pyx_n_s_filter_time; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_n_s_gen_dir; +static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_n_s_global_var; +static PyObject *__pyx_n_s_global_vars; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_itemsize; +static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_kind; +static PyObject *__pyx_n_s_logger; +static PyObject *__pyx_n_s_maha_test_kinds; +static PyObject *__pyx_n_s_maha_thresh; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_max_rewind_age; +static PyObject *__pyx_n_s_memview; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_nan; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; +static PyObject *__pyx_n_s_norm_quats; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to; +static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_order; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_pyx_PickleError; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_result; +static PyObject *__pyx_n_s_pyx_state; +static PyObject *__pyx_n_s_pyx_type; +static PyObject *__pyx_n_s_pyx_unpickle_Enum; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_quaternion_idxs; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_reduce_ex; +static PyObject *__pyx_kp_u_s; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_state; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_kp_s_strided_and_direct; +static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; +static PyObject *__pyx_kp_s_strided_and_indirect; +static PyObject *__pyx_kp_s_stringsource; +static PyObject *__pyx_n_s_struct; +static PyObject *__pyx_n_s_t; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_kp_s_unable_to_allocate_array_data; +static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; +static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_n_u_utf8; +static PyObject *__pyx_n_s_val; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_n_s_x_initial; +static PyObject *__pyx_n_s_z; +static int __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym___cinit__(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_gen_dir, PyObject *__pyx_v_name, PyArrayObject *__pyx_v_Q, PyArrayObject *__pyx_v_x_initial, PyArrayObject *__pyx_v_P_initial, int __pyx_v_dim_main, int __pyx_v_dim_main_err, int __pyx_v_N, int __pyx_v_dim_augment, int __pyx_v_dim_augment_err, PyObject *__pyx_v_maha_test_kinds, PyObject *__pyx_v_quaternion_idxs, PyObject *__pyx_v_global_vars, double __pyx_v_max_rewind_age, CYTHON_UNUSED PyObject *__pyx_v_logger); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_2init_state(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, PyArrayObject *__pyx_v_state, PyArrayObject *__pyx_v_covs, PyObject *__pyx_v_filter_time); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_4state(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_6covs(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_8set_filter_time(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, double __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_10get_filter_time(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_12set_global(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, PyObject *__pyx_v_global_var, double __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_14reset_rewind(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_16predict(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, double __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_18predict_and_update_batch(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, double __pyx_v_t, int __pyx_v_kind, PyObject *__pyx_v_z, PyObject *__pyx_v_R, PyObject *__pyx_v_extra_args, bool __pyx_v_augment); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_20augment(CYTHON_UNUSED struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_22get_augment_times(CYTHON_UNUSED struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_24rts_smooth(CYTHON_UNUSED struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_estimates, CYTHON_UNUSED PyObject *__pyx_v_norm_quats); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_26maha_test(CYTHON_UNUSED struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_P, CYTHON_UNUSED PyObject *__pyx_v_kind, CYTHON_UNUSED PyObject *__pyx_v_z, CYTHON_UNUSED PyObject *__pyx_v_R, CYTHON_UNUSED PyObject *__pyx_v_extra_args, CYTHON_UNUSED PyObject *__pyx_v_maha_thresh); /* proto */ +static void __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_28__dealloc__(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */ +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_7helpers_11ekf_sym_pyx_EKF_sym(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_float_0_95; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_184977713; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_k_; +static PyObject *__pyx_k__2; +static PyObject *__pyx_k__3; +static PyObject *__pyx_k__4; +static PyObject *__pyx_k__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_slice__24; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_codeobj__28; +/* Late includes */ + +/* "helpers/ekf_sym_pyx.pyx":71 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cdef np.ndarray[np.float64_t, ndim=2, mode="c"] matrix_to_numpy(MatrixXdr arr): # <<<<<<<<<<<<<< + * cdef double[:,:] mem_view = arr.data() + * return np.copy(np.asarray(mem_view, dtype=np.double, order="C")) + */ + +static PyArrayObject *__pyx_f_7helpers_11ekf_sym_pyx_matrix_to_numpy(Eigen::Matrix __pyx_v_arr) { + __Pyx_memviewslice __pyx_v_mem_view = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + double *__pyx_t_1; + struct __pyx_array_obj *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("matrix_to_numpy", 0); + __Pyx_TraceCall("matrix_to_numpy", __pyx_f[0], 71, 0, __PYX_ERR(0, 71, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":72 + * @cython.boundscheck(False) + * cdef np.ndarray[np.float64_t, ndim=2, mode="c"] matrix_to_numpy(MatrixXdr arr): + * cdef double[:,:] mem_view = arr.data() # <<<<<<<<<<<<<< + * return np.copy(np.asarray(mem_view, dtype=np.double, order="C")) + * + */ + __pyx_t_1 = __pyx_v_arr.data(); + if (!__pyx_t_1) { + PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); + __PYX_ERR(0, 72, __pyx_L1_error) + } + __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_arr.rows()), ((Py_ssize_t)__pyx_v_arr.cols())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_array_new(__pyx_t_3, sizeof(double), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_t_1); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(((PyObject *)__pyx_t_2), PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_mem_view = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "helpers/ekf_sym_pyx.pyx":73 + * cdef np.ndarray[np.float64_t, ndim=2, mode="c"] matrix_to_numpy(MatrixXdr arr): + * cdef double[:,:] mem_view = arr.data() + * return np.copy(np.asarray(mem_view, dtype=np.double, order="C")) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_mem_view, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_double); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_r = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "helpers/ekf_sym_pyx.pyx":71 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cdef np.ndarray[np.float64_t, ndim=2, mode="c"] matrix_to_numpy(MatrixXdr arr): # <<<<<<<<<<<<<< + * cdef double[:,:] mem_view = arr.data() + * return np.copy(np.asarray(mem_view, dtype=np.double, order="C")) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(((PyObject *)__pyx_t_2)); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("helpers.ekf_sym_pyx.matrix_to_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_mem_view, 1); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":77 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cdef np.ndarray[np.float64_t, ndim=1, mode="c"] vector_to_numpy(VectorXd arr): # <<<<<<<<<<<<<< + * cdef double[:] mem_view = arr.data() + * return np.copy(np.asarray(mem_view, dtype=np.double, order="C")) + */ + +static PyArrayObject *__pyx_f_7helpers_11ekf_sym_pyx_vector_to_numpy(Eigen::VectorXd __pyx_v_arr) { + __Pyx_memviewslice __pyx_v_mem_view = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + double *__pyx_t_1; + struct __pyx_array_obj *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("vector_to_numpy", 0); + __Pyx_TraceCall("vector_to_numpy", __pyx_f[0], 77, 0, __PYX_ERR(0, 77, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":78 + * @cython.boundscheck(False) + * cdef np.ndarray[np.float64_t, ndim=1, mode="c"] vector_to_numpy(VectorXd arr): + * cdef double[:] mem_view = arr.data() # <<<<<<<<<<<<<< + * return np.copy(np.asarray(mem_view, dtype=np.double, order="C")) + * + */ + __pyx_t_1 = __pyx_v_arr.data(); + if (!__pyx_t_1) { + PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); + __PYX_ERR(0, 78, __pyx_L1_error) + } + __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_arr.rows())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_array_new(__pyx_t_3, sizeof(double), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_t_1); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(((PyObject *)__pyx_t_2), PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_mem_view = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "helpers/ekf_sym_pyx.pyx":79 + * cdef np.ndarray[np.float64_t, ndim=1, mode="c"] vector_to_numpy(VectorXd arr): + * cdef double[:] mem_view = arr.data() + * return np.copy(np.asarray(mem_view, dtype=np.double, order="C")) # <<<<<<<<<<<<<< + * + * cdef class EKF_sym: + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_mem_view, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_double); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_r = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "helpers/ekf_sym_pyx.pyx":77 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cdef np.ndarray[np.float64_t, ndim=1, mode="c"] vector_to_numpy(VectorXd arr): # <<<<<<<<<<<<<< + * cdef double[:] mem_view = arr.data() + * return np.copy(np.asarray(mem_view, dtype=np.double, order="C")) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(((PyObject *)__pyx_t_2)); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("helpers.ekf_sym_pyx.vector_to_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_mem_view, 1); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":83 + * cdef class EKF_sym: + * cdef EKFSym* ekf + * def __cinit__(self, str gen_dir, str name, np.ndarray[np.float64_t, ndim=2] Q, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] x_initial, np.ndarray[np.float64_t, ndim=2] P_initial, int dim_main, + * int dim_main_err, int N=0, int dim_augment=0, int dim_augment_err=0, list maha_test_kinds=[], + */ + +/* Python wrapper */ +static int __pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_gen_dir = 0; + PyObject *__pyx_v_name = 0; + PyArrayObject *__pyx_v_Q = 0; + PyArrayObject *__pyx_v_x_initial = 0; + PyArrayObject *__pyx_v_P_initial = 0; + int __pyx_v_dim_main; + int __pyx_v_dim_main_err; + int __pyx_v_N; + int __pyx_v_dim_augment; + int __pyx_v_dim_augment_err; + PyObject *__pyx_v_maha_test_kinds = 0; + PyObject *__pyx_v_quaternion_idxs = 0; + PyObject *__pyx_v_global_vars = 0; + double __pyx_v_max_rewind_age; + CYTHON_UNUSED PyObject *__pyx_v_logger = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen_dir,&__pyx_n_s_name,&__pyx_n_s_Q,&__pyx_n_s_x_initial,&__pyx_n_s_P_initial,&__pyx_n_s_dim_main,&__pyx_n_s_dim_main_err,&__pyx_n_s_N,&__pyx_n_s_dim_augment,&__pyx_n_s_dim_augment_err,&__pyx_n_s_maha_test_kinds,&__pyx_n_s_quaternion_idxs,&__pyx_n_s_global_vars,&__pyx_n_s_max_rewind_age,&__pyx_n_s_logger,0}; + PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + values[10] = __pyx_k_; + values[11] = __pyx_k__2; + values[12] = __pyx_k__3; + + /* "helpers/ekf_sym_pyx.pyx":86 + * np.ndarray[np.float64_t, ndim=1] x_initial, np.ndarray[np.float64_t, ndim=2] P_initial, int dim_main, + * int dim_main_err, int N=0, int dim_augment=0, int dim_augment_err=0, list maha_test_kinds=[], + * list quaternion_idxs=[], list global_vars=[], double max_rewind_age=1.0, logger=None): # <<<<<<<<<<<<<< + * # TODO logger + * + */ + values[14] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gen_dir)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 7, 15, 1); __PYX_ERR(0, 83, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Q)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 7, 15, 2); __PYX_ERR(0, 83, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x_initial)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 7, 15, 3); __PYX_ERR(0, 83, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P_initial)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 7, 15, 4); __PYX_ERR(0, 83, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_main)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 7, 15, 5); __PYX_ERR(0, 83, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_main_err)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 7, 15, 6); __PYX_ERR(0, 83, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N); + if (value) { values[7] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 8: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_augment); + if (value) { values[8] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_augment_err); + if (value) { values[9] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 10: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maha_test_kinds); + if (value) { values[10] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 11: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quaternion_idxs); + if (value) { values[11] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 12: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_global_vars); + if (value) { values[12] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 13: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_rewind_age); + if (value) { values[13] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 14: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_logger); + if (value) { values[14] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 83, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_gen_dir = ((PyObject*)values[0]); + __pyx_v_name = ((PyObject*)values[1]); + __pyx_v_Q = ((PyArrayObject *)values[2]); + __pyx_v_x_initial = ((PyArrayObject *)values[3]); + __pyx_v_P_initial = ((PyArrayObject *)values[4]); + __pyx_v_dim_main = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_dim_main == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) + __pyx_v_dim_main_err = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_dim_main_err == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error) + if (values[7]) { + __pyx_v_N = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error) + } else { + __pyx_v_N = ((int)0); + } + if (values[8]) { + __pyx_v_dim_augment = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_dim_augment == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error) + } else { + __pyx_v_dim_augment = ((int)0); + } + if (values[9]) { + __pyx_v_dim_augment_err = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_dim_augment_err == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error) + } else { + __pyx_v_dim_augment_err = ((int)0); + } + __pyx_v_maha_test_kinds = ((PyObject*)values[10]); + __pyx_v_quaternion_idxs = ((PyObject*)values[11]); + __pyx_v_global_vars = ((PyObject*)values[12]); + if (values[13]) { + __pyx_v_max_rewind_age = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_max_rewind_age == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) + } else { + __pyx_v_max_rewind_age = ((double)1.0); + } + __pyx_v_logger = values[14]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 7, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 83, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen_dir), (&PyUnicode_Type), 1, "gen_dir", 1))) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Q), __pyx_ptype_5numpy_ndarray, 1, "Q", 0))) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x_initial), __pyx_ptype_5numpy_ndarray, 1, "x_initial", 0))) __PYX_ERR(0, 84, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P_initial), __pyx_ptype_5numpy_ndarray, 1, "P_initial", 0))) __PYX_ERR(0, 84, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_maha_test_kinds), (&PyList_Type), 1, "maha_test_kinds", 1))) __PYX_ERR(0, 85, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quaternion_idxs), (&PyList_Type), 1, "quaternion_idxs", 1))) __PYX_ERR(0, 86, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_global_vars), (&PyList_Type), 1, "global_vars", 1))) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym___cinit__(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self), __pyx_v_gen_dir, __pyx_v_name, __pyx_v_Q, __pyx_v_x_initial, __pyx_v_P_initial, __pyx_v_dim_main, __pyx_v_dim_main_err, __pyx_v_N, __pyx_v_dim_augment, __pyx_v_dim_augment_err, __pyx_v_maha_test_kinds, __pyx_v_quaternion_idxs, __pyx_v_global_vars, __pyx_v_max_rewind_age, __pyx_v_logger); + + /* "helpers/ekf_sym_pyx.pyx":83 + * cdef class EKF_sym: + * cdef EKFSym* ekf + * def __cinit__(self, str gen_dir, str name, np.ndarray[np.float64_t, ndim=2] Q, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] x_initial, np.ndarray[np.float64_t, ndim=2] P_initial, int dim_main, + * int dim_main_err, int N=0, int dim_augment=0, int dim_augment_err=0, list maha_test_kinds=[], + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym___cinit__(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_gen_dir, PyObject *__pyx_v_name, PyArrayObject *__pyx_v_Q, PyArrayObject *__pyx_v_x_initial, PyArrayObject *__pyx_v_P_initial, int __pyx_v_dim_main, int __pyx_v_dim_main_err, int __pyx_v_N, int __pyx_v_dim_augment, int __pyx_v_dim_augment_err, PyObject *__pyx_v_maha_test_kinds, PyObject *__pyx_v_quaternion_idxs, PyObject *__pyx_v_global_vars, double __pyx_v_max_rewind_age, CYTHON_UNUSED PyObject *__pyx_v_logger) { + PyArrayObject *__pyx_v_Q_b = 0; + PyArrayObject *__pyx_v_x_initial_b = 0; + PyArrayObject *__pyx_v_P_initial_b = 0; + PyObject *__pyx_7genexpr__pyx_v_x = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_P_initial; + __Pyx_Buffer __pyx_pybuffer_P_initial; + __Pyx_LocalBuf_ND __pyx_pybuffernd_P_initial_b; + __Pyx_Buffer __pyx_pybuffer_P_initial_b; + __Pyx_LocalBuf_ND __pyx_pybuffernd_Q; + __Pyx_Buffer __pyx_pybuffer_Q; + __Pyx_LocalBuf_ND __pyx_pybuffernd_Q_b; + __Pyx_Buffer __pyx_pybuffer_Q_b; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x_initial; + __Pyx_Buffer __pyx_pybuffer_x_initial; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x_initial_b; + __Pyx_Buffer __pyx_pybuffer_x_initial_b; + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + std::string __pyx_t_9; + std::vector __pyx_t_10; + std::vector __pyx_t_11; + Py_ssize_t __pyx_t_12; + std::vector __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_TraceCall("__cinit__", __pyx_f[0], 83, 0, __PYX_ERR(0, 83, __pyx_L1_error)); + __pyx_pybuffer_Q_b.pybuffer.buf = NULL; + __pyx_pybuffer_Q_b.refcount = 0; + __pyx_pybuffernd_Q_b.data = NULL; + __pyx_pybuffernd_Q_b.rcbuffer = &__pyx_pybuffer_Q_b; + __pyx_pybuffer_x_initial_b.pybuffer.buf = NULL; + __pyx_pybuffer_x_initial_b.refcount = 0; + __pyx_pybuffernd_x_initial_b.data = NULL; + __pyx_pybuffernd_x_initial_b.rcbuffer = &__pyx_pybuffer_x_initial_b; + __pyx_pybuffer_P_initial_b.pybuffer.buf = NULL; + __pyx_pybuffer_P_initial_b.refcount = 0; + __pyx_pybuffernd_P_initial_b.data = NULL; + __pyx_pybuffernd_P_initial_b.rcbuffer = &__pyx_pybuffer_P_initial_b; + __pyx_pybuffer_Q.pybuffer.buf = NULL; + __pyx_pybuffer_Q.refcount = 0; + __pyx_pybuffernd_Q.data = NULL; + __pyx_pybuffernd_Q.rcbuffer = &__pyx_pybuffer_Q; + __pyx_pybuffer_x_initial.pybuffer.buf = NULL; + __pyx_pybuffer_x_initial.refcount = 0; + __pyx_pybuffernd_x_initial.data = NULL; + __pyx_pybuffernd_x_initial.rcbuffer = &__pyx_pybuffer_x_initial; + __pyx_pybuffer_P_initial.pybuffer.buf = NULL; + __pyx_pybuffer_P_initial.refcount = 0; + __pyx_pybuffernd_P_initial.data = NULL; + __pyx_pybuffernd_P_initial.rcbuffer = &__pyx_pybuffer_P_initial; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Q.rcbuffer->pybuffer, (PyObject*)__pyx_v_Q, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 83, __pyx_L1_error) + } + __pyx_pybuffernd_Q.diminfo[0].strides = __pyx_pybuffernd_Q.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Q.diminfo[0].shape = __pyx_pybuffernd_Q.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Q.diminfo[1].strides = __pyx_pybuffernd_Q.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Q.diminfo[1].shape = __pyx_pybuffernd_Q.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_initial.rcbuffer->pybuffer, (PyObject*)__pyx_v_x_initial, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 83, __pyx_L1_error) + } + __pyx_pybuffernd_x_initial.diminfo[0].strides = __pyx_pybuffernd_x_initial.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x_initial.diminfo[0].shape = __pyx_pybuffernd_x_initial.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P_initial.rcbuffer->pybuffer, (PyObject*)__pyx_v_P_initial, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 83, __pyx_L1_error) + } + __pyx_pybuffernd_P_initial.diminfo[0].strides = __pyx_pybuffernd_P_initial.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P_initial.diminfo[0].shape = __pyx_pybuffernd_P_initial.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P_initial.diminfo[1].strides = __pyx_pybuffernd_P_initial.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P_initial.diminfo[1].shape = __pyx_pybuffernd_P_initial.rcbuffer->pybuffer.shape[1]; + + /* "helpers/ekf_sym_pyx.pyx":89 + * # TODO logger + * + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] Q_b = np.ascontiguousarray(Q, dtype=np.double) # <<<<<<<<<<<<<< + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] x_initial_b = np.ascontiguousarray(x_initial, dtype=np.double) + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] P_initial_b = np.ascontiguousarray(P_initial, dtype=np.double) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_Q)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_Q)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Q)); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Q_b.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) { + __pyx_v_Q_b = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Q_b.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 89, __pyx_L1_error) + } else {__pyx_pybuffernd_Q_b.diminfo[0].strides = __pyx_pybuffernd_Q_b.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Q_b.diminfo[0].shape = __pyx_pybuffernd_Q_b.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Q_b.diminfo[1].strides = __pyx_pybuffernd_Q_b.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Q_b.diminfo[1].shape = __pyx_pybuffernd_Q_b.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_Q_b = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "helpers/ekf_sym_pyx.pyx":90 + * + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] Q_b = np.ascontiguousarray(Q, dtype=np.double) + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] x_initial_b = np.ascontiguousarray(x_initial, dtype=np.double) # <<<<<<<<<<<<<< + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] P_initial_b = np.ascontiguousarray(P_initial, dtype=np.double) + * self.ekf = new EKFSym( + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_x_initial)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_x_initial)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_x_initial)); + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_initial_b.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { + __pyx_v_x_initial_b = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x_initial_b.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 90, __pyx_L1_error) + } else {__pyx_pybuffernd_x_initial_b.diminfo[0].strides = __pyx_pybuffernd_x_initial_b.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x_initial_b.diminfo[0].shape = __pyx_pybuffernd_x_initial_b.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_x_initial_b = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "helpers/ekf_sym_pyx.pyx":91 + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] Q_b = np.ascontiguousarray(Q, dtype=np.double) + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] x_initial_b = np.ascontiguousarray(x_initial, dtype=np.double) + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] P_initial_b = np.ascontiguousarray(P_initial, dtype=np.double) # <<<<<<<<<<<<<< + * self.ekf = new EKFSym( + * name.encode('utf8'), + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_P_initial)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_P_initial)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_P_initial)); + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P_initial_b.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) { + __pyx_v_P_initial_b = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_P_initial_b.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 91, __pyx_L1_error) + } else {__pyx_pybuffernd_P_initial_b.diminfo[0].strides = __pyx_pybuffernd_P_initial_b.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P_initial_b.diminfo[0].shape = __pyx_pybuffernd_P_initial_b.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P_initial_b.diminfo[1].strides = __pyx_pybuffernd_P_initial_b.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P_initial_b.diminfo[1].shape = __pyx_pybuffernd_P_initial_b.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_8 = 0; + __pyx_v_P_initial_b = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "helpers/ekf_sym_pyx.pyx":93 + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] P_initial_b = np.ascontiguousarray(P_initial, dtype=np.double) + * self.ekf = new EKFSym( + * name.encode('utf8'), # <<<<<<<<<<<<<< + * MapMatrixXdr( Q_b.data, Q.shape[0], Q.shape[1]), + * MapVectorXd( x_initial_b.data, x_initial.shape[0]), + */ + if (unlikely(__pyx_v_name == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 93, __pyx_L1_error) + } + __pyx_t_2 = PyUnicode_AsUTF8String(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "helpers/ekf_sym_pyx.pyx":102 + * dim_augment, + * dim_augment_err, + * maha_test_kinds, # <<<<<<<<<<<<<< + * quaternion_idxs, + * [x.encode('utf8') for x in global_vars], + */ + __pyx_t_10 = __pyx_convert_vector_from_py_int(__pyx_v_maha_test_kinds); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) + + /* "helpers/ekf_sym_pyx.pyx":103 + * dim_augment_err, + * maha_test_kinds, + * quaternion_idxs, # <<<<<<<<<<<<<< + * [x.encode('utf8') for x in global_vars], + * max_rewind_age + */ + __pyx_t_11 = __pyx_convert_vector_from_py_int(__pyx_v_quaternion_idxs); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) + { /* enter inner scope */ + + /* "helpers/ekf_sym_pyx.pyx":104 + * maha_test_kinds, + * quaternion_idxs, + * [x.encode('utf8') for x in global_vars], # <<<<<<<<<<<<<< + * max_rewind_age + * ) + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__pyx_v_global_vars == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 104, __pyx_L5_error) + } + __pyx_t_5 = __pyx_v_global_vars; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0; + for (;;) { + if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 104, __pyx_L5_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_x, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_n_u_utf8) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_u_utf8); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 104, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0; + goto __pyx_L8_exit_scope; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0; + goto __pyx_L1_error; + __pyx_L8_exit_scope:; + } /* exit inner scope */ + __pyx_t_13 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "helpers/ekf_sym_pyx.pyx":92 + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] x_initial_b = np.ascontiguousarray(x_initial, dtype=np.double) + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] P_initial_b = np.ascontiguousarray(P_initial, dtype=np.double) + * self.ekf = new EKFSym( # <<<<<<<<<<<<<< + * name.encode('utf8'), + * MapMatrixXdr( Q_b.data, Q.shape[0], Q.shape[1]), + */ + __pyx_v_self->ekf = new EKFS::EKFSym(__pyx_t_9, Eigen::Map >(((double *)__pyx_v_Q_b->data), (__pyx_v_Q->dimensions[0]), (__pyx_v_Q->dimensions[1])), Eigen::Map(((double *)__pyx_v_x_initial_b->data), (__pyx_v_x_initial->dimensions[0])), Eigen::Map >(((double *)__pyx_v_P_initial_b->data), (__pyx_v_P_initial->dimensions[0]), (__pyx_v_P_initial->dimensions[1])), __pyx_v_dim_main, __pyx_v_dim_main_err, __pyx_v_N, __pyx_v_dim_augment, __pyx_v_dim_augment_err, __pyx_t_10, __pyx_t_11, __pyx_t_13, __pyx_v_max_rewind_age); + + /* "helpers/ekf_sym_pyx.pyx":83 + * cdef class EKF_sym: + * cdef EKFSym* ekf + * def __cinit__(self, str gen_dir, str name, np.ndarray[np.float64_t, ndim=2] Q, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] x_initial, np.ndarray[np.float64_t, ndim=2] P_initial, int dim_main, + * int dim_main_err, int N=0, int dim_augment=0, int dim_augment_err=0, list maha_test_kinds=[], + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_initial.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_initial_b.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q_b.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x_initial.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x_initial_b.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_initial.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_initial_b.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q_b.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x_initial.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x_initial_b.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_Q_b); + __Pyx_XDECREF((PyObject *)__pyx_v_x_initial_b); + __Pyx_XDECREF((PyObject *)__pyx_v_P_initial_b); + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":108 + * ) + * + * def init_state(self, np.ndarray[np.float64_t, ndim=1] state, np.ndarray[np.float64_t, ndim=2] covs, filter_time): # <<<<<<<<<<<<<< + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] state_b = np.ascontiguousarray(state, dtype=np.double) + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] covs_b = np.ascontiguousarray(covs, dtype=np.double) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_3init_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_3init_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_state = 0; + PyArrayObject *__pyx_v_covs = 0; + PyObject *__pyx_v_filter_time = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("init_state (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_covs,&__pyx_n_s_filter_time,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_covs)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("init_state", 1, 3, 3, 1); __PYX_ERR(0, 108, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filter_time)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("init_state", 1, 3, 3, 2); __PYX_ERR(0, 108, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init_state") < 0)) __PYX_ERR(0, 108, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_state = ((PyArrayObject *)values[0]); + __pyx_v_covs = ((PyArrayObject *)values[1]); + __pyx_v_filter_time = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("init_state", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 108, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.init_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_5numpy_ndarray, 1, "state", 0))) __PYX_ERR(0, 108, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_covs), __pyx_ptype_5numpy_ndarray, 1, "covs", 0))) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_2init_state(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self), __pyx_v_state, __pyx_v_covs, __pyx_v_filter_time); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_2init_state(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, PyArrayObject *__pyx_v_state, PyArrayObject *__pyx_v_covs, PyObject *__pyx_v_filter_time) { + PyArrayObject *__pyx_v_state_b = 0; + PyArrayObject *__pyx_v_covs_b = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_covs; + __Pyx_Buffer __pyx_pybuffer_covs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_covs_b; + __Pyx_Buffer __pyx_pybuffer_covs_b; + __Pyx_LocalBuf_ND __pyx_pybuffernd_state; + __Pyx_Buffer __pyx_pybuffer_state; + __Pyx_LocalBuf_ND __pyx_pybuffernd_state_b; + __Pyx_Buffer __pyx_pybuffer_state_b; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + double __pyx_t_8; + int __pyx_t_9; + double __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("init_state", 0); + __Pyx_TraceCall("init_state", __pyx_f[0], 108, 0, __PYX_ERR(0, 108, __pyx_L1_error)); + __pyx_pybuffer_state_b.pybuffer.buf = NULL; + __pyx_pybuffer_state_b.refcount = 0; + __pyx_pybuffernd_state_b.data = NULL; + __pyx_pybuffernd_state_b.rcbuffer = &__pyx_pybuffer_state_b; + __pyx_pybuffer_covs_b.pybuffer.buf = NULL; + __pyx_pybuffer_covs_b.refcount = 0; + __pyx_pybuffernd_covs_b.data = NULL; + __pyx_pybuffernd_covs_b.rcbuffer = &__pyx_pybuffer_covs_b; + __pyx_pybuffer_state.pybuffer.buf = NULL; + __pyx_pybuffer_state.refcount = 0; + __pyx_pybuffernd_state.data = NULL; + __pyx_pybuffernd_state.rcbuffer = &__pyx_pybuffer_state; + __pyx_pybuffer_covs.pybuffer.buf = NULL; + __pyx_pybuffer_covs.refcount = 0; + __pyx_pybuffernd_covs.data = NULL; + __pyx_pybuffernd_covs.rcbuffer = &__pyx_pybuffer_covs; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_state.rcbuffer->pybuffer, (PyObject*)__pyx_v_state, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 108, __pyx_L1_error) + } + __pyx_pybuffernd_state.diminfo[0].strides = __pyx_pybuffernd_state.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_state.diminfo[0].shape = __pyx_pybuffernd_state.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_covs.rcbuffer->pybuffer, (PyObject*)__pyx_v_covs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 108, __pyx_L1_error) + } + __pyx_pybuffernd_covs.diminfo[0].strides = __pyx_pybuffernd_covs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_covs.diminfo[0].shape = __pyx_pybuffernd_covs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_covs.diminfo[1].strides = __pyx_pybuffernd_covs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_covs.diminfo[1].shape = __pyx_pybuffernd_covs.rcbuffer->pybuffer.shape[1]; + + /* "helpers/ekf_sym_pyx.pyx":109 + * + * def init_state(self, np.ndarray[np.float64_t, ndim=1] state, np.ndarray[np.float64_t, ndim=2] covs, filter_time): + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] state_b = np.ascontiguousarray(state, dtype=np.double) # <<<<<<<<<<<<<< + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] covs_b = np.ascontiguousarray(covs, dtype=np.double) + * self.ekf.init_state( + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_state)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_state)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_state)); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_state_b.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { + __pyx_v_state_b = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_state_b.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 109, __pyx_L1_error) + } else {__pyx_pybuffernd_state_b.diminfo[0].strides = __pyx_pybuffernd_state_b.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_state_b.diminfo[0].shape = __pyx_pybuffernd_state_b.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_state_b = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "helpers/ekf_sym_pyx.pyx":110 + * def init_state(self, np.ndarray[np.float64_t, ndim=1] state, np.ndarray[np.float64_t, ndim=2] covs, filter_time): + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] state_b = np.ascontiguousarray(state, dtype=np.double) + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] covs_b = np.ascontiguousarray(covs, dtype=np.double) # <<<<<<<<<<<<<< + * self.ekf.init_state( + * MapVectorXd( state_b.data, state.shape[0]), + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_covs)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_covs)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_covs)); + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_covs_b.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) { + __pyx_v_covs_b = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_covs_b.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 110, __pyx_L1_error) + } else {__pyx_pybuffernd_covs_b.diminfo[0].strides = __pyx_pybuffernd_covs_b.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_covs_b.diminfo[0].shape = __pyx_pybuffernd_covs_b.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_covs_b.diminfo[1].strides = __pyx_pybuffernd_covs_b.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_covs_b.diminfo[1].shape = __pyx_pybuffernd_covs_b.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_7 = 0; + __pyx_v_covs_b = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "helpers/ekf_sym_pyx.pyx":114 + * MapVectorXd( state_b.data, state.shape[0]), + * MapMatrixXdr( covs_b.data, covs.shape[0], covs.shape[1]), + * np.nan if filter_time is None else filter_time # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_9 = (__pyx_v_filter_time == Py_None); + if ((__pyx_t_9 != 0)) { + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __pyx_t_10; + } else { + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_filter_time); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_8 = __pyx_t_10; + } + + /* "helpers/ekf_sym_pyx.pyx":111 + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] state_b = np.ascontiguousarray(state, dtype=np.double) + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] covs_b = np.ascontiguousarray(covs, dtype=np.double) + * self.ekf.init_state( # <<<<<<<<<<<<<< + * MapVectorXd( state_b.data, state.shape[0]), + * MapMatrixXdr( covs_b.data, covs.shape[0], covs.shape[1]), + */ + __pyx_v_self->ekf->init_state(Eigen::Map(((double *)__pyx_v_state_b->data), (__pyx_v_state->dimensions[0])), Eigen::Map >(((double *)__pyx_v_covs_b->data), (__pyx_v_covs->dimensions[0]), (__pyx_v_covs->dimensions[1])), __pyx_t_8); + + /* "helpers/ekf_sym_pyx.pyx":108 + * ) + * + * def init_state(self, np.ndarray[np.float64_t, ndim=1] state, np.ndarray[np.float64_t, ndim=2] covs, filter_time): # <<<<<<<<<<<<<< + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] state_b = np.ascontiguousarray(state, dtype=np.double) + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] covs_b = np.ascontiguousarray(covs, dtype=np.double) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_covs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_covs_b.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_state.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_state_b.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.init_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_covs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_covs_b.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_state.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_state_b.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_state_b); + __Pyx_XDECREF((PyObject *)__pyx_v_covs_b); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":117 + * ) + * + * def state(self): # <<<<<<<<<<<<<< + * cdef np.ndarray res = vector_to_numpy(self.ekf.state()) + * return res + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_5state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_5state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("state (wrapper)", 0); + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_4state(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_4state(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self) { + PyArrayObject *__pyx_v_res = 0; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("state", 0); + __Pyx_TraceCall("state", __pyx_f[0], 117, 0, __PYX_ERR(0, 117, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":118 + * + * def state(self): + * cdef np.ndarray res = vector_to_numpy(self.ekf.state()) # <<<<<<<<<<<<<< + * return res + * + */ + __pyx_t_1 = ((PyObject *)__pyx_f_7helpers_11ekf_sym_pyx_vector_to_numpy(__pyx_v_self->ekf->state())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "helpers/ekf_sym_pyx.pyx":119 + * def state(self): + * cdef np.ndarray res = vector_to_numpy(self.ekf.state()) + * return res # <<<<<<<<<<<<<< + * + * def covs(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_res)); + __pyx_r = ((PyObject *)__pyx_v_res); + goto __pyx_L0; + + /* "helpers/ekf_sym_pyx.pyx":117 + * ) + * + * def state(self): # <<<<<<<<<<<<<< + * cdef np.ndarray res = vector_to_numpy(self.ekf.state()) + * return res + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":121 + * return res + * + * def covs(self): # <<<<<<<<<<<<<< + * return matrix_to_numpy(self.ekf.covs()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_7covs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_7covs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("covs (wrapper)", 0); + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_6covs(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_6covs(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("covs", 0); + __Pyx_TraceCall("covs", __pyx_f[0], 121, 0, __PYX_ERR(0, 121, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":122 + * + * def covs(self): + * return matrix_to_numpy(self.ekf.covs()) # <<<<<<<<<<<<<< + * + * def set_filter_time(self, double t): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_7helpers_11ekf_sym_pyx_matrix_to_numpy(__pyx_v_self->ekf->covs())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "helpers/ekf_sym_pyx.pyx":121 + * return res + * + * def covs(self): # <<<<<<<<<<<<<< + * return matrix_to_numpy(self.ekf.covs()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.covs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":124 + * return matrix_to_numpy(self.ekf.covs()) + * + * def set_filter_time(self, double t): # <<<<<<<<<<<<<< + * self.ekf.set_filter_time(t) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_9set_filter_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_9set_filter_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t) { + double __pyx_v_t; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_filter_time (wrapper)", 0); + assert(__pyx_arg_t); { + __pyx_v_t = __pyx_PyFloat_AsDouble(__pyx_arg_t); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.set_filter_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_8set_filter_time(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self), ((double)__pyx_v_t)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_8set_filter_time(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, double __pyx_v_t) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_filter_time", 0); + __Pyx_TraceCall("set_filter_time", __pyx_f[0], 124, 0, __PYX_ERR(0, 124, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":125 + * + * def set_filter_time(self, double t): + * self.ekf.set_filter_time(t) # <<<<<<<<<<<<<< + * + * def get_filter_time(self): + */ + __pyx_v_self->ekf->set_filter_time(__pyx_v_t); + + /* "helpers/ekf_sym_pyx.pyx":124 + * return matrix_to_numpy(self.ekf.covs()) + * + * def set_filter_time(self, double t): # <<<<<<<<<<<<<< + * self.ekf.set_filter_time(t) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.set_filter_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":127 + * self.ekf.set_filter_time(t) + * + * def get_filter_time(self): # <<<<<<<<<<<<<< + * return self.ekf.get_filter_time() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_11get_filter_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_11get_filter_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_filter_time (wrapper)", 0); + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_10get_filter_time(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_10get_filter_time(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_filter_time", 0); + __Pyx_TraceCall("get_filter_time", __pyx_f[0], 127, 0, __PYX_ERR(0, 127, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":128 + * + * def get_filter_time(self): + * return self.ekf.get_filter_time() # <<<<<<<<<<<<<< + * + * def set_global(self, str global_var, double val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->ekf->get_filter_time()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "helpers/ekf_sym_pyx.pyx":127 + * self.ekf.set_filter_time(t) + * + * def get_filter_time(self): # <<<<<<<<<<<<<< + * return self.ekf.get_filter_time() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.get_filter_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":130 + * return self.ekf.get_filter_time() + * + * def set_global(self, str global_var, double val): # <<<<<<<<<<<<<< + * self.ekf.set_global(global_var.encode('utf8'), val) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_13set_global(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_13set_global(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_global_var = 0; + double __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_global (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_global_var,&__pyx_n_s_val,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_global_var)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_global", 1, 2, 2, 1); __PYX_ERR(0, 130, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_global") < 0)) __PYX_ERR(0, 130, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_global_var = ((PyObject*)values[0]); + __pyx_v_val = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_val == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_global", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 130, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.set_global", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_global_var), (&PyUnicode_Type), 1, "global_var", 1))) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_12set_global(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self), __pyx_v_global_var, __pyx_v_val); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_12set_global(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, PyObject *__pyx_v_global_var, double __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + std::string __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_global", 0); + __Pyx_TraceCall("set_global", __pyx_f[0], 130, 0, __PYX_ERR(0, 130, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":131 + * + * def set_global(self, str global_var, double val): + * self.ekf.set_global(global_var.encode('utf8'), val) # <<<<<<<<<<<<<< + * + * def reset_rewind(self): + */ + if (unlikely(__pyx_v_global_var == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 131, __pyx_L1_error) + } + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_global_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->ekf->set_global(__pyx_t_2, __pyx_v_val); + + /* "helpers/ekf_sym_pyx.pyx":130 + * return self.ekf.get_filter_time() + * + * def set_global(self, str global_var, double val): # <<<<<<<<<<<<<< + * self.ekf.set_global(global_var.encode('utf8'), val) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.set_global", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":133 + * self.ekf.set_global(global_var.encode('utf8'), val) + * + * def reset_rewind(self): # <<<<<<<<<<<<<< + * self.ekf.reset_rewind() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_15reset_rewind(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_15reset_rewind(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reset_rewind (wrapper)", 0); + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_14reset_rewind(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_14reset_rewind(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reset_rewind", 0); + __Pyx_TraceCall("reset_rewind", __pyx_f[0], 133, 0, __PYX_ERR(0, 133, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":134 + * + * def reset_rewind(self): + * self.ekf.reset_rewind() # <<<<<<<<<<<<<< + * + * def predict(self, double t): + */ + __pyx_v_self->ekf->reset_rewind(); + + /* "helpers/ekf_sym_pyx.pyx":133 + * self.ekf.set_global(global_var.encode('utf8'), val) + * + * def reset_rewind(self): # <<<<<<<<<<<<<< + * self.ekf.reset_rewind() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.reset_rewind", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":136 + * self.ekf.reset_rewind() + * + * def predict(self, double t): # <<<<<<<<<<<<<< + * self.ekf.predict(t) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_17predict(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_17predict(PyObject *__pyx_v_self, PyObject *__pyx_arg_t) { + double __pyx_v_t; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("predict (wrapper)", 0); + assert(__pyx_arg_t); { + __pyx_v_t = __pyx_PyFloat_AsDouble(__pyx_arg_t); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.predict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_16predict(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self), ((double)__pyx_v_t)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_16predict(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, double __pyx_v_t) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("predict", 0); + __Pyx_TraceCall("predict", __pyx_f[0], 136, 0, __PYX_ERR(0, 136, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":137 + * + * def predict(self, double t): + * self.ekf.predict(t) # <<<<<<<<<<<<<< + * + * def predict_and_update_batch(self, double t, int kind, z, R, extra_args=[[]], bool augment=False): + */ + __pyx_v_self->ekf->predict(__pyx_v_t); + + /* "helpers/ekf_sym_pyx.pyx":136 + * self.ekf.reset_rewind() + * + * def predict(self, double t): # <<<<<<<<<<<<<< + * self.ekf.predict(t) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.predict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":139 + * self.ekf.predict(t) + * + * def predict_and_update_batch(self, double t, int kind, z, R, extra_args=[[]], bool augment=False): # <<<<<<<<<<<<<< + * cdef vector[MapVectorXd] z_map + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] zi_b + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_19predict_and_update_batch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_19predict_and_update_batch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + double __pyx_v_t; + int __pyx_v_kind; + PyObject *__pyx_v_z = 0; + PyObject *__pyx_v_R = 0; + PyObject *__pyx_v_extra_args = 0; + bool __pyx_v_augment; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("predict_and_update_batch (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_kind,&__pyx_n_s_z,&__pyx_n_s_R,&__pyx_n_s_extra_args,&__pyx_n_s_augment,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + values[4] = __pyx_k__4; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kind)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("predict_and_update_batch", 0, 4, 6, 1); __PYX_ERR(0, 139, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_z)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("predict_and_update_batch", 0, 4, 6, 2); __PYX_ERR(0, 139, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("predict_and_update_batch", 0, 4, 6, 3); __PYX_ERR(0, 139, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extra_args); + if (value) { values[4] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 5: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_augment); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "predict_and_update_batch") < 0)) __PYX_ERR(0, 139, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error) + __pyx_v_kind = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_kind == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error) + __pyx_v_z = values[2]; + __pyx_v_R = values[3]; + __pyx_v_extra_args = values[4]; + if (values[5]) { + __pyx_v_augment = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_augment == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error) + } else { + __pyx_v_augment = ((bool)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("predict_and_update_batch", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 139, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.predict_and_update_batch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_18predict_and_update_batch(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self), __pyx_v_t, __pyx_v_kind, __pyx_v_z, __pyx_v_R, __pyx_v_extra_args, __pyx_v_augment); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_18predict_and_update_batch(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, double __pyx_v_t, int __pyx_v_kind, PyObject *__pyx_v_z, PyObject *__pyx_v_R, PyObject *__pyx_v_extra_args, bool __pyx_v_augment) { + std::vector> __pyx_v_z_map; + PyArrayObject *__pyx_v_zi_b = 0; + PyObject *__pyx_v_zi = NULL; + std::vector >> __pyx_v_R_map; + PyArrayObject *__pyx_v_Ri_b = 0; + PyObject *__pyx_v_Ri = NULL; + std::vector > __pyx_v_extra_args_map; + std::vector __pyx_v_args_map; + PyObject *__pyx_v_args = NULL; + PyObject *__pyx_v_a = NULL; + std::optional __pyx_v_res; + Eigen::VectorXd __pyx_8genexpr1__pyx_v_tmpvec; + __Pyx_LocalBuf_ND __pyx_pybuffernd_Ri_b; + __Pyx_Buffer __pyx_pybuffer_Ri_b; + __Pyx_LocalBuf_ND __pyx_pybuffernd_zi_b; + __Pyx_Buffer __pyx_pybuffer_zi_b; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + PyObject *(*__pyx_t_17)(PyObject *); + double __pyx_t_18; + int __pyx_t_19; + PyObject *__pyx_t_20 = NULL; + std::vector ::iterator __pyx_t_21; + std::vector *__pyx_t_22; + Eigen::VectorXd __pyx_t_23; + PyObject *__pyx_t_24 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("predict_and_update_batch", 0); + __Pyx_TraceCall("predict_and_update_batch", __pyx_f[0], 139, 0, __PYX_ERR(0, 139, __pyx_L1_error)); + __pyx_pybuffer_zi_b.pybuffer.buf = NULL; + __pyx_pybuffer_zi_b.refcount = 0; + __pyx_pybuffernd_zi_b.data = NULL; + __pyx_pybuffernd_zi_b.rcbuffer = &__pyx_pybuffer_zi_b; + __pyx_pybuffer_Ri_b.pybuffer.buf = NULL; + __pyx_pybuffer_Ri_b.refcount = 0; + __pyx_pybuffernd_Ri_b.data = NULL; + __pyx_pybuffernd_Ri_b.rcbuffer = &__pyx_pybuffer_Ri_b; + + /* "helpers/ekf_sym_pyx.pyx":142 + * cdef vector[MapVectorXd] z_map + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] zi_b + * for zi in z: # <<<<<<<<<<<<<< + * zi_b = np.ascontiguousarray(zi, dtype=np.double) + * z_map.push_back(MapVectorXd( zi_b.data, zi.shape[0])) + */ + if (likely(PyList_CheckExact(__pyx_v_z)) || PyTuple_CheckExact(__pyx_v_z)) { + __pyx_t_1 = __pyx_v_z; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 142, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 142, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 142, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_zi, __pyx_t_4); + __pyx_t_4 = 0; + + /* "helpers/ekf_sym_pyx.pyx":143 + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] zi_b + * for zi in z: + * zi_b = np.ascontiguousarray(zi, dtype=np.double) # <<<<<<<<<<<<<< + * z_map.push_back(MapVectorXd( zi_b.data, zi.shape[0])) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_zi); + __Pyx_GIVEREF(__pyx_v_zi); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_zi); + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_double); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_zi_b.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_zi_b.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_zi_b.rcbuffer->pybuffer, (PyObject*)__pyx_v_zi_b, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0; + } + __pyx_pybuffernd_zi_b.diminfo[0].strides = __pyx_pybuffernd_zi_b.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_zi_b.diminfo[0].shape = __pyx_pybuffernd_zi_b.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 143, __pyx_L1_error) + } + __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_zi_b, ((PyArrayObject *)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "helpers/ekf_sym_pyx.pyx":144 + * for zi in z: + * zi_b = np.ascontiguousarray(zi, dtype=np.double) + * z_map.push_back(MapVectorXd( zi_b.data, zi.shape[0])) # <<<<<<<<<<<<<< + * + * cdef vector[MapMatrixXdr] R_map + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_zi, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + try { + __pyx_v_z_map.push_back(Eigen::Map(((double *)__pyx_v_zi_b->data), __pyx_t_10)); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 144, __pyx_L1_error) + } + + /* "helpers/ekf_sym_pyx.pyx":142 + * cdef vector[MapVectorXd] z_map + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] zi_b + * for zi in z: # <<<<<<<<<<<<<< + * zi_b = np.ascontiguousarray(zi, dtype=np.double) + * z_map.push_back(MapVectorXd( zi_b.data, zi.shape[0])) + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "helpers/ekf_sym_pyx.pyx":148 + * cdef vector[MapMatrixXdr] R_map + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] Ri_b + * for Ri in R: # <<<<<<<<<<<<<< + * Ri_b = np.ascontiguousarray(Ri, dtype=np.double) + * R_map.push_back(MapMatrixXdr( Ri_b.data, Ri.shape[0], Ri.shape[1])) + */ + if (likely(PyList_CheckExact(__pyx_v_R)) || PyTuple_CheckExact(__pyx_v_R)) { + __pyx_t_1 = __pyx_v_R; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_R); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 148, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 148, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 148, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_Ri, __pyx_t_6); + __pyx_t_6 = 0; + + /* "helpers/ekf_sym_pyx.pyx":149 + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] Ri_b + * for Ri in R: + * Ri_b = np.ascontiguousarray(Ri, dtype=np.double) # <<<<<<<<<<<<<< + * R_map.push_back(MapMatrixXdr( Ri_b.data, Ri.shape[0], Ri.shape[1])) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_Ri); + __Pyx_GIVEREF(__pyx_v_Ri); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_Ri); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_14 = ((PyArrayObject *)__pyx_t_7); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ri_b.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Ri_b.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Ri_b.rcbuffer->pybuffer, (PyObject*)__pyx_v_Ri_b, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0; + } + __pyx_pybuffernd_Ri_b.diminfo[0].strides = __pyx_pybuffernd_Ri_b.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Ri_b.diminfo[0].shape = __pyx_pybuffernd_Ri_b.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Ri_b.diminfo[1].strides = __pyx_pybuffernd_Ri_b.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Ri_b.diminfo[1].shape = __pyx_pybuffernd_Ri_b.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) + } + __pyx_t_14 = 0; + __Pyx_XDECREF_SET(__pyx_v_Ri_b, ((PyArrayObject *)__pyx_t_7)); + __pyx_t_7 = 0; + + /* "helpers/ekf_sym_pyx.pyx":150 + * for Ri in R: + * Ri_b = np.ascontiguousarray(Ri, dtype=np.double) + * R_map.push_back(MapMatrixXdr( Ri_b.data, Ri.shape[0], Ri.shape[1])) # <<<<<<<<<<<<<< + * + * cdef vector[vector[double]] extra_args_map + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_Ri, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_Ri, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + try { + __pyx_v_R_map.push_back(Eigen::Map >(((double *)__pyx_v_Ri_b->data), __pyx_t_10, __pyx_t_15)); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 150, __pyx_L1_error) + } + + /* "helpers/ekf_sym_pyx.pyx":148 + * cdef vector[MapMatrixXdr] R_map + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] Ri_b + * for Ri in R: # <<<<<<<<<<<<<< + * Ri_b = np.ascontiguousarray(Ri, dtype=np.double) + * R_map.push_back(MapMatrixXdr( Ri_b.data, Ri.shape[0], Ri.shape[1])) + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "helpers/ekf_sym_pyx.pyx":154 + * cdef vector[vector[double]] extra_args_map + * cdef vector[double] args_map + * for args in extra_args: # <<<<<<<<<<<<<< + * args_map.clear() + * for a in args: + */ + if (likely(PyList_CheckExact(__pyx_v_extra_args)) || PyTuple_CheckExact(__pyx_v_extra_args)) { + __pyx_t_1 = __pyx_v_extra_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_extra_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 154, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 154, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 154, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_7); + __pyx_t_7 = 0; + + /* "helpers/ekf_sym_pyx.pyx":155 + * cdef vector[double] args_map + * for args in extra_args: + * args_map.clear() # <<<<<<<<<<<<<< + * for a in args: + * args_map.push_back(a) + */ + __pyx_v_args_map.clear(); + + /* "helpers/ekf_sym_pyx.pyx":156 + * for args in extra_args: + * args_map.clear() + * for a in args: # <<<<<<<<<<<<<< + * args_map.push_back(a) + * extra_args_map.push_back(args_map) + */ + if (likely(PyList_CheckExact(__pyx_v_args)) || PyTuple_CheckExact(__pyx_v_args)) { + __pyx_t_7 = __pyx_v_args; __Pyx_INCREF(__pyx_t_7); __pyx_t_16 = 0; + __pyx_t_17 = NULL; + } else { + __pyx_t_16 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_17 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 156, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_17)) { + if (likely(PyList_CheckExact(__pyx_t_7))) { + if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_16); __Pyx_INCREF(__pyx_t_4); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 156, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_16); __Pyx_INCREF(__pyx_t_4); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 156, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_17(__pyx_t_7); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 156, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_4); + __pyx_t_4 = 0; + + /* "helpers/ekf_sym_pyx.pyx":157 + * args_map.clear() + * for a in args: + * args_map.push_back(a) # <<<<<<<<<<<<<< + * extra_args_map.push_back(args_map) + * + */ + __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error) + try { + __pyx_v_args_map.push_back(__pyx_t_18); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 157, __pyx_L1_error) + } + + /* "helpers/ekf_sym_pyx.pyx":156 + * for args in extra_args: + * args_map.clear() + * for a in args: # <<<<<<<<<<<<<< + * args_map.push_back(a) + * extra_args_map.push_back(args_map) + */ + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "helpers/ekf_sym_pyx.pyx":158 + * for a in args: + * args_map.push_back(a) + * extra_args_map.push_back(args_map) # <<<<<<<<<<<<<< + * + * cdef optional[Estimate] res = self.ekf.predict_and_update_batch(t, kind, z_map, R_map, extra_args_map, augment) + */ + try { + __pyx_v_extra_args_map.push_back(__pyx_v_args_map); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 158, __pyx_L1_error) + } + + /* "helpers/ekf_sym_pyx.pyx":154 + * cdef vector[vector[double]] extra_args_map + * cdef vector[double] args_map + * for args in extra_args: # <<<<<<<<<<<<<< + * args_map.clear() + * for a in args: + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "helpers/ekf_sym_pyx.pyx":160 + * extra_args_map.push_back(args_map) + * + * cdef optional[Estimate] res = self.ekf.predict_and_update_batch(t, kind, z_map, R_map, extra_args_map, augment) # <<<<<<<<<<<<<< + * if not res.has_value(): + * return None + */ + __pyx_v_res = __pyx_v_self->ekf->predict_and_update_batch(__pyx_v_t, __pyx_v_kind, __pyx_v_z_map, __pyx_v_R_map, __pyx_v_extra_args_map, __pyx_v_augment); + + /* "helpers/ekf_sym_pyx.pyx":161 + * + * cdef optional[Estimate] res = self.ekf.predict_and_update_batch(t, kind, z_map, R_map, extra_args_map, augment) + * if not res.has_value(): # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_19 = ((!(__pyx_v_res.has_value() != 0)) != 0); + if (__pyx_t_19) { + + /* "helpers/ekf_sym_pyx.pyx":162 + * cdef optional[Estimate] res = self.ekf.predict_and_update_batch(t, kind, z_map, R_map, extra_args_map, augment) + * if not res.has_value(): + * return None # <<<<<<<<<<<<<< + * + * cdef VectorXd tmpvec + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "helpers/ekf_sym_pyx.pyx":161 + * + * cdef optional[Estimate] res = self.ekf.predict_and_update_batch(t, kind, z_map, R_map, extra_args_map, augment) + * if not res.has_value(): # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "helpers/ekf_sym_pyx.pyx":165 + * + * cdef VectorXd tmpvec + * return ( # <<<<<<<<<<<<<< + * vector_to_numpy(res.value().xk1), + * vector_to_numpy(res.value().xk), + */ + __Pyx_XDECREF(__pyx_r); + + /* "helpers/ekf_sym_pyx.pyx":166 + * cdef VectorXd tmpvec + * return ( + * vector_to_numpy(res.value().xk1), # <<<<<<<<<<<<<< + * vector_to_numpy(res.value().xk), + * matrix_to_numpy(res.value().Pk1), + */ + __pyx_t_1 = ((PyObject *)__pyx_f_7helpers_11ekf_sym_pyx_vector_to_numpy(__pyx_v_res.value().xk1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "helpers/ekf_sym_pyx.pyx":167 + * return ( + * vector_to_numpy(res.value().xk1), + * vector_to_numpy(res.value().xk), # <<<<<<<<<<<<<< + * matrix_to_numpy(res.value().Pk1), + * matrix_to_numpy(res.value().Pk), + */ + __pyx_t_7 = ((PyObject *)__pyx_f_7helpers_11ekf_sym_pyx_vector_to_numpy(__pyx_v_res.value().xk)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "helpers/ekf_sym_pyx.pyx":168 + * vector_to_numpy(res.value().xk1), + * vector_to_numpy(res.value().xk), + * matrix_to_numpy(res.value().Pk1), # <<<<<<<<<<<<<< + * matrix_to_numpy(res.value().Pk), + * res.value().t, + */ + __pyx_t_4 = ((PyObject *)__pyx_f_7helpers_11ekf_sym_pyx_matrix_to_numpy(__pyx_v_res.value().Pk1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "helpers/ekf_sym_pyx.pyx":169 + * vector_to_numpy(res.value().xk), + * matrix_to_numpy(res.value().Pk1), + * matrix_to_numpy(res.value().Pk), # <<<<<<<<<<<<<< + * res.value().t, + * res.value().kind, + */ + __pyx_t_6 = ((PyObject *)__pyx_f_7helpers_11ekf_sym_pyx_matrix_to_numpy(__pyx_v_res.value().Pk)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "helpers/ekf_sym_pyx.pyx":170 + * matrix_to_numpy(res.value().Pk1), + * matrix_to_numpy(res.value().Pk), + * res.value().t, # <<<<<<<<<<<<<< + * res.value().kind, + * [vector_to_numpy(tmpvec) for tmpvec in res.value().y], + */ + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_res.value().t); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + + /* "helpers/ekf_sym_pyx.pyx":171 + * matrix_to_numpy(res.value().Pk), + * res.value().t, + * res.value().kind, # <<<<<<<<<<<<<< + * [vector_to_numpy(tmpvec) for tmpvec in res.value().y], + * z, # TODO: take return values? + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_res.value().kind); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + { /* enter inner scope */ + + /* "helpers/ekf_sym_pyx.pyx":172 + * res.value().t, + * res.value().kind, + * [vector_to_numpy(tmpvec) for tmpvec in res.value().y], # <<<<<<<<<<<<<< + * z, # TODO: take return values? + * extra_args, + */ + __pyx_t_20 = PyList_New(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_22 = &__pyx_v_res.value().y; + __pyx_t_21 = __pyx_t_22->begin(); + for (;;) { + if (!(__pyx_t_21 != __pyx_t_22->end())) break; + __pyx_t_23 = *__pyx_t_21; + ++__pyx_t_21; + __pyx_8genexpr1__pyx_v_tmpvec = __pyx_t_23; + __pyx_t_24 = ((PyObject *)__pyx_f_7helpers_11ekf_sym_pyx_vector_to_numpy(__pyx_8genexpr1__pyx_v_tmpvec)); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_20, (PyObject*)__pyx_t_24))) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + } + } /* exit inner scope */ + + /* "helpers/ekf_sym_pyx.pyx":166 + * cdef VectorXd tmpvec + * return ( + * vector_to_numpy(res.value().xk1), # <<<<<<<<<<<<<< + * vector_to_numpy(res.value().xk), + * matrix_to_numpy(res.value().Pk1), + */ + __pyx_t_24 = PyTuple_New(9); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_24, 3, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_24, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_24, 5, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_24, 6, __pyx_t_20); + __Pyx_INCREF(__pyx_v_z); + __Pyx_GIVEREF(__pyx_v_z); + PyTuple_SET_ITEM(__pyx_t_24, 7, __pyx_v_z); + __Pyx_INCREF(__pyx_v_extra_args); + __Pyx_GIVEREF(__pyx_v_extra_args); + PyTuple_SET_ITEM(__pyx_t_24, 8, __pyx_v_extra_args); + __pyx_t_1 = 0; + __pyx_t_7 = 0; + __pyx_t_4 = 0; + __pyx_t_6 = 0; + __pyx_t_8 = 0; + __pyx_t_5 = 0; + __pyx_t_20 = 0; + __pyx_r = __pyx_t_24; + __pyx_t_24 = 0; + goto __pyx_L0; + + /* "helpers/ekf_sym_pyx.pyx":139 + * self.ekf.predict(t) + * + * def predict_and_update_batch(self, double t, int kind, z, R, extra_args=[[]], bool augment=False): # <<<<<<<<<<<<<< + * cdef vector[MapVectorXd] z_map + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] zi_b + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_XDECREF(__pyx_t_24); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ri_b.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_zi_b.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.predict_and_update_batch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ri_b.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_zi_b.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_zi_b); + __Pyx_XDECREF(__pyx_v_zi); + __Pyx_XDECREF((PyObject *)__pyx_v_Ri_b); + __Pyx_XDECREF(__pyx_v_Ri); + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_a); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":177 + * ) + * + * def augment(self): # <<<<<<<<<<<<<< + * raise NotImplementedError() # TODO + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_21augment(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_21augment(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("augment (wrapper)", 0); + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_20augment(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_20augment(CYTHON_UNUSED struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("augment", 0); + __Pyx_TraceCall("augment", __pyx_f[0], 177, 0, __PYX_ERR(0, 177, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":178 + * + * def augment(self): + * raise NotImplementedError() # TODO # <<<<<<<<<<<<<< + * + * def get_augment_times(self): + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 178, __pyx_L1_error) + + /* "helpers/ekf_sym_pyx.pyx":177 + * ) + * + * def augment(self): # <<<<<<<<<<<<<< + * raise NotImplementedError() # TODO + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.augment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":180 + * raise NotImplementedError() # TODO + * + * def get_augment_times(self): # <<<<<<<<<<<<<< + * raise NotImplementedError() # TODO + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_23get_augment_times(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_23get_augment_times(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_augment_times (wrapper)", 0); + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_22get_augment_times(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_22get_augment_times(CYTHON_UNUSED struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_augment_times", 0); + __Pyx_TraceCall("get_augment_times", __pyx_f[0], 180, 0, __PYX_ERR(0, 180, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":181 + * + * def get_augment_times(self): + * raise NotImplementedError() # TODO # <<<<<<<<<<<<<< + * + * def rts_smooth(self, estimates, norm_quats=False): + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 181, __pyx_L1_error) + + /* "helpers/ekf_sym_pyx.pyx":180 + * raise NotImplementedError() # TODO + * + * def get_augment_times(self): # <<<<<<<<<<<<<< + * raise NotImplementedError() # TODO + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.get_augment_times", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":183 + * raise NotImplementedError() # TODO + * + * def rts_smooth(self, estimates, norm_quats=False): # <<<<<<<<<<<<<< + * raise NotImplementedError() # TODO + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_25rts_smooth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_25rts_smooth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_estimates = 0; + CYTHON_UNUSED PyObject *__pyx_v_norm_quats = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rts_smooth (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_estimates,&__pyx_n_s_norm_quats,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_estimates)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm_quats); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rts_smooth") < 0)) __PYX_ERR(0, 183, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_estimates = values[0]; + __pyx_v_norm_quats = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rts_smooth", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 183, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.rts_smooth", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_24rts_smooth(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self), __pyx_v_estimates, __pyx_v_norm_quats); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_24rts_smooth(CYTHON_UNUSED struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_estimates, CYTHON_UNUSED PyObject *__pyx_v_norm_quats) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rts_smooth", 0); + __Pyx_TraceCall("rts_smooth", __pyx_f[0], 183, 0, __PYX_ERR(0, 183, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":184 + * + * def rts_smooth(self, estimates, norm_quats=False): + * raise NotImplementedError() # TODO # <<<<<<<<<<<<<< + * + * def maha_test(self, x, P, kind, z, R, extra_args=[], maha_thresh=0.95): + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 184, __pyx_L1_error) + + /* "helpers/ekf_sym_pyx.pyx":183 + * raise NotImplementedError() # TODO + * + * def rts_smooth(self, estimates, norm_quats=False): # <<<<<<<<<<<<<< + * raise NotImplementedError() # TODO + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.rts_smooth", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":186 + * raise NotImplementedError() # TODO + * + * def maha_test(self, x, P, kind, z, R, extra_args=[], maha_thresh=0.95): # <<<<<<<<<<<<<< + * raise NotImplementedError() # TODO + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_27maha_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_27maha_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_x = 0; + CYTHON_UNUSED PyObject *__pyx_v_P = 0; + CYTHON_UNUSED PyObject *__pyx_v_kind = 0; + CYTHON_UNUSED PyObject *__pyx_v_z = 0; + CYTHON_UNUSED PyObject *__pyx_v_R = 0; + CYTHON_UNUSED PyObject *__pyx_v_extra_args = 0; + CYTHON_UNUSED PyObject *__pyx_v_maha_thresh = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("maha_test (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_P,&__pyx_n_s_kind,&__pyx_n_s_z,&__pyx_n_s_R,&__pyx_n_s_extra_args,&__pyx_n_s_maha_thresh,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; + values[5] = __pyx_k__5; + values[6] = ((PyObject *)__pyx_float_0_95); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("maha_test", 0, 5, 7, 1); __PYX_ERR(0, 186, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kind)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("maha_test", 0, 5, 7, 2); __PYX_ERR(0, 186, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_z)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("maha_test", 0, 5, 7, 3); __PYX_ERR(0, 186, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("maha_test", 0, 5, 7, 4); __PYX_ERR(0, 186, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extra_args); + if (value) { values[5] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 6: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maha_thresh); + if (value) { values[6] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "maha_test") < 0)) __PYX_ERR(0, 186, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_x = values[0]; + __pyx_v_P = values[1]; + __pyx_v_kind = values[2]; + __pyx_v_z = values[3]; + __pyx_v_R = values[4]; + __pyx_v_extra_args = values[5]; + __pyx_v_maha_thresh = values[6]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("maha_test", 0, 5, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 186, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.maha_test", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_26maha_test(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self), __pyx_v_x, __pyx_v_P, __pyx_v_kind, __pyx_v_z, __pyx_v_R, __pyx_v_extra_args, __pyx_v_maha_thresh); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_26maha_test(CYTHON_UNUSED struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_P, CYTHON_UNUSED PyObject *__pyx_v_kind, CYTHON_UNUSED PyObject *__pyx_v_z, CYTHON_UNUSED PyObject *__pyx_v_R, CYTHON_UNUSED PyObject *__pyx_v_extra_args, CYTHON_UNUSED PyObject *__pyx_v_maha_thresh) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maha_test", 0); + __Pyx_TraceCall("maha_test", __pyx_f[0], 186, 0, __PYX_ERR(0, 186, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":187 + * + * def maha_test(self, x, P, kind, z, R, extra_args=[], maha_thresh=0.95): + * raise NotImplementedError() # TODO # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 187, __pyx_L1_error) + + /* "helpers/ekf_sym_pyx.pyx":186 + * raise NotImplementedError() # TODO + * + * def maha_test(self, x, P, kind, z, R, extra_args=[], maha_thresh=0.95): # <<<<<<<<<<<<<< + * raise NotImplementedError() # TODO + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.maha_test", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "helpers/ekf_sym_pyx.pyx":189 + * raise NotImplementedError() # TODO + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del self.ekf + */ + +/* Python wrapper */ +static void __pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_29__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_29__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_28__dealloc__(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_28__dealloc__(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self) { + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__dealloc__", 0); + __Pyx_TraceCall("__dealloc__", __pyx_f[0], 189, 0, __PYX_ERR(0, 189, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":190 + * + * def __dealloc__(self): + * del self.ekf # <<<<<<<<<<<<<< + */ + delete __pyx_v_self->ekf; + + /* "helpers/ekf_sym_pyx.pyx":189 + * raise NotImplementedError() # TODO + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del self.ekf + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("helpers.ekf_sym_pyx.EKF_sym.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_30__reduce_cython__(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_32__setstate_cython__(((struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7helpers_11ekf_sym_pyx_7EKF_sym_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("helpers.ekf_sym_pyx.EKF_sym.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":735 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[2], 735, 0, __PYX_ERR(2, 735, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":736 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":735 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":738 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[2], 738, 0, __PYX_ERR(2, 738, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":739 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":738 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":741 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[2], 741, 0, __PYX_ERR(2, 741, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":742 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":741 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":744 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[2], 744, 0, __PYX_ERR(2, 744, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":745 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":744 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":747 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[2], 747, 0, __PYX_ERR(2, 747, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":748 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":747 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":750 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); + __Pyx_TraceCall("PyDataType_SHAPE", __pyx_f[2], 750, 0, __PYX_ERR(2, 750, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":751 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); + if (__pyx_t_1) { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":752 + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape # <<<<<<<<<<<<<< + * else: + * return () + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); + __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":751 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":754 + * return d.subarray.shape + * else: + * return () # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_r = __pyx_empty_tuple; + goto __pyx_L0; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":750 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("numpy.PyDataType_SHAPE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":929 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_array_base", 0); + __Pyx_TraceCall("set_array_base", __pyx_f[2], 929, 0, __PYX_ERR(2, 929, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":930 + * + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< + * PyArray_SetBaseObject(arr, base) + * + */ + Py_INCREF(__pyx_v_base); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":931 + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":929 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":933 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_v_base; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_array_base", 0); + __Pyx_TraceCall("get_array_base", __pyx_f[2], 933, 0, __PYX_ERR(2, 933, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":934 + * + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< + * if base is NULL: + * return None + */ + __pyx_v_base = PyArray_BASE(__pyx_v_arr); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":935 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + __pyx_t_1 = ((__pyx_v_base == NULL) != 0); + if (__pyx_t_1) { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":936 + * base = PyArray_BASE(arr) + * if base is NULL: + * return None # <<<<<<<<<<<<<< + * return base + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":935 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":937 + * if base is NULL: + * return None + * return base # <<<<<<<<<<<<<< + * + * # Versions of the import_* functions which are more suitable for + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_base)); + __pyx_r = ((PyObject *)__pyx_v_base); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":933 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":941 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_array", 0); + __Pyx_TraceCall("import_array", __pyx_f[2], 941, 0, __PYX_ERR(2, 941, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":943 + * cdef inline int import_array() except -1: + * try: + * __pyx_import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":944 + * try: + * __pyx_import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":945 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 945, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":941 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":947 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_umath", 0); + __Pyx_TraceCall("import_umath", __pyx_f[2], 947, 0, __PYX_ERR(2, 947, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":949 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":950 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":951 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 951, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":947 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":953 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_ufunc", 0); + __Pyx_TraceCall("import_ufunc", __pyx_f[2], 953, 0, __PYX_ERR(2, 953, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":955 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":956 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":957 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef extern from *: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 957, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":953 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":967 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_timedelta64_object", 0); + __Pyx_TraceCall("is_timedelta64_object", __pyx_f[2], 967, 0, __PYX_ERR(2, 967, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":979 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":967 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("numpy.is_timedelta64_object", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":982 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_datetime64_object", 0); + __Pyx_TraceCall("is_datetime64_object", __pyx_f[2], 982, 0, __PYX_ERR(2, 982, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":994 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":982 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("numpy.is_datetime64_object", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":997 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + +static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { + npy_datetime __pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("get_datetime64_value", __pyx_f[2], 997, 1, __PYX_ERR(2, 997, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1004 + * also needed. That can be found using `get_datetime64_unit`. + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":997 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("numpy.get_datetime64_value", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1007 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + +static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { + npy_timedelta __pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("get_timedelta64_value", __pyx_f[2], 1007, 1, __PYX_ERR(2, 1007, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1011 + * returns the int64 value underlying scalar numpy timedelta64 object + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1007 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("numpy.get_timedelta64_value", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1014 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + +static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { + NPY_DATETIMEUNIT __pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("get_datetime64_unit", __pyx_f[2], 1014, 1, __PYX_ERR(2, 1014, __pyx_L1_error)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1018 + * returns the unit part of the dtype for a numpy datetime64 object. + * """ + * return (obj).obmeta.base # <<<<<<<<<<<<<< + */ + __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1014 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("numpy.get_datetime64_unit", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = (NPY_DATETIMEUNIT) 0; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + +static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) { + Py_ssize_t __pyx_v_length; + char const *__pyx_v_data; + std::string __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + char const *__pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0); + __Pyx_TraceCall("__pyx_convert_string_from_py_std__in_string", __pyx_f[1], 13, 0, __PYX_ERR(1, 13, __pyx_L1_error)); + + /* "string.from_py":14 + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<< + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) + */ + __pyx_v_length = 0; + + /* "string.from_py":15 + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<< + * return string(data, length) + * + */ + __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(1, 15, __pyx_L1_error) + __pyx_v_data = __pyx_t_1; + + /* "string.from_py":16 + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = std::string(__pyx_v_data, __pyx_v_length); + goto __pyx_L0; + + /* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "vector.from_py":45 + * + * @cname("__pyx_convert_vector_from_py_int") + * cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *: # <<<<<<<<<<<<<< + * cdef vector[X] v + * for item in o: + */ + +static std::vector __pyx_convert_vector_from_py_int(PyObject *__pyx_v_o) { + std::vector __pyx_v_v; + PyObject *__pyx_v_item = NULL; + std::vector __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_int", 0); + __Pyx_TraceCall("__pyx_convert_vector_from_py_int", __pyx_f[1], 45, 0, __PYX_ERR(1, 45, __pyx_L1_error)); + + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 47, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); + __pyx_t_4 = 0; + + /* "vector.from_py":48 + * cdef vector[X] v + * for item in o: + * v.push_back(item) # <<<<<<<<<<<<<< + * return v + * + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_item); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error) + __pyx_v_v.push_back(((int)__pyx_t_5)); + + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "vector.from_py":49 + * for item in o: + * v.push_back(item) + * return v # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_v; + goto __pyx_L0; + + /* "vector.from_py":45 + * + * @cname("__pyx_convert_vector_from_py_int") + * cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *: # <<<<<<<<<<<<<< + * cdef vector[X] v + * for item in o: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static std::vector __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *__pyx_v_o) { + std::vector __pyx_v_v; + PyObject *__pyx_v_item = NULL; + std::vector __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + std::string __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_string", 0); + __Pyx_TraceCall("__pyx_convert_vector_from_py_std_3a__3a_string", __pyx_f[1], 45, 0, __PYX_ERR(1, 45, __pyx_L1_error)); + + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 47, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); + __pyx_t_4 = 0; + + /* "vector.from_py":48 + * cdef vector[X] v + * for item in o: + * v.push_back(item) # <<<<<<<<<<<<<< + * return v + * + */ + __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error) + __pyx_v_v.push_back(((std::string)__pyx_t_5)); + + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "vector.from_py":49 + * for item in o: + * v.push_back(item) + * return v # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_v; + goto __pyx_L0; + + /* "vector.from_py":45 + * + * @cname("__pyx_convert_vector_from_py_std_3a__3a_string") + * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *: # <<<<<<<<<<<<<< + * cdef vector[X] v + * for item in o: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":122 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + +/* Python wrapper */ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_shape = 0; + Py_ssize_t __pyx_v_itemsize; + PyObject *__pyx_v_format = 0; + PyObject *__pyx_v_mode = 0; + int __pyx_v_allocate_buffer; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)__pyx_n_s_c); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_shape = ((PyObject*)values[0]); + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error) + } else { + + /* "View.MemoryView":123 + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, + * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< + * + * cdef int idx + */ + __pyx_v_allocate_buffer = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error) + } + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); + + /* "View.MemoryView":122 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) { + int __pyx_v_idx; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_dim; + PyObject **__pyx_v_p; + char __pyx_v_order; + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_TraceCall("__cinit__", __pyx_f[1], 122, 0, __PYX_ERR(1, 122, __pyx_L1_error)); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":129 + * cdef PyObject **p + * + * self.ndim = len(shape) # <<<<<<<<<<<<<< + * self.itemsize = itemsize + * + */ + if (unlikely(__pyx_v_shape == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 129, __pyx_L1_error) + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":130 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":132 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":133 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 133, __pyx_L1_error) + + /* "View.MemoryView":132 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + } + + /* "View.MemoryView":135 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":136 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 136, __pyx_L1_error) + + /* "View.MemoryView":135 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + } + + /* "View.MemoryView":138 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + __pyx_t_2 = PyBytes_Check(__pyx_v_format); + __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":139 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":138 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + } + + /* "View.MemoryView":140 + * if not isinstance(format, bytes): + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error) + __pyx_t_3 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":141 + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * + * + */ + if (unlikely(__pyx_v_self->_format == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(1, 141, __pyx_L1_error) + } + __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_7; + + /* "View.MemoryView":144 + * + * + * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< + * self._strides = self._shape + self.ndim + * + */ + __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); + + /* "View.MemoryView":145 + * + * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) + * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< + * + * if not self._shape: + */ + __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); + + /* "View.MemoryView":147 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":148 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 148, __pyx_L1_error) + + /* "View.MemoryView":147 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + } + + /* "View.MemoryView":151 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + __pyx_t_8 = 0; + __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + for (;;) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_9; + __pyx_v_idx = __pyx_t_8; + __pyx_t_8 = (__pyx_t_8 + 1); + + /* "View.MemoryView":152 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":153 + * for idx, dim in enumerate(shape): + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< + * self._shape[idx] = dim + * + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6); + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(1, 153, __pyx_L1_error) + + /* "View.MemoryView":152 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + } + + /* "View.MemoryView":154 + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim # <<<<<<<<<<<<<< + * + * cdef char order + */ + (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; + + /* "View.MemoryView":151 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":157 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":158 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":159 + * if mode == 'fortran': + * order = b'F' + * self.mode = u'fortran' # <<<<<<<<<<<<<< + * elif mode == 'c': + * order = b'C' + */ + __Pyx_INCREF(__pyx_n_u_fortran); + __Pyx_GIVEREF(__pyx_n_u_fortran); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_fortran; + + /* "View.MemoryView":157 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":160 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error) + if (likely(__pyx_t_4)) { + + /* "View.MemoryView":161 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":162 + * elif mode == 'c': + * order = b'C' + * self.mode = u'c' # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + */ + __Pyx_INCREF(__pyx_n_u_c); + __Pyx_GIVEREF(__pyx_n_u_c); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_c; + + /* "View.MemoryView":160 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":164 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< + * + * self.len = fill_contig_strides_array(self._shape, self._strides, + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(1, 164, __pyx_L1_error) + } + __pyx_L10:; + + /* "View.MemoryView":166 + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + * + * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< + * itemsize, self.ndim, order) + * + */ + __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); + + /* "View.MemoryView":169 + * itemsize, self.ndim, order) + * + * self.free_data = allocate_buffer # <<<<<<<<<<<<<< + * self.dtype_is_object = format == b'O' + * if allocate_buffer: + */ + __pyx_v_self->free_data = __pyx_v_allocate_buffer; + + /* "View.MemoryView":170 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: + * + */ + __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":171 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = (__pyx_v_allocate_buffer != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":174 + * + * + * self.data = malloc(self.len) # <<<<<<<<<<<<<< + * if not self.data: + * raise MemoryError("unable to allocate array data.") + */ + __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); + + /* "View.MemoryView":175 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":176 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(1, 176, __pyx_L1_error) + + /* "View.MemoryView":175 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + } + + /* "View.MemoryView":178 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":179 + * + * if self.dtype_is_object: + * p = self.data # <<<<<<<<<<<<<< + * for i in range(self.len / itemsize): + * p[i] = Py_None + */ + __pyx_v_p = ((PyObject **)__pyx_v_self->data); + + /* "View.MemoryView":180 + * if self.dtype_is_object: + * p = self.data + * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< + * p[i] = Py_None + * Py_INCREF(Py_None) + */ + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(1, 180, __pyx_L1_error) + } + else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(1, 180, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + __pyx_t_9 = __pyx_t_1; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "View.MemoryView":181 + * p = self.data + * for i in range(self.len / itemsize): + * p[i] = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + (__pyx_v_p[__pyx_v_i]) = Py_None; + + /* "View.MemoryView":182 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + + /* "View.MemoryView":178 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + } + + /* "View.MemoryView":171 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":122 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":185 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_bufmode; + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + char *__pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 185, 0, __PYX_ERR(1, 185, __pyx_L1_error)); + + /* "View.MemoryView":186 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 # <<<<<<<<<<<<<< + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = -1; + + /* "View.MemoryView":187 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":188 + * cdef int bufmode = -1 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + + /* "View.MemoryView":187 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + goto __pyx_L3; + } + + /* "View.MemoryView":189 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":190 + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + */ + __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + + /* "View.MemoryView":189 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + } + __pyx_L3:; + + /* "View.MemoryView":191 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":192 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 192, __pyx_L1_error) + + /* "View.MemoryView":191 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + } + + /* "View.MemoryView":193 + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data # <<<<<<<<<<<<<< + * info.len = self.len + * info.ndim = self.ndim + */ + __pyx_t_4 = __pyx_v_self->data; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":194 + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + * info.len = self.len # <<<<<<<<<<<<<< + * info.ndim = self.ndim + * info.shape = self._shape + */ + __pyx_t_5 = __pyx_v_self->len; + __pyx_v_info->len = __pyx_t_5; + + /* "View.MemoryView":195 + * info.buf = self.data + * info.len = self.len + * info.ndim = self.ndim # <<<<<<<<<<<<<< + * info.shape = self._shape + * info.strides = self._strides + */ + __pyx_t_6 = __pyx_v_self->ndim; + __pyx_v_info->ndim = __pyx_t_6; + + /* "View.MemoryView":196 + * info.len = self.len + * info.ndim = self.ndim + * info.shape = self._shape # <<<<<<<<<<<<<< + * info.strides = self._strides + * info.suboffsets = NULL + */ + __pyx_t_7 = __pyx_v_self->_shape; + __pyx_v_info->shape = __pyx_t_7; + + /* "View.MemoryView":197 + * info.ndim = self.ndim + * info.shape = self._shape + * info.strides = self._strides # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = self.itemsize + */ + __pyx_t_7 = __pyx_v_self->_strides; + __pyx_v_info->strides = __pyx_t_7; + + /* "View.MemoryView":198 + * info.shape = self._shape + * info.strides = self._strides + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = self.itemsize + * info.readonly = 0 + */ + __pyx_v_info->suboffsets = NULL; + + /* "View.MemoryView":199 + * info.strides = self._strides + * info.suboffsets = NULL + * info.itemsize = self.itemsize # <<<<<<<<<<<<<< + * info.readonly = 0 + * + */ + __pyx_t_5 = __pyx_v_self->itemsize; + __pyx_v_info->itemsize = __pyx_t_5; + + /* "View.MemoryView":200 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":202 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":203 + * + * if flags & PyBUF_FORMAT: + * info.format = self.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_4 = __pyx_v_self->format; + __pyx_v_info->format = __pyx_t_4; + + /* "View.MemoryView":202 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":205 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":207 + * info.format = NULL + * + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":185 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":211 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + +/* Python wrapper */ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__dealloc__", 0); + __Pyx_TraceCall("__dealloc__", __pyx_f[1], 211, 0, __PYX_ERR(1, 211, __pyx_L1_error)); + + /* "View.MemoryView":212 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":213 + * def __dealloc__(array self): + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) # <<<<<<<<<<<<<< + * elif self.free_data: + * if self.dtype_is_object: + */ + __pyx_v_self->callback_free_data(__pyx_v_self->data); + + /* "View.MemoryView":212 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":214 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":215 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":216 + * elif self.free_data: + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< + * self._strides, self.ndim, False) + * free(self.data) + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); + + /* "View.MemoryView":215 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + } + + /* "View.MemoryView":218 + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + * free(self.data) # <<<<<<<<<<<<<< + * PyObject_Free(self._shape) + * + */ + free(__pyx_v_self->data); + + /* "View.MemoryView":214 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + } + __pyx_L3:; + + /* "View.MemoryView":219 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< + * + * @property + */ + PyObject_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":211 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":222 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[1], 222, 0, __PYX_ERR(1, 222, __pyx_L1_error)); + + /* "View.MemoryView":223 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< + * + * @cname('get_memview') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":222 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":226 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_memview", 0); + __Pyx_TraceCall("get_memview", __pyx_f[1], 226, 0, __PYX_ERR(1, 226, __pyx_L1_error)); + + /* "View.MemoryView":227 + * @cname('get_memview') + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":228 + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":226 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":230 + * return memoryview(self, flags, self.dtype_is_object) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self._shape[0] + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__len__", 0); + __Pyx_TraceCall("__len__", __pyx_f[1], 230, 0, __PYX_ERR(1, 230, __pyx_L1_error)); + + /* "View.MemoryView":231 + * + * def __len__(self): + * return self._shape[0] # <<<<<<<<<<<<<< + * + * def __getattr__(self, attr): + */ + __pyx_r = (__pyx_v_self->_shape[0]); + goto __pyx_L0; + + /* "View.MemoryView":230 + * return memoryview(self, flags, self.dtype_is_object) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self._shape[0] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":233 + * return self._shape[0] + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getattr__", 0); + __Pyx_TraceCall("__getattr__", __pyx_f[1], 233, 0, __PYX_ERR(1, 233, __pyx_L1_error)); + + /* "View.MemoryView":234 + * + * def __getattr__(self, attr): + * return getattr(self.memview, attr) # <<<<<<<<<<<<<< + * + * def __getitem__(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":233 + * return self._shape[0] + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":236 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + __Pyx_TraceCall("__getitem__", __pyx_f[1], 236, 0, __PYX_ERR(1, 236, __pyx_L1_error)); + + /* "View.MemoryView":237 + * + * def __getitem__(self, item): + * return self.memview[item] # <<<<<<<<<<<<<< + * + * def __setitem__(self, item, value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":236 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":239 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + +/* Python wrapper */ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_TraceCall("__setitem__", __pyx_f[1], 239, 0, __PYX_ERR(1, 239, __pyx_L1_error)); + + /* "View.MemoryView":240 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":239 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":244 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + +static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) { + struct __pyx_array_obj *__pyx_v_result = 0; + struct __pyx_array_obj *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_cwrapper", 0); + __Pyx_TraceCall("array_cwrapper", __pyx_f[1], 244, 0, __PYX_ERR(1, 244, __pyx_L1_error)); + + /* "View.MemoryView":248 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":249 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":248 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":251 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":252 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error) + + /* "View.MemoryView":251 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":253 + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) + * result.data = buf # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->data = __pyx_v_buf; + } + __pyx_L3:; + + /* "View.MemoryView":255 + * result.data = buf + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":244 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":281 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + +/* Python wrapper */ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_TraceCall("__init__", __pyx_f[1], 281, 0, __PYX_ERR(1, 281, __pyx_L1_error)); + + /* "View.MemoryView":282 + * cdef object name + * def __init__(self, name): + * self.name = name # <<<<<<<<<<<<<< + * def __repr__(self): + * return self.name + */ + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_name; + + /* "View.MemoryView":281 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":283 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + +/* Python wrapper */ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + __Pyx_TraceCall("__repr__", __pyx_f[1], 283, 0, __PYX_ERR(1, 283, __pyx_L1_error)); + + /* "View.MemoryView":284 + * self.name = name + * def __repr__(self): + * return self.name # <<<<<<<<<<<<<< + * + * cdef generic = Enum("") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* "View.MemoryView":283 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_v_state = 0; + PyObject *__pyx_v__dict = 0; + int __pyx_v_use_setstate; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); + + /* "(tree fragment)":5 + * cdef object _dict + * cdef bint use_setstate + * state = (self.name,) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->name); + __Pyx_GIVEREF(__pyx_v_self->name); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name); + __pyx_v_state = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "(tree fragment)":6 + * cdef bint use_setstate + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":7 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":8 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "(tree fragment)":9 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self.name is not None + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":7 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":11 + * use_setstate = True + * else: + * use_setstate = self.name is not None # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_self->name != Py_None); + __pyx_v_use_setstate = __pyx_t_3; + } + __pyx_L3:; + + /* "(tree fragment)":12 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":13 + * use_setstate = self.name is not None + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184977713); + __Pyx_GIVEREF(__pyx_int_184977713); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":12 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + } + + /* "(tree fragment)":15 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184977713); + __Pyx_GIVEREF(__pyx_int_184977713); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":16 + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error)); + + /* "(tree fragment)":17 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":298 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + +static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) { + Py_intptr_t __pyx_v_aligned_p; + size_t __pyx_v_offset; + void *__pyx_r; + __Pyx_TraceDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("align_pointer", __pyx_f[1], 298, 1, __PYX_ERR(1, 298, __pyx_L1_error)); + + /* "View.MemoryView":300 + * cdef void *align_pointer(void *memory, size_t alignment) nogil: + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< + * cdef size_t offset + * + */ + __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); + + /* "View.MemoryView":304 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":306 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + __pyx_t_1 = ((__pyx_v_offset > 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":307 + * + * if offset > 0: + * aligned_p += alignment - offset # <<<<<<<<<<<<<< + * + * return aligned_p + */ + __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); + + /* "View.MemoryView":306 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + } + + /* "View.MemoryView":309 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":298 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "View.MemoryView":345 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + +/* Python wrapper */ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_obj = 0; + int __pyx_v_flags; + int __pyx_v_dtype_is_object; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_obj = values[0]; + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_TraceCall("__cinit__", __pyx_f[1], 345, 0, __PYX_ERR(1, 345, __pyx_L1_error)); + + /* "View.MemoryView":346 + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj # <<<<<<<<<<<<<< + * self.flags = flags + * if type(self) is memoryview or obj is not None: + */ + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __Pyx_GOTREF(__pyx_v_self->obj); + __Pyx_DECREF(__pyx_v_self->obj); + __pyx_v_self->obj = __pyx_v_obj; + + /* "View.MemoryView":347 + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj + * self.flags = flags # <<<<<<<<<<<<<< + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + */ + __pyx_v_self->flags = __pyx_v_flags; + + /* "View.MemoryView":348 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_obj != Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "View.MemoryView":349 + * self.flags = flags + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + */ + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error) + + /* "View.MemoryView":350 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":351 + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; + + /* "View.MemoryView":352 + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * global __pyx_memoryview_thread_locks_used + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":350 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + } + + /* "View.MemoryView":348 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + } + + /* "View.MemoryView":355 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":356 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + */ + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + + /* "View.MemoryView":357 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + + /* "View.MemoryView":355 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + } + + /* "View.MemoryView":358 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":359 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":360 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":361 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error) + + /* "View.MemoryView":360 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } + + /* "View.MemoryView":358 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + } + + /* "View.MemoryView":363 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":364 + * + * if flags & PyBUF_FORMAT: + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< + * else: + * self.dtype_is_object = dtype_is_object + */ + __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L11_bool_binop_done:; + __pyx_v_self->dtype_is_object = __pyx_t_1; + + /* "View.MemoryView":363 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + goto __pyx_L10; + } + + /* "View.MemoryView":366 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L10:; + + /* "View.MemoryView":368 + * self.dtype_is_object = dtype_is_object + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL + */ + __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); + + /* "View.MemoryView":370 + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL # <<<<<<<<<<<<<< + * + * def __dealloc__(memoryview self): + */ + __pyx_v_self->typeinfo = NULL; + + /* "View.MemoryView":345 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":372 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + +/* Python wrapper */ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyThread_type_lock __pyx_t_6; + PyThread_type_lock __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__dealloc__", 0); + __Pyx_TraceCall("__dealloc__", __pyx_f[1], 372, 0, __PYX_ERR(1, 372, __pyx_L1_error)); + + /* "View.MemoryView":373 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + */ + __pyx_t_1 = (__pyx_v_self->obj != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":374 + * def __dealloc__(memoryview self): + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + * + */ + __Pyx_ReleaseBuffer((&__pyx_v_self->view)); + + /* "View.MemoryView":373 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":375 + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< + * + * (<__pyx_buffer *> &self.view).obj = NULL + */ + __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":377 + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + * + * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<< + * Py_DECREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL; + + /* "View.MemoryView":378 + * + * (<__pyx_buffer *> &self.view).obj = NULL + * Py_DECREF(Py_None) # <<<<<<<<<<<<<< + * + * cdef int i + */ + Py_DECREF(Py_None); + + /* "View.MemoryView":375 + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< + * + * (<__pyx_buffer *> &self.view).obj = NULL + */ + } + __pyx_L3:; + + /* "View.MemoryView":382 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":383 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":384 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":385 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + + /* "View.MemoryView":386 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":388 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]); + + /* "View.MemoryView":387 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break + */ + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7; + + /* "View.MemoryView":386 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + } + + /* "View.MemoryView":389 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< + * else: + * PyThread_free_lock(self.lock) + */ + goto __pyx_L6_break; + + /* "View.MemoryView":384 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + } + } + /*else*/ { + + /* "View.MemoryView":391 + * break + * else: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + */ + PyThread_free_lock(__pyx_v_self->lock); + } + __pyx_L6_break:; + + /* "View.MemoryView":382 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + } + + /* "View.MemoryView":372 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":393 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + Py_ssize_t __pyx_v_dim; + char *__pyx_v_itemp; + PyObject *__pyx_v_idx = NULL; + char *__pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + char *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item_pointer", 0); + __Pyx_TraceCall("get_item_pointer", __pyx_f[1], 393, 0, __PYX_ERR(1, 393, __pyx_L1_error)); + + /* "View.MemoryView":395 + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< + * + * for dim, idx in enumerate(index): + */ + __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); + + /* "View.MemoryView":397 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + */ + __pyx_t_1 = 0; + if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) { + __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 397, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_1; + __pyx_t_1 = (__pyx_t_1 + 1); + + /* "View.MemoryView":398 + * + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + * + * return itemp + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; + + /* "View.MemoryView":397 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":400 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":393 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":403 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_indices = NULL; + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + __Pyx_TraceCall("__getitem__", __pyx_f[1], 403, 0, __PYX_ERR(1, 403, __pyx_L1_error)); + + /* "View.MemoryView":404 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":405 + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: + * return self # <<<<<<<<<<<<<< + * + * have_slices, indices = _unellipsify(index, self.view.ndim) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "View.MemoryView":404 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + } + + /* "View.MemoryView":407 + * return self + * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp + */ + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 407, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":410 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error) + if (__pyx_t_2) { + + /* "View.MemoryView":411 + * cdef char *itemp + * if have_slices: + * return memview_slice(self, indices) # <<<<<<<<<<<<<< + * else: + * itemp = self.get_item_pointer(indices) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":410 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + } + + /* "View.MemoryView":413 + * return memview_slice(self, indices) + * else: + * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< + * return self.convert_item_to_object(itemp) + * + */ + /*else*/ { + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":414 + * else: + * itemp = self.get_item_pointer(indices) + * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< + * + * def __setitem__(memoryview self, object index, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":403 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":416 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_obj = NULL; + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_TraceCall("__setitem__", __pyx_f[1], 416, 0, __PYX_ERR(1, 416, __pyx_L1_error)); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":417 + * + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: # <<<<<<<<<<<<<< + * raise TypeError("Cannot assign to read-only memoryview") + * + */ + __pyx_t_1 = (__pyx_v_self->view.readonly != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":418 + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< + * + * have_slices, index = _unellipsify(index, self.view.ndim) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 418, __pyx_L1_error) + + /* "View.MemoryView":417 + * + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: # <<<<<<<<<<<<<< + * raise TypeError("Cannot assign to read-only memoryview") + * + */ + } + + /* "View.MemoryView":420 + * raise TypeError("Cannot assign to read-only memoryview") + * + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: + */ + __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(__pyx_t_2 != Py_None)) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 420, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":422 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error) + if (__pyx_t_1) { + + /* "View.MemoryView":423 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_obj = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":424 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error) + if (__pyx_t_1) { + + /* "View.MemoryView":425 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "View.MemoryView":424 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":427 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L5:; + + /* "View.MemoryView":422 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":429 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + /*else*/ { + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L4:; + + /* "View.MemoryView":416 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":431 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_slice", 0); + __Pyx_TraceCall("is_slice", __pyx_f[1], 431, 0, __PYX_ERR(1, 431, __pyx_L1_error)); + __Pyx_INCREF(__pyx_v_obj); + + /* "View.MemoryView":432 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":433 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "View.MemoryView":434 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":435 + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":434 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + + /* "View.MemoryView":433 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "View.MemoryView":436 + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + * except TypeError: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":437 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "View.MemoryView":433 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":432 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + */ + } + + /* "View.MemoryView":439 + * return None + * + * return obj # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assignment(self, dst, src): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + + /* "View.MemoryView":431 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":441 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) { + __Pyx_memviewslice __pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_src_slice; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + __Pyx_memviewslice *__pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); + __Pyx_TraceCall("setitem_slice_assignment", __pyx_f[1], 441, 0, __PYX_ERR(1, 441, __pyx_L1_error)); + + /* "View.MemoryView":445 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error) + + /* "View.MemoryView":446 + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) + * + */ + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error) + + /* "View.MemoryView":447 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":445 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error) + + /* "View.MemoryView":441 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":449 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) { + int __pyx_v_array[0x80]; + void *__pyx_v_tmp; + void *__pyx_v_item; + __Pyx_memviewslice *__pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_tmp_slice; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + char const *__pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); + __Pyx_TraceCall("setitem_slice_assign_scalar", __pyx_f[1], 449, 0, __PYX_ERR(1, 449, __pyx_L1_error)); + + /* "View.MemoryView":451 + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * cdef int array[128] + * cdef void *tmp = NULL # <<<<<<<<<<<<<< + * cdef void *item + * + */ + __pyx_v_tmp = NULL; + + /* "View.MemoryView":456 + * cdef __Pyx_memviewslice *dst_slice + * cdef __Pyx_memviewslice tmp_slice + * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< + * + * if self.view.itemsize > sizeof(array): + */ + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error) + __pyx_v_dst_slice = __pyx_t_1; + + /* "View.MemoryView":458 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":459 + * + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< + * if tmp == NULL: + * raise MemoryError + */ + __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); + + /* "View.MemoryView":460 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":461 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error) + + /* "View.MemoryView":460 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + } + + /* "View.MemoryView":462 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + + /* "View.MemoryView":458 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":464 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":466 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":467 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":468 + * try: + * if self.dtype_is_object: + * ( item)[0] = value # <<<<<<<<<<<<<< + * else: + * self.assign_item_from_object( item, value) + */ + (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); + + /* "View.MemoryView":467 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":470 + * ( item)[0] = value + * else: + * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":474 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":475 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":474 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + } + + /* "View.MemoryView":476 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * item, self.dtype_is_object) + * finally: + */ + __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); + } + + /* "View.MemoryView":479 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + __pyx_L6_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; + { + PyMem_Free(__pyx_v_tmp); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "View.MemoryView":449 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":481 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + char *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_indexed", 0); + __Pyx_TraceCall("setitem_indexed", __pyx_f[1], 481, 0, __PYX_ERR(1, 481, __pyx_L1_error)); + + /* "View.MemoryView":482 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":483 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":481 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":485 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_v_struct = NULL; + PyObject *__pyx_v_bytesitem = 0; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + size_t __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 485, 0, __PYX_ERR(1, 485, __pyx_L1_error)); + + /* "View.MemoryView":488 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":491 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":492 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "View.MemoryView":493 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":492 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + } + + /* "View.MemoryView":497 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { + + /* "View.MemoryView":498 + * else: + * if len(self.view.format) == 1: + * return result[0] # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; + + /* "View.MemoryView":497 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + } + + /* "View.MemoryView":499 + * if len(self.view.format) == 1: + * return result[0] + * return result # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L6_except_return; + } + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "View.MemoryView":494 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9); + __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_1); + + /* "View.MemoryView":495 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 495, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "View.MemoryView":492 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } + + /* "View.MemoryView":485 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesitem); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":501 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_v_struct = NULL; + char __pyx_v_c; + PyObject *__pyx_v_bytesvalue = 0; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + char *__pyx_t_11; + char *__pyx_t_12; + char *__pyx_t_13; + char *__pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 501, 0, __PYX_ERR(1, 501, __pyx_L1_error)); + + /* "View.MemoryView":504 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":509 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":510 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":509 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":512 + * bytesvalue = struct.pack(self.view.format, *value) + * else: + * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< + * + * for i, c in enumerate(bytesvalue): + */ + /*else*/ { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":514 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_9 = 0; + if (unlikely(__pyx_v_bytesvalue == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); + __PYX_ERR(1, 514, __pyx_L1_error) + } + __Pyx_INCREF(__pyx_v_bytesvalue); + __pyx_t_10 = __pyx_v_bytesvalue; + __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10); + __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10)); + for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) { + __pyx_t_11 = __pyx_t_14; + __pyx_v_c = (__pyx_t_11[0]); + + /* "View.MemoryView":515 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_9; + + /* "View.MemoryView":514 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_9 = (__pyx_t_9 + 1); + + /* "View.MemoryView":515 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "View.MemoryView":501 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesvalue); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":518 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t *__pyx_t_4; + char *__pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 518, 0, __PYX_ERR(1, 518, __pyx_L1_error)); + + /* "View.MemoryView":519 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + */ + __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_self->view.readonly != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":520 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< + * + * if flags & PyBUF_ND: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 520, __pyx_L1_error) + + /* "View.MemoryView":519 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + */ + } + + /* "View.MemoryView":522 + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + * if flags & PyBUF_ND: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":523 + * + * if flags & PyBUF_ND: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_4 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_4; + + /* "View.MemoryView":522 + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + * if flags & PyBUF_ND: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":525 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + /*else*/ { + __pyx_v_info->shape = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":527 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":528 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_4 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_4; + + /* "View.MemoryView":527 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + goto __pyx_L7; + } + + /* "View.MemoryView":530 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L7:; + + /* "View.MemoryView":532 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":533 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_4 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_4; + + /* "View.MemoryView":532 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":535 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L8:; + + /* "View.MemoryView":537 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":538 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_5 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_5; + + /* "View.MemoryView":537 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":540 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L9:; + + /* "View.MemoryView":542 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_6 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_6; + + /* "View.MemoryView":543 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_7 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_7; + + /* "View.MemoryView":544 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = self.view.readonly + */ + __pyx_t_8 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_8; + + /* "View.MemoryView":545 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = self.view.readonly + * info.obj = self + */ + __pyx_t_8 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_8; + + /* "View.MemoryView":546 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = self.view.readonly # <<<<<<<<<<<<<< + * info.obj = self + * + */ + __pyx_t_1 = __pyx_v_self->view.readonly; + __pyx_v_info->readonly = __pyx_t_1; + + /* "View.MemoryView":547 + * info.len = self.view.len + * info.readonly = self.view.readonly + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":518 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":553 + * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[1], 553, 0, __PYX_ERR(1, 553, __pyx_L1_error)); + + /* "View.MemoryView":554 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":555 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error) + + /* "View.MemoryView":556 + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + * return result # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":553 + * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":559 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[1], 559, 0, __PYX_ERR(1, 559, __pyx_L1_error)); + + /* "View.MemoryView":560 + * @property + * def base(self): + * return self.obj # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->obj); + __pyx_r = __pyx_v_self->obj; + goto __pyx_L0; + + /* "View.MemoryView":559 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":563 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_length; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[1], 563, 0, __PYX_ERR(1, 563, __pyx_L1_error)); + + /* "View.MemoryView":564 + * @property + * def shape(self): + * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); + for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { + __pyx_t_2 = __pyx_t_4; + __pyx_v_length = (__pyx_t_2[0]); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":563 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":567 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_stride; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[1], 567, 0, __PYX_ERR(1, 567, __pyx_L1_error)); + + /* "View.MemoryView":568 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":570 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 570, __pyx_L1_error) + + /* "View.MemoryView":568 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + } + + /* "View.MemoryView":572 + * raise ValueError("Buffer view does not expose strides") + * + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); + for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { + __pyx_t_3 = __pyx_t_5; + __pyx_v_stride = (__pyx_t_3[0]); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "View.MemoryView":567 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":575 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + Py_ssize_t *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[1], 575, 0, __PYX_ERR(1, 575, __pyx_L1_error)); + + /* "View.MemoryView":576 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":577 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__21, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":576 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + } + + /* "View.MemoryView":579 + * return (-1,) * self.view.ndim + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":575 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":582 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[1], 582, 0, __PYX_ERR(1, 582, __pyx_L1_error)); + + /* "View.MemoryView":583 + * @property + * def ndim(self): + * return self.view.ndim # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":582 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":586 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[1], 586, 0, __PYX_ERR(1, 586, __pyx_L1_error)); + + /* "View.MemoryView":587 + * @property + * def itemsize(self): + * return self.view.itemsize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":586 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":590 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[1], 590, 0, __PYX_ERR(1, 590, __pyx_L1_error)); + + /* "View.MemoryView":591 + * @property + * def nbytes(self): + * return self.size * self.view.itemsize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":590 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":594 + * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[1], 594, 0, __PYX_ERR(1, 594, __pyx_L1_error)); + + /* "View.MemoryView":595 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":596 + * def size(self): + * if self._size is None: + * result = 1 # <<<<<<<<<<<<<< + * + * for length in self.view.shape[:self.view.ndim]: + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_result = __pyx_int_1; + + /* "View.MemoryView":598 + * result = 1 + * + * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< + * result *= length + * + */ + __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); + for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { + __pyx_t_3 = __pyx_t_5; + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; + + /* "View.MemoryView":599 + * + * for length in self.view.shape[:self.view.ndim]: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + } + + /* "View.MemoryView":601 + * result *= length + * + * self._size = result # <<<<<<<<<<<<<< + * + * return self._size + */ + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_GOTREF(__pyx_v_self->_size); + __Pyx_DECREF(__pyx_v_self->_size); + __pyx_v_self->_size = __pyx_v_result; + + /* "View.MemoryView":595 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + } + + /* "View.MemoryView":603 + * self._size = result + * + * return self._size # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_size); + __pyx_r = __pyx_v_self->_size; + goto __pyx_L0; + + /* "View.MemoryView":594 + * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":605 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__len__", 0); + __Pyx_TraceCall("__len__", __pyx_f[1], 605, 0, __PYX_ERR(1, 605, __pyx_L1_error)); + + /* "View.MemoryView":606 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":607 + * def __len__(self): + * if self.view.ndim >= 1: + * return self.view.shape[0] # <<<<<<<<<<<<<< + * + * return 0 + */ + __pyx_r = (__pyx_v_self->view.shape[0]); + goto __pyx_L0; + + /* "View.MemoryView":606 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + } + + /* "View.MemoryView":609 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":605 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":611 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + __Pyx_TraceCall("__repr__", __pyx_f[1], 611, 0, __PYX_ERR(1, 611, __pyx_L1_error)); + + /* "View.MemoryView":612 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":613 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "View.MemoryView":612 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":611 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":615 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + __Pyx_TraceCall("__str__", __pyx_f[1], 615, 0, __PYX_ERR(1, 615, __pyx_L1_error)); + + /* "View.MemoryView":616 + * + * def __str__(self): + * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":615 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":619 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_c_contig", 0); + __Pyx_TraceCall("is_c_contig", __pyx_f[1], 619, 0, __PYX_ERR(1, 619, __pyx_L1_error)); + + /* "View.MemoryView":622 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + */ + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":623 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< + * + * def is_f_contig(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":619 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":625 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_f_contig", 0); + __Pyx_TraceCall("is_f_contig", __pyx_f[1], 625, 0, __PYX_ERR(1, 625, __pyx_L1_error)); + + /* "View.MemoryView":628 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + */ + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":629 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< + * + * def copy(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":625 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":631 + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_mslice; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy", 0); + __Pyx_TraceCall("copy", __pyx_f[1], 631, 0, __PYX_ERR(1, 631, __pyx_L1_error)); + + /* "View.MemoryView":633 + * def copy(self): + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &mslice) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); + + /* "View.MemoryView":635 + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * + * slice_copy(self, &mslice) # <<<<<<<<<<<<<< + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); + + /* "View.MemoryView":636 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":641 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< + * + * def copy_fortran(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":631 + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":643 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy_fortran", 0); + __Pyx_TraceCall("copy_fortran", __pyx_f[1], 643, 0, __PYX_ERR(1, 643, __pyx_L1_error)); + + /* "View.MemoryView":645 + * def copy_fortran(self): + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &src) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); + + /* "View.MemoryView":647 + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + * + * slice_copy(self, &src) # <<<<<<<<<<<<<< + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); + + /* "View.MemoryView":648 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":653 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":643 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":657 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + +static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) { + struct __pyx_memoryview_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + __Pyx_TraceCall("memoryview_cwrapper", __pyx_f[1], 657, 0, __PYX_ERR(1, 657, __pyx_L1_error)); + + /* "View.MemoryView":658 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":659 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":660 + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_check') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":657 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":663 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_check", 0); + __Pyx_TraceCall("memoryview_check", __pyx_f[1], 663, 0, __PYX_ERR(1, 663, __pyx_L1_error)); + + /* "View.MemoryView":664 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + * + * cdef tuple _unellipsify(object index, int ndim): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":663 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":666 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + +static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { + PyObject *__pyx_v_tup = NULL; + PyObject *__pyx_v_result = NULL; + int __pyx_v_have_slices; + int __pyx_v_seen_ellipsis; + CYTHON_UNUSED PyObject *__pyx_v_idx = NULL; + PyObject *__pyx_v_item = NULL; + Py_ssize_t __pyx_v_nslices; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_unellipsify", 0); + __Pyx_TraceCall("_unellipsify", __pyx_f[1], 666, 0, __PYX_ERR(1, 666, __pyx_L1_error)); + + /* "View.MemoryView":671 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":672 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + + /* "View.MemoryView":671 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":674 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":676 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":677 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":678 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":679 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; + if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) { + __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 679, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":680 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":681 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":682 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__24); + __Pyx_GIVEREF(__pyx_slice__24); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__24); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":683 + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True # <<<<<<<<<<<<<< + * else: + * result.append(slice(None)) + */ + __pyx_v_seen_ellipsis = 1; + + /* "View.MemoryView":681 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + goto __pyx_L7; + } + + /* "View.MemoryView":685 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__24); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":686 + * else: + * result.append(slice(None)) + * have_slices = True # <<<<<<<<<<<<<< + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + */ + __pyx_v_have_slices = 1; + + /* "View.MemoryView":680 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + goto __pyx_L6; + } + + /* "View.MemoryView":688 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + /*else*/ { + __pyx_t_2 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_1 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":689 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_11, 0, 0, 0); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __PYX_ERR(1, 689, __pyx_L1_error) + + /* "View.MemoryView":688 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + } + + /* "View.MemoryView":691 + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< + * result.append(item) + * + */ + __pyx_t_10 = (__pyx_v_have_slices != 0); + if (!__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = (__pyx_t_10 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L11_bool_binop_done:; + __pyx_v_have_slices = __pyx_t_1; + + /* "View.MemoryView":692 + * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error) + } + __pyx_L6:; + + /* "View.MemoryView":679 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":694 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":695 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":696 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__24); + __Pyx_GIVEREF(__pyx_slice__24); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__24); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":695 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + } + + /* "View.MemoryView":698 + * result.extend([slice(None)] * nslices) + * + * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + */ + __Pyx_XDECREF(__pyx_r); + if (!__pyx_v_have_slices) { + } else { + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_11); + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "View.MemoryView":666 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":700 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + */ + +static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) { + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); + __Pyx_TraceCall("assert_direct_dimensions", __pyx_f[1], 700, 0, __PYX_ERR(1, 700, __pyx_L1_error)); + + /* "View.MemoryView":701 + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") + */ + __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim); + for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) { + __pyx_t_1 = __pyx_t_3; + __pyx_v_suboffset = (__pyx_t_1[0]); + + /* "View.MemoryView":702 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":703 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 703, __pyx_L1_error) + + /* "View.MemoryView":702 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + } + } + + /* "View.MemoryView":700 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":710 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) { + int __pyx_v_new_ndim; + int __pyx_v_suboffset_dim; + int __pyx_v_dim; + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + __Pyx_memviewslice *__pyx_v_p_src; + struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0; + __Pyx_memviewslice *__pyx_v_p_dst; + int *__pyx_v_p_suboffset_dim; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + int __pyx_v_have_start; + int __pyx_v_have_stop; + int __pyx_v_have_step; + PyObject *__pyx_v_index = NULL; + struct __pyx_memoryview_obj *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + struct __pyx_memoryview_obj *__pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memview_slice", 0); + __Pyx_TraceCall("memview_slice", __pyx_f[1], 710, 0, __PYX_ERR(1, 710, __pyx_L1_error)); + + /* "View.MemoryView":711 + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): + * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< + * cdef bint negative_step + * cdef __Pyx_memviewslice src, dst + */ + __pyx_v_new_ndim = 0; + __pyx_v_suboffset_dim = -1; + + /* "View.MemoryView":718 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); + + /* "View.MemoryView":722 + * cdef _memoryviewslice memviewsliceobj + * + * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 722, __pyx_L1_error) + } + } + #endif + + /* "View.MemoryView":724 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":725 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":726 + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, &src) + */ + __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); + + /* "View.MemoryView":724 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + goto __pyx_L3; + } + + /* "View.MemoryView":728 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":729 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":735 + * + * + * dst.memview = p_src.memview # <<<<<<<<<<<<<< + * dst.data = p_src.data + * + */ + __pyx_t_4 = __pyx_v_p_src->memview; + __pyx_v_dst.memview = __pyx_t_4; + + /* "View.MemoryView":736 + * + * dst.memview = p_src.memview + * dst.data = p_src.data # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_v_p_src->data; + __pyx_v_dst.data = __pyx_t_5; + + /* "View.MemoryView":741 + * + * + * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< + * cdef int *p_suboffset_dim = &suboffset_dim + * cdef Py_ssize_t start, stop, step + */ + __pyx_v_p_dst = (&__pyx_v_dst); + + /* "View.MemoryView":742 + * + * cdef __Pyx_memviewslice *p_dst = &dst + * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step + * cdef bint have_start, have_stop, have_step + */ + __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); + + /* "View.MemoryView":746 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + __pyx_t_6 = 0; + if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) { + __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 746, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_v_dim = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":747 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":751 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error) + + /* "View.MemoryView":748 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error) + + /* "View.MemoryView":747 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + goto __pyx_L6; + } + + /* "View.MemoryView":754 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":755 + * False) + * elif index is None: + * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + */ + (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; + + /* "View.MemoryView":756 + * elif index is None: + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 + */ + (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; + + /* "View.MemoryView":757 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + + /* "View.MemoryView":758 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 # <<<<<<<<<<<<<< + * else: + * start = index.start or 0 + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + + /* "View.MemoryView":754 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + goto __pyx_L6; + } + + /* "View.MemoryView":760 + * new_ndim += 1 + * else: + * start = index.start or 0 # <<<<<<<<<<<<<< + * stop = index.stop or 0 + * step = index.step or 0 + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":761 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":762 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":764 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":765 + * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":766 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< + * + * slice_memviewslice( + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":768 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error) + + /* "View.MemoryView":774 + * have_start, have_stop, have_step, + * True) + * new_ndim += 1 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + } + __pyx_L6:; + + /* "View.MemoryView":746 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":776 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":777 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":778 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) } + + /* "View.MemoryView":779 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) } + + /* "View.MemoryView":777 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":776 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + } + + /* "View.MemoryView":782 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":783 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":782 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":710 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":807 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) { + Py_ssize_t __pyx_v_new_shape; + int __pyx_v_negative_step; + int __pyx_r; + __Pyx_TraceDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("slice_memviewslice", __pyx_f[1], 807, 1, __PYX_ERR(1, 807, __pyx_L1_error)); + + /* "View.MemoryView":827 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":829 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + __pyx_t_1 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":830 + * + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":829 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + } + + /* "View.MemoryView":831 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_t_1 = (0 <= __pyx_v_start); + if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_start < __pyx_v_shape); + } + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":832 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error) + + /* "View.MemoryView":831 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + } + + /* "View.MemoryView":827 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":835 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + /*else*/ { + __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); + if (__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_1 = ((__pyx_v_step < 0) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L6_bool_binop_done:; + __pyx_v_negative_step = __pyx_t_2; + + /* "View.MemoryView":837 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + __pyx_t_1 = (__pyx_v_have_step != 0); + if (__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_1 = ((__pyx_v_step == 0) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L9_bool_binop_done:; + if (__pyx_t_2) { + + /* "View.MemoryView":838 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error) + + /* "View.MemoryView":837 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + } + + /* "View.MemoryView":841 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":842 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":843 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":844 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":845 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":844 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":842 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + goto __pyx_L12; + } + + /* "View.MemoryView":846 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":847 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":848 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":847 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } + + /* "View.MemoryView":850 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; + + /* "View.MemoryView":846 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + } + __pyx_L12:; + + /* "View.MemoryView":841 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; + } + + /* "View.MemoryView":852 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":853 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":852 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L15; + } + + /* "View.MemoryView":855 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; + + /* "View.MemoryView":857 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":858 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":859 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":860 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":861 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + + /* "View.MemoryView":860 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + } + + /* "View.MemoryView":858 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + goto __pyx_L17; + } + + /* "View.MemoryView":862 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":863 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + + /* "View.MemoryView":862 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + } + __pyx_L17:; + + /* "View.MemoryView":857 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + goto __pyx_L16; + } + + /* "View.MemoryView":865 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":866 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1L; + + /* "View.MemoryView":865 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + goto __pyx_L19; + } + + /* "View.MemoryView":868 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + /*else*/ { + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L19:; + } + __pyx_L16:; + + /* "View.MemoryView":870 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":871 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + + /* "View.MemoryView":870 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + } + + /* "View.MemoryView":875 + * + * with cython.cdivision(True): + * new_shape = (stop - start) // step # <<<<<<<<<<<<<< + * + * if (stop - start) - step * new_shape: + */ + __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); + + /* "View.MemoryView":877 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":878 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + + /* "View.MemoryView":877 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + } + + /* "View.MemoryView":880 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":881 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + + /* "View.MemoryView":880 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + } + + /* "View.MemoryView":884 + * + * + * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset + */ + (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); + + /* "View.MemoryView":885 + * + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< + * dst.suboffsets[new_ndim] = suboffset + * + */ + (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; + + /* "View.MemoryView":886 + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; + } + __pyx_L3:; + + /* "View.MemoryView":889 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":890 + * + * if suboffset_dim[0] < 0: + * dst.data += start * stride # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride + */ + __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); + + /* "View.MemoryView":889 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + goto __pyx_L23; + } + + /* "View.MemoryView":892 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L23:; + + /* "View.MemoryView":894 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":895 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":896 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":897 + * if not is_slice: + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + */ + __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); + + /* "View.MemoryView":896 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + goto __pyx_L26; + } + + /* "View.MemoryView":899 + * dst.data = ( dst.data)[0] + suboffset + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< + * "must be indexed and not sliced", dim) + * else: + */ + /*else*/ { + + /* "View.MemoryView":900 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error) + } + __pyx_L26:; + + /* "View.MemoryView":895 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + goto __pyx_L25; + } + + /* "View.MemoryView":902 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; + + /* "View.MemoryView":894 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + } + + /* "View.MemoryView":904 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":807 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "View.MemoryView":910 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + +static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_suboffset; + Py_ssize_t __pyx_v_itemsize; + char *__pyx_v_resultp; + char *__pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pybuffer_index", 0); + __Pyx_TraceCall("pybuffer_index", __pyx_f[1], 910, 0, __PYX_ERR(1, 910, __pyx_L1_error)); + + /* "View.MemoryView":912 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1L; + + /* "View.MemoryView":913 + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< + * cdef char *resultp + * + */ + __pyx_t_1 = __pyx_v_view->itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":916 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":917 + * + * if view.ndim == 0: + * shape = view.len / itemsize # <<<<<<<<<<<<<< + * stride = itemsize + * else: + */ + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(1, 917, __pyx_L1_error) + } + else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(1, 917, __pyx_L1_error) + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":918 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":916 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + goto __pyx_L3; + } + + /* "View.MemoryView":920 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":921 + * else: + * shape = view.shape[dim] + * stride = view.strides[dim] # <<<<<<<<<<<<<< + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] + */ + __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); + + /* "View.MemoryView":922 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":923 + * stride = view.strides[dim] + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< + * + * if index < 0: + */ + __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); + + /* "View.MemoryView":922 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + } + } + __pyx_L3:; + + /* "View.MemoryView":925 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":926 + * + * if index < 0: + * index += view.shape[dim] # <<<<<<<<<<<<<< + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + */ + __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); + + /* "View.MemoryView":927 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":928 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 928, __pyx_L1_error) + + /* "View.MemoryView":927 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":925 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + } + + /* "View.MemoryView":930 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":931 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 931, __pyx_L1_error) + + /* "View.MemoryView":930 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":933 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * resultp = bufp + index * stride # <<<<<<<<<<<<<< + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset + */ + __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); + + /* "View.MemoryView":934 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":935 + * resultp = bufp + index * stride + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< + * + * return resultp + */ + __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); + + /* "View.MemoryView":934 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + } + + /* "View.MemoryView":937 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":910 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":943 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + __Pyx_TraceDeclarations + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + long __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("transpose_memslice", __pyx_f[1], 943, 1, __PYX_ERR(1, 943, __pyx_L1_error)); + + /* "View.MemoryView":944 + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: + * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t *shape = memslice.shape + */ + __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; + __pyx_v_ndim = __pyx_t_1; + + /* "View.MemoryView":946 + * cdef int ndim = memslice.memview.view.ndim + * + * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< + * cdef Py_ssize_t *strides = memslice.strides + * + */ + __pyx_t_2 = __pyx_v_memslice->shape; + __pyx_v_shape = __pyx_t_2; + + /* "View.MemoryView":947 + * + * cdef Py_ssize_t *shape = memslice.shape + * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_v_memslice->strides; + __pyx_v_strides = __pyx_t_2; + + /* "View.MemoryView":951 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":952 + * cdef int i, j + * for i in range(ndim / 2): + * j = ndim - 1 - i # <<<<<<<<<<<<<< + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] + */ + __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); + + /* "View.MemoryView":953 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6; + + /* "View.MemoryView":954 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":956 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L6_bool_binop_done:; + if (__pyx_t_7) { + + /* "View.MemoryView":957 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error) + + /* "View.MemoryView":956 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + } + } + + /* "View.MemoryView":959 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":943 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = 0; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "View.MemoryView":976 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + +/* Python wrapper */ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__dealloc__", 0); + __Pyx_TraceCall("__dealloc__", __pyx_f[1], 976, 0, __PYX_ERR(1, 976, __pyx_L1_error)); + + /* "View.MemoryView":977 + * + * def __dealloc__(self): + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); + + /* "View.MemoryView":976 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":979 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error)); + + /* "View.MemoryView":980 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":981 + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) # <<<<<<<<<<<<<< + * else: + * return memoryview.convert_item_to_object(self, itemp) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":980 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + } + + /* "View.MemoryView":983 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":979 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":985 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error)); + + /* "View.MemoryView":986 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":987 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error) + + /* "View.MemoryView":986 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":989 + * self.to_dtype_func(itemp, value) + * else: + * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< + * + * @property + */ + /*else*/ { + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":985 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":992 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[1], 992, 0, __PYX_ERR(1, 992, __pyx_L1_error)); + + /* "View.MemoryView":993 + * @property + * def base(self): + * return self.from_object # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->from_object); + __pyx_r = __pyx_v_self->from_object; + goto __pyx_L0; + + /* "View.MemoryView":992 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":999 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_TypeInfo *__pyx_t_4; + Py_buffer __pyx_t_5; + Py_ssize_t *__pyx_t_6; + Py_ssize_t *__pyx_t_7; + Py_ssize_t *__pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_fromslice", 0); + __Pyx_TraceCall("memoryview_fromslice", __pyx_f[1], 999, 0, __PYX_ERR(1, 999, __pyx_L1_error)); + + /* "View.MemoryView":1007 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1008 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "View.MemoryView":1007 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "View.MemoryView":1013 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1015 + * result = _memoryviewslice(None, 0, dtype_is_object) + * + * result.from_slice = memviewslice # <<<<<<<<<<<<<< + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + */ + __pyx_v_result->from_slice = __pyx_v_memviewslice; + + /* "View.MemoryView":1016 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":1018 + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< + * result.typeinfo = memviewslice.memview.typeinfo + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_result->from_object); + __Pyx_DECREF(__pyx_v_result->from_object); + __pyx_v_result->from_object = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":1019 + * + * result.from_object = ( memviewslice.memview).base + * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< + * + * result.view = memviewslice.memview.view + */ + __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; + __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; + + /* "View.MemoryView":1021 + * result.typeinfo = memviewslice.memview.typeinfo + * + * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + */ + __pyx_t_5 = __pyx_v_memviewslice.memview->view; + __pyx_v_result->__pyx_base.view = __pyx_t_5; + + /* "View.MemoryView":1022 + * + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + */ + __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); + + /* "View.MemoryView":1023 + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data + * result.view.ndim = ndim # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; + + /* "View.MemoryView":1024 + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; + + /* "View.MemoryView":1025 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":1027 + * Py_INCREF(Py_None) + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< + * result.flags = PyBUF_RECORDS + * else: + */ + __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1028 + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * else: + * result.flags = PyBUF_RECORDS_RO + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1027 + * Py_INCREF(Py_None) + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< + * result.flags = PyBUF_RECORDS + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1030 + * result.flags = PyBUF_RECORDS + * else: + * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + /*else*/ { + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO; + } + __pyx_L4:; + + /* "View.MemoryView":1032 + * result.flags = PyBUF_RECORDS_RO + * + * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< + * result.view.strides = result.from_slice.strides + * + */ + __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); + + /* "View.MemoryView":1033 + * + * result.view.shape = result.from_slice.shape + * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); + + /* "View.MemoryView":1036 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1037 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1038 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1039 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":1040 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L6_break; + + /* "View.MemoryView":1038 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L6_break:; + + /* "View.MemoryView":1042 + * break + * + * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< + * for length in result.view.shape[:ndim]: + * result.view.len *= length + */ + __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + + /* "View.MemoryView":1043 + * + * result.view.len = result.view.itemsize + * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< + * result.view.len *= length + * + */ + __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1044 + * result.view.len = result.view.itemsize + * for length in result.view.shape[:ndim]: + * result.view.len *= length # <<<<<<<<<<<<<< + * + * result.to_object_func = to_object_func + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1046 + * result.view.len *= length + * + * result.to_object_func = to_object_func # <<<<<<<<<<<<<< + * result.to_dtype_func = to_dtype_func + * + */ + __pyx_v_result->to_object_func = __pyx_v_to_object_func; + + /* "View.MemoryView":1047 + * + * result.to_object_func = to_object_func + * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; + + /* "View.MemoryView":1049 + * result.to_dtype_func = to_dtype_func + * + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":999 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1052 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + */ + +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) { + struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0; + __Pyx_memviewslice *__pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_slice_from_memview", 0); + __Pyx_TraceCall("get_slice_from_memview", __pyx_f[1], 1052, 0, __PYX_ERR(1, 1052, __pyx_L1_error)); + + /* "View.MemoryView":1055 + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1056 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1057 + * if isinstance(memview, _memoryviewslice): + * obj = memview + * return &obj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, mslice) + */ + __pyx_r = (&__pyx_v_obj->from_slice); + goto __pyx_L0; + + /* "View.MemoryView":1055 + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1059 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1060 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1052 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1063 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) { + int __pyx_v_dim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + Py_ssize_t *__pyx_v_suboffsets; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_copy", 0); + __Pyx_TraceCall("slice_copy", __pyx_f[1], 1063, 0, __PYX_ERR(1, 1063, __pyx_L1_error)); + + /* "View.MemoryView":1067 + * cdef (Py_ssize_t*) shape, strides, suboffsets + * + * shape = memview.view.shape # <<<<<<<<<<<<<< + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets + */ + __pyx_t_1 = __pyx_v_memview->view.shape; + __pyx_v_shape = __pyx_t_1; + + /* "View.MemoryView":1068 + * + * shape = memview.view.shape + * strides = memview.view.strides # <<<<<<<<<<<<<< + * suboffsets = memview.view.suboffsets + * + */ + __pyx_t_1 = __pyx_v_memview->view.strides; + __pyx_v_strides = __pyx_t_1; + + /* "View.MemoryView":1069 + * shape = memview.view.shape + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< + * + * dst.memview = <__pyx_memoryview *> memview + */ + __pyx_t_1 = __pyx_v_memview->view.suboffsets; + __pyx_v_suboffsets = __pyx_t_1; + + /* "View.MemoryView":1071 + * suboffsets = memview.view.suboffsets + * + * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< + * dst.data = memview.view.buf + * + */ + __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); + + /* "View.MemoryView":1072 + * + * dst.memview = <__pyx_memoryview *> memview + * dst.data = memview.view.buf # <<<<<<<<<<<<<< + * + * for dim in range(memview.view.ndim): + */ + __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); + + /* "View.MemoryView":1074 + * dst.data = memview.view.buf + * + * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + */ + __pyx_t_2 = __pyx_v_memview->view.ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_dim = __pyx_t_4; + + /* "View.MemoryView":1075 + * + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< + * dst.strides[dim] = strides[dim] + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 + */ + (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); + + /* "View.MemoryView":1076 + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 + * + */ + (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); + + /* "View.MemoryView":1077 + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object') + */ + if ((__pyx_v_suboffsets != 0)) { + __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_5 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5; + } + + /* "View.MemoryView":1063 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1080 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) { + __Pyx_memviewslice __pyx_v_memviewslice; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy", 0); + __Pyx_TraceCall("memoryview_copy", __pyx_f[1], 1080, 0, __PYX_ERR(1, 1080, __pyx_L1_error)); + + /* "View.MemoryView":1083 + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< + * return memoryview_copy_from_slice(memview, &memviewslice) + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); + + /* "View.MemoryView":1084 + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) + * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object_from_slice') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1080 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1087 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) { + PyObject *(*__pyx_v_to_object_func)(char *); + int (*__pyx_v_to_dtype_func)(char *, PyObject *); + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *(*__pyx_t_3)(char *); + int (*__pyx_t_4)(char *, PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); + __Pyx_TraceCall("memoryview_copy_from_slice", __pyx_f[1], 1087, 0, __PYX_ERR(1, 1087, __pyx_L1_error)); + + /* "View.MemoryView":1094 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1095 + * + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + */ + __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; + __pyx_v_to_object_func = __pyx_t_3; + + /* "View.MemoryView":1096 + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< + * else: + * to_object_func = NULL + */ + __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; + __pyx_v_to_dtype_func = __pyx_t_4; + + /* "View.MemoryView":1094 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1098 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1099 + * else: + * to_object_func = NULL + * to_dtype_func = NULL # <<<<<<<<<<<<<< + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + */ + __pyx_v_to_dtype_func = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":1101 + * to_dtype_func = NULL + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< + * to_object_func, to_dtype_func, + * memview.dtype_is_object) + */ + __Pyx_XDECREF(__pyx_r); + + /* "View.MemoryView":1103 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1087 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1109 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + +static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { + Py_ssize_t __pyx_r; + __Pyx_TraceDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("abs_py_ssize_t", __pyx_f[1], 1109, 1, __PYX_ERR(1, 1109, __pyx_L1_error)); + + /* "View.MemoryView":1110 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + __pyx_t_1 = ((__pyx_v_arg < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1111 + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: + * return -arg # <<<<<<<<<<<<<< + * else: + * return arg + */ + __pyx_r = (-__pyx_v_arg); + goto __pyx_L0; + + /* "View.MemoryView":1110 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1113 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1109 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "View.MemoryView":1116 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + __Pyx_TraceDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("get_best_order", __pyx_f[1], 1116, 1, __PYX_ERR(1, 1116, __pyx_L1_error)); + + /* "View.MemoryView":1121 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1122 + * cdef int i + * cdef Py_ssize_t c_stride = 0 + * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_f_stride = 0; + + /* "View.MemoryView":1124 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1125 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1126 + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1127 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1125 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1129 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_1; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1130 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1131 + * for i in range(ndim): + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1132 + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + */ + goto __pyx_L7_break; + + /* "View.MemoryView":1130 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1134 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1135 + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + * return 'C' # <<<<<<<<<<<<<< + * else: + * return 'F' + */ + __pyx_r = 'C'; + goto __pyx_L0; + + /* "View.MemoryView":1134 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1137 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1116 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "View.MemoryView":1140 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + + /* "View.MemoryView":1147 + * + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + */ + __pyx_v_src_extent = (__pyx_v_src_shape[0]); + + /* "View.MemoryView":1148 + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] + */ + __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); + + /* "View.MemoryView":1149 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1150 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1152 + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1153 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + + /* "View.MemoryView":1154 + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + */ + __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride)); + } + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L5_bool_binop_done:; + + /* "View.MemoryView":1153 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + if (__pyx_t_1) { + + /* "View.MemoryView":1155 + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); + + /* "View.MemoryView":1153 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1157 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1158 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize)); + + /* "View.MemoryView":1159 + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * else: + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1160 + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L4:; + + /* "View.MemoryView":1152 + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1162 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1163 + * else: + * for i in range(dst_extent): + * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< + * dst_data, dst_strides + 1, + * src_shape + 1, dst_shape + 1, + */ + _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); + + /* "View.MemoryView":1167 + * src_shape + 1, dst_shape + 1, + * ndim - 1, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1168 + * ndim - 1, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1140 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + + /* function exit code */ +} + +/* "View.MemoryView":1170 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + +static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("copy_strided_to_strided", __pyx_f[1], 1170, 1, __PYX_ERR(1, 1170, __pyx_L1_error)); + + /* "View.MemoryView":1173 + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< + * src.shape, dst.shape, ndim, itemsize) + * + */ + _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1170 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); +} + +/* "View.MemoryView":1177 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef Py_ssize_t shape, size = src.memview.view.itemsize + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + __Pyx_TraceDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("slice_get_size", __pyx_f[1], 1177, 1, __PYX_ERR(1, 1177, __pyx_L1_error)); + + /* "View.MemoryView":1179 + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for shape in src.shape[:ndim]: + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1181 + * cdef Py_ssize_t shape, size = src.memview.view.itemsize + * + * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<< + * size *= shape + * + */ + __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim); + for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { + __pyx_t_2 = __pyx_t_4; + __pyx_v_shape = (__pyx_t_2[0]); + + /* "View.MemoryView":1182 + * + * for shape in src.shape[:ndim]: + * size *= shape # <<<<<<<<<<<<<< + * + * return size + */ + __pyx_v_size = (__pyx_v_size * __pyx_v_shape); + } + + /* "View.MemoryView":1184 + * size *= shape + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1177 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef Py_ssize_t shape, size = src.memview.view.itemsize + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "View.MemoryView":1187 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + __Pyx_TraceDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("fill_contig_strides_array", __pyx_f[1], 1187, 1, __PYX_ERR(1, 1187, __pyx_L1_error)); + + /* "View.MemoryView":1196 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + __pyx_t_1 = ((__pyx_v_order == 'F') != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1197 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride *= shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_idx = __pyx_t_4; + + /* "View.MemoryView":1198 + * if order == 'F': + * for idx in range(ndim): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride *= shape[idx] + * else: + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1199 + * for idx in range(ndim): + * strides[idx] = stride + * stride *= shape[idx] # <<<<<<<<<<<<<< + * else: + * for idx in range(ndim - 1, -1, -1): + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + + /* "View.MemoryView":1196 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1201 + * stride *= shape[idx] + * else: + * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride *= shape[idx] + */ + /*else*/ { + for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1202 + * else: + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride *= shape[idx] + * + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1203 + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride + * stride *= shape[idx] # <<<<<<<<<<<<<< + * + * return stride + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + } + __pyx_L3:; + + /* "View.MemoryView":1205 + * stride *= shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1187 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "View.MemoryView":1208 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) { + int __pyx_v_i; + void *__pyx_v_result; + size_t __pyx_v_itemsize; + size_t __pyx_v_size; + void *__pyx_r; + __Pyx_TraceDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + struct __pyx_memoryview_obj *__pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("copy_data_to_temp", __pyx_f[1], 1208, 1, __PYX_ERR(1, 1208, __pyx_L1_error)); + + /* "View.MemoryView":1219 + * cdef void *result + * + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef size_t size = slice_get_size(src, ndim) + * + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1220 + * + * cdef size_t itemsize = src.memview.view.itemsize + * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< + * + * result = malloc(size) + */ + __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); + + /* "View.MemoryView":1222 + * cdef size_t size = slice_get_size(src, ndim) + * + * result = malloc(size) # <<<<<<<<<<<<<< + * if not result: + * _err(MemoryError, NULL) + */ + __pyx_v_result = malloc(__pyx_v_size); + + /* "View.MemoryView":1223 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1224 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error) + + /* "View.MemoryView":1223 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1227 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1228 + * + * tmpslice.data = result + * tmpslice.memview = src.memview # <<<<<<<<<<<<<< + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + */ + __pyx_t_4 = __pyx_v_src->memview; + __pyx_v_tmpslice->memview = __pyx_t_4; + + /* "View.MemoryView":1229 + * tmpslice.data = result + * tmpslice.memview = src.memview + * for i in range(ndim): # <<<<<<<<<<<<<< + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 + */ + __pyx_t_3 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_3; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1230 + * tmpslice.memview = src.memview + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< + * tmpslice.suboffsets[i] = -1 + * + */ + (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); + + /* "View.MemoryView":1231 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1233 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order)); + + /* "View.MemoryView":1237 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_3; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1238 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1239 + * for i in range(ndim): + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< + * + * if slice_is_contig(src[0], order, ndim): + */ + (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; + + /* "View.MemoryView":1238 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1241 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1242 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size)); + + /* "View.MemoryView":1241 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1244 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1246 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1208 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = NULL; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "View.MemoryView":1251 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + +static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_extents", 0); + __Pyx_TraceCall("_err_extents", __pyx_f[1], 1251, 0, __PYX_ERR(1, 1251, __pyx_L1_error)); + + /* "View.MemoryView":1254 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":1253 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 1253, __pyx_L1_error) + + /* "View.MemoryView":1251 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1257 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + +static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_dim", 0); + __Pyx_TraceCall("_err_dim", __pyx_f[1], 1257, 0, __PYX_ERR(1, 1257, __pyx_L1_error)); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1258 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 1258, __pyx_L1_error) + + /* "View.MemoryView":1257 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1261 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + +static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err", 0); + __Pyx_TraceCall("_err", __pyx_f[1], 1261, 0, __PYX_ERR(1, 1261, __pyx_L1_error)); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1262 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":1263 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 1263, __pyx_L1_error) + + /* "View.MemoryView":1262 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1265 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(1, 1265, __pyx_L1_error) + } + + /* "View.MemoryView":1261 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1268 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + __Pyx_TraceDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + void *__pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("memoryview_copy_contents", __pyx_f[1], 1268, 1, __PYX_ERR(1, 1268, __pyx_L1_error)); + + /* "View.MemoryView":1276 + * Check for overlapping memory and verify the shapes. + * """ + * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + */ + __pyx_v_tmpdata = NULL; + + /* "View.MemoryView":1277 + * """ + * cdef void *tmpdata = NULL + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + */ + __pyx_t_1 = __pyx_v_src.memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1279 + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< + * cdef bint broadcasting = False + * cdef bint direct_copy = False + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); + + /* "View.MemoryView":1280 + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False # <<<<<<<<<<<<<< + * cdef bint direct_copy = False + * cdef __Pyx_memviewslice tmp + */ + __pyx_v_broadcasting = 0; + + /* "View.MemoryView":1281 + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False + * cdef bint direct_copy = False # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice tmp + * + */ + __pyx_v_direct_copy = 0; + + /* "View.MemoryView":1284 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1285 + * + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); + + /* "View.MemoryView":1284 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1286 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1287 + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< + * + * cdef int ndim = max(src_ndim, dst_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); + + /* "View.MemoryView":1286 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1289 + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_3 = __pyx_v_dst_ndim; + __pyx_t_4 = __pyx_v_src_ndim; + if (((__pyx_t_3 > __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_v_ndim = __pyx_t_5; + + /* "View.MemoryView":1291 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_5; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1292 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1293 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1294 + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + * broadcasting = True # <<<<<<<<<<<<<< + * src.strides[i] = 0 + * else: + */ + __pyx_v_broadcasting = 1; + + /* "View.MemoryView":1295 + * if src.shape[i] == 1: + * broadcasting = True + * src.strides[i] = 0 # <<<<<<<<<<<<<< + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) + */ + (__pyx_v_src.strides[__pyx_v_i]) = 0; + + /* "View.MemoryView":1293 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1297 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1292 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1299 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error) + + /* "View.MemoryView":1299 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + } + } + + /* "View.MemoryView":1302 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1304 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1305 + * + * if not slice_is_contig(src, order, ndim): + * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); + + /* "View.MemoryView":1304 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1307 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_7; + + /* "View.MemoryView":1308 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1302 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + } + + /* "View.MemoryView":1310 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1313 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1314 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1313 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1315 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1316 + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); + + /* "View.MemoryView":1315 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1318 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_2 = (__pyx_v_direct_copy != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1320 + * if direct_copy: + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1321 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim))); + + /* "View.MemoryView":1322 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1323 + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1324 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * if order == 'F' == get_best_order(&dst, ndim): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1318 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1310 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1326 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_8 = (__pyx_t_2 != 0); + if (__pyx_t_8) { + + /* "View.MemoryView":1329 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error) + + /* "View.MemoryView":1330 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error) + + /* "View.MemoryView":1326 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1332 + * transpose_memslice(&dst) + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1333 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + */ + copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1334 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1336 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1337 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1268 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "View.MemoryView":1340 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) { + int __pyx_v_i; + int __pyx_v_offset; + __Pyx_TraceDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("broadcast_leading", __pyx_f[1], 1340, 1, __PYX_ERR(1, 1340, __pyx_L1_error)); + + /* "View.MemoryView":1344 + * int ndim_other) nogil: + * cdef int i + * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); + + /* "View.MemoryView":1346 + * cdef int offset = ndim_other - ndim + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1347 + * + * for i in range(ndim - 1, -1, -1): + * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + */ + (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); + + /* "View.MemoryView":1348 + * for i in range(ndim - 1, -1, -1): + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<< + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + * + */ + (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1349 + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1351 + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + * + * for i in range(offset): # <<<<<<<<<<<<<< + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + */ + __pyx_t_1 = __pyx_v_offset; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1352 + * + * for i in range(offset): + * mslice.shape[i] = 1 # <<<<<<<<<<<<<< + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 + */ + (__pyx_v_mslice->shape[__pyx_v_i]) = 1; + + /* "View.MemoryView":1353 + * for i in range(offset): + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< + * mslice.suboffsets[i] = -1 + * + */ + (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); + + /* "View.MemoryView":1354 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1340 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); +} + +/* "View.MemoryView":1362 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { + __Pyx_TraceDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("refcount_copying", __pyx_f[1], 1362, 1, __PYX_ERR(1, 1362, __pyx_L1_error)); + + /* "View.MemoryView":1366 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + __pyx_t_1 = (__pyx_v_dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1367 + * + * if dtype_is_object: + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< + * dst.strides, ndim, inc) + * + */ + __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); + + /* "View.MemoryView":1366 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1362 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); +} + +/* "View.MemoryView":1371 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); + __Pyx_TraceCall("refcount_objects_in_slice_with_gil", __pyx_f[1], 1371, 0, __PYX_ERR(1, 1371, __pyx_L1_error)); + + /* "View.MemoryView":1374 + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); + + /* "View.MemoryView":1371 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif +} + +/* "View.MemoryView":1377 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + __Pyx_TraceCall("refcount_objects_in_slice", __pyx_f[1], 1377, 0, __PYX_ERR(1, 1377, __pyx_L1_error)); + + /* "View.MemoryView":1381 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1382 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_4 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1383 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_4 = (__pyx_v_inc != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1384 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1383 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1386 + * Py_INCREF(( data)[0]) + * else: + * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + */ + /*else*/ { + Py_DECREF((((PyObject **)__pyx_v_data)[0])); + } + __pyx_L6:; + + /* "View.MemoryView":1382 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1388 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1389 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1391 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1377 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1397 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("slice_assign_scalar", __pyx_f[1], 1397, 1, __PYX_ERR(1, 1397, __pyx_L1_error)); + + /* "View.MemoryView":1400 + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1401 + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1403 + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1397 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); +} + +/* "View.MemoryView":1407 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + __Pyx_TraceDeclarations + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceCall("_slice_assign_scalar", __pyx_f[1], 1407, 1, __PYX_ERR(1, 1407, __pyx_L1_error)); + + /* "View.MemoryView":1411 + * size_t itemsize, void *item) nogil: + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t extent = shape[0] + * + */ + __pyx_v_stride = (__pyx_v_strides[0]); + + /* "View.MemoryView":1412 + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] + * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_extent = (__pyx_v_shape[0]); + + /* "View.MemoryView":1414 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1415 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1416 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize)); + + /* "View.MemoryView":1417 + * for i in range(extent): + * memcpy(data, item, itemsize) + * data += stride # <<<<<<<<<<<<<< + * else: + * for i in range(extent): + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + + /* "View.MemoryView":1414 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1419 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1420 + * else: + * for i in range(extent): + * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, itemsize, item) + * data += stride + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1422 + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + * data += stride # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1407 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); +} + +/* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = 0; + PyObject *__pyx_v___pyx_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__28) + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0); + __Pyx_TraceCall("__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":5 + * cdef object __pyx_result + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 6, __pyx_L1_error) + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":7 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "(tree fragment)":9 + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) + __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":10 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":11 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + __Pyx_TraceCall("__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error)); + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v___pyx_result->name); + __Pyx_DECREF(__pyx_v___pyx_result->name); + __pyx_v___pyx_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 13, __pyx_L1_error) + } + __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 > 1) != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) + __pyx_t_5 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_5; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "(tree fragment)":14 + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 14, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":11 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "BufferFormatFromTypeInfo":1463 + * + * @cname('__pyx_format_from_typeinfo') + * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< + * cdef __Pyx_StructField *field + * cdef __pyx_typeinfo_string fmt + */ + +static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) { + __Pyx_StructField *__pyx_v_field; + struct __pyx_typeinfo_string __pyx_v_fmt; + PyObject *__pyx_v_part = 0; + PyObject *__pyx_v_result = 0; + PyObject *__pyx_v_alignment = NULL; + PyObject *__pyx_v_parts = NULL; + PyObject *__pyx_v_extents = NULL; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_StructField *__pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("format_from_typeinfo", 0); + __Pyx_TraceCall("format_from_typeinfo", __pyx_f[1], 1463, 0, __PYX_ERR(1, 1463, __pyx_L1_error)); + + /* "BufferFormatFromTypeInfo":1468 + * cdef bytes part, result + * + * if type.typegroup == 'S': # <<<<<<<<<<<<<< + * assert type.fields != NULL + * assert type.fields.type != NULL + */ + __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0); + if (__pyx_t_1) { + + /* "BufferFormatFromTypeInfo":1469 + * + * if type.typegroup == 'S': + * assert type.fields != NULL # <<<<<<<<<<<<<< + * assert type.fields.type != NULL + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_type->fields != NULL) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 1469, __pyx_L1_error) + } + } + #endif + + /* "BufferFormatFromTypeInfo":1470 + * if type.typegroup == 'S': + * assert type.fields != NULL + * assert type.fields.type != NULL # <<<<<<<<<<<<<< + * + * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_type->fields->type != NULL) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 1470, __pyx_L1_error) + } + } + #endif + + /* "BufferFormatFromTypeInfo":1472 + * assert type.fields.type != NULL + * + * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<< + * alignment = b'^' + * else: + */ + __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0); + if (__pyx_t_1) { + + /* "BufferFormatFromTypeInfo":1473 + * + * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: + * alignment = b'^' # <<<<<<<<<<<<<< + * else: + * alignment = b'' + */ + __Pyx_INCREF(__pyx_kp_b__29); + __pyx_v_alignment = __pyx_kp_b__29; + + /* "BufferFormatFromTypeInfo":1472 + * assert type.fields.type != NULL + * + * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<< + * alignment = b'^' + * else: + */ + goto __pyx_L4; + } + + /* "BufferFormatFromTypeInfo":1475 + * alignment = b'^' + * else: + * alignment = b'' # <<<<<<<<<<<<<< + * + * parts = [b"T{"] + */ + /*else*/ { + __Pyx_INCREF(__pyx_kp_b__30); + __pyx_v_alignment = __pyx_kp_b__30; + } + __pyx_L4:; + + /* "BufferFormatFromTypeInfo":1477 + * alignment = b'' + * + * parts = [b"T{"] # <<<<<<<<<<<<<< + * field = type.fields + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_kp_b_T); + __Pyx_GIVEREF(__pyx_kp_b_T); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_b_T); + __pyx_v_parts = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "BufferFormatFromTypeInfo":1478 + * + * parts = [b"T{"] + * field = type.fields # <<<<<<<<<<<<<< + * + * while field.type: + */ + __pyx_t_3 = __pyx_v_type->fields; + __pyx_v_field = __pyx_t_3; + + /* "BufferFormatFromTypeInfo":1480 + * field = type.fields + * + * while field.type: # <<<<<<<<<<<<<< + * part = format_from_typeinfo(field.type) + * parts.append(part + b':' + field.name + b':') + */ + while (1) { + __pyx_t_1 = (__pyx_v_field->type != 0); + if (!__pyx_t_1) break; + + /* "BufferFormatFromTypeInfo":1481 + * + * while field.type: + * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<< + * parts.append(part + b':' + field.name + b':') + * field += 1 + */ + __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "BufferFormatFromTypeInfo":1482 + * while field.type: + * part = format_from_typeinfo(field.type) + * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<< + * field += 1 + * + */ + __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__31); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__31); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1482, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "BufferFormatFromTypeInfo":1483 + * part = format_from_typeinfo(field.type) + * parts.append(part + b':' + field.name + b':') + * field += 1 # <<<<<<<<<<<<<< + * + * result = alignment.join(parts) + b'}' + */ + __pyx_v_field = (__pyx_v_field + 1); + } + + /* "BufferFormatFromTypeInfo":1485 + * field += 1 + * + * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<< + * else: + * fmt = __Pyx_TypeInfoToFormat(type) + */ + __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__32); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(1, 1485, __pyx_L1_error) + __pyx_v_result = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "BufferFormatFromTypeInfo":1468 + * cdef bytes part, result + * + * if type.typegroup == 'S': # <<<<<<<<<<<<<< + * assert type.fields != NULL + * assert type.fields.type != NULL + */ + goto __pyx_L3; + } + + /* "BufferFormatFromTypeInfo":1487 + * result = alignment.join(parts) + b'}' + * else: + * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<< + * if type.arraysize[0]: + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] + */ + /*else*/ { + __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type); + + /* "BufferFormatFromTypeInfo":1488 + * else: + * fmt = __Pyx_TypeInfoToFormat(type) + * if type.arraysize[0]: # <<<<<<<<<<<<<< + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string + */ + __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0); + if (__pyx_t_1) { + + /* "BufferFormatFromTypeInfo":1489 + * fmt = __Pyx_TypeInfoToFormat(type) + * if type.arraysize[0]: + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] # <<<<<<<<<<<<<< + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string + * else: + */ + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __pyx_v_type->ndim; + __pyx_t_8 = __pyx_t_7; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 1489, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_v_extents = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "BufferFormatFromTypeInfo":1490 + * if type.arraysize[0]: + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string # <<<<<<<<<<<<<< + * else: + * result = fmt.string + */ + __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__33, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 1490, __pyx_L1_error) + __pyx_v_result = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "BufferFormatFromTypeInfo":1488 + * else: + * fmt = __Pyx_TypeInfoToFormat(type) + * if type.arraysize[0]: # <<<<<<<<<<<<<< + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string + */ + goto __pyx_L7; + } + + /* "BufferFormatFromTypeInfo":1492 + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string + * else: + * result = fmt.string # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_result = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L7:; + } + __pyx_L3:; + + /* "BufferFormatFromTypeInfo":1494 + * result = fmt.string + * + * return result # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "BufferFormatFromTypeInfo":1463 + * + * @cname('__pyx_format_from_typeinfo') + * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< + * cdef __Pyx_StructField *field + * cdef __pyx_typeinfo_string fmt + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_part); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_alignment); + __Pyx_XDECREF(__pyx_v_parts); + __Pyx_XDECREF(__pyx_v_extents); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_7helpers_11ekf_sym_pyx_EKF_sym(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_7helpers_11ekf_sym_pyx_EKF_sym(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_29__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_7helpers_11ekf_sym_pyx_EKF_sym[] = { + {"init_state", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_3init_state, METH_VARARGS|METH_KEYWORDS, 0}, + {"state", (PyCFunction)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_5state, METH_NOARGS, 0}, + {"covs", (PyCFunction)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_7covs, METH_NOARGS, 0}, + {"set_filter_time", (PyCFunction)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_9set_filter_time, METH_O, 0}, + {"get_filter_time", (PyCFunction)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_11get_filter_time, METH_NOARGS, 0}, + {"set_global", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_13set_global, METH_VARARGS|METH_KEYWORDS, 0}, + {"reset_rewind", (PyCFunction)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_15reset_rewind, METH_NOARGS, 0}, + {"predict", (PyCFunction)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_17predict, METH_O, 0}, + {"predict_and_update_batch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_19predict_and_update_batch, METH_VARARGS|METH_KEYWORDS, 0}, + {"augment", (PyCFunction)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_21augment, METH_NOARGS, 0}, + {"get_augment_times", (PyCFunction)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_23get_augment_times, METH_NOARGS, 0}, + {"rts_smooth", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_25rts_smooth, METH_VARARGS|METH_KEYWORDS, 0}, + {"maha_test", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_27maha_test, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_31__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_7helpers_11ekf_sym_pyx_7EKF_sym_33__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_7helpers_11ekf_sym_pyx_EKF_sym = { + PyVarObject_HEAD_INIT(0, 0) + "helpers.ekf_sym_pyx.EKF_sym", /*tp_name*/ + sizeof(struct __pyx_obj_7helpers_11ekf_sym_pyx_EKF_sym), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7helpers_11ekf_sym_pyx_EKF_sym, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_7helpers_11ekf_sym_pyx_EKF_sym, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7helpers_11ekf_sym_pyx_EKF_sym, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; +static struct __pyx_vtabstruct_array __pyx_vtable_array; + +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_array_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_array_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_array; + p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_array(PyObject *o) { + struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_array___dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->mode); + Py_CLEAR(p->_format); + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_array___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { + PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n); + if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + v = __pyx_array___getattr__(o, n); + } + return v; +} + +static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o); +} + +static PyMethodDef __pyx_methods_array[] = { + {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_array[] = { + {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_array = { + __pyx_array___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + __pyx_array___len__, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_array_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + "helpers.ekf_sym_pyx.array", /*tp_name*/ + sizeof(struct __pyx_array_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_array, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + __pyx_tp_getattro_array, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_array, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_array, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_array, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_MemviewEnum_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_MemviewEnum_obj *)o); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_Enum(PyObject *o) { + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_Enum(PyObject *o) { + PyObject* tmp; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_Enum[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_MemviewEnum = { + PyVarObject_HEAD_INIT(0, 0) + "helpers.ekf_sym_pyx.Enum", /*tp_name*/ + sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_Enum, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_MemviewEnum___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_Enum, /*tp_traverse*/ + __pyx_tp_clear_Enum, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_Enum, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_MemviewEnum___init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_Enum, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; +static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; + +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryview_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryview_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_memoryview; + p->obj = Py_None; Py_INCREF(Py_None); + p->_size = Py_None; Py_INCREF(Py_None); + p->_array_interface = Py_None; Py_INCREF(Py_None); + p->view.obj = NULL; + if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_memoryview(PyObject *o) { + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_memoryview___dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->obj); + Py_CLEAR(p->_size); + Py_CLEAR(p->_array_interface); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + if (p->obj) { + e = (*v)(p->obj, a); if (e) return e; + } + if (p->_size) { + e = (*v)(p->_size, a); if (e) return e; + } + if (p->_array_interface) { + e = (*v)(p->_array_interface, a); if (e) return e; + } + if (p->view.obj) { + e = (*v)(p->view.obj, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_memoryview(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + tmp = ((PyObject*)p->obj); + p->obj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_size); + p->_size = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_array_interface); + p->_array_interface = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + Py_CLEAR(p->view.obj); + return 0; +} +static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_memoryview___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o); +} + +static PyMethodDef __pyx_methods_memoryview[] = { + {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0}, + {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0}, + {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0}, + {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_memoryview[] = { + {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0}, + {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0}, + {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0}, + {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0}, + {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0}, + {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0}, + {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0}, + {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0}, + {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_memoryview = { + __pyx_memoryview___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_memoryview, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_memoryview = { + __pyx_memoryview___len__, /*mp_length*/ + __pyx_memoryview___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_memoryview = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_memoryview_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_memoryview = { + PyVarObject_HEAD_INIT(0, 0) + "helpers.ekf_sym_pyx.memoryview", /*tp_name*/ + sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_memoryview___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_memoryview___str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_memoryview, /*tp_traverse*/ + __pyx_tp_clear_memoryview, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_memoryview, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_memoryview, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_memoryview, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; +static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; + +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryviewslice_obj *p; + PyObject *o = __pyx_tp_new_memoryview(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryviewslice_obj *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice; + p->from_object = Py_None; Py_INCREF(Py_None); + p->from_slice.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_memoryviewslice___dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->from_object); + PyObject_GC_Track(o); + __pyx_tp_dealloc_memoryview(o); +} + +static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e; + if (p->from_object) { + e = (*v)(p->from_object, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear__memoryviewslice(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + __pyx_tp_clear_memoryview(o); + tmp = ((PyObject*)p->from_object); + p->from_object = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + __PYX_XDEC_MEMVIEW(&p->from_slice, 1); + return 0; +} + +static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o); +} + +static PyMethodDef __pyx_methods__memoryviewslice[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = { + {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_memoryviewslice = { + PyVarObject_HEAD_INIT(0, 0) + "helpers.ekf_sym_pyx._memoryviewslice", /*tp_name*/ + sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Internal class for passing memoryview slices to Python", /*tp_doc*/ + __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/ + __pyx_tp_clear__memoryviewslice, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods__memoryviewslice, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets__memoryviewslice, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new__memoryviewslice, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_ekf_sym_pyx(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_ekf_sym_pyx}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "ekf_sym_pyx", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_n_u_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 1, 0, 1}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__pyx_n_s_EKF_sym, __pyx_k_EKF_sym, sizeof(__pyx_k_EKF_sym), 0, 0, 1, 1}, + {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, + {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, + {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0}, + {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, + {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, + {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0}, + {&__pyx_n_s_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 0, 1, 1}, + {&__pyx_n_s_P_initial, __pyx_k_P_initial, sizeof(__pyx_k_P_initial), 0, 0, 1, 1}, + {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_Q, __pyx_k_Q, sizeof(__pyx_k_Q), 0, 0, 1, 1}, + {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1}, + {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, + {&__pyx_kp_b__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 0, 0, 0}, + {&__pyx_kp_b__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 0, 0, 0}, + {&__pyx_kp_b__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 0, 0, 0}, + {&__pyx_kp_b__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 0, 0}, + {&__pyx_kp_u__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 1, 0, 0}, + {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1}, + {&__pyx_n_s_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1}, + {&__pyx_n_s_augment, __pyx_k_augment, sizeof(__pyx_k_augment), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, + {&__pyx_n_s_covs, __pyx_k_covs, sizeof(__pyx_k_covs), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_dim_augment, __pyx_k_dim_augment, sizeof(__pyx_k_dim_augment), 0, 0, 1, 1}, + {&__pyx_n_s_dim_augment_err, __pyx_k_dim_augment_err, sizeof(__pyx_k_dim_augment_err), 0, 0, 1, 1}, + {&__pyx_n_s_dim_main, __pyx_k_dim_main, sizeof(__pyx_k_dim_main), 0, 0, 1, 1}, + {&__pyx_n_s_dim_main_err, __pyx_k_dim_main_err, sizeof(__pyx_k_dim_main_err), 0, 0, 1, 1}, + {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_estimates, __pyx_k_estimates, sizeof(__pyx_k_estimates), 0, 0, 1, 1}, + {&__pyx_n_s_extra_args, __pyx_k_extra_args, sizeof(__pyx_k_extra_args), 0, 0, 1, 1}, + {&__pyx_n_s_filter_time, __pyx_k_filter_time, sizeof(__pyx_k_filter_time), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_n_s_gen_dir, __pyx_k_gen_dir, sizeof(__pyx_k_gen_dir), 0, 0, 1, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_n_s_global_var, __pyx_k_global_var, sizeof(__pyx_k_global_var), 0, 0, 1, 1}, + {&__pyx_n_s_global_vars, __pyx_k_global_vars, sizeof(__pyx_k_global_vars), 0, 0, 1, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, + {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1}, + {&__pyx_n_s_logger, __pyx_k_logger, sizeof(__pyx_k_logger), 0, 0, 1, 1}, + {&__pyx_n_s_maha_test_kinds, __pyx_k_maha_test_kinds, sizeof(__pyx_k_maha_test_kinds), 0, 0, 1, 1}, + {&__pyx_n_s_maha_thresh, __pyx_k_maha_thresh, sizeof(__pyx_k_maha_thresh), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_max_rewind_age, __pyx_k_max_rewind_age, sizeof(__pyx_k_max_rewind_age), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, + {&__pyx_n_s_norm_quats, __pyx_k_norm_quats, sizeof(__pyx_k_norm_quats), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0}, + {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1}, + {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_quaternion_idxs, __pyx_k_quaternion_idxs, sizeof(__pyx_k_quaternion_idxs), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, + {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, + {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, + {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_n_u_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 1, 0, 1}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_x_initial, __pyx_k_x_initial, sizeof(__pyx_k_x_initial), 0, 0, 1, 1}, + {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":945 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 945, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":951 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "View.MemoryView":133 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "View.MemoryView":136 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "View.MemoryView":148 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "View.MemoryView":176 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "View.MemoryView":192 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "View.MemoryView":418 + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< + * + * have_slices, index = _unellipsify(index, self.view.ndim) + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "View.MemoryView":495 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "View.MemoryView":520 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< + * + * if flags & PyBUF_ND: + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "View.MemoryView":570 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "View.MemoryView":577 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __pyx_tuple__21 = PyTuple_New(1); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_tuple__21, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "View.MemoryView":682 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__24); + __Pyx_GIVEREF(__pyx_slice__24); + + /* "View.MemoryView":703 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "View.MemoryView":286 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "View.MemoryView":287 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "View.MemoryView":288 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "View.MemoryView":291 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "View.MemoryView":292 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_tuple__39 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_float_0_95 = PyFloat_FromDouble(0.95); if (unlikely(!__pyx_float_0_95)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_7helpers_11ekf_sym_pyx_EKF_sym) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_7helpers_11ekf_sym_pyx_EKF_sym.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7helpers_11ekf_sym_pyx_EKF_sym.tp_dictoffset && __pyx_type_7helpers_11ekf_sym_pyx_EKF_sym.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_7helpers_11ekf_sym_pyx_EKF_sym.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EKF_sym, (PyObject *)&__pyx_type_7helpers_11ekf_sym_pyx_EKF_sym) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7helpers_11ekf_sym_pyx_EKF_sym) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_ptype_7helpers_11ekf_sym_pyx_EKF_sym = &__pyx_type_7helpers_11ekf_sym_pyx_EKF_sym; + __pyx_vtabptr_array = &__pyx_vtable_array; + __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_array.tp_print = 0; + #endif + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error) + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_MemviewEnum.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error) + __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; + __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; + __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; + __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; + __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment; + __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar; + __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; + __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; + __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_memoryview.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error) + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_memoryviewslice.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error) + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initekf_sym_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initekf_sym_pyx(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_ekf_sym_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_ekf_sym_pyx(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_ekf_sym_pyx(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + __Pyx_TraceDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + static PyThread_type_lock __pyx_t_3[8]; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'ekf_sym_pyx' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_ekf_sym_pyx(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("ekf_sym_pyx", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_helpers__ekf_sym_pyx) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "helpers.ekf_sym_pyx")) { + if (unlikely(PyDict_SetItemString(modules, "helpers.ekf_sym_pyx", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_ekf_sym_pyx(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); + + /* "helpers/ekf_sym_pyx.pyx":12 + * cimport numpy as np + * + * import numpy as np # <<<<<<<<<<<<<< + * + * cdef extern from "" namespace "std" nogil: + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "helpers/ekf_sym_pyx.pyx":85 + * def __cinit__(self, str gen_dir, str name, np.ndarray[np.float64_t, ndim=2] Q, + * np.ndarray[np.float64_t, ndim=1] x_initial, np.ndarray[np.float64_t, ndim=2] P_initial, int dim_main, + * int dim_main_err, int N=0, int dim_augment=0, int dim_augment_err=0, list maha_test_kinds=[], # <<<<<<<<<<<<<< + * list quaternion_idxs=[], list global_vars=[], double max_rewind_age=1.0, logger=None): + * # TODO logger + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_ = ((PyObject*)__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "helpers/ekf_sym_pyx.pyx":86 + * np.ndarray[np.float64_t, ndim=1] x_initial, np.ndarray[np.float64_t, ndim=2] P_initial, int dim_main, + * int dim_main_err, int N=0, int dim_augment=0, int dim_augment_err=0, list maha_test_kinds=[], + * list quaternion_idxs=[], list global_vars=[], double max_rewind_age=1.0, logger=None): # <<<<<<<<<<<<<< + * # TODO logger + * + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__2 = ((PyObject*)__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__3 = ((PyObject*)__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "helpers/ekf_sym_pyx.pyx":139 + * self.ekf.predict(t) + * + * def predict_and_update_batch(self, double t, int kind, z, R, extra_args=[[]], bool augment=False): # <<<<<<<<<<<<<< + * cdef vector[MapVectorXd] z_map + * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] zi_b + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_k__4 = __pyx_t_2; + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "helpers/ekf_sym_pyx.pyx":186 + * raise NotImplementedError() # TODO + * + * def maha_test(self, x, P, kind, z, R, extra_args=[], maha_thresh=0.95): # <<<<<<<<<<<<<< + * raise NotImplementedError() # TODO + * + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_k__5 = __pyx_t_2; + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "helpers/ekf_sym_pyx.pyx":1 + * # cython: language_level=3 # <<<<<<<<<<<<<< + * # cython: profile=True + * # distutils: language = c++ + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":209 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * def __dealloc__(array self): + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 209, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":286 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":287 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":288 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":291 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":292 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":316 + * + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ + * PyThread_allocate_lock(), + */ + __pyx_memoryview_thread_locks_used = 0; + + /* "View.MemoryView":317 + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< + * PyThread_allocate_lock(), + * PyThread_allocate_lock(), + */ + __pyx_t_3[0] = PyThread_allocate_lock(); + __pyx_t_3[1] = PyThread_allocate_lock(); + __pyx_t_3[2] = PyThread_allocate_lock(); + __pyx_t_3[3] = PyThread_allocate_lock(); + __pyx_t_3[4] = PyThread_allocate_lock(); + __pyx_t_3[5] = PyThread_allocate_lock(); + __pyx_t_3[6] = PyThread_allocate_lock(); + __pyx_t_3[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + + /* "View.MemoryView":549 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":995 + * return self.from_object + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_memoryviewslice_type); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "BufferFormatFromTypeInfo":1463 + * + * @cname('__pyx_format_from_typeinfo') + * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< + * cdef __Pyx_StructField *field + * cdef __pyx_typeinfo_string fmt + */ + __Pyx_TraceReturn(Py_None, 0); + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init helpers.ekf_sym_pyx", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init helpers.ekf_sym_pyx"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* Profile */ +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + PyThreadState* tstate, + const char *funcname, + const char *srcfile, + int firstlineno) { + PyObject *type, *value, *traceback; + int retval; + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); + retval = 1; + __Pyx_EnterTracing(tstate); + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + #if CYTHON_TRACE + if (tstate->c_tracefunc) + retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; + if (retval && tstate->c_profilefunc) + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + __Pyx_LeaveTracing(tstate); + if (retval) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + return __Pyx_IsTracing(tstate, 0, 0) && retval; + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + return -1; + } +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyCodeObject *py_code = 0; +#if PY_MAJOR_VERSION >= 3 + py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); + if (likely(py_code)) { + py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; + } +#else + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + py_funcname = PyString_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + py_srcfile = PyString_FromString(srcfile); + if (unlikely(!py_srcfile)) goto bad; + py_code = PyCode_New( + 0, + 0, + 0, + CO_OPTIMIZED | CO_NEWLOCALS, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); +#endif + return py_code; +} +#endif + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (__Pyx_PyFastCFunction_Check(func)) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* MemviewSliceInit */ +static int +__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference) +{ + __Pyx_RefNannyDeclarations + int i, retval=-1; + Py_buffer *buf = &memview->view; + __Pyx_RefNannySetupContext("init_memviewslice", 0); + if (unlikely(memviewslice->memview || memviewslice->data)) { + PyErr_SetString(PyExc_ValueError, + "memviewslice is already initialized!"); + goto fail; + } + if (buf->strides) { + for (i = 0; i < ndim; i++) { + memviewslice->strides[i] = buf->strides[i]; + } + } else { + Py_ssize_t stride = buf->itemsize; + for (i = ndim - 1; i >= 0; i--) { + memviewslice->strides[i] = stride; + stride *= buf->shape[i]; + } + } + for (i = 0; i < ndim; i++) { + memviewslice->shape[i] = buf->shape[i]; + if (buf->suboffsets) { + memviewslice->suboffsets[i] = buf->suboffsets[i]; + } else { + memviewslice->suboffsets[i] = -1; + } + } + memviewslice->memview = memview; + memviewslice->data = (char *)buf->buf; + if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { + Py_INCREF(memview); + } + retval = 0; + goto no_fail; +fail: + memviewslice->memview = 0; + memviewslice->data = 0; + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} +#ifndef Py_NO_RETURN +#define Py_NO_RETURN +#endif +static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN { + va_list vargs; + char msg[200]; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + va_end(vargs); + Py_FatalError(msg); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (unlikely(!memview || (PyObject *) memview == Py_None)) + return; + if (unlikely(__pyx_get_slice_count(memview) < 0)) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (unlikely(first_time)) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (unlikely(!memview || (PyObject *) memview == Py_None)) { + memslice->memview = NULL; + return; + } + if (unlikely(__pyx_get_slice_count(memview) <= 0)) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (unlikely(last_time)) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* IsLittleEndian */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + +/* BufferFormatCheck */ +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t <= '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case '?': return "'bool'"; + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case '?': case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number, ndim; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ndim = ctx->head->field->type->ndim; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + CYTHON_FALLTHROUGH; + case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) && + (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + CYTHON_FALLTHROUGH; + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} + +/* BufferGetAndValidate */ + static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (unlikely(info->buf == NULL)) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} +static void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static int __Pyx__GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + buf->buf = NULL; + if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) { + __Pyx_ZeroBuffer(buf); + return -1; + } + if (unlikely(buf->ndim != nd)) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if (unlikely((size_t)buf->itemsize != dtype->size)) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_SafeReleaseBuffer(buf); + return -1; +} + +/* BufferFallbackError */ + static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +/* GetItemInt */ + static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* PyObjectCallNoArg */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* RaiseException */ + #if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* WriteUnraisableException */ + static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* GetTopmostException */ + #if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* BytesEquals */ + static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ + static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* None */ + static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* ObjectGetItem */ + #if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* decode_c_string */ + static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + size_t slen = strlen(cstring); + if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, + "c-string too long to convert to Python"); + return NULL; + } + length = (Py_ssize_t) slen; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + if (unlikely(stop <= start)) + return __Pyx_NewRef(__pyx_empty_unicode); + length = stop - start; + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* GetAttr3 */ + static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* RaiseTooManyValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* RaiseNoneIterError */ + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* SwapException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* FastTypeChecks */ + #if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* None */ + static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* None */ + static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +/* ImportFrom */ + static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* HasAttr */ + static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* StringJoin */ + #if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +/* PyObject_GenericGetAttrNoDict */ + #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ + #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ + static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* SetupReduce */ + static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#else + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#endif +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); + if (likely(reduce_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (reduce == object_reduce || PyErr_Occurred()) { + goto __PYX_BAD; + } + setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); + if (likely(setstate_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (!setstate || PyErr_Occurred()) { + goto __PYX_BAD; + } + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto __PYX_GOOD; +__PYX_BAD: + if (!PyErr_Occurred()) + PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +__PYX_GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* SetVTable */ + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* TypeImport */ + #ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* CLineInTraceback */ + #ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ + #include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if ((0)) {} + view->obj = NULL; + Py_DECREF(obj); +} +#endif + + + /* MemviewSliceIsContig */ + static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs.memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) + return 0; + itemsize *= mvs.shape[index]; + } + return 1; +} + +/* OverlappingSlices */ + static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +/* Capsule */ + static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* TypeInfoCompare */ + static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + if (!a || !b) + return 0; + if (a == b) + return 1; + if (a->size != b->size || a->typegroup != b->typegroup || + a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { + if (a->typegroup == 'H' || b->typegroup == 'H') { + return a->size == b->size; + } else { + return 0; + } + } + if (a->ndim) { + for (i = 0; i < a->ndim; i++) + if (a->arraysize[i] != b->arraysize[i]) + return 0; + } + if (a->typegroup == 'S') { + if (a->flags != b->flags) + return 0; + if (a->fields || b->fields) { + if (!(a->fields && b->fields)) + return 0; + for (i = 0; a->fields[i].type && b->fields[i].type; i++) { + __Pyx_StructField *field_a = a->fields + i; + __Pyx_StructField *field_b = b->fields + i; + if (field_a->offset != field_b->offset || + !__pyx_typeinfo_cmp(field_a->type, field_b->type)) + return 0; + } + return !a->fields[i].type && !b->fields[i].type; + } + } + return 1; +} + +/* MemviewSliceValidateAndInit */ + static int +__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) +{ + if (buf->shape[dim] <= 1) + return 1; + if (buf->strides) { + if (spec & __Pyx_MEMVIEW_CONTIG) { + if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { + if (unlikely(buf->strides[dim] != sizeof(void *))) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly contiguous " + "in dimension %d.", dim); + goto fail; + } + } else if (unlikely(buf->strides[dim] != buf->itemsize)) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_FOLLOW) { + Py_ssize_t stride = buf->strides[dim]; + if (stride < 0) + stride = -stride; + if (unlikely(stride < buf->itemsize)) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + } else { + if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not contiguous in " + "dimension %d", dim); + goto fail; + } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not indirect in " + "dimension %d", dim); + goto fail; + } else if (unlikely(buf->suboffsets)) { + PyErr_SetString(PyExc_ValueError, + "Buffer exposes suboffsets but no strides"); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec) +{ + if (spec & __Pyx_MEMVIEW_DIRECT) { + if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) { + PyErr_Format(PyExc_ValueError, + "Buffer not compatible with direct access " + "in dimension %d.", dim); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_PTR) { + if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly accessible " + "in dimension %d.", dim); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) +{ + int i; + if (c_or_f_flag & __Pyx_IS_F_CONTIG) { + Py_ssize_t stride = 1; + for (i = 0; i < ndim; i++) { + if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) { + PyErr_SetString(PyExc_ValueError, + "Buffer not fortran contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { + Py_ssize_t stride = 1; + for (i = ndim - 1; i >- 1; i--) { + if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) { + PyErr_SetString(PyExc_ValueError, + "Buffer not C contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } + return 1; +fail: + return 0; +} +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj) +{ + struct __pyx_memoryview_obj *memview, *new_memview; + __Pyx_RefNannyDeclarations + Py_buffer *buf; + int i, spec = 0, retval = -1; + __Pyx_BufFmt_Context ctx; + int from_memoryview = __pyx_memoryview_check(original_obj); + __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); + if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) + original_obj)->typeinfo)) { + memview = (struct __pyx_memoryview_obj *) original_obj; + new_memview = NULL; + } else { + memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + original_obj, buf_flags, 0, dtype); + new_memview = memview; + if (unlikely(!memview)) + goto fail; + } + buf = &memview->view; + if (unlikely(buf->ndim != ndim)) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + ndim, buf->ndim); + goto fail; + } + if (new_memview) { + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail; + } + if (unlikely((unsigned) buf->itemsize != dtype->size)) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " + "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", + buf->itemsize, + (buf->itemsize > 1) ? "s" : "", + dtype->name, + dtype->size, + (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->len > 0) { + for (i = 0; i < ndim; i++) { + spec = axes_specs[i]; + if (unlikely(!__pyx_check_strides(buf, i, ndim, spec))) + goto fail; + if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec))) + goto fail; + } + if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))) + goto fail; + } + if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, + new_memview != NULL) == -1)) { + goto fail; + } + retval = 0; + goto no_fail; +fail: + Py_XDECREF(new_memview); + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_double(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS_RO | writable_flag, 2, + &__Pyx_TypeInfo_double, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) { + return (PyObject *) PyFloat_FromDouble(*(double *) itemp); +} +static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) { + double value = __pyx_PyFloat_AsDouble(obj); + if ((value == (double)-1) && PyErr_Occurred()) + return 0; + *(double *) itemp = value; + return 1; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS_RO | writable_flag, 1, + &__Pyx_TypeInfo_double, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = (float)(1.0) / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + float r = b.real / b.imag; + float s = (float)(1.0) / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_float(a, a); + case 3: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); + case 4: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_float(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = (double)(1.0) / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = (double)(1.0) / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_double(a, a); + case 3: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); + case 4: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_double(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +/* MemviewSliceCopyTemplate */ + static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object) +{ + __Pyx_RefNannyDeclarations + int i; + __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_memoryview_obj *from_memview = from_mvs->memview; + Py_buffer *buf = &from_memview->view; + PyObject *shape_tuple = NULL; + PyObject *temp_int = NULL; + struct __pyx_array_obj *array_obj = NULL; + struct __pyx_memoryview_obj *memview_obj = NULL; + __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); + for (i = 0; i < ndim; i++) { + if (unlikely(from_mvs->suboffsets[i] >= 0)) { + PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " + "indirect dimensions (axis %d)", i); + goto fail; + } + } + shape_tuple = PyTuple_New(ndim); + if (unlikely(!shape_tuple)) { + goto fail; + } + __Pyx_GOTREF(shape_tuple); + for(i = 0; i < ndim; i++) { + temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); + if(unlikely(!temp_int)) { + goto fail; + } else { + PyTuple_SET_ITEM(shape_tuple, i, temp_int); + temp_int = NULL; + } + } + array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); + if (unlikely(!array_obj)) { + goto fail; + } + __Pyx_GOTREF(array_obj); + memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + (PyObject *) array_obj, contig_flag, + dtype_is_object, + from_mvs->memview->typeinfo); + if (unlikely(!memview_obj)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) + goto fail; + if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, + dtype_is_object) < 0)) + goto fail; + goto no_fail; +fail: + __Pyx_XDECREF(new_mvs.memview); + new_mvs.memview = NULL; + new_mvs.data = NULL; +no_fail: + __Pyx_XDECREF(shape_tuple); + __Pyx_XDECREF(temp_int); + __Pyx_XDECREF(array_obj); + __Pyx_RefNannyFinishContext(); + return new_mvs; +} + +/* TypeInfoToFormat */ + static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) { + struct __pyx_typeinfo_string result = { {0} }; + char *buf = (char *) result.string; + size_t size = type->size; + switch (type->typegroup) { + case 'H': + *buf = 'c'; + break; + case 'I': + case 'U': + if (size == 1) + *buf = (type->is_unsigned) ? 'B' : 'b'; + else if (size == 2) + *buf = (type->is_unsigned) ? 'H' : 'h'; + else if (size == 4) + *buf = (type->is_unsigned) ? 'I' : 'i'; + else if (size == 8) + *buf = (type->is_unsigned) ? 'Q' : 'q'; + break; + case 'P': + *buf = 'P'; + break; + case 'C': + { + __Pyx_TypeInfo complex_type = *type; + complex_type.typegroup = 'R'; + complex_type.size /= 2; + *buf++ = 'Z'; + *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0]; + break; + } + case 'R': + if (size == 4) + *buf = 'f'; + else if (size == 8) + *buf = 'd'; + else + *buf = 'g'; + break; + } + return result; +} + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const char neg_one = (char) -1, const_zero = (char) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (char) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) { + return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) { + return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) { + return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (char) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0]) + case -2: + if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + } +#endif + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + char val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (char) -1; + } + } else { + char val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to char"); + return (char) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; +} + +/* CheckBinaryVersion */ + static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/rednose/helpers/ekf_sym_pyx.pyx b/rednose/helpers/ekf_sym_pyx.pyx new file mode 100644 index 000000000..a5c0d5681 --- /dev/null +++ b/rednose/helpers/ekf_sym_pyx.pyx @@ -0,0 +1,190 @@ +# cython: language_level=3 +# cython: profile=True +# distutils: language = c++ + +cimport cython + +from libcpp.string cimport string +from libcpp.vector cimport vector +from libcpp cimport bool +cimport numpy as np + +import numpy as np + +cdef extern from "" namespace "std" nogil: + cdef cppclass optional[T]: + ctypedef T value_type + bool has_value() + T& value() + +cdef extern from "rednose/helpers/ekf_sym.h" namespace "EKFS": + cdef cppclass MapVectorXd "Eigen::Map": + MapVectorXd(double*, int) + + cdef cppclass MapMatrixXdr "Eigen::Map >": + MapMatrixXdr(double*, int, int) + + cdef cppclass VectorXd "Eigen::VectorXd": + VectorXd() + double* data() + int rows() + + cdef cppclass MatrixXdr "Eigen::Matrix": + MatrixXdr() + double* data() + int rows() + int cols() + + ctypedef struct Estimate: + VectorXd xk1 + VectorXd xk + MatrixXdr Pk1 + MatrixXdr Pk + double t + int kind + vector[VectorXd] y + vector[VectorXd] z + vector[vector[double]] extra_args + + cdef cppclass EKFSym: + EKFSym(string name, MapMatrixXdr Q, MapVectorXd x_initial, MapMatrixXdr P_initial, int dim_main, + int dim_main_err, int N, int dim_augment, int dim_augment_err, vector[int] maha_test_kinds, + vector[int] quaternion_idxs, vector[string] global_vars, double max_rewind_age) + void init_state(MapVectorXd state, MapMatrixXdr covs, double filter_time) + + VectorXd state() + MatrixXdr covs() + void set_filter_time(double t) + double get_filter_time() + void set_global(string name, double val) + void reset_rewind() + + void predict(double t) + optional[Estimate] predict_and_update_batch(double t, int kind, vector[MapVectorXd] z, vector[MapMatrixXdr] z, + vector[vector[double]] extra_args, bool augment) + +# Functions like `numpy_to_matrix` are not possible, cython requires default +# constructor for return variable types which aren't available with Eigen::Map + +@cython.wraparound(False) +@cython.boundscheck(False) +cdef np.ndarray[np.float64_t, ndim=2, mode="c"] matrix_to_numpy(MatrixXdr arr): + cdef double[:,:] mem_view = arr.data() + return np.copy(np.asarray(mem_view, dtype=np.double, order="C")) + +@cython.wraparound(False) +@cython.boundscheck(False) +cdef np.ndarray[np.float64_t, ndim=1, mode="c"] vector_to_numpy(VectorXd arr): + cdef double[:] mem_view = arr.data() + return np.copy(np.asarray(mem_view, dtype=np.double, order="C")) + +cdef class EKF_sym: + cdef EKFSym* ekf + def __cinit__(self, str gen_dir, str name, np.ndarray[np.float64_t, ndim=2] Q, + np.ndarray[np.float64_t, ndim=1] x_initial, np.ndarray[np.float64_t, ndim=2] P_initial, int dim_main, + int dim_main_err, int N=0, int dim_augment=0, int dim_augment_err=0, list maha_test_kinds=[], + list quaternion_idxs=[], list global_vars=[], double max_rewind_age=1.0, logger=None): + # TODO logger + + cdef np.ndarray[np.float64_t, ndim=2, mode='c'] Q_b = np.ascontiguousarray(Q, dtype=np.double) + cdef np.ndarray[np.float64_t, ndim=1, mode='c'] x_initial_b = np.ascontiguousarray(x_initial, dtype=np.double) + cdef np.ndarray[np.float64_t, ndim=2, mode='c'] P_initial_b = np.ascontiguousarray(P_initial, dtype=np.double) + self.ekf = new EKFSym( + name.encode('utf8'), + MapMatrixXdr( Q_b.data, Q.shape[0], Q.shape[1]), + MapVectorXd( x_initial_b.data, x_initial.shape[0]), + MapMatrixXdr( P_initial_b.data, P_initial.shape[0], P_initial.shape[1]), + dim_main, + dim_main_err, + N, + dim_augment, + dim_augment_err, + maha_test_kinds, + quaternion_idxs, + [x.encode('utf8') for x in global_vars], + max_rewind_age + ) + + def init_state(self, np.ndarray[np.float64_t, ndim=1] state, np.ndarray[np.float64_t, ndim=2] covs, filter_time): + cdef np.ndarray[np.float64_t, ndim=1, mode='c'] state_b = np.ascontiguousarray(state, dtype=np.double) + cdef np.ndarray[np.float64_t, ndim=2, mode='c'] covs_b = np.ascontiguousarray(covs, dtype=np.double) + self.ekf.init_state( + MapVectorXd( state_b.data, state.shape[0]), + MapMatrixXdr( covs_b.data, covs.shape[0], covs.shape[1]), + np.nan if filter_time is None else filter_time + ) + + def state(self): + cdef np.ndarray res = vector_to_numpy(self.ekf.state()) + return res + + def covs(self): + return matrix_to_numpy(self.ekf.covs()) + + def set_filter_time(self, double t): + self.ekf.set_filter_time(t) + + def get_filter_time(self): + return self.ekf.get_filter_time() + + def set_global(self, str global_var, double val): + self.ekf.set_global(global_var.encode('utf8'), val) + + def reset_rewind(self): + self.ekf.reset_rewind() + + def predict(self, double t): + self.ekf.predict(t) + + def predict_and_update_batch(self, double t, int kind, z, R, extra_args=[[]], bool augment=False): + cdef vector[MapVectorXd] z_map + cdef np.ndarray[np.float64_t, ndim=1, mode='c'] zi_b + for zi in z: + zi_b = np.ascontiguousarray(zi, dtype=np.double) + z_map.push_back(MapVectorXd( zi_b.data, zi.shape[0])) + + cdef vector[MapMatrixXdr] R_map + cdef np.ndarray[np.float64_t, ndim=2, mode='c'] Ri_b + for Ri in R: + Ri_b = np.ascontiguousarray(Ri, dtype=np.double) + R_map.push_back(MapMatrixXdr( Ri_b.data, Ri.shape[0], Ri.shape[1])) + + cdef vector[vector[double]] extra_args_map + cdef vector[double] args_map + for args in extra_args: + args_map.clear() + for a in args: + args_map.push_back(a) + extra_args_map.push_back(args_map) + + cdef optional[Estimate] res = self.ekf.predict_and_update_batch(t, kind, z_map, R_map, extra_args_map, augment) + if not res.has_value(): + return None + + cdef VectorXd tmpvec + return ( + vector_to_numpy(res.value().xk1), + vector_to_numpy(res.value().xk), + matrix_to_numpy(res.value().Pk1), + matrix_to_numpy(res.value().Pk), + res.value().t, + res.value().kind, + [vector_to_numpy(tmpvec) for tmpvec in res.value().y], + z, # TODO: take return values? + extra_args, + ) + + def augment(self): + raise NotImplementedError() # TODO + + def get_augment_times(self): + raise NotImplementedError() # TODO + + def rts_smooth(self, estimates, norm_quats=False): + raise NotImplementedError() # TODO + + def maha_test(self, x, P, kind, z, R, extra_args=[], maha_thresh=0.95): + raise NotImplementedError() # TODO + + def __dealloc__(self): + del self.ekf diff --git a/rednose/helpers/ekf_sym_pyx.so b/rednose/helpers/ekf_sym_pyx.so new file mode 100755 index 000000000..bc5023d7d Binary files /dev/null and b/rednose/helpers/ekf_sym_pyx.so differ diff --git a/rednose/helpers/feature_handler.py b/rednose/helpers/feature_handler.py new file mode 100755 index 000000000..6a20b85e1 --- /dev/null +++ b/rednose/helpers/feature_handler.py @@ -0,0 +1,160 @@ +#!/usr/bin/env python3 + +import os +import sys + +import numpy as np + +from rednose.helpers import TEMPLATE_DIR, load_code, write_code +from rednose.helpers.sympy_helpers import quat_matrix_l, rot_matrix + + +def sane(track): + img_pos = track[1:, 2:4] + diffs_x = abs(img_pos[1:, 0] - img_pos[:-1, 0]) + diffs_y = abs(img_pos[1:, 1] - img_pos[:-1, 1]) + for i in range(1, len(diffs_x)): + if ((diffs_x[i] > 0.05 or diffs_x[i - 1] > 0.05) and + (diffs_x[i] > 2 * diffs_x[i - 1] or + diffs_x[i] < .5 * diffs_x[i - 1])) or \ + ((diffs_y[i] > 0.05 or diffs_y[i - 1] > 0.05) and + (diffs_y[i] > 2 * diffs_y[i - 1] or + diffs_y[i] < .5 * diffs_y[i - 1])): + return False + return True + + +class FeatureHandler(): + name = 'feature_handler' + + @staticmethod + def generate_code(generated_dir, K=5): + # Wrap c code for slow matching + c_header = "\nvoid merge_features(double *tracks, double *features, long long *empty_idxs);" + + c_code = "#include \n" + c_code += "#include \n" + c_code += "#define K %d\n" % K + c_code += "extern \"C\" {\n" + c_code += "\n" + open(os.path.join(TEMPLATE_DIR, "feature_handler.c")).read() + c_code += "\n}\n" + + filename = f"{FeatureHandler.name}_{K}" + write_code(generated_dir, filename, c_code, c_header) + + def __init__(self, generated_dir, K=5): + self.MAX_TRACKS = 6000 + self.K = K + + # Array of tracks, each track has K 5D features preceded + # by 5 params that inidicate [f_idx, last_idx, updated, complete, valid] + # f_idx: idx of current last feature in track + # idx of of last feature in frame + # bool for whether this track has been update + # bool for whether this track is complete + # bool for whether this track is valid + self.tracks = np.zeros((self.MAX_TRACKS, K + 1, 5)) + self.tracks[:] = np.nan + + name = f"{FeatureHandler.name}_{K}" + ffi, lib = load_code(generated_dir, name) + + def merge_features_c(tracks, features, empty_idxs): + lib.merge_features(ffi.cast("double *", tracks.ctypes.data), + ffi.cast("double *", features.ctypes.data), + ffi.cast("long long *", empty_idxs.ctypes.data)) + + # self.merge_features = self.merge_features_python + self.merge_features = merge_features_c + + def reset(self): + self.tracks[:] = np.nan + + def merge_features_python(self, tracks, features, empty_idxs): + empty_idx = 0 + for f in features: + match_idx = int(f[4]) + if tracks[match_idx, 0, 1] == match_idx and tracks[match_idx, 0, 2] == 0: + tracks[match_idx, 0, 0] += 1 + tracks[match_idx, 0, 1] = f[1] + tracks[match_idx, 0, 2] = 1 + tracks[match_idx, int(tracks[match_idx, 0, 0])] = f + if tracks[match_idx, 0, 0] == self.K: + tracks[match_idx, 0, 3] = 1 + if sane(tracks[match_idx]): + tracks[match_idx, 0, 4] = 1 + else: + if empty_idx == len(empty_idxs): + print('need more empty space') + continue + tracks[empty_idxs[empty_idx], 0, 0] = 1 + tracks[empty_idxs[empty_idx], 0, 1] = f[1] + tracks[empty_idxs[empty_idx], 0, 2] = 1 + tracks[empty_idxs[empty_idx], 1] = f + empty_idx += 1 + + def update_tracks(self, features): + last_idxs = np.copy(self.tracks[:, 0, 1]) + real = np.isfinite(last_idxs) + self.tracks[last_idxs[real].astype(int)] = self.tracks[real] + + mask = np.ones(self.MAX_TRACKS, np.bool) + mask[last_idxs[real].astype(int)] = 0 + empty_idxs = np.arange(self.MAX_TRACKS)[mask] + + self.tracks[empty_idxs] = np.nan + self.tracks[:, 0, 2] = 0 + self.merge_features(self.tracks, features, empty_idxs) + + def handle_features(self, features): + self.update_tracks(features) + valid_idxs = self.tracks[:, 0, 4] == 1 + complete_idxs = self.tracks[:, 0, 3] == 1 + stale_idxs = self.tracks[:, 0, 2] == 0 + valid_tracks = self.tracks[valid_idxs] + self.tracks[complete_idxs] = np.nan + self.tracks[stale_idxs] = np.nan + return valid_tracks[:, 1:, :4].reshape((len(valid_tracks), self.K * 4)) + + +def generate_orient_error_jac(K): + import sympy as sp + from rednose.helpers.sympy_helpers import quat_rotate + + x_sym = sp.MatrixSymbol('abr', 3, 1) + dtheta = sp.MatrixSymbol('dtheta', 3, 1) + delta_quat = sp.Matrix(np.ones(4)) + delta_quat[1:, :] = sp.Matrix(0.5 * dtheta[0:3, :]) + poses_sym = sp.MatrixSymbol('poses', 7 * K, 1) + img_pos_sym = sp.MatrixSymbol('img_positions', 2 * K, 1) + alpha, beta, rho = x_sym + to_c = sp.Matrix(rot_matrix(-np.pi / 2, -np.pi / 2, 0)) + pos_0 = sp.Matrix(np.array(poses_sym[K * 7 - 7:K * 7 - 4])[:, 0]) + q = quat_matrix_l(poses_sym[K * 7 - 4:K * 7]) * delta_quat + quat_rot = quat_rotate(*q) + rot_g_to_0 = to_c * quat_rot.T + rows = [] + for i in range(K): + pos_i = sp.Matrix(np.array(poses_sym[i * 7:i * 7 + 3])[:, 0]) + q = quat_matrix_l(poses_sym[7 * i + 3:7 * i + 7]) * delta_quat + quat_rot = quat_rotate(*q) + rot_g_to_i = to_c * quat_rot.T + rot_0_to_i = rot_g_to_i * (rot_g_to_0.T) + trans_0_to_i = rot_g_to_i * (pos_0 - pos_i) + funct_vec = rot_0_to_i * sp.Matrix([alpha, beta, 1]) + rho * trans_0_to_i + h1, h2, h3 = funct_vec + rows.append(h1 / h3 - img_pos_sym[i * 2 + 0]) + rows.append(h2 / h3 - img_pos_sym[i * 2 + 1]) + img_pos_residual_sym = sp.Matrix(rows) + + # sympy into c + sympy_functions = [] + sympy_functions.append(('orient_error_jac', img_pos_residual_sym.jacobian(dtheta), [x_sym, poses_sym, img_pos_sym, dtheta])) + + return sympy_functions + + +if __name__ == "__main__": + K = int(sys.argv[1].split("_")[-1]) + generated_dir = sys.argv[2] + FeatureHandler.generate_code(generated_dir, K=K) diff --git a/rednose/helpers/kalmanfilter.py b/rednose/helpers/kalmanfilter.py new file mode 100644 index 000000000..0c30e4916 --- /dev/null +++ b/rednose/helpers/kalmanfilter.py @@ -0,0 +1,51 @@ +from typing import Any, Dict + +import numpy as np + + +class KalmanFilter: + name = "" + initial_x = np.zeros((0, 0)) + initial_P_diag = np.zeros((0, 0)) + Q = np.zeros((0, 0)) + obs_noise: Dict[int, Any] = {} + + filter = None # Should be initialized when initializating a KalmanFilter implementation + + @property + def x(self): + return self.filter.state() + + @property + def t(self): + return self.filter.get_filter_time() + + @property + def P(self): + return self.filter.covs() + + def init_state(self, state, covs_diag=None, covs=None, filter_time=None): + if covs_diag is not None: + P = np.diag(covs_diag) + elif covs is not None: + P = covs + else: + P = self.filter.covs() + self.filter.init_state(state, P, filter_time) + + def get_R(self, kind, n): + obs_noise = self.obs_noise[kind] + dim = obs_noise.shape[0] + R = np.zeros((n, dim, dim)) + for i in range(n): + R[i, :, :] = obs_noise + return R + + def predict_and_observe(self, t, kind, data, R=None): + if len(data) > 0: + data = np.atleast_2d(data) + + if R is None: + R = self.get_R(kind, len(data)) + + self.filter.predict_and_update_batch(t, kind, data, R) diff --git a/rednose/helpers/lst_sq_computer.py b/rednose/helpers/lst_sq_computer.py new file mode 100755 index 000000000..56c3bc8c4 --- /dev/null +++ b/rednose/helpers/lst_sq_computer.py @@ -0,0 +1,175 @@ +#!/usr/bin/env python3 +import os +import sys + +import numpy as np +import sympy as sp + +from rednose.helpers import TEMPLATE_DIR, load_code, write_code +from rednose.helpers.sympy_helpers import quat_rotate, sympy_into_c, rot_matrix, rotations_from_quats + + +def generate_residual(K): + x_sym = sp.MatrixSymbol('abr', 3, 1) + poses_sym = sp.MatrixSymbol('poses', 7 * K, 1) + img_pos_sym = sp.MatrixSymbol('img_positions', 2 * K, 1) + alpha, beta, rho = x_sym + to_c = sp.Matrix(rot_matrix(-np.pi / 2, -np.pi / 2, 0)) + pos_0 = sp.Matrix(np.array(poses_sym[K * 7 - 7:K * 7 - 4])[:, 0]) + q = poses_sym[K * 7 - 4:K * 7] + quat_rot = quat_rotate(*q) + rot_g_to_0 = to_c * quat_rot.T + rows = [] + + for i in range(K): + pos_i = sp.Matrix(np.array(poses_sym[i * 7:i * 7 + 3])[:, 0]) + q = poses_sym[7 * i + 3:7 * i + 7] + quat_rot = quat_rotate(*q) + rot_g_to_i = to_c * quat_rot.T + rot_0_to_i = rot_g_to_i * rot_g_to_0.T + trans_0_to_i = rot_g_to_i * (pos_0 - pos_i) + funct_vec = rot_0_to_i * sp.Matrix([alpha, beta, 1]) + rho * trans_0_to_i + h1, h2, h3 = funct_vec + rows.append(h1 / h3 - img_pos_sym[i * 2 + 0]) + rows.append(h2 / h3 - img_pos_sym[i * 2 + 1]) + img_pos_residual_sym = sp.Matrix(rows) + + # sympy into c + sympy_functions = [] + sympy_functions.append(('res_fun', img_pos_residual_sym, [x_sym, poses_sym, img_pos_sym])) + sympy_functions.append(('jac_fun', img_pos_residual_sym.jacobian(x_sym), [x_sym, poses_sym, img_pos_sym])) + + return sympy_functions + + +class LstSqComputer(): + name = 'pos_computer' + + @staticmethod + def generate_code(generated_dir, K=4): + sympy_functions = generate_residual(K) + header, sympy_code = sympy_into_c(sympy_functions) + + code = "\n#include \"rednose/helpers/common_ekf.h\"\n" + code += "\n#define KDIM %d\n" % K + code += "extern \"C\" {\n" + code += sympy_code + code += "\n" + open(os.path.join(TEMPLATE_DIR, "compute_pos.c")).read() + "\n" + code += "}\n" + + header += "\nvoid compute_pos(double *to_c, double *in_poses, double *in_img_positions, double *param, double *pos);\n" + + filename = f"{LstSqComputer.name}_{K}" + write_code(generated_dir, filename, code, header) + + def __init__(self, generated_dir, K=4, MIN_DEPTH=2, MAX_DEPTH=500): + self.to_c = rot_matrix(-np.pi / 2, -np.pi / 2, 0) + self.MAX_DEPTH = MAX_DEPTH + self.MIN_DEPTH = MIN_DEPTH + + name = f"{LstSqComputer.name}_{K}" + ffi, lib = load_code(generated_dir, name) + + # wrap c functions + def residual_jac(x, poses, img_positions): + out = np.zeros(((K * 2, 3)), dtype=np.float64) + lib.jac_fun(ffi.cast("double *", x.ctypes.data), + ffi.cast("double *", poses.ctypes.data), + ffi.cast("double *", img_positions.ctypes.data), + ffi.cast("double *", out.ctypes.data)) + return out + self.residual_jac = residual_jac + + def residual(x, poses, img_positions): + out = np.zeros((K * 2), dtype=np.float64) + lib.res_fun(ffi.cast("double *", x.ctypes.data), + ffi.cast("double *", poses.ctypes.data), + ffi.cast("double *", img_positions.ctypes.data), + ffi.cast("double *", out.ctypes.data)) + return out + self.residual = residual + + def compute_pos_c(poses, img_positions): + pos = np.zeros(3, dtype=np.float64) + param = np.zeros(3, dtype=np.float64) + # Can't be a view for the ctype + img_positions = np.copy(img_positions) + lib.compute_pos(ffi.cast("double *", self.to_c.ctypes.data), + ffi.cast("double *", poses.ctypes.data), + ffi.cast("double *", img_positions.ctypes.data), + ffi.cast("double *", param.ctypes.data), + ffi.cast("double *", pos.ctypes.data)) + return pos, param + self.compute_pos_c = compute_pos_c + + def compute_pos(self, poses, img_positions, debug=False): + pos, param = self.compute_pos_c(poses, img_positions) + # pos, param = self.compute_pos_python(poses, img_positions) + + depth = 1 / param[2] + if debug: + # orient_err_jac = self.orient_error_jac(param, poses, img_positions, np.zeros(3)).reshape((-1,2,3)) + jac = self.residual_jac(param, poses, img_positions).reshape((-1, 2, 3)) + res = self.residual(param, poses, img_positions).reshape((-1, 2)) + return pos, param, res, jac # , orient_err_jac + elif (self.MIN_DEPTH < depth < self.MAX_DEPTH): + return pos + else: + return None + + def gauss_newton(self, fun, jac, x, args): + poses, img_positions = args + delta = 1 + counter = 0 + while abs(np.linalg.norm(delta)) > 1e-4 and counter < 30: + delta = np.linalg.pinv(jac(x, poses, img_positions)).dot(fun(x, poses, img_positions)) + x = x - delta + counter += 1 + return [x] + + def compute_pos_python(self, poses, img_positions, check_quality=False): + import scipy.optimize as opt + + # This procedure is also described + # in the MSCKF paper (Mourikis et al. 2007) + x = np.array([img_positions[-1][0], + img_positions[-1][1], 0.1]) + res = opt.leastsq(self.residual, x, Dfun=self.residual_jac, args=(poses, img_positions)) # scipy opt + # res = self.gauss_newton(self.residual, self.residual_jac, x, (poses, img_positions)) # diy gauss_newton + + alpha, beta, rho = res[0] + rot_0_to_g = (rotations_from_quats(poses[-1, 3:])).dot(self.to_c.T) + return (rot_0_to_g.dot(np.array([alpha, beta, 1]))) / rho + poses[-1, :3] + + +# EXPERIMENTAL CODE +def unroll_shutter(img_positions, poses, v, rot_rates, ecef_pos): + # only speed correction for now + t_roll = 0.016 # 16ms rolling shutter? + vroll, vpitch, vyaw = rot_rates + A = 0.5 * np.array([[-1, -vroll, -vpitch, -vyaw], + [vroll, 0, vyaw, -vpitch], + [vpitch, -vyaw, 0, vroll], + [vyaw, vpitch, -vroll, 0]]) + q_dot = A.dot(poses[-1][3:7]) + v = np.append(v, q_dot) + v = np.array([v[0], v[1], v[2], 0, 0, 0, 0]) + current_pose = poses[-1] + v * 0.05 + poses = np.vstack((current_pose, poses)) + dt = -img_positions[:, 1] * t_roll / 0.48 + errs = project(poses, ecef_pos) - project(poses + np.atleast_2d(dt).T.dot(np.atleast_2d(v)), ecef_pos) + return img_positions - errs + + +def project(poses, ecef_pos): + img_positions = np.zeros((len(poses), 2)) + for i, p in enumerate(poses): + cam_frame = rotations_from_quats(p[3:]).T.dot(ecef_pos - p[:3]) + img_positions[i] = np.array([cam_frame[1] / cam_frame[0], cam_frame[2] / cam_frame[0]]) + return img_positions + + +if __name__ == "__main__": + K = int(sys.argv[1].split("_")[-1]) + generated_dir = sys.argv[2] + LstSqComputer.generate_code(generated_dir, K=K) diff --git a/rednose/helpers/sympy_helpers.py b/rednose/helpers/sympy_helpers.py new file mode 100644 index 000000000..716e94e01 --- /dev/null +++ b/rednose/helpers/sympy_helpers.py @@ -0,0 +1,155 @@ +#!/usr/bin/env python3 +import sympy as sp +import numpy as np + +# TODO: remove code duplication between openpilot.common.orientation +def quat2rot(quats): + quats = np.array(quats) + input_shape = quats.shape + quats = np.atleast_2d(quats) + Rs = np.zeros((quats.shape[0], 3, 3)) + q0 = quats[:, 0] + q1 = quats[:, 1] + q2 = quats[:, 2] + q3 = quats[:, 3] + Rs[:, 0, 0] = q0 * q0 + q1 * q1 - q2 * q2 - q3 * q3 + Rs[:, 0, 1] = 2 * (q1 * q2 - q0 * q3) + Rs[:, 0, 2] = 2 * (q0 * q2 + q1 * q3) + Rs[:, 1, 0] = 2 * (q1 * q2 + q0 * q3) + Rs[:, 1, 1] = q0 * q0 - q1 * q1 + q2 * q2 - q3 * q3 + Rs[:, 1, 2] = 2 * (q2 * q3 - q0 * q1) + Rs[:, 2, 0] = 2 * (q1 * q3 - q0 * q2) + Rs[:, 2, 1] = 2 * (q0 * q1 + q2 * q3) + Rs[:, 2, 2] = q0 * q0 - q1 * q1 - q2 * q2 + q3 * q3 + + if len(input_shape) < 2: + return Rs[0] + else: + return Rs + + +def euler2quat(eulers): + eulers = np.array(eulers) + if len(eulers.shape) > 1: + output_shape = (-1,4) + else: + output_shape = (4,) + eulers = np.atleast_2d(eulers) + gamma, theta, psi = eulers[:,0], eulers[:,1], eulers[:,2] + + q0 = np.cos(gamma / 2) * np.cos(theta / 2) * np.cos(psi / 2) + \ + np.sin(gamma / 2) * np.sin(theta / 2) * np.sin(psi / 2) + q1 = np.sin(gamma / 2) * np.cos(theta / 2) * np.cos(psi / 2) - \ + np.cos(gamma / 2) * np.sin(theta / 2) * np.sin(psi / 2) + q2 = np.cos(gamma / 2) * np.sin(theta / 2) * np.cos(psi / 2) + \ + np.sin(gamma / 2) * np.cos(theta / 2) * np.sin(psi / 2) + q3 = np.cos(gamma / 2) * np.cos(theta / 2) * np.sin(psi / 2) - \ + np.sin(gamma / 2) * np.sin(theta / 2) * np.cos(psi / 2) + + quats = np.array([q0, q1, q2, q3]).T + for i in range(len(quats)): + if quats[i,0] < 0: # pylint: disable=unsubscriptable-object + quats[i] = -quats[i] # pylint: disable=unsupported-assignment-operation,unsubscriptable-object + return quats.reshape(output_shape) + + +def euler2rot(eulers): + return quat2rot(euler2quat(eulers)) + +rotations_from_quats = quat2rot + + +def cross(x): + ret = sp.Matrix(np.zeros((3, 3))) + ret[0, 1], ret[0, 2] = -x[2], x[1] + ret[1, 0], ret[1, 2] = x[2], -x[0] + ret[2, 0], ret[2, 1] = -x[1], x[0] + return ret + + +def rot_matrix(roll, pitch, yaw): + cr, sr = np.cos(roll), np.sin(roll) + cp, sp = np.cos(pitch), np.sin(pitch) + cy, sy = np.cos(yaw), np.sin(yaw) + rr = np.array([[1,0,0],[0, cr,-sr],[0, sr, cr]]) + rp = np.array([[cp,0,sp],[0, 1,0],[-sp, 0, cp]]) + ry = np.array([[cy,-sy,0],[sy, cy,0],[0, 0, 1]]) + return ry.dot(rp.dot(rr)) + + +def euler_rotate(roll, pitch, yaw): + # make symbolic rotation matrix from eulers + matrix_roll = sp.Matrix([[1, 0, 0], + [0, sp.cos(roll), -sp.sin(roll)], + [0, sp.sin(roll), sp.cos(roll)]]) + matrix_pitch = sp.Matrix([[sp.cos(pitch), 0, sp.sin(pitch)], + [0, 1, 0], + [-sp.sin(pitch), 0, sp.cos(pitch)]]) + matrix_yaw = sp.Matrix([[sp.cos(yaw), -sp.sin(yaw), 0], + [sp.sin(yaw), sp.cos(yaw), 0], + [0, 0, 1]]) + return matrix_yaw * matrix_pitch * matrix_roll + + +def quat_rotate(q0, q1, q2, q3): + # make symbolic rotation matrix from quat + return sp.Matrix([[q0**2 + q1**2 - q2**2 - q3**2, 2 * (q1 * q2 + q0 * q3), 2 * (q1 * q3 - q0 * q2)], + [2 * (q1 * q2 - q0 * q3), q0**2 - q1**2 + q2**2 - q3**2, 2 * (q2 * q3 + q0 * q1)], + [2 * (q1 * q3 + q0 * q2), 2 * (q2 * q3 - q0 * q1), q0**2 - q1**2 - q2**2 + q3**2]]).T + + +def quat_matrix_l(p): + return sp.Matrix([[p[0], -p[1], -p[2], -p[3]], + [p[1], p[0], -p[3], p[2]], + [p[2], p[3], p[0], -p[1]], + [p[3], -p[2], p[1], p[0]]]) + + +def quat_matrix_r(p): + return sp.Matrix([[p[0], -p[1], -p[2], -p[3]], + [p[1], p[0], p[3], -p[2]], + [p[2], -p[3], p[0], p[1]], + [p[3], p[2], -p[1], p[0]]]) + + +def sympy_into_c(sympy_functions, global_vars=None): + from sympy.utilities import codegen + routines = [] + for name, expr, args in sympy_functions: + r = codegen.make_routine(name, expr, language="C99", global_vars=global_vars) + + # argument ordering input to sympy is broken with function with output arguments + nargs = [] + + # reorder the input arguments + for aa in args: + if aa is None: + nargs.append(codegen.InputArgument(sp.Symbol('unused'), dimensions=[1, 1])) + continue + found = False + for a in r.arguments: + if str(aa.name) == str(a.name): + nargs.append(a) + found = True + break + if not found: + # [1,1] is a hack for Matrices + nargs.append(codegen.InputArgument(aa, dimensions=[1, 1])) + + # add the output arguments + for a in r.arguments: + if type(a) == codegen.OutputArgument: + nargs.append(a) + + # assert len(r.arguments) == len(args)+1 + r.arguments = nargs + + # add routine to list + routines.append(r) + + [(_, c_code), (_, c_header)] = codegen.get_code_generator('C', 'ekf', 'C99').write(routines, "ekf") + c_header = '\n'.join(x for x in c_header.split("\n") if len(x) > 0 and x[0] != '#') + + c_code = '\n'.join(x for x in c_code.split("\n") if len(x) > 0 and x[0] != '#') + + return c_header, c_code diff --git a/rednose/logger/logger.h b/rednose/logger/logger.h new file mode 100644 index 000000000..e21509352 --- /dev/null +++ b/rednose/logger/logger.h @@ -0,0 +1,20 @@ +#pragma once + +#ifdef SWAGLOG +#include "selfdrive/common/swaglog.h" +#else + +#define CLOUDLOG_DEBUG 10 +#define CLOUDLOG_INFO 20 +#define CLOUDLOG_WARNING 30 +#define CLOUDLOG_ERROR 40 +#define CLOUDLOG_CRITICAL 50 + +#define cloudlog(lvl, fmt, ...) printf(fmt "\n", ## __VA_ARGS__) + +#define LOGD(fmt, ...) cloudlog(CLOUDLOG_DEBUG, fmt, ## __VA_ARGS__) +#define LOG(fmt, ...) cloudlog(CLOUDLOG_INFO, fmt, ## __VA_ARGS__) +#define LOGW(fmt, ...) cloudlog(CLOUDLOG_WARNING, fmt, ## __VA_ARGS__) +#define LOGE(fmt, ...) cloudlog(CLOUDLOG_ERROR, fmt, ## __VA_ARGS__) + +#endif diff --git a/rednose/templates/compute_pos.c b/rednose/templates/compute_pos.c new file mode 100644 index 000000000..742c7d618 --- /dev/null +++ b/rednose/templates/compute_pos.c @@ -0,0 +1,52 @@ +#include +#include +#include + +typedef Eigen::Matrix R3M; +typedef Eigen::Matrix R1M; +typedef Eigen::Matrix O1M; +typedef Eigen::Matrix M3D; + +void gauss_newton(double *in_x, double *in_poses, double *in_img_positions) { + + double res[KDIM*2] = {0}; + double jac[KDIM*6] = {0}; + + O1M x(in_x); + O1M delta; + int counter = 0; + while ((delta.squaredNorm() > 0.0001 and counter < 30) or counter == 0){ + res_fun(in_x, in_poses, in_img_positions, res); + jac_fun(in_x, in_poses, in_img_positions, jac); + R1M E(res); R3M J(jac); + delta = (J.transpose()*J).inverse() * J.transpose() * E; + x = x - delta; + memcpy(in_x, x.data(), 3 * sizeof(double)); + counter = counter + 1; + } +} + + +void compute_pos(double *to_c, double *poses, double *img_positions, double *param, double *pos) { + param[0] = img_positions[KDIM*2-2]; + param[1] = img_positions[KDIM*2-1]; + param[2] = 0.1; + gauss_newton(param, poses, img_positions); + + Eigen::Quaterniond q; + q.w() = poses[KDIM*7-4]; + q.x() = poses[KDIM*7-3]; + q.y() = poses[KDIM*7-2]; + q.z() = poses[KDIM*7-1]; + M3D RC(to_c); + Eigen::Matrix3d R = q.normalized().toRotationMatrix(); + Eigen::Matrix3d rot = R * RC.transpose(); + + pos[0] = param[0]/param[2]; + pos[1] = param[1]/param[2]; + pos[2] = 1.0/param[2]; + O1M ecef_offset(poses + KDIM*7-7); + O1M ecef_output(pos); + ecef_output = rot*ecef_output + ecef_offset; + memcpy(pos, ecef_output.data(), 3 * sizeof(double)); +} diff --git a/rednose/templates/ekf_c.c b/rednose/templates/ekf_c.c new file mode 100644 index 000000000..3b4acdfe3 --- /dev/null +++ b/rednose/templates/ekf_c.c @@ -0,0 +1,123 @@ +#include +#include + +typedef Eigen::Matrix DDM; +typedef Eigen::Matrix EEM; +typedef Eigen::Matrix DEM; + +void predict(double *in_x, double *in_P, double *in_Q, double dt) { + typedef Eigen::Matrix RRM; + + double nx[DIM] = {0}; + double in_F[EDIM*EDIM] = {0}; + + // functions from sympy + f_fun(in_x, dt, nx); + F_fun(in_x, dt, in_F); + + + EEM F(in_F); + EEM P(in_P); + EEM Q(in_Q); + + RRM F_main = F.topLeftCorner(MEDIM, MEDIM); + P.topLeftCorner(MEDIM, MEDIM) = (F_main * P.topLeftCorner(MEDIM, MEDIM)) * F_main.transpose(); + P.topRightCorner(MEDIM, EDIM - MEDIM) = F_main * P.topRightCorner(MEDIM, EDIM - MEDIM); + P.bottomLeftCorner(EDIM - MEDIM, MEDIM) = P.bottomLeftCorner(EDIM - MEDIM, MEDIM) * F_main.transpose(); + + P = P + dt*Q; + + // copy out state + memcpy(in_x, nx, DIM * sizeof(double)); + memcpy(in_P, P.data(), EDIM * EDIM * sizeof(double)); +} + +// note: extra_args dim only correct when null space projecting +// otherwise 1 +template +void update(double *in_x, double *in_P, Hfun h_fun, Hfun H_fun, Hfun Hea_fun, double *in_z, double *in_R, double *in_ea, double MAHA_THRESHOLD) { + typedef Eigen::Matrix ZZM; + typedef Eigen::Matrix ZDM; + typedef Eigen::Matrix XEM; + //typedef Eigen::Matrix EZM; + typedef Eigen::Matrix X1M; + typedef Eigen::Matrix XXM; + + double in_hx[ZDIM] = {0}; + double in_H[ZDIM * DIM] = {0}; + double in_H_mod[EDIM * DIM] = {0}; + double delta_x[EDIM] = {0}; + double x_new[DIM] = {0}; + + + // state x, P + Eigen::Matrix z(in_z); + EEM P(in_P); + ZZM pre_R(in_R); + + // functions from sympy + h_fun(in_x, in_ea, in_hx); + H_fun(in_x, in_ea, in_H); + ZDM pre_H(in_H); + + // get y (y = z - hx) + Eigen::Matrix pre_y(in_hx); pre_y = z - pre_y; + X1M y; XXM H; XXM R; + if (Hea_fun){ + typedef Eigen::Matrix ZAM; + double in_Hea[ZDIM * EADIM] = {0}; + Hea_fun(in_x, in_ea, in_Hea); + ZAM Hea(in_Hea); + XXM A = Hea.transpose().fullPivLu().kernel(); + + + y = A.transpose() * pre_y; + H = A.transpose() * pre_H; + R = A.transpose() * pre_R * A; + } else { + y = pre_y; + H = pre_H; + R = pre_R; + } + // get modified H + H_mod_fun(in_x, in_H_mod); + DEM H_mod(in_H_mod); + XEM H_err = H * H_mod; + + // Do mahalobis distance test + if (MAHA_TEST){ + XXM a = (H_err * P * H_err.transpose() + R).inverse(); + double maha_dist = y.transpose() * a * y; + if (maha_dist > MAHA_THRESHOLD){ + R = 1.0e16 * R; + } + } + + // Outlier resilient weighting + double weight = 1;//(1.5)/(1 + y.squaredNorm()/R.sum()); + + // kalman gains and I_KH + XXM S = ((H_err * P) * H_err.transpose()) + R/weight; + XEM KT = S.fullPivLu().solve(H_err * P.transpose()); + //EZM K = KT.transpose(); TODO: WHY DOES THIS NOT COMPILE? + //EZM K = S.fullPivLu().solve(H_err * P.transpose()).transpose(); + //std::cout << "Here is the matrix rot:\n" << K << std::endl; + EEM I_KH = Eigen::Matrix::Identity() - (KT.transpose() * H_err); + + // update state by injecting dx + Eigen::Matrix dx(delta_x); + dx = (KT.transpose() * y); + memcpy(delta_x, dx.data(), EDIM * sizeof(double)); + err_fun(in_x, delta_x, x_new); + Eigen::Matrix x(x_new); + + // update cov + P = ((I_KH * P) * I_KH.transpose()) + ((KT.transpose() * R) * KT); + + // copy out state + memcpy(in_x, x.data(), DIM * sizeof(double)); + memcpy(in_P, P.data(), EDIM * EDIM * sizeof(double)); + memcpy(in_z, y.data(), y.rows() * sizeof(double)); +} + + diff --git a/rednose/templates/feature_handler.c b/rednose/templates/feature_handler.c new file mode 100644 index 000000000..9c580c2ea --- /dev/null +++ b/rednose/templates/feature_handler.c @@ -0,0 +1,56 @@ +bool sane(double track [K + 1][5]) { + double diffs_x [K-1]; + double diffs_y [K-1]; + int i; + for (i = 0; i < K-1; i++) { + diffs_x[i] = fabs(track[i+2][2] - track[i+1][2]); + diffs_y[i] = fabs(track[i+2][3] - track[i+1][3]); + } + for (i = 1; i < K-1; i++) { + if (((diffs_x[i] > 0.05 or diffs_x[i-1] > 0.05) and + (diffs_x[i] > 2*diffs_x[i-1] or + diffs_x[i] < .5*diffs_x[i-1])) or + ((diffs_y[i] > 0.05 or diffs_y[i-1] > 0.05) and + (diffs_y[i] > 2*diffs_y[i-1] or + diffs_y[i] < .5*diffs_y[i-1]))){ + return false; + } + } + return true; +} + +void merge_features(double *tracks, double *features, long long *empty_idxs) { + double feature_arr [3000][5]; + memcpy(feature_arr, features, 3000 * 5 * sizeof(double)); + double track_arr [6000][K + 1][5]; + memcpy(track_arr, tracks, (K+1) * 6000 * 5 * sizeof(double)); + int match; + int empty_idx = 0; + int idx; + for (int i = 0; i < 3000; i++) { + match = feature_arr[i][4]; + if (track_arr[match][0][1] == match and track_arr[match][0][2] == 0){ + track_arr[match][0][0] = track_arr[match][0][0] + 1; + track_arr[match][0][1] = feature_arr[i][1]; + track_arr[match][0][2] = 1; + idx = track_arr[match][0][0]; + memcpy(track_arr[match][idx], feature_arr[i], 5 * sizeof(double)); + if (idx == K){ + // label complete + track_arr[match][0][3] = 1; + if (sane(track_arr[match])){ + // label valid + track_arr[match][0][4] = 1; + } + } + } else { + // gen new track with this feature + track_arr[empty_idxs[empty_idx]][0][0] = 1; + track_arr[empty_idxs[empty_idx]][0][1] = feature_arr[i][1]; + track_arr[empty_idxs[empty_idx]][0][2] = 1; + memcpy(track_arr[empty_idxs[empty_idx]][1], feature_arr[i], 5 * sizeof(double)); + empty_idx = empty_idx + 1; + } + } + memcpy(tracks, track_arr, (K+1) * 6000 * 5 * sizeof(double)); +} diff --git a/scripts/stop_updater.sh b/scripts/stop_updater.sh new file mode 100755 index 000000000..4243d30e9 --- /dev/null +++ b/scripts/stop_updater.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +# Stop updater +pkill -2 -f selfdrive.updated + +# Remove pending update +rm -f /data/safe_staging/finalized/.overlay_consistent diff --git a/scripts/update_now.sh b/scripts/update_now.sh new file mode 100755 index 000000000..3f0193f08 --- /dev/null +++ b/scripts/update_now.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +# Send SIGHUP to updater +pkill -1 -f selfdrive.updated diff --git a/selfdrive/__init__.py b/selfdrive/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/assets/.gitignore b/selfdrive/assets/.gitignore new file mode 100644 index 000000000..283034ca8 --- /dev/null +++ b/selfdrive/assets/.gitignore @@ -0,0 +1 @@ +*.cc diff --git a/selfdrive/assets/assets.cc b/selfdrive/assets/assets.cc new file mode 100644 index 000000000..1822776a9 --- /dev/null +++ b/selfdrive/assets/assets.cc @@ -0,0 +1,1446 @@ +/**************************************************************************** +** Resource object code +** +** Created by: The Resource Compiler for Qt version 5.12.8 +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +static const unsigned char qt_resource_data[] = { + // /data/openpilot_release/selfdrive/assets/img_eye_open.svg + 0x0,0x0,0x3,0x7, + 0x3c, + 0x73,0x76,0x67,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x38,0x31,0x22,0x20,0x68, + 0x65,0x69,0x67,0x68,0x74,0x3d,0x22,0x34,0x34,0x22,0x20,0x76,0x69,0x65,0x77,0x42, + 0x6f,0x78,0x3d,0x22,0x30,0x20,0x30,0x20,0x38,0x31,0x20,0x34,0x34,0x22,0x20,0x66, + 0x69,0x6c,0x6c,0x3d,0x22,0x6e,0x6f,0x6e,0x65,0x22,0x20,0x78,0x6d,0x6c,0x6e,0x73, + 0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,0x2e, + 0x6f,0x72,0x67,0x2f,0x32,0x30,0x30,0x30,0x2f,0x73,0x76,0x67,0x22,0x3e,0xa,0x3c, + 0x65,0x6c,0x6c,0x69,0x70,0x73,0x65,0x20,0x63,0x78,0x3d,0x22,0x34,0x30,0x2e,0x38, + 0x36,0x36,0x33,0x22,0x20,0x63,0x79,0x3d,0x22,0x32,0x31,0x2e,0x34,0x36,0x36,0x37, + 0x22,0x20,0x72,0x78,0x3d,0x22,0x31,0x32,0x2e,0x32,0x36,0x36,0x37,0x22,0x20,0x72, + 0x79,0x3d,0x22,0x31,0x32,0x2e,0x38,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x23, + 0x42,0x44,0x42,0x44,0x42,0x44,0x22,0x2f,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20, + 0x64,0x3d,0x22,0x4d,0x34,0x30,0x2e,0x38,0x35,0x31,0x36,0x20,0x34,0x34,0x43,0x32, + 0x33,0x2e,0x33,0x30,0x32,0x34,0x20,0x34,0x34,0x20,0x31,0x30,0x2e,0x35,0x33,0x36, + 0x38,0x20,0x33,0x34,0x2e,0x35,0x30,0x31,0x31,0x20,0x33,0x2e,0x32,0x37,0x35,0x30, + 0x31,0x20,0x32,0x37,0x2e,0x36,0x34,0x34,0x43,0x2d,0x30,0x2e,0x31,0x31,0x33,0x38, + 0x30,0x37,0x20,0x32,0x34,0x2e,0x34,0x37,0x39,0x31,0x20,0x2d,0x30,0x2e,0x31,0x31, + 0x33,0x38,0x30,0x37,0x20,0x31,0x39,0x2e,0x35,0x32,0x30,0x39,0x20,0x33,0x2e,0x32, + 0x37,0x35,0x30,0x31,0x20,0x31,0x36,0x2e,0x33,0x35,0x36,0x43,0x31,0x30,0x2e,0x35, + 0x33,0x36,0x38,0x20,0x39,0x2e,0x34,0x39,0x38,0x39,0x20,0x32,0x33,0x2e,0x33,0x30, + 0x32,0x34,0x20,0x30,0x20,0x34,0x30,0x2e,0x38,0x35,0x31,0x36,0x20,0x30,0x43,0x35, + 0x38,0x2e,0x34,0x30,0x30,0x39,0x20,0x30,0x20,0x37,0x31,0x2e,0x32,0x38,0x37,0x35, + 0x20,0x39,0x2e,0x36,0x30,0x34,0x34,0x20,0x37,0x38,0x2e,0x35,0x34,0x39,0x32,0x20, + 0x31,0x36,0x2e,0x34,0x36,0x31,0x35,0x43,0x38,0x31,0x2e,0x38,0x31,0x37,0x20,0x31, + 0x39,0x2e,0x35,0x32,0x30,0x39,0x20,0x38,0x31,0x2e,0x38,0x31,0x37,0x20,0x32,0x34, + 0x2e,0x32,0x36,0x38,0x31,0x20,0x37,0x38,0x2e,0x35,0x34,0x39,0x32,0x20,0x32,0x37, + 0x2e,0x34,0x33,0x33,0x43,0x37,0x31,0x2e,0x32,0x38,0x37,0x35,0x20,0x33,0x34,0x2e, + 0x35,0x30,0x31,0x31,0x20,0x35,0x38,0x2e,0x34,0x30,0x30,0x39,0x20,0x34,0x34,0x20, + 0x34,0x30,0x2e,0x38,0x35,0x31,0x36,0x20,0x34,0x34,0x5a,0x4d,0x36,0x2e,0x34,0x37, + 0x39,0x32,0x38,0x20,0x32,0x30,0x2e,0x36,0x38,0x31,0x33,0x43,0x35,0x2e,0x36,0x33, + 0x32,0x30,0x37,0x20,0x32,0x31,0x2e,0x35,0x32,0x35,0x33,0x20,0x35,0x2e,0x36,0x33, + 0x32,0x30,0x37,0x20,0x32,0x32,0x2e,0x36,0x38,0x35,0x37,0x20,0x36,0x2e,0x34,0x37, + 0x39,0x32,0x38,0x20,0x32,0x33,0x2e,0x35,0x32,0x39,0x37,0x43,0x31,0x31,0x2e,0x36, + 0x38,0x33,0x35,0x20,0x32,0x38,0x2e,0x33,0x38,0x32,0x34,0x20,0x32,0x35,0x2e,0x33, + 0x35,0x39,0x38,0x20,0x33,0x39,0x2e,0x37,0x37,0x35,0x38,0x20,0x34,0x30,0x2e,0x38, + 0x35,0x31,0x36,0x20,0x33,0x39,0x2e,0x37,0x37,0x35,0x38,0x43,0x35,0x36,0x2e,0x33, + 0x34,0x33,0x34,0x20,0x33,0x39,0x2e,0x37,0x37,0x35,0x38,0x20,0x37,0x30,0x2e,0x30, + 0x31,0x39,0x37,0x20,0x32,0x38,0x2e,0x32,0x37,0x36,0x39,0x20,0x37,0x35,0x2e,0x32, + 0x32,0x33,0x39,0x20,0x32,0x33,0x2e,0x33,0x31,0x38,0x37,0x43,0x37,0x35,0x2e,0x39, + 0x35,0x30,0x31,0x20,0x32,0x32,0x2e,0x35,0x38,0x30,0x32,0x20,0x37,0x35,0x2e,0x39, + 0x35,0x30,0x31,0x20,0x32,0x31,0x2e,0x35,0x32,0x35,0x33,0x20,0x37,0x35,0x2e,0x32, + 0x32,0x33,0x39,0x20,0x32,0x30,0x2e,0x37,0x38,0x36,0x38,0x43,0x37,0x30,0x2e,0x30, + 0x31,0x39,0x37,0x20,0x31,0x35,0x2e,0x38,0x32,0x38,0x36,0x20,0x35,0x36,0x2e,0x32, + 0x32,0x32,0x33,0x20,0x34,0x2e,0x33,0x32,0x39,0x36,0x37,0x20,0x34,0x30,0x2e,0x38, + 0x35,0x31,0x36,0x20,0x34,0x2e,0x33,0x32,0x39,0x36,0x37,0x43,0x32,0x35,0x2e,0x34, + 0x38,0x30,0x39,0x20,0x34,0x2e,0x33,0x32,0x39,0x36,0x37,0x20,0x31,0x31,0x2e,0x36, + 0x38,0x33,0x35,0x20,0x31,0x35,0x2e,0x37,0x32,0x33,0x31,0x20,0x36,0x2e,0x34,0x37, + 0x39,0x32,0x38,0x20,0x32,0x30,0x2e,0x36,0x38,0x31,0x33,0x5a,0x22,0x20,0x66,0x69, + 0x6c,0x6c,0x3d,0x22,0x23,0x42,0x44,0x42,0x44,0x42,0x44,0x22,0x2f,0x3e,0xa,0x3c, + 0x2f,0x73,0x76,0x67,0x3e,0xa, + // /data/openpilot_release/selfdrive/assets/img_circled_slash.svg + 0x0,0x0,0x1,0x48, + 0x3c, + 0x73,0x76,0x67,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x31,0x30,0x34,0x22,0x20, + 0x68,0x65,0x69,0x67,0x68,0x74,0x3d,0x22,0x31,0x30,0x34,0x22,0x20,0x76,0x69,0x65, + 0x77,0x42,0x6f,0x78,0x3d,0x22,0x30,0x20,0x30,0x20,0x31,0x30,0x34,0x20,0x31,0x30, + 0x34,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x6e,0x6f,0x6e,0x65,0x22,0x20,0x78, + 0x6d,0x6c,0x6e,0x73,0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77, + 0x2e,0x77,0x33,0x2e,0x6f,0x72,0x67,0x2f,0x32,0x30,0x30,0x30,0x2f,0x73,0x76,0x67, + 0x22,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x35,0x32,0x20, + 0x39,0x38,0x43,0x37,0x37,0x2e,0x34,0x30,0x35,0x31,0x20,0x39,0x38,0x20,0x39,0x38, + 0x20,0x37,0x37,0x2e,0x34,0x30,0x35,0x31,0x20,0x39,0x38,0x20,0x35,0x32,0x43,0x39, + 0x38,0x20,0x32,0x36,0x2e,0x35,0x39,0x34,0x39,0x20,0x37,0x37,0x2e,0x34,0x30,0x35, + 0x31,0x20,0x36,0x20,0x35,0x32,0x20,0x36,0x43,0x32,0x36,0x2e,0x35,0x39,0x34,0x39, + 0x20,0x36,0x20,0x36,0x20,0x32,0x36,0x2e,0x35,0x39,0x34,0x39,0x20,0x36,0x20,0x35, + 0x32,0x43,0x36,0x20,0x37,0x37,0x2e,0x34,0x30,0x35,0x31,0x20,0x32,0x36,0x2e,0x35, + 0x39,0x34,0x39,0x20,0x39,0x38,0x20,0x35,0x32,0x20,0x39,0x38,0x5a,0x22,0x20,0x73, + 0x74,0x72,0x6f,0x6b,0x65,0x3d,0x22,0x23,0x36,0x39,0x36,0x39,0x36,0x39,0x22,0x20, + 0x73,0x74,0x72,0x6f,0x6b,0x65,0x2d,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x31,0x32, + 0x22,0x2f,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x31,0x39, + 0x20,0x38,0x35,0x4c,0x38,0x35,0x20,0x31,0x39,0x22,0x20,0x73,0x74,0x72,0x6f,0x6b, + 0x65,0x3d,0x22,0x23,0x36,0x39,0x36,0x39,0x36,0x39,0x22,0x20,0x73,0x74,0x72,0x6f, + 0x6b,0x65,0x2d,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x31,0x32,0x22,0x2f,0x3e,0xa, + 0x3c,0x2f,0x73,0x76,0x67,0x3e,0xa, + // /data/openpilot_release/selfdrive/assets/img_continue_triangle.svg + 0x0,0x0,0x0,0xc5, + 0x3c, + 0x73,0x76,0x67,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x35,0x34,0x22,0x20,0x68, + 0x65,0x69,0x67,0x68,0x74,0x3d,0x22,0x31,0x30,0x36,0x22,0x20,0x76,0x69,0x65,0x77, + 0x42,0x6f,0x78,0x3d,0x22,0x30,0x20,0x30,0x20,0x35,0x34,0x20,0x31,0x30,0x36,0x22, + 0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x6e,0x6f,0x6e,0x65,0x22,0x20,0x78,0x6d,0x6c, + 0x6e,0x73,0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77, + 0x33,0x2e,0x6f,0x72,0x67,0x2f,0x32,0x30,0x30,0x30,0x2f,0x73,0x76,0x67,0x22,0x3e, + 0xa,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x34,0x2e,0x30,0x31,0x39, + 0x34,0x36,0x20,0x34,0x2e,0x30,0x31,0x34,0x38,0x38,0x4c,0x34,0x37,0x2e,0x32,0x34, + 0x39,0x20,0x35,0x34,0x2e,0x30,0x36,0x36,0x36,0x4c,0x36,0x2e,0x31,0x31,0x38,0x34, + 0x20,0x31,0x30,0x32,0x2e,0x31,0x34,0x31,0x22,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65, + 0x3d,0x22,0x77,0x68,0x69,0x74,0x65,0x22,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x2d, + 0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x31,0x30,0x22,0x2f,0x3e,0xa,0x3c,0x2f,0x73, + 0x76,0x67,0x3e,0xa, + // /data/openpilot_release/selfdrive/assets/img_circled_check.svg + 0x0,0x0,0x1,0xb7, + 0x3c, + 0x73,0x76,0x67,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x31,0x30,0x34,0x22,0x20, + 0x68,0x65,0x69,0x67,0x68,0x74,0x3d,0x22,0x31,0x30,0x34,0x22,0x20,0x76,0x69,0x65, + 0x77,0x42,0x6f,0x78,0x3d,0x22,0x30,0x20,0x30,0x20,0x31,0x30,0x34,0x20,0x31,0x30, + 0x34,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x6e,0x6f,0x6e,0x65,0x22,0x20,0x78, + 0x6d,0x6c,0x6e,0x73,0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77, + 0x2e,0x77,0x33,0x2e,0x6f,0x72,0x67,0x2f,0x32,0x30,0x30,0x30,0x2f,0x73,0x76,0x67, + 0x22,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x37,0x36,0x2e, + 0x33,0x20,0x33,0x36,0x4c,0x34,0x33,0x2e,0x38,0x20,0x36,0x37,0x2e,0x37,0x4c,0x32, + 0x38,0x20,0x35,0x31,0x2e,0x39,0x22,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x3d,0x22, + 0x77,0x68,0x69,0x74,0x65,0x22,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x2d,0x77,0x69, + 0x64,0x74,0x68,0x3d,0x22,0x37,0x22,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x2d,0x6d, + 0x69,0x74,0x65,0x72,0x6c,0x69,0x6d,0x69,0x74,0x3d,0x22,0x31,0x30,0x22,0x20,0x73, + 0x74,0x72,0x6f,0x6b,0x65,0x2d,0x6c,0x69,0x6e,0x65,0x63,0x61,0x70,0x3d,0x22,0x72, + 0x6f,0x75,0x6e,0x64,0x22,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x2d,0x6c,0x69,0x6e, + 0x65,0x6a,0x6f,0x69,0x6e,0x3d,0x22,0x72,0x6f,0x75,0x6e,0x64,0x22,0x2f,0x3e,0xa, + 0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x35,0x32,0x20,0x31,0x30,0x31, + 0x2e,0x35,0x43,0x37,0x39,0x2e,0x33,0x33,0x38,0x31,0x20,0x31,0x30,0x31,0x2e,0x35, + 0x20,0x31,0x30,0x31,0x2e,0x35,0x20,0x37,0x39,0x2e,0x33,0x33,0x38,0x31,0x20,0x31, + 0x30,0x31,0x2e,0x35,0x20,0x35,0x32,0x43,0x31,0x30,0x31,0x2e,0x35,0x20,0x32,0x34, + 0x2e,0x36,0x36,0x31,0x39,0x20,0x37,0x39,0x2e,0x33,0x33,0x38,0x31,0x20,0x32,0x2e, + 0x35,0x20,0x35,0x32,0x20,0x32,0x2e,0x35,0x43,0x32,0x34,0x2e,0x36,0x36,0x31,0x39, + 0x20,0x32,0x2e,0x35,0x20,0x32,0x2e,0x35,0x20,0x32,0x34,0x2e,0x36,0x36,0x31,0x39, + 0x20,0x32,0x2e,0x35,0x20,0x35,0x32,0x43,0x32,0x2e,0x35,0x20,0x37,0x39,0x2e,0x33, + 0x33,0x38,0x31,0x20,0x32,0x34,0x2e,0x36,0x36,0x31,0x39,0x20,0x31,0x30,0x31,0x2e, + 0x35,0x20,0x35,0x32,0x20,0x31,0x30,0x31,0x2e,0x35,0x5a,0x22,0x20,0x73,0x74,0x72, + 0x6f,0x6b,0x65,0x3d,0x22,0x77,0x68,0x69,0x74,0x65,0x22,0x20,0x73,0x74,0x72,0x6f, + 0x6b,0x65,0x2d,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x35,0x22,0x2f,0x3e,0xa,0x3c, + 0x2f,0x73,0x76,0x67,0x3e,0xa, + // /data/openpilot_release/selfdrive/assets/img_eye_closed.svg + 0x0,0x0,0x5,0xd2, + 0x3c, + 0x73,0x76,0x67,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x38,0x31,0x22,0x20,0x68, + 0x65,0x69,0x67,0x68,0x74,0x3d,0x22,0x35,0x34,0x22,0x20,0x76,0x69,0x65,0x77,0x42, + 0x6f,0x78,0x3d,0x22,0x30,0x20,0x30,0x20,0x38,0x31,0x20,0x35,0x34,0x22,0x20,0x66, + 0x69,0x6c,0x6c,0x3d,0x22,0x6e,0x6f,0x6e,0x65,0x22,0x20,0x78,0x6d,0x6c,0x6e,0x73, + 0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,0x2e, + 0x6f,0x72,0x67,0x2f,0x32,0x30,0x30,0x30,0x2f,0x73,0x76,0x67,0x22,0x3e,0xa,0x3c, + 0x70,0x61,0x74,0x68,0x20,0x66,0x69,0x6c,0x6c,0x2d,0x72,0x75,0x6c,0x65,0x3d,0x22, + 0x65,0x76,0x65,0x6e,0x6f,0x64,0x64,0x22,0x20,0x63,0x6c,0x69,0x70,0x2d,0x72,0x75, + 0x6c,0x65,0x3d,0x22,0x65,0x76,0x65,0x6e,0x6f,0x64,0x64,0x22,0x20,0x64,0x3d,0x22, + 0x4d,0x35,0x36,0x2e,0x34,0x38,0x34,0x35,0x20,0x37,0x2e,0x36,0x33,0x30,0x36,0x35, + 0x43,0x35,0x31,0x2e,0x37,0x39,0x30,0x35,0x20,0x36,0x2e,0x30,0x31,0x39,0x32,0x31, + 0x20,0x34,0x36,0x2e,0x35,0x36,0x38,0x34,0x20,0x35,0x20,0x34,0x30,0x2e,0x38,0x35, + 0x31,0x36,0x20,0x35,0x43,0x32,0x33,0x2e,0x33,0x30,0x32,0x34,0x20,0x35,0x20,0x31, + 0x30,0x2e,0x35,0x33,0x36,0x38,0x20,0x31,0x34,0x2e,0x34,0x39,0x38,0x39,0x20,0x33, + 0x2e,0x32,0x37,0x35,0x30,0x31,0x20,0x32,0x31,0x2e,0x33,0x35,0x36,0x43,0x2d,0x30, + 0x2e,0x31,0x31,0x33,0x38,0x30,0x37,0x20,0x32,0x34,0x2e,0x35,0x32,0x30,0x39,0x20, + 0x2d,0x30,0x2e,0x31,0x31,0x33,0x38,0x30,0x37,0x20,0x32,0x39,0x2e,0x34,0x37,0x39, + 0x31,0x20,0x33,0x2e,0x32,0x37,0x35,0x30,0x31,0x20,0x33,0x32,0x2e,0x36,0x34,0x34, + 0x43,0x35,0x2e,0x34,0x39,0x37,0x31,0x35,0x20,0x33,0x34,0x2e,0x37,0x34,0x32,0x33, + 0x20,0x38,0x2e,0x32,0x33,0x34,0x36,0x36,0x20,0x33,0x37,0x2e,0x30,0x38,0x38,0x20, + 0x31,0x31,0x2e,0x34,0x36,0x36,0x39,0x20,0x33,0x39,0x2e,0x33,0x33,0x33,0x32,0x4c, + 0x31,0x36,0x2e,0x30,0x32,0x38,0x34,0x20,0x33,0x36,0x2e,0x31,0x32,0x30,0x38,0x43, + 0x31,0x31,0x2e,0x38,0x32,0x31,0x35,0x20,0x33,0x33,0x2e,0x33,0x30,0x34,0x37,0x20, + 0x38,0x2e,0x35,0x30,0x37,0x32,0x31,0x20,0x33,0x30,0x2e,0x34,0x32,0x30,0x36,0x20, + 0x36,0x2e,0x34,0x37,0x39,0x32,0x38,0x20,0x32,0x38,0x2e,0x35,0x32,0x39,0x37,0x43, + 0x35,0x2e,0x36,0x33,0x32,0x30,0x37,0x20,0x32,0x37,0x2e,0x36,0x38,0x35,0x37,0x20, + 0x35,0x2e,0x36,0x33,0x32,0x30,0x37,0x20,0x32,0x36,0x2e,0x35,0x32,0x35,0x33,0x20, + 0x36,0x2e,0x34,0x37,0x39,0x32,0x38,0x20,0x32,0x35,0x2e,0x36,0x38,0x31,0x33,0x43, + 0x31,0x31,0x2e,0x36,0x38,0x33,0x35,0x20,0x32,0x30,0x2e,0x37,0x32,0x33,0x31,0x20, + 0x32,0x35,0x2e,0x34,0x38,0x30,0x39,0x20,0x39,0x2e,0x33,0x32,0x39,0x36,0x37,0x20, + 0x34,0x30,0x2e,0x38,0x35,0x31,0x36,0x20,0x39,0x2e,0x33,0x32,0x39,0x36,0x37,0x43, + 0x34,0x34,0x2e,0x35,0x35,0x34,0x32,0x20,0x39,0x2e,0x33,0x32,0x39,0x36,0x37,0x20, + 0x34,0x38,0x2e,0x31,0x36,0x35,0x36,0x20,0x39,0x2e,0x39,0x39,0x36,0x39,0x32,0x20, + 0x35,0x31,0x2e,0x35,0x38,0x37,0x35,0x20,0x31,0x31,0x2e,0x30,0x37,0x39,0x33,0x4c, + 0x35,0x36,0x2e,0x34,0x38,0x34,0x35,0x20,0x37,0x2e,0x36,0x33,0x30,0x36,0x35,0x5a, + 0x4d,0x37,0x30,0x2e,0x33,0x33,0x37,0x33,0x20,0x31,0x34,0x2e,0x37,0x35,0x33,0x37, + 0x4c,0x36,0x35,0x2e,0x36,0x32,0x38,0x33,0x20,0x31,0x38,0x2e,0x30,0x36,0x39,0x39, + 0x43,0x36,0x39,0x2e,0x38,0x35,0x36,0x35,0x20,0x32,0x30,0x2e,0x39,0x32,0x33,0x36, + 0x20,0x37,0x33,0x2e,0x31,0x39,0x34,0x20,0x32,0x33,0x2e,0x38,0x35,0x32,0x38,0x20, + 0x37,0x35,0x2e,0x32,0x32,0x33,0x39,0x20,0x32,0x35,0x2e,0x37,0x38,0x36,0x38,0x43, + 0x37,0x35,0x2e,0x39,0x35,0x30,0x31,0x20,0x32,0x36,0x2e,0x35,0x32,0x35,0x33,0x20, + 0x37,0x35,0x2e,0x39,0x35,0x30,0x31,0x20,0x32,0x37,0x2e,0x35,0x38,0x30,0x32,0x20, + 0x37,0x35,0x2e,0x32,0x32,0x33,0x39,0x20,0x32,0x38,0x2e,0x33,0x31,0x38,0x37,0x43, + 0x37,0x30,0x2e,0x30,0x31,0x39,0x37,0x20,0x33,0x33,0x2e,0x32,0x37,0x36,0x39,0x20, + 0x35,0x36,0x2e,0x33,0x34,0x33,0x34,0x20,0x34,0x34,0x2e,0x37,0x37,0x35,0x38,0x20, + 0x34,0x30,0x2e,0x38,0x35,0x31,0x36,0x20,0x34,0x34,0x2e,0x37,0x37,0x35,0x38,0x43, + 0x33,0x37,0x2e,0x31,0x34,0x35,0x32,0x20,0x34,0x34,0x2e,0x37,0x37,0x35,0x38,0x20, + 0x33,0x33,0x2e,0x35,0x34,0x32,0x37,0x20,0x34,0x34,0x2e,0x31,0x32,0x33,0x37,0x20, + 0x33,0x30,0x2e,0x31,0x33,0x35,0x33,0x20,0x34,0x33,0x2e,0x30,0x36,0x34,0x39,0x4c, + 0x32,0x35,0x2e,0x33,0x35,0x34,0x37,0x20,0x34,0x36,0x2e,0x34,0x33,0x31,0x36,0x43, + 0x33,0x30,0x2e,0x30,0x30,0x34,0x31,0x20,0x34,0x38,0x2e,0x30,0x30,0x37,0x31,0x20, + 0x33,0x35,0x2e,0x31,0x37,0x37,0x38,0x20,0x34,0x39,0x20,0x34,0x30,0x2e,0x38,0x35, + 0x31,0x36,0x20,0x34,0x39,0x43,0x35,0x38,0x2e,0x34,0x30,0x30,0x39,0x20,0x34,0x39, + 0x20,0x37,0x31,0x2e,0x32,0x38,0x37,0x35,0x20,0x33,0x39,0x2e,0x35,0x30,0x31,0x31, + 0x20,0x37,0x38,0x2e,0x35,0x34,0x39,0x32,0x20,0x33,0x32,0x2e,0x34,0x33,0x33,0x43, + 0x38,0x31,0x2e,0x38,0x31,0x37,0x20,0x32,0x39,0x2e,0x32,0x36,0x38,0x31,0x20,0x38, + 0x31,0x2e,0x38,0x31,0x37,0x20,0x32,0x34,0x2e,0x35,0x32,0x30,0x39,0x20,0x37,0x38, + 0x2e,0x35,0x34,0x39,0x32,0x20,0x32,0x31,0x2e,0x34,0x36,0x31,0x35,0x43,0x37,0x36, + 0x2e,0x33,0x32,0x38,0x37,0x20,0x31,0x39,0x2e,0x33,0x36,0x34,0x37,0x20,0x37,0x33, + 0x2e,0x35,0x38,0x32,0x32,0x20,0x31,0x37,0x2e,0x30,0x31,0x31,0x31,0x20,0x37,0x30, + 0x2e,0x33,0x33,0x37,0x33,0x20,0x31,0x34,0x2e,0x37,0x35,0x33,0x37,0x5a,0x22,0x20, + 0x66,0x69,0x6c,0x6c,0x3d,0x22,0x23,0x42,0x44,0x42,0x44,0x42,0x44,0x22,0x2f,0x3e, + 0xa,0x3c,0x70,0x61,0x74,0x68,0x20,0x66,0x69,0x6c,0x6c,0x2d,0x72,0x75,0x6c,0x65, + 0x3d,0x22,0x65,0x76,0x65,0x6e,0x6f,0x64,0x64,0x22,0x20,0x63,0x6c,0x69,0x70,0x2d, + 0x72,0x75,0x6c,0x65,0x3d,0x22,0x65,0x76,0x65,0x6e,0x6f,0x64,0x64,0x22,0x20,0x64, + 0x3d,0x22,0x4d,0x34,0x36,0x2e,0x31,0x34,0x37,0x33,0x20,0x31,0x34,0x2e,0x39,0x31, + 0x30,0x33,0x43,0x34,0x34,0x2e,0x35,0x34,0x37,0x39,0x20,0x31,0x34,0x2e,0x31,0x31, + 0x33,0x20,0x34,0x32,0x2e,0x37,0x35,0x37,0x20,0x31,0x33,0x2e,0x36,0x36,0x36,0x37, + 0x20,0x34,0x30,0x2e,0x38,0x36,0x36,0x33,0x20,0x31,0x33,0x2e,0x36,0x36,0x36,0x37, + 0x43,0x33,0x34,0x2e,0x30,0x39,0x31,0x36,0x20,0x31,0x33,0x2e,0x36,0x36,0x36,0x37, + 0x20,0x32,0x38,0x2e,0x35,0x39,0x39,0x36,0x20,0x31,0x39,0x2e,0x33,0x39,0x37,0x34, + 0x20,0x32,0x38,0x2e,0x35,0x39,0x39,0x36,0x20,0x32,0x36,0x2e,0x34,0x36,0x36,0x37, + 0x43,0x32,0x38,0x2e,0x35,0x39,0x39,0x36,0x20,0x32,0x36,0x2e,0x37,0x33,0x30,0x33, + 0x20,0x32,0x38,0x2e,0x36,0x30,0x37,0x33,0x20,0x32,0x36,0x2e,0x39,0x39,0x32,0x32, + 0x20,0x32,0x38,0x2e,0x36,0x32,0x32,0x33,0x20,0x32,0x37,0x2e,0x32,0x35,0x31,0x39, + 0x4c,0x34,0x36,0x2e,0x31,0x34,0x37,0x33,0x20,0x31,0x34,0x2e,0x39,0x31,0x30,0x33, + 0x5a,0x4d,0x33,0x36,0x2e,0x36,0x33,0x37,0x37,0x20,0x33,0x38,0x2e,0x34,0x38,0x35, + 0x38,0x43,0x33,0x37,0x2e,0x39,0x35,0x35,0x39,0x20,0x33,0x38,0x2e,0x39,0x39,0x30, + 0x39,0x20,0x33,0x39,0x2e,0x33,0x38,0x30,0x32,0x20,0x33,0x39,0x2e,0x32,0x36,0x36, + 0x37,0x20,0x34,0x30,0x2e,0x38,0x36,0x36,0x33,0x20,0x33,0x39,0x2e,0x32,0x36,0x36, + 0x37,0x43,0x34,0x37,0x2e,0x35,0x31,0x30,0x34,0x20,0x33,0x39,0x2e,0x32,0x36,0x36, + 0x37,0x20,0x35,0x32,0x2e,0x39,0x32,0x30,0x38,0x20,0x33,0x33,0x2e,0x37,0x35,0x34, + 0x36,0x20,0x35,0x33,0x2e,0x31,0x32,0x36,0x39,0x20,0x32,0x36,0x2e,0x38,0x37,0x33, + 0x37,0x4c,0x33,0x36,0x2e,0x36,0x33,0x37,0x37,0x20,0x33,0x38,0x2e,0x34,0x38,0x35, + 0x38,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x23,0x42,0x44,0x42,0x44,0x42, + 0x44,0x22,0x2f,0x3e,0xa,0x3c,0x6c,0x69,0x6e,0x65,0x20,0x78,0x31,0x3d,0x22,0x37, + 0x33,0x2e,0x32,0x37,0x34,0x35,0x22,0x20,0x79,0x31,0x3d,0x22,0x34,0x2e,0x31,0x38, + 0x30,0x31,0x35,0x22,0x20,0x78,0x32,0x3d,0x22,0x37,0x2e,0x31,0x38,0x30,0x31,0x35, + 0x22,0x20,0x79,0x32,0x3d,0x22,0x35,0x30,0x2e,0x37,0x32,0x35,0x35,0x22,0x20,0x73, + 0x74,0x72,0x6f,0x6b,0x65,0x3d,0x22,0x23,0x42,0x44,0x42,0x44,0x42,0x44,0x22,0x20, + 0x73,0x74,0x72,0x6f,0x6b,0x65,0x2d,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x36,0x22, + 0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x2d,0x6c,0x69,0x6e,0x65,0x63,0x61,0x70,0x3d, + 0x22,0x72,0x6f,0x75,0x6e,0x64,0x22,0x2f,0x3e,0xa,0x3c,0x2f,0x73,0x76,0x67,0x3e, + 0xa, + // /data/openpilot_release/selfdrive/assets/icons/close.svg + 0x0,0x0,0x1,0x7b, + 0x3c, + 0x3f,0x78,0x6d,0x6c,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x3d,0x22,0x31,0x2e, + 0x30,0x22,0x20,0x65,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x3d,0x22,0x55,0x54,0x46, + 0x2d,0x38,0x22,0x3f,0x3e,0xa,0x3c,0x73,0x76,0x67,0x20,0x69,0x64,0x3d,0x22,0x73, + 0x76,0x67,0x34,0x22,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x36,0x33,0x2e,0x32, + 0x33,0x38,0x22,0x20,0x68,0x65,0x69,0x67,0x68,0x74,0x3d,0x22,0x36,0x33,0x2e,0x32, + 0x33,0x38,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x6e,0x6f,0x6e,0x65,0x22,0x20, + 0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x3d,0x22,0x31,0x2e,0x31,0x22,0x20,0x76,0x69, + 0x65,0x77,0x42,0x6f,0x78,0x3d,0x22,0x30,0x20,0x30,0x20,0x36,0x33,0x2e,0x32,0x33, + 0x38,0x20,0x36,0x33,0x2e,0x32,0x33,0x38,0x22,0x20,0x78,0x6d,0x6c,0x6e,0x73,0x3d, + 0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,0x2e,0x6f, + 0x72,0x67,0x2f,0x32,0x30,0x30,0x30,0x2f,0x73,0x76,0x67,0x22,0x3e,0xa,0x20,0x3c, + 0x70,0x61,0x74,0x68,0x20,0x69,0x64,0x3d,0x22,0x70,0x61,0x74,0x68,0x32,0x22,0x20, + 0x64,0x3d,0x22,0x6d,0x20,0x35,0x35,0x2e,0x37,0x31,0x38,0x31,0x2c,0x36,0x33,0x2e, + 0x32,0x33,0x38,0x31,0x20,0x37,0x2e,0x35,0x32,0x2c,0x2d,0x37,0x2e,0x35,0x32,0x20, + 0x4c,0x20,0x33,0x39,0x2e,0x31,0x31,0x39,0x39,0x2c,0x33,0x31,0x2e,0x36,0x20,0x36, + 0x33,0x2e,0x32,0x31,0x39,0x2c,0x37,0x2e,0x35,0x30,0x30,0x39,0x20,0x35,0x35,0x2e, + 0x37,0x33,0x37,0x31,0x2c,0x30,0x2e,0x30,0x31,0x39,0x20,0x33,0x31,0x2e,0x36,0x33, + 0x38,0x31,0x2c,0x32,0x34,0x2e,0x31,0x31,0x38,0x31,0x20,0x37,0x2e,0x35,0x31,0x39, + 0x39,0x2c,0x30,0x20,0x30,0x2c,0x37,0x2e,0x35,0x32,0x20,0x32,0x34,0x2e,0x31,0x31, + 0x38,0x31,0x2c,0x33,0x31,0x2e,0x36,0x33,0x38,0x31,0x20,0x30,0x2e,0x30,0x31,0x39, + 0x2c,0x35,0x35,0x2e,0x37,0x33,0x37,0x32,0x20,0x37,0x2e,0x35,0x30,0x30,0x39,0x2c, + 0x36,0x33,0x2e,0x32,0x31,0x39,0x20,0x33,0x31,0x2e,0x36,0x2c,0x33,0x39,0x2e,0x31, + 0x32,0x20,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x23,0x30,0x30,0x30,0x22, + 0x2f,0x3e,0xa,0x3c,0x2f,0x73,0x76,0x67,0x3e,0xa, + // /data/openpilot_release/selfdrive/assets/offroad/icon_lock_closed.svg + 0x0,0x0,0x2,0xdc, + 0x3c, + 0x3f,0x78,0x6d,0x6c,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x3d,0x22,0x31,0x2e, + 0x30,0x22,0x20,0x65,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x3d,0x22,0x75,0x74,0x66, + 0x2d,0x38,0x22,0x3f,0x3e,0xa,0x3c,0x73,0x76,0x67,0x20,0x76,0x69,0x65,0x77,0x42, + 0x6f,0x78,0x3d,0x22,0x32,0x31,0x31,0x20,0x31,0x38,0x32,0x20,0x34,0x30,0x20,0x34, + 0x39,0x22,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x34,0x30,0x22,0x20,0x68,0x65, + 0x69,0x67,0x68,0x74,0x3d,0x22,0x34,0x39,0x22,0x20,0x78,0x6d,0x6c,0x6e,0x73,0x3d, + 0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,0x2e,0x6f, + 0x72,0x67,0x2f,0x32,0x30,0x30,0x30,0x2f,0x73,0x76,0x67,0x22,0x3e,0xa,0x20,0x20, + 0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x20,0x32,0x34,0x36,0x2e,0x32, + 0x32,0x35,0x20,0x32,0x30,0x31,0x2e,0x37,0x33,0x20,0x4c,0x20,0x32,0x34,0x35,0x2e, + 0x36,0x32,0x32,0x20,0x32,0x30,0x31,0x2e,0x37,0x31,0x39,0x20,0x4c,0x20,0x32,0x34, + 0x35,0x2e,0x36,0x31,0x36,0x20,0x31,0x39,0x35,0x2e,0x30,0x39,0x31,0x20,0x43,0x20, + 0x32,0x34,0x35,0x2e,0x36,0x31,0x20,0x31,0x38,0x37,0x2e,0x38,0x37,0x20,0x32,0x33, + 0x38,0x2e,0x39,0x36,0x36,0x20,0x31,0x38,0x31,0x2e,0x39,0x39,0x35,0x20,0x32,0x33, + 0x30,0x2e,0x37,0x39,0x39,0x20,0x31,0x38,0x32,0x20,0x43,0x20,0x32,0x32,0x32,0x2e, + 0x36,0x33,0x32,0x20,0x31,0x38,0x32,0x2e,0x30,0x30,0x36,0x20,0x32,0x31,0x35,0x2e, + 0x39,0x38,0x38,0x20,0x31,0x38,0x37,0x2e,0x38,0x38,0x20,0x32,0x31,0x35,0x2e,0x39, + 0x39,0x34,0x20,0x31,0x39,0x35,0x2e,0x31,0x30,0x31,0x20,0x4c,0x20,0x32,0x31,0x36, + 0x2e,0x30,0x30,0x36,0x20,0x32,0x30,0x31,0x2e,0x37,0x33,0x20,0x4c,0x20,0x32,0x31, + 0x35,0x2e,0x34,0x37,0x20,0x32,0x30,0x31,0x2e,0x37,0x33,0x20,0x43,0x20,0x32,0x31, + 0x32,0x2e,0x36,0x36,0x32,0x20,0x32,0x30,0x31,0x2e,0x37,0x33,0x35,0x20,0x32,0x31, + 0x30,0x2e,0x39,0x39,0x34,0x20,0x32,0x30,0x33,0x2e,0x37,0x34,0x39,0x20,0x32,0x31, + 0x31,0x20,0x32,0x30,0x36,0x2e,0x32,0x33,0x31,0x20,0x4c,0x20,0x32,0x31,0x31,0x20, + 0x32,0x32,0x36,0x2e,0x35,0x30,0x34,0x20,0x43,0x20,0x32,0x31,0x31,0x20,0x32,0x32, + 0x38,0x2e,0x39,0x38,0x37,0x20,0x32,0x31,0x32,0x2e,0x36,0x37,0x35,0x20,0x32,0x33, + 0x31,0x20,0x32,0x31,0x35,0x2e,0x34,0x38,0x32,0x20,0x32,0x33,0x31,0x20,0x4c,0x20, + 0x32,0x34,0x37,0x2e,0x31,0x33,0x39,0x20,0x32,0x33,0x30,0x2e,0x39,0x38,0x35,0x20, + 0x43,0x20,0x32,0x34,0x39,0x2e,0x39,0x34,0x36,0x20,0x32,0x33,0x30,0x2e,0x39,0x38, + 0x35,0x20,0x32,0x35,0x31,0x2e,0x30,0x30,0x36,0x20,0x32,0x32,0x38,0x2e,0x39,0x37, + 0x20,0x32,0x35,0x31,0x20,0x32,0x32,0x36,0x2e,0x34,0x38,0x38,0x20,0x4c,0x20,0x32, + 0x35,0x31,0x20,0x32,0x30,0x36,0x2e,0x32,0x30,0x39,0x20,0x43,0x20,0x32,0x35,0x31, + 0x20,0x32,0x30,0x33,0x2e,0x32,0x36,0x39,0x20,0x32,0x34,0x39,0x2e,0x33,0x36,0x38, + 0x20,0x32,0x30,0x31,0x2e,0x37,0x31,0x39,0x20,0x32,0x34,0x36,0x2e,0x32,0x32,0x35, + 0x20,0x32,0x30,0x31,0x2e,0x37,0x33,0x20,0x5a,0x20,0x4d,0x20,0x32,0x32,0x31,0x2e, + 0x34,0x36,0x33,0x20,0x32,0x30,0x31,0x2e,0x37,0x33,0x20,0x4c,0x20,0x32,0x32,0x31, + 0x2e,0x34,0x35,0x20,0x31,0x39,0x35,0x2e,0x31,0x30,0x31,0x20,0x43,0x20,0x32,0x32, + 0x31,0x2e,0x34,0x35,0x20,0x31,0x39,0x30,0x2e,0x35,0x34,0x31,0x20,0x32,0x32,0x35, + 0x2e,0x36,0x34,0x20,0x31,0x38,0x36,0x2e,0x38,0x33,0x20,0x32,0x33,0x30,0x2e,0x37, + 0x39,0x39,0x20,0x31,0x38,0x36,0x2e,0x38,0x32,0x35,0x20,0x43,0x20,0x32,0x33,0x35, + 0x2e,0x39,0x35,0x37,0x20,0x31,0x38,0x36,0x2e,0x38,0x32,0x35,0x20,0x32,0x34,0x30, + 0x2e,0x31,0x35,0x33,0x20,0x31,0x39,0x30,0x2e,0x35,0x33,0x35,0x20,0x32,0x34,0x30, + 0x2e,0x31,0x35,0x33,0x20,0x31,0x39,0x35,0x2e,0x30,0x39,0x31,0x20,0x4c,0x20,0x32, + 0x34,0x30,0x2e,0x31,0x36,0x35,0x20,0x32,0x30,0x31,0x2e,0x37,0x31,0x39,0x20,0x4c, + 0x20,0x32,0x32,0x31,0x2e,0x34,0x36,0x33,0x20,0x32,0x30,0x31,0x2e,0x37,0x33,0x20, + 0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x23,0x36,0x39,0x36,0x39,0x36,0x39, + 0x22,0x2f,0x3e,0xa,0x3c,0x2f,0x73,0x76,0x67,0x3e,0xa, + // /data/openpilot_release/selfdrive/assets/offroad/icon_wifi_strength_high.svg + 0x0,0x0,0x6,0x79, + 0x3c, + 0x73,0x76,0x67,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x36,0x38,0x22,0x20,0x68, + 0x65,0x69,0x67,0x68,0x74,0x3d,0x22,0x36,0x38,0x22,0x20,0x76,0x69,0x65,0x77,0x42, + 0x6f,0x78,0x3d,0x22,0x30,0x20,0x30,0x20,0x36,0x38,0x20,0x36,0x38,0x22,0x20,0x66, + 0x69,0x6c,0x6c,0x3d,0x22,0x6e,0x6f,0x6e,0x65,0x22,0x20,0x78,0x6d,0x6c,0x6e,0x73, + 0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,0x2e, + 0x6f,0x72,0x67,0x2f,0x32,0x30,0x30,0x30,0x2f,0x73,0x76,0x67,0x22,0x3e,0xa,0x3c, + 0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x33,0x34,0x2e,0x30,0x30,0x30,0x34, + 0x20,0x38,0x2e,0x36,0x33,0x35,0x39,0x39,0x43,0x32,0x31,0x2e,0x38,0x32,0x38,0x34, + 0x20,0x38,0x2e,0x36,0x33,0x35,0x39,0x39,0x20,0x31,0x30,0x2e,0x37,0x34,0x34,0x34, + 0x20,0x31,0x33,0x2e,0x32,0x36,0x20,0x32,0x2e,0x33,0x31,0x32,0x34,0x33,0x20,0x32, + 0x30,0x2e,0x38,0x30,0x38,0x43,0x31,0x2e,0x35,0x36,0x34,0x34,0x33,0x20,0x32,0x31, + 0x2e,0x34,0x38,0x38,0x20,0x31,0x2e,0x34,0x39,0x36,0x34,0x20,0x32,0x32,0x2e,0x36, + 0x34,0x34,0x20,0x32,0x2e,0x31,0x30,0x38,0x34,0x20,0x32,0x33,0x2e,0x33,0x39,0x32, + 0x4c,0x34,0x2e,0x37,0x36,0x30,0x34,0x31,0x20,0x32,0x36,0x2e,0x34,0x35,0x32,0x43, + 0x35,0x2e,0x34,0x34,0x30,0x34,0x31,0x20,0x32,0x37,0x2e,0x32,0x20,0x36,0x2e,0x35, + 0x39,0x36,0x34,0x31,0x20,0x32,0x37,0x2e,0x32,0x36,0x38,0x20,0x37,0x2e,0x33,0x34, + 0x34,0x34,0x31,0x20,0x32,0x36,0x2e,0x35,0x38,0x38,0x43,0x31,0x34,0x2e,0x34,0x31, + 0x36,0x34,0x20,0x32,0x30,0x2e,0x31,0x39,0x36,0x20,0x32,0x33,0x2e,0x37,0x33,0x32, + 0x34,0x20,0x31,0x36,0x2e,0x33,0x32,0x20,0x33,0x33,0x2e,0x39,0x33,0x32,0x34,0x20, + 0x31,0x36,0x2e,0x33,0x32,0x43,0x34,0x34,0x2e,0x31,0x33,0x32,0x34,0x20,0x31,0x36, + 0x2e,0x33,0x32,0x20,0x35,0x33,0x2e,0x34,0x34,0x38,0x34,0x20,0x32,0x30,0x2e,0x31, + 0x39,0x36,0x20,0x36,0x30,0x2e,0x35,0x32,0x30,0x34,0x20,0x32,0x36,0x2e,0x35,0x38, + 0x38,0x43,0x36,0x31,0x2e,0x32,0x36,0x38,0x34,0x20,0x32,0x37,0x2e,0x32,0x36,0x38, + 0x20,0x36,0x32,0x2e,0x34,0x32,0x34,0x34,0x20,0x32,0x37,0x2e,0x32,0x20,0x36,0x33, + 0x2e,0x31,0x30,0x34,0x34,0x20,0x32,0x36,0x2e,0x34,0x35,0x32,0x4c,0x36,0x35,0x2e, + 0x37,0x35,0x36,0x34,0x20,0x32,0x33,0x2e,0x33,0x39,0x32,0x43,0x36,0x36,0x2e,0x34, + 0x33,0x36,0x34,0x20,0x32,0x32,0x2e,0x36,0x34,0x34,0x20,0x36,0x36,0x2e,0x33,0x30, + 0x30,0x34,0x20,0x32,0x31,0x2e,0x34,0x38,0x38,0x20,0x36,0x35,0x2e,0x35,0x35,0x32, + 0x34,0x20,0x32,0x30,0x2e,0x38,0x30,0x38,0x43,0x35,0x37,0x2e,0x32,0x35,0x36,0x34, + 0x20,0x31,0x33,0x2e,0x32,0x36,0x20,0x34,0x36,0x2e,0x31,0x37,0x32,0x34,0x20,0x38, + 0x2e,0x36,0x33,0x35,0x39,0x39,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x34,0x20,0x38, + 0x2e,0x36,0x33,0x35,0x39,0x39,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x23, + 0x33,0x44,0x33,0x44,0x33,0x44,0x22,0x2f,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20, + 0x64,0x3d,0x22,0x4d,0x33,0x34,0x2e,0x30,0x30,0x30,0x34,0x20,0x32,0x32,0x2e,0x30, + 0x33,0x32,0x43,0x32,0x35,0x2e,0x31,0x36,0x30,0x34,0x20,0x32,0x32,0x2e,0x30,0x33, + 0x32,0x20,0x31,0x37,0x2e,0x30,0x36,0x38,0x34,0x20,0x32,0x35,0x2e,0x34,0x33,0x32, + 0x20,0x31,0x31,0x2e,0x30,0x31,0x36,0x34,0x20,0x33,0x30,0x2e,0x39,0x34,0x43,0x31, + 0x30,0x2e,0x32,0x36,0x38,0x34,0x20,0x33,0x31,0x2e,0x36,0x32,0x20,0x31,0x30,0x2e, + 0x32,0x30,0x30,0x34,0x20,0x33,0x32,0x2e,0x37,0x30,0x38,0x20,0x31,0x30,0x2e,0x38, + 0x38,0x30,0x34,0x20,0x33,0x33,0x2e,0x34,0x35,0x36,0x4c,0x31,0x33,0x2e,0x33,0x39, + 0x36,0x34,0x20,0x33,0x36,0x2e,0x33,0x38,0x43,0x31,0x34,0x2e,0x30,0x37,0x36,0x34, + 0x20,0x33,0x37,0x2e,0x31,0x39,0x36,0x20,0x31,0x35,0x2e,0x32,0x33,0x32,0x34,0x20, + 0x33,0x37,0x2e,0x31,0x39,0x36,0x20,0x31,0x36,0x2e,0x30,0x34,0x38,0x34,0x20,0x33, + 0x36,0x2e,0x35,0x31,0x36,0x43,0x32,0x30,0x2e,0x38,0x30,0x38,0x34,0x20,0x33,0x32, + 0x2e,0x31,0x36,0x34,0x20,0x32,0x37,0x2e,0x31,0x33,0x32,0x34,0x20,0x32,0x39,0x2e, + 0x35,0x31,0x32,0x20,0x33,0x34,0x2e,0x30,0x36,0x38,0x34,0x20,0x32,0x39,0x2e,0x35, + 0x31,0x32,0x43,0x34,0x31,0x2e,0x30,0x30,0x34,0x34,0x20,0x32,0x39,0x2e,0x35,0x31, + 0x32,0x20,0x34,0x37,0x2e,0x33,0x32,0x38,0x34,0x20,0x33,0x32,0x2e,0x31,0x36,0x34, + 0x20,0x35,0x32,0x2e,0x30,0x38,0x38,0x34,0x20,0x33,0x36,0x2e,0x35,0x31,0x36,0x43, + 0x35,0x32,0x2e,0x38,0x33,0x36,0x34,0x20,0x33,0x37,0x2e,0x31,0x39,0x36,0x20,0x35, + 0x34,0x2e,0x30,0x36,0x30,0x34,0x20,0x33,0x37,0x2e,0x31,0x39,0x36,0x20,0x35,0x34, + 0x2e,0x37,0x34,0x30,0x34,0x20,0x33,0x36,0x2e,0x33,0x38,0x4c,0x35,0x37,0x2e,0x32, + 0x35,0x36,0x34,0x20,0x33,0x33,0x2e,0x34,0x35,0x36,0x43,0x35,0x37,0x2e,0x38,0x36, + 0x38,0x34,0x20,0x33,0x32,0x2e,0x37,0x30,0x38,0x20,0x35,0x37,0x2e,0x38,0x36,0x38, + 0x34,0x20,0x33,0x31,0x2e,0x35,0x35,0x32,0x20,0x35,0x37,0x2e,0x31,0x32,0x30,0x34, + 0x20,0x33,0x30,0x2e,0x39,0x34,0x43,0x35,0x30,0x2e,0x39,0x33,0x32,0x34,0x20,0x32, + 0x35,0x2e,0x33,0x36,0x34,0x20,0x34,0x32,0x2e,0x38,0x34,0x30,0x34,0x20,0x32,0x32, + 0x2e,0x30,0x33,0x32,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x34,0x20,0x32,0x32,0x2e, + 0x30,0x33,0x32,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x77,0x68,0x69,0x74, + 0x65,0x22,0x2f,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x33, + 0x34,0x2e,0x30,0x30,0x30,0x37,0x20,0x33,0x35,0x2e,0x33,0x36,0x43,0x32,0x38,0x2e, + 0x34,0x32,0x34,0x37,0x20,0x33,0x35,0x2e,0x33,0x36,0x20,0x32,0x33,0x2e,0x33,0x39, + 0x32,0x37,0x20,0x33,0x37,0x2e,0x35,0x33,0x36,0x20,0x31,0x39,0x2e,0x36,0x35,0x32, + 0x37,0x20,0x34,0x31,0x2e,0x31,0x34,0x43,0x31,0x38,0x2e,0x39,0x37,0x32,0x37,0x20, + 0x34,0x31,0x2e,0x38,0x32,0x20,0x31,0x38,0x2e,0x39,0x30,0x34,0x37,0x20,0x34,0x32, + 0x2e,0x39,0x30,0x38,0x20,0x31,0x39,0x2e,0x35,0x38,0x34,0x37,0x20,0x34,0x33,0x2e, + 0x36,0x35,0x36,0x4c,0x32,0x31,0x2e,0x39,0x36,0x34,0x37,0x20,0x34,0x36,0x2e,0x34, + 0x34,0x34,0x43,0x32,0x32,0x2e,0x36,0x34,0x34,0x37,0x20,0x34,0x37,0x2e,0x32,0x36, + 0x20,0x32,0x33,0x2e,0x38,0x36,0x38,0x37,0x20,0x34,0x37,0x2e,0x32,0x36,0x20,0x32, + 0x34,0x2e,0x36,0x31,0x36,0x37,0x20,0x34,0x36,0x2e,0x35,0x38,0x43,0x32,0x37,0x2e, + 0x30,0x36,0x34,0x37,0x20,0x34,0x34,0x2e,0x32,0x20,0x33,0x30,0x2e,0x33,0x32,0x38, + 0x37,0x20,0x34,0x32,0x2e,0x37,0x37,0x32,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x37, + 0x20,0x34,0x32,0x2e,0x37,0x37,0x32,0x43,0x33,0x37,0x2e,0x36,0x37,0x32,0x37,0x20, + 0x34,0x32,0x2e,0x37,0x37,0x32,0x20,0x34,0x30,0x2e,0x39,0x33,0x36,0x37,0x20,0x34, + 0x34,0x2e,0x32,0x20,0x34,0x33,0x2e,0x33,0x38,0x34,0x37,0x20,0x34,0x36,0x2e,0x35, + 0x38,0x43,0x34,0x34,0x2e,0x31,0x33,0x32,0x37,0x20,0x34,0x37,0x2e,0x33,0x32,0x38, + 0x20,0x34,0x35,0x2e,0x33,0x35,0x36,0x37,0x20,0x34,0x37,0x2e,0x32,0x36,0x20,0x34, + 0x36,0x2e,0x30,0x33,0x36,0x37,0x20,0x34,0x36,0x2e,0x34,0x34,0x34,0x4c,0x34,0x38, + 0x2e,0x34,0x31,0x36,0x37,0x20,0x34,0x33,0x2e,0x36,0x35,0x36,0x43,0x34,0x39,0x2e, + 0x30,0x32,0x38,0x37,0x20,0x34,0x32,0x2e,0x39,0x30,0x38,0x20,0x34,0x39,0x2e,0x30, + 0x32,0x38,0x37,0x20,0x34,0x31,0x2e,0x38,0x32,0x20,0x34,0x38,0x2e,0x33,0x34,0x38, + 0x37,0x20,0x34,0x31,0x2e,0x31,0x34,0x43,0x34,0x34,0x2e,0x36,0x30,0x38,0x37,0x20, + 0x33,0x37,0x2e,0x35,0x33,0x36,0x20,0x33,0x39,0x2e,0x35,0x37,0x36,0x37,0x20,0x33, + 0x35,0x2e,0x33,0x36,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x37,0x20,0x33,0x35,0x2e, + 0x33,0x36,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x77,0x68,0x69,0x74,0x65, + 0x22,0x2f,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x33,0x34, + 0x2e,0x30,0x30,0x30,0x35,0x20,0x34,0x38,0x2e,0x36,0x38,0x38,0x43,0x33,0x31,0x2e, + 0x37,0x35,0x36,0x35,0x20,0x34,0x38,0x2e,0x36,0x38,0x38,0x20,0x32,0x39,0x2e,0x37, + 0x31,0x36,0x35,0x20,0x34,0x39,0x2e,0x37,0x30,0x38,0x20,0x32,0x38,0x2e,0x33,0x35, + 0x36,0x35,0x20,0x35,0x31,0x2e,0x33,0x34,0x43,0x32,0x37,0x2e,0x37,0x34,0x34,0x35, + 0x20,0x35,0x32,0x2e,0x30,0x32,0x20,0x32,0x37,0x2e,0x37,0x34,0x34,0x35,0x20,0x35, + 0x33,0x2e,0x30,0x34,0x20,0x32,0x38,0x2e,0x33,0x35,0x36,0x35,0x20,0x35,0x33,0x2e, + 0x37,0x32,0x4c,0x33,0x32,0x2e,0x36,0x34,0x30,0x35,0x20,0x35,0x38,0x2e,0x36,0x38, + 0x34,0x43,0x33,0x33,0x2e,0x33,0x38,0x38,0x35,0x20,0x35,0x39,0x2e,0x35,0x20,0x33, + 0x34,0x2e,0x36,0x38,0x30,0x34,0x20,0x35,0x39,0x2e,0x35,0x20,0x33,0x35,0x2e,0x34, + 0x32,0x38,0x34,0x20,0x35,0x38,0x2e,0x36,0x38,0x34,0x4c,0x33,0x39,0x2e,0x37,0x31, + 0x32,0x35,0x20,0x35,0x33,0x2e,0x37,0x32,0x43,0x34,0x30,0x2e,0x33,0x32,0x34,0x35, + 0x20,0x35,0x33,0x2e,0x30,0x34,0x20,0x34,0x30,0x2e,0x33,0x32,0x34,0x35,0x20,0x35, + 0x32,0x2e,0x30,0x32,0x20,0x33,0x39,0x2e,0x37,0x31,0x32,0x35,0x20,0x35,0x31,0x2e, + 0x33,0x34,0x43,0x33,0x38,0x2e,0x32,0x38,0x34,0x35,0x20,0x34,0x39,0x2e,0x37,0x30, + 0x38,0x20,0x33,0x36,0x2e,0x32,0x34,0x34,0x35,0x20,0x34,0x38,0x2e,0x36,0x38,0x38, + 0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x35,0x20,0x34,0x38,0x2e,0x36,0x38,0x38,0x5a, + 0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x77,0x68,0x69,0x74,0x65,0x22,0x2f,0x3e, + 0xa,0x3c,0x2f,0x73,0x76,0x67,0x3e,0xa, + // /data/openpilot_release/selfdrive/assets/offroad/icon_wifi_strength_full.svg + 0x0,0x0,0x6,0x77, + 0x3c, + 0x73,0x76,0x67,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x36,0x38,0x22,0x20,0x68, + 0x65,0x69,0x67,0x68,0x74,0x3d,0x22,0x36,0x38,0x22,0x20,0x76,0x69,0x65,0x77,0x42, + 0x6f,0x78,0x3d,0x22,0x30,0x20,0x30,0x20,0x36,0x38,0x20,0x36,0x38,0x22,0x20,0x66, + 0x69,0x6c,0x6c,0x3d,0x22,0x6e,0x6f,0x6e,0x65,0x22,0x20,0x78,0x6d,0x6c,0x6e,0x73, + 0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,0x2e, + 0x6f,0x72,0x67,0x2f,0x32,0x30,0x30,0x30,0x2f,0x73,0x76,0x67,0x22,0x3e,0xa,0x3c, + 0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x33,0x34,0x2e,0x30,0x30,0x30,0x34, + 0x20,0x38,0x2e,0x36,0x33,0x35,0x39,0x39,0x43,0x32,0x31,0x2e,0x38,0x32,0x38,0x34, + 0x20,0x38,0x2e,0x36,0x33,0x35,0x39,0x39,0x20,0x31,0x30,0x2e,0x37,0x34,0x34,0x34, + 0x20,0x31,0x33,0x2e,0x32,0x36,0x20,0x32,0x2e,0x33,0x31,0x32,0x34,0x33,0x20,0x32, + 0x30,0x2e,0x38,0x30,0x38,0x43,0x31,0x2e,0x35,0x36,0x34,0x34,0x33,0x20,0x32,0x31, + 0x2e,0x34,0x38,0x38,0x20,0x31,0x2e,0x34,0x39,0x36,0x34,0x20,0x32,0x32,0x2e,0x36, + 0x34,0x34,0x20,0x32,0x2e,0x31,0x30,0x38,0x34,0x20,0x32,0x33,0x2e,0x33,0x39,0x32, + 0x4c,0x34,0x2e,0x37,0x36,0x30,0x34,0x31,0x20,0x32,0x36,0x2e,0x34,0x35,0x32,0x43, + 0x35,0x2e,0x34,0x34,0x30,0x34,0x31,0x20,0x32,0x37,0x2e,0x32,0x20,0x36,0x2e,0x35, + 0x39,0x36,0x34,0x31,0x20,0x32,0x37,0x2e,0x32,0x36,0x38,0x20,0x37,0x2e,0x33,0x34, + 0x34,0x34,0x31,0x20,0x32,0x36,0x2e,0x35,0x38,0x38,0x43,0x31,0x34,0x2e,0x34,0x31, + 0x36,0x34,0x20,0x32,0x30,0x2e,0x31,0x39,0x36,0x20,0x32,0x33,0x2e,0x37,0x33,0x32, + 0x34,0x20,0x31,0x36,0x2e,0x33,0x32,0x20,0x33,0x33,0x2e,0x39,0x33,0x32,0x34,0x20, + 0x31,0x36,0x2e,0x33,0x32,0x43,0x34,0x34,0x2e,0x31,0x33,0x32,0x34,0x20,0x31,0x36, + 0x2e,0x33,0x32,0x20,0x35,0x33,0x2e,0x34,0x34,0x38,0x34,0x20,0x32,0x30,0x2e,0x31, + 0x39,0x36,0x20,0x36,0x30,0x2e,0x35,0x32,0x30,0x34,0x20,0x32,0x36,0x2e,0x35,0x38, + 0x38,0x43,0x36,0x31,0x2e,0x32,0x36,0x38,0x34,0x20,0x32,0x37,0x2e,0x32,0x36,0x38, + 0x20,0x36,0x32,0x2e,0x34,0x32,0x34,0x34,0x20,0x32,0x37,0x2e,0x32,0x20,0x36,0x33, + 0x2e,0x31,0x30,0x34,0x34,0x20,0x32,0x36,0x2e,0x34,0x35,0x32,0x4c,0x36,0x35,0x2e, + 0x37,0x35,0x36,0x34,0x20,0x32,0x33,0x2e,0x33,0x39,0x32,0x43,0x36,0x36,0x2e,0x34, + 0x33,0x36,0x34,0x20,0x32,0x32,0x2e,0x36,0x34,0x34,0x20,0x36,0x36,0x2e,0x33,0x30, + 0x30,0x34,0x20,0x32,0x31,0x2e,0x34,0x38,0x38,0x20,0x36,0x35,0x2e,0x35,0x35,0x32, + 0x34,0x20,0x32,0x30,0x2e,0x38,0x30,0x38,0x43,0x35,0x37,0x2e,0x32,0x35,0x36,0x34, + 0x20,0x31,0x33,0x2e,0x32,0x36,0x20,0x34,0x36,0x2e,0x31,0x37,0x32,0x34,0x20,0x38, + 0x2e,0x36,0x33,0x35,0x39,0x39,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x34,0x20,0x38, + 0x2e,0x36,0x33,0x35,0x39,0x39,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x77, + 0x68,0x69,0x74,0x65,0x22,0x2f,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d, + 0x22,0x4d,0x33,0x34,0x2e,0x30,0x30,0x30,0x34,0x20,0x32,0x32,0x2e,0x30,0x33,0x32, + 0x43,0x32,0x35,0x2e,0x31,0x36,0x30,0x34,0x20,0x32,0x32,0x2e,0x30,0x33,0x32,0x20, + 0x31,0x37,0x2e,0x30,0x36,0x38,0x34,0x20,0x32,0x35,0x2e,0x34,0x33,0x32,0x20,0x31, + 0x31,0x2e,0x30,0x31,0x36,0x34,0x20,0x33,0x30,0x2e,0x39,0x34,0x43,0x31,0x30,0x2e, + 0x32,0x36,0x38,0x34,0x20,0x33,0x31,0x2e,0x36,0x32,0x20,0x31,0x30,0x2e,0x32,0x30, + 0x30,0x34,0x20,0x33,0x32,0x2e,0x37,0x30,0x38,0x20,0x31,0x30,0x2e,0x38,0x38,0x30, + 0x34,0x20,0x33,0x33,0x2e,0x34,0x35,0x36,0x4c,0x31,0x33,0x2e,0x33,0x39,0x36,0x34, + 0x20,0x33,0x36,0x2e,0x33,0x38,0x43,0x31,0x34,0x2e,0x30,0x37,0x36,0x34,0x20,0x33, + 0x37,0x2e,0x31,0x39,0x36,0x20,0x31,0x35,0x2e,0x32,0x33,0x32,0x34,0x20,0x33,0x37, + 0x2e,0x31,0x39,0x36,0x20,0x31,0x36,0x2e,0x30,0x34,0x38,0x34,0x20,0x33,0x36,0x2e, + 0x35,0x31,0x36,0x43,0x32,0x30,0x2e,0x38,0x30,0x38,0x34,0x20,0x33,0x32,0x2e,0x31, + 0x36,0x34,0x20,0x32,0x37,0x2e,0x31,0x33,0x32,0x34,0x20,0x32,0x39,0x2e,0x35,0x31, + 0x32,0x20,0x33,0x34,0x2e,0x30,0x36,0x38,0x34,0x20,0x32,0x39,0x2e,0x35,0x31,0x32, + 0x43,0x34,0x31,0x2e,0x30,0x30,0x34,0x34,0x20,0x32,0x39,0x2e,0x35,0x31,0x32,0x20, + 0x34,0x37,0x2e,0x33,0x32,0x38,0x34,0x20,0x33,0x32,0x2e,0x31,0x36,0x34,0x20,0x35, + 0x32,0x2e,0x30,0x38,0x38,0x34,0x20,0x33,0x36,0x2e,0x35,0x31,0x36,0x43,0x35,0x32, + 0x2e,0x38,0x33,0x36,0x34,0x20,0x33,0x37,0x2e,0x31,0x39,0x36,0x20,0x35,0x34,0x2e, + 0x30,0x36,0x30,0x34,0x20,0x33,0x37,0x2e,0x31,0x39,0x36,0x20,0x35,0x34,0x2e,0x37, + 0x34,0x30,0x34,0x20,0x33,0x36,0x2e,0x33,0x38,0x4c,0x35,0x37,0x2e,0x32,0x35,0x36, + 0x34,0x20,0x33,0x33,0x2e,0x34,0x35,0x36,0x43,0x35,0x37,0x2e,0x38,0x36,0x38,0x34, + 0x20,0x33,0x32,0x2e,0x37,0x30,0x38,0x20,0x35,0x37,0x2e,0x38,0x36,0x38,0x34,0x20, + 0x33,0x31,0x2e,0x35,0x35,0x32,0x20,0x35,0x37,0x2e,0x31,0x32,0x30,0x34,0x20,0x33, + 0x30,0x2e,0x39,0x34,0x43,0x35,0x30,0x2e,0x39,0x33,0x32,0x34,0x20,0x32,0x35,0x2e, + 0x33,0x36,0x34,0x20,0x34,0x32,0x2e,0x38,0x34,0x30,0x34,0x20,0x32,0x32,0x2e,0x30, + 0x33,0x32,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x34,0x20,0x32,0x32,0x2e,0x30,0x33, + 0x32,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x77,0x68,0x69,0x74,0x65,0x22, + 0x2f,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x33,0x34,0x2e, + 0x30,0x30,0x30,0x37,0x20,0x33,0x35,0x2e,0x33,0x36,0x43,0x32,0x38,0x2e,0x34,0x32, + 0x34,0x37,0x20,0x33,0x35,0x2e,0x33,0x36,0x20,0x32,0x33,0x2e,0x33,0x39,0x32,0x37, + 0x20,0x33,0x37,0x2e,0x35,0x33,0x36,0x20,0x31,0x39,0x2e,0x36,0x35,0x32,0x37,0x20, + 0x34,0x31,0x2e,0x31,0x34,0x43,0x31,0x38,0x2e,0x39,0x37,0x32,0x37,0x20,0x34,0x31, + 0x2e,0x38,0x32,0x20,0x31,0x38,0x2e,0x39,0x30,0x34,0x37,0x20,0x34,0x32,0x2e,0x39, + 0x30,0x38,0x20,0x31,0x39,0x2e,0x35,0x38,0x34,0x37,0x20,0x34,0x33,0x2e,0x36,0x35, + 0x36,0x4c,0x32,0x31,0x2e,0x39,0x36,0x34,0x37,0x20,0x34,0x36,0x2e,0x34,0x34,0x34, + 0x43,0x32,0x32,0x2e,0x36,0x34,0x34,0x37,0x20,0x34,0x37,0x2e,0x32,0x36,0x20,0x32, + 0x33,0x2e,0x38,0x36,0x38,0x37,0x20,0x34,0x37,0x2e,0x32,0x36,0x20,0x32,0x34,0x2e, + 0x36,0x31,0x36,0x37,0x20,0x34,0x36,0x2e,0x35,0x38,0x43,0x32,0x37,0x2e,0x30,0x36, + 0x34,0x37,0x20,0x34,0x34,0x2e,0x32,0x20,0x33,0x30,0x2e,0x33,0x32,0x38,0x37,0x20, + 0x34,0x32,0x2e,0x37,0x37,0x32,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x37,0x20,0x34, + 0x32,0x2e,0x37,0x37,0x32,0x43,0x33,0x37,0x2e,0x36,0x37,0x32,0x37,0x20,0x34,0x32, + 0x2e,0x37,0x37,0x32,0x20,0x34,0x30,0x2e,0x39,0x33,0x36,0x37,0x20,0x34,0x34,0x2e, + 0x32,0x20,0x34,0x33,0x2e,0x33,0x38,0x34,0x37,0x20,0x34,0x36,0x2e,0x35,0x38,0x43, + 0x34,0x34,0x2e,0x31,0x33,0x32,0x37,0x20,0x34,0x37,0x2e,0x33,0x32,0x38,0x20,0x34, + 0x35,0x2e,0x33,0x35,0x36,0x37,0x20,0x34,0x37,0x2e,0x32,0x36,0x20,0x34,0x36,0x2e, + 0x30,0x33,0x36,0x37,0x20,0x34,0x36,0x2e,0x34,0x34,0x34,0x4c,0x34,0x38,0x2e,0x34, + 0x31,0x36,0x37,0x20,0x34,0x33,0x2e,0x36,0x35,0x36,0x43,0x34,0x39,0x2e,0x30,0x32, + 0x38,0x37,0x20,0x34,0x32,0x2e,0x39,0x30,0x38,0x20,0x34,0x39,0x2e,0x30,0x32,0x38, + 0x37,0x20,0x34,0x31,0x2e,0x38,0x32,0x20,0x34,0x38,0x2e,0x33,0x34,0x38,0x37,0x20, + 0x34,0x31,0x2e,0x31,0x34,0x43,0x34,0x34,0x2e,0x36,0x30,0x38,0x37,0x20,0x33,0x37, + 0x2e,0x35,0x33,0x36,0x20,0x33,0x39,0x2e,0x35,0x37,0x36,0x37,0x20,0x33,0x35,0x2e, + 0x33,0x36,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x37,0x20,0x33,0x35,0x2e,0x33,0x36, + 0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x77,0x68,0x69,0x74,0x65,0x22,0x2f, + 0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x33,0x34,0x2e,0x30, + 0x30,0x30,0x35,0x20,0x34,0x38,0x2e,0x36,0x38,0x38,0x43,0x33,0x31,0x2e,0x37,0x35, + 0x36,0x35,0x20,0x34,0x38,0x2e,0x36,0x38,0x38,0x20,0x32,0x39,0x2e,0x37,0x31,0x36, + 0x35,0x20,0x34,0x39,0x2e,0x37,0x30,0x38,0x20,0x32,0x38,0x2e,0x33,0x35,0x36,0x35, + 0x20,0x35,0x31,0x2e,0x33,0x34,0x43,0x32,0x37,0x2e,0x37,0x34,0x34,0x35,0x20,0x35, + 0x32,0x2e,0x30,0x32,0x20,0x32,0x37,0x2e,0x37,0x34,0x34,0x35,0x20,0x35,0x33,0x2e, + 0x30,0x34,0x20,0x32,0x38,0x2e,0x33,0x35,0x36,0x35,0x20,0x35,0x33,0x2e,0x37,0x32, + 0x4c,0x33,0x32,0x2e,0x36,0x34,0x30,0x35,0x20,0x35,0x38,0x2e,0x36,0x38,0x34,0x43, + 0x33,0x33,0x2e,0x33,0x38,0x38,0x35,0x20,0x35,0x39,0x2e,0x35,0x20,0x33,0x34,0x2e, + 0x36,0x38,0x30,0x34,0x20,0x35,0x39,0x2e,0x35,0x20,0x33,0x35,0x2e,0x34,0x32,0x38, + 0x34,0x20,0x35,0x38,0x2e,0x36,0x38,0x34,0x4c,0x33,0x39,0x2e,0x37,0x31,0x32,0x35, + 0x20,0x35,0x33,0x2e,0x37,0x32,0x43,0x34,0x30,0x2e,0x33,0x32,0x34,0x35,0x20,0x35, + 0x33,0x2e,0x30,0x34,0x20,0x34,0x30,0x2e,0x33,0x32,0x34,0x35,0x20,0x35,0x32,0x2e, + 0x30,0x32,0x20,0x33,0x39,0x2e,0x37,0x31,0x32,0x35,0x20,0x35,0x31,0x2e,0x33,0x34, + 0x43,0x33,0x38,0x2e,0x32,0x38,0x34,0x35,0x20,0x34,0x39,0x2e,0x37,0x30,0x38,0x20, + 0x33,0x36,0x2e,0x32,0x34,0x34,0x35,0x20,0x34,0x38,0x2e,0x36,0x38,0x38,0x20,0x33, + 0x34,0x2e,0x30,0x30,0x30,0x35,0x20,0x34,0x38,0x2e,0x36,0x38,0x38,0x5a,0x22,0x20, + 0x66,0x69,0x6c,0x6c,0x3d,0x22,0x77,0x68,0x69,0x74,0x65,0x22,0x2f,0x3e,0xa,0x3c, + 0x2f,0x73,0x76,0x67,0x3e,0xa, + // /data/openpilot_release/selfdrive/assets/offroad/icon_warning.png + 0x0,0x0,0x1f,0x42, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0xb8,0x0,0x0,0x0,0xa8,0x8,0x6,0x0,0x0,0x1,0x24,0xe2,0x14,0xca, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, + 0x0,0x0,0x1e,0xf9,0x49,0x44,0x41,0x54,0x78,0x1,0xed,0x5d,0x9,0xb8,0x25,0x45, + 0x75,0x6,0x66,0xd8,0xd7,0x19,0xd9,0x17,0x87,0x61,0xb,0x3b,0x48,0x18,0x89,0x12, + 0x65,0xf9,0x48,0x4,0x4,0x23,0x2,0x1,0x83,0x2c,0x41,0x51,0x51,0x41,0x1,0x11, + 0x34,0x86,0x10,0x5,0x9,0x9b,0x68,0xc,0xa,0x62,0x90,0x4d,0x20,0x9,0x28,0x22, + 0x4,0x94,0x2d,0xac,0x82,0x82,0xb2,0x23,0x44,0x98,0x37,0xec,0x30,0x80,0xec,0x3b, + 0x33,0xfe,0xa7,0x5f,0xd7,0x7d,0xd5,0xd5,0xa7,0xaa,0x4e,0x57,0x57,0x6f,0xf7,0x76, + 0x7d,0x5f,0xbd,0xae,0x3a,0x75,0xce,0x7f,0xfe,0x73,0xba,0x5e,0xdf,0xbe,0xdd,0xd5, + 0x7d,0xe7,0x99,0xa7,0xc2,0x32,0xaf,0x4,0x7b,0xee,0xdc,0xb9,0xb,0x42,0xef,0x75, + 0x5d,0x77,0x5e,0x14,0xbd,0x1f,0xdc,0x6,0x38,0x95,0xc7,0x14,0xc0,0x78,0x77,0xee, + 0x5c,0xd5,0xf,0xde,0xa6,0x40,0xbf,0x30,0x1,0x52,0xf9,0x43,0xa6,0xbc,0x50,0x9f, + 0x40,0x6c,0x6,0xae,0x31,0x9b,0xcd,0x40,0xee,0x33,0xc6,0xf8,0x63,0x3e,0x9d,0x1, + 0x98,0xde,0x80,0xd1,0xfa,0x12,0x43,0x89,0x8e,0x8e,0x9b,0xb4,0x39,0x23,0x92,0x51, + 0xd1,0x95,0xd1,0x5d,0xd0,0x94,0xa9,0xf1,0xf9,0x54,0x43,0xdf,0xda,0x94,0x75,0x1d, + 0xd5,0xc6,0x8c,0x7c,0x83,0xda,0xb0,0x99,0xaa,0x64,0x6a,0x3b,0x59,0x35,0xcc,0x6d, + 0x91,0x79,0x4c,0xba,0x29,0xa1,0xcc,0xdc,0xcf,0x31,0x4f,0x95,0x9e,0x30,0x9d,0x49, + 0xfa,0xde,0x88,0x5d,0xa,0x34,0x46,0xc5,0xe6,0xc8,0x1c,0xcb,0x30,0x4f,0x7,0x17, + 0xb6,0x19,0x4b,0xe4,0xba,0x83,0x1,0x38,0x84,0x47,0x92,0x31,0xd2,0x97,0x39,0x86, + 0x48,0x0,0x95,0x8e,0x75,0x3f,0xe9,0x1e,0x95,0xb2,0xb9,0x25,0x1d,0x94,0x97,0x4c, + 0xb9,0xde,0xc7,0xf8,0x56,0xa4,0x44,0xb2,0x64,0xef,0xe,0x3a,0x70,0xad,0x2b,0x86, + 0xb6,0x53,0xbc,0xdd,0x12,0x7b,0x5,0xee,0x3,0x23,0x3d,0x2a,0x2,0xbd,0x6f,0x26, + 0x7a,0xf8,0xb3,0xb1,0xc4,0x80,0x0,0x49,0x8f,0x8a,0x0,0x7c,0x53,0xd2,0xab,0x32, + 0x2d,0xf3,0xc,0x66,0x4b,0xca,0x6c,0x43,0x1f,0x2b,0xdf,0x38,0x8,0x27,0x87,0x3, + 0xd2,0x1b,0xec,0x40,0xa,0xc3,0x67,0x58,0x64,0xdc,0x3a,0x2d,0x8b,0x80,0xb8,0x74, + 0x7,0xcc,0x5d,0x4a,0x5c,0x54,0x51,0x98,0x11,0x30,0x15,0xdd,0xf9,0xb8,0x64,0xee, + 0xf6,0xba,0x2c,0xa8,0x6d,0x2,0x2b,0x10,0x9b,0x5c,0x8d,0xd3,0x36,0x33,0x5b,0xf4, + 0x1,0x6a,0xa7,0x0,0xab,0x98,0x72,0xd5,0x97,0x38,0x50,0xba,0xb9,0xad,0xcf,0xd8, + 0x37,0x9e,0x3,0x54,0x2,0x89,0x21,0x74,0xf6,0x97,0xe8,0x29,0xcc,0x64,0xb,0x83, + 0x9b,0x4c,0x23,0xea,0xab,0xa2,0x2b,0x93,0x4c,0xef,0x7b,0xdb,0x9c,0x81,0x2,0xb6, + 0x8d,0x71,0xa0,0xb9,0x1d,0xca,0x19,0x73,0x86,0xa6,0xc,0x76,0x3f,0x36,0x65,0xb9, + 0xbe,0xd,0x9c,0xe4,0x69,0x79,0x21,0x67,0x4,0x1,0x8d,0x99,0xf2,0xc,0xf3,0x54, + 0xe1,0x0,0x53,0xc9,0xe8,0x7f,0xcb,0xe8,0xf,0xba,0x9c,0x83,0x64,0x10,0x3,0xb, + 0x58,0x7,0xa1,0x41,0x63,0x69,0xb1,0x1e,0x32,0x68,0x7c,0xe0,0x9,0xd,0x9d,0xf9, + 0x1b,0x9e,0xe3,0xc5,0xf5,0x64,0x8,0x9d,0xc,0x80,0xe,0x86,0x76,0x6e,0x96,0x11, + 0xab,0x37,0x4c,0xaf,0x86,0x51,0xd2,0xd,0xd2,0x91,0x18,0x71,0xce,0x6c,0x32,0x85, + 0x37,0x59,0x35,0x6c,0x8a,0x4a,0xae,0xeb,0x79,0xd2,0x97,0x98,0x40,0xff,0xf2,0xc1, + 0x8e,0x52,0x20,0xb6,0x2d,0x81,0xa7,0x85,0x9d,0x8a,0xba,0x9d,0x52,0xb4,0x9e,0xe5, + 0xea,0xca,0xd4,0x96,0xb0,0x35,0x6d,0x68,0xb6,0x3c,0x42,0x42,0xf2,0x66,0xe,0x86, + 0xf4,0x15,0xe,0x91,0x99,0x8c,0xfa,0x6e,0x25,0x50,0xdb,0x10,0x50,0xc3,0xe6,0x1, + 0xa3,0x1f,0xa7,0x4b,0x4,0x2d,0xe5,0xac,0x38,0x1e,0xc6,0x51,0xac,0xff,0xc9,0x45, + 0x9d,0x10,0x59,0xa9,0x4d,0xc8,0xdc,0x90,0x62,0x8b,0xf5,0xc0,0x77,0xaa,0x96,0xe1, + 0xa5,0x5d,0x86,0xd0,0x7b,0x5d,0xe9,0xba,0xf4,0x2a,0x1f,0x3,0x89,0xd3,0x43,0x88, + 0x84,0xd8,0x98,0xc1,0x4,0x4f,0x15,0x72,0xae,0xc0,0x42,0x76,0xbd,0x66,0x3f,0x9, + 0xf6,0x73,0x14,0x96,0x74,0xab,0x7f,0x8,0x49,0x6d,0x32,0x87,0xa0,0x10,0xd2,0xe4, + 0x48,0xb3,0x7b,0x7,0x41,0x1c,0x2a,0x76,0x1e,0xaa,0x48,0x99,0x4a,0xcb,0xd,0x2e, + 0xc,0xa5,0x44,0x5b,0xa1,0xde,0x2b,0x2e,0xbd,0x52,0x63,0x1a,0x99,0x2d,0x5d,0x40, + 0x9a,0xde,0xa0,0x29,0xd5,0x77,0xe9,0xe9,0x63,0xe2,0x39,0x4e,0xc,0xc8,0x50,0xdb, + 0xc5,0x3a,0x4e,0xa6,0xad,0x74,0x75,0xa1,0xcf,0xe,0x36,0xf4,0xd5,0x72,0x1,0xb2, + 0xf1,0xe9,0x92,0x8e,0x77,0x8e,0x3,0x70,0x57,0x45,0x44,0x2,0x48,0xa0,0x21,0x5, + 0xd8,0x74,0x25,0xf7,0x14,0xb2,0x55,0xfe,0x42,0x70,0x12,0x1b,0x0,0x3c,0x4e,0x20, + 0x54,0x8a,0x80,0x8c,0x5b,0x64,0xfe,0x5e,0x22,0xb5,0x87,0xd5,0x2a,0xca,0x52,0x6a, + 0x93,0xd1,0x53,0xc6,0xb4,0xcd,0xc,0x8,0x3a,0xba,0x6d,0xda,0xde,0x5c,0x60,0x96, + 0x51,0xd1,0x30,0xe4,0x57,0x38,0x34,0xa3,0xc2,0xa4,0xc9,0x3b,0xec,0x93,0xd3,0x70, + 0x85,0x93,0x61,0x54,0xa0,0xa3,0xec,0xb1,0xbd,0xd9,0x6b,0xa6,0x29,0xbf,0xe9,0x55, + 0xb6,0x28,0x0,0xe3,0x60,0xd,0x27,0x28,0x78,0x5,0x2d,0xc2,0xd1,0x94,0x4e,0x53, + 0x86,0x6d,0xd8,0x6a,0xbc,0xb2,0x49,0xc0,0xc0,0xa,0xda,0xe0,0x5e,0x65,0xc9,0x2, + 0x4b,0x3f,0xf1,0xca,0x3a,0xb,0x4,0xd7,0xf8,0x25,0x78,0xc9,0x71,0x9c,0x84,0xa, + 0x2f,0xc6,0x21,0x4f,0xc7,0x8b,0x85,0xb,0x4c,0xba,0x1a,0xfe,0xaa,0xc2,0x9b,0xf, + 0x82,0x6d,0x55,0x27,0xd6,0xd6,0x8,0xfe,0x15,0xa3,0x1f,0xea,0x26,0x73,0x4a,0x90, + 0xcb,0x78,0x8a,0xba,0x3c,0x9c,0x3d,0x15,0xea,0x21,0xb6,0x1d,0xb7,0x7,0x7,0x3e, + 0x68,0xd0,0x52,0xbe,0x32,0x50,0xaa,0xb1,0x1,0x2e,0x77,0x58,0xf8,0xdc,0x49,0x34, + 0x72,0xe7,0x2a,0x50,0xde,0x12,0xf2,0x6b,0x68,0xb0,0x4d,0x25,0xd2,0x74,0x6b,0x53, + 0x48,0x11,0xb8,0x60,0x6f,0xed,0x62,0xd9,0xbd,0x83,0xa3,0x56,0x4,0x37,0x71,0x21, + 0x6c,0x84,0xd,0xf9,0x4e,0xb1,0xbc,0xe6,0xe6,0x78,0x8,0x30,0xc8,0xd1,0xe9,0xc1, + 0xfc,0x42,0xdb,0xf9,0x30,0x5f,0x4b,0xef,0x1,0xef,0xf9,0xb8,0x90,0x8c,0x4e,0x7a, + 0x11,0xfa,0x47,0xd2,0xb,0x30,0xce,0xd0,0x70,0xa,0x7f,0x31,0xd6,0x6c,0xe3,0x35, + 0xf5,0xa9,0xe0,0x43,0xd5,0x74,0x4f,0xf5,0xe9,0x56,0x3a,0xe,0x22,0x7f,0xa7,0xc8, + 0x48,0x1c,0x41,0x77,0x7a,0x11,0x7d,0x9,0x66,0x90,0x8e,0x22,0x81,0xed,0xc7,0xa4, + 0x0,0x9a,0x4d,0x33,0x53,0x6,0x4,0x66,0x29,0x12,0x52,0xd2,0x4a,0x2f,0xd4,0x4e, + 0xd9,0xd3,0x36,0xf8,0xa8,0x42,0xce,0x53,0xa0,0xc2,0x47,0x9,0x98,0x52,0xb6,0x13, + 0xdf,0xf4,0x4f,0x9c,0xe2,0x14,0xda,0x4,0x1d,0x55,0x34,0xd2,0x74,0x29,0x41,0x5, + 0x20,0x76,0xc,0x9b,0x81,0x5f,0x60,0xad,0x2d,0x36,0x2c,0xa3,0x8,0x47,0xc9,0x4d, + 0x12,0x9d,0x7c,0x8,0x1e,0xec,0xff,0x87,0x30,0xa8,0x84,0xd8,0x17,0xb6,0x19,0x77, + 0x95,0xfc,0xf5,0xde,0x54,0xf1,0x81,0x6b,0x58,0xd7,0xfa,0x74,0x4b,0x8d,0xc3,0xd1, + 0xd7,0x94,0x33,0x17,0x90,0xd2,0x49,0xb7,0x3f,0xb2,0xe9,0x62,0x7c,0x3d,0xa5,0x6b, + 0xd3,0x89,0x22,0x57,0x4e,0xb0,0x3d,0xd2,0x6,0x88,0xb1,0x3,0x35,0xbd,0xa4,0x69, + 0xd3,0x25,0xb9,0xae,0xeb,0xd2,0xb,0x1e,0x83,0x83,0xd7,0x94,0x13,0x17,0x88,0xd2, + 0x31,0xb6,0x6b,0x4a,0x6c,0x5c,0x3a,0xe6,0x98,0xf8,0x50,0x44,0x44,0x52,0xe3,0x29, + 0x38,0x2a,0x3c,0x6f,0x2,0xa9,0x3e,0xd4,0xde,0x46,0x7b,0x92,0xea,0xa7,0x5b,0xe7, + 0xc5,0x7b,0xd,0x5b,0x74,0xc1,0x93,0x30,0x7,0x87,0x25,0xc3,0x51,0xa6,0x6b,0x0, + 0x5b,0x49,0xa7,0x46,0xd7,0x65,0x8c,0xd1,0x41,0xa0,0xce,0x4f,0x49,0x8c,0xf,0x12, + 0x8,0x5f,0x1f,0x35,0xed,0xb9,0xbe,0x97,0x38,0x80,0x6,0x37,0xa4,0x74,0x7,0x1c, + 0x58,0x2a,0x4b,0x6e,0x9f,0x3b,0xc6,0x6d,0x43,0xf7,0xa5,0x3,0x3f,0xb3,0x29,0x14, + 0x92,0x53,0xb6,0xd3,0xe2,0xcc,0x9a,0x2,0x85,0xee,0x76,0xca,0x40,0x6d,0xd5,0x98, + 0x6f,0xab,0xf4,0xb1,0x4d,0xee,0x1a,0xfb,0xf4,0xad,0xe3,0x0,0x38,0x47,0x81,0x59, + 0x95,0x8c,0x1,0xe8,0x4f,0x51,0x36,0x6a,0x6b,0xa8,0x58,0xbb,0xd0,0x4f,0xae,0xc5, + 0x93,0x9d,0x55,0x49,0x32,0xa0,0x1c,0x63,0x5b,0x68,0xf7,0x69,0x76,0x49,0x53,0xe2, + 0x4b,0xe9,0xe8,0xb6,0x4a,0xc6,0x6d,0x7,0xff,0x14,0xe6,0x20,0x1,0x28,0x99,0x70, + 0x6e,0x2b,0xf5,0xdc,0x1d,0x85,0x22,0xf6,0x70,0x4b,0xff,0x77,0xef,0xa4,0x60,0xf3, + 0xc3,0x96,0x8e,0x52,0xb9,0xe2,0xfd,0xe7,0x84,0xc5,0x46,0x39,0xab,0xa,0x5,0x20, + 0xaa,0xff,0x2f,0xbd,0x55,0xc8,0x95,0x74,0x77,0xd9,0x40,0x75,0x7b,0x6a,0xdb,0xf4, + 0x5c,0x72,0xd,0xe3,0x9f,0x5c,0x7a,0x83,0x31,0x18,0x6c,0xa2,0x8c,0x6,0xc2,0x82, + 0xd,0x65,0xaf,0xb6,0x5,0xcd,0x13,0x75,0xd8,0xbe,0xe8,0xb2,0xcf,0xcd,0x71,0x52, + 0x56,0x8e,0x8a,0xcc,0x4d,0x65,0x43,0x5b,0x1d,0x83,0xfa,0x11,0x70,0x5e,0x7,0x46, + 0x66,0xd1,0x75,0x66,0x8e,0xc3,0xe1,0x6d,0xe4,0x88,0x4a,0xa8,0xb3,0x71,0xeb,0x68, + 0x7f,0x8f,0x4a,0x91,0x16,0x72,0x22,0x52,0xa6,0xd2,0xf2,0x7,0xa7,0xa2,0x67,0x10, + 0x18,0x3b,0x29,0x20,0x8f,0xaa,0x77,0x58,0xe1,0xd0,0x96,0x55,0xf6,0x2a,0xb0,0x56, + 0xd5,0xb,0xc1,0x4b,0xff,0x40,0x5b,0x36,0xe7,0x51,0x23,0xbe,0x7b,0x6e,0xb0,0x61, + 0x81,0xc6,0x2d,0x9b,0x75,0xeb,0x40,0x20,0x61,0x1d,0xf,0xed,0x5f,0x5,0xc2,0x64, + 0xcc,0x34,0xcc,0x73,0x93,0x1,0x8,0x56,0xd2,0x84,0xd9,0x88,0x32,0xa6,0xb2,0xe, + 0xb0,0x8e,0xd5,0xf1,0xa8,0x2d,0xb3,0x74,0x6b,0xe9,0x98,0x89,0xa6,0x2e,0x40,0xfb, + 0x32,0xb7,0xb9,0x7f,0xd4,0xc0,0x4b,0xba,0x7e,0x2b,0xbf,0x86,0x81,0xbb,0x46,0xe6, + 0x3b,0x1f,0x6,0x1f,0xf6,0x43,0xb8,0x35,0x80,0xb1,0xaa,0xe1,0x24,0x7a,0xc6,0x81, + 0xff,0x90,0x49,0x3c,0x96,0x13,0x7d,0xba,0x64,0x3e,0x2b,0xdc,0x61,0xdb,0x47,0x8d, + 0x64,0xbc,0x52,0x9,0x71,0xbb,0xfb,0xb0,0x11,0x90,0xbe,0xd6,0x20,0x7e,0x8,0x11, + 0xbf,0xd0,0x10,0x46,0xc9,0x7a,0x18,0x45,0xde,0x8a,0xe3,0x97,0x9c,0xab,0xd0,0x80, + 0x69,0xd2,0x86,0x8f,0x7c,0xd0,0x22,0x7e,0xfa,0x69,0x6e,0x42,0x93,0xb8,0xa9,0xf9, + 0xb7,0x9d,0x49,0x3c,0x8d,0x92,0x56,0x66,0x2e,0x6e,0x8e,0x55,0xdd,0x87,0x4f,0xb5, + 0x9c,0x8a,0x25,0x4d,0xfe,0x7,0x67,0x87,0x50,0xde,0xf,0xfd,0x1f,0x56,0x4d,0xaa, + 0xc,0xbe,0x3e,0xb,0x54,0xc6,0xe9,0x6c,0xf0,0xb4,0x74,0x80,0xfd,0xaa,0x54,0xc6, + 0x61,0x4,0xdb,0x63,0x75,0xd2,0x11,0xf0,0xea,0x81,0xc0,0x6c,0x58,0xd,0xf5,0x16, + 0x54,0x5b,0xa1,0x2f,0x1d,0xbb,0xd4,0xc3,0xa6,0x9c,0x97,0xc1,0x14,0x2f,0x7,0x13, + 0xdf,0x1a,0x9,0xa4,0x2b,0x7d,0x4b,0x96,0x40,0x9e,0x8e,0xd9,0x35,0x56,0xc2,0xbe, + 0x12,0xd3,0xd6,0x25,0x9c,0xa6,0x70,0xe4,0x48,0x67,0x20,0xf1,0xb7,0x46,0xc6,0xc, + 0x86,0x1b,0x1c,0xb,0x83,0x11,0x22,0x19,0x22,0xcf,0x87,0xb,0x92,0xfd,0x5d,0xb8, + 0xa3,0x65,0x9f,0x74,0x7f,0x92,0x26,0xcb,0xf2,0xa8,0x87,0xa0,0xba,0xae,0x7b,0xff, + 0x16,0xb8,0xce,0x27,0x97,0x61,0x3f,0x5a,0x5,0x9,0xb9,0x8b,0x92,0xcd,0x94,0x6d, + 0x8a,0x66,0x2,0x18,0xc9,0x73,0x75,0xc,0x56,0xec,0xff,0x9c,0xa2,0xd4,0xda,0xa1, + 0x8f,0xc4,0xbc,0xc5,0x24,0x67,0xdd,0x18,0xec,0x18,0xdc,0xd1,0x4e,0x7a,0x1d,0x9, + 0x81,0x8f,0x7b,0x18,0x3f,0x2b,0xc4,0xd8,0xa1,0x9d,0xc2,0x60,0x92,0x90,0xfb,0xb6, + 0x10,0x2b,0x20,0xf8,0xfa,0xf,0xc6,0xdf,0xde,0xb1,0xf0,0x5b,0x8d,0x83,0xc0,0x57, + 0x66,0x82,0x7f,0xac,0x6a,0xd2,0xf0,0x39,0xb8,0x72,0xac,0xf9,0x2f,0x74,0x33,0xae, + 0x6a,0x8e,0xd1,0xf1,0x11,0xe8,0xa7,0xb4,0x60,0x55,0xf3,0x82,0xe8,0x8e,0x2c,0x80, + 0x70,0x98,0xb9,0x3c,0x9a,0x12,0x98,0x6d,0x51,0xef,0xb6,0x18,0xc1,0x5d,0xa2,0x32, + 0xac,0x6d,0xf7,0xaf,0x3b,0x2a,0xf8,0x9e,0x57,0xf3,0x3f,0x68,0xd6,0xcd,0xa3,0x52, + 0x7f,0x88,0xea,0xd9,0x41,0x64,0x13,0x8d,0xf5,0x2b,0x75,0xea,0x1,0x9f,0xa0,0x31, + 0xd1,0xf2,0x98,0x74,0x63,0x78,0x22,0x9c,0x4c,0x8b,0x9e,0x1e,0xc,0x2a,0x40,0x39, + 0x4,0xf5,0xd5,0x14,0xed,0x2a,0x6c,0x83,0x2f,0xb,0xa6,0x18,0xe6,0x26,0x73,0xf, + 0x35,0x88,0x64,0x53,0x46,0x66,0x24,0xd4,0xf,0xe5,0xc2,0x61,0x19,0xb2,0x4f,0x84, + 0x60,0x3,0xe3,0x5,0x3,0x87,0xba,0x9b,0x87,0x60,0x35,0x66,0x3,0xc2,0x8b,0x30, + 0x41,0x94,0x49,0xf6,0xe0,0xd5,0x3,0x1c,0xae,0x92,0x85,0x6,0xc,0xfb,0xeb,0x14, + 0x86,0xb6,0x3d,0x2e,0x14,0xaf,0x56,0x3b,0x10,0xfe,0xa0,0x46,0x5a,0x35,0x7,0x2f, + 0xe5,0xa,0x21,0xa3,0x40,0x4,0x5b,0xeb,0xeb,0x9f,0x7c,0x7e,0x81,0x7d,0x24,0x83, + 0x7f,0xb7,0xcf,0xae,0xd1,0x71,0x10,0x3e,0x89,0x21,0xad,0xd6,0xf,0x6,0x73,0x3, + 0xe6,0x83,0xc,0x6e,0x4e,0x14,0xec,0x20,0x35,0x4,0xe0,0x16,0x39,0x50,0x5c,0x7a, + 0x28,0x8b,0x5b,0x89,0x3d,0x88,0xde,0xc7,0x90,0x4d,0x1e,0xab,0x2f,0xeb,0x10,0xb8, + 0x83,0x97,0x88,0x30,0x3e,0x6,0xa2,0xb2,0x7e,0xc8,0x1e,0x60,0x4b,0xd,0x0,0xb5, + 0x46,0xc,0xec,0x68,0x18,0xe0,0x45,0xef,0xe7,0x30,0xcb,0xae,0xb1,0x1c,0x0,0x78, + 0x3f,0x13,0x9c,0xeb,0xc7,0xf2,0x47,0x38,0x55,0xe3,0x7,0x73,0xe5,0x88,0x41,0x16, + 0x7c,0x2c,0xe5,0x88,0x0,0x6f,0x3,0x8b,0x9f,0x8c,0x98,0xb3,0x2d,0x23,0xcb,0x80, + 0x4f,0x74,0xde,0x5d,0x6,0x33,0xd8,0x16,0xfe,0xd9,0x6f,0x6c,0x90,0x57,0x72,0x53, + 0x63,0x22,0x5e,0x6b,0xeb,0xae,0xe0,0x60,0x1c,0x86,0xf0,0x36,0x87,0xf1,0xf8,0x69, + 0x87,0x89,0x73,0x28,0x28,0x39,0x20,0xb0,0x1a,0x50,0x73,0x57,0xf7,0xe8,0x2e,0xc, + 0x4a,0x4e,0xee,0x64,0x10,0x6f,0x30,0xf4,0xa1,0x0,0x27,0x3,0xc4,0x43,0x39,0x32, + 0xdf,0x3d,0x7c,0x2a,0x72,0x70,0xa9,0xd3,0x30,0xd6,0x20,0x1c,0x7d,0x9e,0xd9,0xe3, + 0xc1,0xe7,0xd8,0x52,0x5e,0x9c,0x4f,0x43,0xf6,0x71,0x29,0x56,0x88,0x1e,0x7c,0xfd, + 0xd4,0xf0,0x47,0xdd,0x3f,0x85,0x60,0x89,0x6d,0xe0,0xe0,0x97,0x8c,0xd3,0x17,0xc5, + 0x0,0x25,0x14,0x19,0xbf,0xa6,0x68,0xe5,0x12,0xf0,0x22,0x53,0x38,0xfc,0x82,0xe9, + 0x94,0xfa,0x22,0xe3,0xa2,0x4a,0xc0,0xe5,0xbe,0x2,0xdf,0x54,0x14,0x27,0x54,0x9f, + 0xb,0x54,0x97,0x85,0xe2,0x16,0xb5,0x83,0x4f,0xf6,0x3,0xbc,0x28,0x8e,0x53,0x5f, + 0xf,0x4c,0x6b,0xab,0xb5,0xe7,0x4e,0xdb,0x58,0x83,0xf0,0xeb,0xfc,0xf2,0x13,0xcb, + 0x8f,0x4,0x7,0x5c,0x92,0x57,0xe7,0x6b,0xb9,0x50,0xcd,0x45,0x25,0xf6,0x4e,0x1d, + 0x85,0x64,0x6c,0xb7,0x76,0x1a,0x55,0x30,0x8,0xff,0xe7,0x1a,0x1c,0x32,0xdd,0xa, + 0x5c,0x7a,0x21,0x33,0x4,0x26,0x3a,0x5b,0x79,0xd,0x39,0x5,0xd8,0x2f,0x31,0x81, + 0x91,0x69,0x4d,0xe1,0xf4,0xeb,0x90,0x65,0x58,0x64,0x3b,0xe7,0xd7,0xe1,0x9f,0xf3, + 0x91,0xa5,0x31,0xe8,0x7d,0x87,0xd3,0xb5,0xca,0x60,0xf6,0xb7,0x3,0x53,0xad,0x61, + 0x35,0xa8,0x79,0x0,0x94,0xe,0x42,0x3d,0x11,0x75,0x9d,0x9a,0x5d,0xb3,0xee,0xc0, + 0xe3,0x4d,0x54,0xb3,0x3c,0xc0,0x2a,0x9b,0x42,0x58,0x9d,0x6c,0x5a,0x52,0xdf,0xd4, + 0xeb,0xfb,0xd9,0xc,0x20,0x45,0x7f,0x60,0xf2,0xa6,0x1e,0x84,0xcc,0x2a,0xab,0x1e, + 0xc,0xd8,0xf,0x26,0x35,0xde,0x86,0x2d,0x38,0xea,0xf,0x2a,0xdc,0x8f,0x7e,0x33, + 0x5f,0xb5,0x99,0x64,0x80,0xcb,0xe0,0xc5,0x13,0x68,0xf,0xa,0xa3,0x9a,0x5c,0xac, + 0xe1,0x2e,0x40,0xb5,0x66,0x66,0xf,0xd8,0xdb,0x1b,0x5f,0x66,0x3,0xab,0x59,0x8, + 0x7a,0xdc,0xe1,0x25,0x9b,0x47,0x28,0x71,0x97,0x56,0x29,0xb4,0x52,0x4f,0x11,0xc6, + 0x8a,0x95,0x88,0x48,0x4a,0x2c,0x7f,0x65,0x70,0xc0,0x73,0x1d,0x1b,0x57,0xc2,0x55, + 0xd7,0x52,0x6c,0x2f,0x8d,0x79,0xa8,0x8c,0xf3,0x88,0xb6,0xb2,0xf,0xa0,0x88,0xe, + 0x4b,0x40,0xcd,0xb4,0xd9,0x62,0x47,0x1c,0x4f,0xd7,0x7d,0x3f,0x64,0xdb,0x23,0x24, + 0xb7,0x19,0xd7,0x2d,0x7,0x15,0xf3,0xd9,0x2a,0x93,0xb6,0x9a,0x3c,0x75,0x53,0xcb, + 0xf8,0x3,0xa9,0xef,0x9b,0xc4,0xb4,0xfe,0xab,0x94,0x70,0x6e,0x35,0x92,0xa6,0x33, + 0xb7,0x91,0xd7,0x47,0x66,0xa2,0x30,0x3a,0x20,0xb7,0x18,0xaa,0xf3,0x4d,0x32,0x86, + 0x49,0x6d,0x5d,0x3d,0x71,0x4c,0xfb,0x96,0x84,0x8,0x33,0x60,0x8a,0xbe,0x5d,0x1b, + 0xe3,0x8e,0x3a,0x42,0xc2,0x68,0x12,0xf8,0xca,0xf8,0x9a,0x17,0x68,0x59,0x17,0xb1, + 0x1b,0x8,0xdd,0x5d,0x24,0x53,0xe1,0x8e,0x44,0x8e,0x9e,0x31,0xf2,0xc4,0x75,0x4f, + 0xc8,0x51,0xe0,0xb4,0x2c,0xb2,0x4a,0xee,0xae,0xe4,0x8,0xb5,0x58,0x80,0xbc,0x1c, + 0x6d,0xc9,0xd,0x27,0x1e,0xbc,0xaa,0x29,0xf7,0x50,0x15,0xb4,0x69,0x1,0xcc,0xa1, + 0x2d,0x8e,0xb5,0x4b,0xd4,0x5e,0xc0,0x1d,0xa3,0xa5,0x74,0xc2,0xb9,0x84,0xab,0x41, + 0x24,0x7e,0x31,0xb4,0xfb,0x87,0x91,0x54,0x42,0x8a,0x6d,0x77,0x41,0xa2,0x2f,0xe4, + 0x4c,0xac,0x9,0xe7,0x94,0xb1,0x13,0xde,0x3,0xf9,0x5e,0xa8,0xab,0xa3,0xae,0xc8, + 0xe9,0x8c,0x90,0x8c,0x5e,0xe3,0xf8,0x20,0xea,0x65,0x48,0xee,0x70,0x2f,0xec,0x1f, + 0xa1,0x9d,0xda,0x4c,0xa8,0xf8,0xcf,0x3a,0x14,0x95,0xbd,0xd6,0x3,0x39,0x95,0xf3, + 0x50,0x17,0x69,0x86,0xdd,0x10,0x79,0x45,0x12,0xef,0xa4,0x6c,0x16,0x28,0xf4,0x8, + 0xe2,0xf4,0x21,0x4a,0x41,0x3d,0xa1,0x20,0x69,0x7b,0x16,0x48,0x32,0xa7,0x5a,0xdb, + 0xcd,0xed,0x7a,0x32,0x52,0xa1,0x17,0x64,0xcf,0x79,0xef,0x92,0xcb,0xae,0x45,0x36, + 0xf8,0xc1,0x91,0xa,0xe9,0x76,0x1b,0x1a,0x89,0xe3,0x96,0x3b,0x5b,0xf2,0x29,0x12, + 0xbf,0xdc,0xed,0x8c,0x54,0xc8,0x1e,0xe9,0x63,0xd7,0x7b,0x88,0xd2,0xea,0x56,0xba, + 0xa6,0x42,0xda,0xdd,0x85,0x76,0xe7,0x2c,0x19,0xa5,0x47,0xb8,0xf7,0x42,0x4d,0xde, + 0xa1,0x82,0xed,0xfc,0xa8,0x5b,0xa2,0x4a,0xe,0x41,0xd3,0xba,0x9b,0x99,0xa,0x98, + 0x23,0x69,0x3f,0x47,0xb5,0x95,0x3,0x25,0x2e,0x61,0xbc,0x26,0xea,0xdb,0x36,0x10, + 0x9,0xc6,0x48,0xe8,0x20,0x41,0x93,0x2c,0x49,0x7a,0x2a,0x24,0x1,0xc0,0x3a,0xce, + 0x82,0x77,0x70,0x8,0xde,0xd0,0xd9,0x20,0x39,0xb3,0x99,0x4,0xdd,0x5a,0x26,0x50, + 0xe0,0x6d,0xcf,0x60,0xb6,0xe6,0xee,0x55,0x99,0xd8,0x4a,0xd9,0x22,0x29,0xdc,0xd, + 0x57,0xd7,0xdb,0x7d,0xc4,0xfe,0x80,0x7d,0x4,0x93,0xf4,0xab,0xc4,0x0,0x15,0x29, + 0x16,0xba,0x78,0x15,0x9b,0x3,0x25,0xc4,0xc4,0xc4,0x85,0xa0,0x68,0x9c,0x0,0x4f, + 0xbf,0xa3,0x67,0x7e,0xe5,0x5f,0x8,0x2e,0x4a,0x3d,0xc6,0x68,0x72,0x2e,0xd2,0x6f, + 0xec,0xc6,0x2b,0x92,0x71,0x18,0x43,0x34,0xf6,0xda,0x92,0x25,0x18,0x1f,0xcf,0x30, + 0xb2,0xe1,0x17,0xd1,0xec,0x36,0x4b,0x15,0x51,0xc3,0xc7,0xa5,0xa6,0x1f,0xf4,0xdf, + 0x5b,0x85,0xaf,0xd6,0x62,0x22,0x60,0xee,0x51,0xeb,0x4d,0xab,0x22,0xcc,0x24,0x3c, + 0x77,0x28,0xab,0xca,0x77,0xe3,0xb8,0x8,0x7e,0x61,0x26,0x1,0x74,0xac,0xad,0xac, + 0xc0,0x1f,0xbd,0x81,0xc2,0x2c,0xc7,0x54,0xe6,0xd0,0x1,0x1c,0xed,0x3,0xca,0xe1, + 0x23,0x33,0x84,0xa8,0xb9,0xf,0xb2,0xc5,0xf0,0x41,0x56,0x75,0xd2,0x73,0xb3,0x3a, + 0xe6,0x7,0x74,0x26,0x48,0x47,0xa7,0xd6,0xf,0x4d,0x24,0x9b,0x5e,0x8b,0x61,0x9e, + 0x35,0xfc,0xae,0xea,0x64,0xa7,0xf1,0xcf,0x30,0xf3,0x0,0x3e,0xb7,0x9b,0xb2,0xaa, + 0xfb,0xb5,0xce,0x70,0xfa,0x9f,0x36,0x3,0xaa,0x73,0x96,0xc1,0x3d,0xf7,0xdf,0xe5, + 0xfc,0x19,0x2e,0x93,0x6f,0xd9,0x7e,0x6d,0x33,0x1c,0xc1,0xe6,0x17,0xc2,0xcc,0x33, + 0xcf,0xf1,0x65,0x3,0x28,0x68,0xbf,0xc,0xa3,0xff,0x34,0x23,0xeb,0xbe,0x88,0x66, + 0xb7,0x59,0x9a,0x88,0xa,0x1c,0x6e,0x35,0x79,0xa0,0xbf,0x63,0x13,0x5c,0x2a,0xf3, + 0x89,0x80,0xe8,0xd2,0xaa,0x59,0xb6,0xad,0xcc,0xa1,0x7,0xd8,0x24,0x42,0x7d,0x8f, + 0x49,0x77,0x86,0x11,0xcb,0x54,0x26,0xc0,0x46,0xdf,0x66,0xf,0x3e,0xdc,0x15,0xc5, + 0x1f,0xd5,0x91,0xd5,0xca,0x3f,0x34,0x11,0x1c,0x25,0x77,0x92,0x11,0xcc,0x72,0xf8, + 0xb0,0x6c,0xf4,0xd8,0x49,0x93,0xc0,0xe0,0x54,0xcb,0x8f,0x5d,0x55,0xfa,0xa1,0x89, + 0x98,0xe8,0x57,0x9f,0xcd,0x64,0xcf,0xc,0x4d,0x36,0xf0,0x96,0x46,0x55,0xc7,0xe0, + 0xe7,0xd1,0xfe,0x8c,0x99,0xb4,0x2,0xfd,0xed,0x4c,0x5d,0xe0,0xcd,0x32,0x65,0x9d, + 0xea,0x23,0x80,0x5c,0x9,0xd,0x0,0x40,0xf4,0x5c,0xa6,0xad,0x4c,0xe,0xc1,0x5, + 0x18,0x77,0x87,0xa8,0xf2,0x97,0x24,0x84,0x70,0xf5,0xda,0x20,0x98,0x33,0x99,0xec, + 0x9c,0xe5,0x35,0x64,0x14,0x80,0xf3,0x59,0x6,0x2b,0x23,0x62,0xcc,0xbc,0x22,0x0, + 0x2c,0x93,0x1,0x49,0x3b,0x5e,0xc3,0x36,0x2a,0xc4,0xc,0x84,0xc3,0x62,0x64,0x41, + 0xef,0x4b,0x1,0xce,0x43,0xc,0xd6,0xbe,0x6d,0xcc,0xa9,0x95,0x13,0x2,0x78,0x94, + 0x9,0x62,0x6f,0xab,0x81,0x63,0x0,0x38,0x74,0x77,0x5e,0x52,0x82,0x3f,0x84,0x39, + 0x70,0x7,0xa5,0x76,0xd,0x81,0xfc,0xb4,0x98,0x1,0x0,0x6b,0x43,0xe,0x8f,0x93, + 0x85,0x66,0x2,0x58,0xdc,0xe1,0xef,0xe2,0x50,0xbc,0x5a,0xed,0xb8,0x44,0x40,0xb6, + 0x46,0x28,0x9,0xd8,0x72,0x2f,0x78,0x67,0xdd,0x84,0xfa,0x20,0x3b,0x16,0x10,0x2b, + 0xa,0xca,0x60,0x72,0xb6,0x51,0x4f,0xb,0x41,0x9a,0x3b,0x4d,0x7b,0x16,0xa7,0x81, + 0x7f,0xe4,0x9c,0x4b,0x64,0xb0,0x7d,0x54,0xa2,0x7,0x9d,0xdc,0x79,0xb5,0xd0,0x4e, + 0xa9,0xed,0xa3,0x1a,0xda,0x36,0xf8,0x30,0xa5,0x61,0x54,0xd7,0xb4,0xcc,0x92,0xa0, + 0x53,0x36,0x9d,0xa5,0x5,0xd7,0x14,0x4b,0x77,0x8c,0xe,0x9d,0x69,0x9b,0x80,0x69, + 0x7f,0xbd,0x8c,0x52,0xc9,0x4e,0xb4,0x19,0xe,0x72,0xff,0xcb,0x70,0xb9,0x2,0x33, + 0x94,0xbe,0x69,0xd6,0x51,0x1e,0x89,0xe0,0x84,0x3b,0xf4,0xdd,0x1d,0x1,0x37,0x2e, + 0x4,0x92,0xcd,0x9e,0x49,0xc4,0xf2,0x62,0x99,0x79,0xa6,0xf8,0xcc,0x18,0xfe,0x0, + 0xca,0x2d,0x4c,0x3a,0x3c,0x6,0x36,0x61,0xc4,0x9a,0xe1,0xdc,0xb1,0x8e,0x5b,0x6, + 0x11,0x8b,0x37,0x87,0x73,0x3f,0x27,0xc,0x90,0xad,0xc0,0xd8,0x34,0x72,0xff,0x93, + 0xe1,0x91,0x7c,0xba,0x6f,0x64,0x4e,0x35,0xea,0xb3,0xca,0x81,0x42,0xe,0x9f,0x91, + 0xed,0x1c,0x8,0x9f,0x33,0x3,0x36,0xf7,0x7e,0xc6,0x1b,0x73,0x8a,0x4d,0x8,0x98, + 0xc0,0x49,0x14,0x75,0xdd,0x87,0xc5,0x87,0x29,0xa6,0x1f,0xc5,0x8b,0x56,0x4c,0xf0, + 0xb4,0xbf,0x48,0x34,0x7,0x21,0x40,0x20,0xf1,0xcf,0xc,0xb1,0xe8,0x8f,0x7a,0x30, + 0x3e,0x38,0x51,0xb2,0x6e,0x3c,0x24,0xe,0xce,0x6,0xe,0xbe,0xc2,0x38,0x89,0x1e, + 0x1b,0xe7,0xdb,0x2a,0x63,0x8,0x91,0x88,0x9e,0x60,0x8e,0x5a,0x2c,0x7e,0x32,0xe2, + 0xa8,0xe,0x53,0xb0,0x8c,0x83,0x89,0xce,0x7,0xca,0xf8,0xa,0xfe,0xd0,0x84,0xff, + 0x5b,0x18,0xc7,0xb7,0xe3,0x34,0xb0,0x8a,0xe7,0x6a,0x9a,0x9a,0x59,0x9b,0x31,0x31, + 0x5e,0xc7,0xc8,0xaa,0x15,0x21,0xd9,0xec,0xbb,0x41,0xaa,0xf2,0xa,0x7f,0xf4,0xf6, + 0x36,0x67,0xa9,0xd0,0xb7,0xfa,0xcd,0x20,0xdd,0xff,0x89,0x55,0xf9,0x63,0x71,0xe1, + 0x99,0xfb,0x99,0x97,0xca,0x5e,0x62,0x3,0x7f,0x57,0xe9,0xd1,0x72,0x6d,0x96,0x68, + 0x4,0x21,0x7c,0x2d,0x1a,0xd3,0x5f,0xe1,0x43,0xa,0x9c,0x6f,0x8d,0x38,0x16,0x34, + 0x63,0xc1,0xa1,0xa4,0xca,0x47,0x3a,0x2a,0xff,0x35,0x42,0x33,0x1e,0xd5,0x47,0x5c, + 0xb4,0x78,0xe8,0xf7,0xaa,0xaf,0xb6,0xc8,0xc3,0xbd,0xaa,0x5d,0x64,0x5b,0x38,0xe1, + 0x0,0xe7,0x9e,0x22,0xd8,0xa1,0x88,0xd3,0x0,0xdd,0x18,0x5f,0xdb,0x3,0xdc,0x8e, + 0x9b,0x20,0xe9,0x9b,0x30,0xc6,0xf4,0xf4,0xc6,0xd2,0x8c,0xdc,0x29,0x2a,0x94,0x70, + 0x38,0xf8,0x77,0x6,0x6d,0xe,0x8,0x5d,0xca,0xc8,0x63,0x8a,0x4a,0x5f,0x98,0x8a, + 0x40,0x86,0x3b,0x64,0x3e,0x19,0x1,0xd7,0xe,0x81,0x84,0x73,0x65,0x39,0xbb,0x45, + 0x9c,0x11,0x38,0xdd,0x91,0x73,0xac,0xcb,0xe2,0x78,0x72,0xa3,0xe8,0xfe,0xb4,0x76, + 0xb4,0x6f,0xb8,0x19,0xef,0x70,0xf0,0x80,0xe6,0x44,0x35,0xc7,0x32,0x4a,0x15,0x75, + 0xe0,0xec,0x3d,0xca,0xa1,0x65,0xfb,0x4e,0x45,0xae,0x33,0xb0,0xf0,0xfd,0x61,0xce, + 0x7f,0x46,0x29,0x46,0x7,0x4e,0x96,0xab,0xc5,0x91,0x85,0x2c,0x7c,0xb3,0x77,0xd7, + 0x35,0x4e,0x63,0x16,0xd3,0xe8,0x62,0xf8,0xe4,0x96,0x56,0x9c,0x1d,0xd5,0x11,0x9c, + 0x70,0x2f,0x87,0xf9,0x49,0x54,0x27,0x1e,0x30,0x2d,0xb9,0x5c,0xf3,0x6,0x8f,0x79, + 0xb4,0x61,0x38,0x5f,0x96,0x23,0x0,0x99,0x68,0x15,0x9b,0xf7,0x43,0x13,0x40,0xbb, + 0x83,0x6d,0x4e,0xf,0x1f,0x94,0x7b,0x44,0x8b,0xa2,0x3c,0x50,0xb5,0x1f,0x5e,0x1a, + 0x3f,0xc4,0x4d,0x97,0xa2,0xc7,0x34,0x91,0x6a,0x8a,0x3e,0xd8,0x73,0x89,0x54,0xd6, + 0xda,0xf6,0x3c,0xad,0xad,0x9a,0x9f,0x54,0x8d,0x96,0x6c,0x5f,0xac,0x93,0x7,0x92, + 0x3e,0x9d,0xf1,0xb7,0x22,0x26,0x27,0x27,0xcf,0xa8,0x3a,0x13,0xe,0x80,0xf3,0x33, + 0xda,0x69,0x7,0xe,0x4f,0xe7,0xe4,0xd,0xca,0xea,0xba,0x8d,0xa7,0x87,0xc8,0x1d, + 0x52,0xc3,0xdf,0x46,0x8d,0x64,0xcf,0x87,0xca,0x95,0x35,0x75,0xaf,0x75,0xb5,0x39, + 0x22,0x9a,0x6c,0xff,0xba,0x78,0xe8,0x7e,0x34,0xff,0x7a,0x33,0x8c,0xb,0x10,0x9e, + 0xd4,0x51,0xd2,0xf6,0xb3,0xba,0xc3,0x3a,0xdb,0xf0,0x6f,0x7d,0x9d,0x75,0x9d,0x3c, + 0x74,0x5f,0xe0,0xb4,0x2f,0x93,0xa3,0xe2,0x77,0xbb,0x0,0x42,0xef,0x1e,0xe1,0xca, + 0xfc,0xba,0xc3,0xba,0xdb,0x20,0xf4,0x32,0x43,0x6a,0xab,0xba,0x79,0xe8,0xfe,0x18, + 0x3e,0x24,0xba,0x5c,0xd7,0xf1,0xb6,0x2d,0x20,0x57,0x7a,0xd,0x6b,0x50,0x0,0x37, + 0xba,0x87,0xfa,0x6d,0xd4,0x2f,0xd6,0xe0,0xce,0xeb,0x2,0x3c,0xca,0x4d,0x4e,0x0, + 0x1c,0x88,0x9a,0x2b,0x5e,0xcf,0x23,0xac,0x80,0x64,0x3d,0x9b,0x4b,0x18,0x7e,0xbb, + 0x4e,0x94,0x12,0xc6,0x90,0x44,0x5f,0x13,0x19,0x8f,0xa8,0x12,0xf2,0x33,0xd9,0x92, + 0x37,0x7a,0x57,0xaf,0xbd,0xc0,0x88,0xbd,0xd0,0x6f,0xb7,0xe8,0x47,0x54,0x6,0x90, + 0xbb,0x2b,0xb9,0xa4,0xab,0xf1,0xdc,0x16,0xca,0xb6,0x5f,0xd0,0xfb,0x70,0x4e,0xb9, + 0x21,0x1,0x38,0xae,0x8a,0xaa,0xdf,0x6e,0xfb,0xb7,0x86,0xa8,0xb0,0x6e,0xb9,0x84, + 0x43,0x76,0x84,0x4d,0xf9,0x25,0xce,0x80,0x55,0x6e,0x40,0x8,0x6e,0xd6,0xd3,0x42, + 0x8c,0x71,0x2f,0xa2,0xa9,0x9d,0x25,0x78,0x5c,0x2e,0xca,0x21,0x94,0x6c,0x9f,0xb4, + 0x55,0xdf,0x58,0x10,0x25,0x5,0xfc,0x8e,0xe5,0x2,0xd1,0x65,0x22,0xa0,0x8a,0x95, + 0xc0,0x67,0x29,0x9d,0x93,0xd6,0xbe,0x3a,0xe3,0x1a,0x3,0x6f,0x68,0x83,0x7a,0x73, + 0xa3,0x8c,0x62,0x43,0x1d,0x9d,0x90,0xa3,0x1d,0xf6,0xd,0x2f,0x72,0x4c,0x36,0x7e, + 0x19,0x37,0x22,0xa5,0x8c,0x45,0x7d,0x1d,0x70,0x63,0x97,0x64,0x30,0x9c,0x1f,0xae, + 0x8f,0x95,0xdd,0x13,0xc3,0x4b,0x89,0xc6,0x8f,0xe5,0xe8,0x7d,0x55,0x49,0xcc,0xad, + 0x1d,0xb6,0xbe,0x11,0x70,0x5a,0xcb,0xe4,0x65,0xe9,0x37,0xf6,0xa6,0x36,0x3d,0x1b, + 0x16,0x6e,0x89,0x38,0xd1,0x43,0x8b,0x7b,0x6c,0x6e,0x42,0x41,0x47,0x6b,0xa8,0xed, + 0xa,0x42,0x1b,0xbb,0xa6,0x21,0x7a,0x19,0xb7,0x1a,0x9f,0x5c,0x93,0x14,0xe7,0x25, + 0x69,0xc6,0x42,0xeb,0xe0,0x32,0xac,0xe8,0x2e,0x86,0x66,0x52,0x49,0x13,0x14,0x5f, + 0x7,0x70,0x6e,0x2d,0x8c,0xe1,0x6c,0x59,0xd0,0x9d,0x6d,0xc8,0x6a,0xef,0xfa,0xf2, + 0xe9,0xbb,0x1e,0xde,0xe8,0x85,0x21,0x2d,0x5b,0x8b,0x6b,0x6d,0xae,0xf9,0x8b,0x36, + 0x24,0x9b,0x23,0x96,0x93,0xd1,0x1e,0x71,0x94,0xda,0xee,0x15,0xe6,0x88,0x19,0x2, + 0x70,0xa4,0xc7,0x5a,0xb8,0x25,0x76,0x5f,0x37,0x54,0x1b,0xeb,0x82,0x9f,0xf3,0x11, + 0xc7,0x84,0x98,0x23,0xd9,0xc9,0x50,0x63,0xec,0x1d,0x8e,0x41,0x8c,0x3e,0x48,0x17, + 0x75,0xa8,0x34,0x32,0x4,0x4e,0xbf,0x4b,0x92,0x66,0xf9,0x93,0x90,0xc2,0xd8,0xcd, + 0x96,0x71,0x25,0xfe,0x4c,0x23,0xec,0x3b,0xe8,0x54,0x25,0xcc,0xb6,0x55,0x9,0xdf, + 0xdd,0xa6,0xa0,0xe4,0x1d,0x8c,0xbd,0x76,0xca,0xc8,0xd5,0x98,0xca,0x97,0x65,0x3b, + 0x71,0xda,0x6a,0x51,0xd0,0xc5,0xb3,0x6a,0x8f,0xa0,0x43,0xe,0x91,0xa8,0x3d,0xf4, + 0x64,0x59,0xda,0xbb,0xe,0x42,0x82,0xc2,0x2c,0x8b,0x92,0x2e,0xbe,0x64,0x60,0xd0, + 0x37,0x6,0x19,0x40,0x82,0x66,0xe8,0x49,0xb2,0xb5,0x7,0x6,0xd4,0x80,0xd2,0x2, + 0x36,0x45,0x43,0x7e,0x4f,0xc6,0x70,0xc4,0x3b,0xc8,0xcd,0x97,0x8c,0xfc,0xd8,0xba, + 0xf9,0x77,0x36,0x42,0xf3,0x22,0x9b,0x36,0x23,0xff,0xc8,0x28,0xe7,0x1a,0xf9,0x58, + 0x12,0x95,0xbb,0xa1,0xcd,0xa4,0xca,0xfe,0xc5,0x92,0x66,0x3a,0xb7,0x50,0x91,0x5, + 0x49,0x85,0xb4,0x93,0xb6,0x18,0x85,0xe4,0x23,0xce,0x69,0xa8,0x27,0xa0,0x16,0x2d, + 0x99,0x6b,0xf5,0xb9,0xaf,0xee,0x84,0x36,0xa,0x9,0xac,0x29,0xc6,0x19,0xf8,0x6, + 0x7c,0xab,0xee,0x2b,0x97,0x70,0x1a,0x44,0xce,0x69,0xe9,0xd8,0x24,0x5d,0xb1,0x6f, + 0x17,0xce,0xc0,0x74,0x24,0x7b,0xcc,0xb4,0x62,0xaf,0xa5,0x40,0x71,0x32,0x14,0x4f, + 0x37,0x95,0xfb,0xbe,0x28,0x3,0xf4,0x42,0x1e,0x2a,0x63,0x9c,0x36,0x3b,0xc3,0x75, + 0x45,0xcc,0x76,0x3a,0x1d,0x6c,0xcd,0x8d,0x64,0x9d,0x5b,0xcb,0xda,0x4f,0x80,0xcf, + 0x46,0x48,0xb4,0xf3,0x8a,0xa5,0x37,0xe1,0x2a,0x28,0x24,0x9e,0x96,0xb9,0xed,0x8b, + 0xfa,0x7e,0xd4,0xd5,0x51,0x17,0x42,0x1d,0xd5,0x42,0x9f,0x73,0x63,0xa8,0xf7,0xa1, + 0x9e,0x8a,0x24,0x3f,0x86,0xad,0xa8,0x88,0x13,0x2e,0x42,0xeb,0x95,0x92,0xc,0x60, + 0x72,0xd2,0xfb,0x6,0x36,0x44,0xa5,0x85,0x40,0xeb,0xa2,0x4e,0x45,0xa5,0x9f,0x5b, + 0xa7,0xfa,0x26,0x2a,0xfd,0x38,0x14,0x55,0xfa,0xaf,0xb8,0x1d,0x95,0x9e,0x3,0xfd, + 0x7f,0xec,0xb8,0x39,0xd8,0xf6,0xa5,0xcf,0x40,0x3b,0x32,0x80,0x89,0x4c,0x37,0xcc, + 0xe8,0x89,0xc6,0x9b,0x50,0x63,0x96,0x57,0x0,0xf6,0x3,0xd4,0xe9,0xed,0x88,0xb4, + 0x67,0x31,0x32,0x19,0xc0,0xa4,0x5b,0x9,0xf5,0x62,0xd4,0x3a,0xb,0x5d,0x44,0xf8, + 0x22,0x2a,0x7b,0x12,0x3f,0x32,0xc9,0xef,0x3,0xad,0x26,0x3,0x98,0x58,0x74,0xa4, + 0x3e,0x1a,0xb5,0xd,0xe5,0x29,0x90,0x78,0x6f,0x35,0x91,0xf6,0xa8,0x23,0x95,0x1, + 0x4c,0x24,0x7a,0x8a,0xef,0x82,0x36,0xcc,0x6a,0x86,0x3,0x5d,0xd5,0xad,0xfa,0x95, + 0x29,0x9d,0xdf,0xdf,0xfd,0x97,0x4c,0xcb,0x2e,0xc4,0xe4,0x39,0x10,0x43,0xdf,0xb5, + 0xc,0xb7,0x49,0xfc,0x14,0xc8,0x6c,0x86,0x2f,0xa8,0xb3,0xda,0x44,0xaa,0x2d,0x5c, + 0xfa,0x9,0x6e,0xec,0x9,0x4c,0x6c,0xba,0x3,0x70,0xb,0xea,0x5f,0x1a,0x43,0x65, + 0xbb,0x74,0x85,0x84,0xde,0x6,0xb0,0x0,0x6a,0x15,0xef,0xf6,0xfc,0x1c,0x26,0xf9, + 0xf,0xca,0x92,0xec,0xed,0x87,0x38,0x3,0x98,0xdc,0xab,0xa1,0x72,0xb,0x17,0x21, + 0xf6,0x16,0x7a,0x46,0xfe,0x48,0x54,0xba,0x2c,0x58,0xb8,0xc0,0x8e,0x96,0x4c,0xd0, + 0xab,0x86,0xce,0x47,0x2d,0x7a,0x53,0x19,0x26,0x49,0x69,0xc5,0xb3,0x41,0x85,0x83, + 0xef,0xd,0xaa,0xcf,0x0,0xa6,0xc7,0x56,0xe9,0x24,0x29,0xb2,0x39,0x5,0xca,0xbe, + 0x25,0xd4,0xc1,0xe4,0x81,0xbd,0x29,0xea,0xdd,0x45,0x8,0x41,0xf7,0x5e,0x54,0xba, + 0x35,0xda,0x97,0x3e,0x3,0xe3,0x19,0xc0,0x84,0xf8,0x42,0x81,0x49,0x44,0x2f,0xb5, + 0x5b,0xad,0xee,0xdc,0xc1,0xe7,0xa7,0x50,0xdf,0x12,0xf2,0x7c,0xe,0x7a,0xef,0xaa, + 0x9b,0x63,0xef,0xaf,0x85,0x19,0xc0,0x44,0xf8,0x9e,0x70,0xd2,0xcc,0x84,0x5e,0xe5, + 0xaf,0xc2,0xf4,0xa5,0x8,0x1c,0x24,0xeb,0x73,0x29,0x24,0x3a,0xcd,0xd9,0xc0,0x87, + 0xd7,0x8f,0xf,0x71,0x6,0x30,0x1,0x2e,0xa7,0x99,0x20,0x28,0xf4,0xfe,0xc0,0x56, + 0x15,0x70,0xbe,0x42,0xc0,0x9b,0x54,0x26,0x16,0xa3,0xb7,0x2a,0x82,0x9e,0x4c,0x65, + 0x19,0xc0,0x4e,0xa7,0x2f,0x74,0xdc,0xfb,0x73,0x69,0x42,0xe8,0xe5,0x5,0x74,0x56, + 0xae,0x8c,0x48,0x49,0x60,0x70,0x3b,0x48,0x27,0xeb,0x68,0xb7,0xe6,0xe9,0xbe,0x92, + 0x21,0xf7,0xe6,0xbe,0xc,0x60,0x12,0xd0,0xeb,0x62,0x69,0xe2,0xfa,0xa,0x3d,0x5, + 0xbf,0xa0,0xf,0xaf,0xe9,0x71,0x70,0xdc,0xd6,0x17,0x48,0x3a,0x7e,0x4e,0xd3,0x5c, + 0x7b,0xff,0x15,0x67,0x0,0x3b,0x9a,0xde,0x3c,0xce,0xbd,0x1b,0xda,0x9c,0x23,0xd7, + 0x57,0x4c,0x25,0x2a,0x3c,0xc8,0xaf,0x8b,0x2a,0xb9,0xb4,0xf8,0x6b,0xe8,0xf5,0xf7, + 0x3e,0xa2,0x66,0xbf,0x25,0x60,0xd8,0xb1,0xff,0x80,0x2a,0x29,0x67,0xb4,0x84,0x72, + 0x21,0x1a,0x8,0x8c,0xde,0x62,0xff,0xbc,0x20,0xc0,0xc7,0xa0,0xd3,0xba,0xe7,0xe4, + 0xb,0x5,0xdb,0x2b,0x67,0x33,0x80,0x1d,0xfa,0xaf,0x82,0x1d,0x4f,0x2a,0xff,0x92, + 0xb5,0xec,0x56,0xf,0xfc,0xe9,0xbb,0xc5,0x83,0x14,0x88,0xa7,0xbc,0x86,0xf1,0x55, + 0xbb,0x15,0x5d,0xcf,0x96,0xcd,0x0,0x76,0xe4,0x7f,0x79,0x76,0xb6,0x1a,0xde,0x8b, + 0x5,0xe8,0xa0,0x10,0x1,0x5d,0xa7,0x82,0xf2,0x6c,0xb7,0xec,0x60,0x78,0x3d,0x65, + 0xca,0x0,0x76,0x2c,0x2d,0x71,0xbd,0xd5,0xb3,0x83,0xd5,0xf0,0xd0,0x3d,0x3b,0x8d, + 0xc0,0x7e,0xac,0x82,0xf3,0x6c,0x3f,0xd7,0xcf,0x98,0x8e,0x65,0x0,0x3b,0x74,0x71, + 0x54,0x5a,0x1b,0xe2,0x2b,0xf4,0xfa,0x51,0x7a,0xde,0x71,0x28,0xb,0x62,0x3b,0xc2, + 0x97,0x80,0x74,0x9c,0xfb,0x41,0xbd,0xa1,0xcc,0x49,0xe7,0x83,0xc2,0xe,0x5b,0x3, + 0xd5,0xf6,0xde,0x5c,0x7d,0x7f,0xcf,0x46,0x87,0x9e,0x91,0x1c,0xea,0x82,0x18,0xf7, + 0xd4,0x83,0x76,0xb4,0x2f,0x1b,0xea,0x44,0xc,0x43,0x70,0xd8,0x79,0x7f,0xe3,0xd8, + 0x81,0xfa,0xd0,0x48,0x2d,0x48,0x42,0xe0,0x1f,0xd4,0x83,0x77,0xb4,0xef,0xc7,0x58, + 0xa3,0x3f,0x5a,0x33,0xc,0xf3,0xb0,0x92,0x18,0xb0,0x63,0xe8,0x99,0x45,0x49,0xf9, + 0x65,0x25,0x4,0x5a,0xe,0x8a,0xc4,0xac,0x8e,0x2a,0xf9,0x64,0xa3,0x4b,0x8d,0xcb, + 0xb4,0x3c,0x9c,0xd1,0xa2,0x87,0x1d,0x42,0x4f,0xa0,0x4b,0xca,0xf7,0x47,0x2b,0x33, + 0xd9,0x68,0x91,0x20,0x7a,0xb,0x1a,0x9d,0x9a,0xf9,0xa,0xdd,0xc,0xdb,0x38,0x6b, + 0xdd,0xf7,0x1a,0xc9,0x0,0x76,0xc4,0xd5,0xbe,0xbd,0x95,0x8e,0x1f,0xda,0x8,0xc1, + 0xd4,0x29,0x38,0xd0,0xf3,0x9d,0x53,0x51,0x97,0x40,0x6d,0xec,0x6e,0x22,0x7c,0xd3, + 0x8f,0x39,0xdd,0x83,0x2a,0x29,0xad,0x5b,0x64,0xd6,0xe4,0x3e,0xac,0xd5,0x37,0xf6, + 0xe,0xfd,0x9e,0xd3,0x1f,0x25,0x7b,0x9,0x3a,0xbb,0xd4,0x4a,0xe,0xce,0xe0,0x93, + 0xd6,0x98,0x4b,0xee,0x2c,0x3e,0xd,0xbd,0x7f,0x6c,0x80,0xdf,0x65,0xf0,0x2b,0x29, + 0x9d,0xbe,0xf9,0x55,0x77,0x5e,0xa3,0xf8,0xc3,0x5e,0x59,0x1e,0xf5,0x45,0xc1,0xde, + 0x99,0x3,0x9d,0x19,0x51,0x9c,0xa,0x41,0xe0,0xcf,0xfb,0x53,0x4e,0xe,0xde,0x3f, + 0x14,0xba,0x89,0xa2,0x6,0x1e,0x27,0x3b,0xb8,0xe8,0x43,0xe7,0x45,0x71,0xd8,0x83, + 0xf8,0x33,0x80,0xac,0xcf,0x40,0xa5,0x89,0xeb,0x2b,0xaf,0x40,0xa1,0xb6,0xa5,0xae, + 0xf0,0x35,0x5,0x95,0xfb,0xf1,0x4c,0x1f,0x4f,0x73,0xfc,0x11,0x8,0x16,0xf6,0x67, + 0x22,0x8e,0x6,0x7c,0x7d,0xd9,0x24,0x60,0xe9,0xd3,0x4d,0xb3,0xc6,0x4e,0xad,0xe2, + 0x44,0xdb,0x72,0x14,0x24,0x58,0x7a,0x4d,0xb7,0xf6,0x5,0x45,0xe0,0x46,0x2b,0xf5, + 0x62,0x95,0x73,0xeb,0xdc,0x15,0x20,0xbd,0xb3,0x90,0x38,0xdd,0x3c,0xab,0xec,0x19, + 0xd4,0x3a,0x63,0x6e,0x9d,0x2f,0x24,0xf6,0x28,0xe1,0x4e,0xa0,0x5f,0x6f,0xa9,0xf5, + 0x48,0x3,0x7f,0x74,0x9,0x2e,0x76,0xa9,0xe2,0xd5,0x12,0xd6,0xfd,0xa,0xf2,0xf4, + 0x80,0xb3,0xe4,0x93,0x71,0xa8,0xef,0xfe,0x5a,0x13,0x54,0xe5,0x0,0x12,0x7f,0x81, + 0x70,0xf6,0x5c,0x58,0x25,0xf,0x1b,0x36,0xb8,0xad,0x27,0xe4,0x57,0x44,0x6d,0x3d, + 0x9b,0xbf,0xaa,0xe4,0x20,0xb7,0x32,0x2a,0x9d,0xda,0x49,0xca,0x36,0x55,0xf1,0x18, + 0x19,0x5c,0x64,0x99,0x2e,0xad,0xfd,0x5e,0x92,0x6d,0xe8,0xe4,0x7f,0x2a,0xa4,0xa6, + 0x4c,0xc1,0xf7,0x62,0x42,0x8e,0x45,0xd4,0x96,0xac,0x89,0x7e,0xc6,0xd,0x8,0x2e, + 0x8a,0x4a,0xa7,0x78,0x92,0x72,0x40,0xc6,0xb8,0xef,0xc8,0x33,0x80,0xec,0xd2,0x4d, + 0x9,0xba,0x84,0x26,0x29,0x9f,0x97,0x23,0x57,0xa3,0x9,0x92,0x31,0xbe,0x60,0xaa, + 0x58,0xe9,0xd,0x58,0x8d,0x15,0x90,0xa0,0x95,0x98,0xb7,0x29,0x32,0x9e,0xed,0xc9, + 0x8d,0x11,0xed,0xaa,0x63,0x24,0xf4,0x2f,0x50,0xdf,0xf4,0x24,0x56,0xd,0x6f,0xdf, + 0x86,0x38,0x41,0xc6,0xf9,0xcb,0x8d,0x8a,0xac,0x70,0x7b,0x6f,0x4b,0x62,0xba,0x50, + 0xc8,0xf7,0x8a,0x36,0xf0,0xed,0x4,0x7,0x24,0x74,0x7b,0x61,0x52,0xe9,0x19,0xc4, + 0xd6,0xbc,0xf7,0x3,0x5c,0x7e,0x2a,0xe4,0x2d,0x51,0x6b,0xcd,0xcf,0x8,0x82,0xec, + 0xf1,0x12,0xc2,0xd0,0xa1,0x9b,0x6e,0xf4,0xde,0xc5,0x56,0x95,0x56,0xbd,0x50,0x1d, + 0x9,0x3a,0x18,0xd9,0xb9,0x54,0x90,0xa1,0x97,0xa0,0xb3,0x22,0x5e,0x36,0x79,0x97, + 0x40,0xb7,0x2e,0x95,0xb1,0x88,0x8e,0xee,0x8f,0x88,0x55,0xa,0xa,0x39,0xa6,0x25, + 0xe,0x92,0x53,0x40,0x5a,0x57,0xff,0xc,0xf6,0xe1,0xf2,0xa5,0x1c,0x46,0x36,0x6e, + 0xcd,0x4,0x47,0x62,0xe8,0x2e,0xde,0x89,0x82,0xf8,0xc6,0xa0,0xb3,0xc,0x12,0xff, + 0xb4,0x40,0xb7,0x4e,0x15,0xf1,0xf,0x23,0x9,0x48,0x3d,0x20,0xd0,0xa9,0x4d,0x5, + 0xb9,0xa6,0x45,0x6a,0x92,0x53,0xc1,0xc5,0xa1,0xf7,0x38,0xf6,0xe5,0xa6,0xb5,0x91, + 0xeb,0x82,0x23,0x24,0xe4,0x1a,0x54,0x49,0xb9,0xb1,0xad,0xf1,0x80,0xfc,0x6e,0x92, + 0x0,0x84,0x3a,0x5b,0xb6,0x31,0x4e,0x70,0x5f,0x1f,0x95,0x4e,0xd,0x25,0x65,0x8f, + 0x36,0xc6,0x50,0x2b,0x27,0x64,0x69,0x21,0xd4,0x99,0x92,0x6c,0x41,0xe7,0xec,0x5a, + 0xc9,0x15,0x74,0x6,0x7e,0x9b,0xb,0xe3,0x90,0xa8,0xbd,0xbb,0xa0,0xfb,0xda,0xd4, + 0x41,0x5e,0xfa,0xe2,0x24,0x8a,0xf3,0x1b,0xb5,0x11,0x6b,0x9b,0x23,0x4,0xbf,0x12, + 0xea,0xcb,0x94,0x5,0x41,0x69,0x7d,0xa2,0x10,0xc3,0x34,0x41,0x1c,0x12,0x15,0xba, + 0x9b,0xd8,0x9a,0x53,0x47,0x6e,0xde,0x80,0x1f,0xad,0xe4,0x9c,0x89,0x2a,0x29,0xff, + 0xcd,0x61,0xc,0xb5,0xc,0x59,0xf9,0x2b,0x54,0xc9,0x6d,0x61,0x4a,0x60,0xed,0x4b, + 0x49,0x43,0x92,0xf,0x9e,0xb4,0xce,0x3a,0x46,0x79,0x38,0xc4,0x7f,0x13,0x36,0x8, + 0xf6,0x6,0x61,0xc0,0x74,0x9,0xb5,0xd5,0xff,0xb4,0xd1,0xf2,0x87,0x40,0xf7,0x11, + 0x26,0x85,0xd4,0xb6,0x8a,0xe6,0xb8,0x6,0x20,0xf0,0x7d,0xa2,0x40,0x6c,0x36,0xd5, + 0x1b,0x6a,0xa0,0x1a,0xcd,0x5,0x82,0x38,0xdb,0x16,0x88,0x21,0xa7,0x5f,0x87,0x5b, + 0x22,0x9a,0xe3,0x36,0x2,0x21,0xc0,0x63,0x8c,0xa0,0x6d,0x5d,0xba,0xc9,0xb3,0x66, + 0x1b,0x63,0x70,0x71,0x2,0xe7,0xdf,0xda,0x2,0x2a,0x20,0xff,0x89,0xcb,0x47,0x1b, + 0xc7,0x10,0x9b,0xf4,0xcd,0x61,0xb4,0x5f,0xd7,0x6a,0x63,0xc,0xa5,0x39,0x21,0xb0, + 0x9f,0x9,0x77,0x32,0xdd,0xf2,0x9e,0x52,0xda,0x61,0x3,0x0,0x5,0x62,0x74,0xa5, + 0xe2,0x98,0x6,0xa8,0x97,0x76,0x89,0x80,0x8a,0x7c,0x32,0x7f,0xa8,0xb4,0x43,0x21, + 0x40,0xe5,0xe7,0x45,0x8,0x7c,0x12,0xea,0x9d,0xe0,0xf3,0x51,0x1,0x27,0xba,0xc1, + 0xb1,0x1c,0xae,0xbb,0xfe,0x49,0xa0,0xdb,0x46,0x95,0x47,0x23,0x90,0x9a,0x15,0x1, + 0xa3,0x76,0x8,0xec,0xb3,0x33,0xe0,0x54,0x7a,0x4a,0x49,0x3f,0x3c,0xf0,0xa5,0x3a, + 0x48,0x56,0x3a,0xc1,0x11,0x4,0x1d,0x89,0xe9,0x77,0x1c,0x25,0xb7,0xd4,0xaf,0x44, + 0x92,0xd6,0x46,0x7d,0xbb,0x8e,0xc0,0x2b,0xf2,0x11,0x63,0x82,0x77,0xe6,0x4b,0xa6, + 0x99,0x43,0xec,0xbb,0xff,0x83,0x8c,0x4e,0x2d,0xdf,0x32,0xc7,0x98,0xfe,0x49,0x98, + 0x1f,0xa7,0x30,0xf2,0x6e,0x88,0x40,0x7e,0x1d,0xd4,0xb7,0x50,0x25,0xe5,0xd4,0x6e, + 0x44,0xe5,0x66,0x89,0x40,0xf7,0x90,0x4,0xeb,0xd1,0x59,0xdf,0xed,0xa5,0xfd,0xa3, + 0x88,0x6f,0x29,0x54,0xba,0x6d,0x2f,0x29,0x57,0xb7,0x3f,0x22,0x83,0x21,0xa2,0xfa, + 0x88,0x24,0xb2,0x54,0xe7,0x70,0xc3,0xbc,0xb3,0x5d,0xc4,0xb3,0x45,0x81,0xb8,0x6d, + 0xaa,0x74,0xbb,0xbb,0xf3,0x5,0xc1,0xd1,0x65,0xd3,0xfb,0x6c,0x41,0x1a,0xf2,0x87, + 0xd0,0x5f,0xb0,0x13,0x41,0x83,0xe8,0xa1,0x6,0x79,0x57,0x77,0xb7,0x4e,0x4,0x25, + 0x24,0x89,0x40,0xcb,0x3e,0xba,0xd6,0xd5,0xef,0x1e,0xd6,0xc,0x21,0x27,0xbf,0x72, + 0x4d,0x0,0x6d,0x8c,0x6e,0xfa,0xad,0x68,0x5,0x6a,0xc3,0x0,0x8,0xfe,0xa7,0x46, + 0xd8,0xd5,0xa4,0x9b,0x3c,0x9b,0xb5,0x81,0x73,0x4c,0xe,0x88,0x89,0xee,0xf0,0x95, + 0x29,0x77,0xc4,0xe4,0xd3,0x16,0x2c,0x24,0xe4,0x54,0x61,0x52,0xda,0x3b,0x2f,0x10, + 0xc0,0xf5,0xc2,0x20,0x5e,0x85,0x5e,0x6b,0xd7,0x5a,0x94,0x9d,0x14,0x88,0x6d,0xb6, + 0x30,0xf,0x9c,0xda,0xe5,0x65,0xfd,0xb7,0xd5,0x1e,0xc1,0x1e,0xc6,0x5,0x6c,0x91, + 0xb5,0xe7,0xc7,0x8,0x40,0x70,0x61,0xd4,0x87,0x2d,0x44,0x4d,0x31,0xdd,0xe9,0x5b, + 0xac,0xad,0x3b,0x21,0x6,0x2f,0xc4,0x77,0xbb,0x19,0x74,0x81,0xfe,0x99,0x31,0x38, + 0xb4,0x15,0x3,0x79,0xf8,0xfb,0x2,0xb9,0xf8,0x56,0x8c,0x38,0x4a,0x5d,0x26,0x4, + 0xd9,0x55,0x40,0xe2,0x59,0x54,0xda,0xfa,0xa,0x7d,0xfc,0xae,0x84,0x4b,0x49,0x2f, + 0xfb,0x14,0x3b,0x3e,0x5e,0xe6,0x52,0xa1,0xe4,0xf2,0x5a,0x67,0xd3,0x83,0x7d,0x4f, + 0xb,0xaf,0xe8,0xd4,0x74,0xae,0x20,0x88,0xaf,0x62,0x7e,0x5d,0x28,0xd0,0x73,0xaa, + 0x4,0x4f,0x70,0x38,0xff,0x6b,0x20,0xd3,0x35,0x5b,0xc9,0x5b,0x98,0x2e,0x46,0x70, + 0x1b,0xa3,0xce,0x71,0xb2,0x19,0x8e,0xc1,0xb1,0x12,0x61,0x34,0xfa,0xb0,0x71,0x9, + 0xde,0x62,0x53,0xcc,0x81,0xdf,0x40,0x79,0x1a,0xea,0x6b,0x2,0xa3,0x8f,0x61,0x9e, + 0xdd,0x81,0x3a,0x49,0xa0,0x1b,0x4f,0x5,0xe,0x3f,0x89,0x2a,0x2d,0x27,0xc5,0xf3, + 0xdc,0x7e,0x24,0x24,0x65,0x63,0x69,0x62,0x18,0xbd,0xe9,0xed,0x8f,0x30,0xe,0x43, + 0xc4,0x4e,0xaf,0xda,0xa0,0xa7,0x7f,0x24,0x85,0xbe,0xd7,0xd4,0xf3,0x6b,0x1c,0x70, + 0x24,0x7d,0x8,0x95,0x88,0x1f,0x18,0x27,0x1d,0xdd,0x42,0x41,0xdc,0xd3,0x50,0x25, + 0x6f,0x96,0x85,0x5a,0x52,0x68,0x47,0x4f,0xed,0x56,0x94,0xe5,0xd9,0x22,0xe6,0x22, + 0xef,0xbd,0xa1,0x9b,0x86,0x6b,0x97,0xf7,0xea,0x40,0x80,0x83,0x8b,0x51,0xa5,0x65, + 0x47,0x7,0xd4,0x48,0xc,0x21,0x51,0xd3,0x50,0x2f,0x75,0x24,0xec,0x4a,0x8c,0xad, + 0x3b,0x12,0xc9,0x70,0x4,0x89,0x1c,0x5c,0xe4,0xc8,0x91,0x39,0xb4,0x83,0x3,0x2a, + 0x6c,0x8,0x1e,0xe8,0xae,0xd4,0x3d,0xa6,0x27,0x4b,0x9f,0x7e,0x1d,0x60,0xc3,0x30, + 0x4f,0xbd,0xd5,0xa8,0x66,0x0,0x73,0x86,0xd6,0xa6,0x48,0xcb,0x21,0xd1,0xf2,0x4, + 0x8f,0xef,0x42,0x7d,0x4e,0xe8,0x99,0xde,0xd9,0xbd,0x5c,0x34,0xe7,0x3d,0xd0,0x48, + 0x65,0x0,0x73,0xe7,0x0,0xe1,0x3c,0x23,0xb5,0xd3,0x4a,0x27,0x7,0x20,0x45,0x9e, + 0xa2,0x1e,0x83,0xfe,0x42,0xa5,0x9d,0xf6,0x0,0x23,0x9d,0x1,0xcc,0xa1,0x1d,0x50, + 0xa5,0xe5,0xba,0xe0,0x64,0xc1,0xc3,0x4e,0x52,0x2f,0xd0,0xbb,0x39,0xd8,0xd1,0x88, + 0x18,0x22,0x47,0x74,0xd5,0x60,0xad,0xb4,0x2e,0x3a,0x22,0x61,0x7,0x85,0x89,0x1c, + 0x6d,0x88,0x4a,0xa7,0xba,0x92,0x32,0xb,0x4a,0x92,0x4b,0xd5,0x13,0x5c,0x60,0x70, + 0xb8,0x4,0x39,0xd5,0xb9,0xb,0xdb,0x79,0x27,0xac,0xfb,0x16,0xf2,0x31,0x3f,0x2a, + 0xfd,0x94,0xc9,0xeb,0xa8,0xbe,0xf2,0x1a,0x14,0x8e,0x46,0x9d,0xdc,0x67,0x6e,0x22, + 0x3,0xc8,0xc7,0x26,0xbe,0xc4,0x69,0xe3,0xf4,0xca,0x67,0xd9,0xaf,0x79,0x40,0xf1, + 0xc,0xcd,0xd0,0xd7,0xa4,0x1d,0x38,0xd4,0xb7,0xde,0x27,0x52,0xee,0x6f,0x21,0x17, + 0x34,0xb1,0xaf,0xf5,0x25,0xcd,0x31,0x7e,0x9,0xc6,0x82,0x6f,0xbe,0xf9,0x19,0x76, + 0x4b,0x3,0xb9,0xd8,0xd3,0x91,0x2b,0x6e,0xe8,0xfd,0xce,0x8,0x61,0x71,0x1a,0x67, + 0xe5,0x90,0x7d,0xda,0x9,0x38,0x42,0x83,0xc8,0xd1,0xaa,0xa8,0x92,0x23,0xb6,0x23, + 0x9d,0xc9,0x10,0x3d,0x93,0x3a,0xdc,0x4f,0x9f,0x17,0x98,0x17,0xc8,0x85,0x74,0xb9, + 0xad,0xca,0xeb,0xe6,0x2c,0x3c,0x46,0x8f,0x52,0x1a,0xc2,0x2d,0xbd,0xc2,0xab,0x1b, + 0x8b,0xd4,0xd9,0x88,0xe3,0xa,0x91,0x8b,0xfb,0x85,0x79,0x93,0xa8,0xfd,0x3c,0x2e, + 0xbb,0xee,0xa2,0x21,0x59,0x45,0x16,0x68,0xa9,0xdc,0xae,0x93,0x89,0x18,0xd2,0xb5, + 0xd5,0x48,0x81,0x6d,0xf8,0x37,0xd8,0x8c,0xf7,0xee,0x77,0x90,0x33,0xfa,0xf2,0x18, + 0xb3,0xd0,0xdb,0x73,0xfb,0x82,0xc,0x20,0xa9,0x4b,0x7,0x24,0x96,0x1e,0x72,0x4f, + 0x8a,0x3a,0xdf,0x3b,0x56,0x9,0xa,0x6c,0x67,0x17,0xd0,0x1d,0x76,0xd5,0xc7,0x23, + 0x7,0xd8,0x4f,0xf0,0x34,0xa1,0x58,0x9c,0xf5,0xc,0x9a,0x45,0x17,0xe9,0x6d,0x80, + 0x7f,0x8a,0x3d,0x9,0x82,0xd6,0x2,0xd0,0x97,0xc4,0x90,0xdb,0xea,0xb4,0x22,0xac, + 0x2f,0xc8,0x0,0x76,0x2,0x2d,0x1,0x3e,0x2e,0x62,0x32,0x4e,0x88,0x88,0xd5,0x69, + 0x28,0xcc,0x4f,0x7a,0x38,0x46,0x1d,0x88,0x8b,0xc4,0xf2,0x89,0x44,0x19,0x0,0x1f, + 0x40,0xd,0x29,0x74,0x9d,0x72,0xf1,0x22,0x1e,0x87,0x5d,0x17,0xf9,0xa0,0x4b,0x83, + 0x65,0xcb,0x61,0xc3,0x9e,0xa7,0x22,0xf1,0x21,0x99,0x7b,0x7,0x26,0x74,0xfc,0xc, + 0x3,0xc6,0xb4,0xe6,0x36,0xb4,0xc,0xcd,0x13,0xf1,0x45,0x92,0xee,0xd2,0x45,0x22, + 0xa7,0xa2,0x86,0x5c,0x2a,0xa4,0x4b,0x84,0xfd,0x25,0x57,0x23,0xb9,0xc8,0xc9,0x6d, + 0xa8,0xa1,0x65,0x3e,0x3a,0x89,0x2f,0x72,0x41,0xdd,0x74,0x44,0xf,0x89,0x4a,0x9e, + 0xe6,0x31,0x68,0x8f,0x46,0x17,0xb9,0xa1,0x4b,0x87,0x74,0x54,0xe7,0xae,0xb0,0xdc, + 0xd,0xf9,0x37,0x50,0x97,0x1f,0x8d,0x6c,0x14,0x8f,0x12,0xb9,0x39,0x4,0x35,0xb4, + 0xcc,0x4c,0x3c,0xc2,0x9a,0x56,0xa,0xbe,0x11,0x8a,0x2,0xbb,0x47,0x50,0x17,0x28, + 0x4e,0xbf,0xb7,0xe8,0x33,0x60,0xcf,0x0,0xe6,0xd4,0x36,0x25,0xe6,0x24,0x99,0xd2, + 0xe3,0x71,0xe3,0x5,0x9d,0xef,0x94,0x4,0xa3,0xf5,0x0,0x8b,0x28,0xbc,0x7e,0xdb, + 0x67,0xa0,0x4c,0x6,0x30,0x97,0xb6,0x2d,0x39,0x1f,0xc9,0x9c,0x1e,0xa9,0x1c,0x2f, + 0xe8,0xd0,0x8f,0xae,0x96,0xbd,0xb,0x47,0x5f,0x3a,0xe9,0x81,0xd2,0xbe,0xf4,0x19, + 0x8,0xce,0x0,0xe6,0xd0,0xf7,0x50,0xcb,0x96,0x8b,0x72,0x4,0x80,0xb8,0x73,0x59, + 0xd4,0xd4,0xfe,0xd7,0xd8,0xf6,0xcb,0x66,0x73,0x19,0xee,0x5,0xae,0xc,0x60,0xce, + 0xbc,0xf,0xb5,0xec,0x41,0x96,0xa6,0xe0,0x8b,0xa8,0xfc,0xea,0x42,0xc,0x7c,0x96, + 0x34,0x22,0x95,0xeb,0x80,0xd3,0xc8,0xef,0xad,0xbb,0x12,0xd9,0x8f,0xb5,0x2b,0x3, + 0x98,0x23,0x5b,0xa3,0xbe,0x14,0x69,0xce,0xd1,0xaa,0xc2,0x65,0x9d,0x11,0x42,0xe1, + 0xe3,0x91,0x9c,0x29,0x18,0xfa,0xaf,0x3c,0x8,0x35,0xe4,0x62,0xbd,0x93,0x6b,0x3f, + 0xd8,0xcd,0xc,0x60,0x2e,0xac,0x88,0x7a,0x39,0x6a,0xcc,0x42,0x2f,0x95,0x92,0x3d, + 0xb8,0xd,0xc5,0x15,0x50,0xa5,0x8f,0xa9,0x15,0x25,0xf9,0x1b,0x18,0xec,0x87,0x5a, + 0xcf,0x6b,0x0,0xba,0x39,0x7,0x86,0x8a,0x35,0xf6,0x35,0x3d,0xc0,0x70,0x2,0x2a, + 0xad,0x94,0xac,0xa2,0x9c,0x6b,0x4b,0x98,0xf3,0x41,0x5,0x30,0xd9,0x1f,0x86,0xf4, + 0x2b,0xb7,0x75,0x95,0x57,0xe1,0xe8,0x39,0x54,0x7a,0xcb,0xea,0x9b,0x75,0x39,0xed, + 0xfd,0x94,0xce,0x0,0xcd,0x23,0xba,0x49,0x45,0x47,0x50,0x3a,0x70,0xd5,0xf5,0xf0, + 0xc6,0x93,0xf0,0xb5,0x19,0x96,0x4a,0x3c,0x8c,0x2d,0x5b,0x9c,0x13,0x5c,0x59,0x60, + 0xa2,0x7f,0x1d,0xed,0x6f,0xaa,0x7e,0xbf,0xed,0x33,0xd0,0x70,0x6,0x9e,0x80,0xff, + 0x6d,0x31,0xb1,0x7,0xab,0x6,0x6d,0x7c,0x44,0x13,0x5c,0x19,0x63,0xa2,0xd3,0x62, + 0xf2,0xb3,0x50,0x57,0x53,0xb2,0x7e,0xdb,0x67,0xa0,0xc6,0xc,0x9c,0x9,0x5f,0x7, + 0x62,0x62,0xbf,0x28,0xf5,0x59,0xe8,0x8b,0x1f,0x80,0x6f,0x44,0x5d,0x1d,0x95,0xfe, + 0x31,0xde,0x87,0x7a,0xa5,0xd4,0x51,0xaf,0xd7,0x67,0x20,0x20,0x3,0xb4,0x4a,0xf3, + 0x68,0xd4,0x29,0x34,0xe7,0x50,0xf6,0x41,0x15,0x4f,0x6e,0xf2,0x57,0xe8,0x8,0x4e, + 0x6,0xb6,0x82,0xa3,0xfb,0xd2,0x18,0xdb,0x2d,0xad,0x33,0xb0,0xed,0xaf,0x85,0xdb, + 0x92,0xd5,0xcb,0xb9,0xc,0xd0,0x9a,0xfa,0x2b,0x50,0xcf,0x41,0xbd,0x1a,0x13,0xb9, + 0xe8,0x1a,0x70,0xe,0xb3,0x97,0xf5,0x19,0x18,0xee,0xc,0xfc,0x19,0x82,0xec,0x3c, + 0xe0,0xa6,0x38,0xde,0xa3,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, + 0x82, + // /data/openpilot_release/selfdrive/assets/offroad/icon_wifi_strength_medium.svg + 0x0,0x0,0x6,0x7b, + 0x3c, + 0x73,0x76,0x67,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x36,0x38,0x22,0x20,0x68, + 0x65,0x69,0x67,0x68,0x74,0x3d,0x22,0x36,0x38,0x22,0x20,0x76,0x69,0x65,0x77,0x42, + 0x6f,0x78,0x3d,0x22,0x30,0x20,0x30,0x20,0x36,0x38,0x20,0x36,0x38,0x22,0x20,0x66, + 0x69,0x6c,0x6c,0x3d,0x22,0x6e,0x6f,0x6e,0x65,0x22,0x20,0x78,0x6d,0x6c,0x6e,0x73, + 0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,0x2e, + 0x6f,0x72,0x67,0x2f,0x32,0x30,0x30,0x30,0x2f,0x73,0x76,0x67,0x22,0x3e,0xa,0x3c, + 0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x33,0x34,0x2e,0x30,0x30,0x30,0x34, + 0x20,0x38,0x2e,0x36,0x33,0x35,0x39,0x39,0x43,0x32,0x31,0x2e,0x38,0x32,0x38,0x34, + 0x20,0x38,0x2e,0x36,0x33,0x35,0x39,0x39,0x20,0x31,0x30,0x2e,0x37,0x34,0x34,0x34, + 0x20,0x31,0x33,0x2e,0x32,0x36,0x20,0x32,0x2e,0x33,0x31,0x32,0x34,0x33,0x20,0x32, + 0x30,0x2e,0x38,0x30,0x38,0x43,0x31,0x2e,0x35,0x36,0x34,0x34,0x33,0x20,0x32,0x31, + 0x2e,0x34,0x38,0x38,0x20,0x31,0x2e,0x34,0x39,0x36,0x34,0x20,0x32,0x32,0x2e,0x36, + 0x34,0x34,0x20,0x32,0x2e,0x31,0x30,0x38,0x34,0x20,0x32,0x33,0x2e,0x33,0x39,0x32, + 0x4c,0x34,0x2e,0x37,0x36,0x30,0x34,0x31,0x20,0x32,0x36,0x2e,0x34,0x35,0x32,0x43, + 0x35,0x2e,0x34,0x34,0x30,0x34,0x31,0x20,0x32,0x37,0x2e,0x32,0x20,0x36,0x2e,0x35, + 0x39,0x36,0x34,0x31,0x20,0x32,0x37,0x2e,0x32,0x36,0x38,0x20,0x37,0x2e,0x33,0x34, + 0x34,0x34,0x31,0x20,0x32,0x36,0x2e,0x35,0x38,0x38,0x43,0x31,0x34,0x2e,0x34,0x31, + 0x36,0x34,0x20,0x32,0x30,0x2e,0x31,0x39,0x36,0x20,0x32,0x33,0x2e,0x37,0x33,0x32, + 0x34,0x20,0x31,0x36,0x2e,0x33,0x32,0x20,0x33,0x33,0x2e,0x39,0x33,0x32,0x34,0x20, + 0x31,0x36,0x2e,0x33,0x32,0x43,0x34,0x34,0x2e,0x31,0x33,0x32,0x34,0x20,0x31,0x36, + 0x2e,0x33,0x32,0x20,0x35,0x33,0x2e,0x34,0x34,0x38,0x34,0x20,0x32,0x30,0x2e,0x31, + 0x39,0x36,0x20,0x36,0x30,0x2e,0x35,0x32,0x30,0x34,0x20,0x32,0x36,0x2e,0x35,0x38, + 0x38,0x43,0x36,0x31,0x2e,0x32,0x36,0x38,0x34,0x20,0x32,0x37,0x2e,0x32,0x36,0x38, + 0x20,0x36,0x32,0x2e,0x34,0x32,0x34,0x34,0x20,0x32,0x37,0x2e,0x32,0x20,0x36,0x33, + 0x2e,0x31,0x30,0x34,0x34,0x20,0x32,0x36,0x2e,0x34,0x35,0x32,0x4c,0x36,0x35,0x2e, + 0x37,0x35,0x36,0x34,0x20,0x32,0x33,0x2e,0x33,0x39,0x32,0x43,0x36,0x36,0x2e,0x34, + 0x33,0x36,0x34,0x20,0x32,0x32,0x2e,0x36,0x34,0x34,0x20,0x36,0x36,0x2e,0x33,0x30, + 0x30,0x34,0x20,0x32,0x31,0x2e,0x34,0x38,0x38,0x20,0x36,0x35,0x2e,0x35,0x35,0x32, + 0x34,0x20,0x32,0x30,0x2e,0x38,0x30,0x38,0x43,0x35,0x37,0x2e,0x32,0x35,0x36,0x34, + 0x20,0x31,0x33,0x2e,0x32,0x36,0x20,0x34,0x36,0x2e,0x31,0x37,0x32,0x34,0x20,0x38, + 0x2e,0x36,0x33,0x35,0x39,0x39,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x34,0x20,0x38, + 0x2e,0x36,0x33,0x35,0x39,0x39,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x23, + 0x33,0x44,0x33,0x44,0x33,0x44,0x22,0x2f,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20, + 0x64,0x3d,0x22,0x4d,0x33,0x34,0x2e,0x30,0x30,0x30,0x34,0x20,0x32,0x32,0x2e,0x30, + 0x33,0x32,0x43,0x32,0x35,0x2e,0x31,0x36,0x30,0x34,0x20,0x32,0x32,0x2e,0x30,0x33, + 0x32,0x20,0x31,0x37,0x2e,0x30,0x36,0x38,0x34,0x20,0x32,0x35,0x2e,0x34,0x33,0x32, + 0x20,0x31,0x31,0x2e,0x30,0x31,0x36,0x34,0x20,0x33,0x30,0x2e,0x39,0x34,0x43,0x31, + 0x30,0x2e,0x32,0x36,0x38,0x34,0x20,0x33,0x31,0x2e,0x36,0x32,0x20,0x31,0x30,0x2e, + 0x32,0x30,0x30,0x34,0x20,0x33,0x32,0x2e,0x37,0x30,0x38,0x20,0x31,0x30,0x2e,0x38, + 0x38,0x30,0x34,0x20,0x33,0x33,0x2e,0x34,0x35,0x36,0x4c,0x31,0x33,0x2e,0x33,0x39, + 0x36,0x34,0x20,0x33,0x36,0x2e,0x33,0x38,0x43,0x31,0x34,0x2e,0x30,0x37,0x36,0x34, + 0x20,0x33,0x37,0x2e,0x31,0x39,0x36,0x20,0x31,0x35,0x2e,0x32,0x33,0x32,0x34,0x20, + 0x33,0x37,0x2e,0x31,0x39,0x36,0x20,0x31,0x36,0x2e,0x30,0x34,0x38,0x34,0x20,0x33, + 0x36,0x2e,0x35,0x31,0x36,0x43,0x32,0x30,0x2e,0x38,0x30,0x38,0x34,0x20,0x33,0x32, + 0x2e,0x31,0x36,0x34,0x20,0x32,0x37,0x2e,0x31,0x33,0x32,0x34,0x20,0x32,0x39,0x2e, + 0x35,0x31,0x32,0x20,0x33,0x34,0x2e,0x30,0x36,0x38,0x34,0x20,0x32,0x39,0x2e,0x35, + 0x31,0x32,0x43,0x34,0x31,0x2e,0x30,0x30,0x34,0x34,0x20,0x32,0x39,0x2e,0x35,0x31, + 0x32,0x20,0x34,0x37,0x2e,0x33,0x32,0x38,0x34,0x20,0x33,0x32,0x2e,0x31,0x36,0x34, + 0x20,0x35,0x32,0x2e,0x30,0x38,0x38,0x34,0x20,0x33,0x36,0x2e,0x35,0x31,0x36,0x43, + 0x35,0x32,0x2e,0x38,0x33,0x36,0x34,0x20,0x33,0x37,0x2e,0x31,0x39,0x36,0x20,0x35, + 0x34,0x2e,0x30,0x36,0x30,0x34,0x20,0x33,0x37,0x2e,0x31,0x39,0x36,0x20,0x35,0x34, + 0x2e,0x37,0x34,0x30,0x34,0x20,0x33,0x36,0x2e,0x33,0x38,0x4c,0x35,0x37,0x2e,0x32, + 0x35,0x36,0x34,0x20,0x33,0x33,0x2e,0x34,0x35,0x36,0x43,0x35,0x37,0x2e,0x38,0x36, + 0x38,0x34,0x20,0x33,0x32,0x2e,0x37,0x30,0x38,0x20,0x35,0x37,0x2e,0x38,0x36,0x38, + 0x34,0x20,0x33,0x31,0x2e,0x35,0x35,0x32,0x20,0x35,0x37,0x2e,0x31,0x32,0x30,0x34, + 0x20,0x33,0x30,0x2e,0x39,0x34,0x43,0x35,0x30,0x2e,0x39,0x33,0x32,0x34,0x20,0x32, + 0x35,0x2e,0x33,0x36,0x34,0x20,0x34,0x32,0x2e,0x38,0x34,0x30,0x34,0x20,0x32,0x32, + 0x2e,0x30,0x33,0x32,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x34,0x20,0x32,0x32,0x2e, + 0x30,0x33,0x32,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x23,0x33,0x44,0x33, + 0x44,0x33,0x44,0x22,0x2f,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22, + 0x4d,0x33,0x34,0x2e,0x30,0x30,0x30,0x37,0x20,0x33,0x35,0x2e,0x33,0x36,0x43,0x32, + 0x38,0x2e,0x34,0x32,0x34,0x37,0x20,0x33,0x35,0x2e,0x33,0x36,0x20,0x32,0x33,0x2e, + 0x33,0x39,0x32,0x37,0x20,0x33,0x37,0x2e,0x35,0x33,0x36,0x20,0x31,0x39,0x2e,0x36, + 0x35,0x32,0x37,0x20,0x34,0x31,0x2e,0x31,0x34,0x43,0x31,0x38,0x2e,0x39,0x37,0x32, + 0x37,0x20,0x34,0x31,0x2e,0x38,0x32,0x20,0x31,0x38,0x2e,0x39,0x30,0x34,0x37,0x20, + 0x34,0x32,0x2e,0x39,0x30,0x38,0x20,0x31,0x39,0x2e,0x35,0x38,0x34,0x37,0x20,0x34, + 0x33,0x2e,0x36,0x35,0x36,0x4c,0x32,0x31,0x2e,0x39,0x36,0x34,0x37,0x20,0x34,0x36, + 0x2e,0x34,0x34,0x34,0x43,0x32,0x32,0x2e,0x36,0x34,0x34,0x37,0x20,0x34,0x37,0x2e, + 0x32,0x36,0x20,0x32,0x33,0x2e,0x38,0x36,0x38,0x37,0x20,0x34,0x37,0x2e,0x32,0x36, + 0x20,0x32,0x34,0x2e,0x36,0x31,0x36,0x37,0x20,0x34,0x36,0x2e,0x35,0x38,0x43,0x32, + 0x37,0x2e,0x30,0x36,0x34,0x37,0x20,0x34,0x34,0x2e,0x32,0x20,0x33,0x30,0x2e,0x33, + 0x32,0x38,0x37,0x20,0x34,0x32,0x2e,0x37,0x37,0x32,0x20,0x33,0x34,0x2e,0x30,0x30, + 0x30,0x37,0x20,0x34,0x32,0x2e,0x37,0x37,0x32,0x43,0x33,0x37,0x2e,0x36,0x37,0x32, + 0x37,0x20,0x34,0x32,0x2e,0x37,0x37,0x32,0x20,0x34,0x30,0x2e,0x39,0x33,0x36,0x37, + 0x20,0x34,0x34,0x2e,0x32,0x20,0x34,0x33,0x2e,0x33,0x38,0x34,0x37,0x20,0x34,0x36, + 0x2e,0x35,0x38,0x43,0x34,0x34,0x2e,0x31,0x33,0x32,0x37,0x20,0x34,0x37,0x2e,0x33, + 0x32,0x38,0x20,0x34,0x35,0x2e,0x33,0x35,0x36,0x37,0x20,0x34,0x37,0x2e,0x32,0x36, + 0x20,0x34,0x36,0x2e,0x30,0x33,0x36,0x37,0x20,0x34,0x36,0x2e,0x34,0x34,0x34,0x4c, + 0x34,0x38,0x2e,0x34,0x31,0x36,0x37,0x20,0x34,0x33,0x2e,0x36,0x35,0x36,0x43,0x34, + 0x39,0x2e,0x30,0x32,0x38,0x37,0x20,0x34,0x32,0x2e,0x39,0x30,0x38,0x20,0x34,0x39, + 0x2e,0x30,0x32,0x38,0x37,0x20,0x34,0x31,0x2e,0x38,0x32,0x20,0x34,0x38,0x2e,0x33, + 0x34,0x38,0x37,0x20,0x34,0x31,0x2e,0x31,0x34,0x43,0x34,0x34,0x2e,0x36,0x30,0x38, + 0x37,0x20,0x33,0x37,0x2e,0x35,0x33,0x36,0x20,0x33,0x39,0x2e,0x35,0x37,0x36,0x37, + 0x20,0x33,0x35,0x2e,0x33,0x36,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x37,0x20,0x33, + 0x35,0x2e,0x33,0x36,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x77,0x68,0x69, + 0x74,0x65,0x22,0x2f,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d, + 0x33,0x34,0x2e,0x30,0x30,0x30,0x35,0x20,0x34,0x38,0x2e,0x36,0x38,0x38,0x43,0x33, + 0x31,0x2e,0x37,0x35,0x36,0x35,0x20,0x34,0x38,0x2e,0x36,0x38,0x38,0x20,0x32,0x39, + 0x2e,0x37,0x31,0x36,0x35,0x20,0x34,0x39,0x2e,0x37,0x30,0x38,0x20,0x32,0x38,0x2e, + 0x33,0x35,0x36,0x35,0x20,0x35,0x31,0x2e,0x33,0x34,0x43,0x32,0x37,0x2e,0x37,0x34, + 0x34,0x35,0x20,0x35,0x32,0x2e,0x30,0x32,0x20,0x32,0x37,0x2e,0x37,0x34,0x34,0x35, + 0x20,0x35,0x33,0x2e,0x30,0x34,0x20,0x32,0x38,0x2e,0x33,0x35,0x36,0x35,0x20,0x35, + 0x33,0x2e,0x37,0x32,0x4c,0x33,0x32,0x2e,0x36,0x34,0x30,0x35,0x20,0x35,0x38,0x2e, + 0x36,0x38,0x34,0x43,0x33,0x33,0x2e,0x33,0x38,0x38,0x35,0x20,0x35,0x39,0x2e,0x35, + 0x20,0x33,0x34,0x2e,0x36,0x38,0x30,0x34,0x20,0x35,0x39,0x2e,0x35,0x20,0x33,0x35, + 0x2e,0x34,0x32,0x38,0x34,0x20,0x35,0x38,0x2e,0x36,0x38,0x34,0x4c,0x33,0x39,0x2e, + 0x37,0x31,0x32,0x35,0x20,0x35,0x33,0x2e,0x37,0x32,0x43,0x34,0x30,0x2e,0x33,0x32, + 0x34,0x35,0x20,0x35,0x33,0x2e,0x30,0x34,0x20,0x34,0x30,0x2e,0x33,0x32,0x34,0x35, + 0x20,0x35,0x32,0x2e,0x30,0x32,0x20,0x33,0x39,0x2e,0x37,0x31,0x32,0x35,0x20,0x35, + 0x31,0x2e,0x33,0x34,0x43,0x33,0x38,0x2e,0x32,0x38,0x34,0x35,0x20,0x34,0x39,0x2e, + 0x37,0x30,0x38,0x20,0x33,0x36,0x2e,0x32,0x34,0x34,0x35,0x20,0x34,0x38,0x2e,0x36, + 0x38,0x38,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x35,0x20,0x34,0x38,0x2e,0x36,0x38, + 0x38,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x77,0x68,0x69,0x74,0x65,0x22, + 0x2f,0x3e,0xa,0x3c,0x2f,0x73,0x76,0x67,0x3e,0xa, + // /data/openpilot_release/selfdrive/assets/offroad/icon_checkmark.svg + 0x0,0x0,0x0,0xf3, + 0x3c, + 0x73,0x76,0x67,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x31,0x31,0x32,0x22,0x20, + 0x68,0x65,0x69,0x67,0x68,0x74,0x3d,0x22,0x38,0x30,0x22,0x20,0x76,0x69,0x65,0x77, + 0x42,0x6f,0x78,0x3d,0x22,0x30,0x20,0x30,0x20,0x35,0x36,0x20,0x34,0x30,0x22,0x20, + 0x66,0x69,0x6c,0x6c,0x3d,0x22,0x6e,0x6f,0x6e,0x65,0x22,0x20,0x78,0x6d,0x6c,0x6e, + 0x73,0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33, + 0x2e,0x6f,0x72,0x67,0x2f,0x32,0x30,0x30,0x30,0x2f,0x73,0x76,0x67,0x22,0x3e,0xa, + 0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x35,0x32,0x2e,0x33,0x20,0x34, + 0x4c,0x31,0x39,0x2e,0x38,0x20,0x33,0x35,0x2e,0x37,0x4c,0x34,0x20,0x31,0x39,0x2e, + 0x39,0x22,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x3d,0x22,0x77,0x68,0x69,0x74,0x65, + 0x22,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x2d,0x77,0x69,0x64,0x74,0x68,0x3d,0x22, + 0x37,0x22,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x2d,0x6d,0x69,0x74,0x65,0x72,0x6c, + 0x69,0x6d,0x69,0x74,0x3d,0x22,0x31,0x30,0x22,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65, + 0x2d,0x6c,0x69,0x6e,0x65,0x63,0x61,0x70,0x3d,0x22,0x72,0x6f,0x75,0x6e,0x64,0x22, + 0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x2d,0x6c,0x69,0x6e,0x65,0x6a,0x6f,0x69,0x6e, + 0x3d,0x22,0x72,0x6f,0x75,0x6e,0x64,0x22,0x2f,0x3e,0xa,0x3c,0x2f,0x73,0x76,0x67, + 0x3e,0xa, + // /data/openpilot_release/selfdrive/assets/offroad/icon_wifi_strength_low.svg + 0x0,0x0,0x6,0x7d, + 0x3c, + 0x73,0x76,0x67,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x36,0x38,0x22,0x20,0x68, + 0x65,0x69,0x67,0x68,0x74,0x3d,0x22,0x36,0x38,0x22,0x20,0x76,0x69,0x65,0x77,0x42, + 0x6f,0x78,0x3d,0x22,0x30,0x20,0x30,0x20,0x36,0x38,0x20,0x36,0x38,0x22,0x20,0x66, + 0x69,0x6c,0x6c,0x3d,0x22,0x6e,0x6f,0x6e,0x65,0x22,0x20,0x78,0x6d,0x6c,0x6e,0x73, + 0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,0x2e, + 0x6f,0x72,0x67,0x2f,0x32,0x30,0x30,0x30,0x2f,0x73,0x76,0x67,0x22,0x3e,0xa,0x3c, + 0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,0x33,0x34,0x2e,0x30,0x30,0x30,0x34, + 0x20,0x38,0x2e,0x36,0x33,0x35,0x39,0x39,0x43,0x32,0x31,0x2e,0x38,0x32,0x38,0x34, + 0x20,0x38,0x2e,0x36,0x33,0x35,0x39,0x39,0x20,0x31,0x30,0x2e,0x37,0x34,0x34,0x34, + 0x20,0x31,0x33,0x2e,0x32,0x36,0x20,0x32,0x2e,0x33,0x31,0x32,0x34,0x33,0x20,0x32, + 0x30,0x2e,0x38,0x30,0x38,0x43,0x31,0x2e,0x35,0x36,0x34,0x34,0x33,0x20,0x32,0x31, + 0x2e,0x34,0x38,0x38,0x20,0x31,0x2e,0x34,0x39,0x36,0x34,0x20,0x32,0x32,0x2e,0x36, + 0x34,0x34,0x20,0x32,0x2e,0x31,0x30,0x38,0x34,0x20,0x32,0x33,0x2e,0x33,0x39,0x32, + 0x4c,0x34,0x2e,0x37,0x36,0x30,0x34,0x31,0x20,0x32,0x36,0x2e,0x34,0x35,0x32,0x43, + 0x35,0x2e,0x34,0x34,0x30,0x34,0x31,0x20,0x32,0x37,0x2e,0x32,0x20,0x36,0x2e,0x35, + 0x39,0x36,0x34,0x31,0x20,0x32,0x37,0x2e,0x32,0x36,0x38,0x20,0x37,0x2e,0x33,0x34, + 0x34,0x34,0x31,0x20,0x32,0x36,0x2e,0x35,0x38,0x38,0x43,0x31,0x34,0x2e,0x34,0x31, + 0x36,0x34,0x20,0x32,0x30,0x2e,0x31,0x39,0x36,0x20,0x32,0x33,0x2e,0x37,0x33,0x32, + 0x34,0x20,0x31,0x36,0x2e,0x33,0x32,0x20,0x33,0x33,0x2e,0x39,0x33,0x32,0x34,0x20, + 0x31,0x36,0x2e,0x33,0x32,0x43,0x34,0x34,0x2e,0x31,0x33,0x32,0x34,0x20,0x31,0x36, + 0x2e,0x33,0x32,0x20,0x35,0x33,0x2e,0x34,0x34,0x38,0x34,0x20,0x32,0x30,0x2e,0x31, + 0x39,0x36,0x20,0x36,0x30,0x2e,0x35,0x32,0x30,0x34,0x20,0x32,0x36,0x2e,0x35,0x38, + 0x38,0x43,0x36,0x31,0x2e,0x32,0x36,0x38,0x34,0x20,0x32,0x37,0x2e,0x32,0x36,0x38, + 0x20,0x36,0x32,0x2e,0x34,0x32,0x34,0x34,0x20,0x32,0x37,0x2e,0x32,0x20,0x36,0x33, + 0x2e,0x31,0x30,0x34,0x34,0x20,0x32,0x36,0x2e,0x34,0x35,0x32,0x4c,0x36,0x35,0x2e, + 0x37,0x35,0x36,0x34,0x20,0x32,0x33,0x2e,0x33,0x39,0x32,0x43,0x36,0x36,0x2e,0x34, + 0x33,0x36,0x34,0x20,0x32,0x32,0x2e,0x36,0x34,0x34,0x20,0x36,0x36,0x2e,0x33,0x30, + 0x30,0x34,0x20,0x32,0x31,0x2e,0x34,0x38,0x38,0x20,0x36,0x35,0x2e,0x35,0x35,0x32, + 0x34,0x20,0x32,0x30,0x2e,0x38,0x30,0x38,0x43,0x35,0x37,0x2e,0x32,0x35,0x36,0x34, + 0x20,0x31,0x33,0x2e,0x32,0x36,0x20,0x34,0x36,0x2e,0x31,0x37,0x32,0x34,0x20,0x38, + 0x2e,0x36,0x33,0x35,0x39,0x39,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x34,0x20,0x38, + 0x2e,0x36,0x33,0x35,0x39,0x39,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x23, + 0x33,0x44,0x33,0x44,0x33,0x44,0x22,0x2f,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20, + 0x64,0x3d,0x22,0x4d,0x33,0x34,0x2e,0x30,0x30,0x30,0x34,0x20,0x32,0x32,0x2e,0x30, + 0x33,0x32,0x43,0x32,0x35,0x2e,0x31,0x36,0x30,0x34,0x20,0x32,0x32,0x2e,0x30,0x33, + 0x32,0x20,0x31,0x37,0x2e,0x30,0x36,0x38,0x34,0x20,0x32,0x35,0x2e,0x34,0x33,0x32, + 0x20,0x31,0x31,0x2e,0x30,0x31,0x36,0x34,0x20,0x33,0x30,0x2e,0x39,0x34,0x43,0x31, + 0x30,0x2e,0x32,0x36,0x38,0x34,0x20,0x33,0x31,0x2e,0x36,0x32,0x20,0x31,0x30,0x2e, + 0x32,0x30,0x30,0x34,0x20,0x33,0x32,0x2e,0x37,0x30,0x38,0x20,0x31,0x30,0x2e,0x38, + 0x38,0x30,0x34,0x20,0x33,0x33,0x2e,0x34,0x35,0x36,0x4c,0x31,0x33,0x2e,0x33,0x39, + 0x36,0x34,0x20,0x33,0x36,0x2e,0x33,0x38,0x43,0x31,0x34,0x2e,0x30,0x37,0x36,0x34, + 0x20,0x33,0x37,0x2e,0x31,0x39,0x36,0x20,0x31,0x35,0x2e,0x32,0x33,0x32,0x34,0x20, + 0x33,0x37,0x2e,0x31,0x39,0x36,0x20,0x31,0x36,0x2e,0x30,0x34,0x38,0x34,0x20,0x33, + 0x36,0x2e,0x35,0x31,0x36,0x43,0x32,0x30,0x2e,0x38,0x30,0x38,0x34,0x20,0x33,0x32, + 0x2e,0x31,0x36,0x34,0x20,0x32,0x37,0x2e,0x31,0x33,0x32,0x34,0x20,0x32,0x39,0x2e, + 0x35,0x31,0x32,0x20,0x33,0x34,0x2e,0x30,0x36,0x38,0x34,0x20,0x32,0x39,0x2e,0x35, + 0x31,0x32,0x43,0x34,0x31,0x2e,0x30,0x30,0x34,0x34,0x20,0x32,0x39,0x2e,0x35,0x31, + 0x32,0x20,0x34,0x37,0x2e,0x33,0x32,0x38,0x34,0x20,0x33,0x32,0x2e,0x31,0x36,0x34, + 0x20,0x35,0x32,0x2e,0x30,0x38,0x38,0x34,0x20,0x33,0x36,0x2e,0x35,0x31,0x36,0x43, + 0x35,0x32,0x2e,0x38,0x33,0x36,0x34,0x20,0x33,0x37,0x2e,0x31,0x39,0x36,0x20,0x35, + 0x34,0x2e,0x30,0x36,0x30,0x34,0x20,0x33,0x37,0x2e,0x31,0x39,0x36,0x20,0x35,0x34, + 0x2e,0x37,0x34,0x30,0x34,0x20,0x33,0x36,0x2e,0x33,0x38,0x4c,0x35,0x37,0x2e,0x32, + 0x35,0x36,0x34,0x20,0x33,0x33,0x2e,0x34,0x35,0x36,0x43,0x35,0x37,0x2e,0x38,0x36, + 0x38,0x34,0x20,0x33,0x32,0x2e,0x37,0x30,0x38,0x20,0x35,0x37,0x2e,0x38,0x36,0x38, + 0x34,0x20,0x33,0x31,0x2e,0x35,0x35,0x32,0x20,0x35,0x37,0x2e,0x31,0x32,0x30,0x34, + 0x20,0x33,0x30,0x2e,0x39,0x34,0x43,0x35,0x30,0x2e,0x39,0x33,0x32,0x34,0x20,0x32, + 0x35,0x2e,0x33,0x36,0x34,0x20,0x34,0x32,0x2e,0x38,0x34,0x30,0x34,0x20,0x32,0x32, + 0x2e,0x30,0x33,0x32,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x34,0x20,0x32,0x32,0x2e, + 0x30,0x33,0x32,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x23,0x33,0x44,0x33, + 0x44,0x33,0x44,0x22,0x2f,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22, + 0x4d,0x33,0x34,0x2e,0x30,0x30,0x30,0x37,0x20,0x33,0x35,0x2e,0x33,0x36,0x43,0x32, + 0x38,0x2e,0x34,0x32,0x34,0x37,0x20,0x33,0x35,0x2e,0x33,0x36,0x20,0x32,0x33,0x2e, + 0x33,0x39,0x32,0x37,0x20,0x33,0x37,0x2e,0x35,0x33,0x36,0x20,0x31,0x39,0x2e,0x36, + 0x35,0x32,0x37,0x20,0x34,0x31,0x2e,0x31,0x34,0x43,0x31,0x38,0x2e,0x39,0x37,0x32, + 0x37,0x20,0x34,0x31,0x2e,0x38,0x32,0x20,0x31,0x38,0x2e,0x39,0x30,0x34,0x37,0x20, + 0x34,0x32,0x2e,0x39,0x30,0x38,0x20,0x31,0x39,0x2e,0x35,0x38,0x34,0x37,0x20,0x34, + 0x33,0x2e,0x36,0x35,0x36,0x4c,0x32,0x31,0x2e,0x39,0x36,0x34,0x37,0x20,0x34,0x36, + 0x2e,0x34,0x34,0x34,0x43,0x32,0x32,0x2e,0x36,0x34,0x34,0x37,0x20,0x34,0x37,0x2e, + 0x32,0x36,0x20,0x32,0x33,0x2e,0x38,0x36,0x38,0x37,0x20,0x34,0x37,0x2e,0x32,0x36, + 0x20,0x32,0x34,0x2e,0x36,0x31,0x36,0x37,0x20,0x34,0x36,0x2e,0x35,0x38,0x43,0x32, + 0x37,0x2e,0x30,0x36,0x34,0x37,0x20,0x34,0x34,0x2e,0x32,0x20,0x33,0x30,0x2e,0x33, + 0x32,0x38,0x37,0x20,0x34,0x32,0x2e,0x37,0x37,0x32,0x20,0x33,0x34,0x2e,0x30,0x30, + 0x30,0x37,0x20,0x34,0x32,0x2e,0x37,0x37,0x32,0x43,0x33,0x37,0x2e,0x36,0x37,0x32, + 0x37,0x20,0x34,0x32,0x2e,0x37,0x37,0x32,0x20,0x34,0x30,0x2e,0x39,0x33,0x36,0x37, + 0x20,0x34,0x34,0x2e,0x32,0x20,0x34,0x33,0x2e,0x33,0x38,0x34,0x37,0x20,0x34,0x36, + 0x2e,0x35,0x38,0x43,0x34,0x34,0x2e,0x31,0x33,0x32,0x37,0x20,0x34,0x37,0x2e,0x33, + 0x32,0x38,0x20,0x34,0x35,0x2e,0x33,0x35,0x36,0x37,0x20,0x34,0x37,0x2e,0x32,0x36, + 0x20,0x34,0x36,0x2e,0x30,0x33,0x36,0x37,0x20,0x34,0x36,0x2e,0x34,0x34,0x34,0x4c, + 0x34,0x38,0x2e,0x34,0x31,0x36,0x37,0x20,0x34,0x33,0x2e,0x36,0x35,0x36,0x43,0x34, + 0x39,0x2e,0x30,0x32,0x38,0x37,0x20,0x34,0x32,0x2e,0x39,0x30,0x38,0x20,0x34,0x39, + 0x2e,0x30,0x32,0x38,0x37,0x20,0x34,0x31,0x2e,0x38,0x32,0x20,0x34,0x38,0x2e,0x33, + 0x34,0x38,0x37,0x20,0x34,0x31,0x2e,0x31,0x34,0x43,0x34,0x34,0x2e,0x36,0x30,0x38, + 0x37,0x20,0x33,0x37,0x2e,0x35,0x33,0x36,0x20,0x33,0x39,0x2e,0x35,0x37,0x36,0x37, + 0x20,0x33,0x35,0x2e,0x33,0x36,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x37,0x20,0x33, + 0x35,0x2e,0x33,0x36,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x23,0x33,0x44, + 0x33,0x44,0x33,0x44,0x22,0x2f,0x3e,0xa,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d, + 0x22,0x4d,0x33,0x34,0x2e,0x30,0x30,0x30,0x35,0x20,0x34,0x38,0x2e,0x36,0x38,0x38, + 0x43,0x33,0x31,0x2e,0x37,0x35,0x36,0x35,0x20,0x34,0x38,0x2e,0x36,0x38,0x38,0x20, + 0x32,0x39,0x2e,0x37,0x31,0x36,0x35,0x20,0x34,0x39,0x2e,0x37,0x30,0x38,0x20,0x32, + 0x38,0x2e,0x33,0x35,0x36,0x35,0x20,0x35,0x31,0x2e,0x33,0x34,0x43,0x32,0x37,0x2e, + 0x37,0x34,0x34,0x35,0x20,0x35,0x32,0x2e,0x30,0x32,0x20,0x32,0x37,0x2e,0x37,0x34, + 0x34,0x35,0x20,0x35,0x33,0x2e,0x30,0x34,0x20,0x32,0x38,0x2e,0x33,0x35,0x36,0x35, + 0x20,0x35,0x33,0x2e,0x37,0x32,0x4c,0x33,0x32,0x2e,0x36,0x34,0x30,0x35,0x20,0x35, + 0x38,0x2e,0x36,0x38,0x34,0x43,0x33,0x33,0x2e,0x33,0x38,0x38,0x35,0x20,0x35,0x39, + 0x2e,0x35,0x20,0x33,0x34,0x2e,0x36,0x38,0x30,0x34,0x20,0x35,0x39,0x2e,0x35,0x20, + 0x33,0x35,0x2e,0x34,0x32,0x38,0x34,0x20,0x35,0x38,0x2e,0x36,0x38,0x34,0x4c,0x33, + 0x39,0x2e,0x37,0x31,0x32,0x35,0x20,0x35,0x33,0x2e,0x37,0x32,0x43,0x34,0x30,0x2e, + 0x33,0x32,0x34,0x35,0x20,0x35,0x33,0x2e,0x30,0x34,0x20,0x34,0x30,0x2e,0x33,0x32, + 0x34,0x35,0x20,0x35,0x32,0x2e,0x30,0x32,0x20,0x33,0x39,0x2e,0x37,0x31,0x32,0x35, + 0x20,0x35,0x31,0x2e,0x33,0x34,0x43,0x33,0x38,0x2e,0x32,0x38,0x34,0x35,0x20,0x34, + 0x39,0x2e,0x37,0x30,0x38,0x20,0x33,0x36,0x2e,0x32,0x34,0x34,0x35,0x20,0x34,0x38, + 0x2e,0x36,0x38,0x38,0x20,0x33,0x34,0x2e,0x30,0x30,0x30,0x35,0x20,0x34,0x38,0x2e, + 0x36,0x38,0x38,0x5a,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22,0x77,0x68,0x69,0x74, + 0x65,0x22,0x2f,0x3e,0xa,0x3c,0x2f,0x73,0x76,0x67,0x3e,0xa, + +}; + +static const unsigned char qt_resource_name[] = { + // offroad + 0x0,0x7, + 0x5,0xcd,0x95,0x94, + 0x0,0x6f, + 0x0,0x66,0x0,0x66,0x0,0x72,0x0,0x6f,0x0,0x61,0x0,0x64, + // img_eye_open.svg + 0x0,0x10, + 0xd,0x42,0x31,0x47, + 0x0,0x69, + 0x0,0x6d,0x0,0x67,0x0,0x5f,0x0,0x65,0x0,0x79,0x0,0x65,0x0,0x5f,0x0,0x6f,0x0,0x70,0x0,0x65,0x0,0x6e,0x0,0x2e,0x0,0x73,0x0,0x76,0x0,0x67, + // icons + 0x0,0x5, + 0x0,0x6f,0xa6,0x53, + 0x0,0x69, + 0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x73, + // img_circled_slash.svg + 0x0,0x15, + 0x8,0x84,0x22,0xe7, + 0x0,0x69, + 0x0,0x6d,0x0,0x67,0x0,0x5f,0x0,0x63,0x0,0x69,0x0,0x72,0x0,0x63,0x0,0x6c,0x0,0x65,0x0,0x64,0x0,0x5f,0x0,0x73,0x0,0x6c,0x0,0x61,0x0,0x73,0x0,0x68, + 0x0,0x2e,0x0,0x73,0x0,0x76,0x0,0x67, + // img_continue_triangle.svg + 0x0,0x19, + 0x8,0xe,0x2,0xa7, + 0x0,0x69, + 0x0,0x6d,0x0,0x67,0x0,0x5f,0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x74,0x0,0x69,0x0,0x6e,0x0,0x75,0x0,0x65,0x0,0x5f,0x0,0x74,0x0,0x72,0x0,0x69,0x0,0x61, + 0x0,0x6e,0x0,0x67,0x0,0x6c,0x0,0x65,0x0,0x2e,0x0,0x73,0x0,0x76,0x0,0x67, + // img_circled_check.svg + 0x0,0x15, + 0xb,0x85,0x4d,0x67, + 0x0,0x69, + 0x0,0x6d,0x0,0x67,0x0,0x5f,0x0,0x63,0x0,0x69,0x0,0x72,0x0,0x63,0x0,0x6c,0x0,0x65,0x0,0x64,0x0,0x5f,0x0,0x63,0x0,0x68,0x0,0x65,0x0,0x63,0x0,0x6b, + 0x0,0x2e,0x0,0x73,0x0,0x76,0x0,0x67, + // img_eye_closed.svg + 0x0,0x12, + 0xa,0xd3,0xcb,0x7, + 0x0,0x69, + 0x0,0x6d,0x0,0x67,0x0,0x5f,0x0,0x65,0x0,0x79,0x0,0x65,0x0,0x5f,0x0,0x63,0x0,0x6c,0x0,0x6f,0x0,0x73,0x0,0x65,0x0,0x64,0x0,0x2e,0x0,0x73,0x0,0x76, + 0x0,0x67, + // close.svg + 0x0,0x9, + 0x6,0x98,0x8e,0xa7, + 0x0,0x63, + 0x0,0x6c,0x0,0x6f,0x0,0x73,0x0,0x65,0x0,0x2e,0x0,0x73,0x0,0x76,0x0,0x67, + // icon_lock_closed.svg + 0x0,0x14, + 0x4,0xd,0xa6,0xa7, + 0x0,0x69, + 0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x5f,0x0,0x6c,0x0,0x6f,0x0,0x63,0x0,0x6b,0x0,0x5f,0x0,0x63,0x0,0x6c,0x0,0x6f,0x0,0x73,0x0,0x65,0x0,0x64,0x0,0x2e, + 0x0,0x73,0x0,0x76,0x0,0x67, + // icon_wifi_strength_high.svg + 0x0,0x1b, + 0x9,0x94,0xf6,0x7, + 0x0,0x69, + 0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x5f,0x0,0x77,0x0,0x69,0x0,0x66,0x0,0x69,0x0,0x5f,0x0,0x73,0x0,0x74,0x0,0x72,0x0,0x65,0x0,0x6e,0x0,0x67,0x0,0x74, + 0x0,0x68,0x0,0x5f,0x0,0x68,0x0,0x69,0x0,0x67,0x0,0x68,0x0,0x2e,0x0,0x73,0x0,0x76,0x0,0x67, + // icon_wifi_strength_full.svg + 0x0,0x1b, + 0xe,0x60,0xf6,0x67, + 0x0,0x69, + 0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x5f,0x0,0x77,0x0,0x69,0x0,0x66,0x0,0x69,0x0,0x5f,0x0,0x73,0x0,0x74,0x0,0x72,0x0,0x65,0x0,0x6e,0x0,0x67,0x0,0x74, + 0x0,0x68,0x0,0x5f,0x0,0x66,0x0,0x75,0x0,0x6c,0x0,0x6c,0x0,0x2e,0x0,0x73,0x0,0x76,0x0,0x67, + // icon_warning.png + 0x0,0x10, + 0x8,0x8a,0xac,0x47, + 0x0,0x69, + 0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x5f,0x0,0x77,0x0,0x61,0x0,0x72,0x0,0x6e,0x0,0x69,0x0,0x6e,0x0,0x67,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // icon_wifi_strength_medium.svg + 0x0,0x1d, + 0xf,0xf,0x21,0x27, + 0x0,0x69, + 0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x5f,0x0,0x77,0x0,0x69,0x0,0x66,0x0,0x69,0x0,0x5f,0x0,0x73,0x0,0x74,0x0,0x72,0x0,0x65,0x0,0x6e,0x0,0x67,0x0,0x74, + 0x0,0x68,0x0,0x5f,0x0,0x6d,0x0,0x65,0x0,0x64,0x0,0x69,0x0,0x75,0x0,0x6d,0x0,0x2e,0x0,0x73,0x0,0x76,0x0,0x67, + // icon_checkmark.svg + 0x0,0x12, + 0x0,0xb4,0x8f,0xe7, + 0x0,0x69, + 0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x5f,0x0,0x63,0x0,0x68,0x0,0x65,0x0,0x63,0x0,0x6b,0x0,0x6d,0x0,0x61,0x0,0x72,0x0,0x6b,0x0,0x2e,0x0,0x73,0x0,0x76, + 0x0,0x67, + // icon_wifi_strength_low.svg + 0x0,0x1a, + 0xb,0xe,0xa1,0xe7, + 0x0,0x69, + 0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x5f,0x0,0x77,0x0,0x69,0x0,0x66,0x0,0x69,0x0,0x5f,0x0,0x73,0x0,0x74,0x0,0x72,0x0,0x65,0x0,0x6e,0x0,0x67,0x0,0x74, + 0x0,0x68,0x0,0x5f,0x0,0x6c,0x0,0x6f,0x0,0x77,0x0,0x2e,0x0,0x73,0x0,0x76,0x0,0x67, + +}; + +static const unsigned char qt_resource_struct[] = { + // : + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x7,0x0,0x0,0x0,0x1, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + // :/icons + 0x0,0x0,0x0,0x3a,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xf, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + // :/offroad + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x7,0x0,0x0,0x0,0x8, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + // :/img_continue_triangle.svg + 0x0,0x0,0x0,0x7a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x4,0x57, +0x0,0x0,0x1,0x7f,0xb7,0x40,0x31,0x72, + // :/img_circled_slash.svg + 0x0,0x0,0x0,0x4a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x3,0xb, +0x0,0x0,0x1,0x7f,0xb7,0x40,0x31,0x72, + // :/img_eye_closed.svg + 0x0,0x0,0x0,0xe2,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x6,0xdb, +0x0,0x0,0x1,0x7f,0xb7,0x40,0x31,0x72, + // :/img_circled_check.svg + 0x0,0x0,0x0,0xb2,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x5,0x20, +0x0,0x0,0x1,0x7f,0xb7,0x40,0x31,0x71, + // :/img_eye_open.svg + 0x0,0x0,0x0,0x14,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, +0x0,0x0,0x1,0x7f,0xb7,0x40,0x31,0x72, + // :/offroad/icon_checkmark.svg + 0x0,0x0,0x2,0x30,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x43,0xcd, +0x0,0x0,0x1,0x7f,0xb7,0x40,0x31,0x75, + // :/offroad/icon_lock_closed.svg + 0x0,0x0,0x1,0x24,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xe,0x30, +0x0,0x0,0x1,0x7f,0xb7,0x40,0x31,0x76, + // :/offroad/icon_warning.png + 0x0,0x0,0x1,0xca,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1e,0x8, +0x0,0x0,0x1,0x7f,0xb7,0x40,0x31,0x7b, + // :/offroad/icon_wifi_strength_high.svg + 0x0,0x0,0x1,0x52,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x11,0x10, +0x0,0x0,0x1,0x7f,0xb7,0x40,0x31,0x7b, + // :/offroad/icon_wifi_strength_low.svg + 0x0,0x0,0x2,0x5a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x44,0xc4, +0x0,0x0,0x1,0x7f,0xb7,0x40,0x31,0x7b, + // :/offroad/icon_wifi_strength_full.svg + 0x0,0x0,0x1,0x8e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x17,0x8d, +0x0,0x0,0x1,0x7f,0xb7,0x40,0x31,0x7b, + // :/offroad/icon_wifi_strength_medium.svg + 0x0,0x0,0x1,0xf0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x3d,0x4e, +0x0,0x0,0x1,0x7f,0xb7,0x40,0x31,0x7b, + // :/icons/close.svg + 0x0,0x0,0x1,0xc,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xc,0xb1, +0x0,0x0,0x1,0x7f,0xb7,0x40,0x31,0x70, + +}; + +#ifdef QT_NAMESPACE +# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name +# define QT_RCC_MANGLE_NAMESPACE0(x) x +# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b +# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b) +# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \ + QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE)) +#else +# define QT_RCC_PREPEND_NAMESPACE(name) name +# define QT_RCC_MANGLE_NAMESPACE(name) name +#endif + +#ifdef QT_NAMESPACE +namespace QT_NAMESPACE { +#endif + +bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); + +bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); + +#ifdef QT_NAMESPACE +} +#endif + +int QT_RCC_MANGLE_NAMESPACE(qInitResources)(); +int QT_RCC_MANGLE_NAMESPACE(qInitResources)() +{ + QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData) + (0x2, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); +int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)() +{ + QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData) + (0x2, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +namespace { + struct initializer { + initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources)(); } + ~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); } + } dummy; +} diff --git a/selfdrive/assets/assets.qrc b/selfdrive/assets/assets.qrc new file mode 100644 index 000000000..39be41aa6 --- /dev/null +++ b/selfdrive/assets/assets.qrc @@ -0,0 +1,17 @@ + + + img_continue_triangle.svg + img_circled_check.svg + img_circled_slash.svg + img_eye_open.svg + img_eye_closed.svg + icons/close.svg + offroad/icon_lock_closed.svg + offroad/icon_checkmark.svg + offroad/icon_warning.png + offroad/icon_wifi_strength_low.svg + offroad/icon_wifi_strength_medium.svg + offroad/icon_wifi_strength_high.svg + offroad/icon_wifi_strength_full.svg + + diff --git a/selfdrive/assets/fonts/Inter-Black.ttf b/selfdrive/assets/fonts/Inter-Black.ttf new file mode 100644 index 000000000..565375773 Binary files /dev/null and b/selfdrive/assets/fonts/Inter-Black.ttf differ diff --git a/selfdrive/assets/fonts/Inter-Bold.ttf b/selfdrive/assets/fonts/Inter-Bold.ttf new file mode 100644 index 000000000..e98b84ce8 Binary files /dev/null and b/selfdrive/assets/fonts/Inter-Bold.ttf differ diff --git a/selfdrive/assets/fonts/Inter-ExtraBold.ttf b/selfdrive/assets/fonts/Inter-ExtraBold.ttf new file mode 100644 index 000000000..7f16a0f0f Binary files /dev/null and b/selfdrive/assets/fonts/Inter-ExtraBold.ttf differ diff --git a/selfdrive/assets/fonts/Inter-ExtraLight.ttf b/selfdrive/assets/fonts/Inter-ExtraLight.ttf new file mode 100644 index 000000000..69426a3eb Binary files /dev/null and b/selfdrive/assets/fonts/Inter-ExtraLight.ttf differ diff --git a/selfdrive/assets/fonts/Inter-Light.ttf b/selfdrive/assets/fonts/Inter-Light.ttf new file mode 100644 index 000000000..a5f073690 Binary files /dev/null and b/selfdrive/assets/fonts/Inter-Light.ttf differ diff --git a/selfdrive/assets/fonts/Inter-Medium.ttf b/selfdrive/assets/fonts/Inter-Medium.ttf new file mode 100644 index 000000000..721147d83 Binary files /dev/null and b/selfdrive/assets/fonts/Inter-Medium.ttf differ diff --git a/selfdrive/assets/fonts/Inter-Regular.ttf b/selfdrive/assets/fonts/Inter-Regular.ttf new file mode 100644 index 000000000..96fd6a12d Binary files /dev/null and b/selfdrive/assets/fonts/Inter-Regular.ttf differ diff --git a/selfdrive/assets/fonts/Inter-SemiBold.ttf b/selfdrive/assets/fonts/Inter-SemiBold.ttf new file mode 100644 index 000000000..ddb279290 Binary files /dev/null and b/selfdrive/assets/fonts/Inter-SemiBold.ttf differ diff --git a/selfdrive/assets/fonts/Inter-Thin.ttf b/selfdrive/assets/fonts/Inter-Thin.ttf new file mode 100644 index 000000000..76be6252b Binary files /dev/null and b/selfdrive/assets/fonts/Inter-Thin.ttf differ diff --git a/selfdrive/assets/fonts/opensans_bold.ttf b/selfdrive/assets/fonts/opensans_bold.ttf new file mode 100644 index 000000000..7b5294560 Binary files /dev/null and b/selfdrive/assets/fonts/opensans_bold.ttf differ diff --git a/selfdrive/assets/fonts/opensans_regular.ttf b/selfdrive/assets/fonts/opensans_regular.ttf new file mode 100644 index 000000000..2e31d0242 Binary files /dev/null and b/selfdrive/assets/fonts/opensans_regular.ttf differ diff --git a/selfdrive/assets/fonts/opensans_semibold.ttf b/selfdrive/assets/fonts/opensans_semibold.ttf new file mode 100644 index 000000000..99db86aa0 Binary files /dev/null and b/selfdrive/assets/fonts/opensans_semibold.ttf differ diff --git a/selfdrive/assets/icons/close.svg b/selfdrive/assets/icons/close.svg new file mode 100644 index 000000000..b1e6d3b86 --- /dev/null +++ b/selfdrive/assets/icons/close.svg @@ -0,0 +1,4 @@ + + + + diff --git a/selfdrive/assets/images/button_home.png b/selfdrive/assets/images/button_home.png new file mode 100644 index 000000000..9f52faf9e Binary files /dev/null and b/selfdrive/assets/images/button_home.png differ diff --git a/selfdrive/assets/images/button_settings.png b/selfdrive/assets/images/button_settings.png new file mode 100644 index 000000000..e04262b88 Binary files /dev/null and b/selfdrive/assets/images/button_settings.png differ diff --git a/selfdrive/assets/images/triangle.svg b/selfdrive/assets/images/triangle.svg new file mode 100644 index 000000000..9320269bd --- /dev/null +++ b/selfdrive/assets/images/triangle.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/selfdrive/assets/img_chffr_wheel.png b/selfdrive/assets/img_chffr_wheel.png new file mode 100644 index 000000000..3f09a35a7 Binary files /dev/null and b/selfdrive/assets/img_chffr_wheel.png differ diff --git a/selfdrive/assets/img_circled_check.svg b/selfdrive/assets/img_circled_check.svg new file mode 100644 index 000000000..27c37395b --- /dev/null +++ b/selfdrive/assets/img_circled_check.svg @@ -0,0 +1,4 @@ + + + + diff --git a/selfdrive/assets/img_circled_slash.svg b/selfdrive/assets/img_circled_slash.svg new file mode 100644 index 000000000..b10a3938d --- /dev/null +++ b/selfdrive/assets/img_circled_slash.svg @@ -0,0 +1,4 @@ + + + + diff --git a/selfdrive/assets/img_continue_triangle.svg b/selfdrive/assets/img_continue_triangle.svg new file mode 100644 index 000000000..20f9e45dc --- /dev/null +++ b/selfdrive/assets/img_continue_triangle.svg @@ -0,0 +1,3 @@ + + + diff --git a/selfdrive/assets/img_driver_face.png b/selfdrive/assets/img_driver_face.png new file mode 100644 index 000000000..ddde478cd Binary files /dev/null and b/selfdrive/assets/img_driver_face.png differ diff --git a/selfdrive/assets/img_eye_closed.svg b/selfdrive/assets/img_eye_closed.svg new file mode 100644 index 000000000..91b229e91 --- /dev/null +++ b/selfdrive/assets/img_eye_closed.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/selfdrive/assets/img_eye_open.svg b/selfdrive/assets/img_eye_open.svg new file mode 100644 index 000000000..ea6e41ac5 --- /dev/null +++ b/selfdrive/assets/img_eye_open.svg @@ -0,0 +1,4 @@ + + + + diff --git a/selfdrive/assets/img_map.png b/selfdrive/assets/img_map.png new file mode 100644 index 000000000..8bdae4d7d Binary files /dev/null and b/selfdrive/assets/img_map.png differ diff --git a/selfdrive/assets/img_spinner_comma.png b/selfdrive/assets/img_spinner_comma.png new file mode 100644 index 000000000..4a196e784 Binary files /dev/null and b/selfdrive/assets/img_spinner_comma.png differ diff --git a/selfdrive/assets/img_spinner_track.png b/selfdrive/assets/img_spinner_track.png new file mode 100644 index 000000000..931c17e83 Binary files /dev/null and b/selfdrive/assets/img_spinner_track.png differ diff --git a/selfdrive/assets/offroad/fcc.html b/selfdrive/assets/offroad/fcc.html new file mode 100644 index 000000000..793bea533 --- /dev/null +++ b/selfdrive/assets/offroad/fcc.html @@ -0,0 +1,56 @@ + + +

    Supplier's Declaration of Conformity: 47 CFR § 2.1077 Compliance Information

    + +

    Unique Identifier

    +

    comma three

    + +

    Authorized Components

    + +
    Thundersoft TurboX D845 SOM
    +

    FCC ID: 2AOHHTURBOXSOMD845

    + +
    Quectel/EG25-G
    +

    FCC ID: XMR201903EG25G

    +

    + This device complies with Part 15 of the FCC Rules. + Operation is subject to the following two conditions: + +

    (1) this device may not cause harmful interference, and +

    (2) this device must accept any interference received, including interference that may cause undesired operation.

    + + The following test reports are subject to this declaration: + Test report number: HR20191001605 + Issue date: 2019-2-21 + + The following manufacturer/importer/entity (located in the USA) is responsible for this declaration: + Company name: Quectel Wireless Solutions Co., Ltd. + Name/Title (legal representative): Yin JiXiong + Address: 7th Floor, Hongye Building, No.1801 Hongmei Road, Xuhui District, Shanghai 200233, China + Phone: +8602150086326 Extension: 800 + Fax: +862153253668 + E-mail: johnny.xiang@quectel.com +

    + +

    Responsible Party - U.S. Contact Information

    +

    comma.ai

    +

    501 W Broadway St

    +

    STE A #403

    +

    San Diego, California

    +

    92101

    +

    United States

    +

    support@comma.ai

    + +

    FCC Compliance Statement

    +

    This device complies with part 15 of the FCC Rules. Operation is subject to the following two conditions: (1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. Note: This equipment has been tested and found to comply with the limits for a Class B digital device, pursuant to part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference in a residential installation.

    +

    This equipment generates, uses, and can radiate radio frequency energy and, if not installed and used in accordance with the instructions, may cause harmful interference to radio communications. However, there is no guarantee that interference will not occur in a particular installation.

    +

    If this equipment does cause harmful interference to radio or television reception, which can be determined by turning the equipment off and on, the user is encouraged to try to correct the interference by one or more of the following measures:

    +

    Reorient or relocate the receiving antenna.

    +

    Increase the separation between the equipment and receiver.

    +

    Connect the equipment to an outlet on a circuit different from that to which the receiver is connected.

    +

    Consult the dealer or an experienced radio/TV technician for help.

    +

    Changes or modifications to this product not expressly approved by the party responsible for compliance could void the electromagnetic compatibility (EMC) and wireless compliance and negate your authority to operate the product.

    +

    This product has demonstrated EMC compliance under conditions that included the use of compliant peripheral devices and shielded cables between system components. It is important that you use compliant peripheral devices and shielded cables between system components to reduce the possibility of causing interference to radios, televisions, and other electronic devices.

    +

    The radiated output power of this device meets the limits of FCC/IC radio frequency exposure limits. This device should be operated with a minimum separation distance of 20 cm (8 inches) between the equipment and a person's body.

    + + diff --git a/selfdrive/assets/offroad/icon_calibration.png b/selfdrive/assets/offroad/icon_calibration.png new file mode 100644 index 000000000..c4ee0d63d Binary files /dev/null and b/selfdrive/assets/offroad/icon_calibration.png differ diff --git a/selfdrive/assets/offroad/icon_checkmark.svg b/selfdrive/assets/offroad/icon_checkmark.svg new file mode 100644 index 000000000..b024eccd9 --- /dev/null +++ b/selfdrive/assets/offroad/icon_checkmark.svg @@ -0,0 +1,3 @@ + + + diff --git a/selfdrive/assets/offroad/icon_chevron_right.png b/selfdrive/assets/offroad/icon_chevron_right.png new file mode 100644 index 000000000..a3aaa7648 Binary files /dev/null and b/selfdrive/assets/offroad/icon_chevron_right.png differ diff --git a/selfdrive/assets/offroad/icon_close.svg b/selfdrive/assets/offroad/icon_close.svg new file mode 100644 index 000000000..4c063371a --- /dev/null +++ b/selfdrive/assets/offroad/icon_close.svg @@ -0,0 +1,4 @@ + + + + diff --git a/selfdrive/assets/offroad/icon_lock_closed.svg b/selfdrive/assets/offroad/icon_lock_closed.svg new file mode 100644 index 000000000..7dc9283c8 --- /dev/null +++ b/selfdrive/assets/offroad/icon_lock_closed.svg @@ -0,0 +1,4 @@ + + + + diff --git a/selfdrive/assets/offroad/icon_map.png b/selfdrive/assets/offroad/icon_map.png new file mode 100644 index 000000000..21dd0bacc Binary files /dev/null and b/selfdrive/assets/offroad/icon_map.png differ diff --git a/selfdrive/assets/offroad/icon_map_speed.png b/selfdrive/assets/offroad/icon_map_speed.png new file mode 100644 index 000000000..1eeab8460 Binary files /dev/null and b/selfdrive/assets/offroad/icon_map_speed.png differ diff --git a/selfdrive/assets/offroad/icon_menu.png b/selfdrive/assets/offroad/icon_menu.png new file mode 100644 index 000000000..837cf5831 Binary files /dev/null and b/selfdrive/assets/offroad/icon_menu.png differ diff --git a/selfdrive/assets/offroad/icon_metric.png b/selfdrive/assets/offroad/icon_metric.png new file mode 100644 index 000000000..eaa2438fa Binary files /dev/null and b/selfdrive/assets/offroad/icon_metric.png differ diff --git a/selfdrive/assets/offroad/icon_minus.png b/selfdrive/assets/offroad/icon_minus.png new file mode 100644 index 000000000..e5327c0d3 Binary files /dev/null and b/selfdrive/assets/offroad/icon_minus.png differ diff --git a/selfdrive/assets/offroad/icon_monitoring.png b/selfdrive/assets/offroad/icon_monitoring.png new file mode 100644 index 000000000..05f78811e Binary files /dev/null and b/selfdrive/assets/offroad/icon_monitoring.png differ diff --git a/selfdrive/assets/offroad/icon_network.png b/selfdrive/assets/offroad/icon_network.png new file mode 100644 index 000000000..3236924f4 Binary files /dev/null and b/selfdrive/assets/offroad/icon_network.png differ diff --git a/selfdrive/assets/offroad/icon_openpilot.png b/selfdrive/assets/offroad/icon_openpilot.png new file mode 100644 index 000000000..0a90a8791 Binary files /dev/null and b/selfdrive/assets/offroad/icon_openpilot.png differ diff --git a/selfdrive/assets/offroad/icon_openpilot_mirrored.png b/selfdrive/assets/offroad/icon_openpilot_mirrored.png new file mode 100644 index 000000000..23a7d5a55 Binary files /dev/null and b/selfdrive/assets/offroad/icon_openpilot_mirrored.png differ diff --git a/selfdrive/assets/offroad/icon_plus.png b/selfdrive/assets/offroad/icon_plus.png new file mode 100644 index 000000000..92b448b0b Binary files /dev/null and b/selfdrive/assets/offroad/icon_plus.png differ diff --git a/selfdrive/assets/offroad/icon_road.png b/selfdrive/assets/offroad/icon_road.png new file mode 100644 index 000000000..5868ed1cc Binary files /dev/null and b/selfdrive/assets/offroad/icon_road.png differ diff --git a/selfdrive/assets/offroad/icon_settings.png b/selfdrive/assets/offroad/icon_settings.png new file mode 100644 index 000000000..d0c90a620 Binary files /dev/null and b/selfdrive/assets/offroad/icon_settings.png differ diff --git a/selfdrive/assets/offroad/icon_shell.png b/selfdrive/assets/offroad/icon_shell.png new file mode 100644 index 000000000..f1d655416 Binary files /dev/null and b/selfdrive/assets/offroad/icon_shell.png differ diff --git a/selfdrive/assets/offroad/icon_speed_limit.png b/selfdrive/assets/offroad/icon_speed_limit.png new file mode 100644 index 000000000..0aa7038f9 Binary files /dev/null and b/selfdrive/assets/offroad/icon_speed_limit.png differ diff --git a/selfdrive/assets/offroad/icon_warning.png b/selfdrive/assets/offroad/icon_warning.png new file mode 100644 index 000000000..50fe82112 Binary files /dev/null and b/selfdrive/assets/offroad/icon_warning.png differ diff --git a/selfdrive/assets/offroad/icon_wifi_strength_full.svg b/selfdrive/assets/offroad/icon_wifi_strength_full.svg new file mode 100644 index 000000000..758198e97 --- /dev/null +++ b/selfdrive/assets/offroad/icon_wifi_strength_full.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/selfdrive/assets/offroad/icon_wifi_strength_high.svg b/selfdrive/assets/offroad/icon_wifi_strength_high.svg new file mode 100644 index 000000000..a8db07f91 --- /dev/null +++ b/selfdrive/assets/offroad/icon_wifi_strength_high.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/selfdrive/assets/offroad/icon_wifi_strength_low.svg b/selfdrive/assets/offroad/icon_wifi_strength_low.svg new file mode 100644 index 000000000..8963c3dbc --- /dev/null +++ b/selfdrive/assets/offroad/icon_wifi_strength_low.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/selfdrive/assets/offroad/icon_wifi_strength_medium.svg b/selfdrive/assets/offroad/icon_wifi_strength_medium.svg new file mode 100644 index 000000000..8f8d50326 --- /dev/null +++ b/selfdrive/assets/offroad/icon_wifi_strength_medium.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/selfdrive/assets/offroad/tc.html b/selfdrive/assets/offroad/tc.html new file mode 100644 index 000000000..f88daf08f --- /dev/null +++ b/selfdrive/assets/offroad/tc.html @@ -0,0 +1,44 @@ + + + + + openpilot Terms of Service + + + + +

    The Terms and Conditions below are effective for all users

    +

    Last Updated on October 18, 2019

    +

    Please read these Terms of Use (“Terms”) carefully before using openpilot which is open-sourced software developed by Comma.ai, Inc., a corporation organized under the laws of Delaware (“comma,” “us,” “we,” or “our”).

    +

    Before using and by accessing openpilot, you indicate that you have read, understood, and agree to these Terms. These Terms apply to all users and others who access or use openpilot. If others use openpilot through your user account or vehicle, you are responsible to ensure that they only use openpilot when it is safe to do so, and in compliance with these Terms and with applicable law. If you disagree with any part of the Terms, you should not access or use openpilot.

    +

    Communications

    +

    You agree that comma may contact you by email or telephone in connection with openpilot or for other business purposes. You may opt out of receiving email messages at any time by contacting us at support@comma.ai.

    +

    We collect, use, and share information from and about you and your vehicle in connection with openpilot. You consent to comma accessing the systems associated with openpilot, without additional notice or consent, for the purposes of providing openpilot, data collection, software updates, safety and cybersecurity, suspension or removal of your account, and as disclosed in the Privacy Policy (available at https://connect.comma.ai/privacy).

    +

    Safety

    +

    openpilot performs the functions of Adaptive Cruise Control (ACC) and Lane Keeping Assist System (LKAS) designed for use in compatible motor vehicles. While using openpilot, it is your responsibility to obey all laws, traffic rules, and traffic regulations governing your vehicle and its operation. Access to and use of openpilot is at your own risk and responsibility, and openpilot should be accessed and/or used only when you can do so safely.

    +

    openpilot does not make your vehicle “autonomous” or capable of operation without the active monitoring of a licensed driver. It is designed to assist a licensed driver. A licensed driver must pay attention to the road, remain aware of navigation at all times, and be prepared to take immediate action. Failure to do so can cause damage, injury, or death.

    +

    Supported Locations and Models

    +

    openpilot is compatible only with particular makes and models of vehicles. For a complete list of currently supported vehicles, visit https://comma.ai. openpilot will not function properly when installed in an incompatible vehicle. openpilot is compatible only within the geographical boundaries of the United States of America.

    +

    Indemnification

    +

    To the maximum extent allowable by law, you agree to defend, indemnify and hold harmless comma, and its employees, partners, suppliers, contractors, investors, agents, officers, directors, and affiliates, from and against any and all claims, damages, causes of action, penalties, interest, demands, obligations, losses, liabilities, costs or debt, additional taxes, and expenses (including but not limited to attorneys’ fees), resulting from or arising out of (i) your use and access of, or inability to use or access, openpilot, (ii) your breach of these Terms, (iii) the inaccuracy of any information, representation or warranty made by you, (iv) activities of anyone other than you in connection with openpilot conducted through your comma device or account, (v) any other of your activities under or in connection with these Terms or openpilot.

    +

    Limitation of Liability

    +

    In no event shall comma, nor its directors, employees, partners, agents, suppliers, or affiliates, be liable for any indirect, incidental, special, consequential or punitive damages, including without limitation, loss of profits, data, use, goodwill, or other intangible losses, resulting from (i) your access to or use of or inability to access or use of the Software; or (ii) any conduct or content of any third party on the Software whether based on warranty, contract, tort (including negligence) or any other legal theory, whether or not we have been informed of the possibility of such damage, and even if a remedy set forth herein is found to have failed of its essential purpose.

    +

    No Warranty or Obligations to Maintain or Service

    +

    comma provides openpilot without representations, conditions, or warranties of any kind. openpilot is provided on an “AS IS” and “AS AVAILABLE” basis, including with all faults and errors as may occur. To the extent permitted by law and unless prohibited by law, comma on behalf of itself and all persons and parties acting by, through, or for comma, explicitly disclaims all warranties or conditions, express, implied, or collateral, including any implied warranties of merchantability, satisfactory quality, and fitness for a particular purpose in respect of openpilot.

    +

    To the extent permitted by law, comma does not warrant the operation, performance, or availability of openpilot under all conditions. comma is not responsible for any failures caused by server errors, misdirected or redirected transmissions, failed internet connections, interruptions or failures in the transmission of data, any computer virus, or any acts or omissions of third parties that damage the network or impair wireless service.

    +

    We undertake reasonable measures to preserve and secure information collected through our openpilot. However, no data collection, transmission or storage system is 100% secure, and there is always a risk that your information may be intercepted without our consent. In using openpilot, you acknowledge that comma is not responsible for intercepted information, and you hereby release us from any and all claims arising out of or related to the use of intercepted information in any unauthorized manner.

    +

    By providing openpilot, comma does not transfer or license its intellectual property or grant rights in its brand names, nor does comma make representations with respect to third-party intellectual property rights.

    +

    We are not obligated to provide any maintenance or support for openpilot, technical or otherwise. If we voluntarily provide any maintenance or support for openpilot, we may stop any such maintenance, support, or services at any time in our sole discretion.

    +

    Modification of Software

    +

    In no event shall comma, nor its directors, employees, partners, agents, suppliers, or affiliates, be liable if you choose to modify the software.

    +

    Changes

    +

    We reserve the right, at our sole discretion, to modify or replace these Terms at any time. If a revision is material we will provide at least 15 days’ notice prior to any new terms taking effect. What constitutes a material change will be determined at our sole discretion.

    +

    By continuing to access or use our Software after any revisions become effective, you agree to be bound by the revised terms. If you do not agree to the new terms, you are no longer authorized to use the Software.

    +

    Contact Us

    +

    If you have any questions about these Terms, please contact us at support@comma.ai.

    + + diff --git a/selfdrive/assets/sounds/disengage.wav b/selfdrive/assets/sounds/disengage.wav new file mode 100644 index 000000000..ba583c41f Binary files /dev/null and b/selfdrive/assets/sounds/disengage.wav differ diff --git a/selfdrive/assets/sounds/engage.wav b/selfdrive/assets/sounds/engage.wav new file mode 100644 index 000000000..41e9b2d58 Binary files /dev/null and b/selfdrive/assets/sounds/engage.wav differ diff --git a/selfdrive/assets/sounds/prompt.wav b/selfdrive/assets/sounds/prompt.wav new file mode 100644 index 000000000..420e9fabe Binary files /dev/null and b/selfdrive/assets/sounds/prompt.wav differ diff --git a/selfdrive/assets/sounds/prompt_distracted.wav b/selfdrive/assets/sounds/prompt_distracted.wav new file mode 100644 index 000000000..c3d4475ca Binary files /dev/null and b/selfdrive/assets/sounds/prompt_distracted.wav differ diff --git a/selfdrive/assets/sounds/refuse.wav b/selfdrive/assets/sounds/refuse.wav new file mode 100644 index 000000000..0e80f7d12 Binary files /dev/null and b/selfdrive/assets/sounds/refuse.wav differ diff --git a/selfdrive/assets/sounds/warning_immediate.wav b/selfdrive/assets/sounds/warning_immediate.wav new file mode 100644 index 000000000..9f6f672e2 Binary files /dev/null and b/selfdrive/assets/sounds/warning_immediate.wav differ diff --git a/selfdrive/assets/sounds/warning_soft.wav b/selfdrive/assets/sounds/warning_soft.wav new file mode 100644 index 000000000..261c7e137 Binary files /dev/null and b/selfdrive/assets/sounds/warning_soft.wav differ diff --git a/selfdrive/assets/training/step0.png b/selfdrive/assets/training/step0.png new file mode 100644 index 000000000..8ea90610d Binary files /dev/null and b/selfdrive/assets/training/step0.png differ diff --git a/selfdrive/assets/training/step1.png b/selfdrive/assets/training/step1.png new file mode 100644 index 000000000..22a629bea Binary files /dev/null and b/selfdrive/assets/training/step1.png differ diff --git a/selfdrive/assets/training/step10.png b/selfdrive/assets/training/step10.png new file mode 100644 index 000000000..96390aa32 Binary files /dev/null and b/selfdrive/assets/training/step10.png differ diff --git a/selfdrive/assets/training/step11.png b/selfdrive/assets/training/step11.png new file mode 100644 index 000000000..94342a4b5 Binary files /dev/null and b/selfdrive/assets/training/step11.png differ diff --git a/selfdrive/assets/training/step12.png b/selfdrive/assets/training/step12.png new file mode 100644 index 000000000..8b2b01af2 Binary files /dev/null and b/selfdrive/assets/training/step12.png differ diff --git a/selfdrive/assets/training/step13.png b/selfdrive/assets/training/step13.png new file mode 100644 index 000000000..6593b93d7 Binary files /dev/null and b/selfdrive/assets/training/step13.png differ diff --git a/selfdrive/assets/training/step14.png b/selfdrive/assets/training/step14.png new file mode 100644 index 000000000..1cb8fb992 Binary files /dev/null and b/selfdrive/assets/training/step14.png differ diff --git a/selfdrive/assets/training/step15.png b/selfdrive/assets/training/step15.png new file mode 100644 index 000000000..b4c0841b7 Binary files /dev/null and b/selfdrive/assets/training/step15.png differ diff --git a/selfdrive/assets/training/step16.png b/selfdrive/assets/training/step16.png new file mode 100644 index 000000000..d8518b10b Binary files /dev/null and b/selfdrive/assets/training/step16.png differ diff --git a/selfdrive/assets/training/step17.png b/selfdrive/assets/training/step17.png new file mode 100644 index 000000000..a9ab91269 Binary files /dev/null and b/selfdrive/assets/training/step17.png differ diff --git a/selfdrive/assets/training/step18.png b/selfdrive/assets/training/step18.png new file mode 100644 index 000000000..a5d8833a3 Binary files /dev/null and b/selfdrive/assets/training/step18.png differ diff --git a/selfdrive/assets/training/step2.png b/selfdrive/assets/training/step2.png new file mode 100644 index 000000000..03a45f8de Binary files /dev/null and b/selfdrive/assets/training/step2.png differ diff --git a/selfdrive/assets/training/step3.png b/selfdrive/assets/training/step3.png new file mode 100644 index 000000000..0712678ac Binary files /dev/null and b/selfdrive/assets/training/step3.png differ diff --git a/selfdrive/assets/training/step4.png b/selfdrive/assets/training/step4.png new file mode 100644 index 000000000..60a99310f Binary files /dev/null and b/selfdrive/assets/training/step4.png differ diff --git a/selfdrive/assets/training/step5.png b/selfdrive/assets/training/step5.png new file mode 100644 index 000000000..54aa049dd Binary files /dev/null and b/selfdrive/assets/training/step5.png differ diff --git a/selfdrive/assets/training/step6.png b/selfdrive/assets/training/step6.png new file mode 100644 index 000000000..80cbb0a55 Binary files /dev/null and b/selfdrive/assets/training/step6.png differ diff --git a/selfdrive/assets/training/step7.png b/selfdrive/assets/training/step7.png new file mode 100644 index 000000000..e5e403df2 Binary files /dev/null and b/selfdrive/assets/training/step7.png differ diff --git a/selfdrive/assets/training/step8.png b/selfdrive/assets/training/step8.png new file mode 100644 index 000000000..d5193ae33 Binary files /dev/null and b/selfdrive/assets/training/step8.png differ diff --git a/selfdrive/assets/training/step9.png b/selfdrive/assets/training/step9.png new file mode 100644 index 000000000..10dadc2ae Binary files /dev/null and b/selfdrive/assets/training/step9.png differ diff --git a/selfdrive/athena/__init__.py b/selfdrive/athena/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/athena/athenad.py b/selfdrive/athena/athenad.py new file mode 100755 index 000000000..f34ef1900 --- /dev/null +++ b/selfdrive/athena/athenad.py @@ -0,0 +1,727 @@ +#!/usr/bin/env python3 +import base64 +import hashlib +import io +import json +import os +import queue +import random +import select +import socket +import subprocess +import sys +import tempfile +import threading +import time +from collections import namedtuple +from datetime import datetime +from functools import partial +from typing import Any, Dict + +import requests +from jsonrpc import JSONRPCResponseManager, dispatcher +from websocket import (ABNF, WebSocketException, WebSocketTimeoutException, + create_connection) + +import cereal.messaging as messaging +from cereal import log +from cereal.services import service_list +from common.api import Api +from common.basedir import PERSIST +from common.file_helpers import CallbackReader +from common.params import Params +from common.realtime import sec_since_boot +from selfdrive.hardware import HARDWARE, PC, TICI +from selfdrive.loggerd.config import ROOT +from selfdrive.loggerd.xattr_cache import getxattr, setxattr +from selfdrive.statsd import STATS_DIR +from selfdrive.swaglog import SWAGLOG_DIR, cloudlog +from selfdrive.version import get_commit, get_origin, get_short_branch, get_version + +ATHENA_HOST = os.getenv('ATHENA_HOST', 'wss://athena.comma.ai') +HANDLER_THREADS = int(os.getenv('HANDLER_THREADS', "4")) +LOCAL_PORT_WHITELIST = {8022} + +LOG_ATTR_NAME = 'user.upload' +LOG_ATTR_VALUE_MAX_UNIX_TIME = int.to_bytes(2147483647, 4, sys.byteorder) +RECONNECT_TIMEOUT_S = 70 + +RETRY_DELAY = 10 # seconds +MAX_RETRY_COUNT = 30 # Try for at most 5 minutes if upload fails immediately +MAX_AGE = 31 * 24 * 3600 # seconds +WS_FRAME_SIZE = 4096 + +NetworkType = log.DeviceState.NetworkType + +dispatcher["echo"] = lambda s: s +recv_queue: Any = queue.Queue() +send_queue: Any = queue.Queue() +upload_queue: Any = queue.Queue() +low_priority_send_queue: Any = queue.Queue() +log_recv_queue: Any = queue.Queue() +cancelled_uploads: Any = set() +UploadItem = namedtuple('UploadItem', ['path', 'url', 'headers', 'created_at', 'id', 'retry_count', 'current', 'progress', 'allow_cellular'], defaults=(0, False, 0, False)) + +cur_upload_items: Dict[int, Any] = {} + +class AbortTransferException(Exception): + pass + + +class UploadQueueCache(): + params = Params() + + @staticmethod + def initialize(upload_queue): + try: + upload_queue_json = UploadQueueCache.params.get("AthenadUploadQueue") + if upload_queue_json is not None: + for item in json.loads(upload_queue_json): + upload_queue.put(UploadItem(**item)) + except Exception: + cloudlog.exception("athena.UploadQueueCache.initialize.exception") + + @staticmethod + def cache(upload_queue): + try: + items = [i._asdict() for i in upload_queue.queue if i.id not in cancelled_uploads] + UploadQueueCache.params.put("AthenadUploadQueue", json.dumps(items)) + except Exception: + cloudlog.exception("athena.UploadQueueCache.cache.exception") + + +def handle_long_poll(ws): + end_event = threading.Event() + + threads = [ + threading.Thread(target=ws_recv, args=(ws, end_event), name='ws_recv'), + threading.Thread(target=ws_send, args=(ws, end_event), name='ws_send'), + threading.Thread(target=upload_handler, args=(end_event,), name='upload_handler'), + threading.Thread(target=log_handler, args=(end_event,), name='log_handler'), + threading.Thread(target=stat_handler, args=(end_event,), name='stat_handler'), + ] + [ + threading.Thread(target=jsonrpc_handler, args=(end_event,), name=f'worker_{x}') + for x in range(HANDLER_THREADS) + ] + + for thread in threads: + thread.start() + try: + while not end_event.is_set(): + time.sleep(0.1) + except (KeyboardInterrupt, SystemExit): + end_event.set() + raise + finally: + for thread in threads: + cloudlog.debug(f"athena.joining {thread.name}") + thread.join() + + +def jsonrpc_handler(end_event): + dispatcher["startLocalProxy"] = partial(startLocalProxy, end_event) + while not end_event.is_set(): + try: + data = recv_queue.get(timeout=1) + if "method" in data: + cloudlog.debug(f"athena.jsonrpc_handler.call_method {data}") + response = JSONRPCResponseManager.handle(data, dispatcher) + send_queue.put_nowait(response.json) + elif "id" in data and ("result" in data or "error" in data): + log_recv_queue.put_nowait(data) + else: + raise Exception("not a valid request or response") + except queue.Empty: + pass + except Exception as e: + cloudlog.exception("athena jsonrpc handler failed") + send_queue.put_nowait(json.dumps({"error": str(e)})) + + +def retry_upload(tid: int, end_event: threading.Event, increase_count: bool = True) -> None: + if cur_upload_items[tid].retry_count < MAX_RETRY_COUNT: + item = cur_upload_items[tid] + new_retry_count = item.retry_count + 1 if increase_count else item.retry_count + + item = item._replace( + retry_count=new_retry_count, + progress=0, + current=False + ) + upload_queue.put_nowait(item) + UploadQueueCache.cache(upload_queue) + + cur_upload_items[tid] = None + + for _ in range(RETRY_DELAY): + time.sleep(1) + if end_event.is_set(): + break + + +def upload_handler(end_event: threading.Event) -> None: + sm = messaging.SubMaster(['deviceState']) + tid = threading.get_ident() + + while not end_event.is_set(): + cur_upload_items[tid] = None + + try: + cur_upload_items[tid] = upload_queue.get(timeout=1)._replace(current=True) + + if cur_upload_items[tid].id in cancelled_uploads: + cancelled_uploads.remove(cur_upload_items[tid].id) + continue + + # Remove item if too old + age = datetime.now() - datetime.fromtimestamp(cur_upload_items[tid].created_at / 1000) + if age.total_seconds() > MAX_AGE: + cloudlog.event("athena.upload_handler.expired", item=cur_upload_items[tid], error=True) + continue + + # Check if uploading over cell is allowed + sm.update(0) + cell = sm['deviceState'].networkType not in [NetworkType.wifi, NetworkType.ethernet] + if cell and (not cur_upload_items[tid].allow_cellular): + retry_upload(tid, end_event, False) + continue + + try: + def cb(sz, cur): + # Abort transfer if connection changed to cell after starting upload + sm.update(0) + cell = sm['deviceState'].networkType not in [NetworkType.wifi, NetworkType.ethernet] + if cell and (not cur_upload_items[tid].allow_cellular): + raise AbortTransferException + + cur_upload_items[tid] = cur_upload_items[tid]._replace(progress=cur / sz if sz else 1) + + + network_type = sm['deviceState'].networkType.raw + fn = cur_upload_items[tid].path + try: + sz = os.path.getsize(fn) + except OSError: + sz = -1 + + cloudlog.event("athena.upload_handler.upload_start", fn=fn, sz=sz, network_type=network_type) + response = _do_upload(cur_upload_items[tid], cb) + + if response.status_code not in (200, 201, 403, 412): + cloudlog.event("athena.upload_handler.retry", status_code=response.status_code, fn=fn, sz=sz, network_type=network_type) + retry_upload(tid, end_event) + else: + cloudlog.event("athena.upload_handler.success", fn=fn, sz=sz, network_type=network_type) + + UploadQueueCache.cache(upload_queue) + except (requests.exceptions.Timeout, requests.exceptions.ConnectionError, requests.exceptions.SSLError): + cloudlog.event("athena.upload_handler.timeout", fn=fn, sz=sz, network_type=network_type) + retry_upload(tid, end_event) + except AbortTransferException: + cloudlog.event("athena.upload_handler.abort", fn=fn, sz=sz, network_type=network_type) + retry_upload(tid, end_event, False) + + except queue.Empty: + pass + except Exception: + cloudlog.exception("athena.upload_handler.exception") + + +def _do_upload(upload_item, callback=None): + with open(upload_item.path, "rb") as f: + size = os.fstat(f.fileno()).st_size + + if callback: + f = CallbackReader(f, callback, size) + + return requests.put(upload_item.url, + data=f, + headers={**upload_item.headers, 'Content-Length': str(size)}, + timeout=30) + + +# security: user should be able to request any message from their car +@dispatcher.add_method +def getMessage(service=None, timeout=1000): + if service is None or service not in service_list: + raise Exception("invalid service") + + socket = messaging.sub_sock(service, timeout=timeout) + ret = messaging.recv_one(socket) + + if ret is None: + raise TimeoutError + + return ret.to_dict() + + +@dispatcher.add_method +def getVersion(): + return { + "version": get_version(), + "remote": get_origin(), + "branch": get_short_branch(), + "commit": get_commit(), + } + + +@dispatcher.add_method +def setNavDestination(latitude=0, longitude=0, place_name=None, place_details=None): + destination = { + "latitude": latitude, + "longitude": longitude, + "place_name": place_name, + "place_details": place_details, + } + Params().put("NavDestination", json.dumps(destination)) + + return {"success": 1} + + +def scan_dir(path, prefix): + files = list() + # only walk directories that match the prefix + # (glob and friends traverse entire dir tree) + with os.scandir(path) as i: + for e in i: + rel_path = os.path.relpath(e.path, ROOT) + if e.is_dir(follow_symlinks=False): + # add trailing slash + rel_path = os.path.join(rel_path, '') + # if prefix is a partial dir name, current dir will start with prefix + # if prefix is a partial file name, prefix with start with dir name + if rel_path.startswith(prefix) or prefix.startswith(rel_path): + files.extend(scan_dir(e.path, prefix)) + else: + if rel_path.startswith(prefix): + files.append(rel_path) + return files + +@dispatcher.add_method +def listDataDirectory(prefix=''): + return scan_dir(ROOT, prefix) + + +@dispatcher.add_method +def reboot(): + sock = messaging.sub_sock("deviceState", timeout=1000) + ret = messaging.recv_one(sock) + if ret is None or ret.deviceState.started: + raise Exception("Reboot unavailable") + + def do_reboot(): + time.sleep(2) + HARDWARE.reboot() + + threading.Thread(target=do_reboot).start() + + return {"success": 1} + + +@dispatcher.add_method +def uploadFileToUrl(fn, url, headers): + return uploadFilesToUrls([{ + "fn": fn, + "url": url, + "headers": headers, + }]) + + +@dispatcher.add_method +def uploadFilesToUrls(files_data): + items = [] + failed = [] + for file in files_data: + fn = file.get('fn', '') + if len(fn) == 0 or fn[0] == '/' or '..' in fn or 'url' not in file: + failed.append(fn) + continue + path = os.path.join(ROOT, fn) + if not os.path.exists(path): + failed.append(fn) + continue + + item = UploadItem( + path=path, + url=file['url'], + headers=file.get('headers', {}), + created_at=int(time.time() * 1000), + id=None, + allow_cellular=file.get('allow_cellular', False), + ) + upload_id = hashlib.sha1(str(item).encode()).hexdigest() + item = item._replace(id=upload_id) + upload_queue.put_nowait(item) + items.append(item._asdict()) + + UploadQueueCache.cache(upload_queue) + + resp = {"enqueued": len(items), "items": items} + if failed: + resp["failed"] = failed + + return resp + + +@dispatcher.add_method +def listUploadQueue(): + items = list(upload_queue.queue) + list(cur_upload_items.values()) + return [i._asdict() for i in items if (i is not None) and (i.id not in cancelled_uploads)] + + +@dispatcher.add_method +def cancelUpload(upload_id): + if not isinstance(upload_id, list): + upload_id = [upload_id] + + uploading_ids = {item.id for item in list(upload_queue.queue)} + cancelled_ids = uploading_ids.intersection(upload_id) + if len(cancelled_ids) == 0: + return 404 + + cancelled_uploads.update(cancelled_ids) + return {"success": 1} + + +@dispatcher.add_method +def primeActivated(activated): + return {"success": 1} + + +@dispatcher.add_method +def setBandwithLimit(upload_speed_kbps, download_speed_kbps): + if not TICI: + return {"success": 0, "error": "only supported on comma three"} + + try: + HARDWARE.set_bandwidth_limit(upload_speed_kbps, download_speed_kbps) + return {"success": 1} + except subprocess.CalledProcessError as e: + return {"success": 0, "error": "failed to set limit", "stdout": e.stdout, "stderr": e.stderr} + + +def startLocalProxy(global_end_event, remote_ws_uri, local_port): + try: + if local_port not in LOCAL_PORT_WHITELIST: + raise Exception("Requested local port not whitelisted") + + cloudlog.debug("athena.startLocalProxy.starting") + + dongle_id = Params().get("DongleId").decode('utf8') + identity_token = Api(dongle_id).get_token() + ws = create_connection(remote_ws_uri, + cookie="jwt=" + identity_token, + enable_multithread=True) + + ssock, csock = socket.socketpair() + local_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + local_sock.connect(('127.0.0.1', local_port)) + local_sock.setblocking(0) + + proxy_end_event = threading.Event() + threads = [ + threading.Thread(target=ws_proxy_recv, args=(ws, local_sock, ssock, proxy_end_event, global_end_event)), + threading.Thread(target=ws_proxy_send, args=(ws, local_sock, csock, proxy_end_event)) + ] + for thread in threads: + thread.start() + + cloudlog.debug("athena.startLocalProxy.started") + return {"success": 1} + except Exception as e: + cloudlog.exception("athenad.startLocalProxy.exception") + raise e + + +@dispatcher.add_method +def getPublicKey(): + if not os.path.isfile(PERSIST + '/comma/id_rsa.pub'): + return None + + with open(PERSIST + '/comma/id_rsa.pub') as f: + return f.read() + + +@dispatcher.add_method +def getSshAuthorizedKeys(): + return Params().get("GithubSshKeys", encoding='utf8') or '' + + +@dispatcher.add_method +def getSimInfo(): + return HARDWARE.get_sim_info() + + +@dispatcher.add_method +def getNetworkType(): + return HARDWARE.get_network_type() + + +@dispatcher.add_method +def getNetworks(): + return HARDWARE.get_networks() + + +@dispatcher.add_method +def takeSnapshot(): + from selfdrive.camerad.snapshot.snapshot import jpeg_write, snapshot + ret = snapshot() + if ret is not None: + def b64jpeg(x): + if x is not None: + f = io.BytesIO() + jpeg_write(f, x) + return base64.b64encode(f.getvalue()).decode("utf-8") + else: + return None + return {'jpegBack': b64jpeg(ret[0]), + 'jpegFront': b64jpeg(ret[1])} + else: + raise Exception("not available while camerad is started") + + +def get_logs_to_send_sorted(): + # TODO: scan once then use inotify to detect file creation/deletion + curr_time = int(time.time()) + logs = [] + for log_entry in os.listdir(SWAGLOG_DIR): + log_path = os.path.join(SWAGLOG_DIR, log_entry) + try: + time_sent = int.from_bytes(getxattr(log_path, LOG_ATTR_NAME), sys.byteorder) + except (ValueError, TypeError): + time_sent = 0 + # assume send failed and we lost the response if sent more than one hour ago + if not time_sent or curr_time - time_sent > 3600: + logs.append(log_entry) + # excluding most recent (active) log file + return sorted(logs)[:-1] + + +def log_handler(end_event): + if PC: + return + + log_files = [] + last_scan = 0 + while not end_event.is_set(): + try: + curr_scan = sec_since_boot() + if curr_scan - last_scan > 10: + log_files = get_logs_to_send_sorted() + last_scan = curr_scan + + # send one log + curr_log = None + if len(log_files) > 0: + log_entry = log_files.pop() # newest log file + cloudlog.debug(f"athena.log_handler.forward_request {log_entry}") + try: + curr_time = int(time.time()) + log_path = os.path.join(SWAGLOG_DIR, log_entry) + setxattr(log_path, LOG_ATTR_NAME, int.to_bytes(curr_time, 4, sys.byteorder)) + with open(log_path) as f: + jsonrpc = { + "method": "forwardLogs", + "params": { + "logs": f.read() + }, + "jsonrpc": "2.0", + "id": log_entry + } + low_priority_send_queue.put_nowait(json.dumps(jsonrpc)) + curr_log = log_entry + except OSError: + pass # file could be deleted by log rotation + + # wait for response up to ~100 seconds + # always read queue at least once to process any old responses that arrive + for _ in range(100): + if end_event.is_set(): + break + try: + log_resp = json.loads(log_recv_queue.get(timeout=1)) + log_entry = log_resp.get("id") + log_success = "result" in log_resp and log_resp["result"].get("success") + cloudlog.debug(f"athena.log_handler.forward_response {log_entry} {log_success}") + if log_entry and log_success: + log_path = os.path.join(SWAGLOG_DIR, log_entry) + try: + setxattr(log_path, LOG_ATTR_NAME, LOG_ATTR_VALUE_MAX_UNIX_TIME) + except OSError: + pass # file could be deleted by log rotation + if curr_log == log_entry: + break + except queue.Empty: + if curr_log is None: + break + + except Exception: + cloudlog.exception("athena.log_handler.exception") + + +def stat_handler(end_event): + while not end_event.is_set(): + last_scan = 0 + curr_scan = sec_since_boot() + try: + if curr_scan - last_scan > 10: + stat_filenames = list(filter(lambda name: not name.startswith(tempfile.gettempprefix()), os.listdir(STATS_DIR))) + if len(stat_filenames) > 0: + stat_path = os.path.join(STATS_DIR, stat_filenames[0]) + with open(stat_path) as f: + jsonrpc = { + "method": "storeStats", + "params": { + "stats": f.read() + }, + "jsonrpc": "2.0", + "id": stat_filenames[0] + } + low_priority_send_queue.put_nowait(json.dumps(jsonrpc)) + os.remove(stat_path) + last_scan = curr_scan + except Exception: + cloudlog.exception("athena.stat_handler.exception") + time.sleep(0.1) + + +def ws_proxy_recv(ws, local_sock, ssock, end_event, global_end_event): + while not (end_event.is_set() or global_end_event.is_set()): + try: + data = ws.recv() + local_sock.sendall(data) + except WebSocketTimeoutException: + pass + except Exception: + cloudlog.exception("athenad.ws_proxy_recv.exception") + break + + cloudlog.debug("athena.ws_proxy_recv closing sockets") + ssock.close() + local_sock.close() + cloudlog.debug("athena.ws_proxy_recv done closing sockets") + + end_event.set() + + +def ws_proxy_send(ws, local_sock, signal_sock, end_event): + while not end_event.is_set(): + try: + r, _, _ = select.select((local_sock, signal_sock), (), ()) + if r: + if r[0].fileno() == signal_sock.fileno(): + # got end signal from ws_proxy_recv + end_event.set() + break + data = local_sock.recv(4096) + if not data: + # local_sock is dead + end_event.set() + break + + ws.send(data, ABNF.OPCODE_BINARY) + except Exception: + cloudlog.exception("athenad.ws_proxy_send.exception") + end_event.set() + + cloudlog.debug("athena.ws_proxy_send closing sockets") + signal_sock.close() + cloudlog.debug("athena.ws_proxy_send done closing sockets") + + +def ws_recv(ws, end_event): + last_ping = int(sec_since_boot() * 1e9) + while not end_event.is_set(): + try: + opcode, data = ws.recv_data(control_frame=True) + if opcode in (ABNF.OPCODE_TEXT, ABNF.OPCODE_BINARY): + if opcode == ABNF.OPCODE_TEXT: + data = data.decode("utf-8") + recv_queue.put_nowait(data) + elif opcode == ABNF.OPCODE_PING: + last_ping = int(sec_since_boot() * 1e9) + Params().put("LastAthenaPingTime", str(last_ping)) + except WebSocketTimeoutException: + ns_since_last_ping = int(sec_since_boot() * 1e9) - last_ping + if ns_since_last_ping > RECONNECT_TIMEOUT_S * 1e9: + cloudlog.exception("athenad.ws_recv.timeout") + end_event.set() + except Exception: + cloudlog.exception("athenad.ws_recv.exception") + end_event.set() + + +def ws_send(ws, end_event): + while not end_event.is_set(): + try: + try: + data = send_queue.get_nowait() + except queue.Empty: + data = low_priority_send_queue.get(timeout=1) + for i in range(0, len(data), WS_FRAME_SIZE): + frame = data[i:i+WS_FRAME_SIZE] + last = i + WS_FRAME_SIZE >= len(data) + opcode = ABNF.OPCODE_TEXT if i == 0 else ABNF.OPCODE_CONT + ws.send_frame(ABNF.create_frame(frame, opcode, last)) + except queue.Empty: + pass + except Exception: + cloudlog.exception("athenad.ws_send.exception") + end_event.set() + + +def backoff(retries): + return random.randrange(0, min(128, int(2 ** retries))) + + +def main(): + params = Params() + dongle_id = params.get("DongleId", encoding='utf-8') + UploadQueueCache.initialize(upload_queue) + + ws_uri = ATHENA_HOST + "/ws/v2/" + dongle_id + api = Api(dongle_id) + + conn_retries = 0 + while 1: + try: + cloudlog.event("athenad.main.connecting_ws", ws_uri=ws_uri) + ws = create_connection(ws_uri, + cookie="jwt=" + api.get_token(), + enable_multithread=True, + timeout=30.0) + cloudlog.event("athenad.main.connected_ws", ws_uri=ws_uri) + params.delete("PrimeRedirected") + + conn_retries = 0 + cur_upload_items.clear() + + handle_long_poll(ws) + except (KeyboardInterrupt, SystemExit): + break + except (ConnectionError, TimeoutError, WebSocketException): + conn_retries += 1 + params.delete("PrimeRedirected") + params.delete("LastAthenaPingTime") + except socket.timeout: + try: + r = requests.get("http://api.commadotai.com/v1/me", allow_redirects=False, + headers={"User-Agent": f"openpilot-{get_version()}"}, timeout=15.0) + if r.status_code == 302 and r.headers['Location'].startswith("http://u.web2go.com"): + params.put_bool("PrimeRedirected", True) + except Exception: + cloudlog.exception("athenad.socket_timeout.exception") + params.delete("LastAthenaPingTime") + except Exception: + crash.capture_exception() + cloudlog.exception("athenad.main.exception") + + conn_retries += 1 + params.delete("PrimeRedirected") + params.delete("LastAthenaPingTime") + + time.sleep(backoff(conn_retries)) + + +if __name__ == "__main__": + main() diff --git a/selfdrive/athena/manage_athenad.py b/selfdrive/athena/manage_athenad.py new file mode 100755 index 000000000..58ad58310 --- /dev/null +++ b/selfdrive/athena/manage_athenad.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +import time +from multiprocessing import Process + +from common.params import Params +from selfdrive.manager.process import launcher +from selfdrive.swaglog import cloudlog +from selfdrive.version import get_version, is_dirty + +ATHENA_MGR_PID_PARAM = "AthenadPid" + + +def main(): + params = Params() + dongle_id = params.get("DongleId").decode('utf-8') + cloudlog.bind_global(dongle_id=dongle_id, version=get_version(), dirty=is_dirty()) + + try: + while 1: + cloudlog.info("starting athena daemon") + proc = Process(name='athenad', target=launcher, args=('selfdrive.athena.athenad', 'athenad')) + proc.start() + proc.join() + cloudlog.event("athenad exited", exitcode=proc.exitcode) + time.sleep(5) + except Exception: + cloudlog.exception("manage_athenad.exception") + finally: + params.delete(ATHENA_MGR_PID_PARAM) + + +if __name__ == '__main__': + main() diff --git a/selfdrive/athena/registration.py b/selfdrive/athena/registration.py new file mode 100755 index 000000000..10f5d46f7 --- /dev/null +++ b/selfdrive/athena/registration.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +import time +import json +import jwt +from pathlib import Path + +from datetime import datetime, timedelta +from common.api import api_get +from common.params import Params +from common.spinner import Spinner +from common.basedir import PERSIST +from selfdrive.controls.lib.alertmanager import set_offroad_alert +from selfdrive.hardware import HARDWARE, PC +from selfdrive.swaglog import cloudlog + + +UNREGISTERED_DONGLE_ID = "UnregisteredDevice" + + +def is_registered_device() -> bool: + dongle = Params().get("DongleId", encoding='utf-8') + return dongle not in (None, UNREGISTERED_DONGLE_ID) + + +def register(show_spinner=False) -> str: + params = Params() + params.put("SubscriberInfo", HARDWARE.get_subscriber_info()) + + IMEI = params.get("IMEI", encoding='utf8') + HardwareSerial = params.get("HardwareSerial", encoding='utf8') + dongle_id = params.get("DongleId", encoding='utf8') + needs_registration = None in (IMEI, HardwareSerial, dongle_id) + + pubkey = Path(PERSIST+"/comma/id_rsa.pub") + if not pubkey.is_file(): + dongle_id = UNREGISTERED_DONGLE_ID + cloudlog.warning(f"missing public key: {pubkey}") + elif needs_registration: + if show_spinner: + spinner = Spinner() + spinner.update("registering device") + + # Create registration token, in the future, this key will make JWTs directly + with open(PERSIST+"/comma/id_rsa.pub") as f1, open(PERSIST+"/comma/id_rsa") as f2: + public_key = f1.read() + private_key = f2.read() + + # Block until we get the imei + serial = HARDWARE.get_serial() + start_time = time.monotonic() + imei1, imei2 = None, None + while imei1 is None and imei2 is None: + try: + imei1, imei2 = HARDWARE.get_imei(0), HARDWARE.get_imei(1) + except Exception: + cloudlog.exception("Error getting imei, trying again...") + time.sleep(1) + + if time.monotonic() - start_time > 60 and show_spinner: + spinner.update(f"registering device - serial: {serial}, IMEI: ({imei1}, {imei2})") + + params.put("IMEI", imei1) + params.put("HardwareSerial", serial) + + backoff = 0 + start_time = time.monotonic() + while True: + try: + register_token = jwt.encode({'register': True, 'exp': datetime.utcnow() + timedelta(hours=1)}, private_key, algorithm='RS256') + cloudlog.info("getting pilotauth") + resp = api_get("v2/pilotauth/", method='POST', timeout=15, + imei=imei1, imei2=imei2, serial=serial, public_key=public_key, register_token=register_token) + + if resp.status_code in (402, 403): + cloudlog.info(f"Unable to register device, got {resp.status_code}") + dongle_id = UNREGISTERED_DONGLE_ID + else: + dongleauth = json.loads(resp.text) + dongle_id = dongleauth["dongle_id"] + break + except Exception: + cloudlog.exception("failed to authenticate") + backoff = min(backoff + 1, 15) + time.sleep(backoff) + + if time.monotonic() - start_time > 60 and show_spinner: + spinner.update(f"registering device - serial: {serial}, IMEI: ({imei1}, {imei2})") + + if show_spinner: + spinner.close() + + if dongle_id: + params.put("DongleId", dongle_id) + set_offroad_alert("Offroad_UnofficialHardware", (dongle_id == UNREGISTERED_DONGLE_ID) and not PC) + return dongle_id + + +if __name__ == "__main__": + print(register()) diff --git a/selfdrive/boardd/.gitignore b/selfdrive/boardd/.gitignore new file mode 100644 index 000000000..e8daa2ef2 --- /dev/null +++ b/selfdrive/boardd/.gitignore @@ -0,0 +1,3 @@ +boardd +boardd_api_impl.cpp +tests/test_boardd_usbprotocol diff --git a/selfdrive/boardd/SConscript b/selfdrive/boardd/SConscript new file mode 100644 index 000000000..922107509 --- /dev/null +++ b/selfdrive/boardd/SConscript @@ -0,0 +1,9 @@ +Import('env', 'envCython', 'common', 'cereal', 'messaging') + +libs = ['usb-1.0', common, cereal, messaging, 'pthread', 'zmq', 'capnp', 'kj'] +env.Program('boardd', ['main.cc', 'boardd.cc', 'panda.cc', 'pigeon.cc'], LIBS=libs) +env.Library('libcan_list_to_can_capnp', ['can_list_to_can_capnp.cc']) + +envCython.Program('boardd_api_impl.so', 'boardd_api_impl.pyx', LIBS=["can_list_to_can_capnp", 'capnp', 'kj'] + envCython["LIBS"]) +if GetOption('test'): + env.Program('tests/test_boardd_usbprotocol', ['tests/test_boardd_usbprotocol.cc', 'panda.cc'], LIBS=libs) diff --git a/selfdrive/boardd/__init__.py b/selfdrive/boardd/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/boardd/boardd b/selfdrive/boardd/boardd new file mode 100755 index 000000000..c09ec08da Binary files /dev/null and b/selfdrive/boardd/boardd differ diff --git a/selfdrive/boardd/boardd.cc b/selfdrive/boardd/boardd.cc new file mode 100644 index 000000000..c5310f879 --- /dev/null +++ b/selfdrive/boardd/boardd.cc @@ -0,0 +1,655 @@ +#include "selfdrive/boardd/boardd.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "cereal/gen/cpp/car.capnp.h" +#include "cereal/messaging/messaging.h" +#include "selfdrive/common/params.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/timing.h" +#include "selfdrive/common/util.h" +#include "selfdrive/hardware/hw.h" + +#include "selfdrive/boardd/pigeon.h" + +// -- Multi-panda conventions -- +// Ordering: +// - The internal panda will always be the first panda +// - Consecutive pandas will be sorted based on panda type, and then serial number +// Connecting: +// - If a panda connection is dropped, boardd wil reconnect to all pandas +// - If a panda is added, we will only reconnect when we are offroad +// CAN buses: +// - Each panda will have it's block of 4 buses. E.g.: the second panda will use +// bus numbers 4, 5, 6 and 7 +// - The internal panda will always be used for accessing the OBD2 port, +// and thus firmware queries +// Safety: +// - SafetyConfig is a list, which is mapped to the connected pandas +// - If there are more pandas connected than there are SafetyConfigs, +// the excess pandas will remain in "silent" ot "noOutput" mode +// Ignition: +// - If any of the ignition sources in any panda is high, ignition is high + +#define MAX_IR_POWER 0.5f +#define MIN_IR_POWER 0.0f +#define CUTOFF_IL 200 +#define SATURATE_IL 1600 +#define NIBBLE_TO_HEX(n) ((n) < 10 ? (n) + '0' : ((n) - 10) + 'a') +using namespace std::chrono_literals; + +std::atomic ignition(false); +std::atomic pigeon_active(false); + +ExitHandler do_exit; + +static std::string get_time_str(const struct tm &time) { + char s[30] = {'\0'}; + std::strftime(s, std::size(s), "%Y-%m-%d %H:%M:%S", &time); + return s; +} + +bool check_all_connected(const std::vector &pandas) { + for (const auto& panda : pandas) { + if (!panda->connected) { + do_exit = true; + return false; + } + } + return true; +} + +enum class SyncTimeDir { TO_PANDA, FROM_PANDA }; + +void sync_time(Panda *panda, SyncTimeDir dir) { + if (!panda->has_rtc) return; + + setenv("TZ", "UTC", 1); + struct tm sys_time = util::get_time(); + struct tm rtc_time = panda->get_rtc(); + + if (dir == SyncTimeDir::TO_PANDA) { + if (util::time_valid(sys_time)) { + // Write time to RTC if it looks reasonable + double seconds = difftime(mktime(&rtc_time), mktime(&sys_time)); + if (std::abs(seconds) > 1.1) { + panda->set_rtc(sys_time); + LOGW("Updating panda RTC. dt = %.2f System: %s RTC: %s", + seconds, get_time_str(sys_time).c_str(), get_time_str(rtc_time).c_str()); + } + } + } else if (dir == SyncTimeDir::FROM_PANDA) { + if (!util::time_valid(sys_time) && util::time_valid(rtc_time)) { + const struct timeval tv = {mktime(&rtc_time), 0}; + settimeofday(&tv, 0); + LOGE("System time wrong, setting from RTC. System: %s RTC: %s", + get_time_str(sys_time).c_str(), get_time_str(rtc_time).c_str()); + } + } +} + +bool safety_setter_thread(std::vector pandas) { + LOGD("Starting safety setter thread"); + + // there should be at least one panda connected + if (pandas.size() == 0) { + return false; + } + + pandas[0]->set_safety_model(cereal::CarParams::SafetyModel::ELM327); + + Params p = Params(); + + // switch to SILENT when CarVin param is read + while (true) { + if (do_exit || !check_all_connected(pandas) || !ignition) { + return false; + } + + std::string value_vin = p.get("CarVin"); + if (value_vin.size() > 0) { + // sanity check VIN format + assert(value_vin.size() == 17); + LOGW("got CarVin %s", value_vin.c_str()); + break; + } + util::sleep_for(20); + } + + pandas[0]->set_safety_model(cereal::CarParams::SafetyModel::ELM327, 1); + + std::string params; + LOGW("waiting for params to set safety model"); + while (true) { + for (const auto& panda : pandas) { + if (do_exit || !panda->connected || !ignition) { + return false; + } + } + + if (p.getBool("ControlsReady")) { + params = p.get("CarParams"); + if (params.size() > 0) break; + } + util::sleep_for(100); + } + LOGW("got %d bytes CarParams", params.size()); + + AlignedBuffer aligned_buf; + capnp::FlatArrayMessageReader cmsg(aligned_buf.align(params.data(), params.size())); + cereal::CarParams::Reader car_params = cmsg.getRoot(); + cereal::CarParams::SafetyModel safety_model; + int safety_param; + + auto safety_configs = car_params.getSafetyConfigs(); + uint16_t unsafe_mode = car_params.getUnsafeMode(); + for (uint32_t i = 0; i < pandas.size(); i++) { + auto panda = pandas[i]; + + if (safety_configs.size() > i) { + safety_model = safety_configs[i].getSafetyModel(); + safety_param = safety_configs[i].getSafetyParam(); + } else { + // If no safety mode is specified, default to silent + safety_model = cereal::CarParams::SafetyModel::SILENT; + safety_param = 0; + } + + LOGW("panda %d: setting safety model: %d, param: %d, unsafe mode: %d", i, (int)safety_model, safety_param, unsafe_mode); + panda->set_unsafe_mode(unsafe_mode); + panda->set_safety_model(safety_model, safety_param); + } + + return true; +} + +Panda *usb_connect(std::string serial="", uint32_t index=0) { + std::unique_ptr panda; + try { + panda = std::make_unique(serial, (index * PANDA_BUS_CNT)); + } catch (std::exception &e) { + return nullptr; + } + + if (getenv("BOARDD_LOOPBACK")) { + panda->set_loopback(true); + } + + // power on charging, only the first time. Panda can also change mode and it causes a brief disconneciton +#ifndef __x86_64__ + static std::once_flag connected_once; + std::call_once(connected_once, &Panda::set_usb_power_mode, panda, cereal::PeripheralState::UsbPowerMode::CDP); +#endif + + sync_time(panda.get(), SyncTimeDir::FROM_PANDA); + return panda.release(); +} + +void can_send_thread(std::vector pandas, bool fake_send) { + util::set_thread_name("boardd_can_send"); + + AlignedBuffer aligned_buf; + std::unique_ptr context(Context::create()); + std::unique_ptr subscriber(SubSocket::create(context.get(), "sendcan")); + assert(subscriber != NULL); + subscriber->setTimeout(100); + + // run as fast as messages come in + while (!do_exit && check_all_connected(pandas)) { + std::unique_ptr msg(subscriber->receive()); + if (!msg) { + if (errno == EINTR) { + do_exit = true; + } + continue; + } + + capnp::FlatArrayMessageReader cmsg(aligned_buf.align(msg.get())); + cereal::Event::Reader event = cmsg.getRoot(); + + //Dont send if older than 1 second + if ((nanos_since_boot() - event.getLogMonoTime() < 1e9) && !fake_send) { + for (const auto& panda : pandas) { + panda->can_send(event.getSendcan()); + } + } + } +} + +void can_recv_thread(std::vector pandas) { + util::set_thread_name("boardd_can_recv"); + + // can = 8006 + PubMaster pm({"can"}); + + // run at 100hz + const uint64_t dt = 10000000ULL; + uint64_t next_frame_time = nanos_since_boot() + dt; + std::vector raw_can_data; + + while (!do_exit && check_all_connected(pandas)) { + bool comms_healthy = true; + raw_can_data.clear(); + for (const auto& panda : pandas) { + comms_healthy &= panda->can_receive(raw_can_data); + } + + MessageBuilder msg; + auto evt = msg.initEvent(); + evt.setValid(comms_healthy); + auto canData = evt.initCan(raw_can_data.size()); + for (uint i = 0; i 0) { + std::this_thread::sleep_for(std::chrono::nanoseconds(remaining)); + } else { + if (ignition) { + LOGW("missed cycles (%d) %lld", (int)-1*remaining/dt, remaining); + } + next_frame_time = cur_time; + } + + next_frame_time += dt; + } +} + +void send_empty_peripheral_state(PubMaster *pm) { + MessageBuilder msg; + auto peripheralState = msg.initEvent().initPeripheralState(); + peripheralState.setPandaType(cereal::PandaState::PandaType::UNKNOWN); + pm->send("peripheralState", msg); +} + +void send_empty_panda_state(PubMaster *pm) { + MessageBuilder msg; + auto pandaStates = msg.initEvent().initPandaStates(1); + pandaStates[0].setPandaType(cereal::PandaState::PandaType::UNKNOWN); + pm->send("pandaStates", msg); +} + +std::optional send_panda_states(PubMaster *pm, const std::vector &pandas, bool spoofing_started) { + bool ignition_local = false; + + // build msg + MessageBuilder msg; + auto evt = msg.initEvent(); + auto pss = evt.initPandaStates(pandas.size()); + + std::vector pandaStates; + for (const auto& panda : pandas){ + auto health_opt = panda->get_state(); + if (!health_opt) { + return std::nullopt; + } + + health_t health = *health_opt; + + if (spoofing_started) { + health.ignition_line_pkt = 1; + } + + ignition_local |= ((health.ignition_line_pkt != 0) || (health.ignition_can_pkt != 0)); + + pandaStates.push_back(health); + } + + for (uint32_t i = 0; i < pandas.size(); i++) { + auto panda = pandas[i]; + const auto &health = pandaStates[i]; + + // Make sure CAN buses are live: safety_setter_thread does not work if Panda CAN are silent and there is only one other CAN node + if (health.safety_mode_pkt == (uint8_t)(cereal::CarParams::SafetyModel::SILENT)) { + panda->set_safety_model(cereal::CarParams::SafetyModel::NO_OUTPUT); + } + + #ifndef __x86_64__ + bool power_save_desired = !ignition_local && !pigeon_active; + if (health.power_save_enabled_pkt != power_save_desired) { + panda->set_power_saving(power_save_desired); + } + + // set safety mode to NO_OUTPUT when car is off. ELM327 is an alternative if we want to leverage athenad/connect + if (!ignition_local && (health.safety_mode_pkt != (uint8_t)(cereal::CarParams::SafetyModel::NO_OUTPUT))) { + panda->set_safety_model(cereal::CarParams::SafetyModel::NO_OUTPUT); + } + #endif + + if (!panda->comms_healthy) { + evt.setValid(false); + } + + auto ps = pss[i]; + ps.setUptime(health.uptime_pkt); + ps.setBlockedCnt(health.blocked_msg_cnt_pkt); + ps.setIgnitionLine(health.ignition_line_pkt); + ps.setIgnitionCan(health.ignition_can_pkt); + ps.setControlsAllowed(health.controls_allowed_pkt); + ps.setGasInterceptorDetected(health.gas_interceptor_detected_pkt); + ps.setCanRxErrs(health.can_rx_errs_pkt); + ps.setCanSendErrs(health.can_send_errs_pkt); + ps.setCanFwdErrs(health.can_fwd_errs_pkt); + ps.setGmlanSendErrs(health.gmlan_send_errs_pkt); + ps.setPandaType(panda->hw_type); + ps.setSafetyModel(cereal::CarParams::SafetyModel(health.safety_mode_pkt)); + ps.setSafetyParam(health.safety_param_pkt); + ps.setFaultStatus(cereal::PandaState::FaultStatus(health.fault_status_pkt)); + ps.setPowerSaveEnabled((bool)(health.power_save_enabled_pkt)); + ps.setHeartbeatLost((bool)(health.heartbeat_lost_pkt)); + ps.setUnsafeMode(health.unsafe_mode_pkt); + ps.setHarnessStatus(cereal::PandaState::HarnessStatus(health.car_harness_status_pkt)); + + // Convert faults bitset to capnp list + std::bitset fault_bits(health.faults_pkt); + auto faults = ps.initFaults(fault_bits.count()); + + size_t j = 0; + for (size_t f = size_t(cereal::PandaState::FaultType::RELAY_MALFUNCTION); + f <= size_t(cereal::PandaState::FaultType::INTERRUPT_RATE_TICK); f++) { + if (fault_bits.test(f)) { + faults.set(j, cereal::PandaState::FaultType(f)); + j++; + } + } + } + + pm->send("pandaStates", msg); + return ignition_local; +} + +void send_peripheral_state(PubMaster *pm, Panda *panda) { + auto pandaState_opt = panda->get_state(); + if (!pandaState_opt) { + return; + } + + health_t pandaState = *pandaState_opt; + + // build msg + MessageBuilder msg; + auto evt = msg.initEvent(); + evt.setValid(panda->comms_healthy); + + auto ps = evt.initPeripheralState(); + ps.setPandaType(panda->hw_type); + + if (Hardware::TICI()) { + double read_time = millis_since_boot(); + ps.setVoltage(std::atoi(util::read_file("/sys/class/hwmon/hwmon1/in1_input").c_str())); + ps.setCurrent(std::atoi(util::read_file("/sys/class/hwmon/hwmon1/curr1_input").c_str())); + read_time = millis_since_boot() - read_time; + if (read_time > 50) { + LOGW("reading hwmon took %lfms", read_time); + } + } else { + ps.setVoltage(pandaState.voltage_pkt); + ps.setCurrent(pandaState.current_pkt); + } + + uint16_t fan_speed_rpm = panda->get_fan_speed(); + ps.setUsbPowerMode(cereal::PeripheralState::UsbPowerMode(pandaState.usb_power_mode_pkt)); + ps.setFanSpeedRpm(fan_speed_rpm); + + pm->send("peripheralState", msg); +} + +void panda_state_thread(PubMaster *pm, std::vector pandas, bool spoofing_started) { + util::set_thread_name("boardd_panda_state"); + + Params params; + SubMaster sm({"controlsState"}); + + Panda *peripheral_panda = pandas[0]; + bool ignition_last = false; + std::future safety_future; + + LOGD("start panda state thread"); + + // run at 2hz + while (!do_exit && check_all_connected(pandas)) { + uint64_t start_time = nanos_since_boot(); + + // send out peripheralState + send_peripheral_state(pm, peripheral_panda); + auto ignition_opt = send_panda_states(pm, pandas, spoofing_started); + + if (!ignition_opt) { + continue; + } + + ignition = *ignition_opt; + + // TODO: make this check fast, currently takes 16ms + // check if we have new pandas and are offroad + if (!ignition && (pandas.size() != Panda::list().size())) { + LOGW("Reconnecting to changed amount of pandas!"); + do_exit = true; + break; + } + + // clear ignition-based params and set new safety on car start + if (ignition && !ignition_last) { + params.clearAll(CLEAR_ON_IGNITION_ON); + if (!safety_future.valid() || safety_future.wait_for(0ms) == std::future_status::ready) { + safety_future = std::async(std::launch::async, safety_setter_thread, pandas); + } else { + LOGW("Safety setter thread already running"); + } + } else if (!ignition && ignition_last) { + params.clearAll(CLEAR_ON_IGNITION_OFF); + } + + ignition_last = ignition; + + sm.update(0); + const bool engaged = sm.allAliveAndValid({"controlsState"}) && sm["controlsState"].getControlsState().getEnabled(); + + for (const auto &panda : pandas) { + panda->send_heartbeat(engaged); + } + + uint64_t dt = nanos_since_boot() - start_time; + util::sleep_for(500 - dt / 1000000ULL); + } +} + + +void peripheral_control_thread(Panda *panda) { + util::set_thread_name("boardd_peripheral_control"); + + SubMaster sm({"deviceState", "driverCameraState"}); + + uint64_t last_front_frame_t = 0; + uint16_t prev_fan_speed = 999; + uint16_t ir_pwr = 0; + uint16_t prev_ir_pwr = 999; + bool prev_charging_disabled = false; + unsigned int cnt = 0; + + FirstOrderFilter integ_lines_filter(0, 30.0, 0.05); + + while (!do_exit && panda->connected) { + cnt++; + sm.update(1000); // TODO: what happens if EINTR is sent while in sm.update? + + if (!Hardware::PC() && sm.updated("deviceState")) { + // Charging mode + bool charging_disabled = sm["deviceState"].getDeviceState().getChargingDisabled(); + if (charging_disabled != prev_charging_disabled) { + if (charging_disabled) { + panda->set_usb_power_mode(cereal::PeripheralState::UsbPowerMode::CLIENT); + LOGW("TURN OFF CHARGING!\n"); + } else { + panda->set_usb_power_mode(cereal::PeripheralState::UsbPowerMode::CDP); + LOGW("TURN ON CHARGING!\n"); + } + prev_charging_disabled = charging_disabled; + } + } + + // Other pandas don't have fan/IR to control + if (panda->hw_type != cereal::PandaState::PandaType::UNO && panda->hw_type != cereal::PandaState::PandaType::DOS) continue; + if (sm.updated("deviceState")) { + // Fan speed + uint16_t fan_speed = sm["deviceState"].getDeviceState().getFanSpeedPercentDesired(); + if (fan_speed != prev_fan_speed || cnt % 100 == 0) { + panda->set_fan_speed(fan_speed); + prev_fan_speed = fan_speed; + } + } + if (sm.updated("driverCameraState")) { + auto event = sm["driverCameraState"]; + int cur_integ_lines = event.getDriverCameraState().getIntegLines(); + float cur_gain = event.getDriverCameraState().getGain(); + + if (Hardware::TICI()) { + cur_integ_lines = integ_lines_filter.update(cur_integ_lines * cur_gain); + } + last_front_frame_t = event.getLogMonoTime(); + + if (cur_integ_lines <= CUTOFF_IL) { + ir_pwr = 100.0 * MIN_IR_POWER; + } else if (cur_integ_lines > SATURATE_IL) { + ir_pwr = 100.0 * MAX_IR_POWER; + } else { + ir_pwr = 100.0 * (MIN_IR_POWER + ((cur_integ_lines - CUTOFF_IL) * (MAX_IR_POWER - MIN_IR_POWER) / (SATURATE_IL - CUTOFF_IL))); + } + } + // Disable ir_pwr on front frame timeout + uint64_t cur_t = nanos_since_boot(); + if (cur_t - last_front_frame_t > 1e9) { + ir_pwr = 0; + } + + if (ir_pwr != prev_ir_pwr || cnt % 100 == 0 || ir_pwr >= 50.0) { + panda->set_ir_pwr(ir_pwr); + prev_ir_pwr = ir_pwr; + } + + // Write to rtc once per minute when no ignition present + if (!ignition && (cnt % 120 == 1)) { + sync_time(panda, SyncTimeDir::TO_PANDA); + } + } +} + +static void pigeon_publish_raw(PubMaster &pm, const std::string &dat) { + // create message + MessageBuilder msg; + msg.initEvent().setUbloxRaw(capnp::Data::Reader((uint8_t*)dat.data(), dat.length())); + pm.send("ubloxRaw", msg); +} + +void pigeon_thread(Panda *panda) { + util::set_thread_name("boardd_pigeon"); + + PubMaster pm({"ubloxRaw"}); + bool ignition_last = false; + + std::unique_ptr pigeon(Hardware::TICI() ? Pigeon::connect("/dev/ttyHS0") : Pigeon::connect(panda)); + + while (!do_exit && panda->connected) { + bool need_reset = false; + bool ignition_local = ignition; + std::string recv = pigeon->receive(); + + // Check based on null bytes + if (ignition_local && recv.length() > 0 && recv[0] == (char)0x00) { + need_reset = true; + LOGW("received invalid ublox message while onroad, resetting panda GPS"); + } + + if (recv.length() > 0) { + pigeon_publish_raw(pm, recv); + } + + // init pigeon on rising ignition edge + // since it was turned off in low power mode + if((ignition_local && !ignition_last) || need_reset) { + pigeon_active = true; + pigeon->init(); + } else if (!ignition_local && ignition_last) { + // power off on falling edge of ignition + LOGD("powering off pigeon\n"); + pigeon->stop(); + pigeon->set_power(false); + pigeon_active = false; + } + + ignition_last = ignition_local; + + // 10ms - 100 Hz + util::sleep_for(10); + } +} + +void boardd_main_thread(std::vector serials) { + if (serials.size() == 0) serials.push_back(""); + + PubMaster pm({"pandaStates", "peripheralState"}); + LOGW("attempting to connect"); + + // connect to all provided serials + std::vector pandas; + for (int i = 0; i < serials.size() && !do_exit; /**/) { + Panda *p = usb_connect(serials[i], i); + if (!p) { + // send empty pandaState & peripheralState and try again + send_empty_panda_state(&pm); + send_empty_peripheral_state(&pm); + util::sleep_for(500); + continue; + } + + pandas.push_back(p); + ++i; + } + + if (!do_exit) { + LOGW("connected to board"); + Panda *peripheral_panda = pandas[0]; + std::vector threads; + + Params().put("LastPeripheralPandaType", std::to_string((int) peripheral_panda->get_hw_type())); + + threads.emplace_back(panda_state_thread, &pm, pandas, getenv("STARTED") != nullptr); + threads.emplace_back(peripheral_control_thread, peripheral_panda); + threads.emplace_back(pigeon_thread, peripheral_panda); + + threads.emplace_back(can_send_thread, pandas, getenv("FAKESEND") != nullptr); + threads.emplace_back(can_recv_thread, pandas); + + for (auto &t : threads) t.join(); + } + + // we have exited, clean up pandas + for (Panda *panda : pandas) { + delete panda; + } +} diff --git a/selfdrive/boardd/boardd.h b/selfdrive/boardd/boardd.h new file mode 100644 index 000000000..d3c9e1f94 --- /dev/null +++ b/selfdrive/boardd/boardd.h @@ -0,0 +1,6 @@ +#pragma once + +#include "selfdrive/boardd/panda.h" + +bool safety_setter_thread(std::vector pandas); +void boardd_main_thread(std::vector serials); diff --git a/selfdrive/boardd/boardd.py b/selfdrive/boardd/boardd.py new file mode 100644 index 000000000..527f1f4f5 --- /dev/null +++ b/selfdrive/boardd/boardd.py @@ -0,0 +1,12 @@ +# pylint: skip-file + +# Cython, now uses scons to build +from selfdrive.boardd.boardd_api_impl import can_list_to_can_capnp +assert can_list_to_can_capnp + +def can_capnp_to_can_list(can, src_filter=None): + ret = [] + for msg in can: + if src_filter is None or msg.src in src_filter: + ret.append((msg.address, msg.busTime, msg.dat, msg.src)) + return ret diff --git a/selfdrive/boardd/boardd_api_impl.cpp b/selfdrive/boardd/boardd_api_impl.cpp new file mode 100644 index 000000000..814e8a01d --- /dev/null +++ b/selfdrive/boardd/boardd_api_impl.cpp @@ -0,0 +1,3655 @@ +/* Generated by Cython 0.29.26 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [], + "language": "c++", + "name": "selfdrive.boardd.boardd_api_impl", + "sources": [ + "/data/openpilot/selfdrive/boardd/boardd_api_impl.pyx" + ] + }, + "module_name": "selfdrive.boardd.boardd_api_impl" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_26" +#define CYTHON_HEX_VERSION 0x001D1AF0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } + private: + T *ptr; +}; + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject* co=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(0))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too; + if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here + if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too; + Py_XDECREF((PyObject*)co); + co = (PyCodeObject*)call_result; + call_result = NULL; + if (0) { + cleanup_code_too: + Py_XDECREF((PyObject*)co); + co = NULL; + } + end: + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(call_result); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return co; + } +#else + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if defined(PyUnicode_IS_READY) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #else + #define __Pyx_PyUnicode_READY(op) (0) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__selfdrive__boardd__boardd_api_impl +#define __PYX_HAVE_API__selfdrive__boardd__boardd_api_impl +/* Early includes */ +#include "ios" +#include "new" +#include "stdexcept" +#include "typeinfo" +#include +#include +#include +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "selfdrive/boardd/boardd_api_impl.pyx", + "stringsource", +}; + +/*--- Type declarations ---*/ +struct __pyx_t_9selfdrive_6boardd_15boardd_api_impl_can_frame; + +/* "selfdrive/boardd/boardd_api_impl.pyx":7 + * from libcpp cimport bool + * + * cdef struct can_frame: # <<<<<<<<<<<<<< + * long address + * string dat + */ +struct __pyx_t_9selfdrive_6boardd_15boardd_api_impl_can_frame { + long address; + std::string dat; + long busTime; + long src; +}; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* GCCDiagnostics.proto */ +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CppExceptionConversion.proto */ +#ifndef __Pyx_CppExn2PyErr +#include +#include +#include +#include +static void __Pyx_CppExn2PyErr() { + try { + if (PyErr_Occurred()) + ; // let the latest Python exn pass through and ignore the current one + else + throw; + } catch (const std::bad_alloc& exn) { + PyErr_SetString(PyExc_MemoryError, exn.what()); + } catch (const std::bad_cast& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::bad_typeid& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::domain_error& exn) { + PyErr_SetString(PyExc_ValueError, exn.what()); + } catch (const std::invalid_argument& exn) { + PyErr_SetString(PyExc_ValueError, exn.what()); + } catch (const std::ios_base::failure& exn) { + PyErr_SetString(PyExc_IOError, exn.what()); + } catch (const std::out_of_range& exn) { + PyErr_SetString(PyExc_IndexError, exn.what()); + } catch (const std::overflow_error& exn) { + PyErr_SetString(PyExc_OverflowError, exn.what()); + } catch (const std::range_error& exn) { + PyErr_SetString(PyExc_ArithmeticError, exn.what()); + } catch (const std::underflow_error& exn) { + PyErr_SetString(PyExc_ArithmeticError, exn.what()); + } catch (const std::exception& exn) { + PyErr_SetString(PyExc_RuntimeError, exn.what()); + } + catch (...) + { + PyErr_SetString(PyExc_RuntimeError, "Unknown exception"); + } +} +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + + +/* Module declarations from 'libcpp.vector' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libcpp.string' */ + +/* Module declarations from 'libcpp' */ + +/* Module declarations from 'selfdrive.boardd.boardd_api_impl' */ +__PYX_EXTERN_C DL_IMPORT(void) can_list_to_can_capnp_cpp(std::vector const &, std::string &, bool, bool); /*proto*/ +static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/ +#define __Pyx_MODULE_NAME "selfdrive.boardd.boardd_api_impl" +extern int __pyx_module_is_main_selfdrive__boardd__boardd_api_impl; +int __pyx_module_is_main_selfdrive__boardd__boardd_api_impl = 0; + +/* Implementation of 'selfdrive.boardd.boardd_api_impl' */ +static const char __pyx_k_f[] = "f"; +static const char __pyx_k_can[] = "can"; +static const char __pyx_k_out[] = "out"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_valid[] = "valid"; +static const char __pyx_k_can_msg[] = "can_msg"; +static const char __pyx_k_msgtype[] = "msgtype"; +static const char __pyx_k_sendcan[] = "sendcan"; +static const char __pyx_k_can_list[] = "can_list"; +static const char __pyx_k_can_msgs[] = "can_msgs"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_can_list_to_can_capnp[] = "can_list_to_can_capnp"; +static const char __pyx_k_selfdrive_boardd_boardd_api_impl[] = "selfdrive/boardd/boardd_api_impl.pyx"; +static const char __pyx_k_selfdrive_boardd_boardd_api_impl_2[] = "selfdrive.boardd.boardd_api_impl"; +static PyObject *__pyx_n_u_can; +static PyObject *__pyx_n_s_can_list; +static PyObject *__pyx_n_s_can_list_to_can_capnp; +static PyObject *__pyx_n_s_can_msg; +static PyObject *__pyx_n_s_can_msgs; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_f; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_msgtype; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_out; +static PyObject *__pyx_kp_s_selfdrive_boardd_boardd_api_impl; +static PyObject *__pyx_n_s_selfdrive_boardd_boardd_api_impl_2; +static PyObject *__pyx_n_u_sendcan; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_valid; +static PyObject *__pyx_pf_9selfdrive_6boardd_15boardd_api_impl_can_list_to_can_capnp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_can_msgs, PyObject *__pyx_v_msgtype, PyObject *__pyx_v_valid); /* proto */ +static PyObject *__pyx_tuple_; +static PyObject *__pyx_codeobj__2; +/* Late includes */ + +/* "selfdrive/boardd/boardd_api_impl.pyx":15 + * cdef extern void can_list_to_can_capnp_cpp(const vector[can_frame] &can_list, string &out, bool sendCan, bool valid) + * + * def can_list_to_can_capnp(can_msgs, msgtype='can', valid=True): # <<<<<<<<<<<<<< + * cdef vector[can_frame] can_list + * can_list.reserve(len(can_msgs)) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_9selfdrive_6boardd_15boardd_api_impl_1can_list_to_can_capnp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_9selfdrive_6boardd_15boardd_api_impl_1can_list_to_can_capnp = {"can_list_to_can_capnp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9selfdrive_6boardd_15boardd_api_impl_1can_list_to_can_capnp, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_9selfdrive_6boardd_15boardd_api_impl_1can_list_to_can_capnp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_can_msgs = 0; + PyObject *__pyx_v_msgtype = 0; + PyObject *__pyx_v_valid = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("can_list_to_can_capnp (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_can_msgs,&__pyx_n_s_msgtype,&__pyx_n_s_valid,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_n_u_can); + values[2] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_can_msgs)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msgtype); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valid); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "can_list_to_can_capnp") < 0)) __PYX_ERR(0, 15, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_can_msgs = values[0]; + __pyx_v_msgtype = values[1]; + __pyx_v_valid = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("can_list_to_can_capnp", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 15, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("selfdrive.boardd.boardd_api_impl.can_list_to_can_capnp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9selfdrive_6boardd_15boardd_api_impl_can_list_to_can_capnp(__pyx_self, __pyx_v_can_msgs, __pyx_v_msgtype, __pyx_v_valid); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9selfdrive_6boardd_15boardd_api_impl_can_list_to_can_capnp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_can_msgs, PyObject *__pyx_v_msgtype, PyObject *__pyx_v_valid) { + std::vector __pyx_v_can_list; + struct __pyx_t_9selfdrive_6boardd_15boardd_api_impl_can_frame __pyx_v_f; + PyObject *__pyx_v_can_msg = NULL; + std::string __pyx_v_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + long __pyx_t_5; + std::string __pyx_t_6; + bool __pyx_t_7; + bool __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("can_list_to_can_capnp", 0); + + /* "selfdrive/boardd/boardd_api_impl.pyx":17 + * def can_list_to_can_capnp(can_msgs, msgtype='can', valid=True): + * cdef vector[can_frame] can_list + * can_list.reserve(len(can_msgs)) # <<<<<<<<<<<<<< + * + * cdef can_frame f + */ + __pyx_t_1 = PyObject_Length(__pyx_v_can_msgs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 17, __pyx_L1_error) + __pyx_v_can_list.reserve(__pyx_t_1); + + /* "selfdrive/boardd/boardd_api_impl.pyx":20 + * + * cdef can_frame f + * for can_msg in can_msgs: # <<<<<<<<<<<<<< + * f.address = can_msg[0] + * f.busTime = can_msg[1] + */ + if (likely(PyList_CheckExact(__pyx_v_can_msgs)) || PyTuple_CheckExact(__pyx_v_can_msgs)) { + __pyx_t_2 = __pyx_v_can_msgs; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_can_msgs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 20, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 20, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_2); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 20, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_can_msg, __pyx_t_4); + __pyx_t_4 = 0; + + /* "selfdrive/boardd/boardd_api_impl.pyx":21 + * cdef can_frame f + * for can_msg in can_msgs: + * f.address = can_msg[0] # <<<<<<<<<<<<<< + * f.busTime = can_msg[1] + * f.dat = can_msg[2] + */ + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_can_msg, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_4); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_f.address = __pyx_t_5; + + /* "selfdrive/boardd/boardd_api_impl.pyx":22 + * for can_msg in can_msgs: + * f.address = can_msg[0] + * f.busTime = can_msg[1] # <<<<<<<<<<<<<< + * f.dat = can_msg[2] + * f.src = can_msg[3] + */ + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_can_msg, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_4); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_f.busTime = __pyx_t_5; + + /* "selfdrive/boardd/boardd_api_impl.pyx":23 + * f.address = can_msg[0] + * f.busTime = can_msg[1] + * f.dat = can_msg[2] # <<<<<<<<<<<<<< + * f.src = can_msg[3] + * can_list.push_back(f) + */ + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_can_msg, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_f.dat = __pyx_t_6; + + /* "selfdrive/boardd/boardd_api_impl.pyx":24 + * f.busTime = can_msg[1] + * f.dat = can_msg[2] + * f.src = can_msg[3] # <<<<<<<<<<<<<< + * can_list.push_back(f) + * cdef string out + */ + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_can_msg, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_4); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_f.src = __pyx_t_5; + + /* "selfdrive/boardd/boardd_api_impl.pyx":25 + * f.dat = can_msg[2] + * f.src = can_msg[3] + * can_list.push_back(f) # <<<<<<<<<<<<<< + * cdef string out + * can_list_to_can_capnp_cpp(can_list, out, msgtype == 'sendcan', valid) + */ + try { + __pyx_v_can_list.push_back(__pyx_v_f); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 25, __pyx_L1_error) + } + + /* "selfdrive/boardd/boardd_api_impl.pyx":20 + * + * cdef can_frame f + * for can_msg in can_msgs: # <<<<<<<<<<<<<< + * f.address = can_msg[0] + * f.busTime = can_msg[1] + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "selfdrive/boardd/boardd_api_impl.pyx":27 + * can_list.push_back(f) + * cdef string out + * can_list_to_can_capnp_cpp(can_list, out, msgtype == 'sendcan', valid) # <<<<<<<<<<<<<< + * return out + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_msgtype, __pyx_n_u_sendcan, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_valid); if (unlikely((__pyx_t_8 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L1_error) + can_list_to_can_capnp_cpp(__pyx_v_can_list, __pyx_v_out, __pyx_t_7, __pyx_t_8); + + /* "selfdrive/boardd/boardd_api_impl.pyx":28 + * cdef string out + * can_list_to_can_capnp_cpp(can_list, out, msgtype == 'sendcan', valid) + * return out # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "selfdrive/boardd/boardd_api_impl.pyx":15 + * cdef extern void can_list_to_can_capnp_cpp(const vector[can_frame] &can_list, string &out, bool sendCan, bool valid) + * + * def can_list_to_can_capnp(can_msgs, msgtype='can', valid=True): # <<<<<<<<<<<<<< + * cdef vector[can_frame] can_list + * can_list.reserve(len(can_msgs)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("selfdrive.boardd.boardd_api_impl.can_list_to_can_capnp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_can_msg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + +static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) { + Py_ssize_t __pyx_v_length; + char const *__pyx_v_data; + std::string __pyx_r; + __Pyx_RefNannyDeclarations + char const *__pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0); + + /* "string.from_py":14 + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<< + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) + */ + __pyx_v_length = 0; + + /* "string.from_py":15 + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<< + * return string(data, length) + * + */ + __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(1, 15, __pyx_L1_error) + __pyx_v_data = __pyx_t_1; + + /* "string.from_py":16 + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = std::string(__pyx_v_data, __pyx_v_length); + goto __pyx_L0; + + /* "string.from_py":13 + * + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = 0 + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":31 + * + * @cname("__pyx_convert_PyObject_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0); + + /* "string.to_py":32 + * @cname("__pyx_convert_PyObject_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): + * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * cdef extern from *: + * cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":31 + * + * @cname("__pyx_convert_PyObject_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":37 + * + * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0); + + /* "string.to_py":38 + * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): + * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * cdef extern from *: + * cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":37 + * + * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":43 + * + * @cname("__pyx_convert_PyStr_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0); + + /* "string.to_py":44 + * @cname("__pyx_convert_PyStr_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): + * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * cdef extern from *: + * cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":43 + * + * @cname("__pyx_convert_PyStr_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":49 + * + * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0); + + /* "string.to_py":50 + * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): + * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * cdef extern from *: + * cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":49 + * + * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) + * cdef extern from *: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "string.to_py":55 + * + * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) + * + */ + +static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0); + + /* "string.to_py":56 + * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): + * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<< + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "string.to_py":55 + * + * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_boardd_api_impl(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_boardd_api_impl}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "boardd_api_impl", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_u_can, __pyx_k_can, sizeof(__pyx_k_can), 0, 1, 0, 1}, + {&__pyx_n_s_can_list, __pyx_k_can_list, sizeof(__pyx_k_can_list), 0, 0, 1, 1}, + {&__pyx_n_s_can_list_to_can_capnp, __pyx_k_can_list_to_can_capnp, sizeof(__pyx_k_can_list_to_can_capnp), 0, 0, 1, 1}, + {&__pyx_n_s_can_msg, __pyx_k_can_msg, sizeof(__pyx_k_can_msg), 0, 0, 1, 1}, + {&__pyx_n_s_can_msgs, __pyx_k_can_msgs, sizeof(__pyx_k_can_msgs), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_msgtype, __pyx_k_msgtype, sizeof(__pyx_k_msgtype), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, + {&__pyx_kp_s_selfdrive_boardd_boardd_api_impl, __pyx_k_selfdrive_boardd_boardd_api_impl, sizeof(__pyx_k_selfdrive_boardd_boardd_api_impl), 0, 0, 1, 0}, + {&__pyx_n_s_selfdrive_boardd_boardd_api_impl_2, __pyx_k_selfdrive_boardd_boardd_api_impl_2, sizeof(__pyx_k_selfdrive_boardd_boardd_api_impl_2), 0, 0, 1, 1}, + {&__pyx_n_u_sendcan, __pyx_k_sendcan, sizeof(__pyx_k_sendcan), 0, 1, 0, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_valid, __pyx_k_valid, sizeof(__pyx_k_valid), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + return 0; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "selfdrive/boardd/boardd_api_impl.pyx":15 + * cdef extern void can_list_to_can_capnp_cpp(const vector[can_frame] &can_list, string &out, bool sendCan, bool valid) + * + * def can_list_to_can_capnp(can_msgs, msgtype='can', valid=True): # <<<<<<<<<<<<<< + * cdef vector[can_frame] can_list + * can_list.reserve(len(can_msgs)) + */ + __pyx_tuple_ = PyTuple_Pack(7, __pyx_n_s_can_msgs, __pyx_n_s_msgtype, __pyx_n_s_valid, __pyx_n_s_can_list, __pyx_n_s_f, __pyx_n_s_can_msg, __pyx_n_s_out); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_selfdrive_boardd_boardd_api_impl, __pyx_n_s_can_list_to_can_capnp, 15, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initboardd_api_impl(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initboardd_api_impl(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_boardd_api_impl(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_boardd_api_impl(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_boardd_api_impl(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'boardd_api_impl' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_boardd_api_impl(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("boardd_api_impl", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_selfdrive__boardd__boardd_api_impl) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "selfdrive.boardd.boardd_api_impl")) { + if (unlikely(PyDict_SetItemString(modules, "selfdrive.boardd.boardd_api_impl", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + (void)__Pyx_modinit_type_init_code(); + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "selfdrive/boardd/boardd_api_impl.pyx":15 + * cdef extern void can_list_to_can_capnp_cpp(const vector[can_frame] &can_list, string &out, bool sendCan, bool valid) + * + * def can_list_to_can_capnp(can_msgs, msgtype='can', valid=True): # <<<<<<<<<<<<<< + * cdef vector[can_frame] can_list + * can_list.reserve(len(can_msgs)) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9selfdrive_6boardd_15boardd_api_impl_1can_list_to_can_capnp, NULL, __pyx_n_s_selfdrive_boardd_boardd_api_impl_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_can_list_to_can_capnp, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "selfdrive/boardd/boardd_api_impl.pyx":1 + * # distutils: language = c++ # <<<<<<<<<<<<<< + * # cython: language_level=3 + * from libcpp.vector cimport vector + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "string.to_py":55 + * + * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string") + * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<< + * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) + * + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init selfdrive.boardd.boardd_api_impl", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init selfdrive.boardd.boardd_api_impl"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; ip) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/selfdrive/boardd/boardd_api_impl.pyx b/selfdrive/boardd/boardd_api_impl.pyx new file mode 100644 index 000000000..0d428a925 --- /dev/null +++ b/selfdrive/boardd/boardd_api_impl.pyx @@ -0,0 +1,28 @@ +# distutils: language = c++ +# cython: language_level=3 +from libcpp.vector cimport vector +from libcpp.string cimport string +from libcpp cimport bool + +cdef struct can_frame: + long address + string dat + long busTime + long src + +cdef extern void can_list_to_can_capnp_cpp(const vector[can_frame] &can_list, string &out, bool sendCan, bool valid) + +def can_list_to_can_capnp(can_msgs, msgtype='can', valid=True): + cdef vector[can_frame] can_list + can_list.reserve(len(can_msgs)) + + cdef can_frame f + for can_msg in can_msgs: + f.address = can_msg[0] + f.busTime = can_msg[1] + f.dat = can_msg[2] + f.src = can_msg[3] + can_list.push_back(f) + cdef string out + can_list_to_can_capnp_cpp(can_list, out, msgtype == 'sendcan', valid) + return out diff --git a/selfdrive/boardd/boardd_api_impl.so b/selfdrive/boardd/boardd_api_impl.so new file mode 100755 index 000000000..ec7f370f3 Binary files /dev/null and b/selfdrive/boardd/boardd_api_impl.so differ diff --git a/selfdrive/boardd/can_list_to_can_capnp.cc b/selfdrive/boardd/can_list_to_can_capnp.cc new file mode 100644 index 000000000..faa0e3737 --- /dev/null +++ b/selfdrive/boardd/can_list_to_can_capnp.cc @@ -0,0 +1,25 @@ +#include "cereal/messaging/messaging.h" +#include "panda.h" + +extern "C" { + +void can_list_to_can_capnp_cpp(const std::vector &can_list, std::string &out, bool sendCan, bool valid) { + MessageBuilder msg; + auto event = msg.initEvent(valid); + + auto canData = sendCan ? event.initSendcan(can_list.size()) : event.initCan(can_list.size()); + int j = 0; + for (auto it = can_list.begin(); it != can_list.end(); it++, j++) { + auto c = canData[j]; + c.setAddress(it->address); + c.setBusTime(it->busTime); + c.setDat(kj::arrayPtr((uint8_t*)it->dat.data(), it->dat.size())); + c.setSrc(it->src); + } + const uint64_t msg_size = capnp::computeSerializedSizeInWords(msg) * sizeof(capnp::word); + out.resize(msg_size); + kj::ArrayOutputStream output_stream(kj::ArrayPtr((unsigned char *)out.data(), msg_size)); + capnp::writeMessage(output_stream, msg); +} + +} diff --git a/selfdrive/boardd/main.cc b/selfdrive/boardd/main.cc new file mode 100644 index 000000000..d802e42f8 --- /dev/null +++ b/selfdrive/boardd/main.cc @@ -0,0 +1,22 @@ +#include + +#include "selfdrive/boardd/boardd.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/util.h" +#include "selfdrive/hardware/hw.h" + +int main(int argc, char *argv[]) { + LOGW("starting boardd"); + + if (!Hardware::PC()) { + int err; + err = util::set_realtime_priority(54); + assert(err == 0); + err = util::set_core_affinity({Hardware::TICI() ? 4 : 3}); + assert(err == 0); + } + + std::vector serials(argv + 1, argv + argc); + boardd_main_thread(serials); + return 0; +} diff --git a/selfdrive/boardd/panda.cc b/selfdrive/boardd/panda.cc new file mode 100644 index 000000000..5e621b12c --- /dev/null +++ b/selfdrive/boardd/panda.cc @@ -0,0 +1,462 @@ +#include "selfdrive/boardd/panda.h" + +#include + +#include +#include +#include + +#include "cereal/messaging/messaging.h" +#include "panda/board/dlc_to_len.h" +#include "selfdrive/common/gpio.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/util.h" + +static int init_usb_ctx(libusb_context **context) { + assert(context != nullptr); + + int err = libusb_init(context); + if (err != 0) { + LOGE("libusb initialization error"); + return err; + } + +#if LIBUSB_API_VERSION >= 0x01000106 + libusb_set_option(*context, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_INFO); +#else + libusb_set_debug(*context, 3); +#endif + + return err; +} + + +Panda::Panda(std::string serial, uint32_t bus_offset) : bus_offset(bus_offset) { + // init libusb + ssize_t num_devices; + libusb_device **dev_list = NULL; + int err = init_usb_ctx(&ctx); + if (err != 0) { goto fail; } + + // connect by serial + num_devices = libusb_get_device_list(ctx, &dev_list); + if (num_devices < 0) { goto fail; } + for (size_t i = 0; i < num_devices; ++i) { + libusb_device_descriptor desc; + libusb_get_device_descriptor(dev_list[i], &desc); + if (desc.idVendor == 0xbbaa && desc.idProduct == 0xddcc) { + int ret = libusb_open(dev_list[i], &dev_handle); + if (dev_handle == NULL || ret < 0) { goto fail; } + + unsigned char desc_serial[26] = { 0 }; + ret = libusb_get_string_descriptor_ascii(dev_handle, desc.iSerialNumber, desc_serial, std::size(desc_serial)); + if (ret < 0) { goto fail; } + + usb_serial = std::string((char *)desc_serial, ret).c_str(); + if (serial.empty() || serial == usb_serial) { + break; + } + libusb_close(dev_handle); + dev_handle = NULL; + } + } + if (dev_handle == NULL) goto fail; + libusb_free_device_list(dev_list, 1); + dev_list = nullptr; + + if (libusb_kernel_driver_active(dev_handle, 0) == 1) { + libusb_detach_kernel_driver(dev_handle, 0); + } + + err = libusb_set_configuration(dev_handle, 1); + if (err != 0) { goto fail; } + + err = libusb_claim_interface(dev_handle, 0); + if (err != 0) { goto fail; } + + hw_type = get_hw_type(); + + assert((hw_type != cereal::PandaState::PandaType::WHITE_PANDA) && + (hw_type != cereal::PandaState::PandaType::GREY_PANDA)); + + has_rtc = (hw_type == cereal::PandaState::PandaType::UNO) || + (hw_type == cereal::PandaState::PandaType::DOS); + + return; + +fail: + if (dev_list != NULL) { + libusb_free_device_list(dev_list, 1); + } + cleanup(); + throw std::runtime_error("Error connecting to panda"); +} + +Panda::~Panda() { + std::lock_guard lk(usb_lock); + cleanup(); + connected = false; +} + +void Panda::cleanup() { + if (dev_handle) { + libusb_release_interface(dev_handle, 0); + libusb_close(dev_handle); + } + + if (ctx) { + libusb_exit(ctx); + } +} + +std::vector Panda::list() { + // init libusb + ssize_t num_devices; + libusb_context *context = NULL; + libusb_device **dev_list = NULL; + std::vector serials; + + int err = init_usb_ctx(&context); + if (err != 0) { return serials; } + + num_devices = libusb_get_device_list(context, &dev_list); + if (num_devices < 0) { + LOGE("libusb can't get device list"); + goto finish; + } + for (size_t i = 0; i < num_devices; ++i) { + libusb_device *device = dev_list[i]; + libusb_device_descriptor desc; + libusb_get_device_descriptor(device, &desc); + if (desc.idVendor == 0xbbaa && desc.idProduct == 0xddcc) { + libusb_device_handle *handle = NULL; + int ret = libusb_open(device, &handle); + if (ret < 0) { goto finish; } + + unsigned char desc_serial[26] = { 0 }; + ret = libusb_get_string_descriptor_ascii(handle, desc.iSerialNumber, desc_serial, std::size(desc_serial)); + libusb_close(handle); + if (ret < 0) { goto finish; } + + serials.push_back(std::string((char *)desc_serial, ret).c_str()); + } + } + +finish: + if (dev_list != NULL) { + libusb_free_device_list(dev_list, 1); + } + if (context) { + libusb_exit(context); + } + return serials; +} + +void Panda::handle_usb_issue(int err, const char func[]) { + LOGE_100("usb error %d \"%s\" in %s", err, libusb_strerror((enum libusb_error)err), func); + if (err == LIBUSB_ERROR_NO_DEVICE) { + LOGE("lost connection"); + connected = false; + } + // TODO: check other errors, is simply retrying okay? +} + +int Panda::usb_write(uint8_t bRequest, uint16_t wValue, uint16_t wIndex, unsigned int timeout) { + int err; + const uint8_t bmRequestType = LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE; + + if (!connected) { + return LIBUSB_ERROR_NO_DEVICE; + } + + std::lock_guard lk(usb_lock); + do { + err = libusb_control_transfer(dev_handle, bmRequestType, bRequest, wValue, wIndex, NULL, 0, timeout); + if (err < 0) handle_usb_issue(err, __func__); + } while (err < 0 && connected); + + return err; +} + +int Panda::usb_read(uint8_t bRequest, uint16_t wValue, uint16_t wIndex, unsigned char *data, uint16_t wLength, unsigned int timeout) { + int err; + const uint8_t bmRequestType = LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE; + + if (!connected) { + return LIBUSB_ERROR_NO_DEVICE; + } + + std::lock_guard lk(usb_lock); + do { + err = libusb_control_transfer(dev_handle, bmRequestType, bRequest, wValue, wIndex, data, wLength, timeout); + if (err < 0) handle_usb_issue(err, __func__); + } while (err < 0 && connected); + + return err; +} + +int Panda::usb_bulk_write(unsigned char endpoint, unsigned char* data, int length, unsigned int timeout) { + int err; + int transferred = 0; + + if (!connected) { + return 0; + } + + std::lock_guard lk(usb_lock); + do { + // Try sending can messages. If the receive buffer on the panda is full it will NAK + // and libusb will try again. After 5ms, it will time out. We will drop the messages. + err = libusb_bulk_transfer(dev_handle, endpoint, data, length, &transferred, timeout); + + if (err == LIBUSB_ERROR_TIMEOUT) { + LOGW("Transmit buffer full"); + break; + } else if (err != 0 || length != transferred) { + handle_usb_issue(err, __func__); + } + } while(err != 0 && connected); + + return transferred; +} + +int Panda::usb_bulk_read(unsigned char endpoint, unsigned char* data, int length, unsigned int timeout) { + int err; + int transferred = 0; + + if (!connected) { + return 0; + } + + std::lock_guard lk(usb_lock); + + do { + err = libusb_bulk_transfer(dev_handle, endpoint, data, length, &transferred, timeout); + + if (err == LIBUSB_ERROR_TIMEOUT) { + break; // timeout is okay to exit, recv still happened + } else if (err == LIBUSB_ERROR_OVERFLOW) { + comms_healthy = false; + LOGE_100("overflow got 0x%x", transferred); + } else if (err != 0) { + handle_usb_issue(err, __func__); + } + + } while(err != 0 && connected); + + return transferred; +} + +void Panda::set_safety_model(cereal::CarParams::SafetyModel safety_model, int safety_param) { + usb_write(0xdc, (uint16_t)safety_model, safety_param); +} + +void Panda::set_unsafe_mode(uint16_t unsafe_mode) { + usb_write(0xdf, unsafe_mode, 0); +} + +cereal::PandaState::PandaType Panda::get_hw_type() { + unsigned char hw_query[1] = {0}; + + usb_read(0xc1, 0, 0, hw_query, 1); + return (cereal::PandaState::PandaType)(hw_query[0]); +} + +void Panda::set_rtc(struct tm sys_time) { + // tm struct has year defined as years since 1900 + usb_write(0xa1, (uint16_t)(1900 + sys_time.tm_year), 0); + usb_write(0xa2, (uint16_t)(1 + sys_time.tm_mon), 0); + usb_write(0xa3, (uint16_t)sys_time.tm_mday, 0); + // usb_write(0xa4, (uint16_t)(1 + sys_time.tm_wday), 0); + usb_write(0xa5, (uint16_t)sys_time.tm_hour, 0); + usb_write(0xa6, (uint16_t)sys_time.tm_min, 0); + usb_write(0xa7, (uint16_t)sys_time.tm_sec, 0); +} + +struct tm Panda::get_rtc() { + struct __attribute__((packed)) timestamp_t { + uint16_t year; // Starts at 0 + uint8_t month; + uint8_t day; + uint8_t weekday; + uint8_t hour; + uint8_t minute; + uint8_t second; + } rtc_time = {0}; + + usb_read(0xa0, 0, 0, (unsigned char*)&rtc_time, sizeof(rtc_time)); + + struct tm new_time = { 0 }; + new_time.tm_year = rtc_time.year - 1900; // tm struct has year defined as years since 1900 + new_time.tm_mon = rtc_time.month - 1; + new_time.tm_mday = rtc_time.day; + new_time.tm_hour = rtc_time.hour; + new_time.tm_min = rtc_time.minute; + new_time.tm_sec = rtc_time.second; + + return new_time; +} + +void Panda::set_fan_speed(uint16_t fan_speed) { + usb_write(0xb1, fan_speed, 0); +} + +uint16_t Panda::get_fan_speed() { + uint16_t fan_speed_rpm = 0; + usb_read(0xb2, 0, 0, (unsigned char*)&fan_speed_rpm, sizeof(fan_speed_rpm)); + return fan_speed_rpm; +} + +void Panda::set_ir_pwr(uint16_t ir_pwr) { + usb_write(0xb0, ir_pwr, 0); +} + +std::optional Panda::get_state() { + health_t health {0}; + int err = usb_read(0xd2, 0, 0, (unsigned char*)&health, sizeof(health)); + return err >= 0 ? std::make_optional(health) : std::nullopt; +} + +void Panda::set_loopback(bool loopback) { + usb_write(0xe5, loopback, 0); +} + +std::optional> Panda::get_firmware_version() { + std::vector fw_sig_buf(128); + int read_1 = usb_read(0xd3, 0, 0, &fw_sig_buf[0], 64); + int read_2 = usb_read(0xd4, 0, 0, &fw_sig_buf[64], 64); + return ((read_1 == 64) && (read_2 == 64)) ? std::make_optional(fw_sig_buf) : std::nullopt; +} + +std::optional Panda::get_serial() { + char serial_buf[17] = {'\0'}; + int err = usb_read(0xd0, 0, 0, (uint8_t*)serial_buf, 16); + return err >= 0 ? std::make_optional(serial_buf) : std::nullopt; +} + +void Panda::set_power_saving(bool power_saving) { + usb_write(0xe7, power_saving, 0); +} + +void Panda::set_usb_power_mode(cereal::PeripheralState::UsbPowerMode power_mode) { + usb_write(0xe6, (uint16_t)power_mode, 0); +} + +void Panda::send_heartbeat(bool engaged) { + usb_write(0xf3, engaged, 0); +} + +void Panda::set_can_speed_kbps(uint16_t bus, uint16_t speed) { + usb_write(0xde, bus, (speed * 10)); +} + +void Panda::set_data_speed_kbps(uint16_t bus, uint16_t speed) { + usb_write(0xf9, bus, (speed * 10)); +} + +static uint8_t len_to_dlc(uint8_t len) { + if (len <= 8) { + return len; + } + if (len <= 24) { + return 8 + ((len - 8) / 4) + ((len % 4) ? 1 : 0); + } else { + return 11 + (len / 16) + ((len % 16) ? 1 : 0); + } +} + +static void write_packet(uint8_t *dest, int *write_pos, const uint8_t *src, size_t size) { + for (int i = 0, &pos = *write_pos; i < size; ++i, ++pos) { + // Insert counter every 64 bytes (first byte of 64 bytes USB packet) + if (pos % USBPACKET_MAX_SIZE == 0) { + dest[pos] = pos / USBPACKET_MAX_SIZE; + pos++; + } + dest[pos] = src[i]; + } +} + +void Panda::pack_can_buffer(const capnp::List::Reader &can_data_list, + std::function write_func) { + int32_t pos = 0; + uint8_t send_buf[2 * USB_TX_SOFT_LIMIT]; + + for (auto cmsg : can_data_list) { + // check if the message is intended for this panda + uint8_t bus = cmsg.getSrc(); + if (bus < bus_offset || bus >= (bus_offset + PANDA_BUS_CNT)) { + continue; + } + auto can_data = cmsg.getDat(); + uint8_t data_len_code = len_to_dlc(can_data.size()); + assert(can_data.size() <= ((hw_type == cereal::PandaState::PandaType::RED_PANDA) ? 64 : 8)); + assert(can_data.size() == dlc_to_len[data_len_code]); + + can_header header; + header.addr = cmsg.getAddress(); + header.extended = (cmsg.getAddress() >= 0x800) ? 1 : 0; + header.data_len_code = data_len_code; + header.bus = bus - bus_offset; + + write_packet(send_buf, &pos, (uint8_t *)&header, sizeof(can_header)); + write_packet(send_buf, &pos, (uint8_t *)can_data.begin(), can_data.size()); + if (pos >= USB_TX_SOFT_LIMIT) { + write_func(send_buf, pos); + pos = 0; + } + } + + // send remaining packets + if (pos > 0) write_func(send_buf, pos); +} + +void Panda::can_send(capnp::List::Reader can_data_list) { + pack_can_buffer(can_data_list, [=](uint8_t* data, size_t size) { + usb_bulk_write(3, data, size, 5); + }); +} + +bool Panda::can_receive(std::vector& out_vec) { + uint8_t data[RECV_SIZE]; + int recv = usb_bulk_read(0x81, (uint8_t*)data, RECV_SIZE); + if (!comms_healthy) { + return false; + } + if (recv == RECV_SIZE) { + LOGW("Panda receive buffer full"); + } + + return (recv <= 0) ? true : unpack_can_buffer(data, recv, out_vec); +} + +bool Panda::unpack_can_buffer(uint8_t *data, int size, std::vector &out_vec) { + recv_buf.clear(); + for (int i = 0; i < size; i += USBPACKET_MAX_SIZE) { + if (data[i] != i / USBPACKET_MAX_SIZE) { + LOGE("CAN: MALFORMED USB RECV PACKET"); + comms_healthy = false; + return false; + } + int chunk_len = std::min(USBPACKET_MAX_SIZE, (size - i)); + recv_buf.insert(recv_buf.end(), &data[i + 1], &data[i + chunk_len]); + } + + int pos = 0; + while (pos < recv_buf.size()) { + can_header header; + memcpy(&header, &recv_buf[pos], CANPACKET_HEAD_SIZE); + + can_frame &canData = out_vec.emplace_back(); + canData.busTime = 0; + canData.address = header.addr; + canData.src = header.bus + bus_offset; + if (header.rejected) { canData.src += CANPACKET_REJECTED; } + if (header.returned) { canData.src += CANPACKET_RETURNED; } + + const uint8_t data_len = dlc_to_len[header.data_len_code]; + canData.dat.assign((char *)&recv_buf[pos + CANPACKET_HEAD_SIZE], data_len); + + pos += CANPACKET_HEAD_SIZE + data_len; + } + return true; +} diff --git a/selfdrive/boardd/panda.h b/selfdrive/boardd/panda.h new file mode 100644 index 000000000..dbd866adf --- /dev/null +++ b/selfdrive/boardd/panda.h @@ -0,0 +1,101 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "cereal/gen/cpp/car.capnp.h" +#include "cereal/gen/cpp/log.capnp.h" +#include "panda/board/health.h" + +#define TIMEOUT 0 +#define PANDA_BUS_CNT 4 +#define RECV_SIZE (0x4000U) +#define USB_TX_SOFT_LIMIT (0x100U) +#define USBPACKET_MAX_SIZE (0x40) +#define CANPACKET_HEAD_SIZE 5U +#define CANPACKET_MAX_SIZE 72U +#define CANPACKET_REJECTED (0xC0U) +#define CANPACKET_RETURNED (0x80U) + +struct __attribute__((packed)) can_header { + uint8_t reserved : 1; + uint8_t bus : 3; + uint8_t data_len_code : 4; + uint8_t rejected : 1; + uint8_t returned : 1; + uint8_t extended : 1; + uint32_t addr : 29; +}; + +struct can_frame { + long address; + std::string dat; + long busTime; + long src; +}; + +class Panda { + private: + libusb_context *ctx = NULL; + libusb_device_handle *dev_handle = NULL; + std::mutex usb_lock; + std::vector recv_buf; + void handle_usb_issue(int err, const char func[]); + void cleanup(); + + public: + Panda(std::string serial="", uint32_t bus_offset=0); + ~Panda(); + + std::string usb_serial; + std::atomic connected = true; + std::atomic comms_healthy = true; + cereal::PandaState::PandaType hw_type = cereal::PandaState::PandaType::UNKNOWN; + bool has_rtc = false; + const uint32_t bus_offset; + + // Static functions + static std::vector list(); + + // HW communication + int usb_write(uint8_t bRequest, uint16_t wValue, uint16_t wIndex, unsigned int timeout=TIMEOUT); + int usb_read(uint8_t bRequest, uint16_t wValue, uint16_t wIndex, unsigned char *data, uint16_t wLength, unsigned int timeout=TIMEOUT); + int usb_bulk_write(unsigned char endpoint, unsigned char* data, int length, unsigned int timeout=TIMEOUT); + int usb_bulk_read(unsigned char endpoint, unsigned char* data, int length, unsigned int timeout=TIMEOUT); + + // Panda functionality + cereal::PandaState::PandaType get_hw_type(); + void set_safety_model(cereal::CarParams::SafetyModel safety_model, int safety_param=0); + void set_unsafe_mode(uint16_t unsafe_mode); + void set_rtc(struct tm sys_time); + struct tm get_rtc(); + void set_fan_speed(uint16_t fan_speed); + uint16_t get_fan_speed(); + void set_ir_pwr(uint16_t ir_pwr); + std::optional get_state(); + void set_loopback(bool loopback); + std::optional> get_firmware_version(); + std::optional get_serial(); + void set_power_saving(bool power_saving); + void set_usb_power_mode(cereal::PeripheralState::UsbPowerMode power_mode); + void send_heartbeat(bool engaged); + void set_can_speed_kbps(uint16_t bus, uint16_t speed); + void set_data_speed_kbps(uint16_t bus, uint16_t speed); + void can_send(capnp::List::Reader can_data_list); + bool can_receive(std::vector& out_vec); + +protected: + // for unit tests + Panda(uint32_t bus_offset) : bus_offset(bus_offset) {} + void pack_can_buffer(const capnp::List::Reader &can_data_list, + std::function write_func); + bool unpack_can_buffer(uint8_t *data, int size, std::vector &out_vec); +}; diff --git a/selfdrive/boardd/pigeon.cc b/selfdrive/boardd/pigeon.cc new file mode 100644 index 000000000..912f4b03e --- /dev/null +++ b/selfdrive/boardd/pigeon.cc @@ -0,0 +1,333 @@ +#include "selfdrive/boardd/pigeon.h" + +#include +#include +#include + +#include +#include +#include + +#include "selfdrive/common/gpio.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/util.h" +#include "selfdrive/locationd/ublox_msg.h" + +// Termios on macos doesn't define all baud rate constants +#ifndef B460800 +#define B460800 0010004 +#endif + +using namespace std::string_literals; + +extern ExitHandler do_exit; + +const std::string ack = "\xb5\x62\x05\x01\x02\x00"; +const std::string nack = "\xb5\x62\x05\x00\x02\x00"; +const std::string sos_save_ack = "\xb5\x62\x09\x14\x08\x00\x02\x00\x00\x00\x01\x00\x00\x00"; +const std::string sos_save_nack = "\xb5\x62\x09\x14\x08\x00\x02\x00\x00\x00\x00\x00\x00\x00"; + +Pigeon * Pigeon::connect(Panda * p) { + PandaPigeon * pigeon = new PandaPigeon(); + pigeon->connect(p); + + return pigeon; +} + +Pigeon * Pigeon::connect(const char * tty) { + TTYPigeon * pigeon = new TTYPigeon(); + pigeon->connect(tty); + + return pigeon; +} + +bool Pigeon::wait_for_ack(const std::string &ack_, const std::string &nack_, int timeout_ms) { + std::string s; + const double start_t = millis_since_boot(); + while (!do_exit) { + s += receive(); + + if (s.find(ack_) != std::string::npos) { + LOGD("Received ACK from ublox"); + return true; + } else if (s.find(nack_) != std::string::npos) { + LOGE("Received NACK from ublox"); + return false; + } else if (s.size() > 0x1000 || ((millis_since_boot() - start_t) > timeout_ms)) { + LOGE("No response from ublox"); + return false; + } + + util::sleep_for(1); // Allow other threads to be scheduled + } + return false; +} + +bool Pigeon::wait_for_ack() { + return wait_for_ack(ack, nack); +} + +bool Pigeon::send_with_ack(const std::string &cmd) { + send(cmd); + return wait_for_ack(); +} + +sos_restore_response Pigeon::wait_for_backup_restore_status(int timeout_ms) { + std::string s; + const double start_t = millis_since_boot(); + while (!do_exit) { + s += receive(); + + size_t position = s.find("\xb5\x62\x09\x14\x08\x00\x03"); + if (position != std::string::npos && s.size() >= (position + 11)) { + return static_cast(s[position + 10]); + } else if (s.size() > 0x1000 || ((millis_since_boot() - start_t) > timeout_ms)) { + LOGE("No backup restore response from ublox"); + return error; + } + + util::sleep_for(1); // Allow other threads to be scheduled + } + return error; +} + +void Pigeon::init() { + for (int i = 0; i < 10; i++) { + if (do_exit) return; + LOGW("panda GPS start"); + + // power off pigeon + set_power(false); + util::sleep_for(100); + + // 9600 baud at init + set_baud(9600); + + // power on pigeon + set_power(true); + util::sleep_for(500); + + // baud rate upping + send("\x24\x50\x55\x42\x58\x2C\x34\x31\x2C\x31\x2C\x30\x30\x30\x37\x2C\x30\x30\x30\x33\x2C\x34\x36\x30\x38\x30\x30\x2C\x30\x2A\x31\x35\x0D\x0A"s); + util::sleep_for(100); + + // set baud rate to 460800 + set_baud(460800); + + // init from ubloxd + // To generate this data, run selfdrive/locationd/test/ubloxd.py + if (!send_with_ack("\xB5\x62\x06\x00\x14\x00\x03\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01\x00\x00\x00\x00\x00\x1E\x7F"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x00\x14\x00\x00\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x35"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x00\x14\x00\x01\x00\x00\x00\xC0\x08\x00\x00\x00\x08\x07\x00\x01\x00\x01\x00\x00\x00\x00\x00\xF4\x80"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x00\x14\x00\x04\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1D\x85"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x00\x00\x00\x06\x18"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x00\x01\x00\x01\x08\x22"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x00\x01\x00\x03\x0A\x24"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x08\x06\x00\x64\x00\x01\x00\x00\x00\x79\x10"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x24\x24\x00\x05\x00\x04\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5A\x63"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x1E\x14\x00\x00\x00\x00\x00\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3C\x37"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x39\x08\x00\xFF\xAD\x62\xAD\x1E\x63\x00\x00\x83\x0C"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x24\x00\x00\x2A\x84"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x23\x00\x00\x29\x81"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x1E\x00\x00\x24\x72"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x39\x00\x00\x3F\xC3"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x01\x03\x00\x01\x07\x01\x13\x51"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x01\x03\x00\x02\x15\x01\x22\x70"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x01\x03\x00\x02\x13\x01\x20\x6C"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x01\x03\x00\x0A\x09\x01\x1E\x70"s)) continue; + if (!send_with_ack("\xB5\x62\x06\x01\x03\x00\x0A\x0B\x01\x20\x74"s)) continue; + + // check the backup restore status + send("\xB5\x62\x09\x14\x00\x00\x1D\x60"s); + sos_restore_response restore_status = wait_for_backup_restore_status(); + switch(restore_status) { + case restored: + LOGW("almanac backup restored"); + // clear the backup + send_with_ack("\xB5\x62\x06\x01\x03\x00\x0A\x0B\x01\x20\x74"s); + break; + case no_backup: + LOGW("no almanac backup found"); + break; + default: + LOGE("failed to restore almanac backup, status: %d", restore_status); + } + + auto time = util::get_time(); + if (util::time_valid(time)) { + LOGW("Sending current time to ublox"); + send(ublox::build_ubx_mga_ini_time_utc(time)); + } + + LOGW("panda GPS on"); + return; + } + LOGE("failed to initialize panda GPS"); +} + +void Pigeon::stop() { + LOGW("Storing almanac in ublox flash"); + + // Controlled GNSS stop + send("\xB5\x62\x06\x04\x04\x00\x00\x00\x08\x00\x16\x74"s); + + // Store almanac in flash + send("\xB5\x62\x09\x14\x04\x00\x00\x00\x00\x00\x21\xEC"s); + + if (wait_for_ack(sos_save_ack, sos_save_nack)) { + LOGW("Done storing almanac"); + } else { + LOGE("Error storing almanac"); + } +} + +void PandaPigeon::connect(Panda * p) { + panda = p; +} + +void PandaPigeon::set_baud(int baud) { + panda->usb_write(0xe2, 1, 0); + panda->usb_write(0xe4, 1, baud/300); +} + +void PandaPigeon::send(const std::string &s) { + int len = s.length(); + const char * dat = s.data(); + + unsigned char a[0x20+1]; + a[0] = 1; + for (int i=0; iusb_bulk_write(2, a, ll+1); + } +} + +std::string PandaPigeon::receive() { + std::string r; + r.reserve(0x1000 + 0x40); + unsigned char dat[0x40]; + while (r.length() < 0x1000) { + int len = panda->usb_read(0xe0, 1, 0, dat, sizeof(dat)); + if (len <= 0) break; + r.append((char*)dat, len); + } + + return r; +} + +void PandaPigeon::set_power(bool power) { + panda->usb_write(0xd9, power, 0); +} + +PandaPigeon::~PandaPigeon() { +} + +void handle_tty_issue(int err, const char func[]) { + LOGE_100("tty error %d \"%s\" in %s", err, strerror(err), func); +} + +void TTYPigeon::connect(const char * tty) { + pigeon_tty_fd = HANDLE_EINTR(open(tty, O_RDWR)); + if (pigeon_tty_fd < 0) { + handle_tty_issue(errno, __func__); + assert(pigeon_tty_fd >= 0); + } + int err = tcgetattr(pigeon_tty_fd, &pigeon_tty); + assert(err == 0); + + // configure tty + pigeon_tty.c_cflag &= ~PARENB; // disable parity + pigeon_tty.c_cflag &= ~CSTOPB; // single stop bit + pigeon_tty.c_cflag |= CS8; // 8 bits per byte + pigeon_tty.c_cflag &= ~CRTSCTS; // no RTS/CTS flow control + pigeon_tty.c_cflag |= CREAD | CLOCAL; // turn on READ & ignore ctrl lines + pigeon_tty.c_lflag &= ~ICANON; // disable canonical mode + pigeon_tty.c_lflag &= ~ISIG; // disable interpretation of INTR, QUIT and SUSP + pigeon_tty.c_iflag &= ~(IXON | IXOFF | IXANY); // turn off software flow ctrl + pigeon_tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL); // disable any special handling of received bytes + pigeon_tty.c_oflag &= ~OPOST; // prevent special interpretation of output bytes + pigeon_tty.c_oflag &= ~ONLCR; // prevent conversion of newline to carriage return/line feed + + // configure blocking behavior + pigeon_tty.c_cc[VMIN] = 0; // min amount of characters returned + pigeon_tty.c_cc[VTIME] = 0; // max blocking time in s/10 (0=inf) + + err = tcsetattr(pigeon_tty_fd, TCSANOW, &pigeon_tty); + assert(err == 0); +} + +void TTYPigeon::set_baud(int baud) { + speed_t baud_const = 0; + switch(baud) { + case 9600: + baud_const = B9600; + break; + case 460800: + baud_const = B460800; + break; + default: + assert(false); + } + + // make sure everything is tx'ed before changing baud + int err = tcdrain(pigeon_tty_fd); + assert(err == 0); + + // change baud + err = tcgetattr(pigeon_tty_fd, &pigeon_tty); + assert(err == 0); + err = cfsetspeed(&pigeon_tty, baud_const); + assert(err == 0); + err = tcsetattr(pigeon_tty_fd, TCSANOW, &pigeon_tty); + assert(err == 0); + + // flush + err = tcflush(pigeon_tty_fd, TCIOFLUSH); + assert(err == 0); +} + +void TTYPigeon::send(const std::string &s) { + int err = HANDLE_EINTR(write(pigeon_tty_fd, s.data(), s.length())); + + if(err < 0) { handle_tty_issue(err, __func__); } + err = tcdrain(pigeon_tty_fd); + if(err < 0) { handle_tty_issue(err, __func__); } +} + +std::string TTYPigeon::receive() { + std::string r; + r.reserve(0x1000 + 0x40); + char dat[0x40]; + while (r.length() < 0x1000) { + int len = read(pigeon_tty_fd, dat, sizeof(dat)); + if(len < 0) { + handle_tty_issue(len, __func__); + } else if (len == 0) { + break; + } else { + r.append(dat, len); + } + + } + return r; +} + +void TTYPigeon::set_power(bool power) { +#ifdef QCOM2 + int err = 0; + err += gpio_init(GPIO_UBLOX_RST_N, true); + err += gpio_init(GPIO_UBLOX_SAFEBOOT_N, true); + err += gpio_init(GPIO_UBLOX_PWR_EN, true); + + err += gpio_set(GPIO_UBLOX_RST_N, power); + err += gpio_set(GPIO_UBLOX_SAFEBOOT_N, power); + err += gpio_set(GPIO_UBLOX_PWR_EN, power); + assert(err == 0); +#endif +} + +TTYPigeon::~TTYPigeon() { + close(pigeon_tty_fd); +} diff --git a/selfdrive/boardd/pigeon.h b/selfdrive/boardd/pigeon.h new file mode 100644 index 000000000..c9ea4739d --- /dev/null +++ b/selfdrive/boardd/pigeon.h @@ -0,0 +1,58 @@ +#pragma once + +#include + +#include +#include + +#include "selfdrive/boardd/panda.h" + +enum sos_restore_response : int { + unknown = 0, + failed = 1, + restored = 2, + no_backup = 3, + error = -1 +}; + +class Pigeon { + public: + static Pigeon* connect(Panda * p); + static Pigeon* connect(const char * tty); + virtual ~Pigeon(){}; + + void init(); + void stop(); + bool wait_for_ack(); + bool wait_for_ack(const std::string &ack, const std::string &nack, int timeout_ms = 1000); + bool send_with_ack(const std::string &cmd); + sos_restore_response wait_for_backup_restore_status(int timeout_ms = 1000); + virtual void set_baud(int baud) = 0; + virtual void send(const std::string &s) = 0; + virtual std::string receive() = 0; + virtual void set_power(bool power) = 0; +}; + +class PandaPigeon : public Pigeon { + Panda * panda = NULL; +public: + ~PandaPigeon(); + void connect(Panda * p); + void set_baud(int baud); + void send(const std::string &s); + std::string receive(); + void set_power(bool power); +}; + + +class TTYPigeon : public Pigeon { + int pigeon_tty_fd = -1; + struct termios pigeon_tty; +public: + ~TTYPigeon(); + void connect(const char* tty); + void set_baud(int baud); + void send(const std::string &s); + std::string receive(); + void set_power(bool power); +}; diff --git a/selfdrive/boardd/set_time.py b/selfdrive/boardd/set_time.py new file mode 100755 index 000000000..7d17be4de --- /dev/null +++ b/selfdrive/boardd/set_time.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 +import datetime +import os +import struct +import usb1 + +REQUEST_IN = usb1.ENDPOINT_IN | usb1.TYPE_VENDOR | usb1.RECIPIENT_DEVICE +MIN_DATE = datetime.datetime(year=2021, month=4, day=1) + +def set_time(logger): + sys_time = datetime.datetime.today() + if sys_time > MIN_DATE: + logger.info("System time valid") + return + + try: + ctx = usb1.USBContext() + dev = ctx.openByVendorIDAndProductID(0xbbaa, 0xddcc) + if dev is None: + logger.info("No panda found") + return + + # Set system time from panda RTC time + dat = dev.controlRead(REQUEST_IN, 0xa0, 0, 0, 8) + a = struct.unpack("HBBBBBB", dat) + panda_time = datetime.datetime(a[0], a[1], a[2], a[4], a[5], a[6]) + if panda_time > MIN_DATE: + logger.info(f"adjusting time from '{sys_time}' to '{panda_time}'") + os.system(f"TZ=UTC date -s '{panda_time}'") + except Exception: + logger.warn("Failed to fetch time from panda") + +if __name__ == "__main__": + import logging + logging.basicConfig(level=logging.INFO) + + set_time(logging) diff --git a/selfdrive/camerad/SConscript b/selfdrive/camerad/SConscript new file mode 100644 index 000000000..85bc756bc --- /dev/null +++ b/selfdrive/camerad/SConscript @@ -0,0 +1,47 @@ +Import('env', 'arch', 'cereal', 'messaging', 'common', 'gpucommon', 'visionipc', 'USE_WEBCAM') + +libs = ['m', 'pthread', common, 'jpeg', 'OpenCL', 'yuv', cereal, messaging, 'zmq', 'capnp', 'kj', visionipc, gpucommon] + +if arch == "aarch64": + libs += ['gsl', 'CB', 'adreno_utils', 'EGL', 'GLESv3', 'cutils', 'ui'] + cameras = ['cameras/camera_qcom.cc'] +elif arch == "larch64": + libs += ['atomic'] + cameras = ['cameras/camera_qcom2.cc'] +else: + env['CXXFLAGS'] += ["-Wno-deprecated-declarations"] + if USE_WEBCAM: + libs += ['opencv_core', 'opencv_highgui', 'opencv_imgproc', 'opencv_videoio'] + cameras = ['cameras/camera_webcam.cc'] + env = env.Clone() + env.Append(CXXFLAGS = '-DWEBCAM') + env.Append(CFLAGS = '-DWEBCAM') + env.Append(CPPPATH = ['/usr/include/opencv4', '/usr/local/include/opencv4']) + else: + libs += ['avutil', 'avcodec', 'avformat', 'bz2', 'ssl', 'curl', 'crypto'] + # TODO: import replay_lib from root SConstruct + cameras = ['cameras/camera_replay.cc', + env.Object('camera-util', '#/selfdrive/ui/replay/util.cc'), + env.Object('camera-framereader', '#/selfdrive/ui/replay/framereader.cc'), + env.Object('camera-filereader', '#/selfdrive/ui/replay/filereader.cc')] + + if arch == "Darwin": + del libs[libs.index('OpenCL')] + del libs[libs.index(gpucommon)][gpucommon.index('GL')] + env = env.Clone() + env['FRAMEWORKS'] = ['OpenCL', 'OpenGL'] + +env.Program('camerad', [ + 'main.cc', + 'cameras/camera_common.cc', + 'transforms/rgb_to_yuv.cc', + 'imgproc/utils.cc', + cameras, + ], LIBS=libs) + +if GetOption("test"): + env.Program('test/ae_gray_test', [ + 'test/ae_gray_test.cc', + 'cameras/camera_common.cc', + 'transforms/rgb_to_yuv.cc', + ], LIBS=libs) diff --git a/selfdrive/camerad/camerad b/selfdrive/camerad/camerad new file mode 100755 index 000000000..7ec78d4e0 Binary files /dev/null and b/selfdrive/camerad/camerad differ diff --git a/selfdrive/camerad/cameras/camera_common.cc b/selfdrive/camerad/cameras/camera_common.cc new file mode 100644 index 000000000..b313f74e7 --- /dev/null +++ b/selfdrive/camerad/cameras/camera_common.cc @@ -0,0 +1,449 @@ +#include "selfdrive/camerad/cameras/camera_common.h" + +#include + +#include +#include +#include +#include + +#include "libyuv.h" +#include + +#include "selfdrive/camerad/imgproc/utils.h" +#include "selfdrive/common/clutil.h" +#include "selfdrive/common/modeldata.h" +#include "selfdrive/common/params.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/util.h" +#include "selfdrive/hardware/hw.h" + +#ifdef QCOM +#include "CL/cl_ext_qcom.h" +#include "selfdrive/camerad/cameras/camera_qcom.h" +#elif QCOM2 +#include "selfdrive/camerad/cameras/camera_qcom2.h" +#elif WEBCAM +#include "selfdrive/camerad/cameras/camera_webcam.h" +#else +#include "selfdrive/camerad/cameras/camera_replay.h" +#endif + +ExitHandler do_exit; + +class Debayer { +public: + Debayer(cl_device_id device_id, cl_context context, const CameraBuf *b, const CameraState *s) { + char args[4096]; + const CameraInfo *ci = &s->ci; + snprintf(args, sizeof(args), + "-cl-fast-relaxed-math -cl-denorms-are-zero " + "-DFRAME_WIDTH=%d -DFRAME_HEIGHT=%d -DFRAME_STRIDE=%d " + "-DRGB_WIDTH=%d -DRGB_HEIGHT=%d -DRGB_STRIDE=%d " + "-DBAYER_FLIP=%d -DHDR=%d -DCAM_NUM=%d", + ci->frame_width, ci->frame_height, ci->frame_stride, + b->rgb_width, b->rgb_height, b->rgb_stride, + ci->bayer_flip, ci->hdr, s->camera_num); + const char *cl_file = Hardware::TICI() ? "cameras/real_debayer.cl" : "cameras/debayer.cl"; + cl_program prg_debayer = cl_program_from_file(context, device_id, cl_file, args); + krnl_ = CL_CHECK_ERR(clCreateKernel(prg_debayer, "debayer10", &err)); + CL_CHECK(clReleaseProgram(prg_debayer)); + } + + void queue(cl_command_queue q, cl_mem cam_buf_cl, cl_mem buf_cl, int width, int height, float gain, cl_event *debayer_event) { + CL_CHECK(clSetKernelArg(krnl_, 0, sizeof(cl_mem), &cam_buf_cl)); + CL_CHECK(clSetKernelArg(krnl_, 1, sizeof(cl_mem), &buf_cl)); + + if (Hardware::TICI()) { + const int debayer_local_worksize = 16; + constexpr int localMemSize = (debayer_local_worksize + 2 * (3 / 2)) * (debayer_local_worksize + 2 * (3 / 2)) * sizeof(short int); + const size_t globalWorkSize[] = {size_t(width), size_t(height)}; + const size_t localWorkSize[] = {debayer_local_worksize, debayer_local_worksize}; + CL_CHECK(clSetKernelArg(krnl_, 2, localMemSize, 0)); + CL_CHECK(clEnqueueNDRangeKernel(q, krnl_, 2, NULL, globalWorkSize, localWorkSize, 0, 0, debayer_event)); + } else { + const size_t debayer_work_size = height; // doesn't divide evenly, is this okay? + CL_CHECK(clSetKernelArg(krnl_, 2, sizeof(float), &gain)); + CL_CHECK(clEnqueueNDRangeKernel(q, krnl_, 1, NULL, &debayer_work_size, NULL, 0, 0, debayer_event)); + } + } + + ~Debayer() { + CL_CHECK(clReleaseKernel(krnl_)); + } + +private: + cl_kernel krnl_; +}; + +void CameraBuf::init(cl_device_id device_id, cl_context context, CameraState *s, VisionIpcServer * v, int frame_cnt, VisionStreamType init_rgb_type, VisionStreamType init_yuv_type, release_cb init_release_callback) { + vipc_server = v; + this->rgb_type = init_rgb_type; + this->yuv_type = init_yuv_type; + this->release_callback = init_release_callback; + + const CameraInfo *ci = &s->ci; + camera_state = s; + frame_buf_count = frame_cnt; + + // RAW frame + const int frame_size = ci->frame_height * ci->frame_stride; + camera_bufs = std::make_unique(frame_buf_count); + camera_bufs_metadata = std::make_unique(frame_buf_count); + + for (int i = 0; i < frame_buf_count; i++) { + camera_bufs[i].allocate(frame_size); + camera_bufs[i].init_cl(device_id, context); + } + + rgb_width = ci->frame_width; + rgb_height = ci->frame_height; + + if (!Hardware::TICI() && ci->bayer) { + // debayering does a 2x downscale + rgb_width = ci->frame_width / 2; + rgb_height = ci->frame_height / 2; + } + + yuv_transform = get_model_yuv_transform(ci->bayer); + + vipc_server->create_buffers(rgb_type, UI_BUF_COUNT, true, rgb_width, rgb_height); + rgb_stride = vipc_server->get_buffer(rgb_type)->stride; + + vipc_server->create_buffers(yuv_type, YUV_BUFFER_COUNT, false, rgb_width, rgb_height); + + if (ci->bayer) { + debayer = new Debayer(device_id, context, this, s); + } + rgb2yuv = std::make_unique(context, device_id, rgb_width, rgb_height, rgb_stride); + +#ifdef __APPLE__ + q = CL_CHECK_ERR(clCreateCommandQueue(context, device_id, 0, &err)); +#else + const cl_queue_properties props[] = {0}; //CL_QUEUE_PRIORITY_KHR, CL_QUEUE_PRIORITY_HIGH_KHR, 0}; + q = CL_CHECK_ERR(clCreateCommandQueueWithProperties(context, device_id, props, &err)); +#endif +} + +CameraBuf::~CameraBuf() { + for (int i = 0; i < frame_buf_count; i++) { + camera_bufs[i].free(); + } + if (debayer) delete debayer; + if (q) CL_CHECK(clReleaseCommandQueue(q)); +} + +bool CameraBuf::acquire() { + if (!safe_queue.try_pop(cur_buf_idx, 1)) return false; + + if (camera_bufs_metadata[cur_buf_idx].frame_id == -1) { + LOGE("no frame data? wtf"); + release(); + return false; + } + + cur_frame_data = camera_bufs_metadata[cur_buf_idx]; + cur_rgb_buf = vipc_server->get_buffer(rgb_type); + cl_mem camrabuf_cl = camera_bufs[cur_buf_idx].buf_cl; + cl_event event; + + if (debayer) { + float gain = 0.0; + +#ifndef QCOM2 + gain = camera_state->digital_gain; + if ((int)gain == 0) gain = 1.0; +#endif + + debayer->queue(q, camrabuf_cl, cur_rgb_buf->buf_cl, rgb_width, rgb_height, gain, &event); + } else { + assert(rgb_stride == camera_state->ci.frame_stride); + CL_CHECK(clEnqueueCopyBuffer(q, camrabuf_cl, cur_rgb_buf->buf_cl, 0, 0, cur_rgb_buf->len, 0, 0, &event)); + } + + clWaitForEvents(1, &event); + CL_CHECK(clReleaseEvent(event)); + + cur_yuv_buf = vipc_server->get_buffer(yuv_type); + rgb2yuv->queue(q, cur_rgb_buf->buf_cl, cur_yuv_buf->buf_cl); + + VisionIpcBufExtra extra = { + cur_frame_data.frame_id, + cur_frame_data.timestamp_sof, + cur_frame_data.timestamp_eof, + }; + cur_rgb_buf->set_frame_id(cur_frame_data.frame_id); + cur_yuv_buf->set_frame_id(cur_frame_data.frame_id); + vipc_server->send(cur_rgb_buf, &extra); + vipc_server->send(cur_yuv_buf, &extra); + + return true; +} + +void CameraBuf::release() { + if (release_callback) { + release_callback((void*)camera_state, cur_buf_idx); + } +} + +void CameraBuf::queue(size_t buf_idx) { + safe_queue.push(buf_idx); +} + +// common functions + +void fill_frame_data(cereal::FrameData::Builder &framed, const FrameMetadata &frame_data) { + framed.setFrameId(frame_data.frame_id); + framed.setTimestampEof(frame_data.timestamp_eof); + framed.setTimestampSof(frame_data.timestamp_sof); + framed.setFrameLength(frame_data.frame_length); + framed.setIntegLines(frame_data.integ_lines); + framed.setGain(frame_data.gain); + framed.setHighConversionGain(frame_data.high_conversion_gain); + framed.setMeasuredGreyFraction(frame_data.measured_grey_fraction); + framed.setTargetGreyFraction(frame_data.target_grey_fraction); + framed.setLensPos(frame_data.lens_pos); + framed.setLensErr(frame_data.lens_err); + framed.setLensTruePos(frame_data.lens_true_pos); +} + +kj::Array get_frame_image(const CameraBuf *b) { + static const int x_min = util::getenv("XMIN", 0); + static const int y_min = util::getenv("YMIN", 0); + static const int env_xmax = util::getenv("XMAX", -1); + static const int env_ymax = util::getenv("YMAX", -1); + static const int scale = util::getenv("SCALE", 1); + + assert(b->cur_rgb_buf); + + const int x_max = env_xmax != -1 ? env_xmax : b->rgb_width - 1; + const int y_max = env_ymax != -1 ? env_ymax : b->rgb_height - 1; + const int new_width = (x_max - x_min + 1) / scale; + const int new_height = (y_max - y_min + 1) / scale; + const uint8_t *dat = (const uint8_t *)b->cur_rgb_buf->addr; + + kj::Array frame_image = kj::heapArray(new_width*new_height*3); + uint8_t *resized_dat = frame_image.begin(); + int goff = x_min*3 + y_min*b->rgb_stride; + for (int r=0;rrgb_stride*scale+c*3*scale], 3*sizeof(uint8_t)); + } + } + return kj::mv(frame_image); +} + +static kj::Array yuv420_to_jpeg(const CameraBuf *b, int thumbnail_width, int thumbnail_height) { + // make the buffer big enough. jpeg_write_raw_data requires 16-pixels aligned height to be used. + std::unique_ptr buf(new uint8_t[(thumbnail_width * ((thumbnail_height + 15) & ~15) * 3) / 2]); + uint8_t *y_plane = buf.get(); + uint8_t *u_plane = y_plane + thumbnail_width * thumbnail_height; + uint8_t *v_plane = u_plane + (thumbnail_width * thumbnail_height) / 4; + { + int result = libyuv::I420Scale( + b->cur_yuv_buf->y, b->rgb_width, b->cur_yuv_buf->u, b->rgb_width / 2, b->cur_yuv_buf->v, b->rgb_width / 2, + b->rgb_width, b->rgb_height, + y_plane, thumbnail_width, u_plane, thumbnail_width / 2, v_plane, thumbnail_width / 2, + thumbnail_width, thumbnail_height, libyuv::kFilterNone); + if (result != 0) { + LOGE("Generate YUV thumbnail failed."); + return {}; + } + } + + struct jpeg_compress_struct cinfo; + struct jpeg_error_mgr jerr; + cinfo.err = jpeg_std_error(&jerr); + jpeg_create_compress(&cinfo); + + uint8_t *thumbnail_buffer = nullptr; + size_t thumbnail_len = 0; + jpeg_mem_dest(&cinfo, &thumbnail_buffer, &thumbnail_len); + + cinfo.image_width = thumbnail_width; + cinfo.image_height = thumbnail_height; + cinfo.input_components = 3; + + jpeg_set_defaults(&cinfo); + jpeg_set_colorspace(&cinfo, JCS_YCbCr); + // configure sampling factors for yuv420. + cinfo.comp_info[0].h_samp_factor = 2; // Y + cinfo.comp_info[0].v_samp_factor = 2; + cinfo.comp_info[1].h_samp_factor = 1; // U + cinfo.comp_info[1].v_samp_factor = 1; + cinfo.comp_info[2].h_samp_factor = 1; // V + cinfo.comp_info[2].v_samp_factor = 1; + cinfo.raw_data_in = TRUE; + + jpeg_set_quality(&cinfo, 50, TRUE); + jpeg_start_compress(&cinfo, TRUE); + + JSAMPROW y[16], u[8], v[8]; + JSAMPARRAY planes[3]{y, u, v}; + + for (int line = 0; line < cinfo.image_height; line += 16) { + for (int i = 0; i < 16; ++i) { + y[i] = y_plane + (line + i) * cinfo.image_width; + if (i % 2 == 0) { + int offset = (cinfo.image_width / 2) * ((i + line) / 2); + u[i / 2] = u_plane + offset; + v[i / 2] = v_plane + offset; + } + } + jpeg_write_raw_data(&cinfo, planes, 16); + } + + jpeg_finish_compress(&cinfo); + jpeg_destroy_compress(&cinfo); + + kj::Array dat = kj::heapArray(thumbnail_buffer, thumbnail_len); + free(thumbnail_buffer); + return dat; +} + +static void publish_thumbnail(PubMaster *pm, const CameraBuf *b) { + auto thumbnail = yuv420_to_jpeg(b, b->rgb_width / 4, b->rgb_height / 4); + if (thumbnail.size() == 0) return; + + MessageBuilder msg; + auto thumbnaild = msg.initEvent().initThumbnail(); + thumbnaild.setFrameId(b->cur_frame_data.frame_id); + thumbnaild.setTimestampEof(b->cur_frame_data.timestamp_eof); + thumbnaild.setThumbnail(thumbnail); + + pm->send("thumbnail", msg); +} + +float set_exposure_target(const CameraBuf *b, int x_start, int x_end, int x_skip, int y_start, int y_end, int y_skip) { + int lum_med; + uint32_t lum_binning[256] = {0}; + const uint8_t *pix_ptr = b->cur_yuv_buf->y; + + unsigned int lum_total = 0; + for (int y = y_start; y < y_end; y += y_skip) { + for (int x = x_start; x < x_end; x += x_skip) { + uint8_t lum = pix_ptr[(y * b->rgb_width) + x]; + lum_binning[lum]++; + lum_total += 1; + } + } + + + // Find mean lumimance value + unsigned int lum_cur = 0; + for (lum_med = 255; lum_med >= 0; lum_med--) { + lum_cur += lum_binning[lum_med]; + + if (lum_cur >= lum_total / 2) { + break; + } + } + + return lum_med / 256.0; +} + +void *processing_thread(MultiCameraState *cameras, CameraState *cs, process_thread_cb callback) { + const char *thread_name = nullptr; + if (cs == &cameras->road_cam) { + thread_name = "RoadCamera"; + } else if (cs == &cameras->driver_cam) { + thread_name = "DriverCamera"; + } else { + thread_name = "WideRoadCamera"; + } + util::set_thread_name(thread_name); + + uint32_t cnt = 0; + while (!do_exit) { + if (!cs->buf.acquire()) continue; + + callback(cameras, cs, cnt); + + if (cs == &(cameras->road_cam) && cameras->pm && cnt % 100 == 3) { + // this takes 10ms??? + publish_thumbnail(cameras->pm, &(cs->buf)); + } + cs->buf.release(); + ++cnt; + } + return NULL; +} + +std::thread start_process_thread(MultiCameraState *cameras, CameraState *cs, process_thread_cb callback) { + return std::thread(processing_thread, cameras, cs, callback); +} + +static void driver_cam_auto_exposure(CameraState *c, SubMaster &sm) { + static const bool is_rhd = Params().getBool("IsRHD"); + struct ExpRect {int x1, x2, x_skip, y1, y2, y_skip;}; + const CameraBuf *b = &c->buf; + + int x_offset = 0, y_offset = 0; + int frame_width = b->rgb_width, frame_height = b->rgb_height; + + + ExpRect def_rect; + if (Hardware::TICI()) { + x_offset = 630, y_offset = 156; + frame_width = 668, frame_height = frame_width / 1.33; + def_rect = {96, 1832, 2, 242, 1148, 4}; + } else { + def_rect = {is_rhd ? 0 : b->rgb_width * 3 / 5, is_rhd ? b->rgb_width * 2 / 5 : b->rgb_width, 2, + b->rgb_height / 3, b->rgb_height, 1}; + } + + static ExpRect rect = def_rect; + // use driver face crop for AE + if (Hardware::EON() && sm.updated("driverState")) { + if (auto state = sm["driverState"].getDriverState(); state.getFaceProb() > 0.4) { + auto face_position = state.getFacePosition(); + int x = is_rhd ? 0 : frame_width - (0.5 * frame_height); + x += (face_position[0] * (is_rhd ? -1.0 : 1.0) + 0.5) * (0.5 * frame_height) + x_offset; + int y = (face_position[1] + 0.5) * frame_height + y_offset; + rect = {std::max(0, x - 72), std::min(b->rgb_width - 1, x + 72), 2, + std::max(0, y - 72), std::min(b->rgb_height - 1, y + 72), 1}; + } + } + + camera_autoexposure(c, set_exposure_target(b, rect.x1, rect.x2, rect.x_skip, rect.y1, rect.y2, rect.y_skip)); +} + +void common_process_driver_camera(MultiCameraState *s, CameraState *c, int cnt) { + int j = Hardware::TICI() ? 1 : 3; + if (cnt % j == 0) { + s->sm->update(0); + driver_cam_auto_exposure(c, *(s->sm)); + } + MessageBuilder msg; + auto framed = msg.initEvent().initDriverCameraState(); + framed.setFrameType(cereal::FrameData::FrameType::FRONT); + fill_frame_data(framed, c->buf.cur_frame_data); + if (env_send_driver) { + framed.setImage(get_frame_image(&c->buf)); + } + s->pm->send("driverCameraState", msg); +} + + +void camerad_thread() { + cl_device_id device_id = cl_get_device_id(CL_DEVICE_TYPE_DEFAULT); + // TODO: do this for QCOM2 too +#if defined(QCOM) + const cl_context_properties props[] = {CL_CONTEXT_PRIORITY_HINT_QCOM, CL_PRIORITY_HINT_HIGH_QCOM, 0}; + cl_context context = CL_CHECK_ERR(clCreateContext(props, 1, &device_id, NULL, NULL, &err)); +#else + cl_context context = CL_CHECK_ERR(clCreateContext(NULL, 1, &device_id, NULL, NULL, &err)); +#endif + + MultiCameraState cameras = {}; + VisionIpcServer vipc_server("camerad", device_id, context); + + cameras_init(&vipc_server, &cameras, device_id, context); + cameras_open(&cameras); + + vipc_server.start_listener(); + + cameras_run(&cameras); + + CL_CHECK(clReleaseContext(context)); +} diff --git a/selfdrive/camerad/cameras/camera_common.h b/selfdrive/camerad/cameras/camera_common.h new file mode 100644 index 000000000..f53f06dce --- /dev/null +++ b/selfdrive/camerad/cameras/camera_common.h @@ -0,0 +1,137 @@ +#pragma once + +#include +#include +#include +#include + +#include "cereal/messaging/messaging.h" +#include "cereal/visionipc/visionbuf.h" +#include "cereal/visionipc/visionipc.h" +#include "cereal/visionipc/visionipc_server.h" +#include "selfdrive/camerad/transforms/rgb_to_yuv.h" +#include "selfdrive/common/mat.h" +#include "selfdrive/common/queue.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/visionimg.h" +#include "selfdrive/hardware/hw.h" + +#define CAMERA_ID_IMX298 0 +#define CAMERA_ID_IMX179 1 +#define CAMERA_ID_S5K3P8SP 2 +#define CAMERA_ID_OV8865 3 +#define CAMERA_ID_IMX298_FLIPPED 4 +#define CAMERA_ID_OV10640 5 +#define CAMERA_ID_LGC920 6 +#define CAMERA_ID_LGC615 7 +#define CAMERA_ID_AR0231 8 +#define CAMERA_ID_MAX 9 + +const int UI_BUF_COUNT = 4; +const int YUV_BUFFER_COUNT = Hardware::EON() ? 100 : 40; + +enum CameraType { + RoadCam = 0, + DriverCam, + WideRoadCam +}; + +// TODO: remove these once all the internal tools are moved to vipc +const bool env_send_driver = getenv("SEND_DRIVER") != NULL; +const bool env_send_road = getenv("SEND_ROAD") != NULL; +const bool env_send_wide_road = getenv("SEND_WIDE_ROAD") != NULL; + +// for debugging +// note: ONLY_ROAD doesn't work, likely due to a mixup with wideRoad cam in the kernel +const bool env_only_driver = getenv("ONLY_DRIVER") != NULL; +const bool env_debug_frames = getenv("DEBUG_FRAMES") != NULL; + +typedef void (*release_cb)(void *cookie, int buf_idx); + +typedef struct CameraInfo { + int frame_width, frame_height; + int frame_stride; + bool bayer; + int bayer_flip; + bool hdr; +} CameraInfo; + +typedef struct FrameMetadata { + uint32_t frame_id; + unsigned int frame_length; + + // Timestamps + uint64_t timestamp_sof; // only set on tici + uint64_t timestamp_eof; + + // Exposure + unsigned int integ_lines; + bool high_conversion_gain; + float gain; + float measured_grey_fraction; + float target_grey_fraction; + + // Focus + unsigned int lens_pos; + float lens_err; + float lens_true_pos; +} FrameMetadata; + +typedef struct CameraExpInfo { + int op_id; + float grey_frac; +} CameraExpInfo; + +struct MultiCameraState; +struct CameraState; +class Debayer; + +class CameraBuf { +private: + VisionIpcServer *vipc_server; + CameraState *camera_state; + Debayer *debayer = nullptr; + std::unique_ptr rgb2yuv; + + VisionStreamType rgb_type, yuv_type; + + int cur_buf_idx; + + SafeQueue safe_queue; + + int frame_buf_count; + release_cb release_callback; + +public: + cl_command_queue q; + FrameMetadata cur_frame_data; + VisionBuf *cur_rgb_buf; + VisionBuf *cur_yuv_buf; + std::unique_ptr camera_bufs; + std::unique_ptr camera_bufs_metadata; + int rgb_width, rgb_height, rgb_stride; + + mat3 yuv_transform; + + CameraBuf() = default; + ~CameraBuf(); + void init(cl_device_id device_id, cl_context context, CameraState *s, VisionIpcServer * v, int frame_cnt, VisionStreamType rgb_type, VisionStreamType yuv_type, release_cb release_callback=nullptr); + bool acquire(); + void release(); + void queue(size_t buf_idx); +}; + +typedef void (*process_thread_cb)(MultiCameraState *s, CameraState *c, int cnt); + +void fill_frame_data(cereal::FrameData::Builder &framed, const FrameMetadata &frame_data); +kj::Array get_frame_image(const CameraBuf *b); +float set_exposure_target(const CameraBuf *b, int x_start, int x_end, int x_skip, int y_start, int y_end, int y_skip); +std::thread start_process_thread(MultiCameraState *cameras, CameraState *cs, process_thread_cb callback); +void common_process_driver_camera(MultiCameraState *s, CameraState *c, int cnt); + +void cameras_init(VisionIpcServer *v, MultiCameraState *s, cl_device_id device_id, cl_context ctx); +void cameras_open(MultiCameraState *s); +void cameras_run(MultiCameraState *s); +void cameras_close(MultiCameraState *s); +void camera_autoexposure(CameraState *s, float grey_frac); +void camerad_thread(); diff --git a/selfdrive/camerad/cameras/camera_qcom.cc b/selfdrive/camerad/cameras/camera_qcom.cc new file mode 100644 index 000000000..ecb1c8ffe --- /dev/null +++ b/selfdrive/camerad/cameras/camera_qcom.cc @@ -0,0 +1,1173 @@ +#include "selfdrive/camerad/cameras/camera_qcom.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "selfdrive/camerad/cameras/sensor_i2c.h" +#include "selfdrive/camerad/include/msm_cam_sensor.h" +#include "selfdrive/camerad/include/msmb_camera.h" +#include "selfdrive/camerad/include/msmb_isp.h" +#include "selfdrive/camerad/include/msmb_ispif.h" +#include "selfdrive/common/clutil.h" +#include "selfdrive/common/params.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/timing.h" +#include "selfdrive/common/util.h" + +// leeco actuator (DW9800W H-Bridge Driver IC) +// from sniff +const uint16_t INFINITY_DAC = 364; + +extern ExitHandler do_exit; + +static int cam_ioctl(int fd, unsigned long int request, void *arg, const char *log_msg = nullptr) { + int err = HANDLE_EINTR(ioctl(fd, request, arg)); + if (err != 0 && log_msg) { + LOG(util::string_format("%s: %d", log_msg, err).c_str()); + } + return err; +} +// global var for AE/AF ops +std::atomic road_cam_exp{{0}}; +std::atomic driver_cam_exp{{0}}; + +CameraInfo cameras_supported[CAMERA_ID_MAX] = { + [CAMERA_ID_IMX298] = { + .frame_width = 2328, + .frame_height = 1748, + .frame_stride = 2912, + .bayer = true, + .bayer_flip = 3, + .hdr = true + }, + [CAMERA_ID_OV8865] = { + .frame_width = 1632, + .frame_height = 1224, + .frame_stride = 2040, // seems right + .bayer = true, + .bayer_flip = 3, + .hdr = false + }, + // this exists to get the kernel to build for the LeEco in release + [CAMERA_ID_IMX298_FLIPPED] = { + .frame_width = 2328, + .frame_height = 1748, + .frame_stride = 2912, + .bayer = true, + .bayer_flip = 3, + .hdr = true + }, + [CAMERA_ID_OV10640] = { + .frame_width = 1280, + .frame_height = 1080, + .frame_stride = 2040, + .bayer = true, + .bayer_flip = 0, + .hdr = true + }, +}; + +static void camera_release_buffer(void* cookie, int buf_idx) { + CameraState *s = (CameraState *)cookie; + // printf("camera_release_buffer %d\n", buf_idx); + s->ss[0].qbuf_info[buf_idx].dirty_buf = 1; + HANDLE_EINTR(ioctl(s->isp_fd, VIDIOC_MSM_ISP_ENQUEUE_BUF, &s->ss[0].qbuf_info[buf_idx])); +} + +int sensor_write_regs(CameraState *s, struct msm_camera_i2c_reg_array* arr, size_t size, msm_camera_i2c_data_type data_type) { + struct msm_camera_i2c_reg_setting out_settings = { + .reg_setting = arr, + .size = (uint16_t)size, + .addr_type = MSM_CAMERA_I2C_WORD_ADDR, + .data_type = data_type, + .delay = 0, + }; + sensorb_cfg_data cfg_data = {.cfgtype = CFG_WRITE_I2C_ARRAY, .cfg.setting = &out_settings}; + return HANDLE_EINTR(ioctl(s->sensor_fd, VIDIOC_MSM_SENSOR_CFG, &cfg_data)); +} + +static int imx298_apply_exposure(CameraState *s, int gain, int integ_lines, uint32_t frame_length) { + int analog_gain = std::min(gain, 448); + s->digital_gain = gain > 448 ? (512.0/(512-(gain))) / 8.0 : 1.0; + //printf("%5d/%5d %5d %f\n", s->cur_integ_lines, s->frame_length, analog_gain, s->digital_gain); + + struct msm_camera_i2c_reg_array reg_array[] = { + // REG_HOLD + {0x104,0x1,0}, + {0x3002,0x0,0}, // long autoexposure off + + // FRM_LENGTH + {0x340, (uint16_t)(frame_length >> 8), 0}, {0x341, (uint16_t)(frame_length & 0xff), 0}, + // INTEG_TIME aka coarse_int_time_addr aka shutter speed + {0x202, (uint16_t)(integ_lines >> 8), 0}, {0x203, (uint16_t)(integ_lines & 0xff),0}, + // global_gain_addr + // if you assume 1x gain is 32, 448 is 14x gain, aka 2^14=16384 + {0x204, (uint16_t)(analog_gain >> 8), 0}, {0x205, (uint16_t)(analog_gain & 0xff),0}, + + // digital gain for colors: gain_greenR, gain_red, gain_blue, gain_greenB + /*{0x20e, digital_gain_gr >> 8, 0}, {0x20f,digital_gain_gr & 0xFF,0}, + {0x210, digital_gain_r >> 8, 0}, {0x211,digital_gain_r & 0xFF,0}, + {0x212, digital_gain_b >> 8, 0}, {0x213,digital_gain_b & 0xFF,0}, + {0x214, digital_gain_gb >> 8, 0}, {0x215,digital_gain_gb & 0xFF,0},*/ + + // REG_HOLD + {0x104,0x0,0}, + }; + return sensor_write_regs(s, reg_array, std::size(reg_array), MSM_CAMERA_I2C_BYTE_DATA); +} + +static int ov8865_apply_exposure(CameraState *s, int gain, int integ_lines, uint32_t frame_length) { + //printf("driver camera: %d %d %d\n", gain, integ_lines, frame_length); + int coarse_gain_bitmap, fine_gain_bitmap; + + // get bitmaps from iso + static const int gains[] = {0, 100, 200, 400, 800}; + int i; + for (i = 1; i < std::size(gains); i++) { + if (gain >= gains[i - 1] && gain < gains[i]) + break; + } + int coarse_gain = i - 1; + float fine_gain = (gain - gains[coarse_gain])/(float)(gains[coarse_gain+1]-gains[coarse_gain]); + coarse_gain_bitmap = (1 << coarse_gain) - 1; + fine_gain_bitmap = ((int)(16*fine_gain) << 3) + 128; // 7th is always 1, 0-2nd are always 0 + + integ_lines *= 16; // The exposure value in reg is in 16ths of a line + + struct msm_camera_i2c_reg_array reg_array[] = { + //{0x104,0x1,0}, + + // FRM_LENGTH + {0x380e, (uint16_t)(frame_length >> 8), 0}, {0x380f, (uint16_t)(frame_length & 0xff), 0}, + // AEC EXPO + {0x3500, (uint16_t)(integ_lines >> 16), 0}, {0x3501, (uint16_t)(integ_lines >> 8), 0}, {0x3502, (uint16_t)(integ_lines & 0xff),0}, + // AEC MANUAL + {0x3503, 0x4, 0}, + // AEC GAIN + {0x3508, (uint16_t)(coarse_gain_bitmap), 0}, {0x3509, (uint16_t)(fine_gain_bitmap), 0}, + + //{0x104,0x0,0}, + }; + return sensor_write_regs(s, reg_array, std::size(reg_array), MSM_CAMERA_I2C_BYTE_DATA); +} + +static void camera_init(VisionIpcServer *v, CameraState *s, int camera_id, int camera_num, + uint32_t pixel_clock, uint32_t line_length_pclk, + uint32_t max_gain, uint32_t fps, cl_device_id device_id, cl_context ctx, + VisionStreamType rgb_type, VisionStreamType yuv_type) { + s->camera_num = camera_num; + s->camera_id = camera_id; + + assert(camera_id < std::size(cameras_supported)); + s->ci = cameras_supported[camera_id]; + assert(s->ci.frame_width != 0); + + s->pixel_clock = pixel_clock; + s->max_gain = max_gain; + s->fps = fps; + s->frame_length = s->pixel_clock / line_length_pclk / s->fps; + s->self_recover = 0; + + s->apply_exposure = (camera_id == CAMERA_ID_IMX298) ? imx298_apply_exposure : ov8865_apply_exposure; + s->buf.init(device_id, ctx, s, v, FRAME_BUF_COUNT, rgb_type, yuv_type, camera_release_buffer); +} + +void cameras_init(VisionIpcServer *v, MultiCameraState *s, cl_device_id device_id, cl_context ctx) { + char project_name[1024] = {0}; + property_get("ro.boot.project_name", project_name, ""); + assert(strlen(project_name) == 0); + + // sensor is flipped in LP3 + // IMAGE_ORIENT = 3 + init_array_imx298[0].reg_data = 3; + + // 0 = ISO 100 + // 256 = ISO 200 + // 384 = ISO 400 + // 448 = ISO 800 + // 480 = ISO 1600 + // 496 = ISO 3200 + // 504 = ISO 6400, 8x digital gain + // 508 = ISO 12800, 16x digital gain + // 510 = ISO 25600, 32x digital gain + + camera_init(v, &s->road_cam, CAMERA_ID_IMX298, 0, + /*pixel_clock=*/600000000, /*line_length_pclk=*/5536, + /*max_gain=*/510, //0 (ISO 100)- 448 (ISO 800, max analog gain) - 511 (super noisy) +#ifdef HIGH_FPS + /*fps*/ 60, +#else + /*fps*/ 20, +#endif + device_id, ctx, + VISION_STREAM_RGB_BACK, VISION_STREAM_ROAD); + + camera_init(v, &s->driver_cam, CAMERA_ID_OV8865, 1, + /*pixel_clock=*/72000000, /*line_length_pclk=*/1602, + /*max_gain=*/510, 10, device_id, ctx, + VISION_STREAM_RGB_FRONT, VISION_STREAM_DRIVER); + + s->sm = new SubMaster({"driverState"}); + s->pm = new PubMaster({"roadCameraState", "driverCameraState", "thumbnail"}); + + for (int i = 0; i < FRAME_BUF_COUNT; i++) { + // TODO: make lengths correct + s->focus_bufs[i].allocate(0xb80); + s->stats_bufs[i].allocate(0xb80); + } + std::fill_n(s->lapres, std::size(s->lapres), 16160); + s->lap_conv = new LapConv(device_id, ctx, s->road_cam.buf.rgb_width, s->road_cam.buf.rgb_height, s->road_cam.buf.rgb_stride, 3); +} + +static void set_exposure(CameraState *s, float exposure_frac, float gain_frac) { + int err = 0; + uint32_t gain = s->cur_gain; + uint32_t integ_lines = s->cur_integ_lines; + + if (exposure_frac >= 0) { + exposure_frac = std::clamp(exposure_frac, 2.0f / s->frame_length, 1.0f); + integ_lines = s->frame_length * exposure_frac; + + // See page 79 of the datasheet, this is the max allowed (-1 for phase adjust) + integ_lines = std::min(integ_lines, s->frame_length - 11); + } + + if (gain_frac >= 0) { + // ISO200 is minimum gain + gain_frac = std::clamp(gain_frac, 1.0f/64, 1.0f); + + // linearize gain response + // TODO: will be wrong for driver camera + // 0.125 -> 448 + // 0.25 -> 480 + // 0.5 -> 496 + // 1.0 -> 504 + // 512 - 512/(128*gain_frac) + gain = (s->max_gain/510) * (512 - 512/(256*gain_frac)); + } + + if (gain != s->cur_gain || integ_lines != s->cur_integ_lines) { + if (s->apply_exposure == ov8865_apply_exposure) { + gain = 800 * gain_frac; // ISO + } + err = s->apply_exposure(s, gain, integ_lines, s->frame_length); + if (err == 0) { + std::lock_guard lk(s->frame_info_lock); + s->cur_gain = gain; + s->cur_integ_lines = integ_lines; + } else { + LOGE("camera %d apply_exposure err: %d", s->camera_num, err); + } + } + + if (err == 0) { + s->cur_exposure_frac = exposure_frac; + std::lock_guard lk(s->frame_info_lock); + s->cur_gain_frac = gain_frac; + } + + //LOGD("set exposure: %f %f - %d", exposure_frac, gain_frac, err); +} + +static void do_autoexposure(CameraState *s, float grey_frac) { + const float target_grey = 0.3; + + s->frame_info_lock.lock(); + s->measured_grey_fraction = grey_frac; + s->target_grey_fraction = target_grey; + s->frame_info_lock.unlock(); + + if (s->apply_exposure == ov8865_apply_exposure) { + // gain limits downstream + const float gain_frac_min = 0.015625; + const float gain_frac_max = 1.0; + // exposure time limits + const uint32_t exposure_time_min = 16; + const uint32_t exposure_time_max = s->frame_length - 11; // copied from set_exposure() + + float cur_gain_frac = s->cur_gain_frac; + float exposure_factor = pow(1.05, (target_grey - grey_frac) / 0.05); + if (cur_gain_frac > 0.125 && exposure_factor < 1) { + cur_gain_frac *= exposure_factor; + } else if (s->cur_integ_lines * exposure_factor <= exposure_time_max && s->cur_integ_lines * exposure_factor >= exposure_time_min) { // adjust exposure time first + s->cur_exposure_frac *= exposure_factor; + } else if (cur_gain_frac * exposure_factor <= gain_frac_max && cur_gain_frac * exposure_factor >= gain_frac_min) { + cur_gain_frac *= exposure_factor; + } + s->frame_info_lock.lock(); + s->cur_gain_frac = cur_gain_frac; + s->frame_info_lock.unlock(); + + set_exposure(s, s->cur_exposure_frac, cur_gain_frac); + } else { // keep the old for others + float new_exposure = s->cur_exposure_frac; + new_exposure *= pow(1.05, (target_grey - grey_frac) / 0.05 ); + //LOGD("diff %f: %f to %f", target_grey - grey_frac, s->cur_exposure_frac, new_exposure); + + float new_gain = s->cur_gain_frac; + if (new_exposure < 0.10) { + new_gain *= 0.95; + } else if (new_exposure > 0.40) { + new_gain *= 1.05; + } + + set_exposure(s, new_exposure, new_gain); + } +} + +static void sensors_init(MultiCameraState *s) { + msm_camera_sensor_slave_info slave_infos[2] = { + (msm_camera_sensor_slave_info){ // road camera + .sensor_name = "imx298", + .eeprom_name = "sony_imx298", + .actuator_name = "dw9800w", + .ois_name = "", + .flash_name = "pmic", + .camera_id = CAMERA_0, + .slave_addr = 32, + .i2c_freq_mode = I2C_FAST_MODE, + .addr_type = MSM_CAMERA_I2C_WORD_ADDR, + .sensor_id_info = {.sensor_id_reg_addr = 22, .sensor_id = 664, .module_id = 9, .vcm_id = 6}, + .power_setting_array = { + .power_setting_a = { + {.seq_type = SENSOR_GPIO, .delay = 1}, + {.seq_type = SENSOR_VREG, .seq_val = 2}, + {.seq_type = SENSOR_GPIO, .seq_val = 5, .config_val = 2}, + {.seq_type = SENSOR_VREG, .seq_val = 1}, + {.seq_type = SENSOR_VREG, .seq_val = 3, .delay = 1}, + {.seq_type = SENSOR_CLK, .config_val = 24000000, .delay = 1}, + {.seq_type = SENSOR_GPIO, .config_val = 2, .delay = 10}, + }, + .size = 7, + .power_down_setting_a = { + {.seq_type = SENSOR_CLK, .delay = 1}, + {.seq_type = SENSOR_GPIO, .delay = 1}, + {.seq_type = SENSOR_VREG, .seq_val = 1}, + {.seq_type = SENSOR_GPIO, .seq_val = 5}, + {.seq_type = SENSOR_VREG, .seq_val = 2}, + {.seq_type = SENSOR_VREG, .seq_val = 3, .delay = 1}, + }, + .size_down = 6, + }, + .is_init_params_valid = 0, + .sensor_init_params = {.modes_supported = 1, .position = BACK_CAMERA_B, .sensor_mount_angle = 90}, + .output_format = MSM_SENSOR_BAYER, + }, + (msm_camera_sensor_slave_info){ // driver camera + .sensor_name = "ov8865_sunny", + .eeprom_name = "ov8865_plus", + .actuator_name = "", + .ois_name = "", + .flash_name = "", + .camera_id = CAMERA_2, + .slave_addr = 108, + .i2c_freq_mode = I2C_FAST_MODE, + .addr_type = MSM_CAMERA_I2C_WORD_ADDR, + .sensor_id_info = {.sensor_id_reg_addr = 12299, .sensor_id = 34917, .module_id = 2}, + .power_setting_array = { + .power_setting_a = { + {.seq_type = SENSOR_GPIO, .delay = 5}, + {.seq_type = SENSOR_VREG, .seq_val = 1}, + {.seq_type = SENSOR_VREG, .seq_val = 2}, + {.seq_type = SENSOR_VREG}, + {.seq_type = SENSOR_CLK, .config_val = 24000000, .delay = 1}, + {.seq_type = SENSOR_GPIO, .config_val = 2, .delay = 1}, + }, + .size = 6, + .power_down_setting_a = { + {.seq_type = SENSOR_GPIO, .delay = 5}, + {.seq_type = SENSOR_CLK, .delay = 1}, + {.seq_type = SENSOR_VREG}, + {.seq_type = SENSOR_VREG, .seq_val = 1}, + {.seq_type = SENSOR_VREG, .seq_val = 2, .delay = 1}, + }, + .size_down = 5, + }, + .is_init_params_valid = 0, + .sensor_init_params = {.modes_supported = 1, .position = FRONT_CAMERA_B, .sensor_mount_angle = 270}, + .output_format = MSM_SENSOR_BAYER, + }}; + + unique_fd sensorinit_fd = HANDLE_EINTR(open("/dev/v4l-subdev11", O_RDWR | O_NONBLOCK)); + assert(sensorinit_fd >= 0); + for (auto &info : slave_infos) { + info.power_setting_array.power_setting = &info.power_setting_array.power_setting_a[0]; + info.power_setting_array.power_down_setting = &info.power_setting_array.power_down_setting_a[0]; + sensor_init_cfg_data sensor_init_cfg = {.cfgtype = CFG_SINIT_PROBE, .cfg.setting = &info}; + int err = cam_ioctl(sensorinit_fd, VIDIOC_MSM_SENSOR_INIT_CFG, &sensor_init_cfg, "sensor init cfg"); + assert(err >= 0); + } +} + +static void camera_open(CameraState *s, bool is_road_cam) { + struct csid_cfg_data csid_cfg_data = {}; + struct v4l2_event_subscription sub = {}; + + struct msm_actuator_cfg_data actuator_cfg_data = {}; + + // open devices + const char *sensor_dev; + if (is_road_cam) { + s->csid_fd = HANDLE_EINTR(open("/dev/v4l-subdev3", O_RDWR | O_NONBLOCK)); + assert(s->csid_fd >= 0); + s->csiphy_fd = HANDLE_EINTR(open("/dev/v4l-subdev0", O_RDWR | O_NONBLOCK)); + assert(s->csiphy_fd >= 0); + sensor_dev = "/dev/v4l-subdev17"; + s->isp_fd = HANDLE_EINTR(open("/dev/v4l-subdev13", O_RDWR | O_NONBLOCK)); + assert(s->isp_fd >= 0); + s->actuator_fd = HANDLE_EINTR(open("/dev/v4l-subdev7", O_RDWR | O_NONBLOCK)); + assert(s->actuator_fd >= 0); + } else { + s->csid_fd = HANDLE_EINTR(open("/dev/v4l-subdev5", O_RDWR | O_NONBLOCK)); + assert(s->csid_fd >= 0); + s->csiphy_fd = HANDLE_EINTR(open("/dev/v4l-subdev2", O_RDWR | O_NONBLOCK)); + assert(s->csiphy_fd >= 0); + sensor_dev = "/dev/v4l-subdev18"; + s->isp_fd = HANDLE_EINTR(open("/dev/v4l-subdev14", O_RDWR | O_NONBLOCK)); + assert(s->isp_fd >= 0); + } + + // wait for sensor device + // on first startup, these devices aren't present yet + for (int i = 0; i < 10; i++) { + s->sensor_fd = HANDLE_EINTR(open(sensor_dev, O_RDWR | O_NONBLOCK)); + if (s->sensor_fd >= 0) break; + LOGW("waiting for sensors..."); + util::sleep_for(1000); // sleep one second + } + assert(s->sensor_fd >= 0); + + // *** SHUTDOWN ALL *** + + // CSIPHY: release csiphy + struct msm_camera_csi_lane_params csi_lane_params = {0}; + csi_lane_params.csi_lane_mask = 0x1f; + csiphy_cfg_data csiphy_cfg_data = { .cfg.csi_lane_params = &csi_lane_params, .cfgtype = CSIPHY_RELEASE}; + int err = cam_ioctl(s->csiphy_fd, VIDIOC_MSM_CSIPHY_IO_CFG, &csiphy_cfg_data, "release csiphy"); + + // CSID: release csid + csid_cfg_data.cfgtype = CSID_RELEASE; + cam_ioctl(s->csid_fd, VIDIOC_MSM_CSID_IO_CFG, &csid_cfg_data, "release csid"); + + // SENSOR: send power down + struct sensorb_cfg_data sensorb_cfg_data = {.cfgtype = CFG_POWER_DOWN}; + cam_ioctl(s->sensor_fd, VIDIOC_MSM_SENSOR_CFG, &sensorb_cfg_data, "sensor power down"); + + // actuator powerdown + actuator_cfg_data.cfgtype = CFG_ACTUATOR_POWERDOWN; + cam_ioctl(s->actuator_fd, VIDIOC_MSM_ACTUATOR_CFG, &actuator_cfg_data, "actuator powerdown"); + + // reset isp + // struct msm_vfe_axi_halt_cmd halt_cmd = { + // .stop_camif = 1, + // .overflow_detected = 1, + // .blocking_halt = 1, + // }; + // err = ioctl(s->isp_fd, VIDIOC_MSM_ISP_AXI_HALT, &halt_cmd); + // printf("axi halt: %d\n", err); + + // struct msm_vfe_axi_reset_cmd reset_cmd = { + // .blocking = 1, + // .frame_id = 1, + // }; + // err = ioctl(s->isp_fd, VIDIOC_MSM_ISP_AXI_RESET, &reset_cmd); + // printf("axi reset: %d\n", err); + + // struct msm_vfe_axi_restart_cmd restart_cmd = { + // .enable_camif = 1, + // }; + // err = ioctl(s->isp_fd, VIDIOC_MSM_ISP_AXI_RESTART, &restart_cmd); + // printf("axi restart: %d\n", err); + + // **** GO GO GO **** + LOG("******************** GO GO GO ************************"); + + // CSID: init csid + csid_cfg_data.cfgtype = CSID_INIT; + cam_ioctl(s->csid_fd, VIDIOC_MSM_CSID_IO_CFG, &csid_cfg_data, "init csid"); + + // CSIPHY: init csiphy + csiphy_cfg_data = {.cfgtype = CSIPHY_INIT}; + cam_ioctl(s->csiphy_fd, VIDIOC_MSM_CSIPHY_IO_CFG, &csiphy_cfg_data, "init csiphy"); + + // SENSOR: stop stream + struct msm_camera_i2c_reg_setting stop_settings = { + .reg_setting = stop_reg_array, + .size = std::size(stop_reg_array), + .addr_type = MSM_CAMERA_I2C_WORD_ADDR, + .data_type = MSM_CAMERA_I2C_BYTE_DATA, + .delay = 0 + }; + sensorb_cfg_data.cfgtype = CFG_SET_STOP_STREAM_SETTING; + sensorb_cfg_data.cfg.setting = &stop_settings; + cam_ioctl(s->sensor_fd, VIDIOC_MSM_SENSOR_CFG, &sensorb_cfg_data, "stop stream"); + + // SENSOR: send power up + sensorb_cfg_data = {.cfgtype = CFG_POWER_UP}; + cam_ioctl(s->sensor_fd, VIDIOC_MSM_SENSOR_CFG, &sensorb_cfg_data, "sensor power up"); + + // **** configure the sensor **** + + // SENSOR: send i2c configuration + if (s->camera_id == CAMERA_ID_IMX298) { + err = sensor_write_regs(s, init_array_imx298, std::size(init_array_imx298), MSM_CAMERA_I2C_BYTE_DATA); + } else if (s->camera_id == CAMERA_ID_OV8865) { + err = sensor_write_regs(s, init_array_ov8865, std::size(init_array_ov8865), MSM_CAMERA_I2C_BYTE_DATA); + } else { + assert(false); + } + LOG("sensor init i2c: %d", err); + + if (is_road_cam) { + // init the actuator + actuator_cfg_data.cfgtype = CFG_ACTUATOR_POWERUP; + cam_ioctl(s->actuator_fd, VIDIOC_MSM_ACTUATOR_CFG, &actuator_cfg_data, "actuator powerup"); + + actuator_cfg_data.cfgtype = CFG_ACTUATOR_INIT; + cam_ioctl(s->actuator_fd, VIDIOC_MSM_ACTUATOR_CFG, &actuator_cfg_data, "actuator init"); + + struct msm_actuator_reg_params_t actuator_reg_params[] = { + { + .reg_write_type = MSM_ACTUATOR_WRITE_DAC, + // MSB here at address 3 + .reg_addr = 3, + .data_type = 9, + .addr_type = 4, + }, + }; + + struct reg_settings_t actuator_init_settings[] = { + { .reg_addr=2, .addr_type=MSM_ACTUATOR_BYTE_ADDR, .reg_data=1, .data_type = MSM_ACTUATOR_BYTE_DATA, .i2c_operation = MSM_ACT_WRITE, .delay = 0 }, // PD = power down + { .reg_addr=2, .addr_type=MSM_ACTUATOR_BYTE_ADDR, .reg_data=0, .data_type = MSM_ACTUATOR_BYTE_DATA, .i2c_operation = MSM_ACT_WRITE, .delay = 2 }, // 0 = power up + { .reg_addr=2, .addr_type=MSM_ACTUATOR_BYTE_ADDR, .reg_data=2, .data_type = MSM_ACTUATOR_BYTE_DATA, .i2c_operation = MSM_ACT_WRITE, .delay = 2 }, // RING = SAC mode + { .reg_addr=6, .addr_type=MSM_ACTUATOR_BYTE_ADDR, .reg_data=64, .data_type = MSM_ACTUATOR_BYTE_DATA, .i2c_operation = MSM_ACT_WRITE, .delay = 0 }, // 0x40 = SAC3 mode + { .reg_addr=7, .addr_type=MSM_ACTUATOR_BYTE_ADDR, .reg_data=113, .data_type = MSM_ACTUATOR_BYTE_DATA, .i2c_operation = MSM_ACT_WRITE, .delay = 0 }, + // 0x71 = DIV1 | DIV0 | SACT0 -- Tvib x 1/4 (quarter) + // SAC Tvib = 6.3 ms + 0.1 ms = 6.4 ms / 4 = 1.6 ms + // LSC 1-step = 252 + 1*4 = 256 ms / 4 = 64 ms + }; + + struct region_params_t region_params[] = { + {.step_bound = {238, 0,}, .code_per_step = 235, .qvalue = 128} + }; + + actuator_cfg_data.cfgtype = CFG_SET_ACTUATOR_INFO; + actuator_cfg_data.cfg.set_info = (struct msm_actuator_set_info_t){ + .actuator_params = { + .act_type = ACTUATOR_BIVCM, + .reg_tbl_size = 1, + .data_size = 10, + .init_setting_size = 5, + .i2c_freq_mode = I2C_STANDARD_MODE, + .i2c_addr = 24, + .i2c_addr_type = MSM_ACTUATOR_BYTE_ADDR, + .i2c_data_type = MSM_ACTUATOR_WORD_DATA, + .reg_tbl_params = &actuator_reg_params[0], + .init_settings = &actuator_init_settings[0], + .park_lens = {.damping_step = 1023, .damping_delay = 14000, .hw_params = 11, .max_step = 20}, + }, + .af_tuning_params = { + .initial_code = INFINITY_DAC, + .pwd_step = 0, + .region_size = 1, + .total_steps = 238, + .region_params = ®ion_params[0], + }, + }; + + cam_ioctl(s->actuator_fd, VIDIOC_MSM_ACTUATOR_CFG, &actuator_cfg_data, "actuator set info"); + } + + if (s->camera_id == CAMERA_ID_IMX298) { + err = sensor_write_regs(s, mode_setting_array_imx298, std::size(mode_setting_array_imx298), MSM_CAMERA_I2C_BYTE_DATA); + LOG("sensor setup: %d", err); + } + + // CSIPHY: configure csiphy + struct msm_camera_csiphy_params csiphy_params = {}; + if (s->camera_id == CAMERA_ID_IMX298) { + csiphy_params = {.lane_cnt = 4, .settle_cnt = 14, .lane_mask = 0x1f, .csid_core = 0}; + } else if (s->camera_id == CAMERA_ID_OV8865) { + // guess! + csiphy_params = {.lane_cnt = 4, .settle_cnt = 24, .lane_mask = 0x1f, .csid_core = 2}; + } + csiphy_cfg_data.cfgtype = CSIPHY_CFG; + csiphy_cfg_data.cfg.csiphy_params = &csiphy_params; + cam_ioctl(s->csiphy_fd, VIDIOC_MSM_CSIPHY_IO_CFG, &csiphy_cfg_data, "csiphy configure"); + + // CSID: configure csid +#define CSI_STATS 0x35 +#define CSI_PD 0x36 + struct msm_camera_csid_params csid_params = { + .lane_cnt = 4, + .lane_assign = 0x4320, + .phy_sel = (uint8_t)(is_road_cam ? 0 : 2), + .lut_params.num_cid = (uint8_t)(is_road_cam ? 3 : 1), + .lut_params.vc_cfg_a = { + {.cid = 0, .dt = CSI_RAW10, .decode_format = CSI_DECODE_10BIT}, + {.cid = 1, .dt = CSI_PD, .decode_format = CSI_DECODE_10BIT}, + {.cid = 2, .dt = CSI_STATS, .decode_format = CSI_DECODE_10BIT}, + }, + }; + + csid_params.lut_params.vc_cfg[0] = &csid_params.lut_params.vc_cfg_a[0]; + csid_params.lut_params.vc_cfg[1] = &csid_params.lut_params.vc_cfg_a[1]; + csid_params.lut_params.vc_cfg[2] = &csid_params.lut_params.vc_cfg_a[2]; + + csid_cfg_data.cfgtype = CSID_CFG; + csid_cfg_data.cfg.csid_params = &csid_params; + cam_ioctl(s->csid_fd, VIDIOC_MSM_CSID_IO_CFG, &csid_cfg_data, "csid configure"); + + // ISP: SMMU_ATTACH + msm_vfe_smmu_attach_cmd smmu_attach_cmd = {.security_mode = 0, .iommu_attach_mode = IOMMU_ATTACH}; + cam_ioctl(s->isp_fd, VIDIOC_MSM_ISP_SMMU_ATTACH, &smmu_attach_cmd, "isp smmu attach"); + + // ******************* STREAM RAW ***************************** + + // configure QMET input + struct msm_vfe_input_cfg input_cfg = {}; + for (int i = 0; i < (is_road_cam ? 3 : 1); i++) { + StreamState *ss = &s->ss[i]; + + memset(&input_cfg, 0, sizeof(struct msm_vfe_input_cfg)); + input_cfg.input_src = (msm_vfe_input_src)(VFE_RAW_0+i); + input_cfg.input_pix_clk = s->pixel_clock; + input_cfg.d.rdi_cfg.cid = i; + input_cfg.d.rdi_cfg.frame_based = 1; + err = ioctl(s->isp_fd, VIDIOC_MSM_ISP_INPUT_CFG, &input_cfg); + LOG("configure input(%d): %d", i, err); + + // ISP: REQUEST_STREAM + ss->stream_req.axi_stream_handle = 0; + if (is_road_cam) { + ss->stream_req.session_id = 2; + ss->stream_req.stream_id = /*ISP_META_CHANNEL_BIT | */ISP_NATIVE_BUF_BIT | (1+i); + } else { + ss->stream_req.session_id = 3; + ss->stream_req.stream_id = ISP_NATIVE_BUF_BIT | 1; + } + + if (i == 0) { + ss->stream_req.output_format = v4l2_fourcc('R', 'G', '1', '0'); + } else { + ss->stream_req.output_format = v4l2_fourcc('Q', 'M', 'E', 'T'); + } + ss->stream_req.stream_src = (msm_vfe_axi_stream_src)(RDI_INTF_0+i); + +#ifdef HIGH_FPS + if (is_road_cam) { + ss->stream_req.frame_skip_pattern = EVERY_3FRAME; + } +#endif + + ss->stream_req.frame_base = 1; + ss->stream_req.buf_divert = 1; //i == 0; + + // setup stream plane. doesn't even matter? + /*s->stream_req.plane_cfg[0].output_plane_format = Y_PLANE; + s->stream_req.plane_cfg[0].output_width = s->ci.frame_width; + s->stream_req.plane_cfg[0].output_height = s->ci.frame_height; + s->stream_req.plane_cfg[0].output_stride = s->ci.frame_width; + s->stream_req.plane_cfg[0].output_scan_lines = s->ci.frame_height; + s->stream_req.plane_cfg[0].rdi_cid = 0;*/ + + err = ioctl(s->isp_fd, VIDIOC_MSM_ISP_REQUEST_STREAM, &ss->stream_req); + LOG("isp request stream: %d -> 0x%x", err, ss->stream_req.axi_stream_handle); + + // ISP: REQUEST_BUF + ss->buf_request.session_id = ss->stream_req.session_id; + ss->buf_request.stream_id = ss->stream_req.stream_id; + ss->buf_request.num_buf = FRAME_BUF_COUNT; + ss->buf_request.buf_type = ISP_PRIVATE_BUF; + ss->buf_request.handle = 0; + cam_ioctl(s->isp_fd, VIDIOC_MSM_ISP_REQUEST_BUF, &ss->buf_request, "isp request buf"); + LOG("got buf handle: 0x%x", ss->buf_request.handle); + + // ENQUEUE all buffers + for (int j = 0; j < ss->buf_request.num_buf; j++) { + ss->qbuf_info[j].handle = ss->buf_request.handle; + ss->qbuf_info[j].buf_idx = j; + ss->qbuf_info[j].buffer.num_planes = 1; + ss->qbuf_info[j].buffer.planes[0].addr = ss->bufs[j].fd; + ss->qbuf_info[j].buffer.planes[0].length = ss->bufs[j].len; + err = ioctl(s->isp_fd, VIDIOC_MSM_ISP_ENQUEUE_BUF, &ss->qbuf_info[j]); + } + + // ISP: UPDATE_STREAM + struct msm_vfe_axi_stream_update_cmd update_cmd = {}; + update_cmd.num_streams = 1; + update_cmd.update_info[0].user_stream_id = ss->stream_req.stream_id; + update_cmd.update_info[0].stream_handle = ss->stream_req.axi_stream_handle; + update_cmd.update_type = UPDATE_STREAM_ADD_BUFQ; + cam_ioctl(s->isp_fd, VIDIOC_MSM_ISP_UPDATE_STREAM, &update_cmd, "isp update stream"); + } + + LOG("******** START STREAMS ********"); + + sub.id = 0; + sub.type = 0x1ff; + cam_ioctl(s->isp_fd, VIDIOC_SUBSCRIBE_EVENT, &sub, "isp subscribe"); + + // ISP: START_STREAM + s->stream_cfg.cmd = START_STREAM; + s->stream_cfg.num_streams = is_road_cam ? 3 : 1; + for (int i = 0; i < s->stream_cfg.num_streams; i++) { + s->stream_cfg.stream_handle[i] = s->ss[i].stream_req.axi_stream_handle; + } + cam_ioctl(s->isp_fd, VIDIOC_MSM_ISP_CFG_STREAM, &s->stream_cfg, "isp start stream"); +} + +static void road_camera_start(CameraState *s) { + set_exposure(s, 1.0, 1.0); + + int err = sensor_write_regs(s, start_reg_array, std::size(start_reg_array), MSM_CAMERA_I2C_BYTE_DATA); + LOG("sensor start regs: %d", err); + + int inf_step = 512 - INFINITY_DAC; + + // initial guess + s->lens_true_pos = 400; + + // reset lens position + struct msm_actuator_cfg_data actuator_cfg_data = {}; + actuator_cfg_data.cfgtype = CFG_SET_POSITION; + actuator_cfg_data.cfg.setpos = (struct msm_actuator_set_position_t){ + .number_of_steps = 1, + .hw_params = (uint32_t)7, + .pos = {INFINITY_DAC, 0}, + .delay = {0,} + }; + cam_ioctl(s->actuator_fd, VIDIOC_MSM_ACTUATOR_CFG, &actuator_cfg_data, "actuator set pos"); + + // TODO: confirm this isn't needed + /*memset(&actuator_cfg_data, 0, sizeof(actuator_cfg_data)); + actuator_cfg_data.cfgtype = CFG_MOVE_FOCUS; + actuator_cfg_data.cfg.move = (struct msm_actuator_move_params_t){ + .dir = 0, + .sign_dir = 1, + .dest_step_pos = inf_step, + .num_steps = inf_step, + .curr_lens_pos = 0, + .ringing_params = &actuator_ringing_params, + }; + err = ioctl(s->actuator_fd, VIDIOC_MSM_ACTUATOR_CFG, &actuator_cfg_data); // should be ~332 at startup ? + LOG("init actuator move focus: %d", err);*/ + //actuator_cfg_data.cfg.move.curr_lens_pos; + + s->cur_lens_pos = 0; + s->cur_step_pos = inf_step; + + actuator_move(s, s->cur_lens_pos); + LOG("init lens pos: %d", s->cur_lens_pos); +} + +void actuator_move(CameraState *s, uint16_t target) { + // LP3 moves only on even positions. TODO: use proper sensor params + + // focus on infinity assuming phone is perpendicular + static struct damping_params_t actuator_ringing_params = { + .damping_step = 1023, + .damping_delay = 20000, + .hw_params = 13, + }; + + int step = (target - s->cur_lens_pos) / 2; + + int dest_step_pos = s->cur_step_pos + step; + dest_step_pos = std::clamp(dest_step_pos, 0, 255); + + struct msm_actuator_cfg_data actuator_cfg_data = {0}; + actuator_cfg_data.cfgtype = CFG_MOVE_FOCUS; + actuator_cfg_data.cfg.move = (struct msm_actuator_move_params_t){ + .dir = (int8_t)((step > 0) ? MOVE_NEAR : MOVE_FAR), + .sign_dir = (int8_t)((step > 0) ? MSM_ACTUATOR_MOVE_SIGNED_NEAR : MSM_ACTUATOR_MOVE_SIGNED_FAR), + .dest_step_pos = (int16_t)dest_step_pos, + .num_steps = abs(step), + .curr_lens_pos = s->cur_lens_pos, + .ringing_params = &actuator_ringing_params, + }; + HANDLE_EINTR(ioctl(s->actuator_fd, VIDIOC_MSM_ACTUATOR_CFG, &actuator_cfg_data)); + + s->cur_step_pos = dest_step_pos; + s->cur_lens_pos = actuator_cfg_data.cfg.move.curr_lens_pos; + //LOGD("step %d target: %d lens pos: %d", dest_step_pos, target, s->cur_lens_pos); +} + +static void parse_autofocus(CameraState *s, uint8_t *d) { + int good_count = 0; + int16_t max_focus = -32767; + int avg_focus = 0; + + /*printf("FOCUS: "); + for (int i = 0; i < 0x10; i++) { + printf("%2.2X ", d[i]); + }*/ + + for (int i = 0; i < NUM_FOCUS; i++) { + int doff = i*5+5; + s->confidence[i] = d[doff]; + // this should just be a 10-bit signed int instead of 11 + // TODO: write it in a nicer way + int16_t focus_t = (d[doff+1] << 3) | (d[doff+2] >> 5); + if (focus_t >= 1024) focus_t = -(2048-focus_t); + s->focus[i] = focus_t; + //printf("%x->%d ", d[doff], focus_t); + if (s->confidence[i] > 0x20) { + good_count++; + max_focus = std::max(max_focus, s->focus[i]); + avg_focus += s->focus[i]; + } + } + // self recover override + if (s->self_recover > 1) { + s->focus_err = 200 * ((s->self_recover % 2 == 0) ? 1:-1); // far for even numbers, close for odd + s->self_recover -= 2; + return; + } + + if (good_count < 4) { + s->focus_err = nan(""); + return; + } + + avg_focus /= good_count; + + // outlier rejection + if (abs(avg_focus - max_focus) > 200) { + s->focus_err = nan(""); + return; + } + + s->focus_err = max_focus*1.0; +} + +static void do_autofocus(CameraState *s) { + float lens_true_pos = s->lens_true_pos.load(); + if (!isnan(s->focus_err)) { + // learn lens_true_pos + const float focus_kp = 0.005; + lens_true_pos -= s->focus_err*focus_kp; + } + + // stay off the walls + lens_true_pos = std::clamp(lens_true_pos, float(LP3_AF_DAC_DOWN), float(LP3_AF_DAC_UP)); + s->lens_true_pos.store(lens_true_pos); + actuator_move(s, lens_true_pos); +} + +void camera_autoexposure(CameraState *s, float grey_frac) { + if (s->camera_num == 0) { + CameraExpInfo tmp = road_cam_exp.load(); + tmp.op_id++; + tmp.grey_frac = grey_frac; + road_cam_exp.store(tmp); + } else { + CameraExpInfo tmp = driver_cam_exp.load(); + tmp.op_id++; + tmp.grey_frac = grey_frac; + driver_cam_exp.store(tmp); + } +} + +static void driver_camera_start(CameraState *s) { + set_exposure(s, 1.0, 1.0); + int err = sensor_write_regs(s, start_reg_array, std::size(start_reg_array), MSM_CAMERA_I2C_BYTE_DATA); + LOG("sensor start regs: %d", err); +} + +void cameras_open(MultiCameraState *s) { + struct msm_ispif_param_data ispif_params = { + .num = 4, + .entries = { + // road camera + {.vfe_intf = VFE0, .intftype = RDI0, .num_cids = 1, .cids[0] = CID0, .csid = CSID0}, + // driver camera + {.vfe_intf = VFE1, .intftype = RDI0, .num_cids = 1, .cids[0] = CID0, .csid = CSID2}, + // road camera (focus) + {.vfe_intf = VFE0, .intftype = RDI1, .num_cids = 1, .cids[0] = CID1, .csid = CSID0}, + // road camera (stats, for AE) + {.vfe_intf = VFE0, .intftype = RDI2, .num_cids = 1, .cids[0] = CID2, .csid = CSID0}, + }, + }; + s->msmcfg_fd = HANDLE_EINTR(open("/dev/media0", O_RDWR | O_NONBLOCK)); + assert(s->msmcfg_fd >= 0); + + sensors_init(s); + + s->v4l_fd = HANDLE_EINTR(open("/dev/video0", O_RDWR | O_NONBLOCK)); + assert(s->v4l_fd >= 0); + + s->ispif_fd = HANDLE_EINTR(open("/dev/v4l-subdev15", O_RDWR | O_NONBLOCK)); + assert(s->ispif_fd >= 0); + + // ISPIF: stop + // memset(&ispif_cfg_data, 0, sizeof(ispif_cfg_data)); + // ispif_cfg_data.cfg_type = ISPIF_STOP_FRAME_BOUNDARY; + // ispif_cfg_data.params = ispif_params; + // err = ioctl(s->ispif_fd, VIDIOC_MSM_ISPIF_CFG, &ispif_cfg_data); + // LOG("ispif stop: %d", err); + + LOG("*** open driver camera ***"); + s->driver_cam.ss[0].bufs = s->driver_cam.buf.camera_bufs.get(); + camera_open(&s->driver_cam, false); + + LOG("*** open road camera ***"); + s->road_cam.ss[0].bufs = s->road_cam.buf.camera_bufs.get(); + s->road_cam.ss[1].bufs = s->focus_bufs; + s->road_cam.ss[2].bufs = s->stats_bufs; + camera_open(&s->road_cam, true); + + if (getenv("CAMERA_TEST")) { + cameras_close(s); + exit(0); + } + + // ISPIF: set vfe info + struct ispif_cfg_data ispif_cfg_data = {.cfg_type = ISPIF_SET_VFE_INFO, .vfe_info.num_vfe = 2}; + int err = HANDLE_EINTR(ioctl(s->ispif_fd, VIDIOC_MSM_ISPIF_CFG, &ispif_cfg_data)); + LOG("ispif set vfe info: %d", err); + + // ISPIF: setup + ispif_cfg_data = {.cfg_type = ISPIF_INIT, .csid_version = 0x30050000 /* CSID_VERSION_V35*/}; + cam_ioctl(s->ispif_fd, VIDIOC_MSM_ISPIF_CFG, &ispif_cfg_data, "ispif setup"); + + ispif_cfg_data = {.cfg_type = ISPIF_CFG, .params = ispif_params}; + cam_ioctl(s->ispif_fd, VIDIOC_MSM_ISPIF_CFG, &ispif_cfg_data, "ispif cfg"); + + ispif_cfg_data.cfg_type = ISPIF_START_FRAME_BOUNDARY; + cam_ioctl(s->ispif_fd, VIDIOC_MSM_ISPIF_CFG, &ispif_cfg_data, "ispif start_frame_boundary"); + + driver_camera_start(&s->driver_cam); + road_camera_start(&s->road_cam); +} + + +static void camera_close(CameraState *s) { + // ISP: STOP_STREAM + s->stream_cfg.cmd = STOP_STREAM; + cam_ioctl(s->isp_fd, VIDIOC_MSM_ISP_CFG_STREAM, &s->stream_cfg, "isp stop stream"); + + for (int i = 0; i < 3; i++) { + StreamState *ss = &s->ss[i]; + if (ss->stream_req.axi_stream_handle != 0) { + cam_ioctl(s->isp_fd, VIDIOC_MSM_ISP_RELEASE_BUF, &ss->buf_request, "isp release buf"); + + struct msm_vfe_axi_stream_release_cmd stream_release = { + .stream_handle = ss->stream_req.axi_stream_handle, + }; + cam_ioctl(s->isp_fd, VIDIOC_MSM_ISP_RELEASE_STREAM, &stream_release, "isp release stream"); + } + } +} + +const char* get_isp_event_name(uint32_t type) { + switch (type) { + case ISP_EVENT_REG_UPDATE: return "ISP_EVENT_REG_UPDATE"; + case ISP_EVENT_EPOCH_0: return "ISP_EVENT_EPOCH_0"; + case ISP_EVENT_EPOCH_1: return "ISP_EVENT_EPOCH_1"; + case ISP_EVENT_START_ACK: return "ISP_EVENT_START_ACK"; + case ISP_EVENT_STOP_ACK: return "ISP_EVENT_STOP_ACK"; + case ISP_EVENT_IRQ_VIOLATION: return "ISP_EVENT_IRQ_VIOLATION"; + case ISP_EVENT_STATS_OVERFLOW: return "ISP_EVENT_STATS_OVERFLOW"; + case ISP_EVENT_ERROR: return "ISP_EVENT_ERROR"; + case ISP_EVENT_SOF: return "ISP_EVENT_SOF"; + case ISP_EVENT_EOF: return "ISP_EVENT_EOF"; + case ISP_EVENT_BUF_DONE: return "ISP_EVENT_BUF_DONE"; + case ISP_EVENT_BUF_DIVERT: return "ISP_EVENT_BUF_DIVERT"; + case ISP_EVENT_STATS_NOTIFY: return "ISP_EVENT_STATS_NOTIFY"; + case ISP_EVENT_COMP_STATS_NOTIFY: return "ISP_EVENT_COMP_STATS_NOTIFY"; + case ISP_EVENT_FE_READ_DONE: return "ISP_EVENT_FE_READ_DONE"; + case ISP_EVENT_IOMMU_P_FAULT: return "ISP_EVENT_IOMMU_P_FAULT"; + case ISP_EVENT_HW_FATAL_ERROR: return "ISP_EVENT_HW_FATAL_ERROR"; + case ISP_EVENT_PING_PONG_MISMATCH: return "ISP_EVENT_PING_PONG_MISMATCH"; + case ISP_EVENT_REG_UPDATE_MISSING: return "ISP_EVENT_REG_UPDATE_MISSING"; + case ISP_EVENT_BUF_FATAL_ERROR: return "ISP_EVENT_BUF_FATAL_ERROR"; + case ISP_EVENT_STREAM_UPDATE_DONE: return "ISP_EVENT_STREAM_UPDATE_DONE"; + default: return "unknown"; + } +} + +static FrameMetadata get_frame_metadata(CameraState *s, uint32_t frame_id) { + std::lock_guard lk(s->frame_info_lock); + for (auto &i : s->frame_metadata) { + if (i.frame_id == frame_id) { + return i; + } + } + // should never happen + return (FrameMetadata){ + .frame_id = (uint32_t)-1, + }; +} + +static void ops_thread(MultiCameraState *s) { + int last_road_cam_op_id = 0; + int last_driver_cam_op_id = 0; + + CameraExpInfo road_cam_op; + CameraExpInfo driver_cam_op; + + util::set_thread_name("camera_settings"); + while(!do_exit) { + road_cam_op = road_cam_exp.load(); + if (road_cam_op.op_id != last_road_cam_op_id) { + do_autoexposure(&s->road_cam, road_cam_op.grey_frac); + do_autofocus(&s->road_cam); + last_road_cam_op_id = road_cam_op.op_id; + } + + driver_cam_op = driver_cam_exp.load(); + if (driver_cam_op.op_id != last_driver_cam_op_id) { + do_autoexposure(&s->driver_cam, driver_cam_op.grey_frac); + last_driver_cam_op_id = driver_cam_op.op_id; + } + + util::sleep_for(50); + } +} + +static void setup_self_recover(CameraState *c, const uint16_t *lapres, size_t lapres_size) { + const float lens_true_pos = c->lens_true_pos.load(); + int self_recover = c->self_recover.load(); + if (self_recover < 2 && (lens_true_pos < (LP3_AF_DAC_DOWN + 1) || lens_true_pos > (LP3_AF_DAC_UP - 1)) && is_blur(lapres, lapres_size)) { + // truly stuck, needs help + if (--self_recover < -FOCUS_RECOVER_PATIENCE) { + LOGD("road camera bad state detected. attempting recovery from %.1f, recover state is %d", lens_true_pos, self_recover); + // parity determined by which end is stuck at + self_recover = FOCUS_RECOVER_STEPS + (lens_true_pos < LP3_AF_DAC_M ? 1 : 0); + } + } else if (self_recover < 2 && (lens_true_pos < (LP3_AF_DAC_M - LP3_AF_DAC_3SIG) || lens_true_pos > (LP3_AF_DAC_M + LP3_AF_DAC_3SIG))) { + // in suboptimal position with high prob, but may still recover by itself + if (--self_recover < -(FOCUS_RECOVER_PATIENCE * 3)) { + self_recover = FOCUS_RECOVER_STEPS / 2 + (lens_true_pos < LP3_AF_DAC_M ? 1 : 0); + } + } else if (self_recover < 0) { + self_recover += 1; // reset if fine + } + c->self_recover.store(self_recover); +} + +// called by processing_thread +void process_road_camera(MultiCameraState *s, CameraState *c, int cnt) { + const CameraBuf *b = &c->buf; + const int roi_id = cnt % std::size(s->lapres); // rolling roi + s->lapres[roi_id] = s->lap_conv->Update(b->q, (uint8_t *)b->cur_rgb_buf->addr, roi_id); + setup_self_recover(c, &s->lapres[0], std::size(s->lapres)); + + MessageBuilder msg; + auto framed = msg.initEvent().initRoadCameraState(); + fill_frame_data(framed, b->cur_frame_data); + if (env_send_road) { + framed.setImage(get_frame_image(b)); + } + framed.setFocusVal(s->road_cam.focus); + framed.setFocusConf(s->road_cam.confidence); + framed.setRecoverState(s->road_cam.self_recover); + framed.setSharpnessScore(s->lapres); + framed.setTransform(b->yuv_transform.v); + s->pm->send("roadCameraState", msg); + + if (cnt % 3 == 0) { + const int x = 290, y = 322, width = 560, height = 314; + const int skip = 1; + camera_autoexposure(c, set_exposure_target(b, x, x + width, skip, y, y + height, skip)); + } +} + +void cameras_run(MultiCameraState *s) { + std::vector threads; + threads.push_back(std::thread(ops_thread, s)); + threads.push_back(start_process_thread(s, &s->road_cam, process_road_camera)); + threads.push_back(start_process_thread(s, &s->driver_cam, common_process_driver_camera)); + + CameraState* cameras[2] = {&s->road_cam, &s->driver_cam}; + + while (!do_exit) { + struct pollfd fds[2] = {{.fd = cameras[0]->isp_fd, .events = POLLPRI}, + {.fd = cameras[1]->isp_fd, .events = POLLPRI}}; + int ret = poll(fds, std::size(fds), 1000); + if (ret < 0) { + if (errno == EINTR || errno == EAGAIN) continue; + LOGE("poll failed (%d - %d)", ret, errno); + break; + } + + // process cameras + for (int i=0; i<2; i++) { + if (!fds[i].revents) continue; + + CameraState *c = cameras[i]; + + struct v4l2_event ev = {}; + ret = HANDLE_EINTR(ioctl(c->isp_fd, VIDIOC_DQEVENT, &ev)); + const msm_isp_event_data *isp_event_data = (const msm_isp_event_data *)ev.u.data; + + if (ev.type == ISP_EVENT_BUF_DIVERT) { + const int buf_idx = isp_event_data->u.buf_done.buf_idx; + const int buffer = (isp_event_data->u.buf_done.stream_id & 0xFFFF) - 1; + if (buffer == 0) { + c->buf.camera_bufs_metadata[buf_idx] = get_frame_metadata(c, isp_event_data->frame_id); + c->buf.queue(buf_idx); + } else { + auto &ss = c->ss[buffer]; + if (buffer == 1) { + parse_autofocus(c, (uint8_t *)(ss.bufs[buf_idx].addr)); + } + ss.qbuf_info[buf_idx].dirty_buf = 1; + HANDLE_EINTR(ioctl(c->isp_fd, VIDIOC_MSM_ISP_ENQUEUE_BUF, &ss.qbuf_info[buf_idx])); + } + + } else if (ev.type == ISP_EVENT_EOF) { + const uint64_t timestamp = (isp_event_data->mono_timestamp.tv_sec * 1000000000ULL + isp_event_data->mono_timestamp.tv_usec * 1000); + std::lock_guard lk(c->frame_info_lock); + c->frame_metadata[c->frame_metadata_idx] = (FrameMetadata){ + .frame_id = isp_event_data->frame_id, + .timestamp_eof = timestamp, + .frame_length = (uint32_t)c->frame_length, + .integ_lines = (uint32_t)c->cur_integ_lines, + .lens_pos = c->cur_lens_pos, + .lens_err = c->focus_err, + .lens_true_pos = c->lens_true_pos, + .gain = c->cur_gain_frac, + .measured_grey_fraction = c->measured_grey_fraction, + .target_grey_fraction = c->target_grey_fraction, + .high_conversion_gain = false, + }; + c->frame_metadata_idx = (c->frame_metadata_idx + 1) % METADATA_BUF_COUNT; + + } else if (ev.type == ISP_EVENT_ERROR) { + LOGE("ISP_EVENT_ERROR! err type: 0x%08x", isp_event_data->u.error_info.err_type); + } + } + } + + LOG(" ************** STOPPING **************"); + + for (auto &t : threads) t.join(); + + cameras_close(s); +} + +void cameras_close(MultiCameraState *s) { + camera_close(&s->road_cam); + camera_close(&s->driver_cam); + for (int i = 0; i < FRAME_BUF_COUNT; i++) { + s->focus_bufs[i].free(); + s->stats_bufs[i].free(); + } + + delete s->lap_conv; + delete s->sm; + delete s->pm; +} diff --git a/selfdrive/camerad/cameras/camera_qcom.h b/selfdrive/camerad/cameras/camera_qcom.h new file mode 100644 index 000000000..87bbe4b7e --- /dev/null +++ b/selfdrive/camerad/cameras/camera_qcom.h @@ -0,0 +1,106 @@ +#pragma once + +#include +#include +#include + +#include "cereal/messaging/messaging.h" +#include "cereal/visionipc/visionbuf.h" +#include "selfdrive/camerad/cameras/camera_common.h" +#include "selfdrive/camerad/imgproc/utils.h" +#include "selfdrive/camerad/include/msm_cam_sensor.h" +#include "selfdrive/camerad/include/msmb_camera.h" +#include "selfdrive/camerad/include/msmb_isp.h" +#include "selfdrive/camerad/include/msmb_ispif.h" +#include "selfdrive/common/mat.h" +#include "selfdrive/common/util.h" + +#define FRAME_BUF_COUNT 4 +#define METADATA_BUF_COUNT 4 + +#define NUM_FOCUS 8 + +#define LP3_AF_DAC_DOWN 366 +#define LP3_AF_DAC_UP 634 +#define LP3_AF_DAC_M 440 +#define LP3_AF_DAC_3SIG 52 + +#define FOCUS_RECOVER_PATIENCE 50 // 2.5 seconds of complete blur +#define FOCUS_RECOVER_STEPS 240 // 6 seconds + +typedef struct CameraState CameraState; + +typedef int (*camera_apply_exposure_func)(CameraState *s, int gain, int integ_lines, uint32_t frame_length); + +typedef struct StreamState { + struct msm_isp_buf_request buf_request; + struct msm_vfe_axi_stream_request_cmd stream_req; + struct msm_isp_qbuf_info qbuf_info[FRAME_BUF_COUNT]; + VisionBuf *bufs; +} StreamState; + +typedef struct CameraState { + int camera_num; + int camera_id; + + int fps; + CameraInfo ci; + + unique_fd csid_fd; + unique_fd csiphy_fd; + unique_fd sensor_fd; + unique_fd isp_fd; + + struct msm_vfe_axi_stream_cfg_cmd stream_cfg; + + StreamState ss[3]; + CameraBuf buf; + + std::mutex frame_info_lock; + FrameMetadata frame_metadata[METADATA_BUF_COUNT]; + int frame_metadata_idx; + + // exposure + uint32_t pixel_clock, line_length_pclk; + uint32_t frame_length; + unsigned int max_gain; + float cur_exposure_frac, cur_gain_frac; + int cur_gain, cur_integ_lines; + + float measured_grey_fraction; + float target_grey_fraction; + + std::atomic digital_gain; + camera_apply_exposure_func apply_exposure; + + // rear camera only,used for focusing + unique_fd actuator_fd; + std::atomic focus_err; + std::atomic lens_true_pos; + std::atomic self_recover; // af recovery counter, neg is patience, pos is active + uint16_t cur_step_pos; + uint16_t cur_lens_pos; + int16_t focus[NUM_FOCUS]; + uint8_t confidence[NUM_FOCUS]; +} CameraState; + + +typedef struct MultiCameraState { + unique_fd ispif_fd; + unique_fd msmcfg_fd; + unique_fd v4l_fd; + uint16_t lapres[(ROI_X_MAX-ROI_X_MIN+1)*(ROI_Y_MAX-ROI_Y_MIN+1)]; + + VisionBuf focus_bufs[FRAME_BUF_COUNT]; + VisionBuf stats_bufs[FRAME_BUF_COUNT]; + + CameraState road_cam; + CameraState driver_cam; + + SubMaster *sm; + PubMaster *pm; + LapConv *lap_conv; +} MultiCameraState; + +void actuator_move(CameraState *s, uint16_t target); +int sensor_write_regs(CameraState *s, struct msm_camera_i2c_reg_array* arr, size_t size, int data_type); diff --git a/selfdrive/camerad/cameras/camera_replay.cc b/selfdrive/camerad/cameras/camera_replay.cc new file mode 100644 index 000000000..b5b2e6ad2 --- /dev/null +++ b/selfdrive/camerad/cameras/camera_replay.cc @@ -0,0 +1,125 @@ +#include "selfdrive/camerad/cameras/camera_replay.h" + +#include +#include + +#include "selfdrive/common/clutil.h" +#include "selfdrive/common/util.h" + +extern ExitHandler do_exit; + +void camera_autoexposure(CameraState *s, float grey_frac) {} + +namespace { + +const char *BASE_URL = "https://commadataci.blob.core.windows.net/openpilotci/"; + +const std::string road_camera_route = "0c94aa1e1296d7c6|2021-05-05--19-48-37"; +// const std::string driver_camera_route = "534ccd8a0950a00c|2021-06-08--12-15-37"; + +std::string get_url(std::string route_name, const std::string &camera, int segment_num) { + std::replace(route_name.begin(), route_name.end(), '|', '/'); + return util::string_format("%s%s/%d/%s.hevc", BASE_URL, route_name.c_str(), segment_num, camera.c_str()); +} + +void camera_init(VisionIpcServer *v, CameraState *s, int camera_id, unsigned int fps, cl_device_id device_id, cl_context ctx, VisionStreamType rgb_type, VisionStreamType yuv_type, const std::string &url) { + s->frame = new FrameReader(); + if (!s->frame->load(url)) { + printf("failed to load stream from %s", url.c_str()); + assert(0); + } + + CameraInfo ci = { + .frame_width = s->frame->width, + .frame_height = s->frame->height, + .frame_stride = s->frame->width * 3, + }; + s->ci = ci; + s->camera_num = camera_id; + s->fps = fps; + s->buf.init(device_id, ctx, s, v, FRAME_BUF_COUNT, rgb_type, yuv_type); +} + +void camera_close(CameraState *s) { + delete s->frame; +} + +void run_camera(CameraState *s) { + uint32_t stream_frame_id = 0, frame_id = 0; + size_t buf_idx = 0; + std::unique_ptr rgb_buf = std::make_unique(s->frame->getRGBSize()); + std::unique_ptr yuv_buf = std::make_unique(s->frame->getYUVSize()); + while (!do_exit) { + if (stream_frame_id == s->frame->getFrameCount()) { + // loop stream + stream_frame_id = 0; + } + if (s->frame->get(stream_frame_id++, rgb_buf.get(), yuv_buf.get())) { + s->buf.camera_bufs_metadata[buf_idx] = {.frame_id = frame_id}; + auto &buf = s->buf.camera_bufs[buf_idx]; + CL_CHECK(clEnqueueWriteBuffer(buf.copy_q, buf.buf_cl, CL_TRUE, 0, s->frame->getRGBSize(), rgb_buf.get(), 0, NULL, NULL)); + s->buf.queue(buf_idx); + ++frame_id; + buf_idx = (buf_idx + 1) % FRAME_BUF_COUNT; + } + util::sleep_for(1000 / s->fps); + } +} + +void road_camera_thread(CameraState *s) { + util::set_thread_name("replay_road_camera_thread"); + run_camera(s); +} + +// void driver_camera_thread(CameraState *s) { +// util::set_thread_name("replay_driver_camera_thread"); +// run_camera(s); +// } + +void process_road_camera(MultiCameraState *s, CameraState *c, int cnt) { + const CameraBuf *b = &c->buf; + MessageBuilder msg; + auto framed = msg.initEvent().initRoadCameraState(); + fill_frame_data(framed, b->cur_frame_data); + framed.setImage(kj::arrayPtr((const uint8_t *)b->cur_yuv_buf->addr, b->cur_yuv_buf->len)); + framed.setTransform(b->yuv_transform.v); + s->pm->send("roadCameraState", msg); +} + +// void process_driver_camera(MultiCameraState *s, CameraState *c, int cnt) { +// MessageBuilder msg; +// auto framed = msg.initEvent().initDriverCameraState(); +// framed.setFrameType(cereal::FrameData::FrameType::FRONT); +// fill_frame_data(framed, c->buf.cur_frame_data); +// s->pm->send("driverCameraState", msg); +// } + +} // namespace + +void cameras_init(VisionIpcServer *v, MultiCameraState *s, cl_device_id device_id, cl_context ctx) { + camera_init(v, &s->road_cam, CAMERA_ID_LGC920, 20, device_id, ctx, + VISION_STREAM_RGB_BACK, VISION_STREAM_ROAD, get_url(road_camera_route, "fcamera", 0)); + // camera_init(v, &s->driver_cam, CAMERA_ID_LGC615, 10, device_id, ctx, + // VISION_STREAM_RGB_FRONT, VISION_STREAM_DRIVER, get_url(driver_camera_route, "dcamera", 0)); + s->pm = new PubMaster({"roadCameraState", "driverCameraState", "thumbnail"}); +} + +void cameras_open(MultiCameraState *s) {} + +void cameras_close(MultiCameraState *s) { + camera_close(&s->road_cam); + camera_close(&s->driver_cam); + delete s->pm; +} + +void cameras_run(MultiCameraState *s) { + std::vector threads; + threads.push_back(start_process_thread(s, &s->road_cam, process_road_camera)); + // threads.push_back(start_process_thread(s, &s->driver_cam, process_driver_camera)); + // threads.push_back(std::thread(driver_camera_thread, &s->driver_cam)); + road_camera_thread(&s->road_cam); + + for (auto &t : threads) t.join(); + + cameras_close(s); +} diff --git a/selfdrive/camerad/cameras/camera_replay.h b/selfdrive/camerad/cameras/camera_replay.h new file mode 100644 index 000000000..7c41af0ab --- /dev/null +++ b/selfdrive/camerad/cameras/camera_replay.h @@ -0,0 +1,25 @@ +#pragma once + +#include "selfdrive/camerad/cameras/camera_common.h" +#include "selfdrive/ui/replay/framereader.h" + +#define FRAME_BUF_COUNT 16 + +typedef struct CameraState { + int camera_num; + CameraInfo ci; + + int fps; + float digital_gain = 0; + + CameraBuf buf; + FrameReader *frame = nullptr; +} CameraState; + +typedef struct MultiCameraState { + CameraState road_cam; + CameraState driver_cam; + + SubMaster *sm = nullptr; + PubMaster *pm = nullptr; +} MultiCameraState; diff --git a/selfdrive/camerad/cameras/debayer.cl b/selfdrive/camerad/cameras/debayer.cl new file mode 100644 index 000000000..5188dc88c --- /dev/null +++ b/selfdrive/camerad/cameras/debayer.cl @@ -0,0 +1,131 @@ +const __constant float3 color_correction[3] = { + // Matrix from WBraw -> sRGBD65 (normalized) + (float3)( 1.62393627, -0.2092988, 0.00119886), + (float3)(-0.45734315, 1.5534676, -0.59296798), + (float3)(-0.16659312, -0.3441688, 1.59176912), +}; + +float3 color_correct(float3 x) { + float3 ret = (0,0,0); + + // white balance of daylight + x /= (float3)(0.4609375, 1.0, 0.546875); + x = max(0.0, min(1.0, x)); + + // fix up the colors + ret += x.x * color_correction[0]; + ret += x.y * color_correction[1]; + ret += x.z * color_correction[2]; + return ret; +} + +float3 srgb_gamma(float3 p) { + // go all out and add an sRGB gamma curve + const float3 ph = (1.0f + 0.055f)*pow(p, 1/2.4f) - 0.055f; + const float3 pl = p*12.92f; + return select(ph, pl, islessequal(p, 0.0031308f)); +} + +__constant int dpcm_lookup[512] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -17, -18, -19, -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, -30, -31, 935, 951, 967, 983, 999, 1015, 1031, 1047, 1063, 1079, 1095, 1111, 1127, 1143, 1159, 1175, 1191, 1207, 1223, 1239, 1255, 1271, 1287, 1303, 1319, 1335, 1351, 1367, 1383, 1399, 1415, 1431, -935, -951, -967, -983, -999, -1015, -1031, -1047, -1063, -1079, -1095, -1111, -1127, -1143, -1159, -1175, -1191, -1207, -1223, -1239, -1255, -1271, -1287, -1303, -1319, -1335, -1351, -1367, -1383, -1399, -1415, -1431, 419, 427, 435, 443, 451, 459, 467, 475, 483, 491, 499, 507, 515, 523, 531, 539, 547, 555, 563, 571, 579, 587, 595, 603, 611, 619, 627, 635, 643, 651, 659, 667, 675, 683, 691, 699, 707, 715, 723, 731, 739, 747, 755, 763, 771, 779, 787, 795, 803, 811, 819, 827, 835, 843, 851, 859, 867, 875, 883, 891, 899, 907, 915, 923, -419, -427, -435, -443, -451, -459, -467, -475, -483, -491, -499, -507, -515, -523, -531, -539, -547, -555, -563, -571, -579, -587, -595, -603, -611, -619, -627, -635, -643, -651, -659, -667, -675, -683, -691, -699, -707, -715, -723, -731, -739, -747, -755, -763, -771, -779, -787, -795, -803, -811, -819, -827, -835, -843, -851, -859, -867, -875, -883, -891, -899, -907, -915, -923, 161, 165, 169, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 233, 237, 241, 245, 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, 289, 293, 297, 301, 305, 309, 313, 317, 321, 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, 365, 369, 373, 377, 381, 385, 389, 393, 397, 401, 405, 409, 413, -161, -165, -169, -173, -177, -181, -185, -189, -193, -197, -201, -205, -209, -213, -217, -221, -225, -229, -233, -237, -241, -245, -249, -253, -257, -261, -265, -269, -273, -277, -281, -285, -289, -293, -297, -301, -305, -309, -313, -317, -321, -325, -329, -333, -337, -341, -345, -349, -353, -357, -361, -365, -369, -373, -377, -381, -385, -389, -393, -397, -401, -405, -409, -413, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, -32, -34, -36, -38, -40, -42, -44, -46, -48, -50, -52, -54, -56, -58, -60, -62, -64, -66, -68, -70, -72, -74, -76, -78, -80, -82, -84, -86, -88, -90, -92, -94, -96, -98, -100, -102, -104, -106, -108, -110, -112, -114, -116, -118, -120, -122, -124, -126, -128, -130, -132, -134, -136, -138, -140, -142, -144, -146, -148, -150, -152, -154, -156, -158}; + +inline uint4 decompress(uint4 p, uint4 pl) { + uint4 r1 = (pl + (uint4)(dpcm_lookup[p.s0], dpcm_lookup[p.s1], dpcm_lookup[p.s2], dpcm_lookup[p.s3])); + uint4 r2 = ((p-0x200)<<5) | 0xF; + r2 += select((uint4)(0,0,0,0), (uint4)(1,1,1,1), r2 <= pl); + return select(r2, r1, p < 0x200); +} + +__kernel void debayer10(__global uchar const * const in, + __global uchar * out, float digital_gain) +{ + const int oy = get_global_id(0); + if (oy >= RGB_HEIGHT) return; + const int iy = oy * 2; + + uint4 pint_last; + for (int ox = 0; ox < RGB_WIDTH; ox += 2) { + const int ix = (ox/2) * 5; + + // TODO: why doesn't this work for the frontview + /*const uchar8 v1 = vload8(0, &in[iy * FRAME_STRIDE + ix]); + const uchar ex1 = v1.s4; + const uchar8 v2 = vload8(0, &in[(iy+1) * FRAME_STRIDE + ix]); + const uchar ex2 = v2.s4;*/ + + const uchar4 v1 = vload4(0, &in[iy * FRAME_STRIDE + ix]); + const uchar ex1 = in[iy * FRAME_STRIDE + ix + 4]; + const uchar4 v2 = vload4(0, &in[(iy+1) * FRAME_STRIDE + ix]); + const uchar ex2 = in[(iy+1) * FRAME_STRIDE + ix + 4]; + + uint4 pinta[2]; + pinta[0] = (uint4)( + (((uint)v1.s0 << 2) + ( (ex1 >> 0) & 3)), + (((uint)v1.s1 << 2) + ( (ex1 >> 2) & 3)), + (((uint)v2.s0 << 2) + ( (ex2 >> 0) & 3)), + (((uint)v2.s1 << 2) + ( (ex2 >> 2) & 3))); + pinta[1] = (uint4)( + (((uint)v1.s2 << 2) + ( (ex1 >> 4) & 3)), + (((uint)v1.s3 << 2) + ( (ex1 >> 6) & 3)), + (((uint)v2.s2 << 2) + ( (ex2 >> 4) & 3)), + (((uint)v2.s3 << 2) + ( (ex2 >> 6) & 3))); + + #pragma unroll + for (uint px = 0; px < 2; px++) { + uint4 pint = pinta[px]; + +#if HDR + // decompress HDR + pint = (ox == 0 && px == 0) ? ((pint<<4) | 8) : decompress(pint, pint_last); + pint_last = pint; +#endif + + float4 p = convert_float4(pint); + + // 64 is the black level of the sensor, remove + // (changed to 56 for HDR) + const float black_level = 56.0f; + // TODO: switch to max here? + p = (p - black_level); + + // correct vignetting (no pow function?) + // see https://www.eecis.udel.edu/~jye/lab_research/09/JiUp.pdf the A (4th order) + const float r = ((oy - RGB_HEIGHT/2)*(oy - RGB_HEIGHT/2) + (ox - RGB_WIDTH/2)*(ox - RGB_WIDTH/2)); + const float fake_f = 700.0f; // should be 910, but this fits... + const float lil_a = (1.0f + r/(fake_f*fake_f)); + p = p * lil_a * lil_a; + + // rescale to 1.0 +#if HDR + p /= (16384.0f-black_level); +#else + p /= (1024.0f-black_level); +#endif + + // digital gain + p *= digital_gain; + + // use both green channels +#if BAYER_FLIP == 3 + float3 c1 = (float3)(p.s3, (p.s1+p.s2)/2.0f, p.s0); +#elif BAYER_FLIP == 2 + float3 c1 = (float3)(p.s2, (p.s0+p.s3)/2.0f, p.s1); +#elif BAYER_FLIP == 1 + float3 c1 = (float3)(p.s1, (p.s0+p.s3)/2.0f, p.s2); +#elif BAYER_FLIP == 0 + float3 c1 = (float3)(p.s0, (p.s1+p.s2)/2.0f, p.s3); +#endif + + // color correction + c1 = color_correct(c1); + +#if HDR + // srgb gamma isn't right for YUV, so it's disabled for now + c1 = srgb_gamma(c1); +#endif + + // output BGR + const int ooff = oy * RGB_STRIDE/3 + ox; + vstore3(convert_uchar3_sat(c1.zyx * 255.0f), ooff+px, out); + } + } +} diff --git a/selfdrive/camerad/cameras/sensor2_i2c.h b/selfdrive/camerad/cameras/sensor2_i2c.h new file mode 100644 index 000000000..c3d8861a9 --- /dev/null +++ b/selfdrive/camerad/cameras/sensor2_i2c.h @@ -0,0 +1,124 @@ +struct i2c_random_wr_payload start_reg_array[] = {{0x301A, 0x91C}}; +struct i2c_random_wr_payload stop_reg_array[] = {{0x301A, 0x918}}; + +struct i2c_random_wr_payload init_array_ar0231[] = { + {0x301A, 0x0018}, // RESET_REGISTER + + // CLOCK Settings + {0x302A, 0x0006}, // VT_PIX_CLK_DIV + {0x302C, 0x0001}, // VT_SYS_CLK_DIV + {0x302E, 0x0002}, // PRE_PLL_CLK_DIV + {0x3030, 0x0032}, // PLL_MULTIPLIER + {0x3036, 0x000A}, // OP_WORD_CLK_DIV + {0x3038, 0x0001}, // OP_SYS_CLK_DIV + + // FORMAT + {0x3040, 0xC000}, // READ_MODE + {0x3004, 0x0000}, // X_ADDR_START_ (A) + {0x308A, 0x0000}, // X_ADDR_START_ (B) + {0x3008, 0x0787}, // X_ADDR_END_ (A) + {0x308E, 0x0787}, // X_ADDR_END_ (B) + {0x3002, 0x0000}, // Y_ADDR_START_ (A) + {0x308C, 0x0000}, // Y_ADDR_START_ (B) + {0x3006, 0x04B7}, // Y_ADDR_END_ (A) + {0x3090, 0x04B7}, // Y_ADDR_END_ (B) + {0x3032, 0x0000}, // SCALING_MODE + {0x30A2, 0x0001}, // X_ODD_INC_ (A) + {0x30AE, 0x0001}, // X_ODD_INC_ (B) + {0x30A6, 0x0001}, // Y_ODD_INC_ (A) + {0x30A8, 0x0001}, // Y_ODD_INC_ (B) + {0x3402, 0x0F10}, // X_OUTPUT_CONTROL + {0x3404, 0x0970}, // Y_OUTPUT_CONTROL + {0x3064, 0x1802}, // SMIA_TEST + {0x30BA, 0x11F2}, // DIGITAL_CTRL + + // SLAV* MODE + {0x30CE, 0x0120}, + {0x340A, 0xE6}, // E6 // 0000 1110 0110 + {0x340C, 0x802}, // 2 // 0000 0000 0010 + + // Readout timing + {0x300C, 0x07B9}, // LINE_LENGTH_PCK (A) + {0x303E, 0x07B9}, // LINE_LENGTH_PCK (B) + {0x300A, 0x07E7}, // FRAME_LENGTH_LINES (A) + {0x30AA, 0x07E7}, // FRAME_LENGTH_LINES (B) + {0x3042, 0x0000}, // EXTRA_DELAY + + // Readout Settings + {0x31AE, 0x0204}, // SERIAL_FORMAT, 4-lane MIPI + {0x31AC, 0x0C0A}, // DATA_FORMAT_BITS, 12 -> 10 + {0x3342, 0x122B}, // MIPI_F1_PDT_EDT + {0x3346, 0x122B}, // MIPI_F2_PDT_EDT + {0x334A, 0x122B}, // MIPI_F3_PDT_EDT + {0x334E, 0x122B}, // MIPI_F4_PDT_EDT + {0x3344, 0x0011}, // MIPI_F1_VDT_VC + {0x3348, 0x0111}, // MIPI_F2_VDT_VC + {0x334C, 0x0211}, // MIPI_F3_VDT_VC + {0x3350, 0x0311}, // MIPI_F4_VDT_VC + {0x31B0, 0x0053}, // FRAME_PREAMBLE + {0x31B2, 0x003B}, // LINE_PREAMBLE + {0x301A, 0x001C}, // RESET_REGISTER + + // Noise Corrections + {0x3092, 0x0C24}, // ROW_NOISE_CONTROL + {0x337A, 0x0C80}, // DBLC_SCALE0 + {0x3370, 0x03B1}, // DBLC + {0x3044, 0x0400}, // DARK_CONTROL + + // Enable dead pixel correction using + // the 1D line correction scheme + {0x31E0, 0x0003}, + + // HDR Settings + {0x3082, 0x0004}, // OPERATION_MODE_CTRL (A) + {0x3084, 0x0004}, // OPERATION_MODE_CTRL (B) + + {0x3238, 0x0004}, // EXPOSURE_RATIO (A) + {0x323A, 0x0004}, // EXPOSURE_RATIO (B) + + {0x3014, 0x098E}, // FINE_INTEGRATION_TIME_ (A) + {0x3018, 0x098E}, // FINE_INTEGRATION_TIME_ (B) + + {0x321E, 0x098E}, // FINE_INTEGRATION_TIME2 (A) + {0x3220, 0x098E}, // FINE_INTEGRATION_TIME2 (B) + + {0x31D0, 0x0000}, // COMPANDING, no good in 10 bit? + {0x33DA, 0x0000}, // COMPANDING + {0x318E, 0x0200}, // PRE_HDR_GAIN_EN + + // DLO Settings + {0x3100, 0x4000}, // DLO_CONTROL0 + {0x3280, 0x0CCC}, // T1 G1 + {0x3282, 0x0CCC}, // T1 R + {0x3284, 0x0CCC}, // T1 B + {0x3286, 0x0CCC}, // T1 G2 + {0x3288, 0x0FA0}, // T2 G1 + {0x328A, 0x0FA0}, // T2 R + {0x328C, 0x0FA0}, // T2 B + {0x328E, 0x0FA0}, // T2 G2 + + // Initial Gains + {0x3022, 0x0001}, // GROUPED_PARAMETER_HOLD_ + {0x3366, 0xFF77}, // ANALOG_GAIN (1x) (A) + {0x3368, 0xFF77}, // ANALOG_GAIN (1x) (B) + + {0x3060, 0x3333}, // ANALOG_COLOR_GAIN + + {0x3362, 0x0000}, // DC GAIN (A & B) + + {0x305A, 0x00F8}, // red gain (A) + {0x3058, 0x0122}, // blue gain (A) + {0x3056, 0x009A}, // g1 gain (A) + {0x305C, 0x009A}, // g2 gain (A) + + {0x30C0, 0x00F8}, // red gain (B) + {0x30BE, 0x0122}, // blue gain (B) + {0x30BC, 0x009A}, // g1 gain (B) + {0x30C2, 0x009A}, // g2 gain (B) + + {0x3022, 0x0000}, // GROUPED_PARAMETER_HOLD_ + + // Initial Integration Time + {0x3012, 0x0005}, // (A) + {0x3016, 0x0005}, // (B) +}; diff --git a/selfdrive/camerad/cameras/sensor_i2c.h b/selfdrive/camerad/cameras/sensor_i2c.h new file mode 100644 index 000000000..b46ebb370 --- /dev/null +++ b/selfdrive/camerad/cameras/sensor_i2c.h @@ -0,0 +1,651 @@ +static struct msm_camera_i2c_reg_array init_array_imx298[] = { + {0x101,0x0,0}, // IMAGE_ORIENT + {0x601,0x0,0}, // test pattern + //{0xb02,0,0}, // green correction? + // external clock setting + {0x136,0x18,0}, {0x137,0x0,0}, // EXCK_FREQ = Extclk_frequency_mhz + // global setting? + {0x30f4,0x1,0}, + {0x30f5,0x7a,0}, + {0x30f6,0x0,0}, + {0x30f7,0xec,0}, + {0x30fc,0x1,0}, + {0x3101,0x1,0}, + {0x5b2f,0x8,0}, + {0x5d32,0x5,0}, + {0x5d7c,0x0,0}, + {0x5d7d,0x0,0}, + {0x5db9,0x1,0}, + {0x5e43,0x0,0}, + {0x6300,0x0,0}, + {0x6301,0xea,0}, + {0x6302,0x0,0}, + {0x6303,0xb4,0}, + {0x6564,0x0,0}, + {0x6565,0xb6,0}, + {0x6566,0x0,0}, + {0x6567,0xe6,0}, + {0x6714,0x1,0}, + {0x6758,0xb,0}, + {0x6910,0x4,0}, + {0x6916,0x1,0}, + {0x6918,0x4,0}, + {0x691e,0x1,0}, + {0x6931,0x1,0}, + {0x6937,0x2,0}, + {0x693b,0x2,0}, + {0x6d00,0x4a,0}, + {0x6d01,0x41,0}, + {0x6d02,0x23,0}, + {0x6d05,0x4c,0}, + {0x6d06,0x10,0}, + {0x6d08,0x30,0}, + {0x6d09,0x38,0}, + {0x6d0a,0x2c,0}, + {0x6d0b,0x2d,0}, + {0x6d0c,0x34,0}, + {0x6d0d,0x42,0}, + {0x6d19,0x1c,0}, + {0x6d1a,0x71,0}, + {0x6d1b,0xc6,0}, + {0x6d1c,0x94,0}, + {0x6d24,0xe4,0}, + {0x6d30,0xa,0}, + {0x6d31,0x1,0}, + {0x6d33,0xb,0}, + {0x6d34,0x5,0}, + {0x6d35,0x0,0}, + {0x83c2,0x3,0}, + {0x83c3,0x8,0}, + {0x83c4,0x48,0}, + {0x83c7,0x8,0}, + {0x83cb,0x0,0}, + {0xb101,0xff,0}, + {0xb103,0xff,0}, + {0xb105,0xff,0}, + {0xb107,0xff,0}, + {0xb109,0xff,0}, + {0xb10b,0xff,0}, + {0xb10d,0xff,0}, + {0xb10f,0xff,0}, + {0xb111,0xff,0}, + {0xb163,0x3c,0}, + {0xc2a0,0x8,0}, + {0xc2a3,0x3,0}, + {0xc2a5,0x8,0}, + {0xc2a6,0x48,0}, + {0xc2a9,0x0,0}, + {0xf800,0x5e,0}, + {0xf801,0x5e,0}, + {0xf802,0xcd,0}, + {0xf803,0x20,0}, + {0xf804,0x55,0}, + {0xf805,0xd4,0}, + {0xf806,0x1f,0}, + {0xf808,0xf8,0}, + {0xf809,0x3a,0}, + {0xf80a,0xf1,0}, + {0xf80b,0x7e,0}, + {0xf80c,0x55,0}, + {0xf80d,0x38,0}, + {0xf80e,0xe3,0}, + {0xf810,0x74,0}, + {0xf811,0x41,0}, + {0xf812,0xbf,0}, + {0xf844,0x40,0}, + {0xf845,0xba,0}, + {0xf846,0x70,0}, + {0xf847,0x47,0}, + {0xf848,0xc0,0}, + {0xf849,0xba,0}, + {0xf84a,0x70,0}, + {0xf84b,0x47,0}, + {0xf84c,0x82,0}, + {0xf84d,0xf6,0}, + {0xf84e,0x32,0}, + {0xf84f,0xfd,0}, + {0xf851,0xf0,0}, + {0xf852,0x2,0}, + {0xf853,0xf8,0}, + {0xf854,0x81,0}, + {0xf855,0xf6,0}, + {0xf856,0xc0,0}, + {0xf857,0xff,0}, + {0xf858,0x10,0}, + {0xf859,0xb5,0}, + {0xf85a,0xd,0}, + {0xf85b,0x48,0}, + {0xf85c,0x40,0}, + {0xf85d,0x7a,0}, + {0xf85e,0x1,0}, + {0xf85f,0x28,0}, + {0xf860,0x15,0}, + {0xf861,0xd1,0}, + {0xf862,0xc,0}, + {0xf863,0x49,0}, + {0xf864,0xc,0}, + {0xf865,0x46,0}, + {0xf866,0x40,0}, + {0xf867,0x3c,0}, + {0xf868,0x48,0}, + {0xf869,0x8a,0}, + {0xf86a,0x62,0}, + {0xf86b,0x8a,0}, + {0xf86c,0x80,0}, + {0xf86d,0x1a,0}, + {0xf86e,0x8a,0}, + {0xf86f,0x89,0}, + {0xf871,0xb2,0}, + {0xf872,0x10,0}, + {0xf873,0x18,0}, + {0xf874,0xa,0}, + {0xf875,0x46,0}, + {0xf876,0x20,0}, + {0xf877,0x32,0}, + {0xf878,0x12,0}, + {0xf879,0x88,0}, + {0xf87a,0x90,0}, + {0xf87b,0x42,0}, + {0xf87d,0xda,0}, + {0xf87e,0x10,0}, + {0xf87f,0x46,0}, + {0xf880,0x80,0}, + {0xf881,0xb2,0}, + {0xf882,0x88,0}, + {0xf883,0x81,0}, + {0xf884,0x84,0}, + {0xf885,0xf6,0}, + {0xf886,0xd2,0}, + {0xf887,0xf9,0}, + {0xf888,0xe0,0}, + {0xf889,0x67,0}, + {0xf88a,0x85,0}, + {0xf88b,0xf6,0}, + {0xf88c,0xa1,0}, + {0xf88d,0xfc,0}, + {0xf88e,0x10,0}, + {0xf88f,0xbd,0}, + {0xf891,0x18,0}, + {0xf892,0x21,0}, + {0xf893,0x24,0}, + {0xf895,0x18,0}, + {0xf896,0x19,0}, + {0xf897,0xb4,0}, + {0x4e29,0x1,0}, + // PDAF stuff + {0x3166,0x1,0}, //AREA_EN_0 + {0x3167,0x1,0}, + {0x3168,0x1,0}, + {0x3169,0x1,0}, + {0x316a,0x1,0}, + {0x316b,0x1,0}, + {0x316c,0x1,0}, + {0x316d,0x1,0}, + {0x3158,0x2,0}, + {0x3159,0x2,0}, + {0x315a,0x2,0}, + {0x315b,0x3,0}, + {0x3013,0x7,0}, //RMSC_NR_MODE + {0x3035,0x1,0}, + {0x3051,0x0,0}, + {0x3056,0x2,0}, + {0x3057,0x1,0}, + {0x3060,0x0,0}, + {0x8435,0x0,0}, + {0x8455,0x0,0}, + {0x847c,0x0,0}, + {0x84fb,0x1,0}, + {0x9619,0xa0,0}, + {0x961b,0xa0,0}, + {0x961d,0xa0,0}, + {0x961f,0x20,0}, + {0x9621,0x20,0}, + {0x9623,0x20,0}, + {0x9625,0xa0,0}, + {0x9627,0xa0,0}, + {0x9629,0xa0,0}, + {0x962b,0x20,0}, + {0x962d,0x20,0}, + {0x962f,0x20,0}, + {0x9901,0x35,0}, + {0x9903,0x23,0}, + {0x9905,0x23,0}, + {0x9906,0x0,0}, + {0x9907,0x31,0}, + {0x9908,0x0,0}, + {0x9909,0x1b,0}, + {0x990a,0x0,0}, + {0x990b,0x15,0}, + {0x990d,0x3f,0}, + {0x990f,0x3f,0}, + {0x9911,0x3f,0}, + {0x9913,0x64,0}, + {0x9915,0x64,0}, + {0x9917,0x64,0}, + {0x9919,0x50,0}, + {0x991b,0x60,0}, + {0x991d,0x65,0}, + {0x991f,0x1,0}, + {0x9921,0x1,0}, + {0x9923,0x1,0}, + {0x9925,0x23,0}, + {0x9927,0x23,0}, + {0x9929,0x23,0}, + {0x992b,0x2f,0}, + {0x992d,0x1a,0}, + {0x992f,0x14,0}, + {0x9931,0x3f,0}, + {0x9933,0x3f,0}, + {0x9935,0x3f,0}, + {0x9937,0x6b,0}, + {0x9939,0x7c,0}, + {0x993b,0x81,0}, + {0x9943,0xf,0}, + {0x9945,0xf,0}, + {0x9947,0xf,0}, + {0x9949,0xf,0}, + {0x994b,0xf,0}, + {0x994d,0xf,0}, + {0x994f,0x42,0}, + {0x9951,0xf,0}, + {0x9953,0xb,0}, + {0x9955,0x5a,0}, + {0x9957,0x13,0}, + {0x9959,0xc,0}, + {0x995a,0x0,0}, + {0x995b,0x0,0}, + {0x995c,0x0,0}, + {0x996b,0x0,0}, + {0x996d,0x10,0}, + {0x996f,0x10,0}, + {0x9971,0xc8,0}, + {0x9973,0x32,0}, + {0x9975,0x4,0}, + {0x9976,0xa,0}, + {0x9977,0xa,0}, + {0x9978,0xa,0}, + {0x99a4,0x2f,0}, + {0x99a5,0x2f,0}, + {0x99a6,0x2f,0}, + {0x99a7,0xa,0}, + {0x99a8,0xa,0}, + {0x99a9,0xa,0}, + {0x99aa,0x2f,0}, + {0x99ab,0x2f,0}, + {0x99ac,0x2f,0}, + {0x99ad,0x0,0}, + {0x99ae,0x0,0}, + {0x99af,0x0,0}, + {0x99b0,0x40,0}, + {0x99b1,0x40,0}, + {0x99b2,0x40,0}, + {0x99b3,0x30,0}, + {0x99b4,0x30,0}, + {0x99b5,0x30,0}, + {0x99bb,0xa,0}, + {0x99bd,0xa,0}, + {0x99bf,0xa,0}, + {0x99c0,0x9,0}, + {0x99c1,0x9,0}, + {0x99c2,0x9,0}, + {0x99c6,0x3c,0}, + {0x99c7,0x3c,0}, + {0x99c8,0x3c,0}, + {0x99c9,0xff,0}, + {0x99ca,0xff,0}, + {0x99cb,0xff,0}, + {0x9b01,0x35,0}, + {0x9b03,0x14,0}, + {0x9b05,0x14,0}, + {0x9b07,0x31,0}, + {0x9b09,0x1b,0}, + {0x9b0b,0x15,0}, + {0x9b0d,0x1e,0}, + {0x9b0f,0x1e,0}, + {0x9b11,0x1e,0}, + {0x9b13,0x64,0}, + {0x9b15,0x64,0}, + {0x9b17,0x64,0}, + {0x9b19,0x50,0}, + {0x9b1b,0x60,0}, + {0x9b1d,0x65,0}, + {0x9b1f,0x1,0}, + {0x9b21,0x1,0}, + {0x9b23,0x1,0}, + {0x9b25,0x14,0}, + {0x9b27,0x14,0}, + {0x9b29,0x14,0}, + {0x9b2b,0x2f,0}, + {0x9b2d,0x1a,0}, + {0x9b2f,0x14,0}, + {0x9b31,0x1e,0}, + {0x9b33,0x1e,0}, + {0x9b35,0x1e,0}, + {0x9b37,0x6b,0}, + {0x9b39,0x7c,0}, + {0x9b3b,0x81,0}, + {0x9b43,0xf,0}, + {0x9b45,0xf,0}, + {0x9b47,0xf,0}, + {0x9b49,0xf,0}, + {0x9b4b,0xf,0}, + {0x9b4d,0xf,0}, + {0x9b4f,0x2d,0}, + {0x9b51,0xb,0}, + {0x9b53,0x8,0}, + {0x9b55,0x40,0}, + {0x9b57,0xd,0}, + {0x9b59,0x8,0}, + {0x9b5a,0x0,0}, + {0x9b5b,0x0,0}, + {0x9b5c,0x0,0}, + {0x9b6b,0x0,0}, + {0x9b6d,0x10,0}, + {0x9b6f,0x10,0}, + {0x9b71,0xc8,0}, + {0x9b73,0x32,0}, + {0x9b75,0x4,0}, + {0x9bb0,0x40,0}, + {0x9bb1,0x40,0}, + {0x9bb2,0x40,0}, + {0x9bb3,0x30,0}, + {0x9bb4,0x30,0}, + {0x9bb5,0x30,0}, + {0x9bbb,0xa,0}, + {0x9bbd,0xa,0}, + {0x9bbf,0xa,0}, + {0x9bc0,0x9,0}, + {0x9bc1,0x9,0}, + {0x9bc2,0x9,0}, + {0x9bc6,0x18,0}, + {0x9bc7,0x18,0}, + {0x9bc8,0x18,0}, + {0x9bc9,0xff,0}, + {0x9bca,0xff,0}, + {0x9bcb,0xff,0}, + {0xb2b2,0x1,0}, +}; + +static struct msm_camera_i2c_reg_array mode_setting_array_imx298[] = { +// i2c settings for mode 3 +// { +// .x_output = 2328, +// .y_output = 1748, +// .line_length_pclk = 5536, +// .frame_length_lines = 1802, +// .vt_pixel_clk = 299300000, +// .op_pixel_clk = 299300000, +// .binning_factor = 2, +// .min_fps = 15.000000, +// .max_fps = 30.020000, +// .mode = 1, +// .offset_x = 0, +// .offset_y = 0, +// .scale_factor = 1.000000, +// .is_pdaf_supported = 1, +// } + +// mode settings + +// hdr settings +{0x0114, 0x03, 0}, // CSI_LANE_MODE = 4-lane +/*{0x0220, 0x00, 0}, // HDR_MODE = disable +{0x0221, 0x11, 0}, // HDR_RESO_REDU_H/V = Full Pixel +{0x0222, 0x10, 0}, // EXPO_RATIO = 16*/ +{0x0220, 0x01, 0}, // HDR_MODE = enable with combined gain and 16x ratio +{0x0221, 0x22, 0}, // HDR_RESO_REDU_H/V = 2 binning +{0x0222, 0x10, 0}, // EXPO_RATIO = 16 + +{0x0340, 0x07, 0}, {0x0341, 0x0a, 0}, // FRM_LENGTH = frame_length_lines = 1802 +{0x0342, 0x15, 0}, {0x0343, 0xa0, 0}, // LINE_LENGTH = line_length_pclk = 5536 +{0x0344, 0x00, 0}, {0x0345, 0x00, 0}, // x_addr_start +{0x0346, 0x00, 0}, {0x0347, 0x00, 0}, // y_addr_start +{0x0348, 0x12, 0}, {0x0349, 0x2f, 0}, // x_addr_end +{0x034a, 0x0d, 0}, {0x034b, 0xa7, 0}, // y_addr_end +{0x0381, 0x01, 0}, // x_even_inc +{0x0383, 0x01, 0}, // x_odd_inc +{0x0385, 0x01, 0}, // y_even_inc +{0x0387, 0x01, 0}, // y_odd_inc +{0x0900, 0x01, 0}, // BINNING_MODE = enable +{0x0901, 0x22, 0}, // BINING_TYPE_H/V = 2binning +{0x0902, 0x00, 0}, // binning_weighting = average + +{0x0b06, 1, 0}, // SING_DEF_CORR_EN +{0x0b0a, 1, 0}, // combined defect correct + +{0x3010, 0x66, 0}, // HDR_OUTPUT_CTRL = ATR + HDR compose + DPC1D + DCP2D +{0x3011, 0x01, 0}, // HDR_OUTPUT_CTRL2 = PD enable +{0x30c0, 0x11, 0}, // RED_GAIN_CB? +{0x300d, 0x00, 0}, // FORCE_FDSUM = disable +{0x30fd, 0x00, 0}, +{0x8493, 0x00, 0}, +{0x8863, 0x00, 0}, +{0x90d7, 0x19, 0}, + +// set black level +{0x3090, 1, 0}, +{0x3092, 0, 0}, +{0x3093, 0x38, 0}, + +// output size settings +{0x0112, 0x0a, 0}, {0x0113, 0x0a, 0}, // CS_DT_FMT_H = 0x0a0a (RAW10 output) +{0x034c, 0x09, 0}, {0x034d, 0x18, 0}, // X_OUT_SIZE = 2328 (1164*2) +{0x034e, 0x06, 0}, {0x034f, 0xd4, 0}, // Y_OUT_SIZE = 1748 (874*2) +{0x0401, 0x00, 0}, // SCALING_MODE +{0x0404, 0x00, 0}, {0x0405, 0x10, 0}, // SCALE_M +{0x0408, 0x00, 0}, {0x0409, 0x00, 0}, // DCROP_XOFS +{0x040a, 0x00, 0}, {0x040b, 0x00, 0}, // DCROP_YOFS +{0x040c, 0x09, 0}, {0x040d, 0x18, 0}, // DCROP_WIDTH +{0x040e, 0x06, 0}, {0x040f, 0xd4, 0}, // DCROP_HIGT + +// clock settings +// 299300000 +/* +{0x0301, 0x05, 0}, // VT_PIX_CLK_DIV +{0x0303, 0x02, 0}, // VT_SYS_CLK_DIV +{0x0305, 0x04, 0}, // PRE_PLL_CLK_DIV +{0x0306, 0x00, 0}, {0x0307, 0x7d, 0}, // PLL_MULTIPLIER . mode 1: 0xf6 +{0x0309, 0x0a, 0}, // OP_PIX_CLK_DIV +{0x030b, 0x01, 0}, // OP_SYS_CLK_DIV +{0x030d, 0x0f, 0}, // PREPLLCK_OP_DIV +{0x030e, 0x03, 0}, {0x030f, 0x41, 0}, // PLL_OP_MPY +{0x0310, 0x00, 0}, // PLL_MULT_DRIV +*/ +// 600000000 +{0x0301, 0x05, 0}, +{0x0303, 0x02, 0}, +{0x0305, 0x04, 0}, +{0x0306, 0x00, 0}, +{0x0307, 0xfa, 0}, +{0x0309, 0x0a, 0}, +{0x030b, 0x01, 0}, +{0x030d, 0x0f, 0}, +{0x030e, 0x03, 0}, {0x030f, 0x41, 0}, +{0x0310, 0x00, 0}, + +// data rate settings +/*{0x0820, 0x0b, 0}, // requested_link_bit_rate_mbps = 3000 +{0x0821, 0xb8, 0}, +{0x0822, 0x00, 0}, +{0x0823, 0x00, 0},*/ +{0x0820, 0x17, 0}, // requested_link_bit_rate_mbps = 6000 +{0x0821, 0x70, 0}, +{0x0822, 0x00, 0}, +{0x0823, 0x00, 0}, + +//integration time settings +{0x0202, 0x07, 0}, {0x0203, 0x00, 0}, // INTEG_TIME = 1792 +{0x0224, 0x01, 0}, {0x0225, 0xf4, 0}, // ST_COARSE_INTEG_TIME = 506 + +// gain settings +{0x0204, 0x00, 0}, {0x0205, 0x00, 0}, // ANA_GAIN_GLOBAL = 512 / (512 - X) +{0x0216, 0x00, 0}, {0x0217, 0x00, 0}, // ST_ANA_GAIN_GLOBAL[8] +{0x020e, 0x01, 0}, {0x020f, 0x00, 0}, // DIG_GAIN_GR +{0x0210, 0x01, 0}, {0x0211, 0x00, 0}, // DIG_GAIN_R +{0x0212, 0x01, 0}, {0x0213, 0x00, 0}, // DIG_GAIN_B +{0x0214, 0x01, 0}, {0x0215, 0x00, 0}, // DIG_GAIN_GB + +// HDR white balance settings (ABS_GAIN) +{0xb8e, 0x01, 0}, {0xb8f, 0x00, 0}, // GR +{0xb90, 0x02, 0}, {0xb91, 0x2b, 0}, // R +{0xb92, 0x01, 0}, {0xb93, 0xd4, 0}, // B +{0xb94, 0x01, 0}, {0xb95, 0x00, 0}, // GB + +// phase detection settings +{0x3058, 0x00, 0}, // NML_NR_EN +{0x3103, 0x01, 0}, // NML_PD_CAL_ENABLE = enable +{0x3108, 0x00, 0}, {0x3109, 0x2c, 0}, //PD_AREA_X_OFFSET +{0x310a, 0x00, 0}, {0x310b, 0x24, 0}, //PD_AREA_Y_OFFSET +{0x310c, 0x01, 0}, {0x310d, 0xa4, 0}, //PD_AREA_WIDTH +{0x310e, 0x01, 0}, {0x310f, 0xa4, 0}, //PD_AREA_HEIGHT +// whole size is 0x918 x 0x6d4 +{0x3110, 0x03, 0}, // PD_AREA_0 = 0x375-0x4d1, 0x258-0x3b6 +{0x3111, 0x75, 0}, +{0x3112, 0x02, 0}, +{0x3113, 0x58, 0}, +{0x3114, 0x04, 0}, +{0x3115, 0xd1, 0}, +{0x3116, 0x03, 0}, +{0x3117, 0xb6, 0}, +{0x3118, 0x04, 0}, // PD_AREA_1 = 0x446-0x5a2, 0x258-0x3b6 +{0x3119, 0x46, 0}, +{0x311a, 0x02, 0}, +{0x311b, 0x58, 0}, +{0x311c, 0x05, 0}, +{0x311d, 0xa2, 0}, +{0x311e, 0x03, 0}, +{0x311f, 0xb6, 0}, +{0x3120, 0x03, 0}, // PD_AREA_2 = 0x375-0x4d1, 0x32a-0x488 +{0x3121, 0x75, 0}, +{0x3122, 0x03, 0}, +{0x3123, 0x2a, 0}, +{0x3124, 0x04, 0}, +{0x3125, 0xd1, 0}, +{0x3126, 0x04, 0}, +{0x3127, 0x88, 0}, +{0x3128, 0x04, 0}, // PD_AREA_3 = 0x446-0x5a2, 0x32a-0x488 +{0x3129, 0x46, 0}, +{0x312a, 0x03, 0}, +{0x312b, 0x2a, 0}, +{0x312c, 0x05, 0}, +{0x312d, 0xa2, 0}, +{0x312e, 0x04, 0}, +{0x312f, 0x88, 0}, +{0x3130, 0x03, 0}, // PD_AREA_4 = 0x375-0x5a2, 0x258-0x488 +{0x3131, 0x75, 0}, +{0x3132, 0x02, 0}, +{0x3133, 0x58, 0}, +{0x3134, 0x05, 0}, +{0x3135, 0xa2, 0}, +{0x3136, 0x04, 0}, +{0x3137, 0x88, 0}, +{0x3138, 0x02, 0}, // PD_AREA_5 = 0x2ba-0x65d, 0x210-0x4d0 +{0x3139, 0xba, 0}, +{0x313a, 0x02, 0}, +{0x313b, 0x10, 0}, +{0x313c, 0x06, 0}, +{0x313d, 0x5d, 0}, +{0x313e, 0x04, 0}, +{0x313f, 0xd0, 0}, +{0x3140, 0x00, 0}, // PD_AREA_6 = 0xa1-0x876, 0x6b-0x676 +{0x3141, 0xa1, 0}, +{0x3142, 0x00, 0}, +{0x3143, 0x6b, 0}, +{0x3144, 0x08, 0}, +{0x3145, 0x76, 0}, +{0x3146, 0x06, 0}, +{0x3147, 0x76, 0}, +{0x3148, 0x00, 0}, // PD_AREA_7 = 0xa1-0x876, 0x5e-0x34c +{0x3149, 0xa1, 0}, +{0x314a, 0x00, 0}, +{0x314b, 0x5e, 0}, +{0x314c, 0x08, 0}, +{0x314d, 0x76, 0}, +{0x314e, 0x03, 0}, +{0x314f, 0x4c, 0}, +{0x3165, 0x02, 0}, // AREA_EN_0 = free area +}; + +// static struct msm_camera_i2c_reg_array reg_array3[] = { +// // REG_HOLD ON +// {0x104,0x1,0}, +// // from regression +// {0x3002,0x0,0}, +// // FRM_LENGTH, 1802 vs 3554 +// // {0x340,0x7,0}, {0x341,0xa,0}, // camera start {0x340,0xd,0}, {0x341,0xe2,0}, +// // INTEG_TIME aka coarse_int_time_addr aka shutter speed +// {0x202,0x03,0}, {0x203,0xda,0}, +// // global_gain_addr +// {0x204,0x0,0}, {0x205,0x0,0}, + +// //?? +// {0x20e,0x1,0}, {0x20f,0x0,0}, +// {0x210,0x1,0}, {0x211,0x0,0}, +// {0x212,0x1,0}, {0x213,0x0,0}, +// {0x214,0x1,0}, {0x215,0x0,0}, + +// // REG_HOLD: mode setting +// {0x104,0x0,0}, +// }; + +// start, remove standby mode +static struct msm_camera_i2c_reg_array start_reg_array[] = {{0x100,0x1,0}}; + +// stop, enable standby mode +static struct msm_camera_i2c_reg_array stop_reg_array[] = {{0x100,0x0,0}}; + +/* +// still mode settings: + {0x847f, 0x0c0c,}, //_M_EQCTL + + {0x8436, 0xfd7f,}, //_M_Kgxdr + {0x8440, 0xf07f,}, //_M_X_LMT + {0x8443, 0xb41e,}, //_M_X_TGT + {0x841b, 0x4001,}, //_M_Kgx10 + + {0x84b6, 0xfd7f,}, //_M_Kgydr + {0x84c0, 0xf07f,}, //_M_Y_LMT + {0x84c3, 0xb41e,}, //_M_Y_TGT + {0x849b, 0x4001,}, //_M_Kgy10 + + {0x8438, 0x2d0f,}, //_M_Kgx11 + {0x84b8, 0x2d0f,}, //_M_Kgy11 + {0x8447, 0x002b,}, //_M_KgxTG + {0x84c7, 0x002b,}, //_M_KgyTG + + {0x847f, 0x0d0d,}, //_M_EQCTL +*/ + +static struct msm_camera_i2c_reg_array init_array_ov8865[] = { +// round 1 +//{0x103,0x1,0}, // software reset +{0x100,0x0,0}, // standby on +{0x3638,0xff,0}, +{0x302,0x1e,0}, {0x303,0x0,0}, {0x304,0x3,0}, {0x30d,0x1e,0}, {0x30e,0x0,0}, {0x30f,0x9,0}, {0x312,0x1,0}, {0x31e,0xc,0}, // PLL control +{0x3015,0x1,0}, {0x3018,0x72,0}, {0x3020,0x93,0}, {0x3022,0x1,0}, +{0x3031,0xa,0}, // 10-bit mode +{0x3106,0x1,0}, {0x3305,0xf1,0}, {0x3308,0x0,0}, {0x3309,0x28,0}, {0x330a,0x0,0}, {0x330b,0x20,0}, {0x330c,0x0,0}, {0x330d,0x0,0}, {0x330e,0x0,0}, {0x330f,0x40,0}, {0x3307,0x4,0}, {0x3604,0x4,0}, {0x3602,0x30,0}, {0x3605,0x0,0}, {0x3607,0x20,0}, {0x3608,0x11,0}, {0x3609,0x68,0}, {0x360a,0x40,0}, {0x360c,0xdd,0}, {0x360e,0xc,0}, {0x3610,0x7,0}, {0x3612,0x86,0}, {0x3613,0x58,0}, {0x3614,0x28,0}, {0x3617,0x40,0}, {0x3618,0x5a,0}, {0x3619,0x9b,0}, {0x361c,0x0,0}, {0x361d,0x60,0}, {0x3631,0x60,0}, {0x3633,0x10,0}, {0x3634,0x10,0}, {0x3635,0x10,0}, {0x3636,0x10,0}, {0x3641,0x55,0}, {0x3646,0x86,0}, {0x3647,0x27,0}, {0x364a,0x1b,0}, {0x3500,0x0,0}, {0x3501,0x4c,0}, {0x3502,0x0,0}, {0x3503,0x0,0}, {0x3508,0x2,0}, +{0x3509,0x0,0}, // AEC GAIN +{0x3700,0x24,0}, {0x3701,0xc,0}, {0x3702,0x28,0}, {0x3703,0x19,0}, {0x3704,0x14,0}, {0x3705,0x0,0}, {0x3706,0x38,0}, {0x3707,0x4,0}, {0x3708,0x24,0}, {0x3709,0x40,0}, {0x370a,0x0,0}, {0x370b,0xb8,0}, {0x370c,0x4,0}, {0x3718,0x12,0}, {0x3719,0x31,0}, {0x3712,0x42,0}, {0x3714,0x12,0}, {0x371e,0x19,0}, {0x371f,0x40,0}, {0x3720,0x5,0}, {0x3721,0x5,0}, {0x3724,0x2,0}, {0x3725,0x2,0}, {0x3726,0x6,0}, {0x3728,0x5,0}, {0x3729,0x2,0}, {0x372a,0x3,0}, {0x372b,0x53,0}, {0x372c,0xa3,0}, {0x372d,0x53,0}, {0x372e,0x6,0}, {0x372f,0x10,0}, {0x3730,0x1,0}, {0x3731,0x6,0}, {0x3732,0x14,0}, {0x3733,0x10,0}, {0x3734,0x40,0}, {0x3736,0x20,0}, {0x373a,0x2,0}, {0x373b,0xc,0}, {0x373c,0xa,0}, {0x373e,0x3,0}, {0x3755,0x40,0}, {0x3758,0x0,0}, {0x3759,0x4c,0}, {0x375a,0x6,0}, {0x375b,0x13,0}, {0x375c,0x40,0}, {0x375d,0x2,0}, {0x375e,0x0,0}, {0x375f,0x14,0}, {0x3767,0x1c,0}, {0x3768,0x4,0}, {0x3769,0x20,0}, {0x376c,0xc0,0}, {0x376d,0xc0,0}, {0x376a,0x8,0}, {0x3761,0x0,0}, {0x3762,0x0,0}, {0x3763,0x0,0}, {0x3766,0xff,0}, {0x376b,0x42,0}, {0x3772,0x23,0}, {0x3773,0x2,0}, {0x3774,0x16,0}, {0x3775,0x12,0}, {0x3776,0x8,0}, {0x37a0,0x44,0}, {0x37a1,0x3d,0}, {0x37a2,0x3d,0}, {0x37a3,0x1,0}, {0x37a4,0x0,0}, {0x37a5,0x8,0}, {0x37a6,0x0,0}, {0x37a7,0x44,0}, {0x37a8,0x58,0}, {0x37a9,0x58,0}, {0x3760,0x0,0}, {0x376f,0x1,0}, {0x37aa,0x44,0}, {0x37ab,0x2e,0}, {0x37ac,0x2e,0}, {0x37ad,0x33,0}, {0x37ae,0xd,0}, {0x37af,0xd,0}, {0x37b0,0x0,0}, {0x37b1,0x0,0}, {0x37b2,0x0,0}, {0x37b3,0x42,0}, {0x37b4,0x42,0}, {0x37b5,0x33,0}, {0x37b6,0x0,0}, {0x37b7,0x0,0}, {0x37b8,0x0,0}, {0x37b9,0xff,0}, {0x3800,0x0,0}, {0x3801,0xc,0}, {0x3802,0x0,0}, {0x3803,0xc,0}, +{0x3804,0xc,0}, {0x3805,0xd3,0}, // 3283 +{0x3806,0x9,0}, {0x3807,0xa3,0}, // 2467 +{0x3808,0x6,0}, {0x3809,0x60,0}, // 0x660 = 1632 (width) +{0x380a,0x4,0}, {0x380b,0xc8,0}, // 0x4c8 = 1224 (height) +{0x380c,0x6,0}, {0x380d,0x42,0}, // line_length_pck +{0x380e,0x5,0}, {0x380f,0xda,0}, // frame_length_lines +{0x3810,0x0,0}, {0x3811,0x4,0}, {0x3813,0x4,0}, +{0x3814,0x3,0}, {0x3815,0x1,0}, // H-binning +{0x3820,0x6,0}, // format1 +{0x3821,0x40,0}, // format2 +{0x382a,0x3,0}, {0x382b,0x1,0}, // V-binning +{0x382d,0x7f,0}, {0x3830,0x8,0}, {0x3836,0x2,0}, {0x3837,0x18,0}, +{0x3841,0xff,0}, +{0x3846,0x88,0}, {0x3d85,0x6,0}, {0x3d8c,0x75,0}, {0x3d8d,0xef,0}, {0x3f08,0xb,0}, {0x4000,0xf1,0}, {0x4001,0x14,0}, {0x4005,0x10,0}, {0x4006,0x1,0}, {0x4007,0x1,0}, {0x400b,0xc,0}, {0x400d,0x10,0}, {0x401b,0x0,0}, {0x401d,0x0,0}, {0x4020,0x0,0}, {0x4021,0x0,0}, {0x4022,0x4,0}, {0x4023,0x1f,0}, {0x4024,0x6,0}, {0x4025,0x20,0}, {0x4026,0x6,0}, {0x4027,0x4f,0}, {0x4028,0x0,0}, {0x4029,0x2,0}, {0x402a,0x4,0}, {0x402b,0x4,0}, {0x402c,0x2,0}, {0x402d,0x2,0}, {0x402e,0x8,0}, {0x402f,0x2,0}, {0x401f,0x0,0}, {0x4034,0x3f,0}, {0x4300,0xff,0}, {0x4301,0x0,0}, {0x4302,0xf,0}, {0x4500,0x40,0}, {0x4503,0x10,0}, {0x4601,0x74,0}, {0x481f,0x32,0}, {0x4837,0x15,0}, {0x4850,0x10,0}, {0x4851,0x32,0}, {0x4b00,0x2a,0}, {0x4b0d,0x0,0}, {0x4d00,0x4,0}, {0x4d01,0x18,0}, {0x4d02,0xc3,0}, {0x4d03,0xff,0}, {0x4d04,0xff,0}, {0x4d05,0xff,0}, {0x5000,0x96,0}, {0x5001,0x1,0}, {0x5002,0x8,0}, {0x5901,0x0,0}, +{0x5e00,0x0,0}, +//{0x5e00,0x80,0}, +{0x5e01,0x41,0}, {0x5b00,0x2,0}, {0x5b01,0xd0,0}, {0x5b02,0x3,0}, {0x5b03,0xff,0}, {0x5b05,0x6c,0}, {0x5780,0xfc,0}, {0x5781,0xdf,0}, {0x5782,0x3f,0}, {0x5783,0x8,0}, {0x5784,0xc,0}, {0x5786,0x20,0}, {0x5787,0x40,0}, {0x5788,0x8,0}, {0x5789,0x8,0}, {0x578a,0x2,0}, {0x578b,0x1,0}, {0x578c,0x1,0}, {0x578d,0xc,0}, {0x578e,0x2,0}, {0x578f,0x1,0}, {0x5790,0x1,0}, {0x5800,0x1d,0}, {0x5801,0xe,0}, {0x5802,0xc,0}, {0x5803,0xc,0}, {0x5804,0xf,0}, {0x5805,0x22,0}, {0x5806,0xa,0}, {0x5807,0x6,0}, {0x5808,0x5,0}, {0x5809,0x5,0}, {0x580a,0x7,0}, {0x580b,0xa,0}, {0x580c,0x6,0}, {0x580d,0x2,0}, {0x580e,0x0,0}, {0x580f,0x0,0}, {0x5810,0x3,0}, {0x5811,0x7,0}, {0x5812,0x6,0}, {0x5813,0x2,0}, {0x5814,0x0,0}, {0x5815,0x0,0}, {0x5816,0x3,0}, {0x5817,0x7,0}, {0x5818,0x9,0}, {0x5819,0x6,0}, {0x581a,0x4,0}, {0x581b,0x4,0}, {0x581c,0x6,0}, {0x581d,0xa,0}, {0x581e,0x19,0}, {0x581f,0xd,0}, {0x5820,0xb,0}, {0x5821,0xb,0}, {0x5822,0xe,0}, {0x5823,0x22,0}, {0x5824,0x23,0}, {0x5825,0x28,0}, {0x5826,0x29,0}, {0x5827,0x27,0}, {0x5828,0x13,0}, {0x5829,0x26,0}, {0x582a,0x33,0}, {0x582b,0x32,0}, {0x582c,0x33,0}, {0x582d,0x16,0}, {0x582e,0x14,0}, {0x582f,0x30,0}, {0x5830,0x31,0}, {0x5831,0x30,0}, {0x5832,0x15,0}, {0x5833,0x26,0}, {0x5834,0x23,0}, {0x5835,0x21,0}, {0x5836,0x23,0}, {0x5837,0x5,0}, {0x5838,0x36,0}, {0x5839,0x27,0}, {0x583a,0x28,0}, {0x583b,0x26,0}, {0x583c,0x24,0}, {0x583d,0xdf,0}, +//{0x100,0x1,0}, +// round 2 (color calibration) +{0x7010,0x0,0}, {0x7011,0x0,0}, {0x7012,0x0,0}, {0x7013,0x0,0}, {0x7014,0x0,0}, {0x7015,0x0,0}, {0x7016,0x0,0}, {0x7017,0x0,0}, {0x7018,0x0,0}, {0x7019,0x0,0}, {0x701a,0x0,0}, {0x701b,0x0,0}, {0x701c,0x0,0}, {0x701d,0x0,0}, {0x701e,0x0,0}, {0x701f,0x0,0}, {0x7020,0x0,0}, {0x7021,0x0,0}, {0x7022,0x0,0}, {0x7023,0x0,0}, {0x7024,0x0,0}, {0x7025,0x0,0}, {0x7026,0x0,0}, {0x7027,0x0,0}, {0x7028,0x0,0}, {0x7029,0x0,0}, {0x702a,0x0,0}, {0x702b,0x0,0}, {0x702c,0x0,0}, {0x702d,0x0,0}, {0x702e,0x0,0}, {0x702f,0x0,0}, {0x7030,0x0,0}, {0x7031,0x0,0}, {0x7032,0x0,0}, {0x7033,0x0,0}, {0x7034,0x0,0}, {0x7035,0x0,0}, {0x7036,0x0,0}, {0x7037,0x0,0}, {0x7038,0x0,0}, {0x7039,0x0,0}, {0x703a,0x0,0}, {0x703b,0x0,0}, {0x703c,0x0,0}, {0x703d,0x0,0}, {0x703e,0x0,0}, {0x703f,0x0,0}, {0x7040,0x0,0}, {0x7041,0x0,0}, {0x7042,0x0,0}, {0x7043,0x0,0}, {0x7044,0x0,0}, {0x7045,0x0,0}, {0x7046,0x0,0}, {0x7047,0x0,0}, {0x7048,0x0,0}, {0x7049,0x0,0}, {0x704a,0x0,0}, {0x704b,0x0,0}, {0x704c,0x0,0}, {0x704d,0x0,0}, {0x704e,0x0,0}, {0x704f,0x0,0}, {0x7050,0x0,0}, {0x7051,0x0,0}, {0x7052,0x0,0}, {0x7053,0x0,0}, {0x7054,0x0,0}, {0x7055,0x0,0}, {0x7056,0x0,0}, {0x7057,0x0,0}, {0x7058,0x0,0}, {0x7059,0x0,0}, {0x705a,0x0,0}, {0x705b,0x0,0}, {0x705c,0x0,0}, {0x705d,0x0,0}, {0x705e,0x0,0}, {0x705f,0x0,0}, {0x7060,0x0,0}, {0x7061,0x0,0}, {0x7062,0x0,0}, {0x7063,0x0,0}, {0x7064,0x0,0}, {0x7065,0x0,0}, {0x7066,0x0,0}, {0x7067,0x0,0}, {0x7068,0x0,0}, {0x7069,0x0,0}, {0x706a,0x0,0}, {0x706b,0x0,0}, {0x706c,0x0,0}, {0x706d,0x0,0}, {0x706e,0x0,0}, {0x706f,0x0,0}, {0x7070,0x0,0}, {0x7071,0x0,0}, {0x7072,0x0,0}, {0x7073,0x0,0}, {0x7074,0x0,0}, {0x7075,0x0,0}, {0x7076,0x0,0}, {0x7077,0x0,0}, {0x7078,0x0,0}, {0x7079,0x0,0}, {0x707a,0x0,0}, {0x707b,0x0,0}, {0x707c,0x0,0}, {0x707d,0x0,0}, {0x707e,0x0,0}, {0x707f,0x0,0}, {0x7080,0x0,0}, {0x7081,0x0,0}, {0x7082,0x0,0}, {0x7083,0x0,0}, {0x7084,0x0,0}, {0x7085,0x0,0}, {0x7086,0x0,0}, {0x7087,0x0,0}, {0x7088,0x0,0}, {0x7089,0x0,0}, {0x708a,0x0,0}, {0x708b,0x0,0}, {0x708c,0x0,0}, {0x708d,0x0,0}, {0x708e,0x0,0}, {0x708f,0x0,0}, {0x7090,0x0,0}, {0x7091,0x0,0}, {0x7092,0x0,0}, {0x7093,0x0,0}, {0x7094,0x0,0}, {0x7095,0x0,0}, {0x7096,0x0,0}, {0x7097,0x0,0}, {0x7098,0x0,0}, {0x7099,0x0,0}, {0x709a,0x0,0}, {0x709b,0x0,0}, {0x709c,0x0,0}, {0x709d,0x0,0}, {0x709e,0x0,0}, {0x709f,0x0,0}, {0x70a0,0x0,0}, {0x70a1,0x0,0}, {0x70a2,0x0,0}, {0x70a3,0x0,0}, {0x70a4,0x0,0}, {0x70a5,0x0,0}, {0x70a6,0x0,0}, {0x70a7,0x0,0}, {0x70a8,0x0,0}, {0x70a9,0x0,0}, {0x70aa,0x0,0}, {0x70ab,0x0,0}, {0x70ac,0x0,0}, {0x70ad,0x0,0}, {0x70ae,0x0,0}, {0x70af,0x0,0}, {0x70b0,0x0,0}, {0x70b1,0x0,0}, {0x70b2,0x0,0}, {0x70b3,0x0,0}, {0x70b4,0x0,0}, {0x70b5,0x0,0}, {0x70b6,0x0,0}, {0x70b7,0x0,0}, {0x70b8,0x0,0}, {0x70b9,0x0,0}, {0x70ba,0x0,0}, {0x70bb,0x0,0}, {0x70bc,0x0,0}, {0x70bd,0x0,0}, {0x70be,0x0,0}, {0x70bf,0x0,0}, {0x70c0,0x0,0}, {0x70c1,0x0,0}, {0x70c2,0x0,0}, {0x70c3,0x0,0}, {0x70c4,0x0,0}, {0x70c5,0x0,0}, {0x70c6,0x0,0}, {0x70c7,0x0,0}, {0x70c8,0x0,0}, {0x70c9,0x0,0}, {0x70ca,0x0,0}, {0x70cb,0x0,0}, {0x70cc,0x0,0}, {0x70cd,0x0,0}, {0x70ce,0x0,0}, {0x70cf,0x0,0}, {0x70d0,0x0,0}, {0x70d1,0x0,0}, {0x70d2,0x0,0}, {0x70d3,0x0,0}, {0x70d4,0x0,0}, {0x70d5,0x0,0}, {0x70d6,0x0,0}, {0x70d7,0x0,0}, {0x70d8,0x0,0}, {0x70d9,0x0,0}, {0x70da,0x0,0}, {0x70db,0x0,0}, {0x70dc,0x0,0}, {0x70dd,0x0,0}, {0x70de,0x0,0}, {0x70df,0x0,0}, {0x70e0,0x0,0}, {0x70e1,0x0,0}, {0x70e2,0x0,0}, {0x70e3,0x0,0}, {0x70e4,0x0,0}, {0x70e5,0x0,0}, {0x70e6,0x0,0}, {0x70e7,0x0,0}, {0x70e8,0x0,0}, {0x70e9,0x0,0}, {0x70ea,0x0,0}, {0x70eb,0x0,0}, {0x70ec,0x0,0}, {0x70ed,0x0,0}, {0x70ee,0x0,0}, {0x70ef,0x0,0}, {0x70f0,0x0,0}, {0x70f1,0x0,0}, {0x70f2,0x0,0}, {0x70f3,0x0,0}, {0x70f4,0x0,0}, {0x70f5,0x0,0}, {0x70f6,0x0,0}, {0x70f7,0x0,0}, {0x70f8,0x0,0}, {0x70f9,0x0,0}, {0x70fa,0x0,0}, {0x70fb,0x0,0}, {0x70fc,0x0,0}, {0x70fd,0x0,0}, {0x70fe,0x0,0}, {0x70ff,0x0,0}, {0x7100,0x0,0}, {0x7101,0x0,0}, {0x7102,0x0,0}, {0x7103,0x0,0}, {0x7104,0x0,0}, {0x7105,0x0,0}, {0x7106,0x0,0}, {0x7107,0x0,0}, {0x7108,0x0,0}, {0x7109,0x0,0}, {0x710a,0x0,0}, {0x710b,0x0,0}, {0x710c,0x0,0}, {0x710d,0x0,0}, {0x710e,0x0,0}, {0x710f,0x0,0}, {0x7110,0x0,0}, {0x7111,0x0,0}, {0x7112,0x0,0}, {0x7113,0x0,0}, {0x7114,0x0,0}, {0x7115,0x0,0}, {0x7116,0x0,0}, {0x7117,0x0,0}, {0x7118,0x0,0}, {0x7119,0x0,0}, {0x711a,0x0,0}, {0x711b,0x0,0}, {0x711c,0x0,0}, {0x711d,0x0,0}, {0x711e,0x0,0}, {0x711f,0x0,0}, {0x7120,0x0,0}, {0x7121,0x0,0}, {0x7122,0x0,0}, {0x7123,0x0,0}, {0x7124,0x0,0}, {0x7125,0x0,0}, {0x7126,0x0,0}, {0x7127,0x0,0}, {0x7128,0x0,0}, {0x7129,0x0,0}, {0x712a,0x0,0}, {0x712b,0x0,0}, {0x712c,0x0,0}, {0x712d,0x0,0}, {0x712e,0x0,0}, {0x712f,0x0,0}, {0x7130,0x0,0}, {0x7131,0x0,0}, {0x7132,0x0,0}, {0x501a,0x10,0}, {0x501b,0xd,0}, {0x501c,0x10,0}, {0x501d,0x13,0}, {0x5000,0x96,0}, {0x5800,0x14,0}, {0x5801,0xd,0}, {0x5802,0xa,0}, {0x5803,0xa,0}, {0x5804,0xd,0}, {0x5805,0x13,0}, {0x5806,0xa,0}, {0x5807,0x5,0}, {0x5808,0x3,0}, {0x5809,0x3,0}, {0x580a,0x5,0}, {0x580b,0x9,0}, {0x580c,0x6,0}, {0x580d,0x2,0}, {0x580e,0x0,0}, {0x580f,0x0,0}, {0x5810,0x2,0}, {0x5811,0x5,0}, {0x5812,0x6,0}, {0x5813,0x2,0}, {0x5814,0x0,0}, {0x5815,0x0,0}, {0x5816,0x2,0}, {0x5817,0x5,0}, {0x5818,0xb,0}, {0x5819,0x6,0}, {0x581a,0x3,0}, {0x581b,0x3,0}, {0x581c,0x5,0}, {0x581d,0xa,0}, {0x581e,0x16,0}, {0x581f,0xf,0}, {0x5820,0xb,0}, {0x5821,0xb,0}, {0x5822,0xf,0}, {0x5823,0x15,0}, {0x5824,0x32,0}, {0x5825,0x23,0}, {0x5826,0x23,0}, {0x5827,0x23,0}, {0x5828,0x22,0}, {0x5829,0x21,0}, {0x582a,0x21,0}, {0x582b,0x22,0}, {0x582c,0x21,0},{0x582d,0x11,0}, {0x582e,0x22,0}, {0x582f,0x31,0}, {0x5830,0x41,0}, {0x5831,0x31,0}, {0x5832,0x1,0}, {0x5833,0x21,0}, {0x5834,0x21,0}, {0x5835,0x21,0}, {0x5836,0x11,0}, {0x5837,0x11,0}, {0x5838,0x22,0}, {0x5839,0x22,0}, {0x583a,0x12,0}, {0x583b,0x22,0}, {0x583c,0x22,0}, {0x583d,0xdf,0}, +}; + diff --git a/selfdrive/camerad/imgproc/conv.cl b/selfdrive/camerad/imgproc/conv.cl new file mode 100644 index 000000000..a7115ae76 --- /dev/null +++ b/selfdrive/camerad/imgproc/conv.cl @@ -0,0 +1,110 @@ +// const __constant float3 rgb_weights = (0.299, 0.587, 0.114); // opencv rgb2gray weights +// const __constant float3 bgr_weights = (0.114, 0.587, 0.299); // bgr2gray weights + +// convert input rgb image to single channel then conv +__kernel void rgb2gray_conv2d( + const __global uchar * input, + __global short * output, + __constant short * filter, + __local uchar3 * cached +) +{ + const int rowOffset = get_global_id(1) * IMAGE_W; + const int my = get_global_id(0) + rowOffset; + + const int localRowLen = TWICE_HALF_FILTER_SIZE + get_local_size(0); + const int localRowOffset = ( get_local_id(1) + HALF_FILTER_SIZE ) * localRowLen; + const int myLocal = localRowOffset + get_local_id(0) + HALF_FILTER_SIZE; + + // cache local pixels + cached[ myLocal ].x = input[ my * 3 ]; // r + cached[ myLocal ].y = input[ my * 3 + 1]; // g + cached[ myLocal ].z = input[ my * 3 + 2]; // b + + // pad + if ( + get_global_id(0) < HALF_FILTER_SIZE || + get_global_id(0) > IMAGE_W - HALF_FILTER_SIZE - 1 || + get_global_id(1) < HALF_FILTER_SIZE || + get_global_id(1) > IMAGE_H - HALF_FILTER_SIZE - 1 + ) + { + barrier(CLK_LOCAL_MEM_FENCE); + return; + } + else + { + int localColOffset = -1; + int globalColOffset = -1; + + // cache extra + if ( get_local_id(0) < HALF_FILTER_SIZE ) + { + localColOffset = get_local_id(0); + globalColOffset = -HALF_FILTER_SIZE; + + cached[ localRowOffset + get_local_id(0) ].x = input[ my * 3 - HALF_FILTER_SIZE * 3 ]; + cached[ localRowOffset + get_local_id(0) ].y = input[ my * 3 - HALF_FILTER_SIZE * 3 + 1]; + cached[ localRowOffset + get_local_id(0) ].z = input[ my * 3 - HALF_FILTER_SIZE * 3 + 2]; + } + else if ( get_local_id(0) >= get_local_size(0) - HALF_FILTER_SIZE ) + { + localColOffset = get_local_id(0) + TWICE_HALF_FILTER_SIZE; + globalColOffset = HALF_FILTER_SIZE; + + cached[ myLocal + HALF_FILTER_SIZE ].x = input[ my * 3 + HALF_FILTER_SIZE * 3 ]; + cached[ myLocal + HALF_FILTER_SIZE ].y = input[ my * 3 + HALF_FILTER_SIZE * 3 + 1]; + cached[ myLocal + HALF_FILTER_SIZE ].z = input[ my * 3 + HALF_FILTER_SIZE * 3 + 2]; + } + + + if ( get_local_id(1) < HALF_FILTER_SIZE ) + { + cached[ get_local_id(1) * localRowLen + get_local_id(0) + HALF_FILTER_SIZE ].x = input[ my * 3 - HALF_FILTER_SIZE_IMAGE_W * 3 ]; + cached[ get_local_id(1) * localRowLen + get_local_id(0) + HALF_FILTER_SIZE ].y = input[ my * 3 - HALF_FILTER_SIZE_IMAGE_W * 3 + 1]; + cached[ get_local_id(1) * localRowLen + get_local_id(0) + HALF_FILTER_SIZE ].z = input[ my * 3 - HALF_FILTER_SIZE_IMAGE_W * 3 + 2]; + if (localColOffset > 0) + { + cached[ get_local_id(1) * localRowLen + localColOffset ].x = input[ my * 3 - HALF_FILTER_SIZE_IMAGE_W * 3 + globalColOffset * 3]; + cached[ get_local_id(1) * localRowLen + localColOffset ].y = input[ my * 3 - HALF_FILTER_SIZE_IMAGE_W * 3 + globalColOffset * 3 + 1]; + cached[ get_local_id(1) * localRowLen + localColOffset ].z = input[ my * 3 - HALF_FILTER_SIZE_IMAGE_W * 3 + globalColOffset * 3 + 2]; + } + } + else if ( get_local_id(1) >= get_local_size(1) -HALF_FILTER_SIZE ) + { + int offset = ( get_local_id(1) + TWICE_HALF_FILTER_SIZE ) * localRowLen; + cached[ offset + get_local_id(0) + HALF_FILTER_SIZE ].x = input[ my * 3 + HALF_FILTER_SIZE_IMAGE_W * 3 ]; + cached[ offset + get_local_id(0) + HALF_FILTER_SIZE ].y = input[ my * 3 + HALF_FILTER_SIZE_IMAGE_W * 3 + 1]; + cached[ offset + get_local_id(0) + HALF_FILTER_SIZE ].z = input[ my * 3 + HALF_FILTER_SIZE_IMAGE_W * 3 + 2]; + if (localColOffset > 0) + { + cached[ offset + localColOffset ].x = input[ my * 3 + HALF_FILTER_SIZE_IMAGE_W * 3 + globalColOffset * 3]; + cached[ offset + localColOffset ].y = input[ my * 3 + HALF_FILTER_SIZE_IMAGE_W * 3 + globalColOffset * 3 + 1]; + cached[ offset + localColOffset ].z = input[ my * 3 + HALF_FILTER_SIZE_IMAGE_W * 3 + globalColOffset * 3 + 2]; + } + } + + // sync + barrier(CLK_LOCAL_MEM_FENCE); + + // perform convolution + int fIndex = 0; + short sum = 0; + + for (int r = -HALF_FILTER_SIZE; r <= HALF_FILTER_SIZE; r++) + { + int curRow = r * localRowLen; + for (int c = -HALF_FILTER_SIZE; c <= HALF_FILTER_SIZE; c++, fIndex++) + { + if (!FLIP_RB){ + // sum += dot(rgb_weights, cached[ myLocal + curRow + c ]) * filter[ fIndex ]; + sum += (cached[ myLocal + curRow + c ].x / 3 + cached[ myLocal + curRow + c ].y / 2 + cached[ myLocal + curRow + c ].z / 9) * filter[ fIndex ]; + } else { + // sum += dot(bgr_weights, cached[ myLocal + curRow + c ]) * filter[ fIndex ]; + sum += (cached[ myLocal + curRow + c ].x / 9 + cached[ myLocal + curRow + c ].y / 2 + cached[ myLocal + curRow + c ].z / 3) * filter[ fIndex ]; + } + } + } + output[my] = sum; + } +} \ No newline at end of file diff --git a/selfdrive/camerad/imgproc/pool.cl b/selfdrive/camerad/imgproc/pool.cl new file mode 100644 index 000000000..d674b5f36 --- /dev/null +++ b/selfdrive/camerad/imgproc/pool.cl @@ -0,0 +1,34 @@ +// calculate variance in each subregion +__kernel void var_pool( + const __global char * input, + __global ushort * output // should not be larger than 128*128 so uint16 +) +{ + const int xidx = get_global_id(0) + ROI_X_MIN; + const int yidx = get_global_id(1) + ROI_Y_MIN; + + const int size = X_PITCH * Y_PITCH; + + float fsum = 0; + char mean, max; + + for (int i = 0; i < size; i++) { + int x_offset = i % X_PITCH; + int y_offset = i / X_PITCH; + fsum += input[xidx*X_PITCH + yidx*Y_PITCH*FULL_STRIDE_X + x_offset + y_offset*FULL_STRIDE_X]; + max = input[xidx*X_PITCH + yidx*Y_PITCH*FULL_STRIDE_X + x_offset + y_offset*FULL_STRIDE_X]>max ? input[xidx*X_PITCH + yidx*Y_PITCH*FULL_STRIDE_X + x_offset + y_offset*FULL_STRIDE_X]:max; + } + + mean = convert_char_rte(fsum / size); + + float fvar = 0; + for (int i = 0; i < size; i++) { + int x_offset = i % X_PITCH; + int y_offset = i / X_PITCH; + fvar += (input[xidx*X_PITCH + yidx*Y_PITCH*FULL_STRIDE_X + x_offset + y_offset*FULL_STRIDE_X] - mean) * (input[xidx*X_PITCH + yidx*Y_PITCH*FULL_STRIDE_X + x_offset + y_offset*FULL_STRIDE_X] - mean); + } + + fvar = fvar / size; + + output[(xidx-ROI_X_MIN)+(yidx-ROI_Y_MIN)*(ROI_X_MAX-ROI_X_MIN+1)] = convert_ushort_rte(5 * fvar + convert_float_rte(max)); +} \ No newline at end of file diff --git a/selfdrive/camerad/imgproc/utils.cc b/selfdrive/camerad/imgproc/utils.cc new file mode 100644 index 000000000..a88b8f4bb --- /dev/null +++ b/selfdrive/camerad/imgproc/utils.cc @@ -0,0 +1,106 @@ +#include "selfdrive/camerad/imgproc/utils.h" + +#include +#include +#include +#include +#include + +const int16_t lapl_conv_krnl[9] = {0, 1, 0, + 1, -4, 1, + 0, 1, 0}; + +// calculate score based on laplacians in one area +uint16_t get_lapmap_one(const int16_t *lap, int x_pitch, int y_pitch) { + const int size = x_pitch * y_pitch; + // avg and max of roi + int16_t max = 0; + int sum = 0; + for (int i = 0; i < size; ++i) { + const int16_t v = lap[i]; + sum += v; + if (v > max) max = v; + } + + const int16_t mean = sum / size; + + // var of roi + int var = 0; + for (int i = 0; i < size; ++i) { + var += std::pow(lap[i] - mean, 2); + } + + const float fvar = (float)var / size; + return std::min(5 * fvar + max, (float)65535); +} + +bool is_blur(const uint16_t *lapmap, const size_t size) { + float bad_sum = 0; + for (int i = 0; i < size; i++) { + if (lapmap[i] < LM_THRESH) { + bad_sum += 1 / (float)size; + } + } + return (bad_sum > LM_PREC_THRESH); +} + +static cl_program build_conv_program(cl_device_id device_id, cl_context context, int image_w, int image_h, int filter_size) { + char args[4096]; + snprintf(args, sizeof(args), + "-cl-fast-relaxed-math -cl-denorms-are-zero " + "-DIMAGE_W=%d -DIMAGE_H=%d -DFLIP_RB=%d " + "-DFILTER_SIZE=%d -DHALF_FILTER_SIZE=%d -DTWICE_HALF_FILTER_SIZE=%d -DHALF_FILTER_SIZE_IMAGE_W=%d", + image_w, image_h, 1, + filter_size, filter_size/2, (filter_size/2)*2, (filter_size/2)*image_w); + return cl_program_from_file(context, device_id, "imgproc/conv.cl", args); +} + +LapConv::LapConv(cl_device_id device_id, cl_context ctx, int rgb_width, int rgb_height, int rgb_stride, int filter_size) + : width(rgb_width / NUM_SEGMENTS_X), height(rgb_height / NUM_SEGMENTS_Y), rgb_stride(rgb_stride), + roi_buf(width * height * 3), result_buf(width * height) { + + prg = build_conv_program(device_id, ctx, width, height, filter_size); + krnl = CL_CHECK_ERR(clCreateKernel(prg, "rgb2gray_conv2d", &err)); + // TODO: Removed CL_MEM_SVM_FINE_GRAIN_BUFFER, confirm it doesn't matter + roi_cl = CL_CHECK_ERR(clCreateBuffer(ctx, CL_MEM_READ_WRITE, roi_buf.size() * sizeof(roi_buf[0]), NULL, &err)); + result_cl = CL_CHECK_ERR(clCreateBuffer(ctx, CL_MEM_READ_WRITE, result_buf.size() * sizeof(result_buf[0]), NULL, &err)); + filter_cl = CL_CHECK_ERR(clCreateBuffer(ctx, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, + 9 * sizeof(int16_t), (void *)&lapl_conv_krnl, &err)); +} + +LapConv::~LapConv() { + CL_CHECK(clReleaseMemObject(roi_cl)); + CL_CHECK(clReleaseMemObject(result_cl)); + CL_CHECK(clReleaseMemObject(filter_cl)); + CL_CHECK(clReleaseKernel(krnl)); + CL_CHECK(clReleaseProgram(prg)); +} + +uint16_t LapConv::Update(cl_command_queue q, const uint8_t *rgb_buf, const int roi_id) { + // sharpness scores + const int x_offset = ROI_X_MIN + roi_id % (ROI_X_MAX - ROI_X_MIN + 1); + const int y_offset = ROI_Y_MIN + roi_id / (ROI_X_MAX - ROI_X_MIN + 1); + + const uint8_t *rgb_offset = rgb_buf + y_offset * height * rgb_stride + x_offset * width * 3; + for (int i = 0; i < height; ++i) { + memcpy(&roi_buf[i * width * 3], &rgb_offset[i * rgb_stride], width * 3); + } + + constexpr int local_mem_size = (CONV_LOCAL_WORKSIZE + 2 * (3 / 2)) * (CONV_LOCAL_WORKSIZE + 2 * (3 / 2)) * (3 * sizeof(uint8_t)); + const size_t global_work_size[] = {(size_t)width, (size_t)height}; + const size_t local_work_size[] = {CONV_LOCAL_WORKSIZE, CONV_LOCAL_WORKSIZE}; + + CL_CHECK(clEnqueueWriteBuffer(q, roi_cl, CL_TRUE, 0, roi_buf.size() * sizeof(roi_buf[0]), roi_buf.data(), 0, 0, 0)); + CL_CHECK(clSetKernelArg(krnl, 0, sizeof(cl_mem), (void *)&roi_cl)); + CL_CHECK(clSetKernelArg(krnl, 1, sizeof(cl_mem), (void *)&result_cl)); + CL_CHECK(clSetKernelArg(krnl, 2, sizeof(cl_mem), (void *)&filter_cl)); + CL_CHECK(clSetKernelArg(krnl, 3, local_mem_size, 0)); + cl_event conv_event; + CL_CHECK(clEnqueueNDRangeKernel(q, krnl, 2, NULL, global_work_size, local_work_size, 0, 0, &conv_event)); + CL_CHECK(clWaitForEvents(1, &conv_event)); + CL_CHECK(clReleaseEvent(conv_event)); + CL_CHECK(clEnqueueReadBuffer(q, result_cl, CL_TRUE, 0, + result_buf.size() * sizeof(result_buf[0]), result_buf.data(), 0, 0, 0)); + + return get_lapmap_one(result_buf.data(), width, height); +} diff --git a/selfdrive/camerad/imgproc/utils.h b/selfdrive/camerad/imgproc/utils.h new file mode 100644 index 000000000..b735975b3 --- /dev/null +++ b/selfdrive/camerad/imgproc/utils.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include +#include + +#include "selfdrive/common/clutil.h" + +#define NUM_SEGMENTS_X 8 +#define NUM_SEGMENTS_Y 6 + +#define ROI_X_MIN 1 +#define ROI_X_MAX 6 +#define ROI_Y_MIN 2 +#define ROI_Y_MAX 3 + +#define LM_THRESH 120 +#define LM_PREC_THRESH 0.9 // 90 perc is blur +#define CONV_LOCAL_WORKSIZE 16 + +class LapConv { +public: + LapConv(cl_device_id device_id, cl_context ctx, int rgb_width, int rgb_height, int rgb_stride, int filter_size); + ~LapConv(); + uint16_t Update(cl_command_queue q, const uint8_t *rgb_buf, const int roi_id); + +private: + cl_mem roi_cl, result_cl, filter_cl; + cl_program prg; + cl_kernel krnl; + const int width, height; + const int rgb_stride; + std::vector roi_buf; + std::vector result_buf; +}; + +bool is_blur(const uint16_t *lapmap, const size_t size); diff --git a/selfdrive/camerad/include/media/cam_cpas.h b/selfdrive/camerad/include/media/cam_cpas.h new file mode 100644 index 000000000..c5cbac82e --- /dev/null +++ b/selfdrive/camerad/include/media/cam_cpas.h @@ -0,0 +1,25 @@ +#ifndef __UAPI_CAM_CPAS_H__ +#define __UAPI_CAM_CPAS_H__ + +#include "cam_defs.h" + +#define CAM_FAMILY_CAMERA_SS 1 +#define CAM_FAMILY_CPAS_SS 2 + +/** + * struct cam_cpas_query_cap - CPAS query device capability payload + * + * @camera_family : Camera family type + * @reserved : Reserved field for alignment + * @camera_version : Camera platform version + * @cpas_version : Camera CPAS version within camera platform + * + */ +struct cam_cpas_query_cap { + uint32_t camera_family; + uint32_t reserved; + struct cam_hw_version camera_version; + struct cam_hw_version cpas_version; +}; + +#endif /* __UAPI_CAM_CPAS_H__ */ diff --git a/selfdrive/camerad/include/media/cam_defs.h b/selfdrive/camerad/include/media/cam_defs.h new file mode 100644 index 000000000..e006463d2 --- /dev/null +++ b/selfdrive/camerad/include/media/cam_defs.h @@ -0,0 +1,477 @@ +#ifndef __UAPI_CAM_DEFS_H__ +#define __UAPI_CAM_DEFS_H__ + +#include +#include +#include + + +/* camera op codes */ +#define CAM_COMMON_OPCODE_BASE 0x100 +#define CAM_QUERY_CAP (CAM_COMMON_OPCODE_BASE + 0x1) +#define CAM_ACQUIRE_DEV (CAM_COMMON_OPCODE_BASE + 0x2) +#define CAM_START_DEV (CAM_COMMON_OPCODE_BASE + 0x3) +#define CAM_STOP_DEV (CAM_COMMON_OPCODE_BASE + 0x4) +#define CAM_CONFIG_DEV (CAM_COMMON_OPCODE_BASE + 0x5) +#define CAM_RELEASE_DEV (CAM_COMMON_OPCODE_BASE + 0x6) +#define CAM_SD_SHUTDOWN (CAM_COMMON_OPCODE_BASE + 0x7) +#define CAM_FLUSH_REQ (CAM_COMMON_OPCODE_BASE + 0x8) +#define CAM_COMMON_OPCODE_MAX (CAM_COMMON_OPCODE_BASE + 0x9) + +#define CAM_EXT_OPCODE_BASE 0x200 +#define CAM_CONFIG_DEV_EXTERNAL (CAM_EXT_OPCODE_BASE + 0x1) + +/* camera handle type */ +#define CAM_HANDLE_USER_POINTER 1 +#define CAM_HANDLE_MEM_HANDLE 2 + +/* Generic Blob CmdBuffer header properties */ +#define CAM_GENERIC_BLOB_CMDBUFFER_SIZE_MASK 0xFFFFFF00 +#define CAM_GENERIC_BLOB_CMDBUFFER_SIZE_SHIFT 8 +#define CAM_GENERIC_BLOB_CMDBUFFER_TYPE_MASK 0xFF +#define CAM_GENERIC_BLOB_CMDBUFFER_TYPE_SHIFT 0 + +/* Command Buffer Types */ +#define CAM_CMD_BUF_DMI 0x1 +#define CAM_CMD_BUF_DMI16 0x2 +#define CAM_CMD_BUF_DMI32 0x3 +#define CAM_CMD_BUF_DMI64 0x4 +#define CAM_CMD_BUF_DIRECT 0x5 +#define CAM_CMD_BUF_INDIRECT 0x6 +#define CAM_CMD_BUF_I2C 0x7 +#define CAM_CMD_BUF_FW 0x8 +#define CAM_CMD_BUF_GENERIC 0x9 +#define CAM_CMD_BUF_LEGACY 0xA + +/** + * enum flush_type_t - Identifies the various flush types + * + * @CAM_FLUSH_TYPE_REQ: Flush specific request + * @CAM_FLUSH_TYPE_ALL: Flush all requests belonging to a context + * @CAM_FLUSH_TYPE_MAX: Max enum to validate flush type + * + */ +enum flush_type_t { + CAM_FLUSH_TYPE_REQ, + CAM_FLUSH_TYPE_ALL, + CAM_FLUSH_TYPE_MAX +}; + +/** + * struct cam_control - Structure used by ioctl control for camera + * + * @op_code: This is the op code for camera control + * @size: Control command size + * @handle_type: User pointer or shared memory handle + * @reserved: Reserved field for 64 bit alignment + * @handle: Control command payload + */ +struct cam_control { + uint32_t op_code; + uint32_t size; + uint32_t handle_type; + uint32_t reserved; + uint64_t handle; +}; + +/* camera IOCTL */ +#define VIDIOC_CAM_CONTROL \ + _IOWR('V', BASE_VIDIOC_PRIVATE, struct cam_control) + +/** + * struct cam_hw_version - Structure for HW version of camera devices + * + * @major : Hardware version major + * @minor : Hardware version minor + * @incr : Hardware version increment + * @reserved : Reserved for 64 bit aligngment + */ +struct cam_hw_version { + uint32_t major; + uint32_t minor; + uint32_t incr; + uint32_t reserved; +}; + +/** + * struct cam_iommu_handle - Structure for IOMMU handles of camera hw devices + * + * @non_secure: Device Non Secure IOMMU handle + * @secure: Device Secure IOMMU handle + * + */ +struct cam_iommu_handle { + int32_t non_secure; + int32_t secure; +}; + +/* camera secure mode */ +#define CAM_SECURE_MODE_NON_SECURE 0 +#define CAM_SECURE_MODE_SECURE 1 + +/* Camera Format Type */ +#define CAM_FORMAT_BASE 0 +#define CAM_FORMAT_MIPI_RAW_6 1 +#define CAM_FORMAT_MIPI_RAW_8 2 +#define CAM_FORMAT_MIPI_RAW_10 3 +#define CAM_FORMAT_MIPI_RAW_12 4 +#define CAM_FORMAT_MIPI_RAW_14 5 +#define CAM_FORMAT_MIPI_RAW_16 6 +#define CAM_FORMAT_MIPI_RAW_20 7 +#define CAM_FORMAT_QTI_RAW_8 8 +#define CAM_FORMAT_QTI_RAW_10 9 +#define CAM_FORMAT_QTI_RAW_12 10 +#define CAM_FORMAT_QTI_RAW_14 11 +#define CAM_FORMAT_PLAIN8 12 +#define CAM_FORMAT_PLAIN16_8 13 +#define CAM_FORMAT_PLAIN16_10 14 +#define CAM_FORMAT_PLAIN16_12 15 +#define CAM_FORMAT_PLAIN16_14 16 +#define CAM_FORMAT_PLAIN16_16 17 +#define CAM_FORMAT_PLAIN32_20 18 +#define CAM_FORMAT_PLAIN64 19 +#define CAM_FORMAT_PLAIN128 20 +#define CAM_FORMAT_ARGB 21 +#define CAM_FORMAT_ARGB_10 22 +#define CAM_FORMAT_ARGB_12 23 +#define CAM_FORMAT_ARGB_14 24 +#define CAM_FORMAT_DPCM_10_6_10 25 +#define CAM_FORMAT_DPCM_10_8_10 26 +#define CAM_FORMAT_DPCM_12_6_12 27 +#define CAM_FORMAT_DPCM_12_8_12 28 +#define CAM_FORMAT_DPCM_14_8_14 29 +#define CAM_FORMAT_DPCM_14_10_14 30 +#define CAM_FORMAT_NV21 31 +#define CAM_FORMAT_NV12 32 +#define CAM_FORMAT_TP10 33 +#define CAM_FORMAT_YUV422 34 +#define CAM_FORMAT_PD8 35 +#define CAM_FORMAT_PD10 36 +#define CAM_FORMAT_UBWC_NV12 37 +#define CAM_FORMAT_UBWC_NV12_4R 38 +#define CAM_FORMAT_UBWC_TP10 39 +#define CAM_FORMAT_UBWC_P010 40 +#define CAM_FORMAT_PLAIN8_SWAP 41 +#define CAM_FORMAT_PLAIN8_10 42 +#define CAM_FORMAT_PLAIN8_10_SWAP 43 +#define CAM_FORMAT_YV12 44 +#define CAM_FORMAT_Y_ONLY 45 +#define CAM_FORMAT_MAX 46 + +/* camera rotaion */ +#define CAM_ROTATE_CW_0_DEGREE 0 +#define CAM_ROTATE_CW_90_DEGREE 1 +#define CAM_RORATE_CW_180_DEGREE 2 +#define CAM_ROTATE_CW_270_DEGREE 3 + +/* camera Color Space */ +#define CAM_COLOR_SPACE_BASE 0 +#define CAM_COLOR_SPACE_BT601_FULL 1 +#define CAM_COLOR_SPACE_BT601625 2 +#define CAM_COLOR_SPACE_BT601525 3 +#define CAM_COLOR_SPACE_BT709 4 +#define CAM_COLOR_SPACE_DEPTH 5 +#define CAM_COLOR_SPACE_MAX 6 + +/* camera buffer direction */ +#define CAM_BUF_INPUT 1 +#define CAM_BUF_OUTPUT 2 +#define CAM_BUF_IN_OUT 3 + +/* camera packet device Type */ +#define CAM_PACKET_DEV_BASE 0 +#define CAM_PACKET_DEV_IMG_SENSOR 1 +#define CAM_PACKET_DEV_ACTUATOR 2 +#define CAM_PACKET_DEV_COMPANION 3 +#define CAM_PACKET_DEV_EEPOM 4 +#define CAM_PACKET_DEV_CSIPHY 5 +#define CAM_PACKET_DEV_OIS 6 +#define CAM_PACKET_DEV_FLASH 7 +#define CAM_PACKET_DEV_FD 8 +#define CAM_PACKET_DEV_JPEG_ENC 9 +#define CAM_PACKET_DEV_JPEG_DEC 10 +#define CAM_PACKET_DEV_VFE 11 +#define CAM_PACKET_DEV_CPP 12 +#define CAM_PACKET_DEV_CSID 13 +#define CAM_PACKET_DEV_ISPIF 14 +#define CAM_PACKET_DEV_IFE 15 +#define CAM_PACKET_DEV_ICP 16 +#define CAM_PACKET_DEV_LRME 17 +#define CAM_PACKET_DEV_MAX 18 + + +/* constants */ +#define CAM_PACKET_MAX_PLANES 3 + +/** + * struct cam_plane_cfg - Plane configuration info + * + * @width: Plane width in pixels + * @height: Plane height in lines + * @plane_stride: Plane stride in pixel + * @slice_height: Slice height in line (not used by ISP) + * @meta_stride: UBWC metadata stride + * @meta_size: UBWC metadata plane size + * @meta_offset: UBWC metadata offset + * @packer_config: UBWC packer config + * @mode_config: UBWC mode config + * @tile_config: UBWC tile config + * @h_init: UBWC horizontal initial coordinate in pixels + * @v_init: UBWC vertical initial coordinate in lines + * + */ +struct cam_plane_cfg { + uint32_t width; + uint32_t height; + uint32_t plane_stride; + uint32_t slice_height; + uint32_t meta_stride; + uint32_t meta_size; + uint32_t meta_offset; + uint32_t packer_config; + uint32_t mode_config; + uint32_t tile_config; + uint32_t h_init; + uint32_t v_init; +}; + +/** + * struct cam_cmd_buf_desc - Command buffer descriptor + * + * @mem_handle: Command buffer handle + * @offset: Command start offset + * @size: Size of the command buffer in bytes + * @length: Used memory in command buffer in bytes + * @type: Type of the command buffer + * @meta_data: Data type for private command buffer + * Between UMD and KMD + * + */ +struct cam_cmd_buf_desc { + int32_t mem_handle; + uint32_t offset; + uint32_t size; + uint32_t length; + uint32_t type; + uint32_t meta_data; +}; + +/** + * struct cam_buf_io_cfg - Buffer io configuration for buffers + * + * @mem_handle: Mem_handle array for the buffers. + * @offsets: Offsets for each planes in the buffer + * @planes: Per plane information + * @width: Main plane width in pixel + * @height: Main plane height in lines + * @format: Format of the buffer + * @color_space: Color space for the buffer + * @color_pattern: Color pattern in the buffer + * @bpp: Bit per pixel + * @rotation: Rotation information for the buffer + * @resource_type: Resource type associated with the buffer + * @fence: Fence handle + * @early_fence: Fence handle for early signal + * @aux_cmd_buf: An auxiliary command buffer that may be + * used for programming the IO + * @direction: Direction of the config + * @batch_size: Batch size in HFR mode + * @subsample_pattern: Subsample pattern. Used in HFR mode. It + * should be consistent with batchSize and + * CAMIF programming. + * @subsample_period: Subsample period. Used in HFR mode. It + * should be consistent with batchSize and + * CAMIF programming. + * @framedrop_pattern: Framedrop pattern + * @framedrop_period: Framedrop period + * @flag: Flags for extra information + * @direction: Buffer direction: input or output + * @padding: Padding for the structure + * + */ +struct cam_buf_io_cfg { + int32_t mem_handle[CAM_PACKET_MAX_PLANES]; + uint32_t offsets[CAM_PACKET_MAX_PLANES]; + struct cam_plane_cfg planes[CAM_PACKET_MAX_PLANES]; + uint32_t format; + uint32_t color_space; + uint32_t color_pattern; + uint32_t bpp; + uint32_t rotation; + uint32_t resource_type; + int32_t fence; + int32_t early_fence; + struct cam_cmd_buf_desc aux_cmd_buf; + uint32_t direction; + uint32_t batch_size; + uint32_t subsample_pattern; + uint32_t subsample_period; + uint32_t framedrop_pattern; + uint32_t framedrop_period; + uint32_t flag; + uint32_t padding; +}; + +/** + * struct cam_packet_header - Camera packet header + * + * @op_code: Camera packet opcode + * @size: Size of the camera packet in bytes + * @request_id: Request id for this camera packet + * @flags: Flags for the camera packet + * @padding: Padding + * + */ +struct cam_packet_header { + uint32_t op_code; + uint32_t size; + uint64_t request_id; + uint32_t flags; + uint32_t padding; +}; + +/** + * struct cam_patch_desc - Patch structure + * + * @dst_buf_hdl: Memory handle for the dest buffer + * @dst_offset: Offset byte in the dest buffer + * @src_buf_hdl: Memory handle for the source buffer + * @src_offset: Offset byte in the source buffer + * + */ +struct cam_patch_desc { + int32_t dst_buf_hdl; + uint32_t dst_offset; + int32_t src_buf_hdl; + uint32_t src_offset; +}; + +/** + * struct cam_packet - Camera packet structure + * + * @header: Camera packet header + * @cmd_buf_offset: Command buffer start offset + * @num_cmd_buf: Number of the command buffer in the packet + * @io_config_offset: Buffer io configuration start offset + * @num_io_configs: Number of the buffer io configurations + * @patch_offset: Patch offset for the patch structure + * @num_patches: Number of the patch structure + * @kmd_cmd_buf_index: Command buffer index which contains extra + * space for the KMD buffer + * @kmd_cmd_buf_offset: Offset from the beginning of the command + * buffer for KMD usage. + * @payload: Camera packet payload + * + */ +struct cam_packet { + struct cam_packet_header header; + uint32_t cmd_buf_offset; + uint32_t num_cmd_buf; + uint32_t io_configs_offset; + uint32_t num_io_configs; + uint32_t patch_offset; + uint32_t num_patches; + uint32_t kmd_cmd_buf_index; + uint32_t kmd_cmd_buf_offset; + uint64_t payload[1]; + +}; + +/** + * struct cam_release_dev_cmd - Control payload for release devices + * + * @session_handle: Session handle for the release + * @dev_handle: Device handle for the release + */ +struct cam_release_dev_cmd { + int32_t session_handle; + int32_t dev_handle; +}; + +/** + * struct cam_start_stop_dev_cmd - Control payload for start/stop device + * + * @session_handle: Session handle for the start/stop command + * @dev_handle: Device handle for the start/stop command + * + */ +struct cam_start_stop_dev_cmd { + int32_t session_handle; + int32_t dev_handle; +}; + +/** + * struct cam_config_dev_cmd - Command payload for configure device + * + * @session_handle: Session handle for the command + * @dev_handle: Device handle for the command + * @offset: Offset byte in the packet handle. + * @packet_handle: Packet memory handle for the actual packet: + * struct cam_packet. + * + */ +struct cam_config_dev_cmd { + int32_t session_handle; + int32_t dev_handle; + uint64_t offset; + uint64_t packet_handle; +}; + +/** + * struct cam_query_cap_cmd - Payload for query device capability + * + * @size: Handle size + * @handle_type: User pointer or shared memory handle + * @caps_handle: Device specific query command payload + * + */ +struct cam_query_cap_cmd { + uint32_t size; + uint32_t handle_type; + uint64_t caps_handle; +}; + +/** + * struct cam_acquire_dev_cmd - Control payload for acquire devices + * + * @session_handle: Session handle for the acquire command + * @dev_handle: Device handle to be returned + * @handle_type: Resource handle type: + * 1 = user pointer, 2 = mem handle + * @num_resources: Number of the resources to be acquired + * @resources_hdl: Resource handle that refers to the actual + * resource array. Each item in this + * array is device specific resource structure + * + */ +struct cam_acquire_dev_cmd { + int32_t session_handle; + int32_t dev_handle; + uint32_t handle_type; + uint32_t num_resources; + uint64_t resource_hdl; +}; + +/** + * struct cam_flush_dev_cmd - Control payload for flush devices + * + * @version: Version + * @session_handle: Session handle for the acquire command + * @dev_handle: Device handle to be returned + * @flush_type: Flush type: + * 0 = flush specific request + * 1 = flush all + * @reserved: Reserved for 64 bit aligngment + * @req_id: Request id that needs to cancel + * + */ +struct cam_flush_dev_cmd { + uint64_t version; + int32_t session_handle; + int32_t dev_handle; + uint32_t flush_type; + uint32_t reserved; + int64_t req_id; +}; + +#endif /* __UAPI_CAM_DEFS_H__ */ diff --git a/selfdrive/camerad/include/media/cam_fd.h b/selfdrive/camerad/include/media/cam_fd.h new file mode 100644 index 000000000..8feb6e4da --- /dev/null +++ b/selfdrive/camerad/include/media/cam_fd.h @@ -0,0 +1,127 @@ +#ifndef __UAPI_CAM_FD_H__ +#define __UAPI_CAM_FD_H__ + +#include "cam_defs.h" + +#define CAM_FD_MAX_FACES 35 +#define CAM_FD_RAW_RESULT_ENTRIES 512 + +/* FD Op Codes */ +#define CAM_PACKET_OPCODES_FD_FRAME_UPDATE 0x0 + +/* FD Command Buffer identifiers */ +#define CAM_FD_CMD_BUFFER_ID_GENERIC 0x0 +#define CAM_FD_CMD_BUFFER_ID_CDM 0x1 +#define CAM_FD_CMD_BUFFER_ID_MAX 0x2 + +/* FD Blob types */ +#define CAM_FD_BLOB_TYPE_SOC_CLOCK_BW_REQUEST 0x0 +#define CAM_FD_BLOB_TYPE_RAW_RESULTS_REQUIRED 0x1 + +/* FD Resource IDs */ +#define CAM_FD_INPUT_PORT_ID_IMAGE 0x0 +#define CAM_FD_INPUT_PORT_ID_MAX 0x1 + +#define CAM_FD_OUTPUT_PORT_ID_RESULTS 0x0 +#define CAM_FD_OUTPUT_PORT_ID_RAW_RESULTS 0x1 +#define CAM_FD_OUTPUT_PORT_ID_WORK_BUFFER 0x2 +#define CAM_FD_OUTPUT_PORT_ID_MAX 0x3 + +/** + * struct cam_fd_soc_clock_bw_request - SOC clock, bandwidth request info + * + * @clock_rate : Clock rate required while processing frame + * @bandwidth : Bandwidth required while processing frame + * @reserved : Reserved for future use + */ +struct cam_fd_soc_clock_bw_request { + uint64_t clock_rate; + uint64_t bandwidth; + uint64_t reserved[4]; +}; + +/** + * struct cam_fd_face - Face properties + * + * @prop1 : Property 1 of face + * @prop2 : Property 2 of face + * @prop3 : Property 3 of face + * @prop4 : Property 4 of face + * + * Do not change this layout, this is inline with how HW writes + * these values directly when the buffer is programmed to HW + */ +struct cam_fd_face { + uint32_t prop1; + uint32_t prop2; + uint32_t prop3; + uint32_t prop4; +}; + +/** + * struct cam_fd_results - FD results layout + * + * @faces : Array of faces with face properties + * @face_count : Number of faces detected + * @reserved : Reserved for alignment + * + * Do not change this layout, this is inline with how HW writes + * these values directly when the buffer is programmed to HW + */ +struct cam_fd_results { + struct cam_fd_face faces[CAM_FD_MAX_FACES]; + uint32_t face_count; + uint32_t reserved[3]; +}; + +/** + * struct cam_fd_hw_caps - Face properties + * + * @core_version : FD core version + * @wrapper_version : FD wrapper version + * @raw_results_available : Whether raw results are available on this HW + * @supported_modes : Modes supported by this HW. + * @reserved : Reserved for future use + */ +struct cam_fd_hw_caps { + struct cam_hw_version core_version; + struct cam_hw_version wrapper_version; + uint32_t raw_results_available; + uint32_t supported_modes; + uint64_t reserved; +}; + +/** + * struct cam_fd_query_cap_cmd - FD Query capabilities information + * + * @device_iommu : FD IOMMU handles + * @cdm_iommu : CDM iommu handles + * @hw_caps : FD HW capabilities + * @reserved : Reserved for alignment + */ +struct cam_fd_query_cap_cmd { + struct cam_iommu_handle device_iommu; + struct cam_iommu_handle cdm_iommu; + struct cam_fd_hw_caps hw_caps; + uint64_t reserved; +}; + +/** + * struct cam_fd_acquire_dev_info - FD acquire device information + * + * @clk_bw_request : SOC clock, bandwidth request + * @priority : Priority for this acquire + * @mode : Mode in which to run FD HW. + * @get_raw_results : Whether this acquire needs face raw results + * while frame processing + * @reserved : Reserved field for 64 bit alignment + */ +struct cam_fd_acquire_dev_info { + struct cam_fd_soc_clock_bw_request clk_bw_request; + uint32_t priority; + uint32_t mode; + uint32_t get_raw_results; + uint32_t reserved[13]; +}; + +#endif /* __UAPI_CAM_FD_H__ */ diff --git a/selfdrive/camerad/include/media/cam_icp.h b/selfdrive/camerad/include/media/cam_icp.h new file mode 100644 index 000000000..680d05b63 --- /dev/null +++ b/selfdrive/camerad/include/media/cam_icp.h @@ -0,0 +1,179 @@ +#ifndef __UAPI_CAM_ICP_H__ +#define __UAPI_CAM_ICP_H__ + +#include "cam_defs.h" + +/* icp, ipe, bps, cdm(ipe/bps) are used in querycap */ +#define CAM_ICP_DEV_TYPE_A5 1 +#define CAM_ICP_DEV_TYPE_IPE 2 +#define CAM_ICP_DEV_TYPE_BPS 3 +#define CAM_ICP_DEV_TYPE_IPE_CDM 4 +#define CAM_ICP_DEV_TYPE_BPS_CDM 5 +#define CAM_ICP_DEV_TYPE_MAX 5 + +/* definitions needed for icp aquire device */ +#define CAM_ICP_RES_TYPE_BPS 1 +#define CAM_ICP_RES_TYPE_IPE_RT 2 +#define CAM_ICP_RES_TYPE_IPE 3 +#define CAM_ICP_RES_TYPE_MAX 4 + +/* packet opcode types */ +#define CAM_ICP_OPCODE_IPE_UPDATE 0 +#define CAM_ICP_OPCODE_BPS_UPDATE 1 + +/* IPE input port resource type */ +#define CAM_ICP_IPE_INPUT_IMAGE_FULL 0x0 +#define CAM_ICP_IPE_INPUT_IMAGE_DS4 0x1 +#define CAM_ICP_IPE_INPUT_IMAGE_DS16 0x2 +#define CAM_ICP_IPE_INPUT_IMAGE_DS64 0x3 +#define CAM_ICP_IPE_INPUT_IMAGE_FULL_REF 0x4 +#define CAM_ICP_IPE_INPUT_IMAGE_DS4_REF 0x5 +#define CAM_ICP_IPE_INPUT_IMAGE_DS16_REF 0x6 +#define CAM_ICP_IPE_INPUT_IMAGE_DS64_REF 0x7 + +/* IPE output port resource type */ +#define CAM_ICP_IPE_OUTPUT_IMAGE_DISPLAY 0x8 +#define CAM_ICP_IPE_OUTPUT_IMAGE_VIDEO 0x9 +#define CAM_ICP_IPE_OUTPUT_IMAGE_FULL_REF 0xA +#define CAM_ICP_IPE_OUTPUT_IMAGE_DS4_REF 0xB +#define CAM_ICP_IPE_OUTPUT_IMAGE_DS16_REF 0xC +#define CAM_ICP_IPE_OUTPUT_IMAGE_DS64_REF 0xD + +#define CAM_ICP_IPE_IMAGE_MAX 0xE + +/* BPS input port resource type */ +#define CAM_ICP_BPS_INPUT_IMAGE 0x0 + +/* BPS output port resource type */ +#define CAM_ICP_BPS_OUTPUT_IMAGE_FULL 0x1 +#define CAM_ICP_BPS_OUTPUT_IMAGE_DS4 0x2 +#define CAM_ICP_BPS_OUTPUT_IMAGE_DS16 0x3 +#define CAM_ICP_BPS_OUTPUT_IMAGE_DS64 0x4 +#define CAM_ICP_BPS_OUTPUT_IMAGE_STATS_BG 0x5 +#define CAM_ICP_BPS_OUTPUT_IMAGE_STATS_BHIST 0x6 +#define CAM_ICP_BPS_OUTPUT_IMAGE_REG1 0x7 +#define CAM_ICP_BPS_OUTPUT_IMAGE_REG2 0x8 + +#define CAM_ICP_BPS_IO_IMAGES_MAX 0x9 + +/* Command meta types */ +#define CAM_ICP_CMD_META_GENERIC_BLOB 0x1 + +/* Generic blob types */ +#define CAM_ICP_CMD_GENERIC_BLOB_CLK 0x1 +#define CAM_ICP_CMD_GENERIC_BLOB_CFG_IO 0x2 + +/** + * struct cam_icp_clk_bw_request + * + * @budget_ns: Time required to process frame + * @frame_cycles: Frame cycles needed to process the frame + * @rt_flag: Flag to indicate real time stream + * @uncompressed_bw: Bandwidth required to process frame + * @compressed_bw: Compressed bandwidth to process frame + */ +struct cam_icp_clk_bw_request { + uint64_t budget_ns; + uint32_t frame_cycles; + uint32_t rt_flag; + uint64_t uncompressed_bw; + uint64_t compressed_bw; +}; + +/** + * struct cam_icp_dev_ver - Device information for particular hw type + * + * This is used to get device version info of + * ICP, IPE, BPS and CDM related IPE and BPS from firmware + * and use this info in CAM_QUERY_CAP IOCTL + * + * @dev_type: hardware type for the cap info(icp, ipe, bps, cdm(ipe/bps)) + * @reserved: reserved field + * @hw_ver: major, minor and incr values of a device version + */ +struct cam_icp_dev_ver { + uint32_t dev_type; + uint32_t reserved; + struct cam_hw_version hw_ver; +}; + +/** + * struct cam_icp_ver - ICP version info + * + * This strcuture is used for fw and api version + * this is used to get firmware version and api version from firmware + * and use this info in CAM_QUERY_CAP IOCTL + * + * @major: FW version major + * @minor: FW version minor + * @revision: FW version increment + */ +struct cam_icp_ver { + uint32_t major; + uint32_t minor; + uint32_t revision; + uint32_t reserved; +}; + +/** + * struct cam_icp_query_cap_cmd - ICP query device capability payload + * + * @dev_iommu_handle: icp iommu handles for secure/non secure modes + * @cdm_iommu_handle: iommu handles for secure/non secure modes + * @fw_version: firmware version info + * @api_version: api version info + * @num_ipe: number of ipes + * @num_bps: number of bps + * @dev_ver: returned device capability array + */ +struct cam_icp_query_cap_cmd { + struct cam_iommu_handle dev_iommu_handle; + struct cam_iommu_handle cdm_iommu_handle; + struct cam_icp_ver fw_version; + struct cam_icp_ver api_version; + uint32_t num_ipe; + uint32_t num_bps; + struct cam_icp_dev_ver dev_ver[CAM_ICP_DEV_TYPE_MAX]; +}; + +/** + * struct cam_icp_res_info - ICP output resource info + * + * @format: format of the resource + * @width: width in pixels + * @height: height in lines + * @fps: fps + */ +struct cam_icp_res_info { + uint32_t format; + uint32_t width; + uint32_t height; + uint32_t fps; +}; + +/** + * struct cam_icp_acquire_dev_info - An ICP device info + * + * @scratch_mem_size: Output param - size of scratch memory + * @dev_type: device type (IPE_RT/IPE_NON_RT/BPS) + * @io_config_cmd_size: size of IO config command + * @io_config_cmd_handle: IO config command for each acquire + * @secure_mode: camera mode (secure/non secure) + * @chain_info: chaining info of FW device handles + * @in_res: resource info used for clock and bandwidth calculation + * @num_out_res: number of output resources + * @out_res: output resource + */ +struct cam_icp_acquire_dev_info { + uint32_t scratch_mem_size; + uint32_t dev_type; + uint32_t io_config_cmd_size; + int32_t io_config_cmd_handle; + uint32_t secure_mode; + int32_t chain_info; + struct cam_icp_res_info in_res; + uint32_t num_out_res; + struct cam_icp_res_info out_res[1]; +} __attribute__((__packed__)); + +#endif /* __UAPI_CAM_ICP_H__ */ diff --git a/selfdrive/camerad/include/media/cam_isp.h b/selfdrive/camerad/include/media/cam_isp.h new file mode 100644 index 000000000..266840d38 --- /dev/null +++ b/selfdrive/camerad/include/media/cam_isp.h @@ -0,0 +1,379 @@ +#ifndef __UAPI_CAM_ISP_H__ +#define __UAPI_CAM_ISP_H__ + +#include "cam_defs.h" +#include "cam_isp_vfe.h" +#include "cam_isp_ife.h" + + +/* ISP driver name */ +#define CAM_ISP_DEV_NAME "cam-isp" + +/* HW type */ +#define CAM_ISP_HW_BASE 0 +#define CAM_ISP_HW_CSID 1 +#define CAM_ISP_HW_VFE 2 +#define CAM_ISP_HW_IFE 3 +#define CAM_ISP_HW_ISPIF 4 +#define CAM_ISP_HW_MAX 5 + +/* Color Pattern */ +#define CAM_ISP_PATTERN_BAYER_RGRGRG 0 +#define CAM_ISP_PATTERN_BAYER_GRGRGR 1 +#define CAM_ISP_PATTERN_BAYER_BGBGBG 2 +#define CAM_ISP_PATTERN_BAYER_GBGBGB 3 +#define CAM_ISP_PATTERN_YUV_YCBYCR 4 +#define CAM_ISP_PATTERN_YUV_YCRYCB 5 +#define CAM_ISP_PATTERN_YUV_CBYCRY 6 +#define CAM_ISP_PATTERN_YUV_CRYCBY 7 +#define CAM_ISP_PATTERN_MAX 8 + +/* Usage Type */ +#define CAM_ISP_RES_USAGE_SINGLE 0 +#define CAM_ISP_RES_USAGE_DUAL 1 +#define CAM_ISP_RES_USAGE_MAX 2 + +/* Resource ID */ +#define CAM_ISP_RES_ID_PORT 0 +#define CAM_ISP_RES_ID_CLK 1 +#define CAM_ISP_RES_ID_MAX 2 + +/* Resource Type - Type of resource for the resource id + * defined in cam_isp_vfe.h, cam_isp_ife.h + */ + +/* Lane Type in input resource for Port */ +#define CAM_ISP_LANE_TYPE_DPHY 0 +#define CAM_ISP_LANE_TYPE_CPHY 1 +#define CAM_ISP_LANE_TYPE_MAX 2 + +/* ISP Resurce Composite Group ID */ +#define CAM_ISP_RES_COMP_GROUP_NONE 0 +#define CAM_ISP_RES_COMP_GROUP_ID_0 1 +#define CAM_ISP_RES_COMP_GROUP_ID_1 2 +#define CAM_ISP_RES_COMP_GROUP_ID_2 3 +#define CAM_ISP_RES_COMP_GROUP_ID_3 4 +#define CAM_ISP_RES_COMP_GROUP_ID_4 5 +#define CAM_ISP_RES_COMP_GROUP_ID_5 6 +#define CAM_ISP_RES_COMP_GROUP_ID_MAX 6 + +/* ISP packet opcode for ISP */ +#define CAM_ISP_PACKET_OP_BASE 0 +#define CAM_ISP_PACKET_INIT_DEV 1 +#define CAM_ISP_PACKET_UPDATE_DEV 2 +#define CAM_ISP_PACKET_OP_MAX 3 + +/* ISP packet meta_data type for command buffer */ +#define CAM_ISP_PACKET_META_BASE 0 +#define CAM_ISP_PACKET_META_LEFT 1 +#define CAM_ISP_PACKET_META_RIGHT 2 +#define CAM_ISP_PACKET_META_COMMON 3 +#define CAM_ISP_PACKET_META_DMI_LEFT 4 +#define CAM_ISP_PACKET_META_DMI_RIGHT 5 +#define CAM_ISP_PACKET_META_DMI_COMMON 6 +#define CAM_ISP_PACKET_META_CLOCK 7 +#define CAM_ISP_PACKET_META_CSID 8 +#define CAM_ISP_PACKET_META_DUAL_CONFIG 9 +#define CAM_ISP_PACKET_META_GENERIC_BLOB_LEFT 10 +#define CAM_ISP_PACKET_META_GENERIC_BLOB_RIGHT 11 +#define CAM_ISP_PACKET_META_GENERIC_BLOB_COMMON 12 + +/* DSP mode */ +#define CAM_ISP_DSP_MODE_NONE 0 +#define CAM_ISP_DSP_MODE_ONE_WAY 1 +#define CAM_ISP_DSP_MODE_ROUND 2 + +/* ISP Generic Cmd Buffer Blob types */ +#define CAM_ISP_GENERIC_BLOB_TYPE_HFR_CONFIG 0 +#define CAM_ISP_GENERIC_BLOB_TYPE_CLOCK_CONFIG 1 +#define CAM_ISP_GENERIC_BLOB_TYPE_BW_CONFIG 2 + +/* Query devices */ +/** + * struct cam_isp_dev_cap_info - A cap info for particular hw type + * + * @hw_type: Hardware type for the cap info + * @reserved: reserved field for alignment + * @hw_version: Hardware version + * + */ +struct cam_isp_dev_cap_info { + uint32_t hw_type; + uint32_t reserved; + struct cam_hw_version hw_version; +}; + +/** + * struct cam_isp_query_cap_cmd - ISP query device capability payload + * + * @device_iommu: returned iommu handles for device + * @cdm_iommu: returned iommu handles for cdm + * @num_dev: returned number of device capabilities + * @reserved: reserved field for alignment + * @dev_caps: returned device capability array + * + */ +struct cam_isp_query_cap_cmd { + struct cam_iommu_handle device_iommu; + struct cam_iommu_handle cdm_iommu; + int32_t num_dev; + uint32_t reserved; + struct cam_isp_dev_cap_info dev_caps[CAM_ISP_HW_MAX]; +}; + +/* Acquire Device */ +/** + * struct cam_isp_out_port_info - An output port resource info + * + * @res_type: output resource type defined in file + * cam_isp_vfe.h or cam_isp_ife.h + * @format: output format of the resource + * @wdith: output width in pixels + * @height: output height in lines + * @comp_grp_id: composite group id for the resource. + * @split_point: split point in pixels for the dual VFE. + * @secure_mode: flag to tell if output should be run in secure + * mode or not. See cam_defs.h for definition + * @reserved: reserved field for alignment + * + */ +struct cam_isp_out_port_info { + uint32_t res_type; + uint32_t format; + uint32_t width; + uint32_t height; + uint32_t comp_grp_id; + uint32_t split_point; + uint32_t secure_mode; + uint32_t reserved; +}; + +/** + * struct cam_isp_in_port_info - An input port resource info + * + * @res_type: input resource type define in file + * cam_isp_vfe.h or cam_isp_ife.h + * @lane_type: lane type: c-phy or d-phy. + * @lane_num: active lane number + * @lane_cfg: lane configurations: 4 bits per lane + * @vc: input virtual channel number + * @dt: input data type number + * @format: input format + * @test_pattern: test pattern for the testgen + * @usage_type: whether dual vfe is required + * @left_start: left input start offset in pixels + * @left_stop: left input stop offset in pixels + * @left_width: left input width in pixels + * @right_start: right input start offset in pixels. + * Only for Dual VFE + * @right_stop: right input stop offset in pixels. + * Only for Dual VFE + * @right_width: right input width in pixels. + * Only for dual VFE + * @line_start: top of the line number + * @line_stop: bottome of the line number + * @height: input height in lines + * @pixel_clk; sensor output clock + * @batch_size: batch size for HFR mode + * @dsp_mode: DSP stream mode (Defines as CAM_ISP_DSP_MODE_*) + * @hbi_cnt: HBI count for the camif input + * @reserved: Reserved field for alignment + * @num_out_res: number of the output resource associated + * @data: payload that contains the output resources + * + */ +struct cam_isp_in_port_info { + uint32_t res_type; + uint32_t lane_type; + uint32_t lane_num; + uint32_t lane_cfg; + uint32_t vc; + uint32_t dt; + uint32_t format; + uint32_t test_pattern; + uint32_t usage_type; + uint32_t left_start; + uint32_t left_stop; + uint32_t left_width; + uint32_t right_start; + uint32_t right_stop; + uint32_t right_width; + uint32_t line_start; + uint32_t line_stop; + uint32_t height; + uint32_t pixel_clk; + uint32_t batch_size; + uint32_t dsp_mode; + uint32_t hbi_cnt; + uint32_t custom_csid; + uint32_t reserved; + uint32_t num_out_res; + struct cam_isp_out_port_info data[1]; +}; + +/** + * struct cam_isp_resource - A resource bundle + * + * @resoruce_id: resource id for the resource bundle + * @length: length of the while resource blob + * @handle_type: type of the resource handle + * @reserved: reserved field for alignment + * @res_hdl: resource handle that points to the + * resource array; + * + */ +struct cam_isp_resource { + uint32_t resource_id; + uint32_t length; + uint32_t handle_type; + uint32_t reserved; + uint64_t res_hdl; +}; + +/** + * struct cam_isp_port_hfr_config - HFR configuration for this port + * + * @resource_type: Resource type + * @subsample_pattern: Subsample pattern. Used in HFR mode. It + * should be consistent with batchSize and + * CAMIF programming. + * @subsample_period: Subsample period. Used in HFR mode. It + * should be consistent with batchSize and + * CAMIF programming. + * @framedrop_pattern: Framedrop pattern + * @framedrop_period: Framedrop period + * @reserved: Reserved for alignment + */ +struct cam_isp_port_hfr_config { + uint32_t resource_type; + uint32_t subsample_pattern; + uint32_t subsample_period; + uint32_t framedrop_pattern; + uint32_t framedrop_period; + uint32_t reserved; +} __attribute__((packed)); + +/** + * struct cam_isp_resource_hfr_config - Resource HFR configuration + * + * @num_ports: Number of ports + * @reserved: Reserved for alignment + * @port_hfr_config: HFR configuration for each IO port + */ +struct cam_isp_resource_hfr_config { + uint32_t num_ports; + uint32_t reserved; + struct cam_isp_port_hfr_config port_hfr_config[1]; +} __attribute__((packed)); + +/** + * struct cam_isp_dual_split_params - dual isp spilt parameters + * + * @split_point: Split point information x, where (0 < x < width) + * left ISP's input ends at x + righ padding and + * Right ISP's input starts at x - left padding + * @right_padding: Padding added past the split point for left + * ISP's input + * @left_padding: Padding added before split point for right + * ISP's input + * @reserved: Reserved filed for alignment + * + */ +struct cam_isp_dual_split_params { + uint32_t split_point; + uint32_t right_padding; + uint32_t left_padding; + uint32_t reserved; +}; + +/** + * struct cam_isp_dual_stripe_config - stripe config per bus client + * + * @offset: Start horizontal offset relative to + * output buffer + * In UBWC mode, this value indicates the H_INIT + * value in pixel + * @width: Width of the stripe in bytes + * @tileconfig Ubwc meta tile config. Contain the partial + * tile info + * @port_id: port id of ISP output + * + */ +struct cam_isp_dual_stripe_config { + uint32_t offset; + uint32_t width; + uint32_t tileconfig; + uint32_t port_id; +}; + +/** + * struct cam_isp_dual_config - dual isp configuration + * + * @num_ports Number of isp output ports + * @reserved Reserved field for alignment + * @split_params: Inpput split parameters + * @stripes: Stripe information + * + */ +struct cam_isp_dual_config { + uint32_t num_ports; + uint32_t reserved; + struct cam_isp_dual_split_params split_params; + struct cam_isp_dual_stripe_config stripes[1]; +} __attribute__((packed)); + +/** + * struct cam_isp_clock_config - Clock configuration + * + * @usage_type: Usage type (Single/Dual) + * @num_rdi: Number of RDI votes + * @left_pix_hz: Pixel Clock for Left ISP + * @right_pix_hz: Pixel Clock for Right ISP, valid only if Dual + * @rdi_hz: RDI Clock. ISP clock will be max of RDI and + * PIX clocks. For a particular context which ISP + * HW the RDI is allocated to is not known to UMD. + * Hence pass the clock and let KMD decide. + */ +struct cam_isp_clock_config { + uint32_t usage_type; + uint32_t num_rdi; + uint64_t left_pix_hz; + uint64_t right_pix_hz; + uint64_t rdi_hz[1]; +} __attribute__((packed)); + +/** + * struct cam_isp_bw_vote - Bandwidth vote information + * + * @resource_id: Resource ID + * @reserved: Reserved field for alignment + * @cam_bw_bps: Bandwidth vote for CAMNOC + * @ext_bw_bps: Bandwidth vote for path-to-DDR after CAMNOC + */ + +struct cam_isp_bw_vote { + uint32_t resource_id; + uint32_t reserved; + uint64_t cam_bw_bps; + uint64_t ext_bw_bps; +} __attribute__((packed)); + +/** + * struct cam_isp_bw_config - Bandwidth configuration + * + * @usage_type: Usage type (Single/Dual) + * @num_rdi: Number of RDI votes + * @left_pix_vote: Bandwidth vote for left ISP + * @right_pix_vote: Bandwidth vote for right ISP + * @rdi_vote: RDI bandwidth requirements + */ + +struct cam_isp_bw_config { + uint32_t usage_type; + uint32_t num_rdi; + struct cam_isp_bw_vote left_pix_vote; + struct cam_isp_bw_vote right_pix_vote; + struct cam_isp_bw_vote rdi_vote[1]; +} __attribute__((packed)); + +#endif /* __UAPI_CAM_ISP_H__ */ diff --git a/selfdrive/camerad/include/media/cam_isp_ife.h b/selfdrive/camerad/include/media/cam_isp_ife.h new file mode 100644 index 000000000..f5e72813f --- /dev/null +++ b/selfdrive/camerad/include/media/cam_isp_ife.h @@ -0,0 +1,39 @@ +#ifndef __UAPI_CAM_ISP_IFE_H__ +#define __UAPI_CAM_ISP_IFE_H__ + +/* IFE output port resource type (global unique)*/ +#define CAM_ISP_IFE_OUT_RES_BASE 0x3000 + +#define CAM_ISP_IFE_OUT_RES_FULL (CAM_ISP_IFE_OUT_RES_BASE + 0) +#define CAM_ISP_IFE_OUT_RES_DS4 (CAM_ISP_IFE_OUT_RES_BASE + 1) +#define CAM_ISP_IFE_OUT_RES_DS16 (CAM_ISP_IFE_OUT_RES_BASE + 2) +#define CAM_ISP_IFE_OUT_RES_RAW_DUMP (CAM_ISP_IFE_OUT_RES_BASE + 3) +#define CAM_ISP_IFE_OUT_RES_FD (CAM_ISP_IFE_OUT_RES_BASE + 4) +#define CAM_ISP_IFE_OUT_RES_PDAF (CAM_ISP_IFE_OUT_RES_BASE + 5) +#define CAM_ISP_IFE_OUT_RES_RDI_0 (CAM_ISP_IFE_OUT_RES_BASE + 6) +#define CAM_ISP_IFE_OUT_RES_RDI_1 (CAM_ISP_IFE_OUT_RES_BASE + 7) +#define CAM_ISP_IFE_OUT_RES_RDI_2 (CAM_ISP_IFE_OUT_RES_BASE + 8) +#define CAM_ISP_IFE_OUT_RES_RDI_3 (CAM_ISP_IFE_OUT_RES_BASE + 9) +#define CAM_ISP_IFE_OUT_RES_STATS_HDR_BE (CAM_ISP_IFE_OUT_RES_BASE + 10) +#define CAM_ISP_IFE_OUT_RES_STATS_HDR_BHIST (CAM_ISP_IFE_OUT_RES_BASE + 11) +#define CAM_ISP_IFE_OUT_RES_STATS_TL_BG (CAM_ISP_IFE_OUT_RES_BASE + 12) +#define CAM_ISP_IFE_OUT_RES_STATS_BF (CAM_ISP_IFE_OUT_RES_BASE + 13) +#define CAM_ISP_IFE_OUT_RES_STATS_AWB_BG (CAM_ISP_IFE_OUT_RES_BASE + 14) +#define CAM_ISP_IFE_OUT_RES_STATS_BHIST (CAM_ISP_IFE_OUT_RES_BASE + 15) +#define CAM_ISP_IFE_OUT_RES_STATS_RS (CAM_ISP_IFE_OUT_RES_BASE + 16) +#define CAM_ISP_IFE_OUT_RES_STATS_CS (CAM_ISP_IFE_OUT_RES_BASE + 17) +#define CAM_ISP_IFE_OUT_RES_STATS_IHIST (CAM_ISP_IFE_OUT_RES_BASE + 18) +#define CAM_ISP_IFE_OUT_RES_MAX (CAM_ISP_IFE_OUT_RES_BASE + 19) + + +/* IFE input port resource type (global unique) */ +#define CAM_ISP_IFE_IN_RES_BASE 0x4000 + +#define CAM_ISP_IFE_IN_RES_TPG (CAM_ISP_IFE_IN_RES_BASE + 0) +#define CAM_ISP_IFE_IN_RES_PHY_0 (CAM_ISP_IFE_IN_RES_BASE + 1) +#define CAM_ISP_IFE_IN_RES_PHY_1 (CAM_ISP_IFE_IN_RES_BASE + 2) +#define CAM_ISP_IFE_IN_RES_PHY_2 (CAM_ISP_IFE_IN_RES_BASE + 3) +#define CAM_ISP_IFE_IN_RES_PHY_3 (CAM_ISP_IFE_IN_RES_BASE + 4) +#define CAM_ISP_IFE_IN_RES_MAX (CAM_ISP_IFE_IN_RES_BASE + 5) + +#endif /* __UAPI_CAM_ISP_IFE_H__ */ diff --git a/selfdrive/camerad/include/media/cam_isp_vfe.h b/selfdrive/camerad/include/media/cam_isp_vfe.h new file mode 100644 index 000000000..e48db2f98 --- /dev/null +++ b/selfdrive/camerad/include/media/cam_isp_vfe.h @@ -0,0 +1,44 @@ +#ifndef __UAPI_CAM_ISP_VFE_H__ +#define __UAPI_CAM_ISP_VFE_H__ + +/* VFE output port resource type (global unique) */ +#define CAM_ISP_VFE_OUT_RES_BASE 0x1000 + +#define CAM_ISP_VFE_OUT_RES_ENC (CAM_ISP_VFE_OUT_RES_BASE + 0) +#define CAM_ISP_VFE_OUT_RES_VIEW (CAM_ISP_VFE_OUT_RES_BASE + 1) +#define CAM_ISP_VFE_OUT_RES_VID (CAM_ISP_VFE_OUT_RES_BASE + 2) +#define CAM_ISP_VFE_OUT_RES_RDI_0 (CAM_ISP_VFE_OUT_RES_BASE + 3) +#define CAM_ISP_VFE_OUT_RES_RDI_1 (CAM_ISP_VFE_OUT_RES_BASE + 4) +#define CAM_ISP_VFE_OUT_RES_RDI_2 (CAM_ISP_VFE_OUT_RES_BASE + 5) +#define CAM_ISP_VFE_OUT_RES_RDI_3 (CAM_ISP_VFE_OUT_RES_BASE + 6) +#define CAM_ISP_VFE_OUT_RES_STATS_AEC (CAM_ISP_VFE_OUT_RES_BASE + 7) +#define CAM_ISP_VFE_OUT_RES_STATS_AF (CAM_ISP_VFE_OUT_RES_BASE + 8) +#define CAM_ISP_VFE_OUT_RES_STATS_AWB (CAM_ISP_VFE_OUT_RES_BASE + 9) +#define CAM_ISP_VFE_OUT_RES_STATS_RS (CAM_ISP_VFE_OUT_RES_BASE + 10) +#define CAM_ISP_VFE_OUT_RES_STATS_CS (CAM_ISP_VFE_OUT_RES_BASE + 11) +#define CAM_ISP_VFE_OUT_RES_STATS_IHIST (CAM_ISP_VFE_OUT_RES_BASE + 12) +#define CAM_ISP_VFE_OUT_RES_STATS_SKIN (CAM_ISP_VFE_OUT_RES_BASE + 13) +#define CAM_ISP_VFE_OUT_RES_STATS_BG (CAM_ISP_VFE_OUT_RES_BASE + 14) +#define CAM_ISP_VFE_OUT_RES_STATS_BF (CAM_ISP_VFE_OUT_RES_BASE + 15) +#define CAM_ISP_VFE_OUT_RES_STATS_BE (CAM_ISP_VFE_OUT_RES_BASE + 16) +#define CAM_ISP_VFE_OUT_RES_STATS_BHIST (CAM_ISP_VFE_OUT_RES_BASE + 17) +#define CAM_ISP_VFE_OUT_RES_STATS_BF_SCALE (CAM_ISP_VFE_OUT_RES_BASE + 18) +#define CAM_ISP_VFE_OUT_RES_STATS_HDR_BE (CAM_ISP_VFE_OUT_RES_BASE + 19) +#define CAM_ISP_VFE_OUT_RES_STATS_HDR_BHIST (CAM_ISP_VFE_OUT_RES_BASE + 20) +#define CAM_ISP_VFE_OUT_RES_STATS_AEC_BG (CAM_ISP_VFE_OUT_RES_BASE + 21) +#define CAM_ISP_VFE_OUT_RES_CAMIF_RAW (CAM_ISP_VFE_OUT_RES_BASE + 22) +#define CAM_ISP_VFE_OUT_RES_IDEAL_RAW (CAM_ISP_VFE_OUT_RES_BASE + 23) +#define CAM_ISP_VFE_OUT_RES_MAX (CAM_ISP_VFE_OUT_RES_BASE + 24) + +/* VFE input port_ resource type (global unique) */ +#define CAM_ISP_VFE_IN_RES_BASE 0x2000 + +#define CAM_ISP_VFE_IN_RES_TPG (CAM_ISP_VFE_IN_RES_BASE + 0) +#define CAM_ISP_VFE_IN_RES_PHY_0 (CAM_ISP_VFE_IN_RES_BASE + 1) +#define CAM_ISP_VFE_IN_RES_PHY_1 (CAM_ISP_VFE_IN_RES_BASE + 2) +#define CAM_ISP_VFE_IN_RES_PHY_2 (CAM_ISP_VFE_IN_RES_BASE + 3) +#define CAM_ISP_VFE_IN_RES_PHY_3 (CAM_ISP_VFE_IN_RES_BASE + 4) +#define CAM_ISP_VFE_IN_RES_FE (CAM_ISP_VFE_IN_RES_BASE + 5) +#define CAM_ISP_VFE_IN_RES_MAX (CAM_ISP_VFE_IN_RES_BASE + 6) + +#endif /* __UAPI_CAM_ISP_VFE_H__ */ diff --git a/selfdrive/camerad/include/media/cam_jpeg.h b/selfdrive/camerad/include/media/cam_jpeg.h new file mode 100644 index 000000000..f3082f3bf --- /dev/null +++ b/selfdrive/camerad/include/media/cam_jpeg.h @@ -0,0 +1,117 @@ +#ifndef __UAPI_CAM_JPEG_H__ +#define __UAPI_CAM_JPEG_H__ + +#include "cam_defs.h" + +/* enc, dma, cdm(enc/dma) are used in querycap */ +#define CAM_JPEG_DEV_TYPE_ENC 0 +#define CAM_JPEG_DEV_TYPE_DMA 1 +#define CAM_JPEG_DEV_TYPE_MAX 2 + +#define CAM_JPEG_NUM_DEV_PER_RES_MAX 1 + +/* definitions needed for jpeg aquire device */ +#define CAM_JPEG_RES_TYPE_ENC 0 +#define CAM_JPEG_RES_TYPE_DMA 1 +#define CAM_JPEG_RES_TYPE_MAX 2 + +/* packet opcode types */ +#define CAM_JPEG_OPCODE_ENC_UPDATE 0 +#define CAM_JPEG_OPCODE_DMA_UPDATE 1 + +/* ENC input port resource type */ +#define CAM_JPEG_ENC_INPUT_IMAGE 0x0 + +/* ENC output port resource type */ +#define CAM_JPEG_ENC_OUTPUT_IMAGE 0x1 + +#define CAM_JPEG_ENC_IO_IMAGES_MAX 0x2 + +/* DMA input port resource type */ +#define CAM_JPEG_DMA_INPUT_IMAGE 0x0 + +/* DMA output port resource type */ +#define CAM_JPEG_DMA_OUTPUT_IMAGE 0x1 + +#define CAM_JPEG_DMA_IO_IMAGES_MAX 0x2 + +#define CAM_JPEG_IMAGE_MAX 0x2 + +/** + * struct cam_jpeg_dev_ver - Device information for particular hw type + * + * This is used to get device version info of JPEG ENC, JPEG DMA + * from hardware and use this info in CAM_QUERY_CAP IOCTL + * + * @size : Size of struct passed + * @dev_type: Hardware type for the cap info(jpeg enc, jpeg dma) + * @hw_ver: Major, minor and incr values of a device version + */ +struct cam_jpeg_dev_ver { + uint32_t size; + uint32_t dev_type; + struct cam_hw_version hw_ver; +}; + +/** + * struct cam_jpeg_query_cap_cmd - JPEG query device capability payload + * + * @dev_iommu_handle: Jpeg iommu handles for secure/non secure + * modes + * @cdm_iommu_handle: Iommu handles for secure/non secure modes + * @num_enc: Number of encoder + * @num_dma: Number of dma + * @dev_ver: Returned device capability array + */ +struct cam_jpeg_query_cap_cmd { + struct cam_iommu_handle dev_iommu_handle; + struct cam_iommu_handle cdm_iommu_handle; + uint32_t num_enc; + uint32_t num_dma; + struct cam_jpeg_dev_ver dev_ver[CAM_JPEG_DEV_TYPE_MAX]; +}; + +/** + * struct cam_jpeg_res_info - JPEG output resource info + * + * @format: Format of the resource + * @width: Width in pixels + * @height: Height in lines + * @fps: Fps + */ +struct cam_jpeg_res_info { + uint32_t format; + uint32_t width; + uint32_t height; + uint32_t fps; +}; + +/** + * struct cam_jpeg_acquire_dev_info - An JPEG device info + * + * @dev_type: Device type (ENC/DMA) + * @reserved: Reserved Bytes + * @in_res: In resource info + * @in_res: Iut resource info + */ +struct cam_jpeg_acquire_dev_info { + uint32_t dev_type; + uint32_t reserved; + struct cam_jpeg_res_info in_res; + struct cam_jpeg_res_info out_res; +}; + +/** + * struct cam_jpeg_config_inout_param_info - JPEG Config time + * input output params + * + * @clk_index: Input Param- clock selection index.(-1 default) + * @output_size: Output Param - jpeg encode/dma output size in + * bytes + */ +struct cam_jpeg_config_inout_param_info { + int32_t clk_index; + int32_t output_size; +}; + +#endif /* __UAPI_CAM_JPEG_H__ */ diff --git a/selfdrive/camerad/include/media/cam_lrme.h b/selfdrive/camerad/include/media/cam_lrme.h new file mode 100644 index 000000000..97d957835 --- /dev/null +++ b/selfdrive/camerad/include/media/cam_lrme.h @@ -0,0 +1,65 @@ +#ifndef __UAPI_CAM_LRME_H__ +#define __UAPI_CAM_LRME_H__ + +#include "cam_defs.h" + +/* LRME Resource Types */ + +enum CAM_LRME_IO_TYPE { + CAM_LRME_IO_TYPE_TAR, + CAM_LRME_IO_TYPE_REF, + CAM_LRME_IO_TYPE_RES, + CAM_LRME_IO_TYPE_DS2, +}; + +#define CAM_LRME_INPUT_PORT_TYPE_TAR (1 << 0) +#define CAM_LRME_INPUT_PORT_TYPE_REF (1 << 1) + +#define CAM_LRME_OUTPUT_PORT_TYPE_DS2 (1 << 0) +#define CAM_LRME_OUTPUT_PORT_TYPE_RES (1 << 1) + +#define CAM_LRME_DEV_MAX 1 + + +struct cam_lrme_hw_version { + uint32_t gen; + uint32_t rev; + uint32_t step; +}; + +struct cam_lrme_dev_cap { + struct cam_lrme_hw_version clc_hw_version; + struct cam_lrme_hw_version bus_rd_hw_version; + struct cam_lrme_hw_version bus_wr_hw_version; + struct cam_lrme_hw_version top_hw_version; + struct cam_lrme_hw_version top_titan_version; +}; + +/** + * struct cam_lrme_query_cap_cmd - LRME query device capability payload + * + * @dev_iommu_handle: LRME iommu handles for secure/non secure + * modes + * @cdm_iommu_handle: Iommu handles for secure/non secure modes + * @num_devices: number of hardware devices + * @dev_caps: Returned device capability array + */ +struct cam_lrme_query_cap_cmd { + struct cam_iommu_handle device_iommu; + struct cam_iommu_handle cdm_iommu; + uint32_t num_devices; + struct cam_lrme_dev_cap dev_caps[CAM_LRME_DEV_MAX]; +}; + +struct cam_lrme_soc_info { + uint64_t clock_rate; + uint64_t bandwidth; + uint64_t reserved[4]; +}; + +struct cam_lrme_acquire_args { + struct cam_lrme_soc_info lrme_soc_info; +}; + +#endif /* __UAPI_CAM_LRME_H__ */ + diff --git a/selfdrive/camerad/include/media/cam_req_mgr.h b/selfdrive/camerad/include/media/cam_req_mgr.h new file mode 100644 index 000000000..ae6564996 --- /dev/null +++ b/selfdrive/camerad/include/media/cam_req_mgr.h @@ -0,0 +1,436 @@ +#ifndef __UAPI_LINUX_CAM_REQ_MGR_H +#define __UAPI_LINUX_CAM_REQ_MGR_H + +#include +#include +#include +#include +#include + +#define CAM_REQ_MGR_VNODE_NAME "cam-req-mgr-devnode" + +#define CAM_DEVICE_TYPE_BASE (MEDIA_ENT_F_OLD_BASE) +#define CAM_VNODE_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE) +#define CAM_SENSOR_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 1) +#define CAM_IFE_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 2) +#define CAM_ICP_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 3) +#define CAM_LRME_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 4) +#define CAM_JPEG_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 5) +#define CAM_FD_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 6) +#define CAM_CPAS_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 7) +#define CAM_CSIPHY_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 8) +#define CAM_ACTUATOR_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 9) +#define CAM_CCI_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 10) +#define CAM_FLASH_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 11) +#define CAM_EEPROM_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 12) +#define CAM_OIS_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 13) + +/* cam_req_mgr hdl info */ +#define CAM_REQ_MGR_HDL_IDX_POS 8 +#define CAM_REQ_MGR_HDL_IDX_MASK ((1 << CAM_REQ_MGR_HDL_IDX_POS) - 1) +#define CAM_REQ_MGR_GET_HDL_IDX(hdl) (hdl & CAM_REQ_MGR_HDL_IDX_MASK) + +/** + * Max handles supported by cam_req_mgr + * It includes both session and device handles + */ +#define CAM_REQ_MGR_MAX_HANDLES 64 +#define MAX_LINKS_PER_SESSION 2 + +/* V4L event type which user space will subscribe to */ +#define V4L_EVENT_CAM_REQ_MGR_EVENT (V4L2_EVENT_PRIVATE_START + 0) + +/* Specific event ids to get notified in user space */ +#define V4L_EVENT_CAM_REQ_MGR_SOF 0 +#define V4L_EVENT_CAM_REQ_MGR_ERROR 1 +#define V4L_EVENT_CAM_REQ_MGR_SOF_BOOT_TS 2 + +/* SOF Event status */ +#define CAM_REQ_MGR_SOF_EVENT_SUCCESS 0 +#define CAM_REQ_MGR_SOF_EVENT_ERROR 1 + +/* Link control operations */ +#define CAM_REQ_MGR_LINK_ACTIVATE 0 +#define CAM_REQ_MGR_LINK_DEACTIVATE 1 + +/** + * Request Manager : flush_type + * @CAM_REQ_MGR_FLUSH_TYPE_ALL: Req mgr will remove all the pending + * requests from input/processing queue. + * @CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ: Req mgr will remove only particular + * request id from input/processing queue. + * @CAM_REQ_MGR_FLUSH_TYPE_MAX: Max number of the flush type + * @opcode: CAM_REQ_MGR_FLUSH_REQ + */ +#define CAM_REQ_MGR_FLUSH_TYPE_ALL 0 +#define CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ 1 +#define CAM_REQ_MGR_FLUSH_TYPE_MAX 2 + +/** + * Request Manager : Sync Mode type + * @CAM_REQ_MGR_SYNC_MODE_NO_SYNC: Req mgr will apply non-sync mode for this + * request. + * @CAM_REQ_MGR_SYNC_MODE_SYNC: Req mgr will apply sync mode for this request. + */ +#define CAM_REQ_MGR_SYNC_MODE_NO_SYNC 0 +#define CAM_REQ_MGR_SYNC_MODE_SYNC 1 + +/** + * struct cam_req_mgr_event_data + * @session_hdl: session handle + * @link_hdl: link handle + * @frame_id: frame id + * @reserved: reserved for 64 bit aligngment + * @req_id: request id + * @tv_sec: timestamp in seconds + * @tv_usec: timestamp in micro seconds + */ +struct cam_req_mgr_event_data { + int32_t session_hdl; + int32_t link_hdl; + int32_t frame_id; + int32_t reserved; + int64_t req_id; + uint64_t tv_sec; + uint64_t tv_usec; +}; + +/** + * struct cam_req_mgr_session_info + * @session_hdl: In/Output param - session_handle + * @opcode1: CAM_REQ_MGR_CREATE_SESSION + * @opcode2: CAM_REQ_MGR_DESTROY_SESSION + */ +struct cam_req_mgr_session_info { + int32_t session_hdl; + int32_t reserved; +}; + +/** + * struct cam_req_mgr_link_info + * @session_hdl: Input param - Identifier for CSL session + * @num_devices: Input Param - Num of devices to be linked + * @dev_hdls: Input param - List of device handles to be linked + * @link_hdl: Output Param -Identifier for link + * @opcode: CAM_REQ_MGR_LINK + */ +struct cam_req_mgr_link_info { + int32_t session_hdl; + uint32_t num_devices; + int32_t dev_hdls[CAM_REQ_MGR_MAX_HANDLES]; + int32_t link_hdl; +}; + +/** + * struct cam_req_mgr_unlink_info + * @session_hdl: input param - session handle + * @link_hdl: input param - link handle + * @opcode: CAM_REQ_MGR_UNLINK + */ +struct cam_req_mgr_unlink_info { + int32_t session_hdl; + int32_t link_hdl; +}; + +/** + * struct cam_req_mgr_flush_info + * @brief: User can tell drivers to flush a particular request id or + * flush all requests from its pending processing queue. Flush is a + * blocking call and driver shall ensure all requests are flushed + * before returning. + * @session_hdl: Input param - Identifier for CSL session + * @link_hdl: Input Param -Identifier for link + * @flush_type: User can cancel a particular req id or can flush + * all requests in queue + * @reserved: reserved for 64 bit aligngment + * @req_id: field is valid only if flush type is cancel request + * for flush all this field value is not considered. + * @opcode: CAM_REQ_MGR_FLUSH_REQ + */ +struct cam_req_mgr_flush_info { + int32_t session_hdl; + int32_t link_hdl; + uint32_t flush_type; + uint32_t reserved; + int64_t req_id; +}; + +/** struct cam_req_mgr_sched_info + * @session_hdl: Input param - Identifier for CSL session + * @link_hdl: Input Param -Identifier for link + * inluding itself. + * @bubble_enable: Input Param - Cam req mgr will do bubble recovery if this + * flag is set. + * @sync_mode: Type of Sync mode for this request + * @req_id: Input Param - Request Id from which all requests will be flushed + */ +struct cam_req_mgr_sched_request { + int32_t session_hdl; + int32_t link_hdl; + int32_t bubble_enable; + int32_t sync_mode; + int64_t req_id; +}; + +/** + * struct cam_req_mgr_sync_mode + * @session_hdl: Input param - Identifier for CSL session + * @sync_mode: Input Param - Type of sync mode + * @num_links: Input Param - Num of links in sync mode (Valid only + * when sync_mode is one of SYNC enabled modes) + * @link_hdls: Input Param - Array of link handles to be in sync mode + * (Valid only when sync_mode is one of SYNC + * enabled modes) + * @master_link_hdl: Input Param - To dictate which link's SOF drives system + * (Valid only when sync_mode is one of SYNC + * enabled modes) + * + * @opcode: CAM_REQ_MGR_SYNC_MODE + */ +struct cam_req_mgr_sync_mode { + int32_t session_hdl; + int32_t sync_mode; + int32_t num_links; + int32_t link_hdls[MAX_LINKS_PER_SESSION]; + int32_t master_link_hdl; + int32_t reserved; +}; + +/** + * struct cam_req_mgr_link_control + * @ops: Link operations: activate/deactive + * @session_hdl: Input param - Identifier for CSL session + * @num_links: Input Param - Num of links + * @reserved: reserved field + * @link_hdls: Input Param - Links to be activated/deactivated + * + * @opcode: CAM_REQ_MGR_LINK_CONTROL + */ +struct cam_req_mgr_link_control { + int32_t ops; + int32_t session_hdl; + int32_t num_links; + int32_t reserved; + int32_t link_hdls[MAX_LINKS_PER_SESSION]; +}; + +/** + * cam_req_mgr specific opcode ids + */ +#define CAM_REQ_MGR_CREATE_DEV_NODES (CAM_COMMON_OPCODE_MAX + 1) +#define CAM_REQ_MGR_CREATE_SESSION (CAM_COMMON_OPCODE_MAX + 2) +#define CAM_REQ_MGR_DESTROY_SESSION (CAM_COMMON_OPCODE_MAX + 3) +#define CAM_REQ_MGR_LINK (CAM_COMMON_OPCODE_MAX + 4) +#define CAM_REQ_MGR_UNLINK (CAM_COMMON_OPCODE_MAX + 5) +#define CAM_REQ_MGR_SCHED_REQ (CAM_COMMON_OPCODE_MAX + 6) +#define CAM_REQ_MGR_FLUSH_REQ (CAM_COMMON_OPCODE_MAX + 7) +#define CAM_REQ_MGR_SYNC_MODE (CAM_COMMON_OPCODE_MAX + 8) +#define CAM_REQ_MGR_ALLOC_BUF (CAM_COMMON_OPCODE_MAX + 9) +#define CAM_REQ_MGR_MAP_BUF (CAM_COMMON_OPCODE_MAX + 10) +#define CAM_REQ_MGR_RELEASE_BUF (CAM_COMMON_OPCODE_MAX + 11) +#define CAM_REQ_MGR_CACHE_OPS (CAM_COMMON_OPCODE_MAX + 12) +#define CAM_REQ_MGR_LINK_CONTROL (CAM_COMMON_OPCODE_MAX + 13) +/* end of cam_req_mgr opcodes */ + +#define CAM_MEM_FLAG_HW_READ_WRITE (1<<0) +#define CAM_MEM_FLAG_HW_READ_ONLY (1<<1) +#define CAM_MEM_FLAG_HW_WRITE_ONLY (1<<2) +#define CAM_MEM_FLAG_KMD_ACCESS (1<<3) +#define CAM_MEM_FLAG_UMD_ACCESS (1<<4) +#define CAM_MEM_FLAG_PROTECTED_MODE (1<<5) +#define CAM_MEM_FLAG_CMD_BUF_TYPE (1<<6) +#define CAM_MEM_FLAG_PIXEL_BUF_TYPE (1<<7) +#define CAM_MEM_FLAG_STATS_BUF_TYPE (1<<8) +#define CAM_MEM_FLAG_PACKET_BUF_TYPE (1<<9) +#define CAM_MEM_FLAG_CACHE (1<<10) +#define CAM_MEM_FLAG_HW_SHARED_ACCESS (1<<11) + +#define CAM_MEM_MMU_MAX_HANDLE 16 + +/* Maximum allowed buffers in existence */ +#define CAM_MEM_BUFQ_MAX 1024 + +#define CAM_MEM_MGR_SECURE_BIT_POS 15 +#define CAM_MEM_MGR_HDL_IDX_SIZE 15 +#define CAM_MEM_MGR_HDL_FD_SIZE 16 +#define CAM_MEM_MGR_HDL_IDX_END_POS 16 +#define CAM_MEM_MGR_HDL_FD_END_POS 32 + +#define CAM_MEM_MGR_HDL_IDX_MASK ((1 << CAM_MEM_MGR_HDL_IDX_SIZE) - 1) + +#define GET_MEM_HANDLE(idx, fd) \ + ((idx & CAM_MEM_MGR_HDL_IDX_MASK) | \ + (fd << (CAM_MEM_MGR_HDL_FD_END_POS - CAM_MEM_MGR_HDL_FD_SIZE))) \ + +#define GET_FD_FROM_HANDLE(hdl) \ + (hdl >> (CAM_MEM_MGR_HDL_FD_END_POS - CAM_MEM_MGR_HDL_FD_SIZE)) \ + +#define CAM_MEM_MGR_GET_HDL_IDX(hdl) (hdl & CAM_MEM_MGR_HDL_IDX_MASK) + +#define CAM_MEM_MGR_SET_SECURE_HDL(hdl, flag) \ + ((flag) ? (hdl |= (1 << CAM_MEM_MGR_SECURE_BIT_POS)) : \ + ((hdl) &= ~(1 << CAM_MEM_MGR_SECURE_BIT_POS))) + +#define CAM_MEM_MGR_IS_SECURE_HDL(hdl) \ + (((hdl) & \ + (1<> CAM_MEM_MGR_SECURE_BIT_POS) + +/** + * memory allocation type + */ +#define CAM_MEM_DMA_NONE 0 +#define CAM_MEM_DMA_BIDIRECTIONAL 1 +#define CAM_MEM_DMA_TO_DEVICE 2 +#define CAM_MEM_DMA_FROM_DEVICE 3 + + +/** + * memory cache operation + */ +#define CAM_MEM_CLEAN_CACHE 1 +#define CAM_MEM_INV_CACHE 2 +#define CAM_MEM_CLEAN_INV_CACHE 3 + + +/** + * struct cam_mem_alloc_out_params + * @buf_handle: buffer handle + * @fd: output buffer file descriptor + * @vaddr: virtual address pointer + */ +struct cam_mem_alloc_out_params { + uint32_t buf_handle; + int32_t fd; + uint64_t vaddr; +}; + +/** + * struct cam_mem_map_out_params + * @buf_handle: buffer handle + * @reserved: reserved for future + * @vaddr: virtual address pointer + */ +struct cam_mem_map_out_params { + uint32_t buf_handle; + uint32_t reserved; + uint64_t vaddr; +}; + +/** + * struct cam_mem_mgr_alloc_cmd + * @len: size of buffer to allocate + * @align: alignment of the buffer + * @mmu_hdls: array of mmu handles + * @num_hdl: number of handles + * @flags: flags of the buffer + * @out: out params + */ +/* CAM_REQ_MGR_ALLOC_BUF */ +struct cam_mem_mgr_alloc_cmd { + uint64_t len; + uint64_t align; + int32_t mmu_hdls[CAM_MEM_MMU_MAX_HANDLE]; + uint32_t num_hdl; + uint32_t flags; + struct cam_mem_alloc_out_params out; +}; + +/** + * struct cam_mem_mgr_map_cmd + * @mmu_hdls: array of mmu handles + * @num_hdl: number of handles + * @flags: flags of the buffer + * @fd: output buffer file descriptor + * @reserved: reserved field + * @out: out params + */ + +/* CAM_REQ_MGR_MAP_BUF */ +struct cam_mem_mgr_map_cmd { + int32_t mmu_hdls[CAM_MEM_MMU_MAX_HANDLE]; + uint32_t num_hdl; + uint32_t flags; + int32_t fd; + uint32_t reserved; + struct cam_mem_map_out_params out; +}; + +/** + * struct cam_mem_mgr_map_cmd + * @buf_handle: buffer handle + * @reserved: reserved field + */ +/* CAM_REQ_MGR_RELEASE_BUF */ +struct cam_mem_mgr_release_cmd { + int32_t buf_handle; + uint32_t reserved; +}; + +/** + * struct cam_mem_mgr_map_cmd + * @buf_handle: buffer handle + * @ops: cache operations + */ +/* CAM_REQ_MGR_CACHE_OPS */ +struct cam_mem_cache_ops_cmd { + int32_t buf_handle; + uint32_t mem_cache_ops; +}; + +/** + * Request Manager : error message type + * @CAM_REQ_MGR_ERROR_TYPE_DEVICE: Device error message, fatal to session + * @CAM_REQ_MGR_ERROR_TYPE_REQUEST: Error on a single request, not fatal + * @CAM_REQ_MGR_ERROR_TYPE_BUFFER: Buffer was not filled, not fatal + */ +#define CAM_REQ_MGR_ERROR_TYPE_DEVICE 0 +#define CAM_REQ_MGR_ERROR_TYPE_REQUEST 1 +#define CAM_REQ_MGR_ERROR_TYPE_BUFFER 2 + +/** + * struct cam_req_mgr_error_msg + * @error_type: type of error + * @request_id: request id of frame + * @device_hdl: device handle + * @linke_hdl: link_hdl + * @resource_size: size of the resource + */ +struct cam_req_mgr_error_msg { + uint32_t error_type; + uint32_t request_id; + int32_t device_hdl; + int32_t link_hdl; + uint64_t resource_size; +}; + +/** + * struct cam_req_mgr_frame_msg + * @request_id: request id of the frame + * @frame_id: frame id of the frame + * @timestamp: timestamp of the frame + * @link_hdl: link handle associated with this message + * @sof_status: sof status success or fail + */ +struct cam_req_mgr_frame_msg { + uint64_t request_id; + uint64_t frame_id; + uint64_t timestamp; + int32_t link_hdl; + uint32_t sof_status; +}; + +/** + * struct cam_req_mgr_message + * @session_hdl: session to which the frame belongs to + * @reserved: reserved field + * @u: union which can either be error or frame message + */ +struct cam_req_mgr_message { + int32_t session_hdl; + int32_t reserved; + union { + struct cam_req_mgr_error_msg err_msg; + struct cam_req_mgr_frame_msg frame_msg; + } u; +}; +#endif /* __UAPI_LINUX_CAM_REQ_MGR_H */ diff --git a/selfdrive/camerad/include/media/cam_sensor.h b/selfdrive/camerad/include/media/cam_sensor.h new file mode 100644 index 000000000..f5af6047f --- /dev/null +++ b/selfdrive/camerad/include/media/cam_sensor.h @@ -0,0 +1,477 @@ +#ifndef __UAPI_CAM_SENSOR_H__ +#define __UAPI_CAM_SENSOR_H__ + +#include +#include +#include + +#define CAM_SENSOR_PROBE_CMD (CAM_COMMON_OPCODE_MAX + 1) +#define CAM_FLASH_MAX_LED_TRIGGERS 3 +#define MAX_OIS_NAME_SIZE 32 +#define CAM_CSIPHY_SECURE_MODE_ENABLED 1 +/** + * struct cam_sensor_query_cap - capabilities info for sensor + * + * @slot_info : Indicates about the slotId or cell Index + * @secure_camera : Camera is in secure/Non-secure mode + * @pos_pitch : Sensor position pitch + * @pos_roll : Sensor position roll + * @pos_yaw : Sensor position yaw + * @actuator_slot_id : Actuator slot id which connected to sensor + * @eeprom_slot_id : EEPROM slot id which connected to sensor + * @ois_slot_id : OIS slot id which connected to sensor + * @flash_slot_id : Flash slot id which connected to sensor + * @csiphy_slot_id : CSIphy slot id which connected to sensor + * + */ +struct cam_sensor_query_cap { + uint32_t slot_info; + uint32_t secure_camera; + uint32_t pos_pitch; + uint32_t pos_roll; + uint32_t pos_yaw; + uint32_t actuator_slot_id; + uint32_t eeprom_slot_id; + uint32_t ois_slot_id; + uint32_t flash_slot_id; + uint32_t csiphy_slot_id; +} __attribute__((packed)); + +/** + * struct cam_csiphy_query_cap - capabilities info for csiphy + * + * @slot_info : Indicates about the slotId or cell Index + * @version : CSIphy version + * @clk lane : Of the 5 lanes, informs lane configured + * as clock lane + * @reserved + */ +struct cam_csiphy_query_cap { + uint32_t slot_info; + uint32_t version; + uint32_t clk_lane; + uint32_t reserved; +} __attribute__((packed)); + +/** + * struct cam_actuator_query_cap - capabilities info for actuator + * + * @slot_info : Indicates about the slotId or cell Index + * @reserved + */ +struct cam_actuator_query_cap { + uint32_t slot_info; + uint32_t reserved; +} __attribute__((packed)); + +/** + * struct cam_eeprom_query_cap_t - capabilities info for eeprom + * + * @slot_info : Indicates about the slotId or cell Index + * @eeprom_kernel_probe : Indicates about the kernel or userspace probe + */ +struct cam_eeprom_query_cap_t { + uint32_t slot_info; + uint16_t eeprom_kernel_probe; + uint16_t reserved; +} __attribute__((packed)); + +/** + * struct cam_ois_query_cap_t - capabilities info for ois + * + * @slot_info : Indicates about the slotId or cell Index + */ +struct cam_ois_query_cap_t { + uint32_t slot_info; + uint16_t reserved; +} __attribute__((packed)); + +/** + * struct cam_cmd_i2c_info - Contains slave I2C related info + * + * @slave_addr : Slave address + * @i2c_freq_mode : 4 bits are used for I2c freq mode + * @cmd_type : Explains type of command + */ +struct cam_cmd_i2c_info { + uint16_t slave_addr; + uint8_t i2c_freq_mode; + uint8_t cmd_type; +} __attribute__((packed)); + +/** + * struct cam_ois_opcode - Contains OIS opcode + * + * @prog : OIS FW prog register address + * @coeff : OIS FW coeff register address + * @pheripheral : OIS pheripheral + * @memory : OIS memory + */ +struct cam_ois_opcode { + uint32_t prog; + uint32_t coeff; + uint32_t pheripheral; + uint32_t memory; +} __attribute__((packed)); + +/** + * struct cam_cmd_ois_info - Contains OIS slave info + * + * @slave_addr : OIS i2c slave address + * @i2c_freq_mode : i2c frequency mode + * @cmd_type : Explains type of command + * @ois_fw_flag : indicates if fw is present or not + * @is_ois_calib : indicates the calibration data is available + * @ois_name : OIS name + * @opcode : opcode + */ +struct cam_cmd_ois_info { + uint16_t slave_addr; + uint8_t i2c_freq_mode; + uint8_t cmd_type; + uint8_t ois_fw_flag; + uint8_t is_ois_calib; + char ois_name[MAX_OIS_NAME_SIZE]; + struct cam_ois_opcode opcode; +} __attribute__((packed)); + +/** + * struct cam_cmd_probe - Contains sensor slave info + * + * @data_type : Slave register data type + * @addr_type : Slave register address type + * @op_code : Don't Care + * @cmd_type : Explains type of command + * @reg_addr : Slave register address + * @expected_data : Data expected at slave register address + * @data_mask : Data mask if only few bits are valid + * @camera_id : Indicates the slot to which camera + * needs to be probed + * @reserved + */ +struct cam_cmd_probe { + uint8_t data_type; + uint8_t addr_type; + uint8_t op_code; + uint8_t cmd_type; + uint32_t reg_addr; + uint32_t expected_data; + uint32_t data_mask; + uint16_t camera_id; + uint16_t reserved; +} __attribute__((packed)); + +/** + * struct cam_power_settings - Contains sensor power setting info + * + * @power_seq_type : Type of power sequence + * @reserved + * @config_val_low : Lower 32 bit value configuration value + * @config_val_high : Higher 32 bit value configuration value + * + */ +struct cam_power_settings { + uint16_t power_seq_type; + uint16_t reserved; + uint32_t config_val_low; + uint32_t config_val_high; +} __attribute__((packed)); + +/** + * struct cam_cmd_power - Explains about the power settings + * + * @count : Number of power settings follows + * @reserved + * @cmd_type : Explains type of command + * @power_settings : Contains power setting info + */ +struct cam_cmd_power { + uint16_t count; + uint8_t reserved; + uint8_t cmd_type; + struct cam_power_settings power_settings[1]; +} __attribute__((packed)); + +/** + * struct i2c_rdwr_header - header of READ/WRITE I2C command + * + * @ count : Number of registers / data / reg-data pairs + * @ op_code : Operation code + * @ cmd_type : Command buffer type + * @ data_type : I2C data type + * @ addr_type : I2C address type + * @ reserved + */ +struct i2c_rdwr_header { + uint16_t count; + uint8_t op_code; + uint8_t cmd_type; + uint8_t data_type; + uint8_t addr_type; + uint16_t reserved; +} __attribute__((packed)); + +/** + * struct i2c_random_wr_payload - payload for I2C random write + * + * @ reg_addr : Register address + * @ reg_data : Register data + * + */ +struct i2c_random_wr_payload { + uint32_t reg_addr; + uint32_t reg_data; +} __attribute__((packed)); + +/** + * struct cam_cmd_i2c_random_wr - I2C random write command + * @ header : header of READ/WRITE I2C command + * @ random_wr_payload : payload for I2C random write + */ +struct cam_cmd_i2c_random_wr { + struct i2c_rdwr_header header; + struct i2c_random_wr_payload random_wr_payload[1]; +} __attribute__((packed)); + +/** + * struct cam_cmd_read - I2C read command + * @ reg_data : Register data + * @ reserved + */ +struct cam_cmd_read { + uint32_t reg_data; + uint32_t reserved; +} __attribute__((packed)); + +/** + * struct cam_cmd_i2c_continuous_wr - I2C continuous write command + * @ header : header of READ/WRITE I2C command + * @ reg_addr : Register address + * @ data_read : I2C read command + */ +struct cam_cmd_i2c_continuous_wr { + struct i2c_rdwr_header header; + uint32_t reg_addr; + struct cam_cmd_read data_read[1]; +} __attribute__((packed)); + +/** + * struct cam_cmd_i2c_random_rd - I2C random read command + * @ header : header of READ/WRITE I2C command + * @ data_read : I2C read command + */ +struct cam_cmd_i2c_random_rd { + struct i2c_rdwr_header header; + struct cam_cmd_read data_read[1]; +} __attribute__((packed)); + +/** + * struct cam_cmd_i2c_continuous_rd - I2C continuous continuous read command + * @ header : header of READ/WRITE I2C command + * @ reg_addr : Register address + * + */ +struct cam_cmd_i2c_continuous_rd { + struct i2c_rdwr_header header; + uint32_t reg_addr; +} __attribute__((packed)); + +/** + * struct cam_cmd_conditional_wait - Conditional wait command + * @data_type : Data type + * @addr_type : Address type + * @op_code : Opcode + * @cmd_type : Explains type of command + * @timeout : Timeout for retries + * @reserved + * @reg_addr : Register Address + * @reg_data : Register data + * @data_mask : Data mask if only few bits are valid + * @camera_id : Indicates the slot to which camera + * needs to be probed + * + */ +struct cam_cmd_conditional_wait { + uint8_t data_type; + uint8_t addr_type; + uint8_t op_code; + uint8_t cmd_type; + uint16_t timeout; + uint16_t reserved; + uint32_t reg_addr; + uint32_t reg_data; + uint32_t data_mask; +} __attribute__((packed)); + +/** + * struct cam_cmd_unconditional_wait - Un-conditional wait command + * @delay : Delay + * @op_code : Opcode + * @cmd_type : Explains type of command + */ +struct cam_cmd_unconditional_wait { + int16_t delay; + uint8_t op_code; + uint8_t cmd_type; +} __attribute__((packed)); + +/** + * cam_csiphy_info: Provides cmdbuffer structre + * @lane_mask : Lane mask details + * @lane_assign : Lane sensor will be using + * @csiphy_3phase : Total number of lanes + * @combo_mode : Info regarding combo_mode is enable / disable + * @lane_cnt : Total number of lanes + * @secure_mode : Secure mode flag to enable / disable + * @3phase : Details whether 3Phase / 2Phase operation + * @settle_time : Settling time in ms + * @data_rate : Data rate + * + */ +struct cam_csiphy_info { + uint16_t lane_mask; + uint16_t lane_assign; + uint8_t csiphy_3phase; + uint8_t combo_mode; + uint8_t lane_cnt; + uint8_t secure_mode; + uint64_t settle_time; + uint64_t data_rate; +} __attribute__((packed)); + +/** + * cam_csiphy_acquire_dev_info : Information needed for + * csiphy at the time of acquire + * @combo_mode : Indicates the device mode of operation + * @reserved + * + */ +struct cam_csiphy_acquire_dev_info { + uint32_t combo_mode; + uint32_t reserved; +} __attribute__((packed)); + +/** + * cam_sensor_acquire_dev : Updates sensor acuire cmd + * @device_handle : Updates device handle + * @session_handle : Session handle for acquiring device + * @handle_type : Resource handle type + * @reserved + * @info_handle : Handle to additional info + * needed for sensor sub modules + * + */ +struct cam_sensor_acquire_dev { + uint32_t session_handle; + uint32_t device_handle; + uint32_t handle_type; + uint32_t reserved; + uint64_t info_handle; +} __attribute__((packed)); + +/** + * cam_sensor_streamon_dev : StreamOn command for the sensor + * @session_handle : Session handle for acquiring device + * @device_handle : Updates device handle + * @handle_type : Resource handle type + * @reserved + * @info_handle : Information Needed at the time of streamOn + * + */ +struct cam_sensor_streamon_dev { + uint32_t session_handle; + uint32_t device_handle; + uint32_t handle_type; + uint32_t reserved; + uint64_t info_handle; +} __attribute__((packed)); + +/** + * struct cam_flash_init : Init command for the flash + * @flash_type : flash hw type + * @reserved + * @cmd_type : command buffer type + */ +struct cam_flash_init { + uint8_t flash_type; + uint16_t reserved; + uint8_t cmd_type; +} __attribute__((packed)); + +/** + * struct cam_flash_set_rer : RedEyeReduction command buffer + * + * @count : Number of flash leds + * @opcode : Command buffer opcode + * CAM_FLASH_FIRE_RER + * @cmd_type : command buffer operation type + * @num_iteration : Number of led turn on/off sequence + * @reserved + * @led_on_delay_ms : flash led turn on time in ms + * @led_off_delay_ms : flash led turn off time in ms + * @led_current_ma : flash led current in ma + * + */ +struct cam_flash_set_rer { + uint16_t count; + uint8_t opcode; + uint8_t cmd_type; + uint16_t num_iteration; + uint16_t reserved; + uint32_t led_on_delay_ms; + uint32_t led_off_delay_ms; + uint32_t led_current_ma[CAM_FLASH_MAX_LED_TRIGGERS]; +} __attribute__((packed)); + +/** + * struct cam_flash_set_on_off : led turn on/off command buffer + * + * @count : Number of Flash leds + * @opcode : command buffer opcodes + * CAM_FLASH_FIRE_LOW + * CAM_FLASH_FIRE_HIGH + * CAM_FLASH_OFF + * @cmd_type : command buffer operation type + * @led_current_ma : flash led current in ma + * + */ +struct cam_flash_set_on_off { + uint16_t count; + uint8_t opcode; + uint8_t cmd_type; + uint32_t led_current_ma[CAM_FLASH_MAX_LED_TRIGGERS]; +} __attribute__((packed)); + +/** + * struct cam_flash_query_curr : query current command buffer + * + * @reserved + * @opcode : command buffer opcode + * @cmd_type : command buffer operation type + * @query_current_ma : battery current in ma + * + */ +struct cam_flash_query_curr { + uint16_t reserved; + uint8_t opcode; + uint8_t cmd_type; + uint32_t query_current_ma; +} __attribute__ ((packed)); + +/** + * struct cam_flash_query_cap : capabilities info for flash + * + * @slot_info : Indicates about the slotId or cell Index + * @max_current_flash : max supported current for flash + * @max_duration_flash : max flash turn on duration + * @max_current_torch : max supported current for torch + * + */ +struct cam_flash_query_cap_info { + uint32_t slot_info; + uint32_t max_current_flash[CAM_FLASH_MAX_LED_TRIGGERS]; + uint32_t max_duration_flash[CAM_FLASH_MAX_LED_TRIGGERS]; + uint32_t max_current_torch[CAM_FLASH_MAX_LED_TRIGGERS]; +} __attribute__ ((packed)); + +#endif diff --git a/selfdrive/camerad/include/media/cam_sensor_cmn_header.h b/selfdrive/camerad/include/media/cam_sensor_cmn_header.h new file mode 100644 index 000000000..24617b39b --- /dev/null +++ b/selfdrive/camerad/include/media/cam_sensor_cmn_header.h @@ -0,0 +1,391 @@ +/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * 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. + */ + +#ifndef _CAM_SENSOR_CMN_HEADER_ +#define _CAM_SENSOR_CMN_HEADER_ + +#include +#include +#include + +#define MAX_REGULATOR 5 +#define MAX_POWER_CONFIG 12 + +#define MAX_PER_FRAME_ARRAY 32 +#define BATCH_SIZE_MAX 16 + +#define CAM_SENSOR_NAME "cam-sensor" +#define CAM_ACTUATOR_NAME "cam-actuator" +#define CAM_CSIPHY_NAME "cam-csiphy" +#define CAM_FLASH_NAME "cam-flash" +#define CAM_EEPROM_NAME "cam-eeprom" +#define CAM_OIS_NAME "cam-ois" + +#define MAX_SYSTEM_PIPELINE_DELAY 2 + +#define CAM_PKT_NOP_OPCODE 127 + +enum camera_sensor_cmd_type { + CAMERA_SENSOR_CMD_TYPE_INVALID, + CAMERA_SENSOR_CMD_TYPE_PROBE, + CAMERA_SENSOR_CMD_TYPE_PWR_UP, + CAMERA_SENSOR_CMD_TYPE_PWR_DOWN, + CAMERA_SENSOR_CMD_TYPE_I2C_INFO, + CAMERA_SENSOR_CMD_TYPE_I2C_RNDM_WR, + CAMERA_SENSOR_CMD_TYPE_I2C_RNDM_RD, + CAMERA_SENSOR_CMD_TYPE_I2C_CONT_WR, + CAMERA_SENSOR_CMD_TYPE_I2C_CONT_RD, + CAMERA_SENSOR_CMD_TYPE_WAIT, + CAMERA_SENSOR_FLASH_CMD_TYPE_INIT_INFO, + CAMERA_SENSOR_FLASH_CMD_TYPE_FIRE, + CAMERA_SENSOR_FLASH_CMD_TYPE_RER, + CAMERA_SENSOR_FLASH_CMD_TYPE_QUERYCURR, + CAMERA_SENSOR_FLASH_CMD_TYPE_WIDGET, + CAMERA_SENSOR_CMD_TYPE_RD_DATA, + CAMERA_SENSOR_FLASH_CMD_TYPE_INIT_FIRE, + CAMERA_SENSOR_CMD_TYPE_MAX, +}; + +enum camera_sensor_i2c_op_code { + CAMERA_SENSOR_I2C_OP_INVALID, + CAMERA_SENSOR_I2C_OP_RNDM_WR, + CAMERA_SENSOR_I2C_OP_RNDM_WR_VERF, + CAMERA_SENSOR_I2C_OP_CONT_WR_BRST, + CAMERA_SENSOR_I2C_OP_CONT_WR_BRST_VERF, + CAMERA_SENSOR_I2C_OP_CONT_WR_SEQN, + CAMERA_SENSOR_I2C_OP_CONT_WR_SEQN_VERF, + CAMERA_SENSOR_I2C_OP_MAX, +}; + +enum camera_sensor_wait_op_code { + CAMERA_SENSOR_WAIT_OP_INVALID, + CAMERA_SENSOR_WAIT_OP_COND, + CAMERA_SENSOR_WAIT_OP_HW_UCND, + CAMERA_SENSOR_WAIT_OP_SW_UCND, + CAMERA_SENSOR_WAIT_OP_MAX, +}; + +enum camera_flash_opcode { + CAMERA_SENSOR_FLASH_OP_INVALID, + CAMERA_SENSOR_FLASH_OP_OFF, + CAMERA_SENSOR_FLASH_OP_FIRELOW, + CAMERA_SENSOR_FLASH_OP_FIREHIGH, + CAMERA_SENSOR_FLASH_OP_MAX, +}; + +enum camera_sensor_i2c_type { + CAMERA_SENSOR_I2C_TYPE_INVALID, + CAMERA_SENSOR_I2C_TYPE_BYTE, + CAMERA_SENSOR_I2C_TYPE_WORD, + CAMERA_SENSOR_I2C_TYPE_3B, + CAMERA_SENSOR_I2C_TYPE_DWORD, + CAMERA_SENSOR_I2C_TYPE_MAX, +}; + +enum i2c_freq_mode { + I2C_STANDARD_MODE, + I2C_FAST_MODE, + I2C_CUSTOM_MODE, + I2C_FAST_PLUS_MODE, + I2C_MAX_MODES, +}; + +enum position_roll { + ROLL_0 = 0, + ROLL_90 = 90, + ROLL_180 = 180, + ROLL_270 = 270, + ROLL_INVALID = 360, +}; + +enum position_yaw { + FRONT_CAMERA_YAW = 0, + REAR_CAMERA_YAW = 180, + INVALID_YAW = 360, +}; + +enum position_pitch { + LEVEL_PITCH = 0, + INVALID_PITCH = 360, +}; + +enum sensor_sub_module { + SUB_MODULE_SENSOR, + SUB_MODULE_ACTUATOR, + SUB_MODULE_EEPROM, + SUB_MODULE_LED_FLASH, + SUB_MODULE_CSID, + SUB_MODULE_CSIPHY, + SUB_MODULE_OIS, + SUB_MODULE_EXT, + SUB_MODULE_MAX, +}; + +enum msm_camera_power_seq_type { + SENSOR_MCLK, + SENSOR_VANA, + SENSOR_VDIG, + SENSOR_VIO, + SENSOR_VAF, + SENSOR_VAF_PWDM, + SENSOR_CUSTOM_REG1, + SENSOR_CUSTOM_REG2, + SENSOR_RESET, + SENSOR_STANDBY, + SENSOR_CUSTOM_GPIO1, + SENSOR_CUSTOM_GPIO2, + SENSOR_SEQ_TYPE_MAX, +}; + +enum cam_sensor_packet_opcodes { + CAM_SENSOR_PACKET_OPCODE_SENSOR_STREAMON, + CAM_SENSOR_PACKET_OPCODE_SENSOR_UPDATE, + CAM_SENSOR_PACKET_OPCODE_SENSOR_INITIAL_CONFIG, + CAM_SENSOR_PACKET_OPCODE_SENSOR_PROBE, + CAM_SENSOR_PACKET_OPCODE_SENSOR_CONFIG, + CAM_SENSOR_PACKET_OPCODE_SENSOR_STREAMOFF, + CAM_SENSOR_PACKET_OPCODE_SENSOR_NOP = 127 +}; + +enum cam_actuator_packet_opcodes { + CAM_ACTUATOR_PACKET_OPCODE_INIT, + CAM_ACTUATOR_PACKET_AUTO_MOVE_LENS, + CAM_ACTUATOR_PACKET_MANUAL_MOVE_LENS +}; + +enum cam_eeprom_packet_opcodes { + CAM_EEPROM_PACKET_OPCODE_INIT +}; + +enum cam_ois_packet_opcodes { + CAM_OIS_PACKET_OPCODE_INIT, + CAM_OIS_PACKET_OPCODE_OIS_CONTROL +}; + +enum msm_bus_perf_setting { + S_INIT, + S_PREVIEW, + S_VIDEO, + S_CAPTURE, + S_ZSL, + S_STEREO_VIDEO, + S_STEREO_CAPTURE, + S_DEFAULT, + S_LIVESHOT, + S_DUAL, + S_EXIT +}; + +enum msm_camera_device_type_t { + MSM_CAMERA_I2C_DEVICE, + MSM_CAMERA_PLATFORM_DEVICE, + MSM_CAMERA_SPI_DEVICE, +}; + +enum cam_flash_device_type { + CAMERA_FLASH_DEVICE_TYPE_PMIC = 0, + CAMERA_FLASH_DEVICE_TYPE_I2C, + CAMERA_FLASH_DEVICE_TYPE_GPIO, +}; + +enum cci_i2c_master_t { + MASTER_0, + MASTER_1, + MASTER_MAX, +}; + +enum camera_vreg_type { + VREG_TYPE_DEFAULT, + VREG_TYPE_CUSTOM, +}; + +enum cam_sensor_i2c_cmd_type { + CAM_SENSOR_I2C_WRITE_RANDOM, + CAM_SENSOR_I2C_WRITE_BURST, + CAM_SENSOR_I2C_WRITE_SEQ, + CAM_SENSOR_I2C_READ, + CAM_SENSOR_I2C_POLL +}; + +struct common_header { + uint16_t first_word; + uint8_t third_byte; + uint8_t cmd_type; +}; + +struct camera_vreg_t { + const char *reg_name; + int min_voltage; + int max_voltage; + int op_mode; + uint32_t delay; + const char *custom_vreg_name; + enum camera_vreg_type type; +}; + +struct msm_camera_gpio_num_info { + uint16_t gpio_num[SENSOR_SEQ_TYPE_MAX]; + uint8_t valid[SENSOR_SEQ_TYPE_MAX]; +}; + +struct msm_cam_clk_info { + const char *clk_name; + long clk_rate; + uint32_t delay; +}; + +struct msm_pinctrl_info { + struct pinctrl *pinctrl; + struct pinctrl_state *gpio_state_active; + struct pinctrl_state *gpio_state_suspend; + bool use_pinctrl; +}; + +struct cam_sensor_i2c_reg_array { + uint32_t reg_addr; + uint32_t reg_data; + uint32_t delay; + uint32_t data_mask; +}; + +struct cam_sensor_i2c_reg_setting { + struct cam_sensor_i2c_reg_array *reg_setting; + unsigned short size; + enum camera_sensor_i2c_type addr_type; + enum camera_sensor_i2c_type data_type; + unsigned short delay; +}; + +/*struct i2c_settings_list { + struct cam_sensor_i2c_reg_setting i2c_settings; + enum cam_sensor_i2c_cmd_type op_code; + struct list_head list; +}; + +struct i2c_settings_array { + struct list_head list_head; + int32_t is_settings_valid; + int64_t request_id; +}; + +struct i2c_data_settings { + struct i2c_settings_array init_settings; + struct i2c_settings_array config_settings; + struct i2c_settings_array streamon_settings; + struct i2c_settings_array streamoff_settings; + struct i2c_settings_array *per_frame; +};*/ + +struct cam_sensor_power_ctrl_t { + struct device *dev; + struct cam_sensor_power_setting *power_setting; + uint16_t power_setting_size; + struct cam_sensor_power_setting *power_down_setting; + uint16_t power_down_setting_size; + struct msm_camera_gpio_num_info *gpio_num_info; + struct msm_pinctrl_info pinctrl_info; + uint8_t cam_pinctrl_status; +}; + +struct cam_camera_slave_info { + uint16_t sensor_slave_addr; + uint16_t sensor_id_reg_addr; + uint16_t sensor_id; + uint16_t sensor_id_mask; +}; + +struct msm_sensor_init_params { + int modes_supported; + unsigned int sensor_mount_angle; +}; + +enum msm_sensor_camera_id_t { + CAMERA_0, + CAMERA_1, + CAMERA_2, + CAMERA_3, + CAMERA_4, + CAMERA_5, + CAMERA_6, + MAX_CAMERAS, +}; + +struct msm_sensor_id_info_t { + unsigned short sensor_id_reg_addr; + unsigned short sensor_id; + unsigned short sensor_id_mask; +}; + +enum msm_sensor_output_format_t { + MSM_SENSOR_BAYER, + MSM_SENSOR_YCBCR, + MSM_SENSOR_META, +}; + +struct cam_sensor_power_setting { + enum msm_camera_power_seq_type seq_type; + unsigned short seq_val; + long config_val; + unsigned short delay; + void *data[10]; +}; + +struct cam_sensor_board_info { + struct cam_camera_slave_info slave_info; + int32_t sensor_mount_angle; + int32_t secure_mode; + int modes_supported; + int32_t pos_roll; + int32_t pos_yaw; + int32_t pos_pitch; + int32_t subdev_id[SUB_MODULE_MAX]; + int32_t subdev_intf[SUB_MODULE_MAX]; + const char *misc_regulator; + struct cam_sensor_power_ctrl_t power_info; +}; + +enum msm_camera_vreg_name_t { + CAM_VDIG, + CAM_VIO, + CAM_VANA, + CAM_VAF, + CAM_V_CUSTOM1, + CAM_V_CUSTOM2, + CAM_VREG_MAX, +}; + +struct msm_camera_gpio_conf { + void *cam_gpiomux_conf_tbl; + uint8_t cam_gpiomux_conf_tbl_size; + struct gpio *cam_gpio_common_tbl; + uint8_t cam_gpio_common_tbl_size; + struct gpio *cam_gpio_req_tbl; + uint8_t cam_gpio_req_tbl_size; + uint32_t gpio_no_mux; + uint32_t *camera_off_table; + uint8_t camera_off_table_size; + uint32_t *camera_on_table; + uint8_t camera_on_table_size; + struct msm_camera_gpio_num_info *gpio_num_info; +}; + +/*for tof camera Begin*/ +enum EEPROM_DATA_OP_T{ + EEPROM_DEFAULT_DATA = 0, + EEPROM_INIT_DATA, + EEPROM_CONFIG_DATA, + EEPROM_STREAMON_DATA, + EEPROM_STREAMOFF_DATA, + EEPROM_OTHER_DATA, +}; +/*for tof camera End*/ +#endif /* _CAM_SENSOR_CMN_HEADER_ */ diff --git a/selfdrive/camerad/include/media/cam_sync.h b/selfdrive/camerad/include/media/cam_sync.h new file mode 100644 index 000000000..4a8781fc8 --- /dev/null +++ b/selfdrive/camerad/include/media/cam_sync.h @@ -0,0 +1,134 @@ +#ifndef __UAPI_CAM_SYNC_H__ +#define __UAPI_CAM_SYNC_H__ + +#include +#include +#include +#include + +#define CAM_SYNC_DEVICE_NAME "cam_sync_device" + +/* V4L event which user space will subscribe to */ +#define CAM_SYNC_V4L_EVENT (V4L2_EVENT_PRIVATE_START + 0) + +/* Specific event ids to get notified in user space */ +#define CAM_SYNC_V4L_EVENT_ID_CB_TRIG 0 + +/* Size of opaque payload sent to kernel for safekeeping until signal time */ +#define CAM_SYNC_USER_PAYLOAD_SIZE 2 + +/* Device type for sync device needed for device discovery */ +#define CAM_SYNC_DEVICE_TYPE (MEDIA_ENT_F_OLD_BASE) + +#define CAM_SYNC_GET_PAYLOAD_PTR(ev, type) \ + (type *)((char *)ev.u.data + sizeof(struct cam_sync_ev_header)) + +#define CAM_SYNC_GET_HEADER_PTR(ev) \ + ((struct cam_sync_ev_header *)ev.u.data) + +#define CAM_SYNC_STATE_INVALID 0 +#define CAM_SYNC_STATE_ACTIVE 1 +#define CAM_SYNC_STATE_SIGNALED_SUCCESS 2 +#define CAM_SYNC_STATE_SIGNALED_ERROR 3 + +/** + * struct cam_sync_ev_header - Event header for sync event notification + * + * @sync_obj: Sync object + * @status: Status of the object + */ +struct cam_sync_ev_header { + int32_t sync_obj; + int32_t status; +}; + +/** + * struct cam_sync_info - Sync object creation information + * + * @name: Optional string representation of the sync object + * @sync_obj: Sync object returned after creation in kernel + */ +struct cam_sync_info { + char name[64]; + int32_t sync_obj; +}; + +/** + * struct cam_sync_signal - Sync object signaling struct + * + * @sync_obj: Sync object to be signaled + * @sync_state: State of the sync object to which it should be signaled + */ +struct cam_sync_signal { + int32_t sync_obj; + uint32_t sync_state; +}; + +/** + * struct cam_sync_merge - Merge information for sync objects + * + * @sync_objs: Pointer to sync objects + * @num_objs: Number of objects in the array + * @merged: Merged sync object + */ +struct cam_sync_merge { + __u64 sync_objs; + uint32_t num_objs; + int32_t merged; +}; + +/** + * struct cam_sync_userpayload_info - Payload info from user space + * + * @sync_obj: Sync object for which payload has to be registered for + * @reserved: Reserved + * @payload: Pointer to user payload + */ +struct cam_sync_userpayload_info { + int32_t sync_obj; + uint32_t reserved; + __u64 payload[CAM_SYNC_USER_PAYLOAD_SIZE]; +}; + +/** + * struct cam_sync_wait - Sync object wait information + * + * @sync_obj: Sync object to wait on + * @reserved: Reserved + * @timeout_ms: Timeout in milliseconds + */ +struct cam_sync_wait { + int32_t sync_obj; + uint32_t reserved; + uint64_t timeout_ms; +}; + +/** + * struct cam_private_ioctl_arg - Sync driver ioctl argument + * + * @id: IOCTL command id + * @size: Size of command payload + * @result: Result of command execution + * @reserved: Reserved + * @ioctl_ptr: Pointer to user data + */ +struct cam_private_ioctl_arg { + __u32 id; + __u32 size; + __u32 result; + __u32 reserved; + __u64 ioctl_ptr; +}; + +#define CAM_PRIVATE_IOCTL_CMD \ + _IOWR('V', BASE_VIDIOC_PRIVATE, struct cam_private_ioctl_arg) + +#define CAM_SYNC_CREATE 0 +#define CAM_SYNC_DESTROY 1 +#define CAM_SYNC_SIGNAL 2 +#define CAM_SYNC_MERGE 3 +#define CAM_SYNC_REGISTER_PAYLOAD 4 +#define CAM_SYNC_DEREGISTER_PAYLOAD 5 +#define CAM_SYNC_WAIT 6 + +#endif /* __UAPI_CAM_SYNC_H__ */ diff --git a/selfdrive/camerad/include/msm_cam_sensor.h b/selfdrive/camerad/include/msm_cam_sensor.h new file mode 100644 index 000000000..c75d1fd52 --- /dev/null +++ b/selfdrive/camerad/include/msm_cam_sensor.h @@ -0,0 +1,829 @@ +#ifndef __LINUX_MSM_CAM_SENSOR_H +#define __LINUX_MSM_CAM_SENSOR_H + +#ifdef MSM_CAMERA_BIONIC +#include +#endif + +//#include +#include "msm_camsensor_sdk.h" + +#include +#include +#ifdef CONFIG_COMPAT +#include +#endif + +#define I2C_SEQ_REG_SETTING_MAX 5 + +#define MSM_SENSOR_MCLK_8HZ 8000000 +#define MSM_SENSOR_MCLK_16HZ 16000000 +#define MSM_SENSOR_MCLK_24HZ 24000000 + +#define MAX_SENSOR_NAME 32 +#define MAX_ACTUATOR_AF_TOTAL_STEPS 1024 + +#define MAX_OIS_MOD_NAME_SIZE 32 +#define MAX_OIS_NAME_SIZE 32 +#define MAX_OIS_REG_SETTINGS 800 + +#define MOVE_NEAR 0 +#define MOVE_FAR 1 + +#define MSM_ACTUATOR_MOVE_SIGNED_FAR -1 +#define MSM_ACTUATOR_MOVE_SIGNED_NEAR 1 + +#define MAX_ACTUATOR_REGION 5 + +#define MAX_EEPROM_NAME 32 + +#define MAX_AF_ITERATIONS 3 +#define MAX_NUMBER_OF_STEPS 47 +#define MAX_REGULATOR 5 + +#define MSM_V4L2_PIX_FMT_META v4l2_fourcc('M', 'E', 'T', 'A') /* META */ +#define MSM_V4L2_PIX_FMT_SBGGR14 v4l2_fourcc('B', 'G', '1', '4') + /* 14 BGBG.. GRGR.. */ +#define MSM_V4L2_PIX_FMT_SGBRG14 v4l2_fourcc('G', 'B', '1', '4') + /* 14 GBGB.. RGRG.. */ +#define MSM_V4L2_PIX_FMT_SGRBG14 v4l2_fourcc('B', 'A', '1', '4') + /* 14 GRGR.. BGBG.. */ +#define MSM_V4L2_PIX_FMT_SRGGB14 v4l2_fourcc('R', 'G', '1', '4') + /* 14 RGRG.. GBGB.. */ + +enum flash_type { + LED_FLASH = 1, + STROBE_FLASH, + GPIO_FLASH +}; + +enum msm_sensor_resolution_t { + MSM_SENSOR_RES_FULL, + MSM_SENSOR_RES_QTR, + MSM_SENSOR_RES_2, + MSM_SENSOR_RES_3, + MSM_SENSOR_RES_4, + MSM_SENSOR_RES_5, + MSM_SENSOR_RES_6, + MSM_SENSOR_RES_7, + MSM_SENSOR_INVALID_RES, +}; + +enum msm_camera_stream_type_t { + MSM_CAMERA_STREAM_PREVIEW, + MSM_CAMERA_STREAM_SNAPSHOT, + MSM_CAMERA_STREAM_VIDEO, + MSM_CAMERA_STREAM_INVALID, +}; + +enum sensor_sub_module_t { + SUB_MODULE_SENSOR, + SUB_MODULE_CHROMATIX, + SUB_MODULE_ACTUATOR, + SUB_MODULE_EEPROM, + SUB_MODULE_LED_FLASH, + SUB_MODULE_STROBE_FLASH, + SUB_MODULE_CSID, + SUB_MODULE_CSID_3D, + SUB_MODULE_CSIPHY, + SUB_MODULE_CSIPHY_3D, + SUB_MODULE_OIS, + SUB_MODULE_EXT, + SUB_MODULE_MAX, +}; + +enum { + MSM_CAMERA_EFFECT_MODE_OFF, + MSM_CAMERA_EFFECT_MODE_MONO, + MSM_CAMERA_EFFECT_MODE_NEGATIVE, + MSM_CAMERA_EFFECT_MODE_SOLARIZE, + MSM_CAMERA_EFFECT_MODE_SEPIA, + MSM_CAMERA_EFFECT_MODE_POSTERIZE, + MSM_CAMERA_EFFECT_MODE_WHITEBOARD, + MSM_CAMERA_EFFECT_MODE_BLACKBOARD, + MSM_CAMERA_EFFECT_MODE_AQUA, + MSM_CAMERA_EFFECT_MODE_EMBOSS, + MSM_CAMERA_EFFECT_MODE_SKETCH, + MSM_CAMERA_EFFECT_MODE_NEON, + MSM_CAMERA_EFFECT_MODE_MAX +}; + +enum { + MSM_CAMERA_WB_MODE_AUTO, + MSM_CAMERA_WB_MODE_CUSTOM, + MSM_CAMERA_WB_MODE_INCANDESCENT, + MSM_CAMERA_WB_MODE_FLUORESCENT, + MSM_CAMERA_WB_MODE_WARM_FLUORESCENT, + MSM_CAMERA_WB_MODE_DAYLIGHT, + MSM_CAMERA_WB_MODE_CLOUDY_DAYLIGHT, + MSM_CAMERA_WB_MODE_TWILIGHT, + MSM_CAMERA_WB_MODE_SHADE, + MSM_CAMERA_WB_MODE_OFF, + MSM_CAMERA_WB_MODE_MAX +}; + +enum { + MSM_CAMERA_SCENE_MODE_OFF, + MSM_CAMERA_SCENE_MODE_AUTO, + MSM_CAMERA_SCENE_MODE_LANDSCAPE, + MSM_CAMERA_SCENE_MODE_SNOW, + MSM_CAMERA_SCENE_MODE_BEACH, + MSM_CAMERA_SCENE_MODE_SUNSET, + MSM_CAMERA_SCENE_MODE_NIGHT, + MSM_CAMERA_SCENE_MODE_PORTRAIT, + MSM_CAMERA_SCENE_MODE_BACKLIGHT, + MSM_CAMERA_SCENE_MODE_SPORTS, + MSM_CAMERA_SCENE_MODE_ANTISHAKE, + MSM_CAMERA_SCENE_MODE_FLOWERS, + MSM_CAMERA_SCENE_MODE_CANDLELIGHT, + MSM_CAMERA_SCENE_MODE_FIREWORKS, + MSM_CAMERA_SCENE_MODE_PARTY, + MSM_CAMERA_SCENE_MODE_NIGHT_PORTRAIT, + MSM_CAMERA_SCENE_MODE_THEATRE, + MSM_CAMERA_SCENE_MODE_ACTION, + MSM_CAMERA_SCENE_MODE_AR, + MSM_CAMERA_SCENE_MODE_FACE_PRIORITY, + MSM_CAMERA_SCENE_MODE_BARCODE, + MSM_CAMERA_SCENE_MODE_HDR, + MSM_CAMERA_SCENE_MODE_MAX +}; + +enum csid_cfg_type_t { + CSID_INIT, + CSID_CFG, + CSID_TESTMODE_CFG, + CSID_RELEASE, +}; + +enum csiphy_cfg_type_t { + CSIPHY_INIT, + CSIPHY_CFG, + CSIPHY_RELEASE, +}; + +enum camera_vreg_type { + VREG_TYPE_DEFAULT, + VREG_TYPE_CUSTOM, +}; + +enum sensor_af_t { + SENSOR_AF_FOCUSSED, + SENSOR_AF_NOT_FOCUSSED, +}; + +enum cci_i2c_master_t { + MASTER_0, + MASTER_1, + MASTER_MAX, +}; + +struct msm_camera_i2c_array_write_config { + struct msm_camera_i2c_reg_setting conf_array; + uint16_t slave_addr; +}; + +struct msm_camera_i2c_read_config { + uint16_t slave_addr; + uint16_t reg_addr; + enum msm_camera_i2c_reg_addr_type addr_type; + enum msm_camera_i2c_data_type data_type; + uint16_t data; +}; + +struct msm_camera_csi2_params { + struct msm_camera_csid_params csid_params; + struct msm_camera_csiphy_params csiphy_params; + uint8_t csi_clk_scale_enable; +}; + +struct msm_camera_csi_lane_params { + uint16_t csi_lane_assign; + uint16_t csi_lane_mask; +}; + +struct csi_lane_params_t { + uint16_t csi_lane_assign; + uint8_t csi_lane_mask; + uint8_t csi_if; + int8_t csid_core[2]; + uint8_t csi_phy_sel; +}; + +struct msm_sensor_info_t { + char sensor_name[MAX_SENSOR_NAME]; + uint32_t session_id; + int32_t subdev_id[SUB_MODULE_MAX]; + int32_t subdev_intf[SUB_MODULE_MAX]; + uint8_t is_mount_angle_valid; + uint32_t sensor_mount_angle; + int modes_supported; + enum camb_position_t position; +}; + +struct camera_vreg_t { + const char *reg_name; + int min_voltage; + int max_voltage; + int op_mode; + uint32_t delay; + const char *custom_vreg_name; + enum camera_vreg_type type; +}; + +struct sensorb_cfg_data { + int cfgtype; + union { + struct msm_sensor_info_t sensor_info; + struct msm_sensor_init_params sensor_init_params; + void *setting; + struct msm_sensor_i2c_sync_params sensor_i2c_sync_params; + } cfg; +}; + +struct csid_cfg_data { + enum csid_cfg_type_t cfgtype; + union { + uint32_t csid_version; + struct msm_camera_csid_params *csid_params; + struct msm_camera_csid_testmode_parms *csid_testmode_params; + } cfg; +}; + +struct csiphy_cfg_data { + enum csiphy_cfg_type_t cfgtype; + union { + struct msm_camera_csiphy_params *csiphy_params; + struct msm_camera_csi_lane_params *csi_lane_params; + } cfg; +}; + +enum eeprom_cfg_type_t { + CFG_EEPROM_GET_INFO, + CFG_EEPROM_GET_CAL_DATA, + CFG_EEPROM_READ_CAL_DATA, + CFG_EEPROM_WRITE_DATA, + CFG_EEPROM_GET_MM_INFO, + CFG_EEPROM_INIT, +}; + +struct eeprom_get_t { + uint32_t num_bytes; +}; + +struct eeprom_read_t { + uint8_t *dbuffer; + uint32_t num_bytes; +}; + +struct eeprom_write_t { + uint8_t *dbuffer; + uint32_t num_bytes; +}; + +struct eeprom_get_cmm_t { + uint32_t cmm_support; + uint32_t cmm_compression; + uint32_t cmm_size; +}; + +struct msm_eeprom_info_t { + struct msm_sensor_power_setting_array *power_setting_array; + enum i2c_freq_mode_t i2c_freq_mode; + struct msm_eeprom_memory_map_array *mem_map_array; +}; + +struct msm_eeprom_cfg_data { + enum eeprom_cfg_type_t cfgtype; + uint8_t is_supported; + union { + char eeprom_name[MAX_SENSOR_NAME]; + struct eeprom_get_t get_data; + struct eeprom_read_t read_data; + struct eeprom_write_t write_data; + struct eeprom_get_cmm_t get_cmm_data; + struct msm_eeprom_info_t eeprom_info; + } cfg; +}; + +#ifdef CONFIG_COMPAT +struct msm_sensor_power_setting32 { + enum msm_sensor_power_seq_type_t seq_type; + uint16_t seq_val; + compat_uint_t config_val; + uint16_t delay; + compat_uptr_t data[10]; +}; + +struct msm_sensor_power_setting_array32 { + struct msm_sensor_power_setting32 power_setting_a[MAX_POWER_CONFIG]; + compat_uptr_t power_setting; + uint16_t size; + struct msm_sensor_power_setting32 + power_down_setting_a[MAX_POWER_CONFIG]; + compat_uptr_t power_down_setting; + uint16_t size_down; +}; + +struct msm_camera_sensor_slave_info32 { + char sensor_name[32]; + char eeprom_name[32]; + char actuator_name[32]; + char ois_name[32]; + char flash_name[32]; + enum msm_sensor_camera_id_t camera_id; + uint16_t slave_addr; + enum i2c_freq_mode_t i2c_freq_mode; + enum msm_camera_i2c_reg_addr_type addr_type; + struct msm_sensor_id_info_t sensor_id_info; + struct msm_sensor_power_setting_array32 power_setting_array; + uint8_t is_init_params_valid; + struct msm_sensor_init_params sensor_init_params; + enum msm_sensor_output_format_t output_format; +}; + +struct msm_camera_csid_lut_params32 { + uint8_t num_cid; + struct msm_camera_csid_vc_cfg vc_cfg_a[MAX_CID]; + compat_uptr_t vc_cfg[MAX_CID]; +}; + +struct msm_camera_csid_params32 { + uint8_t lane_cnt; + uint16_t lane_assign; + uint8_t phy_sel; + uint32_t csi_clk; + struct msm_camera_csid_lut_params32 lut_params; + uint8_t csi_3p_sel; +}; + +struct msm_camera_csi2_params32 { + struct msm_camera_csid_params32 csid_params; + struct msm_camera_csiphy_params csiphy_params; + uint8_t csi_clk_scale_enable; +}; + +struct csid_cfg_data32 { + enum csid_cfg_type_t cfgtype; + union { + uint32_t csid_version; + compat_uptr_t csid_params; + compat_uptr_t csid_testmode_params; + } cfg; +}; + +struct eeprom_read_t32 { + compat_uptr_t dbuffer; + uint32_t num_bytes; +}; + +struct eeprom_write_t32 { + compat_uptr_t dbuffer; + uint32_t num_bytes; +}; + +struct msm_eeprom_info_t32 { + compat_uptr_t power_setting_array; + enum i2c_freq_mode_t i2c_freq_mode; + compat_uptr_t mem_map_array; +}; + +struct msm_eeprom_cfg_data32 { + enum eeprom_cfg_type_t cfgtype; + uint8_t is_supported; + union { + char eeprom_name[MAX_SENSOR_NAME]; + struct eeprom_get_t get_data; + struct eeprom_read_t32 read_data; + struct eeprom_write_t32 write_data; + struct msm_eeprom_info_t32 eeprom_info; + } cfg; +}; + +struct msm_camera_i2c_seq_reg_setting32 { + compat_uptr_t reg_setting; + uint16_t size; + enum msm_camera_i2c_reg_addr_type addr_type; + uint16_t delay; +}; +#endif + +enum msm_sensor_cfg_type_t { + CFG_SET_SLAVE_INFO, + CFG_SLAVE_READ_I2C, + CFG_WRITE_I2C_ARRAY, + CFG_SLAVE_WRITE_I2C_ARRAY, + CFG_WRITE_I2C_SEQ_ARRAY, + CFG_POWER_UP, + CFG_POWER_DOWN, + CFG_SET_STOP_STREAM_SETTING, + CFG_GET_SENSOR_INFO, + CFG_GET_SENSOR_INIT_PARAMS, + CFG_SET_INIT_SETTING, + CFG_SET_RESOLUTION, + CFG_SET_STOP_STREAM, + CFG_SET_START_STREAM, + CFG_SET_SATURATION, + CFG_SET_CONTRAST, + CFG_SET_SHARPNESS, + CFG_SET_ISO, + CFG_SET_EXPOSURE_COMPENSATION, + CFG_SET_ANTIBANDING, + CFG_SET_BESTSHOT_MODE, + CFG_SET_EFFECT, + CFG_SET_WHITE_BALANCE, + CFG_SET_AUTOFOCUS, + CFG_CANCEL_AUTOFOCUS, + CFG_SET_STREAM_TYPE, + CFG_SET_I2C_SYNC_PARAM, + CFG_WRITE_I2C_ARRAY_ASYNC, + CFG_WRITE_I2C_ARRAY_SYNC, + CFG_WRITE_I2C_ARRAY_SYNC_BLOCK, +}; + +enum msm_actuator_cfg_type_t { + CFG_GET_ACTUATOR_INFO, + CFG_SET_ACTUATOR_INFO, + CFG_SET_DEFAULT_FOCUS, + CFG_MOVE_FOCUS, + CFG_SET_POSITION, + CFG_ACTUATOR_POWERDOWN, + CFG_ACTUATOR_POWERUP, + CFG_ACTUATOR_INIT, +}; + +enum msm_ois_cfg_type_t { + CFG_OIS_INIT, + CFG_OIS_POWERDOWN, + CFG_OIS_POWERUP, + CFG_OIS_CONTROL, + CFG_OIS_I2C_WRITE_SEQ_TABLE, +}; + +enum msm_ois_i2c_operation { + MSM_OIS_WRITE = 0, + MSM_OIS_POLL, +}; + +struct reg_settings_ois_t { + uint16_t reg_addr; + enum msm_camera_i2c_reg_addr_type addr_type; + uint32_t reg_data; + enum msm_camera_i2c_data_type data_type; + enum msm_ois_i2c_operation i2c_operation; + uint32_t delay; +#define OIS_REG_DATA_SEQ_MAX 128 + unsigned char reg_data_seq[OIS_REG_DATA_SEQ_MAX]; + uint32_t reg_data_seq_size; +}; + +struct msm_ois_params_t { + uint16_t data_size; + uint16_t setting_size; + uint32_t i2c_addr; + enum i2c_freq_mode_t i2c_freq_mode; + enum msm_camera_i2c_reg_addr_type i2c_addr_type; + enum msm_camera_i2c_data_type i2c_data_type; + struct reg_settings_ois_t *settings; +}; + +struct msm_ois_set_info_t { + struct msm_ois_params_t ois_params; +}; + +struct msm_actuator_move_params_t { + int8_t dir; + int8_t sign_dir; + int16_t dest_step_pos; + int32_t num_steps; + uint16_t curr_lens_pos; + struct damping_params_t *ringing_params; +}; + +struct msm_actuator_tuning_params_t { + int16_t initial_code; + uint16_t pwd_step; + uint16_t region_size; + uint32_t total_steps; + struct region_params_t *region_params; +}; + +struct park_lens_data_t { + uint32_t damping_step; + uint32_t damping_delay; + uint32_t hw_params; + uint32_t max_step; +}; + +struct msm_actuator_params_t { + enum actuator_type act_type; + uint8_t reg_tbl_size; + uint16_t data_size; + uint16_t init_setting_size; + uint32_t i2c_addr; + enum i2c_freq_mode_t i2c_freq_mode; + enum msm_actuator_addr_type i2c_addr_type; + enum msm_actuator_data_type i2c_data_type; + struct msm_actuator_reg_params_t *reg_tbl_params; + struct reg_settings_t *init_settings; + struct park_lens_data_t park_lens; +}; + +struct msm_actuator_set_info_t { + struct msm_actuator_params_t actuator_params; + struct msm_actuator_tuning_params_t af_tuning_params; +}; + +struct msm_actuator_get_info_t { + uint32_t focal_length_num; + uint32_t focal_length_den; + uint32_t f_number_num; + uint32_t f_number_den; + uint32_t f_pix_num; + uint32_t f_pix_den; + uint32_t total_f_dist_num; + uint32_t total_f_dist_den; + uint32_t hor_view_angle_num; + uint32_t hor_view_angle_den; + uint32_t ver_view_angle_num; + uint32_t ver_view_angle_den; +}; + +enum af_camera_name { + ACTUATOR_MAIN_CAM_0, + ACTUATOR_MAIN_CAM_1, + ACTUATOR_MAIN_CAM_2, + ACTUATOR_MAIN_CAM_3, + ACTUATOR_MAIN_CAM_4, + ACTUATOR_MAIN_CAM_5, + ACTUATOR_WEB_CAM_0, + ACTUATOR_WEB_CAM_1, + ACTUATOR_WEB_CAM_2, +}; + +struct msm_ois_cfg_data { + int cfgtype; + union { + struct msm_ois_set_info_t set_info; + struct msm_camera_i2c_seq_reg_setting *settings; + } cfg; +}; + +struct msm_actuator_set_position_t { + uint16_t number_of_steps; + uint32_t hw_params; + uint16_t pos[MAX_NUMBER_OF_STEPS]; + uint16_t delay[MAX_NUMBER_OF_STEPS]; +}; + +struct msm_actuator_cfg_data { + int cfgtype; + uint8_t is_af_supported; + union { + struct msm_actuator_move_params_t move; + struct msm_actuator_set_info_t set_info; + struct msm_actuator_get_info_t get_info; + struct msm_actuator_set_position_t setpos; + enum af_camera_name cam_name; + } cfg; +}; + +enum msm_camera_led_config_t { + MSM_CAMERA_LED_OFF, + MSM_CAMERA_LED_LOW, + MSM_CAMERA_LED_HIGH, + MSM_CAMERA_LED_INIT, + MSM_CAMERA_LED_RELEASE, +}; + +struct msm_camera_led_cfg_t { + enum msm_camera_led_config_t cfgtype; + int32_t torch_current[MAX_LED_TRIGGERS]; + int32_t flash_current[MAX_LED_TRIGGERS]; + int32_t flash_duration[MAX_LED_TRIGGERS]; +}; + +struct msm_flash_init_info_t { + enum msm_flash_driver_type flash_driver_type; + uint32_t slave_addr; + enum i2c_freq_mode_t i2c_freq_mode; + struct msm_sensor_power_setting_array *power_setting_array; + struct msm_camera_i2c_reg_setting_array *settings; +}; + +struct msm_flash_cfg_data_t { + enum msm_flash_cfg_type_t cfg_type; + int32_t flash_current[MAX_LED_TRIGGERS]; + int32_t flash_duration[MAX_LED_TRIGGERS]; + union { + struct msm_flash_init_info_t *flash_init_info; + struct msm_camera_i2c_reg_setting_array *settings; + } cfg; +}; + +/* sensor init structures and enums */ +enum msm_sensor_init_cfg_type_t { + CFG_SINIT_PROBE, + CFG_SINIT_PROBE_DONE, + CFG_SINIT_PROBE_WAIT_DONE, +}; + +struct sensor_init_cfg_data { + enum msm_sensor_init_cfg_type_t cfgtype; + struct msm_sensor_info_t probed_info; + char entity_name[MAX_SENSOR_NAME]; + union { + void *setting; + } cfg; +}; + +#define VIDIOC_MSM_SENSOR_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct sensorb_cfg_data) + +#define VIDIOC_MSM_SENSOR_RELEASE \ + _IO('V', BASE_VIDIOC_PRIVATE + 2) + +#define VIDIOC_MSM_SENSOR_GET_SUBDEV_ID \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 3, uint32_t) + +#define VIDIOC_MSM_CSIPHY_IO_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct csiphy_cfg_data) + +#define VIDIOC_MSM_CSID_IO_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct csid_cfg_data) + +#define VIDIOC_MSM_ACTUATOR_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct msm_actuator_cfg_data) + +#define VIDIOC_MSM_FLASH_LED_DATA_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 7, struct msm_camera_led_cfg_t) + +#define VIDIOC_MSM_EEPROM_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 8, struct msm_eeprom_cfg_data) + +#define VIDIOC_MSM_SENSOR_GET_AF_STATUS \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 9, uint32_t) + +#define VIDIOC_MSM_SENSOR_INIT_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 10, struct sensor_init_cfg_data) + +#define VIDIOC_MSM_OIS_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 11, struct msm_ois_cfg_data) + +#define VIDIOC_MSM_FLASH_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 13, struct msm_flash_cfg_data_t) + +#ifdef CONFIG_COMPAT +struct msm_camera_i2c_reg_setting32 { + compat_uptr_t reg_setting; + uint16_t size; + enum msm_camera_i2c_reg_addr_type addr_type; + enum msm_camera_i2c_data_type data_type; + uint16_t delay; +}; + +struct msm_camera_i2c_array_write_config32 { + struct msm_camera_i2c_reg_setting32 conf_array; + uint16_t slave_addr; +}; + +struct msm_actuator_tuning_params_t32 { + int16_t initial_code; + uint16_t pwd_step; + uint16_t region_size; + uint32_t total_steps; + compat_uptr_t region_params; +}; + +struct msm_actuator_params_t32 { + enum actuator_type act_type; + uint8_t reg_tbl_size; + uint16_t data_size; + uint16_t init_setting_size; + uint32_t i2c_addr; + enum i2c_freq_mode_t i2c_freq_mode; + enum msm_actuator_addr_type i2c_addr_type; + enum msm_actuator_data_type i2c_data_type; + compat_uptr_t reg_tbl_params; + compat_uptr_t init_settings; + struct park_lens_data_t park_lens; +}; + +struct msm_actuator_set_info_t32 { + struct msm_actuator_params_t32 actuator_params; + struct msm_actuator_tuning_params_t32 af_tuning_params; +}; + +struct sensor_init_cfg_data32 { + enum msm_sensor_init_cfg_type_t cfgtype; + struct msm_sensor_info_t probed_info; + char entity_name[MAX_SENSOR_NAME]; + union { + compat_uptr_t setting; + } cfg; +}; + +struct msm_actuator_move_params_t32 { + int8_t dir; + int8_t sign_dir; + int16_t dest_step_pos; + int32_t num_steps; + uint16_t curr_lens_pos; + compat_uptr_t ringing_params; +}; + +struct msm_actuator_cfg_data32 { + int cfgtype; + uint8_t is_af_supported; + union { + struct msm_actuator_move_params_t32 move; + struct msm_actuator_set_info_t32 set_info; + struct msm_actuator_get_info_t get_info; + struct msm_actuator_set_position_t setpos; + enum af_camera_name cam_name; + } cfg; +}; + +struct csiphy_cfg_data32 { + enum csiphy_cfg_type_t cfgtype; + union { + compat_uptr_t csiphy_params; + compat_uptr_t csi_lane_params; + } cfg; +}; + +struct sensorb_cfg_data32 { + int cfgtype; + union { + struct msm_sensor_info_t sensor_info; + struct msm_sensor_init_params sensor_init_params; + compat_uptr_t setting; + struct msm_sensor_i2c_sync_params sensor_i2c_sync_params; + } cfg; +}; + +struct msm_ois_params_t32 { + uint16_t data_size; + uint16_t setting_size; + uint32_t i2c_addr; + enum i2c_freq_mode_t i2c_freq_mode; + enum msm_camera_i2c_reg_addr_type i2c_addr_type; + enum msm_camera_i2c_data_type i2c_data_type; + compat_uptr_t settings; +}; + +struct msm_ois_set_info_t32 { + struct msm_ois_params_t32 ois_params; +}; + +struct msm_ois_cfg_data32 { + int cfgtype; + union { + struct msm_ois_set_info_t32 set_info; + compat_uptr_t settings; + } cfg; +}; + +struct msm_flash_init_info_t32 { + enum msm_flash_driver_type flash_driver_type; + uint32_t slave_addr; + enum i2c_freq_mode_t i2c_freq_mode; + compat_uptr_t power_setting_array; + compat_uptr_t settings; +}; + +struct msm_flash_cfg_data_t32 { + enum msm_flash_cfg_type_t cfg_type; + int32_t flash_current[MAX_LED_TRIGGERS]; + int32_t flash_duration[MAX_LED_TRIGGERS]; + union { + compat_uptr_t flash_init_info; + compat_uptr_t settings; + } cfg; +}; + +#define VIDIOC_MSM_ACTUATOR_CFG32 \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct msm_actuator_cfg_data32) + +#define VIDIOC_MSM_SENSOR_INIT_CFG32 \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 10, struct sensor_init_cfg_data32) + +#define VIDIOC_MSM_CSIPHY_IO_CFG32 \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct csiphy_cfg_data32) + +#define VIDIOC_MSM_SENSOR_CFG32 \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct sensorb_cfg_data32) + +#define VIDIOC_MSM_EEPROM_CFG32 \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 8, struct msm_eeprom_cfg_data32) + +#define VIDIOC_MSM_OIS_CFG32 \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 11, struct msm_ois_cfg_data32) + +#define VIDIOC_MSM_CSID_IO_CFG32 \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct csid_cfg_data32) + +#define VIDIOC_MSM_FLASH_CFG32 \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 13, struct msm_flash_cfg_data_t32) +#endif + +#endif /* __LINUX_MSM_CAM_SENSOR_H */ diff --git a/selfdrive/camerad/include/msm_camsensor_sdk.h b/selfdrive/camerad/include/msm_camsensor_sdk.h new file mode 100644 index 000000000..62a4da253 --- /dev/null +++ b/selfdrive/camerad/include/msm_camsensor_sdk.h @@ -0,0 +1,386 @@ +#ifndef __LINUX_MSM_CAMSENSOR_SDK_H +#define __LINUX_MSM_CAMSENSOR_SDK_H + +#define KVERSION 0x1 + +#define MAX_POWER_CONFIG 12 +#define GPIO_OUT_LOW (0 << 1) +#define GPIO_OUT_HIGH (1 << 1) +#define CSI_EMBED_DATA 0x12 +#define CSI_RESERVED_DATA_0 0x13 +#define CSI_YUV422_8 0x1E +#define CSI_RAW8 0x2A +#define CSI_RAW10 0x2B +#define CSI_RAW12 0x2C +#define CSI_DECODE_6BIT 0 +#define CSI_DECODE_8BIT 1 +#define CSI_DECODE_10BIT 2 +#define CSI_DECODE_12BIT 3 +#define CSI_DECODE_DPCM_10_8_10 5 +#define MAX_CID 16 +#define I2C_SEQ_REG_DATA_MAX 1024 +#define I2C_REG_DATA_MAX (8*1024) + +#define MSM_V4L2_PIX_FMT_META v4l2_fourcc('M', 'E', 'T', 'A') /* META */ +#define MSM_V4L2_PIX_FMT_SBGGR14 v4l2_fourcc('B', 'G', '1', '4') + /* 14 BGBG.. GRGR.. */ +#define MSM_V4L2_PIX_FMT_SGBRG14 v4l2_fourcc('G', 'B', '1', '4') + /* 14 GBGB.. RGRG.. */ +#define MSM_V4L2_PIX_FMT_SGRBG14 v4l2_fourcc('B', 'A', '1', '4') + /* 14 GRGR.. BGBG.. */ +#define MSM_V4L2_PIX_FMT_SRGGB14 v4l2_fourcc('R', 'G', '1', '4') + /* 14 RGRG.. GBGB.. */ + +#define MAX_ACTUATOR_REG_TBL_SIZE 8 +#define MAX_ACTUATOR_REGION 5 +#define NUM_ACTUATOR_DIR 2 +#define MAX_ACTUATOR_SCENARIO 8 +#define MAX_ACT_MOD_NAME_SIZE 32 +#define MAX_ACT_NAME_SIZE 32 +#define MAX_ACTUATOR_INIT_SET 120 +#define MAX_I2C_REG_SET 12 + +#define MAX_LED_TRIGGERS 3 + +#define MSM_EEPROM_MEMORY_MAP_MAX_SIZE 80 +#define MSM_EEPROM_MAX_MEM_MAP_CNT 8 + +enum msm_sensor_camera_id_t { + CAMERA_0, + CAMERA_1, + CAMERA_2, + CAMERA_3, + MAX_CAMERAS, +}; + +enum i2c_freq_mode_t { + I2C_STANDARD_MODE, + I2C_FAST_MODE, + I2C_CUSTOM_MODE, + I2C_FAST_PLUS_MODE, + I2C_MAX_MODES, +}; + +enum camb_position_t { + BACK_CAMERA_B, + FRONT_CAMERA_B, + AUX_CAMERA_B = 0x100, + INVALID_CAMERA_B, +}; + +enum msm_sensor_power_seq_type_t { + SENSOR_CLK, + SENSOR_GPIO, + SENSOR_VREG, + SENSOR_I2C_MUX, + SENSOR_I2C, +}; + +enum msm_camera_i2c_reg_addr_type { + MSM_CAMERA_I2C_BYTE_ADDR = 1, + MSM_CAMERA_I2C_WORD_ADDR, + MSM_CAMERA_I2C_3B_ADDR, + MSM_CAMERA_I2C_ADDR_TYPE_MAX, +}; + +enum msm_camera_i2c_data_type { + MSM_CAMERA_I2C_BYTE_DATA = 1, + MSM_CAMERA_I2C_WORD_DATA, + MSM_CAMERA_I2C_DWORD_DATA, + MSM_CAMERA_I2C_SET_BYTE_MASK, + MSM_CAMERA_I2C_UNSET_BYTE_MASK, + MSM_CAMERA_I2C_SET_WORD_MASK, + MSM_CAMERA_I2C_UNSET_WORD_MASK, + MSM_CAMERA_I2C_SET_BYTE_WRITE_MASK_DATA, + MSM_CAMERA_I2C_SEQ_DATA, + MSM_CAMERA_I2C_DATA_TYPE_MAX, +}; + +enum msm_sensor_power_seq_gpio_t { + SENSOR_GPIO_RESET, + SENSOR_GPIO_STANDBY, + SENSOR_GPIO_AF_PWDM, + SENSOR_GPIO_VIO, + SENSOR_GPIO_VANA, + SENSOR_GPIO_VDIG, + SENSOR_GPIO_VAF, + SENSOR_GPIO_FL_EN, + SENSOR_GPIO_FL_NOW, + SENSOR_GPIO_FL_RESET, + SENSOR_GPIO_CUSTOM1, + SENSOR_GPIO_CUSTOM2, + SENSOR_GPIO_MAX, +}; + +enum msm_camera_vreg_name_t { + CAM_VDIG, + CAM_VIO, + CAM_VANA, + CAM_VAF, + CAM_V_CUSTOM1, + CAM_V_CUSTOM2, + CAM_VREG_MAX, +}; + +enum msm_sensor_clk_type_t { + SENSOR_CAM_MCLK, + SENSOR_CAM_CLK, + SENSOR_CAM_CLK_MAX, +}; + +enum camerab_mode_t { + CAMERA_MODE_2D_B = (1<<0), + CAMERA_MODE_3D_B = (1<<1), + CAMERA_MODE_INVALID = (1<<2), +}; + +enum msm_actuator_data_type { + MSM_ACTUATOR_BYTE_DATA = 1, + MSM_ACTUATOR_WORD_DATA, +}; + +enum msm_actuator_addr_type { + MSM_ACTUATOR_BYTE_ADDR = 1, + MSM_ACTUATOR_WORD_ADDR, +}; + +enum msm_actuator_write_type { + MSM_ACTUATOR_WRITE_HW_DAMP, + MSM_ACTUATOR_WRITE_DAC, + MSM_ACTUATOR_WRITE, + MSM_ACTUATOR_WRITE_DIR_REG, + MSM_ACTUATOR_POLL, + MSM_ACTUATOR_READ_WRITE, +}; + +enum msm_actuator_i2c_operation { + MSM_ACT_WRITE = 0, + MSM_ACT_POLL, +}; + +enum actuator_type { + ACTUATOR_VCM, + ACTUATOR_PIEZO, + ACTUATOR_HVCM, + ACTUATOR_BIVCM, +}; + +enum msm_flash_driver_type { + FLASH_DRIVER_PMIC, + FLASH_DRIVER_I2C, + FLASH_DRIVER_GPIO, + FLASH_DRIVER_DEFAULT +}; + +enum msm_flash_cfg_type_t { + CFG_FLASH_INIT, + CFG_FLASH_RELEASE, + CFG_FLASH_OFF, + CFG_FLASH_LOW, + CFG_FLASH_HIGH, +}; + +enum msm_sensor_output_format_t { + MSM_SENSOR_BAYER, + MSM_SENSOR_YCBCR, + MSM_SENSOR_META, +}; + +struct msm_sensor_power_setting { + enum msm_sensor_power_seq_type_t seq_type; + unsigned short seq_val; + long config_val; + unsigned short delay; + void *data[10]; +}; + +struct msm_sensor_power_setting_array { + struct msm_sensor_power_setting power_setting_a[MAX_POWER_CONFIG]; + struct msm_sensor_power_setting *power_setting; + unsigned short size; + struct msm_sensor_power_setting power_down_setting_a[MAX_POWER_CONFIG]; + struct msm_sensor_power_setting *power_down_setting; + unsigned short size_down; +}; + +enum msm_camera_i2c_operation { + MSM_CAM_WRITE = 0, + MSM_CAM_POLL, + MSM_CAM_READ, +}; + +struct msm_sensor_i2c_sync_params { + unsigned int cid; + int csid; + unsigned short line; + unsigned short delay; +}; + +struct msm_camera_reg_settings_t { + uint16_t reg_addr; + enum msm_camera_i2c_reg_addr_type addr_type; + uint16_t reg_data; + enum msm_camera_i2c_data_type data_type; + enum msm_camera_i2c_operation i2c_operation; + uint16_t delay; +}; + +struct msm_eeprom_mem_map_t { + int slave_addr; + struct msm_camera_reg_settings_t + mem_settings[MSM_EEPROM_MEMORY_MAP_MAX_SIZE]; + int memory_map_size; +}; + +struct msm_eeprom_memory_map_array { + struct msm_eeprom_mem_map_t memory_map[MSM_EEPROM_MAX_MEM_MAP_CNT]; + uint32_t msm_size_of_max_mappings; +}; + +struct msm_sensor_init_params { + /* mask of modes supported: 2D, 3D */ + int modes_supported; + /* sensor position: front, back */ + enum camb_position_t position; + /* sensor mount angle */ + unsigned int sensor_mount_angle; +}; + +struct msm_sensor_id_info_t { + unsigned short sensor_id_reg_addr; + unsigned short sensor_id; + unsigned short sensor_id_mask; + // added in LeEco + unsigned char module_id; + unsigned char vcm_id; +}; + +struct msm_camera_sensor_slave_info { + char sensor_name[32]; + char eeprom_name[32]; + char actuator_name[32]; + char ois_name[32]; + char flash_name[32]; + enum msm_sensor_camera_id_t camera_id; + unsigned short slave_addr; + enum i2c_freq_mode_t i2c_freq_mode; + enum msm_camera_i2c_reg_addr_type addr_type; + struct msm_sensor_id_info_t sensor_id_info; + struct msm_sensor_power_setting_array power_setting_array; + unsigned char is_init_params_valid; + struct msm_sensor_init_params sensor_init_params; + enum msm_sensor_output_format_t output_format; +}; + +struct msm_camera_i2c_reg_array { + unsigned short reg_addr; + unsigned short reg_data; + unsigned int delay; +}; + +struct msm_camera_i2c_reg_setting { + struct msm_camera_i2c_reg_array *reg_setting; + unsigned short size; + enum msm_camera_i2c_reg_addr_type addr_type; + enum msm_camera_i2c_data_type data_type; + unsigned short delay; +}; + +struct msm_camera_csid_vc_cfg { + unsigned char cid; + unsigned char dt; + unsigned char decode_format; +}; + +struct msm_camera_csid_lut_params { + unsigned char num_cid; + struct msm_camera_csid_vc_cfg vc_cfg_a[MAX_CID]; + struct msm_camera_csid_vc_cfg *vc_cfg[MAX_CID]; +}; + +struct msm_camera_csid_params { + unsigned char lane_cnt; + unsigned short lane_assign; + unsigned char phy_sel; + unsigned int csi_clk; + struct msm_camera_csid_lut_params lut_params; + unsigned char csi_3p_sel; +}; + +struct msm_camera_csid_testmode_parms { + unsigned int num_bytes_per_line; + unsigned int num_lines; + unsigned int h_blanking_count; + unsigned int v_blanking_count; + unsigned int payload_mode; +}; + +struct msm_camera_csiphy_params { + unsigned char lane_cnt; + unsigned char settle_cnt; + unsigned short lane_mask; + unsigned char combo_mode; + unsigned char csid_core; + unsigned int csiphy_clk; + unsigned char csi_3phase; +}; + +struct msm_camera_i2c_seq_reg_array { + unsigned short reg_addr; + unsigned char reg_data[I2C_SEQ_REG_DATA_MAX]; + unsigned short reg_data_size; +}; + +struct msm_camera_i2c_seq_reg_setting { + struct msm_camera_i2c_seq_reg_array *reg_setting; + unsigned short size; + enum msm_camera_i2c_reg_addr_type addr_type; + unsigned short delay; +}; + +struct msm_actuator_reg_params_t { + enum msm_actuator_write_type reg_write_type; + unsigned int hw_mask; + unsigned short reg_addr; + unsigned short hw_shift; + unsigned short data_shift; + unsigned short data_type; + unsigned short addr_type; + unsigned short reg_data; + unsigned short delay; +}; + + +struct damping_params_t { + unsigned int damping_step; + unsigned int damping_delay; + unsigned int hw_params; +}; + +struct region_params_t { + /* [0] = ForwardDirection Macro boundary + [1] = ReverseDirection Inf boundary + */ + unsigned short step_bound[2]; + unsigned short code_per_step; + /* qvalue for converting float type numbers to integer format */ + unsigned int qvalue; +}; + +struct reg_settings_t { + unsigned short reg_addr; + enum msm_actuator_addr_type addr_type; + unsigned short reg_data; + enum msm_actuator_data_type data_type; + enum msm_actuator_i2c_operation i2c_operation; + unsigned int delay; +}; + +struct msm_camera_i2c_reg_setting_array { + struct msm_camera_i2c_reg_array reg_setting_a[MAX_I2C_REG_SET]; + unsigned short size; + enum msm_camera_i2c_reg_addr_type addr_type; + enum msm_camera_i2c_data_type data_type; + unsigned short delay; +}; +#endif /* __LINUX_MSM_CAM_SENSOR_H */ diff --git a/selfdrive/camerad/include/msmb_camera.h b/selfdrive/camerad/include/msmb_camera.h new file mode 100644 index 000000000..f4c4b3e18 --- /dev/null +++ b/selfdrive/camerad/include/msmb_camera.h @@ -0,0 +1,220 @@ +#ifndef __LINUX_MSMB_CAMERA_H +#define __LINUX_MSMB_CAMERA_H + +#include +#include +#include + +#define MSM_CAM_LOGSYNC_FILE_NAME "logsync" +#define MSM_CAM_LOGSYNC_FILE_BASEDIR "camera" + +#define MSM_CAM_V4L2_IOCTL_NOTIFY \ + _IOW('V', BASE_VIDIOC_PRIVATE + 30, struct msm_v4l2_event_data) + +#define MSM_CAM_V4L2_IOCTL_NOTIFY_META \ + _IOW('V', BASE_VIDIOC_PRIVATE + 31, struct msm_v4l2_event_data) + +#define MSM_CAM_V4L2_IOCTL_CMD_ACK \ + _IOW('V', BASE_VIDIOC_PRIVATE + 32, struct msm_v4l2_event_data) + +#define MSM_CAM_V4L2_IOCTL_NOTIFY_ERROR \ + _IOW('V', BASE_VIDIOC_PRIVATE + 33, struct msm_v4l2_event_data) + +#define MSM_CAM_V4L2_IOCTL_NOTIFY_DEBUG \ + _IOW('V', BASE_VIDIOC_PRIVATE + 34, struct msm_v4l2_event_data) + +#ifdef CONFIG_COMPAT +#define MSM_CAM_V4L2_IOCTL_NOTIFY32 \ + _IOW('V', BASE_VIDIOC_PRIVATE + 30, struct v4l2_event32) + +#define MSM_CAM_V4L2_IOCTL_NOTIFY_META32 \ + _IOW('V', BASE_VIDIOC_PRIVATE + 31, struct v4l2_event32) + +#define MSM_CAM_V4L2_IOCTL_CMD_ACK32 \ + _IOW('V', BASE_VIDIOC_PRIVATE + 32, struct v4l2_event32) + +#define MSM_CAM_V4L2_IOCTL_NOTIFY_ERROR32 \ + _IOW('V', BASE_VIDIOC_PRIVATE + 33, struct v4l2_event32) + +#define MSM_CAM_V4L2_IOCTL_NOTIFY_DEBUG32 \ + _IOW('V', BASE_VIDIOC_PRIVATE + 34, struct v4l2_event32) + +#endif + +#define QCAMERA_DEVICE_GROUP_ID 1 +#define QCAMERA_VNODE_GROUP_ID 2 +#define MSM_CAMERA_NAME "msm_camera" +#define MSM_CONFIGURATION_NAME "msm_config" + +#define MSM_CAMERA_SUBDEV_CSIPHY 0 +#define MSM_CAMERA_SUBDEV_CSID 1 +#define MSM_CAMERA_SUBDEV_ISPIF 2 +#define MSM_CAMERA_SUBDEV_VFE 3 +#define MSM_CAMERA_SUBDEV_AXI 4 +#define MSM_CAMERA_SUBDEV_VPE 5 +#define MSM_CAMERA_SUBDEV_SENSOR 6 +#define MSM_CAMERA_SUBDEV_ACTUATOR 7 +#define MSM_CAMERA_SUBDEV_EEPROM 8 +#define MSM_CAMERA_SUBDEV_CPP 9 +#define MSM_CAMERA_SUBDEV_CCI 10 +#define MSM_CAMERA_SUBDEV_LED_FLASH 11 +#define MSM_CAMERA_SUBDEV_STROBE_FLASH 12 +#define MSM_CAMERA_SUBDEV_BUF_MNGR 13 +#define MSM_CAMERA_SUBDEV_SENSOR_INIT 14 +#define MSM_CAMERA_SUBDEV_OIS 15 +#define MSM_CAMERA_SUBDEV_FLASH 16 +#define MSM_CAMERA_SUBDEV_EXT 17 + +#define MSM_MAX_CAMERA_SENSORS 5 + +/* The below macro is defined to put an upper limit on maximum + * number of buffer requested per stream. In case of extremely + * large value for number of buffer due to data structure corruption + * we return error to avoid integer overflow. Group processing + * can have max of 9 groups of 8 bufs each. This value may be + * configured in future*/ +#define MSM_CAMERA_MAX_STREAM_BUF 72 + +/* Max batch size of processing */ +#define MSM_CAMERA_MAX_USER_BUFF_CNT 16 + +/* featur base */ +#define MSM_CAMERA_FEATURE_BASE 0x00010000 +#define MSM_CAMERA_FEATURE_SHUTDOWN (MSM_CAMERA_FEATURE_BASE + 1) + +#define MSM_CAMERA_STATUS_BASE 0x00020000 +#define MSM_CAMERA_STATUS_FAIL (MSM_CAMERA_STATUS_BASE + 1) +#define MSM_CAMERA_STATUS_SUCCESS (MSM_CAMERA_STATUS_BASE + 2) + +/* event type */ +#define MSM_CAMERA_V4L2_EVENT_TYPE (V4L2_EVENT_PRIVATE_START + 0x00002000) + +/* event id */ +#define MSM_CAMERA_EVENT_MIN 0 +#define MSM_CAMERA_NEW_SESSION (MSM_CAMERA_EVENT_MIN + 1) +#define MSM_CAMERA_DEL_SESSION (MSM_CAMERA_EVENT_MIN + 2) +#define MSM_CAMERA_SET_PARM (MSM_CAMERA_EVENT_MIN + 3) +#define MSM_CAMERA_GET_PARM (MSM_CAMERA_EVENT_MIN + 4) +#define MSM_CAMERA_MAPPING_CFG (MSM_CAMERA_EVENT_MIN + 5) +#define MSM_CAMERA_MAPPING_SES (MSM_CAMERA_EVENT_MIN + 6) +#define MSM_CAMERA_MSM_NOTIFY (MSM_CAMERA_EVENT_MIN + 7) +#define MSM_CAMERA_EVENT_MAX (MSM_CAMERA_EVENT_MIN + 8) + +/* data.command */ +#define MSM_CAMERA_PRIV_S_CROP (V4L2_CID_PRIVATE_BASE + 1) +#define MSM_CAMERA_PRIV_G_CROP (V4L2_CID_PRIVATE_BASE + 2) +#define MSM_CAMERA_PRIV_G_FMT (V4L2_CID_PRIVATE_BASE + 3) +#define MSM_CAMERA_PRIV_S_FMT (V4L2_CID_PRIVATE_BASE + 4) +#define MSM_CAMERA_PRIV_TRY_FMT (V4L2_CID_PRIVATE_BASE + 5) +#define MSM_CAMERA_PRIV_METADATA (V4L2_CID_PRIVATE_BASE + 6) +#define MSM_CAMERA_PRIV_QUERY_CAP (V4L2_CID_PRIVATE_BASE + 7) +#define MSM_CAMERA_PRIV_STREAM_ON (V4L2_CID_PRIVATE_BASE + 8) +#define MSM_CAMERA_PRIV_STREAM_OFF (V4L2_CID_PRIVATE_BASE + 9) +#define MSM_CAMERA_PRIV_NEW_STREAM (V4L2_CID_PRIVATE_BASE + 10) +#define MSM_CAMERA_PRIV_DEL_STREAM (V4L2_CID_PRIVATE_BASE + 11) +#define MSM_CAMERA_PRIV_SHUTDOWN (V4L2_CID_PRIVATE_BASE + 12) +#define MSM_CAMERA_PRIV_STREAM_INFO_SYNC \ + (V4L2_CID_PRIVATE_BASE + 13) +#define MSM_CAMERA_PRIV_G_SESSION_ID (V4L2_CID_PRIVATE_BASE + 14) +#define MSM_CAMERA_PRIV_CMD_MAX 20 + +/* data.status - success */ +#define MSM_CAMERA_CMD_SUCESS 0x00000001 +#define MSM_CAMERA_BUF_MAP_SUCESS 0x00000002 + +/* data.status - error */ +#define MSM_CAMERA_ERR_EVT_BASE 0x00010000 +#define MSM_CAMERA_ERR_CMD_FAIL (MSM_CAMERA_ERR_EVT_BASE + 1) +#define MSM_CAMERA_ERR_MAPPING (MSM_CAMERA_ERR_EVT_BASE + 2) +#define MSM_CAMERA_ERR_DEVICE_BUSY (MSM_CAMERA_ERR_EVT_BASE + 3) + +/* The msm_v4l2_event_data structure should match the + * v4l2_event.u.data field. + * should not exceed 16 elements */ +struct msm_v4l2_event_data { + /*word 0*/ + unsigned int command; + /*word 1*/ + unsigned int status; + /*word 2*/ + unsigned int session_id; + /*word 3*/ + unsigned int stream_id; + /*word 4*/ + unsigned int map_op; + /*word 5*/ + unsigned int map_buf_idx; + /*word 6*/ + unsigned int notify; + /*word 7*/ + unsigned int arg_value; + /*word 8*/ + unsigned int ret_value; + /*word 9*/ + unsigned int v4l2_event_type; + /*word 10*/ + unsigned int v4l2_event_id; + /*word 11*/ + unsigned int handle; + /*word 12*/ + unsigned int nop6; + /*word 13*/ + unsigned int nop7; + /*word 14*/ + unsigned int nop8; + /*word 15*/ + unsigned int nop9; +}; + +/* map to v4l2_format.fmt.raw_data */ +struct msm_v4l2_format_data { + enum v4l2_buf_type type; + unsigned int width; + unsigned int height; + unsigned int pixelformat; /* FOURCC */ + unsigned char num_planes; + unsigned int plane_sizes[VIDEO_MAX_PLANES]; +}; + +/* MSM Four-character-code (FOURCC) */ +#define msm_v4l2_fourcc(a, b, c, d)\ + ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) |\ + ((__u32)(d) << 24)) + +/* Composite stats */ +#define MSM_V4L2_PIX_FMT_STATS_COMB v4l2_fourcc('S', 'T', 'C', 'M') +/* AEC stats */ +#define MSM_V4L2_PIX_FMT_STATS_AE v4l2_fourcc('S', 'T', 'A', 'E') +/* AF stats */ +#define MSM_V4L2_PIX_FMT_STATS_AF v4l2_fourcc('S', 'T', 'A', 'F') +/* AWB stats */ +#define MSM_V4L2_PIX_FMT_STATS_AWB v4l2_fourcc('S', 'T', 'W', 'B') +/* IHIST stats */ +#define MSM_V4L2_PIX_FMT_STATS_IHST v4l2_fourcc('I', 'H', 'S', 'T') +/* Column count stats */ +#define MSM_V4L2_PIX_FMT_STATS_CS v4l2_fourcc('S', 'T', 'C', 'S') +/* Row count stats */ +#define MSM_V4L2_PIX_FMT_STATS_RS v4l2_fourcc('S', 'T', 'R', 'S') +/* Bayer Grid stats */ +#define MSM_V4L2_PIX_FMT_STATS_BG v4l2_fourcc('S', 'T', 'B', 'G') +/* Bayer focus stats */ +#define MSM_V4L2_PIX_FMT_STATS_BF v4l2_fourcc('S', 'T', 'B', 'F') +/* Bayer hist stats */ +#define MSM_V4L2_PIX_FMT_STATS_BHST v4l2_fourcc('B', 'H', 'S', 'T') + +enum smmu_attach_mode { + NON_SECURE_MODE = 0x01, + SECURE_MODE = 0x02, + MAX_PROTECTION_MODE = 0x03, +}; + +struct msm_camera_smmu_attach_type { + enum smmu_attach_mode attach; +}; + +struct msm_camera_user_buf_cont_t { + unsigned int buf_cnt; + unsigned int buf_idx[MSM_CAMERA_MAX_USER_BUFF_CNT]; +}; + +#endif /* __LINUX_MSMB_CAMERA_H */ diff --git a/selfdrive/camerad/include/msmb_isp.h b/selfdrive/camerad/include/msmb_isp.h new file mode 100644 index 000000000..35589e050 --- /dev/null +++ b/selfdrive/camerad/include/msmb_isp.h @@ -0,0 +1,880 @@ +#ifndef __MSMB_ISP__ +#define __MSMB_ISP__ + +#include + +#define MAX_PLANES_PER_STREAM 3 +#define MAX_NUM_STREAM 7 + +#define ISP_VERSION_47 47 +#define ISP_VERSION_46 46 +#define ISP_VERSION_44 44 +#define ISP_VERSION_40 40 +#define ISP_VERSION_32 32 +#define ISP_NATIVE_BUF_BIT (0x10000 << 0) +#define ISP0_BIT (0x10000 << 1) +#define ISP1_BIT (0x10000 << 2) +#define ISP_META_CHANNEL_BIT (0x10000 << 3) +#define ISP_SCRATCH_BUF_BIT (0x10000 << 4) +#define ISP_OFFLINE_STATS_BIT (0x10000 << 5) +#define ISP_STATS_STREAM_BIT 0x80000000 + +struct msm_vfe_cfg_cmd_list; + +enum ISP_START_PIXEL_PATTERN { + ISP_BAYER_RGRGRG, + ISP_BAYER_GRGRGR, + ISP_BAYER_BGBGBG, + ISP_BAYER_GBGBGB, + ISP_YUV_YCbYCr, + ISP_YUV_YCrYCb, + ISP_YUV_CbYCrY, + ISP_YUV_CrYCbY, + ISP_PIX_PATTERN_MAX +}; + +enum msm_vfe_plane_fmt { + Y_PLANE, + CB_PLANE, + CR_PLANE, + CRCB_PLANE, + CBCR_PLANE, + VFE_PLANE_FMT_MAX +}; + +enum msm_vfe_input_src { + VFE_PIX_0, + VFE_RAW_0, + VFE_RAW_1, + VFE_RAW_2, + VFE_SRC_MAX, +}; + +enum msm_vfe_axi_stream_src { + PIX_ENCODER, + PIX_VIEWFINDER, + PIX_VIDEO, + CAMIF_RAW, + IDEAL_RAW, + RDI_INTF_0, + RDI_INTF_1, + RDI_INTF_2, + VFE_AXI_SRC_MAX +}; + +enum msm_vfe_frame_skip_pattern { + NO_SKIP, + EVERY_2FRAME, + EVERY_3FRAME, + EVERY_4FRAME, + EVERY_5FRAME, + EVERY_6FRAME, + EVERY_7FRAME, + EVERY_8FRAME, + EVERY_16FRAME, + EVERY_32FRAME, + SKIP_ALL, + SKIP_RANGE, + MAX_SKIP, +}; + +/* + * Define an unused period. When this period is set it means that the stream is + * stopped(i.e the pattern is 0). We don't track the current pattern, just the + * period defines what the pattern is, if period is this then pattern is 0 else + * pattern is 1 + */ +#define MSM_VFE_STREAM_STOP_PERIOD 15 + +enum msm_isp_stats_type { + MSM_ISP_STATS_AEC, /* legacy based AEC */ + MSM_ISP_STATS_AF, /* legacy based AF */ + MSM_ISP_STATS_AWB, /* legacy based AWB */ + MSM_ISP_STATS_RS, /* legacy based RS */ + MSM_ISP_STATS_CS, /* legacy based CS */ + MSM_ISP_STATS_IHIST, /* legacy based HIST */ + MSM_ISP_STATS_SKIN, /* legacy based SKIN */ + MSM_ISP_STATS_BG, /* Bayer Grids */ + MSM_ISP_STATS_BF, /* Bayer Focus */ + MSM_ISP_STATS_BE, /* Bayer Exposure*/ + MSM_ISP_STATS_BHIST, /* Bayer Hist */ + MSM_ISP_STATS_BF_SCALE, /* Bayer Focus scale */ + MSM_ISP_STATS_HDR_BE, /* HDR Bayer Exposure */ + MSM_ISP_STATS_HDR_BHIST, /* HDR Bayer Hist */ + MSM_ISP_STATS_AEC_BG, /* AEC BG */ + MSM_ISP_STATS_MAX /* MAX */ +}; + +/* + * @stats_type_mask: Stats type mask (enum msm_isp_stats_type). + * @stream_src_mask: Stream src mask (enum msm_vfe_axi_stream_src) + * @skip_mode: skip pattern, if skip mode is range only then min/max is used + * @min_frame_id: minimum frame id (valid only if skip_mode = RANGE) + * @max_frame_id: maximum frame id (valid only if skip_mode = RANGE) +*/ +struct msm_isp_sw_framskip { + uint32_t stats_type_mask; + uint32_t stream_src_mask; + enum msm_vfe_frame_skip_pattern skip_mode; + uint32_t min_frame_id; + uint32_t max_frame_id; +}; + +enum msm_vfe_testgen_color_pattern { + COLOR_BAR_8_COLOR, + UNICOLOR_WHITE, + UNICOLOR_YELLOW, + UNICOLOR_CYAN, + UNICOLOR_GREEN, + UNICOLOR_MAGENTA, + UNICOLOR_RED, + UNICOLOR_BLUE, + UNICOLOR_BLACK, + MAX_COLOR, +}; + +enum msm_vfe_camif_input { + CAMIF_DISABLED, + CAMIF_PAD_REG_INPUT, + CAMIF_MIDDI_INPUT, + CAMIF_MIPI_INPUT, +}; + +struct msm_vfe_fetch_engine_cfg { + uint32_t input_format; + uint32_t buf_width; + uint32_t buf_height; + uint32_t fetch_width; + uint32_t fetch_height; + uint32_t x_offset; + uint32_t y_offset; + uint32_t buf_stride; +}; + +enum msm_vfe_camif_output_format { + CAMIF_QCOM_RAW, + CAMIF_MIPI_RAW, + CAMIF_PLAIN_8, + CAMIF_PLAIN_16, + CAMIF_MAX_FORMAT, +}; + +/* + * Camif output general configuration + */ +struct msm_vfe_camif_subsample_cfg { + uint32_t irq_subsample_period; + uint32_t irq_subsample_pattern; + uint32_t sof_counter_step; + uint32_t pixel_skip; + uint32_t line_skip; + uint32_t first_line; + uint32_t last_line; + uint32_t first_pixel; + uint32_t last_pixel; + enum msm_vfe_camif_output_format output_format; +}; + +/* + * Camif frame and window configuration + */ +struct msm_vfe_camif_cfg { + uint32_t lines_per_frame; + uint32_t pixels_per_line; + uint32_t first_pixel; + uint32_t last_pixel; + uint32_t first_line; + uint32_t last_line; + uint32_t epoch_line0; + uint32_t epoch_line1; + uint32_t is_split; + enum msm_vfe_camif_input camif_input; + struct msm_vfe_camif_subsample_cfg subsample_cfg; +}; + +struct msm_vfe_testgen_cfg { + uint32_t lines_per_frame; + uint32_t pixels_per_line; + uint32_t v_blank; + uint32_t h_blank; + enum ISP_START_PIXEL_PATTERN pixel_bayer_pattern; + uint32_t rotate_period; + enum msm_vfe_testgen_color_pattern color_bar_pattern; + uint32_t burst_num_frame; +}; + +enum msm_vfe_inputmux { + CAMIF, + TESTGEN, + EXTERNAL_READ, +}; + +enum msm_vfe_stats_composite_group { + STATS_COMPOSITE_GRP_NONE, + STATS_COMPOSITE_GRP_1, + STATS_COMPOSITE_GRP_2, + STATS_COMPOSITE_GRP_MAX, +}; + +enum msm_vfe_hvx_streaming_cmd { + HVX_DISABLE, + HVX_ONE_WAY, + HVX_ROUND_TRIP +}; + +struct msm_vfe_pix_cfg { + struct msm_vfe_camif_cfg camif_cfg; + struct msm_vfe_testgen_cfg testgen_cfg; + struct msm_vfe_fetch_engine_cfg fetch_engine_cfg; + enum msm_vfe_inputmux input_mux; + enum ISP_START_PIXEL_PATTERN pixel_pattern; + uint32_t input_format; + enum msm_vfe_hvx_streaming_cmd hvx_cmd; + uint32_t is_split; +}; + +struct msm_vfe_rdi_cfg { + uint8_t cid; + uint8_t frame_based; +}; + +struct msm_vfe_input_cfg { + union { + struct msm_vfe_pix_cfg pix_cfg; + struct msm_vfe_rdi_cfg rdi_cfg; + } d; + enum msm_vfe_input_src input_src; + uint32_t input_pix_clk; +}; + +struct msm_vfe_fetch_eng_start { + uint32_t session_id; + uint32_t stream_id; + uint32_t buf_idx; + uint8_t offline_mode; + uint32_t fd; + uint32_t buf_addr; + uint32_t frame_id; +}; + +struct msm_vfe_axi_plane_cfg { + uint32_t output_width; /*Include padding*/ + uint32_t output_height; + uint32_t output_stride; + uint32_t output_scan_lines; + uint32_t output_plane_format; /*Y/Cb/Cr/CbCr*/ + uint32_t plane_addr_offset; + uint8_t csid_src; /*RDI 0-2*/ + uint8_t rdi_cid;/*CID 1-16*/ +}; + +enum msm_stream_memory_input_t { + MEMORY_INPUT_DISABLED, + MEMORY_INPUT_ENABLED +}; + +struct msm_vfe_axi_stream_request_cmd { + uint32_t session_id; + uint32_t stream_id; + uint32_t vt_enable; + uint32_t output_format;/*Planar/RAW/Misc*/ + enum msm_vfe_axi_stream_src stream_src; /*CAMIF/IDEAL/RDIs*/ + struct msm_vfe_axi_plane_cfg plane_cfg[MAX_PLANES_PER_STREAM]; + + uint32_t burst_count; + uint32_t hfr_mode; + uint8_t frame_base; + + uint32_t init_frame_drop; /*MAX 31 Frames*/ + enum msm_vfe_frame_skip_pattern frame_skip_pattern; + uint8_t buf_divert; /* if TRUE no vb2 buf done. */ + /*Return values*/ + uint32_t axi_stream_handle; + uint32_t controllable_output; + uint32_t burst_len; + /* Flag indicating memory input stream */ + enum msm_stream_memory_input_t memory_input; +}; + +struct msm_vfe_axi_stream_release_cmd { + uint32_t stream_handle; +}; + +enum msm_vfe_axi_stream_cmd { + STOP_STREAM, + START_STREAM, + STOP_IMMEDIATELY, +}; + +struct msm_vfe_axi_stream_cfg_cmd { + uint8_t num_streams; + uint32_t stream_handle[VFE_AXI_SRC_MAX]; + enum msm_vfe_axi_stream_cmd cmd; + uint8_t sync_frame_id_src; +}; + +enum msm_vfe_axi_stream_update_type { + ENABLE_STREAM_BUF_DIVERT, + DISABLE_STREAM_BUF_DIVERT, + UPDATE_STREAM_FRAMEDROP_PATTERN, + UPDATE_STREAM_STATS_FRAMEDROP_PATTERN, + UPDATE_STREAM_AXI_CONFIG, + UPDATE_STREAM_REQUEST_FRAMES, + UPDATE_STREAM_ADD_BUFQ, + UPDATE_STREAM_REMOVE_BUFQ, + UPDATE_STREAM_SW_FRAME_DROP, +}; + +enum msm_vfe_iommu_type { + IOMMU_ATTACH, + IOMMU_DETACH, +}; + +enum msm_vfe_buff_queue_id { + VFE_BUF_QUEUE_DEFAULT, + VFE_BUF_QUEUE_SHARED, + VFE_BUF_QUEUE_MAX, +}; + +struct msm_vfe_axi_stream_cfg_update_info { + uint32_t stream_handle; + uint32_t output_format; + uint32_t user_stream_id; + uint32_t frame_id; + enum msm_vfe_frame_skip_pattern skip_pattern; + struct msm_vfe_axi_plane_cfg plane_cfg[MAX_PLANES_PER_STREAM]; + struct msm_isp_sw_framskip sw_skip_info; +}; + +struct msm_vfe_axi_halt_cmd { + uint32_t stop_camif; + uint32_t overflow_detected; + uint32_t blocking_halt; +}; + +struct msm_vfe_axi_reset_cmd { + uint32_t blocking; + uint32_t frame_id; +}; + +struct msm_vfe_axi_restart_cmd { + uint32_t enable_camif; +}; + +struct msm_vfe_axi_stream_update_cmd { + uint32_t num_streams; + enum msm_vfe_axi_stream_update_type update_type; + struct msm_vfe_axi_stream_cfg_update_info + update_info[MSM_ISP_STATS_MAX]; +}; + +struct msm_vfe_smmu_attach_cmd { + uint32_t security_mode; + uint32_t iommu_attach_mode; +}; + +struct msm_vfe_stats_stream_request_cmd { + uint32_t session_id; + uint32_t stream_id; + enum msm_isp_stats_type stats_type; + uint32_t composite_flag; + uint32_t framedrop_pattern; + uint32_t init_frame_drop; /*MAX 31 Frames*/ + uint32_t irq_subsample_pattern; + uint32_t buffer_offset; + uint32_t stream_handle; +}; + +struct msm_vfe_stats_stream_release_cmd { + uint32_t stream_handle; +}; +struct msm_vfe_stats_stream_cfg_cmd { + uint8_t num_streams; + uint32_t stream_handle[MSM_ISP_STATS_MAX]; + uint8_t enable; + uint32_t stats_burst_len; +}; + +enum msm_vfe_reg_cfg_type { + VFE_WRITE, + VFE_WRITE_MB, + VFE_READ, + VFE_CFG_MASK, + VFE_WRITE_DMI_16BIT, + VFE_WRITE_DMI_32BIT, + VFE_WRITE_DMI_64BIT, + VFE_READ_DMI_16BIT, + VFE_READ_DMI_32BIT, + VFE_READ_DMI_64BIT, + GET_MAX_CLK_RATE, + GET_CLK_RATES, + GET_ISP_ID, + VFE_HW_UPDATE_LOCK, + VFE_HW_UPDATE_UNLOCK, + SET_WM_UB_SIZE, + SET_UB_POLICY, +}; + +struct msm_vfe_cfg_cmd2 { + uint16_t num_cfg; + uint16_t cmd_len; + void __user *cfg_data; + void __user *cfg_cmd; +}; + +struct msm_vfe_cfg_cmd_list { + struct msm_vfe_cfg_cmd2 cfg_cmd; + struct msm_vfe_cfg_cmd_list *next; + uint32_t next_size; +}; + +struct msm_vfe_reg_rw_info { + uint32_t reg_offset; + uint32_t cmd_data_offset; + uint32_t len; +}; + +struct msm_vfe_reg_mask_info { + uint32_t reg_offset; + uint32_t mask; + uint32_t val; +}; + +struct msm_vfe_reg_dmi_info { + uint32_t hi_tbl_offset; /*Optional*/ + uint32_t lo_tbl_offset; /*Required*/ + uint32_t len; +}; + +struct msm_vfe_reg_cfg_cmd { + union { + struct msm_vfe_reg_rw_info rw_info; + struct msm_vfe_reg_mask_info mask_info; + struct msm_vfe_reg_dmi_info dmi_info; + } u; + + enum msm_vfe_reg_cfg_type cmd_type; +}; + +enum vfe_sd_type { + VFE_SD_0 = 0, + VFE_SD_1, + VFE_SD_COMMON, + VFE_SD_MAX, +}; + +/* When you change the value below, check for the sof event_data size. + * V4l2 limits payload to 64 bytes */ +#define MS_NUM_SLAVE_MAX 1 + +/* Usecases when 2 HW need to be related or synced */ +enum msm_vfe_dual_hw_type { + DUAL_NONE = 0, + DUAL_HW_VFE_SPLIT = 1, + DUAL_HW_MASTER_SLAVE = 2, +}; + +/* Type for 2 INTF when used in Master-Slave mode */ +enum msm_vfe_dual_hw_ms_type { + MS_TYPE_NONE, + MS_TYPE_MASTER, + MS_TYPE_SLAVE, +}; + +struct msm_isp_set_dual_hw_ms_cmd { + uint8_t num_src; + /* Each session can be only one type but multiple intf if YUV cam */ + enum msm_vfe_dual_hw_ms_type dual_hw_ms_type; + /* Primary intf is mostly associated with preview. + * This primary intf SOF frame_id and timestamp is tracked + * and used to calculate delta */ + enum msm_vfe_input_src primary_intf; + /* input_src array indicates other input INTF that may be Master/Slave. + * For these additional intf, frame_id and timestamp are not saved. + * However, if these are slaves then they will still get their + * frame_id from Master */ + enum msm_vfe_input_src input_src[VFE_SRC_MAX]; + uint32_t sof_delta_threshold; /* In milliseconds. Sent for Master */ +}; + +enum msm_isp_buf_type { + ISP_PRIVATE_BUF, + ISP_SHARE_BUF, + MAX_ISP_BUF_TYPE, +}; + +struct msm_isp_unmap_buf_req { + uint32_t fd; +}; + +struct msm_isp_buf_request { + uint32_t session_id; + uint32_t stream_id; + uint8_t num_buf; + uint32_t handle; + enum msm_isp_buf_type buf_type; +}; + +struct msm_isp_qbuf_plane { + uint32_t addr; + uint32_t offset; + uint32_t length; +}; + +struct msm_isp_qbuf_buffer { + struct msm_isp_qbuf_plane planes[MAX_PLANES_PER_STREAM]; + uint32_t num_planes; +}; + +struct msm_isp_qbuf_info { + uint32_t handle; + int32_t buf_idx; + /*Only used for prepare buffer*/ + struct msm_isp_qbuf_buffer buffer; + /*Only used for diverted buffer*/ + uint32_t dirty_buf; +}; + +struct msm_isp_clk_rates { + uint32_t svs_rate; + uint32_t nominal_rate; + uint32_t high_rate; +}; + +struct msm_vfe_axi_src_state { + enum msm_vfe_input_src input_src; + uint32_t src_active; + uint32_t src_frame_id; +}; + +enum msm_isp_event_mask_index { + ISP_EVENT_MASK_INDEX_STATS_NOTIFY = 0, + ISP_EVENT_MASK_INDEX_ERROR = 1, + ISP_EVENT_MASK_INDEX_IOMMU_P_FAULT = 2, + ISP_EVENT_MASK_INDEX_STREAM_UPDATE_DONE = 3, + ISP_EVENT_MASK_INDEX_REG_UPDATE = 4, + ISP_EVENT_MASK_INDEX_SOF = 5, + ISP_EVENT_MASK_INDEX_BUF_DIVERT = 6, + ISP_EVENT_MASK_INDEX_COMP_STATS_NOTIFY = 7, + ISP_EVENT_MASK_INDEX_MASK_FE_READ_DONE = 8, + ISP_EVENT_MASK_INDEX_BUF_DONE = 9, + ISP_EVENT_MASK_INDEX_REG_UPDATE_MISSING = 10, + ISP_EVENT_MASK_INDEX_PING_PONG_MISMATCH = 11, + ISP_EVENT_MASK_INDEX_BUF_FATAL_ERROR = 12, +}; + + +#define ISP_EVENT_SUBS_MASK_NONE 0 + +#define ISP_EVENT_SUBS_MASK_STATS_NOTIFY \ + (1 << ISP_EVENT_MASK_INDEX_STATS_NOTIFY) + +#define ISP_EVENT_SUBS_MASK_ERROR \ + (1 << ISP_EVENT_MASK_INDEX_ERROR) + +#define ISP_EVENT_SUBS_MASK_IOMMU_P_FAULT \ + (1 << ISP_EVENT_MASK_INDEX_IOMMU_P_FAULT) + +#define ISP_EVENT_SUBS_MASK_STREAM_UPDATE_DONE \ + (1 << ISP_EVENT_MASK_INDEX_STREAM_UPDATE_DONE) + +#define ISP_EVENT_SUBS_MASK_REG_UPDATE \ + (1 << ISP_EVENT_MASK_INDEX_REG_UPDATE) + +#define ISP_EVENT_SUBS_MASK_SOF \ + (1 << ISP_EVENT_MASK_INDEX_SOF) + +#define ISP_EVENT_SUBS_MASK_BUF_DIVERT \ + (1 << ISP_EVENT_MASK_INDEX_BUF_DIVERT) + +#define ISP_EVENT_SUBS_MASK_COMP_STATS_NOTIFY \ + (1 << ISP_EVENT_MASK_INDEX_COMP_STATS_NOTIFY) + +#define ISP_EVENT_SUBS_MASK_FE_READ_DONE \ + (1 << ISP_EVENT_MASK_INDEX_MASK_FE_READ_DONE) + +#define ISP_EVENT_SUBS_MASK_BUF_DONE \ + (1 << ISP_EVENT_MASK_INDEX_BUF_DONE) + +#define ISP_EVENT_SUBS_MASK_REG_UPDATE_MISSING \ + (1 << ISP_EVENT_MASK_INDEX_REG_UPDATE_MISSING) + +#define ISP_EVENT_SUBS_MASK_PING_PONG_MISMATCH \ + (1 << ISP_EVENT_MASK_INDEX_PING_PONG_MISMATCH) + +#define ISP_EVENT_SUBS_MASK_BUF_FATAL_ERROR \ + (1 << ISP_EVENT_MASK_INDEX_BUF_FATAL_ERROR) + +enum msm_isp_event_idx { + ISP_REG_UPDATE = 0, + ISP_EPOCH_0 = 1, + ISP_EPOCH_1 = 2, + ISP_START_ACK = 3, + ISP_STOP_ACK = 4, + ISP_IRQ_VIOLATION = 5, + ISP_STATS_OVERFLOW = 6, + ISP_BUF_DONE = 7, + ISP_FE_RD_DONE = 8, + ISP_IOMMU_P_FAULT = 9, + ISP_ERROR = 10, + ISP_HW_FATAL_ERROR = 11, + ISP_PING_PONG_MISMATCH = 12, + ISP_REG_UPDATE_MISSING = 13, + ISP_BUF_FATAL_ERROR = 14, + ISP_EVENT_MAX = 15 +}; + +#define ISP_EVENT_OFFSET 8 +#define ISP_EVENT_BASE (V4L2_EVENT_PRIVATE_START) +#define ISP_BUF_EVENT_BASE (ISP_EVENT_BASE + (1 << ISP_EVENT_OFFSET)) +#define ISP_STATS_EVENT_BASE (ISP_EVENT_BASE + (2 << ISP_EVENT_OFFSET)) +#define ISP_CAMIF_EVENT_BASE (ISP_EVENT_BASE + (3 << ISP_EVENT_OFFSET)) +#define ISP_STREAM_EVENT_BASE (ISP_EVENT_BASE + (4 << ISP_EVENT_OFFSET)) +#define ISP_EVENT_REG_UPDATE (ISP_EVENT_BASE + ISP_REG_UPDATE) +#define ISP_EVENT_EPOCH_0 (ISP_EVENT_BASE + ISP_EPOCH_0) +#define ISP_EVENT_EPOCH_1 (ISP_EVENT_BASE + ISP_EPOCH_1) +#define ISP_EVENT_START_ACK (ISP_EVENT_BASE + ISP_START_ACK) +#define ISP_EVENT_STOP_ACK (ISP_EVENT_BASE + ISP_STOP_ACK) +#define ISP_EVENT_IRQ_VIOLATION (ISP_EVENT_BASE + ISP_IRQ_VIOLATION) +#define ISP_EVENT_STATS_OVERFLOW (ISP_EVENT_BASE + ISP_STATS_OVERFLOW) +#define ISP_EVENT_ERROR (ISP_EVENT_BASE + ISP_ERROR) +#define ISP_EVENT_SOF (ISP_CAMIF_EVENT_BASE) +#define ISP_EVENT_EOF (ISP_CAMIF_EVENT_BASE + 1) +#define ISP_EVENT_BUF_DONE (ISP_EVENT_BASE + ISP_BUF_DONE) +#define ISP_EVENT_BUF_DIVERT (ISP_BUF_EVENT_BASE) +#define ISP_EVENT_STATS_NOTIFY (ISP_STATS_EVENT_BASE) +#define ISP_EVENT_COMP_STATS_NOTIFY (ISP_EVENT_STATS_NOTIFY + MSM_ISP_STATS_MAX) +#define ISP_EVENT_FE_READ_DONE (ISP_EVENT_BASE + ISP_FE_RD_DONE) +#define ISP_EVENT_IOMMU_P_FAULT (ISP_EVENT_BASE + ISP_IOMMU_P_FAULT) +#define ISP_EVENT_HW_FATAL_ERROR (ISP_EVENT_BASE + ISP_HW_FATAL_ERROR) +#define ISP_EVENT_PING_PONG_MISMATCH (ISP_EVENT_BASE + ISP_PING_PONG_MISMATCH) +#define ISP_EVENT_REG_UPDATE_MISSING (ISP_EVENT_BASE + ISP_REG_UPDATE_MISSING) +#define ISP_EVENT_BUF_FATAL_ERROR (ISP_EVENT_BASE + ISP_BUF_FATAL_ERROR) +#define ISP_EVENT_STREAM_UPDATE_DONE (ISP_STREAM_EVENT_BASE) + +/* The msm_v4l2_event_data structure should match the + * v4l2_event.u.data field. + * should not exceed 64 bytes */ + +struct msm_isp_buf_event { + uint32_t session_id; + uint32_t stream_id; + uint32_t handle; + uint32_t output_format; + int8_t buf_idx; +}; +struct msm_isp_fetch_eng_event { + uint32_t session_id; + uint32_t stream_id; + uint32_t handle; + uint32_t fd; + int8_t buf_idx; + int8_t offline_mode; +}; +struct msm_isp_stats_event { + uint32_t stats_mask; /* 4 bytes */ + uint8_t stats_buf_idxs[MSM_ISP_STATS_MAX]; /* 11 bytes */ +}; + +struct msm_isp_stream_ack { + uint32_t session_id; + uint32_t stream_id; + uint32_t handle; +}; + +enum msm_vfe_error_type { + ISP_ERROR_NONE, + ISP_ERROR_CAMIF, + ISP_ERROR_BUS_OVERFLOW, + ISP_ERROR_RETURN_EMPTY_BUFFER, + ISP_ERROR_FRAME_ID_MISMATCH, + ISP_ERROR_MAX, +}; + +struct msm_isp_error_info { + enum msm_vfe_error_type err_type; + uint32_t session_id; + uint32_t stream_id; + uint32_t stream_id_mask; +}; + +/* This structure reports delta between master and slave */ +struct msm_isp_ms_delta_info { + uint8_t num_delta_info; + uint32_t delta[MS_NUM_SLAVE_MAX]; +}; + +/* This is sent in EPOCH irq */ +struct msm_isp_output_info { + uint8_t regs_not_updated; + /* mask with bufq_handle for regs not updated or return empty */ + uint16_t output_err_mask; + /* mask with stream_idx for get_buf failed */ + uint8_t stream_framedrop_mask; + /* mask with stats stream_idx for get_buf failed */ + uint16_t stats_framedrop_mask; + /* delta between master and slave */ +}; + +/* This structure is piggybacked with SOF event */ +struct msm_isp_sof_info { + uint8_t regs_not_updated; + /* mask with AXI_SRC for regs not updated */ + uint16_t reg_update_fail_mask; + /* mask with bufq_handle for get_buf failed */ + uint32_t stream_get_buf_fail_mask; + /* mask with stats stream_idx for get_buf failed */ + uint16_t stats_get_buf_fail_mask; + /* delta between master and slave */ + struct msm_isp_ms_delta_info ms_delta_info; +}; + +struct msm_isp_event_data { + /*Wall clock except for buffer divert events + *which use monotonic clock + */ + struct timeval timestamp; + /* Monotonic timestamp since bootup */ + struct timeval mono_timestamp; + uint32_t frame_id; + union { + /* Sent for Stats_Done event */ + struct msm_isp_stats_event stats; + /* Sent for Buf_Divert event */ + struct msm_isp_buf_event buf_done; + /* Sent for offline fetch done event */ + struct msm_isp_fetch_eng_event fetch_done; + /* Sent for Error_Event */ + struct msm_isp_error_info error_info; + /* + * This struct needs to be removed once + * userspace switches to sof_info + */ + struct msm_isp_output_info output_info; + /* Sent for SOF event */ + struct msm_isp_sof_info sof_info; + } u; /* union can have max 52 bytes */ +}; + +#ifdef CONFIG_COMPAT +struct msm_isp_event_data32 { + struct compat_timeval timestamp; + struct compat_timeval mono_timestamp; + uint32_t frame_id; + union { + struct msm_isp_stats_event stats; + struct msm_isp_buf_event buf_done; + struct msm_isp_fetch_eng_event fetch_done; + struct msm_isp_error_info error_info; + struct msm_isp_output_info output_info; + struct msm_isp_sof_info sof_info; + } u; +}; +#endif + +#define V4L2_PIX_FMT_QBGGR8 v4l2_fourcc('Q', 'B', 'G', '8') +#define V4L2_PIX_FMT_QGBRG8 v4l2_fourcc('Q', 'G', 'B', '8') +#define V4L2_PIX_FMT_QGRBG8 v4l2_fourcc('Q', 'G', 'R', '8') +#define V4L2_PIX_FMT_QRGGB8 v4l2_fourcc('Q', 'R', 'G', '8') +#define V4L2_PIX_FMT_QBGGR10 v4l2_fourcc('Q', 'B', 'G', '0') +#define V4L2_PIX_FMT_QGBRG10 v4l2_fourcc('Q', 'G', 'B', '0') +#define V4L2_PIX_FMT_QGRBG10 v4l2_fourcc('Q', 'G', 'R', '0') +#define V4L2_PIX_FMT_QRGGB10 v4l2_fourcc('Q', 'R', 'G', '0') +#define V4L2_PIX_FMT_QBGGR12 v4l2_fourcc('Q', 'B', 'G', '2') +#define V4L2_PIX_FMT_QGBRG12 v4l2_fourcc('Q', 'G', 'B', '2') +#define V4L2_PIX_FMT_QGRBG12 v4l2_fourcc('Q', 'G', 'R', '2') +#define V4L2_PIX_FMT_QRGGB12 v4l2_fourcc('Q', 'R', 'G', '2') +#define V4L2_PIX_FMT_QBGGR14 v4l2_fourcc('Q', 'B', 'G', '4') +#define V4L2_PIX_FMT_QGBRG14 v4l2_fourcc('Q', 'G', 'B', '4') +#define V4L2_PIX_FMT_QGRBG14 v4l2_fourcc('Q', 'G', 'R', '4') +#define V4L2_PIX_FMT_QRGGB14 v4l2_fourcc('Q', 'R', 'G', '4') +#define V4L2_PIX_FMT_P16BGGR10 v4l2_fourcc('P', 'B', 'G', '0') +#define V4L2_PIX_FMT_P16GBRG10 v4l2_fourcc('P', 'G', 'B', '0') +#define V4L2_PIX_FMT_P16GRBG10 v4l2_fourcc('P', 'G', 'R', '0') +#define V4L2_PIX_FMT_P16RGGB10 v4l2_fourcc('P', 'R', 'G', '0') +#define V4L2_PIX_FMT_NV14 v4l2_fourcc('N', 'V', '1', '4') +#define V4L2_PIX_FMT_NV41 v4l2_fourcc('N', 'V', '4', '1') +#define V4L2_PIX_FMT_META v4l2_fourcc('Q', 'M', 'E', 'T') +#define V4L2_PIX_FMT_SBGGR14 v4l2_fourcc('B', 'G', '1', '4') /* 14 BGBG.GRGR.*/ +#define V4L2_PIX_FMT_SGBRG14 v4l2_fourcc('G', 'B', '1', '4') /* 14 GBGB.RGRG.*/ +#define V4L2_PIX_FMT_SGRBG14 v4l2_fourcc('B', 'A', '1', '4') /* 14 GRGR.BGBG.*/ +#define V4L2_PIX_FMT_SRGGB14 v4l2_fourcc('R', 'G', '1', '4') /* 14 RGRG.GBGB.*/ + +#define VIDIOC_MSM_VFE_REG_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_vfe_cfg_cmd2) + +#define VIDIOC_MSM_ISP_REQUEST_BUF \ + _IOWR('V', BASE_VIDIOC_PRIVATE+1, struct msm_isp_buf_request) + +#define VIDIOC_MSM_ISP_ENQUEUE_BUF \ + _IOWR('V', BASE_VIDIOC_PRIVATE+2, struct msm_isp_qbuf_info) + +#define VIDIOC_MSM_ISP_RELEASE_BUF \ + _IOWR('V', BASE_VIDIOC_PRIVATE+3, struct msm_isp_buf_request) + +#define VIDIOC_MSM_ISP_REQUEST_STREAM \ + _IOWR('V', BASE_VIDIOC_PRIVATE+4, struct msm_vfe_axi_stream_request_cmd) + +#define VIDIOC_MSM_ISP_CFG_STREAM \ + _IOWR('V', BASE_VIDIOC_PRIVATE+5, struct msm_vfe_axi_stream_cfg_cmd) + +#define VIDIOC_MSM_ISP_RELEASE_STREAM \ + _IOWR('V', BASE_VIDIOC_PRIVATE+6, struct msm_vfe_axi_stream_release_cmd) + +#define VIDIOC_MSM_ISP_INPUT_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE+7, struct msm_vfe_input_cfg) + +#define VIDIOC_MSM_ISP_SET_SRC_STATE \ + _IOWR('V', BASE_VIDIOC_PRIVATE+8, struct msm_vfe_axi_src_state) + +#define VIDIOC_MSM_ISP_REQUEST_STATS_STREAM \ + _IOWR('V', BASE_VIDIOC_PRIVATE+9, \ + struct msm_vfe_stats_stream_request_cmd) + +#define VIDIOC_MSM_ISP_CFG_STATS_STREAM \ + _IOWR('V', BASE_VIDIOC_PRIVATE+10, struct msm_vfe_stats_stream_cfg_cmd) + +#define VIDIOC_MSM_ISP_RELEASE_STATS_STREAM \ + _IOWR('V', BASE_VIDIOC_PRIVATE+11, \ + struct msm_vfe_stats_stream_release_cmd) + +#define VIDIOC_MSM_ISP_REG_UPDATE_CMD \ + _IOWR('V', BASE_VIDIOC_PRIVATE+12, enum msm_vfe_input_src) + +#define VIDIOC_MSM_ISP_UPDATE_STREAM \ + _IOWR('V', BASE_VIDIOC_PRIVATE+13, struct msm_vfe_axi_stream_update_cmd) + +#define VIDIOC_MSM_VFE_REG_LIST_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE+14, struct msm_vfe_cfg_cmd_list) + +#define VIDIOC_MSM_ISP_SMMU_ATTACH \ + _IOWR('V', BASE_VIDIOC_PRIVATE+15, struct msm_vfe_smmu_attach_cmd) + +#define VIDIOC_MSM_ISP_UPDATE_STATS_STREAM \ + _IOWR('V', BASE_VIDIOC_PRIVATE+16, struct msm_vfe_axi_stream_update_cmd) + +#define VIDIOC_MSM_ISP_AXI_HALT \ + _IOWR('V', BASE_VIDIOC_PRIVATE+17, struct msm_vfe_axi_halt_cmd) + +#define VIDIOC_MSM_ISP_AXI_RESET \ + _IOWR('V', BASE_VIDIOC_PRIVATE+18, struct msm_vfe_axi_reset_cmd) + +#define VIDIOC_MSM_ISP_AXI_RESTART \ + _IOWR('V', BASE_VIDIOC_PRIVATE+19, struct msm_vfe_axi_restart_cmd) + +#define VIDIOC_MSM_ISP_FETCH_ENG_START \ + _IOWR('V', BASE_VIDIOC_PRIVATE+20, struct msm_vfe_fetch_eng_start) + +#define VIDIOC_MSM_ISP_DEQUEUE_BUF \ + _IOWR('V', BASE_VIDIOC_PRIVATE+21, struct msm_isp_qbuf_info) + +#define VIDIOC_MSM_ISP_SET_DUAL_HW_MASTER_SLAVE \ + _IOWR('V', BASE_VIDIOC_PRIVATE+22, struct msm_isp_set_dual_hw_ms_cmd) + +#define VIDIOC_MSM_ISP_MAP_BUF_START_FE \ + _IOWR('V', BASE_VIDIOC_PRIVATE+23, struct msm_vfe_fetch_eng_start) + +#define VIDIOC_MSM_ISP_UNMAP_BUF \ + _IOWR('V', BASE_VIDIOC_PRIVATE+24, struct msm_isp_unmap_buf_req) + +#endif /* __MSMB_ISP__ */ diff --git a/selfdrive/camerad/include/msmb_ispif.h b/selfdrive/camerad/include/msmb_ispif.h new file mode 100644 index 000000000..2564c33b7 --- /dev/null +++ b/selfdrive/camerad/include/msmb_ispif.h @@ -0,0 +1,125 @@ +#ifndef MSM_CAM_ISPIF_H +#define MSM_CAM_ISPIF_H + +#define CSID_VERSION_V20 0x02000011 +#define CSID_VERSION_V22 0x02001000 +#define CSID_VERSION_V30 0x30000000 +#define CSID_VERSION_V3 0x30000000 + +enum msm_ispif_vfe_intf { + VFE0, + VFE1, + VFE_MAX +}; +#define VFE0_MASK (1 << VFE0) +#define VFE1_MASK (1 << VFE1) + +enum msm_ispif_intftype { + PIX0, + RDI0, + PIX1, + RDI1, + RDI2, + INTF_MAX +}; +#define MAX_PARAM_ENTRIES (INTF_MAX * 2) +#define MAX_CID_CH 8 + +#define PIX0_MASK (1 << PIX0) +#define PIX1_MASK (1 << PIX1) +#define RDI0_MASK (1 << RDI0) +#define RDI1_MASK (1 << RDI1) +#define RDI2_MASK (1 << RDI2) + + +enum msm_ispif_vc { + VC0, + VC1, + VC2, + VC3, + VC_MAX +}; + +enum msm_ispif_cid { + CID0, + CID1, + CID2, + CID3, + CID4, + CID5, + CID6, + CID7, + CID8, + CID9, + CID10, + CID11, + CID12, + CID13, + CID14, + CID15, + CID_MAX +}; + +enum msm_ispif_csid { + CSID0, + CSID1, + CSID2, + CSID3, + CSID_MAX +}; + +struct msm_ispif_params_entry { + enum msm_ispif_vfe_intf vfe_intf; + enum msm_ispif_intftype intftype; + int num_cids; + enum msm_ispif_cid cids[3]; + enum msm_ispif_csid csid; + int crop_enable; + uint16_t crop_start_pixel; + uint16_t crop_end_pixel; +}; + +struct msm_ispif_param_data { + uint32_t num; + struct msm_ispif_params_entry entries[MAX_PARAM_ENTRIES]; +}; + +struct msm_isp_info { + uint32_t max_resolution; + uint32_t id; + uint32_t ver; +}; + +struct msm_ispif_vfe_info { + int num_vfe; + struct msm_isp_info info[VFE_MAX]; +}; + +enum ispif_cfg_type_t { + ISPIF_CLK_ENABLE, + ISPIF_CLK_DISABLE, + ISPIF_INIT, + ISPIF_CFG, + ISPIF_START_FRAME_BOUNDARY, + ISPIF_RESTART_FRAME_BOUNDARY, + ISPIF_STOP_FRAME_BOUNDARY, + ISPIF_STOP_IMMEDIATELY, + ISPIF_RELEASE, + ISPIF_ENABLE_REG_DUMP, + ISPIF_SET_VFE_INFO, +}; + +struct ispif_cfg_data { + enum ispif_cfg_type_t cfg_type; + union { + int reg_dump; /* ISPIF_ENABLE_REG_DUMP */ + uint32_t csid_version; /* ISPIF_INIT */ + struct msm_ispif_vfe_info vfe_info; /* ISPIF_SET_VFE_INFO */ + struct msm_ispif_param_data params; /* CFG, START, STOP */ + }; +}; + +#define VIDIOC_MSM_ISPIF_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE, struct ispif_cfg_data) + +#endif /* MSM_CAM_ISPIF_H */ diff --git a/selfdrive/camerad/main.cc b/selfdrive/camerad/main.cc new file mode 100644 index 000000000..668410d6f --- /dev/null +++ b/selfdrive/camerad/main.cc @@ -0,0 +1,20 @@ +#include "selfdrive/camerad/cameras/camera_common.h" + +#include + +#include "selfdrive/common/params.h" +#include "selfdrive/common/util.h" +#include "selfdrive/hardware/hw.h" + +int main(int argc, char *argv[]) { + if (!Hardware::PC()) { + int ret; + ret = util::set_realtime_priority(53); + assert(ret == 0); + ret = util::set_core_affinity({Hardware::EON() ? 2 : 6}); + assert(ret == 0 || Params().getBool("IsOffroad")); // failure ok while offroad due to offlining cores + } + + camerad_thread(); + return 0; +} diff --git a/selfdrive/camerad/snapshot/__init__.py b/selfdrive/camerad/snapshot/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/camerad/snapshot/snapshot.py b/selfdrive/camerad/snapshot/snapshot.py new file mode 100755 index 000000000..506064de3 --- /dev/null +++ b/selfdrive/camerad/snapshot/snapshot.py @@ -0,0 +1,124 @@ +#!/usr/bin/env python3 +import subprocess +import time + +import numpy as np +from PIL import Image +from typing import List + +import cereal.messaging as messaging +from cereal.visionipc.visionipc_pyx import VisionIpcClient, VisionStreamType # pylint: disable=no-name-in-module, import-error +from common.params import Params +from common.realtime import DT_MDL +from selfdrive.hardware import TICI, PC +from selfdrive.controls.lib.alertmanager import set_offroad_alert +from selfdrive.manager.process_config import managed_processes + +LM_THRESH = 120 # defined in selfdrive/camerad/imgproc/utils.h + +VISION_STREAMS = { + "roadCameraState": VisionStreamType.VISION_STREAM_RGB_BACK, + "driverCameraState": VisionStreamType.VISION_STREAM_RGB_FRONT, + "wideRoadCameraState": VisionStreamType.VISION_STREAM_RGB_WIDE, +} + + +def jpeg_write(fn, dat): + img = Image.fromarray(dat) + img.save(fn, "JPEG") + + +def extract_image(buf, w, h, stride): + img = np.hstack([buf[i * stride:i * stride + 3 * w] for i in range(h)]) + b = img[::3].reshape(h, w) + g = img[1::3].reshape(h, w) + r = img[2::3].reshape(h, w) + return np.dstack([r, g, b]) + + +def rois_in_focus(lapres: List[float]) -> float: + return sum(1. / len(lapres) for sharpness in lapres if sharpness >= LM_THRESH) + + +def get_snapshots(frame="roadCameraState", front_frame="driverCameraState", focus_perc_threshold=0.): + sockets = [s for s in (frame, front_frame) if s is not None] + sm = messaging.SubMaster(sockets) + vipc_clients = {s: VisionIpcClient("camerad", VISION_STREAMS[s], True) for s in sockets} + + # wait 4 sec from camerad startup for focus and exposure + while sm[sockets[0]].frameId < int(4. / DT_MDL): + sm.update() + + for client in vipc_clients.values(): + client.connect(True) + + # wait for focus + start_t = time.monotonic() + while time.monotonic() - start_t < 10: + sm.update(100) + if min(sm.rcv_frame.values()) > 1 and rois_in_focus(sm[frame].sharpnessScore) >= focus_perc_threshold: + break + + # grab images + rear, front = None, None + if frame is not None: + c = vipc_clients[frame] + rear = extract_image(c.recv(), c.width, c.height, c.stride) + if front_frame is not None: + c = vipc_clients[front_frame] + front = extract_image(c.recv(), c.width, c.height, c.stride) + return rear, front + + +def snapshot(): + params = Params() + + if (not params.get_bool("IsOffroad")) or params.get_bool("IsTakingSnapshot"): + print("Already taking snapshot") + return None, None + + front_camera_allowed = params.get_bool("RecordFront") + params.put_bool("IsTakingSnapshot", True) + set_offroad_alert("Offroad_IsTakingSnapshot", True) + time.sleep(2.0) # Give thermald time to read the param, or if just started give camerad time to start + + # Check if camerad is already started + try: + subprocess.check_call(["pgrep", "camerad"]) + print("Camerad already running") + params.put_bool("IsTakingSnapshot", False) + params.delete("Offroad_IsTakingSnapshot") + return None, None + except subprocess.CalledProcessError: + pass + + try: + # Allow testing on replay on PC + if not PC: + managed_processes['camerad'].start() + + frame = "wideRoadCameraState" if TICI else "roadCameraState" + front_frame = "driverCameraState" if front_camera_allowed else None + focus_perc_threshold = 0. if TICI else 10 / 12. + + rear, front = get_snapshots(frame, front_frame, focus_perc_threshold) + finally: + managed_processes['camerad'].stop() + params.put_bool("IsTakingSnapshot", False) + set_offroad_alert("Offroad_IsTakingSnapshot", False) + + if not front_camera_allowed: + front = None + + return rear, front + + +if __name__ == "__main__": + pic, fpic = snapshot() + if pic is not None: + print(pic.shape) + jpeg_write("/tmp/back.jpg", pic) + if fpic is not None: + jpeg_write("/tmp/front.jpg", fpic) + else: + print("Error taking snapshot") diff --git a/selfdrive/camerad/transforms/rgb_to_yuv.cc b/selfdrive/camerad/transforms/rgb_to_yuv.cc new file mode 100644 index 000000000..63e032e2d --- /dev/null +++ b/selfdrive/camerad/transforms/rgb_to_yuv.cc @@ -0,0 +1,36 @@ +#include "selfdrive/camerad/transforms/rgb_to_yuv.h" + +#include +#include + +Rgb2Yuv::Rgb2Yuv(cl_context ctx, cl_device_id device_id, int width, int height, int rgb_stride) { + assert(width % 2 == 0 && height % 2 == 0); + char args[1024]; + snprintf(args, sizeof(args), + "-cl-fast-relaxed-math -cl-denorms-are-zero " +#ifdef CL_DEBUG + "-DCL_DEBUG " +#endif + "-DWIDTH=%d -DHEIGHT=%d -DUV_WIDTH=%d -DUV_HEIGHT=%d -DRGB_STRIDE=%d -DRGB_SIZE=%d", + width, height, width / 2, height / 2, rgb_stride, width * height); + + cl_program prg = cl_program_from_file(ctx, device_id, "transforms/rgb_to_yuv.cl", args); + krnl = CL_CHECK_ERR(clCreateKernel(prg, "rgb_to_yuv", &err)); + CL_CHECK(clReleaseProgram(prg)); + + work_size[0] = (width + (width % 4 == 0 ? 0 : (4 - width % 4))) / 4; + work_size[1] = (height + (height % 4 == 0 ? 0 : (4 - height % 4))) / 4; +} + +Rgb2Yuv::~Rgb2Yuv() { + CL_CHECK(clReleaseKernel(krnl)); +} + +void Rgb2Yuv::queue(cl_command_queue q, cl_mem rgb_cl, cl_mem yuv_cl) { + CL_CHECK(clSetKernelArg(krnl, 0, sizeof(cl_mem), &rgb_cl)); + CL_CHECK(clSetKernelArg(krnl, 1, sizeof(cl_mem), &yuv_cl)); + cl_event event; + CL_CHECK(clEnqueueNDRangeKernel(q, krnl, 2, NULL, &work_size[0], NULL, 0, 0, &event)); + CL_CHECK(clWaitForEvents(1, &event)); + CL_CHECK(clReleaseEvent(event)); +} diff --git a/selfdrive/camerad/transforms/rgb_to_yuv.cl b/selfdrive/camerad/transforms/rgb_to_yuv.cl new file mode 100644 index 000000000..60dbdb4d5 --- /dev/null +++ b/selfdrive/camerad/transforms/rgb_to_yuv.cl @@ -0,0 +1,127 @@ +#define RGB_TO_Y(r, g, b) ((((mul24(b, 13) + mul24(g, 65) + mul24(r, 33)) + 64) >> 7) + 16) +#define RGB_TO_U(r, g, b) ((mul24(b, 56) - mul24(g, 37) - mul24(r, 19) + 0x8080) >> 8) +#define RGB_TO_V(r, g, b) ((mul24(r, 56) - mul24(g, 47) - mul24(b, 9) + 0x8080) >> 8) +#define AVERAGE(x, y, z, w) ((convert_ushort(x) + convert_ushort(y) + convert_ushort(z) + convert_ushort(w) + 1) >> 1) + +inline void convert_2_ys(__global uchar * out_yuv, int yi, const uchar8 rgbs1) { + uchar2 yy = (uchar2)( + RGB_TO_Y(rgbs1.s2, rgbs1.s1, rgbs1.s0), + RGB_TO_Y(rgbs1.s5, rgbs1.s4, rgbs1.s3) + ); +#ifdef CL_DEBUG + if(yi >= RGB_SIZE) + printf("Y vector2 overflow, %d > %d\n", yi, RGB_SIZE); +#endif + vstore2(yy, 0, out_yuv + yi); +} + +inline void convert_4_ys(__global uchar * out_yuv, int yi, const uchar8 rgbs1, const uchar8 rgbs3) { + const uchar4 yy = (uchar4)( + RGB_TO_Y(rgbs1.s2, rgbs1.s1, rgbs1.s0), + RGB_TO_Y(rgbs1.s5, rgbs1.s4, rgbs1.s3), + RGB_TO_Y(rgbs3.s0, rgbs1.s7, rgbs1.s6), + RGB_TO_Y(rgbs3.s3, rgbs3.s2, rgbs3.s1) + ); +#ifdef CL_DEBUG + if(yi > RGB_SIZE - 4) + printf("Y vector4 overflow, %d > %d\n", yi, RGB_SIZE - 4); +#endif + vstore4(yy, 0, out_yuv + yi); +} + +inline void convert_uv(__global uchar * out_yuv, int ui, int vi, + const uchar8 rgbs1, const uchar8 rgbs2) { + // U & V: average of 2x2 pixels square + const short ab = AVERAGE(rgbs1.s0, rgbs1.s3, rgbs2.s0, rgbs2.s3); + const short ag = AVERAGE(rgbs1.s1, rgbs1.s4, rgbs2.s1, rgbs2.s4); + const short ar = AVERAGE(rgbs1.s2, rgbs1.s5, rgbs2.s2, rgbs2.s5); +#ifdef CL_DEBUG + if(ui >= RGB_SIZE + RGB_SIZE / 4) + printf("U overflow, %d >= %d\n", ui, RGB_SIZE + RGB_SIZE / 4); + if(vi >= RGB_SIZE + RGB_SIZE / 2) + printf("V overflow, %d >= %d\n", vi, RGB_SIZE + RGB_SIZE / 2); +#endif + out_yuv[ui] = RGB_TO_U(ar, ag, ab); + out_yuv[vi] = RGB_TO_V(ar, ag, ab); +} + +inline void convert_2_uvs(__global uchar * out_yuv, int ui, int vi, + const uchar8 rgbs1, const uchar8 rgbs2, const uchar8 rgbs3, const uchar8 rgbs4) { + // U & V: average of 2x2 pixels square + const short ab1 = AVERAGE(rgbs1.s0, rgbs1.s3, rgbs2.s0, rgbs2.s3); + const short ag1 = AVERAGE(rgbs1.s1, rgbs1.s4, rgbs2.s1, rgbs2.s4); + const short ar1 = AVERAGE(rgbs1.s2, rgbs1.s5, rgbs2.s2, rgbs2.s5); + const short ab2 = AVERAGE(rgbs1.s6, rgbs3.s1, rgbs2.s6, rgbs4.s1); + const short ag2 = AVERAGE(rgbs1.s7, rgbs3.s2, rgbs2.s7, rgbs4.s2); + const short ar2 = AVERAGE(rgbs3.s0, rgbs3.s3, rgbs4.s0, rgbs4.s3); + uchar2 u2 = (uchar2)( + RGB_TO_U(ar1, ag1, ab1), + RGB_TO_U(ar2, ag2, ab2) + ); + uchar2 v2 = (uchar2)( + RGB_TO_V(ar1, ag1, ab1), + RGB_TO_V(ar2, ag2, ab2) + ); +#ifdef CL_DEBUG1 + if(ui > RGB_SIZE + RGB_SIZE / 4 - 2) + printf("U 2 overflow, %d >= %d\n", ui, RGB_SIZE + RGB_SIZE / 4 - 2); + if(vi > RGB_SIZE + RGB_SIZE / 2 - 2) + printf("V 2 overflow, %d >= %d\n", vi, RGB_SIZE + RGB_SIZE / 2 - 2); +#endif + vstore2(u2, 0, out_yuv + ui); + vstore2(v2, 0, out_yuv + vi); +} + +__kernel void rgb_to_yuv(__global uchar const * const rgb, + __global uchar * out_yuv) +{ + const int dx = get_global_id(0); + const int dy = get_global_id(1); + const int col = mul24(dx, 4); // Current column in rgb image + const int row = mul24(dy, 4); // Current row in rgb image + const int bgri_start = mad24(row, RGB_STRIDE, mul24(col, 3)); // Start offset of rgb data being converted + const int yi_start = mad24(row, WIDTH, col); // Start offset in the target yuv buffer + int ui = mad24(row / 2, UV_WIDTH, RGB_SIZE + col / 2); + int vi = mad24(row / 2 , UV_WIDTH, RGB_SIZE + UV_WIDTH * UV_HEIGHT + col / 2); + int num_col = min(WIDTH - col, 4); + int num_row = min(HEIGHT - row, 4); + if(num_row == 4) { + const uchar8 rgbs0_0 = vload8(0, rgb + bgri_start); + const uchar8 rgbs0_1 = vload8(0, rgb + bgri_start + 8); + const uchar8 rgbs1_0 = vload8(0, rgb + bgri_start + RGB_STRIDE); + const uchar8 rgbs1_1 = vload8(0, rgb + bgri_start + RGB_STRIDE + 8); + const uchar8 rgbs2_0 = vload8(0, rgb + bgri_start + RGB_STRIDE * 2); + const uchar8 rgbs2_1 = vload8(0, rgb + bgri_start + RGB_STRIDE * 2 + 8); + const uchar8 rgbs3_0 = vload8(0, rgb + bgri_start + RGB_STRIDE * 3); + const uchar8 rgbs3_1 = vload8(0, rgb + bgri_start + RGB_STRIDE * 3 + 8); + if(num_col == 4) { + convert_4_ys(out_yuv, yi_start, rgbs0_0, rgbs0_1); + convert_4_ys(out_yuv, yi_start + WIDTH, rgbs1_0, rgbs1_1); + convert_4_ys(out_yuv, yi_start + WIDTH * 2, rgbs2_0, rgbs2_1); + convert_4_ys(out_yuv, yi_start + WIDTH * 3, rgbs3_0, rgbs3_1); + convert_2_uvs(out_yuv, ui, vi, rgbs0_0, rgbs1_0, rgbs0_1, rgbs1_1); + convert_2_uvs(out_yuv, ui + UV_WIDTH, vi + UV_WIDTH, rgbs2_0, rgbs3_0, rgbs2_1, rgbs3_1); + } else if(num_col == 2) { + convert_2_ys(out_yuv, yi_start, rgbs0_0); + convert_2_ys(out_yuv, yi_start + WIDTH, rgbs1_0); + convert_2_ys(out_yuv, yi_start + WIDTH * 2, rgbs2_0); + convert_2_ys(out_yuv, yi_start + WIDTH * 3, rgbs3_0); + convert_uv(out_yuv, ui, vi, rgbs0_0, rgbs1_0); + convert_uv(out_yuv, ui + UV_WIDTH, vi + UV_WIDTH, rgbs2_0, rgbs3_0); + } + } else { + const uchar8 rgbs0_0 = vload8(0, rgb + bgri_start); + const uchar8 rgbs0_1 = vload8(0, rgb + bgri_start + 8); + const uchar8 rgbs1_0 = vload8(0, rgb + bgri_start + RGB_STRIDE); + const uchar8 rgbs1_1 = vload8(0, rgb + bgri_start + RGB_STRIDE + 8); + if(num_col == 4) { + convert_4_ys(out_yuv, yi_start, rgbs0_0, rgbs0_1); + convert_4_ys(out_yuv, yi_start + WIDTH, rgbs1_0, rgbs1_1); + convert_2_uvs(out_yuv, ui, vi, rgbs0_0, rgbs1_0, rgbs0_1, rgbs1_1); + } else if(num_col == 2) { + convert_2_ys(out_yuv, yi_start, rgbs0_0); + convert_2_ys(out_yuv, yi_start + WIDTH, rgbs1_0); + convert_uv(out_yuv, ui, vi, rgbs0_0, rgbs1_0); + } + } +} diff --git a/selfdrive/camerad/transforms/rgb_to_yuv.h b/selfdrive/camerad/transforms/rgb_to_yuv.h new file mode 100644 index 000000000..3bb50669e --- /dev/null +++ b/selfdrive/camerad/transforms/rgb_to_yuv.h @@ -0,0 +1,14 @@ +#pragma once + +#include "selfdrive/common/clutil.h" + +class Rgb2Yuv { +public: + Rgb2Yuv(cl_context ctx, cl_device_id device_id, int width, int height, int rgb_stride); + ~Rgb2Yuv(); + void queue(cl_command_queue q, cl_mem rgb_cl, cl_mem yuv_cl); +private: + size_t work_size[2]; + cl_kernel krnl; +}; + diff --git a/selfdrive/camerad/transforms/rgb_to_yuv_test.cc b/selfdrive/camerad/transforms/rgb_to_yuv_test.cc new file mode 100644 index 000000000..74db2bc1c --- /dev/null +++ b/selfdrive/camerad/transforms/rgb_to_yuv_test.cc @@ -0,0 +1,191 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef ANDROID + +#define MAXE 0 +#include + +#else +// The libyuv implementation on ARM is slightly different than on x86 +// Our implementation matches the ARM version, so accept errors of 1 +#define MAXE 1 + +#endif + +#include + +#include "libyuv.h" +#include "selfdrive/camerad/transforms/rgb_to_yuv.h" +#include "selfdrive/common/clutil.h" + +static inline double millis_since_boot() { + struct timespec t; + clock_gettime(CLOCK_BOOTTIME, &t); + return t.tv_sec * 1000.0 + t.tv_nsec * 1e-6; +} + +void cl_init(cl_device_id &device_id, cl_context &context) { + device_id = cl_get_device_id(CL_DEVICE_TYPE_DEFAULT); + context = CL_CHECK_ERR(clCreateContext(NULL, 1, &device_id, NULL, NULL, &err)); +} + + +bool compare_results(uint8_t *a, uint8_t *b, int len, int stride, int width, int height, uint8_t *rgb) { + int min_diff = 0., max_diff = 0., max_e = 0.; + int e1 = 0, e0 = 0; + int e0y = 0, e0u = 0, e0v = 0, e1y = 0, e1u = 0, e1v = 0; + int max_e_i = 0; + for (int i = 0;i < len;i++) { + int e = ((int)a[i]) - ((int)b[i]); + if(e < min_diff) { + min_diff = e; + } + if(e > max_diff) { + max_diff = e; + } + int e_abs = std::abs(e); + if(e_abs > max_e) { + max_e = e_abs; + max_e_i = i; + } + if(e_abs < 1) { + e0++; + if(i < stride * height) + e0y++; + else if(i < stride * height + stride * height / 4) + e0u++; + else + e0v++; + } else { + e1++; + if(i < stride * height) + e1y++; + else if(i < stride * height + stride * height / 4) + e1u++; + else + e1v++; + } + } + //printf("max diff : %d, min diff : %d, e < 1: %d, e >= 1: %d\n", max_diff, min_diff, e0, e1); + //printf("Y: e < 1: %d, e >= 1: %d, U: e < 1: %d, e >= 1: %d, V: e < 1: %d, e >= 1: %d\n", e0y, e1y, e0u, e1u, e0v, e1v); + if(max_e <= MAXE) { + return true; + } + int row = max_e_i / stride; + if(row < height) { + printf("max error is Y: %d = (libyuv: %u - cl: %u), row: %d, col: %d\n", max_e, a[max_e_i], b[max_e_i], row, max_e_i % stride); + } else if(row >= height && row < (height + height / 4)) { + printf("max error is U: %d = %u - %u, row: %d, col: %d\n", max_e, a[max_e_i], b[max_e_i], (row - height) / 2, max_e_i % stride / 2); + } else { + printf("max error is V: %d = %u - %u, row: %d, col: %d\n", max_e, a[max_e_i], b[max_e_i], (row - height - height / 4) / 2, max_e_i % stride / 2); + } + return false; +} + +int main(int argc, char** argv) { + srand(1337); + + cl_device_id device_id; + cl_context context; + cl_init(device_id, context) ; + + int err; + const cl_queue_properties props[] = {0}; //CL_QUEUE_PRIORITY_KHR, CL_QUEUE_PRIORITY_HIGH_KHR, 0}; + cl_command_queue q = clCreateCommandQueueWithProperties(context, device_id, props, &err); + if(err != 0) { + std::cout << "clCreateCommandQueueWithProperties error: " << err << std::endl; + } + + int width = 1164; + int height = 874; + + int opt = 0; + while ((opt = getopt(argc, argv, "f")) != -1) + { + switch (opt) + { + case 'f': + std::cout << "Using front camera dimensions" << std::endl; + int width = 1152; + int height = 846; + } + } + + std::cout << "Width: " << width << " Height: " << height << std::endl; + uint8_t *rgb_frame = new uint8_t[width * height * 3]; + + + RGBToYUVState rgb_to_yuv_state; + rgb_to_yuv_init(&rgb_to_yuv_state, context, device_id, width, height, width * 3); + + int frame_yuv_buf_size = width * height * 3 / 2; + cl_mem yuv_cl = CL_CHECK_ERR(clCreateBuffer(context, CL_MEM_READ_WRITE, frame_yuv_buf_size, (void*)NULL, &err)); + uint8_t *frame_yuv_buf = new uint8_t[frame_yuv_buf_size]; + uint8_t *frame_yuv_ptr_y = frame_yuv_buf; + uint8_t *frame_yuv_ptr_u = frame_yuv_buf + (width * height); + uint8_t *frame_yuv_ptr_v = frame_yuv_ptr_u + ((width/2) * (height/2)); + + cl_mem rgb_cl = CL_CHECK_ERR(clCreateBuffer(context, CL_MEM_READ_WRITE, width * height * 3, (void*)NULL, &err)); + int mismatched = 0; + int counter = 0; + srand (time(NULL)); + + for (int i = 0; i < 100; i++) { + for (int i = 0; i < width * height * 3; i++) { + rgb_frame[i] = (uint8_t)rand(); + } + + double t1 = millis_since_boot(); + libyuv::RGB24ToI420((uint8_t*)rgb_frame, width * 3, + frame_yuv_ptr_y, width, + frame_yuv_ptr_u, width/2, + frame_yuv_ptr_v, width/2, + width, height); + double t2 = millis_since_boot(); + //printf("Libyuv: rgb to yuv: %.2fms\n", t2-t1); + + clEnqueueWriteBuffer(q, rgb_cl, CL_TRUE, 0, width * height * 3, (void *)rgb_frame, 0, NULL, NULL); + t1 = millis_since_boot(); + rgb_to_yuv_queue(&rgb_to_yuv_state, q, rgb_cl, yuv_cl); + t2 = millis_since_boot(); + + //printf("OpenCL: rgb to yuv: %.2fms\n", t2-t1); + uint8_t *yyy = (uint8_t *)clEnqueueMapBuffer(q, yuv_cl, CL_TRUE, + CL_MAP_READ, 0, frame_yuv_buf_size, + 0, NULL, NULL, &err); + if(!compare_results(frame_yuv_ptr_y, yyy, frame_yuv_buf_size, width, width, height, (uint8_t*)rgb_frame)) + mismatched++; + clEnqueueUnmapMemObject(q, yuv_cl, yyy, 0, NULL, NULL); + + // std::this_thread::sleep_for(std::chrono::milliseconds(20)); + if(counter++ % 100 == 0) + printf("Matched: %d, Mismatched: %d\n", counter - mismatched, mismatched); + + } + printf("Matched: %d, Mismatched: %d\n", counter - mismatched, mismatched); + + delete[] frame_yuv_buf; + rgb_to_yuv_destroy(&rgb_to_yuv_state); + clReleaseContext(context); + delete[] rgb_frame; + + if (mismatched == 0) + return 0; + else + return -1; +} diff --git a/selfdrive/car/__init__.py b/selfdrive/car/__init__.py new file mode 100644 index 000000000..408e0d075 --- /dev/null +++ b/selfdrive/car/__init__.py @@ -0,0 +1,132 @@ +# functions common among cars +from cereal import car +from common.numpy_fast import clip + +# kg of standard extra cargo to count for drive, gas, etc... +STD_CARGO_KG = 136. + + +def gen_empty_fingerprint(): + return {i: {} for i in range(0, 4)} + + +# FIXME: hardcoding honda civic 2016 touring params so they can be used to +# scale unknown params for other cars +class CivicParams: + MASS = 1326. + STD_CARGO_KG + WHEELBASE = 2.70 + CENTER_TO_FRONT = WHEELBASE * 0.4 + CENTER_TO_REAR = WHEELBASE - CENTER_TO_FRONT + ROTATIONAL_INERTIA = 2500 + TIRE_STIFFNESS_FRONT = 192150 + TIRE_STIFFNESS_REAR = 202500 + + +# TODO: get actual value, for now starting with reasonable value for +# civic and scaling by mass and wheelbase +def scale_rot_inertia(mass, wheelbase): + return CivicParams.ROTATIONAL_INERTIA * mass * wheelbase ** 2 / (CivicParams.MASS * CivicParams.WHEELBASE ** 2) + + +# TODO: start from empirically derived lateral slip stiffness for the civic and scale by +# mass and CG position, so all cars will have approximately similar dyn behaviors +def scale_tire_stiffness(mass, wheelbase, center_to_front, tire_stiffness_factor=1.0): + center_to_rear = wheelbase - center_to_front + tire_stiffness_front = (CivicParams.TIRE_STIFFNESS_FRONT * tire_stiffness_factor) * mass / CivicParams.MASS * \ + (center_to_rear / wheelbase) / (CivicParams.CENTER_TO_REAR / CivicParams.WHEELBASE) + + tire_stiffness_rear = (CivicParams.TIRE_STIFFNESS_REAR * tire_stiffness_factor) * mass / CivicParams.MASS * \ + (center_to_front / wheelbase) / (CivicParams.CENTER_TO_FRONT / CivicParams.WHEELBASE) + + return tire_stiffness_front, tire_stiffness_rear + + +def dbc_dict(pt_dbc, radar_dbc, chassis_dbc=None, body_dbc=None): + return {'pt': pt_dbc, 'radar': radar_dbc, 'chassis': chassis_dbc, 'body': body_dbc} + + +def apply_std_steer_torque_limits(apply_torque, apply_torque_last, driver_torque, LIMITS): + + # limits due to driver torque + driver_max_torque = LIMITS.STEER_MAX + (LIMITS.STEER_DRIVER_ALLOWANCE + driver_torque * LIMITS.STEER_DRIVER_FACTOR) * LIMITS.STEER_DRIVER_MULTIPLIER + driver_min_torque = -LIMITS.STEER_MAX + (-LIMITS.STEER_DRIVER_ALLOWANCE + driver_torque * LIMITS.STEER_DRIVER_FACTOR) * LIMITS.STEER_DRIVER_MULTIPLIER + max_steer_allowed = max(min(LIMITS.STEER_MAX, driver_max_torque), 0) + min_steer_allowed = min(max(-LIMITS.STEER_MAX, driver_min_torque), 0) + apply_torque = clip(apply_torque, min_steer_allowed, max_steer_allowed) + + # slow rate if steer torque increases in magnitude + if apply_torque_last > 0: + apply_torque = clip(apply_torque, max(apply_torque_last - LIMITS.STEER_DELTA_DOWN, -LIMITS.STEER_DELTA_UP), + apply_torque_last + LIMITS.STEER_DELTA_UP) + else: + apply_torque = clip(apply_torque, apply_torque_last - LIMITS.STEER_DELTA_UP, + min(apply_torque_last + LIMITS.STEER_DELTA_DOWN, LIMITS.STEER_DELTA_UP)) + + return int(round(float(apply_torque))) + + +def apply_toyota_steer_torque_limits(apply_torque, apply_torque_last, motor_torque, LIMITS): + # limits due to comparison of commanded torque VS motor reported torque + max_lim = min(max(motor_torque + LIMITS.STEER_ERROR_MAX, LIMITS.STEER_ERROR_MAX), LIMITS.STEER_MAX) + min_lim = max(min(motor_torque - LIMITS.STEER_ERROR_MAX, -LIMITS.STEER_ERROR_MAX), -LIMITS.STEER_MAX) + + apply_torque = clip(apply_torque, min_lim, max_lim) + + # slow rate if steer torque increases in magnitude + if apply_torque_last > 0: + apply_torque = clip(apply_torque, + max(apply_torque_last - LIMITS.STEER_DELTA_DOWN, -LIMITS.STEER_DELTA_UP), + apply_torque_last + LIMITS.STEER_DELTA_UP) + else: + apply_torque = clip(apply_torque, + apply_torque_last - LIMITS.STEER_DELTA_UP, + min(apply_torque_last + LIMITS.STEER_DELTA_DOWN, LIMITS.STEER_DELTA_UP)) + + return int(round(float(apply_torque))) + + +def crc8_pedal(data): + crc = 0xFF # standard init value + poly = 0xD5 # standard crc8: x8+x7+x6+x4+x2+1 + size = len(data) + for i in range(size - 1, -1, -1): + crc ^= data[i] + for _ in range(8): + if ((crc & 0x80) != 0): + crc = ((crc << 1) ^ poly) & 0xFF + else: + crc <<= 1 + return crc + + +def create_gas_interceptor_command(packer, gas_amount, idx): + # Common gas pedal msg generator + enable = gas_amount > 0.001 + + values = { + "ENABLE": enable, + "COUNTER_PEDAL": idx & 0xF, + } + + if enable: + values["GAS_COMMAND"] = gas_amount * 255. + values["GAS_COMMAND2"] = gas_amount * 255. + + dat = packer.make_can_msg("GAS_COMMAND", 0, values)[2] + + checksum = crc8_pedal(dat[:-1]) + values["CHECKSUM_PEDAL"] = checksum + + return packer.make_can_msg("GAS_COMMAND", 0, values) + + +def make_can_msg(addr, dat, bus): + return [addr, 0, dat, bus] + + +def get_safety_config(safety_model, safety_param = None): + ret = car.CarParams.SafetyConfig.new_message() + ret.safetyModel = safety_model + if safety_param is not None: + ret.safetyParam = safety_param + return ret diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py new file mode 100644 index 000000000..fda94f5d8 --- /dev/null +++ b/selfdrive/car/car_helpers.py @@ -0,0 +1,191 @@ +import os +from common.params import Params +from common.basedir import BASEDIR +from selfdrive.version import is_comma_remote, is_tested_branch +from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars +from selfdrive.car.vin import get_vin, VIN_UNKNOWN +from selfdrive.car.fw_versions import get_fw_versions, match_fw_to_car +from selfdrive.swaglog import cloudlog +import cereal.messaging as messaging +from selfdrive.car import gen_empty_fingerprint +from selfdrive.car.modules.CFG_module import load_bool_param + +from cereal import car +EventName = car.CarEvent.EventName + + +def get_startup_event(car_recognized, controller_available, fw_seen): + if is_comma_remote() and is_tested_branch(): + event = EventName.startup + else: + event = EventName.startupMaster + + if not car_recognized: + if fw_seen: + event = EventName.startupNoCar + else: + event = EventName.startupNoFw + elif car_recognized and not controller_available: + event = EventName.startupNoControl + return event + + +def get_one_can(logcan): + while True: + can = messaging.recv_one_retry(logcan) + if len(can.can) > 0: + return can + + +def load_interfaces(brand_names): + ret = {} + for brand_name in brand_names: + path = f'selfdrive.car.{brand_name}' + CarInterface = __import__(path + '.interface', fromlist=['CarInterface']).CarInterface + + if os.path.exists(BASEDIR + '/' + path.replace('.', '/') + '/carstate.py'): + CarState = __import__(path + '.carstate', fromlist=['CarState']).CarState + else: + CarState = None + + if os.path.exists(BASEDIR + '/' + path.replace('.', '/') + '/carcontroller.py'): + CarController = __import__(path + '.carcontroller', fromlist=['CarController']).CarController + else: + CarController = None + + for model_name in brand_names[brand_name]: + ret[model_name] = (CarInterface, CarController, CarState) + return ret + + +def _get_interface_names(): + # read all the folders in selfdrive/car and return a dict where: + # - keys are all the car names that which we have an interface for + # - values are lists of spefic car models for a given car + brand_names = {} + for car_folder in [x[0] for x in os.walk(BASEDIR + '/selfdrive/car')]: + try: + brand_name = car_folder.split('/')[-1] + model_names = __import__(f'selfdrive.car.{brand_name}.values', fromlist=['CAR']).CAR + model_names = [getattr(model_names, c) for c in model_names.__dict__.keys() if not c.startswith("__")] + brand_names[brand_name] = model_names + except (ImportError, OSError): + pass + + return brand_names + + +# imports from directory selfdrive/car// +interface_names = _get_interface_names() +interfaces = load_interfaces(interface_names) + + +# **** for use live only **** +def fingerprint(logcan, sendcan): + fixed_fingerprint = os.environ.get('FINGERPRINT', "") + skip_fw_query = os.environ.get('SKIP_FW_QUERY', False) + + if not fixed_fingerprint and not skip_fw_query: + # Vin query only reliably works thorugh OBDII + bus = 1 + + cached_params = Params().get("CarParamsCache") + if cached_params is not None: + cached_params = car.CarParams.from_bytes(cached_params) + if cached_params.carName == "mock": + cached_params = None + + if cached_params is not None and len(cached_params.carFw) > 0 and cached_params.carVin is not VIN_UNKNOWN: + cloudlog.warning("Using cached CarParams") + vin = cached_params.carVin + car_fw = list(cached_params.carFw) + else: + cloudlog.warning("Getting VIN & FW versions") + _, vin = get_vin(logcan, sendcan, bus) + car_fw = get_fw_versions(logcan, sendcan, bus) + + exact_fw_match, fw_candidates = match_fw_to_car(car_fw) + else: + vin = VIN_UNKNOWN + exact_fw_match, fw_candidates, car_fw = True, set(), [] + + cloudlog.warning("VIN %s", vin) + Params().put("CarVin", vin) + + finger = gen_empty_fingerprint() + candidate_cars = {i: all_legacy_fingerprint_cars() for i in [0, 1]} # attempt fingerprint on both bus 0 and 1 + frame = 0 + frame_fingerprint = 10 # 0.1s + car_fingerprint = None + done = False + + while not done: + a = get_one_can(logcan) + + for can in a.can: + # The fingerprint dict is generated for all buses, this way the car interface + # can use it to detect a (valid) multipanda setup and initialize accordingly + if can.src < 128: + if can.src not in finger: + finger[can.src] = {} + finger[can.src][can.address] = len(can.dat) + + for b in candidate_cars: + # Ignore extended messages and VIN query response. + if can.src == b and can.address < 0x800 and can.address not in (0x7df, 0x7e0, 0x7e8): + candidate_cars[b] = eliminate_incompatible_cars(can, candidate_cars[b]) + + # if we only have one car choice and the time since we got our first + # message has elapsed, exit + for b in candidate_cars: + if len(candidate_cars[b]) == 1 and frame > frame_fingerprint: + # fingerprint done + car_fingerprint = candidate_cars[b][0] + + + if load_bool_param("TinklaForceTeslaPreAP",False): + print ("Fingerprinting Failed: Returning PreAP Tesla Model S (based on branch)") + car_fingerprint = "TESLA MODEL S" + vin = "TESLAFAKEVIN12345" + + + # bail if no cars left or we've been waiting for more than 2s + failed = (all(len(cc) == 0 for cc in candidate_cars.values()) and frame > frame_fingerprint) or frame > 200 + succeeded = car_fingerprint is not None + done = failed or succeeded + + frame += 1 + + exact_match = True + source = car.CarParams.FingerprintSource.can + + # If FW query returns exactly 1 candidate, use it + if len(fw_candidates) == 1 and not load_bool_param("TinklaForceTeslaPreAP",False): + car_fingerprint = list(fw_candidates)[0] + source = car.CarParams.FingerprintSource.fw + exact_match = exact_fw_match + + if fixed_fingerprint: + car_fingerprint = fixed_fingerprint + source = car.CarParams.FingerprintSource.fixed + + cloudlog.event("fingerprinted", car_fingerprint=car_fingerprint, + source=source, fuzzy=not exact_match, fw_count=len(car_fw)) + return car_fingerprint, finger, vin, car_fw, source, exact_match + + +def get_car(logcan, sendcan): + candidate, fingerprints, vin, car_fw, source, exact_match = fingerprint(logcan, sendcan) + + if candidate is None: + cloudlog.warning("car doesn't match any fingerprints: %r", fingerprints) + candidate = "mock" + + CarInterface, CarController, CarState = interfaces[candidate] + car_params = CarInterface.get_params(candidate, fingerprints, car_fw) + car_params.carVin = vin + car_params.carFw = car_fw + car_params.fingerprintSource = source + car_params.fuzzyFingerprint = not exact_match + + return CarInterface(car_params, CarController, CarState), car_params diff --git a/selfdrive/car/chrysler/__init__.py b/selfdrive/car/chrysler/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/chrysler/carcontroller.py b/selfdrive/car/chrysler/carcontroller.py new file mode 100644 index 000000000..b72a23f0b --- /dev/null +++ b/selfdrive/car/chrysler/carcontroller.py @@ -0,0 +1,73 @@ +from cereal import car +from selfdrive.car import apply_toyota_steer_torque_limits +from selfdrive.car.chrysler.chryslercan import create_lkas_hud, create_lkas_command, \ + create_wheel_buttons +from selfdrive.car.chrysler.values import CAR, CarControllerParams +from opendbc.can.packer import CANPacker + +class CarController(): + def __init__(self, dbc_name, CP, VM): + self.apply_steer_last = 0 + self.ccframe = 0 + self.prev_frame = -1 + self.hud_count = 0 + self.car_fingerprint = CP.carFingerprint + self.gone_fast_yet = False + self.steer_rate_limited = False + + self.packer = CANPacker(dbc_name) + + def update(self, enabled, CS, actuators, pcm_cancel_cmd, hud_alert): + # this seems needed to avoid steering faults and to force the sync with the EPS counter + frame = CS.lkas_counter + if self.prev_frame == frame: + return car.CarControl.Actuators.new_message(), [] + + # steer torque + new_steer = int(round(actuators.steer * CarControllerParams.STEER_MAX)) + apply_steer = apply_toyota_steer_torque_limits(new_steer, self.apply_steer_last, + CS.out.steeringTorqueEps, CarControllerParams) + self.steer_rate_limited = new_steer != apply_steer + + moving_fast = CS.out.vEgo > CS.CP.minSteerSpeed # for status message + if CS.out.vEgo > (CS.CP.minSteerSpeed - 0.5): # for command high bit + self.gone_fast_yet = True + elif self.car_fingerprint in (CAR.PACIFICA_2019_HYBRID, CAR.PACIFICA_2020, CAR.JEEP_CHEROKEE_2019): + if CS.out.vEgo < (CS.CP.minSteerSpeed - 3.0): + self.gone_fast_yet = False # < 14.5m/s stock turns off this bit, but fine down to 13.5 + lkas_active = moving_fast and enabled and not CS.human_control + + if not lkas_active: + apply_steer = 0 + + self.apply_steer_last = apply_steer + + can_sends = [] + + #*** control msgs *** + + if pcm_cancel_cmd: + # TODO: would be better to start from frame_2b3 + new_msg = create_wheel_buttons(self.packer, self.ccframe, cancel=True) + can_sends.append(new_msg) + + # LKAS_HEARTBIT is forwarded by Panda so no need to send it here. + # frame is 100Hz (0.01s period) + if (self.ccframe % 25 == 0): # 0.25s period + if (CS.lkas_car_model != -1): + new_msg = create_lkas_hud( + self.packer, CS.out.gearShifter, lkas_active, hud_alert, + self.hud_count, CS.lkas_car_model) + can_sends.append(new_msg) + self.hud_count += 1 + + new_msg = create_lkas_command(self.packer, int(apply_steer), self.gone_fast_yet, frame) + can_sends.append(new_msg) + + self.ccframe += 1 + self.prev_frame = frame + + new_actuators = actuators.copy() + new_actuators.steer = apply_steer / CarControllerParams.STEER_MAX + + return new_actuators, can_sends diff --git a/selfdrive/car/chrysler/carstate.py b/selfdrive/car/chrysler/carstate.py new file mode 100644 index 000000000..30a0bf6a3 --- /dev/null +++ b/selfdrive/car/chrysler/carstate.py @@ -0,0 +1,147 @@ +from cereal import car +from opendbc.can.parser import CANParser +from opendbc.can.can_define import CANDefine +from selfdrive.config import Conversions as CV +from selfdrive.car.interfaces import CarStateBase +from selfdrive.car.chrysler.values import DBC, STEER_THRESHOLD + + +class CarState(CarStateBase): + def __init__(self, CP): + super().__init__(CP) + can_define = CANDefine(DBC[CP.carFingerprint]["pt"]) + self.shifter_values = can_define.dv["GEAR"]["PRNDL"] + + def update(self, cp, cp_cam): + + ret = car.CarState.new_message() + + self.frame = int(cp.vl["EPS_STATUS"]["COUNTER"]) + + ret.doorOpen = any([cp.vl["DOORS"]["DOOR_OPEN_FL"], + cp.vl["DOORS"]["DOOR_OPEN_FR"], + cp.vl["DOORS"]["DOOR_OPEN_RL"], + cp.vl["DOORS"]["DOOR_OPEN_RR"]]) + ret.seatbeltUnlatched = cp.vl["SEATBELT_STATUS"]["SEATBELT_DRIVER_UNLATCHED"] == 1 + + ret.brakePressed = cp.vl["BRAKE_2"]["BRAKE_PRESSED_2"] == 5 # human-only + ret.brake = 0 + ret.gas = cp.vl["ACCEL_GAS_134"]["ACCEL_134"] + ret.gasPressed = ret.gas > 1e-5 + + ret.espDisabled = (cp.vl["TRACTION_BUTTON"]["TRACTION_OFF"] == 1) + + ret.wheelSpeeds = self.get_wheel_speeds( + cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_FL"], + cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_FR"], + cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_RL"], + cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_RR"], + unit=1, + ) + ret.vEgoRaw = (cp.vl["SPEED_1"]["SPEED_LEFT"] + cp.vl["SPEED_1"]["SPEED_RIGHT"]) / 2. + ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) + ret.standstill = not ret.vEgoRaw > 0.001 + + ret.leftBlinker = cp.vl["STEERING_LEVERS"]["TURN_SIGNALS"] == 1 + ret.rightBlinker = cp.vl["STEERING_LEVERS"]["TURN_SIGNALS"] == 2 + ret.steeringAngleDeg = cp.vl["STEERING"]["STEER_ANGLE"] + ret.steeringRateDeg = cp.vl["STEERING"]["STEERING_RATE"] + ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(cp.vl["GEAR"]["PRNDL"], None)) + + ret.cruiseState.enabled = cp.vl["ACC_2"]["ACC_STATUS_2"] == 7 # ACC is green. + ret.cruiseState.available = ret.cruiseState.enabled # FIXME: for now same as enabled + ret.cruiseState.speed = cp.vl["DASHBOARD"]["ACC_SPEED_CONFIG_KPH"] * CV.KPH_TO_MS + # CRUISE_STATE is a three bit msg, 0 is off, 1 and 2 are Non-ACC mode, 3 and 4 are ACC mode, find if there are other states too + ret.cruiseState.nonAdaptive = cp.vl["DASHBOARD"]["CRUISE_STATE"] in (1, 2) + + ret.steeringTorque = cp.vl["EPS_STATUS"]["TORQUE_DRIVER"] + ret.steeringTorqueEps = cp.vl["EPS_STATUS"]["TORQUE_MOTOR"] + ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD + steer_state = cp.vl["EPS_STATUS"]["LKAS_STATE"] + ret.steerError = steer_state == 4 or (steer_state == 0 and ret.vEgo > self.CP.minSteerSpeed) + + ret.genericToggle = bool(cp.vl["STEERING_LEVERS"]["HIGH_BEAM_FLASH"]) + + if self.CP.enableBsm: + ret.leftBlindspot = cp.vl["BLIND_SPOT_WARNINGS"]["BLIND_SPOT_LEFT"] == 1 + ret.rightBlindspot = cp.vl["BLIND_SPOT_WARNINGS"]["BLIND_SPOT_RIGHT"] == 1 + + self.lkas_counter = cp_cam.vl["LKAS_COMMAND"]["COUNTER"] + self.lkas_car_model = cp_cam.vl["LKAS_HUD"]["CAR_MODEL"] + self.lkas_status_ok = cp_cam.vl["LKAS_HEARTBIT"]["LKAS_STATUS_OK"] + + return ret + + @staticmethod + def get_can_parser(CP): + signals = [ + # sig_name, sig_address + ("PRNDL", "GEAR"), + ("DOOR_OPEN_FL", "DOORS"), + ("DOOR_OPEN_FR", "DOORS"), + ("DOOR_OPEN_RL", "DOORS"), + ("DOOR_OPEN_RR", "DOORS"), + ("BRAKE_PRESSED_2", "BRAKE_2"), + ("ACCEL_134", "ACCEL_GAS_134"), + ("SPEED_LEFT", "SPEED_1"), + ("SPEED_RIGHT", "SPEED_1"), + ("WHEEL_SPEED_FL", "WHEEL_SPEEDS"), + ("WHEEL_SPEED_RR", "WHEEL_SPEEDS"), + ("WHEEL_SPEED_RL", "WHEEL_SPEEDS"), + ("WHEEL_SPEED_FR", "WHEEL_SPEEDS"), + ("STEER_ANGLE", "STEERING"), + ("STEERING_RATE", "STEERING"), + ("TURN_SIGNALS", "STEERING_LEVERS"), + ("ACC_STATUS_2", "ACC_2"), + ("HIGH_BEAM_FLASH", "STEERING_LEVERS"), + ("ACC_SPEED_CONFIG_KPH", "DASHBOARD"), + ("CRUISE_STATE", "DASHBOARD"), + ("TORQUE_DRIVER", "EPS_STATUS"), + ("TORQUE_MOTOR", "EPS_STATUS"), + ("LKAS_STATE", "EPS_STATUS"), + ("COUNTER", "EPS_STATUS",), + ("TRACTION_OFF", "TRACTION_BUTTON"), + ("SEATBELT_DRIVER_UNLATCHED", "SEATBELT_STATUS"), + ] + + checks = [ + # sig_address, frequency + ("BRAKE_2", 50), + ("EPS_STATUS", 100), + ("SPEED_1", 100), + ("WHEEL_SPEEDS", 50), + ("STEERING", 100), + ("ACC_2", 50), + ("GEAR", 50), + ("ACCEL_GAS_134", 50), + ("DASHBOARD", 15), + ("STEERING_LEVERS", 10), + ("SEATBELT_STATUS", 2), + ("DOORS", 1), + ("TRACTION_BUTTON", 1), + ] + + if CP.enableBsm: + signals += [ + ("BLIND_SPOT_RIGHT", "BLIND_SPOT_WARNINGS"), + ("BLIND_SPOT_LEFT", "BLIND_SPOT_WARNINGS"), + ] + checks.append(("BLIND_SPOT_WARNINGS", 2)) + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 0) + + @staticmethod + def get_cam_can_parser(CP): + signals = [ + # sig_name, sig_address + ("COUNTER", "LKAS_COMMAND"), + ("CAR_MODEL", "LKAS_HUD"), + ("LKAS_STATUS_OK", "LKAS_HEARTBIT") + ] + checks = [ + ("LKAS_COMMAND", 100), + ("LKAS_HEARTBIT", 10), + ("LKAS_HUD", 4), + ] + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 2) diff --git a/selfdrive/car/chrysler/chryslercan.py b/selfdrive/car/chrysler/chryslercan.py new file mode 100644 index 000000000..4d5226570 --- /dev/null +++ b/selfdrive/car/chrysler/chryslercan.py @@ -0,0 +1,57 @@ +from cereal import car +from selfdrive.car import make_can_msg + + +GearShifter = car.CarState.GearShifter +VisualAlert = car.CarControl.HUDControl.VisualAlert + +def create_lkas_hud(packer, gear, lkas_active, hud_alert, hud_count, lkas_car_model): + # LKAS_HUD 0x2a6 (678) Controls what lane-keeping icon is displayed. + + if hud_alert in (VisualAlert.steerRequired, VisualAlert.ldw): + msg = b'\x00\x00\x00\x03\x00\x00\x00\x00' + return make_can_msg(0x2a6, msg, 0) + + color = 1 # default values are for park or neutral in 2017 are 0 0, but trying 1 1 for 2019 + lines = 1 + alerts = 0 + + if hud_count < (1 * 4): # first 3 seconds, 4Hz + alerts = 1 + # CAR.PACIFICA_2018_HYBRID and CAR.PACIFICA_2019_HYBRID + # had color = 1 and lines = 1 but trying 2017 hybrid style for now. + if gear in (GearShifter.drive, GearShifter.reverse, GearShifter.low): + if lkas_active: + color = 2 # control active, display green. + lines = 6 + else: + color = 1 # control off, display white. + lines = 1 + + values = { + "LKAS_ICON_COLOR": color, # byte 0, last 2 bits + "CAR_MODEL": lkas_car_model, # byte 1 + "LKAS_LANE_LINES": lines, # byte 2, last 4 bits + "LKAS_ALERTS": alerts, # byte 3, last 4 bits + } + + return packer.make_can_msg("LKAS_HUD", 0, values) # 0x2a6 + + +def create_lkas_command(packer, apply_steer, moving_fast, frame): + # LKAS_COMMAND 0x292 (658) Lane-keeping signal to turn the wheel. + values = { + "LKAS_STEERING_TORQUE": apply_steer, + "LKAS_HIGH_TORQUE": int(moving_fast), + "COUNTER": frame % 0x10, + } + return packer.make_can_msg("LKAS_COMMAND", 0, values) + + +def create_wheel_buttons(packer, frame, cancel=False): + # WHEEL_BUTTONS (571) Message sent to cancel ACC. + values = { + "ACC_CANCEL": cancel, + "COUNTER": frame % 10 + } + return packer.make_can_msg("WHEEL_BUTTONS", 0, values) diff --git a/selfdrive/car/chrysler/interface.py b/selfdrive/car/chrysler/interface.py new file mode 100755 index 000000000..a01ebd227 --- /dev/null +++ b/selfdrive/car/chrysler/interface.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python3 +from cereal import car +from selfdrive.car.chrysler.values import CAR +from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config +from selfdrive.car.interfaces import CarInterfaceBase + + +class CarInterface(CarInterfaceBase): + @staticmethod + def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None): + ret = CarInterfaceBase.get_std_params(candidate, fingerprint) + ret.carName = "chrysler" + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.chrysler)] + + # Speed conversion: 20, 45 mph + ret.wheelbase = 3.089 # in meters for Pacifica Hybrid 2017 + ret.steerRatio = 16.2 # Pacifica Hybrid 2017 + ret.mass = 2242. + STD_CARGO_KG # kg curb weight Pacifica Hybrid 2017 + ret.lateralTuning.pid.kpBP, ret.lateralTuning.pid.kiBP = [[9., 20.], [9., 20.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.15, 0.30], [0.03, 0.05]] + ret.lateralTuning.pid.kf = 0.00006 # full torque for 10 deg at 80mph means 0.00007818594 + ret.steerActuatorDelay = 0.1 + ret.steerRateCost = 0.7 + ret.steerLimitTimer = 0.4 + + if candidate in (CAR.JEEP_CHEROKEE, CAR.JEEP_CHEROKEE_2019): + ret.wheelbase = 2.91 # in meters + ret.steerRatio = 12.7 + ret.steerActuatorDelay = 0.2 # in seconds + + ret.centerToFront = ret.wheelbase * 0.44 + + ret.minSteerSpeed = 3.8 # m/s + if candidate in (CAR.PACIFICA_2019_HYBRID, CAR.PACIFICA_2020, CAR.JEEP_CHEROKEE_2019): + # TODO allow 2019 cars to steer down to 13 m/s if already engaged. + ret.minSteerSpeed = 17.5 # m/s 17 on the way up, 13 on the way down once engaged. + + # starting with reasonable value for civic and scaling by mass and wheelbase + ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) + + # TODO: start from empirically derived lateral slip stiffness for the civic and scale by + # mass and CG position, so all cars will have approximately similar dyn behaviors + ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront) + + ret.enableBsm = 720 in fingerprint[0] + + return ret + + # returns a car.CarState + def update(self, c, can_strings): + # ******************* do can recv ******************* + self.cp.update_strings(can_strings) + self.cp_cam.update_strings(can_strings) + + ret = self.CS.update(self.cp, self.cp_cam) + self.post_update(c,ret) + ret.canValid = self.cp.can_valid and self.cp_cam.can_valid + + # speeds + ret.steeringRateLimited = self.CC.steer_rate_limited if self.CC is not None else False + + # events + events = self.create_common_events(ret, extra_gears=[car.CarState.GearShifter.low]) + + if ret.vEgo < self.CP.minSteerSpeed: + events.add(car.CarEvent.EventName.belowSteerSpeed) + + ret.events = events.to_msg() + + # copy back carState packet to CS + self.CS.out = ret.as_reader() + return self.CS.out + + # pass in a car.CarControl + # to be called @ 100hz + def apply(self, c): + self.pre_apply(c) + if (self.CS.frame == -1): + return car.CarControl.Actuators.new_message(), [] # if we haven't seen a frame 220, then do not update. + + return self.CC.update(c.enabled, self.CS, c.actuators, c.cruiseControl.cancel, c.hudControl.visualAlert) diff --git a/selfdrive/car/chrysler/radar_interface.py b/selfdrive/car/chrysler/radar_interface.py new file mode 100755 index 000000000..8882dc2d9 --- /dev/null +++ b/selfdrive/car/chrysler/radar_interface.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 +from opendbc.can.parser import CANParser +from cereal import car +from selfdrive.car.interfaces import RadarInterfaceBase +from selfdrive.car.chrysler.values import DBC + +RADAR_MSGS_C = list(range(0x2c2, 0x2d4+2, 2)) # c_ messages 706,...,724 +RADAR_MSGS_D = list(range(0x2a2, 0x2b4+2, 2)) # d_ messages +LAST_MSG = max(RADAR_MSGS_C + RADAR_MSGS_D) +NUMBER_MSGS = len(RADAR_MSGS_C) + len(RADAR_MSGS_D) + +def _create_radar_can_parser(car_fingerprint): + msg_n = len(RADAR_MSGS_C) + # list of [(signal name, message name or number), (...)] + # [('RADAR_STATE', 1024), + # ('LONG_DIST', 1072), + # ('LONG_DIST', 1073), + # ('LONG_DIST', 1074), + # ('LONG_DIST', 1075), + + signals = list(zip(['LONG_DIST'] * msg_n + + ['LAT_DIST'] * msg_n + + ['REL_SPEED'] * msg_n, + RADAR_MSGS_C * 2 + # LONG_DIST, LAT_DIST + RADAR_MSGS_D)) # REL_SPEED + + checks = list(zip(RADAR_MSGS_C + + RADAR_MSGS_D, + [20] * msg_n + # 20Hz (0.05s) + [20] * msg_n)) # 20Hz (0.05s) + + return CANParser(DBC[car_fingerprint]['radar'], signals, checks, 1) + +def _address_to_track(address): + if address in RADAR_MSGS_C: + return (address - RADAR_MSGS_C[0]) // 2 + if address in RADAR_MSGS_D: + return (address - RADAR_MSGS_D[0]) // 2 + raise ValueError("radar received unexpected address %d" % address) + +class RadarInterface(RadarInterfaceBase): + def __init__(self, CP): + super().__init__(CP) + self.rcp = _create_radar_can_parser(CP.carFingerprint) + self.updated_messages = set() + self.trigger_msg = LAST_MSG + + def update(self, can_strings): + vls = self.rcp.update_strings(can_strings) + self.updated_messages.update(vls) + + if self.trigger_msg not in self.updated_messages: + return None + + ret = car.RadarData.new_message() + errors = [] + if not self.rcp.can_valid: + errors.append("canError") + ret.errors = errors + + for ii in self.updated_messages: # ii should be the message ID as a number + cpt = self.rcp.vl[ii] + trackId = _address_to_track(ii) + + if trackId not in self.pts: + self.pts[trackId] = car.RadarData.RadarPoint.new_message() + self.pts[trackId].trackId = trackId + self.pts[trackId].aRel = float('nan') + self.pts[trackId].yvRel = float('nan') + self.pts[trackId].measured = True + + if 'LONG_DIST' in cpt: # c_* message + self.pts[trackId].dRel = cpt['LONG_DIST'] # from front of car + # our lat_dist is positive to the right in car's frame. + # TODO what does yRel want? + self.pts[trackId].yRel = cpt['LAT_DIST'] # in car frame's y axis, left is positive + else: # d_* message + self.pts[trackId].vRel = cpt['REL_SPEED'] + + # We want a list, not a dictionary. Filter out LONG_DIST==0 because that means it's not valid. + ret.points = [x for x in self.pts.values() if x.dRel != 0] + + self.updated_messages.clear() + return ret diff --git a/selfdrive/car/chrysler/values.py b/selfdrive/car/chrysler/values.py new file mode 100644 index 000000000..3fd32e9bc --- /dev/null +++ b/selfdrive/car/chrysler/values.py @@ -0,0 +1,87 @@ +from selfdrive.car import dbc_dict +from cereal import car +Ecu = car.CarParams.Ecu + +class CarControllerParams: + STEER_MAX = 261 # 262 faults + STEER_DELTA_UP = 3 # 3 is stock. 100 is fine. 200 is too much it seems + STEER_DELTA_DOWN = 3 # no faults on the way down it seems + STEER_ERROR_MAX = 80 + + +class CAR: + PACIFICA_2017_HYBRID = "CHRYSLER PACIFICA HYBRID 2017" + PACIFICA_2018_HYBRID = "CHRYSLER PACIFICA HYBRID 2018" + PACIFICA_2019_HYBRID = "CHRYSLER PACIFICA HYBRID 2019" + PACIFICA_2018 = "CHRYSLER PACIFICA 2018" # includes 2017 Pacifica + PACIFICA_2020 = "CHRYSLER PACIFICA 2020" + JEEP_CHEROKEE = "JEEP GRAND CHEROKEE V6 2018" # includes 2017 Trailhawk + JEEP_CHEROKEE_2019 = "JEEP GRAND CHEROKEE 2019" # includes 2020 Trailhawk + +# Unique CAN messages: +# Only the hybrids have 270: 8 +# Only the gas have 55: 8, 416: 7 +# For 564, All 2017 have length 4, whereas 2018-19 have length 8. +# For 924, Pacifica 2017 has length 3, whereas all 2018-19 have length 8. +# For 560, All 2019 have length 8, whereas all 2017-18 have length 4. + +# Jeep Grand Cherokee unique messages: +# 2017 Trailhawk: 618: 8 +# For 924, Trailhawk 2017 has length 3, whereas 2018 V6 has length 8. + +FINGERPRINTS = { + CAR.PACIFICA_2017_HYBRID: [{ + 168: 8, 257: 5, 258: 8, 264: 8, 268: 8, 270: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 291: 8, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 515: 7, 516: 7, 517: 7, 518: 7, 520: 8, 528: 8, 532: 8, 542: 8, 544: 8, 557: 8, 559: 8, 560: 4, 564: 4, 571: 3, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 653: 8, 654: 8, 655: 8, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 678: 8, 680: 8, 701: 8, 704: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 729: 5, 736: 8, 737: 8, 746: 5, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 782: 8, 784: 8, 788:3, 792: 8, 799: 8, 800: 8, 804: 8, 808: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 878: 8, 882: 8, 897: 8, 908: 8, 924: 3, 926: 3, 929: 8, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 956: 8, 958: 8, 959: 8, 969: 4, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1082: 8, 1083: 8, 1098: 8, 1100: 8, 1216: 8, 1218: 8, 1220: 8, 1225: 8, 1235: 8, 1242: 8, 1246: 8, 1250: 8, 1284: 8, 1537: 8, 1538: 8, 1562: 8, 1568: 8, 1856: 8, 1858: 8, 1860: 8, 1865: 8, 1875: 8, 1882: 8, 1886: 8, 1890: 8, 1892: 8, 2016: 8, 2024: 8 + }], + CAR.PACIFICA_2018: [{ + 55: 8, 257: 5, 258: 8, 264: 8, 268: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 416: 7, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 516: 7, 517: 7, 520: 8, 524: 8, 526: 6, 528: 8, 532: 8, 542: 8, 544: 8, 557: 8, 559: 8, 560: 4, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 656: 4, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 678: 8, 680: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 729: 5, 736: 8, 746: 5, 752: 2, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 784: 8, 792: 8, 799: 8, 800: 8, 804: 8, 808: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 882: 8, 897: 8, 924: 8, 926: 3, 937: 8, 947: 8, 948: 8, 969: 4, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1098: 8, 1100: 8, 1537: 8, 1538: 8, 1562: 8 + }, + { + 55: 8, 257: 5, 258: 8, 264: 8, 268: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 416: 7, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 516: 7, 517: 7, 520: 8, 524: 8, 526: 6, 528: 8, 532: 8, 542: 8, 544: 8, 557: 8, 559: 8, 560: 4, 564: 4, 571: 3, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 656: 4, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 678: 8, 680: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 729: 5, 736: 8, 746: 5, 752: 2, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 784: 8, 792: 8, 799: 8, 800: 8, 804: 8, 808: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 882: 8, 897: 8, 924: 3, 926: 3, 937: 8, 947: 8, 948: 8, 969: 4, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1098: 8, 1100: 8, 1537: 8, 1538: 8, 1562: 8 + }], + CAR.PACIFICA_2020: [{ + 55: 8, 179: 8, 181: 8, 257: 5, 258: 8, 264: 8, 268: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 352: 8, 362: 8, 368: 8, 376: 3, 384: 8, 388: 4, 416: 7, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 516: 7, 517: 7, 520: 8, 524: 8, 526: 6, 528: 8, 532: 8, 536: 8, 542: 8, 544: 8, 557: 8, 559: 8, 560: 8, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 650: 8, 656: 4, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 676: 8, 678: 8, 680: 8, 683: 8, 703: 8, 705: 8, 706: 8, 709: 8, 710: 8, 711: 8, 719: 8, 720: 6, 729: 5, 736: 8, 746: 5, 752: 2, 754: 8, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 776: 8, 779: 8, 782: 8, 784: 8, 792: 8, 793: 8, 794: 8, 795: 8, 799: 8, 800: 8, 801: 8, 802: 8, 803: 8, 804: 8, 808: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 847: 1, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 882: 8, 886: 8, 897: 8, 906: 8, 924: 8, 926: 3, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 962: 8, 969: 4, 973: 8, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1098: 8, 1100: 8, 1216: 8, 1218: 8, 1220: 8, 1223: 7, 1225: 8, 1227: 8, 1235: 8, 1242: 8, 1246: 8, 1250: 8, 1251: 8, 1252: 8, 1284: 8, 1543: 8, 1568: 8, 1570: 8, 1856: 8, 1858: 8, 1860: 8, 1863: 8, 1865: 8, 1867: 8, 1875: 8, 1882: 8, 1886: 8, 1890: 8, 1891: 8, 1892: 8, 1898: 8, 2015: 8, 2016: 8, 2017:8, 2024: 8, 2025: 8 + }], + CAR.PACIFICA_2018_HYBRID: [{ + 68: 8, 168: 8, 257: 5, 258: 8, 264: 8, 268: 8, 270: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 291: 8, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 520: 8, 528: 8, 532: 8, 544: 8, 557: 8, 559: 8, 560: 4, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 653: 8, 654: 8, 655: 8, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 680: 8, 701: 8, 704: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 736: 8, 737: 8, 746: 5, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 782: 8, 784: 8, 792: 8, 799: 8, 800: 8, 804: 8, 808: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 878: 8, 882: 8, 897: 8, 908: 8, 924: 8, 926: 3, 929: 8, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 958: 8, 959: 8, 969: 4, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1082: 8, 1083: 8, 1098: 8, 1100: 8 + }, + # based on 9ae7821dc4e92455|2019-07-01--16-42-55 + { + 168: 8, 257: 5, 258: 8, 264: 8, 268: 8, 270: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 291: 8, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 515: 7, 516: 7, 517: 7, 518: 7, 520: 8, 528: 8, 532: 8, 542: 8, 544: 8, 557: 8, 559: 8, 560: 4, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 653: 8, 654: 8, 655: 8, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 678: 8, 680: 8, 701: 8, 704: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 729: 5, 736: 8, 737: 8, 746: 5, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 782: 8, 784: 8, 792: 8, 799: 8, 800: 8, 804: 8, 808: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 878: 8, 882: 8, 897: 8, 908: 8, 924: 8, 926: 3, 929: 8, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 958: 8, 959: 8, 969: 4, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1082: 8, 1083: 8, 1098: 8, 1100: 8, 1216: 8, 1218: 8, 1220: 8, 1225: 8, 1235: 8, 1242: 8, 1246: 8, 1250: 8, 1251: 8, 1252: 8, 1258: 8, 1259: 8, 1260: 8, 1262: 8, 1284: 8, 1537: 8, 1538: 8, 1562: 8, 1568: 8, 1856: 8, 1858: 8, 1860: 8, 1865: 8, 1875: 8, 1882: 8, 1886: 8, 1890: 8, 1891: 8, 1892: 8, 1898: 8, 1899: 8, 1900: 8, 1902: 8, 2016: 8, 2018: 8, 2019: 8, 2020: 8, 2023: 8, 2024: 8, 2026: 8, 2027: 8, 2028: 8, 2031: 8 + }], + CAR.PACIFICA_2019_HYBRID: [{ + 168: 8, 257: 5, 258: 8, 264: 8, 268: 8, 270: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 291: 8, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 515: 7, 516: 7, 517: 7, 518: 7, 520: 8, 528: 8, 532: 8, 542: 8, 544: 8, 557: 8, 559: 8, 560: 8, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 653: 8, 654: 8, 655: 8, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 680: 8, 701: 8, 703: 8, 704: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 736: 8, 737: 8, 746: 5, 752: 2, 754: 8, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 782: 8, 784: 8, 792: 8, 799: 8, 800: 8, 804: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 878: 8, 882: 8, 897: 8, 906: 8, 908: 8, 924: 8, 926: 3, 929: 8, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 958: 8, 959: 8, 962: 8, 969: 4, 973: 8, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1082: 8, 1083: 8, 1098: 8, 1100: 8, 1538: 8 + }, + # Based on 0607d2516fc2148f|2019-02-13--23-03-16 + { + 168: 8, 257: 5, 258: 8, 264: 8, 268: 8, 270: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 291: 8, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 520: 8, 528: 8, 532: 8, 544: 8, 557: 8, 559: 8, 560: 8, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 653: 8, 654: 8, 655: 8, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 678: 8, 680: 8, 701: 8, 703: 8, 704: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 729: 5, 736: 8, 737: 8, 746: 5, 752: 2, 754: 8, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 782: 8, 784: 8, 792: 8, 799: 8, 800: 8, 804: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 878: 8, 882: 8, 897: 8, 906: 8, 908: 8, 924: 8, 926: 3, 929: 8, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 958: 8, 959: 8, 962: 8, 969: 4, 973: 8, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1082: 8, 1083: 8, 1098: 8, 1100: 8, 1537: 8 + }, + # Based on 3c7ce223e3571b54|2019-05-11--20-16-14 + { + 168: 8, 257: 5, 258: 8, 264: 8, 268: 8, 270: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 291: 8, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 520: 8, 528: 8, 532: 8, 544: 8, 557: 8, 559: 8, 560: 8, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 653: 8, 654: 8, 655: 8, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 678: 8, 680: 8, 701: 8, 703: 8, 704: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 729: 5, 736: 8, 737: 8, 746: 5, 752: 2, 754: 8, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 782: 8, 784: 8, 792: 8, 799: 8, 800: 8, 804: 8, 808: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 878: 8, 882: 8, 897: 8, 906: 8, 908: 8, 924: 8, 926: 3, 929: 8, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 958: 8, 959: 8, 962: 8, 969: 4, 973: 8, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1082: 8, 1083: 8, 1098: 8, 1100: 8, 1562: 8, 1570: 8 + }, + # Based on "8190c7275a24557b|2020-02-24--09-57-23" + { + 168: 8, 257: 5, 258: 8, 264: 8, 268: 8, 270: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 291: 8, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 515: 7, 516: 7, 517: 7, 518: 7, 520: 8, 524: 8, 526: 6, 528: 8, 532: 8, 542: 8, 544: 8, 557: 8, 559: 8, 560: 8, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 640: 1, 650: 8, 653: 8, 654: 8, 655: 8, 656: 4, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 678: 8, 680: 8, 683: 8, 701: 8, 703: 8, 704: 8, 705: 8, 706: 8, 709: 8, 710: 8, 711: 8, 719: 8, 720: 6, 729: 5, 736: 8, 737: 8, 738: 8, 746: 5, 752: 2, 754: 8, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 782: 8, 784: 8, 792: 8, 793: 8, 794: 8, 795: 8, 796: 8, 797: 8, 798: 8, 799: 8, 800: 8, 801: 8, 802: 8, 803: 8, 804: 8, 805: 8, 807: 8, 808: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 847: 1, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 878: 8, 882: 8, 886: 8, 897: 8, 906: 8, 908: 8, 924: 8, 926: 3, 929: 8, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 958: 8, 959: 8, 962: 8, 969: 4, 973: 8, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1082: 8, 1083: 8, 1098: 8, 1100: 8, 1216: 8, 1218: 8, 1220: 8, 1225: 8, 1235: 8, 1242: 8, 1246: 8, 1250: 8, 1251: 8, 1252: 8, 1258: 8, 1259: 8, 1260: 8, 1262: 8, 1284: 8, 1568: 8, 1570: 8, 1856: 8, 1858: 8, 1860: 8, 1863: 8, 1865: 8, 1875: 8, 1882: 8, 1886: 8, 1890: 8, 1891: 8, 1892: 8, 1898: 8, 1899: 8, 1900: 8, 1902: 8, 2015: 8, 2016: 8, 2017: 8, 2018: 8, 2019: 8, 2020: 8, 2023: 8, 2024: 8, 2026: 8, 2027: 8, 2028: 8, 2031: 8 + }], + CAR.JEEP_CHEROKEE: [{ + 55: 8, 168: 8, 181: 8, 256: 4, 257: 5, 258: 8, 264: 8, 268: 8, 272: 6, 273: 6, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 292: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 352: 8, 362: 8, 368: 8, 376: 3, 384: 8, 388: 4, 416: 7, 448: 6, 456: 4, 464: 8, 500: 8, 501: 8, 512: 8, 514: 8, 520: 8, 532: 8, 544: 8, 557: 8, 559: 8, 560: 4, 564: 4, 571: 3, 579: 8, 584: 8, 608: 8, 618: 8, 624: 8, 625: 8, 632: 8, 639: 8, 656: 4, 658: 6, 660: 8, 671: 8, 672: 8, 676: 8, 678: 8, 680: 8, 683: 8, 684: 8, 703: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 729: 5, 736: 8, 737: 8, 738: 8, 746: 5, 752: 2, 754: 8, 760: 8, 761: 8, 764: 8, 766: 8, 773: 8, 776: 8, 779: 8, 782: 8, 783: 8, 784: 8, 785: 8, 788: 3, 792: 8, 799: 8, 800: 8, 804: 8, 806: 2, 808: 8, 810: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 831: 6, 832: 8, 838: 2, 840: 8, 844: 5, 847: 1, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 874: 2, 882: 8, 897: 8, 906: 8, 924: 8, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 956: 8, 968: 8, 969: 4, 970: 8, 973: 8, 974: 5, 975: 8, 976: 8, 977: 4, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1062: 8, 1098: 8, 1100: 8, 1543: 8, 1562: 8, 2015: 8, 2016: 8, 2017: 8, 2024: 8, 2025: 8 + }], + CAR.JEEP_CHEROKEE_2019: [{ + # Jeep Grand Cherokee 2019, including most 2020 models + 55: 8, 168: 8, 179: 8, 181: 8, 256: 4, 257: 5, 258: 8, 264: 8, 268: 8, 272: 6, 273: 6, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 292: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 341: 8, 344: 8, 352: 8, 362: 8, 368: 8, 376: 3, 384: 8, 388: 4, 416: 7, 448: 6, 456: 4, 464: 8, 500: 8, 501: 8, 512: 8, 514: 8, 520: 8, 530: 8, 532: 8, 544: 8, 557: 8, 559: 8, 560: 8, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 618: 8, 624: 8, 625: 8, 632: 8, 639: 8, 640: 1, 656: 4, 658: 6, 660: 8, 671: 8, 672: 8, 676: 8, 678: 8, 680: 8, 683: 8, 684: 8, 703: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 729: 5, 736: 8, 737: 8, 738: 8, 746: 5, 752: 2, 754: 8, 760: 8, 761: 8, 764: 8, 766: 8, 773: 8, 776: 8, 779: 8, 782: 8, 783: 8, 784: 8, 785: 8, 792: 8, 799: 8, 800: 8, 804: 8, 806: 2, 808: 8, 810: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 831: 6, 832: 8, 838: 2, 840: 8, 844: 5, 847: 1, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 882: 8, 897: 8, 906: 8, 924: 8, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 960: 4, 968: 8, 969: 4, 970: 8, 973: 8, 974: 5, 976: 8, 977: 4, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1062: 8, 1098: 8, 1100: 8, 1216: 8, 1218: 8, 1220: 8, 1223: 8, 1225: 8, 1227: 8, 1235: 8, 1242: 8, 1250: 8, 1251: 8, 1252: 8, 1254: 8, 1264: 8, 1284: 8, 1536: 8, 1537: 8, 1543: 8, 1545: 8, 1562: 8, 1568: 8, 1570: 8, 1572: 8, 1593: 8, 1856: 8, 1858: 8, 1860: 8, 1863: 8, 1865: 8, 1867: 8, 1875: 8, 1882: 8, 1890: 8, 1891: 8, 1892: 8, 1894: 8, 1896: 8, 1904: 8, 2015: 8, 2016: 8, 2017: 8, 2024: 8, 2025: 8 + }], +} + + +DBC = { + CAR.PACIFICA_2017_HYBRID: dbc_dict('chrysler_pacifica_2017_hybrid', 'chrysler_pacifica_2017_hybrid_private_fusion'), + CAR.PACIFICA_2018: dbc_dict('chrysler_pacifica_2017_hybrid', 'chrysler_pacifica_2017_hybrid_private_fusion'), + CAR.PACIFICA_2020: dbc_dict('chrysler_pacifica_2017_hybrid', 'chrysler_pacifica_2017_hybrid_private_fusion'), + CAR.PACIFICA_2018_HYBRID: dbc_dict('chrysler_pacifica_2017_hybrid', 'chrysler_pacifica_2017_hybrid_private_fusion'), + CAR.PACIFICA_2019_HYBRID: dbc_dict('chrysler_pacifica_2017_hybrid', 'chrysler_pacifica_2017_hybrid_private_fusion'), + CAR.JEEP_CHEROKEE: dbc_dict('chrysler_pacifica_2017_hybrid', 'chrysler_pacifica_2017_hybrid_private_fusion'), + CAR.JEEP_CHEROKEE_2019: dbc_dict('chrysler_pacifica_2017_hybrid', 'chrysler_pacifica_2017_hybrid_private_fusion'), +} + +STEER_THRESHOLD = 120 diff --git a/selfdrive/car/disable_ecu.py b/selfdrive/car/disable_ecu.py new file mode 100644 index 000000000..3a06cc06f --- /dev/null +++ b/selfdrive/car/disable_ecu.py @@ -0,0 +1,34 @@ +from selfdrive.car.isotp_parallel_query import IsoTpParallelQuery +from selfdrive.swaglog import cloudlog + +EXT_DIAG_REQUEST = b'\x10\x03' +EXT_DIAG_RESPONSE = b'\x50\x03' + +COM_CONT_RESPONSE = b'' + +def disable_ecu(logcan, sendcan, bus=0, addr=0x7d0, com_cont_req=b'\x28\x83\x01', timeout=0.1, retry=10, debug=False): + """Silence an ECU by disabling sending and receiving messages using UDS 0x28. + The ECU will stay silent as long as openpilot keeps sending Tester Present. + + This is used to disable the radar in some cars. Openpilot will emulate the radar. + WARNING: THIS DISABLES AEB!""" + cloudlog.warning(f"ecu disable {hex(addr)} ...") + + for i in range(retry): + try: + query = IsoTpParallelQuery(sendcan, logcan, bus, [addr], [EXT_DIAG_REQUEST], [EXT_DIAG_RESPONSE], debug=debug) + + for _, _ in query.get_data(timeout).items(): + cloudlog.warning("communication control disable tx/rx ...") + + query = IsoTpParallelQuery(sendcan, logcan, bus, [addr], [com_cont_req], [COM_CONT_RESPONSE], debug=debug) + query.get_data(0) + + cloudlog.warning("ecu disabled") + return True + except Exception: + cloudlog.exception("ecu disable exception") + + print(f"ecu disable retry ({i+1}) ...") + cloudlog.warning("ecu disable failed") + return False diff --git a/selfdrive/car/fingerprints.py b/selfdrive/car/fingerprints.py new file mode 100644 index 000000000..9b280f3b4 --- /dev/null +++ b/selfdrive/car/fingerprints.py @@ -0,0 +1,80 @@ +import os +from common.basedir import BASEDIR + + +def get_attr_from_cars(attr, result=dict, combine_brands=True): + # read all the folders in selfdrive/car and return a dict where: + # - keys are all the car models + # - values are attr values from all car folders + result = result() + + for car_folder in [x[0] for x in os.walk(BASEDIR + '/selfdrive/car')]: + try: + car_name = car_folder.split('/')[-1] + values = __import__(f'selfdrive.car.{car_name}.values', fromlist=[attr]) + if hasattr(values, attr): + attr_values = getattr(values, attr) + else: + continue + + if isinstance(attr_values, dict): + for f, v in attr_values.items(): + if combine_brands: + result[f] = v + else: + if car_name not in result: + result[car_name] = {} + result[car_name][f] = v + elif isinstance(attr_values, list): + result += attr_values + + except (ImportError, OSError): + pass + + return result + + +FW_VERSIONS = get_attr_from_cars('FW_VERSIONS') +_FINGERPRINTS = get_attr_from_cars('FINGERPRINTS') + +_DEBUG_ADDRESS = {1880: 8} # reserved for debug purposes + +def is_valid_for_fingerprint(msg, car_fingerprint): + adr = msg.address + # ignore addresses that are more than 11 bits + return (adr in car_fingerprint and car_fingerprint[adr] == len(msg.dat)) or adr >= 0x800 + + +def eliminate_incompatible_cars(msg, candidate_cars): + """Removes cars that could not have sent msg. + + Inputs: + msg: A cereal/log CanData message from the car. + candidate_cars: A list of cars to consider. + + Returns: + A list containing the subset of candidate_cars that could have sent msg. + """ + compatible_cars = [] + + for car_name in candidate_cars: + car_fingerprints = _FINGERPRINTS[car_name] + + for fingerprint in car_fingerprints: + fingerprint.update(_DEBUG_ADDRESS) # add alien debug address + + if is_valid_for_fingerprint(msg, fingerprint): + compatible_cars.append(car_name) + break + + return compatible_cars + + +def all_known_cars(): + """Returns a list of all known car strings.""" + return list({*FW_VERSIONS.keys(), *_FINGERPRINTS.keys()}) + + +def all_legacy_fingerprint_cars(): + """Returns a list of all known car strings, FPv1 only.""" + return list(_FINGERPRINTS.keys()) diff --git a/selfdrive/car/ford/__init__.py b/selfdrive/car/ford/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/ford/carcontroller.py b/selfdrive/car/ford/carcontroller.py new file mode 100644 index 000000000..389d3d8d8 --- /dev/null +++ b/selfdrive/car/ford/carcontroller.py @@ -0,0 +1,86 @@ +import math +from cereal import car +from selfdrive.car import make_can_msg +from selfdrive.car.ford.fordcan import create_steer_command, create_lkas_ui, spam_cancel_button +from opendbc.can.packer import CANPacker + +VisualAlert = car.CarControl.HUDControl.VisualAlert + +MAX_STEER_DELTA = 1 +TOGGLE_DEBUG = False + +class CarController(): + def __init__(self, dbc_name, CP, VM): + self.packer = CANPacker(dbc_name) + self.enabled_last = False + self.main_on_last = False + self.vehicle_model = VM + self.generic_toggle_last = 0 + self.steer_alert_last = False + self.lkas_action = 0 + + def update(self, enabled, CS, frame, actuators, visual_alert, pcm_cancel): + + can_sends = [] + steer_alert = visual_alert in (VisualAlert.steerRequired, VisualAlert.ldw) + + apply_steer = actuators.steer + + if pcm_cancel: + #print "CANCELING!!!!" + can_sends.append(spam_cancel_button(self.packer)) + + if (frame % 3) == 0: + + curvature = self.vehicle_model.calc_curvature(math.radians(actuators.steeringAngleDeg), CS.out.vEgo, 0.0) + + # The use of the toggle below is handy for trying out the various LKAS modes + if TOGGLE_DEBUG: + self.lkas_action += int(CS.out.genericToggle and not self.generic_toggle_last) + self.lkas_action &= 0xf + else: + self.lkas_action = 5 # 4 and 5 seem the best. 8 and 9 seem to aggressive and laggy + + can_sends.append(create_steer_command(self.packer, apply_steer, enabled, + CS.lkas_state, CS.out.steeringAngleDeg, curvature, self.lkas_action)) + self.generic_toggle_last = CS.out.genericToggle + + if (frame % 100) == 0: + + can_sends.append(make_can_msg(973, b'\x00\x00\x00\x00\x00\x00\x00\x00', 0)) + #can_sends.append(make_can_msg(984, b'\x00\x00\x00\x00\x80\x45\x60\x30', 0)) + + if (frame % 100) == 0 or (self.enabled_last != enabled) or (self.main_on_last != CS.out.cruiseState.available) or \ + (self.steer_alert_last != steer_alert): + can_sends.append(create_lkas_ui(self.packer, CS.out.cruiseState.available, enabled, steer_alert)) + + if (frame % 200) == 0: + can_sends.append(make_can_msg(1875, b'\x80\xb0\x55\x55\x78\x90\x00\x00', 1)) + + if (frame % 10) == 0: + + can_sends.append(make_can_msg(1648, b'\x00\x00\x00\x40\x00\x00\x50\x00', 1)) + can_sends.append(make_can_msg(1649, b'\x10\x10\xf1\x70\x04\x00\x00\x00', 1)) + + can_sends.append(make_can_msg(1664, b'\x00\x00\x03\xe8\x00\x01\xa9\xb2', 1)) + can_sends.append(make_can_msg(1674, b'\x08\x00\x00\xff\x0c\xfb\x6a\x08', 1)) + can_sends.append(make_can_msg(1675, b'\x00\x00\x3b\x60\x37\x00\x00\x00', 1)) + can_sends.append(make_can_msg(1690, b'\x70\x00\x00\x55\x86\x1c\xe0\x00', 1)) + + can_sends.append(make_can_msg(1910, b'\x06\x4b\x06\x4b\x42\xd3\x11\x30', 1)) + can_sends.append(make_can_msg(1911, b'\x48\x53\x37\x54\x48\x53\x37\x54', 1)) + can_sends.append(make_can_msg(1912, b'\x31\x34\x47\x30\x38\x31\x43\x42', 1)) + can_sends.append(make_can_msg(1913, b'\x31\x34\x47\x30\x38\x32\x43\x42', 1)) + can_sends.append(make_can_msg(1969, b'\xf4\x40\x00\x00\x00\x00\x00\x00', 1)) + can_sends.append(make_can_msg(1971, b'\x0b\xc0\x00\x00\x00\x00\x00\x00', 1)) + + static_msgs = range(1653, 1658) + for addr in static_msgs: + cnt = (frame % 10) + 1 + can_sends.append(make_can_msg(addr, (cnt << 4).to_bytes(1, 'little') + b'\x00\x00\x00\x00\x00\x00\x00', 1)) + + self.enabled_last = enabled + self.main_on_last = CS.out.cruiseState.available + self.steer_alert_last = steer_alert + + return actuators, can_sends diff --git a/selfdrive/car/ford/carstate.py b/selfdrive/car/ford/carstate.py new file mode 100644 index 000000000..eba623f5c --- /dev/null +++ b/selfdrive/car/ford/carstate.py @@ -0,0 +1,58 @@ +from cereal import car +from opendbc.can.parser import CANParser +from common.numpy_fast import mean +from selfdrive.config import Conversions as CV +from selfdrive.car.interfaces import CarStateBase +from selfdrive.car.ford.values import DBC + +WHEEL_RADIUS = 0.33 + +class CarState(CarStateBase): + def update(self, cp): + ret = car.CarState.new_message() + + ret.wheelSpeeds = self.get_wheel_speeds( + cp.vl["WheelSpeed_CG1"]["WhlFl_W_Meas"], + cp.vl["WheelSpeed_CG1"]["WhlFr_W_Meas"], + cp.vl["WheelSpeed_CG1"]["WhlRl_W_Meas"], + cp.vl["WheelSpeed_CG1"]["WhlRr_W_Meas"], + unit=WHEEL_RADIUS, + ) + ret.vEgoRaw = mean([ret.wheelSpeeds.rr, ret.wheelSpeeds.rl, ret.wheelSpeeds.fr, ret.wheelSpeeds.fl]) + ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) + ret.standstill = not ret.vEgoRaw > 0.001 + ret.steeringAngleDeg = cp.vl["Steering_Wheel_Data_CG1"]["SteWhlRelInit_An_Sns"] + ret.steeringPressed = not cp.vl["Lane_Keep_Assist_Status"]["LaHandsOff_B_Actl"] + ret.steerError = cp.vl["Lane_Keep_Assist_Status"]["LaActDeny_B_Actl"] == 1 + ret.cruiseState.speed = cp.vl["Cruise_Status"]["Set_Speed"] * CV.MPH_TO_MS + ret.cruiseState.enabled = not (cp.vl["Cruise_Status"]["Cruise_State"] in (0, 3)) + ret.cruiseState.available = cp.vl["Cruise_Status"]["Cruise_State"] != 0 + ret.gas = cp.vl["EngineData_14"]["ApedPosScal_Pc_Actl"] / 100. + ret.gasPressed = ret.gas > 1e-6 + ret.brakePressed = bool(cp.vl["Cruise_Status"]["Brake_Drv_Appl"]) + ret.genericToggle = bool(cp.vl["Steering_Buttons"]["Dist_Incr"]) + # TODO: we also need raw driver torque, needed for Assisted Lane Change + self.lkas_state = cp.vl["Lane_Keep_Assist_Status"]["LaActAvail_D_Actl"] + + return ret + + @staticmethod + def get_can_parser(CP): + signals = [ + # sig_name, sig_address + ("WhlRr_W_Meas", "WheelSpeed_CG1"), + ("WhlRl_W_Meas", "WheelSpeed_CG1"), + ("WhlFr_W_Meas", "WheelSpeed_CG1"), + ("WhlFl_W_Meas", "WheelSpeed_CG1"), + ("SteWhlRelInit_An_Sns", "Steering_Wheel_Data_CG1"), + ("Cruise_State", "Cruise_Status"), + ("Set_Speed", "Cruise_Status"), + ("LaActAvail_D_Actl", "Lane_Keep_Assist_Status"), + ("LaHandsOff_B_Actl", "Lane_Keep_Assist_Status"), + ("LaActDeny_B_Actl", "Lane_Keep_Assist_Status"), + ("ApedPosScal_Pc_Actl", "EngineData_14"), + ("Dist_Incr", "Steering_Buttons"), + ("Brake_Drv_Appl", "Cruise_Status"), + ] + checks = [] + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 0, enforce_checks=False) diff --git a/selfdrive/car/ford/fordcan.py b/selfdrive/car/ford/fordcan.py new file mode 100644 index 000000000..5a8b0b2de --- /dev/null +++ b/selfdrive/car/ford/fordcan.py @@ -0,0 +1,50 @@ +from common.numpy_fast import clip +from selfdrive.car.ford.values import MAX_ANGLE + + +def create_steer_command(packer, angle_cmd, enabled, lkas_state, angle_steers, curvature, lkas_action): + """Creates a CAN message for the Ford Steer Command.""" + + #if enabled and lkas available: + if enabled and lkas_state in (2, 3): # and (frame % 500) >= 3: + action = lkas_action + else: + action = 0xf + angle_cmd = angle_steers/MAX_ANGLE + + angle_cmd = clip(angle_cmd * MAX_ANGLE, - MAX_ANGLE, MAX_ANGLE) + + values = { + "Lkas_Action": action, + "Lkas_Alert": 0xf, # no alerts + "Lane_Curvature": clip(curvature, -0.01, 0.01), # is it just for debug? + #"Lane_Curvature": 0, # is it just for debug? + "Steer_Angle_Req": angle_cmd + } + return packer.make_can_msg("Lane_Keep_Assist_Control", 0, values) + + +def create_lkas_ui(packer, main_on, enabled, steer_alert): + """Creates a CAN message for the Ford Steer Ui.""" + + if not main_on: + lines = 0xf + elif enabled: + lines = 0x3 + else: + lines = 0x6 + + values = { + "Set_Me_X80": 0x80, + "Set_Me_X45": 0x45, + "Set_Me_X30": 0x30, + "Lines_Hud": lines, + "Hands_Warning_W_Chime": steer_alert, + } + return packer.make_can_msg("Lane_Keep_Assist_Ui", 0, values) + +def spam_cancel_button(packer): + values = { + "Cancel": 1 + } + return packer.make_can_msg("Steering_Buttons", 0, values) diff --git a/selfdrive/car/ford/interface.py b/selfdrive/car/ford/interface.py new file mode 100755 index 000000000..a5a3034e0 --- /dev/null +++ b/selfdrive/car/ford/interface.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python3 +from cereal import car +from selfdrive.config import Conversions as CV +from selfdrive.car.ford.values import MAX_ANGLE +from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config +from selfdrive.car.interfaces import CarInterfaceBase + + +class CarInterface(CarInterfaceBase): + @staticmethod + def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None): + ret = CarInterfaceBase.get_std_params(candidate, fingerprint) + ret.carName = "ford" + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.ford)] + ret.dashcamOnly = True + + ret.wheelbase = 2.85 + ret.steerRatio = 14.8 + ret.mass = 3045. * CV.LB_TO_KG + STD_CARGO_KG + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.01], [0.005]] # TODO: tune this + ret.lateralTuning.pid.kf = 1. / MAX_ANGLE # MAX Steer angle to normalize FF + ret.steerActuatorDelay = 0.1 # Default delay, not measured yet + ret.steerLimitTimer = 1.0 + ret.steerRateCost = 1.0 + ret.centerToFront = ret.wheelbase * 0.44 + tire_stiffness_factor = 0.5328 + + # TODO: get actual value, for now starting with reasonable value for + # civic and scaling by mass and wheelbase + ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) + + # TODO: start from empirically derived lateral slip stiffness for the civic and scale by + # mass and CG position, so all cars will have approximately similar dyn behaviors + ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, + tire_stiffness_factor=tire_stiffness_factor) + + ret.steerControlType = car.CarParams.SteerControlType.angle + + return ret + + # returns a car.CarState + def update(self, c, can_strings): + # ******************* do can recv ******************* + self.cp.update_strings(can_strings) + + ret = self.CS.update(self.cp) + self.post_update(c,ret) + ret.canValid = self.cp.can_valid + + # events + events = self.create_common_events(ret) + + if self.CS.lkas_state not in (2, 3) and ret.vEgo > 13. * CV.MPH_TO_MS and ret.cruiseState.enabled: + events.add(car.CarEvent.EventName.steerTempUnavailable) + + ret.events = events.to_msg() + + self.CS.out = ret.as_reader() + return self.CS.out + + # pass in a car.CarControl + # to be called @ 100hz + def apply(self, c): + + ret = self.CC.update(c.enabled, self.CS, self.frame, c.actuators, + c.hudControl.visualAlert, c.cruiseControl.cancel) + + self.frame += 1 + return ret diff --git a/selfdrive/car/ford/radar_interface.py b/selfdrive/car/ford/radar_interface.py new file mode 100755 index 000000000..94eb8bb0c --- /dev/null +++ b/selfdrive/car/ford/radar_interface.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +from cereal import car +from opendbc.can.parser import CANParser +from selfdrive.car.ford.values import DBC +from selfdrive.config import Conversions as CV +from selfdrive.car.interfaces import RadarInterfaceBase + +RADAR_MSGS = list(range(0x500, 0x540)) + + +def _create_radar_can_parser(car_fingerprint): + msg_n = len(RADAR_MSGS) + signals = list(zip(['X_Rel'] * msg_n + ['Angle'] * msg_n + ['V_Rel'] * msg_n, + RADAR_MSGS * 3)) + checks = list(zip(RADAR_MSGS, [20] * msg_n)) + + return CANParser(DBC[car_fingerprint]['radar'], signals, checks, 1) + +class RadarInterface(RadarInterfaceBase): + def __init__(self, CP): + super().__init__(CP) + self.validCnt = {key: 0 for key in RADAR_MSGS} + self.track_id = 0 + + self.rcp = _create_radar_can_parser(CP.carFingerprint) + self.trigger_msg = 0x53f + self.updated_messages = set() + + def update(self, can_strings): + vls = self.rcp.update_strings(can_strings) + self.updated_messages.update(vls) + + if self.trigger_msg not in self.updated_messages: + return None + + ret = car.RadarData.new_message() + errors = [] + if not self.rcp.can_valid: + errors.append("canError") + ret.errors = errors + + for ii in sorted(self.updated_messages): + cpt = self.rcp.vl[ii] + + if cpt['X_Rel'] > 0.00001: + self.validCnt[ii] = 0 # reset counter + + if cpt['X_Rel'] > 0.00001: + self.validCnt[ii] += 1 + else: + self.validCnt[ii] = max(self.validCnt[ii] - 1, 0) + #print ii, self.validCnt[ii], cpt['VALID'], cpt['X_Rel'], cpt['Angle'] + + # radar point only valid if there have been enough valid measurements + if self.validCnt[ii] > 0: + if ii not in self.pts: + self.pts[ii] = car.RadarData.RadarPoint.new_message() + self.pts[ii].trackId = self.track_id + self.track_id += 1 + self.pts[ii].dRel = cpt['X_Rel'] # from front of car + self.pts[ii].yRel = cpt['X_Rel'] * cpt['Angle'] * CV.DEG_TO_RAD # in car frame's y axis, left is positive + self.pts[ii].vRel = cpt['V_Rel'] + self.pts[ii].aRel = float('nan') + self.pts[ii].yvRel = float('nan') + self.pts[ii].measured = True + else: + if ii in self.pts: + del self.pts[ii] + + ret.points = list(self.pts.values()) + self.updated_messages.clear() + return ret diff --git a/selfdrive/car/ford/values.py b/selfdrive/car/ford/values.py new file mode 100644 index 000000000..e1e220647 --- /dev/null +++ b/selfdrive/car/ford/values.py @@ -0,0 +1,12 @@ +from selfdrive.car import dbc_dict +from cereal import car +Ecu = car.CarParams.Ecu + +MAX_ANGLE = 87. # make sure we never command the extremes (0xfff) which cause latching fault + +class CAR: + FUSION = "FORD FUSION 2018" + +DBC = { + CAR.FUSION: dbc_dict('ford_fusion_2018_pt', 'ford_fusion_2018_adas'), +} diff --git a/selfdrive/car/fw_versions.py b/selfdrive/car/fw_versions.py new file mode 100755 index 000000000..59fd4fe8a --- /dev/null +++ b/selfdrive/car/fw_versions.py @@ -0,0 +1,395 @@ +#!/usr/bin/env python3 +import struct +import traceback +from typing import Any +from collections import defaultdict + +from tqdm import tqdm + +import panda.python.uds as uds +from cereal import car +from selfdrive.car.fingerprints import FW_VERSIONS, get_attr_from_cars +from selfdrive.car.isotp_parallel_query import IsoTpParallelQuery +from selfdrive.car.toyota.values import CAR as TOYOTA +from selfdrive.swaglog import cloudlog + +Ecu = car.CarParams.Ecu + + +def p16(val): + return struct.pack("!H", val) + + +TESTER_PRESENT_REQUEST = bytes([uds.SERVICE_TYPE.TESTER_PRESENT, 0x0]) +TESTER_PRESENT_RESPONSE = bytes([uds.SERVICE_TYPE.TESTER_PRESENT + 0x40, 0x0]) + +SHORT_TESTER_PRESENT_REQUEST = bytes([uds.SERVICE_TYPE.TESTER_PRESENT]) +SHORT_TESTER_PRESENT_RESPONSE = bytes([uds.SERVICE_TYPE.TESTER_PRESENT + 0x40]) + +DEFAULT_DIAGNOSTIC_REQUEST = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL, + uds.SESSION_TYPE.DEFAULT]) +DEFAULT_DIAGNOSTIC_RESPONSE = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL + 0x40, + uds.SESSION_TYPE.DEFAULT, 0x0, 0x32, 0x1, 0xf4]) + +EXTENDED_DIAGNOSTIC_REQUEST = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL, + uds.SESSION_TYPE.EXTENDED_DIAGNOSTIC]) +EXTENDED_DIAGNOSTIC_RESPONSE = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL + 0x40, + uds.SESSION_TYPE.EXTENDED_DIAGNOSTIC, 0x0, 0x32, 0x1, 0xf4]) + +UDS_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_SOFTWARE_IDENTIFICATION) +UDS_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_SOFTWARE_IDENTIFICATION) + + +HYUNDAI_VERSION_REQUEST_LONG = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(0xf100) # Long description +HYUNDAI_VERSION_REQUEST_MULTI = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_SPARE_PART_NUMBER) + \ + p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_SOFTWARE_IDENTIFICATION) + \ + p16(0xf100) +HYUNDAI_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + + +TOYOTA_VERSION_REQUEST = b'\x1a\x88\x01' +TOYOTA_VERSION_RESPONSE = b'\x5a\x88\x01' + +VOLKSWAGEN_VERSION_REQUEST_MULTI = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_SPARE_PART_NUMBER) + \ + p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_VERSION_NUMBER) + \ + p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_DATA_IDENTIFICATION) +VOLKSWAGEN_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + +OBD_VERSION_REQUEST = b'\x09\x04' +OBD_VERSION_RESPONSE = b'\x49\x04' + +DEFAULT_RX_OFFSET = 0x8 +VOLKSWAGEN_RX_OFFSET = 0x6a + +MAZDA_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER) +MAZDA_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER) + +NISSAN_DIAGNOSTIC_REQUEST_KWP = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL, 0xc0]) +NISSAN_DIAGNOSTIC_RESPONSE_KWP = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL + 0x40, 0xc0]) + +NISSAN_VERSION_REQUEST_KWP = b'\x21\x83' +NISSAN_VERSION_RESPONSE_KWP = b'\x61\x83' + +NISSAN_VERSION_REQUEST_STANDARD = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER) +NISSAN_VERSION_RESPONSE_STANDARD = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER) + +NISSAN_RX_OFFSET = 0x20 + +SUBARU_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_DATA_IDENTIFICATION) +SUBARU_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_DATA_IDENTIFICATION) + + +# brand, request, response, response offset +REQUESTS = [ + # Subaru + ( + "subaru", + [TESTER_PRESENT_REQUEST, SUBARU_VERSION_REQUEST], + [TESTER_PRESENT_RESPONSE, SUBARU_VERSION_RESPONSE], + DEFAULT_RX_OFFSET, + ), + # Hyundai + ( + "hyundai", + [HYUNDAI_VERSION_REQUEST_LONG], + [HYUNDAI_VERSION_RESPONSE], + DEFAULT_RX_OFFSET, + ), + ( + "hyundai", + [HYUNDAI_VERSION_REQUEST_MULTI], + [HYUNDAI_VERSION_RESPONSE], + DEFAULT_RX_OFFSET, + ), + # Honda + ( + "honda", + [UDS_VERSION_REQUEST], + [UDS_VERSION_RESPONSE], + DEFAULT_RX_OFFSET, + ), + # Toyota + ( + "toyota", + [SHORT_TESTER_PRESENT_REQUEST, TOYOTA_VERSION_REQUEST], + [SHORT_TESTER_PRESENT_RESPONSE, TOYOTA_VERSION_RESPONSE], + DEFAULT_RX_OFFSET, + ), + ( + "toyota", + [SHORT_TESTER_PRESENT_REQUEST, OBD_VERSION_REQUEST], + [SHORT_TESTER_PRESENT_RESPONSE, OBD_VERSION_RESPONSE], + DEFAULT_RX_OFFSET, + ), + ( + "toyota", + [TESTER_PRESENT_REQUEST, DEFAULT_DIAGNOSTIC_REQUEST, EXTENDED_DIAGNOSTIC_REQUEST, UDS_VERSION_REQUEST], + [TESTER_PRESENT_RESPONSE, DEFAULT_DIAGNOSTIC_RESPONSE, EXTENDED_DIAGNOSTIC_RESPONSE, UDS_VERSION_RESPONSE], + DEFAULT_RX_OFFSET, + ), + # Volkswagen + ( + "volkswagen", + [VOLKSWAGEN_VERSION_REQUEST_MULTI], + [VOLKSWAGEN_VERSION_RESPONSE], + VOLKSWAGEN_RX_OFFSET, + ), + ( + "volkswagen", + [VOLKSWAGEN_VERSION_REQUEST_MULTI], + [VOLKSWAGEN_VERSION_RESPONSE], + DEFAULT_RX_OFFSET, + ), + # Mazda + ( + "mazda", + [MAZDA_VERSION_REQUEST], + [MAZDA_VERSION_RESPONSE], + DEFAULT_RX_OFFSET, + ), + # Nissan + ( + "nissan", + [NISSAN_DIAGNOSTIC_REQUEST_KWP, NISSAN_VERSION_REQUEST_KWP], + [NISSAN_DIAGNOSTIC_RESPONSE_KWP, NISSAN_VERSION_RESPONSE_KWP], + DEFAULT_RX_OFFSET, + ), + ( + "nissan", + [NISSAN_DIAGNOSTIC_REQUEST_KWP, NISSAN_VERSION_REQUEST_KWP], + [NISSAN_DIAGNOSTIC_RESPONSE_KWP, NISSAN_VERSION_RESPONSE_KWP], + NISSAN_RX_OFFSET, + ), + ( + "nissan", + [NISSAN_VERSION_REQUEST_STANDARD], + [NISSAN_VERSION_RESPONSE_STANDARD], + NISSAN_RX_OFFSET, + ), +] + + +def chunks(l, n=128): + for i in range(0, len(l), n): + yield l[i:i + n] + + +def build_fw_dict(fw_versions): + fw_versions_dict = {} + for fw in fw_versions: + addr = fw.address + sub_addr = fw.subAddress if fw.subAddress != 0 else None + fw_versions_dict[(addr, sub_addr)] = fw.fwVersion + return fw_versions_dict + + +def match_fw_to_car_fuzzy(fw_versions_dict, log=True, exclude=None): + """Do a fuzzy FW match. This function will return a match, and the number of firmware version + that were matched uniquely to that specific car. If multiple ECUs uniquely match to different cars + the match is rejected.""" + + # These ECUs are known to be shared between models (EPS only between hybrid/ICE version) + # Getting this exactly right isn't crucial, but excluding camera and radar makes it almost + # impossible to get 3 matching versions, even if two models with shared parts are released at the same + # time and only one is in our database. + exclude_types = [Ecu.fwdCamera, Ecu.fwdRadar, Ecu.eps] + + # Build lookup table from (addr, subaddr, fw) to list of candidate cars + all_fw_versions = defaultdict(list) + for candidate, fw_by_addr in FW_VERSIONS.items(): + if candidate == exclude: + continue + + for addr, fws in fw_by_addr.items(): + if addr[0] in exclude_types: + continue + for f in fws: + all_fw_versions[(addr[1], addr[2], f)].append(candidate) + + match_count = 0 + candidate = None + for addr, version in fw_versions_dict.items(): + # All cars that have this FW response on the specified address + candidates = all_fw_versions[(addr[0], addr[1], version)] + + if len(candidates) == 1: + match_count += 1 + if candidate is None: + candidate = candidates[0] + # We uniquely matched two different cars. No fuzzy match possible + elif candidate != candidates[0]: + return set() + + if match_count >= 2: + if log: + cloudlog.error(f"Fingerprinted {candidate} using fuzzy match. {match_count} matching ECUs") + return {candidate} + else: + return set() + + +def match_fw_to_car_exact(fw_versions_dict): + """Do an exact FW match. Returns all cars that match the given + FW versions for a list of "essential" ECUs. If an ECU is not considered + essential the FW version can be missing to get a fingerprint, but if it's present it + needs to match the database.""" + invalid = [] + candidates = FW_VERSIONS + + for candidate, fws in candidates.items(): + for ecu, expected_versions in fws.items(): + ecu_type = ecu[0] + addr = ecu[1:] + found_version = fw_versions_dict.get(addr, None) + ESSENTIAL_ECUS = [Ecu.engine, Ecu.eps, Ecu.esp, Ecu.fwdRadar, Ecu.fwdCamera, Ecu.vsa] + if ecu_type == Ecu.esp and candidate in (TOYOTA.RAV4, TOYOTA.COROLLA, TOYOTA.HIGHLANDER, TOYOTA.SIENNA, TOYOTA.LEXUS_IS) and found_version is None: + continue + + # On some Toyota models, the engine can show on two different addresses + if ecu_type == Ecu.engine and candidate in (TOYOTA.CAMRY, TOYOTA.COROLLA_TSS2, TOYOTA.CHR, TOYOTA.LEXUS_IS) and found_version is None: + continue + + # Ignore non essential ecus + if ecu_type not in ESSENTIAL_ECUS and found_version is None: + continue + + if found_version not in expected_versions: + invalid.append(candidate) + break + + return set(candidates.keys()) - set(invalid) + + +def match_fw_to_car(fw_versions, allow_fuzzy=True): + fw_versions_dict = build_fw_dict(fw_versions) + matches = match_fw_to_car_exact(fw_versions_dict) + + exact_match = True + if allow_fuzzy and len(matches) == 0: + matches = match_fw_to_car_fuzzy(fw_versions_dict) + + # Fuzzy match found + if len(matches) == 1: + exact_match = False + + return exact_match, matches + + +def get_fw_versions(logcan, sendcan, bus, extra=None, timeout=0.1, debug=False, progress=False): + ecu_types = {} + + # Extract ECU addresses to query from fingerprints + # ECUs using a subadress need be queried one by one, the rest can be done in parallel + addrs = [] + parallel_addrs = [] + + versions = get_attr_from_cars('FW_VERSIONS', combine_brands=False) + if extra is not None: + versions.update(extra) + + for brand, brand_versions in versions.items(): + for c in brand_versions.values(): + for ecu_type, addr, sub_addr in c.keys(): + a = (brand, addr, sub_addr) + if a not in ecu_types: + ecu_types[(addr, sub_addr)] = ecu_type + + if sub_addr is None: + if a not in parallel_addrs: + parallel_addrs.append(a) + else: + if [a] not in addrs: + addrs.append([a]) + + addrs.insert(0, parallel_addrs) + + fw_versions = {} + for i, addr in enumerate(tqdm(addrs, disable=not progress)): + for addr_chunk in chunks(addr): + for brand, request, response, response_offset in REQUESTS: + try: + addrs = [(a, s) for (b, a, s) in addr_chunk if b in (brand, 'any')] + + if addrs: + query = IsoTpParallelQuery(sendcan, logcan, bus, addrs, request, response, response_offset, debug=debug) + t = 2 * timeout if i == 0 else timeout + fw_versions.update(query.get_data(t)) + except Exception: + cloudlog.warning(f"FW query exception: {traceback.format_exc()}") + + # Build capnp list to put into CarParams + car_fw = [] + for addr, version in fw_versions.items(): + f = car.CarParams.CarFw.new_message() + + f.ecu = ecu_types[addr] + f.fwVersion = version + f.address = addr[0] + + if addr[1] is not None: + f.subAddress = addr[1] + + car_fw.append(f) + + return car_fw + + +if __name__ == "__main__": + import time + import argparse + import cereal.messaging as messaging + from selfdrive.car.vin import get_vin + + parser = argparse.ArgumentParser(description='Get firmware version of ECUs') + parser.add_argument('--scan', action='store_true') + parser.add_argument('--debug', action='store_true') + args = parser.parse_args() + + logcan = messaging.sub_sock('can') + sendcan = messaging.pub_sock('sendcan') + + extra: Any = None + if args.scan: + extra = {} + # Honda + for i in range(256): + extra[(Ecu.unknown, 0x18da00f1 + (i << 8), None)] = [] + extra[(Ecu.unknown, 0x700 + i, None)] = [] + extra[(Ecu.unknown, 0x750, i)] = [] + extra = {"any": {"debug": extra}} + + time.sleep(1.) + + t = time.time() + print("Getting vin...") + addr, vin = get_vin(logcan, sendcan, 1, retry=10, debug=args.debug) + print(f"VIN: {vin}") + print(f"Getting VIN took {time.time() - t:.3f} s") + print() + + t = time.time() + fw_vers = get_fw_versions(logcan, sendcan, 1, extra=extra, debug=args.debug, progress=True) + _, candidates = match_fw_to_car(fw_vers) + + print() + print("Found FW versions") + print("{") + for version in fw_vers: + subaddr = None if version.subAddress == 0 else hex(version.subAddress) + print(f" (Ecu.{version.ecu}, {hex(version.address)}, {subaddr}): [{version.fwVersion}]") + print("}") + + print() + print("Possible matches:", candidates) + print(f"Getting fw took {time.time() - t:.3f} s") diff --git a/selfdrive/car/gm/__init__.py b/selfdrive/car/gm/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/gm/carcontroller.py b/selfdrive/car/gm/carcontroller.py new file mode 100644 index 000000000..7ad1e7cf8 --- /dev/null +++ b/selfdrive/car/gm/carcontroller.py @@ -0,0 +1,117 @@ +from cereal import car +from common.realtime import DT_CTRL +from common.numpy_fast import interp +from selfdrive.config import Conversions as CV +from selfdrive.car import apply_std_steer_torque_limits +from selfdrive.car.gm import gmcan +from selfdrive.car.gm.values import DBC, CanBus, CarControllerParams +from opendbc.can.packer import CANPacker + +VisualAlert = car.CarControl.HUDControl.VisualAlert + + +class CarController(): + def __init__(self, dbc_name, CP, VM): + self.start_time = 0. + self.apply_steer_last = 0 + self.apply_gas = 0 + self.apply_brake = 0 + + self.lka_steering_cmd_counter_last = -1 + self.lka_icon_status_last = (False, False) + self.steer_rate_limited = False + + self.params = CarControllerParams() + + self.packer_pt = CANPacker(DBC[CP.carFingerprint]['pt']) + self.packer_obj = CANPacker(DBC[CP.carFingerprint]['radar']) + self.packer_ch = CANPacker(DBC[CP.carFingerprint]['chassis']) + + def update(self, c, enabled, CS, frame, actuators, + hud_v_cruise, hud_show_lanes, hud_show_car, hud_alert): + + P = self.params + + # Send CAN commands. + can_sends = [] + + # Steering (50Hz) + # Avoid GM EPS faults when transmitting messages too close together: skip this transmit if we just received the + # next Panda loopback confirmation in the current CS frame. + if CS.lka_steering_cmd_counter != self.lka_steering_cmd_counter_last: + self.lka_steering_cmd_counter_last = CS.lka_steering_cmd_counter + elif (frame % P.STEER_STEP) == 0: + lkas_enabled = c.active and not (CS.out.steerWarning or CS.out.steerError) and CS.out.vEgo > P.MIN_STEER_SPEED + if lkas_enabled: + new_steer = int(round(actuators.steer * P.STEER_MAX)) + apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, P) + self.steer_rate_limited = new_steer != apply_steer + else: + apply_steer = 0 + + self.apply_steer_last = apply_steer + # GM EPS faults on any gap in received message counters. To handle transient OP/Panda safety sync issues at the + # moment of disengaging, increment the counter based on the last message known to pass Panda safety checks. + idx = (CS.lka_steering_cmd_counter + 1) % 4 + + can_sends.append(gmcan.create_steering_control(self.packer_pt, CanBus.POWERTRAIN, apply_steer, idx, lkas_enabled)) + + # Gas/regen and brakes - all at 25Hz + if (frame % 4) == 0: + if not c.active: + # Stock ECU sends max regen when not enabled. + self.apply_gas = P.MAX_ACC_REGEN + self.apply_brake = 0 + else: + self.apply_gas = int(round(interp(actuators.accel, P.GAS_LOOKUP_BP, P.GAS_LOOKUP_V))) + self.apply_brake = int(round(interp(actuators.accel, P.BRAKE_LOOKUP_BP, P.BRAKE_LOOKUP_V))) + + idx = (frame // 4) % 4 + + at_full_stop = enabled and CS.out.standstill + near_stop = enabled and (CS.out.vEgo < P.NEAR_STOP_BRAKE_PHASE) + can_sends.append(gmcan.create_friction_brake_command(self.packer_ch, CanBus.CHASSIS, self.apply_brake, idx, near_stop, at_full_stop)) + can_sends.append(gmcan.create_gas_regen_command(self.packer_pt, CanBus.POWERTRAIN, self.apply_gas, idx, enabled, at_full_stop)) + + # Send dashboard UI commands (ACC status), 25hz + if (frame % 4) == 0: + send_fcw = hud_alert == VisualAlert.fcw + can_sends.append(gmcan.create_acc_dashboard_command(self.packer_pt, CanBus.POWERTRAIN, enabled, hud_v_cruise * CV.MS_TO_KPH, hud_show_car, send_fcw)) + + # Radar needs to know current speed and yaw rate (50hz), + # and that ADAS is alive (10hz) + time_and_headlights_step = 10 + tt = frame * DT_CTRL + + if frame % time_and_headlights_step == 0: + idx = (frame // time_and_headlights_step) % 4 + can_sends.append(gmcan.create_adas_time_status(CanBus.OBSTACLE, int((tt - self.start_time) * 60), idx)) + can_sends.append(gmcan.create_adas_headlights_status(self.packer_obj, CanBus.OBSTACLE)) + + speed_and_accelerometer_step = 2 + if frame % speed_and_accelerometer_step == 0: + idx = (frame // speed_and_accelerometer_step) % 4 + can_sends.append(gmcan.create_adas_steering_status(CanBus.OBSTACLE, idx)) + can_sends.append(gmcan.create_adas_accelerometer_speed_status(CanBus.OBSTACLE, CS.out.vEgo, idx)) + + if frame % P.ADAS_KEEPALIVE_STEP == 0: + can_sends += gmcan.create_adas_keepalive(CanBus.POWERTRAIN) + + # Show green icon when LKA torque is applied, and + # alarming orange icon when approaching torque limit. + # If not sent again, LKA icon disappears in about 5 seconds. + # Conveniently, sending camera message periodically also works as a keepalive. + lka_active = CS.lkas_status == 1 + lka_critical = lka_active and abs(actuators.steer) > 0.9 + lka_icon_status = (lka_active, lka_critical) + if frame % P.CAMERA_KEEPALIVE_STEP == 0 or lka_icon_status != self.lka_icon_status_last: + steer_alert = hud_alert in (VisualAlert.steerRequired, VisualAlert.ldw) + can_sends.append(gmcan.create_lka_icon_command(CanBus.SW_GMLAN, lka_active, lka_critical, steer_alert)) + self.lka_icon_status_last = lka_icon_status + + new_actuators = actuators.copy() + new_actuators.steer = self.apply_steer_last / P.STEER_MAX + new_actuators.gas = self.apply_gas + new_actuators.brake = self.apply_brake + + return new_actuators, can_sends diff --git a/selfdrive/car/gm/carstate.py b/selfdrive/car/gm/carstate.py new file mode 100644 index 000000000..78597fdf1 --- /dev/null +++ b/selfdrive/car/gm/carstate.py @@ -0,0 +1,156 @@ +from cereal import car +from common.numpy_fast import mean +from opendbc.can.can_define import CANDefine +from opendbc.can.parser import CANParser +from selfdrive.car.interfaces import CarStateBase +from selfdrive.car.gm.values import DBC, CAR, AccState, CanBus, STEER_THRESHOLD + + +class CarState(CarStateBase): + def __init__(self, CP): + super().__init__(CP) + can_define = CANDefine(DBC[CP.carFingerprint]["pt"]) + self.shifter_values = can_define.dv["ECMPRDNL"]["PRNDL"] + self.lka_steering_cmd_counter = 0 + + def update(self, pt_cp, loopback_cp): + ret = car.CarState.new_message() + + self.prev_cruise_buttons = self.cruise_buttons + self.cruise_buttons = pt_cp.vl["ASCMSteeringButton"]["ACCButtons"] + + ret.wheelSpeeds = self.get_wheel_speeds( + pt_cp.vl["EBCMWheelSpdFront"]["FLWheelSpd"], + pt_cp.vl["EBCMWheelSpdFront"]["FRWheelSpd"], + pt_cp.vl["EBCMWheelSpdRear"]["RLWheelSpd"], + pt_cp.vl["EBCMWheelSpdRear"]["RRWheelSpd"], + ) + ret.vEgoRaw = mean([ret.wheelSpeeds.fl, ret.wheelSpeeds.fr, ret.wheelSpeeds.rl, ret.wheelSpeeds.rr]) + ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) + ret.standstill = ret.vEgoRaw < 0.01 + + ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(pt_cp.vl["ECMPRDNL"]["PRNDL"], None)) + ret.brakePressed = pt_cp.vl["ECMEngineStatus"]["Brake_Pressed"] != 0 + ret.brake = pt_cp.vl["EBCMBrakePedalPosition"]["BrakePedalPosition"] / 0xd0 + + ret.gas = pt_cp.vl["AcceleratorPedal2"]["AcceleratorPedal2"] / 254. + ret.gasPressed = ret.gas > 1e-5 + + ret.steeringAngleDeg = pt_cp.vl["PSCMSteeringAngle"]["SteeringWheelAngle"] + ret.steeringRateDeg = pt_cp.vl["PSCMSteeringAngle"]["SteeringWheelRate"] + ret.steeringTorque = pt_cp.vl["PSCMStatus"]["LKADriverAppldTrq"] + ret.steeringTorqueEps = pt_cp.vl["PSCMStatus"]["LKATorqueDelivered"] + ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD + self.lka_steering_cmd_counter = loopback_cp.vl["ASCMLKASteeringCmd"]["RollingCounter"] + + # 0 inactive, 1 active, 2 temporarily limited, 3 failed + self.lkas_status = pt_cp.vl["PSCMStatus"]["LKATorqueDeliveredStatus"] + ret.steerWarning = self.lkas_status == 2 + ret.steerError = self.lkas_status == 3 + + # 1 - open, 0 - closed + ret.doorOpen = (pt_cp.vl["BCMDoorBeltStatus"]["FrontLeftDoor"] == 1 or + pt_cp.vl["BCMDoorBeltStatus"]["FrontRightDoor"] == 1 or + pt_cp.vl["BCMDoorBeltStatus"]["RearLeftDoor"] == 1 or + pt_cp.vl["BCMDoorBeltStatus"]["RearRightDoor"] == 1) + + # 1 - latched + ret.seatbeltUnlatched = pt_cp.vl["BCMDoorBeltStatus"]["LeftSeatBelt"] == 0 + ret.leftBlinker = pt_cp.vl["BCMTurnSignals"]["TurnSignals"] == 1 + ret.rightBlinker = pt_cp.vl["BCMTurnSignals"]["TurnSignals"] == 2 + + self.park_brake = pt_cp.vl["EPBStatus"]["EPBClosed"] + ret.cruiseState.available = pt_cp.vl["ECMEngineStatus"]["CruiseMainOn"] != 0 + ret.espDisabled = pt_cp.vl["ESPStatus"]["TractionControlOn"] != 1 + self.pcm_acc_status = pt_cp.vl["AcceleratorPedal2"]["CruiseState"] + + # Regen braking is braking + if self.car_fingerprint == CAR.VOLT: + ret.brakePressed = ret.brakePressed or pt_cp.vl["EBCMRegenPaddle"]["RegenPaddle"] != 0 + + ret.cruiseState.enabled = self.pcm_acc_status != AccState.OFF + ret.cruiseState.standstill = self.pcm_acc_status == AccState.STANDSTILL + + return ret + + @staticmethod + def get_can_parser(CP): + signals = [ + # sig_name, sig_address + ("BrakePedalPosition", "EBCMBrakePedalPosition"), + ("FrontLeftDoor", "BCMDoorBeltStatus"), + ("FrontRightDoor", "BCMDoorBeltStatus"), + ("RearLeftDoor", "BCMDoorBeltStatus"), + ("RearRightDoor", "BCMDoorBeltStatus"), + ("LeftSeatBelt", "BCMDoorBeltStatus"), + ("RightSeatBelt", "BCMDoorBeltStatus"), + ("TurnSignals", "BCMTurnSignals"), + ("AcceleratorPedal2", "AcceleratorPedal2"), + ("CruiseState", "AcceleratorPedal2"), + ("ACCButtons", "ASCMSteeringButton"), + ("SteeringWheelAngle", "PSCMSteeringAngle"), + ("SteeringWheelRate", "PSCMSteeringAngle"), + ("FLWheelSpd", "EBCMWheelSpdFront"), + ("FRWheelSpd", "EBCMWheelSpdFront"), + ("RLWheelSpd", "EBCMWheelSpdRear"), + ("RRWheelSpd", "EBCMWheelSpdRear"), + ("PRNDL", "ECMPRDNL"), + ("LKADriverAppldTrq", "PSCMStatus"), + ("LKATorqueDelivered", "PSCMStatus"), + ("LKATorqueDeliveredStatus", "PSCMStatus"), + ("TractionControlOn", "ESPStatus"), + ("EPBClosed", "EPBStatus"), + ("CruiseMainOn", "ECMEngineStatus"), + ("Brake_Pressed", "ECMEngineStatus"), + ] + + checks = [ + ("BCMTurnSignals", 1), + ("ECMPRDNL", 10), + ("PSCMStatus", 10), + ("ESPStatus", 10), + ("BCMDoorBeltStatus", 10), + ("EPBStatus", 20), + ("EBCMWheelSpdFront", 20), + ("EBCMWheelSpdRear", 20), + ("AcceleratorPedal2", 33), + ("ASCMSteeringButton", 33), + ("ECMEngineStatus", 100), + ("PSCMSteeringAngle", 100), + ("EBCMBrakePedalPosition", 100), + ] + + checks = [ + ("BCMTurnSignals", 1), + ("ECMPRDNL", 10), + ("PSCMStatus", 10), + ("ESPStatus", 10), + ("BCMDoorBeltStatus", 10), + ("EPBStatus", 20), + ("EBCMWheelSpdFront", 20), + ("EBCMWheelSpdRear", 20), + ("AcceleratorPedal", 33), + ("AcceleratorPedal2", 33), + ("ASCMSteeringButton", 33), + ("ECMEngineStatus", 100), + ("PSCMSteeringAngle", 100), + ("EBCMBrakePedalPosition", 100), + ] + + if CP.carFingerprint == CAR.VOLT: + signals.append(("RegenPaddle", "EBCMRegenPaddle")) + checks.append(("EBCMRegenPaddle", 50)) + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, CanBus.POWERTRAIN) + + @staticmethod + def get_loopback_can_parser(CP): + signals = [ + ("RollingCounter", "ASCMLKASteeringCmd"), + ] + + checks = [ + ("ASCMLKASteeringCmd", 50), + ] + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, CanBus.LOOPBACK) diff --git a/selfdrive/car/gm/gmcan.py b/selfdrive/car/gm/gmcan.py new file mode 100644 index 000000000..47e6090a0 --- /dev/null +++ b/selfdrive/car/gm/gmcan.py @@ -0,0 +1,125 @@ +from selfdrive.car import make_can_msg + +def create_steering_control(packer, bus, apply_steer, idx, lkas_active): + + values = { + "LKASteeringCmdActive": lkas_active, + "LKASteeringCmd": apply_steer, + "RollingCounter": idx, + "LKASteeringCmdChecksum": 0x1000 - (lkas_active << 11) - (apply_steer & 0x7ff) - idx + } + + return packer.make_can_msg("ASCMLKASteeringCmd", bus, values) + +def create_adas_keepalive(bus): + dat = b"\x00\x00\x00\x00\x00\x00\x00" + return [make_can_msg(0x409, dat, bus), make_can_msg(0x40a, dat, bus)] + +def create_gas_regen_command(packer, bus, throttle, idx, acc_engaged, at_full_stop): + values = { + "GasRegenCmdActive": acc_engaged, + "RollingCounter": idx, + "GasRegenCmdActiveInv": 1 - acc_engaged, + "GasRegenCmd": throttle, + "GasRegenFullStopActive": at_full_stop, + "GasRegenAlwaysOne": 1, + "GasRegenAlwaysOne2": 1, + "GasRegenAlwaysOne3": 1, + } + + dat = packer.make_can_msg("ASCMGasRegenCmd", bus, values)[2] + values["GasRegenChecksum"] = (((0xff - dat[1]) & 0xff) << 16) | \ + (((0xff - dat[2]) & 0xff) << 8) | \ + ((0x100 - dat[3] - idx) & 0xff) + + return packer.make_can_msg("ASCMGasRegenCmd", bus, values) + +def create_friction_brake_command(packer, bus, apply_brake, idx, near_stop, at_full_stop): + mode = 0x1 + if apply_brake > 0: + mode = 0xa + if at_full_stop: + mode = 0xd + + # TODO: this is to have GM bringing the car to complete stop, + # but currently it conflicts with OP controls, so turned off. + #elif near_stop: + # mode = 0xb + + brake = (0x1000 - apply_brake) & 0xfff + checksum = (0x10000 - (mode << 12) - brake - idx) & 0xffff + + values = { + "RollingCounter" : idx, + "FrictionBrakeMode" : mode, + "FrictionBrakeChecksum": checksum, + "FrictionBrakeCmd" : -apply_brake + } + + return packer.make_can_msg("EBCMFrictionBrakeCmd", bus, values) + +def create_acc_dashboard_command(packer, bus, acc_engaged, target_speed_kph, lead_car_in_sight, fcw): + # Not a bit shift, dash can round up based on low 4 bits. + target_speed = int(target_speed_kph * 16) & 0xfff + + values = { + "ACCAlwaysOne" : 1, + "ACCResumeButton" : 0, + "ACCSpeedSetpoint" : target_speed, + "ACCGapLevel" : 3 * acc_engaged, # 3 "far", 0 "inactive" + "ACCCmdActive" : acc_engaged, + "ACCAlwaysOne2" : 1, + "ACCLeadCar" : lead_car_in_sight, + "FCWAlert": 0x3 if fcw else 0 + } + + return packer.make_can_msg("ASCMActiveCruiseControlStatus", bus, values) + +def create_adas_time_status(bus, tt, idx): + dat = [(tt >> 20) & 0xff, (tt >> 12) & 0xff, (tt >> 4) & 0xff, + ((tt & 0xf) << 4) + (idx << 2)] + chksum = 0x1000 - dat[0] - dat[1] - dat[2] - dat[3] + chksum = chksum & 0xfff + dat += [0x40 + (chksum >> 8), chksum & 0xff, 0x12] + return make_can_msg(0xa1, bytes(dat), bus) + +def create_adas_steering_status(bus, idx): + dat = [idx << 6, 0xf0, 0x20, 0, 0, 0] + chksum = 0x60 + sum(dat) + dat += [chksum >> 8, chksum & 0xff] + return make_can_msg(0x306, bytes(dat), bus) + +def create_adas_accelerometer_speed_status(bus, speed_ms, idx): + spd = int(speed_ms * 16) & 0xfff + accel = 0 & 0xfff + # 0 if in park/neutral, 0x10 if in reverse, 0x08 for D/L + #stick = 0x08 + near_range_cutoff = 0x27 + near_range_mode = 1 if spd <= near_range_cutoff else 0 + far_range_mode = 1 - near_range_mode + dat = [0x08, spd >> 4, ((spd & 0xf) << 4) | (accel >> 8), accel & 0xff, 0] + chksum = 0x62 + far_range_mode + (idx << 2) + dat[0] + dat[1] + dat[2] + dat[3] + dat[4] + dat += [(idx << 5) + (far_range_mode << 4) + (near_range_mode << 3) + (chksum >> 8), chksum & 0xff] + return make_can_msg(0x308, bytes(dat), bus) + +def create_adas_headlights_status(packer, bus): + values = { + "Always42": 0x42, + "Always4": 0x4, + } + return packer.make_can_msg("ASCMHeadlight", bus, values) + +def create_lka_icon_command(bus, active, critical, steer): + if active and steer == 1: + if critical: + dat = b"\x50\xc0\x14" + else: + dat = b"\x50\x40\x18" + elif active: + if critical: + dat = b"\x40\xc0\x14" + else: + dat = b"\x40\x40\x18" + else: + dat = b"\x00\x00\x00" + return make_can_msg(0x104c006c, dat, bus) diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py new file mode 100755 index 000000000..c2d5b7088 --- /dev/null +++ b/selfdrive/car/gm/interface.py @@ -0,0 +1,233 @@ +#!/usr/bin/env python3 +from cereal import car +from math import fabs +from selfdrive.config import Conversions as CV +from selfdrive.car.gm.values import CAR, CruiseButtons, \ + AccState, CarControllerParams +from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config +from selfdrive.car.interfaces import CarInterfaceBase + +ButtonType = car.CarState.ButtonEvent.Type +EventName = car.CarEvent.EventName + +class CarInterface(CarInterfaceBase): + @staticmethod + def get_pid_accel_limits(CP, current_speed, cruise_speed): + params = CarControllerParams() + return params.ACCEL_MIN, params.ACCEL_MAX + + # Determined by iteratively plotting and minimizing error for f(angle, speed) = steer. + @staticmethod + def get_steer_feedforward_volt(desired_angle, v_ego): + desired_angle *= 0.02904609 + sigmoid = desired_angle / (1 + fabs(desired_angle)) + return 0.10006696 * sigmoid * (v_ego + 3.12485927) + + @staticmethod + def get_steer_feedforward_acadia(desired_angle, v_ego): + desired_angle *= 0.09760208 + sigmoid = desired_angle / (1 + fabs(desired_angle)) + return 0.04689655 * sigmoid * (v_ego + 10.028217) + + def get_steer_feedforward_function(self): + if self.CP.carFingerprint == CAR.VOLT: + return self.get_steer_feedforward_volt + elif self.CP.carFingerprint == CAR.ACADIA: + return self.get_steer_feedforward_acadia + else: + return CarInterfaceBase.get_steer_feedforward_default + + @staticmethod + def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None): + ret = CarInterfaceBase.get_std_params(candidate, fingerprint) + ret.carName = "gm" + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.gm)] + ret.pcmCruise = False # stock cruise control is kept off + + # These cars have been put into dashcam only due to both a lack of users and test coverage. + # These cars likely still work fine. Once a user confirms each car works and a test route is + # added to selfdrive/test/test_routes, we can remove it from this list. + ret.dashcamOnly = candidate in {CAR.CADILLAC_ATS, CAR.HOLDEN_ASTRA, CAR.MALIBU, CAR.BUICK_REGAL} + + # Presence of a camera on the object bus is ok. + # Have to go to read_only if ASCM is online (ACC-enabled cars), + # or camera is on powertrain bus (LKA cars without ACC). + ret.openpilotLongitudinalControl = True + tire_stiffness_factor = 0.444 # not optimized yet + + # Start with a baseline lateral tuning for all GM vehicles. Override tuning as needed in each model section below. + ret.minSteerSpeed = 7 * CV.MPH_TO_MS + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.00]] + ret.lateralTuning.pid.kf = 0.00004 # full torque for 20 deg at 80mph means 0.00007818594 + ret.steerRateCost = 1.0 + ret.steerActuatorDelay = 0.1 # Default delay, not measured yet + + if candidate == CAR.VOLT: + # supports stop and go, but initial engage must be above 18mph (which include conservatism) + ret.minEnableSpeed = 18 * CV.MPH_TO_MS + ret.mass = 1607. + STD_CARGO_KG + ret.wheelbase = 2.69 + ret.steerRatio = 17.7 # Stock 15.7, LiveParameters + tire_stiffness_factor = 0.469 # Stock Michelin Energy Saver A/S, LiveParameters + ret.steerRatioRear = 0. + ret.centerToFront = ret.wheelbase * 0.45 # Volt Gen 1, TODO corner weigh + + ret.lateralTuning.pid.kpBP = [0., 40.] + ret.lateralTuning.pid.kpV = [0., 0.17] + ret.lateralTuning.pid.kiBP = [0.] + ret.lateralTuning.pid.kiV = [0.] + ret.lateralTuning.pid.kf = 1. # get_steer_feedforward_volt() + ret.steerActuatorDelay = 0.2 + + elif candidate == CAR.MALIBU: + # supports stop and go, but initial engage must be above 18mph (which include conservatism) + ret.minEnableSpeed = 18 * CV.MPH_TO_MS + ret.mass = 1496. + STD_CARGO_KG + ret.wheelbase = 2.83 + ret.steerRatio = 15.8 + ret.steerRatioRear = 0. + ret.centerToFront = ret.wheelbase * 0.4 # wild guess + + elif candidate == CAR.HOLDEN_ASTRA: + ret.mass = 1363. + STD_CARGO_KG + ret.wheelbase = 2.662 + # Remaining parameters copied from Volt for now + ret.centerToFront = ret.wheelbase * 0.4 + ret.minEnableSpeed = 18 * CV.MPH_TO_MS + ret.steerRatio = 15.7 + ret.steerRatioRear = 0. + + elif candidate == CAR.ACADIA: + ret.minEnableSpeed = -1. # engage speed is decided by pcm + ret.mass = 4353. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.86 + ret.steerRatio = 14.4 # end to end is 13.46 + ret.steerRatioRear = 0. + ret.centerToFront = ret.wheelbase * 0.4 + ret.lateralTuning.pid.kf = 1. # get_steer_feedforward_acadia() + + elif candidate == CAR.BUICK_REGAL: + ret.minEnableSpeed = 18 * CV.MPH_TO_MS + ret.mass = 3779. * CV.LB_TO_KG + STD_CARGO_KG # (3849+3708)/2 + ret.wheelbase = 2.83 # 111.4 inches in meters + ret.steerRatio = 14.4 # guess for tourx + ret.steerRatioRear = 0. + ret.centerToFront = ret.wheelbase * 0.4 # guess for tourx + + elif candidate == CAR.CADILLAC_ATS: + ret.minEnableSpeed = 18 * CV.MPH_TO_MS + ret.mass = 1601. + STD_CARGO_KG + ret.wheelbase = 2.78 + ret.steerRatio = 15.3 + ret.steerRatioRear = 0. + ret.centerToFront = ret.wheelbase * 0.49 + + elif candidate == CAR.ESCALADE_ESV: + ret.minEnableSpeed = -1. # engage speed is decided by pcm + ret.mass = 2739. + STD_CARGO_KG + ret.wheelbase = 3.302 + ret.steerRatio = 17.3 + ret.centerToFront = ret.wheelbase * 0.49 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[10., 41.0], [10., 41.0]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.13, 0.24], [0.01, 0.02]] + ret.lateralTuning.pid.kf = 0.000045 + tire_stiffness_factor = 1.0 + + # TODO: get actual value, for now starting with reasonable value for + # civic and scaling by mass and wheelbase + ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) + + # TODO: start from empirically derived lateral slip stiffness for the civic and scale by + # mass and CG position, so all cars will have approximately similar dyn behaviors + ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, + tire_stiffness_factor=tire_stiffness_factor) + + ret.longitudinalTuning.kpBP = [5., 35.] + ret.longitudinalTuning.kpV = [2.4, 1.5] + ret.longitudinalTuning.kiBP = [0.] + ret.longitudinalTuning.kiV = [0.36] + + ret.steerLimitTimer = 0.4 + ret.radarTimeStep = 0.0667 # GM radar runs at 15Hz instead of standard 20Hz + + return ret + + # returns a car.CarState + def update(self, c, can_strings): + self.cp.update_strings(can_strings) + self.cp_loopback.update_strings(can_strings) + + ret = self.CS.update(self.cp, self.cp_loopback) + + ret.canValid = self.cp.can_valid and self.cp_loopback.can_valid + ret.steeringRateLimited = self.CC.steer_rate_limited if self.CC is not None else False + + buttonEvents = [] + + if self.CS.cruise_buttons != self.CS.prev_cruise_buttons and self.CS.prev_cruise_buttons != CruiseButtons.INIT: + be = car.CarState.ButtonEvent.new_message() + be.type = ButtonType.unknown + if self.CS.cruise_buttons != CruiseButtons.UNPRESS: + be.pressed = True + but = self.CS.cruise_buttons + else: + be.pressed = False + but = self.CS.prev_cruise_buttons + if but == CruiseButtons.RES_ACCEL: + if not (ret.cruiseState.enabled and ret.standstill): + be.type = ButtonType.accelCruise # Suppress resume button if we're resuming from stop so we don't adjust speed. + elif but == CruiseButtons.DECEL_SET: + be.type = ButtonType.decelCruise + elif but == CruiseButtons.CANCEL: + be.type = ButtonType.cancel + elif but == CruiseButtons.MAIN: + be.type = ButtonType.altButton3 + buttonEvents.append(be) + + ret.buttonEvents = buttonEvents + + events = self.create_common_events(ret, pcm_enable=False) + + if ret.vEgo < self.CP.minEnableSpeed: + events.add(EventName.belowEngageSpeed) + if self.CS.park_brake: + events.add(EventName.parkBrake) + if ret.cruiseState.standstill: + events.add(EventName.resumeRequired) + if self.CS.pcm_acc_status == AccState.FAULTED: + events.add(EventName.accFaulted) + if ret.vEgo < self.CP.minSteerSpeed: + events.add(car.CarEvent.EventName.belowSteerSpeed) + + # handle button presses + for b in ret.buttonEvents: + # do enable on both accel and decel buttons + if b.type in (ButtonType.accelCruise, ButtonType.decelCruise) and not b.pressed: + events.add(EventName.buttonEnable) + # do disable on button down + if b.type == ButtonType.cancel and b.pressed: + events.add(EventName.buttonCancel) + + ret.events = events.to_msg() + + # copy back carState packet to CS + self.CS.out = ret.as_reader() + return self.CS.out + + def apply(self, c): + hud_control = c.hudControl + hud_v_cruise = hud_control.setSpeed + if hud_v_cruise > 70: + hud_v_cruise = 0 + # For Openpilot, "enabled" includes pre-enable. + # In GM, PCM faults out if ACC command overlaps user gas. + enabled = c.enabled and not self.CS.out.gasPressed + + ret = self.CC.update(c, enabled, self.CS, self.frame, + c.actuators, + hud_v_cruise, hud_control.lanesVisible, + hud_control.leadVisible, hud_control.visualAlert) + + self.frame += 1 + return ret diff --git a/selfdrive/car/gm/radar_interface.py b/selfdrive/car/gm/radar_interface.py new file mode 100755 index 000000000..66fac5474 --- /dev/null +++ b/selfdrive/car/gm/radar_interface.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python3 +import math +from cereal import car +from opendbc.can.parser import CANParser +from selfdrive.car.gm.values import DBC, CAR, CanBus +from selfdrive.config import Conversions as CV +from selfdrive.car.interfaces import RadarInterfaceBase + +RADAR_HEADER_MSG = 1120 +SLOT_1_MSG = RADAR_HEADER_MSG + 1 +NUM_SLOTS = 20 + +# Actually it's 0x47f, but can parser only reports +# messages that are present in DBC +LAST_RADAR_MSG = RADAR_HEADER_MSG + NUM_SLOTS + + +def create_radar_can_parser(car_fingerprint): + if car_fingerprint not in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA, CAR.ACADIA, CAR.CADILLAC_ATS, CAR.ESCALADE_ESV): + return None + + # C1A-ARS3-A by Continental + radar_targets = list(range(SLOT_1_MSG, SLOT_1_MSG + NUM_SLOTS)) + signals = list(zip(['FLRRNumValidTargets', + 'FLRRSnsrBlckd', 'FLRRYawRtPlsblityFlt', + 'FLRRHWFltPrsntInt', 'FLRRAntTngFltPrsnt', + 'FLRRAlgnFltPrsnt', 'FLRRSnstvFltPrsntInt'] + + ['TrkRange'] * NUM_SLOTS + ['TrkRangeRate'] * NUM_SLOTS + + ['TrkRangeAccel'] * NUM_SLOTS + ['TrkAzimuth'] * NUM_SLOTS + + ['TrkWidth'] * NUM_SLOTS + ['TrkObjectID'] * NUM_SLOTS, + [RADAR_HEADER_MSG] * 7 + radar_targets * 6)) + + checks = list({(s[1], 14) for s in signals}) + + return CANParser(DBC[car_fingerprint]['radar'], signals, checks, CanBus.OBSTACLE) + +class RadarInterface(RadarInterfaceBase): + def __init__(self, CP): + super().__init__(CP) + + self.rcp = create_radar_can_parser(CP.carFingerprint) + + self.trigger_msg = LAST_RADAR_MSG + self.updated_messages = set() + self.radar_ts = CP.radarTimeStep + + def update(self, can_strings): + if self.rcp is None: + return super().update(None) + + vls = self.rcp.update_strings(can_strings) + self.updated_messages.update(vls) + + if self.trigger_msg not in self.updated_messages: + return None + + ret = car.RadarData.new_message() + header = self.rcp.vl[RADAR_HEADER_MSG] + fault = header['FLRRSnsrBlckd'] or header['FLRRSnstvFltPrsntInt'] or \ + header['FLRRYawRtPlsblityFlt'] or header['FLRRHWFltPrsntInt'] or \ + header['FLRRAntTngFltPrsnt'] or header['FLRRAlgnFltPrsnt'] + errors = [] + if not self.rcp.can_valid: + errors.append("canError") + if fault: + errors.append("fault") + ret.errors = errors + + currentTargets = set() + num_targets = header['FLRRNumValidTargets'] + + # Not all radar messages describe targets, + # no need to monitor all of the self.rcp.msgs_upd + for ii in self.updated_messages: + if ii == RADAR_HEADER_MSG: + continue + + if num_targets == 0: + break + + cpt = self.rcp.vl[ii] + # Zero distance means it's an empty target slot + if cpt['TrkRange'] > 0.0: + targetId = cpt['TrkObjectID'] + currentTargets.add(targetId) + if targetId not in self.pts: + self.pts[targetId] = car.RadarData.RadarPoint.new_message() + self.pts[targetId].trackId = targetId + distance = cpt['TrkRange'] + self.pts[targetId].dRel = distance # from front of car + # From driver's pov, left is positive + self.pts[targetId].yRel = math.sin(cpt['TrkAzimuth'] * CV.DEG_TO_RAD) * distance + self.pts[targetId].vRel = cpt['TrkRangeRate'] + self.pts[targetId].aRel = float('nan') + self.pts[targetId].yvRel = float('nan') + + for oldTarget in list(self.pts.keys()): + if oldTarget not in currentTargets: + del self.pts[oldTarget] + + ret.points = list(self.pts.values()) + self.updated_messages.clear() + return ret diff --git a/selfdrive/car/gm/values.py b/selfdrive/car/gm/values.py new file mode 100644 index 000000000..8e0907671 --- /dev/null +++ b/selfdrive/car/gm/values.py @@ -0,0 +1,123 @@ +from cereal import car +from selfdrive.car import dbc_dict +Ecu = car.CarParams.Ecu + +class CarControllerParams(): + STEER_MAX = 300 # Safety limit, not LKA max. Trucks use 600. + STEER_STEP = 2 # control frames per command + STEER_DELTA_UP = 7 + STEER_DELTA_DOWN = 17 + MIN_STEER_SPEED = 3. # m/s + STEER_DRIVER_ALLOWANCE = 50 + STEER_DRIVER_MULTIPLIER = 4 + STEER_DRIVER_FACTOR = 100 + NEAR_STOP_BRAKE_PHASE = 0.5 # m/s + + # Heartbeat for dash "Service Adaptive Cruise" and "Service Front Camera" + ADAS_KEEPALIVE_STEP = 100 + CAMERA_KEEPALIVE_STEP = 100 + + # Volt gasbrake lookups + MAX_GAS = 3072 # Safety limit, not ACC max. Stock ACC >4096 from standstill. + ZERO_GAS = 2048 # Coasting + MAX_BRAKE = 350 # ~ -3.5 m/s^2 with regen + + # Allow small margin below -3.5 m/s^2 from ISO 15622:2018 since we + # perform the closed loop control, and might need some + # to apply some more braking if we're on a downhill slope. + # Our controller should still keep the 2 second average above + # -3.5 m/s^2 as per planner limits + ACCEL_MAX = 2. # m/s^2 + ACCEL_MIN = -4. # m/s^2 + + MAX_ACC_REGEN = 1404 # Max ACC regen is slightly less than max paddle regen + GAS_LOOKUP_BP = [-1., 0., ACCEL_MAX] + GAS_LOOKUP_V = [MAX_ACC_REGEN, ZERO_GAS, MAX_GAS] + BRAKE_LOOKUP_BP = [ACCEL_MIN, -1.] + BRAKE_LOOKUP_V = [MAX_BRAKE, 0.] + +STEER_THRESHOLD = 1.0 + +class CAR: + HOLDEN_ASTRA = "HOLDEN ASTRA RS-V BK 2017" + VOLT = "CHEVROLET VOLT PREMIER 2017" + CADILLAC_ATS = "CADILLAC ATS Premium Performance 2018" + MALIBU = "CHEVROLET MALIBU PREMIER 2017" + ACADIA = "GMC ACADIA DENALI 2018" + BUICK_REGAL = "BUICK REGAL ESSENCE 2018" + ESCALADE_ESV = "CADILLAC ESCALADE ESV 2016" + +class CruiseButtons: + INIT = 0 + UNPRESS = 1 + RES_ACCEL = 2 + DECEL_SET = 3 + MAIN = 5 + CANCEL = 6 + +class AccState: + OFF = 0 + ACTIVE = 1 + FAULTED = 3 + STANDSTILL = 4 + +class CanBus: + POWERTRAIN = 0 + OBSTACLE = 1 + CHASSIS = 2 + SW_GMLAN = 3 + LOOPBACK = 128 + +FINGERPRINTS = { + # Astra BK MY17, ASCM unplugged + CAR.HOLDEN_ASTRA: [{ + 190: 8, 193: 8, 197: 8, 199: 4, 201: 8, 209: 7, 211: 8, 241: 6, 249: 8, 288: 5, 298: 8, 304: 1, 309: 8, 311: 8, 313: 8, 320: 3, 328: 1, 352: 5, 381: 6, 384: 4, 386: 8, 388: 8, 393: 8, 398: 8, 401: 8, 413: 8, 417: 8, 419: 8, 422: 1, 426: 7, 431: 8, 442: 8, 451: 8, 452: 8, 453: 8, 455: 7, 456: 8, 458: 5, 479: 8, 481: 7, 485: 8, 489: 8, 497: 8, 499: 3, 500: 8, 501: 8, 508: 8, 528: 5, 532: 6, 554: 3, 560: 8, 562: 8, 563: 5, 564: 5, 565: 5, 567: 5, 647: 5, 707: 8, 715: 8, 723: 8, 753: 5, 761: 7, 806: 1, 810: 8, 840: 5, 842: 5, 844: 8, 866: 4, 961: 8, 969: 8, 977: 8, 979: 8, 985: 5, 1001: 8, 1009: 8, 1011: 6, 1017: 8, 1019: 3, 1020: 8, 1105: 6, 1217: 8, 1221: 5, 1225: 8, 1233: 8, 1249: 8, 1257: 6, 1259: 8, 1261: 7, 1263: 4, 1265: 8, 1267: 8, 1280: 4, 1300: 8, 1328: 4, 1417: 8, 1906: 7, 1907: 7, 1908: 7, 1912: 7, 1919: 7, + }], + CAR.VOLT: [ + # Volt Premier w/ ACC 2017 + { + 170: 8, 171: 8, 189: 7, 190: 6, 193: 8, 197: 8, 199: 4, 201: 8, 209: 7, 211: 2, 241: 6, 288: 5, 289: 8, 298: 8, 304: 1, 308: 4, 309: 8, 311: 8, 313: 8, 320: 3, 328: 1, 352: 5, 381: 6, 384: 4, 386: 8, 388: 8, 389: 2, 390: 7, 417: 7, 419: 1, 426: 7, 451: 8, 452: 8, 453: 6, 454: 8, 456: 8, 479: 3, 481: 7, 485: 8, 489: 8, 493: 8, 495: 4, 497: 8, 499: 3, 500: 6, 501: 8, 508: 8, 528: 4, 532: 6, 546: 7, 550: 8, 554: 3, 558: 8, 560: 8, 562: 8, 563: 5, 564: 5, 565: 5, 566: 5, 567: 3, 568: 1, 573: 1, 577: 8, 647: 3, 707: 8, 711: 6, 715: 8, 761: 7, 810: 8, 840: 5, 842: 5, 844: 8, 866: 4, 961: 8, 969: 8, 977: 8, 979: 7, 988: 6, 989: 8, 995: 7, 1001: 8, 1005: 6, 1009: 8, 1017: 8, 1019: 2, 1020: 8, 1105: 6, 1187: 4, 1217: 8, 1221: 5, 1223: 3, 1225: 7, 1227: 4, 1233: 8, 1249: 8, 1257: 6, 1265: 8, 1267: 1, 1273: 3, 1275: 3, 1280: 4, 1300: 8, 1322: 6, 1323: 4, 1328: 4, 1417: 8, 1601: 8, 1905: 7, 1906: 7, 1907: 7, 1910: 7, 1912: 7, 1922: 7, 1927: 7, 1928: 7, 2016: 8, 2020: 8, 2024: 8, 2028: 8 + }, + # Volt Premier w/ ACC 2018 + { + 170: 8, 171: 8, 189: 7, 190: 6, 193: 8, 197: 8, 199: 4, 201: 8, 209: 7, 211: 2, 241: 6, 288: 5, 298: 8, 304: 1, 308: 4, 309: 8, 311: 8, 313: 8, 320: 3, 328: 1, 352: 5, 381: 6, 384: 4, 386: 8, 388: 8, 389: 2, 390: 7, 417: 7, 419: 1, 426: 7, 451: 8, 452: 8, 453: 6, 454: 8, 456: 8, 479: 3, 481: 7, 485: 8, 489: 8, 493: 8, 495: 4, 497: 8, 499: 3, 500: 6, 501: 8, 508: 8, 528: 4, 532: 6, 546: 7, 550: 8, 554: 3, 558: 8, 560: 8, 562: 8, 563: 5, 564: 5, 565: 5, 566: 5, 567: 3, 568: 1, 573: 1, 577: 8, 578: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 647: 3, 707: 8, 711: 6, 715: 8, 717: 5, 761: 7, 810: 8, 840: 5, 842: 5, 844: 8, 866: 4, 869: 4, 880: 6, 961: 8, 967: 4, 969: 8, 977: 8, 979: 7, 988: 6, 989: 8, 995: 7, 1001: 8, 1005: 6, 1009: 8, 1017: 8, 1019: 2, 1020: 8, 1033: 7, 1034: 7, 1105: 6, 1187: 4, 1217: 8, 1221: 5, 1223: 3, 1225: 7, 1227: 4, 1233: 8, 1249: 8, 1257: 6, 1265: 8, 1267: 1, 1273: 3, 1275: 3, 1280: 4, 1296: 4, 1300: 8, 1322: 6, 1323: 4, 1328: 4, 1417: 8, 1516: 8, 1601: 8, 1618: 8, 1905: 7, 1906: 7, 1907: 7, 1910: 7, 1912: 7, 1922: 7, 1927: 7, 1930: 7, 2016: 8, 2018: 8, 2020: 8, 2024: 8, 2028: 8 + }], + CAR.BUICK_REGAL : [ + # Regal TourX Essence w/ ACC 2018 + { + 190: 8, 193: 8, 197: 8, 199: 4, 201: 8, 209: 7, 211: 8, 241: 6, 249: 8, 288: 5, 298: 8, 304: 1, 309: 8, 311: 8, 313: 8, 320: 3, 322: 7, 328: 1, 352: 5, 381: 6, 384: 4, 386: 8, 388: 8, 393: 7, 398: 8, 407: 7, 413: 8, 417: 8, 419: 8, 422: 4, 426: 8, 431: 8, 442: 8, 451: 8, 452: 8, 453: 8, 455: 7, 456: 8, 463: 3, 479: 8, 481: 7, 485: 8, 487: 8, 489: 8, 495: 8, 497: 8, 499: 3, 500: 8, 501: 8, 508: 8, 528: 5, 532: 6, 554: 3, 560: 8, 562: 8, 563: 5, 564: 5, 565: 5, 567: 5, 569: 3, 573: 1, 577: 8, 578: 8, 579: 8, 587: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 647: 3, 707: 8, 715: 8, 717: 5, 753: 5, 761: 7, 810: 8, 840: 5, 842: 5, 844: 8, 866: 4, 869: 4, 880: 6, 882: 8, 884: 8, 890: 1, 892: 2, 893: 2, 894: 1, 961: 8, 967: 8, 969: 8, 977: 8, 979: 8, 985: 8, 1001: 8, 1005: 6, 1009: 8, 1011: 8, 1013: 3, 1017: 8, 1020: 8, 1024: 8, 1025: 8, 1026: 8, 1027: 8, 1028: 8, 1029: 8, 1030: 8, 1031: 8, 1032: 2, 1033: 7, 1034: 7, 1105: 6, 1217: 8, 1221: 5, 1223: 8, 1225: 7, 1233: 8, 1249: 8, 1257: 6, 1259: 8, 1261: 8, 1263: 8, 1265: 8, 1267: 8, 1271: 8, 1280: 4, 1296: 4, 1300: 8, 1322: 6, 1328: 4, 1417: 8, 1601: 8, 1602: 8, 1603: 7, 1611: 8, 1618: 8, 1906: 8, 1907: 7, 1912: 7, 1914: 7, 1916: 7, 1919: 7, 1930: 7, 2016: 8, 2018: 8, 2019: 8, 2024: 8, 2026: 8 + }], + CAR.CADILLAC_ATS: [ + # Cadillac ATS Coupe Premium Performance 3.6L RWD w/ ACC 2018 + { + 190: 6, 193: 8, 197: 8, 199: 4, 201: 8, 209: 7, 211: 2, 241: 6, 249: 8, 288: 5, 298: 8, 304: 1, 309: 8, 311: 8, 313: 8, 320: 3, 322: 7, 328: 1, 352: 5, 368: 3, 381: 6, 384: 4, 386: 8, 388: 8, 393: 7, 398: 8, 401: 8, 407: 7, 413: 8, 417: 7, 419: 1, 422: 4, 426: 7, 431: 8, 442: 8, 451: 8, 452: 8, 453: 6, 455: 7, 456: 8, 462: 4, 479: 3, 481: 7, 485: 8, 487: 8, 489: 8, 491: 2, 493: 8, 497: 8, 499: 3, 500: 6, 501: 8, 508: 8, 510: 8, 528: 5, 532: 6, 534: 2, 554: 3, 560: 8, 562: 8, 563: 5, 564: 5, 565: 5, 567: 5, 573: 1, 577: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 647: 6, 707: 8, 715: 8, 717: 5, 719: 5, 723: 2, 753: 5, 761: 7, 801: 8, 804: 3, 810: 8, 840: 5, 842: 5, 844: 8, 866: 4, 869: 4, 880: 6, 882: 8, 890: 1, 892: 2, 893: 2, 894: 1, 961: 8, 967: 4, 969: 8, 977: 8, 979: 8, 985: 5, 1001: 8, 1005: 6, 1009: 8, 1011: 6, 1013: 3, 1017: 8, 1019: 2, 1020: 8, 1033: 7, 1034: 7, 1105: 6, 1217: 8, 1221: 5, 1223: 3, 1225: 7, 1233: 8, 1241: 3, 1249: 8, 1257: 6, 1259: 8, 1261: 7, 1263: 4, 1265: 8, 1267: 1, 1271: 8, 1280: 4, 1296: 4, 1300: 8, 1322: 6, 1323: 4, 1328: 4, 1417: 8, 1601: 8, 1904: 7, 1906: 7, 1907: 7, 1912: 7, 1916: 7, 1917: 7, 1918: 7, 1919: 7, 1920: 7, 1930: 7, 2016: 8, 2024: 8 + }], + CAR.MALIBU: [ + # Malibu Premier w/ ACC 2017 + { + 190: 6, 193: 8, 197: 8, 199: 4, 201: 8, 209: 7, 211: 2, 241: 6, 249: 8, 288: 5, 298: 8, 304: 1, 309: 8, 311: 8, 313: 8, 320: 3, 328: 1, 352: 5, 381: 6, 384: 4, 386: 8, 388: 8, 393: 7, 398: 8, 407: 7, 413: 8, 417: 7, 419: 1, 422: 4, 426: 7, 431: 8, 442: 8, 451: 8, 452: 8, 453: 6, 455: 7, 456: 8, 479: 3, 481: 7, 485: 8, 487: 8, 489: 8, 495: 4, 497: 8, 499: 3, 500: 6, 501: 8, 508: 8, 510: 8, 528: 5, 532: 6, 554: 3, 560: 8, 562: 8, 563: 5, 564: 5, 565: 5, 567: 5, 573: 1, 577: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 647: 6, 707: 8, 715: 8, 717: 5, 753: 5, 761: 7, 810: 8, 840: 5, 842: 5, 844: 8, 866: 4, 869: 4, 880: 6, 961: 8, 969: 8, 977: 8, 979: 8, 985: 5, 1001: 8, 1005: 6, 1009: 8, 1013: 3, 1017: 8, 1019: 2, 1020: 8, 1033: 7, 1034: 7, 1105: 6, 1217: 8, 1221: 5, 1223: 2, 1225: 7, 1233: 8, 1249: 8, 1257: 6, 1265: 8, 1267: 1, 1280: 4, 1296: 4, 1300: 8, 1322: 6, 1323: 4, 1328: 4, 1417: 8, 1601: 8, 1906: 7, 1907: 7, 1912: 7, 1919: 7, 1930: 7, 2016: 8, 2024: 8, + }], + CAR.ACADIA: [ + # Acadia Denali w/ACC 2018 + { + 190: 6, 192: 5, 193: 8, 197: 8, 199: 4, 201: 6, 208: 8, 209: 7, 211: 2, 241: 6, 249: 8, 288: 5, 289: 1, 290: 1, 298: 8, 304: 8, 309: 8, 313: 8, 320: 8, 322: 7, 328: 1, 352: 7, 368: 8, 381: 8, 384: 8, 386: 8, 388: 8, 393: 8, 398: 8, 413: 8, 417: 7, 419: 1, 422: 4, 426: 7, 431: 8, 442: 8, 451: 8, 452: 8, 453: 6, 454: 8, 455: 7, 458: 8, 460: 4, 462: 4, 463: 3, 479: 3, 481: 7, 485: 8, 489: 5, 497: 8, 499: 3, 500: 6, 501: 8, 508: 8, 510: 8, 512: 3, 530: 8, 532: 6, 534: 2, 554: 3, 560: 8, 562: 8, 563: 5, 564: 5, 567: 5, 568: 2, 573: 1, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 647: 6, 707: 8, 715: 8, 717: 5, 753: 5, 761: 7, 789: 5, 800: 6, 801: 8, 803: 8, 804: 3, 805: 8, 832: 8, 840: 5, 842: 5, 844: 8, 866: 4, 869: 4, 880: 6, 961: 8, 969: 8, 977: 8, 979: 8, 985: 5, 1001: 8, 1003: 5, 1005: 6, 1009: 8, 1017: 8, 1020: 8, 1033: 7, 1034: 7, 1105: 6, 1217: 8, 1221: 5, 1225: 8, 1233: 8, 1249: 8, 1257: 6, 1265: 8, 1267: 1, 1280: 4, 1296: 4, 1300: 8, 1322: 6, 1328: 4, 1417: 8, 1906: 7, 1907: 7, 1912: 7, 1914: 7, 1918: 7, 1919: 7, 1920: 7, 1930: 7 + }, + # Acadia Denali w/ /ACC 2018 + { + 190: 6, 193: 8, 197: 8, 199: 4, 201: 8, 208: 8, 209: 7, 211: 2, 241: 6, 249: 8, 288: 5, 289: 8, 298: 8, 304: 1, 309: 8, 313: 8, 320: 3, 322: 7, 328: 1, 338: 6, 340: 6, 352: 5, 381: 8, 384: 4, 386: 8, 388: 8, 393: 8, 398: 8, 413: 8, 417: 7, 419: 1, 422: 4, 426: 7, 431: 8, 442: 8, 451: 8, 452: 8, 453: 6, 454: 8, 455: 7, 462: 4, 463: 3, 479: 3, 481: 7, 485: 8, 489: 8, 497: 8, 499: 3, 500: 6, 501: 8, 508: 8, 510: 8, 532: 6, 554: 3, 560: 8, 562: 8, 563: 5, 564: 5, 567: 5, 573: 1, 577: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 647: 6, 707: 8, 715: 8, 717: 5, 753: 5, 761: 7, 840: 5, 842: 5, 844: 8, 866: 4, 869: 4, 880: 6, 961: 8, 969: 8, 977: 8, 979: 8, 985: 5, 1001: 8, 1005: 6, 1009: 8, 1017: 8, 1020: 8, 1033: 7, 1034: 7, 1105: 6, 1217: 8, 1221: 5, 1225: 8, 1233: 8, 1249: 8, 1257: 6, 1265: 8, 1267: 1, 1280: 4, 1296: 4, 1300: 8, 1322: 6, 1328: 4, 1417: 8, 1601: 8, 1906: 7, 1907: 7, 1912: 7, 1914: 7, 1919: 7, 1920: 7, 1930: 7, 2016: 8, 2024: 8 + }], + CAR.ESCALADE_ESV: [ + { + 309: 1, 848: 8, 849: 8, 850: 8, 851: 8, 852: 8, 853: 8, 854: 3, 1056: 6, 1057: 8, 1058: 8, 1059: 8, 1060: 8, 1061: 8, 1062: 8, 1063: 8, 1064: 8, 1065: 8, 1066: 8, 1067: 8, 1068: 8, 1120: 8, 1121: 8, 1122: 8, 1123: 8, 1124: 8, 1125: 8, 1126: 8, 1127: 8, 1128: 8, 1129: 8, 1130: 8, 1131: 8, 1132: 8, 1133: 8, 1134: 8, 1135: 8, 1136: 8, 1137: 8, 1138: 8, 1139: 8, 1140: 8, 1141: 8, 1142: 8, 1143: 8, 1146: 8, 1147: 8, 1148: 8, 1149: 8, 1150: 8, 1151: 8, 1216: 8, 1217: 8, 1218: 8, 1219: 8, 1220: 8, 1221: 8, 1222: 8, 1223: 8, 1224: 8, 1225: 8, 1226: 8, 1232: 8, 1233: 8, 1234: 8, 1235: 8, 1236: 8, 1237: 8, 1238: 8, 1239: 8, 1240: 8, 1241: 8, 1242: 8, 1787: 8, 1788: 8 + }], +} + +DBC = { + CAR.HOLDEN_ASTRA: dbc_dict('gm_global_a_powertrain_generated', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'), + CAR.VOLT: dbc_dict('gm_global_a_powertrain_generated', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'), + CAR.MALIBU: dbc_dict('gm_global_a_powertrain_generated', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'), + CAR.ACADIA: dbc_dict('gm_global_a_powertrain_generated', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'), + CAR.CADILLAC_ATS: dbc_dict('gm_global_a_powertrain_generated', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'), + CAR.BUICK_REGAL: dbc_dict('gm_global_a_powertrain_generated', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'), + CAR.ESCALADE_ESV: dbc_dict('gm_global_a_powertrain_generated', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'), +} diff --git a/selfdrive/car/honda/__init__.py b/selfdrive/car/honda/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py new file mode 100644 index 000000000..49581799a --- /dev/null +++ b/selfdrive/car/honda/carcontroller.py @@ -0,0 +1,264 @@ +from collections import namedtuple +from cereal import car +from common.realtime import DT_CTRL +from selfdrive.controls.lib.drive_helpers import rate_limit +from common.numpy_fast import clip, interp +from selfdrive.car import create_gas_interceptor_command +from selfdrive.car.honda import hondacan +from selfdrive.car.honda.values import CruiseButtons, VISUAL_HUD, HONDA_BOSCH, HONDA_NIDEC_ALT_PCM_ACCEL, CarControllerParams +from opendbc.can.packer import CANPacker + +VisualAlert = car.CarControl.HUDControl.VisualAlert +LongCtrlState = car.CarControl.Actuators.LongControlState + +def compute_gb_honda_bosch(accel, speed): + #TODO returns 0s, is unused + return 0.0, 0.0 + + +def compute_gb_honda_nidec(accel, speed): + creep_brake = 0.0 + creep_speed = 2.3 + creep_brake_value = 0.15 + if speed < creep_speed: + creep_brake = (creep_speed - speed) / creep_speed * creep_brake_value + gb = float(accel) / 4.8 - creep_brake + return clip(gb, 0.0, 1.0), clip(-gb, 0.0, 1.0) + + +def compute_gas_brake(accel, speed, fingerprint): + if fingerprint in HONDA_BOSCH: + return compute_gb_honda_bosch(accel, speed) + else: + return compute_gb_honda_nidec(accel, speed) + + +#TODO not clear this does anything useful +def actuator_hystereses(brake, braking, brake_steady, v_ego, car_fingerprint): + # hyst params + brake_hyst_on = 0.02 # to activate brakes exceed this value + brake_hyst_off = 0.005 # to deactivate brakes below this value + brake_hyst_gap = 0.01 # don't change brake command for small oscillations within this value + + #*** hysteresis logic to avoid brake blinking. go above 0.1 to trigger + if (brake < brake_hyst_on and not braking) or brake < brake_hyst_off: + brake = 0. + braking = brake > 0. + + # for small brake oscillations within brake_hyst_gap, don't change the brake command + if brake == 0.: + brake_steady = 0. + elif brake > brake_steady + brake_hyst_gap: + brake_steady = brake - brake_hyst_gap + elif brake < brake_steady - brake_hyst_gap: + brake_steady = brake + brake_hyst_gap + brake = brake_steady + + return brake, braking, brake_steady + + +def brake_pump_hysteresis(apply_brake, apply_brake_last, last_pump_ts, ts): + pump_on = False + + # reset pump timer if: + # - there is an increment in brake request + # - we are applying steady state brakes and we haven't been running the pump + # for more than 20s (to prevent pressure bleeding) + if apply_brake > apply_brake_last or (ts - last_pump_ts > 20. and apply_brake > 0): + last_pump_ts = ts + + # once the pump is on, run it for at least 0.2s + if ts - last_pump_ts < 0.2 and apply_brake > 0: + pump_on = True + + return pump_on, last_pump_ts + + +def process_hud_alert(hud_alert): + # initialize to no alert + fcw_display = 0 + steer_required = 0 + acc_alert = 0 + + # priority is: FCW, steer required, all others + if hud_alert == VisualAlert.fcw: + fcw_display = VISUAL_HUD[hud_alert.raw] + elif hud_alert in (VisualAlert.steerRequired, VisualAlert.ldw): + steer_required = VISUAL_HUD[hud_alert.raw] + else: + acc_alert = VISUAL_HUD[hud_alert.raw] + + return fcw_display, steer_required, acc_alert + + +HUDData = namedtuple("HUDData", + ["pcm_accel", "v_cruise", "car", + "lanes", "fcw", "acc_alert", "steer_required"]) + + +class CarController(): + def __init__(self, dbc_name, CP, VM): + self.braking = False + self.brake_steady = 0. + self.brake_last = 0. + self.apply_brake_last = 0 + self.last_pump_ts = 0. + self.packer = CANPacker(dbc_name) + + self.accel = 0 + self.speed = 0 + self.gas = 0 + self.brake = 0 + + self.params = CarControllerParams(CP) + + def update(self, enabled, active, CS, frame, actuators, pcm_cancel_cmd, + hud_v_cruise, hud_show_lanes, hud_show_car, hud_alert): + + P = self.params + + if active: + accel = actuators.accel + gas, brake = compute_gas_brake(actuators.accel, CS.out.vEgo, CS.CP.carFingerprint) + else: + accel = 0.0 + gas, brake = 0.0, 0.0 + + # *** apply brake hysteresis *** + pre_limit_brake, self.braking, self.brake_steady = actuator_hystereses(brake, self.braking, self.brake_steady, CS.out.vEgo, CS.CP.carFingerprint) + + # *** rate limit after the enable check *** + self.brake_last = rate_limit(pre_limit_brake, self.brake_last, -2., DT_CTRL) + + # vehicle hud display, wait for one update from 10Hz 0x304 msg + if hud_show_lanes: + hud_lanes = 1 + else: + hud_lanes = 0 + + if enabled: + if hud_show_car: + hud_car = 2 + else: + hud_car = 1 + else: + hud_car = 0 + + fcw_display, steer_required, acc_alert = process_hud_alert(hud_alert) + + + # **** process the car messages **** + + # steer torque is converted back to CAN reference (positive when steering right) + apply_steer = int(interp(-actuators.steer * P.STEER_MAX, P.STEER_LOOKUP_BP, P.STEER_LOOKUP_V)) + + lkas_active = active and not CS.steer_not_allowed + + # Send CAN commands. + can_sends = [] + + # tester present - w/ no response (keeps radar disabled) + if CS.CP.carFingerprint in HONDA_BOSCH and CS.CP.openpilotLongitudinalControl: + if (frame % 10) == 0: + can_sends.append((0x18DAB0F1, 0, b"\x02\x3E\x80\x00\x00\x00\x00\x00", 1)) + + # Send steering command. + idx = frame % 4 + can_sends.append(hondacan.create_steering_control(self.packer, apply_steer, + lkas_active, CS.CP.carFingerprint, idx, CS.CP.openpilotLongitudinalControl)) + + stopping = actuators.longControlState == LongCtrlState.stopping + + # wind brake from air resistance decel at high speed + wind_brake = interp(CS.out.vEgo, [0.0, 2.3, 35.0], [0.001, 0.002, 0.15]) + # all of this is only relevant for HONDA NIDEC + max_accel = interp(CS.out.vEgo, P.NIDEC_MAX_ACCEL_BP, P.NIDEC_MAX_ACCEL_V) + # TODO this 1.44 is just to maintain previous behavior + pcm_speed_BP = [-wind_brake, + -wind_brake*(3/4), + 0.0, + 0.5] + # The Honda ODYSSEY seems to have different PCM_ACCEL + # msgs, is it other cars too? + if CS.CP.enableGasInterceptor: + pcm_speed = 0.0 + pcm_accel = int(0.0) + elif CS.CP.carFingerprint in HONDA_NIDEC_ALT_PCM_ACCEL: + pcm_speed_V = [0.0, + clip(CS.out.vEgo - 3.0, 0.0, 100.0), + clip(CS.out.vEgo + 0.0, 0.0, 100.0), + clip(CS.out.vEgo + 5.0, 0.0, 100.0)] + pcm_speed = interp(gas-brake, pcm_speed_BP, pcm_speed_V) + pcm_accel = int((1.0) * 0xc6) + else: + pcm_speed_V = [0.0, + clip(CS.out.vEgo - 2.0, 0.0, 100.0), + clip(CS.out.vEgo + 2.0, 0.0, 100.0), + clip(CS.out.vEgo + 5.0, 0.0, 100.0)] + pcm_speed = interp(gas-brake, pcm_speed_BP, pcm_speed_V) + pcm_accel = int(clip((accel/1.44)/max_accel, 0.0, 1.0) * 0xc6) + + if not CS.CP.openpilotLongitudinalControl: + if (frame % 2) == 0: + idx = frame // 2 + can_sends.append(hondacan.create_bosch_supplemental_1(self.packer, CS.CP.carFingerprint, idx)) + # If using stock ACC, spam cancel command to kill gas when OP disengages. + if pcm_cancel_cmd: + can_sends.append(hondacan.spam_buttons_command(self.packer, CruiseButtons.CANCEL, idx, CS.CP.carFingerprint)) + elif CS.out.cruiseState.standstill: + can_sends.append(hondacan.spam_buttons_command(self.packer, CruiseButtons.RES_ACCEL, idx, CS.CP.carFingerprint)) + + else: + # Send gas and brake commands. + if (frame % 2) == 0: + idx = frame // 2 + ts = frame * DT_CTRL + + if CS.CP.carFingerprint in HONDA_BOSCH: + self.accel = clip(accel, P.BOSCH_ACCEL_MIN, P.BOSCH_ACCEL_MAX) + self.gas = interp(accel, P.BOSCH_GAS_LOOKUP_BP, P.BOSCH_GAS_LOOKUP_V) + can_sends.extend(hondacan.create_acc_commands(self.packer, enabled, active, accel, self.gas, idx, stopping, CS.CP.carFingerprint)) + else: + apply_brake = clip(self.brake_last - wind_brake, 0.0, 1.0) + apply_brake = int(clip(apply_brake * P.NIDEC_BRAKE_MAX, 0, P.NIDEC_BRAKE_MAX - 1)) + pump_on, self.last_pump_ts = brake_pump_hysteresis(apply_brake, self.apply_brake_last, self.last_pump_ts, ts) + + pcm_override = True + can_sends.append(hondacan.create_brake_command(self.packer, apply_brake, pump_on, + pcm_override, pcm_cancel_cmd, fcw_display, idx, CS.CP.carFingerprint, CS.stock_brake)) + self.apply_brake_last = apply_brake + self.brake = apply_brake / P.NIDEC_BRAKE_MAX + + if CS.CP.enableGasInterceptor: + # way too aggressive at low speed without this + gas_mult = interp(CS.out.vEgo, [0., 10.], [0.4, 1.0]) + # send exactly zero if apply_gas is zero. Interceptor will send the max between read value and apply_gas. + # This prevents unexpected pedal range rescaling + # Sending non-zero gas when OP is not enabled will cause the PCM not to respond to throttle as expected + # when you do enable. + if active: + self.gas = clip(gas_mult * (gas - brake + wind_brake*3/4), 0., 1.) + else: + self.gas = 0.0 + can_sends.append(create_gas_interceptor_command(self.packer, self.gas, idx)) + + # Send dashboard UI commands. + if (frame % 10) == 0: + idx = (frame//10) % 4 + hud = HUDData(int(pcm_accel), int(round(hud_v_cruise)), hud_car, + hud_lanes, fcw_display, acc_alert, steer_required) + can_sends.extend(hondacan.create_ui_commands(self.packer, CS.CP, pcm_speed, hud, CS.is_metric, idx, CS.stock_hud)) + + if (CS.CP.openpilotLongitudinalControl) and (CS.CP.carFingerprint not in HONDA_BOSCH): + self.speed = pcm_speed + + if not CS.CP.enableGasInterceptor: + self.gas = pcm_accel / 0xc6 + + new_actuators = actuators.copy() + new_actuators.speed = self.speed + new_actuators.accel = self.accel + new_actuators.gas = self.gas + new_actuators.brake = self.brake + + return new_actuators, can_sends diff --git a/selfdrive/car/honda/carstate.py b/selfdrive/car/honda/carstate.py new file mode 100644 index 000000000..0a56a02b9 --- /dev/null +++ b/selfdrive/car/honda/carstate.py @@ -0,0 +1,356 @@ +from cereal import car +from collections import defaultdict +from common.numpy_fast import interp +from opendbc.can.can_define import CANDefine +from opendbc.can.parser import CANParser +from selfdrive.config import Conversions as CV +from selfdrive.car.interfaces import CarStateBase +from selfdrive.car.honda.values import CAR, DBC, STEER_THRESHOLD, HONDA_BOSCH, HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_ALT_BRAKE_SIGNAL + +TransmissionType = car.CarParams.TransmissionType + + +def get_can_signals(CP, gearbox_msg, main_on_sig_msg): + signals = [ + ("XMISSION_SPEED", "ENGINE_DATA"), + ("WHEEL_SPEED_FL", "WHEEL_SPEEDS"), + ("WHEEL_SPEED_FR", "WHEEL_SPEEDS"), + ("WHEEL_SPEED_RL", "WHEEL_SPEEDS"), + ("WHEEL_SPEED_RR", "WHEEL_SPEEDS"), + ("STEER_ANGLE", "STEERING_SENSORS"), + ("STEER_ANGLE_RATE", "STEERING_SENSORS"), + ("MOTOR_TORQUE", "STEER_MOTOR_TORQUE"), + ("STEER_TORQUE_SENSOR", "STEER_STATUS"), + ("LEFT_BLINKER", "SCM_FEEDBACK"), + ("RIGHT_BLINKER", "SCM_FEEDBACK"), + ("GEAR", gearbox_msg), + ("SEATBELT_DRIVER_LAMP", "SEATBELT_STATUS"), + ("SEATBELT_DRIVER_LATCHED", "SEATBELT_STATUS"), + ("BRAKE_PRESSED", "POWERTRAIN_DATA"), + ("BRAKE_SWITCH", "POWERTRAIN_DATA"), + ("CRUISE_BUTTONS", "SCM_BUTTONS"), + ("ESP_DISABLED", "VSA_STATUS"), + ("USER_BRAKE", "VSA_STATUS"), + ("BRAKE_HOLD_ACTIVE", "VSA_STATUS"), + ("STEER_STATUS", "STEER_STATUS"), + ("GEAR_SHIFTER", gearbox_msg), + ("PEDAL_GAS", "POWERTRAIN_DATA"), + ("CRUISE_SETTING", "SCM_BUTTONS"), + ("ACC_STATUS", "POWERTRAIN_DATA"), + ("MAIN_ON", main_on_sig_msg), + ] + + checks = [ + ("ENGINE_DATA", 100), + ("WHEEL_SPEEDS", 50), + ("STEERING_SENSORS", 100), + ("SEATBELT_STATUS", 10), + ("CRUISE", 10), + ("POWERTRAIN_DATA", 100), + ("VSA_STATUS", 50), + ("STEER_STATUS", 100), + ("STEER_MOTOR_TORQUE", 0), # TODO: not on every car + ] + + if CP.carFingerprint == CAR.ODYSSEY_CHN: + checks += [ + ("SCM_FEEDBACK", 25), + ("SCM_BUTTONS", 50), + ] + else: + checks += [ + ("SCM_FEEDBACK", 10), + ("SCM_BUTTONS", 25), + ] + + if CP.carFingerprint in (CAR.CRV_HYBRID, CAR.CIVIC_BOSCH_DIESEL, CAR.ACURA_RDX_3G, CAR.HONDA_E): + checks.append((gearbox_msg, 50)) + else: + checks.append((gearbox_msg, 100)) + + if CP.carFingerprint in HONDA_BOSCH_ALT_BRAKE_SIGNAL: + signals.append(("BRAKE_PRESSED", "BRAKE_MODULE")) + checks.append(("BRAKE_MODULE", 50)) + + if CP.carFingerprint in HONDA_BOSCH: + signals += [ + ("EPB_STATE", "EPB_STATUS"), + ("IMPERIAL_UNIT", "CAR_SPEED"), + ] + checks += [ + ("EPB_STATUS", 50), + ("CAR_SPEED", 10), + ] + + if not CP.openpilotLongitudinalControl: + signals += [ + ("CRUISE_CONTROL_LABEL", "ACC_HUD"), + ("CRUISE_SPEED", "ACC_HUD"), + ("ACCEL_COMMAND", "ACC_CONTROL"), + ("AEB_STATUS", "ACC_CONTROL"), + ] + checks += [ + ("ACC_HUD", 10), + ("ACC_CONTROL", 50), + ] + else: # Nidec signals + signals += [("CRUISE_SPEED_PCM", "CRUISE"), + ("CRUISE_SPEED_OFFSET", "CRUISE_PARAMS")] + + if CP.carFingerprint == CAR.ODYSSEY_CHN: + checks.append(("CRUISE_PARAMS", 10)) + else: + checks.append(("CRUISE_PARAMS", 50)) + + if CP.carFingerprint in (CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E): + signals.append(("DRIVERS_DOOR_OPEN", "SCM_FEEDBACK")) + elif CP.carFingerprint == CAR.ODYSSEY_CHN: + signals.append(("DRIVERS_DOOR_OPEN", "SCM_BUTTONS")) + elif CP.carFingerprint in (CAR.FREED, CAR.HRV): + signals += [("DRIVERS_DOOR_OPEN", "SCM_BUTTONS"), + ("WHEELS_MOVING", "STANDSTILL")] + else: + signals += [("DOOR_OPEN_FL", "DOORS_STATUS"), + ("DOOR_OPEN_FR", "DOORS_STATUS"), + ("DOOR_OPEN_RL", "DOORS_STATUS"), + ("DOOR_OPEN_RR", "DOORS_STATUS"), + ("WHEELS_MOVING", "STANDSTILL")] + checks += [ + ("DOORS_STATUS", 3), + ("STANDSTILL", 50), + ] + + if CP.carFingerprint == CAR.CIVIC: + signals += [("IMPERIAL_UNIT", "HUD_SETTING"), + ("EPB_STATE", "EPB_STATUS")] + checks += [ + ("HUD_SETTING", 50), + ("EPB_STATUS", 50), + ] + elif CP.carFingerprint in (CAR.ODYSSEY, CAR.ODYSSEY_CHN): + signals.append(("EPB_STATE", "EPB_STATUS")) + checks.append(("EPB_STATUS", 50)) + + # add gas interceptor reading if we are using it + if CP.enableGasInterceptor: + signals.append(("INTERCEPTOR_GAS", "GAS_SENSOR")) + signals.append(("INTERCEPTOR_GAS2", "GAS_SENSOR")) + checks.append(("GAS_SENSOR", 50)) + + if CP.openpilotLongitudinalControl: + signals += [ + ("BRAKE_ERROR_1", "STANDSTILL"), + ("BRAKE_ERROR_2", "STANDSTILL") + ] + checks.append(("STANDSTILL", 50)) + + return signals, checks + + +class CarState(CarStateBase): + def __init__(self, CP): + super().__init__(CP) + can_define = CANDefine(DBC[CP.carFingerprint]["pt"]) + self.gearbox_msg = "GEARBOX" + if CP.carFingerprint == CAR.ACCORD and CP.transmissionType == TransmissionType.cvt: + self.gearbox_msg = "GEARBOX_15T" + + self.main_on_sig_msg = "SCM_FEEDBACK" + if CP.carFingerprint in HONDA_NIDEC_ALT_SCM_MESSAGES: + self.main_on_sig_msg = "SCM_BUTTONS" + + self.shifter_values = can_define.dv[self.gearbox_msg]["GEAR_SHIFTER"] + self.steer_status_values = defaultdict(lambda: "UNKNOWN", can_define.dv["STEER_STATUS"]["STEER_STATUS"]) + + self.brake_error = False + self.brake_switch_prev = False + self.brake_switch_active = False + self.cruise_setting = 0 + self.v_cruise_pcm_prev = 0 + + def update(self, cp, cp_cam, cp_body): + ret = car.CarState.new_message() + + # car params + v_weight_v = [0., 1.] # don't trust smooth speed at low values to avoid premature zero snapping + v_weight_bp = [1., 6.] # smooth blending, below ~0.6m/s the smooth speed snaps to zero + + # update prevs, update must run once per loop + self.prev_cruise_buttons = self.cruise_buttons + self.prev_cruise_setting = self.cruise_setting + + # ******************* parse out can ******************* + # TODO: find wheels moving bit in dbc + if self.CP.carFingerprint in (CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E): + ret.standstill = cp.vl["ENGINE_DATA"]["XMISSION_SPEED"] < 0.1 + ret.doorOpen = bool(cp.vl["SCM_FEEDBACK"]["DRIVERS_DOOR_OPEN"]) + elif self.CP.carFingerprint == CAR.ODYSSEY_CHN: + ret.standstill = cp.vl["ENGINE_DATA"]["XMISSION_SPEED"] < 0.1 + ret.doorOpen = bool(cp.vl["SCM_BUTTONS"]["DRIVERS_DOOR_OPEN"]) + elif self.CP.carFingerprint in (CAR.FREED, CAR.HRV): + ret.standstill = not cp.vl["STANDSTILL"]["WHEELS_MOVING"] + ret.doorOpen = bool(cp.vl["SCM_BUTTONS"]["DRIVERS_DOOR_OPEN"]) + else: + ret.standstill = not cp.vl["STANDSTILL"]["WHEELS_MOVING"] + ret.doorOpen = any([cp.vl["DOORS_STATUS"]["DOOR_OPEN_FL"], cp.vl["DOORS_STATUS"]["DOOR_OPEN_FR"], + cp.vl["DOORS_STATUS"]["DOOR_OPEN_RL"], cp.vl["DOORS_STATUS"]["DOOR_OPEN_RR"]]) + ret.seatbeltUnlatched = bool(cp.vl["SEATBELT_STATUS"]["SEATBELT_DRIVER_LAMP"] or not cp.vl["SEATBELT_STATUS"]["SEATBELT_DRIVER_LATCHED"]) + + steer_status = self.steer_status_values[cp.vl["STEER_STATUS"]["STEER_STATUS"]] + ret.steerError = steer_status not in ("NORMAL", "NO_TORQUE_ALERT_1", "NO_TORQUE_ALERT_2", "LOW_SPEED_LOCKOUT", "TMP_FAULT") + # NO_TORQUE_ALERT_2 can be caused by bump OR steering nudge from driver + self.steer_not_allowed = steer_status not in ("NORMAL", "NO_TORQUE_ALERT_2") + # LOW_SPEED_LOCKOUT is not worth a warning + ret.steerWarning = steer_status not in ("NORMAL", "LOW_SPEED_LOCKOUT", "NO_TORQUE_ALERT_2") + + if self.CP.openpilotLongitudinalControl: + self.brake_error = cp.vl["STANDSTILL"]["BRAKE_ERROR_1"] or cp.vl["STANDSTILL"]["BRAKE_ERROR_2"] + ret.espDisabled = cp.vl["VSA_STATUS"]["ESP_DISABLED"] != 0 + + ret.wheelSpeeds = self.get_wheel_speeds( + cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_FL"], + cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_FR"], + cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_RL"], + cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_RR"], + ) + v_wheel = (ret.wheelSpeeds.fl + ret.wheelSpeeds.fr + ret.wheelSpeeds.rl + ret.wheelSpeeds.rr) / 4.0 + + # blend in transmission speed at low speed, since it has more low speed accuracy + v_weight = interp(v_wheel, v_weight_bp, v_weight_v) + ret.vEgoRaw = (1. - v_weight) * cp.vl["ENGINE_DATA"]["XMISSION_SPEED"] * CV.KPH_TO_MS * self.CP.wheelSpeedFactor + v_weight * v_wheel + ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) + + ret.steeringAngleDeg = cp.vl["STEERING_SENSORS"]["STEER_ANGLE"] + ret.steeringRateDeg = cp.vl["STEERING_SENSORS"]["STEER_ANGLE_RATE"] + + self.cruise_setting = cp.vl["SCM_BUTTONS"]["CRUISE_SETTING"] + self.cruise_buttons = cp.vl["SCM_BUTTONS"]["CRUISE_BUTTONS"] + + ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_stalk( + 250, cp.vl["SCM_FEEDBACK"]["LEFT_BLINKER"], cp.vl["SCM_FEEDBACK"]["RIGHT_BLINKER"]) + ret.brakeHoldActive = cp.vl["VSA_STATUS"]["BRAKE_HOLD_ACTIVE"] == 1 + + if self.CP.carFingerprint in (CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN, CAR.CRV_5G, CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH, + CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E): + self.park_brake = cp.vl["EPB_STATUS"]["EPB_STATE"] != 0 + else: + self.park_brake = 0 # TODO + + gear = int(cp.vl[self.gearbox_msg]["GEAR_SHIFTER"]) + ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(gear, None)) + + if self.CP.enableGasInterceptor: + ret.gas = (cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"]) / 2. + else: + ret.gas = cp.vl["POWERTRAIN_DATA"]["PEDAL_GAS"] + ret.gasPressed = ret.gas > 1e-5 + + ret.steeringTorque = cp.vl["STEER_STATUS"]["STEER_TORQUE_SENSOR"] + ret.steeringTorqueEps = cp.vl["STEER_MOTOR_TORQUE"]["MOTOR_TORQUE"] + ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD.get(self.CP.carFingerprint, 1200) + + if self.CP.carFingerprint in HONDA_BOSCH: + if not self.CP.openpilotLongitudinalControl: + ret.cruiseState.nonAdaptive = cp.vl["ACC_HUD"]["CRUISE_CONTROL_LABEL"] != 0 + ret.cruiseState.standstill = cp.vl["ACC_HUD"]["CRUISE_SPEED"] == 252. + + # On set, cruise set speed pulses between 254~255 and the set speed prev is set to avoid this. + ret.cruiseState.speed = self.v_cruise_pcm_prev if cp.vl["ACC_HUD"]["CRUISE_SPEED"] > 160.0 else cp.vl["ACC_HUD"]["CRUISE_SPEED"] * CV.KPH_TO_MS + self.v_cruise_pcm_prev = ret.cruiseState.speed + else: + ret.cruiseState.speed = cp.vl["CRUISE"]["CRUISE_SPEED_PCM"] * CV.KPH_TO_MS + + if self.CP.carFingerprint in HONDA_BOSCH_ALT_BRAKE_SIGNAL: + ret.brakePressed = cp.vl["BRAKE_MODULE"]["BRAKE_PRESSED"] != 0 + else: + # brake switch has shown some single time step noise, so only considered when + # switch is on for at least 2 consecutive CAN samples + # brake switch rises earlier than brake pressed but is never 1 when in park + brake_switch_vals = cp.vl_all["POWERTRAIN_DATA"]["BRAKE_SWITCH"] + if len(brake_switch_vals): + brake_switch = cp.vl["POWERTRAIN_DATA"]["BRAKE_SWITCH"] != 0 + if len(brake_switch_vals) > 1: + self.brake_switch_prev = brake_switch_vals[-2] != 0 + self.brake_switch_active = brake_switch and self.brake_switch_prev + self.brake_switch_prev = brake_switch + ret.brakePressed = (cp.vl["POWERTRAIN_DATA"]["BRAKE_PRESSED"] != 0) or self.brake_switch_active + + ret.brake = cp.vl["VSA_STATUS"]["USER_BRAKE"] + ret.cruiseState.enabled = cp.vl["POWERTRAIN_DATA"]["ACC_STATUS"] != 0 + ret.cruiseState.available = bool(cp.vl[self.main_on_sig_msg]["MAIN_ON"]) + + # Gets rid of Pedal Grinding noise when brake is pressed at slow speeds for some models + if self.CP.carFingerprint in (CAR.PILOT, CAR.PASSPORT, CAR.RIDGELINE): + if ret.brake > 0.1: + ret.brakePressed = True + + # TODO: discover the CAN msg that has the imperial unit bit for all other cars + if self.CP.carFingerprint in (CAR.CIVIC, ): + self.is_metric = not cp.vl["HUD_SETTING"]["IMPERIAL_UNIT"] + elif self.CP.carFingerprint in HONDA_BOSCH: + self.is_metric = not cp.vl["CAR_SPEED"]["IMPERIAL_UNIT"] + else: + self.is_metric = False + + if self.CP.carFingerprint in HONDA_BOSCH: + ret.stockAeb = (not self.CP.openpilotLongitudinalControl) and bool(cp.vl["ACC_CONTROL"]["AEB_STATUS"] and cp.vl["ACC_CONTROL"]["ACCEL_COMMAND"] < -1e-5) + else: + ret.stockAeb = bool(cp_cam.vl["BRAKE_COMMAND"]["AEB_REQ_1"] and cp_cam.vl["BRAKE_COMMAND"]["COMPUTER_BRAKE"] > 1e-5) + + if self.CP.carFingerprint in HONDA_BOSCH: + self.stock_hud = False + ret.stockFcw = False + else: + ret.stockFcw = cp_cam.vl["BRAKE_COMMAND"]["FCW"] != 0 + self.stock_hud = cp_cam.vl["ACC_HUD"] + self.stock_brake = cp_cam.vl["BRAKE_COMMAND"] + + if self.CP.enableBsm and self.CP.carFingerprint in (CAR.CRV_5G, ): + # BSM messages are on B-CAN, requires a panda forwarding B-CAN messages to CAN 0 + # more info here: https://github.com/commaai/openpilot/pull/1867 + ret.leftBlindspot = cp_body.vl["BSM_STATUS_LEFT"]["BSM_ALERT"] == 1 + ret.rightBlindspot = cp_body.vl["BSM_STATUS_RIGHT"]["BSM_ALERT"] == 1 + + return ret + + def get_can_parser(self, CP): + signals, checks = get_can_signals(CP, self.gearbox_msg, self.main_on_sig_msg) + bus_pt = 1 if CP.carFingerprint in HONDA_BOSCH else 0 + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, bus_pt) + + @staticmethod + def get_cam_can_parser(CP): + signals = [] + checks = [ + ("STEERING_CONTROL", 100), + ] + + if CP.carFingerprint not in HONDA_BOSCH: + signals += [("COMPUTER_BRAKE", "BRAKE_COMMAND"), + ("AEB_REQ_1", "BRAKE_COMMAND"), + ("FCW", "BRAKE_COMMAND"), + ("CHIME", "BRAKE_COMMAND"), + ("FCM_OFF", "ACC_HUD"), + ("FCM_OFF_2", "ACC_HUD"), + ("FCM_PROBLEM", "ACC_HUD"), + ("ICONS", "ACC_HUD")] + checks += [ + ("ACC_HUD", 10), + ("BRAKE_COMMAND", 50), + ] + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 2) + + @staticmethod + def get_body_can_parser(CP): + if CP.enableBsm and CP.carFingerprint == CAR.CRV_5G: + signals = [("BSM_ALERT", "BSM_STATUS_RIGHT"), + ("BSM_ALERT", "BSM_STATUS_LEFT")] + + checks = [ + ("BSM_STATUS_LEFT", 3), + ("BSM_STATUS_RIGHT", 3), + ] + bus_body = 0 # B-CAN is forwarded to ACC-CAN radar side (CAN 0 on fake ethernet port) + return CANParser(DBC[CP.carFingerprint]["body"], signals, checks, bus_body) + return None diff --git a/selfdrive/car/honda/hondacan.py b/selfdrive/car/honda/hondacan.py new file mode 100644 index 000000000..db7104cd4 --- /dev/null +++ b/selfdrive/car/honda/hondacan.py @@ -0,0 +1,174 @@ +from selfdrive.car.honda.values import HondaFlags, HONDA_BOSCH, CAR, CarControllerParams +from selfdrive.config import Conversions as CV + +# CAN bus layout with relay +# 0 = ACC-CAN - radar side +# 1 = F-CAN B - powertrain +# 2 = ACC-CAN - camera side +# 3 = F-CAN A - OBDII port + +def get_pt_bus(car_fingerprint): + return 1 if car_fingerprint in HONDA_BOSCH else 0 + + +def get_lkas_cmd_bus(car_fingerprint, radar_disabled=False): + if radar_disabled: + # when radar is disabled, steering commands are sent directly to powertrain bus + return get_pt_bus(car_fingerprint) + # normally steering commands are sent to radar, which forwards them to powertrain bus + return 0 + +def create_brake_command(packer, apply_brake, pump_on, pcm_override, pcm_cancel_cmd, fcw, idx, car_fingerprint, stock_brake): + # TODO: do we loose pressure if we keep pump off for long? + brakelights = apply_brake > 0 + brake_rq = apply_brake > 0 + pcm_fault_cmd = False + + values = { + "COMPUTER_BRAKE": apply_brake, + "BRAKE_PUMP_REQUEST": pump_on, + "CRUISE_OVERRIDE": pcm_override, + "CRUISE_FAULT_CMD": pcm_fault_cmd, + "CRUISE_CANCEL_CMD": pcm_cancel_cmd, + "COMPUTER_BRAKE_REQUEST": brake_rq, + "SET_ME_1": 1, + "BRAKE_LIGHTS": brakelights, + "CHIME": stock_brake["CHIME"] if fcw else 0, # send the chime for stock fcw + "FCW": fcw << 1, # TODO: Why are there two bits for fcw? + "AEB_REQ_1": 0, + "AEB_REQ_2": 0, + "AEB_STATUS": 0, + } + bus = get_pt_bus(car_fingerprint) + return packer.make_can_msg("BRAKE_COMMAND", bus, values, idx) + + +def create_acc_commands(packer, enabled, active, accel, gas, idx, stopping, car_fingerprint): + commands = [] + bus = get_pt_bus(car_fingerprint) + min_gas_accel = CarControllerParams.BOSCH_GAS_LOOKUP_BP[0] + + control_on = 5 if enabled else 0 + gas_command = gas if active and accel > min_gas_accel else -30000 + accel_command = accel if active else 0 + braking = 1 if active and accel < min_gas_accel else 0 + standstill = 1 if active and stopping else 0 + standstill_release = 1 if active and not stopping else 0 + + acc_control_values = { + # setting CONTROL_ON causes car to set POWERTRAIN_DATA->ACC_STATUS = 1 + "CONTROL_ON": control_on, + "GAS_COMMAND": gas_command, # used for gas + "ACCEL_COMMAND": accel_command, # used for brakes + "BRAKE_LIGHTS": braking, + "BRAKE_REQUEST": braking, + "STANDSTILL": standstill, + "STANDSTILL_RELEASE": standstill_release, + } + commands.append(packer.make_can_msg("ACC_CONTROL", bus, acc_control_values, idx)) + + acc_control_on_values = { + "SET_TO_3": 0x03, + "CONTROL_ON": enabled, + "SET_TO_FF": 0xff, + "SET_TO_75": 0x75, + "SET_TO_30": 0x30, + } + commands.append(packer.make_can_msg("ACC_CONTROL_ON", bus, acc_control_on_values, idx)) + + return commands + +def create_steering_control(packer, apply_steer, lkas_active, car_fingerprint, idx, radar_disabled): + values = { + "STEER_TORQUE": apply_steer if lkas_active else 0, + "STEER_TORQUE_REQUEST": lkas_active, + } + bus = get_lkas_cmd_bus(car_fingerprint, radar_disabled) + return packer.make_can_msg("STEERING_CONTROL", bus, values, idx) + + +def create_bosch_supplemental_1(packer, car_fingerprint, idx): + # non-active params + values = { + "SET_ME_X04": 0x04, + "SET_ME_X80": 0x80, + "SET_ME_X10": 0x10, + } + bus = get_lkas_cmd_bus(car_fingerprint) + return packer.make_can_msg("BOSCH_SUPPLEMENTAL_1", bus, values, idx) + + +def create_ui_commands(packer, CP, pcm_speed, hud, is_metric, idx, stock_hud): + commands = [] + bus_pt = get_pt_bus(CP.carFingerprint) + radar_disabled = CP.carFingerprint in HONDA_BOSCH and CP.openpilotLongitudinalControl + bus_lkas = get_lkas_cmd_bus(CP.carFingerprint, radar_disabled) + + if CP.openpilotLongitudinalControl: + if CP.carFingerprint in HONDA_BOSCH: + acc_hud_values = { + 'CRUISE_SPEED': hud.v_cruise, + 'ENABLE_MINI_CAR': 1, + 'SET_TO_1': 1, + 'HUD_LEAD': hud.car, + 'HUD_DISTANCE': 3, + 'ACC_ON': hud.car != 0, + 'SET_TO_X1': 1, + 'IMPERIAL_UNIT': int(not is_metric), + 'FCM_OFF': 1, + } + else: + acc_hud_values = { + 'PCM_SPEED': pcm_speed * CV.MS_TO_KPH, + 'PCM_GAS': hud.pcm_accel, + 'CRUISE_SPEED': hud.v_cruise, + 'ENABLE_MINI_CAR': 1, + 'HUD_LEAD': hud.car, + 'HUD_DISTANCE': 3, # max distance setting on display + 'IMPERIAL_UNIT': int(not is_metric), + 'SET_ME_X01_2': 1, + 'SET_ME_X01': 1, + "FCM_OFF": stock_hud["FCM_OFF"], + "FCM_OFF_2": stock_hud["FCM_OFF_2"], + "FCM_PROBLEM": stock_hud["FCM_PROBLEM"], + "ICONS": stock_hud["ICONS"], + } + commands.append(packer.make_can_msg("ACC_HUD", bus_pt, acc_hud_values, idx)) + + lkas_hud_values = { + 'SET_ME_X41': 0x41, + 'SET_ME_X48': 0x48, + 'STEERING_REQUIRED': hud.steer_required, + 'SOLID_LANES': hud.lanes, + 'BEEP': 0, + } + + if not (CP.flags & HondaFlags.BOSCH_EXT_HUD): + lkas_hud_values['SET_ME_X48'] = 0x48 + + if CP.flags & HondaFlags.BOSCH_EXT_HUD and not CP.openpilotLongitudinalControl: + commands.append(packer.make_can_msg('LKAS_HUD_A', bus_lkas, lkas_hud_values, idx)) + commands.append(packer.make_can_msg('LKAS_HUD_B', bus_lkas, lkas_hud_values, idx)) + else: + commands.append(packer.make_can_msg('LKAS_HUD', bus_lkas, lkas_hud_values, idx)) + + if radar_disabled and CP.carFingerprint in HONDA_BOSCH: + radar_hud_values = { + 'CMBS_OFF': 0x01, + 'SET_TO_1': 0x01, + } + commands.append(packer.make_can_msg('RADAR_HUD', bus_pt, radar_hud_values, idx)) + + if CP.carFingerprint == CAR.CIVIC_BOSCH: + commands.append(packer.make_can_msg("LEGACY_BRAKE_COMMAND", bus_pt, {}, idx)) + + return commands + + +def spam_buttons_command(packer, button_val, idx, car_fingerprint): + values = { + 'CRUISE_BUTTONS': button_val, + 'CRUISE_SETTING': 0, + } + bus = get_pt_bus(car_fingerprint) + return packer.make_can_msg("SCM_BUTTONS", bus, values, idx) diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py new file mode 100755 index 000000000..9e31ed8ae --- /dev/null +++ b/selfdrive/car/honda/interface.py @@ -0,0 +1,439 @@ +#!/usr/bin/env python3 +from cereal import car +from panda import Panda +from common.numpy_fast import interp +from common.params import Params +from selfdrive.car.honda.values import CarControllerParams, CruiseButtons, HondaFlags, CAR, HONDA_BOSCH, HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_ALT_BRAKE_SIGNAL +from selfdrive.car import STD_CARGO_KG, CivicParams, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config +from selfdrive.car.interfaces import CarInterfaceBase +from selfdrive.car.disable_ecu import disable_ecu +from selfdrive.config import Conversions as CV + + +ButtonType = car.CarState.ButtonEvent.Type +EventName = car.CarEvent.EventName +TransmissionType = car.CarParams.TransmissionType + + +class CarInterface(CarInterfaceBase): + @staticmethod + def get_pid_accel_limits(CP, current_speed, cruise_speed): + if CP.carFingerprint in HONDA_BOSCH: + return CarControllerParams.BOSCH_ACCEL_MIN, CarControllerParams.BOSCH_ACCEL_MAX + else: + # NIDECs don't allow acceleration near cruise_speed, + # so limit limits of pid to prevent windup + ACCEL_MAX_VALS = [CarControllerParams.NIDEC_ACCEL_MAX, 0.2] + ACCEL_MAX_BP = [cruise_speed - 2., cruise_speed - .2] + return CarControllerParams.NIDEC_ACCEL_MIN, interp(current_speed, ACCEL_MAX_BP, ACCEL_MAX_VALS) + + @staticmethod + def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[]): # pylint: disable=dangerous-default-value + ret = CarInterfaceBase.get_std_params(candidate, fingerprint) + ret.carName = "honda" + + if candidate in HONDA_BOSCH: + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.hondaBosch)] + ret.radarOffCan = True + + # Disable the radar and let openpilot control longitudinal + # WARNING: THIS DISABLES AEB! + ret.openpilotLongitudinalControl = Params().get_bool("DisableRadar") + + ret.pcmCruise = not ret.openpilotLongitudinalControl + else: + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.hondaNidec)] + ret.enableGasInterceptor = 0x201 in fingerprint[0] + ret.openpilotLongitudinalControl = True + + ret.pcmCruise = not ret.enableGasInterceptor + + if candidate == CAR.CRV_5G: + ret.enableBsm = 0x12f8bfa7 in fingerprint[0] + + # Detect Bosch cars with new HUD msgs + if any(0x33DA in f for f in fingerprint.values()): + ret.flags |= HondaFlags.BOSCH_EXT_HUD.value + + # Accord 1.5T CVT has different gearbox message + if candidate == CAR.ACCORD and 0x191 in fingerprint[1]: + ret.transmissionType = TransmissionType.cvt + + # Certain Hondas have an extra steering sensor at the bottom of the steering rack, + # which improves controls quality as it removes the steering column torsion from feedback. + # Tire stiffness factor fictitiously lower if it includes the steering column torsion effect. + # For modeling details, see p.198-200 in "The Science of Vehicle Dynamics (2014), M. Guiggiani" + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0], [0]] + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kf = 0.00006 # conservative feed-forward + + if candidate in HONDA_BOSCH: + ret.longitudinalTuning.kpV = [0.25] + ret.longitudinalTuning.kiV = [0.05] + ret.longitudinalActuatorDelayUpperBound = 0.5 # s + else: + # default longitudinal tuning for all hondas + ret.longitudinalTuning.kpBP = [0., 5., 35.] + ret.longitudinalTuning.kpV = [1.2, 0.8, 0.5] + ret.longitudinalTuning.kiBP = [0., 35.] + ret.longitudinalTuning.kiV = [0.18, 0.12] + + eps_modified = False + for fw in car_fw: + if fw.ecu == "eps" and b"," in fw.fwVersion: + eps_modified = True + + if candidate == CAR.CIVIC: + stop_and_go = True + ret.mass = CivicParams.MASS + ret.wheelbase = CivicParams.WHEELBASE + ret.centerToFront = CivicParams.CENTER_TO_FRONT + ret.steerRatio = 15.38 # 10.93 is end-to-end spec + if eps_modified: + # stock request input values: 0x0000, 0x00DE, 0x014D, 0x01EF, 0x0290, 0x0377, 0x0454, 0x0610, 0x06EE + # stock request output values: 0x0000, 0x0917, 0x0DC5, 0x1017, 0x119F, 0x140B, 0x1680, 0x1680, 0x1680 + # modified request output values: 0x0000, 0x0917, 0x0DC5, 0x1017, 0x119F, 0x140B, 0x1680, 0x2880, 0x3180 + # stock filter output values: 0x009F, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108 + # modified filter output values: 0x009F, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0400, 0x0480 + # note: max request allowed is 4096, but request is capped at 3840 in firmware, so modifications result in 2x max + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 2560, 8000], [0, 2560, 3840]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.3], [0.1]] + else: + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 2560], [0, 2560]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[1.1], [0.33]] + tire_stiffness_factor = 1. + + elif candidate in (CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL): + stop_and_go = True + ret.mass = CivicParams.MASS + ret.wheelbase = CivicParams.WHEELBASE + ret.centerToFront = CivicParams.CENTER_TO_FRONT + ret.steerRatio = 15.38 # 10.93 is end-to-end spec + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end + tire_stiffness_factor = 1. + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] + + elif candidate in (CAR.ACCORD, CAR.ACCORDH): + stop_and_go = True + ret.mass = 3279. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.83 + ret.centerToFront = ret.wheelbase * 0.39 + ret.steerRatio = 16.33 # 11.82 is spec end-to-end + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end + tire_stiffness_factor = 0.8467 + + if eps_modified: + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.3], [0.09]] + else: + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]] + + elif candidate == CAR.ACURA_ILX: + stop_and_go = False + ret.mass = 3095. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.67 + ret.centerToFront = ret.wheelbase * 0.37 + ret.steerRatio = 18.61 # 15.3 is spec end-to-end + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 3840], [0, 3840]] # TODO: determine if there is a dead zone at the top end + tire_stiffness_factor = 0.72 + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] + + elif candidate in (CAR.CRV, CAR.CRV_EU): + stop_and_go = False + ret.mass = 3572. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.62 + ret.centerToFront = ret.wheelbase * 0.41 + ret.steerRatio = 16.89 # as spec + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 1000], [0, 1000]] # TODO: determine if there is a dead zone at the top end + tire_stiffness_factor = 0.444 + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] + ret.wheelSpeedFactor = 1.025 + + elif candidate == CAR.CRV_5G: + stop_and_go = True + ret.mass = 3410. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.66 + ret.centerToFront = ret.wheelbase * 0.41 + ret.steerRatio = 16.0 # 12.3 is spec end-to-end + if eps_modified: + # stock request input values: 0x0000, 0x00DB, 0x01BB, 0x0296, 0x0377, 0x0454, 0x0532, 0x0610, 0x067F + # stock request output values: 0x0000, 0x0500, 0x0A15, 0x0E6D, 0x1100, 0x1200, 0x129A, 0x134D, 0x1400 + # modified request output values: 0x0000, 0x0500, 0x0A15, 0x0E6D, 0x1100, 0x1200, 0x1ACD, 0x239A, 0x2800 + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 2560, 10000], [0, 2560, 3840]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.21], [0.07]] + else: + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 3840], [0, 3840]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.64], [0.192]] + tire_stiffness_factor = 0.677 + ret.wheelSpeedFactor = 1.025 + + elif candidate == CAR.CRV_HYBRID: + stop_and_go = True + ret.mass = 1667. + STD_CARGO_KG # mean of 4 models in kg + ret.wheelbase = 2.66 + ret.centerToFront = ret.wheelbase * 0.41 + ret.steerRatio = 16.0 # 12.3 is spec end-to-end + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end + tire_stiffness_factor = 0.677 + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]] + ret.wheelSpeedFactor = 1.025 + + elif candidate == CAR.FIT: + stop_and_go = False + ret.mass = 2644. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.53 + ret.centerToFront = ret.wheelbase * 0.39 + ret.steerRatio = 13.06 + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end + tire_stiffness_factor = 0.75 + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.05]] + + elif candidate == CAR.FREED: + stop_and_go = False + ret.mass = 3086. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.74 + # the remaining parameters were copied from FIT + ret.centerToFront = ret.wheelbase * 0.39 + ret.steerRatio = 13.06 + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] + tire_stiffness_factor = 0.75 + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.05]] + + elif candidate == CAR.HRV: + stop_and_go = False + ret.mass = 3125 * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.61 + ret.centerToFront = ret.wheelbase * 0.41 + ret.steerRatio = 15.2 + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] + tire_stiffness_factor = 0.5 + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.16], [0.025]] + ret.wheelSpeedFactor = 1.025 + + elif candidate == CAR.ACURA_RDX: + stop_and_go = False + ret.mass = 3935. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.68 + ret.centerToFront = ret.wheelbase * 0.38 + ret.steerRatio = 15.0 # as spec + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 1000], [0, 1000]] # TODO: determine if there is a dead zone at the top end + tire_stiffness_factor = 0.444 + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] + + elif candidate == CAR.ACURA_RDX_3G: + stop_and_go = True + ret.mass = 4068. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.75 + ret.centerToFront = ret.wheelbase * 0.41 + ret.steerRatio = 11.95 # as spec + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 3840], [0, 3840]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.06]] + tire_stiffness_factor = 0.677 + + elif candidate == CAR.ODYSSEY: + stop_and_go = False + ret.mass = 4471. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 3.00 + ret.centerToFront = ret.wheelbase * 0.41 + ret.steerRatio = 14.35 # as spec + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end + tire_stiffness_factor = 0.82 + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.28], [0.08]] + + elif candidate == CAR.ODYSSEY_CHN: + stop_and_go = False + ret.mass = 1849.2 + STD_CARGO_KG # mean of 4 models in kg + ret.wheelbase = 2.90 + ret.centerToFront = ret.wheelbase * 0.41 # from CAR.ODYSSEY + ret.steerRatio = 14.35 + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 32767], [0, 32767]] # TODO: determine if there is a dead zone at the top end + tire_stiffness_factor = 0.82 + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.28], [0.08]] + + elif candidate in (CAR.PILOT, CAR.PASSPORT): + stop_and_go = False + ret.mass = 4204. * CV.LB_TO_KG + STD_CARGO_KG # average weight + ret.wheelbase = 2.82 + ret.centerToFront = ret.wheelbase * 0.428 + ret.steerRatio = 17.25 # as spec + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end + tire_stiffness_factor = 0.444 + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.38], [0.11]] + + elif candidate == CAR.RIDGELINE: + stop_and_go = False + ret.mass = 4515. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 3.18 + ret.centerToFront = ret.wheelbase * 0.41 + ret.steerRatio = 15.59 # as spec + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end + tire_stiffness_factor = 0.444 + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.38], [0.11]] + + elif candidate == CAR.INSIGHT: + stop_and_go = True + ret.mass = 2987. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.7 + ret.centerToFront = ret.wheelbase * 0.39 + ret.steerRatio = 15.0 # 12.58 is spec end-to-end + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end + tire_stiffness_factor = 0.82 + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]] + + elif candidate == CAR.HONDA_E: + stop_and_go = True + ret.mass = 3338.8 * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.5 + ret.centerToFront = ret.wheelbase * 0.5 + ret.steerRatio = 16.71 + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end + tire_stiffness_factor = 0.82 + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]] # TODO: can probably use some tuning + + else: + raise ValueError(f"unsupported car {candidate}") + + # These cars use alternate user brake msg (0x1BE) + if candidate in HONDA_BOSCH_ALT_BRAKE_SIGNAL: + ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HONDA_ALT_BRAKE + + # These cars use alternate SCM messages (SCM_FEEDBACK AND SCM_BUTTON) + if candidate in HONDA_NIDEC_ALT_SCM_MESSAGES: + ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HONDA_NIDEC_ALT + + if ret.openpilotLongitudinalControl and candidate in HONDA_BOSCH: + ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HONDA_BOSCH_LONG + + # min speed to enable ACC. if car can do stop and go, then set enabling speed + # to a negative value, so it won't matter. Otherwise, add 0.5 mph margin to not + # conflict with PCM acc + ret.minEnableSpeed = -1. if (stop_and_go or ret.enableGasInterceptor) else 25.5 * CV.MPH_TO_MS + + # TODO: get actual value, for now starting with reasonable value for + # civic and scaling by mass and wheelbase + ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) + + # TODO: start from empirically derived lateral slip stiffness for the civic and scale by + # mass and CG position, so all cars will have approximately similar dyn behaviors + ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, + tire_stiffness_factor=tire_stiffness_factor) + + ret.steerActuatorDelay = 0.1 + ret.steerRateCost = 0.5 + ret.steerLimitTimer = 0.8 + + return ret + + @staticmethod + def init(CP, logcan, sendcan): + if CP.carFingerprint in HONDA_BOSCH and CP.openpilotLongitudinalControl: + disable_ecu(logcan, sendcan, bus=1, addr=0x18DAB0F1, com_cont_req=b'\x28\x83\x03') + + # returns a car.CarState + def update(self, c, can_strings): + # ******************* do can recv ******************* + self.cp.update_strings(can_strings) + self.cp_cam.update_strings(can_strings) + if self.cp_body: + self.cp_body.update_strings(can_strings) + + ret = self.CS.update(self.cp, self.cp_cam, self.cp_body) + self.post_update(c,ret) + ret.canValid = self.cp.can_valid and self.cp_cam.can_valid and (self.cp_body is None or self.cp_body.can_valid) + + buttonEvents = [] + + if self.CS.cruise_buttons != self.CS.prev_cruise_buttons: + be = car.CarState.ButtonEvent.new_message() + be.type = ButtonType.unknown + if self.CS.cruise_buttons != 0: + be.pressed = True + but = self.CS.cruise_buttons + else: + be.pressed = False + but = self.CS.prev_cruise_buttons + if but == CruiseButtons.RES_ACCEL: + be.type = ButtonType.accelCruise + elif but == CruiseButtons.DECEL_SET: + be.type = ButtonType.decelCruise + elif but == CruiseButtons.CANCEL: + be.type = ButtonType.cancel + elif but == CruiseButtons.MAIN: + be.type = ButtonType.altButton3 + buttonEvents.append(be) + + if self.CS.cruise_setting != self.CS.prev_cruise_setting: + be = car.CarState.ButtonEvent.new_message() + be.type = ButtonType.unknown + if self.CS.cruise_setting != 0: + be.pressed = True + but = self.CS.cruise_setting + else: + be.pressed = False + but = self.CS.prev_cruise_setting + if but == 1: + be.type = ButtonType.altButton1 + # TODO: more buttons? + buttonEvents.append(be) + ret.buttonEvents = buttonEvents + + # events + events = self.create_common_events(ret, pcm_enable=False) + if self.CS.brake_error: + events.add(EventName.brakeUnavailable) + if self.CS.park_brake: + events.add(EventName.parkBrake) + + if self.CP.pcmCruise and ret.vEgo < self.CP.minEnableSpeed: + events.add(EventName.belowEngageSpeed) + + if self.CP.pcmCruise: + # we engage when pcm is active (rising edge) + if ret.cruiseState.enabled and not self.CS.out.cruiseState.enabled: + events.add(EventName.pcmEnable) + elif not ret.cruiseState.enabled and (c.actuators.accel >= 0. or not self.CP.openpilotLongitudinalControl): + # it can happen that car cruise disables while comma system is enabled: need to + # keep braking if needed or if the speed is very low + if ret.vEgo < self.CP.minEnableSpeed + 2.: + # non loud alert if cruise disables below 25mph as expected (+ a little margin) + events.add(EventName.speedTooLow) + else: + events.add(EventName.cruiseDisabled) + if self.CS.CP.minEnableSpeed > 0 and ret.vEgo < 0.001: + events.add(EventName.manualRestart) + + # handle button presses + for b in ret.buttonEvents: + + # do enable on both accel and decel buttons + if b.type in (ButtonType.accelCruise, ButtonType.decelCruise) and not b.pressed: + if not self.CP.pcmCruise: + events.add(EventName.buttonEnable) + + # do disable on button down + if b.type == ButtonType.cancel and b.pressed: + events.add(EventName.buttonCancel) + + ret.events = events.to_msg() + + self.CS.out = ret.as_reader() + return self.CS.out + + # pass in a car.CarControl + # to be called @ 100hz + def apply(self, c): + hud_control = c.hudControl + if hud_control.speedVisible: + hud_v_cruise = hud_control.setSpeed * CV.MS_TO_KPH + else: + hud_v_cruise = 255 + + ret = self.CC.update(c.enabled, c.active, self.CS, self.frame, + c.actuators, + c.cruiseControl.cancel, + hud_v_cruise, + hud_control.lanesVisible, + hud_show_car=hud_control.leadVisible, + hud_alert=hud_control.visualAlert) + + self.frame += 1 + return ret diff --git a/selfdrive/car/honda/radar_interface.py b/selfdrive/car/honda/radar_interface.py new file mode 100755 index 000000000..629ab01d4 --- /dev/null +++ b/selfdrive/car/honda/radar_interface.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python3 +from cereal import car +from opendbc.can.parser import CANParser +from selfdrive.car.interfaces import RadarInterfaceBase +from selfdrive.car.honda.values import DBC + + +def _create_nidec_can_parser(car_fingerprint): + radar_messages = [0x400] + list(range(0x430, 0x43A)) + list(range(0x440, 0x446)) + signals = list(zip(['RADAR_STATE'] + + ['LONG_DIST'] * 16 + ['NEW_TRACK'] * 16 + ['LAT_DIST'] * 16 + + ['REL_SPEED'] * 16, + [0x400] + radar_messages[1:] * 4)) + checks = [(s[1], 20) for s in signals] + return CANParser(DBC[car_fingerprint]['radar'], signals, checks, 1) + + +class RadarInterface(RadarInterfaceBase): + def __init__(self, CP): + super().__init__(CP) + self.track_id = 0 + self.radar_fault = False + self.radar_wrong_config = False + self.radar_off_can = CP.radarOffCan + self.radar_ts = CP.radarTimeStep + + self.delay = int(round(0.1 / CP.radarTimeStep)) # 0.1s delay of radar + + # Nidec + if self.radar_off_can: + self.rcp = None + else: + self.rcp = _create_nidec_can_parser(CP.carFingerprint) + self.trigger_msg = 0x445 + self.updated_messages = set() + + def update(self, can_strings): + # in Bosch radar and we are only steering for now, so sleep 0.05s to keep + # radard at 20Hz and return no points + if self.radar_off_can: + return super().update(None) + + vls = self.rcp.update_strings(can_strings) + self.updated_messages.update(vls) + + if self.trigger_msg not in self.updated_messages: + return None + + rr = self._update(self.updated_messages) + self.updated_messages.clear() + return rr + + def _update(self, updated_messages): + ret = car.RadarData.new_message() + + for ii in sorted(updated_messages): + cpt = self.rcp.vl[ii] + if ii == 0x400: + # check for radar faults + self.radar_fault = cpt['RADAR_STATE'] != 0x79 + self.radar_wrong_config = cpt['RADAR_STATE'] == 0x69 + elif cpt['LONG_DIST'] < 255: + if ii not in self.pts or cpt['NEW_TRACK']: + self.pts[ii] = car.RadarData.RadarPoint.new_message() + self.pts[ii].trackId = self.track_id + self.track_id += 1 + self.pts[ii].dRel = cpt['LONG_DIST'] # from front of car + self.pts[ii].yRel = -cpt['LAT_DIST'] # in car frame's y axis, left is positive + self.pts[ii].vRel = cpt['REL_SPEED'] + self.pts[ii].aRel = float('nan') + self.pts[ii].yvRel = float('nan') + self.pts[ii].measured = True + else: + if ii in self.pts: + del self.pts[ii] + + errors = [] + if not self.rcp.can_valid: + errors.append("canError") + if self.radar_fault: + errors.append("fault") + if self.radar_wrong_config: + errors.append("wrongConfig") + ret.errors = errors + + ret.points = list(self.pts.values()) + + return ret diff --git a/selfdrive/car/honda/values.py b/selfdrive/car/honda/values.py new file mode 100644 index 000000000..50ea52faa --- /dev/null +++ b/selfdrive/car/honda/values.py @@ -0,0 +1,1377 @@ +from enum import IntFlag + +from cereal import car +from selfdrive.car import dbc_dict + +Ecu = car.CarParams.Ecu +VisualAlert = car.CarControl.HUDControl.VisualAlert + + +class CarControllerParams(): + # Allow small margin below -3.5 m/s^2 from ISO 15622:2018 since we + # perform the closed loop control, and might need some + # to apply some more braking if we're on a downhill slope. + # Our controller should still keep the 2 second average above + # -3.5 m/s^2 as per planner limits + NIDEC_ACCEL_MIN = -4.0 # m/s^2 + NIDEC_ACCEL_MAX = 1.6 # m/s^2, lower than 2.0 m/s^2 for tuning reasons + + NIDEC_ACCEL_LOOKUP_BP = [-1., 0., .6] + NIDEC_ACCEL_LOOKUP_V = [-4.8, 0., 2.0] + + NIDEC_MAX_ACCEL_V = [0.5, 2.4, 1.4, 0.6] + NIDEC_MAX_ACCEL_BP = [0.0, 4.0, 10., 20.] + + NIDEC_BRAKE_MAX = 1024 // 4 + + BOSCH_ACCEL_MIN = -3.5 # m/s^2 + BOSCH_ACCEL_MAX = 2.0 # m/s^2 + + BOSCH_GAS_LOOKUP_BP = [-0.2, 2.0] # 2m/s^2 + BOSCH_GAS_LOOKUP_V = [0, 1600] + + def __init__(self, CP): + self.STEER_MAX = CP.lateralParams.torqueBP[-1] + # mirror of list (assuming first item is zero) for interp of signed request values + assert(CP.lateralParams.torqueBP[0] == 0) + assert(CP.lateralParams.torqueBP[0] == 0) + self.STEER_LOOKUP_BP = [v * -1 for v in CP.lateralParams.torqueBP][1:][::-1] + list(CP.lateralParams.torqueBP) + self.STEER_LOOKUP_V = [v * -1 for v in CP.lateralParams.torqueV][1:][::-1] + list(CP.lateralParams.torqueV) + + +class HondaFlags(IntFlag): + # Bosch models with alternate set of LKAS_HUD messages + BOSCH_EXT_HUD = 1 + + +# Car button codes +class CruiseButtons: + RES_ACCEL = 4 + DECEL_SET = 3 + CANCEL = 2 + MAIN = 1 + +# See dbc files for info on values +VISUAL_HUD = { + VisualAlert.none: 0, + VisualAlert.fcw: 1, + VisualAlert.steerRequired: 1, + VisualAlert.ldw: 1, + VisualAlert.brakePressed: 10, + VisualAlert.wrongGear: 6, + VisualAlert.seatbeltUnbuckled: 5, + VisualAlert.speedTooHigh: 8 +} + +class CAR: + ACCORD = "HONDA ACCORD 2018" + ACCORDH = "HONDA ACCORD HYBRID 2018" + CIVIC = "HONDA CIVIC 2016" + CIVIC_BOSCH = "HONDA CIVIC (BOSCH) 2019" + CIVIC_BOSCH_DIESEL = "HONDA CIVIC SEDAN 1.6 DIESEL 2019" + ACURA_ILX = "ACURA ILX 2016" + CRV = "HONDA CR-V 2016" + CRV_5G = "HONDA CR-V 2017" + CRV_EU = "HONDA CR-V EU 2016" + CRV_HYBRID = "HONDA CR-V HYBRID 2019" + FIT = "HONDA FIT 2018" + FREED = "HONDA FREED 2020" + HRV = "HONDA HRV 2019" + ODYSSEY = "HONDA ODYSSEY 2018" + ODYSSEY_CHN = "HONDA ODYSSEY CHN 2019" + ACURA_RDX = "ACURA RDX 2018" + ACURA_RDX_3G = "ACURA RDX 2020" + PILOT = "HONDA PILOT 2017" + PASSPORT = "HONDA PASSPORT 2021" + RIDGELINE = "HONDA RIDGELINE 2017" + INSIGHT = "HONDA INSIGHT 2019" + HONDA_E = "HONDA E 2020" + +FW_VERSIONS = { + CAR.ACCORD: { + (Ecu.programmedFuelInjection, 0x18da10f1, None): [ + b'37805-6A0-8720\x00\x00', + b'37805-6A0-9520\x00\x00', + b'37805-6A0-9620\x00\x00', + b'37805-6A0-9720\x00\x00', + b'37805-6A0-A540\x00\x00', + b'37805-6A0-A550\x00\x00', + b'37805-6A0-A640\x00\x00', + b'37805-6A0-A650\x00\x00', + b'37805-6A0-A740\x00\x00', + b'37805-6A0-A750\x00\x00', + b'37805-6A0-A840\x00\x00', + b'37805-6A0-A850\x00\x00', + b'37805-6A0-AF30\x00\x00', + b'37805-6A0-AG30\x00\x00', + b'37805-6B2-C520\x00\x00', + b'37805-6A0-C540\x00\x00', + b'37805-6A1-H650\x00\x00', + b'37805-6B2-A550\x00\x00', + b'37805-6B2-A560\x00\x00', + b'37805-6B2-A650\x00\x00', + b'37805-6B2-A660\x00\x00', + b'37805-6B2-A720\x00\x00', + b'37805-6B2-A810\x00\x00', + b'37805-6B2-A820\x00\x00', + b'37805-6B2-A920\x00\x00', + b'37805-6B2-M520\x00\x00', + b'37805-6B2-Y810\x00\x00', + b'37805-6M4-B730\x00\x00', + ], + (Ecu.shiftByWire, 0x18da0bf1, None): [ + b'54008-TVC-A910\x00\x00', + ], + (Ecu.transmission, 0x18da1ef1, None): [ + b'28101-6A7-A220\x00\x00', + b'28101-6A7-A230\x00\x00', + b'28101-6A7-A320\x00\x00', + b'28101-6A7-A330\x00\x00', + b'28101-6A7-A410\x00\x00', + b'28101-6A7-A510\x00\x00', + b'28101-6A7-A610\x00\x00', + b'28101-6A7-A710\x00\x00', + b'28101-6A9-H140\x00\x00', + b'28101-6A9-H420\x00\x00', + b'28102-6B8-A560\x00\x00', + b'28102-6B8-A570\x00\x00', + b'28102-6B8-A700\x00\x00', + b'28102-6B8-A800\x00\x00', + b'28102-6B8-C560\x00\x00', + b'28102-6B8-C570\x00\x00', + b'28102-6B8-M520\x00\x00', + b'28102-6B8-R700\x00\x00', + ], + (Ecu.electricBrakeBooster, 0x18da2bf1, None): [ + b'46114-TVA-A060\x00\x00', + b'46114-TVA-A080\x00\x00', + b'46114-TVA-A120\x00\x00', + b'46114-TVA-A320\x00\x00', + b'46114-TVA-A050\x00\x00', + b'46114-TVE-H550\x00\x00', + b'46114-TVE-H560\x00\x00', + ], + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-TVA-B040\x00\x00', + b'57114-TVA-B050\x00\x00', + b'57114-TVA-B060\x00\x00', + b'57114-TVA-B530\x00\x00', + b'57114-TVA-C040\x00\x00', + b'57114-TVA-C050\x00\x00', + b'57114-TVA-C060\x00\x00', + b'57114-TVA-C530\x00\x00', + b'57114-TVA-E520\x00\x00', + b'57114-TVE-H250\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-TBX-H120\x00\x00', + b'39990-TVA-A140\x00\x00', + b'39990-TVA-A150\x00\x00', + b'39990-TVA-A160\x00\x00', + b'39990-TVA-A340\x00\x00', + b'39990-TVA-X030\x00\x00', + b'39990-TVA-X040\x00\x00', + b'39990-TVA,A150\x00\x00', + b'39990-TVE-H130\x00\x00', + ], + (Ecu.unknown, 0x18da3af1, None): [ + b'39390-TVA-A020\x00\x00', + b'39390-TVA-A120\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-TBX-H230\x00\x00', + b'77959-TVA-A460\x00\x00', + b'77959-TVA-F330\x00\x00', + b'77959-TVA-H230\x00\x00', + b'77959-TVA-L420\x00\x00', + b'77959-TVA-X330\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-TBX-H310\x00\x00', + b'78109-TVA-A010\x00\x00', + b'78109-TVA-A020\x00\x00', + b'78109-TVA-A030\x00\x00', + b'78109-TVA-A110\x00\x00', + b'78109-TVA-A120\x00\x00', + b'78109-TVA-A210\x00\x00', + b'78109-TVA-A220\x00\x00', + b'78109-TVA-A230\x00\x00', + b'78109-TVA-A310\x00\x00', + b'78109-TVA-C010\x00\x00', + b'78109-TVA-L010\x00\x00', + b'78109-TVA-L210\x00\x00', + b'78109-TVA-R310\x00\x00', + b'78109-TVC-A010\x00\x00', + b'78109-TVC-A020\x00\x00', + b'78109-TVC-A030\x00\x00', + b'78109-TVC-A110\x00\x00', + b'78109-TVC-A130\x00\x00', + b'78109-TVC-A210\x00\x00', + b'78109-TVC-A220\x00\x00', + b'78109-TVC-A230\x00\x00', + b'78109-TVC-C010\x00\x00', + b'78109-TVC-C110\x00\x00', + b'78109-TVC-L010\x00\x00', + b'78109-TVC-L210\x00\x00', + b'78109-TVC-M510\x00\x00', + b'78109-TVC-YF10\x00\x00', + b'78109-TVE-H610\x00\x00', + b'78109-TWA-A210\x00\x00', + ], + (Ecu.hud, 0x18da61f1, None): [ + b'78209-TVA-A010\x00\x00', + b'78209-TVA-A110\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36802-TBX-H140\x00\x00', + b'36802-TVA-A150\x00\x00', + b'36802-TVA-A160\x00\x00', + b'36802-TVA-A170\x00\x00', + b'36802-TVA-A330\x00\x00', + b'36802-TVC-A330\x00\x00', + b'36802-TVE-H070\x00\x00', + b'36802-TWA-A070\x00\x00', + b'36802-TWA-A080\x00\x00', + ], + (Ecu.fwdCamera, 0x18dab5f1, None): [ + b'36161-TBX-H130\x00\x00', + b'36161-TVA-A060\x00\x00', + b'36161-TVA-A330\x00\x00', + b'36161-TVC-A330\x00\x00', + b'36161-TVE-H050\x00\x00', + b'36161-TWA-A070\x00\x00', + ], + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-TVA-A010\x00\x00', + b'38897-TVA-A020\x00\x00', + b'38897-TVA-A230\x00\x00', + b'38897-TVA-A240\x00\x00', + ], + }, + CAR.ACCORDH: { + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-TWA-A120\x00\x00', + b'38897-TWD-J020\x00\x00', + ], + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-TWA-A040\x00\x00', + b'57114-TWA-A050\x00\x00', + b'57114-TWA-A530\x00\x00', + b'57114-TWA-B520\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-TWA-A440\x00\x00', + b'77959-TWA-L420\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-TWA-A010\x00\x00', + b'78109-TWA-A020\x00\x00', + b'78109-TWA-A030\x00\x00', + b'78109-TWA-A110\x00\x00', + b'78109-TWA-A120\x00\x00', + b'78109-TWA-A130\x00\x00', + b'78109-TWA-A210\x00\x00', + b'78109-TWA-A220\x00\x00', + b'78109-TWA-A230\x00\x00', + b'78109-TWA-L010\x00\x00', + b'78109-TWA-L210\x00\x00', + ], + (Ecu.shiftByWire, 0x18da0bf1, None): [ + b'54008-TWA-A910\x00\x00', + ], + (Ecu.hud, 0x18da61f1, None): [ + b'78209-TVA-A010\x00\x00', + b'78209-TVA-A110\x00\x00', + ], + (Ecu.fwdCamera, 0x18dab5f1, None): [ + b'36161-TWA-A070\x00\x00', + b'36161-TWA-A330\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36802-TWA-A070\x00\x00', + b'36802-TWA-A080\x00\x00', + b'36802-TWA-A330\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-TVA-A160\x00\x00', + b'39990-TVA-A150\x00\x00', + b'39990-TVA-A340\x00\x00', + ], + }, + CAR.CIVIC: { + (Ecu.programmedFuelInjection, 0x18da10f1, None): [ + b'37805-5AA-A640\x00\x00', + b'37805-5AA-A650\x00\x00', + b'37805-5AA-A670\x00\x00', + b'37805-5AA-A680\x00\x00', + b'37805-5AA-A810\x00\x00', + b'37805-5AA-C640\x00\x00', + b'37805-5AA-C680\x00\x00', + b'37805-5AA-C820\x00\x00', + b'37805-5AA-L650\x00\x00', + b'37805-5AA-L660\x00\x00', + b'37805-5AA-L680\x00\x00', + b'37805-5AA-L690\x00\x00', + b'37805-5AA-L810\000\000', + b'37805-5AG-Q710\x00\x00', + b'37805-5AJ-A610\x00\x00', + b'37805-5AJ-A620\x00\x00', + b'37805-5AJ-L610\x00\x00', + b'37805-5BA-A310\x00\x00', + b'37805-5BA-A510\x00\x00', + b'37805-5BA-A740\x00\x00', + b'37805-5BA-A760\x00\x00', + b'37805-5BA-A930\x00\x00', + b'37805-5BA-A960\x00\x00', + b'37805-5BA-C860\x00\x00', + b'37805-5BA-L410\x00\x00', + b'37805-5BA-L760\x00\x00', + b'37805-5BA-L930\x00\x00', + b'37805-5BA-L940\x00\x00', + b'37805-5BA-L960\x00\x00', + ], + (Ecu.transmission, 0x18da1ef1, None): [ + b'28101-5CG-A040\x00\x00', + b'28101-5CG-A050\x00\x00', + b'28101-5CG-A070\x00\x00', + b'28101-5CG-A080\x00\x00', + b'28101-5CG-A320\x00\x00', + b'28101-5CG-A810\x00\x00', + b'28101-5CG-A820\x00\x00', + b'28101-5DJ-A040\x00\x00', + b'28101-5DJ-A060\x00\x00', + b'28101-5DJ-A510\x00\x00', + ], + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-TBA-A540\x00\x00', + b'57114-TBA-A550\x00\x00', + b'57114-TBA-A560\x00\x00', + b'57114-TBA-A570\x00\x00', + b'57114-TEA-Q220\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-TBA,A030\x00\x00', # modified firmware + b'39990-TBA-A030\x00\x00', + b'39990-TBG-A030\x00\x00', + b'39990-TEA-T020\x00\x00', + b'39990-TEG-A010\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-TBA-A030\x00\x00', + b'77959-TBA-A040\x00\x00', + b'77959-TBG-A030\x00\x00', + b'77959-TEA-Q820\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-TBA-A510\x00\x00', + b'78109-TBA-A520\x00\x00', + b'78109-TBA-A530\x00\x00', + b'78109-TBA-C520\x00\x00', + b'78109-TBC-A310\x00\x00', + b'78109-TBC-A320\x00\x00', + b'78109-TBC-A510\x00\x00', + b'78109-TBC-A520\x00\x00', + b'78109-TBC-A530\x00\x00', + b'78109-TBC-C510\x00\x00', + b'78109-TBC-C520\x00\x00', + b'78109-TBC-C530\x00\x00', + b'78109-TBH-A510\x00\x00', + b'78109-TBH-A530\x00\x00', + b'78109-TED-Q510\x00\x00', + b'78109-TEG-A310\x00\x00', + ], + (Ecu.fwdCamera, 0x18dab0f1, None): [ + b'36161-TBA-A020\x00\x00', + b'36161-TBA-A030\x00\x00', + b'36161-TBA-A040\x00\x00', + b'36161-TBC-A020\x00\x00', + b'36161-TBC-A030\x00\x00', + b'36161-TED-Q320\x00\x00', + b'36161-TEG-A010\x00\x00', + b'36161-TEG-A020\x00\x00', + ], + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-TBA-A010\x00\x00', + b'38897-TBA-A020\x00\x00', + ], + }, + CAR.CIVIC_BOSCH: { + (Ecu.programmedFuelInjection, 0x18da10f1, None): [ + b'37805-5AA-A940\x00\x00', + b'37805-5AA-A950\x00\x00', + b'37805-5AA-C950\x00\x00', + b'37805-5AA-L940\x00\x00', + b'37805-5AA-L950\x00\x00', + b'37805-5AG-Z910\x00\x00', + b'37805-5AJ-A750\x00\x00', + b'37805-5AJ-L750\x00\x00', + b'37805-5AK-T530\x00\x00', + b'37805-5AN-A750\x00\x00', + b'37805-5AN-A830\x00\x00', + b'37805-5AN-A840\x00\x00', + b'37805-5AN-A930\x00\x00', + b'37805-5AN-A940\x00\x00', + b'37805-5AN-A950\x00\x00', + b'37805-5AN-AG20\x00\x00', + b'37805-5AN-AH20\x00\x00', + b'37805-5AN-AJ30\x00\x00', + b'37805-5AN-AK10\x00\x00', + b'37805-5AN-AK20\x00\x00', + b'37805-5AN-AR10\x00\x00', + b'37805-5AN-AR20\x00\x00', + b'37805-5AN-CH20\x00\x00', + b'37805-5AN-E630\x00\x00', + b'37805-5AN-E720\x00\x00', + b'37805-5AN-E820\x00\x00', + b'37805-5AN-J820\x00\x00', + b'37805-5AN-L840\x00\x00', + b'37805-5AN-L930\x00\x00', + b'37805-5AN-L940\x00\x00', + b'37805-5AN-LF20\x00\x00', + b'37805-5AN-LH20\x00\x00', + b'37805-5AN-LJ20\x00\x00', + b'37805-5AN-LR20\x00\x00', + b'37805-5AN-LS20\x00\x00', + b'37805-5AW-G720\x00\x00', + b'37805-5AZ-E850\x00\x00', + b'37805-5AZ-G540\x00\x00', + b'37805-5AZ-G740\x00\x00', + b'37805-5AZ-G840\x00\x00', + b'37805-5BB-A530\x00\x00', + b'37805-5BB-A540\x00\x00', + b'37805-5BB-A630\x00\x00', + b'37805-5BB-A640\x00\x00', + b'37805-5BB-C540\x00\x00', + b'37805-5BB-C630\x00\x00', + b'37805-5BB-C640\x00\x00', + b'37805-5BB-L540\x00\x00', + b'37805-5BB-L630\x00\x00', + b'37805-5BB-L640\x00\x00', + ], + (Ecu.transmission, 0x18da1ef1, None): [ + b'28101-5CG-A920\x00\x00', + b'28101-5CG-AB10\x00\x00', + b'28101-5CG-C110\x00\x00', + b'28101-5CG-C220\x00\x00', + b'28101-5CG-C320\x00\x00', + b'28101-5CG-G020\x00\x00', + b'28101-5CG-L020\x00\x00', + b'28101-5CK-A130\x00\x00', + b'28101-5CK-A140\x00\x00', + b'28101-5CK-A150\x00\x00', + b'28101-5CK-C130\x00\x00', + b'28101-5CK-C140\x00\x00', + b'28101-5CK-C150\x00\x00', + b'28101-5CK-G210\x00\x00', + b'28101-5CK-J710\x00\x00', + b'28101-5CK-Q610\x00\x00', + b'28101-5DJ-A610\x00\x00', + b'28101-5DJ-A710\x00\x00', + b'28101-5DV-E330\x00\x00', + b'28101-5DV-E610\x00\x00', + b'28101-5DV-E820\x00\x00', + ], + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-TBG-A330\x00\x00', + b'57114-TBG-A340\x00\x00', + b'57114-TBG-A350\x00\x00', + b'57114-TGG-A340\x00\x00', + b'57114-TGG-C320\x00\x00', + b'57114-TGG-G320\x00\x00', + b'57114-TGG-L320\x00\x00', + b'57114-TGG-L330\x00\x00', + b'57114-TGK-T320\x00\x00', + b'57114-TGL-G330\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-TBA-C020\x00\x00', + b'39990-TBA-C120\x00\x00', + b'39990-TEA-T820\x00\x00', + b'39990-TEZ-T020\x00\x00', + b'39990-TGG-A020\x00\x00', + b'39990-TGG-A120\x00\x00', + b'39990-TGG-J510\x00\x00', + b'39990-TGL-E130\x00\x00', + b'39990-TGN-E120\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-TBA-A060\x00\x00', + b'77959-TBG-A050\x00\x00', + b'77959-TEA-G020\x00\x00', + b'77959-TGG-A020\x00\x00', + b'77959-TGG-A030\x00\x00', + b'77959-TGG-E010\x00\x00', + b'77959-TGG-G010\x00\x00', + b'77959-TGG-G110\x00\x00', + b'77959-TGG-J320\x00\x00', + b'77959-TGG-Z820\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-TBA-A110\x00\x00', + b'78109-TBA-A910\x00\x00', + b'78109-TBA-C340\x00\x00', + b'78109-TBA-C910\x00\x00', + b'78109-TBC-A740\x00\x00', + b'78109-TBC-C540\x00\x00', + b'78109-TBG-A110\x00\x00', + b'78109-TBH-A710\x00\x00', + b'78109-TEG-A720\x00\x00', + b'78109-TFJ-G020\x00\x00', + b'78109-TGG-9020\x00\x00', + b'78109-TGG-A210\x00\x00', + b'78109-TGG-A220\x00\x00', + b'78109-TGG-A310\x00\x00', + b'78109-TGG-A320\x00\x00', + b'78109-TGG-A330\x00\x00', + b'78109-TGG-A610\x00\x00', + b'78109-TGG-A620\x00\x00', + b'78109-TGG-A810\x00\x00', + b'78109-TGG-A820\x00\x00', + b'78109-TGG-C220\x00\x00', + b'78109-TGG-E110\x00\x00', + b'78109-TGG-G030\x00\x00', + b'78109-TGG-G230\x00\x00', + b'78109-TGG-G410\x00\x00', + b'78109-TGK-Z410\x00\x00', + b'78109-TGL-G120\x00\x00', + b'78109-TGL-G130\x00\x00', + b'78109-TGL-G210\x00\x00', + b'78109-TGL-G230\x00\x00', + b'78109-TGL-GM10\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36802-TBA-A150\x00\x00', + b'36802-TBA-A160\x00\x00', + b'36802-TFJ-G060\x00\x00', + b'36802-TGG-A050\x00\x00', + b'36802-TGG-A060\x00\x00', + b'36802-TGG-A130\x00\x00', + b'36802-TGG-G040\x00\x00', + b'36802-TGG-G130\x00\x00', + b'36802-TGK-Q120\x00\x00', + b'36802-TGL-G040\x00\x00', + ], + (Ecu.fwdCamera, 0x18dab5f1, None): [ + b'36161-TBA-A130\x00\x00', + b'36161-TBA-A140\x00\x00', + b'36161-TFJ-G070\x00\x00', + b'36161-TGG-A060\x00\x00', + b'36161-TGG-A080\x00\x00', + b'36161-TGG-A120\x00\x00', + b'36161-TGG-G050\x00\x00', + b'36161-TGG-G130\x00\x00', + b'36161-TGG-G140\x00\x00', + b'36161-TGK-Q120\x00\x00', + b'36161-TGL-G050\x00\x00', + b'36161-TGL-G070\x00\x00', + b'36161-TGG-G070\x00\x00', + ], + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-TBA-A110\x00\x00', + b'38897-TBA-A020\x00\x00', + ], + (Ecu.electricBrakeBooster, 0x18da2bf1, None): [ + b'39494-TGL-G030\x00\x00', + ], + }, + CAR.CIVIC_BOSCH_DIESEL: { + (Ecu.programmedFuelInjection, 0x18da10f1, None): [ + b'37805-59N-G630\x00\x00', + b'37805-59N-G830\x00\x00', + ], + (Ecu.transmission, 0x18da1ef1, None): [ + b'28101-59Y-G220\x00\x00', + b'28101-59Y-G620\x00\x00', + ], + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-TGN-E320\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-TFK-G020\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-TFK-G210\x00\x00', + b'77959-TGN-G220\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-TFK-G020\x00\x00', + b'78109-TGN-G120\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36802-TFK-G130\x00\x00', + b'36802-TGN-G130\x00\x00', + ], + (Ecu.shiftByWire, 0x18da0bf1, None): [ + b'54008-TGN-E010\x00\x00', + ], + (Ecu.fwdCamera, 0x18dab5f1, None): [ + b'36161-TFK-G130\x00\x00', + b'36161-TGN-G130\x00\x00', + ], + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-TBA-A020\x00\x00', + ], + }, + CAR.CRV: { + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-T1W-A230\x00\x00', + b'57114-T1W-A240\x00\x00', + b'57114-TFF-A940\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-T0A-A230\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-T1W-A210\x00\x00', + b'78109-T1W-C210\x00\x00', + b'78109-T1X-A210\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36161-T1W-A830\x00\x00', + b'36161-T1W-C830\x00\x00', + b'36161-T1X-A830\x00\x00', + ], + }, + CAR.CRV_5G: { + (Ecu.programmedFuelInjection, 0x18da10f1, None): [ + b'37805-5PA-AH20\x00\x00', + b'37805-5PA-3060\x00\x00', + b'37805-5PA-3080\x00\x00', + b'37805-5PA-3180\x00\x00', + b'37805-5PA-4050\x00\x00', + b'37805-5PA-4150\x00\x00', + b'37805-5PA-6520\x00\x00', + b'37805-5PA-6530\x00\x00', + b'37805-5PA-6630\x00\x00', + b'37805-5PA-6640\x00\x00', + b'37805-5PA-7630\x00\x00', + b'37805-5PA-9630\x00\x00', + b'37805-5PA-9640\x00\x00', + b'37805-5PA-9730\x00\x00', + b'37805-5PA-9830\x00\x00', + b'37805-5PA-9840\x00\x00', + b'37805-5PA-A650\x00\x00', + b'37805-5PA-A670\x00\x00', + b'37805-5PA-A680\x00\x00', + b'37805-5PA-A850\x00\x00', + b'37805-5PA-A870\x00\x00', + b'37805-5PA-A880\x00\x00', + b'37805-5PA-A890\x00\x00', + b'37805-5PA-AB10\x00\x00', + b'37805-5PA-AD10\x00\x00', + b'37805-5PA-AF20\x00\x00', + b'37805-5PA-C680\x00\x00', + b'37805-5PD-Q630\x00\x00', + b'37805-5PF-F730\x00\x00', + b'37805-5PF-M630\x00\x00', + ], + (Ecu.transmission, 0x18da1ef1, None): [ + b'28101-5RG-A020\x00\x00', + b'28101-5RG-A030\x00\x00', + b'28101-5RG-A040\x00\x00', + b'28101-5RG-A120\x00\x00', + b'28101-5RG-A220\x00\x00', + b'28101-5RH-A020\x00\x00', + b'28101-5RH-A030\x00\x00', + b'28101-5RH-A040\x00\x00', + b'28101-5RH-A120\x00\x00', + b'28101-5RH-A220\x00\x00', + b'28101-5RL-Q010\x00\x00', + b'28101-5RM-F010\x00\x00', + b'28101-5RM-K010\x00\x00', + ], + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-TLA-A040\x00\x00', + b'57114-TLA-A050\x00\x00', + b'57114-TLA-A060\x00\x00', + b'57114-TLB-A830\x00\x00', + b'57114-TMC-Z040\x00\x00', + b'57114-TMC-Z050\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-TLA-A040\x00\x00', + b'39990-TLA-A110\x00\x00', + b'39990-TLA-A220\x00\x00', + b'39990-TLA,A040\x00\x00', # modified firmware + b'39990-TME-T030\x00\x00', + b'39990-TME-T120\x00\x00', + b'39990-TMT-T010\x00\x00', + ], + (Ecu.electricBrakeBooster, 0x18da2bf1, None): [ + b'46114-TLA-A040\x00\x00', + b'46114-TLA-A050\x00\x00', + b'46114-TLA-A930\x00\x00', + b'46114-TMC-U020\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-TLA-A110\x00\x00', + b'78109-TLA-A120\x00\x00', + b'78109-TLA-A210\x00\x00', + b'78109-TLA-A220\x00\x00', + b'78109-TLA-C020\x00\x00', + b'78109-TLA-C110\x00\x00', + b'78109-TLA-C210\x00\x00', + b'78109-TLA-C310\x00\x00', + b'78109-TLB-A020\x00\x00', + b'78109-TLB-A110\x00\x00', + b'78109-TLB-A120\x00\x00', + b'78109-TLB-A210\x00\x00', + b'78109-TLB-A220\x00\x00', + b'78109-TMC-Q210\x00\x00', + b'78109-TMM-F210\x00\x00', + b'78109-TMM-M110\x00\x00', + ], + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-TLA-A010\x00\x00', + b'38897-TLA-A110\x00\x00', + b'38897-TNY-G010\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36802-TLA-A040\x00\x00', + b'36802-TLA-A050\x00\x00', + b'36802-TLA-A060\x00\x00', + b'36802-TMC-Q040\x00\x00', + b'36802-TMC-Q070\x00\x00', + b'36802-TNY-A030\x00\x00', + ], + (Ecu.fwdCamera, 0x18dab5f1, None): [ + b'36161-TLA-A060\x00\x00', + b'36161-TLA-A070\x00\x00', + b'36161-TLA-A080\x00\x00', + b'36161-TMC-Q020\x00\x00', + b'36161-TMC-Q030\x00\x00', + b'36161-TMC-Q040\x00\x00', + b'36161-TNY-A020\x00\x00', + b'36161-TNY-A030\x00\x00', + b'36161-TNY-A040\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-TLA-A240\x00\x00', + b'77959-TLA-A250\x00\x00', + b'77959-TLA-A320\x00\x00', + b'77959-TLA-A410\x00\x00', + b'77959-TLA-A420\x00\x00', + b'77959-TLA-Q040\x00\x00', + b'77959-TLA-Z040\x00\x00', + b'77959-TMM-F040\x00\x00', + ], + }, + CAR.CRV_EU: { + (Ecu.programmedFuelInjection, 0x18da10f1, None): [ + b'37805-R5Z-G740\x00\x00', + b'37805-R5Z-G780\x00\x00', + ], + (Ecu.vsa, 0x18da28f1, None): [b'57114-T1V-G920\x00\x00'], + (Ecu.fwdRadar, 0x18dab0f1, None): [b'36161-T1V-G520\x00\x00'], + (Ecu.shiftByWire, 0x18da0bf1, None): [b'54008-T1V-G010\x00\x00'], + (Ecu.transmission, 0x18da1ef1, None): [ + b'28101-5LH-E120\x00\x00', + b'28103-5LH-E100\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-T1V-G020\x00\x00', + b'78109-T1B-3050\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [b'77959-T1G-G940\x00\x00'], + }, + CAR.CRV_HYBRID: { + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-TPA-G020\x00\x00', + b'57114-TPG-A020\x00\x00', + b'57114-TMB-H030\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-TPA-G030\x00\x00', + b'39990-TPG-A020\x00\x00', + b'39990-TMA-H020\x00\x00', + ], + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-TMA-H110\x00\x00', + b'38897-TPG-A110\x00\x00', + b'38897-TPG-A210\x00\x00', + ], + (Ecu.shiftByWire, 0x18da0bf1, None): [ + b'54008-TMB-H510\x00\x00', + b'54008-TMB-H610\x00\x00', + ], + (Ecu.fwdCamera, 0x18dab5f1, None): [ + b'36161-TMB-H040\x00\x00', + b'36161-TPA-E050\x00\x00', + b'36161-TPG-A030\x00\x00', + b'36161-TPG-A040\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-TMB-H220\x00\x00', + b'78109-TPA-G520\x00\x00', + b'78109-TPG-A110\x00\x00', + b'78109-TPG-A210\x00\x00', + ], + (Ecu.hud, 0x18da61f1, None): [ + b'78209-TLA-X010\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36802-TPA-E040\x00\x00', + b'36802-TPG-A020\x00\x00', + b'36802-TMB-H040\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-TLA-C320\x00\x00', + b'77959-TLA-C410\x00\x00', + b'77959-TLA-C420\x00\x00', + b'77959-TLA-G220\x00\x00', + b'77959-TLA-H240\x00\x00', + ], + }, + CAR.FIT: { + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-T5R-L020\x00\x00', + b'57114-T5R-L220\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-T5R-C020\x00\x00', + b'39990-T5R-C030\x00\x00', + ], + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-T5A-J010\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-T5A-A210\x00\x00', + b'78109-T5A-A410\x00\x00', + b'78109-T5A-A420\x00\x00', + b'78109-T5A-A910\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36161-T5R-A040\x00\x00', + b'36161-T5R-A240\x00\x00', + b'36161-T5R-A520\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-T5R-A230\x00\x00', + ], + }, + CAR.FREED: { + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-TDK-J010\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-TDK-J050\x00\x00', + b'39990-TDK-N020\x00\x00', + ], + # TODO: vsa is "essential" for fpv2 but doesn't appear on some models + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-TDK-J120\x00\x00', + b'57114-TDK-J330\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-TDK-J310\x00\x00', + b'78109-TDK-J320\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36161-TDK-J070\x00\x00', + b'36161-TDK-J080\x00\x00', + b'36161-TDK-J530\x00\x00', + ], + }, + CAR.ODYSSEY: { + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-THR-A010\x00\x00', + b'38897-THR-A020\x00\x00', + ], + (Ecu.programmedFuelInjection, 0x18da10f1, None): [ + b'37805-5MR-4080\x00\x00', + b'37805-5MR-A240\x00\x00', + b'37805-5MR-A250\x00\x00', + b'37805-5MR-A310\x00\x00', + b'37805-5MR-A740\x00\x00', + b'37805-5MR-A750\x00\x00', + b'37805-5MR-A840\x00\x00', + b'37805-5MR-C620\x00\x00', + b'37805-5MR-D530\x00\x00', + b'37805-5MR-K730\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-THR-A020\x00\x00', + b'39990-THR-A030\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-THR-A010\x00\x00', + b'77959-THR-A110\x00\x00', + b'77959-THR-X010\x00\x00', + ], + (Ecu.fwdCamera, 0x18dab0f1, None): [ + b'36161-THR-A020\x00\x00', + b'36161-THR-A030\x00\x00', + b'36161-THR-A110\x00\x00', + b'36161-THR-A720\x00\x00', + b'36161-THR-A730\x00\x00', + b'36161-THR-A810\x00\x00', + b'36161-THR-A910\x00\x00', + b'36161-THR-C010\x00\x00', + b'36161-THR-D110\x00\x00', + b'36161-THR-K020\x00\x00', + ], + (Ecu.transmission, 0x18da1ef1, None): [ + b'28101-5NZ-A110\x00\x00', + b'28101-5NZ-A310\x00\x00', + b'28101-5NZ-C310\x00\x00', + b'28102-5MX-A001\x00\x00', + b'28102-5MX-A600\x00\x00', + b'28102-5MX-A610\x00\x00', + b'28102-5MX-A710\x00\x00', + b'28102-5MX-A900\x00\x00', + b'28102-5MX-A910\x00\x00', + b'28102-5MX-C001\x00\x00', + b'28102-5MX-D001\x00\x00', + b'28102-5MX-D710\x00\x00', + b'28102-5MX-K610\x00\x00', + b'28103-5NZ-A100\x00\x00', + b'28103-5NZ-A300\x00\x00', + ], + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-THR-A040\x00\x00', + b'57114-THR-A110\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-THR-A220\x00\x00', + b'78109-THR-A230\x00\x00', + b'78109-THR-A420\x00\x00', + b'78109-THR-A430\x00\x00', + b'78109-THR-A720\x00\x00', + b'78109-THR-A820\x00\x00', + b'78109-THR-A830\x00\x00', + b'78109-THR-AB20\x00\x00', + b'78109-THR-AB30\x00\x00', + b'78109-THR-AB40\x00\x00', + b'78109-THR-AC20\x00\x00', + b'78109-THR-AC30\x00\x00', + b'78109-THR-AC40\x00\x00', + b'78109-THR-AC50\x00\x00', + b'78109-THR-AD30\x00\x00', + b'78109-THR-AE20\x00\x00', + b'78109-THR-AE30\x00\x00', + b'78109-THR-AE40\x00\x00', + b'78109-THR-AK10\x00\x00', + b'78109-THR-AL10\x00\x00', + b'78109-THR-AN10\x00\x00', + b'78109-THR-C220\x00\x00', + b'78109-THR-C330\x00\x00', + b'78109-THR-CE20\x00\x00', + b'78109-THR-DA20\x00\x00', + b'78109-THR-DA30\x00\x00', + b'78109-THR-DA40\x00\x00', + b'78109-THR-K120\x00\x00', + ], + (Ecu.shiftByWire, 0x18da0bf1, None): [ + b'54008-THR-A020\x00\x00', + ], + }, + CAR.PILOT: { + (Ecu.shiftByWire, 0x18da0bf1, None): [ + b'54008-TG7-A520\x00\x00', + b'54008-TG7-A530\x00\x00', + ], + (Ecu.transmission, 0x18da1ef1, None): [ + b'28101-5EY-A050\x00\x00', + b'28101-5EY-A100\x00\x00', + b'28101-5EZ-A050\x00\x00', + b'28101-5EZ-A060\x00\x00', + b'28101-5EZ-A100\x00\x00', + b'28101-5EZ-A210\x00\x00', + ], + (Ecu.programmedFuelInjection, 0x18da10f1, None): [ + b'37805-RLV-4060\x00\x00', + b'37805-RLV-4070\x00\x00', + b'37805-RLV-A830\x00\x00', + b'37805-RLV-A840\x00\x00', + b'37805-RLV-C430\x00\x00', + b'37805-RLV-C510\x00\x00', + b'37805-RLV-C520\x00\x00', + b'37805-RLV-C530\x00\x00', + b'37805-RLV-C910\x00\x00', + ], + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-TG7-A030\x00\x00', + b'38897-TG7-A040\x00\x00', + b'38897-TG7-A110\x00\x00', + b'38897-TG7-A210\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-TG7-A030\x00\x00', + b'39990-TG7-A040\x00\x00', + b'39990-TG7-A060\x00\x00', + b'39990-TG7-A070\x00\x00', + b'39990-TGS-A230\x00\x00', + ], + (Ecu.fwdCamera, 0x18dab0f1, None): [ + b'36161-TG7-A310\x00\x00', + b'36161-TG7-A520\x00\x00', + b'36161-TG7-A630\x00\x00', + b'36161-TG7-A720\x00\x00', + b'36161-TG7-A820\x00\x00', + b'36161-TG7-A930\x00\x00', + b'36161-TG7-C520\x00\x00', + b'36161-TG7-D520\x00\x00', + b'36161-TG7-D630\x00\x00', + b'36161-TG7-Y630\x00\x00', + b'36161-TG8-A520\x00\x00', + b'36161-TG8-A630\x00\x00', + b'36161-TG8-A720\x00\x00', + b'36161-TG8-A830\x00\x00', + b'36161-TGS-A130\x00\x00', + b'36161-TGT-A030\x00\x00', + b'36161-TGT-A130\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-TG7-A020\x00\x00', + b'77959-TG7-A110\x00\x00', + b'77959-TG7-A210\x00\x00', + b'77959-TG7-Y210\x00\x00', + b'77959-TGS-A010\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-TG7-A040\x00\x00', + b'78109-TG7-A050\x00\x00', + b'78109-TG7-A420\x00\x00', + b'78109-TG7-A520\x00\x00', + b'78109-TG7-A720\x00\x00', + b'78109-TG7-AJ10\x00\x00', + b'78109-TG7-AJ20\x00\x00', + b'78109-TG7-AK10\x00\x00', + b'78109-TG7-AK20\x00\x00', + b'78109-TG7-AM20\x00\x00', + b'78109-TG7-AP10\x00\x00', + b'78109-TG7-AP20\x00\x00', + b'78109-TG7-AS20\x00\x00', + b'78109-TG7-AT20\x00\x00', + b'78109-TG7-AU20\x00\x00', + b'78109-TG7-AX20\x00\x00', + b'78109-TG7-D020\x00\x00', + b'78109-TG7-DJ10\x00\x00', + b'78109-TG7-YK20\x00\x00', + b'78109-TG8-A420\x00\x00', + b'78109-TG8-A520\x00\x00', + b'78109-TG8-AJ10\x00\x00', + b'78109-TG8-AJ20\x00\x00', + b'78109-TG8-AK20\x00\x00', + b'78109-TGS-AK20\x00\x00', + b'78109-TGS-AP20\x00\x00', + b'78109-TGT-AJ20\x00\x00', + b'78109-TGT-AK30\x00\x00', + ], + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-TG7-A130\x00\x00', + b'57114-TG7-A140\x00\x00', + b'57114-TG7-A230\x00\x00', + b'57114-TG7-A240\x00\x00', + b'57114-TG7-A630\x00\x00', + b'57114-TG7-A730\x00\x00', + b'57114-TG8-A140\x00\x00', + b'57114-TG8-A240\x00\x00', + b'57114-TG8-A630\x00\x00', + b'57114-TG8-A730\x00\x00', + b'57114-TGS-A530\x00\x00', + b'57114-TGT-A530\x00\x00', + ], + }, + CAR.PASSPORT: { + (Ecu.programmedFuelInjection, 0x18da10f1, None): [ + b'37805-RLV-B220\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-TGS-A230\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36161-TGS-A030\x00\x00', + ], + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-TG7-A040\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-TGS-A010\x00\x00', + ], + (Ecu.shiftByWire, 0x18da0bf1, None): [ + b'54008-TG7-A530\x00\x00', + ], + (Ecu.transmission, 0x18da1ef1, None): [ + b'28101-5EZ-A600\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-TGS-AT20\x00\x00', + ], + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-TGS-A530\x00\x00', + ], + }, + CAR.ACURA_RDX: { + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-TX5-A220\x00\x00', + b'57114-TX4-A220\x00\x00', + ], + (Ecu.fwdCamera, 0x18dab0f1, None): [ + b'36161-TX5-A030\x00\x00', + b'36161-TX4-A030\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-TX4-C010\x00\x00', + b'77959-TX4-B010\x00\x00', + b'77959-TX4-C020\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-TX5-A310\x00\x00', + b'78109-TX4-A210\x00\x00', + b'78109-TX4-A310\x00\x00', + ], + }, + CAR.ACURA_RDX_3G: { + (Ecu.programmedFuelInjection, 0x18da10f1, None): [ + b'37805-5YF-A130\x00\x00', + b'37805-5YF-A230\x00\x00', + b'37805-5YF-A320\x00\x00', + b'37805-5YF-A330\x00\x00', + b'37805-5YF-A420\x00\x00', + b'37805-5YF-A430\x00\x00', + b'37805-5YF-A750\x00\x00', + b'37805-5YF-A850\x00\x00', + b'37805-5YF-A870\x00\x00', + b'37805-5YF-C210\x00\x00', + b'37805-5YF-C220\x00\x00', + b'37805-5YF-C410\000\000', + b'37805-5YF-C420\x00\x00', + ], + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-TJB-A030\x00\x00', + b'57114-TJB-A040\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36802-TJB-A040\x00\x00', + b'36802-TJB-A050\x00\x00', + ], + (Ecu.fwdCamera, 0x18dab5f1, None): [ + b'36161-TJB-A040\x00\x00', + ], + (Ecu.shiftByWire, 0x18da0bf1, None): [ + b'54008-TJB-A520\x00\x00', + ], + (Ecu.transmission, 0x18da1ef1, None): [ + b'28102-5YK-A610\x00\x00', + b'28102-5YK-A620\x00\x00', + b'28102-5YK-A630\x00\x00', + b'28102-5YK-A700\x00\x00', + b'28102-5YK-A711\x00\x00', + b'28102-5YL-A620\x00\x00', + b'28102-5YL-A700\x00\x00', + b'28102-5YL-A711\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-TJB-A140\x00\x00', + b'78109-TJB-A240\x00\x00', + b'78109-TJB-A420\x00\x00', + b'78109-TJB-AB10\x00\x00', + b'78109-TJB-AD10\x00\x00', + b'78109-TJB-AF10\x00\x00', + b'78109-TJB-AR10\x00\x00', + b'78109-TJB-AS10\000\000', + b'78109-TJB-AU10\x00\x00', + b'78109-TJB-AW10\x00\x00', + b'78109-TJC-A420\x00\x00', + b'78109-TJC-AA10\x00\x00', + b'78109-TJC-AD10\x00\x00', + b'78109-TJC-AF10\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-TJB-A040\x00\x00', + b'77959-TJB-A210\x00\x00', + ], + (Ecu.electricBrakeBooster, 0x18da2bf1, None): [ + b'46114-TJB-A040\x00\x00', + b'46114-TJB-A050\x00\x00', + b'46114-TJB-A060\x00\x00', + ], + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-TJB-A040\x00\x00', + b'38897-TJB-A110\x00\x00', + b'38897-TJB-A120\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-TJB-A030\x00\x00', + b'39990-TJB-A040\x00\x00', + b'39990-TJB-A130\x00\x00' + ], + }, + CAR.RIDGELINE: { + (Ecu.eps, 0x18da30f1, None): [ + b'39990-T6Z-A020\x00\x00', + b'39990-T6Z-A030\x00\x00', + b'39990-T6Z-A050\x00\x00', + ], + (Ecu.fwdCamera, 0x18dab0f1, None): [ + b'36161-T6Z-A020\x00\x00', + b'36161-T6Z-A310\x00\x00', + b'36161-T6Z-A420\x00\x00', + b'36161-T6Z-A520\x00\x00', + b'36161-T6Z-A620\x00\x00', + b'36161-TJZ-A120\x00\x00', + ], + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-T6Z-A010\x00\x00', + b'38897-T6Z-A110\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-T6Z-A420\x00\x00', + b'78109-T6Z-A510\x00\x00', + b'78109-T6Z-A710\x00\x00', + b'78109-T6Z-A810\x00\x00', + b'78109-T6Z-A910\x00\x00', + b'78109-T6Z-AA10\x00\x00', + b'78109-T6Z-C620\x00\x00', + b'78109-TJZ-A510\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-T6Z-A020\x00\x00', + ], + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-T6Z-A120\x00\x00', + b'57114-T6Z-A130\x00\x00', + b'57114-T6Z-A520\x00\x00', + b'57114-TJZ-A520\x00\x00', + ], + }, + CAR.INSIGHT: { + (Ecu.eps, 0x18da30f1, None): [ + b'39990-TXM-A040\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36802-TXM-A070\x00\x00', + ], + (Ecu.fwdCamera, 0x18dab5f1, None): [ + b'36161-TXM-A050\x00\x00', + b'36161-TXM-A060\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-TXM-A230\x00\x00', + ], + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-TXM-A030\x00\x00', + b'57114-TXM-A040\x00\x00', + ], + (Ecu.shiftByWire, 0x18da0bf1, None): [ + b'54008-TWA-A910\x00\x00', + ], + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-TXM-A020\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-TXM-A010\x00\x00', + b'78109-TXM-A020\x00\x00', + b'78109-TXM-A110\x00\x00', + b'78109-TXM-C010\x00\x00', + b'78109-TXM-A030\x00\x00', + ], + }, + CAR.HRV: { + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-T7A-A010\x00\x00', + b'38897-T7A-A110\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-THX-A020\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36161-T7A-A140\x00\x00', + b'36161-T7A-A240\x00\x00', + b'36161-T7A-C440\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-T7A-A230\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-THX-A110\x00\x00', + b'78109-THX-A120\x00\x00', + b'78109-THX-A210\x00\x00', + b'78109-THX-A220\x00\x00', + b'78109-THX-C220\x00\x00', + ], + }, + CAR.ACURA_ILX: { + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-TX6-A010\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36161-TV9-A140\x00\x00', + b'36161-TX6-A030\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-TX6-A230\x00\x00', + b'77959-TX6-C210\x00\x00', + ], + (Ecu.combinationMeter, 0x18da60f1, None): [ + b'78109-T3R-A120\x00\x00', + b'78109-T3R-A410\x00\x00', + b'78109-TV9-A510\x00\x00', + ], + }, + CAR.HONDA_E:{ + (Ecu.eps, 0x18DA30F1, None):[ + b'39990-TYF-N030\x00\x00' + ], + (Ecu.gateway, 0x18DAEFF1, None):[ + b'38897-TYF-E140\x00\x00' + ], + (Ecu.shiftByWire, 0x18DA0BF1, None):[ + b'54008-TYF-E010\x00\x00' + ], + (Ecu.srs, 0x18DA53F1, None):[ + b'77959-TYF-G430\x00\x00' + ], + (Ecu.combinationMeter, 0x18DA60F1, None):[ + b'78108-TYF-G610\x00\x00' + ], + (Ecu.fwdRadar, 0x18DAB0F1, None):[ + b'36802-TYF-E030\x00\x00' + ], + (Ecu.fwdCamera, 0x18DAB5F1, None):[ + b'36161-TYF-E020\x00\x00' + ], + (Ecu.vsa, 0x18DA28F1, None):[ + b'57114-TYF-E030\x00\x00' + ], + }, +} + +DBC = { + CAR.ACCORD: dbc_dict('honda_accord_2018_can_generated', None), + CAR.ACCORDH: dbc_dict('honda_accord_2018_can_generated', None), + CAR.ACURA_ILX: dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'), + CAR.ACURA_RDX: dbc_dict('acura_rdx_2018_can_generated', 'acura_ilx_2016_nidec'), + CAR.ACURA_RDX_3G: dbc_dict('acura_rdx_2020_can_generated', None), + CAR.CIVIC: dbc_dict('honda_civic_touring_2016_can_generated', 'acura_ilx_2016_nidec'), + CAR.CIVIC_BOSCH: dbc_dict('honda_civic_hatchback_ex_2017_can_generated', None), + CAR.CIVIC_BOSCH_DIESEL: dbc_dict('honda_accord_2018_can_generated', None), + CAR.CRV: dbc_dict('honda_crv_touring_2016_can_generated', 'acura_ilx_2016_nidec'), + CAR.CRV_5G: dbc_dict('honda_crv_ex_2017_can_generated', None, body_dbc='honda_crv_ex_2017_body_generated'), + CAR.CRV_EU: dbc_dict('honda_crv_executive_2016_can_generated', 'acura_ilx_2016_nidec'), + CAR.CRV_HYBRID: dbc_dict('honda_accord_2018_can_generated', None), + CAR.FIT: dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'), + CAR.FREED: dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'), + CAR.HRV: dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'), + CAR.ODYSSEY: dbc_dict('honda_odyssey_exl_2018_generated', 'acura_ilx_2016_nidec'), + CAR.ODYSSEY_CHN: dbc_dict('honda_odyssey_extreme_edition_2018_china_can_generated', 'acura_ilx_2016_nidec'), + CAR.PILOT: dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'), + CAR.PASSPORT: dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'), + CAR.RIDGELINE: dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'), + CAR.INSIGHT: dbc_dict('honda_insight_ex_2019_can_generated', None), + CAR.HONDA_E: dbc_dict('acura_rdx_2020_can_generated', None), +} + +STEER_THRESHOLD = { + # default is 1200, overrides go here + CAR.ACURA_RDX: 400, + CAR.CRV_EU: 400, +} + +HONDA_NIDEC_ALT_PCM_ACCEL = {CAR.ODYSSEY} +HONDA_NIDEC_ALT_SCM_MESSAGES = {CAR.ACURA_ILX, CAR.ACURA_RDX, CAR.CRV, CAR.CRV_EU, CAR.FIT, CAR.FREED, CAR.HRV, CAR.ODYSSEY_CHN, + CAR.PILOT, CAR.PASSPORT, CAR.RIDGELINE} +HONDA_BOSCH = {CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_5G, + CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E} +HONDA_BOSCH_ALT_BRAKE_SIGNAL = {CAR.ACCORD, CAR.CRV_5G, CAR.ACURA_RDX_3G} diff --git a/selfdrive/car/hyundai/__init__.py b/selfdrive/car/hyundai/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py new file mode 100644 index 000000000..f7c43bd6e --- /dev/null +++ b/selfdrive/car/hyundai/carcontroller.py @@ -0,0 +1,125 @@ +from cereal import car +from common.realtime import DT_CTRL +from common.numpy_fast import clip, interp +from selfdrive.config import Conversions as CV +from selfdrive.car import apply_std_steer_torque_limits +from selfdrive.car.hyundai.hyundaican import create_lkas11, create_clu11, create_lfahda_mfc, create_acc_commands, create_acc_opt, create_frt_radar_opt +from selfdrive.car.hyundai.values import Buttons, CarControllerParams, CAR +from opendbc.can.packer import CANPacker + +VisualAlert = car.CarControl.HUDControl.VisualAlert +LongCtrlState = car.CarControl.Actuators.LongControlState + + +def process_hud_alert(enabled, fingerprint, visual_alert, left_lane, + right_lane, left_lane_depart, right_lane_depart): + sys_warning = (visual_alert in (VisualAlert.steerRequired, VisualAlert.ldw)) + + # initialize to no line visible + sys_state = 1 + if left_lane and right_lane or sys_warning: # HUD alert only display when LKAS status is active + sys_state = 3 if enabled or sys_warning else 4 + elif left_lane: + sys_state = 5 + elif right_lane: + sys_state = 6 + + # initialize to no warnings + left_lane_warning = 0 + right_lane_warning = 0 + if left_lane_depart: + left_lane_warning = 1 if fingerprint in (CAR.GENESIS_G90, CAR.GENESIS_G80) else 2 + if right_lane_depart: + right_lane_warning = 1 if fingerprint in (CAR.GENESIS_G90, CAR.GENESIS_G80) else 2 + + return sys_warning, sys_state, left_lane_warning, right_lane_warning + + +class CarController(): + def __init__(self, dbc_name, CP, VM): + self.p = CarControllerParams(CP) + self.packer = CANPacker(dbc_name) + + self.apply_steer_last = 0 + self.car_fingerprint = CP.carFingerprint + self.steer_rate_limited = False + self.last_resume_frame = 0 + self.accel = 0 + + def update(self, c, enabled, CS, frame, actuators, pcm_cancel_cmd, visual_alert, hud_speed, + left_lane, right_lane, left_lane_depart, right_lane_depart): + # Steering Torque + new_steer = int(round(actuators.steer * self.p.STEER_MAX)) + apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, self.p) + self.steer_rate_limited = new_steer != apply_steer + + # disable when temp fault is active, or below LKA minimum speed + lkas_active = c.active and not CS.out.steerWarning and CS.out.vEgo >= CS.CP.minSteerSpeed + + if not lkas_active: + apply_steer = 0 + + self.apply_steer_last = apply_steer + + sys_warning, sys_state, left_lane_warning, right_lane_warning = \ + process_hud_alert(enabled, self.car_fingerprint, visual_alert, + left_lane, right_lane, left_lane_depart, right_lane_depart) + + can_sends = [] + + # tester present - w/ no response (keeps radar disabled) + if CS.CP.openpilotLongitudinalControl: + if (frame % 100) == 0: + can_sends.append([0x7D0, 0, b"\x02\x3E\x80\x00\x00\x00\x00\x00", 0]) + + can_sends.append(create_lkas11(self.packer, frame, self.car_fingerprint, apply_steer, lkas_active, + CS.lkas11, sys_warning, sys_state, enabled, + left_lane, right_lane, + left_lane_warning, right_lane_warning)) + + if not CS.CP.openpilotLongitudinalControl: + if pcm_cancel_cmd: + can_sends.append(create_clu11(self.packer, frame, CS.clu11, Buttons.CANCEL)) + elif CS.out.cruiseState.standstill: + # send resume at a max freq of 10Hz + if (frame - self.last_resume_frame) * DT_CTRL > 0.1: + # send 25 messages at a time to increases the likelihood of resume being accepted + can_sends.extend([create_clu11(self.packer, frame, CS.clu11, Buttons.RES_ACCEL)] * 25) + self.last_resume_frame = frame + + if frame % 2 == 0 and CS.CP.openpilotLongitudinalControl: + lead_visible = False + accel = actuators.accel if c.active else 0 + + jerk = clip(2.0 * (accel - CS.out.aEgo), -12.7, 12.7) + + if accel < 0: + accel = interp(accel - CS.out.aEgo, [-1.0, -0.5], [2 * accel, accel]) + + accel = clip(accel, CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX) + + stopping = (actuators.longControlState == LongCtrlState.stopping) + set_speed_in_units = hud_speed * (CV.MS_TO_MPH if CS.clu11["CF_Clu_SPEED_UNIT"] == 1 else CV.MS_TO_KPH) + can_sends.extend(create_acc_commands(self.packer, enabled, accel, jerk, int(frame / 2), lead_visible, set_speed_in_units, stopping)) + self.accel = accel + + # 20 Hz LFA MFA message + if frame % 5 == 0 and self.car_fingerprint in (CAR.SONATA, CAR.PALISADE, CAR.IONIQ, CAR.KIA_NIRO_EV, CAR.KIA_NIRO_HEV_2021, + CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV, CAR.KIA_CEED, CAR.KIA_SELTOS, CAR.KONA_EV, + CAR.ELANTRA_2021, CAR.ELANTRA_HEV_2021, CAR.SONATA_HYBRID, CAR.KONA_HEV, CAR.SANTA_FE_2022, + CAR.KIA_K5_2021, CAR.IONIQ_HEV_2022, CAR.SANTA_FE_HEV_2022, CAR.GENESIS_G70_2020, CAR.SANTA_FE_PHEV_2022): + can_sends.append(create_lfahda_mfc(self.packer, enabled)) + + # 5 Hz ACC options + if frame % 20 == 0 and CS.CP.openpilotLongitudinalControl: + can_sends.extend(create_acc_opt(self.packer)) + + # 2 Hz front radar options + if frame % 50 == 0 and CS.CP.openpilotLongitudinalControl: + can_sends.append(create_frt_radar_opt(self.packer)) + + new_actuators = actuators.copy() + new_actuators.steer = apply_steer / self.p.STEER_MAX + new_actuators.accel = self.accel + + return new_actuators, can_sends diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py new file mode 100644 index 000000000..bdd49e206 --- /dev/null +++ b/selfdrive/car/hyundai/carstate.py @@ -0,0 +1,279 @@ +import copy +from cereal import car +from selfdrive.car.hyundai.values import DBC, STEER_THRESHOLD, FEATURES, EV_CAR, HYBRID_CAR +from selfdrive.car.interfaces import CarStateBase +from opendbc.can.parser import CANParser +from opendbc.can.can_define import CANDefine +from selfdrive.config import Conversions as CV + + +class CarState(CarStateBase): + def __init__(self, CP): + super().__init__(CP) + can_define = CANDefine(DBC[CP.carFingerprint]["pt"]) + + if self.CP.carFingerprint in FEATURES["use_cluster_gears"]: + self.shifter_values = can_define.dv["CLU15"]["CF_Clu_Gear"] + elif self.CP.carFingerprint in FEATURES["use_tcu_gears"]: + self.shifter_values = can_define.dv["TCU12"]["CUR_GR"] + else: # preferred and elect gear methods use same definition + self.shifter_values = can_define.dv["LVR12"]["CF_Lvr_Gear"] + + + def update(self, cp, cp_cam): + ret = car.CarState.new_message() + + ret.doorOpen = any([cp.vl["CGW1"]["CF_Gway_DrvDrSw"], cp.vl["CGW1"]["CF_Gway_AstDrSw"], + cp.vl["CGW2"]["CF_Gway_RLDrSw"], cp.vl["CGW2"]["CF_Gway_RRDrSw"]]) + + ret.seatbeltUnlatched = cp.vl["CGW1"]["CF_Gway_DrvSeatBeltSw"] == 0 + + ret.wheelSpeeds = self.get_wheel_speeds( + cp.vl["WHL_SPD11"]["WHL_SPD_FL"], + cp.vl["WHL_SPD11"]["WHL_SPD_FR"], + cp.vl["WHL_SPD11"]["WHL_SPD_RL"], + cp.vl["WHL_SPD11"]["WHL_SPD_RR"], + ) + ret.vEgoRaw = (ret.wheelSpeeds.fl + ret.wheelSpeeds.fr + ret.wheelSpeeds.rl + ret.wheelSpeeds.rr) / 4. + ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) + + ret.standstill = ret.vEgoRaw < 0.1 + + ret.steeringAngleDeg = cp.vl["SAS11"]["SAS_Angle"] + ret.steeringRateDeg = cp.vl["SAS11"]["SAS_Speed"] + ret.yawRate = cp.vl["ESP12"]["YAW_RATE"] + ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp( + 50, cp.vl["CGW1"]["CF_Gway_TurnSigLh"], cp.vl["CGW1"]["CF_Gway_TurnSigRh"]) + ret.steeringTorque = cp.vl["MDPS12"]["CR_Mdps_StrColTq"] + ret.steeringTorqueEps = cp.vl["MDPS12"]["CR_Mdps_OutTq"] + ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD + ret.steerWarning = cp.vl["MDPS12"]["CF_Mdps_ToiUnavail"] != 0 or cp.vl["MDPS12"]["CF_Mdps_ToiFlt"] != 0 + + # cruise state + if self.CP.openpilotLongitudinalControl: + # These are not used for engage/disengage since openpilot keeps track of state using the buttons + ret.cruiseState.available = cp.vl["TCS13"]["ACCEnable"] == 0 + ret.cruiseState.enabled = cp.vl["TCS13"]["ACC_REQ"] == 1 + ret.cruiseState.standstill = False + else: + ret.cruiseState.available = cp.vl["SCC11"]["MainMode_ACC"] == 1 + ret.cruiseState.enabled = cp.vl["SCC12"]["ACCMode"] != 0 + ret.cruiseState.standstill = cp.vl["SCC11"]["SCCInfoDisplay"] == 4. + + if ret.cruiseState.enabled: + speed_conv = CV.MPH_TO_MS if cp.vl["CLU11"]["CF_Clu_SPEED_UNIT"] else CV.KPH_TO_MS + ret.cruiseState.speed = cp.vl["SCC11"]["VSetDis"] * speed_conv + else: + ret.cruiseState.speed = 0 + + # TODO: Find brake pressure + ret.brake = 0 + ret.brakePressed = cp.vl["TCS13"]["DriverBraking"] != 0 + ret.brakeHoldActive = cp.vl["TCS15"]["AVH_LAMP"] == 2 # 0 OFF, 1 ERROR, 2 ACTIVE, 3 READY + + if self.CP.carFingerprint in (HYBRID_CAR | EV_CAR): + if self.CP.carFingerprint in HYBRID_CAR: + ret.gas = cp.vl["E_EMS11"]["CR_Vcu_AccPedDep_Pos"] / 254. + else: + ret.gas = cp.vl["E_EMS11"]["Accel_Pedal_Pos"] / 254. + ret.gasPressed = ret.gas > 0 + else: + ret.gas = cp.vl["EMS12"]["PV_AV_CAN"] / 100. + ret.gasPressed = bool(cp.vl["EMS16"]["CF_Ems_AclAct"]) + + # Gear Selection via Cluster - For those Kia/Hyundai which are not fully discovered, we can use the Cluster Indicator for Gear Selection, + # as this seems to be standard over all cars, but is not the preferred method. + if self.CP.carFingerprint in FEATURES["use_cluster_gears"]: + gear = cp.vl["CLU15"]["CF_Clu_Gear"] + elif self.CP.carFingerprint in FEATURES["use_tcu_gears"]: + gear = cp.vl["TCU12"]["CUR_GR"] + elif self.CP.carFingerprint in FEATURES["use_elect_gears"]: + gear = cp.vl["ELECT_GEAR"]["Elect_Gear_Shifter"] + else: + gear = cp.vl["LVR12"]["CF_Lvr_Gear"] + + ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(gear)) + + if not self.CP.openpilotLongitudinalControl: + if self.CP.carFingerprint in FEATURES["use_fca"]: + ret.stockAeb = cp.vl["FCA11"]["FCA_CmdAct"] != 0 + ret.stockFcw = cp.vl["FCA11"]["CF_VSM_Warn"] == 2 + else: + ret.stockAeb = cp.vl["SCC12"]["AEB_CmdAct"] != 0 + ret.stockFcw = cp.vl["SCC12"]["CF_VSM_Warn"] == 2 + + if self.CP.enableBsm: + ret.leftBlindspot = cp.vl["LCA11"]["CF_Lca_IndLeft"] != 0 + ret.rightBlindspot = cp.vl["LCA11"]["CF_Lca_IndRight"] != 0 + + # save the entire LKAS11 and CLU11 + self.lkas11 = copy.copy(cp_cam.vl["LKAS11"]) + self.clu11 = copy.copy(cp.vl["CLU11"]) + self.park_brake = cp.vl["TCS13"]["PBRAKE_ACT"] == 1 + self.steer_state = cp.vl["MDPS12"]["CF_Mdps_ToiActive"] # 0 NOT ACTIVE, 1 ACTIVE + self.brake_error = cp.vl["TCS13"]["ACCEnable"] != 0 # 0 ACC CONTROL ENABLED, 1-3 ACC CONTROL DISABLED + self.prev_cruise_buttons = self.cruise_buttons + self.cruise_buttons = cp.vl["CLU11"]["CF_Clu_CruiseSwState"] + + return ret + + @staticmethod + def get_can_parser(CP): + signals = [ + # sig_name, sig_address + ("WHL_SPD_FL", "WHL_SPD11"), + ("WHL_SPD_FR", "WHL_SPD11"), + ("WHL_SPD_RL", "WHL_SPD11"), + ("WHL_SPD_RR", "WHL_SPD11"), + + ("YAW_RATE", "ESP12"), + + ("CF_Gway_DrvSeatBeltInd", "CGW4"), + + ("CF_Gway_DrvSeatBeltSw", "CGW1"), + ("CF_Gway_DrvDrSw", "CGW1"), # Driver Door + ("CF_Gway_AstDrSw", "CGW1"), # Passenger door + ("CF_Gway_RLDrSw", "CGW2"), # Rear reft door + ("CF_Gway_RRDrSw", "CGW2"), # Rear right door + ("CF_Gway_TurnSigLh", "CGW1"), + ("CF_Gway_TurnSigRh", "CGW1"), + ("CF_Gway_ParkBrakeSw", "CGW1"), + + ("CYL_PRES", "ESP12"), + + ("CF_Clu_CruiseSwState", "CLU11"), + ("CF_Clu_CruiseSwMain", "CLU11"), + ("CF_Clu_SldMainSW", "CLU11"), + ("CF_Clu_ParityBit1", "CLU11"), + ("CF_Clu_VanzDecimal" , "CLU11"), + ("CF_Clu_Vanz", "CLU11"), + ("CF_Clu_SPEED_UNIT", "CLU11"), + ("CF_Clu_DetentOut", "CLU11"), + ("CF_Clu_RheostatLevel", "CLU11"), + ("CF_Clu_CluInfo", "CLU11"), + ("CF_Clu_AmpInfo", "CLU11"), + ("CF_Clu_AliveCnt1", "CLU11"), + + ("ACCEnable", "TCS13"), + ("ACC_REQ", "TCS13"), + ("DriverBraking", "TCS13"), + ("StandStill", "TCS13"), + ("PBRAKE_ACT", "TCS13"), + + ("ESC_Off_Step", "TCS15"), + ("AVH_LAMP", "TCS15"), + + ("CR_Mdps_StrColTq", "MDPS12"), + ("CF_Mdps_ToiActive", "MDPS12"), + ("CF_Mdps_ToiUnavail", "MDPS12"), + ("CF_Mdps_ToiFlt", "MDPS12"), + ("CR_Mdps_OutTq", "MDPS12"), + + ("SAS_Angle", "SAS11"), + ("SAS_Speed", "SAS11"), + ] + + checks = [ + # address, frequency + ("MDPS12", 50), + ("TCS13", 50), + ("TCS15", 10), + ("CLU11", 50), + ("ESP12", 100), + ("CGW1", 10), + ("CGW2", 5), + ("CGW4", 5), + ("WHL_SPD11", 50), + ("SAS11", 100), + ] + + if not CP.openpilotLongitudinalControl: + signals += [ + ("MainMode_ACC", "SCC11"), + ("VSetDis", "SCC11"), + ("SCCInfoDisplay", "SCC11"), + ("ACC_ObjDist", "SCC11"), + ("ACCMode", "SCC12"), + ] + + checks += [ + ("SCC11", 50), + ("SCC12", 50), + ] + + if CP.carFingerprint in FEATURES["use_fca"]: + signals += [ + ("FCA_CmdAct", "FCA11"), + ("CF_VSM_Warn", "FCA11"), + ] + checks.append(("FCA11", 50)) + else: + signals += [ + ("AEB_CmdAct", "SCC12"), + ("CF_VSM_Warn", "SCC12"), + ] + + if CP.enableBsm: + signals += [ + ("CF_Lca_IndLeft", "LCA11"), + ("CF_Lca_IndRight", "LCA11"), + ] + checks.append(("LCA11", 50)) + + if CP.carFingerprint in (HYBRID_CAR | EV_CAR): + if CP.carFingerprint in HYBRID_CAR: + signals.append(("CR_Vcu_AccPedDep_Pos", "E_EMS11")) + else: + signals.append(("Accel_Pedal_Pos", "E_EMS11")) + checks.append(("E_EMS11", 50)) + else: + signals += [ + ("PV_AV_CAN", "EMS12"), + ("CF_Ems_AclAct", "EMS16"), + ] + checks += [ + ("EMS12", 100), + ("EMS16", 100), + ] + + if CP.carFingerprint in FEATURES["use_cluster_gears"]: + signals.append(("CF_Clu_Gear", "CLU15")) + checks.append(("CLU15", 5)) + elif CP.carFingerprint in FEATURES["use_tcu_gears"]: + signals.append(("CUR_GR", "TCU12")) + checks.append(("TCU12", 100)) + elif CP.carFingerprint in FEATURES["use_elect_gears"]: + signals.append(("Elect_Gear_Shifter", "ELECT_GEAR")) + checks.append(("ELECT_GEAR", 20)) + else: + signals.append(("CF_Lvr_Gear", "LVR12")) + checks.append(("LVR12", 100)) + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 0) + + @staticmethod + def get_cam_can_parser(CP): + signals = [ + # sig_name, sig_address + ("CF_Lkas_LdwsActivemode", "LKAS11"), + ("CF_Lkas_LdwsSysState", "LKAS11"), + ("CF_Lkas_SysWarning", "LKAS11"), + ("CF_Lkas_LdwsLHWarning", "LKAS11"), + ("CF_Lkas_LdwsRHWarning", "LKAS11"), + ("CF_Lkas_HbaLamp", "LKAS11"), + ("CF_Lkas_FcwBasReq", "LKAS11"), + ("CF_Lkas_HbaSysState", "LKAS11"), + ("CF_Lkas_FcwOpt", "LKAS11"), + ("CF_Lkas_HbaOpt", "LKAS11"), + ("CF_Lkas_FcwSysState", "LKAS11"), + ("CF_Lkas_FcwCollisionWarning", "LKAS11"), + ("CF_Lkas_FusionState", "LKAS11"), + ("CF_Lkas_FcwOpt_USM", "LKAS11"), + ("CF_Lkas_LdwsOpt_USM", "LKAS11"), + ] + + checks = [ + ("LKAS11", 100) + ] + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 2) diff --git a/selfdrive/car/hyundai/hyundaican.py b/selfdrive/car/hyundai/hyundaican.py new file mode 100644 index 000000000..fd3fc78e8 --- /dev/null +++ b/selfdrive/car/hyundai/hyundaican.py @@ -0,0 +1,157 @@ +import crcmod +from selfdrive.car.hyundai.values import CAR, CHECKSUM + +hyundai_checksum = crcmod.mkCrcFun(0x11D, initCrc=0xFD, rev=False, xorOut=0xdf) + +def create_lkas11(packer, frame, car_fingerprint, apply_steer, steer_req, + lkas11, sys_warning, sys_state, enabled, + left_lane, right_lane, + left_lane_depart, right_lane_depart): + values = lkas11 + values["CF_Lkas_LdwsSysState"] = sys_state + values["CF_Lkas_SysWarning"] = 3 if sys_warning else 0 + values["CF_Lkas_LdwsLHWarning"] = left_lane_depart + values["CF_Lkas_LdwsRHWarning"] = right_lane_depart + values["CR_Lkas_StrToqReq"] = apply_steer + values["CF_Lkas_ActToi"] = steer_req + values["CF_Lkas_MsgCount"] = frame % 0x10 + + if car_fingerprint in (CAR.SONATA, CAR.PALISADE, CAR.KIA_NIRO_EV, CAR.KIA_NIRO_HEV_2021, CAR.SANTA_FE, + CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV, CAR.KIA_SELTOS, CAR.ELANTRA_2021, CAR.GENESIS_G70_2020, + CAR.ELANTRA_HEV_2021, CAR.SONATA_HYBRID, CAR.KONA_EV, CAR.KONA_HEV, CAR.SANTA_FE_2022, + CAR.KIA_K5_2021, CAR.IONIQ_HEV_2022, CAR.SANTA_FE_HEV_2022, CAR.SANTA_FE_PHEV_2022): + values["CF_Lkas_LdwsActivemode"] = int(left_lane) + (int(right_lane) << 1) + values["CF_Lkas_LdwsOpt_USM"] = 2 + + # FcwOpt_USM 5 = Orange blinking car + lanes + # FcwOpt_USM 4 = Orange car + lanes + # FcwOpt_USM 3 = Green blinking car + lanes + # FcwOpt_USM 2 = Green car + lanes + # FcwOpt_USM 1 = White car + lanes + # FcwOpt_USM 0 = No car + lanes + values["CF_Lkas_FcwOpt_USM"] = 2 if enabled else 1 + + # SysWarning 4 = keep hands on wheel + # SysWarning 5 = keep hands on wheel (red) + # SysWarning 6 = keep hands on wheel (red) + beep + # Note: the warning is hidden while the blinkers are on + values["CF_Lkas_SysWarning"] = 4 if sys_warning else 0 + + elif car_fingerprint == CAR.HYUNDAI_GENESIS: + # This field is actually LdwsActivemode + # Genesis and Optima fault when forwarding while engaged + values["CF_Lkas_LdwsActivemode"] = 2 + elif car_fingerprint == CAR.KIA_OPTIMA: + values["CF_Lkas_LdwsActivemode"] = 0 + + dat = packer.make_can_msg("LKAS11", 0, values)[2] + + if car_fingerprint in CHECKSUM["crc8"]: + # CRC Checksum as seen on 2019 Hyundai Santa Fe + dat = dat[:6] + dat[7:8] + checksum = hyundai_checksum(dat) + elif car_fingerprint in CHECKSUM["6B"]: + # Checksum of first 6 Bytes, as seen on 2018 Kia Sorento + checksum = sum(dat[:6]) % 256 + else: + # Checksum of first 6 Bytes and last Byte as seen on 2018 Kia Stinger + checksum = (sum(dat[:6]) + dat[7]) % 256 + + values["CF_Lkas_Chksum"] = checksum + + return packer.make_can_msg("LKAS11", 0, values) + + +def create_clu11(packer, frame, clu11, button): + values = clu11 + values["CF_Clu_CruiseSwState"] = button + values["CF_Clu_AliveCnt1"] = frame % 0x10 + return packer.make_can_msg("CLU11", 0, values) + + +def create_lfahda_mfc(packer, enabled, hda_set_speed=0): + values = { + "LFA_Icon_State": 2 if enabled else 0, + "HDA_Active": 1 if hda_set_speed else 0, + "HDA_Icon_State": 2 if hda_set_speed else 0, + "HDA_VSetReq": hda_set_speed, + } + return packer.make_can_msg("LFAHDA_MFC", 0, values) + +def create_acc_commands(packer, enabled, accel, jerk, idx, lead_visible, set_speed, stopping): + commands = [] + + scc11_values = { + "MainMode_ACC": 1, + "TauGapSet": 4, + "VSetDis": set_speed if enabled else 0, + "AliveCounterACC": idx % 0x10, + "ObjValid": 1 if lead_visible else 0, + "ACC_ObjStatus": 1 if lead_visible else 0, + "ACC_ObjLatPos": 0, + "ACC_ObjRelSpd": 0, + "ACC_ObjDist": 0, + } + commands.append(packer.make_can_msg("SCC11", 0, scc11_values)) + + scc12_values = { + "ACCMode": 1 if enabled else 0, + "StopReq": 1 if enabled and stopping else 0, + "aReqRaw": accel if enabled else 0, + "aReqValue": accel if enabled else 0, # stock ramps up and down respecting jerk limit until it reaches aReqRaw + "CR_VSM_Alive": idx % 0xF, + } + scc12_dat = packer.make_can_msg("SCC12", 0, scc12_values)[2] + scc12_values["CR_VSM_ChkSum"] = 0x10 - sum(sum(divmod(i, 16)) for i in scc12_dat) % 0x10 + + commands.append(packer.make_can_msg("SCC12", 0, scc12_values)) + + scc14_values = { + "ComfortBandUpper": 0.0, # stock usually is 0 but sometimes uses higher values + "ComfortBandLower": 0.0, # stock usually is 0 but sometimes uses higher values + "JerkUpperLimit": max(jerk, 1.0) if (enabled and not stopping) else 0, # stock usually is 1.0 but sometimes uses higher values + "JerkLowerLimit": max(-jerk, 1.0) if enabled else 0, # stock usually is 0.5 but sometimes uses higher values + "ACCMode": 1 if enabled else 4, # stock will always be 4 instead of 0 after first disengage + "ObjGap": 2 if lead_visible else 0, # 5: >30, m, 4: 25-30 m, 3: 20-25 m, 2: < 20 m, 0: no lead + } + commands.append(packer.make_can_msg("SCC14", 0, scc14_values)) + + fca11_values = { + # seems to count 2,1,0,3,2,1,0,3,2,1,0,3,2,1,0,repeat... + # (where first value is aligned to Supplemental_Counter == 0) + # test: [(idx % 0xF, -((idx % 0xF) + 2) % 4) for idx in range(0x14)] + "CR_FCA_Alive": ((-((idx % 0xF) + 2) % 4) << 2) + 1, + "Supplemental_Counter": idx % 0xF, + "PAINT1_Status": 1, + "FCA_DrvSetStatus": 1, + "FCA_Status": 1, # AEB disabled + } + fca11_dat = packer.make_can_msg("FCA11", 0, fca11_values)[2] + fca11_values["CR_FCA_ChkSum"] = 0x10 - sum(sum(divmod(i, 16)) for i in fca11_dat) % 0x10 + commands.append(packer.make_can_msg("FCA11", 0, fca11_values)) + + return commands + +def create_acc_opt(packer): + commands = [] + + scc13_values = { + "SCCDrvModeRValue": 2, + "SCC_Equip": 1, + "Lead_Veh_Dep_Alert_USM": 2, + } + commands.append(packer.make_can_msg("SCC13", 0, scc13_values)) + + fca12_values = { + "FCA_DrvSetState": 2, + "FCA_USM": 1, # AEB disabled + } + commands.append(packer.make_can_msg("FCA12", 0, fca12_values)) + + return commands + +def create_frt_radar_opt(packer): + frt_radar11_values = { + "CF_FCA_Equip_Front_Radar": 1, + } + return packer.make_can_msg("FRT_RADAR11", 0, frt_radar11_values) diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py new file mode 100644 index 000000000..822a99ae6 --- /dev/null +++ b/selfdrive/car/hyundai/interface.py @@ -0,0 +1,359 @@ +#!/usr/bin/env python3 +from cereal import car +from panda import Panda +from common.params import Params +from selfdrive.config import Conversions as CV +from selfdrive.car.hyundai.values import CAR, EV_CAR, HYBRID_CAR, LEGACY_SAFETY_MODE_CAR, Buttons, CarControllerParams +from selfdrive.car.hyundai.radar_interface import RADAR_START_ADDR +from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config +from selfdrive.car.interfaces import CarInterfaceBase +from selfdrive.car.disable_ecu import disable_ecu + +ButtonType = car.CarState.ButtonEvent.Type +EventName = car.CarEvent.EventName + +class CarInterface(CarInterfaceBase): + @staticmethod + def get_pid_accel_limits(CP, current_speed, cruise_speed): + return CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX + + @staticmethod + def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[]): # pylint: disable=dangerous-default-value + ret = CarInterfaceBase.get_std_params(candidate, fingerprint) + + ret.carName = "hyundai" + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.hyundai, 0)] + ret.radarOffCan = RADAR_START_ADDR not in fingerprint[1] + + # WARNING: disabling radar also disables AEB (and we show the same warning on the instrument cluster as if you manually disabled AEB) + ret.openpilotLongitudinalControl = Params().get_bool("DisableRadar") and (candidate not in LEGACY_SAFETY_MODE_CAR) + + ret.pcmCruise = not ret.openpilotLongitudinalControl + + # These cars have been put into dashcam only due to both a lack of users and test coverage. + # These cars likely still work fine. Once a user confirms each car works and a test route is + # added to selfdrive/test/test_routes, we can remove it from this list. + ret.dashcamOnly = candidate in {CAR.KIA_OPTIMA_H, CAR.ELANTRA_GT_I30} + + ret.steerActuatorDelay = 0.1 # Default delay + ret.steerRateCost = 0.5 + ret.steerLimitTimer = 0.4 + tire_stiffness_factor = 1. + + ret.stoppingControl = True + ret.vEgoStopping = 1.0 + + ret.longitudinalTuning.kpV = [0.1] + ret.longitudinalTuning.kiV = [0.0] + ret.stopAccel = 0.0 + + ret.longitudinalActuatorDelayUpperBound = 1.0 # s + + if candidate in (CAR.SANTA_FE, CAR.SANTA_FE_2022, CAR.SANTA_FE_HEV_2022, CAR.SANTA_FE_PHEV_2022): + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 3982. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.766 + # Values from optimizer + ret.steerRatio = 16.55 # 13.8 is spec end-to-end + tire_stiffness_factor = 0.82 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[9., 22.], [9., 22.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2, 0.35], [0.05, 0.09]] + elif candidate in (CAR.SONATA, CAR.SONATA_HYBRID): + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 1513. + STD_CARGO_KG + ret.wheelbase = 2.84 + ret.steerRatio = 13.27 * 1.15 # 15% higher at the center seems reasonable + tire_stiffness_factor = 0.65 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + elif candidate == CAR.SONATA_LF: + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 4497. * CV.LB_TO_KG + ret.wheelbase = 2.804 + ret.steerRatio = 13.27 * 1.15 # 15% higher at the center seems reasonable + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + elif candidate == CAR.PALISADE: + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 1999. + STD_CARGO_KG + ret.wheelbase = 2.90 + ret.steerRatio = 15.6 * 1.15 + tire_stiffness_factor = 0.63 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.3], [0.05]] + elif candidate in (CAR.ELANTRA, CAR.ELANTRA_GT_I30): + ret.lateralTuning.pid.kf = 0.00006 + ret.mass = 1275. + STD_CARGO_KG + ret.wheelbase = 2.7 + ret.steerRatio = 15.4 # 14 is Stock | Settled Params Learner values are steerRatio: 15.401566348670535 + tire_stiffness_factor = 0.385 # stiffnessFactor settled on 1.0081302973865127 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + ret.minSteerSpeed = 32 * CV.MPH_TO_MS + elif candidate == CAR.ELANTRA_2021: + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = (2800. * CV.LB_TO_KG) + STD_CARGO_KG + ret.wheelbase = 2.72 + ret.steerRatio = 12.9 + tire_stiffness_factor = 0.65 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + elif candidate == CAR.ELANTRA_HEV_2021: + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = (3017. * CV.LB_TO_KG) + STD_CARGO_KG + ret.wheelbase = 2.72 + ret.steerRatio = 12.9 + tire_stiffness_factor = 0.65 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + elif candidate == CAR.HYUNDAI_GENESIS: + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 2060. + STD_CARGO_KG + ret.wheelbase = 3.01 + ret.steerRatio = 16.5 + ret.lateralTuning.init('indi') + ret.lateralTuning.indi.innerLoopGainBP = [0.] + ret.lateralTuning.indi.innerLoopGainV = [3.5] + ret.lateralTuning.indi.outerLoopGainBP = [0.] + ret.lateralTuning.indi.outerLoopGainV = [2.0] + ret.lateralTuning.indi.timeConstantBP = [0.] + ret.lateralTuning.indi.timeConstantV = [1.4] + ret.lateralTuning.indi.actuatorEffectivenessBP = [0.] + ret.lateralTuning.indi.actuatorEffectivenessV = [2.3] + ret.minSteerSpeed = 60 * CV.KPH_TO_MS + elif candidate in (CAR.KONA, CAR.KONA_EV, CAR.KONA_HEV): + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = {CAR.KONA_EV: 1685., CAR.KONA_HEV: 1425.}.get(candidate, 1275.) + STD_CARGO_KG + ret.wheelbase = 2.7 + ret.steerRatio = 13.73 * 1.15 # Spec + tire_stiffness_factor = 0.385 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + elif candidate in (CAR.IONIQ, CAR.IONIQ_EV_LTD, CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV, CAR.IONIQ_HEV_2022): + ret.lateralTuning.pid.kf = 0.00006 + ret.mass = 1490. + STD_CARGO_KG # weight per hyundai site https://www.hyundaiusa.com/ioniq-electric/specifications.aspx + ret.wheelbase = 2.7 + ret.steerRatio = 13.73 # Spec + tire_stiffness_factor = 0.385 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + if candidate not in (CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV, CAR.IONIQ_HEV_2022): + ret.minSteerSpeed = 32 * CV.MPH_TO_MS + elif candidate == CAR.VELOSTER: + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 3558. * CV.LB_TO_KG + ret.wheelbase = 2.80 + ret.steerRatio = 13.75 * 1.15 + tire_stiffness_factor = 0.5 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + + # Kia + elif candidate == CAR.KIA_SORENTO: + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 1985. + STD_CARGO_KG + ret.wheelbase = 2.78 + ret.steerRatio = 14.4 * 1.1 # 10% higher at the center seems reasonable + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + elif candidate in (CAR.KIA_NIRO_EV, CAR.KIA_NIRO_HEV, CAR.KIA_NIRO_HEV_2021): + ret.lateralTuning.pid.kf = 0.00006 + ret.mass = 1737. + STD_CARGO_KG + ret.wheelbase = 2.7 + ret.steerRatio = 13.9 if CAR.KIA_NIRO_HEV_2021 else 13.73 # Spec + tire_stiffness_factor = 0.385 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + if candidate == CAR.KIA_NIRO_HEV: + ret.minSteerSpeed = 32 * CV.MPH_TO_MS + elif candidate == CAR.KIA_SELTOS: + ret.mass = 1337. + STD_CARGO_KG + ret.wheelbase = 2.63 + ret.steerRatio = 14.56 + tire_stiffness_factor = 1 + ret.lateralTuning.init('indi') + ret.lateralTuning.indi.innerLoopGainBP = [0.] + ret.lateralTuning.indi.innerLoopGainV = [4.] + ret.lateralTuning.indi.outerLoopGainBP = [0.] + ret.lateralTuning.indi.outerLoopGainV = [3.] + ret.lateralTuning.indi.timeConstantBP = [0.] + ret.lateralTuning.indi.timeConstantV = [1.4] + ret.lateralTuning.indi.actuatorEffectivenessBP = [0.] + ret.lateralTuning.indi.actuatorEffectivenessV = [1.8] + elif candidate in (CAR.KIA_OPTIMA, CAR.KIA_OPTIMA_H): + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 3558. * CV.LB_TO_KG + ret.wheelbase = 2.80 + ret.steerRatio = 13.75 + tire_stiffness_factor = 0.5 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + elif candidate == CAR.KIA_STINGER: + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 1825. + STD_CARGO_KG + ret.wheelbase = 2.78 + ret.steerRatio = 14.4 * 1.15 # 15% higher at the center seems reasonable + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + elif candidate == CAR.KIA_FORTE: + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 3558. * CV.LB_TO_KG + ret.wheelbase = 2.80 + ret.steerRatio = 13.75 + tire_stiffness_factor = 0.5 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + elif candidate == CAR.KIA_CEED: + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 1450. + STD_CARGO_KG + ret.wheelbase = 2.65 + ret.steerRatio = 13.75 + tire_stiffness_factor = 0.5 + ret.lateralTuning.pid.kf = 0.00005 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + elif candidate == CAR.KIA_K5_2021: + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 3228. * CV.LB_TO_KG + ret.wheelbase = 2.85 + ret.steerRatio = 13.27 # 2021 Kia K5 Steering Ratio (all trims) + tire_stiffness_factor = 0.5 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + + # Genesis + elif candidate == CAR.GENESIS_G70: + ret.lateralTuning.init('indi') + ret.lateralTuning.indi.innerLoopGainBP = [0.] + ret.lateralTuning.indi.innerLoopGainV = [2.5] + ret.lateralTuning.indi.outerLoopGainBP = [0.] + ret.lateralTuning.indi.outerLoopGainV = [3.5] + ret.lateralTuning.indi.timeConstantBP = [0.] + ret.lateralTuning.indi.timeConstantV = [1.4] + ret.lateralTuning.indi.actuatorEffectivenessBP = [0.] + ret.lateralTuning.indi.actuatorEffectivenessV = [1.8] + ret.steerActuatorDelay = 0.1 + ret.mass = 1640.0 + STD_CARGO_KG + ret.wheelbase = 2.84 + ret.steerRatio = 13.56 + elif candidate == CAR.GENESIS_G70_2020: + ret.lateralTuning.pid.kf = 0. + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.112], [0.004]] + ret.mass = 3673.0 * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.83 + ret.steerRatio = 12.9 + elif candidate == CAR.GENESIS_G80: + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 2060. + STD_CARGO_KG + ret.wheelbase = 3.01 + ret.steerRatio = 16.5 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.16], [0.01]] + elif candidate == CAR.GENESIS_G90: + ret.mass = 2200 + ret.wheelbase = 3.15 + ret.steerRatio = 12.069 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.16], [0.01]] + + # these cars require a special panda safety mode due to missing counters and checksums in the messages + if candidate in LEGACY_SAFETY_MODE_CAR: + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.hyundaiLegacy)] + + # set appropriate safety param for gas signal + if candidate in HYBRID_CAR: + ret.safetyConfigs[0].safetyParam = 2 + elif candidate in EV_CAR: + ret.safetyConfigs[0].safetyParam = 1 + + ret.centerToFront = ret.wheelbase * 0.4 + + # TODO: get actual value, for now starting with reasonable value for + # civic and scaling by mass and wheelbase + ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) + + # TODO: start from empirically derived lateral slip stiffness for the civic and scale by + # mass and CG position, so all cars will have approximately similar dyn behaviors + ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, + tire_stiffness_factor=tire_stiffness_factor) + + ret.enableBsm = 0x58b in fingerprint[0] + + if ret.openpilotLongitudinalControl: + ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HYUNDAI_LONG + + return ret + + @staticmethod + def init(CP, logcan, sendcan): + if CP.openpilotLongitudinalControl: + disable_ecu(logcan, sendcan, addr=0x7d0, com_cont_req=b'\x28\x83\x01') + + def update(self, c, can_strings): + self.cp.update_strings(can_strings) + self.cp_cam.update_strings(can_strings) + + ret = self.CS.update(self.cp, self.cp_cam) + self.post_update(c,ret) + ret.canValid = self.cp.can_valid and self.cp_cam.can_valid + ret.steeringRateLimited = self.CC.steer_rate_limited if self.CC is not None else False + + events = self.create_common_events(ret, pcm_enable=self.CS.CP.pcmCruise) + + if self.CS.brake_error: + events.add(EventName.brakeUnavailable) + if self.CS.park_brake: + events.add(EventName.parkBrake) + + if self.CS.CP.openpilotLongitudinalControl: + buttonEvents = [] + + if self.CS.cruise_buttons != self.CS.prev_cruise_buttons: + be = car.CarState.ButtonEvent.new_message() + be.type = ButtonType.unknown + if self.CS.cruise_buttons != 0: + be.pressed = True + but = self.CS.cruise_buttons + else: + be.pressed = False + but = self.CS.prev_cruise_buttons + if but == Buttons.RES_ACCEL: + be.type = ButtonType.accelCruise + elif but == Buttons.SET_DECEL: + be.type = ButtonType.decelCruise + elif but == Buttons.GAP_DIST: + be.type = ButtonType.gapAdjustCruise + elif but == Buttons.CANCEL: + be.type = ButtonType.cancel + buttonEvents.append(be) + + ret.buttonEvents = buttonEvents + + for b in ret.buttonEvents: + # do enable on both accel and decel buttons + if b.type in (ButtonType.accelCruise, ButtonType.decelCruise) and not b.pressed: + events.add(EventName.buttonEnable) + # do disable on button down + if b.type == ButtonType.cancel and b.pressed: + events.add(EventName.buttonCancel) + + # low speed steer alert hysteresis logic (only for cars with steer cut off above 10 m/s) + if ret.vEgo < (self.CP.minSteerSpeed + 2.) and self.CP.minSteerSpeed > 10.: + self.low_speed_alert = True + if ret.vEgo > (self.CP.minSteerSpeed + 4.): + self.low_speed_alert = False + if self.low_speed_alert: + events.add(car.CarEvent.EventName.belowSteerSpeed) + + ret.events = events.to_msg() + self.CS.out = ret.as_reader() + return self.CS.out + + def apply(self, c): + hud_control = c.hudControl + ret = self.CC.update(c, c.enabled, self.CS, self.frame, c.actuators, + c.cruiseControl.cancel, hud_control.visualAlert, hud_control.setSpeed, hud_control.leftLaneVisible, + hud_control.rightLaneVisible, hud_control.leftLaneDepart, hud_control.rightLaneDepart) + self.frame += 1 + return ret diff --git a/selfdrive/car/hyundai/radar_interface.py b/selfdrive/car/hyundai/radar_interface.py new file mode 100644 index 000000000..0d22611fb --- /dev/null +++ b/selfdrive/car/hyundai/radar_interface.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python3 +import math + +from cereal import car +from opendbc.can.parser import CANParser +from selfdrive.car.interfaces import RadarInterfaceBase +from selfdrive.car.hyundai.values import DBC + +RADAR_START_ADDR = 0x500 +RADAR_MSG_COUNT = 32 + + +def get_radar_can_parser(CP): + if DBC[CP.carFingerprint]['radar'] is None: + return None + + signals = [] + checks = [] + + for addr in range(RADAR_START_ADDR, RADAR_START_ADDR + RADAR_MSG_COUNT): + msg = f"RADAR_TRACK_{addr:x}" + signals += [ + ("STATE", msg), + ("AZIMUTH", msg), + ("LONG_DIST", msg), + ("REL_ACCEL", msg), + ("REL_SPEED", msg), + ] + checks += [(msg, 50)] + return CANParser(DBC[CP.carFingerprint]['radar'], signals, checks, 1) + + +class RadarInterface(RadarInterfaceBase): + def __init__(self, CP): + super().__init__(CP) + self.updated_messages = set() + self.trigger_msg = RADAR_START_ADDR + RADAR_MSG_COUNT - 1 + self.track_id = 0 + + self.radar_off_can = CP.radarOffCan + self.rcp = get_radar_can_parser(CP) + + def update(self, can_strings): + if self.radar_off_can or (self.rcp is None): + return super().update(None) + + vls = self.rcp.update_strings(can_strings) + self.updated_messages.update(vls) + + if self.trigger_msg not in self.updated_messages: + return None + + rr = self._update(self.updated_messages) + self.updated_messages.clear() + + return rr + + def _update(self, updated_messages): + ret = car.RadarData.new_message() + if self.rcp is None: + return ret + + errors = [] + + if not self.rcp.can_valid: + errors.append("canError") + ret.errors = errors + + for addr in range(RADAR_START_ADDR, RADAR_START_ADDR + RADAR_MSG_COUNT): + msg = self.rcp.vl[f"RADAR_TRACK_{addr:x}"] + + if addr not in self.pts: + self.pts[addr] = car.RadarData.RadarPoint.new_message() + self.pts[addr].trackId = self.track_id + self.track_id += 1 + + valid = msg['STATE'] in (3, 4) + if valid: + azimuth = math.radians(msg['AZIMUTH']) + self.pts[addr].measured = True + self.pts[addr].dRel = math.cos(azimuth) * msg['LONG_DIST'] + self.pts[addr].yRel = 0.5 * -math.sin(azimuth) * msg['LONG_DIST'] + self.pts[addr].vRel = msg['REL_SPEED'] + self.pts[addr].aRel = msg['REL_ACCEL'] + self.pts[addr].yvRel = float('nan') + + else: + del self.pts[addr] + + ret.points = list(self.pts.values()) + return ret diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py new file mode 100644 index 000000000..5563845bf --- /dev/null +++ b/selfdrive/car/hyundai/values.py @@ -0,0 +1,1066 @@ +from cereal import car +from selfdrive.car import dbc_dict +Ecu = car.CarParams.Ecu + +# Steer torque limits +class CarControllerParams: + ACCEL_MIN = -3.5 # m/s + ACCEL_MAX = 2.0 # m/s + + def __init__(self, CP): + # To determine the limit for your car, find the maximum value that the stock LKAS will request. + # If the max stock LKAS request is <384, add your car to this list. + if CP.carFingerprint in (CAR.GENESIS_G80, CAR.GENESIS_G90, CAR.ELANTRA, CAR.HYUNDAI_GENESIS, CAR.ELANTRA_GT_I30, CAR.IONIQ, + CAR.IONIQ_EV_LTD, CAR.IONIQ_PHEV, CAR.SANTA_FE_PHEV_2022, CAR.SONATA_LF, CAR.KIA_FORTE, CAR.KIA_NIRO_HEV, + CAR.KIA_NIRO_HEV_2021, CAR.KIA_OPTIMA_H, CAR.KIA_OPTIMA, CAR.KIA_SORENTO, CAR.KIA_STINGER): + self.STEER_MAX = 255 + else: + self.STEER_MAX = 384 + self.STEER_DELTA_UP = 3 + self.STEER_DELTA_DOWN = 7 + self.STEER_DRIVER_ALLOWANCE = 50 + self.STEER_DRIVER_MULTIPLIER = 2 + self.STEER_DRIVER_FACTOR = 1 + +class CAR: + # Hyundai + ELANTRA = "HYUNDAI ELANTRA 2017" + ELANTRA_2021 = "HYUNDAI ELANTRA 2021" + ELANTRA_HEV_2021 = "HYUNDAI ELANTRA HYBRID 2021" + ELANTRA_GT_I30 = "HYUNDAI I30 N LINE 2019 & GT 2018 DCT" + HYUNDAI_GENESIS = "HYUNDAI GENESIS 2015-2016" + IONIQ = "HYUNDAI IONIQ HYBRID 2017-2019" + IONIQ_HEV_2022 = "HYUNDAI IONIQ HYBRID 2020-2022" + IONIQ_EV_LTD = "HYUNDAI IONIQ ELECTRIC LIMITED 2019" + IONIQ_EV_2020 = "HYUNDAI IONIQ ELECTRIC 2020" + IONIQ_PHEV = "HYUNDAI IONIQ PHEV 2020" + KONA = "HYUNDAI KONA 2020" + KONA_EV = "HYUNDAI KONA ELECTRIC 2019" + KONA_HEV = "HYUNDAI KONA HYBRID 2020" + SANTA_FE = "HYUNDAI SANTA FE 2019" + SANTA_FE_2022 = "HYUNDAI SANTA FE 2022" + SANTA_FE_HEV_2022 = "HYUNDAI SANTA FE HYBRID 2022" + SANTA_FE_PHEV_2022 = "HYUNDAI SANTA FE PlUG-IN HYBRID 2022" + SONATA = "HYUNDAI SONATA 2020" + SONATA_LF = "HYUNDAI SONATA 2019" + PALISADE = "HYUNDAI PALISADE 2020" + VELOSTER = "HYUNDAI VELOSTER 2019" + SONATA_HYBRID = "HYUNDAI SONATA HYBRID 2021" + + # Kia + KIA_FORTE = "KIA FORTE E 2018 & GT 2021" + KIA_K5_2021 = "KIA K5 2021" + KIA_NIRO_EV = "KIA NIRO EV 2020" + KIA_NIRO_HEV = "KIA NIRO HYBRID 2019" + KIA_NIRO_HEV_2021 = "KIA NIRO HYBRID 2021" + KIA_OPTIMA = "KIA OPTIMA SX 2019 & 2016" + KIA_OPTIMA_H = "KIA OPTIMA HYBRID 2017 & SPORTS 2019" + KIA_SELTOS = "KIA SELTOS 2021" + KIA_SORENTO = "KIA SORENTO GT LINE 2018" + KIA_STINGER = "KIA STINGER GT2 2018" + KIA_CEED = "KIA CEED INTRO ED 2019" + + # Genesis + GENESIS_G70 = "GENESIS G70 2018" + GENESIS_G70_2020 = "GENESIS G70 2020" + GENESIS_G80 = "GENESIS G80 2017" + GENESIS_G90 = "GENESIS G90 2017" + + +class Buttons: + NONE = 0 + RES_ACCEL = 1 + SET_DECEL = 2 + GAP_DIST = 3 + CANCEL = 4 + +FINGERPRINTS = { + CAR.ELANTRA: [{ + 66: 8, 67: 8, 68: 8, 127: 8, 273: 8, 274: 8, 275: 8, 339: 8, 356: 4, 399: 8, 512: 6, 544: 8, 593: 8, 608: 8, 688: 5, 790: 8, 809: 8, 897: 8, 832: 8, 899: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1170: 8, 1265: 4, 1280: 1, 1282: 4, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1314: 8, 1322: 8, 1345: 8, 1349: 8, 1351: 8, 1353: 8, 1363: 8, 1366: 8, 1367: 8, 1369: 8, 1407: 8, 1415: 8, 1419: 8, 1425: 2, 1427: 6, 1440: 8, 1456: 4, 1472: 8, 1486: 8, 1487: 8, 1491: 8, 1530: 8, 1532: 5, 2001: 8, 2003: 8, 2004: 8, 2009: 8, 2012: 8, 2016: 8, 2017: 8, 2024: 8, 2025: 8 + }], + CAR.ELANTRA_GT_I30: [{ + 66: 8, 67: 8, 68: 8, 127: 8, 128: 8, 129: 8, 273: 8, 274: 8, 275: 8, 339: 8, 354: 3, 356: 4, 399: 8, 512: 6, 544: 8, 593: 8, 608: 8, 688: 5, 790: 8, 809: 8, 884: 8, 897: 8, 899: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1151: 6, 1168: 7, 1170: 8, 1193: 8, 1265: 4, 1280: 1, 1282: 4, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1345: 8, 1348: 8, 1349: 8, 1351: 8, 1353: 8, 1356: 8, 1363: 8, 1365: 8, 1366: 8, 1367: 8, 1369: 8, 1407: 8, 1414: 3, 1415: 8, 1427: 6, 1440: 8, 1456: 4, 1470: 8, 1486: 8, 1487: 8, 1491: 8, 1530: 8, 1952: 8, 1960: 8, 1988: 8, 2000: 8, 2001: 8, 2005: 8, 2008: 8, 2009: 8, 2013: 8, 2017: 8, 2025: 8 + }, + { + 66: 8, 67: 8, 68: 8, 127: 8, 128: 8, 129: 8, 273: 8, 274: 8, 275: 8, 339: 8, 354: 3, 356: 4, 399: 8, 512: 6, 544: 8, 593: 8, 608: 8, 688: 5, 790: 8, 809: 8, 832: 8, 897: 8, 899: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1151: 6, 1168: 7, 1170: 8, 1265: 4, 1280: 1, 1282: 4, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1349: 8, 1351: 8, 1353: 8, 1356: 8, 1363: 8, 1366: 8, 1367: 8, 1369: 8, 1407: 8, 1414: 3, 1415: 8, 1419: 8, 1440: 8, 1456: 4, 1470: 8, 1486: 8, 1487: 8, 1491: 8, 1530: 8 + }, + { + 66: 8, 67: 8, 68: 8, 127: 8, 128: 8, 129: 8, 273: 8, 274: 8, 275: 8, 339: 8, 354: 3, 356: 4, 399: 8, 512: 6, 544: 8, 593: 8, 608: 8, 688: 5, 790: 8, 809: 8, 832: 8, 897: 8, 899: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1151: 6, 1168: 7, 1170: 8, 1265: 4, 1280: 1, 1282: 4, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1349: 8, 1351: 8, 1353: 8, 1356: 8, 1363: 8, 1366: 8, 1367: 8, 1369: 8, 1407: 8, 1414: 3, 1419: 8, 1427: 6, 1440: 8, 1456: 4, 1470: 8, 1486: 8, 1487: 8, 1491: 8, 1960: 8, 1990: 8, 1998: 8, 2000: 8, 2001: 8, 2004: 8, 2005: 8, 2008: 8, 2009: 8, 2012: 8, 2013: 8, 2015: 8, 2016: 8, 2017: 8, 2024: 8, 2025: 8 + }], + CAR.HYUNDAI_GENESIS: [{ + 67: 8, 68: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 7, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 5, 897: 8, 902: 8, 903: 6, 916: 8, 1024: 2, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1287: 4, 1292: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1334: 8, 1335: 8, 1342: 6, 1345: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1378: 4, 1384: 5, 1407: 8, 1419: 8, 1427: 6, 1434: 2, 1456: 4 + }, + { + 67: 8, 68: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 7, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 5, 897: 8, 902: 8, 903: 6, 916: 8, 1024: 2, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1281: 3, 1287: 4, 1292: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1334: 8, 1335: 8, 1345: 8, 1363: 8, 1369: 8, 1370: 8, 1378: 4, 1379: 8, 1384: 5, 1407: 8, 1419: 8, 1427: 6, 1434: 2, 1456: 4 + }, + { + 67: 8, 68: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 7, 593: 8, 608: 8, 688: 5, 809: 8, 854: 7, 870: 7, 871: 8, 872: 5, 897: 8, 902: 8, 903: 6, 912: 7, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1268: 8, 1280: 1, 1281: 3, 1287: 4, 1292: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1334: 8, 1335: 8, 1345: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1378: 4, 1384: 5, 1407: 8, 1419: 8, 1427: 6, 1434: 2, 1437: 8, 1456: 4 + }, + { + 67: 8, 68: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 7, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 5, 897: 8, 902: 8, 903: 6, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1287: 4, 1292: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1334: 8, 1335: 8, 1345: 8, 1363: 8, 1369: 8, 1370: 8, 1378: 4, 1379: 8, 1384: 5, 1407: 8, 1425: 2, 1427: 6, 1437: 8, 1456: 4 + }, + { + 67: 8, 68: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 7, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 5, 897: 8, 902: 8, 903: 6, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1287: 4, 1292: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1334: 8, 1335: 8, 1345: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1378: 4, 1384: 5, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1437: 8, 1456: 4 + }], + CAR.SANTA_FE: [{ + 67: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 593: 8, 608: 8, 688: 6, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1155: 8, 1156: 8, 1162: 8, 1164: 8, 1168: 7, 1170: 8, 1173: 8, 1183: 8, 1186: 2, 1191: 2, 1227: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1379: 8, 1384: 8, 1407: 8, 1414: 3, 1419: 8, 1427: 6, 1456: 4, 1470: 8 + }, + { + 67: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 593: 8, 608: 8, 688: 6, 764: 8, 809: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1064: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1155: 8, 1162: 8, 1164: 8, 1168: 7, 1170: 8, 1173: 8, 1180: 8, 1183: 8, 1186: 2, 1227: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 8, 1384: 8, 1407: 8, 1414: 3, 1419: 8, 1427: 6, 1456: 4, 1470: 8, 1988: 8, 2000: 8, 2004: 8, 2008: 8, 2012: 8 + }, + { + 67: 8, 68: 8, 80: 4, 160: 8, 161: 8, 272: 8, 288: 4, 339: 8, 356: 8, 357: 8, 399: 8, 544: 8, 608: 8, 672: 8, 688: 5, 704: 1, 790: 8, 809: 8, 848: 8, 880: 8, 898: 8, 900: 8, 901: 8, 904: 8, 1056: 8, 1064: 8, 1065: 8, 1072: 8, 1075: 8, 1087: 8, 1088: 8, 1151: 8, 1200: 8, 1201: 8, 1232: 4, 1264: 8, 1265: 8, 1266: 8, 1296: 8, 1306: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1348: 8, 1349: 8, 1369: 8, 1370: 8, 1371: 8, 1407: 8, 1415: 8, 1419: 8, 1440: 8, 1442: 4, 1461: 8, 1470: 8 + }], + CAR.SONATA: [ + {67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 546: 8, 549: 8, 550: 8, 576: 8, 593: 8, 608: 8, 688: 6, 809: 8, 832: 8, 854: 8, 865: 8, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 905: 8, 908: 8, 909: 8, 912: 7, 913: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1089: 5, 1096: 8, 1107: 5, 1108: 8, 1114: 8, 1136: 8, 1145: 8, 1151: 8, 1155: 8, 1156: 8, 1157: 4, 1162: 8, 1164: 8, 1168: 8, 1170: 8, 1173: 8, 1180: 8, 1183: 8, 1184: 8, 1186: 2, 1191: 2, 1193: 8, 1210: 8, 1225: 8, 1227: 8, 1265: 4, 1268: 8, 1280: 8, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1330: 8, 1339: 8, 1342: 6, 1343: 8, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 8, 1379: 8, 1384: 8, 1394: 8, 1407: 8, 1419: 8, 1427: 6, 1446: 8, 1456: 4, 1460: 8, 1470: 8, 1485: 8, 1504: 3, 1988: 8, 1996: 8, 2000: 8, 2004: 8, 2008: 8, 2012: 8, 2015: 8}, + ], + CAR.SONATA_LF: [ + {66: 8, 67: 8, 68: 8, 127: 8, 273: 8, 274: 8, 275: 8, 339: 8, 356: 4, 399: 8, 447: 8, 512: 6, 544: 8, 593: 8, 608: 8, 688: 5, 790: 8, 809: 8, 832: 8, 884: 8, 897: 8, 899: 8, 902: 8, 903: 6, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1151: 6, 1168: 7, 1170: 8, 1253: 8, 1254: 8, 1255: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1314: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1342: 6, 1345: 8, 1348: 8, 1349: 8, 1351: 8, 1353: 8, 1363: 8, 1365: 8, 1366: 8, 1367: 8, 1369: 8, 1397: 8, 1407: 8, 1415: 8, 1419: 8, 1425: 2, 1427: 6, 1440: 8, 1456: 4, 1470: 8, 1472: 8, 1486: 8, 1487: 8, 1491: 8, 1530: 8, 1532: 5, 2000: 8, 2001: 8, 2004: 8, 2005: 8, 2008: 8, 2009: 8, 2012: 8, 2013: 8, 2014: 8, 2016: 8, 2017: 8, 2024: 8, 2025: 8}, + ], + CAR.KIA_OPTIMA: [{ + 64: 8, 66: 8, 67: 8, 68: 8, 127: 8, 128: 8, 129: 8, 273: 8, 274: 8, 275: 8, 339: 8, 354: 3, 356: 4, 399: 8, 447: 8, 512: 6, 544: 8, 558: 8, 593: 8, 608: 8, 640: 8, 688: 5, 790: 8, 809: 8, 832: 8, 884: 8, 897: 8, 899: 8, 902: 8, 903: 6, 909: 8, 912: 7, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1151: 6, 1168: 7, 1170: 8, 1186: 2, 1191: 2, 1253: 8, 1254: 8, 1255: 8, 1265: 4, 1268: 8, 1280: 1, 1282: 4, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1342: 6, 1345: 8, 1348: 8, 1349: 8, 1351: 8, 1353: 8, 1356: 8, 1363: 8, 1365: 8, 1366: 8, 1367: 8, 1369: 8, 1407: 8, 1414: 3, 1415: 8, 1419: 8, 1425: 2, 1427: 6, 1440: 8, 1456: 4, 1470: 8, 1472: 8, 1486: 8, 1487: 8, 1491: 8, 1492: 8, 1530: 8, 1532: 5, 1792: 8, 1872: 8, 1937: 8, 1953: 8, 1968: 8, 1988: 8, 1996: 8, 2000: 8, 2001: 8, 2004: 8, 2008: 8, 2009: 8, 2012: 8, 2015: 8, 2016: 8, 2017: 8, 2024: 8, 2025: 8, 1371: 8, 1397: 8, 1961: 8 + }], + CAR.KIA_SORENTO: [{ + 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1064: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1384: 8, 1407: 8, 1411: 8, 1419: 8, 1425: 2, 1427: 6, 1444: 8, 1456: 4, 1470: 8, 1489: 1 + }], + CAR.KIA_STINGER: [{ + 67: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 358: 6, 359: 8, 544: 8, 576: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1064: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1281: 4, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 4, 1379: 8, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1456: 4, 1470: 8 + }], + CAR.GENESIS_G80: [{ + 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 358: 6, 544: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1024: 2, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1156: 8, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1191: 2, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1378: 4, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1434: 2, 1456: 4, 1470: 8 + }, + { + 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 358: 6, 359: 8, 544: 8, 546: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1064: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1156: 8, 1157: 4, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1281: 3, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1378: 4, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1434: 2, 1437: 8, 1456: 4, 1470: 8 + }, + { + 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 358: 6, 544: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1064: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1156: 8, 1157: 4, 1162: 8, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1193: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 4, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1437: 8, 1456: 4, 1470: 8 + }], + CAR.GENESIS_G90: [{ + 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 358: 6, 359: 8, 544: 8, 593: 8, 608: 8, 688: 5, 809: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1162: 4, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1281: 3, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1378: 4, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1434: 2, 1456: 4, 1470: 8, 1988: 8, 2000: 8, 2003: 8, 2004: 8, 2005: 8, 2008: 8, 2011: 8, 2012: 8, 2013: 8 + }], + CAR.IONIQ_EV_2020: [{ + 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 524: 8, 544: 7, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8, 1151: 6, 1155: 8, 1156: 8, 1157: 4, 1164: 8, 1168: 7, 1173: 8, 1183: 8, 1186: 2, 1191: 2, 1225: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1379: 8, 1407: 8, 1419: 8, 1426: 8, 1427: 6, 1429: 8, 1430: 8, 1456: 4, 1470: 8, 1473: 8, 1507: 8, 1535: 8, 1988: 8, 1996: 8, 2000: 8, 2004: 8, 2005: 8, 2008: 8, 2012: 8, 2013: 8 + }], + CAR.IONIQ: [{ + 68:8, 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 524: 8, 544: 8, 576:8, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 6, 1151: 6, 1155: 8, 1156: 8, 1157: 4, 1164: 8, 1168: 7, 1173: 8, 1183: 8, 1186: 2, 1191: 2, 1225: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1379: 8, 1407: 8, 1419: 8, 1426: 8, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470: 8, 1473: 8, 1476: 8, 1507: 8, 1535: 8, 1988: 8, 1996: 8, 2000: 8, 2004: 8, 2005: 8, 2008: 8, 2012: 8, 2013: 8 + }], + CAR.KONA_EV: [{ + 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 549: 8, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8, 1151: 6, 1168: 7, 1173: 8, 1183: 8, 1186: 2, 1191: 2, 1225: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1307: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1378: 4, 1407: 8, 1419: 8, 1426: 8, 1427: 6, 1429: 8, 1430: 8, 1456: 4, 1470: 8, 1473: 8, 1507: 8, 1535: 8, 2000: 8, 2004: 8, 2008: 8, 2012: 8, 1157: 4, 1193: 8, 1379: 8, 1988: 8, 1996: 8 + }], + CAR.KIA_NIRO_EV: [{ + 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 516: 8, 544: 8, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8, 1151: 6, 1156: 8, 1157: 4, 1168: 7, 1173: 8, 1183: 8, 1186: 2, 1191: 2, 1193: 8, 1225: 8, 1260: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1407: 8, 1419: 8, 1426: 8, 1427: 6, 1429: 8, 1430: 8, 1456: 4, 1470: 8, 1473: 8, 1507: 8, 1535: 8, 1990: 8, 1998: 8, 1996: 8, 2000: 8, 2004: 8, 2008: 8, 2012: 8, 2015: 8 + }], + CAR.KIA_OPTIMA_H: [{ + 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 6, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 6, 1151: 6, 1168: 7, 1173: 8, 1236: 2, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1371: 8, 1407: 8, 1419: 8, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470: 8, 1476: 8, 1535: 8 + }, + { + 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 576: 8, 593: 8, 688: 5, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 909: 8, 912: 7, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 6, 1151: 6, 1168: 7, 1173: 8, 1180: 8, 1186: 2, 1191: 2, 1265: 4, 1268: 8, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1371: 8, 1407: 8, 1419: 8, 1420: 8, 1425: 2, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470: 8, 1476: 8, 1535: 8 + }], + CAR.PALISADE: [{ + 67: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 546: 8, 547: 8, 548: 8, 549: 8, 576: 8, 593: 8, 608: 8, 688: 6, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 913: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1064: 8, 1078: 4, 1107: 5, 1123: 8, 1136: 8, 1151: 6, 1155: 8, 1156: 8, 1157: 4, 1162: 8, 1164: 8, 1168: 7, 1170: 8, 1173: 8, 1180: 8, 1186: 2, 1191: 2, 1193: 8, 1210: 8, 1225: 8, 1227: 8, 1265: 4, 1280: 8, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 8, 1384: 8, 1407: 8, 1419: 8, 1427: 6, 1456: 4, 1470: 8, 1988: 8, 1996: 8, 2000: 8, 2004: 8, 2005: 8, 2008: 8, 2012: 8 + }], +} + + +FW_VERSIONS = { + CAR.IONIQ: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00AEhe SCC H-CUP 1.01 1.01 96400-G2000 ', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00AE MDPS C 1.00 1.07 56310/G2301 4AEHC107', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00AEH MFC AT EUR LHD 1.00 1.00 95740-G2400 180222', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x816H6F2051\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x816U3H1051\x00\x00\xf1\x006U3H0_C2\x00\x006U3H1051\x00\x00HAE0G16US2\x00\x00\x00\x00', + ], + }, + CAR.IONIQ_PHEV: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\000AEhe SCC FHCUP 1.00 1.02 99110-G2100 ', + b'\xf1\x00AEhe SCC F-CUP 1.00 1.00 99110-G2200 ', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\000AE MDPS C 1.00 1.01 56310/G2510 4APHC101', + b'\xf1\x00AE MDPS C 1.00 1.01 56310/G2560 4APHC101', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\000AEP MFC AT USA LHD 1.00 1.01 95740-G2600 190819', + b'\xf1\x00AEP MFC AT EUR RHD 1.00 1.01 95740-G2600 190819', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x816H6F6051\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x816U3J9051\000\000\xf1\0006U3H1_C2\000\0006U3J9051\000\000PAE0G16NL0\x82zT\xd2', + b'\xf1\x816U3J8051\x00\x00\xf1\x006U3H1_C2\x00\x006U3J8051\x00\x00PAETG16UL0\x00\x00\x00\x00', + ], + }, + CAR.IONIQ_EV_2020: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00AEev SCC F-CUP 1.00 1.01 99110-G7000 ', + b'\xf1\x00AEev SCC F-CUP 1.00 1.00 99110-G7200 ', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00AE MDPS C 1.00 1.01 56310/G7310 4APEC101', + b'\xf1\x00AE MDPS C 1.00 1.01 56310/G7560 4APEC101', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00AEE MFC AT EUR LHD 1.00 1.01 95740-G2600 190819', + b'\xf1\x00AEE MFC AT EUR LHD 1.00 1.03 95740-G2500 190516', + b'\xf1\x00AEE MFC AT EUR RHD 1.00 1.01 95740-G2600 190819', + ], + }, + CAR.IONIQ_EV_LTD: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00AEev SCC F-CUP 1.00 1.00 96400-G7000 ', + b'\xf1\x00AEev SCC F-CUP 1.00 1.00 96400-G7100 ', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00AE MDPS C 1.00 1.02 56310G7300\x00 4AEEC102', + b'\xf1\x00AE MDPS C 1.00 1.04 56310/G7501 4AEEC104', + b'\xf1\x00AE MDPS C 1.00 1.03 56310/G7300 4AEEC103', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00AEE MFC AT EUR LHD 1.00 1.00 95740-G7200 160418', + b'\xf1\x00AEE MFC AT USA LHD 1.00 1.00 95740-G2400 180222', + b'\xf1\x00AEE MFC AT EUR LHD 1.00 1.00 95740-G2300 170703', + ], + }, + CAR.IONIQ_HEV_2022: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00AEhe SCC F-CUP 1.00 1.00 99110-G2600 ', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00AE MDPS C 1.00 1.01 56310G2510\x00 4APHC101', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00AEH MFC AT USA LHD 1.00 1.00 95740-G2700 201027', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x816H6G5051\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x816U3J9051\x00\x00\xf1\x006U3H1_C2\x00\x006U3J9051\x00\x00HAE0G16NL2\x00\x00\x00\x00', + ], + }, + CAR.SONATA: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00DN8 1.00 99110-L0000 \xaa\xaa\xaa\xaa\xaa\xaa\xaa ', + b'\xf1\x00DN8 1.00 99110-L0000 \xaa\xaa\xaa\xaa\xaa\xaa\xaa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'\xf1\x00DN8_ SCC F-CU- 1.00 1.00 99110-L0000 ', + b'\xf1\x00DN8_ SCC F-CUP 1.00 1.00 99110-L0000 ', + b'\xf1\x00DN8_ SCC F-CUP 1.00 1.02 99110-L1000 ', + b'\xf1\x00DN8_ SCC FHCUP 1.00 1.00 99110-L0000 ', + b'\xf1\x00DN8_ SCC FHCUP 1.00 1.01 99110-L1000 ', + b'\xf1\x00DN89110-L0000 \xaa\xaa\xaa\xaa\xaa\xaa\xaa ', + b'\xf1\x8799110L0000\xf1\x00DN8_ SCC F-CUP 1.00 1.00 99110-L0000 ', + b'\xf1\x8799110L0000\xf1\x00DN8_ SCC FHCUP 1.00 1.00 99110-L0000 ', + ], + (Ecu.esp, 0x7d1, None): [ + b'\xf1\x00DN ESC \a 106 \a\x01 58910-L0100', + b'\xf1\x00DN ESC \x01 102\x19\x04\x13 58910-L1300', + b'\xf1\x00DN ESC \x03 100 \x08\x01 58910-L0300', + b'\xf1\x00DN ESC \x06 104\x19\x08\x01 58910-L0100', + b'\xf1\x00DN ESC \x07 104\x19\x08\x01 58910-L0100', + b'\xf1\x00DN ESC \x08 103\x19\x06\x01 58910-L1300', + b'\xf1\x8758910-L0100\xf1\x00DN ESC \a 106 \a\x01 58910-L0100', + b'\xf1\x8758910-L0100\xf1\x00DN ESC \x06 104\x19\x08\x01 58910-L0100', + b'\xf1\x8758910-L0100\xf1\x00DN ESC \x06 106 \x07\x01 58910-L0100', + b'\xf1\x8758910-L0100\xf1\x00DN ESC \x07 104\x19\x08\x01 58910-L0100', + b'\xf1\x8758910-L0300\xf1\x00DN ESC \x03 100 \x08\x01 58910-L0300', + b'\xf1\x00DN ESC \x06 106 \x07\x01 58910-L0100', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x81HM6M1_0a0_F00', + b'\xf1\x82DNBVN5GMCCXXXDCA', + b'\xf1\x82DNBVN5GMCCXXXG2F', + b'\xf1\x82DNBWN5TMDCXXXG2E', + b'\xf1\x82DNCVN5GMCCXXXF0A', + b'\xf1\x82DNCVN5GMCCXXXG2B', + b'\xf1\x870\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf1\x82DNDWN5TMDCXXXJ1A', + b'\xf1\x87391162M003', + b'\xf1\x87391162M013', + b'\xf1\x87391162M023', + b'HM6M1_0a0_F00', + b'HM6M1_0a0_G20', + b'HM6M2_0a0_BD0', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00DN8 MDPS C 1.00 1.01 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 4DNAC101', + b'\xf1\x00DN8 MDPS C 1.00 1.01 56310-L0010 4DNAC101', + b'\xf1\x00DN8 MDPS C 1.00 1.01 56310L0010\x00 4DNAC101', + b'\xf1\x00DN8 MDPS R 1.00 1.00 57700-L0000 4DNAP100', + b'\xf1\x87\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf1\x00DN8 MDPS C 1.00 1.01 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 4DNAC101', + b'\xf1\x8756310-L0010\xf1\x00DN8 MDPS C 1.00 1.01 56310-L0010 4DNAC101', + b'\xf1\x8756310-L0210\xf1\x00DN8 MDPS C 1.00 1.01 56310-L0210 4DNAC101', + b'\xf1\x8756310-L1010\xf1\x00DN8 MDPS C 1.00 1.03 56310-L1010 4DNDC103', + b'\xf1\x8756310-L1030\xf1\x00DN8 MDPS C 1.00 1.03 56310-L1030 4DNDC103', + b'\xf1\x8756310L0010\x00\xf1\x00DN8 MDPS C 1.00 1.01 56310L0010\x00 4DNAC101', + b'\xf1\x8756310L0210\x00\xf1\x00DN8 MDPS C 1.00 1.01 56310L0210\x00 4DNAC101', + b'\xf1\x8757700-L0000\xf1\x00DN8 MDPS R 1.00 1.00 57700-L0000 4DNAP100', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00DN8 MFC AT KOR LHD 1.00 1.02 99211-L1000 190422', + b'\xf1\x00DN8 MFC AT RUS LHD 1.00 1.03 99211-L1000 190705', + b'\xf1\x00DN8 MFC AT USA LHD 1.00 1.00 99211-L0000 190716', + b'\xf1\x00DN8 MFC AT USA LHD 1.00 1.01 99211-L0000 191016', + b'\xf1\x00DN8 MFC AT USA LHD 1.00 1.03 99211-L0000 210603', + b'\xf1\x00DN8 MFC AT USA LHD 1.00 1.05 99211-L1000 201109', + b'\xf1\x00DN8 MFC AT USA LHD 1.00 1.06 99211-L1000 210325', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x00bcsh8p54 U913\x00\x00\x00\x00\x00\x00SDN8T16NB1\xe3\xc10\xa1', + b'\xf1\x00bcsh8p54 U913\x00\x00\x00\x00\x00\x00SDN8T16NB2\n\xdd^\xbc', + b'\xf1\x00HT6TA260BLHT6TA800A1TDN8C20KS4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'\xf1\x00HT6TA260BLHT6TA810A1TDN8M25GS0\x00\x00\x00\x00\x00\x00\xaa\x8c\xd9p', + b'\xf1\x00HT6WA250BLHT6WA910A1SDN8G25NB1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'\xf1\x00HT6WA250BLHT6WA910A1SDN8G25NB1\x00\x00\x00\x00\x00\x00\x96\xa1\xf1\x92', + b'\xf1\x00HT6WA280BLHT6WAD10A1SDN8G25NB2\x00\x00\x00\x00\x00\x00\x08\xc9O:', + b'\xf1\x00T02601BL T02730A1 VDN8T25XXX730NS5\xf7_\x92\xf5', + b'\xf1\x87954A02N060\x00\x00\x00\x00\x00\xf1\x81T02730A1 \xf1\x00T02601BL T02730A1 VDN8T25XXX730NS5\xf7_\x92\xf5', + b'\xf1\x87SAKFBA2926554GJ2VefVww\x87xwwwww\x88\x87xww\x87wTo\xfb\xffvUo\xff\x8d\x16\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SAKFBA3030524GJ2UVugww\x97yx\x88\x87\x88vw\x87gww\x87wto\xf9\xfffUo\xff\xa2\x0c\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SAKFBA3356084GJ2\x86fvgUUuWgw\x86www\x87wffvf\xb6\xcf\xfc\xffeUO\xff\x12\x19\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SAKFBA3474944GJ2ffvgwwwwg\x88\x86x\x88\x88\x98\x88ffvfeo\xfa\xff\x86fo\xff\t\xae\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SAKFBA3475714GJ2Vfvgvg\x96yx\x88\x97\x88ww\x87ww\x88\x87xs_\xfb\xffvUO\xff\x0f\xff\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALDBA3510954GJ3ww\x87xUUuWx\x88\x87\x88\x87w\x88wvfwfc_\xf9\xff\x98wO\xffl\xe0\xf1\x89HT6WA910A1\xf1\x82SDN8G25NB1\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SALDBA3573534GJ3\x89\x98\x89\x88EUuWgwvwwwwww\x88\x87xTo\xfa\xff\x86f\x7f\xffo\x0e\xf1\x89HT6WA910A1\xf1\x82SDN8G25NB1\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SALDBA3601464GJ3\x88\x88\x88\x88ffvggwvwvw\x87gww\x87wvo\xfb\xff\x98\x88\x7f\xffjJ\xf1\x89HT6WA910A1\xf1\x82SDN8G25NB1\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SALDBA3753044GJ3UUeVff\x86hwwwwvwwgvfgfvo\xf9\xfffU_\xffC\xae\xf1\x89HT6WA910A1\xf1\x82SDN8G25NB1\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SALDBA3862294GJ3vfvgvefVxw\x87\x87w\x88\x87xwwwwc_\xf9\xff\x87w\x9f\xff\xd5\xdc\xf1\x89HT6WA910A1\xf1\x82SDN8G25NB1\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SALDBA3873834GJ3fefVwuwWx\x88\x97\x88w\x88\x97xww\x87wU_\xfb\xff\x86f\x8f\xffN\x04\xf1\x89HT6WA910A1\xf1\x82SDN8G25NB1\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SALDBA4525334GJ3\x89\x99\x99\x99fevWh\x88\x86\x88fwvgw\x88\x87xfo\xfa\xffuDo\xff\xd1>\xf1\x89HT6WA910A1\xf1\x82SDN8G25NB1\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SALDBA4626804GJ3wwww\x88\x87\x88xx\x88\x87\x88wwgw\x88\x88\x98\x88\x95_\xf9\xffuDo\xff|\xe7\xf1\x89HT6WA910A1\xf1\x82SDN8G25NB1\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SALDBA4803224GJ3wwwwwvwg\x88\x88\x98\x88wwww\x87\x88\x88xu\x9f\xfc\xff\x87f\x8f\xff\xea\xea\xf1\x89HT6WA910A1\xf1\x82SDN8G25NB1\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SALDBA6212564GJ3\x87wwwUTuGg\x88\x86xx\x88\x87\x88\x87\x88\x98xu?\xf9\xff\x97f\x7f\xff\xb8\n\xf1\x89HT6WA910A1\xf1\x82SDN8G25NB1\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SALDBA6347404GJ3wwwwff\x86hx\x88\x97\x88\x88\x88\x88\x88vfgf\x88?\xfc\xff\x86Uo\xff\xec/\xf1\x89HT6WA910A1\xf1\x82SDN8G25NB1\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SALDBA6901634GJ3UUuWVeVUww\x87wwwwwvUge\x86/\xfb\xff\xbb\x99\x7f\xff]2\xf1\x89HT6WA910A1\xf1\x82SDN8G25NB1\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SALDBA7077724GJ3\x98\x88\x88\x88ww\x97ygwvwww\x87ww\x88\x87x\x87_\xfd\xff\xba\x99o\xff\x99\x01\xf1\x89HT6WA910A1\xf1\x82SDN8G25NB1\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SALFBA3525114GJ2wvwgvfvggw\x86wffvffw\x86g\x85_\xf9\xff\xa8wo\xffv\xcd\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA3624024GJ2\x88\x88\x88\x88wv\x87hx\x88\x97\x88x\x88\x97\x88ww\x87w\x86o\xfa\xffvU\x7f\xff\xd1\xec\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA3960824GJ2wwwwff\x86hffvfffffvfwfg_\xf9\xff\xa9\x88\x8f\xffb\x99\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA4011074GJ2fgvwwv\x87hw\x88\x87xww\x87wwfgvu_\xfa\xffefo\xff\x87\xc0\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA4121304GJ2x\x87xwff\x86hwwwwww\x87wwwww\x84_\xfc\xff\x98\x88\x9f\xffi\xa6\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA4195874GJ2EVugvf\x86hgwvwww\x87wgw\x86wc_\xfb\xff\x98\x88\x8f\xff\xe23\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA4625294GJ2eVefeUeVx\x88\x97\x88wwwwwwww\xa7o\xfb\xffvw\x9f\xff\xee.\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA4728774GJ2vfvg\x87vwgww\x87ww\x88\x97xww\x87w\x86_\xfb\xffeD?\xffk0\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA5129064GJ2vfvgwv\x87hx\x88\x87\x88ww\x87www\x87wd_\xfa\xffvfo\xff\x1d\x00\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA5454914GJ2\x98\x88\x88\x88\x87vwgx\x88\x87\x88xww\x87ffvf\xa7\x7f\xf9\xff\xa8w\x7f\xff\x1b\x90\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA5987784GJ2UVugDDtGx\x88\x87\x88w\x88\x87xwwwwd/\xfb\xff\x97fO\xff\xb0h\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA5987864GJ2fgvwUUuWgwvw\x87wxwwwww\x84/\xfc\xff\x97w\x7f\xff\xdf\x1d\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA6337644GJ2vgvwwv\x87hgffvwwwwwwww\x85O\xfa\xff\xa7w\x7f\xff\xc5\xfc\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA6802004GJ2UUuWUUuWgw\x86www\x87www\x87w\x96?\xf9\xff\xa9\x88\x7f\xff\x9fK\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA6892284GJ233S5\x87w\x87xx\x88\x87\x88vwwgww\x87w\x84?\xfb\xff\x98\x88\x8f\xff*\x9e\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00SDN8T16NB0z{\xd4v', + b'\xf1\x87SALFBA7005534GJ2eUuWfg\x86xxww\x87x\x88\x87\x88\x88w\x88\x87\x87O\xfc\xffuUO\xff\xa3k\xf1\x81U913\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U913\x00\x00\x00\x00\x00\x00SDN8T16NB1\xe3\xc10\xa1', + b'\xf1\x87SALFBA7152454GJ2gvwgFf\x86hx\x88\x87\x88vfWfffffd?\xfa\xff\xba\x88o\xff,\xcf\xf1\x81U913\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U913\x00\x00\x00\x00\x00\x00SDN8T16NB1\xe3\xc10\xa1', + b'\xf1\x87SALFBA7485034GJ2ww\x87xww\x87xfwvgwwwwvfgf\xa5/\xfc\xff\xa9w_\xff40\xf1\x81U913\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U913\x00\x00\x00\x00\x00\x00SDN8T16NB2\n\xdd^\xbc', + b'\xf1\x87SAMDBA7743924GJ3wwwwww\x87xgwvw\x88\x88\x88\x88wwww\x85_\xfa\xff\x86f\x7f\xff0\x9d\xf1\x89HT6WAD10A1\xf1\x82SDN8G25NB2\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SAMDBA7817334GJ3Vgvwvfvgww\x87wwwwwwfgv\x97O\xfd\xff\x88\x88o\xff\x8e\xeb\xf1\x89HT6WAD10A1\xf1\x82SDN8G25NB2\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SAMDBA8054504GJ3gw\x87xffvgffffwwwweUVUf?\xfc\xffvU_\xff\xddl\xf1\x89HT6WAD10A1\xf1\x82SDN8G25NB2\x00\x00\x00\x00\x00\x00', + b'\xf1\x87SAMFB41553621GC7ww\x87xUU\x85Xvwwg\x88\x88\x88\x88wwgw\x86\xaf\xfb\xffuDo\xff\xaa\x8f\xf1\x81U913\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U913\x00\x00\x00\x00\x00\x00SDN8T16NB2\n\xdd^\xbc', + b'\xf1\x87SAMFB42555421GC7\x88\x88\x88\x88wvwgx\x88\x87\x88wwgw\x87wxw3\x8f\xfc\xff\x98f\x8f\xffga\xf1\x81U913\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U913\x00\x00\x00\x00\x00\x00SDN8T16NB2\n\xdd^\xbc', + b'\xf1\x87SAMFBA7978674GJ2gw\x87xgw\x97ywwwwvUGeUUeU\x87O\xfb\xff\x98w\x8f\xfffF\xf1\x81U913\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U913\x00\x00\x00\x00\x00\x00SDN8T16NB2\n\xdd^\xbc', + b'\xf1\x87SAMFBA9283024GJ2wwwwEUuWwwgwwwwwwwww\x87/\xfb\xff\x98w\x8f\xff<\xd3\xf1\x81U913\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U913\x00\x00\x00\x00\x00\x00SDN8T16NB2\n\xdd^\xbc', + b'\xf1\x87SAMFBA9708354GJ2wwwwVf\x86h\x88wx\x87xww\x87\x88\x88\x88\x88w/\xfa\xff\x97w\x8f\xff\x86\xa0\xf1\x81U913\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U913\x00\x00\x00\x00\x00\x00SDN8T16NB2\n\xdd^\xbc', + ], + }, + CAR.SONATA_LF: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00LF__ SCC F-CUP 1.00 1.00 96401-C2200 ', + ], + (Ecu.esp, 0x7d1, None): [ + b'\xf1\x00LF ESC \f 11 \x17\x01\x13 58920-C2610', + b'\xf1\x00LF ESC \t 11 \x17\x01\x13 58920-C2610', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x81606D5051\x00\x00\x00\x00\x00\x00\x00\x00', + b'\xf1\x81606D5K51\x00\x00\x00\x00\x00\x00\x00\x00', + b'\xf1\x81606G1051\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00LFF LKAS AT USA LHD 1.00 1.01 95740-C1000 E51', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x006T6H0_C2\x00\x006T6B4051\x00\x00TLF0G24NL1\xb0\x9f\xee\xf5', + b'\xf1\x87\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf1\x816T6B4051\x00\x00\xf1\x006T6H0_C2\x00\x006T6B4051\x00\x00TLF0G24NL1\x00\x00\x00\x00', + b'\xf1\x87\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf1\x816T6B4051\x00\x00\xf1\x006T6H0_C2\x00\x006T6B4051\x00\x00TLF0G24NL1\xb0\x9f\xee\xf5', + b'\xf1\x87\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf1\x816T6B4051\x00\x00\xf1\x006T6H0_C2\x00\x006T6B4051\x00\x00TLF0G24SL2n\x8d\xbe\xd8', + b'\xf1\x87LAHSGN012918KF10\x98\x88x\x87\x88\x88x\x87\x88\x88\x98\x88\x87w\x88w\x88\x88\x98\x886o\xf6\xff\x98w\x7f\xff3\x00\xf1\x816W3B1051\x00\x00\xf1\x006W351_C2\x00\x006W3B1051\x00\x00TLF0T20NL2\x00\x00\x00\x00', + b'\xf1\x87LAHSGN012918KF10\x98\x88x\x87\x88\x88x\x87\x88\x88\x98\x88\x87w\x88w\x88\x88\x98\x886o\xf6\xff\x98w\x7f\xff3\x00\xf1\x816W3B1051\x00\x00\xf1\x006W351_C2\x00\x006W3B1051\x00\x00TLF0T20NL2H\r\xbdm', + ], + }, + CAR.SANTA_FE: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00TM__ SCC F-CUP 1.00 1.01 99110-S2000 ', + b'\xf1\x00TM__ SCC F-CUP 1.00 1.02 99110-S2000 ', + b'\xf1\x00TM__ SCC F-CUP 1.00 1.03 99110-S2000 ', + ], + (Ecu.esp, 0x7d1, None): [ + b'\xf1\x00TM ESC \r 100\x18\x031 58910-S2650', + b'\xf1\x00TM ESC \r 103\x18\x11\x08 58910-S2650', + b'\xf1\x00TM ESC \r 104\x19\a\b 58910-S2650', + b'\xf1\x00TM ESC \x02 100\x18\x030 58910-S2600', + b'\xf1\x00TM ESC \x02 102\x18\x07\x01 58910-S2600', + b'\xf1\x00TM ESC \x02 103\x18\x11\x07 58910-S2600', + b'\xf1\x00TM ESC \x02 104\x19\x07\x07 58910-S2600', + b'\xf1\x00TM ESC \x03 103\x18\x11\x07 58910-S2600', + b'\xf1\x00TM ESC \x0c 103\x18\x11\x08 58910-S2650', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x81606EA051\x00\x00\x00\x00\x00\x00\x00\x00', + b'\xf1\x81606G1051\x00\x00\x00\x00\x00\x00\x00\x00', + b'\xf1\x81606G3051\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00TM MDPS C 1.00 1.00 56340-S2000 8409', + b'\xf1\x00TM MDPS C 1.00 1.00 56340-S2000 8A12', + b'\xf1\x00TM MDPS C 1.00 1.01 56340-S2000 9129', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00TM MFC AT USA LHD 1.00 1.00 99211-S2000 180409', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x87LBJSGA7082574HG0\x87www\x98\x88\x88\x88\x99\xaa\xb9\x9afw\x86gx\x99\xa7\x89co\xf8\xffvU_\xffR\xaf\xf1\x816W3C2051\x00\x00\xf1\x006W351_C2\x00\x006W3C2051\x00\x00TTM2T20NS1\x00\xa6\xe0\x91', + b'\xf1\x87LBKSGA0458404HG0vfvg\x87www\x89\x99\xa8\x99y\xaa\xa7\x9ax\x88\xa7\x88t_\xf9\xff\x86w\x8f\xff\x15x\xf1\x816W3C2051\x00\x00\xf1\x006W351_C2\x00\x006W3C2051\x00\x00TTM2T20NS1\x00\x00\x00\x00', + b'\xf1\x87LDJUEA6010814HG1\x87w\x87x\x86gvw\x88\x88\x98\x88gw\x86wx\x88\x97\x88\x85o\xf8\xff\x86f_\xff\xd37\xf1\x816W3C2051\x00\x00\xf1\x006W351_C2\x00\x006W3C2051\x00\x00TTM4T20NS0\xf8\x19\x92g', + b'\xf1\x87LDJUEA6458264HG1ww\x87x\x97x\x87\x88\x88\x99\x98\x89g\x88\x86xw\x88\x97x\x86o\xf7\xffvw\x8f\xff3\x9a\xf1\x816W3C2051\x00\x00\xf1\x006W351_C2\x00\x006W3C2051\x00\x00TTM4T20NS0\xf8\x19\x92g', + b'\xf1\x87LDKUEA2045844HG1wwww\x98\x88x\x87\x88\x88\xa8\x88x\x99\x97\x89x\x88\xa7\x88U\x7f\xf8\xffvfO\xffC\x1e\xf1\x816W3E0051\x00\x00\xf1\x006W351_C2\x00\x006W3E0051\x00\x00TTM4T20NS3\x00\x00\x00\x00', + b'\xf1\x87LDKUEA9993304HG1\x87www\x97x\x87\x88\x99\x99\xa9\x99x\x99\xa7\x89w\x88\x97x\x86_\xf7\xffwwO\xffl#\xf1\x816W3C2051\x00\x00\xf1\x006W351_C2\x00\x006W3C2051\x00\x00TTM4T20NS1R\x7f\x90\n', + b'\xf1\x87LDLUEA6061564HG1\xa9\x99\x89\x98\x87wwwx\x88\x97\x88x\x99\xa7\x89x\x99\xa7\x89sO\xf9\xffvU_\xff<\xde\xf1\x816W3E1051\x00\x00\xf1\x006W351_C2\x00\x006W3E1051\x00\x00TTM4T20NS50\xcb\xc3\xed', + b'\xf1\x87LDLUEA6159884HG1\x88\x87hv\x99\x99y\x97\x89\xaa\xb8\x9ax\x99\x87\x89y\x99\xb7\x99\xa7?\xf7\xff\x97wo\xff\xf3\x05\xf1\x816W3E1051\x00\x00\xf1\x006W351_C2\x00\x006W3E1051\x00\x00TTM4T20NS5\x00\x00\x00\x00', + b'\xf1\x87LDLUEA6852664HG1\x97wWu\x97www\x89\xaa\xc8\x9ax\x99\x97\x89x\x99\xa7\x89SO\xf7\xff\xa8\x88\x7f\xff\x03z\xf1\x816W3E1051\x00\x00\xf1\x006W351_C2\x00\x006W3E1051\x00\x00TTM4T20NS50\xcb\xc3\xed', + b'\xf1\x87LDLUEA6898374HG1fevW\x87wwwx\x88\x97\x88h\x88\x96\x88x\x88\xa7\x88ao\xf9\xff\x98\x99\x7f\xffD\xe2\xf1\x816W3E1051\x00\x00\xf1\x006W351_C2\x00\x006W3E1051\x00\x00TTM4T20NS5\x00\x00\x00\x00', + b'\xf1\x87LDLUEA6898374HG1fevW\x87wwwx\x88\x97\x88h\x88\x96\x88x\x88\xa7\x88ao\xf9\xff\x98\x99\x7f\xffD\xe2\xf1\x816W3E1051\x00\x00\xf1\x006W351_C2\x00\x006W3E1051\x00\x00TTM4T20NS50\xcb\xc3\xed', + b'\xf1\x87SBJWAA5842214GG0\x88\x87\x88xww\x87x\x89\x99\xa8\x99\x88\x99\x98\x89w\x88\x87xw_\xfa\xfffU_\xff\xd1\x8d\xf1\x816W3C2051\x00\x00\xf1\x006W351_C2\x00\x006W3C2051\x00\x00TTM2G24NS1\x98{|\xe3', + b'\xf1\x87SBJWAA5890864GG0\xa9\x99\x89\x98\x98\x87\x98y\x89\x99\xa8\x99w\x88\x87xww\x87wvo\xfb\xffuD_\xff\x9f\xb5\xf1\x816W3C2051\x00\x00\xf1\x006W351_C2\x00\x006W3C2051\x00\x00TTM2G24NS1\x98{|\xe3', + b'\xf1\x87SBJWAA6562474GG0ffvgeTeFx\x88\x97\x88ww\x87www\x87w\x84o\xfa\xff\x87fO\xff\xc2 \xf1\x816W3C2051\x00\x00\xf1\x006W351_C2\x00\x006W3C2051\x00\x00TTM2G24NS1\x00\x00\x00\x00', + b'\xf1\x87SBJWAA6562474GG0ffvgeTeFx\x88\x97\x88ww\x87www\x87w\x84o\xfa\xff\x87fO\xff\xc2 \xf1\x816W3C2051\x00\x00\xf1\x006W351_C2\x00\x006W3C2051\x00\x00TTM2G24NS1\x98{|\xe3', + b'\xf1\x87SBJWAA7780564GG0wvwgUUeVwwwwx\x88\x87\x88wwwwd_\xfc\xff\x86f\x7f\xff\xd7*\xf1\x816W3C2051\x00\x00\xf1\x006W351_C2\x00\x006W3C2051\x00\x00TTM2G24NS2F\x84<\xc0', + b'\xf1\x87SBJWAA8278284GG0ffvgUU\x85Xx\x88\x87\x88x\x88w\x88ww\x87w\x96o\xfd\xff\xa7U_\xff\xf2\xa0\xf1\x816W3C2051\x00\x00\xf1\x006W351_C2\x00\x006W3C2051\x00\x00TTM2G24NS2F\x84<\xc0', + b'\xf1\x87SBLWAA4363244GG0wvwgwv\x87hgw\x86ww\x88\x87xww\x87wdo\xfb\xff\x86f\x7f\xff3$\xf1\x816W3E1051\x00\x00\xf1\x006W351_C2\x00\x006W3E1051\x00\x00TTM2G24NS6\x00\x00\x00\x00', + b'\xf1\x87SBLWAA4363244GG0wvwgwv\x87hgw\x86ww\x88\x87xww\x87wdo\xfb\xff\x86f\x7f\xff3$\xf1\x816W3E1051\x00\x00\xf1\x006W351_C2\x00\x006W3E1051\x00\x00TTM2G24NS6x0\x17\xfe', + b'\xf1\x87SBLWAA4899564GG0VfvgUU\x85Xx\x88\x87\x88vfgf\x87wxwvO\xfb\xff\x97f\xb1\xffSB\xf1\x816W3E1051\x00\x00\xf1\x006W351_C2\x00\x006W3E1051\x00\x00TTM2G24NS7\x00\x00\x00\x00', + b'\xf1\x87SBLWAA6622844GG0wwwwff\x86hwwwwx\x88\x87\x88\x88\x88\x88\x88\x98?\xfd\xff\xa9\x88\x7f\xffn\xe5\xf1\x816W3E1051\x00\x00\xf1\x006W351_C2\x00\x006W3E1051\x00\x00TTM2G24NS7u\x1e{\x1c', + b'\xf1\x87SDJXAA7656854GG1DEtWUU\x85X\x88\x88\x98\x88w\x88\x87xx\x88\x87\x88\x96o\xfb\xff\x86f\x7f\xff.\xca\xf1\x816W3C2051\x00\x00\xf1\x006W351_C2\x00\x006W3C2051\x00\x00TTM4G24NS2\x00\x00\x00\x00', + b'\xf1\x87SDJXAA7656854GG1DEtWUU\x85X\x88\x88\x98\x88w\x88\x87xx\x88\x87\x88\x96o\xfb\xff\x86f\x7f\xff.\xca\xf1\x816W3C2051\x00\x00\xf1\x006W351_C2\x00\x006W3C2051\x00\x00TTM4G24NS2K\xdaV0', + b'\xf1\x87SDKXAA2443414GG1vfvgwv\x87h\x88\x88\x88\x88ww\x87wwwww\x99_\xfc\xffvD?\xffl\xd2\xf1\x816W3E1051\x00\x00\xf1\x006W351_C2\x00\x006W3E1051\x00\x00TTM4G24NS6\x00\x00\x00\x00', + ], + }, + CAR.SANTA_FE_2022: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00TM__ SCC F-CUP 1.00 1.00 99110-S1500 ', + b'\xf1\x8799110S1500\xf1\x00TM__ SCC F-CUP 1.00 1.00 99110-S1500 ', + ], + (Ecu.esp, 0x7d1, None): [ + b'\xf1\x00TM ESC \x02 101 \x08\x04 58910-S2GA0', + b'\xf1\x00TM ESC \x03 101 \x08\x02 58910-S2DA0', + b'\xf1\x8758910-S2DA0\xf1\x00TM ESC \x03 101 \x08\x02 58910-S2DA0', + b'\xf1\x8758910-S2GA0\xf1\x00TM ESC \x02 101 \x08\x04 58910-S2GA0', + b'\xf1\x8758910-S1DA0\xf1\x00TM ESC \x1e 102 \x08\x08 58910-S1DA0', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x82TMBZN5TMD3XXXG2E', + b'\xf1\x82TACVN5GSI3XXXH0A', + b'\xf1\x82TMCFD5MMCXXXXG0A', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00TM MDPS C 1.00 1.02 56370-S2AA0 0B19', + b'\xf1\x00TM MDPS C 1.00 1.01 56310-S1AB0 4TSDC101', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00TMA MFC AT MEX LHD 1.00 1.01 99211-S2500 210205', + b'\xf1\x00TMA MFC AT USA LHD 1.00 1.00 99211-S2500 200720', + b'\xf1\x00TM MFC AT EUR LHD 1.00 1.03 99211-S1500 210224', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x00T02601BL T02730A1 VTMPT25XXX730NS2\xa6\x06\x88\xf7', + b'\xf1\x87SDMXCA8653204GN1EVugEUuWwwwwww\x87wwwwwv/\xfb\xff\xa8\x88\x9f\xff\xa5\x9c\xf1\x89HT6WAD00A1\xf1\x82STM4G25NH1\x00\x00\x00\x00\x00\x00', + b'\xf1\x87954A02N250\x00\x00\x00\x00\x00\xf1\x81T02730A1 \xf1\x00T02601BL T02730A1 VTMPT25XXX730NS2\xa6\x06\x88\xf7', + b'\xf1\x87KMMYBU034207SB72x\x89\x88\x98h\x88\x98\x89\x87fhvvfWf33_\xff\x87\xff\x8f\xfa\x81\xe5\xf1\x89HT6TAF00A1\xf1\x82STM0M25GS1\x00\x00\x00\x00\x00\x00', + ], + }, + CAR.SANTA_FE_HEV_2022: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x8799110CL500\xf1\x00TMhe SCC FHCUP 1.00 1.00 99110-CL500 ', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00TM MDPS C 1.00 1.02 56310-CLAC0 4TSHC102', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00TMH MFC AT USA LHD 1.00 1.03 99211-S1500 210224', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x87959102T250\x00\x00\x00\x00\x00\xf1\x81E14\x00\x00\x00\x00\x00\x00\x00\xf1\x00PSBG2333 E14\x00\x00\x00\x00\x00\x00\x00TTM2H16SA2\x80\xd7l\xb2', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x87391312MTC1', + ], + }, + CAR.SANTA_FE_PHEV_2022: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x8799110CL500\xf1\x00TMhe SCC FHCUP 1.00 1.00 99110-CL500 ', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00TM MDPS C 1.00 1.02 56310-CLAC0 4TSHC102', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00TMP MFC AT USA LHD 1.00 1.03 99211-S1500 210224', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x8795441-3D121\x00\xf1\x81E16\x00\x00\x00\x00\x00\x00\x00\xf1\x00PSBG2333 E16\x00\x00\x00\x00\x00\x00\x00TTM2P16SA0o\x88^\xbe', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x87391312MTF0', + ], + }, + CAR.KIA_STINGER: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00CK__ SCC F_CUP 1.00 1.01 96400-J5100 ', + b'\xf1\x00CK__ SCC F_CUP 1.00 1.03 96400-J5100 ', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x81606DE051\x00\x00\x00\x00\x00\x00\x00\x00', + b'\xf1\x81640E0051\x00\x00\x00\x00\x00\x00\x00\x00', + b'\xf1\x82CKJN3TMSDE0B\x00\x00\x00\x00', + b'\xf1\x82CKKN3TMD_H0A\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00CK MDPS R 1.00 1.04 57700-J5200 4C2CL104', + b'\xf1\x00CK MDPS R 1.00 1.04 57700-J5220 4C2VL104', + b'\xf1\x00CK MDPS R 1.00 1.04 57700-J5420 4C4VL104', + b'\xf1\x00CK MDPS R 1.00 1.06 57700-J5420 4C4VL106', + b'\xf1\x00CK MDPS R 1.00 1.07 57700-J5220 4C2VL107', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00CK MFC AT USA LHD 1.00 1.03 95740-J5000 170822', + b'\xf1\x00CK MFC AT USA LHD 1.00 1.04 95740-J5000 180504', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x87VCJLE17622572DK0vd6D\x99\x98y\x97vwVffUfvfC%CuT&Dx\x87o\xff{\x1c\xf1\x81E21\x00\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 E21\x00\x00\x00\x00\x00\x00\x00SCK0T33NB0\x88\xa2\xe6\xf0', + b'\xf1\x87VDHLG17000192DK2xdFffT\xa5VUD$DwT\x86wveVeeD&T\x99\xba\x8f\xff\xcc\x99\xf1\x81E21\x00\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 E21\x00\x00\x00\x00\x00\x00\x00SCK0T33NB0\x88\xa2\xe6\xf0', + b'\xf1\x87VDHLG17000192DK2xdFffT\xa5VUD$DwT\x86wveVeeD&T\x99\xba\x8f\xff\xcc\x99\xf1\x89E21\x00\x00\x00\x00\x00\x00\x00\xf1\x82SCK0T33NB0', + b'\xf1\x87VDHLG17034412DK2vD6DfVvVTD$D\x99w\x88\x98EDEDeT6DgfO\xff\xc3=\xf1\x81E21\x00\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 E21\x00\x00\x00\x00\x00\x00\x00SCK0T33NB0\x88\xa2\xe6\xf0', + b'\xf1\x87VDHLG17118862DK2\x8awWwgu\x96wVfUVwv\x97xWvfvUTGTx\x87o\xff\xc9\xed\xf1\x81E21\x00\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 E21\x00\x00\x00\x00\x00\x00\x00SCK0T33NB0\x88\xa2\xe6\xf0', + b'\xf1\x87VDKLJ18675252DK6\x89vhgwwwwveVU\x88w\x87w\x99vgf\x97vXfgw_\xff\xc2\xfb\xf1\x89E25\x00\x00\x00\x00\x00\x00\x00\xf1\x82TCK0T33NB2', + b'\xf1\x87WAJTE17552812CH4vfFffvfVeT5DwvvVVdFeegeg\x88\x88o\xff\x1a]\xf1\x81E21\x00\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 E21\x00\x00\x00\x00\x00\x00\x00TCK2T20NB1\x19\xd2\x00\x94', + ], + }, + CAR.PALISADE: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\000LX2_ SCC F-CUP 1.00 1.05 99110-S8100 ', + b'\xf1\x00LX2 SCC FHCUP 1.00 1.04 99110-S8100 ', + b'\xf1\x00LX2_ SCC FHCU- 1.00 1.05 99110-S8100 ', + b'\xf1\x00LX2_ SCC FHCUP 1.00 1.00 99110-S8110 ', + b'\xf1\x00LX2_ SCC FHCUP 1.00 1.04 99110-S8100 ', + b'\xf1\x00LX2_ SCC FHCUP 1.00 1.05 99110-S8100 ', + b'\xf1\x00ON__ FCA FHCUP 1.00 1.02 99110-S9100 ', + ], + (Ecu.esp, 0x7d1, None): [ + b'\xf1\x00LX ESC \x01 103\x19\t\x10 58910-S8360', + b'\xf1\x00LX ESC \x01 103\x31\t\020 58910-S8360', + b'\xf1\x00LX ESC \x0b 101\x19\x03\x17 58910-S8330', + b'\xf1\x00LX ESC \x0b 102\x19\x05\x07 58910-S8330', + b'\xf1\x00LX ESC \x0b 103\x19\t\x07 58910-S8330', + b'\xf1\x00LX ESC \x0b 103\x19\t\x10 58910-S8360', + b'\xf1\x00LX ESC \x0b 104 \x10\x16 58910-S8360', + b'\xf1\x00ON ESC \x0b 100\x18\x12\x18 58910-S9360', + b'\xf1\x00ON ESC \x0b 101\x19\t\x08 58910-S9360', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x81640J0051\x00\x00\x00\x00\x00\x00\x00\x00', + b'\xf1\x81640K0051\x00\x00\x00\x00\x00\x00\x00\x00', + b'\xf1\x81640S1051\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00LX2 MDPS C 1,00 1,03 56310-S8020 4LXDC103', # modified firmware + b'\xf1\x00LX2 MDPS C 1.00 1.03 56310-S8020 4LXDC103', + b'\xf1\x00LX2 MDPS C 1.00 1.04 56310-S8020 4LXDC104', + b'\xf1\x00ON MDPS C 1.00 1.00 56340-S9000 8B13', + b'\xf1\x00ON MDPS C 1.00 1.01 56340-S9000 9201', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00LX2 MFC AT USA LHD 1.00 1.03 99211-S8100 190125', + b'\xf1\x00LX2 MFC AT USA LHD 1.00 1.05 99211-S8100 190909', + b'\xf1\x00LX2 MFC AT USA LHD 1.00 1.07 99211-S8100 200422', + b'\xf1\x00LX2 MFC AT USA LHD 1.00 1.08 99211-S8100 200903', + b'\xf1\x00ON MFC AT USA LHD 1.00 1.01 99211-S9100 181105', + b'\xf1\x00ON MFC AT USA LHD 1.00 1.03 99211-S9100 200720', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x00bcsh8p54 U872\x00\x00\x00\x00\x00\x00TON4G38NB1\x96z28', + b'\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00TON4G38NB2[v\\\xb6', + b'\xf1\x87LBLUFN591307KF25vgvw\x97wwwy\x99\xa7\x99\x99\xaa\xa9\x9af\x88\x96h\x95o\xf7\xff\x99f/\xff\xe4c\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX2G38NB2\xd7\xc1/\xd1', + b'\xf1\x87LBLUFN650868KF36\xa9\x98\x89\x88\xa8\x88\x88\x88h\x99\xa6\x89fw\x86gw\x88\x97x\xaa\x7f\xf6\xff\xbb\xbb\x8f\xff+\x82\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX2G38NB3\xd1\xc3\xf8\xa8', + b'\xf1\x87LBLUFN655162KF36\x98\x88\x88\x88\x98\x88\x88\x88x\x99\xa7\x89x\x99\xa7\x89x\x99\x97\x89g\x7f\xf7\xffwU_\xff\xe9!\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX2G38NB3\xd1\xc3\xf8\xa8', + b'\xf1\x87LBLUFN731381KF36\xb9\x99\x89\x98\x98\x88\x88\x88\x89\x99\xa8\x99\x88\x99\xa8\x89\x88\x88\x98\x88V\177\xf6\xff\x99w\x8f\xff\xad\xd8\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\000bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX2G38NB3\xd1\xc3\xf8\xa8', + b'\xf1\x87LDKVAA0028604HH1\xa8\x88x\x87vgvw\x88\x99\xa8\x89gw\x86ww\x88\x97x\x97o\xf9\xff\x97w\x7f\xffo\x02\xf1\x81U872\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U872\x00\x00\x00\x00\x00\x00TON4G38NB1\x96z28', + b'\xf1\x87LDKVAA3068374HH1wwww\x87xw\x87y\x99\xa7\x99w\x88\x87xw\x88\x97x\x85\xaf\xfa\xffvU/\xffU\xdc\xf1\x81U872\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U872\x00\x00\x00\x00\x00\x00TON4G38NB1\x96z28', + b'\xf1\x87LDKVBN382172KF26\x98\x88\x88\x88\xa8\x88\x88\x88x\x99\xa7\x89\x87\x88\x98x\x98\x99\xa9\x89\xa5_\xf6\xffDDO\xff\xcd\x16\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB2\xafL]\xe7', + b'\xf1\x87LDKVBN424201KF26\xba\xaa\x9a\xa9\x99\x99\x89\x98\x89\x99\xa8\x99\x88\x99\x98\x89\x88\x99\xa8\x89v\x7f\xf7\xffwf_\xffq\xa6\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB2\xafL]\xe7', + b'\xf1\x87LDKVBN540766KF37\x87wgv\x87w\x87xx\x99\x97\x89v\x88\x97h\x88\x88\x88\x88x\x7f\xf6\xffvUo\xff\xd3\x01\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB2\xafL]\xe7', + b'\xf1\x87LDLVAA4225634HH1\x98\x88\x88\x88eUeVx\x88\x87\x88g\x88\x86xx\x88\x87\x88\x86o\xf9\xff\x87w\x7f\xff\xf2\xf7\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00TON4G38NB2[v\\\xb6', + b'\xf1\x87LDLVAA4777834HH1\x98\x88x\x87\x87wwwx\x88\x87\x88x\x99\x97\x89x\x88\x97\x88\x86o\xfa\xff\x86fO\xff\x1d9\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00TON4G38NB2[v\\\xb6', + b'\xf1\x87LDLVAA5194534HH1ffvguUUUx\x88\xa7\x88h\x99\x96\x89x\x88\x97\x88ro\xf9\xff\x98wo\xff\xaaM\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00TON4G38NB2[v\\\xb6', + b'\xf1\x87LDLVAA5949924HH1\xa9\x99y\x97\x87wwwx\x99\x97\x89x\x99\xa7\x89x\x99\xa7\x89\x87_\xfa\xffeD?\xff\xf1\xfd\xf1\x81U903\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U903\x00\x00\x00\x00\x00\x00TON4G38NB2[v\\\xb6', + b'\xf1\x87LDLVBN560098KF26\x86fff\x87vgfg\x88\x96xfw\x86gfw\x86g\x95\xf6\xffeU_\xff\x92c\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB2\xafL]\xe7', + b'\xf1\x87LDLVBN602045KF26\xb9\x99\x89\x98\x97vwgy\xaa\xb7\x9af\x88\x96hw\x99\xa7y\xa9\x7f\xf5\xff\x99w\x7f\xff,\xd3\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB3X\xa8\xc08', + b'\xf1\x87LDLVBN628911KF26\xa9\x99\x89\x98\x98\x88\x88\x88y\x99\xa7\x99fw\x86gw\x88\x87x\x83\x7f\xf6\xff\x98wo\xff2\xda\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB3X\xa8\xc08', + b'\xf1\x87LDLVBN645817KF37\x87www\x98\x87xwx\x99\x97\x89\x99\x99\x99\x99g\x88\x96x\xb6_\xf7\xff\x98fo\xff\xe2\x86\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB3X\xa8\xc08', + b'\xf1\x87LDLVBN662115KF37\x98\x88\x88\x88\xa8\x88\x88\x88x\x99\x97\x89x\x99\xa7\x89\x88\x99\xa8\x89\x88\x7f\xf7\xfffD_\xff\xdc\x84\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB3X\xa8\xc08', + b'\xf1\x87LDLVBN667933KF37\xb9\x99\x89\x98\xb9\x99\x99\x99x\x88\x87\x88w\x88\x87x\x88\x88\x98\x88\xcbo\xf7\xffe3/\xffQ!\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB3X\xa8\xc08', + b'\xf1\x87LDLVBN673087KF37\x97www\x86fvgx\x99\x97\x89\x99\xaa\xa9\x9ag\x88\x86x\xe9_\xf8\xff\x98w\x7f\xff"\xad\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB3X\xa8\xc08', + b'\xf1\x87LDLVBN673841KF37\x98\x88x\x87\x86g\x86xy\x99\xa7\x99\x88\x99\xa8\x89w\x88\x97xdo\xf5\xff\x98\x88\x8f\xffT\xec\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB3X\xa8\xc08', + b'\xf1\x87LDLVBN681363KF37\x98\x88\x88\x88\x97x\x87\x88y\xaa\xa7\x9a\x88\x88\x98\x88\x88\x88\x88\x88vo\xf6\xffvD\x7f\xff%v\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB3X\xa8\xc08', + b'\xf1\x87LDLVBN713782KF37\x99\x99y\x97\x98\x88\x88\x88x\x88\x97\x88\x88\x99\x98\x89\x88\x99\xa8\x89\x87o\xf7\xffeU?\xff7,\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB3X\xa8\xc08', + b'\xf1\x87LDLVBN713890KF26\xb9\x99\x89\x98\xa9\x99\x99\x99x\x99\x97\x89\x88\x99\xa8\x89\x88\x99\xb8\x89Do\xf7\xff\xa9\x88o\xffs\r\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB3X\xa8\xc08', + b'\xf1\x87LDLVBN733215KF37\x99\x98y\x87\x97wwwi\x99\xa6\x99x\x99\xa7\x89V\x88\x95h\x86o\xf7\xffeDO\xff\x12\xe7\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB3X\xa8\xc08', + b'\xf1\x87LDLVBN750044KF37\xca\xa9\x8a\x98\xa7wwwy\xaa\xb7\x9ag\x88\x96x\x88\x99\xa8\x89\xb9\x7f\xf6\xff\xa8w\x7f\xff\xbe\xde\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB3X\xa8\xc08', + b'\xf1\x87LDLVBN752612KF37\xba\xaa\x8a\xa8\x87w\x87xy\xaa\xa7\x9a\x88\x99\x98\x89x\x88\x97\x88\x96o\xf6\xffvU_\xffh\x1b\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB3X\xa8\xc08', + b'\xf1\x87LDLVBN755553KF37\x87xw\x87\x97w\x87xy\x99\xa7\x99\x99\x99\xa9\x99Vw\x95gwo\xf6\xffwUO\xff\xb5T\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX4G38NB3X\xa8\xc08', + b'\xf1\x87LDLVBN757883KF37\x98\x87xw\x98\x87\x88xy\xaa\xb7\x9ag\x88\x96x\x89\x99\xa8\x99e\x7f\xf6\xff\xa9\x88o\xff5\x15\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB4\xd6\xe8\xd7\xa6', + b'\xf1\x87LDMVBN778156KF37\x87vWe\xa9\x99\x99\x99y\x99\xb7\x99\x99\x99\x99\x99x\x99\x97\x89\xa8\x7f\xf8\xffwf\x7f\xff\x82_\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB4\xd6\xe8\xd7\xa6', + b'\xf1\x87LDMVBN780576KF37\x98\x87hv\x97x\x97\x89x\x99\xa7\x89\x88\x99\x98\x89w\x88\x97x\x98\x7f\xf7\xff\xba\x88\x8f\xff\x1e0\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB4\xd6\xe8\xd7\xa6', + b'\xf1\x87LDMVBN783485KF37\x87www\x87vwgy\x99\xa7\x99\x99\x99\xa9\x99Vw\x95g\x89_\xf6\xff\xa9w_\xff\xc5\xd6\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB4\xd6\xe8\xd7\xa6', + b'\xf1\x87LDMVBN811844KF37\x87vwgvfffx\x99\xa7\x89Vw\x95gg\x88\xa6xe\x8f\xf6\xff\x97wO\xff\t\x80\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB4\xd6\xe8\xd7\xa6', + b'\xf1\x87LDMVBN830601KF37\xa7www\xa8\x87xwx\x99\xa7\x89Uw\x85Ww\x88\x97x\x88o\xf6\xff\x8a\xaa\x7f\xff\xe2:\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB4\xd6\xe8\xd7\xa6', + b'\xf1\x87LDMVBN848789KF37\x87w\x87x\x87w\x87xy\x99\xb7\x99\x87\x88\x98x\x88\x99\xa8\x89\x87\x7f\xf6\xfffUo\xff\xe3!\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB5\xb9\x94\xe8\x89', + b'\xf1\x87LDMVBN851595KF37\x97wgvvfffx\x99\xb7\x89\x88\x99\x98\x89\x87\x88\x98x\x99\x7f\xf7\xff\x97w\x7f\xff@\xf3\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB5\xb9\x94\xe8\x89', + b'\xf1\x87LDMVBN873175KF26\xa8\x88\x88\x88vfVex\x99\xb7\x89\x88\x99\x98\x89x\x88\x97\x88f\x7f\xf7\xff\xbb\xaa\x8f\xff,\x04\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB5\xb9\x94\xe8\x89', + b'\xf1\x87LDMVBN879401KF26veVU\xa8\x88\x88\x88g\x88\xa6xVw\x95gx\x88\xa7\x88v\x8f\xf9\xff\xdd\xbb\xbf\xff\xb3\x99\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB5\xb9\x94\xe8\x89', + b'\xf1\x87LDMVBN881314KF37\xa8\x88h\x86\x97www\x89\x99\xa8\x99w\x88\x97xx\x99\xa7\x89\xca\x7f\xf8\xff\xba\x99\x8f\xff\xd8v\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB5\xb9\x94\xe8\x89', + b'\xf1\x87LDMVBN888651KF37\xa9\x99\x89\x98vfff\x88\x99\x98\x89w\x99\xa7y\x88\x88\x98\x88D\x8f\xf9\xff\xcb\x99\x8f\xff\xa5\x1e\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB5\xb9\x94\xe8\x89', + b'\xf1\x87LDMVBN889419KF37\xa9\x99y\x97\x87w\x87xx\x88\x97\x88w\x88\x97x\x88\x99\x98\x89e\x9f\xf9\xffeUo\xff\x901\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB5\xb9\x94\xe8\x89', + b'\xf1\x87LDMVBN895969KF37vefV\x87vgfx\x99\xa7\x89\x99\x99\xb9\x99f\x88\x96he_\xf7\xffxwo\xff\x14\xf9\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB5\xb9\x94\xe8\x89', + b'\xf1\x87LDMVBN899222KF37\xa8\x88x\x87\x97www\x98\x99\x99\x89\x88\x99\x98\x89f\x88\x96hdo\xf7\xff\xbb\xaa\x9f\xff\xe2U\xf1\x81U922\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U922\x00\x00\x00\x00\x00\x00SLX4G38NB5\xb9\x94\xe8\x89', + b"\xf1\x87LBLUFN622950KF36\xa8\x88\x88\x88\x87w\x87xh\x99\x96\x89\x88\x99\x98\x89\x88\x99\x98\x89\x87o\xf6\xff\x98\x88o\xffx'\xf1\x81U891\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U891\x00\x00\x00\x00\x00\x00SLX2G38NB3\xd1\xc3\xf8\xa8", + ], + }, + CAR.VELOSTER: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00JS__ SCC H-CUP 1.00 1.02 95650-J3200 ', + b'\xf1\x00JS__ SCC HNCUP 1.00 1.02 95650-J3100 ', + ], + (Ecu.esp, 0x7d1, None): [b'\xf1\x00\x00\x00\x00\x00\x00\x00', ], + (Ecu.engine, 0x7e0, None): [ + b'\x01TJS-JNU06F200H0A', + b'\x01TJS-JDK06F200H0A', + ], + (Ecu.eps, 0x7d4, None): [b'\xf1\x00JSL MDPS C 1.00 1.03 56340-J3000 8308', ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00JS LKAS AT USA LHD 1.00 1.02 95740-J3000 K32', + b'\xf1\x00JS LKAS AT KOR LHD 1.00 1.03 95740-J3000 K33', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x816U2V8051\x00\x00\xf1\x006U2V0_C2\x00\x006U2V8051\x00\x00DJS0T16NS1\xba\x02\xb8\x80', + b'\xf1\x816U2V8051\x00\x00\xf1\x006U2V0_C2\x00\x006U2V8051\x00\x00DJS0T16NS1\x00\x00\x00\x00', + b'\xf1\x816U2V8051\x00\x00\xf1\x006U2V0_C2\x00\x006U2V8051\x00\x00DJS0T16KS2\016\xba\036\xa2', + ], + }, + CAR.GENESIS_G70: { + (Ecu.fwdRadar, 0x7d0, None): [b'\xf1\x00IK__ SCC F-CUP 1.00 1.02 96400-G9100 ', ], + (Ecu.engine, 0x7e0, None): [b'\xf1\x81640F0051\x00\x00\x00\x00\x00\x00\x00\x00', ], + (Ecu.eps, 0x7d4, None): [b'\xf1\x00IK MDPS R 1.00 1.06 57700-G9420 4I4VL106', ], + (Ecu.fwdCamera, 0x7c4, None): [b'\xf1\x00IK MFC AT USA LHD 1.00 1.01 95740-G9000 170920', ], + (Ecu.transmission, 0x7e1, None): [b'\xf1\x87VDJLT17895112DN4\x88fVf\x99\x88\x88\x88\x87fVe\x88vhwwUFU\x97eFex\x99\xff\xb7\x82\xf1\x81E25\x00\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 E25\x00\x00\x00\x00\x00\x00\x00SIK0T33NB2\x11\x1am\xda', ], + }, + CAR.GENESIS_G70_2020: { + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00IK MDPS R 1.00 1.07 57700-G9220 4I2VL107', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x87VCJLP18407832DN3\x88vXfvUVT\x97eFU\x87d7v\x88eVeveFU\x89\x98\x7f\xff\xb2\xb0\xf1\x81E25\x00\x00\x00', + b'\x00\x00\x00\x00\xf1\x00bcsh8p54 E25\x00\x00\x00\x00\x00\x00\x00SIK0T33NB4\xecE\xefL', + ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00IK__ SCC F-CUP 1.00 1.02 96400-G9100 ', + b'\xf1\x00IK__ SCC F-CUP 1.00 1.02 96400-G9100 \xf1\xa01.02', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00IK MFC AT USA LHD 1.00 1.01 95740-G9000 170920', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x81640J0051\x00\x00\x00\x00\x00\x00\x00\x00', + ], + }, + CAR.KONA: { + (Ecu.fwdRadar, 0x7d0, None): [b'\xf1\x00OS__ SCC F-CUP 1.00 1.00 95655-J9200 ', ], + (Ecu.esp, 0x7d1, None): [b'\xf1\x816V5RAK00018.ELF\xf1\x00\x00\x00\x00\x00\x00\x00', ], + (Ecu.engine, 0x7e0, None): [b'"\x01TOS-0NU06F301J02', ], + (Ecu.eps, 0x7d4, None): [b'\xf1\x00OS MDPS C 1.00 1.05 56310J9030\x00 4OSDC105', ], + (Ecu.fwdCamera, 0x7c4, None): [b'\xf1\x00OS9 LKAS AT USA LHD 1.00 1.00 95740-J9300 g21', ], + (Ecu.transmission, 0x7e1, None): [b'\xf1\x816U2VE051\x00\x00\xf1\x006U2V0_C2\x00\x006U2VE051\x00\x00DOS4T16NS3\x00\x00\x00\x00', ], + }, + CAR.KIA_CEED: { + (Ecu.fwdRadar, 0x7D0, None): [b'\xf1\000CD__ SCC F-CUP 1.00 1.02 99110-J7000 ', ], + (Ecu.esp, 0x7D4, None): [b'\xf1\000CD MDPS C 1.00 1.06 56310-XX000 4CDEC106', ], + (Ecu.fwdCamera, 0x7C4, None): [b'\xf1\000CD LKAS AT EUR LHD 1.00 1.01 99211-J7000 B40', ], + (Ecu.engine, 0x7E0, None): [b'\001TCD-JECU4F202H0K', ], + (Ecu.transmission, 0x7E1, None): [ + b'\xf1\x816U2V7051\000\000\xf1\0006U2V0_C2\000\0006U2V7051\000\000DCD0T14US1\000\000\000\000', + b'\xf1\x816U2V7051\x00\x00\xf1\x006U2V0_C2\x00\x006U2V7051\x00\x00DCD0T14US1U\x867Z', + ], + (Ecu.esp, 0x7D1, None): [b'\xf1\000CD ESC \003 102\030\b\005 58920-J7350', ], + }, + CAR.KIA_FORTE: { + (Ecu.eps, 0x7D4, None): [ + b'\xf1\x00BD MDPS C 1.00 1.02 56310-XX000 4BD2C102', + b'\xf1\x00BD MDPS C 1.00 1.08 56310/M6300 4BDDC108', + b'\xf1\x00BD MDPS C 1.00 1.08 56310M6300\x00 4BDDC108', + ], + (Ecu.fwdCamera, 0x7C4, None): [ + b'\xf1\x00BD LKAS AT USA LHD 1.00 1.04 95740-M6000 J33', + ], + (Ecu.fwdRadar, 0x7D0, None): [ + b'\xf1\x00BD__ SCC H-CUP 1.00 1.02 99110-M6000 ', + ], + (Ecu.engine, 0x7e0, None): [ + b'\x01TBDM1NU06F200H01', + b'391182B945\x00', + ], + (Ecu.esp, 0x7d1, None): [ + b'\xf1\x816VGRAH00018.ELF\xf1\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x816U2VC051\x00\x00\xf1\x006U2V0_C2\x00\x006U2VC051\x00\x00DBD0T16SS0\x00\x00\x00\x00', + b"\xf1\x816U2VC051\x00\x00\xf1\x006U2V0_C2\x00\x006U2VC051\x00\x00DBD0T16SS0\xcf\x1e'\xc3", + ], + }, + CAR.KIA_K5_2021: { + (Ecu.fwdRadar, 0x7D0, None): [ + b'\xf1\000DL3_ SCC FHCUP 1.00 1.03 99110-L2000 ', + b'\xf1\x8799110L2000\xf1\000DL3_ SCC FHCUP 1.00 1.03 99110-L2000 ', + b'\xf1\x8799110L2100\xf1\x00DL3_ SCC F-CUP 1.00 1.03 99110-L2100 ', + b'\xf1\x8799110L2100\xf1\x00DL3_ SCC FHCUP 1.00 1.03 99110-L2100 ', + ], + (Ecu.eps, 0x7D4, None): [ + b'\xf1\x8756310-L3110\xf1\000DL3 MDPS C 1.00 1.01 56310-L3110 4DLAC101', + b'\xf1\x8756310-L3220\xf1\x00DL3 MDPS C 1.00 1.01 56310-L3220 4DLAC101', + b'\xf1\x8757700-L3000\xf1\x00DL3 MDPS R 1.00 1.02 57700-L3000 4DLAP102', + ], + (Ecu.fwdCamera, 0x7C4, None): [ + b'\xf1\x00DL3 MFC AT USA LHD 1.00 1.03 99210-L3000 200915', + b'\xf1\x00DL3 MFC AT USA LHD 1.00 1.04 99210-L3000 210208', + ], + (Ecu.esp, 0x7D1, None): [ + b'\xf1\000DL ESC \006 101 \004\002 58910-L3200', + b'\xf1\x8758910-L3200\xf1\000DL ESC \006 101 \004\002 58910-L3200', + b'\xf1\x8758910-L3800\xf1\x00DL ESC \t 101 \x07\x02 58910-L3800', + b'\xf1\x8758910-L3600\xf1\x00DL ESC \x03 100 \x08\x02 58910-L3600', + ], + (Ecu.engine, 0x7E0, None): [ + b'\xf1\x87391212MKT0', + b'\xf1\x87391212MKV0', + b'\xf1\x870\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf1\x82DLDWN5TMDCXXXJ1B', + ], + (Ecu.transmission, 0x7E1, None): [ + b'\xf1\000bcsh8p54 U913\000\000\000\000\000\000TDL2T16NB1ia\v\xb8', + b'\xf1\x87SALFEA5652514GK2UUeV\x88\x87\x88xxwg\x87ww\x87wwfwvd/\xfb\xffvU_\xff\x93\xd3\xf1\x81U913\000\000\000\000\000\000\xf1\000bcsh8p54 U913\000\000\000\000\000\000TDL2T16NB1ia\v\xb8', + b'\xf1\x87SALFEA6046104GK2wvwgeTeFg\x88\x96xwwwwffvfe?\xfd\xff\x86fo\xff\x97A\xf1\x81U913\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U913\x00\x00\x00\x00\x00\x00TDL2T16NB1ia\x0b\xb8', + b'\xf1\x87SCMSAA8572454GK1\x87x\x87\x88Vf\x86hgwvwvwwgvwwgT?\xfb\xff\x97fo\xffH\xb8\xf1\x81U913\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 U913\x00\x00\x00\x00\x00\x00TDL4T16NB05\x94t\x18', + b'\xf1\x87954A02N300\x00\x00\x00\x00\x00\xf1\x81T02730A1 \xf1\x00T02601BL T02730A1 WDL3T25XXX730NS2b\x1f\xb8%', + ], + }, + CAR.KONA_EV: { + (Ecu.esp, 0x7D1, None): [ + b'\xf1\x00OS IEB \r 105\x18\t\x18 58520-K4000', + b'\xf1\x00OS IEB \x01 212 \x11\x13 58520-K4000', + b'\xf1\x00OS IEB \x02 212 \x11\x13 58520-K4000', + b'\xf1\x00OS IEB \x03 210 \x02\x14 58520-K4000', + b'\xf1\x00OS IEB \x03 212 \x11\x13 58520-K4000', + ], + (Ecu.fwdCamera, 0x7C4, None): [ + b'\xf1\x00OE2 LKAS AT EUR LHD 1.00 1.00 95740-K4200 200', + b'\xf1\x00OSE LKAS AT EUR LHD 1.00 1.00 95740-K4100 W40', + b'\xf1\x00OSE LKAS AT EUR RHD 1.00 1.00 95740-K4100 W40', + b'\xf1\x00OSE LKAS AT KOR LHD 1.00 1.00 95740-K4100 W40', + b'\xf1\x00OSE LKAS AT USA LHD 1.00 1.00 95740-K4300 W50', + ], + (Ecu.eps, 0x7D4, None): [ + b'\xf1\x00OS MDPS C 1.00 1.03 56310/K4550 4OEDC103', + b'\xf1\x00OS MDPS C 1.00 1.04 56310K4000\x00 4OEDC104', + b'\xf1\x00OS MDPS C 1.00 1.04 56310K4050\x00 4OEDC104', + ], + (Ecu.fwdRadar, 0x7D0, None): [ + b'\xf1\x00OSev SCC F-CUP 1.00 1.00 99110-K4000 ', + b'\xf1\x00OSev SCC F-CUP 1.00 1.00 99110-K4100 ', + b'\xf1\x00OSev SCC F-CUP 1.00 1.01 99110-K4000 ', + b'\xf1\x00OSev SCC FNCUP 1.00 1.01 99110-K4000 ', + ], + }, + CAR.KIA_NIRO_EV: { + (Ecu.fwdRadar, 0x7D0, None): [ + b'\xf1\x00DEev SCC F-CUP 1.00 1.00 99110-Q4000 ', + b'\xf1\x00DEev SCC F-CUP 1.00 1.02 96400-Q4100 ', + b'\xf1\x00DEev SCC F-CUP 1.00 1.03 96400-Q4100 ', + b'\xf1\x8799110Q4000\xf1\x00DEev SCC F-CUP 1.00 1.00 99110-Q4000 ', + b'\xf1\x8799110Q4100\xf1\x00DEev SCC F-CUP 1.00 1.00 99110-Q4100 ', + b'\xf1\x8799110Q4500\xf1\x00DEev SCC F-CUP 1.00 1.00 99110-Q4500 ', + b'\xf1\x8799110Q4600\xf1\x00DEev SCC FNCUP 1.00 1.00 99110-Q4600 ', + b'\xf1\x8799110Q4600\xf1\x00DEev SCC FHCUP 1.00 1.00 99110-Q4600 ', + ], + (Ecu.eps, 0x7D4, None): [ + b'\xf1\x00DE MDPS C 1.00 1.05 56310Q4000\x00 4DEEC105', + b'\xf1\x00DE MDPS C 1.00 1.05 56310Q4100\x00 4DEEC105', + b'\xf1\x00OS MDPS C 1.00 1.04 56310K4050\x00 4OEDC104', + ], + (Ecu.fwdCamera, 0x7C4, None): [ + b'\xf1\x00DEE MFC AT EUR LHD 1.00 1.00 99211-Q4100 200706', + b'\xf1\x00DEE MFC AT EUR LHD 1.00 1.00 99211-Q4000 191211', + b'\xf1\x00DEE MFC AT USA LHD 1.00 1.00 99211-Q4000 191211', + b'\xf1\x00DEE MFC AT USA LHD 1.00 1.03 95740-Q4000 180821', + b'\xf1\x00DEE MFC AT USA LHD 1.00 1.01 99211-Q4500 210428', + ], + }, + CAR.KIA_NIRO_HEV: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x816H6F4051\000\000\000\000\000\000\000\000', + ], + (Ecu.transmission, 0x7e1, None): [ + b"\xf1\x816U3J2051\000\000\xf1\0006U3H0_C2\000\0006U3J2051\000\000PDE0G16NS2\xf4\'\\\x91", + b'\xf1\x816U3J2051\000\000\xf1\0006U3H0_C2\000\0006U3J2051\000\000PDE0G16NS2\000\000\000\000', + ], + (Ecu.eps, 0x7D4, None): [ + b'\xf1\000DE MDPS C 1.00 1.09 56310G5301\000 4DEHC109', + ], + (Ecu.fwdCamera, 0x7C4, None): [ + b'\xf1\000DEP MFC AT USA LHD 1.00 1.01 95740-G5010 170424', + ], + (Ecu.fwdRadar, 0x7D0, None): [ + b'\xf1\000DEhe SCC H-CUP 1.01 1.02 96400-G5100 ', + ], + }, + CAR.KIA_NIRO_HEV_2021: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x816H6G5051\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x816U3J9051\x00\x00\xf1\x006U3H1_C2\x00\x006U3J9051\x00\x00HDE0G16NL3\x00\x00\x00\x00', + b'\xf1\x816U3J9051\x00\x00\xf1\x006U3H1_C2\x00\x006U3J9051\x00\x00HDE0G16NL3\xb9\xd3\xfaW', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00DE MDPS C 1.00 1.01 56310G5520\x00 4DEPC101', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00DEH MFC AT USA LHD 1.00 1.07 99211-G5000 201221', + ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00DEhe SCC FHCUP 1.00 1.00 99110-G5600 ', + ], + }, + CAR.KIA_SELTOS: { + (Ecu.fwdRadar, 0x7d0, None): [b'\xf1\x8799110Q5100\xf1\000SP2_ SCC FHCUP 1.01 1.05 99110-Q5100 ',], + (Ecu.esp, 0x7d1, None): [ + b'\xf1\x8758910-Q5450\xf1\000SP ESC \a 101\031\t\005 58910-Q5450', + b'\xf1\x8758910-Q5450\xf1\000SP ESC \t 101\031\t\005 58910-Q5450', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x81616D2051\000\000\000\000\000\000\000\000', + b'\xf1\x81616D5051\000\000\000\000\000\000\000\000', + b'\001TSP2KNL06F100J0K', + b'\001TSP2KNL06F200J0K', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\000SP2 MDPS C 1.00 1.04 56300Q5200 ', + b'\xf1\000SP2 MDPS C 1.01 1.05 56300Q5200 ', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\000SP2 MFC AT USA LHD 1.00 1.04 99210-Q5000 191114', + b'\xf1\000SP2 MFC AT USA LHD 1.00 1.05 99210-Q5000 201012', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x87CZLUB49370612JF7h\xa8y\x87\x99\xa7hv\x99\x97fv\x88\x87x\x89x\x96O\xff\x88\xff\xff\xff.@\xf1\x816V2C2051\000\000\xf1\0006V2B0_C2\000\0006V2C2051\000\000CSP4N20NS3\000\000\000\000', + b'\xf1\x87954A22D200\xf1\x81T01950A1 \xf1\000T0190XBL T01950A1 DSP2T16X4X950NS6\xd30\xa5\xb9', + b'\xf1\x87954A22D200\xf1\x81T01950A1 \xf1\000T0190XBL T01950A1 DSP2T16X4X950NS8\r\xfe\x9c\x8b', + ], + }, + CAR.KIA_OPTIMA: { + (Ecu.fwdRadar, 0x7d0, None): [b'\xf1\x00JF__ SCC F-CUP 1.00 1.00 96400-D4110 '], + (Ecu.esp, 0x7d1, None): [b'\xf1\x00JF ESC \v 11 \x18\x030 58920-D5180',], + (Ecu.engine, 0x7e0, None): [ + b'\x01TJFAJNU06F201H03', + b'\xf1\x89F1JF600AISEIU702\xf1\x82F1JF600AISEIU702', + ], + (Ecu.eps, 0x7d4, None): [b'\xf1\x00TM MDPS C 1.00 1.00 56340-S2000 8409'], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00JFA LKAS AT USA LHD 1.00 1.00 95895-D5001 h32', + b'\xf1\x00JFA LKAS AT USA LHD 1.00 1.02 95895-D5000 h31', + ], + (Ecu.transmission, 0x7e1, None): [b'\xf1\x816U2V8051\x00\x00\xf1\x006U2V0_C2\x00\x006U2V8051\x00\x00DJF0T16NL0\t\xd2GW'], + }, + CAR.ELANTRA_2021: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00CN7_ SCC F-CUP 1.00 1.01 99110-AA000 ', + b'\xf1\x00CN7_ SCC FHCUP 1.00 1.01 99110-AA000 ', + b'\xf1\x8799110AA000\xf1\x00CN7_ SCC FHCUP 1.00 1.01 99110-AA000 ', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x87\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf1\x00CN7 MDPS C 1.00 1.06 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 4CNDC106', + b'\xf1\x8756310/AA070\xf1\x00CN7 MDPS C 1.00 1.06 56310/AA070 4CNDC106', + b'\xf1\x8756310AA050\x00\xf1\x00CN7 MDPS C 1.00 1.06 56310AA050\x00 4CNDC106', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00CN7 MFC AT USA LHD 1.00 1.00 99210-AB000 200819', + b'\xf1\x00CN7 MFC AT USA LHD 1.00 1.03 99210-AA000 200819', + ], + (Ecu.esp, 0x7d1, None): [ + b'\xf1\x00CN ESC \t 101 \x10\x03 58910-AB800', + b'\xf1\x8758910-AA800\xf1\x00CN ESC \t 104 \x08\x03 58910-AA800', + b'\xf1\x8758910-AB800\xf1\x00CN ESC \t 101 \x10\x03 58910-AB800', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x00HT6WA280BLHT6VA640A1CCN0N20NS5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'\xf1\x00HT6WA280BLHT6VA640A1CCN0N20NS5\x00\x00\x00\x00\x00\x00\xe8\xba\xce\xfa', + b'\xf1\x87CXMQFM2135005JB2E\xb9\x89\x98W\xa9y\x97h\xa9\x98\x99wxvwh\x87\177\xffx\xff\xff\xff,,\xf1\x89HT6VA640A1\xf1\x82CCN0N20NS5\x00\x00\x00\x00\x00\x00', + b'\xf1\x87CXMQFM1916035JB2\x88vvgg\x87Wuwgev\xa9\x98\x88\x98h\x99\x9f\xffh\xff\xff\xff\xa5\xee\xf1\x89HT6VA640A1\xf1\x82CCN0N20NS5\x00\x00\x00\x00\x00\x00', + b'\xf1\x87CXLQF40189012JL2f\x88\x86\x88\x88vUex\xb8\x88\x88\x88\x87\x88\x89fh?\xffz\xff\xff\xff\x08z\xf1\x89HT6VA640A1\xf1\x82CCN0N20NS5\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x82CNCWD0AMFCXCSFFA', + b'\xf1\x82CNCWD0AMFCXCSFFB', + b'\xf1\x82CNCVD0AMFCXCSFFB', + ], + }, + CAR.ELANTRA_HEV_2021: { + (Ecu.fwdCamera, 0x7c4, None) : [ + b'\xf1\000CN7HMFC AT USA LHD 1.00 1.03 99210-AA000 200819', + ], + (Ecu.fwdRadar, 0x7d0, None) : [ + b'\xf1\000CNhe SCC FHCUP 1.00 1.01 99110-BY000 ', + b'\xf1\x8799110BY000\xf1\x00CNhe SCC FHCUP 1.00 1.01 99110-BY000 ', + ], + (Ecu.eps, 0x7d4, None) :[ + b'\xf1\x8756310/BY050\xf1\000CN7 MDPS C 1.00 1.02 56310/BY050 4CNHC102', + ], + (Ecu.transmission, 0x7e1, None) :[ + b'\xf1\0006U3L0_C2\000\0006U3K3051\000\000HCN0G16NS0\xb9?A\xaa', + b'\xf1\0006U3L0_C2\000\0006U3K3051\000\000HCN0G16NS0\000\000\000\000', + b'\xf1\x816U3K3051\000\000\xf1\0006U3L0_C2\000\0006U3K3051\000\000HCN0G16NS0\xb9?A\xaa', + b'\xf1\x816U3K3051\x00\x00\xf1\x006U3L0_C2\x00\x006U3K3051\x00\x00HCN0G16NS0\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None) : [ + b'\xf1\x816H6G5051\x00\x00\x00\x00\x00\x00\x00\x00', + ] + }, + CAR.KONA_HEV: { + (Ecu.esp, 0x7d1, None): [ + b'\xf1\x00OS IEB \x01 104 \x11 58520-CM000', + ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00OShe SCC FNCUP 1.00 1.01 99110-CM000 ', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00OS MDPS C 1.00 1.00 56310CM030\x00 4OHDC100', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00OSH LKAS AT KOR LHD 1.00 1.01 95740-CM000 l31', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x816U3J9051\x00\x00\xf1\x006U3H1_C2\x00\x006U3J9051\x00\x00HOS0G16DS1\x16\xc7\xb0\xd9', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x816H6F6051\x00\x00\x00\x00\x00\x00\x00\x00', + ] + }, + CAR.SONATA_HYBRID: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\000DNhe SCC FHCUP 1.00 1.02 99110-L5000 ', + b'\xf1\x8799110L5000\xf1\000DNhe SCC FHCUP 1.00 1.02 99110-L5000 ', + b'\xf1\000DNhe SCC F-CUP 1.00 1.02 99110-L5000 ', + b'\xf1\x8799110L5000\xf1\000DNhe SCC F-CUP 1.00 1.02 99110-L5000 ', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x8756310-L5500\xf1\x00DN8 MDPS C 1.00 1.02 56310-L5500 4DNHC102', + b'\xf1\x8756310-L5450\xf1\x00DN8 MDPS C 1.00 1.02 56310-L5450 4DNHC102', + b'\xf1\x8756310-L5450\xf1\000DN8 MDPS C 1.00 1.03 56310-L5450 4DNHC103', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00DN8HMFC AT USA LHD 1.00 1.04 99211-L1000 191016', + b'\xf1\x00DN8HMFC AT USA LHD 1.00 1.05 99211-L1000 201109', + b'\xf1\000DN8HMFC AT USA LHD 1.00 1.06 99211-L1000 210325', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\000PSBG2333 E14\x00\x00\x00\x00\x00\x00\x00TDN2H20SA6N\xc2\xeeW', + b'\xf1\x87959102T250\000\000\000\000\000\xf1\x81E09\000\000\000\000\000\000\000\xf1\000PSBG2323 E09\000\000\000\000\000\000\000TDN2H20SA5\x97R\x88\x9e', + b'\xf1\000PSBG2323 E09\000\000\000\000\000\000\000TDN2H20SA5\x97R\x88\x9e', + b'\xf1\000PSBG2333 E16\000\000\000\000\000\000\000TDN2H20SA7\0323\xf9\xab', + b'\xf1\x87PCU\000\000\000\000\000\000\000\000\000\xf1\x81E16\000\000\000\000\000\000\000\xf1\000PSBG2333 E16\000\000\000\000\000\000\000TDN2H20SA7\0323\xf9\xab', + b'\xf1\x87959102T250\x00\x00\x00\x00\x00\xf1\x81E14\x00\x00\x00\x00\x00\x00\x00\xf1\x00PSBG2333 E14\x00\x00\x00\x00\x00\x00\x00TDN2H20SA6N\xc2\xeeW', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x87391162J012', + b'\xf1\x87391162J013', + ], + }, +} + +CHECKSUM = { + "crc8": [CAR.SANTA_FE, CAR.SONATA, CAR.PALISADE, CAR.KIA_SELTOS, CAR.ELANTRA_2021, CAR.ELANTRA_HEV_2021, CAR.SONATA_HYBRID, CAR.SANTA_FE_2022, CAR.KIA_K5_2021, CAR.SANTA_FE_HEV_2022, CAR.SANTA_FE_PHEV_2022], + "6B": [CAR.KIA_SORENTO, CAR.HYUNDAI_GENESIS], +} + +FEATURES = { + # which message has the gear + "use_cluster_gears": {CAR.ELANTRA, CAR.ELANTRA_GT_I30, CAR.KONA}, + "use_tcu_gears": {CAR.KIA_OPTIMA, CAR.SONATA_LF, CAR.VELOSTER}, + "use_elect_gears": {CAR.KIA_NIRO_EV, CAR.KIA_NIRO_HEV, CAR.KIA_NIRO_HEV_2021, CAR.KIA_OPTIMA_H, CAR.IONIQ_EV_LTD, CAR.KONA_EV, CAR.IONIQ, CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV, CAR.ELANTRA_HEV_2021,CAR.SONATA_HYBRID, CAR.KONA_HEV, CAR.IONIQ_HEV_2022, CAR.SANTA_FE_HEV_2022, CAR.SANTA_FE_PHEV_2022}, + + # these cars use the FCA11 message for the AEB and FCW signals, all others use SCC12 + "use_fca": {CAR.SONATA, CAR.SONATA_HYBRID, CAR.ELANTRA, CAR.ELANTRA_2021, CAR.ELANTRA_HEV_2021, CAR.ELANTRA_GT_I30, CAR.KIA_STINGER, CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV, CAR.KONA_EV, CAR.KIA_FORTE, CAR.KIA_NIRO_EV, CAR.PALISADE, CAR.GENESIS_G70, CAR.GENESIS_G70_2020, CAR.KONA, CAR.SANTA_FE, CAR.KIA_SELTOS, CAR.KONA_HEV, CAR.SANTA_FE_2022, CAR.KIA_K5_2021, CAR.IONIQ_HEV_2022, CAR.SANTA_FE_HEV_2022, CAR.SANTA_FE_PHEV_2022}, +} + +HYBRID_CAR = {CAR.IONIQ_PHEV, CAR.ELANTRA_HEV_2021, CAR.KIA_NIRO_HEV, CAR.KIA_NIRO_HEV_2021, CAR.SONATA_HYBRID, CAR.KONA_HEV, CAR.IONIQ, CAR.IONIQ_HEV_2022, CAR.SANTA_FE_HEV_2022, CAR.SANTA_FE_PHEV_2022} # these cars use a different gas signal +EV_CAR = {CAR.IONIQ_EV_2020, CAR.IONIQ_EV_LTD, CAR.KONA_EV, CAR.KIA_NIRO_EV} + +# these cars require a special panda safety mode due to missing counters and checksums in the messages +LEGACY_SAFETY_MODE_CAR = {CAR.HYUNDAI_GENESIS, CAR.IONIQ_EV_2020, CAR.IONIQ_EV_LTD, CAR.IONIQ_PHEV, CAR.IONIQ, CAR.KONA_EV, CAR.KIA_SORENTO, CAR.SONATA_LF, CAR.KIA_OPTIMA, CAR.VELOSTER, CAR.KIA_STINGER, CAR.GENESIS_G70, CAR.GENESIS_G80, CAR.KIA_CEED, CAR.ELANTRA, CAR.IONIQ_HEV_2022} + +# If 0x500 is present on bus 1 it probably has a Mando radar outputting radar points. +# If no points are outputted by default it might be possible to turn it on using selfdrive/debug/hyundai_enable_radar_points.py +DBC = { + CAR.ELANTRA: dbc_dict('hyundai_kia_generic', None), + CAR.ELANTRA_2021: dbc_dict('hyundai_kia_generic', None), + CAR.ELANTRA_HEV_2021: dbc_dict('hyundai_kia_generic', None), + CAR.ELANTRA_GT_I30: dbc_dict('hyundai_kia_generic', None), + CAR.GENESIS_G70: dbc_dict('hyundai_kia_generic', None), + CAR.GENESIS_G70_2020: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar'), + CAR.GENESIS_G80: dbc_dict('hyundai_kia_generic', None), + CAR.GENESIS_G90: dbc_dict('hyundai_kia_generic', None), + CAR.HYUNDAI_GENESIS: dbc_dict('hyundai_kia_generic', None), + CAR.IONIQ_PHEV: dbc_dict('hyundai_kia_generic', None), + CAR.IONIQ_EV_2020: dbc_dict('hyundai_kia_generic', None), + CAR.IONIQ_EV_LTD: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar'), + CAR.IONIQ: dbc_dict('hyundai_kia_generic', None), + CAR.IONIQ_HEV_2022: dbc_dict('hyundai_kia_generic', None), + CAR.KIA_FORTE: dbc_dict('hyundai_kia_generic', None), + CAR.KIA_K5_2021: dbc_dict('hyundai_kia_generic', None), + CAR.KIA_NIRO_EV: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar'), + CAR.KIA_NIRO_HEV: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar'), + CAR.KIA_NIRO_HEV_2021: dbc_dict('hyundai_kia_generic', None), + CAR.KIA_OPTIMA: dbc_dict('hyundai_kia_generic', None), + CAR.KIA_OPTIMA_H: dbc_dict('hyundai_kia_generic', None), + CAR.KIA_SELTOS: dbc_dict('hyundai_kia_generic', None), + CAR.KIA_SORENTO: dbc_dict('hyundai_kia_generic', None), # Has 0x5XX messages, but different format + CAR.KIA_STINGER: dbc_dict('hyundai_kia_generic', None), + CAR.KONA: dbc_dict('hyundai_kia_generic', None), + CAR.KONA_EV: dbc_dict('hyundai_kia_generic', None), + CAR.KONA_HEV: dbc_dict('hyundai_kia_generic', None), + CAR.SANTA_FE: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar'), + CAR.SANTA_FE_2022: dbc_dict('hyundai_kia_generic', None), + CAR.SANTA_FE_HEV_2022: dbc_dict('hyundai_kia_generic', None), + CAR.SANTA_FE_PHEV_2022: dbc_dict('hyundai_kia_generic', None), + CAR.SONATA: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar'), + CAR.SONATA_LF: dbc_dict('hyundai_kia_generic', None), # Has 0x5XX messages, but different format + CAR.PALISADE: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar'), + CAR.VELOSTER: dbc_dict('hyundai_kia_generic', None), + CAR.KIA_CEED: dbc_dict('hyundai_kia_generic', None), + CAR.SONATA_HYBRID: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar'), +} + +STEER_THRESHOLD = 150 diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py new file mode 100644 index 000000000..1f995c5cb --- /dev/null +++ b/selfdrive/car/interfaces.py @@ -0,0 +1,345 @@ +import os +import time +from abc import abstractmethod, ABC +from typing import Dict, Tuple, List + +from cereal import car,log +from common.kalman.simple_kalman import KF1D +from common.realtime import DT_CTRL +from selfdrive.car import gen_empty_fingerprint +from selfdrive.config import Conversions as CV +from selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX +from selfdrive.controls.lib.events import Events +from selfdrive.controls.lib.vehicle_model import VehicleModel +from selfdrive.car.modules.CFG_module import load_bool_param,load_float_param +from selfdrive.car.modules.HSO_module import HSOController +from selfdrive.car.modules.BLNK_module import BLNKController +from selfdrive.car.modules.ALC_module import ALCController +import cereal.messaging as messaging + +GearShifter = car.CarState.GearShifter +EventName = car.CarEvent.EventName + +MAX_CTRL_SPEED = (V_CRUISE_MAX + 4) * CV.KPH_TO_MS +ACCEL_MAX = 2.0 +ACCEL_MIN = -3.5 + + +# generic car and radar interfaces + + +class CarInterfaceBase(ABC): + def __init__(self, CP, CarController, CarState): + self.CP = CP + self.VM = VehicleModel(CP) + + self.frame = 0 + self.steering_unpressed = 0 + self.low_speed_alert = False + self.silent_steer_warning = True + + if CarState is not None: + self.CS = CarState(CP) + self.cp = self.CS.get_can_parser(CP) + self.cp_cam = self.CS.get_cam_can_parser(CP) + self.cp_body = self.CS.get_body_can_parser(CP) + + #initialize modules + self.CS.HSO = HSOController() + self.CS.blinker_controller = BLNKController() + self.CS.alca_controller = ALCController() + + #initialize listeners + self.CS.laP = messaging.sub_sock('lateralPlan') + + #alca info + self.CS.prev_alca_pre_engage = False + self.CS.alca_pre_engage = False + self.CS.alca_engaged = False + self.CS.alca_direction = 0 + self.CS.alca_need_engagement = False + self.CS.alca_done = False + self.cp_loopback = self.CS.get_loopback_can_parser(CP) + + self.CC = None + if CarController is not None: + self.CC = CarController(self.cp.dbc_name, CP, self.VM) + + @staticmethod + def get_pid_accel_limits(CP, current_speed, cruise_speed): + return ACCEL_MIN, ACCEL_MAX + + @staticmethod + @abstractmethod + def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None): + pass + + @staticmethod + def init(CP, logcan, sendcan): + pass + + @staticmethod + def get_steer_feedforward_default(desired_angle, v_ego): + # Proportional to realigning tire momentum: lateral acceleration. + # TODO: something with lateralPlan.curvatureRates + return desired_angle * (v_ego**2) + + @classmethod + def get_steer_feedforward_function(cls): + return cls.get_steer_feedforward_default + + # returns a set of default params to avoid repetition in car specific params + @staticmethod + def get_std_params(candidate, fingerprint): + ret = car.CarParams.new_message() + ret.carFingerprint = candidate + ret.unsafeMode = 0 # see panda/board/safety_declarations.h for allowed values + + # standard ALC params + ret.steerControlType = car.CarParams.SteerControlType.torque + ret.steerMaxBP = [0.] + ret.steerMaxV = [1.] + ret.minSteerSpeed = 0. + ret.wheelSpeedFactor = 1.0 + + ret.pcmCruise = True # openpilot's state is tied to the PCM's cruise state on most cars + ret.minEnableSpeed = -1. # enable is done by stock ACC, so ignore this + ret.steerRatioRear = 0. # no rear steering, at least on the listed cars aboveA + ret.openpilotLongitudinalControl = False + ret.stopAccel = -2.0 + ret.stoppingDecelRate = 0.8 # brake_travel/s while trying to stop + ret.vEgoStopping = 0.5 + ret.vEgoStarting = 0.5 # needs to be >= vEgoStopping to avoid state transition oscillation + ret.stoppingControl = True + ret.longitudinalTuning.deadzoneBP = [0.] + ret.longitudinalTuning.deadzoneV = [0.] + ret.longitudinalTuning.kpBP = [0.] + ret.longitudinalTuning.kpV = [1.] + ret.longitudinalTuning.kiBP = [0.] + ret.longitudinalTuning.kiV = [1.] + ret.longitudinalActuatorDelayLowerBound = 0.15 + ret.longitudinalActuatorDelayUpperBound = 0.15 + ret.steerLimitTimer = 1.0 + return ret + + @abstractmethod + def update(self, c: car.CarControl, can_strings: List[bytes]) -> car.CarState: + pass + + def post_update(self,c,ret): + self.CS.realSteeringPressed = ret.steeringPressed + if self.CS.enableHAO: + ret.gas = 0 + ret.gasPressed = False + #Trick the alca if autoStartAlcaDelay is set + if (self.CS.enableALC) and (self.CS.alca_need_engagement): + ret.steeringPressed = True + if self.CS.alca_direction == log.LateralPlan.LaneChangeDirection.left: + ret.steeringTorque = 0.1 + if self.CS.alca_direction == log.LateralPlan.LaneChangeDirection.right: + ret.steeringTorque = - 0.1 + + def pre_apply(self,c): + #read params once a second + if self.frame % 100 == 0: + self.CS.enableHSO = load_bool_param("TinklaHso",True) + self.CS.enableHAO = load_bool_param("TinklaHao",False) + self.CS.enableALC = load_bool_param("TinklaAlc",False) + + self.CS.lat_plan = messaging.recv_one_or_none(self.CS.laP) + # Update HSO module + self.CS.human_control = self.CS.HSO.update_stat(self.CS, c.enabled, c.actuators, self.frame) + + #update blinker tap module + self.CS.blinker_controller.update_state(self.CS, self.frame) + self.CS.tap_direction = self.CS.blinker_controller.tap_direction + + #update ALC module + self.CS.alca_controller.update(c.enabled, self.CS, self.frame, self.CS.lat_plan) + + # return sendcan, pass in a car.CarControl + + @abstractmethod + def apply(self, c: car.CarControl) -> Tuple[car.CarControl.Actuators, List[bytes]]: + pass + + def create_common_events(self, cs_out, extra_gears=None, pcm_enable=True): + events = Events() + + if cs_out.doorOpen: + events.add(EventName.doorOpen) + if cs_out.seatbeltUnlatched: + events.add(EventName.seatbeltNotLatched) + if cs_out.gearShifter != GearShifter.drive and (extra_gears is None or + cs_out.gearShifter not in extra_gears): + events.add(EventName.wrongGear) + if cs_out.gearShifter == GearShifter.reverse: + events.add(EventName.reverseGear) + if not cs_out.cruiseState.available: + events.add(EventName.wrongCarMode) + if cs_out.espDisabled: + events.add(EventName.espDisabled) + if cs_out.gasPressed: + events.add(EventName.gasPressed) + if cs_out.stockFcw: + events.add(EventName.stockFcw) + if cs_out.stockAeb: + events.add(EventName.stockAeb) + if cs_out.vEgo > MAX_CTRL_SPEED: + events.add(EventName.speedTooHigh) + if cs_out.cruiseState.nonAdaptive: + events.add(EventName.wrongCruiseMode) + if cs_out.brakeHoldActive and self.CP.openpilotLongitudinalControl: + events.add(EventName.brakeHold) + + + # Handle permanent and temporary steering faults + self.steering_unpressed = 0 if cs_out.steeringPressed else self.steering_unpressed + 1 + if cs_out.steerWarning: + # if the user overrode recently, show a less harsh alert + if self.CS.enableHSO or self.silent_steer_warning or cs_out.standstill or self.steering_unpressed < int(1.5 / DT_CTRL): + self.silent_steer_warning = True + events.add(EventName.steerTempUnavailableSilent) + else: + events.add(EventName.steerTempUnavailable) + else: + #add this to disable the annoying sounds during HSO + if not self.CS.enableHSO: + self.silent_steer_warning = False + if cs_out.steerError: + events.add(EventName.steerUnavailable) + + # Disable on rising edge of gas or brake. Also disable on brake when speed > 0. + if (cs_out.gasPressed and not self.CS.out.gasPressed) or \ + (cs_out.brakePressed and (not self.CS.out.brakePressed or not cs_out.standstill)): + events.add(EventName.pedalPressed) + + # we engage when pcm is active (rising edge) + if pcm_enable: + if cs_out.cruiseState.enabled and not self.CS.out.cruiseState.enabled: + events.add(EventName.pcmEnable) + elif not cs_out.cruiseState.enabled: + events.add(EventName.pcmDisable) + + return events + + +class RadarInterfaceBase(ABC): + def __init__(self, CP): + self.pts = {} + self.delay = 0 + self.radar_ts = CP.radarTimeStep + self.no_radar_sleep = 'NO_RADAR_SLEEP' in os.environ + + def update(self, can_strings): + ret = car.RadarData.new_message() + if not self.no_radar_sleep: + time.sleep(self.radar_ts) # radard runs on RI updates + return ret + + +class CarStateBase(ABC): + def __init__(self, CP): + self.CP = CP + self.car_fingerprint = CP.carFingerprint + self.out = car.CarState.new_message() + + self.cruise_buttons = 0 + self.left_blinker_cnt = 0 + self.right_blinker_cnt = 0 + self.left_blinker_prev = False + self.right_blinker_prev = False + + #start config section + self.enablePedal = load_bool_param("TinklaEnablePedal",False) + self.autoresumeAcc = load_bool_param("TinklaAutoResumeACC",False) + self.enableHSO = load_bool_param("TinklaHso",True) + self.enableHAO = load_bool_param("TinklaHao",False) + self.enableALC = load_bool_param("TinklaAlc",False) + self.useTeslaRadar = load_bool_param("TinklaUseTeslaRadar",False) + self.usesApillarHarness = load_bool_param("TinklaUseAPillarHarness",False) + self.autoStartAlcaDelay = load_float_param("TinklaAlcDelay",2.0) + self.hsoNumbPeriod = load_float_param("TinklaHsoNumbPeriod",1.5) + self.longCtrlEvent = None + + #end config section + + # 0 = off, 1 = indicate left (stalk down), 2 = indicate right (stalk up) + self.turnSignalStalkState = 0 + self.realSteeringPressed = False + + # Q = np.matrix([[10.0, 0.0], [0.0, 100.0]]) + # R = 1e3 + self.v_ego_kf = KF1D(x0=[[0.0], [0.0]], + A=[[1.0, DT_CTRL], [0.0, 1.0]], + C=[1.0, 0.0], + K=[[0.12287673], [0.29666309]]) + + def update_speed_kf(self, v_ego_raw): + if abs(v_ego_raw - self.v_ego_kf.x[0][0]) > 2.0: # Prevent large accelerations when car starts at non zero speed + self.v_ego_kf.x = [[v_ego_raw], [0.0]] + + v_ego_x = self.v_ego_kf.update(v_ego_raw) + return float(v_ego_x[0]), float(v_ego_x[1]) + + def get_wheel_speeds(self, fl, fr, rl, rr, unit=CV.KPH_TO_MS): + factor = unit * self.CP.wheelSpeedFactor + + wheelSpeeds = car.CarState.WheelSpeeds.new_message() + wheelSpeeds.fl = fl * factor + wheelSpeeds.fr = fr * factor + wheelSpeeds.rl = rl * factor + wheelSpeeds.rr = rr * factor + return wheelSpeeds + + def update_blinker_from_lamp(self, blinker_time: int, left_blinker_lamp: bool, right_blinker_lamp: bool): + """Update blinkers from lights. Enable output when light was seen within the last `blinker_time` + iterations""" + # TODO: Handle case when switching direction. Now both blinkers can be on at the same time + self.left_blinker_cnt = blinker_time if left_blinker_lamp else max(self.left_blinker_cnt - 1, 0) + self.right_blinker_cnt = blinker_time if right_blinker_lamp else max(self.right_blinker_cnt - 1, 0) + return self.left_blinker_cnt > 0, self.right_blinker_cnt > 0 + + def update_blinker_from_stalk(self, blinker_time: int, left_blinker_stalk: bool, right_blinker_stalk: bool): + """Update blinkers from stalk position. When stalk is seen the blinker will be on for at least blinker_time, + or until the stalk is turned off, whichever is longer. If the opposite stalk direction is seen the blinker + is forced to the other side. On a rising edge of the stalk the timeout is reset.""" + + if left_blinker_stalk: + self.right_blinker_cnt = 0 + if not self.left_blinker_prev: + self.left_blinker_cnt = blinker_time + + if right_blinker_stalk: + self.left_blinker_cnt = 0 + if not self.right_blinker_prev: + self.right_blinker_cnt = blinker_time + + self.left_blinker_cnt = max(self.left_blinker_cnt - 1, 0) + self.right_blinker_cnt = max(self.right_blinker_cnt - 1, 0) + + self.left_blinker_prev = left_blinker_stalk + self.right_blinker_prev = right_blinker_stalk + + return bool(left_blinker_stalk or self.left_blinker_cnt > 0), bool(right_blinker_stalk or self.right_blinker_cnt > 0) + + @staticmethod + def parse_gear_shifter(gear: str) -> car.CarState.GearShifter: + d: Dict[str, car.CarState.GearShifter] = { + 'P': GearShifter.park, 'R': GearShifter.reverse, 'N': GearShifter.neutral, + 'E': GearShifter.eco, 'T': GearShifter.manumatic, 'D': GearShifter.drive, + 'S': GearShifter.sport, 'L': GearShifter.low, 'B': GearShifter.brake + } + return d.get(gear, GearShifter.unknown) + + @staticmethod + def get_cam_can_parser(CP): + return None + + @staticmethod + def get_body_can_parser(CP): + return None + + @staticmethod + def get_loopback_can_parser(CP): + return None diff --git a/selfdrive/car/isotp_parallel_query.py b/selfdrive/car/isotp_parallel_query.py new file mode 100644 index 000000000..1209a8f1a --- /dev/null +++ b/selfdrive/car/isotp_parallel_query.py @@ -0,0 +1,148 @@ +import time +from collections import defaultdict +from functools import partial +from typing import Optional + +import cereal.messaging as messaging +from selfdrive.swaglog import cloudlog +from selfdrive.boardd.boardd import can_list_to_can_capnp +from panda.python.uds import CanClient, IsoTpMessage, FUNCTIONAL_ADDRS, get_rx_addr_for_tx_addr + + +class IsoTpParallelQuery: + def __init__(self, sendcan, logcan, bus, addrs, request, response, response_offset=0x8, functional_addr=False, debug=False): + self.sendcan = sendcan + self.logcan = logcan + self.bus = bus + self.request = request + self.response = response + self.debug = debug + self.functional_addr = functional_addr + + self.real_addrs = [] + for a in addrs: + if isinstance(a, tuple): + self.real_addrs.append(a) + else: + self.real_addrs.append((a, None)) + + self.msg_addrs = {tx_addr: get_rx_addr_for_tx_addr(tx_addr[0], rx_offset=response_offset) for tx_addr in self.real_addrs} + self.msg_buffer = defaultdict(list) + + def rx(self): + """Drain can socket and sort messages into buffers based on address""" + can_packets = messaging.drain_sock(self.logcan, wait_for_one=True) + + for packet in can_packets: + for msg in packet.can: + if msg.src == self.bus: + if self.functional_addr: + if (0x7E8 <= msg.address <= 0x7EF) or (0x18DAF100 <= msg.address <= 0x18DAF1FF): + fn_addr = next(a for a in FUNCTIONAL_ADDRS if msg.address - a <= 32) + self.msg_buffer[fn_addr].append((msg.address, msg.busTime, msg.dat, msg.src)) + elif msg.address in self.msg_addrs.values(): + self.msg_buffer[msg.address].append((msg.address, msg.busTime, msg.dat, msg.src)) + + def _can_tx(self, tx_addr, dat, bus): + """Helper function to send single message""" + msg = [tx_addr, 0, dat, bus] + self.sendcan.send(can_list_to_can_capnp([msg], msgtype='sendcan')) + + def _can_rx(self, addr, sub_addr=None): + """Helper function to retrieve message with specified address and subadress from buffer""" + keep_msgs = [] + + if sub_addr is None: + msgs = self.msg_buffer[addr] + else: + # Filter based on subadress + msgs = [] + for m in self.msg_buffer[addr]: + first_byte = m[2][0] + if first_byte == sub_addr: + msgs.append(m) + else: + keep_msgs.append(m) + + self.msg_buffer[addr] = keep_msgs + return msgs + + def _drain_rx(self): + messaging.drain_sock(self.logcan) + self.msg_buffer = defaultdict(list) + + def get_data(self, timeout, total_timeout=None): + if total_timeout is None: + total_timeout = 10 * timeout + + self._drain_rx() + + # Create message objects + msgs = {} + request_counter = {} + request_done = {} + for tx_addr, rx_addr in self.msg_addrs.items(): + # rx_addr not set when using functional tx addr + id_addr = rx_addr or tx_addr[0] + sub_addr = tx_addr[1] + + can_client = CanClient(self._can_tx, partial(self._can_rx, id_addr, sub_addr=sub_addr), tx_addr[0], rx_addr, + self.bus, sub_addr=sub_addr, debug=self.debug) + + max_len = 8 if sub_addr is None else 7 + + msg = IsoTpMessage(can_client, timeout=0, max_len=max_len, debug=self.debug) + msg.send(self.request[0]) + + msgs[tx_addr] = msg + request_counter[tx_addr] = 0 + request_done[tx_addr] = False + + results = {} + start_time = time.monotonic() + last_response_time = start_time + while True: + self.rx() + + if all(request_done.values()): + break + + for tx_addr, msg in msgs.items(): + try: + dat: Optional[bytes] = msg.recv() + except Exception: + cloudlog.exception("Error processing UDS response") + request_done[tx_addr] = True + continue + + if not dat: + continue + + counter = request_counter[tx_addr] + expected_response = self.response[counter] + response_valid = dat[:len(expected_response)] == expected_response + + if response_valid: + last_response_time = time.monotonic() + if counter + 1 < len(self.request): + msg.send(self.request[counter + 1]) + request_counter[tx_addr] += 1 + else: + results[tx_addr] = dat[len(expected_response):] + request_done[tx_addr] = True + else: + request_done[tx_addr] = True + cloudlog.warning(f"iso-tp query bad response: 0x{dat.hex()}") + + cur_time = time.monotonic() + if cur_time - last_response_time > timeout: + for tx_addr in msgs: + if (request_counter[tx_addr] > 0) and (not request_done[tx_addr]): + cloudlog.warning(f"iso-tp query timeout after receiving response: {tx_addr}") + break + + if cur_time - start_time > total_timeout: + cloudlog.warning("iso-tp query timeout while receiving data") + break + + return results diff --git a/selfdrive/car/mazda/__init__.py b/selfdrive/car/mazda/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/mazda/carcontroller.py b/selfdrive/car/mazda/carcontroller.py new file mode 100644 index 000000000..60bb62037 --- /dev/null +++ b/selfdrive/car/mazda/carcontroller.py @@ -0,0 +1,65 @@ +from cereal import car +from opendbc.can.packer import CANPacker +from selfdrive.car.mazda import mazdacan +from selfdrive.car.mazda.values import CarControllerParams, Buttons +from selfdrive.car import apply_std_steer_torque_limits + +VisualAlert = car.CarControl.HUDControl.VisualAlert + +class CarController(): + def __init__(self, dbc_name, CP, VM): + self.apply_steer_last = 0 + self.packer = CANPacker(dbc_name) + self.steer_rate_limited = False + self.brake_counter = 0 + + def update(self, c, CS, frame): + can_sends = [] + + apply_steer = 0 + self.steer_rate_limited = False + + if c.active: + # calculate steer and also set limits due to driver torque + new_steer = int(round(c.actuators.steer * CarControllerParams.STEER_MAX)) + apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, + CS.out.steeringTorque, CarControllerParams) + self.steer_rate_limited = new_steer != apply_steer + + if CS.out.standstill and frame % 5 == 0: + # Mazda Stop and Go requires a RES button (or gas) press if the car stops more than 3 seconds + # Send Resume button at 20hz if we're engaged at standstill to support full stop and go! + # TODO: improve the resume trigger logic by looking at actual radar data + can_sends.append(mazdacan.create_button_cmd(self.packer, CS.CP.carFingerprint, CS.crz_btns_counter, Buttons.RESUME)) + + if c.cruiseControl.cancel or (CS.out.cruiseState.enabled and not c.enabled): + # If brake is pressed, let us wait >70ms before trying to disable crz to avoid + # a race condition with the stock system, where the second cancel from openpilot + # will disable the crz 'main on'. crz ctrl msg runs at 50hz. 70ms allows us to + # read 3 messages and most likely sync state before we attempt cancel. + self.brake_counter = self.brake_counter + 1 + if frame % 10 == 0 and not (CS.out.brakePressed and self.brake_counter < 7): + # Cancel Stock ACC if it's enabled while OP is disengaged + # Send at a rate of 10hz until we sync with stock ACC state + can_sends.append(mazdacan.create_button_cmd(self.packer, CS.CP.carFingerprint, CS.crz_btns_counter, Buttons.CANCEL)) + else: + self.brake_counter = 0 + + self.apply_steer_last = apply_steer + + # send HUD alerts + if frame % 50 == 0: + ldw = c.hudControl.visualAlert == VisualAlert.ldw + steer_required = c.hudControl.visualAlert == VisualAlert.steerRequired + # TODO: find a way to silence audible warnings so we can add more hud alerts + steer_required = steer_required and CS.lkas_allowed_speed + can_sends.append(mazdacan.create_alert_command(self.packer, CS.cam_laneinfo, ldw, steer_required)) + + # send steering command + can_sends.append(mazdacan.create_steering_control(self.packer, CS.CP.carFingerprint, + frame, apply_steer, CS.cam_lkas)) + + new_actuators = c.actuators.copy() + new_actuators.steer = apply_steer / CarControllerParams.STEER_MAX + + return new_actuators, can_sends diff --git a/selfdrive/car/mazda/carstate.py b/selfdrive/car/mazda/carstate.py new file mode 100644 index 000000000..feb114754 --- /dev/null +++ b/selfdrive/car/mazda/carstate.py @@ -0,0 +1,205 @@ +from cereal import car +from selfdrive.config import Conversions as CV +from opendbc.can.can_define import CANDefine +from opendbc.can.parser import CANParser +from selfdrive.car.interfaces import CarStateBase +from selfdrive.car.mazda.values import DBC, LKAS_LIMITS, GEN1 + +class CarState(CarStateBase): + def __init__(self, CP): + super().__init__(CP) + + can_define = CANDefine(DBC[CP.carFingerprint]["pt"]) + self.shifter_values = can_define.dv["GEAR"]["GEAR"] + + self.crz_btns_counter = 0 + self.acc_active_last = False + self.low_speed_alert = False + self.lkas_allowed_speed = False + self.lkas_disabled = False + + def update(self, cp, cp_cam): + + ret = car.CarState.new_message() + ret.wheelSpeeds = self.get_wheel_speeds( + cp.vl["WHEEL_SPEEDS"]["FL"], + cp.vl["WHEEL_SPEEDS"]["FR"], + cp.vl["WHEEL_SPEEDS"]["RL"], + cp.vl["WHEEL_SPEEDS"]["RR"], + ) + ret.vEgoRaw = (ret.wheelSpeeds.fl + ret.wheelSpeeds.fr + ret.wheelSpeeds.rl + ret.wheelSpeeds.rr) / 4. + ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) + + # Match panda speed reading + speed_kph = cp.vl["ENGINE_DATA"]["SPEED"] + ret.standstill = speed_kph < .1 + + can_gear = int(cp.vl["GEAR"]["GEAR"]) + ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(can_gear, None)) + + ret.genericToggle = bool(cp.vl["BLINK_INFO"]["HIGH_BEAMS"]) + ret.leftBlindspot = cp.vl["BSM"]["LEFT_BS1"] == 1 + ret.rightBlindspot = cp.vl["BSM"]["RIGHT_BS1"] == 1 + ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(40, cp.vl["BLINK_INFO"]["LEFT_BLINK"] == 1, + cp.vl["BLINK_INFO"]["RIGHT_BLINK"] == 1) + + ret.steeringAngleDeg = cp.vl["STEER"]["STEER_ANGLE"] + ret.steeringTorque = cp.vl["STEER_TORQUE"]["STEER_TORQUE_SENSOR"] + ret.steeringPressed = abs(ret.steeringTorque) > LKAS_LIMITS.STEER_THRESHOLD + + ret.steeringTorqueEps = cp.vl["STEER_TORQUE"]["STEER_TORQUE_MOTOR"] + ret.steeringRateDeg = cp.vl["STEER_RATE"]["STEER_ANGLE_RATE"] + + # TODO: this should be from 0 - 1. + ret.brakePressed = cp.vl["PEDALS"]["BRAKE_ON"] == 1 + ret.brake = cp.vl["BRAKE"]["BRAKE_PRESSURE"] + + ret.seatbeltUnlatched = cp.vl["SEATBELT"]["DRIVER_SEATBELT"] == 0 + ret.doorOpen = any([cp.vl["DOORS"]["FL"], cp.vl["DOORS"]["FR"], + cp.vl["DOORS"]["BL"], cp.vl["DOORS"]["BR"]]) + + # TODO: this should be from 0 - 1. + ret.gas = cp.vl["ENGINE_DATA"]["PEDAL_GAS"] + ret.gasPressed = ret.gas > 0 + + # Either due to low speed or hands off + lkas_blocked = cp.vl["STEER_RATE"]["LKAS_BLOCK"] == 1 + + if self.CP.minSteerSpeed > 0: + # LKAS is enabled at 52kph going up and disabled at 45kph going down + # wait for LKAS_BLOCK signal to clear when going up since it lags behind the speed sometimes + if speed_kph > LKAS_LIMITS.ENABLE_SPEED and not lkas_blocked: + self.lkas_allowed_speed = True + elif speed_kph < LKAS_LIMITS.DISABLE_SPEED: + self.lkas_allowed_speed = False + + # TODO: the signal used for available seems to be the adaptive cruise signal, instead of the main on + # it should be used for carState.cruiseState.nonAdaptive instead + ret.cruiseState.available = cp.vl["CRZ_CTRL"]["CRZ_AVAILABLE"] == 1 + ret.cruiseState.enabled = cp.vl["CRZ_CTRL"]["CRZ_ACTIVE"] == 1 + ret.cruiseState.speed = cp.vl["CRZ_EVENTS"]["CRZ_SPEED"] * CV.KPH_TO_MS + + if ret.cruiseState.enabled: + if not self.lkas_allowed_speed and self.acc_active_last: + self.low_speed_alert = True + else: + self.low_speed_alert = False + + # Check if LKAS is disabled due to lack of driver torque when all other states indicate + # it should be enabled (steer lockout). Don't warn until we actually get lkas active + # and lose it again, i.e, after initial lkas activation + ret.steerWarning = self.lkas_allowed_speed and lkas_blocked + + self.acc_active_last = ret.cruiseState.enabled + + self.crz_btns_counter = cp.vl["CRZ_BTNS"]["CTR"] + + # camera signals + self.lkas_disabled = cp_cam.vl["CAM_LANEINFO"]["LANE_LINES"] == 0 + self.cam_lkas = cp_cam.vl["CAM_LKAS"] + self.cam_laneinfo = cp_cam.vl["CAM_LANEINFO"] + ret.steerError = cp_cam.vl["CAM_LKAS"]["ERR_BIT_1"] == 1 + + return ret + + @staticmethod + def get_can_parser(CP): + signals = [ + # sig_name, sig_address + ("LEFT_BLINK", "BLINK_INFO"), + ("RIGHT_BLINK", "BLINK_INFO"), + ("HIGH_BEAMS", "BLINK_INFO"), + ("STEER_ANGLE", "STEER"), + ("STEER_ANGLE_RATE", "STEER_RATE"), + ("STEER_TORQUE_SENSOR", "STEER_TORQUE"), + ("STEER_TORQUE_MOTOR", "STEER_TORQUE"), + ("FL", "WHEEL_SPEEDS"), + ("FR", "WHEEL_SPEEDS"), + ("RL", "WHEEL_SPEEDS"), + ("RR", "WHEEL_SPEEDS"), + ] + + checks = [ + # sig_address, frequency + ("BLINK_INFO", 10), + ("STEER", 67), + ("STEER_RATE", 83), + ("STEER_TORQUE", 83), + ("WHEEL_SPEEDS", 100), + ] + + if CP.carFingerprint in GEN1: + signals += [ + ("LKAS_BLOCK", "STEER_RATE"), + ("LKAS_TRACK_STATE", "STEER_RATE"), + ("HANDS_OFF_5_SECONDS", "STEER_RATE"), + ("CRZ_ACTIVE", "CRZ_CTRL"), + ("CRZ_AVAILABLE", "CRZ_CTRL"), + ("CRZ_SPEED", "CRZ_EVENTS"), + ("STANDSTILL", "PEDALS"), + ("BRAKE_ON", "PEDALS"), + ("BRAKE_PRESSURE", "BRAKE"), + ("GEAR", "GEAR"), + ("DRIVER_SEATBELT", "SEATBELT"), + ("FL", "DOORS"), + ("FR", "DOORS"), + ("BL", "DOORS"), + ("BR", "DOORS"), + ("PEDAL_GAS", "ENGINE_DATA"), + ("SPEED", "ENGINE_DATA"), + ("CTR", "CRZ_BTNS"), + ("LEFT_BS1", "BSM"), + ("RIGHT_BS1", "BSM"), + ] + + checks += [ + ("ENGINE_DATA", 100), + ("CRZ_CTRL", 50), + ("CRZ_EVENTS", 50), + ("CRZ_BTNS", 10), + ("PEDALS", 50), + ("BRAKE", 50), + ("SEATBELT", 10), + ("DOORS", 10), + ("GEAR", 20), + ("BSM", 10), + ] + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 0) + + @staticmethod + def get_cam_can_parser(CP): + signals = [] + checks = [] + + if CP.carFingerprint in GEN1: + signals += [ + # sig_name, sig_address + ("LKAS_REQUEST", "CAM_LKAS"), + ("CTR", "CAM_LKAS"), + ("ERR_BIT_1", "CAM_LKAS"), + ("LINE_NOT_VISIBLE", "CAM_LKAS"), + ("BIT_1", "CAM_LKAS"), + ("ERR_BIT_2", "CAM_LKAS"), + ("STEERING_ANGLE", "CAM_LKAS"), + ("ANGLE_ENABLED", "CAM_LKAS"), + ("CHKSUM", "CAM_LKAS"), + + ("LINE_VISIBLE", "CAM_LANEINFO"), + ("LINE_NOT_VISIBLE", "CAM_LANEINFO"), + ("LANE_LINES", "CAM_LANEINFO"), + ("BIT1", "CAM_LANEINFO"), + ("BIT2", "CAM_LANEINFO"), + ("BIT3", "CAM_LANEINFO"), + ("NO_ERR_BIT", "CAM_LANEINFO"), + ("S1", "CAM_LANEINFO"), + ("S1_HBEAM", "CAM_LANEINFO"), + ] + + checks += [ + # sig_address, frequency + ("CAM_LANEINFO", 2), + ("CAM_LKAS", 16), + ] + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 2) diff --git a/selfdrive/car/mazda/interface.py b/selfdrive/car/mazda/interface.py new file mode 100755 index 000000000..c702f5300 --- /dev/null +++ b/selfdrive/car/mazda/interface.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python3 +from cereal import car +from selfdrive.config import Conversions as CV +from selfdrive.car.mazda.values import CAR, LKAS_LIMITS +from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config +from selfdrive.car.interfaces import CarInterfaceBase + +ButtonType = car.CarState.ButtonEvent.Type +EventName = car.CarEvent.EventName + +class CarInterface(CarInterfaceBase): + + @staticmethod + def compute_gb(accel, speed): + return float(accel) / 4.0 + + @staticmethod + def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None): + ret = CarInterfaceBase.get_std_params(candidate, fingerprint) + + ret.carName = "mazda" + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.mazda)] + ret.radarOffCan = True + + ret.dashcamOnly = candidate not in (CAR.CX5_2022, CAR.CX9_2021) + + ret.steerActuatorDelay = 0.1 + ret.steerRateCost = 1.0 + ret.steerLimitTimer = 0.8 + tire_stiffness_factor = 0.70 # not optimized yet + + if candidate in (CAR.CX5, CAR.CX5_2022): + ret.mass = 3655 * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.7 + ret.steerRatio = 15.5 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.19], [0.019]] + ret.lateralTuning.pid.kf = 0.00006 + elif candidate in (CAR.CX9, CAR.CX9_2021): + ret.mass = 4217 * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 3.1 + ret.steerRatio = 17.6 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.19], [0.019]] + ret.lateralTuning.pid.kf = 0.00006 + elif candidate == CAR.MAZDA3: + ret.mass = 2875 * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.7 + ret.steerRatio = 14.0 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.19], [0.019]] + ret.lateralTuning.pid.kf = 0.00006 + elif candidate == CAR.MAZDA6: + ret.mass = 3443 * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.83 + ret.steerRatio = 15.5 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.19], [0.019]] + ret.lateralTuning.pid.kf = 0.00006 + + if candidate not in (CAR.CX5_2022, ): + ret.minSteerSpeed = LKAS_LIMITS.DISABLE_SPEED * CV.KPH_TO_MS + + ret.centerToFront = ret.wheelbase * 0.41 + + # TODO: get actual value, for now starting with reasonable value for + # civic and scaling by mass and wheelbase + ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) + + # TODO: start from empirically derived lateral slip stiffness for the civic and scale by + # mass and CG position, so all cars will have approximately similar dyn behaviors + ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, + tire_stiffness_factor=tire_stiffness_factor) + + return ret + + # returns a car.CarState + def update(self, c, can_strings): + + self.cp.update_strings(can_strings) + self.cp_cam.update_strings(can_strings) + + ret = self.CS.update(self.cp, self.cp_cam) + self.post_update(c,ret) + + ret.canValid = self.cp.can_valid and self.cp_cam.can_valid + + # events + events = self.create_common_events(ret) + + if self.CS.lkas_disabled: + events.add(EventName.lkasDisabled) + elif self.CS.low_speed_alert: + events.add(EventName.belowSteerSpeed) + + ret.events = events.to_msg() + + self.CS.out = ret.as_reader() + return self.CS.out + + def apply(self, c): + ret = self.CC.update(c, self.CS, self.frame) + self.frame += 1 + return ret diff --git a/selfdrive/car/mazda/mazdacan.py b/selfdrive/car/mazda/mazdacan.py new file mode 100644 index 000000000..e2ee93e02 --- /dev/null +++ b/selfdrive/car/mazda/mazdacan.py @@ -0,0 +1,119 @@ +import copy + +from selfdrive.car.mazda.values import GEN1, Buttons + + +def create_steering_control(packer, car_fingerprint, frame, apply_steer, lkas): + + tmp = apply_steer + 2048 + + lo = tmp & 0xFF + hi = tmp >> 8 + + # copy values from camera + b1 = int(lkas["BIT_1"]) + er1 = int(lkas["ERR_BIT_1"]) + lnv = 0 + ldw = 0 + er2 = int(lkas["ERR_BIT_2"]) + + # Some older models do have these, newer models don't. + # Either way, they all work just fine if set to zero. + steering_angle = 0 + b2 = 0 + + tmp = steering_angle + 2048 + ahi = tmp >> 10 + amd = (tmp & 0x3FF) >> 2 + amd = (amd >> 4) | (( amd & 0xF) << 4) + alo = (tmp & 0x3) << 2 + + ctr = frame % 16 + # bytes: [ 1 ] [ 2 ] [ 3 ] [ 4 ] + csum = 249 - ctr - hi - lo - (lnv << 3) - er1 - (ldw << 7) - ( er2 << 4) - (b1 << 5) + + # bytes [ 5 ] [ 6 ] [ 7 ] + csum = csum - ahi - amd - alo - b2 + + if ahi == 1: + csum = csum + 15 + + if csum < 0: + if csum < -256: + csum = csum + 512 + else: + csum = csum + 256 + + csum = csum % 256 + + if car_fingerprint in GEN1: + values = { + "LKAS_REQUEST": apply_steer, + "CTR": ctr, + "ERR_BIT_1": er1, + "LINE_NOT_VISIBLE" : lnv, + "LDW": ldw, + "BIT_1": b1, + "ERR_BIT_2": er2, + "STEERING_ANGLE": steering_angle, + "ANGLE_ENABLED": b2, + "CHKSUM": csum + } + + return packer.make_can_msg("CAM_LKAS", 0, values) + + +def create_alert_command(packer, cam_msg: dict, ldw: bool, steer_required: bool): + values = copy.copy(cam_msg) + values.update({ + # TODO: what's the difference between all these? do we need to send all? + "HANDS_WARN_3_BITS": 0b111 if steer_required else 0, + "HANDS_ON_STEER_WARN": steer_required, + "HANDS_ON_STEER_WARN_2": steer_required, + + # TODO: right lane works, left doesn't + # TODO: need to do something about L/R + "LDW_WARN_LL": 0, + "LDW_WARN_RL": 0, + }) + return packer.make_can_msg("CAM_LANEINFO", 0, values) + + +def create_button_cmd(packer, car_fingerprint, counter, button): + + can = int(button == Buttons.CANCEL) + res = int(button == Buttons.RESUME) + + if car_fingerprint in GEN1: + values = { + "CAN_OFF": can, + "CAN_OFF_INV": (can + 1) % 2, + + "SET_P": 0, + "SET_P_INV": 1, + + "RES": res, + "RES_INV": (res + 1) % 2, + + "SET_M": 0, + "SET_M_INV": 1, + + "DISTANCE_LESS": 0, + "DISTANCE_LESS_INV": 1, + + "DISTANCE_MORE": 0, + "DISTANCE_MORE_INV": 1, + + "MODE_X": 0, + "MODE_X_INV": 1, + + "MODE_Y": 0, + "MODE_Y_INV": 1, + + "BIT1": 1, + "BIT2": 1, + "BIT3": 1, + "CTR": (counter + 1) % 16, + } + + return packer.make_can_msg("CRZ_BTNS", 0, values) diff --git a/selfdrive/car/mazda/radar_interface.py b/selfdrive/car/mazda/radar_interface.py new file mode 100755 index 000000000..b2f765113 --- /dev/null +++ b/selfdrive/car/mazda/radar_interface.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 +from selfdrive.car.interfaces import RadarInterfaceBase + +class RadarInterface(RadarInterfaceBase): + pass diff --git a/selfdrive/car/mazda/values.py b/selfdrive/car/mazda/values.py new file mode 100644 index 000000000..1fcf18428 --- /dev/null +++ b/selfdrive/car/mazda/values.py @@ -0,0 +1,274 @@ +from selfdrive.car import dbc_dict +from cereal import car +Ecu = car.CarParams.Ecu + + +# Steer torque limits + +class CarControllerParams: + STEER_MAX = 800 # theoretical max_steer 2047 + STEER_DELTA_UP = 10 # torque increase per refresh + STEER_DELTA_DOWN = 25 # torque decrease per refresh + STEER_DRIVER_ALLOWANCE = 15 # allowed driver torque before start limiting + STEER_DRIVER_MULTIPLIER = 1 # weight driver torque + STEER_DRIVER_FACTOR = 1 # from dbc + STEER_ERROR_MAX = 350 # max delta between torque cmd and torque motor + +class CAR: + CX5 = "MAZDA CX-5" + CX9 = "MAZDA CX-9" + MAZDA3 = "MAZDA 3" + MAZDA6 = "MAZDA 6" + CX9_2021 = "MAZDA CX-9 2021" + CX5_2022 = "MAZDA CX-5 2022" + +class LKAS_LIMITS: + STEER_THRESHOLD = 15 + DISABLE_SPEED = 45 # kph + ENABLE_SPEED = 52 # kph + +class Buttons: + NONE = 0 + SET_PLUS = 1 + SET_MINUS = 2 + RESUME = 3 + CANCEL = 4 + + +FW_VERSIONS = { + CAR.CX5_2022 : { + (Ecu.eps, 0x730, None): [ + b'KSD5-3210X-C-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'PX2G-188K2-H\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x764, None): [ + b'K131-67XK2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x760, None): [ + b'KSD5-437K2-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x706, None): [ + b'GSH7-67XK2-S\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.transmission, 0x7e1, None): [ + b'PYB2-21PS1-H\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + }, + CAR.CX5: { + (Ecu.eps, 0x730, None): [ + b'KJ01-3210X-G-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'KJ01-3210X-J-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'KJ01-3210X-M-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'K319-3210X-A-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'PA53-188K2-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYFA-188K2-J\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYFC-188K2-J\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYFD-188K2-J\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYNF-188K2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PX2F-188K2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PX2G-188K2-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PX2H-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PX2H-188K2-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PX2H-188K2-G\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PX2K-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PX38-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PX42-188K2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PX68-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'SHKT-188K2-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x764, None): [ + b'K123-67XK2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'K131-67XK2-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'K131-67XK2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'K131-67XK2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'K131-67XK2-E\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'K131-67XK2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x760, None): [ + b'K123-437K2-E\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'KBJ5-437K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'KL2K-437K2-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'KN0W-437K2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x706, None): [ + b'B61L-67XK2-R\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'B61L-67XK2-S\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'B61L-67XK2-T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'B61L-67XK2-V\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'GSH7-67XK2-J\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'GSH7-67XK2-M\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'GSH7-67XK2-N\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'GSH7-67XK2-R\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.transmission, 0x7e1, None): [ + b'PA66-21PS1-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PX39-21PS1-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PX39-21PS1-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PX68-21PS1-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYB1-21PS1-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYB1-21PS1-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYB1-21PS1-G\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYB2-21PS1-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYB2-21PS1-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYB2-21PS1-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYB2-21PS1-G\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYB2-21PS1-H\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYNC-21PS1-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'SH9T-21PS1-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + }, + + CAR.CX9 : { + (Ecu.eps, 0x730, None): [ + b'K070-3210X-C-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'KJ01-3210X-G-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'KJ01-3210X-L-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'PX23-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PX24-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PXN8-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PXN8-188K2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYD7-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYD8-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYFM-188K2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYFM-188K2-H\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x764, None): [ + b'K123-67XK2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'K131-67XK2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'K131-67XK2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'TK80-67XK2-E\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'TK80-67XK2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x760, None): [ + b'TA0B-437K2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'TK79-437K2-E\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'TK79-437K2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'TM53-437K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'TN40-437K2-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x706, None): [ + b'B61L-67XK2-P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'B61L-67XK2-V\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'GSH7-67XK2-K\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'TK80-67XK2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.transmission, 0x7e1, None): [ + b'PXM7-21PS1-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PXM7-21PS1-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYFM-21PS1-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYFM-21PS1-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYD5-21PS1-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYD5-21PS1-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYD6-21PS1-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYD6-21PS1-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + }, + + CAR.MAZDA3: { + (Ecu.eps, 0x730, None): [ + b'BHN1-3210X-J-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'K070-3210X-C-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'KR11-3210X-K-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + + ], + (Ecu.engine, 0x7e0, None): [ + b'P5JD-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PY2P-188K2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYJW-188K2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYKC-188K2-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYKE-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x764, None): [ + b'B63C-67XK2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'GHP9-67Y10---41\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'K131-67XK2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x760, None): [ + b'B45A-437AS-0-08\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x706, None): [ + b'B61L-67XK2-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'B61L-67XK2-P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'B61L-67XK2-Q\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'B61L-67XK2-T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.transmission, 0x7e1, None): [ + b'PY2S-21PS1-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'P52G-21PS1-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYKA-21PS1-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYKE-21PS1-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PYKE-21PS1-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + }, + + CAR.MAZDA6: { + (Ecu.eps, 0x730, None): [ + b'GBEF-3210X-B-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'GFBC-3210X-A-00\000\000\000\000\000\000\000\000\000', + ], + (Ecu.engine, 0x7e0, None): [ + b'PX4F-188K2-D\000\000\000\000\000\000\000\000\000\000\000\000', + b'PYH7-188K2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x764, None): [ + b'K131-67XK2-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'K131-67XK2-E\000\000\000\000\000\000\000\000\000\000\000\000', + ], + (Ecu.esp, 0x760, None): [ + b'GBVH-437K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'GDDM-437K2-A\000\000\000\000\000\000\000\000\000\000\000\000', + ], + (Ecu.fwdCamera, 0x706, None): [ + b'B61L-67XK2-S\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'GSH7-67XK2-P\000\000\000\000\000\000\000\000\000\000\000\000', + ], + (Ecu.transmission, 0x7e1, None): [ + b'PYH3-21PS1-D\000\000\000\000\000\000\000\000\000\000\000\000', + b'PYH7-21PS1-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + }, + + CAR.CX9_2021 : { + (Ecu.eps, 0x730, None): [ + b'TC3M-3210X-A-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'PXM4-188K2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PXM4-188K2-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x764, None): [ + b'K131-67XK2-E\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'K131-67XK2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x760, None): [ + b'TA0B-437K2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x706, None): [ + b'GSH7-67XK2-M\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'GSH7-67XK2-N\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'GSH7-67XK2-P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.transmission, 0x7e1, None): [ + b'PXM4-21PS1-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + } +} + + +DBC = { + CAR.CX5: dbc_dict('mazda_2017', None), + CAR.CX9: dbc_dict('mazda_2017', None), + CAR.MAZDA3: dbc_dict('mazda_2017', None), + CAR.MAZDA6: dbc_dict('mazda_2017', None), + CAR.CX9_2021: dbc_dict('mazda_2017', None), + CAR.CX5_2022: dbc_dict('mazda_2017', None), +} + +# Gen 1 hardware: same CAN messages and same camera +GEN1 = {CAR.CX5, CAR.CX9, CAR.CX9_2021, CAR.MAZDA3, CAR.MAZDA6, CAR.CX5_2022} diff --git a/selfdrive/car/mock/__init__.py b/selfdrive/car/mock/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/mock/interface.py b/selfdrive/car/mock/interface.py new file mode 100755 index 000000000..ef9b980ad --- /dev/null +++ b/selfdrive/car/mock/interface.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python3 +import math +from cereal import car +from selfdrive.config import Conversions as CV +from selfdrive.swaglog import cloudlog +import cereal.messaging as messaging +from selfdrive.car import gen_empty_fingerprint, get_safety_config +from selfdrive.car.interfaces import CarInterfaceBase + +# mocked car interface to work with chffrplus +TS = 0.01 # 100Hz +YAW_FR = 0.2 # ~0.8s time constant on yaw rate filter +# low pass gain +LPG = 2 * math.pi * YAW_FR * TS / (1 + 2 * math.pi * YAW_FR * TS) + + +class CarInterface(CarInterfaceBase): + def __init__(self, CP, CarController, CarState): + super().__init__(CP, CarController, CarState) + + cloudlog.debug("Using Mock Car Interface") + + self.sensor = messaging.sub_sock('sensorEvents') + self.gps = messaging.sub_sock('gpsLocationExternal') + + self.speed = 0. + self.prev_speed = 0. + self.yaw_rate = 0. + self.yaw_rate_meas = 0. + + @staticmethod + def compute_gb(accel, speed): + return accel + + @staticmethod + def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None): + ret = CarInterfaceBase.get_std_params(candidate, fingerprint) + ret.carName = "mock" + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.noOutput)] + ret.mass = 1700. + ret.rotationalInertia = 2500. + ret.wheelbase = 2.70 + ret.centerToFront = ret.wheelbase * 0.5 + ret.steerRatio = 13. # reasonable + ret.tireStiffnessFront = 1e6 # very stiff to neglect slip + ret.tireStiffnessRear = 1e6 # very stiff to neglect slip + + return ret + + # returns a car.CarState + def update(self, c, can_strings): + # get basic data from phone and gps since CAN isn't connected + sensors = messaging.recv_sock(self.sensor) + if sensors is not None: + for sensor in sensors.sensorEvents: + if sensor.type == 4: # gyro + self.yaw_rate_meas = -sensor.gyro.v[0] + + gps = messaging.recv_sock(self.gps) + if gps is not None: + self.prev_speed = self.speed + self.speed = gps.gpsLocationExternal.speed + + # create message + ret = car.CarState.new_message() + ret.canValid = True + + # speeds + ret.vEgo = self.speed + ret.vEgoRaw = self.speed + a = self.speed - self.prev_speed + + ret.aEgo = a + ret.brakePressed = a < -0.5 + + ret.standstill = self.speed < 0.01 + ret.wheelSpeeds.fl = self.speed + ret.wheelSpeeds.fr = self.speed + ret.wheelSpeeds.rl = self.speed + ret.wheelSpeeds.rr = self.speed + + self.yawRate = LPG * self.yaw_rate_meas + (1. - LPG) * self.yaw_rate + curvature = self.yaw_rate / max(self.speed, 1.) + ret.steeringAngleDeg = curvature * self.CP.steerRatio * self.CP.wheelbase * CV.RAD_TO_DEG + return ret.as_reader() + + def apply(self, c): + # in mock no carcontrols + actuators = car.CarControl.Actuators.new_message() + return actuators, [] diff --git a/selfdrive/car/mock/radar_interface.py b/selfdrive/car/mock/radar_interface.py new file mode 100755 index 000000000..b2f765113 --- /dev/null +++ b/selfdrive/car/mock/radar_interface.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 +from selfdrive.car.interfaces import RadarInterfaceBase + +class RadarInterface(RadarInterfaceBase): + pass diff --git a/selfdrive/car/mock/values.py b/selfdrive/car/mock/values.py new file mode 100644 index 000000000..0dd91565b --- /dev/null +++ b/selfdrive/car/mock/values.py @@ -0,0 +1,2 @@ +class CAR: + MOCK = 'mock' diff --git a/selfdrive/car/modules/ALC_module.py b/selfdrive/car/modules/ALC_module.py new file mode 100644 index 000000000..fa69b726c --- /dev/null +++ b/selfdrive/car/modules/ALC_module.py @@ -0,0 +1,41 @@ +from cereal import log + +LaneChangeState = log.LateralPlan.LaneChangeState +LaneChangeDirection = log.LateralPlan.LaneChangeDirection + +class ALCController: + + def __init__ (self): + self.alca_engaged_frame = 0 + + + def update(self, enabled, CS, frame, lat_plan): + #get lat plan info + + if lat_plan is not None: + CS.alca_pre_engage = lat_plan.lateralPlan.laneChangeState in [LaneChangeState.preLaneChange] + CS.alca_engaged = lat_plan.lateralPlan.laneChangeState in [LaneChangeState.laneChangeStarting, + LaneChangeState.laneChangeFinishing] + CS.alca_done = lat_plan.lateralPlan.laneChangeState in [LaneChangeState.laneChangeFinishing] + # 0-none, 1-left, 2-right + if (CS.alca_pre_engage or CS.alca_engaged) and not CS.alca_done: + if lat_plan.lateralPlan.laneChangeDirection == log.LateralPlan.LaneChangeDirection.left: + CS.alca_direction = 1 + elif lat_plan.lateralPlan.laneChangeDirection == log.LateralPlan.LaneChangeDirection.right: + CS.alca_direction = 2 + else: + CS.alca_direction = 0 + else: + CS.alca_direction = 0 + + if CS.alca_pre_engage: + if CS.alca_pre_engage != CS.prev_alca_pre_engage: + self.alca_engaged_frame = frame + if (CS.autoStartAlcaDelay > 0) and (self.alca_engaged_frame > 0) and (frame - self.alca_engaged_frame > CS.autoStartAlcaDelay * 100): + CS.alca_need_engagement = True + else: + CS.alca_need_engagement = False + else: + CS.alca_need_engagement = False + self.alca_engaged_frame = frame + CS.prev_alca_pre_engage = CS.alca_pre_engage \ No newline at end of file diff --git a/selfdrive/car/modules/BLNK_module.py b/selfdrive/car/modules/BLNK_module.py new file mode 100644 index 000000000..a1c964096 --- /dev/null +++ b/selfdrive/car/modules/BLNK_module.py @@ -0,0 +1,53 @@ +class BLNKController: + def __init__(self): + # stalk signal for less than 550ms means it was tapped + self.tap_duration_frames = 55 + self.tap_direction = 0 + self.blinker_on_frame_start = 0 + self.blinker_on_frame_end = 0 + self.prev_turnSignalStalkState = 0 + + def update_state(self, CS, frame): + #opposite direction so start canceling + if ( + self.tap_direction > 0 + and CS.turnSignalStalkState > 0 + and self.tap_direction != CS.turnSignalStalkState + ): + self.tap_direction = 0 + self.blinker_on_frame_start = 0 + self.blinker_on_frame_end = 0 + + # turn signal stalk just turned on, capture frame + if ( + CS.turnSignalStalkState > 0 + and self.prev_turnSignalStalkState == 0 + ): + self.blinker_on_frame_start = frame + # turn signal stalk just turned off + elif ( + CS.turnSignalStalkState == 0 + and self.prev_turnSignalStalkState > 0 + ): + if frame - self.blinker_on_frame_start <= self.tap_duration_frames: + #recognize tap + self.tap_direction = self.prev_turnSignalStalkState + self.blinker_on_frame_end = frame + else: + #too long, no tap + self.tap_direction = 0 + self.blinker_on_frame_start = 0 + self.blinker_on_frame_end = 0 + + # check what we need to maintain + if ( + self.tap_direction > 0 + and frame - self.blinker_on_frame_start > self.tap_duration_frames + and frame - self.blinker_on_frame_end > self.tap_duration_frames + and CS.alca_direction != self.tap_direction + ): + self.tap_direction = 0 + self.blinker_on_frame_start = 0 + self.blinker_on_frame_end = 0 + + self.prev_turnSignalStalkState = CS.turnSignalStalkState \ No newline at end of file diff --git a/selfdrive/car/modules/CFG_module.py b/selfdrive/car/modules/CFG_module.py new file mode 100644 index 000000000..882e10380 --- /dev/null +++ b/selfdrive/car/modules/CFG_module.py @@ -0,0 +1,48 @@ +import configparser +from common.basedir import BASEDIR + +#operate with params +OP_PARAMS_PATH = "/data/params/" + +def save_bool_param(param_name,param_value): + try: + real_param_value = 1 if param_value else 0 + with open(OP_PARAMS_PATH+"/"+param_name, "w") as outfile: + outfile.write(f'{real_param_value}') + except IOError: + print("Failed to save "+param_name+" with value ",param_value) + + +def load_bool_param(param_name,param_def_value): + try: + with open(OP_PARAMS_PATH+"/"+param_name, 'r') as f: + for line in f: + value_saved = int(line) + #print("Reading Params ",param_name , "value", value_saved) + return True if value_saved == 1 else False + except IOError: + print("Initializing "+param_name+" with value ",param_def_value) + save_bool_param(param_name,param_def_value) + return param_def_value + +def save_float_param(param_name,param_value): + try: + real_param_value = param_value * 1.0 + with open(OP_PARAMS_PATH+"/"+param_name, "w") as outfile: + outfile.write(f'{real_param_value}') + except IOError: + print("Failed to save "+param_name+" with value ",real_param_value) + + +def load_float_param(param_name,param_def_value): + try: + with open(OP_PARAMS_PATH+"/"+param_name, 'r') as f: + for line in f: + value_saved = float(line) + #print("Reading Params ",param_name , "value", value_saved) + return value_saved * 1.0 + except IOError: + print("Initializing "+param_name+" with value ",param_def_value*1.0) + save_float_param(param_name,param_def_value * 1.0) + return param_def_value * 1.0 + diff --git a/selfdrive/car/modules/HSO_module.py b/selfdrive/car/modules/HSO_module.py new file mode 100644 index 000000000..ee24fbf87 --- /dev/null +++ b/selfdrive/car/modules/HSO_module.py @@ -0,0 +1,29 @@ +# human steer override module + +class HSOController: + def __init__(self): + self.human_control = False + self.frame_humanSteered = 0 + + def update_stat(self, CS, enabled, actuators, frame): + human_control = False + + if CS.enableHSO and enabled: + # if steering but not by ALCA + if CS.realSteeringPressed: + self.frame_humanSteered = frame + elif (frame - self.frame_humanSteered < 50) and (CS.turnSignalStalkState > 0): + # stalk locked, update frame + self.frame_humanSteered = frame + elif (frame - self.frame_humanSteered < 50): + # Need more human testing of handoff timing + # Find steering difference between visiond model and human (no need to do every frame if we run out of CPU): + apply_steer = int(actuators.steeringAngleDeg) + angle_diff = abs(apply_steer - CS.out.steeringAngleDeg) + if angle_diff > 15.0: + self.frame_humanSteered = frame + if frame - self.frame_humanSteered < 50: + human_control = True + + self.human_control = human_control + return human_control and enabled diff --git a/selfdrive/car/modules/__init__.py b/selfdrive/car/modules/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/modules/qt/moc_num_param.cc b/selfdrive/car/modules/qt/moc_num_param.cc new file mode 100644 index 000000000..46980f0c3 --- /dev/null +++ b/selfdrive/car/modules/qt/moc_num_param.cc @@ -0,0 +1,94 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'num_param.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "num_param.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'num_param.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_NumParamControl_t { + QByteArrayData data[1]; + char stringdata0[16]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_NumParamControl_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_NumParamControl_t qt_meta_stringdata_NumParamControl = { + { +QT_MOC_LITERAL(0, 0, 15) // "NumParamControl" + + }, + "NumParamControl" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_NumParamControl[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void NumParamControl::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject NumParamControl::staticMetaObject = { { + &ButtonControl::staticMetaObject, + qt_meta_stringdata_NumParamControl.data, + qt_meta_data_NumParamControl, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *NumParamControl::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *NumParamControl::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_NumParamControl.stringdata0)) + return static_cast(this); + return ButtonControl::qt_metacast(_clname); +} + +int NumParamControl::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = ButtonControl::qt_metacall(_c, _id, _a); + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/car/modules/qt/moc_tcontrols.cc b/selfdrive/car/modules/qt/moc_tcontrols.cc new file mode 100644 index 000000000..bbc1160b2 --- /dev/null +++ b/selfdrive/car/modules/qt/moc_tcontrols.cc @@ -0,0 +1,94 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'tcontrols.hpp' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "tcontrols.hpp" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'tcontrols.hpp' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_TinklaParamControl_t { + QByteArrayData data[1]; + char stringdata0[19]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_TinklaParamControl_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_TinklaParamControl_t qt_meta_stringdata_TinklaParamControl = { + { +QT_MOC_LITERAL(0, 0, 18) // "TinklaParamControl" + + }, + "TinklaParamControl" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_TinklaParamControl[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void TinklaParamControl::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject TinklaParamControl::staticMetaObject = { { + &ToggleControl::staticMetaObject, + qt_meta_stringdata_TinklaParamControl.data, + qt_meta_data_TinklaParamControl, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *TinklaParamControl::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *TinklaParamControl::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_TinklaParamControl.stringdata0)) + return static_cast(this); + return ToggleControl::qt_metacast(_clname); +} + +int TinklaParamControl::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = ToggleControl::qt_metacall(_c, _id, _a); + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/car/modules/qt/moc_tsettings.cc b/selfdrive/car/modules/qt/moc_tsettings.cc new file mode 100644 index 000000000..c8935b81a --- /dev/null +++ b/selfdrive/car/modules/qt/moc_tsettings.cc @@ -0,0 +1,234 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'tsettings.hpp' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "tsettings.hpp" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'tsettings.hpp' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_TinklaTogglesPanel_t { + QByteArrayData data[1]; + char stringdata0[19]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_TinklaTogglesPanel_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_TinklaTogglesPanel_t qt_meta_stringdata_TinklaTogglesPanel = { + { +QT_MOC_LITERAL(0, 0, 18) // "TinklaTogglesPanel" + + }, + "TinklaTogglesPanel" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_TinklaTogglesPanel[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void TinklaTogglesPanel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject TinklaTogglesPanel::staticMetaObject = { { + &ListWidget::staticMetaObject, + qt_meta_stringdata_TinklaTogglesPanel.data, + qt_meta_data_TinklaTogglesPanel, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *TinklaTogglesPanel::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *TinklaTogglesPanel::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_TinklaTogglesPanel.stringdata0)) + return static_cast(this); + return ListWidget::qt_metacast(_clname); +} + +int TinklaTogglesPanel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = ListWidget::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_TeslaPreApTogglesPanel_t { + QByteArrayData data[1]; + char stringdata0[23]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_TeslaPreApTogglesPanel_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_TeslaPreApTogglesPanel_t qt_meta_stringdata_TeslaPreApTogglesPanel = { + { +QT_MOC_LITERAL(0, 0, 22) // "TeslaPreApTogglesPanel" + + }, + "TeslaPreApTogglesPanel" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_TeslaPreApTogglesPanel[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void TeslaPreApTogglesPanel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject TeslaPreApTogglesPanel::staticMetaObject = { { + &ListWidget::staticMetaObject, + qt_meta_stringdata_TeslaPreApTogglesPanel.data, + qt_meta_data_TeslaPreApTogglesPanel, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *TeslaPreApTogglesPanel::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *TeslaPreApTogglesPanel::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_TeslaPreApTogglesPanel.stringdata0)) + return static_cast(this); + return ListWidget::qt_metacast(_clname); +} + +int TeslaPreApTogglesPanel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = ListWidget::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_TeslaTogglesPanel_t { + QByteArrayData data[1]; + char stringdata0[18]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_TeslaTogglesPanel_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_TeslaTogglesPanel_t qt_meta_stringdata_TeslaTogglesPanel = { + { +QT_MOC_LITERAL(0, 0, 17) // "TeslaTogglesPanel" + + }, + "TeslaTogglesPanel" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_TeslaTogglesPanel[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void TeslaTogglesPanel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject TeslaTogglesPanel::staticMetaObject = { { + &ListWidget::staticMetaObject, + qt_meta_stringdata_TeslaTogglesPanel.data, + qt_meta_data_TeslaTogglesPanel, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *TeslaTogglesPanel::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *TeslaTogglesPanel::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_TeslaTogglesPanel.stringdata0)) + return static_cast(this); + return ListWidget::qt_metacast(_clname); +} + +int TeslaTogglesPanel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = ListWidget::qt_metacall(_c, _id, _a); + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/car/modules/qt/num_param.cc b/selfdrive/car/modules/qt/num_param.cc new file mode 100644 index 000000000..f2c733f2c --- /dev/null +++ b/selfdrive/car/modules/qt/num_param.cc @@ -0,0 +1,63 @@ +#include "selfdrive/car/modules/qt/num_param.h" +#include "selfdrive/car/modules/qt/tinklaparams.h" +#include "selfdrive/ui/qt/api.h" +#include "selfdrive/ui/qt/widgets/input.h" + +NumParamControl::NumParamControl(QString theLabel, QString theDescription, + QString theWindowTitle, QString theWindowInfo, QString theUom, + QString theParam, float theDefaultValue, + float minVal, float maxVal, float stepVal, QString icon) : ButtonControl(theLabel, "", theDescription) { + param_label.setAlignment(Qt::AlignRight | Qt::AlignVCenter); + param_label.setStyleSheet("color: #aaaaaa"); + QPixmap pix(icon); + QLabel *icon_label = new QLabel(); + icon_label->setPixmap(pix.scaledToWidth(80, Qt::SmoothTransformation)); + icon_label->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + hlayout->insertWidget(0,icon_label); + hlayout->insertWidget(2, ¶m_label); + param_name = theParam; + default_value = theDefaultValue; + window_title = theWindowTitle; + window_info = theWindowInfo; + description_txt = theDescription; + label_txt = theLabel; + uom = theUom; + min_val = minVal; + max_val = maxVal; + step_val = stepVal; + window_info = window_info + "\n" + + "Min: " + QString::number(min_val)+ + " | Max: " + QString::number(max_val) + + " | Step: " + QString::number(step_val); + + QObject::connect(this, &ButtonControl::clicked, [=]() { + try { + QString txtValue = InputDialog::getNumber(window_title, this, + window_info, false, 1, QString::number(value)); + if (txtValue != "") { + QTextStream floatTextStream(&txtValue); + floatTextStream >> value; + value = step_val * (int)(value/step_val); + if (value < min_val) + value = min_val; + if (value > max_val) + value = max_val; + tinkla_set_float_param(param_name.toStdString(),value); + } + } catch(std::exception e) { + //restore to last value + } + refresh(); + }); + + refresh(); +} + + +void NumParamControl::refresh() { + bool locked = params.getBool((param_name + "Lock").toStdString()); + value = tinkla_get_float_param(param_name.toStdString(),default_value); + param_label.setText(QString::number(value)+uom); + setText("Change"); + setEnabled(!locked); +} \ No newline at end of file diff --git a/selfdrive/car/modules/qt/num_param.h b/selfdrive/car/modules/qt/num_param.h new file mode 100644 index 000000000..614042c69 --- /dev/null +++ b/selfdrive/car/modules/qt/num_param.h @@ -0,0 +1,32 @@ +#pragma once + +#include + +#include "selfdrive/hardware/hw.h" +#include "selfdrive/ui/qt/widgets/controls.h" + +class NumParamControl : public ButtonControl { + Q_OBJECT + +public: + NumParamControl(QString theLabel, QString theDescription, QString theWindowTitle, QString theWindowInfo, QString theUom, QString theParam, float theDefaultValue, float minVal, float maxVal, float stepVal, QString icon); + +private: + QString param_name; + QString window_info; + QString window_title; + QLabel param_label; + QString description_txt; + QString label_txt; + QString uom; + + Params params; + + float default_value; + float value; + float min_val; + float max_val; + float step_val; + + void refresh(); +}; diff --git a/selfdrive/car/modules/qt/tcontrols.cc b/selfdrive/car/modules/qt/tcontrols.cc new file mode 100644 index 000000000..bc60581b0 --- /dev/null +++ b/selfdrive/car/modules/qt/tcontrols.cc @@ -0,0 +1,3 @@ +#include "selfdrive/ui/qt/widgets/controls.h" + + \ No newline at end of file diff --git a/selfdrive/car/modules/qt/tcontrols.hpp b/selfdrive/car/modules/qt/tcontrols.hpp new file mode 100644 index 000000000..c63b9d0a2 --- /dev/null +++ b/selfdrive/car/modules/qt/tcontrols.hpp @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include +#include +#include + +#include "selfdrive/common/params.h" +#include "selfdrive/ui/qt/widgets/toggle.h" +#include "selfdrive/ui/qt/widgets/controls.h" + +class TinklaParamControl : public ToggleControl { + Q_OBJECT + +public: + TinklaParamControl(const QString ¶m, const QString &title, const QString &desc, const QString &icon, QWidget *parent = nullptr) : ToggleControl(title, desc, icon, parent) { + if (!Params().tinkla_get_bool_param(param.toStdString().c_str())) { + toggle.togglePosition(); + } + QObject::connect(this, &ToggleControl::toggleFlipped, [=](int state) { + Params().tinkla_set_bool_param(param.toStdString().c_str(),state); + }); + } + +}; \ No newline at end of file diff --git a/selfdrive/car/modules/qt/tinklaparams.h b/selfdrive/car/modules/qt/tinklaparams.h new file mode 100644 index 000000000..021caf0d4 --- /dev/null +++ b/selfdrive/car/modules/qt/tinklaparams.h @@ -0,0 +1,74 @@ +#pragma once +#include +using std::cerr; +using std::cout; +using std::endl; +#include +using std::ifstream; +using std::ofstream; +#include +#include "selfdrive/common/params.h" + +//const std::string tinkla_params_path = "/data/params"; + +bool tinkla_get_bool_param(const std::string &tinkla_param) { + ifstream ifile; + ifile.open(tinkla_params_path + "/" + tinkla_param); + if (!ifile) { + //no file assume false and create + ofstream ofile; + ofile.open(tinkla_params_path + "/" + tinkla_param); + if (ofile) { + ofile << 0; + ofile.close(); + } + return false; + } else { + int value; + ifile >> value; + ifile.close(); + if (value == 0) { + return false; + } else { + return true; + } + } +} + +void tinkla_set_bool_param(const std::string &tinkla_param,int tinkla_param_value) { + ofstream ofile; + ofile.open(tinkla_params_path + "/" + tinkla_param); + if (ofile) { + ofile << tinkla_param_value; + ofile.close(); + } +} + +float tinkla_get_float_param(const std::string &tinkla_param, float default_value) { + ifstream ifile; + ifile.open(tinkla_params_path + "/" + tinkla_param); + if (!ifile) { + //no file assume false and create + ofstream ofile; + ofile.open(tinkla_params_path + "/" + tinkla_param); + if (ofile) { + ofile << default_value; + ofile.close(); + } + return false; + } else { + float value; + ifile >> value; + ifile.close(); + return value; + } +} + +void tinkla_set_float_param(const std::string &tinkla_param,float tinkla_param_value) { + ofstream ofile; + ofile.open(tinkla_params_path + "/" + tinkla_param); + if (ofile) { + ofile << tinkla_param_value; + ofile.close(); + } +} diff --git a/selfdrive/car/modules/qt/tsettings.cc b/selfdrive/car/modules/qt/tsettings.cc new file mode 100644 index 000000000..6cc6324ff --- /dev/null +++ b/selfdrive/car/modules/qt/tsettings.cc @@ -0,0 +1,287 @@ +#include +#include +#include +#include + +#include "tsettings.hpp" + + + +#include "tcontrols.hpp" + +#include "num_param.h" + +#define TINKLA_TOGGLE 1 +#define TINKLA_FLOAT 2 + +TinklaTogglesPanel::TinklaTogglesPanel(SettingsWindow *parent) : ListWidget(parent) { + + std::vector> tinkla_toggles{ + // param, title, desc, icon + {"TinklaHso", + "Enable HSO", + "Enables Human Steering Override (HSO) module without disengaging OpenPilot.", + "../assets/offroad/icon_warning.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaHsoNumbPeriod", + "HSO numb period", + "The time, in seconds, to delay the reengagement of LKAS after HSO has been engaged by user by taking control of steering.", + "../assets/offroad/icon_settings.png", + "HSO numb period:", + "Enter time in seconds.", + "s", + 1.5,0.5,3.0,0.5,TINKLA_FLOAT + }, + {"TinklaHao", + "Enable HAO", + "Enables Human Accelerator Override (HAO) module without disengaging OpenPilot.", + "../assets/offroad/icon_warning.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaAlc", + "Enable ALC", + "Enables automatic lane change with just the tap of the turn signal stalk. Your attention is required at all times to use this feature.", + "../assets/offroad/icon_warning.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + + {"TinklaAlcDelay", + "ALC delay", + "The time, in seconds, that ALC will wait and keep the turn signal on and check blind spot monitoring (when available) before automatically starting the lange change.", + "../assets/offroad/icon_settings.png", + "ALC delay:", + "Enter time in seconds.", + "s", + 2.0,1.0,3.0,0.5,TINKLA_FLOAT + }, + {"TinklaEnableOPLong", + "Enable OP Long Control", + "AP1/AP2: Enables OP Long Control and disables the AP ACC. Requires 2 pandas for MS AP2/MX AP1", + "../assets/offroad/icon_warning.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaTurnScreenOff", + "Turn screen off while engaged", + "Keeps device screen off even when engaged. It wakes the screen any time a message is shown.", + "../assets/offroad/icon_settings.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaDebugMode", + "Show Debug View", + "Shows the image captured by the road camera, including detected path and lanes.", + "../assets/offroad/icon_settings.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaHideGps", + "Hide GPS Warnings", + "Hides the GPS warning when user doesn't care about them.", + "../assets/offroad/icon_settings.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + }; + Params params; + for (auto &[param, title, desc, icon, edit_title,edit_desc, edit_uom, val_default,val_min,val_max,val_step, field_type] : tinkla_toggles) { + if (field_type == TINKLA_TOGGLE) { + auto toggle = new TinklaParamControl(param, title, desc, icon, this); + bool locked = params.getBool((param + "Lock").toStdString()); + toggle->setEnabled(!locked); + if (!locked) { + connect(uiState(), &UIState::offroadTransition, toggle, &ParamControl::setEnabled); + } + addItem(toggle); + } + if (field_type == TINKLA_FLOAT) { + addItem(new NumParamControl(title, desc, edit_title,edit_desc, edit_uom, param,val_default,val_min,val_max,val_step, icon)); + } + }; + QPushButton *flash_btn = new QPushButton("Flash Panda"); + flash_btn->setObjectName("flash_btn"); + + QObject::connect(flash_btn, &QPushButton::clicked, [=](){ + QProcess::startDetached("/data/openpilot/panda/board/flashPanda"); + }); + + setStyleSheet(R"( + #flash_btn { height: 120px; border-radius: 15px; background-color: #393939; } + #flash_btn:pressed { background-color: #4a4a4a; } + )"); + addItem(flash_btn); + +} + +TeslaPreApTogglesPanel::TeslaPreApTogglesPanel(SettingsWindow *parent) : ListWidget(parent) { + + std::vector> tinkla_toggles{ + // param, title, desc, icon + {"TinklaPost1916Fix", + "Tesla software post 2019.16", + "Use the DBC for Tesla software after 2019.16 when some of the messages changed.", + "../assets/offroad/icon_settings.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaAllowHumanLong", + "Control only LKA", + "Allows the user to perform longitudinal control via accel/brake without disengaging OP. Requires reboot.", + "../assets/offroad/icon_speed_limit.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaEnablePedal", + "Use pedal", + "Enables the use of the Pedal Interceptor to control the speed of your pre-AutoPilot Tesla. Requires Pedal Interceptor hardware connected to CAN2. Requires reboot.", + "../assets/offroad/icon_speed_limit.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaPedalCanZero", + "Pedal on CAN0", + "Uses CAN0 for pedal interceptor. Default (and safest option) is CAN2. Only enable if you know what you're doing.", + "../assets/offroad/icon_speed_limit.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaAutoResumeACC", + "AutoResume ACC", + "Enables the use of the AutoResume mode ACC instead full disengagement. Works with both CC.", + "../assets/offroad/icon_speed_limit.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaFollowDistance", + "Follow Distance", + "The number of seconds based on current speed between you and the lead vehicle.", + "../assets/offroad/icon_speed_limit.png", + "Follow Distance:", + "Enter time in seconds.", + "s", + 1.45,0.6,3.0,0.05,TINKLA_FLOAT + }, + {"TinklaHasIcIntegration", + "Use Tinkla Buddy", + "Enables IC integration via Tinkla Buddy. Only enable if you have a Tinkla Buddy licensed and installed.", + "../assets/offroad/icon_speed_limit.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaUseTeslaRadar", + "Use Tesla Radar", + "Enables the use of the Tesla Radar for pre-AutoPilot Tesla Model S. Requires Tesla Bosch radar hardware conencted to CAN1. Requires reboot.", + "../assets/offroad/icon_settings.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaTeslaRadarBehindNosecone", + "Radar behind nosecone", + "Enables the use of the Tesla Radar behind the nosecone for pre-AutoPilot Tesla Model S. Requires Tesla Bosch radar hardware conencted to CAN1. Requires reboot.", + "../assets/offroad/icon_settings.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaRadarOffset", + "Radar offset", + "The distance, in meters from center of car, the radar is offset.", + "../assets/offroad/icon_settings.png", + "Radar offset:", + "Enter distance in meters. Positive towards left.", + "m", + 0.0,-1.0,1.0,0.01,TINKLA_FLOAT + }, + {"TinklaHasIBooster", + "Car has iBooster", + "Set to true if you retrofitted Tesla Model S iBooster on pre-AutoPilot cars. Requires reboot.", + "../assets/offroad/icon_settings.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaForceTeslaPreAP", + "Force PreAP Tesla Model S ", + "Forces the fingerprint to match a PreAP Tesla Model S. Requires reboot.", + "../assets/offroad/icon_settings.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + }; + Params params; + for (auto &[param, title, desc, icon, edit_title,edit_desc, edit_uom, val_default,val_min,val_max,val_step, field_type] : tinkla_toggles) { + if (field_type == TINKLA_TOGGLE) { + auto toggle = new TinklaParamControl(param, title, desc, icon, this); + bool locked = params.getBool((param + "Lock").toStdString()); + toggle->setEnabled(!locked); + if (!locked) { + connect(uiState(), &UIState::offroadTransition, toggle, &ParamControl::setEnabled); + } + addItem(toggle); + } + if (field_type == TINKLA_FLOAT) { + addItem(new NumParamControl(title, desc, edit_title,edit_desc, edit_uom, param,val_default,val_min,val_max,val_step, icon)); + } + }; + + QPushButton *flash_btn = new QPushButton("Flash EPAS"); + flash_btn->setObjectName("flash_btn"); + + QObject::connect(flash_btn, &QPushButton::clicked, [=](){ + QProcess::startDetached("/data/openpilot/selfdrive/car/modules/teslaEpasFlasher/flashTeslaEPAS"); + }); + + QPushButton *flash_pedal_btn = new QPushButton("Flash Pedal"); + flash_pedal_btn->setObjectName("flash_pedal_btn"); + + QObject::connect(flash_pedal_btn, &QPushButton::clicked, [=](){ + QProcess::startDetached("/data/openpilot/panda/board/pedal/flashPedal"); + }); + + QPushButton *vin_radar_btn = new QPushButton("Radar VIN Learn"); + vin_radar_btn->setObjectName("vin_radar_btn"); + + QObject::connect(vin_radar_btn, &QPushButton::clicked, [=](){ + QProcess::startDetached("/data/openpilot/selfdrive/car/modules/radarFlasher/flashTeslaRadar"); + }); + + setStyleSheet(R"( + #flash_btn { height: 120px; border-radius: 15px; background-color: #393939; } + #flash_btn:pressed { background-color: #4a4a4a; } + #flash_pedal_btn { height: 120px; border-radius: 15px; background-color: #393939; } + #flash_pedal_btn:pressed { background-color: #4a4a4a; } + #vin_radar_btn { height: 120px; border-radius: 15px; background-color: #393939; } + #vin_radar_btn:pressed { background-color: #4a4a4a; } + )"); + addItem(flash_btn); + addItem(flash_pedal_btn); + addItem(vin_radar_btn); +} + +TeslaTogglesPanel::TeslaTogglesPanel(SettingsWindow *parent) : ListWidget(parent) { + + std::vector> tinkla_toggles{ + + {"TinklaAdjustAccWithSpeedLimit", + "Adjust ACC max with speed limit", + "Adjust cruise control speed limit when legal speed limit for the road changes.", + "../assets/offroad/icon_speed_limit.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaSpeedLimitUseRelative", + "Use relative offset", + "Use a relative offset (percentage of speed limit).", + "../assets/offroad/icon_speed_limit.png", + "","","",0.0,0.0,0.0,0.0, TINKLA_TOGGLE + }, + {"TinklaSpeedLimitOffset", + "Speed Limit Offset", + "The speed offset vs. the legal speed limit you want ACC to apply when automatically changing with speed limit (in your car's UOM or percentage if using relative offset).", + "../assets/offroad/icon_speed_limit.png", + "Speed Limit Offset:", + "Enter offset in your car's UOM", + "", + 0.0,-5.0,20.0,1.0,TINKLA_FLOAT + }, + }; + Params params; + for (auto &[param, title, desc, icon, edit_title,edit_desc, edit_uom, val_default,val_min,val_max,val_step, field_type] : tinkla_toggles) { + if (field_type == TINKLA_TOGGLE) { + auto toggle = new TinklaParamControl(param, title, desc, icon, this); + bool locked = params.getBool((param + "Lock").toStdString()); + toggle->setEnabled(!locked); + if (!locked) { + connect(uiState(), &UIState::offroadTransition, toggle, &ParamControl::setEnabled); + } + addItem(toggle); + } + if (field_type == TINKLA_FLOAT) { + addItem(new NumParamControl(title, desc, edit_title,edit_desc, edit_uom, param,val_default,val_min,val_max,val_step, icon)); + } + }; +} diff --git a/selfdrive/car/modules/qt/tsettings.hpp b/selfdrive/car/modules/qt/tsettings.hpp new file mode 100644 index 000000000..2ab56da6e --- /dev/null +++ b/selfdrive/car/modules/qt/tsettings.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#ifndef QCOM +#include "selfdrive/ui/qt/offroad/networking.h" +#endif +#include "selfdrive/ui/qt/offroad/settings.h" +#include "selfdrive/ui/qt/widgets/input.h" +#include "selfdrive/ui/qt/widgets/toggle.h" +#include "selfdrive/ui/qt/widgets/offroad_alerts.h" +#include "selfdrive/ui/qt/widgets/scrollview.h" +#include "selfdrive/ui/qt/widgets/controls.h" +#include "selfdrive/ui/qt/widgets/ssh_keys.h" +#include "selfdrive/common/params.h" +#include "selfdrive/common/util.h" +#include "selfdrive/hardware/hw.h" +#include "selfdrive/ui/qt/home.h" + +class TinklaTogglesPanel : public ListWidget { + Q_OBJECT +public: + explicit TinklaTogglesPanel(SettingsWindow *parent = nullptr); +}; + +class TeslaPreApTogglesPanel : public ListWidget { + Q_OBJECT +public: + explicit TeslaPreApTogglesPanel(SettingsWindow *parent = nullptr); +}; + +class TeslaTogglesPanel : public ListWidget { + Q_OBJECT +public: + explicit TeslaTogglesPanel(SettingsWindow *parent = nullptr); +}; diff --git a/selfdrive/car/modules/radarFlasher/flash.sh b/selfdrive/car/modules/radarFlasher/flash.sh new file mode 100755 index 000000000..1325a3210 --- /dev/null +++ b/selfdrive/car/modules/radarFlasher/flash.sh @@ -0,0 +1,26 @@ +#! /bin/sh +echo "=================================" +echo "RADAR FLASH PROCESS STARTED" +echo "=================================" +echo "NOTE: KEEP BRAKE PEDAL PRESSED UNTIL FLASH PROCESS IS COMPLETE" +echo " " +echo "Starting the radar flash process..." +echo " " +cd /data/openpilot/selfdrive/car/modules/radarFlasher +PYTHONPATH=/data/openpilot +./patch.py --flash-firmware +ret=$? +if [ $ret -ne 0 ]; then + echo "=================================" + echo "RADAR FLASH PROCESS FAILED" + echo "=================================" + echo " Please check logs above for errors" + echo " Please hit Reboot to return to OP" + echo "An error occurred during flashing. Exiting..." >&2 + exit 1 +fi +echo "=================================" +echo "RADAR FLASH PROCESS COMPLETED" +echo "=================================" +echo " Please hit Reboot to return to OP" +exit 0 diff --git a/selfdrive/car/modules/radarFlasher/flashTeslaRadar b/selfdrive/car/modules/radarFlasher/flashTeslaRadar new file mode 100755 index 000000000..a00ac2425 --- /dev/null +++ b/selfdrive/car/modules/radarFlasher/flashTeslaRadar @@ -0,0 +1,5 @@ +#! /bin/sh +tmux kill-session -t comma +cd /data/openpilot/selfdrive/car/modules/radarFlasher +cp /data/openpilot/selfdrive/ui/qt/flasher ./flasher +exec ./flasher "Flash" flash.sh "VIN Lrn" vin_learn.sh info.sh diff --git a/selfdrive/car/modules/radarFlasher/info.sh b/selfdrive/car/modules/radarFlasher/info.sh new file mode 100755 index 000000000..4d70b09bc --- /dev/null +++ b/selfdrive/car/modules/radarFlasher/info.sh @@ -0,0 +1,8 @@ +#! /bin/sh +echo "=====================================" +echo "Welcome to the Tesla Radar VIN Learn" +echo "=====================================" +echo "This app will set your Bosch radar so you can use OpenPilot on preAP Tesla Model S." +echo "Please press the brake pedal then hit VIN Lrn to start the process or Flash to write the firmware." +echo "NOTE: KEEP BRAKE PEDAL PRESSED UNTIL THE PROCESS IS COMPLETE" +echo " " \ No newline at end of file diff --git a/selfdrive/car/modules/radarFlasher/patch.py b/selfdrive/car/modules/radarFlasher/patch.py new file mode 100755 index 000000000..e0a996857 --- /dev/null +++ b/selfdrive/car/modules/radarFlasher/patch.py @@ -0,0 +1,421 @@ +#!/usr/bin/env python3 +import argparse +import os +import sys +import struct +import binascii +from tqdm import tqdm +from enum import IntEnum +import time + +from selfdrive.car.modules.CFG_module import load_bool_param +from panda import Panda +from panda.python.uds import UdsClient, MessageTimeoutError, NegativeResponseError, _negative_response_codes +from panda.python.uds import SESSION_TYPE, ACCESS_TYPE, ROUTINE_CONTROL_TYPE, ROUTINE_IDENTIFIER_TYPE, RESET_TYPE,DATA_IDENTIFIER_TYPE + +# md5sum of supported (unmodified) firmware +FW_MD5SUM = "9e51ddd80606fbdaaf604c73c8dde0d1" +FW_START_ADDR = 0x7000 +FW_END_ADDR = 0x45FFF +FW_SIZE = FW_END_ADDR - FW_START_ADDR + 1 +BOOTLOADER_ADDR = 0x3ff7000 + +#tesla access codes +class ACCESS_TYPE_LEVEL_1(IntEnum): + REQUEST_SEED = 0x11 + SEND_KEY = REQUEST_SEED + 1 + +def tesla_radar_security_access_algorithm(seeda, DEBUG=False): + # k4 = 4 bits + seed = int.from_bytes(seeda, byteorder="big") + k4 = ((seed >> 5) & 8) | ((seed >> 0xB) & 4) | ((seed >> 0x18) & 1) | ((seed >> 1) & 2) + if DEBUG: print("k4=",hex(k4)) + if DEBUG: print("seed&0x20000=",hex(seed&0x20000)) + + # k32 = 32 bits + if seed & 0x20000 == 0: + k32 = (seed & ~(0xff << k4 & 0xFFFFFFFF)) << 0x20 - k4 & 0xFFFFFFFF | seed >> k4 & 0xFFFFFFFF + else: + k32 = (~(0xff << k4 & 0xFFFFFFFF) << 0x20 - k4 & seed & 0xFFFFFFFF) >> 0x20 - k4 & 0xFFFFFFFF | seed << k4 & 0xFFFFFFFF + if DEBUG: print("k32=",hex(k32)) + + # k2 = 2 bits + k2 = seed >> 4 & 2 | seed >> 0x1F + if DEBUG: print("k2=",hex(k2)) + if k2 == 0: + return k32 | seed + if k2 == 1: + return k32 & seed + if k2 == 2: + return k32 ^ seed + return k32 + +def tesla_epas_security_access_key(seed): + + key = 0xc541a9 + + mask = struct.unpack('> 1 + key = key >> 1 + if (msb != 0): + key = (key | msb << 0x17) ^ 0x109028 + + mask = 0x55f222f9 + for _i in range(32): + msb = key & 1 ^ mask & 1 + mask = mask >> 1 + key = key >> 1 + if (msb != 0): + key = (key | msb << 0x17) ^ 0x109028 + + key = bytes([ + (key & 0xff0) >> 4, + (key & 0xf000) >> 8 | (key & 0xf00000) >> 20, + (key & 0xf0000) >> 16 | (key & 0xf) << 4, + ]) + + return key + +def wait(uds_client): + print(" wait .", end="") + prev_timeout = uds_client.timeout + uds_client.timeout = 0.1 + for _ in range(10): + try: + uds_client.tester_present() + uds_client.timeout = prev_timeout + print("") + return + except MessageTimeoutError: + print(".", end="") + raise Exception("reboot failed!") + +def extract_firmware(uds_client, start_addr, end_addr): + print("start extended diagnostic session ...") + uds_client.diagnostic_session_control(SESSION_TYPE.EXTENDED_DIAGNOSTIC) + + print("request security access seed ...") + seed = uds_client.security_access(ACCESS_TYPE.REQUEST_SEED) + print(f" seed: 0x{seed.hex()}") + + print("send security access key ...") + key = tesla_radar_security_access_algorithm(seed) + print(f" key: 0x{key.hex()}") + uds_client.security_access(ACCESS_TYPE.SEND_KEY, key) + + print("extract firmware ...") + print(f" start addr: {hex(start_addr)}") + print(f" end addr: {hex(end_addr)}") + fw = b"" + chunk_size = 128 + for addr in tqdm(range(start_addr, end_addr + 1, chunk_size)): + dat = uds_client.read_memory_by_address(addr, chunk_size) + assert len(dat) == chunk_size, f"expected {chunk_size} bytes but received {len(dat)} bytes starting at address {addr}" + fw += dat + return fw + +def update_checksums(fw, offset, restore=False): + for addr in [ 0x79c0, 0x79d0 ]: + idx = addr - offset + assert idx >= 0 + start = struct.unpack('= 0 + end = struct.unpack('= 0 + if restore: + # undo firmware modifications (if firmware was already patched) + if fw[idx:idx+len(old_val)] != new_val: + continue + tmp_val = old_val + old_val = new_val + new_val = tmp_val + else: + # patch firmware + print(f" {hex(addr)} : 0x{fw[idx:idx+len(old_val)].hex()} -> 0x{new_val.hex()}") + assert len(old_val) == len(new_val), f"{len(old_val)} != {len(new_val)}" + assert fw[idx:idx+len(old_val)] == old_val, f"0x{fw[idx:idx+len(old_val)].hex()} != 0x{old_val.hex()}" + fw = fw[:idx] + new_val + fw[idx+len(new_val):] + return fw + +def flash_bootloader(uds_client, bootloader_filename, start_addr): + print("read bootloader ...") + with open(bootloader_filename, "rb") as f: + fw = f.read() + fw_len = len(fw) + end_addr = start_addr + fw_len - 1 + + print("start programming session ...") + uds_client.diagnostic_session_control(SESSION_TYPE.PROGRAMMING) + wait(uds_client) + + print("request security access seed ...") + seed = uds_client.security_access(ACCESS_TYPE.REQUEST_SEED) + print(f" seed: 0x{seed.hex()}") + + print("send security access key ...") + key = tesla_radar_security_access_algorithm(seed) + print(f" key: 0x{key.hex()}") + uds_client.security_access(ACCESS_TYPE.SEND_KEY, key) + + print("request download ...") + print(f" start addr: {hex(start_addr)}") + print(f" end addr: {hex(end_addr)}") + print(f" data length: {hex(fw_len)}") + block_size = uds_client.request_download(start_addr, fw_len) + + print("transfer data ...") + print(f" block size: {block_size}") + chunk_size = block_size - 2 + cnt = 0 + for i in tqdm(range(0, fw_len, chunk_size)): + cnt += 1 + uds_client.transfer_data(cnt & 0xFF, fw[i:i+chunk_size]) + + print("request transfer exit ...") + uds_client.request_transfer_exit() + + print("enter bootloader ...") + uds_client.routine_control(ROUTINE_CONTROL_TYPE.START, 0x0301, struct.pack(">I", start_addr)) + +def flash_firmware(uds_client, fw_slice, start_addr, end_addr): + slice_len = end_addr - start_addr + 1 + assert slice_len == len(fw_slice) + start_and_length = struct.pack('>II', start_addr, slice_len) + + print("erase memory ...") + print(f" start addr: {hex(start_addr)}") + print(f" end addr: {hex(end_addr)}") + print(f" data length: {hex(slice_len)}") + uds_client.routine_control(ROUTINE_CONTROL_TYPE.START, ROUTINE_IDENTIFIER_TYPE.ERASE_MEMORY, start_and_length) + + print("request download ...") + print(f" start addr: {hex(start_addr)}") + print(f" end addr: {hex(end_addr)}") + print(f" data length: {hex(slice_len)}") + block_size = uds_client.request_download(start_addr, slice_len) + + print("transfer data ...") + print(f" block size: {block_size}") + chunk_size = block_size - 2 + cnt = 0 + for i in tqdm(range(0, slice_len, chunk_size)): + cnt += 1 + uds_client.transfer_data(cnt & 0xFF, fw_slice[i:i+chunk_size]) + + print("request transfer exit ...") + uds_client.request_transfer_exit() + + print("reset ...") + wait(uds_client) + try: + uds_client.ecu_reset(RESET_TYPE.HARD | 0x80) + except MessageTimeoutError: + # supress response bit set, so timeout expected + # (timeout is used to wait for reboot to complete) + pass + wait(uds_client) + + print("start extended diagnostic session ...") + uds_client.diagnostic_session_control(SESSION_TYPE.EXTENDED_DIAGNOSTIC) + + print("request security access seed ...") + seed = uds_client.security_access(ACCESS_TYPE.REQUEST_SEED) + print(f" seed: 0x{seed.hex()}") + + print("send security access key ...") + key = tesla_radar_security_access_algorithm(seed) + print(f" key: 0x{key.hex()}") + uds_client.security_access(ACCESS_TYPE.SEND_KEY, key) + + print("check dependencies ...") + uds_client.routine_control(ROUTINE_CONTROL_TYPE.START, 0xDC03) + + print("complete!") + +def vin_learn(udcli): + print("\n[START DIAGNOSTIC SESSION]") + udcli.tester_present() + udcli.diagnostic_session_control(SESSION_TYPE.DEFAULT) + udcli.diagnostic_session_control(SESSION_TYPE.EXTENDED_DIAGNOSTIC) + wait(udcli) + print("request security access seed ...") + seed = udcli.security_access(ACCESS_TYPE_LEVEL_1.REQUEST_SEED) + print(f" seed: 0x{seed.hex()}") + + print("send security access key ...") + key = struct.pack("!I",tesla_radar_security_access_algorithm(seed)) + udcli.security_access(ACCESS_TYPE_LEVEL_1.SEND_KEY, key) + + print("Starting VIN learn...") + output = udcli.routine_control(ROUTINE_CONTROL_TYPE.START, 2563) + ns = 0 + nsmax = 2 + while ns < nsmax: + for i in range(3): + time.sleep(2) + try: + output = udcli.routine_control(ROUTINE_CONTROL_TYPE.STOP, 2563) + except NegativeResponseError as e: + print(('Failed to stop vin learning on attempt #{0}. ({1})').format(i + 1,_negative_response_codes[e.error_code])) + if i == 2: + raise + else: + ns += 1 + if ns >= nsmax: + output = udcli.routine_control(ROUTINE_CONTROL_TYPE.REQUEST_RESULTS, 2563) + break + print("VIN learn complete! [",output,"]") + +def read_values_from_radar(udcli): + print("\n[START DIAGNOSTIC SESSION]") + #udcli.tester_present() + udcli.diagnostic_session_control(SESSION_TYPE.DEFAULT) + udcli.diagnostic_session_control(SESSION_TYPE.EXTENDED_DIAGNOSTIC) + + print("reading VIN from radar...") + vin = udcli.read_data_by_identifier(DATA_IDENTIFIER_TYPE.VIN) + print("new VIN: {} [{}]".format(vin.decode("utf-8"), binascii.hexlify(vin))) + vin = udcli.read_data_by_identifier(0xA022) + print("plant mode: {} [{}]".format(vin.decode("utf-8"), binascii.hexlify(vin))) + vin = udcli.read_data_by_identifier(0xF014) + print("board part #: {} [{}]".format(vin.decode("utf-8"), binascii.hexlify(vin))) + vin = udcli.read_data_by_identifier(0xF015) + print("board ser #: {} [{}]".format(vin.decode("utf-8"), binascii.hexlify(vin))) + + vin = udcli.read_data_by_identifier(0xFC01) + print("Active alignment horizontal angle: {} [{}]".format(vin.decode("utf-8"), binascii.hexlify(vin))) + vin = udcli.read_data_by_identifier(0x508) + print("Active Alignment Horizontal Screw: {} [{}]".format(vin.decode("utf-8"), binascii.hexlify(vin))) + vin = udcli.read_data_by_identifier(0x505) + print("Active Alignment State: {} [{}]".format(vin.decode("utf-8"), binascii.hexlify(vin))) + vin = udcli.read_data_by_identifier(0xFC02) + print("Active Alignment Vertical Angle: {} [{}]".format(vin.decode("utf-8"), binascii.hexlify(vin))) + vin = udcli.read_data_by_identifier(0x507) + print("Active Alignment Vertical Screw: {} [{}]".format(vin.decode("utf-8"), binascii.hexlify(vin))) + vin = udcli.read_data_by_identifier(0x506) + print("Active Alignment Operation: {} [{}]".format(vin.decode("utf-8"), binascii.hexlify(vin))) + vin = udcli.read_data_by_identifier(0x50A) + print("Service Drive Alignment State: {} [{}]".format(vin.decode("utf-8"), binascii.hexlify(vin))) + vin = udcli.read_data_by_identifier(0x509) + print("Service Drive Alignment Status: {} [{}]".format(vin.decode("utf-8"), binascii.hexlify(vin))) + + print("reading variables from radar...") + for i in range(0xF100, 0xF2FF): + try: + dat = udcli.read_data_by_identifier(i) + desc = "" + try: + desc = " [" + DATA_IDENTIFIER_TYPE(i).name + "]" + except ValueError: + pass + print("{}:{} {} {}".format(hex(i), desc, binascii.hexlify(dat), "")) #, dat.decode(errors="ignore"))) + except NegativeResponseError as e: + if e.error_code != 0x31: + print("{}: {}".format(hex(i), e)) + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('--extract-only', action='store_true', help='extract the firmware (do not flash)') + parser.add_argument('--extract-params', action='store_true', help='extract the programmed params from radar') + parser.add_argument('--vin-learn', action='store_true', help='switch radar in programming mode to learn VIN') + parser.add_argument('--restore', action='store_true', help='flash firmware without modification') + parser.add_argument('--debug', action='store_true', help='print additional debug messages') + parser.add_argument('--bootloader', type=str, default="./radarfw.bin", help='path to firmware file') + parser.add_argument('--can-addr', type=int, default=0x641, help='TX CAN address for UDS') #receives on 0x671, answers on 0x681 - UDS_radcRequest 1649 - RADC_udsResponse 1665 + parser.add_argument('--can-bus', type=int, default=1, help='CAN bus number (zero based)') + args = parser.parse_args() + + safetyParam = 0 + if not load_bool_param("TinklaForceTeslaPreAP", False): + print("This software should only be used on preAP Tesla Model S!!!") + sys.exit(1) + if load_bool_param("TinklaUseTeslaRadar",False): + safetyParam = safetyParam | Panda.FLAG_TESLA_NEED_RADAR_EMULATION + if load_bool_param("TinklaTeslaRadarBehindNosecone",False): + safetyParam = safetyParam | Panda.FLAG_TESLA_RADAR_BEHIND_NOSECONE + else: + print("Use of Tesla Radar not enabled in toggles.") + sys.exit(1) + + if load_bool_param("TinklaHasIBooster",False): + safetyParam = safetyParam | Panda.FLAG_TESLA_HAS_IBOOSTER + + panda = Panda() + panda.reset() + #negative safetyParam used when doing VIN learn in our SAFETY_TESL for now + panda.set_safety_mode(Panda.SAFETY_TESLA, param=-safetyParam) + uds_client = UdsClient(panda, args.can_addr, bus=args.can_bus, rx_addr=args.can_addr + 0x10, timeout=3, debug=args.debug) + + os.chdir(os.path.dirname(os.path.realpath(__file__))) + + #radc:7 radc/1/radc.bhx radc.bhx radc fbfe4746 dasHw=1,forwardRadarHW=1 + + if args.extract_params: + read_values_from_radar(uds_client) + sys.exit(0) + + if args.vin_learn: + vin_learn(uds_client) + sys.exit(0) + + # fw_slice = None + # fw_fn = f"./epas-firmware-{hex(FW_START_ADDR)}-{hex(FW_END_ADDR)}.bin" + # if args.extract_only or not os.path.exists(fw_fn): + # fw_slice = extract_firmware(uds_client, FW_START_ADDR, FW_END_ADDR) + # # undo firmware changes in case firmware was already patched + # fw_slice = patch_firmware(fw_slice, FW_START_ADDR, restore=True) + # fw_slice = update_checksums(fw_slice, FW_START_ADDR, restore=True) + # print(f" file name: {fw_fn}") + # with open(fw_fn, "wb") as f: + # f.write(fw_slice) + + # if args.extract_only: + # exit(0) + + # if fw_slice is None: + # print("load firmware ...") + # print(f" file name: {fw_fn}") + # with open(fw_fn, "rb") as f: + # fw_slice = f.read() + # md5 = hashlib.md5(fw_slice).hexdigest() + + # assert len(fw_slice) == FW_SIZE, f"expected {FW_SIZE} bytes of firmware but got {len(fw_slice)} bytes" + # assert md5 == FW_MD5SUM, f"expected md5sum of firmware to be in {FW_MD5SUM} but found {md5}" + # fw_mod_fn = f"{md5}.modified.bin" + + # if not args.restore: + # print("modify firmware ...") + # fw_slice = patch_firmware(fw_slice, FW_START_ADDR) + # print("update checksums ...") + # fw_slice = update_checksums(fw_slice, FW_START_ADDR) + # print(f" file name: {fw_mod_fn}") + # with open(fw_mod_fn, "wb") as f: + # f.write(fw_slice) + + # if args.extract_only: + # sys.exit(0) + + # flash_bootloader(uds_client, args.bootloader, BOOTLOADER_ADDR) + # flash_firmware(uds_client, fw_slice, FW_START_ADDR, FW_END_ADDR) diff --git a/selfdrive/car/modules/radarFlasher/radarfw.bin b/selfdrive/car/modules/radarFlasher/radarfw.bin new file mode 100755 index 000000000..99c4c60a8 Binary files /dev/null and b/selfdrive/car/modules/radarFlasher/radarfw.bin differ diff --git a/selfdrive/car/modules/radarFlasher/vin_learn.sh b/selfdrive/car/modules/radarFlasher/vin_learn.sh new file mode 100755 index 000000000..b702a8451 --- /dev/null +++ b/selfdrive/car/modules/radarFlasher/vin_learn.sh @@ -0,0 +1,26 @@ +#! /bin/sh +echo "=================================" +echo "VIN LEARN PROCESS STARTED" +echo "=================================" +echo "NOTE: KEEP BRAKE PEDAL PRESSED UNTIL PROCESS IS COMPLETE" +echo " " +echo "Starting the VIN learn process..." +echo " " +cd /data/openpilot/selfdrive/car/modules/radarFlasher +PYTHONPATH=/data/openpilot +./patch.py --vin-learn +ret=$? +if [ $ret -ne 0 ]; then + echo "=================================" + echo " VIN LEARN PROCESS FAILED" + echo "=================================" + echo " Please check logs above for errors" + echo " Please hit Reboot to return to OP" + echo "An error occurred during VIN learn. Exiting..." >&2 + exit 1 +fi +echo "=================================" +echo " VIN LEARN PROCESS COMPLETED" +echo "=================================" +echo " Please hit Reboot to return to OP" +exit 0 diff --git a/selfdrive/car/modules/teslaEpasFlasher/LICENSE b/selfdrive/car/modules/teslaEpasFlasher/LICENSE new file mode 100644 index 000000000..f288702d2 --- /dev/null +++ b/selfdrive/car/modules/teslaEpasFlasher/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/selfdrive/car/modules/teslaEpasFlasher/README.md b/selfdrive/car/modules/teslaEpasFlasher/README.md new file mode 100644 index 000000000..9a3b6a784 --- /dev/null +++ b/selfdrive/car/modules/teslaEpasFlasher/README.md @@ -0,0 +1,64 @@ +# Tesla pre-AP EPAS steering firmware patch +Normally on Tesla vehicles without autopilot the gateway sends a message indicating that steering over CAN is disabled. + +This tool patches the firmware to enable steering over CAN. + +## important - read this first! +* flashing firmware can fail and brick your EPAS, while unlikely, + **do not flash something that you are not willing to pay to replace** +* [comma.ai panda](https://comma.ai/shop/products/panda-obd-ii-dongle) + is used to communicate with EPAS over CAN +* requires connection the chassis CAN bus such that you are connected in parallel with the EPAopenpilotS + (flashing does not happen through the gateway) +* before flashing a backup of the firmware is take from the EPAS to ensure that + the firmware on your EPAS is the expected firmware and compatible + +## setup +```sh +# install python packages +pip3 install -r requirements.txt +# clone openpilot into home directory to get panda repo +git clone https://github.com/commaai/openpilot.git ~/openpilot +``` + +## patch the firmware +connect [comma.ai panda](https://comma.ai/shop/products/panda-obd-ii-dongle) to EPAS and run: + +```sh +# replace PYTHONPATH with location you cloned openpilot to +PYTHONPATH=~/openpilot ./patch.py +``` + +## restore original firmware +connect [comma.ai panda](https://comma.ai/shop/products/panda-obd-ii-dongle) to EPAS and run: + +```sh +# replace PYTHONPATH with location you cloned openpilot to +PYTHONPATH=~/openpilot ./patch.py --restore +``` + +## how it works +The gateway in vehicles without autopilot constantly sends a `GTW_epasControl` message +(CAN address 0x101) with two signals we care about: +* `GTW_epasControlType` (3 bits) + * 0 = INHIBIT + * 1 = ANGLE + * 2 = TORQUE + * 3 = BOTH +* `GTW_epasLDWEnable` (1 bit) + * 0 = DISABLE + * 1 = ENABLE +(the gateway in vehicles without autopilot sets these signals to have a value of 0) + +The electronic parking brake in vehicles without autopilot constantly sends a `EPB_epasControl` +message (CAN address 0x214) with one signal we care about: +* EPB_epasEACAllow (3 bits) + * 0 = DISABLE + * 1 = ENABLE +(the electronic parking brake in vehicles without autopilot sets this signal to have a value of 0) + +The firmware patch replaces parsing these signals with loading the value 1 +(after the checksum is validated). + +Note that if you have no electronic parking brake you still need to send `EPB_epasControl` with +a good checksum and counter to prevent the EPAS from faulting. diff --git a/selfdrive/car/modules/teslaEpasFlasher/epas-bootloader-0x3ff7000-0x3ffacbd.bin b/selfdrive/car/modules/teslaEpasFlasher/epas-bootloader-0x3ff7000-0x3ffacbd.bin new file mode 100644 index 000000000..14d7f005e Binary files /dev/null and b/selfdrive/car/modules/teslaEpasFlasher/epas-bootloader-0x3ff7000-0x3ffacbd.bin differ diff --git a/selfdrive/car/modules/teslaEpasFlasher/flash.sh b/selfdrive/car/modules/teslaEpasFlasher/flash.sh new file mode 100755 index 000000000..073c7b032 --- /dev/null +++ b/selfdrive/car/modules/teslaEpasFlasher/flash.sh @@ -0,0 +1,26 @@ +#! /bin/sh +echo "=================================" +echo "FLASH PROCESS STARTED" +echo "=================================" +echo "NOTE: KEEP BRAKE PEDAL PRESSED UNTIL FLASH PROCESS IS COMPLETE" +echo " " +echo "Starting the flash process..." +echo " " +cd /data/openpilot/selfdrive/car/modules/teslaEpasFlasher +PYTHONPATH=/data/openpilot +./patch.py +ret=$? +if [ $ret -ne 0 ]; then + echo "=================================" + echo " FLASH PROCESS FAILED" + echo "=================================" + echo " Please check logs above for errors" + echo " Please hit Reboot to return to OP" + echo "An error occurred during flashing. Exiting..." >&2 + exit 1 +fi +echo "=================================" +echo " FLASH PROCESS COMPLETED" +echo "=================================" +echo " Please hit Reboot to return to OP" +exit 0 diff --git a/selfdrive/car/modules/teslaEpasFlasher/flashTeslaEPAS b/selfdrive/car/modules/teslaEpasFlasher/flashTeslaEPAS new file mode 100755 index 000000000..098d3742a --- /dev/null +++ b/selfdrive/car/modules/teslaEpasFlasher/flashTeslaEPAS @@ -0,0 +1,5 @@ +#! /bin/sh +tmux kill-session -t comma +cd /data/openpilot/selfdrive/car/modules/teslaEpasFlasher +cp /data/openpilot/selfdrive/ui/qt/flasher ./flasher +exec ./flasher "Patch" flash.sh "Restore" restore.sh info.sh diff --git a/selfdrive/car/modules/teslaEpasFlasher/info.sh b/selfdrive/car/modules/teslaEpasFlasher/info.sh new file mode 100755 index 000000000..1343b3084 --- /dev/null +++ b/selfdrive/car/modules/teslaEpasFlasher/info.sh @@ -0,0 +1,8 @@ +#! /bin/sh +echo "=================================" +echo "Welcome to the Tesla EPAS patcher" +echo "=================================" +echo "This app will patch your EPAS firmware so you can use OpenPilot on preAP Tesla Model S." +echo "Please press the brake pedal then hit Patch to start the process or Restore to restore original firmware." +echo "NOTE: KEEP BRAKE PEDAL PRESSED UNTIL PATCH PROCESS IS COMPLETE" +echo " " \ No newline at end of file diff --git a/selfdrive/car/modules/teslaEpasFlasher/patch.py b/selfdrive/car/modules/teslaEpasFlasher/patch.py new file mode 100755 index 000000000..1370778eb --- /dev/null +++ b/selfdrive/car/modules/teslaEpasFlasher/patch.py @@ -0,0 +1,278 @@ +#!/usr/bin/env python3 +import argparse +import os +import sys +import struct +import hashlib +import binascii +from tqdm import tqdm + +from panda import Panda +from panda.python.uds import UdsClient, MessageTimeoutError +from panda.python.uds import SESSION_TYPE, ACCESS_TYPE, ROUTINE_CONTROL_TYPE, ROUTINE_IDENTIFIER_TYPE, RESET_TYPE + +# md5sum of supported (unmodified) firmware +FW_MD5SUM = "9e51ddd80606fbdaaf604c73c8dde0d1" +FW_START_ADDR = 0x7000 +FW_END_ADDR = 0x45FFF +FW_SIZE = FW_END_ADDR - FW_START_ADDR + 1 +BOOTLOADER_ADDR = 0x3ff7000 + +def get_security_access_key(seed): + key = 0xc541a9 + + mask = struct.unpack('> 1 + key = key >> 1 + if (msb != 0): + key = (key | msb << 0x17) ^ 0x109028 + + mask = 0x55f222f9 + for i in range(32): + msb = key & 1 ^ mask & 1 + mask = mask >> 1 + key = key >> 1 + if (msb != 0): + key = (key | msb << 0x17) ^ 0x109028 + + key = bytes([ + (key & 0xff0) >> 4, + (key & 0xf000) >> 8 | (key & 0xf00000) >> 20, + (key & 0xf0000) >> 16 | (key & 0xf) << 4, + ]) + + return key + +def wait(uds_client): + print(" wait .", end="") + prev_timeout = uds_client.timeout + uds_client.timeout = 0.1 + for _ in range(10): + try: + uds_client.tester_present() + uds_client.timeout = prev_timeout + print("") + return + except MessageTimeoutError: + print(".", end="") + raise Exception("reboot failed!") + +def extract_firmware(uds_client, start_addr, end_addr): + print("start extended diagnostic session ...") + uds_client.diagnostic_session_control(SESSION_TYPE.EXTENDED_DIAGNOSTIC) + + print("request security access seed ...") + seed = uds_client.security_access(ACCESS_TYPE.REQUEST_SEED) + print(f" seed: 0x{seed.hex()}") + + print("send security access key ...") + key = get_security_access_key(seed) + print(f" key: 0x{key.hex()}") + uds_client.security_access(ACCESS_TYPE.SEND_KEY, key) + + print("extract firmware ...") + print(f" start addr: {hex(start_addr)}") + print(f" end addr: {hex(end_addr)}") + fw = b"" + chunk_size = 128 + for addr in tqdm(range(start_addr, end_addr + 1, chunk_size)): + dat = uds_client.read_memory_by_address(addr, chunk_size) + assert len(dat) == chunk_size, f"expected {chunk_size} bytes but received {len(dat)} bytes starting at address {addr}" + fw += dat + return fw + +def update_checksums(fw, offset, restore=False): + for addr in [ 0x79c0, 0x79d0 ]: + idx = addr - offset + assert idx >= 0 + start = struct.unpack('= 0 + end = struct.unpack('= 0 + if restore: + # undo firmware modifications (if firmware was already patched) + if fw[idx:idx+len(old_val)] != new_val: + continue + tmp_val = old_val + old_val = new_val + new_val = tmp_val + else: + # patch firmware + print(f" {hex(addr)} : 0x{fw[idx:idx+len(old_val)].hex()} -> 0x{new_val.hex()}") + assert len(old_val) == len(new_val), f"{len(old_val)} != {len(new_val)}" + assert fw[idx:idx+len(old_val)] == old_val, f"0x{fw[idx:idx+len(old_val)].hex()} != 0x{old_val.hex()}" + fw = fw[:idx] + new_val + fw[idx+len(new_val):] + return fw + +def flash_bootloader(uds_client, bootloader_filename, start_addr): + print(f"read bootloader ...") + with open(bootloader_filename, "rb") as f: + fw = f.read() + fw_len = len(fw) + end_addr = start_addr + fw_len - 1 + + print("start programming session ...") + uds_client.diagnostic_session_control(SESSION_TYPE.PROGRAMMING) + wait(uds_client) + + print("request security access seed ...") + seed = uds_client.security_access(ACCESS_TYPE.REQUEST_SEED) + print(f" seed: 0x{seed.hex()}") + + print("send security access key ...") + key = get_security_access_key(seed) + print(f" key: 0x{key.hex()}") + uds_client.security_access(ACCESS_TYPE.SEND_KEY, key) + + print("request download ...") + print(f" start addr: {hex(start_addr)}") + print(f" end addr: {hex(end_addr)}") + print(f" data length: {hex(fw_len)}") + block_size = uds_client.request_download(start_addr, fw_len) + + print("transfer data ...") + print(f" block size: {block_size}") + chunk_size = block_size - 2 + cnt = 0 + for i in tqdm(range(0, fw_len, chunk_size)): + cnt += 1 + uds_client.transfer_data(cnt & 0xFF, fw[i:i+chunk_size]) + + print("request transfer exit ...") + uds_client.request_transfer_exit() + + print("enter bootloader ...") + uds_client.routine_control(ROUTINE_CONTROL_TYPE.START, 0x0301, struct.pack(">I", start_addr)) + +def flash_firmware(uds_client, fw_slice, start_addr, end_addr): + slice_len = end_addr - start_addr + 1 + assert slice_len == len(fw_slice) + start_and_length = struct.pack('>II', start_addr, slice_len) + + print("erase memory ...") + print(f" start addr: {hex(start_addr)}") + print(f" end addr: {hex(end_addr)}") + print(f" data length: {hex(slice_len)}") + uds_client.routine_control(ROUTINE_CONTROL_TYPE.START, ROUTINE_IDENTIFIER_TYPE.ERASE_MEMORY, start_and_length) + + print("request download ...") + print(f" start addr: {hex(start_addr)}") + print(f" end addr: {hex(end_addr)}") + print(f" data length: {hex(slice_len)}") + block_size = uds_client.request_download(start_addr, slice_len) + + print("transfer data ...") + print(f" block size: {block_size}") + chunk_size = block_size - 2 + cnt = 0 + for i in tqdm(range(0, slice_len, chunk_size)): + cnt += 1 + uds_client.transfer_data(cnt & 0xFF, fw_slice[i:i+chunk_size]) + + print("request transfer exit ...") + uds_client.request_transfer_exit() + + print("reset ...") + wait(uds_client) + try: + uds_client.ecu_reset(RESET_TYPE.HARD | 0x80) + except MessageTimeoutError: + # supress response bit set, so timeout expected + # (timeout is used to wait for reboot to complete) + pass + wait(uds_client) + + print("start extended diagnostic session ...") + uds_client.diagnostic_session_control(SESSION_TYPE.EXTENDED_DIAGNOSTIC) + + print("request security access seed ...") + seed = uds_client.security_access(ACCESS_TYPE.REQUEST_SEED) + print(f" seed: 0x{seed.hex()}") + + print("send security access key ...") + key = get_security_access_key(seed) + print(f" key: 0x{key.hex()}") + uds_client.security_access(ACCESS_TYPE.SEND_KEY, key) + + print("check dependencies ...") + uds_client.routine_control(ROUTINE_CONTROL_TYPE.START, 0xDC03) + + print("complete!") + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('--extract-only', action='store_true', help='extract the firmware (do not flash)') + parser.add_argument('--restore', action='store_true', help='flash firmware without modification') + parser.add_argument('--debug', action='store_true', help='print additional debug messages') + parser.add_argument('--bootloader', type=str, default="./epas-bootloader-0x3ff7000-0x3ffacbd.bin", help='path to bootloader file') + parser.add_argument('--can-addr', type=int, default=0x730, help='TX CAN address for UDS') + parser.add_argument('--can-bus', type=int, default=0, help='CAN bus number (zero based)') + args = parser.parse_args() + + panda = Panda() + panda.set_safety_mode(Panda.SAFETY_ELM327) + uds_client = UdsClient(panda, args.can_addr, bus=args.can_bus, timeout=1, debug=args.debug) + + os.chdir(os.path.dirname(os.path.realpath(__file__))) + + fw_slice = None + fw_fn = f"./epas-firmware-{hex(FW_START_ADDR)}-{hex(FW_END_ADDR)}.bin" + if args.extract_only or not os.path.exists(fw_fn): + fw_slice = extract_firmware(uds_client, FW_START_ADDR, FW_END_ADDR) + # undo firmware changes in case firmware was already patched + fw_slice = patch_firmware(fw_slice, FW_START_ADDR, restore=True) + fw_slice = update_checksums(fw_slice, FW_START_ADDR, restore=True) + print(f" file name: {fw_fn}") + with open(fw_fn, "wb") as f: + f.write(fw_slice) + + if args.extract_only: + exit(0) + + if fw_slice is None: + print("load firmware ...") + print(f" file name: {fw_fn}") + with open(fw_fn, "rb") as f: + fw_slice = f.read() + md5 = hashlib.md5(fw_slice).hexdigest() + + assert len(fw_slice) == FW_SIZE, f"expected {FW_SIZE} bytes of firmware but got {len(fw_slice)} bytes" + assert md5 == FW_MD5SUM, f"expected md5sum of firmware to be in {FW_MD5SUM} but found {md5}" + fw_mod_fn = f"{md5}.modified.bin" + + if not args.restore: + print("modify firmware ...") + fw_slice = patch_firmware(fw_slice, FW_START_ADDR) + print("update checksums ...") + fw_slice = update_checksums(fw_slice, FW_START_ADDR) + print(f" file name: {fw_mod_fn}") + with open(fw_mod_fn, "wb") as f: + f.write(fw_slice) + + if args.extract_only: + sys.exit(0) + + flash_bootloader(uds_client, args.bootloader, BOOTLOADER_ADDR) + flash_firmware(uds_client, fw_slice, FW_START_ADDR, FW_END_ADDR) diff --git a/selfdrive/car/modules/teslaEpasFlasher/requirements.txt b/selfdrive/car/modules/teslaEpasFlasher/requirements.txt new file mode 100644 index 000000000..9722dd49f --- /dev/null +++ b/selfdrive/car/modules/teslaEpasFlasher/requirements.txt @@ -0,0 +1 @@ +tqdm==4.46.0 diff --git a/selfdrive/car/modules/teslaEpasFlasher/restore.sh b/selfdrive/car/modules/teslaEpasFlasher/restore.sh new file mode 100755 index 000000000..61d918c95 --- /dev/null +++ b/selfdrive/car/modules/teslaEpasFlasher/restore.sh @@ -0,0 +1,26 @@ +#! /bin/sh +echo "=================================" +echo "RESTORE PROCESS STARTED" +echo "=================================" +echo "NOTE: KEEP BRAKE PEDAL PRESSED UNTIL RESTORE PROCESS IS COMPLETE" +echo " " +echo "Starting the restore process..." +echo " " +cd /data/openpilot/selfdrive/car/modules/teslaEpasFlasher +PYTHONPATH=/data/openpilot +./patch.py --restore +ret=$? +if [ $ret -ne 0 ]; then + echo "=================================" + echo " RESTORE PROCESS FAILED" + echo "=================================" + echo " Please check logs above for errors" + echo " Please hit Reboot to return to OP" + echo "An error occurred during restore. Exiting..." >&2 + exit 1 +fi +echo "=================================" +echo " RESTORE PROCESS COMPLETED" +echo "=================================" +echo " Please hit Reboot to return to OP" +exit 0 diff --git a/selfdrive/car/nissan/__init__.py b/selfdrive/car/nissan/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/nissan/carcontroller.py b/selfdrive/car/nissan/carcontroller.py new file mode 100644 index 000000000..8b30c1124 --- /dev/null +++ b/selfdrive/car/nissan/carcontroller.py @@ -0,0 +1,91 @@ +from cereal import car +from common.numpy_fast import clip, interp +from selfdrive.car.nissan import nissancan +from opendbc.can.packer import CANPacker +from selfdrive.car.nissan.values import CAR, CarControllerParams + + +VisualAlert = car.CarControl.HUDControl.VisualAlert + + +class CarController(): + def __init__(self, dbc_name, CP, VM): + self.CP = CP + self.car_fingerprint = CP.carFingerprint + + self.lkas_max_torque = 0 + self.last_angle = 0 + + self.packer = CANPacker(dbc_name) + + def update(self, c, enabled, CS, frame, actuators, cruise_cancel, hud_alert, + left_line, right_line, left_lane_depart, right_lane_depart): + + can_sends = [] + + ### STEER ### + acc_active = CS.out.cruiseState.enabled + lkas_hud_msg = CS.lkas_hud_msg + lkas_hud_info_msg = CS.lkas_hud_info_msg + apply_angle = actuators.steeringAngleDeg + + steer_hud_alert = 1 if hud_alert in (VisualAlert.steerRequired, VisualAlert.ldw) else 0 + + if c.active: + # # windup slower + if self.last_angle * apply_angle > 0. and abs(apply_angle) > abs(self.last_angle): + angle_rate_lim = interp(CS.out.vEgo, CarControllerParams.ANGLE_DELTA_BP, CarControllerParams.ANGLE_DELTA_V) + else: + angle_rate_lim = interp(CS.out.vEgo, CarControllerParams.ANGLE_DELTA_BP, CarControllerParams.ANGLE_DELTA_VU) + + apply_angle = clip(apply_angle, self.last_angle - angle_rate_lim, self.last_angle + angle_rate_lim) + + # Max torque from driver before EPS will give up and not apply torque + if not bool(CS.out.steeringPressed): + self.lkas_max_torque = CarControllerParams.LKAS_MAX_TORQUE + else: + # Scale max torque based on how much torque the driver is applying to the wheel + self.lkas_max_torque = max( + # Scale max torque down to half LKAX_MAX_TORQUE as a minimum + CarControllerParams.LKAS_MAX_TORQUE * 0.5, + # Start scaling torque at STEER_THRESHOLD + CarControllerParams.LKAS_MAX_TORQUE - 0.6 * max(0, abs(CS.out.steeringTorque) - CarControllerParams.STEER_THRESHOLD) + ) + + else: + apply_angle = CS.out.steeringAngleDeg + self.lkas_max_torque = 0 + + self.last_angle = apply_angle + + if not enabled and acc_active: + # send acc cancel cmd if drive is disabled but pcm is still on, or if the system can't be activated + cruise_cancel = 1 + + if self.CP.carFingerprint in (CAR.ROGUE, CAR.XTRAIL, CAR.ALTIMA) and cruise_cancel: + can_sends.append(nissancan.create_acc_cancel_cmd(self.packer, self.car_fingerprint, CS.cruise_throttle_msg, frame)) + + # TODO: Find better way to cancel! + # For some reason spamming the cancel button is unreliable on the Leaf + # We now cancel by making propilot think the seatbelt is unlatched, + # this generates a beep and a warning message every time you disengage + if self.CP.carFingerprint in (CAR.LEAF, CAR.LEAF_IC) and frame % 2 == 0: + can_sends.append(nissancan.create_cancel_msg(self.packer, CS.cancel_msg, cruise_cancel)) + + can_sends.append(nissancan.create_steering_control( + self.packer, apply_angle, frame, enabled, self.lkas_max_torque)) + + if lkas_hud_msg and lkas_hud_info_msg: + if frame % 2 == 0: + can_sends.append(nissancan.create_lkas_hud_msg( + self.packer, lkas_hud_msg, enabled, left_line, right_line, left_lane_depart, right_lane_depart)) + + if frame % 50 == 0: + can_sends.append(nissancan.create_lkas_hud_info_msg( + self.packer, lkas_hud_info_msg, steer_hud_alert + )) + + new_actuators = actuators.copy() + new_actuators.steeringAngleDeg = apply_angle + + return new_actuators, can_sends diff --git a/selfdrive/car/nissan/carstate.py b/selfdrive/car/nissan/carstate.py new file mode 100644 index 000000000..6b030e9b4 --- /dev/null +++ b/selfdrive/car/nissan/carstate.py @@ -0,0 +1,350 @@ +import copy +from collections import deque +from cereal import car +from opendbc.can.can_define import CANDefine +from selfdrive.car.interfaces import CarStateBase +from selfdrive.config import Conversions as CV +from opendbc.can.parser import CANParser +from selfdrive.car.nissan.values import CAR, DBC, CarControllerParams + +TORQUE_SAMPLES = 12 + +class CarState(CarStateBase): + def __init__(self, CP): + super().__init__(CP) + can_define = CANDefine(DBC[CP.carFingerprint]["pt"]) + + self.lkas_hud_msg = None + self.lkas_hud_info_msg = None + + self.steeringTorqueSamples = deque(TORQUE_SAMPLES*[0], TORQUE_SAMPLES) + self.shifter_values = can_define.dv["GEARBOX"]["GEAR_SHIFTER"] + + def update(self, cp, cp_adas, cp_cam): + ret = car.CarState.new_message() + + if self.CP.carFingerprint in (CAR.ROGUE, CAR.XTRAIL, CAR.ALTIMA): + ret.gas = cp.vl["GAS_PEDAL"]["GAS_PEDAL"] + elif self.CP.carFingerprint in (CAR.LEAF, CAR.LEAF_IC): + ret.gas = cp.vl["CRUISE_THROTTLE"]["GAS_PEDAL"] + + ret.gasPressed = bool(ret.gas > 3) + + if self.CP.carFingerprint in (CAR.ROGUE, CAR.XTRAIL, CAR.ALTIMA): + ret.brakePressed = bool(cp.vl["DOORS_LIGHTS"]["USER_BRAKE_PRESSED"]) + elif self.CP.carFingerprint in (CAR.LEAF, CAR.LEAF_IC): + ret.brakePressed = bool(cp.vl["CRUISE_THROTTLE"]["USER_BRAKE_PRESSED"]) + + ret.wheelSpeeds = self.get_wheel_speeds( + cp.vl["WHEEL_SPEEDS_FRONT"]["WHEEL_SPEED_FL"], + cp.vl["WHEEL_SPEEDS_FRONT"]["WHEEL_SPEED_FR"], + cp.vl["WHEEL_SPEEDS_REAR"]["WHEEL_SPEED_RL"], + cp.vl["WHEEL_SPEEDS_REAR"]["WHEEL_SPEED_RR"], + ) + ret.vEgoRaw = (ret.wheelSpeeds.fl + ret.wheelSpeeds.fr + ret.wheelSpeeds.rl + ret.wheelSpeeds.rr) / 4. + + ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) + ret.standstill = ret.vEgoRaw < 0.01 + + if self.CP.carFingerprint == CAR.ALTIMA: + ret.cruiseState.enabled = bool(cp.vl["CRUISE_STATE"]["CRUISE_ENABLED"]) + else: + ret.cruiseState.enabled = bool(cp_adas.vl["CRUISE_STATE"]["CRUISE_ENABLED"]) + + if self.CP.carFingerprint in (CAR.ROGUE, CAR.XTRAIL): + ret.seatbeltUnlatched = cp.vl["HUD"]["SEATBELT_DRIVER_LATCHED"] == 0 + ret.cruiseState.available = bool(cp_cam.vl["PRO_PILOT"]["CRUISE_ON"]) + elif self.CP.carFingerprint in (CAR.LEAF, CAR.LEAF_IC): + if self.CP.carFingerprint == CAR.LEAF: + ret.seatbeltUnlatched = cp.vl["SEATBELT"]["SEATBELT_DRIVER_LATCHED"] == 0 + elif self.CP.carFingerprint == CAR.LEAF_IC: + ret.seatbeltUnlatched = cp.vl["CANCEL_MSG"]["CANCEL_SEATBELT"] == 1 + ret.cruiseState.available = bool(cp.vl["CRUISE_THROTTLE"]["CRUISE_AVAILABLE"]) + elif self.CP.carFingerprint == CAR.ALTIMA: + ret.seatbeltUnlatched = cp.vl["HUD"]["SEATBELT_DRIVER_LATCHED"] == 0 + ret.cruiseState.available = bool(cp_adas.vl["PRO_PILOT"]["CRUISE_ON"]) + + if self.CP.carFingerprint == CAR.ALTIMA: + speed = cp.vl["PROPILOT_HUD"]["SET_SPEED"] + else: + speed = cp_adas.vl["PROPILOT_HUD"]["SET_SPEED"] + + if speed != 255: + if self.CP.carFingerprint in (CAR.LEAF, CAR.LEAF_IC): + conversion = CV.MPH_TO_MS if cp.vl["HUD_SETTINGS"]["SPEED_MPH"] else CV.KPH_TO_MS + else: + conversion = CV.MPH_TO_MS if cp.vl["HUD"]["SPEED_MPH"] else CV.KPH_TO_MS + speed -= 1 # Speed on HUD is always 1 lower than actually sent on can bus + ret.cruiseState.speed = speed * conversion + + if self.CP.carFingerprint == CAR.ALTIMA: + ret.steeringTorque = cp_cam.vl["STEER_TORQUE_SENSOR"]["STEER_TORQUE_DRIVER"] + else: + ret.steeringTorque = cp.vl["STEER_TORQUE_SENSOR"]["STEER_TORQUE_DRIVER"] + + self.steeringTorqueSamples.append(ret.steeringTorque) + # Filtering driver torque to prevent steeringPressed false positives + ret.steeringPressed = bool(abs(sum(self.steeringTorqueSamples) / TORQUE_SAMPLES) > CarControllerParams.STEER_THRESHOLD) + + ret.steeringAngleDeg = cp.vl["STEER_ANGLE_SENSOR"]["STEER_ANGLE"] + + ret.leftBlinker = bool(cp.vl["LIGHTS"]["LEFT_BLINKER"]) + ret.rightBlinker = bool(cp.vl["LIGHTS"]["RIGHT_BLINKER"]) + + ret.doorOpen = any([cp.vl["DOORS_LIGHTS"]["DOOR_OPEN_RR"], + cp.vl["DOORS_LIGHTS"]["DOOR_OPEN_RL"], + cp.vl["DOORS_LIGHTS"]["DOOR_OPEN_FR"], + cp.vl["DOORS_LIGHTS"]["DOOR_OPEN_FL"]]) + + ret.espDisabled = bool(cp.vl["ESP"]["ESP_DISABLED"]) + + can_gear = int(cp.vl["GEARBOX"]["GEAR_SHIFTER"]) + ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(can_gear, None)) + + if self.CP.carFingerprint == CAR.ALTIMA: + self.lkas_enabled = bool(cp.vl["LKAS_SETTINGS"]["LKAS_ENABLED"]) + else: + self.lkas_enabled = bool(cp_adas.vl["LKAS_SETTINGS"]["LKAS_ENABLED"]) + + self.cruise_throttle_msg = copy.copy(cp.vl["CRUISE_THROTTLE"]) + + if self.CP.carFingerprint in (CAR.LEAF, CAR.LEAF_IC): + self.cancel_msg = copy.copy(cp.vl["CANCEL_MSG"]) + + if self.CP.carFingerprint != CAR.ALTIMA: + self.lkas_hud_msg = copy.copy(cp_adas.vl["PROPILOT_HUD"]) + self.lkas_hud_info_msg = copy.copy(cp_adas.vl["PROPILOT_HUD_INFO_MSG"]) + + return ret + + @staticmethod + def get_can_parser(CP): + signals = [ + # sig_name, sig_address + ("WHEEL_SPEED_FL", "WHEEL_SPEEDS_FRONT"), + ("WHEEL_SPEED_FR", "WHEEL_SPEEDS_FRONT"), + ("WHEEL_SPEED_RL", "WHEEL_SPEEDS_REAR"), + ("WHEEL_SPEED_RR", "WHEEL_SPEEDS_REAR"), + + ("STEER_ANGLE", "STEER_ANGLE_SENSOR"), + + ("DOOR_OPEN_FR", "DOORS_LIGHTS"), + ("DOOR_OPEN_FL", "DOORS_LIGHTS"), + ("DOOR_OPEN_RR", "DOORS_LIGHTS"), + ("DOOR_OPEN_RL", "DOORS_LIGHTS"), + + ("RIGHT_BLINKER", "LIGHTS"), + ("LEFT_BLINKER", "LIGHTS"), + + ("ESP_DISABLED", "ESP"), + + ("GEAR_SHIFTER", "GEARBOX"), + ] + + checks = [ + # sig_address, frequency + ("STEER_ANGLE_SENSOR", 100), + ("WHEEL_SPEEDS_REAR", 50), + ("WHEEL_SPEEDS_FRONT", 50), + ("ESP", 25), + ("GEARBOX", 25), + ("DOORS_LIGHTS", 10), + ("LIGHTS", 10), + ] + + if CP.carFingerprint in (CAR.ROGUE, CAR.XTRAIL, CAR.ALTIMA): + signals += [ + ("USER_BRAKE_PRESSED", "DOORS_LIGHTS"), + + ("GAS_PEDAL", "GAS_PEDAL"), + ("SEATBELT_DRIVER_LATCHED", "HUD"), + ("SPEED_MPH", "HUD"), + + ("PROPILOT_BUTTON", "CRUISE_THROTTLE"), + ("CANCEL_BUTTON", "CRUISE_THROTTLE"), + ("GAS_PEDAL_INVERTED", "CRUISE_THROTTLE"), + ("SET_BUTTON", "CRUISE_THROTTLE"), + ("RES_BUTTON", "CRUISE_THROTTLE"), + ("FOLLOW_DISTANCE_BUTTON", "CRUISE_THROTTLE"), + ("NO_BUTTON_PRESSED", "CRUISE_THROTTLE"), + ("GAS_PEDAL", "CRUISE_THROTTLE"), + ("USER_BRAKE_PRESSED", "CRUISE_THROTTLE"), + ("NEW_SIGNAL_2", "CRUISE_THROTTLE"), + ("GAS_PRESSED_INVERTED", "CRUISE_THROTTLE"), + ("unsure1", "CRUISE_THROTTLE"), + ("unsure2", "CRUISE_THROTTLE"), + ("unsure3", "CRUISE_THROTTLE"), + ] + + checks += [ + ("GAS_PEDAL", 100), + ("CRUISE_THROTTLE", 50), + ("HUD", 25), + ] + + elif CP.carFingerprint in (CAR.LEAF, CAR.LEAF_IC): + signals += [ + ("USER_BRAKE_PRESSED", "CRUISE_THROTTLE"), + ("GAS_PEDAL", "CRUISE_THROTTLE"), + ("CRUISE_AVAILABLE", "CRUISE_THROTTLE"), + ("SPEED_MPH", "HUD_SETTINGS"), + ("SEATBELT_DRIVER_LATCHED", "SEATBELT"), + + # Copy other values, we use this to cancel + ("CANCEL_SEATBELT", "CANCEL_MSG"), + ("NEW_SIGNAL_1", "CANCEL_MSG"), + ("NEW_SIGNAL_2", "CANCEL_MSG"), + ("NEW_SIGNAL_3", "CANCEL_MSG"), + ] + checks += [ + ("BRAKE_PEDAL", 100), + ("CRUISE_THROTTLE", 50), + ("CANCEL_MSG", 50), + ("HUD_SETTINGS", 25), + ("SEATBELT", 10), + ] + + if CP.carFingerprint == CAR.ALTIMA: + signals += [ + ("LKAS_ENABLED", "LKAS_SETTINGS"), + ("CRUISE_ENABLED", "CRUISE_STATE"), + ("SET_SPEED", "PROPILOT_HUD"), + ] + checks += [ + ("CRUISE_STATE", 10), + ("LKAS_SETTINGS", 10), + ("PROPILOT_HUD", 50), + ] + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 1) + + signals.append(("STEER_TORQUE_DRIVER", "STEER_TORQUE_SENSOR")) + checks.append(("STEER_TORQUE_SENSOR", 100)) + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 0) + + @staticmethod + def get_adas_can_parser(CP): + # this function generates lists for signal, messages and initial values + + if CP.carFingerprint == CAR.ALTIMA: + signals = [ + ("DESIRED_ANGLE", "LKAS"), + ("SET_0x80_2", "LKAS"), + ("MAX_TORQUE", "LKAS"), + ("SET_0x80", "LKAS"), + ("COUNTER", "LKAS"), + ("LKA_ACTIVE", "LKAS"), + + ("CRUISE_ON", "PRO_PILOT"), + ] + checks = [ + ("LKAS", 100), + ("PRO_PILOT", 100), + ] + else: + signals = [ + # sig_name, sig_address + ("LKAS_ENABLED", "LKAS_SETTINGS"), + + ("CRUISE_ENABLED", "CRUISE_STATE"), + + ("DESIRED_ANGLE", "LKAS"), + ("SET_0x80_2", "LKAS"), + ("MAX_TORQUE", "LKAS"), + ("SET_0x80", "LKAS"), + ("COUNTER", "LKAS"), + ("LKA_ACTIVE", "LKAS"), + + # Below are the HUD messages. We copy the stock message and modify + ("LARGE_WARNING_FLASHING", "PROPILOT_HUD"), + ("SIDE_RADAR_ERROR_FLASHING1", "PROPILOT_HUD"), + ("SIDE_RADAR_ERROR_FLASHING2", "PROPILOT_HUD"), + ("LEAD_CAR", "PROPILOT_HUD"), + ("LEAD_CAR_ERROR", "PROPILOT_HUD"), + ("FRONT_RADAR_ERROR", "PROPILOT_HUD"), + ("FRONT_RADAR_ERROR_FLASHING", "PROPILOT_HUD"), + ("SIDE_RADAR_ERROR_FLASHING3", "PROPILOT_HUD"), + ("LKAS_ERROR_FLASHING", "PROPILOT_HUD"), + ("SAFETY_SHIELD_ACTIVE", "PROPILOT_HUD"), + ("RIGHT_LANE_GREEN_FLASH", "PROPILOT_HUD"), + ("LEFT_LANE_GREEN_FLASH", "PROPILOT_HUD"), + ("FOLLOW_DISTANCE", "PROPILOT_HUD"), + ("AUDIBLE_TONE", "PROPILOT_HUD"), + ("SPEED_SET_ICON", "PROPILOT_HUD"), + ("SMALL_STEERING_WHEEL_ICON", "PROPILOT_HUD"), + ("unknown59", "PROPILOT_HUD"), + ("unknown55", "PROPILOT_HUD"), + ("unknown26", "PROPILOT_HUD"), + ("unknown28", "PROPILOT_HUD"), + ("unknown31", "PROPILOT_HUD"), + ("SET_SPEED", "PROPILOT_HUD"), + ("unknown43", "PROPILOT_HUD"), + ("unknown08", "PROPILOT_HUD"), + ("unknown05", "PROPILOT_HUD"), + ("unknown02", "PROPILOT_HUD"), + + ("NA_HIGH_ACCEL_TEMP", "PROPILOT_HUD_INFO_MSG"), + ("SIDE_RADAR_NA_HIGH_CABIN_TEMP", "PROPILOT_HUD_INFO_MSG"), + ("SIDE_RADAR_MALFUNCTION", "PROPILOT_HUD_INFO_MSG"), + ("LKAS_MALFUNCTION", "PROPILOT_HUD_INFO_MSG"), + ("FRONT_RADAR_MALFUNCTION", "PROPILOT_HUD_INFO_MSG"), + ("SIDE_RADAR_NA_CLEAN_REAR_CAMERA", "PROPILOT_HUD_INFO_MSG"), + ("NA_POOR_ROAD_CONDITIONS", "PROPILOT_HUD_INFO_MSG"), + ("CURRENTLY_UNAVAILABLE", "PROPILOT_HUD_INFO_MSG"), + ("SAFETY_SHIELD_OFF", "PROPILOT_HUD_INFO_MSG"), + ("FRONT_COLLISION_NA_FRONT_RADAR_OBSTRUCTION", "PROPILOT_HUD_INFO_MSG"), + ("PEDAL_MISSAPPLICATION_SYSTEM_ACTIVATED", "PROPILOT_HUD_INFO_MSG"), + ("SIDE_IMPACT_NA_RADAR_OBSTRUCTION", "PROPILOT_HUD_INFO_MSG"), + ("WARNING_DO_NOT_ENTER", "PROPILOT_HUD_INFO_MSG"), + ("SIDE_IMPACT_SYSTEM_OFF", "PROPILOT_HUD_INFO_MSG"), + ("SIDE_IMPACT_MALFUNCTION", "PROPILOT_HUD_INFO_MSG"), + ("FRONT_COLLISION_MALFUNCTION", "PROPILOT_HUD_INFO_MSG"), + ("SIDE_RADAR_MALFUNCTION2", "PROPILOT_HUD_INFO_MSG"), + ("LKAS_MALFUNCTION2", "PROPILOT_HUD_INFO_MSG"), + ("FRONT_RADAR_MALFUNCTION2", "PROPILOT_HUD_INFO_MSG"), + ("PROPILOT_NA_MSGS", "PROPILOT_HUD_INFO_MSG"), + ("BOTTOM_MSG", "PROPILOT_HUD_INFO_MSG"), + ("HANDS_ON_WHEEL_WARNING", "PROPILOT_HUD_INFO_MSG"), + ("WARNING_STEP_ON_BRAKE_NOW", "PROPILOT_HUD_INFO_MSG"), + ("PROPILOT_NA_FRONT_CAMERA_OBSTRUCTED", "PROPILOT_HUD_INFO_MSG"), + ("PROPILOT_NA_HIGH_CABIN_TEMP", "PROPILOT_HUD_INFO_MSG"), + ("WARNING_PROPILOT_MALFUNCTION", "PROPILOT_HUD_INFO_MSG"), + ("ACC_UNAVAILABLE_HIGH_CABIN_TEMP", "PROPILOT_HUD_INFO_MSG"), + ("ACC_NA_FRONT_CAMERA_IMPARED", "PROPILOT_HUD_INFO_MSG"), + ("unknown07", "PROPILOT_HUD_INFO_MSG"), + ("unknown10", "PROPILOT_HUD_INFO_MSG"), + ("unknown15", "PROPILOT_HUD_INFO_MSG"), + ("unknown23", "PROPILOT_HUD_INFO_MSG"), + ("unknown19", "PROPILOT_HUD_INFO_MSG"), + ("unknown31", "PROPILOT_HUD_INFO_MSG"), + ("unknown32", "PROPILOT_HUD_INFO_MSG"), + ("unknown46", "PROPILOT_HUD_INFO_MSG"), + ("unknown61", "PROPILOT_HUD_INFO_MSG"), + ("unknown55", "PROPILOT_HUD_INFO_MSG"), + ("unknown50", "PROPILOT_HUD_INFO_MSG"), + ] + + checks = [ + ("PROPILOT_HUD_INFO_MSG", 2), + ("LKAS_SETTINGS", 10), + ("CRUISE_STATE", 50), + ("PROPILOT_HUD", 50), + ("LKAS", 100), + ] + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 2) + + @staticmethod + def get_cam_can_parser(CP): + signals = [] + checks = [] + + if CP.carFingerprint in (CAR.ROGUE, CAR.XTRAIL): + signals.append(("CRUISE_ON", "PRO_PILOT")) + checks.append(("PRO_PILOT", 100)) + elif CP.carFingerprint == CAR.ALTIMA: + signals.append(("STEER_TORQUE_DRIVER", "STEER_TORQUE_SENSOR")) + checks.append(("STEER_TORQUE_SENSOR", 100)) + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 0) + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 1) diff --git a/selfdrive/car/nissan/interface.py b/selfdrive/car/nissan/interface.py new file mode 100644 index 000000000..d3afee2a5 --- /dev/null +++ b/selfdrive/car/nissan/interface.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python3 +from cereal import car +from selfdrive.car.nissan.values import CAR +from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config +from selfdrive.car.interfaces import CarInterfaceBase + +class CarInterface(CarInterfaceBase): + def __init__(self, CP, CarController, CarState): + super().__init__(CP, CarController, CarState) + self.cp_adas = self.CS.get_adas_can_parser(CP) + + @staticmethod + def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None): + + ret = CarInterfaceBase.get_std_params(candidate, fingerprint) + ret.carName = "nissan" + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.nissan)] + + ret.steerLimitTimer = 1.0 + ret.steerRateCost = 0.5 + + ret.steerActuatorDelay = 0.1 + + if candidate in (CAR.ROGUE, CAR.XTRAIL): + ret.mass = 1610 + STD_CARGO_KG + ret.wheelbase = 2.705 + ret.centerToFront = ret.wheelbase * 0.44 + ret.steerRatio = 17 + elif candidate in (CAR.LEAF, CAR.LEAF_IC): + ret.mass = 1610 + STD_CARGO_KG + ret.wheelbase = 2.705 + ret.centerToFront = ret.wheelbase * 0.44 + ret.steerRatio = 17 + elif candidate == CAR.ALTIMA: + # Altima has EPS on C-CAN unlike the others that have it on V-CAN + ret.safetyConfigs[0].safetyParam = 1 # EPS is on alternate bus + ret.mass = 1492 + STD_CARGO_KG + ret.wheelbase = 2.824 + ret.centerToFront = ret.wheelbase * 0.44 + ret.steerRatio = 17 + + ret.steerControlType = car.CarParams.SteerControlType.angle + ret.radarOffCan = True + + # TODO: get actual value, for now starting with reasonable value for + # civic and scaling by mass and wheelbase + ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) + + # TODO: start from empirically derived lateral slip stiffness for the civic and scale by + # mass and CG position, so all cars will have approximately similar dyn behaviors + ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront) + + return ret + + # returns a car.CarState + def update(self, c, can_strings): + self.cp.update_strings(can_strings) + self.cp_cam.update_strings(can_strings) + self.cp_adas.update_strings(can_strings) + + ret = self.CS.update(self.cp, self.cp_adas, self.cp_cam) + self.post_update(c,ret) + ret.canValid = self.cp.can_valid and self.cp_adas.can_valid and self.cp_cam.can_valid + + buttonEvents = [] + be = car.CarState.ButtonEvent.new_message() + be.type = car.CarState.ButtonEvent.Type.accelCruise + buttonEvents.append(be) + + events = self.create_common_events(ret) + + if self.CS.lkas_enabled: + events.add(car.CarEvent.EventName.invalidLkasSetting) + + ret.events = events.to_msg() + + self.CS.out = ret.as_reader() + return self.CS.out + + def apply(self, c): + hud_control = c.hudControl + ret = self.CC.update(c, c.enabled, self.CS, self.frame, c.actuators, + c.cruiseControl.cancel, hud_control.visualAlert, + hud_control.leftLaneVisible, hud_control.rightLaneVisible, + hud_control.leftLaneDepart, hud_control.rightLaneDepart) + self.frame += 1 + return ret diff --git a/selfdrive/car/nissan/nissancan.py b/selfdrive/car/nissan/nissancan.py new file mode 100644 index 000000000..ceace5088 --- /dev/null +++ b/selfdrive/car/nissan/nissancan.py @@ -0,0 +1,71 @@ +import copy +import crcmod +from selfdrive.car.nissan.values import CAR + +nissan_checksum = crcmod.mkCrcFun(0x11d, initCrc=0x00, rev=False, xorOut=0xff) + + +def create_steering_control(packer, apply_steer, frame, steer_on, lkas_max_torque): + idx = (frame % 16) + values = { + "DESIRED_ANGLE": apply_steer, + "SET_0x80_2": 0x80, + "SET_0x80": 0x80, + "MAX_TORQUE": lkas_max_torque if steer_on else 0, + "COUNTER": idx, + "LKA_ACTIVE": steer_on, + } + + dat = packer.make_can_msg("LKAS", 0, values)[2] + + values["CHECKSUM"] = nissan_checksum(dat[:7]) + return packer.make_can_msg("LKAS", 0, values) + + +def create_acc_cancel_cmd(packer, car_fingerprint, cruise_throttle_msg, frame): + values = copy.copy(cruise_throttle_msg) + can_bus = 2 + + if car_fingerprint == CAR.ALTIMA: + can_bus = 1 + + values["CANCEL_BUTTON"] = 1 + values["NO_BUTTON_PRESSED"] = 0 + values["PROPILOT_BUTTON"] = 0 + values["SET_BUTTON"] = 0 + values["RES_BUTTON"] = 0 + values["FOLLOW_DISTANCE_BUTTON"] = 0 + values["COUNTER"] = (frame % 4) + + return packer.make_can_msg("CRUISE_THROTTLE", can_bus, values) + + +def create_cancel_msg(packer, cancel_msg, cruise_cancel): + values = copy.copy(cancel_msg) + + if cruise_cancel: + values["CANCEL_SEATBELT"] = 1 + + return packer.make_can_msg("CANCEL_MSG", 2, values) + + +def create_lkas_hud_msg(packer, lkas_hud_msg, enabled, left_line, right_line, left_lane_depart, right_lane_depart): + values = lkas_hud_msg + + values["RIGHT_LANE_YELLOW_FLASH"] = 1 if right_lane_depart else 0 + values["LEFT_LANE_YELLOW_FLASH"] = 1 if left_lane_depart else 0 + + values["LARGE_STEERING_WHEEL_ICON"] = 2 if enabled else 0 + values["RIGHT_LANE_GREEN"] = 1 if right_line and enabled else 0 + values["LEFT_LANE_GREEN"] = 1 if left_line and enabled else 0 + + return packer.make_can_msg("PROPILOT_HUD", 0, values) + + +def create_lkas_hud_info_msg(packer, lkas_hud_info_msg, steer_hud_alert): + values = lkas_hud_info_msg + + if steer_hud_alert: + values["HANDS_ON_WHEEL_WARNING"] = 1 + + return packer.make_can_msg("PROPILOT_HUD_INFO_MSG", 0, values) diff --git a/selfdrive/car/nissan/radar_interface.py b/selfdrive/car/nissan/radar_interface.py new file mode 100644 index 000000000..b2f765113 --- /dev/null +++ b/selfdrive/car/nissan/radar_interface.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 +from selfdrive.car.interfaces import RadarInterfaceBase + +class RadarInterface(RadarInterfaceBase): + pass diff --git a/selfdrive/car/nissan/values.py b/selfdrive/car/nissan/values.py new file mode 100644 index 000000000..f7001d141 --- /dev/null +++ b/selfdrive/car/nissan/values.py @@ -0,0 +1,121 @@ +from selfdrive.car import dbc_dict +from cereal import car +Ecu = car.CarParams.Ecu + + +class CarControllerParams: + ANGLE_DELTA_BP = [0., 5., 15.] + ANGLE_DELTA_V = [5., .8, .15] # windup limit + ANGLE_DELTA_VU = [5., 3.5, 0.4] # unwind limit + LKAS_MAX_TORQUE = 1 # A value of 1 is easy to overpower + STEER_THRESHOLD = 1.0 + +class CAR: + XTRAIL = "NISSAN X-TRAIL 2017" + LEAF = "NISSAN LEAF 2018" + # Leaf with ADAS ECU found behind instrument cluster instead of glovebox + # Currently the only known difference between them is the inverted seatbelt signal. + LEAF_IC = "NISSAN LEAF 2018 Instrument Cluster" + ROGUE = "NISSAN ROGUE 2019" + ALTIMA = "NISSAN ALTIMA 2020" + + +FINGERPRINTS = { + CAR.XTRAIL: [ + { + 2: 5, 42: 6, 346: 6, 347: 5, 348: 8, 349: 7, 361: 8, 386: 8, 389: 8, 397: 8, 398: 8, 403: 8, 520: 2, 523: 6, 548: 8, 645: 8, 658: 8, 665: 8, 666: 8, 674: 2, 682: 8, 683: 8, 689: 8, 723: 8, 758: 3, 768: 2, 783: 3, 851: 8, 855: 8, 1041: 8, 1055: 2, 1104: 4, 1105: 6, 1107: 4, 1108: 8, 1111: 4, 1227: 8, 1228: 8, 1247: 4, 1266: 8, 1273: 7, 1342: 1, 1376: 6, 1401: 8, 1474: 2, 1497: 3, 1821: 8, 1823: 8, 1837: 8, 2015: 8, 2016: 8, 2024: 8 + }, + { + 2: 5, 42: 6, 346: 6, 347: 5, 348: 8, 349: 7, 361: 8, 386: 8, 389: 8, 397: 8, 398: 8, 403: 8, 520: 2, 523: 6, 527: 1, 548: 8, 637: 4, 645: 8, 658: 8, 665: 8, 666: 8, 674: 2, 682: 8, 683: 8, 689: 8, 723: 8, 758: 3, 768: 6, 783: 3, 851: 8, 855: 8, 1041: 8, 1055: 2, 1104: 4, 1105: 6, 1107: 4, 1108: 8, 1111: 4, 1227: 8, 1228: 8, 1247: 4, 1266: 8, 1273: 7, 1342: 1, 1376: 6, 1401: 8, 1474: 8, 1497: 3, 1534: 6, 1792: 8, 1821: 8, 1823: 8, 1837: 8, 1872: 8, 1937: 8, 1953: 8, 1968: 8, 2015: 8, 2016: 8, 2024: 8 + }, + ], + CAR.LEAF: [ + { + 2: 5, 42: 6, 264: 3, 361: 8, 372: 8, 384: 8, 389: 8, 403: 8, 459: 7, 460: 4, 470: 8, 520: 1, 569: 8, 581: 8, 634: 7, 640: 8, 644: 8, 645: 8, 646: 5, 658: 8, 682: 8, 683: 8, 689: 8, 724: 6, 758: 3, 761: 2, 783: 3, 852: 8, 853: 8, 856: 8, 861: 8, 944: 1, 976: 6, 1008: 7, 1011: 7, 1057: 3, 1227: 8, 1228: 8, 1261: 5, 1342: 1, 1354: 8, 1361: 8, 1459: 8, 1477: 8, 1497: 3, 1549: 8, 1573: 6, 1821: 8, 1837: 8, 1856: 8, 1859: 8, 1861: 8, 1864: 8, 1874: 8, 1888: 8, 1891: 8, 1893: 8, 1906: 8, 1947: 8, 1949: 8, 1979: 8, 1981: 8, 2016: 8, 2017: 8, 2021: 8, 643: 5, 1792: 8, 1872: 8, 1937: 8, 1953: 8, 1968: 8, 1988: 8, 2000: 8, 2001: 8, 2004: 8, 2005: 8, 2015: 8 + }, + # 2020 Leaf SV Plus + { + 2: 5, 42: 8, 264: 3, 361: 8, 372: 8, 384: 8, 389: 8, 403: 8, 459: 7, 460: 4, 470: 8, 520: 1, 569: 8, 581: 8, 634: 7, 640: 8, 643: 5, 644: 8, 645: 8, 646: 5, 658: 8, 682: 8, 683: 8, 689: 8, 724: 6, 758: 3, 761: 2, 772: 8, 773: 6, 774: 7, 775: 8, 776: 6, 777: 7, 778: 6, 783: 3, 852: 8, 853: 8, 856: 8, 861: 8, 943: 8, 944: 1, 976: 6, 1008: 7, 1009: 8, 1010: 8, 1011: 7, 1012: 8, 1013: 8, 1019: 8, 1020: 8, 1021: 8, 1022: 8, 1057: 3, 1227: 8, 1228: 8, 1261: 5, 1342: 1, 1354: 8, 1361: 8, 1402: 8, 1459: 8, 1477: 8, 1497: 3, 1549: 8, 1573: 6, 1821: 8, 1837: 8 + }, + ], + CAR.LEAF_IC: [ + { + 2: 5, 42: 6, 264: 3, 282: 8, 361: 8, 372: 8, 384: 8, 389: 8, 403: 8, 459: 7, 460: 4, 470: 8, 520: 1, 569: 8, 581: 8, 634: 7, 640: 8, 643: 5, 644: 8, 645: 8, 646: 5, 658: 8, 682: 8, 683: 8, 689: 8, 756: 5, 758: 3, 761: 2, 783: 3, 830: 2, 852: 8, 853: 8, 856: 8, 861: 8, 943: 8, 944: 1, 1001: 6, 1057: 3, 1227: 8, 1228: 8, 1229: 8, 1342: 1, 1354: 8, 1361: 8, 1459: 8, 1477: 8, 1497: 3, 1514: 6, 1549: 8, 1573: 6, 1792: 8, 1821: 8, 1822: 8, 1837: 8, 1838: 8, 1872: 8, 1937: 8, 1953: 8, 1968: 8, 1988: 8, 2000: 8, 2001: 8, 2004: 8, 2005: 8, 2015: 8, 2016: 8, 2017: 8 + }, + ], + CAR.ROGUE: [ + { + 2: 5, 42: 6, 346: 6, 347: 5, 348: 8, 349: 7, 361: 8, 386: 8, 389: 8, 397: 8, 398: 8, 403: 8, 520: 2, 523: 6, 548: 8, 634: 7, 643: 5, 645: 8, 658: 8, 665: 8, 666: 8, 674: 2, 682: 8, 683: 8, 689: 8, 723: 8, 758: 3, 772: 8, 773: 6, 774: 7, 775: 8, 776: 6, 777: 7, 778: 6, 783: 3, 851: 8, 855: 8, 1041: 8, 1042: 8, 1055: 2, 1104: 4, 1105: 6, 1107: 4, 1108: 8, 1110: 7, 1111: 7, 1227: 8, 1228: 8, 1247: 4, 1266: 8, 1273: 7, 1342: 1, 1376: 6, 1401: 8, 1474: 2, 1497: 3, 1534: 7, 1792: 8, 1821: 8, 1823: 8, 1837: 8, 1839: 8, 1872: 8, 1937: 8, 1953: 8, 1968: 8, 1988: 8, 2000: 8, 2001: 8, 2004: 8, 2005: 8, 2015: 8, 2016: 8, 2017: 8, 2024: 8, 2025: 8 + }, + ], + CAR.ALTIMA: [ + { + 2: 5, 42: 6, 346: 6, 347: 5, 348: 8, 349: 7, 361: 8, 386: 8, 389: 8, 397: 8, 398: 8, 403: 8, 438: 8, 451: 8, 517: 8, 520: 2, 522: 8, 523: 6, 539: 8, 541: 7, 542: 8, 543: 8, 544: 8, 545: 8, 546: 8, 547: 8, 548: 8, 570: 8, 576: 8, 577: 8, 582: 8, 583: 8, 584: 8, 586: 8, 587: 8, 588: 8, 589: 8, 590: 8, 591: 8, 592: 8, 600: 8, 601: 8, 610: 8, 611: 8, 612: 8, 614: 8, 615: 8, 616: 8, 617: 8, 622: 8, 623: 8, 634: 7, 638: 8, 645: 8, 648: 5, 654: 6, 658: 8, 659: 8, 660: 8, 661: 8, 665: 8, 666: 8, 674: 2, 675: 8, 676: 8, 682: 8, 683: 8, 684: 8, 685: 8, 686: 8, 687: 8, 689: 8, 690: 8, 703: 8, 708: 7, 709: 7, 711: 7, 712: 7, 713: 7, 714: 8, 715: 8, 716: 8, 717: 7, 718: 7, 719: 7, 720: 7, 723: 8, 726: 7, 727: 7, 728: 7, 735: 8, 746: 8, 748: 6, 749: 6, 750: 8, 758: 3, 772: 8, 773: 6, 774: 7, 775: 8, 776: 6, 777: 7, 778: 6, 779: 7, 781: 7, 782: 7, 783: 3, 851: 8, 855: 5, 1001: 6, 1041: 8, 1042: 8, 1055: 3, 1100: 7, 1104: 4, 1105: 6, 1107: 4, 1108: 8, 1110: 7, 1111: 7, 1144: 7, 1145: 7, 1227: 8, 1228: 8, 1229: 8, 1232: 8, 1247: 4, 1258: 8, 1259: 8, 1266: 8, 1273: 7, 1306: 1, 1314: 8, 1323: 8, 1324: 8, 1342: 1, 1376: 8, 1401: 8, 1454: 8, 1497: 3, 1514: 6, 1526: 8, 1527: 5, 1792: 8, 1821: 8, 1823: 8, 1837: 8, 1872: 8, 1937: 8, 1953: 8, 1968: 8, 1988: 8, 2000: 8, 2001: 8, 2004: 8, 2005: 8, 2015: 8, 2016: 8, 2017: 8, 2024: 8, 2025: 8 + }, + ] +} + +FW_VERSIONS = { + CAR.ALTIMA: { + (Ecu.fwdCamera, 0x707, None): [ + b'284N86CA1D', + ], + (Ecu.eps, 0x742, None): [ + b'6CA2B\xa9A\x02\x02G8A89P90D6A\x00\x00\x01\x80', + ], + (Ecu.engine, 0x7e0, None): [ + b'237109HE2B', + ], + (Ecu.gateway, 0x18dad0f1, None): [ + b'284U29HE0A', + ], + }, + CAR.LEAF_IC: { + (Ecu.fwdCamera, 0x707, None): [ + b'5SH1BDB\x04\x18\x00\x00\x00\x00\x00_-?\x04\x91\xf2\x00\x00\x00\x80', + b'5SK0ADB\x04\x18\x00\x00\x00\x00\x00_(5\x07\x9aQ\x00\x00\x00\x80', + ], + (Ecu.esp, 0x740, None): [ + b'476605SH1D', + b'476605SK2A', + ], + (Ecu.eps, 0x742, None): [ + b'5SH2A\x99A\x05\x02N123F\x15\x81\x00\x00\x00\x00\x00\x00\x00\x80', + b'5SK3A\x99A\x05\x02N123F\x15u\x00\x00\x00\x00\x00\x00\x00\x80', + ], + (Ecu.gateway, 0x18dad0f1, None): [ + b'284U25SH3A', + b'284U25SK2D', + ], + }, + CAR.XTRAIL: { + (Ecu.fwdCamera, 0x707, None): [ + b'284N86FR2A', + ], + (Ecu.esp, 0x740, None): [ + b'6FU1BD\x11\x02\x00\x02e\x95e\x80iX#\x01\x00\x00\x00\x00\x00\x80', + b'6FU0AD\x11\x02\x00\x02e\x95e\x80iQ#\x01\x00\x00\x00\x00\x00\x80', + ], + (Ecu.eps, 0x742, None): [ + b'6FP2A\x99A\x05\x02N123F\x18\x02\x00\x00\x00\x00\x00\x00\x00\x80', + ], + (Ecu.combinationMeter, 0x743, None): [ + b'6FR2A\x18B\x05\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80', + ], + (Ecu.engine, 0x7e0, None): [ + b'6FU9B\xa0A\x06\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80', + b'6FR9A\xa0A\x06\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80', + ], + (Ecu.gateway, 0x18dad0f1, None): [ + b'284U26FR0E', + ], + }, +} + +DBC = { + CAR.XTRAIL: dbc_dict('nissan_x_trail_2017', None), + CAR.LEAF: dbc_dict('nissan_leaf_2018', None), + CAR.LEAF_IC: dbc_dict('nissan_leaf_2018', None), + CAR.ROGUE: dbc_dict('nissan_x_trail_2017', None), + CAR.ALTIMA: dbc_dict('nissan_x_trail_2017', None), +} diff --git a/selfdrive/car/subaru/__init__.py b/selfdrive/car/subaru/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/subaru/carcontroller.py b/selfdrive/car/subaru/carcontroller.py new file mode 100644 index 000000000..afc91f475 --- /dev/null +++ b/selfdrive/car/subaru/carcontroller.py @@ -0,0 +1,78 @@ +from selfdrive.car import apply_std_steer_torque_limits +from selfdrive.car.subaru import subarucan +from selfdrive.car.subaru.values import DBC, PREGLOBAL_CARS, CarControllerParams +from opendbc.can.packer import CANPacker + + +class CarController(): + def __init__(self, dbc_name, CP, VM): + self.apply_steer_last = 0 + self.es_distance_cnt = -1 + self.es_lkas_cnt = -1 + self.cruise_button_prev = 0 + self.steer_rate_limited = False + + self.p = CarControllerParams(CP) + self.packer = CANPacker(DBC[CP.carFingerprint]['pt']) + + def update(self, c, enabled, CS, frame, actuators, pcm_cancel_cmd, visual_alert, left_line, right_line, left_lane_depart, right_lane_depart): + + can_sends = [] + + # *** steering *** + if (frame % self.p.STEER_STEP) == 0: + + apply_steer = int(round(actuators.steer * self.p.STEER_MAX)) + + # limits due to driver torque + + new_steer = int(round(apply_steer)) + apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, self.p) + self.steer_rate_limited = new_steer != apply_steer + + if not c.active: + apply_steer = 0 + + if CS.CP.carFingerprint in PREGLOBAL_CARS: + can_sends.append(subarucan.create_preglobal_steering_control(self.packer, apply_steer, frame, self.p.STEER_STEP)) + else: + can_sends.append(subarucan.create_steering_control(self.packer, apply_steer, frame, self.p.STEER_STEP)) + + self.apply_steer_last = apply_steer + + + # *** alerts and pcm cancel *** + + if CS.CP.carFingerprint in PREGLOBAL_CARS: + if self.es_distance_cnt != CS.es_distance_msg["Counter"]: + # 1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 = resume deep + # disengage ACC when OP is disengaged + if pcm_cancel_cmd: + cruise_button = 1 + # turn main on if off and past start-up state + elif not CS.out.cruiseState.available and CS.ready: + cruise_button = 1 + else: + cruise_button = CS.cruise_button + + # unstick previous mocked button press + if cruise_button == 1 and self.cruise_button_prev == 1: + cruise_button = 0 + self.cruise_button_prev = cruise_button + + can_sends.append(subarucan.create_preglobal_es_distance(self.packer, cruise_button, CS.es_distance_msg)) + self.es_distance_cnt = CS.es_distance_msg["Counter"] + + else: + if self.es_distance_cnt != CS.es_distance_msg["Counter"]: + can_sends.append(subarucan.create_es_distance(self.packer, CS.es_distance_msg, pcm_cancel_cmd)) + self.es_distance_cnt = CS.es_distance_msg["Counter"] + + if self.es_lkas_cnt != CS.es_lkas_msg["Counter"]: + can_sends.append(subarucan.create_es_lkas(self.packer, CS.es_lkas_msg, enabled, visual_alert, left_line, right_line, left_lane_depart, right_lane_depart)) + self.es_lkas_cnt = CS.es_lkas_msg["Counter"] + + new_actuators = actuators.copy() + new_actuators.steer = self.apply_steer_last / self.p.STEER_MAX + + return new_actuators, can_sends diff --git a/selfdrive/car/subaru/carstate.py b/selfdrive/car/subaru/carstate.py new file mode 100644 index 000000000..1eefb1858 --- /dev/null +++ b/selfdrive/car/subaru/carstate.py @@ -0,0 +1,232 @@ +import copy +from cereal import car +from opendbc.can.can_define import CANDefine +from selfdrive.config import Conversions as CV +from selfdrive.car.interfaces import CarStateBase +from opendbc.can.parser import CANParser +from selfdrive.car.subaru.values import DBC, STEER_THRESHOLD, CAR, PREGLOBAL_CARS + + +class CarState(CarStateBase): + def __init__(self, CP): + super().__init__(CP) + can_define = CANDefine(DBC[CP.carFingerprint]["pt"]) + self.shifter_values = can_define.dv["Transmission"]["Gear"] + + def update(self, cp, cp_cam): + ret = car.CarState.new_message() + + ret.gas = cp.vl["Throttle"]["Throttle_Pedal"] / 255. + ret.gasPressed = ret.gas > 1e-5 + if self.car_fingerprint in PREGLOBAL_CARS: + ret.brakePressed = cp.vl["Brake_Pedal"]["Brake_Pedal"] > 2 + else: + ret.brakePressed = cp.vl["Brake_Status"]["Brake"] == 1 + + ret.wheelSpeeds = self.get_wheel_speeds( + cp.vl["Wheel_Speeds"]["FL"], + cp.vl["Wheel_Speeds"]["FR"], + cp.vl["Wheel_Speeds"]["RL"], + cp.vl["Wheel_Speeds"]["RR"], + ) + ret.vEgoRaw = (ret.wheelSpeeds.fl + ret.wheelSpeeds.fr + ret.wheelSpeeds.rl + ret.wheelSpeeds.rr) / 4. + # Kalman filter, even though Subaru raw wheel speed is heaviliy filtered by default + ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) + ret.standstill = ret.vEgoRaw < 0.01 + + # continuous blinker signals for assisted lane change + ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp( + 50, cp.vl["Dashlights"]["LEFT_BLINKER"], cp.vl["Dashlights"]["RIGHT_BLINKER"]) + + if self.CP.enableBsm: + ret.leftBlindspot = (cp.vl["BSD_RCTA"]["L_ADJACENT"] == 1) or (cp.vl["BSD_RCTA"]["L_APPROACHING"] == 1) + ret.rightBlindspot = (cp.vl["BSD_RCTA"]["R_ADJACENT"] == 1) or (cp.vl["BSD_RCTA"]["R_APPROACHING"] == 1) + + can_gear = int(cp.vl["Transmission"]["Gear"]) + ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(can_gear, None)) + + ret.steeringAngleDeg = cp.vl["Steering_Torque"]["Steering_Angle"] + ret.steeringTorque = cp.vl["Steering_Torque"]["Steer_Torque_Sensor"] + ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD[self.car_fingerprint] + + ret.cruiseState.enabled = cp.vl["CruiseControl"]["Cruise_Activated"] != 0 + ret.cruiseState.available = cp.vl["CruiseControl"]["Cruise_On"] != 0 + ret.cruiseState.speed = cp_cam.vl["ES_DashStatus"]["Cruise_Set_Speed"] * CV.KPH_TO_MS + + if (self.car_fingerprint in PREGLOBAL_CARS and cp.vl["Dash_State2"]["UNITS"] == 1) or \ + (self.car_fingerprint not in PREGLOBAL_CARS and cp.vl["Dashlights"]["UNITS"] == 1): + ret.cruiseState.speed *= CV.MPH_TO_KPH + + ret.seatbeltUnlatched = cp.vl["Dashlights"]["SEATBELT_FL"] == 1 + ret.doorOpen = any([cp.vl["BodyInfo"]["DOOR_OPEN_RR"], + cp.vl["BodyInfo"]["DOOR_OPEN_RL"], + cp.vl["BodyInfo"]["DOOR_OPEN_FR"], + cp.vl["BodyInfo"]["DOOR_OPEN_FL"]]) + ret.steerError = cp.vl["Steering_Torque"]["Steer_Error_1"] == 1 + + if self.car_fingerprint in PREGLOBAL_CARS: + self.cruise_button = cp_cam.vl["ES_Distance"]["Cruise_Button"] + self.ready = not cp_cam.vl["ES_DashStatus"]["Not_Ready_Startup"] + else: + ret.steerWarning = cp.vl["Steering_Torque"]["Steer_Warning"] == 1 + ret.cruiseState.nonAdaptive = cp_cam.vl["ES_DashStatus"]["Conventional_Cruise"] == 1 + self.es_lkas_msg = copy.copy(cp_cam.vl["ES_LKAS_State"]) + self.es_distance_msg = copy.copy(cp_cam.vl["ES_Distance"]) + + return ret + + @staticmethod + def get_can_parser(CP): + signals = [ + # sig_name, sig_address + ("Steer_Torque_Sensor", "Steering_Torque"), + ("Steering_Angle", "Steering_Torque"), + ("Steer_Error_1", "Steering_Torque"), + ("Cruise_On", "CruiseControl"), + ("Cruise_Activated", "CruiseControl"), + ("Brake_Pedal", "Brake_Pedal"), + ("Throttle_Pedal", "Throttle"), + ("LEFT_BLINKER", "Dashlights"), + ("RIGHT_BLINKER", "Dashlights"), + ("SEATBELT_FL", "Dashlights"), + ("FL", "Wheel_Speeds"), + ("FR", "Wheel_Speeds"), + ("RL", "Wheel_Speeds"), + ("RR", "Wheel_Speeds"), + ("DOOR_OPEN_FR", "BodyInfo"), + ("DOOR_OPEN_FL", "BodyInfo"), + ("DOOR_OPEN_RR", "BodyInfo"), + ("DOOR_OPEN_RL", "BodyInfo"), + ("Gear", "Transmission"), + ] + + checks = [ + # sig_address, frequency + ("Throttle", 100), + ("Dashlights", 10), + ("Brake_Pedal", 50), + ("Wheel_Speeds", 50), + ("Transmission", 100), + ("Steering_Torque", 50), + ("BodyInfo", 1), + ] + + if CP.enableBsm: + signals += [ + ("L_ADJACENT", "BSD_RCTA"), + ("R_ADJACENT", "BSD_RCTA"), + ("L_APPROACHING", "BSD_RCTA"), + ("R_APPROACHING", "BSD_RCTA"), + ] + checks.append(("BSD_RCTA", 17)) + + if CP.carFingerprint not in PREGLOBAL_CARS: + signals += [ + ("Steer_Warning", "Steering_Torque"), + ("Brake", "Brake_Status"), + ("UNITS", "Dashlights"), + ] + + checks += [ + ("Dashlights", 10), + ("BodyInfo", 10), + ("Brake_Status", 50), + ("CruiseControl", 20), + ] + else: + signals.append(("UNITS", "Dash_State2")) + + checks.append(("Dash_State2", 1)) + + if CP.carFingerprint == CAR.FORESTER_PREGLOBAL: + checks += [ + ("Dashlights", 20), + ("BodyInfo", 1), + ("CruiseControl", 50), + ] + + if CP.carFingerprint in (CAR.LEGACY_PREGLOBAL, CAR.OUTBACK_PREGLOBAL, CAR.OUTBACK_PREGLOBAL_2018): + checks += [ + ("Dashlights", 10), + ("CruiseControl", 50), + ] + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 0) + + @staticmethod + def get_cam_can_parser(CP): + if CP.carFingerprint in PREGLOBAL_CARS: + signals = [ + ("Cruise_Set_Speed", "ES_DashStatus"), + ("Not_Ready_Startup", "ES_DashStatus"), + + ("Cruise_Throttle", "ES_Distance"), + ("Signal1", "ES_Distance"), + ("Car_Follow", "ES_Distance"), + ("Signal2", "ES_Distance"), + ("Brake_On", "ES_Distance"), + ("Distance_Swap", "ES_Distance"), + ("Standstill", "ES_Distance"), + ("Signal3", "ES_Distance"), + ("Close_Distance", "ES_Distance"), + ("Signal4", "ES_Distance"), + ("Standstill_2", "ES_Distance"), + ("Cruise_Fault", "ES_Distance"), + ("Signal5", "ES_Distance"), + ("Counter", "ES_Distance"), + ("Signal6", "ES_Distance"), + ("Cruise_Button", "ES_Distance"), + ("Signal7", "ES_Distance"), + ] + + checks = [ + ("ES_DashStatus", 20), + ("ES_Distance", 20), + ] + else: + signals = [ + ("Cruise_Set_Speed", "ES_DashStatus"), + ("Conventional_Cruise", "ES_DashStatus"), + + ("Counter", "ES_Distance"), + ("Signal1", "ES_Distance"), + ("Cruise_Fault", "ES_Distance"), + ("Cruise_Throttle", "ES_Distance"), + ("Signal2", "ES_Distance"), + ("Car_Follow", "ES_Distance"), + ("Signal3", "ES_Distance"), + ("Cruise_Brake_Active", "ES_Distance"), + ("Distance_Swap", "ES_Distance"), + ("Cruise_EPB", "ES_Distance"), + ("Signal4", "ES_Distance"), + ("Close_Distance", "ES_Distance"), + ("Signal5", "ES_Distance"), + ("Cruise_Cancel", "ES_Distance"), + ("Cruise_Set", "ES_Distance"), + ("Cruise_Resume", "ES_Distance"), + ("Signal6", "ES_Distance"), + + ("Counter", "ES_LKAS_State"), + ("LKAS_Alert_Msg", "ES_LKAS_State"), + ("Signal1", "ES_LKAS_State"), + ("LKAS_ACTIVE", "ES_LKAS_State"), + ("LKAS_Dash_State", "ES_LKAS_State"), + ("Signal2", "ES_LKAS_State"), + ("Backward_Speed_Limit_Menu", "ES_LKAS_State"), + ("LKAS_Left_Line_Enable", "ES_LKAS_State"), + ("LKAS_Left_Line_Light_Blink", "ES_LKAS_State"), + ("LKAS_Right_Line_Enable", "ES_LKAS_State"), + ("LKAS_Right_Line_Light_Blink", "ES_LKAS_State"), + ("LKAS_Left_Line_Visible", "ES_LKAS_State"), + ("LKAS_Right_Line_Visible", "ES_LKAS_State"), + ("LKAS_Alert", "ES_LKAS_State"), + ("Signal3", "ES_LKAS_State"), + ] + + checks = [ + ("ES_DashStatus", 10), + ("ES_Distance", 20), + ("ES_LKAS_State", 10), + ] + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 2) diff --git a/selfdrive/car/subaru/interface.py b/selfdrive/car/subaru/interface.py new file mode 100644 index 000000000..63e1d40d3 --- /dev/null +++ b/selfdrive/car/subaru/interface.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +from cereal import car +from selfdrive.car.subaru.values import CAR, PREGLOBAL_CARS +from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config +from selfdrive.car.interfaces import CarInterfaceBase + +class CarInterface(CarInterfaceBase): + + @staticmethod + def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None): + ret = CarInterfaceBase.get_std_params(candidate, fingerprint) + + ret.carName = "subaru" + ret.radarOffCan = True + + if candidate in PREGLOBAL_CARS: + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.subaruLegacy)] + ret.enableBsm = 0x25c in fingerprint[0] + else: + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.subaru)] + ret.enableBsm = 0x228 in fingerprint[0] + + ret.dashcamOnly = candidate in PREGLOBAL_CARS + + ret.steerRateCost = 0.7 + ret.steerLimitTimer = 0.4 + + if candidate == CAR.ASCENT: + ret.mass = 2031. + STD_CARGO_KG + ret.wheelbase = 2.89 + ret.centerToFront = ret.wheelbase * 0.5 + ret.steerRatio = 13.5 + ret.steerActuatorDelay = 0.3 # end-to-end angle controller + ret.lateralTuning.pid.kf = 0.00003 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0., 20.], [0., 20.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.0025, 0.1], [0.00025, 0.01]] + + if candidate == CAR.IMPREZA: + ret.mass = 1568. + STD_CARGO_KG + ret.wheelbase = 2.67 + ret.centerToFront = ret.wheelbase * 0.5 + ret.steerRatio = 15 + ret.steerActuatorDelay = 0.4 # end-to-end angle controller + ret.lateralTuning.pid.kf = 0.00005 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0., 20.], [0., 20.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2, 0.3], [0.02, 0.03]] + + if candidate == CAR.IMPREZA_2020: + ret.mass = 1480. + STD_CARGO_KG + ret.wheelbase = 2.67 + ret.centerToFront = ret.wheelbase * 0.5 + ret.steerRatio = 17 # learned, 14 stock + ret.steerActuatorDelay = 0.1 + ret.lateralTuning.pid.kf = 0.00005 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0., 14., 23.], [0., 14., 23.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.045, 0.042, 0.20], [0.04, 0.035, 0.045]] + + if candidate == CAR.FORESTER: + ret.mass = 1568. + STD_CARGO_KG + ret.wheelbase = 2.67 + ret.centerToFront = ret.wheelbase * 0.5 + ret.steerRatio = 17 # learned, 14 stock + ret.steerActuatorDelay = 0.1 + ret.lateralTuning.pid.kf = 0.000038 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0., 14., 23.], [0., 14., 23.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.01, 0.065, 0.2], [0.001, 0.015, 0.025]] + + if candidate in (CAR.FORESTER_PREGLOBAL, CAR.OUTBACK_PREGLOBAL_2018): + ret.safetyConfigs[0].safetyParam = 1 # Outback 2018-2019 and Forester have reversed driver torque signal + ret.mass = 1568 + STD_CARGO_KG + ret.wheelbase = 2.67 + ret.centerToFront = ret.wheelbase * 0.5 + ret.steerRatio = 20 # learned, 14 stock + ret.steerActuatorDelay = 0.1 + ret.lateralTuning.pid.kf = 0.000039 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0., 10., 20.], [0., 10., 20.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.01, 0.05, 0.2], [0.003, 0.018, 0.025]] + + if candidate == CAR.LEGACY_PREGLOBAL: + ret.mass = 1568 + STD_CARGO_KG + ret.wheelbase = 2.67 + ret.centerToFront = ret.wheelbase * 0.5 + ret.steerRatio = 12.5 # 14.5 stock + ret.steerActuatorDelay = 0.15 + ret.lateralTuning.pid.kf = 0.00005 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0., 20.], [0., 20.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.1, 0.2], [0.01, 0.02]] + + if candidate == CAR.OUTBACK_PREGLOBAL: + ret.mass = 1568 + STD_CARGO_KG + ret.wheelbase = 2.67 + ret.centerToFront = ret.wheelbase * 0.5 + ret.steerRatio = 20 # learned, 14 stock + ret.steerActuatorDelay = 0.1 + ret.lateralTuning.pid.kf = 0.000039 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0., 10., 20.], [0., 10., 20.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.01, 0.05, 0.2], [0.003, 0.018, 0.025]] + + # TODO: get actual value, for now starting with reasonable value for + # civic and scaling by mass and wheelbase + ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) + + # TODO: start from empirically derived lateral slip stiffness for the civic and scale by + # mass and CG position, so all cars will have approximately similar dyn behaviors + ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront) + + return ret + + # returns a car.CarState + def update(self, c, can_strings): + self.cp.update_strings(can_strings) + self.cp_cam.update_strings(can_strings) + + ret = self.CS.update(self.cp, self.cp_cam) + self.post_update(c,ret) + ret.canValid = self.cp.can_valid and self.cp_cam.can_valid + ret.steeringRateLimited = self.CC.steer_rate_limited if self.CC is not None else False + + ret.events = self.create_common_events(ret).to_msg() + + self.CS.out = ret.as_reader() + return self.CS.out + + def apply(self, c): + hud_control = c.hudControl + ret = self.CC.update(c, c.enabled, self.CS, self.frame, c.actuators, + c.cruiseControl.cancel, hud_control.visualAlert, + hud_control.leftLaneVisible, hud_control.rightLaneVisible, hud_control.leftLaneDepart, hud_control.rightLaneDepart) + self.frame += 1 + return ret diff --git a/selfdrive/car/subaru/radar_interface.py b/selfdrive/car/subaru/radar_interface.py new file mode 100644 index 000000000..b2f765113 --- /dev/null +++ b/selfdrive/car/subaru/radar_interface.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 +from selfdrive.car.interfaces import RadarInterfaceBase + +class RadarInterface(RadarInterfaceBase): + pass diff --git a/selfdrive/car/subaru/subarucan.py b/selfdrive/car/subaru/subarucan.py new file mode 100644 index 000000000..86ec5e8bd --- /dev/null +++ b/selfdrive/car/subaru/subarucan.py @@ -0,0 +1,90 @@ +import copy +from cereal import car + +VisualAlert = car.CarControl.HUDControl.VisualAlert + +def create_steering_control(packer, apply_steer, frame, steer_step): + + idx = (frame / steer_step) % 16 + + values = { + "Counter": idx, + "LKAS_Output": apply_steer, + "LKAS_Request": 1 if apply_steer != 0 else 0, + "SET_1": 1 + } + + return packer.make_can_msg("ES_LKAS", 0, values) + +def create_steering_status(packer, apply_steer, frame, steer_step): + return packer.make_can_msg("ES_LKAS_State", 0, {}) + +def create_es_distance(packer, es_distance_msg, pcm_cancel_cmd): + + values = copy.copy(es_distance_msg) + if pcm_cancel_cmd: + values["Cruise_Cancel"] = 1 + + return packer.make_can_msg("ES_Distance", 0, values) + +def create_es_lkas(packer, es_lkas_msg, enabled, visual_alert, left_line, right_line, left_lane_depart, right_lane_depart): + + values = copy.copy(es_lkas_msg) + + # Filter the stock LKAS "Keep hands on wheel" alert + if values["LKAS_Alert_Msg"] == 1: + values["LKAS_Alert_Msg"] = 0 + + # Filter the stock LKAS sending an audible alert when it turns off LKAS + if values["LKAS_Alert"] == 27: + values["LKAS_Alert"] = 0 + + # Show Keep hands on wheel alert for openpilot steerRequired alert + if visual_alert == VisualAlert.steerRequired: + values["LKAS_Alert_Msg"] = 1 + + # Ensure we don't overwrite potentially more important alerts from stock (e.g. FCW) + if visual_alert == VisualAlert.ldw and values["LKAS_Alert"] == 0: + if left_lane_depart: + values["LKAS_Alert"] = 12 # Left lane departure dash alert + elif right_lane_depart: + values["LKAS_Alert"] = 11 # Right lane departure dash alert + + if enabled: + values["LKAS_ACTIVE"] = 1 # Show LKAS lane lines + values["LKAS_Dash_State"] = 2 # Green enabled indicator + else: + values["LKAS_Dash_State"] = 0 # LKAS Not enabled + + values["LKAS_Left_Line_Visible"] = int(left_line) + values["LKAS_Right_Line_Visible"] = int(right_line) + + return packer.make_can_msg("ES_LKAS_State", 0, values) + +# *** Subaru Pre-global *** + +def subaru_preglobal_checksum(packer, values, addr): + dat = packer.make_can_msg(addr, 0, values)[2] + return (sum(dat[:7])) % 256 + +def create_preglobal_steering_control(packer, apply_steer, frame, steer_step): + + idx = (frame / steer_step) % 8 + + values = { + "Counter": idx, + "LKAS_Command": apply_steer, + "LKAS_Active": 1 if apply_steer != 0 else 0 + } + values["Checksum"] = subaru_preglobal_checksum(packer, values, "ES_LKAS") + + return packer.make_can_msg("ES_LKAS", 0, values) + +def create_preglobal_es_distance(packer, cruise_button, es_distance_msg): + + values = copy.copy(es_distance_msg) + values["Cruise_Button"] = cruise_button + + values["Checksum"] = subaru_preglobal_checksum(packer, values, "ES_Distance") + + return packer.make_can_msg("ES_Distance", 0, values) diff --git a/selfdrive/car/subaru/values.py b/selfdrive/car/subaru/values.py new file mode 100644 index 000000000..4e1745366 --- /dev/null +++ b/selfdrive/car/subaru/values.py @@ -0,0 +1,379 @@ +from selfdrive.car import dbc_dict +from cereal import car +Ecu = car.CarParams.Ecu + +class CarControllerParams: + def __init__(self, CP): + if CP.carFingerprint == CAR.IMPREZA_2020: + self.STEER_MAX = 1439 + else: + self.STEER_MAX = 2047 + self.STEER_STEP = 2 # how often we update the steer cmd + self.STEER_DELTA_UP = 50 # torque increase per refresh, 0.8s to max + self.STEER_DELTA_DOWN = 70 # torque decrease per refresh + self.STEER_DRIVER_ALLOWANCE = 60 # allowed driver torque before start limiting + self.STEER_DRIVER_MULTIPLIER = 10 # weight driver torque heavily + self.STEER_DRIVER_FACTOR = 1 # from dbc + +class CAR: + ASCENT = "SUBARU ASCENT LIMITED 2019" + IMPREZA = "SUBARU IMPREZA LIMITED 2019" + IMPREZA_2020 = "SUBARU IMPREZA SPORT 2020" + FORESTER = "SUBARU FORESTER 2019" + FORESTER_PREGLOBAL = "SUBARU FORESTER 2017 - 2018" + LEGACY_PREGLOBAL = "SUBARU LEGACY 2015 - 2018" + OUTBACK_PREGLOBAL = "SUBARU OUTBACK 2015 - 2017" + OUTBACK_PREGLOBAL_2018 = "SUBARU OUTBACK 2018 - 2019" + +FINGERPRINTS = { + CAR.IMPREZA: [{ + 2: 8, 64: 8, 65: 8, 72: 8, 73: 8, 280: 8, 281: 8, 290: 8, 312: 8, 313: 8, 314: 8, 315: 8, 316: 8, 326: 8, 372: 8, 544: 8, 545: 8, 546: 8, 552: 8, 554: 8, 557: 8, 576: 8, 577: 8, 722: 8, 801: 8, 802: 8, 805: 8, 808: 8, 811: 8, 816: 8, 826: 8, 827: 8, 837: 8, 838: 8, 839: 8, 842: 8, 912: 8, 915: 8, 940: 8, 1614: 8, 1617: 8, 1632: 8, 1650: 8, 1657: 8, 1658: 8, 1677: 8, 1697: 8, 1722: 8, 1743: 8, 1759: 8, 1786: 5, 1787: 5, 1788: 8, 1809: 8, 1813: 8, 1817: 8, 1821: 8, 1840: 8, 1848: 8, 1924: 8, 1932: 8, 1952: 8, 1960: 8 + }], + CAR.IMPREZA_2020: [{ + 2: 8, 64: 8, 65: 8, 72: 8, 73: 8, 280: 8, 281: 8, 282: 8, 290: 8, 312: 8, 313: 8, 314: 8, 315: 8, 316: 8, 326: 8, 372: 8, 544: 8, 545: 8, 546: 8, 552: 8, 554: 8, 557: 8, 576: 8, 577: 8, 722: 8, 801: 8, 802: 8, 803: 8, 805: 8, 808: 8, 816: 8, 826: 8, 837: 8, 838: 8, 839: 8, 842: 8, 912: 8, 915: 8, 940: 8, 1617: 8, 1632: 8, 1650: 8, 1677: 8, 1697: 8, 1722: 8, 1743: 8, 1759: 8, 1786: 5, 1787: 5, 1788: 8, 1809: 8, 1813: 8, 1817: 8, 1821: 8, 1840: 8, 1848: 8, 1924: 8, 1932: 8, 1952: 8, 1960: 8, 1968: 8, 1976: 8, 2015: 8, 2016: 8, 2024: 8 + }, + { + 2: 8, 64: 8, 65: 8, 72: 8, 73: 8, 280: 8, 281: 8, 282: 8, 290: 8, 312: 8, 313: 8, 314: 8, 315: 8, 316: 8, 326: 8, 544: 8, 545: 8, 546: 8, 554: 8, 557: 8, 576: 8, 577: 8, 801: 8, 802: 8, 803: 8, 805: 8, 808: 8, 816: 8, 826: 8, 837: 8, 838: 8, 839: 8, 842: 8, 912: 8, 915: 8, 940: 8, 1614: 8, 1617: 8, 1632: 8, 1657: 8, 1658: 8, 1677: 8, 1697: 8, 1743: 8, 1759: 8, 1786: 5, 1787: 5, 1788: 8, 1809: 8, 1813: 8, 1817: 8, 1821: 8, 1840: 8, 1848: 8, 1924: 8, 1932: 8, 1952: 8, 1960: 8 + }], + CAR.FORESTER: [{ + 2: 8, 64: 8, 65: 8, 72: 8, 73: 8, 280: 8, 281: 8, 282: 8, 290: 8, 312: 8, 313: 8, 314: 8, 315: 8, 316: 8, 326: 8, 372: 8, 544: 8, 545: 8, 546: 8, 552: 8, 554: 8, 557: 8, 576: 8, 577: 8, 722: 8, 801: 8, 802: 8, 803: 8, 805: 8, 808: 8, 811: 8, 816: 8, 826: 8, 837: 8, 838: 8, 839: 8, 842: 8, 912: 8, 915: 8, 940: 8, 961: 8, 984: 8, 1614: 8, 1617: 8, 1632: 8, 1650: 8, 1651: 8, 1657: 8, 1658: 8, 1677: 8, 1697: 8, 1698: 8, 1722: 8, 1743: 8, 1759: 8, 1787: 5, 1788: 8, 1809: 8, 1813: 8, 1817: 8, 1821: 8, 1840: 8, 1848: 8, 1924: 8, 1932: 8, 1952: 8, 1960: 8 + }], +} + +FW_VERSIONS = { + CAR.ASCENT: { + (Ecu.esp, 0x7b0, None): [ + b'\xa5 \x19\x02\x00', + b'\xa5 !\002\000', + b'\xf1\x82\xa5 \x19\x02\x00', + ], + (Ecu.eps, 0x746, None): [ + b'\x85\xc0\xd0\x00', + b'\005\xc0\xd0\000', + b'\x95\xc0\xd0\x00', + ], + (Ecu.fwdCamera, 0x787, None): [ + b'\x00\x00d\xb9\x1f@ \x10', + b'\000\000e~\037@ \'', + b'\x00\x00e@\x1f@ $', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xbb,\xa0t\a', + b'\xf1\x82\xbb,\xa0t\x87', + b'\xf1\x82\xbb,\xa0t\a', + b'\xf1\x82\xd9,\xa0@\a', + b'\xf1\x82\xd1,\xa0q\x07', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\x00\xfe\xf7\x00\x00', + b'\001\xfe\xf9\000\000', + b'\x01\xfe\xf7\x00\x00', + ], + }, + CAR.IMPREZA: { + (Ecu.esp, 0x7b0, None): [ + b'\x7a\x94\x3f\x90\x00', + b'\xa2 \x185\x00', + b'\xa2 \x193\x00', + b'z\x94.\x90\x00', + b'z\x94\b\x90\x01', + b'\xa2 \x19`\x00', + b'z\x94\f\x90\001', + b'z\x9c\x19\x80\x01', + b'z\x94\x08\x90\x00', + ], + (Ecu.eps, 0x746, None): [ + b'\x7a\xc0\x0c\x00', + b'z\xc0\b\x00', + b'\x8a\xc0\x00\x00', + b'z\xc0\x04\x00', + b'z\xc0\x00\x00', + b'\x8a\xc0\x10\x00', + ], + (Ecu.fwdCamera, 0x787, None): [ + b'\x00\x00\x64\xb5\x1f\x40\x20\x0e', + b'\x00\x00d\xdc\x1f@ \x0e', + b'\x00\x00e\x1c\x1f@ \x14', + b'\x00\x00d)\x1f@ \a', + b'\x00\x00e+\x1f@ \x14', + b'\000\000e+\000\000\000\000', + b'\000\000dd\037@ \016', + b'\000\000e\002\037@ \024', + b'\x00\x00d)\x00\x00\x00\x00', + b'\x00\x00c\xf4\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xaa\x61\x66\x73\x07', + b'\xbeacr\a', + b'\xc5!`r\a', + b'\xaa!ds\a', + b'\xaa!`u\a', + b'\xaa!dq\a', + b'\xaa!dt\a', + b'\xf1\x00\xa2\x10\t', + b'\xc5!ar\a', + b'\xbe!as\a', + b'\xc5!ds\a', + b'\xc5!`s\a', + b'\xaa!au\a', + b'\xbe!at\a', + b'\xaa\x00Bu\x07', + b'\xc5!dr\x07', + b'\xaa!aw\x07', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xe3\xe5\x46\x31\x00', + b'\xe4\xe5\x061\x00', + b'\xe5\xf5\x04\x00\x00', + b'\xe3\xf5G\x00\x00', + b'\xe3\xf5\a\x00\x00', + b'\xe3\xf5C\x00\x00', + b'\xe5\xf5B\x00\x00', + b'\xe5\xf5$\000\000', + b'\xe4\xf5\a\000\000', + b'\xe3\xf5F\000\000', + b'\xe4\xf5\002\000\000', + b'\xe3\xd0\x081\x00', + b'\xe3\xf5\x06\x00\x00', + ], + }, + CAR.IMPREZA_2020: { + (Ecu.esp, 0x7b0, None): [ + b'\xa2 \0314\000', + b'\xa2 \0313\000', + b'\xa2 !i\000', + b'\xa2 !`\000', + ], + (Ecu.eps, 0x746, None): [ + b'\x9a\xc0\000\000', + b'\n\xc0\004\000', + ], + (Ecu.fwdCamera, 0x787, None): [ + b'\000\000eb\037@ \"', + b'\000\000e\x8f\037@ )', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xca!ap\a', + b'\xca!`p\a', + b'\xca!`0\a', + b'\xcc\"f0\a', + b'\xcc!fp\a', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xe6\xf5\004\000\000', + b'\xe6\xf5$\000\000', + b'\xe7\xf6B0\000', + b'\xe7\xf5D0\000', + ], + }, + CAR.FORESTER: { + (Ecu.esp, 0x7b0, None): [ + b'\xa3 \030\024\000', + b'\xa3 \024\000', + b'\xa3 \031\024\000', + b'\xa3 \024\001', + ], + (Ecu.eps, 0x746, None): [ + b'\x8d\xc0\004\000', + ], + (Ecu.fwdCamera, 0x787, None): [ + b'\000\000e!\037@ \021', + b'\000\000e\x97\037@ 0', + b'\000\000e`\037@ ', + b'\xf1\x00\xac\x02\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xb6\"`A\a', + b'\xcf"`0\a', + b'\xcb\"`@\a', + b'\xcb\"`p\a', + b'\xf1\x00\xa2\x10\n', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\032\xf6B0\000', + b'\032\xf6F`\000', + b'\032\xf6b`\000', + b'\032\xf6B`\000', + b'\xf1\x00\xa4\x10@', + ], + }, + CAR.FORESTER_PREGLOBAL: { + (Ecu.esp, 0x7b0, None): [ + b'\x7d\x97\x14\x40', + b'\xf1\x00\xbb\x0c\x04', + ], + (Ecu.eps, 0x746, None): [ + b'}\xc0\x10\x00', + b'm\xc0\x10\x00', + ], + (Ecu.fwdCamera, 0x787, None): [ + b'\x00\x00\x64\x35\x1f\x40\x20\x09', + b'\x00\x00c\xe9\x1f@ \x03', + b'\x00\x00d\xd3\x1f@ \t' + ], + (Ecu.engine, 0x7e0, None): [ + b'\xba"@p\a', + b'\xa7)\xa0q\a', + b'\xf1\x82\xa7)\xa0q\a', + b'\xba"@@\a', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xdc\xf2\x60\x60\x00', + b'\xdc\xf2@`\x00', + b'\xda\xfd\xe0\x80\x00', + b'\xdc\xf2`\x81\000', + b'\xdc\xf2`\x80\x00', + ], + }, + CAR.LEGACY_PREGLOBAL: { + (Ecu.esp, 0x7b0, None): [ + b'k\x97D\x00', + b'[\xba\xc4\x03', + b'{\x97D\x00', + b'[\x97D\000', + ], + (Ecu.eps, 0x746, None): [ + b'[\xb0\x00\x01', + b'K\xb0\x00\x01', + b'k\xb0\x00\x00', + ], + (Ecu.fwdCamera, 0x787, None): [ + b'\x00\x00c\xb7\x1f@\x10\x16', + b'\x00\x00c\x94\x1f@\x10\x08', + b'\x00\x00c\xec\x1f@ \x04', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xab*@r\a', + b'\xa0+@p\x07', + b'\xb4"@0\x07', + b'\xa0"@q\a', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xbe\xf2\x00p\x00', + b'\xbf\xfb\xc0\x80\x00', + b'\xbd\xf2\x00`\x00', + b'\xbf\xf2\000\x80\000', + ], + }, + CAR.OUTBACK_PREGLOBAL: { + (Ecu.esp, 0x7b0, None): [ + b'{\x9a\xac\x00', + b'k\x97\xac\x00', + b'\x5b\xf7\xbc\x03', + b'[\xf7\xac\x03', + b'{\x97\xac\x00', + b'k\x9a\xac\000', + b'[\xba\xac\x03', + b'[\xf7\xac\000', + ], + (Ecu.eps, 0x746, None): [ + b'k\xb0\x00\x00', + b'[\xb0\x00\x00', + b'\x4b\xb0\x00\x02', + b'K\xb0\x00\x00', + b'{\xb0\x00\x01', + ], + (Ecu.fwdCamera, 0x787, None): [ + b'\x00\x00c\xec\x1f@ \x04', + b'\x00\x00c\xd1\x1f@\x10\x17', + b'\xf1\x00\xf0\xe0\x0e', + b'\x00\x00c\x94\x00\x00\x00\x00', + b'\x00\x00c\x94\x1f@\x10\b', + b'\x00\x00c\xb7\x1f@\x10\x16', + b'\000\000c\x90\037@\020\016', + b'\x00\x00c\xec\x37@\x04', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xb4+@p\a', + b'\xab\"@@\a', + b'\xa0\x62\x41\x71\x07', + b'\xa0*@q\a', + b'\xab*@@\a', + b'\xb4"@0\a', + b'\xb4"@p\a', + b'\xab"@s\a', + b'\xab+@@\a', + b'\xb4"@r\a', + b'\xa0+@@\x07', + b'\xa0\"@\x80\a', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xbd\xfb\xe0\x80\x00', + b'\xbe\xf2@\x80\x00', + b'\xbf\xe2\x40\x80\x00', + b'\xbf\xf2@\x80\x00', + b'\xbe\xf2@p\x00', + b'\xbd\xf2@`\x00', + b'\xbd\xf2@\x81\000', + b'\xbe\xfb\xe0p\000', + b'\xbf\xfb\xe0b\x00', + ], + }, + CAR.OUTBACK_PREGLOBAL_2018: { + (Ecu.esp, 0x7b0, None): [ + b'\x8b\x97\xac\x00', + b'\x8b\x9a\xac\x00', + b'\x9b\x97\xac\x00', + b'\x8b\x97\xbc\x00', + b'\x8b\x99\xac\x00', + b'\x9b\x9a\xac\000', + b'\x9b\x97\xbe\x10', + ], + (Ecu.eps, 0x746, None): [ + b'{\xb0\x00\x00', + b'{\xb0\x00\x01', + ], + (Ecu.fwdCamera, 0x787, None): [ + b'\x00\x00df\x1f@ \n', + b'\x00\x00d\xfe\x1f@ \x15', + b'\x00\x00d\x95\x00\x00\x00\x00', + b'\x00\x00d\x95\x1f@ \x0f', + b'\x00\x00d\xfe\x00\x00\x00\x00', + b'\x00\x00e\x19\x1f@ \x15', + ], + (Ecu.engine, 0x7e0, None): [ + b'\xb5"@p\a', + b'\xb5+@@\a', + b'\xb5"@P\a', + b'\xc4"@0\a', + b'\xb5b@1\x07', + b'\xb5q\xe0@\a', + b'\xc4+@0\a', + b'\xc4b@p\a', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xbc\xf2@\x81\x00', + b'\xbc\xfb\xe0\x80\x00', + b'\xbc\xf2@\x80\x00', + b'\xbb\xf2@`\x00', + b'\xbc\xe2@\x80\x00', + b'\xbc\xfb\xe0`\x00', + b'\xbc\xaf\xe0`\x00', + b'\xbb\xfb\xe0`\000', + ], + }, +} + +STEER_THRESHOLD = { + CAR.ASCENT: 80, + CAR.IMPREZA: 80, + CAR.IMPREZA_2020: 80, + CAR.FORESTER: 80, + CAR.FORESTER_PREGLOBAL: 75, + CAR.LEGACY_PREGLOBAL: 75, + CAR.OUTBACK_PREGLOBAL: 75, + CAR.OUTBACK_PREGLOBAL_2018: 75, +} + +DBC = { + CAR.ASCENT: dbc_dict('subaru_global_2017_generated', None), + CAR.IMPREZA: dbc_dict('subaru_global_2017_generated', None), + CAR.IMPREZA_2020: dbc_dict('subaru_global_2017_generated', None), + CAR.FORESTER: dbc_dict('subaru_global_2017_generated', None), + CAR.FORESTER_PREGLOBAL: dbc_dict('subaru_forester_2017_generated', None), + CAR.LEGACY_PREGLOBAL: dbc_dict('subaru_outback_2015_generated', None), + CAR.OUTBACK_PREGLOBAL: dbc_dict('subaru_outback_2015_generated', None), + CAR.OUTBACK_PREGLOBAL_2018: dbc_dict('subaru_outback_2019_generated', None), +} + +PREGLOBAL_CARS = [CAR.FORESTER_PREGLOBAL, CAR.LEGACY_PREGLOBAL, CAR.OUTBACK_PREGLOBAL, CAR.OUTBACK_PREGLOBAL_2018] diff --git a/selfdrive/car/tesla/ACC_module.py b/selfdrive/car/tesla/ACC_module.py new file mode 100644 index 000000000..a5623332a --- /dev/null +++ b/selfdrive/car/tesla/ACC_module.py @@ -0,0 +1,405 @@ +from selfdrive.car.tesla.speed_utils.fleet_speed import FleetSpeed +from selfdrive.car.tesla.values import CruiseButtons, CruiseState +from selfdrive.config import Conversions as CV +import cereal.messaging as messaging +import sys +import time +from cereal import car + +# CS.v_ego -> CS.out.vEgo +# CS.v_ego_raw -> CS.out.vEgoRaw +# CS.imperial_speed_units -> CS.speed_units == "MPH" +# CS.pcm_acc_status -> CS.cruise_state + + +class ACCState: + # Possible states of the ACC system, following the DI_cruiseState naming + # scheme. + OFF = 0 # Disabled by UI. + STANDBY = 1 # Ready to be enaged. + ENABLED = 2 # Engaged. + NOT_READY = 9 # Not ready to be engaged due to the state of the car. + + +class _Mode: + def __init__(self, label, autoresume, state, adaptive): + self.label = label + self.autoresume = autoresume + self.state = state + self.adaptive = adaptive + self.next = None + + +def _current_time_millis(): + return int(round(time.time() * 1000)) + + +class ACCController: + + # Tesla cruise only functions above 17 MPH + MIN_CRUISE_SPEED_MS = 17.1 * CV.MPH_TO_MS + + def __init__(self, longcontroller): + self.LongCtr = longcontroller + self.human_cruise_action_time = 0 + self.automated_cruise_action_time = 0 + self.radarState = messaging.sub_sock("radarState", conflate=True) + self.last_update_time = 0 + self.enable_adaptive_cruise = False + self.prev_enable_adaptive_cruise = False + # Whether to re-engage automatically after being paused due to low speed or + # user-initated deceleration. + self.autoresume = False + self.adaptive = False + self.last_brake_press_time = 0 + self.last_cruise_stalk_pull_time = 0 + self.prev_cruise_buttons = CruiseButtons.IDLE + self.prev_cruise_state = 0 + self.acc_speed_kph = 0.0 + self.speed_limit_kph = 0.0 + self.prev_speed_limit_kph = 0.0 + self.user_has_braked = False + self.has_gone_below_min_speed = False + self.fast_decel_time = 0 + self.lead_last_seen_time_ms = 0 + average_speed_over_x_suggestions = 20 # 1 second (20x a second) + self.fleet_speed = FleetSpeed(average_speed_over_x_suggestions) + + # Updates the internal state of this controller based on user input, + # specifically the steering wheel mounted cruise control stalk, and OpenPilot + # UI buttons. + def update_stat(self, CS, enabled): + # Check if the cruise stalk was double pulled, indicating that adaptive + # cruise control should be enabled. Twice in .75 seconds counts as a double + # pull. + self.prev_enable_adaptive_cruise = self.enable_adaptive_cruise + self.autoresume = CS.autoresumeAcc + curr_time_ms = _current_time_millis() + if not self.LongCtr.CP.openpilotLongitudinalControl: + return + # Handle pressing the enable button. + if ( + CS.cruise_buttons == CruiseButtons.MAIN + or ( + CS.cruise_buttons == CruiseButtons.DECEL_SET + and + not self.enable_adaptive_cruise + ) + + ) and self.prev_cruise_buttons != CS.cruise_buttons: + double_pull = curr_time_ms - self.last_cruise_stalk_pull_time < 750 + self.last_cruise_stalk_pull_time = curr_time_ms + ready = ( + ( + enabled + or + ( + CS.cruise_buttons == CruiseButtons.DECEL_SET + and + not self.enable_adaptive_cruise + ) + ) + and CruiseState.is_enabled_or_standby(CS.cruise_state) + and CS.out.vEgo > self.MIN_CRUISE_SPEED_MS + ) + if ( + ready + and double_pull + and ( + CS.cruise_buttons == CruiseButtons.MAIN + or + ( + CS.cruise_buttons == CruiseButtons.DECEL_SET + and + not self.enable_adaptive_cruise + ) + ) + ): + #decide adaptive or not + if CS.cruise_buttons == CruiseButtons.MAIN: + self.adaptive = True + else: + self.adaptive = False + # A double pull enables ACC. updating the max ACC speed if necessary. + if not self.enable_adaptive_cruise: + CS.longCtrlEvent = car.CarEvent.EventName.accEnabled + self.enable_adaptive_cruise = True + # Increase ACC speed to match current, if applicable. + if self.adaptive: + self.acc_speed_kph = max( + CS.out.vEgoRaw * CV.MS_TO_KPH, self.speed_limit_kph + ) + else: + self.acc_speed_kph = CS.out.vEgoRaw * CV.MS_TO_KPH + self.user_has_braked = False + self.has_gone_below_min_speed = False + else: + # A single pull disables ACC (falling back to just steering). + if CS.cruise_buttons == CruiseButtons.MAIN: + if self.enable_adaptive_cruise: + CS.longCtrlEvent = car.CarEvent.EventName.accDisabled + self.enable_adaptive_cruise = False + + # Handle pressing the cancel button. + if CS.cruise_buttons == CruiseButtons.CANCEL: + if self.enable_adaptive_cruise: + CS.longCtrlEvent = car.CarEvent.EventName.accDisabled + self.enable_adaptive_cruise = False + self.acc_speed_kph = 0.0 + self.last_cruise_stalk_pull_time = 0 + # Handle pressing up and down buttons. + elif ( + CS.cruise_buttons != CruiseButtons.MAIN + and self.enable_adaptive_cruise + and CS.cruise_buttons != self.prev_cruise_buttons + ): + self._update_max_acc_speed(CS) + + if CS.realBrakePressed: + self.user_has_braked = True + self.last_brake_press_time = _current_time_millis() + if not self.autoresume: + self.enable_adaptive_cruise = False + CS.longCtrlEvent = car.CarEvent.EventName.accDisabled + + if CS.out.vEgo < self.MIN_CRUISE_SPEED_MS: + self.has_gone_below_min_speed = True + + # If autoresume is not enabled and not in standard CC, disable if we hit the brakes or gone below 18mph + if not self.autoresume: + if ( + (self.adaptive and not enabled) + or self.user_has_braked + or self.has_gone_below_min_speed + ): + if self.enable_adaptive_cruise: + self.enable_adaptive_cruise = False + CS.longCtrlEvent = car.CarEvent.EventName.accDisabled + + # Update prev state after all other actions. + self.prev_cruise_buttons = CS.cruise_buttons + self.prev_cruise_state = CS.cruise_state + + def _update_max_acc_speed(self, CS): + # Adjust the max ACC speed based on user cruise stalk actions. + half_press_kph, full_press_kph = self._get_cc_units_kph(CS.speed_units == "MPH") + speed_change_map = { + CruiseButtons.RES_ACCEL: half_press_kph, + CruiseButtons.RES_ACCEL_2ND: full_press_kph, + CruiseButtons.DECEL_SET: -1 * half_press_kph, + CruiseButtons.DECEL_2ND: -1 * full_press_kph, + } + self.acc_speed_kph += speed_change_map.get(CS.cruise_buttons, 0) + + # Clip ACC speed between 0 and 170 KPH. + self.acc_speed_kph = min(self.acc_speed_kph, 170) + self.acc_speed_kph = max(self.acc_speed_kph, 0) + + # Decide which cruise control buttons to simluate to get the car to the desired speed. + def update_acc( + self, + enabled, + CS, + frame, + actuators, + pcm_speed, + speed_limit_kph, + set_speed_limit_active, + speed_limit_offset, + ): + # Adaptive cruise control + self.prev_speed_limit_kph = self.speed_limit_kph + if set_speed_limit_active and speed_limit_kph > 0: + self.speed_limit_kph = speed_limit_kph + speed_limit_offset + if int(self.prev_speed_limit_kph) != int(self.speed_limit_kph): + self.acc_speed_kph = self.speed_limit_kph + self.fleet_speed.reset_averager() + else: # reset internal speed limit, so double pull doesn't set higher speed than current (e.g. after leaving the highway) + self.speed_limit_kph = 0.0 + current_time_ms = _current_time_millis() + if CruiseButtons.should_be_throttled(CS.cruise_buttons): + self.human_cruise_action_time = current_time_ms + button_to_press = None + + # If ACC is disabled, disengage traditional cruise control. + if ( + (self.prev_enable_adaptive_cruise) + and (not self.enable_adaptive_cruise) + and (CS.cruise_state == CruiseState.ENABLED) + ): + button_to_press = CruiseButtons.CANCEL + + # if non addaptive and we just engaged ACC but pcm is not engaged, then engage + if ( + (not self.adaptive) + and self.enable_adaptive_cruise + and (CS.cruise_state != CruiseState.ENABLED) + ): + button_to_press = CruiseButtons.MAIN + + # if plain cc, not adaptive, then just return None or Cancel + if (not self.adaptive): + self.acc_speed_kph = ( + CS.v_cruise_actual + ) + return button_to_press + + # disengage if cruise is canceled + if ( + (not self.enable_adaptive_cruise) + and (CS.cruise_state >= 2) + and (CS.cruise_state <= 4) + ): + return CruiseButtons.CANCEL + lead_1 = None + # if enabled: + lead = messaging.recv_one_or_none(self.radarState) + if lead is not None: + lead_1 = lead.radarState.leadOne + if lead_1.dRel: + self.lead_last_seen_time_ms = current_time_ms + if self.enable_adaptive_cruise and enabled and pcm_speed is not None: + button_to_press = self._calc_button(CS, pcm_speed) + if button_to_press: + self.automated_cruise_action_time = current_time_ms + # If trying to slow below the min cruise speed, just cancel cruise. + # This prevents a SCCM crash which is triggered by repeatedly pressing + # stalk-down when already at min cruise speed. + if ( + CruiseButtons.is_decel(button_to_press) + and CS.v_cruise_actual - 1 < self.MIN_CRUISE_SPEED_MS * CV.MS_TO_KPH + ): + button_to_press = CruiseButtons.CANCEL + if button_to_press == CruiseButtons.CANCEL: + self.fast_decel_time = current_time_ms + # Debug logging (disable in production to reduce latency of commands) + # print "***ACC command: %s***" % button_to_press + return button_to_press + + def _should_autoengage_cc(self, CS, lead_car=None): + # Automatically (re)engage cruise control so long as + # 1) The carstate allows cruise control + # 2) There is no imminent threat of collision + # 3) The user did not cancel ACC by pressing the brake + cruise_ready = ( + self.enable_adaptive_cruise + and CS.cruise_state == CruiseState.STANDBY + and CS.out.vEgo >= self.MIN_CRUISE_SPEED_MS + and _current_time_millis() > self.fast_decel_time + 2000 + ) + + slow_lead = ( + lead_car + and lead_car.dRel > 0 + and lead_car.vRel < 0 + or self._fast_decel_required(CS, lead_car) + ) # pylint: disable=chained-comparison + + # "Autoresume" mode allows cruise to engage even after brake events, but + # shouldn't trigger DURING braking. + autoresume_ready = ( + self.autoresume + and CS.out.aEgo >= 0.1 + and not CS.HSO.human_control + and _current_time_millis() > self.last_brake_press_time + 1000 + ) + + braked = self.user_has_braked or self.has_gone_below_min_speed + + return cruise_ready and not slow_lead and (autoresume_ready or not braked) + + def _fast_decel_required(self, CS, lead_car): + """ Identifies situations which call for rapid deceleration. """ + if not lead_car or not lead_car.dRel: + return False + + collision_imminent = self._seconds_to_collision(CS, lead_car) < 4 + + lead_absolute_speed_ms = lead_car.vRel + CS.out.vEgo + lead_too_slow = lead_absolute_speed_ms < self.MIN_CRUISE_SPEED_MS + + return collision_imminent or lead_too_slow + + def _seconds_to_collision(self, CS, lead_car): + if not lead_car or not lead_car.dRel: + return sys.maxsize + elif lead_car.vRel >= 0: + return sys.maxsize + return abs(float(lead_car.dRel) / lead_car.vRel) + + def _get_cc_units_kph(self, is_imperial_units): + # Cruise control buttons behave differently depending on whether the car + # is configured for metric or imperial units. + if is_imperial_units: + # Imperial unit cars adjust cruise in units of 1 and 5 mph. + half_press_kph = 1 * CV.MPH_TO_KPH + full_press_kph = 5 * CV.MPH_TO_KPH + else: + # Metric cars adjust cruise in units of 1 and 5 kph. + half_press_kph = 1 + full_press_kph = 5 + return half_press_kph, full_press_kph + + # Adjust speed based off OP's longitudinal model. + def _calc_button(self, CS, desired_speed_ms): + button_to_press = None + # Automatically engange traditional cruise if appropriate. + if self._should_autoengage_cc(CS) and desired_speed_ms >= CS.out.vEgo: + button_to_press = CruiseButtons.RES_ACCEL + # If traditional cruise is engaged, then control it. + elif ( + CS.cruise_state == CruiseState.ENABLED + # But don't make adjustments if a human has manually done so in + # the last 3 seconds. Human intention should not be overridden. + and self._no_human_action_for(milliseconds=3000) + and self._no_automated_action_for(milliseconds=400) + ): + # The difference between OP's target speed and the current cruise + # control speed, in KPH. + speed_offset_kph = desired_speed_ms * CV.MS_TO_KPH - CS.v_cruise_actual + + half_press_kph, full_press_kph = self._get_cc_units_kph( + CS.speed_units == "MPH" + ) + + # Reduce cruise speed significantly if necessary. Multiply by a % to + # make the car slightly more eager to slow down vs speed up. + if desired_speed_ms < self.MIN_CRUISE_SPEED_MS: + button_to_press = CruiseButtons.CANCEL + if speed_offset_kph < -2 * full_press_kph and CS.v_cruise_actual > 0: + button_to_press = CruiseButtons.CANCEL + elif speed_offset_kph < -0.6 * full_press_kph and CS.v_cruise_actual > 0: + # Send cruise stalk dn_2nd. + button_to_press = CruiseButtons.DECEL_2ND + # Reduce speed slightly if necessary. + elif speed_offset_kph < -0.9 * half_press_kph and CS.v_cruise_actual > 0: + # Send cruise stalk dn_1st. + button_to_press = CruiseButtons.DECEL_SET + # Increase cruise speed if possible. + elif CS.out.vEgo > self.MIN_CRUISE_SPEED_MS: + # How much we can accelerate without exceeding max allowed speed. + available_speed_kph = self.acc_speed_kph - CS.v_cruise_actual + if ( + speed_offset_kph >= full_press_kph + and full_press_kph < available_speed_kph + ): + # Send cruise stalk up_2nd. + button_to_press = CruiseButtons.RES_ACCEL_2ND + elif ( + speed_offset_kph >= half_press_kph + and half_press_kph < available_speed_kph + ): + # Send cruise stalk up_1st. + button_to_press = CruiseButtons.RES_ACCEL + return button_to_press + + def _no_human_action_for(self, milliseconds): + return _current_time_millis() > self.human_cruise_action_time + milliseconds + + def _no_automated_action_for(self, milliseconds): + return _current_time_millis() > self.automated_cruise_action_time + milliseconds + + def _no_action_for(self, milliseconds): + return self._no_human_action_for( + milliseconds + ) and self._no_automated_action_for(milliseconds) diff --git a/selfdrive/car/tesla/HUD_module.py b/selfdrive/car/tesla/HUD_module.py new file mode 100644 index 000000000..fb67403b6 --- /dev/null +++ b/selfdrive/car/tesla/HUD_module.py @@ -0,0 +1,259 @@ +from common.numpy_fast import clip +from selfdrive.car.tesla.values import CAR, CAN_CHASSIS +from cereal import car +from selfdrive.config import Conversions as CV +import numpy as np + +IC_LANE_SCALE = 0.5 + +VisualAlert = car.CarControl.HUDControl.VisualAlert +AudibleAlert = car.CarControl.HUDControl.AudibleAlert + +class HUDController: + + def __init__(self, CP, packer, tesla_can): + self.CP = CP + self.packer = packer + self.tesla_can = tesla_can + + self.IC_integration_counter = 0 + self.IC_integration_warning_counter = 0 + self.IC_previous_enabled = False + self.leftLaneQuality = 0 + self.rightLaneQuality = 0 + + + # to show lead car on IC + def showLeadCarOnICCanMessage(self, leadsData, curv0): + lead_1 = leadsData.leadOne + lead_2 = leadsData.leadTwo + if (lead_1 is not None) and lead_1.status: + self.leadDx = clip(lead_1.dRel,0,126) + self.leadDy = clip(curv0 - lead_1.yRel,-22.05,22.4) + self.leadId = 1 + self.leadClass = 2 + self.leadVx = clip(int(lead_1.vRel),-30,26) + else: + self.leadDx = 0 + self.leadDy = 0.0 + self.leadClass = 0 + self.leadId = 0 + self.leadVx = 0 + if (lead_2 is not None) and lead_2.status: + self.lead2Dx = clip(lead_2.dRel,0,126) + self.lead2Dy = clip(curv0 - lead_2.yRel,-22.05,22.4) + self.lead2Id = 2 + self.lead2Class = 2 + self.lead2Vx = clip(int(lead_2.vRel),-30,26) + else: + self.lead2Dx = 0 + self.lead2Dy = 0.0 + self.lead2Class = 0 + self.lead2Id = 0 + self.lead2Vx = 0 + return self.tesla_can.create_lead_car_object_message( + 0, #lead vehicle + self.leadClass, + self.leadId, + 0, #relevant1 + self.leadDx, + self.leadVx, + self.leadDy, + self.lead2Class, + self.lead2Id, + 0, #relevant2 + self.lead2Dx, + self.lead2Vx, + self.lead2Dy, + CAN_CHASSIS[self.CP.carFingerprint], + ) + + def update(self, enabled, CS, frame, actuators, cruise_cancel, hud_alert, audible_alert, + left_line, right_line, lead, left_lane_depart, right_lane_depart,human_control,radar_state,lat_plan,apply_angle,model_data): + # TODO: additional lanes to show on IC + self.IC_integration_counter = ((self.IC_integration_counter + 2) % 100) + + if self.IC_integration_warning_counter > 0: + self.IC_integration_warning_counter = self.IC_integration_warning_counter - 1 + messages = [] + + if lat_plan is not None: + #let's get the path points and compute poly coef + pts = np.array(lat_plan.lateralPlan.dPathPoints) + x = np.arange(0, len(pts)) + order = 3 + coefs = np.polyfit(x, pts, order) + # IC shows the path 2x scaled + f = IC_LANE_SCALE + suppress_x_coord = True + f2 = f * f + f3 = f2 * f + CS.curvC0 = -clip(coefs[3], -3.5, 3.5) + CS.curvC1 = -clip(coefs[2] * f * (0 if suppress_x_coord else 1), -0.2, 0.2) + CS.curvC2 = -clip(coefs[1] * f2, -0.0025, 0.0025) + CS.curvC3 = -clip(coefs[0] * f3, -0.00003, 0.00003) + CS.laneWidth = lat_plan.lateralPlan.laneWidth + CS.lProb = lat_plan.lateralPlan.lProb + CS.rProb = lat_plan.lateralPlan.rProb + if CS.lProb > 0.45: + CS.lLine = 1 + else: + CS.lLine = 0 + if CS.rProb > 0.45: + CS.rLine = 1 + else: + CS.rLine = 0 + if model_data is not None: + self.leftLaneQuality = 1 if model_data.modelV2.laneLineProbs[0] > 0.25 else 0 + self.rightLaneQuality = 1 if model_data.modelV2.laneLineProbs[3] > 0.25 else 0 + + #send messages for IC intergration + #CS.DAS_206_apUnavailable = 1 if enabled and human_control else 0 + #CS.DAS_220_lcTempUnavailableRoad = 1 if enabled and human_control else 0 + warnings = CS.DAS_gas_to_resume + \ + CS.DAS_025_steeringOverride + \ + CS.DAS_202_noisyEnvironment + \ + CS.DAS_206_apUnavailable + \ + CS.DAS_207_lkasUnavailable + \ + CS.DAS_208_rackDetected + \ + CS.DAS_211_accNoSeatBelt + \ + CS.DAS_216_driverOverriding + \ + CS.DAS_219_lcTempUnavailableSpeed + \ + CS.DAS_220_lcTempUnavailableRoad + \ + CS.DAS_221_lcAborting + \ + CS.DAS_222_accCameraBlind + \ + CS.stopSignWarning + \ + CS.stopLightWarning + \ + CS.DAS_canErrors + \ + CS.DAS_notInDrive + if (warnings > 0) and (self.IC_integration_warning_counter == 0): + self.IC_integration_warning_counter = 200 # alert for 2 sconds + if (self.IC_integration_warning_counter == 0) or (not enabled): + # when zero reset all warnings + CS.DAS_gas_to_resume = 0 + CS.DAS_025_steeringOverride = 0 #use for manual steer? + CS.DAS_202_noisyEnvironment = 0 #use for planner error? + CS.DAS_206_apUnavailable = 0 #Ap disabled from CID + CS.DAS_207_lkasUnavailable = 0 #use for manual not in drive? + CS.DAS_208_rackDetected = 0 #use for low battery? + CS.DAS_211_accNoSeatBelt = 0 + CS.DAS_216_driverOverriding = 0 + CS.DAS_219_lcTempUnavailableSpeed = 0 + CS.DAS_220_lcTempUnavailableRoad = 0 + CS.DAS_221_lcAborting = 0 + CS.DAS_222_accCameraBlind = 0 #we will see what we can use this for + CS.stopSignWarning = 0 + CS.stopLightWarning = 0 + CS.DAS_canErrors = 0 + CS.DAS_notInDrive = 0 + + if (enabled or self.IC_previous_enabled or self.CP.carFingerprint == CAR.PREAP_MODELS) and (self.IC_integration_counter % 10 == 0): + + # send DAS_bodyControls + if (self.IC_integration_counter in [20,70]) or (self.IC_previous_enabled and not enabled): + messages.append(self.tesla_can.create_body_controls_message( + CS.alca_direction, 1 if CS.needs_hazard else 0 , CAN_CHASSIS[self.CP.carFingerprint], 1)) + #if no ic integration we stop here + if not CS.enableICIntegration: + return messages + + messages.append(self.tesla_can.create_lane_message(CS.laneWidth, 1 if CS.alca_engaged else CS.rLine, 1 if CS.alca_engaged else CS.lLine, + 50, CS.curvC0, CS.curvC1, CS.curvC2, CS.curvC3, self.leftLaneQuality, self.rightLaneQuality, + CAN_CHASSIS[self.CP.carFingerprint], 1)) + + if radar_state is not None: + leadsData = radar_state.radarState + if leadsData is not None: + #pass + messages.append(self.showLeadCarOnICCanMessage(leadsData=leadsData,curv0=CS.curvC0)) + + # send DAS_warningMatrix0 at 1Hz + if (self.IC_integration_counter == 10) or (self.IC_previous_enabled and not enabled): + messages.append(self.tesla_can.create_das_warningMatrix0(CS.DAS_canErrors, CS.DAS_025_steeringOverride, CS.DAS_notInDrive, CAN_CHASSIS[self.CP.carFingerprint])) + + # send DAS_warningMatrix1 at 1Hz + if (self.IC_integration_counter == 20) or (self.IC_previous_enabled and not enabled): + messages.append(self.tesla_can.create_das_warningMatrix1(CAN_CHASSIS[self.CP.carFingerprint])) + + # send DAS_warningMatrix3 at 1Hz + if (self.IC_integration_counter == 30) or (self.IC_previous_enabled and not enabled): + messages.append(self.tesla_can.create_das_warningMatrix3 (CS.DAS_gas_to_resume, CS.DAS_211_accNoSeatBelt, CS.DAS_202_noisyEnvironment, CS.DAS_206_apUnavailable, CS.DAS_207_lkasUnavailable, + CS.DAS_219_lcTempUnavailableSpeed, CS.DAS_220_lcTempUnavailableRoad, CS.DAS_221_lcAborting, CS.DAS_222_accCameraBlind, + CS.DAS_208_rackDetected, CS.DAS_216_driverOverriding, CS.stopSignWarning, CS.stopLightWarning, CAN_CHASSIS[self.CP.carFingerprint])) + + # send DAS_status and DAS_status2 at 2Hz + DAS_ldwStatus = 1 if left_lane_depart or right_lane_depart else 0 + DAS_hands_on_state = 2 + #steering required is also used by ALCA + if (hud_alert == VisualAlert.steerRequired) and not (CS.alca_engaged or CS.alca_pre_engage): + if audible_alert == AudibleAlert.none: + DAS_hands_on_state = 3 + else: + DAS_hands_on_state = 5 + #if manual steering overright we will flash the light at the top of IC + if enabled and human_control: + DAS_hands_on_state = 5 + DAS_collision_warning = 1 if hud_alert == VisualAlert.fcw else 0 + #alcaState 1 if nothing, 8+direction if enabled + DAS_alca_state = 8 + CS.alca_direction if (CS.alca_pre_engage or CS.alca_engaged) and CS.alca_direction > 0 else 1 + #ap status 0-Disabled 1-Unavailable 2-Available 3-Active_nominal, + # 4-active_restricted 5-active_nav 8-aborting 9-aborted + # 14-fault 15-SNA + DAS_op_status = 5 if enabled else 2 + if (self.IC_integration_counter %20 == 0) or (self.IC_previous_enabled and not enabled ): + messages.append(self.tesla_can.create_das_status(DAS_op_status, DAS_collision_warning, + DAS_ldwStatus, DAS_hands_on_state, DAS_alca_state, + CS.out.leftBlindspot, CS.out.rightBlindspot, + CS.DAS_fusedSpeedLimit, CS.fleet_speed_state, CAN_CHASSIS[self.CP.carFingerprint], 1)) + messages.append(self.tesla_can.create_das_status2(CS.out.cruiseState.speed * CV.MS_TO_MPH, + DAS_collision_warning, CAN_CHASSIS[self.CP.carFingerprint], 1)) + self.IC_previous_enabled = enabled + + #send message for TB if preAP + if (self.CP.carFingerprint == CAR.PREAP_MODELS) and (self.IC_integration_counter %10 == 0): + speed_uom_kph = 1.0 + if CS.speed_units == "MPH": + speed_uom_kph = CV.KPH_TO_MPH + v_cruise_pcm = max(0.0, CS.out.vEgo * CV.MS_TO_KPH) * speed_uom_kph + if CS.cruiseEnabled: + v_cruise_pcm = max(0.0, CS.out.cruiseState.speed * CV.MS_TO_KPH) * speed_uom_kph + DAS_control_speed = v_cruise_pcm + if CS.carNotInDrive: + DAS_control_speed = 350.0/3.6 + messages.append( + self.tesla_can.create_ap1_long_control( + not CS.carNotInDrive, + not CS.adaptive_cruise, + CS.cc_state > 1, + DAS_control_speed, + [-1.4000000000000004,1.8000000000000007], + [-0.46000000000000085,0.47600000000000003], + CAN_CHASSIS[self.CP.carFingerprint], + 1 + ) + ) + messages.append( + self.tesla_can.create_fake_DAS_msg( + CS.speed_control_enabled, + CS.DAS_216_driverOverriding, + CS.DAS_206_apUnavailable, + DAS_collision_warning, + DAS_op_status, + max(0.0, CS.out.cruiseState.speed * CV.MS_TO_KPH),# + CS.tap_direction, + DAS_collision_warning, + CS.adaptive_cruise, + DAS_hands_on_state, + CS.cc_state, + 1 if CS.pcc_available else 0, + DAS_alca_state, + v_cruise_pcm, + CS.DAS_fusedSpeedLimit, + apply_angle, + 1 if enabled else 0, + 0, #park_brake_request + CAN_CHASSIS[self.CP.carFingerprint], + ) + ) + + return messages diff --git a/selfdrive/car/tesla/LONG_module.py b/selfdrive/car/tesla/LONG_module.py new file mode 100644 index 000000000..d2ff58c1b --- /dev/null +++ b/selfdrive/car/tesla/LONG_module.py @@ -0,0 +1,202 @@ +from selfdrive.car.tesla.values import CAR, CAN_CHASSIS, CAN_POWERTRAIN, CruiseState +from selfdrive.car.tesla.ACC_module import ACCController +from selfdrive.car.tesla.PCC_module import PCCController +from selfdrive.config import Conversions as CV +from selfdrive.car.modules.CFG_module import load_bool_param,load_float_param + +def _is_present(lead): + return bool((not (lead is None)) and (lead.dRel > 0)) + +class LONGController: + + def __init__(self,CP,packer, tesla_can, pedalcan): + self.CP = CP + self.v_target = None + self.a_target = None + self.j_target = None + self.lead_1 = None + self.long_control_counter = 1 + self.tesla_can = tesla_can + self.packer = packer + self.pedalcan = pedalcan + self.enablePedal = load_bool_param("TinklaEnablePedal",False) + self.has_ibooster_ecu = False + self.apply_brake = 0.0 + self.speed_limit_offset_uom = 0 + self.speed_limit_offset_ms = 0.0 + self.adjustSpeedWithSpeedLimit = load_bool_param("TinklaAdjustAccWithSpeedLimit",True) + if (CP.carFingerprint == CAR.PREAP_MODELS): + self.ACC = ACCController(self) + self.PCC = PCCController(self,tesla_can,pedalcan) + self.speed_limit_ms = 0 + self.set_speed_limit_active = False + self.speed_limit_offset_uom = load_float_param("TinklaSpeedLimitOffset",0.0) + + def update(self, enabled, CS, frame, actuators, cruise_cancel,pcm_speed,pcm_override, long_plan,radar_state): + messages = [] + self.has_ibooster_ecu = CS.has_ibooster_ecu + + if frame % 10 == 0: + self.speed_limit_ms = CS.speed_limit_ms + self.set_speed_limit_active = self.adjustSpeedWithSpeedLimit if self.speed_limit_ms > 0 else False + + if frame % 100 == 0: + if self.CP.carFingerprint != CAR.PREAP_MODELS: + self.speed_limit_offset_ms = CS.userSpeedLimitOffsetMS + else: + if load_bool_param("TinklaSpeedLimitUseRelative",False): + self.speed_limit_offset_ms = self.speed_limit_offset_uom * self.speed_limit_ms / 100.0 + else: + if CS.speed_units == "KPH": + self.speed_limit_offset_ms = self.speed_limit_offset_uom* CV.KPH_TO_MS + elif CS.speed_units == "MPH": + self.speed_limit_offset_ms = self.speed_limit_offset_uom* CV.MPH_TO_MS + + + #if not openpilot long control just exit + if not self.CP.openpilotLongitudinalControl: + return messages + #preAP ModelS + if self.CP.carFingerprint == CAR.PREAP_MODELS: + # update PCC module info + pedal_can_sends = self.PCC.update_stat(CS, frame) + if len(pedal_can_sends) > 0: + messages.extend(pedal_can_sends) + if self.PCC.pcc_available: + self.ACC.enable_adaptive_cruise = False + else: + # Update ACC module info. + self.ACC.update_stat(CS, True) + self.PCC.enable_pedal_cruise = False + # update CS.v_cruise_pcm based on module selected. + speed_uom_kph = 1.0 + # cruise state: 0 unavailable, 1 available, 2 enabled, 3 hold + if CS.carNotInDrive: + CS.cc_state = 0 + else: + CS.cc_state = 1 + CS.speed_control_enabled = 0 + if enabled: + if CS.speed_units == "MPH": + speed_uom_kph = CV.KPH_TO_MPH + if self.ACC.enable_adaptive_cruise: + CS.acc_speed_kph = self.ACC.acc_speed_kph + elif self.PCC.enable_pedal_cruise: + CS.acc_speed_kph = self.PCC.pedal_speed_kph + else: + CS.acc_speed_kph = max(0.0, CS.out.vEgo * CV.MS_TO_KPH) + CS.v_cruise_pcm = CS.acc_speed_kph * speed_uom_kph + if (self.PCC.pcc_available and self.PCC.enable_pedal_cruise) or ( + self.ACC.enable_adaptive_cruise + ): + CS.speed_control_enabled = 1 + CS.cc_state = 2 + if not self.ACC.adaptive: + CS.cc_state = 3 #find other values we can use + else: + if CS.cruise_state == CruiseState.OVERRIDE: # state #4 + CS.cc_state = 3 + CS.adaptive_cruise = ( + 1 + if (not self.PCC.pcc_available and self.ACC.adaptive) + or self.PCC.pcc_available + else 0 + ) + CS.pcc_available = self.PCC.pcc_available + + if long_plan and long_plan.longitudinalPlan: + self.v_target = long_plan.longitudinalPlan.speeds[-1] + if (not self.PCC.pcc_available) and frame % 20 == 0: # acc processed at 5Hz + cruise_btn = self.ACC.update_acc( + enabled, + CS, + frame, + actuators, + self.v_target, + self.speed_limit_ms * CV.MS_TO_KPH, + self.set_speed_limit_active, + self.speed_limit_offset_ms * CV.MS_TO_KPH, + ) + if cruise_btn: + # insert the message first since it is racing against messages from the real stalk + stlk_counter = ((CS.msg_stw_actn_req['MC_STW_ACTN_RQ'] + 1) % 16) + messages.insert(0, self.tesla_can.create_action_request( + msg_stw_actn_req=CS.msg_stw_actn_req, + button_to_press=cruise_btn, + bus=CAN_CHASSIS[self.CP.carFingerprint], + counter=stlk_counter)) + apply_accel = 0.0 + if self.PCC.pcc_available and frame % 5 == 0: # pedal processed at 20Hz + v_target = 0 + if long_plan is not None: + v_target = long_plan.longitudinalPlan.speeds[0] + self.apply_brake = 0.0 + apply_accel, self.apply_brake, accel_needed, accel_idx = self.PCC.update_pdl( + enabled, + CS, + frame, + actuators, + v_target, + pcm_override, + self.speed_limit_ms, + self.set_speed_limit_active, + self.speed_limit_offset_ms, + CS.alca_engaged, + radar_state + ) + if (accel_needed > -1) and (accel_idx > -1): + messages.append( + self.tesla_can.create_pedal_command_msg( + apply_accel, int(accel_needed), accel_idx, self.pedalcan + ) + ) + + if self.PCC.pcc_available and self.has_ibooster_ecu: + messages.append( + self.tesla_can.create_ibst_command( + enabled, self.apply_brake, frame, CAN_CHASSIS[self.CP.carFingerprint] + ) + ) + + #TODO: update message sent in HUD + + #AP ModelS with OP Long and enabled + elif enabled and self.CP.openpilotLongitudinalControl and (frame %2 == 0) and (self.CP.carFingerprint in [CAR.AP1_MODELS,CAR.AP2_MODELS]): + #we use the same logic from planner here to get the speed + + if radar_state is not None: + self.lead_1 = radar_state.radarState.leadOne + if long_plan is not None: + self.v_target = long_plan.longitudinalPlan.speeds[0] # to try vs vTarget + self.a_target = abs(long_plan.longitudinalPlan.accels[0]) # to try vs aTarget + self.j_target = abs(long_plan.longitudinalPlan.jerks[0]) + if self.v_target is None: + self.v_target = CS.out.vEgo + self.a_target = 1 + self.j_target = 1 + + #following = False + #TODO: see what works best for these + tesla_accel_limits = [-2*self.a_target,self.a_target] + tesla_jerk_limits = [-4*self.a_target,2*self.a_target] + #if _is_present(self.lead_1): + # following = self.lead_1.status and self.lead_1.dRel < 45.0 and self.lead_1.vLeadK > CS.out.vEgo and self.lead_1.aLeadK > 0.0 + + #we now create the DAS_control for AP1 or DAS_longControl for AP2 + if self.CP.carFingerprint == CAR.AP2_MODELS: + messages.append(self.tesla_can.create_ap2_long_control(self.v_target, tesla_accel_limits, tesla_jerk_limits, CAN_POWERTRAIN[self.CP.carFingerprint], self.long_control_counter)) + if self.CP.carFingerprint == CAR.AP1_MODELS: + messages.append(self.tesla_can.create_ap1_long_control(not CS.carNotInDrive, True, True ,self.v_target, tesla_accel_limits, tesla_jerk_limits, CAN_POWERTRAIN[self.CP.carFingerprint], self.long_control_counter)) + + #AP ModelS with OP Long and not enabled + elif (not enabled) and self.CP.openpilotLongitudinalControl and (frame %2 == 0) and (self.CP.carFingerprint in [CAR.AP1_MODELS,CAR.AP2_MODELS]): + #send this values so we can enable at 0 km/h + tesla_accel_limits = [-1.4000000000000004,1.8000000000000007] + tesla_jerk_limits = [-0.46000000000000085,0.47600000000000003] + if self.CP.carFingerprint == CAR.AP2_MODELS: + messages.append(self.tesla_can.create_ap2_long_control(350.0/3.6, tesla_accel_limits, tesla_jerk_limits, CAN_POWERTRAIN[self.CP.carFingerprint], self.long_control_counter)) + if self.CP.carFingerprint == CAR.AP1_MODELS: + messages.append(self.tesla_can.create_ap1_long_control(not CS.carNotInDrive, False, False , 350.0/3.6, tesla_accel_limits, tesla_jerk_limits, CAN_POWERTRAIN[self.CP.carFingerprint], self.long_control_counter)) + + return messages + diff --git a/selfdrive/car/tesla/PCC_module.py b/selfdrive/car/tesla/PCC_module.py new file mode 100644 index 000000000..a009ea2dc --- /dev/null +++ b/selfdrive/car/tesla/PCC_module.py @@ -0,0 +1,340 @@ +from selfdrive.car.tesla.speed_utils.fleet_speed import FleetSpeed +from common.numpy_fast import clip, interp +from selfdrive.car.tesla.values import CruiseState, CruiseButtons +from selfdrive.config import Conversions as CV +import time +from common.params import Params +from cereal import car + +ACCEL_MAX = 0.6 #0.6m/s2 * 36 = ~ 0 -> 50mph in 6 seconds +ACCEL_MIN = -3.5 + +_DT = 0.05 # 20Hz in our case, since we don't want to process more than once the same radarState message +_DT_MPC = _DT + +# TODO: these should end up in values.py at some point, probably variable by trim +# Accel limits +MAX_RADAR_DISTANCE = 120.0 # max distance to take in consideration radar reading +MAX_PEDAL_VALUE_AVG = 100 +MAX_PEDAL_REGEN_VALUE = 0.0 +MAX_BRAKE_VALUE = 1 #ibooster fully pressed BBTODO determine the exact value we need +PEDAL_HYST_GAP = ( + 1.0 # don't change pedal command for small oscilalitons within this value +) +# Cap the pedal to go from 0 to max in 3 seconds +PEDAL_MAX_UP = MAX_PEDAL_VALUE_AVG * _DT / 3 +# Cap the pedal to go from max to 0 in 0.4 seconds +PEDAL_MAX_DOWN = MAX_PEDAL_VALUE_AVG * _DT / 0.4 + +# BBTODO: move the vehicle variables; maybe make them speed variable +TORQUE_LEVEL_ACC = 0.0 +TORQUE_LEVEL_DECEL = -30.0 + +MIN_PCC_V_KPH = 0.0 # +MAX_PCC_V_KPH = 270.0 + +# Pull the cruise stalk twice in this many ms for a 'double pull' +STALK_DOUBLE_PULL_MS = 750 + +class PCCState: + # Possible state of the PCC system, following the DI_cruiseState naming scheme. + OFF = 0 # Disabled by UI (effectively never happens since button switches over to ACC mode). + STANDBY = 1 # Ready to be engaged. + ENABLED = 2 # Engaged. + NOT_READY = 9 # Not ready to be engaged due to the state of the car. + + +def _current_time_millis(): + return int(round(time.time() * 1000)) + + +# this is for the pedal cruise control +class PCCController: + def __init__(self, longcontroller,tesla_can,pedalcan): + self.LongCtr = longcontroller + self.tesla_can = tesla_can + self.human_cruise_action_time = 0 + self.pcc_available = self.prev_pcc_available = False + self.pedal_timeout_frame = 0 + self.accelerator_pedal_pressed = self.prev_accelerator_pedal_pressed = False + self.automated_cruise_action_time = 0 + self.last_angle = 0.0 + self.lead_1 = None + self.last_update_time = 0 + self.enable_pedal_cruise = False + self.stalk_pull_time_ms = 0 + self.prev_stalk_pull_time_ms = -1000 + self.prev_cruise_state = 0 + self.prev_cruise_buttons = CruiseButtons.IDLE + self.pedal_speed_kph = 0.0 + self.speed_limit_kph = 0.0 + self.prev_speed_limit_kph = 0.0 + self.pedal_idx = 0 + self.pedal_steady = 0.0 + self.prev_tesla_accel = 0.0 + self.prev_tesla_pedal = 0.0 + self.prev_tesla_brake = 0.0 + self.torqueLevel_last = 0.0 + self.prev_v_ego = 0.0 + self.PedalForZeroTorque = ( + 18.0 # starting number for a S85, adjusts down automatically + ) + self.lastTorqueForPedalForZeroTorque = TORQUE_LEVEL_DECEL + self.v_pid = 0.0 + self.a_pid = 0.0 + self.last_output_gb = 0.0 + self.last_speed_kph = None + # for smoothing the changes in speed + self.v_acc_start = 0.0 + self.a_acc_start = 0.0 + self.v_acc = 0.0 + self.v_acc_sol = 0.0 + self.v_acc_future = 0.0 + self.a_acc = 0.0 + self.a_acc_sol = 0.0 + self.v_cruise = 0.0 + self.a_cruise = 0.0 + + # when was radar data last updated? + self.lead_last_seen_time_ms = 0 + self.continuous_lead_sightings = 0 + self.params = Params() + average_speed_over_x_suggestions = 6 # 0.3 seconds (20x a second) + self.fleet_speed = FleetSpeed(average_speed_over_x_suggestions) + self.pedalcan = pedalcan + + def update_stat(self, CS, frame): + if not self.LongCtr.CP.openpilotLongitudinalControl: + return [] + + if not self.LongCtr.enablePedal: + return [] + + self._update_pedal_state(CS, frame) + + can_sends = [] + if not self.pcc_available: + timed_out = frame >= self.pedal_timeout_frame + if timed_out or CS.pedal_interceptor_state > 0: + if frame % 50 == 0: + # send reset command + idx = self.pedal_idx + self.pedal_idx = (self.pedal_idx + 1) % 16 + can_sends.append( + self.tesla_can.create_pedal_command_msg(0, 0, idx, self.pedalcan) + ) + return can_sends + + prev_enable_pedal_cruise = self.enable_pedal_cruise + # disable on brake + if CS.realBrakePressed and self.enable_pedal_cruise: + CS.longCtrlEvent = car.CarEvent.EventName.pccDisabled + self.enable_pedal_cruise = False + + # process any stalk movement + curr_time_ms = _current_time_millis() + speed_uom_kph = 1.0 + if CS.speed_units == "MPH": + speed_uom_kph = CV.MPH_TO_KPH + if ( + CS.cruise_buttons == CruiseButtons.MAIN + and self.prev_cruise_buttons != CruiseButtons.MAIN + ): + self.prev_stalk_pull_time_ms = self.stalk_pull_time_ms + self.stalk_pull_time_ms = curr_time_ms + double_pull = ( + self.stalk_pull_time_ms - self.prev_stalk_pull_time_ms + < STALK_DOUBLE_PULL_MS + ) + ready = ( + (CruiseState.is_off(CS.cruise_state)) + or CS.enablePedal + ) + if ready and double_pull: + # A double pull enables ACC. updating the max ACC speed if necessary. + if not self.enable_pedal_cruise: + CS.longCtrlEvent = car.CarEvent.EventName.pccEnabled + self.enable_pedal_cruise = True + # Increase PCC speed to match current, if applicable. + # We round the target speed in the user's units of measurement to avoid jumpy speed readings + current_speed_kph_uom_rounded = ( + int(CS.out.vEgo * CV.MS_TO_KPH / speed_uom_kph + 0.5) * speed_uom_kph + ) + self.pedal_speed_kph = max( + current_speed_kph_uom_rounded, self.speed_limit_kph + ) + # Handle pressing the cancel button. + elif CS.cruise_buttons == CruiseButtons.CANCEL: + if self.enable_pedal_cruise: + CS.longCtrlEvent = car.CarEvent.EventName.pccDisabled + self.enable_pedal_cruise = False + self.pedal_speed_kph = 0.0 + self.stalk_pull_time_ms = 0 + self.prev_stalk_pull_time_ms = -1000 + # Handle pressing up and down buttons. + elif self.enable_pedal_cruise and CS.cruise_buttons != self.prev_cruise_buttons: + # Real stalk command while PCC is already enabled. Adjust the max PCC speed if necessary. + # We round the target speed in the user's units of measurement to avoid jumpy speed readings + actual_speed_kph_uom_rounded = ( + int(CS.out.vEgo * CV.MS_TO_KPH / speed_uom_kph + 0.5) * speed_uom_kph + ) + if CS.cruise_buttons == CruiseButtons.RES_ACCEL: + self.pedal_speed_kph = ( + max(self.pedal_speed_kph, actual_speed_kph_uom_rounded) + + speed_uom_kph + ) + elif CS.cruise_buttons == CruiseButtons.RES_ACCEL_2ND: + self.pedal_speed_kph = ( + max(self.pedal_speed_kph, actual_speed_kph_uom_rounded) + + 5 * speed_uom_kph + ) + elif CS.cruise_buttons == CruiseButtons.DECEL_SET: + self.pedal_speed_kph = self.pedal_speed_kph - speed_uom_kph + elif CS.cruise_buttons == CruiseButtons.DECEL_2ND: + self.pedal_speed_kph = self.pedal_speed_kph - 5 * speed_uom_kph + # Clip PCC speed between 0 and 170 KPH. + self.pedal_speed_kph = clip( + self.pedal_speed_kph, MIN_PCC_V_KPH, MAX_PCC_V_KPH + ) + # If something disabled cruise control, disable PCC too + elif self.enable_pedal_cruise and CS.cruise_state and not CS.enablePedal: + self.enable_pedal_cruise = False + CS.longCtrlEvent = car.CarEvent.EventName.pccDisabled + # A single pull disables PCC (falling back to just steering). Wait some time + # in case a double pull comes along. + elif ( + self.enable_pedal_cruise + and curr_time_ms - self.stalk_pull_time_ms > STALK_DOUBLE_PULL_MS + and self.stalk_pull_time_ms - self.prev_stalk_pull_time_ms + > STALK_DOUBLE_PULL_MS + ): + self.enable_pedal_cruise = False + CS.longCtrlEvent = car.CarEvent.EventName.pccDisabled + + # Notify if PCC was toggled + if prev_enable_pedal_cruise and not self.enable_pedal_cruise: + self.fleet_speed.reset_averager() + + # Update prev state after all other actions. + self.prev_cruise_buttons = CS.cruise_buttons + self.prev_cruise_state = CS.cruise_state + + return can_sends + + def update_pdl( + self, + enabled, + CS, + frame, + actuators, + v_target, + pcm_override, + speed_limit_ms, + set_speed_limit_active, + speed_limit_offset, + alca_enabled, + radSt + ): + + if not self.LongCtr.CP.openpilotLongitudinalControl: + return 0.0, 0.0, -1, -1 + + if not self.LongCtr.enablePedal: + return 0.0, 0.0, -1, -1 + + idx = self.pedal_idx + + self.prev_speed_limit_kph = self.speed_limit_kph + + ###################################################################################### + # Determine pedal "zero" + # + # save position for cruising (zero acc, zero brake, no torque) when we are above 10 MPH + ###################################################################################### + if ( + CS.torqueLevel < TORQUE_LEVEL_ACC + and CS.torqueLevel > TORQUE_LEVEL_DECEL + and CS.out.vEgo >= 10.0 * CV.MPH_TO_MS + and abs(CS.torqueLevel) < abs(self.lastTorqueForPedalForZeroTorque) + ): + self.PedalForZeroTorque = self.prev_tesla_pedal + self.lastTorqueForPedalForZeroTorque = CS.torqueLevel + # print ("Detected new Pedal For Zero Torque at %s" % (self.PedalForZeroTorque)) + # print ("Torque level at detection %s" % (CS.torqueLevel)) + # print ("Speed level at detection %s" % (CS.out.vEgo * CV.MS_TO_MPH)) + + if set_speed_limit_active and speed_limit_ms > 0: + self.speed_limit_kph = (speed_limit_ms + speed_limit_offset) * CV.MS_TO_KPH + if int(self.prev_speed_limit_kph) != int(self.speed_limit_kph): + self.pedal_speed_kph = self.speed_limit_kph + # reset MovingAverage for fleet speed when speed limit changes + self.fleet_speed.reset_averager() + else: # reset internal speed limit, so double pull doesn't set higher speed than current (e.g. after leaving the highway) + self.speed_limit_kph = 0.0 + self.pedal_idx = (self.pedal_idx + 1) % 16 + + if not self.pcc_available or not enabled: + return 0.0, 0.0, 0, idx + + ############################################################## + # This mode uses the longitudinal MPC built in OP + # + # we use the values from actuators.accel + ############################################################## + ZERO_ACCEL = self.PedalForZeroTorque + REGEN_DECEL = -0.5 #BB needs to be calculated based on regen available + if CS.out.vEgo < 5 * CV.MPH_TO_MS: + ZERO_ACCEL = 0 + MAX_PEDAL_BP = [0., 5., 20., 30., 40] + MAX_PEDAL_V = [65. , 75., 85., 100., 120.] + MAX_PEDAL_VALUE = interp(CS.out.vEgo, MAX_PEDAL_BP, MAX_PEDAL_V) + ACCEL_LOOKUP_BP = [REGEN_DECEL, 0., ACCEL_MAX] + ACCEL_LOOKUP_V = [MAX_PEDAL_REGEN_VALUE, ZERO_ACCEL, MAX_PEDAL_VALUE] + + BRAKE_LOOKUP_BP = [ACCEL_MIN, REGEN_DECEL] + BRAKE_LOOKUP_V = [MAX_BRAKE_VALUE, 0.] + + enable_pedal = 1.0 if self.enable_pedal_cruise else 0.0 + tesla_pedal = int(round(interp(actuators.accel/2, ACCEL_LOOKUP_BP, ACCEL_LOOKUP_V))) + tesla_pedal = self.pedal_hysteresis(tesla_pedal, enable_pedal) + if CS.out.vEgo < 0.1 and actuators.accel < 0.01: + #hold brake pressed at when standstill + #BBTODO: show HOLD indicator in IC with integration + tesla_brake = 0.26 + else: + tesla_brake = interp(actuators.accel, BRAKE_LOOKUP_BP, BRAKE_LOOKUP_V) + + if CS.has_ibooster_ecu and CS.brakeUnavailable: + CS.longCtrlEvent = car.CarEvent.EventName.iBoosterBrakeNotOk + #since they don't use the compute_gb anymore divide by 3 + #tesla_pedal = tesla_pedal / 2.0 + tesla_pedal = clip(tesla_pedal, self.prev_tesla_pedal - PEDAL_MAX_DOWN, self.prev_tesla_pedal + PEDAL_MAX_UP) + self.prev_tesla_brake = tesla_brake * enable_pedal + self.torqueLevel_last = CS.torqueLevel + self.prev_tesla_pedal = tesla_pedal * enable_pedal + self.prev_v_ego = CS.out.vEgo + return self.prev_tesla_pedal, self.prev_tesla_brake, enable_pedal, idx + + def pedal_hysteresis(self, pedal, enabled): + # for small accel oscillations within PEDAL_HYST_GAP, don't change the command + if not enabled: + # send 0 when disabled, otherwise acc faults + self.pedal_steady = 0.0 + elif pedal > self.pedal_steady + PEDAL_HYST_GAP: + self.pedal_steady = pedal - PEDAL_HYST_GAP + elif pedal < self.pedal_steady - PEDAL_HYST_GAP: + self.pedal_steady = pedal + PEDAL_HYST_GAP + return self.pedal_steady + + def _update_pedal_state(self, CS, frame): + if CS.pedal_idx != CS.prev_pedal_idx: + # time out pedal after 500ms without receiving a new CAN message from it + self.pedal_timeout_frame = frame + 50 + self.prev_pcc_available = self.pcc_available + pedal_ready = ( + frame < self.pedal_timeout_frame and CS.pedal_interceptor_state == 0 + ) + #acc_disabled = CS.enablePedal or CruiseState.is_off(CS.cruise_state) + # Mark pedal unavailable while traditional cruise is on. + self.pcc_available = pedal_ready and self.LongCtr.enablePedal + diff --git a/selfdrive/car/tesla/__init__.py b/selfdrive/car/tesla/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/tesla/carcontroller.py b/selfdrive/car/tesla/carcontroller.py new file mode 100644 index 000000000..5b8e2fccf --- /dev/null +++ b/selfdrive/car/tesla/carcontroller.py @@ -0,0 +1,118 @@ +from selfdrive.car.tesla.teslacan import TeslaCAN + +from selfdrive.car.tesla.HUD_module import HUDController +from selfdrive.car.tesla.LONG_module import LONGController +from selfdrive.car.modules.CFG_module import load_bool_param +from opendbc.can.packer import CANPacker +from selfdrive.car.tesla.values import DBC, CAR, CarControllerParams, CAN_RADAR, CAN_CHASSIS, CAN_AUTOPILOT, CAN_EPAS, CruiseButtons +import cereal.messaging as messaging +from common.numpy_fast import clip, interp + + +class CarController(): + def __init__(self, dbc_name, CP, VM): + self.CP = CP + self.last_angle = 0 + self.packer = CANPacker(dbc_name) + self.pt_packer = None + if DBC[CP.carFingerprint]['pt']: + self.pt_packer = CANPacker(DBC[CP.carFingerprint]['pt']) + self.tesla_can = TeslaCAN(dbc_name, self.packer, self.pt_packer) + self.prev_das_steeringControl_counter = -1 + self.long_control_counter = 0 + + #initialize modules + + self.hud_controller = HUDController(CP,self.packer,self.tesla_can) + pedalcan = 2 + if load_bool_param("TinklaPedalCanZero", False): + pedalcan = 0 + self.long_controller = LONGController(CP,self.packer,self.tesla_can,pedalcan) + + + self.cruiseDelayFrame = 0 + self.prevCruiseEnabled = False + + self.lP = messaging.sub_sock('longitudinalPlan') + self.rS = messaging.sub_sock('radarState') + self.mD = messaging.sub_sock('modelV2') + + self.long_control_counter = 0 + + + #def update(self, c, enabled, CS, frame, actuators, cruise_cancel): + def update(self, c, enabled, CS, frame, actuators, cruise_cancel, pcm_speed, pcm_override, hud_alert, audible_alert, + left_line, right_line, lead, left_lane_depart, right_lane_depart): + if frame % 100 == 0: + CS.autoresumeAcc = load_bool_param("TinklaAutoResumeACC",False) + can_sends = [] + #add 1 second delay logic to wait for AP which has a status at 2Hz + if self.CP.carFingerprint != CAR.PREAP_MODELS: + if CS.cruiseEnabled: + if not self.prevCruiseEnabled: + self.cruiseDelayFrame = frame + if frame - self.cruiseDelayFrame > 30: + CS.cruiseDelay = True + else: + self.cruiseDelayFrame = 0 + CS.cruiseDelay = False + self.prevCruiseEnabled = CS.cruiseEnabled + + #receive socks + long_plan = messaging.recv_one_or_none(self.lP) + radar_state = messaging.recv_one_or_none(self.rS) + model_data = messaging.recv_one_or_none(self.mD) + + if not enabled: + self.v_target = CS.out.vEgo + self.a_target = 1 + + # Cancel when openpilot is not enabled anymore and no autopilot + # BB: do we need to do this? AP/Tesla does not behave this way + # LKAS can be disabled by steering and ACC remains engaged + #TODO: we need more logic arround this for AP0 + if not enabled and bool(CS.out.cruiseState.enabled) and not CS.enableHumanLongControl: + cruise_cancel = True + + if ((frame % 10) == 0 and cruise_cancel): + stlk_counter = ((CS.msg_stw_actn_req['MC_STW_ACTN_RQ'] + 1) % 16) + can_sends.insert(0,self.tesla_can.create_action_request(CS.msg_stw_actn_req, CruiseButtons.CANCEL, CAN_CHASSIS[self.CP.carFingerprint],stlk_counter)) + if (self.CP.carFingerprint in [CAR.AP1_MODELS,CAR.AP2_MODELS]): + can_sends.insert(1,self.tesla_can.create_action_request(CS.msg_stw_actn_req, CruiseButtons.CANCEL, CAN_AUTOPILOT[self.CP.carFingerprint],stlk_counter)) + + #now process controls + if enabled and not CS.human_control: + apply_angle = actuators.steeringAngleDeg + + # Angular rate limit based on speed + steer_up = (self.last_angle * apply_angle > 0. and abs(apply_angle) > abs(self.last_angle)) + rate_limit = CarControllerParams.RATE_LIMIT_UP if steer_up else CarControllerParams.RATE_LIMIT_DOWN + max_angle_diff = interp(CS.out.vEgo, rate_limit.speed_points, rate_limit.max_angle_diff_points) + apply_angle = clip(apply_angle, (self.last_angle - max_angle_diff), (self.last_angle + max_angle_diff)) + + # To not fault the EPS + apply_angle = clip(apply_angle, (CS.out.steeringAngleDeg - 20), (CS.out.steeringAngleDeg + 20)) + else: + apply_angle = CS.out.steeringAngleDeg + + self.last_angle = apply_angle + + if enabled or (self.CP.carFingerprint == CAR.PREAP_MODELS): + can_sends.append(self.tesla_can.create_steering_control(apply_angle, enabled and not CS.human_control and not CS.out.cruiseState.standstill, CAN_EPAS[self.CP.carFingerprint], 1)) + + + #update LONG Control module + can_messages = self.long_controller.update(enabled, CS, frame, actuators, cruise_cancel,pcm_speed,pcm_override, long_plan,radar_state) + if len(can_messages) > 0: + can_sends[0:0] = can_messages + + #update HUD Integration module + can_messages = self.hud_controller.update(enabled, CS, frame, actuators, cruise_cancel, hud_alert, audible_alert, + left_line, right_line, lead, left_lane_depart, right_lane_depart,CS.human_control,radar_state,CS.lat_plan,apply_angle,model_data) + if len(can_messages) > 0: + can_sends.extend(can_messages) + + new_actuators = actuators.copy() + new_actuators.steeringAngleDeg = apply_angle + + return new_actuators, can_sends diff --git a/selfdrive/car/tesla/carstate.py b/selfdrive/car/tesla/carstate.py new file mode 100644 index 000000000..a3e10b93d --- /dev/null +++ b/selfdrive/car/tesla/carstate.py @@ -0,0 +1,564 @@ +import copy +from cereal import car +from selfdrive.car.tesla.values import DBC, GEAR_MAP, DOORS, BUTTONS, CAR, CruiseButtons +from selfdrive.car.interfaces import CarStateBase +from opendbc.can.parser import CANParser +from opendbc.can.can_define import CANDefine +from selfdrive.config import Conversions as CV +from selfdrive.car.modules.CFG_module import load_bool_param + +#tesla uses various tires, this is for now for the 245/45R19s or 245/35ZR21s and they are 27.8" diameter = 0.353m +#TODOBB: sometimes tesla on the rear has 265/35ZR21 and they are 28.3" diameter 0.359m +#for now OP does not allow for various uom per tire ... to look into it +WHEEL_RADIUS = 0.353 + +class CarState(CarStateBase): + def __init__(self, CP): + super().__init__(CP) + self.CP = CP + self.button_states = {button.event_type: False for button in BUTTONS} + self.can_define = CANDefine(DBC[CP.carFingerprint]['chassis']) + + self.hands_on_level = 0 + self.steer_warning = None + self.acc_state = 0 + + # Needed by carcontroller + self.msg_stw_actn_req = None + + self.das_steeringControl_counter = -1 + self.das_status_counter = -1 + self.autopilot_enabled = False + + #to control hazard lighgts + self.needs_hazard = False + + #path info + self.laneWidth = 0 + self.lProb = 0. + self.rProb = 0. + self.curvC0 = 0. + self.curvC1 = 0. + self.curvC2 = 0. + self.curvC3 = 0. + self.laneToLeft = 0 + self.laneToRight = 0 + self.lLine = 0 + self.rLine = 0 + + self.acc_speed_kph = 0. + + #IC integration + self.DAS_gas_to_resume = 0 + self.DAS_025_steeringOverride = 0 #use for manual steer? + self.DAS_202_noisyEnvironment = 0 #use for planner error? + self.DAS_206_apUnavailable = 0 #Ap disabled from CID + self.DAS_207_lkasUnavailable = 0 #use for manual not in drive? + self.DAS_208_rackDetected = 0 #use for low battery? + self.DAS_211_accNoSeatBelt = 0 + self.DAS_216_driverOverriding = 0 + self.DAS_219_lcTempUnavailableSpeed = 0 + self.DAS_220_lcTempUnavailableRoad = 0 + self.DAS_221_lcAborting = 0 + self.DAS_222_accCameraBlind = 0 #we will see what we can use this for + self.stopSignWarning = 0 + self.stopLightWarning = 0 + self.DAS_canErrors = 0 + self.DAS_notInDrive = 0 + self.DAS_fusedSpeedLimit = 0 + self.baseMapSpeedLimitMPS = 0 + self.fleet_speed_state = 0 + + self.cruiseEnabled = False + self.cruiseDelay = False + self.carNotInDrive = True + + self.speed_units = "MPH" + self.tap_direction = 0 + + self.op_lkas_enabled = False + + #preAP long + self.speed_control_enabled = 0 + self.cc_state = 1 + self.adaptive_cruise = 0 + self.apFollowTimeInS = 2.5 # time in seconds to follow + self.pcc_available = False + self.torqueLevel = 0.0 + self.cruise_state = None + self.enableHumanLongControl = load_bool_param("TinklaAllowHumanLong", False) + self.enableICIntegration = load_bool_param("TinklaHasIcIntegration", False) + self.pedalcanzero = load_bool_param("TinklaPedalCanZero",False) + self.has_ibooster_ecu = load_bool_param("TinklaHasIBooster",False) + self.brakeUnavailable = True + self.realBrakePressed = False + self.userSpeedLimitOffsetMS = 0 + + + #pedal interceptor variables + self.pedal_idx = self.prev_pedal_idx = 0 + self.prev_pedal_interceptor_state = self.pedal_interceptor_state = 0 + self.pedal_interceptor_value = 0.0 + self.pedal_interceptor_value2 = 0.0 + self.teslaModel = "S" + + def _convert_to_DAS_fusedSpeedLimit(self, speed_limit_uom, speed_limit_type): + if speed_limit_uom > 0: + if speed_limit_type == 0x1E: # Autobahn with no speed limit + return 0x1F * 5 # no speed limit sign + return int(speed_limit_uom + 0.5) + else: + if speed_limit_type == 0x1F: # SNA (parking lot, no public road, etc.) + return 0 # no sign or show 35 for debug + return 5 # show 5 kph/mph for unknown limit where we should have one + + def update(self, cp, cp_cam): + ret = car.CarState.new_message() + + # Vehicle speed + ret.vEgoRaw = cp.vl["ESP_B"]["ESP_vehicleSpeed"] * CV.KPH_TO_MS + ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) + ret.standstill = (ret.vEgo < 0.1) + + ret.wheelSpeeds = self.get_wheel_speeds( + cp.vl["ESP_B"]["ESP_wheelPulseCountFrL"], + cp.vl["ESP_B"]["ESP_wheelPulseCountFrR"], + cp.vl["ESP_B"]["ESP_wheelPulseCountReL"], + cp.vl["ESP_B"]["ESP_wheelPulseCountReR"], + unit=WHEEL_RADIUS, + ) + + # Gas pedal + ret.gas = cp.vl["DI_torque1"]["DI_pedalPos"] / 100.0 + ret.gasPressed = (ret.gas > 0) + if self.enableHAO: + self.DAS_216_driverOverriding = 1 if (ret.gas > 0) else 0 + ret.gas = 0 + ret.gasPressed = False + + # Brake pedal + ret.brake = 0 + if self.has_ibooster_ecu: + self.realBrakePressed = bool(cp.vl["ECU_BrakeStatus"]['DriverBrakeApplied']) + ret.brakeLights = bool(cp.vl["ECU_BrakeStatus"]['BrakeApplied']) + self.brakeUnavailable = not bool(cp.vl["ECU_BrakeStatus"]['BrakeOK']) + else: + self.realBrakePressed = bool(cp.vl["BrakeMessage"]["driverBrakeStatus"] != 1) + ret.brakePressed = self.realBrakePressed + # Steering wheel + + self.steer_warning = self.can_define.dv["EPAS_sysStatus"]["EPAS_eacErrorCode"].get(int(cp.vl["EPAS_sysStatus"]["EPAS_eacErrorCode"]), None) + steer_status = self.can_define.dv["EPAS_sysStatus"]["EPAS_eacStatus"].get(int(cp.vl["EPAS_sysStatus"]["EPAS_eacStatus"]), None) + ret.steeringAngleDeg = -cp.vl["EPAS_sysStatus"]["EPAS_internalSAS"] + ret.steeringTorque = -cp.vl["EPAS_sysStatus"]["EPAS_torsionBarTorque"] + + ret.steeringRateDeg = -cp.vl["STW_ANGLHP_STAT"]["StW_AnglHP_Spd"] # This is from a different angle sensor, and at different rate + self.hands_on_level = cp.vl["EPAS_sysStatus"]["EPAS_handsOnLevel"] + ret.steeringPressed = (self.hands_on_level > 0) + ret.steerError = steer_status == "EAC_FAULT" + ret.steerWarning = self.steer_warning != "EAC_ERROR_IDLE" + self.torqueLevel = cp.vl["DI_torque1"]["DI_torqueMotor"] + + # Cruise state + #cruise_state = self.can_define.dv["DI_state"]["DI_cruiseState"].get(int(cp.vl["DI_state"]["DI_cruiseState"]), None) + #speed_units = self.can_define.dv["DI_state"]["DI_speedUnits"].get(int(cp.vl["DI_state"]["DI_speedUnits"]), None) + #acc_enabled = (cruise_state in ("ENABLED", "STANDSTILL", "OVERRIDE", "PRE_FAULT", "PRE_CANCEL")) + #ret.cruiseState.enabled = acc_enabled + #if speed_units == "KPH": + # ret.cruiseState.speed = cp.vl["DI_state"]["DI_digitalSpeed"] * CV.KPH_TO_MS + #elif speed_units == "MPH": + # ret.cruiseState.speed = cp.vl["DI_state"]["DI_digitalSpeed"] * CV.MPH_TO_MS + #ret.cruiseState.available = ((cruise_state == "STANDBY") or ret.cruiseState.enabled) + #et.cruiseState.standstill = False # This needs to be false, since we can resume from stop without sending anything special + + + autopilot_status = None + if (not self.CP.carFingerprint == CAR.PREAP_MODELS): + autopilot_status = self.can_define.dv["DAS_status"]["DAS_autopilotState"].get(int(cp_cam.vl["DAS_status"]["DAS_autopilotState"]), None) + autopark_status = None + eac_status = None + if (not self.CP.carFingerprint == CAR.PREAP_MODELS): + eac_status = self.can_define.dv["DAS_pscControl"]["DAS_eacState"].get(int(cp_cam.vl["DAS_pscControl"]["DAS_eacState"]), None) + autopark_status = self.can_define.dv["DAS_pscControl"]["DAS_pscParkState"].get(int(cp_cam.vl["DAS_pscControl"]["DAS_pscParkState"]), None) + summon_or_autopark_enabled = ( + eac_status in ["EAC_ACTIVE"] + or autopark_status in ["SUMMON", "COMPLETE", "ABORT", "PARALLEL_PULL_OUT_TO_RIGHT", + "PARALLEL_PULL_OUT_TO_LEFT", "PARK_RIGHT_CROSS", "PARK_RIGHT_PARALLEL", + "PARK_LEFT_CROSS", "PARK_LEFT_PARALLEL"] + ) + self.cruise_state = cp.vl["DI_state"]["DI_cruiseState"] + cruise_state = self.can_define.dv["DI_state"]["DI_cruiseState"].get(int(cp.vl["DI_state"]["DI_cruiseState"]), None) + self.speed_units = self.can_define.dv["DI_state"]["DI_speedUnits"].get(int(cp.vl["DI_state"]["DI_speedUnits"]), None) + self.v_cruise_actual = cp.vl["DI_state"]["DI_cruiseSet"] + if self.speed_units == "MPH": + self.v_cruise_actual = self.v_cruise_actual * CV.MPH_TO_KPH + self.prev_cruise_buttons = self.cruise_buttons + self.cruise_buttons = cp.vl["STW_ACTN_RQ"]["SpdCtrlLvr_Stat"] + + + if (self.CP.carFingerprint != CAR.PREAP_MODELS): + acc_enabled = (cruise_state in ["ENABLED", "STANDSTILL", "OVERRIDE", "PRE_FAULT", "PRE_CANCEL"]) + self.autopilot_enabled = (autopilot_status in ["ACTIVE_1", "ACTIVE_2"]) #, "ACTIVE_NAVIGATE_ON_AUTOPILOT"]) + self.cruiseEnabled = acc_enabled and not self.autopilot_enabled and not summon_or_autopark_enabled + ret.cruiseState.enabled = self.cruiseEnabled and self.cruiseDelay + if self.speed_units == "KPH": + ret.cruiseState.speed = cp.vl["DI_state"]["DI_digitalSpeed"] * CV.KPH_TO_MS + elif self.speed_units == "MPH": + ret.cruiseState.speed = cp.vl["DI_state"]["DI_digitalSpeed"] * CV.MPH_TO_MS + ret.cruiseState.available = ((cruise_state == "STANDBY") or ret.cruiseState.enabled) + ret.cruiseState.standstill = False #(cruise_state == "STANDSTILL") + else: + ret.cruiseState.speed = self.acc_speed_kph * CV.KPH_TO_MS + ret.cruiseState.enabled = self.cruiseEnabled and (not ret.doorOpen) and (ret.gearShifter == car.CarState.GearShifter.drive) and (not ret.seatbeltUnlatched) + ret.cruiseState.available = True + ret.cruiseState.standstill = False + + #speed limit + msu = cp.vl['UI_gpsVehicleSpeed']["UI_mapSpeedLimitUnits"] + map_speed_uom_to_ms = CV.KPH_TO_MS if msu == 1 else CV.MPH_TO_MS + map_speed_ms_to_uom = CV.MS_TO_KPH if msu == 1 else CV.MS_TO_MPH + + speed_limit_type = int(cp.vl["UI_driverAssistMapData"]["UI_mapSpeedLimit"]) + rdSignMsg = cp.vl["UI_driverAssistRoadSign"]["UI_roadSign"] + if rdSignMsg == 3: # ROAD_SIGN_SPEED_LIMIT + self.baseMapSpeedLimitMPS = cp.vl["UI_driverAssistRoadSign"]["UI_baseMapSpeedLimitMPS"] + # we round the speed limit in the map's units of measurement to fix noisy data (there are no signs with a limit of 79.2 kph) + self.baseMapSpeedLimitMPS = int(self.baseMapSpeedLimitMPS * map_speed_ms_to_uom + 0.99) / map_speed_ms_to_uom + if self.CP.carFingerprint != CAR.PREAP_MODELS and self.baseMapSpeedLimitMPS > 0 and (speed_limit_type != 0x1F or self.baseMapSpeedLimitMPS >= 5.56): + self.speed_limit_ms = self.baseMapSpeedLimitMPS # this one is earlier than the actual sign but can also be unreliable, so we ignore it on SNA at higher speeds + else: + self.speed_limit_ms = cp.vl['UI_gpsVehicleSpeed']["UI_mppSpeedLimit"] * map_speed_uom_to_ms + self.DAS_fusedSpeedLimit = self._convert_to_DAS_fusedSpeedLimit(self.speed_limit_ms * map_speed_ms_to_uom, speed_limit_type) + if self.DAS_fusedSpeedLimit > 1: + self.fleet_speed_state = 2 + else: + self.fleet_speed_state = 0 + # Gear + ret.gearShifter = GEAR_MAP[self.can_define.dv["DI_torque2"]["DI_gear"].get(int(cp.vl["DI_torque2"]["DI_gear"]), "DI_GEAR_INVALID")] + self.DAS_notInDrive = 0 if ret.gearShifter == car.CarState.GearShifter.drive else 1 + self.carNotInDrive = (not (ret.gearShifter == car.CarState.GearShifter.drive)) + + # Buttons + buttonEvents = [] + for button in BUTTONS: + state = (cp.vl[button.can_addr][button.can_msg] in button.values) + if self.button_states[button.event_type] != state: + event = car.CarState.ButtonEvent.new_message() + event.type = button.event_type + event.pressed = state + buttonEvents.append(event) + self.button_states[button.event_type] = state + ret.buttonEvents = buttonEvents + + # Doors + ret.doorOpen = any([(self.can_define.dv["GTW_carState"][door].get(int(cp.vl["GTW_carState"][door]), "OPEN") == "OPEN") for door in DOORS]) + + # Blinkers are used for Comma ALCA + # we use tap to trigger Comma ALCA so only engage when blinkig but not pressed + if (cp.vl["STW_ACTN_RQ"]["TurnIndLvr_Stat"] is not None): + self.turnSignalStalkState = ( + 0 + if cp.vl["STW_ACTN_RQ"]["TurnIndLvr_Stat"] == 3 + else int(cp.vl["STW_ACTN_RQ"]["TurnIndLvr_Stat"]) + ) + ret.leftBlinker = (cp.vl["GTW_carState"]["BC_indicatorLStatus"] == 1) and (self.turnSignalStalkState == 0) and (self.tap_direction == 1) + ret.rightBlinker = (cp.vl["GTW_carState"]["BC_indicatorRStatus"] == 1) and (self.turnSignalStalkState == 0) and (self.tap_direction == 2) + + # Seatbelt + if (self.CP.carFingerprint in [CAR.AP1_MODELX]): + ret.seatbeltUnlatched = (cp.vl["RCM_status"]["RCM_buckleDriverStatus"] != 1) + else: + ret.seatbeltUnlatched = (cp.vl["SDM1"]["SDM_bcklDrivStatus"] != 1) + + #Blindspot + if (self.CP.carFingerprint != CAR.PREAP_MODELS): + park_right_blindspot = self.can_define.dv["PARK_status2"]["PARK_sdiBlindSpotRight"].get(int(cp.vl["PARK_status2"]["PARK_sdiBlindSpotRight"])) == "WARNING" + park_left_blindspot = self.can_define.dv["PARK_status2"]["PARK_sdiBlindSpotLeft"].get(int(cp.vl["PARK_status2"]["PARK_sdiBlindSpotLeft"])) == "WARNING" + das_right_blindspot = self.can_define.dv["DAS_status"]["DAS_blindSpotRearRight"].get(int(cp_cam.vl["DAS_status"]["DAS_blindSpotRearRight"])) in ["WARNING_LEVEL_2","WARNING_LEVEL_1"] + das_left_blindspot = self.can_define.dv["DAS_status"]["DAS_blindSpotRearLeft"].get(int(cp_cam.vl["DAS_status"]["DAS_blindSpotRearLeft"])) in ["WARNING_LEVEL_2","WARNING_LEVEL_1"] + else: + das_right_blindspot = False + das_left_blindspot = False + park_right_blindspot = False + park_left_blindspot = False + ret.rightBlindspot = (park_right_blindspot or das_right_blindspot) + ret.leftBlindspot = (park_left_blindspot or das_left_blindspot) + # Messages needed by carcontroller + sw_a = copy.copy(cp.vl["STW_ACTN_RQ"]) + if sw_a is not None: + self.msg_stw_actn_req = sw_a + + #PREAP overrides at the last moment + if self.CP.carFingerprint in [CAR.PREAP_MODELS]: + #Pedal Interceptor + self.prev_pedal_interceptor_state = self.pedal_interceptor_state + self.prev_pedal_idx = self.pedal_idx + if self.enablePedal: + if self.pedalcanzero: + self.pedal_interceptor_state = cp.vl["GAS_SENSOR"]["STATE"] + self.pedal_interceptor_value = cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + self.pedal_interceptor_value2 = cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"] + self.pedal_idx = cp.vl["GAS_SENSOR"]["IDX"] + else: + self.pedal_interceptor_state = cp_cam.vl["GAS_SENSOR"]["STATE"] + self.pedal_interceptor_value = cp_cam.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + self.pedal_interceptor_value2 = cp_cam.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"] + self.pedal_idx = cp_cam.vl["GAS_SENSOR"]["IDX"] + + if self.enableHumanLongControl: + if self.cruise_buttons == CruiseButtons.MAIN: + self.cruiseEnabled = True + if self.cruise_buttons == CruiseButtons.CANCEL: + self.cruiseEnabled = False + + ret.cruiseState.enabled = self.cruiseEnabled and (not ret.doorOpen) and (ret.gearShifter == car.CarState.GearShifter.drive) and (not ret.seatbeltUnlatched) + self.cruiseEnabled = ret.cruiseState.enabled + ret.cruiseState.available = True + ret.cruiseState.standstill = ret.standstill + ret.brakePressed = False + ret.gasPressed = False + self.DAS_216_driverOverriding = False + ret.cruiseState.speed = self.acc_speed_kph * CV.KPH_TO_MS + + return ret + + @staticmethod + def get_can_parser(CP): + enablePedal = load_bool_param("TinklaEnablePedal",False) + pedalcanzero = load_bool_param("TinklaPedalCanZero",False) + has_ibooster_ecu = load_bool_param("TinklaHasIBooster",False) + signals = [ + # sig_name, sig_address, default + ("DI_pedalPos", "DI_torque1", 0), + ("DI_torqueMotor", "DI_torque1", 0), + ("DI_brakePedal", "DI_torque2", 0), + ("StW_AnglHP", "STW_ANGLHP_STAT", 0), + ("StW_AnglHP_Spd", "STW_ANGLHP_STAT", 0), + ("DI_cruiseState", "DI_state", 0), + ("DI_digitalSpeed", "DI_state", 0), + ("DI_speedUnits", "DI_state", 0), + ("DI_cruiseSet", "DI_state", 0), + ("DI_gear", "DI_torque2", 0), + ("DOOR_STATE_FL", "GTW_carState", 1), + ("DOOR_STATE_FR", "GTW_carState", 1), + ("DOOR_STATE_RL", "GTW_carState", 1), + ("DOOR_STATE_RR", "GTW_carState", 1), + ("DOOR_STATE_FrontTrunk", "GTW_carState", 1), + ("BOOT_STATE", "GTW_carState", 1), + ("BC_indicatorLStatus", "GTW_carState", 1), + ("BC_indicatorRStatus", "GTW_carState", 1), + # info for speed limit + ("UI_mapSpeedLimitUnits","UI_gpsVehicleSpeed",0), + ("UI_mppSpeedLimit","UI_gpsVehicleSpeed",0), + ("UI_mapSpeedLimit","UI_driverAssistMapData",0), + ("UI_roadSign","UI_driverAssistRoadSign",0), + ("UI_baseMapSpeedLimitMPS","UI_driverAssistRoadSign",0), + # We copy this whole message when spamming cancel + ("SpdCtrlLvr_Stat", "STW_ACTN_RQ", 0), + ("VSL_Enbl_Rq", "STW_ACTN_RQ", 0), + ("SpdCtrlLvrStat_Inv", "STW_ACTN_RQ", 0), + ("DTR_Dist_Rq", "STW_ACTN_RQ", 0), + ("TurnIndLvr_Stat", "STW_ACTN_RQ", 0), + ("HiBmLvr_Stat", "STW_ACTN_RQ", 0), + ("WprWashSw_Psd", "STW_ACTN_RQ", 0), + ("WprWash_R_Sw_Posn_V2", "STW_ACTN_RQ", 0), + ("StW_Lvr_Stat", "STW_ACTN_RQ", 0), + ("StW_Cond_Flt", "STW_ACTN_RQ", 0), + ("StW_Cond_Psd", "STW_ACTN_RQ", 0), + ("HrnSw_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw00_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw01_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw02_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw03_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw04_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw05_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw06_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw07_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw08_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw09_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw10_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw11_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw12_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw13_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw14_Psd", "STW_ACTN_RQ", 0), + ("StW_Sw15_Psd", "STW_ACTN_RQ", 0), + ("WprSw6Posn", "STW_ACTN_RQ", 0), + ("MC_STW_ACTN_RQ", "STW_ACTN_RQ", 0), + ("CRC_STW_ACTN_RQ", "STW_ACTN_RQ", 0), + ] + + checks = [ + # sig_address, frequency + ("DI_torque1", 100), + ("DI_torque2", 100), + ("STW_ANGLHP_STAT", 100), + ("DI_state", 10), + ("STW_ACTN_RQ", 10), + ("GTW_carState", 10), + ] + + signals += [ + ("ESP_vehicleSpeed", "ESP_B", 0), + ("ESP_wheelPulseCountFrL", "ESP_B", 0), + ("ESP_wheelPulseCountFrR", "ESP_B", 0), + ("ESP_wheelPulseCountReL", "ESP_B", 0), + ("ESP_wheelPulseCountReR", "ESP_B", 0), + ("driverBrakeStatus", "BrakeMessage", 0), + ] + checks += [ + ("ESP_B", 50), + ("BrakeMessage", 50), + ] + + if not (CP.carFingerprint in [CAR.AP1_MODELX]): + signals += [ + ("SDM_bcklDrivStatus", "SDM1", 0), + ] + + checks += [ + #("SDM1", 10), + ] + + if (CP.carFingerprint in [CAR.AP1_MODELX]): + signals += [ + ("RCM_buckleDriverStatus","RCM_status",0), + ] + + checks += [ + #("RCM_status",10), + ] + + signals += [ + ("EPAS_handsOnLevel", "EPAS_sysStatus", 0), + ("EPAS_torsionBarTorque", "EPAS_sysStatus", 0), + ("EPAS_internalSAS", "EPAS_sysStatus", 0), + ("EPAS_eacStatus", "EPAS_sysStatus", 1), + ("EPAS_eacErrorCode", "EPAS_sysStatus", 0), + ("PARK_sdiBlindSpotRight","PARK_status2",0), + ("PARK_sdiBlindSpotLeft","PARK_status2",0), + ] + + checks += [ + ("EPAS_sysStatus", 25), + #("PARK_status2",4), + ] + + if has_ibooster_ecu: + signals += [ + ("BrakeApplied", "ECU_BrakeStatus", 0), + ("BrakeOK", "ECU_BrakeStatus", 0), + ("DriverBrakeApplied", "ECU_BrakeStatus", 0), + ("BrakePedalPosition", "ECU_BrakeStatus", 0), + ] + + checks += [ + ("ECU_BrakeStatus", 80) + ] + + if enablePedal and pedalcanzero: + signals += [ + ("INTERCEPTOR_GAS", "GAS_SENSOR", 0), + ("INTERCEPTOR_GAS2", "GAS_SENSOR", 0), + ("STATE", "GAS_SENSOR", 0), + ("IDX", "GAS_SENSOR", 0), + ] + + checks += [ + ("GAS_SENSOR", 10) + ] + + return CANParser(DBC[CP.carFingerprint]['chassis'], signals, checks, 0, enforce_checks=False) + + @staticmethod + def get_cam_can_parser(CP): + enablePedal = load_bool_param("TinklaEnablePedal",False) + pedalcanzero = load_bool_param("TinklaPedalCanZero",False) + signals = [] + checks = [] + + if CP.carFingerprint in [CAR.AP1_MODELS, CAR.AP2_MODELS, CAR.AP1_MODELX]: + signals = [ + # sig_name, sig_address, default + #we need the steering control counter + ("DAS_steeringControlCounter", "DAS_steeringControl", 0), + # We copy this whole message when we change the status for IC + ("DAS_autopilotState", "DAS_status", 0), + ("DAS_blindSpotRearLeft", "DAS_status", 0), + ("DAS_blindSpotRearRight", "DAS_status", 0), + ("DAS_fusedSpeedLimit", "DAS_status", 0), + ("DAS_suppressSpeedWarning", "DAS_status", 0), + ("DAS_summonObstacle", "DAS_status", 0), + ("DAS_summonClearedGate", "DAS_status", 0), + ("DAS_visionOnlySpeedLimit", "DAS_status", 0), + ("DAS_heaterState", "DAS_status", 0), + ("DAS_forwardCollisionWarning", "DAS_status", 0), + ("DAS_autoparkReady", "DAS_status", 0), + ("DAS_autoParked", "DAS_status", 0), + ("DAS_autoparkWaitingForBrake", "DAS_status", 0), + ("DAS_summonFwdLeashReached", "DAS_status", 0), + ("DAS_summonRvsLeashReached", "DAS_status", 0), + ("DAS_sideCollisionAvoid", "DAS_status", 0), + ("DAS_sideCollisionWarning", "DAS_status", 0), + ("DAS_sideCollisionInhibit", "DAS_status", 0), + ("DAS_csaState", "DAS_status2", 0), + ("DAS_laneDepartureWarning", "DAS_status", 0), + ("DAS_fleetSpeedState", "DAS_status", 0), + ("DAS_autopilotHandsOnState", "DAS_status", 0), + ("DAS_autoLaneChangeState", "DAS_status", 0), + ("DAS_summonAvailable", "DAS_status", 0), + ("DAS_statusCounter", "DAS_status", 0), + ("DAS_statusChecksum", "DAS_status", 0), + ("DAS_headlightRequest", "DAS_bodyControls", 0), + ("DAS_hazardLightRequest", "DAS_bodyControls", 0), + ("DAS_wiperSpeed", "DAS_bodyControls", 0), + ("DAS_turnIndicatorRequest", "DAS_bodyControls", 0), + ("DAS_highLowBeamDecision", "DAS_bodyControls", 0), + ("DAS_highLowBeamOffReason", "DAS_bodyControls", 0), + ("DAS_turnIndicatorRequestReason", "DAS_bodyControls", 0), + ("DAS_bodyControlsCounter", "DAS_bodyControls", 0), + ("DAS_bodyControlsChecksum", "DAS_bodyControls", 0), + ("DAS_accSpeedLimit", "DAS_status2", 0), + ("DAS_pmmObstacleSeverity", "DAS_status2", 0), + ("DAS_pmmLoggingRequest", "DAS_status2", 0), + ("DAS_activationFailureStatus", "DAS_status2", 0), + ("DAS_pmmUltrasonicsFaultReason", "DAS_status2", 0), + ("DAS_pmmRadarFaultReason", "DAS_status2", 0), + ("DAS_pmmSysFaultReason", "DAS_status2", 0), + ("DAS_pmmCameraFaultReason", "DAS_status2", 0), + ("DAS_ACC_report", "DAS_status2", 0), + ("DAS_lssState", "DAS_status", 0), + ("DAS_radarTelemetry", "DAS_status2", 0), + ("DAS_robState", "DAS_status2", 0), + ("DAS_driverInteractionLevel", "DAS_status2", 0), + ("DAS_ppOffsetDesiredRamp", "DAS_status2", 0), + ("DAS_longCollisionWarning", "DAS_status2", 0), + ("DAS_status2Counter", "DAS_status2", 0), + ("DAS_status2Checksum", "DAS_status2", 0), + ("DAS_eacState", "DAS_pscControl", 0), + ("DAS_pscParkState", "DAS_pscControl", 0), + ] + + checks = [ + # sig_address, frequency + ("DAS_status", 2), + ("DAS_status2",2), + ("DAS_pscControl",25), + ("DAS_bodyControls",2), + ("DAS_steeringControl",50), + + ] + + if CP.carFingerprint in [CAR.PREAP_MODELS]: + if enablePedal and not pedalcanzero: + signals += [ + ("INTERCEPTOR_GAS", "GAS_SENSOR", 0), + ("INTERCEPTOR_GAS2", "GAS_SENSOR", 0), + ("STATE", "GAS_SENSOR", 0), + ("IDX", "GAS_SENSOR", 0), + ] + + checks += [ + ("GAS_SENSOR", 10) + ] + + return CANParser(DBC[CP.carFingerprint]['chassis'], signals, checks, 2,enforce_checks=False) diff --git a/selfdrive/car/tesla/ck_fingerprint.py b/selfdrive/car/tesla/ck_fingerprint.py new file mode 100644 index 000000000..d13c6d660 --- /dev/null +++ b/selfdrive/car/tesla/ck_fingerprint.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python3 +import os +import sys +from common.basedir import BASEDIR +from selfdrive.car.fingerprints import IGNORED_FINGERPRINTS + +# messages reserved for CAN based ignition (see can_ignition_hook function in panda/board/drivers/can) +# (addr, len) +CAN_IGNITION_MSGS = { + 'gm': [(0x1F1, 8), (0x160, 5)], + #'tesla' : [(0x348, 8)], +} + +def _get_fingerprints(): + # read all the folders in selfdrive/car and return a dict where: + # - keys are all the car names that which we have a fingerprint dict for + # - values are dicts of fingeprints for each trim + fingerprints = {} + for car_folder in [x[0] for x in os.walk(BASEDIR + '/selfdrive/car')]: + car_name = car_folder.split('/')[-1] + try: + fingerprints[car_name] = __import__('selfdrive.car.%s.values' % car_name, fromlist=['FINGERPRINTS']).FINGERPRINTS + except (ImportError, IOError, AttributeError): + pass + + return fingerprints + + +def check_fingerprint_consistency(f1, f2): + # return false if it finds a fingerprint fully included in another + # max message worth checking is 1800, as above that they usually come too infrequently and not + # usable for fingerprinting + + max_msg = 1800 + + is_f1_in_f2 = True + for k in f1: + if (k not in f2 or f1[k] != f2[k]) and k < max_msg: + is_f1_in_f2 = False + + is_f2_in_f1 = True + for k in f2: + if (k not in f1 or f2[k] != f1[k]) and k < max_msg: + is_f2_in_f1 = False + + return not is_f1_in_f2 and not is_f2_in_f1 + + +def check_can_ignition_conflicts(fingerprints, brands): + # loops through all the fingerprints and exits if CAN ignition dedicated messages + # are found in unexpected fingerprints + + for brand_can, msgs_can in CAN_IGNITION_MSGS.items(): + for i, f in enumerate(fingerprints): + for msg_can in msgs_can: + if brand_can != brands[i] and msg_can[0] in f and msg_can[1] == f[msg_can[0]]: + print("CAN ignition dedicated msg %d with len %d found in %s fingerprints!" % (msg_can[0], msg_can[1], brands[i])) + print("TEST FAILED") + sys.exit(1) + + +fingerprints = _get_fingerprints() + +fingerprints_flat = [] +car_names = [] +brand_names = [] +for brand in fingerprints: + for car in fingerprints[brand]: + if car in IGNORED_FINGERPRINTS: + continue + + fingerprints_flat += fingerprints[brand][car] + for i in range(len(fingerprints[brand][car])): + car_names.append(car) + brand_names.append(brand) + +if len(sys.argv) != 2 or not sys.argv[1] in ["-i","-c"]: + print(" **** Fingerprint Tester ****") + print(" ") + print("use 'python",sys.argv[0],"-i' to see which car matches your fingerprint.") + print(" ") + print("use 'python",sys.argv[0],"-c' to see what message IDs makes it fail against a certain car.") + exit(0) + +count = 0 +idx2 = "YOUR_CAR" +f2string = input("Please provide your fingerprint:") +f2l = f2string.split(",") +f2 = {} +for a in f2l: + b,c = a.split(":") + f2[int(b)]=int(c) +#print("You entered: [",f2,"]") +if sys.argv[1] == "-i": + for idx1, f1 in enumerate(fingerprints_flat): + if not check_fingerprint_consistency(f1, f2): + print("{0} matches the fingerprint for {1}".format(idx2, car_names[idx1])) + print("") + count = count + 1 + + +if sys.argv[1] == "-c": + fingerprints_flat = [] + car_names = [] + brands = {} + brand_names = [] + bid = 0 + + print("Please select the brand to check against") + for brand in fingerprints: + if brand not in brand_names: + brand_names.append(brand) + bid = bid + 1 + brands[bid] = brand + print("{} : {}".format(bid,brand)) + brandmod = input("Brand # to check against:") + brandt = brands[int(brandmod)] + + cars = {} + cid = 0 + for car in fingerprints[brandt]: + fingerprints_flat += fingerprints[brandt][car] + cid = cid + 1 + cars[cid]=car + for i in range(len(fingerprints[brandt][car])): + car_names.append(car) + print("{} : {}".format(cid,car)) + + carmod = input("Car # to check against:") + car = cars[int(carmod)] + included_in = False + for idx1, f1 in enumerate(fingerprints_flat): + if car == car_names[idx1]: + print (car,"(",idx1,")") + all_in = True + for k in f2: + if (k not in f1): + print("{}: {} not in fingerprint for {} {}".format(k,f2[k],brandt,car)) + all_in = False + if (k in f1) and (f2[k] != f1[k]): + print("{}: {} does not match the size ({}) in fingerprint for {} {}".format(k,f2[k],f1[k],brandt,car)) + all_in = False + + if not all_in: + print("Not fully included!") + else: + print("Fully included!") + included_in = True + if included_in: + print("PASS: At least one of the fingerprints for",car,"contains your fingerprint!") + else: + print("FAIL: None of the fingerprints for",car,"contains your fingerprint!") \ No newline at end of file diff --git a/selfdrive/car/tesla/interface.py b/selfdrive/car/tesla/interface.py new file mode 100755 index 000000000..da15d21ae --- /dev/null +++ b/selfdrive/car/tesla/interface.py @@ -0,0 +1,192 @@ +#!/usr/bin/env python3 +from cereal import car +from selfdrive.car.tesla.values import CAR, CruiseButtons, CAN_AP_POWERTRAIN +from selfdrive.car import STD_CARGO_KG, gen_empty_fingerprint, scale_rot_inertia, scale_tire_stiffness, get_safety_config +from selfdrive.car.interfaces import CarInterfaceBase +from selfdrive.car.modules.CFG_module import load_bool_param +from panda import Panda +from selfdrive.car.tesla.tunes import LongTunes, set_long_tune +from selfdrive.car.tesla.PCC_module import ACCEL_MIN, ACCEL_MAX + +ButtonType = car.CarState.ButtonEvent.Type + +class CarInterface(CarInterfaceBase): + @staticmethod + def compute_gb(accel, speed): + # TODO: is this correct? + return float(accel) / 6.0 + + @staticmethod + def get_pid_accel_limits(CP, current_speed, cruise_speed): + return ACCEL_MIN, ACCEL_MAX + + @staticmethod + def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None): + if load_bool_param("TinklaForceTeslaPreAP",False): + candidate = CAR.PREAP_MODELS + ret = CarInterfaceBase.get_std_params(candidate, fingerprint) + ret.carName = "tesla" + ret.steerControlType = car.CarParams.SteerControlType.angle + + ret.stopAccel = 0.0 + ret.longitudinalActuatorDelayUpperBound = 0.5 # s + ret.radarTimeStep = (1.0 / 8) # 8Hz + + ret.steerLimitTimer = 1.0 + ret.steerActuatorDelay = 0.1 + ret.steerRateCost = 0.5 + + #safetyParam + # BIT - MEANING + # Panda.FLAG_TESLA_POWERTRAIN = 1 + # Panda.FLAG_TESLA_LONG_CONTROL = 2 + # Panda.FLAG_TESLA_HAS_IC_INTEGRATION = 8 + # Panda.FLAG_TESLA_HAS_AP = 16 + # Panda.FLAG_TESLA_NEED_RADAR_EMULATION = 32 + # Panda.FLAG_TESLA_HAO = 64 + # Panda.FLAG_TESLA_IBOOSTER = 128 + + ret.steerLimitTimer = 1.0 + ret.steerActuatorDelay = 0.1 + ret.steerRateCost = 0.5 + safetyParam = 0 + ret.wheelSpeedFactor = 1. + if candidate in (CAR.AP2_MODELS, CAR.AP1_MODELS): + ret.mass = 2100. + STD_CARGO_KG + ret.wheelbase = 2.959 + ret.centerToFront = ret.wheelbase * 0.5 + ret.steerRatio = 13.5 + safetyParam = safetyParam | Panda.FLAG_TESLA_HAS_AP # has AP, ACC + ret.openpilotLongitudinalControl = False + set_long_tune(ret.longitudinalTuning, LongTunes.AP) + elif candidate == CAR.AP1_MODELS: + ret.mass = 2100. + STD_CARGO_KG + ret.wheelbase = 2.959 + ret.centerToFront = ret.wheelbase * 0.5 + ret.steerRatio = 13.5 + safetyParam = safetyParam | Panda.FLAG_TESLA_HAS_AP # has AP, ACC + ret.openpilotLongitudinalControl = False + set_long_tune(ret.longitudinalTuning, LongTunes.AP) + elif candidate == CAR.AP1_MODELX: + #TODO: update values + ret.mass = 2560. + STD_CARGO_KG + ret.wheelbase = 2.964 + ret.centerToFront = ret.wheelbase * 0.5 + ret.steerRatio = 13.5 + safetyParam = safetyParam | Panda.FLAG_TESLA_HAS_AP # has AP, ACC + ret.openpilotLongitudinalControl = False + set_long_tune(ret.longitudinalTuning, LongTunes.AP) + elif candidate == CAR.PREAP_MODELS: + ret.mass = 2100. + STD_CARGO_KG + ret.wheelbase = 2.959 + ret.centerToFront = ret.wheelbase * 0.5 + ret.steerRatio = 13.5 + ret.openpilotLongitudinalControl = False + if load_bool_param("TinklaEnablePedal",False): + set_long_tune(ret.longitudinalTuning, LongTunes.PEDAL) + else: + set_long_tune(ret.longitudinalTuning, LongTunes.ACC) + else: + raise ValueError(f"Unsupported car: {candidate}") + # enable IC integration - always enabled + # enable body controls - always enabled + # enabled radar emulation from carconfig + if candidate == CAR.PREAP_MODELS and load_bool_param("TinklaUseTeslaRadar",False): + safetyParam = safetyParam | Panda.FLAG_TESLA_NEED_RADAR_EMULATION + if load_bool_param("TinklaTeslaRadarBehindNosecone",False): + safetyParam = safetyParam | Panda.FLAG_TESLA_RADAR_BEHIND_NOSECONE + # enabled HAO from carconfig + if load_bool_param("TinklaHao",False): + safetyParam = safetyParam | Panda.FLAG_TESLA_ENABLE_HAO + if load_bool_param("TinklaEnableOPLong",False) or ret.openpilotLongitudinalControl: + safetyParam = safetyParam | Panda.FLAG_TESLA_LONG_CONTROL + ret.openpilotLongitudinalControl = True + if load_bool_param("TinklaHasIcIntegration",False): + safetyParam = safetyParam | Panda.FLAG_TESLA_HAS_IC_INTEGRATION + # true if car has ibooster + if (candidate == CAR.PREAP_MODELS and load_bool_param("TinklaHasIBooster",False)) or (candidate != CAR.PREAP_MODELS): + safetyParam = safetyParam | Panda.FLAG_TESLA_HAS_IBOOSTER + ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) + ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront) + ret.radarOffCan = False + if candidate == CAR.PREAP_MODELS: + ret.radarOffCan = not load_bool_param("TinklaUseTeslaRadar",False) + # set safetyParam flag for OP Long Control + if ret.openpilotLongitudinalControl: + safetyParam = safetyParam | Panda.FLAG_TESLA_LONG_CONTROL + + if candidate == CAR.AP2_MODELS: + # Check if we have messages on an auxiliary panda, and that 0x2bf (DAS_control) is present on the AP powertrain bus + # If so, we assume that it is connected to the longitudinal harness. + if (CAN_AP_POWERTRAIN[candidate] in fingerprint.keys()) and (0x2bf in fingerprint[CAN_AP_POWERTRAIN[candidate]].keys()): + ret.openpilotLongitudinalControl = True + ret.safetyConfigs = [ + get_safety_config(car.CarParams.SafetyModel.tesla, safetyParam | Panda.FLAG_TESLA_LONG_CONTROL), + get_safety_config(car.CarParams.SafetyModel.tesla, safetyParam | Panda.FLAG_TESLA_LONG_CONTROL | Panda.FLAG_TESLA_POWERTRAIN), + ] + else: + ret.openpilotLongitudinalControl = False + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.tesla, safetyParam)] + else: + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.tesla, safetyParam)] + return ret + + def update(self, c, can_strings): + self.cp.update_strings(can_strings) + self.cp_cam.update_strings(can_strings) + + ret = self.CS.update(self.cp, self.cp_cam) + if self.CP.carFingerprint == CAR.PREAP_MODELS: + ret.canValid = self.cp.can_valid + else: + ret.canValid = self.cp.can_valid and self.cp_cam.can_valid + + self.post_update(c,ret) + + buttonEvents = [] + + if self.CS.cruise_buttons != self.CS.prev_cruise_buttons: + be = car.CarState.ButtonEvent.new_message() + be.type = ButtonType.unknown + if self.CS.cruise_buttons != 0: + be.pressed = True + but = self.CS.cruise_buttons + else: + be.pressed = False + but = self.CS.prev_cruise_buttons + if but == CruiseButtons.RES_ACCEL: + be.type = ButtonType.accelCruise + elif but == CruiseButtons.DECEL_SET: + be.type = ButtonType.decelCruise + elif but == CruiseButtons.CANCEL: + be.type = ButtonType.cancel + elif but == CruiseButtons.MAIN: + be.type = ButtonType.setCruise + buttonEvents.append(be) + + ret.buttonEvents = buttonEvents + + events = self.create_common_events(ret) + if self.CS.autopilot_enabled: + events.add(car.CarEvent.EventName.invalidLkasSetting) + + if self.CS.longCtrlEvent: + events.add(self.CS.longCtrlEvent) + self.CS.longCtrlEvent = None + + ret.events = events.to_msg() + + self.CS.out = ret.as_reader() + self.CS.DAS_canErrors = 0 if ret.canValid else 1 + + return self.CS.out + + def apply(self, c): + self.pre_apply(c) + ret = self.CC.update(c, c.enabled, self.CS, self.frame, c.actuators, + c.cruiseControl.cancel,c.cruiseControl.speedOverride,c.cruiseControl.override, + c.hudControl.visualAlert, c.hudControl.audibleAlert, c.hudControl.leftLaneVisible, + c.hudControl.rightLaneVisible, c.hudControl.leadVisible, + c.hudControl.leftLaneDepart, c.hudControl.rightLaneDepart) + self.frame += 1 + return ret diff --git a/selfdrive/car/tesla/radar_interface.py b/selfdrive/car/tesla/radar_interface.py new file mode 100755 index 000000000..5d2b34996 --- /dev/null +++ b/selfdrive/car/tesla/radar_interface.py @@ -0,0 +1,148 @@ +#!/usr/bin/env python3 +from cereal import car +from opendbc.can.parser import CANParser +from selfdrive.car.tesla.values import DBC, CAR, CAN_RADAR +from selfdrive.car.interfaces import RadarInterfaceBase +from selfdrive.car.modules.CFG_module import load_bool_param,load_float_param + + +RADAR_MSGS_A = list(range(0x310, 0x36E, 3)) +RADAR_MSGS_B = list(range(0x311, 0x36F, 3)) +NUM_POINTS = len(RADAR_MSGS_A) +BOSCH_MAX_DIST = 250.0 # max distance for radar +OBJECT_MIN_PROBABILITY = 50.0 + +def get_radar_can_parser(CP): + # Status messages + signals = [ + ('RADC_HWFail', 'TeslaRadarSguInfo'), + ('RADC_SGUFail', 'TeslaRadarSguInfo'), + ('RADC_SensorDirty', 'TeslaRadarSguInfo'), + ] + + checks = [ + ('TeslaRadarSguInfo', 10), + ] + + # Radar tracks. There are also raw point clouds available, + # we don't use those. + for i in range(NUM_POINTS): + msg_id_a = RADAR_MSGS_A[i] + msg_id_b = RADAR_MSGS_B[i] + + # There is a bunch more info in the messages, + # but these are the only things actually used in openpilot + signals.extend([ + ('LongDist', msg_id_a), + ('LongSpeed', msg_id_a), + ('LatDist', msg_id_a), + ('LongAccel', msg_id_a), + ('Meas', msg_id_a), + ('Tracked', msg_id_a), + ('Index', msg_id_a), + ('ProbExist', msg_id_a), + ('LatSpeed', msg_id_b), + ('Index2', msg_id_b), + ]) + + checks.extend([ + (msg_id_a, 8), + (msg_id_b, 8), + ]) + + return CANParser(DBC[CP.carFingerprint]['radar'], signals, checks, CAN_RADAR[CP.carFingerprint]) + +class RadarInterface(RadarInterfaceBase): + def __init__(self, CP): + super().__init__(CP) + self.rcp = None + self.updated_messages = set() + self.track_id = 0 + self.trigger_msg = RADAR_MSGS_B[-1] + self.radar_off_can = CP.radarOffCan + self.fingerprint = CP.carFingerprint + if not self.radar_off_can: + self.rcp = get_radar_can_parser(CP) + self.behindNoseCone = load_bool_param("TinklaTeslaRadarBehindNosecone",False) + self.radar_offset = load_float_param("TinklaRadarOffset",0.0) + + def update(self, can_strings): + if self.rcp is None or self.radar_off_can: + return super().update(None) + + values = self.rcp.update_strings(can_strings) + self.updated_messages.update(values) + + if self.trigger_msg not in self.updated_messages: + return None + + ret = car.RadarData.new_message() + + # Errors + errors = [] + sgu_info = self.rcp.vl['TeslaRadarSguInfo'] + if not self.rcp.can_valid: + errors.append('canError') + #ignore RADC_SGUFail on PREAP MODEL S due to retrofit + if ( + sgu_info['RADC_HWFail'] + or + ( + sgu_info['RADC_SGUFail'] + and + self.fingerprint != CAR.PREAP_MODELS + ) + or + ( + sgu_info['RADC_SensorDirty'] + and + ( + self.fingerprint != CAR.PREAP_MODELS + or + not self.behindNoseCone + ) + ) + ): + errors.append('fault') + ret.errors = errors + + # Radar tracks + for i in range(NUM_POINTS): + msg_a = self.rcp.vl[RADAR_MSGS_A[i]] + msg_b = self.rcp.vl[RADAR_MSGS_B[i]] + + # Make sure msg A and B are together + if msg_a['Index'] != msg_b['Index2']: + continue + + # Check if it's a valid track + if not msg_a['Tracked']: + if i in self.pts: + del self.pts[i] + continue + + #BB Check if it's a valid point + if ((msg_a["LongDist"] > BOSCH_MAX_DIST) or + (msg_a["LongDist"] <= 0) or + (msg_a["ProbExist"] < OBJECT_MIN_PROBABILITY)): + if i in self.pts: + del self.pts[i] + continue + + # New track! + if i not in self.pts: + self.pts[i] = car.RadarData.RadarPoint.new_message() + self.pts[i].trackId = self.track_id + self.track_id += 1 + + # Parse track data + self.pts[i].dRel = msg_a['LongDist'] + self.pts[i].yRel = msg_a['LatDist'] + self.radar_offset + self.pts[i].vRel = msg_a['LongSpeed'] + self.pts[i].aRel = msg_a['LongAccel'] + self.pts[i].yvRel = msg_b['LatSpeed'] + self.pts[i].measured = bool(msg_a['Meas']) + + ret.points = list(self.pts.values()) + self.updated_messages.clear() + return ret \ No newline at end of file diff --git a/selfdrive/car/tesla/radar_tools/calibrateRadar.py b/selfdrive/car/tesla/radar_tools/calibrateRadar.py new file mode 100755 index 000000000..edfdb0322 --- /dev/null +++ b/selfdrive/car/tesla/radar_tools/calibrateRadar.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +import cereal.messaging as messaging +from selfdrive.car.tesla.radar_interface import RadarInterface +from selfdrive.car.tesla.values import CAR +from selfdrive.car import gen_empty_fingerprint +from selfdrive.car.interfaces import CarInterfaceBase + + +#for calibration we only want fixed objects within 1 m of the center line and between 2.5 and 4.5 m far from radar +MINX = 2.5 +MAXX = 14.5 +MINY = -1.0 +MAXY = 1.0 + +if __name__ == "__main__": + CP = CarInterfaceBase.get_std_params(CAR.PREAP_MODELS,gen_empty_fingerprint()) + CP.radarTimeStep = (1.0 / 8) # 8Hz + RI = RadarInterface(CP) + can_sock = messaging.sub_sock('can') + while 1: + can_strings = messaging.drain_sock_raw(can_sock, wait_for_one=True) + rr = RI.update(can_strings) + + if (rr is None): + continue + + print(chr(27) + "[2J") + + for pt in rr.points: + if (pt.dRel >= MINX) and (pt.dRel <= MAXX) and (pt.yRel >= MINY) and (pt.yRel <= MAXY): + print (pt) diff --git a/selfdrive/car/tesla/radar_tools/getRadarErrorCodes.py b/selfdrive/car/tesla/radar_tools/getRadarErrorCodes.py new file mode 100755 index 000000000..7bf9e4934 --- /dev/null +++ b/selfdrive/car/tesla/radar_tools/getRadarErrorCodes.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python3 + +import cereal.messaging as messaging +from selfdrive.car.tesla.radar_interface import RadarInterface +from selfdrive.car.tesla.values import CAR +from selfdrive.car import gen_empty_fingerprint +from selfdrive.car.interfaces import CarInterfaceBase +from opendbc.can.parser import CANParser +from selfdrive.car.tesla.values import DBC, CAR, CAN_RADAR + + +error_signals = ["RADC_a001_ecuInternalPerf","RADC_a002_flashPerformance","RADC_a003_vBatHigh", + "RADC_a004_adjustmentNotDone","RADC_a005_adjustmentReq","RADC_a006_adjustmentNotOk", + "RADC_a007_sensorBlinded","RADC_a008_plantModeActive","RADC_a009_configMismatch", + "RADC_a010_canBusOff","RADC_a011_bdyMIA","RADC_a012_espMIA","RADC_a013_gtwMIA", + "RADC_a014_sccmMIA","RADC_a015_adasMIA","RADC_a016_bdyInvalidCount", + "RADC_a017_adasInvalidCount","RADC_a018_espInvalidCount","RADC_a019_sccmInvalidCount", + "RADC_a020_bdyInvalidChkSm","RADC_a021_espInvalidChkSm","RADC_a022_sccmInvalidChkSm", + "RADC_a023_sccmInvalidChkSm","RADC_a024_absValidity","RADC_a025_ambTValidity", + "RADC_a026_brakeValidity","RADC_a027_CntryCdValidity","RADC_a028_espValidity", + "RADC_a029_longAccOffValidity","RADC_a030_longAccValidity","RADC_a031_odoValidity", + "RADC_a032_gearValidity","RADC_a033_steerAngValidity","RADC_a034_steerAngSpdValidity", + "RADC_a035_indctrValidity","RADC_a036_vehStandStillValidity","RADC_a037_vinValidity", + "RADC_a038_whlRotValidity","RADC_a039_whlSpdValidity","RADC_a040_whlStandStillValidity", + "RADC_a041_wiperValidity","RADC_a042_xwdValidity","RADC_a043_yawOffValidity", + "RADC_a044_yawValidity","RADC_a045_bsdSanity","RADC_a046_rctaSanity", + "RADC_a047_lcwSanity","RADC_a048_steerAngOffSanity","RADC_a049_tireSizeSanity", + "RADC_a050_velocitySanity","RADC_a051_yawSanity","RADC_a052_radomeHtrInop", + "RADC_a053_espmodValidity","RADC_a054_gtwmodValidity","RADC_a055_stwmodValidity", + "RADC_a056_bcmodValidity","RADC_a057_dimodValidity","RADC_a058_opmodValidity", + "RADC_a059_drmiInvalidChkSm","RADC_a060_drmiInvalidCount","RADC_a061_radPositionMismatch", + "RADC_a062_strRackMismatch","unused62"] +error_message = "TeslaRadarAlertMatrix" + +def get_radar_error_parser(CP): + # Status messages + signals = [] + checks = [('TeslaRadarAlertMatrix', 1),] + for signal in error_signals: + tpl = (signal, error_message) + signals.append(tpl) + return CANParser(DBC[CP.carFingerprint]['radar'], signals, checks, CAN_RADAR[CP.carFingerprint]) + + +if __name__ == "__main__": + CP = CarInterfaceBase.get_std_params(CAR.PREAP_MODELS,gen_empty_fingerprint()) + rcp = get_radar_error_parser(CP) + can_sock = messaging.sub_sock('can') + while 1: + can_strings = messaging.drain_sock_raw(can_sock, wait_for_one=True) + values = rcp.update_strings(can_strings) + errors = 0 + print(chr(27) + "[2J") + print("Checking TeslaRadarAlertMatrix for errors...") + print("--------------------------------------------") + for signal in error_signals: + val = rcp.vl[error_message][signal] + if val > 0: + print(signal,val) + errors = errors + 1 + if errors == 0: + print ("No errors!") + else: + print(errors," errors!") + + diff --git a/selfdrive/car/tesla/radar_tools/testRadar.py b/selfdrive/car/tesla/radar_tools/testRadar.py new file mode 100755 index 000000000..0a097b602 --- /dev/null +++ b/selfdrive/car/tesla/radar_tools/testRadar.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +import cereal.messaging as messaging +from selfdrive.car.tesla.radar_interface import RadarInterface +from selfdrive.car.tesla.values import CAR +from selfdrive.car import gen_empty_fingerprint +from selfdrive.car.interfaces import CarInterfaceBase + + +if __name__ == "__main__": + CP = CarInterfaceBase.get_std_params(CAR.PREAP_MODELS,gen_empty_fingerprint()) + CP.radarTimeStep = (1.0 / 8) # 8Hz + RI = RadarInterface(CP) + can_sock = messaging.sub_sock('can') + while 1: + can_strings = messaging.drain_sock_raw(can_sock, wait_for_one=True) + rr = RI.update(can_strings) + + if (rr is None): + continue + + print(chr(27) + "[2J") + + for pt in rr.points: + print (pt) diff --git a/selfdrive/car/tesla/speed_utils/__init__.py b/selfdrive/car/tesla/speed_utils/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/tesla/speed_utils/fleet_speed.py b/selfdrive/car/tesla/speed_utils/fleet_speed.py new file mode 100644 index 000000000..f78160535 --- /dev/null +++ b/selfdrive/car/tesla/speed_utils/fleet_speed.py @@ -0,0 +1,54 @@ +from selfdrive.car.tesla.speed_utils.movingaverage import MovingAverage + + +class FleetSpeed: + def __init__(self, average_speed_over_x_suggestions): + self.speed_avg = MovingAverage(average_speed_over_x_suggestions) + self.frame_last_adjustment = 0 + + def adjust(self, CS, max_speed_ms, frame): + if CS.mapAwareSpeed and self.is_valid(CS, max_speed_ms): + self.frame_last_adjustment = frame + # if max speed is greater than the speed limit, apply a relative offset to map speed + if ( + CS.rampType == 0 + and max_speed_ms > CS.speed_limit_ms > CS.map_suggested_speed + ): + return self.speed_avg.add( + max_speed_ms * CS.map_suggested_speed / CS.speed_limit_ms + ) + else: + return self.speed_avg.add(CS.map_suggested_speed) + return max_speed_ms + + def is_active(self, frame): + return ( + self.frame_last_adjustment > 0 and frame <= self.frame_last_adjustment + 10 + ) + + def reset_averager(self): + self.speed_avg.reset() + + @classmethod + def is_available(cls, CS): + return ( + CS.mapAwareSpeed + and CS.medianFleetSpeedMPS > 0 + and CS.splineLocConfidence > 60 + and CS.UI_splineID > 0 + ) + + @classmethod + def is_valid(cls, CS, max_speed_ms): + if CS.map_suggested_speed <= 0 or CS.map_suggested_speed > max_speed_ms: + return False + if CS.speed_limit_ms == 0: # no or unknown speed limit + if ( + CS.rampType == 0 and CS.map_suggested_speed >= 17 + ): # more than 61 kph / 38 mph, means we may be on a road without speed limit + return False + elif ( + CS.speed_limit_ms < CS.map_suggested_speed + ): # if map speed exceeds the speed limit, we'll ignore it + return False + return True \ No newline at end of file diff --git a/selfdrive/car/tesla/speed_utils/movingaverage.py b/selfdrive/car/tesla/speed_utils/movingaverage.py new file mode 100644 index 000000000..cc1dc8a6b --- /dev/null +++ b/selfdrive/car/tesla/speed_utils/movingaverage.py @@ -0,0 +1,21 @@ +import queue + + +class MovingAverage: + def __init__(self, length): + self.length = length + self.reset() + + def reset(self): + self.queue = queue.Queue(maxsize=self.length) + self.sum = 0 + + def add(self, sample): + if self.queue.full(): + self.sum -= self.queue.get_nowait() + self.queue.put_nowait(sample) + self.sum += sample + return self.sum / self.queue.qsize() + + def full(self): + return self.queue.full() \ No newline at end of file diff --git a/selfdrive/car/tesla/teslacan.py b/selfdrive/car/tesla/teslacan.py new file mode 100644 index 000000000..6df8565b2 --- /dev/null +++ b/selfdrive/car/tesla/teslacan.py @@ -0,0 +1,384 @@ +import copy +import crcmod +from opendbc.can.can_define import CANDefine +from common.numpy_fast import clip +from ctypes import create_string_buffer +import struct +from selfdrive.config import Conversions as CV +from selfdrive.car import make_can_msg +from selfdrive.car.tesla.values import CarControllerParams, CAN_CHASSIS, CAN_POWERTRAIN + +class TeslaCAN: + def __init__(self, dbc_name, packer, pt_packer): + self.can_define = CANDefine(dbc_name) + self.packer = packer + self.pt_packer = pt_packer + self.crc = crcmod.mkCrcFun(0x11d, initCrc=0x00, rev=False, xorOut=0xff) + + @staticmethod + def checksum(msg_id, dat): + # TODO: get message ID from name instead + ret = (msg_id & 0xFF) + ((msg_id >> 8) & 0xFF) + ret += sum(dat) + return ret & 0xFF + + def create_ibst_command(self, enabled, brake, raw_cnt, bus): + values = { + "BrakePositionCommand" : brake * 20, + "BrakeRelativeCommand": 0, + "BrakeMode": enabled * 2, + "Brake_Counter" : raw_cnt % 16, + } + data = self.packer.make_can_msg("ECU_BrakeCommand", bus, values)[2] + values["Brake_Checksum"] = self.crc(data[:5]) + return self.packer.make_can_msg("ECU_BrakeCommand", bus, values) + + def create_lane_message(self, lWidth, rLine, lLine, laneRange, curvC0, curvC1, curvC2, curvC3, lLane2,rLane2,bus, counter): + values = { + "DAS_leftLaneExists" : lLine, + "DAS_rightLaneExists" : rLine, + "DAS_virtualLaneWidth" : lWidth, + "DAS_virtualLaneViewRange" : laneRange, + "DAS_virtualLaneC0" : curvC0, + "DAS_virtualLaneC1" : curvC1, + "DAS_virtualLaneC2" : curvC2, + "DAS_virtualLaneC3" : curvC3, + "DAS_leftLineUsage" : lLine * 2, + "DAS_rightLineUsage" : rLine * 2, + "DAS_leftFork" : lLane2, + "DAS_rightFork" : rLane2, + "DAS_lanesCounter" : counter, + } + return self.packer.make_can_msg("DAS_lanes", bus, values) + + def create_lead_car_object_message(self, objectId, vType1,vId1,relevant1,dx1,vxrel1,dy1,vType2,vId2,relevant2,dx2,vxrel2,dy2,bus): + values = { + "DAS_objectId" : objectId, #0-Lead vehicles + "DAS_leadVehType" : vType1, + "DAS_leadVehRelevantForControl" : relevant1, + "DAS_leadVehDx" : dx1, + "DAS_leadVehVxRel" : vxrel1, + "DAS_leadVehDy" : dy1, + "DAS_leadVehId" : vId1, + "DAS_leadVeh2Type" : vType2, + "DAS_leadVeh2RelevantForControl" : relevant2, + "DAS_leadVeh2Dx" : dx2, + "DAS_leadVeh2VxRel" : vxrel2, + "DAS_leadVeh2Dy" : dy2, + "DAS_leadVeh2Id" : vId2, + } + return self.packer.make_can_msg("DAS_object", bus, values) + + def create_body_controls_message(self,turn,hazard,bus,counter): + values = { + "DAS_headlightRequest" : 0, + "DAS_hazardLightRequest" : 0, + "DAS_wiperSpeed" : 0, + "DAS_turnIndicatorRequest" : 0, + "DAS_highLowBeamDecision" : 3, + "DAS_highLowBeamOffReason" : 5, + "DAS_turnIndicatorRequestReason" : 0, + "DAS_bodyControlsCounter" : 1 , + "DAS_bodyControlsChecksum" : 0, + } + values["DAS_hazardLightRequest"] = hazard + values["DAS_turnIndicatorRequest"] = turn #0-off, 1-left 2-right + if turn > 0: + values["DAS_turnIndicatorRequestReason"] = 1 + else: + values["DAS_turnIndicatorRequestReason"] = 0 + + return self.packer.make_can_msg("DAS_bodyControls", bus, values) + + + def create_telemetry_road_info(self, lLineQualRaw, rLineQualRaw, alcaState, bus): + #alcaState -1 alca to left, 1 alca to right, 0 no alca now + rLineType = 7 + rLineColor = 0 + rLineQual = 0 + if rLineQualRaw > 0.15: + rLineType = 3 + rLineColor = 1 + if rLineQualRaw > 0.75: + rLineQual = 3 + elif rLineQualRaw > 0.5: + rLineQual = 2 + else: + rLineQual = 1 + lLineType = 7 + lLineColor = 0 + lLineQual = 0 + if lLineQualRaw > 0.45: + lLineType = 3 + lLineColor = 1 + if lLineQualRaw > 0.75: + lLineQual = 3 + elif lLineQualRaw > 0.5: + lLineQual = 2 + else: + lLineQual = 1 + values = { + "DAS_telemetryMultiplexer" : 0, + "DAS_telLeftLaneType" : lLineType, #0-undecided, 1-solid, 2-road edge, 3-dashed 4-double 5-botts dots 6-barrier + "DAS_telRightLaneType" : rLineType, #0-undecided, 1-solid, 2-road edge, 3-dashed 4-double 5-botts dots 6-barrier + "DAS_telLeftMarkerQuality" : lLineQual, # 0 LOWEST, 1 LOW, 2 MEDIUM, 3 HIGH + "DAS_telRightMarkerQuality" : rLineQual, # 0 LOWEST, 1 LOW, 2 MEDIUM, 3 HIGH + "DAS_telLeftMarkerColor" : lLineColor, # 0 UNKNOWN, 1 WHITE, 2 YELLOW, 3 BLUE + "DAS_telRightMarkerColor" : rLineColor, # 0 UNKNOWN, 1 WHITE, 2 YELLOW, 3 BLUE + "DAS_telLeftLaneCrossing" : 0 if alcaState != -1 else 1, #0 NOT CROSSING, 1 CROSSING + "DAS_telRightLaneCrossing" : 0 if alcaState != 1 else 1,#0 NOT CROSSING, 1 CROSSING + } + return self.packer.make_can_msg("DAS_telemetry", bus, values) + + def create_steering_control(self, angle, enabled, bus, counter): + values = { + "DAS_steeringAngleRequest": -angle, + "DAS_steeringHapticRequest": 0, + "DAS_steeringControlType": 1 if enabled else 0, #0-NONE, 1-ANGLE, 2-LKA, 3-Emergency LKA + "DAS_steeringControlCounter": counter, + "DAS_steeringControlChecksum": 0, + } + return self.packer.make_can_msg("DAS_steeringControl", bus, values) + + def create_ap1_long_control(self, in_drive, static_cruise, cruise_enabled, speed, accel_limits, jerk_limits, bus, counter): + accState = 0 + if in_drive: + accState = 4 + if static_cruise and cruise_enabled: + accState = 3 + values = { + "DAS_setSpeed" : clip(speed*3.6,0,410), #kph + "DAS_accState" : accState, # 4-ACC ON, 3-HOLD, 0-CANCEL + "DAS_aebEvent" : 0, # 0 - AEB NOT ACTIVE + "DAS_jerkMin" : clip(jerk_limits[0],-7.67,0), #m/s^3 -8.67,0 + "DAS_jerkMax" : clip(jerk_limits[1],0,7.67), #m/s^3 0,8.67 + "DAS_accelMin" : clip(accel_limits[0],-12,3.44), #m/s^2 -15,5.44 + "DAS_accelMax" : clip(accel_limits[1],-12,3.44), #m/s^2 -15,5.44 + "DAS_controlCounter": counter, + "DAS_controlChecksum" : 0, + } + return self.packer.make_can_msg("DAS_control", bus, values) + + def create_ap2_long_control(self, speed, accel_limits, jerk_limits, bus, counter): + locRequest = 0 + if speed == 0: + locRequest = 3 + else: + locRequest = 1 + values = { + "DAS_locMode" : 1, # 1- NORMAL + "DAS_locState" : 0, # 0-HEALTHY + "DAS_locRequest" : locRequest, # 0-IDLE,1-FORWARD,2-REVERSE,3-HOLD,4-PARK + "DAS_locJerkMin" : clip(jerk_limits[0],-7.67,0), #m/s^3 -8.67,0 + "DAS_locJerkMax" : clip(jerk_limits[1],0,7.67), #m/s^3 0,8.67 + "DAS_locSpeed" : clip(speed*3.6,0,200), #kph + "DAS_locAccelMin" : clip(accel_limits[0],-12,3.44), #m/s^2 -15,5.44 + "DAS_locAccelMax" : clip(accel_limits[1],-12,3.44), #m/s^2 -15,5.44 + "DAS_longControlCounter" : counter, # + "DAS_longControlChecksum" : 0, # + } + return self.packer.make_can_msg("DAS_longControl", bus, values) + + def create_das_warningMatrix0 (self, DAS_canErrors, DAS_025_steeringOverride, DAS_notInDrive, bus): + msg_id = 0x329 + msg_len = 8 + msg = create_string_buffer(msg_len) + struct.pack_into("BBBBBBBB", msg, 0, + 0,0,0,DAS_025_steeringOverride + (DAS_canErrors << 7),0,(DAS_notInDrive << 7),0,0) + return [msg_id, 0, msg.raw, bus] + + def create_das_warningMatrix1 (self, bus): + msg_id = 0x369 + msg_len = 8 + msg = create_string_buffer(msg_len) + struct.pack_into("BBBBBBBB", msg, 0, + 0,0,0,0,0,0,0,0) + return [msg_id, 0, msg.raw, bus] + + def create_das_warningMatrix3 (self, DAS_gas_to_resume, DAS_211_accNoSeatBelt, DAS_202_noisyEnvironment , DAS_206_apUnavailable, DAS_207_lkasUnavailable, + DAS_219_lcTempUnavailableSpeed, DAS_220_lcTempUnavailableRoad, DAS_221_lcAborting, DAS_222_accCameraBlind, + DAS_208_rackDetected, DAS_w216_driverOverriding, stopSignWarning, stopLightWarning, bus): + msg_id = 0x349 + msg_len = 8 + msg = create_string_buffer(msg_len) + struct.pack_into("BBBBBBBB", msg, 0, + (DAS_gas_to_resume << 1) + (stopSignWarning << 3) + (stopLightWarning << 4), + (DAS_202_noisyEnvironment << 1) + (DAS_206_apUnavailable << 5) + (DAS_207_lkasUnavailable << 6) + (DAS_208_rackDetected << 7), + (DAS_211_accNoSeatBelt << 2) + (DAS_w216_driverOverriding << 7), + (DAS_219_lcTempUnavailableSpeed << 2) + (DAS_220_lcTempUnavailableRoad << 3) + (DAS_221_lcAborting << 4) + (DAS_222_accCameraBlind << 5), + 0,0,0,0) + return [msg_id, 0, msg.raw, bus] + + + def create_das_status (self, DAS_op_status, DAS_collision_warning, + DAS_ldwStatus, DAS_hands_on_state, DAS_alca_state, + blindSpotLeft, blindSpotRight, + DAS_speed_limit_kph, DAS_fleetSpeedState, bus, counter): + values = { + "DAS_autopilotState" : DAS_op_status, + "DAS_blindSpotRearLeft" : 1 if blindSpotLeft else 0, + "DAS_blindSpotRearRight" : 1 if blindSpotRight else 0, + "DAS_fusedSpeedLimit" : DAS_speed_limit_kph, + "DAS_suppressSpeedWarning" : 0, + "DAS_summonObstacle" : 0, + "DAS_summonClearedGate" : 0, + "DAS_visionOnlySpeedLimit" : DAS_speed_limit_kph, + "DAS_heaterState" : 0, + "DAS_forwardCollisionWarning" : DAS_collision_warning, + "DAS_autoparkReady" : 0, + "DAS_autoParked" : 0, + "DAS_autoparkWaitingForBrake" : 0, + "DAS_summonFwdLeashReached" : 0, + "DAS_summonRvsLeashReached" : 0, + "DAS_sideCollisionAvoid" : 0, + "DAS_sideCollisionWarning" : 0, + "DAS_sideCollisionInhibit" : 0, + "DAS_lssState" : 0, #0-FAULT + "DAS_laneDepartureWarning" : DAS_ldwStatus, + "DAS_fleetSpeedState" : DAS_fleetSpeedState, + "DAS_autopilotHandsOnState" : DAS_hands_on_state, # 3 quiet, 5 with alerts + "DAS_autoLaneChangeState" : DAS_alca_state, + "DAS_summonAvailable" : 0, + "DAS_statusCounter" : counter, + "DAS_statusChecksum" : 0, + } + return self.packer.make_can_msg("DAS_status", bus, values) + + def create_das_status2(self, DAS_acc_speed_limit, fcw, bus, counter): + fcw_sig = 0x0F if fcw == 0 else 0x01 + values = { + "DAS_accSpeedLimit" : DAS_acc_speed_limit, + "DAS_pmmObstacleSeverity" : 0, + "DAS_pmmLoggingRequest" : 0, + "DAS_activationFailureStatus" : 0, + "DAS_pmmUltrasonicsFaultReason" : 0, + "DAS_pmmRadarFaultReason" : 0, + "DAS_pmmSysFaultReason" : 0, + "DAS_pmmCameraFaultReason" : 0, + "DAS_ACC_report" : 1, #ACC_report_target_CIPV + "DAS_csaState" : 2, #CSA_EXTERNAL_STATE_AVAILABLE + "DAS_radarTelemetry" : 1, #normal + "DAS_robState" : 2, #active + "DAS_driverInteractionLevel" : 0, + "DAS_ppOffsetDesiredRamp" : 0x80, + "DAS_longCollisionWarning" : fcw_sig, + "DAS_status2Counter" : counter, + "DAS_status2Checksum" : 0, + } + return self.packer.make_can_msg("DAS_status2", bus, values) + + def create_action_request(self, msg_stw_actn_req, button_to_press, bus, counter): + values = copy.copy(msg_stw_actn_req) + + values["SpdCtrlLvr_Stat"] = button_to_press + values["MC_STW_ACTN_RQ"] = counter + + data = self.packer.make_can_msg("STW_ACTN_RQ", bus, values)[2] + values["CRC_STW_ACTN_RQ"] = self.crc(data[:7]) + return self.packer.make_can_msg("STW_ACTN_RQ", bus, values) + + def create_fake_DAS_msg( + self, + speed_control_enabled, + speed_override, + apUnavailable, + collision_warning, + op_status, + acc_speed_kph, + turn_signal_needed, + forward_collission_warning, + adaptive_cruise, + hands_on_state, + cc_state, + pcc_available, + alca_state, + acc_speed_limit, # IC cruise speed, kph or mph + legal_speed_limit, + apply_angle, + enable_steer_control, + park_brake_request, + bus, + ): + units_included = 1 + c_apply_steer = int( + ((int(apply_angle * 10 + 0x4000)) & 0x7FFF) + (enable_steer_control << 15) + ) + dat = [ + int( + (speed_control_enabled << 7) + + (speed_override << 6) + + (apUnavailable << 5) + + (collision_warning << 4) + + op_status + ), + int(acc_speed_kph), + int( + (turn_signal_needed << 6) + + (units_included << 5) + + (forward_collission_warning << 4) + + (adaptive_cruise << 3) + + hands_on_state + ), + int((pcc_available << 5) + cc_state), + int( + acc_speed_limit + 0.5 + ), # IC rounds current speed, so we need to round cruise speed the same way + int( + (legal_speed_limit & 0x1F) + ((park_brake_request << 5) & 0x20) + (0x01 << 6) #new extended cc_state + ), # positions 7 and 6 not used yet + int(c_apply_steer & 0xFF), + int((c_apply_steer >> 8) & 0xFF) + ] + return make_can_msg(0x659, bytes(dat), bus) + + def create_pedal_command_msg(self,accelCommand, enable, idx, pedalcan): + """Create GAS_COMMAND (0x551) message to comma pedal""" + msg_id = 0x551 + msg_len = 6 + msg = create_string_buffer(msg_len) + m1 = 0.050796813 + m2 = 0.101593626 + d = -22.85856576 + if enable == 1: + int_accelCommand = int((accelCommand - d) / m1) + int_accelCommand2 = int((accelCommand - d) / m2) + else: + int_accelCommand = 0 + int_accelCommand2 = 0 + msg = create_string_buffer(msg_len) + struct.pack_into( + "BBBBB", + msg, + 0, + int((int_accelCommand >> 8) & 0xFF), + int_accelCommand & 0xFF, + int((int_accelCommand2 >> 8) & 0xFF), + int_accelCommand2 & 0xFF, + ((enable << 7) + idx) & 0xFF, + ) + struct.pack_into("B", msg, msg_len - 1, self.checksum(msg_id,msg.raw)) + return [msg_id, 0, msg.raw, pedalcan] + + #BBTODO: login for long control with ibooster + def create_longitudinal_commands(self, acc_state, speed, min_accel, max_accel, cnt, fingerprint): + messages = [] + values = { + "DAS_setSpeed": speed * CV.MS_TO_KPH, + "DAS_accState": acc_state, + "DAS_aebEvent": 0, + "DAS_jerkMin": CarControllerParams.JERK_LIMIT_MIN, + "DAS_jerkMax": CarControllerParams.JERK_LIMIT_MAX, + "DAS_accelMin": min_accel, + "DAS_accelMax": max_accel, + "DAS_controlCounter": (cnt % 8), + "DAS_controlChecksum": 0, + } + + #BBTODO: don't think we need to send on both.... gtw should forward + #also change counter and checksum so we mod on forward + for packer, bus in [(self.packer, CAN_CHASSIS), (self.pt_packer, CAN_POWERTRAIN[fingerprint])]: + if packer: + data = packer.make_can_msg("DAS_control", bus, values)[2] + values["DAS_controlChecksum"] = self.checksum(0x2b9, data[:7]) + messages.append(packer.make_can_msg("DAS_control", bus, values)) + return messages diff --git a/selfdrive/car/tesla/tinkla/bootanimation.zip b/selfdrive/car/tesla/tinkla/bootanimation.zip new file mode 100644 index 000000000..0adeacca9 Binary files /dev/null and b/selfdrive/car/tesla/tinkla/bootanimation.zip differ diff --git a/selfdrive/car/tesla/tunes.py b/selfdrive/car/tesla/tunes.py new file mode 100644 index 000000000..74edd3d82 --- /dev/null +++ b/selfdrive/car/tesla/tunes.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +from enum import Enum + + +class LongTunes(Enum): + PEDAL = 0 + ACC = 1 + AP = 2 + + +###### LONG ###### +def set_long_tune(tune, name): + # Improved longitudinal tune + if name == LongTunes.PEDAL: + tune.kpBP = [0., 5., 35.] + tune.kpV = [0.50, 0.45, 0.45] + tune.kiBP = [0., 5., 35.] + tune.kiV = [0.01,0.01,0.02] + + + # Default longitudinal tune + elif name == LongTunes.ACC: + tune.kpBP = [0] + tune.kiBP = [0] + tune.kpV = [0] + tune.kiV = [0] + elif name == LongTunes.AP: + tune.kpBP = [0] + tune.kiBP = [0] + tune.kpV = [0] + tune.kiV = [0] + else: + raise NotImplementedError('This longitudinal tune does not exist') diff --git a/selfdrive/car/tesla/values.py b/selfdrive/car/tesla/values.py new file mode 100644 index 000000000..345bd2c0d --- /dev/null +++ b/selfdrive/car/tesla/values.py @@ -0,0 +1,184 @@ +# flake8: noqa + +from collections import namedtuple +from selfdrive.car import dbc_dict +from cereal import car +from selfdrive.car.modules.CFG_module import load_bool_param + +Button = namedtuple('Button', ['event_type', 'can_addr', 'can_msg', 'values']) +AngleRateLimit = namedtuple('AngleRateLimit', ['speed_points', 'max_angle_diff_points']) + +class CAR: + AP2_MODELS = 'TESLA AP2 MODEL S' + AP1_MODELS = 'TESLA AP1 MODEL S' + PREAP_MODELS = 'TESLA MODEL S' + AP1_MODELX = 'TESLA AP1 MODEL X' + +FINGERPRINTS = { + CAR.AP2_MODELS: [ + { + 1: 8, 3: 8, 14: 8, 21: 4, 69: 8, 109: 4, 257: 3, 264: 8, 267: 5, 277: 6, 280: 6, 283: 5, 293: 4, 296: 4, 309: 5, 325: 8, 328: 5, 336: 8, 341: 8, 357: 8, 360: 7, 373: 8, 389: 8, 390: 7, 415: 8, 513: 5, 516: 8, 518: 8, 520: 4, 522: 8, 523: 7, 524: 8, 525: 4, 526: 8, 527: 8, 529: 8, 532: 3, 536: 8, 537: 3, 539: 8, 542: 8, 545: 8, 546: 2, 551: 5, 552: 2, 556: 8, 558: 8, 568: 8, 569: 8, 574: 8, 577: 8, 582: 5, 583: 8, 584: 4, 585: 8, 590: 8, 601: 8, 606: 8, 608: 1, 622: 8, 627: 6, 638: 8, 641: 8, 643: 8, 660: 5, 665: 8, 692: 8, 693: 8, 695: 8, 696: 8, 697: 8, 699: 8, 700: 8, 701: 8, 702: 8, 703: 8, 704: 8, 708: 8, 709: 8, 710: 8, 711: 8, 712: 8, 728: 8, 744: 8, 760: 8, 771: 2, 772: 8, 775: 8, 776: 8, 777: 8, 778: 8, 780: 2, 781: 8, 782: 8, 785: 8, 787: 8, 788: 8, 791: 8, 792: 8, 796: 2, 797: 8, 798: 6, 799: 8, 804: 8, 805: 8, 807: 8, 808: 1, 809: 8, 811: 8, 812: 8, 813: 8, 814: 5, 815: 8, 820: 8, 823: 8, 824: 8, 829: 8, 830: 5, 831:8, 836: 8, 840: 8, 841: 8, 843: 8, 845: 8, 846: 5, 848: 8, 849: 8, 852: 8, 853: 8, 856: 4, 857: 6, 859: 8, 861: 8, 862: 5, 863: 8, 872: 8, 875: 8, 876: 8, 877: 8, 878: 8, 879: 8, 880: 8, 882: 8, 884: 8, 888: 8, 889: 8, 893: 8, 894: 8, 896: 8, 901: 6, 904: 3, 905: 8, 906: 8, 907: 8, 908: 2, 909: 8, 910: 8, 912: 8, 920: 8, 921: 8, 925: 4, 926: 6, 936: 8, 941: 8, 949: 8, 952: 8, 953: 6, 957: 8, 968: 8, 969: 6, 970: 8, 971: 8, 973: 8, 977: 8, 984: 8, 986: 8, 987: 8, 989: 8, 990: 8, 1000: 8, 1001: 8, 1006: 8, 1007: 8, 1008: 8, 1010: 6, 1014: 1, 1015: 8, 1016: 8, 1017: 8, 1018: 8, 1019: 5, 1020: 8, 1026: 8, 1028: 8, 1029: 8, 1030: 8, 1032: 1, 1033: 1, 1034: 8, 1035: 6, 1048: 1, 1049: 8, 1061: 8, 1064: 8, 1065: 8, 1070: 8, 1080: 8, 1081: 8, 1097: 8, 1113: 8, 1129: 8, 1145: 8, 1160: 4, 1177: 8, 1281: 8, 1291: 8, 1307: 8, 1328: 8, 1329: 8, 1332: 8, 1335: 8, 1337: 8, 1339: 2, 1353: 8, 1361: 6, 1362: 6, 1368: 8, 1412: 8, 1436: 8, 1456: 8, 1463: 8, 1465: 8, 1469: 8, 1476: 8, 1481: 8, 1486: 8, 1497: 8, 1513: 8, 1519: 8, 1521: 8, 1524: 8, 1527: 8, 1593: 8, 1601: 8, 1605: 8, 1609: 8, 1610: 2, 1611: 8, 1614: 8, 1617: 8, 1621: 8, 1625: 8, 1627: 8, 1630: 8, 1800: 4, 1804: 8, 1812: 8, 1815: 8, 1816: 8, 1824: 8, 1828: 8, 1831: 8, 1832: 8, 1840: 8, 1848: 8, 1864: 8, 1880: 8, 1892: 8, 1896: 8, 1912: 8, 1960: 8, 1992: 8, 2008: 3, 2043: 5, 2045: 4 + }, + ], + CAR.AP1_MODELS: [ + { + 1: 8, 3: 8, 14: 8, 21: 4, 69: 8, 109: 4, 257: 3, 264: 8, 267: 5, 277: 6, 280: 6, 283: 5, 293: 4, 296: 4, 309: 5, 325: 8, 328: 5, 336: 8, 341: 8, 357: 8, 360: 7, 373: 8, 389: 8, 390: 7, 415: 8, 513: 5, 516: 8, 518: 8, 520: 4, 522: 8, 523: 7, 524: 8, 525: 4, 526: 8, 527: 8, 529: 8, 532: 3, 536: 8, 537: 3, 539: 8, 542: 8, 545: 8, 546: 2, 551: 5, 552: 2, 556: 8, 558: 8, 568: 8, 569: 8, 574: 8, 577: 8, 582: 5, 583: 8, 584: 4, 585: 8, 590: 8, 606: 8, 622: 8, 627: 6, 638: 8, 641: 8, 643: 8, 660: 5, 665: 8, 692: 8, 693: 8, 695: 8, 696: 8, 697: 8, 699: 8, 700: 8, 701: 8, 702: 8, 703: 8, 704: 8, 708: 8, 709: 8, 710: 8, 711: 8, 712: 8, 728: 8, 744: 8, 760: 8, 771: 2, 772: 8, 775: 8, 776: 8, 777: 8, 778: 8, 780: 2, 781: 8, 782: 8, 783: 8, 785: 8, 787: 8, 788: 8, 791: 8, 792: 8, 796: 2, 797: 8, 798: 6, 799: 8, 804: 8, 805: 8, 807: 8, 808: 1, 809: 8, 812: 8, 813: 8, 814: 5, 815: 8, 820: 8, 823: 8, 824: 8, 829: 8, 830: 5, 831: 8, 836: 8, 840: 8, 841: 8, 843: 8, 845: 8, 846: 5, 849: 8, 852: 8, 853: 8, 856: 4, 857: 6, 859: 8, 861: 8, 862: 5, 863: 8, 872: 8, 873: 8, 875: 8, 877: 8, 878: 8, 879: 8, 880: 8, 882: 8, 884: 8, 888: 8, 889: 8, 893: 8, 894: 8, 896: 8, 901: 6, 904: 3, 905: 8, 907: 8, 908: 2, 909: 8, 910: 8, 912: 8, 920: 8, 921: 8, 925: 4, 926: 6, 936: 8, 937: 8, 941: 8, 949: 8, 952: 8, 953: 6, 957: 8, 968: 8, 970: 8, 973: 8, 977: 8, 984: 8, 986: 8, 987: 8, 989: 8, 990: 8, 1000: 8, 1001: 8, 1006: 8, 1016: 8, 1019: 5, 1026: 8, 1028: 8, 1029: 8, 1030: 8, 1032: 1, 1033: 1, 1034: 8, 1035: 6, 1048: 1, 1064: 8, 1070: 8, 1080: 8, 1160: 4, 1281: 8, 1291: 8, 1307: 8, 1328: 8, 1329: 8, 1332: 8, 1335: 8, 1337: 8, 1339: 2, 1361: 6, 1362: 6, 1368: 8, 1412: 8, 1436: 8, 1456: 8, 1463: 8, 1465: 8, 1469: 8, 1476: 8, 1486: 8, 1497: 8, 1519: 8, 1521: 8, 1524: 8, 1527: 8, 1593: 8, 1601: 8, 1605: 8, 1609: 8, 1610: 2, 1611: 8, 1614: 8, 1617: 8, 1621: 8, 1625: 8, 1627: 8, 1630: 8, 1800: 4, 1804: 8, 1812: 8, 1815: 8, 1816: 8, 1824: 8, 1828: 8, 1831: 8, 1832: 8, 1840: 8, 1848: 8, 1864: 8, 1880: 8, 1892: 8, 1896: 8, 1912: 8, 1960: 8, 1992: 8, 2008: 3, 2043: 5, 2045: 4 + }, + { + 1: 8, 3: 8, 14: 8, 21: 4, 69: 8, 109: 4, 257: 3, 264: 8, 267: 5, 277: 6, 280: 6, 283: 5, 293: 4, 296: 4, 309: 5, 325: 8, 328: 5, 336: 8, 341: 8, 357: 8, 360: 7, 373: 8, 389: 8, 390: 7, 415: 8, 513: 5, 516: 8, 518: 8, 520: 4, 522: 8, 523: 7, 524: 8, 525: 4, 526: 8, 527: 8, 529: 8, 532: 3, 536: 8, 537: 3, 539: 8, 542: 8, 545: 8, 546: 2, 551: 5, 552: 2, 556: 8, 558: 8, 568: 8, 569: 8, 574: 8, 577: 8, 582: 5, 583: 8, 584: 4, 585: 8, 590: 8, 606: 8, 622: 8, 627: 6, 638: 8, 641: 8, 643: 8, 660: 3, 665: 8, 692: 8, 693: 8, 695: 8, 696: 8, 697: 8, 699: 8, 700: 8, 701: 8, 702: 8, 703: 8, 704: 8, 708: 8, 709: 8, 710: 8, 711: 8, 712: 8, 728: 8, 744: 8, 760: 8, 771: 2, 772: 8, 775: 8, 776: 8, 777: 8, 778: 8, 780: 2, 781: 8, 782: 8, 783: 8, 785: 8, 787: 8, 788: 8, 791: 8, 792: 8, 796: 2, 797: 8, 798: 6, 799: 8, 804: 8, 805: 8, 807: 8, 808: 1, 809: 8, 812: 8, 813: 8, 814: 5, 815: 8, 820: 8, 823: 8, 824: 8, 829: 8, 830: 5, 831: 8, 836: 8, 840: 8, 841: 8, 843: 8, 845: 8, 846: 5, 849: 8, 852: 8, 853: 8, 856: 4, 857: 5, 859: 8, 861: 8, 862: 5, 863: 8, 872: 8, 873: 8, 875: 8, 877: 8, 878: 8, 879: 8, 880: 8, 882: 8, 884: 8, 888: 8, 889: 8, 893: 8, 894: 8, 896: 8, 901: 6, 904: 3, 905: 8, 907: 8, 908: 2, 909: 8, 910: 8, 912: 8, 920: 8, 921: 8, 925: 4, 926: 6, 936: 8, 937: 8, 941: 8, 949: 8, 952: 8, 953: 6, 957: 8, 968: 8, 970: 8, 973: 8, 977: 8, 984: 8, 986: 8, 987: 8, 989: 8, 990: 8, 1000: 8, 1001: 8, 1006: 8, 1016: 8, 1019: 5, 1026: 8, 1028: 8, 1029: 8, 1030: 8, 1032: 1, 1033: 1, 1034: 8, 1035: 6, 1048: 1, 1064: 8, 1070: 8, 1080: 8, 1160: 4, 1281: 8, 1291: 8, 1307: 8, 1328: 8, 1329: 8, 1332: 8, 1335: 8, 1337: 8, 1339: 2, 1361: 6, 1362: 6, 1368: 8, 1412: 8, 1436: 8, 1456: 8, 1463: 8, 1465: 8, 1469: 8, 1476: 8, 1486: 8, 1497: 8, 1519: 8, 1521: 8, 1524: 8, 1527: 8, 1593: 8, 1601: 8, 1605: 8, 1609: 8, 1610: 2, 1611: 8, 1614: 8, 1617: 8, 1621: 8, 1625: 8, 1627: 8, 1630: 8, 1800: 4, 1804: 8, 1812: 8, 1815: 8, 1816: 8, 1824: 8, 1828: 8, 1831: 8, 1832: 8, 1840: 8, 1848: 8, 1864: 8, 1880: 8, 1892: 8, 1896: 8, 1912: 8, 1960: 8, 1992: 8, 2008: 3, 2043: 5, 2045: 4 + }, + ], + CAR.AP1_MODELX: [ + { + 1: 8, 3: 8, 14: 8, 21: 4, 69: 8, 109: 4, 257: 3, 264: 8, 267: 5, 277: 6, 280: 6, 283: 5, 293: 4, 296: 4, 309: 5, 325: 8, 328: 5, 336: 8, 341: 8, 360: 7, 373: 8, 389: 8, 390: 7, 415: 8, 516: 8, 518: 8, 520: 4, 522: 8, 523: 7, 524: 8, 525: 4, 526: 8, 527: 8, 529: 8, 532: 3, 536: 8, 537: 3, 539: 8, 542: 8, 545: 8, 546: 2, 551: 5, 552: 2, 556: 8, 558: 8, 568: 8, 569: 8, 574: 8, 577: 8, 582: 5, 583: 8, 584: 4, 585: 8, 590: 8, 606: 8, 622: 8, 627: 6, 638: 8, 641: 8, 643: 8, 660: 5, 665: 8, 692: 8, 693: 8, 695: 8, 696: 8, 697: 8, 699: 8, 700: 8, 701: 8, 702: 8, 703: 8, 704: 8, 708: 8, 709: 8, 710: 8, 711: 8, 712: 8, 728: 8, 744: 8, 753: 8, 760: 8, 771: 8, 772: 8, 775: 8, 776: 8, 777: 8, 778: 8, 780: 2, 781: 8, 782: 8, 783: 8, 785: 8, 787: 8, 788: 8, 791: 8, 792: 8, 796: 2, 797: 8, 798: 6, 799: 8, 804: 8, 805: 8, 807: 8, 808: 1, 809: 8, 812: 8, 813: 8, 814: 5, 815: 8, 820: 8, 823: 8, 824: 8, 829: 8, 830: 5, 831: 8, 836: 8, 840: 8, 841: 8, 843: 8, 845: 8, 846: 5, 849: 8, 852: 8, 853: 8, 856: 4, 857: 6, 859: 8, 861: 8, 862: 5, 863: 8, 872: 8, 873: 8, 875: 8, 877: 8, 878: 8, 879: 8, 880: 8, 881: 8, 882: 8, 884: 8, 888: 8, 891: 8, 893: 8, 896: 8, 901: 6, 904: 3, 905: 8, 907: 8, 908: 2, 909: 8, 910: 8, 912: 8, 920: 8, 921: 8, 925: 4, 926: 6, 936: 8, 937: 8, 941: 8, 949: 8, 952: 8, 953: 6, 957: 8, 968: 8, 970: 8, 973: 8, 977: 8, 984: 8, 986: 8, 987: 8, 989: 8, 990: 8, 1000: 8, 1001: 8, 1006: 8, 1016: 8, 1019: 5, 1026: 8, 1028: 8, 1029: 8, 1030: 8, 1032: 1, 1033: 1, 1034: 8, 1035: 6, 1048: 1, 1064: 8, 1070: 8, 1080: 8, 1160: 4, 1281: 8, 1291: 8, 1307: 8, 1328: 8, 1329: 8, 1332: 8, 1335: 8, 1337: 8, 1339: 2, 1361: 6, 1362: 6, 1368: 8, 1412: 8, 1416: 8, 1432: 8, 1436: 8, 1448: 8, 1456: 8, 1463: 8, 1465: 8, 1469: 8, 1476: 8, 1486: 8, 1497: 8, 1519: 8, 1521: 8, 1524: 8, 1527: 8, 1593: 8, 1601: 8, 1605: 8, 1609: 8, 1610: 2, 1611: 8, 1614: 8, 1617: 8, 1621: 8, 1625: 8, 1627: 8, 1630: 8, 1800: 4, 1804: 8, 1812: 8, 1815: 8, 1816: 8, 1824: 8, 1828: 8, 1831: 8, 1832: 8, 1840: 8, 1848: 8, 1864: 8, 1880: 8, 1892: 8, 1896: 8, 1912: 8, 1960: 8, 1992: 8, 2008: 3, 2043: 5, 2045: 4 + } + ], + CAR.PREAP_MODELS: [ + #for tesla with ibooster we need to actually force the fingerprint.... + { + # 2013 base model + 1: 8, 3: 8, 14: 8, 21: 4, 69: 8, 109: 4, 257: 3, 264: 8, 277: 6, 280: 6, 293: 4, 296: 4, 309: 5, 325: 8, 336: 8, 341: 8, 360: 7, 373: 8, 389: 8, 415: 8, 513: 5, 516: 8, 520: 4, 522: 8, 524: 8, 527: 8, 536: 8, 551: 4, 552: 2, 556: 8, 568: 8, 582: 5, 638: 8, 643: 8, 693: 8, 696: 8, 712: 8, 728: 8, 744: 8, 760: 8, 771: 2, 772: 8, 775: 8, 776: 8, 778: 8, 780: 2, 783: 8, 785: 8, 787: 8, 788: 8, 791: 8, 792: 8, 796: 2, 799: 8, 804: 8, 805: 8, 807: 8, 808: 1, 812: 8, 815: 8, 820: 8, 823: 8, 824: 8, 831: 8, 836: 8, 840: 8, 856: 4, 863: 8, 872: 8, 880: 8, 888: 8, 896: 8, 901: 6, 904: 3, 920: 8, 936: 8, 949: 8, 952: 8, 953: 6, 968: 8, 984: 8, 1000: 8, 1006: 8, 1026: 8, 1028: 8, 1029: 8, 1030: 8, 1032: 1, 1034: 8, 1048: 1, 1064: 8, 1080: 8, 1281: 8, 1285: 8, 1332: 8, 1335: 8, 1362: 6, 1368: 8, 1412: 8, 1436: 8, 1456: 8, 1463: 8, 1476: 8, 1524: 8, 1527: 8, 1601: 8, 1605: 8, 1617: 8, 1621: 8, 1800: 4, 1804: 8, 1812: 8, 1815: 8, 1816: 8, 1828: 8, 1831: 8, 1832: 8, 1840: 8, 1848: 8, 1864: 8, 1880: 8, 1892: 8, 1896: 8, 1912: 8, 1960: 8, 1992: 8, 2008: 3, 2043: 5 + } + ], + +} +dbc_file_name = 'tesla_can' +if not load_bool_param("TinklaPost1916Fix",True): + dbc_file_name = 'tesla_can_pre1916' + +DBC = { + CAR.AP2_MODELS: dbc_dict('tesla_powertrain', 'tesla_radar', chassis_dbc=dbc_file_name), + CAR.AP1_MODELS: dbc_dict(None, 'tesla_radar', chassis_dbc=dbc_file_name), + CAR.PREAP_MODELS: dbc_dict(None, 'tesla_radar', chassis_dbc=dbc_file_name), + CAR.AP1_MODELX: dbc_dict(None, 'tesla_radar', chassis_dbc=dbc_file_name), +} + +CAN_CHASSIS = { + CAR.AP2_MODELS: 0, + CAR.AP1_MODELS: 0, + CAR.PREAP_MODELS: 0, + CAR.AP1_MODELX: 0, +} + +CAN_RADAR = { + CAR.AP2_MODELS: 1, + CAR.AP1_MODELS: 1, + CAR.PREAP_MODELS: 1, + CAR.AP1_MODELX: 1, +} + +CAN_AUTOPILOT = { + CAR.AP2_MODELS: 2, + CAR.AP1_MODELS: 2, + CAR.PREAP_MODELS: -1, + CAR.AP1_MODELX: 2, +} + +CAN_EPAS = { + CAR.AP2_MODELS: 0, + CAR.AP1_MODELS: 0, + CAR.PREAP_MODELS: 0, + CAR.AP1_MODELX: 0, +} + +CAN_POWERTRAIN = { + CAR.AP2_MODELS: 4, + CAR.AP1_MODELS: 0, + CAR.PREAP_MODELS: -1, + CAR.AP1_MODELX: 4, +} + +CAN_AP_POWERTRAIN = { + CAR.AP2_MODELS: 6, + CAR.AP1_MODELS: 2, + CAR.PREAP_MODELS: -1, + CAR.AP1_MODELX: 6, +} + +class CANBUS: + # Lateral harness + chassis = 0 + radar = 1 + autopilot_chassis = 2 + + # Longitudinal harness + powertrain = 4 + private = 5 + autopilot_powertrain = 6 + +GEAR_MAP = { + "DI_GEAR_INVALID": car.CarState.GearShifter.unknown, + "DI_GEAR_P": car.CarState.GearShifter.park, + "DI_GEAR_R": car.CarState.GearShifter.reverse, + "DI_GEAR_N": car.CarState.GearShifter.neutral, + "DI_GEAR_D": car.CarState.GearShifter.drive, + "DI_GEAR_SNA": car.CarState.GearShifter.unknown, +} + +DOORS = ["DOOR_STATE_FL", "DOOR_STATE_FR", "DOOR_STATE_RL", "DOOR_STATE_RR", "DOOR_STATE_FrontTrunk", "BOOT_STATE"] + +# Make sure the message and addr is also in the CAN parser! +BUTTONS = [ + Button(car.CarState.ButtonEvent.Type.leftBlinker, "STW_ACTN_RQ", "TurnIndLvr_Stat", [1]), + Button(car.CarState.ButtonEvent.Type.rightBlinker, "STW_ACTN_RQ", "TurnIndLvr_Stat", [2]), + Button(car.CarState.ButtonEvent.Type.accelCruise, "STW_ACTN_RQ", "SpdCtrlLvr_Stat", [4, 16]), + Button(car.CarState.ButtonEvent.Type.decelCruise, "STW_ACTN_RQ", "SpdCtrlLvr_Stat", [8, 32]), + Button(car.CarState.ButtonEvent.Type.cancel, "STW_ACTN_RQ", "SpdCtrlLvr_Stat", [1]), + Button(car.CarState.ButtonEvent.Type.resumeCruise, "STW_ACTN_RQ", "SpdCtrlLvr_Stat", [2]), +] + +class CarControllerParams: + RATE_LIMIT_UP = AngleRateLimit(speed_points=[0., 5., 15.], max_angle_diff_points=[5., .8, .15]) + RATE_LIMIT_DOWN = AngleRateLimit(speed_points=[0., 5., 15.], max_angle_diff_points=[5., 3.5, 0.4]) + JERK_LIMIT_MAX = 8 + JERK_LIMIT_MIN = -8 + ACCEL_TO_SPEED_MULTIPLIER = 3 + ACCEL_TO_SPEED_MULTIPLIER_ACC = 1 + + +class CruiseButtons: + # VAL_ 69 SpdCtrlLvr_Stat 32 "DN_1ST" 16 "UP_1ST" 8 "DN_2ND" 4 "UP_2ND" 2 "RWD" 1 "FWD" 0 "IDLE" ; + RES_ACCEL = 16 + RES_ACCEL_2ND = 4 + DECEL_SET = 32 + DECEL_2ND = 8 + CANCEL = 1 + MAIN = 2 + IDLE = 0 + + @classmethod + def is_accel(cls, btn): + return btn in [cls.RES_ACCEL, cls.RES_ACCEL_2ND] + + @classmethod + def is_decel(cls, btn): + return btn in [cls.DECEL_SET, cls.DECEL_2ND] + + @classmethod + def should_be_throttled(cls, btn): + # Some buttons should not be spammed or they may overwhelm the SCCM. + return btn not in [cls.MAIN, cls.IDLE] + +class CruiseState: + # DI_cruiseState from the DBC + OFF = 0 + STANDBY = 1 + ENABLED = 2 + STANDSTILL = 3 + OVERRIDE = 4 + FAULT = 5 + PRE_FAULT = 6 + PRE_CANCEL = 7 + + @classmethod + def is_enabled_or_standby(cls, state): + return state in [cls.ENABLED, cls.STANDBY] + + @classmethod + def is_faulted(cls, state): + return state in [cls.PRE_FAULT, cls.FAULT] + + @classmethod + def is_off(cls, state): + return state in [cls.OFF] + \ No newline at end of file diff --git a/selfdrive/car/tests/__init__.py b/selfdrive/car/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/tests/test_car_interfaces.py b/selfdrive/car/tests/test_car_interfaces.py new file mode 100755 index 000000000..930619ee6 --- /dev/null +++ b/selfdrive/car/tests/test_car_interfaces.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +import unittest +import importlib +from parameterized import parameterized + +from cereal import car +from selfdrive.car.fingerprints import all_known_cars +from selfdrive.car.car_helpers import interfaces +from selfdrive.car.fingerprints import _FINGERPRINTS as FINGERPRINTS + +class TestCarInterfaces(unittest.TestCase): + + @parameterized.expand([(car,) for car in all_known_cars()]) + def test_car_interfaces(self, car_name): + print(car_name) + if car_name in FINGERPRINTS: + fingerprint = FINGERPRINTS[car_name][0] + else: + fingerprint = {} + + CarInterface, CarController, CarState = interfaces[car_name] + fingerprints = { + 0: fingerprint, + 1: fingerprint, + 2: fingerprint, + } + + car_fw = [] + + car_params = CarInterface.get_params(car_name, fingerprints, car_fw) + car_interface = CarInterface(car_params, CarController, CarState) + assert car_params + assert car_interface + + self.assertGreater(car_params.mass, 1) + self.assertGreater(car_params.steerRateCost, 1e-3) + + if car_params.steerControlType != car.CarParams.SteerControlType.angle: + tuning = car_params.lateralTuning.which() + if tuning == 'pid': + self.assertTrue(len(car_params.lateralTuning.pid.kpV)) + elif tuning == 'lqr': + self.assertTrue(len(car_params.lateralTuning.lqr.a)) + elif tuning == 'indi': + self.assertTrue(len(car_params.lateralTuning.indi.outerLoopGainV)) + + # Run car interface + CC = car.CarControl.new_message() + for _ in range(10): + car_interface.update(CC, []) + car_interface.apply(CC) + car_interface.apply(CC) + + CC = car.CarControl.new_message() + CC.enabled = True + for _ in range(10): + car_interface.update(CC, []) + car_interface.apply(CC) + car_interface.apply(CC) + + # Test radar interface + RadarInterface = importlib.import_module(f'selfdrive.car.{car_params.carName}.radar_interface').RadarInterface + radar_interface = RadarInterface(car_params) + assert radar_interface + + # Run radar interface once + radar_interface.update([]) + if not car_params.radarOffCan and hasattr(radar_interface, '_update') and hasattr(radar_interface, 'trigger_msg'): + radar_interface._update([radar_interface.trigger_msg]) + +if __name__ == "__main__": + unittest.main() diff --git a/selfdrive/car/toyota/__init__.py b/selfdrive/car/toyota/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py new file mode 100644 index 000000000..0cf48b0d5 --- /dev/null +++ b/selfdrive/car/toyota/carcontroller.py @@ -0,0 +1,145 @@ +from cereal import car +from common.numpy_fast import clip, interp +from selfdrive.car import apply_toyota_steer_torque_limits, create_gas_interceptor_command, make_can_msg +from selfdrive.car.toyota.toyotacan import create_steer_command, create_ui_command, \ + create_accel_command, create_acc_cancel_command, \ + create_fcw_command, create_lta_steer_command +from selfdrive.car.toyota.values import CAR, STATIC_DSU_MSGS, NO_STOP_TIMER_CAR, TSS2_CAR, \ + MIN_ACC_SPEED, PEDAL_TRANSITION, CarControllerParams +from opendbc.can.packer import CANPacker +VisualAlert = car.CarControl.HUDControl.VisualAlert + + +class CarController(): + def __init__(self, dbc_name, CP, VM): + self.last_steer = 0 + self.alert_active = False + self.last_standstill = False + self.standstill_req = False + self.steer_rate_limited = False + + self.enable_aeb_gateway = load_bool_param("ToyotaUseAEBgateway",False) + + self.packer = CANPacker(dbc_name) + self.gas = 0 + self.accel = 0 + + def update(self, enabled, active, CS, frame, actuators, pcm_cancel_cmd, hud_alert, + left_line, right_line, lead, left_lane_depart, right_lane_depart): + + # gas and brake + if CS.CP.enableGasInterceptor and active: + MAX_INTERCEPTOR_GAS = 0.5 + # RAV4 has very sensitive gas pedal + if CS.CP.carFingerprint in (CAR.RAV4, CAR.RAV4H, CAR.HIGHLANDER, CAR.HIGHLANDERH): + PEDAL_SCALE = interp(CS.out.vEgo, [0.0, MIN_ACC_SPEED, MIN_ACC_SPEED + PEDAL_TRANSITION], [0.15, 0.3, 0.0]) + elif CS.CP.carFingerprint in (CAR.COROLLA,): + PEDAL_SCALE = interp(CS.out.vEgo, [0.0, MIN_ACC_SPEED, MIN_ACC_SPEED + PEDAL_TRANSITION], [0.3, 0.4, 0.0]) + else: + PEDAL_SCALE = interp(CS.out.vEgo, [0.0, MIN_ACC_SPEED, MIN_ACC_SPEED + PEDAL_TRANSITION], [0.4, 0.5, 0.0]) + # offset for creep and windbrake + pedal_offset = interp(CS.out.vEgo, [0.0, 2.3, MIN_ACC_SPEED + PEDAL_TRANSITION], [-.4, 0.0, 0.2]) + pedal_command = PEDAL_SCALE * (actuators.accel + pedal_offset) + interceptor_gas_cmd = clip(pedal_command, 0., MAX_INTERCEPTOR_GAS) + else: + interceptor_gas_cmd = 0. + pcm_accel_cmd = clip(actuators.accel, CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX) + + # steer torque + new_steer = int(round(actuators.steer * CarControllerParams.STEER_MAX)) + apply_steer = apply_toyota_steer_torque_limits(new_steer, self.last_steer, CS.out.steeringTorqueEps, CarControllerParams) + self.steer_rate_limited = new_steer != apply_steer + + # Cut steering while we're in a known fault state (2s) + if not enabled or CS.steer_state in (9, 25) or CS.human_control: + apply_steer = 0 + apply_steer_req = 0 + else: + apply_steer_req = 1 + + # TODO: probably can delete this. CS.pcm_acc_status uses a different signal + # than CS.cruiseState.enabled. confirm they're not meaningfully different + if not enabled and CS.pcm_acc_status: + pcm_cancel_cmd = 1 + + # on entering standstill, send standstill request + if CS.out.standstill and not self.last_standstill and CS.CP.carFingerprint not in NO_STOP_TIMER_CAR: + self.standstill_req = True + if CS.pcm_acc_status != 8: + # pcm entered standstill or it's disabled + self.standstill_req = False + + self.last_steer = apply_steer + self.last_standstill = CS.out.standstill + + can_sends = [] + + #*** control msgs *** + #print("steer {0} {1} {2} {3}".format(apply_steer, min_lim, max_lim, CS.steer_torque_motor) + + # toyota can trace shows this message at 42Hz, with counter adding alternatively 1 and 2; + # sending it at 100Hz seem to allow a higher rate limit, as the rate limit seems imposed + # on consecutive messages + can_sends.append(create_steer_command(self.packer, apply_steer, apply_steer_req, frame)) + if frame % 2 == 0 and CS.CP.carFingerprint in TSS2_CAR: + can_sends.append(create_lta_steer_command(self.packer, 0, 0, frame // 2)) + + # LTA mode. Set ret.steerControlType = car.CarParams.SteerControlType.angle and whitelist 0x191 in the panda + # if frame % 2 == 0: + # can_sends.append(create_steer_command(self.packer, 0, 0, frame // 2)) + # can_sends.append(create_lta_steer_command(self.packer, actuators.steeringAngleDeg, apply_steer_req, frame // 2)) + + # we can spam can to cancel the system even if we are using lat only control + if (frame % 3 == 0 and CS.CP.openpilotLongitudinalControl) or pcm_cancel_cmd: + lead = lead or CS.out.vEgo < 12. # at low speed we always assume the lead is present so ACC can be engaged + + # Lexus IS uses a different cancellation message + if pcm_cancel_cmd and CS.CP.carFingerprint in (CAR.LEXUS_IS, CAR.LEXUS_RC): + can_sends.append(create_acc_cancel_command(self.packer)) + elif CS.CP.openpilotLongitudinalControl: + if self.enable_aeb_gateway: + can_sends.append(create_accel_command_alt(self.packer, pcm_accel_cmd, pcm_cancel_cmd, self.standstill_req, lead)) + else: + can_sends.append(create_accel_command(self.packer, pcm_accel_cmd, pcm_cancel_cmd, self.standstill_req, lead, CS.acc_type)) + self.accel = pcm_accel_cmd + else: + can_sends.append(create_accel_command(self.packer, 0, pcm_cancel_cmd, False, lead, CS.acc_type)) + + if frame % 2 == 0 and CS.CP.enableGasInterceptor and CS.CP.openpilotLongitudinalControl: + # send exactly zero if gas cmd is zero. Interceptor will send the max between read value and gas cmd. + # This prevents unexpected pedal range rescaling + can_sends.append(create_gas_interceptor_command(self.packer, interceptor_gas_cmd, frame // 2)) + self.gas = interceptor_gas_cmd + + # ui mesg is at 1Hz but we send asap if: + # - there is something to display + # - there is something to stop displaying + fcw_alert = hud_alert == VisualAlert.fcw + steer_alert = hud_alert in (VisualAlert.steerRequired, VisualAlert.ldw) + + send_ui = False + if ((fcw_alert or steer_alert) and not self.alert_active) or \ + (not (fcw_alert or steer_alert) and self.alert_active): + send_ui = True + self.alert_active = not self.alert_active + elif pcm_cancel_cmd: + # forcing the pcm to disengage causes a bad fault sound so play a good sound instead + send_ui = True + + if (frame % 100 == 0 or send_ui): + can_sends.append(create_ui_command(self.packer, steer_alert, pcm_cancel_cmd, left_line, right_line, left_lane_depart, right_lane_depart, enabled)) + + if frame % 100 == 0 and CS.CP.enableDsu: + can_sends.append(create_fcw_command(self.packer, fcw_alert)) + + # *** static msgs *** + for (addr, cars, bus, fr_step, vl) in STATIC_DSU_MSGS: + if frame % fr_step == 0 and CS.CP.enableDsu and CS.CP.carFingerprint in cars: + can_sends.append(make_can_msg(addr, vl, bus)) + + new_actuators = actuators.copy() + new_actuators.steer = apply_steer / CarControllerParams.STEER_MAX + new_actuators.accel = self.accel + new_actuators.gas = self.gas + + return new_actuators, can_sends diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py new file mode 100644 index 000000000..21e73a319 --- /dev/null +++ b/selfdrive/car/toyota/carstate.py @@ -0,0 +1,225 @@ +from cereal import car +from common.numpy_fast import mean +from common.filter_simple import FirstOrderFilter +from common.realtime import DT_CTRL +from opendbc.can.can_define import CANDefine +from selfdrive.car.interfaces import CarStateBase +from opendbc.can.parser import CANParser +from selfdrive.config import Conversions as CV +from selfdrive.car.toyota.values import ToyotaFlags, CAR, DBC, STEER_THRESHOLD, NO_STOP_TIMER_CAR, TSS2_CAR, EPS_SCALE + + +class CarState(CarStateBase): + def __init__(self, CP): + super().__init__(CP) + can_define = CANDefine(DBC[CP.carFingerprint]["pt"]) + self.shifter_values = can_define.dv["GEAR_PACKET"]["GEAR"] + self.eps_torque_scale = EPS_SCALE[CP.carFingerprint] / 100. + + # On cars with cp.vl["STEER_TORQUE_SENSOR"]["STEER_ANGLE"] + # the signal is zeroed to where the steering angle is at start. + # Need to apply an offset as soon as the steering angle measurements are both received + self.needs_angle_offset = True + self.accurate_steer_angle_seen = False + self.angle_offset = FirstOrderFilter(None, 60.0, DT_CTRL, initialized=False) + + self.low_speed_lockout = False + self.acc_type = 1 + + def update(self, cp, cp_cam): + ret = car.CarState.new_message() + + ret.doorOpen = any([cp.vl["BODY_CONTROL_STATE"]["DOOR_OPEN_FL"], cp.vl["BODY_CONTROL_STATE"]["DOOR_OPEN_FR"], + cp.vl["BODY_CONTROL_STATE"]["DOOR_OPEN_RL"], cp.vl["BODY_CONTROL_STATE"]["DOOR_OPEN_RR"]]) + ret.seatbeltUnlatched = cp.vl["BODY_CONTROL_STATE"]["SEATBELT_DRIVER_UNLATCHED"] != 0 + + ret.brakePressed = cp.vl["BRAKE_MODULE"]["BRAKE_PRESSED"] != 0 + ret.brakeHoldActive = cp.vl["ESP_CONTROL"]["BRAKE_HOLD_ACTIVE"] == 1 + if self.CP.enableGasInterceptor: + ret.gas = (cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"]) / 2. + ret.gasPressed = ret.gas > 15 + else: + # TODO: find a new, common signal + msg = "GAS_PEDAL_HYBRID" if (self.CP.flags & ToyotaFlags.HYBRID) else "GAS_PEDAL" + ret.gas = cp.vl[msg]["GAS_PEDAL"] + ret.gasPressed = cp.vl["PCM_CRUISE"]["GAS_RELEASED"] == 0 + + ret.wheelSpeeds = self.get_wheel_speeds( + cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_FL"], + cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_FR"], + cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_RL"], + cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_RR"], + ) + ret.vEgoRaw = mean([ret.wheelSpeeds.fl, ret.wheelSpeeds.fr, ret.wheelSpeeds.rl, ret.wheelSpeeds.rr]) + ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) + + ret.standstill = ret.vEgoRaw < 0.001 + + ret.steeringAngleDeg = cp.vl["STEER_ANGLE_SENSOR"]["STEER_ANGLE"] + cp.vl["STEER_ANGLE_SENSOR"]["STEER_FRACTION"] + torque_sensor_angle_deg = cp.vl["STEER_TORQUE_SENSOR"]["STEER_ANGLE"] + + # Some newer models have a more accurate angle measurement in the TORQUE_SENSOR message. Use if non-zero + if abs(torque_sensor_angle_deg) > 1e-3: + self.accurate_steer_angle_seen = True + + if self.accurate_steer_angle_seen: + # Offset seems to be invalid for large steering angles + if abs(ret.steeringAngleDeg) < 90 and cp.can_valid: + self.angle_offset.update(torque_sensor_angle_deg - ret.steeringAngleDeg) + + if self.angle_offset.initialized: + ret.steeringAngleOffsetDeg = self.angle_offset.x + ret.steeringAngleDeg = torque_sensor_angle_deg - self.angle_offset.x + + ret.steeringRateDeg = cp.vl["STEER_ANGLE_SENSOR"]["STEER_RATE"] + + can_gear = int(cp.vl["GEAR_PACKET"]["GEAR"]) + ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(can_gear, None)) + ret.leftBlinker = cp.vl["BLINKERS_STATE"]['TURN_SIGNALS'] == 1 + ret.rightBlinker = cp.vl["BLINKERS_STATE"]['TURN_SIGNALS'] == 2 + self.turnSignalStalkState = cp.vl["BLINKERS_STATE"]['TURN_SIGNALS'] + + ret.steeringTorque = cp.vl["STEER_TORQUE_SENSOR"]["STEER_TORQUE_DRIVER"] + ret.steeringTorqueEps = cp.vl["STEER_TORQUE_SENSOR"]["STEER_TORQUE_EPS"] * self.eps_torque_scale + # we could use the override bit from dbc, but it's triggered at too high torque values + ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD + ret.steerWarning = cp.vl["EPS_STATUS"]["LKA_STATE"] not in (1, 5) + + if self.CP.carFingerprint in (CAR.LEXUS_IS, CAR.LEXUS_RC): + ret.cruiseState.available = cp.vl["DSU_CRUISE"]["MAIN_ON"] != 0 + ret.cruiseState.speed = cp.vl["DSU_CRUISE"]["SET_SPEED"] * CV.KPH_TO_MS + else: + ret.cruiseState.available = cp.vl["PCM_CRUISE_2"]["MAIN_ON"] != 0 + ret.cruiseState.speed = cp.vl["PCM_CRUISE_2"]["SET_SPEED"] * CV.KPH_TO_MS + + if self.CP.carFingerprint in TSS2_CAR: + self.acc_type = cp_cam.vl["ACC_CONTROL"]["ACC_TYPE"] + + # some TSS2 cars have low speed lockout permanently set, so ignore on those cars + # these cars are identified by an ACC_TYPE value of 2. + # TODO: it is possible to avoid the lockout and gain stop and go if you + # send your own ACC_CONTROL msg on startup with ACC_TYPE set to 1 + if (self.CP.carFingerprint not in TSS2_CAR and self.CP.carFingerprint not in (CAR.LEXUS_IS, CAR.LEXUS_RC)) or \ + (self.CP.carFingerprint in TSS2_CAR and self.acc_type == 1): + self.low_speed_lockout = cp.vl["PCM_CRUISE_2"]["LOW_SPEED_LOCKOUT"] == 2 + + self.pcm_acc_status = cp.vl["PCM_CRUISE"]["CRUISE_STATE"] + if self.CP.carFingerprint in NO_STOP_TIMER_CAR or self.CP.enableGasInterceptor: + # ignore standstill in hybrid vehicles, since pcm allows to restart without + # receiving any special command. Also if interceptor is detected + ret.cruiseState.standstill = False + else: + ret.cruiseState.standstill = self.pcm_acc_status == 7 + ret.cruiseState.enabled = bool(cp.vl["PCM_CRUISE"]["CRUISE_ACTIVE"]) + ret.cruiseState.nonAdaptive = cp.vl["PCM_CRUISE"]["CRUISE_STATE"] in (1, 2, 3, 4, 5, 6) + + ret.genericToggle = bool(cp.vl["LIGHT_STALK"]["AUTO_HIGH_BEAM"]) + ret.stockAeb = bool(cp_cam.vl["PRE_COLLISION"]["PRECOLLISION_ACTIVE"] and cp_cam.vl["PRE_COLLISION"]["FORCE"] < -1e-5) + + ret.espDisabled = cp.vl["ESP_CONTROL"]["TC_DISABLED"] != 0 + # 2 is standby, 10 is active. TODO: check that everything else is really a faulty state + self.steer_state = cp.vl["EPS_STATUS"]["LKA_STATE"] + + if self.CP.enableBsm: + ret.leftBlindspot = (cp.vl["BSM"]["L_ADJACENT"] == 1) or (cp.vl["BSM"]["L_APPROACHING"] == 1) + ret.rightBlindspot = (cp.vl["BSM"]["R_ADJACENT"] == 1) or (cp.vl["BSM"]["R_APPROACHING"] == 1) + + return ret + + @staticmethod + def get_can_parser(CP): + signals = [ + # sig_name, sig_address + ("STEER_ANGLE", "STEER_ANGLE_SENSOR"), + ("GEAR", "GEAR_PACKET"), + ("BRAKE_PRESSED", "BRAKE_MODULE"), + ("WHEEL_SPEED_FL", "WHEEL_SPEEDS"), + ("WHEEL_SPEED_FR", "WHEEL_SPEEDS"), + ("WHEEL_SPEED_RL", "WHEEL_SPEEDS"), + ("WHEEL_SPEED_RR", "WHEEL_SPEEDS"), + ("DOOR_OPEN_FL", "BODY_CONTROL_STATE"), + ("DOOR_OPEN_FR", "BODY_CONTROL_STATE"), + ("DOOR_OPEN_RL", "BODY_CONTROL_STATE"), + ("DOOR_OPEN_RR", "BODY_CONTROL_STATE"), + ("SEATBELT_DRIVER_UNLATCHED", "BODY_CONTROL_STATE"), + ("TC_DISABLED", "ESP_CONTROL"), + ("BRAKE_HOLD_ACTIVE", "ESP_CONTROL"), + ("STEER_FRACTION", "STEER_ANGLE_SENSOR"), + ("STEER_RATE", "STEER_ANGLE_SENSOR"), + ("CRUISE_ACTIVE", "PCM_CRUISE"), + ("CRUISE_STATE", "PCM_CRUISE"), + ("GAS_RELEASED", "PCM_CRUISE"), + ("STEER_TORQUE_DRIVER", "STEER_TORQUE_SENSOR"), + ("STEER_TORQUE_EPS", "STEER_TORQUE_SENSOR"), + ("STEER_ANGLE", "STEER_TORQUE_SENSOR"), + ("TURN_SIGNALS", "BLINKERS_STATE"), + ("LKA_STATE", "EPS_STATUS"), + ("AUTO_HIGH_BEAM", "LIGHT_STALK"), + ] + + checks = [ + ("GEAR_PACKET", 1), + ("LIGHT_STALK", 1), + ("BLINKERS_STATE", 0.15), + ("BODY_CONTROL_STATE", 3), + ("ESP_CONTROL", 3), + ("EPS_STATUS", 25), + ("BRAKE_MODULE", 40), + ("WHEEL_SPEEDS", 80), + ("STEER_ANGLE_SENSOR", 80), + ("PCM_CRUISE", 33), + ("STEER_TORQUE_SENSOR", 50), + ] + + if CP.flags & ToyotaFlags.HYBRID: + signals.append(("GAS_PEDAL", "GAS_PEDAL_HYBRID")) + checks.append(("GAS_PEDAL_HYBRID", 33)) + else: + signals.append(("GAS_PEDAL", "GAS_PEDAL")) + checks.append(("GAS_PEDAL", 33)) + + if CP.carFingerprint in (CAR.LEXUS_IS, CAR.LEXUS_RC): + signals.append(("MAIN_ON", "DSU_CRUISE")) + signals.append(("SET_SPEED", "DSU_CRUISE")) + checks.append(("DSU_CRUISE", 5)) + else: + signals.append(("MAIN_ON", "PCM_CRUISE_2")) + signals.append(("SET_SPEED", "PCM_CRUISE_2")) + signals.append(("LOW_SPEED_LOCKOUT", "PCM_CRUISE_2")) + checks.append(("PCM_CRUISE_2", 33)) + + # add gas interceptor reading if we are using it + if CP.enableGasInterceptor: + signals.append(("INTERCEPTOR_GAS", "GAS_SENSOR")) + signals.append(("INTERCEPTOR_GAS2", "GAS_SENSOR")) + checks.append(("GAS_SENSOR", 50)) + + if CP.enableBsm: + signals += [ + ("L_ADJACENT", "BSM"), + ("L_APPROACHING", "BSM"), + ("R_ADJACENT", "BSM"), + ("R_APPROACHING", "BSM"), + ] + checks.append(("BSM", 1)) + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 0) + + @staticmethod + def get_cam_can_parser(CP): + signals = [ + ("FORCE", "PRE_COLLISION"), + ("PRECOLLISION_ACTIVE", "PRE_COLLISION"), + ] + + # use steering message to check if panda is connected to frc + checks = [ + ("STEERING_LKA", 42), + ("PRE_COLLISION", 0), # TODO: figure out why freq is inconsistent + ] + + if CP.carFingerprint in TSS2_CAR: + signals.append(("ACC_TYPE", "ACC_CONTROL")) + checks.append(("ACC_CONTROL", 33)) + + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 2) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py new file mode 100644 index 000000000..2757b49b1 --- /dev/null +++ b/selfdrive/car/toyota/interface.py @@ -0,0 +1,279 @@ +#!/usr/bin/env python3 +from cereal import car +from selfdrive.config import Conversions as CV +from selfdrive.car.toyota.tunes import LatTunes, LongTunes, set_long_tune, set_lat_tune +from selfdrive.car.toyota.values import Ecu, CAR, ToyotaFlags, TSS2_CAR, NO_DSU_CAR, MIN_ACC_SPEED, EPS_SCALE, CarControllerParams +from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config +from selfdrive.car.interfaces import CarInterfaceBase + +EventName = car.CarEvent.EventName + + +class CarInterface(CarInterfaceBase): + @staticmethod + def get_pid_accel_limits(CP, current_speed, cruise_speed): + return CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX + + @staticmethod + def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[]): # pylint: disable=dangerous-default-value + ret = CarInterfaceBase.get_std_params(candidate, fingerprint) + + ret.carName = "toyota" + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.toyota)] + ret.safetyConfigs[0].safetyParam = EPS_SCALE[candidate] + + ret.steerActuatorDelay = 0.12 # Default delay, Prius has larger delay + ret.steerLimitTimer = 0.4 + ret.stoppingControl = False # Toyota starts braking more when it thinks you want to stop + + stop_and_go = False + + if candidate == CAR.PRIUS: + stop_and_go = True + ret.wheelbase = 2.70 + ret.steerRatio = 15.74 # unknown end-to-end spec + tire_stiffness_factor = 0.6371 # hand-tune + ret.mass = 3045. * CV.LB_TO_KG + STD_CARGO_KG + + set_lat_tune(ret.lateralTuning, LatTunes.INDI_PRIUS) + ret.steerActuatorDelay = 0.3 + + elif candidate == CAR.PRIUS_V: + stop_and_go = True + ret.wheelbase = 2.78 + ret.steerRatio = 17.4 + tire_stiffness_factor = 0.5533 + ret.mass = 4387. * CV.LB_TO_KG + STD_CARGO_KG + set_lat_tune(ret.lateralTuning, LatTunes.LQR_RAV4) + + elif candidate in (CAR.RAV4, CAR.RAV4H): + stop_and_go = True if (candidate in CAR.RAV4H) else False + ret.wheelbase = 2.65 + ret.steerRatio = 16.88 # 14.5 is spec end-to-end + tire_stiffness_factor = 0.5533 + ret.mass = 3650. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid + set_lat_tune(ret.lateralTuning, LatTunes.LQR_RAV4) + + elif candidate == CAR.COROLLA: + ret.wheelbase = 2.70 + ret.steerRatio = 18.27 + tire_stiffness_factor = 0.444 # not optimized yet + ret.mass = 2860. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid + set_lat_tune(ret.lateralTuning, LatTunes.PID_A) + + elif candidate in (CAR.LEXUS_RX, CAR.LEXUS_RXH, CAR.LEXUS_RX_TSS2, CAR.LEXUS_RXH_TSS2): + stop_and_go = True + ret.wheelbase = 2.79 + ret.steerRatio = 16. # 14.8 is spec end-to-end + ret.wheelSpeedFactor = 1.035 + tire_stiffness_factor = 0.5533 + ret.mass = 4481. * CV.LB_TO_KG + STD_CARGO_KG # mean between min and max + set_lat_tune(ret.lateralTuning, LatTunes.PID_C) + + elif candidate in (CAR.CHR, CAR.CHRH): + stop_and_go = True + ret.wheelbase = 2.63906 + ret.steerRatio = 13.6 + tire_stiffness_factor = 0.7933 + ret.mass = 3300. * CV.LB_TO_KG + STD_CARGO_KG + set_lat_tune(ret.lateralTuning, LatTunes.PID_F) + + elif candidate in (CAR.CAMRY, CAR.CAMRYH, CAR.CAMRY_TSS2, CAR.CAMRYH_TSS2): + stop_and_go = True + ret.wheelbase = 2.82448 + ret.steerRatio = 13.7 + tire_stiffness_factor = 0.7933 + ret.mass = 3400. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid + set_lat_tune(ret.lateralTuning, LatTunes.PID_C) + + elif candidate in (CAR.HIGHLANDER_TSS2, CAR.HIGHLANDERH_TSS2): + stop_and_go = True + ret.wheelbase = 2.84988 # 112.2 in = 2.84988 m + ret.steerRatio = 16.0 + tire_stiffness_factor = 0.8 + ret.mass = 4700. * CV.LB_TO_KG + STD_CARGO_KG # 4260 + 4-5 people + set_lat_tune(ret.lateralTuning, LatTunes.PID_G) + + elif candidate in (CAR.HIGHLANDER, CAR.HIGHLANDERH): + stop_and_go = True + ret.wheelbase = 2.78 + ret.steerRatio = 16.0 + tire_stiffness_factor = 0.8 + ret.mass = 4607. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid limited + set_lat_tune(ret.lateralTuning, LatTunes.PID_G) + + elif candidate in (CAR.AVALON, CAR.AVALON_2019, CAR.AVALONH_2019, CAR.AVALON_TSS2): + ret.wheelbase = 2.82 + ret.steerRatio = 14.8 # Found at https://pressroom.toyota.com/releases/2016+avalon+product+specs.download + tire_stiffness_factor = 0.7983 + ret.mass = 3505. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid + set_lat_tune(ret.lateralTuning, LatTunes.PID_H) + + elif candidate in (CAR.RAV4_TSS2, CAR.RAV4H_TSS2): + stop_and_go = True + ret.wheelbase = 2.68986 + ret.steerRatio = 14.3 + tire_stiffness_factor = 0.7933 + ret.mass = 3585. * CV.LB_TO_KG + STD_CARGO_KG # Average between ICE and Hybrid + set_lat_tune(ret.lateralTuning, LatTunes.PID_D) + + # 2019+ Rav4 TSS2 uses two different steering racks and specific tuning seems to be necessary. + # See https://github.com/commaai/openpilot/pull/21429#issuecomment-873652891 + for fw in car_fw: + if fw.ecu == "eps" and (fw.fwVersion.startswith(b'\x02') or fw.fwVersion in [b'8965B42181\x00\x00\x00\x00\x00\x00']): + set_lat_tune(ret.lateralTuning, LatTunes.PID_I) + break + + elif candidate in (CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2): + stop_and_go = True + ret.wheelbase = 2.67 # Average between 2.70 for sedan and 2.64 for hatchback + ret.steerRatio = 13.9 + tire_stiffness_factor = 0.444 # not optimized yet + ret.mass = 3060. * CV.LB_TO_KG + STD_CARGO_KG + set_lat_tune(ret.lateralTuning, LatTunes.PID_D) + + elif candidate in (CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2, CAR.LEXUS_ESH): + stop_and_go = True + ret.wheelbase = 2.8702 + ret.steerRatio = 16.0 # not optimized + tire_stiffness_factor = 0.444 # not optimized yet + ret.mass = 3677. * CV.LB_TO_KG + STD_CARGO_KG # mean between min and max + set_lat_tune(ret.lateralTuning, LatTunes.PID_D) + + elif candidate == CAR.SIENNA: + stop_and_go = True + ret.wheelbase = 3.03 + ret.steerRatio = 15.5 + tire_stiffness_factor = 0.444 + ret.mass = 4590. * CV.LB_TO_KG + STD_CARGO_KG + set_lat_tune(ret.lateralTuning, LatTunes.PID_J) + + elif candidate in (CAR.LEXUS_IS, CAR.LEXUS_RC): + ret.wheelbase = 2.79908 + ret.steerRatio = 13.3 + tire_stiffness_factor = 0.444 + ret.mass = 3736.8 * CV.LB_TO_KG + STD_CARGO_KG + set_lat_tune(ret.lateralTuning, LatTunes.PID_L) + + elif candidate == CAR.LEXUS_CTH: + stop_and_go = True + ret.wheelbase = 2.60 + ret.steerRatio = 18.6 + tire_stiffness_factor = 0.517 + ret.mass = 3108 * CV.LB_TO_KG + STD_CARGO_KG # mean between min and max + set_lat_tune(ret.lateralTuning, LatTunes.PID_M) + + elif candidate in (CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.LEXUS_NX_TSS2): + stop_and_go = True + ret.wheelbase = 2.66 + ret.steerRatio = 14.7 + tire_stiffness_factor = 0.444 # not optimized yet + ret.mass = 4070 * CV.LB_TO_KG + STD_CARGO_KG + set_lat_tune(ret.lateralTuning, LatTunes.PID_C) + + elif candidate == CAR.PRIUS_TSS2: + stop_and_go = True + ret.wheelbase = 2.70002 # from toyota online sepc. + ret.steerRatio = 13.4 # True steerRatio from older prius + tire_stiffness_factor = 0.6371 # hand-tune + ret.mass = 3115. * CV.LB_TO_KG + STD_CARGO_KG + set_lat_tune(ret.lateralTuning, LatTunes.PID_N) + + elif candidate == CAR.MIRAI: + stop_and_go = True + ret.wheelbase = 2.91 + ret.steerRatio = 14.8 + tire_stiffness_factor = 0.8 + ret.mass = 4300. * CV.LB_TO_KG + STD_CARGO_KG + set_lat_tune(ret.lateralTuning, LatTunes.PID_C) + + elif candidate == CAR.ALPHARD_TSS2: + stop_and_go = True + ret.wheelbase = 3.00 + ret.steerRatio = 14.2 + tire_stiffness_factor = 0.444 + ret.mass = 4305. * CV.LB_TO_KG + STD_CARGO_KG + set_lat_tune(ret.lateralTuning, LatTunes.PID_J) + + ret.steerRateCost = 1. + ret.centerToFront = ret.wheelbase * 0.44 + + # TODO: get actual value, for now starting with reasonable value for + # civic and scaling by mass and wheelbase + ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) + + # TODO: start from empirically derived lateral slip stiffness for the civic and scale by + # mass and CG position, so all cars will have approximately similar dyn behaviors + ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, + tire_stiffness_factor=tire_stiffness_factor) + + ret.enableBsm = 0x3F6 in fingerprint[0] and candidate in TSS2_CAR + # Detect smartDSU, which intercepts ACC_CMD from the DSU allowing openpilot to send it + smartDsu = 0x2FF in fingerprint[0] + # In TSS2 cars the camera does long control + found_ecus = [fw.ecu for fw in car_fw] + ret.enableDsu = (len(found_ecus) > 0) and (Ecu.dsu not in found_ecus) and (candidate not in NO_DSU_CAR) and (not smartDsu) + ret.enableGasInterceptor = 0x201 in fingerprint[0] + # if the smartDSU is detected, openpilot can send ACC_CMD (and the smartDSU will block it from the DSU) or not (the DSU is "connected") + ret.openpilotLongitudinalControl = smartDsu or ret.enableDsu or candidate in TSS2_CAR + + if 0x245 in fingerprint[0]: + ret.flags |= ToyotaFlags.HYBRID.value + + # min speed to enable ACC. if car can do stop and go, then set enabling speed + # to a negative value, so it won't matter. + ret.minEnableSpeed = -1. if (stop_and_go or ret.enableGasInterceptor) else MIN_ACC_SPEED + + if ret.enableGasInterceptor: + set_long_tune(ret.longitudinalTuning, LongTunes.PEDAL) + elif candidate in TSS2_CAR: + set_long_tune(ret.longitudinalTuning, LongTunes.TSS2) + ret.stoppingDecelRate = 0.3 # reach stopping target smoothly + else: + set_long_tune(ret.longitudinalTuning, LongTunes.TSS) + + return ret + + # returns a car.CarState + def update(self, c, can_strings): + # ******************* do can recv ******************* + self.cp.update_strings(can_strings) + self.cp_cam.update_strings(can_strings) + + ret = self.CS.update(self.cp, self.cp_cam) + self.post_update(c,ret) + ret.canValid = self.cp.can_valid and self.cp_cam.can_valid + ret.steeringRateLimited = self.CC.steer_rate_limited if self.CC is not None else False + + # events + events = self.create_common_events(ret) + + if self.CS.low_speed_lockout and self.CP.openpilotLongitudinalControl: + events.add(EventName.lowSpeedLockout) + if ret.vEgo < self.CP.minEnableSpeed and self.CP.openpilotLongitudinalControl: + events.add(EventName.belowEngageSpeed) + if c.actuators.accel > 0.3: + # some margin on the actuator to not false trigger cancellation while stopping + events.add(EventName.speedTooLow) + if ret.vEgo < 0.001: + # while in standstill, send a user alert + events.add(EventName.manualRestart) + + ret.events = events.to_msg() + + self.CS.out = ret.as_reader() + return self.CS.out + + # pass in a car.CarControl + # to be called @ 100hz + def apply(self, c): + self.pre_apply(c) + hud_control = c.hudControl + ret = self.CC.update(c.enabled, c.active, self.CS, self.frame, + c.actuators, c.cruiseControl.cancel, + hud_control.visualAlert, hud_control.leftLaneVisible, + hud_control.rightLaneVisible, hud_control.leadVisible, + hud_control.leftLaneDepart, hud_control.rightLaneDepart) + + self.frame += 1 + return ret diff --git a/selfdrive/car/toyota/radar_interface.py b/selfdrive/car/toyota/radar_interface.py new file mode 100755 index 000000000..590840851 --- /dev/null +++ b/selfdrive/car/toyota/radar_interface.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python3 +from opendbc.can.parser import CANParser +from cereal import car +from selfdrive.car.toyota.values import NO_DSU_CAR, DBC, TSS2_CAR +from selfdrive.car.interfaces import RadarInterfaceBase + + +def _create_radar_can_parser(car_fingerprint): + if car_fingerprint in TSS2_CAR: + RADAR_A_MSGS = list(range(0x180, 0x190)) + RADAR_B_MSGS = list(range(0x190, 0x1a0)) + else: + RADAR_A_MSGS = list(range(0x210, 0x220)) + RADAR_B_MSGS = list(range(0x220, 0x230)) + + msg_a_n = len(RADAR_A_MSGS) + msg_b_n = len(RADAR_B_MSGS) + + signals = list(zip(['LONG_DIST'] * msg_a_n + ['NEW_TRACK'] * msg_a_n + ['LAT_DIST'] * msg_a_n + + ['REL_SPEED'] * msg_a_n + ['VALID'] * msg_a_n + ['SCORE'] * msg_b_n, + RADAR_A_MSGS * 5 + RADAR_B_MSGS)) + + checks = list(zip(RADAR_A_MSGS + RADAR_B_MSGS, [20] * (msg_a_n + msg_b_n))) + + return CANParser(DBC[car_fingerprint]['radar'], signals, checks, 1) + +class RadarInterface(RadarInterfaceBase): + def __init__(self, CP): + super().__init__(CP) + self.track_id = 0 + self.radar_ts = CP.radarTimeStep + + if CP.carFingerprint in TSS2_CAR: + self.RADAR_A_MSGS = list(range(0x180, 0x190)) + self.RADAR_B_MSGS = list(range(0x190, 0x1a0)) + else: + self.RADAR_A_MSGS = list(range(0x210, 0x220)) + self.RADAR_B_MSGS = list(range(0x220, 0x230)) + + self.valid_cnt = {key: 0 for key in self.RADAR_A_MSGS} + + self.rcp = _create_radar_can_parser(CP.carFingerprint) + self.trigger_msg = self.RADAR_B_MSGS[-1] + self.updated_messages = set() + + # No radar dbc for cars without DSU which are not TSS 2.0 + # TODO: make a adas dbc file for dsu-less models + self.no_radar = CP.carFingerprint in NO_DSU_CAR and CP.carFingerprint not in TSS2_CAR + + def update(self, can_strings): + if self.no_radar: + return super().update(None) + + vls = self.rcp.update_strings(can_strings) + self.updated_messages.update(vls) + + if self.trigger_msg not in self.updated_messages: + return None + + rr = self._update(self.updated_messages) + self.updated_messages.clear() + + return rr + + def _update(self, updated_messages): + ret = car.RadarData.new_message() + errors = [] + if not self.rcp.can_valid: + errors.append("canError") + ret.errors = errors + + for ii in sorted(updated_messages): + if ii in self.RADAR_A_MSGS: + cpt = self.rcp.vl[ii] + + if cpt['LONG_DIST'] >= 255 or cpt['NEW_TRACK']: + self.valid_cnt[ii] = 0 # reset counter + if cpt['VALID'] and cpt['LONG_DIST'] < 255: + self.valid_cnt[ii] += 1 + else: + self.valid_cnt[ii] = max(self.valid_cnt[ii] - 1, 0) + + score = self.rcp.vl[ii+16]['SCORE'] + # print ii, self.valid_cnt[ii], score, cpt['VALID'], cpt['LONG_DIST'], cpt['LAT_DIST'] + + # radar point only valid if it's a valid measurement and score is above 50 + if cpt['VALID'] or (score > 50 and cpt['LONG_DIST'] < 255 and self.valid_cnt[ii] > 0): + if ii not in self.pts or cpt['NEW_TRACK']: + self.pts[ii] = car.RadarData.RadarPoint.new_message() + self.pts[ii].trackId = self.track_id + self.track_id += 1 + self.pts[ii].dRel = cpt['LONG_DIST'] # from front of car + self.pts[ii].yRel = -cpt['LAT_DIST'] # in car frame's y axis, left is positive + self.pts[ii].vRel = cpt['REL_SPEED'] + self.pts[ii].aRel = float('nan') + self.pts[ii].yvRel = float('nan') + self.pts[ii].measured = bool(cpt['VALID']) + else: + if ii in self.pts: + del self.pts[ii] + + ret.points = list(self.pts.values()) + return ret diff --git a/selfdrive/car/toyota/toyotacan.py b/selfdrive/car/toyota/toyotacan.py new file mode 100644 index 000000000..083ba2353 --- /dev/null +++ b/selfdrive/car/toyota/toyotacan.py @@ -0,0 +1,122 @@ +def create_steer_command(packer, steer, steer_req, raw_cnt): + """Creates a CAN message for the Toyota Steer Command.""" + + values = { + "STEER_REQUEST": steer_req, + "STEER_TORQUE_CMD": steer, + "COUNTER": raw_cnt, + "SET_ME_1": 1, + } + return packer.make_can_msg("STEERING_LKA", 0, values) + + +def create_lta_steer_command(packer, steer, steer_req, raw_cnt): + """Creates a CAN message for the Toyota LTA Steer Command.""" + + values = { + "COUNTER": raw_cnt + 128, + "SETME_X1": 1, + "SETME_X3": 3, + "PERCENTAGE": 100, + "SETME_X64": 0x64, + "ANGLE": 0, # Rate limit? Lower values seeem to work better, but needs more testing + "STEER_ANGLE_CMD": steer, + "STEER_REQUEST": steer_req, + "STEER_REQUEST_2": steer_req, + "BIT": 0, + } + return packer.make_can_msg("STEERING_LTA", 0, values) + + +def create_accel_command(packer, accel, pcm_cancel, standstill_req, lead, acc_type): + # TODO: find the exact canceling bit that does not create a chime + values = { + "ACCEL_CMD": accel, + "ACC_TYPE": acc_type, + "DISTANCE": 0, + "MINI_CAR": lead, + "PERMIT_BRAKING": 1, + "RELEASE_STANDSTILL": not standstill_req, + "CANCEL_REQ": pcm_cancel, + "ALLOW_LONG_PRESS": 1, + } + return packer.make_can_msg("ACC_CONTROL", 0, values) + +def create_accel_command_alt(packer, accel, pcm_cancel, standstill_req, lead): + # TODO: find the exact canceling bit that does not create a chime + values = { + "ACCEL_CMD": accel, + "SET_ME_X01": 1, + "DISTANCE": 0, + "MINI_CAR": lead, + "SET_ME_X3": 3, + "PERMIT_BRAKING": 1, + "RELEASE_STANDSTILL": not standstill_req, + "CANCEL_REQ": pcm_cancel, + } + return packer.make_can_msg("ACC_CONTROL_ALT", 0, values) + +def create_acc_cancel_command(packer): + values = { + "GAS_RELEASED": 0, + "CRUISE_ACTIVE": 0, + "STANDSTILL_ON": 0, + "ACCEL_NET": 0, + "CRUISE_STATE": 0, + "CANCEL_REQ": 1, + } + return packer.make_can_msg("PCM_CRUISE", 0, values) + + +def create_fcw_command(packer, fcw): + values = { + "PCS_INDICATOR": 1, + "FCW": fcw, + "SET_ME_X20": 0x20, + "SET_ME_X10": 0x10, + "PCS_OFF": 1, + "PCS_SENSITIVITY": 0, + } + return packer.make_can_msg("ACC_HUD", 0, values) + + +def create_ui_command(packer, steer, chime, left_line, right_line, left_lane_depart, right_lane_depart, enabled): + values = { + "TWO_BEEPS": chime, + "LDA_ALERT": steer, + "RIGHT_LINE": 3 if right_lane_depart else 1 if right_line else 2, + "LEFT_LINE": 3 if left_lane_depart else 1 if left_line else 2, + "BARRIERS" : 1 if enabled else 0, + + # static signals + "SET_ME_X02": 2, + "SET_ME_X01": 1, + "LKAS_STATUS": 1, + "REPEATED_BEEPS": 0, + "LANE_SWAY_FLD": 7, + "LANE_SWAY_BUZZER": 0, + "LANE_SWAY_WARNING": 0, + "LDA_FRONT_CAMERA_BLOCKED": 0, + "TAKE_CONTROL": 0, + "LANE_SWAY_SENSITIVITY": 2, + "LANE_SWAY_TOGGLE": 1, + "LDA_ON_MESSAGE": 0, + "LDA_SPEED_TOO_LOW": 0, + "LDA_SA_TOGGLE": 1, + "LDA_SENSITIVITY": 2, + "LDA_UNAVAILABLE": 0, + "LDA_MALFUNCTION": 0, + "LDA_UNAVAILABLE_QUIET": 0, + "ADJUSTING_CAMERA": 0, + "LDW_EXIST": 1, + } + return packer.make_can_msg("LKAS_HUD", 0, values) + +def create_aeb_command(packer, brake_amt): + # do not send this unless it's an emergency takeover + # this will disable gas input + values = { + "DECELERATION": brake_amt * -4.5, + "BRKHLD": 1, + } + return packer.make_can_msg("PRECOLLISION_2_ALT", 0, values) diff --git a/selfdrive/car/toyota/tunes.py b/selfdrive/car/toyota/tunes.py new file mode 100644 index 000000000..f26fc72a0 --- /dev/null +++ b/selfdrive/car/toyota/tunes.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python3 +from enum import Enum + + +class LongTunes(Enum): + PEDAL = 0 + TSS2 = 1 + TSS = 2 + +class LatTunes(Enum): + INDI_PRIUS = 0 + LQR_RAV4 = 1 + PID_A = 2 + PID_B = 3 + PID_C = 4 + PID_D = 5 + PID_E = 6 + PID_F = 7 + PID_G = 8 + PID_I = 9 + PID_H = 10 + PID_J = 11 + PID_K = 12 + PID_L = 13 + PID_M = 14 + PID_N = 15 + + +###### LONG ###### +def set_long_tune(tune, name): + # Improved longitudinal tune + if name == LongTunes.TSS2 or name == LongTunes.PEDAL: + tune.deadzoneBP = [0., 8.05] + tune.deadzoneV = [.0, .14] + tune.kpBP = [0., 5., 20.] + tune.kpV = [1.3, 1.0, 0.7] + tune.kiBP = [0., 5., 12., 20., 27.] + tune.kiV = [.35, .23, .20, .17, .1] + # Default longitudinal tune + elif name == LongTunes.TSS: + tune.deadzoneBP = [0., 9.] + tune.deadzoneV = [0., .15] + tune.kpBP = [0., 5., 35.] + tune.kiBP = [0., 35.] + tune.kpV = [3.6, 2.4, 1.5] + tune.kiV = [0.54, 0.36] + else: + raise NotImplementedError('This longitudinal tune does not exist') + + +###### LAT ###### +def set_lat_tune(tune, name): + if name == LatTunes.INDI_PRIUS: + tune.init('indi') + tune.indi.innerLoopGainBP = [0.] + tune.indi.innerLoopGainV = [4.0] + tune.indi.outerLoopGainBP = [0.] + tune.indi.outerLoopGainV = [3.0] + tune.indi.timeConstantBP = [0.] + tune.indi.timeConstantV = [1.0] + tune.indi.actuatorEffectivenessBP = [0.] + tune.indi.actuatorEffectivenessV = [1.0] + + elif name == LatTunes.LQR_RAV4: + tune.init('lqr') + tune.lqr.scale = 1500.0 + tune.lqr.ki = 0.05 + tune.lqr.a = [0., 1., -0.22619643, 1.21822268] + tune.lqr.b = [-1.92006585e-04, 3.95603032e-05] + tune.lqr.c = [1., 0.] + tune.lqr.k = [-110.73572306, 451.22718255] + tune.lqr.l = [0.3233671, 0.3185757] + tune.lqr.dcGain = 0.002237852961363602 + + elif 'PID' in str(name): + tune.init('pid') + tune.pid.kiBP = [0.0] + tune.pid.kpBP = [0.0] + if name == LatTunes.PID_A: + tune.pid.kpV = [0.2] + tune.pid.kiV = [0.05] + tune.pid.kf = 0.00003 + elif name == LatTunes.PID_C: + tune.pid.kpV = [0.6] + tune.pid.kiV = [0.1] + tune.pid.kf = 0.00006 + elif name == LatTunes.PID_D: + tune.pid.kpV = [0.6] + tune.pid.kiV = [0.1] + tune.pid.kf = 0.00007818594 + elif name == LatTunes.PID_F: + tune.pid.kpV = [0.723] + tune.pid.kiV = [0.0428] + tune.pid.kf = 0.00006 + elif name == LatTunes.PID_G: + tune.pid.kpV = [0.18] + tune.pid.kiV = [0.015] + tune.pid.kf = 0.00012 + elif name == LatTunes.PID_H: + tune.pid.kpV = [0.17] + tune.pid.kiV = [0.03] + tune.pid.kf = 0.00006 + elif name == LatTunes.PID_I: + tune.pid.kpV = [0.15] + tune.pid.kiV = [0.05] + tune.pid.kf = 0.00004 + elif name == LatTunes.PID_J: + tune.pid.kpV = [0.19] + tune.pid.kiV = [0.02] + tune.pid.kf = 0.00007818594 + elif name == LatTunes.PID_L: + tune.pid.kpV = [0.3] + tune.pid.kiV = [0.05] + tune.pid.kf = 0.00006 + elif name == LatTunes.PID_M: + tune.pid.kpV = [0.3] + tune.pid.kiV = [0.05] + tune.pid.kf = 0.00007 + elif name == LatTunes.PID_N: + tune.pid.kpV = [0.35] + tune.pid.kiV = [0.15] + tune.pid.kf = 0.00007818594 + else: + raise NotImplementedError('This PID tune does not exist') + else: + raise NotImplementedError('This lateral tune does not exist') diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py new file mode 100644 index 000000000..99937561a --- /dev/null +++ b/selfdrive/car/toyota/values.py @@ -0,0 +1,1722 @@ +from collections import defaultdict +from enum import IntFlag + +from cereal import car +from selfdrive.car import dbc_dict +from selfdrive.config import Conversions as CV + +Ecu = car.CarParams.Ecu +MIN_ACC_SPEED = 19. * CV.MPH_TO_MS +PEDAL_TRANSITION = 10. * CV.MPH_TO_MS + + +class CarControllerParams: + ACCEL_MAX = 1.5 # m/s2, lower than allowed 2.0 m/s2 for tuning reasons + ACCEL_MIN = -3.5 # m/s2 + + STEER_MAX = 1500 + STEER_DELTA_UP = 10 # 1.5s time to peak torque + STEER_DELTA_DOWN = 25 # always lower than 45 otherwise the Rav4 faults (Prius seems ok with 50) + STEER_ERROR_MAX = 350 # max delta between torque cmd and torque motor + + +class ToyotaFlags(IntFlag): + HYBRID = 1 + + +class CAR: + # Toyota + ALPHARD_TSS2 = "TOYOTA ALPHARD 2020" + AVALON = "TOYOTA AVALON 2016" + AVALON_2019 = "TOYOTA AVALON 2019" + AVALONH_2019 = "TOYOTA AVALON HYBRID 2019" + AVALON_TSS2 = "TOYOTA AVALON 2022" + CAMRY = "TOYOTA CAMRY 2018" + CAMRYH = "TOYOTA CAMRY HYBRID 2018" + CAMRY_TSS2 = "TOYOTA CAMRY 2021" # TSS 2.5 + CAMRYH_TSS2 = "TOYOTA CAMRY HYBRID 2021" + CHR = "TOYOTA C-HR 2018" + CHRH = "TOYOTA C-HR HYBRID 2018" + COROLLA = "TOYOTA COROLLA 2017" + COROLLA_TSS2 = "TOYOTA COROLLA TSS2 2019" + # LSS2 Lexus UX Hybrid is same as a TSS2 Corolla Hybrid + COROLLAH_TSS2 = "TOYOTA COROLLA HYBRID TSS2 2019" + HIGHLANDER = "TOYOTA HIGHLANDER 2017" + HIGHLANDER_TSS2 = "TOYOTA HIGHLANDER 2020" + HIGHLANDERH = "TOYOTA HIGHLANDER HYBRID 2018" + HIGHLANDERH_TSS2 = "TOYOTA HIGHLANDER HYBRID 2020" + PRIUS = "TOYOTA PRIUS 2017" + PRIUS_V = "TOYOTA PRIUS v 2017" + PRIUS_TSS2 = "TOYOTA PRIUS TSS2 2021" + RAV4 = "TOYOTA RAV4 2017" + RAV4H = "TOYOTA RAV4 HYBRID 2017" + RAV4_TSS2 = "TOYOTA RAV4 2019" + RAV4H_TSS2 = "TOYOTA RAV4 HYBRID 2019" + MIRAI = "TOYOTA MIRAI 2021" # TSS 2.5 + SIENNA = "TOYOTA SIENNA 2018" + + # Lexus + LEXUS_CTH = "LEXUS CT HYBRID 2018" + LEXUS_ESH = "LEXUS ES HYBRID 2018" + LEXUS_ES_TSS2 = "LEXUS ES 2019" + LEXUS_ESH_TSS2 = "LEXUS ES HYBRID 2019" + LEXUS_IS = "LEXUS IS 2018" + LEXUS_NX = "LEXUS NX 2018" + LEXUS_NXH = "LEXUS NX HYBRID 2018" + LEXUS_NX_TSS2 = "LEXUS NX 2020" + LEXUS_RC = "LEXUS RC 2020" + LEXUS_RX = "LEXUS RX 2016" + LEXUS_RXH = "LEXUS RX HYBRID 2017" + LEXUS_RX_TSS2 = "LEXUS RX 2020" + LEXUS_RXH_TSS2 = "LEXUS RX HYBRID 2020" + +# (addr, cars, bus, 1/freq*100, vl) +STATIC_DSU_MSGS = [ + (0x128, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.AVALON), 1, 3, b'\xf4\x01\x90\x83\x00\x37'), + (0x128, (CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH), 1, 3, b'\x03\x00\x20\x00\x00\x52'), + (0x141, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX, CAR.PRIUS_V), 1, 2, b'\x00\x00\x00\x46'), + (0x160, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX, CAR.PRIUS_V), 1, 7, b'\x00\x00\x08\x12\x01\x31\x9c\x51'), + (0x161, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.AVALON, CAR.LEXUS_RX, CAR.PRIUS_V), 1, 7, b'\x00\x1e\x00\x00\x00\x80\x07'), + (0X161, (CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH), 1, 7, b'\x00\x1e\x00\xd4\x00\x00\x5b'), + (0x283, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX, CAR.PRIUS_V), 0, 3, b'\x00\x00\x00\x00\x00\x00\x8c'), + (0x2E6, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 3, b'\xff\xf8\x00\x08\x7f\xe0\x00\x4e'), + (0x2E7, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 3, b'\xa8\x9c\x31\x9c\x00\x00\x00\x02'), + (0x33E, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 20, b'\x0f\xff\x26\x40\x00\x1f\x00'), + (0x344, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX, CAR.PRIUS_V), 0, 5, b'\x00\x00\x01\x00\x00\x00\x00\x50'), + (0x365, (CAR.PRIUS, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.HIGHLANDERH), 0, 20, b'\x00\x00\x00\x80\x03\x00\x08'), + (0x365, (CAR.RAV4, CAR.RAV4H, CAR.COROLLA, CAR.HIGHLANDER, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX, CAR.PRIUS_V), 0, 20, b'\x00\x00\x00\x80\xfc\x00\x08'), + (0x366, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.HIGHLANDERH), 0, 20, b'\x00\x00\x4d\x82\x40\x02\x00'), + (0x366, (CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX, CAR.PRIUS_V), 0, 20, b'\x00\x72\x07\xff\x09\xfe\x00'), + (0x470, (CAR.PRIUS, CAR.LEXUS_RXH), 1, 100, b'\x00\x00\x02\x7a'), + (0x470, (CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.RAV4H, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.PRIUS_V), 1, 100, b'\x00\x00\x01\x79'), + (0x4CB, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX, CAR.PRIUS_V), 0, 100, b'\x0c\x00\x00\x00\x00\x00\x00\x00'), +] + +FW_VERSIONS = { + CAR.AVALON: { + (Ecu.esp, 0x7b0, None): [ + b'F152607060\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881510701300\x00\x00\x00\x00', + b'881510705100\x00\x00\x00\x00', + b'881510705200\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B41051\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'\x0230721100\x00\x00\x00\x00\x00\x00\x00\x00A0C01000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0230721200\x00\x00\x00\x00\x00\x00\x00\x00A0C01000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702000\x00\x00\x00\x00', + b'8821F4702100\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F0701100\x00\x00\x00\x00', + b'8646F0703000\x00\x00\x00\x00', + ], + }, + CAR.AVALON_2019: { + (Ecu.esp, 0x7b0, None): [ + b'F152607140\x00\x00\x00\x00\x00\x00', + b'F152607171\x00\x00\x00\x00\x00\x00', + b'F152607110\x00\x00\x00\x00\x00\x00', + b'F152607180\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881510703200\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B41080\x00\x00\x00\x00\x00\x00', + b'8965B07010\x00\x00\x00\x00\x00\x00', + b'8965B41090\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x700, None): [ + b'\x01896630725200\x00\x00\x00\x00', + b'\x01896630725300\x00\x00\x00\x00', + b'\x01896630735100\x00\x00\x00\x00', + b'\x01896630738000\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F0702100\x00\x00\x00\x00', + ], + }, + CAR.AVALONH_2019: { + (Ecu.esp, 0x7b0, None): [ + b'F152641040\x00\x00\x00\x00\x00\x00', + b'F152641061\x00\x00\x00\x00\x00\x00', + b'F152641050\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881510704200\x00\x00\x00\x00', + b'881514107100\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B07010\x00\x00\x00\x00\x00\x00', + b'8965B41090\x00\x00\x00\x00\x00\x00', + b'8965B41070\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x700, None): [ + b'\x02896630724000\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00', + b'\x02896630737000\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00', + b'\x02896630728000\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F0702100\x00\x00\x00\x00', + ], + }, + CAR.AVALON_TSS2: { + (Ecu.esp, 0x7b0, None): [ + b'\x01F152607280\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B41110\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x700, None): [ + b'\x01896630742000\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F6201200\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F4104100\x00\x00\x00\x008646G5301200\x00\x00\x00\x00', + ], + }, + CAR.CAMRY: { + (Ecu.engine, 0x700, None): [ + b'\x018966306L3100\x00\x00\x00\x00', + b'\x018966306L4200\x00\x00\x00\x00', + b'\x018966306L5200\x00\x00\x00\x00', + b'\x018966306P8000\x00\x00\x00\x00', + b'\x018966306Q3100\x00\x00\x00\x00', + b'\x018966306Q4000\x00\x00\x00\x00', + b'\x018966306Q4100\x00\x00\x00\x00', + b'\x018966306Q4200\x00\x00\x00\x00', + b'\x018966333Q9200\x00\x00\x00\x00', + b'\x018966333P3100\x00\x00\x00\x00', + b'\x018966333P3200\x00\x00\x00\x00', + b'\x018966333P4200\x00\x00\x00\x00', + b'\x018966333P4300\x00\x00\x00\x00', + b'\x018966333P4400\x00\x00\x00\x00', + b'\x018966333P4500\x00\x00\x00\x00', + b'\x018966333P4700\x00\x00\x00\x00', + b'\x018966333P4900\x00\x00\x00\x00', + b'\x018966333Q6000\x00\x00\x00\x00', + b'\x018966333Q6200\x00\x00\x00\x00', + b'\x018966333Q6300\x00\x00\x00\x00', + b'\x018966333W6000\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'\x02333P1100\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'8821F0601200 ', + b'8821F0601300 ', + b'8821F0602000 ', + b'8821F0603300 ', + b'8821F0604100 ', + b'8821F0605200 ', + b'8821F0607200 ', + b'8821F0608000 ', + b'8821F0608200 ', + b'8821F0609100 ', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152606210\x00\x00\x00\x00\x00\x00', + b'F152606230\x00\x00\x00\x00\x00\x00', + b'F152606270\x00\x00\x00\x00\x00\x00', + b'F152606290\x00\x00\x00\x00\x00\x00', + b'F152606410\x00\x00\x00\x00\x00\x00', + b'F152633540\x00\x00\x00\x00\x00\x00', + b'F152633A10\x00\x00\x00\x00\x00\x00', + b'F152633A20\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B33540\x00\x00\x00\x00\x00\x00', + b'8965B33542\x00\x00\x00\x00\x00\x00', + b'8965B33580\x00\x00\x00\x00\x00\x00', + b'8965B33581\x00\x00\x00\x00\x00\x00', + b'8965B33621\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ # Same as 0x791 + b'8821F0601200 ', + b'8821F0601300 ', + b'8821F0602000 ', + b'8821F0603300 ', + b'8821F0604100 ', + b'8821F0605200 ', + b'8821F0607200 ', + b'8821F0608000 ', + b'8821F0608200 ', + b'8821F0609100 ', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F0601200 ', + b'8646F0601300 ', + b'8646F0601400 ', + b'8646F0603400 ', + b'8646F0604100 ', + b'8646F0605000 ', + b'8646F0606000 ', + b'8646F0606100 ', + b'8646F0607100 ', + ], + }, + CAR.CAMRYH: { + (Ecu.engine, 0x700, None): [ + b'\x018966306Q6000\x00\x00\x00\x00', + b'\x018966333N1100\x00\x00\x00\x00', + b'\x018966333N4300\x00\x00\x00\x00', + b'\x018966333X0000\x00\x00\x00\x00', + b'\x018966333X4000\x00\x00\x00\x00', + b'\x01896633T16000\x00\x00\x00\x00', + b'\x028966306B2100\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00', + b'\x028966306B2300\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00', + b'\x028966306B2500\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00', + b'\x028966306N8100\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00', + b'\x028966306N8200\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00', + b'\x028966306N8300\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00', + b'\x028966306N8400\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00', + b'\x028966306R5000\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00', + b'\x028966306R5000\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00', + b'\x028966306R6000\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00', + b'\x028966306R6000\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00', + b'\x028966306S0000\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00', + b'\x028966306S0100\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00', + b'\x028966306S1100\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152633214\x00\x00\x00\x00\x00\x00', + b'F152633660\x00\x00\x00\x00\x00\x00', + b'F152633712\x00\x00\x00\x00\x00\x00', + b'F152633713\x00\x00\x00\x00\x00\x00', + b'F152633B51\x00\x00\x00\x00\x00\x00', + b'F152633B60\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'8821F0601200 ', + b'8821F0601300 ', + b'8821F0603400 ', + b'8821F0604000 ', + b'8821F0604100 ', + b'8821F0604200 ', + b'8821F0605200 ', + b'8821F0606200 ', + b'8821F0607200 ', + b'8821F0608000 ', + b'8821F0608200 ', + b'8821F0609000 ', + b'8821F0609100 ', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B33540\x00\x00\x00\x00\x00\x00', + b'8965B33542\x00\x00\x00\x00\x00\x00', + b'8965B33550\x00\x00\x00\x00\x00\x00', + b'8965B33551\x00\x00\x00\x00\x00\x00', + b'8965B33580\x00\x00\x00\x00\x00\x00', + b'8965B33581\x00\x00\x00\x00\x00\x00', + b'8965B33611\x00\x00\x00\x00\x00\x00', + b'8965B33621\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ # Same as 0x791 + b'8821F0601200 ', + b'8821F0601300 ', + b'8821F0603400 ', + b'8821F0604000 ', + b'8821F0604100 ', + b'8821F0604200 ', + b'8821F0605200 ', + b'8821F0606200 ', + b'8821F0607200 ', + b'8821F0608000 ', + b'8821F0608200 ', + b'8821F0609000 ', + b'8821F0609100 ', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F0601200 ', + b'8646F0601300 ', + b'8646F0601400 ', + b'8646F0603400 ', + b'8646F0603500 ', + b'8646F0604100 ', + b'8646F0605000 ', + b'8646F0606000 ', + b'8646F0606100 ', + b'8646F0607000 ', + b'8646F0607100 ', + ], + }, + CAR.CAMRY_TSS2: { + (Ecu.eps, 0x7a1, None): [ + b'8965B33630\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'\x01F152606370\x00\x00\x00\x00\x00\x00', + b'\x01F152606390\x00\x00\x00\x00\x00\x00', + b'\x01F152606400\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x700, None): [ + b'\x018966306Q5000\x00\x00\x00\x00', + b'\x018966306T3100\x00\x00\x00\x00', + b'\x018966306T3200\x00\x00\x00\x00', + b'\x018966306T4000\x00\x00\x00\x00', + b'\x018966306T4100\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F6201200\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F0602100\x00\x00\x00\x008646G5301200\x00\x00\x00\x00', + b'\x028646F0602200\x00\x00\x00\x008646G5301200\x00\x00\x00\x00', + b'\x028646F3305200\x00\x00\x00\x008646G5301200\x00\x00\x00\x00', + b'\x028646F3305300\x00\x00\x00\x008646G5301200\x00\x00\x00\x00', + ], + }, + CAR.CAMRYH_TSS2: { + (Ecu.eps, 0x7a1, None): [ + b'8965B33630\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152633D00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x700, None): [ + b'\x018966306Q6000\x00\x00\x00\x00', + b'\x018966306Q7000\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 15): [ + b'\x018821F6201200\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 109): [ + b'\x028646F3305200\x00\x00\x00\x008646G5301200\x00\x00\x00\x00', + b'\x028646F3305300\x00\x00\x00\x008646G5301200\x00\x00\x00\x00', + ], + }, + CAR.CHR: { + (Ecu.engine, 0x700, None): [ + b'\x01896631021100\x00\x00\x00\x00', + b'\x01896631017100\x00\x00\x00\x00', + b'\x01896631017200\x00\x00\x00\x00', + b'\x0189663F413100\x00\x00\x00\x00', + b'\x0189663F414100\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'8821F0W01000 ', + b'8821F0W01100 ', + b'8821FF401600 ', + b'8821FF404000 ', + b'8821FF404100 ', + b'8821FF405100 ', + b'8821FF406000 ', + b'8821FF407100 ', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152610020\x00\x00\x00\x00\x00\x00', + b'F152610153\x00\x00\x00\x00\x00\x00', + b'F152610210\x00\x00\x00\x00\x00\x00', + b'F1526F4034\x00\x00\x00\x00\x00\x00', + b'F1526F4044\x00\x00\x00\x00\x00\x00', + b'F1526F4073\x00\x00\x00\x00\x00\x00', + b'F1526F4121\x00\x00\x00\x00\x00\x00', + b'F1526F4122\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B10011\x00\x00\x00\x00\x00\x00', + b'8965B10040\x00\x00\x00\x00\x00\x00', + b'8965B10070\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'\x0331024000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203202\x00\x00\x00\x00', + b'\x0331024000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203302\x00\x00\x00\x00', + b'\x0331036000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203302\x00\x00\x00\x00', + b'\x033F401100\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203102\x00\x00\x00\x00', + b'\x033F401200\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203202\x00\x00\x00\x00', + b'\x033F424000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203202\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F0W01000 ', + b'8821FF401600 ', + b'8821FF404000 ', + b'8821FF404100 ', + b'8821FF405100 ', + b'8821FF406000 ', + b'8821FF407100 ', + b'8821F0W01100 ', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646FF401700 ', + b'8646FF401800 ', + b'8646FF404000 ', + b'8646FF406000 ', + b'8646FF407000 ', + ], + }, + CAR.CHRH: { + (Ecu.engine, 0x700, None): [ + b'\x0289663F405100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896631013200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x0289663F405000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x0289663F418000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x0289663F423000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x0289663F431000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x0189663F438000\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152610012\x00\x00\x00\x00\x00\x00', + b'F152610013\x00\x00\x00\x00\x00\x00', + b'F152610014\x00\x00\x00\x00\x00\x00', + b'F152610040\x00\x00\x00\x00\x00\x00', + b'F152610190\x00\x00\x00\x00\x00\x00', + b'F152610200\x00\x00\x00\x00\x00\x00', + b'F152610230\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'8821F0W01000 ', + b'8821FF402300 ', + b'8821FF402400 ', + b'8821FF404000 ', + b'8821FF404100 ', + b'8821FF405000 ', + b'8821FF406000 ', + b'8821FF407100 ', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B10011\x00\x00\x00\x00\x00\x00', + b'8965B10020\x00\x00\x00\x00\x00\x00', + b'8965B10040\x00\x00\x00\x00\x00\x00', + b'8965B10050\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F0W01000 ', + b'8821FF402300 ', + b'8821FF402400 ', + b'8821FF404000 ', + b'8821FF404100 ', + b'8821FF405000 ', + b'8821FF406000 ', + b'8821FF407100 ', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646FF401700 ', + b'8646FF402100 ', + b'8646FF404000 ', + b'8646FF406000 ', + b'8646FF407000 ', + ], + }, + CAR.COROLLA: { + (Ecu.engine, 0x7e0, None): [ + b'\x0230ZC2000\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0230ZC2100\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0230ZC2200\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0230ZC2300\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0230ZC3000\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0230ZC3100\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0230ZC3200\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0230ZC3300\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0330ZC1200\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00895231203202\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881510201100\x00\x00\x00\x00', + b'881510201200\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152602190\x00\x00\x00\x00\x00\x00', + b'F152602191\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B02181\x00\x00\x00\x00\x00\x00', + b'8965B02191\x00\x00\x00\x00\x00\x00', + b'8965B48150\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702100\x00\x00\x00\x00', + b'8821F4702300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F0201101\x00\x00\x00\x00', + b'8646F0201200\x00\x00\x00\x00', + ], + }, + CAR.COROLLA_TSS2: { + (Ecu.engine, 0x700, None): [ + b'\x01896630ZG2000\x00\x00\x00\x00', + b'\x01896630ZG5000\x00\x00\x00\x00', + b'\x01896630ZG5100\x00\x00\x00\x00', + b'\x01896630ZG5200\x00\x00\x00\x00', + b'\x01896630ZG5300\x00\x00\x00\x00', + b'\x01896630ZP1000\x00\x00\x00\x00', + b'\x01896630ZP2000\x00\x00\x00\x00', + b'\x01896630ZQ5000\x00\x00\x00\x00', + b'\x018966312L8000\x00\x00\x00\x00', + b'\x018966312M0000\x00\x00\x00\x00', + b'\x018966312M9000\x00\x00\x00\x00', + b'\x018966312P9000\x00\x00\x00\x00', + b'\x018966312P9100\x00\x00\x00\x00', + b'\x018966312P9200\x00\x00\x00\x00', + b'\x018966312P9300\x00\x00\x00\x00', + b'\x018966312Q2300\x00\x00\x00\x00', + b'\x018966312Q8000\x00\x00\x00\x00', + b'\x018966312R0000\x00\x00\x00\x00', + b'\x018966312R0100\x00\x00\x00\x00', + b'\x018966312R1000\x00\x00\x00\x00', + b'\x018966312R1100\x00\x00\x00\x00', + b'\x018966312R3100\x00\x00\x00\x00', + b'\x018966312S5000\x00\x00\x00\x00', + b'\x018966312S7000\x00\x00\x00\x00', + b'\x018966312W3000\x00\x00\x00\x00', + b'\x018966312W9000\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'\x0230A10000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0230A11000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0230ZN4000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x03312K7000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203402\x00\x00\x00\x00', + b'\x03312M3000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203402\x00\x00\x00\x00', + b'\x03312N6000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203202\x00\x00\x00\x00', + b'\x03312N6000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203302\x00\x00\x00\x00', + b'\x03312N6000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203402\x00\x00\x00\x00', + b'\x03312N6100\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203302\x00\x00\x00\x00', + b'\x03312N6100\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203402\x00\x00\x00\x00', + b'\x02312K4000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'\x018965B12350\x00\x00\x00\x00\x00\x00', + b'\x018965B12470\x00\x00\x00\x00\x00\x00', + b'\x018965B12490\x00\x00\x00\x00\x00\x00', + b'\x018965B12500\x00\x00\x00\x00\x00\x00', + b'\x018965B12520\x00\x00\x00\x00\x00\x00', + b'\x018965B12530\x00\x00\x00\x00\x00\x00', + b'\x018965B1255000\x00\x00\x00\x00', + b'8965B12361\x00\x00\x00\x00\x00\x00', + b'8965B16011\x00\x00\x00\x00\x00\x00', + b'\x018965B12510\x00\x00\x00\x00\x00\x00' + ], + (Ecu.esp, 0x7b0, None): [ + b'\x01F152602280\x00\x00\x00\x00\x00\x00', + b'\x01F152602560\x00\x00\x00\x00\x00\x00', + b'\x01F152602590\x00\x00\x00\x00\x00\x00', + b'\x01F152602650\x00\x00\x00\x00\x00\x00', + b"\x01F15260A010\x00\x00\x00\x00\x00\x00", + b'\x01F15260A050\x00\x00\x00\x00\x00\x00', + b'\x01F152612641\x00\x00\x00\x00\x00\x00', + b'\x01F152612651\x00\x00\x00\x00\x00\x00', + b'\x01F152612B10\x00\x00\x00\x00\x00\x00', + b'\x01F152612B51\x00\x00\x00\x00\x00\x00', + b'\x01F152612B60\x00\x00\x00\x00\x00\x00', + b'\x01F152612B61\x00\x00\x00\x00\x00\x00', + b'\x01F152612B62\x00\x00\x00\x00\x00\x00', + b'\x01F152612B71\x00\x00\x00\x00\x00\x00', + b'\x01F152612B81\x00\x00\x00\x00\x00\x00', + b'\x01F152612B90\x00\x00\x00\x00\x00\x00', + b'\x01F152612C00\x00\x00\x00\x00\x00\x00', + b'F152602191\x00\x00\x00\x00\x00\x00', + b'\x01F152612862\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F3301100\x00\x00\x00\x00', + b'\x018821F3301200\x00\x00\x00\x00', + b'\x018821F3301300\x00\x00\x00\x00', + b'\x018821F3301400\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F12010D0\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F1201100\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F1201200\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F1201300\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + b'\x028646F1201400\x00\x00\x00\x008646G2601500\x00\x00\x00\x00', + b'\x028646F1202000\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F1202100\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + b'\x028646F1202200\x00\x00\x00\x008646G2601500\x00\x00\x00\x00', + b'\x028646F1601100\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + ], + }, + CAR.COROLLAH_TSS2: { + (Ecu.engine, 0x700, None): [ + b'\x01896630ZJ1000\x00\x00\x00\x00', + b'\x01896630ZU8000\x00\x00\x00\x00', + b'\x01896637621000\x00\x00\x00\x00', + b'\x01896637624000\x00\x00\x00\x00', + b'\x01896637626000\x00\x00\x00\x00', + b'\x01896637648000\x00\x00\x00\x00', + b'\x01896637643000\x00\x00\x00\x00', + b'\x02896630ZJ5000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896630ZN8000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896630ZQ3000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896630ZR2000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896630ZT8000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896630ZT9000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x028966312K6000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x028966312L0000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x028966312Q3000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x028966312Q4000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x038966312L7000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF1205001\x00\x00\x00\x00', + b'\x038966312N1000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF1203001\x00\x00\x00\x00', + b'\x038966312T3000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF1205001\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B12361\x00\x00\x00\x00\x00\x00', + b'8965B12451\x00\x00\x00\x00\x00\x00', + b'8965B76012\x00\x00\x00\x00\x00\x00', + b'8965B76050\x00\x00\x00\x00\x00\x00', + b'\x018965B12350\x00\x00\x00\x00\x00\x00', + b'\x018965B12470\x00\x00\x00\x00\x00\x00', + b'\x018965B12490\x00\x00\x00\x00\x00\x00', + b'\x018965B12500\x00\x00\x00\x00\x00\x00', + b'\x018965B12510\x00\x00\x00\x00\x00\x00', + b'\x018965B12520\x00\x00\x00\x00\x00\x00', + b'\x018965B12530\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152612590\x00\x00\x00\x00\x00\x00', + b'F152612691\x00\x00\x00\x00\x00\x00', + b'F152612692\x00\x00\x00\x00\x00\x00', + b'F152612700\x00\x00\x00\x00\x00\x00', + b'F152612710\x00\x00\x00\x00\x00\x00', + b'F152612790\x00\x00\x00\x00\x00\x00', + b'F152612800\x00\x00\x00\x00\x00\x00', + b'F152612820\x00\x00\x00\x00\x00\x00', + b'F152612840\x00\x00\x00\x00\x00\x00', + b'F152612890\x00\x00\x00\x00\x00\x00', + b'F152612A00\x00\x00\x00\x00\x00\x00', + b'F152612A10\x00\x00\x00\x00\x00\x00', + b'F152642540\x00\x00\x00\x00\x00\x00', + b'F152676293\x00\x00\x00\x00\x00\x00', + b'F152676303\x00\x00\x00\x00\x00\x00', + b'F152676304\x00\x00\x00\x00\x00\x00', + b'F152612D00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F3301100\x00\x00\x00\x00', + b'\x018821F3301200\x00\x00\x00\x00', + b'\x018821F3301300\x00\x00\x00\x00', + b'\x018821F3301400\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F12010D0\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F1201100\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F1201300\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + b'\x028646F1201400\x00\x00\x00\x008646G2601500\x00\x00\x00\x00', + b'\x028646F1202000\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F1202100\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + b'\x028646F1202200\x00\x00\x00\x008646G2601500\x00\x00\x00\x00', + b"\x028646F1601300\x00\x00\x00\x008646G2601400\x00\x00\x00\x00", + b'\x028646F4203400\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F76020C0\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F7603100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F7603200\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + ], + }, + CAR.HIGHLANDER: { + (Ecu.engine, 0x700, None): [ + b'\x01896630E09000\x00\x00\x00\x00', + b'\x01896630E43000\x00\x00\x00\x00', + b'\x01896630E43100\x00\x00\x00\x00', + b'\x01896630E43200\x00\x00\x00\x00', + b'\x01896630E44200\x00\x00\x00\x00', + b'\x01896630E45000\x00\x00\x00\x00', + b'\x01896630E45100\x00\x00\x00\x00', + b'\x01896630E45200\x00\x00\x00\x00', + b'\x01896630E46000\x00\x00\x00\x00', + b'\x01896630E46200\x00\x00\x00\x00', + b'\x01896630E74000\x00\x00\x00\x00', + b'\x01896630E75000\x00\x00\x00\x00', + b'\x01896630E76000\x00\x00\x00\x00', + b'\x01896630E77000\x00\x00\x00\x00', + b'\x01896630E83000\x00\x00\x00\x00', + b'\x01896630E84000\x00\x00\x00\x00', + b'\x01896630E85000\x00\x00\x00\x00', + b'\x01896630E86000\x00\x00\x00\x00', + b'\x01896630E88000\x00\x00\x00\x00', + b'\x01896630EA0000\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B48140\x00\x00\x00\x00\x00\x00', + b'8965B48150\x00\x00\x00\x00\x00\x00', + b'8965B48210\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [b'F15260E011\x00\x00\x00\x00\x00\x00'], + (Ecu.dsu, 0x791, None): [ + b'881510E01100\x00\x00\x00\x00', + b'881510E01200\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702100\x00\x00\x00\x00', + b'8821F4702300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F0E01200\x00\x00\x00\x00', + b'8646F0E01300\x00\x00\x00\x00', + ], + }, + CAR.HIGHLANDERH: { + (Ecu.eps, 0x7a1, None): [ + b'8965B48160\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152648541\x00\x00\x00\x00\x00\x00', + b'F152648542\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'\x0230E40000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0230E40100\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0230EA2000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0230EA2100\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702100\x00\x00\x00\x00', + b'8821F4702300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F0E01200\x00\x00\x00\x00', + b'8646F0E01300\x00\x00\x00\x00', + ], + }, + CAR.HIGHLANDER_TSS2: { + (Ecu.eps, 0x7a1, None): [ + b'8965B48241\x00\x00\x00\x00\x00\x00', + b'8965B48310\x00\x00\x00\x00\x00\x00', + b'8965B48320\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'\x01F15260E051\x00\x00\x00\x00\x00\x00', + b'\x01F15260E061\x00\x00\x00\x00\x00\x00', + b'\x01F15260E110\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x700, None): [ + b'\x01896630E62100\x00\x00\x00\x00', + b'\x01896630E62200\x00\x00\x00\x00', + b'\x01896630E64100\x00\x00\x00\x00', + b'\x01896630E64200\x00\x00\x00\x00', + b'\x01896630EB1000\x00\x00\x00\x00', + b'\x01896630EB1100\x00\x00\x00\x00', + b'\x01896630EB1200\x00\x00\x00\x00', + b'\x01896630EB2000\x00\x00\x00\x00', + b'\x01896630EB2100\x00\x00\x00\x00', + b'\x01896630EB2200\x00\x00\x00\x00', + b'\x01896630EC4000\x00\x00\x00\x00', + b'\x01896630ED9000\x00\x00\x00\x00', + b'\x01896630EE1000\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F3301400\x00\x00\x00\x00', + b'\x018821F6201200\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F0E02100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F4803000\x00\x00\x00\x008646G5301200\x00\x00\x00\x00', + ], + }, + CAR.HIGHLANDERH_TSS2: { + (Ecu.eps, 0x7a1, None): [ + b'8965B48241\x00\x00\x00\x00\x00\x00', + b'8965B48310\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'\x01F15264872300\x00\x00\x00\x00', + b'\x01F15264872400\x00\x00\x00\x00', + b'\x01F15264872500\x00\x00\x00\x00', + b'\x01F15264873500\x00\x00\x00\x00', + b'\x01F152648C6300\x00\x00\x00\x00', + ], + (Ecu.engine, 0x700, None): [ + b'\x01896630E67000\x00\x00\x00\x00', + b'\x01896630EA1000\x00\x00\x00\x00', + b'\x01896630EE4000\x00\x00\x00\x00', + b'\x01896630EA1000\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', + b'\x02896630E66000\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', + b'\x02896630EB3000\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', + b'\x02896630EB3100\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', + b'\x02896630E66100\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F3301400\x00\x00\x00\x00', + b'\x018821F6201200\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F0E02100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F4803000\x00\x00\x00\x008646G5301200\x00\x00\x00\x00', + ], + }, + CAR.LEXUS_IS: { + (Ecu.engine, 0x700, None): [ + b'\x018966353M7000\x00\x00\x00\x00', + b'\x018966353M7100\x00\x00\x00\x00', + b'\x018966353Q2000\x00\x00\x00\x00', + b'\x018966353Q2300\x00\x00\x00\x00', + b'\x018966353Q4000\x00\x00\x00\x00', + b'\x018966353R1100\x00\x00\x00\x00', + b'\x018966353R7100\x00\x00\x00\x00', + b'\x018966353R8100\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'\x0232480000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02353P7000\x00\x00\x00\x00\x00\x00\x00\x00530J5000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02353P9000\x00\x00\x00\x00\x00\x00\x00\x00553C1000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152653300\x00\x00\x00\x00\x00\x00', + b'F152653301\x00\x00\x00\x00\x00\x00', + b'F152653310\x00\x00\x00\x00\x00\x00', + b'F152653330\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881515306200\x00\x00\x00\x00', + b'881515306400\x00\x00\x00\x00', + b'881515306500\x00\x00\x00\x00', + b'881515307400\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B53270\x00\x00\x00\x00\x00\x00', + b'8965B53271\x00\x00\x00\x00\x00\x00', + b'8965B53280\x00\x00\x00\x00\x00\x00', + b'8965B53281\x00\x00\x00\x00\x00\x00', + b'8965B53311\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702300\x00\x00\x00\x00', + b'8821F4702100\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F5301101\x00\x00\x00\x00', + b'8646F5301200\x00\x00\x00\x00', + b'8646F5301300\x00\x00\x00\x00', + b'8646F5301400\x00\x00\x00\x00', + ], + }, + CAR.PRIUS: { + (Ecu.engine, 0x700, None): [ + b'\x02896634761000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634761100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634761200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634762000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634763000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634763100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634765000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634765100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634769000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634769100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634769200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634770000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634774000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634774100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634774200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634782000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x02896634784000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x028966347A0000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x028966347A5000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x028966347A8000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x028966347B0000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x03896634759100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701003\x00\x00\x00\x00', + b'\x03896634759200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701003\x00\x00\x00\x00', + b'\x03896634759200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701004\x00\x00\x00\x00', + b'\x03896634759300\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701004\x00\x00\x00\x00', + b'\x03896634760000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701002\x00\x00\x00\x00', + b'\x03896634760000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701003\x00\x00\x00\x00', + b'\x03896634760000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701004\x00\x00\x00\x00', + b'\x03896634760100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701003\x00\x00\x00\x00', + b'\x03896634760200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701003\x00\x00\x00\x00', + b'\x03896634760200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701004\x00\x00\x00\x00', + b'\x03896634760300\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701004\x00\x00\x00\x00', + b'\x03896634768000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4703001\x00\x00\x00\x00', + b'\x03896634768000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4703002\x00\x00\x00\x00', + b'\x03896634768100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4703002\x00\x00\x00\x00', + b'\x03896634785000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4705001\x00\x00\x00\x00', + b'\x03896634785000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4710001\x00\x00\x00\x00', + b'\x03896634786000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4705001\x00\x00\x00\x00', + b'\x03896634786000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4710001\x00\x00\x00\x00', + b'\x03896634789000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4703002\x00\x00\x00\x00', + b'\x038966347A3000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701003\x00\x00\x00\x00', + b'\x038966347A3000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4707001\x00\x00\x00\x00', + b'\x038966347B6000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4710001\x00\x00\x00\x00', + b'\x038966347B7000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4710001\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B47021\x00\x00\x00\x00\x00\x00', + b'8965B47022\x00\x00\x00\x00\x00\x00', + b'8965B47023\x00\x00\x00\x00\x00\x00', + b'8965B47050\x00\x00\x00\x00\x00\x00', + b'8965B47060\x00\x00\x00\x00\x00\x00', # This is the EPS with good angle sensor + ], + (Ecu.esp, 0x7b0, None): [ + b'F152647290\x00\x00\x00\x00\x00\x00', + b'F152647300\x00\x00\x00\x00\x00\x00', + b'F152647310\x00\x00\x00\x00\x00\x00', + b'F152647414\x00\x00\x00\x00\x00\x00', + b'F152647415\x00\x00\x00\x00\x00\x00', + b'F152647416\x00\x00\x00\x00\x00\x00', + b'F152647417\x00\x00\x00\x00\x00\x00', + b'F152647470\x00\x00\x00\x00\x00\x00', + b'F152647490\x00\x00\x00\x00\x00\x00', + b'F152647682\x00\x00\x00\x00\x00\x00', + b'F152647683\x00\x00\x00\x00\x00\x00', + b'F152647684\x00\x00\x00\x00\x00\x00', + b'F152647862\x00\x00\x00\x00\x00\x00', + b'F152647863\x00\x00\x00\x00\x00\x00', + b'F152647864\x00\x00\x00\x00\x00\x00', + b'F152647865\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881514702300\x00\x00\x00\x00', + b'881514702400\x00\x00\x00\x00', + b'881514703100\x00\x00\x00\x00', + b'881514704100\x00\x00\x00\x00', + b'881514706000\x00\x00\x00\x00', + b'881514706100\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702000\x00\x00\x00\x00', + b'8821F4702100\x00\x00\x00\x00', + b'8821F4702300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F4701300\x00\x00\x00\x00', + b'8646F4702001\x00\x00\x00\x00', + b'8646F4702100\x00\x00\x00\x00', + b'8646F4702200\x00\x00\x00\x00', + b'8646F4705000\x00\x00\x00\x00', + b'8646F4705200\x00\x00\x00\x00', + ], + }, + CAR.PRIUS_V: { + (Ecu.esp, 0x7b0, None): [ + b'F152647280\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'\x0234781000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881514705100\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F4703300\x00\x00\x00\x00', + ], + }, + CAR.RAV4: { + (Ecu.engine, 0x7e0, None): [ + b'\x02342Q1000\x00\x00\x00\x00\x00\x00\x00\x0054212000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02342Q1100\x00\x00\x00\x00\x00\x00\x00\x0054212000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02342Q1200\x00\x00\x00\x00\x00\x00\x00\x0054212000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02342Q1300\x00\x00\x00\x00\x00\x00\x00\x0054212000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02342Q2000\x00\x00\x00\x00\x00\x00\x00\x0054213000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02342Q2100\x00\x00\x00\x00\x00\x00\x00\x0054213000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02342Q2200\x00\x00\x00\x00\x00\x00\x00\x0054213000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02342Q4000\x00\x00\x00\x00\x00\x00\x00\x0054215000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B42063\x00\x00\x00\x00\x00\x00', + b'8965B42073\x00\x00\x00\x00\x00\x00', + b'8965B42082\x00\x00\x00\x00\x00\x00', + b'8965B42083\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F15260R102\x00\x00\x00\x00\x00\x00', + b'F15260R103\x00\x00\x00\x00\x00\x00', + b'F152642493\x00\x00\x00\x00\x00\x00', + b'F152642492\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881514201200\x00\x00\x00\x00', + b'881514201300\x00\x00\x00\x00', + b'881514201400\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702000\x00\x00\x00\x00', + b'8821F4702100\x00\x00\x00\x00', + b'8821F4702300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F4201100\x00\x00\x00\x00', + b'8646F4201200\x00\x00\x00\x00', + b'8646F4202001\x00\x00\x00\x00', + b'8646F4202100\x00\x00\x00\x00', + b'8646F4204000\x00\x00\x00\x00', + ], + }, + CAR.RAV4H: { + (Ecu.engine, 0x7e0, None): [ + b'\x02342N9000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02342N9100\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02342P0000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B42102\x00\x00\x00\x00\x00\x00', + b'8965B42103\x00\x00\x00\x00\x00\x00', + b'8965B42112\x00\x00\x00\x00\x00\x00', + b'8965B42162\x00\x00\x00\x00\x00\x00', + b'8965B42163\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152642090\x00\x00\x00\x00\x00\x00', + b'F152642110\x00\x00\x00\x00\x00\x00', + b'F152642120\x00\x00\x00\x00\x00\x00', + b'F152642400\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881514202200\x00\x00\x00\x00', + b'881514202300\x00\x00\x00\x00', + b'881514202400\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702000\x00\x00\x00\x00', + b'8821F4702100\x00\x00\x00\x00', + b'8821F4702300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F4201100\x00\x00\x00\x00', + b'8646F4201200\x00\x00\x00\x00', + b'8646F4202001\x00\x00\x00\x00', + b'8646F4202100\x00\x00\x00\x00', + b'8646F4204000\x00\x00\x00\x00', + ], + }, + CAR.RAV4_TSS2: { + (Ecu.engine, 0x700, None): [ + b'\x01896630R58000\x00\x00\x00\x00', + b'\x01896630R58100\x00\x00\x00\x00', + b'\x018966342E2000\x00\x00\x00\x00', + b'\x018966342M8000\x00\x00\x00\x00', + b'\x018966342S9000\x00\x00\x00\x00', + b'\x018966342T1000\x00\x00\x00\x00', + b'\x018966342T6000\x00\x00\x00\x00', + b'\x018966342T9000\x00\x00\x00\x00', + b'\x018966342U4000\x00\x00\x00\x00', + b'\x018966342U4100\x00\x00\x00\x00', + b'\x018966342U5100\x00\x00\x00\x00', + b'\x018966342V0000\x00\x00\x00\x00', + b'\x018966342V3000\x00\x00\x00\x00', + b'\x018966342V3100\x00\x00\x00\x00', + b'\x018966342V3200\x00\x00\x00\x00', + b'\x01896634A05000\x00\x00\x00\x00', + b'\x01896634A19000\x00\x00\x00\x00', + b'\x01896634A19100\x00\x00\x00\x00', + b'\x01896634A20000\x00\x00\x00\x00', + b'\x01896634A20100\x00\x00\x00\x00', + b'\x01896634A22000\x00\x00\x00\x00', + b'\x01896634A22100\x00\x00\x00\x00', + b'\x01896634A30000\x00\x00\x00\x00', + b'\x01896634A44000\x00\x00\x00\x00', + b'\x01896634A45000\x00\x00\x00\x00', + b'\x01896634A46000\x00\x00\x00\x00', + b'\x028966342M7000\x00\x00\x00\x00897CF1201001\x00\x00\x00\x00', + b'\x028966342T0000\x00\x00\x00\x00897CF1201001\x00\x00\x00\x00', + b'\x028966342V1000\x00\x00\x00\x00897CF1202001\x00\x00\x00\x00', + b'\x028966342Y8000\x00\x00\x00\x00897CF1201001\x00\x00\x00\x00', + b'\x02896634A18000\x00\x00\x00\x00897CF1201001\x00\x00\x00\x00', + b'\x02896634A18100\x00\x00\x00\x00897CF1201001\x00\x00\x00\x00', + b'\x02896634A43000\x00\x00\x00\x00897CF4201001\x00\x00\x00\x00', + b'\x02896634A47000\x00\x00\x00\x00897CF4201001\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'\x01F15260R210\x00\x00\x00\x00\x00\x00', + b'\x01F15260R220\x00\x00\x00\x00\x00\x00', + b'\x01F15260R290\x00\x00\x00\x00\x00\x00', + b'\x01F15260R300\x00\x00\x00\x00\x00\x00', + b'\x01F152642551\x00\x00\x00\x00\x00\x00', + b'\x01F152642561\x00\x00\x00\x00\x00\x00', + b'\x01F152642700\x00\x00\x00\x00\x00\x00', + b'\x01F152642701\x00\x00\x00\x00\x00\x00', + b'\x01F152642710\x00\x00\x00\x00\x00\x00', + b'\x01F152642711\x00\x00\x00\x00\x00\x00', + b'\x01F152642750\x00\x00\x00\x00\x00\x00', + b'\x01F152642751\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B42170\x00\x00\x00\x00\x00\x00', + b'8965B42171\x00\x00\x00\x00\x00\x00', + b'8965B42180\x00\x00\x00\x00\x00\x00', + b'8965B42181\x00\x00\x00\x00\x00\x00', + b'\x028965B0R01200\x00\x00\x00\x008965B0R02200\x00\x00\x00\x00', + b'\x028965B0R01300\x00\x00\x00\x008965B0R02300\x00\x00\x00\x00', + b'\x028965B0R01400\x00\x00\x00\x008965B0R02400\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F3301100\x00\x00\x00\x00', + b'\x018821F3301200\x00\x00\x00\x00', + b'\x018821F3301300\x00\x00\x00\x00', + b'\x018821F3301400\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F4203200\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F4203300\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F4203400\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F4203500\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F4203700\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + b'\x028646F4203800\x00\x00\x00\x008646G2601500\x00\x00\x00\x00', + ], + }, + CAR.RAV4H_TSS2: { + (Ecu.engine, 0x700, None): [ + b'\x01896634A15000\x00\x00\x00\x00', + b'\x018966342M5000\x00\x00\x00\x00', + b'\x018966342W8000\x00\x00\x00\x00', + b'\x018966342X5000\x00\x00\x00\x00', + b'\x018966342X6000\x00\x00\x00\x00', + b'\x01896634A25000\x00\x00\x00\x00', + b'\x018966342W5000\x00\x00\x00\x00', + b'\x028966342W4001\x00\x00\x00\x00897CF1203001\x00\x00\x00\x00', + b'\x02896634A13000\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02896634A13001\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', + b'\x02896634A13101\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', + b'\x02896634A14001\x00\x00\x00\x00897CF1203001\x00\x00\x00\x00', + b'\x02896634A23000\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02896634A23001\x00\x00\x00\x00897CF1203001\x00\x00\x00\x00', + b'\x02896634A14001\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', + b'\x02896634A14101\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152642291\x00\x00\x00\x00\x00\x00', + b'F152642290\x00\x00\x00\x00\x00\x00', + b'F152642322\x00\x00\x00\x00\x00\x00', + b'F152642330\x00\x00\x00\x00\x00\x00', + b'F152642331\x00\x00\x00\x00\x00\x00', + b'F152642531\x00\x00\x00\x00\x00\x00', + b'F152642532\x00\x00\x00\x00\x00\x00', + b'F152642520\x00\x00\x00\x00\x00\x00', + b'F152642521\x00\x00\x00\x00\x00\x00', + b'F152642540\x00\x00\x00\x00\x00\x00', + b'F152642541\x00\x00\x00\x00\x00\x00', + b'F152642542\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B42170\x00\x00\x00\x00\x00\x00', + b'8965B42171\x00\x00\x00\x00\x00\x00', + b'8965B42180\x00\x00\x00\x00\x00\x00', + b'8965B42181\x00\x00\x00\x00\x00\x00', + b'\x028965B0R01200\x00\x00\x00\x008965B0R02200\x00\x00\x00\x00', + b'\x028965B0R01300\x00\x00\x00\x008965B0R02300\x00\x00\x00\x00', + b'\x028965B0R01400\x00\x00\x00\x008965B0R02400\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F3301100\x00\x00\x00\x00', + b'\x018821F3301200\x00\x00\x00\x00', + b'\x018821F3301300\x00\x00\x00\x00', + b'\x018821F3301400\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F4203200\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F4203300\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F4203400\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F4203500\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F4203700\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + b'\x028646F4203800\x00\x00\x00\x008646G2601500\x00\x00\x00\x00', + ], + }, + CAR.SIENNA: { + (Ecu.engine, 0x700, None): [ + b'\x01896630832100\x00\x00\x00\x00', + b'\x01896630832200\x00\x00\x00\x00', + b'\x01896630838000\x00\x00\x00\x00', + b'\x01896630838100\x00\x00\x00\x00', + b'\x01896630842000\x00\x00\x00\x00', + b'\x01896630843000\x00\x00\x00\x00', + b'\x01896630851000\x00\x00\x00\x00', + b'\x01896630851100\x00\x00\x00\x00', + b'\x01896630851200\x00\x00\x00\x00', + b'\x01896630852000\x00\x00\x00\x00', + b'\x01896630852100\x00\x00\x00\x00', + b'\x01896630859000\x00\x00\x00\x00', + b'\x01896630860000\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B45070\x00\x00\x00\x00\x00\x00', + b'8965B45080\x00\x00\x00\x00\x00\x00', + b'8965B45082\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152608130\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881510801100\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702100\x00\x00\x00\x00', + b'8821F4702200\x00\x00\x00\x00', + b'8821F4702300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F0801100\x00\x00\x00\x00', + ], + }, + CAR.LEXUS_CTH: { + (Ecu.dsu, 0x791, None): [ + b'881517601100\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152676144\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7e0, None): [ + b'\x0237635000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F7601100\x00\x00\x00\x00', + ], + }, + CAR.LEXUS_ES_TSS2: { + (Ecu.engine, 0x700, None): [ + b'\x01896630EC9100\x00\x00\x00\x00', + b'\x018966333T5000\x00\x00\x00\x00', + b'\x018966333T5100\x00\x00\x00\x00', + b'\x018966333X6000\x00\x00\x00\x00', + b'\x01896633T07000\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'\x01F152606281\x00\x00\x00\x00\x00\x00', + b'\x01F152606340\x00\x00\x00\x00\x00\x00', + b'\x01F152606461\x00\x00\x00\x00\x00\x00', + b'\x01F15260E031\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B33252\x00\x00\x00\x00\x00\x00', + b'8965B33590\x00\x00\x00\x00\x00\x00', + b'8965B33690\x00\x00\x00\x00\x00\x00', + b'8965B48271\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F3301100\x00\x00\x00\x00', + b'\x018821F3301200\x00\x00\x00\x00', + b'\x018821F3301400\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F33030D0\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F3303200\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F3304100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F3304300\x00\x00\x00\x008646G2601500\x00\x00\x00\x00', + b'\x028646F4810200\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + ], + }, + CAR.LEXUS_ESH_TSS2: { + (Ecu.engine, 0x700, None): [ + b'\x028966333S8000\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00', + b'\x028966333S8000\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00', + b'\x028966333T0100\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00', + b'\x028966333V4000\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00', + b'\x02896633T09000\x00\x00\x00\x00897CF3307001\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152633423\x00\x00\x00\x00\x00\x00', + b'F152633680\x00\x00\x00\x00\x00\x00', + b'F152633681\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B33252\x00\x00\x00\x00\x00\x00', + b'8965B33590\x00\x00\x00\x00\x00\x00', + b'8965B33690\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F3301100\x00\x00\x00\x00', + b'\x018821F3301200\x00\x00\x00\x00', + b'\x018821F3301300\x00\x00\x00\x00', + b'\x018821F3301400\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F33030D0\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F3303100\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F3303200\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F3304100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F3304200\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + b'\x028646F3304300\x00\x00\x00\x008646G2601500\x00\x00\x00\x00', + ], + }, + CAR.LEXUS_ESH: { + (Ecu.engine, 0x7e0, None): [ + b'\x02333M4200\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152633171\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881513310400\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B33512\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4701100\x00\x00\x00\x00', + b'8821F4701300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F3302001\x00\x00\x00\x00', + b'8646F3302200\x00\x00\x00\x00', + ], + }, + CAR.LEXUS_NX: { + (Ecu.engine, 0x700, None): [ + b'\x01896637850000\x00\x00\x00\x00', + b'\x01896637851000\x00\x00\x00\x00', + b'\x01896637852000\x00\x00\x00\x00', + b'\x01896637854000\x00\x00\x00\x00', + b'\x01896637878000\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152678130\x00\x00\x00\x00\x00\x00', + b'F152678140\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881517803100\x00\x00\x00\x00', + b'881517803300\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B78060\x00\x00\x00\x00\x00\x00', + b'8965B78080\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702100\x00\x00\x00\x00', + b'8821F4702300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F7801100\x00\x00\x00\x00', + b'8646F7801300\x00\x00\x00\x00', + ], + }, + CAR.LEXUS_NX_TSS2: { + (Ecu.engine, 0x700, None): [ + b'\x018966378B2100\x00\x00\x00\x00', + b'\x018966378G3000\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'\x01F152678221\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B78120\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b"\x018821F3301400\x00\x00\x00\x00", + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F78030A0\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F7803100\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + ], + }, + CAR.LEXUS_NXH: { + (Ecu.engine, 0x7e0, None): [ + b'\x0237841000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0237842000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0237880000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0237882000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0237886000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152678160\x00\x00\x00\x00\x00\x00', + b'F152678170\x00\x00\x00\x00\x00\x00', + b'F152678171\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881517804300\x00\x00\x00\x00', + b'881517804100\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B78060\x00\x00\x00\x00\x00\x00', + b'8965B78080\x00\x00\x00\x00\x00\x00', + b'8965B78100\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702300\x00\x00\x00\x00', + b'8821F4702100\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F7801300\x00\x00\x00\x00', + b'8646F7801100\x00\x00\x00\x00', + ], + }, + CAR.LEXUS_RC: { + (Ecu.engine, 0x7e0, None): [ + b'\x0232484000\x00\x00\x00\x00\x00\x00\x00\x0052422000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152624221\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881512409100\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B24081\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F2402200\x00\x00\x00\x00', + ], + }, + CAR.LEXUS_RX: { + (Ecu.engine, 0x700, None): [ + b'\x01896630E36200\x00\x00\x00\x00', + b'\x01896630E36300\x00\x00\x00\x00', + b'\x01896630E37200\x00\x00\x00\x00', + b'\x01896630E37300\x00\x00\x00\x00', + b'\x01896630E41000\x00\x00\x00\x00', + b'\x01896630E41100\x00\x00\x00\x00', + b'\x01896630E41200\x00\x00\x00\x00', + b'\x01896630E41500\x00\x00\x00\x00', + b'\x01896630EA3100\x00\x00\x00\x00', + b'\x01896630EA3400\x00\x00\x00\x00', + b'\x01896630EA4100\x00\x00\x00\x00', + b'\x01896630EA4300\x00\x00\x00\x00', + b'\x01896630EA4400\x00\x00\x00\x00', + b'\x01896630EA6300\x00\x00\x00\x00', + b'\x018966348R1300\x00\x00\x00\x00', + b'\x018966348R8500\x00\x00\x00\x00', + b'\x018966348W1300\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152648472\x00\x00\x00\x00\x00\x00', + b'F152648473\x00\x00\x00\x00\x00\x00', + b'F152648492\x00\x00\x00\x00\x00\x00', + b'F152648493\x00\x00\x00\x00\x00\x00', + b'F152648474\x00\x00\x00\x00\x00\x00', + b'F152648630\x00\x00\x00\x00\x00\x00', + b'F152648494\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881514810300\x00\x00\x00\x00', + b'881514810500\x00\x00\x00\x00', + b'881514810700\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B0E011\x00\x00\x00\x00\x00\x00', + b'8965B0E012\x00\x00\x00\x00\x00\x00', + b'8965B48102\x00\x00\x00\x00\x00\x00', + b'8965B48111\x00\x00\x00\x00\x00\x00', + b'8965B48112\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4701000\x00\x00\x00\x00', + b'8821F4701100\x00\x00\x00\x00', + b'8821F4701200\x00\x00\x00\x00', + b'8821F4701300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F4801100\x00\x00\x00\x00', + b'8646F4801200\x00\x00\x00\x00', + b'8646F4802001\x00\x00\x00\x00', + b'8646F4802100\x00\x00\x00\x00', + b'8646F4802200\x00\x00\x00\x00', + b'8646F4809000\x00\x00\x00\x00', + ], + }, + CAR.LEXUS_RXH: { + (Ecu.engine, 0x7e0, None): [ + b'\x02348J7000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02348N0000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02348Q4000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02348Q4100\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02348T1100\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02348T3000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02348V6000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x02348Z3000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152648361\x00\x00\x00\x00\x00\x00', + b'F152648501\x00\x00\x00\x00\x00\x00', + b'F152648502\x00\x00\x00\x00\x00\x00', + b'F152648504\x00\x00\x00\x00\x00\x00', + b'F152648740\x00\x00\x00\x00\x00\x00', + b'F152648A30\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881514811300\x00\x00\x00\x00', + b'881514811500\x00\x00\x00\x00', + b'881514811700\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B0E011\x00\x00\x00\x00\x00\x00', + b'8965B0E012\x00\x00\x00\x00\x00\x00', + b'8965B48111\x00\x00\x00\x00\x00\x00', + b'8965B48112\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4701000\x00\x00\x00\x00', + b'8821F4701100\x00\x00\x00\x00', + b'8821F4701200\x00\x00\x00\x00', + b'8821F4701300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F4801200\x00\x00\x00\x00', + b'8646F4802001\x00\x00\x00\x00', + b'8646F4802100\x00\x00\x00\x00', + b'8646F4802200\x00\x00\x00\x00', + b'8646F4809000\x00\x00\x00\x00', + ], + }, + CAR.LEXUS_RX_TSS2: { + (Ecu.engine, 0x700, None): [ + b'\x01896630EA9000\x00\x00\x00\x00', + b'\x01896630EB0000\x00\x00\x00\x00', + b'\x01896630EC9000\x00\x00\x00\x00', + b'\x01896630ED0000\x00\x00\x00\x00', + b'\x01896630ED6000\x00\x00\x00\x00', + b'\x018966348W5100\x00\x00\x00\x00', + b'\x018966348W9000\x00\x00\x00\x00', + b'\x01896634D12000\x00\x00\x00\x00', + b'\x01896634D12100\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'\x01F15260E031\x00\x00\x00\x00\x00\x00', + b'\x01F15260E041\x00\x00\x00\x00\x00\x00', + b'\x01F152648781\x00\x00\x00\x00\x00\x00', + b'\x01F152648801\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B48261\x00\x00\x00\x00\x00\x00', + b'8965B48271\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F3301100\x00\x00\x00\x00', + b'\x018821F3301300\x00\x00\x00\x00', + b'\x018821F3301400\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F4810100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F4810200\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + b'\x028646F4810300\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + ], + }, + CAR.LEXUS_RXH_TSS2: { + (Ecu.engine, 0x7e0, None): [ + b'\x02348X8000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0234D14000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0234D16000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152648831\x00\x00\x00\x00\x00\x00', + b'F152648D00\x00\x00\x00\x00\x00\x00', + b'F152648D60\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B48271\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F3301400\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F4810200\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + b'\x028646F4810100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + ], + }, + CAR.PRIUS_TSS2: { + (Ecu.engine, 0x700, None): [ + b'\x028966347B1000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x028966347C6000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x028966347C8000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x038966347C0000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4710101\x00\x00\x00\x00', + b'\x038966347C1000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4710101\x00\x00\x00\x00', + b'\x038966347C5000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4707101\x00\x00\x00\x00', + b'\x038966347C5100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4707101\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152647500\x00\x00\x00\x00\x00\x00', + b'F152647510\x00\x00\x00\x00\x00\x00', + b'F152647520\x00\x00\x00\x00\x00\x00', + b'F152647521\x00\x00\x00\x00\x00\x00', + b'F152647531\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B47070\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F3301400\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F4707000\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + b'\x028646F4710000\x00\x00\x00\x008646G2601500\x00\x00\x00\x00', + ], + }, + CAR.MIRAI: { + (Ecu.esp, 0x7D1, None): [b'\x01898A36203000\x00\x00\x00\x00',], + (Ecu.esp, 0x7B0, None): [b'\x01F15266203200\x00\x00\x00\x00',], # a second ESP ECU + (Ecu.eps, 0x7A1, None): [b'\x028965B6204100\x00\x00\x00\x008965B6203100\x00\x00\x00\x00',], + (Ecu.fwdRadar, 0x750, 0xf): [b'\x018821F6201200\x00\x00\x00\x00',], + (Ecu.fwdCamera, 0x750, 0x6d): [b'\x028646F6201400\x00\x00\x00\x008646G5301200\x00\x00\x00\x00',], + }, + CAR.ALPHARD_TSS2: { + (Ecu.engine, 0x7e0, None): [ + b'\x0235870000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0235883000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B58040\x00\x00\x00\x00\x00\x00', + b'8965B58052\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F3301200\x00\x00\x00\x00', + b'\x018821F3301400\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F58010C0\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', + b'\x028646F5803200\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + ], + }, +} + +STEER_THRESHOLD = 100 + +DBC = { + CAR.RAV4H: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + CAR.RAV4: dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), + CAR.PRIUS: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), + CAR.PRIUS_V: dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), + CAR.COROLLA: dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), + CAR.LEXUS_RC: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + CAR.LEXUS_RX: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + CAR.LEXUS_RXH: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + CAR.LEXUS_RX_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.LEXUS_RXH_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.CHR: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), + CAR.CHRH: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), + CAR.CAMRY: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), + CAR.CAMRYH: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), + CAR.CAMRY_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.CAMRYH_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.HIGHLANDER: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + CAR.HIGHLANDER_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.HIGHLANDERH: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + CAR.HIGHLANDERH_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.AVALON: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + CAR.AVALON_2019: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), + CAR.AVALONH_2019: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), + CAR.AVALON_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.RAV4_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.COROLLA_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.COROLLAH_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.LEXUS_ES_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.LEXUS_ESH_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.LEXUS_ESH: dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), + CAR.SIENNA: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + CAR.LEXUS_IS: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + CAR.LEXUS_CTH: dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), + CAR.RAV4H_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.LEXUS_NXH: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + CAR.LEXUS_NX: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + CAR.LEXUS_NX_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.PRIUS_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.MIRAI: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), + CAR.ALPHARD_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), +} + +# These cars have non-standard EPS torque scale factors. All others are 73 +EPS_SCALE = defaultdict(lambda: 73, {CAR.PRIUS: 66, CAR.COROLLA: 88, CAR.LEXUS_IS: 77, CAR.LEXUS_RC: 77, CAR.LEXUS_CTH: 100, CAR.PRIUS_V: 100}) + +# Toyota/Lexus Safety Sense 2.0 and 2.5 +TSS2_CAR = {CAR.RAV4_TSS2, CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2, CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2, CAR.RAV4H_TSS2, + CAR.LEXUS_RX_TSS2, CAR.LEXUS_RXH_TSS2, CAR.HIGHLANDER_TSS2, CAR.HIGHLANDERH_TSS2, CAR.PRIUS_TSS2, CAR.CAMRY_TSS2, CAR.CAMRYH_TSS2, + CAR.MIRAI, CAR.LEXUS_NX_TSS2, CAR.ALPHARD_TSS2, CAR.AVALON_TSS2} + +NO_DSU_CAR = TSS2_CAR | {CAR.CHR, CAR.CHRH, CAR.CAMRY, CAR.CAMRYH} + +# no resume button press required +NO_STOP_TIMER_CAR = TSS2_CAR | {CAR.PRIUS_V, CAR.RAV4H, CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.SIENNA, CAR.LEXUS_ESH} diff --git a/selfdrive/car/vin.py b/selfdrive/car/vin.py new file mode 100755 index 000000000..648f41651 --- /dev/null +++ b/selfdrive/car/vin.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +import traceback + +import cereal.messaging as messaging +from panda.python.uds import FUNCTIONAL_ADDRS +from selfdrive.car.isotp_parallel_query import IsoTpParallelQuery +from selfdrive.swaglog import cloudlog + +VIN_REQUEST = b'\x09\x02' +VIN_RESPONSE = b'\x49\x02\x01' +VIN_UNKNOWN = "0" * 17 + + +def get_vin(logcan, sendcan, bus, timeout=0.1, retry=5, debug=False): + for i in range(retry): + try: + query = IsoTpParallelQuery(sendcan, logcan, bus, FUNCTIONAL_ADDRS, [VIN_REQUEST], [VIN_RESPONSE], functional_addr=True, debug=debug) + for addr, vin in query.get_data(timeout).items(): + return addr[0], vin.decode() + print(f"vin query retry ({i+1}) ...") + except Exception: + cloudlog.warning(f"VIN query exception: {traceback.format_exc()}") + + return 0, VIN_UNKNOWN + + +if __name__ == "__main__": + import time + sendcan = messaging.pub_sock('sendcan') + logcan = messaging.sub_sock('can') + time.sleep(1) + addr, vin = get_vin(logcan, sendcan, 1, debug=False) + print(hex(addr), vin) diff --git a/selfdrive/car/volkswagen/__init__.py b/selfdrive/car/volkswagen/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/car/volkswagen/carcontroller.py b/selfdrive/car/volkswagen/carcontroller.py new file mode 100644 index 000000000..f85a81a53 --- /dev/null +++ b/selfdrive/car/volkswagen/carcontroller.py @@ -0,0 +1,116 @@ +from cereal import car +from selfdrive.car import apply_std_steer_torque_limits +from selfdrive.car.volkswagen import volkswagencan +from selfdrive.car.volkswagen.values import DBC_FILES, CANBUS, MQB_LDW_MESSAGES, BUTTON_STATES, CarControllerParams as P +from opendbc.can.packer import CANPacker + +VisualAlert = car.CarControl.HUDControl.VisualAlert + +class CarController(): + def __init__(self, dbc_name, CP, VM): + self.apply_steer_last = 0 + + self.packer_pt = CANPacker(DBC_FILES.mqb) + + self.hcaSameTorqueCount = 0 + self.hcaEnabledFrameCount = 0 + self.graButtonStatesToSend = None + self.graMsgSentCount = 0 + self.graMsgStartFramePrev = 0 + self.graMsgBusCounterPrev = 0 + + self.steer_rate_limited = False + + def update(self, c, enabled, CS, frame, ext_bus, actuators, visual_alert, left_lane_visible, right_lane_visible, left_lane_depart, right_lane_depart): + """ Controls thread """ + + can_sends = [] + + # **** Steering Controls ************************************************ # + + if frame % P.HCA_STEP == 0: + # Logic to avoid HCA state 4 "refused": + # * Don't steer unless HCA is in state 3 "ready" or 5 "active" + # * Don't steer at standstill + # * Don't send > 3.00 Newton-meters torque + # * Don't send the same torque for > 6 seconds + # * Don't send uninterrupted steering for > 360 seconds + # One frame of HCA disabled is enough to reset the timer, without zeroing the + # torque value. Do that anytime we happen to have 0 torque, or failing that, + # when exceeding ~1/3 the 360 second timer. + + if c.active and CS.out.vEgo > CS.CP.minSteerSpeed and not (CS.out.standstill or CS.out.steerError or CS.out.steerWarning): + new_steer = int(round(actuators.steer * P.STEER_MAX)) + apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, P) + self.steer_rate_limited = new_steer != apply_steer + if apply_steer == 0: + hcaEnabled = False + self.hcaEnabledFrameCount = 0 + else: + self.hcaEnabledFrameCount += 1 + if self.hcaEnabledFrameCount >= 118 * (100 / P.HCA_STEP): # 118s + hcaEnabled = False + self.hcaEnabledFrameCount = 0 + else: + hcaEnabled = True + if self.apply_steer_last == apply_steer: + self.hcaSameTorqueCount += 1 + if self.hcaSameTorqueCount > 1.9 * (100 / P.HCA_STEP): # 1.9s + apply_steer -= (1, -1)[apply_steer < 0] + self.hcaSameTorqueCount = 0 + else: + self.hcaSameTorqueCount = 0 + else: + hcaEnabled = False + apply_steer = 0 + + self.apply_steer_last = apply_steer + idx = (frame / P.HCA_STEP) % 16 + can_sends.append(volkswagencan.create_mqb_steering_control(self.packer_pt, CANBUS.pt, apply_steer, + idx, hcaEnabled)) + + # **** HUD Controls ***************************************************** # + + if frame % P.LDW_STEP == 0: + if visual_alert in (VisualAlert.steerRequired, VisualAlert.ldw): + hud_alert = MQB_LDW_MESSAGES["laneAssistTakeOverSilent"] + else: + hud_alert = MQB_LDW_MESSAGES["none"] + + can_sends.append(volkswagencan.create_mqb_hud_control(self.packer_pt, CANBUS.pt, enabled, + CS.out.steeringPressed, hud_alert, left_lane_visible, + right_lane_visible, CS.ldw_stock_values, + left_lane_depart, right_lane_depart)) + + # **** ACC Button Controls ********************************************** # + + # FIXME: this entire section is in desperate need of refactoring + + if CS.CP.pcmCruise: + if frame > self.graMsgStartFramePrev + P.GRA_VBP_STEP: + if not enabled and CS.out.cruiseState.enabled: + # Cancel ACC if it's engaged with OP disengaged. + self.graButtonStatesToSend = BUTTON_STATES.copy() + self.graButtonStatesToSend["cancel"] = True + elif enabled and CS.esp_hold_confirmation: + # Blip the Resume button if we're engaged at standstill. + # FIXME: This is a naive implementation, improve with visiond or radar input. + self.graButtonStatesToSend = BUTTON_STATES.copy() + self.graButtonStatesToSend["resumeCruise"] = True + + if CS.graMsgBusCounter != self.graMsgBusCounterPrev: + self.graMsgBusCounterPrev = CS.graMsgBusCounter + if self.graButtonStatesToSend is not None: + if self.graMsgSentCount == 0: + self.graMsgStartFramePrev = frame + idx = (CS.graMsgBusCounter + 1) % 16 + can_sends.append(volkswagencan.create_mqb_acc_buttons_control(self.packer_pt, ext_bus, self.graButtonStatesToSend, CS, idx)) + self.graMsgSentCount += 1 + if self.graMsgSentCount >= P.GRA_VBP_COUNT: + self.graButtonStatesToSend = None + self.graMsgSentCount = 0 + + new_actuators = actuators.copy() + new_actuators.steer = self.apply_steer_last / P.STEER_MAX + + return new_actuators, can_sends diff --git a/selfdrive/car/volkswagen/carstate.py b/selfdrive/car/volkswagen/carstate.py new file mode 100644 index 000000000..bfbb071b6 --- /dev/null +++ b/selfdrive/car/volkswagen/carstate.py @@ -0,0 +1,293 @@ +import numpy as np +from cereal import car +from selfdrive.config import Conversions as CV +from selfdrive.car.interfaces import CarStateBase +from opendbc.can.parser import CANParser +from opendbc.can.can_define import CANDefine +from selfdrive.car.volkswagen.values import DBC_FILES, CANBUS, NetworkLocation, TransmissionType, GearShifter, BUTTON_STATES, CarControllerParams + +class CarState(CarStateBase): + def __init__(self, CP): + super().__init__(CP) + can_define = CANDefine(DBC_FILES.mqb) + if CP.transmissionType == TransmissionType.automatic: + self.shifter_values = can_define.dv["Getriebe_11"]["GE_Fahrstufe"] + elif CP.transmissionType == TransmissionType.direct: + self.shifter_values = can_define.dv["EV_Gearshift"]["GearPosition"] + self.hca_status_values = can_define.dv["LH_EPS_03"]["EPS_HCA_Status"] + self.buttonStates = BUTTON_STATES.copy() + + def update(self, pt_cp, cam_cp, ext_cp, trans_type): + ret = car.CarState.new_message() + # Update vehicle speed and acceleration from ABS wheel speeds. + ret.wheelSpeeds = self.get_wheel_speeds( + pt_cp.vl["ESP_19"]["ESP_VL_Radgeschw_02"], + pt_cp.vl["ESP_19"]["ESP_VR_Radgeschw_02"], + pt_cp.vl["ESP_19"]["ESP_HL_Radgeschw_02"], + pt_cp.vl["ESP_19"]["ESP_HR_Radgeschw_02"], + ) + + ret.vEgoRaw = float(np.mean([ret.wheelSpeeds.fl, ret.wheelSpeeds.fr, ret.wheelSpeeds.rl, ret.wheelSpeeds.rr])) + ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) + ret.standstill = ret.vEgo < 0.1 + + # Update steering angle, rate, yaw rate, and driver input torque. VW send + # the sign/direction in a separate signal so they must be recombined. + ret.steeringAngleDeg = pt_cp.vl["LWI_01"]["LWI_Lenkradwinkel"] * (1, -1)[int(pt_cp.vl["LWI_01"]["LWI_VZ_Lenkradwinkel"])] + ret.steeringRateDeg = pt_cp.vl["LWI_01"]["LWI_Lenkradw_Geschw"] * (1, -1)[int(pt_cp.vl["LWI_01"]["LWI_VZ_Lenkradw_Geschw"])] + ret.steeringTorque = pt_cp.vl["LH_EPS_03"]["EPS_Lenkmoment"] * (1, -1)[int(pt_cp.vl["LH_EPS_03"]["EPS_VZ_Lenkmoment"])] + ret.steeringPressed = abs(ret.steeringTorque) > CarControllerParams.STEER_DRIVER_ALLOWANCE + ret.yawRate = pt_cp.vl["ESP_02"]["ESP_Gierrate"] * (1, -1)[int(pt_cp.vl["ESP_02"]["ESP_VZ_Gierrate"])] * CV.DEG_TO_RAD + + # Verify EPS readiness to accept steering commands + hca_status = self.hca_status_values.get(pt_cp.vl["LH_EPS_03"]["EPS_HCA_Status"]) + ret.steerError = hca_status in ("DISABLED", "FAULT") + ret.steerWarning = hca_status in ("INITIALIZING", "REJECTED") + + # Update gas, brakes, and gearshift. + ret.gas = pt_cp.vl["Motor_20"]["MO_Fahrpedalrohwert_01"] / 100.0 + ret.gasPressed = ret.gas > 0 + ret.brake = pt_cp.vl["ESP_05"]["ESP_Bremsdruck"] / 250.0 # FIXME: this is pressure in Bar, not sure what OP expects + ret.brakePressed = bool(pt_cp.vl["ESP_05"]["ESP_Fahrer_bremst"]) + self.esp_hold_confirmation = pt_cp.vl["ESP_21"]["ESP_Haltebestaetigung"] + + # Update gear and/or clutch position data. + if trans_type == TransmissionType.automatic: + ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(pt_cp.vl["Getriebe_11"]["GE_Fahrstufe"], None)) + elif trans_type == TransmissionType.direct: + ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(pt_cp.vl["EV_Gearshift"]["GearPosition"], None)) + elif trans_type == TransmissionType.manual: + ret.clutchPressed = not pt_cp.vl["Motor_14"]["MO_Kuppl_schalter"] + if bool(pt_cp.vl["Gateway_72"]["BCM1_Rueckfahrlicht_Schalter"]): + ret.gearShifter = GearShifter.reverse + else: + ret.gearShifter = GearShifter.drive + + # Update door and trunk/hatch lid open status. + ret.doorOpen = any([pt_cp.vl["Gateway_72"]["ZV_FT_offen"], + pt_cp.vl["Gateway_72"]["ZV_BT_offen"], + pt_cp.vl["Gateway_72"]["ZV_HFS_offen"], + pt_cp.vl["Gateway_72"]["ZV_HBFS_offen"], + pt_cp.vl["Gateway_72"]["ZV_HD_offen"]]) + + # Update seatbelt fastened status. + ret.seatbeltUnlatched = pt_cp.vl["Airbag_02"]["AB_Gurtschloss_FA"] != 3 + + # Update driver preference for metric. VW stores many different unit + # preferences, including separate units for for distance vs. speed. + # We use the speed preference for OP. + self.displayMetricUnits = not pt_cp.vl["Einheiten_01"]["KBI_MFA_v_Einheit_02"] + + # Consume blind-spot monitoring info/warning LED states, if available. + # Infostufe: BSM LED on, Warnung: BSM LED flashing + if self.CP.enableBsm: + ret.leftBlindspot = bool(ext_cp.vl["SWA_01"]["SWA_Infostufe_SWA_li"]) or bool(ext_cp.vl["SWA_01"]["SWA_Warnung_SWA_li"]) + ret.rightBlindspot = bool(ext_cp.vl["SWA_01"]["SWA_Infostufe_SWA_re"]) or bool(ext_cp.vl["SWA_01"]["SWA_Warnung_SWA_re"]) + + # Consume factory LDW data relevant for factory SWA (Lane Change Assist) + # and capture it for forwarding to the blind spot radar controller + self.ldw_stock_values = cam_cp.vl["LDW_02"] if self.CP.networkLocation == NetworkLocation.fwdCamera else {} + + # Stock FCW is considered active if the release bit for brake-jerk warning + # is set. Stock AEB considered active if the partial braking or target + # braking release bits are set. + # Refer to VW Self Study Program 890253: Volkswagen Driver Assistance + # Systems, chapter on Front Assist with Braking: Golf Family for all MQB + ret.stockFcw = bool(ext_cp.vl["ACC_10"]["AWV2_Freigabe"]) + ret.stockAeb = bool(ext_cp.vl["ACC_10"]["ANB_Teilbremsung_Freigabe"]) or bool(ext_cp.vl["ACC_10"]["ANB_Zielbremsung_Freigabe"]) + + # Update ACC radar status. + self.tsk_status = pt_cp.vl["TSK_06"]["TSK_Status"] + if self.tsk_status == 2: + # ACC okay and enabled, but not currently engaged + ret.cruiseState.available = True + ret.cruiseState.enabled = False + elif self.tsk_status in (3, 4, 5): + # ACC okay and enabled, currently regulating speed (3) or driver accel override (4) or overrun coast-down (5) + ret.cruiseState.available = True + ret.cruiseState.enabled = True + else: + # ACC okay but disabled (1), or a radar visibility or other fault/disruption (6 or 7) + ret.cruiseState.available = False + ret.cruiseState.enabled = False + + # Update ACC setpoint. When the setpoint is zero or there's an error, the + # radar sends a set-speed of ~90.69 m/s / 203mph. + if self.CP.pcmCruise: + ret.cruiseState.speed = ext_cp.vl["ACC_02"]["ACC_Wunschgeschw"] * CV.KPH_TO_MS + if ret.cruiseState.speed > 90: + ret.cruiseState.speed = 0 + + # Update control button states for turn signals and ACC controls. + self.buttonStates["accelCruise"] = bool(pt_cp.vl["GRA_ACC_01"]["GRA_Tip_Hoch"]) + self.buttonStates["decelCruise"] = bool(pt_cp.vl["GRA_ACC_01"]["GRA_Tip_Runter"]) + self.buttonStates["cancel"] = bool(pt_cp.vl["GRA_ACC_01"]["GRA_Abbrechen"]) + self.buttonStates["setCruise"] = bool(pt_cp.vl["GRA_ACC_01"]["GRA_Tip_Setzen"]) + self.buttonStates["resumeCruise"] = bool(pt_cp.vl["GRA_ACC_01"]["GRA_Tip_Wiederaufnahme"]) + self.buttonStates["gapAdjustCruise"] = bool(pt_cp.vl["GRA_ACC_01"]["GRA_Verstellung_Zeitluecke"]) + ret.leftBlinker = bool(pt_cp.vl["Blinkmodi_02"]["Comfort_Signal_Left"]) + ret.rightBlinker = bool(pt_cp.vl["Blinkmodi_02"]["Comfort_Signal_Right"]) + + # Read ACC hardware button type configuration info that has to pass thru + # to the radar. Ends up being different for steering wheel buttons vs + # third stalk type controls. + self.graHauptschalter = pt_cp.vl["GRA_ACC_01"]["GRA_Hauptschalter"] + self.graTypHauptschalter = pt_cp.vl["GRA_ACC_01"]["GRA_Typ_Hauptschalter"] + self.graButtonTypeInfo = pt_cp.vl["GRA_ACC_01"]["GRA_ButtonTypeInfo"] + self.graTipStufe2 = pt_cp.vl["GRA_ACC_01"]["GRA_Tip_Stufe_2"] + # Pick up the GRA_ACC_01 CAN message counter so we can sync to it for + # later cruise-control button spamming. + self.graMsgBusCounter = pt_cp.vl["GRA_ACC_01"]["COUNTER"] + + # Additional safety checks performed in CarInterface. + self.parkingBrakeSet = bool(pt_cp.vl["Kombi_01"]["KBI_Handbremse"]) # FIXME: need to include an EPB check as well + ret.espDisabled = pt_cp.vl["ESP_21"]["ESP_Tastung_passiv"] != 0 + + return ret + + @staticmethod + def get_can_parser(CP): + signals = [ + # sig_name, sig_address + ("LWI_Lenkradwinkel", "LWI_01"), # Absolute steering angle + ("LWI_VZ_Lenkradwinkel", "LWI_01"), # Steering angle sign + ("LWI_Lenkradw_Geschw", "LWI_01"), # Absolute steering rate + ("LWI_VZ_Lenkradw_Geschw", "LWI_01"), # Steering rate sign + ("ESP_VL_Radgeschw_02", "ESP_19"), # ABS wheel speed, front left + ("ESP_VR_Radgeschw_02", "ESP_19"), # ABS wheel speed, front right + ("ESP_HL_Radgeschw_02", "ESP_19"), # ABS wheel speed, rear left + ("ESP_HR_Radgeschw_02", "ESP_19"), # ABS wheel speed, rear right + ("ESP_Gierrate", "ESP_02"), # Absolute yaw rate + ("ESP_VZ_Gierrate", "ESP_02"), # Yaw rate sign + ("ZV_FT_offen", "Gateway_72"), # Door open, driver + ("ZV_BT_offen", "Gateway_72"), # Door open, passenger + ("ZV_HFS_offen", "Gateway_72"), # Door open, rear left + ("ZV_HBFS_offen", "Gateway_72"), # Door open, rear right + ("ZV_HD_offen", "Gateway_72"), # Trunk or hatch open + ("Comfort_Signal_Left", "Blinkmodi_02"), # Left turn signal including comfort blink interval + ("Comfort_Signal_Right", "Blinkmodi_02"), # Right turn signal including comfort blink interval + ("AB_Gurtschloss_FA", "Airbag_02"), # Seatbelt status, driver + ("AB_Gurtschloss_BF", "Airbag_02"), # Seatbelt status, passenger + ("ESP_Fahrer_bremst", "ESP_05"), # Brake pedal pressed + ("ESP_Bremsdruck", "ESP_05"), # Brake pressure applied + ("MO_Fahrpedalrohwert_01", "Motor_20"), # Accelerator pedal value + ("EPS_Lenkmoment", "LH_EPS_03"), # Absolute driver torque input + ("EPS_VZ_Lenkmoment", "LH_EPS_03"), # Driver torque input sign + ("EPS_HCA_Status", "LH_EPS_03"), # EPS HCA control status + ("ESP_Tastung_passiv", "ESP_21"), # Stability control disabled + ("ESP_Haltebestaetigung", "ESP_21"), # ESP hold confirmation + ("KBI_MFA_v_Einheit_02", "Einheiten_01"), # MPH vs KMH speed display + ("KBI_Handbremse", "Kombi_01"), # Manual handbrake applied + ("TSK_Status", "TSK_06"), # ACC engagement status from drivetrain coordinator + ("GRA_Hauptschalter", "GRA_ACC_01"), # ACC button, on/off + ("GRA_Abbrechen", "GRA_ACC_01"), # ACC button, cancel + ("GRA_Tip_Setzen", "GRA_ACC_01"), # ACC button, set + ("GRA_Tip_Hoch", "GRA_ACC_01"), # ACC button, increase or accel + ("GRA_Tip_Runter", "GRA_ACC_01"), # ACC button, decrease or decel + ("GRA_Tip_Wiederaufnahme", "GRA_ACC_01"), # ACC button, resume + ("GRA_Verstellung_Zeitluecke", "GRA_ACC_01"), # ACC button, time gap adj + ("GRA_Typ_Hauptschalter", "GRA_ACC_01"), # ACC main button type + ("GRA_Tip_Stufe_2", "GRA_ACC_01"), # unknown related to stalk type + ("GRA_ButtonTypeInfo", "GRA_ACC_01"), # unknown related to stalk type + ("COUNTER", "GRA_ACC_01"), # GRA_ACC_01 CAN message counter + ] + + checks = [ + # sig_address, frequency + ("LWI_01", 100), # From J500 Steering Assist with integrated sensors + ("LH_EPS_03", 100), # From J500 Steering Assist with integrated sensors + ("ESP_19", 100), # From J104 ABS/ESP controller + ("ESP_05", 50), # From J104 ABS/ESP controller + ("ESP_21", 50), # From J104 ABS/ESP controller + ("Motor_20", 50), # From J623 Engine control module + ("TSK_06", 50), # From J623 Engine control module + ("ESP_02", 50), # From J104 ABS/ESP controller + ("GRA_ACC_01", 33), # From J533 CAN gateway (via LIN from steering wheel controls) + ("Gateway_72", 10), # From J533 CAN gateway (aggregated data) + ("Airbag_02", 5), # From J234 Airbag control module + ("Kombi_01", 2), # From J285 Instrument cluster + ("Blinkmodi_02", 1), # From J519 BCM (sent at 1Hz when no lights active, 50Hz when active) + ("Einheiten_01", 1), # From J??? not known if gateway, cluster, or BCM + ] + + if CP.enableBsm: + signals += [ + ("SWA_Infostufe_SWA_li", "SWA_01", 0), # Blind spot object info, left + ("SWA_Warnung_SWA_li", "SWA_01", 0), # Blind spot object warning, left + ("SWA_Infostufe_SWA_re", "SWA_01", 0), # Blind spot object info, right + ("SWA_Warnung_SWA_re", "SWA_01", 0), # Blind spot object warning, right + ] + checks += [ + ("SWA_01", 20), + ] + + if CP.transmissionType == TransmissionType.automatic: + signals.append(("GE_Fahrstufe", "Getriebe_11")) # Auto trans gear selector position + checks.append(("Getriebe_11", 20)) # From J743 Auto transmission control module + elif CP.transmissionType == TransmissionType.direct: + signals.append(("GearPosition", "EV_Gearshift")) # EV gear selector position + checks.append(("EV_Gearshift", 10)) # From J??? unknown EV control module + elif CP.transmissionType == TransmissionType.manual: + signals += [("MO_Kuppl_schalter", "Motor_14"), # Clutch switch + ("BCM1_Rueckfahrlicht_Schalter", "Gateway_72")] # Reverse light from BCM + checks.append(("Motor_14", 10)) # From J623 Engine control module + + if CP.networkLocation == NetworkLocation.fwdCamera: + # Radars are here on CANBUS.pt + signals += MqbExtraSignals.fwd_radar_signals + checks += MqbExtraSignals.fwd_radar_checks + if CP.enableBsm: + signals += MqbExtraSignals.bsm_radar_signals + checks += MqbExtraSignals.bsm_radar_checks + + return CANParser(DBC_FILES.mqb, signals, checks, CANBUS.pt) + + @staticmethod + def get_cam_can_parser(CP): + signals = [] + checks = [] + + if CP.networkLocation == NetworkLocation.fwdCamera: + signals += [ + # sig_name, sig_address + ("LDW_SW_Warnung_links", "LDW_02"), # Blind spot in warning mode on left side due to lane departure + ("LDW_SW_Warnung_rechts", "LDW_02"), # Blind spot in warning mode on right side due to lane departure + ("LDW_Seite_DLCTLC", "LDW_02"), # Direction of most likely lane departure (left or right) + ("LDW_DLC", "LDW_02"), # Lane departure, distance to line crossing + ("LDW_TLC", "LDW_02"), # Lane departure, time to line crossing + ] + checks += [ + # sig_address, frequency + ("LDW_02", 10) # From R242 Driver assistance camera + ] + else: + # Radars are here on CANBUS.cam + signals += MqbExtraSignals.fwd_radar_signals + checks += MqbExtraSignals.fwd_radar_checks + if CP.enableBsm: + signals += MqbExtraSignals.bsm_radar_signals + checks += MqbExtraSignals.bsm_radar_checks + + return CANParser(DBC_FILES.mqb, signals, checks, CANBUS.cam) + +class MqbExtraSignals: + # Additional signal and message lists for optional or bus-portable controllers + fwd_radar_signals = [ + ("ACC_Wunschgeschw", "ACC_02"), # ACC set speed + ("AWV2_Freigabe", "ACC_10"), # FCW brake jerk release + ("ANB_Teilbremsung_Freigabe", "ACC_10"), # AEB partial braking release + ("ANB_Zielbremsung_Freigabe", "ACC_10"), # AEB target braking release + ] + fwd_radar_checks = [ + ("ACC_10", 50), # From J428 ACC radar control module + ("ACC_02", 17), # From J428 ACC radar control module + ] + bsm_radar_signals = [ + ("SWA_Infostufe_SWA_li", "SWA_01"), # Blind spot object info, left + ("SWA_Warnung_SWA_li", "SWA_01"), # Blind spot object warning, left + ("SWA_Infostufe_SWA_re", "SWA_01"), # Blind spot object info, right + ("SWA_Warnung_SWA_re", "SWA_01"), # Blind spot object warning, right + ] + bsm_radar_checks = [ + ("SWA_01", 20), # From J1086 Lane Change Assist + ] diff --git a/selfdrive/car/volkswagen/interface.py b/selfdrive/car/volkswagen/interface.py new file mode 100644 index 000000000..e88f9e90a --- /dev/null +++ b/selfdrive/car/volkswagen/interface.py @@ -0,0 +1,223 @@ +from cereal import car +from selfdrive.car.volkswagen.values import CAR, BUTTON_STATES, CANBUS, NetworkLocation, TransmissionType, GearShifter +from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config +from selfdrive.car.interfaces import CarInterfaceBase + +EventName = car.CarEvent.EventName + + +class CarInterface(CarInterfaceBase): + def __init__(self, CP, CarController, CarState): + super().__init__(CP, CarController, CarState) + + self.displayMetricUnitsPrev = None + self.buttonStatesPrev = BUTTON_STATES.copy() + + if CP.networkLocation == NetworkLocation.fwdCamera: + self.ext_bus = CANBUS.pt + self.cp_ext = self.cp + else: + self.ext_bus = CANBUS.cam + self.cp_ext = self.cp_cam + + @staticmethod + def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None): + ret = CarInterfaceBase.get_std_params(candidate, fingerprint) + ret.carName = "volkswagen" + ret.radarOffCan = True + + if True: # pylint: disable=using-constant-test + # Set global MQB parameters + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.volkswagen)] + ret.enableBsm = 0x30F in fingerprint[0] # SWA_01 + + if 0xAD in fingerprint[0]: # Getriebe_11 + ret.transmissionType = TransmissionType.automatic + elif 0x187 in fingerprint[0]: # EV_Gearshift + ret.transmissionType = TransmissionType.direct + else: + ret.transmissionType = TransmissionType.manual + + if any(msg in fingerprint[1] for msg in (0x40, 0x86, 0xB2, 0xFD)): # Airbag_01, LWI_01, ESP_19, ESP_21 + ret.networkLocation = NetworkLocation.gateway + else: + ret.networkLocation = NetworkLocation.fwdCamera + + # Global lateral tuning defaults, can be overridden per-vehicle + + ret.steerActuatorDelay = 0.1 + ret.steerRateCost = 1.0 + ret.steerLimitTimer = 0.4 + ret.steerRatio = 15.6 # Let the params learner figure this out + tire_stiffness_factor = 1.0 # Let the params learner figure this out + ret.lateralTuning.pid.kpBP = [0.] + ret.lateralTuning.pid.kiBP = [0.] + ret.lateralTuning.pid.kf = 0.00006 + ret.lateralTuning.pid.kpV = [0.6] + ret.lateralTuning.pid.kiV = [0.2] + + # Per-chassis tuning values, override tuning defaults here if desired + + if candidate == CAR.ARTEON_MK1: + ret.mass = 1733 + STD_CARGO_KG + ret.wheelbase = 2.84 + + elif candidate == CAR.ATLAS_MK1: + ret.mass = 2011 + STD_CARGO_KG + ret.wheelbase = 2.98 + + elif candidate == CAR.GOLF_MK7: + ret.mass = 1397 + STD_CARGO_KG + ret.wheelbase = 2.62 + + elif candidate == CAR.JETTA_MK7: + ret.mass = 1328 + STD_CARGO_KG + ret.wheelbase = 2.71 + + elif candidate == CAR.PASSAT_MK8: + ret.mass = 1551 + STD_CARGO_KG + ret.wheelbase = 2.79 + + elif candidate == CAR.POLO_MK6: + ret.mass = 1230 + STD_CARGO_KG + ret.wheelbase = 2.55 + + elif candidate == CAR.TAOS_MK1: + ret.mass = 1498 + STD_CARGO_KG + ret.wheelbase = 2.69 + + elif candidate == CAR.TCROSS_MK1: + ret.mass = 1150 + STD_CARGO_KG + ret.wheelbase = 2.60 + + elif candidate == CAR.TIGUAN_MK2: + ret.mass = 1715 + STD_CARGO_KG + ret.wheelbase = 2.74 + + elif candidate == CAR.TOURAN_MK2: + ret.mass = 1516 + STD_CARGO_KG + ret.wheelbase = 2.79 + + elif candidate == CAR.TRANSPORTER_T61: + ret.mass = 1926 + STD_CARGO_KG + ret.wheelbase = 3.00 # SWB, LWB is 3.40, TBD how to detect difference + ret.minSteerSpeed = 14.0 + + elif candidate == CAR.TROC_MK1: + ret.mass = 1413 + STD_CARGO_KG + ret.wheelbase = 2.63 + + elif candidate == CAR.AUDI_A3_MK3: + ret.mass = 1335 + STD_CARGO_KG + ret.wheelbase = 2.61 + + elif candidate == CAR.AUDI_Q2_MK1: + ret.mass = 1205 + STD_CARGO_KG + ret.wheelbase = 2.61 + + elif candidate == CAR.AUDI_Q3_MK2: + ret.mass = 1623 + STD_CARGO_KG + ret.wheelbase = 2.68 + + elif candidate == CAR.SEAT_ATECA_MK1: + ret.mass = 1900 + STD_CARGO_KG + ret.wheelbase = 2.64 + + elif candidate == CAR.SEAT_LEON_MK3: + ret.mass = 1227 + STD_CARGO_KG + ret.wheelbase = 2.64 + + elif candidate == CAR.SKODA_KAMIQ_MK1: + ret.mass = 1265 + STD_CARGO_KG + ret.wheelbase = 2.66 + + elif candidate == CAR.SKODA_KAROQ_MK1: + ret.mass = 1278 + STD_CARGO_KG + ret.wheelbase = 2.66 + + elif candidate == CAR.SKODA_KODIAQ_MK1: + ret.mass = 1569 + STD_CARGO_KG + ret.wheelbase = 2.79 + + elif candidate == CAR.SKODA_OCTAVIA_MK3: + ret.mass = 1388 + STD_CARGO_KG + ret.wheelbase = 2.68 + + elif candidate == CAR.SKODA_SCALA_MK1: + ret.mass = 1192 + STD_CARGO_KG + ret.wheelbase = 2.65 + + elif candidate == CAR.SKODA_SUPERB_MK3: + ret.mass = 1505 + STD_CARGO_KG + ret.wheelbase = 2.84 + + else: + raise ValueError(f"unsupported car {candidate}") + + ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) + ret.centerToFront = ret.wheelbase * 0.45 + ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, + tire_stiffness_factor=tire_stiffness_factor) + return ret + + # returns a car.CarState + def update(self, c, can_strings): + buttonEvents = [] + + # Process the most recent CAN message traffic, and check for validity + # The camera CAN has no signals we use at this time, but we process it + # anyway so we can test connectivity with can_valid + self.cp.update_strings(can_strings) + self.cp_cam.update_strings(can_strings) + + ret = self.CS.update(self.cp, self.cp_cam, self.cp_ext, self.CP.transmissionType) + self.post_update(c,ret) + ret.canValid = self.cp.can_valid and self.cp_cam.can_valid + ret.steeringRateLimited = self.CC.steer_rate_limited if self.CC is not None else False + + # Check for and process state-change events (button press or release) from + # the turn stalk switch or ACC steering wheel/control stalk buttons. + for button in self.CS.buttonStates: + if self.CS.buttonStates[button] != self.buttonStatesPrev[button]: + be = car.CarState.ButtonEvent.new_message() + be.type = button + be.pressed = self.CS.buttonStates[button] + buttonEvents.append(be) + + events = self.create_common_events(ret, extra_gears=[GearShifter.eco, GearShifter.sport, GearShifter.manumatic]) + + # Vehicle health and operation safety checks + if self.CS.parkingBrakeSet: + events.add(EventName.parkBrake) + if self.CS.tsk_status in (6, 7): + events.add(EventName.accFaulted) + + # Low speed steer alert hysteresis logic + if self.CP.minSteerSpeed > 0. and ret.vEgo < (self.CP.minSteerSpeed + 1.): + self.low_speed_alert = True + elif ret.vEgo > (self.CP.minSteerSpeed + 2.): + self.low_speed_alert = False + if self.low_speed_alert: + events.add(EventName.belowSteerSpeed) + + ret.events = events.to_msg() + ret.buttonEvents = buttonEvents + + # update previous car states + self.displayMetricUnitsPrev = self.CS.displayMetricUnits + self.buttonStatesPrev = self.CS.buttonStates.copy() + + self.CS.out = ret.as_reader() + return self.CS.out + + def apply(self, c): + self.pre_apply(c) + hud_control = c.hudControl + ret = self.CC.update(c, c.enabled, self.CS, self.frame, self.ext_bus, c.actuators, + hud_control.visualAlert, + hud_control.leftLaneVisible, + hud_control.rightLaneVisible, + hud_control.leftLaneDepart, + hud_control.rightLaneDepart) + self.frame += 1 + return ret diff --git a/selfdrive/car/volkswagen/radar_interface.py b/selfdrive/car/volkswagen/radar_interface.py new file mode 100644 index 000000000..b2f765113 --- /dev/null +++ b/selfdrive/car/volkswagen/radar_interface.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 +from selfdrive.car.interfaces import RadarInterfaceBase + +class RadarInterface(RadarInterfaceBase): + pass diff --git a/selfdrive/car/volkswagen/values.py b/selfdrive/car/volkswagen/values.py new file mode 100755 index 000000000..241338c2c --- /dev/null +++ b/selfdrive/car/volkswagen/values.py @@ -0,0 +1,788 @@ +from collections import defaultdict +from typing import Dict + +from cereal import car +from selfdrive.car import dbc_dict + +Ecu = car.CarParams.Ecu +NetworkLocation = car.CarParams.NetworkLocation +TransmissionType = car.CarParams.TransmissionType +GearShifter = car.CarState.GearShifter + +class CarControllerParams: + HCA_STEP = 2 # HCA_01 message frequency 50Hz + LDW_STEP = 10 # LDW_02 message frequency 10Hz + GRA_ACC_STEP = 3 # GRA_ACC_01 message frequency 33Hz + + GRA_VBP_STEP = 100 # Send ACC virtual button presses once a second + GRA_VBP_COUNT = 16 # Send VBP messages for ~0.5s (GRA_ACC_STEP * 16) + + # Observed documented MQB limits: 3.00 Nm max, rate of change 5.00 Nm/sec. + # Limiting rate-of-change based on real-world testing and Comma's safety + # requirements for minimum time to lane departure. + STEER_MAX = 300 # Max heading control assist torque 3.00 Nm + STEER_DELTA_UP = 4 # Max HCA reached in 1.50s (STEER_MAX / (50Hz * 1.50)) + STEER_DELTA_DOWN = 10 # Min HCA reached in 0.60s (STEER_MAX / (50Hz * 0.60)) + STEER_DRIVER_ALLOWANCE = 80 + STEER_DRIVER_MULTIPLIER = 3 # weight driver torque heavily + STEER_DRIVER_FACTOR = 1 # from dbc + +class CANBUS: + pt = 0 + cam = 2 + +class DBC_FILES: + mqb = "vw_mqb_2010" # Used for all cars with MQB-style CAN messaging + +DBC = defaultdict(lambda: dbc_dict(DBC_FILES.mqb, None)) # type: Dict[str, Dict[str, str]] + +BUTTON_STATES = { + "accelCruise": False, + "decelCruise": False, + "cancel": False, + "setCruise": False, + "resumeCruise": False, + "gapAdjustCruise": False +} + +MQB_LDW_MESSAGES = { + "none": 0, # Nothing to display + "laneAssistUnavailChime": 1, # "Lane Assist currently not available." with chime + "laneAssistUnavailNoSensorChime": 3, # "Lane Assist not available. No sensor view." with chime + "laneAssistTakeOverUrgent": 4, # "Lane Assist: Please Take Over Steering" with urgent beep + "emergencyAssistUrgent": 6, # "Emergency Assist: Please Take Over Steering" with urgent beep + "laneAssistTakeOverChime": 7, # "Lane Assist: Please Take Over Steering" with chime + "laneAssistTakeOverSilent": 8, # "Lane Assist: Please Take Over Steering" silent + "emergencyAssistChangingLanes": 9, # "Emergency Assist: Changing lanes..." with urgent beep + "laneAssistDeactivated": 10, # "Lane Assist deactivated." silent with persistent icon afterward +} + +# Check the 7th and 8th characters of the VIN before adding a new CAR. If the +# chassis code is already listed below, don't add a new CAR, just add to the +# FW_VERSIONS for that existing CAR. +# Exception: SEAT Leon and SEAT Ateca share a chassis code + +class CAR: + ARTEON_MK1 = "VOLKSWAGEN ARTEON 1ST GEN" # Chassis AN, Mk1 VW Arteon and variants + ATLAS_MK1 = "VOLKSWAGEN ATLAS 1ST GEN" # Chassis CA, Mk1 VW Atlas and Atlas Cross Sport + GOLF_MK7 = "VOLKSWAGEN GOLF 7TH GEN" # Chassis 5G/AU/BA/BE, Mk7 VW Golf and variants + JETTA_MK7 = "VOLKSWAGEN JETTA 7TH GEN" # Chassis BU, Mk7 VW Jetta + PASSAT_MK8 = "VOLKSWAGEN PASSAT 8TH GEN" # Chassis 3G, Mk8 VW Passat and variants + POLO_MK6 = "VOLKSWAGEN POLO 6TH GEN" # Chassis AW, Mk6 VW Polo + TAOS_MK1 = "VOLKSWAGEN TAOS 1ST GEN" # Chassis B2, Mk1 VW Taos and Tharu + TCROSS_MK1 = "VOLKSWAGEN T-CROSS 1ST GEN" # Chassis C1, Mk1 VW T-Cross SWB and LWB variants + TIGUAN_MK2 = "VOLKSWAGEN TIGUAN 2ND GEN" # Chassis AD/BW, Mk2 VW Tiguan and variants + TOURAN_MK2 = "VOLKSWAGEN TOURAN 2ND GEN" # Chassis 1T, Mk2 VW Touran and variants + TRANSPORTER_T61 = "VOLKSWAGEN TRANSPORTER T6.1" # Chassis 7H/7L, T6-facelift Transporter/Multivan/Caravelle/California + TROC_MK1 = "VOLKSWAGEN T-ROC 1ST GEN" # Chassis A1, Mk1 VW VW T-Roc and variants + AUDI_A3_MK3 = "AUDI A3 3RD GEN" # Chassis 8V/FF, Mk3 Audi A3 and variants + AUDI_Q2_MK1 = "AUDI Q2 1ST GEN" # Chassis GA, Mk1 Audi Q2 (RoW) and Q2L (China only) + AUDI_Q3_MK2 = "AUDI Q3 2ND GEN" # Chassis 8U/F3/FS, Mk2 Audi Q3 and variants + SEAT_ATECA_MK1 = "SEAT ATECA 1ST GEN" # Chassis 5F, Mk1 SEAT Ateca and CUPRA Ateca + SEAT_LEON_MK3 = "SEAT LEON 3RD GEN" # Chassis 5F, Mk3 SEAT Leon and variants + SKODA_KAMIQ_MK1 = "SKODA KAMIQ 1ST GEN" # Chassis NW, Mk1 Skoda Kamiq + SKODA_KAROQ_MK1 = "SKODA KAROQ 1ST GEN" # Chassis NU, Mk1 Skoda Karoq + SKODA_KODIAQ_MK1 = "SKODA KODIAQ 1ST GEN" # Chassis NS, Mk1 Skoda Kodiaq + SKODA_SCALA_MK1 = "SKODA SCALA 1ST GEN" # Chassis NW, Mk1 Skoda Scala and Skoda Kamiq + SKODA_SUPERB_MK3 = "SKODA SUPERB 3RD GEN" # Chassis 3V/NP, Mk3 Skoda Superb and variants + SKODA_OCTAVIA_MK3 = "SKODA OCTAVIA 3RD GEN" # Chassis NE, Mk3 Skoda Octavia and variants + +# All supported cars should return FW from the engine, srs, eps, and fwdRadar. Cars +# with a manual trans won't return transmission firmware, but all other cars will. +# +# The 0xF187 SW part number query should return in the form of N[NX][NX] NNN NNN [X[X]], +# where N=number, X=letter, and the trailing two letters are optional. Performance +# tuners sometimes tamper with that field (e.g. 8V0 9C0 BB0 1 from COBB/EQT). Tampered +# ECU SW part numbers are invalid for vehicle ID and compatibility checks. Try to have +# them repaired by the tuner before including them in openpilot. + +FW_VERSIONS = { + CAR.ARTEON_MK1: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x873G0906259F \xf1\x890004', + b'\xf1\x873G0906259P \xf1\x890001', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x8709G927158L \xf1\x893611', + b'\xf1\x870GC300011L \xf1\x891401', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x873Q0959655BK\xf1\x890703\xf1\x82\x0e1616001613121177161113772900', + b'\xf1\x873Q0959655DL\xf1\x890732\xf1\x82\0161812141812171105141123052J00', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x873Q0909144K \xf1\x895072\xf1\x82\x0571B41815A1', + b'\xf1\x875Q0910143C \xf1\x892211\xf1\x82\00567B0020800', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572T \xf1\x890383', + b'\xf1\x875Q0907572J \xf1\x890654', + ], + }, + CAR.ATLAS_MK1: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8703H906026AA\xf1\x899970', + b'\xf1\x8703H906026AT\xf1\x891922', + b'\xf1\x8703H906026F \xf1\x896696', + b'\xf1\x8703H906026F \xf1\x899970', + b'\xf1\x8703H906026J \xf1\x896026', + b'\xf1\x8703H906026J \xf1\x899971', + b'\xf1\x8703H906026S \xf1\x896693', + b'\xf1\x8703H906026S \xf1\x899970', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x8709G927158A \xf1\x893387', + b'\xf1\x8709G927158DR\xf1\x893536', + b'\xf1\x8709G927158FT\xf1\x893835', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x873Q0959655BC\xf1\x890503\xf1\x82\0161914151912001103111122031200', + b'\xf1\x873Q0959655BN\xf1\x890713\xf1\x82\0162214152212001105141122052900', + b'\xf1\x873Q0959655DB\xf1\x890720\xf1\x82\0162214152212001105141122052900', + b'\xf1\x873Q0959655DM\xf1\x890732\xf1\x82\x0e1114151112001105161122052J00', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x873QF909144B \xf1\x891582\xf1\x82\00571B60924A1', + b'\xf1\x873QF909144B \xf1\x891582\xf1\x82\x0571B6G920A1', + b'\xf1\x875Q0909143P \xf1\x892051\xf1\x820528B6090105', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572T \xf1\x890383', + b'\xf1\x875Q0907572H \xf1\x890620', + b'\xf1\x875Q0907572J \xf1\x890654', + b'\xf1\x875Q0907572P \xf1\x890682', + ], + }, + CAR.GOLF_MK7: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704E906016A \xf1\x897697', + b'\xf1\x8704E906016AD\xf1\x895758', + b'\xf1\x8704E906016CE\xf1\x899096', + b'\xf1\x8704E906023AG\xf1\x891726', + b'\xf1\x8704E906023BN\xf1\x894518', + b'\xf1\x8704E906024K \xf1\x896811', + b'\xf1\x8704E906027GR\xf1\x892394', + b'\xf1\x8704E906027HD\xf1\x893742', + b'\xf1\x8704E906027MA\xf1\x894958', + b'\xf1\x8704L906021DT\xf1\x895520', + b'\xf1\x8704L906021DT\xf1\x898127', + b'\xf1\x8704L906021N \xf1\x895518', + b'\xf1\x8704L906026BP\xf1\x897608', + b'\xf1\x8704L906026NF\xf1\x899528', + b'\xf1\x8704L906056CL\xf1\x893823', + b'\xf1\x8704L906056CR\xf1\x895813', + b'\xf1\x8704L906056HE\xf1\x893758', + b'\xf1\x870EA906016A \xf1\x898343', + b'\xf1\x870EA906016E \xf1\x894219', + b'\xf1\x870EA906016F \xf1\x895002', + b'\xf1\x870EA906016S \xf1\x897207', + b'\xf1\x875G0906259 \xf1\x890007', + b'\xf1\x875G0906259J \xf1\x890002', + b'\xf1\x875G0906259L \xf1\x890002', + b'\xf1\x875G0906259N \xf1\x890003', + b'\xf1\x875G0906259Q \xf1\x890002', + b'\xf1\x875G0906259Q \xf1\x892313', + b'\xf1\x878V0906259H \xf1\x890002', + b'\xf1\x878V0906259J \xf1\x890003', + b'\xf1\x878V0906259K \xf1\x890001', + b'\xf1\x878V0906259P \xf1\x890001', + b'\xf1\x878V0906259Q \xf1\x890002', + b'\xf1\x878V0906264F \xf1\x890003', + b'\xf1\x878V0906264L \xf1\x890002', + b'\xf1\x878V0906264M \xf1\x890001', + b'\xf1\x878V09C0BB01 \xf1\x890001', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x8709G927749AP\xf1\x892943', + b'\xf1\x8709S927158A \xf1\x893585', + b'\xf1\x870CW300041H \xf1\x891010', + b'\xf1\x870CW300042F \xf1\x891604', + b'\xf1\x870CW300043B \xf1\x891601', + b'\xf1\x870CW300044S \xf1\x894530', + b'\xf1\x870CW300044T \xf1\x895245', + b'\xf1\x870CW300045 \xf1\x894531', + b'\xf1\x870CW300047D \xf1\x895261', + b'\xf1\x870CW300048J \xf1\x890611', + b'\xf1\x870D9300012 \xf1\x894904', + b'\xf1\x870D9300012 \xf1\x894913', + b'\xf1\x870D9300012 \xf1\x894937', + b'\xf1\x870D9300012 \xf1\x895045', + b'\xf1\x870D9300014M \xf1\x895004', + b'\xf1\x870D9300020S \xf1\x895201', + b'\xf1\x870D9300040A \xf1\x893613', + b'\xf1\x870D9300040S \xf1\x894311', + b'\xf1\x870D9300041H \xf1\x895220', + b'\xf1\x870D9300041P \xf1\x894507', + b'\xf1\x870DD300045K \xf1\x891120', + b'\xf1\x870DD300046F \xf1\x891601', + b'\xf1\x870GC300012A \xf1\x891403', + b'\xf1\x870GC300014B \xf1\x892401', + b'\xf1\x870GC300014B \xf1\x892405', + b'\xf1\x870GC300020G \xf1\x892401', + b'\xf1\x870GC300020G \xf1\x892403', + b'\xf1\x870GC300020G \xf1\x892404', + b'\xf1\x870GC300043T \xf1\x899999', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x875Q0959655AA\xf1\x890386\xf1\x82\0211413001113120043114317121C111C9113', + b'\xf1\x875Q0959655AA\xf1\x890386\xf1\x82\0211413001113120053114317121C111C9113', + b'\xf1\x875Q0959655AA\xf1\x890388\xf1\x82\0211413001113120043114317121C111C9113', + b'\xf1\x875Q0959655AA\xf1\x890388\xf1\x82\0211413001113120043114417121411149113', + b'\xf1\x875Q0959655AA\xf1\x890388\xf1\x82\0211413001113120053114317121C111C9113', + b'\xf1\x875Q0959655BH\xf1\x890336\xf1\x82\02314160011123300314211012230229333463100', + b'\xf1\x875Q0959655BT\xf1\x890403\xf1\x82\023141600111233003142404A2252229333463100', + b'\xf1\x875Q0959655BT\xf1\x890403\xf1\x82\023141600111233003142405A2252229333463100', + b'\xf1\x875Q0959655C \xf1\x890361\xf1\x82\0211413001112120004110415121610169112', + b'\xf1\x875Q0959655D \xf1\x890388\xf1\x82\0211413001113120006110417121A101A9113', + b'\xf1\x875Q0959655J \xf1\x890830\xf1\x82\023271112111312--071104171825102591131211', + b'\xf1\x875Q0959655J \xf1\x890830\xf1\x82\023271212111312--071104171838103891131211', + b'\xf1\x875Q0959655J \xf1\x890830\xf1\x82\023341512112212--071104172328102891131211', + b'\xf1\x875Q0959655J \xf1\x890830\xf1\x82\x13272512111312--07110417182C102C91131211', + b'\xf1\x875Q0959655M \xf1\x890361\xf1\x82\0211413001112120041114115121611169112', + b'\xf1\x875Q0959655S \xf1\x890870\xf1\x82\02315120011211200621143171717111791132111', + b'\xf1\x875Q0959655S \xf1\x890870\xf1\x82\02324230011211200061104171724102491132111', + b'\xf1\x875Q0959655S \xf1\x890870\xf1\x82\02324230011211200621143171724112491132111', + b'\xf1\x875Q0959655S \xf1\x890870\xf1\x82\x1315120011211200061104171717101791132111', + b'\xf1\x875Q0959655S \xf1\x890870\xf1\x82\x1324230011211200631143171724122491132111', + b'\xf1\x875Q0959655T \xf1\x890825\xf1\x82\023271200111312--071104171837103791132111', + b'\xf1\x875Q0959655T \xf1\x890830\xf1\x82\x13271100111312--071104171826102691131211', + b'\xf1\x875QD959655 \xf1\x890388\xf1\x82\x111413001113120006110417121D101D9112', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x873Q0909144F \xf1\x895043\xf1\x82\00561A01612A0', + b'\xf1\x873Q0909144H \xf1\x895061\xf1\x82\00566A0J612A1', + b'\xf1\x873Q0909144J \xf1\x895063\xf1\x82\00566A00514A1', + b'\xf1\x873Q0909144J \xf1\x895063\xf1\x82\00566A0J712A1', + b'\xf1\x873Q0909144K \xf1\x895072\xf1\x82\00571A0J714A1', + b'\xf1\x873Q0909144L \xf1\x895081\xf1\x82\x0571A0JA15A1', + b'\xf1\x873Q0909144M \xf1\x895082\xf1\x82\00571A01A18A1', + b'\xf1\x873Q0909144M \xf1\x895082\xf1\x82\00571A0JA16A1', + b'\xf1\x875Q0909143K \xf1\x892033\xf1\x820519A9040203', + b'\xf1\x875Q0909144AA\xf1\x891081\xf1\x82\00521A00441A1', + b'\xf1\x875Q0909144AA\xf1\x891081\xf1\x82\x0521A00641A1', + b'\xf1\x875Q0909144AB\xf1\x891082\xf1\x82\00521A00442A1', + b'\xf1\x875Q0909144AB\xf1\x891082\xf1\x82\00521A00642A1', + b'\xf1\x875Q0909144AB\xf1\x891082\xf1\x82\00521A07B05A1', + b'\xf1\x875Q0909144L \xf1\x891021\xf1\x82\00521A00602A0', + b'\xf1\x875Q0909144L \xf1\x891021\xf1\x82\00522A00402A0', + b'\xf1\x875Q0909144L \xf1\x891021\xf1\x82\x0521A00502A0', + b'\xf1\x875Q0909144P \xf1\x891043\xf1\x82\00511A00403A0', + b'\xf1\x875Q0909144R \xf1\x891061\xf1\x82\00516A00604A1', + b'\xf1\x875Q0909144S \xf1\x891063\xf1\x82\00516A00604A1', + b'\xf1\x875Q0909144S \xf1\x891063\xf1\x82\00516A07A02A1', + b'\xf1\x875Q0909144T \xf1\x891072\xf1\x82\00521A00507A1', + b'\xf1\x875Q0909144T \xf1\x891072\xf1\x82\x0521A07B04A1', + b'\xf1\x875Q0909144T \xf1\x891072\xf1\x82\00521A20B03A1', + b'\xf1\x875QD909144B \xf1\x891072\xf1\x82\x0521A00507A1', + b'\xf1\x875QM909144A \xf1\x891072\xf1\x82\x0521A20B03A1', + b'\xf1\x875QM909144B \xf1\x891081\xf1\x82\00521A00442A1', + b'\xf1\x875QN909144A \xf1\x895081\xf1\x82\00571A01A16A1', + b'\xf1\x875QN909144A \xf1\x895081\xf1\x82\00571A01A18A1', + b'\xf1\x875QN909144A \xf1\x895081\xf1\x82\x0571A01A17A1', + b'\xf1\x875QN909144B \xf1\x895082\xf1\x82\00571A01A18A1', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x875Q0907567G \xf1\x890390\xf1\x82\00101', + b'\xf1\x875Q0907567J \xf1\x890396\xf1\x82\x0101', + b'\xf1\x875Q0907572A \xf1\x890141\xf1\x82\00101', + b'\xf1\x875Q0907572B \xf1\x890200\xf1\x82\00101', + b'\xf1\x875Q0907572C \xf1\x890210\xf1\x82\00101', + b'\xf1\x875Q0907572D \xf1\x890304\xf1\x82\00101', + b'\xf1\x875Q0907572E \xf1\x89X310\xf1\x82\00101', + b'\xf1\x875Q0907572F \xf1\x890400\xf1\x82\00101', + b'\xf1\x875Q0907572G \xf1\x890571', + b'\xf1\x875Q0907572H \xf1\x890620', + b'\xf1\x875Q0907572J \xf1\x890654', + b'\xf1\x875Q0907572P \xf1\x890682', + b'\xf1\x875Q0907572R \xf1\x890771', + ], + }, + CAR.JETTA_MK7: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704E906024AK\xf1\x899937', + b'\xf1\x8704E906024AS\xf1\x899912', + b'\xf1\x8704E906024B \xf1\x895594', + b'\xf1\x8704E906024C \xf1\x899970', + b'\xf1\x8704E906024L \xf1\x895595', + b'\xf1\x8704E906024L \xf1\x899970', + b'\xf1\x8704E906027MS\xf1\x896223', + b'\xf1\x875G0906259T \xf1\x890003', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x8709G927158BQ\xf1\x893545', + b'\xf1\x8709S927158BS\xf1\x893642', + b'\xf1\x8709S927158R \xf1\x893552', + b'\xf1\x8709S927158R \xf1\x893587', + b'\xf1\x870GC300020N \xf1\x892803', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x875Q0959655AG\xf1\x890336\xf1\x82\02314171231313500314611011630169333463100', + b'\xf1\x875Q0959655AG\xf1\x890338\xf1\x82\x1314171231313500314611011630169333463100', + b'\xf1\x875Q0959655BM\xf1\x890403\xf1\x82\02314171231313500314642011650169333463100', + b'\xf1\x875Q0959655BM\xf1\x890403\xf1\x82\02314171231313500314643011650169333463100', + b'\xf1\x875Q0959655BR\xf1\x890403\xf1\x82\02311170031313300314240011150119333433100', + b'\xf1\x875Q0959655BR\xf1\x890403\xf1\x82\02319170031313300314240011550159333463100', + b'\xf1\x875Q0959655CB\xf1\x890421\xf1\x82\x1314171231313500314643021650169333613100', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x873Q0909144M \xf1\x895082\xf1\x82\x0571A10A11A1', + b'\xf1\x875QM909144B \xf1\x891081\xf1\x82\00521A10A01A1', + b'\xf1\x875QM909144B \xf1\x891081\xf1\x82\x0521B00404A1', + b'\xf1\x875QM909144C \xf1\x891082\xf1\x82\00521A00642A1', + b'\xf1\x875QM909144C \xf1\x891082\xf1\x82\00521A10A01A1', + b'\xf1\x875QN909144B \xf1\x895082\xf1\x82\00571A10A11A1', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x875Q0907572N \xf1\x890681', + b'\xf1\x875Q0907572P \xf1\x890682', + b'\xf1\x875Q0907572R \xf1\x890771', + ], + }, + CAR.PASSAT_MK8: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704E906023AH\xf1\x893379', + b'\xf1\x8704L906026GA\xf1\x892013', + b'\xf1\x8704L906026KD\xf1\x894798', + b'\xf1\x873G0906264 \xf1\x890004', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870CW300048R \xf1\x890610', + b'\xf1\x870D9300014L \xf1\x895002', + b'\xf1\x870DD300045T \xf1\x891601', + b'\xf1\x870GC300042H \xf1\x891404', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x873Q0959655AN\xf1\x890306\xf1\x82\r58160058140013036914110311', + b'\xf1\x873Q0959655BB\xf1\x890195\xf1\x82\r56140056130012026612120211', + b'\xf1\x873Q0959655BK\xf1\x890703\xf1\x82\0165915005914001344701311442900', + b'\xf1\x875Q0959655S \xf1\x890870\xf1\x82\02315120011111200631145171716121691132111', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x875Q0909143M \xf1\x892041\xf1\x820522B0080803', + b'\xf1\x875Q0909144AB\xf1\x891082\xf1\x82\00521B00606A1', + b'\xf1\x875Q0909144S \xf1\x891063\xf1\x82\00516B00501A1', + b'\xf1\x875Q0909144T \xf1\x891072\xf1\x82\00521B00703A1', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x873Q0907572B \xf1\x890192', + b'\xf1\x873Q0907572C \xf1\x890195', + b'\xf1\x875Q0907572R \xf1\x890771', + ], + }, + CAR.POLO_MK6: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704C906025H \xf1\x895177', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870CW300050D \xf1\x891908', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x872Q0959655AJ\xf1\x890250\xf1\x82\x1248130411110416--04040404784811152H14', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x872Q1909144M \xf1\x896041', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572R \xf1\x890372', + ], + }, + CAR.TAOS_MK1: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8705E906013E \xf1\x891624', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x8709S927158BL\xf1\x893791', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572T \xf1\x890383', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x875QM909144C \xf1\x891082\xf1\x82\x0521060605A1', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x875Q0959655CB\xf1\x890421\xf1\x82\x1311111111333500314646021450149333613100', + ], + }, + CAR.TCROSS_MK1: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704C906025AK\xf1\x897053', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870CW300050E \xf1\x891903', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x872Q0959655AJ\xf1\x890250\xf1\x82\02212130411110411--04041104141311152H14', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x872Q1909144M \xf1\x896041', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572T \xf1\x890383', + ], + }, + CAR.TIGUAN_MK2: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704L906026EJ\xf1\x893661', + b'\xf1\x8704L906027G \xf1\x899893', + b'\xf1\x875N0906259 \xf1\x890002', + b'\xf1\x8783A907115B \xf1\x890005', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x8709G927158DT\xf1\x893698', + b'\xf1\x870DL300011N \xf1\x892001', + b'\xf1\x870DL300011N \xf1\x892012', + b'\xf1\x870DL300013A \xf1\x893005', + b'\xf1\x870DL300013G \xf1\x892120', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x875Q0959655AR\xf1\x890317\xf1\x82\02331310031333334313132573732379333313100', + b'\xf1\x875Q0959655BM\xf1\x890403\xf1\x82\02316143231313500314641011750179333423100', + b'\xf1\x875Q0959655BT\xf1\x890403\xf1\x82\02312110031333300314240583752379333423100', + b'\xf1\x875Q0959655BT\xf1\x890403\xf1\x82\02331310031333336313140013950399333423100', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x875Q0909143M \xf1\x892041\xf1\x820529A6060603', + b'\xf1\x875QF909144B \xf1\x895582\xf1\x82\00571A60634A1', + b'\xf1\x875QM909144B \xf1\x891081\xf1\x82\x0521A60604A1', + b'\xf1\x875QM909144C \xf1\x891082\xf1\x82\00521A60804A1', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572J \xf1\x890156', + b'\xf1\x872Q0907572Q \xf1\x890342', + b'\xf1\x872Q0907572R \xf1\x890372', + ], + }, + CAR.TOURAN_MK2: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704L906026HM\xf1\x893017', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870CW300041E \xf1\x891005', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x875Q0959655AS\xf1\x890318\xf1\x82\023363500213533353141324C4732479333313100', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x875Q0909143P \xf1\x892051\xf1\x820531B0062105', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x873Q0907572C \xf1\x890195', + ], + }, + CAR.TRANSPORTER_T61: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704L906057AP\xf1\x891186', + b'\xf1\x8704L906057N \xf1\x890413', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870BT300012G \xf1\x893102', + b'\xf1\x870BT300012E \xf1\x893105', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x872Q0959655AE\xf1\x890506\xf1\x82\02316170411110411--04041704161611152S1411', + b'\xf1\x872Q0959655AF\xf1\x890506\xf1\x82\x1316171111110411--04041711121211152S1413', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x877LA909144F \xf1\x897150\xf1\x82\005323A5519A2', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572R \xf1\x890372', + ], + }, + CAR.TROC_MK1: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8705E906018AT\xf1\x899640', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870CW300051M \xf1\x891925', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x875Q0959655CG\xf1\x890421\xf1\x82\x13111100123333003142404M1152119333613100', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x875Q0909144AB\xf1\x891082\xf1\x82\x0521060405A1', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572T \xf1\x890383', + ], + }, + CAR.AUDI_A3_MK3: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704E906023AN\xf1\x893695', + b'\xf1\x8704E906023AR\xf1\x893440', + b'\xf1\x8704E906023BL\xf1\x895190', + b'\xf1\x8704E906027CJ\xf1\x897798', + b'\xf1\x8704L997022N \xf1\x899459', + b'\xf1\x875G0906259L \xf1\x890002', + b'\xf1\x875G0906259Q \xf1\x890002', + b'\xf1\x878V0906259F \xf1\x890002', + b'\xf1\x878V0906264B \xf1\x890003', + b'\xf1\x878V0907115B \xf1\x890007', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870CW300044T \xf1\x895245', + b'\xf1\x870CW300048 \xf1\x895201', + b'\xf1\x870D9300012 \xf1\x894912', + b'\xf1\x870D9300013B \xf1\x894931', + b'\xf1\x870D9300041N \xf1\x894512', + b'\xf1\x870DD300046A \xf1\x891602', + b'\xf1\x870DD300046F \xf1\x891602', + b'\xf1\x870DD300046G \xf1\x891601', + b'\xf1\x870GC300013M \xf1\x892402', + b'\xf1\x870GC300042J \xf1\x891402', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x875Q0959655AB\xf1\x890388\xf1\x82\0211111001111111206110412111321139114', + b'\xf1\x875Q0959655AM\xf1\x890315\xf1\x82\x1311111111111111311411011231129321212100', + b'\xf1\x875Q0959655J \xf1\x890825\xf1\x82\023111112111111--171115141112221291163221', + b'\xf1\x875Q0959655J \xf1\x890830\xf1\x82\023121111111211--261117141112231291163221', + b'\xf1\x875Q0959655J \xf1\x890830\xf1\x82\x13121111111111--341117141212231291163221', + b'\xf1\x875Q0959655N \xf1\x890361\xf1\x82\0211212001112110004110411111421149114', + b'\xf1\x875Q0959655N \xf1\x890361\xf1\x82\0211212001112111104110411111521159114', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x873Q0909144H \xf1\x895061\xf1\x82\00566G0HA14A1', + b'\xf1\x875Q0909144AB\xf1\x891082\xf1\x82\00521G0G809A1', + b'\xf1\x875Q0909144P \xf1\x891043\xf1\x82\00503G00303A0', + b'\xf1\x875Q0909144P \xf1\x891043\xf1\x82\00503G00803A0', + b'\xf1\x875Q0909144R \xf1\x891061\xf1\x82\00516G00804A1', + b'\xf1\x875Q0909144T \xf1\x891072\xf1\x82\00521G00807A1', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x875Q0907567N \xf1\x890400\xf1\x82\00101', + b'\xf1\x875Q0907572D \xf1\x890304\xf1\x82\00101', + b'\xf1\x875Q0907572G \xf1\x890571', + b'\xf1\x875Q0907572H \xf1\x890620', + b'\xf1\x875Q0907572P \xf1\x890682', + ], + }, + CAR.AUDI_Q2_MK1: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704E906027JT\xf1\x894145', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870CW300041F \xf1\x891006', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x875Q0959655BD\xf1\x890336\xf1\x82\x1311111111111100311211011231129321312111', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x873Q0909144K \xf1\x895072\xf1\x82\x0571F60511A1', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572M \xf1\x890233', + ], + }, + CAR.AUDI_Q3_MK2: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8705E906018N \xf1\x899970', + b'\xf1\x8783A906259 \xf1\x890001', + b'\xf1\x8783A906259 \xf1\x890005', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x8709G927158CN\xf1\x893608', + b'\xf1\x870GC300046F \xf1\x892701', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x875Q0959655BF\xf1\x890403\xf1\x82\x1321211111211200311121232152219321422111', + b'\xf1\x875Q0959655CC\xf1\x890421\xf1\x82\x131111111111120031111237116A119321532111', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x875Q0910143C \xf1\x892211\xf1\x82\x0567G6000300', + b'\xf1\x875Q0910143C \xf1\x892211\xf1\x82\x0567G6000800', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572R \xf1\x890372', + b'\xf1\x872Q0907572T \xf1\x890383', + ], + }, + CAR.SEAT_ATECA_MK1: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704E906027KA\xf1\x893749', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870D9300014S \xf1\x895202', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x873Q0959655BH\xf1\x890703\xf1\x82\0161212001211001305121211052900', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x873Q0909144L \xf1\x895081\xf1\x82\00571N60511A1', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572M \xf1\x890233', + ], + }, + CAR.SEAT_LEON_MK3: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704L906021EL\xf1\x897542', + b'\xf1\x8704L906026BP\xf1\x891198', + b'\xf1\x8704L906026BP\xf1\x897608', + b'\xf1\x8705E906018AS\xf1\x899596', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870CW300050J \xf1\x891908', + b'\xf1\x870D9300042M \xf1\x895016', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x873Q0959655AC\xf1\x890189\xf1\x82\r11110011110011021511110200', + b'\xf1\x873Q0959655AS\xf1\x890200\xf1\x82\r12110012120012021612110200', + b'\xf1\x873Q0959655CM\xf1\x890720\xf1\x82\0161312001313001305171311052900', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x875Q0909144AB\xf1\x891082\xf1\x82\00521N01342A1', + b'\xf1\x875Q0909144P \xf1\x891043\xf1\x82\00511N01805A0', + b'\xf1\x875Q0909144T \xf1\x891072\xf1\x82\00521N05808A1', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x875Q0907572B \xf1\x890200\xf1\x82\00101', + b'\xf1\x875Q0907572H \xf1\x890620', + b'\xf1\x875Q0907572P \xf1\x890682', + ], + }, + CAR.SKODA_KAMIQ_MK1: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8705C906032M \xf1\x891333', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870CW300020 \xf1\x891906', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x872Q0959655AM\xf1\x890351\xf1\x82\0222221042111042121040404042E2711152H14', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x872Q1909144M \xf1\x896041', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572T \xf1\x890383', + ], + }, + CAR.SKODA_KAROQ_MK1: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8705E906018P \xf1\x896020', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870CW300041S \xf1\x891615', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x873Q0959655BH\xf1\x890712\xf1\x82\0161213001211001101131122012100', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x875Q0910143C \xf1\x892211\xf1\x82\00567T6100500', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572M \xf1\x890233', + ], + }, + CAR.SKODA_KODIAQ_MK1: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704E906027DD\xf1\x893123', + b'\xf1\x8704L906026DE\xf1\x895418', + b'\xf1\x875NA907115E \xf1\x890003', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870D9300043 \xf1\x895202', + b'\xf1\x870DL300012M \xf1\x892107', + b'\xf1\x870DL300012N \xf1\x892110', + b'\xf1\x870DL300013G \xf1\x892119', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x873Q0959655BJ\xf1\x890703\xf1\x82\0161213001211001205212111052100', + b'\xf1\x873Q0959655CN\xf1\x890720\xf1\x82\0161213001211001205212112052100', + b'\xf1\x873Q0959655CQ\xf1\x890720\xf1\x82\x0e1213111211001205212112052111', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x875Q0909143P \xf1\x892051\xf1\x820527T6050405', + b'\xf1\x875Q0909143P \xf1\x892051\xf1\x820527T6060405', + b'\xf1\x875Q0910143C \xf1\x892211\xf1\x82\x0567T600G600', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572Q \xf1\x890342', + b'\xf1\x872Q0907572R \xf1\x890372', + ], + }, + CAR.SKODA_OCTAVIA_MK3: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704E906016ER\xf1\x895823', + b'\xf1\x8704E906027HD\xf1\x893742', + b'\xf1\x8704L906021DT\xf1\x898127', + b'\xf1\x8704L906026BS\xf1\x891541', + b'\xf1\x875G0906259C \xf1\x890002', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870CW300041N \xf1\x891605', + b'\xf1\x870CW300043B \xf1\x891601', + b'\xf1\x870D9300041C \xf1\x894936', + b'\xf1\x870D9300041J \xf1\x894902', + b'\xf1\x870D9300041P \xf1\x894507', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x873Q0959655AC\xf1\x890200\xf1\x82\r11120011100010022212110200', + b'\xf1\x873Q0959655AQ\xf1\x890200\xf1\x82\r11120011100010312212113100', + b'\xf1\x873Q0959655AS\xf1\x890200\xf1\x82\r11120011100010022212110200', + b'\xf1\x873Q0959655BH\xf1\x890703\xf1\x82\0163221003221002105755331052100', + b'\xf1\x873Q0959655CN\xf1\x890720\xf1\x82\x0e3221003221002105755331052100', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x873Q0909144J \xf1\x895063\xf1\x82\00566A01513A1', + b'\xf1\x875Q0909144AA\xf1\x891081\xf1\x82\00521T00403A1', + b'\xf1\x875Q0909144AB\xf1\x891082\xf1\x82\x0521T00403A1', + b'\xf1\x875Q0909144R \xf1\x891061\xf1\x82\x0516A00604A1', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x875Q0907572D \xf1\x890304\xf1\x82\x0101', + b'\xf1\x875Q0907572F \xf1\x890400\xf1\x82\00101', + b'\xf1\x875Q0907572J \xf1\x890654', + b'\xf1\x875Q0907572P \xf1\x890682', + ], + }, + CAR.SKODA_SCALA_MK1: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704C906025AK\xf1\x897053', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870CW300050 \xf1\x891709', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x872Q0959655AM\xf1\x890351\xf1\x82\022111104111104112104040404111111112H14', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x872Q1909144M \xf1\x896041', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x872Q0907572R \xf1\x890372', + ], + }, + CAR.SKODA_SUPERB_MK3: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704L906026FP\xf1\x891196', + b'\xf1\x8704L906026KB\xf1\x894071', + b'\xf1\x8704L906026KD\xf1\x894798', + b'\xf1\x873G0906259B \xf1\x890002', + b'\xf1\x873G0906264A \xf1\x890002', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x870CW300042H \xf1\x891601', + b'\xf1\x870D9300011T \xf1\x894801', + b'\xf1\x870D9300012 \xf1\x894940', + b'\xf1\x870GC300043 \xf1\x892301', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x875Q0959655AE\xf1\x890130\xf1\x82\022111200111121001121118112231292221111', + b'\xf1\x875Q0959655AK\xf1\x890130\xf1\x82\022111200111121001121110012211292221111', + b'\xf1\x875Q0959655BH\xf1\x890336\xf1\x82\02331310031313100313131013141319331413100', + ], + (Ecu.eps, 0x712, None): [ + b'\xf1\x875Q0909143K \xf1\x892033\xf1\x820514UZ070203', + b'\xf1\x875Q0909143M \xf1\x892041\xf1\x820522UZ070303', + b'\xf1\x875Q0910143B \xf1\x892201\xf1\x82\00563UZ060700', + b'\xf1\x875Q0910143B \xf1\x892201\xf1\x82\x0563UZ060600', + b'\xf1\x875Q0910143C \xf1\x892211\xf1\x82\x0567UZ070600', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x873Q0907572B \xf1\x890192', + b'\xf1\x873Q0907572B \xf1\x890194', + b'\xf1\x873Q0907572C \xf1\x890195', + ], + }, +} diff --git a/selfdrive/car/volkswagen/volkswagencan.py b/selfdrive/car/volkswagen/volkswagencan.py new file mode 100644 index 000000000..10e0054c7 --- /dev/null +++ b/selfdrive/car/volkswagen/volkswagencan.py @@ -0,0 +1,49 @@ +# CAN controls for MQB platform Volkswagen, Audi, Skoda and SEAT. +# PQ35/PQ46/NMS, and any future MLB, to come later. + +def create_mqb_steering_control(packer, bus, apply_steer, idx, lkas_enabled): + values = { + "SET_ME_0X3": 0x3, + "Assist_Torque": abs(apply_steer), + "Assist_Requested": lkas_enabled, + "Assist_VZ": 1 if apply_steer < 0 else 0, + "HCA_Available": 1, + "HCA_Standby": not lkas_enabled, + "HCA_Active": lkas_enabled, + "SET_ME_0XFE": 0xFE, + "SET_ME_0X07": 0x07, + } + return packer.make_can_msg("HCA_01", bus, values, idx) + +def create_mqb_hud_control(packer, bus, enabled, steering_pressed, hud_alert, left_lane_visible, right_lane_visible, + ldw_stock_values, left_lane_depart, right_lane_depart): + # Lane color reference: + # 0 (LKAS disabled) - off + # 1 (LKAS enabled, no lane detected) - dark gray + # 2 (LKAS enabled, lane detected) - light gray on VW, green or white on Audi depending on year or virtual cockpit. On a color MFD on a 2015 A3 TDI it is white, virtual cockpit on a 2018 A3 e-Tron its green. + # 3 (LKAS enabled, lane departure detected) - white on VW, red on Audi + values = ldw_stock_values.copy() + values.update({ + "LDW_Status_LED_gelb": 1 if enabled and steering_pressed else 0, + "LDW_Status_LED_gruen": 1 if enabled and not steering_pressed else 0, + "LDW_Lernmodus_links": 3 if left_lane_depart else 1 + left_lane_visible, + "LDW_Lernmodus_rechts": 3 if right_lane_depart else 1 + right_lane_visible, + "LDW_Texte": hud_alert, + }) + return packer.make_can_msg("LDW_02", bus, values) + +def create_mqb_acc_buttons_control(packer, bus, buttonStatesToSend, CS, idx): + values = { + "GRA_Hauptschalter": CS.graHauptschalter, + "GRA_Abbrechen": buttonStatesToSend["cancel"], + "GRA_Tip_Setzen": buttonStatesToSend["setCruise"], + "GRA_Tip_Hoch": buttonStatesToSend["accelCruise"], + "GRA_Tip_Runter": buttonStatesToSend["decelCruise"], + "GRA_Tip_Wiederaufnahme": buttonStatesToSend["resumeCruise"], + "GRA_Verstellung_Zeitluecke": 3 if buttonStatesToSend["gapAdjustCruise"] else 0, + "GRA_Typ_Hauptschalter": CS.graTypHauptschalter, + "GRA_Codierung": 2, + "GRA_Tip_Stufe_2": CS.graTipStufe2, + "GRA_ButtonTypeInfo": CS.graButtonTypeInfo + } + return packer.make_can_msg("GRA_ACC_01", bus, values, idx) diff --git a/selfdrive/clocksd/.gitignore b/selfdrive/clocksd/.gitignore new file mode 100644 index 000000000..a6d841d65 --- /dev/null +++ b/selfdrive/clocksd/.gitignore @@ -0,0 +1 @@ +clocksd diff --git a/selfdrive/clocksd/SConscript b/selfdrive/clocksd/SConscript new file mode 100644 index 000000000..d1cf13e9e --- /dev/null +++ b/selfdrive/clocksd/SConscript @@ -0,0 +1,2 @@ +Import('env', 'common', 'cereal', 'messaging') +env.Program('clocksd.cc', LIBS=[common, cereal, messaging, 'capnp', 'zmq', 'kj']) diff --git a/selfdrive/clocksd/clocksd b/selfdrive/clocksd/clocksd new file mode 100755 index 000000000..933df2d1b Binary files /dev/null and b/selfdrive/clocksd/clocksd differ diff --git a/selfdrive/clocksd/clocksd.cc b/selfdrive/clocksd/clocksd.cc new file mode 100644 index 000000000..c24ffa41d --- /dev/null +++ b/selfdrive/clocksd/clocksd.cc @@ -0,0 +1,90 @@ +#include +#include +#include + +#include +#include + +// Apple doesn't have timerfd +#ifdef __APPLE__ +#include +#else +#include +#endif + +#include +#include + +#include "cereal/messaging/messaging.h" +#include "selfdrive/common/timing.h" +#include "selfdrive/common/util.h" + +ExitHandler do_exit; + +#ifdef QCOM +namespace { + int64_t arm_cntpct() { + int64_t v; + asm volatile("mrs %0, cntpct_el0" : "=r"(v)); + return v; + } +} +#endif + +int main() { + setpriority(PRIO_PROCESS, 0, -13); + PubMaster pm({"clocks"}); + +#ifndef __APPLE__ + int timerfd = timerfd_create(CLOCK_BOOTTIME, 0); + assert(timerfd >= 0); + + struct itimerspec spec = {0}; + spec.it_interval.tv_sec = 1; + spec.it_interval.tv_nsec = 0; + spec.it_value.tv_sec = 1; + spec.it_value.tv_nsec = 0; + + int err = timerfd_settime(timerfd, 0, &spec, 0); + assert(err == 0); + + uint64_t expirations = 0; + while (!do_exit && (err = read(timerfd, &expirations, sizeof(expirations)))) { + if (err < 0) { + if (errno == EINTR) continue; + break; + } +#else + // Just run at 1Hz on apple + while (!do_exit) { + util::sleep_for(1000); +#endif + + uint64_t boottime = nanos_since_boot(); + uint64_t monotonic = nanos_monotonic(); + uint64_t monotonic_raw = nanos_monotonic_raw(); + uint64_t wall_time = nanos_since_epoch(); + +#ifdef QCOM + uint64_t modem_uptime_v = arm_cntpct() / 19200ULL; // 19.2 mhz clock +#endif + + MessageBuilder msg; + auto clocks = msg.initEvent().initClocks(); + + clocks.setBootTimeNanos(boottime); + clocks.setMonotonicNanos(monotonic); + clocks.setMonotonicRawNanos(monotonic_raw); + clocks.setWallTimeNanos(wall_time); +#ifdef QCOM + clocks.setModemUptimeMillis(modem_uptime_v); +#endif + + pm.send("clocks", msg); + } + +#ifndef __APPLE__ + close(timerfd); +#endif + return 0; +} diff --git a/selfdrive/common/SConscript b/selfdrive/common/SConscript new file mode 100644 index 000000000..8dfeecbdd --- /dev/null +++ b/selfdrive/common/SConscript @@ -0,0 +1,37 @@ +Import('env', 'arch', 'SHARED') + +if SHARED: + fxn = env.SharedLibrary +else: + fxn = env.Library + +common_libs = [ + 'params.cc', + 'statlog.cc', + 'swaglog.cc', + 'util.cc', + 'gpio.cc', + 'i2c.cc', + 'watchdog.cc', +] + +_common = fxn('common', common_libs, LIBS="json11") + +files = [ + 'clutil.cc', + 'visionimg.cc', +] + +if arch == "aarch64": + _gpu_libs = ['gui', 'adreno_utils'] +elif arch == "larch64": + _gpu_libs = ["GLESv2"] +else: + _gpu_libs = ["GL"] + +_gpucommon = fxn('gpucommon', files, LIBS=_gpu_libs) +Export('_common', '_gpucommon', '_gpu_libs') + +if GetOption('test'): + env.Program('tests/test_util', ['tests/test_util.cc'], LIBS=[_common]) + env.Program('tests/test_swaglog', ['tests/test_swaglog.cc'], LIBS=[_common, 'json11', 'zmq', 'pthread']) diff --git a/selfdrive/common/clutil.cc b/selfdrive/common/clutil.cc new file mode 100644 index 000000000..4e952a2a8 --- /dev/null +++ b/selfdrive/common/clutil.cc @@ -0,0 +1,193 @@ +#include "selfdrive/common/clutil.h" + +#include +#include +#include + +#include "selfdrive/common/util.h" + +namespace { // helper functions + +template +std::string get_info(Func get_info_func, Id id, Name param_name) { + size_t size = 0; + CL_CHECK(get_info_func(id, param_name, 0, NULL, &size)); + std::string info(size, '\0'); + CL_CHECK(get_info_func(id, param_name, size, info.data(), NULL)); + return info; +} +inline std::string get_platform_info(cl_platform_id id, cl_platform_info name) { return get_info(&clGetPlatformInfo, id, name); } +inline std::string get_device_info(cl_device_id id, cl_device_info name) { return get_info(&clGetDeviceInfo, id, name); } + +void cl_print_info(cl_platform_id platform, cl_device_id device) { + size_t work_group_size = 0; + cl_device_type device_type = 0; + clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(work_group_size), &work_group_size, NULL); + clGetDeviceInfo(device, CL_DEVICE_TYPE, sizeof(device_type), &device_type, NULL); + const char *type_str = "Other..."; + switch (device_type) { + case CL_DEVICE_TYPE_CPU: type_str ="CL_DEVICE_TYPE_CPU"; break; + case CL_DEVICE_TYPE_GPU: type_str = "CL_DEVICE_TYPE_GPU"; break; + case CL_DEVICE_TYPE_ACCELERATOR: type_str = "CL_DEVICE_TYPE_ACCELERATOR"; break; + } + + std::cout << "vendor: " << get_platform_info(platform, CL_PLATFORM_VENDOR) << std::endl + << "platform version: " << get_platform_info(platform, CL_PLATFORM_VERSION) << std::endl + << "profile: " << get_platform_info(platform, CL_PLATFORM_PROFILE) << std::endl + << "extensions: " << get_platform_info(platform, CL_PLATFORM_EXTENSIONS) << std::endl + << "name :" << get_device_info(device, CL_DEVICE_NAME) << std::endl + << "device version :" << get_device_info(device, CL_DEVICE_VERSION) << std::endl + << "max work group size :" << work_group_size << std::endl + << "type = " << device_type << " = " << type_str << std::endl; +} + +void cl_print_build_errors(cl_program program, cl_device_id device) { + cl_build_status status; + clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_STATUS, sizeof(status), &status, NULL); + size_t log_size; + clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size); + std::string log(log_size, '\0'); + clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, log_size, &log[0], NULL); + + std::cout << "build failed; status=" << status << ", log:" << std::endl << log << std::endl; +} + +} // namespace + +cl_device_id cl_get_device_id(cl_device_type device_type) { + cl_uint num_platforms = 0; + CL_CHECK(clGetPlatformIDs(0, NULL, &num_platforms)); + std::unique_ptr platform_ids = std::make_unique(num_platforms); + CL_CHECK(clGetPlatformIDs(num_platforms, &platform_ids[0], NULL)); + + for (size_t i = 0; i < num_platforms; ++i) { + std::cout << "platform[" << i << "] CL_PLATFORM_NAME: " << get_platform_info(platform_ids[i], CL_PLATFORM_NAME) << std::endl; + // Get first device + if (cl_device_id device_id = NULL; clGetDeviceIDs(platform_ids[i], device_type, 1, &device_id, NULL) == 0 && device_id) { + cl_print_info(platform_ids[i], device_id); + return device_id; + } + } + std::cout << "No valid openCL platform found" << std::endl; + assert(0); + return nullptr; +} + +cl_program cl_program_from_file(cl_context ctx, cl_device_id device_id, const char* path, const char* args) { + return cl_program_from_source(ctx, device_id, util::read_file(path), args); +} + +cl_program cl_program_from_source(cl_context ctx, cl_device_id device_id, const std::string& src, const char* args) { + cl_program prg = CL_CHECK_ERR(clCreateProgramWithSource(ctx, 1, (const char*[]){src.c_str()}, NULL, &err)); + if (int err = clBuildProgram(prg, 1, &device_id, args, NULL, NULL); err != 0) { + cl_print_build_errors(prg, device_id); + assert(0); + } + return prg; +} + +cl_program cl_program_from_binary(cl_context ctx, cl_device_id device_id, const uint8_t* binary, size_t length, const char* args) { + cl_program prg = CL_CHECK_ERR(clCreateProgramWithBinary(ctx, 1, &device_id, &length, (const uint8_t*[]){binary}, NULL, &err)); + if (int err = clBuildProgram(prg, 1, &device_id, args, NULL, NULL); err != 0) { + cl_print_build_errors(prg, device_id); + assert(0); + } + return prg; +} + +// Given a cl code and return a string representation +#define CL_ERR_TO_STR(err) case err: return #err +const char* cl_get_error_string(int err) { + switch (err) { + CL_ERR_TO_STR(CL_SUCCESS); + CL_ERR_TO_STR(CL_DEVICE_NOT_FOUND); + CL_ERR_TO_STR(CL_DEVICE_NOT_AVAILABLE); + CL_ERR_TO_STR(CL_COMPILER_NOT_AVAILABLE); + CL_ERR_TO_STR(CL_MEM_OBJECT_ALLOCATION_FAILURE); + CL_ERR_TO_STR(CL_OUT_OF_RESOURCES); + CL_ERR_TO_STR(CL_OUT_OF_HOST_MEMORY); + CL_ERR_TO_STR(CL_PROFILING_INFO_NOT_AVAILABLE); + CL_ERR_TO_STR(CL_MEM_COPY_OVERLAP); + CL_ERR_TO_STR(CL_IMAGE_FORMAT_MISMATCH); + CL_ERR_TO_STR(CL_IMAGE_FORMAT_NOT_SUPPORTED); + CL_ERR_TO_STR(CL_MAP_FAILURE); + CL_ERR_TO_STR(CL_MISALIGNED_SUB_BUFFER_OFFSET); + CL_ERR_TO_STR(CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST); + CL_ERR_TO_STR(CL_COMPILE_PROGRAM_FAILURE); + CL_ERR_TO_STR(CL_LINKER_NOT_AVAILABLE); + CL_ERR_TO_STR(CL_LINK_PROGRAM_FAILURE); + CL_ERR_TO_STR(CL_DEVICE_PARTITION_FAILED); + CL_ERR_TO_STR(CL_KERNEL_ARG_INFO_NOT_AVAILABLE); + CL_ERR_TO_STR(CL_INVALID_VALUE); + CL_ERR_TO_STR(CL_INVALID_DEVICE_TYPE); + CL_ERR_TO_STR(CL_INVALID_PLATFORM); + CL_ERR_TO_STR(CL_INVALID_DEVICE); + CL_ERR_TO_STR(CL_INVALID_CONTEXT); + CL_ERR_TO_STR(CL_INVALID_QUEUE_PROPERTIES); + CL_ERR_TO_STR(CL_INVALID_COMMAND_QUEUE); + CL_ERR_TO_STR(CL_INVALID_HOST_PTR); + CL_ERR_TO_STR(CL_INVALID_MEM_OBJECT); + CL_ERR_TO_STR(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR); + CL_ERR_TO_STR(CL_INVALID_IMAGE_SIZE); + CL_ERR_TO_STR(CL_INVALID_SAMPLER); + CL_ERR_TO_STR(CL_INVALID_BINARY); + CL_ERR_TO_STR(CL_INVALID_BUILD_OPTIONS); + CL_ERR_TO_STR(CL_INVALID_PROGRAM); + CL_ERR_TO_STR(CL_INVALID_PROGRAM_EXECUTABLE); + CL_ERR_TO_STR(CL_INVALID_KERNEL_NAME); + CL_ERR_TO_STR(CL_INVALID_KERNEL_DEFINITION); + CL_ERR_TO_STR(CL_INVALID_KERNEL); + CL_ERR_TO_STR(CL_INVALID_ARG_INDEX); + CL_ERR_TO_STR(CL_INVALID_ARG_VALUE); + CL_ERR_TO_STR(CL_INVALID_ARG_SIZE); + CL_ERR_TO_STR(CL_INVALID_KERNEL_ARGS); + CL_ERR_TO_STR(CL_INVALID_WORK_DIMENSION); + CL_ERR_TO_STR(CL_INVALID_WORK_GROUP_SIZE); + CL_ERR_TO_STR(CL_INVALID_WORK_ITEM_SIZE); + CL_ERR_TO_STR(CL_INVALID_GLOBAL_OFFSET); + CL_ERR_TO_STR(CL_INVALID_EVENT_WAIT_LIST); + CL_ERR_TO_STR(CL_INVALID_EVENT); + CL_ERR_TO_STR(CL_INVALID_OPERATION); + CL_ERR_TO_STR(CL_INVALID_GL_OBJECT); + CL_ERR_TO_STR(CL_INVALID_BUFFER_SIZE); + CL_ERR_TO_STR(CL_INVALID_MIP_LEVEL); + CL_ERR_TO_STR(CL_INVALID_GLOBAL_WORK_SIZE); + CL_ERR_TO_STR(CL_INVALID_PROPERTY); + CL_ERR_TO_STR(CL_INVALID_IMAGE_DESCRIPTOR); + CL_ERR_TO_STR(CL_INVALID_COMPILER_OPTIONS); + CL_ERR_TO_STR(CL_INVALID_LINKER_OPTIONS); + CL_ERR_TO_STR(CL_INVALID_DEVICE_PARTITION_COUNT); + case -69: return "CL_INVALID_PIPE_SIZE"; + case -70: return "CL_INVALID_DEVICE_QUEUE"; + case -71: return "CL_INVALID_SPEC_ID"; + case -72: return "CL_MAX_SIZE_RESTRICTION_EXCEEDED"; + case -1002: return "CL_INVALID_D3D10_DEVICE_KHR"; + case -1003: return "CL_INVALID_D3D10_RESOURCE_KHR"; + case -1004: return "CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR"; + case -1005: return "CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR"; + case -1006: return "CL_INVALID_D3D11_DEVICE_KHR"; + case -1007: return "CL_INVALID_D3D11_RESOURCE_KHR"; + case -1008: return "CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR"; + case -1009: return "CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR"; + case -1010: return "CL_INVALID_DX9_MEDIA_ADAPTER_KHR"; + case -1011: return "CL_INVALID_DX9_MEDIA_SURFACE_KHR"; + case -1012: return "CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR"; + case -1013: return "CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR"; + case -1093: return "CL_INVALID_EGL_OBJECT_KHR"; + case -1092: return "CL_EGL_RESOURCE_NOT_ACQUIRED_KHR"; + case -1001: return "CL_PLATFORM_NOT_FOUND_KHR"; + case -1057: return "CL_DEVICE_PARTITION_FAILED_EXT"; + case -1058: return "CL_INVALID_PARTITION_COUNT_EXT"; + case -1059: return "CL_INVALID_PARTITION_NAME_EXT"; + case -1094: return "CL_INVALID_ACCELERATOR_INTEL"; + case -1095: return "CL_INVALID_ACCELERATOR_TYPE_INTEL"; + case -1096: return "CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL"; + case -1097: return "CL_ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL"; + case -1000: return "CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR"; + case -1098: return "CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL"; + case -1099: return "CL_INVALID_VA_API_MEDIA_SURFACE_INTEL"; + case -1100: return "CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL"; + case -1101: return "CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL"; + default: return "CL_UNKNOWN_ERROR"; + } +} diff --git a/selfdrive/common/clutil.h b/selfdrive/common/clutil.h new file mode 100644 index 000000000..be1a07c33 --- /dev/null +++ b/selfdrive/common/clutil.h @@ -0,0 +1,28 @@ +#pragma once + +#ifdef __APPLE__ +#include +#else +#include +#endif + +#include + +#define CL_CHECK(_expr) \ + do { \ + assert(CL_SUCCESS == (_expr)); \ + } while (0) + +#define CL_CHECK_ERR(_expr) \ + ({ \ + cl_int err = CL_INVALID_VALUE; \ + __typeof__(_expr) _ret = _expr; \ + assert(_ret&& err == CL_SUCCESS); \ + _ret; \ + }) + +cl_device_id cl_get_device_id(cl_device_type device_type); +cl_program cl_program_from_source(cl_context ctx, cl_device_id device_id, const std::string& src, const char* args = nullptr); +cl_program cl_program_from_binary(cl_context ctx, cl_device_id device_id, const uint8_t* binary, size_t length, const char* args = nullptr); +cl_program cl_program_from_file(cl_context ctx, cl_device_id device_id, const char* path, const char* args); +const char* cl_get_error_string(int err); diff --git a/selfdrive/common/gpio.cc b/selfdrive/common/gpio.cc new file mode 100644 index 000000000..033d6da4f --- /dev/null +++ b/selfdrive/common/gpio.cc @@ -0,0 +1,32 @@ +#include "selfdrive/common/gpio.h" + +#include +#include + +#include + +#include "selfdrive/common/util.h" + +// We assume that all pins have already been exported on boot, +// and that we have permission to write to them. + +int gpio_init(int pin_nr, bool output) { + char pin_dir_path[50]; + int pin_dir_path_len = snprintf(pin_dir_path, sizeof(pin_dir_path), + "/sys/class/gpio/gpio%d/direction", pin_nr); + if(pin_dir_path_len <= 0) { + return -1; + } + const char *value = output ? "out" : "in"; + return util::write_file(pin_dir_path, (void*)value, strlen(value)); +} + +int gpio_set(int pin_nr, bool high) { + char pin_val_path[50]; + int pin_val_path_len = snprintf(pin_val_path, sizeof(pin_val_path), + "/sys/class/gpio/gpio%d/value", pin_nr); + if(pin_val_path_len <= 0) { + return -1; + } + return util::write_file(pin_val_path, (void*)(high ? "1" : "0"), 1); +} diff --git a/selfdrive/common/gpio.h b/selfdrive/common/gpio.h new file mode 100644 index 000000000..e03001987 --- /dev/null +++ b/selfdrive/common/gpio.h @@ -0,0 +1,21 @@ +#pragma once + +// Pin definitions +#ifdef QCOM2 + #define GPIO_HUB_RST_N 30 + #define GPIO_UBLOX_RST_N 32 + #define GPIO_UBLOX_SAFEBOOT_N 33 + #define GPIO_UBLOX_PWR_EN 34 + #define GPIO_STM_RST_N 124 + #define GPIO_STM_BOOT0 134 +#else + #define GPIO_HUB_RST_N 0 + #define GPIO_UBLOX_RST_N 0 + #define GPIO_UBLOX_SAFEBOOT_N 0 + #define GPIO_UBLOX_PWR_EN 0 + #define GPIO_STM_RST_N 0 + #define GPIO_STM_BOOT0 0 +#endif + +int gpio_init(int pin_nr, bool output); +int gpio_set(int pin_nr, bool high); diff --git a/selfdrive/common/i2c.cc b/selfdrive/common/i2c.cc new file mode 100644 index 000000000..5e6488fab --- /dev/null +++ b/selfdrive/common/i2c.cc @@ -0,0 +1,87 @@ +#include "selfdrive/common/i2c.h" + +#include +#include +#include + +#include +#include +#include + +#include "selfdrive/common/util.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/util.h" + +#define UNUSED(x) (void)(x) + +#ifdef QCOM2 +// TODO: decide if we want to isntall libi2c-dev everywhere +extern "C" { + #include + #include +} + +I2CBus::I2CBus(uint8_t bus_id) { + char bus_name[20]; + snprintf(bus_name, 20, "/dev/i2c-%d", bus_id); + + i2c_fd = HANDLE_EINTR(open(bus_name, O_RDWR)); + if(i2c_fd < 0) { + throw std::runtime_error("Failed to open I2C bus"); + } +} + +I2CBus::~I2CBus() { + if(i2c_fd >= 0) { close(i2c_fd); } +} + +int I2CBus::read_register(uint8_t device_address, uint register_address, uint8_t *buffer, uint8_t len) { + int ret = 0; + + ret = HANDLE_EINTR(ioctl(i2c_fd, I2C_SLAVE, device_address)); + if(ret < 0) { goto fail; } + + ret = i2c_smbus_read_i2c_block_data(i2c_fd, register_address, len, buffer); + if((ret < 0) || (ret != len)) { goto fail; } + +fail: + return ret; +} + +int I2CBus::set_register(uint8_t device_address, uint register_address, uint8_t data) { + int ret = 0; + + ret = HANDLE_EINTR(ioctl(i2c_fd, I2C_SLAVE, device_address)); + if(ret < 0) { goto fail; } + + ret = i2c_smbus_write_byte_data(i2c_fd, register_address, data); + if(ret < 0) { goto fail; } + +fail: + return ret; +} + +#else + +I2CBus::I2CBus(uint8_t bus_id) { + UNUSED(bus_id); + i2c_fd = -1; +} + +I2CBus::~I2CBus() {} + +int I2CBus::read_register(uint8_t device_address, uint register_address, uint8_t *buffer, uint8_t len) { + UNUSED(device_address); + UNUSED(register_address); + UNUSED(buffer); + UNUSED(len); + return -1; +} + +int I2CBus::set_register(uint8_t device_address, uint register_address, uint8_t data) { + UNUSED(device_address); + UNUSED(register_address); + UNUSED(data); + return -1; +} +#endif diff --git a/selfdrive/common/i2c.h b/selfdrive/common/i2c.h new file mode 100644 index 000000000..0669116bb --- /dev/null +++ b/selfdrive/common/i2c.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +#include + +class I2CBus { + private: + int i2c_fd; + + public: + I2CBus(uint8_t bus_id); + ~I2CBus(); + + int read_register(uint8_t device_address, uint register_address, uint8_t *buffer, uint8_t len); + int set_register(uint8_t device_address, uint register_address, uint8_t data); +}; diff --git a/selfdrive/common/mat.h b/selfdrive/common/mat.h new file mode 100644 index 000000000..626f3404f --- /dev/null +++ b/selfdrive/common/mat.h @@ -0,0 +1,85 @@ +#pragma once + +typedef struct vec3 { + float v[3]; +} vec3; + +typedef struct vec4 { + float v[4]; +} vec4; + +typedef struct mat3 { + float v[3*3]; +} mat3; + +typedef struct mat4 { + float v[4*4]; +} mat4; + +static inline mat3 matmul3(const mat3 &a, const mat3 &b) { + mat3 ret = {{0.0}}; + for (int r=0; r<3; r++) { + for (int c=0; c<3; c++) { + float v = 0.0; + for (int k=0; k<3; k++) { + v += a.v[r*3+k] * b.v[k*3+c]; + } + ret.v[r*3+c] = v; + } + } + return ret; +} + +static inline vec3 matvecmul3(const mat3 &a, const vec3 &b) { + vec3 ret = {{0.0}}; + for (int r=0; r<3; r++) { + for (int c=0; c<3; c++) { + ret.v[r] += a.v[r*3+c] * b.v[c]; + } + } + return ret; +} + +static inline mat4 matmul(const mat4 &a, const mat4 &b) { + mat4 ret = {{0.0}}; + for (int r=0; r<4; r++) { + for (int c=0; c<4; c++) { + float v = 0.0; + for (int k=0; k<4; k++) { + v += a.v[r*4+k] * b.v[k*4+c]; + } + ret.v[r*4+c] = v; + } + } + return ret; +} + +static inline vec4 matvecmul(const mat4 &a, const vec4 &b) { + vec4 ret = {{0.0}}; + for (int r=0; r<4; r++) { + for (int c=0; c<4; c++) { + ret.v[r] += a.v[r*4+c] * b.v[c]; + } + } + return ret; +} + +// scales the input and output space of a transformation matrix +// that assumes pixel-center origin. +static inline mat3 transform_scale_buffer(const mat3 &in, float s) { + // in_pt = ( transform(out_pt/s + 0.5) - 0.5) * s + + mat3 transform_out = {{ + 1.0f/s, 0.0f, 0.5f, + 0.0f, 1.0f/s, 0.5f, + 0.0f, 0.0f, 1.0f, + }}; + + mat3 transform_in = {{ + s, 0.0f, -0.5f*s, + 0.0f, s, -0.5f*s, + 0.0f, 0.0f, 1.0f, + }}; + + return matmul3(transform_in, matmul3(in, transform_out)); +} diff --git a/selfdrive/common/modeldata.h b/selfdrive/common/modeldata.h new file mode 100644 index 000000000..8d91f7be1 --- /dev/null +++ b/selfdrive/common/modeldata.h @@ -0,0 +1,56 @@ +#pragma once + +#include +#include "selfdrive/common/mat.h" +#include "selfdrive/hardware/hw.h" + +const int TRAJECTORY_SIZE = 33; +const int LAT_MPC_N = 16; +const int LON_MPC_N = 32; +const float MIN_DRAW_DISTANCE = 10.0; +const float MAX_DRAW_DISTANCE = 100.0; + +template +constexpr std::array build_idxs(float max_val) { + std::array result{}; + for (int i = 0; i < size; ++i) { + result[i] = max_val * ((i / (double)(size - 1)) * (i / (double)(size - 1))); + } + return result; +} + +constexpr auto T_IDXS = build_idxs(10.0); +constexpr auto T_IDXS_FLOAT = build_idxs(10.0); +constexpr auto X_IDXS = build_idxs(192.0); +constexpr auto X_IDXS_FLOAT = build_idxs(192.0); + +const int TICI_CAM_WIDTH = 1928; + +namespace tici_dm_crop { + const int x_offset = -72; + const int y_offset = -144; + const int width = 954; +}; + +const mat3 fcam_intrinsic_matrix = + Hardware::EON() ? (mat3){{910., 0., 1164.0 / 2, + 0., 910., 874.0 / 2, + 0., 0., 1.}} + : (mat3){{2648.0, 0.0, 1928.0 / 2, + 0.0, 2648.0, 1208.0 / 2, + 0.0, 0.0, 1.0}}; + +// without unwarp, focal length is for center portion only +const mat3 ecam_intrinsic_matrix = (mat3){{620.0, 0.0, 1928.0 / 2, + 0.0, 620.0, 1208.0 / 2, + 0.0, 0.0, 1.0}}; + +static inline mat3 get_model_yuv_transform(bool bayer = true) { + float db_s = Hardware::EON() ? 0.5 : 1.0; // debayering does a 2x downscale on EON + const mat3 transform = (mat3){{ + 1.0, 0.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 0.0, 1.0 + }}; + return bayer ? transform_scale_buffer(transform, db_s) : transform; +} diff --git a/selfdrive/common/params.cc b/selfdrive/common/params.cc new file mode 100644 index 000000000..3f64f790c --- /dev/null +++ b/selfdrive/common/params.cc @@ -0,0 +1,280 @@ +#include "selfdrive/common/params.h" + +#include +#include + +#include +#include + +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/util.h" +#include "selfdrive/hardware/hw.h" + +namespace { + +volatile sig_atomic_t params_do_exit = 0; +void params_sig_handler(int signal) { + params_do_exit = 1; +} + +int fsync_dir(const std::string &path) { + int result = -1; + int fd = HANDLE_EINTR(open(path.c_str(), O_RDONLY, 0755)); + if (fd >= 0) { + result = fsync(fd); + close(fd); + } + return result; +} + +bool create_params_path(const std::string ¶m_path, const std::string &key_path) { + // Make sure params path exists + if (!util::file_exists(param_path) && !util::create_directories(param_path, 0775)) { + return false; + } + + // See if the symlink exists, otherwise create it + if (!util::file_exists(key_path)) { + // 1) Create temp folder + // 2) Symlink it to temp link + // 3) Move symlink to /d + + std::string tmp_path = param_path + "/.tmp_XXXXXX"; + // this should be OK since mkdtemp just replaces characters in place + char *tmp_dir = mkdtemp((char *)tmp_path.c_str()); + if (tmp_dir == NULL) { + return false; + } + + std::string link_path = std::string(tmp_dir) + ".link"; + if (symlink(tmp_dir, link_path.c_str()) != 0) { + return false; + } + + // don't return false if it has been created by other + if (rename(link_path.c_str(), key_path.c_str()) != 0 && errno != EEXIST) { + return false; + } + } + + return true; +} + +std::string ensure_params_path(const std::string &path = {}) { + std::string params_path = path.empty() ? Path::params() : path; + if (!create_params_path(params_path, params_path + "/d")) { + throw std::runtime_error(util::string_format("Failed to ensure params path, errno=%d", errno)); + } + return params_path; +} + +class FileLock { +public: + FileLock(const std::string &fn) { + fd_ = HANDLE_EINTR(open(fn.c_str(), O_CREAT, 0775)); + if (fd_ < 0 || HANDLE_EINTR(flock(fd_, LOCK_EX)) < 0) { + LOGE("Failed to lock file %s, errno=%d", fn.c_str(), errno); + } + } + ~FileLock() { close(fd_); } + +private: + int fd_ = -1; +}; + +std::unordered_map keys = { + {"AccessToken", CLEAR_ON_MANAGER_START | DONT_LOG}, + {"AthenadPid", PERSISTENT}, + {"AthenadUploadQueue", PERSISTENT}, + {"CalibrationParams", PERSISTENT}, + {"CarBatteryCapacity", PERSISTENT}, + {"CarParams", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON}, + {"CarParamsCache", CLEAR_ON_MANAGER_START}, + {"CarVin", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON}, + {"CompletedTrainingVersion", PERSISTENT}, + {"ControlsReady", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON}, + {"CurrentRoute", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON}, + {"DisablePowerDown", PERSISTENT}, + {"DisableRadar_Allow", PERSISTENT}, + {"DisableRadar", PERSISTENT}, // WARNING: THIS DISABLES AEB + {"DisableUpdates", PERSISTENT}, + {"DongleId", PERSISTENT}, + {"DoReboot", CLEAR_ON_MANAGER_START}, + {"DoShutdown", CLEAR_ON_MANAGER_START}, + {"DoUninstall", CLEAR_ON_MANAGER_START}, + {"EnableWideCamera", CLEAR_ON_MANAGER_START}, + {"EndToEndToggle", PERSISTENT}, + {"ForcePowerDown", CLEAR_ON_MANAGER_START}, + {"GitBranch", PERSISTENT}, + {"GitCommit", PERSISTENT}, + {"GitDiff", PERSISTENT}, + {"GithubSshKeys", PERSISTENT}, + {"GithubUsername", PERSISTENT}, + {"GitRemote", PERSISTENT}, + {"GsmApn", PERSISTENT}, + {"GsmRoaming", PERSISTENT}, + {"HardwareSerial", PERSISTENT}, + {"HasAcceptedTerms", PERSISTENT}, + {"IMEI", PERSISTENT}, + {"InstallDate", PERSISTENT}, + {"IsDriverViewEnabled", CLEAR_ON_MANAGER_START}, + {"IsEngaged", PERSISTENT}, + {"IsLdwEnabled", PERSISTENT}, + {"IsMetric", PERSISTENT}, + {"IsOffroad", CLEAR_ON_MANAGER_START}, + {"IsOnroad", PERSISTENT}, + {"IsRHD", PERSISTENT}, + {"IsTakingSnapshot", CLEAR_ON_MANAGER_START}, + {"IsUpdateAvailable", CLEAR_ON_MANAGER_START}, + {"JoystickDebugMode", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_OFF}, + {"LastAthenaPingTime", CLEAR_ON_MANAGER_START}, + {"LastGPSPosition", PERSISTENT}, + {"LastManagerExitReason", CLEAR_ON_MANAGER_START}, + {"LastPeripheralPandaType", PERSISTENT}, + {"LastPowerDropDetected", CLEAR_ON_MANAGER_START}, + {"LastSystemShutdown", CLEAR_ON_MANAGER_START}, + {"LastUpdateException", PERSISTENT}, + {"LastUpdateTime", PERSISTENT}, + {"LiveParameters", PERSISTENT}, + {"NavDestination", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_OFF}, + {"NavSettingTime24h", PERSISTENT}, + {"NavdRender", PERSISTENT}, + {"OpenpilotEnabledToggle", PERSISTENT}, + {"PandaHeartbeatLost", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_OFF}, + {"PandaSignatures", CLEAR_ON_MANAGER_START}, + {"Passive", PERSISTENT}, + {"PrimeRedirected", PERSISTENT}, + {"PrimeType", PERSISTENT}, + {"RecordFront", PERSISTENT}, + {"RecordFrontLock", PERSISTENT}, // for the internal fleet + {"ReleaseNotes", PERSISTENT}, + {"ShouldDoUpdate", CLEAR_ON_MANAGER_START}, + {"SnoozeUpdate", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_OFF}, + {"SshEnabled", PERSISTENT}, + {"SubscriberInfo", PERSISTENT}, + {"TermsVersion", PERSISTENT}, + {"Timezone", PERSISTENT}, + {"TrainingVersion", PERSISTENT}, + {"UpdateAvailable", CLEAR_ON_MANAGER_START}, + {"UpdateFailedCount", CLEAR_ON_MANAGER_START}, + {"Version", PERSISTENT}, + {"VisionRadarToggle", PERSISTENT}, + {"ApiCache_Device", PERSISTENT}, + {"ApiCache_DriveStats", PERSISTENT}, + {"ApiCache_NavDestinations", PERSISTENT}, + {"ApiCache_Owner", PERSISTENT}, + {"Offroad_CarUnrecognized", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON}, + {"Offroad_ChargeDisabled", CLEAR_ON_MANAGER_START }, + {"Offroad_ConnectivityNeeded", CLEAR_ON_MANAGER_START}, + {"Offroad_ConnectivityNeededPrompt", CLEAR_ON_MANAGER_START}, + {"Offroad_InvalidTime", CLEAR_ON_MANAGER_START}, + {"Offroad_IsTakingSnapshot", CLEAR_ON_MANAGER_START}, + {"Offroad_NeosUpdate", CLEAR_ON_MANAGER_START}, + {"Offroad_NoFirmware", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON}, + {"Offroad_StorageMissing", CLEAR_ON_MANAGER_START}, + {"Offroad_TemperatureTooHigh", CLEAR_ON_MANAGER_START}, + {"Offroad_UnofficialHardware", CLEAR_ON_MANAGER_START}, + {"Offroad_UpdateFailed", CLEAR_ON_MANAGER_START}, +}; + +} // namespace + +Params::Params(const std::string &path) { + static std::string default_param_path = ensure_params_path(); + params_path = path.empty() ? default_param_path : ensure_params_path(path); +} + +bool Params::checkKey(const std::string &key) { + return keys.find(key) != keys.end(); +} + +ParamKeyType Params::getKeyType(const std::string &key) { + return static_cast(keys[key]); +} + +int Params::put(const char* key, const char* value, size_t value_size) { + // Information about safely and atomically writing a file: https://lwn.net/Articles/457667/ + // 1) Create temp file + // 2) Write data to temp file + // 3) fsync() the temp file + // 4) rename the temp file to the real name + // 5) fsync() the containing directory + std::string tmp_path = params_path + "/.tmp_value_XXXXXX"; + int tmp_fd = mkstemp((char*)tmp_path.c_str()); + if (tmp_fd < 0) return -1; + + int result = -1; + do { + // Write value to temp. + ssize_t bytes_written = HANDLE_EINTR(write(tmp_fd, value, value_size)); + if (bytes_written < 0 || (size_t)bytes_written != value_size) { + result = -20; + break; + } + + // fsync to force persist the changes. + if ((result = fsync(tmp_fd)) < 0) break; + + FileLock file_lock(params_path + "/.lock"); + + // Move temp into place. + if ((result = rename(tmp_path.c_str(), getParamPath(key).c_str())) < 0) break; + + // fsync parent directory + result = fsync_dir(getParamPath()); + } while (false); + + close(tmp_fd); + ::unlink(tmp_path.c_str()); + return result; +} + +int Params::remove(const std::string &key) { + FileLock file_lock(params_path + "/.lock"); + int result = unlink(getParamPath(key).c_str()); + if (result != 0) { + return result; + } + return fsync_dir(getParamPath()); +} + +std::string Params::get(const std::string &key, bool block) { + if (!block) { + return util::read_file(getParamPath(key)); + } else { + // blocking read until successful + params_do_exit = 0; + void (*prev_handler_sigint)(int) = std::signal(SIGINT, params_sig_handler); + void (*prev_handler_sigterm)(int) = std::signal(SIGTERM, params_sig_handler); + + std::string value; + while (!params_do_exit) { + if (value = util::read_file(getParamPath(key)); !value.empty()) { + break; + } + util::sleep_for(100); // 0.1 s + } + + std::signal(SIGINT, prev_handler_sigint); + std::signal(SIGTERM, prev_handler_sigterm); + return value; + } +} + +std::map Params::readAll() { + FileLock file_lock(params_path + "/.lock"); + return util::read_files_in_dir(getParamPath()); +} + +void Params::clearAll(ParamKeyType key_type) { + FileLock file_lock(params_path + "/.lock"); + + std::string path; + for (auto &[key, type] : keys) { + if (type & key_type) { + unlink(getParamPath(key).c_str()); + } + } + + fsync_dir(getParamPath()); +} diff --git a/selfdrive/common/params.h b/selfdrive/common/params.h new file mode 100644 index 000000000..50680dfc0 --- /dev/null +++ b/selfdrive/common/params.h @@ -0,0 +1,91 @@ +#pragma once + +#include +#include +#include +#include +using std::cerr; +using std::cout; +using std::endl; +#include +using std::ifstream; +using std::ofstream; +#include + +#define ERR_NO_VALUE -33 +const std::string tinkla_params_path = "/data/params"; + +enum ParamKeyType { + PERSISTENT = 0x02, + CLEAR_ON_MANAGER_START = 0x04, + CLEAR_ON_IGNITION_ON = 0x08, + CLEAR_ON_IGNITION_OFF = 0x10, + DONT_LOG = 0x20, + ALL = 0xFFFFFFFF +}; + +class Params { +public: + Params(const std::string &path = {}); + bool checkKey(const std::string &key); + ParamKeyType getKeyType(const std::string &key); + inline std::string getParamPath(const std::string &key = {}) { + return key.empty() ? params_path + "/d" : params_path + "/d/" + key; + } + + // Delete a value + int remove(const std::string &key); + void clearAll(ParamKeyType type); + + // helpers for reading values + std::string get(const std::string &key, bool block = false); + inline bool getBool(const std::string &key) { + return get(key) == "1"; + } + std::map readAll(); + + inline bool tinkla_get_bool_param(const std::string &tinkla_param) { + std::ifstream ifile; + ifile.open(tinkla_params_path + "/" + tinkla_param); + if (!ifile) { + //no file assume false and create + ofstream ofile; + ofile.open(tinkla_params_path + "/" + tinkla_param); + if (ofile) { + ofile << 0; + ofile.close(); + } + return false; + } else { + int value; + ifile >> value; + ifile.close(); + if (value == 0) { + return false; + } else { + return true; + } + } + } + + inline void tinkla_set_bool_param(const std::string &tinkla_param,int tinkla_param_value) { + ofstream ofile; + ofile.open(tinkla_params_path + "/" + tinkla_param); + if (ofile) { + ofile << tinkla_param_value; + ofile.close(); + } + } + + // helpers for writing values + int put(const char *key, const char *val, size_t value_size); + inline int put(const std::string &key, const std::string &val) { + return put(key.c_str(), val.data(), val.size()); + } + inline int putBool(const std::string &key, bool val) { + return put(key.c_str(), val ? "1" : "0", 1); + } + +private: + std::string params_path; +}; diff --git a/selfdrive/common/queue.h b/selfdrive/common/queue.h new file mode 100644 index 000000000..b3558b11a --- /dev/null +++ b/selfdrive/common/queue.h @@ -0,0 +1,52 @@ +#pragma once + +#include +#include +#include + +template +class SafeQueue { +public: + SafeQueue() = default; + + void push(const T& v) { + { + std::unique_lock lk(m); + q.push(v); + } + cv.notify_one(); + } + + T pop() { + std::unique_lock lk(m); + cv.wait(lk, [this] { return !q.empty(); }); + T v = q.front(); + q.pop(); + return v; + } + + bool try_pop(T& v, int timeout_ms = 0) { + std::unique_lock lk(m); + if (!cv.wait_for(lk, std::chrono::milliseconds(timeout_ms), [this] { return !q.empty(); })) { + return false; + } + v = q.front(); + q.pop(); + return true; + } + + bool empty() const { + std::scoped_lock lk(m); + return q.empty(); + } + + size_t size() const { + std::scoped_lock lk(m); + return q.size(); + } + +private: + mutable std::mutex m; + std::condition_variable cv; + std::queue q; +}; diff --git a/selfdrive/common/statlog.cc b/selfdrive/common/statlog.cc new file mode 100644 index 000000000..27dfc2ca9 --- /dev/null +++ b/selfdrive/common/statlog.cc @@ -0,0 +1,43 @@ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + +#include "selfdrive/common/statlog.h" +#include "selfdrive/common/util.h" + +#include +#include +#include + +class StatlogState : public LogState { + public: + StatlogState() : LogState("ipc:///tmp/stats") {} +}; + +static StatlogState s = {}; + +static void log(const char* metric_type, const char* metric, const char* fmt, ...) { + char* value_buf = nullptr; + va_list args; + va_start(args, fmt); + int ret = vasprintf(&value_buf, fmt, args); + va_end(args); + + if (ret > 0 && value_buf) { + char* line_buf = nullptr; + ret = asprintf(&line_buf, "%s:%s|%s", metric, value_buf, metric_type); + if (ret > 0 && line_buf) { + zmq_send(s.sock, line_buf, ret, ZMQ_NOBLOCK); + free(line_buf); + } + free(value_buf); + } +} + +void statlog_log(const char* metric_type, const char* metric, int value) { + log(metric_type, metric, "%d", value); +} + +void statlog_log(const char* metric_type, const char* metric, float value) { + log(metric_type, metric, "%f", value); +} diff --git a/selfdrive/common/statlog.h b/selfdrive/common/statlog.h new file mode 100644 index 000000000..5d223bb66 --- /dev/null +++ b/selfdrive/common/statlog.h @@ -0,0 +1,10 @@ +#pragma once + +#define STATLOG_GAUGE "g" +#define STATLOG_SAMPLE "sa" + +void statlog_log(const char* metric_type, const char* metric, int value); +void statlog_log(const char* metric_type, const char* metric, float value); + +#define statlog_gauge(metric, value) statlog_log(STATLOG_GAUGE, metric, value) +#define statlog_sample(metric, value) statlog_log(STATLOG_SAMPLE, metric, value) diff --git a/selfdrive/common/swaglog.cc b/selfdrive/common/swaglog.cc new file mode 100644 index 000000000..1fe700415 --- /dev/null +++ b/selfdrive/common/swaglog.cc @@ -0,0 +1,101 @@ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + +#include "selfdrive/common/swaglog.h" + +#include +#include +#include +#include + +#include +#include "json11.hpp" + +#include "selfdrive/common/util.h" +#include "selfdrive/common/version.h" +#include "selfdrive/hardware/hw.h" + +class SwaglogState : public LogState { + public: + SwaglogState() : LogState("ipc:///tmp/logmessage") {} + + bool initialized = false; + json11::Json::object ctx_j; + + inline void initialize() { + ctx_j = json11::Json::object {}; + print_level = CLOUDLOG_WARNING; + const char* print_lvl = getenv("LOGPRINT"); + if (print_lvl) { + if (strcmp(print_lvl, "debug") == 0) { + print_level = CLOUDLOG_DEBUG; + } else if (strcmp(print_lvl, "info") == 0) { + print_level = CLOUDLOG_INFO; + } else if (strcmp(print_lvl, "warning") == 0) { + print_level = CLOUDLOG_WARNING; + } + } + + // openpilot bindings + char* dongle_id = getenv("DONGLE_ID"); + if (dongle_id) { + ctx_j["dongle_id"] = dongle_id; + } + char* daemon_name = getenv("MANAGER_DAEMON"); + if (daemon_name) { + ctx_j["daemon"] = daemon_name; + } + ctx_j["version"] = COMMA_VERSION; + ctx_j["dirty"] = !getenv("CLEAN"); + + // device type + if (Hardware::EON()) { + ctx_j["device"] = "eon"; + } else if (Hardware::TICI()) { + ctx_j["device"] = "tici"; + } else { + ctx_j["device"] = "pc"; + } + + initialized = true; + } +}; + +static SwaglogState s = {}; + +static void log(int levelnum, const char* filename, int lineno, const char* func, const char* msg, const std::string& log_s) { + if (levelnum >= s.print_level) { + printf("%s: %s\n", filename, msg); + } + char levelnum_c = levelnum; + zmq_send(s.sock, (levelnum_c + log_s).c_str(), log_s.length() + 1, ZMQ_NOBLOCK); +} + +void cloudlog_e(int levelnum, const char* filename, int lineno, const char* func, + const char* fmt, ...) { + char* msg_buf = nullptr; + va_list args; + va_start(args, fmt); + int ret = vasprintf(&msg_buf, fmt, args); + va_end(args); + + if (ret <= 0 || !msg_buf) return; + + std::lock_guard lk(s.lock); + + if (!s.initialized) s.initialize(); + + json11::Json log_j = json11::Json::object { + {"msg", msg_buf}, + {"ctx", s.ctx_j}, + {"levelnum", levelnum}, + {"filename", filename}, + {"lineno", lineno}, + {"funcname", func}, + {"created", seconds_since_epoch()} + }; + std::string log_s = log_j.dump(); + log(levelnum, filename, lineno, func, msg_buf, log_s); + free(msg_buf); +} diff --git a/selfdrive/common/swaglog.h b/selfdrive/common/swaglog.h new file mode 100644 index 000000000..6403820ac --- /dev/null +++ b/selfdrive/common/swaglog.h @@ -0,0 +1,57 @@ +#pragma once + +#include "selfdrive/common/timing.h" + +#define CLOUDLOG_DEBUG 10 +#define CLOUDLOG_INFO 20 +#define CLOUDLOG_WARNING 30 +#define CLOUDLOG_ERROR 40 +#define CLOUDLOG_CRITICAL 50 + + + +void cloudlog_e(int levelnum, const char* filename, int lineno, const char* func, + const char* fmt, ...) /*__attribute__ ((format (printf, 6, 7)))*/; + +#define cloudlog(lvl, fmt, ...) cloudlog_e(lvl, __FILE__, __LINE__, \ + __func__, \ + fmt, ## __VA_ARGS__) + +#define cloudlog_rl(burst, millis, lvl, fmt, ...) \ +{ \ + static uint64_t __begin = 0; \ + static int __printed = 0; \ + static int __missed = 0; \ + \ + int __burst = (burst); \ + int __millis = (millis); \ + uint64_t __ts = nanos_since_boot(); \ + \ + if (!__begin) __begin = __ts; \ + \ + if (__begin + __millis*1000000ULL < __ts) { \ + if (__missed) { \ + cloudlog(CLOUDLOG_WARNING, "cloudlog: %d messages suppressed", __missed); \ + } \ + __begin = 0; \ + __printed = 0; \ + __missed = 0; \ + } \ + \ + if (__printed < __burst) { \ + cloudlog(lvl, fmt, ## __VA_ARGS__); \ + __printed++; \ + } else { \ + __missed++; \ + } \ +} + +#define LOGD(fmt, ...) cloudlog(CLOUDLOG_DEBUG, fmt, ## __VA_ARGS__) +#define LOG(fmt, ...) cloudlog(CLOUDLOG_INFO, fmt, ## __VA_ARGS__) +#define LOGW(fmt, ...) cloudlog(CLOUDLOG_WARNING, fmt, ## __VA_ARGS__) +#define LOGE(fmt, ...) cloudlog(CLOUDLOG_ERROR, fmt, ## __VA_ARGS__) + +#define LOGD_100(fmt, ...) cloudlog_rl(2, 100, CLOUDLOG_DEBUG, fmt, ## __VA_ARGS__) +#define LOG_100(fmt, ...) cloudlog_rl(2, 100, CLOUDLOG_INFO, fmt, ## __VA_ARGS__) +#define LOGW_100(fmt, ...) cloudlog_rl(2, 100, CLOUDLOG_WARNING, fmt, ## __VA_ARGS__) +#define LOGE_100(fmt, ...) cloudlog_rl(2, 100, CLOUDLOG_ERROR, fmt, ## __VA_ARGS__) diff --git a/selfdrive/common/timing.h b/selfdrive/common/timing.h new file mode 100644 index 000000000..83f55e0c4 --- /dev/null +++ b/selfdrive/common/timing.h @@ -0,0 +1,51 @@ +#pragma once + +#include +#include + +#ifdef __APPLE__ +#define CLOCK_BOOTTIME CLOCK_MONOTONIC +#endif + +static inline uint64_t nanos_since_boot() { + struct timespec t; + clock_gettime(CLOCK_BOOTTIME, &t); + return t.tv_sec * 1000000000ULL + t.tv_nsec; +} + +static inline double millis_since_boot() { + struct timespec t; + clock_gettime(CLOCK_BOOTTIME, &t); + return t.tv_sec * 1000.0 + t.tv_nsec * 1e-6; +} + +static inline double seconds_since_boot() { + struct timespec t; + clock_gettime(CLOCK_BOOTTIME, &t); + return (double)t.tv_sec + t.tv_nsec * 1e-9; +} + +static inline uint64_t nanos_since_epoch() { + struct timespec t; + clock_gettime(CLOCK_REALTIME, &t); + return t.tv_sec * 1000000000ULL + t.tv_nsec; +} + +static inline double seconds_since_epoch() { + struct timespec t; + clock_gettime(CLOCK_REALTIME, &t); + return (double)t.tv_sec + t.tv_nsec * 1e-9; +} + +// you probably should use nanos_since_boot instead +static inline uint64_t nanos_monotonic() { + struct timespec t; + clock_gettime(CLOCK_MONOTONIC, &t); + return t.tv_sec * 1000000000ULL + t.tv_nsec; +} + +static inline uint64_t nanos_monotonic_raw() { + struct timespec t; + clock_gettime(CLOCK_MONOTONIC_RAW, &t); + return t.tv_sec * 1000000000ULL + t.tv_nsec; +} diff --git a/selfdrive/common/tinkla_version.h b/selfdrive/common/tinkla_version.h new file mode 100644 index 000000000..48015f79f --- /dev/null +++ b/selfdrive/common/tinkla_version.h @@ -0,0 +1 @@ +#define TINKLA_VERSION "0.8.13-28" diff --git a/selfdrive/common/util.cc b/selfdrive/common/util.cc new file mode 100644 index 000000000..534a7f445 --- /dev/null +++ b/selfdrive/common/util.cc @@ -0,0 +1,244 @@ +#include "selfdrive/common/util.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifdef __linux__ +#include +#include +#ifndef __USE_GNU +#define __USE_GNU +#endif +#include +#endif // __linux__ + +namespace util { + +void set_thread_name(const char* name) { +#ifdef __linux__ + // pthread_setname_np is dumb (fails instead of truncates) + prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0); +#endif +} + +int set_realtime_priority(int level) { +#ifdef __linux__ + long tid = syscall(SYS_gettid); + + // should match python using chrt + struct sched_param sa; + memset(&sa, 0, sizeof(sa)); + sa.sched_priority = level; + return sched_setscheduler(tid, SCHED_FIFO, &sa); +#else + return -1; +#endif +} + +int set_core_affinity(std::vector cores) { +#ifdef __linux__ + long tid = syscall(SYS_gettid); + cpu_set_t cpu; + + CPU_ZERO(&cpu); + for (const int n : cores) { + CPU_SET(n, &cpu); + } + return sched_setaffinity(tid, sizeof(cpu), &cpu); +#else + return -1; +#endif +} + +std::string read_file(const std::string& fn) { + std::ifstream f(fn, std::ios::binary | std::ios::in); + if (f.is_open()) { + f.seekg(0, std::ios::end); + int size = f.tellg(); + if (f.good() && size > 0) { + std::string result(size, '\0'); + f.seekg(0, std::ios::beg); + f.read(result.data(), size); + // return either good() or has reached end-of-file (e.g. /sys/power/wakeup_count) + if (f.good() || f.eof()) { + result.resize(f.gcount()); + return result; + } + } + // fallback for files created on read, e.g. procfs + std::stringstream buffer; + buffer << f.rdbuf(); + return buffer.str(); + } + return std::string(); +} + +std::map read_files_in_dir(const std::string &path) { + std::map ret; + DIR *d = opendir(path.c_str()); + if (!d) return ret; + + struct dirent *de = NULL; + while ((de = readdir(d))) { + if (de->d_type != DT_DIR) { + ret[de->d_name] = util::read_file(path + "/" + de->d_name); + } + } + + closedir(d); + return ret; +} + +int write_file(const char* path, const void* data, size_t size, int flags, mode_t mode) { + int fd = HANDLE_EINTR(open(path, flags, mode)); + if (fd == -1) { + return -1; + } + ssize_t n = HANDLE_EINTR(write(fd, data, size)); + close(fd); + return (n >= 0 && (size_t)n == size) ? 0 : -1; +} + +FILE* safe_fopen(const char* filename, const char* mode) { + FILE* fp = NULL; + do { + fp = fopen(filename, mode); + } while ((nullptr == fp) && (errno == EINTR)); + return fp; +} + +size_t safe_fwrite(const void* ptr, size_t size, size_t count, FILE* stream) { + size_t written = 0; + do { + size_t ret = ::fwrite((void*)((char *)ptr + written * size), size, count - written, stream); + if (ret == 0 && errno != EINTR) break; + written += ret; + } while (written != count); + return written; +} + +int safe_fflush(FILE *stream) { + int ret = EOF; + do { + ret = fflush(stream); + } while ((EOF == ret) && (errno == EINTR)); + return ret; +} + +std::string readlink(const std::string &path) { + char buff[4096]; + ssize_t len = ::readlink(path.c_str(), buff, sizeof(buff)-1); + if (len != -1) { + buff[len] = '\0'; + return std::string(buff); + } + return ""; +} + +bool file_exists(const std::string& fn) { + struct stat st = {}; + return stat(fn.c_str(), &st) != -1; +} + +static bool createDirectory(std::string dir, mode_t mode) { + auto verify_dir = [](const std::string& dir) -> bool { + struct stat st = {}; + return (stat(dir.c_str(), &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR); + }; + // remove trailing /'s + while (dir.size() > 1 && dir.back() == '/') { + dir.pop_back(); + } + // try to mkdir this directory + if (mkdir(dir.c_str(), mode) == 0) return true; + if (errno == EEXIST) return verify_dir(dir); + if (errno != ENOENT) return false; + + // mkdir failed because the parent dir doesn't exist, so try to create it + size_t slash = dir.rfind('/'); + if ((slash == std::string::npos || slash < 1) || + !createDirectory(dir.substr(0, slash), mode)) { + return false; + } + + // try again + if (mkdir(dir.c_str(), mode) == 0) return true; + return errno == EEXIST && verify_dir(dir); +} + +bool create_directories(const std::string& dir, mode_t mode) { + if (dir.empty()) return false; + return createDirectory(dir, mode); +} + +std::string getenv(const char* key, const char* default_val) { + const char* val = ::getenv(key); + return val ? val : default_val; +} + +int getenv(const char* key, int default_val) { + const char* val = ::getenv(key); + return val ? atoi(val) : default_val; +} + +float getenv(const char* key, float default_val) { + const char* val = ::getenv(key); + return val ? atof(val) : default_val; +} + +std::string hexdump(const uint8_t* in, const size_t size) { + std::stringstream ss; + ss << std::hex << std::setfill('0'); + for (size_t i = 0; i < size; i++) { + ss << std::setw(2) << static_cast(in[i]); + } + return ss.str(); +} + +std::string dir_name(std::string const &path) { + size_t pos = path.find_last_of("/"); + if (pos == std::string::npos) return ""; + return path.substr(0, pos); +} + +std::string check_output(const std::string& command) { + char buffer[128]; + std::string result; + std::unique_ptr pipe(popen(command.c_str(), "r"), pclose); + + if (!pipe) { + return ""; + } + + while (fgets(buffer, std::size(buffer), pipe.get()) != nullptr) { + result += std::string(buffer); + } + + return result; +} + +struct tm get_time() { + time_t rawtime; + time(&rawtime); + + struct tm sys_time; + gmtime_r(&rawtime, &sys_time); + + return sys_time; +} + +bool time_valid(struct tm sys_time) { + int year = 1900 + sys_time.tm_year; + int month = 1 + sys_time.tm_mon; + return (year > 2021) || (year == 2021 && month >= 6); +} + +} // namespace util diff --git a/selfdrive/common/util.h b/selfdrive/common/util.h new file mode 100644 index 000000000..bf0df3bca --- /dev/null +++ b/selfdrive/common/util.h @@ -0,0 +1,190 @@ +#pragma once + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// keep trying if x gets interrupted by a signal +#define HANDLE_EINTR(x) \ + ({ \ + decltype(x) ret_; \ + int try_cnt = 0; \ + do { \ + ret_ = (x); \ + } while (ret_ == -1 && errno == EINTR && try_cnt++ < 100); \ + ret_; \ + }) + +#ifndef sighandler_t +typedef void (*sighandler_t)(int sig); +#endif + +const double MILE_TO_KM = 1.609344; +const double KM_TO_MILE = 1. / MILE_TO_KM; +const double MS_TO_KPH = 3.6; +const double MS_TO_MPH = MS_TO_KPH * KM_TO_MILE; +const double METER_TO_MILE = KM_TO_MILE / 1000.0; +const double METER_TO_FOOT = 3.28084; + +namespace util { + +void set_thread_name(const char* name); +int set_realtime_priority(int level); +int set_core_affinity(std::vector cores); + +// ***** Time helpers ***** +struct tm get_time(); +bool time_valid(struct tm sys_time); + +// ***** math helpers ***** + +// map x from [a1, a2] to [b1, b2] +template +T map_val(T x, T a1, T a2, T b1, T b2) { + x = std::clamp(x, a1, a2); + T ra = a2 - a1; + T rb = b2 - b1; + return (x - a1) * rb / ra + b1; +} + +// ***** string helpers ***** + +template +std::string string_format(const std::string& format, Args... args) { + size_t size = snprintf(nullptr, 0, format.c_str(), args...) + 1; + std::unique_ptr buf(new char[size]); + snprintf(buf.get(), size, format.c_str(), args...); + return std::string(buf.get(), buf.get() + size - 1); +} + +std::string getenv(const char* key, const char* default_val = ""); +int getenv(const char* key, int default_val); +float getenv(const char* key, float default_val); + +std::string hexdump(const uint8_t* in, const size_t size); +std::string dir_name(std::string const& path); + +// **** file fhelpers ***** +std::string read_file(const std::string& fn); +std::map read_files_in_dir(const std::string& path); +int write_file(const char* path, const void* data, size_t size, int flags = O_WRONLY, mode_t mode = 0664); + +FILE* safe_fopen(const char* filename, const char* mode); +size_t safe_fwrite(const void * ptr, size_t size, size_t count, FILE * stream); +int safe_fflush(FILE *stream); + +std::string readlink(const std::string& path); +bool file_exists(const std::string& fn); +bool create_directories(const std::string &dir, mode_t mode); + +std::string check_output(const std::string& command); + +inline void sleep_for(const int milliseconds) { + if (milliseconds > 0) { + std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds)); + } +} + +} // namespace util + +class ExitHandler { +public: + ExitHandler() { + std::signal(SIGINT, (sighandler_t)set_do_exit); + std::signal(SIGTERM, (sighandler_t)set_do_exit); + +#ifndef __APPLE__ + std::signal(SIGPWR, (sighandler_t)set_do_exit); +#endif + }; + inline static std::atomic power_failure = false; + inline static std::atomic signal = 0; + inline operator bool() { return do_exit; } + inline ExitHandler& operator=(bool v) { + signal = 0; + do_exit = v; + return *this; + } +private: + static void set_do_exit(int sig) { +#ifndef __APPLE__ + power_failure = (sig == SIGPWR); +#endif + signal = sig; + do_exit = true; + } + inline static std::atomic do_exit = false; +}; + +struct unique_fd { + unique_fd(int fd = -1) : fd_(fd) {} + unique_fd& operator=(unique_fd&& uf) { + fd_ = uf.fd_; + uf.fd_ = -1; + return *this; + } + ~unique_fd() { + if (fd_ != -1) close(fd_); + } + operator int() const { return fd_; } + int fd_; +}; + +class FirstOrderFilter { +public: + FirstOrderFilter(float x0, float ts, float dt) { + k_ = (dt / ts) / (1.0 + dt / ts); + x_ = x0; + } + inline float update(float x) { + x_ = (1. - k_) * x_ + k_ * x; + return x_; + } + inline void reset(float x) { x_ = x; } + inline float x(){ return x_; } + +private: + float x_, k_; +}; + +template +void update_max_atomic(std::atomic& max, T const& value) { + T prev = max; + while(prev < value && !max.compare_exchange_weak(prev, value)) {} +} + +class LogState { + public: + std::mutex lock; + void *zctx; + void *sock; + int print_level; + + LogState(const char* endpoint) { + zctx = zmq_ctx_new(); + sock = zmq_socket(zctx, ZMQ_PUSH); + + // Timeout on shutdown for messages to be received by the logging process + int timeout = 100; + zmq_setsockopt(sock, ZMQ_LINGER, &timeout, sizeof(timeout)); + + zmq_connect(sock, endpoint); + }; + ~LogState() { + zmq_close(sock); + zmq_ctx_destroy(zctx); + } +}; diff --git a/selfdrive/common/version.h b/selfdrive/common/version.h new file mode 100644 index 000000000..bc47cc95e --- /dev/null +++ b/selfdrive/common/version.h @@ -0,0 +1 @@ +#define COMMA_VERSION "0.8.13-28" diff --git a/selfdrive/common/visionimg.cc b/selfdrive/common/visionimg.cc new file mode 100644 index 000000000..a98aabc36 --- /dev/null +++ b/selfdrive/common/visionimg.cc @@ -0,0 +1,63 @@ +#include "selfdrive/common/visionimg.h" + +#include + +#ifdef QCOM +#include +#include +#include +#include +#define GL_GLEXT_PROTOTYPES +#include +using namespace android; + +EGLImageTexture::EGLImageTexture(const VisionBuf *buf) { + const int bpp = 3; + assert((buf->len % buf->stride) == 0); + assert((buf->stride % bpp) == 0); + + const int format = HAL_PIXEL_FORMAT_RGB_888; + private_handle = new private_handle_t(buf->fd, buf->len, + private_handle_t::PRIV_FLAGS_USES_ION|private_handle_t::PRIV_FLAGS_FRAMEBUFFER, + 0, format, + buf->stride/bpp, buf->len/buf->stride, + buf->width, buf->height); + + // GraphicBuffer is ref counted by EGLClientBuffer(ANativeWindowBuffer), no need and not possible to release. + GraphicBuffer* gb = new GraphicBuffer(buf->width, buf->height, (PixelFormat)format, + GraphicBuffer::USAGE_HW_TEXTURE, buf->stride/bpp, (private_handle_t*)private_handle, false); + + EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); + assert(display != EGL_NO_DISPLAY); + + EGLint img_attrs[] = {EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE}; + img_khr = eglCreateImageKHR(display, EGL_NO_CONTEXT, + EGL_NATIVE_BUFFER_ANDROID, gb->getNativeBuffer(), img_attrs); + assert(img_khr != EGL_NO_IMAGE_KHR); + + glGenTextures(1, &frame_tex); + glBindTexture(GL_TEXTURE_2D, frame_tex); + glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, img_khr); +} + +EGLImageTexture::~EGLImageTexture() { + glDeleteTextures(1, &frame_tex); + EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); + assert(display != EGL_NO_DISPLAY); + eglDestroyImageKHR(display, img_khr); + delete (private_handle_t*)private_handle; +} + +#else // ifdef QCOM + +EGLImageTexture::EGLImageTexture(const VisionBuf *buf) { + glGenTextures(1, &frame_tex); + glBindTexture(GL_TEXTURE_2D, frame_tex); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, buf->width, buf->height, 0, GL_RGB, GL_UNSIGNED_BYTE, nullptr); + glGenerateMipmap(GL_TEXTURE_2D); +} + +EGLImageTexture::~EGLImageTexture() { + glDeleteTextures(1, &frame_tex); +} +#endif // ifdef QCOM diff --git a/selfdrive/common/visionimg.h b/selfdrive/common/visionimg.h new file mode 100644 index 000000000..e8917f3bd --- /dev/null +++ b/selfdrive/common/visionimg.h @@ -0,0 +1,27 @@ +#pragma once + +#include "cereal/visionipc/visionbuf.h" + +#ifdef __APPLE__ +#include +#else +#include +#endif + +#ifdef QCOM +#include +#define EGL_EGLEXT_PROTOTYPES +#include +#undef Status +#endif + +class EGLImageTexture { + public: + EGLImageTexture(const VisionBuf *buf); + ~EGLImageTexture(); + GLuint frame_tex = 0; +#ifdef QCOM + void *private_handle = nullptr; + EGLImageKHR img_khr = 0; +#endif +}; diff --git a/selfdrive/common/watchdog.cc b/selfdrive/common/watchdog.cc new file mode 100644 index 000000000..c937103a5 --- /dev/null +++ b/selfdrive/common/watchdog.cc @@ -0,0 +1,12 @@ +#include "selfdrive/common/watchdog.h" +#include "selfdrive/common/timing.h" +#include "selfdrive/common/util.h" + +const std::string watchdog_fn_prefix = "/dev/shm/wd_"; // + + +bool watchdog_kick() { + static std::string fn = watchdog_fn_prefix + std::to_string(getpid()); + + uint64_t ts = nanos_since_boot(); + return util::write_file(fn.c_str(), &ts, sizeof(ts), O_WRONLY | O_CREAT) > 0; +} diff --git a/selfdrive/common/watchdog.h b/selfdrive/common/watchdog.h new file mode 100644 index 000000000..7ed23aa0d --- /dev/null +++ b/selfdrive/common/watchdog.h @@ -0,0 +1,3 @@ +#pragma once + +bool watchdog_kick(); diff --git a/selfdrive/config.py b/selfdrive/config.py new file mode 100644 index 000000000..511f6126c --- /dev/null +++ b/selfdrive/config.py @@ -0,0 +1,29 @@ +import numpy as np + +class Conversions: + #Speed + MPH_TO_KPH = 1.609344 + KPH_TO_MPH = 1. / MPH_TO_KPH + MS_TO_KPH = 3.6 + KPH_TO_MS = 1. / MS_TO_KPH + MS_TO_MPH = MS_TO_KPH * KPH_TO_MPH + MPH_TO_MS = MPH_TO_KPH * KPH_TO_MS + MS_TO_KNOTS = 1.9438 + KNOTS_TO_MS = 1. / MS_TO_KNOTS + #Angle + DEG_TO_RAD = np.pi / 180. + RAD_TO_DEG = 1. / DEG_TO_RAD + #Mass + LB_TO_KG = 0.453592 + + +RADAR_TO_CENTER = 2.7 # (deprecated) RADAR is ~ 2.7m ahead from center of car +RADAR_TO_CAMERA = 1.52 # RADAR is ~ 1.5m ahead from center of mesh frame + +class UIParams: + lidar_x, lidar_y, lidar_zoom = 384, 960, 6 + lidar_car_x, lidar_car_y = lidar_x / 2., lidar_y / 1.1 + car_hwidth = 1.7272 / 2 * lidar_zoom + car_front = 2.6924 * lidar_zoom + car_back = 1.8796 * lidar_zoom + car_color = 110 diff --git a/selfdrive/controls/__init__.py b/selfdrive/controls/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py new file mode 100755 index 000000000..0ff104615 --- /dev/null +++ b/selfdrive/controls/controlsd.py @@ -0,0 +1,746 @@ +#!/usr/bin/env python3 +import os +import math +from numbers import Number + +from cereal import car, log +from common.numpy_fast import clip +from common.realtime import sec_since_boot, config_realtime_process, Priority, Ratekeeper, DT_CTRL +from common.profiler import Profiler +from common.params import Params, put_nonblocking +import cereal.messaging as messaging +from selfdrive.config import Conversions as CV +from selfdrive.swaglog import cloudlog +from selfdrive.boardd.boardd import can_list_to_can_capnp +from selfdrive.car.car_helpers import get_car, get_startup_event, get_one_can +from selfdrive.controls.lib.lane_planner import CAMERA_OFFSET +from selfdrive.controls.lib.drive_helpers import update_v_cruise, initialize_v_cruise +from selfdrive.controls.lib.drive_helpers import get_lag_adjusted_curvature +from selfdrive.controls.lib.longcontrol import LongControl +from selfdrive.controls.lib.latcontrol_pid import LatControlPID +from selfdrive.controls.lib.latcontrol_indi import LatControlINDI +from selfdrive.controls.lib.latcontrol_lqr import LatControlLQR +from selfdrive.controls.lib.latcontrol_angle import LatControlAngle +from selfdrive.controls.lib.events import Events, ET +from selfdrive.controls.lib.alertmanager import AlertManager, set_offroad_alert +from selfdrive.controls.lib.vehicle_model import VehicleModel +from selfdrive.locationd.calibrationd import Calibration +from selfdrive.hardware import HARDWARE, TICI, EON +from selfdrive.manager.process_config import managed_processes +from selfdrive.car.modules.CFG_module import load_bool_param + + +SOFT_DISABLE_TIME = 3 # seconds +LDW_MIN_SPEED = 31 * CV.MPH_TO_MS +LANE_DEPARTURE_THRESHOLD = 0.1 + +REPLAY = "REPLAY" in os.environ +SIMULATION = "SIMULATION" in os.environ +NOSENSOR = "NOSENSOR" in os.environ +IGNORE_PROCESSES = {"rtshield", "uploader", "deleter", "loggerd", "logmessaged", "tombstoned", + "logcatd", "proclogd", "clocksd", "updated", "timezoned", "manage_athenad", + "statsd", "shutdownd"} | \ + {k for k, v in managed_processes.items() if not v.enabled} + +ACTUATOR_FIELDS = set(car.CarControl.Actuators.schema.fields.keys()) + +ThermalStatus = log.DeviceState.ThermalStatus +State = log.ControlsState.OpenpilotState +PandaType = log.PandaState.PandaType +Desire = log.LateralPlan.Desire +LaneChangeState = log.LateralPlan.LaneChangeState +LaneChangeDirection = log.LateralPlan.LaneChangeDirection +EventName = car.CarEvent.EventName +ButtonEvent = car.CarState.ButtonEvent +SafetyModel = car.CarParams.SafetyModel + +IGNORED_SAFETY_MODES = [SafetyModel.silent, SafetyModel.noOutput] +CSID_MAP = {"0": EventName.roadCameraError, "1": EventName.wideRoadCameraError, "2": EventName.driverCameraError} + +class Controls: + def __init__(self, sm=None, pm=None, can_sock=None): + config_realtime_process(4 if TICI else 3, Priority.CTRL_HIGH) + + # Setup sockets + self.pm = pm + if self.pm is None: + self.pm = messaging.PubMaster(['sendcan', 'controlsState', 'carState', + 'carControl', 'carEvents', 'carParams']) + + self.camera_packets = ["roadCameraState", "driverCameraState"] + if TICI: + self.camera_packets.append("wideRoadCameraState") + + params = Params() + self.joystick_mode = params.get_bool("JoystickDebugMode") + joystick_packet = ['testJoystick'] if self.joystick_mode else [] + + self.sm = sm + if self.sm is None: + ignore = ['driverCameraState', 'managerState'] if SIMULATION else None + self.sm = messaging.SubMaster(['deviceState', 'pandaStates', 'peripheralState', 'modelV2', 'liveCalibration', + 'driverMonitoringState', 'longitudinalPlan', 'lateralPlan', 'liveLocationKalman', + 'managerState', 'liveParameters', 'radarState'] + self.camera_packets + joystick_packet, + ignore_alive=ignore, ignore_avg_freq=['radarState', 'longitudinalPlan']) + + self.can_sock = can_sock + if can_sock is None: + can_timeout = None if os.environ.get('NO_CAN_TIMEOUT', False) else 100 + self.can_sock = messaging.sub_sock('can', timeout=can_timeout) + + if TICI: + self.log_sock = messaging.sub_sock('androidLog') + + # wait for one pandaState and one CAN packet + print("Waiting for CAN messages...") + get_one_can(self.can_sock) + + self.CI, self.CP = get_car(self.can_sock, self.pm.sock['sendcan']) + + # read params + self.is_metric = params.get_bool("IsMetric") + self.is_ldw_enabled = params.get_bool("IsLdwEnabled") + openpilot_enabled_toggle = params.get_bool("OpenpilotEnabledToggle") + passive = params.get_bool("Passive") or not openpilot_enabled_toggle + + # detect sound card presence and ensure successful init + sounds_available = HARDWARE.get_sound_card_online() + + car_recognized = self.CP.carName != 'mock' + + controller_available = self.CI.CC is not None and not passive and not self.CP.dashcamOnly + self.read_only = not car_recognized or not controller_available or self.CP.dashcamOnly + if self.read_only: + safety_config = car.CarParams.SafetyConfig.new_message() + safety_config.safetyModel = car.CarParams.SafetyModel.noOutput + self.CP.safetyConfigs = [safety_config] + + # Write CarParams for radard + cp_bytes = self.CP.to_bytes() + params.put("CarParams", cp_bytes) + put_nonblocking("CarParamsCache", cp_bytes) + + self.CC = car.CarControl.new_message() + self.AM = AlertManager() + self.events = Events() + + self.LoC = LongControl(self.CP) + self.VM = VehicleModel(self.CP) + + if self.CP.steerControlType == car.CarParams.SteerControlType.angle: + self.LaC = LatControlAngle(self.CP, self.CI) + elif self.CP.lateralTuning.which() == 'pid': + self.LaC = LatControlPID(self.CP, self.CI) + elif self.CP.lateralTuning.which() == 'indi': + self.LaC = LatControlINDI(self.CP, self.CI) + elif self.CP.lateralTuning.which() == 'lqr': + self.LaC = LatControlLQR(self.CP, self.CI) + + self.initialized = False + self.state = State.disabled + self.enabled = False + self.active = False + self.can_rcv_error = False + self.soft_disable_timer = 0 + self.v_cruise_kph = 255 + self.v_cruise_kph_last = 0 + self.mismatch_counter = 0 + self.cruise_mismatch_counter = 0 + self.can_rcv_error_counter = 0 + self.last_blinker_frame = 0 + self.distance_traveled = 0 + self.last_functional_fan_frame = 0 + self.events_prev = [] + self.current_alert_types = [ET.PERMANENT] + self.logged_comm_issue = False + self.button_timers = {ButtonEvent.Type.decelCruise: 0, ButtonEvent.Type.accelCruise: 0} + self.last_actuators = car.CarControl.Actuators.new_message() + + # TODO: no longer necessary, aside from process replay + self.sm['liveParameters'].valid = True + + self.startup_event = get_startup_event(car_recognized, controller_available, len(self.CP.carFw) > 0) + + if not sounds_available: + self.events.add(EventName.soundsUnavailable, static=True) + if not car_recognized: + self.events.add(EventName.carUnrecognized, static=True) + if len(self.CP.carFw) > 0: + set_offroad_alert("Offroad_CarUnrecognized", True) + else: + set_offroad_alert("Offroad_NoFirmware", True) + elif self.read_only: + self.events.add(EventName.dashcamMode, static=True) + elif self.joystick_mode: + self.events.add(EventName.joystickDebug, static=True) + self.startup_event = None + + # controlsd is driven by can recv, expected at 100Hz + self.rk = Ratekeeper(100, print_delay_threshold=None) + self.prof = Profiler(False) # off by default + self.hideGpsMsg = load_bool_param("TinklaHideGps",False) + + def update_events(self, CS): + """Compute carEvents from carState""" + + self.events.clear() + + # Add startup event + if self.startup_event is not None: + self.events.add(self.startup_event) + self.startup_event = None + + # Don't add any more events if not initialized + if not self.initialized: + self.events.add(EventName.controlsInitializing) + return + + self.events.add_from_msg(CS.events) + self.events.add_from_msg(self.sm['driverMonitoringState'].events) + + # Create events for battery, temperature, disk space, and memory + if EON and (self.sm['peripheralState'].pandaType != PandaType.uno) and \ + self.sm['deviceState'].batteryPercent < 1 and self.sm['deviceState'].chargingError: + # at zero percent battery, while discharging, OP should not allowed + self.events.add(EventName.lowBattery) + if self.sm['deviceState'].thermalStatus >= ThermalStatus.red: + self.events.add(EventName.overheat) + if self.sm['deviceState'].freeSpacePercent < 7 and not SIMULATION: + # under 7% of space free no enable allowed + self.events.add(EventName.outOfSpace) + # TODO: make tici threshold the same + if self.sm['deviceState'].memoryUsagePercent > (90 if TICI else 65) and not SIMULATION: + self.events.add(EventName.lowMemory) + + # TODO: enable this once loggerd CPU usage is more reasonable + #cpus = list(self.sm['deviceState'].cpuUsagePercent)[:(-1 if EON else None)] + #if max(cpus, default=0) > 95 and not SIMULATION: + # self.events.add(EventName.highCpuUsage) + + # Alert if fan isn't spinning for 5 seconds + if self.sm['peripheralState'].pandaType in (PandaType.uno, PandaType.dos): + if self.sm['peripheralState'].fanSpeedRpm == 0 and self.sm['deviceState'].fanSpeedPercentDesired > 50: + if (self.sm.frame - self.last_functional_fan_frame) * DT_CTRL > 5.0: + self.events.add(EventName.fanMalfunction) + else: + self.last_functional_fan_frame = self.sm.frame + + # Handle calibration status + cal_status = self.sm['liveCalibration'].calStatus + if cal_status != Calibration.CALIBRATED: + if cal_status == Calibration.UNCALIBRATED: + self.events.add(EventName.calibrationIncomplete) + else: + self.events.add(EventName.calibrationInvalid) + + # Handle lane change + if self.sm['lateralPlan'].laneChangeState == LaneChangeState.preLaneChange: + direction = self.sm['lateralPlan'].laneChangeDirection + if (CS.leftBlindspot and direction == LaneChangeDirection.left) or \ + (CS.rightBlindspot and direction == LaneChangeDirection.right): + self.events.add(EventName.laneChangeBlocked) + else: + if direction == LaneChangeDirection.left: + self.events.add(EventName.preLaneChangeLeft) + else: + self.events.add(EventName.preLaneChangeRight) + elif self.sm['lateralPlan'].laneChangeState in (LaneChangeState.laneChangeStarting, + LaneChangeState.laneChangeFinishing): + self.events.add(EventName.laneChange) + + if not CS.canValid: + self.events.add(EventName.canError) + + for i, pandaState in enumerate(self.sm['pandaStates']): + # All pandas must match the list of safetyConfigs, and if outside this list, must be silent or noOutput + if i < len(self.CP.safetyConfigs): + safety_mismatch = pandaState.safetyModel != self.CP.safetyConfigs[i].safetyModel or \ + pandaState.safetyParam != self.CP.safetyConfigs[i].safetyParam or \ + pandaState.unsafeMode != self.CP.unsafeMode + else: + safety_mismatch = pandaState.safetyModel not in IGNORED_SAFETY_MODES + + if safety_mismatch or self.mismatch_counter >= 200: + self.events.add(EventName.controlsMismatch) + + if log.PandaState.FaultType.relayMalfunction in pandaState.faults: + self.events.add(EventName.relayMalfunction) + + # Check for HW or system issues + if len(self.sm['radarState'].radarErrors): + self.events.add(EventName.radarFault) + elif not self.sm.valid["pandaStates"]: + self.events.add(EventName.usbError) + elif not self.sm.all_alive_and_valid() or self.can_rcv_error: + self.events.add(EventName.commIssue) + if not self.logged_comm_issue: + invalid = [s for s, valid in self.sm.valid.items() if not valid] + not_alive = [s for s, alive in self.sm.alive.items() if not alive] + cloudlog.event("commIssue", invalid=invalid, not_alive=not_alive, can_error=self.can_rcv_error, error=True) + self.logged_comm_issue = True + else: + self.logged_comm_issue = False + + if not self.sm['liveParameters'].valid: + self.events.add(EventName.vehicleModelInvalid) + if not self.sm['lateralPlan'].mpcSolutionValid: + self.events.add(EventName.plannerError) + if not self.sm['liveLocationKalman'].sensorsOK and not NOSENSOR: + if self.sm.frame > 5 / DT_CTRL: # Give locationd some time to receive all the inputs + self.events.add(EventName.sensorDataInvalid) + if not self.sm['liveLocationKalman'].posenetOK: + self.events.add(EventName.posenetInvalid) + if not self.sm['liveLocationKalman'].deviceStable: + self.events.add(EventName.deviceFalling) + + if not REPLAY: + # Check for mismatch between openpilot and car's PCM + cruise_mismatch = CS.cruiseState.enabled and (not self.enabled or not self.CP.pcmCruise) + self.cruise_mismatch_counter = self.cruise_mismatch_counter + 1 if cruise_mismatch else 0 + if self.cruise_mismatch_counter > int(3. / DT_CTRL): + self.events.add(EventName.cruiseMismatch) + + # Check for FCW + stock_long_is_braking = self.enabled and not self.CP.openpilotLongitudinalControl and CS.aEgo < -1.5 + model_fcw = self.sm['modelV2'].meta.hardBrakePredicted and not CS.brakePressed and not stock_long_is_braking + planner_fcw = self.sm['longitudinalPlan'].fcw and self.enabled + if planner_fcw or model_fcw: + self.events.add(EventName.fcw) + + if TICI: + for m in messaging.drain_sock(self.log_sock, wait_for_one=False): + try: + msg = m.androidLog.message + if any(err in msg for err in ("ERROR_CRC", "ERROR_ECC", "ERROR_STREAM_UNDERFLOW", "APPLY FAILED")): + csid = msg.split("CSID:")[-1].split(" ")[0] + evt = CSID_MAP.get(csid, None) + if evt is not None: + self.events.add(evt) + except UnicodeDecodeError: + pass + + # TODO: fix simulator + if not SIMULATION: + if not NOSENSOR: + if not self.sm['liveLocationKalman'].gpsOK and (self.distance_traveled > 1000): + # Not show in first 1 km to allow for driving out of garage. This event shows after 5 minutes + if not self.hideGpsMsg: + self.events.add(EventName.noGps) + if not self.sm.all_alive(self.camera_packets): + self.events.add(EventName.cameraMalfunction) + if self.sm['modelV2'].frameDropPerc > 20: + self.events.add(EventName.modeldLagging) + if self.sm['liveLocationKalman'].excessiveResets: + self.events.add(EventName.localizerMalfunction) + + # Check if all manager processes are running + not_running = {p.name for p in self.sm['managerState'].processes if not p.running} + if self.sm.rcv_frame['managerState'] and (not_running - IGNORE_PROCESSES): + self.events.add(EventName.processNotRunning) + + # Only allow engagement with brake pressed when stopped behind another stopped car + speeds = self.sm['longitudinalPlan'].speeds + if len(speeds) > 1: + v_future = speeds[-1] + else: + v_future = 100.0 + if CS.brakePressed and v_future >= self.CP.vEgoStarting \ + and self.CP.openpilotLongitudinalControl and CS.vEgo < 0.3: + self.events.add(EventName.noTarget) + + def data_sample(self): + """Receive data from sockets and update carState""" + + # Update carState from CAN + can_strs = messaging.drain_sock_raw(self.can_sock, wait_for_one=True) + CS = self.CI.update(self.CC, can_strs) + + self.sm.update(0) + + if not self.initialized: + all_valid = CS.canValid and self.sm.all_alive_and_valid() + if all_valid or self.sm.frame * DT_CTRL > 3.5 or SIMULATION: + if not self.read_only: + self.CI.init(self.CP, self.can_sock, self.pm.sock['sendcan']) + self.initialized = True + + if REPLAY and self.sm['pandaStates'][0].controlsAllowed: + self.state = State.enabled + + Params().put_bool("ControlsReady", True) + + # Check for CAN timeout + if not can_strs: + self.can_rcv_error_counter += 1 + self.can_rcv_error = True + else: + self.can_rcv_error = False + + # When the panda and controlsd do not agree on controls_allowed + # we want to disengage openpilot. However the status from the panda goes through + # another socket other than the CAN messages and one can arrive earlier than the other. + # Therefore we allow a mismatch for two samples, then we trigger the disengagement. + if not self.enabled: + self.mismatch_counter = 0 + + # All pandas not in silent mode must have controlsAllowed when openpilot is enabled + if self.enabled and any(not ps.controlsAllowed for ps in self.sm['pandaStates'] + if ps.safetyModel not in IGNORED_SAFETY_MODES): + self.mismatch_counter += 1 + + self.distance_traveled += CS.vEgo * DT_CTRL + + return CS + + def state_transition(self, CS): + """Compute conditional state transitions and execute actions on state transitions""" + + self.v_cruise_kph_last = self.v_cruise_kph + + # if stock cruise is completely disabled, then we can use our own set speed logic + if not self.CP.pcmCruise: + self.v_cruise_kph = update_v_cruise(self.v_cruise_kph, CS.buttonEvents, self.button_timers, self.enabled, self.is_metric) + elif CS.cruiseState.enabled: + self.v_cruise_kph = CS.cruiseState.speed * CV.MS_TO_KPH + + # decrement the soft disable timer at every step, as it's reset on + # entrance in SOFT_DISABLING state + self.soft_disable_timer = max(0, self.soft_disable_timer - 1) + + self.current_alert_types = [ET.PERMANENT] + + # ENABLED, PRE ENABLING, SOFT DISABLING + if self.state != State.disabled: + # user and immediate disable always have priority in a non-disabled state + if self.events.any(ET.USER_DISABLE): + self.state = State.disabled + self.current_alert_types.append(ET.USER_DISABLE) + + elif self.events.any(ET.IMMEDIATE_DISABLE): + self.state = State.disabled + self.current_alert_types.append(ET.IMMEDIATE_DISABLE) + + else: + # ENABLED + if self.state == State.enabled: + if self.events.any(ET.SOFT_DISABLE): + self.state = State.softDisabling + self.soft_disable_timer = int(SOFT_DISABLE_TIME / DT_CTRL) + self.current_alert_types.append(ET.SOFT_DISABLE) + + # SOFT DISABLING + elif self.state == State.softDisabling: + if not self.events.any(ET.SOFT_DISABLE): + # no more soft disabling condition, so go back to ENABLED + self.state = State.enabled + + elif self.soft_disable_timer > 0: + self.current_alert_types.append(ET.SOFT_DISABLE) + + elif self.soft_disable_timer <= 0: + self.state = State.disabled + + # PRE ENABLING + elif self.state == State.preEnabled: + if not self.events.any(ET.PRE_ENABLE): + self.state = State.enabled + else: + self.current_alert_types.append(ET.PRE_ENABLE) + + # DISABLED + elif self.state == State.disabled: + if self.events.any(ET.ENABLE): + if self.events.any(ET.NO_ENTRY): + self.current_alert_types.append(ET.NO_ENTRY) + + else: + if self.events.any(ET.PRE_ENABLE): + self.state = State.preEnabled + else: + self.state = State.enabled + self.current_alert_types.append(ET.ENABLE) + self.v_cruise_kph = initialize_v_cruise(CS.vEgo, CS.buttonEvents, self.v_cruise_kph_last) + + # Check if actuators are enabled + self.active = self.state == State.enabled or self.state == State.softDisabling + if self.active: + self.current_alert_types.append(ET.WARNING) + + # Check if openpilot is engaged + self.enabled = self.active or self.state == State.preEnabled + + def state_control(self, CS): + """Given the state, this function returns an actuators packet""" + + # Update VehicleModel + params = self.sm['liveParameters'] + x = max(params.stiffnessFactor, 0.1) + sr = max(params.steerRatio, 0.1) + self.VM.update_params(x, sr) + + lat_plan = self.sm['lateralPlan'] + long_plan = self.sm['longitudinalPlan'] + + actuators = car.CarControl.Actuators.new_message() + actuators.longControlState = self.LoC.long_control_state + + if CS.leftBlinker or CS.rightBlinker: + self.last_blinker_frame = self.sm.frame + + # State specific actions + + if not self.active: + self.LaC.reset() + self.LoC.reset(v_pid=CS.vEgo) + + if not self.joystick_mode: + # accel PID loop + pid_accel_limits = self.CI.get_pid_accel_limits(self.CP, CS.vEgo, self.v_cruise_kph * CV.KPH_TO_MS) + actuators.accel = self.LoC.update(self.active, CS, self.CP, long_plan, pid_accel_limits) + + # Steering PID loop and lateral MPC + lat_active = self.active and not CS.steerWarning and not CS.steerError and CS.vEgo > self.CP.minSteerSpeed + desired_curvature, desired_curvature_rate = get_lag_adjusted_curvature(self.CP, CS.vEgo, + lat_plan.psis, + lat_plan.curvatures, + lat_plan.curvatureRates) + actuators.steer, actuators.steeringAngleDeg, lac_log = self.LaC.update(lat_active, CS, self.CP, self.VM, params, self.last_actuators, + desired_curvature, desired_curvature_rate) + else: + lac_log = log.ControlsState.LateralDebugState.new_message() + if self.sm.rcv_frame['testJoystick'] > 0 and self.active: + actuators.accel = 4.0*clip(self.sm['testJoystick'].axes[0], -1, 1) + + steer = clip(self.sm['testJoystick'].axes[1], -1, 1) + # max angle is 45 for angle-based cars + actuators.steer, actuators.steeringAngleDeg = steer, steer * 45. + + lac_log.active = True + lac_log.steeringAngleDeg = CS.steeringAngleDeg + lac_log.output = steer + lac_log.saturated = abs(steer) >= 0.9 + + # Send a "steering required alert" if saturation count has reached the limit + if lac_log.active and lac_log.saturated and not CS.steeringPressed: + dpath_points = lat_plan.dPathPoints + if len(dpath_points): + # Check if we deviated from the path + # TODO use desired vs actual curvature + left_deviation = actuators.steer > 0 and dpath_points[0] < -0.20 + right_deviation = actuators.steer < 0 and dpath_points[0] > 0.20 + + if left_deviation or right_deviation: + self.events.add(EventName.steerSaturated) + + # Ensure no NaNs/Infs + for p in ACTUATOR_FIELDS: + attr = getattr(actuators, p) + if not isinstance(attr, Number): + continue + + if not math.isfinite(attr): + cloudlog.error(f"actuators.{p} not finite {actuators.to_dict()}") + setattr(actuators, p, 0.0) + + return actuators, lac_log + + def update_button_timers(self, buttonEvents): + # increment timer for buttons still pressed + for k in self.button_timers: + if self.button_timers[k] > 0: + self.button_timers[k] += 1 + + for b in buttonEvents: + if b.type.raw in self.button_timers: + self.button_timers[b.type.raw] = 1 if b.pressed else 0 + + def publish_logs(self, CS, start_time, actuators, lac_log): + """Send actuators and hud commands to the car, send controlsstate and MPC logging""" + + CC = car.CarControl.new_message() + CC.enabled = self.enabled + CC.active = self.active + CC.actuators = actuators + + orientation_value = self.sm['liveLocationKalman'].orientationNED.value + if len(orientation_value) > 2: + CC.roll = orientation_value[0] + CC.pitch = orientation_value[1] + + CC.cruiseControl.cancel = CS.cruiseState.enabled and (not self.enabled or not self.CP.pcmCruise) + if self.joystick_mode and self.sm.rcv_frame['testJoystick'] > 0 and self.sm['testJoystick'].buttons[0]: + CC.cruiseControl.cancel = True + + hudControl = CC.hudControl + hudControl.setSpeed = float(self.v_cruise_kph * CV.KPH_TO_MS) + hudControl.speedVisible = self.enabled + hudControl.lanesVisible = self.enabled + hudControl.leadVisible = self.sm['longitudinalPlan'].hasLead + + hudControl.rightLaneVisible = True + hudControl.leftLaneVisible = True + + recent_blinker = (self.sm.frame - self.last_blinker_frame) * DT_CTRL < 5.0 # 5s blinker cooldown + ldw_allowed = self.is_ldw_enabled and CS.vEgo > LDW_MIN_SPEED and not recent_blinker \ + and not self.active and self.sm['liveCalibration'].calStatus == Calibration.CALIBRATED + + model_v2 = self.sm['modelV2'] + desire_prediction = model_v2.meta.desirePrediction + if len(desire_prediction) and ldw_allowed: + right_lane_visible = self.sm['lateralPlan'].rProb > 0.5 + left_lane_visible = self.sm['lateralPlan'].lProb > 0.5 + l_lane_change_prob = desire_prediction[Desire.laneChangeLeft - 1] + r_lane_change_prob = desire_prediction[Desire.laneChangeRight - 1] + + lane_lines = model_v2.laneLines + l_lane_close = left_lane_visible and (lane_lines[1].y[0] > -(1.08 + CAMERA_OFFSET)) + r_lane_close = right_lane_visible and (lane_lines[2].y[0] < (1.08 - CAMERA_OFFSET)) + + hudControl.leftLaneDepart = bool(l_lane_change_prob > LANE_DEPARTURE_THRESHOLD and l_lane_close) + hudControl.rightLaneDepart = bool(r_lane_change_prob > LANE_DEPARTURE_THRESHOLD and r_lane_close) + + if hudControl.rightLaneDepart or hudControl.leftLaneDepart: + self.events.add(EventName.ldw) + + clear_event_types = set() + if ET.WARNING not in self.current_alert_types: + clear_event_types.add(ET.WARNING) + if self.enabled: + clear_event_types.add(ET.NO_ENTRY) + + alerts = self.events.create_alerts(self.current_alert_types, [self.CP, self.sm, self.is_metric, self.soft_disable_timer]) + self.AM.add_many(self.sm.frame, alerts) + current_alert = self.AM.process_alerts(self.sm.frame, clear_event_types) + if current_alert: + hudControl.visualAlert = current_alert.visual_alert + + if not self.read_only and self.initialized: + # send car controls over can + self.last_actuators, can_sends = self.CI.apply(CC) + self.pm.send('sendcan', can_list_to_can_capnp(can_sends, msgtype='sendcan', valid=CS.canValid)) + CC.actuatorsOutput = self.last_actuators + + force_decel = (self.sm['driverMonitoringState'].awarenessStatus < 0.) or \ + (self.state == State.softDisabling) + + # Curvature & Steering angle + params = self.sm['liveParameters'] + + steer_angle_without_offset = math.radians(CS.steeringAngleDeg - params.angleOffsetDeg) + curvature = -self.VM.calc_curvature(steer_angle_without_offset, CS.vEgo, params.roll) + + # controlsState + dat = messaging.new_message('controlsState') + dat.valid = CS.canValid + controlsState = dat.controlsState + if current_alert: + controlsState.alertText1 = current_alert.alert_text_1 + controlsState.alertText2 = current_alert.alert_text_2 + controlsState.alertSize = current_alert.alert_size + controlsState.alertStatus = current_alert.alert_status + controlsState.alertBlinkingRate = current_alert.alert_rate + controlsState.alertType = current_alert.alert_type + controlsState.alertSound = current_alert.audible_alert + + controlsState.canMonoTimes = list(CS.canMonoTimes) + controlsState.longitudinalPlanMonoTime = self.sm.logMonoTime['longitudinalPlan'] + controlsState.lateralPlanMonoTime = self.sm.logMonoTime['lateralPlan'] + controlsState.enabled = self.enabled + controlsState.active = self.active + controlsState.curvature = curvature + controlsState.state = self.state + controlsState.engageable = not self.events.any(ET.NO_ENTRY) + controlsState.longControlState = self.LoC.long_control_state + controlsState.vPid = float(self.LoC.v_pid) + controlsState.vCruise = float(self.v_cruise_kph) + controlsState.upAccelCmd = float(self.LoC.pid.p) + controlsState.uiAccelCmd = float(self.LoC.pid.i) + controlsState.ufAccelCmd = float(self.LoC.pid.f) + controlsState.cumLagMs = -self.rk.remaining * 1000. + controlsState.startMonoTime = int(start_time * 1e9) + controlsState.forceDecel = bool(force_decel) + controlsState.canErrorCounter = self.can_rcv_error_counter + + lat_tuning = self.CP.lateralTuning.which() + if self.joystick_mode: + controlsState.lateralControlState.debugState = lac_log + elif self.CP.steerControlType == car.CarParams.SteerControlType.angle: + controlsState.lateralControlState.angleState = lac_log + elif lat_tuning == 'pid': + controlsState.lateralControlState.pidState = lac_log + elif lat_tuning == 'lqr': + controlsState.lateralControlState.lqrState = lac_log + elif lat_tuning == 'indi': + controlsState.lateralControlState.indiState = lac_log + + self.pm.send('controlsState', dat) + + # carState + car_events = self.events.to_msg() + cs_send = messaging.new_message('carState') + cs_send.valid = CS.canValid + cs_send.carState = CS + cs_send.carState.events = car_events + self.pm.send('carState', cs_send) + + # carEvents - logged every second or on change + if (self.sm.frame % int(1. / DT_CTRL) == 0) or (self.events.names != self.events_prev): + ce_send = messaging.new_message('carEvents', len(self.events)) + ce_send.carEvents = car_events + self.pm.send('carEvents', ce_send) + self.events_prev = self.events.names.copy() + + # carParams - logged every 50 seconds (> 1 per segment) + if (self.sm.frame % int(50. / DT_CTRL) == 0): + cp_send = messaging.new_message('carParams') + cp_send.carParams = self.CP + self.pm.send('carParams', cp_send) + + # carControl + cc_send = messaging.new_message('carControl') + cc_send.valid = CS.canValid + cc_send.carControl = CC + self.pm.send('carControl', cc_send) + + # copy CarControl to pass to CarInterface on the next iteration + self.CC = CC + + def step(self): + start_time = sec_since_boot() + self.prof.checkpoint("Ratekeeper", ignore=True) + + # Sample data from sockets and get a carState + CS = self.data_sample() + self.prof.checkpoint("Sample") + + self.update_events(CS) + + if not self.read_only and self.initialized: + # Update control state + self.state_transition(CS) + self.prof.checkpoint("State transition") + + # Compute actuators (runs PID loops and lateral MPC) + actuators, lac_log = self.state_control(CS) + + self.prof.checkpoint("State Control") + + # Publish data + self.publish_logs(CS, start_time, actuators, lac_log) + self.prof.checkpoint("Sent") + + self.update_button_timers(CS.buttonEvents) + + def controlsd_thread(self): + while True: + self.step() + self.rk.monitor_time() + self.prof.display() + +def main(sm=None, pm=None, logcan=None): + controls = Controls(sm, pm, logcan) + controls.controlsd_thread() + + +if __name__ == "__main__": + main() diff --git a/selfdrive/controls/lib/__init__.py b/selfdrive/controls/lib/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/controls/lib/alertmanager.py b/selfdrive/controls/lib/alertmanager.py new file mode 100644 index 000000000..2dad05e21 --- /dev/null +++ b/selfdrive/controls/lib/alertmanager.py @@ -0,0 +1,64 @@ +import copy +import os +import json +from collections import defaultdict +from dataclasses import dataclass +from typing import List, Dict, Optional + +from common.basedir import BASEDIR +from common.params import Params +from selfdrive.controls.lib.events import Alert + + +with open(os.path.join(BASEDIR, "selfdrive/controls/lib/alerts_offroad.json")) as f: + OFFROAD_ALERTS = json.load(f) + + +def set_offroad_alert(alert: str, show_alert: bool, extra_text: Optional[str] = None) -> None: + if show_alert: + a = OFFROAD_ALERTS[alert] + if extra_text is not None: + a = copy.copy(OFFROAD_ALERTS[alert]) + a['text'] += extra_text + Params().put(alert, json.dumps(a)) + else: + Params().delete(alert) + + +@dataclass +class AlertEntry: + alert: Optional[Alert] = None + start_frame: int = -1 + end_frame: int = -1 + + def active(self, frame: int) -> bool: + return frame <= self.end_frame + +class AlertManager: + def __init__(self): + self.alerts: Dict[str, AlertEntry] = defaultdict(AlertEntry) + + def add_many(self, frame: int, alerts: List[Alert]) -> None: + for alert in alerts: + entry = self.alerts[alert.alert_type] + entry.alert = alert + if not entry.active(frame): + entry.start_frame = frame + min_end_frame = entry.start_frame + alert.duration + entry.end_frame = max(frame + 1, min_end_frame) + + def process_alerts(self, frame: int, clear_event_types: set) -> Optional[Alert]: + current_alert = AlertEntry() + for v in self.alerts.values(): + if not v.alert: + continue + + if v.alert.event_type in clear_event_types: + v.end_frame = -1 + + # sort by priority first and then by start_frame + greater = current_alert.alert is None or (v.alert.priority, v.start_frame) > (current_alert.alert.priority, current_alert.start_frame) + if v.active(frame) and greater: + current_alert = v + + return current_alert.alert diff --git a/selfdrive/controls/lib/alerts_offroad.json b/selfdrive/controls/lib/alerts_offroad.json new file mode 100644 index 000000000..aa54f582f --- /dev/null +++ b/selfdrive/controls/lib/alerts_offroad.json @@ -0,0 +1,52 @@ +{ + "Offroad_ChargeDisabled": { + "text": "EON charging disabled after car being off for more than 30 hours. Turn ignition on to start charging again.", + "severity": 0 + }, + "Offroad_TemperatureTooHigh": { + "text": "Device temperature too high. System won't start.", + "severity": 1 + }, + "Offroad_ConnectivityNeededPrompt": { + "text": "Immediately connect to the internet to check for updates. If you do not connect to the internet, openpilot won't engage in ", + "severity": 0, + "_comment": "Append the number of days at the end of the text" + }, + "Offroad_ConnectivityNeeded": { + "text": "Connect to internet to check for updates. openpilot won't automatically start until it connects to internet to check for updates.", + "severity": 1 + }, + "Offroad_UpdateFailed": { + "text": "Unable to download updates\n", + "severity": 1, + "_comment": "Append the command and error to the text." + }, + "Offroad_InvalidTime": { + "text": "Invalid date and time settings, system won't start. Connect to internet to set time.", + "severity": 1 + }, + "Offroad_IsTakingSnapshot": { + "text": "Taking camera snapshots. System won't start until finished.", + "severity": 0 + }, + "Offroad_NeosUpdate": { + "text": "An update to your device's operating system is downloading in the background. You will be prompted to update when it's ready to install.", + "severity": 0 + }, + "Offroad_UnofficialHardware": { + "text": "Device failed to register. It will not connect to or upload to comma.ai servers, and receives no support from comma.ai. If this is an official device, contact support@comma.ai.", + "severity": 1 + }, + "Offroad_StorageMissing": { + "text": "NVMe drive not mounted.", + "severity": 1 + }, + "Offroad_CarUnrecognized": { + "text": "openpilot was unable to identify your car. Your car is either unsupported or its ECUs are not recognized. Please submit a pull request to add the firmware versions to the proper vehicle. Need help? Join discord.comma.ai.", + "severity": 0 + }, + "Offroad_NoFirmware": { + "text": "openpilot was unable to identify your car. Check integrity of cables and ensure all connections are secure, particularly that the comma power is fully inserted in the OBD-II port of the vehicle. Need help? Join discord.comma.ai.", + "severity": 0 + } +} diff --git a/selfdrive/controls/lib/cluster/LICENSE b/selfdrive/controls/lib/cluster/LICENSE new file mode 100644 index 000000000..ab8b4db7d --- /dev/null +++ b/selfdrive/controls/lib/cluster/LICENSE @@ -0,0 +1,13 @@ +Copyright: + * fastcluster_dm.cpp & fastcluster_R_dm.cpp: + © 2011 Daniel Müllner + * fastcluster.(h|cpp) & demo.cpp & plotresult.r: + © 2018 Christoph Dalitz +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/selfdrive/controls/lib/cluster/README b/selfdrive/controls/lib/cluster/README new file mode 100644 index 000000000..acb18bc72 --- /dev/null +++ b/selfdrive/controls/lib/cluster/README @@ -0,0 +1,79 @@ +C++ interface to fast hierarchical clustering algorithms +======================================================== + +This is a simplified C++ interface to fast implementations of hierarchical +clustering by Daniel Müllner. The original library with interfaces to R +and Python is described in: + +Daniel Müllner: "fastcluster: Fast Hierarchical, Agglomerative Clustering +Routines for R and Python." Journal of Statistical Software 53 (2013), +no. 9, pp. 1–18, http://www.jstatsoft.org/v53/i09/ + + +Usage of the library +-------------------- + +For using the library, the following source files are needed: + +fastcluster_dm.cpp, fastcluster_R_dm.cpp + original code by Daniel Müllner + these are included by fastcluster.cpp via #include, and therefore + need not be compiled to object code + +fastcluster.[h|cpp] + simplified C++ interface + fastcluster.cpp is the only file that must be compiled + +The library provides the clustering function *hclust_fast* for +creating the dendrogram information in an encoding as used by the +R function *hclust*. For a description of the parameters, see fastcluster.h. +Its parameter *method* can be one of + +HCLUST_METHOD_SINGLE + single link with the minimum spanning tree algorithm (Rohlf, 1973) + +HHCLUST_METHOD_COMPLETE + complete link with the nearest-neighbor-chain algorithm (Murtagh, 1984) + +HCLUST_METHOD_AVERAGE + complete link with the nearest-neighbor-chain algorithm (Murtagh, 1984) + +HCLUST_METHOD_MEDIAN + median link with the generic algorithm (Müllner, 2011) + +For splitting the dendrogram into clusters, the two functions *cutree_k* +and *cutree_cdist* are provided. + +Note that output parameters must be allocated beforehand, e.g. + int* merge = new int[2*(npoints-1)]; +For a complete usage example, see lines 135-142 of demo.cpp. + + +Demonstration program +--------------------- + +A simple demo is implemented in demo.cpp, which can be compiled and run with + + make + ./hclust-demo -m complete lines.csv + +It creates two clusters of line segments such that the segment angle between +line segments of different clusters have a maximum (cosine) dissimilarity. +For visualizing the result, plotresult.r can be used as follows +(requires R to be installed): + + ./hclust-demo -m complete lines.csv | Rscript plotresult.r + + +Authors & Copyright +------------------- + +Daniel Müllner, 2011, +Christoph Dalitz, 2018, + + +License +------- + +This code is provided under a BSD-style license. +See the file LICENSE for details. diff --git a/selfdrive/controls/lib/cluster/SConscript b/selfdrive/controls/lib/cluster/SConscript new file mode 100644 index 000000000..97eb4300d --- /dev/null +++ b/selfdrive/controls/lib/cluster/SConscript @@ -0,0 +1,8 @@ +Import('env') + +fc = env.SharedLibrary("fastcluster", "fastcluster.cpp") + +# TODO: how do I gate on test +#env.Program("test", ["test.cpp"], LIBS=[fc]) +#valgrind --leak-check=full ./test + diff --git a/selfdrive/controls/lib/cluster/__init__.py b/selfdrive/controls/lib/cluster/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/controls/lib/cluster/fastcluster.cpp b/selfdrive/controls/lib/cluster/fastcluster.cpp new file mode 100644 index 000000000..d2b557d6f --- /dev/null +++ b/selfdrive/controls/lib/cluster/fastcluster.cpp @@ -0,0 +1,218 @@ +// +// C++ standalone verion of fastcluster by Daniel Müllner +// +// Copyright: Christoph Dalitz, 2018 +// Daniel Müllner, 2011 +// License: BSD style license +// (see the file LICENSE for details) +// + + +#include +#include +#include + + +extern "C" { +#include "fastcluster.h" +} + +// Code by Daniel Müllner +// workaround to make it usable as a standalone version (without R) +bool fc_isnan(double x) { return false; } +#include "fastcluster_dm.cpp" +#include "fastcluster_R_dm.cpp" + +extern "C" { +// +// Assigns cluster labels (0, ..., nclust-1) to the n points such +// that the cluster result is split into nclust clusters. +// +// Input arguments: +// n = number of observables +// merge = clustering result in R format +// nclust = number of clusters +// Output arguments: +// labels = allocated integer array of size n for result +// + void cutree_k(int n, const int* merge, int nclust, int* labels) { + + int k,m1,m2,j,l; + + if (nclust > n || nclust < 2) { + for (j=0; j last_merge(n, 0); + for (k=1; k<=(n-nclust); k++) { + // (m1,m2) = merge[k,] + m1 = merge[k-1]; + m2 = merge[n-1+k-1]; + if (m1 < 0 && m2 < 0) { // both single observables + last_merge[-m1-1] = last_merge[-m2-1] = k; + } + else if (m1 < 0 || m2 < 0) { // one is a cluster + if(m1 < 0) { j = -m1; m1 = m2; } else j = -m2; + // merging single observable and cluster + for(l = 0; l < n; l++) + if (last_merge[l] == m1) + last_merge[l] = k; + last_merge[j-1] = k; + } + else { // both cluster + for(l=0; l < n; l++) { + if( last_merge[l] == m1 || last_merge[l] == m2 ) + last_merge[l] = k; + } + } + } + + // assign cluster labels + int label = 0; + std::vector z(n,-1); + for (j=0; j= cdist + // + // Input arguments: + // n = number of observables + // merge = clustering result in R format + // height = cluster distance at each merge step + // cdist = cutoff cluster distance + // Output arguments: + // labels = allocated integer array of size n for result + // + void cutree_cdist(int n, const int* merge, double* height, double cdist, int* labels) { + + int k; + + for (k=0; k<(n-1); k++) { + if (height[k] >= cdist) { + break; + } + } + cutree_k(n, merge, n-k, labels); + } + + + // + // Hierarchical clustering with one of Daniel Muellner's fast algorithms + // + // Input arguments: + // n = number of observables + // distmat = condensed distance matrix, i.e. an n*(n-1)/2 array representing + // the upper triangle (without diagonal elements) of the distance + // matrix, e.g. for n=4: + // d00 d01 d02 d03 + // d10 d11 d12 d13 -> d01 d02 d03 d12 d13 d23 + // d20 d21 d22 d23 + // d30 d31 d32 d33 + // method = cluster metric (see enum method_code) + // Output arguments: + // merge = allocated (n-1)x2 matrix (2*(n-1) array) for storing result. + // Result follows R hclust convention: + // - observabe indices start with one + // - merge[i][] contains the merged nodes in step i + // - merge[i][j] is negative when the node is an atom + // height = allocated (n-1) array with distances at each merge step + // Return code: + // 0 = ok + // 1 = invalid method + // + int hclust_fast(int n, double* distmat, int method, int* merge, double* height) { + + // call appropriate culstering function + cluster_result Z2(n-1); + if (method == HCLUST_METHOD_SINGLE) { + // single link + MST_linkage_core(n, distmat, Z2); + } + else if (method == HCLUST_METHOD_COMPLETE) { + // complete link + NN_chain_core(n, distmat, NULL, Z2); + } + else if (method == HCLUST_METHOD_AVERAGE) { + // best average distance + double* members = new double[n]; + for (int i=0; i(n, distmat, members, Z2); + delete[] members; + } + else if (method == HCLUST_METHOD_MEDIAN) { + // best median distance (beware: O(n^3)) + generic_linkage(n, distmat, NULL, Z2); + } + else if (method == HCLUST_METHOD_CENTROID) { + // best centroid distance (beware: O(n^3)) + double* members = new double[n]; + for (int i=0; i(n, distmat, members, Z2); + delete[] members; + } + else { + return 1; + } + + int* order = new int[n]; + if (method == HCLUST_METHOD_MEDIAN || method == HCLUST_METHOD_CENTROID) { + generate_R_dendrogram(merge, height, order, Z2, n); + } else { + generate_R_dendrogram(merge, height, order, Z2, n); + } + delete[] order; // only needed for visualization + + return 0; + } + + + // Build condensed distance matrix + // Input arguments: + // n = number of observables + // m = dimension of observable + // Output arguments: + // out = allocated integer array of size n * (n - 1) / 2 for result + void hclust_pdist(int n, int m, double* pts, double* out) { + int ii = 0; + for (int i = 0; i < n; i++) { + for (int j = i + 1; j < n; j++) { + // Compute euclidian distance + double d = 0; + for (int k = 0; k < m; k ++) { + double error = pts[i * m + k] - pts[j * m + k]; + d += (error * error); + } + out[ii] = d;//sqrt(d); + ii++; + } + } + } + + void cluster_points_centroid(int n, int m, double* pts, double dist, int* idx) { + double* pdist = new double[n * (n - 1) / 2]; + int* merge = new int[2 * (n - 1)]; + double* height = new double[n - 1]; + + hclust_pdist(n, m, pts, pdist); + hclust_fast(n, pdist, HCLUST_METHOD_CENTROID, merge, height); + cutree_cdist(n, merge, height, dist, idx); + + delete[] pdist; + delete[] merge; + delete[] height; + } +} diff --git a/selfdrive/controls/lib/cluster/fastcluster.h b/selfdrive/controls/lib/cluster/fastcluster.h new file mode 100644 index 000000000..56c63b6a5 --- /dev/null +++ b/selfdrive/controls/lib/cluster/fastcluster.h @@ -0,0 +1,77 @@ +// +// C++ standalone verion of fastcluster by Daniel Muellner +// +// Copyright: Daniel Muellner, 2011 +// Christoph Dalitz, 2018 +// License: BSD style license +// (see the file LICENSE for details) +// + +#ifndef fastclustercpp_H +#define fastclustercpp_H + +// +// Assigns cluster labels (0, ..., nclust-1) to the n points such +// that the cluster result is split into nclust clusters. +// +// Input arguments: +// n = number of observables +// merge = clustering result in R format +// nclust = number of clusters +// Output arguments: +// labels = allocated integer array of size n for result +// +void cutree_k(int n, const int* merge, int nclust, int* labels); + +// +// Assigns cluster labels (0, ..., nclust-1) to the n points such +// that the hierarchical clsutering is stopped at cluster distance cdist +// +// Input arguments: +// n = number of observables +// merge = clustering result in R format +// height = cluster distance at each merge step +// cdist = cutoff cluster distance +// Output arguments: +// labels = allocated integer array of size n for result +// +void cutree_cdist(int n, const int* merge, double* height, double cdist, int* labels); + +// +// Hierarchical clustering with one of Daniel Muellner's fast algorithms +// +// Input arguments: +// n = number of observables +// distmat = condensed distance matrix, i.e. an n*(n-1)/2 array representing +// the upper triangle (without diagonal elements) of the distance +// matrix, e.g. for n=4: +// d00 d01 d02 d03 +// d10 d11 d12 d13 -> d01 d02 d03 d12 d13 d23 +// d20 d21 d22 d23 +// d30 d31 d32 d33 +// method = cluster metric (see enum method_code) +// Output arguments: +// merge = allocated (n-1)x2 matrix (2*(n-1) array) for storing result. +// Result follows R hclust convention: +// - observabe indices start with one +// - merge[i][] contains the merged nodes in step i +// - merge[i][j] is negative when the node is an atom +// height = allocated (n-1) array with distances at each merge step +// Return code: +// 0 = ok +// 1 = invalid method +// +int hclust_fast(int n, double* distmat, int method, int* merge, double* height); +enum hclust_fast_methods { + HCLUST_METHOD_SINGLE = 0, + HCLUST_METHOD_COMPLETE = 1, + HCLUST_METHOD_AVERAGE = 2, + HCLUST_METHOD_MEDIAN = 3, + HCLUST_METHOD_CENTROID = 5, +}; + +void hclust_pdist(int n, int m, double* pts, double* out); +void cluster_points_centroid(int n, int m, double* pts, double dist, int* idx); + + +#endif diff --git a/selfdrive/controls/lib/cluster/fastcluster_R_dm.cpp b/selfdrive/controls/lib/cluster/fastcluster_R_dm.cpp new file mode 100644 index 000000000..cbe126c15 --- /dev/null +++ b/selfdrive/controls/lib/cluster/fastcluster_R_dm.cpp @@ -0,0 +1,115 @@ +// +// Excerpt from fastcluster_R.cpp +// +// Copyright: Daniel Müllner, 2011 +// + +struct pos_node { + t_index pos; + int node; +}; + +void order_nodes(const int N, const int * const merge, const t_index * const node_size, int * const order) { + /* Parameters: + N : number of data points + merge : (N-1)×2 array which specifies the node indices which are + merged in each step of the clustering procedure. + Negative entries -1...-N point to singleton nodes, while + positive entries 1...(N-1) point to nodes which are themselves + parents of other nodes. + node_size : array of node sizes - makes it easier + order : output array of size N + + Runtime: Θ(N) + */ + auto_array_ptr queue(N/2); + + int parent; + int child; + t_index pos = 0; + + queue[0].pos = 0; + queue[0].node = N-2; + t_index idx = 1; + + do { + --idx; + pos = queue[idx].pos; + parent = queue[idx].node; + + // First child + child = merge[parent]; + if (child<0) { // singleton node, write this into the 'order' array. + order[pos] = -child; + ++pos; + } + else { /* compound node: put it on top of the queue and decompose it + in a later iteration. */ + queue[idx].pos = pos; + queue[idx].node = child-1; // convert index-1 based to index-0 based + ++idx; + pos += node_size[child-1]; + } + // Second child + child = merge[parent+N-1]; + if (child<0) { + order[pos] = -child; + } + else { + queue[idx].pos = pos; + queue[idx].node = child-1; + ++idx; + } + } while (idx>0); +} + +#define size_(r_) ( ((r_ +void generate_R_dendrogram(int * const merge, double * const height, int * const order, cluster_result & Z2, const int N) { + // The array "nodes" is a union-find data structure for the cluster + // identites (only needed for unsorted cluster_result input). + union_find nodes(sorted ? 0 : N); + if (!sorted) { + std::stable_sort(Z2[0], Z2[N-1]); + } + + t_index node1, node2; + auto_array_ptr node_size(N-1); + + for (t_index i=0; inode1; + node2 = Z2[i]->node2; + } + else { + node1 = nodes.Find(Z2[i]->node1); + node2 = nodes.Find(Z2[i]->node2); + // Merge the nodes in the union-find data structure by making them + // children of a new node. + nodes.Union(node1, node2); + } + // Sort the nodes in the output array. + if (node1>node2) { + t_index tmp = node1; + node1 = node2; + node2 = tmp; + } + /* Conversion between labeling conventions. + Input: singleton nodes 0,...,N-1 + compound nodes N,...,2N-2 + Output: singleton nodes -1,...,-N + compound nodes 1,...,N + */ + merge[i] = (node1(node1)-1 + : static_cast(node1)-N+1; + merge[i+N-1] = (node2(node2)-1 + : static_cast(node2)-N+1; + height[i] = Z2[i]->dist; + node_size[i] = size_(node1) + size_(node2); + } + + order_nodes(N, merge, node_size, order); +} diff --git a/selfdrive/controls/lib/cluster/fastcluster_dm.cpp b/selfdrive/controls/lib/cluster/fastcluster_dm.cpp new file mode 100644 index 000000000..ee6670c20 --- /dev/null +++ b/selfdrive/controls/lib/cluster/fastcluster_dm.cpp @@ -0,0 +1,1794 @@ +/* + fastcluster: Fast hierarchical clustering routines for R and Python + + Copyright © 2011 Daniel Müllner + + + This library implements various fast algorithms for hierarchical, + agglomerative clustering methods: + + (1) Algorithms for the "stored matrix approach": the input is the array of + pairwise dissimilarities. + + MST_linkage_core: single linkage clustering with the "minimum spanning + tree algorithm (Rohlfs) + + NN_chain_core: nearest-neighbor-chain algorithm, suitable for single, + complete, average, weighted and Ward linkage (Murtagh) + + generic_linkage: generic algorithm, suitable for all distance update + formulas (Müllner) + + (2) Algorithms for the "stored data approach": the input are points in a + vector space. + + MST_linkage_core_vector: single linkage clustering for vector data + + generic_linkage_vector: generic algorithm for vector data, suitable for + the Ward, centroid and median methods. + + generic_linkage_vector_alternative: alternative scheme for updating the + nearest neighbors. This method seems faster than "generic_linkage_vector" + for the centroid and median methods but slower for the Ward method. + + All these implementation treat infinity values correctly. They throw an + exception if a NaN distance value occurs. +*/ + +// Older versions of Microsoft Visual Studio do not have the fenv header. +#ifdef _MSC_VER +#if (_MSC_VER == 1500 || _MSC_VER == 1600) +#define NO_INCLUDE_FENV +#endif +#endif +// NaN detection via fenv might not work on systems with software +// floating-point emulation (bug report for Debian armel). +#ifdef __SOFTFP__ +#define NO_INCLUDE_FENV +#endif +#ifdef NO_INCLUDE_FENV +#pragma message("Do not use fenv header.") +#else +//#pragma message("Use fenv header. If there is a warning about unknown #pragma STDC FENV_ACCESS, this can be ignored.") +//#pragma STDC FENV_ACCESS on +#include +#endif + +#include // for std::pow, std::sqrt +#include // for std::ptrdiff_t +#include // for std::numeric_limits<...>::infinity() +#include // for std::fill_n +#include // for std::runtime_error +#include // for std::string + +#include // also for DBL_MAX, DBL_MIN +#ifndef DBL_MANT_DIG +#error The constant DBL_MANT_DIG could not be defined. +#endif +#define T_FLOAT_MANT_DIG DBL_MANT_DIG + +#ifndef LONG_MAX +#include +#endif +#ifndef LONG_MAX +#error The constant LONG_MAX could not be defined. +#endif +#ifndef INT_MAX +#error The constant INT_MAX could not be defined. +#endif + +#ifndef INT32_MAX +#ifdef _MSC_VER +#if _MSC_VER >= 1600 +#define __STDC_LIMIT_MACROS +#include +#else +typedef __int32 int_fast32_t; +typedef __int64 int64_t; +#endif +#else +#define __STDC_LIMIT_MACROS +#include +#endif +#endif + +#define FILL_N std::fill_n +#ifdef _MSC_VER +#if _MSC_VER < 1600 +#undef FILL_N +#define FILL_N stdext::unchecked_fill_n +#endif +#endif + +// Suppress warnings about (potentially) uninitialized variables. +#ifdef _MSC_VER + #pragma warning (disable:4700) +#endif + +#ifndef HAVE_DIAGNOSTIC +#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6)) +#define HAVE_DIAGNOSTIC 1 +#endif +#endif + +#ifndef HAVE_VISIBILITY +#if __GNUC__ >= 4 +#define HAVE_VISIBILITY 1 +#endif +#endif + +/* Since the public interface is given by the Python respectively R interface, + * we do not want other symbols than the interface initalization routines to be + * visible in the shared object file. The "visibility" switch is a GCC concept. + * Hiding symbols keeps the relocation table small and decreases startup time. + * See http://gcc.gnu.org/wiki/Visibility + */ +#if HAVE_VISIBILITY +#pragma GCC visibility push(hidden) +#endif + +typedef int_fast32_t t_index; +#ifndef INT32_MAX +#define MAX_INDEX 0x7fffffffL +#else +#define MAX_INDEX INT32_MAX +#endif +#if (LONG_MAX < MAX_INDEX) +#error The integer format "t_index" must not have a greater range than "long int". +#endif +#if (INT_MAX > MAX_INDEX) +#error The integer format "int" must not have a greater range than "t_index". +#endif +typedef double t_float; + +/* Method codes. + + These codes must agree with the METHODS array in fastcluster.R and the + dictionary mthidx in fastcluster.py. +*/ +enum method_codes { + // non-Euclidean methods + METHOD_METR_SINGLE = 0, + METHOD_METR_COMPLETE = 1, + METHOD_METR_AVERAGE = 2, + METHOD_METR_WEIGHTED = 3, + METHOD_METR_WARD = 4, + METHOD_METR_WARD_D = METHOD_METR_WARD, + METHOD_METR_CENTROID = 5, + METHOD_METR_MEDIAN = 6, + METHOD_METR_WARD_D2 = 7, + + MIN_METHOD_CODE = 0, + MAX_METHOD_CODE = 7 +}; + +enum method_codes_vector { + // Euclidean methods + METHOD_VECTOR_SINGLE = 0, + METHOD_VECTOR_WARD = 1, + METHOD_VECTOR_CENTROID = 2, + METHOD_VECTOR_MEDIAN = 3, + + MIN_METHOD_VECTOR_CODE = 0, + MAX_METHOD_VECTOR_CODE = 3 +}; + +// self-destructing array pointer +template +class auto_array_ptr{ +private: + type * ptr; + auto_array_ptr(auto_array_ptr const &); // non construction-copyable + auto_array_ptr& operator=(auto_array_ptr const &); // non copyable +public: + auto_array_ptr() + : ptr(NULL) + { } + template + auto_array_ptr(index const size) + : ptr(new type[size]) + { } + template + auto_array_ptr(index const size, value const val) + : ptr(new type[size]) + { + FILL_N(ptr, size, val); + } + ~auto_array_ptr() { + delete [] ptr; } + void free() { + delete [] ptr; + ptr = NULL; + } + template + void init(index const size) { + ptr = new type [size]; + } + template + void init(index const size, value const val) { + init(size); + FILL_N(ptr, size, val); + } + inline operator type *() const { return ptr; } +}; + +struct node { + t_index node1, node2; + t_float dist; +}; + +inline bool operator< (const node a, const node b) { + return (a.dist < b.dist); +} + +class cluster_result { +private: + auto_array_ptr Z; + t_index pos; + +public: + cluster_result(const t_index size) + : Z(size) + , pos(0) + {} + + void append(const t_index node1, const t_index node2, const t_float dist) { + Z[pos].node1 = node1; + Z[pos].node2 = node2; + Z[pos].dist = dist; + ++pos; + } + + node * operator[] (const t_index idx) const { return Z + idx; } + + /* Define several methods to postprocess the distances. All these functions + are monotone, so they do not change the sorted order of distances. */ + + void sqrt() const { + for (node * ZZ=Z; ZZ!=Z+pos; ++ZZ) { + ZZ->dist = std::sqrt(ZZ->dist); + } + } + + void sqrt(const t_float) const { // ignore the argument + sqrt(); + } + + void sqrtdouble(const t_float) const { // ignore the argument + for (node * ZZ=Z; ZZ!=Z+pos; ++ZZ) { + ZZ->dist = std::sqrt(2*ZZ->dist); + } + } + + #ifdef R_pow + #define my_pow R_pow + #else + #define my_pow std::pow + #endif + + void power(const t_float p) const { + t_float const q = 1/p; + for (node * ZZ=Z; ZZ!=Z+pos; ++ZZ) { + ZZ->dist = my_pow(ZZ->dist,q); + } + } + + void plusone(const t_float) const { // ignore the argument + for (node * ZZ=Z; ZZ!=Z+pos; ++ZZ) { + ZZ->dist += 1; + } + } + + void divide(const t_float denom) const { + for (node * ZZ=Z; ZZ!=Z+pos; ++ZZ) { + ZZ->dist /= denom; + } + } +}; + +class doubly_linked_list { + /* + Class for a doubly linked list. Initially, the list is the integer range + [0, size]. We provide a forward iterator and a method to delete an index + from the list. + + Typical use: for (i=L.start; L succ; + +private: + auto_array_ptr pred; + // Not necessarily private, we just do not need it in this instance. + +public: + doubly_linked_list(const t_index size) + // Initialize to the given size. + : start(0) + , succ(size+1) + , pred(size+1) + { + for (t_index i=0; i(2*N-3-(r_))*(r_)>>1)+(c_)-1] ) +// Z is an ((N-1)x4)-array +#define Z_(_r, _c) (Z[(_r)*4 + (_c)]) + +/* + Lookup function for a union-find data structure. + + The function finds the root of idx by going iteratively through all + parent elements until a root is found. An element i is a root if + nodes[i] is zero. To make subsequent searches faster, the entry for + idx and all its parents is updated with the root element. + */ +class union_find { +private: + auto_array_ptr parent; + t_index nextparent; + +public: + union_find(const t_index size) + : parent(size>0 ? 2*size-1 : 0, 0) + , nextparent(size) + { } + + t_index Find (t_index idx) const { + if (parent[idx] != 0 ) { // a → b + t_index p = idx; + idx = parent[idx]; + if (parent[idx] != 0 ) { // a → b → c + do { + idx = parent[idx]; + } while (parent[idx] != 0); + do { + t_index tmp = parent[p]; + parent[p] = idx; + p = tmp; + } while (parent[p] != idx); + } + } + return idx; + } + + void Union (const t_index node1, const t_index node2) { + parent[node1] = parent[node2] = nextparent++; + } +}; + +class nan_error{}; +#ifdef FE_INVALID +class fenv_error{}; +#endif + +static void MST_linkage_core(const t_index N, const t_float * const D, + cluster_result & Z2) { +/* + N: integer, number of data points + D: condensed distance matrix N*(N-1)/2 + Z2: output data structure + + The basis of this algorithm is an algorithm by Rohlf: + + F. James Rohlf, Hierarchical clustering using the minimum spanning tree, + The Computer Journal, vol. 16, 1973, p. 93–95. +*/ + t_index i; + t_index idx2; + doubly_linked_list active_nodes(N); + auto_array_ptr d(N); + + t_index prev_node; + t_float min; + + // first iteration + idx2 = 1; + min = std::numeric_limits::infinity(); + for (i=1; i tmp) + d[i] = tmp; + else if (fc_isnan(tmp)) + throw (nan_error()); +#if HAVE_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + if (d[i] < min) { + min = d[i]; + idx2 = i; + } + } + Z2.append(prev_node, idx2, min); + } +} + +/* Functions for the update of the dissimilarity array */ + +inline static void f_single( t_float * const b, const t_float a ) { + if (*b > a) *b = a; +} +inline static void f_complete( t_float * const b, const t_float a ) { + if (*b < a) *b = a; +} +inline static void f_average( t_float * const b, const t_float a, const t_float s, const t_float t) { + *b = s*a + t*(*b); + #ifndef FE_INVALID +#if HAVE_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + if (fc_isnan(*b)) { + throw(nan_error()); + } +#if HAVE_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + #endif +} +inline static void f_weighted( t_float * const b, const t_float a) { + *b = (a+*b)*.5; + #ifndef FE_INVALID +#if HAVE_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + if (fc_isnan(*b)) { + throw(nan_error()); + } +#if HAVE_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + #endif +} +inline static void f_ward( t_float * const b, const t_float a, const t_float c, const t_float s, const t_float t, const t_float v) { + *b = ( (v+s)*a - v*c + (v+t)*(*b) ) / (s+t+v); + //*b = a+(*b)-(t*a+s*(*b)+v*c)/(s+t+v); + #ifndef FE_INVALID +#if HAVE_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + if (fc_isnan(*b)) { + throw(nan_error()); + } +#if HAVE_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + #endif +} +inline static void f_centroid( t_float * const b, const t_float a, const t_float stc, const t_float s, const t_float t) { + *b = s*a - stc + t*(*b); + #ifndef FE_INVALID + if (fc_isnan(*b)) { + throw(nan_error()); + } +#if HAVE_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + #endif +} +inline static void f_median( t_float * const b, const t_float a, const t_float c_4) { + *b = (a+(*b))*.5 - c_4; + #ifndef FE_INVALID +#if HAVE_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + if (fc_isnan(*b)) { + throw(nan_error()); + } +#if HAVE_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + #endif +} + +template +static void NN_chain_core(const t_index N, t_float * const D, t_members * const members, cluster_result & Z2) { +/* + N: integer + D: condensed distance matrix N*(N-1)/2 + Z2: output data structure + + This is the NN-chain algorithm, described on page 86 in the following book: + + Fionn Murtagh, Multidimensional Clustering Algorithms, + Vienna, Würzburg: Physica-Verlag, 1985. +*/ + t_index i; + + auto_array_ptr NN_chain(N); + t_index NN_chain_tip = 0; + + t_index idx1, idx2; + + t_float size1, size2; + doubly_linked_list active_nodes(N); + + t_float min; + + for (t_float const * DD=D; DD!=D+(static_cast(N)*(N-1)>>1); + ++DD) { +#if HAVE_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + if (fc_isnan(*DD)) { + throw(nan_error()); + } +#if HAVE_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + } + + #ifdef FE_INVALID + if (feclearexcept(FE_INVALID)) throw fenv_error(); + #endif + + for (t_index j=0; jidx2) { + t_index tmp = idx1; + idx1 = idx2; + idx2 = tmp; + } + + if (method==METHOD_METR_AVERAGE || + method==METHOD_METR_WARD) { + size1 = static_cast(members[idx1]); + size2 = static_cast(members[idx2]); + members[idx2] += members[idx1]; + } + + // Remove the smaller index from the valid indices (active_nodes). + active_nodes.remove(idx1); + + switch (method) { + case METHOD_METR_SINGLE: + /* + Single linkage. + + Characteristic: new distances are never longer than the old distances. + */ + // Update the distance matrix in the range [start, idx1). + for (i=active_nodes.start; i(members[i]); + for (i=active_nodes.start; i(members[i]) ); + // Update the distance matrix in the range (idx1, idx2). + for (; i(members[i]) ); + // Update the distance matrix in the range (idx2, N). + for (i=active_nodes.succ[idx2]; i(members[i]) ); + break; + + default: + throw std::runtime_error(std::string("Invalid method.")); + } + } + #ifdef FE_INVALID + if (fetestexcept(FE_INVALID)) throw fenv_error(); + #endif +} + +class binary_min_heap { + /* + Class for a binary min-heap. The data resides in an array A. The elements of + A are not changed but two lists I and R of indices are generated which point + to elements of A and backwards. + + The heap tree structure is + + H[2*i+1] H[2*i+2] + \ / + \ / + ≤ ≤ + \ / + \ / + H[i] + + where the children must be less or equal than their parent. Thus, H[0] + contains the minimum. The lists I and R are made such that H[i] = A[I[i]] + and R[I[i]] = i. + + This implementation is not designed to handle NaN values. + */ +private: + t_float * const A; + t_index size; + auto_array_ptr I; + auto_array_ptr R; + + // no default constructor + binary_min_heap(); + // noncopyable + binary_min_heap(binary_min_heap const &); + binary_min_heap & operator=(binary_min_heap const &); + +public: + binary_min_heap(t_float * const A_, const t_index size_) + : A(A_), size(size_), I(size), R(size) + { // Allocate memory and initialize the lists I and R to the identity. This + // does not make it a heap. Call heapify afterwards! + for (t_index i=0; i>1); idx>0; ) { + --idx; + update_geq_(idx); + } + } + + inline t_index argmin() const { + // Return the minimal element. + return I[0]; + } + + void heap_pop() { + // Remove the minimal element from the heap. + --size; + I[0] = I[size]; + R[I[0]] = 0; + update_geq_(0); + } + + void remove(t_index idx) { + // Remove an element from the heap. + --size; + R[I[size]] = R[idx]; + I[R[idx]] = I[size]; + if ( H(size)<=A[idx] ) { + update_leq_(R[idx]); + } + else { + update_geq_(R[idx]); + } + } + + void replace ( const t_index idxold, const t_index idxnew, + const t_float val) { + R[idxnew] = R[idxold]; + I[R[idxnew]] = idxnew; + if (val<=A[idxold]) + update_leq(idxnew, val); + else + update_geq(idxnew, val); + } + + void update ( const t_index idx, const t_float val ) const { + // Update the element A[i] with val and re-arrange the indices to preserve + // the heap condition. + if (val<=A[idx]) + update_leq(idx, val); + else + update_geq(idx, val); + } + + void update_leq ( const t_index idx, const t_float val ) const { + // Use this when the new value is not more than the old value. + A[idx] = val; + update_leq_(R[idx]); + } + + void update_geq ( const t_index idx, const t_float val ) const { + // Use this when the new value is not less than the old value. + A[idx] = val; + update_geq_(R[idx]); + } + +private: + void update_leq_ (t_index i) const { + t_index j; + for ( ; (i>0) && ( H(i)>1) ); i=j) + heap_swap(i,j); + } + + void update_geq_ (t_index i) const { + t_index j; + for ( ; (j=2*i+1)=H(i) ) { + ++j; + if ( j>=size || H(j)>=H(i) ) break; + } + else if ( j+1 +static void generic_linkage(const t_index N, t_float * const D, t_members * const members, cluster_result & Z2) { + /* + N: integer, number of data points + D: condensed distance matrix N*(N-1)/2 + Z2: output data structure + */ + + const t_index N_1 = N-1; + t_index i, j; // loop variables + t_index idx1, idx2; // row and column indices + + auto_array_ptr n_nghbr(N_1); // array of nearest neighbors + auto_array_ptr mindist(N_1); // distances to the nearest neighbors + auto_array_ptr row_repr(N); // row_repr[i]: node number that the + // i-th row represents + doubly_linked_list active_nodes(N); + binary_min_heap nn_distances(&*mindist, N_1); // minimum heap structure for + // the distance to the nearest neighbor of each point + t_index node1, node2; // node numbers in the output + t_float size1, size2; // and their cardinalities + + t_float min; // minimum and row index for nearest-neighbor search + t_index idx; + + for (i=0; ii} D(i,j) for i in range(N-1) + t_float const * DD = D; + for (i=0; i::infinity(); + for (idx=j=i+1; ji} D(i,j) + + Normally, we have equality. However, this minimum may become invalid due + to the updates in the distance matrix. The rules are: + + 1) If mindist[i] is equal to D(i, n_nghbr[i]), this is the correct + minimum and n_nghbr[i] is a nearest neighbor. + + 2) If mindist[i] is smaller than D(i, n_nghbr[i]), this might not be the + correct minimum. The minimum needs to be recomputed. + + 3) mindist[i] is never bigger than the true minimum. Hence, we never + miss the true minimum if we take the smallest mindist entry, + re-compute the value if necessary (thus maybe increasing it) and + looking for the now smallest mindist entry until a valid minimal + entry is found. This step is done in the lines below. + + The update process for D below takes care that these rules are + fulfilled. This makes sure that the minima in the rows D(i,i+1:)of D are + re-calculated when necessary but re-calculation is avoided whenever + possible. + + The re-calculation of the minima makes the worst-case runtime of this + algorithm cubic in N. We avoid this whenever possible, and in most cases + the runtime appears to be quadratic. + */ + idx1 = nn_distances.argmin(); + if (method != METHOD_METR_SINGLE) { + while ( mindist[idx1] < D_(idx1, n_nghbr[idx1]) ) { + // Recompute the minimum mindist[idx1] and n_nghbr[idx1]. + n_nghbr[idx1] = j = active_nodes.succ[idx1]; // exists, maximally N-1 + min = D_(idx1,j); + for (j=active_nodes.succ[j]; j(members[idx1]); + size2 = static_cast(members[idx2]); + members[idx2] += members[idx1]; + } + Z2.append(node1, node2, mindist[idx1]); + + // Remove idx1 from the list of active indices (active_nodes). + active_nodes.remove(idx1); + // Index idx2 now represents the new (merged) node with label N+i. + row_repr[idx2] = N+i; + + // Update the distance matrix + switch (method) { + case METHOD_METR_SINGLE: + /* + Single linkage. + + Characteristic: new distances are never longer than the old distances. + */ + // Update the distance matrix in the range [start, idx1). + for (j=active_nodes.start; j(members[j]) ); + if (n_nghbr[j] == idx1) + n_nghbr[j] = idx2; + } + // Update the distance matrix in the range (idx1, idx2). + for (; j(members[j]) ); + if (D_(j, idx2) < mindist[j]) { + nn_distances.update_leq(j, D_(j, idx2)); + n_nghbr[j] = idx2; + } + } + // Update the distance matrix in the range (idx2, N). + if (idx2(members[j]) ); + min = D_(idx2,j); + for (j=active_nodes.succ[j]; j(members[j]) ); + if (D_(idx2,j) < min) { + min = D_(idx2,j); + n_nghbr[idx2] = j; + } + } + nn_distances.update(idx2, min); + } + break; + + case METHOD_METR_CENTROID: { + /* + Centroid linkage. + + Shorter and longer distances can occur, not bigger than max(d1,d2) + but maybe smaller than min(d1,d2). + */ + // Update the distance matrix in the range [start, idx1). + t_float s = size1/(size1+size2); + t_float t = size2/(size1+size2); + t_float stc = s*t*mindist[idx1]; + for (j=active_nodes.start; j +static void MST_linkage_core_vector(const t_index N, + t_dissimilarity & dist, + cluster_result & Z2) { +/* + N: integer, number of data points + dist: function pointer to the metric + Z2: output data structure + + The basis of this algorithm is an algorithm by Rohlf: + + F. James Rohlf, Hierarchical clustering using the minimum spanning tree, + The Computer Journal, vol. 16, 1973, p. 93–95. +*/ + t_index i; + t_index idx2; + doubly_linked_list active_nodes(N); + auto_array_ptr d(N); + + t_index prev_node; + t_float min; + + // first iteration + idx2 = 1; + min = std::numeric_limits::infinity(); + for (i=1; i tmp) + d[i] = tmp; + else if (fc_isnan(tmp)) + throw (nan_error()); +#if HAVE_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + if (d[i] < min) { + min = d[i]; + idx2 = i; + } + } + Z2.append(prev_node, idx2, min); + } +} + +template +static void generic_linkage_vector(const t_index N, + t_dissimilarity & dist, + cluster_result & Z2) { + /* + N: integer, number of data points + dist: function pointer to the metric + Z2: output data structure + + This algorithm is valid for the distance update methods + "Ward", "centroid" and "median" only! + */ + const t_index N_1 = N-1; + t_index i, j; // loop variables + t_index idx1, idx2; // row and column indices + + auto_array_ptr n_nghbr(N_1); // array of nearest neighbors + auto_array_ptr mindist(N_1); // distances to the nearest neighbors + auto_array_ptr row_repr(N); // row_repr[i]: node number that the + // i-th row represents + doubly_linked_list active_nodes(N); + binary_min_heap nn_distances(&*mindist, N_1); // minimum heap structure for + // the distance to the nearest neighbor of each point + t_index node1, node2; // node numbers in the output + t_float min; // minimum and row index for nearest-neighbor search + + for (i=0; ii} D(i,j) for i in range(N-1) + for (i=0; i::infinity(); + t_index idx; + for (idx=j=i+1; j(i,j); + } + if (tmp(idx1,j); + for (j=active_nodes.succ[j]; j(idx1,j); + if (tmp(j, idx2); + if (tmp < mindist[j]) { + nn_distances.update_leq(j, tmp); + n_nghbr[j] = idx2; + } + else if (n_nghbr[j] == idx2) + n_nghbr[j] = idx1; // invalidate + } + // Find the nearest neighbor for idx2. + if (idx2(idx2,j); + for (j=active_nodes.succ[j]; j(idx2, j); + if (tmp < min) { + min = tmp; + n_nghbr[idx2] = j; + } + } + nn_distances.update(idx2, min); + } + } + } +} + +template +static void generic_linkage_vector_alternative(const t_index N, + t_dissimilarity & dist, + cluster_result & Z2) { + /* + N: integer, number of data points + dist: function pointer to the metric + Z2: output data structure + + This algorithm is valid for the distance update methods + "Ward", "centroid" and "median" only! + */ + const t_index N_1 = N-1; + t_index i, j=0; // loop variables + t_index idx1, idx2; // row and column indices + + auto_array_ptr n_nghbr(2*N-2); // array of nearest neighbors + auto_array_ptr mindist(2*N-2); // distances to the nearest neighbors + + doubly_linked_list active_nodes(N+N_1); + binary_min_heap nn_distances(&*mindist, N_1, 2*N-2, 1); // minimum heap + // structure for the distance to the nearest neighbor of each point + + t_float min; // minimum for nearest-neighbor searches + + // Initialize the minimal distances: + // Find the nearest neighbor of each point. + // n_nghbr[i] = argmin_{j>i} D(i,j) for i in range(N-1) + for (i=1; i::infinity(); + t_index idx; + for (idx=j=0; j(i,j); + } + if (tmp + +extern "C" { +#include "fastcluster.h" +} + + +int main(int argc, const char* argv[]) { + const int n = 11; + const int m = 3; + double* pts = new double[n*m]{59.26000137, -9.35999966, -5.42500019, + 91.61999817, -0.31999999, -2.75, + 31.38000031, 0.40000001, -0.2, + 89.57999725, -8.07999992, -18.04999924, + 53.42000122, 0.63999999, -0.175, + 31.38000031, 0.47999999, -0.2, + 36.33999939, 0.16, -0.2, + 53.33999939, 0.95999998, -0.175, + 59.26000137, -9.76000023, -5.44999981, + 33.93999977, 0.40000001, -0.22499999, + 106.74000092, -5.76000023, -18.04999924}; + + int * idx = new int[n]; + int * correct_idx = new int[n]{0, 1, 2, 3, 4, 2, 5, 4, 0, 5, 6}; + + cluster_points_centroid(n, m, pts, 2.5 * 2.5, idx); + + for (int i = 0; i < n; i++) { + assert(idx[i] == correct_idx[i]); + } + + delete[] idx; + delete[] correct_idx; + delete[] pts; +} diff --git a/selfdrive/controls/lib/desire_helper.py b/selfdrive/controls/lib/desire_helper.py new file mode 100644 index 000000000..c34d143a5 --- /dev/null +++ b/selfdrive/controls/lib/desire_helper.py @@ -0,0 +1,113 @@ +from cereal import log +from common.realtime import DT_MDL +from selfdrive.config import Conversions as CV + +LaneChangeState = log.LateralPlan.LaneChangeState +LaneChangeDirection = log.LateralPlan.LaneChangeDirection + +LANE_CHANGE_SPEED_MIN = 30 * CV.MPH_TO_MS +LANE_CHANGE_TIME_MAX = 10. + +DESIRES = { + LaneChangeDirection.none: { + LaneChangeState.off: log.LateralPlan.Desire.none, + LaneChangeState.preLaneChange: log.LateralPlan.Desire.none, + LaneChangeState.laneChangeStarting: log.LateralPlan.Desire.none, + LaneChangeState.laneChangeFinishing: log.LateralPlan.Desire.none, + }, + LaneChangeDirection.left: { + LaneChangeState.off: log.LateralPlan.Desire.none, + LaneChangeState.preLaneChange: log.LateralPlan.Desire.none, + LaneChangeState.laneChangeStarting: log.LateralPlan.Desire.laneChangeLeft, + LaneChangeState.laneChangeFinishing: log.LateralPlan.Desire.laneChangeLeft, + }, + LaneChangeDirection.right: { + LaneChangeState.off: log.LateralPlan.Desire.none, + LaneChangeState.preLaneChange: log.LateralPlan.Desire.none, + LaneChangeState.laneChangeStarting: log.LateralPlan.Desire.laneChangeRight, + LaneChangeState.laneChangeFinishing: log.LateralPlan.Desire.laneChangeRight, + }, +} + + +class DesireHelper: + def __init__(self): + self.lane_change_state = LaneChangeState.off + self.lane_change_direction = LaneChangeDirection.none + self.lane_change_timer = 0.0 + self.lane_change_ll_prob = 1.0 + self.keep_pulse_timer = 0.0 + self.prev_one_blinker = False + self.desire = log.LateralPlan.Desire.none + + def update(self, carstate, active, lane_change_prob): + v_ego = carstate.vEgo + one_blinker = carstate.leftBlinker != carstate.rightBlinker + below_lane_change_speed = v_ego < LANE_CHANGE_SPEED_MIN + + if not active or self.lane_change_timer > LANE_CHANGE_TIME_MAX: + self.lane_change_state = LaneChangeState.off + self.lane_change_direction = LaneChangeDirection.none + else: + # LaneChangeState.off + if self.lane_change_state == LaneChangeState.off and one_blinker and not self.prev_one_blinker and not below_lane_change_speed: + self.lane_change_state = LaneChangeState.preLaneChange + self.lane_change_ll_prob = 1.0 + + # LaneChangeState.preLaneChange + elif self.lane_change_state == LaneChangeState.preLaneChange: + # Set lane change direction + self.lane_change_direction = LaneChangeDirection.left if \ + carstate.leftBlinker else LaneChangeDirection.right + + torque_applied = carstate.steeringPressed and \ + ((carstate.steeringTorque > 0 and self.lane_change_direction == LaneChangeDirection.left) or + (carstate.steeringTorque < 0 and self.lane_change_direction == LaneChangeDirection.right)) + + blindspot_detected = ((carstate.leftBlindspot and self.lane_change_direction == LaneChangeDirection.left) or + (carstate.rightBlindspot and self.lane_change_direction == LaneChangeDirection.right)) + + if not one_blinker or below_lane_change_speed: + self.lane_change_state = LaneChangeState.off + elif torque_applied and not blindspot_detected: + self.lane_change_state = LaneChangeState.laneChangeStarting + + # LaneChangeState.laneChangeStarting + elif self.lane_change_state == LaneChangeState.laneChangeStarting: + # fade out over .5s + self.lane_change_ll_prob = max(self.lane_change_ll_prob - 2 * DT_MDL, 0.0) + + # 98% certainty + if lane_change_prob < 0.02 and self.lane_change_ll_prob < 0.01: + self.lane_change_state = LaneChangeState.laneChangeFinishing + + # LaneChangeState.laneChangeFinishing + elif self.lane_change_state == LaneChangeState.laneChangeFinishing: + # fade in laneline over 1s + self.lane_change_ll_prob = min(self.lane_change_ll_prob + DT_MDL, 1.0) + + if self.lane_change_ll_prob > 0.99: + self.lane_change_direction = LaneChangeDirection.none + if one_blinker: + self.lane_change_state = LaneChangeState.preLaneChange + else: + self.lane_change_state = LaneChangeState.off + + if self.lane_change_state in (LaneChangeState.off, LaneChangeState.preLaneChange): + self.lane_change_timer = 0.0 + else: + self.lane_change_timer += DT_MDL + + self.prev_one_blinker = one_blinker + + self.desire = DESIRES[self.lane_change_direction][self.lane_change_state] + + # Send keep pulse once per second during LaneChangeStart.preLaneChange + if self.lane_change_state in (LaneChangeState.off, LaneChangeState.laneChangeStarting): + self.keep_pulse_timer = 0.0 + elif self.lane_change_state == LaneChangeState.preLaneChange: + self.keep_pulse_timer += DT_MDL + if self.keep_pulse_timer > 1.0: + self.keep_pulse_timer = 0.0 + elif self.desire in (log.LateralPlan.Desire.keepLeft, log.LateralPlan.Desire.keepRight): + self.desire = log.LateralPlan.Desire.none diff --git a/selfdrive/controls/lib/drive_helpers.py b/selfdrive/controls/lib/drive_helpers.py new file mode 100644 index 000000000..14be3d5ed --- /dev/null +++ b/selfdrive/controls/lib/drive_helpers.py @@ -0,0 +1,124 @@ +import math +from cereal import car +from common.numpy_fast import clip, interp +from common.realtime import DT_MDL +from selfdrive.config import Conversions as CV +from selfdrive.modeld.constants import T_IDXS + +# WARNING: this value was determined based on the model's training distribution, +# model predictions above this speed can be unpredictable +V_CRUISE_MAX = 145 # kph +V_CRUISE_MIN = 8 # kph +V_CRUISE_ENABLE_MIN = 40 # kph + +LAT_MPC_N = 16 +LON_MPC_N = 32 +CONTROL_N = 17 +CAR_ROTATION_RADIUS = 0.0 + +# this corresponds to 80deg/s and 20deg/s steering angle in a toyota corolla +MAX_CURVATURE_RATES = [0.03762194918267951, 0.003441203371932992] +MAX_CURVATURE_RATE_SPEEDS = [0, 35] + +CRUISE_LONG_PRESS = 50 +CRUISE_NEAREST_FUNC = { + car.CarState.ButtonEvent.Type.accelCruise: math.ceil, + car.CarState.ButtonEvent.Type.decelCruise: math.floor, +} +CRUISE_INTERVAL_SIGN = { + car.CarState.ButtonEvent.Type.accelCruise: +1, + car.CarState.ButtonEvent.Type.decelCruise: -1, +} + + +class MPC_COST_LAT: + PATH = 1.0 + HEADING = 1.0 + STEER_RATE = 1.0 + + +class MPC_COST_LONG: + TTC = 5.0 + DISTANCE = 0.1 + ACCELERATION = 10.0 + JERK = 20.0 + + +def rate_limit(new_value, last_value, dw_step, up_step): + return clip(new_value, last_value + dw_step, last_value + up_step) + + +def get_steer_max(CP, v_ego): + return interp(v_ego, CP.steerMaxBP, CP.steerMaxV) + + +def update_v_cruise(v_cruise_kph, buttonEvents, button_timers, enabled, metric): + # handle button presses. TODO: this should be in state_control, but a decelCruise press + # would have the effect of both enabling and changing speed is checked after the state transition + if not enabled: + return v_cruise_kph + + long_press = False + button_type = None + + v_cruise_delta = 1 if metric else 1.6 + + for b in buttonEvents: + if b.type.raw in button_timers and not b.pressed: + if button_timers[b.type.raw] > CRUISE_LONG_PRESS: + return v_cruise_kph # end long press + button_type = b.type.raw + break + else: + for k in button_timers.keys(): + if button_timers[k] and button_timers[k] % CRUISE_LONG_PRESS == 0: + button_type = k + long_press = True + break + + if button_type: + v_cruise_delta = v_cruise_delta * (5 if long_press else 1) + if long_press and v_cruise_kph % v_cruise_delta != 0: # partial interval + v_cruise_kph = CRUISE_NEAREST_FUNC[button_type](v_cruise_kph / v_cruise_delta) * v_cruise_delta + else: + v_cruise_kph += v_cruise_delta * CRUISE_INTERVAL_SIGN[button_type] + v_cruise_kph = clip(round(v_cruise_kph, 1), V_CRUISE_MIN, V_CRUISE_MAX) + + return v_cruise_kph + + +def initialize_v_cruise(v_ego, buttonEvents, v_cruise_last): + for b in buttonEvents: + # 250kph or above probably means we never had a set speed + if b.type == car.CarState.ButtonEvent.Type.accelCruise and v_cruise_last < 250: + return v_cruise_last + + return int(round(clip(v_ego * CV.MS_TO_KPH, V_CRUISE_ENABLE_MIN, V_CRUISE_MAX))) + + +def get_lag_adjusted_curvature(CP, v_ego, psis, curvatures, curvature_rates): + if len(psis) != CONTROL_N: + psis = [0.0 for i in range(CONTROL_N)] + curvatures = [0.0 for i in range(CONTROL_N)] + curvature_rates = [0.0 for i in range(CONTROL_N)] + + # TODO this needs more thought, use .2s extra for now to estimate other delays + delay = CP.steerActuatorDelay + .2 + current_curvature = curvatures[0] + psi = interp(delay, T_IDXS[:CONTROL_N], psis) + desired_curvature_rate = curvature_rates[0] + + # MPC can plan to turn the wheel and turn back before t_delay. This means + # in high delay cases some corrections never even get commanded. So just use + # psi to calculate a simple linearization of desired curvature + curvature_diff_from_psi = psi / (max(v_ego, 1e-1) * delay) - current_curvature + desired_curvature = current_curvature + 2 * curvature_diff_from_psi + + max_curvature_rate = interp(v_ego, MAX_CURVATURE_RATE_SPEEDS, MAX_CURVATURE_RATES) + safe_desired_curvature_rate = clip(desired_curvature_rate, + -max_curvature_rate, + max_curvature_rate) + safe_desired_curvature = clip(desired_curvature, + current_curvature - max_curvature_rate * DT_MDL, + current_curvature + max_curvature_rate * DT_MDL) + return safe_desired_curvature, safe_desired_curvature_rate diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py new file mode 100644 index 000000000..f0e594239 --- /dev/null +++ b/selfdrive/controls/lib/events.py @@ -0,0 +1,874 @@ +from enum import IntEnum +from typing import Dict, Union, Callable, List, Optional + +from cereal import log, car +import cereal.messaging as messaging +from common.realtime import DT_CTRL +from selfdrive.config import Conversions as CV +from selfdrive.locationd.calibrationd import MIN_SPEED_FILTER + +AlertSize = log.ControlsState.AlertSize +AlertStatus = log.ControlsState.AlertStatus +VisualAlert = car.CarControl.HUDControl.VisualAlert +AudibleAlert = car.CarControl.HUDControl.AudibleAlert +EventName = car.CarEvent.EventName + + +# Alert priorities +class Priority(IntEnum): + LOWEST = 0 + LOWER = 1 + LOW = 2 + MID = 3 + HIGH = 4 + HIGHEST = 5 + + +# Event types +class ET: + ENABLE = 'enable' + PRE_ENABLE = 'preEnable' + NO_ENTRY = 'noEntry' + WARNING = 'warning' + USER_DISABLE = 'userDisable' + SOFT_DISABLE = 'softDisable' + IMMEDIATE_DISABLE = 'immediateDisable' + PERMANENT = 'permanent' + + +# get event name from enum +EVENT_NAME = {v: k for k, v in EventName.schema.enumerants.items()} + + +class Events: + def __init__(self): + self.events: List[int] = [] + self.static_events: List[int] = [] + self.events_prev = dict.fromkeys(EVENTS.keys(), 0) + + @property + def names(self) -> List[int]: + return self.events + + def __len__(self) -> int: + return len(self.events) + + def add(self, event_name: int, static: bool=False) -> None: + if static: + self.static_events.append(event_name) + self.events.append(event_name) + + def clear(self) -> None: + self.events_prev = {k: (v + 1 if k in self.events else 0) for k, v in self.events_prev.items()} + self.events = self.static_events.copy() + + def any(self, event_type: str) -> bool: + return any(event_type in EVENTS.get(e, {}) for e in self.events) + + def create_alerts(self, event_types: List[str], callback_args=None): + if callback_args is None: + callback_args = [] + + ret = [] + for e in self.events: + types = EVENTS[e].keys() + for et in event_types: + if et in types: + alert = EVENTS[e][et] + if not isinstance(alert, Alert): + alert = alert(*callback_args) + + if DT_CTRL * (self.events_prev[e] + 1) >= alert.creation_delay: + alert.alert_type = f"{EVENT_NAME[e]}/{et}" + alert.event_type = et + ret.append(alert) + return ret + + def add_from_msg(self, events): + for e in events: + self.events.append(e.name.raw) + + def to_msg(self): + ret = [] + for event_name in self.events: + event = car.CarEvent.new_message() + event.name = event_name + for event_type in EVENTS.get(event_name, {}): + setattr(event, event_type, True) + ret.append(event) + return ret + + +class Alert: + def __init__(self, + alert_text_1: str, + alert_text_2: str, + alert_status: log.ControlsState.AlertStatus, + alert_size: log.ControlsState.AlertSize, + priority: Priority, + visual_alert: car.CarControl.HUDControl.VisualAlert, + audible_alert: car.CarControl.HUDControl.AudibleAlert, + duration: float, + alert_rate: float = 0., + creation_delay: float = 0.): + + self.alert_text_1 = alert_text_1 + self.alert_text_2 = alert_text_2 + self.alert_status = alert_status + self.alert_size = alert_size + self.priority = priority + self.visual_alert = visual_alert + self.audible_alert = audible_alert + + self.duration = int(duration / DT_CTRL) + + self.alert_rate = alert_rate + self.creation_delay = creation_delay + + self.alert_type = "" + self.event_type: Optional[str] = None + + def __str__(self) -> str: + return f"{self.alert_text_1}/{self.alert_text_2} {self.priority} {self.visual_alert} {self.audible_alert}" + + def __gt__(self, alert2) -> bool: + return self.priority > alert2.priority + + +class NoEntryAlert(Alert): + def __init__(self, alert_text_2: str, visual_alert: car.CarControl.HUDControl.VisualAlert=VisualAlert.none): + super().__init__("openpilot Unavailable", alert_text_2, AlertStatus.normal, + AlertSize.mid, Priority.LOW, visual_alert, + AudibleAlert.refuse, 3.) + + +class SoftDisableAlert(Alert): + def __init__(self, alert_text_2: str): + super().__init__("TAKE CONTROL IMMEDIATELY", alert_text_2, + AlertStatus.userPrompt, AlertSize.full, + Priority.MID, VisualAlert.steerRequired, + AudibleAlert.warningSoft, 2.), + + +# less harsh version of SoftDisable, where the condition is user-triggered +class UserSoftDisableAlert(SoftDisableAlert): + def __init__(self, alert_text_2: str): + super().__init__(alert_text_2), + self.alert_text_1 = "openpilot will disengage" + + +class ImmediateDisableAlert(Alert): + def __init__(self, alert_text_2: str): + super().__init__("TAKE CONTROL IMMEDIATELY", alert_text_2, + AlertStatus.critical, AlertSize.full, + Priority.HIGHEST, VisualAlert.steerRequired, + AudibleAlert.warningImmediate, 4.), + + +class EngagementAlert(Alert): + def __init__(self, audible_alert: car.CarControl.HUDControl.AudibleAlert): + super().__init__("", "", + AlertStatus.normal, AlertSize.none, + Priority.MID, VisualAlert.none, + audible_alert, .2), + + +class NormalPermanentAlert(Alert): + def __init__(self, alert_text_1: str, alert_text_2: str = "", duration: float = 0.2, priority: Priority = Priority.LOWER, creation_delay: float = 0.): + super().__init__(alert_text_1, alert_text_2, + AlertStatus.normal, AlertSize.mid if len(alert_text_2) else AlertSize.small, + priority, VisualAlert.none, AudibleAlert.none, duration, creation_delay=creation_delay), + + +class StartupAlert(Alert): + def __init__(self, alert_text_1: str, alert_text_2: str = "Always keep hands on wheel and eyes on road", alert_status=AlertStatus.normal): + super().__init__(alert_text_1, alert_text_2, + alert_status, AlertSize.mid, + Priority.LOWER, VisualAlert.none, AudibleAlert.none, 10.), + + +# ********** helper functions ********** +def get_display_speed(speed_ms: float, metric: bool) -> str: + speed = int(round(speed_ms * (CV.MS_TO_KPH if metric else CV.MS_TO_MPH))) + unit = 'km/h' if metric else 'mph' + return f"{speed} {unit}" + + +# ********** alert callback functions ********** + +AlertCallbackType = Callable[[car.CarParams, messaging.SubMaster, bool, int], Alert] + + +def soft_disable_alert(alert_text_2: str) -> AlertCallbackType: + def func(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: + if soft_disable_time < int(0.5 / DT_CTRL): + return ImmediateDisableAlert(alert_text_2) + return SoftDisableAlert(alert_text_2) + return func + + +def user_soft_disable_alert(alert_text_2: str) -> AlertCallbackType: + def func(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: + if soft_disable_time < int(0.5 / DT_CTRL): + return ImmediateDisableAlert(alert_text_2) + return UserSoftDisableAlert(alert_text_2) + return func + + +def below_engage_speed_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: + return NoEntryAlert(f"Speed Below {get_display_speed(CP.minEnableSpeed, metric)}") + + +def below_steer_speed_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: + return Alert( + f"Steer Unavailable Below {get_display_speed(CP.minSteerSpeed, metric)}", + "", + AlertStatus.userPrompt, AlertSize.small, + Priority.MID, VisualAlert.steerRequired, AudibleAlert.prompt, 0.4) + + +def calibration_incomplete_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: + return Alert( + "Calibration in Progress: %d%%" % sm['liveCalibration'].calPerc, + f"Drive Above {get_display_speed(MIN_SPEED_FILTER, metric)}", + AlertStatus.normal, AlertSize.mid, + Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .2) + + +def no_gps_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: + gps_integrated = sm['peripheralState'].pandaType in (log.PandaState.PandaType.uno, log.PandaState.PandaType.dos) + return Alert( + "Poor GPS reception", + "If sky is visible, contact support" if gps_integrated else "Check GPS antenna placement", + AlertStatus.normal, AlertSize.mid, + Priority.LOWER, VisualAlert.none, AudibleAlert.none, .2, creation_delay=300.) + + +def wrong_car_mode_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: + text = "Cruise Mode Disabled" + if CP.carName == "honda": + text = "Main Switch Off" + return NoEntryAlert(text) + + +def joystick_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: + axes = sm['testJoystick'].axes + gb, steer = list(axes)[:2] if len(axes) else (0., 0.) + vals = f"Gas: {round(gb * 100.)}%, Steer: {round(steer * 100.)}%" + return NormalPermanentAlert("Joystick Mode", vals) + + + +EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = { + # ********** events with no alerts ********** + + EventName.stockFcw: {}, + + # ********** events only containing alerts displayed in all states ********** + + EventName.joystickDebug: { + ET.WARNING: joystick_alert, + ET.PERMANENT: NormalPermanentAlert("Joystick Mode"), + }, + + EventName.controlsInitializing: { + ET.NO_ENTRY: NoEntryAlert("System Initializing"), + }, + + EventName.startup: { + ET.PERMANENT: StartupAlert("Be ready to take over at any time") + }, + + EventName.startupMaster: { + ET.PERMANENT: StartupAlert("WARNING: This branch is not tested", + alert_status=AlertStatus.userPrompt), + }, + + # Car is recognized, but marked as dashcam only + EventName.startupNoControl: { + ET.PERMANENT: StartupAlert("Dashcam mode"), + }, + + # Car is not recognized + EventName.startupNoCar: { + ET.PERMANENT: StartupAlert("Dashcam mode for unsupported car"), + }, + + EventName.startupNoFw: { + ET.PERMANENT: StartupAlert("Car Unrecognized", + "Check comma power connections", + alert_status=AlertStatus.userPrompt), + }, + + EventName.dashcamMode: { + ET.PERMANENT: NormalPermanentAlert("Dashcam Mode", + priority=Priority.LOWEST), + }, + + EventName.invalidLkasSetting: { + ET.PERMANENT: NormalPermanentAlert("Stock LKAS is on", + "Turn off stock LKAS to engage"), + }, + + EventName.cruiseMismatch: { + #ET.PERMANENT: ImmediateDisableAlert("openpilot failed to cancel cruise"), + }, + + # openpilot doesn't recognize the car. This switches openpilot into a + # read-only mode. This can be solved by adding your fingerprint. + # See https://github.com/commaai/openpilot/wiki/Fingerprinting for more information + EventName.carUnrecognized: { + ET.PERMANENT: NormalPermanentAlert("Dashcam Mode", + "Car Unrecognized", + priority=Priority.LOWEST), + }, + + EventName.stockAeb: { + ET.PERMANENT: Alert( + "BRAKE!", + "Stock AEB: Risk of Collision", + AlertStatus.critical, AlertSize.full, + Priority.HIGHEST, VisualAlert.fcw, AudibleAlert.none, 2.), + ET.NO_ENTRY: NoEntryAlert("Stock AEB: Risk of Collision"), + }, + + EventName.fcw: { + ET.PERMANENT: Alert( + "BRAKE!", + "Risk of Collision", + AlertStatus.critical, AlertSize.full, + Priority.HIGHEST, VisualAlert.fcw, AudibleAlert.warningSoft, 2.), + }, + + EventName.ldw: { + ET.PERMANENT: Alert( + "Lane Departure Detected", + "", + AlertStatus.userPrompt, AlertSize.small, + Priority.LOW, VisualAlert.ldw, AudibleAlert.prompt, 3.), + }, + + # ********** events only containing alerts that display while engaged ********** + + EventName.gasPressed: { + ET.PRE_ENABLE: Alert( + "Release Gas Pedal to Engage", + "", + AlertStatus.normal, AlertSize.small, + Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .1, creation_delay=1.), + }, + + # openpilot tries to learn certain parameters about your car by observing + # how the car behaves to steering inputs from both human and openpilot driving. + # This includes: + # - steer ratio: gear ratio of the steering rack. Steering angle divided by tire angle + # - tire stiffness: how much grip your tires have + # - angle offset: most steering angle sensors are offset and measure a non zero angle when driving straight + # This alert is thrown when any of these values exceed a sanity check. This can be caused by + # bad alignment or bad sensor data. If this happens consistently consider creating an issue on GitHub + EventName.vehicleModelInvalid: { + ET.NO_ENTRY: NoEntryAlert("Vehicle Parameter Identification Failed"), + ET.SOFT_DISABLE: soft_disable_alert("Vehicle Parameter Identification Failed"), + }, + + EventName.steerTempUnavailableSilent: { + ET.WARNING: Alert( + "Steering Temporarily Unavailable", + "", + AlertStatus.userPrompt, AlertSize.small, + Priority.LOW, VisualAlert.steerRequired, AudibleAlert.none, 1.), + }, + + EventName.preDriverDistracted: { + ET.WARNING: Alert( + "Pay Attention", + "", + AlertStatus.normal, AlertSize.small, + Priority.LOW, VisualAlert.none, AudibleAlert.none, .1), + }, + + EventName.promptDriverDistracted: { + ET.WARNING: Alert( + "Pay Attention", + "Driver Distracted", + AlertStatus.userPrompt, AlertSize.mid, + Priority.MID, VisualAlert.steerRequired, AudibleAlert.promptDistracted, .1), + }, + + EventName.driverDistracted: { + ET.WARNING: Alert( + "DISENGAGE IMMEDIATELY", + "Driver Distracted", + AlertStatus.critical, AlertSize.full, + Priority.HIGH, VisualAlert.steerRequired, AudibleAlert.warningImmediate, .1), + }, + + EventName.preDriverUnresponsive: { + ET.WARNING: Alert( + "Touch Steering Wheel: No Face Detected", + "", + AlertStatus.normal, AlertSize.small, + Priority.LOW, VisualAlert.steerRequired, AudibleAlert.none, .1, alert_rate=0.75), + }, + + EventName.promptDriverUnresponsive: { + ET.WARNING: Alert( + "Touch Steering Wheel", + "Driver Unresponsive", + AlertStatus.userPrompt, AlertSize.mid, + Priority.MID, VisualAlert.steerRequired, AudibleAlert.promptDistracted, .1), + }, + + EventName.driverUnresponsive: { + ET.WARNING: Alert( + "DISENGAGE IMMEDIATELY", + "Driver Unresponsive", + AlertStatus.critical, AlertSize.full, + Priority.HIGH, VisualAlert.steerRequired, AudibleAlert.warningImmediate, .1), + }, + + EventName.manualRestart: { + ET.WARNING: Alert( + "TAKE CONTROL", + "Resume Driving Manually", + AlertStatus.userPrompt, AlertSize.mid, + Priority.LOW, VisualAlert.none, AudibleAlert.none, .2), + }, + + EventName.resumeRequired: { + ET.WARNING: Alert( + "STOPPED", + "Press Resume to Go", + AlertStatus.userPrompt, AlertSize.mid, + Priority.LOW, VisualAlert.none, AudibleAlert.none, .2), + }, + + EventName.belowSteerSpeed: { + ET.WARNING: below_steer_speed_alert, + }, + + EventName.preLaneChangeLeft: { + ET.WARNING: Alert( + "Steer Left to Start Lane Change Once Safe", + "", + AlertStatus.normal, AlertSize.small, + Priority.LOW, VisualAlert.none, AudibleAlert.none, .1, alert_rate=0.75), + }, + + EventName.preLaneChangeRight: { + ET.WARNING: Alert( + "Steer Right to Start Lane Change Once Safe", + "", + AlertStatus.normal, AlertSize.small, + Priority.LOW, VisualAlert.none, AudibleAlert.none, .1, alert_rate=0.75), + }, + + EventName.laneChangeBlocked: { + ET.WARNING: Alert( + "Car Detected in Blindspot", + "", + AlertStatus.userPrompt, AlertSize.small, + Priority.LOW, VisualAlert.none, AudibleAlert.prompt, .1), + }, + + EventName.laneChange: { + ET.WARNING: Alert( + "Changing Lanes", + "", + AlertStatus.normal, AlertSize.small, + Priority.LOW, VisualAlert.none, AudibleAlert.none, .1), + }, + + EventName.steerSaturated: { + ET.WARNING: Alert( + "Take Control", + "Turn Exceeds Steering Limit", + AlertStatus.userPrompt, AlertSize.mid, + Priority.LOW, VisualAlert.steerRequired, AudibleAlert.promptRepeat, 1.), + }, + + # Thrown when the fan is driven at >50% but is not rotating + EventName.fanMalfunction: { + ET.PERMANENT: NormalPermanentAlert("Fan Malfunction", "Contact Support"), + }, + + # Camera is not outputting frames at a constant framerate + EventName.cameraMalfunction: { + ET.PERMANENT: NormalPermanentAlert("Camera Malfunction", "Contact Support"), + }, + + # Unused + EventName.gpsMalfunction: { + ET.PERMANENT: NormalPermanentAlert("GPS Malfunction", "Contact Support"), + }, + + # When the GPS position and localizer diverge the localizer is reset to the + # current GPS position. This alert is thrown when the localizer is reset + # more often than expected. + EventName.localizerMalfunction: { + # ET.PERMANENT: NormalPermanentAlert("Sensor Malfunction", "Contact Support"), + }, + + # ********** events that affect controls state transitions ********** + + EventName.pcmEnable: { + ET.ENABLE: EngagementAlert(AudibleAlert.engage), + }, + + EventName.buttonEnable: { + ET.ENABLE: EngagementAlert(AudibleAlert.engage), + }, + + EventName.pcmDisable: { + ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), + }, + + EventName.buttonCancel: { + ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), + }, + + EventName.brakeHold: { + ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), + ET.NO_ENTRY: NoEntryAlert("Brake Hold Active"), + }, + + EventName.parkBrake: { + ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), + ET.NO_ENTRY: NoEntryAlert("Parking Brake Engaged"), + }, + + EventName.pedalPressed: { + ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), + ET.NO_ENTRY: NoEntryAlert("Pedal Pressed", + visual_alert=VisualAlert.brakePressed), + }, + + EventName.wrongCarMode: { + ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), + ET.NO_ENTRY: wrong_car_mode_alert, + }, + + EventName.wrongCruiseMode: { + ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), + ET.NO_ENTRY: NoEntryAlert("Adaptive Cruise Disabled"), + }, + + EventName.steerTempUnavailable: { + ET.SOFT_DISABLE: soft_disable_alert("Steering Temporarily Unavailable"), + ET.NO_ENTRY: NoEntryAlert("Steering Temporarily Unavailable"), + }, + + EventName.outOfSpace: { + ET.PERMANENT: NormalPermanentAlert("Out of Storage"), + ET.NO_ENTRY: NoEntryAlert("Out of Storage"), + }, + + EventName.belowEngageSpeed: { + ET.NO_ENTRY: below_engage_speed_alert, + }, + + EventName.sensorDataInvalid: { + ET.PERMANENT: Alert( + "No Data from Device Sensors", + "Reboot your Device", + AlertStatus.normal, AlertSize.mid, + Priority.LOWER, VisualAlert.none, AudibleAlert.none, .2, creation_delay=1.), + ET.NO_ENTRY: NoEntryAlert("No Data from Device Sensors"), + }, + + EventName.noGps: { + ET.PERMANENT: no_gps_alert, + }, + + EventName.soundsUnavailable: { + ET.PERMANENT: NormalPermanentAlert("Speaker not found", "Reboot your Device"), + ET.NO_ENTRY: NoEntryAlert("Speaker not found"), + }, + + EventName.tooDistracted: { + ET.NO_ENTRY: NoEntryAlert("Distraction Level Too High"), + }, + + EventName.overheat: { + ET.PERMANENT: NormalPermanentAlert("System Overheated"), + ET.SOFT_DISABLE: soft_disable_alert("System Overheated"), + ET.NO_ENTRY: NoEntryAlert("System Overheated"), + }, + + EventName.wrongGear: { + ET.SOFT_DISABLE: user_soft_disable_alert("Gear not D"), + ET.NO_ENTRY: NoEntryAlert("Gear not D"), + }, + + # This alert is thrown when the calibration angles are outside of the acceptable range. + # For example if the device is pointed too much to the left or the right. + # Usually this can only be solved by removing the mount from the windshield completely, + # and attaching while making sure the device is pointed straight forward and is level. + # See https://comma.ai/setup for more information + EventName.calibrationInvalid: { + ET.PERMANENT: NormalPermanentAlert("Calibration Invalid", "Remount Device and Recalibrate"), + ET.SOFT_DISABLE: soft_disable_alert("Calibration Invalid: Remount Device & Recalibrate"), + ET.NO_ENTRY: NoEntryAlert("Calibration Invalid: Remount Device & Recalibrate"), + }, + + EventName.calibrationIncomplete: { + ET.PERMANENT: calibration_incomplete_alert, + ET.SOFT_DISABLE: soft_disable_alert("Calibration in Progress"), + ET.NO_ENTRY: NoEntryAlert("Calibration in Progress"), + }, + + EventName.doorOpen: { + ET.SOFT_DISABLE: user_soft_disable_alert("Door Open"), + ET.NO_ENTRY: NoEntryAlert("Door Open"), + }, + + EventName.seatbeltNotLatched: { + ET.SOFT_DISABLE: user_soft_disable_alert("Seatbelt Unlatched"), + ET.NO_ENTRY: NoEntryAlert("Seatbelt Unlatched"), + }, + + EventName.espDisabled: { + ET.SOFT_DISABLE: soft_disable_alert("ESP Off"), + ET.NO_ENTRY: NoEntryAlert("ESP Off"), + }, + + EventName.lowBattery: { + ET.SOFT_DISABLE: soft_disable_alert("Low Battery"), + ET.NO_ENTRY: NoEntryAlert("Low Battery"), + }, + + # Different openpilot services communicate between each other at a certain + # interval. If communication does not follow the regular schedule this alert + # is thrown. This can mean a service crashed, did not broadcast a message for + # ten times the regular interval, or the average interval is more than 10% too high. + EventName.commIssue: { + ET.SOFT_DISABLE: soft_disable_alert("Communication Issue between Processes"), + ET.NO_ENTRY: NoEntryAlert("Communication Issue between Processes"), + }, + + # Thrown when manager detects a service exited unexpectedly while driving + EventName.processNotRunning: { + ET.NO_ENTRY: NoEntryAlert("System Malfunction: Reboot Your Device"), + }, + + EventName.radarFault: { + ET.SOFT_DISABLE: soft_disable_alert("Radar Error: Restart the Car"), + ET.NO_ENTRY: NoEntryAlert("Radar Error: Restart the Car"), + }, + + # Every frame from the camera should be processed by the model. If modeld + # is not processing frames fast enough they have to be dropped. This alert is + # thrown when over 20% of frames are dropped. + EventName.modeldLagging: { + ET.SOFT_DISABLE: soft_disable_alert("Driving model lagging"), + ET.NO_ENTRY: NoEntryAlert("Driving model lagging"), + }, + + # Besides predicting the path, lane lines and lead car data the model also + # predicts the current velocity and rotation speed of the car. If the model is + # very uncertain about the current velocity while the car is moving, this + # usually means the model has trouble understanding the scene. This is used + # as a heuristic to warn the driver. + EventName.posenetInvalid: { + ET.SOFT_DISABLE: soft_disable_alert("Model Output Uncertain"), + ET.NO_ENTRY: NoEntryAlert("Model Output Uncertain"), + }, + + # When the localizer detects an acceleration of more than 40 m/s^2 (~4G) we + # alert the driver the device might have fallen from the windshield. + EventName.deviceFalling: { + ET.SOFT_DISABLE: soft_disable_alert("Device Fell Off Mount"), + ET.NO_ENTRY: NoEntryAlert("Device Fell Off Mount"), + }, + + EventName.lowMemory: { + ET.SOFT_DISABLE: soft_disable_alert("Low Memory: Reboot Your Device"), + ET.PERMANENT: NormalPermanentAlert("Low Memory", "Reboot your Device"), + ET.NO_ENTRY: NoEntryAlert("Low Memory: Reboot Your Device"), + }, + + EventName.highCpuUsage: { + #ET.SOFT_DISABLE: soft_disable_alert("System Malfunction: Reboot Your Device"), + #ET.PERMANENT: NormalPermanentAlert("System Malfunction", "Reboot your Device"), + ET.NO_ENTRY: NoEntryAlert("System Malfunction: Reboot Your Device"), + }, + + EventName.accFaulted: { + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Cruise Faulted"), + ET.PERMANENT: NormalPermanentAlert("Cruise Faulted", ""), + ET.NO_ENTRY: NoEntryAlert("Cruise Faulted"), + }, + + EventName.controlsMismatch: { + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Controls Mismatch"), + }, + + EventName.roadCameraError: { + ET.PERMANENT: NormalPermanentAlert("Camera Error", + duration=1., + creation_delay=30.), + }, + + EventName.driverCameraError: { + ET.PERMANENT: NormalPermanentAlert("Camera Error", + duration=1., + creation_delay=30.), + }, + + EventName.wideRoadCameraError: { + ET.PERMANENT: NormalPermanentAlert("Camera Error", + duration=1., + creation_delay=30.), + }, + + # Sometimes the USB stack on the device can get into a bad state + # causing the connection to the panda to be lost + EventName.usbError: { + ET.SOFT_DISABLE: soft_disable_alert("USB Error: Reboot Your Device"), + ET.PERMANENT: NormalPermanentAlert("USB Error: Reboot Your Device", ""), + ET.NO_ENTRY: NoEntryAlert("USB Error: Reboot Your Device"), + }, + + # This alert can be thrown for the following reasons: + # - No CAN data received at all + # - CAN data is received, but some message are not received at the right frequency + # If you're not writing a new car port, this is usually cause by faulty wiring + EventName.canError: { + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("CAN Error: Check Connections"), + ET.PERMANENT: Alert( + "CAN Error: Check Connections", + "", + AlertStatus.normal, AlertSize.small, + Priority.LOW, VisualAlert.none, AudibleAlert.none, 1., creation_delay=1.), + ET.NO_ENTRY: NoEntryAlert("CAN Error: Check Connections"), + }, + + EventName.steerUnavailable: { + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("LKAS Fault: Restart the Car"), + ET.PERMANENT: NormalPermanentAlert("LKAS Fault: Restart the car to engage"), + ET.NO_ENTRY: NoEntryAlert("LKAS Fault: Restart the Car"), + }, + + EventName.brakeUnavailable: { + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Cruise Fault: Restart the Car"), + ET.PERMANENT: NormalPermanentAlert("Cruise Fault: Restart the car to engage"), + ET.NO_ENTRY: NoEntryAlert("Cruise Fault: Restart the Car"), + }, + + EventName.reverseGear: { + ET.PERMANENT: Alert( + "Reverse\nGear", + "", + AlertStatus.normal, AlertSize.full, + Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .2, creation_delay=0.5), + ET.USER_DISABLE: ImmediateDisableAlert("Reverse Gear"), + ET.NO_ENTRY: NoEntryAlert("Reverse Gear"), + }, + + # On cars that use stock ACC the car can decide to cancel ACC for various reasons. + # When this happens we can no long control the car so the user needs to be warned immediately. + EventName.cruiseDisabled: { + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Cruise Is Off"), + }, + + # For planning the trajectory Model Predictive Control (MPC) is used. This is + # an optimization algorithm that is not guaranteed to find a feasible solution. + # If no solution is found or the solution has a very high cost this alert is thrown. + EventName.plannerError: { + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Planner Solution Error"), + ET.NO_ENTRY: NoEntryAlert("Planner Solution Error"), + }, + + # When the relay in the harness box opens the CAN bus between the LKAS camera + # and the rest of the car is separated. When messages from the LKAS camera + # are received on the car side this usually means the relay hasn't opened correctly + # and this alert is thrown. + EventName.relayMalfunction: { + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Harness Malfunction"), + ET.PERMANENT: NormalPermanentAlert("Harness Malfunction", "Check Hardware"), + ET.NO_ENTRY: NoEntryAlert("Harness Malfunction"), + }, + + EventName.noTarget: { + ET.IMMEDIATE_DISABLE: Alert( + "openpilot Canceled", + "No close lead car", + AlertStatus.normal, AlertSize.mid, + Priority.HIGH, VisualAlert.none, AudibleAlert.disengage, 3.), + ET.NO_ENTRY: NoEntryAlert("No Close Lead Car"), + }, + + EventName.speedTooLow: { + ET.IMMEDIATE_DISABLE: Alert( + "openpilot Canceled", + "Speed too low", + AlertStatus.normal, AlertSize.mid, + Priority.HIGH, VisualAlert.none, AudibleAlert.disengage, 3.), + }, + + # When the car is driving faster than most cars in the training data, the model outputs can be unpredictable. + EventName.speedTooHigh: { + ET.WARNING: Alert( + "Speed Too High", + "Model uncertain at this speed", + AlertStatus.userPrompt, AlertSize.mid, + Priority.HIGH, VisualAlert.steerRequired, AudibleAlert.promptRepeat, 4.), + ET.NO_ENTRY: NoEntryAlert("Slow down to engage"), + }, + + EventName.lowSpeedLockout: { + ET.PERMANENT: NormalPermanentAlert("Cruise Fault: Restart the car to engage"), + ET.NO_ENTRY: NoEntryAlert("Cruise Fault: Restart the Car"), + }, + + EventName.lkasDisabled: { + ET.PERMANENT: NormalPermanentAlert("LKAS Disabled: Enable LKAS to engage"), + ET.NO_ENTRY: NoEntryAlert("LKAS Disabled"), + }, + + EventName.pccEnabled: { + ET.WARNING: Alert( + "Pedal Cruise Enabled", + "", + AlertStatus.normal, AlertSize.small, + Priority.LOW, VisualAlert.none,AudibleAlert.engage, 1.), + }, + + EventName.pccDisabled: { + ET.WARNING: Alert( + "Pedal Cruise Disabled", + "", + AlertStatus.normal, AlertSize.small, + Priority.LOW, VisualAlert.steerRequired,AudibleAlert.disengage, 1.), + }, + + EventName.accEnabled: { + ET.WARNING: Alert( + "Adaptive Cruise Enabled", + "", + AlertStatus.normal, AlertSize.small, + Priority.LOW, VisualAlert.none,AudibleAlert.engage, 1.), + }, + + EventName.accDisabled: { + ET.WARNING: Alert( + "Adaptive Cruise Disabled", + "", + AlertStatus.userPrompt, AlertSize.small, + Priority.LOW, VisualAlert.none,AudibleAlert.disengage, 1.), + }, + + EventName.pccError: { + ET.WARNING: Alert( + "Pedal Interceptor Error", + "", + AlertStatus.userPrompt, AlertSize.small, + Priority.LOW, VisualAlert.none, AudibleAlert.none, 1.), + }, + + EventName.iBoosterBrakeNotOk: { + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("iBooster ECU Fault: Restart the Car"), + ET.PERMANENT: NormalPermanentAlert("iBooster ECU Fault: Restart the car to engage"), + ET.NO_ENTRY: NoEntryAlert("iBooster ECU Fault: Restart the Car"), + }, +} diff --git a/selfdrive/controls/lib/lane_planner.py b/selfdrive/controls/lib/lane_planner.py new file mode 100644 index 000000000..160808cff --- /dev/null +++ b/selfdrive/controls/lib/lane_planner.py @@ -0,0 +1,106 @@ +import numpy as np +from cereal import log +from common.filter_simple import FirstOrderFilter +from common.numpy_fast import interp +from common.realtime import DT_MDL +from selfdrive.hardware import EON, TICI +from selfdrive.swaglog import cloudlog + + +TRAJECTORY_SIZE = 33 +# camera offset is meters from center car to camera +# model path is in the frame of EON's camera. TICI is 0.1 m away, +# however the average measured path difference is 0.04 m +if EON: + CAMERA_OFFSET = -0.06 + PATH_OFFSET = 0.0 +elif TICI: + CAMERA_OFFSET = 0.04 + PATH_OFFSET = 0.04 +else: + CAMERA_OFFSET = 0.0 + PATH_OFFSET = 0.0 + + +class LanePlanner: + def __init__(self, wide_camera=False): + self.ll_t = np.zeros((TRAJECTORY_SIZE,)) + self.ll_x = np.zeros((TRAJECTORY_SIZE,)) + self.lll_y = np.zeros((TRAJECTORY_SIZE,)) + self.rll_y = np.zeros((TRAJECTORY_SIZE,)) + self.lane_width_estimate = FirstOrderFilter(3.7, 9.95, DT_MDL) + self.lane_width_certainty = FirstOrderFilter(1.0, 0.95, DT_MDL) + self.lane_width = 3.7 + + self.lll_prob = 0. + self.rll_prob = 0. + self.d_prob = 0. + + self.lll_std = 0. + self.rll_std = 0. + + self.l_lane_change_prob = 0. + self.r_lane_change_prob = 0. + + self.camera_offset = -CAMERA_OFFSET if wide_camera else CAMERA_OFFSET + self.path_offset = -PATH_OFFSET if wide_camera else PATH_OFFSET + + def parse_model(self, md): + lane_lines = md.laneLines + if len(lane_lines) == 4 and len(lane_lines[0].t) == TRAJECTORY_SIZE: + self.ll_t = (np.array(lane_lines[1].t) + np.array(lane_lines[2].t))/2 + # left and right ll x is the same + self.ll_x = lane_lines[1].x + self.lll_y = np.array(lane_lines[1].y) + self.camera_offset + self.rll_y = np.array(lane_lines[2].y) + self.camera_offset + self.lll_prob = md.laneLineProbs[1] + self.rll_prob = md.laneLineProbs[2] + self.lll_std = md.laneLineStds[1] + self.rll_std = md.laneLineStds[2] + + desire_state = md.meta.desireState + if len(desire_state): + self.l_lane_change_prob = desire_state[log.LateralPlan.Desire.laneChangeLeft] + self.r_lane_change_prob = desire_state[log.LateralPlan.Desire.laneChangeRight] + + def get_d_path(self, v_ego, path_t, path_xyz): + # Reduce reliance on lanelines that are too far apart or + # will be in a few seconds + path_xyz[:, 1] += self.path_offset + l_prob, r_prob = self.lll_prob, self.rll_prob + width_pts = self.rll_y - self.lll_y + prob_mods = [] + for t_check in (0.0, 1.5, 3.0): + width_at_t = interp(t_check * (v_ego + 7), self.ll_x, width_pts) + prob_mods.append(interp(width_at_t, [4.0, 5.0], [1.0, 0.0])) + mod = min(prob_mods) + l_prob *= mod + r_prob *= mod + + # Reduce reliance on uncertain lanelines + l_std_mod = interp(self.lll_std, [.15, .3], [1.0, 0.0]) + r_std_mod = interp(self.rll_std, [.15, .3], [1.0, 0.0]) + l_prob *= l_std_mod + r_prob *= r_std_mod + + # Find current lanewidth + self.lane_width_certainty.update(l_prob * r_prob) + current_lane_width = abs(self.rll_y[0] - self.lll_y[0]) + self.lane_width_estimate.update(current_lane_width) + speed_lane_width = interp(v_ego, [0., 31.], [2.8, 3.5]) + self.lane_width = self.lane_width_certainty.x * self.lane_width_estimate.x + \ + (1 - self.lane_width_certainty.x) * speed_lane_width + + clipped_lane_width = min(4.0, self.lane_width) + path_from_left_lane = self.lll_y + clipped_lane_width / 2.0 + path_from_right_lane = self.rll_y - clipped_lane_width / 2.0 + + self.d_prob = l_prob + r_prob - l_prob * r_prob + lane_path_y = (l_prob * path_from_left_lane + r_prob * path_from_right_lane) / (l_prob + r_prob + 0.0001) + safe_idxs = np.isfinite(self.ll_t) + if safe_idxs[0]: + lane_path_y_interp = np.interp(path_t, self.ll_t[safe_idxs], lane_path_y[safe_idxs]) + path_xyz[:,1] = self.d_prob * lane_path_y_interp + (1.0 - self.d_prob) * path_xyz[:,1] + else: + cloudlog.warning("Lateral mpc - NaNs in laneline times, ignoring") + return path_xyz diff --git a/selfdrive/controls/lib/latcontrol.py b/selfdrive/controls/lib/latcontrol.py new file mode 100644 index 000000000..eb16aca2e --- /dev/null +++ b/selfdrive/controls/lib/latcontrol.py @@ -0,0 +1,28 @@ +from abc import abstractmethod, ABC + +from common.realtime import DT_CTRL +from common.numpy_fast import clip + +MIN_STEER_SPEED = 0.3 + + +class LatControl(ABC): + def __init__(self, CP, CI): + self.sat_count_rate = 1.0 * DT_CTRL + self.sat_limit = CP.steerLimitTimer + self.sat_count = 0. + + @abstractmethod + def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate): + pass + + def reset(self): + self.sat_count = 0. + + def _check_saturation(self, saturated, CS): + if saturated and CS.vEgo > 10. and not CS.steeringRateLimited and not CS.steeringPressed: + self.sat_count += self.sat_count_rate + else: + self.sat_count -= self.sat_count_rate + self.sat_count = clip(self.sat_count, 0.0, self.sat_limit) + return self.sat_count > (self.sat_limit - 1e-3) diff --git a/selfdrive/controls/lib/latcontrol_angle.py b/selfdrive/controls/lib/latcontrol_angle.py new file mode 100644 index 000000000..c93535631 --- /dev/null +++ b/selfdrive/controls/lib/latcontrol_angle.py @@ -0,0 +1,25 @@ +import math + +from cereal import log +from selfdrive.controls.lib.latcontrol import LatControl, MIN_STEER_SPEED + +STEER_ANGLE_SATURATION_THRESHOLD = 2.5 # Degrees + + +class LatControlAngle(LatControl): + def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate): + angle_log = log.ControlsState.LateralAngleState.new_message() + + if CS.vEgo < MIN_STEER_SPEED or not active: + angle_log.active = False + angle_steers_des = float(CS.steeringAngleDeg) + else: + angle_log.active = True + angle_steers_des = math.degrees(VM.get_steer_from_curvature(-desired_curvature, CS.vEgo, params.roll)) + angle_steers_des += params.angleOffsetDeg + + angle_control_saturated = abs(angle_steers_des - CS.steeringAngleDeg) > STEER_ANGLE_SATURATION_THRESHOLD + angle_log.saturated = self._check_saturation(angle_control_saturated, CS) + angle_log.steeringAngleDeg = float(CS.steeringAngleDeg) + angle_log.steeringAngleDesiredDeg = angle_steers_des + return 0, float(angle_steers_des), angle_log diff --git a/selfdrive/controls/lib/latcontrol_indi.py b/selfdrive/controls/lib/latcontrol_indi.py new file mode 100644 index 000000000..dc1b31bad --- /dev/null +++ b/selfdrive/controls/lib/latcontrol_indi.py @@ -0,0 +1,122 @@ +import math +import numpy as np + +from cereal import log +from common.filter_simple import FirstOrderFilter +from common.numpy_fast import clip, interp +from common.realtime import DT_CTRL +from selfdrive.controls.lib.drive_helpers import get_steer_max +from selfdrive.controls.lib.latcontrol import LatControl, MIN_STEER_SPEED + + +class LatControlINDI(LatControl): + def __init__(self, CP, CI): + super().__init__(CP, CI) + self.angle_steers_des = 0. + + A = np.array([[1.0, DT_CTRL, 0.0], + [0.0, 1.0, DT_CTRL], + [0.0, 0.0, 1.0]]) + C = np.array([[1.0, 0.0, 0.0], + [0.0, 1.0, 0.0]]) + + # Q = np.matrix([[1e-2, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 10.0]]) + # R = np.matrix([[1e-2, 0.0], [0.0, 1e3]]) + + # (x, l, K) = control.dare(np.transpose(A), np.transpose(C), Q, R) + # K = np.transpose(K) + K = np.array([[7.30262179e-01, 2.07003658e-04], + [7.29394177e+00, 1.39159419e-02], + [1.71022442e+01, 3.38495381e-02]]) + + self.speed = 0. + + self.K = K + self.A_K = A - np.dot(K, C) + self.x = np.array([[0.], [0.], [0.]]) + + self._RC = (CP.lateralTuning.indi.timeConstantBP, CP.lateralTuning.indi.timeConstantV) + self._G = (CP.lateralTuning.indi.actuatorEffectivenessBP, CP.lateralTuning.indi.actuatorEffectivenessV) + self._outer_loop_gain = (CP.lateralTuning.indi.outerLoopGainBP, CP.lateralTuning.indi.outerLoopGainV) + self._inner_loop_gain = (CP.lateralTuning.indi.innerLoopGainBP, CP.lateralTuning.indi.innerLoopGainV) + + self.steer_filter = FirstOrderFilter(0., self.RC, DT_CTRL) + + self.reset() + + @property + def RC(self): + return interp(self.speed, self._RC[0], self._RC[1]) + + @property + def G(self): + return interp(self.speed, self._G[0], self._G[1]) + + @property + def outer_loop_gain(self): + return interp(self.speed, self._outer_loop_gain[0], self._outer_loop_gain[1]) + + @property + def inner_loop_gain(self): + return interp(self.speed, self._inner_loop_gain[0], self._inner_loop_gain[1]) + + def reset(self): + super().reset() + self.steer_filter.x = 0. + self.speed = 0. + + def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate): + self.speed = CS.vEgo + # Update Kalman filter + y = np.array([[math.radians(CS.steeringAngleDeg)], [math.radians(CS.steeringRateDeg)]]) + self.x = np.dot(self.A_K, self.x) + np.dot(self.K, y) + + indi_log = log.ControlsState.LateralINDIState.new_message() + indi_log.steeringAngleDeg = math.degrees(self.x[0]) + indi_log.steeringRateDeg = math.degrees(self.x[1]) + indi_log.steeringAccelDeg = math.degrees(self.x[2]) + + steers_des = VM.get_steer_from_curvature(-desired_curvature, CS.vEgo, params.roll) + steers_des += math.radians(params.angleOffsetDeg) + indi_log.steeringAngleDesiredDeg = math.degrees(steers_des) + + rate_des = VM.get_steer_from_curvature(-desired_curvature_rate, CS.vEgo, 0) + indi_log.steeringRateDesiredDeg = math.degrees(rate_des) + + if CS.vEgo < MIN_STEER_SPEED or not active: + indi_log.active = False + self.steer_filter.x = 0.0 + output_steer = 0 + else: + # Expected actuator value + self.steer_filter.update_alpha(self.RC) + self.steer_filter.update(last_actuators.steer) + + # Compute acceleration error + rate_sp = self.outer_loop_gain * (steers_des - self.x[0]) + rate_des + accel_sp = self.inner_loop_gain * (rate_sp - self.x[1]) + accel_error = accel_sp - self.x[2] + + # Compute change in actuator + g_inv = 1. / self.G + delta_u = g_inv * accel_error + + # If steering pressed, only allow wind down + if CS.steeringPressed and (delta_u * last_actuators.steer > 0): + delta_u = 0 + + output_steer = self.steer_filter.x + delta_u + + steers_max = get_steer_max(CP, CS.vEgo) + output_steer = clip(output_steer, -steers_max, steers_max) + + indi_log.active = True + indi_log.rateSetPoint = float(rate_sp) + indi_log.accelSetPoint = float(accel_sp) + indi_log.accelError = float(accel_error) + indi_log.delayedOutput = float(self.steer_filter.x) + indi_log.delta = float(delta_u) + indi_log.output = float(output_steer) + indi_log.saturated = self._check_saturation(steers_max - abs(output_steer) < 1e-3, CS) + + return float(output_steer), float(steers_des), indi_log diff --git a/selfdrive/controls/lib/latcontrol_lqr.py b/selfdrive/controls/lib/latcontrol_lqr.py new file mode 100644 index 000000000..5c273a45b --- /dev/null +++ b/selfdrive/controls/lib/latcontrol_lqr.py @@ -0,0 +1,86 @@ +import math +import numpy as np + +from common.numpy_fast import clip +from common.realtime import DT_CTRL +from cereal import log +from selfdrive.controls.lib.drive_helpers import get_steer_max +from selfdrive.controls.lib.latcontrol import LatControl, MIN_STEER_SPEED + + +class LatControlLQR(LatControl): + def __init__(self, CP, CI): + super().__init__(CP, CI) + self.scale = CP.lateralTuning.lqr.scale + self.ki = CP.lateralTuning.lqr.ki + + self.A = np.array(CP.lateralTuning.lqr.a).reshape((2, 2)) + self.B = np.array(CP.lateralTuning.lqr.b).reshape((2, 1)) + self.C = np.array(CP.lateralTuning.lqr.c).reshape((1, 2)) + self.K = np.array(CP.lateralTuning.lqr.k).reshape((1, 2)) + self.L = np.array(CP.lateralTuning.lqr.l).reshape((2, 1)) + self.dc_gain = CP.lateralTuning.lqr.dcGain + + self.x_hat = np.array([[0], [0]]) + self.i_unwind_rate = 0.3 * DT_CTRL + self.i_rate = 1.0 * DT_CTRL + + self.reset() + + def reset(self): + super().reset() + self.i_lqr = 0.0 + + def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate): + lqr_log = log.ControlsState.LateralLQRState.new_message() + + steers_max = get_steer_max(CP, CS.vEgo) + torque_scale = (0.45 + CS.vEgo / 60.0)**2 # Scale actuator model with speed + + # Subtract offset. Zero angle should correspond to zero torque + steering_angle_no_offset = CS.steeringAngleDeg - params.angleOffsetAverageDeg + + desired_angle = math.degrees(VM.get_steer_from_curvature(-desired_curvature, CS.vEgo, params.roll)) + + instant_offset = params.angleOffsetDeg - params.angleOffsetAverageDeg + desired_angle += instant_offset # Only add offset that originates from vehicle model errors + lqr_log.steeringAngleDesiredDeg = desired_angle + + # Update Kalman filter + angle_steers_k = float(self.C.dot(self.x_hat)) + e = steering_angle_no_offset - angle_steers_k + self.x_hat = self.A.dot(self.x_hat) + self.B.dot(CS.steeringTorqueEps / torque_scale) + self.L.dot(e) + + if CS.vEgo < MIN_STEER_SPEED or not active: + lqr_log.active = False + lqr_output = 0. + output_steer = 0. + self.reset() + else: + lqr_log.active = True + + # LQR + u_lqr = float(desired_angle / self.dc_gain - self.K.dot(self.x_hat)) + lqr_output = torque_scale * u_lqr / self.scale + + # Integrator + if CS.steeringPressed: + self.i_lqr -= self.i_unwind_rate * float(np.sign(self.i_lqr)) + else: + error = desired_angle - angle_steers_k + i = self.i_lqr + self.ki * self.i_rate * error + control = lqr_output + i + + if (error >= 0 and (control <= steers_max or i < 0.0)) or \ + (error <= 0 and (control >= -steers_max or i > 0.0)): + self.i_lqr = i + + output_steer = lqr_output + self.i_lqr + output_steer = clip(output_steer, -steers_max, steers_max) + + lqr_log.steeringAngleDeg = angle_steers_k + lqr_log.i = self.i_lqr + lqr_log.output = output_steer + lqr_log.lqrOutput = lqr_output + lqr_log.saturated = self._check_saturation(steers_max - abs(output_steer) < 1e-3, CS) + return output_steer, desired_angle, lqr_log diff --git a/selfdrive/controls/lib/latcontrol_pid.py b/selfdrive/controls/lib/latcontrol_pid.py new file mode 100644 index 000000000..f5ff5a95e --- /dev/null +++ b/selfdrive/controls/lib/latcontrol_pid.py @@ -0,0 +1,54 @@ +import math + +from selfdrive.controls.lib.pid import PIController +from selfdrive.controls.lib.drive_helpers import get_steer_max +from selfdrive.controls.lib.latcontrol import LatControl, MIN_STEER_SPEED +from cereal import log + + +class LatControlPID(LatControl): + def __init__(self, CP, CI): + super().__init__(CP, CI) + self.pid = PIController((CP.lateralTuning.pid.kpBP, CP.lateralTuning.pid.kpV), + (CP.lateralTuning.pid.kiBP, CP.lateralTuning.pid.kiV), + k_f=CP.lateralTuning.pid.kf, pos_limit=1.0, neg_limit=-1.0) + self.get_steer_feedforward = CI.get_steer_feedforward_function() + + def reset(self): + super().reset() + self.pid.reset() + + def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate): + pid_log = log.ControlsState.LateralPIDState.new_message() + pid_log.steeringAngleDeg = float(CS.steeringAngleDeg) + pid_log.steeringRateDeg = float(CS.steeringRateDeg) + + angle_steers_des_no_offset = math.degrees(VM.get_steer_from_curvature(-desired_curvature, CS.vEgo, params.roll)) + angle_steers_des = angle_steers_des_no_offset + params.angleOffsetDeg + + pid_log.steeringAngleDesiredDeg = angle_steers_des + pid_log.angleError = angle_steers_des - CS.steeringAngleDeg + if CS.vEgo < MIN_STEER_SPEED or not active: + output_steer = 0.0 + pid_log.active = False + self.pid.reset() + else: + steers_max = get_steer_max(CP, CS.vEgo) + self.pid.pos_limit = steers_max + self.pid.neg_limit = -steers_max + + # offset does not contribute to resistive torque + steer_feedforward = self.get_steer_feedforward(angle_steers_des_no_offset, CS.vEgo) + + deadzone = 0.0 + + output_steer = self.pid.update(angle_steers_des, CS.steeringAngleDeg, override=CS.steeringPressed, + feedforward=steer_feedforward, speed=CS.vEgo, deadzone=deadzone) + pid_log.active = True + pid_log.p = self.pid.p + pid_log.i = self.pid.i + pid_log.f = self.pid.f + pid_log.output = output_steer + pid_log.saturated = self._check_saturation(steers_max - abs(output_steer) < 1e-3, CS) + + return output_steer, angle_steers_des, pid_log diff --git a/selfdrive/controls/lib/lateral_mpc_lib/.gitignore b/selfdrive/controls/lib/lateral_mpc_lib/.gitignore new file mode 100644 index 000000000..aff2eb082 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/.gitignore @@ -0,0 +1,2 @@ +acados_ocp_lat.json +c_generated_code/ diff --git a/selfdrive/controls/lib/lateral_mpc_lib/SConscript b/selfdrive/controls/lib/lateral_mpc_lib/SConscript new file mode 100644 index 000000000..f402e6e15 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/SConscript @@ -0,0 +1,78 @@ +Import('env', 'envCython', 'arch', 'common') + +gen = "c_generated_code" + +casadi_model = [ + f'{gen}/lat_model/lat_expl_ode_fun.c', + f'{gen}/lat_model/lat_expl_vde_forw.c', +] + +casadi_cost_y = [ + f'{gen}/lat_cost/lat_cost_y_fun.c', + f'{gen}/lat_cost/lat_cost_y_fun_jac_ut_xt.c', + f'{gen}/lat_cost/lat_cost_y_hess.c', +] + +casadi_cost_e = [ + f'{gen}/lat_cost/lat_cost_y_e_fun.c', + f'{gen}/lat_cost/lat_cost_y_e_fun_jac_ut_xt.c', + f'{gen}/lat_cost/lat_cost_y_e_hess.c', +] + +casadi_cost_0 = [ + f'{gen}/lat_cost/lat_cost_y_0_fun.c', + f'{gen}/lat_cost/lat_cost_y_0_fun_jac_ut_xt.c', + f'{gen}/lat_cost/lat_cost_y_0_hess.c', +] + +build_files = [f'{gen}/acados_solver_lat.c'] + casadi_model + casadi_cost_y + casadi_cost_e + casadi_cost_0 + +# extra generated files used to trigger a rebuild +generated_files = [ + f'{gen}/Makefile', + + f'{gen}/main_lat.c', + f'{gen}/acados_solver_lat.h', + f'{gen}/acados_solver.pxd', + + f'{gen}/lat_model/lat_expl_vde_adj.c', + + f'{gen}/lat_model/lat_model.h', + f'{gen}/lat_cost/lat_cost_y_fun.h', + f'{gen}/lat_cost/lat_cost_y_e_fun.h', + f'{gen}/lat_cost/lat_cost_y_0_fun.h', +] + build_files + +lenv = env.Clone() +lenv.Clean(generated_files, Dir(gen)) + +lenv.Command(generated_files, + ["lat_mpc.py"], + f"cd {Dir('.').abspath} && python3 lat_mpc.py") + +lenv["CFLAGS"].append("-DACADOS_WITH_QPOASES") +lenv["CXXFLAGS"].append("-DACADOS_WITH_QPOASES") +lenv["CCFLAGS"].append("-Wno-unused") +if arch != "Darwin": + lenv["LINKFLAGS"].append("-Wl,--disable-new-dtags") +lib_solver = lenv.SharedLibrary(f"{gen}/acados_ocp_solver_lat", + build_files, + LIBS=['m', 'acados', 'hpipm', 'blasfeo', 'qpOASES_e']) + +# generate cython stuff +acados_ocp_solver_pyx = File("#pyextra/acados_template/acados_ocp_solver_pyx.pyx") +acados_ocp_solver_common = File("#pyextra/acados_template/acados_solver_common.pxd") +libacados_ocp_solver_pxd = File(f'{gen}/acados_solver.pxd') +libacados_ocp_solver_c = File(f'{gen}/acados_ocp_solver_pyx.c') + +lenv2 = envCython.Clone() +lenv2["LINKFLAGS"] += [lib_solver[0].get_labspath()] +lenv2.Command(libacados_ocp_solver_c, + [acados_ocp_solver_pyx, acados_ocp_solver_common, libacados_ocp_solver_pxd], + f'cython' + \ + f' -o {libacados_ocp_solver_c.get_labspath()}' + \ + f' -I {libacados_ocp_solver_pxd.get_dir().get_labspath()}' + \ + f' -I {acados_ocp_solver_common.get_dir().get_labspath()}' + \ + f' {acados_ocp_solver_pyx.get_labspath()}') +lib_cython = lenv2.Program(f'{gen}/acados_ocp_solver_pyx.so', [libacados_ocp_solver_c]) +lenv2.Depends(lib_cython, lib_solver) diff --git a/selfdrive/controls/lib/lateral_mpc_lib/__init__.py b/selfdrive/controls/lib/lateral_mpc_lib/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/Makefile b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/Makefile new file mode 100644 index 000000000..eb371aca8 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/Makefile @@ -0,0 +1,198 @@ +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + + + + + + +ACADOS_FLAGS = -fPIC -std=c99 #-fno-diagnostics-show-line-numbers -g +# # Debugging +# ACADOS_FLAGS += -g3 + +MODEL_OBJ= +MODEL_OBJ+= lat_model/lat_expl_ode_fun.o +MODEL_OBJ+= lat_model/lat_expl_vde_forw.o + + +OCP_OBJ= +OCP_OBJ+= lat_cost/lat_cost_y_0_fun.c +OCP_OBJ+= lat_cost/lat_cost_y_0_fun_jac_ut_xt.c +OCP_OBJ+= lat_cost/lat_cost_y_0_hess.c +OCP_OBJ+= lat_cost/lat_cost_y_fun.c +OCP_OBJ+= lat_cost/lat_cost_y_fun_jac_ut_xt.c +OCP_OBJ+= lat_cost/lat_cost_y_hess.c +OCP_OBJ+= lat_cost/lat_cost_y_e_fun.c +OCP_OBJ+= lat_cost/lat_cost_y_e_fun_jac_ut_xt.c +OCP_OBJ+= lat_cost/lat_cost_y_e_hess.c +OCP_OBJ+= acados_solver_lat.o + + +SIM_OBJ= +SIM_OBJ+= acados_sim_solver_lat.o + +EX_OBJ= +EX_OBJ+= main_lat.o + +EX_SIM_OBJ= +EX_SIM_OBJ+= main_sim_lat.o + +OBJ= +OBJ+= $(MODEL_OBJ) +OBJ+= $(SIM_OBJ) +OBJ+= $(OCP_OBJ) + +EXTERNAL_DIR= +EXTERNAL_LIB= + +INCLUDE_PATH = /data/openpilot_release/third_party/acados/include/acados/include +LIB_PATH = /data/openpilot_release/third_party/acados/include/acados/lib +all: clean casadi_fun example_sim example +shared_lib: bundled_shared_lib ocp_shared_lib sim_shared_lib + +CASADI_MODEL_SOURCE= +CASADI_MODEL_SOURCE+= lat_expl_ode_fun.c +CASADI_MODEL_SOURCE+= lat_expl_vde_forw.c +CASADI_COST_Y_SOURCE= +CASADI_COST_Y_SOURCE+= lat_cost_y_fun.c +CASADI_COST_Y_SOURCE+= lat_cost_y_fun_jac_ut_xt.c +CASADI_COST_Y_SOURCE+= lat_cost_y_hess.c +CASADI_COST_Y_E_SOURCE= +CASADI_COST_Y_E_SOURCE+= lat_cost_y_e_fun.c +CASADI_COST_Y_E_SOURCE+= lat_cost_y_e_fun_jac_ut_xt.c +CASADI_COST_Y_E_SOURCE+= lat_cost_y_e_hess.c +CASADI_COST_Y_0_SOURCE= +CASADI_COST_Y_0_SOURCE+= lat_cost_y_0_fun.c +CASADI_COST_Y_0_SOURCE+= lat_cost_y_0_fun_jac_ut_xt.c +CASADI_COST_Y_0_SOURCE+= lat_cost_y_0_hess.c + +casadi_fun: + ( cd lat_model ; gcc $(ACADOS_FLAGS) -c $(CASADI_MODEL_SOURCE)) + ( cd lat_cost ; gcc $(ACADOS_FLAGS) -c $(CASADI_COST_Y_SOURCE)) + ( cd lat_cost ; gcc $(ACADOS_FLAGS) -c $(CASADI_COST_Y_E_SOURCE)) + ( cd lat_cost ; gcc $(ACADOS_FLAGS) -c $(CASADI_COST_Y_0_SOURCE)) + +main: + gcc $(ACADOS_FLAGS) -c main_lat.c -I $(INCLUDE_PATH)/blasfeo/include/ -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) -I $(INCLUDE_PATH)/acados/ \ + +main_sim: + gcc $(ACADOS_FLAGS) -c main_sim_lat.c -I $(INCLUDE_PATH)/blasfeo/include/ -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) -I $(INCLUDE_PATH)/acados/ + +ocp_solver: + gcc $(ACADOS_FLAGS) -c acados_solver_lat.c -I $(INCLUDE_PATH)/blasfeo/include/ -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) -I $(INCLUDE_PATH)/acados/ \ + +sim_solver: + gcc $(ACADOS_FLAGS) -c acados_sim_solver_lat.c -I $(INCLUDE_PATH)/blasfeo/include/ -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) -I $(INCLUDE_PATH)/acados/ \ + +example: ocp_solver main + gcc $(ACADOS_FLAGS) -o main_lat $(EX_OBJ) $(OBJ) -L $(LIB_PATH) \ + -lacados -lhpipm -lblasfeo \ + \ + -lm \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) \ + -I $(INCLUDE_PATH)/acados/ \ + + +example_sim: sim_solver main_sim + gcc $(ACADOS_FLAGS) -o main_sim_lat $(EX_SIM_OBJ) $(MODEL_OBJ) $(SIM_OBJ) -L $(LIB_PATH) \ + -lacados -lhpipm -lblasfeo \ + \ + -lm \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/acados/ \ + +bundled_shared_lib: casadi_fun ocp_solver sim_solver + gcc $(ACADOS_FLAGS) -shared -o libacados_solver_lat.so $(OBJ) \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) \ + -L $(LIB_PATH) \ + -lacados -lhpipm -lblasfeo \ + \ + -lm \ + +ocp_shared_lib: casadi_fun ocp_solver + gcc $(ACADOS_FLAGS) -shared -o libacados_ocp_solver_lat.so $(OCP_OBJ) $(MODEL_OBJ) \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) \ + -L$(EXTERNAL_DIR) -l$(EXTERNAL_LIB) \ + -L $(LIB_PATH) -lacados -lhpipm -lblasfeo \ + \ + -lm \ + +ocp_cython_c: ocp_shared_lib + cython \ + -o acados_ocp_solver_pyx.c \ + -I $(INCLUDE_PATH)/../interfaces/acados_template/acados_template \ + $(INCLUDE_PATH)/../interfaces/acados_template/acados_template/acados_ocp_solver_pyx.pyx \ + +ocp_cython_o: ocp_cython_c + clang $(ACADOS_FLAGS) -c -O2 \ + -o acados_ocp_solver_pyx.o \ + -I /usr/include/python3.8 \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) \ + acados_ocp_solver_pyx.c \ + +ocp_cython: ocp_cython_o + clang $(ACADOS_FLAGS) -shared \ + -o acados_ocp_solver_pyx.so \ + -Wl,-rpath=$(LIB_PATH) \ + acados_ocp_solver_pyx.o \ + $(abspath .)/libacados_ocp_solver_lat.so \ + -L $(LIB_PATH) -lacados -lhpipm -lblasfeo -lqpOASES_e \ + \ + -lm \ + +sim_shared_lib: casadi_fun sim_solver + gcc $(ACADOS_FLAGS) -shared -o libacados_sim_solver_lat.so $(SIM_OBJ) $(MODEL_OBJ) -L$(EXTERNAL_DIR) -l$(EXTERNAL_LIB) \ + -L $(LIB_PATH) -lacados -lhpipm -lblasfeo \ + \ + -lm \ + +clean: + rm -f *.o + rm -f *.so + rm -f main_lat + +clean_ocp_shared_lib: + rm -f libacados_ocp_solver_lat.so + rm -f acados_solver_lat.o diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_ocp_solver_pyx.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_ocp_solver_pyx.c new file mode 100644 index 000000000..c3c44f306 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_ocp_solver_pyx.c @@ -0,0 +1,28063 @@ +/* Generated by Cython 0.29.26 */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_26" +#define CYTHON_HEX_VERSION 0x001D1AF0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject* co=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(0))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too; + if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here + if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too; + Py_XDECREF((PyObject*)co); + co = (PyCodeObject*)call_result; + call_result = NULL; + if (0) { + cleanup_code_too: + Py_XDECREF((PyObject*)co); + co = NULL; + } + end: + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(call_result); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return co; + } +#else + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if defined(PyUnicode_IS_READY) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #else + #define __Pyx_PyUnicode_READY(op) (0) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__acados_template__acados_ocp_solver_pyx +#define __PYX_HAVE_API__acados_template__acados_ocp_solver_pyx +/* Early includes */ +#include +#include "acados/ocp_nlp/ocp_nlp_common.h" +#include "acados_c/ocp_nlp_interface.h" +#include "acados_solver_lat.h" +#include +#include "numpy/arrayobject.h" +#include "numpy/ndarrayobject.h" +#include "numpy/ndarraytypes.h" +#include "numpy/arrayscalars.h" +#include "numpy/ufuncobject.h" + + /* NumPy API declarations from "numpy/__init__.pxd" */ + +#include "pythread.h" +#include +#include "pystate.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +/* Header.proto */ +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "pyextra/acados_template/acados_ocp_solver_pyx.pyx", + "stringsource", + "__init__.pxd", + "type.pxd", +}; +/* BufferFormatStructs.proto */ +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; + struct __Pyx_StructField_* fields; + size_t size; + size_t arraysize[8]; + int ndim; + char typegroup; + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + +/* MemviewSliceStruct.proto */ +struct __pyx_memoryview_obj; +typedef struct { + struct __pyx_memoryview_obj *memview; + char *data; + Py_ssize_t shape[8]; + Py_ssize_t strides[8]; + Py_ssize_t suboffsets[8]; +} __Pyx_memviewslice; +#define __Pyx_MemoryView_Len(m) (m.shape[0]) + +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __pyx_atomic_int_type int +#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\ + !defined(__i386__) + #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0 + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type LONG + #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 + #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using Intel atomics" + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #warning "Not using atomics" + #endif +#endif +typedef volatile __pyx_atomic_int_type __pyx_atomic_int; +#if CYTHON_ATOMICS + #define __pyx_add_acquisition_count(memview)\ + __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) +#else + #define __pyx_add_acquisition_count(memview)\ + __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) +#endif + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":690 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":691 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":692 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":693 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":697 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":698 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":699 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":700 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":704 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":705 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":714 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":715 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":716 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":718 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":719 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":720 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":722 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":723 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":725 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":726 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":727 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + + +/*--- Type declarations ---*/ +struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast; +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":729 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":730 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":731 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":733 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* "acados_template/acados_ocp_solver_pyx.pyx":50 + * + * + * cdef class AcadosOcpSolverFast: # <<<<<<<<<<<<<< + * """ + * Class to interact with the acados ocp solver C object. + */ +struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast { + PyObject_HEAD + lat_solver_capsule *capsule; + void *nlp_opts; + ocp_nlp_dims *nlp_dims; + ocp_nlp_config *nlp_config; + ocp_nlp_out *nlp_out; + ocp_nlp_in *nlp_in; + ocp_nlp_solver *nlp_solver; + PyObject *model_name; + int N; + int solver_created; +}; + + +/* "View.MemoryView":105 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_array_obj { + PyObject_HEAD + struct __pyx_vtabstruct_array *__pyx_vtab; + char *data; + Py_ssize_t len; + char *format; + int ndim; + Py_ssize_t *_shape; + Py_ssize_t *_strides; + Py_ssize_t itemsize; + PyObject *mode; + PyObject *_format; + void (*callback_free_data)(void *); + int free_data; + int dtype_is_object; +}; + + +/* "View.MemoryView":279 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":330 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ +struct __pyx_memoryview_obj { + PyObject_HEAD + struct __pyx_vtabstruct_memoryview *__pyx_vtab; + PyObject *obj; + PyObject *_size; + PyObject *_array_interface; + PyThread_type_lock lock; + __pyx_atomic_int acquisition_count[2]; + __pyx_atomic_int *acquisition_count_aligned_p; + Py_buffer view; + int flags; + int dtype_is_object; + __Pyx_TypeInfo *typeinfo; +}; + + +/* "View.MemoryView":965 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ +struct __pyx_memoryviewslice_obj { + struct __pyx_memoryview_obj __pyx_base; + __Pyx_memviewslice from_slice; + PyObject *from_object; + PyObject *(*to_object_func)(char *); + int (*to_dtype_func)(char *, PyObject *); +}; + + + +/* "View.MemoryView":105 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_array { + PyObject *(*get_memview)(struct __pyx_array_obj *); +}; +static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; + + +/* "View.MemoryView":330 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ + +struct __pyx_vtabstruct_memoryview { + char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); + PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); +}; +static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; + + +/* "View.MemoryView":965 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ + +struct __pyx_vtabstruct__memoryviewslice { + struct __pyx_vtabstruct_memoryview __pyx_base; +}; +static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if CYTHON_FAST_PYCALL + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif // CYTHON_FAST_PYCALL +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* IsLittleEndian.proto */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); + +/* BufferFormatCheck.proto */ +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* BufferGetAndValidate.proto */ +#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\ + ((obj == Py_None || obj == NULL) ?\ + (__Pyx_ZeroBuffer(buf), 0) :\ + __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)) +static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static void __Pyx_ZeroBuffer(Py_buffer* buf); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); +static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 }; +static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + +/* BufferIndexError.proto */ +static void __Pyx_RaiseBufferIndexError(int axis); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* MemviewSliceInit.proto */ +#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d +#define __Pyx_MEMVIEW_DIRECT 1 +#define __Pyx_MEMVIEW_PTR 2 +#define __Pyx_MEMVIEW_FULL 4 +#define __Pyx_MEMVIEW_CONTIG 8 +#define __Pyx_MEMVIEW_STRIDED 16 +#define __Pyx_MEMVIEW_FOLLOW 32 +#define __Pyx_IS_C_CONTIG 1 +#define __Pyx_IS_F_CONTIG 2 +static int __Pyx_init_memviewslice( + struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference); +static CYTHON_INLINE int __pyx_add_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +static CYTHON_INLINE int __pyx_sub_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) +#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) +#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) +#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) +static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* None.proto */ +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); + +/* UnaryNegOverflows.proto */ +#define UNARY_NEG_WOULD_OVERFLOW(x)\ + (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/ +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* decode_c_string_utf16.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 0; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = -1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} + +/* decode_c_string.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + +/* ListExtend.proto */ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject* none = _PyList_Extend((PyListObject*)L, v); + if (unlikely(!none)) + return -1; + Py_DECREF(none); + return 0; +#else + return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); +#endif +} + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* None.proto */ +static CYTHON_INLINE long __Pyx_div_long(long, long); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +/* BufferStructDeclare.proto */ +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +/* MemviewSliceIsContig.proto */ +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim); + +/* OverlappingSlices.proto */ +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +/* Capsule.proto */ +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +/* GCCDiagnostics.proto */ +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* TypeInfoCompare.proto */ +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +/* MemviewSliceValidateAndInit.proto */ +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *, int writable_flag); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *, int writable_flag); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(PyObject *, int writable_flag); + +/* RealImag.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if defined(__cplusplus) && CYTHON_CCOMPLEX\ + && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_float(a, b) ((a)==(b)) + #define __Pyx_c_sum_float(a, b) ((a)+(b)) + #define __Pyx_c_diff_float(a, b) ((a)-(b)) + #define __Pyx_c_prod_float(a, b) ((a)*(b)) + #define __Pyx_c_quot_float(a, b) ((a)/(b)) + #define __Pyx_c_neg_float(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_float(z) ((z)==(float)0) + #define __Pyx_c_conj_float(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_float(z) (::std::abs(z)) + #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_float(z) ((z)==0) + #define __Pyx_c_conj_float(z) (conjf(z)) + #if 1 + #define __Pyx_c_abs_float(z) (cabsf(z)) + #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_double(a, b) ((a)==(b)) + #define __Pyx_c_sum_double(a, b) ((a)+(b)) + #define __Pyx_c_diff_double(a, b) ((a)-(b)) + #define __Pyx_c_prod_double(a, b) ((a)*(b)) + #define __Pyx_c_quot_double(a, b) ((a)/(b)) + #define __Pyx_c_neg_double(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_double(z) ((z)==(double)0) + #define __Pyx_c_conj_double(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (::std::abs(z)) + #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_double(z) ((z)==0) + #define __Pyx_c_conj_double(z) (conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (cabs(z)) + #define __Pyx_c_pow_double(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +/* MemviewSliceCopyTemplate.proto */ +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/ +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/ +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/ +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ + +/* Module declarations from 'cython.view' */ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'libc' */ + +/* Module declarations from 'acados_solver_common' */ + +/* Module declarations from 'acados_solver' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_generic = 0; +static PyTypeObject *__pyx_ptype_5numpy_number = 0; +static PyTypeObject *__pyx_ptype_5numpy_integer = 0; +static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_inexact = 0; +static PyTypeObject *__pyx_ptype_5numpy_floating = 0; +static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0; +static PyTypeObject *__pyx_ptype_5numpy_flexible = 0; +static PyTypeObject *__pyx_ptype_5numpy_character = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; + +/* Module declarations from 'acados_template.acados_ocp_solver_pyx' */ +static PyTypeObject *__pyx_ptype_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast = 0; +static PyTypeObject *__pyx_array_type = 0; +static PyTypeObject *__pyx_MemviewEnum_type = 0; +static PyTypeObject *__pyx_memoryview_type = 0; +static PyTypeObject *__pyx_memoryviewslice_type = 0; +static PyObject *generic = 0; +static PyObject *strided = 0; +static PyObject *indirect = 0; +static PyObject *contiguous = 0; +static PyObject *indirect_contiguous = 0; +static int __pyx_memoryview_thread_locks_used; +static PyThread_type_lock __pyx_memoryview_thread_locks[8]; +static CYTHON_INLINE PyObject *__Pyx_carray_to_py_int(int *, Py_ssize_t); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_int(int *, Py_ssize_t); /*proto*/ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ +static void *__pyx_align_pointer(void *, size_t); /*proto*/ +static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/ +static PyObject *_unellipsify(PyObject *, int); /*proto*/ +static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/ +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/ +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/ +static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/ +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/ +static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/ +static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/ +static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/ +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/ +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/ +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/ +static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/ +static int __pyx_memoryview_err(PyObject *, char *); /*proto*/ +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/ +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ +static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_char = { "unsigned char", NULL, sizeof(unsigned char), { 0 }, 0, IS_UNSIGNED(unsigned char) ? 'U' : 'I', IS_UNSIGNED(unsigned char), 0 }; +#define __Pyx_MODULE_NAME "acados_template.acados_ocp_solver_pyx" +extern int __pyx_module_is_main_acados_template__acados_ocp_solver_pyx; +int __pyx_module_is_main_acados_template__acados_ocp_solver_pyx = 0; + +/* Implementation of 'acados_template.acados_ocp_solver_pyx' */ +static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_Ellipsis; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_IndexError; +static const char __pyx_k_[] = ""; +static const char __pyx_k_F[] = "F"; +static const char __pyx_k_N[] = "N"; +static const char __pyx_k_O[] = "O"; +static const char __pyx_k_c[] = "c"; +static const char __pyx_k_p[] = "p"; +static const char __pyx_k_t[] = "t"; +static const char __pyx_k_u[] = "u"; +static const char __pyx_k_x[] = "x"; +static const char __pyx_k_z[] = "z"; +static const char __pyx_k__6[] = ", "; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_np[] = "np"; +static const char __pyx_k_os[] = "os"; +static const char __pyx_k_pi[] = "pi"; +static const char __pyx_k_sl[] = "sl"; +static const char __pyx_k_su[] = "su"; +static const char __pyx_k_lam[] = "lam"; +static const char __pyx_k_lbu[] = "lbu"; +static const char __pyx_k_lbx[] = "lbx"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_obj[] = "obj"; +static const char __pyx_k_ubu[] = "ubu"; +static const char __pyx_k_ubx[] = "ubx"; +static const char __pyx_k_base[] = "base"; +static const char __pyx_k_data[] = "data"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_mode[] = "mode"; +static const char __pyx_k_name[] = "name"; +static const char __pyx_k_ndim[] = "ndim"; +static const char __pyx_k_pack[] = "pack"; +static const char __pyx_k_size[] = "size"; +static const char __pyx_k_step[] = "step"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_yref[] = "yref"; +static const char __pyx_k_ASCII[] = "ASCII"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_dtype[] = "dtype"; +static const char __pyx_k_error[] = "error"; +static const char __pyx_k_field[] = "field_"; +static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_order[] = "order"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_shape[] = "shape"; +static const char __pyx_k_stage[] = "stage"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_utf_8[] = "utf-8"; +static const char __pyx_k_value[] = "value_"; +static const char __pyx_k_y_ref[] = "y_ref"; +static const char __pyx_k_zeros[] = "zeros"; +static const char __pyx_k_double[] = "double"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_format[] = "format"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_name_2[] = "__name__"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_struct[] = "struct"; +static const char __pyx_k_tol_eq[] = "tol_eq"; +static const char __pyx_k_unpack[] = "unpack"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_SQP_RTI[] = "SQP_RTI"; +static const char __pyx_k_float64[] = "float64"; +static const char __pyx_k_fortran[] = "fortran"; +static const char __pyx_k_memview[] = "memview"; +static const char __pyx_k_Ellipsis[] = "Ellipsis"; +static const char __pyx_k_filename[] = "filename"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_tol_comp[] = "tol_comp"; +static const char __pyx_k_tol_ineq[] = "tol_ineq"; +static const char __pyx_k_tol_stat[] = "tol_stat"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_alpha_min[] = "alpha_min"; +static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_overwrite[] = "overwrite"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_rti_phase[] = "rti_phase"; +static const char __pyx_k_IndexError[] = "IndexError"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_acados_ocp[] = "acados_ocp"; +static const char __pyx_k_model_name[] = "model_name"; +static const char __pyx_k_pyx_result[] = "__pyx_result"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; +static const char __pyx_k_print_level[] = "print_level"; +static const char __pyx_k_step_length[] = "step_length"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_stringsource[] = "stringsource"; +static const char __pyx_k_globalization[] = "globalization"; +static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_asfortranarray[] = "asfortranarray"; +static const char __pyx_k_solver_options[] = "solver_options"; +static const char __pyx_k_View_MemoryView[] = "View.MemoryView"; +static const char __pyx_k_allocate_buffer[] = "allocate_buffer"; +static const char __pyx_k_alpha_reduction[] = "alpha_reduction"; +static const char __pyx_k_code_export_dir[] = "code_export_dir"; +static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; +static const char __pyx_k_nlp_solver_type[] = "nlp_solver_type"; +static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_strided_and_direct[] = ""; +static const char __pyx_k_AcadosOcpSolverFast[] = "AcadosOcpSolverFast"; +static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; +static const char __pyx_k_initialize_t_slacks[] = "initialize_t_slacks"; +static const char __pyx_k_strided_and_indirect[] = ""; +static const char __pyx_k_contiguous_and_direct[] = ""; +static const char __pyx_k_MemoryView_of_r_object[] = ""; +static const char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; +static const char __pyx_k_contiguous_and_indirect[] = ""; +static const char __pyx_k_with_dimension_you_have[] = "with dimension {} (you have {})"; +static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; +static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; +static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; +static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; +static const char __pyx_k_strided_and_direct_or_indirect[] = ""; +static const char __pyx_k_AcadosOcpSolver_constraints_set[] = "AcadosOcpSolver.constraints_set(): mismatching dimension for field \"{}\" with dimension {} (you have {})"; +static const char __pyx_k_AcadosOcpSolver_get_stage_index[] = "AcadosOcpSolver.get(): stage index must be in [0, N], got: {}."; +static const char __pyx_k_AcadosOcpSolver_set_mismatching[] = "AcadosOcpSolver.set(): mismatching dimension for field \"{}\" "; +static const char __pyx_k_for_field_with_dimension_you_ha[] = " for field \"{}\" with dimension {} (you have {})"; +static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; +static const char __pyx_k_AcadosOcpSolver_cost_set_mismatc[] = "AcadosOcpSolver.cost_set(): mismatching dimension"; +static const char __pyx_k_AcadosOcpSolver_get_field_does_n[] = "AcadosOcpSolver.get(): field {} does not exist at final stage {}."; +static const char __pyx_k_AcadosOcpSolver_get_is_an_invali[] = "AcadosOcpSolver.get(): {} is an invalid argument. \n Possible values are {}. Exiting."; +static const char __pyx_k_AcadosOcpSolver_options_set_does[] = "AcadosOcpSolver.options_set() does not support field {}.\n Possible values are {}."; +static const char __pyx_k_AcadosOcpSolver_set_is_not_a_val[] = "AcadosOcpSolver.set(): {} is not a valid argument. \nPossible values are {}. Exiting."; +static const char __pyx_k_AcadosOcpSolver_solve_argument_r[] = "AcadosOcpSolver.solve(): argument 'rti_phase' can take only values 0, 1, 2 for SQP-RTI-type solvers"; +static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; +static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; +static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview"; +static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview"; +static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))"; +static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; +static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; +static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; +static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; +static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; +static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; +static const char __pyx_k_solver_option_must_be_of_type_fl[] = "solver option {} must be of type float. You have {}."; +static const char __pyx_k_solver_option_must_be_of_type_in[] = "solver option {} must be of type int. You have {}."; +static const char __pyx_k_solver_option_must_be_of_type_st[] = "solver option {} must be of type str. You have {}."; +static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; +static const char __pyx_k_AcadosOcpSolver_solve_argument_r_2[] = "AcadosOcpSolver.solve(): argument 'rti_phase' can take only value 0 for SQP-type solvers"; +static PyObject *__pyx_kp_u_; +static PyObject *__pyx_n_s_ASCII; +static PyObject *__pyx_n_s_AcadosOcpSolverFast; +static PyObject *__pyx_kp_u_AcadosOcpSolver_constraints_set; +static PyObject *__pyx_kp_u_AcadosOcpSolver_cost_set_mismatc; +static PyObject *__pyx_kp_u_AcadosOcpSolver_get_field_does_n; +static PyObject *__pyx_kp_u_AcadosOcpSolver_get_is_an_invali; +static PyObject *__pyx_kp_u_AcadosOcpSolver_get_stage_index; +static PyObject *__pyx_kp_u_AcadosOcpSolver_options_set_does; +static PyObject *__pyx_kp_u_AcadosOcpSolver_set_is_not_a_val; +static PyObject *__pyx_kp_u_AcadosOcpSolver_set_mismatching; +static PyObject *__pyx_kp_u_AcadosOcpSolver_solve_argument_r; +static PyObject *__pyx_kp_u_AcadosOcpSolver_solve_argument_r_2; +static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; +static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; +static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor; +static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi; +static PyObject *__pyx_kp_s_Cannot_index_with_type_s; +static PyObject *__pyx_n_s_Ellipsis; +static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; +static PyObject *__pyx_n_u_F; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; +static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; +static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; +static PyObject *__pyx_kp_s_MemoryView_of_r_object; +static PyObject *__pyx_n_s_N; +static PyObject *__pyx_n_s_NotImplementedError; +static PyObject *__pyx_n_b_O; +static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; +static PyObject *__pyx_n_s_PickleError; +static PyObject *__pyx_n_u_SQP_RTI; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; +static PyObject *__pyx_kp_u__6; +static PyObject *__pyx_n_s_acados_ocp; +static PyObject *__pyx_n_s_allocate_buffer; +static PyObject *__pyx_n_u_alpha_min; +static PyObject *__pyx_n_u_alpha_reduction; +static PyObject *__pyx_n_s_ascontiguousarray; +static PyObject *__pyx_n_s_asfortranarray; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_code_export_dir; +static PyObject *__pyx_kp_s_contiguous_and_direct; +static PyObject *__pyx_kp_s_contiguous_and_indirect; +static PyObject *__pyx_n_s_data; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_double; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dtype_is_object; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_field; +static PyObject *__pyx_n_s_filename; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_kp_u_for_field_with_dimension_you_ha; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_n_u_globalization; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_u_initialize_t_slacks; +static PyObject *__pyx_n_s_itemsize; +static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; +static PyObject *__pyx_n_u_lam; +static PyObject *__pyx_n_u_lbu; +static PyObject *__pyx_n_u_lbx; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_memview; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_model_name; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_nlp_solver_type; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to; +static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_order; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_overwrite; +static PyObject *__pyx_n_u_p; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_u_pi; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_u_print_level; +static PyObject *__pyx_n_s_pyx_PickleError; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_result; +static PyObject *__pyx_n_s_pyx_state; +static PyObject *__pyx_n_s_pyx_type; +static PyObject *__pyx_n_s_pyx_unpickle_Enum; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_reduce_ex; +static PyObject *__pyx_n_u_rti_phase; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_u_sl; +static PyObject *__pyx_kp_u_solver_option_must_be_of_type_fl; +static PyObject *__pyx_kp_u_solver_option_must_be_of_type_in; +static PyObject *__pyx_kp_u_solver_option_must_be_of_type_st; +static PyObject *__pyx_n_s_solver_options; +static PyObject *__pyx_n_s_stage; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_u_step_length; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_kp_s_strided_and_direct; +static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; +static PyObject *__pyx_kp_s_strided_and_indirect; +static PyObject *__pyx_kp_s_stringsource; +static PyObject *__pyx_n_s_struct; +static PyObject *__pyx_n_u_su; +static PyObject *__pyx_n_u_t; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_u_tol_comp; +static PyObject *__pyx_n_u_tol_eq; +static PyObject *__pyx_n_u_tol_ineq; +static PyObject *__pyx_n_u_tol_stat; +static PyObject *__pyx_n_u_u; +static PyObject *__pyx_n_u_ubu; +static PyObject *__pyx_n_u_ubx; +static PyObject *__pyx_kp_s_unable_to_allocate_array_data; +static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; +static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_kp_u_utf_8; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_kp_u_with_dimension_you_have; +static PyObject *__pyx_n_u_x; +static PyObject *__pyx_n_u_y_ref; +static PyObject *__pyx_n_u_yref; +static PyObject *__pyx_n_u_z; +static PyObject *__pyx_n_s_zeros; +static int __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast___cinit__(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, PyObject *__pyx_v_model_name, int __pyx_v_N, CYTHON_UNUSED PyObject *__pyx_v_code_export_dir); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_2solve(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_4set_new_time_steps(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_new_time_steps); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_6get(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_8print_statistics(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_10store_iterate(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_filename, CYTHON_UNUSED PyObject *__pyx_v_overwrite); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_12load_iterate(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_14get_stats(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_field_); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_16get_cost(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_18get_residuals(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_20set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_22cost_set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_24constraints_set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_26dynamics_get(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_28options_set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_30__del__(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */ +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_184977713; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_slice__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_codeobj__34; +/* Late includes */ + +/* "acados_template/acados_ocp_solver_pyx.pyx":71 + * cdef bint solver_created + * + * def __cinit__(self, str model_name, int N, str code_export_dir): # <<<<<<<<<<<<<< + * self.model_name = model_name + * self.N = N + */ + +/* Python wrapper */ +static int __pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_model_name = 0; + int __pyx_v_N; + CYTHON_UNUSED PyObject *__pyx_v_code_export_dir = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_model_name,&__pyx_n_s_N,&__pyx_n_s_code_export_dir,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_model_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(0, 71, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_code_export_dir)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(0, 71, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 71, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_model_name = ((PyObject*)values[0]); + __pyx_v_N = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L3_error) + __pyx_v_code_export_dir = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 71, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_model_name), (&PyUnicode_Type), 1, "model_name", 1))) __PYX_ERR(0, 71, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code_export_dir), (&PyUnicode_Type), 1, "code_export_dir", 1))) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast___cinit__(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_model_name, __pyx_v_N, __pyx_v_code_export_dir); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast___cinit__(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, PyObject *__pyx_v_model_name, int __pyx_v_N, CYTHON_UNUSED PyObject *__pyx_v_code_export_dir) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":72 + * + * def __cinit__(self, str model_name, int N, str code_export_dir): + * self.model_name = model_name # <<<<<<<<<<<<<< + * self.N = N + * + */ + __Pyx_INCREF(__pyx_v_model_name); + __Pyx_GIVEREF(__pyx_v_model_name); + __Pyx_GOTREF(__pyx_v_self->model_name); + __Pyx_DECREF(__pyx_v_self->model_name); + __pyx_v_self->model_name = __pyx_v_model_name; + + /* "acados_template/acados_ocp_solver_pyx.pyx":73 + * def __cinit__(self, str model_name, int N, str code_export_dir): + * self.model_name = model_name + * self.N = N # <<<<<<<<<<<<<< + * + * self.solver_created = False + */ + __pyx_v_self->N = __pyx_v_N; + + /* "acados_template/acados_ocp_solver_pyx.pyx":75 + * self.N = N + * + * self.solver_created = False # <<<<<<<<<<<<<< + * + * # create capsule + */ + __pyx_v_self->solver_created = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":78 + * + * # create capsule + * self.capsule = acados_solver.acados_create_capsule() # <<<<<<<<<<<<<< + * + * # create solver + */ + __pyx_v_self->capsule = lat_acados_create_capsule(); + + /* "acados_template/acados_ocp_solver_pyx.pyx":81 + * + * # create solver + * assert acados_solver.acados_create(self.capsule) == 0 # <<<<<<<<<<<<<< + * self.solver_created = True + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((lat_acados_create(__pyx_v_self->capsule) == 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 81, __pyx_L1_error) + } + } + #endif + + /* "acados_template/acados_ocp_solver_pyx.pyx":82 + * # create solver + * assert acados_solver.acados_create(self.capsule) == 0 + * self.solver_created = True # <<<<<<<<<<<<<< + * + * # get pointers solver + */ + __pyx_v_self->solver_created = 1; + + /* "acados_template/acados_ocp_solver_pyx.pyx":85 + * + * # get pointers solver + * self.nlp_opts = acados_solver.acados_get_nlp_opts(self.capsule) # <<<<<<<<<<<<<< + * self.nlp_dims = acados_solver.acados_get_nlp_dims(self.capsule) + * self.nlp_config = acados_solver.acados_get_nlp_config(self.capsule) + */ + __pyx_v_self->nlp_opts = lat_acados_get_nlp_opts(__pyx_v_self->capsule); + + /* "acados_template/acados_ocp_solver_pyx.pyx":86 + * # get pointers solver + * self.nlp_opts = acados_solver.acados_get_nlp_opts(self.capsule) + * self.nlp_dims = acados_solver.acados_get_nlp_dims(self.capsule) # <<<<<<<<<<<<<< + * self.nlp_config = acados_solver.acados_get_nlp_config(self.capsule) + * self.nlp_out = acados_solver.acados_get_nlp_out(self.capsule) + */ + __pyx_v_self->nlp_dims = lat_acados_get_nlp_dims(__pyx_v_self->capsule); + + /* "acados_template/acados_ocp_solver_pyx.pyx":87 + * self.nlp_opts = acados_solver.acados_get_nlp_opts(self.capsule) + * self.nlp_dims = acados_solver.acados_get_nlp_dims(self.capsule) + * self.nlp_config = acados_solver.acados_get_nlp_config(self.capsule) # <<<<<<<<<<<<<< + * self.nlp_out = acados_solver.acados_get_nlp_out(self.capsule) + * self.nlp_in = acados_solver.acados_get_nlp_in(self.capsule) + */ + __pyx_v_self->nlp_config = lat_acados_get_nlp_config(__pyx_v_self->capsule); + + /* "acados_template/acados_ocp_solver_pyx.pyx":88 + * self.nlp_dims = acados_solver.acados_get_nlp_dims(self.capsule) + * self.nlp_config = acados_solver.acados_get_nlp_config(self.capsule) + * self.nlp_out = acados_solver.acados_get_nlp_out(self.capsule) # <<<<<<<<<<<<<< + * self.nlp_in = acados_solver.acados_get_nlp_in(self.capsule) + * self.nlp_solver = acados_solver.acados_get_nlp_solver(self.capsule) + */ + __pyx_v_self->nlp_out = lat_acados_get_nlp_out(__pyx_v_self->capsule); + + /* "acados_template/acados_ocp_solver_pyx.pyx":89 + * self.nlp_config = acados_solver.acados_get_nlp_config(self.capsule) + * self.nlp_out = acados_solver.acados_get_nlp_out(self.capsule) + * self.nlp_in = acados_solver.acados_get_nlp_in(self.capsule) # <<<<<<<<<<<<<< + * self.nlp_solver = acados_solver.acados_get_nlp_solver(self.capsule) + * + */ + __pyx_v_self->nlp_in = lat_acados_get_nlp_in(__pyx_v_self->capsule); + + /* "acados_template/acados_ocp_solver_pyx.pyx":90 + * self.nlp_out = acados_solver.acados_get_nlp_out(self.capsule) + * self.nlp_in = acados_solver.acados_get_nlp_in(self.capsule) + * self.nlp_solver = acados_solver.acados_get_nlp_solver(self.capsule) # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_self->nlp_solver = lat_acados_get_nlp_solver(__pyx_v_self->capsule); + + /* "acados_template/acados_ocp_solver_pyx.pyx":71 + * cdef bint solver_created + * + * def __cinit__(self, str model_name, int N, str code_export_dir): # <<<<<<<<<<<<<< + * self.model_name = model_name + * self.N = N + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":93 + * + * + * def solve(self): # <<<<<<<<<<<<<< + * """ + * Solve the ocp with current input. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_3solve(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_2solve[] = "\n Solve the ocp with current input.\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_3solve(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("solve (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_2solve(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_2solve(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("solve", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":97 + * Solve the ocp with current input. + * """ + * return acados_solver.acados_solve(self.capsule) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(lat_acados_solve(__pyx_v_self->capsule)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":93 + * + * + * def solve(self): # <<<<<<<<<<<<<< + * """ + * Solve the ocp with current input. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":100 + * + * + * def set_new_time_steps(self, new_time_steps): # <<<<<<<<<<<<<< + * """ + * Set new time steps before solving. Only reload library without code generation but with new time steps. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_5set_new_time_steps(PyObject *__pyx_v_self, PyObject *__pyx_v_new_time_steps); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_4set_new_time_steps[] = "\n Set new time steps before solving. Only reload library without code generation but with new time steps.\n\n :param new_time_steps: vector of new time steps for the solver\n\n .. note:: This allows for different use-cases: either set a new size of time-steps or a new distribution of\n the shooting nodes without changing the number, e.g., to reach a different final time. Both cases\n do not require a new code export and compilation.\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_5set_new_time_steps(PyObject *__pyx_v_self, PyObject *__pyx_v_new_time_steps) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_new_time_steps (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_4set_new_time_steps(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), ((PyObject *)__pyx_v_new_time_steps)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_4set_new_time_steps(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_new_time_steps) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_new_time_steps", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":110 + * do not require a new code export and compilation. + * """ + * raise NotImplementedError() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 110, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":100 + * + * + * def set_new_time_steps(self, new_time_steps): # <<<<<<<<<<<<<< + * """ + * Set new time steps before solving. Only reload library without code generation but with new time steps. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.set_new_time_steps", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":113 + * + * + * def get(self, int stage, str field_): # <<<<<<<<<<<<<< + * """ + * Get the last solution of the solver: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_7get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_6get[] = "\n Get the last solution of the solver:\n\n :param stage: integer corresponding to shooting node\n :param field: string in ['x', 'u', 'z', 'pi', 'lam', 't', 'sl', 'su',]\n\n .. note:: regarding lam, t: \n\n the inequalities are internally organized in the following order: \n\n [ lbu lbx lg lh lphi ubu ubx ug uh uphi; \n\n lsbu lsbx lsg lsh lsphi usbu usbx usg ush usphi]\n\n .. note:: pi: multipliers for dynamics equality constraints \n\n lam: multipliers for inequalities \n\n t: slack variables corresponding to evaluation of all inequalities (at the solution) \n\n sl: slack variables of soft lower inequality constraints \n\n su: slack variables of soft upper inequality constraints \n\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_7get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_stage; + PyObject *__pyx_v_field_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stage,&__pyx_n_s_field,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stage)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get", 1, 2, 2, 1); __PYX_ERR(0, 113, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 113, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_stage = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_stage == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L3_error) + __pyx_v_field_ = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 113, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_), (&PyUnicode_Type), 1, "field_", 1))) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_6get(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_stage, __pyx_v_field_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_6get(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_) { + PyObject *__pyx_v_out_fields = NULL; + PyObject *__pyx_v_field = NULL; + int __pyx_v_dims; + PyArrayObject *__pyx_v_out = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + char const *__pyx_t_10; + PyArrayObject *__pyx_t_11 = NULL; + char const *__pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + + /* "acados_template/acados_ocp_solver_pyx.pyx":132 + * """ + * + * out_fields = ['x', 'u', 'z', 'pi', 'lam', 't', 'sl', 'su'] # <<<<<<<<<<<<<< + * field = field_.encode('utf-8') + * + */ + __pyx_t_1 = PyList_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_x); + __Pyx_GIVEREF(__pyx_n_u_x); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_x); + __Pyx_INCREF(__pyx_n_u_u); + __Pyx_GIVEREF(__pyx_n_u_u); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_u); + __Pyx_INCREF(__pyx_n_u_z); + __Pyx_GIVEREF(__pyx_n_u_z); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_z); + __Pyx_INCREF(__pyx_n_u_pi); + __Pyx_GIVEREF(__pyx_n_u_pi); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_pi); + __Pyx_INCREF(__pyx_n_u_lam); + __Pyx_GIVEREF(__pyx_n_u_lam); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_u_lam); + __Pyx_INCREF(__pyx_n_u_t); + __Pyx_GIVEREF(__pyx_n_u_t); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_u_t); + __Pyx_INCREF(__pyx_n_u_sl); + __Pyx_GIVEREF(__pyx_n_u_sl); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_u_sl); + __Pyx_INCREF(__pyx_n_u_su); + __Pyx_GIVEREF(__pyx_n_u_su); + PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_u_su); + __pyx_v_out_fields = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":133 + * + * out_fields = ['x', 'u', 'z', 'pi', 'lam', 't', 'sl', 'su'] + * field = field_.encode('utf-8') # <<<<<<<<<<<<<< + * + * if field_ not in out_fields: + */ + if (unlikely(__pyx_v_field_ == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 133, __pyx_L1_error) + } + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_field_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_field = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":135 + * field = field_.encode('utf-8') + * + * if field_ not in out_fields: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.get(): {} is an invalid argument.\ + * \n Possible values are {}. Exiting.'.format(field_, out_fields)) + */ + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_v_out_fields, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (unlikely(__pyx_t_3)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":137 + * if field_ not in out_fields: + * raise Exception('AcadosOcpSolver.get(): {} is an invalid argument.\ + * \n Possible values are {}. Exiting.'.format(field_, out_fields)) # <<<<<<<<<<<<<< + * + * if stage < 0 or stage > self.N: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_AcadosOcpSolver_get_is_an_invali, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, __pyx_v_out_fields}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, __pyx_v_out_fields}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_field_); + __Pyx_INCREF(__pyx_v_out_fields); + __Pyx_GIVEREF(__pyx_v_out_fields); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_out_fields); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":136 + * + * if field_ not in out_fields: + * raise Exception('AcadosOcpSolver.get(): {} is an invalid argument.\ # <<<<<<<<<<<<<< + * \n Possible values are {}. Exiting.'.format(field_, out_fields)) + * + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 136, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":135 + * field = field_.encode('utf-8') + * + * if field_ not in out_fields: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.get(): {} is an invalid argument.\ + * \n Possible values are {}. Exiting.'.format(field_, out_fields)) + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":139 + * \n Possible values are {}. Exiting.'.format(field_, out_fields)) + * + * if stage < 0 or stage > self.N: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.get(): stage index must be in [0, N], got: {}.'.format(self.N)) + * + */ + __pyx_t_2 = ((__pyx_v_stage < 0) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_stage > __pyx_v_self->N) != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L5_bool_binop_done:; + if (unlikely(__pyx_t_3)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":140 + * + * if stage < 0 or stage > self.N: + * raise Exception('AcadosOcpSolver.get(): stage index must be in [0, N], got: {}.'.format(self.N)) # <<<<<<<<<<<<<< + * + * if stage == self.N and field_ == 'pi': + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_AcadosOcpSolver_get_stage_index, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 140, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":139 + * \n Possible values are {}. Exiting.'.format(field_, out_fields)) + * + * if stage < 0 or stage > self.N: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.get(): stage index must be in [0, N], got: {}.'.format(self.N)) + * + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":142 + * raise Exception('AcadosOcpSolver.get(): stage index must be in [0, N], got: {}.'.format(self.N)) + * + * if stage == self.N and field_ == 'pi': # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.get(): field {} does not exist at final stage {}.'\ + * .format(field_, stage)) + */ + __pyx_t_2 = ((__pyx_v_stage == __pyx_v_self->N) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_field_, __pyx_n_u_pi, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_2 != 0); + __pyx_t_3 = __pyx_t_8; + __pyx_L8_bool_binop_done:; + if (unlikely(__pyx_t_3)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":144 + * if stage == self.N and field_ == 'pi': + * raise Exception('AcadosOcpSolver.get(): field {} does not exist at final stage {}.'\ + * .format(field_, stage)) # <<<<<<<<<<<<<< + * + * cdef int dims = acados_solver_common.ocp_nlp_dims_get_from_attr(self.nlp_config, + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_AcadosOcpSolver_get_field_does_n, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_stage); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_6, __pyx_v_field_); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_6, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":143 + * + * if stage == self.N and field_ == 'pi': + * raise Exception('AcadosOcpSolver.get(): field {} does not exist at final stage {}.'\ # <<<<<<<<<<<<<< + * .format(field_, stage)) + * + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 143, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":142 + * raise Exception('AcadosOcpSolver.get(): stage index must be in [0, N], got: {}.'.format(self.N)) + * + * if stage == self.N and field_ == 'pi': # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.get(): field {} does not exist at final stage {}.'\ + * .format(field_, stage)) + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":147 + * + * cdef int dims = acados_solver_common.ocp_nlp_dims_get_from_attr(self.nlp_config, + * self.nlp_dims, self.nlp_out, stage, field) # <<<<<<<<<<<<<< + * + * cdef cnp.ndarray[cnp.float64_t, ndim=1] out = np.zeros((dims,)) + */ + __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":146 + * .format(field_, stage)) + * + * cdef int dims = acados_solver_common.ocp_nlp_dims_get_from_attr(self.nlp_config, # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_out, stage, field) + * + */ + __pyx_v_dims = ocp_nlp_dims_get_from_attr(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_out, __pyx_v_stage, __pyx_t_10); + + /* "acados_template/acados_ocp_solver_pyx.pyx":149 + * self.nlp_dims, self.nlp_out, stage, field) + * + * cdef cnp.ndarray[cnp.float64_t, ndim=1] out = np.zeros((dims,)) # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_out_get(self.nlp_config, \ + * self.nlp_dims, self.nlp_out, stage, field, out.data) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_11 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_out.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 149, __pyx_L1_error) + } else {__pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_11 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":151 + * cdef cnp.ndarray[cnp.float64_t, ndim=1] out = np.zeros((dims,)) + * acados_solver_common.ocp_nlp_out_get(self.nlp_config, \ + * self.nlp_dims, self.nlp_out, stage, field, out.data) # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":150 + * + * cdef cnp.ndarray[cnp.float64_t, ndim=1] out = np.zeros((dims,)) + * acados_solver_common.ocp_nlp_out_get(self.nlp_config, \ # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_out, stage, field, out.data) + * + */ + ocp_nlp_out_get(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_out, __pyx_v_stage, __pyx_t_12, ((void *)__pyx_v_out->data)); + + /* "acados_template/acados_ocp_solver_pyx.pyx":153 + * self.nlp_dims, self.nlp_out, stage, field, out.data) + * + * return out # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":113 + * + * + * def get(self, int stage, str field_): # <<<<<<<<<<<<<< + * """ + * Get the last solution of the solver: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_out_fields); + __Pyx_XDECREF(__pyx_v_field); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":156 + * + * + * def print_statistics(self): # <<<<<<<<<<<<<< + * """ + * prints statistics of previous solver run as a table: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_9print_statistics(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_8print_statistics[] = "\n prints statistics of previous solver run as a table:\n - iter: iteration number\n - res_stat: stationarity residual\n - res_eq: residual wrt equality constraints (dynamics)\n - res_ineq: residual wrt inequality constraints (constraints)\n - res_comp: residual wrt complementarity conditions\n - qp_stat: status of QP solver\n - qp_iter: number of QP iterations\n - qp_res_stat: stationarity residual of the last QP solution\n - qp_res_eq: residual wrt equality constraints (dynamics) of the last QP solution\n - qp_res_ineq: residual wrt inequality constraints (constraints) of the last QP solution\n - qp_res_comp: residual wrt complementarity conditions of the last QP solution\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_9print_statistics(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("print_statistics (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_8print_statistics(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_8print_statistics(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("print_statistics", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":171 + * - qp_res_comp: residual wrt complementarity conditions of the last QP solution + * """ + * raise NotImplementedError() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 171, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":156 + * + * + * def print_statistics(self): # <<<<<<<<<<<<<< + * """ + * prints statistics of previous solver run as a table: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.print_statistics", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":174 + * + * + * def store_iterate(self, filename='', overwrite=False): # <<<<<<<<<<<<<< + * """ + * Stores the current iterate of the ocp solver in a json file. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_11store_iterate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_10store_iterate[] = "\n Stores the current iterate of the ocp solver in a json file.\n\n :param filename: if not set, use model_name + timestamp + '.json'\n :param overwrite: if false and filename exists add timestamp to filename\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_11store_iterate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_filename = 0; + CYTHON_UNUSED PyObject *__pyx_v_overwrite = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("store_iterate (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_overwrite,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)__pyx_kp_u_); + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overwrite); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "store_iterate") < 0)) __PYX_ERR(0, 174, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_filename = values[0]; + __pyx_v_overwrite = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("store_iterate", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 174, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.store_iterate", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_10store_iterate(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_filename, __pyx_v_overwrite); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_10store_iterate(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_filename, CYTHON_UNUSED PyObject *__pyx_v_overwrite) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("store_iterate", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":181 + * :param overwrite: if false and filename exists add timestamp to filename + * """ + * raise NotImplementedError() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 181, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":174 + * + * + * def store_iterate(self, filename='', overwrite=False): # <<<<<<<<<<<<<< + * """ + * Stores the current iterate of the ocp solver in a json file. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.store_iterate", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":184 + * + * + * def load_iterate(self, filename): # <<<<<<<<<<<<<< + * """ + * Loads the iterate stored in json file with filename into the ocp solver. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_13load_iterate(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_12load_iterate[] = "\n Loads the iterate stored in json file with filename into the ocp solver.\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_13load_iterate(PyObject *__pyx_v_self, PyObject *__pyx_v_filename) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("load_iterate (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_12load_iterate(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), ((PyObject *)__pyx_v_filename)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_12load_iterate(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_filename) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("load_iterate", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":188 + * Loads the iterate stored in json file with filename into the ocp solver. + * """ + * raise NotImplementedError() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 188, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":184 + * + * + * def load_iterate(self, filename): # <<<<<<<<<<<<<< + * """ + * Loads the iterate stored in json file with filename into the ocp solver. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.load_iterate", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":191 + * + * + * def get_stats(self, field_): # <<<<<<<<<<<<<< + * """ + * Get the information of the last solver call. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_15get_stats(PyObject *__pyx_v_self, PyObject *__pyx_v_field_); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_14get_stats[] = "\n Get the information of the last solver call.\n\n :param field: string in ['statistics', 'time_tot', 'time_lin', 'time_sim', 'time_sim_ad', 'time_sim_la', 'time_qp', 'time_qp_solver_call', 'time_reg', 'sqp_iter']\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_15get_stats(PyObject *__pyx_v_self, PyObject *__pyx_v_field_) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_stats (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_14get_stats(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), ((PyObject *)__pyx_v_field_)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_14get_stats(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_field_) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_stats", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":197 + * :param field: string in ['statistics', 'time_tot', 'time_lin', 'time_sim', 'time_sim_ad', 'time_sim_la', 'time_qp', 'time_qp_solver_call', 'time_reg', 'sqp_iter'] + * """ + * raise NotImplementedError() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 197, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":191 + * + * + * def get_stats(self, field_): # <<<<<<<<<<<<<< + * """ + * Get the information of the last solver call. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.get_stats", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":200 + * + * + * def get_cost(self): # <<<<<<<<<<<<<< + * """ + * Returns the cost value of the current solution. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_17get_cost(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_16get_cost[] = "\n Returns the cost value of the current solution.\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_17get_cost(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_cost (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_16get_cost(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_16get_cost(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self) { + double __pyx_v_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_cost", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":205 + * """ + * # compute cost internally + * acados_solver_common.ocp_nlp_eval_cost(self.nlp_solver, self.nlp_in, self.nlp_out) # <<<<<<<<<<<<<< + * + * # create output + */ + ocp_nlp_eval_cost(__pyx_v_self->nlp_solver, __pyx_v_self->nlp_in, __pyx_v_self->nlp_out); + + /* "acados_template/acados_ocp_solver_pyx.pyx":211 + * + * # call getter + * acados_solver_common.ocp_nlp_get(self.nlp_config, self.nlp_solver, "cost_value", &out) # <<<<<<<<<<<<<< + * + * return out + */ + ocp_nlp_get(__pyx_v_self->nlp_config, __pyx_v_self->nlp_solver, ((char const *)"cost_value"), ((void *)(&__pyx_v_out))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":213 + * acados_solver_common.ocp_nlp_get(self.nlp_config, self.nlp_solver, "cost_value", &out) + * + * return out # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":200 + * + * + * def get_cost(self): # <<<<<<<<<<<<<< + * """ + * Returns the cost value of the current solution. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.get_cost", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":216 + * + * + * def get_residuals(self): # <<<<<<<<<<<<<< + * """ + * Returns an array of the form [res_stat, res_eq, res_ineq, res_comp]. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_19get_residuals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_18get_residuals[] = "\n Returns an array of the form [res_stat, res_eq, res_ineq, res_comp].\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_19get_residuals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_residuals (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_18get_residuals(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_18get_residuals(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_residuals", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":220 + * Returns an array of the form [res_stat, res_eq, res_ineq, res_comp]. + * """ + * raise NotImplementedError() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 220, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":216 + * + * + * def get_residuals(self): # <<<<<<<<<<<<<< + * """ + * Returns an array of the form [res_stat, res_eq, res_ineq, res_comp]. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.get_residuals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":224 + * + * # Note: this function should not be used anymore, better use cost_set, constraints_set + * def set(self, int stage, str field_, value_): # <<<<<<<<<<<<<< + * + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_21set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_20set[] = "\n Set numerical data inside the solver.\n\n :param stage: integer corresponding to shooting node\n :param field: string in ['x', 'u', 'pi', 'lam', 't', 'p']\n\n .. note:: regarding lam, t: \n\n the inequalities are internally organized in the following order: \n\n [ lbu lbx lg lh lphi ubu ubx ug uh uphi; \n\n lsbu lsbx lsg lsh lsphi usbu usbx usg ush usphi]\n\n .. note:: pi: multipliers for dynamics equality constraints \n\n lam: multipliers for inequalities \n\n t: slack variables corresponding to evaluation of all inequalities (at the solution) \n\n sl: slack variables of soft lower inequality constraints \n\n su: slack variables of soft upper inequality constraints \n\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_21set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_stage; + PyObject *__pyx_v_field_ = 0; + PyObject *__pyx_v_value_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stage,&__pyx_n_s_field,&__pyx_n_s_value,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stage)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set", 1, 3, 3, 1); __PYX_ERR(0, 224, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set", 1, 3, 3, 2); __PYX_ERR(0, 224, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 224, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_stage = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_stage == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L3_error) + __pyx_v_field_ = ((PyObject*)values[1]); + __pyx_v_value_ = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 224, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_), (&PyUnicode_Type), 1, "field_", 1))) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_20set(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_stage, __pyx_v_field_, __pyx_v_value_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_20set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_) { + PyObject *__pyx_v_cost_fields = NULL; + PyObject *__pyx_v_constraints_fields = NULL; + PyObject *__pyx_v_out_fields = NULL; + PyObject *__pyx_v_field = NULL; + __Pyx_memviewslice __pyx_v_value = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_dims = NULL; + PyObject *__pyx_v_msg = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + char const *__pyx_t_11; + char const *__pyx_t_12; + char const *__pyx_t_13; + char const *__pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":243 + * su: slack variables of soft upper inequality constraints \n + * """ + * cost_fields = ['y_ref', 'yref'] # <<<<<<<<<<<<<< + * constraints_fields = ['lbx', 'ubx', 'lbu', 'ubu'] + * out_fields = ['x', 'u', 'pi', 'lam', 't', 'z', 'sl', 'su'] + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_y_ref); + __Pyx_GIVEREF(__pyx_n_u_y_ref); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_y_ref); + __Pyx_INCREF(__pyx_n_u_yref); + __Pyx_GIVEREF(__pyx_n_u_yref); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_yref); + __pyx_v_cost_fields = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":244 + * """ + * cost_fields = ['y_ref', 'yref'] + * constraints_fields = ['lbx', 'ubx', 'lbu', 'ubu'] # <<<<<<<<<<<<<< + * out_fields = ['x', 'u', 'pi', 'lam', 't', 'z', 'sl', 'su'] + * + */ + __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_lbx); + __Pyx_GIVEREF(__pyx_n_u_lbx); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_lbx); + __Pyx_INCREF(__pyx_n_u_ubx); + __Pyx_GIVEREF(__pyx_n_u_ubx); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_ubx); + __Pyx_INCREF(__pyx_n_u_lbu); + __Pyx_GIVEREF(__pyx_n_u_lbu); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_lbu); + __Pyx_INCREF(__pyx_n_u_ubu); + __Pyx_GIVEREF(__pyx_n_u_ubu); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_ubu); + __pyx_v_constraints_fields = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":245 + * cost_fields = ['y_ref', 'yref'] + * constraints_fields = ['lbx', 'ubx', 'lbu', 'ubu'] + * out_fields = ['x', 'u', 'pi', 'lam', 't', 'z', 'sl', 'su'] # <<<<<<<<<<<<<< + * + * field = field_.encode('utf-8') + */ + __pyx_t_1 = PyList_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_x); + __Pyx_GIVEREF(__pyx_n_u_x); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_x); + __Pyx_INCREF(__pyx_n_u_u); + __Pyx_GIVEREF(__pyx_n_u_u); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_u); + __Pyx_INCREF(__pyx_n_u_pi); + __Pyx_GIVEREF(__pyx_n_u_pi); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_pi); + __Pyx_INCREF(__pyx_n_u_lam); + __Pyx_GIVEREF(__pyx_n_u_lam); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_lam); + __Pyx_INCREF(__pyx_n_u_t); + __Pyx_GIVEREF(__pyx_n_u_t); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_u_t); + __Pyx_INCREF(__pyx_n_u_z); + __Pyx_GIVEREF(__pyx_n_u_z); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_u_z); + __Pyx_INCREF(__pyx_n_u_sl); + __Pyx_GIVEREF(__pyx_n_u_sl); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_u_sl); + __Pyx_INCREF(__pyx_n_u_su); + __Pyx_GIVEREF(__pyx_n_u_su); + PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_u_su); + __pyx_v_out_fields = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":247 + * out_fields = ['x', 'u', 'pi', 'lam', 't', 'z', 'sl', 'su'] + * + * field = field_.encode('utf-8') # <<<<<<<<<<<<<< + * + * cdef double[::1] value + */ + if (unlikely(__pyx_v_field_ == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 247, __pyx_L1_error) + } + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_field_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_field = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":252 + * + * # treat parameters separately + * if field_ == 'p': # <<<<<<<<<<<<<< + * value = np.ascontiguousarray(value_, dtype=np.double) + * assert acados_solver.acados_update_params(self.capsule, stage, &value[0], value.shape[0]) == 0 + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_field_, __pyx_n_u_p, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":253 + * # treat parameters separately + * if field_ == 'p': + * value = np.ascontiguousarray(value_, dtype=np.double) # <<<<<<<<<<<<<< + * assert acados_solver.acados_update_params(self.capsule, stage, &value[0], value.shape[0]) == 0 + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_value_); + __Pyx_GIVEREF(__pyx_v_value_); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value_); + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_value = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "acados_template/acados_ocp_solver_pyx.pyx":254 + * if field_ == 'p': + * value = np.ascontiguousarray(value_, dtype=np.double) + * assert acados_solver.acados_update_params(self.capsule, stage, &value[0], value.shape[0]) == 0 # <<<<<<<<<<<<<< + * else: + * if field_ not in constraints_fields + cost_fields + out_fields: + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_9 = 0; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_v_value.shape[0]; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_v_value.shape[0])) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + __PYX_ERR(0, 254, __pyx_L1_error) + } + if (unlikely(!((lat_acados_update_params(__pyx_v_self->capsule, __pyx_v_stage, ((double *)(&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_value.data) + __pyx_t_9)) ))))), (__pyx_v_value.shape[0])) == 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 254, __pyx_L1_error) + } + } + #endif + + /* "acados_template/acados_ocp_solver_pyx.pyx":252 + * + * # treat parameters separately + * if field_ == 'p': # <<<<<<<<<<<<<< + * value = np.ascontiguousarray(value_, dtype=np.double) + * assert acados_solver.acados_update_params(self.capsule, stage, &value[0], value.shape[0]) == 0 + */ + goto __pyx_L3; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":256 + * assert acados_solver.acados_update_params(self.capsule, stage, &value[0], value.shape[0]) == 0 + * else: + * if field_ not in constraints_fields + cost_fields + out_fields: # <<<<<<<<<<<<<< + * raise Exception("AcadosOcpSolver.set(): {} is not a valid argument.\ + * \nPossible values are {}. Exiting.".format(field, \ + */ + /*else*/ { + __pyx_t_7 = PyNumber_Add(__pyx_v_constraints_fields, __pyx_v_cost_fields); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyNumber_Add(__pyx_t_7, __pyx_v_out_fields); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_t_5, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (unlikely(__pyx_t_2)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":258 + * if field_ not in constraints_fields + cost_fields + out_fields: + * raise Exception("AcadosOcpSolver.set(): {} is not a valid argument.\ + * \nPossible values are {}. Exiting.".format(field, \ # <<<<<<<<<<<<<< + * constraints_fields + cost_fields + out_fields + ['p'])) + * + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_AcadosOcpSolver_set_is_not_a_val, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "acados_template/acados_ocp_solver_pyx.pyx":259 + * raise Exception("AcadosOcpSolver.set(): {} is not a valid argument.\ + * \nPossible values are {}. Exiting.".format(field, \ + * constraints_fields + cost_fields + out_fields + ['p'])) # <<<<<<<<<<<<<< + * + * dims = acados_solver_common.ocp_nlp_dims_get_from_attr(self.nlp_config, + */ + __pyx_t_1 = PyNumber_Add(__pyx_v_constraints_fields, __pyx_v_cost_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_v_out_fields); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_p); + __Pyx_GIVEREF(__pyx_n_u_p); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_p); + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_10 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_field, __pyx_t_6}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_field, __pyx_t_6}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_1) { + __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL; + } + __Pyx_INCREF(__pyx_v_field); + __Pyx_GIVEREF(__pyx_v_field); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_10, __pyx_v_field); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_10, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":257 + * else: + * if field_ not in constraints_fields + cost_fields + out_fields: + * raise Exception("AcadosOcpSolver.set(): {} is not a valid argument.\ # <<<<<<<<<<<<<< + * \nPossible values are {}. Exiting.".format(field, \ + * constraints_fields + cost_fields + out_fields + ['p'])) + */ + __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 257, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":256 + * assert acados_solver.acados_update_params(self.capsule, stage, &value[0], value.shape[0]) == 0 + * else: + * if field_ not in constraints_fields + cost_fields + out_fields: # <<<<<<<<<<<<<< + * raise Exception("AcadosOcpSolver.set(): {} is not a valid argument.\ + * \nPossible values are {}. Exiting.".format(field, \ + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":262 + * + * dims = acados_solver_common.ocp_nlp_dims_get_from_attr(self.nlp_config, + * self.nlp_dims, self.nlp_out, stage, field) # <<<<<<<<<<<<<< + * + * if value_.shape[0] != dims: + */ + __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":261 + * constraints_fields + cost_fields + out_fields + ['p'])) + * + * dims = acados_solver_common.ocp_nlp_dims_get_from_attr(self.nlp_config, # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_out, stage, field) + * + */ + __pyx_t_7 = __Pyx_PyInt_From_int(ocp_nlp_dims_get_from_attr(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_out, __pyx_v_stage, __pyx_t_11)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_v_dims = __pyx_t_7; + __pyx_t_7 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":264 + * self.nlp_dims, self.nlp_out, stage, field) + * + * if value_.shape[0] != dims: # <<<<<<<<<<<<<< + * msg = 'AcadosOcpSolver.set(): mismatching dimension for field "{}" '.format(field_) + * msg += 'with dimension {} (you have {})'.format(dims, value_.shape[0]) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_v_dims, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__pyx_t_2)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":265 + * + * if value_.shape[0] != dims: + * msg = 'AcadosOcpSolver.set(): mismatching dimension for field "{}" '.format(field_) # <<<<<<<<<<<<<< + * msg += 'with dimension {} (you have {})'.format(dims, value_.shape[0]) + * raise Exception(msg) + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_AcadosOcpSolver_set_mismatching, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_field_) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_field_); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_msg = __pyx_t_7; + __pyx_t_7 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":266 + * if value_.shape[0] != dims: + * msg = 'AcadosOcpSolver.set(): mismatching dimension for field "{}" '.format(field_) + * msg += 'with dimension {} (you have {})'.format(dims, value_.shape[0]) # <<<<<<<<<<<<<< + * raise Exception(msg) + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_with_dimension_you_have, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_10 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_dims, __pyx_t_6}; + __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_dims, __pyx_t_6}; + __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_1 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_dims); + __Pyx_GIVEREF(__pyx_v_dims); + PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_10, __pyx_v_dims); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_10, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_5); + __pyx_t_5 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":267 + * msg = 'AcadosOcpSolver.set(): mismatching dimension for field "{}" '.format(field_) + * msg += 'with dimension {} (you have {})'.format(dims, value_.shape[0]) + * raise Exception(msg) # <<<<<<<<<<<<<< + * + * value = np.ascontiguousarray(value_, dtype=np.double) + */ + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_v_msg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 267, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":264 + * self.nlp_dims, self.nlp_out, stage, field) + * + * if value_.shape[0] != dims: # <<<<<<<<<<<<<< + * msg = 'AcadosOcpSolver.set(): mismatching dimension for field "{}" '.format(field_) + * msg += 'with dimension {} (you have {})'.format(dims, value_.shape[0]) + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":269 + * raise Exception(msg) + * + * value = np.ascontiguousarray(value_, dtype=np.double) # <<<<<<<<<<<<<< + * if field_ in constraints_fields: + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_value_); + __Pyx_GIVEREF(__pyx_v_value_); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_value_); + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_value = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "acados_template/acados_ocp_solver_pyx.pyx":270 + * + * value = np.ascontiguousarray(value_, dtype=np.double) + * if field_ in constraints_fields: # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + */ + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_v_constraints_fields, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":272 + * if field_ in constraints_fields: + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) # <<<<<<<<<<<<<< + * elif field_ in cost_fields: + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, + */ + __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_9 = 0; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_v_value.shape[0]; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_v_value.shape[0])) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + __PYX_ERR(0, 272, __pyx_L1_error) + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":271 + * value = np.ascontiguousarray(value_, dtype=np.double) + * if field_ in constraints_fields: + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in cost_fields: + */ + (void)(ocp_nlp_constraints_model_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_in, __pyx_v_stage, __pyx_t_12, ((void *)(&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_value.data) + __pyx_t_9)) ))))))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":270 + * + * value = np.ascontiguousarray(value_, dtype=np.double) + * if field_ in constraints_fields: # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + */ + goto __pyx_L6; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":273 + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in cost_fields: # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + */ + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_v_cost_fields, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":275 + * elif field_ in cost_fields: + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) # <<<<<<<<<<<<<< + * elif field_ in out_fields: + * acados_solver_common.ocp_nlp_out_set(self.nlp_config, + */ + __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_9 = 0; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_v_value.shape[0]; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_v_value.shape[0])) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + __PYX_ERR(0, 275, __pyx_L1_error) + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":274 + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in cost_fields: + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in out_fields: + */ + (void)(ocp_nlp_cost_model_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_in, __pyx_v_stage, __pyx_t_13, ((void *)(&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_value.data) + __pyx_t_9)) ))))))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":273 + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in cost_fields: # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + */ + goto __pyx_L6; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":276 + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in out_fields: # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_out_set(self.nlp_config, + * self.nlp_dims, self.nlp_out, stage, field, &value[0]) + */ + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_v_out_fields, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":278 + * elif field_ in out_fields: + * acados_solver_common.ocp_nlp_out_set(self.nlp_config, + * self.nlp_dims, self.nlp_out, stage, field, &value[0]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_14 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_9 = 0; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_v_value.shape[0]; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_v_value.shape[0])) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + __PYX_ERR(0, 278, __pyx_L1_error) + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":277 + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in out_fields: + * acados_solver_common.ocp_nlp_out_set(self.nlp_config, # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_out, stage, field, &value[0]) + * + */ + ocp_nlp_out_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_out, __pyx_v_stage, __pyx_t_14, ((void *)(&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_value.data) + __pyx_t_9)) )))))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":276 + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in out_fields: # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_out_set(self.nlp_config, + * self.nlp_dims, self.nlp_out, stage, field, &value[0]) + */ + } + __pyx_L6:; + } + __pyx_L3:; + + /* "acados_template/acados_ocp_solver_pyx.pyx":224 + * + * # Note: this function should not be used anymore, better use cost_set, constraints_set + * def set(self, int stage, str field_, value_): # <<<<<<<<<<<<<< + * + * """ + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cost_fields); + __Pyx_XDECREF(__pyx_v_constraints_fields); + __Pyx_XDECREF(__pyx_v_out_fields); + __Pyx_XDECREF(__pyx_v_field); + __PYX_XDEC_MEMVIEW(&__pyx_v_value, 1); + __Pyx_XDECREF(__pyx_v_dims); + __Pyx_XDECREF(__pyx_v_msg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":281 + * + * + * def cost_set(self, int stage, str field_, value_): # <<<<<<<<<<<<<< + * """ + * Set numerical data in the cost module of the solver. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_23cost_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_22cost_set[] = "\n Set numerical data in the cost module of the solver.\n\n :param stage: integer corresponding to shooting node\n :param field: string, e.g. 'yref', 'W', 'ext_cost_num_hess'\n :param value: of appropriate size\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_23cost_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_stage; + PyObject *__pyx_v_field_ = 0; + PyObject *__pyx_v_value_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cost_set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stage,&__pyx_n_s_field,&__pyx_n_s_value,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stage)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cost_set", 1, 3, 3, 1); __PYX_ERR(0, 281, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cost_set", 1, 3, 3, 2); __PYX_ERR(0, 281, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cost_set") < 0)) __PYX_ERR(0, 281, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_stage = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_stage == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L3_error) + __pyx_v_field_ = ((PyObject*)values[1]); + __pyx_v_value_ = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cost_set", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 281, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.cost_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_), (&PyUnicode_Type), 1, "field_", 1))) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_22cost_set(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_stage, __pyx_v_field_, __pyx_v_value_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_22cost_set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_) { + PyObject *__pyx_v_field = NULL; + int __pyx_v_dims[2]; + __Pyx_memviewslice __pyx_v_value = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_value_shape = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + char const *__pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cost_set", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":289 + * :param value: of appropriate size + * """ + * field = field_.encode('utf-8') # <<<<<<<<<<<<<< + * + * cdef int dims[2] + */ + if (unlikely(__pyx_v_field_ == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 289, __pyx_L1_error) + } + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_field_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_field = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":293 + * cdef int dims[2] + * acados_solver_common.ocp_nlp_cost_dims_get_from_attr(self.nlp_config, \ + * self.nlp_dims, self.nlp_out, stage, field, &dims[0]) # <<<<<<<<<<<<<< + * + * cdef double[::1,:] value + */ + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":292 + * + * cdef int dims[2] + * acados_solver_common.ocp_nlp_cost_dims_get_from_attr(self.nlp_config, \ # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_out, stage, field, &dims[0]) + * + */ + ocp_nlp_cost_dims_get_from_attr(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_out, __pyx_v_stage, __pyx_t_2, (&(__pyx_v_dims[0]))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":297 + * cdef double[::1,:] value + * + * value_shape = value_.shape # <<<<<<<<<<<<<< + * if len(value_shape) == 1: + * value_shape = (value_shape[0], 0) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_value_shape = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":298 + * + * value_shape = value_.shape + * if len(value_shape) == 1: # <<<<<<<<<<<<<< + * value_shape = (value_shape[0], 0) + * value = np.asfortranarray(value_[None,:]) + */ + __pyx_t_3 = PyObject_Length(__pyx_v_value_shape); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 == 1) != 0); + if (__pyx_t_4) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":299 + * value_shape = value_.shape + * if len(value_shape) == 1: + * value_shape = (value_shape[0], 0) # <<<<<<<<<<<<<< + * value = np.asfortranarray(value_[None,:]) + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_value_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0); + __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_value_shape, __pyx_t_5); + __pyx_t_5 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":300 + * if len(value_shape) == 1: + * value_shape = (value_shape[0], 0) + * value = np.asfortranarray(value_[None,:]) # <<<<<<<<<<<<<< + * + * elif len(value_shape) == 2: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_value_, __pyx_tuple__3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_value = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "acados_template/acados_ocp_solver_pyx.pyx":298 + * + * value_shape = value_.shape + * if len(value_shape) == 1: # <<<<<<<<<<<<<< + * value_shape = (value_shape[0], 0) + * value = np.asfortranarray(value_[None,:]) + */ + goto __pyx_L3; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":302 + * value = np.asfortranarray(value_[None,:]) + * + * elif len(value_shape) == 2: # <<<<<<<<<<<<<< + * # Get elements in column major order + * value = np.asfortranarray(value_) + */ + __pyx_t_3 = PyObject_Length(__pyx_v_value_shape); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 == 2) != 0); + if (__pyx_t_4) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":304 + * elif len(value_shape) == 2: + * # Get elements in column major order + * value = np.asfortranarray(value_) # <<<<<<<<<<<<<< + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_value_) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_value_); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_value = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "acados_template/acados_ocp_solver_pyx.pyx":302 + * value = np.asfortranarray(value_[None,:]) + * + * elif len(value_shape) == 2: # <<<<<<<<<<<<<< + * # Get elements in column major order + * value = np.asfortranarray(value_) + */ + } + __pyx_L3:; + + /* "acados_template/acados_ocp_solver_pyx.pyx":306 + * value = np.asfortranarray(value_) + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.cost_set(): mismatching dimension', \ + * ' for field "{}" with dimension {} (you have {})'.format( \ + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_value_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_dims[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_9) { + } else { + __pyx_t_4 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_value_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_dims[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __pyx_t_9; + __pyx_L5_bool_binop_done:; + if (unlikely(__pyx_t_4)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":308 + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: + * raise Exception('AcadosOcpSolver.cost_set(): mismatching dimension', \ + * ' for field "{}" with dimension {} (you have {})'.format( \ # <<<<<<<<<<<<<< + * field_, tuple(dims), value_shape)) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_for_field_with_dimension_you_ha, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "acados_template/acados_ocp_solver_pyx.pyx":309 + * raise Exception('AcadosOcpSolver.cost_set(): mismatching dimension', \ + * ' for field "{}" with dimension {} (you have {})'.format( \ + * field_, tuple(dims), value_shape)) # <<<<<<<<<<<<<< + * + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, \ + */ + __pyx_t_6 = __Pyx_carray_to_py_int(__pyx_v_dims, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_10 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_field_, __pyx_t_7, __pyx_v_value_shape}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_field_, __pyx_t_7, __pyx_v_value_shape}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + { + __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_field_); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_7); + __Pyx_INCREF(__pyx_v_value_shape); + __Pyx_GIVEREF(__pyx_v_value_shape); + PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_v_value_shape); + __pyx_t_7 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":307 + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: + * raise Exception('AcadosOcpSolver.cost_set(): mismatching dimension', \ # <<<<<<<<<<<<<< + * ' for field "{}" with dimension {} (you have {})'.format( \ + * field_, tuple(dims), value_shape)) + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_kp_u_AcadosOcpSolver_cost_set_mismatc); + __Pyx_GIVEREF(__pyx_kp_u_AcadosOcpSolver_cost_set_mismatc); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_AcadosOcpSolver_cost_set_mismatc); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 307, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":306 + * value = np.asfortranarray(value_) + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.cost_set(): mismatching dimension', \ + * ' for field "{}" with dimension {} (you have {})'.format( \ + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":312 + * + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, \ + * self.nlp_dims, self.nlp_in, stage, field, &value[0][0]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) + if (unlikely(!__pyx_v_value.memview)) { __Pyx_RaiseUnboundLocalError("value"); __PYX_ERR(0, 312, __pyx_L1_error) } + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_v_value.shape[0]; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_v_value.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_v_value.shape[1]; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_14 >= __pyx_v_value.shape[1])) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + __PYX_ERR(0, 312, __pyx_L1_error) + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":311 + * field_, tuple(dims), value_shape)) + * + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, \ # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_in, stage, field, &value[0][0]) + * + */ + (void)(ocp_nlp_cost_model_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_in, __pyx_v_stage, __pyx_t_12, ((void *)(&(*((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_value.data) + __pyx_t_13)) ) + __pyx_t_14 * __pyx_v_value.strides[1]) ))))))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":281 + * + * + * def cost_set(self, int stage, str field_, value_): # <<<<<<<<<<<<<< + * """ + * Set numerical data in the cost module of the solver. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.cost_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_field); + __PYX_XDEC_MEMVIEW(&__pyx_v_value, 1); + __Pyx_XDECREF(__pyx_v_value_shape); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":315 + * + * + * def constraints_set(self, int stage, str field_, value_): # <<<<<<<<<<<<<< + * """ + * Set numerical data in the constraint module of the solver. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_25constraints_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_24constraints_set[] = "\n Set numerical data in the constraint module of the solver.\n\n :param stage: integer corresponding to shooting node\n :param field: string in ['lbx', 'ubx', 'lbu', 'ubu', 'lg', 'ug', 'lh', 'uh', 'uphi', 'C', 'D']\n :param value: of appropriate size\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_25constraints_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_stage; + PyObject *__pyx_v_field_ = 0; + PyObject *__pyx_v_value_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("constraints_set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stage,&__pyx_n_s_field,&__pyx_n_s_value,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stage)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("constraints_set", 1, 3, 3, 1); __PYX_ERR(0, 315, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("constraints_set", 1, 3, 3, 2); __PYX_ERR(0, 315, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "constraints_set") < 0)) __PYX_ERR(0, 315, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_stage = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_stage == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L3_error) + __pyx_v_field_ = ((PyObject*)values[1]); + __pyx_v_value_ = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("constraints_set", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 315, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.constraints_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_), (&PyUnicode_Type), 1, "field_", 1))) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_24constraints_set(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_stage, __pyx_v_field_, __pyx_v_value_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_24constraints_set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_) { + PyObject *__pyx_v_field = NULL; + int __pyx_v_dims[2]; + __Pyx_memviewslice __pyx_v_value = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_value_shape = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + char const *__pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("constraints_set", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":323 + * :param value: of appropriate size + * """ + * field = field_.encode('utf-8') # <<<<<<<<<<<<<< + * + * cdef int dims[2] + */ + if (unlikely(__pyx_v_field_ == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 323, __pyx_L1_error) + } + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_field_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_field = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":327 + * cdef int dims[2] + * acados_solver_common.ocp_nlp_constraint_dims_get_from_attr(self.nlp_config, \ + * self.nlp_dims, self.nlp_out, stage, field, &dims[0]) # <<<<<<<<<<<<<< + * + * cdef double[::1,:] value + */ + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 327, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":326 + * + * cdef int dims[2] + * acados_solver_common.ocp_nlp_constraint_dims_get_from_attr(self.nlp_config, \ # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_out, stage, field, &dims[0]) + * + */ + ocp_nlp_constraint_dims_get_from_attr(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_out, __pyx_v_stage, __pyx_t_2, (&(__pyx_v_dims[0]))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":331 + * cdef double[::1,:] value + * + * value_shape = value_.shape # <<<<<<<<<<<<<< + * if len(value_shape) == 1: + * value_shape = (value_shape[0], 0) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_value_shape = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":332 + * + * value_shape = value_.shape + * if len(value_shape) == 1: # <<<<<<<<<<<<<< + * value_shape = (value_shape[0], 0) + * value = np.asfortranarray(value_[None,:]) + */ + __pyx_t_3 = PyObject_Length(__pyx_v_value_shape); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 == 1) != 0); + if (__pyx_t_4) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":333 + * value_shape = value_.shape + * if len(value_shape) == 1: + * value_shape = (value_shape[0], 0) # <<<<<<<<<<<<<< + * value = np.asfortranarray(value_[None,:]) + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_value_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0); + __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_value_shape, __pyx_t_5); + __pyx_t_5 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":334 + * if len(value_shape) == 1: + * value_shape = (value_shape[0], 0) + * value = np.asfortranarray(value_[None,:]) # <<<<<<<<<<<<<< + * + * elif len(value_shape) == 2: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_value_, __pyx_tuple__3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_value = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "acados_template/acados_ocp_solver_pyx.pyx":332 + * + * value_shape = value_.shape + * if len(value_shape) == 1: # <<<<<<<<<<<<<< + * value_shape = (value_shape[0], 0) + * value = np.asfortranarray(value_[None,:]) + */ + goto __pyx_L3; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":336 + * value = np.asfortranarray(value_[None,:]) + * + * elif len(value_shape) == 2: # <<<<<<<<<<<<<< + * # Get elements in column major order + * value = np.asfortranarray(value_) + */ + __pyx_t_3 = PyObject_Length(__pyx_v_value_shape); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 == 2) != 0); + if (__pyx_t_4) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":338 + * elif len(value_shape) == 2: + * # Get elements in column major order + * value = np.asfortranarray(value_) # <<<<<<<<<<<<<< + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_value_) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_value_); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_value = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "acados_template/acados_ocp_solver_pyx.pyx":336 + * value = np.asfortranarray(value_[None,:]) + * + * elif len(value_shape) == 2: # <<<<<<<<<<<<<< + * # Get elements in column major order + * value = np.asfortranarray(value_) + */ + } + __pyx_L3:; + + /* "acados_template/acados_ocp_solver_pyx.pyx":340 + * value = np.asfortranarray(value_) + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.constraints_set(): mismatching dimension' \ + * ' for field "{}" with dimension {} (you have {})'.format(field_, tuple(dims), value_shape)) + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_value_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_dims[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_9) { + } else { + __pyx_t_4 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_value_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_dims[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __pyx_t_9; + __pyx_L5_bool_binop_done:; + if (unlikely(__pyx_t_4)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":342 + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: + * raise Exception('AcadosOcpSolver.constraints_set(): mismatching dimension' \ + * ' for field "{}" with dimension {} (you have {})'.format(field_, tuple(dims), value_shape)) # <<<<<<<<<<<<<< + * + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, \ + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_AcadosOcpSolver_constraints_set, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_carray_to_py_int(__pyx_v_dims, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_10 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_field_, __pyx_t_7, __pyx_v_value_shape}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_field_, __pyx_t_7, __pyx_v_value_shape}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + { + __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_field_); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_7); + __Pyx_INCREF(__pyx_v_value_shape); + __Pyx_GIVEREF(__pyx_v_value_shape); + PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_v_value_shape); + __pyx_t_7 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":341 + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: + * raise Exception('AcadosOcpSolver.constraints_set(): mismatching dimension' \ # <<<<<<<<<<<<<< + * ' for field "{}" with dimension {} (you have {})'.format(field_, tuple(dims), value_shape)) + * + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 341, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":340 + * value = np.asfortranarray(value_) + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.constraints_set(): mismatching dimension' \ + * ' for field "{}" with dimension {} (you have {})'.format(field_, tuple(dims), value_shape)) + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":345 + * + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, \ + * self.nlp_dims, self.nlp_in, stage, field, &value[0][0]) # <<<<<<<<<<<<<< + * + * return + */ + __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L1_error) + if (unlikely(!__pyx_v_value.memview)) { __Pyx_RaiseUnboundLocalError("value"); __PYX_ERR(0, 345, __pyx_L1_error) } + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_v_value.shape[0]; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_v_value.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_v_value.shape[1]; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_14 >= __pyx_v_value.shape[1])) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + __PYX_ERR(0, 345, __pyx_L1_error) + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":344 + * ' for field "{}" with dimension {} (you have {})'.format(field_, tuple(dims), value_shape)) + * + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, \ # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_in, stage, field, &value[0][0]) + * + */ + (void)(ocp_nlp_constraints_model_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_in, __pyx_v_stage, __pyx_t_12, ((void *)(&(*((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_value.data) + __pyx_t_13)) ) + __pyx_t_14 * __pyx_v_value.strides[1]) ))))))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":347 + * self.nlp_dims, self.nlp_in, stage, field, &value[0][0]) + * + * return # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":315 + * + * + * def constraints_set(self, int stage, str field_, value_): # <<<<<<<<<<<<<< + * """ + * Set numerical data in the constraint module of the solver. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.constraints_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_field); + __PYX_XDEC_MEMVIEW(&__pyx_v_value, 1); + __Pyx_XDECREF(__pyx_v_value_shape); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":350 + * + * + * def dynamics_get(self, int stage, str field_): # <<<<<<<<<<<<<< + * """ + * Get numerical data from the dynamics module of the solver: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_27dynamics_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_26dynamics_get[] = "\n Get numerical data from the dynamics module of the solver:\n\n :param stage: integer corresponding to shooting node\n :param field: string, e.g. 'A'\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_27dynamics_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_stage; + PyObject *__pyx_v_field_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dynamics_get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stage,&__pyx_n_s_field,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stage)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("dynamics_get", 1, 2, 2, 1); __PYX_ERR(0, 350, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dynamics_get") < 0)) __PYX_ERR(0, 350, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_stage = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_stage == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) + __pyx_v_field_ = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("dynamics_get", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 350, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.dynamics_get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_), (&PyUnicode_Type), 1, "field_", 1))) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_26dynamics_get(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_stage, __pyx_v_field_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_26dynamics_get(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_) { + PyObject *__pyx_v_field = NULL; + int __pyx_v_dims[2]; + PyObject *__pyx_v_out = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + char const *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("dynamics_get", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":357 + * :param field: string, e.g. 'A' + * """ + * field = field_.encode('utf-8') # <<<<<<<<<<<<<< + * + * # get dims + */ + if (unlikely(__pyx_v_field_ == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 357, __pyx_L1_error) + } + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_field_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_field = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":361 + * # get dims + * cdef int[2] dims + * acados_solver_common.ocp_nlp_dynamics_dims_get_from_attr(self.nlp_config, self.nlp_dims, self.nlp_out, stage, field, &dims[0]) # <<<<<<<<<<<<<< + * + * # create output data + */ + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L1_error) + ocp_nlp_dynamics_dims_get_from_attr(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_out, __pyx_v_stage, __pyx_t_2, (&(__pyx_v_dims[0]))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":364 + * + * # create output data + * out = np.zeros((dims[0], dims[1]), order='F', dtype=np.float64) # <<<<<<<<<<<<<< + * + * # call getter + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_dims[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_dims[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_out = __pyx_t_6; + __pyx_t_6 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":367 + * + * # call getter + * acados_solver_common.ocp_nlp_get_at_stage(self.nlp_config, self.nlp_dims, self.nlp_solver, stage, field, out.data) # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + ocp_nlp_get_at_stage(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_solver, __pyx_v_stage, __pyx_t_7, ((void *)__pyx_t_6)); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":369 + * acados_solver_common.ocp_nlp_get_at_stage(self.nlp_config, self.nlp_dims, self.nlp_solver, stage, field, out.data) + * + * return out # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_out); + __pyx_r = __pyx_v_out; + goto __pyx_L0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":350 + * + * + * def dynamics_get(self, int stage, str field_): # <<<<<<<<<<<<<< + * """ + * Get numerical data from the dynamics module of the solver: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.dynamics_get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_field); + __Pyx_XDECREF(__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":372 + * + * + * def options_set(self, str field_, value_): # <<<<<<<<<<<<<< + * """ + * Set options of the solver. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_29options_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_28options_set[] = "\n Set options of the solver.\n\n :param field: string, e.g. 'print_level', 'rti_phase', 'initialize_t_slacks', 'step_length', 'alpha_min', 'alpha_reduction'\n :param value: of type int, float\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_29options_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_field_ = 0; + PyObject *__pyx_v_value_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("options_set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_value,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("options_set", 1, 2, 2, 1); __PYX_ERR(0, 372, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "options_set") < 0)) __PYX_ERR(0, 372, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_field_ = ((PyObject*)values[0]); + __pyx_v_value_ = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("options_set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 372, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.options_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_), (&PyUnicode_Type), 1, "field_", 1))) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_28options_set(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_field_, __pyx_v_value_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_28options_set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_) { + PyObject *__pyx_v_int_fields = NULL; + PyObject *__pyx_v_double_fields = NULL; + PyObject *__pyx_v_string_fields = NULL; + PyObject *__pyx_v_field = NULL; + int __pyx_v_int_value; + double __pyx_v_double_value; + __Pyx_memviewslice __pyx_v_string_value = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + char const *__pyx_t_8; + double __pyx_t_9; + __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("options_set", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":379 + * :param value: of type int, float + * """ + * int_fields = ['print_level', 'rti_phase', 'initialize_t_slacks'] # <<<<<<<<<<<<<< + * double_fields = ['step_length', 'tol_eq', 'tol_stat', 'tol_ineq', 'tol_comp', 'alpha_min', 'alpha_reduction'] + * string_fields = ['globalization'] + */ + __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_print_level); + __Pyx_GIVEREF(__pyx_n_u_print_level); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_print_level); + __Pyx_INCREF(__pyx_n_u_rti_phase); + __Pyx_GIVEREF(__pyx_n_u_rti_phase); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_rti_phase); + __Pyx_INCREF(__pyx_n_u_initialize_t_slacks); + __Pyx_GIVEREF(__pyx_n_u_initialize_t_slacks); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_initialize_t_slacks); + __pyx_v_int_fields = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":380 + * """ + * int_fields = ['print_level', 'rti_phase', 'initialize_t_slacks'] + * double_fields = ['step_length', 'tol_eq', 'tol_stat', 'tol_ineq', 'tol_comp', 'alpha_min', 'alpha_reduction'] # <<<<<<<<<<<<<< + * string_fields = ['globalization'] + * + */ + __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_step_length); + __Pyx_GIVEREF(__pyx_n_u_step_length); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_step_length); + __Pyx_INCREF(__pyx_n_u_tol_eq); + __Pyx_GIVEREF(__pyx_n_u_tol_eq); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_tol_eq); + __Pyx_INCREF(__pyx_n_u_tol_stat); + __Pyx_GIVEREF(__pyx_n_u_tol_stat); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_tol_stat); + __Pyx_INCREF(__pyx_n_u_tol_ineq); + __Pyx_GIVEREF(__pyx_n_u_tol_ineq); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_tol_ineq); + __Pyx_INCREF(__pyx_n_u_tol_comp); + __Pyx_GIVEREF(__pyx_n_u_tol_comp); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_u_tol_comp); + __Pyx_INCREF(__pyx_n_u_alpha_min); + __Pyx_GIVEREF(__pyx_n_u_alpha_min); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_u_alpha_min); + __Pyx_INCREF(__pyx_n_u_alpha_reduction); + __Pyx_GIVEREF(__pyx_n_u_alpha_reduction); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_u_alpha_reduction); + __pyx_v_double_fields = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":381 + * int_fields = ['print_level', 'rti_phase', 'initialize_t_slacks'] + * double_fields = ['step_length', 'tol_eq', 'tol_stat', 'tol_ineq', 'tol_comp', 'alpha_min', 'alpha_reduction'] + * string_fields = ['globalization'] # <<<<<<<<<<<<<< + * + * # encode + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_globalization); + __Pyx_GIVEREF(__pyx_n_u_globalization); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_globalization); + __pyx_v_string_fields = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":384 + * + * # encode + * field = field_.encode('utf-8') # <<<<<<<<<<<<<< + * + * cdef int int_value + */ + if (unlikely(__pyx_v_field_ == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 384, __pyx_L1_error) + } + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_field_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_field = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":391 + * + * # check field availability and type + * if field_ in int_fields: # <<<<<<<<<<<<<< + * if not isinstance(value_, int): + * raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) + */ + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_v_int_fields, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":392 + * # check field availability and type + * if field_ in int_fields: + * if not isinstance(value_, int): # <<<<<<<<<<<<<< + * raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) + * + */ + __pyx_t_3 = PyInt_Check(__pyx_v_value_); + __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0); + if (unlikely(__pyx_t_2)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":393 + * if field_ in int_fields: + * if not isinstance(value_, int): + * raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) # <<<<<<<<<<<<<< + * + * if field_ == 'rti_phase': + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_solver_option_must_be_of_type_in, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, ((PyObject *)Py_TYPE(__pyx_v_value_))}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, ((PyObject *)Py_TYPE(__pyx_v_value_))}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_field_); + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_value_))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_value_))); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)Py_TYPE(__pyx_v_value_))); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 393, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":392 + * # check field availability and type + * if field_ in int_fields: + * if not isinstance(value_, int): # <<<<<<<<<<<<<< + * raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) + * + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":395 + * raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) + * + * if field_ == 'rti_phase': # <<<<<<<<<<<<<< + * if value_ < 0 or value_ > 2: + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_field_, __pyx_n_u_rti_phase, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 395, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":396 + * + * if field_ == 'rti_phase': + * if value_ < 0 or value_ > 2: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_value_, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 396, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_4 = PyObject_RichCompare(__pyx_v_value_, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 396, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __pyx_t_2; + __pyx_L7_bool_binop_done:; + if (unlikely(__pyx_t_3)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":397 + * if field_ == 'rti_phase': + * if value_ < 0 or value_ > 2: + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' # <<<<<<<<<<<<<< + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + * if self.acados_ocp.solver_options.nlp_solver_type != 'SQP_RTI' and value_ > 0: + */ + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 397, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":396 + * + * if field_ == 'rti_phase': + * if value_ < 0 or value_ > 2: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":399 + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + * if self.acados_ocp.solver_options.nlp_solver_type != 'SQP_RTI' and value_ > 0: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + * 'take only value 0 for SQP-type solvers') + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_acados_ocp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_solver_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nlp_solver_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_SQP_RTI, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L10_bool_binop_done; + } + __pyx_t_4 = PyObject_RichCompare(__pyx_v_value_, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __pyx_t_2; + __pyx_L10_bool_binop_done:; + if (unlikely(__pyx_t_3)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":400 + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + * if self.acados_ocp.solver_options.nlp_solver_type != 'SQP_RTI' and value_ > 0: + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' # <<<<<<<<<<<<<< + * 'take only value 0 for SQP-type solvers') + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 400, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":399 + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + * if self.acados_ocp.solver_options.nlp_solver_type != 'SQP_RTI' and value_ > 0: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + * 'take only value 0 for SQP-type solvers') + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":395 + * raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) + * + * if field_ == 'rti_phase': # <<<<<<<<<<<<<< + * if value_ < 0 or value_ > 2: + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":403 + * 'take only value 0 for SQP-type solvers') + * + * int_value = value_ # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &int_value) + * + */ + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_value_); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L1_error) + __pyx_v_int_value = __pyx_t_6; + + /* "acados_template/acados_ocp_solver_pyx.pyx":404 + * + * int_value = value_ + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &int_value) # <<<<<<<<<<<<<< + * + * elif field_ in double_fields: + */ + __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 404, __pyx_L1_error) + ocp_nlp_solver_opts_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_opts, __pyx_t_8, ((void *)(&__pyx_v_int_value))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":391 + * + * # check field availability and type + * if field_ in int_fields: # <<<<<<<<<<<<<< + * if not isinstance(value_, int): + * raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) + */ + goto __pyx_L3; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":406 + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &int_value) + * + * elif field_ in double_fields: # <<<<<<<<<<<<<< + * if not isinstance(value_, float): + * raise Exception('solver option {} must be of type float. You have {}.'.format(field_, type(value_))) + */ + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_v_double_fields, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":407 + * + * elif field_ in double_fields: + * if not isinstance(value_, float): # <<<<<<<<<<<<<< + * raise Exception('solver option {} must be of type float. You have {}.'.format(field_, type(value_))) + * + */ + __pyx_t_2 = PyFloat_Check(__pyx_v_value_); + __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); + if (unlikely(__pyx_t_3)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":408 + * elif field_ in double_fields: + * if not isinstance(value_, float): + * raise Exception('solver option {} must be of type float. You have {}.'.format(field_, type(value_))) # <<<<<<<<<<<<<< + * + * double_value = value_ + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_solver_option_must_be_of_type_fl, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_field_, ((PyObject *)Py_TYPE(__pyx_v_value_))}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_field_, ((PyObject *)Py_TYPE(__pyx_v_value_))}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_field_); + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_value_))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_value_))); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, ((PyObject *)Py_TYPE(__pyx_v_value_))); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 408, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":407 + * + * elif field_ in double_fields: + * if not isinstance(value_, float): # <<<<<<<<<<<<<< + * raise Exception('solver option {} must be of type float. You have {}.'.format(field_, type(value_))) + * + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":410 + * raise Exception('solver option {} must be of type float. You have {}.'.format(field_, type(value_))) + * + * double_value = value_ # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &double_value) + * + */ + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_value_); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_v_double_value = __pyx_t_9; + + /* "acados_template/acados_ocp_solver_pyx.pyx":411 + * + * double_value = value_ + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &double_value) # <<<<<<<<<<<<<< + * + * elif field_ in string_fields: + */ + __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error) + ocp_nlp_solver_opts_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_opts, __pyx_t_8, ((void *)(&__pyx_v_double_value))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":406 + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &int_value) + * + * elif field_ in double_fields: # <<<<<<<<<<<<<< + * if not isinstance(value_, float): + * raise Exception('solver option {} must be of type float. You have {}.'.format(field_, type(value_))) + */ + goto __pyx_L3; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":413 + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &double_value) + * + * elif field_ in string_fields: # <<<<<<<<<<<<<< + * if not isinstance(value_, bytes): + * raise Exception('solver option {} must be of type str. You have {}.'.format(field_, type(value_))) + */ + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_v_string_fields, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_3 != 0); + if (likely(__pyx_t_2)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":414 + * + * elif field_ in string_fields: + * if not isinstance(value_, bytes): # <<<<<<<<<<<<<< + * raise Exception('solver option {} must be of type str. You have {}.'.format(field_, type(value_))) + * + */ + __pyx_t_2 = PyBytes_Check(__pyx_v_value_); + __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); + if (unlikely(__pyx_t_3)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":415 + * elif field_ in string_fields: + * if not isinstance(value_, bytes): + * raise Exception('solver option {} must be of type str. You have {}.'.format(field_, type(value_))) # <<<<<<<<<<<<<< + * + * string_value = value_.encode('utf-8') + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_solver_option_must_be_of_type_st, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, ((PyObject *)Py_TYPE(__pyx_v_value_))}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, ((PyObject *)Py_TYPE(__pyx_v_value_))}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_field_); + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_value_))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_value_))); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)Py_TYPE(__pyx_v_value_))); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 415, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":414 + * + * elif field_ in string_fields: + * if not isinstance(value_, bytes): # <<<<<<<<<<<<<< + * raise Exception('solver option {} must be of type str. You have {}.'.format(field_, type(value_))) + * + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":417 + * raise Exception('solver option {} must be of type str. You have {}.'.format(field_, type(value_))) + * + * string_value = value_.encode('utf-8') # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &string_value[0]) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_utf_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 417, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_string_value = __pyx_t_10; + __pyx_t_10.memview = NULL; + __pyx_t_10.data = NULL; + + /* "acados_template/acados_ocp_solver_pyx.pyx":418 + * + * string_value = value_.encode('utf-8') + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &string_value[0]) # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_11 = 0; + __pyx_t_6 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_v_string_value.shape[0]; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_v_string_value.shape[0])) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + __PYX_ERR(0, 418, __pyx_L1_error) + } + ocp_nlp_solver_opts_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_opts, __pyx_t_8, ((void *)(&(*((unsigned char *) ( /* dim=0 */ ((char *) (((unsigned char *) __pyx_v_string_value.data) + __pyx_t_11)) )))))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":413 + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &double_value) + * + * elif field_ in string_fields: # <<<<<<<<<<<<<< + * if not isinstance(value_, bytes): + * raise Exception('solver option {} must be of type str. You have {}.'.format(field_, type(value_))) + */ + goto __pyx_L3; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":421 + * + * else: + * raise Exception('AcadosOcpSolver.options_set() does not support field {}.'\ # <<<<<<<<<<<<<< + * '\n Possible values are {}.'.format(field_, ', '.join(int_fields + double_fields + string_fields))) + * + */ + /*else*/ { + + /* "acados_template/acados_ocp_solver_pyx.pyx":422 + * else: + * raise Exception('AcadosOcpSolver.options_set() does not support field {}.'\ + * '\n Possible values are {}.'.format(field_, ', '.join(int_fields + double_fields + string_fields))) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_AcadosOcpSolver_options_set_does, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyNumber_Add(__pyx_v_int_fields, __pyx_v_double_fields); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyNumber_Add(__pyx_t_7, __pyx_v_string_fields); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyUnicode_Join(__pyx_kp_u__6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + { + __pyx_t_12 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_6, __pyx_v_field_); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_6, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":421 + * + * else: + * raise Exception('AcadosOcpSolver.options_set() does not support field {}.'\ # <<<<<<<<<<<<<< + * '\n Possible values are {}.'.format(field_, ', '.join(int_fields + double_fields + string_fields))) + * + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 421, __pyx_L1_error) + } + __pyx_L3:; + + /* "acados_template/acados_ocp_solver_pyx.pyx":372 + * + * + * def options_set(self, str field_, value_): # <<<<<<<<<<<<<< + * """ + * Set options of the solver. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.options_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_int_fields); + __Pyx_XDECREF(__pyx_v_double_fields); + __Pyx_XDECREF(__pyx_v_string_fields); + __Pyx_XDECREF(__pyx_v_field); + __PYX_XDEC_MEMVIEW(&__pyx_v_string_value, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":425 + * + * + * def __del__(self): # <<<<<<<<<<<<<< + * if self.solver_created: + * acados_solver.acados_free(self.capsule) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_31__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_31__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_30__del__(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_30__del__(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__del__", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":426 + * + * def __del__(self): + * if self.solver_created: # <<<<<<<<<<<<<< + * acados_solver.acados_free(self.capsule) + * acados_solver.acados_free_capsule(self.capsule) + */ + __pyx_t_1 = (__pyx_v_self->solver_created != 0); + if (__pyx_t_1) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":427 + * def __del__(self): + * if self.solver_created: + * acados_solver.acados_free(self.capsule) # <<<<<<<<<<<<<< + * acados_solver.acados_free_capsule(self.capsule) + */ + (void)(lat_acados_free(__pyx_v_self->capsule)); + + /* "acados_template/acados_ocp_solver_pyx.pyx":428 + * if self.solver_created: + * acados_solver.acados_free(self.capsule) + * acados_solver.acados_free_capsule(self.capsule) # <<<<<<<<<<<<<< + */ + (void)(lat_acados_free_capsule(__pyx_v_self->capsule)); + + /* "acados_template/acados_ocp_solver_pyx.pyx":426 + * + * def __del__(self): + * if self.solver_created: # <<<<<<<<<<<<<< + * acados_solver.acados_free(self.capsule) + * acados_solver.acados_free_capsule(self.capsule) + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":425 + * + * + * def __del__(self): # <<<<<<<<<<<<<< + * if self.solver_created: + * acados_solver.acados_free(self.capsule) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_33__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_33__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_32__reduce_cython__(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_35__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_35__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_34__setstate_cython__(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":735 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":736 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":735 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":738 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":739 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":738 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":741 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":742 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":741 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":744 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":745 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":744 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":747 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":748 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":747 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":750 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":751 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); + if (__pyx_t_1) { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":752 + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape # <<<<<<<<<<<<<< + * else: + * return () + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); + __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":751 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":754 + * return d.subarray.shape + * else: + * return () # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_r = __pyx_empty_tuple; + goto __pyx_L0; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":750 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":929 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":930 + * + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< + * PyArray_SetBaseObject(arr, base) + * + */ + Py_INCREF(__pyx_v_base); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":931 + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":929 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":933 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_v_base; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":934 + * + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< + * if base is NULL: + * return None + */ + __pyx_v_base = PyArray_BASE(__pyx_v_arr); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":935 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + __pyx_t_1 = ((__pyx_v_base == NULL) != 0); + if (__pyx_t_1) { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":936 + * base = PyArray_BASE(arr) + * if base is NULL: + * return None # <<<<<<<<<<<<<< + * return base + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":935 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":937 + * if base is NULL: + * return None + * return base # <<<<<<<<<<<<<< + * + * # Versions of the import_* functions which are more suitable for + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_base)); + __pyx_r = ((PyObject *)__pyx_v_base); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":933 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":941 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":943 + * cdef inline int import_array() except -1: + * try: + * __pyx_import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":944 + * try: + * __pyx_import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":945 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 945, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":941 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":947 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":949 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":950 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":951 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 951, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":947 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":953 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":955 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":956 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":957 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef extern from *: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 957, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":953 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":967 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timedelta64_object", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":979 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":967 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":982 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_datetime64_object", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":994 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":982 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":997 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + +static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { + npy_datetime __pyx_r; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1004 + * also needed. That can be found using `get_datetime64_unit`. + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":997 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1007 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + +static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { + npy_timedelta __pyx_r; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1011 + * returns the int64 value underlying scalar numpy timedelta64 object + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1007 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1014 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + +static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { + NPY_DATETIMEUNIT __pyx_r; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1018 + * returns the unit part of the dtype for a numpy datetime64 object. + * """ + * return (obj).obmeta.base # <<<<<<<<<<<<<< + */ + __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1014 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "carray.to_py":112 + * + * @cname("__Pyx_carray_to_py_int") + * cdef inline list __Pyx_carray_to_py_int(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value + */ + +static CYTHON_INLINE PyObject *__Pyx_carray_to_py_int(int *__pyx_v_v, Py_ssize_t __pyx_v_length) { + size_t __pyx_v_i; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_l = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_carray_to_py_int", 0); + + /* "carray.to_py":115 + * cdef size_t i + * cdef object value + * l = PyList_New(length) # <<<<<<<<<<<<<< + * for i in range(length): + * value = v[i] + */ + __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_l = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "carray.to_py":116 + * cdef object value + * l = PyList_New(length) + * for i in range(length): # <<<<<<<<<<<<<< + * value = v[i] + * Py_INCREF(value) + */ + __pyx_t_2 = ((size_t)__pyx_v_length); + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "carray.to_py":117 + * l = PyList_New(length) + * for i in range(length): + * value = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) + */ + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "carray.to_py":118 + * for i in range(length): + * value = v[i] + * Py_INCREF(value) # <<<<<<<<<<<<<< + * PyList_SET_ITEM(l, i, value) + * return l + */ + Py_INCREF(__pyx_v_value); + + /* "carray.to_py":119 + * value = v[i] + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) # <<<<<<<<<<<<<< + * return l + * + */ + PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value); + } + + /* "carray.to_py":120 + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) + * return l # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_l); + __pyx_r = __pyx_v_l; + goto __pyx_L0; + + /* "carray.to_py":112 + * + * @cname("__Pyx_carray_to_py_int") + * cdef inline list __Pyx_carray_to_py_int(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_l); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "carray.to_py":124 + * + * @cname("__Pyx_carray_to_tuple_int") + * cdef inline tuple __Pyx_carray_to_tuple_int(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value + */ + +static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_int(int *__pyx_v_v, Py_ssize_t __pyx_v_length) { + size_t __pyx_v_i; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_int", 0); + + /* "carray.to_py":127 + * cdef size_t i + * cdef object value + * t = PyTuple_New(length) # <<<<<<<<<<<<<< + * for i in range(length): + * value = v[i] + */ + __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_t = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "carray.to_py":128 + * cdef object value + * t = PyTuple_New(length) + * for i in range(length): # <<<<<<<<<<<<<< + * value = v[i] + * Py_INCREF(value) + */ + __pyx_t_2 = ((size_t)__pyx_v_length); + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "carray.to_py":129 + * t = PyTuple_New(length) + * for i in range(length): + * value = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) + */ + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "carray.to_py":130 + * for i in range(length): + * value = v[i] + * Py_INCREF(value) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(t, i, value) + * return t + */ + Py_INCREF(__pyx_v_value); + + /* "carray.to_py":131 + * value = v[i] + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) # <<<<<<<<<<<<<< + * return t + */ + PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value); + } + + /* "carray.to_py":132 + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) + * return t # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_t); + __pyx_r = __pyx_v_t; + goto __pyx_L0; + + /* "carray.to_py":124 + * + * @cname("__Pyx_carray_to_tuple_int") + * cdef inline tuple __Pyx_carray_to_tuple_int(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":122 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + +/* Python wrapper */ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_shape = 0; + Py_ssize_t __pyx_v_itemsize; + PyObject *__pyx_v_format = 0; + PyObject *__pyx_v_mode = 0; + int __pyx_v_allocate_buffer; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)__pyx_n_s_c); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_shape = ((PyObject*)values[0]); + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error) + } else { + + /* "View.MemoryView":123 + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, + * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< + * + * cdef int idx + */ + __pyx_v_allocate_buffer = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error) + } + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); + + /* "View.MemoryView":122 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) { + int __pyx_v_idx; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_dim; + PyObject **__pyx_v_p; + char __pyx_v_order; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":129 + * cdef PyObject **p + * + * self.ndim = len(shape) # <<<<<<<<<<<<<< + * self.itemsize = itemsize + * + */ + if (unlikely(__pyx_v_shape == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 129, __pyx_L1_error) + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":130 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":132 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":133 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 133, __pyx_L1_error) + + /* "View.MemoryView":132 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + } + + /* "View.MemoryView":135 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":136 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 136, __pyx_L1_error) + + /* "View.MemoryView":135 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + } + + /* "View.MemoryView":138 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + __pyx_t_2 = PyBytes_Check(__pyx_v_format); + __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":139 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":138 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + } + + /* "View.MemoryView":140 + * if not isinstance(format, bytes): + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error) + __pyx_t_3 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":141 + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * + * + */ + if (unlikely(__pyx_v_self->_format == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(1, 141, __pyx_L1_error) + } + __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_7; + + /* "View.MemoryView":144 + * + * + * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< + * self._strides = self._shape + self.ndim + * + */ + __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); + + /* "View.MemoryView":145 + * + * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) + * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< + * + * if not self._shape: + */ + __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); + + /* "View.MemoryView":147 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":148 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 148, __pyx_L1_error) + + /* "View.MemoryView":147 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + } + + /* "View.MemoryView":151 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + __pyx_t_8 = 0; + __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + for (;;) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_9; + __pyx_v_idx = __pyx_t_8; + __pyx_t_8 = (__pyx_t_8 + 1); + + /* "View.MemoryView":152 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":153 + * for idx, dim in enumerate(shape): + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< + * self._shape[idx] = dim + * + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6); + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(1, 153, __pyx_L1_error) + + /* "View.MemoryView":152 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + } + + /* "View.MemoryView":154 + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim # <<<<<<<<<<<<<< + * + * cdef char order + */ + (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; + + /* "View.MemoryView":151 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":157 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":158 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":159 + * if mode == 'fortran': + * order = b'F' + * self.mode = u'fortran' # <<<<<<<<<<<<<< + * elif mode == 'c': + * order = b'C' + */ + __Pyx_INCREF(__pyx_n_u_fortran); + __Pyx_GIVEREF(__pyx_n_u_fortran); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_fortran; + + /* "View.MemoryView":157 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":160 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error) + if (likely(__pyx_t_4)) { + + /* "View.MemoryView":161 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":162 + * elif mode == 'c': + * order = b'C' + * self.mode = u'c' # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + */ + __Pyx_INCREF(__pyx_n_u_c); + __Pyx_GIVEREF(__pyx_n_u_c); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_c; + + /* "View.MemoryView":160 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":164 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< + * + * self.len = fill_contig_strides_array(self._shape, self._strides, + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(1, 164, __pyx_L1_error) + } + __pyx_L10:; + + /* "View.MemoryView":166 + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + * + * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< + * itemsize, self.ndim, order) + * + */ + __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); + + /* "View.MemoryView":169 + * itemsize, self.ndim, order) + * + * self.free_data = allocate_buffer # <<<<<<<<<<<<<< + * self.dtype_is_object = format == b'O' + * if allocate_buffer: + */ + __pyx_v_self->free_data = __pyx_v_allocate_buffer; + + /* "View.MemoryView":170 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: + * + */ + __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":171 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = (__pyx_v_allocate_buffer != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":174 + * + * + * self.data = malloc(self.len) # <<<<<<<<<<<<<< + * if not self.data: + * raise MemoryError("unable to allocate array data.") + */ + __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); + + /* "View.MemoryView":175 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":176 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(1, 176, __pyx_L1_error) + + /* "View.MemoryView":175 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + } + + /* "View.MemoryView":178 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":179 + * + * if self.dtype_is_object: + * p = self.data # <<<<<<<<<<<<<< + * for i in range(self.len / itemsize): + * p[i] = Py_None + */ + __pyx_v_p = ((PyObject **)__pyx_v_self->data); + + /* "View.MemoryView":180 + * if self.dtype_is_object: + * p = self.data + * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< + * p[i] = Py_None + * Py_INCREF(Py_None) + */ + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(1, 180, __pyx_L1_error) + } + else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(1, 180, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + __pyx_t_9 = __pyx_t_1; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "View.MemoryView":181 + * p = self.data + * for i in range(self.len / itemsize): + * p[i] = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + (__pyx_v_p[__pyx_v_i]) = Py_None; + + /* "View.MemoryView":182 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + + /* "View.MemoryView":178 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + } + + /* "View.MemoryView":171 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":122 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":185 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_bufmode; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + char *__pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "View.MemoryView":186 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 # <<<<<<<<<<<<<< + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = -1; + + /* "View.MemoryView":187 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":188 + * cdef int bufmode = -1 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + + /* "View.MemoryView":187 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + goto __pyx_L3; + } + + /* "View.MemoryView":189 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":190 + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + */ + __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + + /* "View.MemoryView":189 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + } + __pyx_L3:; + + /* "View.MemoryView":191 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":192 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 192, __pyx_L1_error) + + /* "View.MemoryView":191 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + } + + /* "View.MemoryView":193 + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data # <<<<<<<<<<<<<< + * info.len = self.len + * info.ndim = self.ndim + */ + __pyx_t_4 = __pyx_v_self->data; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":194 + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + * info.len = self.len # <<<<<<<<<<<<<< + * info.ndim = self.ndim + * info.shape = self._shape + */ + __pyx_t_5 = __pyx_v_self->len; + __pyx_v_info->len = __pyx_t_5; + + /* "View.MemoryView":195 + * info.buf = self.data + * info.len = self.len + * info.ndim = self.ndim # <<<<<<<<<<<<<< + * info.shape = self._shape + * info.strides = self._strides + */ + __pyx_t_6 = __pyx_v_self->ndim; + __pyx_v_info->ndim = __pyx_t_6; + + /* "View.MemoryView":196 + * info.len = self.len + * info.ndim = self.ndim + * info.shape = self._shape # <<<<<<<<<<<<<< + * info.strides = self._strides + * info.suboffsets = NULL + */ + __pyx_t_7 = __pyx_v_self->_shape; + __pyx_v_info->shape = __pyx_t_7; + + /* "View.MemoryView":197 + * info.ndim = self.ndim + * info.shape = self._shape + * info.strides = self._strides # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = self.itemsize + */ + __pyx_t_7 = __pyx_v_self->_strides; + __pyx_v_info->strides = __pyx_t_7; + + /* "View.MemoryView":198 + * info.shape = self._shape + * info.strides = self._strides + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = self.itemsize + * info.readonly = 0 + */ + __pyx_v_info->suboffsets = NULL; + + /* "View.MemoryView":199 + * info.strides = self._strides + * info.suboffsets = NULL + * info.itemsize = self.itemsize # <<<<<<<<<<<<<< + * info.readonly = 0 + * + */ + __pyx_t_5 = __pyx_v_self->itemsize; + __pyx_v_info->itemsize = __pyx_t_5; + + /* "View.MemoryView":200 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":202 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":203 + * + * if flags & PyBUF_FORMAT: + * info.format = self.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_4 = __pyx_v_self->format; + __pyx_v_info->format = __pyx_t_4; + + /* "View.MemoryView":202 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":205 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":207 + * info.format = NULL + * + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":185 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":211 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + +/* Python wrapper */ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":212 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":213 + * def __dealloc__(array self): + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) # <<<<<<<<<<<<<< + * elif self.free_data: + * if self.dtype_is_object: + */ + __pyx_v_self->callback_free_data(__pyx_v_self->data); + + /* "View.MemoryView":212 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":214 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":215 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":216 + * elif self.free_data: + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< + * self._strides, self.ndim, False) + * free(self.data) + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); + + /* "View.MemoryView":215 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + } + + /* "View.MemoryView":218 + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + * free(self.data) # <<<<<<<<<<<<<< + * PyObject_Free(self._shape) + * + */ + free(__pyx_v_self->data); + + /* "View.MemoryView":214 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + } + __pyx_L3:; + + /* "View.MemoryView":219 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< + * + * @property + */ + PyObject_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":211 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":222 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":223 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< + * + * @cname('get_memview') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":222 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":226 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_memview", 0); + + /* "View.MemoryView":227 + * @cname('get_memview') + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":228 + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":226 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":230 + * return memoryview(self, flags, self.dtype_is_object) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self._shape[0] + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":231 + * + * def __len__(self): + * return self._shape[0] # <<<<<<<<<<<<<< + * + * def __getattr__(self, attr): + */ + __pyx_r = (__pyx_v_self->_shape[0]); + goto __pyx_L0; + + /* "View.MemoryView":230 + * return memoryview(self, flags, self.dtype_is_object) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self._shape[0] + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":233 + * return self._shape[0] + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":234 + * + * def __getattr__(self, attr): + * return getattr(self.memview, attr) # <<<<<<<<<<<<<< + * + * def __getitem__(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":233 + * return self._shape[0] + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":236 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":237 + * + * def __getitem__(self, item): + * return self.memview[item] # <<<<<<<<<<<<<< + * + * def __setitem__(self, item, value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":236 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":239 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + +/* Python wrapper */ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":240 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":239 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":244 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + +static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) { + struct __pyx_array_obj *__pyx_v_result = 0; + struct __pyx_array_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_cwrapper", 0); + + /* "View.MemoryView":248 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":249 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":248 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":251 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":252 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error) + + /* "View.MemoryView":251 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":253 + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) + * result.data = buf # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->data = __pyx_v_buf; + } + __pyx_L3:; + + /* "View.MemoryView":255 + * result.data = buf + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":244 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":281 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + +/* Python wrapper */ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "View.MemoryView":282 + * cdef object name + * def __init__(self, name): + * self.name = name # <<<<<<<<<<<<<< + * def __repr__(self): + * return self.name + */ + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_name; + + /* "View.MemoryView":281 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":283 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + +/* Python wrapper */ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":284 + * self.name = name + * def __repr__(self): + * return self.name # <<<<<<<<<<<<<< + * + * cdef generic = Enum("") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* "View.MemoryView":283 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_v_state = 0; + PyObject *__pyx_v__dict = 0; + int __pyx_v_use_setstate; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":5 + * cdef object _dict + * cdef bint use_setstate + * state = (self.name,) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->name); + __Pyx_GIVEREF(__pyx_v_self->name); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name); + __pyx_v_state = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "(tree fragment)":6 + * cdef bint use_setstate + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":7 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":8 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "(tree fragment)":9 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self.name is not None + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":7 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":11 + * use_setstate = True + * else: + * use_setstate = self.name is not None # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_self->name != Py_None); + __pyx_v_use_setstate = __pyx_t_3; + } + __pyx_L3:; + + /* "(tree fragment)":12 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":13 + * use_setstate = self.name is not None + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184977713); + __Pyx_GIVEREF(__pyx_int_184977713); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":12 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + } + + /* "(tree fragment)":15 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184977713); + __Pyx_GIVEREF(__pyx_int_184977713); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":16 + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":17 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":298 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + +static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) { + Py_intptr_t __pyx_v_aligned_p; + size_t __pyx_v_offset; + void *__pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":300 + * cdef void *align_pointer(void *memory, size_t alignment) nogil: + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< + * cdef size_t offset + * + */ + __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); + + /* "View.MemoryView":304 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":306 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + __pyx_t_1 = ((__pyx_v_offset > 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":307 + * + * if offset > 0: + * aligned_p += alignment - offset # <<<<<<<<<<<<<< + * + * return aligned_p + */ + __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); + + /* "View.MemoryView":306 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + } + + /* "View.MemoryView":309 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":298 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":345 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + +/* Python wrapper */ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_obj = 0; + int __pyx_v_flags; + int __pyx_v_dtype_is_object; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_obj = values[0]; + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "View.MemoryView":346 + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj # <<<<<<<<<<<<<< + * self.flags = flags + * if type(self) is memoryview or obj is not None: + */ + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __Pyx_GOTREF(__pyx_v_self->obj); + __Pyx_DECREF(__pyx_v_self->obj); + __pyx_v_self->obj = __pyx_v_obj; + + /* "View.MemoryView":347 + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj + * self.flags = flags # <<<<<<<<<<<<<< + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + */ + __pyx_v_self->flags = __pyx_v_flags; + + /* "View.MemoryView":348 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_obj != Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "View.MemoryView":349 + * self.flags = flags + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + */ + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error) + + /* "View.MemoryView":350 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":351 + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; + + /* "View.MemoryView":352 + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * global __pyx_memoryview_thread_locks_used + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":350 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + } + + /* "View.MemoryView":348 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + } + + /* "View.MemoryView":355 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":356 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + */ + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + + /* "View.MemoryView":357 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + + /* "View.MemoryView":355 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + } + + /* "View.MemoryView":358 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":359 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":360 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":361 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error) + + /* "View.MemoryView":360 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } + + /* "View.MemoryView":358 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + } + + /* "View.MemoryView":363 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":364 + * + * if flags & PyBUF_FORMAT: + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< + * else: + * self.dtype_is_object = dtype_is_object + */ + __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L11_bool_binop_done:; + __pyx_v_self->dtype_is_object = __pyx_t_1; + + /* "View.MemoryView":363 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + goto __pyx_L10; + } + + /* "View.MemoryView":366 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L10:; + + /* "View.MemoryView":368 + * self.dtype_is_object = dtype_is_object + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL + */ + __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); + + /* "View.MemoryView":370 + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL # <<<<<<<<<<<<<< + * + * def __dealloc__(memoryview self): + */ + __pyx_v_self->typeinfo = NULL; + + /* "View.MemoryView":345 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":372 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + +/* Python wrapper */ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyThread_type_lock __pyx_t_6; + PyThread_type_lock __pyx_t_7; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":373 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + */ + __pyx_t_1 = (__pyx_v_self->obj != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":374 + * def __dealloc__(memoryview self): + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + * + */ + __Pyx_ReleaseBuffer((&__pyx_v_self->view)); + + /* "View.MemoryView":373 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":375 + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< + * + * (<__pyx_buffer *> &self.view).obj = NULL + */ + __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":377 + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + * + * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<< + * Py_DECREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL; + + /* "View.MemoryView":378 + * + * (<__pyx_buffer *> &self.view).obj = NULL + * Py_DECREF(Py_None) # <<<<<<<<<<<<<< + * + * cdef int i + */ + Py_DECREF(Py_None); + + /* "View.MemoryView":375 + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< + * + * (<__pyx_buffer *> &self.view).obj = NULL + */ + } + __pyx_L3:; + + /* "View.MemoryView":382 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":383 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":384 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":385 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + + /* "View.MemoryView":386 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":388 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]); + + /* "View.MemoryView":387 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break + */ + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7; + + /* "View.MemoryView":386 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + } + + /* "View.MemoryView":389 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< + * else: + * PyThread_free_lock(self.lock) + */ + goto __pyx_L6_break; + + /* "View.MemoryView":384 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + } + } + /*else*/ { + + /* "View.MemoryView":391 + * break + * else: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + */ + PyThread_free_lock(__pyx_v_self->lock); + } + __pyx_L6_break:; + + /* "View.MemoryView":382 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + } + + /* "View.MemoryView":372 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":393 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + Py_ssize_t __pyx_v_dim; + char *__pyx_v_itemp; + PyObject *__pyx_v_idx = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + char *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item_pointer", 0); + + /* "View.MemoryView":395 + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< + * + * for dim, idx in enumerate(index): + */ + __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); + + /* "View.MemoryView":397 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + */ + __pyx_t_1 = 0; + if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) { + __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 397, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_1; + __pyx_t_1 = (__pyx_t_1 + 1); + + /* "View.MemoryView":398 + * + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + * + * return itemp + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; + + /* "View.MemoryView":397 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":400 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":393 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":403 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_indices = NULL; + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":404 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":405 + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: + * return self # <<<<<<<<<<<<<< + * + * have_slices, indices = _unellipsify(index, self.view.ndim) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "View.MemoryView":404 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + } + + /* "View.MemoryView":407 + * return self + * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp + */ + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 407, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":410 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error) + if (__pyx_t_2) { + + /* "View.MemoryView":411 + * cdef char *itemp + * if have_slices: + * return memview_slice(self, indices) # <<<<<<<<<<<<<< + * else: + * itemp = self.get_item_pointer(indices) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":410 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + } + + /* "View.MemoryView":413 + * return memview_slice(self, indices) + * else: + * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< + * return self.convert_item_to_object(itemp) + * + */ + /*else*/ { + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":414 + * else: + * itemp = self.get_item_pointer(indices) + * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< + * + * def __setitem__(memoryview self, object index, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":403 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":416 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_obj = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":417 + * + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: # <<<<<<<<<<<<<< + * raise TypeError("Cannot assign to read-only memoryview") + * + */ + __pyx_t_1 = (__pyx_v_self->view.readonly != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":418 + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< + * + * have_slices, index = _unellipsify(index, self.view.ndim) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 418, __pyx_L1_error) + + /* "View.MemoryView":417 + * + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: # <<<<<<<<<<<<<< + * raise TypeError("Cannot assign to read-only memoryview") + * + */ + } + + /* "View.MemoryView":420 + * raise TypeError("Cannot assign to read-only memoryview") + * + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: + */ + __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(__pyx_t_2 != Py_None)) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 420, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":422 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error) + if (__pyx_t_1) { + + /* "View.MemoryView":423 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_obj = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":424 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error) + if (__pyx_t_1) { + + /* "View.MemoryView":425 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "View.MemoryView":424 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":427 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L5:; + + /* "View.MemoryView":422 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":429 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + /*else*/ { + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L4:; + + /* "View.MemoryView":416 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":431 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_slice", 0); + __Pyx_INCREF(__pyx_v_obj); + + /* "View.MemoryView":432 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":433 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "View.MemoryView":434 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":435 + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":434 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + + /* "View.MemoryView":433 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "View.MemoryView":436 + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + * except TypeError: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":437 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "View.MemoryView":433 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":432 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + */ + } + + /* "View.MemoryView":439 + * return None + * + * return obj # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assignment(self, dst, src): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + + /* "View.MemoryView":431 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":441 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) { + __Pyx_memviewslice __pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_src_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + __Pyx_memviewslice *__pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); + + /* "View.MemoryView":445 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error) + + /* "View.MemoryView":446 + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) + * + */ + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error) + + /* "View.MemoryView":447 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":445 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error) + + /* "View.MemoryView":441 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":449 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) { + int __pyx_v_array[0x80]; + void *__pyx_v_tmp; + void *__pyx_v_item; + __Pyx_memviewslice *__pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_tmp_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + char const *__pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); + + /* "View.MemoryView":451 + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * cdef int array[128] + * cdef void *tmp = NULL # <<<<<<<<<<<<<< + * cdef void *item + * + */ + __pyx_v_tmp = NULL; + + /* "View.MemoryView":456 + * cdef __Pyx_memviewslice *dst_slice + * cdef __Pyx_memviewslice tmp_slice + * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< + * + * if self.view.itemsize > sizeof(array): + */ + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error) + __pyx_v_dst_slice = __pyx_t_1; + + /* "View.MemoryView":458 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":459 + * + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< + * if tmp == NULL: + * raise MemoryError + */ + __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); + + /* "View.MemoryView":460 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":461 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error) + + /* "View.MemoryView":460 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + } + + /* "View.MemoryView":462 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + + /* "View.MemoryView":458 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":464 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":466 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":467 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":468 + * try: + * if self.dtype_is_object: + * ( item)[0] = value # <<<<<<<<<<<<<< + * else: + * self.assign_item_from_object( item, value) + */ + (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); + + /* "View.MemoryView":467 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":470 + * ( item)[0] = value + * else: + * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":474 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":475 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":474 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + } + + /* "View.MemoryView":476 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * item, self.dtype_is_object) + * finally: + */ + __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); + } + + /* "View.MemoryView":479 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + __pyx_L6_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; + { + PyMem_Free(__pyx_v_tmp); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "View.MemoryView":449 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":481 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + char *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_indexed", 0); + + /* "View.MemoryView":482 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":483 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":481 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":485 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_v_struct = NULL; + PyObject *__pyx_v_bytesitem = 0; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + size_t __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":488 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":491 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":492 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "View.MemoryView":493 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":492 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + } + + /* "View.MemoryView":497 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { + + /* "View.MemoryView":498 + * else: + * if len(self.view.format) == 1: + * return result[0] # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; + + /* "View.MemoryView":497 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + } + + /* "View.MemoryView":499 + * if len(self.view.format) == 1: + * return result[0] + * return result # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L6_except_return; + } + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "View.MemoryView":494 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9); + __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_1); + + /* "View.MemoryView":495 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 495, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "View.MemoryView":492 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } + + /* "View.MemoryView":485 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesitem); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":501 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_v_struct = NULL; + char __pyx_v_c; + PyObject *__pyx_v_bytesvalue = 0; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + char *__pyx_t_11; + char *__pyx_t_12; + char *__pyx_t_13; + char *__pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":504 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":509 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":510 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":509 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":512 + * bytesvalue = struct.pack(self.view.format, *value) + * else: + * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< + * + * for i, c in enumerate(bytesvalue): + */ + /*else*/ { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":514 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_9 = 0; + if (unlikely(__pyx_v_bytesvalue == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); + __PYX_ERR(1, 514, __pyx_L1_error) + } + __Pyx_INCREF(__pyx_v_bytesvalue); + __pyx_t_10 = __pyx_v_bytesvalue; + __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10); + __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10)); + for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) { + __pyx_t_11 = __pyx_t_14; + __pyx_v_c = (__pyx_t_11[0]); + + /* "View.MemoryView":515 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_9; + + /* "View.MemoryView":514 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_9 = (__pyx_t_9 + 1); + + /* "View.MemoryView":515 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "View.MemoryView":501 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesvalue); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":518 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t *__pyx_t_4; + char *__pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "View.MemoryView":519 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + */ + __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_self->view.readonly != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":520 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< + * + * if flags & PyBUF_ND: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 520, __pyx_L1_error) + + /* "View.MemoryView":519 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + */ + } + + /* "View.MemoryView":522 + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + * if flags & PyBUF_ND: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":523 + * + * if flags & PyBUF_ND: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_4 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_4; + + /* "View.MemoryView":522 + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + * if flags & PyBUF_ND: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":525 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + /*else*/ { + __pyx_v_info->shape = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":527 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":528 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_4 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_4; + + /* "View.MemoryView":527 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + goto __pyx_L7; + } + + /* "View.MemoryView":530 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L7:; + + /* "View.MemoryView":532 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":533 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_4 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_4; + + /* "View.MemoryView":532 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":535 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L8:; + + /* "View.MemoryView":537 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":538 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_5 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_5; + + /* "View.MemoryView":537 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":540 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L9:; + + /* "View.MemoryView":542 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_6 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_6; + + /* "View.MemoryView":543 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_7 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_7; + + /* "View.MemoryView":544 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = self.view.readonly + */ + __pyx_t_8 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_8; + + /* "View.MemoryView":545 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = self.view.readonly + * info.obj = self + */ + __pyx_t_8 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_8; + + /* "View.MemoryView":546 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = self.view.readonly # <<<<<<<<<<<<<< + * info.obj = self + * + */ + __pyx_t_1 = __pyx_v_self->view.readonly; + __pyx_v_info->readonly = __pyx_t_1; + + /* "View.MemoryView":547 + * info.len = self.view.len + * info.readonly = self.view.readonly + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":518 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":553 + * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":554 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":555 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error) + + /* "View.MemoryView":556 + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + * return result # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":553 + * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":559 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":560 + * @property + * def base(self): + * return self.obj # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->obj); + __pyx_r = __pyx_v_self->obj; + goto __pyx_L0; + + /* "View.MemoryView":559 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":563 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_length; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":564 + * @property + * def shape(self): + * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); + for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { + __pyx_t_2 = __pyx_t_4; + __pyx_v_length = (__pyx_t_2[0]); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":563 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":567 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_stride; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":568 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":570 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 570, __pyx_L1_error) + + /* "View.MemoryView":568 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + } + + /* "View.MemoryView":572 + * raise ValueError("Buffer view does not expose strides") + * + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); + for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { + __pyx_t_3 = __pyx_t_5; + __pyx_v_stride = (__pyx_t_3[0]); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "View.MemoryView":567 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":575 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + Py_ssize_t *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":576 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":577 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__22, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":576 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + } + + /* "View.MemoryView":579 + * return (-1,) * self.view.ndim + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":575 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":582 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":583 + * @property + * def ndim(self): + * return self.view.ndim # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":582 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":586 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":587 + * @property + * def itemsize(self): + * return self.view.itemsize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":586 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":590 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":591 + * @property + * def nbytes(self): + * return self.size * self.view.itemsize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":590 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":594 + * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":595 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":596 + * def size(self): + * if self._size is None: + * result = 1 # <<<<<<<<<<<<<< + * + * for length in self.view.shape[:self.view.ndim]: + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_result = __pyx_int_1; + + /* "View.MemoryView":598 + * result = 1 + * + * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< + * result *= length + * + */ + __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); + for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { + __pyx_t_3 = __pyx_t_5; + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; + + /* "View.MemoryView":599 + * + * for length in self.view.shape[:self.view.ndim]: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + } + + /* "View.MemoryView":601 + * result *= length + * + * self._size = result # <<<<<<<<<<<<<< + * + * return self._size + */ + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_GOTREF(__pyx_v_self->_size); + __Pyx_DECREF(__pyx_v_self->_size); + __pyx_v_self->_size = __pyx_v_result; + + /* "View.MemoryView":595 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + } + + /* "View.MemoryView":603 + * self._size = result + * + * return self._size # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_size); + __pyx_r = __pyx_v_self->_size; + goto __pyx_L0; + + /* "View.MemoryView":594 + * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":605 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":606 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":607 + * def __len__(self): + * if self.view.ndim >= 1: + * return self.view.shape[0] # <<<<<<<<<<<<<< + * + * return 0 + */ + __pyx_r = (__pyx_v_self->view.shape[0]); + goto __pyx_L0; + + /* "View.MemoryView":606 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + } + + /* "View.MemoryView":609 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":605 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":611 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":612 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":613 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "View.MemoryView":612 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":611 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":615 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "View.MemoryView":616 + * + * def __str__(self): + * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":615 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":619 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_c_contig", 0); + + /* "View.MemoryView":622 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + */ + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":623 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< + * + * def is_f_contig(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":619 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":625 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_f_contig", 0); + + /* "View.MemoryView":628 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + */ + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":629 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< + * + * def copy(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":625 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":631 + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_mslice; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy", 0); + + /* "View.MemoryView":633 + * def copy(self): + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &mslice) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); + + /* "View.MemoryView":635 + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * + * slice_copy(self, &mslice) # <<<<<<<<<<<<<< + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); + + /* "View.MemoryView":636 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":641 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< + * + * def copy_fortran(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":631 + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":643 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy_fortran", 0); + + /* "View.MemoryView":645 + * def copy_fortran(self): + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &src) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); + + /* "View.MemoryView":647 + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + * + * slice_copy(self, &src) # <<<<<<<<<<<<<< + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); + + /* "View.MemoryView":648 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":653 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":643 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":657 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + +static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) { + struct __pyx_memoryview_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + + /* "View.MemoryView":658 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":659 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":660 + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_check') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":657 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":663 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("memoryview_check", 0); + + /* "View.MemoryView":664 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + * + * cdef tuple _unellipsify(object index, int ndim): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":663 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":666 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + +static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { + PyObject *__pyx_v_tup = NULL; + PyObject *__pyx_v_result = NULL; + int __pyx_v_have_slices; + int __pyx_v_seen_ellipsis; + CYTHON_UNUSED PyObject *__pyx_v_idx = NULL; + PyObject *__pyx_v_item = NULL; + Py_ssize_t __pyx_v_nslices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_unellipsify", 0); + + /* "View.MemoryView":671 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":672 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + + /* "View.MemoryView":671 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":674 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":676 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":677 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":678 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":679 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; + if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) { + __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 679, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":680 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":681 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":682 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__2); + __Pyx_GIVEREF(__pyx_slice__2); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__2); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":683 + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True # <<<<<<<<<<<<<< + * else: + * result.append(slice(None)) + */ + __pyx_v_seen_ellipsis = 1; + + /* "View.MemoryView":681 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + goto __pyx_L7; + } + + /* "View.MemoryView":685 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":686 + * else: + * result.append(slice(None)) + * have_slices = True # <<<<<<<<<<<<<< + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + */ + __pyx_v_have_slices = 1; + + /* "View.MemoryView":680 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + goto __pyx_L6; + } + + /* "View.MemoryView":688 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + /*else*/ { + __pyx_t_2 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_1 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":689 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_11, 0, 0, 0); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __PYX_ERR(1, 689, __pyx_L1_error) + + /* "View.MemoryView":688 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + } + + /* "View.MemoryView":691 + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< + * result.append(item) + * + */ + __pyx_t_10 = (__pyx_v_have_slices != 0); + if (!__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = (__pyx_t_10 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L11_bool_binop_done:; + __pyx_v_have_slices = __pyx_t_1; + + /* "View.MemoryView":692 + * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error) + } + __pyx_L6:; + + /* "View.MemoryView":679 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":694 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":695 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":696 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__2); + __Pyx_GIVEREF(__pyx_slice__2); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__2); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":695 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + } + + /* "View.MemoryView":698 + * result.extend([slice(None)] * nslices) + * + * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + */ + __Pyx_XDECREF(__pyx_r); + if (!__pyx_v_have_slices) { + } else { + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_11); + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "View.MemoryView":666 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":700 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + */ + +static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) { + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); + + /* "View.MemoryView":701 + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") + */ + __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim); + for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) { + __pyx_t_1 = __pyx_t_3; + __pyx_v_suboffset = (__pyx_t_1[0]); + + /* "View.MemoryView":702 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":703 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 703, __pyx_L1_error) + + /* "View.MemoryView":702 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + } + } + + /* "View.MemoryView":700 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":710 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) { + int __pyx_v_new_ndim; + int __pyx_v_suboffset_dim; + int __pyx_v_dim; + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + __Pyx_memviewslice *__pyx_v_p_src; + struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0; + __Pyx_memviewslice *__pyx_v_p_dst; + int *__pyx_v_p_suboffset_dim; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + int __pyx_v_have_start; + int __pyx_v_have_stop; + int __pyx_v_have_step; + PyObject *__pyx_v_index = NULL; + struct __pyx_memoryview_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + struct __pyx_memoryview_obj *__pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memview_slice", 0); + + /* "View.MemoryView":711 + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): + * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< + * cdef bint negative_step + * cdef __Pyx_memviewslice src, dst + */ + __pyx_v_new_ndim = 0; + __pyx_v_suboffset_dim = -1; + + /* "View.MemoryView":718 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); + + /* "View.MemoryView":722 + * cdef _memoryviewslice memviewsliceobj + * + * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 722, __pyx_L1_error) + } + } + #endif + + /* "View.MemoryView":724 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":725 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":726 + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, &src) + */ + __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); + + /* "View.MemoryView":724 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + goto __pyx_L3; + } + + /* "View.MemoryView":728 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":729 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":735 + * + * + * dst.memview = p_src.memview # <<<<<<<<<<<<<< + * dst.data = p_src.data + * + */ + __pyx_t_4 = __pyx_v_p_src->memview; + __pyx_v_dst.memview = __pyx_t_4; + + /* "View.MemoryView":736 + * + * dst.memview = p_src.memview + * dst.data = p_src.data # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_v_p_src->data; + __pyx_v_dst.data = __pyx_t_5; + + /* "View.MemoryView":741 + * + * + * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< + * cdef int *p_suboffset_dim = &suboffset_dim + * cdef Py_ssize_t start, stop, step + */ + __pyx_v_p_dst = (&__pyx_v_dst); + + /* "View.MemoryView":742 + * + * cdef __Pyx_memviewslice *p_dst = &dst + * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step + * cdef bint have_start, have_stop, have_step + */ + __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); + + /* "View.MemoryView":746 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + __pyx_t_6 = 0; + if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) { + __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 746, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_v_dim = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":747 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":751 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error) + + /* "View.MemoryView":748 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error) + + /* "View.MemoryView":747 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + goto __pyx_L6; + } + + /* "View.MemoryView":754 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":755 + * False) + * elif index is None: + * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + */ + (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; + + /* "View.MemoryView":756 + * elif index is None: + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 + */ + (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; + + /* "View.MemoryView":757 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + + /* "View.MemoryView":758 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 # <<<<<<<<<<<<<< + * else: + * start = index.start or 0 + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + + /* "View.MemoryView":754 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + goto __pyx_L6; + } + + /* "View.MemoryView":760 + * new_ndim += 1 + * else: + * start = index.start or 0 # <<<<<<<<<<<<<< + * stop = index.stop or 0 + * step = index.step or 0 + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":761 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":762 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":764 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":765 + * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":766 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< + * + * slice_memviewslice( + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":768 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error) + + /* "View.MemoryView":774 + * have_start, have_stop, have_step, + * True) + * new_ndim += 1 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + } + __pyx_L6:; + + /* "View.MemoryView":746 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":776 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":777 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":778 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) } + + /* "View.MemoryView":779 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) } + + /* "View.MemoryView":777 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":776 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + } + + /* "View.MemoryView":782 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":783 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":782 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":710 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":807 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) { + Py_ssize_t __pyx_v_new_shape; + int __pyx_v_negative_step; + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":827 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":829 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + __pyx_t_1 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":830 + * + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":829 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + } + + /* "View.MemoryView":831 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_t_1 = (0 <= __pyx_v_start); + if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_start < __pyx_v_shape); + } + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":832 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error) + + /* "View.MemoryView":831 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + } + + /* "View.MemoryView":827 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":835 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + /*else*/ { + __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); + if (__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_1 = ((__pyx_v_step < 0) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L6_bool_binop_done:; + __pyx_v_negative_step = __pyx_t_2; + + /* "View.MemoryView":837 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + __pyx_t_1 = (__pyx_v_have_step != 0); + if (__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_1 = ((__pyx_v_step == 0) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L9_bool_binop_done:; + if (__pyx_t_2) { + + /* "View.MemoryView":838 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error) + + /* "View.MemoryView":837 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + } + + /* "View.MemoryView":841 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":842 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":843 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":844 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":845 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":844 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":842 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + goto __pyx_L12; + } + + /* "View.MemoryView":846 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":847 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":848 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":847 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } + + /* "View.MemoryView":850 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; + + /* "View.MemoryView":846 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + } + __pyx_L12:; + + /* "View.MemoryView":841 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; + } + + /* "View.MemoryView":852 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":853 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":852 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L15; + } + + /* "View.MemoryView":855 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; + + /* "View.MemoryView":857 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":858 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":859 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":860 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":861 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + + /* "View.MemoryView":860 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + } + + /* "View.MemoryView":858 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + goto __pyx_L17; + } + + /* "View.MemoryView":862 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":863 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + + /* "View.MemoryView":862 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + } + __pyx_L17:; + + /* "View.MemoryView":857 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + goto __pyx_L16; + } + + /* "View.MemoryView":865 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":866 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1L; + + /* "View.MemoryView":865 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + goto __pyx_L19; + } + + /* "View.MemoryView":868 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + /*else*/ { + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L19:; + } + __pyx_L16:; + + /* "View.MemoryView":870 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":871 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + + /* "View.MemoryView":870 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + } + + /* "View.MemoryView":875 + * + * with cython.cdivision(True): + * new_shape = (stop - start) // step # <<<<<<<<<<<<<< + * + * if (stop - start) - step * new_shape: + */ + __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); + + /* "View.MemoryView":877 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":878 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + + /* "View.MemoryView":877 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + } + + /* "View.MemoryView":880 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":881 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + + /* "View.MemoryView":880 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + } + + /* "View.MemoryView":884 + * + * + * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset + */ + (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); + + /* "View.MemoryView":885 + * + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< + * dst.suboffsets[new_ndim] = suboffset + * + */ + (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; + + /* "View.MemoryView":886 + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; + } + __pyx_L3:; + + /* "View.MemoryView":889 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":890 + * + * if suboffset_dim[0] < 0: + * dst.data += start * stride # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride + */ + __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); + + /* "View.MemoryView":889 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + goto __pyx_L23; + } + + /* "View.MemoryView":892 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L23:; + + /* "View.MemoryView":894 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":895 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":896 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":897 + * if not is_slice: + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + */ + __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); + + /* "View.MemoryView":896 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + goto __pyx_L26; + } + + /* "View.MemoryView":899 + * dst.data = ( dst.data)[0] + suboffset + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< + * "must be indexed and not sliced", dim) + * else: + */ + /*else*/ { + + /* "View.MemoryView":900 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error) + } + __pyx_L26:; + + /* "View.MemoryView":895 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + goto __pyx_L25; + } + + /* "View.MemoryView":902 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; + + /* "View.MemoryView":894 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + } + + /* "View.MemoryView":904 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":807 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":910 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + +static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_suboffset; + Py_ssize_t __pyx_v_itemsize; + char *__pyx_v_resultp; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pybuffer_index", 0); + + /* "View.MemoryView":912 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1L; + + /* "View.MemoryView":913 + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< + * cdef char *resultp + * + */ + __pyx_t_1 = __pyx_v_view->itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":916 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":917 + * + * if view.ndim == 0: + * shape = view.len / itemsize # <<<<<<<<<<<<<< + * stride = itemsize + * else: + */ + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(1, 917, __pyx_L1_error) + } + else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(1, 917, __pyx_L1_error) + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":918 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":916 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + goto __pyx_L3; + } + + /* "View.MemoryView":920 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":921 + * else: + * shape = view.shape[dim] + * stride = view.strides[dim] # <<<<<<<<<<<<<< + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] + */ + __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); + + /* "View.MemoryView":922 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":923 + * stride = view.strides[dim] + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< + * + * if index < 0: + */ + __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); + + /* "View.MemoryView":922 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + } + } + __pyx_L3:; + + /* "View.MemoryView":925 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":926 + * + * if index < 0: + * index += view.shape[dim] # <<<<<<<<<<<<<< + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + */ + __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); + + /* "View.MemoryView":927 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":928 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 928, __pyx_L1_error) + + /* "View.MemoryView":927 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":925 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + } + + /* "View.MemoryView":930 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":931 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 931, __pyx_L1_error) + + /* "View.MemoryView":930 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":933 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * resultp = bufp + index * stride # <<<<<<<<<<<<<< + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset + */ + __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); + + /* "View.MemoryView":934 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":935 + * resultp = bufp + index * stride + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< + * + * return resultp + */ + __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); + + /* "View.MemoryView":934 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + } + + /* "View.MemoryView":937 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":910 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":943 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + long __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":944 + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: + * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t *shape = memslice.shape + */ + __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; + __pyx_v_ndim = __pyx_t_1; + + /* "View.MemoryView":946 + * cdef int ndim = memslice.memview.view.ndim + * + * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< + * cdef Py_ssize_t *strides = memslice.strides + * + */ + __pyx_t_2 = __pyx_v_memslice->shape; + __pyx_v_shape = __pyx_t_2; + + /* "View.MemoryView":947 + * + * cdef Py_ssize_t *shape = memslice.shape + * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_v_memslice->strides; + __pyx_v_strides = __pyx_t_2; + + /* "View.MemoryView":951 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":952 + * cdef int i, j + * for i in range(ndim / 2): + * j = ndim - 1 - i # <<<<<<<<<<<<<< + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] + */ + __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); + + /* "View.MemoryView":953 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6; + + /* "View.MemoryView":954 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":956 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L6_bool_binop_done:; + if (__pyx_t_7) { + + /* "View.MemoryView":957 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error) + + /* "View.MemoryView":956 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + } + } + + /* "View.MemoryView":959 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":943 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":976 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + +/* Python wrapper */ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":977 + * + * def __dealloc__(self): + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); + + /* "View.MemoryView":976 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":979 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":980 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":981 + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) # <<<<<<<<<<<<<< + * else: + * return memoryview.convert_item_to_object(self, itemp) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":980 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + } + + /* "View.MemoryView":983 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":979 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":985 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":986 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":987 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error) + + /* "View.MemoryView":986 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":989 + * self.to_dtype_func(itemp, value) + * else: + * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< + * + * @property + */ + /*else*/ { + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":985 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":992 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":993 + * @property + * def base(self): + * return self.from_object # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->from_object); + __pyx_r = __pyx_v_self->from_object; + goto __pyx_L0; + + /* "View.MemoryView":992 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":999 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_TypeInfo *__pyx_t_4; + Py_buffer __pyx_t_5; + Py_ssize_t *__pyx_t_6; + Py_ssize_t *__pyx_t_7; + Py_ssize_t *__pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_fromslice", 0); + + /* "View.MemoryView":1007 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1008 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "View.MemoryView":1007 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "View.MemoryView":1013 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1015 + * result = _memoryviewslice(None, 0, dtype_is_object) + * + * result.from_slice = memviewslice # <<<<<<<<<<<<<< + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + */ + __pyx_v_result->from_slice = __pyx_v_memviewslice; + + /* "View.MemoryView":1016 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":1018 + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< + * result.typeinfo = memviewslice.memview.typeinfo + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_result->from_object); + __Pyx_DECREF(__pyx_v_result->from_object); + __pyx_v_result->from_object = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":1019 + * + * result.from_object = ( memviewslice.memview).base + * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< + * + * result.view = memviewslice.memview.view + */ + __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; + __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; + + /* "View.MemoryView":1021 + * result.typeinfo = memviewslice.memview.typeinfo + * + * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + */ + __pyx_t_5 = __pyx_v_memviewslice.memview->view; + __pyx_v_result->__pyx_base.view = __pyx_t_5; + + /* "View.MemoryView":1022 + * + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + */ + __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); + + /* "View.MemoryView":1023 + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data + * result.view.ndim = ndim # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; + + /* "View.MemoryView":1024 + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; + + /* "View.MemoryView":1025 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":1027 + * Py_INCREF(Py_None) + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< + * result.flags = PyBUF_RECORDS + * else: + */ + __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1028 + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * else: + * result.flags = PyBUF_RECORDS_RO + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1027 + * Py_INCREF(Py_None) + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< + * result.flags = PyBUF_RECORDS + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1030 + * result.flags = PyBUF_RECORDS + * else: + * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + /*else*/ { + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO; + } + __pyx_L4:; + + /* "View.MemoryView":1032 + * result.flags = PyBUF_RECORDS_RO + * + * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< + * result.view.strides = result.from_slice.strides + * + */ + __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); + + /* "View.MemoryView":1033 + * + * result.view.shape = result.from_slice.shape + * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); + + /* "View.MemoryView":1036 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1037 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1038 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1039 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":1040 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L6_break; + + /* "View.MemoryView":1038 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L6_break:; + + /* "View.MemoryView":1042 + * break + * + * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< + * for length in result.view.shape[:ndim]: + * result.view.len *= length + */ + __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + + /* "View.MemoryView":1043 + * + * result.view.len = result.view.itemsize + * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< + * result.view.len *= length + * + */ + __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1044 + * result.view.len = result.view.itemsize + * for length in result.view.shape[:ndim]: + * result.view.len *= length # <<<<<<<<<<<<<< + * + * result.to_object_func = to_object_func + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1046 + * result.view.len *= length + * + * result.to_object_func = to_object_func # <<<<<<<<<<<<<< + * result.to_dtype_func = to_dtype_func + * + */ + __pyx_v_result->to_object_func = __pyx_v_to_object_func; + + /* "View.MemoryView":1047 + * + * result.to_object_func = to_object_func + * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; + + /* "View.MemoryView":1049 + * result.to_dtype_func = to_dtype_func + * + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":999 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1052 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + */ + +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) { + struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0; + __Pyx_memviewslice *__pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_slice_from_memview", 0); + + /* "View.MemoryView":1055 + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1056 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1057 + * if isinstance(memview, _memoryviewslice): + * obj = memview + * return &obj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, mslice) + */ + __pyx_r = (&__pyx_v_obj->from_slice); + goto __pyx_L0; + + /* "View.MemoryView":1055 + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1059 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1060 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1052 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1063 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) { + int __pyx_v_dim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + Py_ssize_t *__pyx_v_suboffsets; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1067 + * cdef (Py_ssize_t*) shape, strides, suboffsets + * + * shape = memview.view.shape # <<<<<<<<<<<<<< + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets + */ + __pyx_t_1 = __pyx_v_memview->view.shape; + __pyx_v_shape = __pyx_t_1; + + /* "View.MemoryView":1068 + * + * shape = memview.view.shape + * strides = memview.view.strides # <<<<<<<<<<<<<< + * suboffsets = memview.view.suboffsets + * + */ + __pyx_t_1 = __pyx_v_memview->view.strides; + __pyx_v_strides = __pyx_t_1; + + /* "View.MemoryView":1069 + * shape = memview.view.shape + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< + * + * dst.memview = <__pyx_memoryview *> memview + */ + __pyx_t_1 = __pyx_v_memview->view.suboffsets; + __pyx_v_suboffsets = __pyx_t_1; + + /* "View.MemoryView":1071 + * suboffsets = memview.view.suboffsets + * + * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< + * dst.data = memview.view.buf + * + */ + __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); + + /* "View.MemoryView":1072 + * + * dst.memview = <__pyx_memoryview *> memview + * dst.data = memview.view.buf # <<<<<<<<<<<<<< + * + * for dim in range(memview.view.ndim): + */ + __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); + + /* "View.MemoryView":1074 + * dst.data = memview.view.buf + * + * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + */ + __pyx_t_2 = __pyx_v_memview->view.ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_dim = __pyx_t_4; + + /* "View.MemoryView":1075 + * + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< + * dst.strides[dim] = strides[dim] + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 + */ + (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); + + /* "View.MemoryView":1076 + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 + * + */ + (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); + + /* "View.MemoryView":1077 + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object') + */ + if ((__pyx_v_suboffsets != 0)) { + __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_5 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5; + } + + /* "View.MemoryView":1063 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1080 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) { + __Pyx_memviewslice __pyx_v_memviewslice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy", 0); + + /* "View.MemoryView":1083 + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< + * return memoryview_copy_from_slice(memview, &memviewslice) + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); + + /* "View.MemoryView":1084 + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) + * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object_from_slice') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1080 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1087 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) { + PyObject *(*__pyx_v_to_object_func)(char *); + int (*__pyx_v_to_dtype_func)(char *, PyObject *); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *(*__pyx_t_3)(char *); + int (*__pyx_t_4)(char *, PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); + + /* "View.MemoryView":1094 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1095 + * + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + */ + __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; + __pyx_v_to_object_func = __pyx_t_3; + + /* "View.MemoryView":1096 + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< + * else: + * to_object_func = NULL + */ + __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; + __pyx_v_to_dtype_func = __pyx_t_4; + + /* "View.MemoryView":1094 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1098 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1099 + * else: + * to_object_func = NULL + * to_dtype_func = NULL # <<<<<<<<<<<<<< + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + */ + __pyx_v_to_dtype_func = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":1101 + * to_dtype_func = NULL + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< + * to_object_func, to_dtype_func, + * memview.dtype_is_object) + */ + __Pyx_XDECREF(__pyx_r); + + /* "View.MemoryView":1103 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1087 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1109 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + +static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { + Py_ssize_t __pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":1110 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + __pyx_t_1 = ((__pyx_v_arg < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1111 + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: + * return -arg # <<<<<<<<<<<<<< + * else: + * return arg + */ + __pyx_r = (-__pyx_v_arg); + goto __pyx_L0; + + /* "View.MemoryView":1110 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1113 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1109 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1116 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1121 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1122 + * cdef int i + * cdef Py_ssize_t c_stride = 0 + * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_f_stride = 0; + + /* "View.MemoryView":1124 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1125 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1126 + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1127 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1125 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1129 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_1; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1130 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1131 + * for i in range(ndim): + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1132 + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + */ + goto __pyx_L7_break; + + /* "View.MemoryView":1130 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1134 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1135 + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + * return 'C' # <<<<<<<<<<<<<< + * else: + * return 'F' + */ + __pyx_r = 'C'; + goto __pyx_L0; + + /* "View.MemoryView":1134 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1137 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1116 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1140 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + + /* "View.MemoryView":1147 + * + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + */ + __pyx_v_src_extent = (__pyx_v_src_shape[0]); + + /* "View.MemoryView":1148 + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] + */ + __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); + + /* "View.MemoryView":1149 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1150 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1152 + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1153 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + + /* "View.MemoryView":1154 + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + */ + __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride)); + } + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L5_bool_binop_done:; + + /* "View.MemoryView":1153 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + if (__pyx_t_1) { + + /* "View.MemoryView":1155 + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); + + /* "View.MemoryView":1153 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1157 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1158 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize)); + + /* "View.MemoryView":1159 + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * else: + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1160 + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L4:; + + /* "View.MemoryView":1152 + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1162 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1163 + * else: + * for i in range(dst_extent): + * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< + * dst_data, dst_strides + 1, + * src_shape + 1, dst_shape + 1, + */ + _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); + + /* "View.MemoryView":1167 + * src_shape + 1, dst_shape + 1, + * ndim - 1, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1168 + * ndim - 1, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1140 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + + /* function exit code */ +} + +/* "View.MemoryView":1170 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + +static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + + /* "View.MemoryView":1173 + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< + * src.shape, dst.shape, ndim, itemsize) + * + */ + _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1170 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1177 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef Py_ssize_t shape, size = src.memview.view.itemsize + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + + /* "View.MemoryView":1179 + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for shape in src.shape[:ndim]: + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1181 + * cdef Py_ssize_t shape, size = src.memview.view.itemsize + * + * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<< + * size *= shape + * + */ + __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim); + for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { + __pyx_t_2 = __pyx_t_4; + __pyx_v_shape = (__pyx_t_2[0]); + + /* "View.MemoryView":1182 + * + * for shape in src.shape[:ndim]: + * size *= shape # <<<<<<<<<<<<<< + * + * return size + */ + __pyx_v_size = (__pyx_v_size * __pyx_v_shape); + } + + /* "View.MemoryView":1184 + * size *= shape + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1177 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef Py_ssize_t shape, size = src.memview.view.itemsize + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1187 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1196 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + __pyx_t_1 = ((__pyx_v_order == 'F') != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1197 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride *= shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_idx = __pyx_t_4; + + /* "View.MemoryView":1198 + * if order == 'F': + * for idx in range(ndim): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride *= shape[idx] + * else: + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1199 + * for idx in range(ndim): + * strides[idx] = stride + * stride *= shape[idx] # <<<<<<<<<<<<<< + * else: + * for idx in range(ndim - 1, -1, -1): + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + + /* "View.MemoryView":1196 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1201 + * stride *= shape[idx] + * else: + * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride *= shape[idx] + */ + /*else*/ { + for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1202 + * else: + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride *= shape[idx] + * + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1203 + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride + * stride *= shape[idx] # <<<<<<<<<<<<<< + * + * return stride + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + } + __pyx_L3:; + + /* "View.MemoryView":1205 + * stride *= shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1187 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1208 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) { + int __pyx_v_i; + void *__pyx_v_result; + size_t __pyx_v_itemsize; + size_t __pyx_v_size; + void *__pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + struct __pyx_memoryview_obj *__pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":1219 + * cdef void *result + * + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef size_t size = slice_get_size(src, ndim) + * + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1220 + * + * cdef size_t itemsize = src.memview.view.itemsize + * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< + * + * result = malloc(size) + */ + __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); + + /* "View.MemoryView":1222 + * cdef size_t size = slice_get_size(src, ndim) + * + * result = malloc(size) # <<<<<<<<<<<<<< + * if not result: + * _err(MemoryError, NULL) + */ + __pyx_v_result = malloc(__pyx_v_size); + + /* "View.MemoryView":1223 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1224 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error) + + /* "View.MemoryView":1223 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1227 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1228 + * + * tmpslice.data = result + * tmpslice.memview = src.memview # <<<<<<<<<<<<<< + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + */ + __pyx_t_4 = __pyx_v_src->memview; + __pyx_v_tmpslice->memview = __pyx_t_4; + + /* "View.MemoryView":1229 + * tmpslice.data = result + * tmpslice.memview = src.memview + * for i in range(ndim): # <<<<<<<<<<<<<< + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 + */ + __pyx_t_3 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_3; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1230 + * tmpslice.memview = src.memview + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< + * tmpslice.suboffsets[i] = -1 + * + */ + (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); + + /* "View.MemoryView":1231 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1233 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order)); + + /* "View.MemoryView":1237 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_3; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1238 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1239 + * for i in range(ndim): + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< + * + * if slice_is_contig(src[0], order, ndim): + */ + (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; + + /* "View.MemoryView":1238 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1241 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1242 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size)); + + /* "View.MemoryView":1241 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1244 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1246 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1208 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = NULL; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1251 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + +static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_extents", 0); + + /* "View.MemoryView":1254 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":1253 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 1253, __pyx_L1_error) + + /* "View.MemoryView":1251 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1257 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + +static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_dim", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1258 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 1258, __pyx_L1_error) + + /* "View.MemoryView":1257 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1261 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + +static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1262 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":1263 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 1263, __pyx_L1_error) + + /* "View.MemoryView":1262 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1265 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(1, 1265, __pyx_L1_error) + } + + /* "View.MemoryView":1261 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1268 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + void *__pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":1276 + * Check for overlapping memory and verify the shapes. + * """ + * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + */ + __pyx_v_tmpdata = NULL; + + /* "View.MemoryView":1277 + * """ + * cdef void *tmpdata = NULL + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + */ + __pyx_t_1 = __pyx_v_src.memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1279 + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< + * cdef bint broadcasting = False + * cdef bint direct_copy = False + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); + + /* "View.MemoryView":1280 + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False # <<<<<<<<<<<<<< + * cdef bint direct_copy = False + * cdef __Pyx_memviewslice tmp + */ + __pyx_v_broadcasting = 0; + + /* "View.MemoryView":1281 + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False + * cdef bint direct_copy = False # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice tmp + * + */ + __pyx_v_direct_copy = 0; + + /* "View.MemoryView":1284 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1285 + * + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); + + /* "View.MemoryView":1284 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1286 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1287 + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< + * + * cdef int ndim = max(src_ndim, dst_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); + + /* "View.MemoryView":1286 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1289 + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_3 = __pyx_v_dst_ndim; + __pyx_t_4 = __pyx_v_src_ndim; + if (((__pyx_t_3 > __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_v_ndim = __pyx_t_5; + + /* "View.MemoryView":1291 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_5; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1292 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1293 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1294 + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + * broadcasting = True # <<<<<<<<<<<<<< + * src.strides[i] = 0 + * else: + */ + __pyx_v_broadcasting = 1; + + /* "View.MemoryView":1295 + * if src.shape[i] == 1: + * broadcasting = True + * src.strides[i] = 0 # <<<<<<<<<<<<<< + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) + */ + (__pyx_v_src.strides[__pyx_v_i]) = 0; + + /* "View.MemoryView":1293 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1297 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1292 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1299 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error) + + /* "View.MemoryView":1299 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + } + } + + /* "View.MemoryView":1302 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1304 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1305 + * + * if not slice_is_contig(src, order, ndim): + * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); + + /* "View.MemoryView":1304 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1307 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_7; + + /* "View.MemoryView":1308 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1302 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + } + + /* "View.MemoryView":1310 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1313 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1314 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1313 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1315 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1316 + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); + + /* "View.MemoryView":1315 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1318 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_2 = (__pyx_v_direct_copy != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1320 + * if direct_copy: + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1321 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim))); + + /* "View.MemoryView":1322 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1323 + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1324 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * if order == 'F' == get_best_order(&dst, ndim): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1318 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1310 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1326 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_8 = (__pyx_t_2 != 0); + if (__pyx_t_8) { + + /* "View.MemoryView":1329 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error) + + /* "View.MemoryView":1330 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error) + + /* "View.MemoryView":1326 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1332 + * transpose_memslice(&dst) + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1333 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + */ + copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1334 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1336 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1337 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1268 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1340 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) { + int __pyx_v_i; + int __pyx_v_offset; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1344 + * int ndim_other) nogil: + * cdef int i + * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); + + /* "View.MemoryView":1346 + * cdef int offset = ndim_other - ndim + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1347 + * + * for i in range(ndim - 1, -1, -1): + * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + */ + (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); + + /* "View.MemoryView":1348 + * for i in range(ndim - 1, -1, -1): + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<< + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + * + */ + (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1349 + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1351 + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + * + * for i in range(offset): # <<<<<<<<<<<<<< + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + */ + __pyx_t_1 = __pyx_v_offset; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1352 + * + * for i in range(offset): + * mslice.shape[i] = 1 # <<<<<<<<<<<<<< + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 + */ + (__pyx_v_mslice->shape[__pyx_v_i]) = 1; + + /* "View.MemoryView":1353 + * for i in range(offset): + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< + * mslice.suboffsets[i] = -1 + * + */ + (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); + + /* "View.MemoryView":1354 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1340 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1362 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { + int __pyx_t_1; + + /* "View.MemoryView":1366 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + __pyx_t_1 = (__pyx_v_dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1367 + * + * if dtype_is_object: + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< + * dst.strides, ndim, inc) + * + */ + __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); + + /* "View.MemoryView":1366 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1362 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + + /* function exit code */ +} + +/* "View.MemoryView":1371 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + __Pyx_RefNannyDeclarations + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); + + /* "View.MemoryView":1374 + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); + + /* "View.MemoryView":1371 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif +} + +/* "View.MemoryView":1377 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1381 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1382 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_4 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1383 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_4 = (__pyx_v_inc != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1384 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1383 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1386 + * Py_INCREF(( data)[0]) + * else: + * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + */ + /*else*/ { + Py_DECREF((((PyObject **)__pyx_v_data)[0])); + } + __pyx_L6:; + + /* "View.MemoryView":1382 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1388 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1389 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1391 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1377 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1397 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { + + /* "View.MemoryView":1400 + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1401 + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1403 + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1397 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1407 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + + /* "View.MemoryView":1411 + * size_t itemsize, void *item) nogil: + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t extent = shape[0] + * + */ + __pyx_v_stride = (__pyx_v_strides[0]); + + /* "View.MemoryView":1412 + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] + * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_extent = (__pyx_v_shape[0]); + + /* "View.MemoryView":1414 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1415 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1416 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize)); + + /* "View.MemoryView":1417 + * for i in range(extent): + * memcpy(data, item, itemsize) + * data += stride # <<<<<<<<<<<<<< + * else: + * for i in range(extent): + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + + /* "View.MemoryView":1414 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1419 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1420 + * else: + * for i in range(extent): + * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, itemsize, item) + * data += stride + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1422 + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + * data += stride # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1407 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* function exit code */ +} + +/* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = 0; + PyObject *__pyx_v___pyx_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0); + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":5 + * cdef object __pyx_result + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 6, __pyx_L1_error) + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":7 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "(tree fragment)":9 + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) + __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":10 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":11 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v___pyx_result->name); + __Pyx_DECREF(__pyx_v___pyx_result->name); + __pyx_v___pyx_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 13, __pyx_L1_error) + } + __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 > 1) != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) + __pyx_t_5 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_5; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "(tree fragment)":14 + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 14, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":11 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)o); + p->model_name = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast(PyObject *o) { + struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *p = (struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + Py_CLEAR(p->model_name); + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast[] = { + {"solve", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_3solve, METH_NOARGS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_2solve}, + {"set_new_time_steps", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_5set_new_time_steps, METH_O, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_4set_new_time_steps}, + {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_7get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_6get}, + {"print_statistics", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_9print_statistics, METH_NOARGS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_8print_statistics}, + {"store_iterate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_11store_iterate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_10store_iterate}, + {"load_iterate", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_13load_iterate, METH_O, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_12load_iterate}, + {"get_stats", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_15get_stats, METH_O, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_14get_stats}, + {"get_cost", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_17get_cost, METH_NOARGS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_16get_cost}, + {"get_residuals", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_19get_residuals, METH_NOARGS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_18get_residuals}, + {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_21set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_20set}, + {"cost_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_23cost_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_22cost_set}, + {"constraints_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_25constraints_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_24constraints_set}, + {"dynamics_get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_27dynamics_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_26dynamics_get}, + {"options_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_29options_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_28options_set}, + {"__del__", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_31__del__, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_33__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_35__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast = { + PyVarObject_HEAD_INIT(0, 0) + "acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast", /*tp_name*/ + sizeof(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "\n Class to interact with the acados ocp solver C object.\n\n :param acados_ocp: type AcadosOcp - description of the OCP for acados\n :param json_file: name for the json file used to render the templated code - default: acados_ocp_nlp.json\n :param simulink_opts: Options to configure Simulink S-function blocks, mainly to activate possible Inputs and Outputs\n ", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; +static struct __pyx_vtabstruct_array __pyx_vtable_array; + +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_array_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_array_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_array; + p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_array(PyObject *o) { + struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_array___dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->mode); + Py_CLEAR(p->_format); + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_array___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { + PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n); + if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + v = __pyx_array___getattr__(o, n); + } + return v; +} + +static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o); +} + +static PyMethodDef __pyx_methods_array[] = { + {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_array[] = { + {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_array = { + __pyx_array___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + __pyx_array___len__, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_array_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + "acados_template.acados_ocp_solver_pyx.array", /*tp_name*/ + sizeof(struct __pyx_array_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_array, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + __pyx_tp_getattro_array, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_array, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_array, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_array, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_MemviewEnum_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_MemviewEnum_obj *)o); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_Enum(PyObject *o) { + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_Enum(PyObject *o) { + PyObject* tmp; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_Enum[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_MemviewEnum = { + PyVarObject_HEAD_INIT(0, 0) + "acados_template.acados_ocp_solver_pyx.Enum", /*tp_name*/ + sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_Enum, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_MemviewEnum___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_Enum, /*tp_traverse*/ + __pyx_tp_clear_Enum, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_Enum, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_MemviewEnum___init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_Enum, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; +static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; + +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryview_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryview_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_memoryview; + p->obj = Py_None; Py_INCREF(Py_None); + p->_size = Py_None; Py_INCREF(Py_None); + p->_array_interface = Py_None; Py_INCREF(Py_None); + p->view.obj = NULL; + if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_memoryview(PyObject *o) { + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_memoryview___dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->obj); + Py_CLEAR(p->_size); + Py_CLEAR(p->_array_interface); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + if (p->obj) { + e = (*v)(p->obj, a); if (e) return e; + } + if (p->_size) { + e = (*v)(p->_size, a); if (e) return e; + } + if (p->_array_interface) { + e = (*v)(p->_array_interface, a); if (e) return e; + } + if (p->view.obj) { + e = (*v)(p->view.obj, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_memoryview(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + tmp = ((PyObject*)p->obj); + p->obj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_size); + p->_size = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_array_interface); + p->_array_interface = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + Py_CLEAR(p->view.obj); + return 0; +} +static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_memoryview___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o); +} + +static PyMethodDef __pyx_methods_memoryview[] = { + {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0}, + {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0}, + {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0}, + {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_memoryview[] = { + {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0}, + {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0}, + {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0}, + {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0}, + {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0}, + {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0}, + {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0}, + {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0}, + {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_memoryview = { + __pyx_memoryview___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_memoryview, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_memoryview = { + __pyx_memoryview___len__, /*mp_length*/ + __pyx_memoryview___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_memoryview = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_memoryview_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_memoryview = { + PyVarObject_HEAD_INIT(0, 0) + "acados_template.acados_ocp_solver_pyx.memoryview", /*tp_name*/ + sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_memoryview___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_memoryview___str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_memoryview, /*tp_traverse*/ + __pyx_tp_clear_memoryview, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_memoryview, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_memoryview, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_memoryview, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; +static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; + +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryviewslice_obj *p; + PyObject *o = __pyx_tp_new_memoryview(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryviewslice_obj *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice; + p->from_object = Py_None; Py_INCREF(Py_None); + p->from_slice.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_memoryviewslice___dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->from_object); + PyObject_GC_Track(o); + __pyx_tp_dealloc_memoryview(o); +} + +static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e; + if (p->from_object) { + e = (*v)(p->from_object, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear__memoryviewslice(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + __pyx_tp_clear_memoryview(o); + tmp = ((PyObject*)p->from_object); + p->from_object = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + __PYX_XDEC_MEMVIEW(&p->from_slice, 1); + return 0; +} + +static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o); +} + +static PyMethodDef __pyx_methods__memoryviewslice[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = { + {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_memoryviewslice = { + PyVarObject_HEAD_INIT(0, 0) + "acados_template.acados_ocp_solver_pyx._memoryviewslice", /*tp_name*/ + sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Internal class for passing memoryview slices to Python", /*tp_doc*/ + __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/ + __pyx_tp_clear__memoryviewslice, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods__memoryviewslice, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets__memoryviewslice, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new__memoryviewslice, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_acados_ocp_solver_pyx(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_acados_ocp_solver_pyx}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "acados_ocp_solver_pyx", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, + {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, + {&__pyx_n_s_AcadosOcpSolverFast, __pyx_k_AcadosOcpSolverFast, sizeof(__pyx_k_AcadosOcpSolverFast), 0, 0, 1, 1}, + {&__pyx_kp_u_AcadosOcpSolver_constraints_set, __pyx_k_AcadosOcpSolver_constraints_set, sizeof(__pyx_k_AcadosOcpSolver_constraints_set), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_cost_set_mismatc, __pyx_k_AcadosOcpSolver_cost_set_mismatc, sizeof(__pyx_k_AcadosOcpSolver_cost_set_mismatc), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_get_field_does_n, __pyx_k_AcadosOcpSolver_get_field_does_n, sizeof(__pyx_k_AcadosOcpSolver_get_field_does_n), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_get_is_an_invali, __pyx_k_AcadosOcpSolver_get_is_an_invali, sizeof(__pyx_k_AcadosOcpSolver_get_is_an_invali), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_get_stage_index, __pyx_k_AcadosOcpSolver_get_stage_index, sizeof(__pyx_k_AcadosOcpSolver_get_stage_index), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_options_set_does, __pyx_k_AcadosOcpSolver_options_set_does, sizeof(__pyx_k_AcadosOcpSolver_options_set_does), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_set_is_not_a_val, __pyx_k_AcadosOcpSolver_set_is_not_a_val, sizeof(__pyx_k_AcadosOcpSolver_set_is_not_a_val), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_set_mismatching, __pyx_k_AcadosOcpSolver_set_mismatching, sizeof(__pyx_k_AcadosOcpSolver_set_mismatching), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_solve_argument_r, __pyx_k_AcadosOcpSolver_solve_argument_r, sizeof(__pyx_k_AcadosOcpSolver_solve_argument_r), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_solve_argument_r_2, __pyx_k_AcadosOcpSolver_solve_argument_r_2, sizeof(__pyx_k_AcadosOcpSolver_solve_argument_r_2), 0, 1, 0, 0}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, + {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, + {&__pyx_n_u_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 1, 0, 1}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, + {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0}, + {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, + {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, + {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0}, + {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, + {&__pyx_n_u_SQP_RTI, __pyx_k_SQP_RTI, sizeof(__pyx_k_SQP_RTI), 0, 1, 0, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, + {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, + {&__pyx_n_s_acados_ocp, __pyx_k_acados_ocp, sizeof(__pyx_k_acados_ocp), 0, 0, 1, 1}, + {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_u_alpha_min, __pyx_k_alpha_min, sizeof(__pyx_k_alpha_min), 0, 1, 0, 1}, + {&__pyx_n_u_alpha_reduction, __pyx_k_alpha_reduction, sizeof(__pyx_k_alpha_reduction), 0, 1, 0, 1}, + {&__pyx_n_s_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1}, + {&__pyx_n_s_asfortranarray, __pyx_k_asfortranarray, sizeof(__pyx_k_asfortranarray), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_code_export_dir, __pyx_k_code_export_dir, sizeof(__pyx_k_code_export_dir), 0, 0, 1, 1}, + {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1}, + {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_kp_u_for_field_with_dimension_you_ha, __pyx_k_for_field_with_dimension_you_ha, sizeof(__pyx_k_for_field_with_dimension_you_ha), 0, 1, 0, 0}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_n_u_globalization, __pyx_k_globalization, sizeof(__pyx_k_globalization), 0, 1, 0, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_u_initialize_t_slacks, __pyx_k_initialize_t_slacks, sizeof(__pyx_k_initialize_t_slacks), 0, 1, 0, 1}, + {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, + {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, + {&__pyx_n_u_lam, __pyx_k_lam, sizeof(__pyx_k_lam), 0, 1, 0, 1}, + {&__pyx_n_u_lbu, __pyx_k_lbu, sizeof(__pyx_k_lbu), 0, 1, 0, 1}, + {&__pyx_n_u_lbx, __pyx_k_lbx, sizeof(__pyx_k_lbx), 0, 1, 0, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_model_name, __pyx_k_model_name, sizeof(__pyx_k_model_name), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_nlp_solver_type, __pyx_k_nlp_solver_type, sizeof(__pyx_k_nlp_solver_type), 0, 0, 1, 1}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0}, + {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_overwrite, __pyx_k_overwrite, sizeof(__pyx_k_overwrite), 0, 0, 1, 1}, + {&__pyx_n_u_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 1, 0, 1}, + {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_u_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 1, 0, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, + {&__pyx_n_u_print_level, __pyx_k_print_level, sizeof(__pyx_k_print_level), 0, 1, 0, 1}, + {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_n_u_rti_phase, __pyx_k_rti_phase, sizeof(__pyx_k_rti_phase), 0, 1, 0, 1}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_u_sl, __pyx_k_sl, sizeof(__pyx_k_sl), 0, 1, 0, 1}, + {&__pyx_kp_u_solver_option_must_be_of_type_fl, __pyx_k_solver_option_must_be_of_type_fl, sizeof(__pyx_k_solver_option_must_be_of_type_fl), 0, 1, 0, 0}, + {&__pyx_kp_u_solver_option_must_be_of_type_in, __pyx_k_solver_option_must_be_of_type_in, sizeof(__pyx_k_solver_option_must_be_of_type_in), 0, 1, 0, 0}, + {&__pyx_kp_u_solver_option_must_be_of_type_st, __pyx_k_solver_option_must_be_of_type_st, sizeof(__pyx_k_solver_option_must_be_of_type_st), 0, 1, 0, 0}, + {&__pyx_n_s_solver_options, __pyx_k_solver_options, sizeof(__pyx_k_solver_options), 0, 0, 1, 1}, + {&__pyx_n_s_stage, __pyx_k_stage, sizeof(__pyx_k_stage), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, + {&__pyx_n_u_step_length, __pyx_k_step_length, sizeof(__pyx_k_step_length), 0, 1, 0, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, + {&__pyx_n_u_su, __pyx_k_su, sizeof(__pyx_k_su), 0, 1, 0, 1}, + {&__pyx_n_u_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 1, 0, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_u_tol_comp, __pyx_k_tol_comp, sizeof(__pyx_k_tol_comp), 0, 1, 0, 1}, + {&__pyx_n_u_tol_eq, __pyx_k_tol_eq, sizeof(__pyx_k_tol_eq), 0, 1, 0, 1}, + {&__pyx_n_u_tol_ineq, __pyx_k_tol_ineq, sizeof(__pyx_k_tol_ineq), 0, 1, 0, 1}, + {&__pyx_n_u_tol_stat, __pyx_k_tol_stat, sizeof(__pyx_k_tol_stat), 0, 1, 0, 1}, + {&__pyx_n_u_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 1, 0, 1}, + {&__pyx_n_u_ubu, __pyx_k_ubu, sizeof(__pyx_k_ubu), 0, 1, 0, 1}, + {&__pyx_n_u_ubx, __pyx_k_ubx, sizeof(__pyx_k_ubx), 0, 1, 0, 1}, + {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, + {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, + {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_kp_u_with_dimension_you_have, __pyx_k_with_dimension_you_have, sizeof(__pyx_k_with_dimension_you_have), 0, 1, 0, 0}, + {&__pyx_n_u_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 1, 0, 1}, + {&__pyx_n_u_y_ref, __pyx_k_y_ref, sizeof(__pyx_k_y_ref), 0, 1, 0, 1}, + {&__pyx_n_u_yref, __pyx_k_yref, sizeof(__pyx_k_yref), 0, 1, 0, 1}, + {&__pyx_n_u_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 1, 0, 1}, + {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 116, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":300 + * if len(value_shape) == 1: + * value_shape = (value_shape[0], 0) + * value = np.asfortranarray(value_[None,:]) # <<<<<<<<<<<<<< + * + * elif len(value_shape) == 2: + */ + __pyx_slice__2 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__2); + __Pyx_GIVEREF(__pyx_slice__2); + __pyx_tuple__3 = PyTuple_Pack(2, Py_None, __pyx_slice__2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "acados_template/acados_ocp_solver_pyx.pyx":397 + * if field_ == 'rti_phase': + * if value_ < 0 or value_ > 2: + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' # <<<<<<<<<<<<<< + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + * if self.acados_ocp.solver_options.nlp_solver_type != 'SQP_RTI' and value_ > 0: + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_AcadosOcpSolver_solve_argument_r); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "acados_template/acados_ocp_solver_pyx.pyx":400 + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + * if self.acados_ocp.solver_options.nlp_solver_type != 'SQP_RTI' and value_ > 0: + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' # <<<<<<<<<<<<<< + * 'take only value 0 for SQP-type solvers') + * + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_AcadosOcpSolver_solve_argument_r_2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":945 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 945, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":951 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "View.MemoryView":133 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "View.MemoryView":136 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "View.MemoryView":148 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "View.MemoryView":176 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "View.MemoryView":192 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "View.MemoryView":418 + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< + * + * have_slices, index = _unellipsify(index, self.view.ndim) + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "View.MemoryView":495 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "View.MemoryView":520 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< + * + * if flags & PyBUF_ND: + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "View.MemoryView":570 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "View.MemoryView":577 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __pyx_tuple__22 = PyTuple_New(1); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_tuple__22, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "View.MemoryView":703 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "View.MemoryView":286 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "View.MemoryView":287 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "View.MemoryView":288 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "View.MemoryView":291 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "View.MemoryView":292 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_tuple__33 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast.tp_dictoffset && __pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AcadosOcpSolverFast, (PyObject *)&__pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_ptype_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast = &__pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast; + __pyx_vtabptr_array = &__pyx_vtable_array; + __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_array.tp_print = 0; + #endif + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error) + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_MemviewEnum.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error) + __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; + __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; + __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; + __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; + __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment; + __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar; + __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; + __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; + __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_memoryview.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error) + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_memoryviewslice.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error) + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initacados_ocp_solver_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initacados_ocp_solver_pyx(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_acados_ocp_solver_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_acados_ocp_solver_pyx(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_acados_ocp_solver_pyx(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + static PyThread_type_lock __pyx_t_2[8]; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'acados_ocp_solver_pyx' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_acados_ocp_solver_pyx(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("acados_ocp_solver_pyx", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_acados_template__acados_ocp_solver_pyx) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "acados_template.acados_ocp_solver_pyx")) { + if (unlikely(PyDict_SetItemString(modules, "acados_template.acados_ocp_solver_pyx", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "acados_template/acados_ocp_solver_pyx.pyx":46 + * cimport numpy as cnp + * + * import os # <<<<<<<<<<<<<< + * import numpy as np + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":47 + * + * import os + * import numpy as np # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":1 + * # -*- coding: future_fstrings -*- # <<<<<<<<<<<<<< + * # + * # Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":209 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * def __dealloc__(array self): + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":286 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":287 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":288 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":291 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":292 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":316 + * + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ + * PyThread_allocate_lock(), + */ + __pyx_memoryview_thread_locks_used = 0; + + /* "View.MemoryView":317 + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< + * PyThread_allocate_lock(), + * PyThread_allocate_lock(), + */ + __pyx_t_2[0] = PyThread_allocate_lock(); + __pyx_t_2[1] = PyThread_allocate_lock(); + __pyx_t_2[2] = PyThread_allocate_lock(); + __pyx_t_2[3] = PyThread_allocate_lock(); + __pyx_t_2[4] = PyThread_allocate_lock(); + __pyx_t_2[5] = PyThread_allocate_lock(); + __pyx_t_2[6] = PyThread_allocate_lock(); + __pyx_t_2[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + + /* "View.MemoryView":549 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":995 + * return self.from_object + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_memoryviewslice_type); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init acados_template.acados_ocp_solver_pyx", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init acados_template.acados_ocp_solver_pyx"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (__Pyx_PyFastCFunction_Check(func)) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* IsLittleEndian */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + +/* BufferFormatCheck */ +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t <= '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case '?': return "'bool'"; + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case '?': case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number, ndim; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ndim = ctx->head->field->type->ndim; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + CYTHON_FALLTHROUGH; + case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) && + (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + CYTHON_FALLTHROUGH; + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} + +/* BufferGetAndValidate */ + static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (unlikely(info->buf == NULL)) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} +static void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static int __Pyx__GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + buf->buf = NULL; + if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) { + __Pyx_ZeroBuffer(buf); + return -1; + } + if (unlikely(buf->ndim != nd)) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if (unlikely((size_t)buf->itemsize != dtype->size)) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_SafeReleaseBuffer(buf); + return -1; +} + +/* BufferIndexError */ + static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +/* GetItemInt */ + static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* MemviewSliceInit */ + static int +__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference) +{ + __Pyx_RefNannyDeclarations + int i, retval=-1; + Py_buffer *buf = &memview->view; + __Pyx_RefNannySetupContext("init_memviewslice", 0); + if (unlikely(memviewslice->memview || memviewslice->data)) { + PyErr_SetString(PyExc_ValueError, + "memviewslice is already initialized!"); + goto fail; + } + if (buf->strides) { + for (i = 0; i < ndim; i++) { + memviewslice->strides[i] = buf->strides[i]; + } + } else { + Py_ssize_t stride = buf->itemsize; + for (i = ndim - 1; i >= 0; i--) { + memviewslice->strides[i] = stride; + stride *= buf->shape[i]; + } + } + for (i = 0; i < ndim; i++) { + memviewslice->shape[i] = buf->shape[i]; + if (buf->suboffsets) { + memviewslice->suboffsets[i] = buf->suboffsets[i]; + } else { + memviewslice->suboffsets[i] = -1; + } + } + memviewslice->memview = memview; + memviewslice->data = (char *)buf->buf; + if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { + Py_INCREF(memview); + } + retval = 0; + goto no_fail; +fail: + memviewslice->memview = 0; + memviewslice->data = 0; + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} +#ifndef Py_NO_RETURN +#define Py_NO_RETURN +#endif +static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN { + va_list vargs; + char msg[200]; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + va_end(vargs); + Py_FatalError(msg); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (unlikely(!memview || (PyObject *) memview == Py_None)) + return; + if (unlikely(__pyx_get_slice_count(memview) < 0)) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (unlikely(first_time)) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (unlikely(!memview || (PyObject *) memview == Py_None)) { + memslice->memview = NULL; + return; + } + if (unlikely(__pyx_get_slice_count(memview) <= 0)) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (unlikely(last_time)) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} + +/* ObjectGetItem */ + #if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* None */ + static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* GetTopmostException */ + #if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* None */ + static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* decode_c_string */ + static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + size_t slen = strlen(cstring); + if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, + "c-string too long to convert to Python"); + return NULL; + } + length = (Py_ssize_t) slen; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + if (unlikely(stop <= start)) + return __Pyx_NewRef(__pyx_empty_unicode); + length = stop - start; + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* GetAttr3 */ + static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* RaiseTooManyValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* RaiseNoneIterError */ + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* SwapException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* FastTypeChecks */ + #if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* None */ + static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +/* ImportFrom */ + static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* HasAttr */ + static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* PyObject_GenericGetAttrNoDict */ + #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ + #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ + static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* SetupReduce */ + static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#else + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#endif +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); + if (likely(reduce_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (reduce == object_reduce || PyErr_Occurred()) { + goto __PYX_BAD; + } + setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); + if (likely(setstate_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (!setstate || PyErr_Occurred()) { + goto __PYX_BAD; + } + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto __PYX_GOOD; +__PYX_BAD: + if (!PyErr_Occurred()) + PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +__PYX_GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* SetVTable */ + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* TypeImport */ + #ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* CLineInTraceback */ + #ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ + #include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if ((0)) {} + view->obj = NULL; + Py_DECREF(obj); +} +#endif + + + /* MemviewSliceIsContig */ + static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs.memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) + return 0; + itemsize *= mvs.shape[index]; + } + return 1; +} + +/* OverlappingSlices */ + static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +/* Capsule */ + static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* TypeInfoCompare */ + static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + if (!a || !b) + return 0; + if (a == b) + return 1; + if (a->size != b->size || a->typegroup != b->typegroup || + a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { + if (a->typegroup == 'H' || b->typegroup == 'H') { + return a->size == b->size; + } else { + return 0; + } + } + if (a->ndim) { + for (i = 0; i < a->ndim; i++) + if (a->arraysize[i] != b->arraysize[i]) + return 0; + } + if (a->typegroup == 'S') { + if (a->flags != b->flags) + return 0; + if (a->fields || b->fields) { + if (!(a->fields && b->fields)) + return 0; + for (i = 0; a->fields[i].type && b->fields[i].type; i++) { + __Pyx_StructField *field_a = a->fields + i; + __Pyx_StructField *field_b = b->fields + i; + if (field_a->offset != field_b->offset || + !__pyx_typeinfo_cmp(field_a->type, field_b->type)) + return 0; + } + return !a->fields[i].type && !b->fields[i].type; + } + } + return 1; +} + +/* MemviewSliceValidateAndInit */ + static int +__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) +{ + if (buf->shape[dim] <= 1) + return 1; + if (buf->strides) { + if (spec & __Pyx_MEMVIEW_CONTIG) { + if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { + if (unlikely(buf->strides[dim] != sizeof(void *))) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly contiguous " + "in dimension %d.", dim); + goto fail; + } + } else if (unlikely(buf->strides[dim] != buf->itemsize)) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_FOLLOW) { + Py_ssize_t stride = buf->strides[dim]; + if (stride < 0) + stride = -stride; + if (unlikely(stride < buf->itemsize)) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + } else { + if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not contiguous in " + "dimension %d", dim); + goto fail; + } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not indirect in " + "dimension %d", dim); + goto fail; + } else if (unlikely(buf->suboffsets)) { + PyErr_SetString(PyExc_ValueError, + "Buffer exposes suboffsets but no strides"); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec) +{ + if (spec & __Pyx_MEMVIEW_DIRECT) { + if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) { + PyErr_Format(PyExc_ValueError, + "Buffer not compatible with direct access " + "in dimension %d.", dim); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_PTR) { + if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly accessible " + "in dimension %d.", dim); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) +{ + int i; + if (c_or_f_flag & __Pyx_IS_F_CONTIG) { + Py_ssize_t stride = 1; + for (i = 0; i < ndim; i++) { + if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) { + PyErr_SetString(PyExc_ValueError, + "Buffer not fortran contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { + Py_ssize_t stride = 1; + for (i = ndim - 1; i >- 1; i--) { + if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) { + PyErr_SetString(PyExc_ValueError, + "Buffer not C contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } + return 1; +fail: + return 0; +} +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj) +{ + struct __pyx_memoryview_obj *memview, *new_memview; + __Pyx_RefNannyDeclarations + Py_buffer *buf; + int i, spec = 0, retval = -1; + __Pyx_BufFmt_Context ctx; + int from_memoryview = __pyx_memoryview_check(original_obj); + __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); + if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) + original_obj)->typeinfo)) { + memview = (struct __pyx_memoryview_obj *) original_obj; + new_memview = NULL; + } else { + memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + original_obj, buf_flags, 0, dtype); + new_memview = memview; + if (unlikely(!memview)) + goto fail; + } + buf = &memview->view; + if (unlikely(buf->ndim != ndim)) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + ndim, buf->ndim); + goto fail; + } + if (new_memview) { + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail; + } + if (unlikely((unsigned) buf->itemsize != dtype->size)) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " + "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", + buf->itemsize, + (buf->itemsize > 1) ? "s" : "", + dtype->name, + dtype->size, + (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->len > 0) { + for (i = 0; i < ndim; i++) { + spec = axes_specs[i]; + if (unlikely(!__pyx_check_strides(buf, i, ndim, spec))) + goto fail; + if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec))) + goto fail; + } + if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))) + goto fail; + } + if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, + new_memview != NULL) == -1)) { + goto fail; + } + retval = 0; + goto no_fail; +fail: + Py_XDECREF(new_memview); + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG, + (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1, + &__Pyx_TypeInfo_double, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG, + (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2, + &__Pyx_TypeInfo_double, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG, + (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1, + &__Pyx_TypeInfo_unsigned_char, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = (float)(1.0) / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + float r = b.real / b.imag; + float s = (float)(1.0) / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_float(a, a); + case 3: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); + case 4: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_float(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = (double)(1.0) / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = (double)(1.0) / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_double(a, a); + case 3: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); + case 4: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_double(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +/* MemviewSliceCopyTemplate */ + static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object) +{ + __Pyx_RefNannyDeclarations + int i; + __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_memoryview_obj *from_memview = from_mvs->memview; + Py_buffer *buf = &from_memview->view; + PyObject *shape_tuple = NULL; + PyObject *temp_int = NULL; + struct __pyx_array_obj *array_obj = NULL; + struct __pyx_memoryview_obj *memview_obj = NULL; + __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); + for (i = 0; i < ndim; i++) { + if (unlikely(from_mvs->suboffsets[i] >= 0)) { + PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " + "indirect dimensions (axis %d)", i); + goto fail; + } + } + shape_tuple = PyTuple_New(ndim); + if (unlikely(!shape_tuple)) { + goto fail; + } + __Pyx_GOTREF(shape_tuple); + for(i = 0; i < ndim; i++) { + temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); + if(unlikely(!temp_int)) { + goto fail; + } else { + PyTuple_SET_ITEM(shape_tuple, i, temp_int); + temp_int = NULL; + } + } + array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); + if (unlikely(!array_obj)) { + goto fail; + } + __Pyx_GOTREF(array_obj); + memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + (PyObject *) array_obj, contig_flag, + dtype_is_object, + from_mvs->memview->typeinfo); + if (unlikely(!memview_obj)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) + goto fail; + if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, + dtype_is_object) < 0)) + goto fail; + goto no_fail; +fail: + __Pyx_XDECREF(new_mvs.memview); + new_mvs.memview = NULL; + new_mvs.data = NULL; +no_fail: + __Pyx_XDECREF(shape_tuple); + __Pyx_XDECREF(temp_int); + __Pyx_XDECREF(array_obj); + __Pyx_RefNannyFinishContext(); + return new_mvs; +} + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ + static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { + return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { + return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { + return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) + case -2: + if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const char neg_one = (char) -1, const_zero = (char) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (char) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) { + return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) { + return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) { + return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (char) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0]) + case -2: + if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + } +#endif + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + char val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (char) -1; + } + } else { + char val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to char"); + return (char) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; +} + +/* CheckBinaryVersion */ + static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so new file mode 100755 index 000000000..2819b10df Binary files /dev/null and b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so differ diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_solver.pxd b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_solver.pxd new file mode 100644 index 000000000..8483b21c4 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_solver.pxd @@ -0,0 +1,22 @@ +cimport acados_solver_common + +cdef extern from "acados_solver_lat.h": + ctypedef struct nlp_solver_capsule "lat_solver_capsule": + pass + + nlp_solver_capsule * acados_create_capsule "lat_acados_create_capsule"() + int acados_free_capsule "lat_acados_free_capsule"(nlp_solver_capsule *capsule) + + int acados_create "lat_acados_create"(nlp_solver_capsule * capsule) + int acados_update_params "lat_acados_update_params"(nlp_solver_capsule * capsule, int stage, double *value, int np_) + int acados_solve "lat_acados_solve"(nlp_solver_capsule * capsule) + int acados_free "lat_acados_free"(nlp_solver_capsule * capsule) + void acados_print_stats "lat_acados_print_stats"(nlp_solver_capsule * capsule) + + acados_solver_common.ocp_nlp_in *acados_get_nlp_in "lat_acados_get_nlp_in"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_out *acados_get_nlp_out "lat_acados_get_nlp_out"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_solver *acados_get_nlp_solver "lat_acados_get_nlp_solver"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_config *acados_get_nlp_config "lat_acados_get_nlp_config"(nlp_solver_capsule * capsule) + void *acados_get_nlp_opts "lat_acados_get_nlp_opts"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_dims *acados_get_nlp_dims "lat_acados_get_nlp_dims"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_plan *acados_get_nlp_plan "lat_acados_get_nlp_plan"(nlp_solver_capsule * capsule) diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_solver_lat.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_solver_lat.c new file mode 100644 index 000000000..53c5de5b1 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_solver_lat.c @@ -0,0 +1,862 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +// standard +#include +#include +// acados +#include "acados/utils/print.h" +#include "acados_c/ocp_nlp_interface.h" +#include "acados_c/external_function_interface.h" + +// example specific +#include "lat_model/lat_model.h" + + + + +#include "lat_cost/lat_cost_y_fun.h" +#include "lat_cost/lat_cost_y_0_fun.h" +#include "lat_cost/lat_cost_y_e_fun.h" + +#include "acados_solver_lat.h" + +#define NX LAT_NX +#define NZ LAT_NZ +#define NU LAT_NU +#define NP LAT_NP +#define NBX LAT_NBX +#define NBX0 LAT_NBX0 +#define NBU LAT_NBU +#define NSBX LAT_NSBX +#define NSBU LAT_NSBU +#define NSH LAT_NSH +#define NSG LAT_NSG +#define NSPHI LAT_NSPHI +#define NSHN LAT_NSHN +#define NSGN LAT_NSGN +#define NSPHIN LAT_NSPHIN +#define NSBXN LAT_NSBXN +#define NS LAT_NS +#define NSN LAT_NSN +#define NG LAT_NG +#define NBXN LAT_NBXN +#define NGN LAT_NGN +#define NY0 LAT_NY0 +#define NY LAT_NY +#define NYN LAT_NYN +// #define N LAT_N +#define NH LAT_NH +#define NPHI LAT_NPHI +#define NHN LAT_NHN +#define NPHIN LAT_NPHIN +#define NR LAT_NR + + +// ** solver data ** + +lat_solver_capsule * lat_acados_create_capsule(void) +{ + void* capsule_mem = malloc(sizeof(lat_solver_capsule)); + lat_solver_capsule *capsule = (lat_solver_capsule *) capsule_mem; + + return capsule; +} + + +int lat_acados_free_capsule(lat_solver_capsule *capsule) +{ + free(capsule); + return 0; +} + + +int lat_acados_create(lat_solver_capsule * capsule) +{ + int N_shooting_intervals = LAT_N; + double* new_time_steps = NULL; // NULL -> don't alter the code generated time-steps + return lat_acados_create_with_discretization(capsule, N_shooting_intervals, new_time_steps); +} + +int lat_acados_update_time_steps(lat_solver_capsule * capsule, int N, double* new_time_steps) +{ + if (N != capsule->nlp_solver_plan->N) { + fprintf(stderr, "lat_acados_update_time_steps: given number of time steps (= %d) " \ + "differs from the currently allocated number of " \ + "time steps (= %d)!\n" \ + "Please recreate with new discretization and provide a new vector of time_stamps!\n", + N, capsule->nlp_solver_plan->N); + return 1; + } + + ocp_nlp_config * nlp_config = capsule->nlp_config; + ocp_nlp_dims * nlp_dims = capsule->nlp_dims; + ocp_nlp_in * nlp_in = capsule->nlp_in; + + for (int i = 0; i < N; i++) + { + ocp_nlp_in_set(nlp_config, nlp_dims, nlp_in, i, "Ts", &new_time_steps[i]); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "scaling", &new_time_steps[i]); + } + return 0; +} + +int lat_acados_create_with_discretization(lat_solver_capsule * capsule, int N, double* new_time_steps) +{ + int status = 0; + // If N does not match the number of shooting intervals used for code generation, new_time_steps must be given. + if (N != LAT_N && !new_time_steps) { + fprintf(stderr, "lat_acados_create_with_discretization: new_time_steps is NULL " \ + "but the number of shooting intervals (= %d) differs from the number of " \ + "shooting intervals (= %d) during code generation! Please provide a new vector of time_stamps!\n", \ + N, LAT_N); + return 1; + } + + // number of expected runtime parameters + capsule->nlp_np = NP; + + /************************************************ + * plan & config + ************************************************/ + ocp_nlp_plan * nlp_solver_plan = ocp_nlp_plan_create(N); + capsule->nlp_solver_plan = nlp_solver_plan; + nlp_solver_plan->nlp_solver = SQP_RTI; + + nlp_solver_plan->ocp_qp_solver_plan.qp_solver = PARTIAL_CONDENSING_HPIPM; + + nlp_solver_plan->nlp_cost[0] = NONLINEAR_LS; + for (int i = 1; i < N; i++) + nlp_solver_plan->nlp_cost[i] = NONLINEAR_LS; + + nlp_solver_plan->nlp_cost[N] = NONLINEAR_LS; + + for (int i = 0; i < N; i++) + { + + nlp_solver_plan->nlp_dynamics[i] = CONTINUOUS_MODEL; + nlp_solver_plan->sim_solver_plan[i].sim_solver = ERK; + } + + for (int i = 0; i < N; i++) + { + nlp_solver_plan->nlp_constraints[i] = BGH; + } + nlp_solver_plan->nlp_constraints[N] = BGH; + ocp_nlp_config * nlp_config = ocp_nlp_config_create(*nlp_solver_plan); + capsule->nlp_config = nlp_config; + + + /************************************************ + * dimensions + ************************************************/ + #define NINTNP1MEMS 17 + int* intNp1mem = (int*)malloc( (N+1)*sizeof(int)*NINTNP1MEMS ); + + int* nx = intNp1mem + (N+1)*0; + int* nu = intNp1mem + (N+1)*1; + int* nbx = intNp1mem + (N+1)*2; + int* nbu = intNp1mem + (N+1)*3; + int* nsbx = intNp1mem + (N+1)*4; + int* nsbu = intNp1mem + (N+1)*5; + int* nsg = intNp1mem + (N+1)*6; + int* nsh = intNp1mem + (N+1)*7; + int* nsphi = intNp1mem + (N+1)*8; + int* ns = intNp1mem + (N+1)*9; + int* ng = intNp1mem + (N+1)*10; + int* nh = intNp1mem + (N+1)*11; + int* nphi = intNp1mem + (N+1)*12; + int* nz = intNp1mem + (N+1)*13; + int* ny = intNp1mem + (N+1)*14; + int* nr = intNp1mem + (N+1)*15; + int* nbxe = intNp1mem + (N+1)*16; + + for (int i = 0; i < N+1; i++) + { + // common + nx[i] = NX; + nu[i] = NU; + nz[i] = NZ; + ns[i] = NS; + // cost + ny[i] = NY; + // constraints + nbx[i] = NBX; + nbu[i] = NBU; + nsbx[i] = NSBX; + nsbu[i] = NSBU; + nsg[i] = NSG; + nsh[i] = NSH; + nsphi[i] = NSPHI; + ng[i] = NG; + nh[i] = NH; + nphi[i] = NPHI; + nr[i] = NR; + nbxe[i] = 0; + } + + // for initial state + nbx[0] = NBX0; + nsbx[0] = 0; + ns[0] = NS - NSBX; + nbxe[0] = 4; + ny[0] = NY0; + + // terminal - common + nu[N] = 0; + nz[N] = 0; + ns[N] = NSN; + // cost + ny[N] = NYN; + // constraint + nbx[N] = NBXN; + nbu[N] = 0; + ng[N] = NGN; + nh[N] = NHN; + nphi[N] = NPHIN; + nr[N] = 0; + + nsbx[N] = NSBXN; + nsbu[N] = 0; + nsg[N] = NSGN; + nsh[N] = NSHN; + nsphi[N] = NSPHIN; + + /* create and set ocp_nlp_dims */ + ocp_nlp_dims * nlp_dims = ocp_nlp_dims_create(nlp_config); + capsule->nlp_dims = nlp_dims; + + ocp_nlp_dims_set_opt_vars(nlp_config, nlp_dims, "nx", nx); + ocp_nlp_dims_set_opt_vars(nlp_config, nlp_dims, "nu", nu); + ocp_nlp_dims_set_opt_vars(nlp_config, nlp_dims, "nz", nz); + ocp_nlp_dims_set_opt_vars(nlp_config, nlp_dims, "ns", ns); + + for (int i = 0; i <= N; i++) + { + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nbx", &nbx[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nbu", &nbu[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nsbx", &nsbx[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nsbu", &nsbu[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "ng", &ng[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nsg", &nsg[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nbxe", &nbxe[i]); + } + ocp_nlp_dims_set_cost(nlp_config, nlp_dims, 0, "ny", &ny[0]); + for (int i = 1; i < N; i++) + ocp_nlp_dims_set_cost(nlp_config, nlp_dims, i, "ny", &ny[i]); + + for (int i = 0; i < N; i++) + { + } + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, N, "nh", &nh[N]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, N, "nsh", &nsh[N]); + ocp_nlp_dims_set_cost(nlp_config, nlp_dims, N, "ny", &ny[N]); + + free(intNp1mem); + + + + /************************************************ + * external functions + ************************************************/ + + + // explicit ode + capsule->forw_vde_casadi = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->forw_vde_casadi[i].casadi_fun = &lat_expl_vde_forw; + capsule->forw_vde_casadi[i].casadi_n_in = &lat_expl_vde_forw_n_in; + capsule->forw_vde_casadi[i].casadi_n_out = &lat_expl_vde_forw_n_out; + capsule->forw_vde_casadi[i].casadi_sparsity_in = &lat_expl_vde_forw_sparsity_in; + capsule->forw_vde_casadi[i].casadi_sparsity_out = &lat_expl_vde_forw_sparsity_out; + capsule->forw_vde_casadi[i].casadi_work = &lat_expl_vde_forw_work; + external_function_param_casadi_create(&capsule->forw_vde_casadi[i], 2); + } + + capsule->expl_ode_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->expl_ode_fun[i].casadi_fun = &lat_expl_ode_fun; + capsule->expl_ode_fun[i].casadi_n_in = &lat_expl_ode_fun_n_in; + capsule->expl_ode_fun[i].casadi_n_out = &lat_expl_ode_fun_n_out; + capsule->expl_ode_fun[i].casadi_sparsity_in = &lat_expl_ode_fun_sparsity_in; + capsule->expl_ode_fun[i].casadi_sparsity_out = &lat_expl_ode_fun_sparsity_out; + capsule->expl_ode_fun[i].casadi_work = &lat_expl_ode_fun_work; + external_function_param_casadi_create(&capsule->expl_ode_fun[i], 2); + } + + + // nonlinear least square function + capsule->cost_y_0_fun.casadi_fun = &lat_cost_y_0_fun; + capsule->cost_y_0_fun.casadi_n_in = &lat_cost_y_0_fun_n_in; + capsule->cost_y_0_fun.casadi_n_out = &lat_cost_y_0_fun_n_out; + capsule->cost_y_0_fun.casadi_sparsity_in = &lat_cost_y_0_fun_sparsity_in; + capsule->cost_y_0_fun.casadi_sparsity_out = &lat_cost_y_0_fun_sparsity_out; + capsule->cost_y_0_fun.casadi_work = &lat_cost_y_0_fun_work; + external_function_param_casadi_create(&capsule->cost_y_0_fun, 2); + + capsule->cost_y_0_fun_jac_ut_xt.casadi_fun = &lat_cost_y_0_fun_jac_ut_xt; + capsule->cost_y_0_fun_jac_ut_xt.casadi_n_in = &lat_cost_y_0_fun_jac_ut_xt_n_in; + capsule->cost_y_0_fun_jac_ut_xt.casadi_n_out = &lat_cost_y_0_fun_jac_ut_xt_n_out; + capsule->cost_y_0_fun_jac_ut_xt.casadi_sparsity_in = &lat_cost_y_0_fun_jac_ut_xt_sparsity_in; + capsule->cost_y_0_fun_jac_ut_xt.casadi_sparsity_out = &lat_cost_y_0_fun_jac_ut_xt_sparsity_out; + capsule->cost_y_0_fun_jac_ut_xt.casadi_work = &lat_cost_y_0_fun_jac_ut_xt_work; + external_function_param_casadi_create(&capsule->cost_y_0_fun_jac_ut_xt, 2); + + capsule->cost_y_0_hess.casadi_fun = &lat_cost_y_0_hess; + capsule->cost_y_0_hess.casadi_n_in = &lat_cost_y_0_hess_n_in; + capsule->cost_y_0_hess.casadi_n_out = &lat_cost_y_0_hess_n_out; + capsule->cost_y_0_hess.casadi_sparsity_in = &lat_cost_y_0_hess_sparsity_in; + capsule->cost_y_0_hess.casadi_sparsity_out = &lat_cost_y_0_hess_sparsity_out; + capsule->cost_y_0_hess.casadi_work = &lat_cost_y_0_hess_work; + external_function_param_casadi_create(&capsule->cost_y_0_hess, 2); + // nonlinear least squares cost + capsule->cost_y_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N-1; i++) + { + capsule->cost_y_fun[i].casadi_fun = &lat_cost_y_fun; + capsule->cost_y_fun[i].casadi_n_in = &lat_cost_y_fun_n_in; + capsule->cost_y_fun[i].casadi_n_out = &lat_cost_y_fun_n_out; + capsule->cost_y_fun[i].casadi_sparsity_in = &lat_cost_y_fun_sparsity_in; + capsule->cost_y_fun[i].casadi_sparsity_out = &lat_cost_y_fun_sparsity_out; + capsule->cost_y_fun[i].casadi_work = &lat_cost_y_fun_work; + + external_function_param_casadi_create(&capsule->cost_y_fun[i], 2); + } + + capsule->cost_y_fun_jac_ut_xt = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N-1; i++) + { + capsule->cost_y_fun_jac_ut_xt[i].casadi_fun = &lat_cost_y_fun_jac_ut_xt; + capsule->cost_y_fun_jac_ut_xt[i].casadi_n_in = &lat_cost_y_fun_jac_ut_xt_n_in; + capsule->cost_y_fun_jac_ut_xt[i].casadi_n_out = &lat_cost_y_fun_jac_ut_xt_n_out; + capsule->cost_y_fun_jac_ut_xt[i].casadi_sparsity_in = &lat_cost_y_fun_jac_ut_xt_sparsity_in; + capsule->cost_y_fun_jac_ut_xt[i].casadi_sparsity_out = &lat_cost_y_fun_jac_ut_xt_sparsity_out; + capsule->cost_y_fun_jac_ut_xt[i].casadi_work = &lat_cost_y_fun_jac_ut_xt_work; + + external_function_param_casadi_create(&capsule->cost_y_fun_jac_ut_xt[i], 2); + } + + capsule->cost_y_hess = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N-1; i++) + { + capsule->cost_y_hess[i].casadi_fun = &lat_cost_y_hess; + capsule->cost_y_hess[i].casadi_n_in = &lat_cost_y_hess_n_in; + capsule->cost_y_hess[i].casadi_n_out = &lat_cost_y_hess_n_out; + capsule->cost_y_hess[i].casadi_sparsity_in = &lat_cost_y_hess_sparsity_in; + capsule->cost_y_hess[i].casadi_sparsity_out = &lat_cost_y_hess_sparsity_out; + capsule->cost_y_hess[i].casadi_work = &lat_cost_y_hess_work; + + external_function_param_casadi_create(&capsule->cost_y_hess[i], 2); + } + // nonlinear least square function + capsule->cost_y_e_fun.casadi_fun = &lat_cost_y_e_fun; + capsule->cost_y_e_fun.casadi_n_in = &lat_cost_y_e_fun_n_in; + capsule->cost_y_e_fun.casadi_n_out = &lat_cost_y_e_fun_n_out; + capsule->cost_y_e_fun.casadi_sparsity_in = &lat_cost_y_e_fun_sparsity_in; + capsule->cost_y_e_fun.casadi_sparsity_out = &lat_cost_y_e_fun_sparsity_out; + capsule->cost_y_e_fun.casadi_work = &lat_cost_y_e_fun_work; + external_function_param_casadi_create(&capsule->cost_y_e_fun, 2); + + capsule->cost_y_e_fun_jac_ut_xt.casadi_fun = &lat_cost_y_e_fun_jac_ut_xt; + capsule->cost_y_e_fun_jac_ut_xt.casadi_n_in = &lat_cost_y_e_fun_jac_ut_xt_n_in; + capsule->cost_y_e_fun_jac_ut_xt.casadi_n_out = &lat_cost_y_e_fun_jac_ut_xt_n_out; + capsule->cost_y_e_fun_jac_ut_xt.casadi_sparsity_in = &lat_cost_y_e_fun_jac_ut_xt_sparsity_in; + capsule->cost_y_e_fun_jac_ut_xt.casadi_sparsity_out = &lat_cost_y_e_fun_jac_ut_xt_sparsity_out; + capsule->cost_y_e_fun_jac_ut_xt.casadi_work = &lat_cost_y_e_fun_jac_ut_xt_work; + external_function_param_casadi_create(&capsule->cost_y_e_fun_jac_ut_xt, 2); + + capsule->cost_y_e_hess.casadi_fun = &lat_cost_y_e_hess; + capsule->cost_y_e_hess.casadi_n_in = &lat_cost_y_e_hess_n_in; + capsule->cost_y_e_hess.casadi_n_out = &lat_cost_y_e_hess_n_out; + capsule->cost_y_e_hess.casadi_sparsity_in = &lat_cost_y_e_hess_sparsity_in; + capsule->cost_y_e_hess.casadi_sparsity_out = &lat_cost_y_e_hess_sparsity_out; + capsule->cost_y_e_hess.casadi_work = &lat_cost_y_e_hess_work; + external_function_param_casadi_create(&capsule->cost_y_e_hess, 2); + + /************************************************ + * nlp_in + ************************************************/ + ocp_nlp_in * nlp_in = ocp_nlp_in_create(nlp_config, nlp_dims); + capsule->nlp_in = nlp_in; + + // set up time_steps + + + if (new_time_steps) { + lat_acados_update_time_steps(capsule, N, new_time_steps); + } else {// time_steps are different + double* time_steps = malloc(N*sizeof(double)); + time_steps[0] = 0.009765625; + time_steps[1] = 0.029296875; + time_steps[2] = 0.048828125; + time_steps[3] = 0.068359375; + time_steps[4] = 0.087890625; + time_steps[5] = 0.107421875; + time_steps[6] = 0.126953125; + time_steps[7] = 0.146484375; + time_steps[8] = 0.166015625; + time_steps[9] = 0.185546875; + time_steps[10] = 0.205078125; + time_steps[11] = 0.224609375; + time_steps[12] = 0.244140625; + time_steps[13] = 0.263671875; + time_steps[14] = 0.283203125; + time_steps[15] = 0.302734375; + lat_acados_update_time_steps(capsule, N, time_steps); + free(time_steps); + } + + /**** Dynamics ****/ + for (int i = 0; i < N; i++) + { + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "expl_vde_forw", &capsule->forw_vde_casadi[i]); + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "expl_ode_fun", &capsule->expl_ode_fun[i]); + + } + + + /**** Cost ****/ + + double* W_0 = calloc(NY0*NY0, sizeof(double)); + // change only the non-zero elements: + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "W", W_0); + free(W_0); + + double* yref_0 = calloc(NY0, sizeof(double)); + // change only the non-zero elements: + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "yref", yref_0); + free(yref_0); + + + + double* W = calloc(NY*NY, sizeof(double)); + // change only the non-zero elements: + + + double* yref = calloc(NY, sizeof(double)); + // change only the non-zero elements: + + for (int i = 1; i < N; i++) + { + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "W", W); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "yref", yref); + } + free(W); + free(yref); + + + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "nls_y_fun", &capsule->cost_y_0_fun); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "nls_y_fun_jac", &capsule->cost_y_0_fun_jac_ut_xt); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "nls_y_hess", &capsule->cost_y_0_hess); + for (int i = 1; i < N; i++) + { + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "nls_y_fun", &capsule->cost_y_fun[i-1]); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "nls_y_fun_jac", &capsule->cost_y_fun_jac_ut_xt[i-1]); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "nls_y_hess", &capsule->cost_y_hess[i-1]); + } + + + + + // terminal cost + + + double* yref_e = calloc(NYN, sizeof(double)); + // change only the non-zero elements: + + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "yref", yref_e); + free(yref_e); + + double* W_e = calloc(NYN*NYN, sizeof(double)); + // change only the non-zero elements: + + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "W", W_e); + free(W_e); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "nls_y_fun", &capsule->cost_y_e_fun); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "nls_y_fun_jac", &capsule->cost_y_e_fun_jac_ut_xt); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "nls_y_hess", &capsule->cost_y_e_hess); + + + + /**** Constraints ****/ + + // bounds for initial stage + + // x0 + int* idxbx0 = malloc(NBX0 * sizeof(int)); + idxbx0[0] = 0; + idxbx0[1] = 1; + idxbx0[2] = 2; + idxbx0[3] = 3; + + double* lubx0 = calloc(2*NBX0, sizeof(double)); + double* lbx0 = lubx0; + double* ubx0 = lubx0 + NBX0; + // change only the non-zero elements: + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "idxbx", idxbx0); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "lbx", lbx0); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "ubx", ubx0); + free(idxbx0); + free(lubx0); + + + // idxbxe_0 + int* idxbxe_0 = malloc(4 * sizeof(int)); + + idxbxe_0[0] = 0; + idxbxe_0[1] = 1; + idxbxe_0[2] = 2; + idxbxe_0[3] = 3; + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "idxbxe", idxbxe_0); + free(idxbxe_0); + + + /* constraints that are the same for initial and intermediate */ + + + + + + + + + + + + + + // x + int* idxbx = malloc(NBX * sizeof(int)); + + idxbx[0] = 2; + idxbx[1] = 3; + double* lubx = calloc(2*NBX, sizeof(double)); + double* lbx = lubx; + double* ubx = lubx + NBX; + + lbx[0] = -1.5707963267948966; + ubx[0] = 1.5707963267948966; + lbx[1] = -0.8726646259971648; + ubx[1] = 0.8726646259971648; + + for (int i = 1; i < N; i++) + { + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "idxbx", idxbx); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "lbx", lbx); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "ubx", ubx); + } + free(idxbx); + free(lubx); + + + + + + + + + /* terminal constraints */ + + + + + + + + + + + + + + + + + + /************************************************ + * opts + ************************************************/ + + capsule->nlp_opts = ocp_nlp_solver_opts_create(nlp_config, nlp_dims); + + + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "globalization", "fixed_step"); + + // set collocation type (relevant for implicit integrators) + sim_collocation_type collocation_type = GAUSS_LEGENDRE; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_collocation_type", &collocation_type); + + // set up sim_method_num_steps + // all sim_method_num_steps are identical + int sim_method_num_steps = 1; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_num_steps", &sim_method_num_steps); + + // set up sim_method_num_stages + // all sim_method_num_stages are identical + int sim_method_num_stages = 4; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_num_stages", &sim_method_num_stages); + + int newton_iter_val = 3; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_newton_iter", &newton_iter_val); + + + // set up sim_method_jac_reuse + bool tmp_bool = (bool) 0; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_jac_reuse", &tmp_bool); + + double nlp_solver_step_length = 1; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "step_length", &nlp_solver_step_length); + + double levenberg_marquardt = 0; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "levenberg_marquardt", &levenberg_marquardt); + + /* options QP solver */ + int qp_solver_cond_N; + qp_solver_cond_N = 1; + + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "qp_cond_N", &qp_solver_cond_N); + + + int qp_solver_iter_max = 1; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "qp_iter_max", &qp_solver_iter_max); + + int print_level = 0; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "print_level", &print_level); + + + int ext_cost_num_hess = 0; + + + /* out */ + ocp_nlp_out * nlp_out = ocp_nlp_out_create(nlp_config, nlp_dims); + capsule->nlp_out = nlp_out; + + // initialize primal solution + double* xu0 = calloc(NX+NU, sizeof(double)); + double* x0 = xu0; + + // initialize with x0 + + + + double* u0 = xu0 + NX; + + for (int i = 0; i < N; i++) + { + // x0 + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, i, "x", x0); + // u0 + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, i, "u", u0); + } + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, N, "x", x0); + free(xu0); + + capsule->nlp_solver = ocp_nlp_solver_create(nlp_config, nlp_dims, capsule->nlp_opts); + + + + // initialize parameters to nominal value + double* p = calloc(NP, sizeof(double)); + + + for (int i = 0; i <= N; i++) + { + lat_acados_update_params(capsule, i, p, NP); + } + free(p); + + status = ocp_nlp_precompute(capsule->nlp_solver, nlp_in, nlp_out); + + if (status != ACADOS_SUCCESS) + { + printf("\nocp_precompute failed!\n\n"); + exit(1); + } + + return status; +} + + +int lat_acados_update_params(lat_solver_capsule * capsule, int stage, double *p, int np) +{ + int solver_status = 0; + + int casadi_np = 2; + if (casadi_np != np) { + printf("acados_update_params: trying to set %i parameters for external functions." + " External function has %i parameters. Exiting.\n", np, casadi_np); + exit(1); + } + const int N = capsule->nlp_solver_plan->N; + if (stage < N && stage >= 0) + { + capsule->forw_vde_casadi[stage].set_param(capsule->forw_vde_casadi+stage, p); + capsule->expl_ode_fun[stage].set_param(capsule->expl_ode_fun+stage, p); + + + // constraints + + + // cost + if (stage == 0) + { + capsule->cost_y_0_fun.set_param(&capsule->cost_y_0_fun, p); + capsule->cost_y_0_fun_jac_ut_xt.set_param(&capsule->cost_y_0_fun_jac_ut_xt, p); + capsule->cost_y_0_hess.set_param(&capsule->cost_y_0_hess, p); + } + else // 0 < stage < N + { + capsule->cost_y_fun[stage-1].set_param(capsule->cost_y_fun+stage-1, p); + capsule->cost_y_fun_jac_ut_xt[stage-1].set_param(capsule->cost_y_fun_jac_ut_xt+stage-1, p); + capsule->cost_y_hess[stage-1].set_param(capsule->cost_y_hess+stage-1, p); + } + } + + else // stage == N + { + // terminal shooting node has no dynamics + // cost + capsule->cost_y_e_fun.set_param(&capsule->cost_y_e_fun, p); + capsule->cost_y_e_fun_jac_ut_xt.set_param(&capsule->cost_y_e_fun_jac_ut_xt, p); + capsule->cost_y_e_hess.set_param(&capsule->cost_y_e_hess, p); + // constraints + + } + + + return solver_status; +} + + + +int lat_acados_solve(lat_solver_capsule * capsule) +{ + // solve NLP + int solver_status = ocp_nlp_solve(capsule->nlp_solver, capsule->nlp_in, capsule->nlp_out); + + return solver_status; +} + + +int lat_acados_free(lat_solver_capsule * capsule) +{ + // before destroying, keep some info + const int N = capsule->nlp_solver_plan->N; + // free memory + ocp_nlp_solver_opts_destroy(capsule->nlp_opts); + ocp_nlp_in_destroy(capsule->nlp_in); + ocp_nlp_out_destroy(capsule->nlp_out); + ocp_nlp_solver_destroy(capsule->nlp_solver); + ocp_nlp_dims_destroy(capsule->nlp_dims); + ocp_nlp_config_destroy(capsule->nlp_config); + ocp_nlp_plan_destroy(capsule->nlp_solver_plan); + + /* free external function */ + // dynamics + for (int i = 0; i < N; i++) + { + external_function_param_casadi_free(&capsule->forw_vde_casadi[i]); + external_function_param_casadi_free(&capsule->expl_ode_fun[i]); + } + free(capsule->forw_vde_casadi); + free(capsule->expl_ode_fun); + + // cost + external_function_param_casadi_free(&capsule->cost_y_0_fun); + external_function_param_casadi_free(&capsule->cost_y_0_fun_jac_ut_xt); + external_function_param_casadi_free(&capsule->cost_y_0_hess); + for (int i = 0; i < N - 1; i++) + { + external_function_param_casadi_free(&capsule->cost_y_fun[i]); + external_function_param_casadi_free(&capsule->cost_y_fun_jac_ut_xt[i]); + external_function_param_casadi_free(&capsule->cost_y_hess[i]); + } + free(capsule->cost_y_fun); + free(capsule->cost_y_fun_jac_ut_xt); + free(capsule->cost_y_hess); + external_function_param_casadi_free(&capsule->cost_y_e_fun); + external_function_param_casadi_free(&capsule->cost_y_e_fun_jac_ut_xt); + external_function_param_casadi_free(&capsule->cost_y_e_hess); + + // constraints + + return 0; +} + +ocp_nlp_in *lat_acados_get_nlp_in(lat_solver_capsule * capsule) { return capsule->nlp_in; } +ocp_nlp_out *lat_acados_get_nlp_out(lat_solver_capsule * capsule) { return capsule->nlp_out; } +ocp_nlp_solver *lat_acados_get_nlp_solver(lat_solver_capsule * capsule) { return capsule->nlp_solver; } +ocp_nlp_config *lat_acados_get_nlp_config(lat_solver_capsule * capsule) { return capsule->nlp_config; } +void *lat_acados_get_nlp_opts(lat_solver_capsule * capsule) { return capsule->nlp_opts; } +ocp_nlp_dims *lat_acados_get_nlp_dims(lat_solver_capsule * capsule) { return capsule->nlp_dims; } +ocp_nlp_plan *lat_acados_get_nlp_plan(lat_solver_capsule * capsule) { return capsule->nlp_solver_plan; } + + +void lat_acados_print_stats(lat_solver_capsule * capsule) +{ + int sqp_iter, stat_m, stat_n, tmp_int; + ocp_nlp_get(capsule->nlp_config, capsule->nlp_solver, "sqp_iter", &sqp_iter); + ocp_nlp_get(capsule->nlp_config, capsule->nlp_solver, "stat_n", &stat_n); + ocp_nlp_get(capsule->nlp_config, capsule->nlp_solver, "stat_m", &stat_m); + + + double stat[1000]; + ocp_nlp_get(capsule->nlp_config, capsule->nlp_solver, "statistics", stat); + + int nrow = sqp_iter+1 < stat_m ? sqp_iter+1 : stat_m; + + printf("iter\tres_stat\tres_eq\t\tres_ineq\tres_comp\tqp_stat\tqp_iter\n"); + for (int i = 0; i < nrow; i++) + { + for (int j = 0; j < stat_n + 1; j++) + { + if (j == 0 || j > 4) + { + tmp_int = (int) stat[i + j * nrow]; + printf("%d\t", tmp_int); + } + else + { + printf("%e\t", stat[i + j * nrow]); + } + } + printf("\n"); + } +} + diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_solver_lat.h b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_solver_lat.h new file mode 100644 index 000000000..1ffb80e14 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_solver_lat.h @@ -0,0 +1,156 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +#ifndef ACADOS_SOLVER_lat_H_ +#define ACADOS_SOLVER_lat_H_ + +#include "acados_c/ocp_nlp_interface.h" +#include "acados_c/external_function_interface.h" + +#define LAT_NX 4 +#define LAT_NZ 0 +#define LAT_NU 1 +#define LAT_NP 2 +#define LAT_NBX 2 +#define LAT_NBX0 4 +#define LAT_NBU 0 +#define LAT_NSBX 0 +#define LAT_NSBU 0 +#define LAT_NSH 0 +#define LAT_NSG 0 +#define LAT_NSPHI 0 +#define LAT_NSHN 0 +#define LAT_NSGN 0 +#define LAT_NSPHIN 0 +#define LAT_NSBXN 0 +#define LAT_NS 0 +#define LAT_NSN 0 +#define LAT_NG 0 +#define LAT_NBXN 0 +#define LAT_NGN 0 +#define LAT_NY0 3 +#define LAT_NY 3 +#define LAT_NYN 2 +#define LAT_N 16 +#define LAT_NH 0 +#define LAT_NPHI 0 +#define LAT_NHN 0 +#define LAT_NPHIN 0 +#define LAT_NR 0 + +#ifdef __cplusplus +extern "C" { +#endif + +// ** capsule for solver data ** +typedef struct lat_solver_capsule +{ + // acados objects + ocp_nlp_in *nlp_in; + ocp_nlp_out *nlp_out; + ocp_nlp_solver *nlp_solver; + void *nlp_opts; + ocp_nlp_plan *nlp_solver_plan; + ocp_nlp_config *nlp_config; + ocp_nlp_dims *nlp_dims; + + // number of expected runtime parameters + unsigned int nlp_np; + + /* external functions */ + // dynamics + + external_function_param_casadi *forw_vde_casadi; + external_function_param_casadi *expl_ode_fun; + + + + + // cost + + external_function_param_casadi *cost_y_fun; + external_function_param_casadi *cost_y_fun_jac_ut_xt; + external_function_param_casadi *cost_y_hess; + + + external_function_param_casadi cost_y_0_fun; + external_function_param_casadi cost_y_0_fun_jac_ut_xt; + external_function_param_casadi cost_y_0_hess; + + + + external_function_param_casadi cost_y_e_fun; + external_function_param_casadi cost_y_e_fun_jac_ut_xt; + external_function_param_casadi cost_y_e_hess; + + + // constraints + + + + +} lat_solver_capsule; + +lat_solver_capsule * lat_acados_create_capsule(void); +int lat_acados_free_capsule(lat_solver_capsule *capsule); + +int lat_acados_create(lat_solver_capsule * capsule); +/** + * Generic version of lat_acados_create which allows to use a different number of shooting intervals than + * the number used for code generation. If new_time_steps=NULL and n_time_steps matches the number used for code + * generation, the time-steps from code generation is used. + */ +int lat_acados_create_with_discretization(lat_solver_capsule * capsule, int n_time_steps, double* new_time_steps); +/** + * Update the time step vector. Number N must be identical to the currently set number of shooting nodes in the + * nlp_solver_plan. Returns 0 if no error occurred and a otherwise a value other than 0. + */ +int lat_acados_update_time_steps(lat_solver_capsule * capsule, int N, double* new_time_steps); +int lat_acados_update_params(lat_solver_capsule * capsule, int stage, double *value, int np); +int lat_acados_solve(lat_solver_capsule * capsule); +int lat_acados_free(lat_solver_capsule * capsule); +void lat_acados_print_stats(lat_solver_capsule * capsule); + +ocp_nlp_in *lat_acados_get_nlp_in(lat_solver_capsule * capsule); +ocp_nlp_out *lat_acados_get_nlp_out(lat_solver_capsule * capsule); +ocp_nlp_solver *lat_acados_get_nlp_solver(lat_solver_capsule * capsule); +ocp_nlp_config *lat_acados_get_nlp_config(lat_solver_capsule * capsule); +void *lat_acados_get_nlp_opts(lat_solver_capsule * capsule); +ocp_nlp_dims *lat_acados_get_nlp_dims(lat_solver_capsule * capsule); +ocp_nlp_plan *lat_acados_get_nlp_plan(lat_solver_capsule * capsule); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_SOLVER_lat_H_ diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_0_fun.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_0_fun.c new file mode 100644 index 000000000..8bdbd2750 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_0_fun.c @@ -0,0 +1,154 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) lat_cost_y_0_fun_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[6] = {2, 1, 0, 2, 0, 1}; +static const casadi_int casadi_s3[7] = {3, 1, 0, 3, 0, 1, 2}; + +/* lat_cost_y_0_fun:(i0[4],i1,i2[2])->(o0[3]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a2, a3; + a0=arg[0]? arg[0][1] : 0; + if (res[0]!=0) res[0][0]=a0; + a0=arg[2]? arg[2][0] : 0; + a1=5.; + a2=(a0+a1); + a3=arg[0]? arg[0][2] : 0; + a2=(a2*a3); + if (res[0]!=0) res[0][1]=a2; + a2=4.; + a0=(a0+a1); + a2=(a2*a0); + a0=arg[1]? arg[1][0] : 0; + a2=(a2*a0); + if (res[0]!=0) res[0][2]=a2; + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_fun(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_fun_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_fun_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_0_fun_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_fun_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_0_fun_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_0_fun_incref(void) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_0_fun_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_0_fun_n_in(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_0_fun_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real lat_cost_y_0_fun_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_0_fun_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_0_fun_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_0_fun_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_0_fun_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_fun_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 3; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_0_fun.h b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_0_fun.h new file mode 100644 index 000000000..842fc03df --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_0_fun.h @@ -0,0 +1,69 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef lat_Y_0_COST +#define lat_Y_0_COST + +#ifdef __cplusplus +extern "C" { +#endif + + +int lat_cost_y_0_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int lat_cost_y_0_fun_work(int *, int *, int *, int *); +const int *lat_cost_y_0_fun_sparsity_in(int); +const int *lat_cost_y_0_fun_sparsity_out(int); +int lat_cost_y_0_fun_n_in(void); +int lat_cost_y_0_fun_n_out(void); + +int lat_cost_y_0_fun_jac_ut_xt(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int lat_cost_y_0_fun_jac_ut_xt_work(int *, int *, int *, int *); +const int *lat_cost_y_0_fun_jac_ut_xt_sparsity_in(int); +const int *lat_cost_y_0_fun_jac_ut_xt_sparsity_out(int); +int lat_cost_y_0_fun_jac_ut_xt_n_in(void); +int lat_cost_y_0_fun_jac_ut_xt_n_out(void); + +int lat_cost_y_0_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int lat_cost_y_0_hess_work(int *, int *, int *, int *); +const int *lat_cost_y_0_hess_sparsity_in(int); +const int *lat_cost_y_0_hess_sparsity_out(int); +int lat_cost_y_0_hess_n_in(void); +int lat_cost_y_0_hess_n_out(void); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // lat_Y_0_COST diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_0_fun_jac_ut_xt.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_0_fun_jac_ut_xt.c new file mode 100644 index 000000000..f8f0b6ad0 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_0_fun_jac_ut_xt.c @@ -0,0 +1,162 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) lat_cost_y_0_fun_jac_ut_xt_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_s4 CASADI_PREFIX(s4) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[6] = {2, 1, 0, 2, 0, 1}; +static const casadi_int casadi_s3[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s4[9] = {5, 3, 0, 1, 2, 3, 2, 3, 0}; + +/* lat_cost_y_0_fun_jac_ut_xt:(i0[4],i1,i2[2])->(o0[3],o1[5x3,3nz]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a2, a3; + a0=arg[0]? arg[0][1] : 0; + if (res[0]!=0) res[0][0]=a0; + a0=arg[2]? arg[2][0] : 0; + a1=5.; + a2=(a0+a1); + a3=arg[0]? arg[0][2] : 0; + a3=(a2*a3); + if (res[0]!=0) res[0][1]=a3; + a3=4.; + a0=(a0+a1); + a3=(a3*a0); + a0=arg[1]? arg[1][0] : 0; + a0=(a3*a0); + if (res[0]!=0) res[0][2]=a0; + a0=1.; + if (res[1]!=0) res[1][0]=a0; + if (res[1]!=0) res[1][1]=a2; + if (res[1]!=0) res[1][2]=a3; + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_fun_jac_ut_xt(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_fun_jac_ut_xt_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_fun_jac_ut_xt_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_0_fun_jac_ut_xt_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_fun_jac_ut_xt_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_0_fun_jac_ut_xt_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_0_fun_jac_ut_xt_incref(void) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_0_fun_jac_ut_xt_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_0_fun_jac_ut_xt_n_in(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_0_fun_jac_ut_xt_n_out(void) { return 2;} + +CASADI_SYMBOL_EXPORT casadi_real lat_cost_y_0_fun_jac_ut_xt_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_0_fun_jac_ut_xt_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_0_fun_jac_ut_xt_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + case 1: return "o1"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_0_fun_jac_ut_xt_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_0_fun_jac_ut_xt_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s3; + case 1: return casadi_s4; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_fun_jac_ut_xt_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 3; + if (sz_res) *sz_res = 2; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_0_hess.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_0_hess.c new file mode 100644 index 000000000..90dbbfb1e --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_0_hess.c @@ -0,0 +1,143 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) lat_cost_y_0_hess_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_s4 CASADI_PREFIX(s4) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s3[6] = {2, 1, 0, 2, 0, 1}; +static const casadi_int casadi_s4[8] = {5, 5, 0, 0, 0, 0, 0, 0}; + +/* lat_cost_y_0_hess:(i0[4],i1,i2[3],i3[2])->(o0[5x5,0nz]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_hess(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_hess_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_hess_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_0_hess_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_hess_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_0_hess_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_0_hess_incref(void) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_0_hess_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_0_hess_n_in(void) { return 4;} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_0_hess_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real lat_cost_y_0_hess_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_0_hess_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + case 3: return "i3"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_0_hess_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_0_hess_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + case 3: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_0_hess_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s4; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_0_hess_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 4; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_e_fun.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_e_fun.c new file mode 100644 index 000000000..a940186ce --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_e_fun.c @@ -0,0 +1,146 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) lat_cost_y_e_fun_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s1[3] = {0, 0, 0}; +static const casadi_int casadi_s2[6] = {2, 1, 0, 2, 0, 1}; + +/* lat_cost_y_e_fun:(i0[4],i1[],i2[2])->(o0[2]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1; + a0=arg[0]? arg[0][1] : 0; + if (res[0]!=0) res[0][0]=a0; + a0=arg[2]? arg[2][0] : 0; + a1=5.; + a0=(a0+a1); + a1=arg[0]? arg[0][2] : 0; + a0=(a0*a1); + if (res[0]!=0) res[0][1]=a0; + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_fun(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_fun_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_fun_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_e_fun_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_fun_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_e_fun_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_e_fun_incref(void) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_e_fun_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_e_fun_n_in(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_e_fun_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real lat_cost_y_e_fun_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_e_fun_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_e_fun_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_e_fun_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_e_fun_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_fun_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 3; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_e_fun.h b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_e_fun.h new file mode 100644 index 000000000..9e444b984 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_e_fun.h @@ -0,0 +1,69 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef lat_Y_E_COST +#define lat_Y_E_COST + +#ifdef __cplusplus +extern "C" { +#endif + + +int lat_cost_y_e_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int lat_cost_y_e_fun_work(int *, int *, int *, int *); +const int *lat_cost_y_e_fun_sparsity_in(int); +const int *lat_cost_y_e_fun_sparsity_out(int); +int lat_cost_y_e_fun_n_in(void); +int lat_cost_y_e_fun_n_out(void); + +int lat_cost_y_e_fun_jac_ut_xt(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int lat_cost_y_e_fun_jac_ut_xt_work(int *, int *, int *, int *); +const int *lat_cost_y_e_fun_jac_ut_xt_sparsity_in(int); +const int *lat_cost_y_e_fun_jac_ut_xt_sparsity_out(int); +int lat_cost_y_e_fun_jac_ut_xt_n_in(void); +int lat_cost_y_e_fun_jac_ut_xt_n_out(void); + +int lat_cost_y_e_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int lat_cost_y_e_hess_work(int *, int *, int *, int *); +const int *lat_cost_y_e_hess_sparsity_in(int); +const int *lat_cost_y_e_hess_sparsity_out(int); +int lat_cost_y_e_hess_n_in(void); +int lat_cost_y_e_hess_n_out(void); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // lat_Y_E_COST diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_e_fun_jac_ut_xt.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_e_fun_jac_ut_xt.c new file mode 100644 index 000000000..9b91f812c --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_e_fun_jac_ut_xt.c @@ -0,0 +1,153 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) lat_cost_y_e_fun_jac_ut_xt_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s1[3] = {0, 0, 0}; +static const casadi_int casadi_s2[6] = {2, 1, 0, 2, 0, 1}; +static const casadi_int casadi_s3[7] = {4, 2, 0, 1, 2, 1, 2}; + +/* lat_cost_y_e_fun_jac_ut_xt:(i0[4],i1[],i2[2])->(o0[2],o1[4x2,2nz]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1; + a0=arg[0]? arg[0][1] : 0; + if (res[0]!=0) res[0][0]=a0; + a0=arg[2]? arg[2][0] : 0; + a1=5.; + a0=(a0+a1); + a1=arg[0]? arg[0][2] : 0; + a1=(a0*a1); + if (res[0]!=0) res[0][1]=a1; + a1=1.; + if (res[1]!=0) res[1][0]=a1; + if (res[1]!=0) res[1][1]=a0; + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_fun_jac_ut_xt(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_fun_jac_ut_xt_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_fun_jac_ut_xt_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_e_fun_jac_ut_xt_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_fun_jac_ut_xt_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_e_fun_jac_ut_xt_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_e_fun_jac_ut_xt_incref(void) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_e_fun_jac_ut_xt_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_e_fun_jac_ut_xt_n_in(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_e_fun_jac_ut_xt_n_out(void) { return 2;} + +CASADI_SYMBOL_EXPORT casadi_real lat_cost_y_e_fun_jac_ut_xt_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_e_fun_jac_ut_xt_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_e_fun_jac_ut_xt_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + case 1: return "o1"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_e_fun_jac_ut_xt_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_e_fun_jac_ut_xt_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s2; + case 1: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_fun_jac_ut_xt_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 3; + if (sz_res) *sz_res = 2; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_e_hess.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_e_hess.c new file mode 100644 index 000000000..781daffaa --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_e_hess.c @@ -0,0 +1,141 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) lat_cost_y_e_hess_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s1[3] = {0, 0, 0}; +static const casadi_int casadi_s2[6] = {2, 1, 0, 2, 0, 1}; +static const casadi_int casadi_s3[7] = {4, 4, 0, 0, 0, 0, 0}; + +/* lat_cost_y_e_hess:(i0[4],i1[],i2[2],i3[2])->(o0[4x4,0nz]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_hess(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_hess_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_hess_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_e_hess_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_hess_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_e_hess_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_e_hess_incref(void) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_e_hess_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_e_hess_n_in(void) { return 4;} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_e_hess_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real lat_cost_y_e_hess_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_e_hess_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + case 3: return "i3"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_e_hess_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_e_hess_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + case 3: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_e_hess_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_e_hess_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 4; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_fun.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_fun.c new file mode 100644 index 000000000..e300e8da2 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_fun.c @@ -0,0 +1,154 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) lat_cost_y_fun_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[6] = {2, 1, 0, 2, 0, 1}; +static const casadi_int casadi_s3[7] = {3, 1, 0, 3, 0, 1, 2}; + +/* lat_cost_y_fun:(i0[4],i1,i2[2])->(o0[3]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a2, a3; + a0=arg[0]? arg[0][1] : 0; + if (res[0]!=0) res[0][0]=a0; + a0=arg[2]? arg[2][0] : 0; + a1=5.; + a2=(a0+a1); + a3=arg[0]? arg[0][2] : 0; + a2=(a2*a3); + if (res[0]!=0) res[0][1]=a2; + a2=4.; + a0=(a0+a1); + a2=(a2*a0); + a0=arg[1]? arg[1][0] : 0; + a2=(a2*a0); + if (res[0]!=0) res[0][2]=a2; + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_fun(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_fun_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_fun_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_fun_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_fun_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_fun_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_fun_incref(void) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_fun_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_fun_n_in(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_fun_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real lat_cost_y_fun_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_fun_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_fun_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_fun_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_fun_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_fun_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 3; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_fun.h b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_fun.h new file mode 100644 index 000000000..0d475171f --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_fun.h @@ -0,0 +1,69 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef lat_Y_COST +#define lat_Y_COST + +#ifdef __cplusplus +extern "C" { +#endif + + +int lat_cost_y_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int lat_cost_y_fun_work(int *, int *, int *, int *); +const int *lat_cost_y_fun_sparsity_in(int); +const int *lat_cost_y_fun_sparsity_out(int); +int lat_cost_y_fun_n_in(void); +int lat_cost_y_fun_n_out(void); + +int lat_cost_y_fun_jac_ut_xt(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int lat_cost_y_fun_jac_ut_xt_work(int *, int *, int *, int *); +const int *lat_cost_y_fun_jac_ut_xt_sparsity_in(int); +const int *lat_cost_y_fun_jac_ut_xt_sparsity_out(int); +int lat_cost_y_fun_jac_ut_xt_n_in(void); +int lat_cost_y_fun_jac_ut_xt_n_out(void); + +int lat_cost_y_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int lat_cost_y_hess_work(int *, int *, int *, int *); +const int *lat_cost_y_hess_sparsity_in(int); +const int *lat_cost_y_hess_sparsity_out(int); +int lat_cost_y_hess_n_in(void); +int lat_cost_y_hess_n_out(void); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // lat_Y_COST diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_fun_jac_ut_xt.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_fun_jac_ut_xt.c new file mode 100644 index 000000000..cc725e8c6 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_fun_jac_ut_xt.c @@ -0,0 +1,162 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) lat_cost_y_fun_jac_ut_xt_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_s4 CASADI_PREFIX(s4) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[6] = {2, 1, 0, 2, 0, 1}; +static const casadi_int casadi_s3[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s4[9] = {5, 3, 0, 1, 2, 3, 2, 3, 0}; + +/* lat_cost_y_fun_jac_ut_xt:(i0[4],i1,i2[2])->(o0[3],o1[5x3,3nz]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a2, a3; + a0=arg[0]? arg[0][1] : 0; + if (res[0]!=0) res[0][0]=a0; + a0=arg[2]? arg[2][0] : 0; + a1=5.; + a2=(a0+a1); + a3=arg[0]? arg[0][2] : 0; + a3=(a2*a3); + if (res[0]!=0) res[0][1]=a3; + a3=4.; + a0=(a0+a1); + a3=(a3*a0); + a0=arg[1]? arg[1][0] : 0; + a0=(a3*a0); + if (res[0]!=0) res[0][2]=a0; + a0=1.; + if (res[1]!=0) res[1][0]=a0; + if (res[1]!=0) res[1][1]=a2; + if (res[1]!=0) res[1][2]=a3; + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_fun_jac_ut_xt(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_fun_jac_ut_xt_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_fun_jac_ut_xt_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_fun_jac_ut_xt_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_fun_jac_ut_xt_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_fun_jac_ut_xt_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_fun_jac_ut_xt_incref(void) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_fun_jac_ut_xt_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_fun_jac_ut_xt_n_in(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_fun_jac_ut_xt_n_out(void) { return 2;} + +CASADI_SYMBOL_EXPORT casadi_real lat_cost_y_fun_jac_ut_xt_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_fun_jac_ut_xt_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_fun_jac_ut_xt_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + case 1: return "o1"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_fun_jac_ut_xt_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_fun_jac_ut_xt_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s3; + case 1: return casadi_s4; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_fun_jac_ut_xt_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 3; + if (sz_res) *sz_res = 2; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_hess.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_hess.c new file mode 100644 index 000000000..2a4258b0d --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_cost/lat_cost_y_hess.c @@ -0,0 +1,143 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) lat_cost_y_hess_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_s4 CASADI_PREFIX(s4) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s3[6] = {2, 1, 0, 2, 0, 1}; +static const casadi_int casadi_s4[8] = {5, 5, 0, 0, 0, 0, 0, 0}; + +/* lat_cost_y_hess:(i0[4],i1,i2[3],i3[2])->(o0[5x5,0nz]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_hess(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_hess_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_hess_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_hess_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_hess_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_hess_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_hess_incref(void) { +} + +CASADI_SYMBOL_EXPORT void lat_cost_y_hess_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_hess_n_in(void) { return 4;} + +CASADI_SYMBOL_EXPORT casadi_int lat_cost_y_hess_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real lat_cost_y_hess_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_hess_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + case 3: return "i3"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_cost_y_hess_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_hess_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + case 3: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_cost_y_hess_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s4; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int lat_cost_y_hess_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 4; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_model/lat_expl_ode_fun.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_model/lat_expl_ode_fun.c new file mode 100644 index 000000000..084aef3f3 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_model/lat_expl_ode_fun.c @@ -0,0 +1,162 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) lat_expl_ode_fun_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[6] = {2, 1, 0, 2, 0, 1}; + +/* lat_expl_ode_fun:(i0[4],i1,i2[2])->(o0[4]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a2, a3, a4, a5, a6; + a0=arg[2]? arg[2][0] : 0; + a1=arg[0]? arg[0][2] : 0; + a2=cos(a1); + a2=(a0*a2); + a3=arg[2]? arg[2][1] : 0; + a4=sin(a1); + a4=(a3*a4); + a5=arg[0]? arg[0][3] : 0; + a6=(a0*a5); + a4=(a4*a6); + a2=(a2-a4); + if (res[0]!=0) res[0][0]=a2; + a2=sin(a1); + a2=(a0*a2); + a1=cos(a1); + a3=(a3*a1); + a1=(a0*a5); + a3=(a3*a1); + a2=(a2+a3); + if (res[0]!=0) res[0][1]=a2; + a0=(a0*a5); + if (res[0]!=0) res[0][2]=a0; + a0=arg[1]? arg[1][0] : 0; + if (res[0]!=0) res[0][3]=a0; + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_expl_ode_fun(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int lat_expl_ode_fun_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_expl_ode_fun_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_expl_ode_fun_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int lat_expl_ode_fun_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_expl_ode_fun_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void lat_expl_ode_fun_incref(void) { +} + +CASADI_SYMBOL_EXPORT void lat_expl_ode_fun_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int lat_expl_ode_fun_n_in(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_int lat_expl_ode_fun_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real lat_expl_ode_fun_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_expl_ode_fun_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_expl_ode_fun_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_expl_ode_fun_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_expl_ode_fun_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int lat_expl_ode_fun_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 3; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_model/lat_expl_vde_adj.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_model/lat_expl_vde_adj.c new file mode 100644 index 000000000..a407cded8 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_model/lat_expl_vde_adj.c @@ -0,0 +1,186 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) lat_expl_vde_adj_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[6] = {2, 1, 0, 2, 0, 1}; +static const casadi_int casadi_s3[9] = {5, 1, 0, 5, 0, 1, 2, 3, 4}; + +/* lat_expl_vde_adj:(i0[4],i1[4],i2,i3[2])->(o0[5]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a2, a3, a4, a5, a6, a7; + a0=0.; + if (res[0]!=0) res[0][0]=a0; + if (res[0]!=0) res[0][1]=a0; + a0=arg[0]? arg[0][2] : 0; + a1=cos(a0); + a2=arg[3]? arg[3][0] : 0; + a3=arg[1]? arg[1][1] : 0; + a4=(a2*a3); + a1=(a1*a4); + a4=sin(a0); + a5=arg[3]? arg[3][1] : 0; + a6=arg[0]? arg[0][3] : 0; + a7=(a2*a6); + a7=(a7*a3); + a7=(a5*a7); + a4=(a4*a7); + a1=(a1-a4); + a4=cos(a0); + a6=(a2*a6); + a7=arg[1]? arg[1][0] : 0; + a6=(a6*a7); + a6=(a5*a6); + a4=(a4*a6); + a1=(a1-a4); + a4=sin(a0); + a6=(a2*a7); + a4=(a4*a6); + a1=(a1-a4); + if (res[0]!=0) res[0][2]=a1; + a1=arg[1]? arg[1][2] : 0; + a1=(a2*a1); + a4=cos(a0); + a4=(a5*a4); + a4=(a4*a3); + a4=(a2*a4); + a1=(a1+a4); + a0=sin(a0); + a5=(a5*a0); + a5=(a5*a7); + a2=(a2*a5); + a1=(a1-a2); + if (res[0]!=0) res[0][3]=a1; + a1=arg[1]? arg[1][3] : 0; + if (res[0]!=0) res[0][4]=a1; + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_expl_vde_adj(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int lat_expl_vde_adj_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_expl_vde_adj_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_expl_vde_adj_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int lat_expl_vde_adj_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_expl_vde_adj_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void lat_expl_vde_adj_incref(void) { +} + +CASADI_SYMBOL_EXPORT void lat_expl_vde_adj_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int lat_expl_vde_adj_n_in(void) { return 4;} + +CASADI_SYMBOL_EXPORT casadi_int lat_expl_vde_adj_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real lat_expl_vde_adj_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_expl_vde_adj_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + case 3: return "i3"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_expl_vde_adj_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_expl_vde_adj_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s0; + case 2: return casadi_s1; + case 3: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_expl_vde_adj_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int lat_expl_vde_adj_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 4; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_model/lat_expl_vde_forw.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_model/lat_expl_vde_forw.c new file mode 100644 index 000000000..832f63096 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_model/lat_expl_vde_forw.c @@ -0,0 +1,312 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) lat_expl_vde_forw_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s1[23] = {4, 4, 0, 4, 8, 12, 16, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3}; +static const casadi_int casadi_s2[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s3[6] = {2, 1, 0, 2, 0, 1}; + +/* lat_expl_vde_forw:(i0[4],i1[4x4],i2[4],i3,i4[2])->(o0[4],o1[4x4],o2[4]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a10, a11, a12, a13, a14, a15, a16, a2, a3, a4, a5, a6, a7, a8, a9; + a0=arg[4]? arg[4][0] : 0; + a1=arg[0]? arg[0][2] : 0; + a2=cos(a1); + a2=(a0*a2); + a3=arg[4]? arg[4][1] : 0; + a4=sin(a1); + a4=(a3*a4); + a5=arg[0]? arg[0][3] : 0; + a6=(a0*a5); + a7=(a4*a6); + a2=(a2-a7); + if (res[0]!=0) res[0][0]=a2; + a2=sin(a1); + a2=(a0*a2); + a7=cos(a1); + a7=(a3*a7); + a8=(a0*a5); + a9=(a7*a8); + a2=(a2+a9); + if (res[0]!=0) res[0][1]=a2; + a5=(a0*a5); + if (res[0]!=0) res[0][2]=a5; + a5=arg[3]? arg[3][0] : 0; + if (res[0]!=0) res[0][3]=a5; + a5=sin(a1); + a2=arg[1]? arg[1][2] : 0; + a9=(a5*a2); + a9=(a0*a9); + a10=cos(a1); + a11=(a10*a2); + a11=(a3*a11); + a11=(a6*a11); + a12=arg[1]? arg[1][3] : 0; + a13=(a0*a12); + a13=(a4*a13); + a11=(a11+a13); + a9=(a9+a11); + a9=(-a9); + if (res[1]!=0) res[1][0]=a9; + a9=cos(a1); + a11=(a9*a2); + a11=(a0*a11); + a13=(a0*a12); + a13=(a7*a13); + a14=sin(a1); + a2=(a14*a2); + a2=(a3*a2); + a2=(a8*a2); + a13=(a13-a2); + a11=(a11+a13); + if (res[1]!=0) res[1][1]=a11; + a12=(a0*a12); + if (res[1]!=0) res[1][2]=a12; + a12=0.; + if (res[1]!=0) res[1][3]=a12; + a11=arg[1]? arg[1][6] : 0; + a13=(a5*a11); + a13=(a0*a13); + a2=(a10*a11); + a2=(a3*a2); + a2=(a6*a2); + a15=arg[1]? arg[1][7] : 0; + a16=(a0*a15); + a16=(a4*a16); + a2=(a2+a16); + a13=(a13+a2); + a13=(-a13); + if (res[1]!=0) res[1][4]=a13; + a13=(a9*a11); + a13=(a0*a13); + a2=(a0*a15); + a2=(a7*a2); + a11=(a14*a11); + a11=(a3*a11); + a11=(a8*a11); + a2=(a2-a11); + a13=(a13+a2); + if (res[1]!=0) res[1][5]=a13; + a15=(a0*a15); + if (res[1]!=0) res[1][6]=a15; + if (res[1]!=0) res[1][7]=a12; + a15=arg[1]? arg[1][10] : 0; + a13=(a5*a15); + a13=(a0*a13); + a2=(a10*a15); + a2=(a3*a2); + a2=(a6*a2); + a11=arg[1]? arg[1][11] : 0; + a16=(a0*a11); + a16=(a4*a16); + a2=(a2+a16); + a13=(a13+a2); + a13=(-a13); + if (res[1]!=0) res[1][8]=a13; + a13=(a9*a15); + a13=(a0*a13); + a2=(a0*a11); + a2=(a7*a2); + a15=(a14*a15); + a15=(a3*a15); + a15=(a8*a15); + a2=(a2-a15); + a13=(a13+a2); + if (res[1]!=0) res[1][9]=a13; + a11=(a0*a11); + if (res[1]!=0) res[1][10]=a11; + if (res[1]!=0) res[1][11]=a12; + a11=arg[1]? arg[1][14] : 0; + a5=(a5*a11); + a5=(a0*a5); + a10=(a10*a11); + a10=(a3*a10); + a10=(a6*a10); + a13=arg[1]? arg[1][15] : 0; + a2=(a0*a13); + a2=(a4*a2); + a10=(a10+a2); + a5=(a5+a10); + a5=(-a5); + if (res[1]!=0) res[1][12]=a5; + a9=(a9*a11); + a9=(a0*a9); + a5=(a0*a13); + a5=(a7*a5); + a14=(a14*a11); + a14=(a3*a14); + a14=(a8*a14); + a5=(a5-a14); + a9=(a9+a5); + if (res[1]!=0) res[1][13]=a9; + a13=(a0*a13); + if (res[1]!=0) res[1][14]=a13; + if (res[1]!=0) res[1][15]=a12; + a12=sin(a1); + a13=arg[2]? arg[2][2] : 0; + a12=(a12*a13); + a12=(a0*a12); + a9=cos(a1); + a9=(a9*a13); + a9=(a3*a9); + a6=(a6*a9); + a9=arg[2]? arg[2][3] : 0; + a5=(a0*a9); + a4=(a4*a5); + a6=(a6+a4); + a12=(a12+a6); + a12=(-a12); + if (res[2]!=0) res[2][0]=a12; + a12=cos(a1); + a12=(a12*a13); + a12=(a0*a12); + a6=(a0*a9); + a7=(a7*a6); + a1=sin(a1); + a1=(a1*a13); + a3=(a3*a1); + a8=(a8*a3); + a7=(a7-a8); + a12=(a12+a7); + if (res[2]!=0) res[2][1]=a12; + a0=(a0*a9); + if (res[2]!=0) res[2][2]=a0; + a0=1.; + if (res[2]!=0) res[2][3]=a0; + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_expl_vde_forw(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int lat_expl_vde_forw_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int lat_expl_vde_forw_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_expl_vde_forw_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int lat_expl_vde_forw_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void lat_expl_vde_forw_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void lat_expl_vde_forw_incref(void) { +} + +CASADI_SYMBOL_EXPORT void lat_expl_vde_forw_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int lat_expl_vde_forw_n_in(void) { return 5;} + +CASADI_SYMBOL_EXPORT casadi_int lat_expl_vde_forw_n_out(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_real lat_expl_vde_forw_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_expl_vde_forw_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + case 3: return "i3"; + case 4: return "i4"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* lat_expl_vde_forw_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + case 1: return "o1"; + case 2: return "o2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_expl_vde_forw_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s0; + case 3: return casadi_s2; + case 4: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* lat_expl_vde_forw_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s0; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int lat_expl_vde_forw_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 5; + if (sz_res) *sz_res = 3; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_model/lat_model.h b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_model/lat_model.h new file mode 100644 index 000000000..98ed49214 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/lat_model/lat_model.h @@ -0,0 +1,74 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +#ifndef lat_MODEL +#define lat_MODEL + +#ifdef __cplusplus +extern "C" { +#endif + + +/* explicit ODE */ + +// explicit ODE +int lat_expl_ode_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int lat_expl_ode_fun_work(int *, int *, int *, int *); +const int *lat_expl_ode_fun_sparsity_in(int); +const int *lat_expl_ode_fun_sparsity_out(int); +int lat_expl_ode_fun_n_in(void); +int lat_expl_ode_fun_n_out(void); + +// explicit forward VDE +int lat_expl_vde_forw(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int lat_expl_vde_forw_work(int *, int *, int *, int *); +const int *lat_expl_vde_forw_sparsity_in(int); +const int *lat_expl_vde_forw_sparsity_out(int); +int lat_expl_vde_forw_n_in(void); +int lat_expl_vde_forw_n_out(void); + +// explicit adjoint VDE +int lat_expl_vde_adj(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int lat_expl_vde_adj_work(int *, int *, int *, int *); +const int *lat_expl_vde_adj_sparsity_in(int); +const int *lat_expl_vde_adj_sparsity_out(int); +int lat_expl_vde_adj_n_in(void); +int lat_expl_vde_adj_n_out(void); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // lat_MODEL diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/libacados_ocp_solver_lat.so b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/libacados_ocp_solver_lat.so new file mode 100755 index 000000000..44c52ec12 Binary files /dev/null and b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/libacados_ocp_solver_lat.so differ diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/main_lat.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/main_lat.c new file mode 100644 index 000000000..61550775f --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/main_lat.c @@ -0,0 +1,215 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +// standard +#include +#include +// acados +#include "acados/utils/print.h" +#include "acados/utils/math.h" +#include "acados_c/ocp_nlp_interface.h" +#include "acados_c/external_function_interface.h" +#include "acados_solver_lat.h" + +#define NX LAT_NX +#define NZ LAT_NZ +#define NU LAT_NU +#define NP LAT_NP +#define NBX LAT_NBX +#define NBX0 LAT_NBX0 +#define NBU LAT_NBU +#define NSBX LAT_NSBX +#define NSBU LAT_NSBU +#define NSH LAT_NSH +#define NSG LAT_NSG +#define NSPHI LAT_NSPHI +#define NSHN LAT_NSHN +#define NSGN LAT_NSGN +#define NSPHIN LAT_NSPHIN +#define NSBXN LAT_NSBXN +#define NS LAT_NS +#define NSN LAT_NSN +#define NG LAT_NG +#define NBXN LAT_NBXN +#define NGN LAT_NGN +#define NY0 LAT_NY0 +#define NY LAT_NY +#define NYN LAT_NYN +#define NH LAT_NH +#define NPHI LAT_NPHI +#define NHN LAT_NHN +#define NPHIN LAT_NPHIN +#define NR LAT_NR + + +int main() +{ + + lat_solver_capsule *acados_ocp_capsule = lat_acados_create_capsule(); + // there is an opportunity to change the number of shooting intervals in C without new code generation + int N = LAT_N; + // allocate the array and fill it accordingly + double* new_time_steps = NULL; + int status = lat_acados_create_with_discretization(acados_ocp_capsule, N, new_time_steps); + + if (status) + { + printf("lat_acados_create() returned status %d. Exiting.\n", status); + exit(1); + } + + ocp_nlp_config *nlp_config = lat_acados_get_nlp_config(acados_ocp_capsule); + ocp_nlp_dims *nlp_dims = lat_acados_get_nlp_dims(acados_ocp_capsule); + ocp_nlp_in *nlp_in = lat_acados_get_nlp_in(acados_ocp_capsule); + ocp_nlp_out *nlp_out = lat_acados_get_nlp_out(acados_ocp_capsule); + ocp_nlp_solver *nlp_solver = lat_acados_get_nlp_solver(acados_ocp_capsule); + void *nlp_opts = lat_acados_get_nlp_opts(acados_ocp_capsule); + + // initial condition + int idxbx0[NBX0]; + idxbx0[0] = 0; + idxbx0[1] = 1; + idxbx0[2] = 2; + idxbx0[3] = 3; + + double lbx0[NBX0]; + double ubx0[NBX0]; + lbx0[0] = 0; + ubx0[0] = 0; + lbx0[1] = 0; + ubx0[1] = 0; + lbx0[2] = 0; + ubx0[2] = 0; + lbx0[3] = 0; + ubx0[3] = 0; + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "idxbx", idxbx0); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "lbx", lbx0); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "ubx", ubx0); + + // initialization for state values + double x_init[NX]; + x_init[0] = 0.0; + x_init[1] = 0.0; + x_init[2] = 0.0; + x_init[3] = 0.0; + + // initial value for control input + double u0[NU]; + u0[0] = 0.0; + // set parameters + double p[NP]; + p[0] = 0; + p[1] = 0; + + for (int ii = 0; ii <= N; ii++) + { + lat_acados_update_params(acados_ocp_capsule, ii, p, NP); + } + + + // prepare evaluation + int NTIMINGS = 1; + double min_time = 1e12; + double kkt_norm_inf; + double elapsed_time; + int sqp_iter; + + double xtraj[NX * (N+1)]; + double utraj[NU * N]; + + + // solve ocp in loop + int rti_phase = 0; + + for (int ii = 0; ii < NTIMINGS; ii++) + { + // initialize solution + for (int i = 0; i <= nlp_dims->N; i++) + { + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, i, "x", x_init); + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, i, "u", u0); + } + ocp_nlp_solver_opts_set(nlp_config, nlp_opts, "rti_phase", &rti_phase); + status = lat_acados_solve(acados_ocp_capsule); + ocp_nlp_get(nlp_config, nlp_solver, "time_tot", &elapsed_time); + min_time = MIN(elapsed_time, min_time); + } + + /* print solution and statistics */ + for (int ii = 0; ii <= nlp_dims->N; ii++) + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, ii, "x", &xtraj[ii*NX]); + for (int ii = 0; ii < nlp_dims->N; ii++) + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, ii, "u", &utraj[ii*NU]); + + printf("\n--- xtraj ---\n"); + d_print_exp_tran_mat( NX, N+1, xtraj, NX); + printf("\n--- utraj ---\n"); + d_print_exp_tran_mat( NU, N, utraj, NU ); + // ocp_nlp_out_print(nlp_solver->dims, nlp_out); + + printf("\nsolved ocp %d times, solution printed above\n\n", NTIMINGS); + + if (status == ACADOS_SUCCESS) + { + printf("lat_acados_solve(): SUCCESS!\n"); + } + else + { + printf("lat_acados_solve() failed with status %d.\n", status); + } + + // get solution + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, 0, "kkt_norm_inf", &kkt_norm_inf); + ocp_nlp_get(nlp_config, nlp_solver, "sqp_iter", &sqp_iter); + + lat_acados_print_stats(acados_ocp_capsule); + + printf("\nSolver info:\n"); + printf(" SQP iterations %2d\n minimum time for %d solve %f [ms]\n KKT %e\n", + sqp_iter, NTIMINGS, min_time*1000, kkt_norm_inf); + + // free solver + status = lat_acados_free(acados_ocp_capsule); + if (status) { + printf("lat_acados_free() returned status %d. \n", status); + } + // free solver capsule + status = lat_acados_free_capsule(acados_ocp_capsule); + if (status) { + printf("lat_acados_free_capsule() returned status %d. \n", status); + } + + return status; +} diff --git a/selfdrive/controls/lib/lateral_mpc_lib/lat_mpc.py b/selfdrive/controls/lib/lateral_mpc_lib/lat_mpc.py new file mode 100755 index 000000000..eeda25627 --- /dev/null +++ b/selfdrive/controls/lib/lateral_mpc_lib/lat_mpc.py @@ -0,0 +1,177 @@ +#!/usr/bin/env python3 +import os +import numpy as np + +from casadi import SX, vertcat, sin, cos + +from common.realtime import sec_since_boot +from selfdrive.controls.lib.drive_helpers import LAT_MPC_N as N +from selfdrive.controls.lib.drive_helpers import T_IDXS + +if __name__ == '__main__': # generating code + from pyextra.acados_template import AcadosModel, AcadosOcp, AcadosOcpSolver +else: + # from pyextra.acados_template import AcadosOcpSolverFast + from selfdrive.controls.lib.lateral_mpc_lib.c_generated_code.acados_ocp_solver_pyx import AcadosOcpSolverFast # pylint: disable=no-name-in-module, import-error + +LAT_MPC_DIR = os.path.dirname(os.path.abspath(__file__)) +EXPORT_DIR = os.path.join(LAT_MPC_DIR, "c_generated_code") +JSON_FILE = "acados_ocp_lat.json" +X_DIM = 4 +P_DIM = 2 + +def gen_lat_model(): + model = AcadosModel() + model.name = 'lat' + + # set up states & controls + x_ego = SX.sym('x_ego') + y_ego = SX.sym('y_ego') + psi_ego = SX.sym('psi_ego') + curv_ego = SX.sym('curv_ego') + model.x = vertcat(x_ego, y_ego, psi_ego, curv_ego) + + # parameters + v_ego = SX.sym('v_ego') + rotation_radius = SX.sym('rotation_radius') + model.p = vertcat(v_ego, rotation_radius) + + # controls + curv_rate = SX.sym('curv_rate') + model.u = vertcat(curv_rate) + + # xdot + x_ego_dot = SX.sym('x_ego_dot') + y_ego_dot = SX.sym('y_ego_dot') + psi_ego_dot = SX.sym('psi_ego_dot') + curv_ego_dot = SX.sym('curv_ego_dot') + + model.xdot = vertcat(x_ego_dot, y_ego_dot, psi_ego_dot, curv_ego_dot) + + # dynamics model + f_expl = vertcat(v_ego * cos(psi_ego) - rotation_radius * sin(psi_ego) * (v_ego * curv_ego), + v_ego * sin(psi_ego) + rotation_radius * cos(psi_ego) * (v_ego * curv_ego), + v_ego * curv_ego, + curv_rate) + model.f_impl_expr = model.xdot - f_expl + model.f_expl_expr = f_expl + return model + + +def gen_lat_mpc_solver(): + ocp = AcadosOcp() + ocp.model = gen_lat_model() + + Tf = np.array(T_IDXS)[N] + + # set dimensions + ocp.dims.N = N + + # set cost module + ocp.cost.cost_type = 'NONLINEAR_LS' + ocp.cost.cost_type_e = 'NONLINEAR_LS' + + Q = np.diag([0.0, 0.0]) + QR = np.diag([0.0, 0.0, 0.0]) + + ocp.cost.W = QR + ocp.cost.W_e = Q + + y_ego, psi_ego = ocp.model.x[1], ocp.model.x[2] + curv_rate = ocp.model.u[0] + v_ego = ocp.model.p[0] + + ocp.parameter_values = np.zeros((P_DIM, )) + + ocp.cost.yref = np.zeros((3, )) + ocp.cost.yref_e = np.zeros((2, )) + # TODO hacky weights to keep behavior the same + ocp.model.cost_y_expr = vertcat(y_ego, + ((v_ego +5.0) * psi_ego), + ((v_ego +5.0) * 4 * curv_rate)) + ocp.model.cost_y_expr_e = vertcat(y_ego, + ((v_ego +5.0) * psi_ego)) + + # set constraints + ocp.constraints.constr_type = 'BGH' + ocp.constraints.idxbx = np.array([2,3]) + ocp.constraints.ubx = np.array([np.radians(90), np.radians(50)]) + ocp.constraints.lbx = np.array([-np.radians(90), -np.radians(50)]) + x0 = np.zeros((X_DIM,)) + ocp.constraints.x0 = x0 + + ocp.solver_options.qp_solver = 'PARTIAL_CONDENSING_HPIPM' + ocp.solver_options.hessian_approx = 'GAUSS_NEWTON' + ocp.solver_options.integrator_type = 'ERK' + ocp.solver_options.nlp_solver_type = 'SQP_RTI' + ocp.solver_options.qp_solver_iter_max = 1 + ocp.solver_options.qp_solver_cond_N = 1 + + # set prediction horizon + ocp.solver_options.tf = Tf + ocp.solver_options.shooting_nodes = np.array(T_IDXS)[:N+1] + + ocp.code_export_directory = EXPORT_DIR + return ocp + + +class LateralMpc(): + def __init__(self, x0=np.zeros(X_DIM)): + self.solver = AcadosOcpSolverFast('lat', N, EXPORT_DIR) + self.reset(x0) + + def reset(self, x0=np.zeros(X_DIM)): + self.x_sol = np.zeros((N+1, X_DIM)) + self.u_sol = np.zeros((N, 1)) + self.yref = np.zeros((N+1, 3)) + for i in range(N): + self.solver.cost_set(i, "yref", self.yref[i]) + self.solver.cost_set(N, "yref", self.yref[N][:2]) + + # Somehow needed for stable init + for i in range(N+1): + self.solver.set(i, 'x', np.zeros(X_DIM)) + self.solver.set(i, 'p', np.zeros(P_DIM)) + self.solver.constraints_set(0, "lbx", x0) + self.solver.constraints_set(0, "ubx", x0) + self.solver.solve() + self.solution_status = 0 + self.solve_time = 0.0 + self.cost = 0 + + def set_weights(self, path_weight, heading_weight, steer_rate_weight): + W = np.asfortranarray(np.diag([path_weight, heading_weight, steer_rate_weight])) + for i in range(N): + self.solver.cost_set(i, 'W', W) + #TODO hacky weights to keep behavior the same + self.solver.cost_set(N, 'W', (3/20.)*W[:2,:2]) + + def run(self, x0, p, y_pts, heading_pts): + x0_cp = np.copy(x0) + p_cp = np.copy(p) + self.solver.constraints_set(0, "lbx", x0_cp) + self.solver.constraints_set(0, "ubx", x0_cp) + self.yref[:,0] = y_pts + v_ego = p_cp[0] + # rotation_radius = p_cp[1] + self.yref[:,1] = heading_pts*(v_ego+5.0) + for i in range(N): + self.solver.cost_set(i, "yref", self.yref[i]) + self.solver.set(i, "p", p_cp) + self.solver.set(N, "p", p_cp) + self.solver.cost_set(N, "yref", self.yref[N][:2]) + + t = sec_since_boot() + self.solution_status = self.solver.solve() + self.solve_time = sec_since_boot() - t + + for i in range(N+1): + self.x_sol[i] = self.solver.get(i, 'x') + for i in range(N): + self.u_sol[i] = self.solver.get(i, 'u') + self.cost = self.solver.get_cost() + + +if __name__ == "__main__": + ocp = gen_lat_mpc_solver() + AcadosOcpSolver.generate(ocp, json_file=JSON_FILE, build=False) diff --git a/selfdrive/controls/lib/lateral_planner.py b/selfdrive/controls/lib/lateral_planner.py new file mode 100644 index 000000000..a9c641139 --- /dev/null +++ b/selfdrive/controls/lib/lateral_planner.py @@ -0,0 +1,123 @@ +import numpy as np +from common.realtime import sec_since_boot, DT_MDL +from common.numpy_fast import interp +from selfdrive.swaglog import cloudlog +from selfdrive.controls.lib.lateral_mpc_lib.lat_mpc import LateralMpc +from selfdrive.controls.lib.drive_helpers import CONTROL_N, MPC_COST_LAT, LAT_MPC_N, CAR_ROTATION_RADIUS +from selfdrive.controls.lib.lane_planner import LanePlanner, TRAJECTORY_SIZE +from selfdrive.controls.lib.desire_helper import DesireHelper +import cereal.messaging as messaging +from cereal import log + + +class LateralPlanner: + def __init__(self, CP, use_lanelines=True, wide_camera=False): + self.use_lanelines = use_lanelines + self.LP = LanePlanner(wide_camera) + self.DH = DesireHelper() + + self.last_cloudlog_t = 0 + self.steer_rate_cost = CP.steerRateCost + self.solution_invalid_cnt = 0 + + self.path_xyz = np.zeros((TRAJECTORY_SIZE, 3)) + self.path_xyz_stds = np.ones((TRAJECTORY_SIZE, 3)) + self.plan_yaw = np.zeros((TRAJECTORY_SIZE,)) + self.t_idxs = np.arange(TRAJECTORY_SIZE) + self.y_pts = np.zeros(TRAJECTORY_SIZE) + + self.lat_mpc = LateralMpc() + self.reset_mpc(np.zeros(4)) + + def reset_mpc(self, x0=np.zeros(4)): + self.x0 = x0 + self.lat_mpc.reset(x0=self.x0) + + def update(self, sm): + v_ego = sm['carState'].vEgo + measured_curvature = sm['controlsState'].curvature + + # Parse model predictions + md = sm['modelV2'] + self.LP.parse_model(md) + if len(md.position.x) == TRAJECTORY_SIZE and len(md.orientation.x) == TRAJECTORY_SIZE: + self.path_xyz = np.column_stack([md.position.x, md.position.y, md.position.z]) + self.t_idxs = np.array(md.position.t) + self.plan_yaw = list(md.orientation.z) + if len(md.position.xStd) == TRAJECTORY_SIZE: + self.path_xyz_stds = np.column_stack([md.position.xStd, md.position.yStd, md.position.zStd]) + + # Lane change logic + lane_change_prob = self.LP.l_lane_change_prob + self.LP.r_lane_change_prob + self.DH.update(sm['carState'], sm['controlsState'].active, lane_change_prob) + + # Turn off lanes during lane change + if self.DH.desire == log.LateralPlan.Desire.laneChangeRight or self.DH.desire == log.LateralPlan.Desire.laneChangeLeft: + self.LP.lll_prob *= self.DH.lane_change_ll_prob + self.LP.rll_prob *= self.DH.lane_change_ll_prob + + # Calculate final driving path and set MPC costs + if self.use_lanelines: + d_path_xyz = self.LP.get_d_path(v_ego, self.t_idxs, self.path_xyz) + self.lat_mpc.set_weights(MPC_COST_LAT.PATH, MPC_COST_LAT.HEADING, self.steer_rate_cost) + else: + d_path_xyz = self.path_xyz + path_cost = np.clip(abs(self.path_xyz[0, 1] / self.path_xyz_stds[0, 1]), 0.5, 1.5) * MPC_COST_LAT.PATH + # Heading cost is useful at low speed, otherwise end of plan can be off-heading + heading_cost = interp(v_ego, [5.0, 10.0], [MPC_COST_LAT.HEADING, 0.0]) + self.lat_mpc.set_weights(path_cost, heading_cost, self.steer_rate_cost) + + y_pts = np.interp(v_ego * self.t_idxs[:LAT_MPC_N + 1], np.linalg.norm(d_path_xyz, axis=1), d_path_xyz[:, 1]) + heading_pts = np.interp(v_ego * self.t_idxs[:LAT_MPC_N + 1], np.linalg.norm(self.path_xyz, axis=1), self.plan_yaw) + self.y_pts = y_pts + + assert len(y_pts) == LAT_MPC_N + 1 + assert len(heading_pts) == LAT_MPC_N + 1 + # self.x0[4] = v_ego + p = np.array([v_ego, CAR_ROTATION_RADIUS]) + self.lat_mpc.run(self.x0, + p, + y_pts, + heading_pts) + # init state for next + self.x0[3] = interp(DT_MDL, self.t_idxs[:LAT_MPC_N + 1], self.lat_mpc.x_sol[:, 3]) + + # Check for infeasible MPC solution + mpc_nans = np.isnan(self.lat_mpc.x_sol[:, 3]).any() + t = sec_since_boot() + if mpc_nans or self.lat_mpc.solution_status != 0: + self.reset_mpc() + self.x0[3] = measured_curvature + if t > self.last_cloudlog_t + 5.0: + self.last_cloudlog_t = t + cloudlog.warning("Lateral mpc - nan: True") + + if self.lat_mpc.cost > 20000. or mpc_nans: + self.solution_invalid_cnt += 1 + else: + self.solution_invalid_cnt = 0 + + def publish(self, sm, pm): + plan_solution_valid = self.solution_invalid_cnt < 2 + plan_send = messaging.new_message('lateralPlan') + plan_send.valid = sm.all_alive_and_valid(service_list=['carState', 'controlsState', 'modelV2']) + + lateralPlan = plan_send.lateralPlan + lateralPlan.laneWidth = float(self.LP.lane_width) + lateralPlan.dPathPoints = self.y_pts.tolist() + lateralPlan.psis = self.lat_mpc.x_sol[0:CONTROL_N, 2].tolist() + lateralPlan.curvatures = self.lat_mpc.x_sol[0:CONTROL_N, 3].tolist() + lateralPlan.curvatureRates = [float(x) for x in self.lat_mpc.u_sol[0:CONTROL_N - 1]] + [0.0] + lateralPlan.lProb = float(self.LP.lll_prob) + lateralPlan.rProb = float(self.LP.rll_prob) + lateralPlan.dProb = float(self.LP.d_prob) + + lateralPlan.mpcSolutionValid = bool(plan_solution_valid) + lateralPlan.solverExecutionTime = self.lat_mpc.solve_time + + lateralPlan.desire = self.DH.desire + lateralPlan.useLaneLines = self.use_lanelines + lateralPlan.laneChangeState = self.DH.lane_change_state + lateralPlan.laneChangeDirection = self.DH.lane_change_direction + + pm.send('lateralPlan', plan_send) diff --git a/selfdrive/controls/lib/longcontrol.py b/selfdrive/controls/lib/longcontrol.py new file mode 100644 index 000000000..21c34aa2d --- /dev/null +++ b/selfdrive/controls/lib/longcontrol.py @@ -0,0 +1,118 @@ +from cereal import car +from common.numpy_fast import clip, interp +from common.realtime import DT_CTRL +from selfdrive.controls.lib.pid import PIController +from selfdrive.controls.lib.drive_helpers import CONTROL_N +from selfdrive.modeld.constants import T_IDXS + +LongCtrlState = car.CarControl.Actuators.LongControlState + +# As per ISO 15622:2018 for all speeds +ACCEL_MIN_ISO = -3.5 # m/s^2 +ACCEL_MAX_ISO = 2.0 # m/s^2 + + +def long_control_state_trans(CP, active, long_control_state, v_ego, v_target_future, + brake_pressed, cruise_standstill): + """Update longitudinal control state machine""" + stopping_condition = (v_ego < 2.0 and cruise_standstill) or \ + (v_ego < CP.vEgoStopping and + (v_target_future < CP.vEgoStopping or brake_pressed)) + + starting_condition = v_target_future > CP.vEgoStarting and not cruise_standstill + + if not active: + long_control_state = LongCtrlState.off + + else: + if long_control_state == LongCtrlState.off: + long_control_state = LongCtrlState.pid + + elif long_control_state == LongCtrlState.pid: + if stopping_condition: + long_control_state = LongCtrlState.stopping + + elif long_control_state == LongCtrlState.stopping: + if starting_condition: + long_control_state = LongCtrlState.pid + + return long_control_state + + +class LongControl(): + def __init__(self, CP): + self.long_control_state = LongCtrlState.off # initialized to off + self.pid = PIController((CP.longitudinalTuning.kpBP, CP.longitudinalTuning.kpV), + (CP.longitudinalTuning.kiBP, CP.longitudinalTuning.kiV), + rate=1 / DT_CTRL) + self.v_pid = 0.0 + self.last_output_accel = 0.0 + + def reset(self, v_pid): + """Reset PID controller and change setpoint""" + self.pid.reset() + self.v_pid = v_pid + + def update(self, active, CS, CP, long_plan, accel_limits): + """Update longitudinal control. This updates the state machine and runs a PID loop""" + # Interp control trajectory + # TODO estimate car specific lag, use .15s for now + speeds = long_plan.speeds + if len(speeds) == CONTROL_N: + v_target_lower = interp(CP.longitudinalActuatorDelayLowerBound, T_IDXS[:CONTROL_N], speeds) + a_target_lower = 2 * (v_target_lower - speeds[0])/CP.longitudinalActuatorDelayLowerBound - long_plan.accels[0] + + v_target_upper = interp(CP.longitudinalActuatorDelayUpperBound, T_IDXS[:CONTROL_N], speeds) + a_target_upper = 2 * (v_target_upper - speeds[0])/CP.longitudinalActuatorDelayUpperBound - long_plan.accels[0] + a_target = min(a_target_lower, a_target_upper) + + v_target = speeds[0] + v_target_future = speeds[-1] + else: + v_target = 0.0 + v_target_future = 0.0 + a_target = 0.0 + + # TODO: This check is not complete and needs to be enforced by MPC + a_target = clip(a_target, ACCEL_MIN_ISO, ACCEL_MAX_ISO) + + self.pid.neg_limit = accel_limits[0] + self.pid.pos_limit = accel_limits[1] + + # Update state machine + output_accel = self.last_output_accel + self.long_control_state = long_control_state_trans(CP, active, self.long_control_state, CS.vEgo, + v_target_future, CS.brakePressed, + CS.cruiseState.standstill) + + if self.long_control_state == LongCtrlState.off or CS.gasPressed: + self.reset(CS.vEgo) + output_accel = 0. + + # tracking objects and driving + elif self.long_control_state == LongCtrlState.pid: + self.v_pid = v_target + + # Toyota starts braking more when it thinks you want to stop + # Freeze the integrator so we don't accelerate to compensate, and don't allow positive acceleration + prevent_overshoot = not CP.stoppingControl and CS.vEgo < 1.5 and v_target_future < 0.7 and v_target_future < self.v_pid + deadzone = interp(CS.vEgo, CP.longitudinalTuning.deadzoneBP, CP.longitudinalTuning.deadzoneV) + freeze_integrator = prevent_overshoot + + output_accel = self.pid.update(self.v_pid, CS.vEgo, speed=CS.vEgo, deadzone=deadzone, feedforward=a_target, freeze_integrator=freeze_integrator) + + if prevent_overshoot: + output_accel = min(output_accel, 0.0) + + # Intention is to stop, switch to a different brake control until we stop + elif self.long_control_state == LongCtrlState.stopping: + # Keep applying brakes until the car is stopped + if not CS.standstill or output_accel > CP.stopAccel: + output_accel -= CP.stoppingDecelRate * DT_CTRL + output_accel = clip(output_accel, accel_limits[0], accel_limits[1]) + self.reset(CS.vEgo) + + self.last_output_accel = output_accel + final_accel = clip(output_accel, accel_limits[0], accel_limits[1]) + + return final_accel diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/.gitignore b/selfdrive/controls/lib/longitudinal_mpc_lib/.gitignore new file mode 100644 index 000000000..6f09b1aa0 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/.gitignore @@ -0,0 +1,2 @@ +acados_ocp_long.json +c_generated_code/ diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/SConscript b/selfdrive/controls/lib/longitudinal_mpc_lib/SConscript new file mode 100644 index 000000000..4c43985d1 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/SConscript @@ -0,0 +1,88 @@ +Import('env', 'envCython', 'arch', 'common') + +gen = "c_generated_code" + +casadi_model = [ + f'{gen}/long_model/long_expl_ode_fun.c', + f'{gen}/long_model/long_expl_vde_forw.c', +] + +casadi_cost_y = [ + f'{gen}/long_cost/long_cost_y_fun.c', + f'{gen}/long_cost/long_cost_y_fun_jac_ut_xt.c', + f'{gen}/long_cost/long_cost_y_hess.c', +] + +casadi_cost_e = [ + f'{gen}/long_cost/long_cost_y_e_fun.c', + f'{gen}/long_cost/long_cost_y_e_fun_jac_ut_xt.c', + f'{gen}/long_cost/long_cost_y_e_hess.c', +] + +casadi_cost_0 = [ + f'{gen}/long_cost/long_cost_y_0_fun.c', + f'{gen}/long_cost/long_cost_y_0_fun_jac_ut_xt.c', + f'{gen}/long_cost/long_cost_y_0_hess.c', +] + +casadi_constraints = [ + f'{gen}/long_constraints/long_constr_h_fun.c', + f'{gen}/long_constraints/long_constr_h_fun_jac_uxt_zt.c', + f'{gen}/long_constraints/long_constr_h_e_fun.c', + f'{gen}/long_constraints/long_constr_h_e_fun_jac_uxt_zt.c', +] + +build_files = [f'{gen}/acados_solver_long.c'] + casadi_model + casadi_cost_y + casadi_cost_e + \ + casadi_cost_0 + casadi_constraints + +# extra generated files used to trigger a rebuild +generated_files = [ + f'{gen}/Makefile', + + f'{gen}/main_long.c', + f'{gen}/acados_solver_long.h', + f'{gen}/acados_solver.pxd', + + f'{gen}/long_model/long_expl_vde_adj.c', + + f'{gen}/long_model/long_model.h', + f'{gen}/long_constraints/long_h_constraint.h', + f'{gen}/long_constraints/long_h_e_constraint.h', + f'{gen}/long_cost/long_cost_y_fun.h', + f'{gen}/long_cost/long_cost_y_e_fun.h', + f'{gen}/long_cost/long_cost_y_0_fun.h', +] + build_files + +lenv = env.Clone() +lenv.Clean(generated_files, Dir(gen)) + +lenv.Command(generated_files, + ["long_mpc.py"], + f"cd {Dir('.').abspath} && python3 long_mpc.py") + +lenv["CFLAGS"].append("-DACADOS_WITH_QPOASES") +lenv["CXXFLAGS"].append("-DACADOS_WITH_QPOASES") +lenv["CCFLAGS"].append("-Wno-unused") +if arch != "Darwin": + lenv["LINKFLAGS"].append("-Wl,--disable-new-dtags") +lib_solver = lenv.SharedLibrary(f"{gen}/acados_ocp_solver_long", + build_files, + LIBS=['m', 'acados', 'hpipm', 'blasfeo', 'qpOASES_e']) + +# generate cython stuff +acados_ocp_solver_pyx = File("#pyextra/acados_template/acados_ocp_solver_pyx.pyx") +acados_ocp_solver_common = File("#pyextra/acados_template/acados_solver_common.pxd") +libacados_ocp_solver_pxd = File(f'{gen}/acados_solver.pxd') +libacados_ocp_solver_c = File(f'{gen}/acados_ocp_solver_pyx.c') + +lenv2 = envCython.Clone() +lenv2["LINKFLAGS"] += [lib_solver[0].get_labspath()] +lenv2.Command(libacados_ocp_solver_c, + [acados_ocp_solver_pyx, acados_ocp_solver_common, libacados_ocp_solver_pxd], + f'cython' + \ + f' -o {libacados_ocp_solver_c.get_labspath()}' + \ + f' -I {libacados_ocp_solver_pxd.get_dir().get_labspath()}' + \ + f' -I {acados_ocp_solver_common.get_dir().get_labspath()}' + \ + f' {acados_ocp_solver_pyx.get_labspath()}') +lib_cython = lenv2.Program(f'{gen}/acados_ocp_solver_pyx.so', [libacados_ocp_solver_c]) +lenv2.Depends(lib_cython, lib_solver) diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/__init__.py b/selfdrive/controls/lib/longitudinal_mpc_lib/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/Makefile b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/Makefile new file mode 100644 index 000000000..36e4d75bf --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/Makefile @@ -0,0 +1,210 @@ +# +# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, +# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, +# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, +# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl +# +# This file is part of acados. +# +# The 2-Clause BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE.; +# + + + + + + +ACADOS_FLAGS = -fPIC -std=c99 #-fno-diagnostics-show-line-numbers -g +# # Debugging +# ACADOS_FLAGS += -g3 + +MODEL_OBJ= +MODEL_OBJ+= long_model/long_expl_ode_fun.o +MODEL_OBJ+= long_model/long_expl_vde_forw.o + + +OCP_OBJ= +OCP_OBJ+= long_constraints/long_constr_h_fun_jac_uxt_zt.o +OCP_OBJ+= long_constraints/long_constr_h_fun.o +OCP_OBJ+= long_constraints/long_constr_h_e_fun_jac_uxt_zt.o +OCP_OBJ+= long_constraints/long_constr_h_e_fun.o +OCP_OBJ+= long_cost/long_cost_y_0_fun.c +OCP_OBJ+= long_cost/long_cost_y_0_fun_jac_ut_xt.c +OCP_OBJ+= long_cost/long_cost_y_0_hess.c +OCP_OBJ+= long_cost/long_cost_y_fun.c +OCP_OBJ+= long_cost/long_cost_y_fun_jac_ut_xt.c +OCP_OBJ+= long_cost/long_cost_y_hess.c +OCP_OBJ+= long_cost/long_cost_y_e_fun.c +OCP_OBJ+= long_cost/long_cost_y_e_fun_jac_ut_xt.c +OCP_OBJ+= long_cost/long_cost_y_e_hess.c +OCP_OBJ+= acados_solver_long.o + + +SIM_OBJ= +SIM_OBJ+= acados_sim_solver_long.o + +EX_OBJ= +EX_OBJ+= main_long.o + +EX_SIM_OBJ= +EX_SIM_OBJ+= main_sim_long.o + +OBJ= +OBJ+= $(MODEL_OBJ) +OBJ+= $(SIM_OBJ) +OBJ+= $(OCP_OBJ) + +EXTERNAL_DIR= +EXTERNAL_LIB= + +INCLUDE_PATH = /data/openpilot_release/third_party/acados/include/acados/include +LIB_PATH = /data/openpilot_release/third_party/acados/include/acados/lib +all: clean casadi_fun example_sim example +shared_lib: bundled_shared_lib ocp_shared_lib sim_shared_lib + +CASADI_MODEL_SOURCE= +CASADI_MODEL_SOURCE+= long_expl_ode_fun.c +CASADI_MODEL_SOURCE+= long_expl_vde_forw.c +CASADI_CON_H_SOURCE= +CASADI_CON_H_SOURCE+= long_constr_h_fun_jac_uxt_zt.c +CASADI_CON_H_SOURCE+= long_constr_h_fun.c +CASADI_CON_H_E_SOURCE= +CASADI_CON_H_E_SOURCE+= long_constr_h_e_fun_jac_uxt_zt.c +CASADI_CON_H_E_SOURCE+= long_constr_h_e_fun.c +CASADI_COST_Y_SOURCE= +CASADI_COST_Y_SOURCE+= long_cost_y_fun.c +CASADI_COST_Y_SOURCE+= long_cost_y_fun_jac_ut_xt.c +CASADI_COST_Y_SOURCE+= long_cost_y_hess.c +CASADI_COST_Y_E_SOURCE= +CASADI_COST_Y_E_SOURCE+= long_cost_y_e_fun.c +CASADI_COST_Y_E_SOURCE+= long_cost_y_e_fun_jac_ut_xt.c +CASADI_COST_Y_E_SOURCE+= long_cost_y_e_hess.c +CASADI_COST_Y_0_SOURCE= +CASADI_COST_Y_0_SOURCE+= long_cost_y_0_fun.c +CASADI_COST_Y_0_SOURCE+= long_cost_y_0_fun_jac_ut_xt.c +CASADI_COST_Y_0_SOURCE+= long_cost_y_0_hess.c + +casadi_fun: + ( cd long_model ; gcc $(ACADOS_FLAGS) -c $(CASADI_MODEL_SOURCE)) + ( cd long_constraints ; gcc $(ACADOS_FLAGS) -c $(CASADI_CON_H_SOURCE)) + ( cd long_constraints ; gcc $(ACADOS_FLAGS) -c $(CASADI_CON_H_E_SOURCE)) + ( cd long_cost ; gcc $(ACADOS_FLAGS) -c $(CASADI_COST_Y_SOURCE)) + ( cd long_cost ; gcc $(ACADOS_FLAGS) -c $(CASADI_COST_Y_E_SOURCE)) + ( cd long_cost ; gcc $(ACADOS_FLAGS) -c $(CASADI_COST_Y_0_SOURCE)) + +main: + gcc $(ACADOS_FLAGS) -c main_long.c -I $(INCLUDE_PATH)/blasfeo/include/ -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) -I $(INCLUDE_PATH)/acados/ \ + +main_sim: + gcc $(ACADOS_FLAGS) -c main_sim_long.c -I $(INCLUDE_PATH)/blasfeo/include/ -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) -I $(INCLUDE_PATH)/acados/ + +ocp_solver: + gcc $(ACADOS_FLAGS) -c acados_solver_long.c -I $(INCLUDE_PATH)/blasfeo/include/ -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) -I $(INCLUDE_PATH)/acados/ \ + +sim_solver: + gcc $(ACADOS_FLAGS) -c acados_sim_solver_long.c -I $(INCLUDE_PATH)/blasfeo/include/ -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) -I $(INCLUDE_PATH)/acados/ \ + +example: ocp_solver main + gcc $(ACADOS_FLAGS) -o main_long $(EX_OBJ) $(OBJ) -L $(LIB_PATH) \ + -lacados -lhpipm -lblasfeo \ + \ + -lm \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) \ + -I $(INCLUDE_PATH)/acados/ \ + + +example_sim: sim_solver main_sim + gcc $(ACADOS_FLAGS) -o main_sim_long $(EX_SIM_OBJ) $(MODEL_OBJ) $(SIM_OBJ) -L $(LIB_PATH) \ + -lacados -lhpipm -lblasfeo \ + \ + -lm \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/acados/ \ + +bundled_shared_lib: casadi_fun ocp_solver sim_solver + gcc $(ACADOS_FLAGS) -shared -o libacados_solver_long.so $(OBJ) \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) \ + -L $(LIB_PATH) \ + -lacados -lhpipm -lblasfeo \ + \ + -lm \ + +ocp_shared_lib: casadi_fun ocp_solver + gcc $(ACADOS_FLAGS) -shared -o libacados_ocp_solver_long.so $(OCP_OBJ) $(MODEL_OBJ) \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) \ + -L$(EXTERNAL_DIR) -l$(EXTERNAL_LIB) \ + -L $(LIB_PATH) -lacados -lhpipm -lblasfeo \ + \ + -lm \ + +ocp_cython_c: ocp_shared_lib + cython \ + -o acados_ocp_solver_pyx.c \ + -I $(INCLUDE_PATH)/../interfaces/acados_template/acados_template \ + $(INCLUDE_PATH)/../interfaces/acados_template/acados_template/acados_ocp_solver_pyx.pyx \ + +ocp_cython_o: ocp_cython_c + clang $(ACADOS_FLAGS) -c -O2 \ + -o acados_ocp_solver_pyx.o \ + -I /usr/include/python3.8 \ + -I $(INCLUDE_PATH)/blasfeo/include/ \ + -I $(INCLUDE_PATH)/hpipm/include/ \ + -I $(INCLUDE_PATH) \ + acados_ocp_solver_pyx.c \ + +ocp_cython: ocp_cython_o + clang $(ACADOS_FLAGS) -shared \ + -o acados_ocp_solver_pyx.so \ + -Wl,-rpath=$(LIB_PATH) \ + acados_ocp_solver_pyx.o \ + $(abspath .)/libacados_ocp_solver_long.so \ + -L $(LIB_PATH) -lacados -lhpipm -lblasfeo -lqpOASES_e \ + \ + -lm \ + +sim_shared_lib: casadi_fun sim_solver + gcc $(ACADOS_FLAGS) -shared -o libacados_sim_solver_long.so $(SIM_OBJ) $(MODEL_OBJ) -L$(EXTERNAL_DIR) -l$(EXTERNAL_LIB) \ + -L $(LIB_PATH) -lacados -lhpipm -lblasfeo \ + \ + -lm \ + +clean: + rm -f *.o + rm -f *.so + rm -f main_long + +clean_ocp_shared_lib: + rm -f libacados_ocp_solver_long.so + rm -f acados_solver_long.o diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.c new file mode 100644 index 000000000..20ca398b5 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.c @@ -0,0 +1,28063 @@ +/* Generated by Cython 0.29.26 */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_26" +#define CYTHON_HEX_VERSION 0x001D1AF0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject* co=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(0))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too; + if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here + if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too; + Py_XDECREF((PyObject*)co); + co = (PyCodeObject*)call_result; + call_result = NULL; + if (0) { + cleanup_code_too: + Py_XDECREF((PyObject*)co); + co = NULL; + } + end: + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(call_result); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return co; + } +#else + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if defined(PyUnicode_IS_READY) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #else + #define __Pyx_PyUnicode_READY(op) (0) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__acados_template__acados_ocp_solver_pyx +#define __PYX_HAVE_API__acados_template__acados_ocp_solver_pyx +/* Early includes */ +#include +#include "acados/ocp_nlp/ocp_nlp_common.h" +#include "acados_c/ocp_nlp_interface.h" +#include "acados_solver_long.h" +#include +#include "numpy/arrayobject.h" +#include "numpy/ndarrayobject.h" +#include "numpy/ndarraytypes.h" +#include "numpy/arrayscalars.h" +#include "numpy/ufuncobject.h" + + /* NumPy API declarations from "numpy/__init__.pxd" */ + +#include "pythread.h" +#include +#include "pystate.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +/* Header.proto */ +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "pyextra/acados_template/acados_ocp_solver_pyx.pyx", + "stringsource", + "__init__.pxd", + "type.pxd", +}; +/* BufferFormatStructs.proto */ +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; + struct __Pyx_StructField_* fields; + size_t size; + size_t arraysize[8]; + int ndim; + char typegroup; + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + +/* MemviewSliceStruct.proto */ +struct __pyx_memoryview_obj; +typedef struct { + struct __pyx_memoryview_obj *memview; + char *data; + Py_ssize_t shape[8]; + Py_ssize_t strides[8]; + Py_ssize_t suboffsets[8]; +} __Pyx_memviewslice; +#define __Pyx_MemoryView_Len(m) (m.shape[0]) + +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __pyx_atomic_int_type int +#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\ + !defined(__i386__) + #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0 + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type LONG + #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 + #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using Intel atomics" + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #warning "Not using atomics" + #endif +#endif +typedef volatile __pyx_atomic_int_type __pyx_atomic_int; +#if CYTHON_ATOMICS + #define __pyx_add_acquisition_count(memview)\ + __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) +#else + #define __pyx_add_acquisition_count(memview)\ + __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) +#endif + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":690 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":691 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":692 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":693 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":697 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":698 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":699 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":700 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":704 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":705 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":714 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":715 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":716 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":718 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":719 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":720 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":722 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":723 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":725 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":726 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":727 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + + +/*--- Type declarations ---*/ +struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast; +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":729 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":730 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":731 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":733 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* "acados_template/acados_ocp_solver_pyx.pyx":50 + * + * + * cdef class AcadosOcpSolverFast: # <<<<<<<<<<<<<< + * """ + * Class to interact with the acados ocp solver C object. + */ +struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast { + PyObject_HEAD + long_solver_capsule *capsule; + void *nlp_opts; + ocp_nlp_dims *nlp_dims; + ocp_nlp_config *nlp_config; + ocp_nlp_out *nlp_out; + ocp_nlp_in *nlp_in; + ocp_nlp_solver *nlp_solver; + PyObject *model_name; + int N; + int solver_created; +}; + + +/* "View.MemoryView":105 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_array_obj { + PyObject_HEAD + struct __pyx_vtabstruct_array *__pyx_vtab; + char *data; + Py_ssize_t len; + char *format; + int ndim; + Py_ssize_t *_shape; + Py_ssize_t *_strides; + Py_ssize_t itemsize; + PyObject *mode; + PyObject *_format; + void (*callback_free_data)(void *); + int free_data; + int dtype_is_object; +}; + + +/* "View.MemoryView":279 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":330 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ +struct __pyx_memoryview_obj { + PyObject_HEAD + struct __pyx_vtabstruct_memoryview *__pyx_vtab; + PyObject *obj; + PyObject *_size; + PyObject *_array_interface; + PyThread_type_lock lock; + __pyx_atomic_int acquisition_count[2]; + __pyx_atomic_int *acquisition_count_aligned_p; + Py_buffer view; + int flags; + int dtype_is_object; + __Pyx_TypeInfo *typeinfo; +}; + + +/* "View.MemoryView":965 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ +struct __pyx_memoryviewslice_obj { + struct __pyx_memoryview_obj __pyx_base; + __Pyx_memviewslice from_slice; + PyObject *from_object; + PyObject *(*to_object_func)(char *); + int (*to_dtype_func)(char *, PyObject *); +}; + + + +/* "View.MemoryView":105 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_array { + PyObject *(*get_memview)(struct __pyx_array_obj *); +}; +static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; + + +/* "View.MemoryView":330 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ + +struct __pyx_vtabstruct_memoryview { + char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); + PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); +}; +static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; + + +/* "View.MemoryView":965 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ + +struct __pyx_vtabstruct__memoryviewslice { + struct __pyx_vtabstruct_memoryview __pyx_base; +}; +static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if CYTHON_FAST_PYCALL + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif // CYTHON_FAST_PYCALL +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* IsLittleEndian.proto */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); + +/* BufferFormatCheck.proto */ +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* BufferGetAndValidate.proto */ +#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\ + ((obj == Py_None || obj == NULL) ?\ + (__Pyx_ZeroBuffer(buf), 0) :\ + __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)) +static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static void __Pyx_ZeroBuffer(Py_buffer* buf); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); +static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 }; +static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + +/* BufferIndexError.proto */ +static void __Pyx_RaiseBufferIndexError(int axis); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* MemviewSliceInit.proto */ +#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d +#define __Pyx_MEMVIEW_DIRECT 1 +#define __Pyx_MEMVIEW_PTR 2 +#define __Pyx_MEMVIEW_FULL 4 +#define __Pyx_MEMVIEW_CONTIG 8 +#define __Pyx_MEMVIEW_STRIDED 16 +#define __Pyx_MEMVIEW_FOLLOW 32 +#define __Pyx_IS_C_CONTIG 1 +#define __Pyx_IS_F_CONTIG 2 +static int __Pyx_init_memviewslice( + struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference); +static CYTHON_INLINE int __pyx_add_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +static CYTHON_INLINE int __pyx_sub_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) +#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) +#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) +#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) +static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* None.proto */ +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); + +/* UnaryNegOverflows.proto */ +#define UNARY_NEG_WOULD_OVERFLOW(x)\ + (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/ +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* decode_c_string_utf16.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 0; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = -1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} + +/* decode_c_string.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + +/* ListExtend.proto */ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject* none = _PyList_Extend((PyListObject*)L, v); + if (unlikely(!none)) + return -1; + Py_DECREF(none); + return 0; +#else + return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); +#endif +} + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* None.proto */ +static CYTHON_INLINE long __Pyx_div_long(long, long); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +/* BufferStructDeclare.proto */ +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +/* MemviewSliceIsContig.proto */ +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim); + +/* OverlappingSlices.proto */ +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +/* Capsule.proto */ +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +/* GCCDiagnostics.proto */ +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* TypeInfoCompare.proto */ +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +/* MemviewSliceValidateAndInit.proto */ +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *, int writable_flag); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *, int writable_flag); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(PyObject *, int writable_flag); + +/* RealImag.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if defined(__cplusplus) && CYTHON_CCOMPLEX\ + && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_float(a, b) ((a)==(b)) + #define __Pyx_c_sum_float(a, b) ((a)+(b)) + #define __Pyx_c_diff_float(a, b) ((a)-(b)) + #define __Pyx_c_prod_float(a, b) ((a)*(b)) + #define __Pyx_c_quot_float(a, b) ((a)/(b)) + #define __Pyx_c_neg_float(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_float(z) ((z)==(float)0) + #define __Pyx_c_conj_float(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_float(z) (::std::abs(z)) + #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_float(z) ((z)==0) + #define __Pyx_c_conj_float(z) (conjf(z)) + #if 1 + #define __Pyx_c_abs_float(z) (cabsf(z)) + #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_double(a, b) ((a)==(b)) + #define __Pyx_c_sum_double(a, b) ((a)+(b)) + #define __Pyx_c_diff_double(a, b) ((a)-(b)) + #define __Pyx_c_prod_double(a, b) ((a)*(b)) + #define __Pyx_c_quot_double(a, b) ((a)/(b)) + #define __Pyx_c_neg_double(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_double(z) ((z)==(double)0) + #define __Pyx_c_conj_double(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (::std::abs(z)) + #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_double(z) ((z)==0) + #define __Pyx_c_conj_double(z) (conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (cabs(z)) + #define __Pyx_c_pow_double(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +/* MemviewSliceCopyTemplate.proto */ +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/ +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/ +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/ +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ + +/* Module declarations from 'cython.view' */ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'libc' */ + +/* Module declarations from 'acados_solver_common' */ + +/* Module declarations from 'acados_solver' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_generic = 0; +static PyTypeObject *__pyx_ptype_5numpy_number = 0; +static PyTypeObject *__pyx_ptype_5numpy_integer = 0; +static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_inexact = 0; +static PyTypeObject *__pyx_ptype_5numpy_floating = 0; +static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0; +static PyTypeObject *__pyx_ptype_5numpy_flexible = 0; +static PyTypeObject *__pyx_ptype_5numpy_character = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; + +/* Module declarations from 'acados_template.acados_ocp_solver_pyx' */ +static PyTypeObject *__pyx_ptype_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast = 0; +static PyTypeObject *__pyx_array_type = 0; +static PyTypeObject *__pyx_MemviewEnum_type = 0; +static PyTypeObject *__pyx_memoryview_type = 0; +static PyTypeObject *__pyx_memoryviewslice_type = 0; +static PyObject *generic = 0; +static PyObject *strided = 0; +static PyObject *indirect = 0; +static PyObject *contiguous = 0; +static PyObject *indirect_contiguous = 0; +static int __pyx_memoryview_thread_locks_used; +static PyThread_type_lock __pyx_memoryview_thread_locks[8]; +static CYTHON_INLINE PyObject *__Pyx_carray_to_py_int(int *, Py_ssize_t); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_int(int *, Py_ssize_t); /*proto*/ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ +static void *__pyx_align_pointer(void *, size_t); /*proto*/ +static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/ +static PyObject *_unellipsify(PyObject *, int); /*proto*/ +static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/ +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/ +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/ +static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/ +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/ +static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/ +static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/ +static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/ +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/ +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/ +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/ +static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/ +static int __pyx_memoryview_err(PyObject *, char *); /*proto*/ +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/ +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ +static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_char = { "unsigned char", NULL, sizeof(unsigned char), { 0 }, 0, IS_UNSIGNED(unsigned char) ? 'U' : 'I', IS_UNSIGNED(unsigned char), 0 }; +#define __Pyx_MODULE_NAME "acados_template.acados_ocp_solver_pyx" +extern int __pyx_module_is_main_acados_template__acados_ocp_solver_pyx; +int __pyx_module_is_main_acados_template__acados_ocp_solver_pyx = 0; + +/* Implementation of 'acados_template.acados_ocp_solver_pyx' */ +static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_Ellipsis; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_IndexError; +static const char __pyx_k_[] = ""; +static const char __pyx_k_F[] = "F"; +static const char __pyx_k_N[] = "N"; +static const char __pyx_k_O[] = "O"; +static const char __pyx_k_c[] = "c"; +static const char __pyx_k_p[] = "p"; +static const char __pyx_k_t[] = "t"; +static const char __pyx_k_u[] = "u"; +static const char __pyx_k_x[] = "x"; +static const char __pyx_k_z[] = "z"; +static const char __pyx_k__6[] = ", "; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_np[] = "np"; +static const char __pyx_k_os[] = "os"; +static const char __pyx_k_pi[] = "pi"; +static const char __pyx_k_sl[] = "sl"; +static const char __pyx_k_su[] = "su"; +static const char __pyx_k_lam[] = "lam"; +static const char __pyx_k_lbu[] = "lbu"; +static const char __pyx_k_lbx[] = "lbx"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_obj[] = "obj"; +static const char __pyx_k_ubu[] = "ubu"; +static const char __pyx_k_ubx[] = "ubx"; +static const char __pyx_k_base[] = "base"; +static const char __pyx_k_data[] = "data"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_mode[] = "mode"; +static const char __pyx_k_name[] = "name"; +static const char __pyx_k_ndim[] = "ndim"; +static const char __pyx_k_pack[] = "pack"; +static const char __pyx_k_size[] = "size"; +static const char __pyx_k_step[] = "step"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_yref[] = "yref"; +static const char __pyx_k_ASCII[] = "ASCII"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_dtype[] = "dtype"; +static const char __pyx_k_error[] = "error"; +static const char __pyx_k_field[] = "field_"; +static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_order[] = "order"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_shape[] = "shape"; +static const char __pyx_k_stage[] = "stage"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_utf_8[] = "utf-8"; +static const char __pyx_k_value[] = "value_"; +static const char __pyx_k_y_ref[] = "y_ref"; +static const char __pyx_k_zeros[] = "zeros"; +static const char __pyx_k_double[] = "double"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_format[] = "format"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_name_2[] = "__name__"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_struct[] = "struct"; +static const char __pyx_k_tol_eq[] = "tol_eq"; +static const char __pyx_k_unpack[] = "unpack"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_SQP_RTI[] = "SQP_RTI"; +static const char __pyx_k_float64[] = "float64"; +static const char __pyx_k_fortran[] = "fortran"; +static const char __pyx_k_memview[] = "memview"; +static const char __pyx_k_Ellipsis[] = "Ellipsis"; +static const char __pyx_k_filename[] = "filename"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_tol_comp[] = "tol_comp"; +static const char __pyx_k_tol_ineq[] = "tol_ineq"; +static const char __pyx_k_tol_stat[] = "tol_stat"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_alpha_min[] = "alpha_min"; +static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_overwrite[] = "overwrite"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_rti_phase[] = "rti_phase"; +static const char __pyx_k_IndexError[] = "IndexError"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_acados_ocp[] = "acados_ocp"; +static const char __pyx_k_model_name[] = "model_name"; +static const char __pyx_k_pyx_result[] = "__pyx_result"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; +static const char __pyx_k_print_level[] = "print_level"; +static const char __pyx_k_step_length[] = "step_length"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_stringsource[] = "stringsource"; +static const char __pyx_k_globalization[] = "globalization"; +static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_asfortranarray[] = "asfortranarray"; +static const char __pyx_k_solver_options[] = "solver_options"; +static const char __pyx_k_View_MemoryView[] = "View.MemoryView"; +static const char __pyx_k_allocate_buffer[] = "allocate_buffer"; +static const char __pyx_k_alpha_reduction[] = "alpha_reduction"; +static const char __pyx_k_code_export_dir[] = "code_export_dir"; +static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; +static const char __pyx_k_nlp_solver_type[] = "nlp_solver_type"; +static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_strided_and_direct[] = ""; +static const char __pyx_k_AcadosOcpSolverFast[] = "AcadosOcpSolverFast"; +static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; +static const char __pyx_k_initialize_t_slacks[] = "initialize_t_slacks"; +static const char __pyx_k_strided_and_indirect[] = ""; +static const char __pyx_k_contiguous_and_direct[] = ""; +static const char __pyx_k_MemoryView_of_r_object[] = ""; +static const char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; +static const char __pyx_k_contiguous_and_indirect[] = ""; +static const char __pyx_k_with_dimension_you_have[] = "with dimension {} (you have {})"; +static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; +static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; +static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; +static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; +static const char __pyx_k_strided_and_direct_or_indirect[] = ""; +static const char __pyx_k_AcadosOcpSolver_constraints_set[] = "AcadosOcpSolver.constraints_set(): mismatching dimension for field \"{}\" with dimension {} (you have {})"; +static const char __pyx_k_AcadosOcpSolver_get_stage_index[] = "AcadosOcpSolver.get(): stage index must be in [0, N], got: {}."; +static const char __pyx_k_AcadosOcpSolver_set_mismatching[] = "AcadosOcpSolver.set(): mismatching dimension for field \"{}\" "; +static const char __pyx_k_for_field_with_dimension_you_ha[] = " for field \"{}\" with dimension {} (you have {})"; +static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; +static const char __pyx_k_AcadosOcpSolver_cost_set_mismatc[] = "AcadosOcpSolver.cost_set(): mismatching dimension"; +static const char __pyx_k_AcadosOcpSolver_get_field_does_n[] = "AcadosOcpSolver.get(): field {} does not exist at final stage {}."; +static const char __pyx_k_AcadosOcpSolver_get_is_an_invali[] = "AcadosOcpSolver.get(): {} is an invalid argument. \n Possible values are {}. Exiting."; +static const char __pyx_k_AcadosOcpSolver_options_set_does[] = "AcadosOcpSolver.options_set() does not support field {}.\n Possible values are {}."; +static const char __pyx_k_AcadosOcpSolver_set_is_not_a_val[] = "AcadosOcpSolver.set(): {} is not a valid argument. \nPossible values are {}. Exiting."; +static const char __pyx_k_AcadosOcpSolver_solve_argument_r[] = "AcadosOcpSolver.solve(): argument 'rti_phase' can take only values 0, 1, 2 for SQP-RTI-type solvers"; +static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; +static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; +static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview"; +static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview"; +static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))"; +static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; +static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; +static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; +static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; +static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; +static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; +static const char __pyx_k_solver_option_must_be_of_type_fl[] = "solver option {} must be of type float. You have {}."; +static const char __pyx_k_solver_option_must_be_of_type_in[] = "solver option {} must be of type int. You have {}."; +static const char __pyx_k_solver_option_must_be_of_type_st[] = "solver option {} must be of type str. You have {}."; +static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; +static const char __pyx_k_AcadosOcpSolver_solve_argument_r_2[] = "AcadosOcpSolver.solve(): argument 'rti_phase' can take only value 0 for SQP-type solvers"; +static PyObject *__pyx_kp_u_; +static PyObject *__pyx_n_s_ASCII; +static PyObject *__pyx_n_s_AcadosOcpSolverFast; +static PyObject *__pyx_kp_u_AcadosOcpSolver_constraints_set; +static PyObject *__pyx_kp_u_AcadosOcpSolver_cost_set_mismatc; +static PyObject *__pyx_kp_u_AcadosOcpSolver_get_field_does_n; +static PyObject *__pyx_kp_u_AcadosOcpSolver_get_is_an_invali; +static PyObject *__pyx_kp_u_AcadosOcpSolver_get_stage_index; +static PyObject *__pyx_kp_u_AcadosOcpSolver_options_set_does; +static PyObject *__pyx_kp_u_AcadosOcpSolver_set_is_not_a_val; +static PyObject *__pyx_kp_u_AcadosOcpSolver_set_mismatching; +static PyObject *__pyx_kp_u_AcadosOcpSolver_solve_argument_r; +static PyObject *__pyx_kp_u_AcadosOcpSolver_solve_argument_r_2; +static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; +static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; +static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor; +static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi; +static PyObject *__pyx_kp_s_Cannot_index_with_type_s; +static PyObject *__pyx_n_s_Ellipsis; +static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; +static PyObject *__pyx_n_u_F; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; +static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; +static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; +static PyObject *__pyx_kp_s_MemoryView_of_r_object; +static PyObject *__pyx_n_s_N; +static PyObject *__pyx_n_s_NotImplementedError; +static PyObject *__pyx_n_b_O; +static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; +static PyObject *__pyx_n_s_PickleError; +static PyObject *__pyx_n_u_SQP_RTI; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; +static PyObject *__pyx_kp_u__6; +static PyObject *__pyx_n_s_acados_ocp; +static PyObject *__pyx_n_s_allocate_buffer; +static PyObject *__pyx_n_u_alpha_min; +static PyObject *__pyx_n_u_alpha_reduction; +static PyObject *__pyx_n_s_ascontiguousarray; +static PyObject *__pyx_n_s_asfortranarray; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_code_export_dir; +static PyObject *__pyx_kp_s_contiguous_and_direct; +static PyObject *__pyx_kp_s_contiguous_and_indirect; +static PyObject *__pyx_n_s_data; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_double; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dtype_is_object; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_field; +static PyObject *__pyx_n_s_filename; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_kp_u_for_field_with_dimension_you_ha; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_n_u_globalization; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_u_initialize_t_slacks; +static PyObject *__pyx_n_s_itemsize; +static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; +static PyObject *__pyx_n_u_lam; +static PyObject *__pyx_n_u_lbu; +static PyObject *__pyx_n_u_lbx; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_memview; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_model_name; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_nlp_solver_type; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to; +static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_order; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_overwrite; +static PyObject *__pyx_n_u_p; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_u_pi; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_u_print_level; +static PyObject *__pyx_n_s_pyx_PickleError; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_result; +static PyObject *__pyx_n_s_pyx_state; +static PyObject *__pyx_n_s_pyx_type; +static PyObject *__pyx_n_s_pyx_unpickle_Enum; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_reduce_ex; +static PyObject *__pyx_n_u_rti_phase; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_u_sl; +static PyObject *__pyx_kp_u_solver_option_must_be_of_type_fl; +static PyObject *__pyx_kp_u_solver_option_must_be_of_type_in; +static PyObject *__pyx_kp_u_solver_option_must_be_of_type_st; +static PyObject *__pyx_n_s_solver_options; +static PyObject *__pyx_n_s_stage; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_u_step_length; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_kp_s_strided_and_direct; +static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; +static PyObject *__pyx_kp_s_strided_and_indirect; +static PyObject *__pyx_kp_s_stringsource; +static PyObject *__pyx_n_s_struct; +static PyObject *__pyx_n_u_su; +static PyObject *__pyx_n_u_t; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_u_tol_comp; +static PyObject *__pyx_n_u_tol_eq; +static PyObject *__pyx_n_u_tol_ineq; +static PyObject *__pyx_n_u_tol_stat; +static PyObject *__pyx_n_u_u; +static PyObject *__pyx_n_u_ubu; +static PyObject *__pyx_n_u_ubx; +static PyObject *__pyx_kp_s_unable_to_allocate_array_data; +static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; +static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_kp_u_utf_8; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_kp_u_with_dimension_you_have; +static PyObject *__pyx_n_u_x; +static PyObject *__pyx_n_u_y_ref; +static PyObject *__pyx_n_u_yref; +static PyObject *__pyx_n_u_z; +static PyObject *__pyx_n_s_zeros; +static int __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast___cinit__(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, PyObject *__pyx_v_model_name, int __pyx_v_N, CYTHON_UNUSED PyObject *__pyx_v_code_export_dir); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_2solve(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_4set_new_time_steps(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_new_time_steps); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_6get(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_8print_statistics(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_10store_iterate(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_filename, CYTHON_UNUSED PyObject *__pyx_v_overwrite); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_12load_iterate(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_14get_stats(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_field_); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_16get_cost(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_18get_residuals(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_20set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_22cost_set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_24constraints_set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_26dynamics_get(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_28options_set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_30__del__(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */ +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_184977713; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_slice__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_codeobj__34; +/* Late includes */ + +/* "acados_template/acados_ocp_solver_pyx.pyx":71 + * cdef bint solver_created + * + * def __cinit__(self, str model_name, int N, str code_export_dir): # <<<<<<<<<<<<<< + * self.model_name = model_name + * self.N = N + */ + +/* Python wrapper */ +static int __pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_model_name = 0; + int __pyx_v_N; + CYTHON_UNUSED PyObject *__pyx_v_code_export_dir = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_model_name,&__pyx_n_s_N,&__pyx_n_s_code_export_dir,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_model_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(0, 71, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_code_export_dir)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(0, 71, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 71, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_model_name = ((PyObject*)values[0]); + __pyx_v_N = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L3_error) + __pyx_v_code_export_dir = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 71, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_model_name), (&PyUnicode_Type), 1, "model_name", 1))) __PYX_ERR(0, 71, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code_export_dir), (&PyUnicode_Type), 1, "code_export_dir", 1))) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast___cinit__(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_model_name, __pyx_v_N, __pyx_v_code_export_dir); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast___cinit__(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, PyObject *__pyx_v_model_name, int __pyx_v_N, CYTHON_UNUSED PyObject *__pyx_v_code_export_dir) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":72 + * + * def __cinit__(self, str model_name, int N, str code_export_dir): + * self.model_name = model_name # <<<<<<<<<<<<<< + * self.N = N + * + */ + __Pyx_INCREF(__pyx_v_model_name); + __Pyx_GIVEREF(__pyx_v_model_name); + __Pyx_GOTREF(__pyx_v_self->model_name); + __Pyx_DECREF(__pyx_v_self->model_name); + __pyx_v_self->model_name = __pyx_v_model_name; + + /* "acados_template/acados_ocp_solver_pyx.pyx":73 + * def __cinit__(self, str model_name, int N, str code_export_dir): + * self.model_name = model_name + * self.N = N # <<<<<<<<<<<<<< + * + * self.solver_created = False + */ + __pyx_v_self->N = __pyx_v_N; + + /* "acados_template/acados_ocp_solver_pyx.pyx":75 + * self.N = N + * + * self.solver_created = False # <<<<<<<<<<<<<< + * + * # create capsule + */ + __pyx_v_self->solver_created = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":78 + * + * # create capsule + * self.capsule = acados_solver.acados_create_capsule() # <<<<<<<<<<<<<< + * + * # create solver + */ + __pyx_v_self->capsule = long_acados_create_capsule(); + + /* "acados_template/acados_ocp_solver_pyx.pyx":81 + * + * # create solver + * assert acados_solver.acados_create(self.capsule) == 0 # <<<<<<<<<<<<<< + * self.solver_created = True + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((long_acados_create(__pyx_v_self->capsule) == 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 81, __pyx_L1_error) + } + } + #endif + + /* "acados_template/acados_ocp_solver_pyx.pyx":82 + * # create solver + * assert acados_solver.acados_create(self.capsule) == 0 + * self.solver_created = True # <<<<<<<<<<<<<< + * + * # get pointers solver + */ + __pyx_v_self->solver_created = 1; + + /* "acados_template/acados_ocp_solver_pyx.pyx":85 + * + * # get pointers solver + * self.nlp_opts = acados_solver.acados_get_nlp_opts(self.capsule) # <<<<<<<<<<<<<< + * self.nlp_dims = acados_solver.acados_get_nlp_dims(self.capsule) + * self.nlp_config = acados_solver.acados_get_nlp_config(self.capsule) + */ + __pyx_v_self->nlp_opts = long_acados_get_nlp_opts(__pyx_v_self->capsule); + + /* "acados_template/acados_ocp_solver_pyx.pyx":86 + * # get pointers solver + * self.nlp_opts = acados_solver.acados_get_nlp_opts(self.capsule) + * self.nlp_dims = acados_solver.acados_get_nlp_dims(self.capsule) # <<<<<<<<<<<<<< + * self.nlp_config = acados_solver.acados_get_nlp_config(self.capsule) + * self.nlp_out = acados_solver.acados_get_nlp_out(self.capsule) + */ + __pyx_v_self->nlp_dims = long_acados_get_nlp_dims(__pyx_v_self->capsule); + + /* "acados_template/acados_ocp_solver_pyx.pyx":87 + * self.nlp_opts = acados_solver.acados_get_nlp_opts(self.capsule) + * self.nlp_dims = acados_solver.acados_get_nlp_dims(self.capsule) + * self.nlp_config = acados_solver.acados_get_nlp_config(self.capsule) # <<<<<<<<<<<<<< + * self.nlp_out = acados_solver.acados_get_nlp_out(self.capsule) + * self.nlp_in = acados_solver.acados_get_nlp_in(self.capsule) + */ + __pyx_v_self->nlp_config = long_acados_get_nlp_config(__pyx_v_self->capsule); + + /* "acados_template/acados_ocp_solver_pyx.pyx":88 + * self.nlp_dims = acados_solver.acados_get_nlp_dims(self.capsule) + * self.nlp_config = acados_solver.acados_get_nlp_config(self.capsule) + * self.nlp_out = acados_solver.acados_get_nlp_out(self.capsule) # <<<<<<<<<<<<<< + * self.nlp_in = acados_solver.acados_get_nlp_in(self.capsule) + * self.nlp_solver = acados_solver.acados_get_nlp_solver(self.capsule) + */ + __pyx_v_self->nlp_out = long_acados_get_nlp_out(__pyx_v_self->capsule); + + /* "acados_template/acados_ocp_solver_pyx.pyx":89 + * self.nlp_config = acados_solver.acados_get_nlp_config(self.capsule) + * self.nlp_out = acados_solver.acados_get_nlp_out(self.capsule) + * self.nlp_in = acados_solver.acados_get_nlp_in(self.capsule) # <<<<<<<<<<<<<< + * self.nlp_solver = acados_solver.acados_get_nlp_solver(self.capsule) + * + */ + __pyx_v_self->nlp_in = long_acados_get_nlp_in(__pyx_v_self->capsule); + + /* "acados_template/acados_ocp_solver_pyx.pyx":90 + * self.nlp_out = acados_solver.acados_get_nlp_out(self.capsule) + * self.nlp_in = acados_solver.acados_get_nlp_in(self.capsule) + * self.nlp_solver = acados_solver.acados_get_nlp_solver(self.capsule) # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_self->nlp_solver = long_acados_get_nlp_solver(__pyx_v_self->capsule); + + /* "acados_template/acados_ocp_solver_pyx.pyx":71 + * cdef bint solver_created + * + * def __cinit__(self, str model_name, int N, str code_export_dir): # <<<<<<<<<<<<<< + * self.model_name = model_name + * self.N = N + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":93 + * + * + * def solve(self): # <<<<<<<<<<<<<< + * """ + * Solve the ocp with current input. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_3solve(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_2solve[] = "\n Solve the ocp with current input.\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_3solve(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("solve (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_2solve(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_2solve(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("solve", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":97 + * Solve the ocp with current input. + * """ + * return acados_solver.acados_solve(self.capsule) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(long_acados_solve(__pyx_v_self->capsule)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":93 + * + * + * def solve(self): # <<<<<<<<<<<<<< + * """ + * Solve the ocp with current input. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":100 + * + * + * def set_new_time_steps(self, new_time_steps): # <<<<<<<<<<<<<< + * """ + * Set new time steps before solving. Only reload library without code generation but with new time steps. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_5set_new_time_steps(PyObject *__pyx_v_self, PyObject *__pyx_v_new_time_steps); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_4set_new_time_steps[] = "\n Set new time steps before solving. Only reload library without code generation but with new time steps.\n\n :param new_time_steps: vector of new time steps for the solver\n\n .. note:: This allows for different use-cases: either set a new size of time-steps or a new distribution of\n the shooting nodes without changing the number, e.g., to reach a different final time. Both cases\n do not require a new code export and compilation.\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_5set_new_time_steps(PyObject *__pyx_v_self, PyObject *__pyx_v_new_time_steps) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_new_time_steps (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_4set_new_time_steps(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), ((PyObject *)__pyx_v_new_time_steps)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_4set_new_time_steps(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_new_time_steps) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_new_time_steps", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":110 + * do not require a new code export and compilation. + * """ + * raise NotImplementedError() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 110, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":100 + * + * + * def set_new_time_steps(self, new_time_steps): # <<<<<<<<<<<<<< + * """ + * Set new time steps before solving. Only reload library without code generation but with new time steps. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.set_new_time_steps", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":113 + * + * + * def get(self, int stage, str field_): # <<<<<<<<<<<<<< + * """ + * Get the last solution of the solver: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_7get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_6get[] = "\n Get the last solution of the solver:\n\n :param stage: integer corresponding to shooting node\n :param field: string in ['x', 'u', 'z', 'pi', 'lam', 't', 'sl', 'su',]\n\n .. note:: regarding lam, t: \n\n the inequalities are internally organized in the following order: \n\n [ lbu lbx lg lh lphi ubu ubx ug uh uphi; \n\n lsbu lsbx lsg lsh lsphi usbu usbx usg ush usphi]\n\n .. note:: pi: multipliers for dynamics equality constraints \n\n lam: multipliers for inequalities \n\n t: slack variables corresponding to evaluation of all inequalities (at the solution) \n\n sl: slack variables of soft lower inequality constraints \n\n su: slack variables of soft upper inequality constraints \n\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_7get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_stage; + PyObject *__pyx_v_field_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stage,&__pyx_n_s_field,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stage)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get", 1, 2, 2, 1); __PYX_ERR(0, 113, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 113, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_stage = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_stage == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L3_error) + __pyx_v_field_ = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 113, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_), (&PyUnicode_Type), 1, "field_", 1))) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_6get(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_stage, __pyx_v_field_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_6get(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_) { + PyObject *__pyx_v_out_fields = NULL; + PyObject *__pyx_v_field = NULL; + int __pyx_v_dims; + PyArrayObject *__pyx_v_out = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + char const *__pyx_t_10; + PyArrayObject *__pyx_t_11 = NULL; + char const *__pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + + /* "acados_template/acados_ocp_solver_pyx.pyx":132 + * """ + * + * out_fields = ['x', 'u', 'z', 'pi', 'lam', 't', 'sl', 'su'] # <<<<<<<<<<<<<< + * field = field_.encode('utf-8') + * + */ + __pyx_t_1 = PyList_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_x); + __Pyx_GIVEREF(__pyx_n_u_x); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_x); + __Pyx_INCREF(__pyx_n_u_u); + __Pyx_GIVEREF(__pyx_n_u_u); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_u); + __Pyx_INCREF(__pyx_n_u_z); + __Pyx_GIVEREF(__pyx_n_u_z); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_z); + __Pyx_INCREF(__pyx_n_u_pi); + __Pyx_GIVEREF(__pyx_n_u_pi); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_pi); + __Pyx_INCREF(__pyx_n_u_lam); + __Pyx_GIVEREF(__pyx_n_u_lam); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_u_lam); + __Pyx_INCREF(__pyx_n_u_t); + __Pyx_GIVEREF(__pyx_n_u_t); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_u_t); + __Pyx_INCREF(__pyx_n_u_sl); + __Pyx_GIVEREF(__pyx_n_u_sl); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_u_sl); + __Pyx_INCREF(__pyx_n_u_su); + __Pyx_GIVEREF(__pyx_n_u_su); + PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_u_su); + __pyx_v_out_fields = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":133 + * + * out_fields = ['x', 'u', 'z', 'pi', 'lam', 't', 'sl', 'su'] + * field = field_.encode('utf-8') # <<<<<<<<<<<<<< + * + * if field_ not in out_fields: + */ + if (unlikely(__pyx_v_field_ == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 133, __pyx_L1_error) + } + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_field_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_field = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":135 + * field = field_.encode('utf-8') + * + * if field_ not in out_fields: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.get(): {} is an invalid argument.\ + * \n Possible values are {}. Exiting.'.format(field_, out_fields)) + */ + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_v_out_fields, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (unlikely(__pyx_t_3)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":137 + * if field_ not in out_fields: + * raise Exception('AcadosOcpSolver.get(): {} is an invalid argument.\ + * \n Possible values are {}. Exiting.'.format(field_, out_fields)) # <<<<<<<<<<<<<< + * + * if stage < 0 or stage > self.N: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_AcadosOcpSolver_get_is_an_invali, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, __pyx_v_out_fields}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, __pyx_v_out_fields}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_field_); + __Pyx_INCREF(__pyx_v_out_fields); + __Pyx_GIVEREF(__pyx_v_out_fields); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_out_fields); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":136 + * + * if field_ not in out_fields: + * raise Exception('AcadosOcpSolver.get(): {} is an invalid argument.\ # <<<<<<<<<<<<<< + * \n Possible values are {}. Exiting.'.format(field_, out_fields)) + * + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 136, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":135 + * field = field_.encode('utf-8') + * + * if field_ not in out_fields: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.get(): {} is an invalid argument.\ + * \n Possible values are {}. Exiting.'.format(field_, out_fields)) + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":139 + * \n Possible values are {}. Exiting.'.format(field_, out_fields)) + * + * if stage < 0 or stage > self.N: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.get(): stage index must be in [0, N], got: {}.'.format(self.N)) + * + */ + __pyx_t_2 = ((__pyx_v_stage < 0) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_stage > __pyx_v_self->N) != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L5_bool_binop_done:; + if (unlikely(__pyx_t_3)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":140 + * + * if stage < 0 or stage > self.N: + * raise Exception('AcadosOcpSolver.get(): stage index must be in [0, N], got: {}.'.format(self.N)) # <<<<<<<<<<<<<< + * + * if stage == self.N and field_ == 'pi': + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_AcadosOcpSolver_get_stage_index, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 140, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":139 + * \n Possible values are {}. Exiting.'.format(field_, out_fields)) + * + * if stage < 0 or stage > self.N: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.get(): stage index must be in [0, N], got: {}.'.format(self.N)) + * + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":142 + * raise Exception('AcadosOcpSolver.get(): stage index must be in [0, N], got: {}.'.format(self.N)) + * + * if stage == self.N and field_ == 'pi': # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.get(): field {} does not exist at final stage {}.'\ + * .format(field_, stage)) + */ + __pyx_t_2 = ((__pyx_v_stage == __pyx_v_self->N) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_field_, __pyx_n_u_pi, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_2 != 0); + __pyx_t_3 = __pyx_t_8; + __pyx_L8_bool_binop_done:; + if (unlikely(__pyx_t_3)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":144 + * if stage == self.N and field_ == 'pi': + * raise Exception('AcadosOcpSolver.get(): field {} does not exist at final stage {}.'\ + * .format(field_, stage)) # <<<<<<<<<<<<<< + * + * cdef int dims = acados_solver_common.ocp_nlp_dims_get_from_attr(self.nlp_config, + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_AcadosOcpSolver_get_field_does_n, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_stage); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_6, __pyx_v_field_); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_6, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":143 + * + * if stage == self.N and field_ == 'pi': + * raise Exception('AcadosOcpSolver.get(): field {} does not exist at final stage {}.'\ # <<<<<<<<<<<<<< + * .format(field_, stage)) + * + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 143, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":142 + * raise Exception('AcadosOcpSolver.get(): stage index must be in [0, N], got: {}.'.format(self.N)) + * + * if stage == self.N and field_ == 'pi': # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.get(): field {} does not exist at final stage {}.'\ + * .format(field_, stage)) + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":147 + * + * cdef int dims = acados_solver_common.ocp_nlp_dims_get_from_attr(self.nlp_config, + * self.nlp_dims, self.nlp_out, stage, field) # <<<<<<<<<<<<<< + * + * cdef cnp.ndarray[cnp.float64_t, ndim=1] out = np.zeros((dims,)) + */ + __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":146 + * .format(field_, stage)) + * + * cdef int dims = acados_solver_common.ocp_nlp_dims_get_from_attr(self.nlp_config, # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_out, stage, field) + * + */ + __pyx_v_dims = ocp_nlp_dims_get_from_attr(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_out, __pyx_v_stage, __pyx_t_10); + + /* "acados_template/acados_ocp_solver_pyx.pyx":149 + * self.nlp_dims, self.nlp_out, stage, field) + * + * cdef cnp.ndarray[cnp.float64_t, ndim=1] out = np.zeros((dims,)) # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_out_get(self.nlp_config, \ + * self.nlp_dims, self.nlp_out, stage, field, out.data) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_11 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_out.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 149, __pyx_L1_error) + } else {__pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_11 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":151 + * cdef cnp.ndarray[cnp.float64_t, ndim=1] out = np.zeros((dims,)) + * acados_solver_common.ocp_nlp_out_get(self.nlp_config, \ + * self.nlp_dims, self.nlp_out, stage, field, out.data) # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":150 + * + * cdef cnp.ndarray[cnp.float64_t, ndim=1] out = np.zeros((dims,)) + * acados_solver_common.ocp_nlp_out_get(self.nlp_config, \ # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_out, stage, field, out.data) + * + */ + ocp_nlp_out_get(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_out, __pyx_v_stage, __pyx_t_12, ((void *)__pyx_v_out->data)); + + /* "acados_template/acados_ocp_solver_pyx.pyx":153 + * self.nlp_dims, self.nlp_out, stage, field, out.data) + * + * return out # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":113 + * + * + * def get(self, int stage, str field_): # <<<<<<<<<<<<<< + * """ + * Get the last solution of the solver: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_out_fields); + __Pyx_XDECREF(__pyx_v_field); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":156 + * + * + * def print_statistics(self): # <<<<<<<<<<<<<< + * """ + * prints statistics of previous solver run as a table: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_9print_statistics(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_8print_statistics[] = "\n prints statistics of previous solver run as a table:\n - iter: iteration number\n - res_stat: stationarity residual\n - res_eq: residual wrt equality constraints (dynamics)\n - res_ineq: residual wrt inequality constraints (constraints)\n - res_comp: residual wrt complementarity conditions\n - qp_stat: status of QP solver\n - qp_iter: number of QP iterations\n - qp_res_stat: stationarity residual of the last QP solution\n - qp_res_eq: residual wrt equality constraints (dynamics) of the last QP solution\n - qp_res_ineq: residual wrt inequality constraints (constraints) of the last QP solution\n - qp_res_comp: residual wrt complementarity conditions of the last QP solution\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_9print_statistics(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("print_statistics (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_8print_statistics(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_8print_statistics(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("print_statistics", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":171 + * - qp_res_comp: residual wrt complementarity conditions of the last QP solution + * """ + * raise NotImplementedError() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 171, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":156 + * + * + * def print_statistics(self): # <<<<<<<<<<<<<< + * """ + * prints statistics of previous solver run as a table: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.print_statistics", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":174 + * + * + * def store_iterate(self, filename='', overwrite=False): # <<<<<<<<<<<<<< + * """ + * Stores the current iterate of the ocp solver in a json file. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_11store_iterate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_10store_iterate[] = "\n Stores the current iterate of the ocp solver in a json file.\n\n :param filename: if not set, use model_name + timestamp + '.json'\n :param overwrite: if false and filename exists add timestamp to filename\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_11store_iterate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_filename = 0; + CYTHON_UNUSED PyObject *__pyx_v_overwrite = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("store_iterate (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_overwrite,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)__pyx_kp_u_); + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overwrite); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "store_iterate") < 0)) __PYX_ERR(0, 174, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_filename = values[0]; + __pyx_v_overwrite = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("store_iterate", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 174, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.store_iterate", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_10store_iterate(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_filename, __pyx_v_overwrite); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_10store_iterate(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_filename, CYTHON_UNUSED PyObject *__pyx_v_overwrite) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("store_iterate", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":181 + * :param overwrite: if false and filename exists add timestamp to filename + * """ + * raise NotImplementedError() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 181, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":174 + * + * + * def store_iterate(self, filename='', overwrite=False): # <<<<<<<<<<<<<< + * """ + * Stores the current iterate of the ocp solver in a json file. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.store_iterate", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":184 + * + * + * def load_iterate(self, filename): # <<<<<<<<<<<<<< + * """ + * Loads the iterate stored in json file with filename into the ocp solver. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_13load_iterate(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_12load_iterate[] = "\n Loads the iterate stored in json file with filename into the ocp solver.\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_13load_iterate(PyObject *__pyx_v_self, PyObject *__pyx_v_filename) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("load_iterate (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_12load_iterate(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), ((PyObject *)__pyx_v_filename)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_12load_iterate(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_filename) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("load_iterate", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":188 + * Loads the iterate stored in json file with filename into the ocp solver. + * """ + * raise NotImplementedError() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 188, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":184 + * + * + * def load_iterate(self, filename): # <<<<<<<<<<<<<< + * """ + * Loads the iterate stored in json file with filename into the ocp solver. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.load_iterate", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":191 + * + * + * def get_stats(self, field_): # <<<<<<<<<<<<<< + * """ + * Get the information of the last solver call. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_15get_stats(PyObject *__pyx_v_self, PyObject *__pyx_v_field_); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_14get_stats[] = "\n Get the information of the last solver call.\n\n :param field: string in ['statistics', 'time_tot', 'time_lin', 'time_sim', 'time_sim_ad', 'time_sim_la', 'time_qp', 'time_qp_solver_call', 'time_reg', 'sqp_iter']\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_15get_stats(PyObject *__pyx_v_self, PyObject *__pyx_v_field_) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_stats (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_14get_stats(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), ((PyObject *)__pyx_v_field_)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_14get_stats(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_field_) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_stats", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":197 + * :param field: string in ['statistics', 'time_tot', 'time_lin', 'time_sim', 'time_sim_ad', 'time_sim_la', 'time_qp', 'time_qp_solver_call', 'time_reg', 'sqp_iter'] + * """ + * raise NotImplementedError() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 197, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":191 + * + * + * def get_stats(self, field_): # <<<<<<<<<<<<<< + * """ + * Get the information of the last solver call. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.get_stats", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":200 + * + * + * def get_cost(self): # <<<<<<<<<<<<<< + * """ + * Returns the cost value of the current solution. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_17get_cost(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_16get_cost[] = "\n Returns the cost value of the current solution.\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_17get_cost(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_cost (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_16get_cost(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_16get_cost(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self) { + double __pyx_v_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_cost", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":205 + * """ + * # compute cost internally + * acados_solver_common.ocp_nlp_eval_cost(self.nlp_solver, self.nlp_in, self.nlp_out) # <<<<<<<<<<<<<< + * + * # create output + */ + ocp_nlp_eval_cost(__pyx_v_self->nlp_solver, __pyx_v_self->nlp_in, __pyx_v_self->nlp_out); + + /* "acados_template/acados_ocp_solver_pyx.pyx":211 + * + * # call getter + * acados_solver_common.ocp_nlp_get(self.nlp_config, self.nlp_solver, "cost_value", &out) # <<<<<<<<<<<<<< + * + * return out + */ + ocp_nlp_get(__pyx_v_self->nlp_config, __pyx_v_self->nlp_solver, ((char const *)"cost_value"), ((void *)(&__pyx_v_out))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":213 + * acados_solver_common.ocp_nlp_get(self.nlp_config, self.nlp_solver, "cost_value", &out) + * + * return out # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":200 + * + * + * def get_cost(self): # <<<<<<<<<<<<<< + * """ + * Returns the cost value of the current solution. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.get_cost", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":216 + * + * + * def get_residuals(self): # <<<<<<<<<<<<<< + * """ + * Returns an array of the form [res_stat, res_eq, res_ineq, res_comp]. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_19get_residuals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_18get_residuals[] = "\n Returns an array of the form [res_stat, res_eq, res_ineq, res_comp].\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_19get_residuals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_residuals (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_18get_residuals(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_18get_residuals(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_residuals", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":220 + * Returns an array of the form [res_stat, res_eq, res_ineq, res_comp]. + * """ + * raise NotImplementedError() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 220, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":216 + * + * + * def get_residuals(self): # <<<<<<<<<<<<<< + * """ + * Returns an array of the form [res_stat, res_eq, res_ineq, res_comp]. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.get_residuals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":224 + * + * # Note: this function should not be used anymore, better use cost_set, constraints_set + * def set(self, int stage, str field_, value_): # <<<<<<<<<<<<<< + * + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_21set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_20set[] = "\n Set numerical data inside the solver.\n\n :param stage: integer corresponding to shooting node\n :param field: string in ['x', 'u', 'pi', 'lam', 't', 'p']\n\n .. note:: regarding lam, t: \n\n the inequalities are internally organized in the following order: \n\n [ lbu lbx lg lh lphi ubu ubx ug uh uphi; \n\n lsbu lsbx lsg lsh lsphi usbu usbx usg ush usphi]\n\n .. note:: pi: multipliers for dynamics equality constraints \n\n lam: multipliers for inequalities \n\n t: slack variables corresponding to evaluation of all inequalities (at the solution) \n\n sl: slack variables of soft lower inequality constraints \n\n su: slack variables of soft upper inequality constraints \n\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_21set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_stage; + PyObject *__pyx_v_field_ = 0; + PyObject *__pyx_v_value_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stage,&__pyx_n_s_field,&__pyx_n_s_value,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stage)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set", 1, 3, 3, 1); __PYX_ERR(0, 224, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set", 1, 3, 3, 2); __PYX_ERR(0, 224, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 224, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_stage = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_stage == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L3_error) + __pyx_v_field_ = ((PyObject*)values[1]); + __pyx_v_value_ = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 224, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_), (&PyUnicode_Type), 1, "field_", 1))) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_20set(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_stage, __pyx_v_field_, __pyx_v_value_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_20set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_) { + PyObject *__pyx_v_cost_fields = NULL; + PyObject *__pyx_v_constraints_fields = NULL; + PyObject *__pyx_v_out_fields = NULL; + PyObject *__pyx_v_field = NULL; + __Pyx_memviewslice __pyx_v_value = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_dims = NULL; + PyObject *__pyx_v_msg = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + char const *__pyx_t_11; + char const *__pyx_t_12; + char const *__pyx_t_13; + char const *__pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":243 + * su: slack variables of soft upper inequality constraints \n + * """ + * cost_fields = ['y_ref', 'yref'] # <<<<<<<<<<<<<< + * constraints_fields = ['lbx', 'ubx', 'lbu', 'ubu'] + * out_fields = ['x', 'u', 'pi', 'lam', 't', 'z', 'sl', 'su'] + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_y_ref); + __Pyx_GIVEREF(__pyx_n_u_y_ref); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_y_ref); + __Pyx_INCREF(__pyx_n_u_yref); + __Pyx_GIVEREF(__pyx_n_u_yref); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_yref); + __pyx_v_cost_fields = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":244 + * """ + * cost_fields = ['y_ref', 'yref'] + * constraints_fields = ['lbx', 'ubx', 'lbu', 'ubu'] # <<<<<<<<<<<<<< + * out_fields = ['x', 'u', 'pi', 'lam', 't', 'z', 'sl', 'su'] + * + */ + __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_lbx); + __Pyx_GIVEREF(__pyx_n_u_lbx); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_lbx); + __Pyx_INCREF(__pyx_n_u_ubx); + __Pyx_GIVEREF(__pyx_n_u_ubx); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_ubx); + __Pyx_INCREF(__pyx_n_u_lbu); + __Pyx_GIVEREF(__pyx_n_u_lbu); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_lbu); + __Pyx_INCREF(__pyx_n_u_ubu); + __Pyx_GIVEREF(__pyx_n_u_ubu); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_ubu); + __pyx_v_constraints_fields = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":245 + * cost_fields = ['y_ref', 'yref'] + * constraints_fields = ['lbx', 'ubx', 'lbu', 'ubu'] + * out_fields = ['x', 'u', 'pi', 'lam', 't', 'z', 'sl', 'su'] # <<<<<<<<<<<<<< + * + * field = field_.encode('utf-8') + */ + __pyx_t_1 = PyList_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_x); + __Pyx_GIVEREF(__pyx_n_u_x); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_x); + __Pyx_INCREF(__pyx_n_u_u); + __Pyx_GIVEREF(__pyx_n_u_u); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_u); + __Pyx_INCREF(__pyx_n_u_pi); + __Pyx_GIVEREF(__pyx_n_u_pi); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_pi); + __Pyx_INCREF(__pyx_n_u_lam); + __Pyx_GIVEREF(__pyx_n_u_lam); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_lam); + __Pyx_INCREF(__pyx_n_u_t); + __Pyx_GIVEREF(__pyx_n_u_t); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_u_t); + __Pyx_INCREF(__pyx_n_u_z); + __Pyx_GIVEREF(__pyx_n_u_z); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_u_z); + __Pyx_INCREF(__pyx_n_u_sl); + __Pyx_GIVEREF(__pyx_n_u_sl); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_u_sl); + __Pyx_INCREF(__pyx_n_u_su); + __Pyx_GIVEREF(__pyx_n_u_su); + PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_u_su); + __pyx_v_out_fields = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":247 + * out_fields = ['x', 'u', 'pi', 'lam', 't', 'z', 'sl', 'su'] + * + * field = field_.encode('utf-8') # <<<<<<<<<<<<<< + * + * cdef double[::1] value + */ + if (unlikely(__pyx_v_field_ == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 247, __pyx_L1_error) + } + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_field_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_field = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":252 + * + * # treat parameters separately + * if field_ == 'p': # <<<<<<<<<<<<<< + * value = np.ascontiguousarray(value_, dtype=np.double) + * assert acados_solver.acados_update_params(self.capsule, stage, &value[0], value.shape[0]) == 0 + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_field_, __pyx_n_u_p, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":253 + * # treat parameters separately + * if field_ == 'p': + * value = np.ascontiguousarray(value_, dtype=np.double) # <<<<<<<<<<<<<< + * assert acados_solver.acados_update_params(self.capsule, stage, &value[0], value.shape[0]) == 0 + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_value_); + __Pyx_GIVEREF(__pyx_v_value_); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value_); + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_value = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "acados_template/acados_ocp_solver_pyx.pyx":254 + * if field_ == 'p': + * value = np.ascontiguousarray(value_, dtype=np.double) + * assert acados_solver.acados_update_params(self.capsule, stage, &value[0], value.shape[0]) == 0 # <<<<<<<<<<<<<< + * else: + * if field_ not in constraints_fields + cost_fields + out_fields: + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_9 = 0; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_v_value.shape[0]; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_v_value.shape[0])) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + __PYX_ERR(0, 254, __pyx_L1_error) + } + if (unlikely(!((long_acados_update_params(__pyx_v_self->capsule, __pyx_v_stage, ((double *)(&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_value.data) + __pyx_t_9)) ))))), (__pyx_v_value.shape[0])) == 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 254, __pyx_L1_error) + } + } + #endif + + /* "acados_template/acados_ocp_solver_pyx.pyx":252 + * + * # treat parameters separately + * if field_ == 'p': # <<<<<<<<<<<<<< + * value = np.ascontiguousarray(value_, dtype=np.double) + * assert acados_solver.acados_update_params(self.capsule, stage, &value[0], value.shape[0]) == 0 + */ + goto __pyx_L3; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":256 + * assert acados_solver.acados_update_params(self.capsule, stage, &value[0], value.shape[0]) == 0 + * else: + * if field_ not in constraints_fields + cost_fields + out_fields: # <<<<<<<<<<<<<< + * raise Exception("AcadosOcpSolver.set(): {} is not a valid argument.\ + * \nPossible values are {}. Exiting.".format(field, \ + */ + /*else*/ { + __pyx_t_7 = PyNumber_Add(__pyx_v_constraints_fields, __pyx_v_cost_fields); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyNumber_Add(__pyx_t_7, __pyx_v_out_fields); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_t_5, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (unlikely(__pyx_t_2)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":258 + * if field_ not in constraints_fields + cost_fields + out_fields: + * raise Exception("AcadosOcpSolver.set(): {} is not a valid argument.\ + * \nPossible values are {}. Exiting.".format(field, \ # <<<<<<<<<<<<<< + * constraints_fields + cost_fields + out_fields + ['p'])) + * + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_AcadosOcpSolver_set_is_not_a_val, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "acados_template/acados_ocp_solver_pyx.pyx":259 + * raise Exception("AcadosOcpSolver.set(): {} is not a valid argument.\ + * \nPossible values are {}. Exiting.".format(field, \ + * constraints_fields + cost_fields + out_fields + ['p'])) # <<<<<<<<<<<<<< + * + * dims = acados_solver_common.ocp_nlp_dims_get_from_attr(self.nlp_config, + */ + __pyx_t_1 = PyNumber_Add(__pyx_v_constraints_fields, __pyx_v_cost_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_v_out_fields); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_p); + __Pyx_GIVEREF(__pyx_n_u_p); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_p); + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_10 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_field, __pyx_t_6}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_field, __pyx_t_6}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_1) { + __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL; + } + __Pyx_INCREF(__pyx_v_field); + __Pyx_GIVEREF(__pyx_v_field); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_10, __pyx_v_field); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_10, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":257 + * else: + * if field_ not in constraints_fields + cost_fields + out_fields: + * raise Exception("AcadosOcpSolver.set(): {} is not a valid argument.\ # <<<<<<<<<<<<<< + * \nPossible values are {}. Exiting.".format(field, \ + * constraints_fields + cost_fields + out_fields + ['p'])) + */ + __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 257, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":256 + * assert acados_solver.acados_update_params(self.capsule, stage, &value[0], value.shape[0]) == 0 + * else: + * if field_ not in constraints_fields + cost_fields + out_fields: # <<<<<<<<<<<<<< + * raise Exception("AcadosOcpSolver.set(): {} is not a valid argument.\ + * \nPossible values are {}. Exiting.".format(field, \ + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":262 + * + * dims = acados_solver_common.ocp_nlp_dims_get_from_attr(self.nlp_config, + * self.nlp_dims, self.nlp_out, stage, field) # <<<<<<<<<<<<<< + * + * if value_.shape[0] != dims: + */ + __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":261 + * constraints_fields + cost_fields + out_fields + ['p'])) + * + * dims = acados_solver_common.ocp_nlp_dims_get_from_attr(self.nlp_config, # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_out, stage, field) + * + */ + __pyx_t_7 = __Pyx_PyInt_From_int(ocp_nlp_dims_get_from_attr(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_out, __pyx_v_stage, __pyx_t_11)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_v_dims = __pyx_t_7; + __pyx_t_7 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":264 + * self.nlp_dims, self.nlp_out, stage, field) + * + * if value_.shape[0] != dims: # <<<<<<<<<<<<<< + * msg = 'AcadosOcpSolver.set(): mismatching dimension for field "{}" '.format(field_) + * msg += 'with dimension {} (you have {})'.format(dims, value_.shape[0]) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_v_dims, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__pyx_t_2)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":265 + * + * if value_.shape[0] != dims: + * msg = 'AcadosOcpSolver.set(): mismatching dimension for field "{}" '.format(field_) # <<<<<<<<<<<<<< + * msg += 'with dimension {} (you have {})'.format(dims, value_.shape[0]) + * raise Exception(msg) + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_AcadosOcpSolver_set_mismatching, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_field_) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_field_); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_msg = __pyx_t_7; + __pyx_t_7 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":266 + * if value_.shape[0] != dims: + * msg = 'AcadosOcpSolver.set(): mismatching dimension for field "{}" '.format(field_) + * msg += 'with dimension {} (you have {})'.format(dims, value_.shape[0]) # <<<<<<<<<<<<<< + * raise Exception(msg) + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_with_dimension_you_have, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_10 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_dims, __pyx_t_6}; + __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_dims, __pyx_t_6}; + __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_1 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_dims); + __Pyx_GIVEREF(__pyx_v_dims); + PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_10, __pyx_v_dims); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_10, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_5); + __pyx_t_5 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":267 + * msg = 'AcadosOcpSolver.set(): mismatching dimension for field "{}" '.format(field_) + * msg += 'with dimension {} (you have {})'.format(dims, value_.shape[0]) + * raise Exception(msg) # <<<<<<<<<<<<<< + * + * value = np.ascontiguousarray(value_, dtype=np.double) + */ + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_v_msg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 267, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":264 + * self.nlp_dims, self.nlp_out, stage, field) + * + * if value_.shape[0] != dims: # <<<<<<<<<<<<<< + * msg = 'AcadosOcpSolver.set(): mismatching dimension for field "{}" '.format(field_) + * msg += 'with dimension {} (you have {})'.format(dims, value_.shape[0]) + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":269 + * raise Exception(msg) + * + * value = np.ascontiguousarray(value_, dtype=np.double) # <<<<<<<<<<<<<< + * if field_ in constraints_fields: + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_value_); + __Pyx_GIVEREF(__pyx_v_value_); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_value_); + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_value = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "acados_template/acados_ocp_solver_pyx.pyx":270 + * + * value = np.ascontiguousarray(value_, dtype=np.double) + * if field_ in constraints_fields: # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + */ + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_v_constraints_fields, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":272 + * if field_ in constraints_fields: + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) # <<<<<<<<<<<<<< + * elif field_ in cost_fields: + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, + */ + __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_9 = 0; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_v_value.shape[0]; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_v_value.shape[0])) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + __PYX_ERR(0, 272, __pyx_L1_error) + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":271 + * value = np.ascontiguousarray(value_, dtype=np.double) + * if field_ in constraints_fields: + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in cost_fields: + */ + (void)(ocp_nlp_constraints_model_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_in, __pyx_v_stage, __pyx_t_12, ((void *)(&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_value.data) + __pyx_t_9)) ))))))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":270 + * + * value = np.ascontiguousarray(value_, dtype=np.double) + * if field_ in constraints_fields: # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + */ + goto __pyx_L6; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":273 + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in cost_fields: # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + */ + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_v_cost_fields, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":275 + * elif field_ in cost_fields: + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) # <<<<<<<<<<<<<< + * elif field_ in out_fields: + * acados_solver_common.ocp_nlp_out_set(self.nlp_config, + */ + __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_9 = 0; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_v_value.shape[0]; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_v_value.shape[0])) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + __PYX_ERR(0, 275, __pyx_L1_error) + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":274 + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in cost_fields: + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in out_fields: + */ + (void)(ocp_nlp_cost_model_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_in, __pyx_v_stage, __pyx_t_13, ((void *)(&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_value.data) + __pyx_t_9)) ))))))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":273 + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in cost_fields: # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + */ + goto __pyx_L6; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":276 + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in out_fields: # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_out_set(self.nlp_config, + * self.nlp_dims, self.nlp_out, stage, field, &value[0]) + */ + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_v_out_fields, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":278 + * elif field_ in out_fields: + * acados_solver_common.ocp_nlp_out_set(self.nlp_config, + * self.nlp_dims, self.nlp_out, stage, field, &value[0]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_14 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_9 = 0; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_v_value.shape[0]; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_v_value.shape[0])) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + __PYX_ERR(0, 278, __pyx_L1_error) + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":277 + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in out_fields: + * acados_solver_common.ocp_nlp_out_set(self.nlp_config, # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_out, stage, field, &value[0]) + * + */ + ocp_nlp_out_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_out, __pyx_v_stage, __pyx_t_14, ((void *)(&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_value.data) + __pyx_t_9)) )))))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":276 + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, + * self.nlp_dims, self.nlp_in, stage, field, &value[0]) + * elif field_ in out_fields: # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_out_set(self.nlp_config, + * self.nlp_dims, self.nlp_out, stage, field, &value[0]) + */ + } + __pyx_L6:; + } + __pyx_L3:; + + /* "acados_template/acados_ocp_solver_pyx.pyx":224 + * + * # Note: this function should not be used anymore, better use cost_set, constraints_set + * def set(self, int stage, str field_, value_): # <<<<<<<<<<<<<< + * + * """ + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cost_fields); + __Pyx_XDECREF(__pyx_v_constraints_fields); + __Pyx_XDECREF(__pyx_v_out_fields); + __Pyx_XDECREF(__pyx_v_field); + __PYX_XDEC_MEMVIEW(&__pyx_v_value, 1); + __Pyx_XDECREF(__pyx_v_dims); + __Pyx_XDECREF(__pyx_v_msg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":281 + * + * + * def cost_set(self, int stage, str field_, value_): # <<<<<<<<<<<<<< + * """ + * Set numerical data in the cost module of the solver. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_23cost_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_22cost_set[] = "\n Set numerical data in the cost module of the solver.\n\n :param stage: integer corresponding to shooting node\n :param field: string, e.g. 'yref', 'W', 'ext_cost_num_hess'\n :param value: of appropriate size\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_23cost_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_stage; + PyObject *__pyx_v_field_ = 0; + PyObject *__pyx_v_value_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cost_set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stage,&__pyx_n_s_field,&__pyx_n_s_value,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stage)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cost_set", 1, 3, 3, 1); __PYX_ERR(0, 281, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cost_set", 1, 3, 3, 2); __PYX_ERR(0, 281, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cost_set") < 0)) __PYX_ERR(0, 281, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_stage = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_stage == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L3_error) + __pyx_v_field_ = ((PyObject*)values[1]); + __pyx_v_value_ = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cost_set", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 281, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.cost_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_), (&PyUnicode_Type), 1, "field_", 1))) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_22cost_set(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_stage, __pyx_v_field_, __pyx_v_value_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_22cost_set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_) { + PyObject *__pyx_v_field = NULL; + int __pyx_v_dims[2]; + __Pyx_memviewslice __pyx_v_value = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_value_shape = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + char const *__pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cost_set", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":289 + * :param value: of appropriate size + * """ + * field = field_.encode('utf-8') # <<<<<<<<<<<<<< + * + * cdef int dims[2] + */ + if (unlikely(__pyx_v_field_ == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 289, __pyx_L1_error) + } + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_field_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_field = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":293 + * cdef int dims[2] + * acados_solver_common.ocp_nlp_cost_dims_get_from_attr(self.nlp_config, \ + * self.nlp_dims, self.nlp_out, stage, field, &dims[0]) # <<<<<<<<<<<<<< + * + * cdef double[::1,:] value + */ + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":292 + * + * cdef int dims[2] + * acados_solver_common.ocp_nlp_cost_dims_get_from_attr(self.nlp_config, \ # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_out, stage, field, &dims[0]) + * + */ + ocp_nlp_cost_dims_get_from_attr(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_out, __pyx_v_stage, __pyx_t_2, (&(__pyx_v_dims[0]))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":297 + * cdef double[::1,:] value + * + * value_shape = value_.shape # <<<<<<<<<<<<<< + * if len(value_shape) == 1: + * value_shape = (value_shape[0], 0) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_value_shape = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":298 + * + * value_shape = value_.shape + * if len(value_shape) == 1: # <<<<<<<<<<<<<< + * value_shape = (value_shape[0], 0) + * value = np.asfortranarray(value_[None,:]) + */ + __pyx_t_3 = PyObject_Length(__pyx_v_value_shape); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 == 1) != 0); + if (__pyx_t_4) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":299 + * value_shape = value_.shape + * if len(value_shape) == 1: + * value_shape = (value_shape[0], 0) # <<<<<<<<<<<<<< + * value = np.asfortranarray(value_[None,:]) + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_value_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0); + __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_value_shape, __pyx_t_5); + __pyx_t_5 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":300 + * if len(value_shape) == 1: + * value_shape = (value_shape[0], 0) + * value = np.asfortranarray(value_[None,:]) # <<<<<<<<<<<<<< + * + * elif len(value_shape) == 2: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_value_, __pyx_tuple__3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_value = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "acados_template/acados_ocp_solver_pyx.pyx":298 + * + * value_shape = value_.shape + * if len(value_shape) == 1: # <<<<<<<<<<<<<< + * value_shape = (value_shape[0], 0) + * value = np.asfortranarray(value_[None,:]) + */ + goto __pyx_L3; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":302 + * value = np.asfortranarray(value_[None,:]) + * + * elif len(value_shape) == 2: # <<<<<<<<<<<<<< + * # Get elements in column major order + * value = np.asfortranarray(value_) + */ + __pyx_t_3 = PyObject_Length(__pyx_v_value_shape); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 == 2) != 0); + if (__pyx_t_4) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":304 + * elif len(value_shape) == 2: + * # Get elements in column major order + * value = np.asfortranarray(value_) # <<<<<<<<<<<<<< + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_value_) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_value_); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_value = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "acados_template/acados_ocp_solver_pyx.pyx":302 + * value = np.asfortranarray(value_[None,:]) + * + * elif len(value_shape) == 2: # <<<<<<<<<<<<<< + * # Get elements in column major order + * value = np.asfortranarray(value_) + */ + } + __pyx_L3:; + + /* "acados_template/acados_ocp_solver_pyx.pyx":306 + * value = np.asfortranarray(value_) + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.cost_set(): mismatching dimension', \ + * ' for field "{}" with dimension {} (you have {})'.format( \ + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_value_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_dims[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_9) { + } else { + __pyx_t_4 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_value_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_dims[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __pyx_t_9; + __pyx_L5_bool_binop_done:; + if (unlikely(__pyx_t_4)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":308 + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: + * raise Exception('AcadosOcpSolver.cost_set(): mismatching dimension', \ + * ' for field "{}" with dimension {} (you have {})'.format( \ # <<<<<<<<<<<<<< + * field_, tuple(dims), value_shape)) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_for_field_with_dimension_you_ha, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "acados_template/acados_ocp_solver_pyx.pyx":309 + * raise Exception('AcadosOcpSolver.cost_set(): mismatching dimension', \ + * ' for field "{}" with dimension {} (you have {})'.format( \ + * field_, tuple(dims), value_shape)) # <<<<<<<<<<<<<< + * + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, \ + */ + __pyx_t_6 = __Pyx_carray_to_py_int(__pyx_v_dims, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_10 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_field_, __pyx_t_7, __pyx_v_value_shape}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_field_, __pyx_t_7, __pyx_v_value_shape}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + { + __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_field_); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_7); + __Pyx_INCREF(__pyx_v_value_shape); + __Pyx_GIVEREF(__pyx_v_value_shape); + PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_v_value_shape); + __pyx_t_7 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":307 + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: + * raise Exception('AcadosOcpSolver.cost_set(): mismatching dimension', \ # <<<<<<<<<<<<<< + * ' for field "{}" with dimension {} (you have {})'.format( \ + * field_, tuple(dims), value_shape)) + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_kp_u_AcadosOcpSolver_cost_set_mismatc); + __Pyx_GIVEREF(__pyx_kp_u_AcadosOcpSolver_cost_set_mismatc); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_AcadosOcpSolver_cost_set_mismatc); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 307, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":306 + * value = np.asfortranarray(value_) + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.cost_set(): mismatching dimension', \ + * ' for field "{}" with dimension {} (you have {})'.format( \ + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":312 + * + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, \ + * self.nlp_dims, self.nlp_in, stage, field, &value[0][0]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) + if (unlikely(!__pyx_v_value.memview)) { __Pyx_RaiseUnboundLocalError("value"); __PYX_ERR(0, 312, __pyx_L1_error) } + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_v_value.shape[0]; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_v_value.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_v_value.shape[1]; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_14 >= __pyx_v_value.shape[1])) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + __PYX_ERR(0, 312, __pyx_L1_error) + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":311 + * field_, tuple(dims), value_shape)) + * + * acados_solver_common.ocp_nlp_cost_model_set(self.nlp_config, \ # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_in, stage, field, &value[0][0]) + * + */ + (void)(ocp_nlp_cost_model_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_in, __pyx_v_stage, __pyx_t_12, ((void *)(&(*((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_value.data) + __pyx_t_13)) ) + __pyx_t_14 * __pyx_v_value.strides[1]) ))))))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":281 + * + * + * def cost_set(self, int stage, str field_, value_): # <<<<<<<<<<<<<< + * """ + * Set numerical data in the cost module of the solver. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.cost_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_field); + __PYX_XDEC_MEMVIEW(&__pyx_v_value, 1); + __Pyx_XDECREF(__pyx_v_value_shape); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":315 + * + * + * def constraints_set(self, int stage, str field_, value_): # <<<<<<<<<<<<<< + * """ + * Set numerical data in the constraint module of the solver. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_25constraints_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_24constraints_set[] = "\n Set numerical data in the constraint module of the solver.\n\n :param stage: integer corresponding to shooting node\n :param field: string in ['lbx', 'ubx', 'lbu', 'ubu', 'lg', 'ug', 'lh', 'uh', 'uphi', 'C', 'D']\n :param value: of appropriate size\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_25constraints_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_stage; + PyObject *__pyx_v_field_ = 0; + PyObject *__pyx_v_value_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("constraints_set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stage,&__pyx_n_s_field,&__pyx_n_s_value,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stage)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("constraints_set", 1, 3, 3, 1); __PYX_ERR(0, 315, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("constraints_set", 1, 3, 3, 2); __PYX_ERR(0, 315, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "constraints_set") < 0)) __PYX_ERR(0, 315, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_stage = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_stage == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L3_error) + __pyx_v_field_ = ((PyObject*)values[1]); + __pyx_v_value_ = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("constraints_set", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 315, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.constraints_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_), (&PyUnicode_Type), 1, "field_", 1))) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_24constraints_set(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_stage, __pyx_v_field_, __pyx_v_value_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_24constraints_set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_) { + PyObject *__pyx_v_field = NULL; + int __pyx_v_dims[2]; + __Pyx_memviewslice __pyx_v_value = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_value_shape = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + char const *__pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("constraints_set", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":323 + * :param value: of appropriate size + * """ + * field = field_.encode('utf-8') # <<<<<<<<<<<<<< + * + * cdef int dims[2] + */ + if (unlikely(__pyx_v_field_ == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 323, __pyx_L1_error) + } + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_field_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_field = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":327 + * cdef int dims[2] + * acados_solver_common.ocp_nlp_constraint_dims_get_from_attr(self.nlp_config, \ + * self.nlp_dims, self.nlp_out, stage, field, &dims[0]) # <<<<<<<<<<<<<< + * + * cdef double[::1,:] value + */ + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 327, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":326 + * + * cdef int dims[2] + * acados_solver_common.ocp_nlp_constraint_dims_get_from_attr(self.nlp_config, \ # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_out, stage, field, &dims[0]) + * + */ + ocp_nlp_constraint_dims_get_from_attr(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_out, __pyx_v_stage, __pyx_t_2, (&(__pyx_v_dims[0]))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":331 + * cdef double[::1,:] value + * + * value_shape = value_.shape # <<<<<<<<<<<<<< + * if len(value_shape) == 1: + * value_shape = (value_shape[0], 0) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_value_shape = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":332 + * + * value_shape = value_.shape + * if len(value_shape) == 1: # <<<<<<<<<<<<<< + * value_shape = (value_shape[0], 0) + * value = np.asfortranarray(value_[None,:]) + */ + __pyx_t_3 = PyObject_Length(__pyx_v_value_shape); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 == 1) != 0); + if (__pyx_t_4) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":333 + * value_shape = value_.shape + * if len(value_shape) == 1: + * value_shape = (value_shape[0], 0) # <<<<<<<<<<<<<< + * value = np.asfortranarray(value_[None,:]) + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_value_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0); + __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_value_shape, __pyx_t_5); + __pyx_t_5 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":334 + * if len(value_shape) == 1: + * value_shape = (value_shape[0], 0) + * value = np.asfortranarray(value_[None,:]) # <<<<<<<<<<<<<< + * + * elif len(value_shape) == 2: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_value_, __pyx_tuple__3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_value = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "acados_template/acados_ocp_solver_pyx.pyx":332 + * + * value_shape = value_.shape + * if len(value_shape) == 1: # <<<<<<<<<<<<<< + * value_shape = (value_shape[0], 0) + * value = np.asfortranarray(value_[None,:]) + */ + goto __pyx_L3; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":336 + * value = np.asfortranarray(value_[None,:]) + * + * elif len(value_shape) == 2: # <<<<<<<<<<<<<< + * # Get elements in column major order + * value = np.asfortranarray(value_) + */ + __pyx_t_3 = PyObject_Length(__pyx_v_value_shape); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 == 2) != 0); + if (__pyx_t_4) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":338 + * elif len(value_shape) == 2: + * # Get elements in column major order + * value = np.asfortranarray(value_) # <<<<<<<<<<<<<< + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_value_) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_value_); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_value = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "acados_template/acados_ocp_solver_pyx.pyx":336 + * value = np.asfortranarray(value_[None,:]) + * + * elif len(value_shape) == 2: # <<<<<<<<<<<<<< + * # Get elements in column major order + * value = np.asfortranarray(value_) + */ + } + __pyx_L3:; + + /* "acados_template/acados_ocp_solver_pyx.pyx":340 + * value = np.asfortranarray(value_) + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.constraints_set(): mismatching dimension' \ + * ' for field "{}" with dimension {} (you have {})'.format(field_, tuple(dims), value_shape)) + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_value_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_dims[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_9) { + } else { + __pyx_t_4 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_value_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_dims[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __pyx_t_9; + __pyx_L5_bool_binop_done:; + if (unlikely(__pyx_t_4)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":342 + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: + * raise Exception('AcadosOcpSolver.constraints_set(): mismatching dimension' \ + * ' for field "{}" with dimension {} (you have {})'.format(field_, tuple(dims), value_shape)) # <<<<<<<<<<<<<< + * + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, \ + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_AcadosOcpSolver_constraints_set, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_carray_to_py_int(__pyx_v_dims, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_10 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_field_, __pyx_t_7, __pyx_v_value_shape}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_field_, __pyx_t_7, __pyx_v_value_shape}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + { + __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_field_); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_7); + __Pyx_INCREF(__pyx_v_value_shape); + __Pyx_GIVEREF(__pyx_v_value_shape); + PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_v_value_shape); + __pyx_t_7 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":341 + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: + * raise Exception('AcadosOcpSolver.constraints_set(): mismatching dimension' \ # <<<<<<<<<<<<<< + * ' for field "{}" with dimension {} (you have {})'.format(field_, tuple(dims), value_shape)) + * + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 341, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":340 + * value = np.asfortranarray(value_) + * + * if value_shape[0] != dims[0] or value_shape[1] != dims[1]: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.constraints_set(): mismatching dimension' \ + * ' for field "{}" with dimension {} (you have {})'.format(field_, tuple(dims), value_shape)) + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":345 + * + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, \ + * self.nlp_dims, self.nlp_in, stage, field, &value[0][0]) # <<<<<<<<<<<<<< + * + * return + */ + __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L1_error) + if (unlikely(!__pyx_v_value.memview)) { __Pyx_RaiseUnboundLocalError("value"); __PYX_ERR(0, 345, __pyx_L1_error) } + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_v_value.shape[0]; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_v_value.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_v_value.shape[1]; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_14 >= __pyx_v_value.shape[1])) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + __PYX_ERR(0, 345, __pyx_L1_error) + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":344 + * ' for field "{}" with dimension {} (you have {})'.format(field_, tuple(dims), value_shape)) + * + * acados_solver_common.ocp_nlp_constraints_model_set(self.nlp_config, \ # <<<<<<<<<<<<<< + * self.nlp_dims, self.nlp_in, stage, field, &value[0][0]) + * + */ + (void)(ocp_nlp_constraints_model_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_in, __pyx_v_stage, __pyx_t_12, ((void *)(&(*((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_value.data) + __pyx_t_13)) ) + __pyx_t_14 * __pyx_v_value.strides[1]) ))))))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":347 + * self.nlp_dims, self.nlp_in, stage, field, &value[0][0]) + * + * return # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":315 + * + * + * def constraints_set(self, int stage, str field_, value_): # <<<<<<<<<<<<<< + * """ + * Set numerical data in the constraint module of the solver. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.constraints_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_field); + __PYX_XDEC_MEMVIEW(&__pyx_v_value, 1); + __Pyx_XDECREF(__pyx_v_value_shape); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":350 + * + * + * def dynamics_get(self, int stage, str field_): # <<<<<<<<<<<<<< + * """ + * Get numerical data from the dynamics module of the solver: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_27dynamics_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_26dynamics_get[] = "\n Get numerical data from the dynamics module of the solver:\n\n :param stage: integer corresponding to shooting node\n :param field: string, e.g. 'A'\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_27dynamics_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_stage; + PyObject *__pyx_v_field_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dynamics_get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stage,&__pyx_n_s_field,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stage)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("dynamics_get", 1, 2, 2, 1); __PYX_ERR(0, 350, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dynamics_get") < 0)) __PYX_ERR(0, 350, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_stage = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_stage == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) + __pyx_v_field_ = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("dynamics_get", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 350, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.dynamics_get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_), (&PyUnicode_Type), 1, "field_", 1))) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_26dynamics_get(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_stage, __pyx_v_field_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_26dynamics_get(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, int __pyx_v_stage, PyObject *__pyx_v_field_) { + PyObject *__pyx_v_field = NULL; + int __pyx_v_dims[2]; + PyObject *__pyx_v_out = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + char const *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("dynamics_get", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":357 + * :param field: string, e.g. 'A' + * """ + * field = field_.encode('utf-8') # <<<<<<<<<<<<<< + * + * # get dims + */ + if (unlikely(__pyx_v_field_ == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 357, __pyx_L1_error) + } + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_field_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_field = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":361 + * # get dims + * cdef int[2] dims + * acados_solver_common.ocp_nlp_dynamics_dims_get_from_attr(self.nlp_config, self.nlp_dims, self.nlp_out, stage, field, &dims[0]) # <<<<<<<<<<<<<< + * + * # create output data + */ + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L1_error) + ocp_nlp_dynamics_dims_get_from_attr(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_out, __pyx_v_stage, __pyx_t_2, (&(__pyx_v_dims[0]))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":364 + * + * # create output data + * out = np.zeros((dims[0], dims[1]), order='F', dtype=np.float64) # <<<<<<<<<<<<<< + * + * # call getter + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_dims[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_dims[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_out = __pyx_t_6; + __pyx_t_6 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":367 + * + * # call getter + * acados_solver_common.ocp_nlp_get_at_stage(self.nlp_config, self.nlp_dims, self.nlp_solver, stage, field, out.data) # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + ocp_nlp_get_at_stage(__pyx_v_self->nlp_config, __pyx_v_self->nlp_dims, __pyx_v_self->nlp_solver, __pyx_v_stage, __pyx_t_7, ((void *)__pyx_t_6)); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":369 + * acados_solver_common.ocp_nlp_get_at_stage(self.nlp_config, self.nlp_dims, self.nlp_solver, stage, field, out.data) + * + * return out # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_out); + __pyx_r = __pyx_v_out; + goto __pyx_L0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":350 + * + * + * def dynamics_get(self, int stage, str field_): # <<<<<<<<<<<<<< + * """ + * Get numerical data from the dynamics module of the solver: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.dynamics_get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_field); + __Pyx_XDECREF(__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":372 + * + * + * def options_set(self, str field_, value_): # <<<<<<<<<<<<<< + * """ + * Set options of the solver. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_29options_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_28options_set[] = "\n Set options of the solver.\n\n :param field: string, e.g. 'print_level', 'rti_phase', 'initialize_t_slacks', 'step_length', 'alpha_min', 'alpha_reduction'\n :param value: of type int, float\n "; +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_29options_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_field_ = 0; + PyObject *__pyx_v_value_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("options_set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_value,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("options_set", 1, 2, 2, 1); __PYX_ERR(0, 372, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "options_set") < 0)) __PYX_ERR(0, 372, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_field_ = ((PyObject*)values[0]); + __pyx_v_value_ = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("options_set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 372, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.options_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_), (&PyUnicode_Type), 1, "field_", 1))) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_28options_set(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), __pyx_v_field_, __pyx_v_value_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_28options_set(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, PyObject *__pyx_v_field_, PyObject *__pyx_v_value_) { + PyObject *__pyx_v_int_fields = NULL; + PyObject *__pyx_v_double_fields = NULL; + PyObject *__pyx_v_string_fields = NULL; + PyObject *__pyx_v_field = NULL; + int __pyx_v_int_value; + double __pyx_v_double_value; + __Pyx_memviewslice __pyx_v_string_value = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + char const *__pyx_t_8; + double __pyx_t_9; + __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("options_set", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":379 + * :param value: of type int, float + * """ + * int_fields = ['print_level', 'rti_phase', 'initialize_t_slacks'] # <<<<<<<<<<<<<< + * double_fields = ['step_length', 'tol_eq', 'tol_stat', 'tol_ineq', 'tol_comp', 'alpha_min', 'alpha_reduction'] + * string_fields = ['globalization'] + */ + __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_print_level); + __Pyx_GIVEREF(__pyx_n_u_print_level); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_print_level); + __Pyx_INCREF(__pyx_n_u_rti_phase); + __Pyx_GIVEREF(__pyx_n_u_rti_phase); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_rti_phase); + __Pyx_INCREF(__pyx_n_u_initialize_t_slacks); + __Pyx_GIVEREF(__pyx_n_u_initialize_t_slacks); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_initialize_t_slacks); + __pyx_v_int_fields = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":380 + * """ + * int_fields = ['print_level', 'rti_phase', 'initialize_t_slacks'] + * double_fields = ['step_length', 'tol_eq', 'tol_stat', 'tol_ineq', 'tol_comp', 'alpha_min', 'alpha_reduction'] # <<<<<<<<<<<<<< + * string_fields = ['globalization'] + * + */ + __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_step_length); + __Pyx_GIVEREF(__pyx_n_u_step_length); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_step_length); + __Pyx_INCREF(__pyx_n_u_tol_eq); + __Pyx_GIVEREF(__pyx_n_u_tol_eq); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_tol_eq); + __Pyx_INCREF(__pyx_n_u_tol_stat); + __Pyx_GIVEREF(__pyx_n_u_tol_stat); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_tol_stat); + __Pyx_INCREF(__pyx_n_u_tol_ineq); + __Pyx_GIVEREF(__pyx_n_u_tol_ineq); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_tol_ineq); + __Pyx_INCREF(__pyx_n_u_tol_comp); + __Pyx_GIVEREF(__pyx_n_u_tol_comp); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_u_tol_comp); + __Pyx_INCREF(__pyx_n_u_alpha_min); + __Pyx_GIVEREF(__pyx_n_u_alpha_min); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_u_alpha_min); + __Pyx_INCREF(__pyx_n_u_alpha_reduction); + __Pyx_GIVEREF(__pyx_n_u_alpha_reduction); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_u_alpha_reduction); + __pyx_v_double_fields = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":381 + * int_fields = ['print_level', 'rti_phase', 'initialize_t_slacks'] + * double_fields = ['step_length', 'tol_eq', 'tol_stat', 'tol_ineq', 'tol_comp', 'alpha_min', 'alpha_reduction'] + * string_fields = ['globalization'] # <<<<<<<<<<<<<< + * + * # encode + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_globalization); + __Pyx_GIVEREF(__pyx_n_u_globalization); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_globalization); + __pyx_v_string_fields = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":384 + * + * # encode + * field = field_.encode('utf-8') # <<<<<<<<<<<<<< + * + * cdef int int_value + */ + if (unlikely(__pyx_v_field_ == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 384, __pyx_L1_error) + } + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_field_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_field = __pyx_t_1; + __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":391 + * + * # check field availability and type + * if field_ in int_fields: # <<<<<<<<<<<<<< + * if not isinstance(value_, int): + * raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) + */ + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_v_int_fields, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":392 + * # check field availability and type + * if field_ in int_fields: + * if not isinstance(value_, int): # <<<<<<<<<<<<<< + * raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) + * + */ + __pyx_t_3 = PyInt_Check(__pyx_v_value_); + __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0); + if (unlikely(__pyx_t_2)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":393 + * if field_ in int_fields: + * if not isinstance(value_, int): + * raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) # <<<<<<<<<<<<<< + * + * if field_ == 'rti_phase': + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_solver_option_must_be_of_type_in, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, ((PyObject *)Py_TYPE(__pyx_v_value_))}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, ((PyObject *)Py_TYPE(__pyx_v_value_))}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_field_); + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_value_))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_value_))); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)Py_TYPE(__pyx_v_value_))); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 393, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":392 + * # check field availability and type + * if field_ in int_fields: + * if not isinstance(value_, int): # <<<<<<<<<<<<<< + * raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) + * + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":395 + * raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) + * + * if field_ == 'rti_phase': # <<<<<<<<<<<<<< + * if value_ < 0 or value_ > 2: + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_field_, __pyx_n_u_rti_phase, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 395, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":396 + * + * if field_ == 'rti_phase': + * if value_ < 0 or value_ > 2: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_value_, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 396, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_4 = PyObject_RichCompare(__pyx_v_value_, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 396, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __pyx_t_2; + __pyx_L7_bool_binop_done:; + if (unlikely(__pyx_t_3)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":397 + * if field_ == 'rti_phase': + * if value_ < 0 or value_ > 2: + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' # <<<<<<<<<<<<<< + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + * if self.acados_ocp.solver_options.nlp_solver_type != 'SQP_RTI' and value_ > 0: + */ + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 397, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":396 + * + * if field_ == 'rti_phase': + * if value_ < 0 or value_ > 2: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":399 + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + * if self.acados_ocp.solver_options.nlp_solver_type != 'SQP_RTI' and value_ > 0: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + * 'take only value 0 for SQP-type solvers') + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_acados_ocp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_solver_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nlp_solver_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_SQP_RTI, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L10_bool_binop_done; + } + __pyx_t_4 = PyObject_RichCompare(__pyx_v_value_, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __pyx_t_2; + __pyx_L10_bool_binop_done:; + if (unlikely(__pyx_t_3)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":400 + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + * if self.acados_ocp.solver_options.nlp_solver_type != 'SQP_RTI' and value_ > 0: + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' # <<<<<<<<<<<<<< + * 'take only value 0 for SQP-type solvers') + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 400, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":399 + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + * if self.acados_ocp.solver_options.nlp_solver_type != 'SQP_RTI' and value_ > 0: # <<<<<<<<<<<<<< + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + * 'take only value 0 for SQP-type solvers') + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":395 + * raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) + * + * if field_ == 'rti_phase': # <<<<<<<<<<<<<< + * if value_ < 0 or value_ > 2: + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":403 + * 'take only value 0 for SQP-type solvers') + * + * int_value = value_ # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &int_value) + * + */ + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_value_); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L1_error) + __pyx_v_int_value = __pyx_t_6; + + /* "acados_template/acados_ocp_solver_pyx.pyx":404 + * + * int_value = value_ + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &int_value) # <<<<<<<<<<<<<< + * + * elif field_ in double_fields: + */ + __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 404, __pyx_L1_error) + ocp_nlp_solver_opts_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_opts, __pyx_t_8, ((void *)(&__pyx_v_int_value))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":391 + * + * # check field availability and type + * if field_ in int_fields: # <<<<<<<<<<<<<< + * if not isinstance(value_, int): + * raise Exception('solver option {} must be of type int. You have {}.'.format(field_, type(value_))) + */ + goto __pyx_L3; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":406 + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &int_value) + * + * elif field_ in double_fields: # <<<<<<<<<<<<<< + * if not isinstance(value_, float): + * raise Exception('solver option {} must be of type float. You have {}.'.format(field_, type(value_))) + */ + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_v_double_fields, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":407 + * + * elif field_ in double_fields: + * if not isinstance(value_, float): # <<<<<<<<<<<<<< + * raise Exception('solver option {} must be of type float. You have {}.'.format(field_, type(value_))) + * + */ + __pyx_t_2 = PyFloat_Check(__pyx_v_value_); + __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); + if (unlikely(__pyx_t_3)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":408 + * elif field_ in double_fields: + * if not isinstance(value_, float): + * raise Exception('solver option {} must be of type float. You have {}.'.format(field_, type(value_))) # <<<<<<<<<<<<<< + * + * double_value = value_ + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_solver_option_must_be_of_type_fl, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_field_, ((PyObject *)Py_TYPE(__pyx_v_value_))}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_field_, ((PyObject *)Py_TYPE(__pyx_v_value_))}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_field_); + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_value_))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_value_))); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, ((PyObject *)Py_TYPE(__pyx_v_value_))); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 408, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":407 + * + * elif field_ in double_fields: + * if not isinstance(value_, float): # <<<<<<<<<<<<<< + * raise Exception('solver option {} must be of type float. You have {}.'.format(field_, type(value_))) + * + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":410 + * raise Exception('solver option {} must be of type float. You have {}.'.format(field_, type(value_))) + * + * double_value = value_ # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &double_value) + * + */ + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_value_); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_v_double_value = __pyx_t_9; + + /* "acados_template/acados_ocp_solver_pyx.pyx":411 + * + * double_value = value_ + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &double_value) # <<<<<<<<<<<<<< + * + * elif field_ in string_fields: + */ + __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error) + ocp_nlp_solver_opts_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_opts, __pyx_t_8, ((void *)(&__pyx_v_double_value))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":406 + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &int_value) + * + * elif field_ in double_fields: # <<<<<<<<<<<<<< + * if not isinstance(value_, float): + * raise Exception('solver option {} must be of type float. You have {}.'.format(field_, type(value_))) + */ + goto __pyx_L3; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":413 + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &double_value) + * + * elif field_ in string_fields: # <<<<<<<<<<<<<< + * if not isinstance(value_, bytes): + * raise Exception('solver option {} must be of type str. You have {}.'.format(field_, type(value_))) + */ + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_field_, __pyx_v_string_fields, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_3 != 0); + if (likely(__pyx_t_2)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":414 + * + * elif field_ in string_fields: + * if not isinstance(value_, bytes): # <<<<<<<<<<<<<< + * raise Exception('solver option {} must be of type str. You have {}.'.format(field_, type(value_))) + * + */ + __pyx_t_2 = PyBytes_Check(__pyx_v_value_); + __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); + if (unlikely(__pyx_t_3)) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":415 + * elif field_ in string_fields: + * if not isinstance(value_, bytes): + * raise Exception('solver option {} must be of type str. You have {}.'.format(field_, type(value_))) # <<<<<<<<<<<<<< + * + * string_value = value_.encode('utf-8') + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_solver_option_must_be_of_type_st, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, ((PyObject *)Py_TYPE(__pyx_v_value_))}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, ((PyObject *)Py_TYPE(__pyx_v_value_))}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_field_); + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_value_))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_value_))); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)Py_TYPE(__pyx_v_value_))); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 415, __pyx_L1_error) + + /* "acados_template/acados_ocp_solver_pyx.pyx":414 + * + * elif field_ in string_fields: + * if not isinstance(value_, bytes): # <<<<<<<<<<<<<< + * raise Exception('solver option {} must be of type str. You have {}.'.format(field_, type(value_))) + * + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":417 + * raise Exception('solver option {} must be of type str. You have {}.'.format(field_, type(value_))) + * + * string_value = value_.encode('utf-8') # <<<<<<<<<<<<<< + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &string_value[0]) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_utf_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 417, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_string_value = __pyx_t_10; + __pyx_t_10.memview = NULL; + __pyx_t_10.data = NULL; + + /* "acados_template/acados_ocp_solver_pyx.pyx":418 + * + * string_value = value_.encode('utf-8') + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &string_value[0]) # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_11 = 0; + __pyx_t_6 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_v_string_value.shape[0]; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_v_string_value.shape[0])) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + __PYX_ERR(0, 418, __pyx_L1_error) + } + ocp_nlp_solver_opts_set(__pyx_v_self->nlp_config, __pyx_v_self->nlp_opts, __pyx_t_8, ((void *)(&(*((unsigned char *) ( /* dim=0 */ ((char *) (((unsigned char *) __pyx_v_string_value.data) + __pyx_t_11)) )))))); + + /* "acados_template/acados_ocp_solver_pyx.pyx":413 + * acados_solver_common.ocp_nlp_solver_opts_set(self.nlp_config, self.nlp_opts, field, &double_value) + * + * elif field_ in string_fields: # <<<<<<<<<<<<<< + * if not isinstance(value_, bytes): + * raise Exception('solver option {} must be of type str. You have {}.'.format(field_, type(value_))) + */ + goto __pyx_L3; + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":421 + * + * else: + * raise Exception('AcadosOcpSolver.options_set() does not support field {}.'\ # <<<<<<<<<<<<<< + * '\n Possible values are {}.'.format(field_, ', '.join(int_fields + double_fields + string_fields))) + * + */ + /*else*/ { + + /* "acados_template/acados_ocp_solver_pyx.pyx":422 + * else: + * raise Exception('AcadosOcpSolver.options_set() does not support field {}.'\ + * '\n Possible values are {}.'.format(field_, ', '.join(int_fields + double_fields + string_fields))) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_AcadosOcpSolver_options_set_does, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyNumber_Add(__pyx_v_int_fields, __pyx_v_double_fields); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyNumber_Add(__pyx_t_7, __pyx_v_string_fields); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyUnicode_Join(__pyx_kp_u__6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_field_, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + { + __pyx_t_12 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_field_); + __Pyx_GIVEREF(__pyx_v_field_); + PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_6, __pyx_v_field_); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_6, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":421 + * + * else: + * raise Exception('AcadosOcpSolver.options_set() does not support field {}.'\ # <<<<<<<<<<<<<< + * '\n Possible values are {}.'.format(field_, ', '.join(int_fields + double_fields + string_fields))) + * + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 421, __pyx_L1_error) + } + __pyx_L3:; + + /* "acados_template/acados_ocp_solver_pyx.pyx":372 + * + * + * def options_set(self, str field_, value_): # <<<<<<<<<<<<<< + * """ + * Set options of the solver. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.options_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_int_fields); + __Pyx_XDECREF(__pyx_v_double_fields); + __Pyx_XDECREF(__pyx_v_string_fields); + __Pyx_XDECREF(__pyx_v_field); + __PYX_XDEC_MEMVIEW(&__pyx_v_string_value, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "acados_template/acados_ocp_solver_pyx.pyx":425 + * + * + * def __del__(self): # <<<<<<<<<<<<<< + * if self.solver_created: + * acados_solver.acados_free(self.capsule) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_31__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_31__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_30__del__(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_30__del__(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__del__", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":426 + * + * def __del__(self): + * if self.solver_created: # <<<<<<<<<<<<<< + * acados_solver.acados_free(self.capsule) + * acados_solver.acados_free_capsule(self.capsule) + */ + __pyx_t_1 = (__pyx_v_self->solver_created != 0); + if (__pyx_t_1) { + + /* "acados_template/acados_ocp_solver_pyx.pyx":427 + * def __del__(self): + * if self.solver_created: + * acados_solver.acados_free(self.capsule) # <<<<<<<<<<<<<< + * acados_solver.acados_free_capsule(self.capsule) + */ + (void)(long_acados_free(__pyx_v_self->capsule)); + + /* "acados_template/acados_ocp_solver_pyx.pyx":428 + * if self.solver_created: + * acados_solver.acados_free(self.capsule) + * acados_solver.acados_free_capsule(self.capsule) # <<<<<<<<<<<<<< + */ + (void)(long_acados_free_capsule(__pyx_v_self->capsule)); + + /* "acados_template/acados_ocp_solver_pyx.pyx":426 + * + * def __del__(self): + * if self.solver_created: # <<<<<<<<<<<<<< + * acados_solver.acados_free(self.capsule) + * acados_solver.acados_free_capsule(self.capsule) + */ + } + + /* "acados_template/acados_ocp_solver_pyx.pyx":425 + * + * + * def __del__(self): # <<<<<<<<<<<<<< + * if self.solver_created: + * acados_solver.acados_free(self.capsule) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_33__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_33__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_32__reduce_cython__(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_35__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_35__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_34__setstate_cython__(((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":735 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":736 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":735 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":738 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":739 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":738 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":741 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":742 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":741 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":744 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":745 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":744 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":747 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":748 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":747 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":750 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":751 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); + if (__pyx_t_1) { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":752 + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape # <<<<<<<<<<<<<< + * else: + * return () + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); + __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":751 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":754 + * return d.subarray.shape + * else: + * return () # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_r = __pyx_empty_tuple; + goto __pyx_L0; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":750 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":929 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":930 + * + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< + * PyArray_SetBaseObject(arr, base) + * + */ + Py_INCREF(__pyx_v_base); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":931 + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":929 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":933 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_v_base; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":934 + * + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< + * if base is NULL: + * return None + */ + __pyx_v_base = PyArray_BASE(__pyx_v_arr); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":935 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + __pyx_t_1 = ((__pyx_v_base == NULL) != 0); + if (__pyx_t_1) { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":936 + * base = PyArray_BASE(arr) + * if base is NULL: + * return None # <<<<<<<<<<<<<< + * return base + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":935 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":937 + * if base is NULL: + * return None + * return base # <<<<<<<<<<<<<< + * + * # Versions of the import_* functions which are more suitable for + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_base)); + __pyx_r = ((PyObject *)__pyx_v_base); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":933 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":941 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":943 + * cdef inline int import_array() except -1: + * try: + * __pyx_import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":944 + * try: + * __pyx_import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":945 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 945, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":942 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":941 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":947 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":949 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":950 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":951 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 951, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":948 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":947 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":953 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":955 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error) + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":956 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":957 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef extern from *: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 957, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":954 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":953 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":967 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timedelta64_object", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":979 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":967 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":982 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_datetime64_object", 0); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":994 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":982 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":997 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + +static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { + npy_datetime __pyx_r; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1004 + * also needed. That can be found using `get_datetime64_unit`. + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":997 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1007 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + +static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { + npy_timedelta __pyx_r; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1011 + * returns the int64 value underlying scalar numpy timedelta64 object + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1007 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1014 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + +static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { + NPY_DATETIMEUNIT __pyx_r; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1018 + * returns the unit part of the dtype for a numpy datetime64 object. + * """ + * return (obj).obmeta.base # <<<<<<<<<<<<<< + */ + __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); + goto __pyx_L0; + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":1014 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "carray.to_py":112 + * + * @cname("__Pyx_carray_to_py_int") + * cdef inline list __Pyx_carray_to_py_int(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value + */ + +static CYTHON_INLINE PyObject *__Pyx_carray_to_py_int(int *__pyx_v_v, Py_ssize_t __pyx_v_length) { + size_t __pyx_v_i; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_l = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_carray_to_py_int", 0); + + /* "carray.to_py":115 + * cdef size_t i + * cdef object value + * l = PyList_New(length) # <<<<<<<<<<<<<< + * for i in range(length): + * value = v[i] + */ + __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_l = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "carray.to_py":116 + * cdef object value + * l = PyList_New(length) + * for i in range(length): # <<<<<<<<<<<<<< + * value = v[i] + * Py_INCREF(value) + */ + __pyx_t_2 = ((size_t)__pyx_v_length); + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "carray.to_py":117 + * l = PyList_New(length) + * for i in range(length): + * value = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) + */ + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "carray.to_py":118 + * for i in range(length): + * value = v[i] + * Py_INCREF(value) # <<<<<<<<<<<<<< + * PyList_SET_ITEM(l, i, value) + * return l + */ + Py_INCREF(__pyx_v_value); + + /* "carray.to_py":119 + * value = v[i] + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) # <<<<<<<<<<<<<< + * return l + * + */ + PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value); + } + + /* "carray.to_py":120 + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) + * return l # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_l); + __pyx_r = __pyx_v_l; + goto __pyx_L0; + + /* "carray.to_py":112 + * + * @cname("__Pyx_carray_to_py_int") + * cdef inline list __Pyx_carray_to_py_int(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_l); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "carray.to_py":124 + * + * @cname("__Pyx_carray_to_tuple_int") + * cdef inline tuple __Pyx_carray_to_tuple_int(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value + */ + +static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_int(int *__pyx_v_v, Py_ssize_t __pyx_v_length) { + size_t __pyx_v_i; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_int", 0); + + /* "carray.to_py":127 + * cdef size_t i + * cdef object value + * t = PyTuple_New(length) # <<<<<<<<<<<<<< + * for i in range(length): + * value = v[i] + */ + __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_t = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "carray.to_py":128 + * cdef object value + * t = PyTuple_New(length) + * for i in range(length): # <<<<<<<<<<<<<< + * value = v[i] + * Py_INCREF(value) + */ + __pyx_t_2 = ((size_t)__pyx_v_length); + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "carray.to_py":129 + * t = PyTuple_New(length) + * for i in range(length): + * value = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) + */ + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "carray.to_py":130 + * for i in range(length): + * value = v[i] + * Py_INCREF(value) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(t, i, value) + * return t + */ + Py_INCREF(__pyx_v_value); + + /* "carray.to_py":131 + * value = v[i] + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) # <<<<<<<<<<<<<< + * return t + */ + PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value); + } + + /* "carray.to_py":132 + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) + * return t # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_t); + __pyx_r = __pyx_v_t; + goto __pyx_L0; + + /* "carray.to_py":124 + * + * @cname("__Pyx_carray_to_tuple_int") + * cdef inline tuple __Pyx_carray_to_tuple_int(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":122 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + +/* Python wrapper */ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_shape = 0; + Py_ssize_t __pyx_v_itemsize; + PyObject *__pyx_v_format = 0; + PyObject *__pyx_v_mode = 0; + int __pyx_v_allocate_buffer; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)__pyx_n_s_c); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_shape = ((PyObject*)values[0]); + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error) + } else { + + /* "View.MemoryView":123 + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, + * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< + * + * cdef int idx + */ + __pyx_v_allocate_buffer = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error) + } + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); + + /* "View.MemoryView":122 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) { + int __pyx_v_idx; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_dim; + PyObject **__pyx_v_p; + char __pyx_v_order; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":129 + * cdef PyObject **p + * + * self.ndim = len(shape) # <<<<<<<<<<<<<< + * self.itemsize = itemsize + * + */ + if (unlikely(__pyx_v_shape == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 129, __pyx_L1_error) + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":130 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":132 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":133 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 133, __pyx_L1_error) + + /* "View.MemoryView":132 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + } + + /* "View.MemoryView":135 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":136 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 136, __pyx_L1_error) + + /* "View.MemoryView":135 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + } + + /* "View.MemoryView":138 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + __pyx_t_2 = PyBytes_Check(__pyx_v_format); + __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":139 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":138 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + } + + /* "View.MemoryView":140 + * if not isinstance(format, bytes): + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error) + __pyx_t_3 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":141 + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * + * + */ + if (unlikely(__pyx_v_self->_format == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(1, 141, __pyx_L1_error) + } + __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_7; + + /* "View.MemoryView":144 + * + * + * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< + * self._strides = self._shape + self.ndim + * + */ + __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); + + /* "View.MemoryView":145 + * + * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) + * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< + * + * if not self._shape: + */ + __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); + + /* "View.MemoryView":147 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":148 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 148, __pyx_L1_error) + + /* "View.MemoryView":147 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + } + + /* "View.MemoryView":151 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + __pyx_t_8 = 0; + __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + for (;;) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_9; + __pyx_v_idx = __pyx_t_8; + __pyx_t_8 = (__pyx_t_8 + 1); + + /* "View.MemoryView":152 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":153 + * for idx, dim in enumerate(shape): + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< + * self._shape[idx] = dim + * + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6); + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(1, 153, __pyx_L1_error) + + /* "View.MemoryView":152 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + } + + /* "View.MemoryView":154 + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim # <<<<<<<<<<<<<< + * + * cdef char order + */ + (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; + + /* "View.MemoryView":151 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":157 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":158 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":159 + * if mode == 'fortran': + * order = b'F' + * self.mode = u'fortran' # <<<<<<<<<<<<<< + * elif mode == 'c': + * order = b'C' + */ + __Pyx_INCREF(__pyx_n_u_fortran); + __Pyx_GIVEREF(__pyx_n_u_fortran); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_fortran; + + /* "View.MemoryView":157 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":160 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error) + if (likely(__pyx_t_4)) { + + /* "View.MemoryView":161 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":162 + * elif mode == 'c': + * order = b'C' + * self.mode = u'c' # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + */ + __Pyx_INCREF(__pyx_n_u_c); + __Pyx_GIVEREF(__pyx_n_u_c); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_c; + + /* "View.MemoryView":160 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":164 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< + * + * self.len = fill_contig_strides_array(self._shape, self._strides, + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(1, 164, __pyx_L1_error) + } + __pyx_L10:; + + /* "View.MemoryView":166 + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + * + * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< + * itemsize, self.ndim, order) + * + */ + __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); + + /* "View.MemoryView":169 + * itemsize, self.ndim, order) + * + * self.free_data = allocate_buffer # <<<<<<<<<<<<<< + * self.dtype_is_object = format == b'O' + * if allocate_buffer: + */ + __pyx_v_self->free_data = __pyx_v_allocate_buffer; + + /* "View.MemoryView":170 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: + * + */ + __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":171 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = (__pyx_v_allocate_buffer != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":174 + * + * + * self.data = malloc(self.len) # <<<<<<<<<<<<<< + * if not self.data: + * raise MemoryError("unable to allocate array data.") + */ + __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); + + /* "View.MemoryView":175 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":176 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(1, 176, __pyx_L1_error) + + /* "View.MemoryView":175 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + } + + /* "View.MemoryView":178 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":179 + * + * if self.dtype_is_object: + * p = self.data # <<<<<<<<<<<<<< + * for i in range(self.len / itemsize): + * p[i] = Py_None + */ + __pyx_v_p = ((PyObject **)__pyx_v_self->data); + + /* "View.MemoryView":180 + * if self.dtype_is_object: + * p = self.data + * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< + * p[i] = Py_None + * Py_INCREF(Py_None) + */ + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(1, 180, __pyx_L1_error) + } + else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(1, 180, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + __pyx_t_9 = __pyx_t_1; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "View.MemoryView":181 + * p = self.data + * for i in range(self.len / itemsize): + * p[i] = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + (__pyx_v_p[__pyx_v_i]) = Py_None; + + /* "View.MemoryView":182 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + + /* "View.MemoryView":178 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + } + + /* "View.MemoryView":171 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":122 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":185 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_bufmode; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + char *__pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "View.MemoryView":186 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 # <<<<<<<<<<<<<< + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = -1; + + /* "View.MemoryView":187 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":188 + * cdef int bufmode = -1 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + + /* "View.MemoryView":187 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + goto __pyx_L3; + } + + /* "View.MemoryView":189 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":190 + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + */ + __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + + /* "View.MemoryView":189 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + } + __pyx_L3:; + + /* "View.MemoryView":191 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":192 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 192, __pyx_L1_error) + + /* "View.MemoryView":191 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + } + + /* "View.MemoryView":193 + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data # <<<<<<<<<<<<<< + * info.len = self.len + * info.ndim = self.ndim + */ + __pyx_t_4 = __pyx_v_self->data; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":194 + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + * info.len = self.len # <<<<<<<<<<<<<< + * info.ndim = self.ndim + * info.shape = self._shape + */ + __pyx_t_5 = __pyx_v_self->len; + __pyx_v_info->len = __pyx_t_5; + + /* "View.MemoryView":195 + * info.buf = self.data + * info.len = self.len + * info.ndim = self.ndim # <<<<<<<<<<<<<< + * info.shape = self._shape + * info.strides = self._strides + */ + __pyx_t_6 = __pyx_v_self->ndim; + __pyx_v_info->ndim = __pyx_t_6; + + /* "View.MemoryView":196 + * info.len = self.len + * info.ndim = self.ndim + * info.shape = self._shape # <<<<<<<<<<<<<< + * info.strides = self._strides + * info.suboffsets = NULL + */ + __pyx_t_7 = __pyx_v_self->_shape; + __pyx_v_info->shape = __pyx_t_7; + + /* "View.MemoryView":197 + * info.ndim = self.ndim + * info.shape = self._shape + * info.strides = self._strides # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = self.itemsize + */ + __pyx_t_7 = __pyx_v_self->_strides; + __pyx_v_info->strides = __pyx_t_7; + + /* "View.MemoryView":198 + * info.shape = self._shape + * info.strides = self._strides + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = self.itemsize + * info.readonly = 0 + */ + __pyx_v_info->suboffsets = NULL; + + /* "View.MemoryView":199 + * info.strides = self._strides + * info.suboffsets = NULL + * info.itemsize = self.itemsize # <<<<<<<<<<<<<< + * info.readonly = 0 + * + */ + __pyx_t_5 = __pyx_v_self->itemsize; + __pyx_v_info->itemsize = __pyx_t_5; + + /* "View.MemoryView":200 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":202 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":203 + * + * if flags & PyBUF_FORMAT: + * info.format = self.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_4 = __pyx_v_self->format; + __pyx_v_info->format = __pyx_t_4; + + /* "View.MemoryView":202 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":205 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":207 + * info.format = NULL + * + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":185 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":211 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + +/* Python wrapper */ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":212 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":213 + * def __dealloc__(array self): + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) # <<<<<<<<<<<<<< + * elif self.free_data: + * if self.dtype_is_object: + */ + __pyx_v_self->callback_free_data(__pyx_v_self->data); + + /* "View.MemoryView":212 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":214 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":215 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":216 + * elif self.free_data: + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< + * self._strides, self.ndim, False) + * free(self.data) + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); + + /* "View.MemoryView":215 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + } + + /* "View.MemoryView":218 + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + * free(self.data) # <<<<<<<<<<<<<< + * PyObject_Free(self._shape) + * + */ + free(__pyx_v_self->data); + + /* "View.MemoryView":214 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + } + __pyx_L3:; + + /* "View.MemoryView":219 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< + * + * @property + */ + PyObject_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":211 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":222 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":223 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< + * + * @cname('get_memview') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":222 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":226 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_memview", 0); + + /* "View.MemoryView":227 + * @cname('get_memview') + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":228 + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":226 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":230 + * return memoryview(self, flags, self.dtype_is_object) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self._shape[0] + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":231 + * + * def __len__(self): + * return self._shape[0] # <<<<<<<<<<<<<< + * + * def __getattr__(self, attr): + */ + __pyx_r = (__pyx_v_self->_shape[0]); + goto __pyx_L0; + + /* "View.MemoryView":230 + * return memoryview(self, flags, self.dtype_is_object) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self._shape[0] + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":233 + * return self._shape[0] + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":234 + * + * def __getattr__(self, attr): + * return getattr(self.memview, attr) # <<<<<<<<<<<<<< + * + * def __getitem__(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":233 + * return self._shape[0] + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":236 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":237 + * + * def __getitem__(self, item): + * return self.memview[item] # <<<<<<<<<<<<<< + * + * def __setitem__(self, item, value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":236 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":239 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + +/* Python wrapper */ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":240 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":239 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":244 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + +static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) { + struct __pyx_array_obj *__pyx_v_result = 0; + struct __pyx_array_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_cwrapper", 0); + + /* "View.MemoryView":248 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":249 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":248 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":251 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":252 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error) + + /* "View.MemoryView":251 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":253 + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) + * result.data = buf # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->data = __pyx_v_buf; + } + __pyx_L3:; + + /* "View.MemoryView":255 + * result.data = buf + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":244 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":281 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + +/* Python wrapper */ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "View.MemoryView":282 + * cdef object name + * def __init__(self, name): + * self.name = name # <<<<<<<<<<<<<< + * def __repr__(self): + * return self.name + */ + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_name; + + /* "View.MemoryView":281 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":283 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + +/* Python wrapper */ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":284 + * self.name = name + * def __repr__(self): + * return self.name # <<<<<<<<<<<<<< + * + * cdef generic = Enum("") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* "View.MemoryView":283 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_v_state = 0; + PyObject *__pyx_v__dict = 0; + int __pyx_v_use_setstate; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":5 + * cdef object _dict + * cdef bint use_setstate + * state = (self.name,) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->name); + __Pyx_GIVEREF(__pyx_v_self->name); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name); + __pyx_v_state = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "(tree fragment)":6 + * cdef bint use_setstate + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":7 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":8 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "(tree fragment)":9 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self.name is not None + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":7 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":11 + * use_setstate = True + * else: + * use_setstate = self.name is not None # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_self->name != Py_None); + __pyx_v_use_setstate = __pyx_t_3; + } + __pyx_L3:; + + /* "(tree fragment)":12 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":13 + * use_setstate = self.name is not None + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184977713); + __Pyx_GIVEREF(__pyx_int_184977713); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":12 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + } + + /* "(tree fragment)":15 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184977713); + __Pyx_GIVEREF(__pyx_int_184977713); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":16 + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":17 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":298 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + +static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) { + Py_intptr_t __pyx_v_aligned_p; + size_t __pyx_v_offset; + void *__pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":300 + * cdef void *align_pointer(void *memory, size_t alignment) nogil: + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< + * cdef size_t offset + * + */ + __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); + + /* "View.MemoryView":304 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":306 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + __pyx_t_1 = ((__pyx_v_offset > 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":307 + * + * if offset > 0: + * aligned_p += alignment - offset # <<<<<<<<<<<<<< + * + * return aligned_p + */ + __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); + + /* "View.MemoryView":306 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + } + + /* "View.MemoryView":309 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":298 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":345 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + +/* Python wrapper */ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_obj = 0; + int __pyx_v_flags; + int __pyx_v_dtype_is_object; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_obj = values[0]; + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "View.MemoryView":346 + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj # <<<<<<<<<<<<<< + * self.flags = flags + * if type(self) is memoryview or obj is not None: + */ + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __Pyx_GOTREF(__pyx_v_self->obj); + __Pyx_DECREF(__pyx_v_self->obj); + __pyx_v_self->obj = __pyx_v_obj; + + /* "View.MemoryView":347 + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj + * self.flags = flags # <<<<<<<<<<<<<< + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + */ + __pyx_v_self->flags = __pyx_v_flags; + + /* "View.MemoryView":348 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_obj != Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "View.MemoryView":349 + * self.flags = flags + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + */ + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error) + + /* "View.MemoryView":350 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":351 + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; + + /* "View.MemoryView":352 + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * global __pyx_memoryview_thread_locks_used + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":350 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + } + + /* "View.MemoryView":348 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + } + + /* "View.MemoryView":355 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":356 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + */ + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + + /* "View.MemoryView":357 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + + /* "View.MemoryView":355 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + } + + /* "View.MemoryView":358 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":359 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":360 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":361 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error) + + /* "View.MemoryView":360 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } + + /* "View.MemoryView":358 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + } + + /* "View.MemoryView":363 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":364 + * + * if flags & PyBUF_FORMAT: + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< + * else: + * self.dtype_is_object = dtype_is_object + */ + __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L11_bool_binop_done:; + __pyx_v_self->dtype_is_object = __pyx_t_1; + + /* "View.MemoryView":363 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + goto __pyx_L10; + } + + /* "View.MemoryView":366 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L10:; + + /* "View.MemoryView":368 + * self.dtype_is_object = dtype_is_object + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL + */ + __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); + + /* "View.MemoryView":370 + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL # <<<<<<<<<<<<<< + * + * def __dealloc__(memoryview self): + */ + __pyx_v_self->typeinfo = NULL; + + /* "View.MemoryView":345 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":372 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + +/* Python wrapper */ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyThread_type_lock __pyx_t_6; + PyThread_type_lock __pyx_t_7; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":373 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + */ + __pyx_t_1 = (__pyx_v_self->obj != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":374 + * def __dealloc__(memoryview self): + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + * + */ + __Pyx_ReleaseBuffer((&__pyx_v_self->view)); + + /* "View.MemoryView":373 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":375 + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< + * + * (<__pyx_buffer *> &self.view).obj = NULL + */ + __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":377 + * elif (<__pyx_buffer *> &self.view).obj == Py_None: + * + * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<< + * Py_DECREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL; + + /* "View.MemoryView":378 + * + * (<__pyx_buffer *> &self.view).obj = NULL + * Py_DECREF(Py_None) # <<<<<<<<<<<<<< + * + * cdef int i + */ + Py_DECREF(Py_None); + + /* "View.MemoryView":375 + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< + * + * (<__pyx_buffer *> &self.view).obj = NULL + */ + } + __pyx_L3:; + + /* "View.MemoryView":382 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":383 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":384 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":385 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + + /* "View.MemoryView":386 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":388 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]); + + /* "View.MemoryView":387 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break + */ + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7; + + /* "View.MemoryView":386 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + } + + /* "View.MemoryView":389 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< + * else: + * PyThread_free_lock(self.lock) + */ + goto __pyx_L6_break; + + /* "View.MemoryView":384 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + } + } + /*else*/ { + + /* "View.MemoryView":391 + * break + * else: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + */ + PyThread_free_lock(__pyx_v_self->lock); + } + __pyx_L6_break:; + + /* "View.MemoryView":382 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + } + + /* "View.MemoryView":372 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":393 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + Py_ssize_t __pyx_v_dim; + char *__pyx_v_itemp; + PyObject *__pyx_v_idx = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + char *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item_pointer", 0); + + /* "View.MemoryView":395 + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< + * + * for dim, idx in enumerate(index): + */ + __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); + + /* "View.MemoryView":397 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + */ + __pyx_t_1 = 0; + if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) { + __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 397, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_1; + __pyx_t_1 = (__pyx_t_1 + 1); + + /* "View.MemoryView":398 + * + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + * + * return itemp + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; + + /* "View.MemoryView":397 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":400 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":393 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":403 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_indices = NULL; + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":404 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":405 + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: + * return self # <<<<<<<<<<<<<< + * + * have_slices, indices = _unellipsify(index, self.view.ndim) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "View.MemoryView":404 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + } + + /* "View.MemoryView":407 + * return self + * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp + */ + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 407, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":410 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error) + if (__pyx_t_2) { + + /* "View.MemoryView":411 + * cdef char *itemp + * if have_slices: + * return memview_slice(self, indices) # <<<<<<<<<<<<<< + * else: + * itemp = self.get_item_pointer(indices) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":410 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + } + + /* "View.MemoryView":413 + * return memview_slice(self, indices) + * else: + * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< + * return self.convert_item_to_object(itemp) + * + */ + /*else*/ { + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":414 + * else: + * itemp = self.get_item_pointer(indices) + * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< + * + * def __setitem__(memoryview self, object index, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":403 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":416 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_obj = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":417 + * + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: # <<<<<<<<<<<<<< + * raise TypeError("Cannot assign to read-only memoryview") + * + */ + __pyx_t_1 = (__pyx_v_self->view.readonly != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":418 + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< + * + * have_slices, index = _unellipsify(index, self.view.ndim) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 418, __pyx_L1_error) + + /* "View.MemoryView":417 + * + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: # <<<<<<<<<<<<<< + * raise TypeError("Cannot assign to read-only memoryview") + * + */ + } + + /* "View.MemoryView":420 + * raise TypeError("Cannot assign to read-only memoryview") + * + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: + */ + __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(__pyx_t_2 != Py_None)) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 420, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":422 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error) + if (__pyx_t_1) { + + /* "View.MemoryView":423 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_obj = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":424 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error) + if (__pyx_t_1) { + + /* "View.MemoryView":425 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "View.MemoryView":424 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":427 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L5:; + + /* "View.MemoryView":422 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":429 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + /*else*/ { + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L4:; + + /* "View.MemoryView":416 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":431 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_slice", 0); + __Pyx_INCREF(__pyx_v_obj); + + /* "View.MemoryView":432 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":433 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "View.MemoryView":434 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":435 + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":434 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + + /* "View.MemoryView":433 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "View.MemoryView":436 + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + * except TypeError: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":437 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "View.MemoryView":433 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":432 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, + */ + } + + /* "View.MemoryView":439 + * return None + * + * return obj # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assignment(self, dst, src): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + + /* "View.MemoryView":431 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":441 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) { + __Pyx_memviewslice __pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_src_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + __Pyx_memviewslice *__pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); + + /* "View.MemoryView":445 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error) + + /* "View.MemoryView":446 + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) + * + */ + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error) + + /* "View.MemoryView":447 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":445 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error) + + /* "View.MemoryView":441 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":449 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) { + int __pyx_v_array[0x80]; + void *__pyx_v_tmp; + void *__pyx_v_item; + __Pyx_memviewslice *__pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_tmp_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + char const *__pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); + + /* "View.MemoryView":451 + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * cdef int array[128] + * cdef void *tmp = NULL # <<<<<<<<<<<<<< + * cdef void *item + * + */ + __pyx_v_tmp = NULL; + + /* "View.MemoryView":456 + * cdef __Pyx_memviewslice *dst_slice + * cdef __Pyx_memviewslice tmp_slice + * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< + * + * if self.view.itemsize > sizeof(array): + */ + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error) + __pyx_v_dst_slice = __pyx_t_1; + + /* "View.MemoryView":458 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":459 + * + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< + * if tmp == NULL: + * raise MemoryError + */ + __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); + + /* "View.MemoryView":460 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":461 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error) + + /* "View.MemoryView":460 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + } + + /* "View.MemoryView":462 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + + /* "View.MemoryView":458 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":464 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":466 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":467 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":468 + * try: + * if self.dtype_is_object: + * ( item)[0] = value # <<<<<<<<<<<<<< + * else: + * self.assign_item_from_object( item, value) + */ + (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); + + /* "View.MemoryView":467 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":470 + * ( item)[0] = value + * else: + * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":474 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":475 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":474 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + } + + /* "View.MemoryView":476 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * item, self.dtype_is_object) + * finally: + */ + __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); + } + + /* "View.MemoryView":479 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + __pyx_L6_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; + { + PyMem_Free(__pyx_v_tmp); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "View.MemoryView":449 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":481 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + char *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_indexed", 0); + + /* "View.MemoryView":482 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":483 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":481 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":485 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_v_struct = NULL; + PyObject *__pyx_v_bytesitem = 0; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + size_t __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":488 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":491 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":492 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "View.MemoryView":493 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":492 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + } + + /* "View.MemoryView":497 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { + + /* "View.MemoryView":498 + * else: + * if len(self.view.format) == 1: + * return result[0] # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; + + /* "View.MemoryView":497 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + } + + /* "View.MemoryView":499 + * if len(self.view.format) == 1: + * return result[0] + * return result # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L6_except_return; + } + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "View.MemoryView":494 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9); + __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_1); + + /* "View.MemoryView":495 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 495, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "View.MemoryView":492 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } + + /* "View.MemoryView":485 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesitem); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":501 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_v_struct = NULL; + char __pyx_v_c; + PyObject *__pyx_v_bytesvalue = 0; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + char *__pyx_t_11; + char *__pyx_t_12; + char *__pyx_t_13; + char *__pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":504 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":509 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":510 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":509 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":512 + * bytesvalue = struct.pack(self.view.format, *value) + * else: + * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< + * + * for i, c in enumerate(bytesvalue): + */ + /*else*/ { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":514 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_9 = 0; + if (unlikely(__pyx_v_bytesvalue == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); + __PYX_ERR(1, 514, __pyx_L1_error) + } + __Pyx_INCREF(__pyx_v_bytesvalue); + __pyx_t_10 = __pyx_v_bytesvalue; + __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10); + __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10)); + for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) { + __pyx_t_11 = __pyx_t_14; + __pyx_v_c = (__pyx_t_11[0]); + + /* "View.MemoryView":515 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_9; + + /* "View.MemoryView":514 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_9 = (__pyx_t_9 + 1); + + /* "View.MemoryView":515 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "View.MemoryView":501 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesvalue); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":518 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t *__pyx_t_4; + char *__pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "View.MemoryView":519 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + */ + __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_self->view.readonly != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":520 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< + * + * if flags & PyBUF_ND: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 520, __pyx_L1_error) + + /* "View.MemoryView":519 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + */ + } + + /* "View.MemoryView":522 + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + * if flags & PyBUF_ND: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":523 + * + * if flags & PyBUF_ND: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_4 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_4; + + /* "View.MemoryView":522 + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + * if flags & PyBUF_ND: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":525 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + /*else*/ { + __pyx_v_info->shape = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":527 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":528 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_4 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_4; + + /* "View.MemoryView":527 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + goto __pyx_L7; + } + + /* "View.MemoryView":530 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L7:; + + /* "View.MemoryView":532 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":533 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_4 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_4; + + /* "View.MemoryView":532 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":535 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L8:; + + /* "View.MemoryView":537 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":538 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_5 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_5; + + /* "View.MemoryView":537 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":540 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L9:; + + /* "View.MemoryView":542 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_6 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_6; + + /* "View.MemoryView":543 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_7 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_7; + + /* "View.MemoryView":544 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = self.view.readonly + */ + __pyx_t_8 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_8; + + /* "View.MemoryView":545 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = self.view.readonly + * info.obj = self + */ + __pyx_t_8 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_8; + + /* "View.MemoryView":546 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = self.view.readonly # <<<<<<<<<<<<<< + * info.obj = self + * + */ + __pyx_t_1 = __pyx_v_self->view.readonly; + __pyx_v_info->readonly = __pyx_t_1; + + /* "View.MemoryView":547 + * info.len = self.view.len + * info.readonly = self.view.readonly + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":518 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":553 + * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":554 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":555 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error) + + /* "View.MemoryView":556 + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + * return result # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":553 + * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":559 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":560 + * @property + * def base(self): + * return self.obj # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->obj); + __pyx_r = __pyx_v_self->obj; + goto __pyx_L0; + + /* "View.MemoryView":559 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":563 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_length; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":564 + * @property + * def shape(self): + * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); + for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { + __pyx_t_2 = __pyx_t_4; + __pyx_v_length = (__pyx_t_2[0]); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":563 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":567 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_stride; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":568 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":570 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 570, __pyx_L1_error) + + /* "View.MemoryView":568 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + } + + /* "View.MemoryView":572 + * raise ValueError("Buffer view does not expose strides") + * + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); + for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { + __pyx_t_3 = __pyx_t_5; + __pyx_v_stride = (__pyx_t_3[0]); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "View.MemoryView":567 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":575 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + Py_ssize_t *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":576 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":577 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__22, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":576 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + } + + /* "View.MemoryView":579 + * return (-1,) * self.view.ndim + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":575 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":582 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":583 + * @property + * def ndim(self): + * return self.view.ndim # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":582 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":586 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":587 + * @property + * def itemsize(self): + * return self.view.itemsize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":586 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":590 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":591 + * @property + * def nbytes(self): + * return self.size * self.view.itemsize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":590 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":594 + * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":595 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":596 + * def size(self): + * if self._size is None: + * result = 1 # <<<<<<<<<<<<<< + * + * for length in self.view.shape[:self.view.ndim]: + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_result = __pyx_int_1; + + /* "View.MemoryView":598 + * result = 1 + * + * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< + * result *= length + * + */ + __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); + for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { + __pyx_t_3 = __pyx_t_5; + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; + + /* "View.MemoryView":599 + * + * for length in self.view.shape[:self.view.ndim]: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + } + + /* "View.MemoryView":601 + * result *= length + * + * self._size = result # <<<<<<<<<<<<<< + * + * return self._size + */ + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_GOTREF(__pyx_v_self->_size); + __Pyx_DECREF(__pyx_v_self->_size); + __pyx_v_self->_size = __pyx_v_result; + + /* "View.MemoryView":595 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + } + + /* "View.MemoryView":603 + * self._size = result + * + * return self._size # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_size); + __pyx_r = __pyx_v_self->_size; + goto __pyx_L0; + + /* "View.MemoryView":594 + * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":605 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":606 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":607 + * def __len__(self): + * if self.view.ndim >= 1: + * return self.view.shape[0] # <<<<<<<<<<<<<< + * + * return 0 + */ + __pyx_r = (__pyx_v_self->view.shape[0]); + goto __pyx_L0; + + /* "View.MemoryView":606 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + } + + /* "View.MemoryView":609 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":605 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":611 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":612 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":613 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "View.MemoryView":612 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":611 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":615 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "View.MemoryView":616 + * + * def __str__(self): + * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":615 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":619 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_c_contig", 0); + + /* "View.MemoryView":622 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + */ + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":623 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< + * + * def is_f_contig(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":619 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":625 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_f_contig", 0); + + /* "View.MemoryView":628 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + */ + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":629 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< + * + * def copy(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":625 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":631 + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_mslice; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy", 0); + + /* "View.MemoryView":633 + * def copy(self): + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &mslice) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); + + /* "View.MemoryView":635 + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * + * slice_copy(self, &mslice) # <<<<<<<<<<<<<< + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); + + /* "View.MemoryView":636 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":641 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< + * + * def copy_fortran(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":631 + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":643 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy_fortran", 0); + + /* "View.MemoryView":645 + * def copy_fortran(self): + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &src) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); + + /* "View.MemoryView":647 + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + * + * slice_copy(self, &src) # <<<<<<<<<<<<<< + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); + + /* "View.MemoryView":648 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":653 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":643 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":657 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + +static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) { + struct __pyx_memoryview_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + + /* "View.MemoryView":658 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":659 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":660 + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_check') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":657 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":663 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("memoryview_check", 0); + + /* "View.MemoryView":664 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + * + * cdef tuple _unellipsify(object index, int ndim): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":663 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":666 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + +static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { + PyObject *__pyx_v_tup = NULL; + PyObject *__pyx_v_result = NULL; + int __pyx_v_have_slices; + int __pyx_v_seen_ellipsis; + CYTHON_UNUSED PyObject *__pyx_v_idx = NULL; + PyObject *__pyx_v_item = NULL; + Py_ssize_t __pyx_v_nslices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_unellipsify", 0); + + /* "View.MemoryView":671 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":672 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + + /* "View.MemoryView":671 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":674 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":676 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":677 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":678 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":679 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; + if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) { + __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 679, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":680 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":681 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":682 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__2); + __Pyx_GIVEREF(__pyx_slice__2); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__2); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":683 + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True # <<<<<<<<<<<<<< + * else: + * result.append(slice(None)) + */ + __pyx_v_seen_ellipsis = 1; + + /* "View.MemoryView":681 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + goto __pyx_L7; + } + + /* "View.MemoryView":685 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":686 + * else: + * result.append(slice(None)) + * have_slices = True # <<<<<<<<<<<<<< + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + */ + __pyx_v_have_slices = 1; + + /* "View.MemoryView":680 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + goto __pyx_L6; + } + + /* "View.MemoryView":688 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + /*else*/ { + __pyx_t_2 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_1 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":689 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_11, 0, 0, 0); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __PYX_ERR(1, 689, __pyx_L1_error) + + /* "View.MemoryView":688 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + } + + /* "View.MemoryView":691 + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< + * result.append(item) + * + */ + __pyx_t_10 = (__pyx_v_have_slices != 0); + if (!__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = (__pyx_t_10 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L11_bool_binop_done:; + __pyx_v_have_slices = __pyx_t_1; + + /* "View.MemoryView":692 + * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error) + } + __pyx_L6:; + + /* "View.MemoryView":679 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":694 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":695 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":696 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__2); + __Pyx_GIVEREF(__pyx_slice__2); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__2); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":695 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + } + + /* "View.MemoryView":698 + * result.extend([slice(None)] * nslices) + * + * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + */ + __Pyx_XDECREF(__pyx_r); + if (!__pyx_v_have_slices) { + } else { + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_11); + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "View.MemoryView":666 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":700 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + */ + +static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) { + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); + + /* "View.MemoryView":701 + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") + */ + __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim); + for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) { + __pyx_t_1 = __pyx_t_3; + __pyx_v_suboffset = (__pyx_t_1[0]); + + /* "View.MemoryView":702 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":703 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 703, __pyx_L1_error) + + /* "View.MemoryView":702 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + } + } + + /* "View.MemoryView":700 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":710 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) { + int __pyx_v_new_ndim; + int __pyx_v_suboffset_dim; + int __pyx_v_dim; + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + __Pyx_memviewslice *__pyx_v_p_src; + struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0; + __Pyx_memviewslice *__pyx_v_p_dst; + int *__pyx_v_p_suboffset_dim; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + int __pyx_v_have_start; + int __pyx_v_have_stop; + int __pyx_v_have_step; + PyObject *__pyx_v_index = NULL; + struct __pyx_memoryview_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + struct __pyx_memoryview_obj *__pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memview_slice", 0); + + /* "View.MemoryView":711 + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): + * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< + * cdef bint negative_step + * cdef __Pyx_memviewslice src, dst + */ + __pyx_v_new_ndim = 0; + __pyx_v_suboffset_dim = -1; + + /* "View.MemoryView":718 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); + + /* "View.MemoryView":722 + * cdef _memoryviewslice memviewsliceobj + * + * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 722, __pyx_L1_error) + } + } + #endif + + /* "View.MemoryView":724 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":725 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":726 + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, &src) + */ + __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); + + /* "View.MemoryView":724 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + goto __pyx_L3; + } + + /* "View.MemoryView":728 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":729 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":735 + * + * + * dst.memview = p_src.memview # <<<<<<<<<<<<<< + * dst.data = p_src.data + * + */ + __pyx_t_4 = __pyx_v_p_src->memview; + __pyx_v_dst.memview = __pyx_t_4; + + /* "View.MemoryView":736 + * + * dst.memview = p_src.memview + * dst.data = p_src.data # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_v_p_src->data; + __pyx_v_dst.data = __pyx_t_5; + + /* "View.MemoryView":741 + * + * + * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< + * cdef int *p_suboffset_dim = &suboffset_dim + * cdef Py_ssize_t start, stop, step + */ + __pyx_v_p_dst = (&__pyx_v_dst); + + /* "View.MemoryView":742 + * + * cdef __Pyx_memviewslice *p_dst = &dst + * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step + * cdef bint have_start, have_stop, have_step + */ + __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); + + /* "View.MemoryView":746 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + __pyx_t_6 = 0; + if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) { + __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 746, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_v_dim = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":747 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":751 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error) + + /* "View.MemoryView":748 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error) + + /* "View.MemoryView":747 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + goto __pyx_L6; + } + + /* "View.MemoryView":754 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":755 + * False) + * elif index is None: + * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + */ + (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; + + /* "View.MemoryView":756 + * elif index is None: + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 + */ + (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; + + /* "View.MemoryView":757 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + + /* "View.MemoryView":758 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 # <<<<<<<<<<<<<< + * else: + * start = index.start or 0 + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + + /* "View.MemoryView":754 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + goto __pyx_L6; + } + + /* "View.MemoryView":760 + * new_ndim += 1 + * else: + * start = index.start or 0 # <<<<<<<<<<<<<< + * stop = index.stop or 0 + * step = index.step or 0 + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":761 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":762 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":764 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":765 + * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":766 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< + * + * slice_memviewslice( + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":768 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error) + + /* "View.MemoryView":774 + * have_start, have_stop, have_step, + * True) + * new_ndim += 1 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + } + __pyx_L6:; + + /* "View.MemoryView":746 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":776 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":777 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":778 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) } + + /* "View.MemoryView":779 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) } + + /* "View.MemoryView":777 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":776 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + } + + /* "View.MemoryView":782 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":783 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":782 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":710 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":807 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) { + Py_ssize_t __pyx_v_new_shape; + int __pyx_v_negative_step; + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":827 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":829 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + __pyx_t_1 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":830 + * + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":829 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + } + + /* "View.MemoryView":831 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_t_1 = (0 <= __pyx_v_start); + if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_start < __pyx_v_shape); + } + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":832 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error) + + /* "View.MemoryView":831 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + } + + /* "View.MemoryView":827 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":835 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + /*else*/ { + __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); + if (__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_1 = ((__pyx_v_step < 0) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L6_bool_binop_done:; + __pyx_v_negative_step = __pyx_t_2; + + /* "View.MemoryView":837 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + __pyx_t_1 = (__pyx_v_have_step != 0); + if (__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_1 = ((__pyx_v_step == 0) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L9_bool_binop_done:; + if (__pyx_t_2) { + + /* "View.MemoryView":838 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error) + + /* "View.MemoryView":837 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + } + + /* "View.MemoryView":841 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":842 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":843 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":844 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":845 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":844 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":842 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + goto __pyx_L12; + } + + /* "View.MemoryView":846 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":847 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":848 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":847 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } + + /* "View.MemoryView":850 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; + + /* "View.MemoryView":846 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + } + __pyx_L12:; + + /* "View.MemoryView":841 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; + } + + /* "View.MemoryView":852 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":853 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":852 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L15; + } + + /* "View.MemoryView":855 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; + + /* "View.MemoryView":857 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":858 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":859 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":860 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":861 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + + /* "View.MemoryView":860 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + } + + /* "View.MemoryView":858 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + goto __pyx_L17; + } + + /* "View.MemoryView":862 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":863 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + + /* "View.MemoryView":862 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + } + __pyx_L17:; + + /* "View.MemoryView":857 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + goto __pyx_L16; + } + + /* "View.MemoryView":865 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":866 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1L; + + /* "View.MemoryView":865 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + goto __pyx_L19; + } + + /* "View.MemoryView":868 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + /*else*/ { + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L19:; + } + __pyx_L16:; + + /* "View.MemoryView":870 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":871 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + + /* "View.MemoryView":870 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + } + + /* "View.MemoryView":875 + * + * with cython.cdivision(True): + * new_shape = (stop - start) // step # <<<<<<<<<<<<<< + * + * if (stop - start) - step * new_shape: + */ + __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); + + /* "View.MemoryView":877 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":878 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + + /* "View.MemoryView":877 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + } + + /* "View.MemoryView":880 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":881 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + + /* "View.MemoryView":880 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + } + + /* "View.MemoryView":884 + * + * + * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset + */ + (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); + + /* "View.MemoryView":885 + * + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< + * dst.suboffsets[new_ndim] = suboffset + * + */ + (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; + + /* "View.MemoryView":886 + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; + } + __pyx_L3:; + + /* "View.MemoryView":889 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":890 + * + * if suboffset_dim[0] < 0: + * dst.data += start * stride # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride + */ + __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); + + /* "View.MemoryView":889 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + goto __pyx_L23; + } + + /* "View.MemoryView":892 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L23:; + + /* "View.MemoryView":894 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":895 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":896 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":897 + * if not is_slice: + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + */ + __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); + + /* "View.MemoryView":896 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + goto __pyx_L26; + } + + /* "View.MemoryView":899 + * dst.data = ( dst.data)[0] + suboffset + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< + * "must be indexed and not sliced", dim) + * else: + */ + /*else*/ { + + /* "View.MemoryView":900 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error) + } + __pyx_L26:; + + /* "View.MemoryView":895 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + goto __pyx_L25; + } + + /* "View.MemoryView":902 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; + + /* "View.MemoryView":894 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + } + + /* "View.MemoryView":904 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":807 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":910 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + +static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_suboffset; + Py_ssize_t __pyx_v_itemsize; + char *__pyx_v_resultp; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pybuffer_index", 0); + + /* "View.MemoryView":912 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1L; + + /* "View.MemoryView":913 + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< + * cdef char *resultp + * + */ + __pyx_t_1 = __pyx_v_view->itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":916 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":917 + * + * if view.ndim == 0: + * shape = view.len / itemsize # <<<<<<<<<<<<<< + * stride = itemsize + * else: + */ + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(1, 917, __pyx_L1_error) + } + else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(1, 917, __pyx_L1_error) + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":918 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":916 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + goto __pyx_L3; + } + + /* "View.MemoryView":920 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":921 + * else: + * shape = view.shape[dim] + * stride = view.strides[dim] # <<<<<<<<<<<<<< + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] + */ + __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); + + /* "View.MemoryView":922 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":923 + * stride = view.strides[dim] + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< + * + * if index < 0: + */ + __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); + + /* "View.MemoryView":922 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + } + } + __pyx_L3:; + + /* "View.MemoryView":925 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":926 + * + * if index < 0: + * index += view.shape[dim] # <<<<<<<<<<<<<< + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + */ + __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); + + /* "View.MemoryView":927 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":928 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 928, __pyx_L1_error) + + /* "View.MemoryView":927 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":925 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + } + + /* "View.MemoryView":930 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":931 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 931, __pyx_L1_error) + + /* "View.MemoryView":930 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":933 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * resultp = bufp + index * stride # <<<<<<<<<<<<<< + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset + */ + __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); + + /* "View.MemoryView":934 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":935 + * resultp = bufp + index * stride + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< + * + * return resultp + */ + __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); + + /* "View.MemoryView":934 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + } + + /* "View.MemoryView":937 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":910 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":943 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + long __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":944 + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: + * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t *shape = memslice.shape + */ + __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; + __pyx_v_ndim = __pyx_t_1; + + /* "View.MemoryView":946 + * cdef int ndim = memslice.memview.view.ndim + * + * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< + * cdef Py_ssize_t *strides = memslice.strides + * + */ + __pyx_t_2 = __pyx_v_memslice->shape; + __pyx_v_shape = __pyx_t_2; + + /* "View.MemoryView":947 + * + * cdef Py_ssize_t *shape = memslice.shape + * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_v_memslice->strides; + __pyx_v_strides = __pyx_t_2; + + /* "View.MemoryView":951 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":952 + * cdef int i, j + * for i in range(ndim / 2): + * j = ndim - 1 - i # <<<<<<<<<<<<<< + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] + */ + __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); + + /* "View.MemoryView":953 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6; + + /* "View.MemoryView":954 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":956 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L6_bool_binop_done:; + if (__pyx_t_7) { + + /* "View.MemoryView":957 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error) + + /* "View.MemoryView":956 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + } + } + + /* "View.MemoryView":959 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":943 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":976 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + +/* Python wrapper */ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":977 + * + * def __dealloc__(self): + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); + + /* "View.MemoryView":976 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":979 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":980 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":981 + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) # <<<<<<<<<<<<<< + * else: + * return memoryview.convert_item_to_object(self, itemp) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":980 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + } + + /* "View.MemoryView":983 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":979 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":985 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":986 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":987 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error) + + /* "View.MemoryView":986 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":989 + * self.to_dtype_func(itemp, value) + * else: + * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< + * + * @property + */ + /*else*/ { + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":985 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":992 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":993 + * @property + * def base(self): + * return self.from_object # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->from_object); + __pyx_r = __pyx_v_self->from_object; + goto __pyx_L0; + + /* "View.MemoryView":992 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":999 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_TypeInfo *__pyx_t_4; + Py_buffer __pyx_t_5; + Py_ssize_t *__pyx_t_6; + Py_ssize_t *__pyx_t_7; + Py_ssize_t *__pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_fromslice", 0); + + /* "View.MemoryView":1007 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1008 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "View.MemoryView":1007 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "View.MemoryView":1013 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1015 + * result = _memoryviewslice(None, 0, dtype_is_object) + * + * result.from_slice = memviewslice # <<<<<<<<<<<<<< + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + */ + __pyx_v_result->from_slice = __pyx_v_memviewslice; + + /* "View.MemoryView":1016 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":1018 + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< + * result.typeinfo = memviewslice.memview.typeinfo + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_result->from_object); + __Pyx_DECREF(__pyx_v_result->from_object); + __pyx_v_result->from_object = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":1019 + * + * result.from_object = ( memviewslice.memview).base + * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< + * + * result.view = memviewslice.memview.view + */ + __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; + __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; + + /* "View.MemoryView":1021 + * result.typeinfo = memviewslice.memview.typeinfo + * + * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + */ + __pyx_t_5 = __pyx_v_memviewslice.memview->view; + __pyx_v_result->__pyx_base.view = __pyx_t_5; + + /* "View.MemoryView":1022 + * + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + */ + __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); + + /* "View.MemoryView":1023 + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data + * result.view.ndim = ndim # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; + + /* "View.MemoryView":1024 + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; + + /* "View.MemoryView":1025 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":1027 + * Py_INCREF(Py_None) + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< + * result.flags = PyBUF_RECORDS + * else: + */ + __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1028 + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * else: + * result.flags = PyBUF_RECORDS_RO + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1027 + * Py_INCREF(Py_None) + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< + * result.flags = PyBUF_RECORDS + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1030 + * result.flags = PyBUF_RECORDS + * else: + * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + /*else*/ { + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO; + } + __pyx_L4:; + + /* "View.MemoryView":1032 + * result.flags = PyBUF_RECORDS_RO + * + * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< + * result.view.strides = result.from_slice.strides + * + */ + __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); + + /* "View.MemoryView":1033 + * + * result.view.shape = result.from_slice.shape + * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); + + /* "View.MemoryView":1036 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1037 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1038 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1039 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":1040 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L6_break; + + /* "View.MemoryView":1038 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L6_break:; + + /* "View.MemoryView":1042 + * break + * + * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< + * for length in result.view.shape[:ndim]: + * result.view.len *= length + */ + __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + + /* "View.MemoryView":1043 + * + * result.view.len = result.view.itemsize + * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< + * result.view.len *= length + * + */ + __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1044 + * result.view.len = result.view.itemsize + * for length in result.view.shape[:ndim]: + * result.view.len *= length # <<<<<<<<<<<<<< + * + * result.to_object_func = to_object_func + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1046 + * result.view.len *= length + * + * result.to_object_func = to_object_func # <<<<<<<<<<<<<< + * result.to_dtype_func = to_dtype_func + * + */ + __pyx_v_result->to_object_func = __pyx_v_to_object_func; + + /* "View.MemoryView":1047 + * + * result.to_object_func = to_object_func + * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; + + /* "View.MemoryView":1049 + * result.to_dtype_func = to_dtype_func + * + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":999 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1052 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + */ + +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) { + struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0; + __Pyx_memviewslice *__pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_slice_from_memview", 0); + + /* "View.MemoryView":1055 + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1056 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1057 + * if isinstance(memview, _memoryviewslice): + * obj = memview + * return &obj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, mslice) + */ + __pyx_r = (&__pyx_v_obj->from_slice); + goto __pyx_L0; + + /* "View.MemoryView":1055 + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1059 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1060 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1052 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice) except NULL: + * cdef _memoryviewslice obj + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1063 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) { + int __pyx_v_dim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + Py_ssize_t *__pyx_v_suboffsets; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1067 + * cdef (Py_ssize_t*) shape, strides, suboffsets + * + * shape = memview.view.shape # <<<<<<<<<<<<<< + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets + */ + __pyx_t_1 = __pyx_v_memview->view.shape; + __pyx_v_shape = __pyx_t_1; + + /* "View.MemoryView":1068 + * + * shape = memview.view.shape + * strides = memview.view.strides # <<<<<<<<<<<<<< + * suboffsets = memview.view.suboffsets + * + */ + __pyx_t_1 = __pyx_v_memview->view.strides; + __pyx_v_strides = __pyx_t_1; + + /* "View.MemoryView":1069 + * shape = memview.view.shape + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< + * + * dst.memview = <__pyx_memoryview *> memview + */ + __pyx_t_1 = __pyx_v_memview->view.suboffsets; + __pyx_v_suboffsets = __pyx_t_1; + + /* "View.MemoryView":1071 + * suboffsets = memview.view.suboffsets + * + * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< + * dst.data = memview.view.buf + * + */ + __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); + + /* "View.MemoryView":1072 + * + * dst.memview = <__pyx_memoryview *> memview + * dst.data = memview.view.buf # <<<<<<<<<<<<<< + * + * for dim in range(memview.view.ndim): + */ + __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); + + /* "View.MemoryView":1074 + * dst.data = memview.view.buf + * + * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + */ + __pyx_t_2 = __pyx_v_memview->view.ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_dim = __pyx_t_4; + + /* "View.MemoryView":1075 + * + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< + * dst.strides[dim] = strides[dim] + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 + */ + (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); + + /* "View.MemoryView":1076 + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 + * + */ + (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); + + /* "View.MemoryView":1077 + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object') + */ + if ((__pyx_v_suboffsets != 0)) { + __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_5 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5; + } + + /* "View.MemoryView":1063 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1080 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) { + __Pyx_memviewslice __pyx_v_memviewslice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy", 0); + + /* "View.MemoryView":1083 + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< + * return memoryview_copy_from_slice(memview, &memviewslice) + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); + + /* "View.MemoryView":1084 + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) + * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object_from_slice') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1080 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1087 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) { + PyObject *(*__pyx_v_to_object_func)(char *); + int (*__pyx_v_to_dtype_func)(char *, PyObject *); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *(*__pyx_t_3)(char *); + int (*__pyx_t_4)(char *, PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); + + /* "View.MemoryView":1094 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1095 + * + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + */ + __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; + __pyx_v_to_object_func = __pyx_t_3; + + /* "View.MemoryView":1096 + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< + * else: + * to_object_func = NULL + */ + __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; + __pyx_v_to_dtype_func = __pyx_t_4; + + /* "View.MemoryView":1094 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1098 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1099 + * else: + * to_object_func = NULL + * to_dtype_func = NULL # <<<<<<<<<<<<<< + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + */ + __pyx_v_to_dtype_func = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":1101 + * to_dtype_func = NULL + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< + * to_object_func, to_dtype_func, + * memview.dtype_is_object) + */ + __Pyx_XDECREF(__pyx_r); + + /* "View.MemoryView":1103 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1087 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1109 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + +static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { + Py_ssize_t __pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":1110 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + __pyx_t_1 = ((__pyx_v_arg < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1111 + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: + * return -arg # <<<<<<<<<<<<<< + * else: + * return arg + */ + __pyx_r = (-__pyx_v_arg); + goto __pyx_L0; + + /* "View.MemoryView":1110 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1113 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1109 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1116 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1121 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1122 + * cdef int i + * cdef Py_ssize_t c_stride = 0 + * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_f_stride = 0; + + /* "View.MemoryView":1124 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1125 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1126 + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1127 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1125 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1129 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_1; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1130 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1131 + * for i in range(ndim): + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1132 + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + */ + goto __pyx_L7_break; + + /* "View.MemoryView":1130 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1134 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1135 + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + * return 'C' # <<<<<<<<<<<<<< + * else: + * return 'F' + */ + __pyx_r = 'C'; + goto __pyx_L0; + + /* "View.MemoryView":1134 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1137 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1116 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1140 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + + /* "View.MemoryView":1147 + * + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + */ + __pyx_v_src_extent = (__pyx_v_src_shape[0]); + + /* "View.MemoryView":1148 + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] + */ + __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); + + /* "View.MemoryView":1149 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1150 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1152 + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1153 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + + /* "View.MemoryView":1154 + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + */ + __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride)); + } + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L5_bool_binop_done:; + + /* "View.MemoryView":1153 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + if (__pyx_t_1) { + + /* "View.MemoryView":1155 + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); + + /* "View.MemoryView":1153 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1157 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1158 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize)); + + /* "View.MemoryView":1159 + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * else: + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1160 + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L4:; + + /* "View.MemoryView":1152 + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1162 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1163 + * else: + * for i in range(dst_extent): + * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< + * dst_data, dst_strides + 1, + * src_shape + 1, dst_shape + 1, + */ + _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); + + /* "View.MemoryView":1167 + * src_shape + 1, dst_shape + 1, + * ndim - 1, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1168 + * ndim - 1, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1140 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + + /* function exit code */ +} + +/* "View.MemoryView":1170 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + +static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + + /* "View.MemoryView":1173 + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< + * src.shape, dst.shape, ndim, itemsize) + * + */ + _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1170 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1177 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef Py_ssize_t shape, size = src.memview.view.itemsize + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + + /* "View.MemoryView":1179 + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for shape in src.shape[:ndim]: + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1181 + * cdef Py_ssize_t shape, size = src.memview.view.itemsize + * + * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<< + * size *= shape + * + */ + __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim); + for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { + __pyx_t_2 = __pyx_t_4; + __pyx_v_shape = (__pyx_t_2[0]); + + /* "View.MemoryView":1182 + * + * for shape in src.shape[:ndim]: + * size *= shape # <<<<<<<<<<<<<< + * + * return size + */ + __pyx_v_size = (__pyx_v_size * __pyx_v_shape); + } + + /* "View.MemoryView":1184 + * size *= shape + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1177 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef Py_ssize_t shape, size = src.memview.view.itemsize + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1187 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1196 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + __pyx_t_1 = ((__pyx_v_order == 'F') != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1197 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride *= shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_idx = __pyx_t_4; + + /* "View.MemoryView":1198 + * if order == 'F': + * for idx in range(ndim): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride *= shape[idx] + * else: + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1199 + * for idx in range(ndim): + * strides[idx] = stride + * stride *= shape[idx] # <<<<<<<<<<<<<< + * else: + * for idx in range(ndim - 1, -1, -1): + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + + /* "View.MemoryView":1196 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1201 + * stride *= shape[idx] + * else: + * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride *= shape[idx] + */ + /*else*/ { + for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1202 + * else: + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride *= shape[idx] + * + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1203 + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride + * stride *= shape[idx] # <<<<<<<<<<<<<< + * + * return stride + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + } + __pyx_L3:; + + /* "View.MemoryView":1205 + * stride *= shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1187 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1208 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) { + int __pyx_v_i; + void *__pyx_v_result; + size_t __pyx_v_itemsize; + size_t __pyx_v_size; + void *__pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + struct __pyx_memoryview_obj *__pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":1219 + * cdef void *result + * + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef size_t size = slice_get_size(src, ndim) + * + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1220 + * + * cdef size_t itemsize = src.memview.view.itemsize + * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< + * + * result = malloc(size) + */ + __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); + + /* "View.MemoryView":1222 + * cdef size_t size = slice_get_size(src, ndim) + * + * result = malloc(size) # <<<<<<<<<<<<<< + * if not result: + * _err(MemoryError, NULL) + */ + __pyx_v_result = malloc(__pyx_v_size); + + /* "View.MemoryView":1223 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1224 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error) + + /* "View.MemoryView":1223 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1227 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1228 + * + * tmpslice.data = result + * tmpslice.memview = src.memview # <<<<<<<<<<<<<< + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + */ + __pyx_t_4 = __pyx_v_src->memview; + __pyx_v_tmpslice->memview = __pyx_t_4; + + /* "View.MemoryView":1229 + * tmpslice.data = result + * tmpslice.memview = src.memview + * for i in range(ndim): # <<<<<<<<<<<<<< + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 + */ + __pyx_t_3 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_3; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1230 + * tmpslice.memview = src.memview + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< + * tmpslice.suboffsets[i] = -1 + * + */ + (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); + + /* "View.MemoryView":1231 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1233 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order)); + + /* "View.MemoryView":1237 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_3; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1238 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1239 + * for i in range(ndim): + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< + * + * if slice_is_contig(src[0], order, ndim): + */ + (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; + + /* "View.MemoryView":1238 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1241 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1242 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size)); + + /* "View.MemoryView":1241 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1244 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1246 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1208 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = NULL; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1251 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + +static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_extents", 0); + + /* "View.MemoryView":1254 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":1253 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 1253, __pyx_L1_error) + + /* "View.MemoryView":1251 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1257 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + +static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_dim", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1258 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 1258, __pyx_L1_error) + + /* "View.MemoryView":1257 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1261 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + +static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1262 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":1263 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 1263, __pyx_L1_error) + + /* "View.MemoryView":1262 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1265 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(1, 1265, __pyx_L1_error) + } + + /* "View.MemoryView":1261 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1268 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + void *__pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":1276 + * Check for overlapping memory and verify the shapes. + * """ + * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + */ + __pyx_v_tmpdata = NULL; + + /* "View.MemoryView":1277 + * """ + * cdef void *tmpdata = NULL + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + */ + __pyx_t_1 = __pyx_v_src.memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1279 + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< + * cdef bint broadcasting = False + * cdef bint direct_copy = False + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); + + /* "View.MemoryView":1280 + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False # <<<<<<<<<<<<<< + * cdef bint direct_copy = False + * cdef __Pyx_memviewslice tmp + */ + __pyx_v_broadcasting = 0; + + /* "View.MemoryView":1281 + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False + * cdef bint direct_copy = False # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice tmp + * + */ + __pyx_v_direct_copy = 0; + + /* "View.MemoryView":1284 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1285 + * + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); + + /* "View.MemoryView":1284 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1286 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1287 + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< + * + * cdef int ndim = max(src_ndim, dst_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); + + /* "View.MemoryView":1286 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1289 + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_3 = __pyx_v_dst_ndim; + __pyx_t_4 = __pyx_v_src_ndim; + if (((__pyx_t_3 > __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_v_ndim = __pyx_t_5; + + /* "View.MemoryView":1291 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_5; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1292 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1293 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1294 + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + * broadcasting = True # <<<<<<<<<<<<<< + * src.strides[i] = 0 + * else: + */ + __pyx_v_broadcasting = 1; + + /* "View.MemoryView":1295 + * if src.shape[i] == 1: + * broadcasting = True + * src.strides[i] = 0 # <<<<<<<<<<<<<< + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) + */ + (__pyx_v_src.strides[__pyx_v_i]) = 0; + + /* "View.MemoryView":1293 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1297 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1292 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1299 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error) + + /* "View.MemoryView":1299 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + } + } + + /* "View.MemoryView":1302 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1304 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1305 + * + * if not slice_is_contig(src, order, ndim): + * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); + + /* "View.MemoryView":1304 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1307 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_7; + + /* "View.MemoryView":1308 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1302 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + } + + /* "View.MemoryView":1310 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1313 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1314 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1313 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1315 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1316 + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); + + /* "View.MemoryView":1315 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1318 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_2 = (__pyx_v_direct_copy != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1320 + * if direct_copy: + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1321 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim))); + + /* "View.MemoryView":1322 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1323 + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1324 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * if order == 'F' == get_best_order(&dst, ndim): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1318 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1310 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1326 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_8 = (__pyx_t_2 != 0); + if (__pyx_t_8) { + + /* "View.MemoryView":1329 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error) + + /* "View.MemoryView":1330 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error) + + /* "View.MemoryView":1326 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1332 + * transpose_memslice(&dst) + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1333 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + */ + copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1334 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1336 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1337 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1268 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1340 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) { + int __pyx_v_i; + int __pyx_v_offset; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1344 + * int ndim_other) nogil: + * cdef int i + * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); + + /* "View.MemoryView":1346 + * cdef int offset = ndim_other - ndim + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1347 + * + * for i in range(ndim - 1, -1, -1): + * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + */ + (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); + + /* "View.MemoryView":1348 + * for i in range(ndim - 1, -1, -1): + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<< + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + * + */ + (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1349 + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1351 + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + * + * for i in range(offset): # <<<<<<<<<<<<<< + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + */ + __pyx_t_1 = __pyx_v_offset; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1352 + * + * for i in range(offset): + * mslice.shape[i] = 1 # <<<<<<<<<<<<<< + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 + */ + (__pyx_v_mslice->shape[__pyx_v_i]) = 1; + + /* "View.MemoryView":1353 + * for i in range(offset): + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< + * mslice.suboffsets[i] = -1 + * + */ + (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); + + /* "View.MemoryView":1354 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1340 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1362 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { + int __pyx_t_1; + + /* "View.MemoryView":1366 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + __pyx_t_1 = (__pyx_v_dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1367 + * + * if dtype_is_object: + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< + * dst.strides, ndim, inc) + * + */ + __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); + + /* "View.MemoryView":1366 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1362 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + + /* function exit code */ +} + +/* "View.MemoryView":1371 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + __Pyx_RefNannyDeclarations + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); + + /* "View.MemoryView":1374 + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); + + /* "View.MemoryView":1371 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif +} + +/* "View.MemoryView":1377 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1381 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1382 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_4 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1383 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_4 = (__pyx_v_inc != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1384 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1383 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1386 + * Py_INCREF(( data)[0]) + * else: + * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + */ + /*else*/ { + Py_DECREF((((PyObject **)__pyx_v_data)[0])); + } + __pyx_L6:; + + /* "View.MemoryView":1382 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1388 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1389 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1391 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1377 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1397 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { + + /* "View.MemoryView":1400 + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1401 + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1403 + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1397 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1407 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + + /* "View.MemoryView":1411 + * size_t itemsize, void *item) nogil: + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t extent = shape[0] + * + */ + __pyx_v_stride = (__pyx_v_strides[0]); + + /* "View.MemoryView":1412 + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] + * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_extent = (__pyx_v_shape[0]); + + /* "View.MemoryView":1414 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1415 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1416 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize)); + + /* "View.MemoryView":1417 + * for i in range(extent): + * memcpy(data, item, itemsize) + * data += stride # <<<<<<<<<<<<<< + * else: + * for i in range(extent): + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + + /* "View.MemoryView":1414 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1419 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1420 + * else: + * for i in range(extent): + * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, itemsize, item) + * data += stride + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1422 + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + * data += stride # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1407 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* function exit code */ +} + +/* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = 0; + PyObject *__pyx_v___pyx_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0); + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":5 + * cdef object __pyx_result + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 6, __pyx_L1_error) + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":7 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "(tree fragment)":9 + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) + __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":10 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":11 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v___pyx_result->name); + __Pyx_DECREF(__pyx_v___pyx_result->name); + __pyx_v___pyx_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 13, __pyx_L1_error) + } + __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 > 1) != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) + __pyx_t_5 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_5; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "(tree fragment)":14 + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 14, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":11 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)o); + p->model_name = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast(PyObject *o) { + struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *p = (struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + Py_CLEAR(p->model_name); + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast[] = { + {"solve", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_3solve, METH_NOARGS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_2solve}, + {"set_new_time_steps", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_5set_new_time_steps, METH_O, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_4set_new_time_steps}, + {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_7get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_6get}, + {"print_statistics", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_9print_statistics, METH_NOARGS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_8print_statistics}, + {"store_iterate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_11store_iterate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_10store_iterate}, + {"load_iterate", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_13load_iterate, METH_O, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_12load_iterate}, + {"get_stats", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_15get_stats, METH_O, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_14get_stats}, + {"get_cost", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_17get_cost, METH_NOARGS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_16get_cost}, + {"get_residuals", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_19get_residuals, METH_NOARGS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_18get_residuals}, + {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_21set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_20set}, + {"cost_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_23cost_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_22cost_set}, + {"constraints_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_25constraints_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_24constraints_set}, + {"dynamics_get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_27dynamics_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_26dynamics_get}, + {"options_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_29options_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_28options_set}, + {"__del__", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_31__del__, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_33__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_15acados_template_21acados_ocp_solver_pyx_19AcadosOcpSolverFast_35__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast = { + PyVarObject_HEAD_INIT(0, 0) + "acados_template.acados_ocp_solver_pyx.AcadosOcpSolverFast", /*tp_name*/ + sizeof(struct __pyx_obj_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "\n Class to interact with the acados ocp solver C object.\n\n :param acados_ocp: type AcadosOcp - description of the OCP for acados\n :param json_file: name for the json file used to render the templated code - default: acados_ocp_nlp.json\n :param simulink_opts: Options to configure Simulink S-function blocks, mainly to activate possible Inputs and Outputs\n ", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; +static struct __pyx_vtabstruct_array __pyx_vtable_array; + +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_array_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_array_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_array; + p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_array(PyObject *o) { + struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_array___dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->mode); + Py_CLEAR(p->_format); + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_array___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { + PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n); + if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + v = __pyx_array___getattr__(o, n); + } + return v; +} + +static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o); +} + +static PyMethodDef __pyx_methods_array[] = { + {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_array[] = { + {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_array = { + __pyx_array___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + __pyx_array___len__, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_array_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + "acados_template.acados_ocp_solver_pyx.array", /*tp_name*/ + sizeof(struct __pyx_array_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_array, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + __pyx_tp_getattro_array, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_array, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_array, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_array, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_MemviewEnum_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_MemviewEnum_obj *)o); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_Enum(PyObject *o) { + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_Enum(PyObject *o) { + PyObject* tmp; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_Enum[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_MemviewEnum = { + PyVarObject_HEAD_INIT(0, 0) + "acados_template.acados_ocp_solver_pyx.Enum", /*tp_name*/ + sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_Enum, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_MemviewEnum___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_Enum, /*tp_traverse*/ + __pyx_tp_clear_Enum, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_Enum, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_MemviewEnum___init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_Enum, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; +static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; + +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryview_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryview_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_memoryview; + p->obj = Py_None; Py_INCREF(Py_None); + p->_size = Py_None; Py_INCREF(Py_None); + p->_array_interface = Py_None; Py_INCREF(Py_None); + p->view.obj = NULL; + if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_memoryview(PyObject *o) { + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_memoryview___dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->obj); + Py_CLEAR(p->_size); + Py_CLEAR(p->_array_interface); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + if (p->obj) { + e = (*v)(p->obj, a); if (e) return e; + } + if (p->_size) { + e = (*v)(p->_size, a); if (e) return e; + } + if (p->_array_interface) { + e = (*v)(p->_array_interface, a); if (e) return e; + } + if (p->view.obj) { + e = (*v)(p->view.obj, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_memoryview(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + tmp = ((PyObject*)p->obj); + p->obj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_size); + p->_size = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_array_interface); + p->_array_interface = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + Py_CLEAR(p->view.obj); + return 0; +} +static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_memoryview___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o); +} + +static PyMethodDef __pyx_methods_memoryview[] = { + {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0}, + {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0}, + {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0}, + {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_memoryview[] = { + {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0}, + {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0}, + {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0}, + {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0}, + {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0}, + {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0}, + {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0}, + {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0}, + {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_memoryview = { + __pyx_memoryview___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_memoryview, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_memoryview = { + __pyx_memoryview___len__, /*mp_length*/ + __pyx_memoryview___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_memoryview = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_memoryview_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_memoryview = { + PyVarObject_HEAD_INIT(0, 0) + "acados_template.acados_ocp_solver_pyx.memoryview", /*tp_name*/ + sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_memoryview___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_memoryview___str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_memoryview, /*tp_traverse*/ + __pyx_tp_clear_memoryview, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_memoryview, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_memoryview, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_memoryview, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; +static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; + +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryviewslice_obj *p; + PyObject *o = __pyx_tp_new_memoryview(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryviewslice_obj *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice; + p->from_object = Py_None; Py_INCREF(Py_None); + p->from_slice.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_memoryviewslice___dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->from_object); + PyObject_GC_Track(o); + __pyx_tp_dealloc_memoryview(o); +} + +static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e; + if (p->from_object) { + e = (*v)(p->from_object, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear__memoryviewslice(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + __pyx_tp_clear_memoryview(o); + tmp = ((PyObject*)p->from_object); + p->from_object = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + __PYX_XDEC_MEMVIEW(&p->from_slice, 1); + return 0; +} + +static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o); +} + +static PyMethodDef __pyx_methods__memoryviewslice[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = { + {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_memoryviewslice = { + PyVarObject_HEAD_INIT(0, 0) + "acados_template.acados_ocp_solver_pyx._memoryviewslice", /*tp_name*/ + sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Internal class for passing memoryview slices to Python", /*tp_doc*/ + __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/ + __pyx_tp_clear__memoryviewslice, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods__memoryviewslice, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets__memoryviewslice, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new__memoryviewslice, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 + 0, /*tp_pypy_flags*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_acados_ocp_solver_pyx(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_acados_ocp_solver_pyx}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "acados_ocp_solver_pyx", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, + {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, + {&__pyx_n_s_AcadosOcpSolverFast, __pyx_k_AcadosOcpSolverFast, sizeof(__pyx_k_AcadosOcpSolverFast), 0, 0, 1, 1}, + {&__pyx_kp_u_AcadosOcpSolver_constraints_set, __pyx_k_AcadosOcpSolver_constraints_set, sizeof(__pyx_k_AcadosOcpSolver_constraints_set), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_cost_set_mismatc, __pyx_k_AcadosOcpSolver_cost_set_mismatc, sizeof(__pyx_k_AcadosOcpSolver_cost_set_mismatc), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_get_field_does_n, __pyx_k_AcadosOcpSolver_get_field_does_n, sizeof(__pyx_k_AcadosOcpSolver_get_field_does_n), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_get_is_an_invali, __pyx_k_AcadosOcpSolver_get_is_an_invali, sizeof(__pyx_k_AcadosOcpSolver_get_is_an_invali), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_get_stage_index, __pyx_k_AcadosOcpSolver_get_stage_index, sizeof(__pyx_k_AcadosOcpSolver_get_stage_index), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_options_set_does, __pyx_k_AcadosOcpSolver_options_set_does, sizeof(__pyx_k_AcadosOcpSolver_options_set_does), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_set_is_not_a_val, __pyx_k_AcadosOcpSolver_set_is_not_a_val, sizeof(__pyx_k_AcadosOcpSolver_set_is_not_a_val), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_set_mismatching, __pyx_k_AcadosOcpSolver_set_mismatching, sizeof(__pyx_k_AcadosOcpSolver_set_mismatching), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_solve_argument_r, __pyx_k_AcadosOcpSolver_solve_argument_r, sizeof(__pyx_k_AcadosOcpSolver_solve_argument_r), 0, 1, 0, 0}, + {&__pyx_kp_u_AcadosOcpSolver_solve_argument_r_2, __pyx_k_AcadosOcpSolver_solve_argument_r_2, sizeof(__pyx_k_AcadosOcpSolver_solve_argument_r_2), 0, 1, 0, 0}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, + {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, + {&__pyx_n_u_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 1, 0, 1}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, + {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0}, + {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, + {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, + {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0}, + {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, + {&__pyx_n_u_SQP_RTI, __pyx_k_SQP_RTI, sizeof(__pyx_k_SQP_RTI), 0, 1, 0, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, + {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, + {&__pyx_n_s_acados_ocp, __pyx_k_acados_ocp, sizeof(__pyx_k_acados_ocp), 0, 0, 1, 1}, + {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_u_alpha_min, __pyx_k_alpha_min, sizeof(__pyx_k_alpha_min), 0, 1, 0, 1}, + {&__pyx_n_u_alpha_reduction, __pyx_k_alpha_reduction, sizeof(__pyx_k_alpha_reduction), 0, 1, 0, 1}, + {&__pyx_n_s_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1}, + {&__pyx_n_s_asfortranarray, __pyx_k_asfortranarray, sizeof(__pyx_k_asfortranarray), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_code_export_dir, __pyx_k_code_export_dir, sizeof(__pyx_k_code_export_dir), 0, 0, 1, 1}, + {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1}, + {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_kp_u_for_field_with_dimension_you_ha, __pyx_k_for_field_with_dimension_you_ha, sizeof(__pyx_k_for_field_with_dimension_you_ha), 0, 1, 0, 0}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_n_u_globalization, __pyx_k_globalization, sizeof(__pyx_k_globalization), 0, 1, 0, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_u_initialize_t_slacks, __pyx_k_initialize_t_slacks, sizeof(__pyx_k_initialize_t_slacks), 0, 1, 0, 1}, + {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, + {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, + {&__pyx_n_u_lam, __pyx_k_lam, sizeof(__pyx_k_lam), 0, 1, 0, 1}, + {&__pyx_n_u_lbu, __pyx_k_lbu, sizeof(__pyx_k_lbu), 0, 1, 0, 1}, + {&__pyx_n_u_lbx, __pyx_k_lbx, sizeof(__pyx_k_lbx), 0, 1, 0, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_model_name, __pyx_k_model_name, sizeof(__pyx_k_model_name), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_nlp_solver_type, __pyx_k_nlp_solver_type, sizeof(__pyx_k_nlp_solver_type), 0, 0, 1, 1}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0}, + {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_overwrite, __pyx_k_overwrite, sizeof(__pyx_k_overwrite), 0, 0, 1, 1}, + {&__pyx_n_u_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 1, 0, 1}, + {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_u_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 1, 0, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, + {&__pyx_n_u_print_level, __pyx_k_print_level, sizeof(__pyx_k_print_level), 0, 1, 0, 1}, + {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_n_u_rti_phase, __pyx_k_rti_phase, sizeof(__pyx_k_rti_phase), 0, 1, 0, 1}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_u_sl, __pyx_k_sl, sizeof(__pyx_k_sl), 0, 1, 0, 1}, + {&__pyx_kp_u_solver_option_must_be_of_type_fl, __pyx_k_solver_option_must_be_of_type_fl, sizeof(__pyx_k_solver_option_must_be_of_type_fl), 0, 1, 0, 0}, + {&__pyx_kp_u_solver_option_must_be_of_type_in, __pyx_k_solver_option_must_be_of_type_in, sizeof(__pyx_k_solver_option_must_be_of_type_in), 0, 1, 0, 0}, + {&__pyx_kp_u_solver_option_must_be_of_type_st, __pyx_k_solver_option_must_be_of_type_st, sizeof(__pyx_k_solver_option_must_be_of_type_st), 0, 1, 0, 0}, + {&__pyx_n_s_solver_options, __pyx_k_solver_options, sizeof(__pyx_k_solver_options), 0, 0, 1, 1}, + {&__pyx_n_s_stage, __pyx_k_stage, sizeof(__pyx_k_stage), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, + {&__pyx_n_u_step_length, __pyx_k_step_length, sizeof(__pyx_k_step_length), 0, 1, 0, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, + {&__pyx_n_u_su, __pyx_k_su, sizeof(__pyx_k_su), 0, 1, 0, 1}, + {&__pyx_n_u_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 1, 0, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_u_tol_comp, __pyx_k_tol_comp, sizeof(__pyx_k_tol_comp), 0, 1, 0, 1}, + {&__pyx_n_u_tol_eq, __pyx_k_tol_eq, sizeof(__pyx_k_tol_eq), 0, 1, 0, 1}, + {&__pyx_n_u_tol_ineq, __pyx_k_tol_ineq, sizeof(__pyx_k_tol_ineq), 0, 1, 0, 1}, + {&__pyx_n_u_tol_stat, __pyx_k_tol_stat, sizeof(__pyx_k_tol_stat), 0, 1, 0, 1}, + {&__pyx_n_u_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 1, 0, 1}, + {&__pyx_n_u_ubu, __pyx_k_ubu, sizeof(__pyx_k_ubu), 0, 1, 0, 1}, + {&__pyx_n_u_ubx, __pyx_k_ubx, sizeof(__pyx_k_ubx), 0, 1, 0, 1}, + {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, + {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, + {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_kp_u_with_dimension_you_have, __pyx_k_with_dimension_you_have, sizeof(__pyx_k_with_dimension_you_have), 0, 1, 0, 0}, + {&__pyx_n_u_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 1, 0, 1}, + {&__pyx_n_u_y_ref, __pyx_k_y_ref, sizeof(__pyx_k_y_ref), 0, 1, 0, 1}, + {&__pyx_n_u_yref, __pyx_k_yref, sizeof(__pyx_k_yref), 0, 1, 0, 1}, + {&__pyx_n_u_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 1, 0, 1}, + {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 116, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "acados_template/acados_ocp_solver_pyx.pyx":300 + * if len(value_shape) == 1: + * value_shape = (value_shape[0], 0) + * value = np.asfortranarray(value_[None,:]) # <<<<<<<<<<<<<< + * + * elif len(value_shape) == 2: + */ + __pyx_slice__2 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__2); + __Pyx_GIVEREF(__pyx_slice__2); + __pyx_tuple__3 = PyTuple_Pack(2, Py_None, __pyx_slice__2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "acados_template/acados_ocp_solver_pyx.pyx":397 + * if field_ == 'rti_phase': + * if value_ < 0 or value_ > 2: + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' # <<<<<<<<<<<<<< + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + * if self.acados_ocp.solver_options.nlp_solver_type != 'SQP_RTI' and value_ > 0: + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_AcadosOcpSolver_solve_argument_r); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "acados_template/acados_ocp_solver_pyx.pyx":400 + * 'take only values 0, 1, 2 for SQP-RTI-type solvers') + * if self.acados_ocp.solver_options.nlp_solver_type != 'SQP_RTI' and value_ > 0: + * raise Exception('AcadosOcpSolver.solve(): argument \'rti_phase\' can ' # <<<<<<<<<<<<<< + * 'take only value 0 for SQP-type solvers') + * + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_AcadosOcpSolver_solve_argument_r_2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":945 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 945, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "../data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.pxd":951 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "View.MemoryView":133 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "View.MemoryView":136 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "View.MemoryView":148 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "View.MemoryView":176 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "View.MemoryView":192 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "View.MemoryView":418 + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: + * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< + * + * have_slices, index = _unellipsify(index, self.view.ndim) + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "View.MemoryView":495 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "View.MemoryView":520 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_WRITABLE and self.view.readonly: + * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< + * + * if flags & PyBUF_ND: + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "View.MemoryView":570 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "View.MemoryView":577 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __pyx_tuple__22 = PyTuple_New(1); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_tuple__22, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "View.MemoryView":703 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "View.MemoryView":286 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "View.MemoryView":287 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "View.MemoryView":288 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "View.MemoryView":291 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "View.MemoryView":292 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_tuple__33 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast.tp_dictoffset && __pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AcadosOcpSolverFast, (PyObject *)&__pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_ptype_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast = &__pyx_type_15acados_template_21acados_ocp_solver_pyx_AcadosOcpSolverFast; + __pyx_vtabptr_array = &__pyx_vtable_array; + __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_array.tp_print = 0; + #endif + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error) + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_MemviewEnum.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error) + __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; + __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; + __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; + __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; + __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment; + __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar; + __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; + __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; + __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_memoryview.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error) + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type___pyx_memoryviewslice.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error) + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initacados_ocp_solver_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initacados_ocp_solver_pyx(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_acados_ocp_solver_pyx(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_acados_ocp_solver_pyx(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_acados_ocp_solver_pyx(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + static PyThread_type_lock __pyx_t_2[8]; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'acados_ocp_solver_pyx' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_acados_ocp_solver_pyx(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("acados_ocp_solver_pyx", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_acados_template__acados_ocp_solver_pyx) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "acados_template.acados_ocp_solver_pyx")) { + if (unlikely(PyDict_SetItemString(modules, "acados_template.acados_ocp_solver_pyx", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "acados_template/acados_ocp_solver_pyx.pyx":46 + * cimport numpy as cnp + * + * import os # <<<<<<<<<<<<<< + * import numpy as np + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":47 + * + * import os + * import numpy as np # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "acados_template/acados_ocp_solver_pyx.pyx":1 + * # -*- coding: future_fstrings -*- # <<<<<<<<<<<<<< + * # + * # Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":209 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * def __dealloc__(array self): + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":286 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":287 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":288 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":291 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":292 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":316 + * + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ + * PyThread_allocate_lock(), + */ + __pyx_memoryview_thread_locks_used = 0; + + /* "View.MemoryView":317 + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< + * PyThread_allocate_lock(), + * PyThread_allocate_lock(), + */ + __pyx_t_2[0] = PyThread_allocate_lock(); + __pyx_t_2[1] = PyThread_allocate_lock(); + __pyx_t_2[2] = PyThread_allocate_lock(); + __pyx_t_2[3] = PyThread_allocate_lock(); + __pyx_t_2[4] = PyThread_allocate_lock(); + __pyx_t_2[5] = PyThread_allocate_lock(); + __pyx_t_2[6] = PyThread_allocate_lock(); + __pyx_t_2[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + + /* "View.MemoryView":549 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":995 + * return self.from_object + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_memoryviewslice_type); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init acados_template.acados_ocp_solver_pyx", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init acados_template.acados_ocp_solver_pyx"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (__Pyx_PyFastCFunction_Check(func)) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* IsLittleEndian */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + +/* BufferFormatCheck */ +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t <= '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case '?': return "'bool'"; + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case '?': case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number, ndim; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ndim = ctx->head->field->type->ndim; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + CYTHON_FALLTHROUGH; + case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) && + (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + CYTHON_FALLTHROUGH; + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} + +/* BufferGetAndValidate */ + static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (unlikely(info->buf == NULL)) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} +static void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static int __Pyx__GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + buf->buf = NULL; + if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) { + __Pyx_ZeroBuffer(buf); + return -1; + } + if (unlikely(buf->ndim != nd)) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if (unlikely((size_t)buf->itemsize != dtype->size)) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_SafeReleaseBuffer(buf); + return -1; +} + +/* BufferIndexError */ + static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +/* GetItemInt */ + static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* MemviewSliceInit */ + static int +__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference) +{ + __Pyx_RefNannyDeclarations + int i, retval=-1; + Py_buffer *buf = &memview->view; + __Pyx_RefNannySetupContext("init_memviewslice", 0); + if (unlikely(memviewslice->memview || memviewslice->data)) { + PyErr_SetString(PyExc_ValueError, + "memviewslice is already initialized!"); + goto fail; + } + if (buf->strides) { + for (i = 0; i < ndim; i++) { + memviewslice->strides[i] = buf->strides[i]; + } + } else { + Py_ssize_t stride = buf->itemsize; + for (i = ndim - 1; i >= 0; i--) { + memviewslice->strides[i] = stride; + stride *= buf->shape[i]; + } + } + for (i = 0; i < ndim; i++) { + memviewslice->shape[i] = buf->shape[i]; + if (buf->suboffsets) { + memviewslice->suboffsets[i] = buf->suboffsets[i]; + } else { + memviewslice->suboffsets[i] = -1; + } + } + memviewslice->memview = memview; + memviewslice->data = (char *)buf->buf; + if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { + Py_INCREF(memview); + } + retval = 0; + goto no_fail; +fail: + memviewslice->memview = 0; + memviewslice->data = 0; + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} +#ifndef Py_NO_RETURN +#define Py_NO_RETURN +#endif +static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN { + va_list vargs; + char msg[200]; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + va_end(vargs); + Py_FatalError(msg); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (unlikely(!memview || (PyObject *) memview == Py_None)) + return; + if (unlikely(__pyx_get_slice_count(memview) < 0)) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (unlikely(first_time)) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (unlikely(!memview || (PyObject *) memview == Py_None)) { + memslice->memview = NULL; + return; + } + if (unlikely(__pyx_get_slice_count(memview) <= 0)) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (unlikely(last_time)) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} + +/* ObjectGetItem */ + #if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* None */ + static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* GetTopmostException */ + #if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* None */ + static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* decode_c_string */ + static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + size_t slen = strlen(cstring); + if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, + "c-string too long to convert to Python"); + return NULL; + } + length = (Py_ssize_t) slen; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + if (unlikely(stop <= start)) + return __Pyx_NewRef(__pyx_empty_unicode); + length = stop - start; + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* GetAttr3 */ + static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* RaiseTooManyValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* RaiseNoneIterError */ + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* SwapException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* FastTypeChecks */ + #if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* None */ + static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +/* ImportFrom */ + static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* HasAttr */ + static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* PyObject_GenericGetAttrNoDict */ + #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ + #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ + static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* SetupReduce */ + static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#else + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#endif +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); + if (likely(reduce_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (reduce == object_reduce || PyErr_Occurred()) { + goto __PYX_BAD; + } + setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); + if (likely(setstate_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (!setstate || PyErr_Occurred()) { + goto __PYX_BAD; + } + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto __PYX_GOOD; +__PYX_BAD: + if (!PyErr_Occurred()) + PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +__PYX_GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* SetVTable */ + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* TypeImport */ + #ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* CLineInTraceback */ + #ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ + #include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if ((0)) {} + view->obj = NULL; + Py_DECREF(obj); +} +#endif + + + /* MemviewSliceIsContig */ + static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs.memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) + return 0; + itemsize *= mvs.shape[index]; + } + return 1; +} + +/* OverlappingSlices */ + static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +/* Capsule */ + static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* TypeInfoCompare */ + static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + if (!a || !b) + return 0; + if (a == b) + return 1; + if (a->size != b->size || a->typegroup != b->typegroup || + a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { + if (a->typegroup == 'H' || b->typegroup == 'H') { + return a->size == b->size; + } else { + return 0; + } + } + if (a->ndim) { + for (i = 0; i < a->ndim; i++) + if (a->arraysize[i] != b->arraysize[i]) + return 0; + } + if (a->typegroup == 'S') { + if (a->flags != b->flags) + return 0; + if (a->fields || b->fields) { + if (!(a->fields && b->fields)) + return 0; + for (i = 0; a->fields[i].type && b->fields[i].type; i++) { + __Pyx_StructField *field_a = a->fields + i; + __Pyx_StructField *field_b = b->fields + i; + if (field_a->offset != field_b->offset || + !__pyx_typeinfo_cmp(field_a->type, field_b->type)) + return 0; + } + return !a->fields[i].type && !b->fields[i].type; + } + } + return 1; +} + +/* MemviewSliceValidateAndInit */ + static int +__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) +{ + if (buf->shape[dim] <= 1) + return 1; + if (buf->strides) { + if (spec & __Pyx_MEMVIEW_CONTIG) { + if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { + if (unlikely(buf->strides[dim] != sizeof(void *))) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly contiguous " + "in dimension %d.", dim); + goto fail; + } + } else if (unlikely(buf->strides[dim] != buf->itemsize)) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_FOLLOW) { + Py_ssize_t stride = buf->strides[dim]; + if (stride < 0) + stride = -stride; + if (unlikely(stride < buf->itemsize)) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + } else { + if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not contiguous in " + "dimension %d", dim); + goto fail; + } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not indirect in " + "dimension %d", dim); + goto fail; + } else if (unlikely(buf->suboffsets)) { + PyErr_SetString(PyExc_ValueError, + "Buffer exposes suboffsets but no strides"); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec) +{ + if (spec & __Pyx_MEMVIEW_DIRECT) { + if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) { + PyErr_Format(PyExc_ValueError, + "Buffer not compatible with direct access " + "in dimension %d.", dim); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_PTR) { + if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly accessible " + "in dimension %d.", dim); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) +{ + int i; + if (c_or_f_flag & __Pyx_IS_F_CONTIG) { + Py_ssize_t stride = 1; + for (i = 0; i < ndim; i++) { + if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) { + PyErr_SetString(PyExc_ValueError, + "Buffer not fortran contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { + Py_ssize_t stride = 1; + for (i = ndim - 1; i >- 1; i--) { + if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) { + PyErr_SetString(PyExc_ValueError, + "Buffer not C contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } + return 1; +fail: + return 0; +} +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj) +{ + struct __pyx_memoryview_obj *memview, *new_memview; + __Pyx_RefNannyDeclarations + Py_buffer *buf; + int i, spec = 0, retval = -1; + __Pyx_BufFmt_Context ctx; + int from_memoryview = __pyx_memoryview_check(original_obj); + __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); + if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) + original_obj)->typeinfo)) { + memview = (struct __pyx_memoryview_obj *) original_obj; + new_memview = NULL; + } else { + memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + original_obj, buf_flags, 0, dtype); + new_memview = memview; + if (unlikely(!memview)) + goto fail; + } + buf = &memview->view; + if (unlikely(buf->ndim != ndim)) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + ndim, buf->ndim); + goto fail; + } + if (new_memview) { + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail; + } + if (unlikely((unsigned) buf->itemsize != dtype->size)) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " + "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", + buf->itemsize, + (buf->itemsize > 1) ? "s" : "", + dtype->name, + dtype->size, + (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->len > 0) { + for (i = 0; i < ndim; i++) { + spec = axes_specs[i]; + if (unlikely(!__pyx_check_strides(buf, i, ndim, spec))) + goto fail; + if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec))) + goto fail; + } + if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))) + goto fail; + } + if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, + new_memview != NULL) == -1)) { + goto fail; + } + retval = 0; + goto no_fail; +fail: + Py_XDECREF(new_memview); + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG, + (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1, + &__Pyx_TypeInfo_double, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG, + (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2, + &__Pyx_TypeInfo_double, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG, + (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1, + &__Pyx_TypeInfo_unsigned_char, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = (float)(1.0) / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + float r = b.real / b.imag; + float s = (float)(1.0) / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_float(a, a); + case 3: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); + case 4: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_float(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = (double)(1.0) / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = (double)(1.0) / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_double(a, a); + case 3: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); + case 4: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_double(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +/* MemviewSliceCopyTemplate */ + static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object) +{ + __Pyx_RefNannyDeclarations + int i; + __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_memoryview_obj *from_memview = from_mvs->memview; + Py_buffer *buf = &from_memview->view; + PyObject *shape_tuple = NULL; + PyObject *temp_int = NULL; + struct __pyx_array_obj *array_obj = NULL; + struct __pyx_memoryview_obj *memview_obj = NULL; + __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); + for (i = 0; i < ndim; i++) { + if (unlikely(from_mvs->suboffsets[i] >= 0)) { + PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " + "indirect dimensions (axis %d)", i); + goto fail; + } + } + shape_tuple = PyTuple_New(ndim); + if (unlikely(!shape_tuple)) { + goto fail; + } + __Pyx_GOTREF(shape_tuple); + for(i = 0; i < ndim; i++) { + temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); + if(unlikely(!temp_int)) { + goto fail; + } else { + PyTuple_SET_ITEM(shape_tuple, i, temp_int); + temp_int = NULL; + } + } + array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); + if (unlikely(!array_obj)) { + goto fail; + } + __Pyx_GOTREF(array_obj); + memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + (PyObject *) array_obj, contig_flag, + dtype_is_object, + from_mvs->memview->typeinfo); + if (unlikely(!memview_obj)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) + goto fail; + if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, + dtype_is_object) < 0)) + goto fail; + goto no_fail; +fail: + __Pyx_XDECREF(new_mvs.memview); + new_mvs.memview = NULL; + new_mvs.data = NULL; +no_fail: + __Pyx_XDECREF(shape_tuple); + __Pyx_XDECREF(temp_int); + __Pyx_XDECREF(array_obj); + __Pyx_RefNannyFinishContext(); + return new_mvs; +} + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ + static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { + return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { + return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { + return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) + case -2: + if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const char neg_one = (char) -1, const_zero = (char) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (char) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) { + return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) { + return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) { + return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (char) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0]) + case -2: + if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + } +#endif + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + char val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (char) -1; + } + } else { + char val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to char"); + return (char) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; +} + +/* CheckBinaryVersion */ + static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so new file mode 100755 index 000000000..b2aded572 Binary files /dev/null and b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so differ diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_solver.pxd b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_solver.pxd new file mode 100644 index 000000000..fc0f0b893 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_solver.pxd @@ -0,0 +1,22 @@ +cimport acados_solver_common + +cdef extern from "acados_solver_long.h": + ctypedef struct nlp_solver_capsule "long_solver_capsule": + pass + + nlp_solver_capsule * acados_create_capsule "long_acados_create_capsule"() + int acados_free_capsule "long_acados_free_capsule"(nlp_solver_capsule *capsule) + + int acados_create "long_acados_create"(nlp_solver_capsule * capsule) + int acados_update_params "long_acados_update_params"(nlp_solver_capsule * capsule, int stage, double *value, int np_) + int acados_solve "long_acados_solve"(nlp_solver_capsule * capsule) + int acados_free "long_acados_free"(nlp_solver_capsule * capsule) + void acados_print_stats "long_acados_print_stats"(nlp_solver_capsule * capsule) + + acados_solver_common.ocp_nlp_in *acados_get_nlp_in "long_acados_get_nlp_in"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_out *acados_get_nlp_out "long_acados_get_nlp_out"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_solver *acados_get_nlp_solver "long_acados_get_nlp_solver"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_config *acados_get_nlp_config "long_acados_get_nlp_config"(nlp_solver_capsule * capsule) + void *acados_get_nlp_opts "long_acados_get_nlp_opts"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_dims *acados_get_nlp_dims "long_acados_get_nlp_dims"(nlp_solver_capsule * capsule) + acados_solver_common.ocp_nlp_plan *acados_get_nlp_plan "long_acados_get_nlp_plan"(nlp_solver_capsule * capsule) diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_solver_long.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_solver_long.c new file mode 100644 index 000000000..9c02c8752 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_solver_long.c @@ -0,0 +1,975 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +// standard +#include +#include +// acados +#include "acados/utils/print.h" +#include "acados_c/ocp_nlp_interface.h" +#include "acados_c/external_function_interface.h" + +// example specific +#include "long_model/long_model.h" + + + +#include "long_constraints/long_h_constraint.h" + + +#include "long_constraints/long_h_e_constraint.h" + +#include "long_cost/long_cost_y_fun.h" +#include "long_cost/long_cost_y_0_fun.h" +#include "long_cost/long_cost_y_e_fun.h" + +#include "acados_solver_long.h" + +#define NX LONG_NX +#define NZ LONG_NZ +#define NU LONG_NU +#define NP LONG_NP +#define NBX LONG_NBX +#define NBX0 LONG_NBX0 +#define NBU LONG_NBU +#define NSBX LONG_NSBX +#define NSBU LONG_NSBU +#define NSH LONG_NSH +#define NSG LONG_NSG +#define NSPHI LONG_NSPHI +#define NSHN LONG_NSHN +#define NSGN LONG_NSGN +#define NSPHIN LONG_NSPHIN +#define NSBXN LONG_NSBXN +#define NS LONG_NS +#define NSN LONG_NSN +#define NG LONG_NG +#define NBXN LONG_NBXN +#define NGN LONG_NGN +#define NY0 LONG_NY0 +#define NY LONG_NY +#define NYN LONG_NYN +// #define N LONG_N +#define NH LONG_NH +#define NPHI LONG_NPHI +#define NHN LONG_NHN +#define NPHIN LONG_NPHIN +#define NR LONG_NR + + +// ** solver data ** + +long_solver_capsule * long_acados_create_capsule(void) +{ + void* capsule_mem = malloc(sizeof(long_solver_capsule)); + long_solver_capsule *capsule = (long_solver_capsule *) capsule_mem; + + return capsule; +} + + +int long_acados_free_capsule(long_solver_capsule *capsule) +{ + free(capsule); + return 0; +} + + +int long_acados_create(long_solver_capsule * capsule) +{ + int N_shooting_intervals = LONG_N; + double* new_time_steps = NULL; // NULL -> don't alter the code generated time-steps + return long_acados_create_with_discretization(capsule, N_shooting_intervals, new_time_steps); +} + +int long_acados_update_time_steps(long_solver_capsule * capsule, int N, double* new_time_steps) +{ + if (N != capsule->nlp_solver_plan->N) { + fprintf(stderr, "long_acados_update_time_steps: given number of time steps (= %d) " \ + "differs from the currently allocated number of " \ + "time steps (= %d)!\n" \ + "Please recreate with new discretization and provide a new vector of time_stamps!\n", + N, capsule->nlp_solver_plan->N); + return 1; + } + + ocp_nlp_config * nlp_config = capsule->nlp_config; + ocp_nlp_dims * nlp_dims = capsule->nlp_dims; + ocp_nlp_in * nlp_in = capsule->nlp_in; + + for (int i = 0; i < N; i++) + { + ocp_nlp_in_set(nlp_config, nlp_dims, nlp_in, i, "Ts", &new_time_steps[i]); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "scaling", &new_time_steps[i]); + } + return 0; +} + +int long_acados_create_with_discretization(long_solver_capsule * capsule, int N, double* new_time_steps) +{ + int status = 0; + // If N does not match the number of shooting intervals used for code generation, new_time_steps must be given. + if (N != LONG_N && !new_time_steps) { + fprintf(stderr, "long_acados_create_with_discretization: new_time_steps is NULL " \ + "but the number of shooting intervals (= %d) differs from the number of " \ + "shooting intervals (= %d) during code generation! Please provide a new vector of time_stamps!\n", \ + N, LONG_N); + return 1; + } + + // number of expected runtime parameters + capsule->nlp_np = NP; + + /************************************************ + * plan & config + ************************************************/ + ocp_nlp_plan * nlp_solver_plan = ocp_nlp_plan_create(N); + capsule->nlp_solver_plan = nlp_solver_plan; + nlp_solver_plan->nlp_solver = SQP_RTI; + + nlp_solver_plan->ocp_qp_solver_plan.qp_solver = PARTIAL_CONDENSING_HPIPM; + + nlp_solver_plan->nlp_cost[0] = NONLINEAR_LS; + for (int i = 1; i < N; i++) + nlp_solver_plan->nlp_cost[i] = NONLINEAR_LS; + + nlp_solver_plan->nlp_cost[N] = NONLINEAR_LS; + + for (int i = 0; i < N; i++) + { + + nlp_solver_plan->nlp_dynamics[i] = CONTINUOUS_MODEL; + nlp_solver_plan->sim_solver_plan[i].sim_solver = ERK; + } + + for (int i = 0; i < N; i++) + { + nlp_solver_plan->nlp_constraints[i] = BGH; + } + nlp_solver_plan->nlp_constraints[N] = BGH; + ocp_nlp_config * nlp_config = ocp_nlp_config_create(*nlp_solver_plan); + capsule->nlp_config = nlp_config; + + + /************************************************ + * dimensions + ************************************************/ + #define NINTNP1MEMS 17 + int* intNp1mem = (int*)malloc( (N+1)*sizeof(int)*NINTNP1MEMS ); + + int* nx = intNp1mem + (N+1)*0; + int* nu = intNp1mem + (N+1)*1; + int* nbx = intNp1mem + (N+1)*2; + int* nbu = intNp1mem + (N+1)*3; + int* nsbx = intNp1mem + (N+1)*4; + int* nsbu = intNp1mem + (N+1)*5; + int* nsg = intNp1mem + (N+1)*6; + int* nsh = intNp1mem + (N+1)*7; + int* nsphi = intNp1mem + (N+1)*8; + int* ns = intNp1mem + (N+1)*9; + int* ng = intNp1mem + (N+1)*10; + int* nh = intNp1mem + (N+1)*11; + int* nphi = intNp1mem + (N+1)*12; + int* nz = intNp1mem + (N+1)*13; + int* ny = intNp1mem + (N+1)*14; + int* nr = intNp1mem + (N+1)*15; + int* nbxe = intNp1mem + (N+1)*16; + + for (int i = 0; i < N+1; i++) + { + // common + nx[i] = NX; + nu[i] = NU; + nz[i] = NZ; + ns[i] = NS; + // cost + ny[i] = NY; + // constraints + nbx[i] = NBX; + nbu[i] = NBU; + nsbx[i] = NSBX; + nsbu[i] = NSBU; + nsg[i] = NSG; + nsh[i] = NSH; + nsphi[i] = NSPHI; + ng[i] = NG; + nh[i] = NH; + nphi[i] = NPHI; + nr[i] = NR; + nbxe[i] = 0; + } + + // for initial state + nbx[0] = NBX0; + nsbx[0] = 0; + ns[0] = NS - NSBX; + nbxe[0] = 3; + ny[0] = NY0; + + // terminal - common + nu[N] = 0; + nz[N] = 0; + ns[N] = NSN; + // cost + ny[N] = NYN; + // constraint + nbx[N] = NBXN; + nbu[N] = 0; + ng[N] = NGN; + nh[N] = NHN; + nphi[N] = NPHIN; + nr[N] = 0; + + nsbx[N] = NSBXN; + nsbu[N] = 0; + nsg[N] = NSGN; + nsh[N] = NSHN; + nsphi[N] = NSPHIN; + + /* create and set ocp_nlp_dims */ + ocp_nlp_dims * nlp_dims = ocp_nlp_dims_create(nlp_config); + capsule->nlp_dims = nlp_dims; + + ocp_nlp_dims_set_opt_vars(nlp_config, nlp_dims, "nx", nx); + ocp_nlp_dims_set_opt_vars(nlp_config, nlp_dims, "nu", nu); + ocp_nlp_dims_set_opt_vars(nlp_config, nlp_dims, "nz", nz); + ocp_nlp_dims_set_opt_vars(nlp_config, nlp_dims, "ns", ns); + + for (int i = 0; i <= N; i++) + { + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nbx", &nbx[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nbu", &nbu[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nsbx", &nsbx[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nsbu", &nsbu[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "ng", &ng[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nsg", &nsg[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nbxe", &nbxe[i]); + } + ocp_nlp_dims_set_cost(nlp_config, nlp_dims, 0, "ny", &ny[0]); + for (int i = 1; i < N; i++) + ocp_nlp_dims_set_cost(nlp_config, nlp_dims, i, "ny", &ny[i]); + + for (int i = 0; i < N; i++) + { + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nh", &nh[i]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, i, "nsh", &nsh[i]); + } + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, N, "nh", &nh[N]); + ocp_nlp_dims_set_constraints(nlp_config, nlp_dims, N, "nsh", &nsh[N]); + ocp_nlp_dims_set_cost(nlp_config, nlp_dims, N, "ny", &ny[N]); + + free(intNp1mem); + + + + /************************************************ + * external functions + ************************************************/ + capsule->nl_constr_h_fun_jac = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->nl_constr_h_fun_jac[i].casadi_fun = &long_constr_h_fun_jac_uxt_zt; + capsule->nl_constr_h_fun_jac[i].casadi_n_in = &long_constr_h_fun_jac_uxt_zt_n_in; + capsule->nl_constr_h_fun_jac[i].casadi_n_out = &long_constr_h_fun_jac_uxt_zt_n_out; + capsule->nl_constr_h_fun_jac[i].casadi_sparsity_in = &long_constr_h_fun_jac_uxt_zt_sparsity_in; + capsule->nl_constr_h_fun_jac[i].casadi_sparsity_out = &long_constr_h_fun_jac_uxt_zt_sparsity_out; + capsule->nl_constr_h_fun_jac[i].casadi_work = &long_constr_h_fun_jac_uxt_zt_work; + external_function_param_casadi_create(&capsule->nl_constr_h_fun_jac[i], 4); + } + capsule->nl_constr_h_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->nl_constr_h_fun[i].casadi_fun = &long_constr_h_fun; + capsule->nl_constr_h_fun[i].casadi_n_in = &long_constr_h_fun_n_in; + capsule->nl_constr_h_fun[i].casadi_n_out = &long_constr_h_fun_n_out; + capsule->nl_constr_h_fun[i].casadi_sparsity_in = &long_constr_h_fun_sparsity_in; + capsule->nl_constr_h_fun[i].casadi_sparsity_out = &long_constr_h_fun_sparsity_out; + capsule->nl_constr_h_fun[i].casadi_work = &long_constr_h_fun_work; + external_function_param_casadi_create(&capsule->nl_constr_h_fun[i], 4); + } + + + capsule->nl_constr_h_e_fun_jac.casadi_fun = &long_constr_h_e_fun_jac_uxt_zt; + capsule->nl_constr_h_e_fun_jac.casadi_n_in = &long_constr_h_e_fun_jac_uxt_zt_n_in; + capsule->nl_constr_h_e_fun_jac.casadi_n_out = &long_constr_h_e_fun_jac_uxt_zt_n_out; + capsule->nl_constr_h_e_fun_jac.casadi_sparsity_in = &long_constr_h_e_fun_jac_uxt_zt_sparsity_in; + capsule->nl_constr_h_e_fun_jac.casadi_sparsity_out = &long_constr_h_e_fun_jac_uxt_zt_sparsity_out; + capsule->nl_constr_h_e_fun_jac.casadi_work = &long_constr_h_e_fun_jac_uxt_zt_work; + external_function_param_casadi_create(&capsule->nl_constr_h_e_fun_jac, 4); + + capsule->nl_constr_h_e_fun.casadi_fun = &long_constr_h_e_fun; + capsule->nl_constr_h_e_fun.casadi_n_in = &long_constr_h_e_fun_n_in; + capsule->nl_constr_h_e_fun.casadi_n_out = &long_constr_h_e_fun_n_out; + capsule->nl_constr_h_e_fun.casadi_sparsity_in = &long_constr_h_e_fun_sparsity_in; + capsule->nl_constr_h_e_fun.casadi_sparsity_out = &long_constr_h_e_fun_sparsity_out; + capsule->nl_constr_h_e_fun.casadi_work = &long_constr_h_e_fun_work; + external_function_param_casadi_create(&capsule->nl_constr_h_e_fun, 4); + + + + + // explicit ode + capsule->forw_vde_casadi = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->forw_vde_casadi[i].casadi_fun = &long_expl_vde_forw; + capsule->forw_vde_casadi[i].casadi_n_in = &long_expl_vde_forw_n_in; + capsule->forw_vde_casadi[i].casadi_n_out = &long_expl_vde_forw_n_out; + capsule->forw_vde_casadi[i].casadi_sparsity_in = &long_expl_vde_forw_sparsity_in; + capsule->forw_vde_casadi[i].casadi_sparsity_out = &long_expl_vde_forw_sparsity_out; + capsule->forw_vde_casadi[i].casadi_work = &long_expl_vde_forw_work; + external_function_param_casadi_create(&capsule->forw_vde_casadi[i], 4); + } + + capsule->expl_ode_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N; i++) { + capsule->expl_ode_fun[i].casadi_fun = &long_expl_ode_fun; + capsule->expl_ode_fun[i].casadi_n_in = &long_expl_ode_fun_n_in; + capsule->expl_ode_fun[i].casadi_n_out = &long_expl_ode_fun_n_out; + capsule->expl_ode_fun[i].casadi_sparsity_in = &long_expl_ode_fun_sparsity_in; + capsule->expl_ode_fun[i].casadi_sparsity_out = &long_expl_ode_fun_sparsity_out; + capsule->expl_ode_fun[i].casadi_work = &long_expl_ode_fun_work; + external_function_param_casadi_create(&capsule->expl_ode_fun[i], 4); + } + + + // nonlinear least square function + capsule->cost_y_0_fun.casadi_fun = &long_cost_y_0_fun; + capsule->cost_y_0_fun.casadi_n_in = &long_cost_y_0_fun_n_in; + capsule->cost_y_0_fun.casadi_n_out = &long_cost_y_0_fun_n_out; + capsule->cost_y_0_fun.casadi_sparsity_in = &long_cost_y_0_fun_sparsity_in; + capsule->cost_y_0_fun.casadi_sparsity_out = &long_cost_y_0_fun_sparsity_out; + capsule->cost_y_0_fun.casadi_work = &long_cost_y_0_fun_work; + external_function_param_casadi_create(&capsule->cost_y_0_fun, 4); + + capsule->cost_y_0_fun_jac_ut_xt.casadi_fun = &long_cost_y_0_fun_jac_ut_xt; + capsule->cost_y_0_fun_jac_ut_xt.casadi_n_in = &long_cost_y_0_fun_jac_ut_xt_n_in; + capsule->cost_y_0_fun_jac_ut_xt.casadi_n_out = &long_cost_y_0_fun_jac_ut_xt_n_out; + capsule->cost_y_0_fun_jac_ut_xt.casadi_sparsity_in = &long_cost_y_0_fun_jac_ut_xt_sparsity_in; + capsule->cost_y_0_fun_jac_ut_xt.casadi_sparsity_out = &long_cost_y_0_fun_jac_ut_xt_sparsity_out; + capsule->cost_y_0_fun_jac_ut_xt.casadi_work = &long_cost_y_0_fun_jac_ut_xt_work; + external_function_param_casadi_create(&capsule->cost_y_0_fun_jac_ut_xt, 4); + + capsule->cost_y_0_hess.casadi_fun = &long_cost_y_0_hess; + capsule->cost_y_0_hess.casadi_n_in = &long_cost_y_0_hess_n_in; + capsule->cost_y_0_hess.casadi_n_out = &long_cost_y_0_hess_n_out; + capsule->cost_y_0_hess.casadi_sparsity_in = &long_cost_y_0_hess_sparsity_in; + capsule->cost_y_0_hess.casadi_sparsity_out = &long_cost_y_0_hess_sparsity_out; + capsule->cost_y_0_hess.casadi_work = &long_cost_y_0_hess_work; + external_function_param_casadi_create(&capsule->cost_y_0_hess, 4); + // nonlinear least squares cost + capsule->cost_y_fun = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N-1; i++) + { + capsule->cost_y_fun[i].casadi_fun = &long_cost_y_fun; + capsule->cost_y_fun[i].casadi_n_in = &long_cost_y_fun_n_in; + capsule->cost_y_fun[i].casadi_n_out = &long_cost_y_fun_n_out; + capsule->cost_y_fun[i].casadi_sparsity_in = &long_cost_y_fun_sparsity_in; + capsule->cost_y_fun[i].casadi_sparsity_out = &long_cost_y_fun_sparsity_out; + capsule->cost_y_fun[i].casadi_work = &long_cost_y_fun_work; + + external_function_param_casadi_create(&capsule->cost_y_fun[i], 4); + } + + capsule->cost_y_fun_jac_ut_xt = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N-1; i++) + { + capsule->cost_y_fun_jac_ut_xt[i].casadi_fun = &long_cost_y_fun_jac_ut_xt; + capsule->cost_y_fun_jac_ut_xt[i].casadi_n_in = &long_cost_y_fun_jac_ut_xt_n_in; + capsule->cost_y_fun_jac_ut_xt[i].casadi_n_out = &long_cost_y_fun_jac_ut_xt_n_out; + capsule->cost_y_fun_jac_ut_xt[i].casadi_sparsity_in = &long_cost_y_fun_jac_ut_xt_sparsity_in; + capsule->cost_y_fun_jac_ut_xt[i].casadi_sparsity_out = &long_cost_y_fun_jac_ut_xt_sparsity_out; + capsule->cost_y_fun_jac_ut_xt[i].casadi_work = &long_cost_y_fun_jac_ut_xt_work; + + external_function_param_casadi_create(&capsule->cost_y_fun_jac_ut_xt[i], 4); + } + + capsule->cost_y_hess = (external_function_param_casadi *) malloc(sizeof(external_function_param_casadi)*N); + for (int i = 0; i < N-1; i++) + { + capsule->cost_y_hess[i].casadi_fun = &long_cost_y_hess; + capsule->cost_y_hess[i].casadi_n_in = &long_cost_y_hess_n_in; + capsule->cost_y_hess[i].casadi_n_out = &long_cost_y_hess_n_out; + capsule->cost_y_hess[i].casadi_sparsity_in = &long_cost_y_hess_sparsity_in; + capsule->cost_y_hess[i].casadi_sparsity_out = &long_cost_y_hess_sparsity_out; + capsule->cost_y_hess[i].casadi_work = &long_cost_y_hess_work; + + external_function_param_casadi_create(&capsule->cost_y_hess[i], 4); + } + // nonlinear least square function + capsule->cost_y_e_fun.casadi_fun = &long_cost_y_e_fun; + capsule->cost_y_e_fun.casadi_n_in = &long_cost_y_e_fun_n_in; + capsule->cost_y_e_fun.casadi_n_out = &long_cost_y_e_fun_n_out; + capsule->cost_y_e_fun.casadi_sparsity_in = &long_cost_y_e_fun_sparsity_in; + capsule->cost_y_e_fun.casadi_sparsity_out = &long_cost_y_e_fun_sparsity_out; + capsule->cost_y_e_fun.casadi_work = &long_cost_y_e_fun_work; + external_function_param_casadi_create(&capsule->cost_y_e_fun, 4); + + capsule->cost_y_e_fun_jac_ut_xt.casadi_fun = &long_cost_y_e_fun_jac_ut_xt; + capsule->cost_y_e_fun_jac_ut_xt.casadi_n_in = &long_cost_y_e_fun_jac_ut_xt_n_in; + capsule->cost_y_e_fun_jac_ut_xt.casadi_n_out = &long_cost_y_e_fun_jac_ut_xt_n_out; + capsule->cost_y_e_fun_jac_ut_xt.casadi_sparsity_in = &long_cost_y_e_fun_jac_ut_xt_sparsity_in; + capsule->cost_y_e_fun_jac_ut_xt.casadi_sparsity_out = &long_cost_y_e_fun_jac_ut_xt_sparsity_out; + capsule->cost_y_e_fun_jac_ut_xt.casadi_work = &long_cost_y_e_fun_jac_ut_xt_work; + external_function_param_casadi_create(&capsule->cost_y_e_fun_jac_ut_xt, 4); + + capsule->cost_y_e_hess.casadi_fun = &long_cost_y_e_hess; + capsule->cost_y_e_hess.casadi_n_in = &long_cost_y_e_hess_n_in; + capsule->cost_y_e_hess.casadi_n_out = &long_cost_y_e_hess_n_out; + capsule->cost_y_e_hess.casadi_sparsity_in = &long_cost_y_e_hess_sparsity_in; + capsule->cost_y_e_hess.casadi_sparsity_out = &long_cost_y_e_hess_sparsity_out; + capsule->cost_y_e_hess.casadi_work = &long_cost_y_e_hess_work; + external_function_param_casadi_create(&capsule->cost_y_e_hess, 4); + + /************************************************ + * nlp_in + ************************************************/ + ocp_nlp_in * nlp_in = ocp_nlp_in_create(nlp_config, nlp_dims); + capsule->nlp_in = nlp_in; + + // set up time_steps + + + if (new_time_steps) { + long_acados_update_time_steps(capsule, N, new_time_steps); + } else {// time_steps are different + double* time_steps = malloc(N*sizeof(double)); + time_steps[0] = 0.059171597633136105; + time_steps[1] = 0.1775147928994083; + time_steps[2] = 0.2958579881656805; + time_steps[3] = 0.4142011834319528; + time_steps[4] = 0.5325443786982247; + time_steps[5] = 0.6508875739644973; + time_steps[6] = 0.7692307692307687; + time_steps[7] = 0.8875739644970424; + time_steps[8] = 1.005917159763312; + time_steps[9] = 1.1242603550295869; + time_steps[10] = 1.2426035502958577; + time_steps[11] = 1.3609467455621314; + long_acados_update_time_steps(capsule, N, time_steps); + free(time_steps); + } + + /**** Dynamics ****/ + for (int i = 0; i < N; i++) + { + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "expl_vde_forw", &capsule->forw_vde_casadi[i]); + ocp_nlp_dynamics_model_set(nlp_config, nlp_dims, nlp_in, i, "expl_ode_fun", &capsule->expl_ode_fun[i]); + + } + + + /**** Cost ****/ + + double* W_0 = calloc(NY0*NY0, sizeof(double)); + // change only the non-zero elements: + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "W", W_0); + free(W_0); + + double* yref_0 = calloc(NY0, sizeof(double)); + // change only the non-zero elements: + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "yref", yref_0); + free(yref_0); + + + + double* W = calloc(NY*NY, sizeof(double)); + // change only the non-zero elements: + + + double* yref = calloc(NY, sizeof(double)); + // change only the non-zero elements: + + for (int i = 1; i < N; i++) + { + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "W", W); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "yref", yref); + } + free(W); + free(yref); + + + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "nls_y_fun", &capsule->cost_y_0_fun); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "nls_y_fun_jac", &capsule->cost_y_0_fun_jac_ut_xt); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, 0, "nls_y_hess", &capsule->cost_y_0_hess); + for (int i = 1; i < N; i++) + { + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "nls_y_fun", &capsule->cost_y_fun[i-1]); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "nls_y_fun_jac", &capsule->cost_y_fun_jac_ut_xt[i-1]); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "nls_y_hess", &capsule->cost_y_hess[i-1]); + } + + + + double* zlumem = calloc(4*NS, sizeof(double)); + double* Zl = zlumem+NS*0; + double* Zu = zlumem+NS*1; + double* zl = zlumem+NS*2; + double* zu = zlumem+NS*3; + // change only the non-zero elements: + + for (int i = 0; i < N; i++) + { + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "Zl", Zl); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "Zu", Zu); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "zl", zl); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, "zu", zu); + } + free(zlumem); + + + // terminal cost + + + double* yref_e = calloc(NYN, sizeof(double)); + // change only the non-zero elements: + + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "yref", yref_e); + free(yref_e); + + double* W_e = calloc(NYN*NYN, sizeof(double)); + // change only the non-zero elements: + + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "W", W_e); + free(W_e); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "nls_y_fun", &capsule->cost_y_e_fun); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "nls_y_fun_jac", &capsule->cost_y_e_fun_jac_ut_xt); + ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, N, "nls_y_hess", &capsule->cost_y_e_hess); + + + + /**** Constraints ****/ + + // bounds for initial stage + + // x0 + int* idxbx0 = malloc(NBX0 * sizeof(int)); + idxbx0[0] = 0; + idxbx0[1] = 1; + idxbx0[2] = 2; + + double* lubx0 = calloc(2*NBX0, sizeof(double)); + double* lbx0 = lubx0; + double* ubx0 = lubx0 + NBX0; + // change only the non-zero elements: + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "idxbx", idxbx0); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "lbx", lbx0); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "ubx", ubx0); + free(idxbx0); + free(lubx0); + + + // idxbxe_0 + int* idxbxe_0 = malloc(3 * sizeof(int)); + + idxbxe_0[0] = 0; + idxbxe_0[1] = 1; + idxbxe_0[2] = 2; + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "idxbxe", idxbxe_0); + free(idxbxe_0); + + + /* constraints that are the same for initial and intermediate */ + + + + + + + + + + // set up soft bounds for nonlinear constraints + int* idxsh = malloc(NSH * sizeof(int)); + + idxsh[0] = 0; + idxsh[1] = 1; + idxsh[2] = 2; + idxsh[3] = 3; + double* lush = calloc(2*NSH, sizeof(double)); + double* lsh = lush; + double* ush = lush + NSH; + + + for (int i = 0; i < N; i++) + { + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "idxsh", idxsh); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "lsh", lsh); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "ush", ush); + } + free(idxsh); + free(lush); + + + + + + + + + + // set up nonlinear constraints for stage 0 to N-1 + double* luh = calloc(2*NH, sizeof(double)); + double* lh = luh; + double* uh = luh + NH; + + + + + uh[0] = 10000; + uh[1] = 10000; + uh[2] = 10000; + uh[3] = 10000; + + for (int i = 0; i < N; i++) + { + // nonlinear constraints for stages 0 to N-1 + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "nl_constr_h_fun_jac", + &capsule->nl_constr_h_fun_jac[i]); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "nl_constr_h_fun", + &capsule->nl_constr_h_fun[i]); + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "lh", lh); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, i, "uh", uh); + } + free(luh); + + + + + /* terminal constraints */ + + + + + + + + + + + + + + // set up nonlinear constraints for last stage + double* luh_e = calloc(2*NHN, sizeof(double)); + double* lh_e = luh_e; + double* uh_e = luh_e + NHN; + + + + uh_e[0] = 10000; + uh_e[1] = 10000; + uh_e[2] = 10000; + uh_e[3] = 10000; + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "nl_constr_h_fun_jac", &capsule->nl_constr_h_e_fun_jac); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "nl_constr_h_fun", &capsule->nl_constr_h_e_fun); + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "lh", lh_e); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, N, "uh", uh_e); + free(luh_e); + + + + + /************************************************ + * opts + ************************************************/ + + capsule->nlp_opts = ocp_nlp_solver_opts_create(nlp_config, nlp_dims); + + + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "globalization", "fixed_step"); + + // set collocation type (relevant for implicit integrators) + sim_collocation_type collocation_type = GAUSS_LEGENDRE; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_collocation_type", &collocation_type); + + // set up sim_method_num_steps + // all sim_method_num_steps are identical + int sim_method_num_steps = 1; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_num_steps", &sim_method_num_steps); + + // set up sim_method_num_stages + // all sim_method_num_stages are identical + int sim_method_num_stages = 4; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_num_stages", &sim_method_num_stages); + + int newton_iter_val = 3; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_newton_iter", &newton_iter_val); + + + // set up sim_method_jac_reuse + bool tmp_bool = (bool) 0; + for (int i = 0; i < N; i++) + ocp_nlp_solver_opts_set_at_stage(nlp_config, capsule->nlp_opts, i, "dynamics_jac_reuse", &tmp_bool); + + double nlp_solver_step_length = 1; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "step_length", &nlp_solver_step_length); + + double levenberg_marquardt = 0; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "levenberg_marquardt", &levenberg_marquardt); + + /* options QP solver */ + int qp_solver_cond_N; + qp_solver_cond_N = 3; + + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "qp_cond_N", &qp_solver_cond_N); + + + int qp_solver_iter_max = 10; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "qp_iter_max", &qp_solver_iter_max); + + int print_level = 0; + ocp_nlp_solver_opts_set(nlp_config, capsule->nlp_opts, "print_level", &print_level); + + + int ext_cost_num_hess = 0; + + + /* out */ + ocp_nlp_out * nlp_out = ocp_nlp_out_create(nlp_config, nlp_dims); + capsule->nlp_out = nlp_out; + + // initialize primal solution + double* xu0 = calloc(NX+NU, sizeof(double)); + double* x0 = xu0; + + // initialize with x0 + + + + double* u0 = xu0 + NX; + + for (int i = 0; i < N; i++) + { + // x0 + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, i, "x", x0); + // u0 + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, i, "u", u0); + } + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, N, "x", x0); + free(xu0); + + capsule->nlp_solver = ocp_nlp_solver_create(nlp_config, nlp_dims, capsule->nlp_opts); + + + + // initialize parameters to nominal value + double* p = calloc(NP, sizeof(double)); + + p[0] = -1.2; + p[1] = 1.2; + + for (int i = 0; i <= N; i++) + { + long_acados_update_params(capsule, i, p, NP); + } + free(p); + + status = ocp_nlp_precompute(capsule->nlp_solver, nlp_in, nlp_out); + + if (status != ACADOS_SUCCESS) + { + printf("\nocp_precompute failed!\n\n"); + exit(1); + } + + return status; +} + + +int long_acados_update_params(long_solver_capsule * capsule, int stage, double *p, int np) +{ + int solver_status = 0; + + int casadi_np = 4; + if (casadi_np != np) { + printf("acados_update_params: trying to set %i parameters for external functions." + " External function has %i parameters. Exiting.\n", np, casadi_np); + exit(1); + } + const int N = capsule->nlp_solver_plan->N; + if (stage < N && stage >= 0) + { + capsule->forw_vde_casadi[stage].set_param(capsule->forw_vde_casadi+stage, p); + capsule->expl_ode_fun[stage].set_param(capsule->expl_ode_fun+stage, p); + + + // constraints + + capsule->nl_constr_h_fun_jac[stage].set_param(capsule->nl_constr_h_fun_jac+stage, p); + capsule->nl_constr_h_fun[stage].set_param(capsule->nl_constr_h_fun+stage, p); + + // cost + if (stage == 0) + { + capsule->cost_y_0_fun.set_param(&capsule->cost_y_0_fun, p); + capsule->cost_y_0_fun_jac_ut_xt.set_param(&capsule->cost_y_0_fun_jac_ut_xt, p); + capsule->cost_y_0_hess.set_param(&capsule->cost_y_0_hess, p); + } + else // 0 < stage < N + { + capsule->cost_y_fun[stage-1].set_param(capsule->cost_y_fun+stage-1, p); + capsule->cost_y_fun_jac_ut_xt[stage-1].set_param(capsule->cost_y_fun_jac_ut_xt+stage-1, p); + capsule->cost_y_hess[stage-1].set_param(capsule->cost_y_hess+stage-1, p); + } + } + + else // stage == N + { + // terminal shooting node has no dynamics + // cost + capsule->cost_y_e_fun.set_param(&capsule->cost_y_e_fun, p); + capsule->cost_y_e_fun_jac_ut_xt.set_param(&capsule->cost_y_e_fun_jac_ut_xt, p); + capsule->cost_y_e_hess.set_param(&capsule->cost_y_e_hess, p); + // constraints + + capsule->nl_constr_h_e_fun_jac.set_param(&capsule->nl_constr_h_e_fun_jac, p); + capsule->nl_constr_h_e_fun.set_param(&capsule->nl_constr_h_e_fun, p); + + } + + + return solver_status; +} + + + +int long_acados_solve(long_solver_capsule * capsule) +{ + // solve NLP + int solver_status = ocp_nlp_solve(capsule->nlp_solver, capsule->nlp_in, capsule->nlp_out); + + return solver_status; +} + + +int long_acados_free(long_solver_capsule * capsule) +{ + // before destroying, keep some info + const int N = capsule->nlp_solver_plan->N; + // free memory + ocp_nlp_solver_opts_destroy(capsule->nlp_opts); + ocp_nlp_in_destroy(capsule->nlp_in); + ocp_nlp_out_destroy(capsule->nlp_out); + ocp_nlp_solver_destroy(capsule->nlp_solver); + ocp_nlp_dims_destroy(capsule->nlp_dims); + ocp_nlp_config_destroy(capsule->nlp_config); + ocp_nlp_plan_destroy(capsule->nlp_solver_plan); + + /* free external function */ + // dynamics + for (int i = 0; i < N; i++) + { + external_function_param_casadi_free(&capsule->forw_vde_casadi[i]); + external_function_param_casadi_free(&capsule->expl_ode_fun[i]); + } + free(capsule->forw_vde_casadi); + free(capsule->expl_ode_fun); + + // cost + external_function_param_casadi_free(&capsule->cost_y_0_fun); + external_function_param_casadi_free(&capsule->cost_y_0_fun_jac_ut_xt); + external_function_param_casadi_free(&capsule->cost_y_0_hess); + for (int i = 0; i < N - 1; i++) + { + external_function_param_casadi_free(&capsule->cost_y_fun[i]); + external_function_param_casadi_free(&capsule->cost_y_fun_jac_ut_xt[i]); + external_function_param_casadi_free(&capsule->cost_y_hess[i]); + } + free(capsule->cost_y_fun); + free(capsule->cost_y_fun_jac_ut_xt); + free(capsule->cost_y_hess); + external_function_param_casadi_free(&capsule->cost_y_e_fun); + external_function_param_casadi_free(&capsule->cost_y_e_fun_jac_ut_xt); + external_function_param_casadi_free(&capsule->cost_y_e_hess); + + // constraints + for (int i = 0; i < N; i++) + { + external_function_param_casadi_free(&capsule->nl_constr_h_fun_jac[i]); + external_function_param_casadi_free(&capsule->nl_constr_h_fun[i]); + } + free(capsule->nl_constr_h_fun_jac); + free(capsule->nl_constr_h_fun); + external_function_param_casadi_free(&capsule->nl_constr_h_e_fun_jac); + external_function_param_casadi_free(&capsule->nl_constr_h_e_fun); + + return 0; +} + +ocp_nlp_in *long_acados_get_nlp_in(long_solver_capsule * capsule) { return capsule->nlp_in; } +ocp_nlp_out *long_acados_get_nlp_out(long_solver_capsule * capsule) { return capsule->nlp_out; } +ocp_nlp_solver *long_acados_get_nlp_solver(long_solver_capsule * capsule) { return capsule->nlp_solver; } +ocp_nlp_config *long_acados_get_nlp_config(long_solver_capsule * capsule) { return capsule->nlp_config; } +void *long_acados_get_nlp_opts(long_solver_capsule * capsule) { return capsule->nlp_opts; } +ocp_nlp_dims *long_acados_get_nlp_dims(long_solver_capsule * capsule) { return capsule->nlp_dims; } +ocp_nlp_plan *long_acados_get_nlp_plan(long_solver_capsule * capsule) { return capsule->nlp_solver_plan; } + + +void long_acados_print_stats(long_solver_capsule * capsule) +{ + int sqp_iter, stat_m, stat_n, tmp_int; + ocp_nlp_get(capsule->nlp_config, capsule->nlp_solver, "sqp_iter", &sqp_iter); + ocp_nlp_get(capsule->nlp_config, capsule->nlp_solver, "stat_n", &stat_n); + ocp_nlp_get(capsule->nlp_config, capsule->nlp_solver, "stat_m", &stat_m); + + + double stat[1000]; + ocp_nlp_get(capsule->nlp_config, capsule->nlp_solver, "statistics", stat); + + int nrow = sqp_iter+1 < stat_m ? sqp_iter+1 : stat_m; + + printf("iter\tres_stat\tres_eq\t\tres_ineq\tres_comp\tqp_stat\tqp_iter\n"); + for (int i = 0; i < nrow; i++) + { + for (int j = 0; j < stat_n + 1; j++) + { + if (j == 0 || j > 4) + { + tmp_int = (int) stat[i + j * nrow]; + printf("%d\t", tmp_int); + } + else + { + printf("%e\t", stat[i + j * nrow]); + } + } + printf("\n"); + } +} + diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_solver_long.h b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_solver_long.h new file mode 100644 index 000000000..dc5d46ee9 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_solver_long.h @@ -0,0 +1,162 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +#ifndef ACADOS_SOLVER_long_H_ +#define ACADOS_SOLVER_long_H_ + +#include "acados_c/ocp_nlp_interface.h" +#include "acados_c/external_function_interface.h" + +#define LONG_NX 3 +#define LONG_NZ 0 +#define LONG_NU 1 +#define LONG_NP 4 +#define LONG_NBX 0 +#define LONG_NBX0 3 +#define LONG_NBU 0 +#define LONG_NSBX 0 +#define LONG_NSBU 0 +#define LONG_NSH 4 +#define LONG_NSG 0 +#define LONG_NSPHI 0 +#define LONG_NSHN 0 +#define LONG_NSGN 0 +#define LONG_NSPHIN 0 +#define LONG_NSBXN 0 +#define LONG_NS 4 +#define LONG_NSN 0 +#define LONG_NG 0 +#define LONG_NBXN 0 +#define LONG_NGN 0 +#define LONG_NY0 6 +#define LONG_NY 6 +#define LONG_NYN 5 +#define LONG_N 12 +#define LONG_NH 4 +#define LONG_NPHI 0 +#define LONG_NHN 4 +#define LONG_NPHIN 0 +#define LONG_NR 0 + +#ifdef __cplusplus +extern "C" { +#endif + +// ** capsule for solver data ** +typedef struct long_solver_capsule +{ + // acados objects + ocp_nlp_in *nlp_in; + ocp_nlp_out *nlp_out; + ocp_nlp_solver *nlp_solver; + void *nlp_opts; + ocp_nlp_plan *nlp_solver_plan; + ocp_nlp_config *nlp_config; + ocp_nlp_dims *nlp_dims; + + // number of expected runtime parameters + unsigned int nlp_np; + + /* external functions */ + // dynamics + + external_function_param_casadi *forw_vde_casadi; + external_function_param_casadi *expl_ode_fun; + + + + + // cost + + external_function_param_casadi *cost_y_fun; + external_function_param_casadi *cost_y_fun_jac_ut_xt; + external_function_param_casadi *cost_y_hess; + + + external_function_param_casadi cost_y_0_fun; + external_function_param_casadi cost_y_0_fun_jac_ut_xt; + external_function_param_casadi cost_y_0_hess; + + + + external_function_param_casadi cost_y_e_fun; + external_function_param_casadi cost_y_e_fun_jac_ut_xt; + external_function_param_casadi cost_y_e_hess; + + + // constraints + external_function_param_casadi *nl_constr_h_fun_jac; + external_function_param_casadi *nl_constr_h_fun; + external_function_param_casadi *nl_constr_h_fun_jac_hess; + + + + external_function_param_casadi nl_constr_h_e_fun_jac; + external_function_param_casadi nl_constr_h_e_fun; + external_function_param_casadi nl_constr_h_e_fun_jac_hess; + +} long_solver_capsule; + +long_solver_capsule * long_acados_create_capsule(void); +int long_acados_free_capsule(long_solver_capsule *capsule); + +int long_acados_create(long_solver_capsule * capsule); +/** + * Generic version of long_acados_create which allows to use a different number of shooting intervals than + * the number used for code generation. If new_time_steps=NULL and n_time_steps matches the number used for code + * generation, the time-steps from code generation is used. + */ +int long_acados_create_with_discretization(long_solver_capsule * capsule, int n_time_steps, double* new_time_steps); +/** + * Update the time step vector. Number N must be identical to the currently set number of shooting nodes in the + * nlp_solver_plan. Returns 0 if no error occurred and a otherwise a value other than 0. + */ +int long_acados_update_time_steps(long_solver_capsule * capsule, int N, double* new_time_steps); +int long_acados_update_params(long_solver_capsule * capsule, int stage, double *value, int np); +int long_acados_solve(long_solver_capsule * capsule); +int long_acados_free(long_solver_capsule * capsule); +void long_acados_print_stats(long_solver_capsule * capsule); + +ocp_nlp_in *long_acados_get_nlp_in(long_solver_capsule * capsule); +ocp_nlp_out *long_acados_get_nlp_out(long_solver_capsule * capsule); +ocp_nlp_solver *long_acados_get_nlp_solver(long_solver_capsule * capsule); +ocp_nlp_config *long_acados_get_nlp_config(long_solver_capsule * capsule); +void *long_acados_get_nlp_opts(long_solver_capsule * capsule); +ocp_nlp_dims *long_acados_get_nlp_dims(long_solver_capsule * capsule); +ocp_nlp_plan *long_acados_get_nlp_plan(long_solver_capsule * capsule); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_SOLVER_long_H_ diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/libacados_ocp_solver_long.so b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/libacados_ocp_solver_long.so new file mode 100755 index 000000000..10156690f Binary files /dev/null and b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/libacados_ocp_solver_long.so differ diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_e_fun.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_e_fun.c new file mode 100644 index 000000000..a4d582291 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_e_fun.c @@ -0,0 +1,145 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_constr_h_e_fun_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[3] = {0, 0, 0}; +static const casadi_int casadi_s2[8] = {4, 1, 0, 4, 0, 1, 2, 3}; + +/* long_constr_h_e_fun:(i0[3],i1[],i2[],i3[4])->(o0[4]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0; + a0=0.; + if (res[0]!=0) res[0][0]=a0; + if (res[0]!=0) res[0][1]=a0; + if (res[0]!=0) res[0][2]=a0; + if (res[0]!=0) res[0][3]=a0; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_constr_h_e_fun(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_constr_h_e_fun_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_constr_h_e_fun_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_constr_h_e_fun_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_constr_h_e_fun_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_constr_h_e_fun_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_constr_h_e_fun_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_constr_h_e_fun_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_constr_h_e_fun_n_in(void) { return 4;} + +CASADI_SYMBOL_EXPORT casadi_int long_constr_h_e_fun_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real long_constr_h_e_fun_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_constr_h_e_fun_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + case 3: return "i3"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_constr_h_e_fun_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_constr_h_e_fun_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s1; + case 3: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_constr_h_e_fun_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_constr_h_e_fun_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 4; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_e_fun_jac_uxt_zt.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_e_fun_jac_uxt_zt.c new file mode 100644 index 000000000..cab4c2174 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_e_fun_jac_uxt_zt.c @@ -0,0 +1,153 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_constr_h_e_fun_jac_uxt_zt_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_s4 CASADI_PREFIX(s4) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[3] = {0, 0, 0}; +static const casadi_int casadi_s2[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s3[7] = {3, 4, 0, 0, 0, 0, 0}; +static const casadi_int casadi_s4[3] = {4, 0, 0}; + +/* long_constr_h_e_fun_jac_uxt_zt:(i0[3],i1[],i2[],i3[4])->(o0[4],o1[3x4,0nz],o2[4x0]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0; + a0=0.; + if (res[0]!=0) res[0][0]=a0; + if (res[0]!=0) res[0][1]=a0; + if (res[0]!=0) res[0][2]=a0; + if (res[0]!=0) res[0][3]=a0; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_constr_h_e_fun_jac_uxt_zt(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_constr_h_e_fun_jac_uxt_zt_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_constr_h_e_fun_jac_uxt_zt_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_constr_h_e_fun_jac_uxt_zt_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_constr_h_e_fun_jac_uxt_zt_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_constr_h_e_fun_jac_uxt_zt_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_constr_h_e_fun_jac_uxt_zt_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_constr_h_e_fun_jac_uxt_zt_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_constr_h_e_fun_jac_uxt_zt_n_in(void) { return 4;} + +CASADI_SYMBOL_EXPORT casadi_int long_constr_h_e_fun_jac_uxt_zt_n_out(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_real long_constr_h_e_fun_jac_uxt_zt_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_constr_h_e_fun_jac_uxt_zt_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + case 3: return "i3"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_constr_h_e_fun_jac_uxt_zt_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + case 1: return "o1"; + case 2: return "o2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_constr_h_e_fun_jac_uxt_zt_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s1; + case 3: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_constr_h_e_fun_jac_uxt_zt_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s2; + case 1: return casadi_s3; + case 2: return casadi_s4; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_constr_h_e_fun_jac_uxt_zt_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 4; + if (sz_res) *sz_res = 3; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_fun.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_fun.c new file mode 100644 index 000000000..f5210e46c --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_fun.c @@ -0,0 +1,172 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_constr_h_fun_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_sq CASADI_PREFIX(sq) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +casadi_real casadi_sq(casadi_real x) { return x*x;} + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[3] = {0, 0, 0}; +static const casadi_int casadi_s3[8] = {4, 1, 0, 4, 0, 1, 2, 3}; + +/* long_constr_h_fun:(i0[3],i1,i2[],i3[4])->(o0[4]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a2, a3, a4; + a0=arg[0]? arg[0][1] : 0; + if (res[0]!=0) res[0][0]=a0; + a1=arg[0]? arg[0][2] : 0; + a2=arg[3]? arg[3][0] : 0; + a2=(a1-a2); + if (res[0]!=0) res[0][1]=a2; + a2=arg[3]? arg[3][1] : 0; + a2=(a2-a1); + if (res[0]!=0) res[0][2]=a2; + a2=arg[3]? arg[3][2] : 0; + a1=arg[0]? arg[0][0] : 0; + a2=(a2-a1); + a1=7.5000000000000000e-01; + a3=casadi_sq(a0); + a4=7.5000000000000000e+00; + a3=(a3/a4); + a4=1.4500000000000000e+00; + a4=(a4*a0); + a3=(a3+a4); + a4=3.; + a3=(a3+a4); + a1=(a1*a3); + a2=(a2-a1); + a1=10.; + a0=(a0+a1); + a2=(a2/a0); + if (res[0]!=0) res[0][3]=a2; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_constr_h_fun(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_constr_h_fun_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_constr_h_fun_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_constr_h_fun_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_constr_h_fun_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_constr_h_fun_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_constr_h_fun_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_constr_h_fun_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_constr_h_fun_n_in(void) { return 4;} + +CASADI_SYMBOL_EXPORT casadi_int long_constr_h_fun_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real long_constr_h_fun_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_constr_h_fun_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + case 3: return "i3"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_constr_h_fun_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_constr_h_fun_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + case 3: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_constr_h_fun_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_constr_h_fun_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 4; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_fun_jac_uxt_zt.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_fun_jac_uxt_zt.c new file mode 100644 index 000000000..7d3c298e9 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_fun_jac_uxt_zt.c @@ -0,0 +1,198 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_constr_h_fun_jac_uxt_zt_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_s4 CASADI_PREFIX(s4) +#define casadi_s5 CASADI_PREFIX(s5) +#define casadi_sq CASADI_PREFIX(sq) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +casadi_real casadi_sq(casadi_real x) { return x*x;} + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[3] = {0, 0, 0}; +static const casadi_int casadi_s3[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s4[12] = {4, 4, 0, 1, 2, 3, 5, 2, 3, 3, 1, 2}; +static const casadi_int casadi_s5[3] = {4, 0, 0}; + +/* long_constr_h_fun_jac_uxt_zt:(i0[3],i1,i2[],i3[4])->(o0[4],o1[4x4,5nz],o2[4x0]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a2, a3, a4, a5; + a0=arg[0]? arg[0][1] : 0; + if (res[0]!=0) res[0][0]=a0; + a1=arg[0]? arg[0][2] : 0; + a2=arg[3]? arg[3][0] : 0; + a2=(a1-a2); + if (res[0]!=0) res[0][1]=a2; + a2=arg[3]? arg[3][1] : 0; + a2=(a2-a1); + if (res[0]!=0) res[0][2]=a2; + a2=arg[3]? arg[3][2] : 0; + a1=arg[0]? arg[0][0] : 0; + a2=(a2-a1); + a1=7.5000000000000000e-01; + a3=casadi_sq(a0); + a4=7.5000000000000000e+00; + a3=(a3/a4); + a4=1.4500000000000000e+00; + a5=(a4*a0); + a3=(a3+a5); + a5=3.; + a3=(a3+a5); + a3=(a1*a3); + a2=(a2-a3); + a3=10.; + a3=(a0+a3); + a2=(a2/a3); + if (res[0]!=0) res[0][3]=a2; + a5=1.; + if (res[1]!=0) res[1][0]=a5; + if (res[1]!=0) res[1][1]=a5; + a5=-1.; + if (res[1]!=0) res[1][2]=a5; + a5=(1./a3); + a5=(-a5); + if (res[1]!=0) res[1][3]=a5; + a5=1.3333333333333333e-01; + a0=(a0+a0); + a5=(a5*a0); + a5=(a5+a4); + a1=(a1*a5); + a1=(a1/a3); + a2=(a2/a3); + a1=(a1+a2); + a1=(-a1); + if (res[1]!=0) res[1][4]=a1; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_constr_h_fun_jac_uxt_zt(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_constr_h_fun_jac_uxt_zt_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_constr_h_fun_jac_uxt_zt_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_constr_h_fun_jac_uxt_zt_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_constr_h_fun_jac_uxt_zt_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_constr_h_fun_jac_uxt_zt_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_constr_h_fun_jac_uxt_zt_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_constr_h_fun_jac_uxt_zt_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_constr_h_fun_jac_uxt_zt_n_in(void) { return 4;} + +CASADI_SYMBOL_EXPORT casadi_int long_constr_h_fun_jac_uxt_zt_n_out(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_real long_constr_h_fun_jac_uxt_zt_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_constr_h_fun_jac_uxt_zt_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + case 3: return "i3"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_constr_h_fun_jac_uxt_zt_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + case 1: return "o1"; + case 2: return "o2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_constr_h_fun_jac_uxt_zt_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + case 3: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_constr_h_fun_jac_uxt_zt_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s3; + case 1: return casadi_s4; + case 2: return casadi_s5; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_constr_h_fun_jac_uxt_zt_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 4; + if (sz_res) *sz_res = 3; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_h_constraint.h b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_h_constraint.h new file mode 100644 index 000000000..eab2d0d9b --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_h_constraint.h @@ -0,0 +1,63 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +#ifndef long_H_CONSTRAINT +#define long_H_CONSTRAINT + +#ifdef __cplusplus +extern "C" { +#endif + + +int long_constr_h_fun_jac_uxt_zt(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_constr_h_fun_jac_uxt_zt_work(int *, int *, int *, int *); +const int *long_constr_h_fun_jac_uxt_zt_sparsity_in(int); +const int *long_constr_h_fun_jac_uxt_zt_sparsity_out(int); +int long_constr_h_fun_jac_uxt_zt_n_in(void); +int long_constr_h_fun_jac_uxt_zt_n_out(void); + +int long_constr_h_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_constr_h_fun_work(int *, int *, int *, int *); +const int *long_constr_h_fun_sparsity_in(int); +const int *long_constr_h_fun_sparsity_out(int); +int long_constr_h_fun_n_in(void); +int long_constr_h_fun_n_out(void); + + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // long_H_CONSTRAINT diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_h_e_constraint.h b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_h_e_constraint.h new file mode 100644 index 000000000..3079bdba0 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_h_e_constraint.h @@ -0,0 +1,64 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef long_H_E_CONSTRAINT +#define long_H_E_CONSTRAINT + +#ifdef __cplusplus +extern "C" { +#endif + + +int long_constr_h_e_fun_jac_uxt_zt(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_constr_h_e_fun_jac_uxt_zt_work(int *, int *, int *, int *); +const int *long_constr_h_e_fun_jac_uxt_zt_sparsity_in(int); +const int *long_constr_h_e_fun_jac_uxt_zt_sparsity_out(int); +int long_constr_h_e_fun_jac_uxt_zt_n_in(void); +int long_constr_h_e_fun_jac_uxt_zt_n_out(void); + +int long_constr_h_e_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_constr_h_e_fun_work(int *, int *, int *, int *); +const int *long_constr_h_e_fun_sparsity_in(int); +const int *long_constr_h_e_fun_sparsity_out(int); +int long_constr_h_e_fun_n_in(void); +int long_constr_h_e_fun_n_out(void); + + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // long_H_E_CONSTRAINT diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun.c new file mode 100644 index 000000000..25c871d67 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun.c @@ -0,0 +1,171 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_cost_y_0_fun_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_sq CASADI_PREFIX(sq) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +casadi_real casadi_sq(casadi_real x) { return x*x;} + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s3[10] = {6, 1, 0, 6, 0, 1, 2, 3, 4, 5}; + +/* long_cost_y_0_fun:(i0[3],i1,i2[4])->(o0[6]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a2, a3, a4; + a0=arg[2]? arg[2][2] : 0; + a1=arg[0]? arg[0][0] : 0; + a0=(a0-a1); + a2=arg[0]? arg[0][1] : 0; + a3=casadi_sq(a2); + a4=7.5000000000000000e+00; + a3=(a3/a4); + a4=1.4500000000000000e+00; + a4=(a4*a2); + a3=(a3+a4); + a4=3.; + a3=(a3+a4); + a0=(a0-a3); + a3=10.; + a3=(a2+a3); + a0=(a0/a3); + if (res[0]!=0) res[0][0]=a0; + if (res[0]!=0) res[0][1]=a1; + if (res[0]!=0) res[0][2]=a2; + a2=arg[0]? arg[0][2] : 0; + if (res[0]!=0) res[0][3]=a2; + a1=20.; + a0=arg[2]? arg[2][3] : 0; + a2=(a2-a0); + a1=(a1*a2); + if (res[0]!=0) res[0][4]=a1; + a1=arg[1]? arg[1][0] : 0; + if (res[0]!=0) res[0][5]=a1; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_fun(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_fun_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_fun_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_0_fun_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_fun_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_0_fun_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_0_fun_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_0_fun_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_0_fun_n_in(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_0_fun_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real long_cost_y_0_fun_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_0_fun_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_0_fun_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_0_fun_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_0_fun_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_fun_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 3; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun.h b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun.h new file mode 100644 index 000000000..928ef7a8c --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun.h @@ -0,0 +1,69 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef long_Y_0_COST +#define long_Y_0_COST + +#ifdef __cplusplus +extern "C" { +#endif + + +int long_cost_y_0_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_cost_y_0_fun_work(int *, int *, int *, int *); +const int *long_cost_y_0_fun_sparsity_in(int); +const int *long_cost_y_0_fun_sparsity_out(int); +int long_cost_y_0_fun_n_in(void); +int long_cost_y_0_fun_n_out(void); + +int long_cost_y_0_fun_jac_ut_xt(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_cost_y_0_fun_jac_ut_xt_work(int *, int *, int *, int *); +const int *long_cost_y_0_fun_jac_ut_xt_sparsity_in(int); +const int *long_cost_y_0_fun_jac_ut_xt_sparsity_out(int); +int long_cost_y_0_fun_jac_ut_xt_n_in(void); +int long_cost_y_0_fun_jac_ut_xt_n_out(void); + +int long_cost_y_0_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_cost_y_0_hess_work(int *, int *, int *, int *); +const int *long_cost_y_0_hess_sparsity_in(int); +const int *long_cost_y_0_hess_sparsity_out(int); +int long_cost_y_0_hess_n_in(void); +int long_cost_y_0_hess_n_out(void); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // long_Y_0_COST diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun_jac_ut_xt.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun_jac_ut_xt.c new file mode 100644 index 000000000..00fc61d33 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun_jac_ut_xt.c @@ -0,0 +1,193 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_cost_y_0_fun_jac_ut_xt_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_s4 CASADI_PREFIX(s4) +#define casadi_sq CASADI_PREFIX(sq) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +casadi_real casadi_sq(casadi_real x) { return x*x;} + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s3[10] = {6, 1, 0, 6, 0, 1, 2, 3, 4, 5}; +static const casadi_int casadi_s4[16] = {4, 6, 0, 2, 3, 4, 5, 6, 7, 1, 2, 1, 2, 3, 3, 0}; + +/* long_cost_y_0_fun_jac_ut_xt:(i0[3],i1,i2[4])->(o0[6],o1[4x6,7nz]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a2, a3, a4, a5, a6; + a0=arg[2]? arg[2][2] : 0; + a1=arg[0]? arg[0][0] : 0; + a0=(a0-a1); + a2=arg[0]? arg[0][1] : 0; + a3=casadi_sq(a2); + a4=7.5000000000000000e+00; + a3=(a3/a4); + a4=1.4500000000000000e+00; + a5=(a4*a2); + a3=(a3+a5); + a5=3.; + a3=(a3+a5); + a0=(a0-a3); + a3=10.; + a3=(a2+a3); + a0=(a0/a3); + if (res[0]!=0) res[0][0]=a0; + if (res[0]!=0) res[0][1]=a1; + if (res[0]!=0) res[0][2]=a2; + a1=arg[0]? arg[0][2] : 0; + if (res[0]!=0) res[0][3]=a1; + a5=20.; + a6=arg[2]? arg[2][3] : 0; + a1=(a1-a6); + a1=(a5*a1); + if (res[0]!=0) res[0][4]=a1; + a1=arg[1]? arg[1][0] : 0; + if (res[0]!=0) res[0][5]=a1; + a1=(1./a3); + a1=(-a1); + if (res[1]!=0) res[1][0]=a1; + a1=1.3333333333333333e-01; + a2=(a2+a2); + a1=(a1*a2); + a1=(a1+a4); + a1=(a1/a3); + a0=(a0/a3); + a1=(a1+a0); + a1=(-a1); + if (res[1]!=0) res[1][1]=a1; + a1=1.; + if (res[1]!=0) res[1][2]=a1; + if (res[1]!=0) res[1][3]=a1; + if (res[1]!=0) res[1][4]=a1; + if (res[1]!=0) res[1][5]=a5; + if (res[1]!=0) res[1][6]=a1; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_fun_jac_ut_xt(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_fun_jac_ut_xt_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_fun_jac_ut_xt_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_0_fun_jac_ut_xt_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_fun_jac_ut_xt_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_0_fun_jac_ut_xt_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_0_fun_jac_ut_xt_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_0_fun_jac_ut_xt_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_0_fun_jac_ut_xt_n_in(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_0_fun_jac_ut_xt_n_out(void) { return 2;} + +CASADI_SYMBOL_EXPORT casadi_real long_cost_y_0_fun_jac_ut_xt_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_0_fun_jac_ut_xt_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_0_fun_jac_ut_xt_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + case 1: return "o1"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_0_fun_jac_ut_xt_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_0_fun_jac_ut_xt_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s3; + case 1: return casadi_s4; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_fun_jac_ut_xt_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 3; + if (sz_res) *sz_res = 2; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_hess.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_hess.c new file mode 100644 index 000000000..d87f8c714 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_hess.c @@ -0,0 +1,194 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_cost_y_0_hess_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_s4 CASADI_PREFIX(s4) +#define casadi_sq CASADI_PREFIX(sq) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +casadi_real casadi_sq(casadi_real x) { return x*x;} + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[10] = {6, 1, 0, 6, 0, 1, 2, 3, 4, 5}; +static const casadi_int casadi_s3[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s4[10] = {4, 4, 0, 0, 1, 3, 3, 2, 1, 2}; + +/* long_cost_y_0_hess:(i0[3],i1,i2[6],i3[4])->(o0[4x4,3nz]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a10, a2, a3, a4, a5, a6, a7, a8, a9; + a0=arg[2]? arg[2][0] : 0; + a1=arg[0]? arg[0][1] : 0; + a2=10.; + a2=(a1+a2); + a3=(1./a2); + a3=(a3/a2); + a3=(a0*a3); + if (res[0]!=0) res[0][0]=a3; + a3=(a0/a2); + a4=(a3/a2); + if (res[0]!=0) res[0][1]=a4; + a5=1.3333333333333333e-01; + a6=(a1+a1); + a6=(a5*a6); + a7=1.4500000000000000e+00; + a6=(a6+a7); + a6=(a6/a2); + a8=arg[3]? arg[3][2] : 0; + a9=arg[0]? arg[0][0] : 0; + a8=(a8-a9); + a9=casadi_sq(a1); + a10=7.5000000000000000e+00; + a9=(a9/a10); + a10=(a7*a1); + a9=(a9+a10); + a10=3.; + a9=(a9+a10); + a8=(a8-a9); + a8=(a8/a2); + a9=(a8/a2); + a6=(a6+a9); + a6=(a6/a2); + a8=(a8/a2); + a8=(a8/a2); + a6=(a6+a8); + a0=(a0*a6); + a7=(a7*a4); + a0=(a0+a7); + a7=2.; + a3=(a5*a3); + a7=(a7*a3); + a1=(a1+a1); + a5=(a5*a4); + a1=(a1*a5); + a7=(a7-a1); + a0=(a0-a7); + if (res[0]!=0) res[0][2]=a0; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_hess(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_hess_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_hess_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_0_hess_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_hess_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_0_hess_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_0_hess_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_0_hess_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_0_hess_n_in(void) { return 4;} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_0_hess_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real long_cost_y_0_hess_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_0_hess_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + case 3: return "i3"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_0_hess_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_0_hess_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + case 3: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_0_hess_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s4; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_cost_y_0_hess_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 4; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun.c new file mode 100644 index 000000000..40e1fc36e --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun.c @@ -0,0 +1,169 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_cost_y_e_fun_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_sq CASADI_PREFIX(sq) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +casadi_real casadi_sq(casadi_real x) { return x*x;} + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[3] = {0, 0, 0}; +static const casadi_int casadi_s2[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s3[9] = {5, 1, 0, 5, 0, 1, 2, 3, 4}; + +/* long_cost_y_e_fun:(i0[3],i1[],i2[4])->(o0[5]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a2, a3, a4; + a0=arg[2]? arg[2][2] : 0; + a1=arg[0]? arg[0][0] : 0; + a0=(a0-a1); + a2=arg[0]? arg[0][1] : 0; + a3=casadi_sq(a2); + a4=7.5000000000000000e+00; + a3=(a3/a4); + a4=1.4500000000000000e+00; + a4=(a4*a2); + a3=(a3+a4); + a4=3.; + a3=(a3+a4); + a0=(a0-a3); + a3=10.; + a3=(a2+a3); + a0=(a0/a3); + if (res[0]!=0) res[0][0]=a0; + if (res[0]!=0) res[0][1]=a1; + if (res[0]!=0) res[0][2]=a2; + a2=arg[0]? arg[0][2] : 0; + if (res[0]!=0) res[0][3]=a2; + a1=20.; + a0=arg[2]? arg[2][3] : 0; + a2=(a2-a0); + a1=(a1*a2); + if (res[0]!=0) res[0][4]=a1; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_fun(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_fun_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_fun_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_e_fun_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_fun_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_e_fun_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_e_fun_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_e_fun_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_e_fun_n_in(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_e_fun_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real long_cost_y_e_fun_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_e_fun_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_e_fun_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_e_fun_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_e_fun_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_fun_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 3; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun.h b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun.h new file mode 100644 index 000000000..41db4d27a --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun.h @@ -0,0 +1,69 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef long_Y_E_COST +#define long_Y_E_COST + +#ifdef __cplusplus +extern "C" { +#endif + + +int long_cost_y_e_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_cost_y_e_fun_work(int *, int *, int *, int *); +const int *long_cost_y_e_fun_sparsity_in(int); +const int *long_cost_y_e_fun_sparsity_out(int); +int long_cost_y_e_fun_n_in(void); +int long_cost_y_e_fun_n_out(void); + +int long_cost_y_e_fun_jac_ut_xt(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_cost_y_e_fun_jac_ut_xt_work(int *, int *, int *, int *); +const int *long_cost_y_e_fun_jac_ut_xt_sparsity_in(int); +const int *long_cost_y_e_fun_jac_ut_xt_sparsity_out(int); +int long_cost_y_e_fun_jac_ut_xt_n_in(void); +int long_cost_y_e_fun_jac_ut_xt_n_out(void); + +int long_cost_y_e_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_cost_y_e_hess_work(int *, int *, int *, int *); +const int *long_cost_y_e_hess_sparsity_in(int); +const int *long_cost_y_e_hess_sparsity_out(int); +int long_cost_y_e_hess_n_in(void); +int long_cost_y_e_hess_n_out(void); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // long_Y_E_COST diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun_jac_ut_xt.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun_jac_ut_xt.c new file mode 100644 index 000000000..36513c8da --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun_jac_ut_xt.c @@ -0,0 +1,190 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_cost_y_e_fun_jac_ut_xt_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_s4 CASADI_PREFIX(s4) +#define casadi_sq CASADI_PREFIX(sq) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +casadi_real casadi_sq(casadi_real x) { return x*x;} + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[3] = {0, 0, 0}; +static const casadi_int casadi_s2[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s3[9] = {5, 1, 0, 5, 0, 1, 2, 3, 4}; +static const casadi_int casadi_s4[14] = {3, 5, 0, 2, 3, 4, 5, 6, 0, 1, 0, 1, 2, 2}; + +/* long_cost_y_e_fun_jac_ut_xt:(i0[3],i1[],i2[4])->(o0[5],o1[3x5,6nz]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a2, a3, a4, a5, a6; + a0=arg[2]? arg[2][2] : 0; + a1=arg[0]? arg[0][0] : 0; + a0=(a0-a1); + a2=arg[0]? arg[0][1] : 0; + a3=casadi_sq(a2); + a4=7.5000000000000000e+00; + a3=(a3/a4); + a4=1.4500000000000000e+00; + a5=(a4*a2); + a3=(a3+a5); + a5=3.; + a3=(a3+a5); + a0=(a0-a3); + a3=10.; + a3=(a2+a3); + a0=(a0/a3); + if (res[0]!=0) res[0][0]=a0; + if (res[0]!=0) res[0][1]=a1; + if (res[0]!=0) res[0][2]=a2; + a1=arg[0]? arg[0][2] : 0; + if (res[0]!=0) res[0][3]=a1; + a5=20.; + a6=arg[2]? arg[2][3] : 0; + a1=(a1-a6); + a1=(a5*a1); + if (res[0]!=0) res[0][4]=a1; + a1=(1./a3); + a1=(-a1); + if (res[1]!=0) res[1][0]=a1; + a1=1.3333333333333333e-01; + a2=(a2+a2); + a1=(a1*a2); + a1=(a1+a4); + a1=(a1/a3); + a0=(a0/a3); + a1=(a1+a0); + a1=(-a1); + if (res[1]!=0) res[1][1]=a1; + a1=1.; + if (res[1]!=0) res[1][2]=a1; + if (res[1]!=0) res[1][3]=a1; + if (res[1]!=0) res[1][4]=a1; + if (res[1]!=0) res[1][5]=a5; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_fun_jac_ut_xt(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_fun_jac_ut_xt_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_fun_jac_ut_xt_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_e_fun_jac_ut_xt_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_fun_jac_ut_xt_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_e_fun_jac_ut_xt_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_e_fun_jac_ut_xt_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_e_fun_jac_ut_xt_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_e_fun_jac_ut_xt_n_in(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_e_fun_jac_ut_xt_n_out(void) { return 2;} + +CASADI_SYMBOL_EXPORT casadi_real long_cost_y_e_fun_jac_ut_xt_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_e_fun_jac_ut_xt_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_e_fun_jac_ut_xt_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + case 1: return "o1"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_e_fun_jac_ut_xt_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_e_fun_jac_ut_xt_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s3; + case 1: return casadi_s4; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_fun_jac_ut_xt_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 3; + if (sz_res) *sz_res = 2; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_hess.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_hess.c new file mode 100644 index 000000000..ba794f055 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_hess.c @@ -0,0 +1,194 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_cost_y_e_hess_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_s4 CASADI_PREFIX(s4) +#define casadi_sq CASADI_PREFIX(sq) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +casadi_real casadi_sq(casadi_real x) { return x*x;} + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[3] = {0, 0, 0}; +static const casadi_int casadi_s2[9] = {5, 1, 0, 5, 0, 1, 2, 3, 4}; +static const casadi_int casadi_s3[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s4[9] = {3, 3, 0, 1, 3, 3, 1, 0, 1}; + +/* long_cost_y_e_hess:(i0[3],i1[],i2[5],i3[4])->(o0[3x3,3nz]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a10, a2, a3, a4, a5, a6, a7, a8, a9; + a0=arg[2]? arg[2][0] : 0; + a1=arg[0]? arg[0][1] : 0; + a2=10.; + a2=(a1+a2); + a3=(1./a2); + a3=(a3/a2); + a3=(a0*a3); + if (res[0]!=0) res[0][0]=a3; + a3=(a0/a2); + a4=(a3/a2); + if (res[0]!=0) res[0][1]=a4; + a5=1.3333333333333333e-01; + a6=(a1+a1); + a6=(a5*a6); + a7=1.4500000000000000e+00; + a6=(a6+a7); + a6=(a6/a2); + a8=arg[3]? arg[3][2] : 0; + a9=arg[0]? arg[0][0] : 0; + a8=(a8-a9); + a9=casadi_sq(a1); + a10=7.5000000000000000e+00; + a9=(a9/a10); + a10=(a7*a1); + a9=(a9+a10); + a10=3.; + a9=(a9+a10); + a8=(a8-a9); + a8=(a8/a2); + a9=(a8/a2); + a6=(a6+a9); + a6=(a6/a2); + a8=(a8/a2); + a8=(a8/a2); + a6=(a6+a8); + a0=(a0*a6); + a7=(a7*a4); + a0=(a0+a7); + a7=2.; + a3=(a5*a3); + a7=(a7*a3); + a1=(a1+a1); + a5=(a5*a4); + a1=(a1*a5); + a7=(a7-a1); + a0=(a0-a7); + if (res[0]!=0) res[0][2]=a0; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_hess(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_hess_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_hess_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_e_hess_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_hess_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_e_hess_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_e_hess_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_e_hess_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_e_hess_n_in(void) { return 4;} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_e_hess_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real long_cost_y_e_hess_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_e_hess_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + case 3: return "i3"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_e_hess_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_e_hess_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + case 3: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_e_hess_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s4; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_cost_y_e_hess_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 4; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun.c new file mode 100644 index 000000000..8ada26e40 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun.c @@ -0,0 +1,171 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_cost_y_fun_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_sq CASADI_PREFIX(sq) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +casadi_real casadi_sq(casadi_real x) { return x*x;} + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s3[10] = {6, 1, 0, 6, 0, 1, 2, 3, 4, 5}; + +/* long_cost_y_fun:(i0[3],i1,i2[4])->(o0[6]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a2, a3, a4; + a0=arg[2]? arg[2][2] : 0; + a1=arg[0]? arg[0][0] : 0; + a0=(a0-a1); + a2=arg[0]? arg[0][1] : 0; + a3=casadi_sq(a2); + a4=7.5000000000000000e+00; + a3=(a3/a4); + a4=1.4500000000000000e+00; + a4=(a4*a2); + a3=(a3+a4); + a4=3.; + a3=(a3+a4); + a0=(a0-a3); + a3=10.; + a3=(a2+a3); + a0=(a0/a3); + if (res[0]!=0) res[0][0]=a0; + if (res[0]!=0) res[0][1]=a1; + if (res[0]!=0) res[0][2]=a2; + a2=arg[0]? arg[0][2] : 0; + if (res[0]!=0) res[0][3]=a2; + a1=20.; + a0=arg[2]? arg[2][3] : 0; + a2=(a2-a0); + a1=(a1*a2); + if (res[0]!=0) res[0][4]=a1; + a1=arg[1]? arg[1][0] : 0; + if (res[0]!=0) res[0][5]=a1; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_fun(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_cost_y_fun_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_fun_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_fun_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_cost_y_fun_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_fun_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_fun_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_fun_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_fun_n_in(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_fun_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real long_cost_y_fun_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_fun_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_fun_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_fun_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_fun_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_cost_y_fun_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 3; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun.h b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun.h new file mode 100644 index 000000000..63e9d84c0 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun.h @@ -0,0 +1,69 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef long_Y_COST +#define long_Y_COST + +#ifdef __cplusplus +extern "C" { +#endif + + +int long_cost_y_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_cost_y_fun_work(int *, int *, int *, int *); +const int *long_cost_y_fun_sparsity_in(int); +const int *long_cost_y_fun_sparsity_out(int); +int long_cost_y_fun_n_in(void); +int long_cost_y_fun_n_out(void); + +int long_cost_y_fun_jac_ut_xt(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_cost_y_fun_jac_ut_xt_work(int *, int *, int *, int *); +const int *long_cost_y_fun_jac_ut_xt_sparsity_in(int); +const int *long_cost_y_fun_jac_ut_xt_sparsity_out(int); +int long_cost_y_fun_jac_ut_xt_n_in(void); +int long_cost_y_fun_jac_ut_xt_n_out(void); + +int long_cost_y_hess(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_cost_y_hess_work(int *, int *, int *, int *); +const int *long_cost_y_hess_sparsity_in(int); +const int *long_cost_y_hess_sparsity_out(int); +int long_cost_y_hess_n_in(void); +int long_cost_y_hess_n_out(void); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // long_Y_COST diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun_jac_ut_xt.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun_jac_ut_xt.c new file mode 100644 index 000000000..ddb9d82c8 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun_jac_ut_xt.c @@ -0,0 +1,193 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_cost_y_fun_jac_ut_xt_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_s4 CASADI_PREFIX(s4) +#define casadi_sq CASADI_PREFIX(sq) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +casadi_real casadi_sq(casadi_real x) { return x*x;} + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s3[10] = {6, 1, 0, 6, 0, 1, 2, 3, 4, 5}; +static const casadi_int casadi_s4[16] = {4, 6, 0, 2, 3, 4, 5, 6, 7, 1, 2, 1, 2, 3, 3, 0}; + +/* long_cost_y_fun_jac_ut_xt:(i0[3],i1,i2[4])->(o0[6],o1[4x6,7nz]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a2, a3, a4, a5, a6; + a0=arg[2]? arg[2][2] : 0; + a1=arg[0]? arg[0][0] : 0; + a0=(a0-a1); + a2=arg[0]? arg[0][1] : 0; + a3=casadi_sq(a2); + a4=7.5000000000000000e+00; + a3=(a3/a4); + a4=1.4500000000000000e+00; + a5=(a4*a2); + a3=(a3+a5); + a5=3.; + a3=(a3+a5); + a0=(a0-a3); + a3=10.; + a3=(a2+a3); + a0=(a0/a3); + if (res[0]!=0) res[0][0]=a0; + if (res[0]!=0) res[0][1]=a1; + if (res[0]!=0) res[0][2]=a2; + a1=arg[0]? arg[0][2] : 0; + if (res[0]!=0) res[0][3]=a1; + a5=20.; + a6=arg[2]? arg[2][3] : 0; + a1=(a1-a6); + a1=(a5*a1); + if (res[0]!=0) res[0][4]=a1; + a1=arg[1]? arg[1][0] : 0; + if (res[0]!=0) res[0][5]=a1; + a1=(1./a3); + a1=(-a1); + if (res[1]!=0) res[1][0]=a1; + a1=1.3333333333333333e-01; + a2=(a2+a2); + a1=(a1*a2); + a1=(a1+a4); + a1=(a1/a3); + a0=(a0/a3); + a1=(a1+a0); + a1=(-a1); + if (res[1]!=0) res[1][1]=a1; + a1=1.; + if (res[1]!=0) res[1][2]=a1; + if (res[1]!=0) res[1][3]=a1; + if (res[1]!=0) res[1][4]=a1; + if (res[1]!=0) res[1][5]=a5; + if (res[1]!=0) res[1][6]=a1; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_fun_jac_ut_xt(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_cost_y_fun_jac_ut_xt_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_fun_jac_ut_xt_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_fun_jac_ut_xt_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_cost_y_fun_jac_ut_xt_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_fun_jac_ut_xt_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_fun_jac_ut_xt_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_fun_jac_ut_xt_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_fun_jac_ut_xt_n_in(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_fun_jac_ut_xt_n_out(void) { return 2;} + +CASADI_SYMBOL_EXPORT casadi_real long_cost_y_fun_jac_ut_xt_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_fun_jac_ut_xt_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_fun_jac_ut_xt_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + case 1: return "o1"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_fun_jac_ut_xt_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_fun_jac_ut_xt_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s3; + case 1: return casadi_s4; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_cost_y_fun_jac_ut_xt_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 3; + if (sz_res) *sz_res = 2; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_hess.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_hess.c new file mode 100644 index 000000000..ea04b4973 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_hess.c @@ -0,0 +1,194 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_cost_y_hess_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) +#define casadi_s4 CASADI_PREFIX(s4) +#define casadi_sq CASADI_PREFIX(sq) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +casadi_real casadi_sq(casadi_real x) { return x*x;} + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[10] = {6, 1, 0, 6, 0, 1, 2, 3, 4, 5}; +static const casadi_int casadi_s3[8] = {4, 1, 0, 4, 0, 1, 2, 3}; +static const casadi_int casadi_s4[10] = {4, 4, 0, 0, 1, 3, 3, 2, 1, 2}; + +/* long_cost_y_hess:(i0[3],i1,i2[6],i3[4])->(o0[4x4,3nz]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1, a10, a2, a3, a4, a5, a6, a7, a8, a9; + a0=arg[2]? arg[2][0] : 0; + a1=arg[0]? arg[0][1] : 0; + a2=10.; + a2=(a1+a2); + a3=(1./a2); + a3=(a3/a2); + a3=(a0*a3); + if (res[0]!=0) res[0][0]=a3; + a3=(a0/a2); + a4=(a3/a2); + if (res[0]!=0) res[0][1]=a4; + a5=1.3333333333333333e-01; + a6=(a1+a1); + a6=(a5*a6); + a7=1.4500000000000000e+00; + a6=(a6+a7); + a6=(a6/a2); + a8=arg[3]? arg[3][2] : 0; + a9=arg[0]? arg[0][0] : 0; + a8=(a8-a9); + a9=casadi_sq(a1); + a10=7.5000000000000000e+00; + a9=(a9/a10); + a10=(a7*a1); + a9=(a9+a10); + a10=3.; + a9=(a9+a10); + a8=(a8-a9); + a8=(a8/a2); + a9=(a8/a2); + a6=(a6+a9); + a6=(a6/a2); + a8=(a8/a2); + a8=(a8/a2); + a6=(a6+a8); + a0=(a0*a6); + a7=(a7*a4); + a0=(a0+a7); + a7=2.; + a3=(a5*a3); + a7=(a7*a3); + a1=(a1+a1); + a5=(a5*a4); + a1=(a1*a5); + a7=(a7-a1); + a0=(a0-a7); + if (res[0]!=0) res[0][2]=a0; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_hess(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_cost_y_hess_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_cost_y_hess_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_hess_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_cost_y_hess_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_cost_y_hess_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_hess_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_cost_y_hess_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_hess_n_in(void) { return 4;} + +CASADI_SYMBOL_EXPORT casadi_int long_cost_y_hess_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real long_cost_y_hess_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_hess_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + case 3: return "i3"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_cost_y_hess_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_hess_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + case 3: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_hess_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s4; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_cost_y_hess_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 4; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_model/long_expl_ode_fun.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_model/long_expl_ode_fun.c new file mode 100644 index 000000000..2ca6c2530 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_model/long_expl_ode_fun.c @@ -0,0 +1,144 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_expl_ode_fun_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[8] = {4, 1, 0, 4, 0, 1, 2, 3}; + +/* long_expl_ode_fun:(i0[3],i1,i2[4])->(o0[3]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0; + a0=arg[0]? arg[0][1] : 0; + if (res[0]!=0) res[0][0]=a0; + a0=arg[0]? arg[0][2] : 0; + if (res[0]!=0) res[0][1]=a0; + a0=arg[1]? arg[1][0] : 0; + if (res[0]!=0) res[0][2]=a0; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_expl_ode_fun(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_expl_ode_fun_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_expl_ode_fun_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_expl_ode_fun_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_expl_ode_fun_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_expl_ode_fun_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_expl_ode_fun_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_expl_ode_fun_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_expl_ode_fun_n_in(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_int long_expl_ode_fun_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real long_expl_ode_fun_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_expl_ode_fun_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_expl_ode_fun_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_expl_ode_fun_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_expl_ode_fun_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_expl_ode_fun_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 3; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_model/long_expl_vde_adj.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_model/long_expl_vde_adj.c new file mode 100644 index 000000000..578f27265 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_model/long_expl_vde_adj.c @@ -0,0 +1,148 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_expl_vde_adj_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s2[8] = {4, 1, 0, 4, 0, 1, 2, 3}; + +/* long_expl_vde_adj:(i0[3],i1[3],i2,i3[4])->(o0[4]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0; + a0=0.; + if (res[0]!=0) res[0][0]=a0; + a0=arg[1]? arg[1][0] : 0; + if (res[0]!=0) res[0][1]=a0; + a0=arg[1]? arg[1][1] : 0; + if (res[0]!=0) res[0][2]=a0; + a0=arg[1]? arg[1][2] : 0; + if (res[0]!=0) res[0][3]=a0; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_expl_vde_adj(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_expl_vde_adj_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_expl_vde_adj_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_expl_vde_adj_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_expl_vde_adj_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_expl_vde_adj_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_expl_vde_adj_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_expl_vde_adj_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_expl_vde_adj_n_in(void) { return 4;} + +CASADI_SYMBOL_EXPORT casadi_int long_expl_vde_adj_n_out(void) { return 1;} + +CASADI_SYMBOL_EXPORT casadi_real long_expl_vde_adj_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_expl_vde_adj_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + case 3: return "i3"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_expl_vde_adj_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_expl_vde_adj_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s0; + case 2: return casadi_s1; + case 3: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_expl_vde_adj_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s2; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_expl_vde_adj_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 4; + if (sz_res) *sz_res = 1; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_model/long_expl_vde_forw.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_model/long_expl_vde_forw.c new file mode 100644 index 000000000..61a5f503d --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_model/long_expl_vde_forw.c @@ -0,0 +1,176 @@ +/* This file was automatically generated by CasADi. + The CasADi copyright holders make no ownership claim of its contents. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* How to prefix internal symbols */ +#ifdef CASADI_CODEGEN_PREFIX + #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) + #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID + #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) +#else + #define CASADI_PREFIX(ID) long_expl_vde_forw_ ## ID +#endif + +#include + +#ifndef casadi_real +#define casadi_real double +#endif + +#ifndef casadi_int +#define casadi_int int +#endif + +/* Add prefix to internal symbols */ +#define casadi_f0 CASADI_PREFIX(f0) +#define casadi_s0 CASADI_PREFIX(s0) +#define casadi_s1 CASADI_PREFIX(s1) +#define casadi_s2 CASADI_PREFIX(s2) +#define casadi_s3 CASADI_PREFIX(s3) + +/* Symbol visibility in DLLs */ +#ifndef CASADI_SYMBOL_EXPORT + #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) + #if defined(STATIC_LINKED) + #define CASADI_SYMBOL_EXPORT + #else + #define CASADI_SYMBOL_EXPORT __declspec(dllexport) + #endif + #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) + #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) + #else + #define CASADI_SYMBOL_EXPORT + #endif +#endif + +static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2}; +static const casadi_int casadi_s1[15] = {3, 3, 0, 3, 6, 9, 0, 1, 2, 0, 1, 2, 0, 1, 2}; +static const casadi_int casadi_s2[5] = {1, 1, 0, 1, 0}; +static const casadi_int casadi_s3[8] = {4, 1, 0, 4, 0, 1, 2, 3}; + +/* long_expl_vde_forw:(i0[3],i1[3x3],i2[3],i3,i4[4])->(o0[3],o1[3x3],o2[3]) */ +static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { + casadi_real a0, a1; + a0=arg[0]? arg[0][1] : 0; + if (res[0]!=0) res[0][0]=a0; + a0=arg[0]? arg[0][2] : 0; + if (res[0]!=0) res[0][1]=a0; + a0=arg[3]? arg[3][0] : 0; + if (res[0]!=0) res[0][2]=a0; + a0=arg[1]? arg[1][1] : 0; + if (res[1]!=0) res[1][0]=a0; + a0=arg[1]? arg[1][2] : 0; + if (res[1]!=0) res[1][1]=a0; + a0=0.; + if (res[1]!=0) res[1][2]=a0; + a1=arg[1]? arg[1][4] : 0; + if (res[1]!=0) res[1][3]=a1; + a1=arg[1]? arg[1][5] : 0; + if (res[1]!=0) res[1][4]=a1; + if (res[1]!=0) res[1][5]=a0; + a1=arg[1]? arg[1][7] : 0; + if (res[1]!=0) res[1][6]=a1; + a1=arg[1]? arg[1][8] : 0; + if (res[1]!=0) res[1][7]=a1; + if (res[1]!=0) res[1][8]=a0; + a0=arg[2]? arg[2][1] : 0; + if (res[2]!=0) res[2][0]=a0; + a0=arg[2]? arg[2][2] : 0; + if (res[2]!=0) res[2][1]=a0; + a0=1.; + if (res[2]!=0) res[2][2]=a0; + return 0; +} + +CASADI_SYMBOL_EXPORT int long_expl_vde_forw(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ + return casadi_f0(arg, res, iw, w, mem); +} + +CASADI_SYMBOL_EXPORT int long_expl_vde_forw_alloc_mem(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT int long_expl_vde_forw_init_mem(int mem) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_expl_vde_forw_free_mem(int mem) { +} + +CASADI_SYMBOL_EXPORT int long_expl_vde_forw_checkout(void) { + return 0; +} + +CASADI_SYMBOL_EXPORT void long_expl_vde_forw_release(int mem) { +} + +CASADI_SYMBOL_EXPORT void long_expl_vde_forw_incref(void) { +} + +CASADI_SYMBOL_EXPORT void long_expl_vde_forw_decref(void) { +} + +CASADI_SYMBOL_EXPORT casadi_int long_expl_vde_forw_n_in(void) { return 5;} + +CASADI_SYMBOL_EXPORT casadi_int long_expl_vde_forw_n_out(void) { return 3;} + +CASADI_SYMBOL_EXPORT casadi_real long_expl_vde_forw_default_in(casadi_int i){ + switch (i) { + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_expl_vde_forw_name_in(casadi_int i){ + switch (i) { + case 0: return "i0"; + case 1: return "i1"; + case 2: return "i2"; + case 3: return "i3"; + case 4: return "i4"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const char* long_expl_vde_forw_name_out(casadi_int i){ + switch (i) { + case 0: return "o0"; + case 1: return "o1"; + case 2: return "o2"; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_expl_vde_forw_sparsity_in(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s0; + case 3: return casadi_s2; + case 4: return casadi_s3; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT const casadi_int* long_expl_vde_forw_sparsity_out(casadi_int i) { + switch (i) { + case 0: return casadi_s0; + case 1: return casadi_s1; + case 2: return casadi_s0; + default: return 0; + } +} + +CASADI_SYMBOL_EXPORT int long_expl_vde_forw_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { + if (sz_arg) *sz_arg = 5; + if (sz_res) *sz_res = 3; + if (sz_iw) *sz_iw = 0; + if (sz_w) *sz_w = 0; + return 0; +} + + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_model/long_model.h b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_model/long_model.h new file mode 100644 index 000000000..723316848 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_model/long_model.h @@ -0,0 +1,74 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +#ifndef long_MODEL +#define long_MODEL + +#ifdef __cplusplus +extern "C" { +#endif + + +/* explicit ODE */ + +// explicit ODE +int long_expl_ode_fun(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_expl_ode_fun_work(int *, int *, int *, int *); +const int *long_expl_ode_fun_sparsity_in(int); +const int *long_expl_ode_fun_sparsity_out(int); +int long_expl_ode_fun_n_in(void); +int long_expl_ode_fun_n_out(void); + +// explicit forward VDE +int long_expl_vde_forw(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_expl_vde_forw_work(int *, int *, int *, int *); +const int *long_expl_vde_forw_sparsity_in(int); +const int *long_expl_vde_forw_sparsity_out(int); +int long_expl_vde_forw_n_in(void); +int long_expl_vde_forw_n_out(void); + +// explicit adjoint VDE +int long_expl_vde_adj(const real_t** arg, real_t** res, int* iw, real_t* w, void *mem); +int long_expl_vde_adj_work(int *, int *, int *, int *); +const int *long_expl_vde_adj_sparsity_in(int); +const int *long_expl_vde_adj_sparsity_out(int); +int long_expl_vde_adj_n_in(void); +int long_expl_vde_adj_n_out(void); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // long_MODEL diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/main_long.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/main_long.c new file mode 100644 index 000000000..fe68229b1 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/main_long.c @@ -0,0 +1,213 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +// standard +#include +#include +// acados +#include "acados/utils/print.h" +#include "acados/utils/math.h" +#include "acados_c/ocp_nlp_interface.h" +#include "acados_c/external_function_interface.h" +#include "acados_solver_long.h" + +#define NX LONG_NX +#define NZ LONG_NZ +#define NU LONG_NU +#define NP LONG_NP +#define NBX LONG_NBX +#define NBX0 LONG_NBX0 +#define NBU LONG_NBU +#define NSBX LONG_NSBX +#define NSBU LONG_NSBU +#define NSH LONG_NSH +#define NSG LONG_NSG +#define NSPHI LONG_NSPHI +#define NSHN LONG_NSHN +#define NSGN LONG_NSGN +#define NSPHIN LONG_NSPHIN +#define NSBXN LONG_NSBXN +#define NS LONG_NS +#define NSN LONG_NSN +#define NG LONG_NG +#define NBXN LONG_NBXN +#define NGN LONG_NGN +#define NY0 LONG_NY0 +#define NY LONG_NY +#define NYN LONG_NYN +#define NH LONG_NH +#define NPHI LONG_NPHI +#define NHN LONG_NHN +#define NPHIN LONG_NPHIN +#define NR LONG_NR + + +int main() +{ + + long_solver_capsule *acados_ocp_capsule = long_acados_create_capsule(); + // there is an opportunity to change the number of shooting intervals in C without new code generation + int N = LONG_N; + // allocate the array and fill it accordingly + double* new_time_steps = NULL; + int status = long_acados_create_with_discretization(acados_ocp_capsule, N, new_time_steps); + + if (status) + { + printf("long_acados_create() returned status %d. Exiting.\n", status); + exit(1); + } + + ocp_nlp_config *nlp_config = long_acados_get_nlp_config(acados_ocp_capsule); + ocp_nlp_dims *nlp_dims = long_acados_get_nlp_dims(acados_ocp_capsule); + ocp_nlp_in *nlp_in = long_acados_get_nlp_in(acados_ocp_capsule); + ocp_nlp_out *nlp_out = long_acados_get_nlp_out(acados_ocp_capsule); + ocp_nlp_solver *nlp_solver = long_acados_get_nlp_solver(acados_ocp_capsule); + void *nlp_opts = long_acados_get_nlp_opts(acados_ocp_capsule); + + // initial condition + int idxbx0[NBX0]; + idxbx0[0] = 0; + idxbx0[1] = 1; + idxbx0[2] = 2; + + double lbx0[NBX0]; + double ubx0[NBX0]; + lbx0[0] = 0; + ubx0[0] = 0; + lbx0[1] = 0; + ubx0[1] = 0; + lbx0[2] = 0; + ubx0[2] = 0; + + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "idxbx", idxbx0); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "lbx", lbx0); + ocp_nlp_constraints_model_set(nlp_config, nlp_dims, nlp_in, 0, "ubx", ubx0); + + // initialization for state values + double x_init[NX]; + x_init[0] = 0.0; + x_init[1] = 0.0; + x_init[2] = 0.0; + + // initial value for control input + double u0[NU]; + u0[0] = 0.0; + // set parameters + double p[NP]; + p[0] = -1.2; + p[1] = 1.2; + p[2] = 0; + p[3] = 0; + + for (int ii = 0; ii <= N; ii++) + { + long_acados_update_params(acados_ocp_capsule, ii, p, NP); + } + + + // prepare evaluation + int NTIMINGS = 1; + double min_time = 1e12; + double kkt_norm_inf; + double elapsed_time; + int sqp_iter; + + double xtraj[NX * (N+1)]; + double utraj[NU * N]; + + + // solve ocp in loop + int rti_phase = 0; + + for (int ii = 0; ii < NTIMINGS; ii++) + { + // initialize solution + for (int i = 0; i <= nlp_dims->N; i++) + { + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, i, "x", x_init); + ocp_nlp_out_set(nlp_config, nlp_dims, nlp_out, i, "u", u0); + } + ocp_nlp_solver_opts_set(nlp_config, nlp_opts, "rti_phase", &rti_phase); + status = long_acados_solve(acados_ocp_capsule); + ocp_nlp_get(nlp_config, nlp_solver, "time_tot", &elapsed_time); + min_time = MIN(elapsed_time, min_time); + } + + /* print solution and statistics */ + for (int ii = 0; ii <= nlp_dims->N; ii++) + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, ii, "x", &xtraj[ii*NX]); + for (int ii = 0; ii < nlp_dims->N; ii++) + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, ii, "u", &utraj[ii*NU]); + + printf("\n--- xtraj ---\n"); + d_print_exp_tran_mat( NX, N+1, xtraj, NX); + printf("\n--- utraj ---\n"); + d_print_exp_tran_mat( NU, N, utraj, NU ); + // ocp_nlp_out_print(nlp_solver->dims, nlp_out); + + printf("\nsolved ocp %d times, solution printed above\n\n", NTIMINGS); + + if (status == ACADOS_SUCCESS) + { + printf("long_acados_solve(): SUCCESS!\n"); + } + else + { + printf("long_acados_solve() failed with status %d.\n", status); + } + + // get solution + ocp_nlp_out_get(nlp_config, nlp_dims, nlp_out, 0, "kkt_norm_inf", &kkt_norm_inf); + ocp_nlp_get(nlp_config, nlp_solver, "sqp_iter", &sqp_iter); + + long_acados_print_stats(acados_ocp_capsule); + + printf("\nSolver info:\n"); + printf(" SQP iterations %2d\n minimum time for %d solve %f [ms]\n KKT %e\n", + sqp_iter, NTIMINGS, min_time*1000, kkt_norm_inf); + + // free solver + status = long_acados_free(acados_ocp_capsule); + if (status) { + printf("long_acados_free() returned status %d. \n", status); + } + // free solver capsule + status = long_acados_free_capsule(acados_ocp_capsule); + if (status) { + printf("long_acados_free_capsule() returned status %d. \n", status); + } + + return status; +} diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py new file mode 100644 index 000000000..ec38581eb --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py @@ -0,0 +1,387 @@ +#!/usr/bin/env python3 +import os +import numpy as np + +from common.realtime import sec_since_boot +from common.numpy_fast import clip, interp +from selfdrive.swaglog import cloudlog +from selfdrive.modeld.constants import index_function +from selfdrive.controls.lib.radar_helpers import _LEAD_ACCEL_TAU +from selfdrive.car.modules.CFG_module import load_float_param + +if __name__ == '__main__': # generating code + from pyextra.acados_template import AcadosModel, AcadosOcp, AcadosOcpSolver +else: + # from pyextra.acados_template import AcadosOcpSolver as AcadosOcpSolverFast + from selfdrive.controls.lib.longitudinal_mpc_lib.c_generated_code.acados_ocp_solver_pyx import AcadosOcpSolverFast # pylint: disable=no-name-in-module, import-error + +from casadi import SX, vertcat + +LONG_MPC_DIR = os.path.dirname(os.path.abspath(__file__)) +EXPORT_DIR = os.path.join(LONG_MPC_DIR, "c_generated_code") +JSON_FILE = "acados_ocp_long.json" + +SOURCES = ['lead0', 'lead1', 'cruise'] + +X_DIM = 3 +U_DIM = 1 +PARAM_DIM= 4 +COST_E_DIM = 5 +COST_DIM = COST_E_DIM + 1 +CONSTR_DIM = 4 + +X_EGO_OBSTACLE_COST = 3. +X_EGO_COST = 0. +V_EGO_COST = 0. +A_EGO_COST = 0. +J_EGO_COST = 5.0 +A_CHANGE_COST = .5 +DANGER_ZONE_COST = 100. +CRASH_DISTANCE = .5 +LIMIT_COST = 1e6 + + +# Fewer timestamps don't hurt performance and lead to +# much better convergence of the MPC with low iterations +N = 12 +MAX_T = 10.0 +T_IDXS_LST = [index_function(idx, max_val=MAX_T, max_idx=N+1) for idx in range(N+1)] + +T_IDXS = np.array(T_IDXS_LST) +T_DIFFS = np.diff(T_IDXS, prepend=[0.]) +MIN_ACCEL = -4.5 +T_FOLLOW = load_float_param("TinklaFollowDistance",1.45) +COMFORT_BRAKE = 2.5 +STOP_DISTANCE = 3.0 #base it if we have radar or just visual +DIST_FACTOR = 3 + +def get_stopped_equivalence_factor(v_lead): + return (v_lead**2) / (DIST_FACTOR * COMFORT_BRAKE) + +def get_safe_obstacle_distance(v_ego): + return (v_ego**2) / (DIST_FACTOR * COMFORT_BRAKE) + T_FOLLOW * v_ego + STOP_DISTANCE + +def desired_follow_distance(v_ego, v_lead): + return get_safe_obstacle_distance(v_ego) - get_stopped_equivalence_factor(v_lead) + + +def gen_long_model(): + model = AcadosModel() + model.name = 'long' + + # set up states & controls + x_ego = SX.sym('x_ego') + v_ego = SX.sym('v_ego') + a_ego = SX.sym('a_ego') + model.x = vertcat(x_ego, v_ego, a_ego) + + # controls + j_ego = SX.sym('j_ego') + model.u = vertcat(j_ego) + + # xdot + x_ego_dot = SX.sym('x_ego_dot') + v_ego_dot = SX.sym('v_ego_dot') + a_ego_dot = SX.sym('a_ego_dot') + model.xdot = vertcat(x_ego_dot, v_ego_dot, a_ego_dot) + + # live parameters + a_min = SX.sym('a_min') + a_max = SX.sym('a_max') + x_obstacle = SX.sym('x_obstacle') + prev_a = SX.sym('prev_a') + model.p = vertcat(a_min, a_max, x_obstacle, prev_a) + + # dynamics model + f_expl = vertcat(v_ego, a_ego, j_ego) + model.f_impl_expr = model.xdot - f_expl + model.f_expl_expr = f_expl + return model + + +def gen_long_mpc_solver(): + ocp = AcadosOcp() + ocp.model = gen_long_model() + + Tf = T_IDXS[-1] + + # set dimensions + ocp.dims.N = N + + # set cost module + ocp.cost.cost_type = 'NONLINEAR_LS' + ocp.cost.cost_type_e = 'NONLINEAR_LS' + + QR = np.zeros((COST_DIM, COST_DIM)) + Q = np.zeros((COST_E_DIM, COST_E_DIM)) + + ocp.cost.W = QR + ocp.cost.W_e = Q + + x_ego, v_ego, a_ego = ocp.model.x[0], ocp.model.x[1], ocp.model.x[2] + j_ego = ocp.model.u[0] + + a_min, a_max = ocp.model.p[0], ocp.model.p[1] + x_obstacle = ocp.model.p[2] + prev_a = ocp.model.p[3] + + ocp.cost.yref = np.zeros((COST_DIM, )) + ocp.cost.yref_e = np.zeros((COST_E_DIM, )) + + desired_dist_comfort = get_safe_obstacle_distance(v_ego) + + # The main cost in normal operation is how close you are to the "desired" distance + # from an obstacle at every timestep. This obstacle can be a lead car + # or other object. In e2e mode we can use x_position targets as a cost + # instead. + costs = [((x_obstacle - x_ego) - (desired_dist_comfort)) / (v_ego + 10.), + x_ego, + v_ego, + a_ego, + 20*(a_ego - prev_a), + j_ego] + ocp.model.cost_y_expr = vertcat(*costs) + ocp.model.cost_y_expr_e = vertcat(*costs[:-1]) + + # Constraints on speed, acceleration and desired distance to + # the obstacle, which is treated as a slack constraint so it + # behaves like an asymmetrical cost. + constraints = vertcat(v_ego, + (a_ego - a_min), + (a_max - a_ego), + ((x_obstacle - x_ego) - (3/4) * (desired_dist_comfort)) / (v_ego + 10.)) + ocp.model.con_h_expr = constraints + ocp.model.con_h_expr_e = vertcat(np.zeros(CONSTR_DIM)) + + x0 = np.zeros(X_DIM) + ocp.constraints.x0 = x0 + ocp.parameter_values = np.array([-1.2, 1.2, 0.0, 0.0]) + + # We put all constraint cost weights to 0 and only set them at runtime + cost_weights = np.zeros(CONSTR_DIM) + ocp.cost.zl = cost_weights + ocp.cost.Zl = cost_weights + ocp.cost.Zu = cost_weights + ocp.cost.zu = cost_weights + + ocp.constraints.lh = np.zeros(CONSTR_DIM) + ocp.constraints.lh_e = np.zeros(CONSTR_DIM) + ocp.constraints.uh = 1e4*np.ones(CONSTR_DIM) + ocp.constraints.uh_e = 1e4*np.ones(CONSTR_DIM) + ocp.constraints.idxsh = np.arange(CONSTR_DIM) + + # The HPIPM solver can give decent solutions even when it is stopped early + # Which is critical for our purpose where compute time is strictly bounded + # We use HPIPM in the SPEED_ABS mode, which ensures fastest runtime. This + # does not cause issues since the problem is well bounded. + ocp.solver_options.qp_solver = 'PARTIAL_CONDENSING_HPIPM' + ocp.solver_options.hessian_approx = 'GAUSS_NEWTON' + ocp.solver_options.integrator_type = 'ERK' + ocp.solver_options.nlp_solver_type = 'SQP_RTI' + ocp.solver_options.qp_solver_cond_N = N//4 + + # More iterations take too much time and less lead to inaccurate convergence in + # some situations. Ideally we would run just 1 iteration to ensure fixed runtime. + ocp.solver_options.qp_solver_iter_max = 10 + + # set prediction horizon + ocp.solver_options.tf = Tf + ocp.solver_options.shooting_nodes = T_IDXS + + ocp.code_export_directory = EXPORT_DIR + return ocp + + +class LongitudinalMpc: + def __init__(self, e2e=False): + self.e2e = e2e + self.reset() + self.source = SOURCES[2] + + def reset(self): + self.solver = AcadosOcpSolverFast('long', N, EXPORT_DIR) + self.v_solution = np.zeros(N+1) + self.a_solution = np.zeros(N+1) + self.prev_a = np.array(self.a_solution) + self.j_solution = np.zeros(N) + self.yref = np.zeros((N+1, COST_DIM)) + for i in range(N): + self.solver.cost_set(i, "yref", self.yref[i]) + self.solver.cost_set(N, "yref", self.yref[N][:COST_E_DIM]) + self.x_sol = np.zeros((N+1, X_DIM)) + self.u_sol = np.zeros((N,1)) + self.params = np.zeros((N+1, PARAM_DIM)) + for i in range(N+1): + self.solver.set(i, 'x', np.zeros(X_DIM)) + self.last_cloudlog_t = 0 + self.status = False + self.crash_cnt = 0.0 + self.solution_status = 0 + self.solve_time = 0.0 + self.x0 = np.zeros(X_DIM) + self.set_weights() + + def set_weights(self): + if self.e2e: + self.set_weights_for_xva_policy() + self.params[:,0] = -10. + self.params[:,1] = 10. + self.params[:,2] = 1e5 + else: + self.set_weights_for_lead_policy() + + def set_weights_for_lead_policy(self): + W = np.asfortranarray(np.diag([X_EGO_OBSTACLE_COST, X_EGO_COST, V_EGO_COST, A_EGO_COST, A_CHANGE_COST, J_EGO_COST])) + for i in range(N): + W[4,4] = A_CHANGE_COST * np.interp(T_IDXS[i], [0.0, 1.0, 2.0], [1.0, 1.0, 0.0]) + self.solver.cost_set(i, 'W', W) + # Setting the slice without the copy make the array not contiguous, + # causing issues with the C interface. + self.solver.cost_set(N, 'W', np.copy(W[:COST_E_DIM, :COST_E_DIM])) + + # Set L2 slack cost on lower bound constraints + Zl = np.array([LIMIT_COST, LIMIT_COST, LIMIT_COST, DANGER_ZONE_COST]) + for i in range(N): + self.solver.cost_set(i, 'Zl', Zl) + + def set_weights_for_xva_policy(self): + W = np.asfortranarray(np.diag([0., 10., 1., 10., 0.0, 1.])) + for i in range(N): + self.solver.cost_set(i, 'W', W) + # Setting the slice without the copy make the array not contiguous, + # causing issues with the C interface. + self.solver.cost_set(N, 'W', np.copy(W[:COST_E_DIM, :COST_E_DIM])) + + # Set L2 slack cost on lower bound constraints + Zl = np.array([LIMIT_COST, LIMIT_COST, LIMIT_COST, 0.0]) + for i in range(N): + self.solver.cost_set(i, 'Zl', Zl) + + def set_cur_state(self, v, a): + if abs(self.x0[1] - v) > 2.: + self.x0[1] = v + self.x0[2] = a + for i in range(0, N+1): + self.solver.set(i, 'x', self.x0) + else: + self.x0[1] = v + self.x0[2] = a + + @staticmethod + def extrapolate_lead(x_lead, v_lead, a_lead, a_lead_tau): + a_lead_traj = a_lead * np.exp(-a_lead_tau * (T_IDXS**2)/2.) + v_lead_traj = np.clip(v_lead + np.cumsum(T_DIFFS * a_lead_traj), 0.0, 1e8) + x_lead_traj = x_lead + np.cumsum(T_DIFFS * v_lead_traj) + lead_xv = np.column_stack((x_lead_traj, v_lead_traj)) + return lead_xv + + def process_lead(self, lead): + v_ego = self.x0[1] + if lead is not None and lead.status: + x_lead = lead.dRel + v_lead = lead.vLead + a_lead = lead.aLeadK + a_lead_tau = lead.aLeadTau + else: + # Fake a fast lead car, so mpc can keep running in the same mode + x_lead = 50.0 + v_lead = v_ego + 10.0 + a_lead = 0.0 + a_lead_tau = _LEAD_ACCEL_TAU + + # MPC will not converge if immediate crash is expected + # Clip lead distance to what is still possible to brake for + min_x_lead = ((v_ego + v_lead)/2) * (v_ego - v_lead) / (-MIN_ACCEL * DIST_FACTOR) + x_lead = clip(x_lead, min_x_lead, 1e8) + v_lead = clip(v_lead, 0.0, 1e8) + a_lead = clip(a_lead, -10., 5.) + lead_xv = self.extrapolate_lead(x_lead, v_lead, a_lead, a_lead_tau) + return lead_xv + + def set_accel_limits(self, min_a, max_a): + self.cruise_min_a = min_a + self.cruise_max_a = max_a + + def update(self, carstate, radarstate, v_cruise, prev_accel_constraint=False): + v_ego = self.x0[1] + a_ego = self.x0[2] + self.status = radarstate.leadOne.status or radarstate.leadTwo.status + + lead_xv_0 = self.process_lead(radarstate.leadOne) + lead_xv_1 = self.process_lead(radarstate.leadTwo) + + # set accel limits in params + self.params[:,0] = interp(float(self.status), [0.0, 1.0], [self.cruise_min_a, MIN_ACCEL]) + self.params[:,1] = self.cruise_max_a + + # To estimate a safe distance from a moving lead, we calculate how much stopping + # distance that lead needs as a minimum. We can add that to the current distance + # and then treat that as a stopped car/obstacle at this new distance. + lead_0_obstacle = lead_xv_0[:,0] + get_stopped_equivalence_factor(lead_xv_0[:,1]) + lead_1_obstacle = lead_xv_1[:,0] + get_stopped_equivalence_factor(lead_xv_1[:,1]) + + # Fake an obstacle for cruise, this ensures smooth acceleration to set speed + # when the leads are no factor. + v_lower = v_ego + (T_IDXS * self.cruise_min_a * 1.05) + v_upper = v_ego + (T_IDXS * self.cruise_max_a * 1.05) + v_cruise_clipped = np.clip(v_cruise * np.ones(N+1), + v_lower, + v_upper) + cruise_obstacle = np.cumsum(T_DIFFS * v_cruise_clipped) + get_safe_obstacle_distance(v_cruise_clipped) + + x_obstacles = np.column_stack([lead_0_obstacle, lead_1_obstacle, cruise_obstacle]) + self.source = SOURCES[np.argmin(x_obstacles[0])] + self.params[:,2] = np.min(x_obstacles, axis=1) + if prev_accel_constraint: + self.params[:,3] = np.copy(self.prev_a) + else: + self.params[:,3] = a_ego + + self.run() + if (np.any(lead_xv_0[:,0] - self.x_sol[:,0] < CRASH_DISTANCE) and + radarstate.leadOne.modelProb > 0.9): + self.crash_cnt += 1 + else: + self.crash_cnt = 0 + + def update_with_xva(self, x, v, a): + self.yref[:,1] = x + self.yref[:,2] = v + self.yref[:,3] = a + for i in range(N): + self.solver.cost_set(i, "yref", self.yref[i]) + self.solver.cost_set(N, "yref", self.yref[N][:COST_E_DIM]) + self.params[:,3] = np.copy(self.prev_a) + self.run() + + def run(self): + for i in range(N+1): + self.solver.set(i, 'p', self.params[i]) + self.solver.constraints_set(0, "lbx", self.x0) + self.solver.constraints_set(0, "ubx", self.x0) + + t = sec_since_boot() + self.solution_status = self.solver.solve() + self.solve_time = sec_since_boot() - t + + for i in range(N+1): + self.x_sol[i] = self.solver.get(i, 'x') + for i in range(N): + self.u_sol[i] = self.solver.get(i, 'u') + + self.v_solution = self.x_sol[:,1] + self.a_solution = self.x_sol[:,2] + self.j_solution = self.u_sol[:,0] + + self.prev_a = np.interp(T_IDXS + 0.05, T_IDXS, self.a_solution) + + if self.solution_status != 0: + if t > self.last_cloudlog_t + 5.0: + self.last_cloudlog_t = t + cloudlog.warning(f"Long mpc reset, solution_status: {self.solution_status}") + self.reset() + + +if __name__ == "__main__": + ocp = gen_long_mpc_solver() + AcadosOcpSolver.generate(ocp, json_file=JSON_FILE, build=False) diff --git a/selfdrive/controls/lib/longitudinal_planner.py b/selfdrive/controls/lib/longitudinal_planner.py new file mode 100755 index 000000000..8c7940405 --- /dev/null +++ b/selfdrive/controls/lib/longitudinal_planner.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python3 +import math +import numpy as np +from common.numpy_fast import interp + +import cereal.messaging as messaging +from common.filter_simple import FirstOrderFilter +from common.realtime import DT_MDL +from selfdrive.modeld.constants import T_IDXS +from selfdrive.config import Conversions as CV +from selfdrive.controls.lib.longcontrol import LongCtrlState +from selfdrive.controls.lib.longitudinal_mpc_lib.long_mpc import LongitudinalMpc +from selfdrive.controls.lib.longitudinal_mpc_lib.long_mpc import T_IDXS as T_IDXS_MPC +from selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX, CONTROL_N +from selfdrive.swaglog import cloudlog + +LON_MPC_STEP = 0.2 # first step is 0.2s +AWARENESS_DECEL = -0.2 # car smoothly decel at .2m/s^2 when user is distracted +A_CRUISE_MIN = -1.2 +A_CRUISE_MAX_VALS = [1.2, 1.2, 0.8, 0.6] +A_CRUISE_MAX_BP = [0., 15., 25., 40.] + +# Lookup table for turns +_A_TOTAL_MAX_V = [1.7, 3.2] +_A_TOTAL_MAX_BP = [20., 40.] + + +def get_max_accel(v_ego): + return interp(v_ego, A_CRUISE_MAX_BP, A_CRUISE_MAX_VALS) + + +def limit_accel_in_turns(v_ego, angle_steers, a_target, CP): + """ + This function returns a limited long acceleration allowed, depending on the existing lateral acceleration + this should avoid accelerating when losing the target in turns + """ + + a_total_max = interp(v_ego, _A_TOTAL_MAX_BP, _A_TOTAL_MAX_V) + a_y = v_ego ** 2 * angle_steers * CV.DEG_TO_RAD / (CP.steerRatio * CP.wheelbase) + a_x_allowed = math.sqrt(max(a_total_max ** 2 - a_y ** 2, 0.)) + + return [a_target[0], min(a_target[1], a_x_allowed)] + + +class Planner: + def __init__(self, CP, init_v=0.0, init_a=0.0): + self.CP = CP + self.mpc = LongitudinalMpc() + + self.fcw = False + + self.a_desired = init_a + self.v_desired_filter = FirstOrderFilter(init_v, 2.0, DT_MDL) + + self.v_desired_trajectory = np.zeros(CONTROL_N) + self.a_desired_trajectory = np.zeros(CONTROL_N) + self.j_desired_trajectory = np.zeros(CONTROL_N) + + def update(self, sm): + v_ego = sm['carState'].vEgo + a_ego = sm['carState'].aEgo + + v_cruise_kph = sm['controlsState'].vCruise + v_cruise_kph = min(v_cruise_kph, V_CRUISE_MAX) + v_cruise = v_cruise_kph * CV.KPH_TO_MS + + long_control_state = sm['controlsState'].longControlState + force_slow_decel = sm['controlsState'].forceDecel + + prev_accel_constraint = True + if long_control_state == LongCtrlState.off or sm['carState'].gasPressed: + self.v_desired_filter.x = v_ego + self.a_desired = a_ego + # Smoothly changing between accel trajectory is only relevant when OP is driving + prev_accel_constraint = False + + # Prevent divergence, smooth in current v_ego + self.v_desired_filter.x = max(0.0, self.v_desired_filter.update(v_ego)) + + accel_limits = [A_CRUISE_MIN, get_max_accel(v_ego)] + accel_limits_turns = limit_accel_in_turns(v_ego, sm['carState'].steeringAngleDeg, accel_limits, self.CP) + if force_slow_decel: + # if required so, force a smooth deceleration + accel_limits_turns[1] = min(accel_limits_turns[1], AWARENESS_DECEL) + accel_limits_turns[0] = min(accel_limits_turns[0], accel_limits_turns[1]) + # clip limits, cannot init MPC outside of bounds + accel_limits_turns[0] = min(accel_limits_turns[0], self.a_desired + 0.05) + accel_limits_turns[1] = max(accel_limits_turns[1], self.a_desired - 0.05) + self.mpc.set_accel_limits(accel_limits_turns[0], accel_limits_turns[1]) + self.mpc.set_cur_state(self.v_desired_filter.x, self.a_desired) + self.mpc.update(sm['carState'], sm['radarState'], v_cruise, prev_accel_constraint=prev_accel_constraint) + self.v_desired_trajectory = np.interp(T_IDXS[:CONTROL_N], T_IDXS_MPC, self.mpc.v_solution) + self.a_desired_trajectory = np.interp(T_IDXS[:CONTROL_N], T_IDXS_MPC, self.mpc.a_solution) + self.j_desired_trajectory = np.interp(T_IDXS[:CONTROL_N], T_IDXS_MPC[:-1], self.mpc.j_solution) + + # TODO counter is only needed because radar is glitchy, remove once radar is gone + self.fcw = self.mpc.crash_cnt > 5 + if self.fcw: + cloudlog.info("FCW triggered") + + # Interpolate 0.05 seconds and save as starting point for next iteration + a_prev = self.a_desired + self.a_desired = float(interp(DT_MDL, T_IDXS[:CONTROL_N], self.a_desired_trajectory)) + self.v_desired_filter.x = self.v_desired_filter.x + DT_MDL * (self.a_desired + a_prev) / 2.0 + + def publish(self, sm, pm): + plan_send = messaging.new_message('longitudinalPlan') + + plan_send.valid = sm.all_alive_and_valid(service_list=['carState', 'controlsState']) + + longitudinalPlan = plan_send.longitudinalPlan + longitudinalPlan.modelMonoTime = sm.logMonoTime['modelV2'] + longitudinalPlan.processingDelay = (plan_send.logMonoTime / 1e9) - sm.logMonoTime['modelV2'] + + longitudinalPlan.speeds = self.v_desired_trajectory.tolist() + longitudinalPlan.accels = self.a_desired_trajectory.tolist() + longitudinalPlan.jerks = self.j_desired_trajectory.tolist() + + longitudinalPlan.hasLead = sm['radarState'].leadOne.status + longitudinalPlan.longitudinalPlanSource = self.mpc.source + longitudinalPlan.fcw = self.fcw + + longitudinalPlan.solverExecutionTime = self.mpc.solve_time + + pm.send('longitudinalPlan', plan_send) diff --git a/selfdrive/controls/lib/pid.py b/selfdrive/controls/lib/pid.py new file mode 100644 index 000000000..28c643819 --- /dev/null +++ b/selfdrive/controls/lib/pid.py @@ -0,0 +1,70 @@ +import numpy as np +from numbers import Number + +from common.numpy_fast import clip, interp + +def apply_deadzone(error, deadzone): + if error > deadzone: + error -= deadzone + elif error < - deadzone: + error += deadzone + else: + error = 0. + return error + +class PIController(): + def __init__(self, k_p, k_i, k_f=1., pos_limit=None, neg_limit=None, rate=100): + self._k_p = k_p # proportional gain + self._k_i = k_i # integral gain + self.k_f = k_f # feedforward gain + if isinstance(self._k_p, Number): + self._k_p = [[0], [self._k_p]] + if isinstance(self._k_i, Number): + self._k_i = [[0], [self._k_i]] + + self.pos_limit = pos_limit + self.neg_limit = neg_limit + + self.i_unwind_rate = 0.3 / rate + self.i_rate = 1.0 / rate + + self.reset() + + @property + def k_p(self): + return interp(self.speed, self._k_p[0], self._k_p[1]) + + @property + def k_i(self): + return interp(self.speed, self._k_i[0], self._k_i[1]) + + def reset(self): + self.p = 0.0 + self.i = 0.0 + self.f = 0.0 + self.control = 0 + + def update(self, setpoint, measurement, speed=0.0, override=False, feedforward=0., deadzone=0., freeze_integrator=False): + self.speed = speed + + error = float(apply_deadzone(setpoint - measurement, deadzone)) + self.p = error * self.k_p + self.f = feedforward * self.k_f + + if override: + self.i -= self.i_unwind_rate * float(np.sign(self.i)) + else: + i = self.i + error * self.k_i * self.i_rate + control = self.p + self.f + i + + # Update when changing i will move the control away from the limits + # or when i will move towards the sign of the error + if ((error >= 0 and (control <= self.pos_limit or i < 0.0)) or + (error <= 0 and (control >= self.neg_limit or i > 0.0))) and \ + not freeze_integrator: + self.i = i + + control = self.p + self.f + self.i + + self.control = clip(control, self.neg_limit, self.pos_limit) + return self.control diff --git a/selfdrive/controls/lib/radar_helpers.py b/selfdrive/controls/lib/radar_helpers.py new file mode 100644 index 000000000..4f87fdf09 --- /dev/null +++ b/selfdrive/controls/lib/radar_helpers.py @@ -0,0 +1,157 @@ +from common.numpy_fast import mean +from common.kalman.simple_kalman import KF1D +from selfdrive.config import RADAR_TO_CAMERA + + +# the longer lead decels, the more likely it will keep decelerating +# TODO is this a good default? +_LEAD_ACCEL_TAU = 1.5 + +# radar tracks +SPEED, ACCEL = 0, 1 # Kalman filter states enum + +# stationary qualification parameters +v_ego_stationary = 4. # no stationary object flag below this speed + + +class Track(): + def __init__(self, v_lead, kalman_params): + self.cnt = 0 + self.aLeadTau = _LEAD_ACCEL_TAU + self.K_A = kalman_params.A + self.K_C = kalman_params.C + self.K_K = kalman_params.K + self.kf = KF1D([[v_lead], [0.0]], self.K_A, self.K_C, self.K_K) + + def update(self, d_rel, y_rel, v_rel, v_lead, measured): + # relative values, copy + self.dRel = d_rel # LONG_DIST + self.yRel = y_rel # -LAT_DIST + self.vRel = v_rel # REL_SPEED + self.vLead = v_lead + self.measured = measured # measured or estimate + + # computed velocity and accelerations + if self.cnt > 0: + self.kf.update(self.vLead) + + self.vLeadK = float(self.kf.x[SPEED][0]) + self.aLeadK = float(self.kf.x[ACCEL][0]) + + # Learn if constant acceleration + if abs(self.aLeadK) < 0.5: + self.aLeadTau = _LEAD_ACCEL_TAU + else: + self.aLeadTau *= 0.9 + + self.cnt += 1 + + def get_key_for_cluster(self): + # Weigh y higher since radar is inaccurate in this dimension + return [self.dRel, self.yRel*2, self.vRel] + + def reset_a_lead(self, aLeadK, aLeadTau): + self.kf = KF1D([[self.vLead], [aLeadK]], self.K_A, self.K_C, self.K_K) + self.aLeadK = aLeadK + self.aLeadTau = aLeadTau + + +class Cluster(): + def __init__(self): + self.tracks = set() + + def add(self, t): + # add the first track + self.tracks.add(t) + + # TODO: make generic + @property + def dRel(self): + return mean([t.dRel for t in self.tracks]) + + @property + def yRel(self): + return mean([t.yRel for t in self.tracks]) + + @property + def vRel(self): + return mean([t.vRel for t in self.tracks]) + + @property + def aRel(self): + return mean([t.aRel for t in self.tracks]) + + @property + def vLead(self): + return mean([t.vLead for t in self.tracks]) + + @property + def dPath(self): + return mean([t.dPath for t in self.tracks]) + + @property + def vLat(self): + return mean([t.vLat for t in self.tracks]) + + @property + def vLeadK(self): + return mean([t.vLeadK for t in self.tracks]) + + @property + def aLeadK(self): + if all(t.cnt <= 1 for t in self.tracks): + return 0. + else: + return mean([t.aLeadK for t in self.tracks if t.cnt > 1]) + + @property + def aLeadTau(self): + if all(t.cnt <= 1 for t in self.tracks): + return _LEAD_ACCEL_TAU + else: + return mean([t.aLeadTau for t in self.tracks if t.cnt > 1]) + + @property + def measured(self): + return any(t.measured for t in self.tracks) + + def get_RadarState(self, model_prob=0.0): + return { + "dRel": float(self.dRel), + "yRel": float(self.yRel), + "vRel": float(self.vRel), + "vLead": float(self.vLead), + "vLeadK": float(self.vLeadK), + "aLeadK": float(self.aLeadK), + "status": True, + "fcw": self.is_potential_fcw(model_prob), + "modelProb": model_prob, + "radar": True, + "aLeadTau": float(self.aLeadTau) + } + + def get_RadarState_from_vision(self, lead_msg, v_ego): + return { + "dRel": float(lead_msg.x[0] - RADAR_TO_CAMERA), + "yRel": float(-lead_msg.y[0]), + "vRel": float(lead_msg.v[0] - v_ego), + "vLead": float(lead_msg.v[0]), + "vLeadK": float(lead_msg.v[0]), + "aLeadK": float(0), + "aLeadTau": _LEAD_ACCEL_TAU, + "fcw": False, + "modelProb": float(lead_msg.prob), + "radar": False, + "status": True + } + + def __str__(self): + ret = f"x: {self.dRel:4.1f} y: {self.yRel:4.1f} v: {self.vRel:4.1f} a: {self.aLeadK:4.1f}" + return ret + + def potential_low_speed_lead(self, v_ego): + # stop for stuff in front of you and low speed, even without model confirmation + return abs(self.yRel) < 1.5 and (v_ego < v_ego_stationary) and self.dRel < 25 + + def is_potential_fcw(self, model_prob): + return model_prob > .9 diff --git a/selfdrive/controls/lib/vehicle_model.py b/selfdrive/controls/lib/vehicle_model.py new file mode 100755 index 000000000..3f180d325 --- /dev/null +++ b/selfdrive/controls/lib/vehicle_model.py @@ -0,0 +1,231 @@ +#!/usr/bin/env python3 +""" +Dynamic bicycle model from "The Science of Vehicle Dynamics (2014), M. Guiggiani" + +The state is x = [v, r]^T +with v lateral speed [m/s], and r rotational speed [rad/s] + +The input u is the steering angle [rad], and roll [rad] + +The system is defined by +x_dot = A*x + B*u + +A depends on longitudinal speed, u [m/s], and vehicle parameters CP +""" +from typing import Tuple + +import numpy as np +from numpy.linalg import solve + +from cereal import car + +ACCELERATION_DUE_TO_GRAVITY = 9.8 + + +class VehicleModel: + def __init__(self, CP: car.CarParams): + """ + Args: + CP: Car Parameters + """ + # for math readability, convert long names car params into short names + self.m = CP.mass + self.j = CP.rotationalInertia + self.l = CP.wheelbase + self.aF = CP.centerToFront + self.aR = CP.wheelbase - CP.centerToFront + self.chi = CP.steerRatioRear + + self.cF_orig = CP.tireStiffnessFront + self.cR_orig = CP.tireStiffnessRear + self.update_params(1.0, CP.steerRatio) + + def update_params(self, stiffness_factor: float, steer_ratio: float) -> None: + """Update the vehicle model with a new stiffness factor and steer ratio""" + self.cF = stiffness_factor * self.cF_orig + self.cR = stiffness_factor * self.cR_orig + self.sR = steer_ratio + + def steady_state_sol(self, sa: float, u: float, roll: float) -> np.ndarray: + """Returns the steady state solution. + + If the speed is too low we can't use the dynamic model (tire slip is undefined), + we then have to use the kinematic model + + Args: + sa: Steering wheel angle [rad] + u: Speed [m/s] + roll: Road Roll [rad] + + Returns: + 2x1 matrix with steady state solution (lateral speed, rotational speed) + """ + if u > 0.1: + return dyn_ss_sol(sa, u, roll, self) + else: + return kin_ss_sol(sa, u, self) + + def calc_curvature(self, sa: float, u: float, roll: float) -> float: + """Returns the curvature. Multiplied by the speed this will give the yaw rate. + + Args: + sa: Steering wheel angle [rad] + u: Speed [m/s] + roll: Road Roll [rad] + + Returns: + Curvature factor [1/m] + """ + return (self.curvature_factor(u) * sa / self.sR) + self.roll_compensation(roll, u) + + def curvature_factor(self, u: float) -> float: + """Returns the curvature factor. + Multiplied by wheel angle (not steering wheel angle) this will give the curvature. + + Args: + u: Speed [m/s] + + Returns: + Curvature factor [1/m] + """ + sf = calc_slip_factor(self) + return (1. - self.chi) / (1. - sf * u**2) / self.l + + def get_steer_from_curvature(self, curv: float, u: float, roll: float) -> float: + """Calculates the required steering wheel angle for a given curvature + + Args: + curv: Desired curvature [1/m] + u: Speed [m/s] + roll: Road Roll [rad] + + Returns: + Steering wheel angle [rad] + """ + + return (curv - self.roll_compensation(roll, u)) * self.sR * 1.0 / self.curvature_factor(u) + + def roll_compensation(self, roll: float, u: float) -> float: + """Calculates the roll-compensation to curvature + + Args: + roll: Road Roll [rad] + u: Speed [m/s] + + Returns: + Roll compensation curvature [rad] + """ + sf = calc_slip_factor(self) + + if abs(sf) < 1e-6: + return 0 + else: + return (ACCELERATION_DUE_TO_GRAVITY * roll) / ((1 / sf) - u**2) + + def get_steer_from_yaw_rate(self, yaw_rate: float, u: float, roll: float) -> float: + """Calculates the required steering wheel angle for a given yaw_rate + + Args: + yaw_rate: Desired yaw rate [rad/s] + u: Speed [m/s] + roll: Road Roll [rad] + + Returns: + Steering wheel angle [rad] + """ + curv = yaw_rate / u + return self.get_steer_from_curvature(curv, u, roll) + + def yaw_rate(self, sa: float, u: float, roll: float) -> float: + """Calculate yaw rate + + Args: + sa: Steering wheel angle [rad] + u: Speed [m/s] + roll: Road Roll [rad] + + Returns: + Yaw rate [rad/s] + """ + return self.calc_curvature(sa, u, roll) * u + + +def kin_ss_sol(sa: float, u: float, VM: VehicleModel) -> np.ndarray: + """Calculate the steady state solution at low speeds + At low speeds the tire slip is undefined, so a kinematic + model is used. + + Args: + sa: Steering angle [rad] + u: Speed [m/s] + VM: Vehicle model + + Returns: + 2x1 matrix with steady state solution + """ + K = np.zeros((2, 1)) + K[0, 0] = VM.aR / VM.sR / VM.l * u + K[1, 0] = 1. / VM.sR / VM.l * u + return K * sa + + +def create_dyn_state_matrices(u: float, VM: VehicleModel) -> Tuple[np.ndarray, np.ndarray]: + """Returns the A and B matrix for the dynamics system + + Args: + u: Vehicle speed [m/s] + VM: Vehicle model + + Returns: + A tuple with the 2x2 A matrix, and 2x2 B matrix + + Parameters in the vehicle model: + cF: Tire stiffness Front [N/rad] + cR: Tire stiffness Front [N/rad] + aF: Distance from CG to front wheels [m] + aR: Distance from CG to rear wheels [m] + m: Mass [kg] + j: Rotational inertia [kg m^2] + sR: Steering ratio [-] + chi: Steer ratio rear [-] + """ + A = np.zeros((2, 2)) + B = np.zeros((2, 2)) + A[0, 0] = - (VM.cF + VM.cR) / (VM.m * u) + A[0, 1] = - (VM.cF * VM.aF - VM.cR * VM.aR) / (VM.m * u) - u + A[1, 0] = - (VM.cF * VM.aF - VM.cR * VM.aR) / (VM.j * u) + A[1, 1] = - (VM.cF * VM.aF**2 + VM.cR * VM.aR**2) / (VM.j * u) + + # Steering input + B[0, 0] = (VM.cF + VM.chi * VM.cR) / VM.m / VM.sR + B[1, 0] = (VM.cF * VM.aF - VM.chi * VM.cR * VM.aR) / VM.j / VM.sR + + # Roll input + B[0, 1] = -ACCELERATION_DUE_TO_GRAVITY + + return A, B + + +def dyn_ss_sol(sa: float, u: float, roll: float, VM: VehicleModel) -> np.ndarray: + """Calculate the steady state solution when x_dot = 0, + Ax + Bu = 0 => x = -A^{-1} B u + + Args: + sa: Steering angle [rad] + u: Speed [m/s] + roll: Road Roll [rad] + VM: Vehicle model + + Returns: + 2x1 matrix with steady state solution + """ + A, B = create_dyn_state_matrices(u, VM) + inp = np.array([[sa], [roll]]) + return -solve(A, B) @ inp + + +def calc_slip_factor(VM): + """The slip factor is a measure of how the curvature changes with speed + it's positive for Oversteering vehicle, negative (usual case) otherwise. + """ + return VM.m * (VM.cF * VM.aF - VM.cR * VM.aR) / (VM.l**2 * VM.cF * VM.cR) diff --git a/selfdrive/controls/plannerd.py b/selfdrive/controls/plannerd.py new file mode 100755 index 000000000..02f1c19a7 --- /dev/null +++ b/selfdrive/controls/plannerd.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 +from cereal import car +from common.params import Params +from common.realtime import Priority, config_realtime_process +from selfdrive.swaglog import cloudlog +from selfdrive.controls.lib.longitudinal_planner import Planner +from selfdrive.controls.lib.lateral_planner import LateralPlanner +from selfdrive.hardware import TICI +import cereal.messaging as messaging + + +def plannerd_thread(sm=None, pm=None): + config_realtime_process(5 if TICI else 2, Priority.CTRL_LOW) + + cloudlog.info("plannerd is waiting for CarParams") + params = Params() + CP = car.CarParams.from_bytes(params.get("CarParams", block=True)) + cloudlog.info("plannerd got CarParams: %s", CP.carName) + + use_lanelines = not params.get_bool('EndToEndToggle') + wide_camera = params.get_bool('EnableWideCamera') if TICI else False + + cloudlog.event("e2e mode", on=use_lanelines) + + longitudinal_planner = Planner(CP) + lateral_planner = LateralPlanner(CP, use_lanelines=use_lanelines, wide_camera=wide_camera) + + if sm is None: + sm = messaging.SubMaster(['carState', 'controlsState', 'radarState', 'modelV2'], + poll=['radarState', 'modelV2'], ignore_avg_freq=['radarState']) + + if pm is None: + pm = messaging.PubMaster(['longitudinalPlan', 'lateralPlan']) + + while True: + sm.update() + + if sm.updated['modelV2']: + lateral_planner.update(sm) + lateral_planner.publish(sm, pm) + longitudinal_planner.update(sm) + longitudinal_planner.publish(sm, pm) + + +def main(sm=None, pm=None): + plannerd_thread(sm, pm) + + +if __name__ == "__main__": + main() diff --git a/selfdrive/controls/radard.py b/selfdrive/controls/radard.py new file mode 100755 index 000000000..65f8480c7 --- /dev/null +++ b/selfdrive/controls/radard.py @@ -0,0 +1,246 @@ +#!/usr/bin/env python3 +import importlib +import math +from collections import defaultdict, deque + +import cereal.messaging as messaging +from cereal import car +from common.numpy_fast import interp +from common.params import Params +from common.realtime import Ratekeeper, Priority, config_realtime_process +from selfdrive.config import RADAR_TO_CAMERA +from selfdrive.controls.lib.cluster.fastcluster_py import cluster_points_centroid +from selfdrive.controls.lib.radar_helpers import Cluster, Track +from selfdrive.swaglog import cloudlog +from selfdrive.hardware import TICI + + +class KalmanParams(): + def __init__(self, dt): + # Lead Kalman Filter params, calculating K from A, C, Q, R requires the control library. + # hardcoding a lookup table to compute K for values of radar_ts between 0.01s and 0.2s + assert dt > .01 and dt < .2, "Radar time step must be between .01s and 0.2s" + self.A = [[1.0, dt], [0.0, 1.0]] + self.C = [1.0, 0.0] + #Q = np.matrix([[10., 0.0], [0.0, 100.]]) + #R = 1e3 + #K = np.matrix([[ 0.05705578], [ 0.03073241]]) + dts = [dt * 0.01 for dt in range(1, 21)] + K0 = [0.12287673, 0.14556536, 0.16522756, 0.18281627, 0.1988689, 0.21372394, + 0.22761098, 0.24069424, 0.253096, 0.26491023, 0.27621103, 0.28705801, + 0.29750003, 0.30757767, 0.31732515, 0.32677158, 0.33594201, 0.34485814, + 0.35353899, 0.36200124] + K1 = [0.29666309, 0.29330885, 0.29042818, 0.28787125, 0.28555364, 0.28342219, + 0.28144091, 0.27958406, 0.27783249, 0.27617149, 0.27458948, 0.27307714, + 0.27162685, 0.27023228, 0.26888809, 0.26758976, 0.26633338, 0.26511557, + 0.26393339, 0.26278425] + self.K = [[interp(dt, dts, K0)], [interp(dt, dts, K1)]] + + +def laplacian_cdf(x, mu, b): + b = max(b, 1e-4) + return math.exp(-abs(x-mu)/b) + + +def match_vision_to_cluster(v_ego, lead, clusters): + # match vision point to best statistical cluster match + offset_vision_dist = lead.x[0] - RADAR_TO_CAMERA + + def prob(c): + prob_d = laplacian_cdf(c.dRel, offset_vision_dist, lead.xStd[0]) + prob_y = laplacian_cdf(c.yRel, -lead.y[0], lead.yStd[0]) + prob_v = laplacian_cdf(c.vRel + v_ego, lead.v[0], lead.vStd[0]) + + # This is isn't exactly right, but good heuristic + return prob_d * prob_y * prob_v + + cluster = max(clusters, key=prob) + + # if no 'sane' match is found return -1 + # stationary radar points can be false positives + dist_sane = abs(cluster.dRel - offset_vision_dist) < max([(offset_vision_dist)*.25, 5.0]) + vel_sane = (abs(cluster.vRel + v_ego - lead.v[0]) < 10) or (v_ego + cluster.vRel > 3) + if dist_sane and vel_sane: + return cluster + else: + return None + + +def get_lead(v_ego, ready, clusters, lead_msg, low_speed_override=True): + # Determine leads, this is where the essential logic happens + if len(clusters) > 0 and ready and lead_msg.prob > .5: + cluster = match_vision_to_cluster(v_ego, lead_msg, clusters) + else: + cluster = None + + lead_dict = {'status': False} + if cluster is not None: + lead_dict = cluster.get_RadarState(lead_msg.prob) + elif (cluster is None) and ready and (lead_msg.prob > .5): + lead_dict = Cluster().get_RadarState_from_vision(lead_msg, v_ego) + + if low_speed_override: + low_speed_clusters = [c for c in clusters if c.potential_low_speed_lead(v_ego)] + if len(low_speed_clusters) > 0: + closest_cluster = min(low_speed_clusters, key=lambda c: c.dRel) + + # Only choose new cluster if it is actually closer than the previous one + if (not lead_dict['status']) or (closest_cluster.dRel < lead_dict['dRel']): + lead_dict = closest_cluster.get_RadarState() + + return lead_dict + + +class RadarD(): + def __init__(self, radar_ts, delay=0): + self.current_time = 0 + + self.tracks = defaultdict(dict) + self.kalman_params = KalmanParams(radar_ts) + + # v_ego + self.v_ego = 0. + self.v_ego_hist = deque([0], maxlen=delay+1) + + self.ready = False + + def update(self, sm, rr, enable_lead): + self.current_time = 1e-9*max(sm.logMonoTime.values()) + + if sm.updated['carState']: + self.v_ego = sm['carState'].vEgo + self.v_ego_hist.append(self.v_ego) + if sm.updated['modelV2']: + self.ready = True + + ar_pts = {} + for pt in rr.points: + ar_pts[pt.trackId] = [pt.dRel, pt.yRel, pt.vRel, pt.measured] + + # *** remove missing points from meta data *** + for ids in list(self.tracks.keys()): + if ids not in ar_pts: + self.tracks.pop(ids, None) + + # *** compute the tracks *** + for ids in ar_pts: + rpt = ar_pts[ids] + + # align v_ego by a fixed time to align it with the radar measurement + v_lead = rpt[2] + self.v_ego_hist[0] + + # create the track if it doesn't exist or it's a new track + if ids not in self.tracks: + self.tracks[ids] = Track(v_lead, self.kalman_params) + self.tracks[ids].update(rpt[0], rpt[1], rpt[2], v_lead, rpt[3]) + + idens = list(sorted(self.tracks.keys())) + track_pts = [self.tracks[iden].get_key_for_cluster() for iden in idens] + + # If we have multiple points, cluster them + if len(track_pts) > 1: + cluster_idxs = cluster_points_centroid(track_pts, 2.5) + clusters = [None] * (max(cluster_idxs) + 1) + + for idx in range(len(track_pts)): + cluster_i = cluster_idxs[idx] + if clusters[cluster_i] is None: + clusters[cluster_i] = Cluster() + clusters[cluster_i].add(self.tracks[idens[idx]]) + elif len(track_pts) == 1: + # FIXME: cluster_point_centroid hangs forever if len(track_pts) == 1 + cluster_idxs = [0] + clusters = [Cluster()] + clusters[0].add(self.tracks[idens[0]]) + else: + clusters = [] + + # if a new point, reset accel to the rest of the cluster + for idx in range(len(track_pts)): + if self.tracks[idens[idx]].cnt <= 1: + aLeadK = clusters[cluster_idxs[idx]].aLeadK + aLeadTau = clusters[cluster_idxs[idx]].aLeadTau + self.tracks[idens[idx]].reset_a_lead(aLeadK, aLeadTau) + + # *** publish radarState *** + dat = messaging.new_message('radarState') + dat.valid = sm.all_alive_and_valid() and len(rr.errors) == 0 + radarState = dat.radarState + radarState.mdMonoTime = sm.logMonoTime['modelV2'] + radarState.canMonoTimes = list(rr.canMonoTimes) + radarState.radarErrors = list(rr.errors) + radarState.carStateMonoTime = sm.logMonoTime['carState'] + + if enable_lead: + leads_v3 = sm['modelV2'].leadsV3 + if len(leads_v3) > 1: + radarState.leadOne = get_lead(self.v_ego, self.ready, clusters, leads_v3[0], low_speed_override=True) + radarState.leadTwo = get_lead(self.v_ego, self.ready, clusters, leads_v3[1], low_speed_override=False) + return dat + + +# fuses camera and radar data for best lead detection +def radard_thread(sm=None, pm=None, can_sock=None): + config_realtime_process(5 if TICI else 2, Priority.CTRL_LOW) + + # wait for stats about the car to come in from controls + cloudlog.info("radard is waiting for CarParams") + CP = car.CarParams.from_bytes(Params().get("CarParams", block=True)) + cloudlog.info("radard got CarParams") + + # import the radar from the fingerprint + cloudlog.info("radard is importing %s", CP.carName) + RadarInterface = importlib.import_module(f'selfdrive.car.{CP.carName}.radar_interface').RadarInterface + + # *** setup messaging + if can_sock is None: + can_sock = messaging.sub_sock('can') + if sm is None: + sm = messaging.SubMaster(['modelV2', 'carState'], ignore_avg_freq=['modelV2', 'carState']) # Can't check average frequency, since radar determines timing + if pm is None: + pm = messaging.PubMaster(['radarState', 'liveTracks']) + + RI = RadarInterface(CP) + + rk = Ratekeeper(1.0 / CP.radarTimeStep, print_delay_threshold=None) + RD = RadarD(CP.radarTimeStep, RI.delay) + + # TODO: always log leads once we can hide them conditionally + enable_lead = CP.openpilotLongitudinalControl or not CP.radarOffCan + + while 1: + can_strings = messaging.drain_sock_raw(can_sock, wait_for_one=True) + rr = RI.update(can_strings) + + if rr is None: + continue + + sm.update(0) + + dat = RD.update(sm, rr, enable_lead) + dat.radarState.cumLagMs = -rk.remaining*1000. + + pm.send('radarState', dat) + + # *** publish tracks for UI debugging (keep last) *** + tracks = RD.tracks + dat = messaging.new_message('liveTracks', len(tracks)) + + for cnt, ids in enumerate(sorted(tracks.keys())): + dat.liveTracks[cnt] = { + "trackId": ids, + "dRel": float(tracks[ids].dRel), + "yRel": float(tracks[ids].yRel), + "vRel": float(tracks[ids].vRel), + } + pm.send('liveTracks', dat) + + rk.monitor_time() + + +def main(sm=None, pm=None, can_sock=None): + radard_thread(sm, pm, can_sock) + + +if __name__ == "__main__": + main() diff --git a/selfdrive/debug/__init__.py b/selfdrive/debug/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/debug/can_print_changes.py b/selfdrive/debug/can_print_changes.py new file mode 100755 index 000000000..4fa775ac1 --- /dev/null +++ b/selfdrive/debug/can_print_changes.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 +import binascii +import sys +from collections import defaultdict + +import cereal.messaging as messaging +from common.realtime import sec_since_boot + + +def can_printer(bus=0): + """Collects messages and prints when a new bit transition is observed. + This is very useful to find signals based on user triggered actions, such as blinkers and seatbelt. + Leave the script running until no new transitions are seen, then perform the action.""" + logcan = messaging.sub_sock('can') + + low_to_high = defaultdict(int) + high_to_low = defaultdict(int) + + while 1: + can_recv = messaging.drain_sock(logcan, wait_for_one=True) + for x in can_recv: + for y in x.can: + if y.src == bus: + i = int.from_bytes(y.dat, byteorder='big') + + l_h = low_to_high[y.address] + h_l = high_to_low[y.address] + + change = None + if (i | l_h) != l_h: + low_to_high[y.address] = i | l_h + change = "+" + + if (~i | h_l) != h_l: + high_to_low[y.address] = ~i | h_l + change = "-" + + if change: + print(f"{sec_since_boot():.2f}\t{hex(y.address)} ({y.address})\t{change}{binascii.hexlify(y.dat)}") + + +if __name__ == "__main__": + if len(sys.argv) > 1: + can_printer(int(sys.argv[1])) + else: + can_printer() diff --git a/selfdrive/debug/can_printer.py b/selfdrive/debug/can_printer.py new file mode 100755 index 000000000..0aaaf1350 --- /dev/null +++ b/selfdrive/debug/can_printer.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +import argparse +import binascii +from collections import defaultdict + +import cereal.messaging as messaging +from common.realtime import sec_since_boot + + +def can_printer(bus, max_msg, addr, ascii_decode): + logcan = messaging.sub_sock('can', addr=addr) + + start = sec_since_boot() + lp = sec_since_boot() + msgs = defaultdict(list) + while 1: + can_recv = messaging.drain_sock(logcan, wait_for_one=True) + for x in can_recv: + for y in x.can: + if y.src == bus: + msgs[y.address].append(y.dat) + + if sec_since_boot() - lp > 0.1: + dd = chr(27) + "[2J" + dd += f"{sec_since_boot() - start:5.2f}\n" + for addr in sorted(msgs.keys()): + a = f"\"{msgs[addr][-1].decode('ascii', 'backslashreplace')}\"" if ascii_decode else "" + x = binascii.hexlify(msgs[addr][-1]).decode('ascii') + if max_msg is None or addr < max_msg: + dd += "%04X(%4d)(%6d) %s %s\n" % (addr, addr, len(msgs[addr]), x.ljust(20), a) + print(dd) + lp = sec_since_boot() + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="simple CAN data viewer", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + + parser.add_argument("--bus", type=int, help="CAN bus to print out", default=0) + parser.add_argument("--max_msg", type=int, help="max addr") + parser.add_argument("--ascii", action='store_true', help="decode as ascii") + parser.add_argument("--addr", default="127.0.0.1") + + args = parser.parse_args() + can_printer(args.bus, args.max_msg, args.addr, args.ascii) diff --git a/selfdrive/debug/check_freq.py b/selfdrive/debug/check_freq.py new file mode 100755 index 000000000..424ad67b6 --- /dev/null +++ b/selfdrive/debug/check_freq.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +# type: ignore + +import argparse +import numpy as np +from collections import defaultdict, deque +from common.realtime import sec_since_boot +import cereal.messaging as messaging + + +if __name__ == "__main__": + context = messaging.Context() + poller = messaging.Poller() + + parser = argparse.ArgumentParser() + parser.add_argument("socket", type=str, nargs='*', help="socket name") + args = parser.parse_args() + + socket_names = args.socket + sockets = {} + + rcv_times = defaultdict(lambda: deque(maxlen=100)) + valids = defaultdict(lambda: deque(maxlen=100)) + + t = sec_since_boot() + for name in socket_names: + sock = messaging.sub_sock(name, poller=poller) + sockets[sock] = name + + prev_print = t + while True: + for socket in poller.poll(100): + msg = messaging.recv_one(socket) + name = msg.which() + + t = sec_since_boot() + rcv_times[name].append(msg.logMonoTime / 1e9) + valids[name].append(msg.valid) + + if t - prev_print > 1: + print() + for name in socket_names: + dts = np.diff(rcv_times[name]) + mean = np.mean(dts) + print(f"{name}: Freq {1.0 / mean:.2f} Hz, Min {np.min(dts) / mean * 100:.2f}%, Max {np.max(dts) / mean * 100:.2f}%, valid ", all(valids[name])) + + prev_print = t diff --git a/selfdrive/debug/check_lag.py b/selfdrive/debug/check_lag.py new file mode 100755 index 000000000..c92264298 --- /dev/null +++ b/selfdrive/debug/check_lag.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +# type: ignore + +import cereal.messaging as messaging +from cereal.services import service_list + +TO_CHECK = ['carState'] + + +if __name__ == "__main__": + sm = messaging.SubMaster(TO_CHECK) + + prev_t = {} + + while True: + sm.update() + + for s in TO_CHECK: + if sm.updated[s]: + t = sm.logMonoTime[s] / 1e9 + + if s in prev_t: + expected = 1.0 / (service_list[s].frequency) + dt = t - prev_t[s] + if dt > 10 * expected: + print(t, s, dt) + + prev_t[s] = t diff --git a/selfdrive/debug/check_timings.py b/selfdrive/debug/check_timings.py new file mode 100755 index 000000000..03e39fd70 --- /dev/null +++ b/selfdrive/debug/check_timings.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 +# type: ignore +import sys +import time +import numpy as np +from collections import defaultdict, deque + +import cereal.messaging as messaging + +socks = {s: messaging.sub_sock(s, conflate=False) for s in sys.argv[1:]} +ts = defaultdict(lambda: deque(maxlen=100)) + +if __name__ == "__main__": + while True: + print() + for s, sock in socks.items(): + msgs = messaging.drain_sock(sock) + for m in msgs: + ts[s].append(m.logMonoTime / 1e6) + + if len(ts[s]): + d = np.diff(ts[s]) + print(f"{s:25} {np.mean(d):.2f} {np.std(d):.2f} {np.max(d):.2f} {np.min(d):.2f}") + time.sleep(1) diff --git a/selfdrive/debug/compare_fingerprints.py b/selfdrive/debug/compare_fingerprints.py new file mode 100755 index 000000000..5b7ba58b1 --- /dev/null +++ b/selfdrive/debug/compare_fingerprints.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +# flake8: noqa + +# put 2 fingeprints and print the diffs +f1 = { +168: 8, 257: 5, 258: 8, 264: 8, 268: 8, 270: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 291: 8, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 520: 8, 528: 8, 532: 8, 544: 8, 557: 8, 559: 8, 560: 8, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 653: 8, 654: 8, 655: 8, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 678: 8, 680: 8, 701: 8, 703: 8, 704: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 729: 5, 736: 8, 737: 8, 746: 5, 752: 2, 754: 8, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 782: 8, 784: 8, 792: 8, 799: 8, 800: 8, 804: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 878: 8, 882: 8, 897: 8, 906: 8, 908: 8, 924: 8, 926: 3, 929: 8, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 958: 8, 959: 8, 962: 8, 969: 4, 973: 8, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1082: 8, 1083: 8, 1098: 8, 1100: 8, 1537: 8, 1538: 8, 1562: 8 +} + +f2 = { +168: 8, 257: 5, 258: 8, 264: 8, 268: 8, 270: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 291: 8, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 515: 7, 516: 7, 517: 7, 518: 7, 520: 8, 528: 8, 532: 8, 542: 8, 544: 8, 557: 8, 559: 8, 560: 8, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 653: 8, 654: 8, 655: 8, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 678: 8, 680: 8, 701: 8, 703: 8, 704: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 729: 5, 736: 8, 737: 8, 746: 5, 752: 2, 754: 8, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 782: 8, 784: 8, 792: 8, 799: 8, 800: 8, 804: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 878: 8, 882: 8, 897: 8, 906: 8, 908: 8, 924: 8, 926: 3, 929: 8, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 958: 8, 959: 8, 962: 8, 969: 4, 973: 8, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1082: 8, 1083: 8, 1098: 8, 1100: 8 +} + +for k in f1: + if k not in f2 or f1[k] != f2[k]: + print(k, "not in f2") + +for k in f2: + if k not in f1 or f2[k] != f1[k]: + print(k, "not in f1") diff --git a/selfdrive/debug/count_events.py b/selfdrive/debug/count_events.py new file mode 100755 index 000000000..8b32ce9d2 --- /dev/null +++ b/selfdrive/debug/count_events.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +import sys +from collections import Counter +from pprint import pprint +from tqdm import tqdm + +from tools.lib.route import Route +from tools.lib.logreader import LogReader + +if __name__ == "__main__": + r = Route(sys.argv[1]) + + cnt_valid: Counter = Counter() + cnt_events: Counter = Counter() + + for q in tqdm(r.qlog_paths()): + if q is None: + continue + lr = list(LogReader(q)) + for msg in lr: + if msg.which() == 'carEvents': + for e in msg.carEvents: + cnt_events[e.name] += 1 + if not msg.valid: + cnt_valid[msg.which()] += 1 + + print("Events") + pprint(cnt_events) + + print("\n\n") + print("Not valid") + pprint(cnt_valid) diff --git a/selfdrive/debug/cpu_usage_stat.py b/selfdrive/debug/cpu_usage_stat.py new file mode 100755 index 000000000..76e809d2c --- /dev/null +++ b/selfdrive/debug/cpu_usage_stat.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python3 +# type: ignore +''' +System tools like top/htop can only show current cpu usage values, so I write this script to do statistics jobs. + Features: + Use psutil library to sample cpu usage(avergage for all cores) of openpilot processes, at a rate of 5 samples/sec. + Do cpu usage statistics periodically, 5 seconds as a cycle. + Caculate the average cpu usage within this cycle. + Caculate minumium/maximium/accumulated_average cpu usage as long term inspections. + Monitor multiple processes simuteneously. + Sample usage: + root@localhost:/data/openpilot$ python selfdrive/debug/cpu_usage_stat.py boardd,ubloxd + ('Add monitored proc:', './boardd') + ('Add monitored proc:', 'python locationd/ubloxd.py') + boardd: 1.96%, min: 1.96%, max: 1.96%, acc: 1.96% + ubloxd.py: 0.39%, min: 0.39%, max: 0.39%, acc: 0.39% +''' +import psutil +import time +import os +import sys +import numpy as np +import argparse +import re +from collections import defaultdict + +from selfdrive.manager.process_config import managed_processes + +# Do statistics every 5 seconds +PRINT_INTERVAL = 5 +SLEEP_INTERVAL = 0.2 + +monitored_proc_names = [ + # android procs + 'SurfaceFlinger', 'sensors.qcom' +] + list(managed_processes.keys()) + +cpu_time_names = ['user', 'system', 'children_user', 'children_system'] + +timer = getattr(time, 'monotonic', time.time) + + +def get_arg_parser(): + parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) + + parser.add_argument("proc_names", nargs="?", default='', + help="Process names to be monitored, comma separated") + parser.add_argument("--list_all", action='store_true', + help="Show all running processes' cmdline") + parser.add_argument("--detailed_times", action='store_true', + help="show cpu time details (split by user, system, child user, child system)") + return parser + + +if __name__ == "__main__": + args = get_arg_parser().parse_args(sys.argv[1:]) + if args.list_all: + for p in psutil.process_iter(): + print('cmdline', p.cmdline(), 'name', p.name()) + sys.exit(0) + + if len(args.proc_names) > 0: + monitored_proc_names = args.proc_names.split(',') + monitored_procs = [] + stats = {} + for p in psutil.process_iter(): + if p == psutil.Process(): + continue + matched = any(l for l in p.cmdline() if any(pn for pn in monitored_proc_names if re.match(r'.*{}.*'.format(pn), l, re.M | re.I))) + if matched: + k = ' '.join(p.cmdline()) + print('Add monitored proc:', k) + stats[k] = {'cpu_samples': defaultdict(list), 'min': defaultdict(lambda: None), 'max': defaultdict(lambda: None), + 'avg': defaultdict(lambda: 0.0), 'last_cpu_times': None, 'last_sys_time': None} + stats[k]['last_sys_time'] = timer() + stats[k]['last_cpu_times'] = p.cpu_times() + monitored_procs.append(p) + i = 0 + interval_int = int(PRINT_INTERVAL / SLEEP_INTERVAL) + while True: + for p in monitored_procs: + k = ' '.join(p.cmdline()) + cur_sys_time = timer() + cur_cpu_times = p.cpu_times() + cpu_times = np.subtract(cur_cpu_times, stats[k]['last_cpu_times']) / (cur_sys_time - stats[k]['last_sys_time']) + stats[k]['last_sys_time'] = cur_sys_time + stats[k]['last_cpu_times'] = cur_cpu_times + cpu_percent = 0 + for num, name in enumerate(cpu_time_names): + stats[k]['cpu_samples'][name].append(cpu_times[num]) + cpu_percent += cpu_times[num] + stats[k]['cpu_samples']['total'].append(cpu_percent) + time.sleep(SLEEP_INTERVAL) + i += 1 + if i % interval_int == 0: + l = [] + for k, stat in stats.items(): + if len(stat['cpu_samples']) <= 0: + continue + for name, samples in stat['cpu_samples'].items(): + samples = np.array(samples) + avg = samples.mean() + c = samples.size + min_cpu = np.amin(samples) + max_cpu = np.amax(samples) + if stat['min'][name] is None or min_cpu < stat['min'][name]: + stat['min'][name] = min_cpu + if stat['max'][name] is None or max_cpu > stat['max'][name]: + stat['max'][name] = max_cpu + stat['avg'][name] = (stat['avg'][name] * (i - c) + avg * c) / (i) + stat['cpu_samples'][name] = [] + + msg = f"avg: {stat['avg']['total']:.2%}, min: {stat['min']['total']:.2%}, max: {stat['max']['total']:.2%} {os.path.basename(k)}" + if args.detailed_times: + for stat_type in ['avg', 'min', 'max']: + msg += f"\n {stat_type}: {[(name + ':' + str(round(stat[stat_type][name] * 100, 2))) for name in cpu_time_names]}" + l.append((os.path.basename(k), stat['avg']['total'], msg)) + l.sort(key=lambda x: -x[1]) + for x in l: + print(x[2]) + print('avg sum: {:.2%} over {} samples {} seconds\n'.format( + sum(stat['avg']['total'] for k, stat in stats.items()), i, i * SLEEP_INTERVAL + )) diff --git a/selfdrive/debug/cycle_alerts.py b/selfdrive/debug/cycle_alerts.py new file mode 100755 index 000000000..f28d5373f --- /dev/null +++ b/selfdrive/debug/cycle_alerts.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python3 +# flake8: noqa +# pylint: skip-file +# type: ignore + +import time + +from cereal import car, log +import cereal.messaging as messaging +from common.realtime import DT_CTRL +from selfdrive.car.honda.interface import CarInterface +from selfdrive.controls.lib.events import ET, EVENTS, Events +from selfdrive.controls.lib.alertmanager import AlertManager + +EventName = car.CarEvent.EventName + +def cycle_alerts(duration=200, is_metric=False): + # all alerts + #alerts = list(EVENTS.keys()) + + # this plays each type of audible alert + alerts = [ + (EventName.buttonEnable, ET.ENABLE), + (EventName.buttonCancel, ET.USER_DISABLE), + (EventName.wrongGear, ET.NO_ENTRY), + + (EventName.vehicleModelInvalid, ET.SOFT_DISABLE), + (EventName.accFaulted, ET.IMMEDIATE_DISABLE), + + # DM sequence + (EventName.preDriverDistracted, ET.WARNING), + (EventName.promptDriverDistracted, ET.WARNING), + (EventName.driverDistracted, ET.WARNING), + ] + + CP = CarInterface.get_params("HONDA CIVIC 2016") + sm = messaging.SubMaster(['deviceState', 'pandaStates', 'roadCameraState', 'modelV2', 'liveCalibration', + 'driverMonitoringState', 'longitudinalPlan', 'lateralPlan', 'liveLocationKalman']) + + pm = messaging.PubMaster(['controlsState', 'pandaStates', 'deviceState']) + + events = Events() + AM = AlertManager() + + frame = 0 + while True: + current_alert_types = [ET.PERMANENT, ET.USER_DISABLE, ET.IMMEDIATE_DISABLE, + ET.SOFT_DISABLE, ET.PRE_ENABLE, ET.NO_ENTRY, + ET.ENABLE, ET.WARNING] + + for alert, et in alerts: + events.clear() + events.add(alert) + + a = events.create_alerts([et, ], [CP, sm, is_metric, 0]) + AM.add_many(frame, a) + AM.process_alerts(frame) + print(AM.alert) + for _ in range(duration): + dat = messaging.new_message() + dat.init('controlsState') + dat.controlsState.enabled = True + + dat.controlsState.alertText1 = AM.alert_text_1 + dat.controlsState.alertText2 = AM.alert_text_2 + dat.controlsState.alertSize = AM.alert_size + dat.controlsState.alertStatus = AM.alert_status + dat.controlsState.alertBlinkingRate = AM.alert_rate + dat.controlsState.alertType = AM.alert_type + dat.controlsState.alertSound = AM.audible_alert + pm.send('controlsState', dat) + + dat = messaging.new_message() + dat.init('deviceState') + dat.deviceState.started = True + pm.send('deviceState', dat) + + dat = messaging.new_message('pandaStates', 1) + dat.pandaStates[0].ignitionLine = True + dat.pandaStates[0].pandaType = log.PandaState.PandaType.uno + pm.send('pandaStates', dat) + + frame += 1 + time.sleep(DT_CTRL) + +if __name__ == '__main__': + cycle_alerts() diff --git a/selfdrive/debug/disable_ecu.py b/selfdrive/debug/disable_ecu.py new file mode 100644 index 000000000..f0faf4001 --- /dev/null +++ b/selfdrive/debug/disable_ecu.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 +import traceback + +import cereal.messaging as messaging +from selfdrive.car.isotp_parallel_query import IsoTpParallelQuery +from selfdrive.swaglog import cloudlog + +EXT_DIAG_REQUEST = b'\x10\x03' +EXT_DIAG_RESPONSE = b'\x50\x03' +COM_CONT_REQUEST = b'\x28\x83\x03' +COM_CONT_RESPONSE = b'' + +def disable_ecu(ecu_addr, logcan, sendcan, bus, timeout=0.5, retry=5, debug=False): + print(f"ecu disable {hex(ecu_addr)} ...") + for i in range(retry): + try: + # enter extended diagnostic session + query = IsoTpParallelQuery(sendcan, logcan, bus, [ecu_addr], [EXT_DIAG_REQUEST], [EXT_DIAG_RESPONSE], debug=debug) + for addr, dat in query.get_data(timeout).items(): # pylint: disable=unused-variable + print("ecu communication control disable tx/rx ...") + # communication control disable tx and rx + query = IsoTpParallelQuery(sendcan, logcan, bus, [ecu_addr], [COM_CONT_REQUEST], [COM_CONT_RESPONSE], debug=debug) + query.get_data(0) + return True + print(f"ecu disable retry ({i+1}) ...") + except Exception: + cloudlog.warning(f"ecu disable exception: {traceback.format_exc()}") + + return False + + +if __name__ == "__main__": + import time + sendcan = messaging.pub_sock('sendcan') + logcan = messaging.sub_sock('can') + time.sleep(1) + + # honda bosch radar disable + disabled = disable_ecu(0x18DAB0F1, logcan, sendcan, 1, debug=False) + print(f"disabled: {disabled}") diff --git a/selfdrive/debug/dump.py b/selfdrive/debug/dump.py new file mode 100755 index 000000000..f208920f1 --- /dev/null +++ b/selfdrive/debug/dump.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 +import os +import sys +import argparse +import json +from hexdump import hexdump +import codecs +codecs.register_error("strict", codecs.backslashreplace_errors) + +from cereal import log +import cereal.messaging as messaging +from cereal.services import service_list + +if __name__ == "__main__": + + parser = argparse.ArgumentParser(description='Dump communcation sockets. See cereal/services.py for a complete list of available sockets.') + parser.add_argument('--pipe', action='store_true') + parser.add_argument('--raw', action='store_true') + parser.add_argument('--json', action='store_true') + parser.add_argument('--dump-json', action='store_true') + parser.add_argument('--no-print', action='store_true') + parser.add_argument('--addr', default='127.0.0.1') + parser.add_argument('--values', help='values to monitor (instead of entire event)') + parser.add_argument("socket", type=str, nargs='*', help="socket names to dump. defaults to all services defined in cereal") + args = parser.parse_args() + + if args.addr != "127.0.0.1": + os.environ["ZMQ"] = "1" + messaging.context = messaging.Context() + + poller = messaging.Poller() + + for m in args.socket if len(args.socket) > 0 else service_list: + messaging.sub_sock(m, poller, addr=args.addr) + + values = None + if args.values: + values = [s.strip().split(".") for s in args.values.split(",")] + + while 1: + polld = poller.poll(100) + for sock in polld: + msg = sock.receive() + evt = log.Event.from_bytes(msg) + + if not args.no_print: + if args.pipe: + sys.stdout.write(msg) + sys.stdout.flush() + elif args.raw: + hexdump(msg) + elif args.json: + print(json.loads(msg)) + elif args.dump_json: + print(json.dumps(evt.to_dict())) + elif values: + print(f"logMonotime = {evt.logMonoTime}") + for value in values: + if hasattr(evt, value[0]): + item = evt + for key in value: + item = getattr(item, key) + print(f"{'.'.join(value)} = {item}") + print("") + else: + try: + print(evt) + except UnicodeDecodeError: + w = evt.which() + s = f"( logMonoTime {evt.logMonoTime} \n {w} = " + s += str(evt.__getattr__(w)) + s += f"\n valid = {evt.valid} )" + print(s) diff --git a/selfdrive/debug/filter_log_message.py b/selfdrive/debug/filter_log_message.py new file mode 100755 index 000000000..98e7d8724 --- /dev/null +++ b/selfdrive/debug/filter_log_message.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python3 +import argparse +import json + +import cereal.messaging as messaging +from tools.lib.robust_logreader import RobustLogReader as LogReader +from tools.lib.route import Route + +LEVELS = { + "DEBUG": 10, + "INFO": 20, + "WARNING": 30, + "ERROR": 40, + "CRITICAL": 50, +} + +ANDROID_LOG_SOURCE = { + 0: "MAIN", + 1: "RADIO", + 2: "EVENTS", + 3: "SYSTEM", + 4: "CRASH", + 5: "KERNEL", +} + + +def print_logmessage(t, msg, min_level): + try: + log = json.loads(msg) + if log['levelnum'] >= min_level: + print(f"[{t / 1e9:.6f}] {log['filename']}:{log.get('lineno', '')} - {log.get('funcname', '')}: {log['msg']}") + if 'exc_info' in log: + print(log['exc_info']) + except json.decoder.JSONDecodeError: + print(f"[{t / 1e9:.6f}] decode error: {msg}") + + +def print_androidlog(t, msg): + source = ANDROID_LOG_SOURCE[msg.id] + try: + m = json.loads(msg.message)['MESSAGE'] + except Exception: + m = msg.message + + print(f"[{t / 1e9:.6f}] {source} {msg.pid} {msg.tag} - {m}") + + +if __name__ == "__main__": + + parser = argparse.ArgumentParser() + parser.add_argument('--level', default='DEBUG') + parser.add_argument('--addr', default='127.0.0.1') + parser.add_argument("route", type=str, nargs='*', help="route name + segment number for offline usage") + args = parser.parse_args() + + logs = None + if len(args.route): + r = Route(args.route[0]) + logs = r.log_paths() + + if len(args.route) == 2 and logs: + n = int(args.route[1]) + logs = [logs[n]] + + min_level = LEVELS[args.level] + + if logs: + for log in logs: + if log: + lr = LogReader(log) + for m in lr: + if m.which() == 'logMessage': + print_logmessage(m.logMonoTime, m.logMessage, min_level) + elif m.which() == 'androidLog': + print_androidlog(m.logMonoTime, m.androidLog) + else: + sm = messaging.SubMaster(['logMessage', 'androidLog'], addr=args.addr) + while True: + sm.update() + + if sm.updated['logMessage']: + print_logmessage(sm.logMonoTime['logMessage'], sm['logMessage'], min_level) + + if sm.updated['androidLog']: + print_androidlog(sm.logMonoTime['androidLog'], sm['androidLog']) diff --git a/selfdrive/debug/fingerprint_from_route.py b/selfdrive/debug/fingerprint_from_route.py new file mode 100755 index 000000000..326e68f8e --- /dev/null +++ b/selfdrive/debug/fingerprint_from_route.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 + +import sys +from tools.lib.route import Route +from tools.lib.logreader import MultiLogIterator + + +def get_fingerprint(lr): + # TODO: make this a nice tool for car ports. should also work with qlogs for FW + + fw = None + msgs = {} + for msg in lr: + if msg.which() == 'carParams': + fw = msg.carParams.carFw + elif msg.which() == 'can': + for c in msg.can: + # read also msgs sent by EON on CAN bus 0x80 and filter out the + # addr with more than 11 bits + if c.src % 0x80 == 0 and c.address < 0x800: + msgs[c.address] = len(c.dat) + + # show CAN fingerprint + fingerprint = ', '.join("%d: %d" % v for v in sorted(msgs.items())) + print(f"\nfound {len(msgs)} messages. CAN fingerprint:\n") + print(fingerprint) + + # TODO: also print the fw fingerprint merged with the existing ones + # show FW fingerprint + print("\nFW fingerprint:\n") + for f in fw: + print(f" (Ecu.{f.ecu}, {hex(f.address)}, {None if f.subAddress == 0 else f.subAddress}): [") + print(f" {f.fwVersion},") + print(" ],") + print() + + +if __name__ == "__main__": + if len(sys.argv) < 2: + print("Usage: ./fingerprint_from_route.py ") + sys.exit(1) + + route = Route(sys.argv[1]) + lr = MultiLogIterator(route.log_paths()[:5]) + get_fingerprint(lr) diff --git a/selfdrive/debug/get_fingerprint.py b/selfdrive/debug/get_fingerprint.py new file mode 100755 index 000000000..e678db4f1 --- /dev/null +++ b/selfdrive/debug/get_fingerprint.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +# simple script to get a vehicle fingerprint. + +# Instructions: +# - connect to a Panda +# - run selfdrive/boardd/boardd +# - launching this script +# Note: it's very important that the car is in stock mode, in order to collect a complete fingerprint +# - since some messages are published at low frequency, keep this script running for at least 30s, +# until all messages are received at least once + +import cereal.messaging as messaging + +logcan = messaging.sub_sock('can') +msgs = {} +while True: + lc = messaging.recv_sock(logcan, True) + if lc is None: + continue + + for c in lc.can: + # read also msgs sent by EON on CAN bus 0x80 and filter out the + # addr with more than 11 bits + if c.src in [0, 2] and c.address < 0x800: + msgs[c.address] = len(c.dat) + + fingerprint = ', '.join("%d: %d" % v for v in sorted(msgs.items())) + + print(f"number of messages {len(msgs)}:") + print(f"fingerprint {fingerprint}") diff --git a/selfdrive/debug/hyundai_enable_radar_points.py b/selfdrive/debug/hyundai_enable_radar_points.py new file mode 100755 index 000000000..8132a4655 --- /dev/null +++ b/selfdrive/debug/hyundai_enable_radar_points.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python3 +"""Some Hyundai radars can be reconfigured to output (debug) radar points on bus 1. +Reconfiguration is done over UDS by reading/writing to 0x0142 using the Read/Write Data By Identifier +endpoints (0x22 & 0x2E). This script checks your radar firmware version against a list of known +firmware versions. If you want to try on a new radar make sure to note the default config value +in case it's different from the other radars and you need to revert the changes. + +After changing the config the car should not show any faults when openpilot is not running. +These config changes are persistent accross car reboots. You need to run this script again +to go back to the default values. + +USE AT YOUR OWN RISK! Safety features, like AEB and FCW, might be affected by these changes.""" + +import sys +import argparse +from typing import NamedTuple +from subprocess import check_output, CalledProcessError + +from panda.python import Panda +from panda.python.uds import UdsClient, SESSION_TYPE, DATA_IDENTIFIER_TYPE + +class ConfigValues(NamedTuple): + default_config: bytes + tracks_enabled: bytes + +# If your radar supports changing data identifier 0x0142 as well make a PR to +# this file to add your firmware version. Make sure to post a drive as proof! +# NOTE: these firmware versions do not match what openpilot uses +# because this script uses a different diagnostic session type +SUPPORTED_FW_VERSIONS = { + # 2020 SONATA + b"DN8_ SCC FHCUP 1.00 1.00 99110-L0000\x19\x08)\x15T ": ConfigValues( + default_config=b"\x00\x00\x00\x01\x00\x00", + tracks_enabled=b"\x00\x00\x00\x01\x00\x01"), + # 2021 SONATA HYBRID + b"DNhe SCC FHCUP 1.00 1.02 99110-L5000 \x01#\x15# ": ConfigValues( + default_config=b"\x00\x00\x00\x01\x00\x00", + tracks_enabled=b"\x00\x00\x00\x01\x00\x01"), + # 2020 PALISADE + b"LX2_ SCC FHCUP 1.00 1.04 99110-S8100\x19\x05\x02\x16V ": ConfigValues( + default_config=b"\x00\x00\x00\x01\x00\x00", + tracks_enabled=b"\x00\x00\x00\x01\x00\x01"), + # 2022 PALISADE + b"LX2_ SCC FHCUP 1.00 1.00 99110-S8110!\x04\x05\x17\x01 ": ConfigValues( + default_config=b"\x00\x00\x00\x01\x00\x00", + tracks_enabled=b"\x00\x00\x00\x01\x00\x01"), + # 2020 SANTA FE + b"TM__ SCC F-CUP 1.00 1.03 99110-S2000\x19\x050\x13' ": ConfigValues( + default_config=b"\x00\x00\x00\x01\x00\x00", + tracks_enabled=b"\x00\x00\x00\x01\x00\x01"), + # 2020 GENESIS G70 + b'IK__ SCC F-CUP 1.00 1.02 96400-G9100\x18\x07\x06\x17\x12 ': ConfigValues( + default_config=b"\x00\x00\x00\x01\x00\x00", + tracks_enabled=b"\x00\x00\x00\x01\x00\x01"), +} + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='configure radar to output points (or reset to default)') + parser.add_argument('--default', action="store_true", default=False, help='reset to default configuration (default: false)') + parser.add_argument('--debug', action="store_true", default=False, help='enable debug output (default: false)') + parser.add_argument('--bus', type=int, default=0, help='can bus to use (default: 0)') + args = parser.parse_args() + + try: + check_output(["pidof", "boardd"]) + print("boardd is running, please kill openpilot before running this script! (aborted)") + sys.exit(1) + except CalledProcessError as e: + if e.returncode != 1: # 1 == no process found (boardd not running) + raise e + + confirm = input("power on the vehicle keeping the engine off (press start button twice) then type OK to continue: ").upper().strip() + if confirm != "OK": + print("\nyou didn't type 'OK! (aborted)") + sys.exit(0) + + panda = Panda() # type: ignore + panda.set_safety_mode(Panda.SAFETY_ELM327) + uds_client = UdsClient(panda, 0x7D0, bus=args.bus, debug=args.debug) + + print("\n[START DIAGNOSTIC SESSION]") + session_type : SESSION_TYPE = 0x07 # type: ignore + uds_client.diagnostic_session_control(session_type) + + print("[HARDWARE/SOFTWARE VERSION]") + fw_version_data_id : DATA_IDENTIFIER_TYPE = 0xf100 # type: ignore + fw_version = uds_client.read_data_by_identifier(fw_version_data_id) + print(fw_version) + if fw_version not in SUPPORTED_FW_VERSIONS.keys(): + print("radar not supported! (aborted)") + sys.exit(1) + + print("[GET CONFIGURATION]") + config_data_id : DATA_IDENTIFIER_TYPE = 0x0142 # type: ignore + current_config = uds_client.read_data_by_identifier(config_data_id) + config_values = SUPPORTED_FW_VERSIONS[fw_version] + new_config = config_values.default_config if args.default else config_values.tracks_enabled + print(f"current config: 0x{current_config.hex()}") + if current_config != new_config: + print("[CHANGE CONFIGURATION]") + print(f"new config: 0x{new_config.hex()}") + uds_client.write_data_by_identifier(config_data_id, new_config) + if not args.default and current_config != SUPPORTED_FW_VERSIONS[fw_version].default_config: + print("\ncurrent config does not match expected default! (aborted)") + sys.exit(1) + + print("[DONE]") + print("\nrestart your vehicle and ensure there are no faults") + if not args.default: + print("you can run this script again with --default to go back to the original (factory) settings") + else: + print("[DONE]") + print("\ncurrent config is already the desired configuration") + sys.exit(0) diff --git a/selfdrive/debug/live_cpu_and_temp.py b/selfdrive/debug/live_cpu_and_temp.py new file mode 100755 index 000000000..e46c0b0a1 --- /dev/null +++ b/selfdrive/debug/live_cpu_and_temp.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python3 +import argparse + +from cereal.messaging import SubMaster +from common.numpy_fast import mean + + +def cputime_total(ct): + return ct.user + ct.nice + ct.system + ct.idle + ct.iowait + ct.irq + ct.softirq + + +def cputime_busy(ct): + return ct.user + ct.nice + ct.system + ct.irq + ct.softirq + + +def proc_cputime_total(ct): + return ct.cpuUser + ct.cpuSystem + ct.cpuChildrenUser + ct.cpuChildrenSystem + + +def proc_name(proc): + name = proc.name + if len(proc.cmdline): + name = proc.cmdline[0] + if len(proc.exe): + name = proc.exe + " - " + name + + return name + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('--mem', action='store_true') + parser.add_argument('--cpu', action='store_true') + args = parser.parse_args() + + sm = SubMaster(['deviceState', 'procLog']) + + last_temp = 0.0 + last_mem = 0.0 + total_times = [0.]*8 + busy_times = [0.]*8 + + prev_proclog = None + prev_proclog_t = None + + while True: + sm.update() + + if sm.updated['deviceState']: + t = sm['deviceState'] + last_temp = mean(t.cpuTempC) + last_mem = t.memoryUsagePercent + + if sm.updated['procLog']: + m = sm['procLog'] + + cores = [0.]*8 + total_times_new = [0.]*8 + busy_times_new = [0.]*8 + + for c in m.cpuTimes: + n = c.cpuNum + total_times_new[n] = cputime_total(c) + busy_times_new[n] = cputime_busy(c) + + for n in range(8): + t_busy = busy_times_new[n] - busy_times[n] + t_total = total_times_new[n] - total_times[n] + cores[n] = t_busy / t_total + + total_times = total_times_new[:] + busy_times = busy_times_new[:] + + print(f"CPU {100.0 * mean(cores):.2f}% - RAM: {last_mem:.2f}% - Temp {last_temp:.2f}C") + + if args.cpu and prev_proclog is not None: + procs = {} + dt = (sm.logMonoTime['procLog'] - prev_proclog_t) / 1e9 + for proc in m.procs: + try: + name = proc_name(proc) + prev_proc = [p for p in prev_proclog.procs if proc.pid == p.pid][0] + cpu_time = proc_cputime_total(proc) - proc_cputime_total(prev_proc) + cpu_usage = cpu_time / dt * 100. + procs[name] = cpu_usage + except IndexError: + pass + + print("Top CPU usage:") + for k, v in sorted(procs.items(), key=lambda item: item[1], reverse=True)[:10]: + print(f"{k.rjust(70)} {v:.2f} %") + print() + + if args.mem: + mems = {} + for proc in m.procs: + name = proc_name(proc) + mems[name] = float(proc.memRss) / 1e6 + print("Top memory usage:") + for k, v in sorted(mems.items(), key=lambda item: item[1], reverse=True)[:10]: + print(f"{k.rjust(70)} {v:.2f} MB") + print() + + prev_proclog = m + prev_proclog_t = sm.logMonoTime['procLog'] diff --git a/selfdrive/debug/run_process_on_route.py b/selfdrive/debug/run_process_on_route.py new file mode 100755 index 000000000..a6e67d2b2 --- /dev/null +++ b/selfdrive/debug/run_process_on_route.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +import argparse + +from selfdrive.test.process_replay.compare_logs import save_log +from selfdrive.test.process_replay.process_replay import CONFIGS, replay_process +from tools.lib.logreader import MultiLogIterator +from tools.lib.route import Route + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Run process on route and create new logs", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument("route", help="The route name to use") + parser.add_argument("process", help="The process to run") + args = parser.parse_args() + + cfg = [c for c in CONFIGS if c.proc_name == args.process][0] + + route = Route(args.route) + lr = MultiLogIterator(route.log_paths()) + inputs = list(lr) + + outputs = replay_process(cfg, inputs) + + # Remove message generated by the process under test and merge in the new messages + produces = {o.which() for o in outputs} + inputs = [i for i in inputs if i.which() not in produces] + outputs = sorted(inputs + outputs, key=lambda x: x.logMonoTime) + + fn = f"{args.route}_{args.process}.bz2" + save_log(fn, outputs) diff --git a/selfdrive/debug/set_car_params.py b/selfdrive/debug/set_car_params.py new file mode 100755 index 000000000..bcdaed077 --- /dev/null +++ b/selfdrive/debug/set_car_params.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 +import sys + +from common.params import Params +from tools.lib.route import Route +from tools.lib.logreader import LogReader + +if __name__ == "__main__": + r = Route(sys.argv[1]) + cp = [m for m in LogReader(r.qlog_paths()[0]) if m.which() == 'carParams'] + Params().put("CarParams", cp[0].carParams.as_builder().to_bytes()) diff --git a/selfdrive/debug/show_matching_cars.py b/selfdrive/debug/show_matching_cars.py new file mode 100755 index 000000000..79a23c1f8 --- /dev/null +++ b/selfdrive/debug/show_matching_cars.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars +import cereal.messaging as messaging + + +# rav4 2019 and corolla tss2 +fingerprint = {896: 8, 898: 8, 900: 6, 976: 1, 1541: 8, 902: 6, 905: 8, 810: 2, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1552: 8, 1553: 8, 1556: 8, 1571: 8, 921: 8, 1056: 8, 544: 4, 1570: 8, 1059: 1, 36: 8, 37: 8, 550: 8, 935: 8, 552: 4, 170: 8, 812: 8, 944: 8, 945: 8, 562: 6, 180: 8, 1077: 8, 951: 8, 1592: 8, 1076: 8, 186: 4, 955: 8, 956: 8, 1001: 8, 705: 8, 452: 8, 1788: 8, 464: 8, 824: 8, 466: 8, 467: 8, 761: 8, 728: 8, 1572: 8, 1114: 8, 933: 8, 800: 8, 608: 8, 865: 8, 610: 8, 1595: 8, 934: 8, 998: 5, 1745: 8, 1000: 8, 764: 8, 1002: 8, 999: 7, 1789: 8, 1649: 8, 1779: 8, 1568: 8, 1017: 8, 1786: 8, 1787: 8, 1020: 8, 426: 6, 1279: 8} + +candidate_cars = all_legacy_fingerprint_cars() + + +for addr, l in fingerprint.items(): + dat = messaging.new_message('can', 1) + + msg = dat.can[0] + msg.address = addr + msg.dat = " " * l + + candidate_cars = eliminate_incompatible_cars(msg, candidate_cars) + print(candidate_cars) diff --git a/selfdrive/debug/test_fw_query_on_routes.py b/selfdrive/debug/test_fw_query_on_routes.py new file mode 100755 index 000000000..44b3ba16a --- /dev/null +++ b/selfdrive/debug/test_fw_query_on_routes.py @@ -0,0 +1,191 @@ +#!/usr/bin/env python3 +# type: ignore + +from collections import defaultdict +import argparse +import os +import traceback +from tqdm import tqdm +from tools.lib.logreader import LogReader +from tools.lib.route import Route +from selfdrive.car.car_helpers import interface_names +from selfdrive.car.fw_versions import match_fw_to_car_exact, match_fw_to_car_fuzzy, build_fw_dict +from selfdrive.car.toyota.values import FW_VERSIONS as TOYOTA_FW_VERSIONS +from selfdrive.car.honda.values import FW_VERSIONS as HONDA_FW_VERSIONS +from selfdrive.car.hyundai.values import FW_VERSIONS as HYUNDAI_FW_VERSIONS +from selfdrive.car.volkswagen.values import FW_VERSIONS as VW_FW_VERSIONS +from selfdrive.car.mazda.values import FW_VERSIONS as MAZDA_FW_VERSIONS + + +NO_API = "NO_API" in os.environ +SUPPORTED_CARS = set(interface_names['toyota']) +SUPPORTED_CARS |= set(interface_names['honda']) +SUPPORTED_CARS |= set(interface_names['hyundai']) +SUPPORTED_CARS |= set(interface_names['volkswagen']) +SUPPORTED_CARS |= set(interface_names['mazda']) + +try: + from xx.pipeline.c.CarState import migration +except ImportError: + migration = {} + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Run FW fingerprint on Qlog of route or list of routes') + parser.add_argument('route', help='Route or file with list of routes') + parser.add_argument('--car', help='Force comparison fingerprint to known car') + args = parser.parse_args() + + if os.path.exists(args.route): + routes = list(open(args.route)) + else: + routes = [args.route] + + mismatches = defaultdict(list) + + not_fingerprinted = 0 + solved_by_fuzzy = 0 + + good_exact = 0 + wrong_fuzzy = 0 + good_fuzzy = 0 + + dongles = [] + for route in tqdm(routes): + route = route.rstrip() + dongle_id, time = route.split('|') + + if dongle_id in dongles: + continue + + if NO_API: + qlog_path = f"cd:/{dongle_id}/{time}/0/qlog.bz2" + else: + route = Route(route) + qlog_path = route.qlog_paths()[0] + + if qlog_path is None: + continue + + try: + lr = LogReader(qlog_path) + dongles.append(dongle_id) + + for msg in lr: + if msg.which() == "pandaStates": + if msg.pandaStates[0].pandaType not in ['uno', 'blackPanda', 'dos']: + break + + elif msg.which() == "carParams": + bts = msg.carParams.as_builder().to_bytes() + + car_fw = msg.carParams.carFw + if len(car_fw) == 0: + break + + live_fingerprint = msg.carParams.carFingerprint + live_fingerprint = migration.get(live_fingerprint, live_fingerprint) + + if args.car is not None: + live_fingerprint = args.car + + if live_fingerprint not in SUPPORTED_CARS: + break + + fw_versions_dict = build_fw_dict(car_fw) + exact_matches = match_fw_to_car_exact(fw_versions_dict) + fuzzy_matches = match_fw_to_car_fuzzy(fw_versions_dict) + + if (len(exact_matches) == 1) and (list(exact_matches)[0] == live_fingerprint): + good_exact += 1 + print(f"Correct! Live: {live_fingerprint} - Fuzzy: {fuzzy_matches}") + + # Check if fuzzy match was correct + if len(fuzzy_matches) == 1: + if list(fuzzy_matches)[0] != live_fingerprint: + wrong_fuzzy += 1 + print(f"{dongle_id}|{time}") + print("Fuzzy match wrong! Fuzzy:", fuzzy_matches, "Live:", live_fingerprint) + else: + good_fuzzy += 1 + break + + print(f"{dongle_id}|{time}") + print("Old style:", live_fingerprint, "Vin", msg.carParams.carVin) + print("New style (exact):", exact_matches) + print("New style (fuzzy):", fuzzy_matches) + + for version in car_fw: + subaddr = None if version.subAddress == 0 else hex(version.subAddress) + print(f" (Ecu.{version.ecu}, {hex(version.address)}, {subaddr}): [{version.fwVersion}],") + + print("Mismatches") + found = False + for car_fws in [TOYOTA_FW_VERSIONS, HONDA_FW_VERSIONS, HYUNDAI_FW_VERSIONS, VW_FW_VERSIONS, MAZDA_FW_VERSIONS]: + if live_fingerprint in car_fws: + found = True + expected = car_fws[live_fingerprint] + for (_, expected_addr, expected_sub_addr), v in expected.items(): + for version in car_fw: + sub_addr = None if version.subAddress == 0 else version.subAddress + addr = version.address + + if (addr, sub_addr) == (expected_addr, expected_sub_addr): + if version.fwVersion not in v: + print(f"({hex(addr)}, {'None' if sub_addr is None else hex(sub_addr)}) - {version.fwVersion}") + + # Add to global list of mismatches + mismatch = (addr, sub_addr, version.fwVersion) + if mismatch not in mismatches[live_fingerprint]: + mismatches[live_fingerprint].append(mismatch) + + # No FW versions for this car yet, add them all to mismatch list + if not found: + for version in car_fw: + sub_addr = None if version.subAddress == 0 else version.subAddress + addr = version.address + mismatch = (addr, sub_addr, version.fwVersion) + if mismatch not in mismatches[live_fingerprint]: + mismatches[live_fingerprint].append(mismatch) + + print() + not_fingerprinted += 1 + + if len(fuzzy_matches) == 1: + if list(fuzzy_matches)[0] == live_fingerprint: + solved_by_fuzzy += 1 + else: + wrong_fuzzy += 1 + print("Fuzzy match wrong! Fuzzy:", fuzzy_matches, "Live:", live_fingerprint) + + break + except Exception: + traceback.print_exc() + except KeyboardInterrupt: + break + + print() + # Print FW versions that need to be added seperated out by car and address + for car, m in sorted(mismatches.items()): + print(car) + addrs = defaultdict(list) + for (addr, sub_addr, version) in m: + addrs[(addr, sub_addr)].append(version) + + for (addr, sub_addr), versions in addrs.items(): + print(f" ({hex(addr)}, {'None' if sub_addr is None else hex(sub_addr)}): [") + for v in versions: + print(f" {v},") + print(" ]") + print() + + print() + print(f"Number of dongle ids checked: {len(dongles)}") + print(f"Fingerprinted: {good_exact}") + print(f"Not fingerprinted: {not_fingerprinted}") + print(f" of which had a fuzzy match: {solved_by_fuzzy}") + + print() + print(f"Correct fuzzy matches: {good_fuzzy}") + print(f"Wrong fuzzy matches: {wrong_fuzzy}") + print() + diff --git a/selfdrive/debug/toyota_eps_factor.py b/selfdrive/debug/toyota_eps_factor.py new file mode 100755 index 000000000..0a459bb71 --- /dev/null +++ b/selfdrive/debug/toyota_eps_factor.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python3 +import sys +import numpy as np +import matplotlib.pyplot as plt +from sklearn import linear_model # pylint: disable=import-error +from selfdrive.car.toyota.values import STEER_THRESHOLD + +from tools.lib.route import Route +from tools.lib.logreader import MultiLogIterator + +MIN_SAMPLES = 30 * 100 + + +def to_signed(n, bits): + if n >= (1 << max((bits - 1), 0)): + n = n - (1 << max(bits, 0)) + return n + + +def get_eps_factor(lr, plot=False): + engaged = False + steering_pressed = False + torque_cmd, eps_torque = None, None + cmds, eps = [], [] + + for msg in lr: + if msg.which() != 'can': + continue + + for m in msg.can: + if m.address == 0x2e4 and m.src == 128: + engaged = bool(m.dat[0] & 1) + torque_cmd = to_signed((m.dat[1] << 8) | m.dat[2], 16) + elif m.address == 0x260 and m.src == 0: + eps_torque = to_signed((m.dat[5] << 8) | m.dat[6], 16) + steering_pressed = abs(to_signed((m.dat[1] << 8) | m.dat[2], 16)) > STEER_THRESHOLD + + if engaged and torque_cmd is not None and eps_torque is not None and not steering_pressed: + cmds.append(torque_cmd) + eps.append(eps_torque) + else: + if len(cmds) > MIN_SAMPLES: + break + cmds, eps = [], [] + + if len(cmds) < MIN_SAMPLES: + raise Exception("too few samples found in route") + + lm = linear_model.LinearRegression(fit_intercept=False) + lm.fit(np.array(cmds).reshape(-1, 1), eps) + scale_factor = 1. / lm.coef_[0] + + if plot: + plt.plot(np.array(eps) * scale_factor) + plt.plot(cmds) + plt.show() + return scale_factor + + +if __name__ == "__main__": + r = Route(sys.argv[1]) + lr = MultiLogIterator(r.log_paths()) + n = get_eps_factor(lr, plot="--plot" in sys.argv) + print("EPS torque factor: ", n) diff --git a/selfdrive/debug/uiview.py b/selfdrive/debug/uiview.py new file mode 100755 index 000000000..29465ecc8 --- /dev/null +++ b/selfdrive/debug/uiview.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +import time +from cereal import messaging, log +from selfdrive.manager.process_config import managed_processes + +if __name__ == "__main__": + procs = ['camerad', 'ui', 'modeld', 'calibrationd'] + + for p in procs: + managed_processes[p].start() + + pm = messaging.PubMaster(['controlsState', 'deviceState', 'pandaStates', 'carParams']) + + msgs = {s: messaging.new_message(s) for s in ['controlsState', 'deviceState', 'carParams']} + msgs['deviceState'].deviceState.started = True + msgs['carParams'].carParams.openpilotLongitudinalControl = True + + msgs['pandaStates'] = messaging.new_message('pandaStates', 1) + msgs['pandaStates'].pandaStates[0].ignitionLine = True + msgs['pandaStates'].pandaStates[0].pandaType = log.PandaState.PandaType.uno + + try: + while True: + time.sleep(1 / 100) # continually send, rate doesn't matter + for s in msgs: + pm.send(s, msgs[s]) + except KeyboardInterrupt: + for p in procs: + managed_processes[p].stop() diff --git a/selfdrive/debug/vw_mqb_config.py b/selfdrive/debug/vw_mqb_config.py new file mode 100755 index 000000000..1dd28d371 --- /dev/null +++ b/selfdrive/debug/vw_mqb_config.py @@ -0,0 +1,145 @@ +#!/usr/bin/env python3 + +import argparse +import struct +from enum import IntEnum +from panda import Panda +from panda.python.uds import UdsClient, MessageTimeoutError, NegativeResponseError, SESSION_TYPE,\ + DATA_IDENTIFIER_TYPE, ACCESS_TYPE + +# TODO: extend UDS library to allow custom/vendor-defined data identifiers without ignoring type checks +class VOLKSWAGEN_DATA_IDENTIFIER_TYPE(IntEnum): + CODING = 0x0600 + +# TODO: extend UDS library security_access() to take an access level offset per ISO 14229-1:2020 10.4 and remove this +class ACCESS_TYPE_LEVEL_1(IntEnum): + REQUEST_SEED = ACCESS_TYPE.REQUEST_SEED + 2 + SEND_KEY = ACCESS_TYPE.SEND_KEY + 2 + +MQB_EPS_CAN_ADDR = 0x712 +RX_OFFSET = 0x6a + +if __name__ == "__main__": + desc_text = "Shows Volkswagen EPS software and coding info, and enables or disables Heading Control Assist " + \ + "(Lane Assist). Useful for enabling HCA on cars without factory Lane Assist that want to use " + \ + "openpilot integrated at the CAN gateway (J533)." + epilog_text = "This tool is meant to run directly on a vehicle-installed comma two or comma three, with the " + \ + "openpilot/tmux processes stopped. It should also work on a separate PC with a USB-attached comma " + \ + "panda. Vehicle ignition must be on. Recommend engine not be running when making changes. Must " + \ + "turn ignition off and on again for any changes to take effect." + parser = argparse.ArgumentParser(description=desc_text, epilog=epilog_text) + parser.add_argument("--debug", action="store_true", help="enable ISO-TP/UDS stack debugging output") + parser.add_argument("action", choices={"show", "enable", "disable"}, help="show or modify current EPS HCA config") + args = parser.parse_args() + + panda = Panda() + panda.set_safety_mode(Panda.SAFETY_ELM327) + bus = 1 if panda.has_obd() else 0 + uds_client = UdsClient(panda, MQB_EPS_CAN_ADDR, MQB_EPS_CAN_ADDR + RX_OFFSET, bus, timeout=0.2, debug=args.debug) + + try: + uds_client.diagnostic_session_control(SESSION_TYPE.EXTENDED_DIAGNOSTIC) + except MessageTimeoutError: + print("Timeout opening session with EPS") + quit() + + odx_file, current_coding = None, None + try: + hw_pn = uds_client.read_data_by_identifier(DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_HARDWARE_NUMBER).decode("utf-8") + sw_pn = uds_client.read_data_by_identifier(DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_SPARE_PART_NUMBER).decode("utf-8") + sw_ver = uds_client.read_data_by_identifier(DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_VERSION_NUMBER).decode("utf-8") + component = uds_client.read_data_by_identifier(DATA_IDENTIFIER_TYPE.SYSTEM_NAME_OR_ENGINE_TYPE).decode("utf-8") + odx_file = uds_client.read_data_by_identifier(DATA_IDENTIFIER_TYPE.ODX_FILE).decode("utf-8") + current_coding = uds_client.read_data_by_identifier(VOLKSWAGEN_DATA_IDENTIFIER_TYPE.CODING) # type: ignore + coding_text = current_coding.hex() + + print("\nEPS diagnostic data\n") + print(f" Part No HW: {hw_pn}") + print(f" Part No SW: {sw_pn}") + print(f" SW Version: {sw_ver}") + print(f" Component: {component}") + print(f" Coding: {coding_text}") + print(f" ASAM Dataset: {odx_file}") + except NegativeResponseError: + print("Error fetching data from EPS") + quit() + except MessageTimeoutError: + print("Timeout fetching data from EPS") + quit() + + coding_variant, current_coding_array = None, None + # EV_SteerAssisMQB covers the majority of MQB racks (EPS_MQB_ZFLS) + # APA racks (MQB_PP_APA) have a different coding layout, which should + # be easy to support once we identify the specific config bit + if odx_file == "EV_SteerAssisMQB\x00": + coding_variant = "ZF" + current_coding_array = struct.unpack("!4B", current_coding) + hca_enabled = (current_coding_array[0] & (1 << 4) != 0) + hca_text = ("DISABLED", "ENABLED")[hca_enabled] + print(f" Lane Assist: {hca_text}") + else: + print("Configuration changes not yet supported on this EPS!") + quit() + + try: + params = uds_client.read_data_by_identifier(DATA_IDENTIFIER_TYPE.APPLICATION_DATA_IDENTIFICATION).decode("utf-8") + param_version_system_params = params[1:3] + param_vehicle_type = params[3:5] + param_index_char_curve = params[5:7] + param_version_char_values = params[7:9] + param_version_memory_map = params[9:11] + print("\nEPS parameterization (per-vehicle calibration) data\n") + print(f" Version of system parameters: {param_version_system_params}") + print(f" Vehicle type: {param_vehicle_type}") + print(f" Index of characteristic curve: {param_index_char_curve}") + print(f" Version of characteristic values: {param_version_char_values}") + print(f" Version of memory map: {param_version_memory_map}") + except (NegativeResponseError, MessageTimeoutError): + print("Error fetching parameterization data from EPS!") + quit() + + if args.action in ["enable", "disable"]: + print("\nAttempting configuration update") + + assert(coding_variant == "ZF") # revisit when we have the APA rack coding bit + # ZF EPS config coding length can be anywhere from 1 to 4 bytes, but the + # bit we care about is always in the same place in the first byte + if args.action == "enable": + new_byte_0 = current_coding_array[0] | (1 << 4) + else: + new_byte_0 = current_coding_array[0] & ~(1 << 4) + new_coding = new_byte_0.to_bytes(1, "little") + current_coding[1:] + + try: + seed = uds_client.security_access(ACCESS_TYPE_LEVEL_1.REQUEST_SEED) # type: ignore + key = struct.unpack("!I", seed)[0] + 28183 # yeah, it's like that + uds_client.security_access(ACCESS_TYPE_LEVEL_1.SEND_KEY, struct.pack("!I", key)) # type: ignore + except (NegativeResponseError, MessageTimeoutError): + print("Security access failed!") + quit() + + try: + # Programming date and tester number must be written before making + # a change, or write to CODING will fail with request sequence error + # Encoding on tester is unclear, it contains the workshop code in the + # last two bytes, but not the VZ/importer or tester serial number + # Can't seem to read it back, but we can read the calibration tester, + # so fib a little and say that same tester did the programming + # TODO: encode the actual current date + prog_date = b'\x22\x02\x08' + uds_client.write_data_by_identifier(DATA_IDENTIFIER_TYPE.PROGRAMMING_DATE, prog_date) + tester_num = uds_client.read_data_by_identifier(DATA_IDENTIFIER_TYPE.CALIBRATION_REPAIR_SHOP_CODE_OR_CALIBRATION_EQUIPMENT_SERIAL_NUMBER) + uds_client.write_data_by_identifier(DATA_IDENTIFIER_TYPE.REPAIR_SHOP_CODE_OR_TESTER_SERIAL_NUMBER, tester_num) + uds_client.write_data_by_identifier(VOLKSWAGEN_DATA_IDENTIFIER_TYPE.CODING, new_coding) # type: ignore + except (NegativeResponseError, MessageTimeoutError): + print("Writing new configuration failed!") + quit() + + try: + # Read back result just to make 100% sure everything worked + current_coding_text = uds_client.read_data_by_identifier(VOLKSWAGEN_DATA_IDENTIFIER_TYPE.CODING).hex() # type: ignore + print(f" New coding: {current_coding_text}") + except (NegativeResponseError, MessageTimeoutError): + print("Reading back updated coding failed!") + quit() + print("EPS configuration successfully updated") diff --git a/selfdrive/hardware/__init__.py b/selfdrive/hardware/__init__.py new file mode 100644 index 000000000..3babf1bb5 --- /dev/null +++ b/selfdrive/hardware/__init__.py @@ -0,0 +1,19 @@ +import os +from typing import cast + +from selfdrive.hardware.base import HardwareBase +from selfdrive.hardware.eon.hardware import Android +from selfdrive.hardware.tici.hardware import Tici +from selfdrive.hardware.pc.hardware import Pc + +EON = os.path.isfile('/EON') +TICI = os.path.isfile('/TICI') +PC = not (EON or TICI) + + +if EON: + HARDWARE = cast(HardwareBase, Android()) +elif TICI: + HARDWARE = cast(HardwareBase, Tici()) +else: + HARDWARE = cast(HardwareBase, Pc()) diff --git a/selfdrive/hardware/base.h b/selfdrive/hardware/base.h new file mode 100644 index 000000000..05e55cc03 --- /dev/null +++ b/selfdrive/hardware/base.h @@ -0,0 +1,25 @@ +#pragma once + +#include +#include + +// no-op base hw class +class HardwareNone { +public: + static constexpr float MAX_VOLUME = 0.7; + static constexpr float MIN_VOLUME = 0.2; + + static std::string get_os_version() { return ""; } + + static void reboot() {} + static void poweroff() {} + static void set_brightness(int percent) {} + static void set_display_power(bool on) {} + + static bool get_ssh_enabled() { return false; } + static void set_ssh_enabled(bool enabled) {} + + static bool PC() { return false; } + static bool EON() { return false; } + static bool TICI() { return false; } +}; diff --git a/selfdrive/hardware/base.py b/selfdrive/hardware/base.py new file mode 100644 index 000000000..b551138ce --- /dev/null +++ b/selfdrive/hardware/base.py @@ -0,0 +1,148 @@ +from abc import abstractmethod, ABC +from collections import namedtuple +from typing import Dict + +ThermalConfig = namedtuple('ThermalConfig', ['cpu', 'gpu', 'mem', 'bat', 'ambient', 'pmic']) + +class HardwareBase(ABC): + @staticmethod + def get_cmdline() -> Dict[str, str]: + with open('/proc/cmdline') as f: + cmdline = f.read() + return {kv[0]: kv[1] for kv in [s.split('=') for s in cmdline.split(' ')] if len(kv) == 2} + + @staticmethod + def read_param_file(path, parser, default=0): + try: + with open(path) as f: + return parser(f.read()) + except Exception: + return default + + @abstractmethod + def reboot(self, reason=None): + pass + + @abstractmethod + def uninstall(self): + pass + + @abstractmethod + def get_os_version(self): + pass + + @abstractmethod + def get_device_type(self): + pass + + @abstractmethod + def get_sound_card_online(self): + pass + + @abstractmethod + def get_imei(self, slot): + pass + + @abstractmethod + def get_serial(self): + pass + + @abstractmethod + def get_subscriber_info(self): + pass + + @abstractmethod + def get_network_info(self): + pass + + @abstractmethod + def get_network_type(self): + pass + + @abstractmethod + def get_sim_info(self): + pass + + @abstractmethod + def get_network_strength(self, network_type): + pass + + @staticmethod + def set_bandwidth_limit(upload_speed_kbps: int, download_speed_kbps: int) -> None: + pass + + @abstractmethod + def get_battery_capacity(self): + pass + + @abstractmethod + def get_battery_status(self): + pass + + @abstractmethod + def get_battery_current(self): + pass + + @abstractmethod + def get_battery_voltage(self): + pass + + @abstractmethod + def get_battery_charging(self): + pass + + @abstractmethod + def set_battery_charging(self, on): + pass + + @abstractmethod + def get_usb_present(self): + pass + + @abstractmethod + def get_current_power_draw(self): + pass + + @abstractmethod + def shutdown(self): + pass + + @abstractmethod + def get_thermal_config(self): + pass + + @abstractmethod + def set_screen_brightness(self, percentage): + pass + + @abstractmethod + def get_screen_brightness(self): + pass + + @abstractmethod + def set_power_save(self, powersave_enabled): + pass + + @abstractmethod + def get_gpu_usage_percent(self): + pass + + @abstractmethod + def get_modem_version(self): + pass + + @abstractmethod + def get_modem_temperatures(self): + pass + + @abstractmethod + def get_nvme_temperatures(self): + pass + + @abstractmethod + def initialize_hardware(self): + pass + + @abstractmethod + def get_networks(self): + pass diff --git a/selfdrive/hardware/eon/__init__.py b/selfdrive/hardware/eon/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/hardware/eon/androidd.py b/selfdrive/hardware/eon/androidd.py new file mode 100755 index 000000000..3d91468b9 --- /dev/null +++ b/selfdrive/hardware/eon/androidd.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python3 +import os +import time +import psutil +from typing import Optional + +import cereal.messaging as messaging +from common.realtime import set_core_affinity, set_realtime_priority +from selfdrive.swaglog import cloudlog + + +MAX_MODEM_CRASHES = 3 +MODEM_PATH = "/sys/devices/soc/2080000.qcom,mss/subsys5" +WATCHED_PROCS = ["zygote", "zygote64", "system_server", "/system/bin/servicemanager", "/system/bin/surfaceflinger"] + + +def get_modem_crash_count() -> Optional[int]: + try: + with open(os.path.join(MODEM_PATH, "crash_count")) as f: + return int(f.read()) + except Exception: + cloudlog.exception("Error reading modem crash count") + return None + +def get_modem_state() -> str: + try: + with open(os.path.join(MODEM_PATH, "state")) as f: + return f.read().strip() + except Exception: + cloudlog.exception("Error reading modem state") + return "" + +def main(): + set_core_affinity(1) + set_realtime_priority(1) + + procs = {} + crash_count = 0 + modem_killed = False + modem_state = "ONLINE" + androidLog = messaging.sub_sock('androidLog') + + while True: + # check critical android services + if any(p is None or not p.is_running() for p in procs.values()) or not len(procs): + cur = {p: None for p in WATCHED_PROCS} + for p in psutil.process_iter(attrs=['cmdline']): + cmdline = None if not len(p.info['cmdline']) else p.info['cmdline'][0] + if cmdline in WATCHED_PROCS: + cur[cmdline] = p + + if len(procs): + for p in WATCHED_PROCS: + if cur[p] != procs[p]: + cloudlog.event("android service pid changed", proc=p, cur=cur[p], prev=procs[p], error=True) + procs.update(cur) + + # log caught NetworkPolicy exceptions + msgs = messaging.drain_sock(androidLog) + for m in msgs: + try: + if m.androidLog.tag == "NetworkPolicy" and m.androidLog.message.startswith("problem with advise persist threshold"): + cloudlog.event("network policy exception caught", androidLog=m.androidLog, error=True) + except UnicodeDecodeError: + pass + + if os.path.exists(MODEM_PATH): + # check modem state + state = get_modem_state() + if state != modem_state and not modem_killed: + cloudlog.event("modem state changed", state=state) + modem_state = state + + # check modem crashes + cnt = get_modem_crash_count() + if cnt is not None: + if cnt > crash_count: + cloudlog.event("modem crash", count=cnt) + crash_count = cnt + + # handle excessive modem crashes + if crash_count > MAX_MODEM_CRASHES and not modem_killed: + cloudlog.event("killing modem", error=True) + with open("/sys/kernel/debug/msm_subsys/modem", "w") as f: + f.write("put") + modem_killed = True + + time.sleep(1) + +if __name__ == "__main__": + main() diff --git a/selfdrive/hardware/eon/hardware.h b/selfdrive/hardware/eon/hardware.h new file mode 100644 index 000000000..bcd1aaba7 --- /dev/null +++ b/selfdrive/hardware/eon/hardware.h @@ -0,0 +1,73 @@ +#pragma once + +#include +#include + +#include +#include +#include + +#include "selfdrive/common/util.h" +#include "selfdrive/hardware/base.h" + +class HardwareEon : public HardwareNone { +public: + static constexpr float MAX_VOLUME = 1.0; + static constexpr float MIN_VOLUME = 0.5; + + static bool EON() { return true; } + static std::string get_os_version() { + return "NEOS " + util::read_file("/VERSION"); + }; + + static void reboot() { std::system("reboot"); }; + static void poweroff() { std::system("LD_LIBRARY_PATH= svc power shutdown"); }; + static void set_brightness(int percent) { + std::ofstream brightness_control("/sys/class/leds/lcd-backlight/brightness"); + if (brightness_control.is_open()) { + brightness_control << (int)(percent * (255/100.)) << "\n"; + brightness_control.close(); + } + }; + static void set_display_power(bool on) { + auto dtoken = android::SurfaceComposerClient::getBuiltInDisplay(android::ISurfaceComposer::eDisplayIdMain); + android::SurfaceComposerClient::setDisplayPowerMode(dtoken, on ? HWC_POWER_MODE_NORMAL : HWC_POWER_MODE_OFF); + }; + + static bool get_ssh_enabled() { + return std::system("getprop persist.neos.ssh | grep -qF '1'") == 0; + }; + static void set_ssh_enabled(bool enabled) { + std::string cmd = util::string_format("setprop persist.neos.ssh %d", enabled ? 1 : 0); + std::system(cmd.c_str()); + }; + + // android only + inline static bool launched_activity = false; + static void check_activity() { + int ret = std::system("dumpsys SurfaceFlinger --list | grep -Fq 'com.android.settings'"); + launched_activity = ret == 0; + } + + static void close_activities() { + if(launched_activity) { + std::system("pm disable com.android.settings && pm enable com.android.settings"); + } + } + + static void launch_activity(std::string activity, std::string opts = "") { + if (!launched_activity) { + std::string cmd = "am start -n " + activity + " " + opts + + " --ez extra_prefs_show_button_bar true \ + --es extra_prefs_set_next_text ''"; + std::system(cmd.c_str()); + } + launched_activity = true; + } + static void launch_wifi() { + launch_activity("com.android.settings/.wifi.WifiPickerActivity", "-a android.net.wifi.PICK_WIFI_NETWORK"); + } + static void launch_tethering() { + launch_activity("com.android.settings/.TetherSettings"); + } +}; diff --git a/selfdrive/hardware/eon/hardware.py b/selfdrive/hardware/eon/hardware.py new file mode 100644 index 000000000..4ab9f81fc --- /dev/null +++ b/selfdrive/hardware/eon/hardware.py @@ -0,0 +1,421 @@ +import binascii +import itertools +import os +import re +import serial +import struct +import subprocess +from typing import List, Union + +from cereal import log +from selfdrive.hardware.base import HardwareBase, ThermalConfig + +try: + from common.params import Params +except Exception: + # openpilot is not built yet + Params = None + +NetworkType = log.DeviceState.NetworkType +NetworkStrength = log.DeviceState.NetworkStrength + +MODEM_PATH = "/dev/smd11" + +def service_call(call: List[str]) -> Union[bytes, None]: + try: + ret = subprocess.check_output(["service", "call", *call], encoding='utf8').strip() + if 'Parcel' not in ret: + return None + return parse_service_call_bytes(ret) + except subprocess.CalledProcessError: + return None + + +def parse_service_call_unpack(r, fmt) -> Union[bytes, None]: + try: + return struct.unpack(fmt, r)[0] + except Exception: + return None + + +def parse_service_call_string(r: bytes) -> Union[str, None]: + try: + r = r[8:] # Cut off length field + r_str = r.decode('utf_16_be') + + # All pairs of two characters seem to be swapped. Not sure why + result = "" + for a, b, in itertools.zip_longest(r_str[::2], r_str[1::2], fillvalue='\x00'): + result += b + a + + return result.replace('\x00', '') + except Exception: + return None + + +def parse_service_call_bytes(ret: str) -> Union[bytes, None]: + try: + r = b"" + for hex_part in re.findall(r'[ (]([0-9a-f]{8})', ret): + r += binascii.unhexlify(hex_part) + return r + except Exception: + return None + + +def getprop(key: str) -> Union[str, None]: + try: + return subprocess.check_output(["getprop", key], encoding='utf8').strip() + except subprocess.CalledProcessError: + return None + + +class Android(HardwareBase): + def get_os_version(self): + with open("/VERSION") as f: + return f.read().strip() + + def get_device_type(self): + try: + if int(Params().get("LastPeripheralPandaType")) == log.PandaState.PandaType.uno: + return "two" + except Exception: + pass + return "eon" + + def get_sound_card_online(self): + return (os.path.isfile('/proc/asound/card0/state') and + open('/proc/asound/card0/state').read().strip() == 'ONLINE') + + def get_imei(self, slot): + slot = str(slot) + if slot not in ("0", "1"): + raise ValueError("SIM slot must be 0 or 1") + + return parse_service_call_string(service_call(["iphonesubinfo", "3", "i32", str(slot)])) + + def get_serial(self): + ret = getprop("ro.serialno") + if len(ret) == 0: + ret = "cccccccc" + return ret + + def get_subscriber_info(self): + ret = parse_service_call_string(service_call(["iphonesubinfo", "7"])) + if ret is None or len(ret) < 8: + return "" + return ret + + def reboot(self, reason=None): + # e.g. reason="recovery" to go into recover mode + if reason is None: + reason_args = ["null"] + else: + reason_args = ["s16", reason] + + subprocess.check_output([ + "service", "call", "power", "16", # IPowerManager.reboot + "i32", "0", # no confirmation, + *reason_args, + "i32", "1" # wait + ]) + + def uninstall(self): + with open('/cache/recovery/command', 'w') as f: + f.write('--wipe_data\n') + # IPowerManager.reboot(confirm=false, reason="recovery", wait=true) + self.reboot(reason="recovery") + + def get_sim_info(self): + # Used for athena + # TODO: build using methods from this class + sim_state = getprop("gsm.sim.state").split(",") + network_type = getprop("gsm.network.type").split(',') + mcc_mnc = getprop("gsm.sim.operator.numeric") or None + + sim_id = parse_service_call_string(service_call(['iphonesubinfo', '11'])) + cell_data_state = parse_service_call_unpack(service_call(['phone', '46']), ">q") + cell_data_connected = (cell_data_state == 2) + + return { + 'sim_id': sim_id, + 'mcc_mnc': mcc_mnc, + 'network_type': network_type, + 'sim_state': sim_state, + 'data_connected': cell_data_connected + } + + def get_network_info(self): + msg = log.DeviceState.NetworkInfo.new_message() + msg.state = getprop("gsm.sim.state") or "" + msg.technology = getprop("gsm.network.type") or "" + msg.operator = getprop("gsm.sim.operator.numeric") or "" + + try: + modem = serial.Serial(MODEM_PATH, 115200, timeout=0.1) + modem.write(b"AT$QCRSRP?\r") + msg.extra = modem.read_until(b"OK\r\n").decode('utf-8') + + rsrp = msg.extra.split("$QCRSRP: ")[1].split("\r")[0].split(",") + msg.channel = int(rsrp[1]) + except Exception: + pass + + return msg + + def get_network_type(self): + wifi_check = parse_service_call_string(service_call(["connectivity", "2"])) + if wifi_check is None: + return NetworkType.none + elif 'WIFI' in wifi_check: + return NetworkType.wifi + else: + cell_check = parse_service_call_unpack(service_call(['phone', '59']), ">q") + # from TelephonyManager.java + cell_networks = { + 0: NetworkType.none, + 1: NetworkType.cell2G, + 2: NetworkType.cell2G, + 3: NetworkType.cell3G, + 4: NetworkType.cell2G, + 5: NetworkType.cell3G, + 6: NetworkType.cell3G, + 7: NetworkType.cell3G, + 8: NetworkType.cell3G, + 9: NetworkType.cell3G, + 10: NetworkType.cell3G, + 11: NetworkType.cell2G, + 12: NetworkType.cell3G, + 13: NetworkType.cell4G, + 14: NetworkType.cell4G, + 15: NetworkType.cell3G, + 16: NetworkType.cell2G, + 17: NetworkType.cell3G, + 18: NetworkType.cell4G, + 19: NetworkType.cell4G + } + return cell_networks.get(cell_check, NetworkType.none) + + def get_network_strength(self, network_type): + network_strength = NetworkStrength.unknown + + # from SignalStrength.java + def get_lte_level(rsrp, rssnr): + INT_MAX = 2147483647 + if rsrp == INT_MAX: + lvl_rsrp = NetworkStrength.unknown + elif rsrp >= -95: + lvl_rsrp = NetworkStrength.great + elif rsrp >= -105: + lvl_rsrp = NetworkStrength.good + elif rsrp >= -115: + lvl_rsrp = NetworkStrength.moderate + else: + lvl_rsrp = NetworkStrength.poor + if rssnr == INT_MAX: + lvl_rssnr = NetworkStrength.unknown + elif rssnr >= 45: + lvl_rssnr = NetworkStrength.great + elif rssnr >= 10: + lvl_rssnr = NetworkStrength.good + elif rssnr >= -30: + lvl_rssnr = NetworkStrength.moderate + else: + lvl_rssnr = NetworkStrength.poor + return max(lvl_rsrp, lvl_rssnr) + + def get_tdscdma_level(tdscmadbm): + lvl = NetworkStrength.unknown + if tdscmadbm > -25: + lvl = NetworkStrength.unknown + elif tdscmadbm >= -49: + lvl = NetworkStrength.great + elif tdscmadbm >= -73: + lvl = NetworkStrength.good + elif tdscmadbm >= -97: + lvl = NetworkStrength.moderate + elif tdscmadbm >= -110: + lvl = NetworkStrength.poor + return lvl + + def get_gsm_level(asu): + if asu <= 2 or asu == 99: + lvl = NetworkStrength.unknown + elif asu >= 12: + lvl = NetworkStrength.great + elif asu >= 8: + lvl = NetworkStrength.good + elif asu >= 5: + lvl = NetworkStrength.moderate + else: + lvl = NetworkStrength.poor + return lvl + + def get_evdo_level(evdodbm, evdosnr): + lvl_evdodbm = NetworkStrength.unknown + lvl_evdosnr = NetworkStrength.unknown + if evdodbm >= -65: + lvl_evdodbm = NetworkStrength.great + elif evdodbm >= -75: + lvl_evdodbm = NetworkStrength.good + elif evdodbm >= -90: + lvl_evdodbm = NetworkStrength.moderate + elif evdodbm >= -105: + lvl_evdodbm = NetworkStrength.poor + if evdosnr >= 7: + lvl_evdosnr = NetworkStrength.great + elif evdosnr >= 5: + lvl_evdosnr = NetworkStrength.good + elif evdosnr >= 3: + lvl_evdosnr = NetworkStrength.moderate + elif evdosnr >= 1: + lvl_evdosnr = NetworkStrength.poor + return max(lvl_evdodbm, lvl_evdosnr) + + def get_cdma_level(cdmadbm, cdmaecio): + lvl_cdmadbm = NetworkStrength.unknown + lvl_cdmaecio = NetworkStrength.unknown + if cdmadbm >= -75: + lvl_cdmadbm = NetworkStrength.great + elif cdmadbm >= -85: + lvl_cdmadbm = NetworkStrength.good + elif cdmadbm >= -95: + lvl_cdmadbm = NetworkStrength.moderate + elif cdmadbm >= -100: + lvl_cdmadbm = NetworkStrength.poor + if cdmaecio >= -90: + lvl_cdmaecio = NetworkStrength.great + elif cdmaecio >= -110: + lvl_cdmaecio = NetworkStrength.good + elif cdmaecio >= -130: + lvl_cdmaecio = NetworkStrength.moderate + elif cdmaecio >= -150: + lvl_cdmaecio = NetworkStrength.poor + return max(lvl_cdmadbm, lvl_cdmaecio) + + if network_type == NetworkType.none: + return network_strength + if network_type == NetworkType.wifi: + out = subprocess.check_output('dumpsys connectivity', shell=True).decode('utf-8') + network_strength = NetworkStrength.unknown + for line in out.split('\n'): + signal_str = "SignalStrength: " + if signal_str in line: + lvl_idx_start = line.find(signal_str) + len(signal_str) + lvl_idx_end = line.find(']', lvl_idx_start) + lvl = int(line[lvl_idx_start : lvl_idx_end]) + if lvl >= -50: + network_strength = NetworkStrength.great + elif lvl >= -60: + network_strength = NetworkStrength.good + elif lvl >= -70: + network_strength = NetworkStrength.moderate + else: + network_strength = NetworkStrength.poor + return network_strength + else: + # check cell strength + out = subprocess.check_output('dumpsys telephony.registry', shell=True).decode('utf-8') + for line in out.split('\n'): + if "mSignalStrength" in line: + arr = line.split(' ') + ns = 0 + if ("gsm" in arr[14]): + rsrp = int(arr[9]) + rssnr = int(arr[11]) + ns = get_lte_level(rsrp, rssnr) + if ns == NetworkStrength.unknown: + tdscmadbm = int(arr[13]) + ns = get_tdscdma_level(tdscmadbm) + if ns == NetworkStrength.unknown: + asu = int(arr[1]) + ns = get_gsm_level(asu) + else: + cdmadbm = int(arr[3]) + cdmaecio = int(arr[4]) + evdodbm = int(arr[5]) + evdosnr = int(arr[7]) + lvl_cdma = get_cdma_level(cdmadbm, cdmaecio) + lvl_edmo = get_evdo_level(evdodbm, evdosnr) + if lvl_edmo == NetworkStrength.unknown: + ns = lvl_cdma + elif lvl_cdma == NetworkStrength.unknown: + ns = lvl_edmo + else: + ns = min(lvl_cdma, lvl_edmo) + network_strength = max(network_strength, ns) + + return network_strength + + def get_battery_capacity(self): + return self.read_param_file("/sys/class/power_supply/battery/capacity", int, 100) + + def get_battery_status(self): + # This does not correspond with actual charging or not. + # If a USB cable is plugged in, it responds with 'Charging', even when charging is disabled + return self.read_param_file("/sys/class/power_supply/battery/status", lambda x: x.strip(), '') + + def get_battery_current(self): + return self.read_param_file("/sys/class/power_supply/battery/current_now", int) + + def get_battery_voltage(self): + return self.read_param_file("/sys/class/power_supply/battery/voltage_now", int) + + def get_battery_charging(self): + # This does correspond with actually charging + return self.read_param_file("/sys/class/power_supply/battery/charge_type", lambda x: x.strip() != "N/A", True) + + def set_battery_charging(self, on): + with open('/sys/class/power_supply/battery/charging_enabled', 'w') as f: + f.write(f"{1 if on else 0}\n") + + def get_usb_present(self): + return self.read_param_file("/sys/class/power_supply/usb/present", lambda x: bool(int(x)), False) + + def get_current_power_draw(self): + # We don't have a good direct way to measure this on android + return None + + def shutdown(self): + os.system('LD_LIBRARY_PATH="" svc power shutdown') + + def get_thermal_config(self): + return ThermalConfig(cpu=((5, 7, 10, 12), 10), gpu=((16,), 10), mem=(2, 10), bat=(29, 1000), ambient=(25, 1), pmic=((22,), 1000)) + + def set_screen_brightness(self, percentage): + with open("/sys/class/leds/lcd-backlight/brightness", "w") as f: + f.write(str(int(percentage * 2.55))) + + def get_screen_brightness(self): + try: + with open("/sys/class/leds/lcd-backlight/brightness") as f: + return int(float(f.read()) / 2.55) + except Exception: + return 0 + + def set_power_save(self, powersave_enabled): + pass + + def get_gpu_usage_percent(self): + try: + used, total = open('/sys/devices/soc/b00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/gpubusy').read().strip().split() + perc = 100.0 * int(used) / int(total) + return min(max(perc, 0), 100) + except Exception: + return 0 + + def get_modem_version(self): + return None + + def get_modem_temperatures(self): + # Not sure if we can get this on the LeEco + return [] + + def get_nvme_temperatures(self): + return [] + + def initialize_hardware(self): + pass + + def get_networks(self): + return None diff --git a/selfdrive/hardware/eon/neos.json b/selfdrive/hardware/eon/neos.json new file mode 100644 index 000000000..4010f7126 --- /dev/null +++ b/selfdrive/hardware/eon/neos.json @@ -0,0 +1,7 @@ +{ + "ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-50da8800caa5cbc224acbaa21f3a83d21802a31d89cccfc62a898903a8eb19e7.zip", + "ota_hash": "50da8800caa5cbc224acbaa21f3a83d21802a31d89cccfc62a898903a8eb19e7", + "recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-fe76739438d28ea6111853a737b616afdf340ba75c01c0ee99e6a28c19ecc29f.img", + "recovery_len": 15222060, + "recovery_hash": "fe76739438d28ea6111853a737b616afdf340ba75c01c0ee99e6a28c19ecc29f" +} diff --git a/selfdrive/hardware/eon/neos.py b/selfdrive/hardware/eon/neos.py new file mode 100755 index 000000000..6f290fbcd --- /dev/null +++ b/selfdrive/hardware/eon/neos.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +import argparse +import hashlib +import json +import logging +import os +import requests + +NEOSUPDATE_DIR = "/data/neoupdate" + +RECOVERY_DEV = "/dev/block/bootdevice/by-name/recovery" +RECOVERY_COMMAND = "/cache/recovery/command" + + +def get_fn(url: str): + return os.path.join(NEOSUPDATE_DIR, os.path.basename(url)) + + +def download_file(url: str, fn: str, sha256: str, display_name: str, cloudlog=logging) -> None: + # check if already downloaded + if check_hash(fn, sha256): + cloudlog.info(f"{display_name} already cached") + return + + try: + with open(fn, "ab+") as f: + headers = {"Range": f"bytes={f.tell()}-"} + r = requests.get(url, stream=True, allow_redirects=True, headers=headers) + r.raise_for_status() + + total = int(r.headers['Content-Length']) + if 'Content-Range' in r.headers: + total = int(r.headers['Content-Range'].split('/')[-1]) + + for chunk in r.iter_content(chunk_size=1024 * 1024): + f.write(chunk) + print(f"Downloading {display_name}: {f.tell() / total * 100}", flush=True) + except Exception: + cloudlog.error("download error") + if os.path.isfile(fn): + os.unlink(fn) + raise + + if not check_hash(fn, sha256): + if os.path.isfile(fn): + os.unlink(fn) + raise Exception("downloaded update failed hash check") + + +def check_hash(fn: str, sha256: str, length: int = -1) -> bool: + if not os.path.exists(fn): + return False + + h = hashlib.sha256() + with open(fn, "rb") as f: + while f.tell() != length: + r = min(max(0, length - f.tell()), 1024 * 1024) if length > 0 else 1024 * 1024 + dat = f.read(r) + if not dat: + break + h.update(dat) + return h.hexdigest().lower() == sha256.lower() + + +def flash_update(update_fn: str, out_path: str) -> None: + with open(update_fn, "rb") as update, open(out_path, "w+b") as out: + while True: + dat = update.read(8192) + if len(dat) == 0: + break + out.write(dat) + + +def download_neos_update(manifest_path: str, cloudlog=logging) -> None: + with open(manifest_path) as f: + m = json.load(f) + + os.makedirs(NEOSUPDATE_DIR, exist_ok=True) + + # handle recovery updates + if not check_hash(RECOVERY_DEV, m['recovery_hash'], m['recovery_len']): + cloudlog.info("recovery needs update") + recovery_fn = os.path.join(NEOSUPDATE_DIR, os.path.basename(m['recovery_url'])) + download_file(m['recovery_url'], recovery_fn, m['recovery_hash'], "recovery", cloudlog) + + flash_update(recovery_fn, RECOVERY_DEV) + assert check_hash(RECOVERY_DEV, m['recovery_hash'], m['recovery_len']), "recovery flash corrupted" + cloudlog.info("recovery successfully flashed") + + # download OTA update + download_file(m['ota_url'], get_fn(m['ota_url']), m['ota_hash'], "system", cloudlog) + + +def verify_update_ready(manifest_path: str) -> bool: + with open(manifest_path) as f: + m = json.load(f) + + ota_downloaded = check_hash(get_fn(m['ota_url']), m['ota_hash']) + recovery_flashed = check_hash(RECOVERY_DEV, m['recovery_hash'], m['recovery_len']) + return ota_downloaded and recovery_flashed + + +def perform_ota_update(manifest_path: str) -> None: + with open(manifest_path) as f: + m = json.load(f) + + # reboot into recovery + ota_fn = get_fn(m['ota_url']) + with open(RECOVERY_COMMAND, "w") as rf: + rf.write(f"--update_package={ota_fn}\n") + os.system("service call power 16 i32 0 s16 recovery i32 1") + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="NEOS update utility", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument("--swap", action="store_true", help="Peform update after downloading") + parser.add_argument("--swap-if-ready", action="store_true", help="Perform update if already downloaded") + parser.add_argument("manifest", help="Manifest json") + args = parser.parse_args() + + logging.basicConfig(level=logging.INFO) + + if args.swap_if_ready: + if verify_update_ready(args.manifest): + perform_ota_update(args.manifest) + else: + download_neos_update(args.manifest, logging) + if args.swap: + perform_ota_update(args.manifest) diff --git a/selfdrive/hardware/eon/shutdownd.py b/selfdrive/hardware/eon/shutdownd.py new file mode 100755 index 000000000..15112e7d5 --- /dev/null +++ b/selfdrive/hardware/eon/shutdownd.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +import os +import time +import datetime + +from common.params import Params +from selfdrive.hardware.eon.hardware import getprop +from selfdrive.swaglog import cloudlog + +def main(): + prev = b"" + params = Params() + while True: + with open("/dev/__properties__", 'rb') as f: + cur = f.read() + + if cur != prev: + prev = cur + + # 0 for shutdown, 1 for reboot + prop = getprop("sys.shutdown.requested") + if prop is not None and len(prop) > 0: + os.system("pkill -9 loggerd") + params.put("LastSystemShutdown", f"'{prop}' {datetime.datetime.now()}") + os.sync() + + time.sleep(120) + cloudlog.error('shutdown false positive') + break + + time.sleep(0.1) + +if __name__ == "__main__": + main() diff --git a/selfdrive/hardware/eon/updater b/selfdrive/hardware/eon/updater new file mode 100755 index 000000000..eaf34e957 Binary files /dev/null and b/selfdrive/hardware/eon/updater differ diff --git a/selfdrive/hardware/hw.h b/selfdrive/hardware/hw.h new file mode 100644 index 000000000..f18ede01e --- /dev/null +++ b/selfdrive/hardware/hw.h @@ -0,0 +1,35 @@ +#pragma once + +#include "selfdrive/hardware/base.h" +#include "selfdrive/common/util.h" + +#ifdef QCOM +#include "selfdrive/hardware/eon/hardware.h" +#define Hardware HardwareEon +#elif QCOM2 +#include "selfdrive/hardware/tici/hardware.h" +#define Hardware HardwareTici +#else +class HardwarePC : public HardwareNone { +public: + static std::string get_os_version() { return "openpilot for PC"; } + static bool PC() { return true; } + static bool TICI() { return util::getenv("TICI", 0) == 1; } +}; +#define Hardware HardwarePC +#endif + +namespace Path { +inline std::string log_root() { + if (const char *env = getenv("LOG_ROOT")) { + return env; + } + return Hardware::PC() ? util::getenv("HOME") + "/.comma/media/0/realdata" : "/data/media/0/realdata"; +} +inline std::string params() { + return Hardware::PC() ? util::getenv("HOME") + "/.comma/params" : "/data/params"; +} +inline std::string rsa_file() { + return Hardware::PC() ? util::getenv("HOME") + "/.comma/persist/comma/id_rsa" : "/persist/comma/id_rsa"; +} +} // namespace Path diff --git a/selfdrive/hardware/pc/__init__.py b/selfdrive/hardware/pc/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/hardware/pc/hardware.py b/selfdrive/hardware/pc/hardware.py new file mode 100644 index 000000000..8231bbc2f --- /dev/null +++ b/selfdrive/hardware/pc/hardware.py @@ -0,0 +1,108 @@ +import random + +from cereal import log +from selfdrive.hardware.base import HardwareBase, ThermalConfig + +NetworkType = log.DeviceState.NetworkType +NetworkStrength = log.DeviceState.NetworkStrength + + +class Pc(HardwareBase): + def get_os_version(self): + return None + + def get_device_type(self): + return "pc" + + def get_sound_card_online(self): + return True + + def reboot(self, reason=None): + print("REBOOT!") + + def uninstall(self): + print("uninstall") + + def get_imei(self, slot): + return "%015d" % random.randint(0, 1 << 32) + + def get_serial(self): + return "cccccccc" + + def get_subscriber_info(self): + return "" + + def get_network_info(self): + return None + + def get_network_type(self): + return NetworkType.wifi + + def get_sim_info(self): + return { + 'sim_id': '', + 'mcc_mnc': None, + 'network_type': ["Unknown"], + 'sim_state': ["ABSENT"], + 'data_connected': False + } + + def get_network_strength(self, network_type): + return NetworkStrength.unknown + + def get_battery_capacity(self): + return 100 + + def get_battery_status(self): + return "" + + def get_battery_current(self): + return 0 + + def get_battery_voltage(self): + return 0 + + def get_battery_charging(self): + return True + + def set_battery_charging(self, on): + pass + + def get_usb_present(self): + return False + + def get_current_power_draw(self): + return 0 + + def shutdown(self): + print("SHUTDOWN!") + + def get_thermal_config(self): + return ThermalConfig(cpu=((None,), 1), gpu=((None,), 1), mem=(None, 1), bat=(None, 1), ambient=(None, 1), pmic=((None,), 1)) + + def set_screen_brightness(self, percentage): + pass + + def get_screen_brightness(self): + return 0 + + def set_power_save(self, powersave_enabled): + pass + + def get_gpu_usage_percent(self): + return 0 + + def get_modem_version(self): + return None + + def get_modem_temperatures(self): + return [] + + def get_nvme_temperatures(self): + return [] + + def initialize_hardware(self): + pass + + def get_networks(self): + return None diff --git a/selfdrive/hardware/tici/__init__.py b/selfdrive/hardware/tici/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/hardware/tici/amplifier.py b/selfdrive/hardware/tici/amplifier.py new file mode 100755 index 000000000..a8b279863 --- /dev/null +++ b/selfdrive/hardware/tici/amplifier.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +from smbus2 import SMBus +from collections import namedtuple + +# https://datasheets.maximintegrated.com/en/ds/MAX98089.pdf + +AmpConfig = namedtuple('AmpConfig', ['name', 'value', 'register', 'offset', 'mask']) +EQParams = namedtuple('EQParams', ['K', 'k1', 'k2', 'c1', 'c2']) + +def configs_from_eq_params(base, eq_params): + return [ + AmpConfig("K (high)", (eq_params.K >> 8), base, 0, 0xFF), + AmpConfig("K (low)", (eq_params.K & 0xFF), base + 1, 0, 0xFF), + AmpConfig("k1 (high)", (eq_params.k1 >> 8), base + 2, 0, 0xFF), + AmpConfig("k1 (low)", (eq_params.k1 & 0xFF), base + 3, 0, 0xFF), + AmpConfig("k2 (high)", (eq_params.k2 >> 8), base + 4, 0, 0xFF), + AmpConfig("k2 (low)", (eq_params.k2 & 0xFF), base + 5, 0, 0xFF), + AmpConfig("c1 (high)", (eq_params.c1 >> 8), base + 6, 0, 0xFF), + AmpConfig("c1 (low)", (eq_params.c1 & 0xFF), base + 7, 0, 0xFF), + AmpConfig("c2 (high)", (eq_params.c2 >> 8), base + 8, 0, 0xFF), + AmpConfig("c2 (low)", (eq_params.c2 & 0xFF), base + 9, 0, 0xFF), + ] + +BASE_CONFIG = [ + AmpConfig("MCLK prescaler", 0b01, 0x10, 4, 0b00110000), + AmpConfig("PM: enable speakers", 0b11, 0x4D, 4, 0b00110000), + AmpConfig("PM: enable DACs", 0b11, 0x4D, 0, 0b00000011), + AmpConfig("Right speaker output from right DAC", 0b1, 0x2C, 0, 0b11111111), + AmpConfig("Right Speaker Mixer Gain", 0b00, 0x2D, 2, 0b00001100), + AmpConfig("Enable PLL1", 0b1, 0x12, 7, 0b10000000), + AmpConfig("Enable PLL2", 0b1, 0x1A, 7, 0b10000000), + AmpConfig("DAI1: I2S mode", 0b00100, 0x14, 2, 0b01111100), + AmpConfig("DAI2: I2S mode", 0b00100, 0x1C, 2, 0b01111100), + AmpConfig("Right speaker output volume", 0x1c, 0x3E, 0, 0b00011111), + AmpConfig("DAI1 Passband filtering: music mode", 0b1, 0x18, 7, 0b10000000), + AmpConfig("DAI1 voice mode gain (DV1G)", 0b00, 0x2F, 4, 0b00110000), + AmpConfig("DAI1 attenuation (DV1)", 0x0, 0x2F, 0, 0b00001111), + AmpConfig("DAI2 attenuation (DV2)", 0x0, 0x31, 0, 0b00001111), + AmpConfig("DAI2: DC blocking", 0b1, 0x20, 0, 0b00000001), + AmpConfig("DAI2: High sample rate", 0b0, 0x20, 3, 0b00001000), + AmpConfig("ALC enable", 0b1, 0x43, 7, 0b10000000), + AmpConfig("ALC/excursion limiter release time", 0b101, 0x43, 4, 0b01110000), + AmpConfig("ALC multiband enable", 0b1, 0x43, 3, 0b00001000), + AmpConfig("DAI1 EQ enable", 0b0, 0x49, 0, 0b00000001), + AmpConfig("DAI2 EQ enable", 0b1, 0x49, 1, 0b00000010), + AmpConfig("DAI2 EQ clip detection disabled", 0b1, 0x32, 4, 0b00010000), + AmpConfig("DAI2 EQ attenuation", 0x5, 0x32, 0, 0b00001111), + AmpConfig("Excursion limiter upper corner freq", 0b100, 0x41, 4, 0b01110000), + AmpConfig("Excursion limiter lower corner freq", 0b00, 0x41, 0, 0b00000011), + AmpConfig("Excursion limiter threshold", 0b000, 0x42, 0, 0b00001111), + AmpConfig("Distortion limit (THDCLP)", 0x6, 0x46, 4, 0b11110000), + AmpConfig("Distortion limiter release time constant", 0b0, 0x46, 0, 0b00000001), + AmpConfig("Right DAC input mixer: DAI1 left", 0b0, 0x22, 3, 0b00001000), + AmpConfig("Right DAC input mixer: DAI1 right", 0b0, 0x22, 2, 0b00000100), + AmpConfig("Right DAC input mixer: DAI2 left", 0b1, 0x22, 1, 0b00000010), + AmpConfig("Right DAC input mixer: DAI2 right", 0b0, 0x22, 0, 0b00000001), + AmpConfig("DAI1 audio port selector", 0b10, 0x16, 6, 0b11000000), + AmpConfig("DAI2 audio port selector", 0b01, 0x1E, 6, 0b11000000), + AmpConfig("Enable left digital microphone", 0b1, 0x48, 5, 0b00100000), + AmpConfig("Enable right digital microphone", 0b1, 0x48, 4, 0b00010000), + AmpConfig("Enhanced volume smoothing disabled", 0b0, 0x49, 7, 0b10000000), + AmpConfig("Volume adjustment smoothing disabled", 0b0, 0x49, 6, 0b01000000), + AmpConfig("Zero-crossing detection disabled", 0b0, 0x49, 5, 0b00100000), +] + +BASE_CONFIG += configs_from_eq_params(0x84, EQParams(0x274F, 0xC0FF, 0x3BF9, 0x0B3C, 0x1656)) +BASE_CONFIG += configs_from_eq_params(0x8E, EQParams(0x1009, 0xC6BF, 0x2952, 0x1C97, 0x30DF)) +BASE_CONFIG += configs_from_eq_params(0x98, EQParams(0x0F75, 0xCBE5, 0x0ED2, 0x2528, 0x3E42)) +BASE_CONFIG += configs_from_eq_params(0xA2, EQParams(0x091F, 0x3D4C, 0xCE11, 0x1266, 0x2807)) +BASE_CONFIG += configs_from_eq_params(0xAC, EQParams(0x0A9E, 0x3F20, 0xE573, 0x0A8B, 0x3A3B)) + +class Amplifier: + AMP_I2C_BUS = 0 + AMP_ADDRESS = 0x10 + + def __init__(self, debug=False): + self.debug = debug + + def set_config(self, config): + with SMBus(self.AMP_I2C_BUS) as bus: + if self.debug: + print(f"Setting \"{config.name}\" to {config.value}:") + + old_value = bus.read_byte_data(self.AMP_ADDRESS, config.register, force=True) + new_value = (old_value & (~config.mask)) | ((config.value << config.offset) & config.mask) + bus.write_byte_data(self.AMP_ADDRESS, config.register, new_value, force=True) + + if self.debug: + print(f" Changed {hex(config.register)}: {hex(old_value)} -> {hex(new_value)}") + + def set_global_shutdown(self, amp_disabled): + self.set_config(AmpConfig("Global shutdown", 0b0 if amp_disabled else 0b1, 0x51, 7, 0b10000000)) + + def initialize_configuration(self): + self.set_global_shutdown(amp_disabled=True) + + for config in BASE_CONFIG: + self.set_config(config) + + self.set_global_shutdown(amp_disabled=False) + + +if __name__ == "__main__": + Amplifier(debug=True).initialize_configuration() diff --git a/selfdrive/hardware/tici/hardware.py b/selfdrive/hardware/tici/hardware.py new file mode 100644 index 000000000..41ae316d3 --- /dev/null +++ b/selfdrive/hardware/tici/hardware.py @@ -0,0 +1,410 @@ +import json +import math +import os +import subprocess +from enum import IntEnum +from functools import cached_property +from pathlib import Path + +from cereal import log +from selfdrive.hardware.base import HardwareBase, ThermalConfig +from selfdrive.hardware.tici import iwlist +from selfdrive.hardware.tici.amplifier import Amplifier + +NM = 'org.freedesktop.NetworkManager' +NM_CON_ACT = NM + '.Connection.Active' +NM_DEV_WL = NM + '.Device.Wireless' +NM_AP = NM + '.AccessPoint' +DBUS_PROPS = 'org.freedesktop.DBus.Properties' + +MM = 'org.freedesktop.ModemManager1' +MM_MODEM = MM + ".Modem" +MM_MODEM_SIMPLE = MM + ".Modem.Simple" +MM_SIM = MM + ".Sim" + +class MM_MODEM_STATE(IntEnum): + FAILED = -1 + UNKNOWN = 0 + INITIALIZING = 1 + LOCKED = 2 + DISABLED = 3 + DISABLING = 4 + ENABLING = 5 + ENABLED = 6 + SEARCHING = 7 + REGISTERED = 8 + DISCONNECTING = 9 + CONNECTING = 10 + CONNECTED = 11 + +TIMEOUT = 0.1 + +NetworkType = log.DeviceState.NetworkType +NetworkStrength = log.DeviceState.NetworkStrength + +# https://developer.gnome.org/ModemManager/unstable/ModemManager-Flags-and-Enumerations.html#MMModemAccessTechnology +MM_MODEM_ACCESS_TECHNOLOGY_UMTS = 1 << 5 +MM_MODEM_ACCESS_TECHNOLOGY_LTE = 1 << 14 + +class Tici(HardwareBase): + @cached_property + def bus(self): + import dbus # pylint: disable=import-error + return dbus.SystemBus() + + @cached_property + def nm(self): + return self.bus.get_object(NM, '/org/freedesktop/NetworkManager') + + @cached_property + def mm(self): + return self.bus.get_object(MM, '/org/freedesktop/ModemManager1') + + @cached_property + def amplifier(self): + return Amplifier() + + def get_os_version(self): + with open("/VERSION") as f: + return f.read().strip() + + def get_device_type(self): + return "tici" + + def get_sound_card_online(self): + return (os.path.isfile('/proc/asound/card0/state') and + open('/proc/asound/card0/state').read().strip() == 'ONLINE') + + def reboot(self, reason=None): + subprocess.check_output(["sudo", "reboot"]) + + def uninstall(self): + Path("/data/__system_reset__").touch() + os.sync() + self.reboot() + + def get_serial(self): + return self.get_cmdline()['androidboot.serialno'] + + def get_network_type(self): + try: + primary_connection = self.nm.Get(NM, 'PrimaryConnection', dbus_interface=DBUS_PROPS, timeout=TIMEOUT) + primary_connection = self.bus.get_object(NM, primary_connection) + primary_type = primary_connection.Get(NM_CON_ACT, 'Type', dbus_interface=DBUS_PROPS, timeout=TIMEOUT) + primary_id = primary_connection.Get(NM_CON_ACT, 'Id', dbus_interface=DBUS_PROPS, timeout=TIMEOUT) + + if primary_type == '802-3-ethernet': + return NetworkType.ethernet + elif primary_type == '802-11-wireless' and primary_id != 'Hotspot': + return NetworkType.wifi + else: + active_connections = self.nm.Get(NM, 'ActiveConnections', dbus_interface=DBUS_PROPS, timeout=TIMEOUT) + for conn in active_connections: + c = self.bus.get_object(NM, conn) + tp = c.Get(NM_CON_ACT, 'Type', dbus_interface=DBUS_PROPS, timeout=TIMEOUT) + if tp == 'gsm': + modem = self.get_modem() + access_t = modem.Get(MM_MODEM, 'AccessTechnologies', dbus_interface=DBUS_PROPS, timeout=TIMEOUT) + if access_t >= MM_MODEM_ACCESS_TECHNOLOGY_LTE: + return NetworkType.cell4G + elif access_t >= MM_MODEM_ACCESS_TECHNOLOGY_UMTS: + return NetworkType.cell3G + else: + return NetworkType.cell2G + except Exception: + pass + + return NetworkType.none + + def get_modem(self): + objects = self.mm.GetManagedObjects(dbus_interface="org.freedesktop.DBus.ObjectManager", timeout=TIMEOUT) + modem_path = list(objects.keys())[0] + return self.bus.get_object(MM, modem_path) + + def get_wlan(self): + wlan_path = self.nm.GetDeviceByIpIface('wlan0', dbus_interface=NM, timeout=TIMEOUT) + return self.bus.get_object(NM, wlan_path) + + def get_sim_info(self): + modem = self.get_modem() + sim_path = modem.Get(MM_MODEM, 'Sim', dbus_interface=DBUS_PROPS, timeout=TIMEOUT) + + if sim_path == "/": + return { + 'sim_id': '', + 'mcc_mnc': None, + 'network_type': ["Unknown"], + 'sim_state': ["ABSENT"], + 'data_connected': False + } + else: + sim = self.bus.get_object(MM, sim_path) + return { + 'sim_id': str(sim.Get(MM_SIM, 'SimIdentifier', dbus_interface=DBUS_PROPS, timeout=TIMEOUT)), + 'mcc_mnc': str(sim.Get(MM_SIM, 'OperatorIdentifier', dbus_interface=DBUS_PROPS, timeout=TIMEOUT)), + 'network_type': ["Unknown"], + 'sim_state': ["READY"], + 'data_connected': modem.Get(MM_MODEM, 'State', dbus_interface=DBUS_PROPS, timeout=TIMEOUT) == MM_MODEM_STATE.CONNECTED, + } + + def get_subscriber_info(self): + return "" + + def get_imei(self, slot): + if slot != 0: + return "" + + return str(self.get_modem().Get(MM_MODEM, 'EquipmentIdentifier', dbus_interface=DBUS_PROPS, timeout=TIMEOUT)) + + def get_network_info(self): + modem = self.get_modem() + try: + info = modem.Command("AT+QNWINFO", math.ceil(TIMEOUT), dbus_interface=MM_MODEM, timeout=TIMEOUT) + extra = modem.Command('AT+QENG="servingcell"', math.ceil(TIMEOUT), dbus_interface=MM_MODEM, timeout=TIMEOUT) + state = modem.Get(MM_MODEM, 'State', dbus_interface=DBUS_PROPS, timeout=TIMEOUT) + except Exception: + return None + + if info and info.startswith('+QNWINFO: '): + info = info.replace('+QNWINFO: ', '').replace('"', '').split(',') + extra = "" if extra is None else extra.replace('+QENG: "servingcell",', '').replace('"', '') + state = "" if state is None else MM_MODEM_STATE(state).name + + if len(info) != 4: + return None + + technology, operator, band, channel = info + + return({ + 'technology': technology, + 'operator': operator, + 'band': band, + 'channel': int(channel), + 'extra': extra, + 'state': state, + }) + else: + return None + + def parse_strength(self, percentage): + if percentage < 25: + return NetworkStrength.poor + elif percentage < 50: + return NetworkStrength.moderate + elif percentage < 75: + return NetworkStrength.good + else: + return NetworkStrength.great + + def get_network_strength(self, network_type): + network_strength = NetworkStrength.unknown + + try: + if network_type == NetworkType.none: + pass + elif network_type == NetworkType.wifi: + wlan = self.get_wlan() + active_ap_path = wlan.Get(NM_DEV_WL, 'ActiveAccessPoint', dbus_interface=DBUS_PROPS, timeout=TIMEOUT) + if active_ap_path != "/": + active_ap = self.bus.get_object(NM, active_ap_path) + strength = int(active_ap.Get(NM_AP, 'Strength', dbus_interface=DBUS_PROPS, timeout=TIMEOUT)) + network_strength = self.parse_strength(strength) + else: # Cellular + modem = self.get_modem() + strength = int(modem.Get(MM_MODEM, 'SignalQuality', dbus_interface=DBUS_PROPS, timeout=TIMEOUT)[0]) + network_strength = self.parse_strength(strength) + except Exception: + pass + + return network_strength + + @staticmethod + def set_bandwidth_limit(upload_speed_kbps: int, download_speed_kbps: int) -> None: + upload_speed_kbps = int(upload_speed_kbps) # Ensure integer value + download_speed_kbps = int(download_speed_kbps) # Ensure integer value + + adapter = "wwan0" + ifb = "ifb0" + + sudo = ["sudo"] + tc = sudo + ["tc"] + + # check, cmd + cleanup = [ + # Clean up old rules + (False, tc + ["qdisc", "del", "dev", adapter, "root"]), + (False, tc + ["qdisc", "del", "dev", ifb, "root"]), + (False, tc + ["qdisc", "del", "dev", adapter, "ingress"]), + (False, tc + ["qdisc", "del", "dev", ifb, "ingress"]), + + # Bring ifb0 down + (False, sudo + ["ip", "link", "set", "dev", ifb, "down"]), + ] + + upload = [ + # Create root Hierarchy Token Bucket that sends all trafic to 1:20 + (True, tc + ["qdisc", "add", "dev", adapter, "root", "handle", "1:", "htb", "default", "20"]), + + # Create class 1:20 with specified rate limit + (True, tc + ["class", "add", "dev", adapter, "parent", "1:", "classid", "1:20", "htb", "rate", f"{upload_speed_kbps}kbit"]), + + # Create universal 32 bit filter on adapter that sends all outbound ip traffic through the class + (True, tc + ["filter", "add", "dev", adapter, "parent", "1:", "protocol", "ip", "prio", "10", "u32", "match", "ip", "dst", "0.0.0.0/0", "flowid", "1:20"]), + ] + + download = [ + # Bring ifb0 up + (True, sudo + ["ip", "link", "set", "dev", ifb, "up"]), + + # Redirect ingress (incoming) to egress ifb0 + (True, tc + ["qdisc", "add", "dev", adapter, "handle", "ffff:", "ingress"]), + (True, tc + ["filter", "add", "dev", adapter, "parent", "ffff:", "protocol", "ip", "u32", "match", "u32", "0", "0", "action", "mirred", "egress", "redirect", "dev", ifb]), + + # Add class and rules for virtual interface + (True, tc + ["qdisc", "add", "dev", ifb, "root", "handle", "2:", "htb"]), + (True, tc + ["class", "add", "dev", ifb, "parent", "2:", "classid", "2:1", "htb", "rate", f"{download_speed_kbps}kbit"]), + + # Add filter to rule for IP address + (True, tc + ["filter", "add", "dev", ifb, "protocol", "ip", "parent", "2:", "prio", "1", "u32", "match", "ip", "src", "0.0.0.0/0", "flowid", "2:1"]), + ] + + commands = cleanup + if upload_speed_kbps != -1: + commands += upload + if download_speed_kbps != -1: + commands += download + + for check, cmd in commands: + subprocess.run(cmd, check=check) + + def get_modem_version(self): + try: + modem = self.get_modem() + return modem.Get(MM_MODEM, 'Revision', dbus_interface=DBUS_PROPS, timeout=TIMEOUT) + except Exception: + return None + + def get_modem_temperatures(self): + timeout = 0.2 # Default timeout is too short + try: + modem = self.get_modem() + temps = modem.Command("AT+QTEMP", math.ceil(timeout), dbus_interface=MM_MODEM, timeout=timeout) + return list(map(int, temps.split(' ')[1].split(','))) + except Exception: + return [] + + def get_nvme_temperatures(self): + ret = [] + try: + out = subprocess.check_output("sudo smartctl -aj /dev/nvme0", shell=True) + dat = json.loads(out) + ret = list(map(int, dat["nvme_smart_health_information_log"]["temperature_sensors"])) + except Exception: + pass + return ret + + # We don't have a battery, so let's use some sane constants + def get_battery_capacity(self): + return 100 + + def get_battery_status(self): + return "" + + def get_battery_current(self): + return 0 + + def get_battery_voltage(self): + return 0 + + def get_battery_charging(self): + return True + + def set_battery_charging(self, on): + pass + + def get_usb_present(self): + # Not sure if relevant on tici, but the file exists + return self.read_param_file("/sys/class/power_supply/usb/present", lambda x: bool(int(x)), False) + + def get_current_power_draw(self): + return (self.read_param_file("/sys/class/hwmon/hwmon1/power1_input", int) / 1e6) + + def shutdown(self): + # Note that for this to work and have the device stay powered off, the panda needs to be in UsbPowerMode::CLIENT! + os.system("sudo poweroff") + + def get_thermal_config(self): + return ThermalConfig(cpu=((1, 2, 3, 4, 5, 6, 7, 8), 1000), gpu=((48,49), 1000), mem=(15, 1000), bat=(None, 1), ambient=(65, 1000), pmic=((35, 36), 1000)) + + def set_screen_brightness(self, percentage): + try: + with open("/sys/class/backlight/panel0-backlight/brightness", "w") as f: + f.write(str(int(percentage * 10.23))) + except Exception: + pass + + def get_screen_brightness(self): + try: + with open("/sys/class/backlight/panel0-backlight/brightness") as f: + return int(float(f.read()) / 10.23) + except Exception: + return 0 + + def set_power_save(self, powersave_enabled): + # amplifier, 100mW at idle + self.amplifier.set_global_shutdown(amp_disabled=powersave_enabled) + if not powersave_enabled: + self.amplifier.initialize_configuration() + + # offline big cluster, leave core 4 online for boardd + for i in range(5, 8): + # TODO: fix permissions with udev + val = "0" if powersave_enabled else "1" + os.system(f"sudo su -c 'echo {val} > /sys/devices/system/cpu/cpu{i}/online'") + + for n in ('0', '4'): + gov = 'userspace' if powersave_enabled else 'performance' + os.system(f"sudo su -c 'echo {gov} > /sys/devices/system/cpu/cpufreq/policy{n}/scaling_governor'") + + if powersave_enabled: + os.system(f"sudo su -c 'echo 979200 > /sys/devices/system/cpu/cpufreq/policy{n}/scaling_setspeed'") + + def get_gpu_usage_percent(self): + try: + used, total = open('/sys/class/kgsl/kgsl-3d0/gpubusy').read().strip().split() + return 100.0 * int(used) / int(total) + except Exception: + return 0 + + def initialize_hardware(self): + self.amplifier.initialize_configuration() + + # Allow thermald to write engagement status to kmsg + os.system("sudo chmod a+w /dev/kmsg") + + def get_networks(self): + r = {} + + wlan = iwlist.scan() + if wlan is not None: + r['wlan'] = wlan + + lte_info = self.get_network_info() + if lte_info is not None: + extra = lte_info['extra'] + + # ,"LTE",,,,,,,, + # ,,,,,,, + if 'LTE' in extra: + extra = extra.split(',') + try: + r['lte'] = [{ + "mcc": int(extra[3]), + "mnc": int(extra[4]), + "cid": int(extra[5], 16), + "nmr": [{"pci": int(extra[6]), "earfcn": int(extra[7])}], + }] + except (ValueError, IndexError): + pass + + return r diff --git a/selfdrive/hardware/tici/iwlist.py b/selfdrive/hardware/tici/iwlist.py new file mode 100644 index 000000000..1e7c428b4 --- /dev/null +++ b/selfdrive/hardware/tici/iwlist.py @@ -0,0 +1,35 @@ +import subprocess + + +def scan(interface="wlan0"): + result = [] + try: + r = subprocess.check_output(["iwlist", interface, "scan"], encoding='utf8') + + mac = None + for line in r.split('\n'): + if "Address" in line: + # Based on the adapter eithere a percentage or dBm is returned + # Add previous network in case no dBm signal level was seen + if mac is not None: + result.append({"mac": mac}) + mac = None + + mac = line.split(' ')[-1] + elif "dBm" in line: + try: + level = line.split('Signal level=')[1] + rss = int(level.split(' ')[0]) + result.append({"mac": mac, "rss": rss}) + mac = None + except ValueError: + continue + + # Add last network if no dBm was found + if mac is not None: + result.append({"mac": mac}) + + return result + + except Exception: + return None diff --git a/selfdrive/locationd/.gitignore b/selfdrive/locationd/.gitignore new file mode 100644 index 000000000..526890278 --- /dev/null +++ b/selfdrive/locationd/.gitignore @@ -0,0 +1,5 @@ +ubloxd +ubloxd_test +params_learner +paramsd +locationd diff --git a/selfdrive/locationd/SConscript b/selfdrive/locationd/SConscript new file mode 100644 index 000000000..4b7fba19b --- /dev/null +++ b/selfdrive/locationd/SConscript @@ -0,0 +1,22 @@ +Import('env', 'common', 'cereal', 'messaging', 'libkf', 'transformations') + +loc_libs = [cereal, messaging, 'zmq', common, 'capnp', 'kj', 'kaitai', 'pthread'] + +if GetOption('kaitai'): + generated = Dir('generated').srcnode().abspath + cmd = f"kaitai-struct-compiler --target cpp_stl --outdir {generated} $SOURCES" + env.Command(['generated/ubx.cpp', 'generated/ubx.h'], 'ubx.ksy', cmd) + env.Command(['generated/gps.cpp', 'generated/gps.h'], 'gps.ksy', cmd) + +env.Program("ubloxd", ["ubloxd.cc", "ublox_msg.cc", "generated/ubx.cpp", "generated/gps.cpp"], LIBS=loc_libs) + +ekf_sym_cc = env.SharedObject("#rednose/helpers/ekf_sym.cc") +locationd_sources = ["locationd.cc", "models/live_kf.cc", ekf_sym_cc] +lenv = env.Clone() +lenv["_LIBFLAGS"] += f' {libkf[0].get_labspath()}' +locationd = lenv.Program("locationd", locationd_sources, LIBS=loc_libs + transformations) +lenv.Depends(locationd, libkf) + +if File("liblocationd.cc").exists(): + liblocationd = lenv.SharedLibrary("liblocationd", ["liblocationd.cc"] + locationd_sources, LIBS=loc_libs + transformations) + lenv.Depends(liblocationd, libkf) diff --git a/selfdrive/locationd/__init__.py b/selfdrive/locationd/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/locationd/calibrationd.py b/selfdrive/locationd/calibrationd.py new file mode 100755 index 000000000..ae314e38c --- /dev/null +++ b/selfdrive/locationd/calibrationd.py @@ -0,0 +1,232 @@ +#!/usr/bin/env python3 +''' +This process finds calibration values. More info on what these calibration values +are can be found here https://github.com/commaai/openpilot/tree/master/common/transformations +While the roll calibration is a real value that can be estimated, here we assume it's zero, +and the image input into the neural network is not corrected for roll. +''' + +import gc +import os +import numpy as np +from typing import NoReturn + +from cereal import log +import cereal.messaging as messaging +from common.params import Params, put_nonblocking +from common.realtime import set_realtime_priority +from common.transformations.model import model_height +from common.transformations.camera import get_view_frame_from_road_frame +from common.transformations.orientation import rot_from_euler, euler_from_rot +from selfdrive.config import Conversions as CV +from selfdrive.hardware import TICI +from selfdrive.swaglog import cloudlog + +MIN_SPEED_FILTER = 15 * CV.MPH_TO_MS +MAX_VEL_ANGLE_STD = np.radians(0.25) +MAX_YAW_RATE_FILTER = np.radians(2) # per second + +# This is at model frequency, blocks needed for efficiency +SMOOTH_CYCLES = 400 +BLOCK_SIZE = 100 +INPUTS_NEEDED = 5 # Minimum blocks needed for valid calibration +INPUTS_WANTED = 50 # We want a little bit more than we need for stability +MAX_ALLOWED_SPREAD = np.radians(2) +RPY_INIT = np.array([0.0,0.0,0.0]) + +# These values are needed to accommodate biggest modelframe +PITCH_LIMITS = np.array([-0.09074112085129739, 0.14907572052989657]) +YAW_LIMITS = np.array([-0.06912048084718224, 0.06912048084718235]) +DEBUG = os.getenv("DEBUG") is not None + + +class Calibration: + UNCALIBRATED = 0 + CALIBRATED = 1 + INVALID = 2 + + +def is_calibration_valid(rpy): + return (PITCH_LIMITS[0] < rpy[1] < PITCH_LIMITS[1]) and (YAW_LIMITS[0] < rpy[2] < YAW_LIMITS[1]) + + +def sanity_clip(rpy): + if np.isnan(rpy).any(): + rpy = RPY_INIT + return np.array([rpy[0], + np.clip(rpy[1], PITCH_LIMITS[0] - .005, PITCH_LIMITS[1] + .005), + np.clip(rpy[2], YAW_LIMITS[0] - .005, YAW_LIMITS[1] + .005)]) + + +class Calibrator(): + def __init__(self, param_put=False): + self.param_put = param_put + + # Read saved calibration + params = Params() + calibration_params = params.get("CalibrationParams") + self.wide_camera = TICI and params.get_bool('EnableWideCamera') + rpy_init = RPY_INIT + valid_blocks = 0 + + if param_put and calibration_params: + try: + msg = log.Event.from_bytes(calibration_params) + rpy_init = np.array(msg.liveCalibration.rpyCalib) + valid_blocks = msg.liveCalibration.validBlocks + except Exception: + cloudlog.exception("Error reading cached CalibrationParams") + + self.reset(rpy_init, valid_blocks) + self.update_status() + + def reset(self, rpy_init=RPY_INIT, valid_blocks=0, smooth_from=None): + if not np.isfinite(rpy_init).all(): + self.rpy = RPY_INIT.copy() + else: + self.rpy = rpy_init.copy() + + if not np.isfinite(valid_blocks) or valid_blocks < 0: + self.valid_blocks = 0 + else: + self.valid_blocks = valid_blocks + + self.rpys = np.tile(self.rpy, (INPUTS_WANTED, 1)) + + self.idx = 0 + self.block_idx = 0 + self.v_ego = 0 + + if smooth_from is None: + self.old_rpy = RPY_INIT + self.old_rpy_weight = 0.0 + else: + self.old_rpy = smooth_from + self.old_rpy_weight = 1.0 + + def get_valid_idxs(self): + # exclude current block_idx from validity window + before_current = list(range(self.block_idx)) + after_current = list(range(min(self.valid_blocks, self.block_idx + 1), self.valid_blocks)) + return before_current + after_current + + def update_status(self): + valid_idxs = self.get_valid_idxs() + if valid_idxs: + rpys = self.rpys[valid_idxs] + self.rpy = np.mean(rpys, axis=0) + max_rpy_calib = np.array(np.max(rpys, axis=0)) + min_rpy_calib = np.array(np.min(rpys, axis=0)) + self.calib_spread = np.abs(max_rpy_calib - min_rpy_calib) + else: + self.calib_spread = np.zeros(3) + + if self.valid_blocks < INPUTS_NEEDED: + self.cal_status = Calibration.UNCALIBRATED + elif is_calibration_valid(self.rpy): + self.cal_status = Calibration.CALIBRATED + else: + self.cal_status = Calibration.INVALID + + # If spread is too high, assume mounting was changed and reset to last block. + # Make the transition smooth. Abrupt transitions are not good foor feedback loop through supercombo model. + if max(self.calib_spread) > MAX_ALLOWED_SPREAD and self.cal_status == Calibration.CALIBRATED: + self.reset(self.rpys[self.block_idx - 1], valid_blocks=INPUTS_NEEDED, smooth_from=self.rpy) + + write_this_cycle = (self.idx == 0) and (self.block_idx % (INPUTS_WANTED//5) == 5) + if self.param_put and write_this_cycle: + put_nonblocking("CalibrationParams", self.get_msg().to_bytes()) + + def handle_v_ego(self, v_ego): + self.v_ego = v_ego + + def get_smooth_rpy(self): + if self.old_rpy_weight > 0: + return self.old_rpy_weight * self.old_rpy + (1.0 - self.old_rpy_weight) * self.rpy + else: + return self.rpy + + def handle_cam_odom(self, trans, rot, trans_std, rot_std): + self.old_rpy_weight = min(0.0, self.old_rpy_weight - 1/SMOOTH_CYCLES) + + straight_and_fast = ((self.v_ego > MIN_SPEED_FILTER) and (trans[0] > MIN_SPEED_FILTER) and (abs(rot[2]) < MAX_YAW_RATE_FILTER)) + if self.wide_camera: + angle_std_threshold = 4*MAX_VEL_ANGLE_STD + else: + angle_std_threshold = MAX_VEL_ANGLE_STD + certain_if_calib = ((np.arctan2(trans_std[1], trans[0]) < angle_std_threshold) or + (self.valid_blocks < INPUTS_NEEDED)) + if not (straight_and_fast and certain_if_calib): + return None + + observed_rpy = np.array([0, + -np.arctan2(trans[2], trans[0]), + np.arctan2(trans[1], trans[0])]) + new_rpy = euler_from_rot(rot_from_euler(self.get_smooth_rpy()).dot(rot_from_euler(observed_rpy))) + new_rpy = sanity_clip(new_rpy) + + self.rpys[self.block_idx] = (self.idx*self.rpys[self.block_idx] + (BLOCK_SIZE - self.idx) * new_rpy) / float(BLOCK_SIZE) + self.idx = (self.idx + 1) % BLOCK_SIZE + if self.idx == 0: + self.block_idx += 1 + self.valid_blocks = max(self.block_idx, self.valid_blocks) + self.block_idx = self.block_idx % INPUTS_WANTED + + self.update_status() + + return new_rpy + + def get_msg(self): + smooth_rpy = self.get_smooth_rpy() + extrinsic_matrix = get_view_frame_from_road_frame(0, smooth_rpy[1], smooth_rpy[2], model_height) + + msg = messaging.new_message('liveCalibration') + msg.liveCalibration.validBlocks = self.valid_blocks + msg.liveCalibration.calStatus = self.cal_status + msg.liveCalibration.calPerc = min(100 * (self.valid_blocks * BLOCK_SIZE + self.idx) // (INPUTS_NEEDED * BLOCK_SIZE), 100) + msg.liveCalibration.extrinsicMatrix = extrinsic_matrix.flatten().tolist() + msg.liveCalibration.rpyCalib = smooth_rpy.tolist() + msg.liveCalibration.rpyCalibSpread = self.calib_spread.tolist() + return msg + + def send_data(self, pm) -> None: + pm.send('liveCalibration', self.get_msg()) + + +def calibrationd_thread(sm=None, pm=None) -> NoReturn: + gc.disable() + set_realtime_priority(1) + + if sm is None: + sm = messaging.SubMaster(['cameraOdometry', 'carState'], poll=['cameraOdometry']) + + if pm is None: + pm = messaging.PubMaster(['liveCalibration']) + + calibrator = Calibrator(param_put=True) + + while 1: + timeout = 0 if sm.frame == -1 else 100 + sm.update(timeout) + + if sm.updated['cameraOdometry']: + calibrator.handle_v_ego(sm['carState'].vEgo) + new_rpy = calibrator.handle_cam_odom(sm['cameraOdometry'].trans, + sm['cameraOdometry'].rot, + sm['cameraOdometry'].transStd, + sm['cameraOdometry'].rotStd) + + if DEBUG and new_rpy is not None: + print('got new rpy', new_rpy) + + # 4Hz driven by cameraOdometry + if sm.frame % 5 == 0: + calibrator.send_data(pm) + + +def main(sm=None, pm=None) -> NoReturn: + calibrationd_thread(sm, pm) + + +if __name__ == "__main__": + main() diff --git a/selfdrive/locationd/generated/gps.cpp b/selfdrive/locationd/generated/gps.cpp new file mode 100644 index 000000000..9b020735b --- /dev/null +++ b/selfdrive/locationd/generated/gps.cpp @@ -0,0 +1,325 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "gps.h" +#include "kaitai/exceptions.h" + +gps_t::gps_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, gps_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = this; + m_tlm = 0; + m_how = 0; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void gps_t::_read() { + m_tlm = new tlm_t(m__io, this, m__root); + m_how = new how_t(m__io, this, m__root); + n_body = true; + switch (how()->subframe_id()) { + case 1: { + n_body = false; + m_body = new subframe_1_t(m__io, this, m__root); + break; + } + case 2: { + n_body = false; + m_body = new subframe_2_t(m__io, this, m__root); + break; + } + case 3: { + n_body = false; + m_body = new subframe_3_t(m__io, this, m__root); + break; + } + case 4: { + n_body = false; + m_body = new subframe_4_t(m__io, this, m__root); + break; + } + } +} + +gps_t::~gps_t() { + _clean_up(); +} + +void gps_t::_clean_up() { + if (m_tlm) { + delete m_tlm; m_tlm = 0; + } + if (m_how) { + delete m_how; m_how = 0; + } + if (!n_body) { + if (m_body) { + delete m_body; m_body = 0; + } + } +} + +gps_t::subframe_1_t::subframe_1_t(kaitai::kstream* p__io, gps_t* p__parent, gps_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + f_af_0 = false; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void gps_t::subframe_1_t::_read() { + m_week_no = m__io->read_bits_int_be(10); + m_code = m__io->read_bits_int_be(2); + m_sv_accuracy = m__io->read_bits_int_be(4); + m_sv_health = m__io->read_bits_int_be(6); + m_iodc_msb = m__io->read_bits_int_be(2); + m_l2_p_data_flag = m__io->read_bits_int_be(1); + m_reserved1 = m__io->read_bits_int_be(23); + m_reserved2 = m__io->read_bits_int_be(24); + m_reserved3 = m__io->read_bits_int_be(24); + m_reserved4 = m__io->read_bits_int_be(16); + m__io->align_to_byte(); + m_t_gd = m__io->read_s1(); + m_iodc_lsb = m__io->read_u1(); + m_t_oc = m__io->read_u2be(); + m_af_2 = m__io->read_s1(); + m_af_1 = m__io->read_s2be(); + m_af_0_sign = m__io->read_bits_int_be(1); + m_af_0_value = m__io->read_bits_int_be(21); + m_reserved5 = m__io->read_bits_int_be(2); +} + +gps_t::subframe_1_t::~subframe_1_t() { + _clean_up(); +} + +void gps_t::subframe_1_t::_clean_up() { +} + +int32_t gps_t::subframe_1_t::af_0() { + if (f_af_0) + return m_af_0; + m_af_0 = ((af_0_sign()) ? ((af_0_value() - (1 << 21))) : (af_0_value())); + f_af_0 = true; + return m_af_0; +} + +gps_t::subframe_3_t::subframe_3_t(kaitai::kstream* p__io, gps_t* p__parent, gps_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + f_omega_dot = false; + f_idot = false; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void gps_t::subframe_3_t::_read() { + m_c_ic = m__io->read_s2be(); + m_omega_0 = m__io->read_s4be(); + m_c_is = m__io->read_s2be(); + m_i_0 = m__io->read_s4be(); + m_c_rc = m__io->read_s2be(); + m_omega = m__io->read_s4be(); + m_omega_dot_sign = m__io->read_bits_int_be(1); + m_omega_dot_value = m__io->read_bits_int_be(23); + m__io->align_to_byte(); + m_iode = m__io->read_u1(); + m_idot_sign = m__io->read_bits_int_be(1); + m_idot_value = m__io->read_bits_int_be(13); + m_reserved = m__io->read_bits_int_be(2); +} + +gps_t::subframe_3_t::~subframe_3_t() { + _clean_up(); +} + +void gps_t::subframe_3_t::_clean_up() { +} + +int32_t gps_t::subframe_3_t::omega_dot() { + if (f_omega_dot) + return m_omega_dot; + m_omega_dot = ((omega_dot_sign()) ? ((omega_dot_value() - (1 << 23))) : (omega_dot_value())); + f_omega_dot = true; + return m_omega_dot; +} + +int32_t gps_t::subframe_3_t::idot() { + if (f_idot) + return m_idot; + m_idot = ((idot_sign()) ? ((idot_value() - (1 << 13))) : (idot_value())); + f_idot = true; + return m_idot; +} + +gps_t::subframe_4_t::subframe_4_t(kaitai::kstream* p__io, gps_t* p__parent, gps_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void gps_t::subframe_4_t::_read() { + m_data_id = m__io->read_bits_int_be(2); + m_page_id = m__io->read_bits_int_be(6); + m__io->align_to_byte(); + n_body = true; + switch (page_id()) { + case 56: { + n_body = false; + m_body = new ionosphere_data_t(m__io, this, m__root); + break; + } + } +} + +gps_t::subframe_4_t::~subframe_4_t() { + _clean_up(); +} + +void gps_t::subframe_4_t::_clean_up() { + if (!n_body) { + if (m_body) { + delete m_body; m_body = 0; + } + } +} + +gps_t::subframe_4_t::ionosphere_data_t::ionosphere_data_t(kaitai::kstream* p__io, gps_t::subframe_4_t* p__parent, gps_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void gps_t::subframe_4_t::ionosphere_data_t::_read() { + m_a0 = m__io->read_s1(); + m_a1 = m__io->read_s1(); + m_a2 = m__io->read_s1(); + m_a3 = m__io->read_s1(); + m_b0 = m__io->read_s1(); + m_b1 = m__io->read_s1(); + m_b2 = m__io->read_s1(); + m_b3 = m__io->read_s1(); +} + +gps_t::subframe_4_t::ionosphere_data_t::~ionosphere_data_t() { + _clean_up(); +} + +void gps_t::subframe_4_t::ionosphere_data_t::_clean_up() { +} + +gps_t::how_t::how_t(kaitai::kstream* p__io, gps_t* p__parent, gps_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void gps_t::how_t::_read() { + m_tow_count = m__io->read_bits_int_be(17); + m_alert = m__io->read_bits_int_be(1); + m_anti_spoof = m__io->read_bits_int_be(1); + m_subframe_id = m__io->read_bits_int_be(3); + m_reserved = m__io->read_bits_int_be(2); +} + +gps_t::how_t::~how_t() { + _clean_up(); +} + +void gps_t::how_t::_clean_up() { +} + +gps_t::tlm_t::tlm_t(kaitai::kstream* p__io, gps_t* p__parent, gps_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void gps_t::tlm_t::_read() { + m_magic = m__io->read_bytes(1); + if (!(magic() == std::string("\x8B", 1))) { + throw kaitai::validation_not_equal_error(std::string("\x8B", 1), magic(), _io(), std::string("/types/tlm/seq/0")); + } + m_tlm = m__io->read_bits_int_be(14); + m_integrity_status = m__io->read_bits_int_be(1); + m_reserved = m__io->read_bits_int_be(1); +} + +gps_t::tlm_t::~tlm_t() { + _clean_up(); +} + +void gps_t::tlm_t::_clean_up() { +} + +gps_t::subframe_2_t::subframe_2_t(kaitai::kstream* p__io, gps_t* p__parent, gps_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void gps_t::subframe_2_t::_read() { + m_iode = m__io->read_u1(); + m_c_rs = m__io->read_s2be(); + m_delta_n = m__io->read_s2be(); + m_m_0 = m__io->read_s4be(); + m_c_uc = m__io->read_s2be(); + m_e = m__io->read_s4be(); + m_c_us = m__io->read_s2be(); + m_sqrt_a = m__io->read_u4be(); + m_t_oe = m__io->read_u2be(); + m_fit_interval_flag = m__io->read_bits_int_be(1); + m_aoda = m__io->read_bits_int_be(5); + m_reserved = m__io->read_bits_int_be(2); +} + +gps_t::subframe_2_t::~subframe_2_t() { + _clean_up(); +} + +void gps_t::subframe_2_t::_clean_up() { +} diff --git a/selfdrive/locationd/generated/gps.h b/selfdrive/locationd/generated/gps.h new file mode 100644 index 000000000..293e2e4a0 --- /dev/null +++ b/selfdrive/locationd/generated/gps.h @@ -0,0 +1,359 @@ +#ifndef GPS_H_ +#define GPS_H_ + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "kaitai/kaitaistruct.h" +#include + +#if KAITAI_STRUCT_VERSION < 9000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.9 or later is required" +#endif + +class gps_t : public kaitai::kstruct { + +public: + class subframe_1_t; + class subframe_3_t; + class subframe_4_t; + class how_t; + class tlm_t; + class subframe_2_t; + + gps_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, gps_t* p__root = 0); + +private: + void _read(); + void _clean_up(); + +public: + ~gps_t(); + + class subframe_1_t : public kaitai::kstruct { + + public: + + subframe_1_t(kaitai::kstream* p__io, gps_t* p__parent = 0, gps_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~subframe_1_t(); + + private: + bool f_af_0; + int32_t m_af_0; + + public: + int32_t af_0(); + + private: + uint64_t m_week_no; + uint64_t m_code; + uint64_t m_sv_accuracy; + uint64_t m_sv_health; + uint64_t m_iodc_msb; + bool m_l2_p_data_flag; + uint64_t m_reserved1; + uint64_t m_reserved2; + uint64_t m_reserved3; + uint64_t m_reserved4; + int8_t m_t_gd; + uint8_t m_iodc_lsb; + uint16_t m_t_oc; + int8_t m_af_2; + int16_t m_af_1; + bool m_af_0_sign; + uint64_t m_af_0_value; + uint64_t m_reserved5; + gps_t* m__root; + gps_t* m__parent; + + public: + uint64_t week_no() const { return m_week_no; } + uint64_t code() const { return m_code; } + uint64_t sv_accuracy() const { return m_sv_accuracy; } + uint64_t sv_health() const { return m_sv_health; } + uint64_t iodc_msb() const { return m_iodc_msb; } + bool l2_p_data_flag() const { return m_l2_p_data_flag; } + uint64_t reserved1() const { return m_reserved1; } + uint64_t reserved2() const { return m_reserved2; } + uint64_t reserved3() const { return m_reserved3; } + uint64_t reserved4() const { return m_reserved4; } + int8_t t_gd() const { return m_t_gd; } + uint8_t iodc_lsb() const { return m_iodc_lsb; } + uint16_t t_oc() const { return m_t_oc; } + int8_t af_2() const { return m_af_2; } + int16_t af_1() const { return m_af_1; } + bool af_0_sign() const { return m_af_0_sign; } + uint64_t af_0_value() const { return m_af_0_value; } + uint64_t reserved5() const { return m_reserved5; } + gps_t* _root() const { return m__root; } + gps_t* _parent() const { return m__parent; } + }; + + class subframe_3_t : public kaitai::kstruct { + + public: + + subframe_3_t(kaitai::kstream* p__io, gps_t* p__parent = 0, gps_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~subframe_3_t(); + + private: + bool f_omega_dot; + int32_t m_omega_dot; + + public: + int32_t omega_dot(); + + private: + bool f_idot; + int32_t m_idot; + + public: + int32_t idot(); + + private: + int16_t m_c_ic; + int32_t m_omega_0; + int16_t m_c_is; + int32_t m_i_0; + int16_t m_c_rc; + int32_t m_omega; + bool m_omega_dot_sign; + uint64_t m_omega_dot_value; + uint8_t m_iode; + bool m_idot_sign; + uint64_t m_idot_value; + uint64_t m_reserved; + gps_t* m__root; + gps_t* m__parent; + + public: + int16_t c_ic() const { return m_c_ic; } + int32_t omega_0() const { return m_omega_0; } + int16_t c_is() const { return m_c_is; } + int32_t i_0() const { return m_i_0; } + int16_t c_rc() const { return m_c_rc; } + int32_t omega() const { return m_omega; } + bool omega_dot_sign() const { return m_omega_dot_sign; } + uint64_t omega_dot_value() const { return m_omega_dot_value; } + uint8_t iode() const { return m_iode; } + bool idot_sign() const { return m_idot_sign; } + uint64_t idot_value() const { return m_idot_value; } + uint64_t reserved() const { return m_reserved; } + gps_t* _root() const { return m__root; } + gps_t* _parent() const { return m__parent; } + }; + + class subframe_4_t : public kaitai::kstruct { + + public: + class ionosphere_data_t; + + subframe_4_t(kaitai::kstream* p__io, gps_t* p__parent = 0, gps_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~subframe_4_t(); + + class ionosphere_data_t : public kaitai::kstruct { + + public: + + ionosphere_data_t(kaitai::kstream* p__io, gps_t::subframe_4_t* p__parent = 0, gps_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~ionosphere_data_t(); + + private: + int8_t m_a0; + int8_t m_a1; + int8_t m_a2; + int8_t m_a3; + int8_t m_b0; + int8_t m_b1; + int8_t m_b2; + int8_t m_b3; + gps_t* m__root; + gps_t::subframe_4_t* m__parent; + + public: + int8_t a0() const { return m_a0; } + int8_t a1() const { return m_a1; } + int8_t a2() const { return m_a2; } + int8_t a3() const { return m_a3; } + int8_t b0() const { return m_b0; } + int8_t b1() const { return m_b1; } + int8_t b2() const { return m_b2; } + int8_t b3() const { return m_b3; } + gps_t* _root() const { return m__root; } + gps_t::subframe_4_t* _parent() const { return m__parent; } + }; + + private: + uint64_t m_data_id; + uint64_t m_page_id; + ionosphere_data_t* m_body; + bool n_body; + + public: + bool _is_null_body() { body(); return n_body; }; + + private: + gps_t* m__root; + gps_t* m__parent; + + public: + uint64_t data_id() const { return m_data_id; } + uint64_t page_id() const { return m_page_id; } + ionosphere_data_t* body() const { return m_body; } + gps_t* _root() const { return m__root; } + gps_t* _parent() const { return m__parent; } + }; + + class how_t : public kaitai::kstruct { + + public: + + how_t(kaitai::kstream* p__io, gps_t* p__parent = 0, gps_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~how_t(); + + private: + uint64_t m_tow_count; + bool m_alert; + bool m_anti_spoof; + uint64_t m_subframe_id; + uint64_t m_reserved; + gps_t* m__root; + gps_t* m__parent; + + public: + uint64_t tow_count() const { return m_tow_count; } + bool alert() const { return m_alert; } + bool anti_spoof() const { return m_anti_spoof; } + uint64_t subframe_id() const { return m_subframe_id; } + uint64_t reserved() const { return m_reserved; } + gps_t* _root() const { return m__root; } + gps_t* _parent() const { return m__parent; } + }; + + class tlm_t : public kaitai::kstruct { + + public: + + tlm_t(kaitai::kstream* p__io, gps_t* p__parent = 0, gps_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~tlm_t(); + + private: + std::string m_magic; + uint64_t m_tlm; + bool m_integrity_status; + bool m_reserved; + gps_t* m__root; + gps_t* m__parent; + + public: + std::string magic() const { return m_magic; } + uint64_t tlm() const { return m_tlm; } + bool integrity_status() const { return m_integrity_status; } + bool reserved() const { return m_reserved; } + gps_t* _root() const { return m__root; } + gps_t* _parent() const { return m__parent; } + }; + + class subframe_2_t : public kaitai::kstruct { + + public: + + subframe_2_t(kaitai::kstream* p__io, gps_t* p__parent = 0, gps_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~subframe_2_t(); + + private: + uint8_t m_iode; + int16_t m_c_rs; + int16_t m_delta_n; + int32_t m_m_0; + int16_t m_c_uc; + int32_t m_e; + int16_t m_c_us; + uint32_t m_sqrt_a; + uint16_t m_t_oe; + bool m_fit_interval_flag; + uint64_t m_aoda; + uint64_t m_reserved; + gps_t* m__root; + gps_t* m__parent; + + public: + uint8_t iode() const { return m_iode; } + int16_t c_rs() const { return m_c_rs; } + int16_t delta_n() const { return m_delta_n; } + int32_t m_0() const { return m_m_0; } + int16_t c_uc() const { return m_c_uc; } + int32_t e() const { return m_e; } + int16_t c_us() const { return m_c_us; } + uint32_t sqrt_a() const { return m_sqrt_a; } + uint16_t t_oe() const { return m_t_oe; } + bool fit_interval_flag() const { return m_fit_interval_flag; } + uint64_t aoda() const { return m_aoda; } + uint64_t reserved() const { return m_reserved; } + gps_t* _root() const { return m__root; } + gps_t* _parent() const { return m__parent; } + }; + +private: + tlm_t* m_tlm; + how_t* m_how; + kaitai::kstruct* m_body; + bool n_body; + +public: + bool _is_null_body() { body(); return n_body; }; + +private: + gps_t* m__root; + kaitai::kstruct* m__parent; + +public: + tlm_t* tlm() const { return m_tlm; } + how_t* how() const { return m_how; } + kaitai::kstruct* body() const { return m_body; } + gps_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; + +#endif // GPS_H_ diff --git a/selfdrive/locationd/generated/ubx.cpp b/selfdrive/locationd/generated/ubx.cpp new file mode 100644 index 000000000..5e743e1ee --- /dev/null +++ b/selfdrive/locationd/generated/ubx.cpp @@ -0,0 +1,340 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "ubx.h" +#include "kaitai/exceptions.h" + +ubx_t::ubx_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, ubx_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = this; + f_checksum = false; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void ubx_t::_read() { + m_magic = m__io->read_bytes(2); + if (!(magic() == std::string("\xB5\x62", 2))) { + throw kaitai::validation_not_equal_error(std::string("\xB5\x62", 2), magic(), _io(), std::string("/seq/0")); + } + m_msg_type = m__io->read_u2be(); + m_length = m__io->read_u2le(); + n_body = true; + switch (msg_type()) { + case 2569: { + n_body = false; + m_body = new mon_hw_t(m__io, this, m__root); + break; + } + case 533: { + n_body = false; + m_body = new rxm_rawx_t(m__io, this, m__root); + break; + } + case 531: { + n_body = false; + m_body = new rxm_sfrbx_t(m__io, this, m__root); + break; + } + case 2571: { + n_body = false; + m_body = new mon_hw2_t(m__io, this, m__root); + break; + } + case 263: { + n_body = false; + m_body = new nav_pvt_t(m__io, this, m__root); + break; + } + } +} + +ubx_t::~ubx_t() { + _clean_up(); +} + +void ubx_t::_clean_up() { + if (!n_body) { + if (m_body) { + delete m_body; m_body = 0; + } + } + if (f_checksum) { + } +} + +ubx_t::rxm_rawx_t::rxm_rawx_t(kaitai::kstream* p__io, ubx_t* p__parent, ubx_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + m_measurements = 0; + m__raw_measurements = 0; + m__io__raw_measurements = 0; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void ubx_t::rxm_rawx_t::_read() { + m_rcv_tow = m__io->read_f8le(); + m_week = m__io->read_u2le(); + m_leap_s = m__io->read_s1(); + m_num_meas = m__io->read_u1(); + m_rec_stat = m__io->read_u1(); + m_reserved1 = m__io->read_bytes(3); + int l_measurements = num_meas(); + m__raw_measurements = new std::vector(); + m__raw_measurements->reserve(l_measurements); + m__io__raw_measurements = new std::vector(); + m__io__raw_measurements->reserve(l_measurements); + m_measurements = new std::vector(); + m_measurements->reserve(l_measurements); + for (int i = 0; i < l_measurements; i++) { + m__raw_measurements->push_back(m__io->read_bytes(32)); + kaitai::kstream* io__raw_measurements = new kaitai::kstream(m__raw_measurements->at(m__raw_measurements->size() - 1)); + m__io__raw_measurements->push_back(io__raw_measurements); + m_measurements->push_back(new meas_t(io__raw_measurements, this, m__root)); + } +} + +ubx_t::rxm_rawx_t::~rxm_rawx_t() { + _clean_up(); +} + +void ubx_t::rxm_rawx_t::_clean_up() { + if (m__raw_measurements) { + delete m__raw_measurements; m__raw_measurements = 0; + } + if (m__io__raw_measurements) { + for (std::vector::iterator it = m__io__raw_measurements->begin(); it != m__io__raw_measurements->end(); ++it) { + delete *it; + } + delete m__io__raw_measurements; m__io__raw_measurements = 0; + } + if (m_measurements) { + for (std::vector::iterator it = m_measurements->begin(); it != m_measurements->end(); ++it) { + delete *it; + } + delete m_measurements; m_measurements = 0; + } +} + +ubx_t::rxm_rawx_t::meas_t::meas_t(kaitai::kstream* p__io, ubx_t::rxm_rawx_t* p__parent, ubx_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void ubx_t::rxm_rawx_t::meas_t::_read() { + m_pr_mes = m__io->read_f8le(); + m_cp_mes = m__io->read_f8le(); + m_do_mes = m__io->read_f4le(); + m_gnss_id = static_cast(m__io->read_u1()); + m_sv_id = m__io->read_u1(); + m_reserved2 = m__io->read_bytes(1); + m_freq_id = m__io->read_u1(); + m_lock_time = m__io->read_u2le(); + m_cno = m__io->read_u1(); + m_pr_stdev = m__io->read_u1(); + m_cp_stdev = m__io->read_u1(); + m_do_stdev = m__io->read_u1(); + m_trk_stat = m__io->read_u1(); + m_reserved3 = m__io->read_bytes(1); +} + +ubx_t::rxm_rawx_t::meas_t::~meas_t() { + _clean_up(); +} + +void ubx_t::rxm_rawx_t::meas_t::_clean_up() { +} + +ubx_t::rxm_sfrbx_t::rxm_sfrbx_t(kaitai::kstream* p__io, ubx_t* p__parent, ubx_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + m_body = 0; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void ubx_t::rxm_sfrbx_t::_read() { + m_gnss_id = static_cast(m__io->read_u1()); + m_sv_id = m__io->read_u1(); + m_reserved1 = m__io->read_bytes(1); + m_freq_id = m__io->read_u1(); + m_num_words = m__io->read_u1(); + m_reserved2 = m__io->read_bytes(1); + m_version = m__io->read_u1(); + m_reserved3 = m__io->read_bytes(1); + int l_body = num_words(); + m_body = new std::vector(); + m_body->reserve(l_body); + for (int i = 0; i < l_body; i++) { + m_body->push_back(m__io->read_u4le()); + } +} + +ubx_t::rxm_sfrbx_t::~rxm_sfrbx_t() { + _clean_up(); +} + +void ubx_t::rxm_sfrbx_t::_clean_up() { + if (m_body) { + delete m_body; m_body = 0; + } +} + +ubx_t::nav_pvt_t::nav_pvt_t(kaitai::kstream* p__io, ubx_t* p__parent, ubx_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void ubx_t::nav_pvt_t::_read() { + m_i_tow = m__io->read_u4le(); + m_year = m__io->read_u2le(); + m_month = m__io->read_u1(); + m_day = m__io->read_u1(); + m_hour = m__io->read_u1(); + m_min = m__io->read_u1(); + m_sec = m__io->read_u1(); + m_valid = m__io->read_u1(); + m_t_acc = m__io->read_u4le(); + m_nano = m__io->read_s4le(); + m_fix_type = m__io->read_u1(); + m_flags = m__io->read_u1(); + m_flags2 = m__io->read_u1(); + m_num_sv = m__io->read_u1(); + m_lon = m__io->read_s4le(); + m_lat = m__io->read_s4le(); + m_height = m__io->read_s4le(); + m_h_msl = m__io->read_s4le(); + m_h_acc = m__io->read_u4le(); + m_v_acc = m__io->read_u4le(); + m_vel_n = m__io->read_s4le(); + m_vel_e = m__io->read_s4le(); + m_vel_d = m__io->read_s4le(); + m_g_speed = m__io->read_s4le(); + m_head_mot = m__io->read_s4le(); + m_s_acc = m__io->read_s4le(); + m_head_acc = m__io->read_u4le(); + m_p_dop = m__io->read_u2le(); + m_flags3 = m__io->read_u1(); + m_reserved1 = m__io->read_bytes(5); + m_head_veh = m__io->read_s4le(); + m_mag_dec = m__io->read_s2le(); + m_mag_acc = m__io->read_u2le(); +} + +ubx_t::nav_pvt_t::~nav_pvt_t() { + _clean_up(); +} + +void ubx_t::nav_pvt_t::_clean_up() { +} + +ubx_t::mon_hw2_t::mon_hw2_t(kaitai::kstream* p__io, ubx_t* p__parent, ubx_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void ubx_t::mon_hw2_t::_read() { + m_ofs_i = m__io->read_s1(); + m_mag_i = m__io->read_u1(); + m_ofs_q = m__io->read_s1(); + m_mag_q = m__io->read_u1(); + m_cfg_source = static_cast(m__io->read_u1()); + m_reserved1 = m__io->read_bytes(3); + m_low_lev_cfg = m__io->read_u4le(); + m_reserved2 = m__io->read_bytes(8); + m_post_status = m__io->read_u4le(); + m_reserved3 = m__io->read_bytes(4); +} + +ubx_t::mon_hw2_t::~mon_hw2_t() { + _clean_up(); +} + +void ubx_t::mon_hw2_t::_clean_up() { +} + +ubx_t::mon_hw_t::mon_hw_t(kaitai::kstream* p__io, ubx_t* p__parent, ubx_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void ubx_t::mon_hw_t::_read() { + m_pin_sel = m__io->read_u4le(); + m_pin_bank = m__io->read_u4le(); + m_pin_dir = m__io->read_u4le(); + m_pin_val = m__io->read_u4le(); + m_noise_per_ms = m__io->read_u2le(); + m_agc_cnt = m__io->read_u2le(); + m_a_status = static_cast(m__io->read_u1()); + m_a_power = static_cast(m__io->read_u1()); + m_flags = m__io->read_u1(); + m_reserved1 = m__io->read_bytes(1); + m_used_mask = m__io->read_u4le(); + m_vp = m__io->read_bytes(17); + m_jam_ind = m__io->read_u1(); + m_reserved2 = m__io->read_bytes(2); + m_pin_irq = m__io->read_u4le(); + m_pull_h = m__io->read_u4le(); + m_pull_l = m__io->read_u4le(); +} + +ubx_t::mon_hw_t::~mon_hw_t() { + _clean_up(); +} + +void ubx_t::mon_hw_t::_clean_up() { +} + +uint16_t ubx_t::checksum() { + if (f_checksum) + return m_checksum; + std::streampos _pos = m__io->pos(); + m__io->seek((length() + 6)); + m_checksum = m__io->read_u2le(); + m__io->seek(_pos); + f_checksum = true; + return m_checksum; +} diff --git a/selfdrive/locationd/generated/ubx.h b/selfdrive/locationd/generated/ubx.h new file mode 100644 index 000000000..6be4ce8c4 --- /dev/null +++ b/selfdrive/locationd/generated/ubx.h @@ -0,0 +1,410 @@ +#ifndef UBX_H_ +#define UBX_H_ + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "kaitai/kaitaistruct.h" +#include +#include + +#if KAITAI_STRUCT_VERSION < 9000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.9 or later is required" +#endif + +class ubx_t : public kaitai::kstruct { + +public: + class rxm_rawx_t; + class rxm_sfrbx_t; + class nav_pvt_t; + class mon_hw2_t; + class mon_hw_t; + + enum gnss_type_t { + GNSS_TYPE_GPS = 0, + GNSS_TYPE_SBAS = 1, + GNSS_TYPE_GALILEO = 2, + GNSS_TYPE_BEIDOU = 3, + GNSS_TYPE_IMES = 4, + GNSS_TYPE_QZSS = 5, + GNSS_TYPE_GLONASS = 6 + }; + + ubx_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, ubx_t* p__root = 0); + +private: + void _read(); + void _clean_up(); + +public: + ~ubx_t(); + + class rxm_rawx_t : public kaitai::kstruct { + + public: + class meas_t; + + rxm_rawx_t(kaitai::kstream* p__io, ubx_t* p__parent = 0, ubx_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~rxm_rawx_t(); + + class meas_t : public kaitai::kstruct { + + public: + + meas_t(kaitai::kstream* p__io, ubx_t::rxm_rawx_t* p__parent = 0, ubx_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~meas_t(); + + private: + double m_pr_mes; + double m_cp_mes; + float m_do_mes; + gnss_type_t m_gnss_id; + uint8_t m_sv_id; + std::string m_reserved2; + uint8_t m_freq_id; + uint16_t m_lock_time; + uint8_t m_cno; + uint8_t m_pr_stdev; + uint8_t m_cp_stdev; + uint8_t m_do_stdev; + uint8_t m_trk_stat; + std::string m_reserved3; + ubx_t* m__root; + ubx_t::rxm_rawx_t* m__parent; + + public: + double pr_mes() const { return m_pr_mes; } + double cp_mes() const { return m_cp_mes; } + float do_mes() const { return m_do_mes; } + gnss_type_t gnss_id() const { return m_gnss_id; } + uint8_t sv_id() const { return m_sv_id; } + std::string reserved2() const { return m_reserved2; } + uint8_t freq_id() const { return m_freq_id; } + uint16_t lock_time() const { return m_lock_time; } + uint8_t cno() const { return m_cno; } + uint8_t pr_stdev() const { return m_pr_stdev; } + uint8_t cp_stdev() const { return m_cp_stdev; } + uint8_t do_stdev() const { return m_do_stdev; } + uint8_t trk_stat() const { return m_trk_stat; } + std::string reserved3() const { return m_reserved3; } + ubx_t* _root() const { return m__root; } + ubx_t::rxm_rawx_t* _parent() const { return m__parent; } + }; + + private: + double m_rcv_tow; + uint16_t m_week; + int8_t m_leap_s; + uint8_t m_num_meas; + uint8_t m_rec_stat; + std::string m_reserved1; + std::vector* m_measurements; + ubx_t* m__root; + ubx_t* m__parent; + std::vector* m__raw_measurements; + std::vector* m__io__raw_measurements; + + public: + double rcv_tow() const { return m_rcv_tow; } + uint16_t week() const { return m_week; } + int8_t leap_s() const { return m_leap_s; } + uint8_t num_meas() const { return m_num_meas; } + uint8_t rec_stat() const { return m_rec_stat; } + std::string reserved1() const { return m_reserved1; } + std::vector* measurements() const { return m_measurements; } + ubx_t* _root() const { return m__root; } + ubx_t* _parent() const { return m__parent; } + std::vector* _raw_measurements() const { return m__raw_measurements; } + std::vector* _io__raw_measurements() const { return m__io__raw_measurements; } + }; + + class rxm_sfrbx_t : public kaitai::kstruct { + + public: + + rxm_sfrbx_t(kaitai::kstream* p__io, ubx_t* p__parent = 0, ubx_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~rxm_sfrbx_t(); + + private: + gnss_type_t m_gnss_id; + uint8_t m_sv_id; + std::string m_reserved1; + uint8_t m_freq_id; + uint8_t m_num_words; + std::string m_reserved2; + uint8_t m_version; + std::string m_reserved3; + std::vector* m_body; + ubx_t* m__root; + ubx_t* m__parent; + + public: + gnss_type_t gnss_id() const { return m_gnss_id; } + uint8_t sv_id() const { return m_sv_id; } + std::string reserved1() const { return m_reserved1; } + uint8_t freq_id() const { return m_freq_id; } + uint8_t num_words() const { return m_num_words; } + std::string reserved2() const { return m_reserved2; } + uint8_t version() const { return m_version; } + std::string reserved3() const { return m_reserved3; } + std::vector* body() const { return m_body; } + ubx_t* _root() const { return m__root; } + ubx_t* _parent() const { return m__parent; } + }; + + class nav_pvt_t : public kaitai::kstruct { + + public: + + nav_pvt_t(kaitai::kstream* p__io, ubx_t* p__parent = 0, ubx_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~nav_pvt_t(); + + private: + uint32_t m_i_tow; + uint16_t m_year; + uint8_t m_month; + uint8_t m_day; + uint8_t m_hour; + uint8_t m_min; + uint8_t m_sec; + uint8_t m_valid; + uint32_t m_t_acc; + int32_t m_nano; + uint8_t m_fix_type; + uint8_t m_flags; + uint8_t m_flags2; + uint8_t m_num_sv; + int32_t m_lon; + int32_t m_lat; + int32_t m_height; + int32_t m_h_msl; + uint32_t m_h_acc; + uint32_t m_v_acc; + int32_t m_vel_n; + int32_t m_vel_e; + int32_t m_vel_d; + int32_t m_g_speed; + int32_t m_head_mot; + int32_t m_s_acc; + uint32_t m_head_acc; + uint16_t m_p_dop; + uint8_t m_flags3; + std::string m_reserved1; + int32_t m_head_veh; + int16_t m_mag_dec; + uint16_t m_mag_acc; + ubx_t* m__root; + ubx_t* m__parent; + + public: + uint32_t i_tow() const { return m_i_tow; } + uint16_t year() const { return m_year; } + uint8_t month() const { return m_month; } + uint8_t day() const { return m_day; } + uint8_t hour() const { return m_hour; } + uint8_t min() const { return m_min; } + uint8_t sec() const { return m_sec; } + uint8_t valid() const { return m_valid; } + uint32_t t_acc() const { return m_t_acc; } + int32_t nano() const { return m_nano; } + uint8_t fix_type() const { return m_fix_type; } + uint8_t flags() const { return m_flags; } + uint8_t flags2() const { return m_flags2; } + uint8_t num_sv() const { return m_num_sv; } + int32_t lon() const { return m_lon; } + int32_t lat() const { return m_lat; } + int32_t height() const { return m_height; } + int32_t h_msl() const { return m_h_msl; } + uint32_t h_acc() const { return m_h_acc; } + uint32_t v_acc() const { return m_v_acc; } + int32_t vel_n() const { return m_vel_n; } + int32_t vel_e() const { return m_vel_e; } + int32_t vel_d() const { return m_vel_d; } + int32_t g_speed() const { return m_g_speed; } + int32_t head_mot() const { return m_head_mot; } + int32_t s_acc() const { return m_s_acc; } + uint32_t head_acc() const { return m_head_acc; } + uint16_t p_dop() const { return m_p_dop; } + uint8_t flags3() const { return m_flags3; } + std::string reserved1() const { return m_reserved1; } + int32_t head_veh() const { return m_head_veh; } + int16_t mag_dec() const { return m_mag_dec; } + uint16_t mag_acc() const { return m_mag_acc; } + ubx_t* _root() const { return m__root; } + ubx_t* _parent() const { return m__parent; } + }; + + class mon_hw2_t : public kaitai::kstruct { + + public: + + enum config_source_t { + CONFIG_SOURCE_FLASH = 102, + CONFIG_SOURCE_OTP = 111, + CONFIG_SOURCE_CONFIG_PINS = 112, + CONFIG_SOURCE_ROM = 113 + }; + + mon_hw2_t(kaitai::kstream* p__io, ubx_t* p__parent = 0, ubx_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~mon_hw2_t(); + + private: + int8_t m_ofs_i; + uint8_t m_mag_i; + int8_t m_ofs_q; + uint8_t m_mag_q; + config_source_t m_cfg_source; + std::string m_reserved1; + uint32_t m_low_lev_cfg; + std::string m_reserved2; + uint32_t m_post_status; + std::string m_reserved3; + ubx_t* m__root; + ubx_t* m__parent; + + public: + int8_t ofs_i() const { return m_ofs_i; } + uint8_t mag_i() const { return m_mag_i; } + int8_t ofs_q() const { return m_ofs_q; } + uint8_t mag_q() const { return m_mag_q; } + config_source_t cfg_source() const { return m_cfg_source; } + std::string reserved1() const { return m_reserved1; } + uint32_t low_lev_cfg() const { return m_low_lev_cfg; } + std::string reserved2() const { return m_reserved2; } + uint32_t post_status() const { return m_post_status; } + std::string reserved3() const { return m_reserved3; } + ubx_t* _root() const { return m__root; } + ubx_t* _parent() const { return m__parent; } + }; + + class mon_hw_t : public kaitai::kstruct { + + public: + + enum antenna_status_t { + ANTENNA_STATUS_INIT = 0, + ANTENNA_STATUS_DONTKNOW = 1, + ANTENNA_STATUS_OK = 2, + ANTENNA_STATUS_SHORT = 3, + ANTENNA_STATUS_OPEN = 4 + }; + + enum antenna_power_t { + ANTENNA_POWER_FALSE = 0, + ANTENNA_POWER_TRUE = 1, + ANTENNA_POWER_DONTKNOW = 2 + }; + + mon_hw_t(kaitai::kstream* p__io, ubx_t* p__parent = 0, ubx_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~mon_hw_t(); + + private: + uint32_t m_pin_sel; + uint32_t m_pin_bank; + uint32_t m_pin_dir; + uint32_t m_pin_val; + uint16_t m_noise_per_ms; + uint16_t m_agc_cnt; + antenna_status_t m_a_status; + antenna_power_t m_a_power; + uint8_t m_flags; + std::string m_reserved1; + uint32_t m_used_mask; + std::string m_vp; + uint8_t m_jam_ind; + std::string m_reserved2; + uint32_t m_pin_irq; + uint32_t m_pull_h; + uint32_t m_pull_l; + ubx_t* m__root; + ubx_t* m__parent; + + public: + uint32_t pin_sel() const { return m_pin_sel; } + uint32_t pin_bank() const { return m_pin_bank; } + uint32_t pin_dir() const { return m_pin_dir; } + uint32_t pin_val() const { return m_pin_val; } + uint16_t noise_per_ms() const { return m_noise_per_ms; } + uint16_t agc_cnt() const { return m_agc_cnt; } + antenna_status_t a_status() const { return m_a_status; } + antenna_power_t a_power() const { return m_a_power; } + uint8_t flags() const { return m_flags; } + std::string reserved1() const { return m_reserved1; } + uint32_t used_mask() const { return m_used_mask; } + std::string vp() const { return m_vp; } + uint8_t jam_ind() const { return m_jam_ind; } + std::string reserved2() const { return m_reserved2; } + uint32_t pin_irq() const { return m_pin_irq; } + uint32_t pull_h() const { return m_pull_h; } + uint32_t pull_l() const { return m_pull_l; } + ubx_t* _root() const { return m__root; } + ubx_t* _parent() const { return m__parent; } + }; + +private: + bool f_checksum; + uint16_t m_checksum; + +public: + uint16_t checksum(); + +private: + std::string m_magic; + uint16_t m_msg_type; + uint16_t m_length; + kaitai::kstruct* m_body; + bool n_body; + +public: + bool _is_null_body() { body(); return n_body; }; + +private: + ubx_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::string magic() const { return m_magic; } + uint16_t msg_type() const { return m_msg_type; } + uint16_t length() const { return m_length; } + kaitai::kstruct* body() const { return m_body; } + ubx_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; + +#endif // UBX_H_ diff --git a/selfdrive/locationd/locationd b/selfdrive/locationd/locationd new file mode 100755 index 000000000..ea2c58fdd Binary files /dev/null and b/selfdrive/locationd/locationd differ diff --git a/selfdrive/locationd/locationd.cc b/selfdrive/locationd/locationd.cc new file mode 100755 index 000000000..b723878e9 --- /dev/null +++ b/selfdrive/locationd/locationd.cc @@ -0,0 +1,538 @@ +#include +#include + +#include + +#include "locationd.h" + +using namespace EKFS; +using namespace Eigen; + +ExitHandler do_exit; +const double ACCEL_SANITY_CHECK = 100.0; // m/s^2 +const double ROTATION_SANITY_CHECK = 10.0; // rad/s +const double TRANS_SANITY_CHECK = 200.0; // m/s +const double CALIB_RPY_SANITY_CHECK = 0.5; // rad (+- 30 deg) +const double ALTITUDE_SANITY_CHECK = 10000; // m +const double MIN_STD_SANITY_CHECK = 1e-5; // m or rad +const double VALID_TIME_SINCE_RESET = 1.0; // s +const double VALID_POS_STD = 50.0; // m +const double MAX_RESET_TRACKER = 5.0; +const double SANE_GPS_UNCERTAINTY = 1500.0; // m + +static VectorXd floatlist2vector(const capnp::List::Reader& floatlist) { + VectorXd res(floatlist.size()); + for (int i = 0; i < floatlist.size(); i++) { + res[i] = floatlist[i]; + } + return res; +} + +static Vector4d quat2vector(const Quaterniond& quat) { + return Vector4d(quat.w(), quat.x(), quat.y(), quat.z()); +} + +static Quaterniond vector2quat(const VectorXd& vec) { + return Quaterniond(vec(0), vec(1), vec(2), vec(3)); +} + +static void init_measurement(cereal::LiveLocationKalman::Measurement::Builder meas, const VectorXd& val, const VectorXd& std, bool valid) { + meas.setValue(kj::arrayPtr(val.data(), val.size())); + meas.setStd(kj::arrayPtr(std.data(), std.size())); + meas.setValid(valid); +} + + +static MatrixXdr rotate_cov(const MatrixXdr& rot_matrix, const MatrixXdr& cov_in) { + // To rotate a covariance matrix, the cov matrix needs to multiplied left and right by the transform matrix + return ((rot_matrix * cov_in) * rot_matrix.transpose()); +} + +static VectorXd rotate_std(const MatrixXdr& rot_matrix, const VectorXd& std_in) { + // Stds cannot be rotated like values, only covariances can be rotated + return rotate_cov(rot_matrix, std_in.array().square().matrix().asDiagonal()).diagonal().array().sqrt(); +} + +Localizer::Localizer() { + this->kf = std::make_unique(); + this->reset_kalman(); + + this->calib = Vector3d(0.0, 0.0, 0.0); + this->device_from_calib = MatrixXdr::Identity(3, 3); + this->calib_from_device = MatrixXdr::Identity(3, 3); + + for (int i = 0; i < POSENET_STD_HIST_HALF * 2; i++) { + this->posenet_stds.push_back(10.0); + } + + VectorXd ecef_pos = this->kf->get_x().segment(STATE_ECEF_POS_START); + this->converter = std::make_unique((ECEF) { .x = ecef_pos[0], .y = ecef_pos[1], .z = ecef_pos[2] }); +} + +void Localizer::build_live_location(cereal::LiveLocationKalman::Builder& fix) { + VectorXd predicted_state = this->kf->get_x(); + MatrixXdr predicted_cov = this->kf->get_P(); + VectorXd predicted_std = predicted_cov.diagonal().array().sqrt(); + + VectorXd fix_ecef = predicted_state.segment(STATE_ECEF_POS_START); + ECEF fix_ecef_ecef = { .x = fix_ecef(0), .y = fix_ecef(1), .z = fix_ecef(2) }; + VectorXd fix_ecef_std = predicted_std.segment(STATE_ECEF_POS_ERR_START); + VectorXd vel_ecef = predicted_state.segment(STATE_ECEF_VELOCITY_START); + VectorXd vel_ecef_std = predicted_std.segment(STATE_ECEF_VELOCITY_ERR_START); + VectorXd fix_pos_geo_vec = this->get_position_geodetic(); + VectorXd orientation_ecef = quat2euler(vector2quat(predicted_state.segment(STATE_ECEF_ORIENTATION_START))); + VectorXd orientation_ecef_std = predicted_std.segment(STATE_ECEF_ORIENTATION_ERR_START); + MatrixXdr orientation_ecef_cov = predicted_cov.block(STATE_ECEF_ORIENTATION_ERR_START, STATE_ECEF_ORIENTATION_ERR_START); + MatrixXdr device_from_ecef = euler2rot(orientation_ecef).transpose(); + VectorXd calibrated_orientation_ecef = rot2euler((this->calib_from_device * device_from_ecef).transpose()); + + VectorXd acc_calib = this->calib_from_device * predicted_state.segment(STATE_ACCELERATION_START); + MatrixXdr acc_calib_cov = predicted_cov.block(STATE_ACCELERATION_ERR_START, STATE_ACCELERATION_ERR_START); + VectorXd acc_calib_std = rotate_cov(this->calib_from_device, acc_calib_cov).diagonal().array().sqrt(); + VectorXd ang_vel_calib = this->calib_from_device * predicted_state.segment(STATE_ANGULAR_VELOCITY_START); + + MatrixXdr vel_angular_cov = predicted_cov.block(STATE_ANGULAR_VELOCITY_ERR_START, STATE_ANGULAR_VELOCITY_ERR_START); + VectorXd ang_vel_calib_std = rotate_cov(this->calib_from_device, vel_angular_cov).diagonal().array().sqrt(); + + VectorXd vel_device = device_from_ecef * vel_ecef; + VectorXd device_from_ecef_eul = quat2euler(vector2quat(predicted_state.segment(STATE_ECEF_ORIENTATION_START))).transpose(); + MatrixXdr condensed_cov(STATE_ECEF_ORIENTATION_ERR_LEN + STATE_ECEF_VELOCITY_ERR_LEN, STATE_ECEF_ORIENTATION_ERR_LEN + STATE_ECEF_VELOCITY_ERR_LEN); + condensed_cov.topLeftCorner() = + predicted_cov.block(STATE_ECEF_ORIENTATION_ERR_START, STATE_ECEF_ORIENTATION_ERR_START); + condensed_cov.topRightCorner() = + predicted_cov.block(STATE_ECEF_ORIENTATION_ERR_START, STATE_ECEF_VELOCITY_ERR_START); + condensed_cov.bottomRightCorner() = + predicted_cov.block(STATE_ECEF_VELOCITY_ERR_START, STATE_ECEF_VELOCITY_ERR_START); + condensed_cov.bottomLeftCorner() = + predicted_cov.block(STATE_ECEF_VELOCITY_ERR_START, STATE_ECEF_ORIENTATION_ERR_START); + VectorXd H_input(device_from_ecef_eul.size() + vel_ecef.size()); + H_input << device_from_ecef_eul, vel_ecef; + MatrixXdr HH = this->kf->H(H_input); + MatrixXdr vel_device_cov = (HH * condensed_cov) * HH.transpose(); + VectorXd vel_device_std = vel_device_cov.diagonal().array().sqrt(); + + VectorXd vel_calib = this->calib_from_device * vel_device; + VectorXd vel_calib_std = rotate_cov(this->calib_from_device, vel_device_cov).diagonal().array().sqrt(); + + VectorXd orientation_ned = ned_euler_from_ecef(fix_ecef_ecef, orientation_ecef); + VectorXd orientation_ned_std = rotate_cov(this->converter->ecef2ned_matrix, orientation_ecef_cov).diagonal().array().sqrt(); + VectorXd calibrated_orientation_ned = ned_euler_from_ecef(fix_ecef_ecef, calibrated_orientation_ecef); + VectorXd nextfix_ecef = fix_ecef + vel_ecef; + VectorXd ned_vel = this->converter->ecef2ned((ECEF) { .x = nextfix_ecef(0), .y = nextfix_ecef(1), .z = nextfix_ecef(2) }).to_vector() - converter->ecef2ned(fix_ecef_ecef).to_vector(); + + VectorXd accDevice = predicted_state.segment(STATE_ACCELERATION_START); + VectorXd accDeviceErr = predicted_std.segment(STATE_ACCELERATION_ERR_START); + + VectorXd angVelocityDevice = predicted_state.segment(STATE_ANGULAR_VELOCITY_START); + VectorXd angVelocityDeviceErr = predicted_std.segment(STATE_ANGULAR_VELOCITY_ERR_START); + + Vector3d nans = Vector3d(NAN, NAN, NAN); + + // TODO fill in NED and Calibrated stds + // write measurements to msg + init_measurement(fix.initPositionGeodetic(), fix_pos_geo_vec, nans, this->gps_mode); + init_measurement(fix.initPositionECEF(), fix_ecef, fix_ecef_std, this->gps_mode); + init_measurement(fix.initVelocityECEF(), vel_ecef, vel_ecef_std, this->gps_mode); + init_measurement(fix.initVelocityNED(), ned_vel, nans, this->gps_mode); + init_measurement(fix.initVelocityDevice(), vel_device, vel_device_std, true); + init_measurement(fix.initAccelerationDevice(), accDevice, accDeviceErr, true); + init_measurement(fix.initOrientationECEF(), orientation_ecef, orientation_ecef_std, this->gps_mode); + init_measurement(fix.initCalibratedOrientationECEF(), calibrated_orientation_ecef, nans, this->calibrated && this->gps_mode); + init_measurement(fix.initOrientationNED(), orientation_ned, orientation_ned_std, this->gps_mode); + init_measurement(fix.initCalibratedOrientationNED(), calibrated_orientation_ned, nans, this->calibrated && this->gps_mode); + init_measurement(fix.initAngularVelocityDevice(), angVelocityDevice, angVelocityDeviceErr, true); + init_measurement(fix.initVelocityCalibrated(), vel_calib, vel_calib_std, this->calibrated); + init_measurement(fix.initAngularVelocityCalibrated(), ang_vel_calib, ang_vel_calib_std, this->calibrated); + init_measurement(fix.initAccelerationCalibrated(), acc_calib, acc_calib_std, this->calibrated); + + double old_mean = 0.0, new_mean = 0.0; + int i = 0; + for (double x : this->posenet_stds) { + if (i < POSENET_STD_HIST_HALF) { + old_mean += x; + } else { + new_mean += x; + } + i++; + } + old_mean /= POSENET_STD_HIST_HALF; + new_mean /= POSENET_STD_HIST_HALF; + // experimentally found these values, no false positives in 20k minutes of driving + bool std_spike = (new_mean / old_mean > 4.0 && new_mean > 7.0); + + fix.setPosenetOK(!(std_spike && this->car_speed > 5.0)); + fix.setDeviceStable(!this->device_fell); + fix.setExcessiveResets(this->reset_tracker > MAX_RESET_TRACKER); + this->device_fell = false; + + //fix.setGpsWeek(this->time.week); + //fix.setGpsTimeOfWeek(this->time.tow); + fix.setUnixTimestampMillis(this->unix_timestamp_millis); + + double time_since_reset = this->kf->get_filter_time() - this->last_reset_time; + fix.setTimeSinceReset(time_since_reset); + if (fix_ecef_std.norm() < VALID_POS_STD && this->calibrated && time_since_reset > VALID_TIME_SINCE_RESET) { + fix.setStatus(cereal::LiveLocationKalman::Status::VALID); + } else if (fix_ecef_std.norm() < VALID_POS_STD && time_since_reset > VALID_TIME_SINCE_RESET) { + fix.setStatus(cereal::LiveLocationKalman::Status::UNCALIBRATED); + } else { + fix.setStatus(cereal::LiveLocationKalman::Status::UNINITIALIZED); + } +} + +VectorXd Localizer::get_position_geodetic() { + VectorXd fix_ecef = this->kf->get_x().segment(STATE_ECEF_POS_START); + ECEF fix_ecef_ecef = { .x = fix_ecef(0), .y = fix_ecef(1), .z = fix_ecef(2) }; + Geodetic fix_pos_geo = ecef2geodetic(fix_ecef_ecef); + return Vector3d(fix_pos_geo.lat, fix_pos_geo.lon, fix_pos_geo.alt); +} + +VectorXd Localizer::get_state() { + return this->kf->get_x(); +} + +VectorXd Localizer::get_stdev() { + return this->kf->get_P().diagonal().array().sqrt(); +} + +void Localizer::handle_sensors(double current_time, const capnp::List::Reader& log) { + // TODO does not yet account for double sensor readings in the log + for (int i = 0; i < log.size(); i++) { + const cereal::SensorEventData::Reader& sensor_reading = log[i]; + + // Ignore empty readings (e.g. in case the magnetometer had no data ready) + if (sensor_reading.getTimestamp() == 0) { + continue; + } + + double sensor_time = 1e-9 * sensor_reading.getTimestamp(); + + // sensor time and log time should be close + if (std::abs(current_time - sensor_time) > 0.1) { + LOGE("Sensor reading ignored, sensor timestamp more than 100ms off from log time"); + return; + } + + // TODO: handle messages from two IMUs at the same time + if (sensor_reading.getSource() == cereal::SensorEventData::SensorSource::BMX055) { + continue; + } + + // Gyro Uncalibrated + if (sensor_reading.getSensor() == SENSOR_GYRO_UNCALIBRATED && sensor_reading.getType() == SENSOR_TYPE_GYROSCOPE_UNCALIBRATED) { + auto v = sensor_reading.getGyroUncalibrated().getV(); + auto meas = Vector3d(-v[2], -v[1], -v[0]); + if (meas.norm() < ROTATION_SANITY_CHECK) { + this->kf->predict_and_observe(sensor_time, OBSERVATION_PHONE_GYRO, { meas }); + } + } + + // Accelerometer + if (sensor_reading.getSensor() == SENSOR_ACCELEROMETER && sensor_reading.getType() == SENSOR_TYPE_ACCELEROMETER) { + auto v = sensor_reading.getAcceleration().getV(); + + // TODO: reduce false positives and re-enable this check + // check if device fell, estimate 10 for g + // 40m/s**2 is a good filter for falling detection, no false positives in 20k minutes of driving + //this->device_fell |= (floatlist2vector(v) - Vector3d(10.0, 0.0, 0.0)).norm() > 40.0; + + auto meas = Vector3d(-v[2], -v[1], -v[0]); + if (meas.norm() < ACCEL_SANITY_CHECK) { + this->kf->predict_and_observe(sensor_time, OBSERVATION_PHONE_ACCEL, { meas }); + } + } + } +} + +void Localizer::input_fake_gps_observations(double current_time) { + // This is done to make sure that the error estimate of the position does not blow up + // when the filter is in no-gps mode + // Steps : first predict -> observe current obs with reasonable STD + this->kf->predict(current_time); + + VectorXd current_x = this->kf->get_x(); + VectorXd ecef_pos = current_x.segment(STATE_ECEF_POS_START); + VectorXd ecef_vel = current_x.segment(STATE_ECEF_VELOCITY_START); + MatrixXdr ecef_pos_R = this->kf->get_fake_gps_pos_cov(); + MatrixXdr ecef_vel_R = this->kf->get_fake_gps_vel_cov(); + + this->kf->predict_and_observe(current_time, OBSERVATION_ECEF_POS, { ecef_pos }, { ecef_pos_R }); + this->kf->predict_and_observe(current_time, OBSERVATION_ECEF_VEL, { ecef_vel }, { ecef_vel_R }); +} + +void Localizer::handle_gps(double current_time, const cereal::GpsLocationData::Reader& log) { + // ignore the message if the fix is invalid + + bool gps_invalid_flag = (log.getFlags() % 2 == 0); + bool gps_unreasonable = (Vector2d(log.getAccuracy(), log.getVerticalAccuracy()).norm() >= SANE_GPS_UNCERTAINTY); + bool gps_accuracy_insane = ((log.getVerticalAccuracy() <= 0) || (log.getSpeedAccuracy() <= 0) || (log.getBearingAccuracyDeg() <= 0)); + bool gps_lat_lng_alt_insane = ((std::abs(log.getLatitude()) > 90) || (std::abs(log.getLongitude()) > 180) || (std::abs(log.getAltitude()) > ALTITUDE_SANITY_CHECK)); + bool gps_vel_insane = (floatlist2vector(log.getVNED()).norm() > TRANS_SANITY_CHECK); + + if (gps_invalid_flag || gps_unreasonable || gps_accuracy_insane || gps_lat_lng_alt_insane || gps_vel_insane){ + this->determine_gps_mode(current_time); + return; + } + + // Process message + this->last_gps_fix = current_time; + this->gps_mode = true; + Geodetic geodetic = { log.getLatitude(), log.getLongitude(), log.getAltitude() }; + this->converter = std::make_unique(geodetic); + + VectorXd ecef_pos = this->converter->ned2ecef({ 0.0, 0.0, 0.0 }).to_vector(); + VectorXd ecef_vel = this->converter->ned2ecef({ log.getVNED()[0], log.getVNED()[1], log.getVNED()[2] }).to_vector() - ecef_pos; + MatrixXdr ecef_pos_R = Vector3d::Constant(std::pow(10.0 * log.getAccuracy(),2) + std::pow(10.0 * log.getVerticalAccuracy(),2)).asDiagonal(); + MatrixXdr ecef_vel_R = Vector3d::Constant(std::pow(log.getSpeedAccuracy() * 10.0, 2)).asDiagonal(); + + this->unix_timestamp_millis = log.getTimestamp(); + double gps_est_error = (this->kf->get_x().segment(STATE_ECEF_POS_START) - ecef_pos).norm(); + + VectorXd orientation_ecef = quat2euler(vector2quat(this->kf->get_x().segment(STATE_ECEF_ORIENTATION_START))); + VectorXd orientation_ned = ned_euler_from_ecef({ ecef_pos(0), ecef_pos(1), ecef_pos(2) }, orientation_ecef); + VectorXd orientation_ned_gps = Vector3d(0.0, 0.0, DEG2RAD(log.getBearingDeg())); + VectorXd orientation_error = (orientation_ned - orientation_ned_gps).array() - M_PI; + for (int i = 0; i < orientation_error.size(); i++) { + orientation_error(i) = std::fmod(orientation_error(i), 2.0 * M_PI); + if (orientation_error(i) < 0.0) { + orientation_error(i) += 2.0 * M_PI; + } + orientation_error(i) -= M_PI; + } + VectorXd initial_pose_ecef_quat = quat2vector(euler2quat(ecef_euler_from_ned({ ecef_pos(0), ecef_pos(1), ecef_pos(2) }, orientation_ned_gps))); + + if (ecef_vel.norm() > 5.0 && orientation_error.norm() > 1.0) { + LOGE("Locationd vs ubloxLocation orientation difference too large, kalman reset"); + this->reset_kalman(NAN, initial_pose_ecef_quat, ecef_pos, ecef_vel, ecef_pos_R, ecef_vel_R); + this->kf->predict_and_observe(current_time, OBSERVATION_ECEF_ORIENTATION_FROM_GPS, { initial_pose_ecef_quat }); + } else if (gps_est_error > 100.0) { + LOGE("Locationd vs ubloxLocation position difference too large, kalman reset"); + this->reset_kalman(NAN, initial_pose_ecef_quat, ecef_pos, ecef_vel, ecef_pos_R, ecef_vel_R); + } + + this->kf->predict_and_observe(current_time, OBSERVATION_ECEF_POS, { ecef_pos }, { ecef_pos_R }); + this->kf->predict_and_observe(current_time, OBSERVATION_ECEF_VEL, { ecef_vel }, { ecef_vel_R }); +} + +void Localizer::handle_car_state(double current_time, const cereal::CarState::Reader& log) { + this->car_speed = std::abs(log.getVEgo()); + if (log.getStandstill()) { + this->kf->predict_and_observe(current_time, OBSERVATION_NO_ROT, { Vector3d(0.0, 0.0, 0.0) }); + this->kf->predict_and_observe(current_time, OBSERVATION_NO_ACCEL, { Vector3d(0.0, 0.0, 0.0) }); + } +} + +void Localizer::handle_cam_odo(double current_time, const cereal::CameraOdometry::Reader& log) { + VectorXd rot_device = this->device_from_calib * floatlist2vector(log.getRot()); + VectorXd trans_device = this->device_from_calib * floatlist2vector(log.getTrans()); + + if ((rot_device.norm() > ROTATION_SANITY_CHECK) || (trans_device.norm() > TRANS_SANITY_CHECK)) { + return; + } + + VectorXd rot_calib_std = floatlist2vector(log.getRotStd()); + VectorXd trans_calib_std = floatlist2vector(log.getTransStd()); + + if ((rot_calib_std.minCoeff() <= MIN_STD_SANITY_CHECK) || (trans_calib_std.minCoeff() <= MIN_STD_SANITY_CHECK)) { + return; + } + + if ((rot_calib_std.norm() > 10 * ROTATION_SANITY_CHECK) || (trans_calib_std.norm() > 10 * TRANS_SANITY_CHECK)) { + return; + } + + this->posenet_stds.pop_front(); + this->posenet_stds.push_back(trans_calib_std[0]); + + // Multiply by 10 to avoid to high certainty in kalman filter because of temporally correlated noise + trans_calib_std *= 10.0; + rot_calib_std *= 10.0; + MatrixXdr rot_device_cov = rotate_std(this->device_from_calib, rot_calib_std).array().square().matrix().asDiagonal(); + MatrixXdr trans_device_cov = rotate_std(this->device_from_calib, trans_calib_std).array().square().matrix().asDiagonal(); + this->kf->predict_and_observe(current_time, OBSERVATION_CAMERA_ODO_ROTATION, + { rot_device }, { rot_device_cov }); + this->kf->predict_and_observe(current_time, OBSERVATION_CAMERA_ODO_TRANSLATION, + { trans_device }, { trans_device_cov }); +} + +void Localizer::handle_live_calib(double current_time, const cereal::LiveCalibrationData::Reader& log) { + if (log.getRpyCalib().size() > 0) { + auto live_calib = floatlist2vector(log.getRpyCalib()); + if ((live_calib.minCoeff() < -CALIB_RPY_SANITY_CHECK) || (live_calib.maxCoeff() > CALIB_RPY_SANITY_CHECK)) { + return; + } + + this->calib = live_calib; + this->device_from_calib = euler2rot(this->calib); + this->calib_from_device = this->device_from_calib.transpose(); + this->calibrated = log.getCalStatus() == 1; + } +} + +void Localizer::reset_kalman(double current_time) { + VectorXd init_x = this->kf->get_initial_x(); + MatrixXdr init_P = this->kf->get_initial_P(); + this->reset_kalman(current_time, init_x, init_P); +} + +void Localizer::finite_check(double current_time) { + bool all_finite = this->kf->get_x().array().isFinite().all() or this->kf->get_P().array().isFinite().all(); + if (!all_finite) { + LOGE("Non-finite values detected, kalman reset"); + this->reset_kalman(current_time); + } +} + +void Localizer::time_check(double current_time) { + if (std::isnan(this->last_reset_time)) { + this->last_reset_time = current_time; + } + double filter_time = this->kf->get_filter_time(); + bool big_time_gap = !std::isnan(filter_time) && (current_time - filter_time > 10); + if (big_time_gap) { + LOGE("Time gap of over 10s detected, kalman reset"); + this->reset_kalman(current_time); + } +} + +void Localizer::update_reset_tracker() { + // reset tracker is tuned to trigger when over 1reset/10s over 2min period + if (this->isGpsOK()) { + this->reset_tracker *= .99995; + } else { + this->reset_tracker = 0.0; + } +} + +void Localizer::reset_kalman(double current_time, VectorXd init_orient, VectorXd init_pos, VectorXd init_vel, MatrixXdr init_pos_R, MatrixXdr init_vel_R) { + // too nonlinear to init on completely wrong + VectorXd current_x = this->kf->get_x(); + MatrixXdr current_P = this->kf->get_P(); + MatrixXdr init_P = this->kf->get_initial_P(); + MatrixXdr reset_orientation_P = this->kf->get_reset_orientation_P(); + int non_ecef_state_err_len = init_P.rows() - (STATE_ECEF_POS_ERR_LEN + STATE_ECEF_ORIENTATION_ERR_LEN + STATE_ECEF_VELOCITY_ERR_LEN); + + current_x.segment(STATE_ECEF_ORIENTATION_START) = init_orient; + current_x.segment(STATE_ECEF_VELOCITY_START) = init_vel; + current_x.segment(STATE_ECEF_POS_START) = init_pos; + + init_P.block(STATE_ECEF_POS_ERR_START, STATE_ECEF_POS_ERR_START).diagonal() = init_pos_R.diagonal(); + init_P.block(STATE_ECEF_ORIENTATION_ERR_START, STATE_ECEF_ORIENTATION_ERR_START).diagonal() = reset_orientation_P.diagonal(); + init_P.block(STATE_ECEF_VELOCITY_ERR_START, STATE_ECEF_VELOCITY_ERR_START).diagonal() = init_vel_R.diagonal(); + init_P.block(STATE_ANGULAR_VELOCITY_ERR_START, STATE_ANGULAR_VELOCITY_ERR_START, non_ecef_state_err_len, non_ecef_state_err_len).diagonal() = current_P.block(STATE_ANGULAR_VELOCITY_ERR_START, STATE_ANGULAR_VELOCITY_ERR_START, non_ecef_state_err_len, non_ecef_state_err_len).diagonal(); + + this->reset_kalman(current_time, current_x, init_P); +} + +void Localizer::reset_kalman(double current_time, VectorXd init_x, MatrixXdr init_P) { + this->kf->init_state(init_x, init_P, current_time); + this->last_reset_time = current_time; + this->reset_tracker += 1.0; +} + +void Localizer::handle_msg_bytes(const char *data, const size_t size) { + AlignedBuffer aligned_buf; + + capnp::FlatArrayMessageReader cmsg(aligned_buf.align(data, size)); + cereal::Event::Reader event = cmsg.getRoot(); + + this->handle_msg(event); +} + +void Localizer::handle_msg(const cereal::Event::Reader& log) { + double t = log.getLogMonoTime() * 1e-9; + this->time_check(t); + if (log.isSensorEvents()) { + this->handle_sensors(t, log.getSensorEvents()); + } else if (log.isGpsLocationExternal()) { + this->handle_gps(t, log.getGpsLocationExternal()); + } else if (log.isCarState()) { + this->handle_car_state(t, log.getCarState()); + } else if (log.isCameraOdometry()) { + this->handle_cam_odo(t, log.getCameraOdometry()); + } else if (log.isLiveCalibration()) { + this->handle_live_calib(t, log.getLiveCalibration()); + } + this->finite_check(); + this->update_reset_tracker(); +} + +kj::ArrayPtr Localizer::get_message_bytes(MessageBuilder& msg_builder, uint64_t logMonoTime, + bool inputsOK, bool sensorsOK, bool gpsOK) +{ + cereal::Event::Builder evt = msg_builder.initEvent(); + evt.setLogMonoTime(logMonoTime); + cereal::LiveLocationKalman::Builder liveLoc = evt.initLiveLocationKalman(); + this->build_live_location(liveLoc); + liveLoc.setInputsOK(inputsOK); + liveLoc.setSensorsOK(sensorsOK); + liveLoc.setGpsOK(gpsOK); + return msg_builder.toBytes(); +} + + +bool Localizer::isGpsOK() { + return this->kf->get_filter_time() - this->last_gps_fix < 1.0; +} + +void Localizer::determine_gps_mode(double current_time) { + // 1. If the pos_std is greater than what's not acceptible and localizer is in gps-mode, reset to no-gps-mode + // 2. If the pos_std is greater than what's not acceptible and localizer is in no-gps-mode, fake obs + // 3. If the pos_std is smaller than what's not acceptible, let gps-mode be whatever it is + VectorXd current_pos_std = this->kf->get_P().block(STATE_ECEF_POS_ERR_START, STATE_ECEF_POS_ERR_START).diagonal().array().sqrt(); + if (current_pos_std.norm() > SANE_GPS_UNCERTAINTY){ + if (this->gps_mode){ + this->gps_mode = false; + this->reset_kalman(current_time); + } + else{ + this->input_fake_gps_observations(current_time); + } + } +} + +int Localizer::locationd_thread() { + const std::initializer_list service_list = + { "gpsLocationExternal", "sensorEvents", "cameraOdometry", "liveCalibration", "carState" }; + PubMaster pm({ "liveLocationKalman" }); + SubMaster sm(service_list, nullptr, { "gpsLocationExternal" }); + + while (!do_exit) { + sm.update(); + for (const char* service : service_list) { + if (sm.updated(service) && sm.valid(service)) { + const cereal::Event::Reader log = sm[service]; + this->handle_msg(log); + } + } + + if (sm.updated("cameraOdometry")) { + uint64_t logMonoTime = sm["cameraOdometry"].getLogMonoTime(); + bool inputsOK = sm.allAliveAndValid(); + bool sensorsOK = sm.alive("sensorEvents") && sm.valid("sensorEvents"); + bool gpsOK = this->isGpsOK(); + + MessageBuilder msg_builder; + kj::ArrayPtr bytes = this->get_message_bytes(msg_builder, logMonoTime, inputsOK, sensorsOK, gpsOK); + pm.send("liveLocationKalman", bytes.begin(), bytes.size()); + + if (sm.frame % 1200 == 0 && gpsOK) { // once a minute + VectorXd posGeo = this->get_position_geodetic(); + std::string lastGPSPosJSON = util::string_format( + "{\"latitude\": %.15f, \"longitude\": %.15f, \"altitude\": %.15f}", posGeo(0), posGeo(1), posGeo(2)); + + std::thread([] (const std::string gpsjson) { + Params().put("LastGPSPosition", gpsjson); + }, lastGPSPosJSON).detach(); + } + } + } + return 0; +} + +int main() { + util::set_realtime_priority(5); + + Localizer localizer; + return localizer.locationd_thread(); +} diff --git a/selfdrive/locationd/locationd.h b/selfdrive/locationd/locationd.h new file mode 100755 index 000000000..9bc864bf6 --- /dev/null +++ b/selfdrive/locationd/locationd.h @@ -0,0 +1,75 @@ +#pragma once + +#include +#include +#include +#include + +#include "cereal/messaging/messaging.h" +#include "common/transformations/coordinates.hpp" +#include "common/transformations/orientation.hpp" +#include "selfdrive/common/params.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/timing.h" +#include "selfdrive/common/util.h" + +#include "selfdrive/sensord/sensors/constants.h" +#define VISION_DECIMATION 2 +#define SENSOR_DECIMATION 10 +#include "selfdrive/locationd/models/live_kf.h" + +#define POSENET_STD_HIST_HALF 20 + +class Localizer { +public: + Localizer(); + + int locationd_thread(); + + void reset_kalman(double current_time = NAN); + void reset_kalman(double current_time, Eigen::VectorXd init_orient, Eigen::VectorXd init_pos, Eigen::VectorXd init_vel, MatrixXdr init_pos_R, MatrixXdr init_vel_R); + void reset_kalman(double current_time, Eigen::VectorXd init_x, MatrixXdr init_P); + void finite_check(double current_time = NAN); + void time_check(double current_time = NAN); + void update_reset_tracker(); + bool isGpsOK(); + void determine_gps_mode(double current_time); + + kj::ArrayPtr get_message_bytes(MessageBuilder& msg_builder, uint64_t logMonoTime, + bool inputsOK, bool sensorsOK, bool gpsOK); + void build_live_location(cereal::LiveLocationKalman::Builder& fix); + + Eigen::VectorXd get_position_geodetic(); + Eigen::VectorXd get_state(); + Eigen::VectorXd get_stdev(); + + void handle_msg_bytes(const char *data, const size_t size); + void handle_msg(const cereal::Event::Reader& log); + void handle_sensors(double current_time, const capnp::List::Reader& log); + void handle_gps(double current_time, const cereal::GpsLocationData::Reader& log); + void handle_car_state(double current_time, const cereal::CarState::Reader& log); + void handle_cam_odo(double current_time, const cereal::CameraOdometry::Reader& log); + void handle_live_calib(double current_time, const cereal::LiveCalibrationData::Reader& log); + + void input_fake_gps_observations(double current_time); + +private: + std::unique_ptr kf; + + Eigen::VectorXd calib; + MatrixXdr device_from_calib; + MatrixXdr calib_from_device; + bool calibrated = false; + + double car_speed = 0.0; + double last_reset_time = NAN; + std::deque posenet_stds; + + std::unique_ptr converter; + + int64_t unix_timestamp_millis = 0; + double last_gps_fix = 0; + double reset_tracker = 0.0; + bool device_fell = false; + bool gps_mode = false; +}; diff --git a/selfdrive/locationd/models/.gitignore b/selfdrive/locationd/models/.gitignore new file mode 100644 index 000000000..9ab870da8 --- /dev/null +++ b/selfdrive/locationd/models/.gitignore @@ -0,0 +1 @@ +generated/ diff --git a/selfdrive/locationd/models/car_kf.py b/selfdrive/locationd/models/car_kf.py new file mode 100755 index 000000000..75534efa5 --- /dev/null +++ b/selfdrive/locationd/models/car_kf.py @@ -0,0 +1,179 @@ +#!/usr/bin/env python3 +import math +import sys +from typing import Any, Dict + +import numpy as np + +from selfdrive.controls.lib.vehicle_model import ACCELERATION_DUE_TO_GRAVITY +from selfdrive.locationd.models.constants import ObservationKind +from selfdrive.swaglog import cloudlog + +from rednose.helpers.kalmanfilter import KalmanFilter + +if __name__ == '__main__': # Generating sympy + import sympy as sp + from rednose.helpers.ekf_sym import gen_code +else: + from rednose.helpers.ekf_sym_pyx import EKF_sym # pylint: disable=no-name-in-module, import-error + + +i = 0 + +def _slice(n): + global i + s = slice(i, i + n) + i += n + + return s + + +class States(): + # Vehicle model params + STIFFNESS = _slice(1) # [-] + STEER_RATIO = _slice(1) # [-] + ANGLE_OFFSET = _slice(1) # [rad] + ANGLE_OFFSET_FAST = _slice(1) # [rad] + + VELOCITY = _slice(2) # (x, y) [m/s] + YAW_RATE = _slice(1) # [rad/s] + STEER_ANGLE = _slice(1) # [rad] + ROAD_ROLL = _slice(1) # [rad] + + +class CarKalman(KalmanFilter): + name = 'car' + + initial_x = np.array([ + 1.0, + 15.0, + 0.0, + 0.0, + + 10.0, 0.0, + 0.0, + 0.0, + 0.0 + ]) + + # process noise + Q = np.diag([ + (.05 / 100)**2, + .01**2, + math.radians(0.02)**2, + math.radians(0.25)**2, + + .1**2, .01**2, + math.radians(0.1)**2, + math.radians(0.1)**2, + math.radians(1)**2, + ]) + P_initial = Q.copy() + + obs_noise: Dict[int, Any] = { + ObservationKind.STEER_ANGLE: np.atleast_2d(math.radians(0.05)**2), + ObservationKind.ANGLE_OFFSET_FAST: np.atleast_2d(math.radians(10.0)**2), + ObservationKind.ROAD_ROLL: np.atleast_2d(math.radians(1.0)**2), + ObservationKind.STEER_RATIO: np.atleast_2d(5.0**2), + ObservationKind.STIFFNESS: np.atleast_2d(0.5**2), + ObservationKind.ROAD_FRAME_X_SPEED: np.atleast_2d(0.1**2), + } + + global_vars = [ + 'mass', + 'rotational_inertia', + 'center_to_front', + 'center_to_rear', + 'stiffness_front', + 'stiffness_rear', + ] + + @staticmethod + def generate_code(generated_dir): + dim_state = CarKalman.initial_x.shape[0] + name = CarKalman.name + + # vehicle models comes from The Science of Vehicle Dynamics: Handling, Braking, and Ride of Road and Race Cars + # Model used is in 6.15 with formula from 6.198 + + # globals + global_vars = [sp.Symbol(name) for name in CarKalman.global_vars] + m, j, aF, aR, cF_orig, cR_orig = global_vars + + # make functions and jacobians with sympy + # state variables + state_sym = sp.MatrixSymbol('state', dim_state, 1) + state = sp.Matrix(state_sym) + + # Vehicle model constants + sf = state[States.STIFFNESS, :][0, 0] + + cF, cR = sf * cF_orig, sf * cR_orig + angle_offset = state[States.ANGLE_OFFSET, :][0, 0] + angle_offset_fast = state[States.ANGLE_OFFSET_FAST, :][0, 0] + theta = state[States.ROAD_ROLL, :][0, 0] + sa = state[States.STEER_ANGLE, :][0, 0] + + sR = state[States.STEER_RATIO, :][0, 0] + u, v = state[States.VELOCITY, :] + r = state[States.YAW_RATE, :][0, 0] + + A = sp.Matrix(np.zeros((2, 2))) + A[0, 0] = -(cF + cR) / (m * u) + A[0, 1] = -(cF * aF - cR * aR) / (m * u) - u + A[1, 0] = -(cF * aF - cR * aR) / (j * u) + A[1, 1] = -(cF * aF**2 + cR * aR**2) / (j * u) + + B = sp.Matrix(np.zeros((2, 1))) + B[0, 0] = cF / m / sR + B[1, 0] = (cF * aF) / j / sR + + C = sp.Matrix(np.zeros((2, 1))) + C[0, 0] = ACCELERATION_DUE_TO_GRAVITY + C[1, 0] = 0 + + x = sp.Matrix([v, r]) # lateral velocity, yaw rate + x_dot = A * x + B * (sa - angle_offset - angle_offset_fast) - C * theta + + dt = sp.Symbol('dt') + state_dot = sp.Matrix(np.zeros((dim_state, 1))) + state_dot[States.VELOCITY.start + 1, 0] = x_dot[0] + state_dot[States.YAW_RATE.start, 0] = x_dot[1] + + # Basic descretization, 1st order integrator + # Can be pretty bad if dt is big + f_sym = state + dt * state_dot + + # + # Observation functions + # + obs_eqs = [ + [sp.Matrix([r]), ObservationKind.ROAD_FRAME_YAW_RATE, None], + [sp.Matrix([u, v]), ObservationKind.ROAD_FRAME_XY_SPEED, None], + [sp.Matrix([u]), ObservationKind.ROAD_FRAME_X_SPEED, None], + [sp.Matrix([sa]), ObservationKind.STEER_ANGLE, None], + [sp.Matrix([angle_offset_fast]), ObservationKind.ANGLE_OFFSET_FAST, None], + [sp.Matrix([sR]), ObservationKind.STEER_RATIO, None], + [sp.Matrix([sf]), ObservationKind.STIFFNESS, None], + [sp.Matrix([theta]), ObservationKind.ROAD_ROLL, None], + ] + + gen_code(generated_dir, name, f_sym, dt, state_sym, obs_eqs, dim_state, dim_state, global_vars=global_vars) + + def __init__(self, generated_dir, steer_ratio=15, stiffness_factor=1, angle_offset=0, P_initial=None): # pylint: disable=super-init-not-called + dim_state = self.initial_x.shape[0] + dim_state_err = self.P_initial.shape[0] + x_init = self.initial_x + x_init[States.STEER_RATIO] = steer_ratio + x_init[States.STIFFNESS] = stiffness_factor + x_init[States.ANGLE_OFFSET] = angle_offset + + if P_initial is not None: + self.P_initial = P_initial + # init filter + self.filter = EKF_sym(generated_dir, self.name, self.Q, self.initial_x, self.P_initial, dim_state, dim_state_err, global_vars=self.global_vars, logger=cloudlog) + + +if __name__ == "__main__": + generated_dir = sys.argv[2] + CarKalman.generate_code(generated_dir) diff --git a/selfdrive/locationd/models/constants.py b/selfdrive/locationd/models/constants.py new file mode 100644 index 000000000..f22f503ee --- /dev/null +++ b/selfdrive/locationd/models/constants.py @@ -0,0 +1,85 @@ +import os + +GENERATED_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), 'generated')) + +class ObservationKind: + UNKNOWN = 0 + NO_OBSERVATION = 1 + GPS_NED = 2 + ODOMETRIC_SPEED = 3 + PHONE_GYRO = 4 + GPS_VEL = 5 + PSEUDORANGE_GPS = 6 + PSEUDORANGE_RATE_GPS = 7 + SPEED = 8 + NO_ROT = 9 + PHONE_ACCEL = 10 + ORB_POINT = 11 + ECEF_POS = 12 + CAMERA_ODO_TRANSLATION = 13 + CAMERA_ODO_ROTATION = 14 + ORB_FEATURES = 15 + MSCKF_TEST = 16 + FEATURE_TRACK_TEST = 17 + LANE_PT = 18 + IMU_FRAME = 19 + PSEUDORANGE_GLONASS = 20 + PSEUDORANGE_RATE_GLONASS = 21 + PSEUDORANGE = 22 + PSEUDORANGE_RATE = 23 + ECEF_VEL = 31 + ECEF_ORIENTATION_FROM_GPS = 32 + NO_ACCEL = 33 + + ROAD_FRAME_XY_SPEED = 24 # (x, y) [m/s] + ROAD_FRAME_YAW_RATE = 25 # [rad/s] + STEER_ANGLE = 26 # [rad] + ANGLE_OFFSET_FAST = 27 # [rad] + STIFFNESS = 28 # [-] + STEER_RATIO = 29 # [-] + ROAD_FRAME_X_SPEED = 30 # (x) [m/s] + ROAD_ROLL = 31 # [rad] + + names = [ + 'Unknown', + 'No observation', + 'GPS NED', + 'Odometric speed', + 'Phone gyro', + 'GPS velocity', + 'GPS pseudorange', + 'GPS pseudorange rate', + 'Speed', + 'No rotation', + 'Phone acceleration', + 'ORB point', + 'ECEF pos', + 'camera odometric translation', + 'camera odometric rotation', + 'ORB features', + 'MSCKF test', + 'Feature track test', + 'Lane ecef point', + 'imu frame eulers', + 'GLONASS pseudorange', + 'GLONASS pseudorange rate', + + 'Road Frame x,y speed', + 'Road Frame yaw rate', + 'Steer Angle', + 'Fast Angle Offset', + 'Stiffness', + 'Steer Ratio', + 'Road Frame x speed', + 'Road Roll', + ] + + @classmethod + def to_string(cls, kind): + return cls.names[kind] + + +SAT_OBS = [ObservationKind.PSEUDORANGE_GPS, + ObservationKind.PSEUDORANGE_RATE_GPS, + ObservationKind.PSEUDORANGE_GLONASS, + ObservationKind.PSEUDORANGE_RATE_GLONASS] diff --git a/selfdrive/locationd/models/generated/car.cpp b/selfdrive/locationd/models/generated/car.cpp new file mode 100644 index 000000000..04b5969cf --- /dev/null +++ b/selfdrive/locationd/models/generated/car.cpp @@ -0,0 +1,661 @@ +#include "car.h" + +namespace { +#define DIM 9 +#define EDIM 9 +#define MEDIM 9 +typedef void (*Hfun)(double *, double *, double *); + +double mass; + +void set_mass(double x){ mass = x;} + +double rotational_inertia; + +void set_rotational_inertia(double x){ rotational_inertia = x;} + +double center_to_front; + +void set_center_to_front(double x){ center_to_front = x;} + +double center_to_rear; + +void set_center_to_rear(double x){ center_to_rear = x;} + +double stiffness_front; + +void set_stiffness_front(double x){ stiffness_front = x;} + +double stiffness_rear; + +void set_stiffness_rear(double x){ stiffness_rear = x;} +const static double MAHA_THRESH_25 = 3.8414588206941227; +const static double MAHA_THRESH_24 = 5.991464547107981; +const static double MAHA_THRESH_30 = 3.8414588206941227; +const static double MAHA_THRESH_26 = 3.8414588206941227; +const static double MAHA_THRESH_27 = 3.8414588206941227; +const static double MAHA_THRESH_29 = 3.8414588206941227; +const static double MAHA_THRESH_28 = 3.8414588206941227; +const static double MAHA_THRESH_31 = 3.8414588206941227; + +/****************************************************************************** + * Code generated with sympy 1.9 * + * * + * See http://www.sympy.org/ for more information. * + * * + * This file is part of 'ekf' * + ******************************************************************************/ +void err_fun(double *nom_x, double *delta_x, double *out_1475588756916852268) { + out_1475588756916852268[0] = delta_x[0] + nom_x[0]; + out_1475588756916852268[1] = delta_x[1] + nom_x[1]; + out_1475588756916852268[2] = delta_x[2] + nom_x[2]; + out_1475588756916852268[3] = delta_x[3] + nom_x[3]; + out_1475588756916852268[4] = delta_x[4] + nom_x[4]; + out_1475588756916852268[5] = delta_x[5] + nom_x[5]; + out_1475588756916852268[6] = delta_x[6] + nom_x[6]; + out_1475588756916852268[7] = delta_x[7] + nom_x[7]; + out_1475588756916852268[8] = delta_x[8] + nom_x[8]; +} +void inv_err_fun(double *nom_x, double *true_x, double *out_3596983127668324109) { + out_3596983127668324109[0] = -nom_x[0] + true_x[0]; + out_3596983127668324109[1] = -nom_x[1] + true_x[1]; + out_3596983127668324109[2] = -nom_x[2] + true_x[2]; + out_3596983127668324109[3] = -nom_x[3] + true_x[3]; + out_3596983127668324109[4] = -nom_x[4] + true_x[4]; + out_3596983127668324109[5] = -nom_x[5] + true_x[5]; + out_3596983127668324109[6] = -nom_x[6] + true_x[6]; + out_3596983127668324109[7] = -nom_x[7] + true_x[7]; + out_3596983127668324109[8] = -nom_x[8] + true_x[8]; +} +void H_mod_fun(double *state, double *out_3389099407762428077) { + out_3389099407762428077[0] = 1.0; + out_3389099407762428077[1] = 0; + out_3389099407762428077[2] = 0; + out_3389099407762428077[3] = 0; + out_3389099407762428077[4] = 0; + out_3389099407762428077[5] = 0; + out_3389099407762428077[6] = 0; + out_3389099407762428077[7] = 0; + out_3389099407762428077[8] = 0; + out_3389099407762428077[9] = 0; + out_3389099407762428077[10] = 1.0; + out_3389099407762428077[11] = 0; + out_3389099407762428077[12] = 0; + out_3389099407762428077[13] = 0; + out_3389099407762428077[14] = 0; + out_3389099407762428077[15] = 0; + out_3389099407762428077[16] = 0; + out_3389099407762428077[17] = 0; + out_3389099407762428077[18] = 0; + out_3389099407762428077[19] = 0; + out_3389099407762428077[20] = 1.0; + out_3389099407762428077[21] = 0; + out_3389099407762428077[22] = 0; + out_3389099407762428077[23] = 0; + out_3389099407762428077[24] = 0; + out_3389099407762428077[25] = 0; + out_3389099407762428077[26] = 0; + out_3389099407762428077[27] = 0; + out_3389099407762428077[28] = 0; + out_3389099407762428077[29] = 0; + out_3389099407762428077[30] = 1.0; + out_3389099407762428077[31] = 0; + out_3389099407762428077[32] = 0; + out_3389099407762428077[33] = 0; + out_3389099407762428077[34] = 0; + out_3389099407762428077[35] = 0; + out_3389099407762428077[36] = 0; + out_3389099407762428077[37] = 0; + out_3389099407762428077[38] = 0; + out_3389099407762428077[39] = 0; + out_3389099407762428077[40] = 1.0; + out_3389099407762428077[41] = 0; + out_3389099407762428077[42] = 0; + out_3389099407762428077[43] = 0; + out_3389099407762428077[44] = 0; + out_3389099407762428077[45] = 0; + out_3389099407762428077[46] = 0; + out_3389099407762428077[47] = 0; + out_3389099407762428077[48] = 0; + out_3389099407762428077[49] = 0; + out_3389099407762428077[50] = 1.0; + out_3389099407762428077[51] = 0; + out_3389099407762428077[52] = 0; + out_3389099407762428077[53] = 0; + out_3389099407762428077[54] = 0; + out_3389099407762428077[55] = 0; + out_3389099407762428077[56] = 0; + out_3389099407762428077[57] = 0; + out_3389099407762428077[58] = 0; + out_3389099407762428077[59] = 0; + out_3389099407762428077[60] = 1.0; + out_3389099407762428077[61] = 0; + out_3389099407762428077[62] = 0; + out_3389099407762428077[63] = 0; + out_3389099407762428077[64] = 0; + out_3389099407762428077[65] = 0; + out_3389099407762428077[66] = 0; + out_3389099407762428077[67] = 0; + out_3389099407762428077[68] = 0; + out_3389099407762428077[69] = 0; + out_3389099407762428077[70] = 1.0; + out_3389099407762428077[71] = 0; + out_3389099407762428077[72] = 0; + out_3389099407762428077[73] = 0; + out_3389099407762428077[74] = 0; + out_3389099407762428077[75] = 0; + out_3389099407762428077[76] = 0; + out_3389099407762428077[77] = 0; + out_3389099407762428077[78] = 0; + out_3389099407762428077[79] = 0; + out_3389099407762428077[80] = 1.0; +} +void f_fun(double *state, double dt, double *out_5045286729280014390) { + out_5045286729280014390[0] = state[0]; + out_5045286729280014390[1] = state[1]; + out_5045286729280014390[2] = state[2]; + out_5045286729280014390[3] = state[3]; + out_5045286729280014390[4] = state[4]; + out_5045286729280014390[5] = dt*((-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]))*state[6] - 9.8000000000000007*state[8] + stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*state[1]) + (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*state[4])) + state[5]; + out_5045286729280014390[6] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*state[4])) + state[6]; + out_5045286729280014390[7] = state[7]; + out_5045286729280014390[8] = state[8]; +} +void F_fun(double *state, double dt, double *out_8901810177871386405) { + out_8901810177871386405[0] = 1; + out_8901810177871386405[1] = 0; + out_8901810177871386405[2] = 0; + out_8901810177871386405[3] = 0; + out_8901810177871386405[4] = 0; + out_8901810177871386405[5] = 0; + out_8901810177871386405[6] = 0; + out_8901810177871386405[7] = 0; + out_8901810177871386405[8] = 0; + out_8901810177871386405[9] = 0; + out_8901810177871386405[10] = 1; + out_8901810177871386405[11] = 0; + out_8901810177871386405[12] = 0; + out_8901810177871386405[13] = 0; + out_8901810177871386405[14] = 0; + out_8901810177871386405[15] = 0; + out_8901810177871386405[16] = 0; + out_8901810177871386405[17] = 0; + out_8901810177871386405[18] = 0; + out_8901810177871386405[19] = 0; + out_8901810177871386405[20] = 1; + out_8901810177871386405[21] = 0; + out_8901810177871386405[22] = 0; + out_8901810177871386405[23] = 0; + out_8901810177871386405[24] = 0; + out_8901810177871386405[25] = 0; + out_8901810177871386405[26] = 0; + out_8901810177871386405[27] = 0; + out_8901810177871386405[28] = 0; + out_8901810177871386405[29] = 0; + out_8901810177871386405[30] = 1; + out_8901810177871386405[31] = 0; + out_8901810177871386405[32] = 0; + out_8901810177871386405[33] = 0; + out_8901810177871386405[34] = 0; + out_8901810177871386405[35] = 0; + out_8901810177871386405[36] = 0; + out_8901810177871386405[37] = 0; + out_8901810177871386405[38] = 0; + out_8901810177871386405[39] = 0; + out_8901810177871386405[40] = 1; + out_8901810177871386405[41] = 0; + out_8901810177871386405[42] = 0; + out_8901810177871386405[43] = 0; + out_8901810177871386405[44] = 0; + out_8901810177871386405[45] = dt*(stiffness_front*(-state[2] - state[3] + state[7])/(mass*state[1]) + (-stiffness_front - stiffness_rear)*state[5]/(mass*state[4]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[6]/(mass*state[4])); + out_8901810177871386405[46] = -dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*pow(state[1], 2)); + out_8901810177871386405[47] = -dt*stiffness_front*state[0]/(mass*state[1]); + out_8901810177871386405[48] = -dt*stiffness_front*state[0]/(mass*state[1]); + out_8901810177871386405[49] = dt*((-1 - (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*pow(state[4], 2)))*state[6] - (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*pow(state[4], 2))); + out_8901810177871386405[50] = dt*(-stiffness_front*state[0] - stiffness_rear*state[0])/(mass*state[4]) + 1; + out_8901810177871386405[51] = dt*(-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4])); + out_8901810177871386405[52] = dt*stiffness_front*state[0]/(mass*state[1]); + out_8901810177871386405[53] = -9.8000000000000007*dt; + out_8901810177871386405[54] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front - pow(center_to_rear, 2)*stiffness_rear)*state[6]/(rotational_inertia*state[4])); + out_8901810177871386405[55] = -center_to_front*dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*pow(state[1], 2)); + out_8901810177871386405[56] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); + out_8901810177871386405[57] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); + out_8901810177871386405[58] = dt*(-(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*pow(state[4], 2)) - (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*pow(state[4], 2))); + out_8901810177871386405[59] = dt*(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(rotational_inertia*state[4]); + out_8901810177871386405[60] = dt*(-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])/(rotational_inertia*state[4]) + 1; + out_8901810177871386405[61] = center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); + out_8901810177871386405[62] = 0; + out_8901810177871386405[63] = 0; + out_8901810177871386405[64] = 0; + out_8901810177871386405[65] = 0; + out_8901810177871386405[66] = 0; + out_8901810177871386405[67] = 0; + out_8901810177871386405[68] = 0; + out_8901810177871386405[69] = 0; + out_8901810177871386405[70] = 1; + out_8901810177871386405[71] = 0; + out_8901810177871386405[72] = 0; + out_8901810177871386405[73] = 0; + out_8901810177871386405[74] = 0; + out_8901810177871386405[75] = 0; + out_8901810177871386405[76] = 0; + out_8901810177871386405[77] = 0; + out_8901810177871386405[78] = 0; + out_8901810177871386405[79] = 0; + out_8901810177871386405[80] = 1; +} +void h_25(double *state, double *unused, double *out_2445776787221609462) { + out_2445776787221609462[0] = state[6]; +} +void H_25(double *state, double *unused, double *out_5198710936402375667) { + out_5198710936402375667[0] = 0; + out_5198710936402375667[1] = 0; + out_5198710936402375667[2] = 0; + out_5198710936402375667[3] = 0; + out_5198710936402375667[4] = 0; + out_5198710936402375667[5] = 0; + out_5198710936402375667[6] = 1; + out_5198710936402375667[7] = 0; + out_5198710936402375667[8] = 0; +} +void h_24(double *state, double *unused, double *out_4307300272860009815) { + out_4307300272860009815[0] = state[4]; + out_4307300272860009815[1] = state[5]; +} +void H_24(double *state, double *unused, double *out_8379218272279469097) { + out_8379218272279469097[0] = 0; + out_8379218272279469097[1] = 0; + out_8379218272279469097[2] = 0; + out_8379218272279469097[3] = 0; + out_8379218272279469097[4] = 1; + out_8379218272279469097[5] = 0; + out_8379218272279469097[6] = 0; + out_8379218272279469097[7] = 0; + out_8379218272279469097[8] = 0; + out_8379218272279469097[9] = 0; + out_8379218272279469097[10] = 0; + out_8379218272279469097[11] = 0; + out_8379218272279469097[12] = 0; + out_8379218272279469097[13] = 0; + out_8379218272279469097[14] = 1; + out_8379218272279469097[15] = 0; + out_8379218272279469097[16] = 0; + out_8379218272279469097[17] = 0; +} +void h_30(double *state, double *unused, double *out_5317488469599062979) { + out_5317488469599062979[0] = state[4]; +} +void H_30(double *state, double *unused, double *out_8720336807179567751) { + out_8720336807179567751[0] = 0; + out_8720336807179567751[1] = 0; + out_8720336807179567751[2] = 0; + out_8720336807179567751[3] = 0; + out_8720336807179567751[4] = 1; + out_8720336807179567751[5] = 0; + out_8720336807179567751[6] = 0; + out_8720336807179567751[7] = 0; + out_8720336807179567751[8] = 0; +} +void h_26(double *state, double *unused, double *out_7250970116551773549) { + out_7250970116551773549[0] = state[7]; +} +void H_26(double *state, double *unused, double *out_8940214255276431891) { + out_8940214255276431891[0] = 0; + out_8940214255276431891[1] = 0; + out_8940214255276431891[2] = 0; + out_8940214255276431891[3] = 0; + out_8940214255276431891[4] = 0; + out_8940214255276431891[5] = 0; + out_8940214255276431891[6] = 0; + out_8940214255276431891[7] = 1; + out_8940214255276431891[8] = 0; +} +void h_27(double *state, double *unused, double *out_970496502427460554) { + out_970496502427460554[0] = state[3]; +} +void H_27(double *state, double *unused, double *out_6545573495379142840) { + out_6545573495379142840[0] = 0; + out_6545573495379142840[1] = 0; + out_6545573495379142840[2] = 0; + out_6545573495379142840[3] = 1; + out_6545573495379142840[4] = 0; + out_6545573495379142840[5] = 0; + out_6545573495379142840[6] = 0; + out_6545573495379142840[7] = 0; + out_6545573495379142840[8] = 0; +} +void h_29(double *state, double *unused, double *out_315815201938217334) { + out_315815201938217334[0] = state[1]; +} +void H_29(double *state, double *unused, double *out_9216175922215591681) { + out_9216175922215591681[0] = 0; + out_9216175922215591681[1] = 1; + out_9216175922215591681[2] = 0; + out_9216175922215591681[3] = 0; + out_9216175922215591681[4] = 0; + out_9216175922215591681[5] = 0; + out_9216175922215591681[6] = 0; + out_9216175922215591681[7] = 0; + out_9216175922215591681[8] = 0; +} +void h_28(double *state, double *unused, double *out_4031176765233385091) { + out_4031176765233385091[0] = state[0]; +} +void H_28(double *state, double *unused, double *out_7252545650650265430) { + out_7252545650650265430[0] = 1; + out_7252545650650265430[1] = 0; + out_7252545650650265430[2] = 0; + out_7252545650650265430[3] = 0; + out_7252545650650265430[4] = 0; + out_7252545650650265430[5] = 0; + out_7252545650650265430[6] = 0; + out_7252545650650265430[7] = 0; + out_7252545650650265430[8] = 0; +} +void h_31(double *state, double *unused, double *out_5435495863532439723) { + out_5435495863532439723[0] = state[8]; +} +void H_31(double *state, double *unused, double *out_8880321716199768249) { + out_8880321716199768249[0] = 0; + out_8880321716199768249[1] = 0; + out_8880321716199768249[2] = 0; + out_8880321716199768249[3] = 0; + out_8880321716199768249[4] = 0; + out_8880321716199768249[5] = 0; + out_8880321716199768249[6] = 0; + out_8880321716199768249[7] = 0; + out_8880321716199768249[8] = 1; +} +#include +#include + +typedef Eigen::Matrix DDM; +typedef Eigen::Matrix EEM; +typedef Eigen::Matrix DEM; + +void predict(double *in_x, double *in_P, double *in_Q, double dt) { + typedef Eigen::Matrix RRM; + + double nx[DIM] = {0}; + double in_F[EDIM*EDIM] = {0}; + + // functions from sympy + f_fun(in_x, dt, nx); + F_fun(in_x, dt, in_F); + + + EEM F(in_F); + EEM P(in_P); + EEM Q(in_Q); + + RRM F_main = F.topLeftCorner(MEDIM, MEDIM); + P.topLeftCorner(MEDIM, MEDIM) = (F_main * P.topLeftCorner(MEDIM, MEDIM)) * F_main.transpose(); + P.topRightCorner(MEDIM, EDIM - MEDIM) = F_main * P.topRightCorner(MEDIM, EDIM - MEDIM); + P.bottomLeftCorner(EDIM - MEDIM, MEDIM) = P.bottomLeftCorner(EDIM - MEDIM, MEDIM) * F_main.transpose(); + + P = P + dt*Q; + + // copy out state + memcpy(in_x, nx, DIM * sizeof(double)); + memcpy(in_P, P.data(), EDIM * EDIM * sizeof(double)); +} + +// note: extra_args dim only correct when null space projecting +// otherwise 1 +template +void update(double *in_x, double *in_P, Hfun h_fun, Hfun H_fun, Hfun Hea_fun, double *in_z, double *in_R, double *in_ea, double MAHA_THRESHOLD) { + typedef Eigen::Matrix ZZM; + typedef Eigen::Matrix ZDM; + typedef Eigen::Matrix XEM; + //typedef Eigen::Matrix EZM; + typedef Eigen::Matrix X1M; + typedef Eigen::Matrix XXM; + + double in_hx[ZDIM] = {0}; + double in_H[ZDIM * DIM] = {0}; + double in_H_mod[EDIM * DIM] = {0}; + double delta_x[EDIM] = {0}; + double x_new[DIM] = {0}; + + + // state x, P + Eigen::Matrix z(in_z); + EEM P(in_P); + ZZM pre_R(in_R); + + // functions from sympy + h_fun(in_x, in_ea, in_hx); + H_fun(in_x, in_ea, in_H); + ZDM pre_H(in_H); + + // get y (y = z - hx) + Eigen::Matrix pre_y(in_hx); pre_y = z - pre_y; + X1M y; XXM H; XXM R; + if (Hea_fun){ + typedef Eigen::Matrix ZAM; + double in_Hea[ZDIM * EADIM] = {0}; + Hea_fun(in_x, in_ea, in_Hea); + ZAM Hea(in_Hea); + XXM A = Hea.transpose().fullPivLu().kernel(); + + + y = A.transpose() * pre_y; + H = A.transpose() * pre_H; + R = A.transpose() * pre_R * A; + } else { + y = pre_y; + H = pre_H; + R = pre_R; + } + // get modified H + H_mod_fun(in_x, in_H_mod); + DEM H_mod(in_H_mod); + XEM H_err = H * H_mod; + + // Do mahalobis distance test + if (MAHA_TEST){ + XXM a = (H_err * P * H_err.transpose() + R).inverse(); + double maha_dist = y.transpose() * a * y; + if (maha_dist > MAHA_THRESHOLD){ + R = 1.0e16 * R; + } + } + + // Outlier resilient weighting + double weight = 1;//(1.5)/(1 + y.squaredNorm()/R.sum()); + + // kalman gains and I_KH + XXM S = ((H_err * P) * H_err.transpose()) + R/weight; + XEM KT = S.fullPivLu().solve(H_err * P.transpose()); + //EZM K = KT.transpose(); TODO: WHY DOES THIS NOT COMPILE? + //EZM K = S.fullPivLu().solve(H_err * P.transpose()).transpose(); + //std::cout << "Here is the matrix rot:\n" << K << std::endl; + EEM I_KH = Eigen::Matrix::Identity() - (KT.transpose() * H_err); + + // update state by injecting dx + Eigen::Matrix dx(delta_x); + dx = (KT.transpose() * y); + memcpy(delta_x, dx.data(), EDIM * sizeof(double)); + err_fun(in_x, delta_x, x_new); + Eigen::Matrix x(x_new); + + // update cov + P = ((I_KH * P) * I_KH.transpose()) + ((KT.transpose() * R) * KT); + + // copy out state + memcpy(in_x, x.data(), DIM * sizeof(double)); + memcpy(in_P, P.data(), EDIM * EDIM * sizeof(double)); + memcpy(in_z, y.data(), y.rows() * sizeof(double)); +} + + + + +} +extern "C" { + +void car_update_25(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<1, 3, 0>(in_x, in_P, h_25, H_25, NULL, in_z, in_R, in_ea, MAHA_THRESH_25); +} +void car_update_24(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<2, 3, 0>(in_x, in_P, h_24, H_24, NULL, in_z, in_R, in_ea, MAHA_THRESH_24); +} +void car_update_30(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<1, 3, 0>(in_x, in_P, h_30, H_30, NULL, in_z, in_R, in_ea, MAHA_THRESH_30); +} +void car_update_26(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<1, 3, 0>(in_x, in_P, h_26, H_26, NULL, in_z, in_R, in_ea, MAHA_THRESH_26); +} +void car_update_27(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<1, 3, 0>(in_x, in_P, h_27, H_27, NULL, in_z, in_R, in_ea, MAHA_THRESH_27); +} +void car_update_29(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<1, 3, 0>(in_x, in_P, h_29, H_29, NULL, in_z, in_R, in_ea, MAHA_THRESH_29); +} +void car_update_28(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<1, 3, 0>(in_x, in_P, h_28, H_28, NULL, in_z, in_R, in_ea, MAHA_THRESH_28); +} +void car_update_31(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<1, 3, 0>(in_x, in_P, h_31, H_31, NULL, in_z, in_R, in_ea, MAHA_THRESH_31); +} +void car_err_fun(double *nom_x, double *delta_x, double *out_1475588756916852268) { + err_fun(nom_x, delta_x, out_1475588756916852268); +} +void car_inv_err_fun(double *nom_x, double *true_x, double *out_3596983127668324109) { + inv_err_fun(nom_x, true_x, out_3596983127668324109); +} +void car_H_mod_fun(double *state, double *out_3389099407762428077) { + H_mod_fun(state, out_3389099407762428077); +} +void car_f_fun(double *state, double dt, double *out_5045286729280014390) { + f_fun(state, dt, out_5045286729280014390); +} +void car_F_fun(double *state, double dt, double *out_8901810177871386405) { + F_fun(state, dt, out_8901810177871386405); +} +void car_h_25(double *state, double *unused, double *out_2445776787221609462) { + h_25(state, unused, out_2445776787221609462); +} +void car_H_25(double *state, double *unused, double *out_5198710936402375667) { + H_25(state, unused, out_5198710936402375667); +} +void car_h_24(double *state, double *unused, double *out_4307300272860009815) { + h_24(state, unused, out_4307300272860009815); +} +void car_H_24(double *state, double *unused, double *out_8379218272279469097) { + H_24(state, unused, out_8379218272279469097); +} +void car_h_30(double *state, double *unused, double *out_5317488469599062979) { + h_30(state, unused, out_5317488469599062979); +} +void car_H_30(double *state, double *unused, double *out_8720336807179567751) { + H_30(state, unused, out_8720336807179567751); +} +void car_h_26(double *state, double *unused, double *out_7250970116551773549) { + h_26(state, unused, out_7250970116551773549); +} +void car_H_26(double *state, double *unused, double *out_8940214255276431891) { + H_26(state, unused, out_8940214255276431891); +} +void car_h_27(double *state, double *unused, double *out_970496502427460554) { + h_27(state, unused, out_970496502427460554); +} +void car_H_27(double *state, double *unused, double *out_6545573495379142840) { + H_27(state, unused, out_6545573495379142840); +} +void car_h_29(double *state, double *unused, double *out_315815201938217334) { + h_29(state, unused, out_315815201938217334); +} +void car_H_29(double *state, double *unused, double *out_9216175922215591681) { + H_29(state, unused, out_9216175922215591681); +} +void car_h_28(double *state, double *unused, double *out_4031176765233385091) { + h_28(state, unused, out_4031176765233385091); +} +void car_H_28(double *state, double *unused, double *out_7252545650650265430) { + H_28(state, unused, out_7252545650650265430); +} +void car_h_31(double *state, double *unused, double *out_5435495863532439723) { + h_31(state, unused, out_5435495863532439723); +} +void car_H_31(double *state, double *unused, double *out_8880321716199768249) { + H_31(state, unused, out_8880321716199768249); +} +void car_predict(double *in_x, double *in_P, double *in_Q, double dt) { + predict(in_x, in_P, in_Q, dt); +} +void car_set_mass(double x) { + set_mass(x); +} +void car_set_rotational_inertia(double x) { + set_rotational_inertia(x); +} +void car_set_center_to_front(double x) { + set_center_to_front(x); +} +void car_set_center_to_rear(double x) { + set_center_to_rear(x); +} +void car_set_stiffness_front(double x) { + set_stiffness_front(x); +} +void car_set_stiffness_rear(double x) { + set_stiffness_rear(x); +} +} + +const EKF car = { + .name = "car", + .kinds = { 25, 24, 30, 26, 27, 29, 28, 31 }, + .feature_kinds = { }, + .f_fun = car_f_fun, + .F_fun = car_F_fun, + .err_fun = car_err_fun, + .inv_err_fun = car_inv_err_fun, + .H_mod_fun = car_H_mod_fun, + .predict = car_predict, + .hs = { + { 25, car_h_25 }, + { 24, car_h_24 }, + { 30, car_h_30 }, + { 26, car_h_26 }, + { 27, car_h_27 }, + { 29, car_h_29 }, + { 28, car_h_28 }, + { 31, car_h_31 }, + }, + .Hs = { + { 25, car_H_25 }, + { 24, car_H_24 }, + { 30, car_H_30 }, + { 26, car_H_26 }, + { 27, car_H_27 }, + { 29, car_H_29 }, + { 28, car_H_28 }, + { 31, car_H_31 }, + }, + .updates = { + { 25, car_update_25 }, + { 24, car_update_24 }, + { 30, car_update_30 }, + { 26, car_update_26 }, + { 27, car_update_27 }, + { 29, car_update_29 }, + { 28, car_update_28 }, + { 31, car_update_31 }, + }, + .Hes = { + }, + .sets = { + { "mass", car_set_mass }, + { "rotational_inertia", car_set_rotational_inertia }, + { "center_to_front", car_set_center_to_front }, + { "center_to_rear", car_set_center_to_rear }, + { "stiffness_front", car_set_stiffness_front }, + { "stiffness_rear", car_set_stiffness_rear }, + }, + .extra_routines = { + }, +}; + +ekf_init(car); diff --git a/selfdrive/locationd/models/generated/car.h b/selfdrive/locationd/models/generated/car.h new file mode 100644 index 000000000..0b04494b2 --- /dev/null +++ b/selfdrive/locationd/models/generated/car.h @@ -0,0 +1,40 @@ +#pragma once +#include "rednose/helpers/common_ekf.h" +extern "C" { +void car_update_25(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void car_update_24(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void car_update_30(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void car_update_26(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void car_update_27(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void car_update_29(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void car_update_28(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void car_update_31(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void car_err_fun(double *nom_x, double *delta_x, double *out_1475588756916852268); +void car_inv_err_fun(double *nom_x, double *true_x, double *out_3596983127668324109); +void car_H_mod_fun(double *state, double *out_3389099407762428077); +void car_f_fun(double *state, double dt, double *out_5045286729280014390); +void car_F_fun(double *state, double dt, double *out_8901810177871386405); +void car_h_25(double *state, double *unused, double *out_2445776787221609462); +void car_H_25(double *state, double *unused, double *out_5198710936402375667); +void car_h_24(double *state, double *unused, double *out_4307300272860009815); +void car_H_24(double *state, double *unused, double *out_8379218272279469097); +void car_h_30(double *state, double *unused, double *out_5317488469599062979); +void car_H_30(double *state, double *unused, double *out_8720336807179567751); +void car_h_26(double *state, double *unused, double *out_7250970116551773549); +void car_H_26(double *state, double *unused, double *out_8940214255276431891); +void car_h_27(double *state, double *unused, double *out_970496502427460554); +void car_H_27(double *state, double *unused, double *out_6545573495379142840); +void car_h_29(double *state, double *unused, double *out_315815201938217334); +void car_H_29(double *state, double *unused, double *out_9216175922215591681); +void car_h_28(double *state, double *unused, double *out_4031176765233385091); +void car_H_28(double *state, double *unused, double *out_7252545650650265430); +void car_h_31(double *state, double *unused, double *out_5435495863532439723); +void car_H_31(double *state, double *unused, double *out_8880321716199768249); +void car_predict(double *in_x, double *in_P, double *in_Q, double dt); +void car_set_mass(double x); +void car_set_rotational_inertia(double x); +void car_set_center_to_front(double x); +void car_set_center_to_rear(double x); +void car_set_stiffness_front(double x); +void car_set_stiffness_rear(double x); +} \ No newline at end of file diff --git a/selfdrive/locationd/models/generated/libkf.so b/selfdrive/locationd/models/generated/libkf.so new file mode 100755 index 000000000..0dc6ed1a3 Binary files /dev/null and b/selfdrive/locationd/models/generated/libkf.so differ diff --git a/selfdrive/locationd/models/generated/live.cpp b/selfdrive/locationd/models/generated/live.cpp new file mode 100644 index 000000000..c87b35463 --- /dev/null +++ b/selfdrive/locationd/models/generated/live.cpp @@ -0,0 +1,1987 @@ +#include "live.h" + +namespace { +#define DIM 22 +#define EDIM 21 +#define MEDIM 21 +typedef void (*Hfun)(double *, double *, double *); +const static double MAHA_THRESH_4 = 7.814727903251177; +const static double MAHA_THRESH_9 = 7.814727903251177; +const static double MAHA_THRESH_10 = 7.814727903251177; +const static double MAHA_THRESH_12 = 7.814727903251177; +const static double MAHA_THRESH_31 = 7.814727903251177; +const static double MAHA_THRESH_32 = 9.487729036781154; +const static double MAHA_THRESH_13 = 7.814727903251177; +const static double MAHA_THRESH_14 = 7.814727903251177; +const static double MAHA_THRESH_33 = 7.814727903251177; + +/****************************************************************************** + * Code generated with sympy 1.9 * + * * + * See http://www.sympy.org/ for more information. * + * * + * This file is part of 'ekf' * + ******************************************************************************/ +void H(double *in_vec, double *out_4028264744687795352) { + out_4028264744687795352[0] = 0; + out_4028264744687795352[1] = -sin(in_vec[1])*sin(in_vec[2])*in_vec[4] - sin(in_vec[1])*cos(in_vec[2])*in_vec[3] - cos(in_vec[1])*in_vec[5]; + out_4028264744687795352[2] = -sin(in_vec[2])*cos(in_vec[1])*in_vec[3] + cos(in_vec[1])*cos(in_vec[2])*in_vec[4]; + out_4028264744687795352[3] = cos(in_vec[1])*cos(in_vec[2]); + out_4028264744687795352[4] = sin(in_vec[2])*cos(in_vec[1]); + out_4028264744687795352[5] = -sin(in_vec[1]); + out_4028264744687795352[6] = (sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]))*in_vec[3] + (-sin(in_vec[0])*cos(in_vec[2]) + sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]))*in_vec[4] + cos(in_vec[0])*cos(in_vec[1])*in_vec[5]; + out_4028264744687795352[7] = -sin(in_vec[0])*sin(in_vec[1])*in_vec[5] + sin(in_vec[0])*sin(in_vec[2])*cos(in_vec[1])*in_vec[4] + sin(in_vec[0])*cos(in_vec[1])*cos(in_vec[2])*in_vec[3]; + out_4028264744687795352[8] = (-sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) - cos(in_vec[0])*cos(in_vec[2]))*in_vec[3] + (sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) - sin(in_vec[2])*cos(in_vec[0]))*in_vec[4]; + out_4028264744687795352[9] = sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) - sin(in_vec[2])*cos(in_vec[0]); + out_4028264744687795352[10] = sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) + cos(in_vec[0])*cos(in_vec[2]); + out_4028264744687795352[11] = sin(in_vec[0])*cos(in_vec[1]); + out_4028264744687795352[12] = (-sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) - cos(in_vec[0])*cos(in_vec[2]))*in_vec[4] + (-sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) + sin(in_vec[2])*cos(in_vec[0]))*in_vec[3] - sin(in_vec[0])*cos(in_vec[1])*in_vec[5]; + out_4028264744687795352[13] = -sin(in_vec[1])*cos(in_vec[0])*in_vec[5] + sin(in_vec[2])*cos(in_vec[0])*cos(in_vec[1])*in_vec[4] + cos(in_vec[0])*cos(in_vec[1])*cos(in_vec[2])*in_vec[3]; + out_4028264744687795352[14] = (sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]))*in_vec[4] + (sin(in_vec[0])*cos(in_vec[2]) - sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]))*in_vec[3]; + out_4028264744687795352[15] = sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]); + out_4028264744687795352[16] = -sin(in_vec[0])*cos(in_vec[2]) + sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]); + out_4028264744687795352[17] = cos(in_vec[0])*cos(in_vec[1]); +} +void err_fun(double *nom_x, double *delta_x, double *out_8435331516567488924) { + out_8435331516567488924[0] = delta_x[0] + nom_x[0]; + out_8435331516567488924[1] = delta_x[1] + nom_x[1]; + out_8435331516567488924[2] = delta_x[2] + nom_x[2]; + out_8435331516567488924[3] = -0.5*delta_x[3]*nom_x[4] - 0.5*delta_x[4]*nom_x[5] - 0.5*delta_x[5]*nom_x[6] + 1.0*nom_x[3]; + out_8435331516567488924[4] = 0.5*delta_x[3]*nom_x[3] + 0.5*delta_x[4]*nom_x[6] - 0.5*delta_x[5]*nom_x[5] + 1.0*nom_x[4]; + out_8435331516567488924[5] = -0.5*delta_x[3]*nom_x[6] + 0.5*delta_x[4]*nom_x[3] + 0.5*delta_x[5]*nom_x[4] + 1.0*nom_x[5]; + out_8435331516567488924[6] = 0.5*delta_x[3]*nom_x[5] - 0.5*delta_x[4]*nom_x[4] + 0.5*delta_x[5]*nom_x[3] + 1.0*nom_x[6]; + out_8435331516567488924[7] = delta_x[6] + nom_x[7]; + out_8435331516567488924[8] = delta_x[7] + nom_x[8]; + out_8435331516567488924[9] = delta_x[8] + nom_x[9]; + out_8435331516567488924[10] = delta_x[9] + nom_x[10]; + out_8435331516567488924[11] = delta_x[10] + nom_x[11]; + out_8435331516567488924[12] = delta_x[11] + nom_x[12]; + out_8435331516567488924[13] = delta_x[12] + nom_x[13]; + out_8435331516567488924[14] = delta_x[13] + nom_x[14]; + out_8435331516567488924[15] = delta_x[14] + nom_x[15]; + out_8435331516567488924[16] = delta_x[15] + nom_x[16]; + out_8435331516567488924[17] = delta_x[16] + nom_x[17]; + out_8435331516567488924[18] = delta_x[17] + nom_x[18]; + out_8435331516567488924[19] = delta_x[18] + nom_x[19]; + out_8435331516567488924[20] = delta_x[19] + nom_x[20]; + out_8435331516567488924[21] = delta_x[20] + nom_x[21]; +} +void inv_err_fun(double *nom_x, double *true_x, double *out_5002002164599025613) { + out_5002002164599025613[0] = -nom_x[0] + true_x[0]; + out_5002002164599025613[1] = -nom_x[1] + true_x[1]; + out_5002002164599025613[2] = -nom_x[2] + true_x[2]; + out_5002002164599025613[3] = 2*nom_x[3]*true_x[4] - 2*nom_x[4]*true_x[3] + 2*nom_x[5]*true_x[6] - 2*nom_x[6]*true_x[5]; + out_5002002164599025613[4] = 2*nom_x[3]*true_x[5] - 2*nom_x[4]*true_x[6] - 2*nom_x[5]*true_x[3] + 2*nom_x[6]*true_x[4]; + out_5002002164599025613[5] = 2*nom_x[3]*true_x[6] + 2*nom_x[4]*true_x[5] - 2*nom_x[5]*true_x[4] - 2*nom_x[6]*true_x[3]; + out_5002002164599025613[6] = -nom_x[7] + true_x[7]; + out_5002002164599025613[7] = -nom_x[8] + true_x[8]; + out_5002002164599025613[8] = -nom_x[9] + true_x[9]; + out_5002002164599025613[9] = -nom_x[10] + true_x[10]; + out_5002002164599025613[10] = -nom_x[11] + true_x[11]; + out_5002002164599025613[11] = -nom_x[12] + true_x[12]; + out_5002002164599025613[12] = -nom_x[13] + true_x[13]; + out_5002002164599025613[13] = -nom_x[14] + true_x[14]; + out_5002002164599025613[14] = -nom_x[15] + true_x[15]; + out_5002002164599025613[15] = -nom_x[16] + true_x[16]; + out_5002002164599025613[16] = -nom_x[17] + true_x[17]; + out_5002002164599025613[17] = -nom_x[18] + true_x[18]; + out_5002002164599025613[18] = -nom_x[19] + true_x[19]; + out_5002002164599025613[19] = -nom_x[20] + true_x[20]; + out_5002002164599025613[20] = -nom_x[21] + true_x[21]; +} +void H_mod_fun(double *state, double *out_3440322527295895629) { + out_3440322527295895629[0] = 1.0; + out_3440322527295895629[1] = 0; + out_3440322527295895629[2] = 0; + out_3440322527295895629[3] = 0; + out_3440322527295895629[4] = 0; + out_3440322527295895629[5] = 0; + out_3440322527295895629[6] = 0; + out_3440322527295895629[7] = 0; + out_3440322527295895629[8] = 0; + out_3440322527295895629[9] = 0; + out_3440322527295895629[10] = 0; + out_3440322527295895629[11] = 0; + out_3440322527295895629[12] = 0; + out_3440322527295895629[13] = 0; + out_3440322527295895629[14] = 0; + out_3440322527295895629[15] = 0; + out_3440322527295895629[16] = 0; + out_3440322527295895629[17] = 0; + out_3440322527295895629[18] = 0; + out_3440322527295895629[19] = 0; + out_3440322527295895629[20] = 0; + out_3440322527295895629[21] = 0; + out_3440322527295895629[22] = 1.0; + out_3440322527295895629[23] = 0; + out_3440322527295895629[24] = 0; + out_3440322527295895629[25] = 0; + out_3440322527295895629[26] = 0; + out_3440322527295895629[27] = 0; + out_3440322527295895629[28] = 0; + out_3440322527295895629[29] = 0; + out_3440322527295895629[30] = 0; + out_3440322527295895629[31] = 0; + out_3440322527295895629[32] = 0; + out_3440322527295895629[33] = 0; + out_3440322527295895629[34] = 0; + out_3440322527295895629[35] = 0; + out_3440322527295895629[36] = 0; + out_3440322527295895629[37] = 0; + out_3440322527295895629[38] = 0; + out_3440322527295895629[39] = 0; + out_3440322527295895629[40] = 0; + out_3440322527295895629[41] = 0; + out_3440322527295895629[42] = 0; + out_3440322527295895629[43] = 0; + out_3440322527295895629[44] = 1.0; + out_3440322527295895629[45] = 0; + out_3440322527295895629[46] = 0; + out_3440322527295895629[47] = 0; + out_3440322527295895629[48] = 0; + out_3440322527295895629[49] = 0; + out_3440322527295895629[50] = 0; + out_3440322527295895629[51] = 0; + out_3440322527295895629[52] = 0; + out_3440322527295895629[53] = 0; + out_3440322527295895629[54] = 0; + out_3440322527295895629[55] = 0; + out_3440322527295895629[56] = 0; + out_3440322527295895629[57] = 0; + out_3440322527295895629[58] = 0; + out_3440322527295895629[59] = 0; + out_3440322527295895629[60] = 0; + out_3440322527295895629[61] = 0; + out_3440322527295895629[62] = 0; + out_3440322527295895629[63] = 0; + out_3440322527295895629[64] = 0; + out_3440322527295895629[65] = 0; + out_3440322527295895629[66] = -0.5*state[4]; + out_3440322527295895629[67] = -0.5*state[5]; + out_3440322527295895629[68] = -0.5*state[6]; + out_3440322527295895629[69] = 0; + out_3440322527295895629[70] = 0; + out_3440322527295895629[71] = 0; + out_3440322527295895629[72] = 0; + out_3440322527295895629[73] = 0; + out_3440322527295895629[74] = 0; + out_3440322527295895629[75] = 0; + out_3440322527295895629[76] = 0; + out_3440322527295895629[77] = 0; + out_3440322527295895629[78] = 0; + out_3440322527295895629[79] = 0; + out_3440322527295895629[80] = 0; + out_3440322527295895629[81] = 0; + out_3440322527295895629[82] = 0; + out_3440322527295895629[83] = 0; + out_3440322527295895629[84] = 0; + out_3440322527295895629[85] = 0; + out_3440322527295895629[86] = 0; + out_3440322527295895629[87] = 0.5*state[3]; + out_3440322527295895629[88] = 0.5*state[6]; + out_3440322527295895629[89] = -0.5*state[5]; + out_3440322527295895629[90] = 0; + out_3440322527295895629[91] = 0; + out_3440322527295895629[92] = 0; + out_3440322527295895629[93] = 0; + out_3440322527295895629[94] = 0; + out_3440322527295895629[95] = 0; + out_3440322527295895629[96] = 0; + out_3440322527295895629[97] = 0; + out_3440322527295895629[98] = 0; + out_3440322527295895629[99] = 0; + out_3440322527295895629[100] = 0; + out_3440322527295895629[101] = 0; + out_3440322527295895629[102] = 0; + out_3440322527295895629[103] = 0; + out_3440322527295895629[104] = 0; + out_3440322527295895629[105] = 0; + out_3440322527295895629[106] = 0; + out_3440322527295895629[107] = 0; + out_3440322527295895629[108] = -0.5*state[6]; + out_3440322527295895629[109] = 0.5*state[3]; + out_3440322527295895629[110] = 0.5*state[4]; + out_3440322527295895629[111] = 0; + out_3440322527295895629[112] = 0; + out_3440322527295895629[113] = 0; + out_3440322527295895629[114] = 0; + out_3440322527295895629[115] = 0; + out_3440322527295895629[116] = 0; + out_3440322527295895629[117] = 0; + out_3440322527295895629[118] = 0; + out_3440322527295895629[119] = 0; + out_3440322527295895629[120] = 0; + out_3440322527295895629[121] = 0; + out_3440322527295895629[122] = 0; + out_3440322527295895629[123] = 0; + out_3440322527295895629[124] = 0; + out_3440322527295895629[125] = 0; + out_3440322527295895629[126] = 0; + out_3440322527295895629[127] = 0; + out_3440322527295895629[128] = 0; + out_3440322527295895629[129] = 0.5*state[5]; + out_3440322527295895629[130] = -0.5*state[4]; + out_3440322527295895629[131] = 0.5*state[3]; + out_3440322527295895629[132] = 0; + out_3440322527295895629[133] = 0; + out_3440322527295895629[134] = 0; + out_3440322527295895629[135] = 0; + out_3440322527295895629[136] = 0; + out_3440322527295895629[137] = 0; + out_3440322527295895629[138] = 0; + out_3440322527295895629[139] = 0; + out_3440322527295895629[140] = 0; + out_3440322527295895629[141] = 0; + out_3440322527295895629[142] = 0; + out_3440322527295895629[143] = 0; + out_3440322527295895629[144] = 0; + out_3440322527295895629[145] = 0; + out_3440322527295895629[146] = 0; + out_3440322527295895629[147] = 0; + out_3440322527295895629[148] = 0; + out_3440322527295895629[149] = 0; + out_3440322527295895629[150] = 0; + out_3440322527295895629[151] = 0; + out_3440322527295895629[152] = 0; + out_3440322527295895629[153] = 1.0; + out_3440322527295895629[154] = 0; + out_3440322527295895629[155] = 0; + out_3440322527295895629[156] = 0; + out_3440322527295895629[157] = 0; + out_3440322527295895629[158] = 0; + out_3440322527295895629[159] = 0; + out_3440322527295895629[160] = 0; + out_3440322527295895629[161] = 0; + out_3440322527295895629[162] = 0; + out_3440322527295895629[163] = 0; + out_3440322527295895629[164] = 0; + out_3440322527295895629[165] = 0; + out_3440322527295895629[166] = 0; + out_3440322527295895629[167] = 0; + out_3440322527295895629[168] = 0; + out_3440322527295895629[169] = 0; + out_3440322527295895629[170] = 0; + out_3440322527295895629[171] = 0; + out_3440322527295895629[172] = 0; + out_3440322527295895629[173] = 0; + out_3440322527295895629[174] = 0; + out_3440322527295895629[175] = 1.0; + out_3440322527295895629[176] = 0; + out_3440322527295895629[177] = 0; + out_3440322527295895629[178] = 0; + out_3440322527295895629[179] = 0; + out_3440322527295895629[180] = 0; + out_3440322527295895629[181] = 0; + out_3440322527295895629[182] = 0; + out_3440322527295895629[183] = 0; + out_3440322527295895629[184] = 0; + out_3440322527295895629[185] = 0; + out_3440322527295895629[186] = 0; + out_3440322527295895629[187] = 0; + out_3440322527295895629[188] = 0; + out_3440322527295895629[189] = 0; + out_3440322527295895629[190] = 0; + out_3440322527295895629[191] = 0; + out_3440322527295895629[192] = 0; + out_3440322527295895629[193] = 0; + out_3440322527295895629[194] = 0; + out_3440322527295895629[195] = 0; + out_3440322527295895629[196] = 0; + out_3440322527295895629[197] = 1.0; + out_3440322527295895629[198] = 0; + out_3440322527295895629[199] = 0; + out_3440322527295895629[200] = 0; + out_3440322527295895629[201] = 0; + out_3440322527295895629[202] = 0; + out_3440322527295895629[203] = 0; + out_3440322527295895629[204] = 0; + out_3440322527295895629[205] = 0; + out_3440322527295895629[206] = 0; + out_3440322527295895629[207] = 0; + out_3440322527295895629[208] = 0; + out_3440322527295895629[209] = 0; + out_3440322527295895629[210] = 0; + out_3440322527295895629[211] = 0; + out_3440322527295895629[212] = 0; + out_3440322527295895629[213] = 0; + out_3440322527295895629[214] = 0; + out_3440322527295895629[215] = 0; + out_3440322527295895629[216] = 0; + out_3440322527295895629[217] = 0; + out_3440322527295895629[218] = 0; + out_3440322527295895629[219] = 1.0; + out_3440322527295895629[220] = 0; + out_3440322527295895629[221] = 0; + out_3440322527295895629[222] = 0; + out_3440322527295895629[223] = 0; + out_3440322527295895629[224] = 0; + out_3440322527295895629[225] = 0; + out_3440322527295895629[226] = 0; + out_3440322527295895629[227] = 0; + out_3440322527295895629[228] = 0; + out_3440322527295895629[229] = 0; + out_3440322527295895629[230] = 0; + out_3440322527295895629[231] = 0; + out_3440322527295895629[232] = 0; + out_3440322527295895629[233] = 0; + out_3440322527295895629[234] = 0; + out_3440322527295895629[235] = 0; + out_3440322527295895629[236] = 0; + out_3440322527295895629[237] = 0; + out_3440322527295895629[238] = 0; + out_3440322527295895629[239] = 0; + out_3440322527295895629[240] = 0; + out_3440322527295895629[241] = 1.0; + out_3440322527295895629[242] = 0; + out_3440322527295895629[243] = 0; + out_3440322527295895629[244] = 0; + out_3440322527295895629[245] = 0; + out_3440322527295895629[246] = 0; + out_3440322527295895629[247] = 0; + out_3440322527295895629[248] = 0; + out_3440322527295895629[249] = 0; + out_3440322527295895629[250] = 0; + out_3440322527295895629[251] = 0; + out_3440322527295895629[252] = 0; + out_3440322527295895629[253] = 0; + out_3440322527295895629[254] = 0; + out_3440322527295895629[255] = 0; + out_3440322527295895629[256] = 0; + out_3440322527295895629[257] = 0; + out_3440322527295895629[258] = 0; + out_3440322527295895629[259] = 0; + out_3440322527295895629[260] = 0; + out_3440322527295895629[261] = 0; + out_3440322527295895629[262] = 0; + out_3440322527295895629[263] = 1.0; + out_3440322527295895629[264] = 0; + out_3440322527295895629[265] = 0; + out_3440322527295895629[266] = 0; + out_3440322527295895629[267] = 0; + out_3440322527295895629[268] = 0; + out_3440322527295895629[269] = 0; + out_3440322527295895629[270] = 0; + out_3440322527295895629[271] = 0; + out_3440322527295895629[272] = 0; + out_3440322527295895629[273] = 0; + out_3440322527295895629[274] = 0; + out_3440322527295895629[275] = 0; + out_3440322527295895629[276] = 0; + out_3440322527295895629[277] = 0; + out_3440322527295895629[278] = 0; + out_3440322527295895629[279] = 0; + out_3440322527295895629[280] = 0; + out_3440322527295895629[281] = 0; + out_3440322527295895629[282] = 0; + out_3440322527295895629[283] = 0; + out_3440322527295895629[284] = 0; + out_3440322527295895629[285] = 1.0; + out_3440322527295895629[286] = 0; + out_3440322527295895629[287] = 0; + out_3440322527295895629[288] = 0; + out_3440322527295895629[289] = 0; + out_3440322527295895629[290] = 0; + out_3440322527295895629[291] = 0; + out_3440322527295895629[292] = 0; + out_3440322527295895629[293] = 0; + out_3440322527295895629[294] = 0; + out_3440322527295895629[295] = 0; + out_3440322527295895629[296] = 0; + out_3440322527295895629[297] = 0; + out_3440322527295895629[298] = 0; + out_3440322527295895629[299] = 0; + out_3440322527295895629[300] = 0; + out_3440322527295895629[301] = 0; + out_3440322527295895629[302] = 0; + out_3440322527295895629[303] = 0; + out_3440322527295895629[304] = 0; + out_3440322527295895629[305] = 0; + out_3440322527295895629[306] = 0; + out_3440322527295895629[307] = 1.0; + out_3440322527295895629[308] = 0; + out_3440322527295895629[309] = 0; + out_3440322527295895629[310] = 0; + out_3440322527295895629[311] = 0; + out_3440322527295895629[312] = 0; + out_3440322527295895629[313] = 0; + out_3440322527295895629[314] = 0; + out_3440322527295895629[315] = 0; + out_3440322527295895629[316] = 0; + out_3440322527295895629[317] = 0; + out_3440322527295895629[318] = 0; + out_3440322527295895629[319] = 0; + out_3440322527295895629[320] = 0; + out_3440322527295895629[321] = 0; + out_3440322527295895629[322] = 0; + out_3440322527295895629[323] = 0; + out_3440322527295895629[324] = 0; + out_3440322527295895629[325] = 0; + out_3440322527295895629[326] = 0; + out_3440322527295895629[327] = 0; + out_3440322527295895629[328] = 0; + out_3440322527295895629[329] = 1.0; + out_3440322527295895629[330] = 0; + out_3440322527295895629[331] = 0; + out_3440322527295895629[332] = 0; + out_3440322527295895629[333] = 0; + out_3440322527295895629[334] = 0; + out_3440322527295895629[335] = 0; + out_3440322527295895629[336] = 0; + out_3440322527295895629[337] = 0; + out_3440322527295895629[338] = 0; + out_3440322527295895629[339] = 0; + out_3440322527295895629[340] = 0; + out_3440322527295895629[341] = 0; + out_3440322527295895629[342] = 0; + out_3440322527295895629[343] = 0; + out_3440322527295895629[344] = 0; + out_3440322527295895629[345] = 0; + out_3440322527295895629[346] = 0; + out_3440322527295895629[347] = 0; + out_3440322527295895629[348] = 0; + out_3440322527295895629[349] = 0; + out_3440322527295895629[350] = 0; + out_3440322527295895629[351] = 1.0; + out_3440322527295895629[352] = 0; + out_3440322527295895629[353] = 0; + out_3440322527295895629[354] = 0; + out_3440322527295895629[355] = 0; + out_3440322527295895629[356] = 0; + out_3440322527295895629[357] = 0; + out_3440322527295895629[358] = 0; + out_3440322527295895629[359] = 0; + out_3440322527295895629[360] = 0; + out_3440322527295895629[361] = 0; + out_3440322527295895629[362] = 0; + out_3440322527295895629[363] = 0; + out_3440322527295895629[364] = 0; + out_3440322527295895629[365] = 0; + out_3440322527295895629[366] = 0; + out_3440322527295895629[367] = 0; + out_3440322527295895629[368] = 0; + out_3440322527295895629[369] = 0; + out_3440322527295895629[370] = 0; + out_3440322527295895629[371] = 0; + out_3440322527295895629[372] = 0; + out_3440322527295895629[373] = 1.0; + out_3440322527295895629[374] = 0; + out_3440322527295895629[375] = 0; + out_3440322527295895629[376] = 0; + out_3440322527295895629[377] = 0; + out_3440322527295895629[378] = 0; + out_3440322527295895629[379] = 0; + out_3440322527295895629[380] = 0; + out_3440322527295895629[381] = 0; + out_3440322527295895629[382] = 0; + out_3440322527295895629[383] = 0; + out_3440322527295895629[384] = 0; + out_3440322527295895629[385] = 0; + out_3440322527295895629[386] = 0; + out_3440322527295895629[387] = 0; + out_3440322527295895629[388] = 0; + out_3440322527295895629[389] = 0; + out_3440322527295895629[390] = 0; + out_3440322527295895629[391] = 0; + out_3440322527295895629[392] = 0; + out_3440322527295895629[393] = 0; + out_3440322527295895629[394] = 0; + out_3440322527295895629[395] = 1.0; + out_3440322527295895629[396] = 0; + out_3440322527295895629[397] = 0; + out_3440322527295895629[398] = 0; + out_3440322527295895629[399] = 0; + out_3440322527295895629[400] = 0; + out_3440322527295895629[401] = 0; + out_3440322527295895629[402] = 0; + out_3440322527295895629[403] = 0; + out_3440322527295895629[404] = 0; + out_3440322527295895629[405] = 0; + out_3440322527295895629[406] = 0; + out_3440322527295895629[407] = 0; + out_3440322527295895629[408] = 0; + out_3440322527295895629[409] = 0; + out_3440322527295895629[410] = 0; + out_3440322527295895629[411] = 0; + out_3440322527295895629[412] = 0; + out_3440322527295895629[413] = 0; + out_3440322527295895629[414] = 0; + out_3440322527295895629[415] = 0; + out_3440322527295895629[416] = 0; + out_3440322527295895629[417] = 1.0; + out_3440322527295895629[418] = 0; + out_3440322527295895629[419] = 0; + out_3440322527295895629[420] = 0; + out_3440322527295895629[421] = 0; + out_3440322527295895629[422] = 0; + out_3440322527295895629[423] = 0; + out_3440322527295895629[424] = 0; + out_3440322527295895629[425] = 0; + out_3440322527295895629[426] = 0; + out_3440322527295895629[427] = 0; + out_3440322527295895629[428] = 0; + out_3440322527295895629[429] = 0; + out_3440322527295895629[430] = 0; + out_3440322527295895629[431] = 0; + out_3440322527295895629[432] = 0; + out_3440322527295895629[433] = 0; + out_3440322527295895629[434] = 0; + out_3440322527295895629[435] = 0; + out_3440322527295895629[436] = 0; + out_3440322527295895629[437] = 0; + out_3440322527295895629[438] = 0; + out_3440322527295895629[439] = 1.0; + out_3440322527295895629[440] = 0; + out_3440322527295895629[441] = 0; + out_3440322527295895629[442] = 0; + out_3440322527295895629[443] = 0; + out_3440322527295895629[444] = 0; + out_3440322527295895629[445] = 0; + out_3440322527295895629[446] = 0; + out_3440322527295895629[447] = 0; + out_3440322527295895629[448] = 0; + out_3440322527295895629[449] = 0; + out_3440322527295895629[450] = 0; + out_3440322527295895629[451] = 0; + out_3440322527295895629[452] = 0; + out_3440322527295895629[453] = 0; + out_3440322527295895629[454] = 0; + out_3440322527295895629[455] = 0; + out_3440322527295895629[456] = 0; + out_3440322527295895629[457] = 0; + out_3440322527295895629[458] = 0; + out_3440322527295895629[459] = 0; + out_3440322527295895629[460] = 0; + out_3440322527295895629[461] = 1.0; +} +void f_fun(double *state, double dt, double *out_6600220164658986461) { + out_6600220164658986461[0] = dt*state[7] + state[0]; + out_6600220164658986461[1] = dt*state[8] + state[1]; + out_6600220164658986461[2] = dt*state[9] + state[2]; + out_6600220164658986461[3] = dt*(-0.5*state[4]*state[10] - 0.5*state[5]*state[11] - 0.5*state[6]*state[12]) + state[3]; + out_6600220164658986461[4] = dt*(0.5*state[3]*state[10] + 0.5*state[5]*state[12] - 0.5*state[6]*state[11]) + state[4]; + out_6600220164658986461[5] = dt*(0.5*state[3]*state[11] - 0.5*state[4]*state[12] + 0.5*state[6]*state[10]) + state[5]; + out_6600220164658986461[6] = dt*(0.5*state[3]*state[12] + 0.5*state[4]*state[11] - 0.5*state[5]*state[10]) + state[6]; + out_6600220164658986461[7] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[18] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[17] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[16]) + state[7]; + out_6600220164658986461[8] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[18] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[16] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[17]) + state[8]; + out_6600220164658986461[9] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[17] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]) + state[9]; + out_6600220164658986461[10] = state[10]; + out_6600220164658986461[11] = state[11]; + out_6600220164658986461[12] = state[12]; + out_6600220164658986461[13] = state[13]; + out_6600220164658986461[14] = state[14]; + out_6600220164658986461[15] = state[15]; + out_6600220164658986461[16] = state[16]; + out_6600220164658986461[17] = state[17]; + out_6600220164658986461[18] = state[18]; + out_6600220164658986461[19] = state[19]; + out_6600220164658986461[20] = state[20]; + out_6600220164658986461[21] = state[21]; +} +void F_fun(double *state, double dt, double *out_6389863516536335469) { + out_6389863516536335469[0] = 1; + out_6389863516536335469[1] = 0; + out_6389863516536335469[2] = 0; + out_6389863516536335469[3] = 0; + out_6389863516536335469[4] = 0; + out_6389863516536335469[5] = 0; + out_6389863516536335469[6] = dt; + out_6389863516536335469[7] = 0; + out_6389863516536335469[8] = 0; + out_6389863516536335469[9] = 0; + out_6389863516536335469[10] = 0; + out_6389863516536335469[11] = 0; + out_6389863516536335469[12] = 0; + out_6389863516536335469[13] = 0; + out_6389863516536335469[14] = 0; + out_6389863516536335469[15] = 0; + out_6389863516536335469[16] = 0; + out_6389863516536335469[17] = 0; + out_6389863516536335469[18] = 0; + out_6389863516536335469[19] = 0; + out_6389863516536335469[20] = 0; + out_6389863516536335469[21] = 0; + out_6389863516536335469[22] = 1; + out_6389863516536335469[23] = 0; + out_6389863516536335469[24] = 0; + out_6389863516536335469[25] = 0; + out_6389863516536335469[26] = 0; + out_6389863516536335469[27] = 0; + out_6389863516536335469[28] = dt; + out_6389863516536335469[29] = 0; + out_6389863516536335469[30] = 0; + out_6389863516536335469[31] = 0; + out_6389863516536335469[32] = 0; + out_6389863516536335469[33] = 0; + out_6389863516536335469[34] = 0; + out_6389863516536335469[35] = 0; + out_6389863516536335469[36] = 0; + out_6389863516536335469[37] = 0; + out_6389863516536335469[38] = 0; + out_6389863516536335469[39] = 0; + out_6389863516536335469[40] = 0; + out_6389863516536335469[41] = 0; + out_6389863516536335469[42] = 0; + out_6389863516536335469[43] = 0; + out_6389863516536335469[44] = 1; + out_6389863516536335469[45] = 0; + out_6389863516536335469[46] = 0; + out_6389863516536335469[47] = 0; + out_6389863516536335469[48] = 0; + out_6389863516536335469[49] = 0; + out_6389863516536335469[50] = dt; + out_6389863516536335469[51] = 0; + out_6389863516536335469[52] = 0; + out_6389863516536335469[53] = 0; + out_6389863516536335469[54] = 0; + out_6389863516536335469[55] = 0; + out_6389863516536335469[56] = 0; + out_6389863516536335469[57] = 0; + out_6389863516536335469[58] = 0; + out_6389863516536335469[59] = 0; + out_6389863516536335469[60] = 0; + out_6389863516536335469[61] = 0; + out_6389863516536335469[62] = 0; + out_6389863516536335469[63] = 0; + out_6389863516536335469[64] = 0; + out_6389863516536335469[65] = 0; + out_6389863516536335469[66] = 1; + out_6389863516536335469[67] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[11] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[10] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[12]); + out_6389863516536335469[68] = dt*((2*state[3]*state[4] - 2*state[5]*state[6])*state[12] + (-2*state[3]*state[6] - 2*state[4]*state[5])*state[10] + (-pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[11]); + out_6389863516536335469[69] = 0; + out_6389863516536335469[70] = 0; + out_6389863516536335469[71] = 0; + out_6389863516536335469[72] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); + out_6389863516536335469[73] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]); + out_6389863516536335469[74] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]); + out_6389863516536335469[75] = 0; + out_6389863516536335469[76] = 0; + out_6389863516536335469[77] = 0; + out_6389863516536335469[78] = 0; + out_6389863516536335469[79] = 0; + out_6389863516536335469[80] = 0; + out_6389863516536335469[81] = 0; + out_6389863516536335469[82] = 0; + out_6389863516536335469[83] = 0; + out_6389863516536335469[84] = 0; + out_6389863516536335469[85] = 0; + out_6389863516536335469[86] = 0; + out_6389863516536335469[87] = dt*(-(2*state[3]*state[4] + 2*state[5]*state[6])*state[11] - (-2*state[3]*state[5] + 2*state[4]*state[6])*state[10] - (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[12]); + out_6389863516536335469[88] = 1; + out_6389863516536335469[89] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[12] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[11] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[10]); + out_6389863516536335469[90] = 0; + out_6389863516536335469[91] = 0; + out_6389863516536335469[92] = 0; + out_6389863516536335469[93] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]); + out_6389863516536335469[94] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); + out_6389863516536335469[95] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]); + out_6389863516536335469[96] = 0; + out_6389863516536335469[97] = 0; + out_6389863516536335469[98] = 0; + out_6389863516536335469[99] = 0; + out_6389863516536335469[100] = 0; + out_6389863516536335469[101] = 0; + out_6389863516536335469[102] = 0; + out_6389863516536335469[103] = 0; + out_6389863516536335469[104] = 0; + out_6389863516536335469[105] = 0; + out_6389863516536335469[106] = 0; + out_6389863516536335469[107] = 0; + out_6389863516536335469[108] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[12] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[10] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[11]); + out_6389863516536335469[109] = dt*((-2*state[3]*state[5] - 2*state[4]*state[6])*state[12] + (2*state[3]*state[6] - 2*state[4]*state[5])*state[11] + (-pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) + pow(state[6], 2))*state[10]); + out_6389863516536335469[110] = 1; + out_6389863516536335469[111] = 0; + out_6389863516536335469[112] = 0; + out_6389863516536335469[113] = 0; + out_6389863516536335469[114] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]); + out_6389863516536335469[115] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]); + out_6389863516536335469[116] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); + out_6389863516536335469[117] = 0; + out_6389863516536335469[118] = 0; + out_6389863516536335469[119] = 0; + out_6389863516536335469[120] = 0; + out_6389863516536335469[121] = 0; + out_6389863516536335469[122] = 0; + out_6389863516536335469[123] = 0; + out_6389863516536335469[124] = 0; + out_6389863516536335469[125] = 0; + out_6389863516536335469[126] = 0; + out_6389863516536335469[127] = 0; + out_6389863516536335469[128] = 0; + out_6389863516536335469[129] = 0; + out_6389863516536335469[130] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[17] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]); + out_6389863516536335469[131] = dt*((2*state[3]*state[4] - 2*state[5]*state[6])*state[18] + (-2*state[3]*state[6] - 2*state[4]*state[5])*state[16] + (-pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[17]); + out_6389863516536335469[132] = 1; + out_6389863516536335469[133] = 0; + out_6389863516536335469[134] = 0; + out_6389863516536335469[135] = 0; + out_6389863516536335469[136] = 0; + out_6389863516536335469[137] = 0; + out_6389863516536335469[138] = 0; + out_6389863516536335469[139] = 0; + out_6389863516536335469[140] = 0; + out_6389863516536335469[141] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); + out_6389863516536335469[142] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]); + out_6389863516536335469[143] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]); + out_6389863516536335469[144] = 0; + out_6389863516536335469[145] = 0; + out_6389863516536335469[146] = 0; + out_6389863516536335469[147] = 0; + out_6389863516536335469[148] = 0; + out_6389863516536335469[149] = 0; + out_6389863516536335469[150] = dt*(-(2*state[3]*state[4] + 2*state[5]*state[6])*state[17] - (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] - (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]); + out_6389863516536335469[151] = 0; + out_6389863516536335469[152] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[18] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[17] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[16]); + out_6389863516536335469[153] = 0; + out_6389863516536335469[154] = 1; + out_6389863516536335469[155] = 0; + out_6389863516536335469[156] = 0; + out_6389863516536335469[157] = 0; + out_6389863516536335469[158] = 0; + out_6389863516536335469[159] = 0; + out_6389863516536335469[160] = 0; + out_6389863516536335469[161] = 0; + out_6389863516536335469[162] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]); + out_6389863516536335469[163] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); + out_6389863516536335469[164] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]); + out_6389863516536335469[165] = 0; + out_6389863516536335469[166] = 0; + out_6389863516536335469[167] = 0; + out_6389863516536335469[168] = 0; + out_6389863516536335469[169] = 0; + out_6389863516536335469[170] = 0; + out_6389863516536335469[171] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[18] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[16] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[17]); + out_6389863516536335469[172] = dt*((-2*state[3]*state[5] - 2*state[4]*state[6])*state[18] + (2*state[3]*state[6] - 2*state[4]*state[5])*state[17] + (-pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) + pow(state[6], 2))*state[16]); + out_6389863516536335469[173] = 0; + out_6389863516536335469[174] = 0; + out_6389863516536335469[175] = 0; + out_6389863516536335469[176] = 1; + out_6389863516536335469[177] = 0; + out_6389863516536335469[178] = 0; + out_6389863516536335469[179] = 0; + out_6389863516536335469[180] = 0; + out_6389863516536335469[181] = 0; + out_6389863516536335469[182] = 0; + out_6389863516536335469[183] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]); + out_6389863516536335469[184] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]); + out_6389863516536335469[185] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); + out_6389863516536335469[186] = 0; + out_6389863516536335469[187] = 0; + out_6389863516536335469[188] = 0; + out_6389863516536335469[189] = 0; + out_6389863516536335469[190] = 0; + out_6389863516536335469[191] = 0; + out_6389863516536335469[192] = 0; + out_6389863516536335469[193] = 0; + out_6389863516536335469[194] = 0; + out_6389863516536335469[195] = 0; + out_6389863516536335469[196] = 0; + out_6389863516536335469[197] = 0; + out_6389863516536335469[198] = 1; + out_6389863516536335469[199] = 0; + out_6389863516536335469[200] = 0; + out_6389863516536335469[201] = 0; + out_6389863516536335469[202] = 0; + out_6389863516536335469[203] = 0; + out_6389863516536335469[204] = 0; + out_6389863516536335469[205] = 0; + out_6389863516536335469[206] = 0; + out_6389863516536335469[207] = 0; + out_6389863516536335469[208] = 0; + out_6389863516536335469[209] = 0; + out_6389863516536335469[210] = 0; + out_6389863516536335469[211] = 0; + out_6389863516536335469[212] = 0; + out_6389863516536335469[213] = 0; + out_6389863516536335469[214] = 0; + out_6389863516536335469[215] = 0; + out_6389863516536335469[216] = 0; + out_6389863516536335469[217] = 0; + out_6389863516536335469[218] = 0; + out_6389863516536335469[219] = 0; + out_6389863516536335469[220] = 1; + out_6389863516536335469[221] = 0; + out_6389863516536335469[222] = 0; + out_6389863516536335469[223] = 0; + out_6389863516536335469[224] = 0; + out_6389863516536335469[225] = 0; + out_6389863516536335469[226] = 0; + out_6389863516536335469[227] = 0; + out_6389863516536335469[228] = 0; + out_6389863516536335469[229] = 0; + out_6389863516536335469[230] = 0; + out_6389863516536335469[231] = 0; + out_6389863516536335469[232] = 0; + out_6389863516536335469[233] = 0; + out_6389863516536335469[234] = 0; + out_6389863516536335469[235] = 0; + out_6389863516536335469[236] = 0; + out_6389863516536335469[237] = 0; + out_6389863516536335469[238] = 0; + out_6389863516536335469[239] = 0; + out_6389863516536335469[240] = 0; + out_6389863516536335469[241] = 0; + out_6389863516536335469[242] = 1; + out_6389863516536335469[243] = 0; + out_6389863516536335469[244] = 0; + out_6389863516536335469[245] = 0; + out_6389863516536335469[246] = 0; + out_6389863516536335469[247] = 0; + out_6389863516536335469[248] = 0; + out_6389863516536335469[249] = 0; + out_6389863516536335469[250] = 0; + out_6389863516536335469[251] = 0; + out_6389863516536335469[252] = 0; + out_6389863516536335469[253] = 0; + out_6389863516536335469[254] = 0; + out_6389863516536335469[255] = 0; + out_6389863516536335469[256] = 0; + out_6389863516536335469[257] = 0; + out_6389863516536335469[258] = 0; + out_6389863516536335469[259] = 0; + out_6389863516536335469[260] = 0; + out_6389863516536335469[261] = 0; + out_6389863516536335469[262] = 0; + out_6389863516536335469[263] = 0; + out_6389863516536335469[264] = 1; + out_6389863516536335469[265] = 0; + out_6389863516536335469[266] = 0; + out_6389863516536335469[267] = 0; + out_6389863516536335469[268] = 0; + out_6389863516536335469[269] = 0; + out_6389863516536335469[270] = 0; + out_6389863516536335469[271] = 0; + out_6389863516536335469[272] = 0; + out_6389863516536335469[273] = 0; + out_6389863516536335469[274] = 0; + out_6389863516536335469[275] = 0; + out_6389863516536335469[276] = 0; + out_6389863516536335469[277] = 0; + out_6389863516536335469[278] = 0; + out_6389863516536335469[279] = 0; + out_6389863516536335469[280] = 0; + out_6389863516536335469[281] = 0; + out_6389863516536335469[282] = 0; + out_6389863516536335469[283] = 0; + out_6389863516536335469[284] = 0; + out_6389863516536335469[285] = 0; + out_6389863516536335469[286] = 1; + out_6389863516536335469[287] = 0; + out_6389863516536335469[288] = 0; + out_6389863516536335469[289] = 0; + out_6389863516536335469[290] = 0; + out_6389863516536335469[291] = 0; + out_6389863516536335469[292] = 0; + out_6389863516536335469[293] = 0; + out_6389863516536335469[294] = 0; + out_6389863516536335469[295] = 0; + out_6389863516536335469[296] = 0; + out_6389863516536335469[297] = 0; + out_6389863516536335469[298] = 0; + out_6389863516536335469[299] = 0; + out_6389863516536335469[300] = 0; + out_6389863516536335469[301] = 0; + out_6389863516536335469[302] = 0; + out_6389863516536335469[303] = 0; + out_6389863516536335469[304] = 0; + out_6389863516536335469[305] = 0; + out_6389863516536335469[306] = 0; + out_6389863516536335469[307] = 0; + out_6389863516536335469[308] = 1; + out_6389863516536335469[309] = 0; + out_6389863516536335469[310] = 0; + out_6389863516536335469[311] = 0; + out_6389863516536335469[312] = 0; + out_6389863516536335469[313] = 0; + out_6389863516536335469[314] = 0; + out_6389863516536335469[315] = 0; + out_6389863516536335469[316] = 0; + out_6389863516536335469[317] = 0; + out_6389863516536335469[318] = 0; + out_6389863516536335469[319] = 0; + out_6389863516536335469[320] = 0; + out_6389863516536335469[321] = 0; + out_6389863516536335469[322] = 0; + out_6389863516536335469[323] = 0; + out_6389863516536335469[324] = 0; + out_6389863516536335469[325] = 0; + out_6389863516536335469[326] = 0; + out_6389863516536335469[327] = 0; + out_6389863516536335469[328] = 0; + out_6389863516536335469[329] = 0; + out_6389863516536335469[330] = 1; + out_6389863516536335469[331] = 0; + out_6389863516536335469[332] = 0; + out_6389863516536335469[333] = 0; + out_6389863516536335469[334] = 0; + out_6389863516536335469[335] = 0; + out_6389863516536335469[336] = 0; + out_6389863516536335469[337] = 0; + out_6389863516536335469[338] = 0; + out_6389863516536335469[339] = 0; + out_6389863516536335469[340] = 0; + out_6389863516536335469[341] = 0; + out_6389863516536335469[342] = 0; + out_6389863516536335469[343] = 0; + out_6389863516536335469[344] = 0; + out_6389863516536335469[345] = 0; + out_6389863516536335469[346] = 0; + out_6389863516536335469[347] = 0; + out_6389863516536335469[348] = 0; + out_6389863516536335469[349] = 0; + out_6389863516536335469[350] = 0; + out_6389863516536335469[351] = 0; + out_6389863516536335469[352] = 1; + out_6389863516536335469[353] = 0; + out_6389863516536335469[354] = 0; + out_6389863516536335469[355] = 0; + out_6389863516536335469[356] = 0; + out_6389863516536335469[357] = 0; + out_6389863516536335469[358] = 0; + out_6389863516536335469[359] = 0; + out_6389863516536335469[360] = 0; + out_6389863516536335469[361] = 0; + out_6389863516536335469[362] = 0; + out_6389863516536335469[363] = 0; + out_6389863516536335469[364] = 0; + out_6389863516536335469[365] = 0; + out_6389863516536335469[366] = 0; + out_6389863516536335469[367] = 0; + out_6389863516536335469[368] = 0; + out_6389863516536335469[369] = 0; + out_6389863516536335469[370] = 0; + out_6389863516536335469[371] = 0; + out_6389863516536335469[372] = 0; + out_6389863516536335469[373] = 0; + out_6389863516536335469[374] = 1; + out_6389863516536335469[375] = 0; + out_6389863516536335469[376] = 0; + out_6389863516536335469[377] = 0; + out_6389863516536335469[378] = 0; + out_6389863516536335469[379] = 0; + out_6389863516536335469[380] = 0; + out_6389863516536335469[381] = 0; + out_6389863516536335469[382] = 0; + out_6389863516536335469[383] = 0; + out_6389863516536335469[384] = 0; + out_6389863516536335469[385] = 0; + out_6389863516536335469[386] = 0; + out_6389863516536335469[387] = 0; + out_6389863516536335469[388] = 0; + out_6389863516536335469[389] = 0; + out_6389863516536335469[390] = 0; + out_6389863516536335469[391] = 0; + out_6389863516536335469[392] = 0; + out_6389863516536335469[393] = 0; + out_6389863516536335469[394] = 0; + out_6389863516536335469[395] = 0; + out_6389863516536335469[396] = 1; + out_6389863516536335469[397] = 0; + out_6389863516536335469[398] = 0; + out_6389863516536335469[399] = 0; + out_6389863516536335469[400] = 0; + out_6389863516536335469[401] = 0; + out_6389863516536335469[402] = 0; + out_6389863516536335469[403] = 0; + out_6389863516536335469[404] = 0; + out_6389863516536335469[405] = 0; + out_6389863516536335469[406] = 0; + out_6389863516536335469[407] = 0; + out_6389863516536335469[408] = 0; + out_6389863516536335469[409] = 0; + out_6389863516536335469[410] = 0; + out_6389863516536335469[411] = 0; + out_6389863516536335469[412] = 0; + out_6389863516536335469[413] = 0; + out_6389863516536335469[414] = 0; + out_6389863516536335469[415] = 0; + out_6389863516536335469[416] = 0; + out_6389863516536335469[417] = 0; + out_6389863516536335469[418] = 1; + out_6389863516536335469[419] = 0; + out_6389863516536335469[420] = 0; + out_6389863516536335469[421] = 0; + out_6389863516536335469[422] = 0; + out_6389863516536335469[423] = 0; + out_6389863516536335469[424] = 0; + out_6389863516536335469[425] = 0; + out_6389863516536335469[426] = 0; + out_6389863516536335469[427] = 0; + out_6389863516536335469[428] = 0; + out_6389863516536335469[429] = 0; + out_6389863516536335469[430] = 0; + out_6389863516536335469[431] = 0; + out_6389863516536335469[432] = 0; + out_6389863516536335469[433] = 0; + out_6389863516536335469[434] = 0; + out_6389863516536335469[435] = 0; + out_6389863516536335469[436] = 0; + out_6389863516536335469[437] = 0; + out_6389863516536335469[438] = 0; + out_6389863516536335469[439] = 0; + out_6389863516536335469[440] = 1; +} +void h_4(double *state, double *unused, double *out_7661006871823619503) { + out_7661006871823619503[0] = state[10] + state[13]; + out_7661006871823619503[1] = state[11] + state[14]; + out_7661006871823619503[2] = state[12] + state[15]; +} +void H_4(double *state, double *unused, double *out_7501541336268905998) { + out_7501541336268905998[0] = 0; + out_7501541336268905998[1] = 0; + out_7501541336268905998[2] = 0; + out_7501541336268905998[3] = 0; + out_7501541336268905998[4] = 0; + out_7501541336268905998[5] = 0; + out_7501541336268905998[6] = 0; + out_7501541336268905998[7] = 0; + out_7501541336268905998[8] = 0; + out_7501541336268905998[9] = 0; + out_7501541336268905998[10] = 1; + out_7501541336268905998[11] = 0; + out_7501541336268905998[12] = 0; + out_7501541336268905998[13] = 1; + out_7501541336268905998[14] = 0; + out_7501541336268905998[15] = 0; + out_7501541336268905998[16] = 0; + out_7501541336268905998[17] = 0; + out_7501541336268905998[18] = 0; + out_7501541336268905998[19] = 0; + out_7501541336268905998[20] = 0; + out_7501541336268905998[21] = 0; + out_7501541336268905998[22] = 0; + out_7501541336268905998[23] = 0; + out_7501541336268905998[24] = 0; + out_7501541336268905998[25] = 0; + out_7501541336268905998[26] = 0; + out_7501541336268905998[27] = 0; + out_7501541336268905998[28] = 0; + out_7501541336268905998[29] = 0; + out_7501541336268905998[30] = 0; + out_7501541336268905998[31] = 0; + out_7501541336268905998[32] = 0; + out_7501541336268905998[33] = 1; + out_7501541336268905998[34] = 0; + out_7501541336268905998[35] = 0; + out_7501541336268905998[36] = 1; + out_7501541336268905998[37] = 0; + out_7501541336268905998[38] = 0; + out_7501541336268905998[39] = 0; + out_7501541336268905998[40] = 0; + out_7501541336268905998[41] = 0; + out_7501541336268905998[42] = 0; + out_7501541336268905998[43] = 0; + out_7501541336268905998[44] = 0; + out_7501541336268905998[45] = 0; + out_7501541336268905998[46] = 0; + out_7501541336268905998[47] = 0; + out_7501541336268905998[48] = 0; + out_7501541336268905998[49] = 0; + out_7501541336268905998[50] = 0; + out_7501541336268905998[51] = 0; + out_7501541336268905998[52] = 0; + out_7501541336268905998[53] = 0; + out_7501541336268905998[54] = 0; + out_7501541336268905998[55] = 0; + out_7501541336268905998[56] = 1; + out_7501541336268905998[57] = 0; + out_7501541336268905998[58] = 0; + out_7501541336268905998[59] = 1; + out_7501541336268905998[60] = 0; + out_7501541336268905998[61] = 0; + out_7501541336268905998[62] = 0; + out_7501541336268905998[63] = 0; + out_7501541336268905998[64] = 0; + out_7501541336268905998[65] = 0; +} +void h_9(double *state, double *unused, double *out_4926267146494518877) { + out_4926267146494518877[0] = state[10]; + out_4926267146494518877[1] = state[11]; + out_4926267146494518877[2] = state[12]; +} +void H_9(double *state, double *unused, double *out_7260351689639315353) { + out_7260351689639315353[0] = 0; + out_7260351689639315353[1] = 0; + out_7260351689639315353[2] = 0; + out_7260351689639315353[3] = 0; + out_7260351689639315353[4] = 0; + out_7260351689639315353[5] = 0; + out_7260351689639315353[6] = 0; + out_7260351689639315353[7] = 0; + out_7260351689639315353[8] = 0; + out_7260351689639315353[9] = 0; + out_7260351689639315353[10] = 1; + out_7260351689639315353[11] = 0; + out_7260351689639315353[12] = 0; + out_7260351689639315353[13] = 0; + out_7260351689639315353[14] = 0; + out_7260351689639315353[15] = 0; + out_7260351689639315353[16] = 0; + out_7260351689639315353[17] = 0; + out_7260351689639315353[18] = 0; + out_7260351689639315353[19] = 0; + out_7260351689639315353[20] = 0; + out_7260351689639315353[21] = 0; + out_7260351689639315353[22] = 0; + out_7260351689639315353[23] = 0; + out_7260351689639315353[24] = 0; + out_7260351689639315353[25] = 0; + out_7260351689639315353[26] = 0; + out_7260351689639315353[27] = 0; + out_7260351689639315353[28] = 0; + out_7260351689639315353[29] = 0; + out_7260351689639315353[30] = 0; + out_7260351689639315353[31] = 0; + out_7260351689639315353[32] = 0; + out_7260351689639315353[33] = 1; + out_7260351689639315353[34] = 0; + out_7260351689639315353[35] = 0; + out_7260351689639315353[36] = 0; + out_7260351689639315353[37] = 0; + out_7260351689639315353[38] = 0; + out_7260351689639315353[39] = 0; + out_7260351689639315353[40] = 0; + out_7260351689639315353[41] = 0; + out_7260351689639315353[42] = 0; + out_7260351689639315353[43] = 0; + out_7260351689639315353[44] = 0; + out_7260351689639315353[45] = 0; + out_7260351689639315353[46] = 0; + out_7260351689639315353[47] = 0; + out_7260351689639315353[48] = 0; + out_7260351689639315353[49] = 0; + out_7260351689639315353[50] = 0; + out_7260351689639315353[51] = 0; + out_7260351689639315353[52] = 0; + out_7260351689639315353[53] = 0; + out_7260351689639315353[54] = 0; + out_7260351689639315353[55] = 0; + out_7260351689639315353[56] = 1; + out_7260351689639315353[57] = 0; + out_7260351689639315353[58] = 0; + out_7260351689639315353[59] = 0; + out_7260351689639315353[60] = 0; + out_7260351689639315353[61] = 0; + out_7260351689639315353[62] = 0; + out_7260351689639315353[63] = 0; + out_7260351689639315353[64] = 0; + out_7260351689639315353[65] = 0; +} +void h_10(double *state, double *unused, double *out_652311280382873356) { + out_652311280382873356[0] = 398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0] + state[16] + state[19]; + out_652311280382873356[1] = 398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[17] + state[20]; + out_652311280382873356[2] = 398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[18] + state[21]; +} +void H_10(double *state, double *unused, double *out_6526497181785554798) { + out_6526497181785554798[0] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*pow(state[0], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); + out_6526497181785554798[1] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1]; + out_6526497181785554798[2] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[2]; + out_6526497181785554798[3] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]; + out_6526497181785554798[4] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]; + out_6526497181785554798[5] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]; + out_6526497181785554798[6] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]; + out_6526497181785554798[7] = 0; + out_6526497181785554798[8] = 0; + out_6526497181785554798[9] = 0; + out_6526497181785554798[10] = 0; + out_6526497181785554798[11] = 0; + out_6526497181785554798[12] = 0; + out_6526497181785554798[13] = 0; + out_6526497181785554798[14] = 0; + out_6526497181785554798[15] = 0; + out_6526497181785554798[16] = 1; + out_6526497181785554798[17] = 0; + out_6526497181785554798[18] = 0; + out_6526497181785554798[19] = 1; + out_6526497181785554798[20] = 0; + out_6526497181785554798[21] = 0; + out_6526497181785554798[22] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1]; + out_6526497181785554798[23] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*pow(state[1], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); + out_6526497181785554798[24] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1]*state[2]; + out_6526497181785554798[25] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]; + out_6526497181785554798[26] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]; + out_6526497181785554798[27] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]; + out_6526497181785554798[28] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]; + out_6526497181785554798[29] = 0; + out_6526497181785554798[30] = 0; + out_6526497181785554798[31] = 0; + out_6526497181785554798[32] = 0; + out_6526497181785554798[33] = 0; + out_6526497181785554798[34] = 0; + out_6526497181785554798[35] = 0; + out_6526497181785554798[36] = 0; + out_6526497181785554798[37] = 0; + out_6526497181785554798[38] = 0; + out_6526497181785554798[39] = 1; + out_6526497181785554798[40] = 0; + out_6526497181785554798[41] = 0; + out_6526497181785554798[42] = 1; + out_6526497181785554798[43] = 0; + out_6526497181785554798[44] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[0]*state[2]; + out_6526497181785554798[45] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[1]*state[2]; + out_6526497181785554798[46] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*pow(state[2], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); + out_6526497181785554798[47] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]; + out_6526497181785554798[48] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]; + out_6526497181785554798[49] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]; + out_6526497181785554798[50] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]; + out_6526497181785554798[51] = 0; + out_6526497181785554798[52] = 0; + out_6526497181785554798[53] = 0; + out_6526497181785554798[54] = 0; + out_6526497181785554798[55] = 0; + out_6526497181785554798[56] = 0; + out_6526497181785554798[57] = 0; + out_6526497181785554798[58] = 0; + out_6526497181785554798[59] = 0; + out_6526497181785554798[60] = 0; + out_6526497181785554798[61] = 0; + out_6526497181785554798[62] = 1; + out_6526497181785554798[63] = 0; + out_6526497181785554798[64] = 0; + out_6526497181785554798[65] = 1; +} +void h_12(double *state, double *unused, double *out_4327059784582922294) { + out_4327059784582922294[0] = state[0]; + out_4327059784582922294[1] = state[1]; + out_4327059784582922294[2] = state[2]; +} +void H_12(double *state, double *unused, double *out_6880442311221312331) { + out_6880442311221312331[0] = 1; + out_6880442311221312331[1] = 0; + out_6880442311221312331[2] = 0; + out_6880442311221312331[3] = 0; + out_6880442311221312331[4] = 0; + out_6880442311221312331[5] = 0; + out_6880442311221312331[6] = 0; + out_6880442311221312331[7] = 0; + out_6880442311221312331[8] = 0; + out_6880442311221312331[9] = 0; + out_6880442311221312331[10] = 0; + out_6880442311221312331[11] = 0; + out_6880442311221312331[12] = 0; + out_6880442311221312331[13] = 0; + out_6880442311221312331[14] = 0; + out_6880442311221312331[15] = 0; + out_6880442311221312331[16] = 0; + out_6880442311221312331[17] = 0; + out_6880442311221312331[18] = 0; + out_6880442311221312331[19] = 0; + out_6880442311221312331[20] = 0; + out_6880442311221312331[21] = 0; + out_6880442311221312331[22] = 0; + out_6880442311221312331[23] = 1; + out_6880442311221312331[24] = 0; + out_6880442311221312331[25] = 0; + out_6880442311221312331[26] = 0; + out_6880442311221312331[27] = 0; + out_6880442311221312331[28] = 0; + out_6880442311221312331[29] = 0; + out_6880442311221312331[30] = 0; + out_6880442311221312331[31] = 0; + out_6880442311221312331[32] = 0; + out_6880442311221312331[33] = 0; + out_6880442311221312331[34] = 0; + out_6880442311221312331[35] = 0; + out_6880442311221312331[36] = 0; + out_6880442311221312331[37] = 0; + out_6880442311221312331[38] = 0; + out_6880442311221312331[39] = 0; + out_6880442311221312331[40] = 0; + out_6880442311221312331[41] = 0; + out_6880442311221312331[42] = 0; + out_6880442311221312331[43] = 0; + out_6880442311221312331[44] = 0; + out_6880442311221312331[45] = 0; + out_6880442311221312331[46] = 1; + out_6880442311221312331[47] = 0; + out_6880442311221312331[48] = 0; + out_6880442311221312331[49] = 0; + out_6880442311221312331[50] = 0; + out_6880442311221312331[51] = 0; + out_6880442311221312331[52] = 0; + out_6880442311221312331[53] = 0; + out_6880442311221312331[54] = 0; + out_6880442311221312331[55] = 0; + out_6880442311221312331[56] = 0; + out_6880442311221312331[57] = 0; + out_6880442311221312331[58] = 0; + out_6880442311221312331[59] = 0; + out_6880442311221312331[60] = 0; + out_6880442311221312331[61] = 0; + out_6880442311221312331[62] = 0; + out_6880442311221312331[63] = 0; + out_6880442311221312331[64] = 0; + out_6880442311221312331[65] = 0; +} +void h_31(double *state, double *unused, double *out_5720054282446494434) { + out_5720054282446494434[0] = state[7]; + out_5720054282446494434[1] = state[8]; + out_5720054282446494434[2] = state[9]; +} +void H_31(double *state, double *unused, double *out_4134879278896298622) { + out_4134879278896298622[0] = 0; + out_4134879278896298622[1] = 0; + out_4134879278896298622[2] = 0; + out_4134879278896298622[3] = 0; + out_4134879278896298622[4] = 0; + out_4134879278896298622[5] = 0; + out_4134879278896298622[6] = 0; + out_4134879278896298622[7] = 1; + out_4134879278896298622[8] = 0; + out_4134879278896298622[9] = 0; + out_4134879278896298622[10] = 0; + out_4134879278896298622[11] = 0; + out_4134879278896298622[12] = 0; + out_4134879278896298622[13] = 0; + out_4134879278896298622[14] = 0; + out_4134879278896298622[15] = 0; + out_4134879278896298622[16] = 0; + out_4134879278896298622[17] = 0; + out_4134879278896298622[18] = 0; + out_4134879278896298622[19] = 0; + out_4134879278896298622[20] = 0; + out_4134879278896298622[21] = 0; + out_4134879278896298622[22] = 0; + out_4134879278896298622[23] = 0; + out_4134879278896298622[24] = 0; + out_4134879278896298622[25] = 0; + out_4134879278896298622[26] = 0; + out_4134879278896298622[27] = 0; + out_4134879278896298622[28] = 0; + out_4134879278896298622[29] = 0; + out_4134879278896298622[30] = 1; + out_4134879278896298622[31] = 0; + out_4134879278896298622[32] = 0; + out_4134879278896298622[33] = 0; + out_4134879278896298622[34] = 0; + out_4134879278896298622[35] = 0; + out_4134879278896298622[36] = 0; + out_4134879278896298622[37] = 0; + out_4134879278896298622[38] = 0; + out_4134879278896298622[39] = 0; + out_4134879278896298622[40] = 0; + out_4134879278896298622[41] = 0; + out_4134879278896298622[42] = 0; + out_4134879278896298622[43] = 0; + out_4134879278896298622[44] = 0; + out_4134879278896298622[45] = 0; + out_4134879278896298622[46] = 0; + out_4134879278896298622[47] = 0; + out_4134879278896298622[48] = 0; + out_4134879278896298622[49] = 0; + out_4134879278896298622[50] = 0; + out_4134879278896298622[51] = 0; + out_4134879278896298622[52] = 0; + out_4134879278896298622[53] = 1; + out_4134879278896298622[54] = 0; + out_4134879278896298622[55] = 0; + out_4134879278896298622[56] = 0; + out_4134879278896298622[57] = 0; + out_4134879278896298622[58] = 0; + out_4134879278896298622[59] = 0; + out_4134879278896298622[60] = 0; + out_4134879278896298622[61] = 0; + out_4134879278896298622[62] = 0; + out_4134879278896298622[63] = 0; + out_4134879278896298622[64] = 0; + out_4134879278896298622[65] = 0; +} +void h_32(double *state, double *unused, double *out_6542287694810245299) { + out_6542287694810245299[0] = state[3]; + out_6542287694810245299[1] = state[4]; + out_6542287694810245299[2] = state[5]; + out_6542287694810245299[3] = state[6]; +} +void H_32(double *state, double *unused, double *out_587034938909139893) { + out_587034938909139893[0] = 0; + out_587034938909139893[1] = 0; + out_587034938909139893[2] = 0; + out_587034938909139893[3] = 1; + out_587034938909139893[4] = 0; + out_587034938909139893[5] = 0; + out_587034938909139893[6] = 0; + out_587034938909139893[7] = 0; + out_587034938909139893[8] = 0; + out_587034938909139893[9] = 0; + out_587034938909139893[10] = 0; + out_587034938909139893[11] = 0; + out_587034938909139893[12] = 0; + out_587034938909139893[13] = 0; + out_587034938909139893[14] = 0; + out_587034938909139893[15] = 0; + out_587034938909139893[16] = 0; + out_587034938909139893[17] = 0; + out_587034938909139893[18] = 0; + out_587034938909139893[19] = 0; + out_587034938909139893[20] = 0; + out_587034938909139893[21] = 0; + out_587034938909139893[22] = 0; + out_587034938909139893[23] = 0; + out_587034938909139893[24] = 0; + out_587034938909139893[25] = 0; + out_587034938909139893[26] = 1; + out_587034938909139893[27] = 0; + out_587034938909139893[28] = 0; + out_587034938909139893[29] = 0; + out_587034938909139893[30] = 0; + out_587034938909139893[31] = 0; + out_587034938909139893[32] = 0; + out_587034938909139893[33] = 0; + out_587034938909139893[34] = 0; + out_587034938909139893[35] = 0; + out_587034938909139893[36] = 0; + out_587034938909139893[37] = 0; + out_587034938909139893[38] = 0; + out_587034938909139893[39] = 0; + out_587034938909139893[40] = 0; + out_587034938909139893[41] = 0; + out_587034938909139893[42] = 0; + out_587034938909139893[43] = 0; + out_587034938909139893[44] = 0; + out_587034938909139893[45] = 0; + out_587034938909139893[46] = 0; + out_587034938909139893[47] = 0; + out_587034938909139893[48] = 0; + out_587034938909139893[49] = 1; + out_587034938909139893[50] = 0; + out_587034938909139893[51] = 0; + out_587034938909139893[52] = 0; + out_587034938909139893[53] = 0; + out_587034938909139893[54] = 0; + out_587034938909139893[55] = 0; + out_587034938909139893[56] = 0; + out_587034938909139893[57] = 0; + out_587034938909139893[58] = 0; + out_587034938909139893[59] = 0; + out_587034938909139893[60] = 0; + out_587034938909139893[61] = 0; + out_587034938909139893[62] = 0; + out_587034938909139893[63] = 0; + out_587034938909139893[64] = 0; + out_587034938909139893[65] = 0; + out_587034938909139893[66] = 0; + out_587034938909139893[67] = 0; + out_587034938909139893[68] = 0; + out_587034938909139893[69] = 0; + out_587034938909139893[70] = 0; + out_587034938909139893[71] = 0; + out_587034938909139893[72] = 1; + out_587034938909139893[73] = 0; + out_587034938909139893[74] = 0; + out_587034938909139893[75] = 0; + out_587034938909139893[76] = 0; + out_587034938909139893[77] = 0; + out_587034938909139893[78] = 0; + out_587034938909139893[79] = 0; + out_587034938909139893[80] = 0; + out_587034938909139893[81] = 0; + out_587034938909139893[82] = 0; + out_587034938909139893[83] = 0; + out_587034938909139893[84] = 0; + out_587034938909139893[85] = 0; + out_587034938909139893[86] = 0; + out_587034938909139893[87] = 0; +} +void h_13(double *state, double *unused, double *out_2498144898772092043) { + out_2498144898772092043[0] = (-2*state[3]*state[5] + 2*state[4]*state[6])*state[9] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[8] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[7]; + out_2498144898772092043[1] = (2*state[3]*state[4] + 2*state[5]*state[6])*state[9] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[7] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[8]; + out_2498144898772092043[2] = (-2*state[3]*state[4] + 2*state[5]*state[6])*state[8] + (2*state[3]*state[5] + 2*state[4]*state[6])*state[7] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[9]; +} +void H_13(double *state, double *unused, double *out_482060401086535411) { + out_482060401086535411[0] = 0; + out_482060401086535411[1] = 0; + out_482060401086535411[2] = 0; + out_482060401086535411[3] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8]; + out_482060401086535411[4] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; + out_482060401086535411[5] = -2*state[3]*state[9] + 2*state[4]*state[8] - 2*state[5]*state[7]; + out_482060401086535411[6] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7]; + out_482060401086535411[7] = pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2); + out_482060401086535411[8] = 2*state[3]*state[6] + 2*state[4]*state[5]; + out_482060401086535411[9] = -2*state[3]*state[5] + 2*state[4]*state[6]; + out_482060401086535411[10] = 0; + out_482060401086535411[11] = 0; + out_482060401086535411[12] = 0; + out_482060401086535411[13] = 0; + out_482060401086535411[14] = 0; + out_482060401086535411[15] = 0; + out_482060401086535411[16] = 0; + out_482060401086535411[17] = 0; + out_482060401086535411[18] = 0; + out_482060401086535411[19] = 0; + out_482060401086535411[20] = 0; + out_482060401086535411[21] = 0; + out_482060401086535411[22] = 0; + out_482060401086535411[23] = 0; + out_482060401086535411[24] = 0; + out_482060401086535411[25] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7]; + out_482060401086535411[26] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7]; + out_482060401086535411[27] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; + out_482060401086535411[28] = -2*state[3]*state[7] + 2*state[5]*state[9] - 2*state[6]*state[8]; + out_482060401086535411[29] = -2*state[3]*state[6] + 2*state[4]*state[5]; + out_482060401086535411[30] = pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2); + out_482060401086535411[31] = 2*state[3]*state[4] + 2*state[5]*state[6]; + out_482060401086535411[32] = 0; + out_482060401086535411[33] = 0; + out_482060401086535411[34] = 0; + out_482060401086535411[35] = 0; + out_482060401086535411[36] = 0; + out_482060401086535411[37] = 0; + out_482060401086535411[38] = 0; + out_482060401086535411[39] = 0; + out_482060401086535411[40] = 0; + out_482060401086535411[41] = 0; + out_482060401086535411[42] = 0; + out_482060401086535411[43] = 0; + out_482060401086535411[44] = 0; + out_482060401086535411[45] = 0; + out_482060401086535411[46] = 0; + out_482060401086535411[47] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7]; + out_482060401086535411[48] = -2*state[3]*state[8] - 2*state[4]*state[9] + 2*state[6]*state[7]; + out_482060401086535411[49] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8]; + out_482060401086535411[50] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; + out_482060401086535411[51] = 2*state[3]*state[5] + 2*state[4]*state[6]; + out_482060401086535411[52] = -2*state[3]*state[4] + 2*state[5]*state[6]; + out_482060401086535411[53] = pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2); + out_482060401086535411[54] = 0; + out_482060401086535411[55] = 0; + out_482060401086535411[56] = 0; + out_482060401086535411[57] = 0; + out_482060401086535411[58] = 0; + out_482060401086535411[59] = 0; + out_482060401086535411[60] = 0; + out_482060401086535411[61] = 0; + out_482060401086535411[62] = 0; + out_482060401086535411[63] = 0; + out_482060401086535411[64] = 0; + out_482060401086535411[65] = 0; +} +void h_14(double *state, double *unused, double *out_4926267146494518877) { + out_4926267146494518877[0] = state[10]; + out_4926267146494518877[1] = state[11]; + out_4926267146494518877[2] = state[12]; +} +void H_14(double *state, double *unused, double *out_7260351689639315353) { + out_7260351689639315353[0] = 0; + out_7260351689639315353[1] = 0; + out_7260351689639315353[2] = 0; + out_7260351689639315353[3] = 0; + out_7260351689639315353[4] = 0; + out_7260351689639315353[5] = 0; + out_7260351689639315353[6] = 0; + out_7260351689639315353[7] = 0; + out_7260351689639315353[8] = 0; + out_7260351689639315353[9] = 0; + out_7260351689639315353[10] = 1; + out_7260351689639315353[11] = 0; + out_7260351689639315353[12] = 0; + out_7260351689639315353[13] = 0; + out_7260351689639315353[14] = 0; + out_7260351689639315353[15] = 0; + out_7260351689639315353[16] = 0; + out_7260351689639315353[17] = 0; + out_7260351689639315353[18] = 0; + out_7260351689639315353[19] = 0; + out_7260351689639315353[20] = 0; + out_7260351689639315353[21] = 0; + out_7260351689639315353[22] = 0; + out_7260351689639315353[23] = 0; + out_7260351689639315353[24] = 0; + out_7260351689639315353[25] = 0; + out_7260351689639315353[26] = 0; + out_7260351689639315353[27] = 0; + out_7260351689639315353[28] = 0; + out_7260351689639315353[29] = 0; + out_7260351689639315353[30] = 0; + out_7260351689639315353[31] = 0; + out_7260351689639315353[32] = 0; + out_7260351689639315353[33] = 1; + out_7260351689639315353[34] = 0; + out_7260351689639315353[35] = 0; + out_7260351689639315353[36] = 0; + out_7260351689639315353[37] = 0; + out_7260351689639315353[38] = 0; + out_7260351689639315353[39] = 0; + out_7260351689639315353[40] = 0; + out_7260351689639315353[41] = 0; + out_7260351689639315353[42] = 0; + out_7260351689639315353[43] = 0; + out_7260351689639315353[44] = 0; + out_7260351689639315353[45] = 0; + out_7260351689639315353[46] = 0; + out_7260351689639315353[47] = 0; + out_7260351689639315353[48] = 0; + out_7260351689639315353[49] = 0; + out_7260351689639315353[50] = 0; + out_7260351689639315353[51] = 0; + out_7260351689639315353[52] = 0; + out_7260351689639315353[53] = 0; + out_7260351689639315353[54] = 0; + out_7260351689639315353[55] = 0; + out_7260351689639315353[56] = 1; + out_7260351689639315353[57] = 0; + out_7260351689639315353[58] = 0; + out_7260351689639315353[59] = 0; + out_7260351689639315353[60] = 0; + out_7260351689639315353[61] = 0; + out_7260351689639315353[62] = 0; + out_7260351689639315353[63] = 0; + out_7260351689639315353[64] = 0; + out_7260351689639315353[65] = 0; +} +void h_33(double *state, double *unused, double *out_4451523588948760961) { + out_4451523588948760961[0] = state[16]; + out_4451523588948760961[1] = state[17]; + out_4451523588948760961[2] = state[18]; +} +void H_33(double *state, double *unused, double *out_984322274257441018) { + out_984322274257441018[0] = 0; + out_984322274257441018[1] = 0; + out_984322274257441018[2] = 0; + out_984322274257441018[3] = 0; + out_984322274257441018[4] = 0; + out_984322274257441018[5] = 0; + out_984322274257441018[6] = 0; + out_984322274257441018[7] = 0; + out_984322274257441018[8] = 0; + out_984322274257441018[9] = 0; + out_984322274257441018[10] = 0; + out_984322274257441018[11] = 0; + out_984322274257441018[12] = 0; + out_984322274257441018[13] = 0; + out_984322274257441018[14] = 0; + out_984322274257441018[15] = 0; + out_984322274257441018[16] = 1; + out_984322274257441018[17] = 0; + out_984322274257441018[18] = 0; + out_984322274257441018[19] = 0; + out_984322274257441018[20] = 0; + out_984322274257441018[21] = 0; + out_984322274257441018[22] = 0; + out_984322274257441018[23] = 0; + out_984322274257441018[24] = 0; + out_984322274257441018[25] = 0; + out_984322274257441018[26] = 0; + out_984322274257441018[27] = 0; + out_984322274257441018[28] = 0; + out_984322274257441018[29] = 0; + out_984322274257441018[30] = 0; + out_984322274257441018[31] = 0; + out_984322274257441018[32] = 0; + out_984322274257441018[33] = 0; + out_984322274257441018[34] = 0; + out_984322274257441018[35] = 0; + out_984322274257441018[36] = 0; + out_984322274257441018[37] = 0; + out_984322274257441018[38] = 0; + out_984322274257441018[39] = 1; + out_984322274257441018[40] = 0; + out_984322274257441018[41] = 0; + out_984322274257441018[42] = 0; + out_984322274257441018[43] = 0; + out_984322274257441018[44] = 0; + out_984322274257441018[45] = 0; + out_984322274257441018[46] = 0; + out_984322274257441018[47] = 0; + out_984322274257441018[48] = 0; + out_984322274257441018[49] = 0; + out_984322274257441018[50] = 0; + out_984322274257441018[51] = 0; + out_984322274257441018[52] = 0; + out_984322274257441018[53] = 0; + out_984322274257441018[54] = 0; + out_984322274257441018[55] = 0; + out_984322274257441018[56] = 0; + out_984322274257441018[57] = 0; + out_984322274257441018[58] = 0; + out_984322274257441018[59] = 0; + out_984322274257441018[60] = 0; + out_984322274257441018[61] = 0; + out_984322274257441018[62] = 1; + out_984322274257441018[63] = 0; + out_984322274257441018[64] = 0; + out_984322274257441018[65] = 0; +} +#include +#include + +typedef Eigen::Matrix DDM; +typedef Eigen::Matrix EEM; +typedef Eigen::Matrix DEM; + +void predict(double *in_x, double *in_P, double *in_Q, double dt) { + typedef Eigen::Matrix RRM; + + double nx[DIM] = {0}; + double in_F[EDIM*EDIM] = {0}; + + // functions from sympy + f_fun(in_x, dt, nx); + F_fun(in_x, dt, in_F); + + + EEM F(in_F); + EEM P(in_P); + EEM Q(in_Q); + + RRM F_main = F.topLeftCorner(MEDIM, MEDIM); + P.topLeftCorner(MEDIM, MEDIM) = (F_main * P.topLeftCorner(MEDIM, MEDIM)) * F_main.transpose(); + P.topRightCorner(MEDIM, EDIM - MEDIM) = F_main * P.topRightCorner(MEDIM, EDIM - MEDIM); + P.bottomLeftCorner(EDIM - MEDIM, MEDIM) = P.bottomLeftCorner(EDIM - MEDIM, MEDIM) * F_main.transpose(); + + P = P + dt*Q; + + // copy out state + memcpy(in_x, nx, DIM * sizeof(double)); + memcpy(in_P, P.data(), EDIM * EDIM * sizeof(double)); +} + +// note: extra_args dim only correct when null space projecting +// otherwise 1 +template +void update(double *in_x, double *in_P, Hfun h_fun, Hfun H_fun, Hfun Hea_fun, double *in_z, double *in_R, double *in_ea, double MAHA_THRESHOLD) { + typedef Eigen::Matrix ZZM; + typedef Eigen::Matrix ZDM; + typedef Eigen::Matrix XEM; + //typedef Eigen::Matrix EZM; + typedef Eigen::Matrix X1M; + typedef Eigen::Matrix XXM; + + double in_hx[ZDIM] = {0}; + double in_H[ZDIM * DIM] = {0}; + double in_H_mod[EDIM * DIM] = {0}; + double delta_x[EDIM] = {0}; + double x_new[DIM] = {0}; + + + // state x, P + Eigen::Matrix z(in_z); + EEM P(in_P); + ZZM pre_R(in_R); + + // functions from sympy + h_fun(in_x, in_ea, in_hx); + H_fun(in_x, in_ea, in_H); + ZDM pre_H(in_H); + + // get y (y = z - hx) + Eigen::Matrix pre_y(in_hx); pre_y = z - pre_y; + X1M y; XXM H; XXM R; + if (Hea_fun){ + typedef Eigen::Matrix ZAM; + double in_Hea[ZDIM * EADIM] = {0}; + Hea_fun(in_x, in_ea, in_Hea); + ZAM Hea(in_Hea); + XXM A = Hea.transpose().fullPivLu().kernel(); + + + y = A.transpose() * pre_y; + H = A.transpose() * pre_H; + R = A.transpose() * pre_R * A; + } else { + y = pre_y; + H = pre_H; + R = pre_R; + } + // get modified H + H_mod_fun(in_x, in_H_mod); + DEM H_mod(in_H_mod); + XEM H_err = H * H_mod; + + // Do mahalobis distance test + if (MAHA_TEST){ + XXM a = (H_err * P * H_err.transpose() + R).inverse(); + double maha_dist = y.transpose() * a * y; + if (maha_dist > MAHA_THRESHOLD){ + R = 1.0e16 * R; + } + } + + // Outlier resilient weighting + double weight = 1;//(1.5)/(1 + y.squaredNorm()/R.sum()); + + // kalman gains and I_KH + XXM S = ((H_err * P) * H_err.transpose()) + R/weight; + XEM KT = S.fullPivLu().solve(H_err * P.transpose()); + //EZM K = KT.transpose(); TODO: WHY DOES THIS NOT COMPILE? + //EZM K = S.fullPivLu().solve(H_err * P.transpose()).transpose(); + //std::cout << "Here is the matrix rot:\n" << K << std::endl; + EEM I_KH = Eigen::Matrix::Identity() - (KT.transpose() * H_err); + + // update state by injecting dx + Eigen::Matrix dx(delta_x); + dx = (KT.transpose() * y); + memcpy(delta_x, dx.data(), EDIM * sizeof(double)); + err_fun(in_x, delta_x, x_new); + Eigen::Matrix x(x_new); + + // update cov + P = ((I_KH * P) * I_KH.transpose()) + ((KT.transpose() * R) * KT); + + // copy out state + memcpy(in_x, x.data(), DIM * sizeof(double)); + memcpy(in_P, P.data(), EDIM * EDIM * sizeof(double)); + memcpy(in_z, y.data(), y.rows() * sizeof(double)); +} + + + + +} +extern "C" { + +void live_update_4(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<3, 3, 0>(in_x, in_P, h_4, H_4, NULL, in_z, in_R, in_ea, MAHA_THRESH_4); +} +void live_update_9(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<3, 3, 0>(in_x, in_P, h_9, H_9, NULL, in_z, in_R, in_ea, MAHA_THRESH_9); +} +void live_update_10(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<3, 3, 0>(in_x, in_P, h_10, H_10, NULL, in_z, in_R, in_ea, MAHA_THRESH_10); +} +void live_update_12(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<3, 3, 0>(in_x, in_P, h_12, H_12, NULL, in_z, in_R, in_ea, MAHA_THRESH_12); +} +void live_update_31(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<3, 3, 0>(in_x, in_P, h_31, H_31, NULL, in_z, in_R, in_ea, MAHA_THRESH_31); +} +void live_update_32(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<4, 3, 0>(in_x, in_P, h_32, H_32, NULL, in_z, in_R, in_ea, MAHA_THRESH_32); +} +void live_update_13(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<3, 3, 0>(in_x, in_P, h_13, H_13, NULL, in_z, in_R, in_ea, MAHA_THRESH_13); +} +void live_update_14(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<3, 3, 0>(in_x, in_P, h_14, H_14, NULL, in_z, in_R, in_ea, MAHA_THRESH_14); +} +void live_update_33(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { + update<3, 3, 0>(in_x, in_P, h_33, H_33, NULL, in_z, in_R, in_ea, MAHA_THRESH_33); +} +void live_H(double *in_vec, double *out_4028264744687795352) { + H(in_vec, out_4028264744687795352); +} +void live_err_fun(double *nom_x, double *delta_x, double *out_8435331516567488924) { + err_fun(nom_x, delta_x, out_8435331516567488924); +} +void live_inv_err_fun(double *nom_x, double *true_x, double *out_5002002164599025613) { + inv_err_fun(nom_x, true_x, out_5002002164599025613); +} +void live_H_mod_fun(double *state, double *out_3440322527295895629) { + H_mod_fun(state, out_3440322527295895629); +} +void live_f_fun(double *state, double dt, double *out_6600220164658986461) { + f_fun(state, dt, out_6600220164658986461); +} +void live_F_fun(double *state, double dt, double *out_6389863516536335469) { + F_fun(state, dt, out_6389863516536335469); +} +void live_h_4(double *state, double *unused, double *out_7661006871823619503) { + h_4(state, unused, out_7661006871823619503); +} +void live_H_4(double *state, double *unused, double *out_7501541336268905998) { + H_4(state, unused, out_7501541336268905998); +} +void live_h_9(double *state, double *unused, double *out_4926267146494518877) { + h_9(state, unused, out_4926267146494518877); +} +void live_H_9(double *state, double *unused, double *out_7260351689639315353) { + H_9(state, unused, out_7260351689639315353); +} +void live_h_10(double *state, double *unused, double *out_652311280382873356) { + h_10(state, unused, out_652311280382873356); +} +void live_H_10(double *state, double *unused, double *out_6526497181785554798) { + H_10(state, unused, out_6526497181785554798); +} +void live_h_12(double *state, double *unused, double *out_4327059784582922294) { + h_12(state, unused, out_4327059784582922294); +} +void live_H_12(double *state, double *unused, double *out_6880442311221312331) { + H_12(state, unused, out_6880442311221312331); +} +void live_h_31(double *state, double *unused, double *out_5720054282446494434) { + h_31(state, unused, out_5720054282446494434); +} +void live_H_31(double *state, double *unused, double *out_4134879278896298622) { + H_31(state, unused, out_4134879278896298622); +} +void live_h_32(double *state, double *unused, double *out_6542287694810245299) { + h_32(state, unused, out_6542287694810245299); +} +void live_H_32(double *state, double *unused, double *out_587034938909139893) { + H_32(state, unused, out_587034938909139893); +} +void live_h_13(double *state, double *unused, double *out_2498144898772092043) { + h_13(state, unused, out_2498144898772092043); +} +void live_H_13(double *state, double *unused, double *out_482060401086535411) { + H_13(state, unused, out_482060401086535411); +} +void live_h_14(double *state, double *unused, double *out_4926267146494518877) { + h_14(state, unused, out_4926267146494518877); +} +void live_H_14(double *state, double *unused, double *out_7260351689639315353) { + H_14(state, unused, out_7260351689639315353); +} +void live_h_33(double *state, double *unused, double *out_4451523588948760961) { + h_33(state, unused, out_4451523588948760961); +} +void live_H_33(double *state, double *unused, double *out_984322274257441018) { + H_33(state, unused, out_984322274257441018); +} +void live_predict(double *in_x, double *in_P, double *in_Q, double dt) { + predict(in_x, in_P, in_Q, dt); +} +} + +const EKF live = { + .name = "live", + .kinds = { 4, 9, 10, 12, 31, 32, 13, 14, 33 }, + .feature_kinds = { }, + .f_fun = live_f_fun, + .F_fun = live_F_fun, + .err_fun = live_err_fun, + .inv_err_fun = live_inv_err_fun, + .H_mod_fun = live_H_mod_fun, + .predict = live_predict, + .hs = { + { 4, live_h_4 }, + { 9, live_h_9 }, + { 10, live_h_10 }, + { 12, live_h_12 }, + { 31, live_h_31 }, + { 32, live_h_32 }, + { 13, live_h_13 }, + { 14, live_h_14 }, + { 33, live_h_33 }, + }, + .Hs = { + { 4, live_H_4 }, + { 9, live_H_9 }, + { 10, live_H_10 }, + { 12, live_H_12 }, + { 31, live_H_31 }, + { 32, live_H_32 }, + { 13, live_H_13 }, + { 14, live_H_14 }, + { 33, live_H_33 }, + }, + .updates = { + { 4, live_update_4 }, + { 9, live_update_9 }, + { 10, live_update_10 }, + { 12, live_update_12 }, + { 31, live_update_31 }, + { 32, live_update_32 }, + { 13, live_update_13 }, + { 14, live_update_14 }, + { 33, live_update_33 }, + }, + .Hes = { + }, + .sets = { + }, + .extra_routines = { + { "H", live_H }, + }, +}; + +ekf_init(live); diff --git a/selfdrive/locationd/models/generated/live.h b/selfdrive/locationd/models/generated/live.h new file mode 100644 index 000000000..0b59352c9 --- /dev/null +++ b/selfdrive/locationd/models/generated/live.h @@ -0,0 +1,38 @@ +#pragma once +#include "rednose/helpers/common_ekf.h" +extern "C" { +void live_update_4(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void live_update_9(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void live_update_10(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void live_update_12(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void live_update_31(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void live_update_32(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void live_update_13(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void live_update_14(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void live_update_33(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); +void live_H(double *in_vec, double *out_4028264744687795352); +void live_err_fun(double *nom_x, double *delta_x, double *out_8435331516567488924); +void live_inv_err_fun(double *nom_x, double *true_x, double *out_5002002164599025613); +void live_H_mod_fun(double *state, double *out_3440322527295895629); +void live_f_fun(double *state, double dt, double *out_6600220164658986461); +void live_F_fun(double *state, double dt, double *out_6389863516536335469); +void live_h_4(double *state, double *unused, double *out_7661006871823619503); +void live_H_4(double *state, double *unused, double *out_7501541336268905998); +void live_h_9(double *state, double *unused, double *out_4926267146494518877); +void live_H_9(double *state, double *unused, double *out_7260351689639315353); +void live_h_10(double *state, double *unused, double *out_652311280382873356); +void live_H_10(double *state, double *unused, double *out_6526497181785554798); +void live_h_12(double *state, double *unused, double *out_4327059784582922294); +void live_H_12(double *state, double *unused, double *out_6880442311221312331); +void live_h_31(double *state, double *unused, double *out_5720054282446494434); +void live_H_31(double *state, double *unused, double *out_4134879278896298622); +void live_h_32(double *state, double *unused, double *out_6542287694810245299); +void live_H_32(double *state, double *unused, double *out_587034938909139893); +void live_h_13(double *state, double *unused, double *out_2498144898772092043); +void live_H_13(double *state, double *unused, double *out_482060401086535411); +void live_h_14(double *state, double *unused, double *out_4926267146494518877); +void live_H_14(double *state, double *unused, double *out_7260351689639315353); +void live_h_33(double *state, double *unused, double *out_4451523588948760961); +void live_H_33(double *state, double *unused, double *out_984322274257441018); +void live_predict(double *in_x, double *in_P, double *in_Q, double dt); +} \ No newline at end of file diff --git a/selfdrive/locationd/models/generated/live_kf_constants.h b/selfdrive/locationd/models/generated/live_kf_constants.h new file mode 100644 index 000000000..3ee5fb13a --- /dev/null +++ b/selfdrive/locationd/models/generated/live_kf_constants.h @@ -0,0 +1,101 @@ +#pragma once + +#include +#include + +#define STATE_ACCELERATION_START 16 +#define STATE_ACCELERATION_END 19 +#define STATE_ACCELERATION_LEN 3 +#define STATE_ACCELERATION_ERR_START 15 +#define STATE_ACCELERATION_ERR_END 18 +#define STATE_ACCELERATION_ERR_LEN 3 +#define STATE_ACC_BIAS_START 19 +#define STATE_ACC_BIAS_END 22 +#define STATE_ACC_BIAS_LEN 3 +#define STATE_ACC_BIAS_ERR_START 18 +#define STATE_ACC_BIAS_ERR_END 21 +#define STATE_ACC_BIAS_ERR_LEN 3 +#define STATE_ANGULAR_VELOCITY_START 10 +#define STATE_ANGULAR_VELOCITY_END 13 +#define STATE_ANGULAR_VELOCITY_LEN 3 +#define STATE_ANGULAR_VELOCITY_ERR_START 9 +#define STATE_ANGULAR_VELOCITY_ERR_END 12 +#define STATE_ANGULAR_VELOCITY_ERR_LEN 3 +#define STATE_ECEF_ORIENTATION_START 3 +#define STATE_ECEF_ORIENTATION_END 7 +#define STATE_ECEF_ORIENTATION_LEN 4 +#define STATE_ECEF_ORIENTATION_ERR_START 3 +#define STATE_ECEF_ORIENTATION_ERR_END 6 +#define STATE_ECEF_ORIENTATION_ERR_LEN 3 +#define STATE_ECEF_POS_START 0 +#define STATE_ECEF_POS_END 3 +#define STATE_ECEF_POS_LEN 3 +#define STATE_ECEF_POS_ERR_START 0 +#define STATE_ECEF_POS_ERR_END 3 +#define STATE_ECEF_POS_ERR_LEN 3 +#define STATE_ECEF_VELOCITY_START 7 +#define STATE_ECEF_VELOCITY_END 10 +#define STATE_ECEF_VELOCITY_LEN 3 +#define STATE_ECEF_VELOCITY_ERR_START 6 +#define STATE_ECEF_VELOCITY_ERR_END 9 +#define STATE_ECEF_VELOCITY_ERR_LEN 3 +#define STATE_GYRO_BIAS_START 13 +#define STATE_GYRO_BIAS_END 16 +#define STATE_GYRO_BIAS_LEN 3 +#define STATE_GYRO_BIAS_ERR_START 12 +#define STATE_GYRO_BIAS_ERR_END 15 +#define STATE_GYRO_BIAS_ERR_LEN 3 + +#define OBSERVATION_ANGLE_OFFSET_FAST 27 +#define OBSERVATION_CAMERA_ODO_ROTATION 14 +#define OBSERVATION_CAMERA_ODO_TRANSLATION 13 +#define OBSERVATION_ECEF_ORIENTATION_FROM_GPS 32 +#define OBSERVATION_ECEF_POS 12 +#define OBSERVATION_ECEF_VEL 31 +#define OBSERVATION_FEATURE_TRACK_TEST 17 +#define OBSERVATION_GPS_NED 2 +#define OBSERVATION_GPS_VEL 5 +#define OBSERVATION_IMU_FRAME 19 +#define OBSERVATION_LANE_PT 18 +#define OBSERVATION_MSCKF_TEST 16 +#define OBSERVATION_NO_ACCEL 33 +#define OBSERVATION_NO_OBSERVATION 1 +#define OBSERVATION_NO_ROT 9 +#define OBSERVATION_ODOMETRIC_SPEED 3 +#define OBSERVATION_ORB_FEATURES 15 +#define OBSERVATION_ORB_POINT 11 +#define OBSERVATION_PHONE_ACCEL 10 +#define OBSERVATION_PHONE_GYRO 4 +#define OBSERVATION_PSEUDORANGE 22 +#define OBSERVATION_PSEUDORANGE_GLONASS 20 +#define OBSERVATION_PSEUDORANGE_GPS 6 +#define OBSERVATION_PSEUDORANGE_RATE 23 +#define OBSERVATION_PSEUDORANGE_RATE_GLONASS 21 +#define OBSERVATION_PSEUDORANGE_RATE_GPS 7 +#define OBSERVATION_ROAD_FRAME_XY_SPEED 24 +#define OBSERVATION_ROAD_FRAME_X_SPEED 30 +#define OBSERVATION_ROAD_FRAME_YAW_RATE 25 +#define OBSERVATION_ROAD_ROLL 31 +#define OBSERVATION_SPEED 8 +#define OBSERVATION_STEER_ANGLE 26 +#define OBSERVATION_STEER_RATIO 29 +#define OBSERVATION_STIFFNESS 28 +#define OBSERVATION_UNKNOWN 0 + +static const Eigen::VectorXd live_initial_x = (Eigen::VectorXd(22) << 3.8800000e+06,-3.3700000e+06,3.7600000e+06,4.2254641e-01,-3.1238054e-01,-8.3602975e-01,-1.5788347e-01,0.0000000e+00,0.0000000e+00,0.0000000e+00,0.0000000e+00,0.0000000e+00,0.0000000e+00,0.0000000e+00,0.0000000e+00,0.0000000e+00,0.0000000e+00,0.0000000e+00,0.0000000e+00,0.0000000e+00,0.0000000e+00,0.0000000e+00).finished(); +static const Eigen::VectorXd live_initial_P_diag = (Eigen::VectorXd(21) << 1.e+02,1.e+02,1.e+02,1.e-04,1.e-04,1.e-04,1.e+02,1.e+02,1.e+02,1.e+00,1.e+00,1.e+00,1.e+00,1.e+00,1.e+00,1.e+04,1.e+04,1.e+04,1.e-04,1.e-04,1.e-04).finished(); +static const Eigen::VectorXd live_fake_gps_pos_cov_diag = (Eigen::VectorXd(3) << 1000000,1000000,1000000).finished(); +static const Eigen::VectorXd live_fake_gps_vel_cov_diag = (Eigen::VectorXd(3) << 100,100,100).finished(); +static const Eigen::VectorXd live_reset_orientation_diag = (Eigen::VectorXd(3) << 1,1,1).finished(); +static const Eigen::VectorXd live_Q_diag = (Eigen::VectorXd(21) << 8.9999999999999998e-04,8.9999999999999998e-04,8.9999999999999998e-04,9.9999999999999995e-07,9.9999999999999995e-07,9.9999999999999995e-07,1.0000000000000000e-04,1.0000000000000000e-04,1.0000000000000000e-04,1.0000000000000002e-02,1.0000000000000002e-02,1.0000000000000002e-02,2.5000000000000001e-09,2.5000000000000001e-09,2.5000000000000001e-09,9.0000000000000000e+00,9.0000000000000000e+00,9.0000000000000000e+00,2.5000000000000001e-05,2.5000000000000001e-05,2.5000000000000001e-05).finished(); +static const std::unordered_map> live_obs_noise_diag = { + { 4, (Eigen::VectorXd(3) << 0.0006250000000000001,0.0006250000000000001,0.0006250000000000001).finished() }, + { 10, (Eigen::VectorXd(3) << 0.25,0.25,0.25).finished() }, + { 14, (Eigen::VectorXd(3) << 0.0025000000000000005,0.0025000000000000005,0.0025000000000000005).finished() }, + { 9, (Eigen::VectorXd(3) << 2.5e-05,2.5e-05,2.5e-05).finished() }, + { 33, (Eigen::VectorXd(3) << 0.0025000000000000005,0.0025000000000000005,0.0025000000000000005).finished() }, + { 12, (Eigen::VectorXd(3) << 25,25,25).finished() }, + { 31, (Eigen::VectorXd(3) << 0.25,0.25,0.25).finished() }, + { 32, (Eigen::VectorXd(4) << 0.04000000000000001,0.04000000000000001,0.04000000000000001,0.04000000000000001).finished() }, +}; + diff --git a/selfdrive/locationd/models/live_kf.cc b/selfdrive/locationd/models/live_kf.cc new file mode 100755 index 000000000..5ff0f2699 --- /dev/null +++ b/selfdrive/locationd/models/live_kf.cc @@ -0,0 +1,122 @@ +#include "live_kf.h" + +using namespace EKFS; +using namespace Eigen; + +Eigen::Map get_mapvec(Eigen::VectorXd& vec) { + return Eigen::Map(vec.data(), vec.rows(), vec.cols()); +} + +Eigen::Map get_mapmat(MatrixXdr& mat) { + return Eigen::Map(mat.data(), mat.rows(), mat.cols()); +} + +std::vector> get_vec_mapvec(std::vector& vec_vec) { + std::vector> res; + for (Eigen::VectorXd& vec : vec_vec) { + res.push_back(get_mapvec(vec)); + } + return res; +} + +std::vector> get_vec_mapmat(std::vector& mat_vec) { + std::vector> res; + for (MatrixXdr& mat : mat_vec) { + res.push_back(get_mapmat(mat)); + } + return res; +} + +LiveKalman::LiveKalman() { + this->dim_state = live_initial_x.rows(); + this->dim_state_err = live_initial_P_diag.rows(); + + this->initial_x = live_initial_x; + this->initial_P = live_initial_P_diag.asDiagonal(); + this->fake_gps_pos_cov = live_fake_gps_pos_cov_diag.asDiagonal(); + this->fake_gps_vel_cov = live_fake_gps_vel_cov_diag.asDiagonal(); + this->reset_orientation_P = live_reset_orientation_diag.asDiagonal(); + this->Q = live_Q_diag.asDiagonal(); + for (auto& pair : live_obs_noise_diag) { + this->obs_noise[pair.first] = pair.second.asDiagonal(); + } + + // init filter + this->filter = std::make_shared(this->name, get_mapmat(this->Q), get_mapvec(this->initial_x), + get_mapmat(initial_P), this->dim_state, this->dim_state_err, 0, 0, 0, std::vector(), + std::vector{3}, std::vector(), 0.2); +} + +void LiveKalman::init_state(VectorXd& state, VectorXd& covs_diag, double filter_time) { + MatrixXdr covs = covs_diag.asDiagonal(); + this->filter->init_state(get_mapvec(state), get_mapmat(covs), filter_time); +} + +void LiveKalman::init_state(VectorXd& state, MatrixXdr& covs, double filter_time) { + this->filter->init_state(get_mapvec(state), get_mapmat(covs), filter_time); +} + +void LiveKalman::init_state(VectorXd& state, double filter_time) { + MatrixXdr covs = this->filter->covs(); + this->filter->init_state(get_mapvec(state), get_mapmat(covs), filter_time); +} + +VectorXd LiveKalman::get_x() { + return this->filter->state(); +} + +MatrixXdr LiveKalman::get_P() { + return this->filter->covs(); +} + +double LiveKalman::get_filter_time() { + return this->filter->get_filter_time(); +} + +std::vector LiveKalman::get_R(int kind, int n) { + std::vector R; + for (int i = 0; i < n; i++) { + R.push_back(this->obs_noise[kind]); + } + return R; +} + +std::optional LiveKalman::predict_and_observe(double t, int kind, std::vector meas, std::vector R) { + std::optional r; + if (R.size() == 0) { + R = this->get_R(kind, meas.size()); + } + r = this->filter->predict_and_update_batch(t, kind, get_vec_mapvec(meas), get_vec_mapmat(R)); + return r; +} + +void LiveKalman::predict(double t) { + this->filter->predict(t); +} + +Eigen::VectorXd LiveKalman::get_initial_x() { + return this->initial_x; +} + +MatrixXdr LiveKalman::get_initial_P() { + return this->initial_P; +} + +MatrixXdr LiveKalman::get_fake_gps_pos_cov() { + return this->fake_gps_pos_cov; +} + +MatrixXdr LiveKalman::get_fake_gps_vel_cov() { + return this->fake_gps_vel_cov; +} + +MatrixXdr LiveKalman::get_reset_orientation_P() { + return this->reset_orientation_P; +} + +MatrixXdr LiveKalman::H(VectorXd in) { + assert(in.size() == 6); + Matrix res; + this->filter->get_extra_routine("H")(in.data(), res.data()); + return res; +} diff --git a/selfdrive/locationd/models/live_kf.h b/selfdrive/locationd/models/live_kf.h new file mode 100755 index 000000000..06ec3854c --- /dev/null +++ b/selfdrive/locationd/models/live_kf.h @@ -0,0 +1,64 @@ +#pragma once + +#include +#include +#include + +#include +#include + +#include "generated/live_kf_constants.h" +#include "rednose/helpers/ekf_sym.h" + +#define EARTH_GM 3.986005e14 // m^3/s^2 (gravitational constant * mass of earth) + +using namespace EKFS; + +Eigen::Map get_mapvec(Eigen::VectorXd& vec); +Eigen::Map get_mapmat(MatrixXdr& mat); +std::vector> get_vec_mapvec(std::vector& vec_vec); +std::vector> get_vec_mapmat(std::vector& mat_vec); + +class LiveKalman { +public: + LiveKalman(); + + void init_state(Eigen::VectorXd& state, Eigen::VectorXd& covs_diag, double filter_time); + void init_state(Eigen::VectorXd& state, MatrixXdr& covs, double filter_time); + void init_state(Eigen::VectorXd& state, double filter_time); + + Eigen::VectorXd get_x(); + MatrixXdr get_P(); + double get_filter_time(); + std::vector get_R(int kind, int n); + + std::optional predict_and_observe(double t, int kind, std::vector meas, std::vector R = {}); + std::optional predict_and_update_odo_speed(std::vector speed, double t, int kind); + std::optional predict_and_update_odo_trans(std::vector trans, double t, int kind); + std::optional predict_and_update_odo_rot(std::vector rot, double t, int kind); + void predict(double t); + + Eigen::VectorXd get_initial_x(); + MatrixXdr get_initial_P(); + MatrixXdr get_fake_gps_pos_cov(); + MatrixXdr get_fake_gps_vel_cov(); + MatrixXdr get_reset_orientation_P(); + + MatrixXdr H(Eigen::VectorXd in); + +private: + std::string name = "live"; + + std::shared_ptr filter; + + int dim_state; + int dim_state_err; + + Eigen::VectorXd initial_x; + MatrixXdr initial_P; + MatrixXdr fake_gps_pos_cov; + MatrixXdr fake_gps_vel_cov; + MatrixXdr reset_orientation_P; + MatrixXdr Q; // process noise + std::unordered_map obs_noise; +}; diff --git a/selfdrive/locationd/models/live_kf.py b/selfdrive/locationd/models/live_kf.py new file mode 100755 index 000000000..023479d10 --- /dev/null +++ b/selfdrive/locationd/models/live_kf.py @@ -0,0 +1,242 @@ +#!/usr/bin/env python3 + +import sys +import os +import numpy as np + +from selfdrive.locationd.models.constants import ObservationKind + +import sympy as sp +import inspect +from rednose.helpers.sympy_helpers import euler_rotate, quat_matrix_r, quat_rotate +from rednose.helpers.ekf_sym import gen_code + +EARTH_GM = 3.986005e14 # m^3/s^2 (gravitational constant * mass of earth) + + +def numpy2eigenstring(arr): + assert(len(arr.shape) == 1) + arr_str = np.array2string(arr, precision=20, separator=',')[1:-1].replace(' ', '').replace('\n', '') + return f"(Eigen::VectorXd({len(arr)}) << {arr_str}).finished()" + + +class States(): + ECEF_POS = slice(0, 3) # x, y and z in ECEF in meters + ECEF_ORIENTATION = slice(3, 7) # quat for pose of phone in ecef + ECEF_VELOCITY = slice(7, 10) # ecef velocity in m/s + ANGULAR_VELOCITY = slice(10, 13) # roll, pitch and yaw rates in device frame in radians/s + GYRO_BIAS = slice(13, 16) # roll, pitch and yaw biases + ACCELERATION = slice(16, 19) # Acceleration in device frame in m/s**2 + ACC_BIAS = slice(19, 22) # Acceletometer bias in m/s**2 + + # Error-state has different slices because it is an ESKF + ECEF_POS_ERR = slice(0, 3) + ECEF_ORIENTATION_ERR = slice(3, 6) # euler angles for orientation error + ECEF_VELOCITY_ERR = slice(6, 9) + ANGULAR_VELOCITY_ERR = slice(9, 12) + GYRO_BIAS_ERR = slice(12, 15) + ACCELERATION_ERR = slice(15, 18) + ACC_BIAS_ERR = slice(18, 21) + + +class LiveKalman(): + name = 'live' + + initial_x = np.array([3.88e6, -3.37e6, 3.76e6, + 0.42254641, -0.31238054, -0.83602975, -0.15788347, # NED [0,0,0] -> ECEF Quat + 0, 0, 0, + 0, 0, 0, + 0, 0, 0, + 0, 0, 0, + 0, 0, 0]) + + # state covariance + initial_P_diag = np.array([10**2, 10**2, 10**2, + 0.01**2, 0.01**2, 0.01**2, + 10**2, 10**2, 10**2, + 1**2, 1**2, 1**2, + 1**2, 1**2, 1**2, + 100**2, 100**2, 100**2, + 0.01**2, 0.01**2, 0.01**2]) + + # state covariance when resetting midway in a segment + reset_orientation_diag = np.array([1**2, 1**2, 1**2]) + + # fake observation covariance, to ensure the uncertainty estimate of the filter is under control + fake_gps_pos_cov_diag = np.array([1000**2, 1000**2, 1000**2]) + fake_gps_vel_cov_diag = np.array([10**2, 10**2, 10**2]) + + # process noise + Q_diag = np.array([0.03**2, 0.03**2, 0.03**2, + 0.001**2, 0.001**2, 0.001**2, + 0.01**2, 0.01**2, 0.01**2, + 0.1**2, 0.1**2, 0.1**2, + (0.005 / 100)**2, (0.005 / 100)**2, (0.005 / 100)**2, + 3**2, 3**2, 3**2, + 0.005**2, 0.005**2, 0.005**2]) + + obs_noise_diag = {ObservationKind.PHONE_GYRO: np.array([0.025**2, 0.025**2, 0.025**2]), + ObservationKind.PHONE_ACCEL: np.array([.5**2, .5**2, .5**2]), + ObservationKind.CAMERA_ODO_ROTATION: np.array([0.05**2, 0.05**2, 0.05**2]), + ObservationKind.NO_ROT: np.array([0.005**2, 0.005**2, 0.005**2]), + ObservationKind.NO_ACCEL: np.array([0.05**2, 0.05**2, 0.05**2]), + ObservationKind.ECEF_POS: np.array([5**2, 5**2, 5**2]), + ObservationKind.ECEF_VEL: np.array([.5**2, .5**2, .5**2]), + ObservationKind.ECEF_ORIENTATION_FROM_GPS: np.array([.2**2, .2**2, .2**2, .2**2])} + + @staticmethod + def generate_code(generated_dir): + name = LiveKalman.name + dim_state = LiveKalman.initial_x.shape[0] + dim_state_err = LiveKalman.initial_P_diag.shape[0] + + state_sym = sp.MatrixSymbol('state', dim_state, 1) + state = sp.Matrix(state_sym) + x, y, z = state[States.ECEF_POS, :] + q = state[States.ECEF_ORIENTATION, :] + v = state[States.ECEF_VELOCITY, :] + vx, vy, vz = v + omega = state[States.ANGULAR_VELOCITY, :] + vroll, vpitch, vyaw = omega + roll_bias, pitch_bias, yaw_bias = state[States.GYRO_BIAS, :] + acceleration = state[States.ACCELERATION, :] + acc_bias = state[States.ACC_BIAS, :] + + dt = sp.Symbol('dt') + + # calibration and attitude rotation matrices + quat_rot = quat_rotate(*q) + + # Got the quat predict equations from here + # A New Quaternion-Based Kalman Filter for + # Real-Time Attitude Estimation Using the Two-Step + # Geometrically-Intuitive Correction Algorithm + A = 0.5 * sp.Matrix([[0, -vroll, -vpitch, -vyaw], + [vroll, 0, vyaw, -vpitch], + [vpitch, -vyaw, 0, vroll], + [vyaw, vpitch, -vroll, 0]]) + q_dot = A * q + + # Time derivative of the state as a function of state + state_dot = sp.Matrix(np.zeros((dim_state, 1))) + state_dot[States.ECEF_POS, :] = v + state_dot[States.ECEF_ORIENTATION, :] = q_dot + state_dot[States.ECEF_VELOCITY, 0] = quat_rot * acceleration + + # Basic descretization, 1st order intergrator + # Can be pretty bad if dt is big + f_sym = state + dt * state_dot + + state_err_sym = sp.MatrixSymbol('state_err', dim_state_err, 1) + state_err = sp.Matrix(state_err_sym) + quat_err = state_err[States.ECEF_ORIENTATION_ERR, :] + v_err = state_err[States.ECEF_VELOCITY_ERR, :] + omega_err = state_err[States.ANGULAR_VELOCITY_ERR, :] + acceleration_err = state_err[States.ACCELERATION_ERR, :] + + # Time derivative of the state error as a function of state error and state + quat_err_matrix = euler_rotate(quat_err[0], quat_err[1], quat_err[2]) + q_err_dot = quat_err_matrix * quat_rot * (omega + omega_err) + state_err_dot = sp.Matrix(np.zeros((dim_state_err, 1))) + state_err_dot[States.ECEF_POS_ERR, :] = v_err + state_err_dot[States.ECEF_ORIENTATION_ERR, :] = q_err_dot + state_err_dot[States.ECEF_VELOCITY_ERR, :] = quat_err_matrix * quat_rot * (acceleration + acceleration_err) + f_err_sym = state_err + dt * state_err_dot + + # Observation matrix modifier + H_mod_sym = sp.Matrix(np.zeros((dim_state, dim_state_err))) + H_mod_sym[States.ECEF_POS, States.ECEF_POS_ERR] = np.eye(States.ECEF_POS.stop - States.ECEF_POS.start) + H_mod_sym[States.ECEF_ORIENTATION, States.ECEF_ORIENTATION_ERR] = 0.5 * quat_matrix_r(state[3:7])[:, 1:] + H_mod_sym[States.ECEF_ORIENTATION.stop:, States.ECEF_ORIENTATION_ERR.stop:] = np.eye(dim_state - States.ECEF_ORIENTATION.stop) + + # these error functions are defined so that say there + # is a nominal x and true x: + # true x = err_function(nominal x, delta x) + # delta x = inv_err_function(nominal x, true x) + nom_x = sp.MatrixSymbol('nom_x', dim_state, 1) + true_x = sp.MatrixSymbol('true_x', dim_state, 1) + delta_x = sp.MatrixSymbol('delta_x', dim_state_err, 1) + + err_function_sym = sp.Matrix(np.zeros((dim_state, 1))) + delta_quat = sp.Matrix(np.ones(4)) + delta_quat[1:, :] = sp.Matrix(0.5 * delta_x[States.ECEF_ORIENTATION_ERR, :]) + err_function_sym[States.ECEF_POS, :] = sp.Matrix(nom_x[States.ECEF_POS, :] + delta_x[States.ECEF_POS_ERR, :]) + err_function_sym[States.ECEF_ORIENTATION, 0] = quat_matrix_r(nom_x[States.ECEF_ORIENTATION, 0]) * delta_quat + err_function_sym[States.ECEF_ORIENTATION.stop:, :] = sp.Matrix(nom_x[States.ECEF_ORIENTATION.stop:, :] + delta_x[States.ECEF_ORIENTATION_ERR.stop:, :]) + + inv_err_function_sym = sp.Matrix(np.zeros((dim_state_err, 1))) + inv_err_function_sym[States.ECEF_POS_ERR, 0] = sp.Matrix(-nom_x[States.ECEF_POS, 0] + true_x[States.ECEF_POS, 0]) + delta_quat = quat_matrix_r(nom_x[States.ECEF_ORIENTATION, 0]).T * true_x[States.ECEF_ORIENTATION, 0] + inv_err_function_sym[States.ECEF_ORIENTATION_ERR, 0] = sp.Matrix(2 * delta_quat[1:]) + inv_err_function_sym[States.ECEF_ORIENTATION_ERR.stop:, 0] = sp.Matrix(-nom_x[States.ECEF_ORIENTATION.stop:, 0] + true_x[States.ECEF_ORIENTATION.stop:, 0]) + + eskf_params = [[err_function_sym, nom_x, delta_x], + [inv_err_function_sym, nom_x, true_x], + H_mod_sym, f_err_sym, state_err_sym] + # + # Observation functions + # + h_gyro_sym = sp.Matrix([ + vroll + roll_bias, + vpitch + pitch_bias, + vyaw + yaw_bias]) + + pos = sp.Matrix([x, y, z]) + gravity = quat_rot.T * ((EARTH_GM / ((x**2 + y**2 + z**2)**(3.0 / 2.0))) * pos) + h_acc_sym = (gravity + acceleration + acc_bias) + h_acc_stationary_sym = acceleration + h_phone_rot_sym = sp.Matrix([vroll, vpitch, vyaw]) + h_pos_sym = sp.Matrix([x, y, z]) + h_vel_sym = sp.Matrix([vx, vy, vz]) + h_orientation_sym = q + h_relative_motion = sp.Matrix(quat_rot.T * v) + + obs_eqs = [[h_gyro_sym, ObservationKind.PHONE_GYRO, None], + [h_phone_rot_sym, ObservationKind.NO_ROT, None], + [h_acc_sym, ObservationKind.PHONE_ACCEL, None], + [h_pos_sym, ObservationKind.ECEF_POS, None], + [h_vel_sym, ObservationKind.ECEF_VEL, None], + [h_orientation_sym, ObservationKind.ECEF_ORIENTATION_FROM_GPS, None], + [h_relative_motion, ObservationKind.CAMERA_ODO_TRANSLATION, None], + [h_phone_rot_sym, ObservationKind.CAMERA_ODO_ROTATION, None], + [h_acc_stationary_sym, ObservationKind.NO_ACCEL, None]] + + # this returns a sympy routine for the jacobian of the observation function of the local vel + in_vec = sp.MatrixSymbol('in_vec', 6, 1) # roll, pitch, yaw, vx, vy, vz + h = euler_rotate(in_vec[0], in_vec[1], in_vec[2]).T * (sp.Matrix([in_vec[3], in_vec[4], in_vec[5]])) + extra_routines = [('H', h.jacobian(in_vec), [in_vec])] + + gen_code(generated_dir, name, f_sym, dt, state_sym, obs_eqs, dim_state, dim_state_err, eskf_params, extra_routines=extra_routines) + + # write constants to extra header file for use in cpp + live_kf_header = "#pragma once\n\n" + live_kf_header += "#include \n" + live_kf_header += "#include \n\n" + for state, slc in inspect.getmembers(States, lambda x: type(x) == slice): + assert(slc.step is None) # unsupported + live_kf_header += f'#define STATE_{state}_START {slc.start}\n' + live_kf_header += f'#define STATE_{state}_END {slc.stop}\n' + live_kf_header += f'#define STATE_{state}_LEN {slc.stop - slc.start}\n' + live_kf_header += "\n" + + for kind, val in inspect.getmembers(ObservationKind, lambda x: type(x) == int): + live_kf_header += f'#define OBSERVATION_{kind} {val}\n' + live_kf_header += "\n" + + live_kf_header += f"static const Eigen::VectorXd live_initial_x = {numpy2eigenstring(LiveKalman.initial_x)};\n" + live_kf_header += f"static const Eigen::VectorXd live_initial_P_diag = {numpy2eigenstring(LiveKalman.initial_P_diag)};\n" + live_kf_header += f"static const Eigen::VectorXd live_fake_gps_pos_cov_diag = {numpy2eigenstring(LiveKalman.fake_gps_pos_cov_diag)};\n" + live_kf_header += f"static const Eigen::VectorXd live_fake_gps_vel_cov_diag = {numpy2eigenstring(LiveKalman.fake_gps_vel_cov_diag)};\n" + live_kf_header += f"static const Eigen::VectorXd live_reset_orientation_diag = {numpy2eigenstring(LiveKalman.reset_orientation_diag)};\n" + live_kf_header += f"static const Eigen::VectorXd live_Q_diag = {numpy2eigenstring(LiveKalman.Q_diag)};\n" + live_kf_header += "static const std::unordered_map> live_obs_noise_diag = {\n" + for kind, noise in LiveKalman.obs_noise_diag.items(): + live_kf_header += f" {{ {kind}, {numpy2eigenstring(noise)} }},\n" + live_kf_header += "};\n\n" + + open(os.path.join(generated_dir, "live_kf_constants.h"), 'w').write(live_kf_header) + + +if __name__ == "__main__": + generated_dir = sys.argv[2] + LiveKalman.generate_code(generated_dir) diff --git a/selfdrive/locationd/paramsd.py b/selfdrive/locationd/paramsd.py new file mode 100755 index 000000000..0efb4d04b --- /dev/null +++ b/selfdrive/locationd/paramsd.py @@ -0,0 +1,214 @@ +#!/usr/bin/env python3 +import gc +import math + +import json +import numpy as np + +import cereal.messaging as messaging +from cereal import car +from common.params import Params, put_nonblocking +from common.realtime import set_realtime_priority, DT_MDL +from common.numpy_fast import clip +from selfdrive.locationd.models.car_kf import CarKalman, ObservationKind, States +from selfdrive.locationd.models.constants import GENERATED_DIR +from selfdrive.swaglog import cloudlog + + +MAX_ANGLE_OFFSET_DELTA = 20 * DT_MDL # Max 20 deg/s +ROLL_MAX_DELTA = np.radians(20.0) * DT_MDL # 20deg in 1 second is well within curvature limits +ROLL_MIN, ROLL_MAX = math.radians(-10), math.radians(10) + +class ParamsLearner: + def __init__(self, CP, steer_ratio, stiffness_factor, angle_offset, P_initial=None): + self.kf = CarKalman(GENERATED_DIR, steer_ratio, stiffness_factor, angle_offset, P_initial) + + self.kf.filter.set_global("mass", CP.mass) + self.kf.filter.set_global("rotational_inertia", CP.rotationalInertia) + self.kf.filter.set_global("center_to_front", CP.centerToFront) + self.kf.filter.set_global("center_to_rear", CP.wheelbase - CP.centerToFront) + self.kf.filter.set_global("stiffness_front", CP.tireStiffnessFront) + self.kf.filter.set_global("stiffness_rear", CP.tireStiffnessRear) + + self.active = False + + self.speed = 0.0 + self.roll = 0.0 + self.steering_pressed = False + self.steering_angle = 0.0 + + self.valid = True + + def handle_log(self, t, which, msg): + if which == 'liveLocationKalman': + yaw_rate = msg.angularVelocityCalibrated.value[2] + yaw_rate_std = msg.angularVelocityCalibrated.std[2] + + localizer_roll = msg.orientationNED.value[0] + localizer_roll_std = np.radians(1) if np.isnan(msg.orientationNED.std[0]) else msg.orientationNED.std[0] + roll_valid = msg.orientationNED.valid and ROLL_MIN < localizer_roll < ROLL_MAX + if roll_valid: + roll = localizer_roll + # Experimentally found multiplier of 2 to be best trade-off between stability and accuracy or similar? + roll_std = 2 * localizer_roll_std + else: + # This is done to bound the road roll estimate when localizer values are invalid + roll = 0.0 + roll_std = np.radians(10.0) + self.roll = clip(roll, self.roll - ROLL_MAX_DELTA, self.roll + ROLL_MAX_DELTA) + + yaw_rate_valid = msg.angularVelocityCalibrated.valid + yaw_rate_valid = yaw_rate_valid and 0 < yaw_rate_std < 10 # rad/s + yaw_rate_valid = yaw_rate_valid and abs(yaw_rate) < 1 # rad/s + + if self.active: + if msg.inputsOK and msg.posenetOK: + + if yaw_rate_valid: + self.kf.predict_and_observe(t, + ObservationKind.ROAD_FRAME_YAW_RATE, + np.array([[-yaw_rate]]), + np.array([np.atleast_2d(yaw_rate_std**2)])) + + self.kf.predict_and_observe(t, + ObservationKind.ROAD_ROLL, + np.array([[self.roll]]), + np.array([np.atleast_2d(roll_std**2)])) + self.kf.predict_and_observe(t, ObservationKind.ANGLE_OFFSET_FAST, np.array([[0]])) + + # We observe the current stiffness and steer ratio (with a high observation noise) to bound + # the respective estimate STD. Otherwise the STDs keep increasing, causing rapid changes in the + # states in longer routes (especially straight stretches). + stiffness = float(self.kf.x[States.STIFFNESS]) + steer_ratio = float(self.kf.x[States.STEER_RATIO]) + self.kf.predict_and_observe(t, ObservationKind.STIFFNESS, np.array([[stiffness]])) + self.kf.predict_and_observe(t, ObservationKind.STEER_RATIO, np.array([[steer_ratio]])) + + elif which == 'carState': + self.steering_angle = msg.steeringAngleDeg + self.steering_pressed = msg.steeringPressed + self.speed = msg.vEgo + + in_linear_region = abs(self.steering_angle) < 45 or not self.steering_pressed + self.active = self.speed > 5 and in_linear_region + + if self.active: + self.kf.predict_and_observe(t, ObservationKind.STEER_ANGLE, np.array([[math.radians(msg.steeringAngleDeg)]])) + self.kf.predict_and_observe(t, ObservationKind.ROAD_FRAME_X_SPEED, np.array([[self.speed]])) + + if not self.active: + # Reset time when stopped so uncertainty doesn't grow + self.kf.filter.set_filter_time(t) + self.kf.filter.reset_rewind() + + +def main(sm=None, pm=None): + gc.disable() + set_realtime_priority(5) + + if sm is None: + sm = messaging.SubMaster(['liveLocationKalman', 'carState'], poll=['liveLocationKalman']) + if pm is None: + pm = messaging.PubMaster(['liveParameters']) + + params_reader = Params() + # wait for stats about the car to come in from controls + cloudlog.info("paramsd is waiting for CarParams") + CP = car.CarParams.from_bytes(params_reader.get("CarParams", block=True)) + cloudlog.info("paramsd got CarParams") + + min_sr, max_sr = 0.5 * CP.steerRatio, 2.0 * CP.steerRatio + + params = params_reader.get("LiveParameters") + + # Check if car model matches + if params is not None: + params = json.loads(params) + if params.get('carFingerprint', None) != CP.carFingerprint: + cloudlog.info("Parameter learner found parameters for wrong car.") + params = None + + # Check if starting values are sane + if params is not None: + try: + angle_offset_sane = abs(params.get('angleOffsetAverageDeg')) < 10.0 + steer_ratio_sane = min_sr <= params['steerRatio'] <= max_sr + params_sane = angle_offset_sane and steer_ratio_sane + if not params_sane: + cloudlog.info(f"Invalid starting values found {params}") + params = None + except Exception as e: + cloudlog.info(f"Error reading params {params}: {str(e)}") + params = None + + # TODO: cache the params with the capnp struct + if params is None: + params = { + 'carFingerprint': CP.carFingerprint, + 'steerRatio': CP.steerRatio, + 'stiffnessFactor': 1.0, + 'angleOffsetAverageDeg': 0.0, + } + cloudlog.info("Parameter learner resetting to default values") + + # When driving in wet conditions the stiffness can go down, and then be too low on the next drive + # Without a way to detect this we have to reset the stiffness every drive + params['stiffnessFactor'] = 1.0 + learner = ParamsLearner(CP, params['steerRatio'], params['stiffnessFactor'], math.radians(params['angleOffsetAverageDeg'])) + angle_offset_average = params['angleOffsetAverageDeg'] + angle_offset = angle_offset_average + + while True: + sm.update() + for which in sorted(sm.updated.keys(), key=lambda x: sm.logMonoTime[x]): + if sm.updated[which]: + t = sm.logMonoTime[which] * 1e-9 + learner.handle_log(t, which, sm[which]) + + if sm.updated['liveLocationKalman']: + x = learner.kf.x + P = np.sqrt(learner.kf.P.diagonal()) + if not all(map(math.isfinite, x)): + cloudlog.error("NaN in liveParameters estimate. Resetting to default values") + learner = ParamsLearner(CP, CP.steerRatio, 1.0, 0.0) + x = learner.kf.x + + angle_offset_average = clip(math.degrees(x[States.ANGLE_OFFSET]), angle_offset_average - MAX_ANGLE_OFFSET_DELTA, angle_offset_average + MAX_ANGLE_OFFSET_DELTA) + angle_offset = clip(math.degrees(x[States.ANGLE_OFFSET] + x[States.ANGLE_OFFSET_FAST]), angle_offset - MAX_ANGLE_OFFSET_DELTA, angle_offset + MAX_ANGLE_OFFSET_DELTA) + + msg = messaging.new_message('liveParameters') + msg.logMonoTime = sm.logMonoTime['carState'] + + liveParameters = msg.liveParameters + liveParameters.posenetValid = True + liveParameters.sensorValid = True + liveParameters.steerRatio = float(x[States.STEER_RATIO]) + liveParameters.stiffnessFactor = float(x[States.STIFFNESS]) + liveParameters.roll = float(x[States.ROAD_ROLL]) + liveParameters.angleOffsetAverageDeg = angle_offset_average + liveParameters.angleOffsetDeg = angle_offset + liveParameters.valid = all(( + abs(liveParameters.angleOffsetAverageDeg) < 10.0, + abs(liveParameters.angleOffsetDeg) < 10.0, + 0.2 <= liveParameters.stiffnessFactor <= 5.0, + min_sr <= liveParameters.steerRatio <= max_sr, + )) + liveParameters.steerRatioStd = float(P[States.STEER_RATIO]) + liveParameters.stiffnessFactorStd = float(P[States.STIFFNESS]) + liveParameters.angleOffsetAverageStd = float(P[States.ANGLE_OFFSET]) + liveParameters.angleOffsetFastStd = float(P[States.ANGLE_OFFSET_FAST]) + + if sm.frame % 1200 == 0: # once a minute + params = { + 'carFingerprint': CP.carFingerprint, + 'steerRatio': liveParameters.steerRatio, + 'stiffnessFactor': liveParameters.stiffnessFactor, + 'angleOffsetAverageDeg': liveParameters.angleOffsetAverageDeg, + } + put_nonblocking("LiveParameters", json.dumps(params)) + + pm.send('liveParameters', msg) + + +if __name__ == "__main__": + main() diff --git a/selfdrive/locationd/ublox_msg.cc b/selfdrive/locationd/ublox_msg.cc new file mode 100644 index 000000000..9e32c7b07 --- /dev/null +++ b/selfdrive/locationd/ublox_msg.cc @@ -0,0 +1,345 @@ +#include "ublox_msg.h" + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "selfdrive/common/swaglog.h" + +const double gpsPi = 3.1415926535898; +#define UBLOX_MSG_SIZE(hdr) (*(uint16_t *)&hdr[4]) + +inline static bool bit_to_bool(uint8_t val, int shifts) { + return (bool)(val & (1 << shifts)); +} + +inline int UbloxMsgParser::needed_bytes() { + // Msg header incomplete? + if(bytes_in_parse_buf < ublox::UBLOX_HEADER_SIZE) + return ublox::UBLOX_HEADER_SIZE + ublox::UBLOX_CHECKSUM_SIZE - bytes_in_parse_buf; + uint16_t needed = UBLOX_MSG_SIZE(msg_parse_buf) + ublox::UBLOX_HEADER_SIZE + ublox::UBLOX_CHECKSUM_SIZE; + // too much data + if(needed < (uint16_t)bytes_in_parse_buf) + return -1; + return needed - (uint16_t)bytes_in_parse_buf; +} + +inline bool UbloxMsgParser::valid_cheksum() { + uint8_t ck_a = 0, ck_b = 0; + for(int i = 2; i < bytes_in_parse_buf - ublox::UBLOX_CHECKSUM_SIZE;i++) { + ck_a = (ck_a + msg_parse_buf[i]) & 0xFF; + ck_b = (ck_b + ck_a) & 0xFF; + } + if(ck_a != msg_parse_buf[bytes_in_parse_buf - 2]) { + LOGD("Checksum a mismatch: %02X, %02X", ck_a, msg_parse_buf[6]); + return false; + } + if(ck_b != msg_parse_buf[bytes_in_parse_buf - 1]) { + LOGD("Checksum b mismatch: %02X, %02X", ck_b, msg_parse_buf[7]); + return false; + } + return true; +} + +inline bool UbloxMsgParser::valid() { + return bytes_in_parse_buf >= ublox::UBLOX_HEADER_SIZE + ublox::UBLOX_CHECKSUM_SIZE && + needed_bytes() == 0 && valid_cheksum(); +} + +inline bool UbloxMsgParser::valid_so_far() { + if(bytes_in_parse_buf > 0 && msg_parse_buf[0] != ublox::PREAMBLE1) { + return false; + } + if(bytes_in_parse_buf > 1 && msg_parse_buf[1] != ublox::PREAMBLE2) { + return false; + } + if(needed_bytes() == 0 && !valid()) { + return false; + } + return true; +} + + +bool UbloxMsgParser::add_data(const uint8_t *incoming_data, uint32_t incoming_data_len, size_t &bytes_consumed) { + int needed = needed_bytes(); + if(needed > 0) { + bytes_consumed = std::min((uint32_t)needed, incoming_data_len ); + // Add data to buffer + memcpy(msg_parse_buf + bytes_in_parse_buf, incoming_data, bytes_consumed); + bytes_in_parse_buf += bytes_consumed; + } else { + bytes_consumed = incoming_data_len; + } + + // Validate msg format, detect invalid header and invalid checksum. + while(!valid_so_far() && bytes_in_parse_buf != 0) { + // Corrupted msg, drop a byte. + bytes_in_parse_buf -= 1; + if(bytes_in_parse_buf > 0) + memmove(&msg_parse_buf[0], &msg_parse_buf[1], bytes_in_parse_buf); + } + + // There is redundant data at the end of buffer, reset the buffer. + if(needed_bytes() == -1) { + bytes_in_parse_buf = 0; + } + return valid(); +} + + +std::pair> UbloxMsgParser::gen_msg() { + std::string dat = data(); + kaitai::kstream stream(dat); + + ubx_t ubx_message(&stream); + auto body = ubx_message.body(); + + switch (ubx_message.msg_type()) { + case 0x0107: + return {"gpsLocationExternal", gen_nav_pvt(static_cast(body))}; + break; + case 0x0213: + return {"ubloxGnss", gen_rxm_sfrbx(static_cast(body))}; + break; + case 0x0215: + return {"ubloxGnss", gen_rxm_rawx(static_cast(body))}; + break; + case 0x0a09: + return {"ubloxGnss", gen_mon_hw(static_cast(body))}; + break; + case 0x0a0b: + return {"ubloxGnss", gen_mon_hw2(static_cast(body))}; + break; + default: + LOGE("Unknown message type %x", ubx_message.msg_type()); + return {"ubloxGnss", kj::Array()}; + break; + } +} + + +kj::Array UbloxMsgParser::gen_nav_pvt(ubx_t::nav_pvt_t *msg) { + MessageBuilder msg_builder; + auto gpsLoc = msg_builder.initEvent().initGpsLocationExternal(); + gpsLoc.setSource(cereal::GpsLocationData::SensorSource::UBLOX); + gpsLoc.setFlags(msg->flags()); + gpsLoc.setLatitude(msg->lat() * 1e-07); + gpsLoc.setLongitude(msg->lon() * 1e-07); + gpsLoc.setAltitude(msg->height() * 1e-03); + gpsLoc.setSpeed(msg->g_speed() * 1e-03); + gpsLoc.setBearingDeg(msg->head_mot() * 1e-5); + gpsLoc.setAccuracy(msg->h_acc() * 1e-03); + std::tm timeinfo = std::tm(); + timeinfo.tm_year = msg->year() - 1900; + timeinfo.tm_mon = msg->month() - 1; + timeinfo.tm_mday = msg->day(); + timeinfo.tm_hour = msg->hour(); + timeinfo.tm_min = msg->min(); + timeinfo.tm_sec = msg->sec(); + + std::time_t utc_tt = timegm(&timeinfo); + gpsLoc.setTimestamp(utc_tt * 1e+03 + msg->nano() * 1e-06); + float f[] = { msg->vel_n() * 1e-03f, msg->vel_e() * 1e-03f, msg->vel_d() * 1e-03f }; + gpsLoc.setVNED(f); + gpsLoc.setVerticalAccuracy(msg->v_acc() * 1e-03); + gpsLoc.setSpeedAccuracy(msg->s_acc() * 1e-03); + gpsLoc.setBearingAccuracyDeg(msg->head_acc() * 1e-05); + return capnp::messageToFlatArray(msg_builder); +} + + +kj::Array UbloxMsgParser::gen_rxm_sfrbx(ubx_t::rxm_sfrbx_t *msg) { + auto body = *msg->body(); + + if (msg->gnss_id() == ubx_t::gnss_type_t::GNSS_TYPE_GPS) { + // GPS subframes are packed into 10x 4 bytes, each containing 3 actual bytes + // We will first need to separate the data from the padding and parity + assert(body.size() == 10); + + std::string subframe_data; + subframe_data.reserve(30); + for (uint32_t word : body) { + word = word >> 6; // TODO: Verify parity + subframe_data.push_back(word >> 16); + subframe_data.push_back(word >> 8); + subframe_data.push_back(word >> 0); + } + + // Collect subframes in map and parse when we have all the parts + { + kaitai::kstream stream(subframe_data); + gps_t subframe(&stream); + int subframe_id = subframe.how()->subframe_id(); + + if (subframe_id == 1) gps_subframes[msg->sv_id()].clear(); + gps_subframes[msg->sv_id()][subframe_id] = subframe_data; + } + + if (gps_subframes[msg->sv_id()].size() == 5) { + MessageBuilder msg_builder; + auto eph = msg_builder.initEvent().initUbloxGnss().initEphemeris(); + eph.setSvId(msg->sv_id()); + + // Subframe 1 + { + kaitai::kstream stream(gps_subframes[msg->sv_id()][1]); + gps_t subframe(&stream); + gps_t::subframe_1_t* subframe_1 = static_cast(subframe.body()); + + eph.setGpsWeek(subframe_1->week_no()); + eph.setTgd(subframe_1->t_gd() * pow(2, -31)); + eph.setToc(subframe_1->t_oc() * pow(2, 4)); + eph.setAf2(subframe_1->af_2() * pow(2, -55)); + eph.setAf1(subframe_1->af_1() * pow(2, -43)); + eph.setAf0(subframe_1->af_0() * pow(2, -31)); + } + + // Subframe 2 + { + kaitai::kstream stream(gps_subframes[msg->sv_id()][2]); + gps_t subframe(&stream); + gps_t::subframe_2_t* subframe_2 = static_cast(subframe.body()); + + eph.setCrs(subframe_2->c_rs() * pow(2, -5)); + eph.setDeltaN(subframe_2->delta_n() * pow(2, -43) * gpsPi); + eph.setM0(subframe_2->m_0() * pow(2, -31) * gpsPi); + eph.setCuc(subframe_2->c_uc() * pow(2, -29)); + eph.setEcc(subframe_2->e() * pow(2, -33)); + eph.setCus(subframe_2->c_us() * pow(2, -29)); + eph.setA(pow(subframe_2->sqrt_a() * pow(2, -19), 2.0)); + eph.setToe(subframe_2->t_oe() * pow(2, 4)); + } + + // Subframe 3 + { + kaitai::kstream stream(gps_subframes[msg->sv_id()][3]); + gps_t subframe(&stream); + gps_t::subframe_3_t* subframe_3 = static_cast(subframe.body()); + + eph.setCic(subframe_3->c_ic() * pow(2, -29)); + eph.setOmega0(subframe_3->omega_0() * pow(2, -31) * gpsPi); + eph.setCis(subframe_3->c_is() * pow(2, -29)); + eph.setI0(subframe_3->i_0() * pow(2, -31) * gpsPi); + eph.setCrc(subframe_3->c_rc() * pow(2, -5)); + eph.setOmega(subframe_3->omega() * pow(2, -31) * gpsPi); + eph.setOmegaDot(subframe_3->omega_dot() * pow(2, -43) * gpsPi); + eph.setIode(subframe_3->iode()); + eph.setIDot(subframe_3->idot() * pow(2, -43) * gpsPi); + } + + // Subframe 4 + { + kaitai::kstream stream(gps_subframes[msg->sv_id()][4]); + gps_t subframe(&stream); + gps_t::subframe_4_t* subframe_4 = static_cast(subframe.body()); + + // This is page 18, why is the page id 56? + if (subframe_4->data_id() == 1 && subframe_4->page_id() == 56) { + auto iono = static_cast(subframe_4->body()); + double a0 = iono->a0() * pow(2, -30); + double a1 = iono->a1() * pow(2, -27); + double a2 = iono->a2() * pow(2, -24); + double a3 = iono->a3() * pow(2, -24); + eph.setIonoAlpha({a0, a1, a2, a3}); + + double b0 = iono->b0() * pow(2, 11); + double b1 = iono->b1() * pow(2, 14); + double b2 = iono->b2() * pow(2, 16); + double b3 = iono->b3() * pow(2, 16); + eph.setIonoBeta({b0, b1, b2, b3}); + } + } + + return capnp::messageToFlatArray(msg_builder); + } + } + return kj::Array(); +} + +kj::Array UbloxMsgParser::gen_rxm_rawx(ubx_t::rxm_rawx_t *msg) { + MessageBuilder msg_builder; + auto mr = msg_builder.initEvent().initUbloxGnss().initMeasurementReport(); + mr.setRcvTow(msg->rcv_tow()); + mr.setGpsWeek(msg->week()); + mr.setLeapSeconds(msg->leap_s()); + mr.setGpsWeek(msg->week()); + + auto mb = mr.initMeasurements(msg->num_meas()); + auto measurements = *msg->measurements(); + for(int8_t i = 0; i < msg->num_meas(); i++) { + mb[i].setSvId(measurements[i]->sv_id()); + mb[i].setPseudorange(measurements[i]->pr_mes()); + mb[i].setCarrierCycles(measurements[i]->cp_mes()); + mb[i].setDoppler(measurements[i]->do_mes()); + mb[i].setGnssId(measurements[i]->gnss_id()); + mb[i].setGlonassFrequencyIndex(measurements[i]->freq_id()); + mb[i].setLocktime(measurements[i]->lock_time()); + mb[i].setCno(measurements[i]->cno()); + mb[i].setPseudorangeStdev(0.01 * (pow(2, (measurements[i]->pr_stdev() & 15)))); // weird scaling, might be wrong + mb[i].setCarrierPhaseStdev(0.004 * (measurements[i]->cp_stdev() & 15)); + mb[i].setDopplerStdev(0.002 * (pow(2, (measurements[i]->do_stdev() & 15)))); // weird scaling, might be wrong + + auto ts = mb[i].initTrackingStatus(); + auto trk_stat = measurements[i]->trk_stat(); + ts.setPseudorangeValid(bit_to_bool(trk_stat, 0)); + ts.setCarrierPhaseValid(bit_to_bool(trk_stat, 1)); + ts.setHalfCycleValid(bit_to_bool(trk_stat, 2)); + ts.setHalfCycleSubtracted(bit_to_bool(trk_stat, 3)); + } + + mr.setNumMeas(msg->num_meas()); + auto rs = mr.initReceiverStatus(); + rs.setLeapSecValid(bit_to_bool(msg->rec_stat(), 0)); + rs.setClkReset(bit_to_bool(msg->rec_stat(), 2)); + return capnp::messageToFlatArray(msg_builder); +} + +kj::Array UbloxMsgParser::gen_mon_hw(ubx_t::mon_hw_t *msg) { + MessageBuilder msg_builder; + auto hwStatus = msg_builder.initEvent().initUbloxGnss().initHwStatus(); + hwStatus.setNoisePerMS(msg->noise_per_ms()); + hwStatus.setFlags(msg->flags()); + hwStatus.setAgcCnt(msg->agc_cnt()); + hwStatus.setAStatus((cereal::UbloxGnss::HwStatus::AntennaSupervisorState) msg->a_status()); + hwStatus.setAPower((cereal::UbloxGnss::HwStatus::AntennaPowerStatus) msg->a_power()); + hwStatus.setJamInd(msg->jam_ind()); + return capnp::messageToFlatArray(msg_builder); +} + +kj::Array UbloxMsgParser::gen_mon_hw2(ubx_t::mon_hw2_t *msg) { + MessageBuilder msg_builder; + auto hwStatus = msg_builder.initEvent().initUbloxGnss().initHwStatus2(); + hwStatus.setOfsI(msg->ofs_i()); + hwStatus.setMagI(msg->mag_i()); + hwStatus.setOfsQ(msg->ofs_q()); + hwStatus.setMagQ(msg->mag_q()); + + switch (msg->cfg_source()) { + case ubx_t::mon_hw2_t::config_source_t::CONFIG_SOURCE_ROM: + hwStatus.setCfgSource(cereal::UbloxGnss::HwStatus2::ConfigSource::ROM); + break; + case ubx_t::mon_hw2_t::config_source_t::CONFIG_SOURCE_OTP: + hwStatus.setCfgSource(cereal::UbloxGnss::HwStatus2::ConfigSource::OTP); + break; + case ubx_t::mon_hw2_t::config_source_t::CONFIG_SOURCE_CONFIG_PINS: + hwStatus.setCfgSource(cereal::UbloxGnss::HwStatus2::ConfigSource::CONFIGPINS); + break; + case ubx_t::mon_hw2_t::config_source_t::CONFIG_SOURCE_FLASH: + hwStatus.setCfgSource(cereal::UbloxGnss::HwStatus2::ConfigSource::FLASH); + break; + default: + hwStatus.setCfgSource(cereal::UbloxGnss::HwStatus2::ConfigSource::UNDEFINED); + break; + } + + hwStatus.setLowLevCfg(msg->low_lev_cfg()); + hwStatus.setPostStatus(msg->post_status()); + + return capnp::messageToFlatArray(msg_builder); +} diff --git a/selfdrive/locationd/ublox_msg.h b/selfdrive/locationd/ublox_msg.h new file mode 100644 index 000000000..da1c180c0 --- /dev/null +++ b/selfdrive/locationd/ublox_msg.h @@ -0,0 +1,111 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "cereal/messaging/messaging.h" +#include "selfdrive/common/util.h" +#include "selfdrive/locationd/generated/gps.h" +#include "selfdrive/locationd/generated/ubx.h" + +using namespace std::string_literals; + +// protocol constants +namespace ublox { + const uint8_t PREAMBLE1 = 0xb5; + const uint8_t PREAMBLE2 = 0x62; + + const int UBLOX_HEADER_SIZE = 6; + const int UBLOX_CHECKSUM_SIZE = 2; + const int UBLOX_MAX_MSG_SIZE = 65536; + + struct ubx_mga_ini_time_utc_t { + uint8_t type; + uint8_t version; + uint8_t ref; + int8_t leapSecs; + uint16_t year; + uint8_t month; + uint8_t day; + uint8_t hour; + uint8_t minute; + uint8_t second; + uint8_t reserved1; + uint32_t ns; + uint16_t tAccS; + uint16_t reserved2; + uint32_t tAccNs; + } __attribute__((packed)); + + inline std::string ubx_add_checksum(const std::string &msg) { + assert(msg.size() > 2); + + uint8_t ck_a = 0, ck_b = 0; + for(int i = 2; i < msg.size(); i++) { + ck_a = (ck_a + msg[i]) & 0xFF; + ck_b = (ck_b + ck_a) & 0xFF; + } + + std::string r = msg; + r.push_back(ck_a); + r.push_back(ck_b); + return r; + } + + inline std::string build_ubx_mga_ini_time_utc(struct tm time) { + ublox::ubx_mga_ini_time_utc_t payload = { + .type = 0x10, + .version = 0x0, + .ref = 0x0, + .leapSecs = -128, // Unknown + .year = (uint16_t)(1900 + time.tm_year), + .month = (uint8_t)(1 + time.tm_mon), + .day = (uint8_t)time.tm_mday, + .hour = (uint8_t)time.tm_hour, + .minute = (uint8_t)time.tm_min, + .second = (uint8_t)time.tm_sec, + .reserved1 = 0x0, + .ns = 0, + .tAccS = 30, + .reserved2 = 0x0, + .tAccNs = 0, + }; + assert(sizeof(payload) == 24); + + std::string msg = "\xb5\x62\x13\x40\x18\x00"s; + msg += std::string((char*)&payload, sizeof(payload)); + + return ubx_add_checksum(msg); + } +} + +class UbloxMsgParser { + public: + bool add_data(const uint8_t *incoming_data, uint32_t incoming_data_len, size_t &bytes_consumed); + inline void reset() {bytes_in_parse_buf = 0;} + inline int needed_bytes(); + inline std::string data() {return std::string((const char*)msg_parse_buf, bytes_in_parse_buf);} + + std::pair> gen_msg(); + kj::Array gen_nav_pvt(ubx_t::nav_pvt_t *msg); + kj::Array gen_rxm_sfrbx(ubx_t::rxm_sfrbx_t *msg); + kj::Array gen_rxm_rawx(ubx_t::rxm_rawx_t *msg); + kj::Array gen_mon_hw(ubx_t::mon_hw_t *msg); + kj::Array gen_mon_hw2(ubx_t::mon_hw2_t *msg); + + private: + inline bool valid_cheksum(); + inline bool valid(); + inline bool valid_so_far(); + + std::unordered_map> gps_subframes; + + size_t bytes_in_parse_buf = 0; + uint8_t msg_parse_buf[ublox::UBLOX_HEADER_SIZE + ublox::UBLOX_MAX_MSG_SIZE]; + +}; + diff --git a/selfdrive/locationd/ubloxd b/selfdrive/locationd/ubloxd new file mode 100755 index 000000000..59a533e98 Binary files /dev/null and b/selfdrive/locationd/ubloxd differ diff --git a/selfdrive/locationd/ubloxd.cc b/selfdrive/locationd/ubloxd.cc new file mode 100644 index 000000000..ae07284c8 --- /dev/null +++ b/selfdrive/locationd/ubloxd.cc @@ -0,0 +1,64 @@ +#include + +#include + +#include "cereal/messaging/messaging.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/util.h" +#include "selfdrive/locationd/ublox_msg.h" + +ExitHandler do_exit; +using namespace ublox; + +int main() { + LOGW("starting ubloxd"); + AlignedBuffer aligned_buf; + UbloxMsgParser parser; + + PubMaster pm({"ubloxGnss", "gpsLocationExternal"}); + + std::unique_ptr context(Context::create()); + std::unique_ptr subscriber(SubSocket::create(context.get(), "ubloxRaw")); + assert(subscriber != NULL); + subscriber->setTimeout(100); + + + while (!do_exit) { + std::unique_ptr msg(subscriber->receive()); + if (!msg) { + if (errno == EINTR) { + do_exit = true; + } + continue; + } + + capnp::FlatArrayMessageReader cmsg(aligned_buf.align(msg.get())); + cereal::Event::Reader event = cmsg.getRoot(); + auto ubloxRaw = event.getUbloxRaw(); + + const uint8_t *data = ubloxRaw.begin(); + size_t len = ubloxRaw.size(); + size_t bytes_consumed = 0; + + while(bytes_consumed < len && !do_exit) { + size_t bytes_consumed_this_time = 0U; + if(parser.add_data(data + bytes_consumed, (uint32_t)(len - bytes_consumed), bytes_consumed_this_time)) { + + try { + auto ublox_msg = parser.gen_msg(); + if (ublox_msg.second.size() > 0) { + auto bytes = ublox_msg.second.asBytes(); + pm.send(ublox_msg.first.c_str(), bytes.begin(), bytes.size()); + } + } catch (const std::exception& e) { + LOGE("Error parsing ublox message %s", e.what()); + } + + parser.reset(); + } + bytes_consumed += bytes_consumed_this_time; + } + } + + return 0; +} diff --git a/selfdrive/logcatd/SConscript b/selfdrive/logcatd/SConscript new file mode 100644 index 000000000..8811f32fe --- /dev/null +++ b/selfdrive/logcatd/SConscript @@ -0,0 +1,6 @@ +Import('env', 'cereal', 'messaging', 'common', 'arch') + +if arch == "aarch64": + env.Program('logcatd', 'logcatd_android.cc', LIBS=[cereal, messaging, common, 'cutils', 'zmq', 'capnp', 'kj']) +else: + env.Program('logcatd', 'logcatd_systemd.cc', LIBS=[cereal, messaging, common, 'zmq', 'capnp', 'kj', 'systemd', 'json11']) diff --git a/selfdrive/logcatd/logcatd b/selfdrive/logcatd/logcatd new file mode 100755 index 000000000..386f6304e Binary files /dev/null and b/selfdrive/logcatd/logcatd differ diff --git a/selfdrive/logcatd/logcatd_android.cc b/selfdrive/logcatd/logcatd_android.cc new file mode 100644 index 000000000..8c2524d94 --- /dev/null +++ b/selfdrive/logcatd/logcatd_android.cc @@ -0,0 +1,51 @@ +#include +#include +#include +#include + +#include + +#include "cereal/messaging/messaging.h" + +#undef LOG_ID_KERNEL +#define LOG_ID_KERNEL 5 + +int main() { + std::signal(SIGINT, exit); + std::signal(SIGTERM, exit); + setpriority(PRIO_PROCESS, 0, -15); + + // setup android logging + logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0); + assert(logger_list); + for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) { + logger *logger = android_logger_open(logger_list, log_id); + assert(logger); + } + + PubMaster pm({"androidLog"}); + + while (true) { + log_msg log_msg; + int err = android_logger_list_read(logger_list, &log_msg); + if (err <= 0) break; + + AndroidLogEntry entry; + err = android_log_processLogBuffer(&log_msg.entry_v1, &entry); + if (err < 0) continue; + + MessageBuilder msg; + auto androidEntry = msg.initEvent().initAndroidLog(); + androidEntry.setId(log_msg.id()); + androidEntry.setTs(entry.tv_sec * NS_PER_SEC + entry.tv_nsec); + androidEntry.setPriority(entry.priority); + androidEntry.setPid(entry.pid); + androidEntry.setTid(entry.tid); + androidEntry.setTag(entry.tag); + androidEntry.setMessage(entry.message); + pm.send("androidLog", msg); + } + + android_logger_list_free(logger_list); + return 0; +} diff --git a/selfdrive/logcatd/logcatd_systemd.cc b/selfdrive/logcatd/logcatd_systemd.cc new file mode 100644 index 000000000..dabb11adc --- /dev/null +++ b/selfdrive/logcatd/logcatd_systemd.cc @@ -0,0 +1,75 @@ +#include + +#include +#include +#include +#include + +#include "json11.hpp" + +#include "cereal/messaging/messaging.h" +#include "selfdrive/common/timing.h" +#include "selfdrive/common/util.h" + +ExitHandler do_exit; +int main(int argc, char *argv[]) { + + PubMaster pm({"androidLog"}); + + sd_journal *journal; + int err = sd_journal_open(&journal, 0); + assert(err >= 0); + err = sd_journal_get_fd(journal); // needed so sd_journal_wait() works properly if files rotate + assert(err >= 0); + err = sd_journal_seek_tail(journal); + assert(err >= 0); + + // workaround for bug https://github.com/systemd/systemd/issues/9934 + // call sd_journal_previous_skip after sd_journal_seek_tail (like journalctl -f does) to makes things work. + sd_journal_previous_skip(journal, 1); + + while (!do_exit) { + err = sd_journal_next(journal); + assert(err >= 0); + + // Wait for new message if we didn't receive anything + if (err == 0) { + err = sd_journal_wait(journal, 1000 * 1000); + assert (err >= 0); + continue; // Try again + } + + uint64_t timestamp = 0; + err = sd_journal_get_realtime_usec(journal, ×tamp); + assert(err >= 0); + + const void *data; + size_t length; + std::map kv; + + SD_JOURNAL_FOREACH_DATA(journal, data, length) { + std::string str((char*)data, length); + + // Split "KEY=VALUE"" on "=" and put in map + std::size_t found = str.find("="); + if (found != std::string::npos) { + kv[str.substr(0, found)] = str.substr(found + 1, std::string::npos); + } + } + + MessageBuilder msg; + + // Build message + auto androidEntry = msg.initEvent().initAndroidLog(); + androidEntry.setTs(timestamp); + androidEntry.setMessage(json11::Json(kv).dump()); + if (kv.count("_PID")) androidEntry.setPid(std::atoi(kv["_PID"].c_str())); + if (kv.count("PRIORITY")) androidEntry.setPriority(std::atoi(kv["PRIORITY"].c_str())); + if (kv.count("SYSLOG_IDENTIFIER")) androidEntry.setTag(kv["SYSLOG_IDENTIFIER"]); + + pm.send("androidLog", msg); + } + + sd_journal_close(journal); + return 0; +} diff --git a/selfdrive/loggerd/SConscript b/selfdrive/loggerd/SConscript new file mode 100644 index 000000000..76fbcae6c --- /dev/null +++ b/selfdrive/loggerd/SConscript @@ -0,0 +1,33 @@ +Import('env', 'arch', 'cereal', 'messaging', 'common', 'visionipc', 'gpucommon') + + +libs = [common, cereal, messaging, visionipc, + 'zmq', 'capnp', 'kj', 'z', + 'avformat', 'avcodec', 'swscale', 'avutil', + 'yuv', 'bz2', 'OpenCL'] + +src = ['logger.cc', 'loggerd.cc'] +if arch in ["aarch64", "larch64"]: + src += ['omx_encoder.cc'] + libs += ['OmxCore', 'gsl', 'CB'] + gpucommon + if arch == "aarch64": + libs += ['OmxVenc', 'cutils'] + else: + libs += ['pthread'] +else: + src += ['raw_logger.cc'] + libs += ['pthread'] + +if arch == "Darwin": + # fix OpenCL + del libs[libs.index('OpenCL')] + env['FRAMEWORKS'] = ['OpenCL'] + +logger_lib = env.Library('logger', src) +libs.insert(0, logger_lib) + +env.Program('loggerd', ['main.cc'], LIBS=libs) +env.Program('bootlog.cc', LIBS=libs) + +if GetOption('test'): + env.Program('tests/test_logger', ['tests/test_runner.cc', 'tests/test_loggerd.cc', 'tests/test_logger.cc', env.Object('logger_util', '#/selfdrive/ui/replay/util.cc')], LIBS=libs + ['curl', 'crypto']) diff --git a/selfdrive/loggerd/__init__.py b/selfdrive/loggerd/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/loggerd/bootlog b/selfdrive/loggerd/bootlog new file mode 100755 index 000000000..1ffb5614f Binary files /dev/null and b/selfdrive/loggerd/bootlog differ diff --git a/selfdrive/loggerd/bootlog.cc b/selfdrive/loggerd/bootlog.cc new file mode 100644 index 000000000..c5897091d --- /dev/null +++ b/selfdrive/loggerd/bootlog.cc @@ -0,0 +1,72 @@ +#include +#include + +#include "cereal/messaging/messaging.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/loggerd/logger.h" + + +static kj::Array build_boot_log() { + std::vector bootlog_commands; + if (Hardware::TICI()) { + bootlog_commands.push_back("journalctl"); + bootlog_commands.push_back("sudo nvme smart-log --output-format=json /dev/nvme0"); + } else if (Hardware::EON()) { + bootlog_commands.push_back("logcat -d"); + } + + MessageBuilder msg; + auto boot = msg.initEvent().initBoot(); + + boot.setWallTimeNanos(nanos_since_epoch()); + + std::string pstore = "/sys/fs/pstore"; + std::map pstore_map = util::read_files_in_dir(pstore); + + int i = 0; + auto lpstore = boot.initPstore().initEntries(pstore_map.size()); + for (auto& kv : pstore_map) { + auto lentry = lpstore[i]; + lentry.setKey(kv.first); + lentry.setValue(capnp::Data::Reader((const kj::byte*)kv.second.data(), kv.second.size())); + i++; + } + + // Gather output of commands + i = 0; + auto commands = boot.initCommands().initEntries(bootlog_commands.size()); + for (auto &command : bootlog_commands) { + auto lentry = commands[i]; + + lentry.setKey(command); + + const std::string result = util::check_output(command); + lentry.setValue(capnp::Data::Reader((const kj::byte*)result.data(), result.size())); + + i++; + } + + boot.setLaunchLog(util::read_file("/tmp/launch_log")); + return capnp::messageToFlatArray(msg); +} + +int main(int argc, char** argv) { + clear_locks(LOG_ROOT); + + const std::string path = LOG_ROOT + "/boot/" + logger_get_route_name() + ".bz2"; + LOGW("bootlog to %s", path.c_str()); + + // Open bootlog + bool r = util::create_directories(LOG_ROOT + "/boot/", 0775); + assert(r); + + BZFile bz_file(path.c_str()); + + // Write initdata + bz_file.write(logger_build_init_data().asBytes()); + + // Write bootlog + bz_file.write(build_boot_log().asBytes()); + + return 0; +} diff --git a/selfdrive/loggerd/config.py b/selfdrive/loggerd/config.py new file mode 100644 index 000000000..6cd20a68a --- /dev/null +++ b/selfdrive/loggerd/config.py @@ -0,0 +1,41 @@ +import os +from pathlib import Path +from selfdrive.hardware import PC + +if os.environ.get('LOG_ROOT', False): + ROOT = os.environ['LOG_ROOT'] +elif PC: + ROOT = os.path.join(str(Path.home()), ".comma", "media", "0", "realdata") +else: + ROOT = '/data/media/0/realdata/' + + +CAMERA_FPS = 20 +SEGMENT_LENGTH = 60 + +STATS_DIR_FILE_LIMIT = 10000 +STATS_SOCKET = "ipc:///tmp/stats" +if PC: + STATS_DIR = os.path.join(str(Path.home()), ".comma", "stats") +else: + STATS_DIR = "/data/stats/" +STATS_FLUSH_TIME_S = 60 + +def get_available_percent(default=None): + try: + statvfs = os.statvfs(ROOT) + available_percent = 100.0 * statvfs.f_bavail / statvfs.f_blocks + except OSError: + available_percent = default + + return available_percent + + +def get_available_bytes(default=None): + try: + statvfs = os.statvfs(ROOT) + available_bytes = statvfs.f_bavail * statvfs.f_frsize + except OSError: + available_bytes = default + + return available_bytes diff --git a/selfdrive/loggerd/deleter.py b/selfdrive/loggerd/deleter.py new file mode 100644 index 000000000..e7006a08c --- /dev/null +++ b/selfdrive/loggerd/deleter.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +import os +import shutil +import threading +from selfdrive.swaglog import cloudlog +from selfdrive.loggerd.config import ROOT, get_available_bytes, get_available_percent +from selfdrive.loggerd.uploader import listdir_by_creation + +MIN_BYTES = 5 * 1024 * 1024 * 1024 +MIN_PERCENT = 10 + +DELETE_LAST = ['boot', 'crash'] + + +def deleter_thread(exit_event): + while not exit_event.is_set(): + out_of_bytes = get_available_bytes(default=MIN_BYTES + 1) < MIN_BYTES + out_of_percent = get_available_percent(default=MIN_PERCENT + 1) < MIN_PERCENT + + if out_of_percent or out_of_bytes: + # remove the earliest directory we can + dirs = sorted(listdir_by_creation(ROOT), key=lambda x: x in DELETE_LAST) + for delete_dir in dirs: + delete_path = os.path.join(ROOT, delete_dir) + + if any(name.endswith(".lock") for name in os.listdir(delete_path)): + continue + + try: + cloudlog.info(f"deleting {delete_path}") + shutil.rmtree(delete_path) + break + except OSError: + cloudlog.exception(f"issue deleting {delete_path}") + exit_event.wait(.1) + else: + exit_event.wait(30) + + +def main(): + deleter_thread(threading.Event()) + + +if __name__ == "__main__": + main() diff --git a/selfdrive/loggerd/encoder.h b/selfdrive/loggerd/encoder.h new file mode 100644 index 000000000..572a635a7 --- /dev/null +++ b/selfdrive/loggerd/encoder.h @@ -0,0 +1,12 @@ +#pragma once + +#include + +class VideoEncoder { +public: + virtual ~VideoEncoder() {} + virtual int encode_frame(const uint8_t *y_ptr, const uint8_t *u_ptr, const uint8_t *v_ptr, + int in_width, int in_height, uint64_t ts) = 0; + virtual void encoder_open(const char* path) = 0; + virtual void encoder_close() = 0; +}; diff --git a/selfdrive/loggerd/include/msm_media_info.h b/selfdrive/loggerd/include/msm_media_info.h new file mode 100644 index 000000000..39dceb2c4 --- /dev/null +++ b/selfdrive/loggerd/include/msm_media_info.h @@ -0,0 +1,819 @@ +#ifndef __MEDIA_INFO_H__ +#define __MEDIA_INFO_H__ + +#ifndef MSM_MEDIA_ALIGN +#define MSM_MEDIA_ALIGN(__sz, __align) (((__sz) + (__align-1)) & (~(__align-1))) +#endif + +#ifndef MSM_MEDIA_ROUNDUP +#define MSM_MEDIA_ROUNDUP(__sz, __r) (((__sz) + ((__r) - 1)) / (__r)) +#endif + +#ifndef MSM_MEDIA_MAX +#define MSM_MEDIA_MAX(__a, __b) ((__a) > (__b)?(__a):(__b)) +#endif + +enum color_fmts { + /* Venus NV12: + * YUV 4:2:0 image with a plane of 8 bit Y samples followed + * by an interleaved U/V plane containing 8 bit 2x2 subsampled + * colour difference samples. + * + * <-------- Y/UV_Stride --------> + * <------- Width -------> + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . ^ ^ + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . Height | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | Y_Scanlines + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . V | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . V + * U V U V U V U V U V U V . . . . ^ + * U V U V U V U V U V U V . . . . | + * U V U V U V U V U V U V . . . . | + * U V U V U V U V U V U V . . . . UV_Scanlines + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . V + * . . . . . . . . . . . . . . . . --> Buffer size alignment + * + * Y_Stride : Width aligned to 128 + * UV_Stride : Width aligned to 128 + * Y_Scanlines: Height aligned to 32 + * UV_Scanlines: Height/2 aligned to 16 + * Extradata: Arbitrary (software-imposed) padding + * Total size = align((Y_Stride * Y_Scanlines + * + UV_Stride * UV_Scanlines + * + max(Extradata, Y_Stride * 8), 4096) + */ + COLOR_FMT_NV12, + + /* Venus NV21: + * YUV 4:2:0 image with a plane of 8 bit Y samples followed + * by an interleaved V/U plane containing 8 bit 2x2 subsampled + * colour difference samples. + * + * <-------- Y/UV_Stride --------> + * <------- Width -------> + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . ^ ^ + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . Height | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | Y_Scanlines + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . V | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . V + * V U V U V U V U V U V U . . . . ^ + * V U V U V U V U V U V U . . . . | + * V U V U V U V U V U V U . . . . | + * V U V U V U V U V U V U . . . . UV_Scanlines + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . V + * . . . . . . . . . . . . . . . . --> Padding & Buffer size alignment + * + * Y_Stride : Width aligned to 128 + * UV_Stride : Width aligned to 128 + * Y_Scanlines: Height aligned to 32 + * UV_Scanlines: Height/2 aligned to 16 + * Extradata: Arbitrary (software-imposed) padding + * Total size = align((Y_Stride * Y_Scanlines + * + UV_Stride * UV_Scanlines + * + max(Extradata, Y_Stride * 8), 4096) + */ + COLOR_FMT_NV21, + /* Venus NV12_MVTB: + * Two YUV 4:2:0 images/views one after the other + * in a top-bottom layout, same as NV12 + * with a plane of 8 bit Y samples followed + * by an interleaved U/V plane containing 8 bit 2x2 subsampled + * colour difference samples. + * + * + * <-------- Y/UV_Stride --------> + * <------- Width -------> + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . ^ ^ ^ + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . Height | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | Y_Scanlines | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . V | | + * . . . . . . . . . . . . . . . . | View_1 + * . . . . . . . . . . . . . . . . | | + * . . . . . . . . . . . . . . . . | | + * . . . . . . . . . . . . . . . . V | + * U V U V U V U V U V U V . . . . ^ | + * U V U V U V U V U V U V . . . . | | + * U V U V U V U V U V U V . . . . | | + * U V U V U V U V U V U V . . . . UV_Scanlines | + * . . . . . . . . . . . . . . . . | | + * . . . . . . . . . . . . . . . . V V + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . ^ ^ ^ + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . Height | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | Y_Scanlines | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . V | | + * . . . . . . . . . . . . . . . . | View_2 + * . . . . . . . . . . . . . . . . | | + * . . . . . . . . . . . . . . . . | | + * . . . . . . . . . . . . . . . . V | + * U V U V U V U V U V U V . . . . ^ | + * U V U V U V U V U V U V . . . . | | + * U V U V U V U V U V U V . . . . | | + * U V U V U V U V U V U V . . . . UV_Scanlines | + * . . . . . . . . . . . . . . . . | | + * . . . . . . . . . . . . . . . . V V + * . . . . . . . . . . . . . . . . --> Buffer size alignment + * + * Y_Stride : Width aligned to 128 + * UV_Stride : Width aligned to 128 + * Y_Scanlines: Height aligned to 32 + * UV_Scanlines: Height/2 aligned to 16 + * View_1 begin at: 0 (zero) + * View_2 begin at: Y_Stride * Y_Scanlines + UV_Stride * UV_Scanlines + * Extradata: Arbitrary (software-imposed) padding + * Total size = align((2*(Y_Stride * Y_Scanlines) + * + 2*(UV_Stride * UV_Scanlines) + Extradata), 4096) + */ + COLOR_FMT_NV12_MVTB, + /* Venus NV12 UBWC: + * Compressed Macro-tile format for NV12. + * Contains 4 planes in the following order - + * (A) Y_Meta_Plane + * (B) Y_UBWC_Plane + * (C) UV_Meta_Plane + * (D) UV_UBWC_Plane + * + * Y_Meta_Plane consists of meta information to decode compressed + * tile data in Y_UBWC_Plane. + * Y_UBWC_Plane consists of Y data in compressed macro-tile format. + * UBWC decoder block will use the Y_Meta_Plane data together with + * Y_UBWC_Plane data to produce loss-less uncompressed 8 bit Y samples. + * + * UV_Meta_Plane consists of meta information to decode compressed + * tile data in UV_UBWC_Plane. + * UV_UBWC_Plane consists of UV data in compressed macro-tile format. + * UBWC decoder block will use UV_Meta_Plane data together with + * UV_UBWC_Plane data to produce loss-less uncompressed 8 bit 2x2 + * subsampled color difference samples. + * + * Each tile in Y_UBWC_Plane/UV_UBWC_Plane is independently decodable + * and randomly accessible. There is no dependency between tiles. + * + * <----- Y_Meta_Stride ----> + * <-------- Width ------> + * M M M M M M M M M M M M . . ^ ^ + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . Height | + * M M M M M M M M M M M M . . | Meta_Y_Scanlines + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . V | + * . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . -------> Buffer size aligned to 4k + * . . . . . . . . . . . . . . V + * <--Compressed tile Y Stride---> + * <------- Width -------> + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . ^ ^ + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . Height | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | Macro_tile_Y_Scanlines + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . V | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . -------> Buffer size aligned to 4k + * . . . . . . . . . . . . . . . . V + * <----- UV_Meta_Stride ----> + * M M M M M M M M M M M M . . ^ + * M M M M M M M M M M M M . . | + * M M M M M M M M M M M M . . | + * M M M M M M M M M M M M . . M_UV_Scanlines + * . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . V + * . . . . . . . . . . . . . . -------> Buffer size aligned to 4k + * <--Compressed tile UV Stride---> + * U* V* U* V* U* V* U* V* . . . . ^ + * U* V* U* V* U* V* U* V* . . . . | + * U* V* U* V* U* V* U* V* . . . . | + * U* V* U* V* U* V* U* V* . . . . UV_Scanlines + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . V + * . . . . . . . . . . . . . . . . -------> Buffer size aligned to 4k + * + * Y_Stride = align(Width, 128) + * UV_Stride = align(Width, 128) + * Y_Scanlines = align(Height, 32) + * UV_Scanlines = align(Height/2, 16) + * Y_UBWC_Plane_size = align(Y_Stride * Y_Scanlines, 4096) + * UV_UBWC_Plane_size = align(UV_Stride * UV_Scanlines, 4096) + * Y_Meta_Stride = align(roundup(Width, Y_TileWidth), 64) + * Y_Meta_Scanlines = align(roundup(Height, Y_TileHeight), 16) + * Y_Meta_Plane_size = align(Y_Meta_Stride * Y_Meta_Scanlines, 4096) + * UV_Meta_Stride = align(roundup(Width, UV_TileWidth), 64) + * UV_Meta_Scanlines = align(roundup(Height, UV_TileHeight), 16) + * UV_Meta_Plane_size = align(UV_Meta_Stride * UV_Meta_Scanlines, 4096) + * Extradata = 8k + * + * Total size = align( Y_UBWC_Plane_size + UV_UBWC_Plane_size + + * Y_Meta_Plane_size + UV_Meta_Plane_size + * + max(Extradata, Y_Stride * 48), 4096) + */ + COLOR_FMT_NV12_UBWC, + /* Venus NV12 10-bit UBWC: + * Compressed Macro-tile format for NV12. + * Contains 4 planes in the following order - + * (A) Y_Meta_Plane + * (B) Y_UBWC_Plane + * (C) UV_Meta_Plane + * (D) UV_UBWC_Plane + * + * Y_Meta_Plane consists of meta information to decode compressed + * tile data in Y_UBWC_Plane. + * Y_UBWC_Plane consists of Y data in compressed macro-tile format. + * UBWC decoder block will use the Y_Meta_Plane data together with + * Y_UBWC_Plane data to produce loss-less uncompressed 10 bit Y samples. + * + * UV_Meta_Plane consists of meta information to decode compressed + * tile data in UV_UBWC_Plane. + * UV_UBWC_Plane consists of UV data in compressed macro-tile format. + * UBWC decoder block will use UV_Meta_Plane data together with + * UV_UBWC_Plane data to produce loss-less uncompressed 10 bit 2x2 + * subsampled color difference samples. + * + * Each tile in Y_UBWC_Plane/UV_UBWC_Plane is independently decodable + * and randomly accessible. There is no dependency between tiles. + * + * <----- Y_Meta_Stride -----> + * <-------- Width ------> + * M M M M M M M M M M M M . . ^ ^ + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . Height | + * M M M M M M M M M M M M . . | Meta_Y_Scanlines + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . V | + * . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . -------> Buffer size aligned to 4k + * . . . . . . . . . . . . . . V + * <--Compressed tile Y Stride---> + * <------- Width -------> + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . ^ ^ + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . Height | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | Macro_tile_Y_Scanlines + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . V | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . -------> Buffer size aligned to 4k + * . . . . . . . . . . . . . . . . V + * <----- UV_Meta_Stride ----> + * M M M M M M M M M M M M . . ^ + * M M M M M M M M M M M M . . | + * M M M M M M M M M M M M . . | + * M M M M M M M M M M M M . . M_UV_Scanlines + * . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . V + * . . . . . . . . . . . . . . -------> Buffer size aligned to 4k + * <--Compressed tile UV Stride---> + * U* V* U* V* U* V* U* V* . . . . ^ + * U* V* U* V* U* V* U* V* . . . . | + * U* V* U* V* U* V* U* V* . . . . | + * U* V* U* V* U* V* U* V* . . . . UV_Scanlines + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . V + * . . . . . . . . . . . . . . . . -------> Buffer size aligned to 4k + * + * + * Y_Stride = align(Width * 4/3, 128) + * UV_Stride = align(Width * 4/3, 128) + * Y_Scanlines = align(Height, 32) + * UV_Scanlines = align(Height/2, 16) + * Y_UBWC_Plane_Size = align(Y_Stride * Y_Scanlines, 4096) + * UV_UBWC_Plane_Size = align(UV_Stride * UV_Scanlines, 4096) + * Y_Meta_Stride = align(roundup(Width, Y_TileWidth), 64) + * Y_Meta_Scanlines = align(roundup(Height, Y_TileHeight), 16) + * Y_Meta_Plane_size = align(Y_Meta_Stride * Y_Meta_Scanlines, 4096) + * UV_Meta_Stride = align(roundup(Width, UV_TileWidth), 64) + * UV_Meta_Scanlines = align(roundup(Height, UV_TileHeight), 16) + * UV_Meta_Plane_size = align(UV_Meta_Stride * UV_Meta_Scanlines, 4096) + * Extradata = 8k + * + * Total size = align(Y_UBWC_Plane_size + UV_UBWC_Plane_size + + * Y_Meta_Plane_size + UV_Meta_Plane_size + * + max(Extradata, Y_Stride * 48), 4096) + */ + COLOR_FMT_NV12_BPP10_UBWC, + /* Venus RGBA8888 format: + * Contains 1 plane in the following order - + * (A) RGBA plane + * + * <-------- RGB_Stride --------> + * <------- Width -------> + * R R R R R R R R R R R R . . . . ^ ^ + * R R R R R R R R R R R R . . . . | | + * R R R R R R R R R R R R . . . . Height | + * R R R R R R R R R R R R . . . . | RGB_Scanlines + * R R R R R R R R R R R R . . . . | | + * R R R R R R R R R R R R . . . . | | + * R R R R R R R R R R R R . . . . | | + * R R R R R R R R R R R R . . . . V | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . V + * + * RGB_Stride = align(Width * 4, 128) + * RGB_Scanlines = align(Height, 32) + * RGB_Plane_size = align(RGB_Stride * RGB_Scanlines, 4096) + * Extradata = 8k + * + * Total size = align(RGB_Plane_size + Extradata, 4096) + */ + COLOR_FMT_RGBA8888, + /* Venus RGBA8888 UBWC format: + * Contains 2 planes in the following order - + * (A) Meta plane + * (B) RGBA plane + * + * <--- RGB_Meta_Stride ----> + * <-------- Width ------> + * M M M M M M M M M M M M . . ^ ^ + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . Height | + * M M M M M M M M M M M M . . | Meta_RGB_Scanlines + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . V | + * . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . -------> Buffer size aligned to 4k + * . . . . . . . . . . . . . . V + * <-------- RGB_Stride --------> + * <------- Width -------> + * R R R R R R R R R R R R . . . . ^ ^ + * R R R R R R R R R R R R . . . . | | + * R R R R R R R R R R R R . . . . Height | + * R R R R R R R R R R R R . . . . | RGB_Scanlines + * R R R R R R R R R R R R . . . . | | + * R R R R R R R R R R R R . . . . | | + * R R R R R R R R R R R R . . . . | | + * R R R R R R R R R R R R . . . . V | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . -------> Buffer size aligned to 4k + * . . . . . . . . . . . . . . . . V + * + * RGB_Stride = align(Width * 4, 128) + * RGB_Scanlines = align(Height, 32) + * RGB_Plane_size = align(RGB_Stride * RGB_Scanlines, 4096) + * RGB_Meta_Stride = align(roundup(Width, RGB_TileWidth), 64) + * RGB_Meta_Scanline = align(roundup(Height, RGB_TileHeight), 16) + * RGB_Meta_Plane_size = align(RGB_Meta_Stride * + * RGB_Meta_Scanlines, 4096) + * Extradata = 8k + * + * Total size = align(RGB_Meta_Plane_size + RGB_Plane_size + + * Extradata, 4096) + */ + COLOR_FMT_RGBA8888_UBWC, +}; + +static inline unsigned int VENUS_EXTRADATA_SIZE(int width, int height) +{ + (void)height; + (void)width; + + /* + * In the future, calculate the size based on the w/h but just + * hardcode it for now since 16K satisfies all current usecases. + */ + return 16 * 1024; +} + +static inline unsigned int VENUS_Y_STRIDE(int color_fmt, int width) +{ + unsigned int alignment, stride = 0; + if (!width) + goto invalid_input; + + switch (color_fmt) { + case COLOR_FMT_NV21: + case COLOR_FMT_NV12: + case COLOR_FMT_NV12_MVTB: + case COLOR_FMT_NV12_UBWC: + alignment = 128; + stride = MSM_MEDIA_ALIGN(width, alignment); + break; + case COLOR_FMT_NV12_BPP10_UBWC: + alignment = 256; + stride = MSM_MEDIA_ALIGN(width, 192); + stride = MSM_MEDIA_ALIGN(stride * 4/3, alignment); + break; + default: + break; + } +invalid_input: + return stride; +} + +static inline unsigned int VENUS_UV_STRIDE(int color_fmt, int width) +{ + unsigned int alignment, stride = 0; + if (!width) + goto invalid_input; + + switch (color_fmt) { + case COLOR_FMT_NV21: + case COLOR_FMT_NV12: + case COLOR_FMT_NV12_MVTB: + case COLOR_FMT_NV12_UBWC: + alignment = 128; + stride = MSM_MEDIA_ALIGN(width, alignment); + break; + case COLOR_FMT_NV12_BPP10_UBWC: + alignment = 256; + stride = MSM_MEDIA_ALIGN(width, 192); + stride = MSM_MEDIA_ALIGN(stride * 4/3, alignment); + break; + default: + break; + } +invalid_input: + return stride; +} + +static inline unsigned int VENUS_Y_SCANLINES(int color_fmt, int height) +{ + unsigned int alignment, sclines = 0; + if (!height) + goto invalid_input; + + switch (color_fmt) { + case COLOR_FMT_NV21: + case COLOR_FMT_NV12: + case COLOR_FMT_NV12_MVTB: + case COLOR_FMT_NV12_UBWC: + alignment = 32; + break; + case COLOR_FMT_NV12_BPP10_UBWC: + alignment = 16; + break; + default: + return 0; + } + sclines = MSM_MEDIA_ALIGN(height, alignment); +invalid_input: + return sclines; +} + +static inline unsigned int VENUS_UV_SCANLINES(int color_fmt, int height) +{ + unsigned int alignment, sclines = 0; + if (!height) + goto invalid_input; + + switch (color_fmt) { + case COLOR_FMT_NV21: + case COLOR_FMT_NV12: + case COLOR_FMT_NV12_MVTB: + case COLOR_FMT_NV12_BPP10_UBWC: + alignment = 16; + break; + case COLOR_FMT_NV12_UBWC: + alignment = 32; + break; + default: + goto invalid_input; + } + + sclines = MSM_MEDIA_ALIGN(height / 2, alignment); + +invalid_input: + return sclines; +} + +static inline unsigned int VENUS_Y_META_STRIDE(int color_fmt, int width) +{ + int y_tile_width = 0, y_meta_stride = 0; + + if (!width) + goto invalid_input; + + switch (color_fmt) { + case COLOR_FMT_NV12_UBWC: + y_tile_width = 32; + break; + case COLOR_FMT_NV12_BPP10_UBWC: + y_tile_width = 48; + break; + default: + goto invalid_input; + } + + y_meta_stride = MSM_MEDIA_ROUNDUP(width, y_tile_width); + y_meta_stride = MSM_MEDIA_ALIGN(y_meta_stride, 64); + +invalid_input: + return y_meta_stride; +} + +static inline unsigned int VENUS_Y_META_SCANLINES(int color_fmt, int height) +{ + int y_tile_height = 0, y_meta_scanlines = 0; + + if (!height) + goto invalid_input; + + switch (color_fmt) { + case COLOR_FMT_NV12_UBWC: + y_tile_height = 8; + break; + case COLOR_FMT_NV12_BPP10_UBWC: + y_tile_height = 4; + break; + default: + goto invalid_input; + } + + y_meta_scanlines = MSM_MEDIA_ROUNDUP(height, y_tile_height); + y_meta_scanlines = MSM_MEDIA_ALIGN(y_meta_scanlines, 16); + +invalid_input: + return y_meta_scanlines; +} + +static inline unsigned int VENUS_UV_META_STRIDE(int color_fmt, int width) +{ + int uv_tile_width = 0, uv_meta_stride = 0; + + if (!width) + goto invalid_input; + + switch (color_fmt) { + case COLOR_FMT_NV12_UBWC: + uv_tile_width = 16; + break; + case COLOR_FMT_NV12_BPP10_UBWC: + uv_tile_width = 24; + break; + default: + goto invalid_input; + } + + uv_meta_stride = MSM_MEDIA_ROUNDUP(width / 2, uv_tile_width); + uv_meta_stride = MSM_MEDIA_ALIGN(uv_meta_stride, 64); + +invalid_input: + return uv_meta_stride; +} + +static inline unsigned int VENUS_UV_META_SCANLINES(int color_fmt, int height) +{ + int uv_tile_height = 0, uv_meta_scanlines = 0; + + if (!height) + goto invalid_input; + + switch (color_fmt) { + case COLOR_FMT_NV12_UBWC: + uv_tile_height = 8; + break; + case COLOR_FMT_NV12_BPP10_UBWC: + uv_tile_height = 4; + break; + default: + goto invalid_input; + } + + uv_meta_scanlines = MSM_MEDIA_ROUNDUP(height / 2, uv_tile_height); + uv_meta_scanlines = MSM_MEDIA_ALIGN(uv_meta_scanlines, 16); + +invalid_input: + return uv_meta_scanlines; +} + +static inline unsigned int VENUS_RGB_STRIDE(int color_fmt, int width) +{ + unsigned int alignment = 0, stride = 0; + if (!width) + goto invalid_input; + + switch (color_fmt) { + case COLOR_FMT_RGBA8888: + alignment = 128; + break; + case COLOR_FMT_RGBA8888_UBWC: + alignment = 256; + break; + default: + goto invalid_input; + } + + stride = MSM_MEDIA_ALIGN(width * 4, alignment); + +invalid_input: + return stride; +} + +static inline unsigned int VENUS_RGB_SCANLINES(int color_fmt, int height) +{ + unsigned int alignment = 0, scanlines = 0; + + if (!height) + goto invalid_input; + + switch (color_fmt) { + case COLOR_FMT_RGBA8888: + alignment = 32; + break; + case COLOR_FMT_RGBA8888_UBWC: + alignment = 16; + break; + default: + goto invalid_input; + } + + scanlines = MSM_MEDIA_ALIGN(height, alignment); + +invalid_input: + return scanlines; +} + +static inline unsigned int VENUS_RGB_META_STRIDE(int color_fmt, int width) +{ + int rgb_tile_width = 0, rgb_meta_stride = 0; + + if (!width) + goto invalid_input; + + switch (color_fmt) { + case COLOR_FMT_RGBA8888_UBWC: + rgb_tile_width = 16; + break; + default: + goto invalid_input; + } + + rgb_meta_stride = MSM_MEDIA_ROUNDUP(width, rgb_tile_width); + rgb_meta_stride = MSM_MEDIA_ALIGN(rgb_meta_stride, 64); + +invalid_input: + return rgb_meta_stride; +} + +static inline unsigned int VENUS_RGB_META_SCANLINES(int color_fmt, int height) +{ + int rgb_tile_height = 0, rgb_meta_scanlines = 0; + + if (!height) + goto invalid_input; + + switch (color_fmt) { + case COLOR_FMT_RGBA8888_UBWC: + rgb_tile_height = 4; + break; + default: + goto invalid_input; + } + + rgb_meta_scanlines = MSM_MEDIA_ROUNDUP(height, rgb_tile_height); + rgb_meta_scanlines = MSM_MEDIA_ALIGN(rgb_meta_scanlines, 16); + +invalid_input: + return rgb_meta_scanlines; +} + +static inline unsigned int VENUS_BUFFER_SIZE( + int color_fmt, int width, int height) +{ + const unsigned int extra_size = VENUS_EXTRADATA_SIZE(width, height); + unsigned int uv_alignment = 0, size = 0; + unsigned int y_plane, uv_plane, y_stride, + uv_stride, y_sclines, uv_sclines; + unsigned int y_ubwc_plane = 0, uv_ubwc_plane = 0; + unsigned int y_meta_stride = 0, y_meta_scanlines = 0; + unsigned int uv_meta_stride = 0, uv_meta_scanlines = 0; + unsigned int y_meta_plane = 0, uv_meta_plane = 0; + unsigned int rgb_stride = 0, rgb_scanlines = 0; + unsigned int rgb_plane = 0, rgb_ubwc_plane = 0, rgb_meta_plane = 0; + unsigned int rgb_meta_stride = 0, rgb_meta_scanlines = 0; + + if (!width || !height) + goto invalid_input; + + y_stride = VENUS_Y_STRIDE(color_fmt, width); + uv_stride = VENUS_UV_STRIDE(color_fmt, width); + y_sclines = VENUS_Y_SCANLINES(color_fmt, height); + uv_sclines = VENUS_UV_SCANLINES(color_fmt, height); + rgb_stride = VENUS_RGB_STRIDE(color_fmt, width); + rgb_scanlines = VENUS_RGB_SCANLINES(color_fmt, height); + + switch (color_fmt) { + case COLOR_FMT_NV21: + case COLOR_FMT_NV12: + uv_alignment = 4096; + y_plane = y_stride * y_sclines; + uv_plane = uv_stride * uv_sclines + uv_alignment; + size = y_plane + uv_plane + + MSM_MEDIA_MAX(extra_size, 8 * y_stride); + size = MSM_MEDIA_ALIGN(size, 4096); + break; + case COLOR_FMT_NV12_MVTB: + uv_alignment = 4096; + y_plane = y_stride * y_sclines; + uv_plane = uv_stride * uv_sclines + uv_alignment; + size = y_plane + uv_plane; + size = 2 * size + extra_size; + size = MSM_MEDIA_ALIGN(size, 4096); + break; + case COLOR_FMT_NV12_UBWC: + case COLOR_FMT_NV12_BPP10_UBWC: + y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096); + uv_ubwc_plane = MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096); + y_meta_stride = VENUS_Y_META_STRIDE(color_fmt, width); + y_meta_scanlines = VENUS_Y_META_SCANLINES(color_fmt, height); + y_meta_plane = MSM_MEDIA_ALIGN( + y_meta_stride * y_meta_scanlines, 4096); + uv_meta_stride = VENUS_UV_META_STRIDE(color_fmt, width); + uv_meta_scanlines = VENUS_UV_META_SCANLINES(color_fmt, height); + uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride * + uv_meta_scanlines, 4096); + + size = y_ubwc_plane + uv_ubwc_plane + y_meta_plane + + uv_meta_plane + + MSM_MEDIA_MAX(extra_size + 8192, 48 * y_stride); + size = MSM_MEDIA_ALIGN(size, 4096); + break; + case COLOR_FMT_RGBA8888: + rgb_plane = MSM_MEDIA_ALIGN(rgb_stride * rgb_scanlines, 4096); + size = rgb_plane; + size = MSM_MEDIA_ALIGN(size, 4096); + break; + case COLOR_FMT_RGBA8888_UBWC: + rgb_ubwc_plane = MSM_MEDIA_ALIGN(rgb_stride * rgb_scanlines, + 4096); + rgb_meta_stride = VENUS_RGB_META_STRIDE(color_fmt, width); + rgb_meta_scanlines = VENUS_RGB_META_SCANLINES(color_fmt, + height); + rgb_meta_plane = MSM_MEDIA_ALIGN(rgb_meta_stride * + rgb_meta_scanlines, 4096); + size = rgb_ubwc_plane + rgb_meta_plane; + size = MSM_MEDIA_ALIGN(size, 4096); + break; + default: + break; + } +invalid_input: + return size; +} + +static inline unsigned int VENUS_VIEW2_OFFSET( + int color_fmt, int width, int height) +{ + unsigned int offset = 0; + unsigned int y_plane, uv_plane, y_stride, + uv_stride, y_sclines, uv_sclines; + if (!width || !height) + goto invalid_input; + + y_stride = VENUS_Y_STRIDE(color_fmt, width); + uv_stride = VENUS_UV_STRIDE(color_fmt, width); + y_sclines = VENUS_Y_SCANLINES(color_fmt, height); + uv_sclines = VENUS_UV_SCANLINES(color_fmt, height); + switch (color_fmt) { + case COLOR_FMT_NV12_MVTB: + y_plane = y_stride * y_sclines; + uv_plane = uv_stride * uv_sclines; + offset = y_plane + uv_plane; + break; + default: + break; + } +invalid_input: + return offset; +} + +#endif diff --git a/selfdrive/loggerd/logger.cc b/selfdrive/loggerd/logger.cc new file mode 100644 index 000000000..81cfd131f --- /dev/null +++ b/selfdrive/loggerd/logger.cc @@ -0,0 +1,281 @@ +#include "selfdrive/loggerd/logger.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef QCOM +#include +#endif + +#include "selfdrive/common/params.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/version.h" + +// ***** logging helpers ***** + +void append_property(const char* key, const char* value, void *cookie) { + std::vector > *properties = + (std::vector > *)cookie; + + properties->push_back(std::make_pair(std::string(key), std::string(value))); +} + +// ***** log metadata ***** +kj::Array logger_build_init_data() { + MessageBuilder msg; + auto init = msg.initEvent().initInitData(); + + if (Hardware::EON()) { + init.setDeviceType(cereal::InitData::DeviceType::NEO); + } else if (Hardware::TICI()) { + init.setDeviceType(cereal::InitData::DeviceType::TICI); + } else { + init.setDeviceType(cereal::InitData::DeviceType::PC); + } + + init.setVersion(COMMA_VERSION); + + std::ifstream cmdline_stream("/proc/cmdline"); + std::vector kernel_args; + std::string buf; + while (cmdline_stream >> buf) { + kernel_args.push_back(buf); + } + + auto lkernel_args = init.initKernelArgs(kernel_args.size()); + for (int i=0; i > properties; + property_list(append_property, (void*)&properties); + + auto lentries = init.initAndroidProperties().initEntries(properties.size()); + for (int i=0; i params_map = params.readAll(); + + init.setGitCommit(params_map["GitCommit"]); + init.setGitBranch(params_map["GitBranch"]); + init.setGitRemote(params_map["GitRemote"]); + init.setPassive(params.getBool("Passive")); + init.setDongleId(params_map["DongleId"]); + + auto lparams = init.initParams().initEntries(params_map.size()); + int i = 0; + for (auto& [key, value] : params_map) { + auto lentry = lparams[i]; + lentry.setKey(key); + if ( !(params.getKeyType(key) & DONT_LOG) ) { + lentry.setValue(capnp::Data::Reader((const kj::byte*)value.data(), value.size())); + } + i++; + + } + return capnp::messageToFlatArray(msg); +} + +std::string logger_get_route_name() { + char route_name[64] = {'\0'}; + time_t rawtime = time(NULL); + struct tm timeinfo; + localtime_r(&rawtime, &timeinfo); + strftime(route_name, sizeof(route_name), "%Y-%m-%d--%H-%M-%S", &timeinfo); + return route_name; +} + +void log_init_data(LoggerState *s) { + auto bytes = s->init_data.asBytes(); + logger_log(s, bytes.begin(), bytes.size(), s->has_qlog); +} + + +static void lh_log_sentinel(LoggerHandle *h, SentinelType type) { + MessageBuilder msg; + auto sen = msg.initEvent().initSentinel(); + sen.setType(type); + sen.setSignal(h->exit_signal); + auto bytes = msg.toBytes(); + + lh_log(h, bytes.begin(), bytes.size(), true); +} + +// ***** logging functions ***** + +void logger_init(LoggerState *s, const char* log_name, bool has_qlog) { + pthread_mutex_init(&s->lock, NULL); + + s->part = -1; + s->has_qlog = has_qlog; + s->route_name = logger_get_route_name(); + snprintf(s->log_name, sizeof(s->log_name), "%s", log_name); + s->init_data = logger_build_init_data(); +} + +static LoggerHandle* logger_open(LoggerState *s, const char* root_path) { + LoggerHandle *h = NULL; + for (int i=0; ihandles[i].refcnt == 0) { + h = &s->handles[i]; + break; + } + } + assert(h); + + snprintf(h->segment_path, sizeof(h->segment_path), + "%s/%s--%d", root_path, s->route_name.c_str(), s->part); + + snprintf(h->log_path, sizeof(h->log_path), "%s/%s.bz2", h->segment_path, s->log_name); + snprintf(h->qlog_path, sizeof(h->qlog_path), "%s/qlog.bz2", h->segment_path); + snprintf(h->lock_path, sizeof(h->lock_path), "%s.lock", h->log_path); + h->end_sentinel_type = SentinelType::END_OF_SEGMENT; + h->exit_signal = 0; + + if (!util::create_directories(h->segment_path, 0775)) return nullptr; + + FILE* lock_file = fopen(h->lock_path, "wb"); + if (lock_file == NULL) return NULL; + fclose(lock_file); + + h->log = std::make_unique(h->log_path); + if (s->has_qlog) { + h->q_log = std::make_unique(h->qlog_path); + } + + pthread_mutex_init(&h->lock, NULL); + h->refcnt++; + return h; +} + +int logger_next(LoggerState *s, const char* root_path, + char* out_segment_path, size_t out_segment_path_len, + int* out_part) { + bool is_start_of_route = !s->cur_handle; + + pthread_mutex_lock(&s->lock); + s->part++; + + LoggerHandle* next_h = logger_open(s, root_path); + if (!next_h) { + pthread_mutex_unlock(&s->lock); + return -1; + } + + if (s->cur_handle) { + lh_close(s->cur_handle); + } + s->cur_handle = next_h; + + if (out_segment_path) { + snprintf(out_segment_path, out_segment_path_len, "%s", next_h->segment_path); + } + if (out_part) { + *out_part = s->part; + } + + pthread_mutex_unlock(&s->lock); + + // write beggining of log metadata + log_init_data(s); + lh_log_sentinel(s->cur_handle, is_start_of_route ? SentinelType::START_OF_ROUTE : SentinelType::START_OF_SEGMENT); + return 0; +} + +LoggerHandle* logger_get_handle(LoggerState *s) { + pthread_mutex_lock(&s->lock); + LoggerHandle* h = s->cur_handle; + if (h) { + pthread_mutex_lock(&h->lock); + h->refcnt++; + pthread_mutex_unlock(&h->lock); + } + pthread_mutex_unlock(&s->lock); + return h; +} + +void logger_log(LoggerState *s, uint8_t* data, size_t data_size, bool in_qlog) { + pthread_mutex_lock(&s->lock); + if (s->cur_handle) { + lh_log(s->cur_handle, data, data_size, in_qlog); + } + pthread_mutex_unlock(&s->lock); +} + +void logger_close(LoggerState *s, ExitHandler *exit_handler) { + pthread_mutex_lock(&s->lock); + if (s->cur_handle) { + s->cur_handle->exit_signal = exit_handler && exit_handler->signal.load(); + s->cur_handle->end_sentinel_type = SentinelType::END_OF_ROUTE; + lh_close(s->cur_handle); + } + pthread_mutex_unlock(&s->lock); +} + +void lh_log(LoggerHandle* h, uint8_t* data, size_t data_size, bool in_qlog) { + pthread_mutex_lock(&h->lock); + assert(h->refcnt > 0); + h->log->write(data, data_size); + if (in_qlog && h->q_log) { + h->q_log->write(data, data_size); + } + pthread_mutex_unlock(&h->lock); +} + +void lh_close(LoggerHandle* h) { + pthread_mutex_lock(&h->lock); + assert(h->refcnt > 0); + if (h->refcnt == 1) { + // a very ugly hack. only here can guarantee sentinel is the last msg + pthread_mutex_unlock(&h->lock); + lh_log_sentinel(h, h->end_sentinel_type); + pthread_mutex_lock(&h->lock); + } + h->refcnt--; + if (h->refcnt == 0) { + h->log.reset(nullptr); + h->q_log.reset(nullptr); + unlink(h->lock_path); + pthread_mutex_unlock(&h->lock); + pthread_mutex_destroy(&h->lock); + return; + } + pthread_mutex_unlock(&h->lock); +} + +int clear_locks_fn(const char* fpath, const struct stat *sb, int tyupeflag) { + const char* dot = strrchr(fpath, '.'); + if (dot && strcmp(dot, ".lock") == 0) { + unlink(fpath); + } + return 0; +} + +void clear_locks(const std::string log_root) { + ftw(log_root.c_str(), clear_locks_fn, 16); +} diff --git a/selfdrive/loggerd/logger.h b/selfdrive/loggerd/logger.h new file mode 100644 index 000000000..e85d7810e --- /dev/null +++ b/selfdrive/loggerd/logger.h @@ -0,0 +1,99 @@ +#pragma once + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "cereal/messaging/messaging.h" +#include "selfdrive/common/util.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/hardware/hw.h" + +const std::string LOG_ROOT = Path::log_root(); + +#define LOGGER_MAX_HANDLES 16 + +class BZFile { + public: + BZFile(const char* path) { + file = util::safe_fopen(path, "wb"); + assert(file != nullptr); + int bzerror; + bz_file = BZ2_bzWriteOpen(&bzerror, file, 9, 0, 30); + assert(bzerror == BZ_OK); + } + ~BZFile() { + int bzerror; + BZ2_bzWriteClose(&bzerror, bz_file, 0, nullptr, nullptr); + if (bzerror != BZ_OK) { + LOGE("BZ2_bzWriteClose error, bzerror=%d", bzerror); + } + util::safe_fflush(file); + int err = fclose(file); + assert(err == 0); + } + inline void write(void* data, size_t size) { + int bzerror; + do { + BZ2_bzWrite(&bzerror, bz_file, data, size); + } while (bzerror == BZ_IO_ERROR && errno == EINTR); + + if (bzerror != BZ_OK && !error_logged) { + LOGE("BZ2_bzWrite error, bzerror=%d", bzerror); + error_logged = true; + } + } + inline void write(kj::ArrayPtr array) { write(array.begin(), array.size()); } + + private: + bool error_logged = false; + FILE* file = nullptr; + BZFILE* bz_file = nullptr; +}; + +typedef cereal::Sentinel::SentinelType SentinelType; + +typedef struct LoggerHandle { + pthread_mutex_t lock; + SentinelType end_sentinel_type; + int exit_signal; + int refcnt; + char segment_path[4096]; + char log_path[4096]; + char qlog_path[4096]; + char lock_path[4096]; + std::unique_ptr log, q_log; +} LoggerHandle; + +typedef struct LoggerState { + pthread_mutex_t lock; + int part; + kj::Array init_data; + std::string route_name; + char log_name[64]; + bool has_qlog; + + LoggerHandle handles[LOGGER_MAX_HANDLES]; + LoggerHandle* cur_handle; +} LoggerState; + +kj::Array logger_build_init_data(); +std::string logger_get_route_name(); +void logger_init(LoggerState *s, const char* log_name, bool has_qlog); +int logger_next(LoggerState *s, const char* root_path, + char* out_segment_path, size_t out_segment_path_len, + int* out_part); +LoggerHandle* logger_get_handle(LoggerState *s); +void logger_close(LoggerState *s, ExitHandler *exit_handler=nullptr); +void logger_log(LoggerState *s, uint8_t* data, size_t data_size, bool in_qlog); + +void lh_log(LoggerHandle* h, uint8_t* data, size_t data_size, bool in_qlog); +void lh_close(LoggerHandle* h); +void clear_locks(const std::string log_root); diff --git a/selfdrive/loggerd/loggerd b/selfdrive/loggerd/loggerd new file mode 100755 index 000000000..aed4a4fa9 Binary files /dev/null and b/selfdrive/loggerd/loggerd differ diff --git a/selfdrive/loggerd/loggerd.cc b/selfdrive/loggerd/loggerd.cc new file mode 100644 index 000000000..02a77336e --- /dev/null +++ b/selfdrive/loggerd/loggerd.cc @@ -0,0 +1,270 @@ +#include "selfdrive/loggerd/loggerd.h" + +ExitHandler do_exit; + +// Handle initial encoder syncing by waiting for all encoders to reach the same frame id +bool sync_encoders(LoggerdState *s, CameraType cam_type, uint32_t frame_id) { + if (s->camera_synced[cam_type]) return true; + + if (s->max_waiting > 1 && s->encoders_ready != s->max_waiting) { + // add a small margin to the start frame id in case one of the encoders already dropped the next frame + update_max_atomic(s->start_frame_id, frame_id + 2); + if (std::exchange(s->camera_ready[cam_type], true) == false) { + ++s->encoders_ready; + LOGD("camera %d encoder ready", cam_type); + } + return false; + } else { + if (s->max_waiting == 1) update_max_atomic(s->start_frame_id, frame_id); + bool synced = frame_id >= s->start_frame_id; + s->camera_synced[cam_type] = synced; + if (!synced) LOGD("camera %d waiting for frame %d, cur %d", cam_type, (int)s->start_frame_id, frame_id); + return synced; + } +} + +bool trigger_rotate_if_needed(LoggerdState *s, int cur_seg, uint32_t frame_id) { + const int frames_per_seg = SEGMENT_LENGTH * MAIN_FPS; + if (cur_seg >= 0 && frame_id >= ((cur_seg + 1) * frames_per_seg) + s->start_frame_id) { + // trigger rotate and wait until the main logger has rotated to the new segment + ++s->ready_to_rotate; + std::unique_lock lk(s->rotate_lock); + s->rotate_cv.wait(lk, [&] { + return s->rotate_segment > cur_seg || do_exit; + }); + return !do_exit; + } + return false; +} + +void encoder_thread(LoggerdState *s, const LogCameraInfo &cam_info) { + util::set_thread_name(cam_info.filename); + + int cur_seg = -1; + int encode_idx = 0; + LoggerHandle *lh = NULL; + std::vector encoders; + VisionIpcClient vipc_client = VisionIpcClient("camerad", cam_info.stream_type, false); + + while (!do_exit) { + if (!vipc_client.connect(false)) { + util::sleep_for(5); + continue; + } + + // init encoders + if (encoders.empty()) { + VisionBuf buf_info = vipc_client.buffers[0]; + LOGD("encoder init %dx%d", buf_info.width, buf_info.height); + + // main encoder + encoders.push_back(new Encoder(cam_info.filename, buf_info.width, buf_info.height, + cam_info.fps, cam_info.bitrate, cam_info.is_h265, + cam_info.downscale, cam_info.record)); + // qcamera encoder + if (cam_info.has_qcamera) { + encoders.push_back(new Encoder(qcam_info.filename, qcam_info.frame_width, qcam_info.frame_height, + qcam_info.fps, qcam_info.bitrate, qcam_info.is_h265, qcam_info.downscale)); + } + } + + while (!do_exit) { + VisionIpcBufExtra extra; + VisionBuf* buf = vipc_client.recv(&extra); + if (buf == nullptr) continue; + + if (cam_info.trigger_rotate) { + s->last_camera_seen_tms = millis_since_boot(); + if (!sync_encoders(s, cam_info.type, extra.frame_id)) { + continue; + } + + // check if we're ready to rotate + trigger_rotate_if_needed(s, cur_seg, extra.frame_id); + if (do_exit) break; + } + + // rotate the encoder if the logger is on a newer segment + if (s->rotate_segment > cur_seg) { + cur_seg = s->rotate_segment; + + LOGW("camera %d rotate encoder to %s", cam_info.type, s->segment_path); + for (auto &e : encoders) { + e->encoder_close(); + e->encoder_open(s->segment_path); + } + if (lh) { + lh_close(lh); + } + lh = logger_get_handle(&s->logger); + } + + // encode a frame + for (int i = 0; i < encoders.size(); ++i) { + int out_id = encoders[i]->encode_frame(buf->y, buf->u, buf->v, + buf->width, buf->height, extra.timestamp_eof); + + if (out_id == -1) { + LOGE("Failed to encode frame. frame_id: %d encode_id: %d", extra.frame_id, encode_idx); + } + + // publish encode index + if (i == 0 && out_id != -1) { + MessageBuilder msg; + // this is really ugly + bool valid = (buf->get_frame_id() == extra.frame_id); + auto eidx = cam_info.type == DriverCam ? msg.initEvent(valid).initDriverEncodeIdx() : + (cam_info.type == WideRoadCam ? msg.initEvent(valid).initWideRoadEncodeIdx() : msg.initEvent(valid).initRoadEncodeIdx()); + eidx.setFrameId(extra.frame_id); + eidx.setTimestampSof(extra.timestamp_sof); + eidx.setTimestampEof(extra.timestamp_eof); + if (Hardware::TICI()) { + eidx.setType(cereal::EncodeIndex::Type::FULL_H_E_V_C); + } else { + eidx.setType(cam_info.type == DriverCam ? cereal::EncodeIndex::Type::FRONT : cereal::EncodeIndex::Type::FULL_H_E_V_C); + } + eidx.setEncodeId(encode_idx); + eidx.setSegmentNum(cur_seg); + eidx.setSegmentId(out_id); + if (lh) { + // TODO: this should read cereal/services.h for qlog decimation + auto bytes = msg.toBytes(); + lh_log(lh, bytes.begin(), bytes.size(), true); + } + } + } + + encode_idx++; + } + + if (lh) { + lh_close(lh); + lh = NULL; + } + } + + LOG("encoder destroy"); + for(auto &e : encoders) { + e->encoder_close(); + delete e; + } +} + +void logger_rotate(LoggerdState *s) { + { + std::unique_lock lk(s->rotate_lock); + int segment = -1; + int err = logger_next(&s->logger, LOG_ROOT.c_str(), s->segment_path, sizeof(s->segment_path), &segment); + assert(err == 0); + s->rotate_segment = segment; + s->ready_to_rotate = 0; + s->last_rotate_tms = millis_since_boot(); + } + s->rotate_cv.notify_all(); + LOGW((s->logger.part == 0) ? "logging to %s" : "rotated to %s", s->segment_path); +} + +void rotate_if_needed(LoggerdState *s) { + if (s->ready_to_rotate == s->max_waiting) { + logger_rotate(s); + } + + double tms = millis_since_boot(); + if ((tms - s->last_rotate_tms) > SEGMENT_LENGTH * 1000 && + (tms - s->last_camera_seen_tms) > NO_CAMERA_PATIENCE && + !LOGGERD_TEST) { + LOGW("no camera packet seen. auto rotating"); + logger_rotate(s); + } +} + +void loggerd_thread() { + // setup messaging + typedef struct QlogState { + std::string name; + int counter, freq; + } QlogState; + std::unordered_map qlog_states; + + std::unique_ptr ctx(Context::create()); + std::unique_ptr poller(Poller::create()); + + // subscribe to all socks + for (const auto& it : services) { + if (!it.should_log) continue; + + SubSocket * sock = SubSocket::create(ctx.get(), it.name); + assert(sock != NULL); + poller->registerSocket(sock); + qlog_states[sock] = { + .name = it.name, + .counter = 0, + .freq = it.decimation, + }; + } + + LoggerdState s; + // init logger + logger_init(&s.logger, "rlog", true); + logger_rotate(&s); + Params().put("CurrentRoute", s.logger.route_name); + + // init encoders + s.last_camera_seen_tms = millis_since_boot(); + std::vector encoder_threads; + for (const auto &cam : cameras_logged) { + if (cam.enable) { + encoder_threads.push_back(std::thread(encoder_thread, &s, cam)); + if (cam.trigger_rotate) s.max_waiting++; + } + } + + uint64_t msg_count = 0, bytes_count = 0; + double start_ts = millis_since_boot(); + while (!do_exit) { + // poll for new messages on all sockets + for (auto sock : poller->poll(1000)) { + if (do_exit) break; + + // drain socket + int count = 0; + QlogState &qs = qlog_states[sock]; + Message *msg = nullptr; + while (!do_exit && (msg = sock->receive(true))) { + const bool in_qlog = qs.freq != -1 && (qs.counter++ % qs.freq == 0); + logger_log(&s.logger, (uint8_t *)msg->getData(), msg->getSize(), in_qlog); + bytes_count += msg->getSize(); + delete msg; + + rotate_if_needed(&s); + + if ((++msg_count % 1000) == 0) { + double seconds = (millis_since_boot() - start_ts) / 1000.0; + LOGD("%lu messages, %.2f msg/sec, %.2f KB/sec", msg_count, msg_count / seconds, bytes_count * 0.001 / seconds); + } + + count++; + if (count >= 200) { + LOGD("large volume of '%s' messages", qs.name.c_str()); + break; + } + } + } + } + + LOGW("closing encoders"); + s.rotate_cv.notify_all(); + for (auto &t : encoder_threads) t.join(); + + LOGW("closing logger"); + logger_close(&s.logger, &do_exit); + + if (do_exit.power_failure) { + LOGE("power failure"); + sync(); + LOGE("sync done"); + } + + // messaging cleanup + for (auto &[sock, qs] : qlog_states) delete sock; +} diff --git a/selfdrive/loggerd/loggerd.h b/selfdrive/loggerd/loggerd.h new file mode 100644 index 000000000..caacbc591 --- /dev/null +++ b/selfdrive/loggerd/loggerd.h @@ -0,0 +1,131 @@ +#pragma once + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cereal/messaging/messaging.h" +#include "cereal/services.h" +#include "cereal/visionipc/visionipc.h" +#include "cereal/visionipc/visionipc_client.h" +#include "selfdrive/camerad/cameras/camera_common.h" +#include "selfdrive/common/params.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/timing.h" +#include "selfdrive/common/util.h" +#include "selfdrive/hardware/hw.h" + +#include "selfdrive/loggerd/encoder.h" +#include "selfdrive/loggerd/logger.h" +#if defined(QCOM) || defined(QCOM2) +#include "selfdrive/loggerd/omx_encoder.h" +#define Encoder OmxEncoder +#else +#include "selfdrive/loggerd/raw_logger.h" +#define Encoder RawLogger +#endif + +constexpr int MAIN_FPS = 20; +const int MAIN_BITRATE = Hardware::TICI() ? 10000000 : 5000000; +const int DCAM_BITRATE = Hardware::TICI() ? MAIN_BITRATE : 2500000; + +#define NO_CAMERA_PATIENCE 500 // fall back to time-based rotation if all cameras are dead + +const bool LOGGERD_TEST = getenv("LOGGERD_TEST"); +const int SEGMENT_LENGTH = LOGGERD_TEST ? atoi(getenv("LOGGERD_SEGMENT_LENGTH")) : 60; + +struct LogCameraInfo { + CameraType type; + const char *filename; + VisionStreamType stream_type; + int frame_width, frame_height; + int fps; + int bitrate; + bool is_h265; + bool downscale; + bool has_qcamera; + bool trigger_rotate; + bool enable; + bool record; +}; + +const LogCameraInfo cameras_logged[] = { + { + .type = RoadCam, + .stream_type = VISION_STREAM_ROAD, + .filename = "fcamera.hevc", + .fps = MAIN_FPS, + .bitrate = MAIN_BITRATE, + .is_h265 = true, + .downscale = false, + .has_qcamera = true, + .trigger_rotate = true, + .enable = true, + .record = true, + }, + { + .type = DriverCam, + .stream_type = VISION_STREAM_DRIVER, + .filename = "dcamera.hevc", + .fps = MAIN_FPS, // on EONs, more compressed this way + .bitrate = DCAM_BITRATE, + .is_h265 = true, + .downscale = false, + .has_qcamera = false, + .trigger_rotate = Hardware::TICI(), + .enable = true, + .record = Params().getBool("RecordFront"), + }, + { + .type = WideRoadCam, + .stream_type = VISION_STREAM_WIDE_ROAD, + .filename = "ecamera.hevc", + .fps = MAIN_FPS, + .bitrate = MAIN_BITRATE, + .is_h265 = true, + .downscale = false, + .has_qcamera = false, + .trigger_rotate = true, + .enable = Hardware::TICI(), + .record = Hardware::TICI(), + }, +}; +const LogCameraInfo qcam_info = { + .filename = "qcamera.ts", + .fps = MAIN_FPS, + .bitrate = 256000, + .is_h265 = false, + .downscale = true, + .frame_width = Hardware::TICI() ? 526 : 480, + .frame_height = Hardware::TICI() ? 330 : 360 // keep pixel count the same? +}; + +struct LoggerdState { + LoggerState logger = {}; + char segment_path[4096]; + std::mutex rotate_lock; + std::condition_variable rotate_cv; + std::atomic rotate_segment; + std::atomic last_camera_seen_tms; + std::atomic ready_to_rotate; // count of encoders ready to rotate + int max_waiting = 0; + double last_rotate_tms = 0.; // last rotate time in ms + + // Sync logic for startup + std::atomic encoders_ready = 0; + std::atomic start_frame_id = 0; + bool camera_ready[WideRoadCam + 1] = {}; + bool camera_synced[WideRoadCam + 1] = {}; +}; + +bool sync_encoders(LoggerdState *s, CameraType cam_type, uint32_t frame_id); +bool trigger_rotate_if_needed(LoggerdState *s, int cur_seg, uint32_t frame_id); +void rotate_if_needed(LoggerdState *s); +void loggerd_thread(); diff --git a/selfdrive/loggerd/main.cc b/selfdrive/loggerd/main.cc new file mode 100644 index 000000000..7069aa706 --- /dev/null +++ b/selfdrive/loggerd/main.cc @@ -0,0 +1,20 @@ +#include "selfdrive/loggerd/loggerd.h" + +#include + +int main(int argc, char** argv) { + if (Hardware::EON()) { + setpriority(PRIO_PROCESS, 0, -20); + } else if (Hardware::TICI()) { + int ret; + ret = util::set_core_affinity({0, 1, 2, 3}); + assert(ret == 0); + // TODO: why does this impact camerad timings? + //ret = util::set_realtime_priority(1); + //assert(ret == 0); + } + + loggerd_thread(); + + return 0; +} diff --git a/selfdrive/loggerd/omx_encoder.cc b/selfdrive/loggerd/omx_encoder.cc new file mode 100644 index 000000000..672238eae --- /dev/null +++ b/selfdrive/loggerd/omx_encoder.cc @@ -0,0 +1,607 @@ +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#include "selfdrive/loggerd/omx_encoder.h" + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include "libyuv.h" + +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/util.h" +#include "selfdrive/loggerd/include/msm_media_info.h" + +// Check the OMX error code and assert if an error occurred. +#define OMX_CHECK(_expr) \ + do { \ + assert(OMX_ErrorNone == (_expr)); \ + } while (0) + +extern ExitHandler do_exit; + +// ***** OMX callback functions ***** + +void OmxEncoder::wait_for_state(OMX_STATETYPE state_) { + std::unique_lock lk(this->state_lock); + while (this->state != state_) { + this->state_cv.wait(lk); + } +} + +static OMX_CALLBACKTYPE omx_callbacks = { + .EventHandler = OmxEncoder::event_handler, + .EmptyBufferDone = OmxEncoder::empty_buffer_done, + .FillBufferDone = OmxEncoder::fill_buffer_done, +}; + +OMX_ERRORTYPE OmxEncoder::event_handler(OMX_HANDLETYPE component, OMX_PTR app_data, OMX_EVENTTYPE event, + OMX_U32 data1, OMX_U32 data2, OMX_PTR event_data) { + OmxEncoder *e = (OmxEncoder*)app_data; + if (event == OMX_EventCmdComplete) { + assert(data1 == OMX_CommandStateSet); + LOG("set state event 0x%x", data2); + { + std::unique_lock lk(e->state_lock); + e->state = (OMX_STATETYPE)data2; + } + e->state_cv.notify_all(); + } else if (event == OMX_EventError) { + LOGE("OMX error 0x%08x", data1); + } else { + LOGE("OMX unhandled event %d", event); + assert(false); + } + + return OMX_ErrorNone; +} + +OMX_ERRORTYPE OmxEncoder::empty_buffer_done(OMX_HANDLETYPE component, OMX_PTR app_data, + OMX_BUFFERHEADERTYPE *buffer) { + // printf("empty_buffer_done\n"); + OmxEncoder *e = (OmxEncoder*)app_data; + e->free_in.push(buffer); + return OMX_ErrorNone; +} + +OMX_ERRORTYPE OmxEncoder::fill_buffer_done(OMX_HANDLETYPE component, OMX_PTR app_data, + OMX_BUFFERHEADERTYPE *buffer) { + // printf("fill_buffer_done\n"); + OmxEncoder *e = (OmxEncoder*)app_data; + e->done_out.push(buffer); + return OMX_ErrorNone; +} + +#define PORT_INDEX_IN 0 +#define PORT_INDEX_OUT 1 + +static const char* omx_color_fomat_name(uint32_t format) __attribute__((unused)); +static const char* omx_color_fomat_name(uint32_t format) { + switch (format) { + case OMX_COLOR_FormatUnused: return "OMX_COLOR_FormatUnused"; + case OMX_COLOR_FormatMonochrome: return "OMX_COLOR_FormatMonochrome"; + case OMX_COLOR_Format8bitRGB332: return "OMX_COLOR_Format8bitRGB332"; + case OMX_COLOR_Format12bitRGB444: return "OMX_COLOR_Format12bitRGB444"; + case OMX_COLOR_Format16bitARGB4444: return "OMX_COLOR_Format16bitARGB4444"; + case OMX_COLOR_Format16bitARGB1555: return "OMX_COLOR_Format16bitARGB1555"; + case OMX_COLOR_Format16bitRGB565: return "OMX_COLOR_Format16bitRGB565"; + case OMX_COLOR_Format16bitBGR565: return "OMX_COLOR_Format16bitBGR565"; + case OMX_COLOR_Format18bitRGB666: return "OMX_COLOR_Format18bitRGB666"; + case OMX_COLOR_Format18bitARGB1665: return "OMX_COLOR_Format18bitARGB1665"; + case OMX_COLOR_Format19bitARGB1666: return "OMX_COLOR_Format19bitARGB1666"; + case OMX_COLOR_Format24bitRGB888: return "OMX_COLOR_Format24bitRGB888"; + case OMX_COLOR_Format24bitBGR888: return "OMX_COLOR_Format24bitBGR888"; + case OMX_COLOR_Format24bitARGB1887: return "OMX_COLOR_Format24bitARGB1887"; + case OMX_COLOR_Format25bitARGB1888: return "OMX_COLOR_Format25bitARGB1888"; + case OMX_COLOR_Format32bitBGRA8888: return "OMX_COLOR_Format32bitBGRA8888"; + case OMX_COLOR_Format32bitARGB8888: return "OMX_COLOR_Format32bitARGB8888"; + case OMX_COLOR_FormatYUV411Planar: return "OMX_COLOR_FormatYUV411Planar"; + case OMX_COLOR_FormatYUV411PackedPlanar: return "OMX_COLOR_FormatYUV411PackedPlanar"; + case OMX_COLOR_FormatYUV420Planar: return "OMX_COLOR_FormatYUV420Planar"; + case OMX_COLOR_FormatYUV420PackedPlanar: return "OMX_COLOR_FormatYUV420PackedPlanar"; + case OMX_COLOR_FormatYUV420SemiPlanar: return "OMX_COLOR_FormatYUV420SemiPlanar"; + case OMX_COLOR_FormatYUV422Planar: return "OMX_COLOR_FormatYUV422Planar"; + case OMX_COLOR_FormatYUV422PackedPlanar: return "OMX_COLOR_FormatYUV422PackedPlanar"; + case OMX_COLOR_FormatYUV422SemiPlanar: return "OMX_COLOR_FormatYUV422SemiPlanar"; + case OMX_COLOR_FormatYCbYCr: return "OMX_COLOR_FormatYCbYCr"; + case OMX_COLOR_FormatYCrYCb: return "OMX_COLOR_FormatYCrYCb"; + case OMX_COLOR_FormatCbYCrY: return "OMX_COLOR_FormatCbYCrY"; + case OMX_COLOR_FormatCrYCbY: return "OMX_COLOR_FormatCrYCbY"; + case OMX_COLOR_FormatYUV444Interleaved: return "OMX_COLOR_FormatYUV444Interleaved"; + case OMX_COLOR_FormatRawBayer8bit: return "OMX_COLOR_FormatRawBayer8bit"; + case OMX_COLOR_FormatRawBayer10bit: return "OMX_COLOR_FormatRawBayer10bit"; + case OMX_COLOR_FormatRawBayer8bitcompressed: return "OMX_COLOR_FormatRawBayer8bitcompressed"; + case OMX_COLOR_FormatL2: return "OMX_COLOR_FormatL2"; + case OMX_COLOR_FormatL4: return "OMX_COLOR_FormatL4"; + case OMX_COLOR_FormatL8: return "OMX_COLOR_FormatL8"; + case OMX_COLOR_FormatL16: return "OMX_COLOR_FormatL16"; + case OMX_COLOR_FormatL24: return "OMX_COLOR_FormatL24"; + case OMX_COLOR_FormatL32: return "OMX_COLOR_FormatL32"; + case OMX_COLOR_FormatYUV420PackedSemiPlanar: return "OMX_COLOR_FormatYUV420PackedSemiPlanar"; + case OMX_COLOR_FormatYUV422PackedSemiPlanar: return "OMX_COLOR_FormatYUV422PackedSemiPlanar"; + case OMX_COLOR_Format18BitBGR666: return "OMX_COLOR_Format18BitBGR666"; + case OMX_COLOR_Format24BitARGB6666: return "OMX_COLOR_Format24BitARGB6666"; + case OMX_COLOR_Format24BitABGR6666: return "OMX_COLOR_Format24BitABGR6666"; + + case OMX_COLOR_FormatAndroidOpaque: return "OMX_COLOR_FormatAndroidOpaque"; + case OMX_TI_COLOR_FormatYUV420PackedSemiPlanar: return "OMX_TI_COLOR_FormatYUV420PackedSemiPlanar"; + case OMX_QCOM_COLOR_FormatYVU420SemiPlanar: return "OMX_QCOM_COLOR_FormatYVU420SemiPlanar"; + case OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka: return "OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka"; + case OMX_SEC_COLOR_FormatNV12Tiled: return "OMX_SEC_COLOR_FormatNV12Tiled"; + case OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m: return "OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m"; + + // case QOMX_COLOR_FormatYVU420SemiPlanar: return "QOMX_COLOR_FormatYVU420SemiPlanar"; + case QOMX_COLOR_FormatYVU420PackedSemiPlanar32m4ka: return "QOMX_COLOR_FormatYVU420PackedSemiPlanar32m4ka"; + case QOMX_COLOR_FormatYUV420PackedSemiPlanar16m2ka: return "QOMX_COLOR_FormatYUV420PackedSemiPlanar16m2ka"; + // case QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka: return "QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka"; + // case QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m: return "QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m"; + case QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mMultiView: return "QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mMultiView"; + case QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mCompressed: return "QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mCompressed"; + case QOMX_COLOR_Format32bitRGBA8888: return "QOMX_COLOR_Format32bitRGBA8888"; + case QOMX_COLOR_Format32bitRGBA8888Compressed: return "QOMX_COLOR_Format32bitRGBA8888Compressed"; + + default: + return "unkn"; + } +} + + +// ***** encoder functions ***** + +OmxEncoder::OmxEncoder(const char* filename, int width, int height, int fps, int bitrate, bool h265, bool downscale, bool write) { + this->filename = filename; + this->write = write; + this->width = width; + this->height = height; + this->fps = fps; + this->remuxing = !h265; + + this->downscale = downscale; + if (this->downscale) { + this->y_ptr2 = (uint8_t *)malloc(this->width*this->height); + this->u_ptr2 = (uint8_t *)malloc(this->width*this->height/4); + this->v_ptr2 = (uint8_t *)malloc(this->width*this->height/4); + } + + auto component = (OMX_STRING)(h265 ? "OMX.qcom.video.encoder.hevc" : "OMX.qcom.video.encoder.avc"); + int err = OMX_GetHandle(&this->handle, component, this, &omx_callbacks); + if (err != OMX_ErrorNone) { + LOGE("error getting codec: %x", err); + } + assert(err == OMX_ErrorNone); + // printf("handle: %p\n", this->handle); + + // setup input port + + OMX_PARAM_PORTDEFINITIONTYPE in_port = {0}; + in_port.nSize = sizeof(in_port); + in_port.nPortIndex = (OMX_U32) PORT_INDEX_IN; + OMX_CHECK(OMX_GetParameter(this->handle, OMX_IndexParamPortDefinition, (OMX_PTR) &in_port)); + + in_port.format.video.nFrameWidth = this->width; + in_port.format.video.nFrameHeight = this->height; + in_port.format.video.nStride = VENUS_Y_STRIDE(COLOR_FMT_NV12, this->width); + in_port.format.video.nSliceHeight = this->height; + // in_port.nBufferSize = (this->width * this->height * 3) / 2; + in_port.nBufferSize = VENUS_BUFFER_SIZE(COLOR_FMT_NV12, this->width, this->height); + in_port.format.video.xFramerate = (this->fps * 65536); + in_port.format.video.eCompressionFormat = OMX_VIDEO_CodingUnused; + // in_port.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar; + in_port.format.video.eColorFormat = (OMX_COLOR_FORMATTYPE)QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m; + + OMX_CHECK(OMX_SetParameter(this->handle, OMX_IndexParamPortDefinition, (OMX_PTR) &in_port)); + OMX_CHECK(OMX_GetParameter(this->handle, OMX_IndexParamPortDefinition, (OMX_PTR) &in_port)); + this->in_buf_headers.resize(in_port.nBufferCountActual); + + // setup output port + + OMX_PARAM_PORTDEFINITIONTYPE out_port = {0}; + out_port.nSize = sizeof(out_port); + out_port.nPortIndex = (OMX_U32) PORT_INDEX_OUT; + OMX_CHECK(OMX_GetParameter(this->handle, OMX_IndexParamPortDefinition, (OMX_PTR)&out_port)); + out_port.format.video.nFrameWidth = this->width; + out_port.format.video.nFrameHeight = this->height; + out_port.format.video.xFramerate = 0; + out_port.format.video.nBitrate = bitrate; + if (h265) { + out_port.format.video.eCompressionFormat = OMX_VIDEO_CodingHEVC; + } else { + out_port.format.video.eCompressionFormat = OMX_VIDEO_CodingAVC; + } + out_port.format.video.eColorFormat = OMX_COLOR_FormatUnused; + + OMX_CHECK(OMX_SetParameter(this->handle, OMX_IndexParamPortDefinition, (OMX_PTR) &out_port)); + + OMX_CHECK(OMX_GetParameter(this->handle, OMX_IndexParamPortDefinition, (OMX_PTR) &out_port)); + this->out_buf_headers.resize(out_port.nBufferCountActual); + + OMX_VIDEO_PARAM_BITRATETYPE bitrate_type = {0}; + bitrate_type.nSize = sizeof(bitrate_type); + bitrate_type.nPortIndex = (OMX_U32) PORT_INDEX_OUT; + OMX_CHECK(OMX_GetParameter(this->handle, OMX_IndexParamVideoBitrate, (OMX_PTR) &bitrate_type)); + bitrate_type.eControlRate = OMX_Video_ControlRateVariable; + bitrate_type.nTargetBitrate = bitrate; + + OMX_CHECK(OMX_SetParameter(this->handle, OMX_IndexParamVideoBitrate, (OMX_PTR) &bitrate_type)); + + if (h265) { + // setup HEVC + #ifndef QCOM2 + OMX_VIDEO_PARAM_HEVCTYPE hevc_type = {0}; + OMX_INDEXTYPE index_type = (OMX_INDEXTYPE) OMX_IndexParamVideoHevc; + #else + OMX_VIDEO_PARAM_PROFILELEVELTYPE hevc_type = {0}; + OMX_INDEXTYPE index_type = OMX_IndexParamVideoProfileLevelCurrent; + #endif + hevc_type.nSize = sizeof(hevc_type); + hevc_type.nPortIndex = (OMX_U32) PORT_INDEX_OUT; + OMX_CHECK(OMX_GetParameter(this->handle, index_type, (OMX_PTR) &hevc_type)); + + hevc_type.eProfile = OMX_VIDEO_HEVCProfileMain; + hevc_type.eLevel = OMX_VIDEO_HEVCHighTierLevel5; + + OMX_CHECK(OMX_SetParameter(this->handle, index_type, (OMX_PTR) &hevc_type)); + } else { + // setup h264 + OMX_VIDEO_PARAM_AVCTYPE avc = { 0 }; + avc.nSize = sizeof(avc); + avc.nPortIndex = (OMX_U32) PORT_INDEX_OUT; + OMX_CHECK(OMX_GetParameter(this->handle, OMX_IndexParamVideoAvc, &avc)); + + avc.nBFrames = 0; + avc.nPFrames = 15; + + avc.eProfile = OMX_VIDEO_AVCProfileHigh; + avc.eLevel = OMX_VIDEO_AVCLevel31; + + avc.nAllowedPictureTypes |= OMX_VIDEO_PictureTypeB; + avc.eLoopFilterMode = OMX_VIDEO_AVCLoopFilterEnable; + + avc.nRefFrames = 1; + avc.bUseHadamard = OMX_TRUE; + avc.bEntropyCodingCABAC = OMX_TRUE; + avc.bWeightedPPrediction = OMX_TRUE; + avc.bconstIpred = OMX_TRUE; + + OMX_CHECK(OMX_SetParameter(this->handle, OMX_IndexParamVideoAvc, &avc)); + } + + + // for (int i = 0; ; i++) { + // OMX_VIDEO_PARAM_PORTFORMATTYPE video_port_format = {0}; + // video_port_format.nSize = sizeof(video_port_format); + // video_port_format.nIndex = i; + // video_port_format.nPortIndex = PORT_INDEX_IN; + // if (OMX_GetParameter(this->handle, OMX_IndexParamVideoPortFormat, &video_port_format) != OMX_ErrorNone) + // break; + // printf("in %d: compression 0x%x format 0x%x %s\n", i, + // video_port_format.eCompressionFormat, video_port_format.eColorFormat, + // omx_color_fomat_name(video_port_format.eColorFormat)); + // } + + // for (int i=0; i<32; i++) { + // OMX_VIDEO_PARAM_PROFILELEVELTYPE params = {0}; + // params.nSize = sizeof(params); + // params.nPortIndex = PORT_INDEX_OUT; + // params.nProfileIndex = i; + // if (OMX_GetParameter(this->handle, OMX_IndexParamVideoProfileLevelQuerySupported, ¶ms) != OMX_ErrorNone) + // break; + // printf("profile %d level 0x%x\n", params.eProfile, params.eLevel); + // } + + OMX_CHECK(OMX_SendCommand(this->handle, OMX_CommandStateSet, OMX_StateIdle, NULL)); + + for (auto &buf : this->in_buf_headers) { + OMX_CHECK(OMX_AllocateBuffer(this->handle, &buf, PORT_INDEX_IN, this, + in_port.nBufferSize)); + } + + for (auto &buf : this->out_buf_headers) { + OMX_CHECK(OMX_AllocateBuffer(this->handle, &buf, PORT_INDEX_OUT, this, + out_port.nBufferSize)); + } + + wait_for_state(OMX_StateIdle); + + OMX_CHECK(OMX_SendCommand(this->handle, OMX_CommandStateSet, OMX_StateExecuting, NULL)); + + wait_for_state(OMX_StateExecuting); + + // give omx all the output buffers + for (auto &buf : this->out_buf_headers) { + // printf("fill %p\n", this->out_buf_headers[i]); + OMX_CHECK(OMX_FillThisBuffer(this->handle, buf)); + } + + // fill the input free queue + for (auto &buf : this->in_buf_headers) { + this->free_in.push(buf); + } +} + +void OmxEncoder::handle_out_buf(OmxEncoder *e, OMX_BUFFERHEADERTYPE *out_buf) { + int err; + uint8_t *buf_data = out_buf->pBuffer + out_buf->nOffset; + + if (out_buf->nFlags & OMX_BUFFERFLAG_CODECCONFIG) { + if (e->codec_config_len < out_buf->nFilledLen) { + e->codec_config = (uint8_t *)realloc(e->codec_config, out_buf->nFilledLen); + } + e->codec_config_len = out_buf->nFilledLen; + memcpy(e->codec_config, buf_data, out_buf->nFilledLen); +#ifdef QCOM2 + out_buf->nTimeStamp = 0; +#endif + } + + if (e->of) { + //printf("write %d flags 0x%x\n", out_buf->nFilledLen, out_buf->nFlags); + size_t written = util::safe_fwrite(buf_data, 1, out_buf->nFilledLen, e->of); + if (written != out_buf->nFilledLen) { + LOGE("failed to write file.errno=%d", errno); + } + } + + if (e->remuxing) { + if (!e->wrote_codec_config && e->codec_config_len > 0) { + // extradata will be freed by av_free() in avcodec_free_context() + e->codec_ctx->extradata = (uint8_t*)av_mallocz(e->codec_config_len + AV_INPUT_BUFFER_PADDING_SIZE); + e->codec_ctx->extradata_size = e->codec_config_len; + memcpy(e->codec_ctx->extradata, e->codec_config, e->codec_config_len); + + err = avcodec_parameters_from_context(e->out_stream->codecpar, e->codec_ctx); + assert(err >= 0); + err = avformat_write_header(e->ofmt_ctx, NULL); + assert(err >= 0); + + e->wrote_codec_config = true; + } + + if (out_buf->nTimeStamp > 0) { + // input timestamps are in microseconds + AVRational in_timebase = {1, 1000000}; + + AVPacket pkt; + av_init_packet(&pkt); + pkt.data = buf_data; + pkt.size = out_buf->nFilledLen; + + enum AVRounding rnd = static_cast(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); + pkt.pts = pkt.dts = av_rescale_q_rnd(out_buf->nTimeStamp, in_timebase, e->ofmt_ctx->streams[0]->time_base, rnd); + pkt.duration = av_rescale_q(50*1000, in_timebase, e->ofmt_ctx->streams[0]->time_base); + + if (out_buf->nFlags & OMX_BUFFERFLAG_SYNCFRAME) { + pkt.flags |= AV_PKT_FLAG_KEY; + } + + err = av_write_frame(e->ofmt_ctx, &pkt); + if (err < 0) { LOGW("ts encoder write issue"); } + + av_free_packet(&pkt); + } + } + + // give omx back the buffer +#ifdef QCOM2 + if (out_buf->nFlags & OMX_BUFFERFLAG_EOS) { + out_buf->nTimeStamp = 0; + } +#endif + OMX_CHECK(OMX_FillThisBuffer(e->handle, out_buf)); +} + +int OmxEncoder::encode_frame(const uint8_t *y_ptr, const uint8_t *u_ptr, const uint8_t *v_ptr, + int in_width, int in_height, uint64_t ts) { + int err; + if (!this->is_open) { + return -1; + } + + // this sometimes freezes... put it outside the encoder lock so we can still trigger rotates... + // THIS IS A REALLY BAD IDEA, but apparently the race has to happen 30 times to trigger this + //pthread_mutex_unlock(&this->lock); + OMX_BUFFERHEADERTYPE* in_buf = nullptr; + while (!this->free_in.try_pop(in_buf, 20)) { + if (do_exit) { + return -1; + } + } + + //pthread_mutex_lock(&this->lock); + + int ret = this->counter; + + uint8_t *in_buf_ptr = in_buf->pBuffer; + // printf("in_buf ptr %p\n", in_buf_ptr); + + uint8_t *in_y_ptr = in_buf_ptr; + int in_y_stride = VENUS_Y_STRIDE(COLOR_FMT_NV12, this->width); + int in_uv_stride = VENUS_UV_STRIDE(COLOR_FMT_NV12, this->width); + // uint8_t *in_uv_ptr = in_buf_ptr + (this->width * this->height); + uint8_t *in_uv_ptr = in_buf_ptr + (in_y_stride * VENUS_Y_SCANLINES(COLOR_FMT_NV12, this->height)); + + if (this->downscale) { + I420Scale(y_ptr, in_width, + u_ptr, in_width/2, + v_ptr, in_width/2, + in_width, in_height, + this->y_ptr2, this->width, + this->u_ptr2, this->width/2, + this->v_ptr2, this->width/2, + this->width, this->height, + libyuv::kFilterNone); + y_ptr = this->y_ptr2; + u_ptr = this->u_ptr2; + v_ptr = this->v_ptr2; + } + err = libyuv::I420ToNV12(y_ptr, this->width, + u_ptr, this->width/2, + v_ptr, this->width/2, + in_y_ptr, in_y_stride, + in_uv_ptr, in_uv_stride, + this->width, this->height); + assert(err == 0); + + // in_buf->nFilledLen = (this->width*this->height) + (this->width*this->height/2); + in_buf->nFilledLen = VENUS_BUFFER_SIZE(COLOR_FMT_NV12, this->width, this->height); + in_buf->nFlags = OMX_BUFFERFLAG_ENDOFFRAME; + in_buf->nOffset = 0; + in_buf->nTimeStamp = ts/1000LL; // OMX_TICKS, in microseconds + this->last_t = in_buf->nTimeStamp; + + OMX_CHECK(OMX_EmptyThisBuffer(this->handle, in_buf)); + + // pump output + while (true) { + OMX_BUFFERHEADERTYPE *out_buf; + if (!this->done_out.try_pop(out_buf)) { + break; + } + handle_out_buf(this, out_buf); + } + + this->dirty = true; + + this->counter++; + + return ret; +} + +void OmxEncoder::encoder_open(const char* path) { + int err; + + snprintf(this->vid_path, sizeof(this->vid_path), "%s/%s", path, this->filename); + LOGD("encoder_open %s remuxing:%d", this->vid_path, this->remuxing); + + if (this->remuxing) { + avformat_alloc_output_context2(&this->ofmt_ctx, NULL, NULL, this->vid_path); + assert(this->ofmt_ctx); + + this->out_stream = avformat_new_stream(this->ofmt_ctx, NULL); + assert(this->out_stream); + + // set codec correctly + av_register_all(); + + AVCodec *codec = NULL; + codec = avcodec_find_encoder(AV_CODEC_ID_H264); + assert(codec); + + this->codec_ctx = avcodec_alloc_context3(codec); + assert(this->codec_ctx); + this->codec_ctx->width = this->width; + this->codec_ctx->height = this->height; + this->codec_ctx->pix_fmt = AV_PIX_FMT_YUV420P; + this->codec_ctx->time_base = (AVRational){ 1, this->fps }; + + err = avio_open(&this->ofmt_ctx->pb, this->vid_path, AVIO_FLAG_WRITE); + assert(err >= 0); + + this->wrote_codec_config = false; + } else { + if (this->write) { + this->of = util::safe_fopen(this->vid_path, "wb"); + assert(this->of); +#ifndef QCOM2 + if (this->codec_config_len > 0) { + util::safe_fwrite(this->codec_config, 1, this->codec_config_len, this->of); + } +#endif + } + } + + // create camera lock file + snprintf(this->lock_path, sizeof(this->lock_path), "%s/%s.lock", path, this->filename); + int lock_fd = HANDLE_EINTR(open(this->lock_path, O_RDWR | O_CREAT, 0664)); + assert(lock_fd >= 0); + close(lock_fd); + + this->is_open = true; + this->counter = 0; +} + +void OmxEncoder::encoder_close() { + if (this->is_open) { + if (this->dirty) { + // drain output only if there could be frames in the encoder + + OMX_BUFFERHEADERTYPE* in_buf = this->free_in.pop(); + in_buf->nFilledLen = 0; + in_buf->nOffset = 0; + in_buf->nFlags = OMX_BUFFERFLAG_EOS; + in_buf->nTimeStamp = this->last_t + 1000000LL/this->fps; + + OMX_CHECK(OMX_EmptyThisBuffer(this->handle, in_buf)); + + while (true) { + OMX_BUFFERHEADERTYPE *out_buf = this->done_out.pop(); + + handle_out_buf(this, out_buf); + + if (out_buf->nFlags & OMX_BUFFERFLAG_EOS) { + break; + } + } + this->dirty = false; + } + + if (this->remuxing) { + av_write_trailer(this->ofmt_ctx); + avcodec_free_context(&this->codec_ctx); + avio_closep(&this->ofmt_ctx->pb); + avformat_free_context(this->ofmt_ctx); + } else { + if (this->of) { + util::safe_fflush(this->of); + fclose(this->of); + this->of = nullptr; + } + } + unlink(this->lock_path); + } + this->is_open = false; +} + +OmxEncoder::~OmxEncoder() { + assert(!this->is_open); + + OMX_CHECK(OMX_SendCommand(this->handle, OMX_CommandStateSet, OMX_StateIdle, NULL)); + + wait_for_state(OMX_StateIdle); + + OMX_CHECK(OMX_SendCommand(this->handle, OMX_CommandStateSet, OMX_StateLoaded, NULL)); + + for (auto &buf : this->in_buf_headers) { + OMX_CHECK(OMX_FreeBuffer(this->handle, PORT_INDEX_IN, buf)); + } + + for (auto &buf : this->out_buf_headers) { + OMX_CHECK(OMX_FreeBuffer(this->handle, PORT_INDEX_OUT, buf)); + } + + wait_for_state(OMX_StateLoaded); + + OMX_CHECK(OMX_FreeHandle(this->handle)); + + OMX_BUFFERHEADERTYPE *out_buf; + while (this->free_in.try_pop(out_buf)); + while (this->done_out.try_pop(out_buf)); + + if (this->codec_config) { + free(this->codec_config); + } + + if (this->downscale) { + free(this->y_ptr2); + free(this->u_ptr2); + free(this->v_ptr2); + } +} diff --git a/selfdrive/loggerd/omx_encoder.h b/selfdrive/loggerd/omx_encoder.h new file mode 100644 index 000000000..74ea17f64 --- /dev/null +++ b/selfdrive/loggerd/omx_encoder.h @@ -0,0 +1,73 @@ +#pragma once + +#include +#include +#include + +#include +extern "C" { +#include +} + +#include "selfdrive/common/queue.h" +#include "selfdrive/loggerd/encoder.h" + +// OmxEncoder, lossey codec using hardware hevc +class OmxEncoder : public VideoEncoder { +public: + OmxEncoder(const char* filename, int width, int height, int fps, int bitrate, bool h265, bool downscale, bool write = true); + ~OmxEncoder(); + int encode_frame(const uint8_t *y_ptr, const uint8_t *u_ptr, const uint8_t *v_ptr, + int in_width, int in_height, uint64_t ts); + void encoder_open(const char* path); + void encoder_close(); + + // OMX callbacks + static OMX_ERRORTYPE event_handler(OMX_HANDLETYPE component, OMX_PTR app_data, OMX_EVENTTYPE event, + OMX_U32 data1, OMX_U32 data2, OMX_PTR event_data); + static OMX_ERRORTYPE empty_buffer_done(OMX_HANDLETYPE component, OMX_PTR app_data, + OMX_BUFFERHEADERTYPE *buffer); + static OMX_ERRORTYPE fill_buffer_done(OMX_HANDLETYPE component, OMX_PTR app_data, + OMX_BUFFERHEADERTYPE *buffer); + +private: + void wait_for_state(OMX_STATETYPE state); + static void handle_out_buf(OmxEncoder *e, OMX_BUFFERHEADERTYPE *out_buf); + + int width, height, fps; + char vid_path[1024]; + char lock_path[1024]; + bool is_open = false; + bool dirty = false; + bool write = false; + int counter = 0; + + const char* filename; + FILE *of = nullptr; + + size_t codec_config_len; + uint8_t *codec_config = NULL; + bool wrote_codec_config; + + std::mutex state_lock; + std::condition_variable state_cv; + OMX_STATETYPE state = OMX_StateLoaded; + + OMX_HANDLETYPE handle; + + std::vector in_buf_headers; + std::vector out_buf_headers; + + uint64_t last_t; + + SafeQueue free_in; + SafeQueue done_out; + + AVFormatContext *ofmt_ctx; + AVCodecContext *codec_ctx; + AVStream *out_stream; + bool remuxing; + + bool downscale; + uint8_t *y_ptr2, *u_ptr2, *v_ptr2; +}; diff --git a/selfdrive/loggerd/raw_logger.cc b/selfdrive/loggerd/raw_logger.cc new file mode 100644 index 000000000..f103822a1 --- /dev/null +++ b/selfdrive/loggerd/raw_logger.cc @@ -0,0 +1,178 @@ +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#include "selfdrive/loggerd/raw_logger.h" + +#include +#include + +#include +#include +#include + +#define __STDC_CONSTANT_MACROS + +#include "libyuv.h" + +extern "C" { +#include +#include +#include +} + +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/util.h" + +RawLogger::RawLogger(const char* filename, int width, int height, int fps, + int bitrate, bool h265, bool downscale, bool write) + : filename(filename), fps(fps) { + + // TODO: respect write arg + + av_register_all(); + codec = avcodec_find_encoder(AV_CODEC_ID_FFVHUFF); + // codec = avcodec_find_encoder(AV_CODEC_ID_FFV1); + assert(codec); + + codec_ctx = avcodec_alloc_context3(codec); + assert(codec_ctx); + codec_ctx->width = width; + codec_ctx->height = height; + codec_ctx->pix_fmt = AV_PIX_FMT_YUV420P; + + // codec_ctx->thread_count = 2; + + // ffv1enc doesn't respect AV_PICTURE_TYPE_I. make every frame a key frame for now. + // codec_ctx->gop_size = 0; + + codec_ctx->time_base = (AVRational){ 1, fps }; + + int err = avcodec_open2(codec_ctx, codec, NULL); + assert(err >= 0); + + frame = av_frame_alloc(); + assert(frame); + frame->format = codec_ctx->pix_fmt; + frame->width = width; + frame->height = height; + frame->linesize[0] = width; + frame->linesize[1] = width/2; + frame->linesize[2] = width/2; + + if (downscale) { + downscale_buf.resize(width * height * 3 / 2); + } +} + +RawLogger::~RawLogger() { + av_frame_free(&frame); + avcodec_close(codec_ctx); + av_free(codec_ctx); +} + +void RawLogger::encoder_open(const char* path) { + vid_path = util::string_format("%s/%s", path, filename); + + // create camera lock file + lock_path = util::string_format("%s/%s.lock", path, filename); + + LOG("open %s\n", lock_path.c_str()); + + int lock_fd = HANDLE_EINTR(open(lock_path.c_str(), O_RDWR | O_CREAT, 0664)); + assert(lock_fd >= 0); + close(lock_fd); + + format_ctx = NULL; + avformat_alloc_output_context2(&format_ctx, NULL, "matroska", vid_path.c_str()); + assert(format_ctx); + + stream = avformat_new_stream(format_ctx, codec); + // AVStream *stream = avformat_new_stream(format_ctx, NULL); + assert(stream); + stream->id = 0; + stream->time_base = (AVRational){ 1, fps }; + // codec_ctx->time_base = stream->time_base; + + int err = avcodec_parameters_from_context(stream->codecpar, codec_ctx); + assert(err >= 0); + + err = avio_open(&format_ctx->pb, vid_path.c_str(), AVIO_FLAG_WRITE); + assert(err >= 0); + + err = avformat_write_header(format_ctx, NULL); + assert(err >= 0); + + is_open = true; + counter = 0; +} + +void RawLogger::encoder_close() { + if (!is_open) return; + + int err = av_write_trailer(format_ctx); + assert(err == 0); + + avcodec_close(stream->codec); + + err = avio_closep(&format_ctx->pb); + assert(err == 0); + + avformat_free_context(format_ctx); + format_ctx = NULL; + + unlink(lock_path.c_str()); + is_open = false; +} + +int RawLogger::encode_frame(const uint8_t *y_ptr, const uint8_t *u_ptr, const uint8_t *v_ptr, + int in_width, int in_height, uint64_t ts) { + AVPacket pkt; + av_init_packet(&pkt); + pkt.data = NULL; + pkt.size = 0; + + if (downscale_buf.size() > 0) { + uint8_t *out_y = downscale_buf.data(); + uint8_t *out_u = out_y + codec_ctx->width * codec_ctx->height; + uint8_t *out_v = out_u + (codec_ctx->width / 2) * (codec_ctx->height / 2); + libyuv::I420Scale(y_ptr, in_width, + u_ptr, in_width/2, + v_ptr, in_width/2, + in_width, in_height, + out_y, codec_ctx->width, + out_u, codec_ctx->width/2, + out_v, codec_ctx->width/2, + codec_ctx->width, codec_ctx->height, + libyuv::kFilterNone); + frame->data[0] = out_y; + frame->data[1] = out_u; + frame->data[2] = out_v; + } else { + frame->data[0] = (uint8_t*)y_ptr; + frame->data[1] = (uint8_t*)u_ptr; + frame->data[2] = (uint8_t*)v_ptr; + } + frame->pts = counter; + + int ret = counter; + + int got_output = 0; + int err = avcodec_encode_video2(codec_ctx, &pkt, frame, &got_output); + if (err) { + LOGE("encoding error\n"); + ret = -1; + } else if (got_output) { + av_packet_rescale_ts(&pkt, codec_ctx->time_base, stream->time_base); + pkt.stream_index = 0; + + err = av_interleaved_write_frame(format_ctx, &pkt); + if (err < 0) { + LOGE("encoder writer error\n"); + ret = -1; + } else { + counter++; + } + } + + av_packet_unref(&pkt); + return ret; +} diff --git a/selfdrive/loggerd/raw_logger.h b/selfdrive/loggerd/raw_logger.h new file mode 100644 index 000000000..75d906784 --- /dev/null +++ b/selfdrive/loggerd/raw_logger.h @@ -0,0 +1,43 @@ +#pragma once + +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +#include "selfdrive/loggerd/encoder.h" + +class RawLogger : public VideoEncoder { + public: + RawLogger(const char* filename, int width, int height, int fps, + int bitrate, bool h265, bool downscale, bool write = true); + ~RawLogger(); + int encode_frame(const uint8_t *y_ptr, const uint8_t *u_ptr, const uint8_t *v_ptr, + int in_width, int in_height, uint64_t ts); + void encoder_open(const char* path); + void encoder_close(); + +private: + const char* filename; + //bool write; + int fps; + int counter = 0; + bool is_open = false; + + std::string vid_path, lock_path; + + AVCodec *codec = NULL; + AVCodecContext *codec_ctx = NULL; + + AVStream *stream = NULL; + AVFormatContext *format_ctx = NULL; + + AVFrame *frame = NULL; + std::vector downscale_buf; +}; diff --git a/selfdrive/loggerd/uploader.py b/selfdrive/loggerd/uploader.py new file mode 100644 index 000000000..2013a522b --- /dev/null +++ b/selfdrive/loggerd/uploader.py @@ -0,0 +1,263 @@ +#!/usr/bin/env python3 +import json +import os +import random +import requests +import threading +import time +import traceback +from pathlib import Path + +from cereal import log +import cereal.messaging as messaging +from common.api import Api +from common.params import Params +from selfdrive.hardware import TICI +from selfdrive.loggerd.xattr_cache import getxattr, setxattr +from selfdrive.loggerd.config import ROOT +from selfdrive.swaglog import cloudlog + +NetworkType = log.DeviceState.NetworkType +UPLOAD_ATTR_NAME = 'user.upload' +UPLOAD_ATTR_VALUE = b'1' + +allow_sleep = bool(os.getenv("UPLOADER_SLEEP", "1")) +force_wifi = os.getenv("FORCEWIFI") is not None +fake_upload = os.getenv("FAKEUPLOAD") is not None + + +def get_directory_sort(d): + return list(map(lambda s: s.rjust(10, '0'), d.rsplit('--', 1))) + +def listdir_by_creation(d): + try: + paths = os.listdir(d) + paths = sorted(paths, key=get_directory_sort) + return paths + except OSError: + cloudlog.exception("listdir_by_creation failed") + return list() + +def clear_locks(root): + for logname in os.listdir(root): + path = os.path.join(root, logname) + try: + for fname in os.listdir(path): + if fname.endswith(".lock"): + os.unlink(os.path.join(path, fname)) + except OSError: + cloudlog.exception("clear_locks failed") + + +class Uploader(): + def __init__(self, dongle_id, root): + self.dongle_id = dongle_id + self.api = Api(dongle_id) + self.root = root + + self.upload_thread = None + + self.last_resp = None + self.last_exc = None + + self.immediate_size = 0 + self.immediate_count = 0 + + # stats for last successfully uploaded file + self.last_time = 0 + self.last_speed = 0 + self.last_filename = "" + + self.immediate_folders = ["crash/", "boot/"] + self.immediate_priority = {"qlog.bz2": 0, "qcamera.ts": 1} + + def get_upload_sort(self, name): + if name in self.immediate_priority: + return self.immediate_priority[name] + return 1000 + + def list_upload_files(self): + if not os.path.isdir(self.root): + return + + self.immediate_size = 0 + self.immediate_count = 0 + + for logname in listdir_by_creation(self.root): + path = os.path.join(self.root, logname) + try: + names = os.listdir(path) + except OSError: + continue + + if any(name.endswith(".lock") for name in names): + continue + + for name in sorted(names, key=self.get_upload_sort): + key = os.path.join(logname, name) + fn = os.path.join(path, name) + # skip files already uploaded + try: + is_uploaded = getxattr(fn, UPLOAD_ATTR_NAME) + except OSError: + cloudlog.event("uploader_getxattr_failed", exc=self.last_exc, key=key, fn=fn) + is_uploaded = True # deleter could have deleted + if is_uploaded: + continue + + try: + if name in self.immediate_priority: + self.immediate_count += 1 + self.immediate_size += os.path.getsize(fn) + except OSError: + pass + + yield (name, key, fn) + + def next_file_to_upload(self): + upload_files = list(self.list_upload_files()) + + for name, key, fn in upload_files: + if any(f in fn for f in self.immediate_folders): + return (key, fn) + + for name, key, fn in upload_files: + if name in self.immediate_priority: + return (key, fn) + + return None + + def do_upload(self, key, fn): + try: + url_resp = self.api.get("v1.4/" + self.dongle_id + "/upload_url/", timeout=10, path=key, access_token=self.api.get_token()) + if url_resp.status_code == 412: + self.last_resp = url_resp + return + + url_resp_json = json.loads(url_resp.text) + url = url_resp_json['url'] + headers = url_resp_json['headers'] + cloudlog.debug("upload_url v1.4 %s %s", url, str(headers)) + + if fake_upload: + cloudlog.debug(f"*** WARNING, THIS IS A FAKE UPLOAD TO {url} ***") + + class FakeResponse(): + def __init__(self): + self.status_code = 200 + + self.last_resp = FakeResponse() + else: + with open(fn, "rb") as f: + self.last_resp = requests.put(url, data=f, headers=headers, timeout=10) + except Exception as e: + self.last_exc = (e, traceback.format_exc()) + raise + + def normal_upload(self, key, fn): + self.last_resp = None + self.last_exc = None + + try: + self.do_upload(key, fn) + except Exception: + pass + + return self.last_resp + + def upload(self, key, fn, network_type): + try: + sz = os.path.getsize(fn) + except OSError: + cloudlog.exception("upload: getsize failed") + return False + + cloudlog.event("upload_start", key=key, fn=fn, sz=sz, network_type=network_type) + + if sz == 0: + try: + # tag files of 0 size as uploaded + setxattr(fn, UPLOAD_ATTR_NAME, UPLOAD_ATTR_VALUE) + except OSError: + cloudlog.event("uploader_setxattr_failed", exc=self.last_exc, key=key, fn=fn, sz=sz) + success = True + else: + start_time = time.monotonic() + stat = self.normal_upload(key, fn) + if stat is not None and stat.status_code in (200, 201, 403, 412): + try: + # tag file as uploaded + setxattr(fn, UPLOAD_ATTR_NAME, UPLOAD_ATTR_VALUE) + except OSError: + cloudlog.event("uploader_setxattr_failed", exc=self.last_exc, key=key, fn=fn, sz=sz) + + self.last_filename = fn + self.last_time = time.monotonic() - start_time + self.last_speed = (sz / 1e6) / self.last_time + success = True + cloudlog.event("upload_success" if stat.status_code != 412 else "upload_ignored", key=key, fn=fn, sz=sz, network_type=network_type) + else: + success = False + cloudlog.event("upload_failed", stat=stat, exc=self.last_exc, key=key, fn=fn, sz=sz, network_type=network_type) + + return success + + def get_msg(self): + msg = messaging.new_message("uploaderState") + us = msg.uploaderState + us.immediateQueueSize = int(self.immediate_size / 1e6) + us.immediateQueueCount = self.immediate_count + us.lastTime = self.last_time + us.lastSpeed = self.last_speed + us.lastFilename = self.last_filename + return msg + +def uploader_fn(exit_event): + params = Params() + dongle_id = params.get("DongleId", encoding='utf8') + + if dongle_id is None: + cloudlog.info("uploader missing dongle_id") + raise Exception("uploader can't start without dongle id") + + if TICI and not Path("/data/media").is_mount(): + cloudlog.warning("NVME not mounted") + + sm = messaging.SubMaster(['deviceState']) + pm = messaging.PubMaster(['uploaderState']) + uploader = Uploader(dongle_id, ROOT) + + backoff = 0.1 + while not exit_event.is_set(): + sm.update(0) + offroad = params.get_bool("IsOffroad") + network_type = sm['deviceState'].networkType if not force_wifi else NetworkType.wifi + if network_type == NetworkType.none: + if allow_sleep: + time.sleep(60 if offroad else 5) + continue + + d = uploader.next_file_to_upload() + if d is None: # Nothing to upload + if allow_sleep: + time.sleep(60 if offroad else 5) + continue + + key, fn = d + + success = uploader.upload(key, fn, sm['deviceState'].networkType.raw) + if success: + backoff = 0.1 + elif allow_sleep: + cloudlog.info("upload backoff %r", backoff) + time.sleep(backoff + random.uniform(0, backoff)) + backoff = min(backoff*2, 120) + + pm.send("uploaderState", uploader.get_msg()) + +def main(): + uploader_fn(threading.Event()) + + +if __name__ == "__main__": + main() diff --git a/selfdrive/loggerd/xattr_cache.py b/selfdrive/loggerd/xattr_cache.py new file mode 100644 index 000000000..e72169250 --- /dev/null +++ b/selfdrive/loggerd/xattr_cache.py @@ -0,0 +1,15 @@ +from typing import Dict, Tuple + +from common.xattr import getxattr as getattr1 +from common.xattr import setxattr as setattr1 + +cached_attributes: Dict[Tuple, bytes] = {} +def getxattr(path: str, attr_name: bytes) -> bytes: + if (path, attr_name) not in cached_attributes: + response = getattr1(path, attr_name) + cached_attributes[(path, attr_name)] = response + return cached_attributes[(path, attr_name)] + +def setxattr(path: str, attr_name: str, attr_value: bytes) -> None: + cached_attributes.pop((path, attr_name), None) + return setattr1(path, attr_name, attr_value) diff --git a/selfdrive/logmessaged.py b/selfdrive/logmessaged.py new file mode 100755 index 000000000..1d1fab516 --- /dev/null +++ b/selfdrive/logmessaged.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 +import zmq +from typing import NoReturn + +import cereal.messaging as messaging +from common.logging_extra import SwagLogFileFormatter +from selfdrive.swaglog import get_file_handler + + +def main() -> NoReturn: + log_handler = get_file_handler() + log_handler.setFormatter(SwagLogFileFormatter(None)) + log_level = 20 # logging.INFO + + ctx = zmq.Context().instance() + sock = ctx.socket(zmq.PULL) + sock.bind("ipc:///tmp/logmessage") + + # and we publish them + log_message_sock = messaging.pub_sock('logMessage') + error_log_message_sock = messaging.pub_sock('errorLogMessage') + + while True: + dat = b''.join(sock.recv_multipart()) + level = dat[0] + record = dat[1:].decode("utf-8") + if level >= log_level: + log_handler.emit(record) + + # then we publish them + msg = messaging.new_message() + msg.logMessage = record + log_message_sock.send(msg.to_bytes()) + + if level >= 40: # logging.ERROR + msg = messaging.new_message() + msg.errorLogMessage = record + error_log_message_sock.send(msg.to_bytes()) + + +if __name__ == "__main__": + main() diff --git a/selfdrive/manager/__init__.py b/selfdrive/manager/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/manager/build.py b/selfdrive/manager/build.py new file mode 100755 index 000000000..4b97855f3 --- /dev/null +++ b/selfdrive/manager/build.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 +import os +import subprocess +import sys +import time +import textwrap +from pathlib import Path + +# NOTE: Do NOT import anything here that needs be built (e.g. params) +from common.basedir import BASEDIR +from common.spinner import Spinner +from common.text_window import TextWindow +from selfdrive.hardware import TICI +from selfdrive.swaglog import cloudlog, add_file_handler +from selfdrive.version import is_dirty + +MAX_CACHE_SIZE = 4e9 if "CI" in os.environ else 2e9 +CACHE_DIR = Path("/data/scons_cache" if TICI else "/tmp/scons_cache") + +TOTAL_SCONS_NODES = 2405 +MAX_BUILD_PROGRESS = 100 +PREBUILT = os.path.exists(os.path.join(BASEDIR, 'prebuilt')) + + +def build(spinner: Spinner, dirty: bool = False) -> None: + env = os.environ.copy() + env['SCONS_PROGRESS'] = "1" + nproc = os.cpu_count() + j_flag = "" if nproc is None else f"-j{nproc - 1}" + + for retry in [True, False]: + scons = subprocess.Popen(["scons", j_flag, "--cache-populate"], cwd=BASEDIR, env=env, stderr=subprocess.PIPE) + assert scons.stderr is not None + + compile_output = [] + + # Read progress from stderr and update spinner + while scons.poll() is None: + try: + line = scons.stderr.readline() + if line is None: + continue + line = line.rstrip() + + prefix = b'progress: ' + if line.startswith(prefix): + i = int(line[len(prefix):]) + spinner.update_progress(MAX_BUILD_PROGRESS * min(1., i / TOTAL_SCONS_NODES), 100.) + elif len(line): + compile_output.append(line) + print(line.decode('utf8', 'replace')) + except Exception: + pass + + if scons.returncode != 0: + # Read remaining output + r = scons.stderr.read().split(b'\n') + compile_output += r + + if retry and (not dirty): + if not os.getenv("CI"): + print("scons build failed, cleaning in") + for i in range(3, -1, -1): + print("....%d" % i) + time.sleep(1) + subprocess.check_call(["scons", "-c"], cwd=BASEDIR, env=env) + else: + print("scons build failed after retry") + sys.exit(1) + else: + # Build failed log errors + errors = [line.decode('utf8', 'replace') for line in compile_output + if any(err in line for err in [b'error: ', b'not found, needed by target'])] + error_s = "\n".join(errors) + add_file_handler(cloudlog) + cloudlog.error("scons build failed\n" + error_s) + + # Show TextWindow + spinner.close() + if not os.getenv("CI"): + error_s = "\n \n".join("\n".join(textwrap.wrap(e, 65)) for e in errors) + with TextWindow("openpilot failed to build\n \n" + error_s) as t: + t.wait_for_exit() + exit(1) + else: + break + + # enforce max cache size + cache_files = [f for f in CACHE_DIR.rglob('*') if f.is_file()] + cache_files.sort(key=lambda f: f.stat().st_mtime) + cache_size = sum(f.stat().st_size for f in cache_files) + for f in cache_files: + if cache_size < MAX_CACHE_SIZE: + break + cache_size -= f.stat().st_size + f.unlink() + + +if __name__ == "__main__" and not PREBUILT: + spinner = Spinner() + spinner.update_progress(0, 100) + build(spinner, is_dirty()) diff --git a/selfdrive/manager/helpers.py b/selfdrive/manager/helpers.py new file mode 100644 index 000000000..b07362dd4 --- /dev/null +++ b/selfdrive/manager/helpers.py @@ -0,0 +1,38 @@ +import os +import sys +import fcntl +import errno +import signal + + +def unblock_stdout() -> None: + # get a non-blocking stdout + child_pid, child_pty = os.forkpty() + if child_pid != 0: # parent + + # child is in its own process group, manually pass kill signals + signal.signal(signal.SIGINT, lambda signum, frame: os.kill(child_pid, signal.SIGINT)) + signal.signal(signal.SIGTERM, lambda signum, frame: os.kill(child_pid, signal.SIGTERM)) + + fcntl.fcntl(sys.stdout, fcntl.F_SETFL, fcntl.fcntl(sys.stdout, fcntl.F_GETFL) | os.O_NONBLOCK) + + while True: + try: + dat = os.read(child_pty, 4096) + except OSError as e: + if e.errno == errno.EIO: + break + continue + + if not dat: + break + + try: + sys.stdout.write(dat.decode('utf8')) + except (OSError, UnicodeDecodeError): + pass + + # os.wait() returns a tuple with the pid and a 16 bit value + # whose low byte is the signal number and whose high byte is the exit satus + exit_status = os.wait()[1] >> 8 + os._exit(exit_status) diff --git a/selfdrive/manager/manager.py b/selfdrive/manager/manager.py new file mode 100755 index 000000000..21b8cb965 --- /dev/null +++ b/selfdrive/manager/manager.py @@ -0,0 +1,233 @@ +#!/usr/bin/env python3 +import datetime +import os +import signal +import subprocess +import sys +import traceback +from typing import List, Tuple, Union + +import cereal.messaging as messaging +import selfdrive.sentry as sentry +from common.basedir import BASEDIR +from common.params import Params, ParamKeyType +from common.text_window import TextWindow +from selfdrive.boardd.set_time import set_time +from selfdrive.hardware import HARDWARE, PC +from selfdrive.manager.helpers import unblock_stdout +from selfdrive.manager.process import ensure_running +from selfdrive.manager.process_config import managed_processes +from selfdrive.athena.registration import register, UNREGISTERED_DONGLE_ID +from selfdrive.swaglog import cloudlog, add_file_handler +from selfdrive.version import is_dirty, get_commit, get_version, get_origin, get_short_branch, \ + terms_version, training_version + + +sys.path.append(os.path.join(BASEDIR, "pyextra")) + + +def manager_init() -> None: + # update system time from panda + set_time(cloudlog) + + # save boot log + subprocess.call("./bootlog", cwd=os.path.join(BASEDIR, "selfdrive/loggerd")) + + params = Params() + params.clear_all(ParamKeyType.CLEAR_ON_MANAGER_START) + + default_params: List[Tuple[str, Union[str, bytes]]] = [ + ("CompletedTrainingVersion", "0"), + ("HasAcceptedTerms", "0"), + ("OpenpilotEnabledToggle", "1"), + ] + if not PC: + default_params.append(("LastUpdateTime", datetime.datetime.utcnow().isoformat().encode('utf8'))) + + if params.get_bool("RecordFrontLock"): + params.put_bool("RecordFront", True) + + if not params.get_bool("DisableRadar_Allow"): + params.delete("DisableRadar") + + # set unset params + for k, v in default_params: + if params.get(k) is None: + params.put(k, v) + + # is this dashcam? + if os.getenv("PASSIVE") is not None: + params.put_bool("Passive", bool(int(os.getenv("PASSIVE", "0")))) + + if params.get("Passive") is None: + raise Exception("Passive must be set to continue") + + # Create folders needed for msgq + try: + os.mkdir("/dev/shm") + except FileExistsError: + pass + except PermissionError: + print("WARNING: failed to make /dev/shm") + + # set version params + params.put("Version", get_version()) + params.put("TermsVersion", terms_version) + params.put("TrainingVersion", training_version) + params.put("GitCommit", get_commit(default="")) + params.put("GitBranch", get_short_branch(default="")) + params.put("GitRemote", get_origin(default="")) + + # set dongle id + reg_res = register(show_spinner=True) + if reg_res: + dongle_id = reg_res + else: + serial = params.get("HardwareSerial") + raise Exception(f"Registration failed for device {serial}") + os.environ['DONGLE_ID'] = dongle_id # Needed for swaglog + + if not is_dirty(): + os.environ['CLEAN'] = '1' + + # init logging + sentry.init(sentry.SentryProject.SELFDRIVE) + cloudlog.bind_global(dongle_id=dongle_id, version=get_version(), dirty=is_dirty(), + device=HARDWARE.get_device_type()) + + +def manager_prepare() -> None: + for p in managed_processes.values(): + p.prepare() + + +def manager_cleanup() -> None: + # send signals to kill all procs + for p in managed_processes.values(): + p.stop(block=False) + + # ensure all are killed + for p in managed_processes.values(): + p.stop(block=True) + + cloudlog.info("everything is dead") + + +def manager_thread() -> None: + cloudlog.bind(daemon="manager") + cloudlog.info("manager start") + cloudlog.info({"environ": os.environ}) + + params = Params() + + ignore: List[str] = [] + if params.get("DongleId", encoding='utf8') in (None, UNREGISTERED_DONGLE_ID): + ignore += ["manage_athenad", "uploader"] + if os.getenv("NOBOARD") is not None: + ignore.append("pandad") + ignore += [x for x in os.getenv("BLOCK", "").split(",") if len(x) > 0] + + ensure_running(managed_processes.values(), started=False, not_run=ignore) + + started_prev = False + sm = messaging.SubMaster(['deviceState']) + pm = messaging.PubMaster(['managerState']) + + while True: + sm.update() + not_run = ignore[:] + + started = sm['deviceState'].started + driverview = params.get_bool("IsDriverViewEnabled") + ensure_running(managed_processes.values(), started, driverview, not_run) + + # trigger an update after going offroad + if started_prev and not started and 'updated' in managed_processes: + os.sync() + managed_processes['updated'].signal(signal.SIGHUP) + + started_prev = started + + running = ' '.join("%s%s\u001b[0m" % ("\u001b[32m" if p.proc.is_alive() else "\u001b[31m", p.name) + for p in managed_processes.values() if p.proc) + print(running) + cloudlog.debug(running) + + # send managerState + msg = messaging.new_message('managerState') + msg.managerState.processes = [p.get_process_state_msg() for p in managed_processes.values()] + pm.send('managerState', msg) + + # Exit main loop when uninstall/shutdown/reboot is needed + shutdown = False + for param in ("DoUninstall", "DoShutdown", "DoReboot"): + if params.get_bool(param): + shutdown = True + params.put("LastManagerExitReason", param) + cloudlog.warning(f"Shutting down manager - {param} set") + + if shutdown: + break + + +def main() -> None: + prepare_only = os.getenv("PREPAREONLY") is not None + + manager_init() + + # Start UI early so prepare can happen in the background + if not prepare_only: + managed_processes['ui'].start() + + manager_prepare() + + if prepare_only: + return + + # SystemExit on sigterm + signal.signal(signal.SIGTERM, lambda signum, frame: sys.exit(1)) + + try: + manager_thread() + except Exception: + traceback.print_exc() + sentry.capture_exception() + finally: + manager_cleanup() + + params = Params() + if params.get_bool("DoUninstall"): + cloudlog.warning("uninstalling") + HARDWARE.uninstall() + elif params.get_bool("DoReboot"): + cloudlog.warning("reboot") + HARDWARE.reboot() + elif params.get_bool("DoShutdown"): + cloudlog.warning("shutdown") + HARDWARE.shutdown() + + +if __name__ == "__main__": + unblock_stdout() + + try: + main() + except Exception: + add_file_handler(cloudlog) + cloudlog.exception("Manager failed to start") + + try: + managed_processes['ui'].stop() + except Exception: + pass + + # Show last 3 lines of traceback + error = traceback.format_exc(-3) + error = "Manager failed to start\n\n" + error + with TextWindow(error) as t: + t.wait_for_exit() + + raise + + # manual exit because we are forked + sys.exit(0) diff --git a/selfdrive/manager/process.py b/selfdrive/manager/process.py new file mode 100644 index 000000000..ebdd2a90b --- /dev/null +++ b/selfdrive/manager/process.py @@ -0,0 +1,306 @@ +import importlib +import os +import signal +import struct +import time +import subprocess +from typing import Optional, List, ValuesView +from abc import ABC, abstractmethod +from multiprocessing import Process + +from setproctitle import setproctitle # pylint: disable=no-name-in-module + +import cereal.messaging as messaging +import selfdrive.sentry as sentry +from common.basedir import BASEDIR +from common.params import Params +from common.realtime import sec_since_boot +from selfdrive.swaglog import cloudlog +from selfdrive.hardware import HARDWARE +from cereal import log + +WATCHDOG_FN = "/dev/shm/wd_" +ENABLE_WATCHDOG = os.getenv("NO_WATCHDOG") is None + + +def launcher(proc: str, name: str) -> None: + try: + # import the process + mod = importlib.import_module(proc) + + # rename the process + setproctitle(proc) + + # create new context since we forked + messaging.context = messaging.Context() + + # add daemon name tag to logs + cloudlog.bind(daemon=name) + sentry.set_tag("daemon", name) + + # exec the process + getattr(mod, 'main')() + except KeyboardInterrupt: + cloudlog.warning(f"child {proc} got SIGINT") + except Exception: + # can't install the crash handler because sys.excepthook doesn't play nice + # with threads, so catch it here. + sentry.capture_exception() + raise + + +def nativelauncher(pargs: List[str], cwd: str, name: str) -> None: + os.environ['MANAGER_DAEMON'] = name + + # exec the process + os.chdir(cwd) + os.execvp(pargs[0], pargs) + + +def join_process(process: Process, timeout: float) -> None: + # Process().join(timeout) will hang due to a python 3 bug: https://bugs.python.org/issue28382 + # We have to poll the exitcode instead + t = time.monotonic() + while time.monotonic() - t < timeout and process.exitcode is None: + time.sleep(0.001) + + +class ManagerProcess(ABC): + unkillable = False + daemon = False + sigkill = False + persistent = False + driverview = False + proc: Optional[Process] = None + enabled = True + name = "" + + last_watchdog_time = 0 + watchdog_max_dt = None + watchdog_seen = False + shutting_down = False + + @abstractmethod + def prepare(self) -> None: + pass + + @abstractmethod + def start(self) -> None: + pass + + def restart(self) -> None: + self.stop() + self.start() + + def check_watchdog(self, started: bool) -> None: + if self.watchdog_max_dt is None or self.proc is None: + return + + try: + fn = WATCHDOG_FN + str(self.proc.pid) + # TODO: why can't pylint find struct.unpack? + self.last_watchdog_time = struct.unpack('Q', open(fn, "rb").read())[0] # pylint: disable=no-member + except Exception: + pass + + dt = sec_since_boot() - self.last_watchdog_time / 1e9 + + if dt > self.watchdog_max_dt: + # Only restart while offroad for now + if self.watchdog_seen and ENABLE_WATCHDOG: + cloudlog.error(f"Watchdog timeout for {self.name} (exitcode {self.proc.exitcode}) restarting ({started=})") + self.restart() + else: + self.watchdog_seen = True + + def stop(self, retry: bool=True, block: bool=True) -> Optional[int]: + if self.proc is None: + return None + + if self.proc.exitcode is None: + if not self.shutting_down: + cloudlog.info(f"killing {self.name}") + sig = signal.SIGKILL if self.sigkill else signal.SIGINT + self.signal(sig) + self.shutting_down = True + + if not block: + return None + + join_process(self.proc, 5) + + # If process failed to die send SIGKILL or reboot + if self.proc.exitcode is None and retry: + if self.unkillable: + cloudlog.critical(f"unkillable process {self.name} failed to exit! rebooting in 15 if it doesn't die") + join_process(self.proc, 15) + + if self.proc.exitcode is None: + cloudlog.critical(f"unkillable process {self.name} failed to die!") + os.system("date >> /data/unkillable_reboot") + os.sync() + HARDWARE.reboot() + raise RuntimeError + else: + cloudlog.info(f"killing {self.name} with SIGKILL") + self.signal(signal.SIGKILL) + self.proc.join() + + ret = self.proc.exitcode + cloudlog.info(f"{self.name} is dead with {ret}") + + if self.proc.exitcode is not None: + self.shutting_down = False + self.proc = None + + return ret + + def signal(self, sig: int) -> None: + if self.proc is None: + return + + # Don't signal if already exited + if self.proc.exitcode is not None and self.proc.pid is not None: + return + + # Can't signal if we don't have a pid + if self.proc.pid is None: + return + + cloudlog.info(f"sending signal {sig} to {self.name}") + os.kill(self.proc.pid, sig) + + def get_process_state_msg(self): + state = log.ManagerState.ProcessState.new_message() + state.name = self.name + if self.proc: + state.running = self.proc.is_alive() + state.shouldBeRunning = self.proc is not None and not self.shutting_down + state.pid = self.proc.pid or 0 + state.exitCode = self.proc.exitcode or 0 + return state + + +class NativeProcess(ManagerProcess): + def __init__(self, name, cwd, cmdline, enabled=True, persistent=False, driverview=False, unkillable=False, sigkill=False, watchdog_max_dt=None): + self.name = name + self.cwd = cwd + self.cmdline = cmdline + self.enabled = enabled + self.persistent = persistent + self.driverview = driverview + self.unkillable = unkillable + self.sigkill = sigkill + self.watchdog_max_dt = watchdog_max_dt + + def prepare(self) -> None: + pass + + def start(self) -> None: + # In case we only tried a non blocking stop we need to stop it before restarting + if self.shutting_down: + self.stop() + + if self.proc is not None: + return + + cwd = os.path.join(BASEDIR, self.cwd) + cloudlog.info(f"starting process {self.name}") + self.proc = Process(name=self.name, target=nativelauncher, args=(self.cmdline, cwd, self.name)) + self.proc.start() + self.watchdog_seen = False + self.shutting_down = False + + +class PythonProcess(ManagerProcess): + def __init__(self, name, module, enabled=True, persistent=False, driverview=False, unkillable=False, sigkill=False, watchdog_max_dt=None): + self.name = name + self.module = module + self.enabled = enabled + self.persistent = persistent + self.driverview = driverview + self.unkillable = unkillable + self.sigkill = sigkill + self.watchdog_max_dt = watchdog_max_dt + + def prepare(self) -> None: + if self.enabled: + cloudlog.info(f"preimporting {self.module}") + importlib.import_module(self.module) + + def start(self) -> None: + # In case we only tried a non blocking stop we need to stop it before restarting + if self.shutting_down: + self.stop() + + if self.proc is not None: + return + + cloudlog.info(f"starting python {self.module}") + self.proc = Process(name=self.name, target=launcher, args=(self.module, self.name)) + self.proc.start() + self.watchdog_seen = False + self.shutting_down = False + + +class DaemonProcess(ManagerProcess): + """Python process that has to stay running across manager restart. + This is used for athena so you don't lose SSH access when restarting manager.""" + def __init__(self, name, module, param_name, enabled=True): + self.name = name + self.module = module + self.param_name = param_name + self.enabled = enabled + self.persistent = True + + def prepare(self) -> None: + pass + + def start(self) -> None: + params = Params() + pid = params.get(self.param_name, encoding='utf-8') + + if pid is not None: + try: + os.kill(int(pid), 0) + with open(f'/proc/{pid}/cmdline') as f: + if self.module in f.read(): + # daemon is running + return + except (OSError, FileNotFoundError): + # process is dead + pass + + cloudlog.info(f"starting daemon {self.name}") + proc = subprocess.Popen(['python', '-m', self.module], # pylint: disable=subprocess-popen-preexec-fn + stdin=open('/dev/null'), + stdout=open('/dev/null', 'w'), + stderr=open('/dev/null', 'w'), + preexec_fn=os.setpgrp) + + params.put(self.param_name, str(proc.pid)) + + def stop(self, retry=True, block=True) -> None: + pass + + +def ensure_running(procs: ValuesView[ManagerProcess], started: bool, driverview: bool=False, not_run: Optional[List[str]]=None) -> None: + if not_run is None: + not_run = [] + + for p in procs: + if p.name in not_run: + p.stop(block=False) + elif not p.enabled: + p.stop(block=False) + elif p.persistent: + p.start() + elif p.driverview and driverview: + p.start() + elif started: + p.start() + else: + p.stop(block=False) + + p.check_watchdog(started) + diff --git a/selfdrive/manager/process_config.py b/selfdrive/manager/process_config.py new file mode 100644 index 000000000..c017e48fa --- /dev/null +++ b/selfdrive/manager/process_config.py @@ -0,0 +1,47 @@ +import os + +from selfdrive.hardware import EON, TICI, PC +from selfdrive.manager.process import PythonProcess, NativeProcess, DaemonProcess + +WEBCAM = os.getenv("USE_WEBCAM") is not None + +procs = [ + DaemonProcess("manage_athenad", "selfdrive.athena.manage_athenad", "AthenadPid"), + # due to qualcomm kernel bugs SIGKILLing camerad sometimes causes page table corruption + NativeProcess("camerad", "selfdrive/camerad", ["./camerad"], unkillable=True, driverview=True), + NativeProcess("clocksd", "selfdrive/clocksd", ["./clocksd"]), + NativeProcess("dmonitoringmodeld", "selfdrive/modeld", ["./dmonitoringmodeld"], enabled=(not PC or WEBCAM), driverview=True), + NativeProcess("logcatd", "selfdrive/logcatd", ["./logcatd"]), + NativeProcess("loggerd", "selfdrive/loggerd", ["./loggerd"]), + NativeProcess("modeld", "selfdrive/modeld", ["./modeld"]), + NativeProcess("navd", "selfdrive/ui/navd", ["./navd"], enabled=(PC or TICI), persistent=True), + NativeProcess("proclogd", "selfdrive/proclogd", ["./proclogd"]), + NativeProcess("sensord", "selfdrive/sensord", ["./sensord"], enabled=not PC, persistent=EON, sigkill=EON), + NativeProcess("ubloxd", "selfdrive/locationd", ["./ubloxd"], enabled=(not PC or WEBCAM)), + NativeProcess("ui", "selfdrive/ui", ["./ui"], persistent=True, watchdog_max_dt=(5 if TICI else None)), + NativeProcess("soundd", "selfdrive/ui/soundd", ["./soundd"], persistent=True), + NativeProcess("locationd", "selfdrive/locationd", ["./locationd"]), + NativeProcess("boardd", "selfdrive/boardd", ["./boardd"], enabled=False), + PythonProcess("calibrationd", "selfdrive.locationd.calibrationd"), + PythonProcess("controlsd", "selfdrive.controls.controlsd"), + PythonProcess("deleter", "selfdrive.loggerd.deleter", persistent=True), + PythonProcess("dmonitoringd", "selfdrive.monitoring.dmonitoringd", enabled=(not PC or WEBCAM), driverview=True), + PythonProcess("logmessaged", "selfdrive.logmessaged", persistent=True), + PythonProcess("pandad", "selfdrive.pandad", persistent=True), + PythonProcess("paramsd", "selfdrive.locationd.paramsd"), + PythonProcess("plannerd", "selfdrive.controls.plannerd"), + PythonProcess("radard", "selfdrive.controls.radard"), + PythonProcess("thermald", "selfdrive.thermald.thermald", persistent=True), + PythonProcess("timezoned", "selfdrive.timezoned", enabled=TICI, persistent=True), + PythonProcess("tombstoned", "selfdrive.tombstoned", enabled=not PC, persistent=True), + PythonProcess("updated", "selfdrive.updated", enabled=not PC, persistent=True), + PythonProcess("uploader", "selfdrive.loggerd.uploader", persistent=True), + PythonProcess("statsd", "selfdrive.statsd", persistent=True), + + # EON only + PythonProcess("rtshield", "selfdrive.rtshield", enabled=EON), + PythonProcess("shutdownd", "selfdrive.hardware.eon.shutdownd", enabled=EON), + PythonProcess("androidd", "selfdrive.hardware.eon.androidd", enabled=EON, persistent=True), +] + +managed_processes = {p.name: p for p in procs} diff --git a/selfdrive/manager/test/__init__.py b/selfdrive/manager/test/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/manager/test/test_manager.py b/selfdrive/manager/test/test_manager.py new file mode 100755 index 000000000..d16a14503 --- /dev/null +++ b/selfdrive/manager/test/test_manager.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python3 +import os +import signal +import time +import unittest + +import selfdrive.manager.manager as manager +from selfdrive.hardware import EON, TICI, HARDWARE +from selfdrive.manager.process import DaemonProcess +from selfdrive.manager.process_config import managed_processes + +os.environ['FAKEUPLOAD'] = "1" + +# TODO: make eon fast +MAX_STARTUP_TIME = 30 if EON else 15 +ALL_PROCESSES = [p.name for p in managed_processes.values() if (type(p) is not DaemonProcess) and p.enabled and (p.name not in ['updated', 'pandad'])] + + +class TestManager(unittest.TestCase): + def setUp(self): + os.environ['PASSIVE'] = '0' + HARDWARE.set_power_save(False) + + def tearDown(self): + manager.manager_cleanup() + + def test_manager_prepare(self): + os.environ['PREPAREONLY'] = '1' + manager.main() + + def test_startup_time(self): + for _ in range(10): + start = time.monotonic() + os.environ['PREPAREONLY'] = '1' + manager.main() + t = time.monotonic() - start + assert t < MAX_STARTUP_TIME, f"startup took {t}s, expected <{MAX_STARTUP_TIME}s" + + # ensure all processes exit cleanly + def test_clean_exit(self): + HARDWARE.set_power_save(False) + manager.manager_prepare() + for p in ALL_PROCESSES: + managed_processes[p].start() + + time.sleep(10) + + for p in reversed(ALL_PROCESSES): + state = managed_processes[p].get_process_state_msg() + self.assertTrue(state.running, f"{p} not running") + + exit_code = managed_processes[p].stop(retry=False) + if (TICI and p in ['ui', 'navd']) or (EON and p == 'logcatd'): + # TODO: make Qt UI exit gracefully + continue + + # Make sure the process is actually dead + managed_processes[p].stop() + + # TODO: interrupted blocking read exits with 1 in cereal. use a more unique return code + exit_codes = [0, 1] + if managed_processes[p].sigkill: + exit_codes = [-signal.SIGKILL] + assert exit_code in exit_codes, f"{p} died with {exit_code}" + + +if __name__ == "__main__": + unittest.main() diff --git a/selfdrive/modeld/SConscript b/selfdrive/modeld/SConscript new file mode 100644 index 000000000..022dc32e1 --- /dev/null +++ b/selfdrive/modeld/SConscript @@ -0,0 +1,87 @@ +import os + +Import('env', 'arch', 'cereal', 'messaging', 'common', 'gpucommon', 'visionipc') +lenv = env.Clone() + +libs = [cereal, messaging, common, visionipc, gpucommon, + 'OpenCL', 'SNPE', 'symphony-cpu', 'capnp', 'zmq', 'kj', 'yuv'] + +def get_dlsym_offset(): + """Returns the offset between dlopen and dlsym in libdl.so""" + import ctypes + libdl = ctypes.PyDLL('libdl.so') + dlopen = ctypes.cast(libdl.dlopen, ctypes.c_void_p).value + dlsym = ctypes.cast(libdl.dlsym, ctypes.c_void_p).value + return dlsym - dlopen + + +common_src = [ + "models/commonmodel.cc", + "runners/snpemodel.cc", + "transforms/loadyuv.cc", + "transforms/transform.cc" +] + +thneed_src = [ + "thneed/thneed.cc", + "thneed/serialize.cc", + "thneed/optimizer.cc", + "runners/thneedmodel.cc", +] + +use_thneed = not GetOption('no_thneed') + +if arch == "aarch64" or arch == "larch64": + libs += ['gsl', 'CB'] + libs += ['gnustl_shared'] if arch == "aarch64" else ['pthread', 'dl'] + + if use_thneed: + common_src += thneed_src + dlsym_offset = get_dlsym_offset() + lenv['CXXFLAGS'].append("-DUSE_THNEED") + lenv['CXXFLAGS'].append(f"-DDLSYM_OFFSET={dlsym_offset}") +else: + libs += ['pthread'] + + if not GetOption('snpe'): + # for onnx support + common_src += ['runners/onnxmodel.cc'] + + # tell runners to use onnx + lenv['CFLAGS'].append("-DUSE_ONNX_MODEL") + lenv['CXXFLAGS'].append("-DUSE_ONNX_MODEL") + + if arch == "Darwin": + # fix OpenCL + del libs[libs.index('OpenCL')] + lenv['FRAMEWORKS'] = ['OpenCL'] + + # no SNPE on Mac + del libs[libs.index('SNPE')] + del libs[libs.index('symphony-cpu')] + del common_src[common_src.index('runners/snpemodel.cc')] + +common_model = lenv.Object(common_src) + +# build thneed model +if use_thneed and arch in ("aarch64", "larch64"): + fn = "../../models/supercombo" + compiler = lenv.Program('thneed/compile', ["thneed/compile.cc"]+common_model, LIBS=libs) + cmd = f"cd {Dir('.').abspath} && {compiler[0].abspath} {fn}.dlc {fn}.thneed --binary" + + lib_paths = ':'.join(Dir(p).abspath for p in lenv["LIBPATH"]) + kernel_path = os.path.join(Dir('.').abspath, "thneed", "kernels") + cenv = Environment(ENV={'LD_LIBRARY_PATH': f"{lib_paths}:{lenv['ENV']['LD_LIBRARY_PATH']}", 'KERNEL_PATH': kernel_path}) + + kernels = [os.path.join(kernel_path, x) for x in os.listdir(kernel_path) if x.endswith(".cl")] + cenv.Command(fn + ".thneed", [fn + ".dlc", kernels, compiler], cmd) + +lenv.Program('_dmonitoringmodeld', [ + "dmonitoringmodeld.cc", + "models/dmonitoring.cc", + ]+common_model, LIBS=libs) + +lenv.Program('_modeld', [ + "modeld.cc", + "models/driving.cc", + ]+common_model, LIBS=libs) diff --git a/selfdrive/modeld/_dmonitoringmodeld b/selfdrive/modeld/_dmonitoringmodeld new file mode 100755 index 000000000..a62f7bdc9 Binary files /dev/null and b/selfdrive/modeld/_dmonitoringmodeld differ diff --git a/selfdrive/modeld/_modeld b/selfdrive/modeld/_modeld new file mode 100755 index 000000000..d4d8508be Binary files /dev/null and b/selfdrive/modeld/_modeld differ diff --git a/selfdrive/modeld/constants.py b/selfdrive/modeld/constants.py new file mode 100644 index 000000000..125864b98 --- /dev/null +++ b/selfdrive/modeld/constants.py @@ -0,0 +1,7 @@ +IDX_N = 33 + +def index_function(idx, max_val=192, max_idx=32): + return (max_val) * ((idx/max_idx)**2) + + +T_IDXS = [index_function(idx, max_val=10.0) for idx in range(IDX_N)] diff --git a/selfdrive/modeld/dmonitoringmodeld b/selfdrive/modeld/dmonitoringmodeld new file mode 100755 index 000000000..9acd7bcc3 --- /dev/null +++ b/selfdrive/modeld/dmonitoringmodeld @@ -0,0 +1,17 @@ +#!/bin/sh + +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" +cd $DIR + +if [ -d /system ]; then + if [ -f /TICI ]; then # QCOM2 + export LD_LIBRARY_PATH="/usr/lib/aarch64-linux-gnu:/data/pythonpath/third_party/snpe/larch64:$LD_LIBRARY_PATH" + else # QCOM + export LD_LIBRARY_PATH="/data/pythonpath/third_party/snpe/aarch64/:$LD_LIBRARY_PATH" + fi + export ADSP_LIBRARY_PATH="/data/pythonpath/third_party/snpe/dsp/" +else + # PC + export LD_LIBRARY_PATH="$DIR/../../third_party/snpe/x86_64-linux-clang:$DIR/../../openpilot/third_party/snpe/x86_64:$LD_LIBRARY_PATH" +fi +exec ./_dmonitoringmodeld diff --git a/selfdrive/modeld/dmonitoringmodeld.cc b/selfdrive/modeld/dmonitoringmodeld.cc new file mode 100644 index 000000000..c85c05c9d --- /dev/null +++ b/selfdrive/modeld/dmonitoringmodeld.cc @@ -0,0 +1,55 @@ +#include +#include + +#include +#include + +#include "cereal/visionipc/visionipc_client.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/util.h" +#include "selfdrive/modeld/models/dmonitoring.h" + +ExitHandler do_exit; + +void run_model(DMonitoringModelState &model, VisionIpcClient &vipc_client) { + PubMaster pm({"driverState"}); + double last = 0; + + while (!do_exit) { + VisionIpcBufExtra extra = {}; + VisionBuf *buf = vipc_client.recv(&extra); + if (buf == nullptr) continue; + + double t1 = millis_since_boot(); + DMonitoringResult res = dmonitoring_eval_frame(&model, buf->addr, buf->width, buf->height); + double t2 = millis_since_boot(); + + // send dm packet + dmonitoring_publish(pm, extra.frame_id, res, (t2 - t1) / 1000.0, model.output); + + //printf("dmonitoring process: %.2fms, from last %.2fms\n", t2 - t1, t1 - last); + last = t1; + } +} + +int main(int argc, char **argv) { + setpriority(PRIO_PROCESS, 0, -15); + + // init the models + DMonitoringModelState model; + dmonitoring_init(&model); + + VisionIpcClient vipc_client = VisionIpcClient("camerad", VISION_STREAM_DRIVER, true); + while (!do_exit && !vipc_client.connect(false)) { + util::sleep_for(100); + } + + // run the models + if (vipc_client.connected) { + LOGW("connected with buffer size: %d", vipc_client.buffers[0].len); + run_model(model, vipc_client); + } + + dmonitoring_free(&model); + return 0; +} diff --git a/selfdrive/modeld/modeld b/selfdrive/modeld/modeld new file mode 100755 index 000000000..fcf2812cb --- /dev/null +++ b/selfdrive/modeld/modeld @@ -0,0 +1,16 @@ +#!/bin/sh + +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" +cd $DIR + +if [ -d /system ]; then + if [ -f /TICI ]; then # QCOM2 + export LD_LIBRARY_PATH="/usr/lib/aarch64-linux-gnu:/data/pythonpath/third_party/snpe/larch64:$LD_LIBRARY_PATH" + else # QCOM + export LD_LIBRARY_PATH="/data/pythonpath/third_party/snpe/aarch64/:$LD_LIBRARY_PATH" + fi +else + # PC + export LD_LIBRARY_PATH="$DIR/../../third_party/snpe/x86_64-linux-clang:$DIR/../../openpilot/third_party/snpe/x86_64:$LD_LIBRARY_PATH" +fi +exec ./_modeld diff --git a/selfdrive/modeld/modeld.cc b/selfdrive/modeld/modeld.cc new file mode 100644 index 000000000..0facf3fa0 --- /dev/null +++ b/selfdrive/modeld/modeld.cc @@ -0,0 +1,150 @@ +#include +#include +#include + +#include + +#include "cereal/messaging/messaging.h" +#include "cereal/visionipc/visionipc_client.h" +#include "selfdrive/common/clutil.h" +#include "selfdrive/common/params.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/util.h" +#include "selfdrive/hardware/hw.h" +#include "selfdrive/modeld/models/driving.h" + +ExitHandler do_exit; + +mat3 update_calibration(cereal::LiveCalibrationData::Reader live_calib, bool wide_camera) { + /* + import numpy as np + from common.transformations.model import medmodel_frame_from_road_frame + medmodel_frame_from_ground = medmodel_frame_from_road_frame[:, (0, 1, 3)] + ground_from_medmodel_frame = np.linalg.inv(medmodel_frame_from_ground) + */ + static const auto ground_from_medmodel_frame = (Eigen::Matrix() << + 0.00000000e+00, 0.00000000e+00, 1.00000000e+00, + -1.09890110e-03, 0.00000000e+00, 2.81318681e-01, + -1.84808520e-20, 9.00738606e-04, -4.28751576e-02).finished(); + + static const auto cam_intrinsics = Eigen::Matrix(wide_camera ? ecam_intrinsic_matrix.v : fcam_intrinsic_matrix.v); + static const mat3 yuv_transform = get_model_yuv_transform(); + + auto extrinsic_matrix = live_calib.getExtrinsicMatrix(); + Eigen::Matrix extrinsic_matrix_eigen; + for (int i = 0; i < 4*3; i++) { + extrinsic_matrix_eigen(i / 4, i % 4) = extrinsic_matrix[i]; + } + + auto camera_frame_from_road_frame = cam_intrinsics * extrinsic_matrix_eigen; + Eigen::Matrix camera_frame_from_ground; + camera_frame_from_ground.col(0) = camera_frame_from_road_frame.col(0); + camera_frame_from_ground.col(1) = camera_frame_from_road_frame.col(1); + camera_frame_from_ground.col(2) = camera_frame_from_road_frame.col(3); + + auto warp_matrix = camera_frame_from_ground * ground_from_medmodel_frame; + mat3 transform = {}; + for (int i=0; i<3*3; i++) { + transform.v[i] = warp_matrix(i / 3, i % 3); + } + return matmul3(yuv_transform, transform); +} + +void run_model(ModelState &model, VisionIpcClient &vipc_client, bool wide_camera) { + // messaging + PubMaster pm({"modelV2", "cameraOdometry"}); + SubMaster sm({"lateralPlan", "roadCameraState", "liveCalibration"}); + + // setup filter to track dropped frames + FirstOrderFilter frame_dropped_filter(0., 10., 1. / MODEL_FREQ); + + uint32_t frame_id = 0, last_vipc_frame_id = 0; + double last = 0; + uint32_t run_count = 0; + + mat3 model_transform = {}; + bool live_calib_seen = false; + + while (!do_exit) { + VisionIpcBufExtra extra = {}; + VisionBuf *buf = vipc_client.recv(&extra); + if (buf == nullptr) continue; + + // TODO: path planner timeout? + sm.update(0); + int desire = ((int)sm["lateralPlan"].getLateralPlan().getDesire()); + frame_id = sm["roadCameraState"].getRoadCameraState().getFrameId(); + if (sm.updated("liveCalibration")) { + model_transform = update_calibration(sm["liveCalibration"].getLiveCalibration(), wide_camera); + live_calib_seen = true; + } + + float vec_desire[DESIRE_LEN] = {0}; + if (desire >= 0 && desire < DESIRE_LEN) { + vec_desire[desire] = 1.0; + } + + double mt1 = millis_since_boot(); + ModelOutput *model_output = model_eval_frame(&model, buf->buf_cl, buf->width, buf->height, + model_transform, vec_desire); + double mt2 = millis_since_boot(); + float model_execution_time = (mt2 - mt1) / 1000.0; + + // tracked dropped frames + uint32_t vipc_dropped_frames = extra.frame_id - last_vipc_frame_id - 1; + float frames_dropped = frame_dropped_filter.update((float)std::min(vipc_dropped_frames, 10U)); + if (run_count < 10) { // let frame drops warm up + frame_dropped_filter.reset(0); + frames_dropped = 0.; + } + run_count++; + + float frame_drop_ratio = frames_dropped / (1 + frames_dropped); + + model_publish(pm, extra.frame_id, frame_id, frame_drop_ratio, *model_output, extra.timestamp_eof, model_execution_time, + kj::ArrayPtr(model.output.data(), model.output.size()), live_calib_seen); + posenet_publish(pm, extra.frame_id, vipc_dropped_frames, *model_output, extra.timestamp_eof, live_calib_seen); + + //printf("model process: %.2fms, from last %.2fms, vipc_frame_id %u, frame_id, %u, frame_drop %.3f\n", mt2 - mt1, mt1 - last, extra.frame_id, frame_id, frame_drop_ratio); + last = mt1; + last_vipc_frame_id = extra.frame_id; + } +} + +int main(int argc, char **argv) { + if (!Hardware::PC()) { + int ret; + ret = util::set_realtime_priority(54); + assert(ret == 0); + util::set_core_affinity({Hardware::EON() ? 2 : 7}); + assert(ret == 0); + } + + bool wide_camera = Hardware::TICI() ? Params().getBool("EnableWideCamera") : false; + + // cl init + cl_device_id device_id = cl_get_device_id(CL_DEVICE_TYPE_DEFAULT); + cl_context context = CL_CHECK_ERR(clCreateContext(NULL, 1, &device_id, NULL, NULL, &err)); + + // init the models + ModelState model; + model_init(&model, device_id, context); + LOGW("models loaded, modeld starting"); + + VisionIpcClient vipc_client = VisionIpcClient("camerad", wide_camera ? VISION_STREAM_WIDE_ROAD : VISION_STREAM_ROAD, true, device_id, context); + while (!do_exit && !vipc_client.connect(false)) { + util::sleep_for(100); + } + + // run the models + // vipc_client.connected is false only when do_exit is true + if (vipc_client.connected) { + const VisionBuf *b = &vipc_client.buffers[0]; + LOGW("connected with buffer size: %d (%d x %d)", b->len, b->width, b->height); + run_model(model, vipc_client, wide_camera); + } + + model_free(&model); + CL_CHECK(clReleaseContext(context)); + return 0; +} diff --git a/selfdrive/modeld/models/commonmodel.cc b/selfdrive/modeld/models/commonmodel.cc new file mode 100644 index 000000000..1a1f6eaea --- /dev/null +++ b/selfdrive/modeld/models/commonmodel.cc @@ -0,0 +1,76 @@ +#include "selfdrive/modeld/models/commonmodel.h" + +#include +#include +#include +#include + +#include "selfdrive/common/clutil.h" +#include "selfdrive/common/mat.h" +#include "selfdrive/common/timing.h" + +ModelFrame::ModelFrame(cl_device_id device_id, cl_context context) { + input_frames = std::make_unique(buf_size); + + q = CL_CHECK_ERR(clCreateCommandQueue(context, device_id, 0, &err)); + y_cl = CL_CHECK_ERR(clCreateBuffer(context, CL_MEM_READ_WRITE, MODEL_WIDTH * MODEL_HEIGHT, NULL, &err)); + u_cl = CL_CHECK_ERR(clCreateBuffer(context, CL_MEM_READ_WRITE, (MODEL_WIDTH / 2) * (MODEL_HEIGHT / 2), NULL, &err)); + v_cl = CL_CHECK_ERR(clCreateBuffer(context, CL_MEM_READ_WRITE, (MODEL_WIDTH / 2) * (MODEL_HEIGHT / 2), NULL, &err)); + net_input_cl = CL_CHECK_ERR(clCreateBuffer(context, CL_MEM_READ_WRITE, MODEL_FRAME_SIZE * sizeof(float), NULL, &err)); + + transform_init(&transform, context, device_id); + loadyuv_init(&loadyuv, context, device_id, MODEL_WIDTH, MODEL_HEIGHT); +} + +float* ModelFrame::prepare(cl_mem yuv_cl, int frame_width, int frame_height, const mat3 &projection, cl_mem *output) { + transform_queue(&this->transform, q, + yuv_cl, frame_width, frame_height, + y_cl, u_cl, v_cl, MODEL_WIDTH, MODEL_HEIGHT, projection); + + if (output == NULL) { + loadyuv_queue(&loadyuv, q, y_cl, u_cl, v_cl, net_input_cl); + + std::memmove(&input_frames[0], &input_frames[MODEL_FRAME_SIZE], sizeof(float) * MODEL_FRAME_SIZE); + CL_CHECK(clEnqueueReadBuffer(q, net_input_cl, CL_TRUE, 0, MODEL_FRAME_SIZE * sizeof(float), &input_frames[MODEL_FRAME_SIZE], 0, nullptr, nullptr)); + clFinish(q); + return &input_frames[0]; + } else { + loadyuv_queue(&loadyuv, q, y_cl, u_cl, v_cl, *output, true); + // NOTE: Since thneed is using a different command queue, this clFinish is needed to ensure the image is ready. + clFinish(q); + return NULL; + } +} + +ModelFrame::~ModelFrame() { + transform_destroy(&transform); + loadyuv_destroy(&loadyuv); + CL_CHECK(clReleaseMemObject(net_input_cl)); + CL_CHECK(clReleaseMemObject(v_cl)); + CL_CHECK(clReleaseMemObject(u_cl)); + CL_CHECK(clReleaseMemObject(y_cl)); + CL_CHECK(clReleaseCommandQueue(q)); +} + +void softmax(const float* input, float* output, size_t len) { + const float max_val = *std::max_element(input, input + len); + float denominator = 0; + for(int i = 0; i < len; i++) { + float const v_exp = expf(input[i] - max_val); + denominator += v_exp; + output[i] = v_exp; + } + + const float inv_denominator = 1. / denominator; + for(int i = 0; i < len; i++) { + output[i] *= inv_denominator; + } +} + +float sigmoid(float input) { + return 1 / (1 + expf(-input)); +} + +float softplus(float input) { + return log1p(expf(input)); +} diff --git a/selfdrive/modeld/models/commonmodel.h b/selfdrive/modeld/models/commonmodel.h new file mode 100644 index 000000000..19af75eef --- /dev/null +++ b/selfdrive/modeld/models/commonmodel.h @@ -0,0 +1,42 @@ +#pragma once + +#include +#include + +#include + +#define CL_USE_DEPRECATED_OPENCL_1_2_APIS +#ifdef __APPLE__ +#include +#else +#include +#endif + +#include "selfdrive/common/mat.h" +#include "selfdrive/modeld/transforms/loadyuv.h" +#include "selfdrive/modeld/transforms/transform.h" + +const bool send_raw_pred = getenv("SEND_RAW_PRED") != NULL; + +void softmax(const float* input, float* output, size_t len); +float softplus(float input); +float sigmoid(float input); + +class ModelFrame { +public: + ModelFrame(cl_device_id device_id, cl_context context); + ~ModelFrame(); + float* prepare(cl_mem yuv_cl, int width, int height, const mat3& transform, cl_mem *output); + + const int MODEL_WIDTH = 512; + const int MODEL_HEIGHT = 256; + const int MODEL_FRAME_SIZE = MODEL_WIDTH * MODEL_HEIGHT * 3 / 2; + const int buf_size = MODEL_FRAME_SIZE * 2; + +private: + Transform transform; + LoadYUVState loadyuv; + cl_command_queue q; + cl_mem y_cl, u_cl, v_cl, net_input_cl; + std::unique_ptr input_frames; +}; diff --git a/selfdrive/modeld/models/dmonitoring.cc b/selfdrive/modeld/models/dmonitoring.cc new file mode 100644 index 000000000..2acdf7d2b --- /dev/null +++ b/selfdrive/modeld/models/dmonitoring.cc @@ -0,0 +1,228 @@ +#include + +#include "libyuv.h" + +#include "selfdrive/common/mat.h" +#include "selfdrive/common/modeldata.h" +#include "selfdrive/common/params.h" +#include "selfdrive/common/timing.h" +#include "selfdrive/hardware/hw.h" + +#include "selfdrive/modeld/models/dmonitoring.h" + +constexpr int MODEL_WIDTH = 320; +constexpr int MODEL_HEIGHT = 640; + +template +static inline T *get_buffer(std::vector &buf, const size_t size) { + if (buf.size() < size) buf.resize(size); + return buf.data(); +} + +static inline void init_yuv_buf(std::vector &buf, const int width, int height) { + uint8_t *y = get_buffer(buf, width * height * 3 / 2); + uint8_t *u = y + width * height; + uint8_t *v = u + (width / 2) * (height / 2); + + // needed on comma two to make the padded border black + // equivalent to RGB(0,0,0) in YUV space + memset(y, 16, width * height); + memset(u, 128, (width / 2) * (height / 2)); + memset(v, 128, (width / 2) * (height / 2)); +} + +void dmonitoring_init(DMonitoringModelState* s) { + s->is_rhd = Params().getBool("IsRHD"); + for (int x = 0; x < std::size(s->tensor); ++x) { + s->tensor[x] = (x - 128.f) * 0.0078125f; + } + init_yuv_buf(s->resized_buf, MODEL_WIDTH, MODEL_HEIGHT); + +#ifdef USE_ONNX_MODEL + s->m = new ONNXModel("../../models/dmonitoring_model.onnx", &s->output[0], OUTPUT_SIZE, USE_DSP_RUNTIME); +#else + s->m = new SNPEModel("../../models/dmonitoring_model_q.dlc", &s->output[0], OUTPUT_SIZE, USE_DSP_RUNTIME); +#endif +} + +static inline auto get_yuv_buf(std::vector &buf, const int width, int height) { + uint8_t *y = get_buffer(buf, width * height * 3 / 2); + uint8_t *u = y + width * height; + uint8_t *v = u + (width /2) * (height / 2); + return std::make_tuple(y, u, v); +} + +struct Rect {int x, y, w, h;}; +void crop_yuv(uint8_t *raw, int width, int height, uint8_t *y, uint8_t *u, uint8_t *v, const Rect &rect) { + uint8_t *raw_y = raw; + uint8_t *raw_u = raw_y + (width * height); + uint8_t *raw_v = raw_u + ((width / 2) * (height / 2)); + for (int r = 0; r < rect.h / 2; r++) { + memcpy(y + 2 * r * rect.w, raw_y + (2 * r + rect.y) * width + rect.x, rect.w); + memcpy(y + (2 * r + 1) * rect.w, raw_y + (2 * r + rect.y + 1) * width + rect.x, rect.w); + memcpy(u + r * (rect.w / 2), raw_u + (r + (rect.y / 2)) * width / 2 + (rect.x / 2), rect.w / 2); + memcpy(v + r * (rect.w / 2), raw_v + (r + (rect.y / 2)) * width / 2 + (rect.x / 2), rect.w / 2); + } +} + +DMonitoringResult dmonitoring_eval_frame(DMonitoringModelState* s, void* stream_buf, int width, int height) { + Rect crop_rect; + if (width == TICI_CAM_WIDTH) { + const int cropped_height = tici_dm_crop::width / 1.33; + crop_rect = {width / 2 - tici_dm_crop::width / 2 + tici_dm_crop::x_offset, + height / 2 - cropped_height / 2 + tici_dm_crop::y_offset, + cropped_height / 2, + cropped_height}; + if (!s->is_rhd) { + crop_rect.x += tici_dm_crop::width - crop_rect.w; + } + } else { + const int adapt_width = 372; + crop_rect = {0, 0, adapt_width, height}; + if (!s->is_rhd) { + crop_rect.x += width - crop_rect.w; + } + } + + int resized_width = MODEL_WIDTH; + int resized_height = MODEL_HEIGHT; + + auto [cropped_y, cropped_u, cropped_v] = get_yuv_buf(s->cropped_buf, crop_rect.w, crop_rect.h); + if (!s->is_rhd) { + crop_yuv((uint8_t *)stream_buf, width, height, cropped_y, cropped_u, cropped_v, crop_rect); + } else { + auto [mirror_y, mirror_u, mirror_v] = get_yuv_buf(s->premirror_cropped_buf, crop_rect.w, crop_rect.h); + crop_yuv((uint8_t *)stream_buf, width, height, mirror_y, mirror_u, mirror_v, crop_rect); + libyuv::I420Mirror(mirror_y, crop_rect.w, + mirror_u, crop_rect.w / 2, + mirror_v, crop_rect.w / 2, + cropped_y, crop_rect.w, + cropped_u, crop_rect.w / 2, + cropped_v, crop_rect.w / 2, + crop_rect.w, crop_rect.h); + } + + auto [resized_buf, resized_u, resized_v] = get_yuv_buf(s->resized_buf, resized_width, resized_height); + uint8_t *resized_y = resized_buf; + libyuv::FilterMode mode = libyuv::FilterModeEnum::kFilterBilinear; + if (Hardware::TICI()) { + libyuv::I420Scale(cropped_y, crop_rect.w, + cropped_u, crop_rect.w / 2, + cropped_v, crop_rect.w / 2, + crop_rect.w, crop_rect.h, + resized_y, resized_width, + resized_u, resized_width / 2, + resized_v, resized_width / 2, + resized_width, resized_height, + mode); + } else { + const int source_height = 0.7*resized_height; + const int extra_height = (resized_height - source_height) / 2; + const int extra_width = (resized_width - source_height / 2) / 2; + const int source_width = source_height / 2 + extra_width; + libyuv::I420Scale(cropped_y, crop_rect.w, + cropped_u, crop_rect.w / 2, + cropped_v, crop_rect.w / 2, + crop_rect.w, crop_rect.h, + resized_y + extra_height * resized_width, resized_width, + resized_u + extra_height / 2 * resized_width / 2, resized_width / 2, + resized_v + extra_height / 2 * resized_width / 2, resized_width / 2, + source_width, source_height, + mode); + } + + int yuv_buf_len = (MODEL_WIDTH/2) * (MODEL_HEIGHT/2) * 6; // Y|u|v -> y|y|y|y|u|v + float *net_input_buf = get_buffer(s->net_input_buf, yuv_buf_len); + // one shot conversion, O(n) anyway + // yuvframe2tensor, normalize + for (int r = 0; r < MODEL_HEIGHT/2; r++) { + for (int c = 0; c < MODEL_WIDTH/2; c++) { + // Y_ul + net_input_buf[(r*MODEL_WIDTH/2) + c + (0*(MODEL_WIDTH/2)*(MODEL_HEIGHT/2))] = s->tensor[resized_y[(2*r)*resized_width + 2*c]]; + // Y_dl + net_input_buf[(r*MODEL_WIDTH/2) + c + (1*(MODEL_WIDTH/2)*(MODEL_HEIGHT/2))] = s->tensor[resized_y[(2*r+1)*resized_width + 2*c]]; + // Y_ur + net_input_buf[(r*MODEL_WIDTH/2) + c + (2*(MODEL_WIDTH/2)*(MODEL_HEIGHT/2))] = s->tensor[resized_y[(2*r)*resized_width + 2*c+1]]; + // Y_dr + net_input_buf[(r*MODEL_WIDTH/2) + c + (3*(MODEL_WIDTH/2)*(MODEL_HEIGHT/2))] = s->tensor[resized_y[(2*r+1)*resized_width + 2*c+1]]; + // U + net_input_buf[(r*MODEL_WIDTH/2) + c + (4*(MODEL_WIDTH/2)*(MODEL_HEIGHT/2))] = s->tensor[resized_u[r*resized_width/2 + c]]; + // V + net_input_buf[(r*MODEL_WIDTH/2) + c + (5*(MODEL_WIDTH/2)*(MODEL_HEIGHT/2))] = s->tensor[resized_v[r*resized_width/2 + c]]; + } + } + + //printf("preprocess completed. %d \n", yuv_buf_len); + //FILE *dump_yuv_file = fopen("/tmp/rawdump.yuv", "wb"); + //fwrite(resized_buf, yuv_buf_len, sizeof(uint8_t), dump_yuv_file); + //fclose(dump_yuv_file); + + // *** testing *** + // idat = np.frombuffer(open("/tmp/inputdump.yuv", "rb").read(), np.float32).reshape(6, 160, 320) + // imshow(cv2.cvtColor(tensor_to_frames(idat[None]/0.0078125+128)[0], cv2.COLOR_YUV2RGB_I420)) + + //FILE *dump_yuv_file2 = fopen("/tmp/inputdump.yuv", "wb"); + //fwrite(net_input_buf, MODEL_HEIGHT*MODEL_WIDTH*3/2, sizeof(float), dump_yuv_file2); + //fclose(dump_yuv_file2); + + double t1 = millis_since_boot(); + s->m->execute(net_input_buf, yuv_buf_len); + double t2 = millis_since_boot(); + + DMonitoringResult ret = {0}; + for (int i = 0; i < 3; ++i) { + ret.face_orientation[i] = s->output[i]; + ret.face_orientation_meta[i] = softplus(s->output[6 + i]); + } + for (int i = 0; i < 2; ++i) { + ret.face_position[i] = s->output[3 + i]; + ret.face_position_meta[i] = softplus(s->output[9 + i]); + } + ret.face_prob = s->output[12]; + ret.left_eye_prob = s->output[21]; + ret.right_eye_prob = s->output[30]; + ret.left_blink_prob = s->output[31]; + ret.right_blink_prob = s->output[32]; + ret.sg_prob = s->output[33]; + ret.poor_vision = s->output[34]; + ret.partial_face = s->output[35]; + ret.distracted_pose = s->output[36]; + ret.distracted_eyes = s->output[37]; + ret.occluded_prob = s->output[38]; + ret.dsp_execution_time = (t2 - t1) / 1000.; + return ret; +} + +void dmonitoring_publish(PubMaster &pm, uint32_t frame_id, const DMonitoringResult &res, float execution_time, kj::ArrayPtr raw_pred) { + // make msg + MessageBuilder msg; + auto framed = msg.initEvent().initDriverState(); + framed.setFrameId(frame_id); + framed.setModelExecutionTime(execution_time); + framed.setDspExecutionTime(res.dsp_execution_time); + + framed.setFaceOrientation(res.face_orientation); + framed.setFaceOrientationStd(res.face_orientation_meta); + framed.setFacePosition(res.face_position); + framed.setFacePositionStd(res.face_position_meta); + framed.setFaceProb(res.face_prob); + framed.setLeftEyeProb(res.left_eye_prob); + framed.setRightEyeProb(res.right_eye_prob); + framed.setLeftBlinkProb(res.left_blink_prob); + framed.setRightBlinkProb(res.right_blink_prob); + framed.setSunglassesProb(res.sg_prob); + framed.setPoorVision(res.poor_vision); + framed.setPartialFace(res.partial_face); + framed.setDistractedPose(res.distracted_pose); + framed.setDistractedEyes(res.distracted_eyes); + framed.setOccludedProb(res.occluded_prob); + if (send_raw_pred) { + framed.setRawPredictions(raw_pred.asBytes()); + } + + pm.send("driverState", msg); +} + +void dmonitoring_free(DMonitoringModelState* s) { + delete s->m; +} diff --git a/selfdrive/modeld/models/dmonitoring.h b/selfdrive/modeld/models/dmonitoring.h new file mode 100644 index 000000000..9b3ee631f --- /dev/null +++ b/selfdrive/modeld/models/dmonitoring.h @@ -0,0 +1,46 @@ +#pragma once + +#include + +#include "cereal/messaging/messaging.h" +#include "selfdrive/common/util.h" +#include "selfdrive/modeld/models/commonmodel.h" +#include "selfdrive/modeld/runners/run.h" + +#define OUTPUT_SIZE 39 + +typedef struct DMonitoringResult { + float face_orientation[3]; + float face_orientation_meta[3]; + float face_position[2]; + float face_position_meta[2]; + float face_prob; + float left_eye_prob; + float right_eye_prob; + float left_blink_prob; + float right_blink_prob; + float sg_prob; + float poor_vision; + float partial_face; + float distracted_pose; + float distracted_eyes; + float occluded_prob; + float dsp_execution_time; +} DMonitoringResult; + +typedef struct DMonitoringModelState { + RunModel *m; + bool is_rhd; + float output[OUTPUT_SIZE]; + std::vector resized_buf; + std::vector cropped_buf; + std::vector premirror_cropped_buf; + std::vector net_input_buf; + float tensor[UINT8_MAX + 1]; +} DMonitoringModelState; + +void dmonitoring_init(DMonitoringModelState* s); +DMonitoringResult dmonitoring_eval_frame(DMonitoringModelState* s, void* stream_buf, int width, int height); +void dmonitoring_publish(PubMaster &pm, uint32_t frame_id, const DMonitoringResult &res, float execution_time, kj::ArrayPtr raw_pred); +void dmonitoring_free(DMonitoringModelState* s); + diff --git a/selfdrive/modeld/models/driving.cc b/selfdrive/modeld/models/driving.cc new file mode 100644 index 000000000..69aeb91be --- /dev/null +++ b/selfdrive/modeld/models/driving.cc @@ -0,0 +1,345 @@ +#include "selfdrive/modeld/models/driving.h" + +#include +#include + +#include +#include + +#include + +#include "selfdrive/common/clutil.h" +#include "selfdrive/common/params.h" +#include "selfdrive/common/timing.h" + +constexpr float FCW_THRESHOLD_5MS2_HIGH = 0.15; +constexpr float FCW_THRESHOLD_5MS2_LOW = 0.05; +constexpr float FCW_THRESHOLD_3MS2 = 0.7; + +std::array prev_brake_5ms2_probs = {0,0,0,0,0}; +std::array prev_brake_3ms2_probs = {0,0,0}; + +// #define DUMP_YUV + +template +constexpr const kj::ArrayPtr to_kj_array_ptr(const std::array &arr) { + return kj::ArrayPtr(arr.data(), arr.size()); +} + +void model_init(ModelState* s, cl_device_id device_id, cl_context context) { + s->frame = new ModelFrame(device_id, context); + +#ifdef USE_THNEED + s->m = std::make_unique("../../models/supercombo.thneed", &s->output[0], NET_OUTPUT_SIZE, USE_GPU_RUNTIME); +#elif USE_ONNX_MODEL + s->m = std::make_unique("../../models/supercombo.onnx", &s->output[0], NET_OUTPUT_SIZE, USE_GPU_RUNTIME); +#else + s->m = std::make_unique("../../models/supercombo.dlc", &s->output[0], NET_OUTPUT_SIZE, USE_GPU_RUNTIME); +#endif + +#ifdef TEMPORAL + s->m->addRecurrent(&s->output[OUTPUT_SIZE], TEMPORAL_SIZE); +#endif + +#ifdef DESIRE + s->m->addDesire(s->pulse_desire, DESIRE_LEN); +#endif + +#ifdef TRAFFIC_CONVENTION + const int idx = Params().getBool("IsRHD") ? 1 : 0; + s->traffic_convention[idx] = 1.0; + s->m->addTrafficConvention(s->traffic_convention, TRAFFIC_CONVENTION_LEN); +#endif +} + +ModelOutput* model_eval_frame(ModelState* s, cl_mem yuv_cl, int width, int height, + const mat3 &transform, float *desire_in) { +#ifdef DESIRE + if (desire_in != NULL) { + for (int i = 1; i < DESIRE_LEN; i++) { + // Model decides when action is completed + // so desire input is just a pulse triggered on rising edge + if (desire_in[i] - s->prev_desire[i] > .99) { + s->pulse_desire[i] = desire_in[i]; + } else { + s->pulse_desire[i] = 0.0; + } + s->prev_desire[i] = desire_in[i]; + } + } +#endif + + // if getInputBuf is not NULL, net_input_buf will be + auto net_input_buf = s->frame->prepare(yuv_cl, width, height, transform, static_cast(s->m->getInputBuf())); + s->m->execute(net_input_buf, s->frame->buf_size); + + return (ModelOutput*)&s->output; +} + +void model_free(ModelState* s) { + delete s->frame; +} + +void fill_lead(cereal::ModelDataV2::LeadDataV3::Builder lead, const ModelOutputLeads &leads, int t_idx, float prob_t) { + std::array lead_t = {0.0, 2.0, 4.0, 6.0, 8.0, 10.0}; + const auto &best_prediction = leads.get_best_prediction(t_idx); + lead.setProb(sigmoid(leads.prob[t_idx])); + lead.setProbTime(prob_t); + std::array lead_x, lead_y, lead_v, lead_a; + std::array lead_x_std, lead_y_std, lead_v_std, lead_a_std; + for (int i=0; i desire_state_softmax; + softmax(meta_data.desire_state_prob.array.data(), desire_state_softmax.data(), DESIRE_LEN); + + std::array desire_pred_softmax; + for (int i=0; i lat_long_t = {2,4,6,8,10}; + std::array gas_disengage_sigmoid, brake_disengage_sigmoid, steer_override_sigmoid, + brake_3ms2_sigmoid, brake_4ms2_sigmoid, brake_5ms2_sigmoid; + for (int i=0; i threshold; + } + for (int i=0; i FCW_THRESHOLD_3MS2; + } + + auto disengage = meta.initDisengagePredictions(); + disengage.setT(to_kj_array_ptr(lat_long_t)); + disengage.setGasDisengageProbs(to_kj_array_ptr(gas_disengage_sigmoid)); + disengage.setBrakeDisengageProbs(to_kj_array_ptr(brake_disengage_sigmoid)); + disengage.setSteerOverrideProbs(to_kj_array_ptr(steer_override_sigmoid)); + disengage.setBrake3MetersPerSecondSquaredProbs(to_kj_array_ptr(brake_3ms2_sigmoid)); + disengage.setBrake4MetersPerSecondSquaredProbs(to_kj_array_ptr(brake_4ms2_sigmoid)); + disengage.setBrake5MetersPerSecondSquaredProbs(to_kj_array_ptr(brake_5ms2_sigmoid)); + + meta.setEngagedProb(sigmoid(meta_data.engaged_prob)); + meta.setDesirePrediction(to_kj_array_ptr(desire_pred_softmax)); + meta.setDesireState(to_kj_array_ptr(desire_state_softmax)); + meta.setHardBrakePredicted(above_fcw_threshold); +} + +template +void fill_xyzt(cereal::ModelDataV2::XYZTData::Builder xyzt, const std::array &t, + const std::array &x, const std::array &y, const std::array &z) { + xyzt.setT(to_kj_array_ptr(t)); + xyzt.setX(to_kj_array_ptr(x)); + xyzt.setY(to_kj_array_ptr(y)); + xyzt.setZ(to_kj_array_ptr(z)); +} + +template +void fill_xyzt(cereal::ModelDataV2::XYZTData::Builder xyzt, const std::array &t, + const std::array &x, const std::array &y, const std::array &z, + const std::array &x_std, const std::array &y_std, const std::array &z_std) { + fill_xyzt(xyzt, t, x, y, z); + xyzt.setXStd(to_kj_array_ptr(x_std)); + xyzt.setYStd(to_kj_array_ptr(y_std)); + xyzt.setZStd(to_kj_array_ptr(z_std)); +} + +void fill_plan(cereal::ModelDataV2::Builder &framed, const ModelOutputPlanPrediction &plan) { + std::array pos_x, pos_y, pos_z; + std::array pos_x_std, pos_y_std, pos_z_std; + std::array vel_x, vel_y, vel_z; + std::array rot_x, rot_y, rot_z; + std::array rot_rate_x, rot_rate_y, rot_rate_z; + + for(int i=0; i &plan_t, + const ModelOutputLaneLines &lanes) { + std::array left_far_y, left_far_z; + std::array left_near_y, left_near_z; + std::array right_near_y, right_near_z; + std::array right_far_y, right_far_z; + for (int j=0; j &plan_t, + const ModelOutputRoadEdges &edges) { + std::array left_y, left_z; + std::array right_y, right_z; + for (int j=0; j plan_t; + std::fill_n(plan_t.data(), plan_t.size(), NAN); + plan_t[0] = 0.0; + for (int xidx=1, tidx=0; xidx t_offsets = {0.0, 2.0, 4.0}; + for (int i=0; i raw_pred, const bool valid) { + const uint32_t frame_age = (frame_id > vipc_frame_id) ? (frame_id - vipc_frame_id) : 0; + MessageBuilder msg; + auto framed = msg.initEvent(valid).initModelV2(); + framed.setFrameId(vipc_frame_id); + framed.setFrameAge(frame_age); + framed.setFrameDropPerc(frame_drop * 100); + framed.setTimestampEof(timestamp_eof); + framed.setModelExecutionTime(model_execution_time); + if (send_raw_pred) { + framed.setRawPredictions(raw_pred.asBytes()); + } + fill_model(framed, net_outputs); + pm.send("modelV2", msg); +} + +void posenet_publish(PubMaster &pm, uint32_t vipc_frame_id, uint32_t vipc_dropped_frames, + const ModelOutput &net_outputs, uint64_t timestamp_eof, const bool valid) { + MessageBuilder msg; + const auto &v_mean = net_outputs.pose.velocity_mean; + const auto &r_mean = net_outputs.pose.rotation_mean; + const auto &v_std = net_outputs.pose.velocity_std; + const auto &r_std = net_outputs.pose.rotation_std; + + auto posenetd = msg.initEvent(valid && (vipc_dropped_frames < 1)).initCameraOdometry(); + posenetd.setTrans({v_mean.x, v_mean.y, v_mean.z}); + posenetd.setRot({r_mean.x, r_mean.y, r_mean.z}); + posenetd.setTransStd({exp(v_std.x), exp(v_std.y), exp(v_std.z)}); + posenetd.setRotStd({exp(r_std.x), exp(r_std.y), exp(r_std.z)}); + + posenetd.setTimestampEof(timestamp_eof); + posenetd.setFrameId(vipc_frame_id); + + pm.send("cameraOdometry", msg); +} diff --git a/selfdrive/modeld/models/driving.h b/selfdrive/modeld/models/driving.h new file mode 100644 index 000000000..14645dcfa --- /dev/null +++ b/selfdrive/modeld/models/driving.h @@ -0,0 +1,242 @@ +#pragma once + +// gate this here +#define TEMPORAL +#define DESIRE +#define TRAFFIC_CONVENTION + +#include +#include + +#include "cereal/messaging/messaging.h" +#include "selfdrive/common/mat.h" +#include "selfdrive/common/modeldata.h" +#include "selfdrive/common/util.h" +#include "selfdrive/modeld/models/commonmodel.h" +#include "selfdrive/modeld/runners/run.h" + +constexpr int DESIRE_LEN = 8; +constexpr int DESIRE_PRED_LEN = 4; +constexpr int TRAFFIC_CONVENTION_LEN = 2; +constexpr int MODEL_FREQ = 20; + +constexpr int DISENGAGE_LEN = 5; +constexpr int BLINKER_LEN = 6; +constexpr int META_STRIDE = 7; + +constexpr int PLAN_MHP_N = 5; + +constexpr int LEAD_MHP_N = 2; +constexpr int LEAD_TRAJ_LEN = 6; +constexpr int LEAD_PRED_DIM = 4; +constexpr int LEAD_MHP_SELECTION = 3; + +struct ModelOutputXYZ { + float x; + float y; + float z; +}; +static_assert(sizeof(ModelOutputXYZ) == sizeof(float)*3); + +struct ModelOutputYZ { + float y; + float z; +}; +static_assert(sizeof(ModelOutputYZ) == sizeof(float)*2); + +struct ModelOutputPlanElement { + ModelOutputXYZ position; + ModelOutputXYZ velocity; + ModelOutputXYZ acceleration; + ModelOutputXYZ rotation; + ModelOutputXYZ rotation_rate; +}; +static_assert(sizeof(ModelOutputPlanElement) == sizeof(ModelOutputXYZ)*5); + +struct ModelOutputPlanPrediction { + std::array mean; + std::array std; + float prob; +}; +static_assert(sizeof(ModelOutputPlanPrediction) == (sizeof(ModelOutputPlanElement)*TRAJECTORY_SIZE*2) + sizeof(float)); + +struct ModelOutputPlans { + std::array prediction; + + constexpr const ModelOutputPlanPrediction &get_best_prediction() const { + int max_idx = 0; + for (int i = 1; i < prediction.size(); i++) { + if (prediction[i].prob > prediction[max_idx].prob) { + max_idx = i; + } + } + return prediction[max_idx]; + } +}; +static_assert(sizeof(ModelOutputPlans) == sizeof(ModelOutputPlanPrediction)*PLAN_MHP_N); + +struct ModelOutputLinesXY { + std::array left_far; + std::array left_near; + std::array right_near; + std::array right_far; +}; +static_assert(sizeof(ModelOutputLinesXY) == sizeof(ModelOutputYZ)*TRAJECTORY_SIZE*4); + +struct ModelOutputLineProbVal { + float val_deprecated; + float val; +}; +static_assert(sizeof(ModelOutputLineProbVal) == sizeof(float)*2); + +struct ModelOutputLinesProb { + ModelOutputLineProbVal left_far; + ModelOutputLineProbVal left_near; + ModelOutputLineProbVal right_near; + ModelOutputLineProbVal right_far; +}; +static_assert(sizeof(ModelOutputLinesProb) == sizeof(ModelOutputLineProbVal)*4); + +struct ModelOutputLaneLines { + ModelOutputLinesXY mean; + ModelOutputLinesXY std; + ModelOutputLinesProb prob; +}; +static_assert(sizeof(ModelOutputLaneLines) == (sizeof(ModelOutputLinesXY)*2) + sizeof(ModelOutputLinesProb)); + +struct ModelOutputEdgessXY { + std::array left; + std::array right; +}; +static_assert(sizeof(ModelOutputEdgessXY) == sizeof(ModelOutputYZ)*TRAJECTORY_SIZE*2); + +struct ModelOutputRoadEdges { + ModelOutputEdgessXY mean; + ModelOutputEdgessXY std; +}; +static_assert(sizeof(ModelOutputRoadEdges) == (sizeof(ModelOutputEdgessXY)*2)); + +struct ModelOutputLeadElement { + float x; + float y; + float velocity; + float acceleration; +}; +static_assert(sizeof(ModelOutputLeadElement) == sizeof(float)*4); + +struct ModelOutputLeadPrediction { + std::array mean; + std::array std; + std::array prob; +}; +static_assert(sizeof(ModelOutputLeadPrediction) == (sizeof(ModelOutputLeadElement)*LEAD_TRAJ_LEN*2) + (sizeof(float)*LEAD_MHP_SELECTION)); + +struct ModelOutputLeads { + std::array prediction; + std::array prob; + + constexpr const ModelOutputLeadPrediction &get_best_prediction(int t_idx) const { + int max_idx = 0; + for (int i = 1; i < prediction.size(); i++) { + if (prediction[i].prob[t_idx] > prediction[max_idx].prob[t_idx]) { + max_idx = i; + } + } + return prediction[max_idx]; + } +}; +static_assert(sizeof(ModelOutputLeads) == (sizeof(ModelOutputLeadPrediction)*LEAD_MHP_N) + (sizeof(float)*LEAD_MHP_SELECTION)); + +struct ModelOutputPose { + ModelOutputXYZ velocity_mean; + ModelOutputXYZ rotation_mean; + ModelOutputXYZ velocity_std; + ModelOutputXYZ rotation_std; +}; +static_assert(sizeof(ModelOutputPose) == sizeof(ModelOutputXYZ)*4); + +struct ModelOutputDisengageProb { + float gas_disengage; + float brake_disengage; + float steer_override; + float brake_3ms2; + float brake_4ms2; + float brake_5ms2; + float gas_pressed; +}; +static_assert(sizeof(ModelOutputDisengageProb) == sizeof(float)*7); + +struct ModelOutputBlinkerProb { + float left; + float right; +}; +static_assert(sizeof(ModelOutputBlinkerProb) == sizeof(float)*2); + +struct ModelOutputDesireProb { + union { + struct { + float none; + float turn_left; + float turn_right; + float lane_change_left; + float lane_change_right; + float keep_left; + float keep_right; + float null; + }; + struct { + std::array array; + }; + }; +}; +static_assert(sizeof(ModelOutputDesireProb) == sizeof(float)*DESIRE_LEN); + +struct ModelOutputMeta { + ModelOutputDesireProb desire_state_prob; + float engaged_prob; + std::array disengage_prob; + std::array blinker_prob; + std::array desire_pred_prob; +}; +static_assert(sizeof(ModelOutputMeta) == sizeof(ModelOutputDesireProb) + sizeof(float) + (sizeof(ModelOutputDisengageProb)*DISENGAGE_LEN) + (sizeof(ModelOutputBlinkerProb)*BLINKER_LEN) + (sizeof(ModelOutputDesireProb)*DESIRE_PRED_LEN)); + +struct ModelOutput { + const ModelOutputPlans plans; + const ModelOutputLaneLines lane_lines; + const ModelOutputRoadEdges road_edges; + const ModelOutputLeads leads; + const ModelOutputMeta meta; + const ModelOutputPose pose; +}; + +constexpr int OUTPUT_SIZE = sizeof(ModelOutput) / sizeof(float); +#ifdef TEMPORAL + constexpr int TEMPORAL_SIZE = 512; +#else + constexpr int TEMPORAL_SIZE = 0; +#endif +constexpr int NET_OUTPUT_SIZE = OUTPUT_SIZE + TEMPORAL_SIZE; + +// TODO: convert remaining arrays to std::array and update model runners +struct ModelState { + ModelFrame *frame; + std::array output = {}; + std::unique_ptr m; +#ifdef DESIRE + float prev_desire[DESIRE_LEN] = {}; + float pulse_desire[DESIRE_LEN] = {}; +#endif +#ifdef TRAFFIC_CONVENTION + float traffic_convention[TRAFFIC_CONVENTION_LEN] = {}; +#endif +}; + +void model_init(ModelState* s, cl_device_id device_id, cl_context context); +ModelOutput *model_eval_frame(ModelState* s, cl_mem yuv_cl, int width, int height, + const mat3 &transform, float *desire_in); +void model_free(ModelState* s); +void model_publish(PubMaster &pm, uint32_t vipc_frame_id, uint32_t frame_id, float frame_drop, + const ModelOutput &net_outputs, uint64_t timestamp_eof, + float model_execution_time, kj::ArrayPtr raw_pred, const bool valid); +void posenet_publish(PubMaster &pm, uint32_t vipc_frame_id, uint32_t vipc_dropped_frames, + const ModelOutput &net_outputs, uint64_t timestamp_eof, const bool valid); diff --git a/selfdrive/modeld/runners/run.h b/selfdrive/modeld/runners/run.h new file mode 100644 index 000000000..c64f300fe --- /dev/null +++ b/selfdrive/modeld/runners/run.h @@ -0,0 +1,10 @@ +#pragma once + +#include "runmodel.h" +#include "snpemodel.h" + +#if defined(USE_THNEED) +#include "thneedmodel.h" +#elif defined(USE_ONNX_MODEL) +#include "onnxmodel.h" +#endif diff --git a/selfdrive/modeld/runners/runmodel.h b/selfdrive/modeld/runners/runmodel.h new file mode 100644 index 000000000..948048f5d --- /dev/null +++ b/selfdrive/modeld/runners/runmodel.h @@ -0,0 +1,11 @@ +#pragma once +class RunModel { +public: + virtual ~RunModel() {} + virtual void addRecurrent(float *state, int state_size) {} + virtual void addDesire(float *state, int state_size) {} + virtual void addTrafficConvention(float *state, int state_size) {} + virtual void execute(float *net_input_buf, int buf_size) {} + virtual void* getInputBuf() { return nullptr; } +}; + diff --git a/selfdrive/modeld/runners/snpemodel.cc b/selfdrive/modeld/runners/snpemodel.cc new file mode 100644 index 000000000..22dc15fdf --- /dev/null +++ b/selfdrive/modeld/runners/snpemodel.cc @@ -0,0 +1,194 @@ +#pragma clang diagnostic ignored "-Wexceptions" + +#include "selfdrive/modeld/runners/snpemodel.h" + +#include +#include +#include + +#include "selfdrive/common/util.h" +#include "selfdrive/common/timing.h" + +void PrintErrorStringAndExit() { + std::cerr << zdl::DlSystem::getLastErrorString() << std::endl; + std::exit(EXIT_FAILURE); +} + +SNPEModel::SNPEModel(const char *path, float *loutput, size_t loutput_size, int runtime) { + output = loutput; + output_size = loutput_size; +#if defined(QCOM) || defined(QCOM2) + if (runtime==USE_GPU_RUNTIME) { + Runtime = zdl::DlSystem::Runtime_t::GPU; + } else if (runtime==USE_DSP_RUNTIME) { + Runtime = zdl::DlSystem::Runtime_t::DSP; + } else { + Runtime = zdl::DlSystem::Runtime_t::CPU; + } + assert(zdl::SNPE::SNPEFactory::isRuntimeAvailable(Runtime)); +#endif + model_data = util::read_file(path); + assert(model_data.size() > 0); + + // load model + std::unique_ptr container = zdl::DlContainer::IDlContainer::open((uint8_t*)model_data.data(), model_data.size()); + if (!container) { PrintErrorStringAndExit(); } + printf("loaded model with size: %lu\n", model_data.size()); + + // create model runner + zdl::SNPE::SNPEBuilder snpeBuilder(container.get()); + while (!snpe) { +#if defined(QCOM) || defined(QCOM2) + snpe = snpeBuilder.setOutputLayers({}) + .setRuntimeProcessor(Runtime) + .setUseUserSuppliedBuffers(true) + .setPerformanceProfile(zdl::DlSystem::PerformanceProfile_t::HIGH_PERFORMANCE) + .build(); +#else + snpe = snpeBuilder.setOutputLayers({}) + .setUseUserSuppliedBuffers(true) + .setPerformanceProfile(zdl::DlSystem::PerformanceProfile_t::HIGH_PERFORMANCE) + .build(); +#endif + if (!snpe) std::cerr << zdl::DlSystem::getLastErrorString() << std::endl; + } + + // get input and output names + const auto &strListi_opt = snpe->getInputTensorNames(); + if (!strListi_opt) throw std::runtime_error("Error obtaining Input tensor names"); + const auto &strListi = *strListi_opt; + //assert(strListi.size() == 1); + const char *input_tensor_name = strListi.at(0); + + const auto &strListo_opt = snpe->getOutputTensorNames(); + if (!strListo_opt) throw std::runtime_error("Error obtaining Output tensor names"); + const auto &strListo = *strListo_opt; + assert(strListo.size() == 1); + const char *output_tensor_name = strListo.at(0); + + printf("model: %s -> %s\n", input_tensor_name, output_tensor_name); + + zdl::DlSystem::UserBufferEncodingFloat userBufferEncodingFloat; + zdl::DlSystem::IUserBufferFactory& ubFactory = zdl::SNPE::SNPEFactory::getUserBufferFactory(); + + // create input buffer + { + const auto &inputDims_opt = snpe->getInputDimensions(input_tensor_name); + const zdl::DlSystem::TensorShape& bufferShape = *inputDims_opt; + std::vector strides(bufferShape.rank()); + strides[strides.size() - 1] = sizeof(float); + size_t product = 1; + for (size_t i = 0; i < bufferShape.rank(); i++) product *= bufferShape[i]; + size_t stride = strides[strides.size() - 1]; + for (size_t i = bufferShape.rank() - 1; i > 0; i--) { + stride *= bufferShape[i]; + strides[i-1] = stride; + } + printf("input product is %lu\n", product); + inputBuffer = ubFactory.createUserBuffer(NULL, product*sizeof(float), strides, &userBufferEncodingFloat); + + inputMap.add(input_tensor_name, inputBuffer.get()); + } + + // create output buffer + { + const zdl::DlSystem::TensorShape& bufferShape = snpe->getInputOutputBufferAttributes(output_tensor_name)->getDims(); + if (output_size != 0) { + assert(output_size == bufferShape[1]); + } else { + output_size = bufferShape[1]; + } + + std::vector outputStrides = {output_size * sizeof(float), sizeof(float)}; + outputBuffer = ubFactory.createUserBuffer(output, output_size * sizeof(float), outputStrides, &userBufferEncodingFloat); + outputMap.add(output_tensor_name, outputBuffer.get()); + } +} + +void SNPEModel::addRecurrent(float *state, int state_size) { + recurrent = state; + recurrent_size = state_size; + recurrentBuffer = this->addExtra(state, state_size, 3); +} + +void SNPEModel::addTrafficConvention(float *state, int state_size) { + trafficConvention = state; + trafficConventionBuffer = this->addExtra(state, state_size, 2); +} + +void SNPEModel::addDesire(float *state, int state_size) { + desire = state; + desireBuffer = this->addExtra(state, state_size, 1); +} + +std::unique_ptr SNPEModel::addExtra(float *state, int state_size, int idx) { + // get input and output names + const auto &strListi_opt = snpe->getInputTensorNames(); + if (!strListi_opt) throw std::runtime_error("Error obtaining Input tensor names"); + const auto &strListi = *strListi_opt; + const char *input_tensor_name = strListi.at(idx); + printf("adding index %d: %s\n", idx, input_tensor_name); + + zdl::DlSystem::UserBufferEncodingFloat userBufferEncodingFloat; + zdl::DlSystem::IUserBufferFactory& ubFactory = zdl::SNPE::SNPEFactory::getUserBufferFactory(); + std::vector retStrides = {state_size * sizeof(float), sizeof(float)}; + auto ret = ubFactory.createUserBuffer(state, state_size * sizeof(float), retStrides, &userBufferEncodingFloat); + inputMap.add(input_tensor_name, ret.get()); + return ret; +} + +void SNPEModel::execute(float *net_input_buf, int buf_size) { +#ifdef USE_THNEED + if (Runtime == zdl::DlSystem::Runtime_t::GPU) { + float *inputs[4] = {recurrent, trafficConvention, desire, net_input_buf}; + if (thneed == NULL) { + bool ret = inputBuffer->setBufferAddress(net_input_buf); + assert(ret == true); + if (!snpe->execute(inputMap, outputMap)) { + PrintErrorStringAndExit(); + } + memset(recurrent, 0, recurrent_size*sizeof(float)); + thneed = new Thneed(); + if (!snpe->execute(inputMap, outputMap)) { + PrintErrorStringAndExit(); + } + thneed->stop(); + printf("thneed cached\n"); + + // doing self test + float *outputs_golden = (float *)malloc(output_size*sizeof(float)); + memcpy(outputs_golden, output, output_size*sizeof(float)); + memset(output, 0, output_size*sizeof(float)); + + for (int i = 0; i < 5; i++) { + memset(recurrent, 0, recurrent_size*sizeof(float)); + uint64_t start_time = nanos_since_boot(); + thneed->execute(inputs, output); + uint64_t elapsed_time = nanos_since_boot() - start_time; + printf("ran model in %.2f ms\n", float(elapsed_time)/1e6); + } + + if (memcmp(output, outputs_golden, output_size*sizeof(float)) == 0) { + printf("thneed selftest passed\n"); + } else { + for (int i = 0; i < output_size; i++) { + printf("mismatch %3d: %f %f\n", i, output[i], outputs_golden[i]); + } + assert(false); + } + free(outputs_golden); + } else { + thneed->execute(inputs, output); + } + } else { +#endif + bool ret = inputBuffer->setBufferAddress(net_input_buf); + assert(ret == true); + if (!snpe->execute(inputMap, outputMap)) { + PrintErrorStringAndExit(); + } +#ifdef USE_THNEED + } +#endif +} + diff --git a/selfdrive/modeld/runners/snpemodel.h b/selfdrive/modeld/runners/snpemodel.h new file mode 100644 index 000000000..6d3a70414 --- /dev/null +++ b/selfdrive/modeld/runners/snpemodel.h @@ -0,0 +1,64 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "runmodel.h" + +#define USE_CPU_RUNTIME 0 +#define USE_GPU_RUNTIME 1 +#define USE_DSP_RUNTIME 2 + +#ifdef USE_THNEED +#include "selfdrive/modeld/thneed/thneed.h" +#endif + +class SNPEModel : public RunModel { +public: + SNPEModel(const char *path, float *loutput, size_t loutput_size, int runtime); + void addRecurrent(float *state, int state_size); + void addTrafficConvention(float *state, int state_size); + void addDesire(float *state, int state_size); + void execute(float *net_input_buf, int buf_size); + +#ifdef USE_THNEED + Thneed *thneed = NULL; +#endif + +private: + std::string model_data; + +#if defined(QCOM) || defined(QCOM2) + zdl::DlSystem::Runtime_t Runtime; +#endif + + // snpe model stuff + std::unique_ptr snpe; + + // snpe input stuff + zdl::DlSystem::UserBufferMap inputMap; + std::unique_ptr inputBuffer; + + // snpe output stuff + zdl::DlSystem::UserBufferMap outputMap; + std::unique_ptr outputBuffer; + float *output; + size_t output_size; + + // recurrent and desire + std::unique_ptr addExtra(float *state, int state_size, int idx); + float *recurrent; + size_t recurrent_size; + std::unique_ptr recurrentBuffer; + float *trafficConvention; + std::unique_ptr trafficConventionBuffer; + float *desire; + std::unique_ptr desireBuffer; +}; diff --git a/selfdrive/modeld/runners/thneedmodel.cc b/selfdrive/modeld/runners/thneedmodel.cc new file mode 100644 index 000000000..0beb6a279 --- /dev/null +++ b/selfdrive/modeld/runners/thneedmodel.cc @@ -0,0 +1,47 @@ +#include "selfdrive/modeld/runners/thneedmodel.h" + +#include + +ThneedModel::ThneedModel(const char *path, float *loutput, size_t loutput_size, int runtime) { + thneed = new Thneed(true); + thneed->record = 0; + thneed->load(path); + thneed->clexec(); + thneed->find_inputs_outputs(); + + recorded = false; + output = loutput; +} + +void ThneedModel::addRecurrent(float *state, int state_size) { + recurrent = state; +} + +void ThneedModel::addTrafficConvention(float *state, int state_size) { + trafficConvention = state; +} + +void ThneedModel::addDesire(float *state, int state_size) { + desire = state; +} + +void* ThneedModel::getInputBuf() { + if (thneed->input_clmem.size() > 3) return &(thneed->input_clmem[3]); + else return nullptr; +} + +void ThneedModel::execute(float *net_input_buf, int buf_size) { + float *inputs[4] = {recurrent, trafficConvention, desire, net_input_buf}; + if (!recorded) { + thneed->record = THNEED_RECORD; + thneed->copy_inputs(inputs); + thneed->clexec(); + thneed->copy_output(output); + thneed->stop(); + + recorded = true; + } else { + thneed->execute(inputs, output); + } +} + diff --git a/selfdrive/modeld/runners/thneedmodel.h b/selfdrive/modeld/runners/thneedmodel.h new file mode 100644 index 000000000..1720d5ff2 --- /dev/null +++ b/selfdrive/modeld/runners/thneedmodel.h @@ -0,0 +1,25 @@ +#pragma once + +#include "selfdrive/modeld/runners/runmodel.h" +#include "selfdrive/modeld/thneed/thneed.h" + +class ThneedModel : public RunModel { +public: + ThneedModel(const char *path, float *loutput, size_t loutput_size, int runtime); + void addRecurrent(float *state, int state_size); + void addTrafficConvention(float *state, int state_size); + void addDesire(float *state, int state_size); + void execute(float *net_input_buf, int buf_size); + void* getInputBuf(); +private: + Thneed *thneed = NULL; + bool recorded; + + float *output; + + // recurrent and desire + float *recurrent; + float *trafficConvention; + float *desire; +}; + diff --git a/selfdrive/modeld/thneed/compile b/selfdrive/modeld/thneed/compile new file mode 100755 index 000000000..122b70476 Binary files /dev/null and b/selfdrive/modeld/thneed/compile differ diff --git a/selfdrive/modeld/thneed/compile.cc b/selfdrive/modeld/thneed/compile.cc new file mode 100644 index 000000000..01a71b747 --- /dev/null +++ b/selfdrive/modeld/thneed/compile.cc @@ -0,0 +1,35 @@ +#include + +#include "selfdrive/modeld/runners/snpemodel.h" +#include "selfdrive/modeld/thneed/thneed.h" + +#define TEMPORAL_SIZE 512 +#define DESIRE_LEN 8 +#define TRAFFIC_CONVENTION_LEN 2 + +// TODO: This should probably use SNPE directly. +int main(int argc, char* argv[]) { + #define OUTPUT_SIZE 0x10000 + float *output = (float*)calloc(OUTPUT_SIZE, sizeof(float)); + SNPEModel mdl(argv[1], output, 0, USE_GPU_RUNTIME); + + float state[TEMPORAL_SIZE] = {0}; + float desire[DESIRE_LEN] = {0}; + float traffic_convention[TRAFFIC_CONVENTION_LEN] = {0}; + float *input = (float*)calloc(0x1000000, sizeof(float)); + + mdl.addRecurrent(state, TEMPORAL_SIZE); + mdl.addDesire(desire, DESIRE_LEN); + mdl.addTrafficConvention(traffic_convention, TRAFFIC_CONVENTION_LEN); + + // first run + printf("************** execute 1 **************\n"); + memset(output, 0, OUTPUT_SIZE * sizeof(float)); + mdl.execute(input, 0); + + // save model + bool save_binaries = (argc > 3) && (strcmp(argv[3], "--binary") == 0); + mdl.thneed->save(argv[2], save_binaries); + return 0; +} + diff --git a/selfdrive/modeld/thneed/include/msm_kgsl.h b/selfdrive/modeld/thneed/include/msm_kgsl.h new file mode 100644 index 000000000..93582eb06 --- /dev/null +++ b/selfdrive/modeld/thneed/include/msm_kgsl.h @@ -0,0 +1,1449 @@ +#ifndef _UAPI_MSM_KGSL_H +#define _UAPI_MSM_KGSL_H + +#include +#include + +/* + * The KGSL version has proven not to be very useful in userspace if features + * are cherry picked into other trees out of order so it is frozen as of 3.14. + * It is left here for backwards compatabilty and as a reminder that + * software releases are never linear. Also, I like pie. + */ + +#define KGSL_VERSION_MAJOR 3 +#define KGSL_VERSION_MINOR 14 + +/* + * We have traditionally mixed context and issueibcmds / command batch flags + * together into a big flag stew. This worked fine until we started adding a + * lot more command batch flags and we started running out of bits. Turns out + * we have a bit of room in the context type / priority mask that we could use + * for command batches, but that means we need to split out the flags into two + * coherent sets. + * + * If any future definitions are for both context and cmdbatch add both defines + * and link the cmdbatch to the context define as we do below. Otherwise feel + * free to add exclusive bits to either set. + */ + +/* --- context flags --- */ +#define KGSL_CONTEXT_SAVE_GMEM 0x00000001 +#define KGSL_CONTEXT_NO_GMEM_ALLOC 0x00000002 +/* This is a cmdbatch exclusive flag - use the CMDBATCH equivalent instead */ +#define KGSL_CONTEXT_SUBMIT_IB_LIST 0x00000004 +#define KGSL_CONTEXT_CTX_SWITCH 0x00000008 +#define KGSL_CONTEXT_PREAMBLE 0x00000010 +#define KGSL_CONTEXT_TRASH_STATE 0x00000020 +#define KGSL_CONTEXT_PER_CONTEXT_TS 0x00000040 +#define KGSL_CONTEXT_USER_GENERATED_TS 0x00000080 +/* This is a cmdbatch exclusive flag - use the CMDBATCH equivalent instead */ +#define KGSL_CONTEXT_END_OF_FRAME 0x00000100 +#define KGSL_CONTEXT_NO_FAULT_TOLERANCE 0x00000200 +/* This is a cmdbatch exclusive flag - use the CMDBATCH equivalent instead */ +#define KGSL_CONTEXT_SYNC 0x00000400 +#define KGSL_CONTEXT_PWR_CONSTRAINT 0x00000800 + +#define KGSL_CONTEXT_PRIORITY_MASK 0x0000F000 +#define KGSL_CONTEXT_PRIORITY_SHIFT 12 +#define KGSL_CONTEXT_PRIORITY_UNDEF 0 + +#define KGSL_CONTEXT_IFH_NOP 0x00010000 +#define KGSL_CONTEXT_SECURE 0x00020000 + +#define KGSL_CONTEXT_PREEMPT_STYLE_MASK 0x0E000000 +#define KGSL_CONTEXT_PREEMPT_STYLE_SHIFT 25 +#define KGSL_CONTEXT_PREEMPT_STYLE_DEFAULT 0x0 +#define KGSL_CONTEXT_PREEMPT_STYLE_RINGBUFFER 0x1 +#define KGSL_CONTEXT_PREEMPT_STYLE_FINEGRAIN 0x2 + +#define KGSL_CONTEXT_TYPE_MASK 0x01F00000 +#define KGSL_CONTEXT_TYPE_SHIFT 20 +#define KGSL_CONTEXT_TYPE_ANY 0 +#define KGSL_CONTEXT_TYPE_GL 1 +#define KGSL_CONTEXT_TYPE_CL 2 +#define KGSL_CONTEXT_TYPE_C2D 3 +#define KGSL_CONTEXT_TYPE_RS 4 +#define KGSL_CONTEXT_TYPE_UNKNOWN 0x1E + +#define KGSL_CONTEXT_INVALID 0xffffffff + +/* + * --- command batch flags --- + * The bits that are linked to a KGSL_CONTEXT equivalent are either legacy + * definitions or bits that are valid for both contexts and cmdbatches. To be + * safe the other 8 bits that are still available in the context field should be + * omitted here in case we need to share - the other bits are available for + * cmdbatch only flags as needed + */ +#define KGSL_CMDBATCH_MEMLIST 0x00000001 +#define KGSL_CMDBATCH_MARKER 0x00000002 +#define KGSL_CMDBATCH_SUBMIT_IB_LIST KGSL_CONTEXT_SUBMIT_IB_LIST /* 0x004 */ +#define KGSL_CMDBATCH_CTX_SWITCH KGSL_CONTEXT_CTX_SWITCH /* 0x008 */ +#define KGSL_CMDBATCH_PROFILING 0x00000010 +#define KGSL_CMDBATCH_PROFILING_KTIME 0x00000020 +#define KGSL_CMDBATCH_END_OF_FRAME KGSL_CONTEXT_END_OF_FRAME /* 0x100 */ +#define KGSL_CMDBATCH_SYNC KGSL_CONTEXT_SYNC /* 0x400 */ +#define KGSL_CMDBATCH_PWR_CONSTRAINT KGSL_CONTEXT_PWR_CONSTRAINT /* 0x800 */ + +/* + * Reserve bits [16:19] and bits [28:31] for possible bits shared between + * contexts and command batches. Update this comment as new flags are added. + */ + +/* + * gpu_command_object flags - these flags communicate the type of command or + * memory object being submitted for a GPU command + */ + +/* Flags for GPU command objects */ +#define KGSL_CMDLIST_IB 0x00000001U +#define KGSL_CMDLIST_CTXTSWITCH_PREAMBLE 0x00000002U +#define KGSL_CMDLIST_IB_PREAMBLE 0x00000004U + +/* Flags for GPU command memory objects */ +#define KGSL_OBJLIST_MEMOBJ 0x00000008U +#define KGSL_OBJLIST_PROFILE 0x00000010U + +/* Flags for GPU command sync points */ +#define KGSL_CMD_SYNCPOINT_TYPE_TIMESTAMP 0 +#define KGSL_CMD_SYNCPOINT_TYPE_FENCE 1 + +/* --- Memory allocation flags --- */ + +/* General allocation hints */ +#define KGSL_MEMFLAGS_SECURE 0x00000008ULL +#define KGSL_MEMFLAGS_GPUREADONLY 0x01000000U +#define KGSL_MEMFLAGS_GPUWRITEONLY 0x02000000U +#define KGSL_MEMFLAGS_FORCE_32BIT 0x100000000ULL + +/* Memory caching hints */ +#define KGSL_CACHEMODE_MASK 0x0C000000U +#define KGSL_CACHEMODE_SHIFT 26 + +#define KGSL_CACHEMODE_WRITECOMBINE 0 +#define KGSL_CACHEMODE_UNCACHED 1 +#define KGSL_CACHEMODE_WRITETHROUGH 2 +#define KGSL_CACHEMODE_WRITEBACK 3 + +#define KGSL_MEMFLAGS_USE_CPU_MAP 0x10000000ULL + +/* Memory types for which allocations are made */ +#define KGSL_MEMTYPE_MASK 0x0000FF00 +#define KGSL_MEMTYPE_SHIFT 8 + +#define KGSL_MEMTYPE_OBJECTANY 0 +#define KGSL_MEMTYPE_FRAMEBUFFER 1 +#define KGSL_MEMTYPE_RENDERBUFFER 2 +#define KGSL_MEMTYPE_ARRAYBUFFER 3 +#define KGSL_MEMTYPE_ELEMENTARRAYBUFFER 4 +#define KGSL_MEMTYPE_VERTEXARRAYBUFFER 5 +#define KGSL_MEMTYPE_TEXTURE 6 +#define KGSL_MEMTYPE_SURFACE 7 +#define KGSL_MEMTYPE_EGL_SURFACE 8 +#define KGSL_MEMTYPE_GL 9 +#define KGSL_MEMTYPE_CL 10 +#define KGSL_MEMTYPE_CL_BUFFER_MAP 11 +#define KGSL_MEMTYPE_CL_BUFFER_NOMAP 12 +#define KGSL_MEMTYPE_CL_IMAGE_MAP 13 +#define KGSL_MEMTYPE_CL_IMAGE_NOMAP 14 +#define KGSL_MEMTYPE_CL_KERNEL_STACK 15 +#define KGSL_MEMTYPE_COMMAND 16 +#define KGSL_MEMTYPE_2D 17 +#define KGSL_MEMTYPE_EGL_IMAGE 18 +#define KGSL_MEMTYPE_EGL_SHADOW 19 +#define KGSL_MEMTYPE_MULTISAMPLE 20 +#define KGSL_MEMTYPE_KERNEL 255 + +/* + * Alignment hint, passed as the power of 2 exponent. + * i.e 4k (2^12) would be 12, 64k (2^16)would be 16. + */ +#define KGSL_MEMALIGN_MASK 0x00FF0000 +#define KGSL_MEMALIGN_SHIFT 16 + +enum kgsl_user_mem_type { + KGSL_USER_MEM_TYPE_PMEM = 0x00000000, + KGSL_USER_MEM_TYPE_ASHMEM = 0x00000001, + KGSL_USER_MEM_TYPE_ADDR = 0x00000002, + KGSL_USER_MEM_TYPE_ION = 0x00000003, + /* + * ION type is retained for backwards compatibilty but Ion buffers are + * dma-bufs so try to use that naming if we can + */ + KGSL_USER_MEM_TYPE_DMABUF = 0x00000003, + KGSL_USER_MEM_TYPE_MAX = 0x00000007, +}; +#define KGSL_MEMFLAGS_USERMEM_MASK 0x000000e0 +#define KGSL_MEMFLAGS_USERMEM_SHIFT 5 + +/* + * Unfortunately, enum kgsl_user_mem_type starts at 0 which does not + * leave a good value for allocated memory. In the flags we use + * 0 to indicate allocated memory and thus need to add 1 to the enum + * values. + */ +#define KGSL_USERMEM_FLAG(x) (((x) + 1) << KGSL_MEMFLAGS_USERMEM_SHIFT) + +#define KGSL_MEMFLAGS_NOT_USERMEM 0 +#define KGSL_MEMFLAGS_USERMEM_PMEM KGSL_USERMEM_FLAG(KGSL_USER_MEM_TYPE_PMEM) +#define KGSL_MEMFLAGS_USERMEM_ASHMEM \ + KGSL_USERMEM_FLAG(KGSL_USER_MEM_TYPE_ASHMEM) +#define KGSL_MEMFLAGS_USERMEM_ADDR KGSL_USERMEM_FLAG(KGSL_USER_MEM_TYPE_ADDR) +#define KGSL_MEMFLAGS_USERMEM_ION KGSL_USERMEM_FLAG(KGSL_USER_MEM_TYPE_ION) + +/* --- generic KGSL flag values --- */ + +#define KGSL_FLAGS_NORMALMODE 0x00000000 +#define KGSL_FLAGS_SAFEMODE 0x00000001 +#define KGSL_FLAGS_INITIALIZED0 0x00000002 +#define KGSL_FLAGS_INITIALIZED 0x00000004 +#define KGSL_FLAGS_STARTED 0x00000008 +#define KGSL_FLAGS_ACTIVE 0x00000010 +#define KGSL_FLAGS_RESERVED0 0x00000020 +#define KGSL_FLAGS_RESERVED1 0x00000040 +#define KGSL_FLAGS_RESERVED2 0x00000080 +#define KGSL_FLAGS_SOFT_RESET 0x00000100 +#define KGSL_FLAGS_PER_CONTEXT_TIMESTAMPS 0x00000200 + +/* Server Side Sync Timeout in milliseconds */ +#define KGSL_SYNCOBJ_SERVER_TIMEOUT 2000 + +/* + * Reset status values for context + */ +enum kgsl_ctx_reset_stat { + KGSL_CTX_STAT_NO_ERROR = 0x00000000, + KGSL_CTX_STAT_GUILTY_CONTEXT_RESET_EXT = 0x00000001, + KGSL_CTX_STAT_INNOCENT_CONTEXT_RESET_EXT = 0x00000002, + KGSL_CTX_STAT_UNKNOWN_CONTEXT_RESET_EXT = 0x00000003 +}; + +#define KGSL_CONVERT_TO_MBPS(val) \ + (val*1000*1000U) + +/* device id */ +enum kgsl_deviceid { + KGSL_DEVICE_3D0 = 0x00000000, + KGSL_DEVICE_MAX +}; + +struct kgsl_devinfo { + + unsigned int device_id; + /* chip revision id + * coreid:8 majorrev:8 minorrev:8 patch:8 + */ + unsigned int chip_id; + unsigned int mmu_enabled; + unsigned long gmem_gpubaseaddr; + /* + * This field contains the adreno revision + * number 200, 205, 220, etc... + */ + unsigned int gpu_id; + size_t gmem_sizebytes; +}; + +/* + * struct kgsl_devmemstore - this structure defines the region of memory + * that can be mmap()ed from this driver. The timestamp fields are volatile + * because they are written by the GPU + * @soptimestamp: Start of pipeline timestamp written by GPU before the + * commands in concern are processed + * @sbz: Unused, kept for 8 byte alignment + * @eoptimestamp: End of pipeline timestamp written by GPU after the + * commands in concern are processed + * @sbz2: Unused, kept for 8 byte alignment + * @preempted: Indicates if the context was preempted + * @sbz3: Unused, kept for 8 byte alignment + * @ref_wait_ts: Timestamp on which to generate interrupt, unused now. + * @sbz4: Unused, kept for 8 byte alignment + * @current_context: The current context the GPU is working on + * @sbz5: Unused, kept for 8 byte alignment + */ +struct kgsl_devmemstore { + volatile unsigned int soptimestamp; + unsigned int sbz; + volatile unsigned int eoptimestamp; + unsigned int sbz2; + volatile unsigned int preempted; + unsigned int sbz3; + volatile unsigned int ref_wait_ts; + unsigned int sbz4; + unsigned int current_context; + unsigned int sbz5; +}; + +#define KGSL_MEMSTORE_OFFSET(ctxt_id, field) \ + ((ctxt_id)*sizeof(struct kgsl_devmemstore) + \ + offsetof(struct kgsl_devmemstore, field)) + +/* timestamp id*/ +enum kgsl_timestamp_type { + KGSL_TIMESTAMP_CONSUMED = 0x00000001, /* start-of-pipeline timestamp */ + KGSL_TIMESTAMP_RETIRED = 0x00000002, /* end-of-pipeline timestamp*/ + KGSL_TIMESTAMP_QUEUED = 0x00000003, +}; + +/* property types - used with kgsl_device_getproperty */ +#define KGSL_PROP_DEVICE_INFO 0x1 +#define KGSL_PROP_DEVICE_SHADOW 0x2 +#define KGSL_PROP_DEVICE_POWER 0x3 +#define KGSL_PROP_SHMEM 0x4 +#define KGSL_PROP_SHMEM_APERTURES 0x5 +#define KGSL_PROP_MMU_ENABLE 0x6 +#define KGSL_PROP_INTERRUPT_WAITS 0x7 +#define KGSL_PROP_VERSION 0x8 +#define KGSL_PROP_GPU_RESET_STAT 0x9 +#define KGSL_PROP_PWRCTRL 0xE +#define KGSL_PROP_PWR_CONSTRAINT 0x12 +#define KGSL_PROP_UCHE_GMEM_VADDR 0x13 +#define KGSL_PROP_SP_GENERIC_MEM 0x14 +#define KGSL_PROP_UCODE_VERSION 0x15 +#define KGSL_PROP_GPMU_VERSION 0x16 +#define KGSL_PROP_DEVICE_BITNESS 0x18 + +struct kgsl_shadowprop { + unsigned long gpuaddr; + size_t size; + unsigned int flags; /* contains KGSL_FLAGS_ values */ +}; + +struct kgsl_version { + unsigned int drv_major; + unsigned int drv_minor; + unsigned int dev_major; + unsigned int dev_minor; +}; + +struct kgsl_sp_generic_mem { + uint64_t local; + uint64_t pvt; +}; + +struct kgsl_ucode_version { + unsigned int pfp; + unsigned int pm4; +}; + +struct kgsl_gpmu_version { + unsigned int major; + unsigned int minor; + unsigned int features; +}; + +/* Performance counter groups */ + +#define KGSL_PERFCOUNTER_GROUP_CP 0x0 +#define KGSL_PERFCOUNTER_GROUP_RBBM 0x1 +#define KGSL_PERFCOUNTER_GROUP_PC 0x2 +#define KGSL_PERFCOUNTER_GROUP_VFD 0x3 +#define KGSL_PERFCOUNTER_GROUP_HLSQ 0x4 +#define KGSL_PERFCOUNTER_GROUP_VPC 0x5 +#define KGSL_PERFCOUNTER_GROUP_TSE 0x6 +#define KGSL_PERFCOUNTER_GROUP_RAS 0x7 +#define KGSL_PERFCOUNTER_GROUP_UCHE 0x8 +#define KGSL_PERFCOUNTER_GROUP_TP 0x9 +#define KGSL_PERFCOUNTER_GROUP_SP 0xA +#define KGSL_PERFCOUNTER_GROUP_RB 0xB +#define KGSL_PERFCOUNTER_GROUP_PWR 0xC +#define KGSL_PERFCOUNTER_GROUP_VBIF 0xD +#define KGSL_PERFCOUNTER_GROUP_VBIF_PWR 0xE +#define KGSL_PERFCOUNTER_GROUP_MH 0xF +#define KGSL_PERFCOUNTER_GROUP_PA_SU 0x10 +#define KGSL_PERFCOUNTER_GROUP_SQ 0x11 +#define KGSL_PERFCOUNTER_GROUP_SX 0x12 +#define KGSL_PERFCOUNTER_GROUP_TCF 0x13 +#define KGSL_PERFCOUNTER_GROUP_TCM 0x14 +#define KGSL_PERFCOUNTER_GROUP_TCR 0x15 +#define KGSL_PERFCOUNTER_GROUP_L2 0x16 +#define KGSL_PERFCOUNTER_GROUP_VSC 0x17 +#define KGSL_PERFCOUNTER_GROUP_CCU 0x18 +#define KGSL_PERFCOUNTER_GROUP_LRZ 0x19 +#define KGSL_PERFCOUNTER_GROUP_CMP 0x1A +#define KGSL_PERFCOUNTER_GROUP_ALWAYSON 0x1B +#define KGSL_PERFCOUNTER_GROUP_SP_PWR 0x1C +#define KGSL_PERFCOUNTER_GROUP_TP_PWR 0x1D +#define KGSL_PERFCOUNTER_GROUP_RB_PWR 0x1E +#define KGSL_PERFCOUNTER_GROUP_CCU_PWR 0x1F +#define KGSL_PERFCOUNTER_GROUP_UCHE_PWR 0x20 +#define KGSL_PERFCOUNTER_GROUP_CP_PWR 0x21 +#define KGSL_PERFCOUNTER_GROUP_GPMU_PWR 0x22 +#define KGSL_PERFCOUNTER_GROUP_ALWAYSON_PWR 0x23 +#define KGSL_PERFCOUNTER_GROUP_MAX 0x24 + +#define KGSL_PERFCOUNTER_NOT_USED 0xFFFFFFFF +#define KGSL_PERFCOUNTER_BROKEN 0xFFFFFFFE + +/* structure holds list of ibs */ +struct kgsl_ibdesc { + unsigned long gpuaddr; + unsigned long __pad; + size_t sizedwords; + unsigned int ctrl; +}; + +/** + * struct kgsl_cmdbatch_profiling_buffer + * @wall_clock_s: Ringbuffer submission time (seconds). + * If KGSL_CMDBATCH_PROFILING_KTIME is set, time is provided + * in kernel clocks, otherwise wall clock time is used. + * @wall_clock_ns: Ringbuffer submission time (nanoseconds). + * If KGSL_CMDBATCH_PROFILING_KTIME is set time is provided + * in kernel clocks, otherwise wall clock time is used. + * @gpu_ticks_queued: GPU ticks at ringbuffer submission + * @gpu_ticks_submitted: GPU ticks when starting cmdbatch execution + * @gpu_ticks_retired: GPU ticks when finishing cmdbatch execution + * + * This structure defines the profiling buffer used to measure cmdbatch + * execution time + */ +struct kgsl_cmdbatch_profiling_buffer { + uint64_t wall_clock_s; + uint64_t wall_clock_ns; + uint64_t gpu_ticks_queued; + uint64_t gpu_ticks_submitted; + uint64_t gpu_ticks_retired; +}; + +/* ioctls */ +#define KGSL_IOC_TYPE 0x09 + +/* get misc info about the GPU + type should be a value from enum kgsl_property_type + value points to a structure that varies based on type + sizebytes is sizeof() that structure + for KGSL_PROP_DEVICE_INFO, use struct kgsl_devinfo + this structure contaings hardware versioning info. + for KGSL_PROP_DEVICE_SHADOW, use struct kgsl_shadowprop + this is used to find mmap() offset and sizes for mapping + struct kgsl_memstore into userspace. +*/ +struct kgsl_device_getproperty { + unsigned int type; + void __user *value; + size_t sizebytes; +}; + +#define IOCTL_KGSL_DEVICE_GETPROPERTY \ + _IOWR(KGSL_IOC_TYPE, 0x2, struct kgsl_device_getproperty) + +/* IOCTL_KGSL_DEVICE_READ (0x3) - removed 03/2012 + */ + +/* block until the GPU has executed past a given timestamp + * timeout is in milliseconds. + */ +struct kgsl_device_waittimestamp { + unsigned int timestamp; + unsigned int timeout; +}; + +#define IOCTL_KGSL_DEVICE_WAITTIMESTAMP \ + _IOW(KGSL_IOC_TYPE, 0x6, struct kgsl_device_waittimestamp) + +struct kgsl_device_waittimestamp_ctxtid { + unsigned int context_id; + unsigned int timestamp; + unsigned int timeout; +}; + +#define IOCTL_KGSL_DEVICE_WAITTIMESTAMP_CTXTID \ + _IOW(KGSL_IOC_TYPE, 0x7, struct kgsl_device_waittimestamp_ctxtid) + +/* DEPRECATED: issue indirect commands to the GPU. + * drawctxt_id must have been created with IOCTL_KGSL_DRAWCTXT_CREATE + * ibaddr and sizedwords must specify a subset of a buffer created + * with IOCTL_KGSL_SHAREDMEM_FROM_PMEM + * flags may be a mask of KGSL_CONTEXT_ values + * timestamp is a returned counter value which can be passed to + * other ioctls to determine when the commands have been executed by + * the GPU. + * + * This fucntion is deprecated - consider using IOCTL_KGSL_SUBMIT_COMMANDS + * instead + */ +struct kgsl_ringbuffer_issueibcmds { + unsigned int drawctxt_id; + unsigned long ibdesc_addr; + unsigned int numibs; + unsigned int timestamp; /*output param */ + unsigned int flags; +}; + +#define IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS \ + _IOWR(KGSL_IOC_TYPE, 0x10, struct kgsl_ringbuffer_issueibcmds) + +/* read the most recently executed timestamp value + * type should be a value from enum kgsl_timestamp_type + */ +struct kgsl_cmdstream_readtimestamp { + unsigned int type; + unsigned int timestamp; /*output param */ +}; + +#define IOCTL_KGSL_CMDSTREAM_READTIMESTAMP_OLD \ + _IOR(KGSL_IOC_TYPE, 0x11, struct kgsl_cmdstream_readtimestamp) + +#define IOCTL_KGSL_CMDSTREAM_READTIMESTAMP \ + _IOWR(KGSL_IOC_TYPE, 0x11, struct kgsl_cmdstream_readtimestamp) + +/* free memory when the GPU reaches a given timestamp. + * gpuaddr specify a memory region created by a + * IOCTL_KGSL_SHAREDMEM_FROM_PMEM call + * type should be a value from enum kgsl_timestamp_type + */ +struct kgsl_cmdstream_freememontimestamp { + unsigned long gpuaddr; + unsigned int type; + unsigned int timestamp; +}; + +#define IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP \ + _IOW(KGSL_IOC_TYPE, 0x12, struct kgsl_cmdstream_freememontimestamp) + +/* Previous versions of this header had incorrectly defined + IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP as a read-only ioctl instead + of a write only ioctl. To ensure binary compatability, the following + #define will be used to intercept the incorrect ioctl +*/ + +#define IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP_OLD \ + _IOR(KGSL_IOC_TYPE, 0x12, struct kgsl_cmdstream_freememontimestamp) + +/* create a draw context, which is used to preserve GPU state. + * The flags field may contain a mask KGSL_CONTEXT_* values + */ +struct kgsl_drawctxt_create { + unsigned int flags; + unsigned int drawctxt_id; /*output param */ +}; + +#define IOCTL_KGSL_DRAWCTXT_CREATE \ + _IOWR(KGSL_IOC_TYPE, 0x13, struct kgsl_drawctxt_create) + +/* destroy a draw context */ +struct kgsl_drawctxt_destroy { + unsigned int drawctxt_id; +}; + +#define IOCTL_KGSL_DRAWCTXT_DESTROY \ + _IOW(KGSL_IOC_TYPE, 0x14, struct kgsl_drawctxt_destroy) + +/* add a block of pmem, fb, ashmem or user allocated address + * into the GPU address space */ +struct kgsl_map_user_mem { + int fd; + unsigned long gpuaddr; /*output param */ + size_t len; + size_t offset; + unsigned long hostptr; /*input param */ + enum kgsl_user_mem_type memtype; + unsigned int flags; +}; + +#define IOCTL_KGSL_MAP_USER_MEM \ + _IOWR(KGSL_IOC_TYPE, 0x15, struct kgsl_map_user_mem) + +struct kgsl_cmdstream_readtimestamp_ctxtid { + unsigned int context_id; + unsigned int type; + unsigned int timestamp; /*output param */ +}; + +#define IOCTL_KGSL_CMDSTREAM_READTIMESTAMP_CTXTID \ + _IOWR(KGSL_IOC_TYPE, 0x16, struct kgsl_cmdstream_readtimestamp_ctxtid) + +struct kgsl_cmdstream_freememontimestamp_ctxtid { + unsigned int context_id; + unsigned long gpuaddr; + unsigned int type; + unsigned int timestamp; +}; + +#define IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP_CTXTID \ + _IOW(KGSL_IOC_TYPE, 0x17, \ + struct kgsl_cmdstream_freememontimestamp_ctxtid) + +/* add a block of pmem or fb into the GPU address space */ +struct kgsl_sharedmem_from_pmem { + int pmem_fd; + unsigned long gpuaddr; /*output param */ + unsigned int len; + unsigned int offset; +}; + +#define IOCTL_KGSL_SHAREDMEM_FROM_PMEM \ + _IOWR(KGSL_IOC_TYPE, 0x20, struct kgsl_sharedmem_from_pmem) + +/* remove memory from the GPU's address space */ +struct kgsl_sharedmem_free { + unsigned long gpuaddr; +}; + +#define IOCTL_KGSL_SHAREDMEM_FREE \ + _IOW(KGSL_IOC_TYPE, 0x21, struct kgsl_sharedmem_free) + +struct kgsl_cff_user_event { + unsigned char cff_opcode; + unsigned int op1; + unsigned int op2; + unsigned int op3; + unsigned int op4; + unsigned int op5; + unsigned int __pad[2]; +}; + +#define IOCTL_KGSL_CFF_USER_EVENT \ + _IOW(KGSL_IOC_TYPE, 0x31, struct kgsl_cff_user_event) + +struct kgsl_gmem_desc { + unsigned int x; + unsigned int y; + unsigned int width; + unsigned int height; + unsigned int pitch; +}; + +struct kgsl_buffer_desc { + void *hostptr; + unsigned long gpuaddr; + int size; + unsigned int format; + unsigned int pitch; + unsigned int enabled; +}; + +struct kgsl_bind_gmem_shadow { + unsigned int drawctxt_id; + struct kgsl_gmem_desc gmem_desc; + unsigned int shadow_x; + unsigned int shadow_y; + struct kgsl_buffer_desc shadow_buffer; + unsigned int buffer_id; +}; + +#define IOCTL_KGSL_DRAWCTXT_BIND_GMEM_SHADOW \ + _IOW(KGSL_IOC_TYPE, 0x22, struct kgsl_bind_gmem_shadow) + +/* add a block of memory into the GPU address space */ + +/* + * IOCTL_KGSL_SHAREDMEM_FROM_VMALLOC deprecated 09/2012 + * use IOCTL_KGSL_GPUMEM_ALLOC instead + */ + +struct kgsl_sharedmem_from_vmalloc { + unsigned long gpuaddr; /*output param */ + unsigned int hostptr; + unsigned int flags; +}; + +#define IOCTL_KGSL_SHAREDMEM_FROM_VMALLOC \ + _IOWR(KGSL_IOC_TYPE, 0x23, struct kgsl_sharedmem_from_vmalloc) + +/* + * This is being deprecated in favor of IOCTL_KGSL_GPUMEM_CACHE_SYNC which + * supports both directions (flush and invalidate). This code will still + * work, but by definition it will do a flush of the cache which might not be + * what you want to have happen on a buffer following a GPU operation. It is + * safer to go with IOCTL_KGSL_GPUMEM_CACHE_SYNC + */ + +#define IOCTL_KGSL_SHAREDMEM_FLUSH_CACHE \ + _IOW(KGSL_IOC_TYPE, 0x24, struct kgsl_sharedmem_free) + +struct kgsl_drawctxt_set_bin_base_offset { + unsigned int drawctxt_id; + unsigned int offset; +}; + +#define IOCTL_KGSL_DRAWCTXT_SET_BIN_BASE_OFFSET \ + _IOW(KGSL_IOC_TYPE, 0x25, struct kgsl_drawctxt_set_bin_base_offset) + +enum kgsl_cmdwindow_type { + KGSL_CMDWINDOW_MIN = 0x00000000, + KGSL_CMDWINDOW_2D = 0x00000000, + KGSL_CMDWINDOW_3D = 0x00000001, /* legacy */ + KGSL_CMDWINDOW_MMU = 0x00000002, + KGSL_CMDWINDOW_ARBITER = 0x000000FF, + KGSL_CMDWINDOW_MAX = 0x000000FF, +}; + +/* write to the command window */ +struct kgsl_cmdwindow_write { + enum kgsl_cmdwindow_type target; + unsigned int addr; + unsigned int data; +}; + +#define IOCTL_KGSL_CMDWINDOW_WRITE \ + _IOW(KGSL_IOC_TYPE, 0x2e, struct kgsl_cmdwindow_write) + +struct kgsl_gpumem_alloc { + unsigned long gpuaddr; /* output param */ + size_t size; + unsigned int flags; +}; + +#define IOCTL_KGSL_GPUMEM_ALLOC \ + _IOWR(KGSL_IOC_TYPE, 0x2f, struct kgsl_gpumem_alloc) + +struct kgsl_cff_syncmem { + unsigned long gpuaddr; + size_t len; + unsigned int __pad[2]; /* For future binary compatibility */ +}; + +#define IOCTL_KGSL_CFF_SYNCMEM \ + _IOW(KGSL_IOC_TYPE, 0x30, struct kgsl_cff_syncmem) + +/* + * A timestamp event allows the user space to register an action following an + * expired timestamp. Note IOCTL_KGSL_TIMESTAMP_EVENT has been redefined to + * _IOWR to support fences which need to return a fd for the priv parameter. + */ + +struct kgsl_timestamp_event { + int type; /* Type of event (see list below) */ + unsigned int timestamp; /* Timestamp to trigger event on */ + unsigned int context_id; /* Context for the timestamp */ + void __user *priv; /* Pointer to the event specific blob */ + size_t len; /* Size of the event specific blob */ +}; + +#define IOCTL_KGSL_TIMESTAMP_EVENT_OLD \ + _IOW(KGSL_IOC_TYPE, 0x31, struct kgsl_timestamp_event) + +/* A genlock timestamp event releases an existing lock on timestamp expire */ + +#define KGSL_TIMESTAMP_EVENT_GENLOCK 1 + +struct kgsl_timestamp_event_genlock { + int handle; /* Handle of the genlock lock to release */ +}; + +/* A fence timestamp event releases an existing lock on timestamp expire */ + +#define KGSL_TIMESTAMP_EVENT_FENCE 2 + +struct kgsl_timestamp_event_fence { + int fence_fd; /* Fence to signal */ +}; + +/* + * Set a property within the kernel. Uses the same structure as + * IOCTL_KGSL_GETPROPERTY + */ + +#define IOCTL_KGSL_SETPROPERTY \ + _IOW(KGSL_IOC_TYPE, 0x32, struct kgsl_device_getproperty) + +#define IOCTL_KGSL_TIMESTAMP_EVENT \ + _IOWR(KGSL_IOC_TYPE, 0x33, struct kgsl_timestamp_event) + +/** + * struct kgsl_gpumem_alloc_id - argument to IOCTL_KGSL_GPUMEM_ALLOC_ID + * @id: returned id value for this allocation. + * @flags: mask of KGSL_MEM* values requested and actual flags on return. + * @size: requested size of the allocation and actual size on return. + * @mmapsize: returned size to pass to mmap() which may be larger than 'size' + * @gpuaddr: returned GPU address for the allocation + * + * Allocate memory for access by the GPU. The flags and size fields are echoed + * back by the kernel, so that the caller can know if the request was + * adjusted. + * + * Supported flags: + * KGSL_MEMFLAGS_GPUREADONLY: the GPU will be unable to write to the buffer + * KGSL_MEMTYPE*: usage hint for debugging aid + * KGSL_MEMALIGN*: alignment hint, may be ignored or adjusted by the kernel. + * KGSL_MEMFLAGS_USE_CPU_MAP: If set on call and return, the returned GPU + * address will be 0. Calling mmap() will set the GPU address. + */ +struct kgsl_gpumem_alloc_id { + unsigned int id; + unsigned int flags; + size_t size; + size_t mmapsize; + unsigned long gpuaddr; +/* private: reserved for future use*/ + unsigned long __pad[2]; +}; + +#define IOCTL_KGSL_GPUMEM_ALLOC_ID \ + _IOWR(KGSL_IOC_TYPE, 0x34, struct kgsl_gpumem_alloc_id) + +/** + * struct kgsl_gpumem_free_id - argument to IOCTL_KGSL_GPUMEM_FREE_ID + * @id: GPU allocation id to free + * + * Free an allocation by id, in case a GPU address has not been assigned or + * is unknown. Freeing an allocation by id with this ioctl or by GPU address + * with IOCTL_KGSL_SHAREDMEM_FREE are equivalent. + */ +struct kgsl_gpumem_free_id { + unsigned int id; +/* private: reserved for future use*/ + unsigned int __pad; +}; + +#define IOCTL_KGSL_GPUMEM_FREE_ID \ + _IOWR(KGSL_IOC_TYPE, 0x35, struct kgsl_gpumem_free_id) + +/** + * struct kgsl_gpumem_get_info - argument to IOCTL_KGSL_GPUMEM_GET_INFO + * @gpuaddr: GPU address to query. Also set on return. + * @id: GPU allocation id to query. Also set on return. + * @flags: returned mask of KGSL_MEM* values. + * @size: returned size of the allocation. + * @mmapsize: returned size to pass mmap(), which may be larger than 'size' + * @useraddr: returned address of the userspace mapping for this buffer + * + * This ioctl allows querying of all user visible attributes of an existing + * allocation, by either the GPU address or the id returned by a previous + * call to IOCTL_KGSL_GPUMEM_ALLOC_ID. Legacy allocation ioctls may not + * return all attributes so this ioctl can be used to look them up if needed. + * + */ +struct kgsl_gpumem_get_info { + unsigned long gpuaddr; + unsigned int id; + unsigned int flags; + size_t size; + size_t mmapsize; + unsigned long useraddr; +/* private: reserved for future use*/ + unsigned long __pad[4]; +}; + +#define IOCTL_KGSL_GPUMEM_GET_INFO\ + _IOWR(KGSL_IOC_TYPE, 0x36, struct kgsl_gpumem_get_info) + +/** + * struct kgsl_gpumem_sync_cache - argument to IOCTL_KGSL_GPUMEM_SYNC_CACHE + * @gpuaddr: GPU address of the buffer to sync. + * @id: id of the buffer to sync. Either gpuaddr or id is sufficient. + * @op: a mask of KGSL_GPUMEM_CACHE_* values + * @offset: offset into the buffer + * @length: number of bytes starting from offset to perform + * the cache operation on + * + * Sync the L2 cache for memory headed to and from the GPU - this replaces + * KGSL_SHAREDMEM_FLUSH_CACHE since it can handle cache management for both + * directions + * + */ +struct kgsl_gpumem_sync_cache { + unsigned long gpuaddr; + unsigned int id; + unsigned int op; + size_t offset; + size_t length; +}; + +#define KGSL_GPUMEM_CACHE_CLEAN (1 << 0) +#define KGSL_GPUMEM_CACHE_TO_GPU KGSL_GPUMEM_CACHE_CLEAN + +#define KGSL_GPUMEM_CACHE_INV (1 << 1) +#define KGSL_GPUMEM_CACHE_FROM_GPU KGSL_GPUMEM_CACHE_INV + +#define KGSL_GPUMEM_CACHE_FLUSH \ + (KGSL_GPUMEM_CACHE_CLEAN | KGSL_GPUMEM_CACHE_INV) + +/* Flag to ensure backwards compatibility of kgsl_gpumem_sync_cache struct */ +#define KGSL_GPUMEM_CACHE_RANGE (1 << 31U) + +#define IOCTL_KGSL_GPUMEM_SYNC_CACHE \ + _IOW(KGSL_IOC_TYPE, 0x37, struct kgsl_gpumem_sync_cache) + +/** + * struct kgsl_perfcounter_get - argument to IOCTL_KGSL_PERFCOUNTER_GET + * @groupid: Performance counter group ID + * @countable: Countable to select within the group + * @offset: Return offset of the reserved LO counter + * @offset_hi: Return offset of the reserved HI counter + * + * Get an available performance counter from a specified groupid. The offset + * of the performance counter will be returned after successfully assigning + * the countable to the counter for the specified group. An error will be + * returned and an offset of 0 if the groupid is invalid or there are no + * more counters left. After successfully getting a perfcounter, the user + * must call kgsl_perfcounter_put(groupid, contable) when finished with + * the perfcounter to clear up perfcounter resources. + * + */ +struct kgsl_perfcounter_get { + unsigned int groupid; + unsigned int countable; + unsigned int offset; + unsigned int offset_hi; +/* private: reserved for future use */ + unsigned int __pad; /* For future binary compatibility */ +}; + +#define IOCTL_KGSL_PERFCOUNTER_GET \ + _IOWR(KGSL_IOC_TYPE, 0x38, struct kgsl_perfcounter_get) + +/** + * struct kgsl_perfcounter_put - argument to IOCTL_KGSL_PERFCOUNTER_PUT + * @groupid: Performance counter group ID + * @countable: Countable to release within the group + * + * Put an allocated performance counter to allow others to have access to the + * resource that was previously taken. This is only to be called after + * successfully getting a performance counter from kgsl_perfcounter_get(). + * + */ +struct kgsl_perfcounter_put { + unsigned int groupid; + unsigned int countable; +/* private: reserved for future use */ + unsigned int __pad[2]; /* For future binary compatibility */ +}; + +#define IOCTL_KGSL_PERFCOUNTER_PUT \ + _IOW(KGSL_IOC_TYPE, 0x39, struct kgsl_perfcounter_put) + +/** + * struct kgsl_perfcounter_query - argument to IOCTL_KGSL_PERFCOUNTER_QUERY + * @groupid: Performance counter group ID + * @countable: Return active countables array + * @size: Size of active countables array + * @max_counters: Return total number counters for the group ID + * + * Query the available performance counters given a groupid. The array + * *countables is used to return the current active countables in counters. + * The size of the array is passed in so the kernel will only write at most + * size or counter->size for the group id. The total number of available + * counters for the group ID is returned in max_counters. + * If the array or size passed in are invalid, then only the maximum number + * of counters will be returned, no data will be written to *countables. + * If the groupid is invalid an error code will be returned. + * + */ +struct kgsl_perfcounter_query { + unsigned int groupid; + /* Array to return the current countable for up to size counters */ + unsigned int __user *countables; + unsigned int count; + unsigned int max_counters; +/* private: reserved for future use */ + unsigned int __pad[2]; /* For future binary compatibility */ +}; + +#define IOCTL_KGSL_PERFCOUNTER_QUERY \ + _IOWR(KGSL_IOC_TYPE, 0x3A, struct kgsl_perfcounter_query) + +/** + * struct kgsl_perfcounter_query - argument to IOCTL_KGSL_PERFCOUNTER_QUERY + * @groupid: Performance counter group IDs + * @countable: Performance counter countable IDs + * @value: Return performance counter reads + * @size: Size of all arrays (groupid/countable pair and return value) + * + * Read in the current value of a performance counter given by the groupid + * and countable. + * + */ + +struct kgsl_perfcounter_read_group { + unsigned int groupid; + unsigned int countable; + unsigned long long value; +}; + +struct kgsl_perfcounter_read { + struct kgsl_perfcounter_read_group __user *reads; + unsigned int count; +/* private: reserved for future use */ + unsigned int __pad[2]; /* For future binary compatibility */ +}; + +#define IOCTL_KGSL_PERFCOUNTER_READ \ + _IOWR(KGSL_IOC_TYPE, 0x3B, struct kgsl_perfcounter_read) +/* + * struct kgsl_gpumem_sync_cache_bulk - argument to + * IOCTL_KGSL_GPUMEM_SYNC_CACHE_BULK + * @id_list: list of GPU buffer ids of the buffers to sync + * @count: number of GPU buffer ids in id_list + * @op: a mask of KGSL_GPUMEM_CACHE_* values + * + * Sync the cache for memory headed to and from the GPU. Certain + * optimizations can be made on the cache operation based on the total + * size of the working set of memory to be managed. + */ +struct kgsl_gpumem_sync_cache_bulk { + unsigned int __user *id_list; + unsigned int count; + unsigned int op; +/* private: reserved for future use */ + unsigned int __pad[2]; /* For future binary compatibility */ +}; + +#define IOCTL_KGSL_GPUMEM_SYNC_CACHE_BULK \ + _IOWR(KGSL_IOC_TYPE, 0x3C, struct kgsl_gpumem_sync_cache_bulk) + +/* + * struct kgsl_cmd_syncpoint_timestamp + * @context_id: ID of a KGSL context + * @timestamp: GPU timestamp + * + * This structure defines a syncpoint comprising a context/timestamp pair. A + * list of these may be passed by IOCTL_KGSL_SUBMIT_COMMANDS to define + * dependencies that must be met before the command can be submitted to the + * hardware + */ +struct kgsl_cmd_syncpoint_timestamp { + unsigned int context_id; + unsigned int timestamp; +}; + +struct kgsl_cmd_syncpoint_fence { + int fd; +}; + +/** + * struct kgsl_cmd_syncpoint - Define a sync point for a command batch + * @type: type of sync point defined here + * @priv: Pointer to the type specific buffer + * @size: Size of the type specific buffer + * + * This structure contains pointers defining a specific command sync point. + * The pointer and size should point to a type appropriate structure. + */ +struct kgsl_cmd_syncpoint { + int type; + void __user *priv; + size_t size; +}; + +/* Flag to indicate that the cmdlist may contain memlists */ +#define KGSL_IBDESC_MEMLIST 0x1 + +/* Flag to point out the cmdbatch profiling buffer in the memlist */ +#define KGSL_IBDESC_PROFILING_BUFFER 0x2 + +/** + * struct kgsl_submit_commands - Argument to IOCTL_KGSL_SUBMIT_COMMANDS + * @context_id: KGSL context ID that owns the commands + * @flags: + * @cmdlist: User pointer to a list of kgsl_ibdesc structures + * @numcmds: Number of commands listed in cmdlist + * @synclist: User pointer to a list of kgsl_cmd_syncpoint structures + * @numsyncs: Number of sync points listed in synclist + * @timestamp: On entry the a user defined timestamp, on exist the timestamp + * assigned to the command batch + * + * This structure specifies a command to send to the GPU hardware. This is + * similar to kgsl_issueibcmds expect that it doesn't support the legacy way to + * submit IB lists and it adds sync points to block the IB until the + * dependencies are satisified. This entry point is the new and preferred way + * to submit commands to the GPU. The memory list can be used to specify all + * memory that is referrenced in the current set of commands. + */ + +struct kgsl_submit_commands { + unsigned int context_id; + unsigned int flags; + struct kgsl_ibdesc __user *cmdlist; + unsigned int numcmds; + struct kgsl_cmd_syncpoint __user *synclist; + unsigned int numsyncs; + unsigned int timestamp; +/* private: reserved for future use */ + unsigned int __pad[4]; +}; + +#define IOCTL_KGSL_SUBMIT_COMMANDS \ + _IOWR(KGSL_IOC_TYPE, 0x3D, struct kgsl_submit_commands) + +/** + * struct kgsl_device_constraint - device constraint argument + * @context_id: KGSL context ID + * @type: type of constraint i.e pwrlevel/none + * @data: constraint data + * @size: size of the constraint data + */ +struct kgsl_device_constraint { + unsigned int type; + unsigned int context_id; + void __user *data; + size_t size; +}; + +/* Constraint Type*/ +#define KGSL_CONSTRAINT_NONE 0 +#define KGSL_CONSTRAINT_PWRLEVEL 1 + +/* PWRLEVEL constraint level*/ +/* set to min frequency */ +#define KGSL_CONSTRAINT_PWR_MIN 0 +/* set to max frequency */ +#define KGSL_CONSTRAINT_PWR_MAX 1 + +struct kgsl_device_constraint_pwrlevel { + unsigned int level; +}; + +/** + * struct kgsl_syncsource_create - Argument to IOCTL_KGSL_SYNCSOURCE_CREATE + * @id: returned id for the syncsource that was created. + * + * This ioctl creates a userspace sync timeline. + */ + +struct kgsl_syncsource_create { + unsigned int id; +/* private: reserved for future use */ + unsigned int __pad[3]; +}; + +#define IOCTL_KGSL_SYNCSOURCE_CREATE \ + _IOWR(KGSL_IOC_TYPE, 0x40, struct kgsl_syncsource_create) + +/** + * struct kgsl_syncsource_destroy - Argument to IOCTL_KGSL_SYNCSOURCE_DESTROY + * @id: syncsource id to destroy + * + * This ioctl creates a userspace sync timeline. + */ + +struct kgsl_syncsource_destroy { + unsigned int id; +/* private: reserved for future use */ + unsigned int __pad[3]; +}; + +#define IOCTL_KGSL_SYNCSOURCE_DESTROY \ + _IOWR(KGSL_IOC_TYPE, 0x41, struct kgsl_syncsource_destroy) + +/** + * struct kgsl_syncsource_create_fence - Argument to + * IOCTL_KGSL_SYNCSOURCE_CREATE_FENCE + * @id: syncsource id + * @fence_fd: returned sync_fence fd + * + * Create a fence that may be signaled by userspace by calling + * IOCTL_KGSL_SYNCSOURCE_SIGNAL_FENCE. There are no order dependencies between + * these fences. + */ +struct kgsl_syncsource_create_fence { + unsigned int id; + int fence_fd; +/* private: reserved for future use */ + unsigned int __pad[4]; +}; + +/** + * struct kgsl_syncsource_signal_fence - Argument to + * IOCTL_KGSL_SYNCSOURCE_SIGNAL_FENCE + * @id: syncsource id + * @fence_fd: sync_fence fd to signal + * + * Signal a fence that was created by a IOCTL_KGSL_SYNCSOURCE_CREATE_FENCE + * call using the same syncsource id. This allows a fence to be shared + * to other processes but only signaled by the process owning the fd + * used to create the fence. + */ +#define IOCTL_KGSL_SYNCSOURCE_CREATE_FENCE \ + _IOWR(KGSL_IOC_TYPE, 0x42, struct kgsl_syncsource_create_fence) + +struct kgsl_syncsource_signal_fence { + unsigned int id; + int fence_fd; +/* private: reserved for future use */ + unsigned int __pad[4]; +}; + +#define IOCTL_KGSL_SYNCSOURCE_SIGNAL_FENCE \ + _IOWR(KGSL_IOC_TYPE, 0x43, struct kgsl_syncsource_signal_fence) + +/** + * struct kgsl_cff_sync_gpuobj - Argument to IOCTL_KGSL_CFF_SYNC_GPUOBJ + * @offset: Offset into the GPU object to sync + * @length: Number of bytes to sync + * @id: ID of the GPU object to sync + */ +struct kgsl_cff_sync_gpuobj { + uint64_t offset; + uint64_t length; + unsigned int id; +}; + +#define IOCTL_KGSL_CFF_SYNC_GPUOBJ \ + _IOW(KGSL_IOC_TYPE, 0x44, struct kgsl_cff_sync_gpuobj) + +/** + * struct kgsl_gpuobj_alloc - Argument to IOCTL_KGSL_GPUOBJ_ALLOC + * @size: Size in bytes of the object to allocate + * @flags: mask of KGSL_MEMFLAG_* bits + * @va_len: Size in bytes of the virtual region to allocate + * @mmapsize: Returns the mmap() size of the object + * @id: Returns the GPU object ID of the new object + * @metadata_len: Length of the metdata to copy from the user + * @metadata: Pointer to the user specified metadata to store for the object + */ +struct kgsl_gpuobj_alloc { + uint64_t size; + uint64_t flags; + uint64_t va_len; + uint64_t mmapsize; + unsigned int id; + unsigned int metadata_len; + uint64_t metadata; +}; + +/* Let the user know that this header supports the gpuobj metadata */ +#define KGSL_GPUOBJ_ALLOC_METADATA_MAX 64 + +#define IOCTL_KGSL_GPUOBJ_ALLOC \ + _IOWR(KGSL_IOC_TYPE, 0x45, struct kgsl_gpuobj_alloc) + +/** + * struct kgsl_gpuobj_free - Argument to IOCTL_KGLS_GPUOBJ_FREE + * @flags: Mask of: KGSL_GUPOBJ_FREE_ON_EVENT + * @priv: Pointer to the private object if KGSL_GPUOBJ_FREE_ON_EVENT is + * specified + * @id: ID of the GPU object to free + * @type: If KGSL_GPUOBJ_FREE_ON_EVENT is specified, the type of asynchronous + * event to free on + * @len: Length of the data passed in priv + */ +struct kgsl_gpuobj_free { + uint64_t flags; + uint64_t __user priv; + unsigned int id; + unsigned int type; + unsigned int len; +}; + +#define KGSL_GPUOBJ_FREE_ON_EVENT 1 + +#define KGSL_GPU_EVENT_TIMESTAMP 1 +#define KGSL_GPU_EVENT_FENCE 2 + +/** + * struct kgsl_gpu_event_timestamp - Specifies a timestamp event to free a GPU + * object on + * @context_id: ID of the timestamp event to wait for + * @timestamp: Timestamp of the timestamp event to wait for + */ +struct kgsl_gpu_event_timestamp { + unsigned int context_id; + unsigned int timestamp; +}; + +/** + * struct kgsl_gpu_event_fence - Specifies a fence ID to to free a GPU object on + * @fd: File descriptor for the fence + */ +struct kgsl_gpu_event_fence { + int fd; +}; + +#define IOCTL_KGSL_GPUOBJ_FREE \ + _IOW(KGSL_IOC_TYPE, 0x46, struct kgsl_gpuobj_free) + +/** + * struct kgsl_gpuobj_info - argument to IOCTL_KGSL_GPUOBJ_INFO + * @gpuaddr: GPU address of the object + * @flags: Current flags for the object + * @size: Size of the object + * @va_len: VA size of the object + * @va_addr: Virtual address of the object (if it is mapped) + * id - GPU object ID of the object to query + */ +struct kgsl_gpuobj_info { + uint64_t gpuaddr; + uint64_t flags; + uint64_t size; + uint64_t va_len; + uint64_t va_addr; + unsigned int id; +}; + +#define IOCTL_KGSL_GPUOBJ_INFO \ + _IOWR(KGSL_IOC_TYPE, 0x47, struct kgsl_gpuobj_info) + +/** + * struct kgsl_gpuobj_import - argument to IOCTL_KGSL_GPUOBJ_IMPORT + * @priv: Pointer to the private data for the import type + * @priv_len: Length of the private data + * @flags: Mask of KGSL_MEMFLAG_ flags + * @type: Type of the import (KGSL_USER_MEM_TYPE_*) + * @id: Returns the ID of the new GPU object + */ +struct kgsl_gpuobj_import { + uint64_t __user priv; + uint64_t priv_len; + uint64_t flags; + unsigned int type; + unsigned int id; +}; + +/** + * struct kgsl_gpuobj_import_dma_buf - import a dmabuf object + * @fd: File descriptor for the dma-buf object + */ +struct kgsl_gpuobj_import_dma_buf { + int fd; +}; + +/** + * struct kgsl_gpuobj_import_useraddr - import an object based on a useraddr + * @virtaddr: Virtual address of the object to import + */ +struct kgsl_gpuobj_import_useraddr { + uint64_t virtaddr; +}; + +#define IOCTL_KGSL_GPUOBJ_IMPORT \ + _IOWR(KGSL_IOC_TYPE, 0x48, struct kgsl_gpuobj_import) + +/** + * struct kgsl_gpuobj_sync_obj - Individual GPU object to sync + * @offset: Offset within the GPU object to sync + * @length: Number of bytes to sync + * @id: ID of the GPU object to sync + * @op: Cache operation to execute + */ + +struct kgsl_gpuobj_sync_obj { + uint64_t offset; + uint64_t length; + unsigned int id; + unsigned int op; +}; + +/** + * struct kgsl_gpuobj_sync - Argument for IOCTL_KGSL_GPUOBJ_SYNC + * @objs: Pointer to an array of kgsl_gpuobj_sync_obj structs + * @obj_len: Size of each item in the array + * @count: Number of items in the array + */ + +struct kgsl_gpuobj_sync { + uint64_t __user objs; + unsigned int obj_len; + unsigned int count; +}; + +#define IOCTL_KGSL_GPUOBJ_SYNC \ + _IOW(KGSL_IOC_TYPE, 0x49, struct kgsl_gpuobj_sync) + +/** + * struct kgsl_command_object - GPU command object + * @offset: GPU address offset of the object + * @gpuaddr: GPU address of the object + * @size: Size of the object + * @flags: Current flags for the object + * @id - GPU command object ID + */ +struct kgsl_command_object { + uint64_t offset; + uint64_t gpuaddr; + uint64_t size; + unsigned int flags; + unsigned int id; +}; + +/** + * struct kgsl_command_syncpoint - GPU syncpoint object + * @priv: Pointer to the type specific buffer + * @size: Size of the type specific buffer + * @type: type of sync point defined here + */ +struct kgsl_command_syncpoint { + uint64_t __user priv; + uint64_t size; + unsigned int type; +}; + +/** + * struct kgsl_command_object - Argument for IOCTL_KGSL_GPU_COMMAND + * @flags: Current flags for the object + * @cmdlist: List of kgsl_command_objects for submission + * @cmd_size: Size of kgsl_command_objects structure + * @numcmds: Number of kgsl_command_objects in command list + * @objlist: List of kgsl_command_objects for tracking + * @obj_size: Size of kgsl_command_objects structure + * @numobjs: Number of kgsl_command_objects in object list + * @synclist: List of kgsl_command_syncpoints + * @sync_size: Size of kgsl_command_syncpoint structure + * @numsyncs: Number of kgsl_command_syncpoints in syncpoint list + * @context_id: Context ID submittin ghte kgsl_gpu_command + * @timestamp: Timestamp for the submitted commands + */ +struct kgsl_gpu_command { + uint64_t flags; + uint64_t __user cmdlist; + unsigned int cmdsize; + unsigned int numcmds; + uint64_t __user objlist; + unsigned int objsize; + unsigned int numobjs; + uint64_t __user synclist; + unsigned int syncsize; + unsigned int numsyncs; + unsigned int context_id; + unsigned int timestamp; +}; + +#define IOCTL_KGSL_GPU_COMMAND \ + _IOWR(KGSL_IOC_TYPE, 0x4A, struct kgsl_gpu_command) + +/** + * struct kgsl_preemption_counters_query - argument to + * IOCTL_KGSL_PREEMPTIONCOUNTER_QUERY + * @counters: Return preemption counters array + * @size_user: Size allocated by userspace + * @size_priority_level: Size of preemption counters for each + * priority level + * @max_priority_level: Return max number of priority levels + * + * Query the available preemption counters. The array counters + * is used to return preemption counters. The size of the array + * is passed in so the kernel will only write at most size_user + * or max available preemption counters. The total number of + * preemption counters is returned in max_priority_level. If the + * array or size passed in are invalid, then an error is + * returned back. + */ +struct kgsl_preemption_counters_query { + uint64_t __user counters; + unsigned int size_user; + unsigned int size_priority_level; + unsigned int max_priority_level; +}; + +#define IOCTL_KGSL_PREEMPTIONCOUNTER_QUERY \ + _IOWR(KGSL_IOC_TYPE, 0x4B, struct kgsl_preemption_counters_query) + +/** + * struct kgsl_gpuobj_set_info - argument for IOCTL_KGSL_GPUOBJ_SET_INFO + * @flags: Flags to indicate which paramaters to change + * @metadata: If KGSL_GPUOBJ_SET_INFO_METADATA is set, a pointer to the new + * metadata + * @id: GPU memory object ID to change + * @metadata_len: If KGSL_GPUOBJ_SET_INFO_METADATA is set, the length of the + * new metadata string + * @type: If KGSL_GPUOBJ_SET_INFO_TYPE is set, the new type of the memory object + */ + +#define KGSL_GPUOBJ_SET_INFO_METADATA (1 << 0) +#define KGSL_GPUOBJ_SET_INFO_TYPE (1 << 1) + +struct kgsl_gpuobj_set_info { + uint64_t flags; + uint64_t metadata; + unsigned int id; + unsigned int metadata_len; + unsigned int type; +}; + +#define IOCTL_KGSL_GPUOBJ_SET_INFO \ + _IOW(KGSL_IOC_TYPE, 0x4C, struct kgsl_gpuobj_set_info) + +#endif /* _UAPI_MSM_KGSL_H */ diff --git a/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads.cl b/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads.cl new file mode 100644 index 000000000..1cd077aec --- /dev/null +++ b/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads.cl @@ -0,0 +1,129 @@ +__kernel void convolution_horizontal_reduced_reads( + read_only image2d_t input, + short startPackedInputChannel, + short numPackedInputChannelsForGroup, short totalNumPackedInputChannels, + short packedOuputChannelOffset, short totalNumPackedOutputChannels, + read_only image2d_t weights, __constant float *biases, + short filterSizeX, short filterSizeY, + write_only image2d_t output, + short paddingX, short paddingY, short strideX, short strideY, + short dilationX, short dilationY, + short neuron, float a, float b, float min_clamp, float max_clamp, + __constant float *parameters, __constant float *batchNormBiases, + short numOutputColumns) { + + // init + const sampler_t smp = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST; + short packedOutputChannel = get_global_id(0); + short startOutputColumn = mul24((short)get_global_id(1), 4); + short outputRow = get_global_id(2); + short startX = mad24(mad24(startOutputColumn, strideX, -paddingX), + totalNumPackedInputChannels, startPackedInputChannel); + short strideWithChannels = mul24(strideX, totalNumPackedInputChannels); + + float4 outputValues[4]; + for (short i = 0; i < 4; ++i) { + outputValues[i] = (float4)(0, 0, 0, 0); + } + + int2 inputLocation; + inputLocation.y = mad24(outputRow, strideY, -paddingY); + + int2 weightLocation; + weightLocation.x = 0; + weightLocation.y = packedOutputChannel; + + // convolution + for (short rfRow = 0; rfRow < filterSizeY; ++rfRow) { + for (short packedInputChannel = 0; + packedInputChannel < numPackedInputChannelsForGroup; + ++packedInputChannel) { + short startXForChannel = startX + packedInputChannel; + for (short rfColumn = 0; rfColumn < filterSizeX; ++rfColumn) { + float4 weightValues[4]; + for (short outChIdx = 0; outChIdx < 4; ++outChIdx) { + weightValues[outChIdx] = read_imagef(weights, smp, weightLocation); + ++weightLocation.x; + } + short dilatedStepX = mul24(totalNumPackedInputChannels, dilationX); + inputLocation.x = mad24(rfColumn, dilatedStepX, startXForChannel); + float4 inputValues[4]; + for (short i = 0; i < 4; ++i) { + inputValues[i] = read_imagef(input, smp, inputLocation); + inputLocation.x += strideWithChannels; + } + for (short i = 0; i < 4; ++i) { + float4 curOutputValues = outputValues[i]; + curOutputValues.x += inputValues[i].x * weightValues[0].x; + curOutputValues.x += inputValues[i].y * weightValues[0].y; + curOutputValues.x += inputValues[i].z * weightValues[0].z; + curOutputValues.x += inputValues[i].w * weightValues[0].w; + curOutputValues.y += inputValues[i].x * weightValues[1].x; + curOutputValues.y += inputValues[i].y * weightValues[1].y; + curOutputValues.y += inputValues[i].z * weightValues[1].z; + curOutputValues.y += inputValues[i].w * weightValues[1].w; + curOutputValues.z += inputValues[i].x * weightValues[2].x; + curOutputValues.z += inputValues[i].y * weightValues[2].y; + curOutputValues.z += inputValues[i].z * weightValues[2].z; + curOutputValues.z += inputValues[i].w * weightValues[2].w; + curOutputValues.w += inputValues[i].x * weightValues[3].x; + curOutputValues.w += inputValues[i].y * weightValues[3].y; + curOutputValues.w += inputValues[i].z * weightValues[3].z; + curOutputValues.w += inputValues[i].w * weightValues[3].w; + outputValues[i] = curOutputValues; + } + } + } + inputLocation.y += dilationY; + } + + // bias + packedOutputChannel += packedOuputChannelOffset; + short outputChannel = mul24(packedOutputChannel, 4); + float4 biasValues = vload4(0, biases + outputChannel); + for (short i = 0; i < 4; ++i) { + outputValues[i] += biasValues; + } + + // activation + switch (neuron) { + case 1: + for (short i = 0; i < 4; ++i) { + outputValues[i] = max(outputValues[i], 0.0f); + } + break; + case 2: + for (short i = 0; i < 4; ++i) { + outputValues[i] = a * tanh(b * outputValues[i]); + } + break; + case 3: + for (short i = 0; i < 4; ++i) { + outputValues[i] = native_recip(1.0f + native_exp(-a * outputValues[i] + b)); + } + break; + case 4: + for (short i = 0; i < 4; ++i) { + outputValues[i] = max(outputValues[i], min_clamp); + outputValues[i] = min(outputValues[i], max_clamp); + } + break; + case 5: + for (short i = 0; i < 4; ++i) { + outputValues[i] = max(outputValues[i], 0.0f) + a * (native_exp(min(outputValues[i], 0.0f)) - 1.0f); + } + break; + } + + // output + int2 outputLocation; + short outputColumn = startOutputColumn; + outputLocation.y = outputRow; + for (short i = 0; i < 4; ++i) { + outputLocation.x = mad24(outputColumn, totalNumPackedOutputChannels, packedOutputChannel); + if (outputColumn < numOutputColumns) { + write_imagef(output, outputLocation, outputValues[i]); + } + ++outputColumn; + } +} diff --git a/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads_1x1.cl b/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads_1x1.cl new file mode 100644 index 000000000..bbadf50bf --- /dev/null +++ b/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads_1x1.cl @@ -0,0 +1,140 @@ +__kernel void convolution_horizontal_reduced_reads_1x1( + read_only image2d_t input, + short startPackedInputChannel, + short numPackedInputChannelsForGroup, short totalNumPackedInputChannels, + short packedOuputChannelOffset, short totalNumPackedOutputChannels, + read_only image2d_t weights, __constant float *biases, + short filterSizeX, short filterSizeY, + write_only image2d_t output, + short paddingX, short paddingY, short strideX, short strideY, + short neuron, float a, float b, float min_clamp, float max_clamp, + __constant float *parameters, __constant float *batchNormBiases, + short numOutputColumns, + short doAccumulate, read_only image2d_t accumulator) { + + // init + const sampler_t smp = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST; + short packedOutputChannel = get_global_id(0); + short startOutputColumn = mul24((short)get_global_id(1), 4); + short outputRow = get_global_id(2); + short endPackedInputChannel = startPackedInputChannel + numPackedInputChannelsForGroup; + short startX = mad24(mad24(startOutputColumn, strideX, -paddingX), + totalNumPackedInputChannels, startPackedInputChannel); + short strideWithChannels = mul24(strideX, totalNumPackedInputChannels); + + float4 outputValues[4]; + for (short i = 0; i < 4; ++i) { + outputValues[i] = (float4)(0, 0, 0, 0); + } + + int2 inputLocation; + inputLocation.y = mad24(outputRow, strideY, -paddingY); + + int2 weightLocation; + weightLocation.x = 0; + weightLocation.y = packedOutputChannel; + + // convolution + for (short packedInputChannel = startPackedInputChannel; + packedInputChannel < endPackedInputChannel; ++packedInputChannel) { + + float4 weightValues[4]; + for (short outChIdx = 0; outChIdx < 4; ++outChIdx) { + weightValues[outChIdx] = read_imagef(weights, smp, weightLocation); + ++weightLocation.x; + } + + inputLocation.x = startX + packedInputChannel; + float4 inputValues[4]; + for (short i = 0; i < 4; ++i) { + inputValues[i] = read_imagef(input, smp, inputLocation); + inputLocation.x += strideWithChannels; + } + + for (short i = 0; i < 4; ++i) { + float4 curOutputValues = outputValues[i]; + curOutputValues.x += inputValues[i].x * weightValues[0].x; + curOutputValues.x += inputValues[i].y * weightValues[0].y; + curOutputValues.x += inputValues[i].z * weightValues[0].z; + curOutputValues.x += inputValues[i].w * weightValues[0].w; + curOutputValues.y += inputValues[i].x * weightValues[1].x; + curOutputValues.y += inputValues[i].y * weightValues[1].y; + curOutputValues.y += inputValues[i].z * weightValues[1].z; + curOutputValues.y += inputValues[i].w * weightValues[1].w; + curOutputValues.z += inputValues[i].x * weightValues[2].x; + curOutputValues.z += inputValues[i].y * weightValues[2].y; + curOutputValues.z += inputValues[i].z * weightValues[2].z; + curOutputValues.z += inputValues[i].w * weightValues[2].w; + curOutputValues.w += inputValues[i].x * weightValues[3].x; + curOutputValues.w += inputValues[i].y * weightValues[3].y; + curOutputValues.w += inputValues[i].z * weightValues[3].z; + curOutputValues.w += inputValues[i].w * weightValues[3].w; + outputValues[i] = curOutputValues; + } + } + + // bias + packedOutputChannel += packedOuputChannelOffset; + short outputChannel = mul24(packedOutputChannel, 4); + float4 biasValues = vload4(0, biases + outputChannel); + for (short i = 0; i < 4; ++i) { + outputValues[i] += biasValues; + } + + // accumulate + if (doAccumulate) { + int2 outputLocation; + short outputColumn = startOutputColumn; + outputLocation.y = outputRow; + for (short i = 0; i < 4; ++i) { + outputLocation.x = mad24(outputColumn, totalNumPackedOutputChannels, packedOutputChannel); + if (outputColumn < numOutputColumns) { + outputValues[i] += read_imagef(accumulator, smp, outputLocation); + } + ++outputColumn; + } + } + + // activation + switch (neuron) { + case 1: + for (short i = 0; i < 4; ++i) { + outputValues[i] = max(outputValues[i], 0.0f); + } + break; + case 2: + for (short i = 0; i < 4; ++i) { + outputValues[i] = a * tanh(b * outputValues[i]); + } + break; + case 3: + for (short i = 0; i < 4; ++i) { + outputValues[i] = native_recip(1.0f + native_exp(-a * outputValues[i] + b)); + } + break; + case 4: + for (short i = 0; i < 4; ++i) { + outputValues[i] = max(outputValues[i], min_clamp); + outputValues[i] = min(outputValues[i], max_clamp); + } + break; + case 5: + for (short i = 0; i < 4; ++i) { + outputValues[i] = max(outputValues[i], 0.0f) + a * (native_exp(min(outputValues[i], 0.0f)) - 1.0f); + } + break; + } + + // output + int2 outputLocation; + short outputColumn = startOutputColumn; + outputLocation.y = outputRow; + for (short i = 0; i < 4; ++i) { + outputLocation.x = mad24(outputColumn, totalNumPackedOutputChannels, packedOutputChannel); + if (outputColumn < numOutputColumns) { + write_imagef(output, outputLocation, outputValues[i]); + } + ++outputColumn; + } +} + diff --git a/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads_5_outputs.cl b/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads_5_outputs.cl new file mode 100644 index 000000000..399e1a77c --- /dev/null +++ b/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads_5_outputs.cl @@ -0,0 +1,130 @@ +__kernel void convolution_horizontal_reduced_reads_5_outputs( + read_only image2d_t input, + short startPackedInputChannel, + short numPackedInputChannelsForGroup, short totalNumPackedInputChannels, + short packedOuputChannelOffset, short totalNumPackedOutputChannels, + read_only image2d_t weights, __constant float *biases, + short filterSizeX, short filterSizeY, + write_only image2d_t output, + short paddingX, short paddingY, short strideX, short strideY, + short neuron, float a, float b, float min_clamp, float max_clamp, + __constant float *parameters, __constant float *batchNormBiases, + short numOutputColumns) { + + // init + const sampler_t smp = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST; + short packedOutputChannel = get_global_id(0); + short startOutputColumn = mul24((short)get_global_id(1), 5); + short outputRow = get_global_id(2); + short startX = mad24(mad24(startOutputColumn, strideX, -paddingX), + totalNumPackedInputChannels, startPackedInputChannel); + short strideWithChannels = mul24(strideX, totalNumPackedInputChannels); + + float4 outputValues[5]; + for (short i = 0; i < 5; ++i) { + outputValues[i] = (float4)(0, 0, 0, 0); + } + + int2 inputLocation; + inputLocation.y = mad24(outputRow, strideY, -paddingY); + + int2 weightLocation; + weightLocation.x = 0; + weightLocation.y = packedOutputChannel; + + // convolution + for (short rfRow = 0; rfRow < filterSizeY; ++rfRow) { + for (short packedInputChannel = 0; + packedInputChannel < numPackedInputChannelsForGroup; + ++packedInputChannel) { + short startXForChannel = startX + packedInputChannel; + for (short rfColumn = 0; rfColumn < filterSizeX; ++rfColumn) { + float4 weightValues[4]; + for (short outChIdx = 0; outChIdx < 4; ++outChIdx) { + weightValues[outChIdx] = read_imagef(weights, smp, weightLocation); + ++weightLocation.x; + } + inputLocation.x = + mad24(rfColumn, totalNumPackedInputChannels, startXForChannel); + + float4 inputValues[5]; + for (short i = 0; i < 5; ++i) { + inputValues[i] = read_imagef(input, smp, inputLocation); + inputLocation.x += strideWithChannels; + } + + for (short i = 0; i < 5; ++i) { + float4 curOutputValues = outputValues[i]; + curOutputValues.x += inputValues[i].x * weightValues[0].x; + curOutputValues.x += inputValues[i].y * weightValues[0].y; + curOutputValues.x += inputValues[i].z * weightValues[0].z; + curOutputValues.x += inputValues[i].w * weightValues[0].w; + curOutputValues.y += inputValues[i].x * weightValues[1].x; + curOutputValues.y += inputValues[i].y * weightValues[1].y; + curOutputValues.y += inputValues[i].z * weightValues[1].z; + curOutputValues.y += inputValues[i].w * weightValues[1].w; + curOutputValues.z += inputValues[i].x * weightValues[2].x; + curOutputValues.z += inputValues[i].y * weightValues[2].y; + curOutputValues.z += inputValues[i].z * weightValues[2].z; + curOutputValues.z += inputValues[i].w * weightValues[2].w; + curOutputValues.w += inputValues[i].x * weightValues[3].x; + curOutputValues.w += inputValues[i].y * weightValues[3].y; + curOutputValues.w += inputValues[i].z * weightValues[3].z; + curOutputValues.w += inputValues[i].w * weightValues[3].w; + outputValues[i] = curOutputValues; + } + } + } + ++inputLocation.y; + } + + // bias + packedOutputChannel += packedOuputChannelOffset; + short outputChannel = mul24(packedOutputChannel, 4); + float4 biasValues = vload4(0, biases + outputChannel); + for (short i = 0; i < 5; ++i) { + outputValues[i] += biasValues; + } + + // activation + switch (neuron) { + case 1: + for (short i = 0; i < 5; ++i) { + outputValues[i] = max(outputValues[i], 0.0f); + } + break; + case 2: + for (short i = 0; i < 5; ++i) { + outputValues[i] = a * tanh(b * outputValues[i]); + } + break; + case 3: + for (short i = 0; i < 5; ++i) { + outputValues[i] = native_recip(1.0f + native_exp(-a * outputValues[i] + b)); + } + break; + case 4: + for (short i = 0; i < 5; ++i) { + outputValues[i] = max(outputValues[i], min_clamp); + outputValues[i] = min(outputValues[i], max_clamp); + } + break; + case 5: + for (short i = 0; i < 5; ++i) { + outputValues[i] = max(outputValues[i], 0.0f) + a * (native_exp(min(outputValues[i], 0.0f)) - 1.0f); + } + break; + } + + // output + int2 outputLocation; + short outputColumn = startOutputColumn; + outputLocation.y = outputRow; + for (short i = 0; i < 5; ++i) { + outputLocation.x = mad24(outputColumn, totalNumPackedOutputChannels, packedOutputChannel); + if (outputColumn < numOutputColumns) { + write_imagef(output, outputLocation, outputValues[i]); + } + ++outputColumn; + } +} diff --git a/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads_depthwise.cl b/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads_depthwise.cl new file mode 100644 index 000000000..b3ff16bcd --- /dev/null +++ b/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads_depthwise.cl @@ -0,0 +1,101 @@ +__kernel void convolution_horizontal_reduced_reads_depthwise( + read_only image2d_t input, + short totalNumPackedChannels, + read_only image2d_t weights, __constant float *biases, + short filterSizeX, short filterSizeY, + write_only image2d_t output, + short paddingX, short paddingY, short strideX, short strideY, + short dilationX, short dilationY, + short neuron, float a, float b, float min_clamp, float max_clamp, + short numOutputColumns) { + + // init + const sampler_t smp = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST; + short packedChannel = get_global_id(0); + short startOutputColumn = mul24((short)get_global_id(1), 4); + short outputRow = get_global_id(2); + short startXForChannel = mad24(mad24(startOutputColumn, strideX, -paddingX), + totalNumPackedChannels, packedChannel); + short strideWithChannels = mul24(strideX, totalNumPackedChannels); + + float4 outputValues[4]; + for (short i = 0; i < 4; ++i) { + outputValues[i] = (float4)(0, 0, 0, 0); + } + + int2 inputLocation; + inputLocation.y = mad24(outputRow, strideY, -paddingY); + + int2 weightLocation; + weightLocation.x = 0; + weightLocation.y = packedChannel; + + // convolution + for (short rfRow = 0; rfRow < filterSizeY; ++rfRow) { + for (short rfColumn = 0; rfColumn < filterSizeX; ++rfColumn) { + short dilatedStepX = mul24(totalNumPackedChannels, dilationX); + inputLocation.x = mad24(rfColumn, dilatedStepX, startXForChannel); + float4 inputValues[4]; + for (short i = 0; i < 4; ++i) { + inputValues[i] = read_imagef(input, smp, inputLocation); + inputLocation.x += strideWithChannels; + } + float4 weightValues = read_imagef(weights, smp, weightLocation); + ++weightLocation.x; + outputValues[0] += inputValues[0] * weightValues; + outputValues[1] += inputValues[1] * weightValues; + outputValues[2] += inputValues[2] * weightValues; + outputValues[3] += inputValues[3] * weightValues; + } + inputLocation.y += dilationY; + } + + // bias + short outputChannel = mul24(packedChannel, 4); + float4 biasValues = vload4(0, biases + outputChannel); + for (short i = 0; i < 4; ++i) { + outputValues[i] += biasValues; + } + + // activation + switch (neuron) { + case 1: + for (short i = 0; i < 4; ++i) { + outputValues[i] = max(outputValues[i], 0.0f); + } + break; + case 2: + for (short i = 0; i < 4; ++i) { + outputValues[i] = a * tanh(b * outputValues[i]); + } + break; + case 3: + for (short i = 0; i < 4; ++i) { + outputValues[i] = native_recip(1.0f + native_exp(-a * outputValues[i] + b)); + } + break; + case 4: + for (short i = 0; i < 4; ++i) { + outputValues[i] = max(outputValues[i], min_clamp); + outputValues[i] = min(outputValues[i], max_clamp); + } + break; + case 5: + for (short i = 0; i < 4; ++i) { + outputValues[i] = max(outputValues[i], 0.0f) + a * (native_exp(min(outputValues[i], 0.0f)) - 1.0f); + } + break; + } + + // output + int2 outputLocation; + short outputColumn = startOutputColumn; + outputLocation.y = outputRow; + for (short i = 0; i < 4; ++i) { + outputLocation.x = mad24(outputColumn, totalNumPackedChannels, packedChannel); + if (outputColumn < numOutputColumns) { + write_imagef(output, outputLocation, outputValues[i]); + } + ++outputColumn; + } +} diff --git a/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads_depthwise_stride_1.cl b/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads_depthwise_stride_1.cl new file mode 100644 index 000000000..0ac2b7796 --- /dev/null +++ b/selfdrive/modeld/thneed/kernels/convolution_horizontal_reduced_reads_depthwise_stride_1.cl @@ -0,0 +1,103 @@ +__kernel void convolution_horizontal_reduced_reads_depthwise_stride_1( + read_only image2d_t input, + short totalNumPackedChannels, + read_only image2d_t weights, __constant float *biases, + short filterSizeX, short filterSizeY, + write_only image2d_t output, + short paddingX, short paddingY, short strideX, short strideY, + short neuron, float a, float b, float min_clamp, float max_clamp, + short numOutputColumns) { + + // init + const sampler_t smp = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST; + short packedChannel = get_global_id(0); + short startOutputColumn = mul24((short)get_global_id(1), 4); + short outputRow = get_global_id(2); + short startXForChannel = mad24(mad24(startOutputColumn, strideX, -paddingX), + totalNumPackedChannels, packedChannel); + + float4 outputValues[4]; + for (short i = 0; i < 4; ++i) { + outputValues[i] = (float4)(0, 0, 0, 0); + } + + int2 inputLocation; + inputLocation.y = mad24(outputRow, strideY, -paddingY); + + int2 weightLocation; + weightLocation.x = 0; + weightLocation.y = packedChannel; + + // convolution + for (short rfRow = 0; rfRow < filterSizeY; ++rfRow) { + float4 inputValues[4]; + inputLocation.x = startXForChannel; + for (short i = 1; i < 4; ++i) { + inputValues[i] = read_imagef(input, smp, inputLocation); + inputLocation.x += totalNumPackedChannels; + } + for (short rfColumn = 0; rfColumn < filterSizeX; ++rfColumn) { + inputValues[0] = inputValues[1]; + inputValues[1] = inputValues[2]; + inputValues[2] = inputValues[3]; + inputValues[3] = read_imagef(input, smp, inputLocation); + inputLocation.x += totalNumPackedChannels; + float4 weightValues = read_imagef(weights, smp, weightLocation); + ++weightLocation.x; + outputValues[0] += inputValues[0] * weightValues; + outputValues[1] += inputValues[1] * weightValues; + outputValues[2] += inputValues[2] * weightValues; + outputValues[3] += inputValues[3] * weightValues; + } + ++inputLocation.y; + } + + // bias + short outputChannel = mul24(packedChannel, 4); + float4 biasValues = vload4(0, biases + outputChannel); + for (short i = 0; i < 4; ++i) { + outputValues[i] += biasValues; + } + + // activation + switch (neuron) { + case 1: + for (short i = 0; i < 4; ++i) { + outputValues[i] = max(outputValues[i], 0.0f); + } + break; + case 2: + for (short i = 0; i < 4; ++i) { + outputValues[i] = a * tanh(b * outputValues[i]); + } + break; + case 3: + for (short i = 0; i < 4; ++i) { + outputValues[i] = native_recip(1.0f + native_exp(-a * outputValues[i] + b)); + } + break; + case 4: + for (short i = 0; i < 4; ++i) { + outputValues[i] = max(outputValues[i], min_clamp); + outputValues[i] = min(outputValues[i], max_clamp); + } + break; + case 5: + for (short i = 0; i < 4; ++i) { + outputValues[i] = max(outputValues[i], 0.0f) + a * (native_exp(min(outputValues[i], 0.0f)) - 1.0f); + } + break; + } + + // output + int2 outputLocation; + short outputColumn = startOutputColumn; + outputLocation.y = outputRow; + for (short i = 0; i < 4; ++i) { + outputLocation.x = mad24(outputColumn, totalNumPackedChannels, packedChannel); + if (outputColumn < numOutputColumns) { + write_imagef(output, outputLocation, outputValues[i]); + } + ++outputColumn; + } +} diff --git a/selfdrive/modeld/thneed/optimizer.cc b/selfdrive/modeld/thneed/optimizer.cc new file mode 100644 index 000000000..0d1da18ec --- /dev/null +++ b/selfdrive/modeld/thneed/optimizer.cc @@ -0,0 +1,259 @@ +#include +#include +#include +#include +#include "thneed.h" + +extern map g_program_source; + +static int is_same_size_image(cl_mem a, cl_mem b) { + size_t a_width, a_height, a_depth, a_array_size, a_row_pitch, a_slice_pitch; + clGetImageInfo(a, CL_IMAGE_WIDTH, sizeof(a_width), &a_width, NULL); + clGetImageInfo(a, CL_IMAGE_HEIGHT, sizeof(a_height), &a_height, NULL); + clGetImageInfo(a, CL_IMAGE_DEPTH, sizeof(a_depth), &a_depth, NULL); + clGetImageInfo(a, CL_IMAGE_ARRAY_SIZE, sizeof(a_array_size), &a_array_size, NULL); + clGetImageInfo(a, CL_IMAGE_ROW_PITCH, sizeof(a_row_pitch), &a_row_pitch, NULL); + clGetImageInfo(a, CL_IMAGE_SLICE_PITCH, sizeof(a_slice_pitch), &a_slice_pitch, NULL); + + size_t b_width, b_height, b_depth, b_array_size, b_row_pitch, b_slice_pitch; + clGetImageInfo(b, CL_IMAGE_WIDTH, sizeof(b_width), &b_width, NULL); + clGetImageInfo(b, CL_IMAGE_HEIGHT, sizeof(b_height), &b_height, NULL); + clGetImageInfo(b, CL_IMAGE_DEPTH, sizeof(b_depth), &b_depth, NULL); + clGetImageInfo(b, CL_IMAGE_ARRAY_SIZE, sizeof(b_array_size), &b_array_size, NULL); + clGetImageInfo(b, CL_IMAGE_ROW_PITCH, sizeof(b_row_pitch), &b_row_pitch, NULL); + clGetImageInfo(b, CL_IMAGE_SLICE_PITCH, sizeof(b_slice_pitch), &b_slice_pitch, NULL); + + return (a_width == b_width) && (a_height == b_height) && + (a_depth == b_depth) && (a_array_size == b_array_size) && + (a_row_pitch == b_row_pitch) && (a_slice_pitch == b_slice_pitch); +} + +static cl_mem make_image_like(cl_context context, cl_mem val) { + cl_image_format format; + size_t width, height, row_pitch; + clGetImageInfo(val, CL_IMAGE_FORMAT, sizeof(format), &format, NULL); + assert(format.image_channel_order == CL_RGBA); + assert(format.image_channel_data_type == CL_HALF_FLOAT); + clGetImageInfo(val, CL_IMAGE_WIDTH, sizeof(width), &width, NULL); + clGetImageInfo(val, CL_IMAGE_HEIGHT, sizeof(height), &height, NULL); + clGetImageInfo(val, CL_IMAGE_ROW_PITCH, sizeof(row_pitch), &row_pitch, NULL); + + cl_image_desc desc = {0}; + desc.image_type = CL_MEM_OBJECT_IMAGE2D; + desc.image_width = width; + desc.image_height = height; + desc.image_row_pitch = row_pitch; + + cl_mem buf = clCreateBuffer(context, CL_MEM_READ_WRITE, row_pitch*height, NULL, NULL); + assert(buf != NULL); + desc.buffer = buf; + + cl_int err; + cl_mem tmp = clCreateImage(context, CL_MEM_READ_WRITE, &format, &desc, NULL, &err); + //printf("got %d for image %zux%zu %zu\n", err, width, height, row_pitch); + assert(tmp != NULL); + + return tmp; +} + +// convolution_horizontal_reduced_reads_1x1 is 66% of the model runtime +// make that faster and the model gets faster + +// this cuts ~2 ms off the model runtime right now +int Thneed::optimize() { + const char *kernel_path = getenv("KERNEL_PATH"); + if (!kernel_path) { kernel_path = "/data/openpilot/selfdrive/modeld/thneed/kernels"; printf("no KERNEL_PATH set, defaulting to %s\n", kernel_path); } + // load custom kernels + map g_programs; + for (auto &k : kq) { + // replace program? + if (g_programs.find(k->name) == g_programs.end()) { + char fn[0x100]; + snprintf(fn, sizeof(fn), "%s/%s.cl", kernel_path, k->name.c_str()); + FILE *g = fopen(fn, "rb"); + if (g != NULL) { + char *src[0x10000]; + const char *srcs[1]; srcs[0] = (const char *)src; + memset(src, 0, sizeof(src)); + size_t length = fread(src, 1, sizeof(src), g); + fclose(g); + + printf("building kernel %s\n", k->name.c_str()); + k->program = clCreateProgramWithSource(context, 1, srcs, &length, NULL); + int err = clBuildProgram(k->program, 1, &device_id, "", NULL, NULL); + + if (err != 0) { + printf("got err %d\n", err); + size_t err_length; + char buffer[2048]; + clGetProgramBuildInfo(k->program, device_id, CL_PROGRAM_BUILD_LOG, sizeof(buffer), buffer, &err_length); + buffer[err_length] = '\0'; + printf("%s\n", buffer); + } + assert(err == 0); + + // save in cache + g_programs[k->name] = k->program; + g_program_source[k->program] = string((char *)src, length); + } else { + g_programs[k->name] = NULL; + } + } else { + // cached replacement + if (g_programs[k->name] != NULL) { + k->program = g_programs[k->name]; + } + } + + // hack in accumulator to convolution_horizontal_reduced_reads_1x1 + if (k->name == "convolution_horizontal_reduced_reads_1x1") { + k->arg_names.push_back("doAccumulate"); + short doAccumulate = 0; + k->args.push_back(string((char *)&doAccumulate, sizeof(doAccumulate))); + k->args_size.push_back(2); + k->arg_names.push_back("accumulator"); + k->args.push_back(k->args[k->get_arg_num("output")]); + k->args_size.push_back(8); + k->num_args += 2; + } + + // assert that parameters + batchNormBiases are not used + // since they aren't supported in custom replacement kernels + if (k->name == "convolution_horizontal_reduced_reads_1x1" || + k->name == "convolution_horizontal_reduced_reads" || + k->name == "convolution_horizontal_reduced_reads_5_outputs") { + string p1 = k->args[k->get_arg_num("parameters")]; + string p2 = k->args[k->get_arg_num("batchNormBiases")]; + assert(p1.length() == 8 && *((uint64_t*)p1.data()) == 0); + assert(p2.length() == 8 && *((uint64_t*)p2.data()) == 0); + } + } + + // optimizer + size_t start_size; + do { + start_size = kq.size(); + + // get optimizations + map replacements; + for (int i = 0; i < kq.size(); i++) { + // fusing elementwise_sum + activate_image will save 3 enqueues + + // delete useless copy layers + // saves ~0.7 ms + if (kq[i]->name == "concatenation" || kq[i]->name == "flatten") { + string in = kq[i]->args[kq[i]->get_arg_num("input")]; + string out = kq[i]->args[kq[i]->get_arg_num("output")]; + if (is_same_size_image(*(cl_mem*)in.data(), *(cl_mem*)out.data())) { + cl_mem tmp = make_image_like(context, *(cl_mem *)in.data()); + replacements[in] = string((char *)&tmp, sizeof(tmp)); + replacements[out] = string((char *)&tmp, sizeof(tmp)); + + kq.erase(kq.begin()+i); --i; + } + } + + // NOTE: if activations/accumulation are done in the wrong order, this will be wrong + + // fuse activations into convs and fc_Wtx + // saves ~1.5 ms + // NOTE: this changes the outputs because of rounding, should be better now! + if (i != 0 && kq[i]->name == "activate_image") { + if (kq[i-1]->name == "convolution_horizontal_reduced_reads_1x1" || + kq[i-1]->name == "convolution_horizontal_reduced_reads_5_outputs" || + kq[i-1]->name == "convolution_horizontal_reduced_reads" || + kq[i-1]->name == "convolution_horizontal_reduced_reads_depthwise" || + kq[i-1]->name == "convolution_horizontal_reduced_reads_depthwise_stride_1" || + kq[i-1]->name == "fc_Wtx") { + string lastout = kq[i-1]->args[kq[i-1]->get_arg_num("output")]; + string in = kq[i]->args[kq[i]->get_arg_num("input")]; + string out = kq[i]->args[kq[i]->get_arg_num("output")]; + + if (lastout == in) { + short neuron = *(int*)kq[i]->args[kq[i]->get_arg_num("neuron")].data(); + kq[i-1]->args[kq[i-1]->get_arg_num("neuron")] = string((char *)&neuron, sizeof(neuron)); + + cl_mem tmp = make_image_like(context, *(cl_mem *)lastout.data()); + replacements[in] = string((char *)&tmp, sizeof(tmp)); + replacements[out] = string((char *)&tmp, sizeof(tmp)); + + kq.erase(kq.begin()+i); --i; + } + } + } + + // fuse accumulation into convs and fc_Wtx + if (i != 0 && kq[i]->name == "elementwise_sum") { + if (kq[i-1]->name == "convolution_horizontal_reduced_reads_1x1" || + kq[i-1]->name == "fc_Wtx") { + string lastout = kq[i-1]->args[kq[i-1]->get_arg_num("output")]; + string a = kq[i]->args[kq[i]->get_arg_num("a")]; + string b = kq[i]->args[kq[i]->get_arg_num("b")]; + string out = kq[i]->args[kq[i]->get_arg_num("output")]; + + if (lastout == a) { + kq[i-1]->args[kq[i-1]->get_arg_num("accumulator")] = b; + } else if (lastout == b) { + kq[i-1]->args[kq[i-1]->get_arg_num("accumulator")] = a; + } else { + continue; + } + + cl_mem tmp = make_image_like(context, *(cl_mem *)lastout.data()); + replacements[lastout] = string((char *)&tmp, sizeof(tmp)); + replacements[out] = string((char *)&tmp, sizeof(tmp)); + + short doAccumulate = 1; + kq[i-1]->args[kq[i-1]->get_arg_num("doAccumulate")] = string((char *)&doAccumulate, sizeof(doAccumulate)); + + kq.erase(kq.begin()+i); --i; + } + } + } + + // remap inputs and outputs, and clear the kernels + for (int i = 0; i < kq.size(); i++) { + kq[i]->kernel = NULL; + for (int j = 0; j < kq[i]->num_args; j++) { + if (replacements.find(kq[i]->args[j]) != replacements.end()) { + kq[i]->args[j] = replacements[kq[i]->args[j]]; + } + } + } + + printf("optimize %lu -> %lu\n", start_size, kq.size()); + } while (kq.size() != start_size); + + size_t work_group_size = 0; + clGetDeviceInfo(device_id, CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(work_group_size), &work_group_size, NULL); + printf("max work group size %lu\n", work_group_size); + + // local work group optimizer + for (auto &k : kq) { + // only do it for convs, since others might share memory + if (k->name.rfind("convolution_", 0) == 0) { + int best = -1; + if (k->local_work_size[0] * k->local_work_size[1] * k->local_work_size[2] < work_group_size/2) { + uint64_t base_time = k->benchmark(); + uint64_t best_time = base_time; + for (int i = 0; i < 3; i++) { + k->local_work_size[i] *= 2; + uint64_t this_time = k->benchmark(); + if (this_time < best_time) { + best = i; + best_time = this_time; + } + k->local_work_size[i] /= 2; + } + if (best != -1) { + k->local_work_size[best] *= 2; + //printf("%s %.2f ms doubled %d to %.2f ms\n", k->name.c_str(), base_time/1e6, best, best_time/1e6); + } + } + + } + } + + return 0; +} + diff --git a/selfdrive/modeld/thneed/serialize.cc b/selfdrive/modeld/thneed/serialize.cc new file mode 100644 index 000000000..cd5584553 --- /dev/null +++ b/selfdrive/modeld/thneed/serialize.cc @@ -0,0 +1,258 @@ +#include +#include + +#include "json11.hpp" +#include "selfdrive/common/util.h" +#include "selfdrive/common/clutil.h" +#include "selfdrive/modeld/thneed/thneed.h" +using namespace json11; + +extern map g_program_source; + +void Thneed::load(const char *filename) { + printf("Thneed::load: loading from %s\n", filename); + + string buf = util::read_file(filename); + int jsz = *(int *)buf.data(); + string err; + string jj(buf.data() + sizeof(int), jsz); + Json jdat = Json::parse(jj, err); + + map real_mem; + real_mem[NULL] = NULL; + + int ptr = sizeof(int)+jsz; + for (auto &obj : jdat["objects"].array_items()) { + auto mobj = obj.object_items(); + int sz = mobj["size"].int_value(); + cl_mem clbuf = NULL; + + if (mobj["buffer_id"].string_value().size() > 0) { + // image buffer must already be allocated + clbuf = real_mem[*(cl_mem*)(mobj["buffer_id"].string_value().data())]; + assert(mobj["needs_load"].bool_value() == false); + } else { + if (mobj["needs_load"].bool_value()) { + //printf("loading %p %d @ 0x%X\n", clbuf, sz, ptr); + clbuf = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR | CL_MEM_READ_WRITE, sz, &buf[ptr], NULL); + ptr += sz; + } else { + clbuf = clCreateBuffer(context, CL_MEM_READ_WRITE, sz, NULL, NULL); + } + } + assert(clbuf != NULL); + + if (mobj["arg_type"] == "image2d_t" || mobj["arg_type"] == "image1d_t") { + cl_image_desc desc = {0}; + desc.image_type = (mobj["arg_type"] == "image2d_t") ? CL_MEM_OBJECT_IMAGE2D : CL_MEM_OBJECT_IMAGE1D_BUFFER; + desc.image_width = mobj["width"].int_value(); + desc.image_height = mobj["height"].int_value(); + desc.image_row_pitch = mobj["row_pitch"].int_value(); + desc.buffer = clbuf; + + cl_image_format format; + format.image_channel_order = CL_RGBA; + format.image_channel_data_type = CL_HALF_FLOAT; + + clbuf = clCreateImage(context, CL_MEM_READ_WRITE, &format, &desc, NULL, NULL); + assert(clbuf != NULL); + } + + real_mem[*(cl_mem*)(mobj["id"].string_value().data())] = clbuf; + } + + map g_programs; + for (const auto &[name, source] : jdat["programs"].object_items()) { + if (record & THNEED_DEBUG) printf("building %s with size %zu\n", name.c_str(), source.string_value().size()); + g_programs[name] = cl_program_from_source(context, device_id, source.string_value()); + } + + for (auto &obj : jdat["binaries"].array_items()) { + string name = obj["name"].string_value(); + size_t length = obj["length"].int_value(); + if (record & THNEED_DEBUG) printf("binary %s with size %zu\n", name.c_str(), length); + g_programs[name] = cl_program_from_binary(context, device_id, (const uint8_t*)&buf[ptr], length); + ptr += length; + } + + for (auto &obj : jdat["kernels"].array_items()) { + auto gws = obj["global_work_size"]; + auto lws = obj["local_work_size"]; + auto kk = shared_ptr(new CLQueuedKernel(this)); + + kk->name = obj["name"].string_value(); + kk->program = g_programs[kk->name]; + kk->work_dim = obj["work_dim"].int_value(); + for (int i = 0; i < kk->work_dim; i++) { + kk->global_work_size[i] = gws[i].int_value(); + kk->local_work_size[i] = lws[i].int_value(); + } + kk->num_args = obj["num_args"].int_value(); + for (int i = 0; i < kk->num_args; i++) { + string arg = obj["args"].array_items()[i].string_value(); + int arg_size = obj["args_size"].array_items()[i].int_value(); + kk->args_size.push_back(arg_size); + if (arg_size == 8) { + cl_mem val = *(cl_mem*)(arg.data()); + val = real_mem[val]; + kk->args.push_back(string((char*)&val, sizeof(val))); + } else { + kk->args.push_back(arg); + } + } + kq.push_back(kk); + } + + clFinish(command_queue); +} + +void Thneed::save(const char *filename, bool save_binaries) { + printf("Thneed::save: saving to %s\n", filename); + + // get kernels + std::vector kernels; + std::set saved_objects; + std::vector objects; + std::map programs; + std::map binaries; + + for (auto &k : kq) { + kernels.push_back(k->to_json()); + + // check args for objects + int i = 0; + for (auto &a : k->args) { + if (a.size() == 8) { + if (saved_objects.find(a) == saved_objects.end()) { + saved_objects.insert(a); + cl_mem val = *(cl_mem*)(a.data()); + if (val != NULL) { + bool needs_load = k->arg_names[i] == "weights" || k->arg_names[i] == "biases"; + + auto jj = Json::object({ + {"id", a}, + {"arg_type", k->arg_types[i]}, + }); + + if (k->arg_types[i] == "image2d_t" || k->arg_types[i] == "image1d_t") { + cl_mem buf; + clGetImageInfo(val, CL_IMAGE_BUFFER, sizeof(buf), &buf, NULL); + string aa = string((char *)&buf, sizeof(buf)); + jj["buffer_id"] = aa; + + size_t width, height, row_pitch; + clGetImageInfo(val, CL_IMAGE_WIDTH, sizeof(width), &width, NULL); + clGetImageInfo(val, CL_IMAGE_HEIGHT, sizeof(height), &height, NULL); + clGetImageInfo(val, CL_IMAGE_ROW_PITCH, sizeof(row_pitch), &row_pitch, NULL); + jj["width"] = (int)width; + jj["height"] = (int)height; + jj["row_pitch"] = (int)row_pitch; + jj["size"] = (int)(height * row_pitch); + jj["needs_load"] = false; + + if (saved_objects.find(aa) == saved_objects.end()) { + saved_objects.insert(aa); + size_t sz; + clGetMemObjectInfo(buf, CL_MEM_SIZE, sizeof(sz), &sz, NULL); + // save the buffer + objects.push_back(Json::object({ + {"id", aa}, + {"arg_type", ""}, + {"needs_load", needs_load}, + {"size", (int)sz} + })); + if (needs_load) assert(sz == height * row_pitch); + } + } else { + size_t sz = 0; + clGetMemObjectInfo(val, CL_MEM_SIZE, sizeof(sz), &sz, NULL); + jj["size"] = (int)sz; + jj["needs_load"] = needs_load; + } + + objects.push_back(jj); + } + } + } + i++; + } + + if (save_binaries) { + int err; + size_t binary_size = 0; + err = clGetProgramInfo(k->program, CL_PROGRAM_BINARY_SIZES, sizeof(binary_size), &binary_size, NULL); + assert(err == 0); + assert(binary_size > 0); + string sv(binary_size, '\x00'); + + uint8_t* bufs[1] = { (uint8_t*)sv.data(), }; + err = clGetProgramInfo(k->program, CL_PROGRAM_BINARIES, sizeof(bufs), &bufs, NULL); + assert(err == 0); + + binaries[k->name] = sv; + } else { + programs[k->name] = g_program_source[k->program]; + } + } + + vector saved_buffers; + for (auto &obj : objects) { + auto mobj = obj.object_items(); + cl_mem val = *(cl_mem*)(mobj["id"].string_value().data()); + int sz = mobj["size"].int_value(); + if (mobj["needs_load"].bool_value()) { + char *buf = (char *)malloc(sz); + if (mobj["arg_type"] == "image2d_t" || mobj["arg_type"] == "image1d_t") { + assert(false); + } else { + // buffers allocated with CL_MEM_HOST_WRITE_ONLY, hence this hack + //hexdump((uint32_t*)val, 0x100); + + // the worst hack in thneed, the flags are at 0x14 + ((uint32_t*)val)[0x14] &= ~CL_MEM_HOST_WRITE_ONLY; + cl_int ret = clEnqueueReadBuffer(command_queue, val, CL_TRUE, 0, sz, buf, 0, NULL, NULL); + assert(ret == CL_SUCCESS); + } + //printf("saving buffer: %d %p %s\n", sz, buf, mobj["arg_type"].string_value().c_str()); + saved_buffers.push_back(string(buf, sz)); + free(buf); + } + } + + std::vector jbinaries; + for (auto &obj : binaries) { + jbinaries.push_back(Json::object({{"name", obj.first}, {"length", (int)obj.second.size()}})); + saved_buffers.push_back(obj.second); + } + + Json jdat = Json::object({ + {"kernels", kernels}, + {"objects", objects}, + {"programs", programs}, + {"binaries", jbinaries}, + }); + + string str = jdat.dump(); + int jsz = str.length(); + + FILE *f = fopen(filename, "wb"); + fwrite(&jsz, 1, sizeof(jsz), f); + fwrite(str.data(), 1, jsz, f); + for (auto &s : saved_buffers) { + fwrite(s.data(), 1, s.length(), f); + } + fclose(f); +} + +Json CLQueuedKernel::to_json() const { + return Json::object { + { "name", name }, + { "work_dim", (int)work_dim }, + { "global_work_size", Json::array { (int)global_work_size[0], (int)global_work_size[1], (int)global_work_size[2] } }, + { "local_work_size", Json::array { (int)local_work_size[0], (int)local_work_size[1], (int)local_work_size[2] } }, + { "num_args", (int)num_args }, + { "args", args }, + { "args_size", args_size }, + }; +} + diff --git a/selfdrive/modeld/thneed/thneed.cc b/selfdrive/modeld/thneed/thneed.cc new file mode 100644 index 000000000..31bfa3e2f --- /dev/null +++ b/selfdrive/modeld/thneed/thneed.cc @@ -0,0 +1,612 @@ +#include "selfdrive/modeld/thneed/thneed.h" + +#include +#include + +#include +#include +#include +#include +#include + +#include "selfdrive/common/clutil.h" +#include "selfdrive/common/timing.h" +//#define RUN_DISASSEMBLER +#define RUN_OPTIMIZER + +Thneed *g_thneed = NULL; +int g_fd = -1; +map, string> g_args; +map, int> g_args_size; +map g_program_source; + +void hexdump(uint8_t *d, int len) { + assert((len%4) == 0); + printf(" dumping %p len 0x%x\n", d, len); + for (int i = 0; i < len/4; i++) { + if (i != 0 && (i%0x10) == 0) printf("\n"); + printf("%8x ", d[i]); + } + printf("\n"); +} + +// *********** ioctl interceptor *********** + +extern "C" { + +int (*my_ioctl)(int filedes, unsigned long request, void *argp) = NULL; +#undef ioctl +int ioctl(int filedes, unsigned long request, void *argp) { + request &= 0xFFFFFFFF; // needed on QCOM2 + if (my_ioctl == NULL) my_ioctl = reinterpret_cast(dlsym(RTLD_NEXT, "ioctl")); + Thneed *thneed = g_thneed; + + // save the fd + if (request == IOCTL_KGSL_GPUOBJ_ALLOC) g_fd = filedes; + + // note that this runs always, even without a thneed object + if (request == IOCTL_KGSL_DRAWCTXT_CREATE) { + struct kgsl_drawctxt_create *create = (struct kgsl_drawctxt_create *)argp; + create->flags &= ~KGSL_CONTEXT_PRIORITY_MASK; + create->flags |= 1 << KGSL_CONTEXT_PRIORITY_SHIFT; // priority from 1-15, 1 is max priority + printf("IOCTL_KGSL_DRAWCTXT_CREATE: creating context with flags 0x%x\n", create->flags); + } + + if (thneed != NULL) { + if (request == IOCTL_KGSL_GPU_COMMAND) { + struct kgsl_gpu_command *cmd = (struct kgsl_gpu_command *)argp; + if (thneed->record & THNEED_RECORD) { + thneed->timestamp = cmd->timestamp; + thneed->context_id = cmd->context_id; + thneed->cmds.push_back(unique_ptr(new CachedCommand(thneed, cmd))); + } + if (thneed->record & THNEED_DEBUG) { + printf("IOCTL_KGSL_GPU_COMMAND(%2zu): flags: 0x%lx context_id: %u timestamp: %u numcmds: %d numobjs: %d\n", + thneed->cmds.size(), + cmd->flags, + cmd->context_id, cmd->timestamp, cmd->numcmds, cmd->numobjs); + } + } else if (request == IOCTL_KGSL_GPUOBJ_SYNC) { + struct kgsl_gpuobj_sync *cmd = (struct kgsl_gpuobj_sync *)argp; + struct kgsl_gpuobj_sync_obj *objs = (struct kgsl_gpuobj_sync_obj *)(cmd->objs); + + if (thneed->record & THNEED_DEBUG) { + printf("IOCTL_KGSL_GPUOBJ_SYNC count:%d ", cmd->count); + for (int i = 0; i < cmd->count; i++) { + printf(" -- offset:0x%lx len:0x%lx id:%d op:%d ", objs[i].offset, objs[i].length, objs[i].id, objs[i].op); + } + printf("\n"); + } + + if (thneed->record & THNEED_RECORD) { + thneed->cmds.push_back(unique_ptr(new + CachedSync(thneed, string((char *)objs, sizeof(struct kgsl_gpuobj_sync_obj)*cmd->count)))); + } + } else if (request == IOCTL_KGSL_DEVICE_WAITTIMESTAMP_CTXTID) { + struct kgsl_device_waittimestamp_ctxtid *cmd = (struct kgsl_device_waittimestamp_ctxtid *)argp; + if (thneed->record & THNEED_DEBUG) { + printf("IOCTL_KGSL_DEVICE_WAITTIMESTAMP_CTXTID: context_id: %d timestamp: %d timeout: %d\n", + cmd->context_id, cmd->timestamp, cmd->timeout); + } + } else if (request == IOCTL_KGSL_SETPROPERTY) { + if (thneed->record & THNEED_DEBUG) { + struct kgsl_device_getproperty *prop = (struct kgsl_device_getproperty *)argp; + printf("IOCTL_KGSL_SETPROPERTY: 0x%x sizebytes:%zu\n", prop->type, prop->sizebytes); + if (thneed->record & THNEED_VERBOSE_DEBUG) { + hexdump((uint8_t *)prop->value, prop->sizebytes); + if (prop->type == KGSL_PROP_PWR_CONSTRAINT) { + struct kgsl_device_constraint *constraint = (struct kgsl_device_constraint *)prop->value; + hexdump((uint8_t *)constraint->data, constraint->size); + } + } + } + } else if (request == IOCTL_KGSL_DRAWCTXT_CREATE || request == IOCTL_KGSL_DRAWCTXT_DESTROY) { + // this happens + } else if (request == IOCTL_KGSL_GPUOBJ_ALLOC || request == IOCTL_KGSL_GPUOBJ_FREE) { + // this happens + } else { + if (thneed->record & THNEED_DEBUG) { + printf("other ioctl %lx\n", request); + } + } + } + + int ret = my_ioctl(filedes, request, argp); + if (ret != 0) printf("ioctl returned %d with errno %d\n", ret, errno); + return ret; +} + +} + +// *********** GPUMalloc *********** + +GPUMalloc::GPUMalloc(int size, int fd) { + struct kgsl_gpuobj_alloc alloc; + memset(&alloc, 0, sizeof(alloc)); + alloc.size = size; + alloc.flags = 0x10000a00; + ioctl(fd, IOCTL_KGSL_GPUOBJ_ALLOC, &alloc); + void *addr = mmap64(NULL, alloc.mmapsize, 0x3, 0x1, fd, alloc.id*0x1000); + assert(addr != MAP_FAILED); + + base = (uint64_t)addr; + remaining = size; +} + +GPUMalloc::~GPUMalloc() { + // TODO: free the GPU malloced area +} + +void *GPUMalloc::alloc(int size) { + void *ret = (void*)base; + size = (size+0xff) & (~0xFF); + assert(size <= remaining); + remaining -= size; + base += size; + return ret; +} + +// *********** CachedSync, at the ioctl layer *********** + +void CachedSync::exec() { + struct kgsl_gpuobj_sync cmd; + + cmd.objs = (uint64_t)data.data(); + cmd.obj_len = data.length(); + cmd.count = data.length() / sizeof(struct kgsl_gpuobj_sync_obj); + + int ret = ioctl(thneed->fd, IOCTL_KGSL_GPUOBJ_SYNC, &cmd); + assert(ret == 0); +} + +// *********** CachedCommand, at the ioctl layer *********** + +CachedCommand::CachedCommand(Thneed *lthneed, struct kgsl_gpu_command *cmd) { + thneed = lthneed; + assert(cmd->numsyncs == 0); + + memcpy(&cache, cmd, sizeof(cache)); + + if (cmd->numcmds > 0) { + cmds = make_unique(cmd->numcmds); + memcpy(cmds.get(), (void *)cmd->cmdlist, sizeof(struct kgsl_command_object)*cmd->numcmds); + cache.cmdlist = (uint64_t)cmds.get(); + for (int i = 0; i < cmd->numcmds; i++) { + void *nn = thneed->ram->alloc(cmds[i].size); + memcpy(nn, (void*)cmds[i].gpuaddr, cmds[i].size); + cmds[i].gpuaddr = (uint64_t)nn; + } + } + + if (cmd->numobjs > 0) { + objs = make_unique(cmd->numobjs); + memcpy(objs.get(), (void *)cmd->objlist, sizeof(struct kgsl_command_object)*cmd->numobjs); + cache.objlist = (uint64_t)objs.get(); + for (int i = 0; i < cmd->numobjs; i++) { + void *nn = thneed->ram->alloc(objs[i].size); + memset(nn, 0, objs[i].size); + objs[i].gpuaddr = (uint64_t)nn; + } + } + + kq = thneed->ckq; + thneed->ckq.clear(); +} + +void CachedCommand::exec() { + cache.timestamp = ++thneed->timestamp; + int ret = ioctl(thneed->fd, IOCTL_KGSL_GPU_COMMAND, &cache); + + if (thneed->record & THNEED_DEBUG) printf("CachedCommand::exec got %d\n", ret); + + if (thneed->record & THNEED_VERBOSE_DEBUG) { + for (auto &it : kq) { + it->debug_print(false); + } + #ifdef RUN_DISASSEMBLER + // assuming 2 commands + disassemble(0); + disassemble(1); + #endif + } + + assert(ret == 0); +} + +// *********** Thneed *********** + +Thneed::Thneed(bool do_clinit) { + if (do_clinit) clinit(); + assert(g_fd != -1); + fd = g_fd; + ram = make_unique(0x80000, fd); + record = THNEED_RECORD; + timestamp = -1; + g_thneed = this; +} + +void Thneed::stop() { + find_inputs_outputs(); + printf("Thneed::stop: recorded %lu commands\n", cmds.size()); + record = 0; +} + +void Thneed::find_inputs_outputs() { + cl_int err; + if (inputs.size() > 0) return; + + // save the global inputs/outputs + for (auto &k : kq) { + for (int i = 0; i < k->num_args; i++) { + if (k->name == "zero_pad_image_float" && k->arg_names[i] == "input") { + cl_mem aa = *(cl_mem*)(k->args[i].data()); + input_clmem.push_back(aa); + + size_t sz; + clGetMemObjectInfo(aa, CL_MEM_SIZE, sizeof(sz), &sz, NULL); + input_sizes.push_back(sz); + + void *ret = clEnqueueMapBuffer(command_queue, aa, CL_TRUE, CL_MAP_WRITE, 0, sz, 0, NULL, NULL, &err); + assert(err == CL_SUCCESS); + inputs.push_back(ret); + } + + if (k->name == "image2d_to_buffer_float" && k->arg_names[i] == "output") { + output = *(cl_mem*)(k->args[i].data()); + } + } + } +} + +void Thneed::copy_inputs(float **finputs) { + //cl_int ret; + for (int idx = 0; idx < inputs.size(); ++idx) { + if (record & THNEED_DEBUG) printf("copying %lu -- %p -> %p\n", input_sizes[idx], finputs[idx], inputs[idx]); + if (finputs[idx] != NULL) memcpy(inputs[idx], finputs[idx], input_sizes[idx]); + } +} + +void Thneed::copy_output(float *foutput) { + if (output != NULL) { + size_t sz; + clGetMemObjectInfo(output, CL_MEM_SIZE, sizeof(sz), &sz, NULL); + if (record & THNEED_DEBUG) printf("copying %lu for output %p -> %p\n", sz, output, foutput); + clEnqueueReadBuffer(command_queue, output, CL_TRUE, 0, sz, foutput, 0, NULL, NULL); + } else { + printf("CAUTION: model output is NULL, does it have no outputs?\n"); + } +} + +void Thneed::wait() { + struct kgsl_device_waittimestamp_ctxtid wait; + wait.context_id = context_id; + wait.timestamp = timestamp; + wait.timeout = -1; + + uint64_t tb = nanos_since_boot(); + int wret = ioctl(fd, IOCTL_KGSL_DEVICE_WAITTIMESTAMP_CTXTID, &wait); + uint64_t te = nanos_since_boot(); + + if (record & THNEED_DEBUG) printf("wait %d after %lu us\n", wret, (te-tb)/1000); +} + +void Thneed::execute(float **finputs, float *foutput, bool slow) { + uint64_t tb, te; + if (record & THNEED_DEBUG) tb = nanos_since_boot(); + + // ****** copy inputs + copy_inputs(finputs); + + // ****** set power constraint + int ret; + struct kgsl_device_constraint_pwrlevel pwrlevel; + pwrlevel.level = KGSL_CONSTRAINT_PWR_MAX; + + struct kgsl_device_constraint constraint; + constraint.type = KGSL_CONSTRAINT_PWRLEVEL; + constraint.context_id = context_id; + constraint.data = (void*)&pwrlevel; + constraint.size = sizeof(pwrlevel); + + struct kgsl_device_getproperty prop; + prop.type = KGSL_PROP_PWR_CONSTRAINT; + prop.value = (void*)&constraint; + prop.sizebytes = sizeof(constraint); + ret = ioctl(fd, IOCTL_KGSL_SETPROPERTY, &prop); + assert(ret == 0); + + // ****** run commands + int i = 0; + for (auto &it : cmds) { + ++i; + if (record & THNEED_DEBUG) printf("run %2d @ %7lu us: ", i, (nanos_since_boot()-tb)/1000); + it->exec(); + if ((i == cmds.size()) || slow) wait(); + } + + // ****** copy outputs + copy_output(foutput); + + // ****** unset power constraint + constraint.type = KGSL_CONSTRAINT_NONE; + constraint.data = NULL; + constraint.size = 0; + + ret = ioctl(fd, IOCTL_KGSL_SETPROPERTY, &prop); + assert(ret == 0); + + if (record & THNEED_DEBUG) { + te = nanos_since_boot(); + printf("model exec in %lu us\n", (te-tb)/1000); + } +} + +void Thneed::clinit() { + device_id = cl_get_device_id(CL_DEVICE_TYPE_DEFAULT); + context = CL_CHECK_ERR(clCreateContext(NULL, 1, &device_id, NULL, NULL, &err)); + //cl_command_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0}; + cl_command_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0}; + command_queue = CL_CHECK_ERR(clCreateCommandQueueWithProperties(context, device_id, props, &err)); + printf("Thneed::clinit done\n"); +} + +cl_int Thneed::clexec() { + printf("Thneed::clexec: running %lu queued kernels\n", kq.size()); + for (auto &k : kq) { + if (record & THNEED_RECORD) ckq.push_back(k); + cl_int ret = k->exec(); + assert(ret == CL_SUCCESS); + } + return clFinish(command_queue); +} + +// *********** OpenCL interceptor *********** + +cl_int thneed_clSetKernelArg(cl_kernel kernel, cl_uint arg_index, size_t arg_size, const void *arg_value) { + g_args_size[make_pair(kernel, arg_index)] = arg_size; + if (arg_value != NULL) { + g_args[make_pair(kernel, arg_index)] = string((char*)arg_value, arg_size); + } else { + g_args[make_pair(kernel, arg_index)] = string(""); + } + cl_int ret = clSetKernelArg(kernel, arg_index, arg_size, arg_value); + return ret; +} + +cl_int thneed_clEnqueueNDRangeKernel(cl_command_queue command_queue, + cl_kernel kernel, + cl_uint work_dim, + const size_t *global_work_offset, + const size_t *global_work_size, + const size_t *local_work_size, + cl_uint num_events_in_wait_list, + const cl_event *event_wait_list, + cl_event *event) { + + Thneed *thneed = g_thneed; + + // SNPE doesn't use these + assert(num_events_in_wait_list == 0); + assert(global_work_offset == NULL); + assert(event_wait_list == NULL); + + cl_int ret = 0; + if (thneed != NULL && thneed->record & THNEED_RECORD) { + if (thneed->context == NULL) { + thneed->command_queue = command_queue; + clGetKernelInfo(kernel, CL_KERNEL_CONTEXT, sizeof(thneed->context), &thneed->context, NULL); + clGetContextInfo(thneed->context, CL_CONTEXT_DEVICES, sizeof(thneed->device_id), &thneed->device_id, NULL); + } + + // if we are recording, we don't actually enqueue the kernel + thneed->kq.push_back(unique_ptr(new CLQueuedKernel(thneed, kernel, work_dim, global_work_size, local_work_size))); + *event = NULL; + } else { + ret = clEnqueueNDRangeKernel(command_queue, kernel, work_dim, + global_work_offset, global_work_size, local_work_size, + num_events_in_wait_list, event_wait_list, event); + } + + return ret; +} + +cl_int thneed_clFinish(cl_command_queue command_queue) { + Thneed *thneed = g_thneed; + + if (thneed != NULL && thneed->record & THNEED_RECORD) { + #ifdef RUN_OPTIMIZER + thneed->optimize(); + #endif + return thneed->clexec(); + } else { + return clFinish(command_queue); + } +} + +cl_program thneed_clCreateProgramWithSource(cl_context context, cl_uint count, const char **strings, const size_t *lengths, cl_int *errcode_ret) { + assert(count == 1); + cl_program ret = clCreateProgramWithSource(context, count, strings, lengths, errcode_ret); + g_program_source[ret] = strings[0]; + return ret; +} + +void *dlsym(void *handle, const char *symbol) { +#if defined(QCOM) || defined(QCOM2) + void *(*my_dlsym)(void *handle, const char *symbol) = (void *(*)(void *handle, const char *symbol))((uintptr_t)dlopen + DLSYM_OFFSET); +#else + #error "Unsupported platform for thneed" +#endif + if (memcmp("REAL_", symbol, 5) == 0) { + return my_dlsym(handle, symbol+5); + } else if (strcmp("clFinish", symbol) == 0) { + return (void*)thneed_clFinish; + } else if (strcmp("clEnqueueNDRangeKernel", symbol) == 0) { + return (void*)thneed_clEnqueueNDRangeKernel; + } else if (strcmp("clSetKernelArg", symbol) == 0) { + return (void*)thneed_clSetKernelArg; + } else if (strcmp("clCreateProgramWithSource", symbol) == 0) { + return (void*)thneed_clCreateProgramWithSource; + } else { + return my_dlsym(handle, symbol); + } +} + +// *********** CLQueuedKernel *********** + +CLQueuedKernel::CLQueuedKernel(Thneed *lthneed, + cl_kernel _kernel, + cl_uint _work_dim, + const size_t *_global_work_size, + const size_t *_local_work_size) { + thneed = lthneed; + kernel = _kernel; + work_dim = _work_dim; + assert(work_dim <= 3); + for (int i = 0; i < work_dim; i++) { + global_work_size[i] = _global_work_size[i]; + local_work_size[i] = _local_work_size[i]; + } + + char _name[0x100]; + clGetKernelInfo(kernel, CL_KERNEL_FUNCTION_NAME, sizeof(_name), _name, NULL); + name = string(_name); + clGetKernelInfo(kernel, CL_KERNEL_NUM_ARGS, sizeof(num_args), &num_args, NULL); + + // get args + for (int i = 0; i < num_args; i++) { + char arg_name[0x100]; + clGetKernelArgInfo(kernel, i, CL_KERNEL_ARG_NAME, sizeof(arg_name), arg_name, NULL); + arg_names.push_back(string(arg_name)); + clGetKernelArgInfo(kernel, i, CL_KERNEL_ARG_TYPE_NAME, sizeof(arg_name), arg_name, NULL); + arg_types.push_back(string(arg_name)); + + args.push_back(g_args[make_pair(kernel, i)]); + args_size.push_back(g_args_size[make_pair(kernel, i)]); + } + + // get program + clGetKernelInfo(kernel, CL_KERNEL_PROGRAM, sizeof(program), &program, NULL); +} + +int CLQueuedKernel::get_arg_num(const char *search_arg_name) { + for (int i = 0; i < num_args; i++) { + if (arg_names[i] == search_arg_name) return i; + } + printf("failed to find %s in %s\n", search_arg_name, name.c_str()); + assert(false); +} + +cl_int CLQueuedKernel::exec() { + if (kernel == NULL) { + kernel = clCreateKernel(program, name.c_str(), NULL); + arg_names.clear(); + arg_types.clear(); + + for (int j = 0; j < num_args; j++) { + char arg_name[0x100]; + clGetKernelArgInfo(kernel, j, CL_KERNEL_ARG_NAME, sizeof(arg_name), arg_name, NULL); + arg_names.push_back(string(arg_name)); + clGetKernelArgInfo(kernel, j, CL_KERNEL_ARG_TYPE_NAME, sizeof(arg_name), arg_name, NULL); + arg_types.push_back(string(arg_name)); + + cl_int ret; + if (args[j].size() != 0) { + assert(args[j].size() == args_size[j]); + ret = thneed_clSetKernelArg(kernel, j, args[j].size(), args[j].data()); + } else { + ret = thneed_clSetKernelArg(kernel, j, args_size[j], NULL); + } + assert(ret == CL_SUCCESS); + } + } + + if (thneed->record & THNEED_DEBUG) { + debug_print(thneed->record & THNEED_VERBOSE_DEBUG); + } + + return clEnqueueNDRangeKernel(thneed->command_queue, + kernel, work_dim, NULL, global_work_size, local_work_size, 0, NULL, NULL); +} + +uint64_t CLQueuedKernel::benchmark() { + uint64_t ret = 0; + int old_record = thneed->record; + thneed->record = 0; + clFinish(thneed->command_queue); + // TODO: benchmarking at a lower level will make this more accurate + for (int i = 0; i < 10; i++) { + uint64_t sb = nanos_since_boot(); + exec(); + clFinish(thneed->command_queue); + uint64_t et = nanos_since_boot() - sb; + if (ret == 0 || et < ret) ret = et; + } + thneed->record = old_record; + return ret; +} + +void CLQueuedKernel::debug_print(bool verbose) { + printf("%p %56s -- ", kernel, name.c_str()); + for (int i = 0; i < work_dim; i++) { + printf("%4zu ", global_work_size[i]); + } + printf(" -- "); + for (int i = 0; i < work_dim; i++) { + printf("%4zu ", local_work_size[i]); + } + printf("\n"); + + if (verbose) { + for (int i = 0; i < num_args; i++) { + string arg = args[i]; + printf(" %s %s", arg_types[i].c_str(), arg_names[i].c_str()); + void *arg_value = (void*)arg.data(); + int arg_size = arg.size(); + if (arg_size == 0) { + printf(" (size) %d", args_size[i]); + } else if (arg_size == 1) { + printf(" = %d", *((char*)arg_value)); + } else if (arg_size == 2) { + printf(" = %d", *((short*)arg_value)); + } else if (arg_size == 4) { + if (arg_types[i] == "float") { + printf(" = %f", *((float*)arg_value)); + } else { + printf(" = %d", *((int*)arg_value)); + } + } else if (arg_size == 8) { + cl_mem val = (cl_mem)(*((uintptr_t*)arg_value)); + printf(" = %p", val); + if (val != NULL) { + if (arg_types[i] == "image2d_t" || arg_types[i] == "image1d_t") { + cl_image_format format; + size_t width, height, depth, array_size, row_pitch, slice_pitch; + cl_mem buf; + clGetImageInfo(val, CL_IMAGE_FORMAT, sizeof(format), &format, NULL); + assert(format.image_channel_order == CL_RGBA); + assert(format.image_channel_data_type == CL_HALF_FLOAT); + clGetImageInfo(val, CL_IMAGE_WIDTH, sizeof(width), &width, NULL); + clGetImageInfo(val, CL_IMAGE_HEIGHT, sizeof(height), &height, NULL); + clGetImageInfo(val, CL_IMAGE_ROW_PITCH, sizeof(row_pitch), &row_pitch, NULL); + clGetImageInfo(val, CL_IMAGE_DEPTH, sizeof(depth), &depth, NULL); + clGetImageInfo(val, CL_IMAGE_ARRAY_SIZE, sizeof(array_size), &array_size, NULL); + clGetImageInfo(val, CL_IMAGE_SLICE_PITCH, sizeof(slice_pitch), &slice_pitch, NULL); + assert(depth == 0); + assert(array_size == 0); + assert(slice_pitch == 0); + + clGetImageInfo(val, CL_IMAGE_BUFFER, sizeof(buf), &buf, NULL); + size_t sz; + clGetMemObjectInfo(buf, CL_MEM_SIZE, sizeof(sz), &sz, NULL); + printf(" image %zu x %zu rp %zu @ %p buffer %zu", width, height, row_pitch, buf, sz); + } else { + size_t sz; + clGetMemObjectInfo(val, CL_MEM_SIZE, sizeof(sz), &sz, NULL); + printf(" buffer %zu", sz); + } + } + } + printf("\n"); + } + } +} diff --git a/selfdrive/modeld/thneed/thneed.h b/selfdrive/modeld/thneed/thneed.h new file mode 100644 index 000000000..1197e4c5e --- /dev/null +++ b/selfdrive/modeld/thneed/thneed.h @@ -0,0 +1,135 @@ +#pragma once + +#ifndef __user +#define __user __attribute__(()) +#endif + +#include +#include +#include +#include +#include + +#include + +#include "selfdrive/modeld/thneed/include/msm_kgsl.h" + +#define THNEED_RECORD 1 +#define THNEED_DEBUG 2 +#define THNEED_VERBOSE_DEBUG 4 + +using namespace std; + +namespace json11 { + class Json; +} +class Thneed; + +class GPUMalloc { + public: + GPUMalloc(int size, int fd); + ~GPUMalloc(); + void *alloc(int size); + private: + uint64_t base; + int remaining; +}; + +class CLQueuedKernel { + public: + CLQueuedKernel(Thneed *lthneed) { thneed = lthneed; } + CLQueuedKernel(Thneed *lthneed, + cl_kernel _kernel, + cl_uint _work_dim, + const size_t *_global_work_size, + const size_t *_local_work_size); + cl_int exec(); + uint64_t benchmark(); + void debug_print(bool verbose); + int get_arg_num(const char *search_arg_name); + cl_program program; + string name; + cl_uint num_args; + vector arg_names; + vector arg_types; + vector args; + vector args_size; + cl_kernel kernel = NULL; + json11::Json to_json() const; + + cl_uint work_dim; + size_t global_work_size[3] = {0}; + size_t local_work_size[3] = {0}; + private: + Thneed *thneed; +}; + +class CachedIoctl { + public: + virtual void exec() {} +}; + +class CachedSync: public CachedIoctl { + public: + CachedSync(Thneed *lthneed, string ldata) { thneed = lthneed; data = ldata; } + void exec(); + private: + Thneed *thneed; + string data; +}; + +class CachedCommand: public CachedIoctl { + public: + CachedCommand(Thneed *lthneed, struct kgsl_gpu_command *cmd); + void exec(); + private: + void disassemble(int cmd_index); + struct kgsl_gpu_command cache; + unique_ptr cmds; + unique_ptr objs; + Thneed *thneed; + vector > kq; +}; + +class Thneed { + public: + Thneed(bool do_clinit=false); + void stop(); + void execute(float **finputs, float *foutput, bool slow=false); + void wait(); + int optimize(); + + vector input_clmem; + vector inputs; + vector input_sizes; + cl_mem output = NULL; + + cl_context context = NULL; + cl_command_queue command_queue; + cl_device_id device_id; + int context_id; + + // protected? + int record; + int timestamp; + unique_ptr ram; + vector > cmds; + int fd; + + // all CL kernels + void find_inputs_outputs(); + void copy_inputs(float **finputs); + void copy_output(float *foutput); + cl_int clexec(); + vector > kq; + + // pending CL kernels + vector > ckq; + + // loading and saving + void load(const char *filename); + void save(const char *filename, bool save_binaries=false); + private: + void clinit(); +}; + diff --git a/selfdrive/modeld/transforms/loadyuv.cc b/selfdrive/modeld/transforms/loadyuv.cc new file mode 100644 index 000000000..39f404a89 --- /dev/null +++ b/selfdrive/modeld/transforms/loadyuv.cc @@ -0,0 +1,74 @@ +#include "selfdrive/modeld/transforms/loadyuv.h" + +#include +#include +#include + +void loadyuv_init(LoadYUVState* s, cl_context ctx, cl_device_id device_id, int width, int height) { + memset(s, 0, sizeof(*s)); + + s->width = width; + s->height = height; + + char args[1024]; + snprintf(args, sizeof(args), + "-cl-fast-relaxed-math -cl-denorms-are-zero " + "-DTRANSFORMED_WIDTH=%d -DTRANSFORMED_HEIGHT=%d", + width, height); + cl_program prg = cl_program_from_file(ctx, device_id, "transforms/loadyuv.cl", args); + + s->loadys_krnl = CL_CHECK_ERR(clCreateKernel(prg, "loadys", &err)); + s->loaduv_krnl = CL_CHECK_ERR(clCreateKernel(prg, "loaduv", &err)); + s->copy_krnl = CL_CHECK_ERR(clCreateKernel(prg, "copy", &err)); + + // done with this + CL_CHECK(clReleaseProgram(prg)); +} + +void loadyuv_destroy(LoadYUVState* s) { + CL_CHECK(clReleaseKernel(s->loadys_krnl)); + CL_CHECK(clReleaseKernel(s->loaduv_krnl)); + CL_CHECK(clReleaseKernel(s->copy_krnl)); +} + +void loadyuv_queue(LoadYUVState* s, cl_command_queue q, + cl_mem y_cl, cl_mem u_cl, cl_mem v_cl, + cl_mem out_cl, bool do_shift) { + cl_int global_out_off = 0; + if (do_shift) { + // shift the image in slot 1 to slot 0, then place the new image in slot 1 + global_out_off += (s->width*s->height) + (s->width/2)*(s->height/2)*2; + CL_CHECK(clSetKernelArg(s->copy_krnl, 0, sizeof(cl_mem), &out_cl)); + CL_CHECK(clSetKernelArg(s->copy_krnl, 1, sizeof(cl_int), &global_out_off)); + const size_t copy_work_size = global_out_off/8; + CL_CHECK(clEnqueueNDRangeKernel(q, s->copy_krnl, 1, NULL, + ©_work_size, NULL, 0, 0, NULL)); + } + + CL_CHECK(clSetKernelArg(s->loadys_krnl, 0, sizeof(cl_mem), &y_cl)); + CL_CHECK(clSetKernelArg(s->loadys_krnl, 1, sizeof(cl_mem), &out_cl)); + CL_CHECK(clSetKernelArg(s->loadys_krnl, 2, sizeof(cl_int), &global_out_off)); + + const size_t loadys_work_size = (s->width*s->height)/8; + CL_CHECK(clEnqueueNDRangeKernel(q, s->loadys_krnl, 1, NULL, + &loadys_work_size, NULL, 0, 0, NULL)); + + const size_t loaduv_work_size = ((s->width/2)*(s->height/2))/8; + global_out_off += (s->width*s->height); + + CL_CHECK(clSetKernelArg(s->loaduv_krnl, 0, sizeof(cl_mem), &u_cl)); + CL_CHECK(clSetKernelArg(s->loaduv_krnl, 1, sizeof(cl_mem), &out_cl)); + CL_CHECK(clSetKernelArg(s->loaduv_krnl, 2, sizeof(cl_int), &global_out_off)); + + CL_CHECK(clEnqueueNDRangeKernel(q, s->loaduv_krnl, 1, NULL, + &loaduv_work_size, NULL, 0, 0, NULL)); + + global_out_off += (s->width/2)*(s->height/2); + + CL_CHECK(clSetKernelArg(s->loaduv_krnl, 0, sizeof(cl_mem), &v_cl)); + CL_CHECK(clSetKernelArg(s->loaduv_krnl, 1, sizeof(cl_mem), &out_cl)); + CL_CHECK(clSetKernelArg(s->loaduv_krnl, 2, sizeof(cl_int), &global_out_off)); + + CL_CHECK(clEnqueueNDRangeKernel(q, s->loaduv_krnl, 1, NULL, + &loaduv_work_size, NULL, 0, 0, NULL)); +} diff --git a/selfdrive/modeld/transforms/loadyuv.cl b/selfdrive/modeld/transforms/loadyuv.cl new file mode 100644 index 000000000..7dd3d973a --- /dev/null +++ b/selfdrive/modeld/transforms/loadyuv.cl @@ -0,0 +1,47 @@ +#define UV_SIZE ((TRANSFORMED_WIDTH/2)*(TRANSFORMED_HEIGHT/2)) + +__kernel void loadys(__global uchar8 const * const Y, + __global float * out, + int out_offset) +{ + const int gid = get_global_id(0); + const int ois = gid * 8; + const int oy = ois / TRANSFORMED_WIDTH; + const int ox = ois % TRANSFORMED_WIDTH; + + const uchar8 ys = Y[gid]; + const float8 ysf = convert_float8(ys); + + // 02 + // 13 + + __global float* outy0; + __global float* outy1; + if ((oy & 1) == 0) { + outy0 = out + out_offset; //y0 + outy1 = out + out_offset + UV_SIZE*2; //y2 + } else { + outy0 = out + out_offset + UV_SIZE; //y1 + outy1 = out + out_offset + UV_SIZE*3; //y3 + } + + vstore4(ysf.s0246, 0, outy0 + (oy/2) * (TRANSFORMED_WIDTH/2) + ox/2); + vstore4(ysf.s1357, 0, outy1 + (oy/2) * (TRANSFORMED_WIDTH/2) + ox/2); +} + +__kernel void loaduv(__global uchar8 const * const in, + __global float8 * out, + int out_offset) +{ + const int gid = get_global_id(0); + const uchar8 inv = in[gid]; + const float8 outv = convert_float8(inv); + out[gid + out_offset / 8] = outv; +} + +__kernel void copy(__global float8 * inout, + int in_offset) +{ + const int gid = get_global_id(0); + inout[gid] = inout[gid + in_offset / 8]; +} diff --git a/selfdrive/modeld/transforms/loadyuv.h b/selfdrive/modeld/transforms/loadyuv.h new file mode 100644 index 000000000..a3161b293 --- /dev/null +++ b/selfdrive/modeld/transforms/loadyuv.h @@ -0,0 +1,16 @@ +#pragma once + +#include "selfdrive/common/clutil.h" + +typedef struct { + int width, height; + cl_kernel loadys_krnl, loaduv_krnl, copy_krnl; +} LoadYUVState; + +void loadyuv_init(LoadYUVState* s, cl_context ctx, cl_device_id device_id, int width, int height); + +void loadyuv_destroy(LoadYUVState* s); + +void loadyuv_queue(LoadYUVState* s, cl_command_queue q, + cl_mem y_cl, cl_mem u_cl, cl_mem v_cl, + cl_mem out_cl, bool do_shift = false); diff --git a/selfdrive/modeld/transforms/transform.cc b/selfdrive/modeld/transforms/transform.cc new file mode 100644 index 000000000..5f4929bab --- /dev/null +++ b/selfdrive/modeld/transforms/transform.cc @@ -0,0 +1,95 @@ +#include "selfdrive/modeld/transforms/transform.h" + +#include +#include + +#include "selfdrive/common/clutil.h" + +void transform_init(Transform* s, cl_context ctx, cl_device_id device_id) { + memset(s, 0, sizeof(*s)); + + cl_program prg = cl_program_from_file(ctx, device_id, "transforms/transform.cl", ""); + s->krnl = CL_CHECK_ERR(clCreateKernel(prg, "warpPerspective", &err)); + // done with this + CL_CHECK(clReleaseProgram(prg)); + + s->m_y_cl = CL_CHECK_ERR(clCreateBuffer(ctx, CL_MEM_READ_WRITE, 3*3*sizeof(float), NULL, &err)); + s->m_uv_cl = CL_CHECK_ERR(clCreateBuffer(ctx, CL_MEM_READ_WRITE, 3*3*sizeof(float), NULL, &err)); +} + +void transform_destroy(Transform* s) { + CL_CHECK(clReleaseMemObject(s->m_y_cl)); + CL_CHECK(clReleaseMemObject(s->m_uv_cl)); + CL_CHECK(clReleaseKernel(s->krnl)); +} + +void transform_queue(Transform* s, + cl_command_queue q, + cl_mem in_yuv, int in_width, int in_height, + cl_mem out_y, cl_mem out_u, cl_mem out_v, + int out_width, int out_height, + const mat3& projection) { + const int zero = 0; + + // sampled using pixel center origin + // (because thats how fastcv and opencv does it) + + mat3 projection_y = projection; + + // in and out uv is half the size of y. + mat3 projection_uv = transform_scale_buffer(projection, 0.5); + + CL_CHECK(clEnqueueWriteBuffer(q, s->m_y_cl, CL_TRUE, 0, 3*3*sizeof(float), (void*)projection_y.v, 0, NULL, NULL)); + CL_CHECK(clEnqueueWriteBuffer(q, s->m_uv_cl, CL_TRUE, 0, 3*3*sizeof(float), (void*)projection_uv.v, 0, NULL, NULL)); + + const int in_y_width = in_width; + const int in_y_height = in_height; + const int in_uv_width = in_width/2; + const int in_uv_height = in_height/2; + const int in_y_offset = 0; + const int in_u_offset = in_y_offset + in_y_width*in_y_height; + const int in_v_offset = in_u_offset + in_uv_width*in_uv_height; + + const int out_y_width = out_width; + const int out_y_height = out_height; + const int out_uv_width = out_width/2; + const int out_uv_height = out_height/2; + + CL_CHECK(clSetKernelArg(s->krnl, 0, sizeof(cl_mem), &in_yuv)); + CL_CHECK(clSetKernelArg(s->krnl, 1, sizeof(cl_int), &in_y_width)); + CL_CHECK(clSetKernelArg(s->krnl, 2, sizeof(cl_int), &in_y_offset)); + CL_CHECK(clSetKernelArg(s->krnl, 3, sizeof(cl_int), &in_y_height)); + CL_CHECK(clSetKernelArg(s->krnl, 4, sizeof(cl_int), &in_y_width)); + CL_CHECK(clSetKernelArg(s->krnl, 5, sizeof(cl_mem), &out_y)); + CL_CHECK(clSetKernelArg(s->krnl, 6, sizeof(cl_int), &out_y_width)); + CL_CHECK(clSetKernelArg(s->krnl, 7, sizeof(cl_int), &zero)); + CL_CHECK(clSetKernelArg(s->krnl, 8, sizeof(cl_int), &out_y_height)); + CL_CHECK(clSetKernelArg(s->krnl, 9, sizeof(cl_int), &out_y_width)); + CL_CHECK(clSetKernelArg(s->krnl, 10, sizeof(cl_mem), &s->m_y_cl)); + + const size_t work_size_y[2] = {(size_t)out_y_width, (size_t)out_y_height}; + + CL_CHECK(clEnqueueNDRangeKernel(q, s->krnl, 2, NULL, + (const size_t*)&work_size_y, NULL, 0, 0, NULL)); + + const size_t work_size_uv[2] = {(size_t)out_uv_width, (size_t)out_uv_height}; + + CL_CHECK(clSetKernelArg(s->krnl, 1, sizeof(cl_int), &in_uv_width)); + CL_CHECK(clSetKernelArg(s->krnl, 2, sizeof(cl_int), &in_u_offset)); + CL_CHECK(clSetKernelArg(s->krnl, 3, sizeof(cl_int), &in_uv_height)); + CL_CHECK(clSetKernelArg(s->krnl, 4, sizeof(cl_int), &in_uv_width)); + CL_CHECK(clSetKernelArg(s->krnl, 5, sizeof(cl_mem), &out_u)); + CL_CHECK(clSetKernelArg(s->krnl, 6, sizeof(cl_int), &out_uv_width)); + CL_CHECK(clSetKernelArg(s->krnl, 7, sizeof(cl_int), &zero)); + CL_CHECK(clSetKernelArg(s->krnl, 8, sizeof(cl_int), &out_uv_height)); + CL_CHECK(clSetKernelArg(s->krnl, 9, sizeof(cl_int), &out_uv_width)); + CL_CHECK(clSetKernelArg(s->krnl, 10, sizeof(cl_mem), &s->m_uv_cl)); + + CL_CHECK(clEnqueueNDRangeKernel(q, s->krnl, 2, NULL, + (const size_t*)&work_size_uv, NULL, 0, 0, NULL)); + CL_CHECK(clSetKernelArg(s->krnl, 2, sizeof(cl_int), &in_v_offset)); + CL_CHECK(clSetKernelArg(s->krnl, 5, sizeof(cl_mem), &out_v)); + + CL_CHECK(clEnqueueNDRangeKernel(q, s->krnl, 2, NULL, + (const size_t*)&work_size_uv, NULL, 0, 0, NULL)); +} diff --git a/selfdrive/modeld/transforms/transform.cl b/selfdrive/modeld/transforms/transform.cl new file mode 100644 index 000000000..8ad186935 --- /dev/null +++ b/selfdrive/modeld/transforms/transform.cl @@ -0,0 +1,54 @@ +#define INTER_BITS 5 +#define INTER_TAB_SIZE (1 << INTER_BITS) +#define INTER_SCALE 1.f / INTER_TAB_SIZE + +#define INTER_REMAP_COEF_BITS 15 +#define INTER_REMAP_COEF_SCALE (1 << INTER_REMAP_COEF_BITS) + +__kernel void warpPerspective(__global const uchar * src, + int src_step, int src_offset, int src_rows, int src_cols, + __global uchar * dst, + int dst_step, int dst_offset, int dst_rows, int dst_cols, + __constant float * M) +{ + int dx = get_global_id(0); + int dy = get_global_id(1); + + if (dx < dst_cols && dy < dst_rows) + { + float X0 = M[0] * dx + M[1] * dy + M[2]; + float Y0 = M[3] * dx + M[4] * dy + M[5]; + float W = M[6] * dx + M[7] * dy + M[8]; + W = W != 0.0f ? INTER_TAB_SIZE / W : 0.0f; + int X = rint(X0 * W), Y = rint(Y0 * W); + + short sx = convert_short_sat(X >> INTER_BITS); + short sy = convert_short_sat(Y >> INTER_BITS); + short ay = (short)(Y & (INTER_TAB_SIZE - 1)); + short ax = (short)(X & (INTER_TAB_SIZE - 1)); + + int v0 = (sx >= 0 && sx < src_cols && sy >= 0 && sy < src_rows) ? + convert_int(src[mad24(sy, src_step, src_offset + sx)]) : 0; + int v1 = (sx+1 >= 0 && sx+1 < src_cols && sy >= 0 && sy < src_rows) ? + convert_int(src[mad24(sy, src_step, src_offset + (sx+1))]) : 0; + int v2 = (sx >= 0 && sx < src_cols && sy+1 >= 0 && sy+1 < src_rows) ? + convert_int(src[mad24(sy+1, src_step, src_offset + sx)]) : 0; + int v3 = (sx+1 >= 0 && sx+1 < src_cols && sy+1 >= 0 && sy+1 < src_rows) ? + convert_int(src[mad24(sy+1, src_step, src_offset + (sx+1))]) : 0; + + float taby = 1.f/INTER_TAB_SIZE*ay; + float tabx = 1.f/INTER_TAB_SIZE*ax; + + int dst_index = mad24(dy, dst_step, dst_offset + dx); + + int itab0 = convert_short_sat_rte( (1.0f-taby)*(1.0f-tabx) * INTER_REMAP_COEF_SCALE ); + int itab1 = convert_short_sat_rte( (1.0f-taby)*tabx * INTER_REMAP_COEF_SCALE ); + int itab2 = convert_short_sat_rte( taby*(1.0f-tabx) * INTER_REMAP_COEF_SCALE ); + int itab3 = convert_short_sat_rte( taby*tabx * INTER_REMAP_COEF_SCALE ); + + int val = v0 * itab0 + v1 * itab1 + v2 * itab2 + v3 * itab3; + + uchar pix = convert_uchar_sat((val + (1 << (INTER_REMAP_COEF_BITS-1))) >> INTER_REMAP_COEF_BITS); + dst[dst_index] = pix; + } +} diff --git a/selfdrive/modeld/transforms/transform.h b/selfdrive/modeld/transforms/transform.h new file mode 100644 index 000000000..f34613684 --- /dev/null +++ b/selfdrive/modeld/transforms/transform.h @@ -0,0 +1,25 @@ +#pragma once + +#define CL_USE_DEPRECATED_OPENCL_1_2_APIS +#ifdef __APPLE__ +#include +#else +#include +#endif + +#include "selfdrive/common/mat.h" + +typedef struct { + cl_kernel krnl; + cl_mem m_y_cl, m_uv_cl; +} Transform; + +void transform_init(Transform* s, cl_context ctx, cl_device_id device_id); + +void transform_destroy(Transform* transform); + +void transform_queue(Transform* s, cl_command_queue q, + cl_mem yuv, int in_width, int in_height, + cl_mem out_y, cl_mem out_u, cl_mem out_v, + int out_width, int out_height, + const mat3& projection); diff --git a/selfdrive/monitoring/dmonitoringd.py b/selfdrive/monitoring/dmonitoringd.py new file mode 100755 index 000000000..f1b0c42bd --- /dev/null +++ b/selfdrive/monitoring/dmonitoringd.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python3 +import gc + +import cereal.messaging as messaging +from cereal import car +from common.params import Params +from common.realtime import set_realtime_priority +from selfdrive.controls.lib.events import Events +from selfdrive.locationd.calibrationd import Calibration +from selfdrive.monitoring.driver_monitor import DriverStatus + + +def dmonitoringd_thread(sm=None, pm=None): + gc.disable() + set_realtime_priority(2) + + if pm is None: + pm = messaging.PubMaster(['driverMonitoringState']) + + if sm is None: + sm = messaging.SubMaster(['driverState', 'liveCalibration', 'carState', 'controlsState', 'modelV2'], poll=['driverState']) + + driver_status = DriverStatus(rhd=Params().get_bool("IsRHD")) + + sm['liveCalibration'].calStatus = Calibration.INVALID + sm['liveCalibration'].rpyCalib = [0, 0, 0] + sm['carState'].buttonEvents = [] + sm['carState'].standstill = True + + v_cruise_last = 0 + driver_engaged = False + + # 10Hz <- dmonitoringmodeld + while True: + sm.update() + + if not sm.updated['driverState']: + continue + + # Get interaction + if sm.updated['carState']: + v_cruise = sm['carState'].cruiseState.speed + driver_engaged = len(sm['carState'].buttonEvents) > 0 or \ + v_cruise != v_cruise_last or \ + sm['carState'].steeringPressed or \ + sm['carState'].gasPressed + v_cruise_last = v_cruise + + if sm.updated['modelV2']: + driver_status.set_policy(sm['modelV2'], sm['carState'].vEgo) + + # Get data from dmonitoringmodeld + events = Events() + driver_status.get_pose(sm['driverState'], sm['liveCalibration'].rpyCalib, sm['carState'].vEgo, sm['controlsState'].enabled) + + # Block engaging after max number of distrations + if driver_status.terminal_alert_cnt >= driver_status.settings._MAX_TERMINAL_ALERTS or \ + driver_status.terminal_time >= driver_status.settings._MAX_TERMINAL_DURATION: + events.add(car.CarEvent.EventName.tooDistracted) + + # Update events from driver state + driver_status.update(events, driver_engaged, sm['controlsState'].enabled, sm['carState'].standstill) + + # build driverMonitoringState packet + dat = messaging.new_message('driverMonitoringState') + dat.driverMonitoringState = { + "events": events.to_msg(), + "faceDetected": driver_status.face_detected, + "isDistracted": driver_status.driver_distracted, + "awarenessStatus": driver_status.awareness, + "posePitchOffset": driver_status.pose.pitch_offseter.filtered_stat.mean(), + "posePitchValidCount": driver_status.pose.pitch_offseter.filtered_stat.n, + "poseYawOffset": driver_status.pose.yaw_offseter.filtered_stat.mean(), + "poseYawValidCount": driver_status.pose.yaw_offseter.filtered_stat.n, + "stepChange": driver_status.step_change, + "awarenessActive": driver_status.awareness_active, + "awarenessPassive": driver_status.awareness_passive, + "isLowStd": driver_status.pose.low_std, + "hiStdCount": driver_status.hi_stds, + "isActiveMode": driver_status.active_monitoring_mode, + } + pm.send('driverMonitoringState', dat) + + +def main(sm=None, pm=None): + dmonitoringd_thread(sm, pm) + + +if __name__ == '__main__': + main() diff --git a/selfdrive/monitoring/driver_monitor.py b/selfdrive/monitoring/driver_monitor.py new file mode 100644 index 000000000..efb00ecb7 --- /dev/null +++ b/selfdrive/monitoring/driver_monitor.py @@ -0,0 +1,286 @@ +from math import atan2 + +from cereal import car +from common.numpy_fast import interp +from common.realtime import DT_DMON +from selfdrive.hardware import TICI +from common.filter_simple import FirstOrderFilter +from common.stat_live import RunningStatFilter + +EventName = car.CarEvent.EventName + +# ****************************************************************************************** +# NOTE: To fork maintainers. +# Disabling or nerfing safety features will get you and your users banned from our servers. +# We recommend that you do not change these numbers from the defaults. +# ****************************************************************************************** + +class DRIVER_MONITOR_SETTINGS(): + def __init__(self, TICI=TICI, DT_DMON=DT_DMON): + self._DT_DMON = DT_DMON + self._AWARENESS_TIME = 35. # passive wheeltouch total timeout + self._AWARENESS_PRE_TIME_TILL_TERMINAL = 12. + self._AWARENESS_PROMPT_TIME_TILL_TERMINAL = 6. + self._DISTRACTED_TIME = 11. # active monitoring total timeout + self._DISTRACTED_PRE_TIME_TILL_TERMINAL = 8. + self._DISTRACTED_PROMPT_TIME_TILL_TERMINAL = 6. + + self._FACE_THRESHOLD = 0.5 + self._PARTIAL_FACE_THRESHOLD = 0.765 if TICI else 0.43 + self._EYE_THRESHOLD = 0.61 if TICI else 0.55 + self._SG_THRESHOLD = 0.89 if TICI else 0.86 + self._BLINK_THRESHOLD = 0.82 if TICI else 0.588 + self._BLINK_THRESHOLD_SLACK = 0.9 if TICI else 0.77 + self._BLINK_THRESHOLD_STRICT = self._BLINK_THRESHOLD + + self._POSE_PITCH_THRESHOLD = 0.3237 + self._POSE_PITCH_THRESHOLD_SLACK = 0.3657 + self._POSE_PITCH_THRESHOLD_STRICT = self._POSE_PITCH_THRESHOLD + self._POSE_YAW_THRESHOLD = 0.3109 + self._POSE_YAW_THRESHOLD_SLACK = 0.4294 + self._POSE_YAW_THRESHOLD_STRICT = self._POSE_YAW_THRESHOLD + self._PITCH_NATURAL_OFFSET = 0.057 # initial value before offset is learned + self._YAW_NATURAL_OFFSET = 0.11 # initial value before offset is learned + self._PITCH_MAX_OFFSET = 0.124 + self._PITCH_MIN_OFFSET = -0.0881 + self._YAW_MAX_OFFSET = 0.289 + self._YAW_MIN_OFFSET = -0.0246 + + self._POSESTD_THRESHOLD = 0.38 if TICI else 0.3 + self._HI_STD_FALLBACK_TIME = int(10 / self._DT_DMON) # fall back to wheel touch if model is uncertain for 10s + self._DISTRACTED_FILTER_TS = 0.25 # 0.6Hz + + self._POSE_CALIB_MIN_SPEED = 13 # 30 mph + self._POSE_OFFSET_MIN_COUNT = int(60 / self._DT_DMON) # valid data counts before calibration completes, 1min cumulative + self._POSE_OFFSET_MAX_COUNT = int(360 / self._DT_DMON) # stop deweighting new data after 6 min, aka "short term memory" + + self._RECOVERY_FACTOR_MAX = 5. # relative to minus step change + self._RECOVERY_FACTOR_MIN = 1.25 # relative to minus step change + + self._MAX_TERMINAL_ALERTS = 3 # not allowed to engage after 3 terminal alerts + self._MAX_TERMINAL_DURATION = int(30 / self._DT_DMON) # not allowed to engage after 30s of terminal alerts + + +# model output refers to center of cropped image, so need to apply the x displacement offset +RESIZED_FOCAL = 320.0 +H, W, FULL_W = 320, 160, 426 + +class DistractedType: + NOT_DISTRACTED = 0 + BAD_POSE = 1 + BAD_BLINK = 2 + +def face_orientation_from_net(angles_desc, pos_desc, rpy_calib, is_rhd): + # the output of these angles are in device frame + # so from driver's perspective, pitch is up and yaw is right + + pitch_net, yaw_net, roll_net = angles_desc + + face_pixel_position = ((pos_desc[0] + .5)*W - W + FULL_W, (pos_desc[1]+.5)*H) + yaw_focal_angle = atan2(face_pixel_position[0] - FULL_W//2, RESIZED_FOCAL) + pitch_focal_angle = atan2(face_pixel_position[1] - H//2, RESIZED_FOCAL) + + pitch = pitch_net + pitch_focal_angle + yaw = -yaw_net + yaw_focal_angle + + # no calib for roll + pitch -= rpy_calib[1] + yaw -= rpy_calib[2] * (1 - 2 * int(is_rhd)) # lhd -> -=, rhd -> += + return roll_net, pitch, yaw + +class DriverPose(): + def __init__(self, max_trackable): + self.yaw = 0. + self.pitch = 0. + self.roll = 0. + self.yaw_std = 0. + self.pitch_std = 0. + self.roll_std = 0. + self.pitch_offseter = RunningStatFilter(max_trackable=max_trackable) + self.yaw_offseter = RunningStatFilter(max_trackable=max_trackable) + self.low_std = True + self.cfactor_pitch = 1. + self.cfactor_yaw = 1. + +class DriverBlink(): + def __init__(self): + self.left_blink = 0. + self.right_blink = 0. + self.cfactor = 1. + +class DriverStatus(): + def __init__(self, rhd=False, settings=DRIVER_MONITOR_SETTINGS()): + # init policy settings + self.settings = settings + + # init driver status + self.is_rhd_region = rhd + self.pose = DriverPose(self.settings._POSE_OFFSET_MAX_COUNT) + self.pose_calibrated = False + self.blink = DriverBlink() + self.awareness = 1. + self.awareness_active = 1. + self.awareness_passive = 1. + self.driver_distracted = False + self.driver_distraction_filter = FirstOrderFilter(0., self.settings._DISTRACTED_FILTER_TS, self.settings._DT_DMON) + self.face_detected = False + self.face_partial = False + self.terminal_alert_cnt = 0 + self.terminal_time = 0 + self.step_change = 0. + self.active_monitoring_mode = True + self.is_model_uncertain = False + self.hi_stds = 0 + self.threshold_pre = self.settings._DISTRACTED_PRE_TIME_TILL_TERMINAL / self.settings._DISTRACTED_TIME + self.threshold_prompt = self.settings._DISTRACTED_PROMPT_TIME_TILL_TERMINAL / self.settings._DISTRACTED_TIME + + self._set_timers(active_monitoring=True) + + def _set_timers(self, active_monitoring): + if self.active_monitoring_mode and self.awareness <= self.threshold_prompt: + if active_monitoring: + self.step_change = self.settings._DT_DMON / self.settings._DISTRACTED_TIME + else: + self.step_change = 0. + return # no exploit after orange alert + elif self.awareness <= 0.: + return + + if active_monitoring: + # when falling back from passive mode to active mode, reset awareness to avoid false alert + if not self.active_monitoring_mode: + self.awareness_passive = self.awareness + self.awareness = self.awareness_active + + self.threshold_pre = self.settings._DISTRACTED_PRE_TIME_TILL_TERMINAL / self.settings._DISTRACTED_TIME + self.threshold_prompt = self.settings._DISTRACTED_PROMPT_TIME_TILL_TERMINAL / self.settings._DISTRACTED_TIME + self.step_change = self.settings._DT_DMON / self.settings._DISTRACTED_TIME + self.active_monitoring_mode = True + else: + if self.active_monitoring_mode: + self.awareness_active = self.awareness + self.awareness = self.awareness_passive + + self.threshold_pre = self.settings._AWARENESS_PRE_TIME_TILL_TERMINAL / self.settings._AWARENESS_TIME + self.threshold_prompt = self.settings._AWARENESS_PROMPT_TIME_TILL_TERMINAL / self.settings._AWARENESS_TIME + self.step_change = self.settings._DT_DMON / self.settings._AWARENESS_TIME + self.active_monitoring_mode = False + + def _is_driver_distracted(self, pose, blink): + if not self.pose_calibrated: + pitch_error = pose.pitch - self.settings._PITCH_NATURAL_OFFSET + yaw_error = pose.yaw - self.settings._YAW_NATURAL_OFFSET + else: + pitch_error = pose.pitch - min(max(self.pose.pitch_offseter.filtered_stat.mean(), + self.settings._PITCH_MIN_OFFSET), self.settings._PITCH_MAX_OFFSET) + yaw_error = pose.yaw - min(max(self.pose.yaw_offseter.filtered_stat.mean(), + self.settings._YAW_MIN_OFFSET), self.settings._YAW_MAX_OFFSET) + + pitch_error = 0 if pitch_error > 0 else abs(pitch_error) # no positive pitch limit + yaw_error = abs(yaw_error) + + if pitch_error > self.settings._POSE_PITCH_THRESHOLD*pose.cfactor_pitch or \ + yaw_error > self.settings._POSE_YAW_THRESHOLD*pose.cfactor_yaw: + return DistractedType.BAD_POSE + elif (blink.left_blink + blink.right_blink)*0.5 > self.settings._BLINK_THRESHOLD*blink.cfactor: + return DistractedType.BAD_BLINK + else: + return DistractedType.NOT_DISTRACTED + + def set_policy(self, model_data, car_speed): + ep = min(model_data.meta.engagedProb, 0.8) / 0.8 # engaged prob + bp = model_data.meta.disengagePredictions.brakeDisengageProbs[0] # brake disengage prob in next 2s + # TODO: retune adaptive blink + self.blink.cfactor = interp(ep, [0, 0.5, 1], + [self.settings._BLINK_THRESHOLD_STRICT, + self.settings._BLINK_THRESHOLD, + self.settings._BLINK_THRESHOLD_SLACK]) / self.settings._BLINK_THRESHOLD + k1 = max(-0.00156*((car_speed-16)**2)+0.6, 0.2) + bp_normal = max(min(bp / k1, 0.5),0) + self.pose.cfactor_pitch = interp(bp_normal, [0, 0.5], + [self.settings._POSE_PITCH_THRESHOLD_SLACK, + self.settings._POSE_PITCH_THRESHOLD_STRICT]) / self.settings._POSE_PITCH_THRESHOLD + self.pose.cfactor_yaw = interp(bp_normal, [0, 0.5], + [self.settings._POSE_YAW_THRESHOLD_SLACK, + self.settings._POSE_YAW_THRESHOLD_STRICT]) / self.settings._POSE_YAW_THRESHOLD + + def get_pose(self, driver_state, cal_rpy, car_speed, op_engaged): + if not all(len(x) > 0 for x in (driver_state.faceOrientation, driver_state.facePosition, + driver_state.faceOrientationStd, driver_state.facePositionStd)): + return + + self.face_partial = driver_state.partialFace > self.settings._PARTIAL_FACE_THRESHOLD + self.face_detected = driver_state.faceProb > self.settings._FACE_THRESHOLD or self.face_partial + self.pose.roll, self.pose.pitch, self.pose.yaw = face_orientation_from_net(driver_state.faceOrientation, driver_state.facePosition, cal_rpy, self.is_rhd_region) + self.pose.pitch_std = driver_state.faceOrientationStd[0] + self.pose.yaw_std = driver_state.faceOrientationStd[1] + # self.pose.roll_std = driver_state.faceOrientationStd[2] + model_std_max = max(self.pose.pitch_std, self.pose.yaw_std) + self.pose.low_std = model_std_max < self.settings._POSESTD_THRESHOLD and not self.face_partial + self.blink.left_blink = driver_state.leftBlinkProb * (driver_state.leftEyeProb > self.settings._EYE_THRESHOLD) * (driver_state.sunglassesProb < self.settings._SG_THRESHOLD) + self.blink.right_blink = driver_state.rightBlinkProb * (driver_state.rightEyeProb > self.settings._EYE_THRESHOLD) * (driver_state.sunglassesProb < self.settings._SG_THRESHOLD) + + self.driver_distracted = self._is_driver_distracted(self.pose, self.blink) > 0 and \ + driver_state.faceProb > self.settings._FACE_THRESHOLD and self.pose.low_std + self.driver_distraction_filter.update(self.driver_distracted) + + # update offseter + # only update when driver is actively driving the car above a certain speed + if self.face_detected and car_speed > self.settings._POSE_CALIB_MIN_SPEED and self.pose.low_std and (not op_engaged or not self.driver_distracted): + self.pose.pitch_offseter.push_and_update(self.pose.pitch) + self.pose.yaw_offseter.push_and_update(self.pose.yaw) + + self.pose_calibrated = self.pose.pitch_offseter.filtered_stat.n > self.settings._POSE_OFFSET_MIN_COUNT and \ + self.pose.yaw_offseter.filtered_stat.n > self.settings._POSE_OFFSET_MIN_COUNT + + self.is_model_uncertain = self.hi_stds > self.settings._HI_STD_FALLBACK_TIME + self._set_timers(self.face_detected and not self.is_model_uncertain) + if self.face_detected and not self.pose.low_std and not self.driver_distracted: + self.hi_stds += 1 + elif self.face_detected and self.pose.low_std: + self.hi_stds = 0 + + def update(self, events, driver_engaged, ctrl_active, standstill): + if (driver_engaged and self.awareness > 0) or not ctrl_active: + # reset only when on disengagement if red reached + self.awareness = 1. + self.awareness_active = 1. + self.awareness_passive = 1. + return + + driver_attentive = self.driver_distraction_filter.x < 0.37 + awareness_prev = self.awareness + + if (driver_attentive and self.face_detected and self.pose.low_std and self.awareness > 0): + # only restore awareness when paying attention and alert is not red + self.awareness = min(self.awareness + ((self.settings._RECOVERY_FACTOR_MAX-self.settings._RECOVERY_FACTOR_MIN)*(1.-self.awareness)+self.settings._RECOVERY_FACTOR_MIN)*self.step_change, 1.) + if self.awareness == 1.: + self.awareness_passive = min(self.awareness_passive + self.step_change, 1.) + # don't display alert banner when awareness is recovering and has cleared orange + if self.awareness > self.threshold_prompt: + return + + standstill_exemption = standstill and self.awareness - self.step_change <= self.threshold_prompt + certainly_distracted = self.driver_distraction_filter.x > 0.63 and self.driver_distracted and self.face_detected + maybe_distracted = self.hi_stds > self.settings._HI_STD_FALLBACK_TIME or not self.face_detected + if certainly_distracted or maybe_distracted: + # should always be counting if distracted unless at standstill and reaching orange + if not standstill_exemption: + self.awareness = max(self.awareness - self.step_change, -0.1) + + alert = None + if self.awareness <= 0.: + # terminal red alert: disengagement required + alert = EventName.driverDistracted if self.active_monitoring_mode else EventName.driverUnresponsive + self.terminal_time += 1 + if awareness_prev > 0.: + self.terminal_alert_cnt += 1 + elif self.awareness <= self.threshold_prompt: + # prompt orange alert + alert = EventName.promptDriverDistracted if self.active_monitoring_mode else EventName.promptDriverUnresponsive + elif self.awareness <= self.threshold_pre: + # pre green alert + alert = EventName.preDriverDistracted if self.active_monitoring_mode else EventName.preDriverUnresponsive + + if alert is not None: + events.add(alert) diff --git a/selfdrive/pandad.py b/selfdrive/pandad.py new file mode 100755 index 000000000..737a36a63 --- /dev/null +++ b/selfdrive/pandad.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python3 +# simple boardd wrapper that updates the panda first +import os +import usb1 +import time +import subprocess +from typing import NoReturn +from functools import cmp_to_key + +from panda import DEFAULT_FW_FN, DEFAULT_H7_FW_FN, MCU_TYPE_H7, Panda, PandaDFU +from common.basedir import BASEDIR +from common.params import Params +from selfdrive.swaglog import cloudlog + + +def get_expected_signature(panda: Panda) -> bytes: + fn = DEFAULT_H7_FW_FN if (panda.get_mcu_type() == MCU_TYPE_H7) else DEFAULT_FW_FN + + try: + return Panda.get_signature_from_firmware(fn) + except Exception: + cloudlog.exception("Error computing expected signature") + return b"" + + +def flash_panda(panda_serial: str) -> Panda: + panda = Panda(panda_serial) + + fw_signature = get_expected_signature(panda) + + panda_version = "bootstub" if panda.bootstub else panda.get_version() + panda_signature = b"" if panda.bootstub else panda.get_signature() + cloudlog.warning(f"Panda {panda_serial} connected, version: {panda_version}, signature {panda_signature.hex()[:16]}, expected {fw_signature.hex()[:16]}") + + if panda.bootstub or panda_signature != fw_signature: + cloudlog.info("Panda firmware out of date, update required") + #panda.flash() + panda.recover() #BB trying to see if auto flash will work this way when the system boots + cloudlog.info("Done flashing") + + if panda.bootstub: + bootstub_version = panda.get_version() + cloudlog.info(f"Flashed firmware not booting, flashing development bootloader. Bootstub version: {bootstub_version}") + panda.recover() + cloudlog.info("Done flashing bootloader") + + if panda.bootstub: + cloudlog.info("Panda still not booting, exiting") + raise AssertionError + + panda_signature = panda.get_signature() + if panda_signature != fw_signature: + cloudlog.info("Version mismatch after flashing, exiting") + raise AssertionError + + return panda + + +def panda_sort_cmp(a: Panda, b: Panda): + a_type = a.get_type() + b_type = b.get_type() + + # make sure the internal one is always first + if a.is_internal() and not b.is_internal(): + return -1 + if not a.is_internal() and b.is_internal(): + return 1 + + # sort by hardware type + if a_type != b_type: + return a_type < b_type + + # last resort: sort by serial number + return a.get_usb_serial() < b.get_usb_serial() + + +def main() -> NoReturn: + first_run = True + params = Params() + + while True: + try: + params.delete("PandaSignatures") + + # Flash all Pandas in DFU mode + for p in PandaDFU.list(): + cloudlog.info(f"Panda in DFU mode found, flashing recovery {p}") + PandaDFU(p).recover() + time.sleep(1) + + panda_serials = Panda.list() + if len(panda_serials) == 0: + continue + + cloudlog.info(f"{len(panda_serials)} panda(s) found, connecting - {panda_serials}") + + # Flash pandas + pandas = [] + for serial in panda_serials: + pandas.append(flash_panda(serial)) + + # check health for lost heartbeat + for panda in pandas: + health = panda.health() + if health["heartbeat_lost"]: + params.put_bool("PandaHeartbeatLost", True) + cloudlog.event("heartbeat lost", deviceState=health, serial=panda.get_usb_serial()) + + if first_run: + cloudlog.info(f"Resetting panda {panda.get_usb_serial()}") + panda.reset() + + # sort pandas to have deterministic order + pandas.sort(key=cmp_to_key(panda_sort_cmp)) + panda_serials = list(map(lambda p: p.get_usb_serial(), pandas)) + + # log panda fw versions + params.put("PandaSignatures", b','.join(p.get_signature() for p in pandas)) + + # close all pandas + for p in pandas: + p.close() + except (usb1.USBErrorNoDevice, usb1.USBErrorPipe): + # a panda was disconnected while setting everything up. let's try again + cloudlog.exception("Panda USB exception while setting up") + continue + + first_run = False + + # run boardd with all connected serials as arguments + os.chdir(os.path.join(BASEDIR, "selfdrive/boardd")) + subprocess.run(["./boardd", *panda_serials], check=True) + +if __name__ == "__main__": + main() diff --git a/selfdrive/proclogd/SConscript b/selfdrive/proclogd/SConscript new file mode 100644 index 000000000..1b94a32f1 --- /dev/null +++ b/selfdrive/proclogd/SConscript @@ -0,0 +1,6 @@ +Import('env', 'cereal', 'messaging', 'common') +libs = [cereal, messaging, 'pthread', 'zmq', 'capnp', 'kj', 'common', 'zmq', 'json11'] +env.Program('proclogd', ['main.cc', 'proclog.cc'], LIBS=libs) + +if GetOption('test'): + env.Program('tests/test_proclog', ['tests/test_proclog.cc', 'proclog.cc'], LIBS=libs) diff --git a/selfdrive/proclogd/main.cc b/selfdrive/proclogd/main.cc new file mode 100644 index 000000000..4e31597c2 --- /dev/null +++ b/selfdrive/proclogd/main.cc @@ -0,0 +1,22 @@ + +#include + +#include "selfdrive/common/util.h" +#include "selfdrive/proclogd/proclog.h" + +ExitHandler do_exit; + +int main(int argc, char **argv) { + setpriority(PRIO_PROCESS, 0, -15); + + PubMaster publisher({"procLog"}); + while (!do_exit) { + MessageBuilder msg; + buildProcLogMessage(msg); + publisher.send("procLog", msg); + + util::sleep_for(2000); // 2 secs + } + + return 0; +} diff --git a/selfdrive/proclogd/proclog.cc b/selfdrive/proclogd/proclog.cc new file mode 100644 index 000000000..26fc1d94d --- /dev/null +++ b/selfdrive/proclogd/proclog.cc @@ -0,0 +1,239 @@ +#include "selfdrive/proclogd/proclog.h" + +#include + +#include +#include +#include +#include + +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/util.h" + +namespace Parser { + +// parse /proc/stat +std::vector cpuTimes(std::istream &stream) { + std::vector cpu_times; + std::string line; + // skip the first line for cpu total + std::getline(stream, line); + while (std::getline(stream, line)) { + if (line.compare(0, 3, "cpu") != 0) break; + + CPUTime t = {}; + std::istringstream iss(line); + if (iss.ignore(3) >> t.id >> t.utime >> t.ntime >> t.stime >> t.itime >> t.iowtime >> t.irqtime >> t.sirqtime) + cpu_times.push_back(t); + } + return cpu_times; +} + +// parse /proc/meminfo +std::unordered_map memInfo(std::istream &stream) { + std::unordered_map mem_info; + std::string line, key; + while (std::getline(stream, line)) { + uint64_t val = 0; + std::istringstream iss(line); + if (iss >> key >> val) { + mem_info[key] = val * 1024; + } + } + return mem_info; +} + +// field position (https://man7.org/linux/man-pages/man5/proc.5.html) +enum StatPos { + pid = 1, + state = 3, + ppid = 4, + utime = 14, + stime = 15, + cutime = 16, + cstime = 17, + priority = 18, + nice = 19, + num_threads = 20, + starttime = 22, + vsize = 23, + rss = 24, + processor = 39, + MAX_FIELD = 52, +}; + +// parse /proc/pid/stat +std::optional procStat(std::string stat) { + // To avoid being fooled by names containing a closing paren, scan backwards. + auto open_paren = stat.find('('); + auto close_paren = stat.rfind(')'); + if (open_paren == std::string::npos || close_paren == std::string::npos || open_paren > close_paren) { + return std::nullopt; + } + + std::string name = stat.substr(open_paren + 1, close_paren - open_paren - 1); + // repace space in name with _ + std::replace(&stat[open_paren], &stat[close_paren], ' ', '_'); + std::istringstream iss(stat); + std::vector v{std::istream_iterator(iss), + std::istream_iterator()}; + try { + if (v.size() != StatPos::MAX_FIELD) { + throw std::invalid_argument("stat"); + } + ProcStat p = { + .name = name, + .pid = stoi(v[StatPos::pid - 1]), + .state = v[StatPos::state - 1][0], + .ppid = stoi(v[StatPos::ppid - 1]), + .utime = stoul(v[StatPos::utime - 1]), + .stime = stoul(v[StatPos::stime - 1]), + .cutime = stol(v[StatPos::cutime - 1]), + .cstime = stol(v[StatPos::cstime - 1]), + .priority = stol(v[StatPos::priority - 1]), + .nice = stol(v[StatPos::nice - 1]), + .num_threads = stol(v[StatPos::num_threads - 1]), + .starttime = stoull(v[StatPos::starttime - 1]), + .vms = stoul(v[StatPos::vsize - 1]), + .rss = stoul(v[StatPos::rss - 1]), + .processor = stoi(v[StatPos::processor - 1]), + }; + return p; + } catch (const std::invalid_argument &e) { + LOGE("failed to parse procStat (%s) :%s", e.what(), stat.c_str()); + } catch (const std::out_of_range &e) { + LOGE("failed to parse procStat (%s) :%s", e.what(), stat.c_str()); + } + return std::nullopt; +} + +// return list of PIDs from /proc +std::vector pids() { + std::vector ids; + DIR *d = opendir("/proc"); + assert(d); + char *p_end; + struct dirent *de = NULL; + while ((de = readdir(d))) { + if (de->d_type == DT_DIR) { + int pid = strtol(de->d_name, &p_end, 10); + if (p_end == (de->d_name + strlen(de->d_name))) { + ids.push_back(pid); + } + } + } + closedir(d); + return ids; +} + +// null-delimited cmdline arguments to vector +std::vector cmdline(std::istream &stream) { + std::vector ret; + std::string line; + while (std::getline(stream, line, '\0')) { + if (!line.empty()) { + ret.push_back(line); + } + } + return ret; +} + +const ProcCache &getProcExtraInfo(int pid, const std::string &name) { + static std::unordered_map proc_cache; + ProcCache &cache = proc_cache[pid]; + if (cache.pid != pid || cache.name != name) { + cache.pid = pid; + cache.name = name; + std::string proc_path = "/proc/" + std::to_string(pid); + cache.exe = util::readlink(proc_path + "/exe"); + std::ifstream stream(proc_path + "/cmdline"); + cache.cmdline = cmdline(stream); + } + return cache; +} + +} // namespace Parser + +const double jiffy = sysconf(_SC_CLK_TCK); +const size_t page_size = sysconf(_SC_PAGE_SIZE); + +void buildCPUTimes(cereal::ProcLog::Builder &builder) { + std::ifstream stream("/proc/stat"); + std::vector stats = Parser::cpuTimes(stream); + + auto log_cpu_times = builder.initCpuTimes(stats.size()); + for (int i = 0; i < stats.size(); ++i) { + auto l = log_cpu_times[i]; + const CPUTime &r = stats[i]; + l.setCpuNum(r.id); + l.setUser(r.utime / jiffy); + l.setNice(r.ntime / jiffy); + l.setSystem(r.stime / jiffy); + l.setIdle(r.itime / jiffy); + l.setIowait(r.iowtime / jiffy); + l.setIrq(r.irqtime / jiffy); + l.setSoftirq(r.sirqtime / jiffy); + } +} + +void buildMemInfo(cereal::ProcLog::Builder &builder) { + std::ifstream stream("/proc/meminfo"); + auto mem_info = Parser::memInfo(stream); + + auto mem = builder.initMem(); + mem.setTotal(mem_info["MemTotal:"]); + mem.setFree(mem_info["MemFree:"]); + mem.setAvailable(mem_info["MemAvailable:"]); + mem.setBuffers(mem_info["Buffers:"]); + mem.setCached(mem_info["Cached:"]); + mem.setActive(mem_info["Active:"]); + mem.setInactive(mem_info["Inactive:"]); + mem.setShared(mem_info["Shmem:"]); +} + +void buildProcs(cereal::ProcLog::Builder &builder) { + auto pids = Parser::pids(); + std::vector proc_stats; + proc_stats.reserve(pids.size()); + for (int pid : pids) { + std::string path = "/proc/" + std::to_string(pid) + "/stat"; + if (auto stat = Parser::procStat(util::read_file(path))) { + proc_stats.push_back(*stat); + } + } + + auto procs = builder.initProcs(proc_stats.size()); + for (size_t i = 0; i < proc_stats.size(); i++) { + auto l = procs[i]; + const ProcStat &r = proc_stats[i]; + l.setPid(r.pid); + l.setState(r.state); + l.setPpid(r.ppid); + l.setCpuUser(r.utime / jiffy); + l.setCpuSystem(r.stime / jiffy); + l.setCpuChildrenUser(r.cutime / jiffy); + l.setCpuChildrenSystem(r.cstime / jiffy); + l.setPriority(r.priority); + l.setNice(r.nice); + l.setNumThreads(r.num_threads); + l.setStartTime(r.starttime / jiffy); + l.setMemVms(r.vms); + l.setMemRss((uint64_t)r.rss * page_size); + l.setProcessor(r.processor); + l.setName(r.name); + + const ProcCache &extra_info = Parser::getProcExtraInfo(r.pid, r.name); + l.setExe(extra_info.exe); + auto lcmdline = l.initCmdline(extra_info.cmdline.size()); + for (size_t j = 0; j < lcmdline.size(); j++) { + lcmdline.set(j, extra_info.cmdline[j]); + } + } +} + +void buildProcLogMessage(MessageBuilder &msg) { + auto procLog = msg.initEvent().initProcLog(); + buildProcs(procLog); + buildCPUTimes(procLog); + buildMemInfo(procLog); +} diff --git a/selfdrive/proclogd/proclog.h b/selfdrive/proclogd/proclog.h new file mode 100644 index 000000000..9ed53d1ba --- /dev/null +++ b/selfdrive/proclogd/proclog.h @@ -0,0 +1,40 @@ +#include +#include +#include +#include + +#include "cereal/messaging/messaging.h" + +struct CPUTime { + int id; + unsigned long utime, ntime, stime, itime; + unsigned long iowtime, irqtime, sirqtime; +}; + +struct ProcCache { + int pid; + std::string name, exe; + std::vector cmdline; +}; + +struct ProcStat { + int pid, ppid, processor; + char state; + long cutime, cstime, priority, nice, num_threads; + unsigned long utime, stime, vms, rss; + unsigned long long starttime; + std::string name; +}; + +namespace Parser { + +std::vector pids(); +std::optional procStat(std::string stat); +std::vector cmdline(std::istream &stream); +std::vector cpuTimes(std::istream &stream); +std::unordered_map memInfo(std::istream &stream); +const ProcCache &getProcExtraInfo(int pid, const std::string &name); + +}; // namespace Parser + +void buildProcLogMessage(MessageBuilder &msg); diff --git a/selfdrive/proclogd/proclogd b/selfdrive/proclogd/proclogd new file mode 100755 index 000000000..bb45942e9 Binary files /dev/null and b/selfdrive/proclogd/proclogd differ diff --git a/selfdrive/rtshield.py b/selfdrive/rtshield.py new file mode 100755 index 000000000..ad7538d7a --- /dev/null +++ b/selfdrive/rtshield.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +import os +import time +from typing import NoReturn + +from common.realtime import set_core_affinity, set_realtime_priority + +# RT shield - ensure CPU 3 always remains available for RT processes +# runs as SCHED_FIFO with minimum priority to ensure kthreads don't +# get scheduled onto CPU 3, but it's always preemptible by realtime +# openpilot processes + +def main() -> NoReturn: + set_core_affinity(int(os.getenv("CORE", "3"))) + set_realtime_priority(1) + + while True: + time.sleep(0.000001) + +if __name__ == "__main__": + main() diff --git a/selfdrive/sensord/SConscript b/selfdrive/sensord/SConscript new file mode 100644 index 000000000..186e302bc --- /dev/null +++ b/selfdrive/sensord/SConscript @@ -0,0 +1,22 @@ +Import('env', 'arch', 'common', 'cereal', 'messaging') + +if arch == "aarch64": + env.Program('_sensord', 'sensors_qcom.cc', LIBS=['hardware', common, cereal, messaging, 'capnp', 'zmq', 'kj']) +else: + sensors = [ + 'sensors/file_sensor.cc', + 'sensors/i2c_sensor.cc', + 'sensors/light_sensor.cc', + 'sensors/bmx055_accel.cc', + 'sensors/bmx055_gyro.cc', + 'sensors/bmx055_magn.cc', + 'sensors/bmx055_temp.cc', + 'sensors/lsm6ds3_accel.cc', + 'sensors/lsm6ds3_gyro.cc', + 'sensors/lsm6ds3_temp.cc', + 'sensors/mmc5603nj_magn.cc', + ] + libs = [common, cereal, messaging, 'capnp', 'zmq', 'kj'] + if arch == "larch64": + libs.append('i2c') + env.Program('_sensord', ['sensors_qcom2.cc'] + sensors, LIBS=libs) diff --git a/selfdrive/sensord/_sensord b/selfdrive/sensord/_sensord new file mode 100755 index 000000000..1ed4ff3f8 Binary files /dev/null and b/selfdrive/sensord/_sensord differ diff --git a/selfdrive/sensord/libdiag.h b/selfdrive/sensord/libdiag.h new file mode 100644 index 000000000..03a59464e --- /dev/null +++ b/selfdrive/sensord/libdiag.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define DIAG_MAX_RX_PKT_SIZ 4096 + +bool Diag_LSM_Init(uint8_t* pIEnv); +bool Diag_LSM_DeInit(void); + +// DCI + +#define DIAG_CON_APSS 0x001 +#define DIAG_CON_MPSS 0x002 +#define DIAG_CON_LPASS 0x004 +#define DIAG_CON_WCNSS 0x008 + +enum { + DIAG_DCI_NO_ERROR = 1001, +} diag_dci_error_type; + +int diag_register_dci_client(int*, uint16_t*, int, void*); +int diag_log_stream_config(int client_id, int set_mask, uint16_t log_codes_array[], int num_codes); +int diag_register_dci_stream(void (*func_ptr_logs)(unsigned char *ptr, int len), void (*func_ptr_events)(unsigned char *ptr, int len)); +int diag_release_dci_client(int*); + +int diag_send_dci_async_req(int client_id, unsigned char buf[], int bytes, unsigned char *rsp_ptr, int rsp_len, + void (*func_ptr)(unsigned char *ptr, int len, void *data_ptr), void *data_ptr); + + +#ifdef __cplusplus +} +#endif diff --git a/selfdrive/sensord/sensord b/selfdrive/sensord/sensord new file mode 100755 index 000000000..9ea848d57 --- /dev/null +++ b/selfdrive/sensord/sensord @@ -0,0 +1,4 @@ +#!/bin/sh +cd "$(dirname "$0")" +export LD_LIBRARY_PATH="/system/lib64:$LD_LIBRARY_PATH" +exec ./_sensord diff --git a/selfdrive/sensord/sensors/bmx055_accel.cc b/selfdrive/sensord/sensors/bmx055_accel.cc new file mode 100644 index 000000000..f5d68bdee --- /dev/null +++ b/selfdrive/sensord/sensors/bmx055_accel.cc @@ -0,0 +1,69 @@ +#include "bmx055_accel.h" + +#include + +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/timing.h" + +BMX055_Accel::BMX055_Accel(I2CBus *bus) : I2CSensor(bus) {} + +int BMX055_Accel::init() { + int ret = 0; + uint8_t buffer[1]; + + ret = read_register(BMX055_ACCEL_I2C_REG_ID, buffer, 1); + if(ret < 0) { + LOGE("Reading chip ID failed: %d", ret); + goto fail; + } + + if(buffer[0] != BMX055_ACCEL_CHIP_ID) { + LOGE("Chip ID wrong. Got: %d, Expected %d", buffer[0], BMX055_ACCEL_CHIP_ID); + ret = -1; + goto fail; + } + + // High bandwidth + // ret = set_register(BMX055_ACCEL_I2C_REG_HBW, BMX055_ACCEL_HBW_ENABLE); + // if (ret < 0) { + // goto fail; + // } + + // Low bandwidth + ret = set_register(BMX055_ACCEL_I2C_REG_HBW, BMX055_ACCEL_HBW_DISABLE); + if (ret < 0) { + goto fail; + } + ret = set_register(BMX055_ACCEL_I2C_REG_BW, BMX055_ACCEL_BW_125HZ); + if (ret < 0) { + goto fail; + } + +fail: + return ret; +} + +void BMX055_Accel::get_event(cereal::SensorEventData::Builder &event) { + uint64_t start_time = nanos_since_boot(); + uint8_t buffer[6]; + int len = read_register(BMX055_ACCEL_I2C_REG_X_LSB, buffer, sizeof(buffer)); + assert(len == 6); + + // 12 bit = +-2g + float scale = 9.81 * 2.0f / (1 << 11); + float x = -read_12_bit(buffer[0], buffer[1]) * scale; + float y = -read_12_bit(buffer[2], buffer[3]) * scale; + float z = read_12_bit(buffer[4], buffer[5]) * scale; + + event.setSource(cereal::SensorEventData::SensorSource::BMX055); + event.setVersion(1); + event.setSensor(SENSOR_ACCELEROMETER); + event.setType(SENSOR_TYPE_ACCELEROMETER); + event.setTimestamp(start_time); + + float xyz[] = {x, y, z}; + auto svec = event.initAcceleration(); + svec.setV(xyz); + svec.setStatus(true); + +} diff --git a/selfdrive/sensord/sensors/bmx055_accel.h b/selfdrive/sensord/sensors/bmx055_accel.h new file mode 100644 index 000000000..86ec419cd --- /dev/null +++ b/selfdrive/sensord/sensors/bmx055_accel.h @@ -0,0 +1,37 @@ +#pragma once + +#include "selfdrive/sensord/sensors/i2c_sensor.h" + +// Address of the chip on the bus +#define BMX055_ACCEL_I2C_ADDR 0x18 + +// Registers of the chip +#define BMX055_ACCEL_I2C_REG_ID 0x00 +#define BMX055_ACCEL_I2C_REG_X_LSB 0x02 +#define BMX055_ACCEL_I2C_REG_TEMP 0x08 +#define BMX055_ACCEL_I2C_REG_BW 0x10 +#define BMX055_ACCEL_I2C_REG_HBW 0x13 +#define BMX055_ACCEL_I2C_REG_FIFO 0x3F + +// Constants +#define BMX055_ACCEL_CHIP_ID 0xFA + +#define BMX055_ACCEL_HBW_ENABLE 0b10000000 +#define BMX055_ACCEL_HBW_DISABLE 0b00000000 + +#define BMX055_ACCEL_BW_7_81HZ 0b01000 +#define BMX055_ACCEL_BW_15_63HZ 0b01001 +#define BMX055_ACCEL_BW_31_25HZ 0b01010 +#define BMX055_ACCEL_BW_62_5HZ 0b01011 +#define BMX055_ACCEL_BW_125HZ 0b01100 +#define BMX055_ACCEL_BW_250HZ 0b01101 +#define BMX055_ACCEL_BW_500HZ 0b01110 +#define BMX055_ACCEL_BW_1000HZ 0b01111 + +class BMX055_Accel : public I2CSensor { + uint8_t get_device_address() {return BMX055_ACCEL_I2C_ADDR;} +public: + BMX055_Accel(I2CBus *bus); + int init(); + void get_event(cereal::SensorEventData::Builder &event); +}; diff --git a/selfdrive/sensord/sensors/bmx055_gyro.cc b/selfdrive/sensord/sensors/bmx055_gyro.cc new file mode 100644 index 000000000..f0e3034e3 --- /dev/null +++ b/selfdrive/sensord/sensors/bmx055_gyro.cc @@ -0,0 +1,80 @@ +#include "bmx055_gyro.h" + +#include +#include + +#include "selfdrive/common/swaglog.h" + +#define DEG2RAD(x) ((x) * M_PI / 180.0) + + +BMX055_Gyro::BMX055_Gyro(I2CBus *bus) : I2CSensor(bus) {} + +int BMX055_Gyro::init() { + int ret = 0; + uint8_t buffer[1]; + + ret =read_register(BMX055_GYRO_I2C_REG_ID, buffer, 1); + if(ret < 0) { + LOGE("Reading chip ID failed: %d", ret); + goto fail; + } + + if(buffer[0] != BMX055_GYRO_CHIP_ID) { + LOGE("Chip ID wrong. Got: %d, Expected %d", buffer[0], BMX055_GYRO_CHIP_ID); + ret = -1; + goto fail; + } + + // High bandwidth + // ret = set_register(BMX055_GYRO_I2C_REG_HBW, BMX055_GYRO_HBW_ENABLE); + // if (ret < 0) { + // goto fail; + // } + + // Low bandwidth + ret = set_register(BMX055_GYRO_I2C_REG_HBW, BMX055_GYRO_HBW_DISABLE); + if (ret < 0) { + goto fail; + } + + // 116 Hz filter + ret = set_register(BMX055_GYRO_I2C_REG_BW, BMX055_GYRO_BW_116HZ); + if (ret < 0) { + goto fail; + } + + // +- 125 deg/s range + ret = set_register(BMX055_GYRO_I2C_REG_RANGE, BMX055_GYRO_RANGE_125); + if (ret < 0) { + goto fail; + } + +fail: + return ret; +} + +void BMX055_Gyro::get_event(cereal::SensorEventData::Builder &event) { + uint64_t start_time = nanos_since_boot(); + uint8_t buffer[6]; + int len = read_register(BMX055_GYRO_I2C_REG_RATE_X_LSB, buffer, sizeof(buffer)); + assert(len == 6); + + // 16 bit = +- 125 deg/s + float scale = 125.0f / (1 << 15); + float x = -DEG2RAD(read_16_bit(buffer[0], buffer[1]) * scale); + float y = -DEG2RAD(read_16_bit(buffer[2], buffer[3]) * scale); + float z = DEG2RAD(read_16_bit(buffer[4], buffer[5]) * scale); + + event.setSource(cereal::SensorEventData::SensorSource::BMX055); + event.setVersion(1); + event.setSensor(SENSOR_GYRO_UNCALIBRATED); + event.setType(SENSOR_TYPE_GYROSCOPE_UNCALIBRATED); + event.setTimestamp(start_time); + + float xyz[] = {x, y, z}; + auto svec = event.initGyroUncalibrated(); + svec.setV(xyz); + svec.setStatus(true); + +} diff --git a/selfdrive/sensord/sensors/bmx055_gyro.h b/selfdrive/sensord/sensors/bmx055_gyro.h new file mode 100644 index 000000000..ed0c16ff0 --- /dev/null +++ b/selfdrive/sensord/sensors/bmx055_gyro.h @@ -0,0 +1,37 @@ +#pragma once + +#include "selfdrive/sensord/sensors/i2c_sensor.h" + +// Address of the chip on the bus +#define BMX055_GYRO_I2C_ADDR 0x68 + +// Registers of the chip +#define BMX055_GYRO_I2C_REG_ID 0x00 +#define BMX055_GYRO_I2C_REG_RATE_X_LSB 0x02 +#define BMX055_GYRO_I2C_REG_RANGE 0x0F +#define BMX055_GYRO_I2C_REG_BW 0x10 +#define BMX055_GYRO_I2C_REG_HBW 0x13 +#define BMX055_GYRO_I2C_REG_FIFO 0x3F + +// Constants +#define BMX055_GYRO_CHIP_ID 0x0F + +#define BMX055_GYRO_HBW_ENABLE 0b10000000 +#define BMX055_GYRO_HBW_DISABLE 0b00000000 + +#define BMX055_GYRO_RANGE_2000 0b000 +#define BMX055_GYRO_RANGE_1000 0b001 +#define BMX055_GYRO_RANGE_500 0b010 +#define BMX055_GYRO_RANGE_250 0b011 +#define BMX055_GYRO_RANGE_125 0b100 + +#define BMX055_GYRO_BW_116HZ 0b0010 + + +class BMX055_Gyro : public I2CSensor { + uint8_t get_device_address() {return BMX055_GYRO_I2C_ADDR;} +public: + BMX055_Gyro(I2CBus *bus); + int init(); + void get_event(cereal::SensorEventData::Builder &event); +}; diff --git a/selfdrive/sensord/sensors/bmx055_magn.cc b/selfdrive/sensord/sensors/bmx055_magn.cc new file mode 100644 index 000000000..29e0d809d --- /dev/null +++ b/selfdrive/sensord/sensors/bmx055_magn.cc @@ -0,0 +1,250 @@ +#include "bmx055_magn.h" + +#include + +#include +#include +#include + +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/util.h" + +static int16_t compensate_x(trim_data_t trim_data, int16_t mag_data_x, uint16_t data_rhall) { + uint16_t process_comp_x0 = data_rhall; + int32_t process_comp_x1 = ((int32_t)trim_data.dig_xyz1) * 16384; + uint16_t process_comp_x2 = ((uint16_t)(process_comp_x1 / process_comp_x0)) - ((uint16_t)0x4000); + int16_t retval = ((int16_t)process_comp_x2); + int32_t process_comp_x3 = (((int32_t)retval) * ((int32_t)retval)); + int32_t process_comp_x4 = (((int32_t)trim_data.dig_xy2) * (process_comp_x3 / 128)); + int32_t process_comp_x5 = (int32_t)(((int16_t)trim_data.dig_xy1) * 128); + int32_t process_comp_x6 = ((int32_t)retval) * process_comp_x5; + int32_t process_comp_x7 = (((process_comp_x4 + process_comp_x6) / 512) + ((int32_t)0x100000)); + int32_t process_comp_x8 = ((int32_t)(((int16_t)trim_data.dig_x2) + ((int16_t)0xA0))); + int32_t process_comp_x9 = ((process_comp_x7 * process_comp_x8) / 4096); + int32_t process_comp_x10 = ((int32_t)mag_data_x) * process_comp_x9; + retval = ((int16_t)(process_comp_x10 / 8192)); + retval = (retval + (((int16_t)trim_data.dig_x1) * 8)) / 16; + + return retval; +} + +static int16_t compensate_y(trim_data_t trim_data, int16_t mag_data_y, uint16_t data_rhall) { + uint16_t process_comp_y0 = trim_data.dig_xyz1; + int32_t process_comp_y1 = (((int32_t)trim_data.dig_xyz1) * 16384) / process_comp_y0; + uint16_t process_comp_y2 = ((uint16_t)process_comp_y1) - ((uint16_t)0x4000); + int16_t retval = ((int16_t)process_comp_y2); + int32_t process_comp_y3 = ((int32_t) retval) * ((int32_t)retval); + int32_t process_comp_y4 = ((int32_t)trim_data.dig_xy2) * (process_comp_y3 / 128); + int32_t process_comp_y5 = ((int32_t)(((int16_t)trim_data.dig_xy1) * 128)); + int32_t process_comp_y6 = ((process_comp_y4 + (((int32_t)retval) * process_comp_y5)) / 512); + int32_t process_comp_y7 = ((int32_t)(((int16_t)trim_data.dig_y2) + ((int16_t)0xA0))); + int32_t process_comp_y8 = (((process_comp_y6 + ((int32_t)0x100000)) * process_comp_y7) / 4096); + int32_t process_comp_y9 = (((int32_t)mag_data_y) * process_comp_y8); + retval = (int16_t)(process_comp_y9 / 8192); + retval = (retval + (((int16_t)trim_data.dig_y1) * 8)) / 16; + + return retval; +} + +static int16_t compensate_z(trim_data_t trim_data, int16_t mag_data_z, uint16_t data_rhall) { + int16_t process_comp_z0 = ((int16_t)data_rhall) - ((int16_t) trim_data.dig_xyz1); + int32_t process_comp_z1 = (((int32_t)trim_data.dig_z3) * ((int32_t)(process_comp_z0))) / 4; + int32_t process_comp_z2 = (((int32_t)(mag_data_z - trim_data.dig_z4)) * 32768); + int32_t process_comp_z3 = ((int32_t)trim_data.dig_z1) * (((int16_t)data_rhall) * 2); + int16_t process_comp_z4 = (int16_t)((process_comp_z3 + (32768)) / 65536); + int32_t retval = ((process_comp_z2 - process_comp_z1) / (trim_data.dig_z2 + process_comp_z4)); + + /* saturate result to +/- 2 micro-tesla */ + retval = std::clamp(retval, -32767, 32767); + + /* Conversion of LSB to micro-tesla*/ + retval = retval / 16; + + return (int16_t)retval; +} + +BMX055_Magn::BMX055_Magn(I2CBus *bus) : I2CSensor(bus) {} + +int BMX055_Magn::init() { + int ret; + uint8_t buffer[1]; + uint8_t trim_x1y1[2] = {0}; + uint8_t trim_x2y2[2] = {0}; + uint8_t trim_xy1xy2[2] = {0}; + uint8_t trim_z1[2] = {0}; + uint8_t trim_z2[2] = {0}; + uint8_t trim_z3[2] = {0}; + uint8_t trim_z4[2] = {0}; + uint8_t trim_xyz1[2] = {0}; + + // suspend -> sleep + ret = set_register(BMX055_MAGN_I2C_REG_PWR_0, 0x01); + if(ret < 0) { + LOGE("Enabling power failed: %d", ret); + goto fail; + } + util::sleep_for(5); // wait until the chip is powered on + + // read chip ID + ret = read_register(BMX055_MAGN_I2C_REG_ID, buffer, 1); + if(ret < 0) { + LOGE("Reading chip ID failed: %d", ret); + goto fail; + } + + if(buffer[0] != BMX055_MAGN_CHIP_ID) { + LOGE("Chip ID wrong. Got: %d, Expected %d", buffer[0], BMX055_MAGN_CHIP_ID); + return -1; + } + + // Load magnetometer trim + ret = read_register(BMX055_MAGN_I2C_REG_DIG_X1, trim_x1y1, 2); + if(ret < 0) goto fail; + ret = read_register(BMX055_MAGN_I2C_REG_DIG_X2, trim_x2y2, 2); + if(ret < 0) goto fail; + ret = read_register(BMX055_MAGN_I2C_REG_DIG_XY2, trim_xy1xy2, 2); + if(ret < 0) goto fail; + ret = read_register(BMX055_MAGN_I2C_REG_DIG_Z1_LSB, trim_z1, 2); + if(ret < 0) goto fail; + ret = read_register(BMX055_MAGN_I2C_REG_DIG_Z2_LSB, trim_z2, 2); + if(ret < 0) goto fail; + ret = read_register(BMX055_MAGN_I2C_REG_DIG_Z3_LSB, trim_z3, 2); + if(ret < 0) goto fail; + ret = read_register(BMX055_MAGN_I2C_REG_DIG_Z4_LSB, trim_z4, 2); + if(ret < 0) goto fail; + ret = read_register(BMX055_MAGN_I2C_REG_DIG_XYZ1_LSB, trim_xyz1, 2); + if(ret < 0) goto fail; + + // Read trim data + trim_data.dig_x1 = trim_x1y1[0]; + trim_data.dig_y1 = trim_x1y1[1]; + + trim_data.dig_x2 = trim_x2y2[0]; + trim_data.dig_y2 = trim_x2y2[1]; + + trim_data.dig_xy1 = trim_xy1xy2[1]; // NB: MSB/LSB swapped + trim_data.dig_xy2 = trim_xy1xy2[0]; + + trim_data.dig_z1 = read_16_bit(trim_z1[0], trim_z1[1]); + trim_data.dig_z2 = read_16_bit(trim_z2[0], trim_z2[1]); + trim_data.dig_z3 = read_16_bit(trim_z3[0], trim_z3[1]); + trim_data.dig_z4 = read_16_bit(trim_z4[0], trim_z4[1]); + + trim_data.dig_xyz1 = read_16_bit(trim_xyz1[0], trim_xyz1[1] & 0x7f); + assert(trim_data.dig_xyz1 != 0); + + perform_self_test(); + + // f_max = 1 / (145us * nXY + 500us * NZ + 980us) + // Chose NXY = 7, NZ = 12, which gives 125 Hz, + // and has the same ratio as the high accuracy preset + ret = set_register(BMX055_MAGN_I2C_REG_REPXY, (7 - 1) / 2); + if (ret < 0) { + goto fail; + } + + ret = set_register(BMX055_MAGN_I2C_REG_REPZ, 12 - 1); + if (ret < 0) { + goto fail; + } + + + return 0; + + fail: + return ret; +} + +bool BMX055_Magn::perform_self_test() { + uint8_t buffer[8]; + int16_t x, y; + int16_t neg_z, pos_z; + + // Increase z reps for less false positives (~30 Hz ODR) + set_register(BMX055_MAGN_I2C_REG_REPXY, 1); + set_register(BMX055_MAGN_I2C_REG_REPZ, 64 - 1); + + // Clean existing measurement + read_register(BMX055_MAGN_I2C_REG_DATAX_LSB, buffer, sizeof(buffer)); + + uint8_t forced = BMX055_MAGN_FORCED; + + // Negative current + set_register(BMX055_MAGN_I2C_REG_MAG, forced | (uint8_t(0b10) << 6)); + util::sleep_for(100); + + read_register(BMX055_MAGN_I2C_REG_DATAX_LSB, buffer, sizeof(buffer)); + parse_xyz(buffer, &x, &y, &neg_z); + + // Positive current + set_register(BMX055_MAGN_I2C_REG_MAG, forced | (uint8_t(0b11) << 6)); + util::sleep_for(100); + + read_register(BMX055_MAGN_I2C_REG_DATAX_LSB, buffer, sizeof(buffer)); + parse_xyz(buffer, &x, &y, &pos_z); + + // Put back in normal mode + set_register(BMX055_MAGN_I2C_REG_MAG, 0); + + int16_t diff = pos_z - neg_z; + bool passed = (diff > 180) && (diff < 240); + + if (!passed) { + LOGE("self test failed: neg %d pos %d diff %d", neg_z, pos_z, diff); + } + + return passed; +} + +bool BMX055_Magn::parse_xyz(uint8_t buffer[8], int16_t *x, int16_t *y, int16_t *z) { + bool ready = buffer[6] & 0x1; + if (ready) { + int16_t mdata_x = (int16_t) (((int16_t)buffer[1] << 8) | buffer[0]) >> 3; + int16_t mdata_y = (int16_t) (((int16_t)buffer[3] << 8) | buffer[2]) >> 3; + int16_t mdata_z = (int16_t) (((int16_t)buffer[5] << 8) | buffer[4]) >> 1; + uint16_t data_r = (uint16_t) (((uint16_t)buffer[7] << 8) | buffer[6]) >> 2; + assert(data_r != 0); + + *x = compensate_x(trim_data, mdata_x, data_r); + *y = compensate_y(trim_data, mdata_y, data_r); + *z = compensate_z(trim_data, mdata_z, data_r); + } + return ready; +} + + +void BMX055_Magn::get_event(cereal::SensorEventData::Builder &event) { + uint64_t start_time = nanos_since_boot(); + uint8_t buffer[8]; + int16_t _x, _y, x, y, z; + + int len = read_register(BMX055_MAGN_I2C_REG_DATAX_LSB, buffer, sizeof(buffer)); + assert(len == sizeof(buffer)); + + if (parse_xyz(buffer, &_x, &_y, &z)) { + event.setSource(cereal::SensorEventData::SensorSource::BMX055); + event.setVersion(2); + event.setSensor(SENSOR_MAGNETOMETER_UNCALIBRATED); + event.setType(SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED); + event.setTimestamp(start_time); + + // Move magnetometer into same reference frame as accel/gryo + x = -_y; + y = _x; + + // Axis convention + x = -x; + y = -y; + + float xyz[] = {(float)x, (float)y, (float)z}; + auto svec = event.initMagneticUncalibrated(); + svec.setV(xyz); + svec.setStatus(true); + } + + // The BMX055 Magnetometer has no FIFO mode. Self running mode only goes + // up to 30 Hz. Therefore we put in forced mode, and request measurements + // at a 100 Hz. When reading the registers we have to check the ready bit + // To verify the measurement was completed this cycle. + set_register(BMX055_MAGN_I2C_REG_MAG, BMX055_MAGN_FORCED); +} diff --git a/selfdrive/sensord/sensors/bmx055_magn.h b/selfdrive/sensord/sensors/bmx055_magn.h new file mode 100644 index 000000000..d60fd5515 --- /dev/null +++ b/selfdrive/sensord/sensors/bmx055_magn.h @@ -0,0 +1,63 @@ +#pragma once +#include + +#include "selfdrive/sensord/sensors/i2c_sensor.h" + +// Address of the chip on the bus +#define BMX055_MAGN_I2C_ADDR 0x10 + +// Registers of the chip +#define BMX055_MAGN_I2C_REG_ID 0x40 +#define BMX055_MAGN_I2C_REG_PWR_0 0x4B +#define BMX055_MAGN_I2C_REG_MAG 0x4C +#define BMX055_MAGN_I2C_REG_DATAX_LSB 0x42 +#define BMX055_MAGN_I2C_REG_RHALL_LSB 0x48 +#define BMX055_MAGN_I2C_REG_REPXY 0x51 +#define BMX055_MAGN_I2C_REG_REPZ 0x52 + +#define BMX055_MAGN_I2C_REG_DIG_X1 0x5D +#define BMX055_MAGN_I2C_REG_DIG_Y1 0x5E +#define BMX055_MAGN_I2C_REG_DIG_Z4_LSB 0x62 +#define BMX055_MAGN_I2C_REG_DIG_Z4_MSB 0x63 +#define BMX055_MAGN_I2C_REG_DIG_X2 0x64 +#define BMX055_MAGN_I2C_REG_DIG_Y2 0x65 +#define BMX055_MAGN_I2C_REG_DIG_Z2_LSB 0x68 +#define BMX055_MAGN_I2C_REG_DIG_Z2_MSB 0x69 +#define BMX055_MAGN_I2C_REG_DIG_Z1_LSB 0x6A +#define BMX055_MAGN_I2C_REG_DIG_Z1_MSB 0x6B +#define BMX055_MAGN_I2C_REG_DIG_XYZ1_LSB 0x6C +#define BMX055_MAGN_I2C_REG_DIG_XYZ1_MSB 0x6D +#define BMX055_MAGN_I2C_REG_DIG_Z3_LSB 0x6E +#define BMX055_MAGN_I2C_REG_DIG_Z3_MSB 0x6F +#define BMX055_MAGN_I2C_REG_DIG_XY2 0x70 +#define BMX055_MAGN_I2C_REG_DIG_XY1 0x71 + +// Constants +#define BMX055_MAGN_CHIP_ID 0x32 +#define BMX055_MAGN_FORCED (0b01 << 1) + +struct trim_data_t { + int8_t dig_x1; + int8_t dig_y1; + int8_t dig_x2; + int8_t dig_y2; + uint16_t dig_z1; + int16_t dig_z2; + int16_t dig_z3; + int16_t dig_z4; + uint8_t dig_xy1; + int8_t dig_xy2; + uint16_t dig_xyz1; +}; + + +class BMX055_Magn : public I2CSensor{ + uint8_t get_device_address() {return BMX055_MAGN_I2C_ADDR;} + trim_data_t trim_data = {0}; + bool perform_self_test(); + bool parse_xyz(uint8_t buffer[8], int16_t *x, int16_t *y, int16_t *z); +public: + BMX055_Magn(I2CBus *bus); + int init(); + void get_event(cereal::SensorEventData::Builder &event); +}; diff --git a/selfdrive/sensord/sensors/bmx055_temp.cc b/selfdrive/sensord/sensors/bmx055_temp.cc new file mode 100644 index 000000000..339a987ce --- /dev/null +++ b/selfdrive/sensord/sensors/bmx055_temp.cc @@ -0,0 +1,44 @@ +#include "bmx055_temp.h" + +#include + +#include "selfdrive/sensord/sensors/bmx055_accel.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/timing.h" + +BMX055_Temp::BMX055_Temp(I2CBus *bus) : I2CSensor(bus) {} + +int BMX055_Temp::init() { + int ret = 0; + uint8_t buffer[1]; + + ret = read_register(BMX055_ACCEL_I2C_REG_ID, buffer, 1); + if(ret < 0) { + LOGE("Reading chip ID failed: %d", ret); + goto fail; + } + + if(buffer[0] != BMX055_ACCEL_CHIP_ID) { + LOGE("Chip ID wrong. Got: %d, Expected %d", buffer[0], BMX055_ACCEL_CHIP_ID); + ret = -1; + goto fail; + } + +fail: + return ret; +} + +void BMX055_Temp::get_event(cereal::SensorEventData::Builder &event) { + uint64_t start_time = nanos_since_boot(); + uint8_t buffer[1]; + int len = read_register(BMX055_ACCEL_I2C_REG_TEMP, buffer, sizeof(buffer)); + assert(len == sizeof(buffer)); + + float temp = 23.0f + int8_t(buffer[0]) / 2.0f; + + event.setSource(cereal::SensorEventData::SensorSource::BMX055); + event.setVersion(1); + event.setType(SENSOR_TYPE_AMBIENT_TEMPERATURE); + event.setTimestamp(start_time); + event.setTemperature(temp); +} diff --git a/selfdrive/sensord/sensors/bmx055_temp.h b/selfdrive/sensord/sensors/bmx055_temp.h new file mode 100644 index 000000000..5ffaa8fb6 --- /dev/null +++ b/selfdrive/sensord/sensors/bmx055_temp.h @@ -0,0 +1,12 @@ +#pragma once + +#include "selfdrive/sensord/sensors/bmx055_accel.h" +#include "selfdrive/sensord/sensors/i2c_sensor.h" + +class BMX055_Temp : public I2CSensor { + uint8_t get_device_address() {return BMX055_ACCEL_I2C_ADDR;} +public: + BMX055_Temp(I2CBus *bus); + int init(); + void get_event(cereal::SensorEventData::Builder &event); +}; diff --git a/selfdrive/sensord/sensors/constants.h b/selfdrive/sensord/sensors/constants.h new file mode 100644 index 000000000..c216f838a --- /dev/null +++ b/selfdrive/sensord/sensors/constants.h @@ -0,0 +1,18 @@ +#pragma once + + +#define SENSOR_ACCELEROMETER 1 +#define SENSOR_MAGNETOMETER 2 +#define SENSOR_MAGNETOMETER_UNCALIBRATED 3 +#define SENSOR_GYRO 4 +#define SENSOR_GYRO_UNCALIBRATED 5 +#define SENSOR_LIGHT 7 + +#define SENSOR_TYPE_ACCELEROMETER 1 +#define SENSOR_TYPE_GEOMAGNETIC_FIELD 2 +#define SENSOR_TYPE_GYROSCOPE 4 +#define SENSOR_TYPE_LIGHT 5 +#define SENSOR_TYPE_AMBIENT_TEMPERATURE 13 +#define SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED 14 +#define SENSOR_TYPE_MAGNETIC_FIELD SENSOR_TYPE_GEOMAGNETIC_FIELD +#define SENSOR_TYPE_GYROSCOPE_UNCALIBRATED 16 diff --git a/selfdrive/sensord/sensors/file_sensor.cc b/selfdrive/sensord/sensors/file_sensor.cc new file mode 100644 index 000000000..812a41fa8 --- /dev/null +++ b/selfdrive/sensord/sensors/file_sensor.cc @@ -0,0 +1,14 @@ +#include "file_sensor.h" + +#include + +FileSensor::FileSensor(std::string filename) : file(filename) { +} + +int FileSensor::init() { + return file.is_open() ? 0 : 1; +} + +FileSensor::~FileSensor() { + file.close(); +} diff --git a/selfdrive/sensord/sensors/file_sensor.h b/selfdrive/sensord/sensors/file_sensor.h new file mode 100644 index 000000000..c5b4643e1 --- /dev/null +++ b/selfdrive/sensord/sensors/file_sensor.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include + +#include "cereal/gen/cpp/log.capnp.h" +#include "selfdrive/sensord/sensors/sensor.h" + +class FileSensor : public Sensor { +protected: + std::ifstream file; + +public: + FileSensor(std::string filename); + ~FileSensor(); + int init(); + virtual void get_event(cereal::SensorEventData::Builder &event) = 0; +}; diff --git a/selfdrive/sensord/sensors/i2c_sensor.cc b/selfdrive/sensord/sensors/i2c_sensor.cc new file mode 100644 index 000000000..40dfa4a73 --- /dev/null +++ b/selfdrive/sensord/sensors/i2c_sensor.cc @@ -0,0 +1,28 @@ +#include "i2c_sensor.h" + +int16_t read_12_bit(uint8_t lsb, uint8_t msb) { + uint16_t combined = (uint16_t(msb) << 8) | uint16_t(lsb & 0xF0); + return int16_t(combined) / (1 << 4); +} + +int16_t read_16_bit(uint8_t lsb, uint8_t msb) { + uint16_t combined = (uint16_t(msb) << 8) | uint16_t(lsb); + return int16_t(combined); +} + +int32_t read_20_bit(uint8_t b2, uint8_t b1, uint8_t b0) { + uint32_t combined = (uint32_t(b0) << 16) | (uint32_t(b1) << 8) | uint32_t(b2); + return int32_t(combined) / (1 << 4); +} + + +I2CSensor::I2CSensor(I2CBus *bus) : bus(bus) { +} + +int I2CSensor::read_register(uint register_address, uint8_t *buffer, uint8_t len) { + return bus->read_register(get_device_address(), register_address, buffer, len); +} + +int I2CSensor::set_register(uint register_address, uint8_t data) { + return bus->set_register(get_device_address(), register_address, data); +} diff --git a/selfdrive/sensord/sensors/i2c_sensor.h b/selfdrive/sensord/sensors/i2c_sensor.h new file mode 100644 index 000000000..83c66eac8 --- /dev/null +++ b/selfdrive/sensord/sensors/i2c_sensor.h @@ -0,0 +1,26 @@ +#pragma once + +#include + +#include "cereal/gen/cpp/log.capnp.h" +#include "selfdrive/common/i2c.h" +#include "selfdrive/sensord/sensors/constants.h" +#include "selfdrive/sensord/sensors/sensor.h" + +int16_t read_12_bit(uint8_t lsb, uint8_t msb); +int16_t read_16_bit(uint8_t lsb, uint8_t msb); +int32_t read_20_bit(uint8_t b2, uint8_t b1, uint8_t b0); + + +class I2CSensor : public Sensor { +private: + I2CBus *bus; + virtual uint8_t get_device_address() = 0; + +public: + I2CSensor(I2CBus *bus); + int read_register(uint register_address, uint8_t *buffer, uint8_t len); + int set_register(uint register_address, uint8_t data); + virtual int init() = 0; + virtual void get_event(cereal::SensorEventData::Builder &event) = 0; +}; diff --git a/selfdrive/sensord/sensors/light_sensor.cc b/selfdrive/sensord/sensors/light_sensor.cc new file mode 100644 index 000000000..4d00d37bd --- /dev/null +++ b/selfdrive/sensord/sensors/light_sensor.cc @@ -0,0 +1,22 @@ +#include "light_sensor.h" + +#include + +#include "selfdrive/common/timing.h" +#include "selfdrive/sensord/sensors/constants.h" + +void LightSensor::get_event(cereal::SensorEventData::Builder &event) { + uint64_t start_time = nanos_since_boot(); + file.clear(); + file.seekg(0); + + int value; + file >> value; + + event.setSource(cereal::SensorEventData::SensorSource::RPR0521); + event.setVersion(1); + event.setSensor(SENSOR_LIGHT); + event.setType(SENSOR_TYPE_LIGHT); + event.setTimestamp(start_time); + event.setLight(value); +} diff --git a/selfdrive/sensord/sensors/light_sensor.h b/selfdrive/sensord/sensors/light_sensor.h new file mode 100644 index 000000000..faf901d41 --- /dev/null +++ b/selfdrive/sensord/sensors/light_sensor.h @@ -0,0 +1,8 @@ +#pragma once +#include "file_sensor.h" + +class LightSensor : public FileSensor { +public: + LightSensor(std::string filename) : FileSensor(filename){}; + void get_event(cereal::SensorEventData::Builder &event); +}; diff --git a/selfdrive/sensord/sensors/lsm6ds3_accel.cc b/selfdrive/sensord/sensors/lsm6ds3_accel.cc new file mode 100644 index 000000000..83222858e --- /dev/null +++ b/selfdrive/sensord/sensors/lsm6ds3_accel.cc @@ -0,0 +1,64 @@ +#include "lsm6ds3_accel.h" + +#include + +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/timing.h" + +LSM6DS3_Accel::LSM6DS3_Accel(I2CBus *bus) : I2CSensor(bus) {} + +int LSM6DS3_Accel::init() { + int ret = 0; + uint8_t buffer[1]; + + ret = read_register(LSM6DS3_ACCEL_I2C_REG_ID, buffer, 1); + if(ret < 0) { + LOGE("Reading chip ID failed: %d", ret); + goto fail; + } + + if(buffer[0] != LSM6DS3_ACCEL_CHIP_ID && buffer[0] != LSM6DS3TRC_ACCEL_CHIP_ID) { + LOGE("Chip ID wrong. Got: %d, Expected %d", buffer[0], LSM6DS3_ACCEL_CHIP_ID); + ret = -1; + goto fail; + } + + if (buffer[0] == LSM6DS3TRC_ACCEL_CHIP_ID) { + source = cereal::SensorEventData::SensorSource::LSM6DS3TRC; + } + + // TODO: set scale and bandwith. Default is +- 2G, 50 Hz + ret = set_register(LSM6DS3_ACCEL_I2C_REG_CTRL1_XL, LSM6DS3_ACCEL_ODR_104HZ); + if (ret < 0) { + goto fail; + } + + +fail: + return ret; +} + +void LSM6DS3_Accel::get_event(cereal::SensorEventData::Builder &event) { + + uint64_t start_time = nanos_since_boot(); + uint8_t buffer[6]; + int len = read_register(LSM6DS3_ACCEL_I2C_REG_OUTX_L_XL, buffer, sizeof(buffer)); + assert(len == sizeof(buffer)); + + float scale = 9.81 * 2.0f / (1 << 15); + float x = read_16_bit(buffer[0], buffer[1]) * scale; + float y = read_16_bit(buffer[2], buffer[3]) * scale; + float z = read_16_bit(buffer[4], buffer[5]) * scale; + + event.setSource(source); + event.setVersion(1); + event.setSensor(SENSOR_ACCELEROMETER); + event.setType(SENSOR_TYPE_ACCELEROMETER); + event.setTimestamp(start_time); + + float xyz[] = {y, -x, z}; + auto svec = event.initAcceleration(); + svec.setV(xyz); + svec.setStatus(true); + +} diff --git a/selfdrive/sensord/sensors/lsm6ds3_accel.h b/selfdrive/sensord/sensors/lsm6ds3_accel.h new file mode 100644 index 000000000..4a6b68744 --- /dev/null +++ b/selfdrive/sensord/sensors/lsm6ds3_accel.h @@ -0,0 +1,26 @@ +#pragma once + +#include "selfdrive/sensord/sensors/i2c_sensor.h" + +// Address of the chip on the bus +#define LSM6DS3_ACCEL_I2C_ADDR 0x6A + +// Registers of the chip +#define LSM6DS3_ACCEL_I2C_REG_ID 0x0F +#define LSM6DS3_ACCEL_I2C_REG_CTRL1_XL 0x10 +#define LSM6DS3_ACCEL_I2C_REG_OUTX_L_XL 0x28 + +// Constants +#define LSM6DS3_ACCEL_CHIP_ID 0x69 +#define LSM6DS3TRC_ACCEL_CHIP_ID 0x6A +#define LSM6DS3_ACCEL_ODR_104HZ (0b0100 << 4) + + +class LSM6DS3_Accel : public I2CSensor { + uint8_t get_device_address() {return LSM6DS3_ACCEL_I2C_ADDR;} + cereal::SensorEventData::SensorSource source = cereal::SensorEventData::SensorSource::LSM6DS3; +public: + LSM6DS3_Accel(I2CBus *bus); + int init(); + void get_event(cereal::SensorEventData::Builder &event); +}; diff --git a/selfdrive/sensord/sensors/lsm6ds3_gyro.cc b/selfdrive/sensord/sensors/lsm6ds3_gyro.cc new file mode 100644 index 000000000..6732ead0f --- /dev/null +++ b/selfdrive/sensord/sensors/lsm6ds3_gyro.cc @@ -0,0 +1,68 @@ +#include "lsm6ds3_gyro.h" + +#include +#include + +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/timing.h" + +#define DEG2RAD(x) ((x) * M_PI / 180.0) + + +LSM6DS3_Gyro::LSM6DS3_Gyro(I2CBus *bus) : I2CSensor(bus) {} + +int LSM6DS3_Gyro::init() { + int ret = 0; + uint8_t buffer[1]; + + ret = read_register(LSM6DS3_GYRO_I2C_REG_ID, buffer, 1); + if(ret < 0) { + LOGE("Reading chip ID failed: %d", ret); + goto fail; + } + + if(buffer[0] != LSM6DS3_GYRO_CHIP_ID && buffer[0] != LSM6DS3TRC_GYRO_CHIP_ID) { + LOGE("Chip ID wrong. Got: %d, Expected %d", buffer[0], LSM6DS3_GYRO_CHIP_ID); + ret = -1; + goto fail; + } + + if (buffer[0] == LSM6DS3TRC_GYRO_CHIP_ID) { + source = cereal::SensorEventData::SensorSource::LSM6DS3TRC; + } + + // TODO: set scale. Default is +- 250 deg/s + ret = set_register(LSM6DS3_GYRO_I2C_REG_CTRL2_G, LSM6DS3_GYRO_ODR_104HZ); + if (ret < 0) { + goto fail; + } + + +fail: + return ret; +} + +void LSM6DS3_Gyro::get_event(cereal::SensorEventData::Builder &event) { + + uint64_t start_time = nanos_since_boot(); + uint8_t buffer[6]; + int len = read_register(LSM6DS3_GYRO_I2C_REG_OUTX_L_G, buffer, sizeof(buffer)); + assert(len == sizeof(buffer)); + + float scale = 8.75 / 1000.0; + float x = DEG2RAD(read_16_bit(buffer[0], buffer[1]) * scale); + float y = DEG2RAD(read_16_bit(buffer[2], buffer[3]) * scale); + float z = DEG2RAD(read_16_bit(buffer[4], buffer[5]) * scale); + + event.setSource(source); + event.setVersion(2); + event.setSensor(SENSOR_GYRO_UNCALIBRATED); + event.setType(SENSOR_TYPE_GYROSCOPE_UNCALIBRATED); + event.setTimestamp(start_time); + + float xyz[] = {y, -x, z}; + auto svec = event.initGyroUncalibrated(); + svec.setV(xyz); + svec.setStatus(true); + +} diff --git a/selfdrive/sensord/sensors/lsm6ds3_gyro.h b/selfdrive/sensord/sensors/lsm6ds3_gyro.h new file mode 100644 index 000000000..d7e8f0025 --- /dev/null +++ b/selfdrive/sensord/sensors/lsm6ds3_gyro.h @@ -0,0 +1,26 @@ +#pragma once + +#include "selfdrive/sensord/sensors/i2c_sensor.h" + +// Address of the chip on the bus +#define LSM6DS3_GYRO_I2C_ADDR 0x6A + +// Registers of the chip +#define LSM6DS3_GYRO_I2C_REG_ID 0x0F +#define LSM6DS3_GYRO_I2C_REG_CTRL2_G 0x11 +#define LSM6DS3_GYRO_I2C_REG_OUTX_L_G 0x22 + +// Constants +#define LSM6DS3_GYRO_CHIP_ID 0x69 +#define LSM6DS3TRC_GYRO_CHIP_ID 0x6A +#define LSM6DS3_GYRO_ODR_104HZ (0b0100 << 4) + + +class LSM6DS3_Gyro : public I2CSensor { + uint8_t get_device_address() {return LSM6DS3_GYRO_I2C_ADDR;} + cereal::SensorEventData::SensorSource source = cereal::SensorEventData::SensorSource::LSM6DS3; +public: + LSM6DS3_Gyro(I2CBus *bus); + int init(); + void get_event(cereal::SensorEventData::Builder &event); +}; diff --git a/selfdrive/sensord/sensors/lsm6ds3_temp.cc b/selfdrive/sensord/sensors/lsm6ds3_temp.cc new file mode 100644 index 000000000..6b093fce0 --- /dev/null +++ b/selfdrive/sensord/sensors/lsm6ds3_temp.cc @@ -0,0 +1,50 @@ +#include "lsm6ds3_temp.h" + +#include + +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/timing.h" + +LSM6DS3_Temp::LSM6DS3_Temp(I2CBus *bus) : I2CSensor(bus) {} + +int LSM6DS3_Temp::init() { + int ret = 0; + uint8_t buffer[1]; + + ret = read_register(LSM6DS3_TEMP_I2C_REG_ID, buffer, 1); + if(ret < 0) { + LOGE("Reading chip ID failed: %d", ret); + goto fail; + } + + if(buffer[0] != LSM6DS3_TEMP_CHIP_ID && buffer[0] != LSM6DS3TRC_TEMP_CHIP_ID) { + LOGE("Chip ID wrong. Got: %d, Expected %d", buffer[0], LSM6DS3_TEMP_CHIP_ID); + ret = -1; + goto fail; + } + + if (buffer[0] == LSM6DS3TRC_TEMP_CHIP_ID) { + source = cereal::SensorEventData::SensorSource::LSM6DS3TRC; + } + +fail: + return ret; +} + +void LSM6DS3_Temp::get_event(cereal::SensorEventData::Builder &event) { + + uint64_t start_time = nanos_since_boot(); + uint8_t buffer[2]; + int len = read_register(LSM6DS3_TEMP_I2C_REG_OUT_TEMP_L, buffer, sizeof(buffer)); + assert(len == sizeof(buffer)); + + float scale = (source == cereal::SensorEventData::SensorSource::LSM6DS3TRC) ? 256.0f : 16.0f; + float temp = 25.0f + read_16_bit(buffer[0], buffer[1]) / scale; + + event.setSource(source); + event.setVersion(1); + event.setType(SENSOR_TYPE_AMBIENT_TEMPERATURE); + event.setTimestamp(start_time); + event.setTemperature(temp); + +} diff --git a/selfdrive/sensord/sensors/lsm6ds3_temp.h b/selfdrive/sensord/sensors/lsm6ds3_temp.h new file mode 100644 index 000000000..8188f4670 --- /dev/null +++ b/selfdrive/sensord/sensors/lsm6ds3_temp.h @@ -0,0 +1,25 @@ +#pragma once + +#include "selfdrive/sensord/sensors/i2c_sensor.h" + +// Address of the chip on the bus +#define LSM6DS3_TEMP_I2C_ADDR 0x6A + +// Registers of the chip +#define LSM6DS3_TEMP_I2C_REG_ID 0x0F +#define LSM6DS3_TEMP_I2C_REG_OUT_TEMP_L 0x20 + +// Constants +#define LSM6DS3_TEMP_CHIP_ID 0x69 +#define LSM6DS3TRC_TEMP_CHIP_ID 0x6A + + +class LSM6DS3_Temp : public I2CSensor { + uint8_t get_device_address() {return LSM6DS3_TEMP_I2C_ADDR;} + cereal::SensorEventData::SensorSource source = cereal::SensorEventData::SensorSource::LSM6DS3; + +public: + LSM6DS3_Temp(I2CBus *bus); + int init(); + void get_event(cereal::SensorEventData::Builder &event); +}; diff --git a/selfdrive/sensord/sensors/mmc5603nj_magn.cc b/selfdrive/sensord/sensors/mmc5603nj_magn.cc new file mode 100644 index 000000000..68878867e --- /dev/null +++ b/selfdrive/sensord/sensors/mmc5603nj_magn.cc @@ -0,0 +1,77 @@ +#include "mmc5603nj_magn.h" + +#include + +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/timing.h" + +MMC5603NJ_Magn::MMC5603NJ_Magn(I2CBus *bus) : I2CSensor(bus) {} + +int MMC5603NJ_Magn::init() { + int ret = 0; + uint8_t buffer[1]; + + ret = read_register(MMC5603NJ_I2C_REG_ID, buffer, 1); + if(ret < 0) { + LOGE("Reading chip ID failed: %d", ret); + goto fail; + } + + if(buffer[0] != MMC5603NJ_CHIP_ID) { + LOGE("Chip ID wrong. Got: %d, Expected %d", buffer[0], MMC5603NJ_CHIP_ID); + ret = -1; + goto fail; + } + + // Set 100 Hz + ret = set_register(MMC5603NJ_I2C_REG_ODR, 100); + if (ret < 0) { + goto fail; + } + + // Set BW to 0b01 for 1-150 Hz operation + ret = set_register(MMC5603NJ_I2C_REG_INTERNAL_1, 0b01); + if (ret < 0) { + goto fail; + } + + // Set compute measurement rate + ret = set_register(MMC5603NJ_I2C_REG_INTERNAL_0, MMC5603NJ_CMM_FREQ_EN | MMC5603NJ_AUTO_SR_EN); + if (ret < 0) { + goto fail; + } + + // Enable continuous mode, set every 100 measurements + ret = set_register(MMC5603NJ_I2C_REG_INTERNAL_2, MMC5603NJ_CMM_EN | MMC5603NJ_EN_PRD_SET | 0b11); + if (ret < 0) { + goto fail; + } + +fail: + return ret; +} + +void MMC5603NJ_Magn::get_event(cereal::SensorEventData::Builder &event) { + + uint64_t start_time = nanos_since_boot(); + uint8_t buffer[9]; + int len = read_register(MMC5603NJ_I2C_REG_XOUT0, buffer, sizeof(buffer)); + assert(len == sizeof(buffer)); + + float scale = 1.0 / 16384.0; + float x = read_20_bit(buffer[6], buffer[1], buffer[0]) * scale; + float y = read_20_bit(buffer[7], buffer[3], buffer[2]) * scale; + float z = read_20_bit(buffer[8], buffer[5], buffer[4]) * scale; + + event.setSource(cereal::SensorEventData::SensorSource::MMC5603NJ); + event.setVersion(1); + event.setSensor(SENSOR_MAGNETOMETER_UNCALIBRATED); + event.setType(SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED); + event.setTimestamp(start_time); + + float xyz[] = {x, y, z}; + auto svec = event.initMagneticUncalibrated(); + svec.setV(xyz); + svec.setStatus(true); + +} diff --git a/selfdrive/sensord/sensors/mmc5603nj_magn.h b/selfdrive/sensord/sensors/mmc5603nj_magn.h new file mode 100644 index 000000000..58840bbf2 --- /dev/null +++ b/selfdrive/sensord/sensors/mmc5603nj_magn.h @@ -0,0 +1,29 @@ +#pragma once + +#include "selfdrive/sensord/sensors/i2c_sensor.h" + +// Address of the chip on the bus +#define MMC5603NJ_I2C_ADDR 0x30 + +// Registers of the chip +#define MMC5603NJ_I2C_REG_XOUT0 0x00 +#define MMC5603NJ_I2C_REG_ODR 0x1A +#define MMC5603NJ_I2C_REG_INTERNAL_0 0x1B +#define MMC5603NJ_I2C_REG_INTERNAL_1 0x1C +#define MMC5603NJ_I2C_REG_INTERNAL_2 0x1D +#define MMC5603NJ_I2C_REG_ID 0x39 + +// Constants +#define MMC5603NJ_CHIP_ID 0x10 +#define MMC5603NJ_CMM_FREQ_EN (1 << 7) +#define MMC5603NJ_AUTO_SR_EN (1 << 5) +#define MMC5603NJ_CMM_EN (1 << 4) +#define MMC5603NJ_EN_PRD_SET (1 << 3) + +class MMC5603NJ_Magn : public I2CSensor { + uint8_t get_device_address() {return MMC5603NJ_I2C_ADDR;} +public: + MMC5603NJ_Magn(I2CBus *bus); + int init(); + void get_event(cereal::SensorEventData::Builder &event); +}; diff --git a/selfdrive/sensord/sensors/sensor.h b/selfdrive/sensord/sensors/sensor.h new file mode 100644 index 000000000..3fb58ad2a --- /dev/null +++ b/selfdrive/sensord/sensors/sensor.h @@ -0,0 +1,10 @@ +#pragma once + +#include "cereal/gen/cpp/log.capnp.h" + +class Sensor { +public: + virtual ~Sensor() {}; + virtual int init() = 0; + virtual void get_event(cereal::SensorEventData::Builder &event) = 0; +}; diff --git a/selfdrive/sensord/sensors_qcom.cc b/selfdrive/sensord/sensors_qcom.cc new file mode 100644 index 000000000..fcdb9a72d --- /dev/null +++ b/selfdrive/sensord/sensors_qcom.cc @@ -0,0 +1,228 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "cereal/messaging/messaging.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/timing.h" +#include "selfdrive/common/util.h" + +// ACCELEROMETER_UNCALIBRATED is only in Android O +// https://developer.android.com/reference/android/hardware/Sensor.html#STRING_TYPE_ACCELEROMETER_UNCALIBRATED + +#define SENSOR_ACCELEROMETER 1 +#define SENSOR_MAGNETOMETER 2 +#define SENSOR_GYRO 4 +#define SENSOR_MAGNETOMETER_UNCALIBRATED 3 +#define SENSOR_GYRO_UNCALIBRATED 5 +#define SENSOR_PROXIMITY 6 +#define SENSOR_LIGHT 7 + +ExitHandler do_exit; +volatile sig_atomic_t re_init_sensors = 0; + +namespace { + +void sigpipe_handler(int sig) { + LOGE("SIGPIPE received"); + re_init_sensors = true; +} + +void sensor_loop() { + LOG("*** sensor loop"); + + uint64_t frame = 0; + bool low_power_mode = false; + + while (!do_exit) { + SubMaster sm({"deviceState"}); + PubMaster pm({"sensorEvents"}); + + struct sensors_poll_device_t* device; + struct sensors_module_t* module; + + hw_get_module(SENSORS_HARDWARE_MODULE_ID, (hw_module_t const**)&module); + sensors_open(&module->common, &device); + + // required + struct sensor_t const* list; + int count = module->get_sensors_list(module, &list); + LOG("%d sensors found", count); + + if (getenv("SENSOR_TEST")) { + exit(count); + } + + for (int i = 0; i < count; i++) { + LOGD("sensor %4d: %4d %60s %d-%ld us", i, list[i].handle, list[i].name, list[i].minDelay, list[i].maxDelay); + } + + std::set sensor_types = { + SENSOR_TYPE_ACCELEROMETER, + SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED, + SENSOR_TYPE_MAGNETIC_FIELD, + SENSOR_TYPE_GYROSCOPE_UNCALIBRATED, + SENSOR_TYPE_GYROSCOPE, + SENSOR_TYPE_PROXIMITY, + SENSOR_TYPE_LIGHT, + }; + + std::map sensors = { + {SENSOR_GYRO_UNCALIBRATED, ms2ns(10)}, + {SENSOR_MAGNETOMETER_UNCALIBRATED, ms2ns(100)}, + {SENSOR_ACCELEROMETER, ms2ns(10)}, + {SENSOR_GYRO, ms2ns(10)}, + {SENSOR_MAGNETOMETER, ms2ns(100)}, + {SENSOR_PROXIMITY, ms2ns(100)}, + {SENSOR_LIGHT, ms2ns(100)} + }; + + // sensors needed while offroad + std::set offroad_sensors = { + SENSOR_LIGHT, + SENSOR_ACCELEROMETER, + SENSOR_GYRO_UNCALIBRATED, + }; + + // init all the sensors + for (auto &s : sensors) { + device->activate(device, s.first, 0); + device->activate(device, s.first, 1); + device->setDelay(device, s.first, s.second); + } + + // TODO: why is this 16? + static const size_t numEvents = 16; + sensors_event_t buffer[numEvents]; + + while (!do_exit) { + int n = device->poll(device, buffer, numEvents); + if (n == 0) continue; + if (n < 0) { + LOG("sensor_loop poll failed: %d", n); + continue; + } + + int log_events = 0; + for (int i=0; i < n; i++) { + if (sensor_types.find(buffer[i].type) != sensor_types.end()) { + log_events++; + } + } + + MessageBuilder msg; + auto sensor_events = msg.initEvent().initSensorEvents(log_events); + + int log_i = 0; + for (int i = 0; i < n; i++) { + + const sensors_event_t& data = buffer[i]; + + if (sensor_types.find(data.type) == sensor_types.end()) { + continue; + } + + auto log_event = sensor_events[log_i]; + log_event.setSource(cereal::SensorEventData::SensorSource::ANDROID); + log_event.setVersion(data.version); + log_event.setSensor(data.sensor); + log_event.setType(data.type); + log_event.setTimestamp(data.timestamp); + + switch (data.type) { + case SENSOR_TYPE_ACCELEROMETER: { + auto svec = log_event.initAcceleration(); + svec.setV(data.acceleration.v); + svec.setStatus(data.acceleration.status); + break; + } + case SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED: { + auto svec = log_event.initMagneticUncalibrated(); + // assuming the uncalib and bias floats are contiguous in memory + kj::ArrayPtr vs(&data.uncalibrated_magnetic.uncalib[0], 6); + svec.setV(vs); + break; + } + case SENSOR_TYPE_MAGNETIC_FIELD: { + auto svec = log_event.initMagnetic(); + svec.setV(data.magnetic.v); + svec.setStatus(data.magnetic.status); + break; + } + case SENSOR_TYPE_GYROSCOPE_UNCALIBRATED: { + auto svec = log_event.initGyroUncalibrated(); + // assuming the uncalib and bias floats are contiguous in memory + kj::ArrayPtr vs(&data.uncalibrated_gyro.uncalib[0], 6); + svec.setV(vs); + break; + } + case SENSOR_TYPE_GYROSCOPE: { + auto svec = log_event.initGyro(); + svec.setV(data.gyro.v); + svec.setStatus(data.gyro.status); + break; + } + case SENSOR_TYPE_PROXIMITY: { + log_event.setProximity(data.distance); + break; + } + case SENSOR_TYPE_LIGHT: + log_event.setLight(data.light); + break; + } + + log_i++; + } + + pm.send("sensorEvents", msg); + + if (re_init_sensors) { + LOGE("Resetting sensors"); + re_init_sensors = false; + break; + } + + // Check whether to go into low power mode at 5Hz + if (frame % 20 == 0) { + sm.update(0); + bool offroad = !sm["deviceState"].getDeviceState().getStarted(); + if (low_power_mode != offroad) { + for (auto &s : sensors) { + device->activate(device, s.first, 0); + if (!offroad || offroad_sensors.find(s.first) != offroad_sensors.end()) { + device->activate(device, s.first, 1); + } + } + low_power_mode = offroad; + } + } + + frame++; + } + sensors_close(device); + } +} + +}// Namespace end + +int main(int argc, char *argv[]) { + setpriority(PRIO_PROCESS, 0, -18); + signal(SIGPIPE, (sighandler_t)sigpipe_handler); + + sensor_loop(); + + return 0; +} diff --git a/selfdrive/sensord/sensors_qcom2.cc b/selfdrive/sensord/sensors_qcom2.cc new file mode 100644 index 000000000..c3e5bbcdf --- /dev/null +++ b/selfdrive/sensord/sensors_qcom2.cc @@ -0,0 +1,116 @@ +#include + +#include +#include +#include + +#include "cereal/messaging/messaging.h" +#include "selfdrive/common/i2c.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/timing.h" +#include "selfdrive/common/util.h" +#include "selfdrive/sensord/sensors/bmx055_accel.h" +#include "selfdrive/sensord/sensors/bmx055_gyro.h" +#include "selfdrive/sensord/sensors/bmx055_magn.h" +#include "selfdrive/sensord/sensors/bmx055_temp.h" +#include "selfdrive/sensord/sensors/constants.h" +#include "selfdrive/sensord/sensors/light_sensor.h" +#include "selfdrive/sensord/sensors/lsm6ds3_accel.h" +#include "selfdrive/sensord/sensors/lsm6ds3_gyro.h" +#include "selfdrive/sensord/sensors/lsm6ds3_temp.h" +#include "selfdrive/sensord/sensors/mmc5603nj_magn.h" +#include "selfdrive/sensord/sensors/sensor.h" + +#define I2C_BUS_IMU 1 + +ExitHandler do_exit; + +int sensor_loop() { + I2CBus *i2c_bus_imu; + + try { + i2c_bus_imu = new I2CBus(I2C_BUS_IMU); + } catch (std::exception &e) { + LOGE("I2CBus init failed"); + return -1; + } + + BMX055_Accel bmx055_accel(i2c_bus_imu); + BMX055_Gyro bmx055_gyro(i2c_bus_imu); + BMX055_Magn bmx055_magn(i2c_bus_imu); + BMX055_Temp bmx055_temp(i2c_bus_imu); + + LSM6DS3_Accel lsm6ds3_accel(i2c_bus_imu); + LSM6DS3_Gyro lsm6ds3_gyro(i2c_bus_imu); + LSM6DS3_Temp lsm6ds3_temp(i2c_bus_imu); + + MMC5603NJ_Magn mmc5603nj_magn(i2c_bus_imu); + + LightSensor light("/sys/class/i2c-adapter/i2c-2/2-0038/iio:device1/in_intensity_both_raw"); + + // Sensor init + std::vector> sensors_init; // Sensor, required + sensors_init.push_back({&bmx055_accel, false}); + sensors_init.push_back({&bmx055_gyro, false}); + sensors_init.push_back({&bmx055_magn, false}); + sensors_init.push_back({&bmx055_temp, false}); + + sensors_init.push_back({&lsm6ds3_accel, true}); + sensors_init.push_back({&lsm6ds3_gyro, true}); + sensors_init.push_back({&lsm6ds3_temp, true}); + + sensors_init.push_back({&mmc5603nj_magn, false}); + + sensors_init.push_back({&light, true}); + + bool has_magnetometer = false; + + // Initialize sensors + std::vector sensors; + for (auto &sensor : sensors_init) { + int err = sensor.first->init(); + if (err < 0) { + // Fail on required sensors + if (sensor.second) { + LOGE("Error initializing sensors"); + return -1; + } + } else { + if (sensor.first == &bmx055_magn || sensor.first == &mmc5603nj_magn) { + has_magnetometer = true; + } + sensors.push_back(sensor.first); + } + } + + if (!has_magnetometer) { + LOGE("No magnetometer present"); + return -1; + } + + PubMaster pm({"sensorEvents"}); + + while (!do_exit) { + std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now(); + + const int num_events = sensors.size(); + MessageBuilder msg; + auto sensor_events = msg.initEvent().initSensorEvents(num_events); + + for (int i = 0; i < num_events; i++) { + auto event = sensor_events[i]; + sensors[i]->get_event(event); + } + + pm.send("sensorEvents", msg); + + std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now(); + std::this_thread::sleep_for(std::chrono::milliseconds(10) - (end - begin)); + } + return 0; +} + +int main(int argc, char *argv[]) { + setpriority(PRIO_PROCESS, 0, -18); + return sensor_loop(); +} diff --git a/selfdrive/sentry.py b/selfdrive/sentry.py new file mode 100644 index 000000000..5f22bf18e --- /dev/null +++ b/selfdrive/sentry.py @@ -0,0 +1,75 @@ +"""Install exception handler for process crash.""" +import sentry_sdk +from enum import Enum +from sentry_sdk.integrations.threading import ThreadingIntegration + +from common.params import Params +from selfdrive.athena.registration import is_registered_device +from selfdrive.hardware import HARDWARE, PC +from selfdrive.swaglog import cloudlog +from selfdrive.version import get_branch, get_commit, get_origin, get_version, \ + is_comma_remote, is_dirty, is_tested_branch + + +class SentryProject(Enum): + # python project + SELFDRIVE = "https://6f3c7076c1e14b2aa10f5dde6dda0cc4@o33823.ingest.sentry.io/77924" + # native project + SELFDRIVE_NATIVE = "https://3e4b586ed21a4479ad5d85083b639bc6@o33823.ingest.sentry.io/157615" + + +def report_tombstone(fn: str, message: str, contents: str) -> None: + cloudlog.error({'tombstone': message}) + + with sentry_sdk.configure_scope() as scope: + scope.set_extra("tombstone_fn", fn) + scope.set_extra("tombstone", contents) + sentry_sdk.capture_message(message=message) + sentry_sdk.flush() + + +def capture_exception(*args, **kwargs) -> None: + cloudlog.error("crash", exc_info=kwargs.get('exc_info', 1)) + + try: + sentry_sdk.capture_exception(*args, **kwargs) + sentry_sdk.flush() # https://github.com/getsentry/sentry-python/issues/291 + except Exception: + cloudlog.exception("sentry exception") + + +def set_tag(key: str, value: str) -> None: + sentry_sdk.set_tag(key, value) + + +def init(project: SentryProject) -> None: + # forks like to mess with this, so double check + comma_remote = is_comma_remote() and "commaai" in get_origin(default="") + if not comma_remote or not is_registered_device() or PC: + return + + env = "release" if is_tested_branch() else "master" + dongle_id = Params().get("DongleId", encoding='utf-8') + + integrations = [] + if project == SentryProject.SELFDRIVE: + integrations.append(ThreadingIntegration(propagate_hub=True)) + else: + sentry_sdk.utils.MAX_STRING_LENGTH = 8192 + + sentry_sdk.init(project.value, + default_integrations=False, + release=get_version(), + integrations=integrations, + traces_sample_rate=1.0, + environment=env) + + sentry_sdk.set_user({"id": dongle_id}) + sentry_sdk.set_tag("dirty", is_dirty()) + sentry_sdk.set_tag("origin", get_origin()) + sentry_sdk.set_tag("branch", get_branch()) + sentry_sdk.set_tag("commit", get_commit()) + sentry_sdk.set_tag("device", HARDWARE.get_device_type()) + + if project == SentryProject.SELFDRIVE: + sentry_sdk.Hub.current.start_session() diff --git a/selfdrive/statsd.py b/selfdrive/statsd.py new file mode 100755 index 000000000..2e62e3253 --- /dev/null +++ b/selfdrive/statsd.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python3 +import os +import zmq +import time +from pathlib import Path +from datetime import datetime, timezone +from typing import NoReturn + +from common.params import Params +from cereal.messaging import SubMaster +from selfdrive.swaglog import cloudlog +from selfdrive.hardware import HARDWARE +from common.file_helpers import atomic_write_in_dir +from selfdrive.version import get_normalized_origin, get_short_branch, get_short_version, is_dirty +from selfdrive.loggerd.config import STATS_DIR, STATS_DIR_FILE_LIMIT, STATS_SOCKET, STATS_FLUSH_TIME_S + + +class METRIC_TYPE: + GAUGE = 'g' + +class StatLog: + def __init__(self): + self.pid = None + + def connect(self) -> None: + self.zctx = zmq.Context() + self.sock = self.zctx.socket(zmq.PUSH) + self.sock.setsockopt(zmq.LINGER, 10) + self.sock.connect(STATS_SOCKET) + self.pid = os.getpid() + + def _send(self, metric: str) -> None: + if os.getpid() != self.pid: + self.connect() + + try: + self.sock.send_string(metric, zmq.NOBLOCK) + except zmq.error.Again: + # drop :/ + pass + + def gauge(self, name: str, value: float) -> None: + self._send(f"{name}:{value}|{METRIC_TYPE.GAUGE}") + + +def main() -> NoReturn: + dongle_id = Params().get("DongleId", encoding='utf-8') + def get_influxdb_line(measurement: str, value: float, timestamp: datetime, tags: dict) -> str: + res = f"{measurement}" + for k, v in tags.items(): + res += f",{k}={str(v)}" + res += f" value={value},dongle_id=\"{dongle_id}\" {int(timestamp.timestamp() * 1e9)}\n" + return res + + # open statistics socket + ctx = zmq.Context().instance() + sock = ctx.socket(zmq.PULL) + sock.bind(STATS_SOCKET) + + # initialize stats directory + Path(STATS_DIR).mkdir(parents=True, exist_ok=True) + + # initialize tags + tags = { + 'started': False, + 'version': get_short_version(), + 'branch': get_short_branch(), + 'dirty': is_dirty(), + 'origin': get_normalized_origin(), + 'deviceType': HARDWARE.get_device_type(), + } + + # subscribe to deviceState for started state + sm = SubMaster(['deviceState']) + + last_flush_time = time.monotonic() + gauges = {} + while True: + started_prev = sm['deviceState'].started + sm.update() + + # Update metrics + while True: + try: + metric = sock.recv_string(zmq.NOBLOCK) + try: + metric_type = metric.split('|')[1] + metric_name = metric.split(':')[0] + metric_value = metric.split('|')[0].split(':')[1] + + if metric_type == METRIC_TYPE.GAUGE: + gauges[metric_name] = metric_value + else: + cloudlog.event("unknown metric type", metric_type=metric_type) + except Exception: + cloudlog.event("malformed metric", metric=metric) + except zmq.error.Again: + break + + # flush when started state changes or after FLUSH_TIME_S + if (time.monotonic() > last_flush_time + STATS_FLUSH_TIME_S) or (sm['deviceState'].started != started_prev): + result = "" + current_time = datetime.utcnow().replace(tzinfo=timezone.utc) + tags['started'] = sm['deviceState'].started + + for gauge_key in gauges: + result += get_influxdb_line(f"gauge.{gauge_key}", gauges[gauge_key], current_time, tags) + + # clear intermediate data + gauges = {} + last_flush_time = time.monotonic() + + # check that we aren't filling up the drive + if len(os.listdir(STATS_DIR)) < STATS_DIR_FILE_LIMIT: + if len(result) > 0: + stats_path = os.path.join(STATS_DIR, str(int(current_time.timestamp()))) + with atomic_write_in_dir(stats_path) as f: + f.write(result) + else: + cloudlog.error("stats dir full") + + +if __name__ == "__main__": + main() +else: + statlog = StatLog() diff --git a/selfdrive/swaglog.py b/selfdrive/swaglog.py new file mode 100644 index 000000000..a987bfe72 --- /dev/null +++ b/selfdrive/swaglog.py @@ -0,0 +1,122 @@ +import logging +import os +import time +from pathlib import Path +from logging.handlers import BaseRotatingHandler + +import zmq + +from common.logging_extra import SwagLogger, SwagFormatter, SwagLogFileFormatter +from selfdrive.hardware import PC + +if PC: + SWAGLOG_DIR = os.path.join(str(Path.home()), ".comma", "log") +else: + SWAGLOG_DIR = "/data/log/" + +def get_file_handler(): + Path(SWAGLOG_DIR).mkdir(parents=True, exist_ok=True) + base_filename = os.path.join(SWAGLOG_DIR, "swaglog") + handler = SwaglogRotatingFileHandler(base_filename) + return handler + +class SwaglogRotatingFileHandler(BaseRotatingHandler): + def __init__(self, base_filename, interval=60, max_bytes=1024*256, backup_count=2500, encoding=None): + super().__init__(base_filename, mode="a", encoding=encoding, delay=True) + self.base_filename = base_filename + self.interval = interval # seconds + self.max_bytes = max_bytes + self.backup_count = backup_count + self.log_files = self.get_existing_logfiles() + log_indexes = [f.split(".")[-1] for f in self.log_files] + self.last_file_idx = max([int(i) for i in log_indexes if i.isdigit()] or [-1]) + self.last_rollover = None + self.doRollover() + + def _open(self): + self.last_rollover = time.monotonic() + self.last_file_idx += 1 + next_filename = f"{self.base_filename}.{self.last_file_idx:010}" + stream = open(next_filename, self.mode, encoding=self.encoding) + self.log_files.insert(0, next_filename) + return stream + + def get_existing_logfiles(self): + log_files = list() + base_dir = os.path.dirname(self.base_filename) + for fn in os.listdir(base_dir): + fp = os.path.join(base_dir, fn) + if fp.startswith(self.base_filename) and os.path.isfile(fp): + log_files.append(fp) + return sorted(log_files) + + def shouldRollover(self, record): + size_exceeded = self.max_bytes > 0 and self.stream.tell() >= self.max_bytes + time_exceeded = self.interval > 0 and self.last_rollover + self.interval <= time.monotonic() + return size_exceeded or time_exceeded + + def doRollover(self): + if self.stream: + self.stream.close() + self.stream = self._open() + + if self.backup_count > 0: + while len(self.log_files) > self.backup_count: + to_delete = self.log_files.pop() + if os.path.exists(to_delete): # just being safe, should always exist + os.remove(to_delete) + +class UnixDomainSocketHandler(logging.Handler): + def __init__(self, formatter): + logging.Handler.__init__(self) + self.setFormatter(formatter) + self.pid = None + + def connect(self): + self.zctx = zmq.Context() + self.sock = self.zctx.socket(zmq.PUSH) + self.sock.setsockopt(zmq.LINGER, 10) + self.sock.connect("ipc:///tmp/logmessage") + self.pid = os.getpid() + + def emit(self, record): + if os.getpid() != self.pid: + self.connect() + + msg = self.format(record).rstrip('\n') + # print("SEND".format(repr(msg))) + try: + s = chr(record.levelno)+msg + self.sock.send(s.encode('utf8'), zmq.NOBLOCK) + except zmq.error.Again: + # drop :/ + pass + + +def add_file_handler(log): + """ + Function to add the file log handler to swaglog. + This can be used to store logs when logmessaged is not running. + """ + handler = get_file_handler() + handler.setFormatter(SwagLogFileFormatter(log)) + log.addHandler(handler) + + +cloudlog = log = SwagLogger() +log.setLevel(logging.DEBUG) + + +outhandler = logging.StreamHandler() + +print_level = os.environ.get('LOGPRINT', 'warning') +if print_level == 'debug': + outhandler.setLevel(logging.DEBUG) +elif print_level == 'info': + outhandler.setLevel(logging.INFO) +elif print_level == 'warning': + outhandler.setLevel(logging.WARNING) + +log.addHandler(outhandler) +# logs are sent through IPC before writing to disk to prevent disk I/O blocking +log.addHandler(UnixDomainSocketHandler(SwagFormatter(log))) diff --git a/selfdrive/test/__init__.py b/selfdrive/test/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/selfdrive/test/helpers.py b/selfdrive/test/helpers.py new file mode 100644 index 000000000..5abc0d964 --- /dev/null +++ b/selfdrive/test/helpers.py @@ -0,0 +1,58 @@ +import os +import time +from functools import wraps + +from selfdrive.hardware import PC +from selfdrive.manager.process_config import managed_processes +from selfdrive.version import training_version, terms_version + + +def set_params_enabled(): + from common.params import Params + params = Params() + params.put("HasAcceptedTerms", terms_version) + params.put("CompletedTrainingVersion", training_version) + params.put_bool("OpenpilotEnabledToggle", True) + params.put_bool("Passive", False) + + +def phone_only(f): + @wraps(f) + def wrap(self, *args, **kwargs): + if PC: + self.skipTest("This test is not meant to run on PC") + f(self, *args, **kwargs) + return wrap + +def release_only(f): + @wraps(f) + def wrap(self, *args, **kwargs): + if "RELEASE" not in os.environ: + self.skipTest("This test is only for release branches") + f(self, *args, **kwargs) + return wrap + +def with_processes(processes, init_time=0, ignore_stopped=None): + ignore_stopped = [] if ignore_stopped is None else ignore_stopped + + def wrapper(func): + @wraps(func) + def wrap(*args, **kwargs): + # start and assert started + for n, p in enumerate(processes): + managed_processes[p].start() + if n < len(processes) - 1: + time.sleep(init_time) + assert all(managed_processes[name].proc.exitcode is None for name in processes) + + # call the function + try: + func(*args, **kwargs) + # assert processes are still started + assert all(managed_processes[name].proc.exitcode is None for name in processes if name not in ignore_stopped) + finally: + for p in processes: + managed_processes[p].stop() + + return wrap + return wrapper diff --git a/selfdrive/test/setup_device_ci.sh b/selfdrive/test/setup_device_ci.sh new file mode 100755 index 000000000..260a1b448 --- /dev/null +++ b/selfdrive/test/setup_device_ci.sh @@ -0,0 +1,72 @@ +#!/usr/bin/bash + +set -e + +if [ -z "$SOURCE_DIR" ]; then + echo "SOURCE_DIR must be set" + exit 1 +fi + +if [ -z "$GIT_COMMIT" ]; then + echo "GIT_COMMIT must be set" + exit 1 +fi + +if [ -z "$TEST_DIR" ]; then + echo "TEST_DIR must be set" + exit 1 +fi + +umount /data/safe_staging/merged/ || true +sudo umount /data/safe_staging/merged/ || true + +if [ -f "/EON" ]; then + rm -rf /data/core + rm -rf /data/neoupdate + rm -rf /data/safe_staging +fi + +export KEYS_PATH="/usr/comma/setup_keys" +export CONTINUE_PATH="/data/continue.sh" +if [ -f "/EON" ]; then + export KEYS_PATH="/data/data/com.termux/files/home/setup_keys" + export CONTINUE_PATH="/data/data/com.termux/files/continue.sh" +fi +tee $CONTINUE_PATH << EOF +#!/usr/bin/bash + +PARAMS_ROOT="/data/params/d" + +while true; do + mkdir -p \$PARAMS_ROOT + cp $KEYS_PATH \$PARAMS_ROOT/GithubSshKeys + echo -n 1 > \$PARAMS_ROOT/SshEnabled + sleep 1m +done + +sleep infinity +EOF +chmod +x $CONTINUE_PATH + +# set up environment +if [ ! -d "$SOURCE_DIR" ]; then + git clone https://github.com/commaai/openpilot.git $SOURCE_DIR +fi +cd $SOURCE_DIR + +rm -f .git/index.lock +git reset --hard +git fetch +find . -maxdepth 1 -not -path './.git' -not -name '.' -not -name '..' -exec rm -rf '{}' \; +git fetch --verbose origin $GIT_COMMIT +git reset --hard $GIT_COMMIT +git checkout $GIT_COMMIT +git clean -xdf +git submodule update --init --recursive +git submodule foreach --recursive "git reset --hard && git clean -xdf" + +echo "git checkout done, t=$SECONDS" + +rsync -a --delete $SOURCE_DIR $TEST_DIR + +echo "$TEST_DIR synced with $GIT_COMMIT, t=$SECONDS" diff --git a/selfdrive/test/test_fingerprints.py b/selfdrive/test/test_fingerprints.py new file mode 100755 index 000000000..01c7d753c --- /dev/null +++ b/selfdrive/test/test_fingerprints.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python3 +import os +import sys +from typing import Dict, List + +from common.basedir import BASEDIR + +# messages reserved for CAN based ignition (see can_ignition_hook function in panda/board/drivers/can) +# (addr, len) +CAN_IGNITION_MSGS = { + 'gm': [(0x1F1, 8), (0x160, 5)], + #'tesla' : [(0x348, 8)], +} + +def _get_fingerprints(): + # read all the folders in selfdrive/car and return a dict where: + # - keys are all the car names that which we have a fingerprint dict for + # - values are dicts of fingeprints for each trim + fingerprints = {} + for car_folder in [x[0] for x in os.walk(BASEDIR + '/selfdrive/car')]: + car_name = car_folder.split('/')[-1] + try: + fingerprints[car_name] = __import__(f'selfdrive.car.{car_name}.values', fromlist=['FINGERPRINTS']).FINGERPRINTS + except (ImportError, OSError, AttributeError): + pass + + return fingerprints + + +def check_fingerprint_consistency(f1, f2): + # return false if it finds a fingerprint fully included in another + # max message worth checking is 1800, as above that they usually come too infrequently and not + # usable for fingerprinting + + max_msg = 1800 + + is_f1_in_f2 = True + for k in f1: + if (k not in f2 or f1[k] != f2[k]) and k < max_msg: + is_f1_in_f2 = False + + is_f2_in_f1 = True + for k in f2: + if (k not in f1 or f2[k] != f1[k]) and k < max_msg: + is_f2_in_f1 = False + + return not is_f1_in_f2 and not is_f2_in_f1 + + +def check_can_ignition_conflicts(fingerprints, brands): + # loops through all the fingerprints and exits if CAN ignition dedicated messages + # are found in unexpected fingerprints + + for brand_can, msgs_can in CAN_IGNITION_MSGS.items(): + for i, f in enumerate(fingerprints): + for msg_can in msgs_can: + if brand_can != brands[i] and msg_can[0] in f and msg_can[1] == f[msg_can[0]]: + print("CAN ignition dedicated msg %d with len %d found in %s fingerprints!" % (msg_can[0], msg_can[1], brands[i])) + print("TEST FAILED") + sys.exit(1) + + + +if __name__ == "__main__": + fingerprints = _get_fingerprints() + + fingerprints_flat: List[Dict] = [] + car_names = [] + brand_names = [] + for brand in fingerprints: + for car in fingerprints[brand]: + fingerprints_flat += fingerprints[brand][car] + for i in range(len(fingerprints[brand][car])): + car_names.append(car) + brand_names.append(brand) + + # first check if CAN ignition specific messages are unexpectedly included in other fingerprints + check_can_ignition_conflicts(fingerprints_flat, brand_names) + + valid = True + for idx1, f1 in enumerate(fingerprints_flat): + for idx2, f2 in enumerate(fingerprints_flat): + if idx1 < idx2 and not check_fingerprint_consistency(f1, f2): + valid = False + print(f"Those two fingerprints are inconsistent {car_names[idx1]} {car_names[idx2]}") + print("") + print(', '.join("%d: %d" % v for v in sorted(f1.items()))) + print("") + print(', '.join("%d: %d" % v for v in sorted(f2.items()))) + print("") + + print(f"Found {len(fingerprints_flat)} individual fingerprints") + if not valid or len(fingerprints_flat) == 0: + print("TEST FAILED") + sys.exit(1) + else: + print("TEST SUCESSFUL") diff --git a/selfdrive/test/test_onroad.py b/selfdrive/test/test_onroad.py new file mode 100755 index 000000000..d0a1ad956 --- /dev/null +++ b/selfdrive/test/test_onroad.py @@ -0,0 +1,284 @@ +#!/usr/bin/env python3 +import json +import os +import subprocess +import time +import numpy as np +import unittest +from collections import Counter +from pathlib import Path + +from cereal import car +import cereal.messaging as messaging +from cereal.services import service_list +from common.basedir import BASEDIR +from common.timeout import Timeout +from common.params import Params +from selfdrive.controls.lib.events import EVENTS, ET +from selfdrive.hardware import EON, TICI +from selfdrive.loggerd.config import ROOT +from selfdrive.test.helpers import set_params_enabled, release_only +from tools.lib.logreader import LogReader + +# Baseline CPU usage by process +PROCS = { + "selfdrive.controls.controlsd": 55.0, + "./loggerd": 45.0, + "./locationd": 9.1, + "selfdrive.controls.plannerd": 22.6, + "./_ui": 20.0, + "selfdrive.locationd.paramsd": 9.1, + "./camerad": 7.07, + "./_sensord": 6.17, + "selfdrive.controls.radard": 7.0, + "./_modeld": 4.48, + "./boardd": 3.63, + "./_dmonitoringmodeld": 2.67, + "selfdrive.thermald.thermald": 5.36, + "selfdrive.locationd.calibrationd": 2.0, + "./_soundd": 1.0, + "selfdrive.monitoring.dmonitoringd": 1.90, + "./proclogd": 1.54, + "selfdrive.logmessaged": 0.2, + "./clocksd": 0.02, + "./ubloxd": 0.02, + "selfdrive.tombstoned": 0, + "./logcatd": 0, +} + +if EON: + PROCS.update({ + "selfdrive.hardware.eon.androidd": 0.4, + "selfdrive.hardware.eon.shutdownd": 0.4, + }) + +if TICI: + PROCS.update({ + "./loggerd": 70.0, + "selfdrive.controls.controlsd": 31.0, + "./camerad": 31.0, + "./_ui": 33.0, + "selfdrive.controls.plannerd": 11.7, + "./_dmonitoringmodeld": 10.0, + "selfdrive.locationd.paramsd": 5.0, + "selfdrive.controls.radard": 4.5, + "selfdrive.thermald.thermald": 3.87, + }) + + +TIMINGS = { + # rtols: max/min, rsd + "can": [2.5, 0.35], + "pandaStates": [2.5, 0.35], + "peripheralState": [2.5, 0.35], + "sendcan": [2.5, 0.35], + "carState": [2.5, 0.35], + "carControl": [2.5, 0.35], + "controlsState": [2.5, 0.35], + "lateralPlan": [2.5, 0.5], + "longitudinalPlan": [2.5, 0.5], + "roadCameraState": [2.5, 0.35], + "driverCameraState": [2.5, 0.35], + "modelV2": [2.5, 0.35], + "driverState": [2.5, 0.35], + "liveLocationKalman": [2.5, 0.35], +} +if EON: + TIMINGS.update({ + "roadCameraState": [2.5, 0.45], + }) +if TICI: + TIMINGS.update({ + "wideRoadCameraState": [1.5, 0.35], + }) + + +def cputime_total(ct): + return ct.cpuUser + ct.cpuSystem + ct.cpuChildrenUser + ct.cpuChildrenSystem + + +def check_cpu_usage(first_proc, last_proc): + result = "\n" + result += "------------------------------------------------\n" + result += "------------------ CPU Usage -------------------\n" + result += "------------------------------------------------\n" + + r = True + dt = (last_proc.logMonoTime - first_proc.logMonoTime) / 1e9 + for proc_name, normal_cpu_usage in PROCS.items(): + first, last = None, None + try: + first = [p for p in first_proc.procLog.procs if proc_name in p.cmdline][0] + last = [p for p in last_proc.procLog.procs if proc_name in p.cmdline][0] + cpu_time = cputime_total(last) - cputime_total(first) + cpu_usage = cpu_time / dt * 100. + if cpu_usage > max(normal_cpu_usage * 1.15, normal_cpu_usage + 5.0): + # cpu usage is high while playing sounds + if not (proc_name == "./_soundd" and cpu_usage < 65.): + result += f"Warning {proc_name} using more CPU than normal\n" + r = False + elif cpu_usage < min(normal_cpu_usage * 0.65, max(normal_cpu_usage - 1.0, 0.0)): + result += f"Warning {proc_name} using less CPU than normal\n" + r = False + result += f"{proc_name.ljust(35)} {cpu_usage:.2f}%\n" + except IndexError: + result += f"{proc_name.ljust(35)} NO METRICS FOUND {first=} {last=}\n" + r = False + result += "------------------------------------------------\n" + print(result) + return r + + +class TestOnroad(unittest.TestCase): + + @classmethod + def setUpClass(cls): + if "DEBUG" in os.environ: + segs = filter(lambda x: os.path.exists(os.path.join(x, "rlog.bz2")), Path(ROOT).iterdir()) + segs = sorted(segs, key=lambda x: x.stat().st_mtime) + cls.lr = list(LogReader(os.path.join(segs[-1], "rlog.bz2"))) + return + + # setup env + os.environ['REPLAY'] = "1" + os.environ['SKIP_FW_QUERY'] = "1" + os.environ['FINGERPRINT'] = "TOYOTA COROLLA TSS2 2019" + + params = Params() + params.clear_all() + set_params_enabled() + + # Make sure athena isn't running + os.system("pkill -9 -f athena") + + # start manager and run openpilot for a minute + try: + manager_path = os.path.join(BASEDIR, "selfdrive/manager/manager.py") + proc = subprocess.Popen(["python", manager_path]) + + sm = messaging.SubMaster(['carState']) + with Timeout(150, "controls didn't start"): + while sm.rcv_frame['carState'] < 0: + sm.update(1000) + + # make sure we get at least two full segments + route = None + cls.segments = [] + with Timeout(300, "timed out waiting for logs"): + while route is None: + route = params.get("CurrentRoute", encoding="utf-8") + time.sleep(0.1) + + while len(cls.segments) < 3: + segs = set() + if Path(ROOT).exists(): + segs = set(Path(ROOT).glob(f"{route}--*")) + cls.segments = sorted(segs, key=lambda s: int(str(s).rsplit('--')[-1])) + time.sleep(2) + + # chop off last, incomplete segment + cls.segments = cls.segments[:-1] + + finally: + proc.terminate() + if proc.wait(60) is None: + proc.kill() + + cls.lrs = [list(LogReader(os.path.join(str(s), "rlog.bz2"))) for s in cls.segments] + + # use the second segment by default as it's the first full segment + cls.lr = list(LogReader(os.path.join(str(cls.segments[1]), "rlog.bz2"))) + + def test_cloudlog_size(self): + msgs = [m for m in self.lr if m.which() == 'logMessage'] + + total_size = sum(len(m.as_builder().to_bytes()) for m in msgs) + self.assertLess(total_size, 3.5e5) + + cnt = Counter(json.loads(m.logMessage)['filename'] for m in msgs) + big_logs = [f for f, n in cnt.most_common(3) if n / sum(cnt.values()) > 30.] + self.assertEqual(len(big_logs), 0, f"Log spam: {big_logs}") + + def test_cpu_usage(self): + proclogs = [m for m in self.lr if m.which() == 'procLog'] + self.assertGreater(len(proclogs), service_list['procLog'].frequency * 45, "insufficient samples") + cpu_ok = check_cpu_usage(proclogs[0], proclogs[-1]) + self.assertTrue(cpu_ok) + + def test_mpc_execution_timings(self): + result = "\n" + result += "------------------------------------------------\n" + result += "----------------- MPC Timing ------------------\n" + result += "------------------------------------------------\n" + + cfgs = [("lateralPlan", 0.05, 0.05), ("longitudinalPlan", 0.05, 0.05)] + for (s, instant_max, avg_max) in cfgs: + ts = [getattr(getattr(m, s), "solverExecutionTime") for m in self.lr if m.which() == s] + self.assertLess(min(ts), instant_max, f"high '{s}' execution time: {min(ts)}") + self.assertLess(np.mean(ts), avg_max, f"high avg '{s}' execution time: {np.mean(ts)}") + result += f"'{s}' execution time: {min(ts)}\n" + result += f"'{s}' avg execution time: {np.mean(ts)}\n" + result += "------------------------------------------------\n" + print(result) + + def test_model_execution_timings(self): + result = "\n" + result += "------------------------------------------------\n" + result += "----------------- Model Timing -----------------\n" + result += "------------------------------------------------\n" + # TODO: this went up when plannerd cpu usage increased, why? + cfgs = [("modelV2", 0.038, 0.036), ("driverState", 0.028, 0.026)] + for (s, instant_max, avg_max) in cfgs: + ts = [getattr(getattr(m, s), "modelExecutionTime") for m in self.lr if m.which() == s] + self.assertLess(min(ts), instant_max, f"high '{s}' execution time: {min(ts)}") + self.assertLess(np.mean(ts), avg_max, f"high avg '{s}' execution time: {np.mean(ts)}") + result += f"'{s}' execution time: {min(ts)}\n" + result += f"'{s}' avg execution time: {np.mean(ts)}\n" + result += "------------------------------------------------\n" + print(result) + + def test_timings(self): + passed = True + result = "\n" + result += "------------------------------------------------\n" + result += "----------------- Service Timings --------------\n" + result += "------------------------------------------------\n" + for s, (maxmin, rsd) in TIMINGS.items(): + msgs = [m.logMonoTime for m in self.lr if m.which() == s] + if not len(msgs): + raise Exception(f"missing {s}") + + ts = np.diff(msgs) / 1e9 + dt = 1 / service_list[s].frequency + + try: + np.testing.assert_allclose(np.mean(ts), dt, rtol=0.03, err_msg=f"{s} - failed mean timing check") + np.testing.assert_allclose([np.max(ts), np.min(ts)], dt, rtol=maxmin, err_msg=f"{s} - failed max/min timing check") + except Exception as e: + result += str(e) + "\n" + passed = False + + if np.std(ts) / dt > rsd: + result += f"{s} - failed RSD timing check\n" + passed = False + + result += f"{s.ljust(40)}: {np.array([np.mean(ts), np.max(ts), np.min(ts)])*1e3}\n" + result += f"{''.ljust(40)} {np.max(np.absolute([np.max(ts)/dt, np.min(ts)/dt]))} {np.std(ts)/dt}\n" + result += "="*67 + print(result) + self.assertTrue(passed) + + @release_only + def test_startup(self): + startup_alert = None + for msg in self.lrs[0]: + # can't use carEvents because the first msg can be dropped while loggerd is starting up + if msg.which() == "controlsState": + startup_alert = msg.controlsState.alertText1 + break + expected = EVENTS[car.CarEvent.EventName.startup][ET.PERMANENT].alert_text_1 + self.assertEqual(startup_alert, expected, "wrong startup alert") + + +if __name__ == "__main__": + unittest.main() diff --git a/selfdrive/thermald/power_monitoring.py b/selfdrive/thermald/power_monitoring.py new file mode 100644 index 000000000..0dc4c5a1d --- /dev/null +++ b/selfdrive/thermald/power_monitoring.py @@ -0,0 +1,192 @@ +import random +import threading +import time +from statistics import mean +from typing import Optional + +from cereal import log +from common.params import Params, put_nonblocking +from common.realtime import sec_since_boot +from selfdrive.hardware import HARDWARE +from selfdrive.swaglog import cloudlog +from selfdrive.statsd import statlog + +CAR_VOLTAGE_LOW_PASS_K = 0.091 # LPF gain for 5s tau (dt/tau / (dt/tau + 1)) + +# A C2 uses about 1W while idling, and 30h seens like a good shutoff for most cars +# While driving, a battery charges completely in about 30-60 minutes +CAR_BATTERY_CAPACITY_uWh = 30e6 +CAR_CHARGING_RATE_W = 45 + +VBATT_PAUSE_CHARGING = 11.0 # Lower limit on the LPF car battery voltage +VBATT_INSTANT_PAUSE_CHARGING = 7.0 # Lower limit on the instant car battery voltage measurements to avoid triggering on instant power loss +MAX_TIME_OFFROAD_S = 30*3600 +MIN_ON_TIME_S = 3600 + +class PowerMonitoring: + def __init__(self): + self.params = Params() + self.last_measurement_time = None # Used for integration delta + self.last_save_time = 0 # Used for saving current value in a param + self.power_used_uWh = 0 # Integrated power usage in uWh since going into offroad + self.next_pulsed_measurement_time = None + self.car_voltage_mV = 12e3 # Low-passed version of peripheralState voltage + self.car_voltage_instant_mV = 12e3 # Last value of peripheralState voltage + self.integration_lock = threading.Lock() + + car_battery_capacity_uWh = self.params.get("CarBatteryCapacity") + if car_battery_capacity_uWh is None: + car_battery_capacity_uWh = 0 + + # Reset capacity if it's low + self.car_battery_capacity_uWh = max((CAR_BATTERY_CAPACITY_uWh / 10), int(car_battery_capacity_uWh)) + + # Calculation tick + def calculate(self, peripheralState, ignition): + try: + now = sec_since_boot() + + # If peripheralState is None, we're probably not in a car, so we don't care + if peripheralState is None or peripheralState.pandaType == log.PandaState.PandaType.unknown: + with self.integration_lock: + self.last_measurement_time = None + self.next_pulsed_measurement_time = None + self.power_used_uWh = 0 + return + + # Low-pass battery voltage + self.car_voltage_instant_mV = peripheralState.voltage + self.car_voltage_mV = ((peripheralState.voltage * CAR_VOLTAGE_LOW_PASS_K) + (self.car_voltage_mV * (1 - CAR_VOLTAGE_LOW_PASS_K))) + statlog.gauge("car_voltage", self.car_voltage_mV / 1e3) + + # Cap the car battery power and save it in a param every 10-ish seconds + self.car_battery_capacity_uWh = max(self.car_battery_capacity_uWh, 0) + self.car_battery_capacity_uWh = min(self.car_battery_capacity_uWh, CAR_BATTERY_CAPACITY_uWh) + if now - self.last_save_time >= 10: + put_nonblocking("CarBatteryCapacity", str(int(self.car_battery_capacity_uWh))) + self.last_save_time = now + + # First measurement, set integration time + with self.integration_lock: + if self.last_measurement_time is None: + self.last_measurement_time = now + return + + if ignition: + # If there is ignition, we integrate the charging rate of the car + with self.integration_lock: + self.power_used_uWh = 0 + integration_time_h = (now - self.last_measurement_time) / 3600 + if integration_time_h < 0: + raise ValueError(f"Negative integration time: {integration_time_h}h") + self.car_battery_capacity_uWh += (CAR_CHARGING_RATE_W * 1e6 * integration_time_h) + self.last_measurement_time = now + else: + # No ignition, we integrate the offroad power used by the device + is_uno = peripheralState.pandaType == log.PandaState.PandaType.uno + # Get current power draw somehow + current_power = HARDWARE.get_current_power_draw() # pylint: disable=assignment-from-none + if current_power is not None: + pass + elif HARDWARE.get_battery_status() == 'Discharging': + # If the battery is discharging, we can use this measurement + # On C2: this is low by about 10-15%, probably mostly due to UNO draw not being factored in + current_power = ((HARDWARE.get_battery_voltage() / 1000000) * (HARDWARE.get_battery_current() / 1000000)) + elif (self.next_pulsed_measurement_time is not None) and (self.next_pulsed_measurement_time <= now): + # TODO: Figure out why this is off by a factor of 3/4??? + FUDGE_FACTOR = 1.33 + + # Turn off charging for about 10 sec in a thread that does not get killed on SIGINT, and perform measurement here to avoid blocking thermal + def perform_pulse_measurement(now): + try: + HARDWARE.set_battery_charging(False) + time.sleep(5) + + # Measure for a few sec to get a good average + voltages = [] + currents = [] + for _ in range(6): + voltages.append(HARDWARE.get_battery_voltage()) + currents.append(HARDWARE.get_battery_current()) + time.sleep(1) + current_power = ((mean(voltages) / 1000000) * (mean(currents) / 1000000)) + + self._perform_integration(now, current_power * FUDGE_FACTOR) + + # Enable charging again + HARDWARE.set_battery_charging(True) + except Exception: + cloudlog.exception("Pulsed power measurement failed") + + # Start pulsed measurement and return + threading.Thread(target=perform_pulse_measurement, args=(now,)).start() + self.next_pulsed_measurement_time = None + return + + elif self.next_pulsed_measurement_time is None and not is_uno: + # On a charging EON with black panda, or drawing more than 400mA out of a white/grey one + # Only way to get the power draw is to turn off charging for a few sec and check what the discharging rate is + # We shouldn't do this very often, so make sure it has been some long-ish random time interval + self.next_pulsed_measurement_time = now + random.randint(120, 180) + return + else: + # Do nothing + return + + # Do the integration + self._perform_integration(now, current_power) + except Exception: + cloudlog.exception("Power monitoring calculation failed") + + def _perform_integration(self, t: float, current_power: float) -> None: + with self.integration_lock: + try: + if self.last_measurement_time: + integration_time_h = (t - self.last_measurement_time) / 3600 + power_used = (current_power * 1000000) * integration_time_h + if power_used < 0: + raise ValueError(f"Negative power used! Integration time: {integration_time_h} h Current Power: {power_used} uWh") + self.power_used_uWh += power_used + self.car_battery_capacity_uWh -= power_used + self.last_measurement_time = t + except Exception: + cloudlog.exception("Integration failed") + + # Get the power usage + def get_power_used(self) -> int: + return int(self.power_used_uWh) + + def get_car_battery_capacity(self) -> int: + return int(self.car_battery_capacity_uWh) + + # See if we need to disable charging + def should_disable_charging(self, ignition: bool, in_car: bool, offroad_timestamp: Optional[float]) -> bool: + if offroad_timestamp is None: + return False + + now = sec_since_boot() + disable_charging = False + disable_charging |= (now - offroad_timestamp) > MAX_TIME_OFFROAD_S + disable_charging |= (self.car_voltage_mV < (VBATT_PAUSE_CHARGING * 1e3)) and (self.car_voltage_instant_mV > (VBATT_INSTANT_PAUSE_CHARGING * 1e3)) + disable_charging |= (self.car_battery_capacity_uWh <= 0) + disable_charging &= not ignition + disable_charging &= (not self.params.get_bool("DisablePowerDown")) + disable_charging &= in_car + disable_charging |= self.params.get_bool("ForcePowerDown") + return disable_charging + + # See if we need to shutdown + def should_shutdown(self, peripheralState, ignition, in_car, offroad_timestamp, started_seen): + if offroad_timestamp is None: + return False + + now = sec_since_boot() + panda_charging = (peripheralState.usbPowerMode != log.PeripheralState.UsbPowerMode.client) + BATT_PERC_OFF = 10 + + should_shutdown = False + # Wait until we have shut down charging before powering down + should_shutdown |= (not panda_charging and self.should_disable_charging(ignition, in_car, offroad_timestamp)) + should_shutdown |= ((HARDWARE.get_battery_capacity() < BATT_PERC_OFF) and (not HARDWARE.get_battery_charging()) and ((now - offroad_timestamp) > 60)) + should_shutdown &= started_seen or (now > MIN_ON_TIME_S) + return should_shutdown diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py new file mode 100755 index 000000000..113ffaa04 --- /dev/null +++ b/selfdrive/thermald/thermald.py @@ -0,0 +1,480 @@ +#!/usr/bin/env python3 +import datetime +import os +import queue +import threading +import time +from collections import OrderedDict, namedtuple +from pathlib import Path +from typing import Dict, Optional, Tuple + +import psutil +from smbus2 import SMBus + +import cereal.messaging as messaging +from cereal import log +from common.dict_helpers import strip_deprecated_keys +from common.filter_simple import FirstOrderFilter +from common.numpy_fast import interp +from common.params import Params +from common.realtime import DT_TRML, sec_since_boot +from selfdrive.controls.lib.alertmanager import set_offroad_alert +from selfdrive.controls.lib.pid import PIController +from selfdrive.hardware import EON, HARDWARE, PC, TICI +from selfdrive.loggerd.config import get_available_percent +from selfdrive.statsd import statlog +from selfdrive.swaglog import cloudlog +from selfdrive.thermald.power_monitoring import PowerMonitoring +from selfdrive.version import terms_version, training_version + +ThermalStatus = log.DeviceState.ThermalStatus +NetworkType = log.DeviceState.NetworkType +NetworkStrength = log.DeviceState.NetworkStrength +CURRENT_TAU = 15. # 15s time constant +TEMP_TAU = 5. # 5s time constant +DISCONNECT_TIMEOUT = 5. # wait 5 seconds before going offroad after disconnect so you get an alert +PANDA_STATES_TIMEOUT = int(1000 * 2.5 * DT_TRML) # 2.5x the expected pandaState frequency + +ThermalBand = namedtuple("ThermalBand", ['min_temp', 'max_temp']) +HardwareState = namedtuple("HardwareState", ['network_type', 'network_strength', 'network_info', 'nvme_temps', 'modem_temps']) + +# List of thermal bands. We will stay within this region as long as we are within the bounds. +# When exiting the bounds, we'll jump to the lower or higher band. Bands are ordered in the dict. +THERMAL_BANDS = OrderedDict({ + ThermalStatus.green: ThermalBand(None, 80.0), + ThermalStatus.yellow: ThermalBand(75.0, 96.0), + ThermalStatus.red: ThermalBand(80.0, 107.), + ThermalStatus.danger: ThermalBand(94.0, None), +}) + +# Override to highest thermal band when offroad and above this temp +OFFROAD_DANGER_TEMP = 79.5 if TICI else 70.0 + +prev_offroad_states: Dict[str, Tuple[bool, Optional[str]]] = {} + +def read_tz(x): + if x is None: + return 0 + + try: + with open(f"/sys/devices/virtual/thermal/thermal_zone{x}/temp") as f: + return int(f.read()) + except FileNotFoundError: + return 0 + + +def read_thermal(thermal_config): + dat = messaging.new_message('deviceState') + dat.deviceState.cpuTempC = [read_tz(z) / thermal_config.cpu[1] for z in thermal_config.cpu[0]] + dat.deviceState.gpuTempC = [read_tz(z) / thermal_config.gpu[1] for z in thermal_config.gpu[0]] + dat.deviceState.memoryTempC = read_tz(thermal_config.mem[0]) / thermal_config.mem[1] + dat.deviceState.ambientTempC = read_tz(thermal_config.ambient[0]) / thermal_config.ambient[1] + dat.deviceState.pmicTempC = [read_tz(z) / thermal_config.pmic[1] for z in thermal_config.pmic[0]] + return dat + + +def setup_eon_fan(): + os.system("echo 2 > /sys/module/dwc3_msm/parameters/otg_switch") + + +last_eon_fan_val = None +def set_eon_fan(val): + global last_eon_fan_val + + if last_eon_fan_val is None or last_eon_fan_val != val: + bus = SMBus(7, force=True) + try: + i = [0x1, 0x3 | 0, 0x3 | 0x08, 0x3 | 0x10][val] + bus.write_i2c_block_data(0x3d, 0, [i]) + except OSError: + # tusb320 + if val == 0: + bus.write_i2c_block_data(0x67, 0xa, [0]) + else: + bus.write_i2c_block_data(0x67, 0xa, [0x20]) + bus.write_i2c_block_data(0x67, 0x8, [(val - 1) << 6]) + bus.close() + last_eon_fan_val = val + + +# temp thresholds to control fan speed - high hysteresis +_TEMP_THRS_H = [50., 65., 80., 10000] +# temp thresholds to control fan speed - low hysteresis +_TEMP_THRS_L = [42.5, 57.5, 72.5, 10000] +# fan speed options +_FAN_SPEEDS = [0, 16384, 32768, 65535] + + +def handle_fan_eon(controller, max_cpu_temp, fan_speed, ignition): + new_speed_h = next(speed for speed, temp_h in zip(_FAN_SPEEDS, _TEMP_THRS_H) if temp_h > max_cpu_temp) + new_speed_l = next(speed for speed, temp_l in zip(_FAN_SPEEDS, _TEMP_THRS_L) if temp_l > max_cpu_temp) + + if new_speed_h > fan_speed: + # update speed if using the high thresholds results in fan speed increment + fan_speed = new_speed_h + elif new_speed_l < fan_speed: + # update speed if using the low thresholds results in fan speed decrement + fan_speed = new_speed_l + + set_eon_fan(fan_speed // 16384) + + return fan_speed + + +def handle_fan_uno(controller, max_cpu_temp, fan_speed, ignition): + new_speed = int(interp(max_cpu_temp, [40.0, 80.0], [0, 80])) + + if not ignition: + new_speed = min(30, new_speed) + + return new_speed + + +last_ignition = False +def handle_fan_tici(controller, max_cpu_temp, fan_speed, ignition): + global last_ignition + + controller.neg_limit = -(80 if ignition else 30) + controller.pos_limit = -(30 if ignition else 0) + + if ignition != last_ignition: + controller.reset() + + fan_pwr_out = -int(controller.update( + setpoint=75, + measurement=max_cpu_temp, + feedforward=interp(max_cpu_temp, [60.0, 100.0], [0, -80]) + )) + + last_ignition = ignition + return fan_pwr_out + + +def set_offroad_alert_if_changed(offroad_alert: str, show_alert: bool, extra_text: Optional[str]=None): + if prev_offroad_states.get(offroad_alert, None) == (show_alert, extra_text): + return + prev_offroad_states[offroad_alert] = (show_alert, extra_text) + set_offroad_alert(offroad_alert, show_alert, extra_text) + + +def hw_state_thread(end_event, hw_queue): + """Handles non critical hardware state, and sends over queue""" + count = 0 + registered_count = 0 + + while not end_event.is_set(): + # these are expensive calls. update every 10s + if (count % int(10. / DT_TRML)) == 0: + try: + network_type = HARDWARE.get_network_type() + + hw_state = HardwareState( + network_type=network_type, + network_strength=HARDWARE.get_network_strength(network_type), + network_info=HARDWARE.get_network_info(), + nvme_temps=HARDWARE.get_nvme_temperatures(), + modem_temps=HARDWARE.get_modem_temperatures(), + ) + + try: + hw_queue.put_nowait(hw_state) + except queue.Full: + pass + + if TICI and (hw_state.network_info is not None) and (hw_state.network_info.get('state', None) == "REGISTERED"): + registered_count += 1 + else: + registered_count = 0 + + if registered_count > 10: + cloudlog.warning(f"Modem stuck in registered state {hw_state.network_info}. nmcli conn up lte") + os.system("nmcli conn up lte") + registered_count = 0 + + except Exception: + cloudlog.exception("Error getting network status") + + count += 1 + time.sleep(DT_TRML) + + +def thermald_thread(end_event, hw_queue): + pm = messaging.PubMaster(['deviceState']) + sm = messaging.SubMaster(["peripheralState", "gpsLocationExternal", "controlsState", "pandaStates"], poll=["pandaStates"]) + + fan_speed = 0 + count = 0 + + onroad_conditions: Dict[str, bool] = { + "ignition": False, + } + startup_conditions: Dict[str, bool] = {} + startup_conditions_prev: Dict[str, bool] = {} + + off_ts = None + started_ts = None + started_seen = False + thermal_status = ThermalStatus.green + usb_power = True + + last_hw_state = HardwareState( + network_type=NetworkType.none, + network_strength=NetworkStrength.unknown, + network_info=None, + nvme_temps=[], + modem_temps=[], + ) + + current_filter = FirstOrderFilter(0., CURRENT_TAU, DT_TRML) + temp_filter = FirstOrderFilter(0., TEMP_TAU, DT_TRML) + should_start_prev = False + in_car = False + handle_fan = None + is_uno = False + engaged_prev = False + + params = Params() + power_monitor = PowerMonitoring() + + HARDWARE.initialize_hardware() + thermal_config = HARDWARE.get_thermal_config() + + # TODO: use PI controller for UNO + controller = PIController(k_p=0, k_i=2e-3, neg_limit=-80, pos_limit=0, rate=(1 / DT_TRML)) + + while not end_event.is_set(): + sm.update(PANDA_STATES_TIMEOUT) + + pandaStates = sm['pandaStates'] + peripheralState = sm['peripheralState'] + + msg = read_thermal(thermal_config) + + if sm.updated['pandaStates'] and len(pandaStates) > 0: + + # Set ignition based on any panda connected + onroad_conditions["ignition"] = any(ps.ignitionLine or ps.ignitionCan for ps in pandaStates if ps.pandaType != log.PandaState.PandaType.unknown) + + pandaState = pandaStates[0] + + in_car = pandaState.harnessStatus != log.PandaState.HarnessStatus.notConnected + usb_power = peripheralState.usbPowerMode != log.PeripheralState.UsbPowerMode.client + + # Setup fan handler on first connect to panda + if handle_fan is None and peripheralState.pandaType != log.PandaState.PandaType.unknown: + is_uno = peripheralState.pandaType == log.PandaState.PandaType.uno + + if TICI: + cloudlog.info("Setting up TICI fan handler") + handle_fan = handle_fan_tici + elif is_uno or PC: + cloudlog.info("Setting up UNO fan handler") + handle_fan = handle_fan_uno + else: + cloudlog.info("Setting up EON fan handler") + setup_eon_fan() + handle_fan = handle_fan_eon + + try: + last_hw_state = hw_queue.get_nowait() + except queue.Empty: + pass + + msg.deviceState.freeSpacePercent = get_available_percent(default=100.0) + msg.deviceState.memoryUsagePercent = int(round(psutil.virtual_memory().percent)) + msg.deviceState.cpuUsagePercent = [int(round(n)) for n in psutil.cpu_percent(percpu=True)] + msg.deviceState.gpuUsagePercent = int(round(HARDWARE.get_gpu_usage_percent())) + + msg.deviceState.networkType = last_hw_state.network_type + msg.deviceState.networkStrength = last_hw_state.network_strength + if last_hw_state.network_info is not None: + msg.deviceState.networkInfo = last_hw_state.network_info + + msg.deviceState.nvmeTempC = last_hw_state.nvme_temps + msg.deviceState.modemTempC = last_hw_state.modem_temps + + msg.deviceState.screenBrightnessPercent = HARDWARE.get_screen_brightness() + msg.deviceState.batteryPercent = HARDWARE.get_battery_capacity() + msg.deviceState.batteryCurrent = HARDWARE.get_battery_current() + msg.deviceState.usbOnline = HARDWARE.get_usb_present() + current_filter.update(msg.deviceState.batteryCurrent / 1e6) + + max_comp_temp = temp_filter.update( + max(max(msg.deviceState.cpuTempC), msg.deviceState.memoryTempC, max(msg.deviceState.gpuTempC)) + ) + + if handle_fan is not None: + fan_speed = handle_fan(controller, max_comp_temp, fan_speed, onroad_conditions["ignition"]) + msg.deviceState.fanSpeedPercentDesired = fan_speed + + is_offroad_for_5_min = (started_ts is None) and ((not started_seen) or (off_ts is None) or (sec_since_boot() - off_ts > 60 * 5)) + if is_offroad_for_5_min and max_comp_temp > OFFROAD_DANGER_TEMP: + # If device is offroad we want to cool down before going onroad + # since going onroad increases load and can make temps go over 107 + thermal_status = ThermalStatus.danger + else: + current_band = THERMAL_BANDS[thermal_status] + band_idx = list(THERMAL_BANDS.keys()).index(thermal_status) + if current_band.min_temp is not None and max_comp_temp < current_band.min_temp: + thermal_status = list(THERMAL_BANDS.keys())[band_idx - 1] + elif current_band.max_temp is not None and max_comp_temp > current_band.max_temp: + thermal_status = list(THERMAL_BANDS.keys())[band_idx + 1] + + # **** starting logic **** + + # Ensure date/time are valid + now = datetime.datetime.utcnow() + startup_conditions["time_valid"] = (now.year > 2020) or (now.year == 2020 and now.month >= 10) + set_offroad_alert_if_changed("Offroad_InvalidTime", (not startup_conditions["time_valid"])) + + startup_conditions["up_to_date"] = params.get("Offroad_ConnectivityNeeded") is None or params.get_bool("DisableUpdates") or params.get_bool("SnoozeUpdate") + startup_conditions["not_uninstalling"] = not params.get_bool("DoUninstall") + startup_conditions["accepted_terms"] = params.get("HasAcceptedTerms") == terms_version + + # with 2% left, we killall, otherwise the phone will take a long time to boot + startup_conditions["free_space"] = msg.deviceState.freeSpacePercent > 2 + startup_conditions["completed_training"] = params.get("CompletedTrainingVersion") == training_version or \ + params.get_bool("Passive") + startup_conditions["not_driver_view"] = not params.get_bool("IsDriverViewEnabled") + startup_conditions["not_taking_snapshot"] = not params.get_bool("IsTakingSnapshot") + # if any CPU gets above 107 or the battery gets above 63, kill all processes + # controls will warn with CPU above 95 or battery above 60 + onroad_conditions["device_temp_good"] = thermal_status < ThermalStatus.danger + set_offroad_alert_if_changed("Offroad_TemperatureTooHigh", (not onroad_conditions["device_temp_good"])) + + if TICI: + missing = (not Path("/data/media").is_mount()) and (not os.path.isfile("/persist/comma/living-in-the-moment")) + set_offroad_alert_if_changed("Offroad_StorageMissing", missing) + + # Handle offroad/onroad transition + should_start = all(onroad_conditions.values()) + if started_ts is None: + should_start = should_start and all(startup_conditions.values()) + + if should_start != should_start_prev or (count == 0): + params.put_bool("IsOnroad", should_start) + params.put_bool("IsOffroad", not should_start) + + params.put_bool("IsEngaged", False) + engaged_prev = False + HARDWARE.set_power_save(not should_start) + + if sm.updated['controlsState']: + engaged = sm['controlsState'].enabled + if engaged != engaged_prev: + params.put_bool("IsEngaged", engaged) + engaged_prev = engaged + + try: + with open('/dev/kmsg', 'w') as kmsg: + kmsg.write(f"<3>[thermald] engaged: {engaged}\n") + except Exception: + pass + + if should_start: + off_ts = None + if started_ts is None: + started_ts = sec_since_boot() + started_seen = True + else: + if onroad_conditions["ignition"] and (startup_conditions != startup_conditions_prev): + cloudlog.event("Startup blocked", startup_conditions=startup_conditions, onroad_conditions=onroad_conditions) + + started_ts = None + if off_ts is None: + off_ts = sec_since_boot() + + # Offroad power monitoring + power_monitor.calculate(peripheralState, onroad_conditions["ignition"]) + msg.deviceState.offroadPowerUsageUwh = power_monitor.get_power_used() + msg.deviceState.carBatteryCapacityUwh = max(0, power_monitor.get_car_battery_capacity()) + current_power_draw = HARDWARE.get_current_power_draw() # pylint: disable=assignment-from-none + msg.deviceState.powerDrawW = current_power_draw if current_power_draw is not None else 0 + + # Check if we need to disable charging (handled by boardd) + msg.deviceState.chargingDisabled = power_monitor.should_disable_charging(onroad_conditions["ignition"], in_car, off_ts) + + # Check if we need to shut down + if power_monitor.should_shutdown(peripheralState, onroad_conditions["ignition"], in_car, off_ts, started_seen): + cloudlog.warning(f"shutting device down, offroad since {off_ts}") + params.put_bool("DoShutdown", True) + + msg.deviceState.chargingError = current_filter.x > 0. and msg.deviceState.batteryPercent < 90 # if current is positive, then battery is being discharged + msg.deviceState.started = started_ts is not None + msg.deviceState.startedMonoTime = int(1e9*(started_ts or 0)) + + last_ping = params.get("LastAthenaPingTime") + if last_ping is not None: + msg.deviceState.lastAthenaPingTime = int(last_ping) + + msg.deviceState.thermalStatus = thermal_status + pm.send("deviceState", msg) + + if EON and not is_uno: + set_offroad_alert_if_changed("Offroad_ChargeDisabled", (not usb_power)) + + should_start_prev = should_start + startup_conditions_prev = startup_conditions.copy() + + # Log to statsd + statlog.gauge("free_space_percent", msg.deviceState.freeSpacePercent) + statlog.gauge("gpu_usage_percent", msg.deviceState.gpuUsagePercent) + statlog.gauge("memory_usage_percent", msg.deviceState.memoryUsagePercent) + for i, usage in enumerate(msg.deviceState.cpuUsagePercent): + statlog.gauge(f"cpu{i}_usage_percent", usage) + for i, temp in enumerate(msg.deviceState.cpuTempC): + statlog.gauge(f"cpu{i}_temperature", temp) + for i, temp in enumerate(msg.deviceState.gpuTempC): + statlog.gauge(f"gpu{i}_temperature", temp) + statlog.gauge("memory_temperature", msg.deviceState.memoryTempC) + statlog.gauge("ambient_temperature", msg.deviceState.ambientTempC) + for i, temp in enumerate(msg.deviceState.pmicTempC): + statlog.gauge(f"pmic{i}_temperature", temp) + for i, temp in enumerate(last_hw_state.nvme_temps): + statlog.gauge(f"nvme_temperature{i}", temp) + for i, temp in enumerate(last_hw_state.modem_temps): + statlog.gauge(f"modem_temperature{i}", temp) + statlog.gauge("fan_speed_percent_desired", msg.deviceState.fanSpeedPercentDesired) + statlog.gauge("screen_brightness_percent", msg.deviceState.screenBrightnessPercent) + + # report to server once every 10 minutes + if (count % int(600. / DT_TRML)) == 0: + if EON and started_ts is None and msg.deviceState.memoryUsagePercent > 40: + cloudlog.event("High offroad memory usage", mem=msg.deviceState.memoryUsagePercent) + + cloudlog.event("STATUS_PACKET", + count=count, + pandaStates=[strip_deprecated_keys(p.to_dict()) for p in pandaStates], + peripheralState=strip_deprecated_keys(peripheralState.to_dict()), + location=(strip_deprecated_keys(sm["gpsLocationExternal"].to_dict()) if sm.alive["gpsLocationExternal"] else None), + deviceState=strip_deprecated_keys(msg.to_dict())) + + count += 1 + + +def main(): + hw_queue = queue.Queue(maxsize=1) + end_event = threading.Event() + + threads = [ + threading.Thread(target=hw_state_thread, args=(end_event, hw_queue)), + threading.Thread(target=thermald_thread, args=(end_event, hw_queue)), + ] + + for t in threads: + t.start() + + try: + while True: + time.sleep(1) + if not all(t.is_alive() for t in threads): + break + finally: + end_event.set() + + for t in threads: + t.join() + + +if __name__ == "__main__": + main() diff --git a/selfdrive/tombstoned.py b/selfdrive/tombstoned.py new file mode 100755 index 000000000..a3dfc5d31 --- /dev/null +++ b/selfdrive/tombstoned.py @@ -0,0 +1,215 @@ +#!/usr/bin/env python3 +import datetime +import os +import re +import shutil +import signal +import subprocess +import time +import glob +from typing import NoReturn + +from common.params import Params +from common.file_helpers import mkdirs_exists_ok +from selfdrive.hardware import TICI, HARDWARE +from selfdrive.loggerd.config import ROOT +import selfdrive.sentry as sentry +from selfdrive.swaglog import cloudlog +from selfdrive.version import get_commit + +MAX_SIZE = 100000 * 10 # mal size is 40-100k, allow up to 1M +if TICI: + MAX_SIZE = MAX_SIZE * 100 # Allow larger size for tici since files contain coredump +MAX_TOMBSTONE_FN_LEN = 62 # 85 - 23 ("/crash/") + +TOMBSTONE_DIR = "/data/tombstones/" +APPORT_DIR = "/var/crash/" + + +def safe_fn(s): + extra = ['_'] + return "".join(c for c in s if c.isalnum() or c in extra).rstrip() + + +def clear_apport_folder(): + for f in glob.glob(APPORT_DIR + '*'): + try: + os.remove(f) + except Exception: + pass + + +def get_apport_stacktrace(fn): + try: + cmd = f'apport-retrace -s <(cat <(echo "Package: openpilot") "{fn}")' + return subprocess.check_output(cmd, shell=True, encoding='utf8', timeout=30, executable='/bin/bash') # pylint: disable=unexpected-keyword-arg + except subprocess.CalledProcessError: + return "Error getting stacktrace" + except subprocess.TimeoutExpired: + return "Timeout getting stacktrace" + + +def get_tombstones(): + """Returns list of (filename, ctime) for all tombstones in /data/tombstones + and apport crashlogs in /var/crash""" + files = [] + for folder in [TOMBSTONE_DIR, APPORT_DIR]: + if os.path.exists(folder): + with os.scandir(folder) as d: + + # Loop over first 1000 directory entries + for _, f in zip(range(1000), d): + if f.name.startswith("tombstone"): + files.append((f.path, int(f.stat().st_ctime))) + elif f.name.endswith(".crash") and f.stat().st_mode == 0o100640: + files.append((f.path, int(f.stat().st_ctime))) + return files + + +def report_tombstone_android(fn): + f_size = os.path.getsize(fn) + if f_size > MAX_SIZE: + cloudlog.error(f"Tombstone {fn} too big, {f_size}. Skipping...") + return + + with open(fn, encoding='ISO-8859-1') as f: + contents = f.read() + + message = " ".join(contents.split('\n')[5:7]) + + # Cut off pid/tid, since that varies per run + name_idx = message.find('name') + if name_idx >= 0: + message = message[name_idx:] + + executable = "" + start_exe_idx = message.find('>>> ') + end_exe_idx = message.find(' <<<') + if start_exe_idx >= 0 and end_exe_idx >= 0: + executable = message[start_exe_idx + 4:end_exe_idx] + + # Cut off fault addr + fault_idx = message.find(', fault addr') + if fault_idx >= 0: + message = message[:fault_idx] + + sentry.report_tombstone(fn, message, contents) + + # Copy crashlog to upload folder + clean_path = executable.replace('./', '').replace('/', '_') + date = datetime.datetime.now().strftime("%Y-%m-%d--%H-%M-%S") + + new_fn = f"{date}_{get_commit(default='nocommit')[:8]}_{safe_fn(clean_path)}"[:MAX_TOMBSTONE_FN_LEN] + + crashlog_dir = os.path.join(ROOT, "crash") + mkdirs_exists_ok(crashlog_dir) + + shutil.copy(fn, os.path.join(crashlog_dir, new_fn)) + + +def report_tombstone_apport(fn): + f_size = os.path.getsize(fn) + if f_size > MAX_SIZE: + cloudlog.error(f"Tombstone {fn} too big, {f_size}. Skipping...") + return + + message = "" # One line description of the crash + contents = "" # Full file contents without coredump + path = "" # File path relative to openpilot directory + + proc_maps = False + + with open(fn) as f: + for line in f: + if "CoreDump" in line: + break + elif "ProcMaps" in line: + proc_maps = True + elif "ProcStatus" in line: + proc_maps = False + + if not proc_maps: + contents += line + + if "ExecutablePath" in line: + path = line.strip().split(': ')[-1] + path = path.replace('/data/openpilot/', '') + message += path + elif "Signal" in line: + message += " - " + line.strip() + + try: + sig_num = int(line.strip().split(': ')[-1]) + message += " (" + signal.Signals(sig_num).name + ")" # pylint: disable=no-member + except ValueError: + pass + + stacktrace = get_apport_stacktrace(fn) + stacktrace_s = stacktrace.split('\n') + crash_function = "No stacktrace" + + if len(stacktrace_s) > 2: + found = False + + # Try to find first entry in openpilot, fall back to first line + for line in stacktrace_s: + if "at selfdrive/" in line: + crash_function = line + found = True + break + + if not found: + crash_function = stacktrace_s[1] + + # Remove arguments that can contain pointers to make sentry one-liner unique + crash_function = " ".join(x for x in crash_function.split(' ')[1:] if not x.startswith('0x')) + crash_function = re.sub(r'\(.*?\)', '', crash_function) + + contents = stacktrace + "\n\n" + contents + message = message + " - " + crash_function + sentry.report_tombstone(fn, message, contents) + + # Copy crashlog to upload folder + clean_path = path.replace('/', '_') + date = datetime.datetime.now().strftime("%Y-%m-%d--%H-%M-%S") + + new_fn = f"{date}_{get_commit(default='nocommit')[:8]}_{safe_fn(clean_path)}"[:MAX_TOMBSTONE_FN_LEN] + + crashlog_dir = os.path.join(ROOT, "crash") + mkdirs_exists_ok(crashlog_dir) + + # Files could be on different filesystems, copy, then delete + shutil.copy(fn, os.path.join(crashlog_dir, new_fn)) + + try: + os.remove(fn) + except PermissionError: + pass + + +def main() -> NoReturn: + sentry.init(sentry.SentryProject.SELFDRIVE_NATIVE) + + # Clear apport folder on start, otherwise duplicate crashes won't register + clear_apport_folder() + initial_tombstones = set(get_tombstones()) + + while True: + now_tombstones = set(get_tombstones()) + + for fn, _ in (now_tombstones - initial_tombstones): + try: + cloudlog.info(f"reporting new tombstone {fn}") + if fn.endswith(".crash"): + report_tombstone_apport(fn) + else: + report_tombstone_android(fn) + except Exception: + cloudlog.exception(f"Error reporting tombstone {fn}") + + initial_tombstones = now_tombstones + time.sleep(5) + + +if __name__ == "__main__": + main() diff --git a/selfdrive/ui/.gitignore b/selfdrive/ui/.gitignore new file mode 100644 index 000000000..5f8a96edf --- /dev/null +++ b/selfdrive/ui/.gitignore @@ -0,0 +1,14 @@ +moc_* +*.moc + +_mui +watch3 +installer/installers/* +replay/replay +replay/tests/test_replay +qt/text +qt/spinner +qt/setup/setup +qt/setup/reset +qt/setup/wifi +qt/setup/updater diff --git a/selfdrive/ui/SConscript b/selfdrive/ui/SConscript new file mode 100644 index 000000000..4a1b2f6ca --- /dev/null +++ b/selfdrive/ui/SConscript @@ -0,0 +1,136 @@ +import os +Import('qt_env', 'arch', 'common', 'messaging', 'gpucommon', 'visionipc', + 'cereal', 'transformations') + +base_libs = [gpucommon, common, messaging, cereal, visionipc, transformations, 'zmq', + 'capnp', 'kj', 'm', 'OpenCL', 'ssl', 'crypto', 'pthread'] + qt_env["LIBS"] + +maps = arch in ['larch64', 'x86_64'] + +if arch == 'aarch64': + base_libs += ['log', 'utils', 'gui', 'ui', 'CB', 'gsl', 'adreno_utils', 'cutils', 'uuid'] + +if maps and arch == 'x86_64': + rpath = [Dir(f"#third_party/mapbox-gl-native-qt/{arch}").srcnode().abspath] + qt_env["RPATH"] += rpath + +if arch == "Darwin": + del base_libs[base_libs.index('OpenCL')] + qt_env['FRAMEWORKS'] += ['OpenCL'] + +widgets_src = ["qt/util.cc", "qt/widgets/input.cc", "qt/widgets/drive_stats.cc", + "qt/widgets/ssh_keys.cc", "qt/widgets/toggle.cc", "qt/widgets/controls.cc", + "qt/widgets/offroad_alerts.cc", "qt/widgets/prime.cc", "qt/widgets/keyboard.cc", + "qt/widgets/scrollview.cc", "qt/widgets/cameraview.cc", "#third_party/qrcode/QrCode.cc", "qt/api.cc", + "qt/request_repeater.cc", "qt/qt_window.cc", "../car/modules/qt/tcontrols.cc"] + +if arch != 'aarch64': + widgets_src += ["qt/offroad/networking.cc", "qt/offroad/wifiManager.cc"] + +qt_env['CPPDEFINES'] = [] +if maps: + base_libs += ['qmapboxgl'] + widgets_src += ["qt/maps/map_helpers.cc", "qt/maps/map_settings.cc", "qt/maps/map.cc"] + qt_env['CPPDEFINES'] += ["ENABLE_MAPS"] + +widgets = qt_env.Library("qt_widgets", widgets_src, LIBS=base_libs) +qt_libs = [widgets] + base_libs + +# build assets +assets = "#selfdrive/assets/assets.cc" +assets_src = "#selfdrive/assets/assets.qrc" +qt_env.Command(assets, assets_src, f"rcc $SOURCES -o $TARGET") +qt_env.Depends(assets, Glob('#selfdrive/assets/*', exclude=[assets, assets_src, "#selfdrive/assets/assets.o"])) +asset_obj = qt_env.Object("assets", assets) + +# build soundd +qt_env.Program("soundd/_soundd", ["soundd/main.cc", "soundd/sound.cc"], LIBS=qt_libs) +if GetOption('test'): + qt_env.Program("tests/playsound", "tests/playsound.cc", LIBS=base_libs) + qt_env.Program('tests/test_sound', ['tests/test_runner.cc', 'soundd/sound.cc', 'tests/test_sound.cc'], LIBS=qt_libs) + +qt_env.SharedLibrary("qt/python_helpers", ["qt/qt_window.cc"], LIBS=qt_libs) + +# spinner and text window +qt_env.Program("qt/text", ["qt/text.cc"], LIBS=qt_libs) +qt_env.Program("qt/flasher", ["qt/flasher.cc"], LIBS=qt_libs) +qt_env.Program("qt/spinner", ["qt/spinner.cc"], LIBS=qt_libs) + +# build main UI +qt_src = ["main.cc", "ui.cc", "qt/sidebar.cc", "qt/onroad.cc", + "qt/window.cc", "qt/home.cc", "qt/offroad/settings.cc", + "qt/offroad/onboarding.cc", "qt/offroad/driverview.cc", + "../car/modules/qt/tsettings.cc", "../car/modules/qt/num_param.cc"] +qt_env.Program("_ui", qt_src + [asset_obj], LIBS=qt_libs) + + +# setup and factory resetter +if arch != 'aarch64' and GetOption('extras'): + qt_env.Program("qt/setup/reset", ["qt/setup/reset.cc"], LIBS=qt_libs) + qt_env.Program("qt/setup/setup", ["qt/setup/setup.cc", asset_obj], + LIBS=qt_libs + ['curl', 'common', 'json11']) + + +if GetOption('extras'): + # buidl updater UI + qt_env.Program("qt/setup/updater", ["qt/setup/updater.cc", asset_obj], LIBS=qt_libs) + + # build mui + qt_env.Program("_mui", ["mui.cc"], LIBS=qt_libs) + + # build installers + senv = qt_env.Clone() + senv['LINKFLAGS'].append('-Wl,-strip-debug') + + release = "release3" if arch == 'larch64' else "release2" + dashcam = "dashcam3" if arch == 'larch64' else "dashcam" + installers = [ + ("openpilot", release), + ("openpilot_test", f"{release}-staging"), + ("openpilot_nightly", "master-ci"), + ("openpilot_internal", "master"), + ("dashcam", dashcam), + ("dashcam_test", f"{dashcam}-staging"), + ] + + cont = {} + for brand in ("openpilot", "dashcam"): + cont[brand] = senv.Command(f"installer/continue_{brand}.o", f"installer/continue_{brand}.sh", + "ld -r -b binary -o $TARGET $SOURCE") + for name, branch in installers: + brand = "dashcam" if "dashcam" in branch else "openpilot" + d = {'BRANCH': f"'\"{branch}\"'", 'BRAND': f"'\"{brand}\"'"} + if "internal" in name: + d['INTERNAL'] = "1" + + import requests + r = requests.get("https://github.com/commaci2.keys") + r.raise_for_status() + d['SSH_KEYS'] = f'\\"{r.text.strip()}\\"' + obj = senv.Object(f"installer/installers/installer_{name}.o", ["installer/installer.cc"], CPPDEFINES=d) + f = senv.Program(f"installer/installers/installer_{name}", [obj, cont[brand]], LIBS=qt_libs) + # keep installers small + assert f[0].get_size() < 300*1e3 + + +# build headless replay +if arch in ['x86_64', 'Darwin'] or GetOption('extras'): + qt_env['CXXFLAGS'] += ["-Wno-deprecated-declarations"] + + replay_lib_src = ["replay/replay.cc", "replay/consoleui.cc", "replay/camera.cc", "replay/filereader.cc", "replay/logreader.cc", "replay/framereader.cc", "replay/route.cc", "replay/util.cc"] + + replay_lib = qt_env.Library("qt_replay", replay_lib_src, LIBS=base_libs) + replay_libs = [replay_lib, 'avutil', 'avcodec', 'avformat', 'bz2', 'curl', 'yuv', 'ncurses'] + qt_libs + qt_env.Program("replay/replay", ["replay/main.cc"], LIBS=replay_libs) + qt_env.Program("watch3", ["watch3.cc"], LIBS=qt_libs + ['common', 'json11', 'zmq', 'visionipc', 'messaging']) + + if GetOption('test'): + qt_env.Program('replay/tests/test_replay', ['replay/tests/test_runner.cc', 'replay/tests/test_replay.cc'], LIBS=[replay_libs]) + +# navd +if maps: + navd_src = ["navd/main.cc", "navd/route_engine.cc", "navd/map_renderer.cc"] + qt_env.Program("navd/_navd", navd_src, LIBS=qt_libs + ['common', 'json11']) + + if GetOption('extras'): + qt_env.SharedLibrary("navd/map_renderer", ["navd/map_renderer.cc"], LIBS=qt_libs + ['common', 'messaging']) diff --git a/selfdrive/ui/_ui b/selfdrive/ui/_ui new file mode 100755 index 000000000..004a09521 Binary files /dev/null and b/selfdrive/ui/_ui differ diff --git a/selfdrive/ui/bbui.h b/selfdrive/ui/bbui.h new file mode 100644 index 000000000..84271ced1 --- /dev/null +++ b/selfdrive/ui/bbui.h @@ -0,0 +1,1469 @@ +#pragma once + +#include "cereal/gen/c/ui.capnp.h" + +#if !defined(QCOM) && !defined(QCOM2) +#ifndef __APPLE__ +#define GLFW_INCLUDE_ES2 +#else +#define GLFW_INCLUDE_GLCOREARB +#endif + +#define GLFW_INCLUDE_GLEXT +#include +int linux_abs_x = 0; +int linux_abs_y = 0; +UIState *mouse_ui_state; +#endif +// TODO: this is also hardcoded in common/transformations/camera.py + + +vec3 bb_car_space_to_full_frame(const UIState *s, vec4 car_space_projective) { + const UIScene *scene = &s->scene; + + // We'll call the car space point p. + // First project into normalized image coordinates with the extrinsics matrix. + const vec4 Ep4 = matvecmul(scene->extrinsic_matrix, car_space_projective); + + // The last entry is zero because of how we store E (to use matvecmul). + const vec3 Ep = {{Ep4.v[0], Ep4.v[1], Ep4.v[2]}}; + const vec3 KEp = matvecmul3(intrinsic_matrix, Ep); + + // Project. + const vec3 p_image = {{KEp.v[0] / KEp.v[2], KEp.v[1] / KEp.v[2], 1.}}; + return p_image; +} + + + +void bb_ui_draw_vision_alert( UIState *s, int va_size, int va_color, + const char* va_text1, const char* va_text2) { + const UIScene *scene = &s->scene; + int ui_viz_rx = scene->ui_viz_rx; + int ui_viz_rw = scene->ui_viz_rw; + bool hasSidebar = !s->scene.uilayout_sidebarcollapsed; + bool mapEnabled = s->scene.uilayout_mapenabled; + bool longAlert1 = strlen(va_text1) > 15; + + const uint8_t *color = alert_colors[va_color]; + const int alr_s = alert_sizes[va_size]; + const int alr_x = ui_viz_rx-(mapEnabled?(hasSidebar?nav_w:(nav_ww)):0)-bdr_s; + const int alr_w = ui_viz_rw+(mapEnabled?(hasSidebar?nav_w:(nav_ww)):0)+(bdr_s*2); + const int alr_h = alr_s+(va_size==ALERTSIZE_NONE?0:bdr_s); + const int alr_y = vwp_h-alr_h; + + nvgBeginPath(s->vg); + nvgRect(s->vg, alr_x, alr_y, alr_w, alr_h); + nvgFillColor(s->vg, nvgRGBA(color[0],color[1],color[2],(color[3]*s->alert_blinking_alpha))); + nvgFill(s->vg); + + nvgBeginPath(s->vg); + NVGpaint gradient = nvgLinearGradient(s->vg, alr_x, alr_y, alr_x, alr_y+alr_h, + nvgRGBAf(0.0,0.0,0.0,0.05), nvgRGBAf(0.0,0.0,0.0,0.35)); + nvgFillPaint(s->vg, gradient); + nvgRect(s->vg, alr_x, alr_y, alr_w, alr_h); + nvgFill(s->vg); + + nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 255)); + nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); + + if (va_size == ALERTSIZE_SMALL) { + nvgFontFace(s->vg, "sans-semibold"); + nvgFontSize(s->vg, 40*2.5); + nvgText(s->vg, alr_x+alr_w/2, alr_y+alr_h/2+15, va_text1, NULL); + } else if (va_size== ALERTSIZE_MID) { + nvgFontFace(s->vg, "sans-bold"); + nvgFontSize(s->vg, 48*2.5); + nvgText(s->vg, alr_x+alr_w/2, alr_y+alr_h/2-45, va_text1, NULL); + nvgFontFace(s->vg, "sans-regular"); + nvgFontSize(s->vg, 36*2.5); + nvgText(s->vg, alr_x+alr_w/2, alr_y+alr_h/2+75, va_text2, NULL); + } else if (va_size== ALERTSIZE_FULL) { + nvgFontSize(s->vg, (longAlert1?72:96)*2.5); + nvgFontFace(s->vg, "sans-bold"); + nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE); + nvgTextBox(s->vg, alr_x, alr_y+(longAlert1?360:420), alr_w-60, va_text1, NULL); + nvgFontSize(s->vg, 48*2.5); + nvgFontFace(s->vg, "sans-regular"); + nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BOTTOM); + nvgTextBox(s->vg, alr_x, alr_h-(longAlert1?300:360), alr_w-60, va_text2, NULL); + } +} + + + +void bb_ui_draw_car( UIState *s) { + // replaces the draw_chevron function when button in mid position + //static void draw_chevron(UIState *s, float x_in, float y_in, float sz, + // NVGcolor fillColor, NVGcolor glowColor) { + if (!s->scene.lead_status) { + //no lead car to draw + return; + } + if (!s->b.icShowCar) { + return; + } + const UIScene *scene = &s->scene; + float x_in = scene->lead_d_rel+2.7; + float y_in = scene->lead_y_rel; + float sz = 1.0; + + nvgSave(s->vg); + nvgTranslate(s->vg, 240.0f, 0.0); + nvgTranslate(s->vg, -1440.0f / 2, -1080.0f / 2); + nvgScale(s->vg, 2.0, 2.0); + nvgScale(s->vg, 1440.0f / s->rgb_width, 1080.0f / s->rgb_height); + + const vec4 p_car_space = (vec4){{x_in, y_in, 0., 1.}}; + const vec3 p_full_frame = bb_car_space_to_full_frame(s, p_car_space); + + float x = p_full_frame.v[0]; + float y = p_full_frame.v[1]; + + // glow + + float bbsz =0.1* 0.1 + 0.6 * (180-x_in*3.3-20)/180; + if (bbsz < 0.1) bbsz = 0.1; + if (bbsz > 0.6) bbsz = 0.6; + float car_alpha = .8; + float car_w = 750 * bbsz; + float car_h = 531 * bbsz; + float car_y = y - car_h/2; + float car_x = x - car_w/2; + + nvgBeginPath(s->vg); + NVGpaint imgPaint = nvgImagePattern(s->vg, car_x, car_y, + car_w, car_h, 0, s->b.img_car, car_alpha); + nvgRect(s->vg, car_x, car_y, car_w, car_h); + nvgFillPaint(s->vg, imgPaint); + nvgFill(s->vg); + nvgRestore(s->vg); +} + +void bb_draw_lane_fill ( UIState *s) { + + const UIScene *scene = &s->scene; + + nvgSave(s->vg); + nvgTranslate(s->vg, 240.0f, 0.0); // rgb-box space + nvgTranslate(s->vg, -1440.0f / 2, -1080.0f / 2); // zoom 2x + nvgScale(s->vg, 2.0, 2.0); + nvgScale(s->vg, 1440.0f / s->rgb_width, 1080.0f / s->rgb_height); + nvgBeginPath(s->vg); + + //BB let the magic begin + //define variables + PathData path; + float *points; + float off; + NVGcolor bb_color = nvgRGBA(138, 140, 142,180); + bool started = false; + bool is_ghost = true; + //left lane, first init + path = scene->model.left_lane; + points = path.points; + off = 0.025*path.prob; + //draw left + for (int i=0; i<49; i++) { + float px = (float)i; + float py = points[i] - off; + vec4 p_car_space = (vec4){{px, py, 0., 1.}}; + vec3 p_full_frame = bb_car_space_to_full_frame(s, p_car_space); + float x = p_full_frame.v[0]; + float y = p_full_frame.v[1]; + if (x < 0 || y < 0.) { + continue; + } + if (!started) { + nvgMoveTo(s->vg, x, y); + started = true; + } else { + nvgLineTo(s->vg, x, y); + } + } + //right lane, first init + path = scene->model.right_lane; + points = path.points; + off = 0.025*path.prob; + //draw right + for (int i=49; i>0; i--) { + float px = (float)i; + float py = is_ghost?(points[i]-off):(points[i]+off); + vec4 p_car_space = (vec4){{px, py, 0., 1.}}; + vec3 p_full_frame = bb_car_space_to_full_frame(s, p_car_space); + float x = p_full_frame.v[0]; + float y = p_full_frame.v[1]; + if (x < 0 || y < 0.) { + continue; + } + nvgLineTo(s->vg, x, y); + } + + nvgClosePath(s->vg); + nvgFillColor(s->vg, bb_color); + nvgFill(s->vg); + nvgRestore(s->vg); + +} + + + + + +long bb_currentTimeInMilis() { + struct timespec res; + clock_gettime(CLOCK_MONOTONIC, &res); + return (res.tv_sec * 1000) + res.tv_nsec/1000000; +} + +int bb_get_status( UIState *s) { + //BB select status based on main s->status w/ priority over s->b.custom_message_status + int bb_status = -1; + if ((s->status == STATUS_ENGAGED) && (s->b.custom_message_status > STATUS_ENGAGED)) { + bb_status = s->b.custom_message_status; + } else { + bb_status = s->status; + } + return bb_status; +} + +int bb_ui_draw_measure( UIState *s, const char* bb_value, const char* bb_uom, const char* bb_label, + int bb_x, int bb_y, int bb_uom_dx, + NVGcolor bb_valueColor, NVGcolor bb_labelColor, NVGcolor bb_uomColor, + int bb_valueFontSize, int bb_labelFontSize, int bb_uomFontSize ) { + const UIScene *scene = &s->scene; + nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); + int dx = 0; + if (strlen(bb_uom) > 0) { + dx = (int)(bb_uomFontSize*2.5/2); + } + //print value + nvgFontFace(s->vg, "sans-semibold"); + nvgFontSize(s->vg, bb_valueFontSize*2.5); + nvgFillColor(s->vg, bb_valueColor); + nvgText(s->vg, bb_x-dx/2, bb_y+ (int)(bb_valueFontSize*2.5)+5, bb_value, NULL); + //print label + nvgFontFace(s->vg, "sans-regular"); + nvgFontSize(s->vg, bb_labelFontSize*2.5); + nvgFillColor(s->vg, bb_labelColor); + nvgText(s->vg, bb_x, bb_y + (int)(bb_valueFontSize*2.5)+5 + (int)(bb_labelFontSize*2.5)+5, bb_label, NULL); + //print uom + if (strlen(bb_uom) > 0) { + nvgSave(s->vg); + int rx =bb_x + bb_uom_dx + bb_valueFontSize -3; + int ry = bb_y + (int)(bb_valueFontSize*2.5/2)+25; + nvgTranslate(s->vg,rx,ry); + nvgRotate(s->vg, -1.5708); //-90deg in radians + nvgFontFace(s->vg, "sans-regular"); + nvgFontSize(s->vg, (int)(bb_uomFontSize*2.5)); + nvgFillColor(s->vg, bb_uomColor); + nvgText(s->vg, 0, 0, bb_uom, NULL); + nvgRestore(s->vg); + } + return (int)((bb_valueFontSize + bb_labelFontSize)*2.5) + 5; +} + + + +bool bb_handle_ui_touch( UIState *s, int touch_x, int touch_y) { +#if !defined(QCOM) && !defined(QCOM2) + touch_x = (int)(vwp_w * touch_x / 1280); + touch_y = (int)(vwp_h * touch_y / 720); + printf("Linux mouse up at %d, %d ( %d, %d)\n",(int)touch_x, (int)touch_y, linux_abs_x, linux_abs_y); +#endif + for(int i=0; i<6; i++) { + if (s->b.btns_r[i] > 0) { + if ((abs(touch_x - s->b.btns_x[i]) < s->b.btns_r[i]) && (abs(touch_y - s->b.btns_y[i]) < s->b.btns_r[i])) { + //found it; change the status + if (s->b.btns_status[i] > 0) { + s->b.btns_status[i] = 0; + } else { + s->b.btns_status[i] = 1; + } + //now let's send the cereal + + struct capn c; + capn_init_malloc(&c); + struct capn_ptr cr = capn_root(&c); + struct capn_segment *cs = cr.seg; + + struct cereal_UIButtonStatus btn_d; + btn_d.btnId = i; + btn_d.btnStatus = s->b.btns_status[i]; + + cereal_UIButtonStatus_ptr btn_p = cereal_new_UIButtonStatus(cs); + + cereal_write_UIButtonStatus(&btn_d, btn_p); + int setp_ret = capn_setp(capn_root(&c), 0, btn_p.p); + assert(setp_ret == 0); + + uint8_t buf[4096]; + ssize_t rs = capn_write_mem(&c, buf, sizeof(buf), 0); + char* data = (char*) buf; + capn_free(&c); + + s->b.uiButtonStatus_sock->send(data,rs); + + return true; + } + } + } + return false; +}; + +#if !defined(QCOM) && !defined(QCOM2) +void bb_mouse_event_handler(GLFWwindow* window, int button, int action, int mods) { + if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_RELEASE) { + + double xpos, ypos; + glfwGetCursorPos(window, &xpos, &ypos); + int w_width,w_height; + glfwGetWindowSize(window, &linux_abs_x, &linux_abs_y); + bb_handle_ui_touch(mouse_ui_state,(int) xpos, (int)ypos); + } +} +#endif + + +int bb_get_button_status( UIState *s, char *btn_name) { + int ret_status = -1; + for (int i = 0; i< 6; i++) { + if (strcmp(s->b.btns[i].btn_name,btn_name)==0) { + ret_status = s->b.btns_status[i]; + } + } + return ret_status; +} + +void bb_draw_button( UIState *s, int btn_id) { + const UIScene *scene = &s->scene; + + int viz_button_x = 0; + int viz_button_y = (box_y + (bdr_s*1.5)) + 20; + int viz_button_w = 140; + int viz_button_h = 140; + + char *btn_text, *btn_text2; + + int delta_x = viz_button_w * 1.1; + int delta_y = 0; + int dx1 = 200; + int dx2 = 190; + int dy = 0; + + if (s->b.tri_state_switch ==2) { + delta_y = delta_x; + delta_x = 0; + dx1 = 20; + dx2 = 160; + dy = 200; + } + + if (btn_id >2) { + viz_button_x = scene->ui_viz_rx + scene->ui_viz_rw - (bdr_s*2) -dx2; + viz_button_x -= (6-btn_id) * delta_x ; + viz_button_y += (btn_id-3) * delta_y + dy; + + } else { + viz_button_x = scene->ui_viz_rx + (bdr_s*2) + dx1; + viz_button_x += (btn_id) * delta_x; + viz_button_y += btn_id * delta_y + dy; + } + + + btn_text = s->b.btns[btn_id].btn_label; + btn_text2 = s->b.btns[btn_id].btn_label2; + + if (strcmp(btn_text,"")==0) { + s->b.btns_r[btn_id] = 0; + } else { + s->b.btns_r[btn_id]= (int)((viz_button_w + viz_button_h)/4); + } + s->b.btns_x[btn_id]=viz_button_x + s->b.btns_r[btn_id]; + s->b.btns_y[btn_id]=viz_button_y + s->b.btns_r[btn_id]; + if (s->b.btns_r[btn_id] == 0) { + return; + } + + nvgBeginPath(s->vg); + nvgRoundedRect(s->vg, viz_button_x, viz_button_y, viz_button_w, viz_button_h, 80); + nvgStrokeWidth(s->vg, 12); + + + if (s->b.btns_status[btn_id] ==0) { + //disabled - red + nvgStrokeColor(s->vg, nvgRGBA(255, 0, 0, 200)); + if (strcmp(btn_text2,"")==0) { + btn_text2 = (char *)"Off"; + } + } else + if (s->b.btns_status[btn_id] ==1) { + //enabled - white + nvgStrokeColor(s->vg, nvgRGBA(255,255,255,200)); + nvgStrokeWidth(s->vg, 4); + if (strcmp(btn_text2,"")==0) { + btn_text2 = (char *)"Ready"; + } + } else + if (s->b.btns_status[btn_id] ==2) { + //active - green + nvgStrokeColor(s->vg, nvgRGBA(28, 204,98,200)); + if (strcmp(btn_text2,"")==0) { + btn_text2 = (char *)"Active"; + } + } else + if (s->b.btns_status[btn_id] ==9) { + //available - thin white + nvgStrokeColor(s->vg, nvgRGBA(200,200,200,40)); + nvgStrokeWidth(s->vg, 4); + if (strcmp(btn_text2,"")==0) { + btn_text2 = (char *)""; + } + } else { + //others - orange + nvgStrokeColor(s->vg, nvgRGBA(255, 188, 3, 200)); + if (strcmp(btn_text2,"")==0) { + btn_text2 = (char *)"Alert"; + } + } + + nvgStroke(s->vg); + + nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); + nvgFontFace(s->vg, "sans-regular"); + nvgFontSize(s->vg, 14*2.5); + nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 200)); + nvgText(s->vg, viz_button_x+viz_button_w/2, viz_button_y + 112, btn_text2, NULL); + + nvgFontFace(s->vg, "sans-semibold"); + nvgFontSize(s->vg, 28*2.5); + nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 255)); + nvgText(s->vg, viz_button_x+viz_button_w/2, viz_button_y + 85,btn_text, NULL); +} + +void bb_draw_buttons( UIState *s) { + for (int i = 0; i < 6; i++) { + bb_draw_button(s,i); + } +} + +void bb_ui_draw_custom_alert( UIState *s) { + if ((strlen(s->b.custom_message) > 0) && (strlen(s->scene.alert_text1)==0)){ + if ((!((bb_get_button_status(s,(char *)"msg") == 0) && (s->b.custom_message_status<=3))) && (s->vision_connected == true)) { + bb_ui_draw_vision_alert(s, ALERTSIZE_SMALL, s->b.custom_message_status, + s->b.custom_message,""); + } + } +} + + +void bb_ui_draw_measures_left( UIState *s, int bb_x, int bb_y, int bb_w ) { + const UIScene *scene = &s->scene; + int bb_rx = bb_x + (int)(bb_w/2); + int bb_ry = bb_y; + int bb_h = 5; + NVGcolor lab_color = nvgRGBA(255, 255, 255, 200); + NVGcolor uom_color = nvgRGBA(255, 255, 255, 200); + int value_fontSize=30; + int label_fontSize=15; + int uom_fontSize = 15; + int bb_uom_dx = (int)(bb_w /2 - uom_fontSize*2.5) ; + + //add CPU temperature + if (true) { + char val_str[16]; + char uom_str[6]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + if((int)(s->b.maxCpuTemp/10) > 80) { + val_color = nvgRGBA(255, 188, 3, 200); + } + if((int)(s->b.maxCpuTemp/10) > 92) { + val_color = nvgRGBA(255, 0, 0, 200); + } + // temp is alway in C * 10 + if (s->is_metric) { + snprintf(val_str, sizeof(val_str), "%d C", (int)(s->b.maxCpuTemp/10)); + } else { + snprintf(val_str, sizeof(val_str), "%d F", (int)(32+9*(s->b.maxCpuTemp/10)/5)); + } + snprintf(uom_str, sizeof(uom_str), ""); + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "CPU TEMP", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + + //add battery temperature + if (true) { + char val_str[16]; + char uom_str[6]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + if((int)(s->b.maxBatTemp/1000) > 40) { + val_color = nvgRGBA(255, 188, 3, 200); + } + if((int)(s->b.maxBatTemp/1000) > 50) { + val_color = nvgRGBA(255, 0, 0, 200); + } + // temp is alway in C * 1000 + if (s->is_metric) { + snprintf(val_str, sizeof(val_str), "%d C", (int)(s->b.maxBatTemp/1000)); + } else { + snprintf(val_str, sizeof(val_str), "%d F", (int)(32+9*(s->b.maxBatTemp/1000)/5)); + } + snprintf(uom_str, sizeof(uom_str), ""); + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "BAT TEMP", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + + //add grey panda GPS accuracy + if (true) { + char val_str[16]; + char uom_str[3]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + //show red/orange if gps accuracy is high + if(s->b.gpsAccuracy > 0.59) { + val_color = nvgRGBA(255, 188, 3, 200); + } + if(s->b.gpsAccuracy > 0.8) { + val_color = nvgRGBA(255, 0, 0, 200); + } + + + // gps accuracy is always in meters + if (true) { + snprintf(val_str, sizeof(val_str), "%d", (int)(s->b.gpsAccuracy*100.0)); + } else { + snprintf(val_str, sizeof(val_str), "%.1f", s->b.gpsAccuracy * 3.28084 * 12); + } + if (true) { + snprintf(uom_str, sizeof(uom_str), "cm");; + } else { + snprintf(uom_str, sizeof(uom_str), "in"); + } + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "GPS PREC", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + //add free space - from bthaler1 + if (true) { + char val_str[16]; + char uom_str[3]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + + //show red/orange if free space is low + if(s->b.freeSpace < 0.4) { + val_color = nvgRGBA(255, 188, 3, 200); + } + if(s->b.freeSpace < 0.2) { + val_color = nvgRGBA(255, 0, 0, 200); + } + + snprintf(val_str, sizeof(val_str), "%.1f", s->b.freeSpace* 100); + snprintf(uom_str, sizeof(uom_str), "%%"); + + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "FREE", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + //finally draw the frame + bb_h += 20; + nvgBeginPath(s->vg); + nvgRoundedRect(s->vg, bb_x, bb_y, bb_w, bb_h, 20); + nvgStrokeColor(s->vg, nvgRGBA(255,255,255,80)); + nvgStrokeWidth(s->vg, 6); + nvgStroke(s->vg); +} + +void bb_ui_draw_measures_left2( UIState *s, int bb_x, int bb_y, int bb_w ) { + const UIScene *scene = &s->scene; + int bb_rx = bb_x + (int)(bb_w/2); + int bb_ry = bb_y; + int bb_h = 5; + NVGcolor lab_color = nvgRGBA(255, 255, 255, 200); + NVGcolor uom_color = nvgRGBA(255, 255, 255, 200); + int value_fontSize=30; + int label_fontSize=15; + int uom_fontSize = 15; + int bb_uom_dx = (int)(bb_w /2 - uom_fontSize*2.5) ; + + //add CPU temperature + if (true) { + char val_str[16]; + char uom_str[6]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + if((int)(s->b.maxCpuTemp/10) > 80) { + val_color = nvgRGBA(255, 188, 3, 200); + } + if((int)(s->b.maxCpuTemp/10) > 92) { + val_color = nvgRGBA(255, 0, 0, 200); + } + // temp is alway in C * 10 + if (s->is_metric) { + snprintf(val_str, sizeof(val_str), "%d C", (int)(s->b.maxCpuTemp/10)); + } else { + snprintf(val_str, sizeof(val_str), "%d F", (int)(32+9*(s->b.maxCpuTemp/10)/5)); + } + snprintf(uom_str, sizeof(uom_str), ""); + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "CPU TEMP", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + + //add battery temperature + if (true) { + char val_str[16]; + char uom_str[6]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + if((int)(s->b.maxBatTemp/1000) > 40) { + val_color = nvgRGBA(255, 188, 3, 200); + } + if((int)(s->b.maxBatTemp/1000) > 50) { + val_color = nvgRGBA(255, 0, 0, 200); + } + // temp is alway in C * 1000 + if (s->is_metric) { + snprintf(val_str, sizeof(val_str), "%d C", (int)(s->b.maxBatTemp/1000)); + } else { + snprintf(val_str, sizeof(val_str), "%d F", (int)(32+9*(s->b.maxBatTemp/1000)/5)); + } + snprintf(uom_str, sizeof(uom_str), ""); + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "BAT TEMP", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + + //add battery level (%) + if (true) { + char val_str[16]; + char uom_str[3]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + + //show red/orange if free space is low + if(s->b.batteryPercent < 40) { + val_color = nvgRGBA(255, 188, 3, 200); + } + if(s->b.batteryPercent < 20) { + val_color = nvgRGBA(255, 0, 0, 200); + } + + snprintf(val_str, sizeof(val_str), "%d", s->b.batteryPercent); + snprintf(uom_str, sizeof(uom_str), "%%"); + + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "BAT LOAD", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + + //add charger status + if (true) { + char val_str[16]; + char uom_str[3]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + //show orange if charger is off + if(!s->b.chargingEnabled) { + val_color = nvgRGBA(255, 188, 3, 200); + } + // gps accuracy is always in meters + if (s->b.chargingEnabled) { + snprintf(val_str, sizeof(val_str), "ON"); + } else { + snprintf(val_str, sizeof(val_str), "OFF"); + } + snprintf(uom_str, sizeof(uom_str), " "); + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "CHARGER", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + + //finally draw the frame + bb_h += 20; + nvgBeginPath(s->vg); + nvgRoundedRect(s->vg, bb_x, bb_y, bb_w, bb_h, 20); + nvgStrokeColor(s->vg, nvgRGBA(255,255,255,80)); + nvgStrokeWidth(s->vg, 6); + nvgStroke(s->vg); +} + + +void bb_ui_draw_measures_right( UIState *s, int bb_x, int bb_y, int bb_w ) { + const UIScene *scene = &s->scene; + int bb_rx = bb_x + (int)(bb_w/2); + int bb_ry = bb_y; + int bb_h = 5; + NVGcolor lab_color = nvgRGBA(255, 255, 255, 200); + NVGcolor uom_color = nvgRGBA(255, 255, 255, 200); + int value_fontSize=30; + int label_fontSize=15; + int uom_fontSize = 15; + int bb_uom_dx = (int)(bb_w /2 - uom_fontSize*2.5) ; + + //add visual radar relative distance + if (true) { + char val_str[16]; + char uom_str[6]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + if (scene->lead_status) { + //show RED if less than 5 meters + //show orange if less than 15 meters + if((int)(scene->lead_d_rel) < 15) { + val_color = nvgRGBA(255, 188, 3, 200); + } + if((int)(scene->lead_d_rel) < 5) { + val_color = nvgRGBA(255, 0, 0, 200); + } + // lead car relative distance is always in meters + if (s->is_metric) { + snprintf(val_str, sizeof(val_str), "%d", (int)scene->lead_d_rel); + } else { + snprintf(val_str, sizeof(val_str), "%d", (int)(scene->lead_d_rel * 3.28084)); + } + } else { + snprintf(val_str, sizeof(val_str), "-"); + } + if (s->is_metric) { + snprintf(uom_str, sizeof(uom_str), "m "); + } else { + snprintf(uom_str, sizeof(uom_str), "ft"); + } + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "REL DIST", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + + //add visual radar relative speed + if (true) { + char val_str[16]; + char uom_str[6]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + if (scene->lead_status) { + //show Orange if negative speed (approaching) + //show Orange if negative speed faster than 5mph (approaching fast) + if((int)(scene->lead_v_rel) < 0) { + val_color = nvgRGBA(255, 188, 3, 200); + } + if((int)(scene->lead_v_rel) < -5) { + val_color = nvgRGBA(255, 0, 0, 200); + } + // lead car relative speed is always in meters + if (s->is_metric) { + snprintf(val_str, sizeof(val_str), "%d", (int)(scene->lead_v_rel * 3.6 + 0.5)); + } else { + snprintf(val_str, sizeof(val_str), "%d", (int)(scene->lead_v_rel * 2.2374144 + 0.5)); + } + } else { + snprintf(val_str, sizeof(val_str), "-"); + } + if (s->is_metric) { + snprintf(uom_str, sizeof(uom_str), "km/h");; + } else { + snprintf(uom_str, sizeof(uom_str), "mph"); + } + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "REL SPD", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + + //add steering angle + if (true) { + char val_str[16]; + char uom_str[6]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + //show Orange if more than 6 degrees + //show red if more than 12 degrees + if(((int)(s->b.angleSteers) < -6) || ((int)(s->b.angleSteers) > 6)) { + val_color = nvgRGBA(255, 188, 3, 200); + } + if(((int)(s->b.angleSteers) < -12) || ((int)(s->b.angleSteers) > 12)) { + val_color = nvgRGBA(255, 0, 0, 200); + } + // steering is in degrees + snprintf(val_str, sizeof(val_str), "%.1f",(s->b.angleSteers)); + + snprintf(uom_str, sizeof(uom_str), "deg"); + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "STEER", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + + //add desired steering angle + if (true) { + char val_str[16]; + char uom_str[6]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + //show Orange if more than 6 degrees + //show red if more than 12 degrees + if(((int)(s->b.angleSteersDes) < -6) || ((int)(s->b.angleSteersDes) > 6)) { + val_color = nvgRGBA(255, 188, 3, 200); + } + if(((int)(s->b.angleSteersDes) < -12) || ((int)(s->b.angleSteersDes) > 12)) { + val_color = nvgRGBA(255, 0, 0, 200); + } + // steering is in degrees + snprintf(val_str, sizeof(val_str), "%.1f",(s->b.angleSteersDes)); + + snprintf(uom_str, sizeof(uom_str), "deg"); + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "DES STEER", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + + + //finally draw the frame + bb_h += 20; + nvgBeginPath(s->vg); + nvgRoundedRect(s->vg, bb_x, bb_y, bb_w, bb_h, 20); + nvgStrokeColor(s->vg, nvgRGBA(255,255,255,80)); + nvgStrokeWidth(s->vg, 6); + nvgStroke(s->vg); +} + +void bb_ui_draw_measures_right2( UIState *s, int bb_x, int bb_y, int bb_w ) { + const UIScene *scene = &s->scene; + int bb_rx = bb_x + (int)(bb_w/2); + int bb_ry = bb_y; + int bb_h = 5; + NVGcolor lab_color = nvgRGBA(255, 255, 255, 200); + NVGcolor uom_color = nvgRGBA(255, 255, 255, 200); + int value_fontSize=30; + int label_fontSize=15; + int uom_fontSize = 15; + int bb_uom_dx = (int)(bb_w /2 - uom_fontSize*2.5) ; + + //Fan speed + if (true) { + char val_str[16]; + char uom_str[6]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + //show RED if at max + //show orange if lower than 16000 + if (s->b.fanSpeed == 0) { + snprintf(val_str, sizeof(val_str), "OFF"); + } else { + if((int)(s->b.fanSpeed) < 12000) { + val_color = nvgRGBA(255, 188, 3, 200); + s->b.fanSpeed = 12000; + } + if((int)(s->b.fanSpeed) > 65000) { + val_color = nvgRGBA(255, 0, 0, 200); + } + snprintf(val_str, sizeof(val_str), "%d", (int)(s->b.fanSpeed * 4500.0 /65535.0)); + } + snprintf(uom_str, sizeof(uom_str), "RPM"); + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "FAN SPEED", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + + //add grey panda GPS accuracy + if (true) { + char val_str[16]; + char uom_str[3]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + //show red/orange if gps accuracy is high + if(s->b.gpsAccuracy > 0.59) { + val_color = nvgRGBA(255, 188, 3, 200); + } + if(s->b.gpsAccuracy > 0.8) { + val_color = nvgRGBA(255, 0, 0, 200); + } + + + // gps accuracy is always in meters + if (true) { + snprintf(val_str, sizeof(val_str), "%d", (int)(s->b.gpsAccuracy*100.0)); + } else { + snprintf(val_str, sizeof(val_str), "%.1f", s->b.gpsAccuracy * 3.28084 * 12); + } + if (true) { + snprintf(uom_str, sizeof(uom_str), "cm");; + } else { + snprintf(uom_str, sizeof(uom_str), "in"); + } + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "GPS PREC", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + + //add steering angle + if (true) { + char val_str[16]; + char uom_str[6]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + //show Orange if more than 6 degrees + //show red if more than 12 degrees + if(((int)(s->b.angleSteers) < -6) || ((int)(s->b.angleSteers) > 6)) { + val_color = nvgRGBA(255, 188, 3, 200); + } + if(((int)(s->b.angleSteers) < -12) || ((int)(s->b.angleSteers) > 12)) { + val_color = nvgRGBA(255, 0, 0, 200); + } + // steering is in degrees + snprintf(val_str, sizeof(val_str), "%.1f",(s->b.angleSteers)); + + snprintf(uom_str, sizeof(uom_str), "deg"); + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "STEER", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + + //add desired steering angle + if (true) { + char val_str[16]; + char uom_str[6]; + NVGcolor val_color = nvgRGBA(255, 255, 255, 200); + //show Orange if more than 6 degrees + //show red if more than 12 degrees + if(((int)(s->b.angleSteersDes) < -6) || ((int)(s->b.angleSteersDes) > 6)) { + val_color = nvgRGBA(255, 188, 3, 200); + } + if(((int)(s->b.angleSteersDes) < -12) || ((int)(s->b.angleSteersDes) > 12)) { + val_color = nvgRGBA(255, 0, 0, 200); + } + // steering is in degrees + snprintf(val_str, sizeof(val_str), "%.1f",(s->b.angleSteersDes)); + + snprintf(uom_str, sizeof(uom_str), "deg"); + bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "DES STEER", + bb_rx, bb_ry, bb_uom_dx, + val_color, lab_color, uom_color, + value_fontSize, label_fontSize, uom_fontSize ); + bb_ry = bb_y + bb_h; + } + + + //finally draw the frame + bb_h += 20; + nvgBeginPath(s->vg); + nvgRoundedRect(s->vg, bb_x, bb_y, bb_w, bb_h, 20); + nvgStrokeColor(s->vg, nvgRGBA(255,255,255,80)); + nvgStrokeWidth(s->vg, 6); + nvgStroke(s->vg); +} + +//draw grid from wiki +void ui_draw_vision_grid( UIState *s) { + const UIScene *scene = &s->scene; + bool is_cruise_set = false;//(s->scene.v_cruise != 0 && s->scene.v_cruise != 255); + if (!is_cruise_set) { + const int grid_spacing = 30; + + int ui_viz_rx = scene->ui_viz_rx; + int ui_viz_rw = scene->ui_viz_rw; + + nvgSave(s->vg); + + // path coords are worked out in rgb-box space + nvgTranslate(s->vg, 240.0f, 0.0); + + // zooom in 2x + nvgTranslate(s->vg, -1440.0f / 2, -1080.0f / 2); + nvgScale(s->vg, 2.0, 2.0); + + nvgScale(s->vg, 1440.0f / s->rgb_width, 1080.0f / s->rgb_height); + + nvgBeginPath(s->vg); + nvgStrokeColor(s->vg, nvgRGBA(255,255,255,128)); + nvgStrokeWidth(s->vg, 1); + + for (int i=box_y; i < box_h; i+=grid_spacing) { + nvgMoveTo(s->vg, ui_viz_rx, i); + //nvgLineTo(s->vg, ui_viz_rx, i); + nvgLineTo(s->vg, ((ui_viz_rw + ui_viz_rx) / 2)+ 10, i); + } + + for (int i=ui_viz_rx + 12; i <= ui_viz_rw; i+=grid_spacing) { + nvgMoveTo(s->vg, i, 0); + nvgLineTo(s->vg, i, 1000); + } + nvgStroke(s->vg); + nvgRestore(s->vg); + } +} + +void bb_ui_draw_logo( UIState *s) { + if ((s->status != STATUS_DISENGAGED) && (s->status != STATUS_STOPPED)) { //(s->status != STATUS_DISENGAGED) {// + return; + } + if (!s->b.icShowLogo) { + return; + } + int rduration = 8000; + int logot = (bb_currentTimeInMilis() % rduration); + int logoi = s->b.img_logo; + if ((logot > (int)(rduration/4)) && (logot < (int)(3*rduration/4))) { + logoi = s->b.img_logo2; + } + if (logot < (int)(rduration/2)) { + logot = logot - (int)(rduration/4); + } else { + logot = logot - (int)(3*rduration/4); + } + float logop = fabs(4.0*logot/rduration); + const UIScene *scene = &s->scene; + const int ui_viz_rx = scene->ui_viz_rx; + const int ui_viz_rw = scene->ui_viz_rw; + const int viz_event_w = (int)(820 * logop); + const int viz_event_h = 820; + const int viz_event_x = (ui_viz_rx + (ui_viz_rw - viz_event_w - bdr_s*2)/2); + const int viz_event_y = 200; + bool is_engageable = scene->engageable; + float viz_event_alpha = 1.0f; + nvgBeginPath(s->vg); + NVGpaint imgPaint = nvgImagePattern(s->vg, viz_event_x, viz_event_y, + viz_event_w, viz_event_h, 0, logoi, viz_event_alpha); + nvgRect(s->vg, viz_event_x, viz_event_y, (int)viz_event_w, viz_event_h); + nvgFillPaint(s->vg, imgPaint); + nvgFill(s->vg); +} + +void bb_ui_draw_gyro(UIState *s) { + //draw the gyro data + const UIScene *scene = &s->scene; + const float prc = 0.6; + const int sc_h = 820; + const int sc_w = scene->ui_viz_rw; + const int sc_x = bdr_s + scene->ui_viz_rx; + const int sc_y = 100; + const int sc_cx = (int)(sc_x + sc_w /2); + const int sc_cy = (int)(sc_y + sc_h/2); + const int l_w = (int)(sc_w * prc / 2); + + const int p_w = (int)((sc_cx - l_w - sc_x)*prc); + const int p_x = (int)(bdr_s +(sc_cx - l_w - p_w)/2); + const int p_max_h = (int)(sc_h * prc /2); + + nvgBeginPath(s->vg); + //white for the base line + nvgStrokeColor(s->vg, nvgRGBA(255,255,255,200)); + nvgStrokeWidth(s->vg, 4); + nvgMoveTo(s->vg, sc_cx - l_w, sc_cy); + nvgLineTo(s->vg, sc_cx +l_w, sc_cy); + nvgStroke(s->vg); + + //compute angle vs horizontal axis based on roll + const float r_ang_rad = -s->b.accRoll; + const float p_ang_rad = -s->b.accPitch; + + //roll + //acc roll - green + nvgSave(s->vg); + nvgTranslate(s->vg, sc_cx, sc_cy); + nvgRotate(s->vg, r_ang_rad); + nvgBeginPath(s->vg); + //green for the real horizontal line based on ACC + nvgStrokeColor(s->vg, nvgRGBA(28, 204,98,200)); + nvgStrokeWidth(s->vg, 4); + nvgMoveTo(s->vg, -l_w, 0); + nvgLineTo(s->vg, +l_w, 0); + nvgStroke(s->vg); + nvgRestore(s->vg); + //mag roll - yellow + nvgSave(s->vg); + nvgTranslate(s->vg, sc_cx, sc_cy); + nvgRotate(s->vg, -s->b.magRoll); + nvgBeginPath(s->vg); + //yellow for the real horizontal line based on MAG + nvgStrokeColor(s->vg, nvgRGBA(255, 255,0,200)); + nvgStrokeWidth(s->vg, 4); + nvgMoveTo(s->vg, -l_w, 0); + nvgLineTo(s->vg, +l_w, 0); + nvgStroke(s->vg); + nvgRestore(s->vg); + //gyro roll - red + nvgSave(s->vg); + nvgTranslate(s->vg, sc_cx, sc_cy); + nvgRotate(s->vg, -s->b.gyroRoll); + nvgBeginPath(s->vg); + //red for the real horizontal line based on GYRO + nvgStrokeColor(s->vg, nvgRGBA(255, 0,0,200)); + nvgStrokeWidth(s->vg, 4); + nvgMoveTo(s->vg, -l_w, 0); + nvgLineTo(s->vg, +l_w, 0); + nvgStroke(s->vg); + nvgRestore(s->vg); + + //pitch + const int p_y = sc_cy; + //double height to accentuate change + const int p_h = (int)(p_max_h * sin(p_ang_rad) ); + nvgBeginPath(s->vg); + //fill with red + nvgFillColor(s->vg, nvgRGBA(255, 0, 0, 200)); + nvgStrokeColor(s->vg, nvgRGBA(255, 0, 0, 200)); + nvgRect(s->vg, p_x, p_y, p_w, p_h); + nvgFill(s->vg); + nvgStroke(s->vg); + //draw middle line white + nvgBeginPath(s->vg); + nvgStrokeColor(s->vg, nvgRGBA(255,255,255,200)); + nvgStrokeWidth(s->vg, 4); + nvgMoveTo(s->vg, p_x,p_y); + nvgLineTo(s->vg, p_x + p_w, p_y); + nvgStroke(s->vg); + //draw horizon with green + nvgBeginPath(s->vg); + nvgStrokeColor(s->vg, nvgRGBA(28, 204,98,200)); + nvgMoveTo(s->vg, p_x,p_y+p_h); + nvgLineTo(s->vg, p_x + p_w, p_y+p_h); + nvgStroke(s->vg); +} + +void bb_ui_read_triState_switch( UIState *s) { + //get 3-state switch position + int tri_state_fd; + char buffer[10]; + if (bb_currentTimeInMilis() - s->b.tri_state_switch_last_read > 2000) { + //tri_stated_fd = open ("/sys/devices/virtual/switch/tri-state-key/state", O_RDONLY); + //if we can't open then switch should be considered in the middle, nothing done + /* if (tri_state_fd == -1) { + s->b.tri_state_switch = 3; + } else { + read (tri_state_fd, &buffer, 10); + s->b.tri_state_switch = buffer[0] -48; + close(tri_state_fd); + s->b.tri_state_switch_last_read = bb_currentTimeInMilis(); + }*/ + s->b.tri_state_switch_last_read = bb_currentTimeInMilis(); + s->b.tri_state_switch = 3; + if (strcmp(s->b.btns[2].btn_label2,"OP")==0) { + s->b.tri_state_switch = 1; + } + if (strcmp(s->b.btns[2].btn_label2,"MIN")==0) { + s->b.tri_state_switch = 2; + } + if (strcmp(s->b.btns[2].btn_label2,"OFF")==0) { + s->b.tri_state_switch = 3; + } + if (strcmp(s->b.btns[2].btn_label2,"GYRO")==0) { + s->b.tri_state_switch = 4; + } + int i = bb_get_button_status(s,(char *)"dsp"); + if (i==9) { + s->b.keepEonOff = true; + if (s->awake_timeout > 3*30) { + s->awake_timeout = 3*30; + } + } else { + s->b.keepEonOff = false; + if (s->awake_timeout > 30*30) { + s->awake_timeout = 30*30; + } + } + } +} + +void bb_ui_draw_UI( UIState *s) { + + + if (s->b.tri_state_switch == 1) { + const UIScene *scene = &s->scene; + const int bb_dml_w = 180; + const int bb_dml_x = (scene->ui_viz_rx + (bdr_s*2)); + const int bb_dml_y = (box_y + (bdr_s*1.5))+220; + + const int bb_dmr_w = 180; + const int bb_dmr_x = scene->ui_viz_rx + scene->ui_viz_rw - bb_dmr_w - (bdr_s*2) ; + const int bb_dmr_y = (box_y + (bdr_s*1.5))+220; + bb_ui_draw_measures_left(s,bb_dml_x, bb_dml_y, bb_dml_w ); + bb_ui_draw_measures_right(s,bb_dmr_x, bb_dmr_y, bb_dmr_w ); + bb_draw_buttons(s); + bb_ui_draw_custom_alert(s); + bb_ui_draw_logo(s); + } + if (s->b.tri_state_switch ==2) { + const UIScene *scene = &s->scene; + const int bb_dml_w = 180; + const int bb_dml_x = (scene->ui_viz_rx + (bdr_s*2)); + const int bb_dml_y = (box_y + (bdr_s*1.5))+220; + + const int bb_dmr_w = 180; + const int bb_dmr_x = scene->ui_viz_rx + scene->ui_viz_rw - bb_dmr_w - (bdr_s*2) ; + const int bb_dmr_y = (box_y + (bdr_s*1.5))+220; + bb_draw_buttons(s); + bb_ui_draw_custom_alert(s); + bb_ui_draw_logo(s); + } + if (s->b.tri_state_switch ==3) { + //we now use the state 3 for minimalistic data alerts + const UIScene *scene = &s->scene; + const int bb_dml_w = 180; + const int bb_dml_x = (scene->ui_viz_rx + (bdr_s*2)); + const int bb_dml_y = (box_y + (bdr_s*1.5))+220; + + const int bb_dmr_w = 180; + const int bb_dmr_x = scene->ui_viz_rx + scene->ui_viz_rw - bb_dmr_w - (bdr_s*2) ; + const int bb_dmr_y = (box_y + (bdr_s*1.5))+220; + bb_ui_draw_measures_left2(s,bb_dml_x, bb_dml_y, bb_dml_w ); + bb_ui_draw_measures_right2(s,bb_dmr_x, bb_dmr_y, bb_dmr_w ); + bb_draw_buttons(s); + bb_ui_draw_custom_alert(s); + } + if (s->b.tri_state_switch ==4) { + //we use the state 4 for gyro info + const UIScene *scene = &s->scene; + const int bb_dml_w = 180; + const int bb_dml_x = (scene->ui_viz_rx + (bdr_s*2)); + const int bb_dml_y = (box_y + (bdr_s*1.5))+220; + + const int bb_dmr_w = 180; + const int bb_dmr_x = scene->ui_viz_rx + scene->ui_viz_rw - bb_dmr_w - (bdr_s*2) ; + const int bb_dmr_y = (box_y + (bdr_s*1.5))+220; + bb_draw_buttons(s); + bb_ui_draw_custom_alert(s); + bb_ui_draw_gyro(s); + } +} + + + +void bb_ui_init(UIState *s) { + + //BB INIT + s->b.shouldDrawFrame = true; + s->status = STATUS_DISENGAGED; + strcpy(s->b.car_model,"Tesla"); + strcpy(s->b.car_folder,"tesla"); + s->b.tri_state_switch = -1; + s->b.tri_state_switch_last_read = 0; + s->b.touch_last = false; + s->b.touch_last_x = 0; + s->b.touch_last_y =0; + s->b.touch_last_width = s->scene.ui_viz_rw; + + s->b.ctx = Context::create(); + + //BB Define CAPNP sock + s->b.uiButtonInfo_sock = SubSocket::create(s->b.ctx, "uiButtonInfo"); //zsock_new_sub(">tcp://127.0.0.1:8201", ""); + s->b.uiCustomAlert_sock = SubSocket::create(s->b.ctx, "uiCustomAlert"); //zsock_new_sub(">tcp://127.0.0.1:8202", ""); + s->b.uiSetCar_sock = SubSocket::create(s->b.ctx, "uiSetCar"); //zsock_new_sub(">tcp://127.0.0.1:8203", ""); + s->b.uiPlaySound_sock = SubSocket::create(s->b.ctx, "uiPlaySound"); //zsock_new_sub(">tcp://127.0.0.1:8205", ""); + s->b.uiButtonStatus_sock = PubSocket::create(s->b.ctx, "uiButtonStatus"); //zsock_new_pub("@tcp://127.0.0.1:8204"); + s->b.gps_sock = SubSocket::create(s->b.ctx, "gpsLocationExternal"); //zsock_new_sub(">tcp://127.0.0.1:8032",""); + s->b.uiGyroInfo_sock = SubSocket::create(s->b.ctx, "uiGyroInfo"); //zsock_new_sub(">tcp://127.0.0.1:8207", ""); + s->b.poller = Poller::create({ + s->b.uiButtonInfo_sock, + s->b.uiCustomAlert_sock, + s->b.uiSetCar_sock, + s->b.uiPlaySound_sock, + s->b.gps_sock, + s->b.uiGyroInfo_sock + }); + + //BB Load Images + s->b.img_logo = nvgCreateImage(s->vg, "../assets/img_spinner_comma.png", 1); + s->b.img_logo2 = nvgCreateImage(s->vg, "../assets/img_spinner_comma2.png", 1); + s->b.img_car = nvgCreateImage(s->vg, "../assets/img_car_tesla.png", 1); + + s->b.icShowCar = true; + s->b.icShowLogo = true; +} + +// void bb_ui_play_sound( UIState *s, int sound) { +// char* snd_command; +// int bts = bb_get_button_status(s,"sound"); +// if ((bts > 0) || (bts == -1)) { +// asprintf(&snd_command, "python /data/openpilot/selfdrive/car/modules/snd/playsound.py %d &", sound); +// system(snd_command); +// } +// } + +void bb_ui_set_car( UIState *s, char *model, char *folder) { + strcpy(s->b.car_model,model); + strcpy(s->b.car_folder, folder); +} + +void bb_ui_poll_update( UIState *s) { + + int err; + + //check tri-state switch + bb_ui_read_triState_switch(s); + + while (true) { + auto polls = s->b.poller->poll(0); + if (polls.size() == 0) + return; + + for (auto sock : polls) { + Message * msg = sock->receive(); + + if (sock == s->b.uiButtonInfo_sock) { + //button info socket + struct capn ctx; + capn_init_mem(&ctx, (uint8_t*)msg->getData(), msg->getSize(), 0); + + cereal_UIButtonInfo_ptr stp; + stp.p = capn_getp(capn_root(&ctx), 0, 1); + struct cereal_UIButtonInfo datad; + cereal_read_UIButtonInfo(&datad, stp); + + int id = datad.btnId; + //LOGW("got button info: ID = (%d)", id); + strcpy(s->b.btns[id].btn_name,(char *)datad.btnName.str); + strcpy(s->b.btns[id].btn_label, (char *)datad.btnLabel.str); + strcpy(s->b.btns[id].btn_label2, (char *)datad.btnLabel2.str); + s->b.btns_status[id] = datad.btnStatus; + capn_free(&ctx); + } + if (sock == s->b.uiCustomAlert_sock) { + //custom alert socket + struct capn ctx; + capn_init_mem(&ctx, (uint8_t*)msg->getData(), msg->getSize(), 0); + + cereal_UICustomAlert_ptr stp; + stp.p = capn_getp(capn_root(&ctx), 0, 1); + struct cereal_UICustomAlert datad; + cereal_read_UICustomAlert(&datad, stp); + + strcpy(s->b.custom_message,datad.caText.str); + s->b.custom_message_status = datad.caStatus; + + if ((strlen(s->b.custom_message) > 0) && (strlen(s->scene.alert_text1)==0)){ + if ((!((bb_get_button_status(s,(char *)"msg") == 0) && (s->b.custom_message_status<=3))) && (s->vision_connected == true)) { + set_awake(s, true); + } + } + + if ((strlen(s->scene.alert_text1) > 0) || (strlen(s->scene.alert_text2) > 0) ) { + set_awake(s, true); + } + + capn_free(&ctx); + } + if (sock == s->b.uiSetCar_sock) { + //set car model socket + struct capn ctx; + capn_init_mem(&ctx, (uint8_t*)msg->getData(), msg->getSize(), 0); + + cereal_UISetCar_ptr stp; + stp.p = capn_getp(capn_root(&ctx), 0, 1); + struct cereal_UISetCar datad; + cereal_read_UISetCar(&datad, stp); + + if ((strcmp(s->b.car_model,(char *) datad.icCarName.str) != 0) || (strcmp(s->b.car_folder, (char *) datad.icCarFolder.str) !=0)) { + strcpy(s->b.car_model, (char *) datad.icCarName.str); + strcpy(s->b.car_folder, (char *) datad.icCarFolder.str); + //LOGW("Car folder set (%s)", s->b.car_folder); + + if (strcmp(s->b.car_folder,"tesla")==0) { + s->b.img_logo = nvgCreateImage(s->vg, "../assets/img_spinner_comma.png", 1); + s->b.img_logo2 = nvgCreateImage(s->vg, "../assets/img_spinner_comma2.png", 1); + //LOGW("Spinning logo set for Tesla"); + } else if (strcmp(s->b.car_folder,"honda")==0) { + s->b.img_logo = nvgCreateImage(s->vg, "../assets/img_spinner_comma.honda.png", 1); + s->b.img_logo2 = nvgCreateImage(s->vg, "../assets/img_spinner_comma.honda2.png", 1); + //LOGW("Spinning logo set for Honda"); + } else if (strcmp(s->b.car_folder,"toyota")==0) { + s->b.img_logo = nvgCreateImage(s->vg, "../assets/img_spinner_comma.toyota.png", 1); + s->b.img_logo2 = nvgCreateImage(s->vg, "../assets/img_spinner_comma.toyota2.png", 1); + //LOGW("Spinning logo set for Toyota"); + }; + } + if (datad.icShowCar == 1) { + s->b.icShowCar = true; + } else { + s->b.icShowCar = false; + } + if (datad.icShowLogo == 1) { + s->b.icShowLogo = true; + } else { + s->b.icShowLogo = false; + } + capn_free(&ctx); + } + if (sock == s->b.uiPlaySound_sock) { + // play sound socket + struct capn ctx; + capn_init_mem(&ctx, (uint8_t*)msg->getData(), msg->getSize(), 0); + + cereal_UIPlaySound_ptr stp; + stp.p = capn_getp(capn_root(&ctx), 0, 1); + struct cereal_UIPlaySound datad; + cereal_read_UIPlaySound(&datad, stp); + + int snd = datad.sndSound; + // bb_ui_play_sound(s,snd); + + capn_free(&ctx); + } + if (sock == s->b.gps_sock) { + // gps socket + struct capn ctx; + capn_init_mem(&ctx, (uint8_t*)msg->getData(), msg->getSize(), 0); + + cereal_Event_ptr eventp; + eventp.p = capn_getp(capn_root(&ctx), 0, 1); + struct cereal_Event eventd; + cereal_read_Event(&eventd, eventp); + + struct cereal_GpsLocationData datad; + cereal_read_GpsLocationData(&datad, eventd.gpsLocationExternal); + + s->b.gpsAccuracy = datad.accuracy; + if (s->b.gpsAccuracy>100) + { + s->b.gpsAccuracy=99.99; + } + else if (s->b.gpsAccuracy==0) + { + s->b.gpsAccuracy=99.8; + } + capn_free(&ctx); + } + if (sock == s->b.uiGyroInfo_sock) { + //gyro info socket + struct capn ctx; + capn_init_mem(&ctx, (uint8_t*)msg->getData(), msg->getSize(), 0); + + cereal_UIGyroInfo_ptr stp; + stp.p = capn_getp(capn_root(&ctx), 0, 1); + struct cereal_UIGyroInfo datad; + cereal_read_UIGyroInfo(&datad, stp); + s->b.accPitch = datad.accPitch; + s->b.accRoll = datad.accRoll; + s->b.accYaw = datad.accYaw; + s->b.magPitch = datad.magPitch; + s->b.magRoll = datad.magRoll; + s->b.magYaw = datad.magYaw; + s->b.gyroPitch = datad.gyroPitch; + s->b.gyroRoll = datad.gyroRoll; + s->b.gyroYaw = datad.gyroYaw; + + capn_free(&ctx); + } + delete msg; + } + } +} + + diff --git a/selfdrive/ui/bbuistate.h b/selfdrive/ui/bbuistate.h new file mode 100644 index 000000000..9d6e40d14 --- /dev/null +++ b/selfdrive/ui/bbuistate.h @@ -0,0 +1,68 @@ +#pragma once +const int touch_timeout = 25; + +typedef struct UICstmButton { + char btn_name[6]; + char btn_label[6]; + char btn_label2[11]; +} UICstmButton; + +typedef struct BBUIState { + float scr_scale_x; + float scr_scale_y; + int scr_w; + int scr_h; + float scr_device_factor; + float scr_scissor_offset; + int touch_last_x; + int touch_last_y; + bool touch_last; + int touch_timeout; + int touch_last_width; + bool shouldDrawFrame; + UICstmButton btns[6]; + char btns_status[6]; + char car_model[40]; + char car_folder[20]; + Context *ctx; + SubSocket *uiButtonInfo_sock; + SubSocket *uiCustomAlert_sock; + SubSocket *uiSetCar_sock; + SubSocket *uiPlaySound_sock; + PubSocket *uiButtonStatus_sock; + SubSocket *gps_sock; + SubSocket *uiGyroInfo_sock; + Poller * poller; + int btns_x[6]; + int btns_y[6]; + int btns_r[6]; + int custom_message_status; + char custom_message[120]; + int img_logo; + int img_logo2; + int img_car; + int tri_state_switch; + long tri_state_switch_last_read; + uint16_t maxCpuTemp; + uint32_t maxBatTemp; + float gpsAccuracy ; + float freeSpace; + float angleSteers; + float angleSteersDes; + float accPitch; + float accRoll; + float accYaw; + float magPitch; + float magRoll; + float magYaw; + float gyroPitch; + float gyroRoll; + float gyroYaw; + bool icShowLogo; + bool icShowCar; + int batteryPercent; + bool chargingEnabled; + uint16_t fanSpeed; + bool keepEonOff; + bool recording; +} BBUIState; diff --git a/selfdrive/ui/dashcam.h b/selfdrive/ui/dashcam.h new file mode 100644 index 000000000..96fb9ffde --- /dev/null +++ b/selfdrive/ui/dashcam.h @@ -0,0 +1,313 @@ +#include + +#define CAPTURE_STATE_NONE 0 +#define CAPTURE_STATE_CAPTURING 1 +#define CAPTURE_STATE_NOT_CAPTURING 2 +#define RECORD_INTERVAL 180 // Time in seconds to rotate recordings +#define RECORD_FILES 20 // Number of files to create before looping over + +typedef struct dashcam_element { + int pos_x; + int pos_y; + int width; + int height; +} dashcam_element; + +dashcam_element lock_button; + +int captureState = CAPTURE_STATE_NOT_CAPTURING; +int captureNum = 0; +int start_time = 0; +int elapsed_time = 0; // Time of current recording +char filenames[RECORD_FILES][50]; // Track the filenames so they can be deleted when rotating + +bool lock_current_video = true; // If true save the current video before rotating +bool locked_files[RECORD_FILES]; // Track which files are locked +int lock_image; // Stores reference to the PNG +int files_created = 0; + +void stop_capture() { + if (captureState == CAPTURE_STATE_CAPTURING) { + //printf("Stop capturing screen\n"); + system("killall -SIGINT screenrecord"); + captureState = CAPTURE_STATE_NOT_CAPTURING; + captureNum++; + + if (captureNum > RECORD_FILES-1) { + captureNum = 0; + } + } +} + +int get_time() { + // Get current time (in seconds) + + int iRet; + struct timeval tv; + int seconds = 0; + + iRet = gettimeofday(&tv,NULL); + if (iRet == 0) { + seconds = (int)tv.tv_sec; + } + return seconds; +} + +struct tm get_time_struct() { + time_t t = time(NULL); + struct tm tm = *localtime(&t); + return tm; +} + +void remove_file(char *videos_dir, char *filename) { + if (filename[0] == '\0') { + // Don't do anything if no filename is passed + return; + } + + int status; + char fullpath[64]; + snprintf(fullpath,sizeof(fullpath),"%s/%s", videos_dir, filename); + status = remove(fullpath); + if (status == 0) { + printf("Removed file: %s\n", fullpath); + } + else { + printf("Unable to remove file: %s\n", fullpath); + perror("Error message:"); + } +} + +void save_file(char *videos_dir, char *filename) { + if (!strlen(filename)) { + return; + } + + // Rename file to save it from being overwritten + char cmd[128]; + snprintf(cmd,sizeof(cmd), "mv %s/%s %s/saved_%s", videos_dir, filename, videos_dir, filename); + printf("save: %s\n",cmd); + system(cmd); +} + +void start_capture() { + captureState = CAPTURE_STATE_CAPTURING; + char cmd[50] = ""; + char videos_dir[50] = "/sdcard/videos"; + + ////////////////////////////////// + // NOTE: make sure videos_dir folder exists on the device! + ////////////////////////////////// + struct stat st = {0}; + if (stat(videos_dir, &st) == -1) { + mkdir(videos_dir,0700); + } + + if (strlen(filenames[captureNum]) && files_created >= RECORD_FILES) { + if (locked_files[captureNum] > 0) { + save_file(videos_dir, filenames[captureNum]); + } + else { + // remove the old file + remove_file(videos_dir, filenames[captureNum]); + } + locked_files[captureNum] = 0; + } + + char filename[64]; + struct tm tm = get_time_struct(); + snprintf(filename,sizeof(filename),"%04d%02d%02d-%02d%02d%02d.mp4", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); + snprintf(cmd,sizeof(cmd),"screenrecord %s/%s&",videos_dir,filename); + strcpy(filenames[captureNum],filename); + + printf("Capturing to file: %s\n",cmd); + start_time = get_time(); + system(cmd); + + if (lock_current_video) { + // Lock is still on so mark this file for saving + locked_files[captureNum] = 1; + } + else { + locked_files[captureNum] = 0; + } + + files_created++; +} + +bool screen_lock_button_clicked(int touch_x, int touch_y, dashcam_element el) { + if (captureState == CAPTURE_STATE_NOT_CAPTURING) { + // Don't register click if we're not recording + return false; + } + + if (touch_x >= el.pos_x && touch_x <= el.pos_x + el.width) { + if (touch_y >= el.pos_y && touch_y <= el.pos_y + el.height) { + return true; + } + } + return false; +} + +bool screen_button_clicked(int touch_x, int touch_y) { + if (touch_x >= 1660 && touch_x <= 1810) { + if (touch_y >= 885 && touch_y <= 1035) { + return true; + } + } + return false; +} + +void draw_date_time(UIState *s) { + if (captureState == CAPTURE_STATE_NOT_CAPTURING) { + // Don't draw if we're not recording + return; + } + + // Draw the current date/time + + int rect_w = 465; + int rect_h = 80; + int rect_x = (1920-rect_w)/2; + int rect_y = (1080-rect_h-10); + + // Get local time to display + char now[50]; + struct tm tm = get_time_struct(); + snprintf(now,sizeof(now),"%04d/%02d/%02d %02d:%02d:%02d", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); + + nvgBeginPath(s->vg); + nvgRoundedRect(s->vg, rect_x, rect_y, rect_w, rect_h, 15); + nvgFillColor(s->vg, nvgRGBA(0, 0, 0, 100)); + nvgFill(s->vg); + nvgStrokeColor(s->vg, nvgRGBA(255,255,255,80)); + nvgStrokeWidth(s->vg, 6); + nvgStroke(s->vg); + + nvgFontSize(s->vg, 60); + nvgFontFace(s->vg, "sans-semibold"); + nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 200)); + nvgText(s->vg,rect_x+231,rect_y+55,now,NULL); +} + +static void rotate_video() { + // Overwrite the existing video (if needed) + elapsed_time = 0; + stop_capture(); + captureState = CAPTURE_STATE_CAPTURING; + start_capture(); +} + +void draw_lock_button(UIState *s) { + int btn_w = 150; + int btn_h = 150; + int btn_x = 1920 - btn_w - 150; + int btn_y = 1080 - btn_h; + int imgw, imgh; + + float alpha = 0.3f; + + if (!lock_image) { + // Load the lock icon + lock_image = nvgCreateImage(s->vg, "../assets/lock_icon.png", 1); + } + + if (lock_current_video) { + alpha = 1.0f; + } + + nvgBeginPath(s->vg); + NVGpaint imgPaint = nvgImagePattern(s->vg, btn_x-125, btn_y-45, 150, 150, 0, lock_image, alpha); + nvgRoundedRect(s->vg, btn_x-125, btn_y-45, 150, 150, 100); + nvgFillPaint(s->vg, imgPaint); + nvgFill(s->vg); + + + lock_button = (dashcam_element){ + .pos_x = 1500, + .pos_y = 920, + .width = 150, + .height = 150 + }; +} + +static void screen_draw_button(UIState *s, int touch_x, int touch_y) { + // Set button to bottom left of screen + if (s->vision_connected && s->active_app == cereal_UiLayoutState_App_home) { + + if (captureState == CAPTURE_STATE_CAPTURING) { + draw_lock_button(s); + } + + int btn_w = 150; + int btn_h = 150; + int btn_x = 1920 - btn_w; + int btn_y = 1080 - btn_h; + nvgBeginPath(s->vg); + nvgRoundedRect(s->vg, btn_x-110, btn_y-45, btn_w, btn_h, 100); + nvgStrokeColor(s->vg, nvgRGBA(255,255,255,80)); + nvgStrokeWidth(s->vg, 6); + nvgStroke(s->vg); + + nvgFontSize(s->vg, 70); + + if (captureState == CAPTURE_STATE_CAPTURING) { + NVGcolor fillColor = nvgRGBA(255,0,0,150); + nvgFillColor(s->vg, fillColor); + nvgFill(s->vg); + nvgFillColor(s->vg, nvgRGBA(255,255,255,200)); + } + else { + nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 200)); + } + nvgText(s->vg,btn_x-88,btn_y+50,"REC",NULL); + } + + if (captureState == CAPTURE_STATE_CAPTURING) { + //draw_date_time(s); + + elapsed_time = get_time() - start_time; + + if (elapsed_time >= RECORD_INTERVAL) { + rotate_video(); + } + } +} + +void screen_toggle_record_state(UIState *s) { + if (captureState == CAPTURE_STATE_CAPTURING) { + s->b.recording = false; + stop_capture(); + lock_current_video = false; + } + else { + //captureState = CAPTURE_STATE_CAPTURING; + s->b.recording = true; + start_capture(); + } +} + +void screen_toggle_lock() { + if (lock_current_video) { + lock_current_video = false; + } + else { + lock_current_video = true; + locked_files[captureNum] = 1; + } +} + +void dashcam( UIState *s, int touch_x, int touch_y ) { + screen_draw_button(s, touch_x, touch_y); + if (screen_button_clicked(touch_x,touch_y)) { + screen_toggle_record_state(s); + } + if (screen_lock_button_clicked(touch_x,touch_y,lock_button)) { + screen_toggle_lock(); + } + if (!s->vision_connected) { + // Assume car is not in drive so stop recording + s->b.recording = false; + stop_capture(); + } +} diff --git a/selfdrive/ui/main.cc b/selfdrive/ui/main.cc new file mode 100644 index 000000000..3d2411b9c --- /dev/null +++ b/selfdrive/ui/main.cc @@ -0,0 +1,28 @@ +#include + +#include +#include + +#include "selfdrive/hardware/hw.h" +#include "selfdrive/ui/qt/qt_window.h" +#include "selfdrive/ui/qt/util.h" +#include "selfdrive/ui/qt/window.h" + +int main(int argc, char *argv[]) { + setpriority(PRIO_PROCESS, 0, -20); + + qInstallMessageHandler(swagLogMessageHandler); + initApp(); + + if (Hardware::EON()) { + QSslConfiguration ssl = QSslConfiguration::defaultConfiguration(); + ssl.setCaCertificates(QSslCertificate::fromPath("/usr/etc/tls/cert.pem")); + QSslConfiguration::setDefaultConfiguration(ssl); + } + + QApplication a(argc, argv); + MainWindow w; + setMainWindow(&w); + a.installEventFilter(&w); + return a.exec(); +} diff --git a/selfdrive/ui/moc_ui.cc b/selfdrive/ui/moc_ui.cc new file mode 100644 index 000000000..35ae59545 --- /dev/null +++ b/selfdrive/ui/moc_ui.cc @@ -0,0 +1,305 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'ui.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "ui.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'ui.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_UIState_t { + QByteArrayData data[7]; + char stringdata0[53]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_UIState_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_UIState_t qt_meta_stringdata_UIState = { + { +QT_MOC_LITERAL(0, 0, 7), // "UIState" +QT_MOC_LITERAL(1, 8, 8), // "uiUpdate" +QT_MOC_LITERAL(2, 17, 0), // "" +QT_MOC_LITERAL(3, 18, 1), // "s" +QT_MOC_LITERAL(4, 20, 17), // "offroadTransition" +QT_MOC_LITERAL(5, 38, 7), // "offroad" +QT_MOC_LITERAL(6, 46, 6) // "update" + + }, + "UIState\0uiUpdate\0\0s\0offroadTransition\0" + "offroad\0update" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_UIState[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 3, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 2, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 1, 29, 2, 0x06 /* Public */, + 4, 1, 32, 2, 0x06 /* Public */, + + // slots: name, argc, parameters, tag, flags + 6, 0, 35, 2, 0x08 /* Private */, + + // signals: parameters + QMetaType::Void, 0x80000000 | 0, 3, + QMetaType::Void, QMetaType::Bool, 5, + + // slots: parameters + QMetaType::Void, + + 0 // eod +}; + +void UIState::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->uiUpdate((*reinterpret_cast< const UIState(*)>(_a[1]))); break; + case 1: _t->offroadTransition((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 2: _t->update(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (UIState::*)(const UIState & ); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&UIState::uiUpdate)) { + *result = 0; + return; + } + } + { + using _t = void (UIState::*)(bool ); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&UIState::offroadTransition)) { + *result = 1; + return; + } + } + } +} + +QT_INIT_METAOBJECT const QMetaObject UIState::staticMetaObject = { { + &QObject::staticMetaObject, + qt_meta_stringdata_UIState.data, + qt_meta_data_UIState, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *UIState::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *UIState::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_UIState.stringdata0)) + return static_cast(this); + return QObject::qt_metacast(_clname); +} + +int UIState::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QObject::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 3) + qt_static_metacall(this, _c, _id, _a); + _id -= 3; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 3) + *reinterpret_cast(_a[0]) = -1; + _id -= 3; + } + return _id; +} + +// SIGNAL 0 +void UIState::uiUpdate(const UIState & _t1) +{ + void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} + +// SIGNAL 1 +void UIState::offroadTransition(bool _t1) +{ + void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 1, _a); +} +struct qt_meta_stringdata_Device_t { + QByteArrayData data[9]; + char stringdata0[89]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_Device_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_Device_t qt_meta_stringdata_Device = { + { +QT_MOC_LITERAL(0, 0, 6), // "Device" +QT_MOC_LITERAL(1, 7, 19), // "displayPowerChanged" +QT_MOC_LITERAL(2, 27, 0), // "" +QT_MOC_LITERAL(3, 28, 2), // "on" +QT_MOC_LITERAL(4, 31, 17), // "interactiveTimout" +QT_MOC_LITERAL(5, 49, 22), // "resetInteractiveTimout" +QT_MOC_LITERAL(6, 72, 6), // "update" +QT_MOC_LITERAL(7, 79, 7), // "UIState" +QT_MOC_LITERAL(8, 87, 1) // "s" + + }, + "Device\0displayPowerChanged\0\0on\0" + "interactiveTimout\0resetInteractiveTimout\0" + "update\0UIState\0s" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_Device[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 4, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 2, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 1, 34, 2, 0x06 /* Public */, + 4, 0, 37, 2, 0x06 /* Public */, + + // slots: name, argc, parameters, tag, flags + 5, 0, 38, 2, 0x0a /* Public */, + 6, 1, 39, 2, 0x0a /* Public */, + + // signals: parameters + QMetaType::Void, QMetaType::Bool, 3, + QMetaType::Void, + + // slots: parameters + QMetaType::Void, + QMetaType::Void, 0x80000000 | 7, 8, + + 0 // eod +}; + +void Device::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->displayPowerChanged((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 1: _t->interactiveTimout(); break; + case 2: _t->resetInteractiveTimout(); break; + case 3: _t->update((*reinterpret_cast< const UIState(*)>(_a[1]))); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (Device::*)(bool ); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&Device::displayPowerChanged)) { + *result = 0; + return; + } + } + { + using _t = void (Device::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&Device::interactiveTimout)) { + *result = 1; + return; + } + } + } +} + +QT_INIT_METAOBJECT const QMetaObject Device::staticMetaObject = { { + &QObject::staticMetaObject, + qt_meta_stringdata_Device.data, + qt_meta_data_Device, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *Device::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *Device::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_Device.stringdata0)) + return static_cast(this); + return QObject::qt_metacast(_clname); +} + +int Device::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QObject::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 4) + qt_static_metacall(this, _c, _id, _a); + _id -= 4; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 4) + *reinterpret_cast(_a[0]) = -1; + _id -= 4; + } + return _id; +} + +// SIGNAL 0 +void Device::displayPowerChanged(bool _t1) +{ + void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} + +// SIGNAL 1 +void Device::interactiveTimout() +{ + QMetaObject::activate(this, &staticMetaObject, 1, nullptr); +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/mui.cc b/selfdrive/ui/mui.cc new file mode 100644 index 000000000..55b9a4747 --- /dev/null +++ b/selfdrive/ui/mui.cc @@ -0,0 +1,138 @@ +#include +#include +#include +#include + +#include "cereal/messaging/messaging.h" +#include "selfdrive/ui/ui.h" +#include "selfdrive/ui/qt/qt_window.h" + +class StatusBar : public QGraphicsRectItem { + private: + QLinearGradient linear_gradient; + QRadialGradient radial_gradient; + QTimer animation_timer; + const int animation_length = 10; + int animation_index = 0; + + public: + StatusBar(double x, double y, double width, double height) : QGraphicsRectItem {x, y, width, height} { + linear_gradient = QLinearGradient(0, 0, 0, height/2); + linear_gradient.setSpread(QGradient::ReflectSpread); + + radial_gradient = QRadialGradient(width/2, height/2, width/8); + QObject::connect(&animation_timer, &QTimer::timeout, [=]() { + animation_index++; + animation_index %= animation_length; + }); + animation_timer.start(50); + } + + void solidColor(QColor color) { + QColor dark_color = QColor(color); + dark_color.setAlphaF(0.5); + + linear_gradient.setColorAt(0, dark_color); + linear_gradient.setColorAt(1, color); + setBrush(QBrush(linear_gradient)); + } + + // these need to be called continuously for the animations to work. + // can probably clean that up with some more abstractions + void blinkingColor(QColor color) { + QColor dark_color = QColor(color); + dark_color.setAlphaF(0.1); + + int radius = (rect().width() / animation_length) * animation_index; + QPoint center = QPoint(rect().width()/2, rect().height()/2); + radial_gradient.setCenter(center); + radial_gradient.setFocalPoint(center); + radial_gradient.setRadius(radius); + + radial_gradient.setColorAt(1, dark_color); + radial_gradient.setColorAt(0, color); + setBrush(QBrush(radial_gradient)); + } + + void laneChange(cereal::LateralPlan::LaneChangeDirection direction) { + QColor dark_color = QColor(bg_colors[STATUS_ENGAGED]); + dark_color.setAlphaF(0.1); + + int x = (rect().width() / animation_length) * animation_index; + QPoint center = QPoint(((direction == cereal::LateralPlan::LaneChangeDirection::RIGHT) ? x : (rect().width() - x)), rect().height()/2); + radial_gradient.setCenter(center); + radial_gradient.setFocalPoint(center); + radial_gradient.setRadius(rect().width()/5); + + radial_gradient.setColorAt(1, dark_color); + radial_gradient.setColorAt(0, bg_colors[STATUS_ENGAGED]); + setBrush(QBrush(radial_gradient)); + } + + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override { + painter->setPen(QPen()); + painter->setBrush(brush()); + + double rounding_radius = rect().height()/2; + painter->drawRoundedRect(rect(), rounding_radius, rounding_radius); + } +}; + +int main(int argc, char *argv[]) { + QApplication a(argc, argv); + QWidget w; + setMainWindow(&w); + + w.setStyleSheet("background-color: black;"); + + // our beautiful UI + QVBoxLayout *layout = new QVBoxLayout(&w); + + QGraphicsScene *scene = new QGraphicsScene(); + StatusBar *status_bar = new StatusBar(0, 0, 1000, 50); + scene->addItem(status_bar); + + QGraphicsView *graphics_view = new QGraphicsView(scene); + layout->insertSpacing(0, 400); + layout->addWidget(graphics_view, 0, Qt::AlignCenter); + + QTimer timer; + QObject::connect(&timer, &QTimer::timeout, [=]() { + static SubMaster sm({"deviceState", "controlsState", "lateralPlan"}); + + bool onroad_prev = sm.allAliveAndValid({"deviceState"}) && + sm["deviceState"].getDeviceState().getStarted(); + sm.update(0); + + bool onroad = sm.allAliveAndValid({"deviceState"}) && + sm["deviceState"].getDeviceState().getStarted(); + + if (onroad) { + auto cs = sm["controlsState"].getControlsState(); + UIStatus status = cs.getEnabled() ? STATUS_ENGAGED : STATUS_DISENGAGED; + if (cs.getAlertStatus() == cereal::ControlsState::AlertStatus::USER_PROMPT) { + status = STATUS_WARNING; + } else if (cs.getAlertStatus() == cereal::ControlsState::AlertStatus::CRITICAL) { + status = STATUS_ALERT; + } + + auto lp = sm["lateralPlan"].getLateralPlan(); + if (lp.getLaneChangeState() == cereal::LateralPlan::LaneChangeState::PRE_LANE_CHANGE || status == STATUS_ALERT) { + status_bar->blinkingColor(bg_colors[status]); + } else if (lp.getLaneChangeState() == cereal::LateralPlan::LaneChangeState::LANE_CHANGE_STARTING || + lp.getLaneChangeState() == cereal::LateralPlan::LaneChangeState::LANE_CHANGE_FINISHING) { + status_bar->laneChange(lp.getLaneChangeDirection()); + } else { + status_bar->solidColor(bg_colors[status]); + } + } + + if ((onroad != onroad_prev) || sm.frame < 2) { + Hardware::set_brightness(50); + Hardware::set_display_power(onroad); + } + }); + timer.start(50); + + return a.exec(); +} diff --git a/selfdrive/ui/paint.cc b/selfdrive/ui/paint.cc new file mode 100644 index 000000000..05abeb8b2 --- /dev/null +++ b/selfdrive/ui/paint.cc @@ -0,0 +1,638 @@ +#include "ui.h" + +#include +#include "common/util.h" +#include "common/timing.h" +#include + +#define NANOVG_GLES3_IMPLEMENTATION +#include "nanovg_gl.h" +#include "nanovg_gl_utils.h" +#include "paint.hpp" +#include "sidebar.hpp" +//#include "dashcam.h" +//#include "tbui.h" + +// TODO: this is also hardcoded in common/transformations/camera.py +// TODO: choose based on frame input size +#ifdef QCOM2 +const float y_offset = 150.0; +const float zoom = 2912.8; +#else +const float y_offset = 0.0; +const float zoom = 2138.5; +#endif + +static void ui_draw_text(const UIState *s, float x, float y, const char *string, float size, NVGcolor color, const char *font_name) { + nvgFontFace(s->vg, font_name); + nvgFontSize(s->vg, size); + nvgFillColor(s->vg, color); + nvgText(s->vg, x, y, string, NULL); +} + +static void draw_chevron(UIState *s, float x, float y, float sz, NVGcolor fillColor, NVGcolor glowColor) { + // glow + float g_xo = sz/5; + float g_yo = sz/10; + nvgBeginPath(s->vg); + nvgMoveTo(s->vg, x+(sz*1.35)+g_xo, y+sz+g_yo); + nvgLineTo(s->vg, x, y-g_xo); + nvgLineTo(s->vg, x-(sz*1.35)-g_xo, y+sz+g_yo); + nvgClosePath(s->vg); + nvgFillColor(s->vg, glowColor); + nvgFill(s->vg); + + // chevron + nvgBeginPath(s->vg); + nvgMoveTo(s->vg, x+(sz*1.25), y+sz); + nvgLineTo(s->vg, x, y); + nvgLineTo(s->vg, x-(sz*1.25), y+sz); + nvgClosePath(s->vg); + nvgFillColor(s->vg, fillColor); + nvgFill(s->vg); +} + +static void ui_draw_circle_image(const UIState *s, int center_x, int center_y, int radius, const char *image, NVGcolor color, float img_alpha) { + nvgBeginPath(s->vg); + nvgCircle(s->vg, center_x, center_y, radius); + nvgFillColor(s->vg, color); + nvgFill(s->vg); + const int img_size = radius * 1.5; + ui_draw_image(s, {center_x - (img_size / 2), center_y - (img_size / 2), img_size, img_size}, image, img_alpha); +} + +static void ui_draw_circle_image(const UIState *s, int center_x, int center_y, int radius, const char *image, bool active) { + float bg_alpha = active ? 0.3f : 0.1f; + float img_alpha = active ? 1.0f : 0.15f; + ui_draw_circle_image(s, center_x, center_y, radius, image, nvgRGBA(0, 0, 0, (255 * bg_alpha)), img_alpha); +} + +static void draw_lead(UIState *s, int idx) { + // Draw lead car indicator + const auto &lead = s->scene.lead_data[idx]; + auto [x, y] = s->scene.lead_vertices[idx]; + + float fillAlpha = 0; + float speedBuff = 10.; + float leadBuff = 40.; + float d_rel = lead.getDRel(); + float v_rel = lead.getVRel(); + if (d_rel < leadBuff) { + fillAlpha = 255*(1.0-(d_rel/leadBuff)); + if (v_rel < 0) { + fillAlpha += 255*(-1*(v_rel/speedBuff)); + } + fillAlpha = (int)(fmin(fillAlpha, 255)); + } + + float sz = std::clamp((25 * 30) / (d_rel / 3 + 30), 15.0f, 30.0f) * s->zoom; + x = std::clamp(x, 0.f, s->viz_rect.right() - sz / 2); + y = std::fmin(s->viz_rect.bottom() - sz * .6, y); + draw_chevron(s, x, y, sz, nvgRGBA(201, 34, 49, fillAlpha), COLOR_YELLOW); +} + +static void ui_draw_line(UIState *s, const line_vertices_data &vd, NVGcolor *color, NVGpaint *paint) { + if (vd.cnt == 0) return; + + const vertex_data *v = &vd.v[0]; + nvgBeginPath(s->vg); + nvgMoveTo(s->vg, v[0].x, v[0].y); + for (int i = 1; i < vd.cnt; i++) { + nvgLineTo(s->vg, v[i].x, v[i].y); + } + nvgClosePath(s->vg); + if (color) { + nvgFillColor(s->vg, *color); + } else if (paint) { + nvgFillPaint(s->vg, *paint); + } + nvgFill(s->vg); +} + +static void draw_frame(UIState *s) { + mat4 *out_mat; + if (s->scene.driver_view) { + glBindVertexArray(s->frame_vao[1]); + out_mat = &s->front_frame_mat; + } else { + glBindVertexArray(s->frame_vao[0]); + out_mat = &s->rear_frame_mat; + } + glActiveTexture(GL_TEXTURE0); + + if (s->last_frame) { + glBindTexture(GL_TEXTURE_2D, s->texture[s->last_frame->idx]->frame_tex); +#ifndef QCOM + // this is handled in ion on QCOM + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, s->last_frame->width, s->last_frame->height, + 0, GL_RGB, GL_UNSIGNED_BYTE, s->last_frame->addr); +#endif + } + + glUseProgram(s->gl_shader->prog); + glUniform1i(s->gl_shader->getUniformLocation("uTexture"), 0); + glUniformMatrix4fv(s->gl_shader->getUniformLocation("uTransform"), 1, GL_TRUE, out_mat->v); + + assert(glGetError() == GL_NO_ERROR); + glEnableVertexAttribArray(0); + glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, (const void *)0); + glDisableVertexAttribArray(0); + glBindVertexArray(0); +} + +static void ui_draw_vision_lane_lines(UIState *s) { + const UIScene &scene = s->scene; + NVGpaint track_bg; + if (!scene.end_to_end) { + // paint lanelines + for (int i = 0; i < std::size(scene.lane_line_vertices); i++) { + NVGcolor color = nvgRGBAf(1.0, 1.0, 1.0, scene.lane_line_probs[i]); + ui_draw_line(s, scene.lane_line_vertices[i], &color, nullptr); + } + + // paint road edges + for (int i = 0; i < std::size(scene.road_edge_vertices); i++) { + NVGcolor color = nvgRGBAf(1.0, 0.0, 0.0, std::clamp(1.0 - scene.road_edge_stds[i], 0.0, 1.0)); + ui_draw_line(s, scene.road_edge_vertices[i], &color, nullptr); + } + track_bg = nvgLinearGradient(s->vg, s->fb_w, s->fb_h, s->fb_w, s->fb_h * .4, + COLOR_WHITE, COLOR_WHITE_ALPHA(0)); + } else { + track_bg = nvgLinearGradient(s->vg, s->fb_w, s->fb_h, s->fb_w, s->fb_h * .4, + COLOR_RED, COLOR_RED_ALPHA(0)); + } + // paint path + ui_draw_line(s, scene.track_vertices, nullptr, &track_bg); +} + +// Draw all world space objects. +static void ui_draw_world(UIState *s) { + const UIScene *scene = &s->scene; + // Don't draw on top of sidebar + nvgScissor(s->vg, s->viz_rect.x, s->viz_rect.y, s->viz_rect.w, s->viz_rect.h); + + // Draw lane edges and vision/mpc tracks + ui_draw_vision_lane_lines(s); + + // Draw lead indicators if openpilot is handling longitudinal + if (s->scene.longitudinal_control) { + if (scene->lead_data[0].getStatus()) { + draw_lead(s, 0); + } + if (scene->lead_data[1].getStatus() && (std::abs(scene->lead_data[0].getDRel() - scene->lead_data[1].getDRel()) > 3.0)) { + draw_lead(s, 1); + } + } + nvgResetScissor(s->vg); +} + +static void ui_draw_vision_maxspeed(UIState *s) { + const int SET_SPEED_NA = 255; + float maxspeed = s->scene.controls_state.getVCruise(); + const bool is_cruise_set = maxspeed != 0 && maxspeed != SET_SPEED_NA; + if (is_cruise_set && !s->scene.is_metric) { maxspeed *= 0.6225; } + + const Rect rect = {s->viz_rect.x + (bdr_s * 2), int(s->viz_rect.y + (bdr_s * 1.5)), 184, 202}; + ui_fill_rect(s->vg, rect, COLOR_BLACK_ALPHA(100), 30.); + ui_draw_rect(s->vg, rect, COLOR_WHITE_ALPHA(100), 10, 20.); + + nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); + ui_draw_text(s, rect.centerX(), 148, "MAX", 26 * 2.5, COLOR_WHITE_ALPHA(is_cruise_set ? 200 : 100), "sans-regular"); + if (is_cruise_set) { + const std::string maxspeed_str = std::to_string((int)std::nearbyint(maxspeed)); + ui_draw_text(s, rect.centerX(), 242, maxspeed_str.c_str(), 48 * 2.5, COLOR_WHITE, "sans-bold"); + } else { + ui_draw_text(s, rect.centerX(), 242, "N/A", 42 * 2.5, COLOR_WHITE_ALPHA(100), "sans-semibold"); + } +} + +static void ui_draw_vision_speed(UIState *s) { + const float speed = std::max(0.0, s->scene.car_state.getVEgo() * (s->scene.is_metric ? 3.6 : 2.2369363)); + const std::string speed_str = std::to_string((int)std::nearbyint(speed)); + nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); + ui_draw_text(s, s->viz_rect.centerX(), 240, speed_str.c_str(), 96 * 2.5, COLOR_WHITE, "sans-bold"); + ui_draw_text(s, s->viz_rect.centerX(), 320, s->scene.is_metric ? "km/h" : "mph", 36 * 2.5, COLOR_WHITE_ALPHA(200), "sans-regular"); +} + +static void ui_draw_vision_event(UIState *s) { + if (s->scene.controls_state.getEngageable()) { + // draw steering wheel + const int radius = 96; + const int center_x = s->viz_rect.right() - radius - bdr_s * 2; + const int center_y = s->viz_rect.y + radius + (bdr_s * 1.5); + ui_draw_circle_image(s, center_x, center_y, radius, "wheel", bg_colors[s->status], 1.0f); + } +} + +static void ui_draw_vision_face(UIState *s) { + const int radius = 96; + const int center_x = s->viz_rect.x + radius + (bdr_s * 2); + const int center_y = s->viz_rect.bottom() - footer_h / 2; + ui_draw_circle_image(s, center_x, center_y, radius, "driver_face", s->scene.dmonitoring_state.getIsActiveMode()); +} + +static void ui_draw_driver_view(UIState *s) { + s->sidebar_collapsed = true; + const bool is_rhd = s->scene.is_rhd; + const int width = 4 * s->viz_rect.h / 3; + const Rect rect = {s->viz_rect.centerX() - width / 2, s->viz_rect.y, width, s->viz_rect.h}; // x, y, w, h + const Rect valid_rect = {is_rhd ? rect.right() - rect.h / 2 : rect.x, rect.y, rect.h / 2, rect.h}; + + // blackout + const int blackout_x_r = valid_rect.right(); +#ifndef QCOM2 + const int blackout_w_r = rect.right() - valid_rect.right(); + const int blackout_x_l = rect.x; +#else + const int blackout_w_r = s->viz_rect.right() - valid_rect.right(); + const int blackout_x_l = s->viz_rect.x; +#endif + const int blackout_w_l = valid_rect.x - blackout_x_l; + ui_fill_rect(s->vg, {blackout_x_l, rect.y, blackout_w_l, rect.h}, COLOR_BLACK_ALPHA(144)); + ui_fill_rect(s->vg, {blackout_x_r, rect.y, blackout_w_r, rect.h}, COLOR_BLACK_ALPHA(144)); + + const bool face_detected = s->scene.driver_state.getFaceProb() > 0.4; + if (face_detected) { + auto fxy_list = s->scene.driver_state.getFacePosition(); + float face_x = fxy_list[0]; + float face_y = fxy_list[1]; + int fbox_x = valid_rect.centerX() + (is_rhd ? face_x : -face_x) * valid_rect.w; + int fbox_y = valid_rect.centerY() + face_y * valid_rect.h; + + float alpha = 0.2; + if (face_x = std::abs(face_x), face_y = std::abs(face_y); face_x <= 0.35 && face_y <= 0.4) + alpha = 0.8 - (face_x > face_y ? face_x : face_y) * 0.6 / 0.375; + + const int box_size = 0.6 * rect.h / 2; + ui_draw_rect(s->vg, {fbox_x - box_size / 2, fbox_y - box_size / 2, box_size, box_size}, nvgRGBAf(1.0, 1.0, 1.0, alpha), 10, 35.); + } + + // draw face icon + const int face_radius = 85; + const int center_x = is_rhd ? rect.right() - face_radius - bdr_s * 2 : rect.x + face_radius + bdr_s * 2; + const int center_y = rect.bottom() - face_radius - bdr_s * 2.5; + ui_draw_circle_image(s, center_x, center_y, face_radius, "driver_face", face_detected); +} + +static void ui_draw_vision_header(UIState *s) { + NVGpaint gradient = nvgLinearGradient(s->vg, s->viz_rect.x, + s->viz_rect.y+(header_h-(header_h/2.5)), + s->viz_rect.x, s->viz_rect.y+header_h, + nvgRGBAf(0,0,0,0.45), nvgRGBAf(0,0,0,0)); + + ui_fill_rect(s->vg, {s->viz_rect.x, s->viz_rect.y, s->viz_rect.w, header_h}, gradient); + + ui_draw_vision_maxspeed(s); + ui_draw_vision_speed(s); + ui_draw_vision_event(s); +} + +static void ui_draw_vision_footer(UIState *s) { + ui_draw_vision_face(s); +} + +static float get_alert_alpha(float blink_rate) { + return 0.375 * cos((millis_since_boot() / 1000) * 2 * M_PI * blink_rate) + 0.625; +} + +static void ui_draw_vision_alert(UIState *s) { + static std::map alert_size_map = { + {cereal::ControlsState::AlertSize::SMALL, 241}, + {cereal::ControlsState::AlertSize::MID, 390}, + {cereal::ControlsState::AlertSize::FULL, s->fb_h}}; + const UIScene *scene = &s->scene; + bool longAlert1 = scene->alert_text1.length() > 15; + + NVGcolor color = bg_colors[s->status]; + color.a *= get_alert_alpha(scene->alert_blinking_rate); + const int alr_h = alert_size_map[scene->alert_size] + bdr_s; + const Rect rect = {.x = s->viz_rect.x - bdr_s, + .y = s->fb_h - alr_h, + .w = s->viz_rect.w + (bdr_s * 2), + .h = alr_h}; + + ui_fill_rect(s->vg, rect, color); + ui_fill_rect(s->vg, rect, nvgLinearGradient(s->vg, rect.x, rect.y, rect.x, rect.bottom(), + nvgRGBAf(0.0, 0.0, 0.0, 0.05), nvgRGBAf(0.0, 0.0, 0.0, 0.35))); + + nvgFillColor(s->vg, COLOR_WHITE); + nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); + + if (scene->alert_size == cereal::ControlsState::AlertSize::SMALL) { + ui_draw_text(s, rect.centerX(), rect.centerY() + 15, scene->alert_text1.c_str(), 40*2.5, COLOR_WHITE, "sans-semibold"); + } else if (scene->alert_size == cereal::ControlsState::AlertSize::MID) { + ui_draw_text(s, rect.centerX(), rect.centerY() - 45, scene->alert_text1.c_str(), 48*2.5, COLOR_WHITE, "sans-bold"); + ui_draw_text(s, rect.centerX(), rect.centerY() + 75, scene->alert_text2.c_str(), 36*2.5, COLOR_WHITE, "sans-regular"); + } else if (scene->alert_size == cereal::ControlsState::AlertSize::FULL) { + nvgFontSize(s->vg, (longAlert1?72:96)*2.5); + nvgFontFace(s->vg, "sans-bold"); + nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE); + nvgTextBox(s->vg, rect.x, rect.y+(longAlert1?360:420), rect.w-60, scene->alert_text1.c_str(), NULL); + nvgFontSize(s->vg, 48*2.5); + nvgFontFace(s->vg, "sans-regular"); + nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BOTTOM); + nvgTextBox(s->vg, rect.x, rect.h-(longAlert1?300:360), rect.w-60, scene->alert_text2.c_str(), NULL); + } +} + +static void ui_draw_vision_frame(UIState *s) { + // Draw video frames + glEnable(GL_SCISSOR_TEST); + glViewport(s->video_rect.x, s->video_rect.y, s->video_rect.w, s->video_rect.h); + glScissor(s->viz_rect.x, s->viz_rect.y, s->viz_rect.w, s->viz_rect.h); + draw_frame(s); + glDisable(GL_SCISSOR_TEST); + + glViewport(0, 0, s->fb_w, s->fb_h); +} + +static void ui_draw_vision(UIState *s) { + const UIScene *scene = &s->scene; + if (!scene->driver_view) { + // Draw augmented elements + if (scene->world_objects_visible) { + ui_draw_world(s); + } + // Set Speed, Current Speed, Status/Events + ui_draw_vision_header(s); + if (scene->alert_size == cereal::ControlsState::AlertSize::NONE) { + ui_draw_vision_footer(s); + } + } else { + ui_draw_driver_view(s); + } +} + +static void ui_draw_background(UIState *s) { + const NVGcolor color = bg_colors[s->status]; + glClearColor(color.r, color.g, color.b, 1.0); + glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT); +} + +void ui_draw(UIState *s) { + s->viz_rect = Rect{bdr_s, bdr_s, s->fb_w - 2 * bdr_s, s->fb_h - 2 * bdr_s}; + if (!s->sidebar_collapsed) { + s->viz_rect.x += sbr_w; + s->viz_rect.w -= sbr_w; + } + + const bool draw_alerts = s->scene.started; + const bool draw_vision = draw_alerts && s->vipc_client->connected; + + // GL drawing functions + ui_draw_background(s); + if (draw_vision) { + ui_draw_vision_frame(s); + } + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glViewport(0, 0, s->fb_w, s->fb_h); + + // NVG drawing functions - should be no GL inside NVG frame + nvgBeginFrame(s->vg, s->fb_w, s->fb_h, 1.0f); + ui_draw_sidebar(s); + if (draw_vision) { + ui_draw_vision(s); + //nvgScale(s->vg,s->b.scr_scale_x,s->b.scr_scale_y); + //dashcam(s, dc_touch_x, dc_touch_y); + //bb_ui_draw_UI(s) ; + //ui_draw_infobar(s); + } + + if (draw_alerts && s->scene.alert_size != cereal::ControlsState::AlertSize::NONE) { + ui_draw_vision_alert(s); + } + + if (s->scene.driver_view && !s->vipc_client->connected) { + nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE); + ui_draw_text(s, s->viz_rect.centerX(), s->viz_rect.centerY(), "Please wait for camera to start", 40 * 2.5, COLOR_WHITE, "sans-bold"); + } + nvgEndFrame(s->vg); + glDisable(GL_BLEND); +} + +void ui_draw_image(const UIState *s, const Rect &r, const char *name, float alpha) { + nvgBeginPath(s->vg); + NVGpaint imgPaint = nvgImagePattern(s->vg, r.x, r.y, r.w, r.h, 0, s->images.at(name), alpha); + nvgRect(s->vg, r.x, r.y, r.w, r.h); + nvgFillPaint(s->vg, imgPaint); + nvgFill(s->vg); +} + +void ui_draw_rect(NVGcontext *vg, const Rect &r, NVGcolor color, int width, float radius) { + nvgBeginPath(vg); + radius > 0 ? nvgRoundedRect(vg, r.x, r.y, r.w, r.h, radius) : nvgRect(vg, r.x, r.y, r.w, r.h); + nvgStrokeColor(vg, color); + nvgStrokeWidth(vg, width); + nvgStroke(vg); +} + +static inline void fill_rect(NVGcontext *vg, const Rect &r, const NVGcolor *color, const NVGpaint *paint, float radius) { + nvgBeginPath(vg); + radius > 0 ? nvgRoundedRect(vg, r.x, r.y, r.w, r.h, radius) : nvgRect(vg, r.x, r.y, r.w, r.h); + if (color) nvgFillColor(vg, *color); + if (paint) nvgFillPaint(vg, *paint); + nvgFill(vg); +} +void ui_fill_rect(NVGcontext *vg, const Rect &r, const NVGcolor &color, float radius) { + fill_rect(vg, r, &color, nullptr, radius); +} +void ui_fill_rect(NVGcontext *vg, const Rect &r, const NVGpaint &paint, float radius) { + fill_rect(vg, r, nullptr, &paint, radius); +} + +static const char frame_vertex_shader[] = +#ifdef NANOVG_GL3_IMPLEMENTATION + "#version 150 core\n" +#else + "#version 300 es\n" +#endif + "in vec4 aPosition;\n" + "in vec4 aTexCoord;\n" + "uniform mat4 uTransform;\n" + "out vec4 vTexCoord;\n" + "void main() {\n" + " gl_Position = uTransform * aPosition;\n" + " vTexCoord = aTexCoord;\n" + "}\n"; + +static const char frame_fragment_shader[] = +#ifdef NANOVG_GL3_IMPLEMENTATION + "#version 150 core\n" +#else + "#version 300 es\n" +#endif + "precision mediump float;\n" + "uniform sampler2D uTexture;\n" + "in vec4 vTexCoord;\n" + "out vec4 colorOut;\n" + "void main() {\n" + " colorOut = texture(uTexture, vTexCoord.xy);\n" +#ifdef QCOM + " vec3 dz = vec3(0.0627f, 0.0627f, 0.0627f);\n" + " colorOut.rgb = ((vec3(1.0f, 1.0f, 1.0f) - dz) * colorOut.rgb / vec3(1.0f, 1.0f, 1.0f)) + dz;\n" +#endif + "}\n"; + +static const mat4 device_transform = {{ + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0, +}}; + +static const float driver_view_ratio = 1.333; +#ifndef QCOM2 +// frame from 4/3 to 16/9 display +static const mat4 driver_view_transform = {{ + driver_view_ratio*(1080-2*bdr_s)/(1920-2*bdr_s), 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0, +}}; +#else +// from dmonitoring.cc +static const int full_width_tici = 1928; +static const int full_height_tici = 1208; +static const int adapt_width_tici = 668; +static const int crop_x_offset = 32; +static const int crop_y_offset = -196; +static const float yscale = full_height_tici * driver_view_ratio / adapt_width_tici; +static const float xscale = yscale*(1080-2*bdr_s)/(2160-2*bdr_s)*full_width_tici/full_height_tici; + +static const mat4 driver_view_transform = {{ + xscale, 0.0, 0.0, xscale*crop_x_offset/full_width_tici*2, + 0.0, yscale, 0.0, yscale*crop_y_offset/full_height_tici*2, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0, +}}; +#endif + +void ui_nvg_init(UIState *s) { + // init drawing +#ifdef QCOM + // on QCOM, we enable MSAA + s->vg = nvgCreate(0); +#else + s->vg = nvgCreate(NVG_ANTIALIAS | NVG_STENCIL_STROKES | NVG_DEBUG); +#endif + assert(s->vg); + + // init fonts + std::pair fonts[] = { + {"sans-regular", "../assets/fonts/opensans_regular.ttf"}, + {"sans-semibold", "../assets/fonts/opensans_semibold.ttf"}, + {"sans-bold", "../assets/fonts/opensans_bold.ttf"}, + }; + for (auto [name, file] : fonts) { + int font_id = nvgCreateFont(s->vg, name, file); + assert(font_id >= 0); + } + + // init images + std::vector> images = { + {"wheel", "../assets/img_chffr_wheel.png"}, + {"trafficSign_turn", "../assets/img_trafficSign_turn.png"}, + {"driver_face", "../assets/img_driver_face.png"}, + {"button_settings", "../assets/images/button_settings.png"}, + {"button_home", "../assets/images/button_home.png"}, + {"battery", "../assets/images/battery.png"}, + {"battery_charging", "../assets/images/battery_charging.png"}, + {"network_0", "../assets/images/network_0.png"}, + {"network_1", "../assets/images/network_1.png"}, + {"network_2", "../assets/images/network_2.png"}, + {"network_3", "../assets/images/network_3.png"}, + {"network_4", "../assets/images/network_4.png"}, + {"network_5", "../assets/images/network_5.png"}, + }; + for (auto [name, file] : images) { + s->images[name] = nvgCreateImage(s->vg, file, 1); + assert(s->images[name] != 0); + } + + // init gl + s->gl_shader = std::make_unique(frame_vertex_shader, frame_fragment_shader); + GLint frame_pos_loc = glGetAttribLocation(s->gl_shader->prog, "aPosition"); + GLint frame_texcoord_loc = glGetAttribLocation(s->gl_shader->prog, "aTexCoord"); + + glViewport(0, 0, s->fb_w, s->fb_h); + + glDisable(GL_DEPTH_TEST); + + assert(glGetError() == GL_NO_ERROR); + + for (int i = 0; i < 2; i++) { + float x1, x2, y1, y2; + if (i == 1) { + // flip horizontally so it looks like a mirror + x1 = 0.0; + x2 = 1.0; + y1 = 1.0; + y2 = 0.0; + } else { + x1 = 1.0; + x2 = 0.0; + y1 = 1.0; + y2 = 0.0; + } + const uint8_t frame_indicies[] = {0, 1, 2, 0, 2, 3}; + const float frame_coords[4][4] = { + {-1.0, -1.0, x2, y1}, //bl + {-1.0, 1.0, x2, y2}, //tl + { 1.0, 1.0, x1, y2}, //tr + { 1.0, -1.0, x1, y1}, //br + }; + + glGenVertexArrays(1, &s->frame_vao[i]); + glBindVertexArray(s->frame_vao[i]); + glGenBuffers(1, &s->frame_vbo[i]); + glBindBuffer(GL_ARRAY_BUFFER, s->frame_vbo[i]); + glBufferData(GL_ARRAY_BUFFER, sizeof(frame_coords), frame_coords, GL_STATIC_DRAW); + glEnableVertexAttribArray(frame_pos_loc); + glVertexAttribPointer(frame_pos_loc, 2, GL_FLOAT, GL_FALSE, + sizeof(frame_coords[0]), (const void *)0); + glEnableVertexAttribArray(frame_texcoord_loc); + glVertexAttribPointer(frame_texcoord_loc, 2, GL_FLOAT, GL_FALSE, + sizeof(frame_coords[0]), (const void *)(sizeof(float) * 2)); + glGenBuffers(1, &s->frame_ibo[i]); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->frame_ibo[i]); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(frame_indicies), frame_indicies, GL_STATIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindVertexArray(0); + } + + auto intrinsic_matrix = s->wide_camera ? ecam_intrinsic_matrix : fcam_intrinsic_matrix; + + s->zoom = zoom / intrinsic_matrix.v[0]; + + if (s->wide_camera) { + s->zoom *= 0.5; + } + + s->video_rect = Rect{bdr_s, bdr_s, s->fb_w - 2 * bdr_s, s->fb_h - 2 * bdr_s}; + float zx = s->zoom * 2 * intrinsic_matrix.v[2] / s->video_rect.w; + float zy = s->zoom * 2 * intrinsic_matrix.v[5] / s->video_rect.h; + + const mat4 frame_transform = {{ + zx, 0.0, 0.0, 0.0, + 0.0, zy, 0.0, -y_offset / s->video_rect.h * 2, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0, + }}; + + s->front_frame_mat = matmul(device_transform, driver_view_transform); + s->rear_frame_mat = matmul(device_transform, frame_transform); + + // Apply transformation such that video pixel coordinates match video + // 1) Put (0, 0) in the middle of the video + nvgTranslate(s->vg, s->video_rect.x + s->video_rect.w / 2, s->video_rect.y + s->video_rect.h / 2 + y_offset); + + // 2) Apply same scaling as video + nvgScale(s->vg, s->zoom, s->zoom); + + // 3) Put (0, 0) in top left corner of video + nvgTranslate(s->vg, -intrinsic_matrix.v[2], -intrinsic_matrix.v[5]); + + nvgCurrentTransform(s->vg, s->car_space_transform); + nvgResetTransform(s->vg); +} diff --git a/selfdrive/ui/qt/api.cc b/selfdrive/ui/qt/api.cc new file mode 100644 index 000000000..8ac9b4131 --- /dev/null +++ b/selfdrive/ui/qt/api.cc @@ -0,0 +1,143 @@ +#include "selfdrive/ui/qt/api.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "selfdrive/common/params.h" +#include "selfdrive/common/util.h" +#include "selfdrive/hardware/hw.h" +#include "selfdrive/ui/qt/util.h" + +namespace CommaApi { + +QByteArray rsa_sign(const QByteArray &data) { + static std::string key = util::read_file(Path::rsa_file()); + if (key.empty()) { + qDebug() << "No RSA private key found, please run manager.py or registration.py"; + return {}; + } + + BIO* mem = BIO_new_mem_buf(key.data(), key.size()); + assert(mem); + RSA* rsa_private = PEM_read_bio_RSAPrivateKey(mem, NULL, NULL, NULL); + assert(rsa_private); + auto sig = QByteArray(); + sig.resize(RSA_size(rsa_private)); + unsigned int sig_len; + int ret = RSA_sign(NID_sha256, (unsigned char*)data.data(), data.size(), (unsigned char*)sig.data(), &sig_len, rsa_private); + assert(ret == 1); + assert(sig_len == sig.size()); + BIO_free(mem); + RSA_free(rsa_private); + return sig; +} + +QString create_jwt(const QJsonObject &payloads, int expiry) { + QJsonObject header = {{"alg", "RS256"}}; + + auto t = QDateTime::currentSecsSinceEpoch(); + QJsonObject payload = {{"identity", getDongleId().value_or("")}, {"nbf", t}, {"iat", t}, {"exp", t + expiry}}; + for (auto it = payloads.begin(); it != payloads.end(); ++it) { + payload.insert(it.key(), it.value()); + } + + auto b64_opts = QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals; + QString jwt = QJsonDocument(header).toJson(QJsonDocument::Compact).toBase64(b64_opts) + '.' + + QJsonDocument(payload).toJson(QJsonDocument::Compact).toBase64(b64_opts); + + auto hash = QCryptographicHash::hash(jwt.toUtf8(), QCryptographicHash::Sha256); + auto sig = rsa_sign(hash); + jwt += '.' + sig.toBase64(b64_opts); + return jwt; +} + +} // namespace CommaApi + +HttpRequest::HttpRequest(QObject *parent, bool create_jwt, int timeout) : create_jwt(create_jwt), QObject(parent) { + networkTimer = new QTimer(this); + networkTimer->setSingleShot(true); + networkTimer->setInterval(timeout); + connect(networkTimer, &QTimer::timeout, this, &HttpRequest::requestTimeout); +} + +bool HttpRequest::active() const { + return reply != nullptr; +} + +bool HttpRequest::timeout() const { + return reply && reply->error() == QNetworkReply::OperationCanceledError; +} + +void HttpRequest::sendRequest(const QString &requestURL, const HttpRequest::Method method) { + if (active()) { + qDebug() << "HttpRequest is active"; + return; + } + QString token; + if(create_jwt) { + token = CommaApi::create_jwt(); + } else { + QString token_json = QString::fromStdString(util::read_file(util::getenv("HOME") + "/.comma/auth.json")); + QJsonDocument json_d = QJsonDocument::fromJson(token_json.toUtf8()); + token = json_d["access_token"].toString(); + } + + QNetworkRequest request; + request.setUrl(QUrl(requestURL)); + request.setRawHeader("User-Agent", getUserAgent().toUtf8()); + + if (!token.isEmpty()) { + request.setRawHeader(QByteArray("Authorization"), ("JWT " + token).toUtf8()); + } + + if (method == HttpRequest::Method::GET) { + reply = nam()->get(request); + } else if (method == HttpRequest::Method::DELETE) { + reply = nam()->deleteResource(request); + } + + networkTimer->start(); + connect(reply, &QNetworkReply::finished, this, &HttpRequest::requestFinished); +} + +void HttpRequest::requestTimeout() { + reply->abort(); +} + +void HttpRequest::requestFinished() { + networkTimer->stop(); + + if (reply->error() == QNetworkReply::NoError) { + emit requestDone(reply->readAll(), true); + } else { + QString error; + if (reply->error() == QNetworkReply::OperationCanceledError) { + nam()->clearAccessCache(); + nam()->clearConnectionCache(); + error = "Request timed out"; + } else { + if (reply->error() == QNetworkReply::ContentAccessDenied || reply->error() == QNetworkReply::AuthenticationRequiredError) { + qWarning() << ">> Unauthorized. Authenticate with tools/lib/auth.py <<"; + } + error = reply->errorString(); + } + emit requestDone(error, false); + } + + reply->deleteLater(); + reply = nullptr; +} + +QNetworkAccessManager *HttpRequest::nam() { + static QNetworkAccessManager *networkAccessManager = new QNetworkAccessManager(qApp); + return networkAccessManager; +} diff --git a/selfdrive/ui/qt/api.h b/selfdrive/ui/qt/api.h new file mode 100644 index 000000000..8f7467810 --- /dev/null +++ b/selfdrive/ui/qt/api.h @@ -0,0 +1,47 @@ +#pragma once + +#include +#include +#include +#include + +#include "selfdrive/common/util.h" + +namespace CommaApi { + +const QString BASE_URL = util::getenv("API_HOST", "https://api.commadotai.com").c_str(); +QByteArray rsa_sign(const QByteArray &data); +QString create_jwt(const QJsonObject &payloads = {}, int expiry = 3600); + +} // namespace CommaApi + +/** + * Makes a request to the request endpoint. + */ + +class HttpRequest : public QObject { + Q_OBJECT + +public: + enum class Method {GET, DELETE}; + + explicit HttpRequest(QObject* parent, bool create_jwt = true, int timeout = 20000); + void sendRequest(const QString &requestURL, const Method method = Method::GET); + bool active() const; + bool timeout() const; + +signals: + void requestDone(const QString &response, bool success); + +protected: + QNetworkReply *reply = nullptr; + +private: + static QNetworkAccessManager *nam(); + QTimer *networkTimer = nullptr; + bool create_jwt; + +private slots: + void requestTimeout(); + void requestFinished(); +}; diff --git a/selfdrive/ui/qt/flasher b/selfdrive/ui/qt/flasher new file mode 100755 index 000000000..2a892fc5d Binary files /dev/null and b/selfdrive/ui/qt/flasher differ diff --git a/selfdrive/ui/qt/flasher.cc b/selfdrive/ui/qt/flasher.cc new file mode 100644 index 000000000..294433432 --- /dev/null +++ b/selfdrive/ui/qt/flasher.cc @@ -0,0 +1,236 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "selfdrive/hardware/hw.h" +#include "selfdrive/ui/qt/util.h" +#include "selfdrive/ui/qt/qt_window.h" +#include "selfdrive/ui/qt/widgets/scrollview.h" + + +#define MAXPATHLEN 200 + +QProcess *process; +QLabel *label; +int stage = 0; +QPushButton *btn; +QPushButton *btn2; +QPushButton *btn3; +QPushButton *btn4; + +void onFinished(int a) { + if (stage == -1) { + stage = 0; + return; + } + if (a == 0) { + btn->setEnabled(true); + btn2->setEnabled(false); + btn3->setEnabled(false); + btn4->setEnabled(false); + btn->repaint(); + btn2->repaint(); + btn3->repaint(); + btn4->repaint(); + stage = 0; + return; + } + if (a == 1) { + btn->setEnabled(true); + btn2->setEnabled(true); + btn3->setEnabled(true); + btn4->setEnabled(false); + btn->repaint(); + btn2->repaint(); + btn3->repaint(); + btn4->repaint(); + stage = 0; + } +} + +void reformatLabel(QString textToAdd) { + QString labelText = textToAdd; + labelText.replace("\r", "\n"); + label->setText(label->text() + labelText); +} + +void run_script(QString script) { + process = new QProcess(); // create on the heap, so it doesn't go out of scope + QObject::connect(process, &QProcess::readyReadStandardOutput, [=](){ + reformatLabel(process->readAllStandardOutput()); + }); + QObject::connect(process, &QProcess::readyReadStandardError, [=](){ + reformatLabel(process->readAllStandardError()); + }); + + QObject::connect(process, static_cast(&QProcess::finished), [=](int exitCode, QProcess::ExitStatus exitStatus){ + reformatLabel(process->readAll()); + onFinished(exitCode); + }); + + QObject::connect(process, &QProcess::errorOccurred, [=](QProcess::ProcessError error) + { + reformatLabel(process->readAll()); + onFinished(0); + }); + process->start(script); +} + +int main(int argc, char *argv[]) { + int length; + char fullpath[MAXPATHLEN]; + length = readlink("/proc/self/exe", fullpath, sizeof(fullpath)); + if (length < 0) { + perror("resolving symlink /proc/self/exe."); + exit(1); + } + if (length >= sizeof(fullpath)) { + fprintf(stderr, "Path too long.\n"); + exit(1); + } + fullpath[length] = '\0'; + QString basePath(fullpath); + int j = basePath.lastIndexOf('/') + 1; + basePath = basePath.left(j); + if (argc != 6) { + fprintf(stderr, "flasher requires 5 arguments\n"); + fprintf(stderr, "Usage: flasher Button1 script1.sh Button2 script2.sh splash_script.sh\n"); + exit(1); + } + QString button1_label(argv[1]); + QString button1_script(argv[2]); + QString button2_label(argv[3]); + QString button2_script(argv[4]); + QString splash_script(argv[5]); + initApp(); + QApplication a(argc, argv); + QWidget window; + setMainWindow(&window); + + process = new QProcess(); // create on the heap, so it doesn't go out of scope + QObject::connect(process, &QProcess::readyReadStandardOutput, [=](){ + label->setText(label->text() + process->readAllStandardOutput()); + }); + QObject::connect(process, &QProcess::readyReadStandardError, [=](){ + label->setText(label->text() + process->readAllStandardError()); + }); + + QObject::connect(process, static_cast(&QProcess::finished), [=](int exitCode, QProcess::ExitStatus exitStatus){ + label->setText(label->text() + process->readAll()); + onFinished(exitCode); + }); + + QObject::connect(process, &QProcess::errorOccurred, [=](QProcess::ProcessError error) + { + label->setText(label->text() + process->readAll()); + onFinished(0); + }); + + + QGridLayout *main_layout = new QGridLayout(&window); + main_layout->setMargin(50); + + label = new QLabel(""); + label->setWordWrap(false); + label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); + ScrollView *scroll = new ScrollView(label); + scroll->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); + main_layout->addWidget(scroll, 0, 0, 1, 4); + + // Scroll to the bottom + QObject::connect(scroll->verticalScrollBar(), &QAbstractSlider::rangeChanged, [=]() { + scroll->verticalScrollBar()->setValue(scroll->verticalScrollBar()->maximum()); + }); + + // Scroll to the left + QObject::connect(scroll->horizontalScrollBar(), &QAbstractSlider::rangeChanged, [=]() { + scroll->horizontalScrollBar()->setValue(scroll->horizontalScrollBar()->minimum()); + }); + + btn = new QPushButton(); + btn2 = new QPushButton(); + btn3 = new QPushButton(); + btn4 = new QPushButton(); + btn->setText("Reboot"); + QObject::connect(btn, &QPushButton::clicked, [=]() { + Hardware::reboot(); + }); + + if (button2_label != "-") { + btn2->setText(button2_label); + QObject::connect(btn2, &QPushButton::clicked, [=]() { + btn->setEnabled(false); + btn2->setEnabled(false); + btn3->setEnabled(false); + btn4->setEnabled(false); + btn->repaint(); + btn2->repaint(); + btn3->repaint(); + btn4->repaint(); + //kill what we have to again (just in case) + //flash EPAS + stage = 2; + run_script(basePath+button2_script); + }); + } + + if (button1_label != "-") { + btn3->setText(button1_label); + QObject::connect(btn3, &QPushButton::clicked, [=]() { + btn->setEnabled(false); + btn2->setEnabled(false); + btn3->setEnabled(false); + btn4->setEnabled(false); + btn->repaint(); + btn2->repaint(); + btn3->repaint(); + btn4->repaint(); + //kill what we have to + //baclup EPAS + stage = 1; + run_script(basePath+button1_script); + }); + } + + btn4->setText("Cancel"); + QObject::connect(btn4, &QPushButton::clicked, [=]() { + Hardware::reboot(); + }); + main_layout->addWidget(btn, 0, 3, Qt::AlignRight | Qt::AlignBottom); + main_layout->addWidget(btn2, 0, 2, Qt::AlignRight | Qt::AlignBottom); + main_layout->addWidget(btn3, 0, 1, Qt::AlignRight | Qt::AlignBottom); + main_layout->addWidget(btn4, 0, 0, Qt::AlignRight | Qt::AlignBottom); + window.setStyleSheet(R"( + * { + outline: none; + padding-bottom: 100px; + font-size: 40px; + } + QPushButton { + padding: 50px; + padding-right: 100px; + padding-left: 100px; + border: 2px solid white; + border-radius: 20px; + margin-right: 40px; + font-size: 60px; + } + )"); + + btn->setEnabled(false); + btn2->setEnabled(true); + btn3->setEnabled(true); + btn4->setEnabled(true); + btn->repaint(); + btn2->repaint(); + btn3->repaint(); + btn4->repaint(); + stage = -1; + run_script(basePath+splash_script); + return a.exec(); +} diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc new file mode 100644 index 000000000..df4f47494 --- /dev/null +++ b/selfdrive/ui/qt/home.cc @@ -0,0 +1,179 @@ +#include "selfdrive/ui/qt/home.h" + +#include +#include +#include +#include + +#include "selfdrive/common/params.h" +#include "selfdrive/ui/qt/util.h" +#include "selfdrive/ui/qt/widgets/drive_stats.h" +#include "selfdrive/ui/qt/widgets/prime.h" + +// HomeWindow: the container for the offroad and onroad UIs + +HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) { + QHBoxLayout *main_layout = new QHBoxLayout(this); + main_layout->setMargin(0); + main_layout->setSpacing(0); + + sidebar = new Sidebar(this); + main_layout->addWidget(sidebar); + QObject::connect(sidebar, &Sidebar::openSettings, this, &HomeWindow::openSettings); + + slayout = new QStackedLayout(); + main_layout->addLayout(slayout); + + home = new OffroadHome(); + slayout->addWidget(home); + + onroad = new OnroadWindow(this); + slayout->addWidget(onroad); + + driver_view = new DriverViewWindow(this); + connect(driver_view, &DriverViewWindow::done, [=] { + showDriverView(false); + }); + slayout->addWidget(driver_view); + setAttribute(Qt::WA_NoSystemBackground); + QObject::connect(uiState(), &UIState::offroadTransition, this, &HomeWindow::offroadTransition); +} + +void HomeWindow::showSidebar(bool show) { + sidebar->setVisible(show); +} + +void HomeWindow::offroadTransition(bool offroad) { + sidebar->setVisible(offroad); + if (offroad) { + slayout->setCurrentWidget(home); + } else { + slayout->setCurrentWidget(onroad); + } +} + +void HomeWindow::showDriverView(bool show) { + if (show) { + emit closeSettings(); + slayout->setCurrentWidget(driver_view); + } else { + slayout->setCurrentWidget(home); + } + sidebar->setVisible(show == false); +} + +void HomeWindow::mousePressEvent(QMouseEvent* e) { + // Handle sidebar collapsing + if (onroad->isVisible() && (!sidebar->isVisible() || e->x() > sidebar->width())) { + sidebar->setVisible(!sidebar->isVisible() && !onroad->isMapVisible()); + } +} + +// OffroadHome: the offroad home page + +OffroadHome::OffroadHome(QWidget* parent) : QFrame(parent) { + QVBoxLayout* main_layout = new QVBoxLayout(this); + main_layout->setContentsMargins(40, 40, 40, 45); + + // top header + QHBoxLayout* header_layout = new QHBoxLayout(); + header_layout->setContentsMargins(15, 15, 15, 0); + header_layout->setSpacing(16); + + date = new QLabel(); + header_layout->addWidget(date, 1, Qt::AlignHCenter | Qt::AlignLeft); + + update_notif = new QPushButton("UPDATE"); + update_notif->setVisible(false); + update_notif->setStyleSheet("background-color: #364DEF;"); + QObject::connect(update_notif, &QPushButton::clicked, [=]() { center_layout->setCurrentIndex(1); }); + header_layout->addWidget(update_notif, 0, Qt::AlignHCenter | Qt::AlignRight); + + alert_notif = new QPushButton(); + alert_notif->setVisible(false); + alert_notif->setStyleSheet("background-color: #E22C2C;"); + QObject::connect(alert_notif, &QPushButton::clicked, [=] { center_layout->setCurrentIndex(2); }); + header_layout->addWidget(alert_notif, 0, Qt::AlignHCenter | Qt::AlignRight); + + header_layout->addWidget(new QLabel(getBrandVersion()), 0, Qt::AlignHCenter | Qt::AlignRight); + + main_layout->addLayout(header_layout); + + // main content + main_layout->addSpacing(25); + center_layout = new QStackedLayout(); + + QWidget* statsAndSetupWidget = new QWidget(this); + QHBoxLayout* statsAndSetup = new QHBoxLayout(statsAndSetupWidget); + statsAndSetup->setMargin(0); + statsAndSetup->setSpacing(30); + statsAndSetup->addWidget(new DriveStats, 1); + statsAndSetup->addWidget(new SetupWidget); + + center_layout->addWidget(statsAndSetupWidget); + + // add update & alerts widgets + update_widget = new UpdateAlert(); + QObject::connect(update_widget, &UpdateAlert::dismiss, [=]() { center_layout->setCurrentIndex(0); }); + center_layout->addWidget(update_widget); + alerts_widget = new OffroadAlert(); + QObject::connect(alerts_widget, &OffroadAlert::dismiss, [=]() { center_layout->setCurrentIndex(0); }); + center_layout->addWidget(alerts_widget); + + main_layout->addLayout(center_layout, 1); + + // set up refresh timer + timer = new QTimer(this); + timer->callOnTimeout(this, &OffroadHome::refresh); + + setStyleSheet(R"( + * { + color: white; + } + OffroadHome { + background-color: black; + } + OffroadHome > QPushButton { + padding: 15px 30px; + border-radius: 5px; + font-size: 40px; + font-weight: 500; + } + OffroadHome > QLabel { + font-size: 55px; + } + )"); +} + +void OffroadHome::showEvent(QShowEvent *event) { + refresh(); + timer->start(10 * 1000); +} + +void OffroadHome::hideEvent(QHideEvent *event) { + timer->stop(); +} + +void OffroadHome::refresh() { + date->setText(QDateTime::currentDateTime().toString("dddd, MMMM d")); + + bool updateAvailable = update_widget->refresh(); + int alerts = alerts_widget->refresh(); + + // pop-up new notification + int idx = center_layout->currentIndex(); + if (!updateAvailable && !alerts) { + idx = 0; + } else if (updateAvailable && (!update_notif->isVisible() || (!alerts && idx == 2))) { + idx = 1; + } else if (alerts && (!alert_notif->isVisible() || (!updateAvailable && idx == 1))) { + idx = 2; + } + center_layout->setCurrentIndex(idx); + + update_notif->setVisible(updateAvailable); + alert_notif->setVisible(alerts); + if (alerts) { + alert_notif->setText(QString::number(alerts) + (alerts > 1 ? " ALERTS" : " ALERT")); + } +} diff --git a/selfdrive/ui/qt/home.h b/selfdrive/ui/qt/home.h new file mode 100644 index 000000000..732071c15 --- /dev/null +++ b/selfdrive/ui/qt/home.h @@ -0,0 +1,60 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "selfdrive/ui/qt/offroad/driverview.h" +#include "selfdrive/ui/qt/onroad.h" +#include "selfdrive/ui/qt/sidebar.h" +#include "selfdrive/ui/qt/widgets/offroad_alerts.h" +#include "selfdrive/ui/ui.h" + +class OffroadHome : public QFrame { + Q_OBJECT + +public: + explicit OffroadHome(QWidget* parent = 0); + +private: + void showEvent(QShowEvent *event) override; + void hideEvent(QHideEvent *event) override; + void refresh(); + + QTimer* timer; + QLabel* date; + QStackedLayout* center_layout; + UpdateAlert *update_widget; + OffroadAlert* alerts_widget; + QPushButton* alert_notif; + QPushButton* update_notif; +}; + +class HomeWindow : public QWidget { + Q_OBJECT + +public: + explicit HomeWindow(QWidget* parent = 0); + +signals: + void openSettings(); + void closeSettings(); + +public slots: + void offroadTransition(bool offroad); + void showDriverView(bool show); + void showSidebar(bool show); + +protected: + void mousePressEvent(QMouseEvent* e) override; + +private: + Sidebar *sidebar; + OffroadHome *home; + OnroadWindow *onroad; + DriverViewWindow *driver_view; + QStackedLayout *slayout; +}; diff --git a/selfdrive/ui/qt/libpython_helpers.so b/selfdrive/ui/qt/libpython_helpers.so new file mode 100755 index 000000000..0fe49ee7b Binary files /dev/null and b/selfdrive/ui/qt/libpython_helpers.so differ diff --git a/selfdrive/ui/qt/moc_api.cc b/selfdrive/ui/qt/moc_api.cc new file mode 100644 index 000000000..0a57a20f9 --- /dev/null +++ b/selfdrive/ui/qt/moc_api.cc @@ -0,0 +1,148 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'api.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "api.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'api.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_HttpRequest_t { + QByteArrayData data[7]; + char stringdata0[73]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_HttpRequest_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_HttpRequest_t qt_meta_stringdata_HttpRequest = { + { +QT_MOC_LITERAL(0, 0, 11), // "HttpRequest" +QT_MOC_LITERAL(1, 12, 11), // "requestDone" +QT_MOC_LITERAL(2, 24, 0), // "" +QT_MOC_LITERAL(3, 25, 8), // "response" +QT_MOC_LITERAL(4, 34, 7), // "success" +QT_MOC_LITERAL(5, 42, 14), // "requestTimeout" +QT_MOC_LITERAL(6, 57, 15) // "requestFinished" + + }, + "HttpRequest\0requestDone\0\0response\0" + "success\0requestTimeout\0requestFinished" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_HttpRequest[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 3, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 2, 29, 2, 0x06 /* Public */, + + // slots: name, argc, parameters, tag, flags + 5, 0, 34, 2, 0x08 /* Private */, + 6, 0, 35, 2, 0x08 /* Private */, + + // signals: parameters + QMetaType::Void, QMetaType::QString, QMetaType::Bool, 3, 4, + + // slots: parameters + QMetaType::Void, + QMetaType::Void, + + 0 // eod +}; + +void HttpRequest::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->requestDone((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break; + case 1: _t->requestTimeout(); break; + case 2: _t->requestFinished(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (HttpRequest::*)(const QString & , bool ); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&HttpRequest::requestDone)) { + *result = 0; + return; + } + } + } +} + +QT_INIT_METAOBJECT const QMetaObject HttpRequest::staticMetaObject = { { + &QObject::staticMetaObject, + qt_meta_stringdata_HttpRequest.data, + qt_meta_data_HttpRequest, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *HttpRequest::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *HttpRequest::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_HttpRequest.stringdata0)) + return static_cast(this); + return QObject::qt_metacast(_clname); +} + +int HttpRequest::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QObject::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 3) + qt_static_metacall(this, _c, _id, _a); + _id -= 3; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 3) + *reinterpret_cast(_a[0]) = -1; + _id -= 3; + } + return _id; +} + +// SIGNAL 0 +void HttpRequest::requestDone(const QString & _t1, bool _t2) +{ + void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)), const_cast(reinterpret_cast(&_t2)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/moc_home.cc b/selfdrive/ui/qt/moc_home.cc new file mode 100644 index 000000000..86ccf5ec4 --- /dev/null +++ b/selfdrive/ui/qt/moc_home.cc @@ -0,0 +1,239 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'home.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "home.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'home.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_OffroadHome_t { + QByteArrayData data[1]; + char stringdata0[12]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_OffroadHome_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_OffroadHome_t qt_meta_stringdata_OffroadHome = { + { +QT_MOC_LITERAL(0, 0, 11) // "OffroadHome" + + }, + "OffroadHome" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_OffroadHome[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void OffroadHome::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject OffroadHome::staticMetaObject = { { + &QFrame::staticMetaObject, + qt_meta_stringdata_OffroadHome.data, + qt_meta_data_OffroadHome, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *OffroadHome::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *OffroadHome::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_OffroadHome.stringdata0)) + return static_cast(this); + return QFrame::qt_metacast(_clname); +} + +int OffroadHome::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QFrame::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_HomeWindow_t { + QByteArrayData data[9]; + char stringdata0[97]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_HomeWindow_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_HomeWindow_t qt_meta_stringdata_HomeWindow = { + { +QT_MOC_LITERAL(0, 0, 10), // "HomeWindow" +QT_MOC_LITERAL(1, 11, 12), // "openSettings" +QT_MOC_LITERAL(2, 24, 0), // "" +QT_MOC_LITERAL(3, 25, 13), // "closeSettings" +QT_MOC_LITERAL(4, 39, 17), // "offroadTransition" +QT_MOC_LITERAL(5, 57, 7), // "offroad" +QT_MOC_LITERAL(6, 65, 14), // "showDriverView" +QT_MOC_LITERAL(7, 80, 4), // "show" +QT_MOC_LITERAL(8, 85, 11) // "showSidebar" + + }, + "HomeWindow\0openSettings\0\0closeSettings\0" + "offroadTransition\0offroad\0showDriverView\0" + "show\0showSidebar" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_HomeWindow[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 5, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 2, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 39, 2, 0x06 /* Public */, + 3, 0, 40, 2, 0x06 /* Public */, + + // slots: name, argc, parameters, tag, flags + 4, 1, 41, 2, 0x0a /* Public */, + 6, 1, 44, 2, 0x0a /* Public */, + 8, 1, 47, 2, 0x0a /* Public */, + + // signals: parameters + QMetaType::Void, + QMetaType::Void, + + // slots: parameters + QMetaType::Void, QMetaType::Bool, 5, + QMetaType::Void, QMetaType::Bool, 7, + QMetaType::Void, QMetaType::Bool, 7, + + 0 // eod +}; + +void HomeWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->openSettings(); break; + case 1: _t->closeSettings(); break; + case 2: _t->offroadTransition((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 3: _t->showDriverView((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 4: _t->showSidebar((*reinterpret_cast< bool(*)>(_a[1]))); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (HomeWindow::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&HomeWindow::openSettings)) { + *result = 0; + return; + } + } + { + using _t = void (HomeWindow::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&HomeWindow::closeSettings)) { + *result = 1; + return; + } + } + } +} + +QT_INIT_METAOBJECT const QMetaObject HomeWindow::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_HomeWindow.data, + qt_meta_data_HomeWindow, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *HomeWindow::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *HomeWindow::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_HomeWindow.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int HomeWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 5) + qt_static_metacall(this, _c, _id, _a); + _id -= 5; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 5) + *reinterpret_cast(_a[0]) = -1; + _id -= 5; + } + return _id; +} + +// SIGNAL 0 +void HomeWindow::openSettings() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} + +// SIGNAL 1 +void HomeWindow::closeSettings() +{ + QMetaObject::activate(this, &staticMetaObject, 1, nullptr); +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/moc_onroad.cc b/selfdrive/ui/qt/moc_onroad.cc new file mode 100644 index 000000000..002fa10cc --- /dev/null +++ b/selfdrive/ui/qt/moc_onroad.cc @@ -0,0 +1,495 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'onroad.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "onroad.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'onroad.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_OnroadHud_t { + QByteArrayData data[11]; + char stringdata0[97]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_OnroadHud_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_OnroadHud_t qt_meta_stringdata_OnroadHud = { + { +QT_MOC_LITERAL(0, 0, 9), // "OnroadHud" +QT_MOC_LITERAL(1, 10, 12), // "valueChanged" +QT_MOC_LITERAL(2, 23, 0), // "" +QT_MOC_LITERAL(3, 24, 5), // "speed" +QT_MOC_LITERAL(4, 30, 9), // "speedUnit" +QT_MOC_LITERAL(5, 40, 8), // "maxSpeed" +QT_MOC_LITERAL(6, 49, 13), // "is_cruise_set" +QT_MOC_LITERAL(7, 63, 10), // "engageable" +QT_MOC_LITERAL(8, 74, 8), // "dmActive" +QT_MOC_LITERAL(9, 83, 6), // "hideDM" +QT_MOC_LITERAL(10, 90, 6) // "status" + + }, + "OnroadHud\0valueChanged\0\0speed\0speedUnit\0" + "maxSpeed\0is_cruise_set\0engageable\0" + "dmActive\0hideDM\0status" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_OnroadHud[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 8, 20, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x06 /* Public */, + + // signals: parameters + QMetaType::Void, + + // properties: name, type, flags + 3, QMetaType::QString, 0x00495003, + 4, QMetaType::QString, 0x00495003, + 5, QMetaType::QString, 0x00495003, + 6, QMetaType::Bool, 0x00495003, + 7, QMetaType::Bool, 0x00495003, + 8, QMetaType::Bool, 0x00495003, + 9, QMetaType::Bool, 0x00495003, + 10, QMetaType::Int, 0x00495003, + + // properties: notify_signal_id + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + + 0 // eod +}; + +void OnroadHud::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->valueChanged(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (OnroadHud::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&OnroadHud::valueChanged)) { + *result = 0; + return; + } + } + } +#ifndef QT_NO_PROPERTIES + else if (_c == QMetaObject::ReadProperty) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + void *_v = _a[0]; + switch (_id) { + case 0: *reinterpret_cast< QString*>(_v) = _t->speed; break; + case 1: *reinterpret_cast< QString*>(_v) = _t->speedUnit; break; + case 2: *reinterpret_cast< QString*>(_v) = _t->maxSpeed; break; + case 3: *reinterpret_cast< bool*>(_v) = _t->is_cruise_set; break; + case 4: *reinterpret_cast< bool*>(_v) = _t->engageable; break; + case 5: *reinterpret_cast< bool*>(_v) = _t->dmActive; break; + case 6: *reinterpret_cast< bool*>(_v) = _t->hideDM; break; + case 7: *reinterpret_cast< int*>(_v) = _t->status; break; + default: break; + } + } else if (_c == QMetaObject::WriteProperty) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + void *_v = _a[0]; + switch (_id) { + case 0: + if (_t->speed != *reinterpret_cast< QString*>(_v)) { + _t->speed = *reinterpret_cast< QString*>(_v); + Q_EMIT _t->valueChanged(); + } + break; + case 1: + if (_t->speedUnit != *reinterpret_cast< QString*>(_v)) { + _t->speedUnit = *reinterpret_cast< QString*>(_v); + Q_EMIT _t->valueChanged(); + } + break; + case 2: + if (_t->maxSpeed != *reinterpret_cast< QString*>(_v)) { + _t->maxSpeed = *reinterpret_cast< QString*>(_v); + Q_EMIT _t->valueChanged(); + } + break; + case 3: + if (_t->is_cruise_set != *reinterpret_cast< bool*>(_v)) { + _t->is_cruise_set = *reinterpret_cast< bool*>(_v); + Q_EMIT _t->valueChanged(); + } + break; + case 4: + if (_t->engageable != *reinterpret_cast< bool*>(_v)) { + _t->engageable = *reinterpret_cast< bool*>(_v); + Q_EMIT _t->valueChanged(); + } + break; + case 5: + if (_t->dmActive != *reinterpret_cast< bool*>(_v)) { + _t->dmActive = *reinterpret_cast< bool*>(_v); + Q_EMIT _t->valueChanged(); + } + break; + case 6: + if (_t->hideDM != *reinterpret_cast< bool*>(_v)) { + _t->hideDM = *reinterpret_cast< bool*>(_v); + Q_EMIT _t->valueChanged(); + } + break; + case 7: + if (_t->status != *reinterpret_cast< int*>(_v)) { + _t->status = *reinterpret_cast< int*>(_v); + Q_EMIT _t->valueChanged(); + } + break; + default: break; + } + } else if (_c == QMetaObject::ResetProperty) { + } +#endif // QT_NO_PROPERTIES + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject OnroadHud::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_OnroadHud.data, + qt_meta_data_OnroadHud, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *OnroadHud::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *OnroadHud::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_OnroadHud.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int OnroadHud::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } +#ifndef QT_NO_PROPERTIES + else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty + || _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) { + qt_static_metacall(this, _c, _id, _a); + _id -= 8; + } else if (_c == QMetaObject::QueryPropertyDesignable) { + _id -= 8; + } else if (_c == QMetaObject::QueryPropertyScriptable) { + _id -= 8; + } else if (_c == QMetaObject::QueryPropertyStored) { + _id -= 8; + } else if (_c == QMetaObject::QueryPropertyEditable) { + _id -= 8; + } else if (_c == QMetaObject::QueryPropertyUser) { + _id -= 8; + } +#endif // QT_NO_PROPERTIES + return _id; +} + +// SIGNAL 0 +void OnroadHud::valueChanged() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} +struct qt_meta_stringdata_OnroadAlerts_t { + QByteArrayData data[1]; + char stringdata0[13]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_OnroadAlerts_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_OnroadAlerts_t qt_meta_stringdata_OnroadAlerts = { + { +QT_MOC_LITERAL(0, 0, 12) // "OnroadAlerts" + + }, + "OnroadAlerts" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_OnroadAlerts[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void OnroadAlerts::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject OnroadAlerts::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_OnroadAlerts.data, + qt_meta_data_OnroadAlerts, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *OnroadAlerts::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *OnroadAlerts::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_OnroadAlerts.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int OnroadAlerts::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_NvgWindow_t { + QByteArrayData data[1]; + char stringdata0[10]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_NvgWindow_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_NvgWindow_t qt_meta_stringdata_NvgWindow = { + { +QT_MOC_LITERAL(0, 0, 9) // "NvgWindow" + + }, + "NvgWindow" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_NvgWindow[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void NvgWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject NvgWindow::staticMetaObject = { { + &CameraViewWidget::staticMetaObject, + qt_meta_stringdata_NvgWindow.data, + qt_meta_data_NvgWindow, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *NvgWindow::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *NvgWindow::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_NvgWindow.stringdata0)) + return static_cast(this); + return CameraViewWidget::qt_metacast(_clname); +} + +int NvgWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = CameraViewWidget::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_OnroadWindow_t { + QByteArrayData data[7]; + char stringdata0[62]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_OnroadWindow_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_OnroadWindow_t qt_meta_stringdata_OnroadWindow = { + { +QT_MOC_LITERAL(0, 0, 12), // "OnroadWindow" +QT_MOC_LITERAL(1, 13, 17), // "offroadTransition" +QT_MOC_LITERAL(2, 31, 0), // "" +QT_MOC_LITERAL(3, 32, 7), // "offroad" +QT_MOC_LITERAL(4, 40, 11), // "updateState" +QT_MOC_LITERAL(5, 52, 7), // "UIState" +QT_MOC_LITERAL(6, 60, 1) // "s" + + }, + "OnroadWindow\0offroadTransition\0\0offroad\0" + "updateState\0UIState\0s" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_OnroadWindow[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 2, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: name, argc, parameters, tag, flags + 1, 1, 24, 2, 0x08 /* Private */, + 4, 1, 27, 2, 0x08 /* Private */, + + // slots: parameters + QMetaType::Void, QMetaType::Bool, 3, + QMetaType::Void, 0x80000000 | 5, 6, + + 0 // eod +}; + +void OnroadWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->offroadTransition((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 1: _t->updateState((*reinterpret_cast< const UIState(*)>(_a[1]))); break; + default: ; + } + } +} + +QT_INIT_METAOBJECT const QMetaObject OnroadWindow::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_OnroadWindow.data, + qt_meta_data_OnroadWindow, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *OnroadWindow::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *OnroadWindow::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_OnroadWindow.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int OnroadWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 2) + qt_static_metacall(this, _c, _id, _a); + _id -= 2; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 2) + *reinterpret_cast(_a[0]) = -1; + _id -= 2; + } + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/moc_sidebar.cc b/selfdrive/ui/qt/moc_sidebar.cc new file mode 100644 index 000000000..533fadf5b --- /dev/null +++ b/selfdrive/ui/qt/moc_sidebar.cc @@ -0,0 +1,261 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'sidebar.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "sidebar.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'sidebar.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_Sidebar_t { + QByteArrayData data[13]; + char stringdata0[125]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_Sidebar_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_Sidebar_t qt_meta_stringdata_Sidebar = { + { +QT_MOC_LITERAL(0, 0, 7), // "Sidebar" +QT_MOC_LITERAL(1, 8, 12), // "openSettings" +QT_MOC_LITERAL(2, 21, 0), // "" +QT_MOC_LITERAL(3, 22, 12), // "valueChanged" +QT_MOC_LITERAL(4, 35, 11), // "updateState" +QT_MOC_LITERAL(5, 47, 7), // "UIState" +QT_MOC_LITERAL(6, 55, 1), // "s" +QT_MOC_LITERAL(7, 57, 13), // "connectStatus" +QT_MOC_LITERAL(8, 71, 10), // "ItemStatus" +QT_MOC_LITERAL(9, 82, 11), // "pandaStatus" +QT_MOC_LITERAL(10, 94, 10), // "tempStatus" +QT_MOC_LITERAL(11, 105, 7), // "netType" +QT_MOC_LITERAL(12, 113, 11) // "netStrength" + + }, + "Sidebar\0openSettings\0\0valueChanged\0" + "updateState\0UIState\0s\0connectStatus\0" + "ItemStatus\0pandaStatus\0tempStatus\0" + "netType\0netStrength" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_Sidebar[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 3, 14, // methods + 5, 34, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 2, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 29, 2, 0x06 /* Public */, + 3, 0, 30, 2, 0x06 /* Public */, + + // slots: name, argc, parameters, tag, flags + 4, 1, 31, 2, 0x0a /* Public */, + + // signals: parameters + QMetaType::Void, + QMetaType::Void, + + // slots: parameters + QMetaType::Void, 0x80000000 | 5, 6, + + // properties: name, type, flags + 7, 0x80000000 | 8, 0x0049500b, + 9, 0x80000000 | 8, 0x0049500b, + 10, 0x80000000 | 8, 0x0049500b, + 11, QMetaType::QString, 0x00495003, + 12, QMetaType::Int, 0x00495003, + + // properties: notify_signal_id + 1, + 1, + 1, + 1, + 1, + + 0 // eod +}; + +void Sidebar::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->openSettings(); break; + case 1: _t->valueChanged(); break; + case 2: _t->updateState((*reinterpret_cast< const UIState(*)>(_a[1]))); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (Sidebar::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&Sidebar::openSettings)) { + *result = 0; + return; + } + } + { + using _t = void (Sidebar::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&Sidebar::valueChanged)) { + *result = 1; + return; + } + } + } else if (_c == QMetaObject::RegisterPropertyMetaType) { + switch (_id) { + default: *reinterpret_cast(_a[0]) = -1; break; + case 2: + case 1: + case 0: + *reinterpret_cast(_a[0]) = qRegisterMetaType< ItemStatus >(); break; + } + } + +#ifndef QT_NO_PROPERTIES + else if (_c == QMetaObject::ReadProperty) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + void *_v = _a[0]; + switch (_id) { + case 0: *reinterpret_cast< ItemStatus*>(_v) = _t->connect_status; break; + case 1: *reinterpret_cast< ItemStatus*>(_v) = _t->panda_status; break; + case 2: *reinterpret_cast< ItemStatus*>(_v) = _t->temp_status; break; + case 3: *reinterpret_cast< QString*>(_v) = _t->net_type; break; + case 4: *reinterpret_cast< int*>(_v) = _t->net_strength; break; + default: break; + } + } else if (_c == QMetaObject::WriteProperty) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + void *_v = _a[0]; + switch (_id) { + case 0: + if (_t->connect_status != *reinterpret_cast< ItemStatus*>(_v)) { + _t->connect_status = *reinterpret_cast< ItemStatus*>(_v); + Q_EMIT _t->valueChanged(); + } + break; + case 1: + if (_t->panda_status != *reinterpret_cast< ItemStatus*>(_v)) { + _t->panda_status = *reinterpret_cast< ItemStatus*>(_v); + Q_EMIT _t->valueChanged(); + } + break; + case 2: + if (_t->temp_status != *reinterpret_cast< ItemStatus*>(_v)) { + _t->temp_status = *reinterpret_cast< ItemStatus*>(_v); + Q_EMIT _t->valueChanged(); + } + break; + case 3: + if (_t->net_type != *reinterpret_cast< QString*>(_v)) { + _t->net_type = *reinterpret_cast< QString*>(_v); + Q_EMIT _t->valueChanged(); + } + break; + case 4: + if (_t->net_strength != *reinterpret_cast< int*>(_v)) { + _t->net_strength = *reinterpret_cast< int*>(_v); + Q_EMIT _t->valueChanged(); + } + break; + default: break; + } + } else if (_c == QMetaObject::ResetProperty) { + } +#endif // QT_NO_PROPERTIES +} + +QT_INIT_METAOBJECT const QMetaObject Sidebar::staticMetaObject = { { + &QFrame::staticMetaObject, + qt_meta_stringdata_Sidebar.data, + qt_meta_data_Sidebar, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *Sidebar::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *Sidebar::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_Sidebar.stringdata0)) + return static_cast(this); + return QFrame::qt_metacast(_clname); +} + +int Sidebar::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QFrame::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 3) + qt_static_metacall(this, _c, _id, _a); + _id -= 3; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 3) + *reinterpret_cast(_a[0]) = -1; + _id -= 3; + } +#ifndef QT_NO_PROPERTIES + else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty + || _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) { + qt_static_metacall(this, _c, _id, _a); + _id -= 5; + } else if (_c == QMetaObject::QueryPropertyDesignable) { + _id -= 5; + } else if (_c == QMetaObject::QueryPropertyScriptable) { + _id -= 5; + } else if (_c == QMetaObject::QueryPropertyStored) { + _id -= 5; + } else if (_c == QMetaObject::QueryPropertyEditable) { + _id -= 5; + } else if (_c == QMetaObject::QueryPropertyUser) { + _id -= 5; + } +#endif // QT_NO_PROPERTIES + return _id; +} + +// SIGNAL 0 +void Sidebar::openSettings() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} + +// SIGNAL 1 +void Sidebar::valueChanged() +{ + QMetaObject::activate(this, &staticMetaObject, 1, nullptr); +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/moc_spinner.cc b/selfdrive/ui/qt/moc_spinner.cc new file mode 100644 index 000000000..49015b9ad --- /dev/null +++ b/selfdrive/ui/qt/moc_spinner.cc @@ -0,0 +1,188 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'spinner.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "spinner.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'spinner.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_TrackWidget_t { + QByteArrayData data[1]; + char stringdata0[12]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_TrackWidget_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_TrackWidget_t qt_meta_stringdata_TrackWidget = { + { +QT_MOC_LITERAL(0, 0, 11) // "TrackWidget" + + }, + "TrackWidget" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_TrackWidget[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void TrackWidget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject TrackWidget::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_TrackWidget.data, + qt_meta_data_TrackWidget, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *TrackWidget::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *TrackWidget::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_TrackWidget.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int TrackWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_Spinner_t { + QByteArrayData data[4]; + char stringdata0[18]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_Spinner_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_Spinner_t qt_meta_stringdata_Spinner = { + { +QT_MOC_LITERAL(0, 0, 7), // "Spinner" +QT_MOC_LITERAL(1, 8, 6), // "update" +QT_MOC_LITERAL(2, 15, 0), // "" +QT_MOC_LITERAL(3, 16, 1) // "n" + + }, + "Spinner\0update\0\0n" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_Spinner[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: name, argc, parameters, tag, flags + 1, 1, 19, 2, 0x0a /* Public */, + + // slots: parameters + QMetaType::Void, QMetaType::Int, 3, + + 0 // eod +}; + +void Spinner::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->update((*reinterpret_cast< int(*)>(_a[1]))); break; + default: ; + } + } +} + +QT_INIT_METAOBJECT const QMetaObject Spinner::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_Spinner.data, + qt_meta_data_Spinner, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *Spinner::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *Spinner::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_Spinner.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int Spinner::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/moc_window.cc b/selfdrive/ui/qt/moc_window.cc new file mode 100644 index 000000000..8d4f6b7bf --- /dev/null +++ b/selfdrive/ui/qt/moc_window.cc @@ -0,0 +1,94 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'window.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "window.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'window.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_MainWindow_t { + QByteArrayData data[1]; + char stringdata0[11]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_MainWindow_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_MainWindow_t qt_meta_stringdata_MainWindow = { + { +QT_MOC_LITERAL(0, 0, 10) // "MainWindow" + + }, + "MainWindow" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_MainWindow[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject MainWindow::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_MainWindow.data, + qt_meta_data_MainWindow, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *MainWindow::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *MainWindow::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_MainWindow.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/offroad/driverview.cc b/selfdrive/ui/qt/offroad/driverview.cc new file mode 100644 index 000000000..3ab5b999b --- /dev/null +++ b/selfdrive/ui/qt/offroad/driverview.cc @@ -0,0 +1,101 @@ +#include "selfdrive/ui/qt/offroad/driverview.h" + +#include + +#include "selfdrive/ui/qt/qt_window.h" +#include "selfdrive/ui/qt/util.h" + +const int FACE_IMG_SIZE = 130; + +DriverViewWindow::DriverViewWindow(QWidget* parent) : QWidget(parent) { + setAttribute(Qt::WA_OpaquePaintEvent); + layout = new QStackedLayout(this); + layout->setStackingMode(QStackedLayout::StackAll); + + cameraView = new CameraViewWidget("camerad", VISION_STREAM_RGB_FRONT, true, this); + layout->addWidget(cameraView); + + scene = new DriverViewScene(this); + connect(cameraView, &CameraViewWidget::vipcThreadFrameReceived, scene, &DriverViewScene::frameUpdated); + layout->addWidget(scene); + layout->setCurrentWidget(scene); +} + +void DriverViewWindow::mouseReleaseEvent(QMouseEvent* e) { + emit done(); +} + +DriverViewScene::DriverViewScene(QWidget* parent) : sm({"driverState"}), QWidget(parent) { + face_img = loadPixmap("../assets/img_driver_face.png", {FACE_IMG_SIZE, FACE_IMG_SIZE}); +} + +void DriverViewScene::showEvent(QShowEvent* event) { + frame_updated = false; + is_rhd = params.getBool("IsRHD"); + params.putBool("IsDriverViewEnabled", true); +} + +void DriverViewScene::hideEvent(QHideEvent* event) { + params.putBool("IsDriverViewEnabled", false); +} + +void DriverViewScene::frameUpdated() { + frame_updated = true; + sm.update(0); + update(); +} + +void DriverViewScene::paintEvent(QPaintEvent* event) { + QPainter p(this); + + // startup msg + if (!frame_updated) { + p.setPen(Qt::white); + p.setRenderHint(QPainter::TextAntialiasing); + configFont(p, "Inter", 100, "Bold"); + p.drawText(geometry(), Qt::AlignCenter, "camera starting"); + return; + } + + const int width = 4 * height() / 3; + const QRect rect2 = {rect().center().x() - width / 2, rect().top(), width, rect().height()}; + const QRect valid_rect = {is_rhd ? rect2.right() - rect2.height() / 2 : rect2.left(), rect2.top(), rect2.height() / 2, rect2.height()}; + + // blackout + const QColor bg(0, 0, 0, 140); + const QRect& blackout_rect = Hardware::TICI() ? rect() : rect2; + p.fillRect(blackout_rect.adjusted(0, 0, valid_rect.left() - blackout_rect.right(), 0), bg); + p.fillRect(blackout_rect.adjusted(valid_rect.right() - blackout_rect.left(), 0, 0, 0), bg); + if (Hardware::TICI()) { + p.fillRect(blackout_rect.adjusted(valid_rect.left()-blackout_rect.left()+1, 0, valid_rect.right()-blackout_rect.right()-1, -valid_rect.height()*7/10), bg); // top dz + } + + // face bounding box + cereal::DriverState::Reader driver_state = sm["driverState"].getDriverState(); + bool face_detected = driver_state.getFaceProb() > 0.5; + if (face_detected) { + auto fxy_list = driver_state.getFacePosition(); + auto std_list = driver_state.getFaceOrientationStd(); + float face_x = fxy_list[0]; + float face_y = fxy_list[1]; + float face_std = std::max(std_list[0], std_list[1]); + + float alpha = 0.7; + if (face_std > 0.08) { + alpha = std::max(0.7 - (face_std-0.08)*7, 0.0); + } + const int box_size = 0.6 * rect2.height() / 2; + const float rhd_offset = 0.05; // lhd is shifted, so rhd is not mirrored + int fbox_x = valid_rect.center().x() + (is_rhd ? (face_x + rhd_offset) : -face_x) * valid_rect.width(); + int fbox_y = valid_rect.center().y() + face_y * valid_rect.height(); + p.setPen(QPen(QColor(255, 255, 255, alpha * 255), 10)); + p.drawRoundedRect(fbox_x - box_size / 2, fbox_y - box_size / 2, box_size, box_size, 35.0, 35.0); + } + + // icon + const int img_offset = 30; + const int img_x = is_rhd ? rect2.right() - FACE_IMG_SIZE - img_offset : rect2.left() + img_offset; + const int img_y = rect2.bottom() - FACE_IMG_SIZE - img_offset; + p.setOpacity(face_detected ? 1.0 : 0.3); + p.drawPixmap(img_x, img_y, face_img); +} diff --git a/selfdrive/ui/qt/offroad/driverview.h b/selfdrive/ui/qt/offroad/driverview.h new file mode 100644 index 000000000..4d4a4358e --- /dev/null +++ b/selfdrive/ui/qt/offroad/driverview.h @@ -0,0 +1,48 @@ +#pragma once + +#include + +#include + +#include "selfdrive/common/util.h" +#include "selfdrive/ui/qt/widgets/cameraview.h" + +class DriverViewScene : public QWidget { + Q_OBJECT + +public: + explicit DriverViewScene(QWidget *parent); + +public slots: + void frameUpdated(); + +protected: + void showEvent(QShowEvent *event) override; + void hideEvent(QHideEvent *event) override; + void paintEvent(QPaintEvent *event) override; + +private: + Params params; + SubMaster sm; + QPixmap face_img; + bool is_rhd = false; + bool frame_updated = false; +}; + +class DriverViewWindow : public QWidget { + Q_OBJECT + +public: + explicit DriverViewWindow(QWidget *parent); + +signals: + void done(); + +protected: + void mouseReleaseEvent(QMouseEvent* e) override; + +private: + CameraViewWidget *cameraView; + DriverViewScene *scene; + QStackedLayout *layout; +}; diff --git a/selfdrive/ui/qt/offroad/moc_driverview.cc b/selfdrive/ui/qt/offroad/moc_driverview.cc new file mode 100644 index 000000000..372d51921 --- /dev/null +++ b/selfdrive/ui/qt/offroad/moc_driverview.cc @@ -0,0 +1,227 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'driverview.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "driverview.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'driverview.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_DriverViewScene_t { + QByteArrayData data[3]; + char stringdata0[30]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_DriverViewScene_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_DriverViewScene_t qt_meta_stringdata_DriverViewScene = { + { +QT_MOC_LITERAL(0, 0, 15), // "DriverViewScene" +QT_MOC_LITERAL(1, 16, 12), // "frameUpdated" +QT_MOC_LITERAL(2, 29, 0) // "" + + }, + "DriverViewScene\0frameUpdated\0" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_DriverViewScene[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a /* Public */, + + // slots: parameters + QMetaType::Void, + + 0 // eod +}; + +void DriverViewScene::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->frameUpdated(); break; + default: ; + } + } + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject DriverViewScene::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_DriverViewScene.data, + qt_meta_data_DriverViewScene, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *DriverViewScene::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *DriverViewScene::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_DriverViewScene.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int DriverViewScene::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} +struct qt_meta_stringdata_DriverViewWindow_t { + QByteArrayData data[3]; + char stringdata0[23]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_DriverViewWindow_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_DriverViewWindow_t qt_meta_stringdata_DriverViewWindow = { + { +QT_MOC_LITERAL(0, 0, 16), // "DriverViewWindow" +QT_MOC_LITERAL(1, 17, 4), // "done" +QT_MOC_LITERAL(2, 22, 0) // "" + + }, + "DriverViewWindow\0done\0" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_DriverViewWindow[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x06 /* Public */, + + // signals: parameters + QMetaType::Void, + + 0 // eod +}; + +void DriverViewWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->done(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (DriverViewWindow::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&DriverViewWindow::done)) { + *result = 0; + return; + } + } + } + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject DriverViewWindow::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_DriverViewWindow.data, + qt_meta_data_DriverViewWindow, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *DriverViewWindow::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *DriverViewWindow::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_DriverViewWindow.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int DriverViewWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} + +// SIGNAL 0 +void DriverViewWindow::done() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/offroad/moc_onboarding.cc b/selfdrive/ui/qt/offroad/moc_onboarding.cc new file mode 100644 index 000000000..8b2cb4157 --- /dev/null +++ b/selfdrive/ui/qt/offroad/moc_onboarding.cc @@ -0,0 +1,486 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'onboarding.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "onboarding.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'onboarding.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_TrainingGuide_t { + QByteArrayData data[3]; + char stringdata0[33]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_TrainingGuide_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_TrainingGuide_t qt_meta_stringdata_TrainingGuide = { + { +QT_MOC_LITERAL(0, 0, 13), // "TrainingGuide" +QT_MOC_LITERAL(1, 14, 17), // "completedTraining" +QT_MOC_LITERAL(2, 32, 0) // "" + + }, + "TrainingGuide\0completedTraining\0" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_TrainingGuide[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x06 /* Public */, + + // signals: parameters + QMetaType::Void, + + 0 // eod +}; + +void TrainingGuide::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->completedTraining(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (TrainingGuide::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&TrainingGuide::completedTraining)) { + *result = 0; + return; + } + } + } + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject TrainingGuide::staticMetaObject = { { + &QFrame::staticMetaObject, + qt_meta_stringdata_TrainingGuide.data, + qt_meta_data_TrainingGuide, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *TrainingGuide::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *TrainingGuide::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_TrainingGuide.stringdata0)) + return static_cast(this); + return QFrame::qt_metacast(_clname); +} + +int TrainingGuide::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QFrame::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} + +// SIGNAL 0 +void TrainingGuide::completedTraining() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} +struct qt_meta_stringdata_TermsPage_t { + QByteArrayData data[5]; + char stringdata0[52]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_TermsPage_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_TermsPage_t qt_meta_stringdata_TermsPage = { + { +QT_MOC_LITERAL(0, 0, 9), // "TermsPage" +QT_MOC_LITERAL(1, 10, 13), // "acceptedTerms" +QT_MOC_LITERAL(2, 24, 0), // "" +QT_MOC_LITERAL(3, 25, 13), // "declinedTerms" +QT_MOC_LITERAL(4, 39, 12) // "enableAccept" + + }, + "TermsPage\0acceptedTerms\0\0declinedTerms\0" + "enableAccept" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_TermsPage[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 3, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 2, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 29, 2, 0x06 /* Public */, + 3, 0, 30, 2, 0x06 /* Public */, + + // slots: name, argc, parameters, tag, flags + 4, 0, 31, 2, 0x0a /* Public */, + + // signals: parameters + QMetaType::Void, + QMetaType::Void, + + // slots: parameters + QMetaType::Void, + + 0 // eod +}; + +void TermsPage::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->acceptedTerms(); break; + case 1: _t->declinedTerms(); break; + case 2: _t->enableAccept(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (TermsPage::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&TermsPage::acceptedTerms)) { + *result = 0; + return; + } + } + { + using _t = void (TermsPage::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&TermsPage::declinedTerms)) { + *result = 1; + return; + } + } + } + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject TermsPage::staticMetaObject = { { + &QFrame::staticMetaObject, + qt_meta_stringdata_TermsPage.data, + qt_meta_data_TermsPage, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *TermsPage::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *TermsPage::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_TermsPage.stringdata0)) + return static_cast(this); + return QFrame::qt_metacast(_clname); +} + +int TermsPage::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QFrame::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 3) + qt_static_metacall(this, _c, _id, _a); + _id -= 3; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 3) + *reinterpret_cast(_a[0]) = -1; + _id -= 3; + } + return _id; +} + +// SIGNAL 0 +void TermsPage::acceptedTerms() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} + +// SIGNAL 1 +void TermsPage::declinedTerms() +{ + QMetaObject::activate(this, &staticMetaObject, 1, nullptr); +} +struct qt_meta_stringdata_DeclinePage_t { + QByteArrayData data[3]; + char stringdata0[21]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_DeclinePage_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_DeclinePage_t qt_meta_stringdata_DeclinePage = { + { +QT_MOC_LITERAL(0, 0, 11), // "DeclinePage" +QT_MOC_LITERAL(1, 12, 7), // "getBack" +QT_MOC_LITERAL(2, 20, 0) // "" + + }, + "DeclinePage\0getBack\0" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_DeclinePage[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x06 /* Public */, + + // signals: parameters + QMetaType::Void, + + 0 // eod +}; + +void DeclinePage::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->getBack(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (DeclinePage::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&DeclinePage::getBack)) { + *result = 0; + return; + } + } + } + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject DeclinePage::staticMetaObject = { { + &QFrame::staticMetaObject, + qt_meta_stringdata_DeclinePage.data, + qt_meta_data_DeclinePage, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *DeclinePage::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *DeclinePage::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_DeclinePage.stringdata0)) + return static_cast(this); + return QFrame::qt_metacast(_clname); +} + +int DeclinePage::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QFrame::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} + +// SIGNAL 0 +void DeclinePage::getBack() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} +struct qt_meta_stringdata_OnboardingWindow_t { + QByteArrayData data[3]; + char stringdata0[33]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_OnboardingWindow_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_OnboardingWindow_t qt_meta_stringdata_OnboardingWindow = { + { +QT_MOC_LITERAL(0, 0, 16), // "OnboardingWindow" +QT_MOC_LITERAL(1, 17, 14), // "onboardingDone" +QT_MOC_LITERAL(2, 32, 0) // "" + + }, + "OnboardingWindow\0onboardingDone\0" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_OnboardingWindow[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x06 /* Public */, + + // signals: parameters + QMetaType::Void, + + 0 // eod +}; + +void OnboardingWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->onboardingDone(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (OnboardingWindow::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&OnboardingWindow::onboardingDone)) { + *result = 0; + return; + } + } + } + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject OnboardingWindow::staticMetaObject = { { + &QStackedWidget::staticMetaObject, + qt_meta_stringdata_OnboardingWindow.data, + qt_meta_data_OnboardingWindow, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *OnboardingWindow::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *OnboardingWindow::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_OnboardingWindow.stringdata0)) + return static_cast(this); + return QStackedWidget::qt_metacast(_clname); +} + +int OnboardingWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QStackedWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} + +// SIGNAL 0 +void OnboardingWindow::onboardingDone() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/offroad/moc_settings.cc b/selfdrive/ui/qt/offroad/moc_settings.cc new file mode 100644 index 000000000..b32efc0e2 --- /dev/null +++ b/selfdrive/ui/qt/offroad/moc_settings.cc @@ -0,0 +1,522 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'settings.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "settings.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'settings.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_SettingsWindow_t { + QByteArrayData data[5]; + char stringdata0[65]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_SettingsWindow_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_SettingsWindow_t qt_meta_stringdata_SettingsWindow = { + { +QT_MOC_LITERAL(0, 0, 14), // "SettingsWindow" +QT_MOC_LITERAL(1, 15, 13), // "closeSettings" +QT_MOC_LITERAL(2, 29, 0), // "" +QT_MOC_LITERAL(3, 30, 19), // "reviewTrainingGuide" +QT_MOC_LITERAL(4, 50, 14) // "showDriverView" + + }, + "SettingsWindow\0closeSettings\0\0" + "reviewTrainingGuide\0showDriverView" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_SettingsWindow[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 3, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 3, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 29, 2, 0x06 /* Public */, + 3, 0, 30, 2, 0x06 /* Public */, + 4, 0, 31, 2, 0x06 /* Public */, + + // signals: parameters + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + + 0 // eod +}; + +void SettingsWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->closeSettings(); break; + case 1: _t->reviewTrainingGuide(); break; + case 2: _t->showDriverView(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (SettingsWindow::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&SettingsWindow::closeSettings)) { + *result = 0; + return; + } + } + { + using _t = void (SettingsWindow::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&SettingsWindow::reviewTrainingGuide)) { + *result = 1; + return; + } + } + { + using _t = void (SettingsWindow::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&SettingsWindow::showDriverView)) { + *result = 2; + return; + } + } + } + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject SettingsWindow::staticMetaObject = { { + &QFrame::staticMetaObject, + qt_meta_stringdata_SettingsWindow.data, + qt_meta_data_SettingsWindow, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *SettingsWindow::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *SettingsWindow::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_SettingsWindow.stringdata0)) + return static_cast(this); + return QFrame::qt_metacast(_clname); +} + +int SettingsWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QFrame::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 3) + qt_static_metacall(this, _c, _id, _a); + _id -= 3; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 3) + *reinterpret_cast(_a[0]) = -1; + _id -= 3; + } + return _id; +} + +// SIGNAL 0 +void SettingsWindow::closeSettings() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} + +// SIGNAL 1 +void SettingsWindow::reviewTrainingGuide() +{ + QMetaObject::activate(this, &staticMetaObject, 1, nullptr); +} + +// SIGNAL 2 +void SettingsWindow::showDriverView() +{ + QMetaObject::activate(this, &staticMetaObject, 2, nullptr); +} +struct qt_meta_stringdata_DevicePanel_t { + QByteArrayData data[7]; + char stringdata0[87]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_DevicePanel_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_DevicePanel_t qt_meta_stringdata_DevicePanel = { + { +QT_MOC_LITERAL(0, 0, 11), // "DevicePanel" +QT_MOC_LITERAL(1, 12, 19), // "reviewTrainingGuide" +QT_MOC_LITERAL(2, 32, 0), // "" +QT_MOC_LITERAL(3, 33, 14), // "showDriverView" +QT_MOC_LITERAL(4, 48, 8), // "poweroff" +QT_MOC_LITERAL(5, 57, 6), // "reboot" +QT_MOC_LITERAL(6, 64, 22) // "updateCalibDescription" + + }, + "DevicePanel\0reviewTrainingGuide\0\0" + "showDriverView\0poweroff\0reboot\0" + "updateCalibDescription" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_DevicePanel[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 5, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 2, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 39, 2, 0x06 /* Public */, + 3, 0, 40, 2, 0x06 /* Public */, + + // slots: name, argc, parameters, tag, flags + 4, 0, 41, 2, 0x08 /* Private */, + 5, 0, 42, 2, 0x08 /* Private */, + 6, 0, 43, 2, 0x08 /* Private */, + + // signals: parameters + QMetaType::Void, + QMetaType::Void, + + // slots: parameters + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + + 0 // eod +}; + +void DevicePanel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->reviewTrainingGuide(); break; + case 1: _t->showDriverView(); break; + case 2: _t->poweroff(); break; + case 3: _t->reboot(); break; + case 4: _t->updateCalibDescription(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (DevicePanel::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&DevicePanel::reviewTrainingGuide)) { + *result = 0; + return; + } + } + { + using _t = void (DevicePanel::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&DevicePanel::showDriverView)) { + *result = 1; + return; + } + } + } + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject DevicePanel::staticMetaObject = { { + &ListWidget::staticMetaObject, + qt_meta_stringdata_DevicePanel.data, + qt_meta_data_DevicePanel, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *DevicePanel::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *DevicePanel::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_DevicePanel.stringdata0)) + return static_cast(this); + return ListWidget::qt_metacast(_clname); +} + +int DevicePanel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = ListWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 5) + qt_static_metacall(this, _c, _id, _a); + _id -= 5; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 5) + *reinterpret_cast(_a[0]) = -1; + _id -= 5; + } + return _id; +} + +// SIGNAL 0 +void DevicePanel::reviewTrainingGuide() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} + +// SIGNAL 1 +void DevicePanel::showDriverView() +{ + QMetaObject::activate(this, &staticMetaObject, 1, nullptr); +} +struct qt_meta_stringdata_TogglesPanel_t { + QByteArrayData data[1]; + char stringdata0[13]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_TogglesPanel_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_TogglesPanel_t qt_meta_stringdata_TogglesPanel = { + { +QT_MOC_LITERAL(0, 0, 12) // "TogglesPanel" + + }, + "TogglesPanel" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_TogglesPanel[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void TogglesPanel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject TogglesPanel::staticMetaObject = { { + &ListWidget::staticMetaObject, + qt_meta_stringdata_TogglesPanel.data, + qt_meta_data_TogglesPanel, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *TogglesPanel::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *TogglesPanel::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_TogglesPanel.stringdata0)) + return static_cast(this); + return ListWidget::qt_metacast(_clname); +} + +int TogglesPanel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = ListWidget::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_SoftwarePanel_t { + QByteArrayData data[1]; + char stringdata0[14]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_SoftwarePanel_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_SoftwarePanel_t qt_meta_stringdata_SoftwarePanel = { + { +QT_MOC_LITERAL(0, 0, 13) // "SoftwarePanel" + + }, + "SoftwarePanel" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_SoftwarePanel[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void SoftwarePanel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject SoftwarePanel::staticMetaObject = { { + &ListWidget::staticMetaObject, + qt_meta_stringdata_SoftwarePanel.data, + qt_meta_data_SoftwarePanel, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *SoftwarePanel::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *SoftwarePanel::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_SoftwarePanel.stringdata0)) + return static_cast(this); + return ListWidget::qt_metacast(_clname); +} + +int SoftwarePanel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = ListWidget::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_C2NetworkPanel_t { + QByteArrayData data[1]; + char stringdata0[15]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_C2NetworkPanel_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_C2NetworkPanel_t qt_meta_stringdata_C2NetworkPanel = { + { +QT_MOC_LITERAL(0, 0, 14) // "C2NetworkPanel" + + }, + "C2NetworkPanel" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_C2NetworkPanel[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void C2NetworkPanel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject C2NetworkPanel::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_C2NetworkPanel.data, + qt_meta_data_C2NetworkPanel, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *C2NetworkPanel::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *C2NetworkPanel::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_C2NetworkPanel.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int C2NetworkPanel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/offroad/networking.cc b/selfdrive/ui/qt/offroad/networking.cc new file mode 100644 index 000000000..9c2088b1d --- /dev/null +++ b/selfdrive/ui/qt/offroad/networking.cc @@ -0,0 +1,330 @@ +#include "selfdrive/ui/qt/offroad/networking.h" + +#include + +#include +#include +#include +#include +#include + +#include "selfdrive/ui/qt/util.h" +#include "selfdrive/ui/qt/qt_window.h" +#include "selfdrive/ui/qt/widgets/controls.h" +#include "selfdrive/ui/qt/widgets/scrollview.h" + + +// Networking functions + +Networking::Networking(QWidget* parent, bool show_advanced) : QFrame(parent) { + main_layout = new QStackedLayout(this); + + wifi = new WifiManager(this); + connect(wifi, &WifiManager::refreshSignal, this, &Networking::refresh); + connect(wifi, &WifiManager::wrongPassword, this, &Networking::wrongPassword); + + wifiScreen = new QWidget(this); + QVBoxLayout* vlayout = new QVBoxLayout(wifiScreen); + vlayout->setContentsMargins(20, 20, 20, 20); + if (show_advanced) { + QPushButton* advancedSettings = new QPushButton("Advanced"); + advancedSettings->setObjectName("advancedBtn"); + advancedSettings->setStyleSheet("margin-right: 30px;"); + advancedSettings->setFixedSize(350, 100); + connect(advancedSettings, &QPushButton::clicked, [=]() { main_layout->setCurrentWidget(an); }); + vlayout->addSpacing(10); + vlayout->addWidget(advancedSettings, 0, Qt::AlignRight); + vlayout->addSpacing(10); + } + + wifiWidget = new WifiUI(this, wifi); + wifiWidget->setObjectName("wifiWidget"); + connect(wifiWidget, &WifiUI::connectToNetwork, this, &Networking::connectToNetwork); + + ScrollView *wifiScroller = new ScrollView(wifiWidget, this); + wifiScroller->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + vlayout->addWidget(wifiScroller, 1); + main_layout->addWidget(wifiScreen); + + an = new AdvancedNetworking(this, wifi); + connect(an, &AdvancedNetworking::backPress, [=]() { main_layout->setCurrentWidget(wifiScreen); }); + main_layout->addWidget(an); + + QPalette pal = palette(); + pal.setColor(QPalette::Window, QColor(0x29, 0x29, 0x29)); + setAutoFillBackground(true); + setPalette(pal); + + // TODO: revisit pressed colors + setStyleSheet(R"( + #wifiWidget > QPushButton, #back_btn, #advancedBtn { + font-size: 50px; + margin: 0px; + padding: 15px; + border-width: 0; + border-radius: 30px; + color: #dddddd; + background-color: #444444; + } + )"); + main_layout->setCurrentWidget(wifiScreen); +} + +void Networking::refresh() { + wifiWidget->refresh(); + an->refresh(); +} + +void Networking::connectToNetwork(const Network &n) { + if (wifi->isKnownConnection(n.ssid)) { + wifi->activateWifiConnection(n.ssid); + wifiWidget->refresh(); + } else if (n.security_type == SecurityType::OPEN) { + wifi->connect(n); + } else if (n.security_type == SecurityType::WPA) { + QString pass = InputDialog::getText("Enter password", this, "for \"" + n.ssid + "\"", true, 8); + if (!pass.isEmpty()) { + wifi->connect(n, pass); + } + } +} + +void Networking::wrongPassword(const QString &ssid) { + if (wifi->seenNetworks.contains(ssid)) { + const Network &n = wifi->seenNetworks.value(ssid); + QString pass = InputDialog::getText("Wrong password", this, "for \"" + n.ssid +"\"", true, 8); + if (!pass.isEmpty()) { + wifi->connect(n, pass); + } + } +} + +void Networking::showEvent(QShowEvent *event) { + wifi->start(); +} + +void Networking::hideEvent(QHideEvent *event) { + wifi->stop(); +} + +// AdvancedNetworking functions + +AdvancedNetworking::AdvancedNetworking(QWidget* parent, WifiManager* wifi): QWidget(parent), wifi(wifi) { + + QVBoxLayout* main_layout = new QVBoxLayout(this); + main_layout->setMargin(40); + main_layout->setSpacing(20); + + // Back button + QPushButton* back = new QPushButton("Back"); + back->setObjectName("back_btn"); + back->setFixedSize(500, 100); + connect(back, &QPushButton::clicked, [=]() { emit backPress(); }); + main_layout->addWidget(back, 0, Qt::AlignLeft); + + ListWidget *list = new ListWidget(this); + // Enable tethering layout + tetheringToggle = new ToggleControl("Enable Tethering", "", "", wifi->isTetheringEnabled()); + list->addItem(tetheringToggle); + QObject::connect(tetheringToggle, &ToggleControl::toggleFlipped, this, &AdvancedNetworking::toggleTethering); + + // Change tethering password + ButtonControl *editPasswordButton = new ButtonControl("Tethering Password", "EDIT"); + connect(editPasswordButton, &ButtonControl::clicked, [=]() { + QString pass = InputDialog::getText("Enter new tethering password", this, "", true, 8, wifi->getTetheringPassword()); + if (!pass.isEmpty()) { + wifi->changeTetheringPassword(pass); + } + }); + list->addItem(editPasswordButton); + + // IP address + ipLabel = new LabelControl("IP Address", wifi->ipv4_address); + list->addItem(ipLabel); + + // SSH keys + list->addItem(new SshToggle()); + list->addItem(new SshControl()); + + // Roaming toggle + const bool roamingEnabled = params.getBool("GsmRoaming"); + ToggleControl *roamingToggle = new ToggleControl("Enable Roaming", "", "", roamingEnabled); + QObject::connect(roamingToggle, &SshToggle::toggleFlipped, [=](bool state) { + params.putBool("GsmRoaming", state); + wifi->updateGsmSettings(state, QString::fromStdString(params.get("GsmApn"))); + }); + list->addItem(roamingToggle); + + // APN settings + ButtonControl *editApnButton = new ButtonControl("APN Setting", "EDIT"); + connect(editApnButton, &ButtonControl::clicked, [=]() { + const bool roamingEnabled = params.getBool("GsmRoaming"); + const QString cur_apn = QString::fromStdString(params.get("GsmApn")); + QString apn = InputDialog::getText("Enter APN", this, "leave blank for automatic configuration", false, -1, cur_apn).trimmed(); + + if (apn.isEmpty()) { + params.remove("GsmApn"); + } else { + params.put("GsmApn", apn.toStdString()); + } + wifi->updateGsmSettings(roamingEnabled, apn); + }); + list->addItem(editApnButton); + + // Set initial config + wifi->updateGsmSettings(roamingEnabled, QString::fromStdString(params.get("GsmApn"))); + + main_layout->addWidget(new ScrollView(list, this)); + main_layout->addStretch(1); +} + +void AdvancedNetworking::refresh() { + ipLabel->setText(wifi->ipv4_address); + tetheringToggle->setEnabled(true); + update(); +} + +void AdvancedNetworking::toggleTethering(bool enabled) { + wifi->setTetheringEnabled(enabled); + tetheringToggle->setEnabled(false); +} + +// WifiUI functions + +WifiUI::WifiUI(QWidget *parent, WifiManager* wifi) : QWidget(parent), wifi(wifi) { + main_layout = new QVBoxLayout(this); + main_layout->setContentsMargins(0, 0, 0, 0); + main_layout->setSpacing(0); + + // load imgs + for (const auto &s : {"low", "medium", "high", "full"}) { + QPixmap pix(ASSET_PATH + "/offroad/icon_wifi_strength_" + s + ".svg"); + strengths.push_back(pix.scaledToHeight(68, Qt::SmoothTransformation)); + } + lock = QPixmap(ASSET_PATH + "offroad/icon_lock_closed.svg").scaledToWidth(49, Qt::SmoothTransformation); + checkmark = QPixmap(ASSET_PATH + "offroad/icon_checkmark.svg").scaledToWidth(49, Qt::SmoothTransformation); + circled_slash = QPixmap(ASSET_PATH + "img_circled_slash.svg").scaledToWidth(49, Qt::SmoothTransformation); + + QLabel *scanning = new QLabel("Scanning for networks..."); + scanning->setStyleSheet("font-size: 65px;"); + main_layout->addWidget(scanning, 0, Qt::AlignCenter); + + setStyleSheet(R"( + QScrollBar::handle:vertical { + min-height: 0px; + border-radius: 4px; + background-color: #8A8A8A; + } + #forgetBtn { + font-size: 32px; + font-weight: 600; + color: #292929; + background-color: #BDBDBD; + border-width: 1px solid #828282; + border-radius: 5px; + padding: 40px; + padding-bottom: 16px; + padding-top: 16px; + } + #connecting { + font-size: 32px; + font-weight: 600; + color: white; + border-radius: 0; + padding: 27px; + padding-left: 43px; + padding-right: 43px; + background-color: black; + } + #ssidLabel { + font-size: 55px; + font-weight: 300; + text-align: left; + border: none; + padding-top: 50px; + padding-bottom: 50px; + } + #ssidLabel[disconnected=false] { + font-weight: 500; + } + #ssidLabel:disabled { + color: #696969; + } + )"); +} + +void WifiUI::refresh() { + // TODO: don't rebuild this every time + clearLayout(main_layout); + + if (wifi->seenNetworks.size() == 0) { + QLabel *scanning = new QLabel("Scanning for networks..."); + scanning->setStyleSheet("font-size: 65px;"); + main_layout->addWidget(scanning, 0, Qt::AlignCenter); + return; + } + QList sortedNetworks = wifi->seenNetworks.values(); + std::sort(sortedNetworks.begin(), sortedNetworks.end(), compare_by_strength); + + // add networks + ListWidget *list = new ListWidget(this); + for (Network &network : sortedNetworks) { + QHBoxLayout *hlayout = new QHBoxLayout; + hlayout->setContentsMargins(44, 0, 73, 0); + hlayout->setSpacing(50); + + // Clickable SSID label + ElidedLabel *ssidLabel = new ElidedLabel(network.ssid); + ssidLabel->setObjectName("ssidLabel"); + ssidLabel->setEnabled(network.security_type != SecurityType::UNSUPPORTED); + ssidLabel->setProperty("disconnected", network.connected == ConnectedType::DISCONNECTED); + if (network.connected == ConnectedType::DISCONNECTED) { + QObject::connect(ssidLabel, &ElidedLabel::clicked, this, [=]() { emit connectToNetwork(network); }); + } + hlayout->addWidget(ssidLabel, network.connected == ConnectedType::CONNECTING ? 0 : 1); + + if (network.connected == ConnectedType::CONNECTING) { + QPushButton *connecting = new QPushButton("CONNECTING..."); + connecting->setObjectName("connecting"); + hlayout->addWidget(connecting, 2, Qt::AlignLeft); + } + + // Forget button + if (wifi->isKnownConnection(network.ssid) && !wifi->isTetheringEnabled()) { + QPushButton *forgetBtn = new QPushButton("FORGET"); + forgetBtn->setObjectName("forgetBtn"); + QObject::connect(forgetBtn, &QPushButton::clicked, [=]() { + if (ConfirmationDialog::confirm("Forget Wi-Fi Network \"" + QString::fromUtf8(network.ssid) + "\"?", this)) { + wifi->forgetConnection(network.ssid); + } + }); + hlayout->addWidget(forgetBtn, 0, Qt::AlignRight); + } + + // Status icon + if (network.connected == ConnectedType::CONNECTED) { + QLabel *connectIcon = new QLabel(); + connectIcon->setPixmap(checkmark); + hlayout->addWidget(connectIcon, 0, Qt::AlignRight); + } else if (network.security_type == SecurityType::UNSUPPORTED) { + QLabel *unsupportedIcon = new QLabel(); + unsupportedIcon->setPixmap(circled_slash); + hlayout->addWidget(unsupportedIcon, 0, Qt::AlignRight); + } else if (network.security_type == SecurityType::WPA) { + QLabel *lockIcon = new QLabel(); + lockIcon->setPixmap(lock); + hlayout->addWidget(lockIcon, 0, Qt::AlignRight); + } else { + hlayout->addSpacing(lock.width() + hlayout->spacing()); + } + + // Strength indicator + QLabel *strength = new QLabel(); + strength->setPixmap(strengths[std::clamp((int)round(network.strength / 33.), 0, 3)]); + hlayout->addWidget(strength, 0, Qt::AlignRight); + + list->addItem(hlayout); + } + main_layout->addWidget(list); + main_layout->addStretch(1); +} diff --git a/selfdrive/ui/qt/offroad/networking.h b/selfdrive/ui/qt/offroad/networking.h new file mode 100644 index 000000000..e78d65ef0 --- /dev/null +++ b/selfdrive/ui/qt/offroad/networking.h @@ -0,0 +1,76 @@ +#pragma once + +#include +#include +#include + +#include "selfdrive/ui/qt/offroad/wifiManager.h" +#include "selfdrive/ui/qt/widgets/input.h" +#include "selfdrive/ui/qt/widgets/ssh_keys.h" +#include "selfdrive/ui/qt/widgets/toggle.h" + +class WifiUI : public QWidget { + Q_OBJECT + +public: + explicit WifiUI(QWidget *parent = 0, WifiManager* wifi = 0); + +private: + WifiManager *wifi = nullptr; + QVBoxLayout* main_layout; + QPixmap lock; + QPixmap checkmark; + QPixmap circled_slash; + QVector strengths; + +signals: + void connectToNetwork(const Network &n); + +public slots: + void refresh(); +}; + +class AdvancedNetworking : public QWidget { + Q_OBJECT +public: + explicit AdvancedNetworking(QWidget* parent = 0, WifiManager* wifi = 0); + +private: + LabelControl* ipLabel; + ToggleControl* tetheringToggle; + WifiManager* wifi = nullptr; + Params params; + +signals: + void backPress(); + +public slots: + void toggleTethering(bool enabled); + void refresh(); +}; + +class Networking : public QFrame { + Q_OBJECT + +public: + explicit Networking(QWidget* parent = 0, bool show_advanced = true); + WifiManager* wifi = nullptr; + +private: + QStackedLayout* main_layout = nullptr; + QWidget* wifiScreen = nullptr; + AdvancedNetworking* an = nullptr; + + WifiUI* wifiWidget; + +protected: + void showEvent(QShowEvent* event) override; + void hideEvent(QHideEvent* event) override; + +public slots: + void refresh(); + +private slots: + void connectToNetwork(const Network &n); + void wrongPassword(const QString &ssid); +}; diff --git a/selfdrive/ui/qt/offroad/networkmanager.h b/selfdrive/ui/qt/offroad/networkmanager.h new file mode 100644 index 000000000..52d85c16a --- /dev/null +++ b/selfdrive/ui/qt/offroad/networkmanager.h @@ -0,0 +1,38 @@ +/** + * We are using a NetworkManager DBUS API : https://developer.gnome.org/NetworkManager/1.26/spec.html + * */ + +// https://developer.gnome.org/NetworkManager/1.26/nm-dbus-types.html#NM80211ApFlags +const int NM_802_11_AP_FLAGS_NONE = 0x00000000; +const int NM_802_11_AP_FLAGS_PRIVACY = 0x00000001; +const int NM_802_11_AP_FLAGS_WPS = 0x00000002; + +// https://developer.gnome.org/NetworkManager/1.26/nm-dbus-types.html#NM80211ApSecurityFlags +const int NM_802_11_AP_SEC_PAIR_WEP40 = 0x00000001; +const int NM_802_11_AP_SEC_PAIR_WEP104 = 0x00000002; +const int NM_802_11_AP_SEC_GROUP_WEP40 = 0x00000010; +const int NM_802_11_AP_SEC_GROUP_WEP104 = 0x00000020; +const int NM_802_11_AP_SEC_KEY_MGMT_PSK = 0x00000100; +const int NM_802_11_AP_SEC_KEY_MGMT_802_1X = 0x00000200; + +const QString NM_DBUS_PATH = "/org/freedesktop/NetworkManager"; +const QString NM_DBUS_PATH_SETTINGS = "/org/freedesktop/NetworkManager/Settings"; + +const QString NM_DBUS_INTERFACE = "org.freedesktop.NetworkManager"; +const QString NM_DBUS_INTERFACE_PROPERTIES = "org.freedesktop.DBus.Properties"; +const QString NM_DBUS_INTERFACE_SETTINGS = "org.freedesktop.NetworkManager.Settings"; +const QString NM_DBUS_INTERFACE_SETTINGS_CONNECTION = "org.freedesktop.NetworkManager.Settings.Connection"; +const QString NM_DBUS_INTERFACE_DEVICE = "org.freedesktop.NetworkManager.Device"; +const QString NM_DBUS_INTERFACE_DEVICE_WIRELESS = "org.freedesktop.NetworkManager.Device.Wireless"; +const QString NM_DBUS_INTERFACE_ACCESS_POINT = "org.freedesktop.NetworkManager.AccessPoint"; +const QString NM_DBUS_INTERFACE_ACTIVE_CONNECTION = "org.freedesktop.NetworkManager.Connection.Active"; +const QString NM_DBUS_INTERFACE_IP4_CONFIG = "org.freedesktop.NetworkManager.IP4Config"; + +const QString NM_DBUS_SERVICE = "org.freedesktop.NetworkManager"; + +const int NM_DEVICE_STATE_ACTIVATED = 100; +const int NM_DEVICE_STATE_NEED_AUTH = 60; +const int NM_DEVICE_TYPE_WIFI = 2; +const int NM_DEVICE_TYPE_MODEM = 8; +const int NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT = 8; +const int DBUS_TIMEOUT = 100; diff --git a/selfdrive/ui/qt/offroad/onboarding.cc b/selfdrive/ui/qt/offroad/onboarding.cc new file mode 100644 index 000000000..458464239 --- /dev/null +++ b/selfdrive/ui/qt/offroad/onboarding.cc @@ -0,0 +1,213 @@ +#include "selfdrive/ui/qt/offroad/onboarding.h" + +#include +#include +#include +#include +#include + +#include "selfdrive/common/util.h" +#include "selfdrive/common/params.h" +#include "selfdrive/ui/qt/util.h" +#include "selfdrive/ui/qt/widgets/input.h" + +TrainingGuide::TrainingGuide(QWidget *parent) : QFrame(parent) { + setAttribute(Qt::WA_OpaquePaintEvent); +} + +void TrainingGuide::mouseReleaseEvent(QMouseEvent *e) { + if (click_timer.elapsed() < 250) { + return; + } + click_timer.restart(); + + if (boundingRect[currentIndex].contains(e->x(), e->y())) { + if (currentIndex == 9) { + const QRect yes = QRect(692, 842, 492, 148); + Params().putBool("RecordFront", yes.contains(e->x(), e->y())); + } + currentIndex += 1; + } else if (currentIndex == (boundingRect.size() - 2) && boundingRect.last().contains(e->x(), e->y())) { + currentIndex = 0; + } + + if (currentIndex >= (boundingRect.size() - 1)) { + emit completedTraining(); + } else { + image.load(img_path + "step" + QString::number(currentIndex) + ".png"); + update(); + } +} + +void TrainingGuide::showEvent(QShowEvent *event) { + img_path = width() == WIDE_WIDTH ? "../assets/training_wide/" : "../assets/training/"; + boundingRect = width() == WIDE_WIDTH ? boundingRectWide : boundingRectStandard; + + currentIndex = 0; + image.load(img_path + "step0.png"); + click_timer.start(); +} + +void TrainingGuide::paintEvent(QPaintEvent *event) { + QPainter painter(this); + + QRect bg(0, 0, painter.device()->width(), painter.device()->height()); + painter.fillRect(bg, QColor("#000000")); + + QRect rect(image.rect()); + rect.moveCenter(bg.center()); + painter.drawImage(rect.topLeft(), image); + + // progress bar + if (currentIndex > 0 && currentIndex < (boundingRect.size() - 2)) { + const int h = 20; + const int w = (currentIndex / (float)(boundingRect.size() - 2)) * width(); + painter.fillRect(QRect(0, height() - h, w, h), QColor("#465BEA")); + } +} + +void TermsPage::showEvent(QShowEvent *event) { + // late init, building QML widget takes 200ms + if (layout()) { + return; + } + + QVBoxLayout *main_layout = new QVBoxLayout(this); + main_layout->setContentsMargins(45, 35, 45, 45); + main_layout->setSpacing(0); + + QLabel *title = new QLabel("Terms & Conditions"); + title->setStyleSheet("font-size: 90px; font-weight: 600;"); + main_layout->addWidget(title); + + main_layout->addSpacing(30); + + QQuickWidget *text = new QQuickWidget(this); + text->setResizeMode(QQuickWidget::SizeRootObjectToView); + text->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + text->setAttribute(Qt::WA_AlwaysStackOnTop); + text->setClearColor(QColor("#1B1B1B")); + + QString text_view = util::read_file("../assets/offroad/tc.html").c_str(); + text->rootContext()->setContextProperty("text_view", text_view); + + text->setSource(QUrl::fromLocalFile("qt/offroad/text_view.qml")); + + main_layout->addWidget(text, 1); + main_layout->addSpacing(50); + + QObject *obj = (QObject*)text->rootObject(); + QObject::connect(obj, SIGNAL(scroll()), SLOT(enableAccept())); + + QHBoxLayout* buttons = new QHBoxLayout; + buttons->setMargin(0); + buttons->setSpacing(45); + main_layout->addLayout(buttons); + + QPushButton *decline_btn = new QPushButton("Decline"); + buttons->addWidget(decline_btn); + QObject::connect(decline_btn, &QPushButton::clicked, this, &TermsPage::declinedTerms); + + accept_btn = new QPushButton("Scroll to accept"); + accept_btn->setEnabled(false); + accept_btn->setStyleSheet(R"( + QPushButton { + background-color: #465BEA; + } + QPushButton:disabled { + background-color: #4F4F4F; + } + )"); + buttons->addWidget(accept_btn); + QObject::connect(accept_btn, &QPushButton::clicked, this, &TermsPage::acceptedTerms); +} + +void TermsPage::enableAccept() { + accept_btn->setText("Agree"); + accept_btn->setEnabled(true); +} + +void DeclinePage::showEvent(QShowEvent *event) { + if (layout()) { + return; + } + + QVBoxLayout *main_layout = new QVBoxLayout(this); + main_layout->setMargin(45); + main_layout->setSpacing(40); + + QLabel *text = new QLabel(this); + text->setText("You must accept the Terms and Conditions in order to use openpilot."); + text->setStyleSheet(R"(font-size: 80px; font-weight: 300; margin: 200px;)"); + text->setWordWrap(true); + main_layout->addWidget(text, 0, Qt::AlignCenter); + + QHBoxLayout* buttons = new QHBoxLayout; + buttons->setSpacing(45); + main_layout->addLayout(buttons); + + QPushButton *back_btn = new QPushButton("Back"); + buttons->addWidget(back_btn); + + QObject::connect(back_btn, &QPushButton::clicked, this, &DeclinePage::getBack); + + QPushButton *uninstall_btn = new QPushButton(QString("Decline, uninstall %1").arg(getBrand())); + uninstall_btn->setStyleSheet("background-color: #B73D3D"); + buttons->addWidget(uninstall_btn); + QObject::connect(uninstall_btn, &QPushButton::clicked, [=]() { + Params().putBool("DoUninstall", true); + }); +} + +void OnboardingWindow::updateActiveScreen() { + if (!accepted_terms) { + setCurrentIndex(0); + } else if (!training_done && !params.getBool("Passive")) { + setCurrentIndex(1); + } else { + emit onboardingDone(); + } +} + +OnboardingWindow::OnboardingWindow(QWidget *parent) : QStackedWidget(parent) { + std::string current_terms_version = params.get("TermsVersion"); + std::string current_training_version = params.get("TrainingVersion"); + accepted_terms = params.get("HasAcceptedTerms") == current_terms_version; + training_done = params.get("CompletedTrainingVersion") == current_training_version; + + TermsPage* terms = new TermsPage(this); + addWidget(terms); + connect(terms, &TermsPage::acceptedTerms, [=]() { + Params().put("HasAcceptedTerms", current_terms_version); + accepted_terms = true; + updateActiveScreen(); + }); + connect(terms, &TermsPage::declinedTerms, [=]() { setCurrentIndex(2); }); + + TrainingGuide* tr = new TrainingGuide(this); + addWidget(tr); + connect(tr, &TrainingGuide::completedTraining, [=]() { + training_done = true; + Params().put("CompletedTrainingVersion", current_training_version); + updateActiveScreen(); + }); + + DeclinePage* declinePage = new DeclinePage(this); + addWidget(declinePage); + connect(declinePage, &DeclinePage::getBack, [=]() { updateActiveScreen(); }); + + setStyleSheet(R"( + * { + color: white; + background-color: black; + } + QPushButton { + height: 160px; + font-size: 55px; + font-weight: 400; + border-radius: 10px; + background-color: #4F4F4F; + } + )"); + updateActiveScreen(); +} diff --git a/selfdrive/ui/qt/offroad/onboarding.h b/selfdrive/ui/qt/offroad/onboarding.h new file mode 100644 index 000000000..9424c07d1 --- /dev/null +++ b/selfdrive/ui/qt/offroad/onboarding.h @@ -0,0 +1,133 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "selfdrive/common/params.h" +#include "selfdrive/ui/qt/qt_window.h" + +class TrainingGuide : public QFrame { + Q_OBJECT + +public: + explicit TrainingGuide(QWidget *parent = 0); + +private: + void showEvent(QShowEvent *event) override; + void paintEvent(QPaintEvent *event) override; + void mouseReleaseEvent(QMouseEvent* e) override; + + QImage image; + int currentIndex = 0; + + // Bounding boxes for each training guide step + const QRect continueBtnStandard = {1610, 0, 310, 1080}; + QVector boundingRectStandard { + QRect(650, 710, 720, 190), + continueBtnStandard, + continueBtnStandard, + QRect(1442, 565, 230, 310), + QRect(1515, 562, 133, 60), + continueBtnStandard, + QRect(1580, 630, 215, 130), + QRect(1210, 0, 485, 590), + QRect(1460, 400, 375, 210), + QRect(166, 842, 1019, 148), + QRect(1460, 210, 300, 310), + continueBtnStandard, + QRect(1375, 80, 545, 1000), + continueBtnStandard, + QRect(1610, 130, 280, 800), + QRect(1385, 485, 400, 270), + continueBtnStandard, + continueBtnStandard, + QRect(1036, 769, 718, 189), + QRect(201, 769, 718, 189), + }; + + const QRect continueBtnWide = {1850, 0, 310, 1080}; + QVector boundingRectWide { + QRect(654, 721, 718, 189), + continueBtnWide, + continueBtnWide, + QRect(1690, 570, 165, 300), + QRect(1690, 560, 133, 60), + continueBtnWide, + QRect(1820, 630, 180, 155), + QRect(1360, 0, 460, 620), + QRect(1570, 400, 375, 215), + QRect(167, 842, 1018, 148), + QRect(1610, 210, 295, 310), + continueBtnWide, + QRect(1555, 90, 610, 990), + continueBtnWide, + QRect(1600, 140, 280, 790), + QRect(1385, 490, 750, 270), + continueBtnWide, + continueBtnWide, + QRect(1138, 755, 718, 189), + QRect(303, 755, 718, 189), + }; + + QString img_path; + QVector boundingRect; + QElapsedTimer click_timer; + +signals: + void completedTraining(); +}; + + +class TermsPage : public QFrame { + Q_OBJECT + +public: + explicit TermsPage(QWidget *parent = 0) : QFrame(parent) {}; + +public slots: + void enableAccept(); + +private: + void showEvent(QShowEvent *event) override; + + QPushButton *accept_btn; + +signals: + void acceptedTerms(); + void declinedTerms(); +}; + +class DeclinePage : public QFrame { + Q_OBJECT + +public: + explicit DeclinePage(QWidget *parent = 0) : QFrame(parent) {}; + +private: + void showEvent(QShowEvent *event) override; + +signals: + void getBack(); +}; + +class OnboardingWindow : public QStackedWidget { + Q_OBJECT + +public: + explicit OnboardingWindow(QWidget *parent = 0); + inline void showTrainingGuide() { setCurrentIndex(1); } + inline bool completed() const { return accepted_terms && training_done; } + +private: + void updateActiveScreen(); + + Params params; + bool accepted_terms = false, training_done = false; + +signals: + void onboardingDone(); +}; diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc new file mode 100644 index 000000000..c2d88a1e5 --- /dev/null +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -0,0 +1,474 @@ +#include "selfdrive/ui/qt/offroad/settings.h" + +#include +#include +#include + +#include + +#ifndef QCOM +#include "selfdrive/ui/qt/offroad/networking.h" +#endif + +#ifdef ENABLE_MAPS +#include "selfdrive/ui/qt/maps/map_settings.h" +#endif + +#include "selfdrive/common/params.h" +#include "selfdrive/common/util.h" +#include "selfdrive/hardware/hw.h" +#include "selfdrive/ui/qt/widgets/controls.h" +#include "selfdrive/ui/qt/widgets/input.h" +#include "selfdrive/ui/qt/widgets/scrollview.h" +#include "selfdrive/ui/qt/widgets/ssh_keys.h" +#include "selfdrive/ui/qt/widgets/toggle.h" +#include "selfdrive/ui/ui.h" +#include "selfdrive/ui/qt/util.h" +#include "selfdrive/ui/qt/qt_window.h" +#include "selfdrive/car/modules/qt/tcontrols.hpp" +#include "selfdrive/car/modules/qt/tsettings.hpp" + +TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) { + // param, title, desc, icon + std::vector> toggles{ + { + "OpenpilotEnabledToggle", + "Enable openpilot", + "Use the openpilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature. Changing this setting takes effect when the car is powered off.", + "../assets/offroad/icon_openpilot.png", + }, + { + "IsLdwEnabled", + "Enable Lane Departure Warnings", + "Receive alerts to steer back into the lane when your vehicle drifts over a detected lane line without a turn signal activated while driving over 31 mph (50 km/h).", + "../assets/offroad/icon_warning.png", + }, + { + "IsRHD", + "Enable Right-Hand Drive", + "Allow openpilot to obey left-hand traffic conventions and perform driver monitoring on right driver seat.", + "../assets/offroad/icon_openpilot_mirrored.png", + }, + { + "IsMetric", + "Use Metric System", + "Display speed in km/h instead of mph.", + "../assets/offroad/icon_metric.png", + }, + { + "RecordFront", + "Record and Upload Driver Camera", + "Upload data from the driver facing camera and help improve the driver monitoring algorithm.", + "../assets/offroad/icon_monitoring.png", + }, + { + "EndToEndToggle", + "\U0001f96c Disable use of lanelines (Alpha) \U0001f96c", + "In this mode openpilot will ignore lanelines and just drive how it thinks a human would.", + "../assets/offroad/icon_road.png", + }, +#ifdef ENABLE_MAPS + { + "NavSettingTime24h", + "Show ETA in 24h format", + "Use 24h format instead of am/pm", + "../assets/offroad/icon_metric.png", + }, +#endif + + }; + + Params params; + + if (params.getBool("DisableRadar_Allow")) { + toggles.push_back({ + "DisableRadar", + "openpilot Longitudinal Control", + "openpilot will disable the car's radar and will take over control of gas and brakes. Warning: this disables AEB!", + "../assets/offroad/icon_speed_limit.png", + }); + } + + for (auto &[param, title, desc, icon] : toggles) { + auto toggle = new ParamControl(param, title, desc, icon, this); + bool locked = params.getBool((param + "Lock").toStdString()); + toggle->setEnabled(!locked); + if (!locked) { + connect(uiState(), &UIState::offroadTransition, toggle, &ParamControl::setEnabled); + } + addItem(toggle); + } +} + +DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) { + setSpacing(50); + addItem(new LabelControl("Dongle ID", getDongleId().value_or("N/A"))); + addItem(new LabelControl("Serial", params.get("HardwareSerial").c_str())); + + // offroad-only buttons + + auto dcamBtn = new ButtonControl("Driver Camera", "PREVIEW", + "Preview the driver facing camera to help optimize device mounting position for best driver monitoring experience. (vehicle must be off)"); + connect(dcamBtn, &ButtonControl::clicked, [=]() { emit showDriverView(); }); + addItem(dcamBtn); + + auto resetCalibBtn = new ButtonControl("Reset Calibration", "RESET", " "); + connect(resetCalibBtn, &ButtonControl::showDescription, this, &DevicePanel::updateCalibDescription); + connect(resetCalibBtn, &ButtonControl::clicked, [&]() { + if (ConfirmationDialog::confirm("Are you sure you want to reset calibration?", this)) { + params.remove("CalibrationParams"); + } + }); + addItem(resetCalibBtn); + + if (!params.getBool("Passive")) { + auto retrainingBtn = new ButtonControl("Review Training Guide", "REVIEW", "Review the rules, features, and limitations of openpilot"); + connect(retrainingBtn, &ButtonControl::clicked, [=]() { + if (ConfirmationDialog::confirm("Are you sure you want to review the training guide?", this)) { + emit reviewTrainingGuide(); + } + }); + addItem(retrainingBtn); + } + + if (Hardware::TICI()) { + auto regulatoryBtn = new ButtonControl("Regulatory", "VIEW", ""); + connect(regulatoryBtn, &ButtonControl::clicked, [=]() { + const std::string txt = util::read_file("../assets/offroad/fcc.html"); + RichTextDialog::alert(QString::fromStdString(txt), this); + }); + addItem(regulatoryBtn); + } + + QObject::connect(uiState(), &UIState::offroadTransition, [=](bool offroad) { + for (auto btn : findChildren()) { + btn->setEnabled(offroad); + } + }); + + // power buttons + QHBoxLayout *power_layout = new QHBoxLayout(); + power_layout->setSpacing(30); + + QPushButton *reboot_btn = new QPushButton("Reboot"); + reboot_btn->setObjectName("reboot_btn"); + power_layout->addWidget(reboot_btn); + QObject::connect(reboot_btn, &QPushButton::clicked, this, &DevicePanel::reboot); + + QPushButton *poweroff_btn = new QPushButton("Power Off"); + poweroff_btn->setObjectName("poweroff_btn"); + power_layout->addWidget(poweroff_btn); + QObject::connect(poweroff_btn, &QPushButton::clicked, this, &DevicePanel::poweroff); + + if (Hardware::TICI()) { + connect(uiState(), &UIState::offroadTransition, poweroff_btn, &QPushButton::setVisible); + } + + setStyleSheet(R"( + #reboot_btn { height: 120px; border-radius: 15px; background-color: #393939; } + #reboot_btn:pressed { background-color: #4a4a4a; } + #poweroff_btn { height: 120px; border-radius: 15px; background-color: #E22C2C; } + #poweroff_btn:pressed { background-color: #FF2424; } + )"); + addItem(power_layout); +} + +void DevicePanel::updateCalibDescription() { + QString desc = + "openpilot requires the device to be mounted within 4° left or right and " + "within 5° up or 8° down. openpilot is continuously calibrating, resetting is rarely required."; + std::string calib_bytes = Params().get("CalibrationParams"); + if (!calib_bytes.empty()) { + try { + AlignedBuffer aligned_buf; + capnp::FlatArrayMessageReader cmsg(aligned_buf.align(calib_bytes.data(), calib_bytes.size())); + auto calib = cmsg.getRoot().getLiveCalibration(); + if (calib.getCalStatus() != 0) { + double pitch = calib.getRpyCalib()[1] * (180 / M_PI); + double yaw = calib.getRpyCalib()[2] * (180 / M_PI); + desc += QString(" Your device is pointed %1° %2 and %3° %4.") + .arg(QString::number(std::abs(pitch), 'g', 1), pitch > 0 ? "down" : "up", + QString::number(std::abs(yaw), 'g', 1), yaw > 0 ? "left" : "right"); + } + } catch (kj::Exception) { + qInfo() << "invalid CalibrationParams"; + } + } + qobject_cast(sender())->setDescription(desc); +} + +void DevicePanel::reboot() { + if (uiState()->status == UIStatus::STATUS_DISENGAGED) { + if (ConfirmationDialog::confirm("Are you sure you want to reboot?", this)) { + // Check engaged again in case it changed while the dialog was open + if (uiState()->status == UIStatus::STATUS_DISENGAGED) { + Params().putBool("DoReboot", true); + } + } + } else { + ConfirmationDialog::alert("Disengage to Reboot", this); + } +} + +void DevicePanel::poweroff() { + if (uiState()->status == UIStatus::STATUS_DISENGAGED) { + if (ConfirmationDialog::confirm("Are you sure you want to power off?", this)) { + // Check engaged again in case it changed while the dialog was open + if (uiState()->status == UIStatus::STATUS_DISENGAGED) { + Params().putBool("DoShutdown", true); + } + } + } else { + ConfirmationDialog::alert("Disengage to Power Off", this); + } +} + +SoftwarePanel::SoftwarePanel(QWidget* parent) : ListWidget(parent) { + gitBranchLbl = new LabelControl("Git Branch"); + gitCommitLbl = new LabelControl("Git Commit"); + osVersionLbl = new LabelControl("OS Version"); + versionLbl = new LabelControl("Version", "", QString::fromStdString(params.get("ReleaseNotes")).trimmed()); + lastUpdateLbl = new LabelControl("Last Update Check", "", "The last time openpilot successfully checked for an update. The updater only runs while the car is off."); + updateBtn = new ButtonControl("Check for Update", ""); + connect(updateBtn, &ButtonControl::clicked, [=]() { + if (params.getBool("IsOffroad")) { + fs_watch->addPath(QString::fromStdString(params.getParamPath("LastUpdateTime"))); + fs_watch->addPath(QString::fromStdString(params.getParamPath("UpdateFailedCount"))); + updateBtn->setText("CHECKING"); + updateBtn->setEnabled(false); + } + std::system("pkill -1 -f selfdrive.updated"); + }); + + + auto uninstallBtn = new ButtonControl("Uninstall " + getBrand(), "UNINSTALL"); + connect(uninstallBtn, &ButtonControl::clicked, [&]() { + if (ConfirmationDialog::confirm("Are you sure you want to uninstall?", this)) { + params.putBool("DoUninstall", true); + } + }); + connect(uiState(), &UIState::offroadTransition, uninstallBtn, &QPushButton::setEnabled); + + QWidget *widgets[] = {versionLbl, lastUpdateLbl, updateBtn, gitBranchLbl, gitCommitLbl, osVersionLbl, uninstallBtn}; + for (QWidget* w : widgets) { + addItem(w); + } + + fs_watch = new QFileSystemWatcher(this); + QObject::connect(fs_watch, &QFileSystemWatcher::fileChanged, [=](const QString path) { + if (path.contains("UpdateFailedCount") && std::atoi(params.get("UpdateFailedCount").c_str()) > 0) { + lastUpdateLbl->setText("failed to fetch update"); + updateBtn->setText("CHECK"); + updateBtn->setEnabled(true); + } else if (path.contains("LastUpdateTime")) { + updateLabels(); + } + }); +} + +void SoftwarePanel::showEvent(QShowEvent *event) { + updateLabels(); +} + +void SoftwarePanel::updateLabels() { + QString lastUpdate = ""; + auto tm = params.get("LastUpdateTime"); + if (!tm.empty()) { + lastUpdate = timeAgo(QDateTime::fromString(QString::fromStdString(tm + "Z"), Qt::ISODate)); + } + + versionLbl->setText(getBrandVersion()); + lastUpdateLbl->setText(lastUpdate); + updateBtn->setText("CHECK"); + updateBtn->setEnabled(true); + gitBranchLbl->setText(QString::fromStdString(params.get("GitBranch"))); + gitCommitLbl->setText(QString::fromStdString(params.get("GitCommit")).left(10)); + osVersionLbl->setText(QString::fromStdString(Hardware::get_os_version()).trimmed()); +} + +C2NetworkPanel::C2NetworkPanel(QWidget *parent) : QWidget(parent) { + QVBoxLayout *layout = new QVBoxLayout(this); + layout->setContentsMargins(50, 0, 50, 0); + + ListWidget *list = new ListWidget(); + list->setSpacing(30); + // wifi + tethering buttons +#ifdef QCOM + auto wifiBtn = new ButtonControl("Wi-Fi Settings", "OPEN"); + QObject::connect(wifiBtn, &ButtonControl::clicked, [=]() { HardwareEon::launch_wifi(); }); + list->addItem(wifiBtn); + + auto tetheringBtn = new ButtonControl("Tethering Settings", "OPEN"); + QObject::connect(tetheringBtn, &ButtonControl::clicked, [=]() { HardwareEon::launch_tethering(); }); + list->addItem(tetheringBtn); +#endif + ipaddress = new LabelControl("IP Address", ""); + list->addItem(ipaddress); + + // SSH key management + list->addItem(new SshToggle()); + list->addItem(new SshControl()); + layout->addWidget(list); + layout->addStretch(1); +} + +void C2NetworkPanel::showEvent(QShowEvent *event) { + ipaddress->setText(getIPAddress()); +} + +QString C2NetworkPanel::getIPAddress() { + std::string result = util::check_output("ifconfig wlan0"); + if (result.empty()) return ""; + + const std::string inetaddrr = "inet addr:"; + std::string::size_type begin = result.find(inetaddrr); + if (begin == std::string::npos) return ""; + + begin += inetaddrr.length(); + std::string::size_type end = result.find(' ', begin); + if (end == std::string::npos) return ""; + + return result.substr(begin, end - begin).c_str(); +} + +QWidget *network_panel(QWidget *parent) { +#ifdef QCOM + return new C2NetworkPanel(parent); +#else + return new Networking(parent); +#endif +} + +void SettingsWindow::showEvent(QShowEvent *event) { + panel_widget->setCurrentIndex(0); + nav_btns->buttons()[0]->setChecked(true); +} + +SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) { + + // setup two main layouts + sidebar_widget = new QWidget; + QVBoxLayout *sidebar_layout = new QVBoxLayout(sidebar_widget); + sidebar_layout->setMargin(0); + panel_widget = new QStackedWidget(); + panel_widget->setStyleSheet(R"( + border-radius: 30px; + background-color: #292929; + )"); + + // close button + QPushButton *close_btn = new QPushButton("×"); + close_btn->setStyleSheet(R"( + QPushButton { + font-size: 140px; + padding-bottom: 20px; + font-weight: bold; + border 1px grey solid; + border-radius: 100px; + background-color: #292929; + font-weight: 400; + } + QPushButton:pressed { + background-color: #3B3B3B; + } + )"); + close_btn->setFixedSize(200, 200); + sidebar_layout->addSpacing(45); + sidebar_layout->addWidget(close_btn, 0, Qt::AlignCenter); + QObject::connect(close_btn, &QPushButton::clicked, this, &SettingsWindow::closeSettings); + + // setup panels + DevicePanel *device = new DevicePanel(this); + QObject::connect(device, &DevicePanel::reviewTrainingGuide, this, &SettingsWindow::reviewTrainingGuide); + QObject::connect(device, &DevicePanel::showDriverView, this, &SettingsWindow::showDriverView); + + QList> panels = { + {"Device", device}, + {"Network", network_panel(this)}, + {"Toggles", new TogglesPanel(this)}, + {"Tinkla", new TinklaTogglesPanel(this)}, + {"Tesla preAP", new TeslaPreApTogglesPanel(this)}, + {"Tesla", new TeslaTogglesPanel(this)}, + {"Software", new SoftwarePanel(this)}, + }; + +#ifdef ENABLE_MAPS + auto map_panel = new MapPanel(this); + panels.push_back({"Navigation", map_panel}); + QObject::connect(map_panel, &MapPanel::closeSettings, this, &SettingsWindow::closeSettings); +#endif + + const int padding = panels.size() > 3 ? 25 : 35; + + nav_btns = new QButtonGroup(this); + for (auto &[name, panel] : panels) { + QPushButton *btn = new QPushButton(name); + btn->setCheckable(true); + btn->setChecked(nav_btns->buttons().size() == 0); + btn->setStyleSheet(QString(R"( + QPushButton { + color: grey; + border: none; + background: none; + font-size: 40px; + font-weight: 500; + padding-top: %1px; + padding-bottom: %1px; + } + QPushButton:checked { + color: white; + } + QPushButton:pressed { + color: #ADADAD; + } + )").arg(padding)); + //padding-top: 30px; + //padding-bottom: 20px; + + nav_btns->addButton(btn); + sidebar_layout->addWidget(btn, 0, Qt::AlignRight); + + const int lr_margin = name != "Network" ? 50 : 0; // Network panel handles its own margins + panel->setContentsMargins(lr_margin, 25, lr_margin, 25); + + ScrollView *panel_frame = new ScrollView(panel, this); + panel_widget->addWidget(panel_frame); + + QObject::connect(btn, &QPushButton::clicked, [=, w = panel_frame]() { + btn->setChecked(true); + panel_widget->setCurrentWidget(w); + }); + } + sidebar_layout->setContentsMargins(50, 50, 100, 50); + + // main settings layout, sidebar + main panel + QHBoxLayout *main_layout = new QHBoxLayout(this); + + sidebar_widget->setFixedWidth(500); + main_layout->addWidget(sidebar_widget); + main_layout->addWidget(panel_widget); + + setStyleSheet(R"( + * { + color: white; + font-size: 50px; + } + SettingsWindow { + background-color: black; + } + )"); +} + +void SettingsWindow::hideEvent(QHideEvent *event) { +#ifdef QCOM + HardwareEon::close_activities(); +#endif + + // TODO: this should be handled by the Dialog classes + QList children = findChildren(); + for(auto &w : children){ + if(w->metaObject()->superClass()->className() == QString("QDialog")){ + w->close(); + } + } +} diff --git a/selfdrive/ui/qt/offroad/settings.h b/selfdrive/ui/qt/offroad/settings.h new file mode 100644 index 000000000..c3acf3d94 --- /dev/null +++ b/selfdrive/ui/qt/offroad/settings.h @@ -0,0 +1,89 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + + +#include "selfdrive/ui/qt/widgets/controls.h" + +// ********** settings window + top-level panels ********** +class SettingsWindow : public QFrame { + Q_OBJECT + +public: + explicit SettingsWindow(QWidget *parent = 0); + +protected: + void hideEvent(QHideEvent *event) override; + void showEvent(QShowEvent *event) override; + +signals: + void closeSettings(); + void reviewTrainingGuide(); + void showDriverView(); + +private: + QPushButton *sidebar_alert_widget; + QWidget *sidebar_widget; + QButtonGroup *nav_btns; + QStackedWidget *panel_widget; +}; + +class DevicePanel : public ListWidget { + Q_OBJECT +public: + explicit DevicePanel(SettingsWindow *parent); +signals: + void reviewTrainingGuide(); + void showDriverView(); + +private slots: + void poweroff(); + void reboot(); + void updateCalibDescription(); + +private: + Params params; +}; + +class TogglesPanel : public ListWidget { + Q_OBJECT +public: + explicit TogglesPanel(SettingsWindow *parent); +}; + +class SoftwarePanel : public ListWidget { + Q_OBJECT +public: + explicit SoftwarePanel(QWidget* parent = nullptr); + +private: + void showEvent(QShowEvent *event) override; + void updateLabels(); + + LabelControl *gitBranchLbl; + LabelControl *gitCommitLbl; + LabelControl *osVersionLbl; + LabelControl *versionLbl; + LabelControl *lastUpdateLbl; + ButtonControl *updateBtn; + + Params params; + QFileSystemWatcher *fs_watch; +}; + +class C2NetworkPanel: public QWidget { + Q_OBJECT +public: + explicit C2NetworkPanel(QWidget* parent = nullptr); + +private: + void showEvent(QShowEvent *event) override; + QString getIPAddress(); + LabelControl *ipaddress; +}; diff --git a/selfdrive/ui/qt/offroad/text_view.qml b/selfdrive/ui/qt/offroad/text_view.qml new file mode 100644 index 000000000..10b423bac --- /dev/null +++ b/selfdrive/ui/qt/offroad/text_view.qml @@ -0,0 +1,47 @@ +import QtQuick 2.0 + +Item { + id: root + signal scroll() + + Flickable { + id: flickArea + objectName: "flickArea" + anchors.fill: parent + contentHeight: helpText.height + contentWidth: width - (leftMargin + rightMargin) + bottomMargin: 50 + topMargin: 50 + rightMargin: 50 + leftMargin: 50 + flickableDirection: Flickable.VerticalFlick + flickDeceleration: 7500.0 + maximumFlickVelocity: 10000.0 + pixelAligned: true + + onAtYEndChanged: root.scroll() + + Text { + id: helpText + width: flickArea.contentWidth + font.family: "Inter" + font.weight: "Light" + font.pixelSize: 50 + textFormat: Text.RichText + color: "#C9C9C9" + wrapMode: Text.Wrap + text: text_view + } + } + + Rectangle { + id: scrollbar + anchors.right: flickArea.right + anchors.rightMargin: 20 + y: flickArea.topMargin + flickArea.visibleArea.yPosition * (flickArea.height - flickArea.bottomMargin - flickArea.topMargin) + width: 12 + radius: 6 + height: flickArea.visibleArea.heightRatio * (flickArea.height - flickArea.bottomMargin - flickArea.topMargin) + color: "#808080" + } +} diff --git a/selfdrive/ui/qt/offroad/wifiManager.cc b/selfdrive/ui/qt/offroad/wifiManager.cc new file mode 100644 index 000000000..1628f35d9 --- /dev/null +++ b/selfdrive/ui/qt/offroad/wifiManager.cc @@ -0,0 +1,470 @@ +#include "selfdrive/ui/qt/offroad/wifiManager.h" + +#include "selfdrive/ui/ui.h" +#include "selfdrive/ui/qt/widgets/prime.h" + +#include "selfdrive/common/params.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/ui/qt/util.h" + +bool compare_by_strength(const Network &a, const Network &b) { + if (a.connected == ConnectedType::CONNECTED) return true; + if (b.connected == ConnectedType::CONNECTED) return false; + if (a.connected == ConnectedType::CONNECTING) return true; + if (b.connected == ConnectedType::CONNECTING) return false; + return a.strength > b.strength; +} + +template +T call(const QString &path, const QString &interface, const QString &method, Args &&...args) { + QDBusInterface nm = QDBusInterface(NM_DBUS_SERVICE, path, interface, QDBusConnection::systemBus()); + nm.setTimeout(DBUS_TIMEOUT); + QDBusMessage response = nm.call(method, args...); + if constexpr (std::is_same_v) { + return response; + } else if (response.arguments().count() >= 1) { + QVariant vFirst = response.arguments().at(0).value().variant(); + if (vFirst.canConvert()) { + return vFirst.value(); + } + QDebug critical = qCritical(); + critical << "Variant unpacking failure :" << method << ','; + (critical << ... << args); + } + return T(); +} + +template +QDBusPendingCall asyncCall(const QString &path, const QString &interface, const QString &method, Args &&...args) { + QDBusInterface nm = QDBusInterface(NM_DBUS_SERVICE, path, interface, QDBusConnection::systemBus()); + return nm.asyncCall(method, args...); +} + +WifiManager::WifiManager(QObject *parent) : QObject(parent) { + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + + // Set tethering ssid as "weedle" + first 4 characters of a dongle id + tethering_ssid = "weedle"; + if (auto dongle_id = getDongleId()) { + tethering_ssid += "-" + dongle_id->left(4); + } + + adapter = getAdapter(); + if (!adapter.isEmpty()) { + setup(); + } else { + QDBusConnection::systemBus().connect(NM_DBUS_SERVICE, NM_DBUS_PATH, NM_DBUS_INTERFACE, "DeviceAdded", this, SLOT(deviceAdded(QDBusObjectPath))); + } + + timer.callOnTimeout(this, &WifiManager::requestScan); +} + +void WifiManager::setup() { + auto bus = QDBusConnection::systemBus(); + bus.connect(NM_DBUS_SERVICE, adapter, NM_DBUS_INTERFACE_DEVICE, "StateChanged", this, SLOT(stateChange(unsigned int, unsigned int, unsigned int))); + bus.connect(NM_DBUS_SERVICE, adapter, NM_DBUS_INTERFACE_PROPERTIES, "PropertiesChanged", this, SLOT(propertyChange(QString, QVariantMap, QStringList))); + + bus.connect(NM_DBUS_SERVICE, NM_DBUS_PATH_SETTINGS, NM_DBUS_INTERFACE_SETTINGS, "ConnectionRemoved", this, SLOT(connectionRemoved(QDBusObjectPath))); + bus.connect(NM_DBUS_SERVICE, NM_DBUS_PATH_SETTINGS, NM_DBUS_INTERFACE_SETTINGS, "NewConnection", this, SLOT(newConnection(QDBusObjectPath))); + + raw_adapter_state = call(adapter, NM_DBUS_INTERFACE_PROPERTIES, "Get", NM_DBUS_INTERFACE_DEVICE, "State"); + activeAp = call(adapter, NM_DBUS_INTERFACE_PROPERTIES, "Get", NM_DBUS_INTERFACE_DEVICE_WIRELESS, "ActiveAccessPoint").path(); + + initConnections(); + requestScan(); +} + +void WifiManager::start() { + timer.start(5000); + refreshNetworks(); +} + +void WifiManager::stop() { + timer.stop(); +} + +void WifiManager::refreshNetworks() { + if (adapter.isEmpty() || !timer.isActive()) return; + + QDBusPendingCall pending_call = asyncCall(adapter, NM_DBUS_INTERFACE_DEVICE_WIRELESS, "GetAllAccessPoints"); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pending_call); + QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, &WifiManager::refreshFinished); +} + +void WifiManager::refreshFinished(QDBusPendingCallWatcher *watcher) { + ipv4_address = getIp4Address(); + seenNetworks.clear(); + + const QDBusReply> wather_reply = *watcher; + for (const QDBusObjectPath &path : wather_reply.value()) { + QDBusReply replay = call(path.path(), NM_DBUS_INTERFACE_PROPERTIES, "GetAll", NM_DBUS_INTERFACE_ACCESS_POINT); + auto properties = replay.value(); + + const QByteArray ssid = properties["Ssid"].toByteArray(); + uint32_t strength = properties["Strength"].toUInt(); + if (ssid.isEmpty() || (seenNetworks.contains(ssid) && strength <= seenNetworks[ssid].strength)) continue; + + SecurityType security = getSecurityType(properties); + ConnectedType ctype = ConnectedType::DISCONNECTED; + if (path.path() == activeAp) { + ctype = (ssid == connecting_to_network) ? ConnectedType::CONNECTING : ConnectedType::CONNECTED; + } + seenNetworks[ssid] = {ssid, strength, ctype, security}; + } + + emit refreshSignal(); + watcher->deleteLater(); +} + +QString WifiManager::getIp4Address() { + if (raw_adapter_state != NM_DEVICE_STATE_ACTIVATED) return ""; + + for (const auto &p : getActiveConnections()) { + QString type = call(p.path(), NM_DBUS_INTERFACE_PROPERTIES, "Get", NM_DBUS_INTERFACE_ACTIVE_CONNECTION, "Type"); + if (type == "802-11-wireless") { + auto ip4config = call(p.path(), NM_DBUS_INTERFACE_PROPERTIES, "Get", NM_DBUS_INTERFACE_ACTIVE_CONNECTION, "Ip4Config"); + const auto &arr = call(ip4config.path(), NM_DBUS_INTERFACE_PROPERTIES, "Get", NM_DBUS_INTERFACE_IP4_CONFIG, "AddressData"); + QVariantMap path; + arr.beginArray(); + while (!arr.atEnd()) { + arr >> path; + arr.endArray(); + return path.value("address").value(); + } + arr.endArray(); + } + } + return ""; +} + +SecurityType WifiManager::getSecurityType(const QVariantMap &properties) { + int sflag = properties["Flags"].toUInt(); + int wpaflag = properties["WpaFlags"].toUInt(); + int rsnflag = properties["RsnFlags"].toUInt(); + int wpa_props = wpaflag | rsnflag; + + // obtained by looking at flags of networks in the office as reported by an Android phone + const int supports_wpa = NM_802_11_AP_SEC_PAIR_WEP40 | NM_802_11_AP_SEC_PAIR_WEP104 | NM_802_11_AP_SEC_GROUP_WEP40 | NM_802_11_AP_SEC_GROUP_WEP104 | NM_802_11_AP_SEC_KEY_MGMT_PSK; + + if ((sflag == NM_802_11_AP_FLAGS_NONE) || ((sflag & NM_802_11_AP_FLAGS_WPS) && !(wpa_props & supports_wpa))) { + return SecurityType::OPEN; + } else if ((sflag & NM_802_11_AP_FLAGS_PRIVACY) && (wpa_props & supports_wpa) && !(wpa_props & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) { + return SecurityType::WPA; + } else { + LOGW("Unsupported network! sflag: %d, wpaflag: %d, rsnflag: %d", sflag, wpaflag, rsnflag); + return SecurityType::UNSUPPORTED; + } +} + +void WifiManager::connect(const Network &n, const QString &password, const QString &username) { + connecting_to_network = n.ssid; + seenNetworks[n.ssid].connected = ConnectedType::CONNECTING; + forgetConnection(n.ssid); // Clear all connections that may already exist to the network we are connecting + Connection connection; + connection["connection"]["type"] = "802-11-wireless"; + connection["connection"]["uuid"] = QUuid::createUuid().toString().remove('{').remove('}'); + connection["connection"]["id"] = "openpilot connection " + QString::fromStdString(n.ssid.toStdString()); + connection["connection"]["autoconnect-retries"] = 0; + + connection["802-11-wireless"]["ssid"] = n.ssid; + connection["802-11-wireless"]["mode"] = "infrastructure"; + + if (n.security_type == SecurityType::WPA) { + connection["802-11-wireless-security"]["key-mgmt"] = "wpa-psk"; + connection["802-11-wireless-security"]["auth-alg"] = "open"; + connection["802-11-wireless-security"]["psk"] = password; + } + + connection["ipv4"]["method"] = "auto"; + connection["ipv4"]["dns-priority"] = 600; + connection["ipv6"]["method"] = "ignore"; + + call(NM_DBUS_PATH_SETTINGS, NM_DBUS_INTERFACE_SETTINGS, "AddConnection", QVariant::fromValue(connection)); +} + +void WifiManager::deactivateConnectionBySsid(const QString &ssid) { + for (QDBusObjectPath active_connection : getActiveConnections()) { + auto pth = call(active_connection.path(), NM_DBUS_INTERFACE_PROPERTIES, "Get", NM_DBUS_INTERFACE_ACTIVE_CONNECTION, "SpecificObject"); + if (pth.path() != "" && pth.path() != "/") { + QString Ssid = get_property(pth.path(), "Ssid"); + if (Ssid == ssid) { + deactivateConnection(active_connection); + return; + } + } + } +} + +void WifiManager::deactivateConnection(const QDBusObjectPath &path) { + asyncCall(NM_DBUS_PATH, NM_DBUS_INTERFACE, "DeactivateConnection", QVariant::fromValue(path)); +} + +QVector WifiManager::getActiveConnections() { + QVector conns; + QDBusObjectPath path; + const QDBusArgument &arr = call(NM_DBUS_PATH, NM_DBUS_INTERFACE_PROPERTIES, "Get", NM_DBUS_INTERFACE, "ActiveConnections"); + arr.beginArray(); + while (!arr.atEnd()) { + arr >> path; + conns.push_back(path); + } + arr.endArray(); + return conns; +} + +bool WifiManager::isKnownConnection(const QString &ssid) { + return !getConnectionPath(ssid).path().isEmpty(); +} + +void WifiManager::forgetConnection(const QString &ssid) { + const QDBusObjectPath &path = getConnectionPath(ssid); + if (!path.path().isEmpty()) { + call(path.path(), NM_DBUS_INTERFACE_SETTINGS_CONNECTION, "Delete"); + } +} + +uint WifiManager::getAdapterType(const QDBusObjectPath &path) { + return call(path.path(), NM_DBUS_INTERFACE_PROPERTIES, "Get", NM_DBUS_INTERFACE_DEVICE, "DeviceType"); +} + +void WifiManager::requestScan() { + if (!adapter.isEmpty()) { + asyncCall(adapter, NM_DBUS_INTERFACE_DEVICE_WIRELESS, "RequestScan", QVariantMap()); + } +} + +QByteArray WifiManager::get_property(const QString &network_path , const QString &property) { + return call(network_path, NM_DBUS_INTERFACE_PROPERTIES, "Get", NM_DBUS_INTERFACE_ACCESS_POINT, property); +} + +QString WifiManager::getAdapter(const uint adapter_type) { + QDBusReply> response = call(NM_DBUS_PATH, NM_DBUS_INTERFACE, "GetDevices"); + for (const QDBusObjectPath &path : response.value()) { + if (getAdapterType(path) == adapter_type) { + return path.path(); + } + } + return ""; +} + +void WifiManager::stateChange(unsigned int new_state, unsigned int previous_state, unsigned int change_reason) { + raw_adapter_state = new_state; + if (new_state == NM_DEVICE_STATE_NEED_AUTH && change_reason == NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT && !connecting_to_network.isEmpty()) { + forgetConnection(connecting_to_network); + emit wrongPassword(connecting_to_network); + } else if (new_state == NM_DEVICE_STATE_ACTIVATED) { + connecting_to_network = ""; + refreshNetworks(); + } +} + +// https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.Wireless.html +void WifiManager::propertyChange(const QString &interface, const QVariantMap &props, const QStringList &invalidated_props) { + if (interface == NM_DBUS_INTERFACE_DEVICE_WIRELESS && props.contains("LastScan")) { + refreshNetworks(); + } else if (interface == NM_DBUS_INTERFACE_DEVICE_WIRELESS && props.contains("ActiveAccessPoint")) { + activeAp = props.value("ActiveAccessPoint").value().path(); + } +} + +void WifiManager::deviceAdded(const QDBusObjectPath &path) { + if (getAdapterType(path) == NM_DEVICE_TYPE_WIFI && (adapter.isEmpty() || adapter == "/")) { + adapter = path.path(); + setup(); + } +} + +void WifiManager::connectionRemoved(const QDBusObjectPath &path) { + knownConnections.remove(path); +} + +void WifiManager::newConnection(const QDBusObjectPath &path) { + Connection settings = getConnectionSettings(path); + if (settings.value("connection").value("type") == "802-11-wireless") { + knownConnections[path] = settings.value("802-11-wireless").value("ssid").toString(); + if (knownConnections[path] != tethering_ssid) { + activateWifiConnection(knownConnections[path]); + } + } +} + +QDBusObjectPath WifiManager::getConnectionPath(const QString &ssid) { + return knownConnections.key(ssid); +} + +Connection WifiManager::getConnectionSettings(const QDBusObjectPath &path) { + return QDBusReply(call(path.path(), NM_DBUS_INTERFACE_SETTINGS_CONNECTION, "GetSettings")).value(); +} + +void WifiManager::initConnections() { + const QDBusReply> response = call(NM_DBUS_PATH_SETTINGS, NM_DBUS_INTERFACE_SETTINGS, "ListConnections"); + for (const QDBusObjectPath &path : response.value()) { + const Connection settings = getConnectionSettings(path); + if (settings.value("connection").value("type") == "802-11-wireless") { + knownConnections[path] = settings.value("802-11-wireless").value("ssid").toString(); + } else if (path.path() != "/") { + lteConnectionPath = path; + } + } +} + +std::optional WifiManager::activateWifiConnection(const QString &ssid) { + const QDBusObjectPath &path = getConnectionPath(ssid); + if (!path.path().isEmpty()) { + connecting_to_network = ssid; + return asyncCall(NM_DBUS_PATH, NM_DBUS_INTERFACE, "ActivateConnection", QVariant::fromValue(path), QVariant::fromValue(QDBusObjectPath(adapter)), QVariant::fromValue(QDBusObjectPath("/"))); + } + return std::nullopt; +} + +void WifiManager::activateModemConnection(const QDBusObjectPath &path) { + QString modem = getAdapter(NM_DEVICE_TYPE_MODEM); + if (!path.path().isEmpty() && !modem.isEmpty()) { + asyncCall(NM_DBUS_PATH, NM_DBUS_INTERFACE, "ActivateConnection", QVariant::fromValue(path), QVariant::fromValue(QDBusObjectPath(modem)), QVariant::fromValue(QDBusObjectPath("/"))); + } +} + +// function matches tici/hardware.py +NetworkType WifiManager::currentNetworkType() { + auto primary_conn = call(NM_DBUS_PATH, NM_DBUS_INTERFACE_PROPERTIES, "Get", NM_DBUS_INTERFACE, "PrimaryConnection"); + auto primary_type = call(primary_conn.path(), NM_DBUS_INTERFACE_PROPERTIES, "Get", NM_DBUS_INTERFACE_ACTIVE_CONNECTION, "Type"); + + if (primary_type == "802-3-ethernet") { + return NetworkType::ETHERNET; + } else if (primary_type == "802-11-wireless" && !isTetheringEnabled()) { + return NetworkType::WIFI; + } else { + for (const QDBusObjectPath &conn : getActiveConnections()) { + auto type = call(conn.path(), NM_DBUS_INTERFACE_PROPERTIES, "Get", NM_DBUS_INTERFACE_ACTIVE_CONNECTION, "Type"); + if (type == "gsm") { + return NetworkType::CELL; + } + } + } + return NetworkType::NONE; +} + +void WifiManager::updateGsmSettings(bool roaming, QString apn) { + if (!lteConnectionPath.path().isEmpty()) { + bool changes = false; + bool auto_config = apn.isEmpty(); + Connection settings = getConnectionSettings(lteConnectionPath); + if (settings.value("gsm").value("auto-config").toBool() != auto_config) { + qWarning() << "Changing gsm.auto-config to" << auto_config; + settings["gsm"]["auto-config"] = auto_config; + changes = true; + } + + if (settings.value("gsm").value("apn").toString() != apn) { + qWarning() << "Changing gsm.apn to" << apn; + settings["gsm"]["apn"] = apn; + changes = true; + } + + if (settings.value("gsm").value("home-only").toBool() == roaming) { + qWarning() << "Changing gsm.home-only to" << !roaming; + settings["gsm"]["home-only"] = !roaming; + changes = true; + } + + if (changes) { + call(lteConnectionPath.path(), NM_DBUS_INTERFACE_SETTINGS_CONNECTION, "UpdateUnsaved", QVariant::fromValue(settings)); // update is temporary + deactivateConnection(lteConnectionPath); + activateModemConnection(lteConnectionPath); + } + } +} + +// Functions for tethering +void WifiManager::addTetheringConnection() { + Connection connection; + connection["connection"]["id"] = "Hotspot"; + connection["connection"]["uuid"] = QUuid::createUuid().toString().remove('{').remove('}'); + connection["connection"]["type"] = "802-11-wireless"; + connection["connection"]["interface-name"] = "wlan0"; + connection["connection"]["autoconnect"] = false; + + connection["802-11-wireless"]["band"] = "bg"; + connection["802-11-wireless"]["mode"] = "ap"; + connection["802-11-wireless"]["ssid"] = tethering_ssid.toUtf8(); + + connection["802-11-wireless-security"]["group"] = QStringList("ccmp"); + connection["802-11-wireless-security"]["key-mgmt"] = "wpa-psk"; + connection["802-11-wireless-security"]["pairwise"] = QStringList("ccmp"); + connection["802-11-wireless-security"]["proto"] = QStringList("rsn"); + connection["802-11-wireless-security"]["psk"] = defaultTetheringPassword; + + connection["ipv4"]["method"] = "shared"; + QVariantMap address; + address["address"] = "192.168.43.1"; + address["prefix"] = 24u; + connection["ipv4"]["address-data"] = QVariant::fromValue(IpConfig() << address); + connection["ipv4"]["gateway"] = "192.168.43.1"; + connection["ipv4"]["route-metric"] = 1100; + connection["ipv6"]["method"] = "ignore"; + + call(NM_DBUS_PATH_SETTINGS, NM_DBUS_INTERFACE_SETTINGS, "AddConnection", QVariant::fromValue(connection)); +} + +void WifiManager::tetheringActivated(QDBusPendingCallWatcher *call) { + int prime_type = uiState()->prime_type; + int ipv4_forward = (prime_type == PrimeType::NONE || prime_type == PrimeType::LITE); + + if (!ipv4_forward) { + QTimer::singleShot(5000, this, [=] { + qWarning() << "net.ipv4.ip_forward = 0"; + std::system("sudo sysctl net.ipv4.ip_forward=0"); + }); + } + call->deleteLater(); +} + +void WifiManager::setTetheringEnabled(bool enabled) { + if (enabled) { + if (!isKnownConnection(tethering_ssid)) { + addTetheringConnection(); + } + + auto pending_call = activateWifiConnection(tethering_ssid); + + if (pending_call) { + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(*pending_call); + QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, &WifiManager::tetheringActivated); + } + + } else { + deactivateConnectionBySsid(tethering_ssid); + } +} + +bool WifiManager::isTetheringEnabled() { + if (activeAp != "" && activeAp != "/") { + return get_property(activeAp, "Ssid") == tethering_ssid; + } + return false; +} + +QString WifiManager::getTetheringPassword() { + if (!isKnownConnection(tethering_ssid)) { + addTetheringConnection(); + } + const QDBusObjectPath &path = getConnectionPath(tethering_ssid); + if (!path.path().isEmpty()) { + QDBusReply> response = call(path.path(), NM_DBUS_INTERFACE_SETTINGS_CONNECTION, "GetSecrets", "802-11-wireless-security"); + return response.value().value("802-11-wireless-security").value("psk").toString(); + } + return ""; +} + +void WifiManager::changeTetheringPassword(const QString &newPassword) { + const QDBusObjectPath &path = getConnectionPath(tethering_ssid); + if (!path.path().isEmpty()) { + Connection settings = getConnectionSettings(path); + settings["802-11-wireless-security"]["psk"] = newPassword; + call(path.path(), NM_DBUS_INTERFACE_SETTINGS_CONNECTION, "Update", QVariant::fromValue(settings)); + if (isTetheringEnabled()) { + activateWifiConnection(tethering_ssid); + } + } +} diff --git a/selfdrive/ui/qt/offroad/wifiManager.h b/selfdrive/ui/qt/offroad/wifiManager.h new file mode 100644 index 000000000..07b982c2c --- /dev/null +++ b/selfdrive/ui/qt/offroad/wifiManager.h @@ -0,0 +1,102 @@ +#pragma once + +#include +#include +#include + +#include "selfdrive/ui/qt/offroad/networkmanager.h" + +enum class SecurityType { + OPEN, + WPA, + UNSUPPORTED +}; +enum class ConnectedType { + DISCONNECTED, + CONNECTING, + CONNECTED +}; +enum class NetworkType { + NONE, + WIFI, + CELL, + ETHERNET +}; + +typedef QMap Connection; +typedef QVector IpConfig; + +struct Network { + QByteArray ssid; + unsigned int strength; + ConnectedType connected; + SecurityType security_type; +}; +bool compare_by_strength(const Network &a, const Network &b); + +class WifiManager : public QObject { + Q_OBJECT + +public: + QMap seenNetworks; + QMap knownConnections; + QString ipv4_address; + + explicit WifiManager(QObject* parent); + void start(); + void stop(); + void requestScan(); + void forgetConnection(const QString &ssid); + bool isKnownConnection(const QString &ssid); + std::optional activateWifiConnection(const QString &ssid); + NetworkType currentNetworkType(); + void updateGsmSettings(bool roaming, QString apn); + void connect(const Network &ssid, const QString &password = {}, const QString &username = {}); + + // Tethering functions + void setTetheringEnabled(bool enabled); + bool isTetheringEnabled(); + void changeTetheringPassword(const QString &newPassword); + QString getTetheringPassword(); + +private: + QString adapter; // Path to network manager wifi-device + QTimer timer; + unsigned int raw_adapter_state; // Connection status https://developer.gnome.org/NetworkManager/1.26/nm-dbus-types.html#NMDeviceState + QString connecting_to_network; + QString tethering_ssid; + const QString defaultTetheringPassword = "swagswagcomma"; + QString activeAp; + QDBusObjectPath lteConnectionPath; + + QString getAdapter(const uint = NM_DEVICE_TYPE_WIFI); + uint getAdapterType(const QDBusObjectPath &path); + bool isWirelessAdapter(const QDBusObjectPath &path); + QString getIp4Address(); + void connect(const QByteArray &ssid, const QString &username, const QString &password, SecurityType security_type); + void deactivateConnectionBySsid(const QString &ssid); + void deactivateConnection(const QDBusObjectPath &path); + QVector getActiveConnections(); + QByteArray get_property(const QString &network_path, const QString &property); + SecurityType getSecurityType(const QVariantMap &properties); + QDBusObjectPath getConnectionPath(const QString &ssid); + Connection getConnectionSettings(const QDBusObjectPath &path); + void initConnections(); + void setup(); + void refreshNetworks(); + void activateModemConnection(const QDBusObjectPath &path); + void addTetheringConnection(); + +signals: + void wrongPassword(const QString &ssid); + void refreshSignal(); + +private slots: + void stateChange(unsigned int new_state, unsigned int previous_state, unsigned int change_reason); + void propertyChange(const QString &interface, const QVariantMap &props, const QStringList &invalidated_props); + void deviceAdded(const QDBusObjectPath &path); + void connectionRemoved(const QDBusObjectPath &path); + void newConnection(const QDBusObjectPath &path); + void refreshFinished(QDBusPendingCallWatcher *call); + void tetheringActivated(QDBusPendingCallWatcher *call); +}; diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc new file mode 100644 index 000000000..44dde8581 --- /dev/null +++ b/selfdrive/ui/qt/onroad.cc @@ -0,0 +1,391 @@ +#include "selfdrive/ui/qt/onroad.h" + +#include + +#include + +#include "selfdrive/common/timing.h" +#include "selfdrive/ui/qt/util.h" +#ifdef ENABLE_MAPS +#include "selfdrive/ui/qt/maps/map.h" +#include "selfdrive/ui/qt/maps/map_helpers.h" +#endif + +OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent) { + QVBoxLayout *main_layout = new QVBoxLayout(this); + main_layout->setMargin(bdr_s); + QStackedLayout *stacked_layout = new QStackedLayout; + stacked_layout->setStackingMode(QStackedLayout::StackAll); + main_layout->addLayout(stacked_layout); + + QStackedLayout *road_view_layout = new QStackedLayout; + road_view_layout->setStackingMode(QStackedLayout::StackAll); + nvg = new NvgWindow(VISION_STREAM_RGB_BACK, this); + road_view_layout->addWidget(nvg); + hud = new OnroadHud(this); + road_view_layout->addWidget(hud); + + QWidget * split_wrapper = new QWidget; + split = new QHBoxLayout(split_wrapper); + split->setContentsMargins(0, 0, 0, 0); + split->setSpacing(0); + split->addLayout(road_view_layout); + + stacked_layout->addWidget(split_wrapper); + + alerts = new OnroadAlerts(this); + alerts->setAttribute(Qt::WA_TransparentForMouseEvents, true); + stacked_layout->addWidget(alerts); + + // setup stacking order + alerts->raise(); + + setAttribute(Qt::WA_OpaquePaintEvent); + QObject::connect(uiState(), &UIState::uiUpdate, this, &OnroadWindow::updateState); + QObject::connect(uiState(), &UIState::offroadTransition, this, &OnroadWindow::offroadTransition); +} + +void OnroadWindow::updateState(const UIState &s) { + QColor bgColor = bg_colors[s.status]; + Alert alert = Alert::get(*(s.sm), s.scene.started_frame); + if (s.sm->updated("controlsState") || !alert.equal({})) { + if (alert.type == "controlsUnresponsive") { + bgColor = bg_colors[STATUS_ALERT]; + } else if (alert.type == "controlsUnresponsivePermanent") { + bgColor = bg_colors[STATUS_DISENGAGED]; + } + alerts->updateAlert(alert, bgColor); + } + + hud->updateState(s); + + if (bg != bgColor) { + // repaint border + bg = bgColor; + update(); + } +} + +void OnroadWindow::mousePressEvent(QMouseEvent* e) { + if (map != nullptr) { + bool sidebarVisible = geometry().x() > 0; + map->setVisible(!sidebarVisible && !map->isVisible()); + } + // propagation event to parent(HomeWindow) + QWidget::mousePressEvent(e); +} + +void OnroadWindow::offroadTransition(bool offroad) { +#ifdef ENABLE_MAPS + if (!offroad) { + if (map == nullptr && (uiState()->prime_type || !MAPBOX_TOKEN.isEmpty())) { + MapWindow * m = new MapWindow(get_mapbox_settings()); + map = m; + + QObject::connect(uiState(), &UIState::offroadTransition, m, &MapWindow::offroadTransition); + + m->setFixedWidth(topWidget(this)->width() / 2); + split->addWidget(m, 0, Qt::AlignRight); + + // Make map visible after adding to split + m->offroadTransition(offroad); + } + } +#endif + + alerts->updateAlert({}, bg); + + // update stream type + bool wide_cam = Hardware::TICI() && Params().getBool("EnableWideCamera"); + nvg->setStreamType(wide_cam ? VISION_STREAM_RGB_WIDE : VISION_STREAM_RGB_BACK); +} + +void OnroadWindow::paintEvent(QPaintEvent *event) { + QPainter p(this); + p.fillRect(rect(), QColor(bg.red(), bg.green(), bg.blue(), 255)); +} + +// ***** onroad widgets ***** + +// OnroadAlerts +void OnroadAlerts::updateAlert(const Alert &a, const QColor &color) { + if (!alert.equal(a) || color != bg) { + alert = a; + bg = color; + update(); + } +} + +void OnroadAlerts::paintEvent(QPaintEvent *event) { + if (alert.size == cereal::ControlsState::AlertSize::NONE) { + return; + } + static std::map alert_sizes = { + {cereal::ControlsState::AlertSize::SMALL, 271}, + {cereal::ControlsState::AlertSize::MID, 420}, + {cereal::ControlsState::AlertSize::FULL, height()}, + }; + int h = alert_sizes[alert.size]; + QRect r = QRect(0, height() - h, width(), h); + + QPainter p(this); + + // draw background + gradient + p.setPen(Qt::NoPen); + p.setCompositionMode(QPainter::CompositionMode_SourceOver); + + p.setBrush(QBrush(bg)); + p.drawRect(r); + + QLinearGradient g(0, r.y(), 0, r.bottom()); + g.setColorAt(0, QColor::fromRgbF(0, 0, 0, 0.05)); + g.setColorAt(1, QColor::fromRgbF(0, 0, 0, 0.35)); + + p.setCompositionMode(QPainter::CompositionMode_DestinationOver); + p.setBrush(QBrush(g)); + p.fillRect(r, g); + p.setCompositionMode(QPainter::CompositionMode_SourceOver); + + // text + const QPoint c = r.center(); + p.setPen(QColor(0xff, 0xff, 0xff)); + p.setRenderHint(QPainter::TextAntialiasing); + if (alert.size == cereal::ControlsState::AlertSize::SMALL) { + configFont(p, "Open Sans", 74, "SemiBold"); + p.drawText(r, Qt::AlignCenter, alert.text1); + } else if (alert.size == cereal::ControlsState::AlertSize::MID) { + configFont(p, "Open Sans", 88, "Bold"); + p.drawText(QRect(0, c.y() - 125, width(), 150), Qt::AlignHCenter | Qt::AlignTop, alert.text1); + configFont(p, "Open Sans", 66, "Regular"); + p.drawText(QRect(0, c.y() + 21, width(), 90), Qt::AlignHCenter, alert.text2); + } else if (alert.size == cereal::ControlsState::AlertSize::FULL) { + bool l = alert.text1.length() > 15; + configFont(p, "Open Sans", l ? 132 : 177, "Bold"); + p.drawText(QRect(0, r.y() + (l ? 240 : 270), width(), 600), Qt::AlignHCenter | Qt::TextWordWrap, alert.text1); + configFont(p, "Open Sans", 88, "Regular"); + p.drawText(QRect(0, r.height() - (l ? 361 : 420), width(), 300), Qt::AlignHCenter | Qt::TextWordWrap, alert.text2); + } +} + +// OnroadHud +OnroadHud::OnroadHud(QWidget *parent) : QWidget(parent) { + engage_img = loadPixmap("../assets/img_chffr_wheel.png", {img_size, img_size}); + dm_img = loadPixmap("../assets/img_driver_face.png", {img_size, img_size}); + + connect(this, &OnroadHud::valueChanged, [=] { update(); }); +} + +void OnroadHud::updateState(const UIState &s) { + const int SET_SPEED_NA = 255; + const SubMaster &sm = *(s.sm); + const auto cs = sm["controlsState"].getControlsState(); + + float maxspeed = cs.getVCruise(); + bool cruise_set = maxspeed > 0 && (int)maxspeed != SET_SPEED_NA; + if (cruise_set && !s.scene.is_metric) { + maxspeed *= KM_TO_MILE; + } + QString maxspeed_str = cruise_set ? QString::number(std::nearbyint(maxspeed)) : "N/A"; + float cur_speed = std::max(0.0, sm["carState"].getCarState().getVEgo() * (s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH)); + + setProperty("is_cruise_set", cruise_set); + setProperty("speed", QString::number(std::nearbyint(cur_speed))); + setProperty("maxSpeed", maxspeed_str); + setProperty("speedUnit", s.scene.is_metric ? "km/h" : "mph"); + setProperty("hideDM", cs.getAlertSize() != cereal::ControlsState::AlertSize::NONE); + setProperty("status", s.status); + + // update engageability and DM icons at 2Hz + if (sm.frame % (UI_FREQ / 2) == 0) { + setProperty("engageable", cs.getEngageable() || cs.getEnabled()); + setProperty("dmActive", sm["driverMonitoringState"].getDriverMonitoringState().getIsActiveMode()); + } +} + +void OnroadHud::paintEvent(QPaintEvent *event) { + QPainter p(this); + p.setRenderHint(QPainter::Antialiasing); + + // Header gradient + QLinearGradient bg(0, header_h - (header_h / 2.5), 0, header_h); + bg.setColorAt(0, QColor::fromRgbF(0, 0, 0, 0.45)); + bg.setColorAt(1, QColor::fromRgbF(0, 0, 0, 0)); + p.fillRect(0, 0, width(), header_h, bg); + + // max speed + QRect rc(bdr_s * 2, bdr_s * 1.5, 184, 202); + p.setPen(QPen(QColor(0xff, 0xff, 0xff, 100), 10)); + p.setBrush(QColor(0, 0, 0, 100)); + p.drawRoundedRect(rc, 20, 20); + p.setPen(Qt::NoPen); + + configFont(p, "Open Sans", 48, "Regular"); + drawText(p, rc.center().x(), 118, "MAX", is_cruise_set ? 200 : 100); + if (is_cruise_set) { + configFont(p, "Open Sans", 88, is_cruise_set ? "Bold" : "SemiBold"); + drawText(p, rc.center().x(), 212, maxSpeed, 255); + } else { + configFont(p, "Open Sans", 80, "SemiBold"); + drawText(p, rc.center().x(), 212, maxSpeed, 100); + } + + // current speed + configFont(p, "Open Sans", 176, "Bold"); + drawText(p, rect().center().x(), 210, speed); + configFont(p, "Open Sans", 66, "Regular"); + drawText(p, rect().center().x(), 290, speedUnit, 200); + + // engage-ability icon + if (engageable) { + drawIcon(p, rect().right() - radius / 2 - bdr_s * 2, radius / 2 + int(bdr_s * 1.5), + engage_img, bg_colors[status], 1.0); + } + + // dm icon + if (!hideDM) { + drawIcon(p, radius / 2 + (bdr_s * 2), rect().bottom() - footer_h / 2, + dm_img, QColor(0, 0, 0, 70), dmActive ? 1.0 : 0.2); + } +} + +void OnroadHud::drawText(QPainter &p, int x, int y, const QString &text, int alpha) { + QFontMetrics fm(p.font()); + QRect init_rect = fm.boundingRect(text); + QRect real_rect = fm.boundingRect(init_rect, 0, text); + real_rect.moveCenter({x, y - real_rect.height() / 2}); + + p.setPen(QColor(0xff, 0xff, 0xff, alpha)); + p.drawText(real_rect.x(), real_rect.bottom(), text); +} + +void OnroadHud::drawIcon(QPainter &p, int x, int y, QPixmap &img, QBrush bg, float opacity) { + p.setPen(Qt::NoPen); + p.setBrush(bg); + p.drawEllipse(x - radius / 2, y - radius / 2, radius, radius); + p.setOpacity(opacity); + p.drawPixmap(x - img_size / 2, y - img_size / 2, img); +} + +// NvgWindow +void NvgWindow::initializeGL() { + CameraViewWidget::initializeGL(); + qInfo() << "OpenGL version:" << QString((const char*)glGetString(GL_VERSION)); + qInfo() << "OpenGL vendor:" << QString((const char*)glGetString(GL_VENDOR)); + qInfo() << "OpenGL renderer:" << QString((const char*)glGetString(GL_RENDERER)); + qInfo() << "OpenGL language version:" << QString((const char*)glGetString(GL_SHADING_LANGUAGE_VERSION)); + + prev_draw_t = millis_since_boot(); + setBackgroundColor(bg_colors[STATUS_DISENGAGED]); +} + +void NvgWindow::updateFrameMat(int w, int h) { + CameraViewWidget::updateFrameMat(w, h); + + UIState *s = uiState(); + s->fb_w = w; + s->fb_h = h; + auto intrinsic_matrix = s->wide_camera ? ecam_intrinsic_matrix : fcam_intrinsic_matrix; + float zoom = ZOOM / intrinsic_matrix.v[0]; + if (s->wide_camera) { + zoom *= 0.5; + } + // Apply transformation such that video pixel coordinates match video + // 1) Put (0, 0) in the middle of the video + // 2) Apply same scaling as video + // 3) Put (0, 0) in top left corner of video + s->car_space_transform.reset(); + s->car_space_transform.translate(w / 2, h / 2 + y_offset) + .scale(zoom, zoom) + .translate(-intrinsic_matrix.v[2], -intrinsic_matrix.v[5]); +} + +void NvgWindow::drawLaneLines(QPainter &painter, const UIScene &scene) { + if (!scene.end_to_end) { + // lanelines + for (int i = 0; i < std::size(scene.lane_line_vertices); ++i) { + painter.setBrush(QColor::fromRgbF(1.0, 1.0, 1.0, scene.lane_line_probs[i])); + painter.drawPolygon(scene.lane_line_vertices[i].v, scene.lane_line_vertices[i].cnt); + } + // road edges + for (int i = 0; i < std::size(scene.road_edge_vertices); ++i) { + painter.setBrush(QColor::fromRgbF(1.0, 0, 0, std::clamp(1.0 - scene.road_edge_stds[i], 0.0, 1.0))); + painter.drawPolygon(scene.road_edge_vertices[i].v, scene.road_edge_vertices[i].cnt); + } + } + // paint path + QLinearGradient bg(0, height(), 0, height() / 4); + bg.setColorAt(0, scene.end_to_end ? redColor() : QColor(255, 255, 255)); + bg.setColorAt(1, scene.end_to_end ? redColor(0) : QColor(255, 255, 255, 0)); + painter.setBrush(bg); + painter.drawPolygon(scene.track_vertices.v, scene.track_vertices.cnt); +} + +void NvgWindow::drawLead(QPainter &painter, const cereal::ModelDataV2::LeadDataV3::Reader &lead_data, const QPointF &vd) { + const float speedBuff = 10.; + const float leadBuff = 40.; + const float d_rel = lead_data.getX()[0]; + const float v_rel = lead_data.getV()[0]; + + float fillAlpha = 0; + if (d_rel < leadBuff) { + fillAlpha = 255 * (1.0 - (d_rel / leadBuff)); + if (v_rel < 0) { + fillAlpha += 255 * (-1 * (v_rel / speedBuff)); + } + fillAlpha = (int)(fmin(fillAlpha, 255)); + } + + float sz = std::clamp((25 * 30) / (d_rel / 3 + 30), 15.0f, 30.0f) * 2.35; + float x = std::clamp((float)vd.x(), 0.f, width() - sz / 2); + float y = std::fmin(height() - sz * .6, (float)vd.y()); + + float g_xo = sz / 5; + float g_yo = sz / 10; + + QPointF glow[] = {{x + (sz * 1.35) + g_xo, y + sz + g_yo}, {x, y - g_yo}, {x - (sz * 1.35) - g_xo, y + sz + g_yo}}; + painter.setBrush(QColor(218, 202, 37, 255)); + painter.drawPolygon(glow, std::size(glow)); + + // chevron + QPointF chevron[] = {{x + (sz * 1.25), y + sz}, {x, y}, {x - (sz * 1.25), y + sz}}; + painter.setBrush(redColor(fillAlpha)); + painter.drawPolygon(chevron, std::size(chevron)); +} + +void NvgWindow::paintGL() { + CameraViewWidget::paintGL(); + + UIState *s = uiState(); + if (s->worldObjectsVisible()) { + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); + painter.setPen(Qt::NoPen); + + drawLaneLines(painter, s->scene); + + if (s->scene.longitudinal_control) { + auto leads = (*s->sm)["modelV2"].getModelV2().getLeadsV3(); + if (leads[0].getProb() > .5) { + drawLead(painter, leads[0], s->scene.lead_vertices[0]); + } + if (leads[1].getProb() > .5 && (std::abs(leads[1].getX()[0] - leads[0].getX()[0]) > 3.0)) { + drawLead(painter, leads[1], s->scene.lead_vertices[1]); + } + } + } + + double cur_draw_t = millis_since_boot(); + double dt = cur_draw_t - prev_draw_t; + if (dt > 66) { + // warn on sub 15fps + LOGW("slow frame time: %.2f", dt); + } + prev_draw_t = cur_draw_t; +} + +void NvgWindow::showEvent(QShowEvent *event) { + CameraViewWidget::showEvent(event); + + ui_update_params(uiState()); + prev_draw_t = millis_since_boot(); +} diff --git a/selfdrive/ui/qt/onroad.h b/selfdrive/ui/qt/onroad.h new file mode 100644 index 000000000..05811c506 --- /dev/null +++ b/selfdrive/ui/qt/onroad.h @@ -0,0 +1,103 @@ +#pragma once + +#include +#include + +#include "selfdrive/ui/qt/widgets/cameraview.h" +#include "selfdrive/ui/ui.h" + + +// ***** onroad widgets ***** + +class OnroadHud : public QWidget { + Q_OBJECT + Q_PROPERTY(QString speed MEMBER speed NOTIFY valueChanged); + Q_PROPERTY(QString speedUnit MEMBER speedUnit NOTIFY valueChanged); + Q_PROPERTY(QString maxSpeed MEMBER maxSpeed NOTIFY valueChanged); + Q_PROPERTY(bool is_cruise_set MEMBER is_cruise_set NOTIFY valueChanged); + Q_PROPERTY(bool engageable MEMBER engageable NOTIFY valueChanged); + Q_PROPERTY(bool dmActive MEMBER dmActive NOTIFY valueChanged); + Q_PROPERTY(bool hideDM MEMBER hideDM NOTIFY valueChanged); + Q_PROPERTY(int status MEMBER status NOTIFY valueChanged); + +public: + explicit OnroadHud(QWidget *parent); + void updateState(const UIState &s); + +private: + void drawIcon(QPainter &p, int x, int y, QPixmap &img, QBrush bg, float opacity); + void drawText(QPainter &p, int x, int y, const QString &text, int alpha = 255); + void paintEvent(QPaintEvent *event) override; + + QPixmap engage_img; + QPixmap dm_img; + const int radius = 192; + const int img_size = (radius / 2) * 1.5; + QString speed; + QString speedUnit; + QString maxSpeed; + bool is_cruise_set = false; + bool engageable = false; + bool dmActive = false; + bool hideDM = false; + int status = STATUS_DISENGAGED; + +signals: + void valueChanged(); +}; + +class OnroadAlerts : public QWidget { + Q_OBJECT + +public: + OnroadAlerts(QWidget *parent = 0) : QWidget(parent) {}; + void updateAlert(const Alert &a, const QColor &color); + +protected: + void paintEvent(QPaintEvent*) override; + +private: + QColor bg; + Alert alert = {}; +}; + +// container window for the NVG UI +class NvgWindow : public CameraViewWidget { + Q_OBJECT + +public: + explicit NvgWindow(VisionStreamType type, QWidget* parent = 0) : CameraViewWidget("camerad", type, true, parent) {} + +protected: + void paintGL() override; + void initializeGL() override; + void showEvent(QShowEvent *event) override; + void updateFrameMat(int w, int h) override; + void drawLaneLines(QPainter &painter, const UIScene &scene); + void drawLead(QPainter &painter, const cereal::ModelDataV2::LeadDataV3::Reader &lead_data, const QPointF &vd); + inline QColor redColor(int alpha = 255) { return QColor(201, 34, 49, alpha); } + double prev_draw_t = 0; +}; + +// container for all onroad widgets +class OnroadWindow : public QWidget { + Q_OBJECT + +public: + OnroadWindow(QWidget* parent = 0); + bool isMapVisible() const { return map && map->isVisible(); } + +private: + void paintEvent(QPaintEvent *event); + void mousePressEvent(QMouseEvent* e) override; + OnroadHud *hud; + OnroadAlerts *alerts; + NvgWindow *nvg; + QColor bg = bg_colors[STATUS_DISENGAGED]; + QWidget *map = nullptr; + QHBoxLayout* split; + +private slots: + void offroadTransition(bool offroad); + void updateState(const UIState &s); +}; diff --git a/selfdrive/ui/qt/qt_window.cc b/selfdrive/ui/qt/qt_window.cc new file mode 100644 index 000000000..d630b560b --- /dev/null +++ b/selfdrive/ui/qt/qt_window.cc @@ -0,0 +1,30 @@ +#include "selfdrive/ui/qt/qt_window.h" + +void setMainWindow(QWidget *w) { + const QSize sz = QGuiApplication::primaryScreen()->size(); + if (Hardware::PC() && sz.width() <= 1920 && sz.height() <= 1080 && getenv("SCALE") == nullptr) { + w->setMinimumSize(QSize(640, 480)); // allow resize smaller than fullscreen + w->setMaximumSize(QSize(2160, 1080)); + w->resize(sz); + } else { + const float scale = util::getenv("SCALE", 1.0f); + const bool wide = (sz.width() >= WIDE_WIDTH) ^ (getenv("INVERT_WIDTH") != NULL); + w->setFixedSize(QSize(wide ? WIDE_WIDTH : 1920, 1080) * scale); + } + w->show(); + +#ifdef QCOM2 + QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); + wl_surface *s = reinterpret_cast(native->nativeResourceForWindow("surface", w->windowHandle())); + wl_surface_set_buffer_transform(s, WL_OUTPUT_TRANSFORM_270); + wl_surface_commit(s); + w->showFullScreen(); +#endif +} + + +extern "C" { + void set_main_window(void *w) { + setMainWindow((QWidget*)w); + } +} diff --git a/selfdrive/ui/qt/qt_window.h b/selfdrive/ui/qt/qt_window.h new file mode 100644 index 000000000..2c9a24e55 --- /dev/null +++ b/selfdrive/ui/qt/qt_window.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include +#include +#include + +#ifdef QCOM2 +#include +#include +#include +#endif + +#include "selfdrive/hardware/hw.h" + +const QString ASSET_PATH = ":/"; + +const int WIDE_WIDTH = 2160; + +void setMainWindow(QWidget *w); diff --git a/selfdrive/ui/qt/request_repeater.cc b/selfdrive/ui/qt/request_repeater.cc new file mode 100644 index 000000000..7ef1c833a --- /dev/null +++ b/selfdrive/ui/qt/request_repeater.cc @@ -0,0 +1,27 @@ +#include "selfdrive/ui/qt/request_repeater.h" + +RequestRepeater::RequestRepeater(QObject *parent, const QString &requestURL, const QString &cacheKey, + int period, bool while_onroad) : HttpRequest(parent) { + timer = new QTimer(this); + timer->setTimerType(Qt::VeryCoarseTimer); + QObject::connect(timer, &QTimer::timeout, [=]() { + if ((!uiState()->scene.started || while_onroad) && uiState()->awake && !active()) { + sendRequest(requestURL); + } + }); + + timer->start(period * 1000); + + if (!cacheKey.isEmpty()) { + prevResp = QString::fromStdString(params.get(cacheKey.toStdString())); + if (!prevResp.isEmpty()) { + QTimer::singleShot(500, [=]() { emit requestDone(prevResp, true); }); + } + QObject::connect(this, &HttpRequest::requestDone, [=](const QString &resp, bool success) { + if (success && resp != prevResp) { + params.put(cacheKey.toStdString(), resp.toStdString()); + prevResp = resp; + } + }); + } +} diff --git a/selfdrive/ui/qt/request_repeater.h b/selfdrive/ui/qt/request_repeater.h new file mode 100644 index 000000000..fa80100d2 --- /dev/null +++ b/selfdrive/ui/qt/request_repeater.h @@ -0,0 +1,15 @@ +#pragma once + +#include "selfdrive/common/util.h" +#include "selfdrive/ui/qt/api.h" +#include "selfdrive/ui/ui.h" + +class RequestRepeater : public HttpRequest { +public: + RequestRepeater(QObject *parent, const QString &requestURL, const QString &cacheKey = "", int period = 0, bool while_onroad=false); + +private: + Params params; + QTimer *timer; + QString prevResp; +}; diff --git a/selfdrive/ui/qt/sidebar.cc b/selfdrive/ui/qt/sidebar.cc new file mode 100644 index 000000000..cdff1fce8 --- /dev/null +++ b/selfdrive/ui/qt/sidebar.cc @@ -0,0 +1,115 @@ +#include "selfdrive/ui/qt/sidebar.h" + +#include + +#include "selfdrive/ui/qt/util.h" + +void Sidebar::drawMetric(QPainter &p, const QString &label, QColor c, int y) { + const QRect rect = {30, y, 240, label.contains("\n") ? 124 : 100}; + + p.setPen(Qt::NoPen); + p.setBrush(QBrush(c)); + p.setClipRect(rect.x() + 6, rect.y(), 18, rect.height(), Qt::ClipOperation::ReplaceClip); + p.drawRoundedRect(QRect(rect.x() + 6, rect.y() + 6, 100, rect.height() - 12), 10, 10); + p.setClipping(false); + + QPen pen = QPen(QColor(0xff, 0xff, 0xff, 0x55)); + pen.setWidth(2); + p.setPen(pen); + p.setBrush(Qt::NoBrush); + p.drawRoundedRect(rect, 20, 20); + + p.setPen(QColor(0xff, 0xff, 0xff)); + configFont(p, "Open Sans", 35, "Bold"); + const QRect r = QRect(rect.x() + 30, rect.y(), rect.width() - 40, rect.height()); + p.drawText(r, Qt::AlignCenter, label); +} + +Sidebar::Sidebar(QWidget *parent) : QFrame(parent) { + home_img = loadPixmap("../assets/images/button_home.png", {180, 180}); + settings_img = loadPixmap("../assets/images/button_settings.png", settings_btn.size(), Qt::IgnoreAspectRatio); + + connect(this, &Sidebar::valueChanged, [=] { update(); }); + + setAttribute(Qt::WA_OpaquePaintEvent); + setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); + setFixedWidth(300); + + QObject::connect(uiState(), &UIState::uiUpdate, this, &Sidebar::updateState); +} + +void Sidebar::mouseReleaseEvent(QMouseEvent *event) { + if (settings_btn.contains(event->pos())) { + emit openSettings(); + } +} + +void Sidebar::updateState(const UIState &s) { + if (!isVisible()) return; + + auto &sm = *(s.sm); + + auto deviceState = sm["deviceState"].getDeviceState(); + setProperty("netType", network_type[deviceState.getNetworkType()]); + int strength = (int)deviceState.getNetworkStrength(); + setProperty("netStrength", strength > 0 ? strength + 1 : 0); + + ItemStatus connectStatus; + auto last_ping = deviceState.getLastAthenaPingTime(); + if (last_ping == 0) { + connectStatus = params.getBool("PrimeRedirected") ? ItemStatus{"NO\nPRIME", danger_color} : ItemStatus{"CONNECT\nOFFLINE", warning_color}; + } else { + connectStatus = nanos_since_boot() - last_ping < 80e9 ? ItemStatus{"CONNECT\nONLINE", good_color} : ItemStatus{"CONNECT\nERROR", danger_color}; + } + setProperty("connectStatus", QVariant::fromValue(connectStatus)); + + ItemStatus tempStatus = {"TEMP\nHIGH", danger_color}; + auto ts = deviceState.getThermalStatus(); + if (ts == cereal::DeviceState::ThermalStatus::GREEN) { + tempStatus = {"TEMP\nGOOD", good_color}; + } else if (ts == cereal::DeviceState::ThermalStatus::YELLOW) { + tempStatus = {"TEMP\nOK", warning_color}; + } + setProperty("tempStatus", QVariant::fromValue(tempStatus)); + + ItemStatus pandaStatus = {"VEHICLE\nONLINE", good_color}; + if (s.scene.pandaType == cereal::PandaState::PandaType::UNKNOWN) { + pandaStatus = {"NO\nPANDA", danger_color}; + } else if (s.scene.started && !sm["liveLocationKalman"].getLiveLocationKalman().getGpsOK()) { + pandaStatus = {"GPS\nSEARCHING", warning_color}; + } + setProperty("pandaStatus", QVariant::fromValue(pandaStatus)); +} + +void Sidebar::paintEvent(QPaintEvent *event) { + QPainter p(this); + p.setPen(Qt::NoPen); + p.setRenderHint(QPainter::Antialiasing); + + p.fillRect(rect(), QColor(57, 57, 57)); + + // static imgs + p.setOpacity(0.65); + p.drawPixmap(settings_btn.x(), settings_btn.y(), settings_img); + p.setOpacity(1.0); + p.drawPixmap(60, 1080 - 180 - 40, home_img); + + // network + int x = 58; + const QColor gray(0x54, 0x54, 0x54); + for (int i = 0; i < 5; ++i) { + p.setBrush(i < net_strength ? Qt::white : gray); + p.drawEllipse(x, 196, 27, 27); + x += 37; + } + + configFont(p, "Open Sans", 35, "Regular"); + p.setPen(QColor(0xff, 0xff, 0xff)); + const QRect r = QRect(50, 247, 100, 50); + p.drawText(r, Qt::AlignCenter, net_type); + + // metrics + drawMetric(p, temp_status.first, temp_status.second, 338); + drawMetric(p, panda_status.first, panda_status.second, 496); + drawMetric(p, connect_status.first, connect_status.second, 654); +} diff --git a/selfdrive/ui/qt/sidebar.h b/selfdrive/ui/qt/sidebar.h new file mode 100644 index 000000000..5d1b92175 --- /dev/null +++ b/selfdrive/ui/qt/sidebar.h @@ -0,0 +1,55 @@ +#pragma once + +#include +#include + +#include "selfdrive/common/params.h" +#include "selfdrive/ui/ui.h" + +typedef QPair ItemStatus; +Q_DECLARE_METATYPE(ItemStatus); + +class Sidebar : public QFrame { + Q_OBJECT + Q_PROPERTY(ItemStatus connectStatus MEMBER connect_status NOTIFY valueChanged); + Q_PROPERTY(ItemStatus pandaStatus MEMBER panda_status NOTIFY valueChanged); + Q_PROPERTY(ItemStatus tempStatus MEMBER temp_status NOTIFY valueChanged); + Q_PROPERTY(QString netType MEMBER net_type NOTIFY valueChanged); + Q_PROPERTY(int netStrength MEMBER net_strength NOTIFY valueChanged); + +public: + explicit Sidebar(QWidget* parent = 0); + +signals: + void openSettings(); + void valueChanged(); + +public slots: + void updateState(const UIState &s); + +protected: + void paintEvent(QPaintEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void drawMetric(QPainter &p, const QString &label, QColor c, int y); + + QPixmap home_img, settings_img; + const QMap network_type = { + {cereal::DeviceState::NetworkType::NONE, "--"}, + {cereal::DeviceState::NetworkType::WIFI, "Wi-Fi"}, + {cereal::DeviceState::NetworkType::ETHERNET, "ETH"}, + {cereal::DeviceState::NetworkType::CELL2_G, "2G"}, + {cereal::DeviceState::NetworkType::CELL3_G, "3G"}, + {cereal::DeviceState::NetworkType::CELL4_G, "LTE"}, + {cereal::DeviceState::NetworkType::CELL5_G, "5G"} + }; + + const QRect settings_btn = QRect(50, 35, 200, 117); + const QColor good_color = QColor(255, 255, 255); + const QColor warning_color = QColor(218, 202, 37); + const QColor danger_color = QColor(201, 34, 49); + + Params params; + ItemStatus connect_status, panda_status, temp_status; + QString net_type; + int net_strength = 0; +}; diff --git a/selfdrive/ui/qt/spinner b/selfdrive/ui/qt/spinner new file mode 100755 index 000000000..5658ae87a Binary files /dev/null and b/selfdrive/ui/qt/spinner differ diff --git a/selfdrive/ui/qt/spinner.cc b/selfdrive/ui/qt/spinner.cc new file mode 100644 index 000000000..b9868f603 --- /dev/null +++ b/selfdrive/ui/qt/spinner.cc @@ -0,0 +1,119 @@ +#include "selfdrive/ui/qt/spinner.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "selfdrive/hardware/hw.h" +#include "selfdrive/ui/qt/qt_window.h" +#include "selfdrive/ui/qt/util.h" + +TrackWidget::TrackWidget(QWidget *parent) : QWidget(parent) { + setAttribute(Qt::WA_OpaquePaintEvent); + setFixedSize(spinner_size); + + // pre-compute all the track imgs. make this a gif instead? + QPixmap comma_img = loadPixmap("../assets/img_spinner_comma.png", spinner_size); + QPixmap track_img = loadPixmap("../assets/img_spinner_track.png", spinner_size); + + QTransform transform(1, 0, 0, 1, width() / 2, height() / 2); + QPixmap pm(spinner_size); + QPainter p(&pm); + p.setRenderHint(QPainter::SmoothPixmapTransform); + for (int i = 0; i < track_imgs.size(); ++i) { + p.resetTransform(); + p.fillRect(0, 0, spinner_size.width(), spinner_size.height(), Qt::black); + p.drawPixmap(0, 0, comma_img); + p.setTransform(transform.rotate(360 / spinner_fps)); + p.drawPixmap(-width() / 2, -height() / 2, track_img); + track_imgs[i] = pm.copy(); + } + + m_anim.setDuration(1000); + m_anim.setStartValue(0); + m_anim.setEndValue(int(track_imgs.size() -1)); + m_anim.setLoopCount(-1); + m_anim.start(); + connect(&m_anim, SIGNAL(valueChanged(QVariant)), SLOT(update())); +} + +void TrackWidget::paintEvent(QPaintEvent *event) { + QPainter painter(this); + painter.drawPixmap(0, 0, track_imgs[m_anim.currentValue().toInt()]); +} + +// Spinner + +Spinner::Spinner(QWidget *parent) : QWidget(parent) { + QGridLayout *main_layout = new QGridLayout(this); + main_layout->setSpacing(0); + main_layout->setMargin(200); + + main_layout->addWidget(new TrackWidget(this), 0, 0, Qt::AlignHCenter | Qt::AlignVCenter); + + text = new QLabel(); + text->setWordWrap(true); + text->setVisible(false); + text->setAlignment(Qt::AlignCenter); + main_layout->addWidget(text, 1, 0, Qt::AlignHCenter); + + progress_bar = new QProgressBar(); + progress_bar->setRange(5, 100); + progress_bar->setTextVisible(false); + progress_bar->setVisible(false); + progress_bar->setFixedHeight(20); + main_layout->addWidget(progress_bar, 1, 0, Qt::AlignHCenter); + + setStyleSheet(R"( + Spinner { + background-color: black; + } + QLabel { + color: white; + font-size: 80px; + background-color: transparent; + } + QProgressBar { + background-color: #373737; + width: 1000px; + border solid white; + border-radius: 10px; + } + QProgressBar::chunk { + border-radius: 10px; + background-color: white; + } + )"); + + notifier = new QSocketNotifier(fileno(stdin), QSocketNotifier::Read); + QObject::connect(notifier, &QSocketNotifier::activated, this, &Spinner::update); +}; + +void Spinner::update(int n) { + std::string line; + std::getline(std::cin, line); + + if (line.length()) { + bool number = std::all_of(line.begin(), line.end(), ::isdigit); + text->setVisible(!number); + progress_bar->setVisible(number); + text->setText(QString::fromStdString(line)); + if (number) { + progress_bar->setValue(std::stoi(line)); + } + } +} + +int main(int argc, char *argv[]) { + initApp(); + QApplication a(argc, argv); + Spinner spinner; + setMainWindow(&spinner); + return a.exec(); +} diff --git a/selfdrive/ui/qt/spinner.h b/selfdrive/ui/qt/spinner.h new file mode 100644 index 000000000..43d90a75b --- /dev/null +++ b/selfdrive/ui/qt/spinner.h @@ -0,0 +1,37 @@ +#include + +#include +#include +#include +#include +#include +#include + +constexpr int spinner_fps = 30; +constexpr QSize spinner_size = QSize(360, 360); + +class TrackWidget : public QWidget { + Q_OBJECT +public: + TrackWidget(QWidget *parent = nullptr); + +private: + void paintEvent(QPaintEvent *event) override; + std::array track_imgs; + QVariantAnimation m_anim; +}; + +class Spinner : public QWidget { + Q_OBJECT + +public: + explicit Spinner(QWidget *parent = 0); + +private: + QLabel *text; + QProgressBar *progress_bar; + QSocketNotifier *notifier; + +public slots: + void update(int n); +}; diff --git a/selfdrive/ui/qt/spinner_aarch64 b/selfdrive/ui/qt/spinner_aarch64 new file mode 100755 index 000000000..a1fa69566 Binary files /dev/null and b/selfdrive/ui/qt/spinner_aarch64 differ diff --git a/selfdrive/ui/qt/text b/selfdrive/ui/qt/text new file mode 100755 index 000000000..9105daa90 Binary files /dev/null and b/selfdrive/ui/qt/text differ diff --git a/selfdrive/ui/qt/text.cc b/selfdrive/ui/qt/text.cc new file mode 100644 index 000000000..cb69cc082 --- /dev/null +++ b/selfdrive/ui/qt/text.cc @@ -0,0 +1,64 @@ +#include +#include +#include +#include +#include +#include + +#include "selfdrive/hardware/hw.h" +#include "selfdrive/ui/qt/util.h" +#include "selfdrive/ui/qt/qt_window.h" +#include "selfdrive/ui/qt/widgets/scrollview.h" + +int main(int argc, char *argv[]) { + initApp(); + QApplication a(argc, argv); + QWidget window; + setMainWindow(&window); + + QGridLayout *main_layout = new QGridLayout(&window); + main_layout->setMargin(50); + + QLabel *label = new QLabel(argv[1]); + label->setWordWrap(true); + label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); + ScrollView *scroll = new ScrollView(label); + scroll->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + main_layout->addWidget(scroll, 0, 0, Qt::AlignTop); + + // Scroll to the bottom + QObject::connect(scroll->verticalScrollBar(), &QAbstractSlider::rangeChanged, [=]() { + scroll->verticalScrollBar()->setValue(scroll->verticalScrollBar()->maximum()); + }); + + QPushButton *btn = new QPushButton(); +#ifdef __aarch64__ + btn->setText("Reboot"); + QObject::connect(btn, &QPushButton::clicked, [=]() { + Hardware::reboot(); + }); +#else + btn->setText("Exit"); + QObject::connect(btn, &QPushButton::clicked, &a, &QApplication::quit); +#endif + main_layout->addWidget(btn, 0, 0, Qt::AlignRight | Qt::AlignBottom); + + window.setStyleSheet(R"( + * { + outline: none; + color: white; + background-color: black; + font-size: 60px; + } + QPushButton { + padding: 50px; + padding-right: 100px; + padding-left: 100px; + border: 2px solid white; + border-radius: 20px; + margin-right: 40px; + } + )"); + + return a.exec(); +} diff --git a/selfdrive/ui/qt/text_aarch64 b/selfdrive/ui/qt/text_aarch64 new file mode 100755 index 000000000..f4f770afd Binary files /dev/null and b/selfdrive/ui/qt/text_aarch64 differ diff --git a/selfdrive/ui/qt/util.cc b/selfdrive/ui/qt/util.cc new file mode 100644 index 000000000..1b826a9c2 --- /dev/null +++ b/selfdrive/ui/qt/util.cc @@ -0,0 +1,131 @@ +#include "selfdrive/ui/qt/util.h" + +#include +#include +#include + +#include "selfdrive/common/params.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/hardware/hw.h" + +QString getVersion() { + static QString version = QString::fromStdString(Params().get("Version")); + return version; +} + +QString getBrand() { + return Params().getBool("Passive") ? "dashcam" : "Tinkla OP"; +} + +QString getBrandVersion() { + return getBrand() + " v" + getVersion().left(14).trimmed(); +} + +QString getUserAgent() { + return "openpilot-" + getVersion(); +} + +std::optional getDongleId() { + std::string id = Params().get("DongleId"); + + if (!id.empty() && (id != "UnregisteredDevice")) { + return QString::fromStdString(id); + } else { + return {}; + } +} + +void configFont(QPainter &p, const QString &family, int size, const QString &style) { + QFont f(family); + f.setPixelSize(size); + f.setStyleName(style); + p.setFont(f); +} + +void clearLayout(QLayout* layout) { + while (QLayoutItem* item = layout->takeAt(0)) { + if (QWidget* widget = item->widget()) { + widget->deleteLater(); + } + if (QLayout* childLayout = item->layout()) { + clearLayout(childLayout); + } + delete item; + } +} + +QString timeAgo(const QDateTime &date) { + int diff = date.secsTo(QDateTime::currentDateTimeUtc()); + + QString s; + if (diff < 60) { + s = "now"; + } else if (diff < 60 * 60) { + int minutes = diff / 60; + s = QString("%1 minute%2 ago").arg(minutes).arg(minutes > 1 ? "s" : ""); + } else if (diff < 60 * 60 * 24) { + int hours = diff / (60 * 60); + s = QString("%1 hour%2 ago").arg(hours).arg(hours > 1 ? "s" : ""); + } else if (diff < 3600 * 24 * 7) { + int days = diff / (60 * 60 * 24); + s = QString("%1 day%2 ago").arg(days).arg(days > 1 ? "s" : ""); + } else { + s = date.date().toString(); + } + + return s; +} + +void setQtSurfaceFormat() { + QSurfaceFormat fmt; +#ifdef __APPLE__ + fmt.setVersion(3, 2); + fmt.setProfile(QSurfaceFormat::OpenGLContextProfile::CoreProfile); + fmt.setRenderableType(QSurfaceFormat::OpenGL); +#else + fmt.setRenderableType(QSurfaceFormat::OpenGLES); +#endif + fmt.setSamples(16); + QSurfaceFormat::setDefaultFormat(fmt); +} + +void initApp() { + Hardware::set_display_power(true); + Hardware::set_brightness(65); + setQtSurfaceFormat(); + if (Hardware::EON()) { + QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); + } +} + +void swagLogMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) { + static std::map levels = { + {QtMsgType::QtDebugMsg, CLOUDLOG_DEBUG}, + {QtMsgType::QtInfoMsg, CLOUDLOG_INFO}, + {QtMsgType::QtWarningMsg, CLOUDLOG_WARNING}, + {QtMsgType::QtCriticalMsg, CLOUDLOG_ERROR}, + {QtMsgType::QtSystemMsg, CLOUDLOG_ERROR}, + {QtMsgType::QtFatalMsg, CLOUDLOG_CRITICAL}, + }; + + std::string file, function; + if (context.file != nullptr) file = context.file; + if (context.function != nullptr) function = context.function; + + auto bts = msg.toUtf8(); + cloudlog_e(levels[type], file.c_str(), context.line, function.c_str(), "%s", bts.constData()); +} + + +QWidget* topWidget (QWidget* widget) { + while (widget->parentWidget() != nullptr) widget=widget->parentWidget(); + return widget; +} + +QPixmap loadPixmap(const QString &fileName, const QSize &size, Qt::AspectRatioMode aspectRatioMode) { + if (size.isEmpty()) { + return QPixmap(fileName); + } else { + return QPixmap(fileName).scaled(size, aspectRatioMode, Qt::SmoothTransformation); + } +} diff --git a/selfdrive/ui/qt/util.h b/selfdrive/ui/qt/util.h new file mode 100644 index 000000000..1b9461fab --- /dev/null +++ b/selfdrive/ui/qt/util.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include +#include +#include +#include +#include +#include + +QString getVersion(); +QString getBrand(); +QString getBrandVersion(); +QString getUserAgent(); +std::optional getDongleId(); +void configFont(QPainter &p, const QString &family, int size, const QString &style); +void clearLayout(QLayout* layout); +void setQtSurfaceFormat(); +QString timeAgo(const QDateTime &date); +void swagLogMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg); +void initApp(); +QWidget* topWidget (QWidget* widget); +QPixmap loadPixmap(const QString &fileName, const QSize &size = {}, Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio); diff --git a/selfdrive/ui/qt/widgets/cameraview.cc b/selfdrive/ui/qt/widgets/cameraview.cc new file mode 100644 index 000000000..fbd425b02 --- /dev/null +++ b/selfdrive/ui/qt/widgets/cameraview.cc @@ -0,0 +1,332 @@ +#include "selfdrive/ui/qt/widgets/cameraview.h" + +#ifdef __APPLE__ +#include +#else +#include +#endif + +#include +#include + +namespace { + +const char frame_vertex_shader[] = +#ifdef __APPLE__ + "#version 150 core\n" +#else + "#version 300 es\n" +#endif + "in vec4 aPosition;\n" + "in vec4 aTexCoord;\n" + "uniform mat4 uTransform;\n" + "out vec4 vTexCoord;\n" + "void main() {\n" + " gl_Position = uTransform * aPosition;\n" + " vTexCoord = aTexCoord;\n" + "}\n"; + +const char frame_fragment_shader[] = +#ifdef __APPLE__ + "#version 150 core\n" +#else + "#version 300 es\n" + "precision mediump float;\n" +#endif + "uniform sampler2D uTexture;\n" + "in vec4 vTexCoord;\n" + "out vec4 colorOut;\n" + "void main() {\n" + " colorOut = texture(uTexture, vTexCoord.xy);\n" +#ifdef QCOM + " vec3 dz = vec3(0.0627f, 0.0627f, 0.0627f);\n" + " colorOut.rgb = ((vec3(1.0f, 1.0f, 1.0f) - dz) * colorOut.rgb / vec3(1.0f, 1.0f, 1.0f)) + dz;\n" +#endif + "}\n"; + +const mat4 device_transform = {{ + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0, +}}; + +mat4 get_driver_view_transform(int screen_width, int screen_height, int stream_width, int stream_height) { + const float driver_view_ratio = 1.333; + mat4 transform; + if (stream_width == TICI_CAM_WIDTH) { + const float yscale = stream_height * driver_view_ratio / tici_dm_crop::width; + const float xscale = yscale*screen_height/screen_width*stream_width/stream_height; + transform = (mat4){{ + xscale, 0.0, 0.0, xscale*tici_dm_crop::x_offset/stream_width*2, + 0.0, yscale, 0.0, yscale*tici_dm_crop::y_offset/stream_height*2, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0, + }}; + } else { + // frame from 4/3 to 16/9 display + transform = (mat4){{ + driver_view_ratio * screen_height / screen_width, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0, + }}; + } + return transform; +} + +mat4 get_fit_view_transform(float widget_aspect_ratio, float frame_aspect_ratio) { + float zx = 1, zy = 1; + if (frame_aspect_ratio > widget_aspect_ratio) { + zy = widget_aspect_ratio / frame_aspect_ratio; + } else { + zx = frame_aspect_ratio / widget_aspect_ratio; + } + + const mat4 frame_transform = {{ + zx, 0.0, 0.0, 0.0, + 0.0, zy, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0, + }}; + return frame_transform; +} + +} // namespace + +CameraViewWidget::CameraViewWidget(std::string stream_name, VisionStreamType type, bool zoom, QWidget* parent) : + stream_name(stream_name), stream_type(type), zoomed_view(zoom), QOpenGLWidget(parent) { + setAttribute(Qt::WA_OpaquePaintEvent); + connect(this, &CameraViewWidget::vipcThreadConnected, this, &CameraViewWidget::vipcConnected, Qt::BlockingQueuedConnection); +} + +CameraViewWidget::~CameraViewWidget() { + makeCurrent(); + if (isValid()) { + glDeleteVertexArrays(1, &frame_vao); + glDeleteBuffers(1, &frame_vbo); + glDeleteBuffers(1, &frame_ibo); + } + doneCurrent(); +} + +void CameraViewWidget::initializeGL() { + initializeOpenGLFunctions(); + + program = std::make_unique(context()); + bool ret = program->addShaderFromSourceCode(QOpenGLShader::Vertex, frame_vertex_shader); + assert(ret); + ret = program->addShaderFromSourceCode(QOpenGLShader::Fragment, frame_fragment_shader); + assert(ret); + + program->link(); + GLint frame_pos_loc = program->attributeLocation("aPosition"); + GLint frame_texcoord_loc = program->attributeLocation("aTexCoord"); + + auto [x1, x2, y1, y2] = stream_type == VISION_STREAM_RGB_FRONT ? std::tuple(0.f, 1.f, 1.f, 0.f) : std::tuple(1.f, 0.f, 1.f, 0.f); + const uint8_t frame_indicies[] = {0, 1, 2, 0, 2, 3}; + const float frame_coords[4][4] = { + {-1.0, -1.0, x2, y1}, // bl + {-1.0, 1.0, x2, y2}, // tl + { 1.0, 1.0, x1, y2}, // tr + { 1.0, -1.0, x1, y1}, // br + }; + + glGenVertexArrays(1, &frame_vao); + glBindVertexArray(frame_vao); + glGenBuffers(1, &frame_vbo); + glBindBuffer(GL_ARRAY_BUFFER, frame_vbo); + glBufferData(GL_ARRAY_BUFFER, sizeof(frame_coords), frame_coords, GL_STATIC_DRAW); + glEnableVertexAttribArray(frame_pos_loc); + glVertexAttribPointer(frame_pos_loc, 2, GL_FLOAT, GL_FALSE, + sizeof(frame_coords[0]), (const void *)0); + glEnableVertexAttribArray(frame_texcoord_loc); + glVertexAttribPointer(frame_texcoord_loc, 2, GL_FLOAT, GL_FALSE, + sizeof(frame_coords[0]), (const void *)(sizeof(float) * 2)); + glGenBuffers(1, &frame_ibo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, frame_ibo); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(frame_indicies), frame_indicies, GL_STATIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindVertexArray(0); +} + +void CameraViewWidget::showEvent(QShowEvent *event) { + latest_texture_id = -1; + if (!vipc_thread) { + vipc_thread = new QThread(); + connect(vipc_thread, &QThread::started, [=]() { vipcThread(); }); + connect(vipc_thread, &QThread::finished, vipc_thread, &QObject::deleteLater); + vipc_thread->start(); + } +} + +void CameraViewWidget::hideEvent(QHideEvent *event) { + if (vipc_thread) { + vipc_thread->requestInterruption(); + vipc_thread->quit(); + vipc_thread->wait(); + vipc_thread = nullptr; + } +} + +void CameraViewWidget::updateFrameMat(int w, int h) { + if (zoomed_view) { + if (stream_type == VISION_STREAM_RGB_FRONT) { + frame_mat = matmul(device_transform, get_driver_view_transform(w, h, stream_width, stream_height)); + } else { + auto intrinsic_matrix = stream_type == VISION_STREAM_RGB_WIDE ? ecam_intrinsic_matrix : fcam_intrinsic_matrix; + float zoom = ZOOM / intrinsic_matrix.v[0]; + if (stream_type == VISION_STREAM_RGB_WIDE) { + zoom *= 0.5; + } + float zx = zoom * 2 * intrinsic_matrix.v[2] / width(); + float zy = zoom * 2 * intrinsic_matrix.v[5] / height(); + + const mat4 frame_transform = {{ + zx, 0.0, 0.0, 0.0, + 0.0, zy, 0.0, -y_offset / height() * 2, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0, + }}; + frame_mat = matmul(device_transform, frame_transform); + } + } else if (stream_width > 0 && stream_height > 0) { + // fit frame to widget size + float widget_aspect_ratio = (float)width() / height(); + float frame_aspect_ratio = (float)stream_width / stream_height; + frame_mat = matmul(device_transform, get_fit_view_transform(widget_aspect_ratio, frame_aspect_ratio)); + } +} + +void CameraViewWidget::paintGL() { + glClearColor(bg.redF(), bg.greenF(), bg.blueF(), bg.alphaF()); + glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT); + + std::lock_guard lk(lock); + + if (latest_texture_id == -1) return; + + glViewport(0, 0, width(), height()); + // sync with the PBO + if (wait_fence) { + wait_fence->wait(); + } + + glBindVertexArray(frame_vao); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, texture[latest_texture_id]->frame_tex); + + glUseProgram(program->programId()); + glUniform1i(program->uniformLocation("uTexture"), 0); + glUniformMatrix4fv(program->uniformLocation("uTransform"), 1, GL_TRUE, frame_mat.v); + + assert(glGetError() == GL_NO_ERROR); + glEnableVertexAttribArray(0); + glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, (const void *)0); + glDisableVertexAttribArray(0); + glBindVertexArray(0); +} + +void CameraViewWidget::vipcConnected(VisionIpcClient *vipc_client) { + makeCurrent(); + for (int i = 0; i < vipc_client->num_buffers; i++) { + texture[i].reset(new EGLImageTexture(&vipc_client->buffers[i])); + + glBindTexture(GL_TEXTURE_2D, texture[i]->frame_tex); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + + // BGR + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED); + assert(glGetError() == GL_NO_ERROR); + } + latest_texture_id = -1; + stream_width = vipc_client->buffers[0].width; + stream_height = vipc_client->buffers[0].height; + updateFrameMat(width(), height()); +} + +void CameraViewWidget::vipcThread() { + VisionStreamType cur_stream_type = stream_type; + std::unique_ptr vipc_client; + + std::unique_ptr ctx; + std::unique_ptr surface; + std::unique_ptr gl_buffer; + + if (!Hardware::EON()) { + ctx = std::make_unique(); + ctx->setFormat(context()->format()); + ctx->setShareContext(context()); + ctx->create(); + assert(ctx->isValid()); + + surface = std::make_unique(); + surface->setFormat(ctx->format()); + surface->create(); + ctx->makeCurrent(surface.get()); + assert(QOpenGLContext::currentContext() == ctx.get()); + initializeOpenGLFunctions(); + } + + while (!QThread::currentThread()->isInterruptionRequested()) { + if (!vipc_client || cur_stream_type != stream_type) { + cur_stream_type = stream_type; + vipc_client.reset(new VisionIpcClient(stream_name, cur_stream_type, true)); + } + + if (!vipc_client->connected) { + if (!vipc_client->connect(false)) { + QThread::msleep(100); + continue; + } + + if (!Hardware::EON()) { + gl_buffer.reset(new QOpenGLBuffer(QOpenGLBuffer::PixelUnpackBuffer)); + gl_buffer->create(); + gl_buffer->bind(); + gl_buffer->setUsagePattern(QOpenGLBuffer::StreamDraw); + gl_buffer->allocate(vipc_client->buffers[0].len); + } + + emit vipcThreadConnected(vipc_client.get()); + } + + if (VisionBuf *buf = vipc_client->recv(nullptr, 1000)) { + { + std::lock_guard lk(lock); + if (!Hardware::EON()) { + void *texture_buffer = gl_buffer->map(QOpenGLBuffer::WriteOnly); + + if (texture_buffer == nullptr) { + LOGE("gl_buffer->map returned nullptr"); + continue; + } + + memcpy(texture_buffer, buf->addr, buf->len); + gl_buffer->unmap(); + + // copy pixels from PBO to texture object + glBindTexture(GL_TEXTURE_2D, texture[buf->idx]->frame_tex); + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, buf->width, buf->height, GL_RGB, GL_UNSIGNED_BYTE, 0); + glBindTexture(GL_TEXTURE_2D, 0); + assert(glGetError() == GL_NO_ERROR); + + wait_fence.reset(new WaitFence()); + + // Ensure the fence is in the GPU command queue, or waiting on it might block + // https://www.khronos.org/opengl/wiki/Sync_Object#Flushing_and_contexts + glFlush(); + } + latest_texture_id = buf->idx; + } + // Schedule update. update() will be invoked on the gui thread. + QMetaObject::invokeMethod(this, "update"); + + // TODO: remove later, it's only connected by DriverView. + emit vipcThreadFrameReceived(buf); + } + } +} diff --git a/selfdrive/ui/qt/widgets/cameraview.h b/selfdrive/ui/qt/widgets/cameraview.h new file mode 100644 index 000000000..03709cbdd --- /dev/null +++ b/selfdrive/ui/qt/widgets/cameraview.h @@ -0,0 +1,64 @@ +#pragma once + +#include + +#include +#include +#include +#include +#include "cereal/visionipc/visionipc_client.h" +#include "selfdrive/camerad/cameras/camera_common.h" +#include "selfdrive/common/visionimg.h" +#include "selfdrive/ui/ui.h" + +class CameraViewWidget : public QOpenGLWidget, protected QOpenGLFunctions { + Q_OBJECT + +public: + using QOpenGLWidget::QOpenGLWidget; + explicit CameraViewWidget(std::string stream_name, VisionStreamType stream_type, bool zoom, QWidget* parent = nullptr); + ~CameraViewWidget(); + void setStreamType(VisionStreamType type) { stream_type = type; } + void setBackgroundColor(const QColor &color) { bg = color; } + +signals: + void clicked(); + void vipcThreadConnected(VisionIpcClient *); + void vipcThreadFrameReceived(VisionBuf *); + +protected: + void paintGL() override; + void initializeGL() override; + void resizeGL(int w, int h) override { updateFrameMat(w, h); } + void showEvent(QShowEvent *event) override; + void hideEvent(QHideEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override { emit clicked(); } + virtual void updateFrameMat(int w, int h); + void vipcThread(); + + struct WaitFence { + WaitFence() { sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); } + ~WaitFence() { glDeleteSync(sync); } + void wait() { glWaitSync(sync, 0, GL_TIMEOUT_IGNORED); } + GLsync sync = 0; + }; + + bool zoomed_view; + std::mutex lock; + int latest_texture_id = -1; + GLuint frame_vao, frame_vbo, frame_ibo; + mat4 frame_mat; + std::unique_ptr texture[UI_BUF_COUNT]; + std::unique_ptr wait_fence; + std::unique_ptr program; + QColor bg = QColor("#000000"); + + std::string stream_name; + int stream_width = 0; + int stream_height = 0; + std::atomic stream_type; + QThread *vipc_thread = nullptr; + +protected slots: + void vipcConnected(VisionIpcClient *vipc_client); +}; diff --git a/selfdrive/ui/qt/widgets/controls.cc b/selfdrive/ui/qt/widgets/controls.cc new file mode 100644 index 000000000..1e67f30d7 --- /dev/null +++ b/selfdrive/ui/qt/widgets/controls.cc @@ -0,0 +1,137 @@ +#include "selfdrive/ui/qt/widgets/controls.h" +#include "selfdrive/car/modules/qt/tcontrols.hpp" +#include +#include + +QFrame *horizontal_line(QWidget *parent) { + QFrame *line = new QFrame(parent); + line->setFrameShape(QFrame::StyledPanel); + line->setStyleSheet(R"( + margin-left: 40px; + margin-right: 40px; + border-width: 1px; + border-bottom-style: solid; + border-color: gray; + )"); + line->setFixedHeight(2); + return line; +} + +AbstractControl::AbstractControl(const QString &title, const QString &desc, const QString &icon, QWidget *parent) : QFrame(parent) { + setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); + + QVBoxLayout *main_layout = new QVBoxLayout(this); + main_layout->setMargin(0); + + hlayout = new QHBoxLayout; + hlayout->setMargin(0); + hlayout->setSpacing(20); + + // left icon + if (!icon.isEmpty()) { + QPixmap pix(icon); + QLabel *icon_label = new QLabel(); + icon_label->setPixmap(pix.scaledToWidth(80, Qt::SmoothTransformation)); + icon_label->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + hlayout->addWidget(icon_label); + } + + // title + title_label = new QPushButton(title); + title_label->setFixedHeight(120); + title_label->setStyleSheet("font-size: 50px; font-weight: 400; text-align: left"); + hlayout->addWidget(title_label); + + main_layout->addLayout(hlayout); + + // description + if (!desc.isEmpty()) { + description = new QLabel(desc); + description->setContentsMargins(40, 20, 40, 20); + description->setStyleSheet("font-size: 40px; color: grey"); + description->setWordWrap(true); + description->setVisible(false); + main_layout->addWidget(description); + + connect(title_label, &QPushButton::clicked, [=]() { + if (!description->isVisible()) { + emit showDescription(); + } + description->setVisible(!description->isVisible()); + }); + } + main_layout->addStretch(); +} + +void AbstractControl::hideEvent(QHideEvent *e) { + if(description != nullptr) { + description->hide(); + } +} + +// controls + +ButtonControl::ButtonControl(const QString &title, const QString &text, const QString &desc, QWidget *parent) : AbstractControl(title, desc, "", parent) { + btn.setText(text); + btn.setStyleSheet(R"( + QPushButton { + padding: 0; + border-radius: 50px; + font-size: 35px; + font-weight: 500; + color: #E4E4E4; + background-color: #393939; + } + QPushButton:pressed { + background-color: #4a4a4a; + } + QPushButton:disabled { + color: #33E4E4E4; + } + )"); + btn.setFixedSize(250, 100); + QObject::connect(&btn, &QPushButton::clicked, this, &ButtonControl::clicked); + hlayout->addWidget(&btn); +} + +// ElidedLabel + +ElidedLabel::ElidedLabel(QWidget *parent) : ElidedLabel({}, parent) {} + +ElidedLabel::ElidedLabel(const QString &text, QWidget *parent) : QLabel(text.trimmed(), parent) { + setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + setMinimumWidth(1); +} + +void ElidedLabel::resizeEvent(QResizeEvent* event) { + QLabel::resizeEvent(event); + lastText_ = elidedText_ = ""; +} + +void ElidedLabel::paintEvent(QPaintEvent *event) { + const QString curText = text(); + if (curText != lastText_) { + elidedText_ = fontMetrics().elidedText(curText, Qt::ElideRight, contentsRect().width()); + lastText_ = curText; + } + + QPainter painter(this); + drawFrame(&painter); + QStyleOption opt; + opt.initFrom(this); + style()->drawItemText(&painter, contentsRect(), alignment(), opt.palette, isEnabled(), elidedText_, foregroundRole()); +} + +ClickableWidget::ClickableWidget(QWidget *parent) : QWidget(parent) { } + +void ClickableWidget::mouseReleaseEvent(QMouseEvent *event) { + emit clicked(); +} + +// Fix stylesheets +void ClickableWidget::paintEvent(QPaintEvent *) { + QStyleOption opt; + opt.init(this); + QPainter p(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); +} diff --git a/selfdrive/ui/qt/widgets/controls.h b/selfdrive/ui/qt/widgets/controls.h new file mode 100644 index 000000000..13cd55ff3 --- /dev/null +++ b/selfdrive/ui/qt/widgets/controls.h @@ -0,0 +1,187 @@ +#pragma once + +#include +#include +#include +#include +#include + +#include "selfdrive/common/params.h" +#include "selfdrive/ui/qt/widgets/toggle.h" + +QFrame *horizontal_line(QWidget *parent = nullptr); + +class ElidedLabel : public QLabel { + Q_OBJECT + +public: + explicit ElidedLabel(QWidget *parent = 0); + explicit ElidedLabel(const QString &text, QWidget *parent = 0); + +signals: + void clicked(); + +protected: + void paintEvent(QPaintEvent *event) override; + void resizeEvent(QResizeEvent* event) override; + void mouseReleaseEvent(QMouseEvent *event) override { emit clicked(); } + QString lastText_, elidedText_; +}; + + +class AbstractControl : public QFrame { + Q_OBJECT + +public: + void setDescription(const QString &desc) { + if (description) description->setText(desc); + } + + void setTitle(const QString &title) { + title_label->setText(title); + } + +signals: + void showDescription(); + +protected: + AbstractControl(const QString &title, const QString &desc = "", const QString &icon = "", QWidget *parent = nullptr); + void hideEvent(QHideEvent *e) override; + + QHBoxLayout *hlayout; + QPushButton *title_label; + QLabel *description = nullptr; +}; + +// widget to display a value +class LabelControl : public AbstractControl { + Q_OBJECT + +public: + LabelControl(const QString &title, const QString &text = "", const QString &desc = "", QWidget *parent = nullptr) : AbstractControl(title, desc, "", parent) { + label.setText(text); + label.setAlignment(Qt::AlignRight | Qt::AlignVCenter); + hlayout->addWidget(&label); + } + void setText(const QString &text) { label.setText(text); } + +private: + ElidedLabel label; +}; + +// widget for a button with a label +class ButtonControl : public AbstractControl { + Q_OBJECT + +public: + ButtonControl(const QString &title, const QString &text, const QString &desc = "", QWidget *parent = nullptr); + inline void setText(const QString &text) { btn.setText(text); } + inline QString text() const { return btn.text(); } + +signals: + void clicked(); + +public slots: + void setEnabled(bool enabled) { btn.setEnabled(enabled); }; + +private: + QPushButton btn; +}; + +class ToggleControl : public AbstractControl { + Q_OBJECT + +public: + ToggleControl(const QString &title, const QString &desc = "", const QString &icon = "", const bool state = false, QWidget *parent = nullptr) : AbstractControl(title, desc, icon, parent) { + toggle.setFixedSize(150, 100); + if (state) { + toggle.togglePosition(); + } + hlayout->addWidget(&toggle); + QObject::connect(&toggle, &Toggle::stateChanged, this, &ToggleControl::toggleFlipped); + } + + void setEnabled(bool enabled) { toggle.setEnabled(enabled); } + +signals: + void toggleFlipped(bool state); + +protected: + Toggle toggle; +}; + +// widget to toggle params +class ParamControl : public ToggleControl { + Q_OBJECT + +public: + ParamControl(const QString ¶m, const QString &title, const QString &desc, const QString &icon, QWidget *parent = nullptr) : ToggleControl(title, desc, icon, false, parent) { + key = param.toStdString(); + QObject::connect(this, &ToggleControl::toggleFlipped, [=](bool state) { + params.putBool(key, state); + }); + } + + void showEvent(QShowEvent *event) override { + if (params.getBool(key) != toggle.on) { + toggle.togglePosition(); + } + }; + +private: + std::string key; + Params params; +}; + +class ListWidget : public QWidget { + Q_OBJECT + public: + explicit ListWidget(QWidget *parent = 0) : QWidget(parent), outer_layout(this) { + outer_layout.setMargin(0); + outer_layout.setSpacing(0); + outer_layout.addLayout(&inner_layout); + inner_layout.setMargin(0); + inner_layout.setSpacing(25); // default spacing is 25 + outer_layout.addStretch(); + } + inline void addItem(QWidget *w) { inner_layout.addWidget(w); } + inline void addItem(QLayout *layout) { inner_layout.addLayout(layout); } + inline void setSpacing(int spacing) { inner_layout.setSpacing(spacing); } + +private: + void paintEvent(QPaintEvent *) override { + QPainter p(this); + p.setPen(Qt::gray); + for (int i = 0; i < inner_layout.count() - 1; ++i) { + QRect r = inner_layout.itemAt(i)->geometry(); + int bottom = r.bottom() + inner_layout.spacing() / 2; + p.drawLine(r.left() + 40, bottom, r.right() - 40, bottom); + } + } + QVBoxLayout outer_layout; + QVBoxLayout inner_layout; +}; + +// convenience class for wrapping layouts +class LayoutWidget : public QWidget { + Q_OBJECT + +public: + LayoutWidget(QLayout *l, QWidget *parent = nullptr) : QWidget(parent) { + setLayout(l); + }; +}; + +class ClickableWidget : public QWidget { + Q_OBJECT + +public: + ClickableWidget(QWidget *parent = nullptr); + +protected: + void mouseReleaseEvent(QMouseEvent *event) override; + void paintEvent(QPaintEvent *) override; + +signals: + void clicked(); +}; diff --git a/selfdrive/ui/qt/widgets/drive_stats.cc b/selfdrive/ui/qt/widgets/drive_stats.cc new file mode 100644 index 000000000..f4c8f502a --- /dev/null +++ b/selfdrive/ui/qt/widgets/drive_stats.cc @@ -0,0 +1,97 @@ +#include "selfdrive/ui/qt/widgets/drive_stats.h" + +#include +#include +#include +#include + +#include "selfdrive/common/params.h" +#include "selfdrive/ui/qt/request_repeater.h" +#include "selfdrive/ui/qt/util.h" + +static QLabel* newLabel(const QString& text, const QString &type) { + QLabel* label = new QLabel(text); + label->setProperty("type", type); + return label; +} + +DriveStats::DriveStats(QWidget* parent) : QFrame(parent) { + metric_ = Params().getBool("IsMetric"); + + QVBoxLayout* main_layout = new QVBoxLayout(this); + main_layout->setContentsMargins(50, 50, 50, 60); + + auto add_stats_layouts = [=](const QString &title, StatsLabels& labels) { + QGridLayout* grid_layout = new QGridLayout; + grid_layout->setVerticalSpacing(10); + grid_layout->setContentsMargins(0, 10, 0, 10); + + int row = 0; + grid_layout->addWidget(newLabel(title, "title"), row++, 0, 1, 3); + grid_layout->addItem(new QSpacerItem(0, 50), row++, 0, 1, 1); + + grid_layout->addWidget(labels.routes = newLabel("0", "number"), row, 0, Qt::AlignLeft); + grid_layout->addWidget(labels.distance = newLabel("0", "number"), row, 1, Qt::AlignLeft); + grid_layout->addWidget(labels.hours = newLabel("0", "number"), row, 2, Qt::AlignLeft); + + grid_layout->addWidget(newLabel("Drives", "unit"), row + 1, 0, Qt::AlignLeft); + grid_layout->addWidget(labels.distance_unit = newLabel(getDistanceUnit(), "unit"), row + 1, 1, Qt::AlignLeft); + grid_layout->addWidget(newLabel("Hours ", "unit"), row + 1, 2, Qt::AlignLeft); + + main_layout->addLayout(grid_layout); + }; + + add_stats_layouts("ALL TIME", all_); + main_layout->addStretch(); + add_stats_layouts("PAST WEEK", week_); + + if (auto dongleId = getDongleId()) { + QString url = CommaApi::BASE_URL + "/v1.1/devices/" + *dongleId + "/stats"; + RequestRepeater* repeater = new RequestRepeater(this, url, "ApiCache_DriveStats", 30); + QObject::connect(repeater, &RequestRepeater::requestDone, this, &DriveStats::parseResponse); + } + + setStyleSheet(R"( + DriveStats { + background-color: #333333; + border-radius: 10px; + } + + QLabel[type="title"] { font-size: 51px; font-weight: 500; } + QLabel[type="number"] { font-size: 78px; font-weight: 500; } + QLabel[type="unit"] { font-size: 51px; font-weight: 300; color: #A0A0A0; } + )"); +} + +void DriveStats::updateStats() { + auto update = [=](const QJsonObject& obj, StatsLabels& labels) { + labels.routes->setText(QString::number((int)obj["routes"].toDouble())); + labels.distance->setText(QString::number(int(obj["distance"].toDouble() * (metric_ ? MILE_TO_KM : 1)))); + labels.distance_unit->setText(getDistanceUnit()); + labels.hours->setText(QString::number((int)(obj["minutes"].toDouble() / 60))); + }; + + QJsonObject json = stats_.object(); + update(json["all"].toObject(), all_); + update(json["week"].toObject(), week_); +} + +void DriveStats::parseResponse(const QString& response, bool success) { + if (!success) return; + + QJsonDocument doc = QJsonDocument::fromJson(response.trimmed().toUtf8()); + if (doc.isNull()) { + qDebug() << "JSON Parse failed on getting past drives statistics"; + return; + } + stats_ = doc; + updateStats(); +} + +void DriveStats::showEvent(QShowEvent* event) { + bool metric = Params().getBool("IsMetric"); + if (metric_ != metric) { + metric_ = metric; + updateStats(); + } +} diff --git a/selfdrive/ui/qt/widgets/drive_stats.h b/selfdrive/ui/qt/widgets/drive_stats.h new file mode 100644 index 000000000..944629451 --- /dev/null +++ b/selfdrive/ui/qt/widgets/drive_stats.h @@ -0,0 +1,25 @@ +#pragma once + +#include +#include + +class DriveStats : public QFrame { + Q_OBJECT + +public: + explicit DriveStats(QWidget* parent = 0); + +private: + void showEvent(QShowEvent *event) override; + void updateStats(); + inline QString getDistanceUnit() const { return metric_ ? "KM" : "Miles"; } + + bool metric_; + QJsonDocument stats_; + struct StatsLabels { + QLabel *routes, *distance, *distance_unit, *hours; + } all_, week_; + +private slots: + void parseResponse(const QString &response, bool success); +}; diff --git a/selfdrive/ui/qt/widgets/input.cc b/selfdrive/ui/qt/widgets/input.cc new file mode 100644 index 000000000..3d6db3c0d --- /dev/null +++ b/selfdrive/ui/qt/widgets/input.cc @@ -0,0 +1,269 @@ +#include "selfdrive/ui/qt/widgets/input.h" + +#include + +#include "selfdrive/hardware/hw.h" +#include "selfdrive/ui/qt/util.h" +#include "selfdrive/ui/qt/qt_window.h" +#include "selfdrive/ui/qt/widgets/scrollview.h" + + +QDialogBase::QDialogBase(QWidget *parent) : QDialog(parent) { + Q_ASSERT(parent != nullptr); + parent->installEventFilter(this); + + setStyleSheet(R"( + * { + outline: none; + color: white; + font-family: Inter; + } + QDialogBase { + background-color: black; + } + QPushButton { + height: 160; + font-size: 55px; + font-weight: 400; + border-radius: 10px; + color: white; + background-color: #333333; + } + QPushButton:pressed { + background-color: #444444; + } + )"); +} + +bool QDialogBase::eventFilter(QObject *o, QEvent *e) { + if (o == parent() && e->type() == QEvent::Hide) { + reject(); + } + return QDialog::eventFilter(o, e); +} + +int QDialogBase::exec() { + setMainWindow(this); + return QDialog::exec(); +} + +InputDialog::InputDialog(const QString &title, QWidget *parent, const QString &subtitle, bool secret) : QDialogBase(parent) { + main_layout = new QVBoxLayout(this); + main_layout->setContentsMargins(50, 55, 50, 50); + main_layout->setSpacing(0); + + // build header + QHBoxLayout *header_layout = new QHBoxLayout(); + + QVBoxLayout *vlayout = new QVBoxLayout; + header_layout->addLayout(vlayout); + label = new QLabel(title, this); + label->setStyleSheet("font-size: 90px; font-weight: bold;"); + vlayout->addWidget(label, 1, Qt::AlignTop | Qt::AlignLeft); + + if (!subtitle.isEmpty()) { + sublabel = new QLabel(subtitle, this); + sublabel->setStyleSheet("font-size: 55px; font-weight: light; color: #BDBDBD;"); + vlayout->addWidget(sublabel, 1, Qt::AlignTop | Qt::AlignLeft); + } + + QPushButton* cancel_btn = new QPushButton("Cancel"); + cancel_btn->setFixedSize(386, 125); + cancel_btn->setStyleSheet(R"( + font-size: 48px; + border-radius: 10px; + color: #E4E4E4; + background-color: #444444; + )"); + header_layout->addWidget(cancel_btn, 0, Qt::AlignRight); + QObject::connect(cancel_btn, &QPushButton::clicked, this, &InputDialog::reject); + QObject::connect(cancel_btn, &QPushButton::clicked, this, &InputDialog::cancel); + + main_layout->addLayout(header_layout); + + // text box + main_layout->addStretch(2); + + QWidget *textbox_widget = new QWidget; + textbox_widget->setObjectName("textbox"); + QHBoxLayout *textbox_layout = new QHBoxLayout(textbox_widget); + textbox_layout->setContentsMargins(50, 0, 50, 0); + + textbox_widget->setStyleSheet(R"( + #textbox { + margin-left: 50px; + margin-right: 50px; + border-radius: 0; + border-bottom: 3px solid #BDBDBD; + } + * { + border: none; + font-size: 80px; + font-weight: light; + background-color: transparent; + } + )"); + + line = new QLineEdit(); + line->setStyleSheet("lineedit-password-character: 8226; lineedit-password-mask-delay: 1500;"); + textbox_layout->addWidget(line, 1); + + if (secret) { + eye_btn = new QPushButton(); + eye_btn->setCheckable(true); + eye_btn->setFixedSize(150, 120); + QObject::connect(eye_btn, &QPushButton::toggled, [=](bool checked) { + if (checked) { + eye_btn->setIcon(QIcon(ASSET_PATH + "img_eye_closed.svg")); + eye_btn->setIconSize(QSize(81, 54)); + line->setEchoMode(QLineEdit::Password); + } else { + eye_btn->setIcon(QIcon(ASSET_PATH + "img_eye_open.svg")); + eye_btn->setIconSize(QSize(81, 44)); + line->setEchoMode(QLineEdit::Normal); + } + }); + eye_btn->setChecked(true); + textbox_layout->addWidget(eye_btn); + } + + main_layout->addWidget(textbox_widget, 0, Qt::AlignBottom); + main_layout->addSpacing(25); + + k = new Keyboard(this); + QObject::connect(k, &Keyboard::emitEnter, this, &InputDialog::handleEnter); + QObject::connect(k, &Keyboard::emitBackspace, this, [=]() { + line->backspace(); + }); + QObject::connect(k, &Keyboard::emitKey, this, [=](const QString &key) { + line->insert(key.left(1)); + }); + + main_layout->addWidget(k, 2, Qt::AlignBottom); +} + +QString InputDialog::getText(const QString &prompt, QWidget *parent, const QString &subtitle, + bool secret, int minLength, const QString &defaultText) { + InputDialog d = InputDialog(prompt, parent, subtitle, secret); + d.line->setText(defaultText); + d.setMinLength(minLength); + const int ret = d.exec(); + return ret ? d.text() : QString(); +} + +QString InputDialog::getNumber(const QString &prompt, QWidget *parent, const QString &subtitle, + bool secret, int minLength, const QString &defaultText) { + InputDialog d = InputDialog(prompt, parent, subtitle, secret); + d.line->setText(defaultText); + d.line->setInputMethodHints(Qt::ImhFormattedNumbersOnly); + d.setMinLength(minLength); + const int ret = d.exec(); + return ret ? d.text() : QString(); +} + +QString InputDialog::text() { + return line->text(); +} + +void InputDialog::show() { + setMainWindow(this); +} + +void InputDialog::handleEnter() { + if (line->text().length() >= minLength) { + done(QDialog::Accepted); + emitText(line->text()); + } else { + setMessage("Need at least "+QString::number(minLength)+" characters!", false); + } +} + +void InputDialog::setMessage(const QString &message, bool clearInputField) { + label->setText(message); + if (clearInputField) { + line->setText(""); + } +} + +void InputDialog::setMinLength(int length) { + minLength = length; +} + +// ConfirmationDialog + +ConfirmationDialog::ConfirmationDialog(const QString &prompt_text, const QString &confirm_text, const QString &cancel_text, + QWidget *parent) : QDialogBase(parent) { + QFrame *container = new QFrame(this); + container->setStyleSheet("QFrame { border-radius: 0; background-color: #ECECEC; }"); + QVBoxLayout *main_layout = new QVBoxLayout(container); + main_layout->setContentsMargins(32, 120, 32, 32); + + QLabel *prompt = new QLabel(prompt_text, this); + prompt->setWordWrap(true); + prompt->setAlignment(Qt::AlignHCenter); + prompt->setStyleSheet("font-size: 70px; font-weight: bold; color: black;"); + main_layout->addWidget(prompt, 1, Qt::AlignTop | Qt::AlignHCenter); + + // cancel + confirm buttons + QHBoxLayout *btn_layout = new QHBoxLayout(); + btn_layout->setSpacing(30); + main_layout->addLayout(btn_layout); + + if (cancel_text.length()) { + QPushButton* cancel_btn = new QPushButton(cancel_text); + btn_layout->addWidget(cancel_btn); + QObject::connect(cancel_btn, &QPushButton::clicked, this, &ConfirmationDialog::reject); + } + + if (confirm_text.length()) { + QPushButton* confirm_btn = new QPushButton(confirm_text); + btn_layout->addWidget(confirm_btn); + QObject::connect(confirm_btn, &QPushButton::clicked, this, &ConfirmationDialog::accept); + } + + QVBoxLayout *outer_layout = new QVBoxLayout(this); + outer_layout->setContentsMargins(210, 170, 210, 170); + outer_layout->addWidget(container); +} + +bool ConfirmationDialog::alert(const QString &prompt_text, QWidget *parent) { + ConfirmationDialog d = ConfirmationDialog(prompt_text, "Ok", "", parent); + return d.exec(); +} + +bool ConfirmationDialog::confirm(const QString &prompt_text, QWidget *parent) { + ConfirmationDialog d = ConfirmationDialog(prompt_text, "Ok", "Cancel", parent); + return d.exec(); +} + + +// RichTextDialog + +RichTextDialog::RichTextDialog(const QString &prompt_text, const QString &btn_text, + QWidget *parent) : QDialogBase(parent) { + QFrame *container = new QFrame(this); + container->setStyleSheet("QFrame { background-color: #1B1B1B; }"); + QVBoxLayout *main_layout = new QVBoxLayout(container); + main_layout->setContentsMargins(32, 32, 32, 32); + + QLabel *prompt = new QLabel(prompt_text, this); + prompt->setWordWrap(true); + prompt->setAlignment(Qt::AlignLeft); + prompt->setTextFormat(Qt::RichText); + prompt->setStyleSheet("font-size: 42px; font-weight: light; color: #C9C9C9; margin: 45px;"); + main_layout->addWidget(new ScrollView(prompt, this), 1, Qt::AlignTop); + + // confirm button + QPushButton* confirm_btn = new QPushButton(btn_text); + main_layout->addWidget(confirm_btn); + QObject::connect(confirm_btn, &QPushButton::clicked, this, &QDialog::accept); + + QVBoxLayout *outer_layout = new QVBoxLayout(this); + outer_layout->setContentsMargins(100, 100, 100, 100); + outer_layout->addWidget(container); +} + +bool RichTextDialog::alert(const QString &prompt_text, QWidget *parent) { + auto d = RichTextDialog(prompt_text, "Ok", parent); + return d.exec(); +} diff --git a/selfdrive/ui/qt/widgets/input.h b/selfdrive/ui/qt/widgets/input.h new file mode 100644 index 000000000..a054b6a3c --- /dev/null +++ b/selfdrive/ui/qt/widgets/input.h @@ -0,0 +1,72 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "selfdrive/ui/qt/widgets/keyboard.h" + + +class QDialogBase : public QDialog { + Q_OBJECT + +protected: + QDialogBase(QWidget *parent); + bool eventFilter(QObject *o, QEvent *e) override; + +public slots: + int exec() override; +}; + +class InputDialog : public QDialogBase { + Q_OBJECT + +public: + explicit InputDialog(const QString &title, QWidget *parent, const QString &subtitle = "", bool secret = false); + static QString getText(const QString &title, QWidget *parent, const QString &substitle = "", + bool secret = false, int minLength = -1, const QString &defaultText = ""); + static QString getNumber(const QString &title, QWidget *parent, const QString &substitle = "", + bool secret = false, int minLength = -1, const QString &defaultText = ""); + QString text(); + void setMessage(const QString &message, bool clearInputField = true); + void setMinLength(int length); + void show(); + +private: + int minLength; + QLineEdit *line; + Keyboard *k; + QLabel *label; + QLabel *sublabel; + QVBoxLayout *main_layout; + QPushButton *eye_btn; + +private slots: + void handleEnter(); + +signals: + void cancel(); + void emitText(const QString &text); +}; + +class ConfirmationDialog : public QDialogBase { + Q_OBJECT + +public: + explicit ConfirmationDialog(const QString &prompt_text, const QString &confirm_text, + const QString &cancel_text, QWidget* parent); + static bool alert(const QString &prompt_text, QWidget *parent); + static bool confirm(const QString &prompt_text, QWidget *parent); +}; + +// larger ConfirmationDialog for rich text +class RichTextDialog : public QDialogBase { + Q_OBJECT + +public: + explicit RichTextDialog(const QString &prompt_text, const QString &btn_text, QWidget* parent); + static bool alert(const QString &prompt_text, QWidget *parent); +}; diff --git a/selfdrive/ui/qt/widgets/keyboard.cc b/selfdrive/ui/qt/widgets/keyboard.cc new file mode 100644 index 000000000..1c5968653 --- /dev/null +++ b/selfdrive/ui/qt/widgets/keyboard.cc @@ -0,0 +1,160 @@ +#include "selfdrive/ui/qt/widgets/keyboard.h" + +#include + +#include +#include +#include +#include +#include + +const QString BACKSPACE_KEY = "⌫"; +const QString ENTER_KEY = "→"; + +const QMap KEY_STRETCH = {{" ", 5}, {ENTER_KEY, 2}}; + +const QStringList CONTROL_BUTTONS = {"↑", "↓", "ABC", "#+=", "123", BACKSPACE_KEY, ENTER_KEY}; + +const float key_spacing_vertical = 20; +const float key_spacing_horizontal = 15; + +KeyButton::KeyButton(const QString &text, QWidget *parent) : QPushButton(text, parent) { + setAttribute(Qt::WA_AcceptTouchEvents); + setFocusPolicy(Qt::NoFocus); +} + +bool KeyButton::event(QEvent *event) { + if (event->type() == QEvent::TouchBegin || event->type() == QEvent::TouchEnd) { + QTouchEvent *touchEvent = static_cast(event); + if (!touchEvent->touchPoints().empty()) { + const QEvent::Type mouseType = event->type() == QEvent::TouchBegin ? QEvent::MouseButtonPress : QEvent::MouseButtonRelease; + QMouseEvent mouseEvent(mouseType, touchEvent->touchPoints().front().pos(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); + QPushButton::event(&mouseEvent); + event->accept(); + parentWidget()->update(); + return true; + } + } + return QPushButton::event(event); +} + +KeyboardLayout::KeyboardLayout(QWidget* parent, const std::vector>& layout) : QWidget(parent) { + QVBoxLayout* main_layout = new QVBoxLayout(this); + main_layout->setMargin(0); + main_layout->setSpacing(0); + + QButtonGroup* btn_group = new QButtonGroup(this); + QObject::connect(btn_group, SIGNAL(buttonClicked(QAbstractButton*)), parent, SLOT(handleButton(QAbstractButton*))); + + for (const auto &s : layout) { + QHBoxLayout *hlayout = new QHBoxLayout; + hlayout->setSpacing(0); + + if (main_layout->count() == 1) { + hlayout->addSpacing(90); + } + + for (const QString &p : s) { + KeyButton* btn = new KeyButton(p); + if (p == BACKSPACE_KEY) { + btn->setAutoRepeat(true); + } else if (p == ENTER_KEY) { + btn->setStyleSheet("background-color: #465BEA;"); + } + btn->setFixedHeight(135 + key_spacing_vertical); + btn_group->addButton(btn); + hlayout->addWidget(btn, KEY_STRETCH.value(p, 1)); + } + + if (main_layout->count() == 1) { + hlayout->addSpacing(90); + } + + main_layout->addLayout(hlayout); + } + + setStyleSheet(QString(R"( + QPushButton { + font-size: 75px; + margin-left: %1px; + margin-right: %1px; + margin-top: %2px; + margin-bottom: %2px; + padding: 0px; + border-radius: 10px; + color: #dddddd; + background-color: #444444; + } + QPushButton:pressed { + background-color: #333333; + } + )").arg(key_spacing_vertical / 2).arg(key_spacing_horizontal / 2)); +} + +Keyboard::Keyboard(QWidget *parent) : QFrame(parent) { + main_layout = new QStackedLayout(this); + main_layout->setMargin(0); + + // lowercase + std::vector> lowercase = { + {"q","w","e","r","t","y","u","i","o","p"}, + {"a","s","d","f","g","h","j","k","l"}, + {"↑","z","x","c","v","b","n","m",BACKSPACE_KEY}, + {"123"," ",".",ENTER_KEY}, + }; + main_layout->addWidget(new KeyboardLayout(this, lowercase)); + + // uppercase + std::vector> uppercase = { + {"Q","W","E","R","T","Y","U","I","O","P"}, + {"A","S","D","F","G","H","J","K","L"}, + {"↓","Z","X","C","V","B","N","M",BACKSPACE_KEY}, + {"123"," ",".",ENTER_KEY}, + }; + main_layout->addWidget(new KeyboardLayout(this, uppercase)); + + // numbers + specials + std::vector> numbers = { + {"1","2","3","4","5","6","7","8","9","0"}, + {"-","/",":",";","(",")","$","&&","@","\""}, + {"#+=",".",",","?","!","`",BACKSPACE_KEY}, + {"ABC"," ",".",ENTER_KEY}, + }; + main_layout->addWidget(new KeyboardLayout(this, numbers)); + + // extra specials + std::vector> specials = { + {"[","]","{","}","#","%","^","*","+","="}, + {"_","\\","|","~","<",">","€","£","¥","•"}, + {"123",".",",","?","!","'",BACKSPACE_KEY}, + {"ABC"," ",".",ENTER_KEY}, + }; + main_layout->addWidget(new KeyboardLayout(this, specials)); + + main_layout->setCurrentIndex(0); +} + +void Keyboard::handleButton(QAbstractButton* btn) { + const QString &key = btn->text(); + if (CONTROL_BUTTONS.contains(key)) { + if (key == "↓" || key == "ABC") { + main_layout->setCurrentIndex(0); + } else if (key == "↑") { + main_layout->setCurrentIndex(1); + } else if (key == "123") { + main_layout->setCurrentIndex(2); + } else if (key == "#+=") { + main_layout->setCurrentIndex(3); + } else if (key == ENTER_KEY) { + main_layout->setCurrentIndex(0); + emit emitEnter(); + } else if (key == BACKSPACE_KEY) { + emit emitBackspace(); + } + } else { + if ("A" <= key && key <= "Z") { + main_layout->setCurrentIndex(0); + } + emit emitKey(key); + } +} diff --git a/selfdrive/ui/qt/widgets/keyboard.h b/selfdrive/ui/qt/widgets/keyboard.h new file mode 100644 index 000000000..516105719 --- /dev/null +++ b/selfdrive/ui/qt/widgets/keyboard.h @@ -0,0 +1,38 @@ +#pragma once + +#include +#include +#include + +class KeyButton : public QPushButton { + Q_OBJECT + +public: + KeyButton(const QString &text, QWidget *parent = 0); + bool event(QEvent *event) override; +}; + +class KeyboardLayout : public QWidget { + Q_OBJECT + +public: + explicit KeyboardLayout(QWidget* parent, const std::vector>& layout); +}; + +class Keyboard : public QFrame { + Q_OBJECT + +public: + explicit Keyboard(QWidget *parent = 0); + +private: + QStackedLayout* main_layout; + +private slots: + void handleButton(QAbstractButton* m_button); + +signals: + void emitKey(const QString &s); + void emitBackspace(); + void emitEnter(); +}; diff --git a/selfdrive/ui/qt/widgets/moc_cameraview.cc b/selfdrive/ui/qt/widgets/moc_cameraview.cc new file mode 100644 index 000000000..367b809b9 --- /dev/null +++ b/selfdrive/ui/qt/widgets/moc_cameraview.cc @@ -0,0 +1,183 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'cameraview.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "cameraview.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'cameraview.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_CameraViewWidget_t { + QByteArrayData data[9]; + char stringdata0[124]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_CameraViewWidget_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_CameraViewWidget_t qt_meta_stringdata_CameraViewWidget = { + { +QT_MOC_LITERAL(0, 0, 16), // "CameraViewWidget" +QT_MOC_LITERAL(1, 17, 7), // "clicked" +QT_MOC_LITERAL(2, 25, 0), // "" +QT_MOC_LITERAL(3, 26, 19), // "vipcThreadConnected" +QT_MOC_LITERAL(4, 46, 16), // "VisionIpcClient*" +QT_MOC_LITERAL(5, 63, 23), // "vipcThreadFrameReceived" +QT_MOC_LITERAL(6, 87, 10), // "VisionBuf*" +QT_MOC_LITERAL(7, 98, 13), // "vipcConnected" +QT_MOC_LITERAL(8, 112, 11) // "vipc_client" + + }, + "CameraViewWidget\0clicked\0\0vipcThreadConnected\0" + "VisionIpcClient*\0vipcThreadFrameReceived\0" + "VisionBuf*\0vipcConnected\0vipc_client" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_CameraViewWidget[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 4, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 3, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 34, 2, 0x06 /* Public */, + 3, 1, 35, 2, 0x06 /* Public */, + 5, 1, 38, 2, 0x06 /* Public */, + + // slots: name, argc, parameters, tag, flags + 7, 1, 41, 2, 0x09 /* Protected */, + + // signals: parameters + QMetaType::Void, + QMetaType::Void, 0x80000000 | 4, 2, + QMetaType::Void, 0x80000000 | 6, 2, + + // slots: parameters + QMetaType::Void, 0x80000000 | 4, 8, + + 0 // eod +}; + +void CameraViewWidget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->clicked(); break; + case 1: _t->vipcThreadConnected((*reinterpret_cast< VisionIpcClient*(*)>(_a[1]))); break; + case 2: _t->vipcThreadFrameReceived((*reinterpret_cast< VisionBuf*(*)>(_a[1]))); break; + case 3: _t->vipcConnected((*reinterpret_cast< VisionIpcClient*(*)>(_a[1]))); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (CameraViewWidget::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&CameraViewWidget::clicked)) { + *result = 0; + return; + } + } + { + using _t = void (CameraViewWidget::*)(VisionIpcClient * ); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&CameraViewWidget::vipcThreadConnected)) { + *result = 1; + return; + } + } + { + using _t = void (CameraViewWidget::*)(VisionBuf * ); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&CameraViewWidget::vipcThreadFrameReceived)) { + *result = 2; + return; + } + } + } +} + +QT_INIT_METAOBJECT const QMetaObject CameraViewWidget::staticMetaObject = { { + &QOpenGLWidget::staticMetaObject, + qt_meta_stringdata_CameraViewWidget.data, + qt_meta_data_CameraViewWidget, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *CameraViewWidget::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *CameraViewWidget::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_CameraViewWidget.stringdata0)) + return static_cast(this); + if (!strcmp(_clname, "QOpenGLFunctions")) + return static_cast< QOpenGLFunctions*>(this); + return QOpenGLWidget::qt_metacast(_clname); +} + +int CameraViewWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QOpenGLWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 4) + qt_static_metacall(this, _c, _id, _a); + _id -= 4; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 4) + *reinterpret_cast(_a[0]) = -1; + _id -= 4; + } + return _id; +} + +// SIGNAL 0 +void CameraViewWidget::clicked() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} + +// SIGNAL 1 +void CameraViewWidget::vipcThreadConnected(VisionIpcClient * _t1) +{ + void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 1, _a); +} + +// SIGNAL 2 +void CameraViewWidget::vipcThreadFrameReceived(VisionBuf * _t1) +{ + void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 2, _a); +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/widgets/moc_controls.cc b/selfdrive/ui/qt/widgets/moc_controls.cc new file mode 100644 index 000000000..c528d519f --- /dev/null +++ b/selfdrive/ui/qt/widgets/moc_controls.cc @@ -0,0 +1,859 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'controls.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "controls.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'controls.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_ElidedLabel_t { + QByteArrayData data[3]; + char stringdata0[21]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_ElidedLabel_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_ElidedLabel_t qt_meta_stringdata_ElidedLabel = { + { +QT_MOC_LITERAL(0, 0, 11), // "ElidedLabel" +QT_MOC_LITERAL(1, 12, 7), // "clicked" +QT_MOC_LITERAL(2, 20, 0) // "" + + }, + "ElidedLabel\0clicked\0" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_ElidedLabel[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x06 /* Public */, + + // signals: parameters + QMetaType::Void, + + 0 // eod +}; + +void ElidedLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->clicked(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (ElidedLabel::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&ElidedLabel::clicked)) { + *result = 0; + return; + } + } + } + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject ElidedLabel::staticMetaObject = { { + &QLabel::staticMetaObject, + qt_meta_stringdata_ElidedLabel.data, + qt_meta_data_ElidedLabel, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *ElidedLabel::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *ElidedLabel::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_ElidedLabel.stringdata0)) + return static_cast(this); + return QLabel::qt_metacast(_clname); +} + +int ElidedLabel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QLabel::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} + +// SIGNAL 0 +void ElidedLabel::clicked() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} +struct qt_meta_stringdata_AbstractControl_t { + QByteArrayData data[3]; + char stringdata0[33]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_AbstractControl_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_AbstractControl_t qt_meta_stringdata_AbstractControl = { + { +QT_MOC_LITERAL(0, 0, 15), // "AbstractControl" +QT_MOC_LITERAL(1, 16, 15), // "showDescription" +QT_MOC_LITERAL(2, 32, 0) // "" + + }, + "AbstractControl\0showDescription\0" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_AbstractControl[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x06 /* Public */, + + // signals: parameters + QMetaType::Void, + + 0 // eod +}; + +void AbstractControl::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->showDescription(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (AbstractControl::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&AbstractControl::showDescription)) { + *result = 0; + return; + } + } + } + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject AbstractControl::staticMetaObject = { { + &QFrame::staticMetaObject, + qt_meta_stringdata_AbstractControl.data, + qt_meta_data_AbstractControl, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *AbstractControl::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *AbstractControl::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_AbstractControl.stringdata0)) + return static_cast(this); + return QFrame::qt_metacast(_clname); +} + +int AbstractControl::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QFrame::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} + +// SIGNAL 0 +void AbstractControl::showDescription() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} +struct qt_meta_stringdata_LabelControl_t { + QByteArrayData data[1]; + char stringdata0[13]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_LabelControl_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_LabelControl_t qt_meta_stringdata_LabelControl = { + { +QT_MOC_LITERAL(0, 0, 12) // "LabelControl" + + }, + "LabelControl" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_LabelControl[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void LabelControl::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject LabelControl::staticMetaObject = { { + &AbstractControl::staticMetaObject, + qt_meta_stringdata_LabelControl.data, + qt_meta_data_LabelControl, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *LabelControl::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *LabelControl::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_LabelControl.stringdata0)) + return static_cast(this); + return AbstractControl::qt_metacast(_clname); +} + +int LabelControl::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = AbstractControl::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_ButtonControl_t { + QByteArrayData data[5]; + char stringdata0[42]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_ButtonControl_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_ButtonControl_t qt_meta_stringdata_ButtonControl = { + { +QT_MOC_LITERAL(0, 0, 13), // "ButtonControl" +QT_MOC_LITERAL(1, 14, 7), // "clicked" +QT_MOC_LITERAL(2, 22, 0), // "" +QT_MOC_LITERAL(3, 23, 10), // "setEnabled" +QT_MOC_LITERAL(4, 34, 7) // "enabled" + + }, + "ButtonControl\0clicked\0\0setEnabled\0" + "enabled" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_ButtonControl[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 2, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 24, 2, 0x06 /* Public */, + + // slots: name, argc, parameters, tag, flags + 3, 1, 25, 2, 0x0a /* Public */, + + // signals: parameters + QMetaType::Void, + + // slots: parameters + QMetaType::Void, QMetaType::Bool, 4, + + 0 // eod +}; + +void ButtonControl::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->clicked(); break; + case 1: _t->setEnabled((*reinterpret_cast< bool(*)>(_a[1]))); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (ButtonControl::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&ButtonControl::clicked)) { + *result = 0; + return; + } + } + } +} + +QT_INIT_METAOBJECT const QMetaObject ButtonControl::staticMetaObject = { { + &AbstractControl::staticMetaObject, + qt_meta_stringdata_ButtonControl.data, + qt_meta_data_ButtonControl, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *ButtonControl::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *ButtonControl::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_ButtonControl.stringdata0)) + return static_cast(this); + return AbstractControl::qt_metacast(_clname); +} + +int ButtonControl::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = AbstractControl::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 2) + qt_static_metacall(this, _c, _id, _a); + _id -= 2; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 2) + *reinterpret_cast(_a[0]) = -1; + _id -= 2; + } + return _id; +} + +// SIGNAL 0 +void ButtonControl::clicked() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} +struct qt_meta_stringdata_ToggleControl_t { + QByteArrayData data[4]; + char stringdata0[35]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_ToggleControl_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_ToggleControl_t qt_meta_stringdata_ToggleControl = { + { +QT_MOC_LITERAL(0, 0, 13), // "ToggleControl" +QT_MOC_LITERAL(1, 14, 13), // "toggleFlipped" +QT_MOC_LITERAL(2, 28, 0), // "" +QT_MOC_LITERAL(3, 29, 5) // "state" + + }, + "ToggleControl\0toggleFlipped\0\0state" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_ToggleControl[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 1, 19, 2, 0x06 /* Public */, + + // signals: parameters + QMetaType::Void, QMetaType::Bool, 3, + + 0 // eod +}; + +void ToggleControl::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->toggleFlipped((*reinterpret_cast< bool(*)>(_a[1]))); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (ToggleControl::*)(bool ); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&ToggleControl::toggleFlipped)) { + *result = 0; + return; + } + } + } +} + +QT_INIT_METAOBJECT const QMetaObject ToggleControl::staticMetaObject = { { + &AbstractControl::staticMetaObject, + qt_meta_stringdata_ToggleControl.data, + qt_meta_data_ToggleControl, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *ToggleControl::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *ToggleControl::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_ToggleControl.stringdata0)) + return static_cast(this); + return AbstractControl::qt_metacast(_clname); +} + +int ToggleControl::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = AbstractControl::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} + +// SIGNAL 0 +void ToggleControl::toggleFlipped(bool _t1) +{ + void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} +struct qt_meta_stringdata_ParamControl_t { + QByteArrayData data[1]; + char stringdata0[13]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_ParamControl_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_ParamControl_t qt_meta_stringdata_ParamControl = { + { +QT_MOC_LITERAL(0, 0, 12) // "ParamControl" + + }, + "ParamControl" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_ParamControl[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void ParamControl::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject ParamControl::staticMetaObject = { { + &ToggleControl::staticMetaObject, + qt_meta_stringdata_ParamControl.data, + qt_meta_data_ParamControl, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *ParamControl::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *ParamControl::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_ParamControl.stringdata0)) + return static_cast(this); + return ToggleControl::qt_metacast(_clname); +} + +int ParamControl::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = ToggleControl::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_ListWidget_t { + QByteArrayData data[1]; + char stringdata0[11]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_ListWidget_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_ListWidget_t qt_meta_stringdata_ListWidget = { + { +QT_MOC_LITERAL(0, 0, 10) // "ListWidget" + + }, + "ListWidget" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_ListWidget[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void ListWidget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject ListWidget::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_ListWidget.data, + qt_meta_data_ListWidget, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *ListWidget::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *ListWidget::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_ListWidget.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int ListWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_LayoutWidget_t { + QByteArrayData data[1]; + char stringdata0[13]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_LayoutWidget_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_LayoutWidget_t qt_meta_stringdata_LayoutWidget = { + { +QT_MOC_LITERAL(0, 0, 12) // "LayoutWidget" + + }, + "LayoutWidget" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_LayoutWidget[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void LayoutWidget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject LayoutWidget::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_LayoutWidget.data, + qt_meta_data_LayoutWidget, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *LayoutWidget::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *LayoutWidget::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_LayoutWidget.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int LayoutWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_ClickableWidget_t { + QByteArrayData data[3]; + char stringdata0[25]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_ClickableWidget_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_ClickableWidget_t qt_meta_stringdata_ClickableWidget = { + { +QT_MOC_LITERAL(0, 0, 15), // "ClickableWidget" +QT_MOC_LITERAL(1, 16, 7), // "clicked" +QT_MOC_LITERAL(2, 24, 0) // "" + + }, + "ClickableWidget\0clicked\0" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_ClickableWidget[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x06 /* Public */, + + // signals: parameters + QMetaType::Void, + + 0 // eod +}; + +void ClickableWidget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->clicked(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (ClickableWidget::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&ClickableWidget::clicked)) { + *result = 0; + return; + } + } + } + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject ClickableWidget::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_ClickableWidget.data, + qt_meta_data_ClickableWidget, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *ClickableWidget::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *ClickableWidget::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_ClickableWidget.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int ClickableWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} + +// SIGNAL 0 +void ClickableWidget::clicked() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/widgets/moc_drive_stats.cc b/selfdrive/ui/qt/widgets/moc_drive_stats.cc new file mode 100644 index 000000000..7a4891266 --- /dev/null +++ b/selfdrive/ui/qt/widgets/moc_drive_stats.cc @@ -0,0 +1,120 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'drive_stats.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "drive_stats.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'drive_stats.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_DriveStats_t { + QByteArrayData data[5]; + char stringdata0[43]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_DriveStats_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_DriveStats_t qt_meta_stringdata_DriveStats = { + { +QT_MOC_LITERAL(0, 0, 10), // "DriveStats" +QT_MOC_LITERAL(1, 11, 13), // "parseResponse" +QT_MOC_LITERAL(2, 25, 0), // "" +QT_MOC_LITERAL(3, 26, 8), // "response" +QT_MOC_LITERAL(4, 35, 7) // "success" + + }, + "DriveStats\0parseResponse\0\0response\0" + "success" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_DriveStats[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: name, argc, parameters, tag, flags + 1, 2, 19, 2, 0x08 /* Private */, + + // slots: parameters + QMetaType::Void, QMetaType::QString, QMetaType::Bool, 3, 4, + + 0 // eod +}; + +void DriveStats::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->parseResponse((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break; + default: ; + } + } +} + +QT_INIT_METAOBJECT const QMetaObject DriveStats::staticMetaObject = { { + &QFrame::staticMetaObject, + qt_meta_stringdata_DriveStats.data, + qt_meta_data_DriveStats, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *DriveStats::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *DriveStats::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_DriveStats.stringdata0)) + return static_cast(this); + return QFrame::qt_metacast(_clname); +} + +int DriveStats::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QFrame::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/widgets/moc_input.cc b/selfdrive/ui/qt/widgets/moc_input.cc new file mode 100644 index 000000000..e13cf5faf --- /dev/null +++ b/selfdrive/ui/qt/widgets/moc_input.cc @@ -0,0 +1,394 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'input.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "input.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'input.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_QDialogBase_t { + QByteArrayData data[3]; + char stringdata0[18]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_QDialogBase_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_QDialogBase_t qt_meta_stringdata_QDialogBase = { + { +QT_MOC_LITERAL(0, 0, 11), // "QDialogBase" +QT_MOC_LITERAL(1, 12, 4), // "exec" +QT_MOC_LITERAL(2, 17, 0) // "" + + }, + "QDialogBase\0exec\0" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_QDialogBase[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a /* Public */, + + // slots: parameters + QMetaType::Int, + + 0 // eod +}; + +void QDialogBase::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: { int _r = _t->exec(); + if (_a[0]) *reinterpret_cast< int*>(_a[0]) = std::move(_r); } break; + default: ; + } + } +} + +QT_INIT_METAOBJECT const QMetaObject QDialogBase::staticMetaObject = { { + &QDialog::staticMetaObject, + qt_meta_stringdata_QDialogBase.data, + qt_meta_data_QDialogBase, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *QDialogBase::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *QDialogBase::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_QDialogBase.stringdata0)) + return static_cast(this); + return QDialog::qt_metacast(_clname); +} + +int QDialogBase::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialog::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} +struct qt_meta_stringdata_InputDialog_t { + QByteArrayData data[6]; + char stringdata0[46]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_InputDialog_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_InputDialog_t qt_meta_stringdata_InputDialog = { + { +QT_MOC_LITERAL(0, 0, 11), // "InputDialog" +QT_MOC_LITERAL(1, 12, 6), // "cancel" +QT_MOC_LITERAL(2, 19, 0), // "" +QT_MOC_LITERAL(3, 20, 8), // "emitText" +QT_MOC_LITERAL(4, 29, 4), // "text" +QT_MOC_LITERAL(5, 34, 11) // "handleEnter" + + }, + "InputDialog\0cancel\0\0emitText\0text\0" + "handleEnter" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_InputDialog[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 3, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 2, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 29, 2, 0x06 /* Public */, + 3, 1, 30, 2, 0x06 /* Public */, + + // slots: name, argc, parameters, tag, flags + 5, 0, 33, 2, 0x08 /* Private */, + + // signals: parameters + QMetaType::Void, + QMetaType::Void, QMetaType::QString, 4, + + // slots: parameters + QMetaType::Void, + + 0 // eod +}; + +void InputDialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->cancel(); break; + case 1: _t->emitText((*reinterpret_cast< const QString(*)>(_a[1]))); break; + case 2: _t->handleEnter(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (InputDialog::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&InputDialog::cancel)) { + *result = 0; + return; + } + } + { + using _t = void (InputDialog::*)(const QString & ); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&InputDialog::emitText)) { + *result = 1; + return; + } + } + } +} + +QT_INIT_METAOBJECT const QMetaObject InputDialog::staticMetaObject = { { + &QDialogBase::staticMetaObject, + qt_meta_stringdata_InputDialog.data, + qt_meta_data_InputDialog, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *InputDialog::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *InputDialog::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_InputDialog.stringdata0)) + return static_cast(this); + return QDialogBase::qt_metacast(_clname); +} + +int InputDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialogBase::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 3) + qt_static_metacall(this, _c, _id, _a); + _id -= 3; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 3) + *reinterpret_cast(_a[0]) = -1; + _id -= 3; + } + return _id; +} + +// SIGNAL 0 +void InputDialog::cancel() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} + +// SIGNAL 1 +void InputDialog::emitText(const QString & _t1) +{ + void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 1, _a); +} +struct qt_meta_stringdata_ConfirmationDialog_t { + QByteArrayData data[1]; + char stringdata0[19]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_ConfirmationDialog_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_ConfirmationDialog_t qt_meta_stringdata_ConfirmationDialog = { + { +QT_MOC_LITERAL(0, 0, 18) // "ConfirmationDialog" + + }, + "ConfirmationDialog" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_ConfirmationDialog[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void ConfirmationDialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject ConfirmationDialog::staticMetaObject = { { + &QDialogBase::staticMetaObject, + qt_meta_stringdata_ConfirmationDialog.data, + qt_meta_data_ConfirmationDialog, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *ConfirmationDialog::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *ConfirmationDialog::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_ConfirmationDialog.stringdata0)) + return static_cast(this); + return QDialogBase::qt_metacast(_clname); +} + +int ConfirmationDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialogBase::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_RichTextDialog_t { + QByteArrayData data[1]; + char stringdata0[15]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_RichTextDialog_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_RichTextDialog_t qt_meta_stringdata_RichTextDialog = { + { +QT_MOC_LITERAL(0, 0, 14) // "RichTextDialog" + + }, + "RichTextDialog" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_RichTextDialog[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void RichTextDialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject RichTextDialog::staticMetaObject = { { + &QDialogBase::staticMetaObject, + qt_meta_stringdata_RichTextDialog.data, + qt_meta_data_RichTextDialog, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *RichTextDialog::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *RichTextDialog::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_RichTextDialog.stringdata0)) + return static_cast(this); + return QDialogBase::qt_metacast(_clname); +} + +int RichTextDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialogBase::qt_metacall(_c, _id, _a); + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/widgets/moc_keyboard.cc b/selfdrive/ui/qt/widgets/moc_keyboard.cc new file mode 100644 index 000000000..7a4f7d5ba --- /dev/null +++ b/selfdrive/ui/qt/widgets/moc_keyboard.cc @@ -0,0 +1,320 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'keyboard.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "keyboard.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'keyboard.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_KeyButton_t { + QByteArrayData data[1]; + char stringdata0[10]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_KeyButton_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_KeyButton_t qt_meta_stringdata_KeyButton = { + { +QT_MOC_LITERAL(0, 0, 9) // "KeyButton" + + }, + "KeyButton" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_KeyButton[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void KeyButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject KeyButton::staticMetaObject = { { + &QPushButton::staticMetaObject, + qt_meta_stringdata_KeyButton.data, + qt_meta_data_KeyButton, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *KeyButton::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *KeyButton::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_KeyButton.stringdata0)) + return static_cast(this); + return QPushButton::qt_metacast(_clname); +} + +int KeyButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QPushButton::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_KeyboardLayout_t { + QByteArrayData data[1]; + char stringdata0[15]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_KeyboardLayout_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_KeyboardLayout_t qt_meta_stringdata_KeyboardLayout = { + { +QT_MOC_LITERAL(0, 0, 14) // "KeyboardLayout" + + }, + "KeyboardLayout" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_KeyboardLayout[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void KeyboardLayout::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject KeyboardLayout::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_KeyboardLayout.data, + qt_meta_data_KeyboardLayout, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *KeyboardLayout::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *KeyboardLayout::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_KeyboardLayout.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int KeyboardLayout::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_Keyboard_t { + QByteArrayData data[9]; + char stringdata0[83]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_Keyboard_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_Keyboard_t qt_meta_stringdata_Keyboard = { + { +QT_MOC_LITERAL(0, 0, 8), // "Keyboard" +QT_MOC_LITERAL(1, 9, 7), // "emitKey" +QT_MOC_LITERAL(2, 17, 0), // "" +QT_MOC_LITERAL(3, 18, 1), // "s" +QT_MOC_LITERAL(4, 20, 13), // "emitBackspace" +QT_MOC_LITERAL(5, 34, 9), // "emitEnter" +QT_MOC_LITERAL(6, 44, 12), // "handleButton" +QT_MOC_LITERAL(7, 57, 16), // "QAbstractButton*" +QT_MOC_LITERAL(8, 74, 8) // "m_button" + + }, + "Keyboard\0emitKey\0\0s\0emitBackspace\0" + "emitEnter\0handleButton\0QAbstractButton*\0" + "m_button" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_Keyboard[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 4, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 3, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 1, 34, 2, 0x06 /* Public */, + 4, 0, 37, 2, 0x06 /* Public */, + 5, 0, 38, 2, 0x06 /* Public */, + + // slots: name, argc, parameters, tag, flags + 6, 1, 39, 2, 0x08 /* Private */, + + // signals: parameters + QMetaType::Void, QMetaType::QString, 3, + QMetaType::Void, + QMetaType::Void, + + // slots: parameters + QMetaType::Void, 0x80000000 | 7, 8, + + 0 // eod +}; + +void Keyboard::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->emitKey((*reinterpret_cast< const QString(*)>(_a[1]))); break; + case 1: _t->emitBackspace(); break; + case 2: _t->emitEnter(); break; + case 3: _t->handleButton((*reinterpret_cast< QAbstractButton*(*)>(_a[1]))); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (Keyboard::*)(const QString & ); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&Keyboard::emitKey)) { + *result = 0; + return; + } + } + { + using _t = void (Keyboard::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&Keyboard::emitBackspace)) { + *result = 1; + return; + } + } + { + using _t = void (Keyboard::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&Keyboard::emitEnter)) { + *result = 2; + return; + } + } + } +} + +QT_INIT_METAOBJECT const QMetaObject Keyboard::staticMetaObject = { { + &QFrame::staticMetaObject, + qt_meta_stringdata_Keyboard.data, + qt_meta_data_Keyboard, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *Keyboard::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *Keyboard::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_Keyboard.stringdata0)) + return static_cast(this); + return QFrame::qt_metacast(_clname); +} + +int Keyboard::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QFrame::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 4) + qt_static_metacall(this, _c, _id, _a); + _id -= 4; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 4) + *reinterpret_cast(_a[0]) = -1; + _id -= 4; + } + return _id; +} + +// SIGNAL 0 +void Keyboard::emitKey(const QString & _t1) +{ + void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} + +// SIGNAL 1 +void Keyboard::emitBackspace() +{ + QMetaObject::activate(this, &staticMetaObject, 1, nullptr); +} + +// SIGNAL 2 +void Keyboard::emitEnter() +{ + QMetaObject::activate(this, &staticMetaObject, 2, nullptr); +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/widgets/moc_offroad_alerts.cc b/selfdrive/ui/qt/widgets/moc_offroad_alerts.cc new file mode 100644 index 000000000..e667313d5 --- /dev/null +++ b/selfdrive/ui/qt/widgets/moc_offroad_alerts.cc @@ -0,0 +1,273 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'offroad_alerts.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "offroad_alerts.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'offroad_alerts.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_AbstractAlert_t { + QByteArrayData data[3]; + char stringdata0[23]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_AbstractAlert_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_AbstractAlert_t qt_meta_stringdata_AbstractAlert = { + { +QT_MOC_LITERAL(0, 0, 13), // "AbstractAlert" +QT_MOC_LITERAL(1, 14, 7), // "dismiss" +QT_MOC_LITERAL(2, 22, 0) // "" + + }, + "AbstractAlert\0dismiss\0" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_AbstractAlert[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x06 /* Public */, + + // signals: parameters + QMetaType::Void, + + 0 // eod +}; + +void AbstractAlert::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->dismiss(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (AbstractAlert::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&AbstractAlert::dismiss)) { + *result = 0; + return; + } + } + } + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject AbstractAlert::staticMetaObject = { { + &QFrame::staticMetaObject, + qt_meta_stringdata_AbstractAlert.data, + qt_meta_data_AbstractAlert, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *AbstractAlert::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *AbstractAlert::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_AbstractAlert.stringdata0)) + return static_cast(this); + return QFrame::qt_metacast(_clname); +} + +int AbstractAlert::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QFrame::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} + +// SIGNAL 0 +void AbstractAlert::dismiss() +{ + QMetaObject::activate(this, &staticMetaObject, 0, nullptr); +} +struct qt_meta_stringdata_UpdateAlert_t { + QByteArrayData data[1]; + char stringdata0[12]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_UpdateAlert_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_UpdateAlert_t qt_meta_stringdata_UpdateAlert = { + { +QT_MOC_LITERAL(0, 0, 11) // "UpdateAlert" + + }, + "UpdateAlert" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_UpdateAlert[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void UpdateAlert::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject UpdateAlert::staticMetaObject = { { + &AbstractAlert::staticMetaObject, + qt_meta_stringdata_UpdateAlert.data, + qt_meta_data_UpdateAlert, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *UpdateAlert::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *UpdateAlert::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_UpdateAlert.stringdata0)) + return static_cast(this); + return AbstractAlert::qt_metacast(_clname); +} + +int UpdateAlert::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = AbstractAlert::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_OffroadAlert_t { + QByteArrayData data[1]; + char stringdata0[13]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_OffroadAlert_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_OffroadAlert_t qt_meta_stringdata_OffroadAlert = { + { +QT_MOC_LITERAL(0, 0, 12) // "OffroadAlert" + + }, + "OffroadAlert" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_OffroadAlert[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void OffroadAlert::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject OffroadAlert::staticMetaObject = { { + &AbstractAlert::staticMetaObject, + qt_meta_stringdata_OffroadAlert.data, + qt_meta_data_OffroadAlert, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *OffroadAlert::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *OffroadAlert::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_OffroadAlert.stringdata0)) + return static_cast(this); + return AbstractAlert::qt_metacast(_clname); +} + +int OffroadAlert::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = AbstractAlert::qt_metacall(_c, _id, _a); + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/widgets/moc_prime.cc b/selfdrive/ui/qt/widgets/moc_prime.cc new file mode 100644 index 000000000..acdd7eff4 --- /dev/null +++ b/selfdrive/ui/qt/widgets/moc_prime.cc @@ -0,0 +1,448 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'prime.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "prime.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'prime.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_PairingQRWidget_t { + QByteArrayData data[3]; + char stringdata0[25]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_PairingQRWidget_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_PairingQRWidget_t qt_meta_stringdata_PairingQRWidget = { + { +QT_MOC_LITERAL(0, 0, 15), // "PairingQRWidget" +QT_MOC_LITERAL(1, 16, 7), // "refresh" +QT_MOC_LITERAL(2, 24, 0) // "" + + }, + "PairingQRWidget\0refresh\0" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_PairingQRWidget[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x08 /* Private */, + + // slots: parameters + QMetaType::Void, + + 0 // eod +}; + +void PairingQRWidget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->refresh(); break; + default: ; + } + } + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject PairingQRWidget::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_PairingQRWidget.data, + qt_meta_data_PairingQRWidget, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *PairingQRWidget::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *PairingQRWidget::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_PairingQRWidget.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int PairingQRWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} +struct qt_meta_stringdata_PairingPopup_t { + QByteArrayData data[1]; + char stringdata0[13]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_PairingPopup_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_PairingPopup_t qt_meta_stringdata_PairingPopup = { + { +QT_MOC_LITERAL(0, 0, 12) // "PairingPopup" + + }, + "PairingPopup" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_PairingPopup[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void PairingPopup::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject PairingPopup::staticMetaObject = { { + &QDialogBase::staticMetaObject, + qt_meta_stringdata_PairingPopup.data, + qt_meta_data_PairingPopup, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *PairingPopup::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *PairingPopup::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_PairingPopup.stringdata0)) + return static_cast(this); + return QDialogBase::qt_metacast(_clname); +} + +int PairingPopup::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialogBase::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_PrimeUserWidget_t { + QByteArrayData data[4]; + char stringdata0[40]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_PrimeUserWidget_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_PrimeUserWidget_t qt_meta_stringdata_PrimeUserWidget = { + { +QT_MOC_LITERAL(0, 0, 15), // "PrimeUserWidget" +QT_MOC_LITERAL(1, 16, 13), // "replyFinished" +QT_MOC_LITERAL(2, 30, 0), // "" +QT_MOC_LITERAL(3, 31, 8) // "response" + + }, + "PrimeUserWidget\0replyFinished\0\0response" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_PrimeUserWidget[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: name, argc, parameters, tag, flags + 1, 1, 19, 2, 0x08 /* Private */, + + // slots: parameters + QMetaType::Void, QMetaType::QString, 3, + + 0 // eod +}; + +void PrimeUserWidget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->replyFinished((*reinterpret_cast< const QString(*)>(_a[1]))); break; + default: ; + } + } +} + +QT_INIT_METAOBJECT const QMetaObject PrimeUserWidget::staticMetaObject = { { + &QWidget::staticMetaObject, + qt_meta_stringdata_PrimeUserWidget.data, + qt_meta_data_PrimeUserWidget, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *PrimeUserWidget::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *PrimeUserWidget::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_PrimeUserWidget.stringdata0)) + return static_cast(this); + return QWidget::qt_metacast(_clname); +} + +int PrimeUserWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} +struct qt_meta_stringdata_PrimeAdWidget_t { + QByteArrayData data[1]; + char stringdata0[14]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_PrimeAdWidget_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_PrimeAdWidget_t qt_meta_stringdata_PrimeAdWidget = { + { +QT_MOC_LITERAL(0, 0, 13) // "PrimeAdWidget" + + }, + "PrimeAdWidget" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_PrimeAdWidget[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void PrimeAdWidget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject PrimeAdWidget::staticMetaObject = { { + &QFrame::staticMetaObject, + qt_meta_stringdata_PrimeAdWidget.data, + qt_meta_data_PrimeAdWidget, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *PrimeAdWidget::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *PrimeAdWidget::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_PrimeAdWidget.stringdata0)) + return static_cast(this); + return QFrame::qt_metacast(_clname); +} + +int PrimeAdWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QFrame::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_SetupWidget_t { + QByteArrayData data[5]; + char stringdata0[44]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_SetupWidget_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_SetupWidget_t qt_meta_stringdata_SetupWidget = { + { +QT_MOC_LITERAL(0, 0, 11), // "SetupWidget" +QT_MOC_LITERAL(1, 12, 13), // "replyFinished" +QT_MOC_LITERAL(2, 26, 0), // "" +QT_MOC_LITERAL(3, 27, 8), // "response" +QT_MOC_LITERAL(4, 36, 7) // "success" + + }, + "SetupWidget\0replyFinished\0\0response\0" + "success" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_SetupWidget[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: name, argc, parameters, tag, flags + 1, 2, 19, 2, 0x08 /* Private */, + + // slots: parameters + QMetaType::Void, QMetaType::QString, QMetaType::Bool, 3, 4, + + 0 // eod +}; + +void SetupWidget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->replyFinished((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break; + default: ; + } + } +} + +QT_INIT_METAOBJECT const QMetaObject SetupWidget::staticMetaObject = { { + &QFrame::staticMetaObject, + qt_meta_stringdata_SetupWidget.data, + qt_meta_data_SetupWidget, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *SetupWidget::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *SetupWidget::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_SetupWidget.stringdata0)) + return static_cast(this); + return QFrame::qt_metacast(_clname); +} + +int SetupWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QFrame::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/widgets/moc_scrollview.cc b/selfdrive/ui/qt/widgets/moc_scrollview.cc new file mode 100644 index 000000000..f5fd143eb --- /dev/null +++ b/selfdrive/ui/qt/widgets/moc_scrollview.cc @@ -0,0 +1,94 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'scrollview.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "scrollview.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'scrollview.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_ScrollView_t { + QByteArrayData data[1]; + char stringdata0[11]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_ScrollView_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_ScrollView_t qt_meta_stringdata_ScrollView = { + { +QT_MOC_LITERAL(0, 0, 10) // "ScrollView" + + }, + "ScrollView" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_ScrollView[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void ScrollView::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject ScrollView::staticMetaObject = { { + &QScrollArea::staticMetaObject, + qt_meta_stringdata_ScrollView.data, + qt_meta_data_ScrollView, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *ScrollView::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *ScrollView::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_ScrollView.stringdata0)) + return static_cast(this); + return QScrollArea::qt_metacast(_clname); +} + +int ScrollView::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QScrollArea::qt_metacall(_c, _id, _a); + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/widgets/moc_ssh_keys.cc b/selfdrive/ui/qt/widgets/moc_ssh_keys.cc new file mode 100644 index 000000000..be700f923 --- /dev/null +++ b/selfdrive/ui/qt/widgets/moc_ssh_keys.cc @@ -0,0 +1,164 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'ssh_keys.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "ssh_keys.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'ssh_keys.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_SshToggle_t { + QByteArrayData data[1]; + char stringdata0[10]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_SshToggle_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_SshToggle_t qt_meta_stringdata_SshToggle = { + { +QT_MOC_LITERAL(0, 0, 9) // "SshToggle" + + }, + "SshToggle" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_SshToggle[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void SshToggle::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject SshToggle::staticMetaObject = { { + &ToggleControl::staticMetaObject, + qt_meta_stringdata_SshToggle.data, + qt_meta_data_SshToggle, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *SshToggle::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *SshToggle::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_SshToggle.stringdata0)) + return static_cast(this); + return ToggleControl::qt_metacast(_clname); +} + +int SshToggle::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = ToggleControl::qt_metacall(_c, _id, _a); + return _id; +} +struct qt_meta_stringdata_SshControl_t { + QByteArrayData data[1]; + char stringdata0[11]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_SshControl_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_SshControl_t qt_meta_stringdata_SshControl = { + { +QT_MOC_LITERAL(0, 0, 10) // "SshControl" + + }, + "SshControl" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_SshControl[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void SshControl::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +QT_INIT_METAOBJECT const QMetaObject SshControl::staticMetaObject = { { + &ButtonControl::staticMetaObject, + qt_meta_stringdata_SshControl.data, + qt_meta_data_SshControl, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *SshControl::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *SshControl::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_SshControl.stringdata0)) + return static_cast(this); + return ButtonControl::qt_metacast(_clname); +} + +int SshControl::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = ButtonControl::qt_metacall(_c, _id, _a); + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/widgets/moc_toggle.cc b/selfdrive/ui/qt/widgets/moc_toggle.cc new file mode 100644 index 000000000..8817cbaeb --- /dev/null +++ b/selfdrive/ui/qt/widgets/moc_toggle.cc @@ -0,0 +1,176 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'toggle.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.8) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "toggle.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'toggle.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.12.8. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_Toggle_t { + QByteArrayData data[5]; + char stringdata0[45]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_Toggle_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_Toggle_t qt_meta_stringdata_Toggle = { + { +QT_MOC_LITERAL(0, 0, 6), // "Toggle" +QT_MOC_LITERAL(1, 7, 12), // "stateChanged" +QT_MOC_LITERAL(2, 20, 0), // "" +QT_MOC_LITERAL(3, 21, 9), // "new_state" +QT_MOC_LITERAL(4, 31, 13) // "offset_circle" + + }, + "Toggle\0stateChanged\0\0new_state\0" + "offset_circle" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_Toggle[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 1, 22, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 1, 19, 2, 0x06 /* Public */, + + // signals: parameters + QMetaType::Void, QMetaType::Bool, 3, + + // properties: name, type, flags + 4, QMetaType::Int, 0x00095003, + + 0 // eod +}; + +void Toggle::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->stateChanged((*reinterpret_cast< bool(*)>(_a[1]))); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + { + using _t = void (Toggle::*)(bool ); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&Toggle::stateChanged)) { + *result = 0; + return; + } + } + } +#ifndef QT_NO_PROPERTIES + else if (_c == QMetaObject::ReadProperty) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + void *_v = _a[0]; + switch (_id) { + case 0: *reinterpret_cast< int*>(_v) = _t->offset_circle(); break; + default: break; + } + } else if (_c == QMetaObject::WriteProperty) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + void *_v = _a[0]; + switch (_id) { + case 0: _t->set_offset_circle(*reinterpret_cast< int*>(_v)); break; + default: break; + } + } else if (_c == QMetaObject::ResetProperty) { + } +#endif // QT_NO_PROPERTIES +} + +QT_INIT_METAOBJECT const QMetaObject Toggle::staticMetaObject = { { + &QAbstractButton::staticMetaObject, + qt_meta_stringdata_Toggle.data, + qt_meta_data_Toggle, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *Toggle::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *Toggle::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_Toggle.stringdata0)) + return static_cast(this); + return QAbstractButton::qt_metacast(_clname); +} + +int Toggle::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QAbstractButton::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } +#ifndef QT_NO_PROPERTIES + else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty + || _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) { + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::QueryPropertyDesignable) { + _id -= 1; + } else if (_c == QMetaObject::QueryPropertyScriptable) { + _id -= 1; + } else if (_c == QMetaObject::QueryPropertyStored) { + _id -= 1; + } else if (_c == QMetaObject::QueryPropertyEditable) { + _id -= 1; + } else if (_c == QMetaObject::QueryPropertyUser) { + _id -= 1; + } +#endif // QT_NO_PROPERTIES + return _id; +} + +// SIGNAL 0 +void Toggle::stateChanged(bool _t1) +{ + void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/selfdrive/ui/qt/widgets/offroad_alerts.cc b/selfdrive/ui/qt/widgets/offroad_alerts.cc new file mode 100644 index 000000000..2d7ae39c3 --- /dev/null +++ b/selfdrive/ui/qt/widgets/offroad_alerts.cc @@ -0,0 +1,118 @@ +#include "selfdrive/ui/qt/widgets/offroad_alerts.h" + +#include +#include +#include + +#include "selfdrive/common/util.h" +#include "selfdrive/hardware/hw.h" +#include "selfdrive/ui/qt/widgets/scrollview.h" + +AbstractAlert::AbstractAlert(bool hasRebootBtn, QWidget *parent) : QFrame(parent) { + QVBoxLayout *main_layout = new QVBoxLayout(this); + main_layout->setMargin(50); + main_layout->setSpacing(30); + + QWidget *widget = new QWidget; + scrollable_layout = new QVBoxLayout(widget); + widget->setStyleSheet("background-color: transparent;"); + main_layout->addWidget(new ScrollView(widget)); + + // bottom footer, dismiss + reboot buttons + QHBoxLayout *footer_layout = new QHBoxLayout(); + main_layout->addLayout(footer_layout); + + QPushButton *dismiss_btn = new QPushButton("Close"); + dismiss_btn->setFixedSize(400, 125); + footer_layout->addWidget(dismiss_btn, 0, Qt::AlignBottom | Qt::AlignLeft); + QObject::connect(dismiss_btn, &QPushButton::clicked, this, &AbstractAlert::dismiss); + + snooze_btn = new QPushButton("Snooze Update"); + snooze_btn->setVisible(false); + snooze_btn->setFixedSize(550, 125); + footer_layout->addWidget(snooze_btn, 0, Qt::AlignBottom | Qt::AlignRight); + QObject::connect(snooze_btn, &QPushButton::clicked, [=]() { + params.putBool("SnoozeUpdate", true); + }); + QObject::connect(snooze_btn, &QPushButton::clicked, this, &AbstractAlert::dismiss); + snooze_btn->setStyleSheet(R"(color: white; background-color: #4F4F4F;)"); + + if (hasRebootBtn) { + QPushButton *rebootBtn = new QPushButton("Reboot and Update"); + rebootBtn->setFixedSize(600, 125); + footer_layout->addWidget(rebootBtn, 0, Qt::AlignBottom | Qt::AlignRight); + QObject::connect(rebootBtn, &QPushButton::clicked, [=]() { Hardware::reboot(); }); + } + + setStyleSheet(R"( + * { + font-size: 48px; + color: white; + } + QFrame { + border-radius: 30px; + background-color: #393939; + } + QPushButton { + color: black; + font-weight: 500; + border-radius: 30px; + background-color: white; + } + )"); +} + +int OffroadAlert::refresh() { + // build widgets for each offroad alert on first refresh + if (alerts.empty()) { + QString json = util::read_file("../controls/lib/alerts_offroad.json").c_str(); + QJsonObject obj = QJsonDocument::fromJson(json.toUtf8()).object(); + + // descending sort labels by severity + std::vector> sorted; + for (auto it = obj.constBegin(); it != obj.constEnd(); ++it) { + sorted.push_back({it.key().toStdString(), it.value()["severity"].toInt()}); + } + std::sort(sorted.begin(), sorted.end(), [=](auto &l, auto &r) { return l.second > r.second; }); + + for (auto &[key, severity] : sorted) { + QLabel *l = new QLabel(this); + alerts[key] = l; + l->setMargin(60); + l->setWordWrap(true); + l->setStyleSheet(QString("background-color: %1").arg(severity ? "#E22C2C" : "#292929")); + scrollable_layout->addWidget(l); + } + scrollable_layout->addStretch(1); + } + + int alertCount = 0; + for (const auto &[key, label] : alerts) { + QString text; + std::string bytes = params.get(key); + if (bytes.size()) { + auto doc_par = QJsonDocument::fromJson(bytes.c_str()); + text = doc_par["text"].toString(); + } + label->setText(text); + label->setVisible(!text.isEmpty()); + alertCount += !text.isEmpty(); + } + snooze_btn->setVisible(!alerts["Offroad_ConnectivityNeeded"]->text().isEmpty()); + return alertCount; +} + +UpdateAlert::UpdateAlert(QWidget *parent) : AbstractAlert(true, parent) { + releaseNotes = new QLabel(this); + releaseNotes->setWordWrap(true); + releaseNotes->setAlignment(Qt::AlignTop); + scrollable_layout->addWidget(releaseNotes); +} + +bool UpdateAlert::refresh() { + bool updateAvailable = params.getBool("UpdateAvailable"); + if (updateAvailable) { + releaseNotes->setText(params.get("ReleaseNotes").c_str()); + } + return updateAvailable; +} diff --git a/selfdrive/ui/qt/widgets/offroad_alerts.h b/selfdrive/ui/qt/widgets/offroad_alerts.h new file mode 100644 index 000000000..4110bdaa4 --- /dev/null +++ b/selfdrive/ui/qt/widgets/offroad_alerts.h @@ -0,0 +1,45 @@ +#pragma once + +#include + +#include +#include +#include + +#include "selfdrive/common/params.h" + +class AbstractAlert : public QFrame { + Q_OBJECT + +protected: + AbstractAlert(bool hasRebootBtn, QWidget *parent = nullptr); + + QPushButton *snooze_btn; + QVBoxLayout *scrollable_layout; + Params params; + +signals: + void dismiss(); +}; + +class UpdateAlert : public AbstractAlert { + Q_OBJECT + +public: + UpdateAlert(QWidget *parent = 0); + bool refresh(); + +private: + QLabel *releaseNotes = nullptr; +}; + +class OffroadAlert : public AbstractAlert { + Q_OBJECT + +public: + explicit OffroadAlert(QWidget *parent = 0) : AbstractAlert(false, parent) {} + int refresh(); + +private: + std::map alerts; +}; diff --git a/selfdrive/ui/qt/widgets/prime.cc b/selfdrive/ui/qt/widgets/prime.cc new file mode 100644 index 000000000..27d472535 --- /dev/null +++ b/selfdrive/ui/qt/widgets/prime.cc @@ -0,0 +1,328 @@ +#include "selfdrive/ui/qt/widgets/prime.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "selfdrive/ui/qt/request_repeater.h" +#include "selfdrive/ui/qt/util.h" +#include "selfdrive/ui/qt/qt_window.h" + +using qrcodegen::QrCode; + +PairingQRWidget::PairingQRWidget(QWidget* parent) : QWidget(parent) { + QTimer* timer = new QTimer(this); + timer->start(5 * 60 * 1000); + connect(timer, &QTimer::timeout, this, &PairingQRWidget::refresh); +} + +void PairingQRWidget::showEvent(QShowEvent *event) { + refresh(); +} + +void PairingQRWidget::refresh() { + if (isVisible()) { + QString pairToken = CommaApi::create_jwt({{"pair", true}}); + QString qrString = "https://connect.comma.ai/?pair=" + pairToken; + this->updateQrCode(qrString); + } +} + +void PairingQRWidget::updateQrCode(const QString &text) { + QrCode qr = QrCode::encodeText(text.toUtf8().data(), QrCode::Ecc::LOW); + qint32 sz = qr.getSize(); + QImage im(sz, sz, QImage::Format_RGB32); + + QRgb black = qRgb(0, 0, 0); + QRgb white = qRgb(255, 255, 255); + for (int y = 0; y < sz; y++) { + for (int x = 0; x < sz; x++) { + im.setPixel(x, y, qr.getModule(x, y) ? black : white); + } + } + + // Integer division to prevent anti-aliasing + int final_sz = ((width() / sz) - 1) * sz; + img = QPixmap::fromImage(im.scaled(final_sz, final_sz, Qt::KeepAspectRatio), Qt::MonoOnly); +} + +void PairingQRWidget::paintEvent(QPaintEvent *e) { + QPainter p(this); + p.fillRect(rect(), Qt::white); + + QSize s = (size() - img.size()) / 2; + p.drawPixmap(s.width(), s.height(), img); +} + + +PairingPopup::PairingPopup(QWidget *parent) : QDialogBase(parent) { + QHBoxLayout *hlayout = new QHBoxLayout(this); + hlayout->setContentsMargins(0, 0, 0, 0); + hlayout->setSpacing(0); + + setStyleSheet("PairingPopup { background-color: #E0E0E0; }"); + + // text + QVBoxLayout *vlayout = new QVBoxLayout(); + vlayout->setContentsMargins(85, 70, 50, 70); + vlayout->setSpacing(50); + hlayout->addLayout(vlayout, 1); + { + QPushButton *close = new QPushButton(QIcon(":/icons/close.svg"), "", this); + close->setIconSize(QSize(80, 80)); + close->setStyleSheet("border: none;"); + vlayout->addWidget(close, 0, Qt::AlignLeft); + QObject::connect(close, &QPushButton::clicked, this, &QDialog::reject); + + vlayout->addSpacing(30); + + QLabel *title = new QLabel("Pair your device to your comma account", this); + title->setStyleSheet("font-size: 75px; color: black;"); + title->setWordWrap(true); + vlayout->addWidget(title); + + QLabel *instructions = new QLabel(R"( +
      +
    1. Go to https://connect.comma.ai on your phone
    2. +
    3. Click "add new device" and scan the QR code on the right
    4. +
    5. Bookmark connect.comma.ai to your home screen to use it like an app
    6. +
    + )", this); + instructions->setStyleSheet("font-size: 47px; font-weight: bold; color: black;"); + instructions->setWordWrap(true); + vlayout->addWidget(instructions); + + vlayout->addStretch(); + } + + // QR code + PairingQRWidget *qr = new PairingQRWidget(this); + hlayout->addWidget(qr, 1); +} + + +PrimeUserWidget::PrimeUserWidget(QWidget* parent) : QWidget(parent) { + mainLayout = new QVBoxLayout(this); + mainLayout->setMargin(0); + mainLayout->setSpacing(30); + + // subscribed prime layout + QWidget *primeWidget = new QWidget; + primeWidget->setObjectName("primeWidget"); + QVBoxLayout *primeLayout = new QVBoxLayout(primeWidget); + primeLayout->setMargin(0); + primeWidget->setContentsMargins(60, 50, 60, 50); + + QLabel* subscribed = new QLabel("✓ SUBSCRIBED"); + subscribed->setStyleSheet("font-size: 41px; font-weight: bold; color: #86FF4E;"); + primeLayout->addWidget(subscribed, 0, Qt::AlignTop); + + primeLayout->addSpacing(60); + + QLabel* commaPrime = new QLabel("comma prime"); + commaPrime->setStyleSheet("font-size: 75px; font-weight: bold;"); + primeLayout->addWidget(commaPrime, 0, Qt::AlignTop); + + primeLayout->addSpacing(20); + + QLabel* connectUrl = new QLabel("CONNECT.COMMA.AI"); + connectUrl->setStyleSheet("font-size: 41px; font-family: Inter SemiBold; color: #A0A0A0;"); + primeLayout->addWidget(connectUrl, 0, Qt::AlignTop); + + mainLayout->addWidget(primeWidget); + + // comma points layout + QWidget *pointsWidget = new QWidget; + pointsWidget->setObjectName("primeWidget"); + QVBoxLayout *pointsLayout = new QVBoxLayout(pointsWidget); + pointsLayout->setMargin(0); + pointsWidget->setContentsMargins(60, 50, 60, 50); + + QLabel* commaPoints = new QLabel("COMMA POINTS"); + commaPoints->setStyleSheet("font-size: 41px; font-family: Inter SemiBold;"); + pointsLayout->addWidget(commaPoints, 0, Qt::AlignTop); + + points = new QLabel("0"); + points->setStyleSheet("font-size: 91px; font-weight: bold;"); + pointsLayout->addWidget(points, 0, Qt::AlignTop); + + mainLayout->addWidget(pointsWidget); + + mainLayout->addStretch(); + + // set up API requests + if (auto dongleId = getDongleId()) { + QString url = CommaApi::BASE_URL + "/v1/devices/" + *dongleId + "/owner"; + RequestRepeater *repeater = new RequestRepeater(this, url, "ApiCache_Owner", 6); + QObject::connect(repeater, &RequestRepeater::requestDone, this, &PrimeUserWidget::replyFinished); + } +} + +void PrimeUserWidget::replyFinished(const QString &response) { + QJsonDocument doc = QJsonDocument::fromJson(response.toUtf8()); + if (doc.isNull()) { + qDebug() << "JSON Parse failed on getting points"; + return; + } + + QJsonObject json = doc.object(); + points->setText(QString::number(json["points"].toInt())); +} + +PrimeAdWidget::PrimeAdWidget(QWidget* parent) : QFrame(parent) { + QVBoxLayout* main_layout = new QVBoxLayout(this); + main_layout->setContentsMargins(80, 90, 80, 60); + main_layout->setSpacing(0); + + QLabel *upgrade = new QLabel("Upgrade Now"); + upgrade->setStyleSheet("font-size: 75px; font-weight: bold;"); + main_layout->addWidget(upgrade, 0, Qt::AlignTop); + main_layout->addSpacing(50); + + QLabel *description = new QLabel("Become a comma prime member at connect.comma.ai"); + description->setStyleSheet("font-size: 60px; font-weight: light; color: white;"); + description->setWordWrap(true); + main_layout->addWidget(description, 0, Qt::AlignTop); + + main_layout->addStretch(); + + QLabel *features = new QLabel("PRIME FEATURES:"); + features->setStyleSheet("font-size: 41px; font-weight: bold; color: #E5E5E5;"); + main_layout->addWidget(features, 0, Qt::AlignBottom); + main_layout->addSpacing(30); + + QVector bullets = {"Remote access", "14 days of storage", "Developer perks"}; + for (auto &b: bullets) { + const QString check = " "; + QLabel *l = new QLabel(check + b); + l->setAlignment(Qt::AlignLeft); + l->setStyleSheet("font-size: 50px; margin-bottom: 15px;"); + main_layout->addWidget(l, 0, Qt::AlignBottom); + } + + setStyleSheet(R"( + PrimeAdWidget { + border-radius: 10px; + background-color: #333333; + } + )"); +} + + +SetupWidget::SetupWidget(QWidget* parent) : QFrame(parent) { + mainLayout = new QStackedWidget; + + // Unpaired, registration prompt layout + + QWidget* finishRegistration = new QWidget; + finishRegistration->setObjectName("primeWidget"); + QVBoxLayout* finishRegistationLayout = new QVBoxLayout(finishRegistration); + finishRegistationLayout->setContentsMargins(30, 75, 30, 45); + finishRegistationLayout->setSpacing(0); + + QLabel* registrationTitle = new QLabel("Finish Setup"); + registrationTitle->setStyleSheet("font-size: 75px; font-weight: bold; margin-left: 55px;"); + finishRegistationLayout->addWidget(registrationTitle); + + finishRegistationLayout->addSpacing(30); + + QLabel* registrationDescription = new QLabel("Pair your device with comma connect (connect.comma.ai) and claim your comma prime offer."); + registrationDescription->setWordWrap(true); + registrationDescription->setStyleSheet("font-size: 55px; font-weight: light; margin-left: 55px;"); + finishRegistationLayout->addWidget(registrationDescription); + + finishRegistationLayout->addStretch(); + + QPushButton* pair = new QPushButton("Pair device"); + pair->setFixedHeight(220); + pair->setStyleSheet(R"( + QPushButton { + font-size: 55px; + font-weight: 400; + border-radius: 10px; + background-color: #465BEA; + } + QPushButton:pressed { + background-color: #3049F4; + } + )"); + finishRegistationLayout->addWidget(pair); + + popup = new PairingPopup(this); + QObject::connect(pair, &QPushButton::clicked, popup, &PairingPopup::exec); + + mainLayout->addWidget(finishRegistration); + + // build stacked layout + QVBoxLayout *outer_layout = new QVBoxLayout(this); + outer_layout->setContentsMargins(0, 0, 0, 0); + outer_layout->addWidget(mainLayout); + + primeAd = new PrimeAdWidget; + mainLayout->addWidget(primeAd); + + primeUser = new PrimeUserWidget; + mainLayout->addWidget(primeUser); + + mainLayout->setCurrentWidget(primeAd); + + setFixedWidth(750); + setStyleSheet(R"( + #primeWidget { + border-radius: 10px; + background-color: #333333; + } + )"); + + // Retain size while hidden + QSizePolicy sp_retain = sizePolicy(); + sp_retain.setRetainSizeWhenHidden(true); + setSizePolicy(sp_retain); + + // set up API requests + if (auto dongleId = getDongleId()) { + QString url = CommaApi::BASE_URL + "/v1.1/devices/" + *dongleId + "/"; + RequestRepeater* repeater = new RequestRepeater(this, url, "ApiCache_Device", 5); + + QObject::connect(repeater, &RequestRepeater::requestDone, this, &SetupWidget::replyFinished); + } + hide(); // Only show when first request comes back +} + +void SetupWidget::replyFinished(const QString &response, bool success) { + show(); + if (!success) return; + + QJsonDocument doc = QJsonDocument::fromJson(response.toUtf8()); + if (doc.isNull()) { + qDebug() << "JSON Parse failed on getting pairing and prime status"; + return; + } + + QJsonObject json = doc.object(); + int prime_type = json["prime_type"].toInt(); + + if (uiState()->prime_type != prime_type) { + uiState()->prime_type = prime_type; + Params().put("PrimeType", std::to_string(prime_type)); + } + + if (!json["is_paired"].toBool()) { + mainLayout->setCurrentIndex(0); + } else { + popup->reject(); + + if (prime_type) { + mainLayout->setCurrentWidget(primeUser); + } else { + mainLayout->setCurrentWidget(primeAd); + } + } +} diff --git a/selfdrive/ui/qt/widgets/prime.h b/selfdrive/ui/qt/widgets/prime.h new file mode 100644 index 000000000..566238fc3 --- /dev/null +++ b/selfdrive/ui/qt/widgets/prime.h @@ -0,0 +1,78 @@ +#pragma once + +#include +#include +#include +#include + +#include "selfdrive/ui/qt/widgets/input.h" + +enum PrimeType { + NONE = 0, + MAGENTA, + LITE, +}; + +// pairing QR code +class PairingQRWidget : public QWidget { + Q_OBJECT + +public: + explicit PairingQRWidget(QWidget* parent = 0); + void paintEvent(QPaintEvent*) override; + +private: + QPixmap img; + void updateQrCode(const QString &text); + void showEvent(QShowEvent *event) override; + +private slots: + void refresh(); +}; + +// pairing popup widget +class PairingPopup : public QDialogBase { + Q_OBJECT + +public: + explicit PairingPopup(QWidget* parent); +}; + +// widget for paired users with prime +class PrimeUserWidget : public QWidget { + Q_OBJECT +public: + explicit PrimeUserWidget(QWidget* parent = 0); + +private: + QVBoxLayout* mainLayout; + QLabel* points; + +private slots: + void replyFinished(const QString &response); +}; + + +// widget for paired users without prime +class PrimeAdWidget : public QFrame { + Q_OBJECT +public: + explicit PrimeAdWidget(QWidget* parent = 0); +}; + +// container widget +class SetupWidget : public QFrame { + Q_OBJECT + +public: + explicit SetupWidget(QWidget* parent = 0); + +private: + PairingPopup *popup; + QStackedWidget *mainLayout; + PrimeAdWidget *primeAd; + PrimeUserWidget *primeUser; + +private slots: + void replyFinished(const QString &response, bool success); +}; diff --git a/selfdrive/ui/qt/widgets/scrollview.cc b/selfdrive/ui/qt/widgets/scrollview.cc new file mode 100644 index 000000000..1aa05b415 --- /dev/null +++ b/selfdrive/ui/qt/widgets/scrollview.cc @@ -0,0 +1,47 @@ +#include "selfdrive/ui/qt/widgets/scrollview.h" + +#include +#include + +ScrollView::ScrollView(QWidget *w, QWidget *parent) : QScrollArea(parent) { + setWidget(w); + setWidgetResizable(true); + setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setStyleSheet("background-color: transparent;"); + + QString style = R"( + QScrollBar:vertical { + border: none; + background: transparent; + width: 10px; + margin: 0; + } + QScrollBar::handle:vertical { + min-height: 0px; + border-radius: 5px; + background-color: white; + } + QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { + height: 0px; + } + QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { + background: none; + } + )"; + verticalScrollBar()->setStyleSheet(style); + horizontalScrollBar()->setStyleSheet(style); + + QScroller *scroller = QScroller::scroller(this->viewport()); + QScrollerProperties sp = scroller->scrollerProperties(); + + sp.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootAlwaysOff)); + sp.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootAlwaysOff)); + + scroller->grabGesture(this->viewport(), QScroller::LeftMouseButtonGesture); + scroller->setScrollerProperties(sp); +} + +void ScrollView::hideEvent(QHideEvent *e) { + verticalScrollBar()->setValue(0); +} diff --git a/selfdrive/ui/qt/widgets/scrollview.h b/selfdrive/ui/qt/widgets/scrollview.h new file mode 100644 index 000000000..024331aa3 --- /dev/null +++ b/selfdrive/ui/qt/widgets/scrollview.h @@ -0,0 +1,12 @@ +#pragma once + +#include + +class ScrollView : public QScrollArea { + Q_OBJECT + +public: + explicit ScrollView(QWidget *w = nullptr, QWidget *parent = nullptr); +protected: + void hideEvent(QHideEvent *e) override; +}; diff --git a/selfdrive/ui/qt/widgets/setup.cc b/selfdrive/ui/qt/widgets/setup.cc new file mode 100644 index 000000000..a0480ed1a --- /dev/null +++ b/selfdrive/ui/qt/widgets/setup.cc @@ -0,0 +1,278 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "QrCode.hpp" +#include "request_repeater.hpp" +#include "common/params.h" +#include "setup.hpp" + +using qrcodegen::QrCode; + +PairingQRWidget::PairingQRWidget(QWidget* parent) : QWidget(parent) { + qrCode = new QLabel; + qrCode->setScaledContents(true); + QVBoxLayout* v = new QVBoxLayout; + v->addWidget(qrCode, 0, Qt::AlignCenter); + setLayout(v); + + QTimer* timer = new QTimer(this); + timer->start(30 * 1000); + connect(timer, SIGNAL(timeout()), this, SLOT(refresh())); + refresh(); // don't wait for the first refresh +} + +void PairingQRWidget::refresh(){ + QString IMEI = QString::fromStdString(Params().get("IMEI")); + QString serial = QString::fromStdString(Params().get("HardwareSerial")); + + if (std::min(IMEI.length(), serial.length()) <= 5) { + qrCode->setText("Error getting serial: contact support"); + qrCode->setWordWrap(true); + qrCode->setStyleSheet(R"(font-size: 60px;)"); + return; + } + QString pairToken = CommaApi::create_jwt({{"pair", true}}); + + QString qrString = IMEI + "--" + serial + "--" + pairToken; + this->updateQrCode(qrString); +} + +void PairingQRWidget::updateQrCode(QString text) { + QrCode qr = QrCode::encodeText(text.toUtf8().data(), QrCode::Ecc::LOW); + qint32 sz = qr.getSize(); + // make the image larger so we can have a white border + QImage im(sz + 2, sz + 2, QImage::Format_RGB32); + QRgb black = qRgb(0, 0, 0); + QRgb white = qRgb(255, 255, 255); + + for (int y = 0; y < sz + 2; y++) { + for (int x = 0; x < sz + 2; x++) { + im.setPixel(x, y, white); + } + } + for (int y = 0; y < sz; y++) { + for (int x = 0; x < sz; x++) { + im.setPixel(x + 1, y + 1, qr.getModule(x, y) ? black : white); + } + } + // Integer division to prevent anti-aliasing + int approx500 = (500 / (sz + 2)) * (sz + 2); + qrCode->setPixmap(QPixmap::fromImage(im.scaled(approx500, approx500, Qt::KeepAspectRatio, Qt::FastTransformation), Qt::MonoOnly)); + qrCode->setFixedSize(approx500, approx500); +} + +PrimeUserWidget::PrimeUserWidget(QWidget* parent) : QWidget(parent) { + mainLayout = new QVBoxLayout; + mainLayout->setMargin(30); + + QLabel* commaPrime = new QLabel("COMMA PRIME"); + mainLayout->addWidget(commaPrime, 0, Qt::AlignTop); + + username = new QLabel(); + username->setStyleSheet("font-size: 55px;"); // TODO: fit width + mainLayout->addWidget(username, 0, Qt::AlignTop); + + mainLayout->addSpacing(100); + + QLabel* commaPoints = new QLabel("COMMA POINTS"); + commaPoints->setStyleSheet(R"( + color: #b8b8b8; + )"); + mainLayout->addWidget(commaPoints, 0, Qt::AlignTop); + + points = new QLabel(); + mainLayout->addWidget(points, 0, Qt::AlignTop); + + setLayout(mainLayout); + setStyleSheet(R"( + QLabel { + font-size: 70px; + font-weight: 500; + } + )"); + + // set up API requests + QString dongleId = QString::fromStdString(Params().get("DongleId")); + if (!dongleId.length()) { + return; + } + + QString url = "https://api.commadotai.com/v1/devices/" + dongleId + "/owner"; + RequestRepeater *repeater = new RequestRepeater(this, url, "ApiCache_Owner", 6); + QObject::connect(repeater, SIGNAL(receivedResponse(QString)), this, SLOT(replyFinished(QString))); +} + +void PrimeUserWidget::replyFinished(QString response) { + QJsonDocument doc = QJsonDocument::fromJson(response.toUtf8()); + if (doc.isNull()) { + qDebug() << "JSON Parse failed on getting username and points"; + return; + } + + QJsonObject json = doc.object(); + QString points_str = QString::number(json["points"].toInt()); + QString username_str = json["username"].toString(); + if (username_str.length()) { + username_str = "@" + username_str; + } + + username->setText(username_str); + points->setText(points_str); +} + +PrimeAdWidget::PrimeAdWidget(QWidget* parent) : QWidget(parent) { + QVBoxLayout* vlayout = new QVBoxLayout; + vlayout->setMargin(30); + vlayout->setSpacing(15); + + vlayout->addWidget(new QLabel("Upgrade now"), 1, Qt::AlignTop); + + QLabel* description = new QLabel("Become a comma prime member in the comma connect app and get premium features!"); + description->setStyleSheet(R"( + font-size: 50px; + color: #b8b8b8; + )"); + description->setWordWrap(true); + vlayout->addWidget(description, 2, Qt::AlignTop); + + QVector features = {"✓ REMOTE ACCESS", "✓ 14 DAYS OF STORAGE", "✓ DEVELOPER PERKS"}; + for (auto &f: features) { + QLabel* feature = new QLabel(f); + feature->setStyleSheet(R"(font-size: 40px;)"); + vlayout->addWidget(feature, 0, Qt::AlignBottom); + } + + setLayout(vlayout); +} + + +SetupWidget::SetupWidget(QWidget* parent) : QFrame(parent) { + mainLayout = new QStackedWidget; + + // Unpaired, registration prompt layout + + QVBoxLayout* finishRegistationLayout = new QVBoxLayout; + finishRegistationLayout->setMargin(30); + + QLabel* registrationDescription = new QLabel("Pair your device with the comma connect app"); + registrationDescription->setWordWrap(true); + registrationDescription->setAlignment(Qt::AlignCenter); + registrationDescription->setStyleSheet(R"( + font-size: 55px; + font-weight: 400; + )"); + + finishRegistationLayout->addWidget(registrationDescription); + + QPushButton* finishButton = new QPushButton("Finish setup"); + finishButton->setFixedHeight(200); + finishButton->setStyleSheet(R"( + border-radius: 30px; + font-size: 55px; + font-weight: 500; + background: #585858; + )"); + finishRegistationLayout->addWidget(finishButton); + QObject::connect(finishButton, SIGNAL(released()), this, SLOT(showQrCode())); + + QWidget* finishRegistration = new QWidget; + finishRegistration->setLayout(finishRegistationLayout); + mainLayout->addWidget(finishRegistration); + + // Pairing QR code layout + + QVBoxLayout* qrLayout = new QVBoxLayout; + + qrLayout->addSpacing(30); + QLabel* qrLabel = new QLabel("Scan with comma connect!"); + qrLabel->setWordWrap(true); + qrLabel->setAlignment(Qt::AlignHCenter); + qrLabel->setStyleSheet(R"( + font-size: 55px; + font-weight: 400; + )"); + qrLayout->addWidget(qrLabel, 0, Qt::AlignTop); + + qrLayout->addWidget(new PairingQRWidget, 1); + + QWidget* q = new QWidget; + q->setLayout(qrLayout); + mainLayout->addWidget(q); + + primeAd = new PrimeAdWidget; + mainLayout->addWidget(primeAd); + + primeUser = new PrimeUserWidget; + mainLayout->addWidget(primeUser); + + mainLayout->setCurrentWidget(primeAd); + + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(mainLayout); + setLayout(layout); + + setStyleSheet(R"( + SetupWidget { + background-color: #292929; + } + * { + font-size: 90px; + font-weight: 500; + border-radius: 40px; + } + )"); + + // Retain size while hidden + QSizePolicy sp_retain = sizePolicy(); + sp_retain.setRetainSizeWhenHidden(true); + setSizePolicy(sp_retain); + + // set up API requests + QString dongleId = QString::fromStdString(Params().get("DongleId")); + QString url = "https://api.commadotai.com/v1.1/devices/" + dongleId + "/"; + RequestRepeater* repeater = new RequestRepeater(this, url, "ApiCache_Device", 5); + + QObject::connect(repeater, SIGNAL(receivedResponse(QString)), this, SLOT(replyFinished(QString))); + QObject::connect(repeater, SIGNAL(failedResponse(QString)), this, SLOT(parseError(QString))); + hide(); // Only show when first request comes back +} + +void SetupWidget::parseError(QString response) { + show(); + showQr = false; + mainLayout->setCurrentIndex(0); +} + +void SetupWidget::showQrCode(){ + showQr = true; + mainLayout->setCurrentIndex(1); +} + +void SetupWidget::replyFinished(QString response) { + show(); + QJsonDocument doc = QJsonDocument::fromJson(response.toUtf8()); + if (doc.isNull()) { + qDebug() << "JSON Parse failed on getting pairing and prime status"; + return; + } + + QJsonObject json = doc.object(); + bool is_paired = json["is_paired"].toBool(); + bool is_prime = json["prime"].toBool(); + + if (!is_paired) { + mainLayout->setCurrentIndex(showQr); + } else if (!is_prime) { + showQr = false; + mainLayout->setCurrentWidget(primeAd); + } else { + showQr = false; + mainLayout->setCurrentWidget(primeUser); + } +} diff --git a/selfdrive/ui/qt/widgets/ssh_keys.cc b/selfdrive/ui/qt/widgets/ssh_keys.cc new file mode 100644 index 000000000..7630e6573 --- /dev/null +++ b/selfdrive/ui/qt/widgets/ssh_keys.cc @@ -0,0 +1,65 @@ +#include "selfdrive/ui/qt/widgets/ssh_keys.h" + +#include "selfdrive/common/params.h" +#include "selfdrive/ui/qt/api.h" +#include "selfdrive/ui/qt/widgets/input.h" + +SshControl::SshControl() : ButtonControl("SSH Keys", "", "Warning: This grants SSH access to all public keys in your GitHub settings. Never enter a GitHub username other than your own. A comma employee will NEVER ask you to add their GitHub username.") { + username_label.setAlignment(Qt::AlignRight | Qt::AlignVCenter); + username_label.setStyleSheet("color: #aaaaaa"); + hlayout->insertWidget(1, &username_label); + + QObject::connect(this, &ButtonControl::clicked, [=]() { + if (text() == "ADD") { + QString username = InputDialog::getText("Enter your GitHub username", this); + if (username.length() > 0) { + setText("LOADING"); + setEnabled(false); + getUserKeys(username); + } + } else { + params.remove("GithubUsername"); + params.remove("GithubSshKeys"); + refresh(); + } + }); + + refresh(); +} + +void SshControl::refresh() { + QString param = QString::fromStdString(params.get("GithubSshKeys")); + if (param.length()) { + username_label.setText(QString::fromStdString(params.get("GithubUsername"))); + setText("REMOVE"); + } else { + username_label.setText(""); + setText("ADD"); + } + setEnabled(true); +} + +void SshControl::getUserKeys(const QString &username) { + HttpRequest *request = new HttpRequest(this, false); + QObject::connect(request, &HttpRequest::requestDone, [=](const QString &resp, bool success) { + if (success) { + if (!resp.isEmpty()) { + params.put("GithubUsername", username.toStdString()); + params.put("GithubSshKeys", resp.toStdString()); + } else { + ConfirmationDialog::alert(QString("Username '%1' has no keys on GitHub").arg(username), this); + } + } else { + if (request->timeout()) { + ConfirmationDialog::alert("Request timed out", this); + } else { + ConfirmationDialog::alert(QString("Username '%1' doesn't exist on GitHub").arg(username), this); + } + } + + refresh(); + request->deleteLater(); + }); + + request->sendRequest("https://github.com/" + username + ".keys"); +} diff --git a/selfdrive/ui/qt/widgets/ssh_keys.h b/selfdrive/ui/qt/widgets/ssh_keys.h new file mode 100644 index 000000000..0614e8c1d --- /dev/null +++ b/selfdrive/ui/qt/widgets/ssh_keys.h @@ -0,0 +1,34 @@ +#pragma once + +#include + +#include "selfdrive/hardware/hw.h" +#include "selfdrive/ui/qt/widgets/controls.h" + +// SSH enable toggle +class SshToggle : public ToggleControl { + Q_OBJECT + +public: + SshToggle() : ToggleControl("Enable SSH", "", "", Hardware::get_ssh_enabled()) { + QObject::connect(this, &SshToggle::toggleFlipped, [=](bool state) { + Hardware::set_ssh_enabled(state); + }); + } +}; + +// SSH key management widget +class SshControl : public ButtonControl { + Q_OBJECT + +public: + SshControl(); + +private: + Params params; + + QLabel username_label; + + void refresh(); + void getUserKeys(const QString &username); +}; diff --git a/selfdrive/ui/qt/widgets/toggle.cc b/selfdrive/ui/qt/widgets/toggle.cc new file mode 100644 index 000000000..82302ad5b --- /dev/null +++ b/selfdrive/ui/qt/widgets/toggle.cc @@ -0,0 +1,83 @@ +#include "selfdrive/ui/qt/widgets/toggle.h" + +#include + +Toggle::Toggle(QWidget *parent) : QAbstractButton(parent), +_height(80), +_height_rect(60), +on(false), +_anim(new QPropertyAnimation(this, "offset_circle", this)) +{ + _radius = _height / 2; + _x_circle = _radius; + _y_circle = _radius; + _y_rect = (_height - _height_rect)/2; + circleColor = QColor(0xffffff); // placeholder + green = QColor(0xffffff); // placeholder + setEnabled(true); +} + +void Toggle::paintEvent(QPaintEvent *e) { + this->setFixedHeight(_height); + QPainter p(this); + p.setPen(Qt::NoPen); + p.setRenderHint(QPainter::Antialiasing, true); + + // Draw toggle background left + p.setBrush(green); + p.drawRoundedRect(QRect(0, _y_rect, _x_circle + _radius, _height_rect), _height_rect/2, _height_rect/2); + + // Draw toggle background right + p.setBrush(QColor(0x393939)); + p.drawRoundedRect(QRect(_x_circle - _radius, _y_rect, width() - (_x_circle - _radius), _height_rect), _height_rect/2, _height_rect/2); + + // Draw toggle circle + p.setBrush(circleColor); + p.drawEllipse(QRectF(_x_circle - _radius, _y_circle - _radius, 2 * _radius, 2 * _radius)); +} + +void Toggle::mouseReleaseEvent(QMouseEvent *e) { + if (!enabled) { + return; + } + const int left = _radius; + const int right = width() - _radius; + if ((_x_circle != left && _x_circle != right) || !this->rect().contains(e->localPos().toPoint())) { + // If mouse release isn't in rect or animation is running, don't parse touch events + return; + } + if (e->button() & Qt::LeftButton) { + togglePosition(); + emit stateChanged(on); + } +} + +void Toggle::togglePosition() { + on = !on; + const int left = _radius; + const int right = width() - _radius; + _anim->setStartValue(on ? left + immediateOffset : right - immediateOffset); + _anim->setEndValue(on ? right : left); + _anim->setDuration(animation_duration); + _anim->start(); + repaint(); +} + +void Toggle::enterEvent(QEvent *e) { + QAbstractButton::enterEvent(e); +} + +bool Toggle::getEnabled() { + return enabled; +} + +void Toggle::setEnabled(bool value) { + enabled = value; + if (value) { + circleColor.setRgb(0xfafafa); + green.setRgb(0x33ab4c); + } else { + circleColor.setRgb(0x888888); + green.setRgb(0x227722); + } +} diff --git a/selfdrive/ui/qt/widgets/toggle.h b/selfdrive/ui/qt/widgets/toggle.h new file mode 100644 index 000000000..e7263a008 --- /dev/null +++ b/selfdrive/ui/qt/widgets/toggle.h @@ -0,0 +1,44 @@ +#pragma once + +#include +#include +#include + +class Toggle : public QAbstractButton { + Q_OBJECT + Q_PROPERTY(int offset_circle READ offset_circle WRITE set_offset_circle CONSTANT) + +public: + Toggle(QWidget* parent = nullptr); + void togglePosition(); + bool on; + int animation_duration = 150; + int immediateOffset = 0; + int offset_circle() const { + return _x_circle; + } + + void set_offset_circle(int o) { + _x_circle = o; + update(); + } + bool getEnabled(); + void setEnabled(bool value); + +protected: + void paintEvent(QPaintEvent*) override; + void mouseReleaseEvent(QMouseEvent*) override; + void enterEvent(QEvent*) override; + +private: + QColor circleColor; + QColor green; + bool enabled = true; + int _x_circle, _y_circle; + int _height, _radius; + int _height_rect, _y_rect; + QPropertyAnimation *_anim = nullptr; + +signals: + void stateChanged(bool new_state); +}; diff --git a/selfdrive/ui/qt/window.cc b/selfdrive/ui/qt/window.cc new file mode 100644 index 000000000..76d5a39d4 --- /dev/null +++ b/selfdrive/ui/qt/window.cc @@ -0,0 +1,99 @@ +#include "selfdrive/ui/qt/window.h" + +#include + +#include "selfdrive/hardware/hw.h" + +MainWindow::MainWindow(QWidget *parent) : QWidget(parent) { + main_layout = new QStackedLayout(this); + main_layout->setMargin(0); + + homeWindow = new HomeWindow(this); + main_layout->addWidget(homeWindow); + QObject::connect(homeWindow, &HomeWindow::openSettings, this, &MainWindow::openSettings); + QObject::connect(homeWindow, &HomeWindow::closeSettings, this, &MainWindow::closeSettings); + + settingsWindow = new SettingsWindow(this); + main_layout->addWidget(settingsWindow); + QObject::connect(settingsWindow, &SettingsWindow::closeSettings, this, &MainWindow::closeSettings); + QObject::connect(settingsWindow, &SettingsWindow::reviewTrainingGuide, [=]() { + onboardingWindow->showTrainingGuide(); + main_layout->setCurrentWidget(onboardingWindow); + }); + QObject::connect(settingsWindow, &SettingsWindow::showDriverView, [=] { + homeWindow->showDriverView(true); + }); + + onboardingWindow = new OnboardingWindow(this); + main_layout->addWidget(onboardingWindow); + QObject::connect(onboardingWindow, &OnboardingWindow::onboardingDone, [=]() { + main_layout->setCurrentWidget(homeWindow); + }); + if (!onboardingWindow->completed()) { + main_layout->setCurrentWidget(onboardingWindow); + } + + QObject::connect(uiState(), &UIState::offroadTransition, [=](bool offroad) { + if (!offroad) { + closeSettings(); + } + }); + QObject::connect(&device, &Device::interactiveTimout, [=]() { + if (main_layout->currentWidget() == settingsWindow) { + closeSettings(); + } + }); + + // load fonts + QFontDatabase::addApplicationFont("../assets/fonts/opensans_regular.ttf"); + QFontDatabase::addApplicationFont("../assets/fonts/opensans_bold.ttf"); + QFontDatabase::addApplicationFont("../assets/fonts/opensans_semibold.ttf"); + QFontDatabase::addApplicationFont("../assets/fonts/Inter-Black.ttf"); + QFontDatabase::addApplicationFont("../assets/fonts/Inter-Bold.ttf"); + QFontDatabase::addApplicationFont("../assets/fonts/Inter-ExtraBold.ttf"); + QFontDatabase::addApplicationFont("../assets/fonts/Inter-ExtraLight.ttf"); + QFontDatabase::addApplicationFont("../assets/fonts/Inter-Medium.ttf"); + QFontDatabase::addApplicationFont("../assets/fonts/Inter-Regular.ttf"); + QFontDatabase::addApplicationFont("../assets/fonts/Inter-SemiBold.ttf"); + QFontDatabase::addApplicationFont("../assets/fonts/Inter-Thin.ttf"); + + // no outline to prevent the focus rectangle + setStyleSheet(R"( + * { + font-family: Inter; + outline: none; + } + )"); + setAttribute(Qt::WA_NoSystemBackground); +} + +void MainWindow::openSettings() { + main_layout->setCurrentWidget(settingsWindow); +} + +void MainWindow::closeSettings() { + main_layout->setCurrentWidget(homeWindow); + + if (uiState()->scene.started) { + homeWindow->showSidebar(false); + } +} + +bool MainWindow::eventFilter(QObject *obj, QEvent *event) { + const static QSet evts({QEvent::MouseButtonPress, QEvent::MouseMove, + QEvent::TouchBegin, QEvent::TouchUpdate, QEvent::TouchEnd}); + + if (evts.contains(event->type())) { + device.resetInteractiveTimout(); +#ifdef QCOM + // filter out touches while in android activity + if (HardwareEon::launched_activity) { + HardwareEon::check_activity(); + if (HardwareEon::launched_activity) { + return true; + } + } +#endif + } + return false; +} diff --git a/selfdrive/ui/qt/window.h b/selfdrive/ui/qt/window.h new file mode 100644 index 000000000..0bd328aa8 --- /dev/null +++ b/selfdrive/ui/qt/window.h @@ -0,0 +1,27 @@ +#pragma once + +#include +#include + +#include "selfdrive/ui/qt/home.h" +#include "selfdrive/ui/qt/offroad/onboarding.h" +#include "selfdrive/ui/qt/offroad/settings.h" + +class MainWindow : public QWidget { + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + +private: + bool eventFilter(QObject *obj, QEvent *event) override; + void openSettings(); + void closeSettings(); + + Device device; + + QStackedLayout *main_layout; + HomeWindow *homeWindow; + SettingsWindow *settingsWindow; + OnboardingWindow *onboardingWindow; +}; diff --git a/selfdrive/ui/replay/camera.cc b/selfdrive/ui/replay/camera.cc new file mode 100644 index 000000000..9bcc00583 --- /dev/null +++ b/selfdrive/ui/replay/camera.cc @@ -0,0 +1,86 @@ +#include "selfdrive/ui/replay/camera.h" +#include "selfdrive/ui/replay/util.h" + +#include + +CameraServer::CameraServer(std::pair camera_size[MAX_CAMERAS], bool send_yuv) : send_yuv(send_yuv) { + for (int i = 0; i < MAX_CAMERAS; ++i) { + std::tie(cameras_[i].width, cameras_[i].height) = camera_size[i]; + } + startVipcServer(); +} + +CameraServer::~CameraServer() { + for (auto &cam : cameras_) { + if (cam.thread.joinable()) { + cam.queue.push({}); + cam.thread.join(); + } + } + vipc_server_.reset(nullptr); +} + +void CameraServer::startVipcServer() { + vipc_server_.reset(new VisionIpcServer("camerad")); + for (auto &cam : cameras_) { + if (cam.width > 0 && cam.height > 0) { + rInfo("camera[%d] frame size %dx%d", cam.type, cam.width, cam.height); + vipc_server_->create_buffers(cam.rgb_type, UI_BUF_COUNT, true, cam.width, cam.height); + if (send_yuv) { + vipc_server_->create_buffers(cam.yuv_type, YUV_BUFFER_COUNT, false, cam.width, cam.height); + } + if (!cam.thread.joinable()) { + cam.thread = std::thread(&CameraServer::cameraThread, this, std::ref(cam)); + } + } + } + vipc_server_->start_listener(); +} + +void CameraServer::cameraThread(Camera &cam) { + auto read_frame = [&](FrameReader *fr, int frame_id) { + VisionBuf *rgb_buf = vipc_server_->get_buffer(cam.rgb_type); + VisionBuf *yuv_buf = send_yuv ? vipc_server_->get_buffer(cam.yuv_type) : nullptr; + bool ret = fr->get(frame_id, (uint8_t *)rgb_buf->addr, yuv_buf ? (uint8_t *)yuv_buf->addr : nullptr); + return ret ? std::pair{rgb_buf, yuv_buf} : std::pair{nullptr, nullptr}; + }; + + while (true) { + const auto [fr, eidx] = cam.queue.pop(); + if (!fr) break; + + const int id = eidx.getSegmentId(); + bool prefetched = (id == cam.cached_id && eidx.getSegmentNum() == cam.cached_seg); + auto [rgb, yuv] = prefetched ? cam.cached_buf : read_frame(fr, id); + if (rgb || yuv) { + VisionIpcBufExtra extra = { + .frame_id = eidx.getFrameId(), + .timestamp_sof = eidx.getTimestampSof(), + .timestamp_eof = eidx.getTimestampEof(), + }; + if (rgb) vipc_server_->send(rgb, &extra, false); + if (yuv) vipc_server_->send(yuv, &extra, false); + } else { + rError("camera[%d] failed to get frame:", cam.type, eidx.getSegmentId()); + } + + cam.cached_id = id + 1; + cam.cached_seg = eidx.getSegmentNum(); + cam.cached_buf = read_frame(fr, cam.cached_id); + + --publishing_; + } +} + +void CameraServer::pushFrame(CameraType type, FrameReader *fr, const cereal::EncodeIndex::Reader &eidx) { + auto &cam = cameras_[type]; + if (cam.width != fr->width || cam.height != fr->height) { + cam.width = fr->width; + cam.height = fr->height; + waitFinish(); + startVipcServer(); + } + + ++publishing_; + cam.queue.push({fr, eidx}); +} diff --git a/selfdrive/ui/replay/camera.h b/selfdrive/ui/replay/camera.h new file mode 100644 index 000000000..340a120e8 --- /dev/null +++ b/selfdrive/ui/replay/camera.h @@ -0,0 +1,42 @@ +#pragma once + +#include +#include "cereal/visionipc/visionipc_server.h" +#include "selfdrive/common/queue.h" +#include "selfdrive/ui/replay/framereader.h" +#include "selfdrive/ui/replay/logreader.h" + +class CameraServer { +public: + CameraServer(std::pair camera_size[MAX_CAMERAS] = nullptr, bool send_yuv = false); + ~CameraServer(); + void pushFrame(CameraType type, FrameReader* fr, const cereal::EncodeIndex::Reader& eidx); + inline void waitFinish() { + while (publishing_ > 0) usleep(0); + } + +protected: + struct Camera { + CameraType type; + VisionStreamType rgb_type; + VisionStreamType yuv_type; + int width; + int height; + std::thread thread; + SafeQueue> queue; + int cached_id = -1; + int cached_seg = -1; + std::pair cached_buf; + }; + void startVipcServer(); + void cameraThread(Camera &cam); + + Camera cameras_[MAX_CAMERAS] = { + {.type = RoadCam, .rgb_type = VISION_STREAM_RGB_BACK, .yuv_type = VISION_STREAM_ROAD}, + {.type = DriverCam, .rgb_type = VISION_STREAM_RGB_FRONT, .yuv_type = VISION_STREAM_DRIVER}, + {.type = WideRoadCam, .rgb_type = VISION_STREAM_RGB_WIDE, .yuv_type = VISION_STREAM_WIDE_ROAD}, + }; + std::atomic publishing_ = 0; + std::unique_ptr vipc_server_; + bool send_yuv; +}; diff --git a/selfdrive/ui/replay/consoleui.cc b/selfdrive/ui/replay/consoleui.cc new file mode 100644 index 000000000..72e2fcf80 --- /dev/null +++ b/selfdrive/ui/replay/consoleui.cc @@ -0,0 +1,353 @@ +#include "selfdrive/ui/replay/consoleui.h" + +#include +#include + +#include "selfdrive/common/version.h" + +namespace { + +const int BORDER_SIZE = 3; + +const std::initializer_list> keyboard_shortcuts[] = { + { + {"s", "+10s"}, + {"shift+s", "-10s"}, + {"m", "+60s"}, + {"shift+m", "-60s"}, + {"space", "Pause/Resume"}, + {"e", "Next Engagement"}, + {"d", "Next Disengagement"}, + }, + { + {"enter", "Enter seek request"}, + {"x", "+/-Replay speed"}, + {"q", "Exit"}, + }, +}; + +enum Color { + Default, + Debug, + Yellow, + Green, + Red, + BrightWhite, + Engaged, + Disengaged, +}; + +void add_str(WINDOW *w, const char *str, Color color = Color::Default, bool bold = false) { + if (color != Color::Default) wattron(w, COLOR_PAIR(color)); + if (bold) wattron(w, A_BOLD); + waddstr(w, str); + if (bold) wattroff(w, A_BOLD); + if (color != Color::Default) wattroff(w, COLOR_PAIR(color)); +} + +std::string format_seconds(int s) { + int total_minutes = s / 60; + int seconds = s % 60; + int hours = total_minutes / 60; + int minutes = total_minutes % 60; + return util::string_format("%02d:%02d:%02d", hours, minutes, seconds); +} + +} // namespace + +ConsoleUI::ConsoleUI(Replay *replay, QObject *parent) : replay(replay), sm({"carState", "liveParameters"}), QObject(parent) { + // Initialize curses + initscr(); + clear(); + curs_set(false); + cbreak(); // Line buffering disabled. pass on everything + noecho(); + keypad(stdscr, true); + nodelay(stdscr, true); // non-blocking getchar() + + // Initialize all the colors. https://www.ditig.com/256-colors-cheat-sheet + start_color(); + init_pair(Color::Debug, 246, COLOR_BLACK); // #949494 + init_pair(Color::Yellow, 184, COLOR_BLACK); + init_pair(Color::Red, COLOR_RED, COLOR_BLACK); + init_pair(Color::BrightWhite, 15, COLOR_BLACK); + init_pair(Color::Disengaged, COLOR_BLUE, COLOR_BLUE); + init_pair(Color::Engaged, 28, 28); + init_pair(Color::Green, 34, COLOR_BLACK); + + initWindows(); + + qRegisterMetaType("uint64_t"); + qRegisterMetaType("ReplyMsgType"); + installMessageHandler([this](ReplyMsgType type, const std::string msg) { + emit logMessageSignal(type, QString::fromStdString(msg)); + }); + installDownloadProgressHandler([this](uint64_t cur, uint64_t total, bool success) { + emit updateProgressBarSignal(cur, total, success); + }); + + QObject::connect(replay, &Replay::streamStarted, this, &ConsoleUI::updateSummary); + QObject::connect(¬ifier, SIGNAL(activated(int)), SLOT(readyRead())); + QObject::connect(this, &ConsoleUI::updateProgressBarSignal, this, &ConsoleUI::updateProgressBar); + QObject::connect(this, &ConsoleUI::logMessageSignal, this, &ConsoleUI::logMessage); + + sm_timer.callOnTimeout(this, &ConsoleUI::updateStatus); + sm_timer.start(100); + getch_timer.start(1000, this); + readyRead(); +} + +ConsoleUI::~ConsoleUI() { + endwin(); +} + +void ConsoleUI::initWindows() { + getmaxyx(stdscr, max_height, max_width); + w.fill(nullptr); + w[Win::Title] = newwin(1, max_width, 0, 0); + w[Win::Stats] = newwin(2, max_width - 2 * BORDER_SIZE, 2, BORDER_SIZE); + w[Win::Timeline] = newwin(4, max_width - 2 * BORDER_SIZE, 5, BORDER_SIZE); + w[Win::TimelineDesc] = newwin(1, 100, 10, BORDER_SIZE); + w[Win::CarState] = newwin(3, 100, 12, BORDER_SIZE); + w[Win::DownloadBar] = newwin(1, 100, 16, BORDER_SIZE); + if (int log_height = max_height - 27; log_height > 4) { + w[Win::LogBorder] = newwin(log_height, max_width - 2 * (BORDER_SIZE - 1), 17, BORDER_SIZE - 1); + box(w[Win::LogBorder], 0, 0); + w[Win::Log] = newwin(log_height - 2, max_width - 2 * BORDER_SIZE, 18, BORDER_SIZE); + scrollok(w[Win::Log], true); + } + w[Win::Help] = newwin(5, max_width - (2 * BORDER_SIZE), max_height - 6, BORDER_SIZE); + + // set the title bar + wbkgd(w[Win::Title], A_REVERSE); + mvwprintw(w[Win::Title], 0, 3, "openpilot replay %s", COMMA_VERSION); + + // show windows on the real screen + refresh(); + displayTimelineDesc(); + displayHelp(); + updateSummary(); + updateTimeline(); + for (auto win : w) { + if (win) wrefresh(win); + } +} + +void ConsoleUI::timerEvent(QTimerEvent *ev) { + if (ev->timerId() != getch_timer.timerId()) return; + + if (is_term_resized(max_height, max_width)) { + for (auto win : w) { + if (win) delwin(win); + } + endwin(); + clear(); + refresh(); + initWindows(); + rWarning("resize term %dx%d", max_height, max_width); + } + updateTimeline(); +} + +void ConsoleUI::updateStatus() { + auto write_item = [this](int y, int x, const char *key, const std::string &value, const char *unit, + bool bold = false, Color color = Color::BrightWhite) { + auto win = w[Win::CarState]; + wmove(win, y, x); + add_str(win, key); + add_str(win, value.c_str(), color, bold); + add_str(win, unit); + }; + static const std::pair status_text[] = { + {"loading...", Color::Red}, + {"playing", Color::Green}, + {"paused...", Color::Yellow}, + }; + + sm.update(0); + + if (status != Status::Paused) { + status = (sm.updated("carState") || sm.updated("liveParameters")) ? Status::Playing : Status::Waiting; + } + auto [status_str, status_color] = status_text[status]; + write_item(0, 0, "STATUS: ", status_str, " ", false, status_color); + std::string suffix = util::string_format(" / %s [%d/%d] ", format_seconds(replay->totalSeconds()).c_str(), + replay->currentSeconds() / 60, replay->route()->segments().size()); + write_item(0, 25, "TIME: ", format_seconds(replay->currentSeconds()), suffix.c_str(), true); + + auto p = sm["liveParameters"].getLiveParameters(); + write_item(1, 0, "STIFFNESS: ", util::string_format("%.2f %%", p.getStiffnessFactor() * 100), " "); + write_item(1, 25, "SPEED: ", util::string_format("%.2f", sm["carState"].getCarState().getVEgo()), " m/s"); + write_item(2, 0, "STEER RATIO: ", util::string_format("%.2f", p.getSteerRatio()), ""); + auto angle_offsets = util::string_format("%.2f|%.2f", p.getAngleOffsetAverageDeg(), p.getAngleOffsetDeg()); + write_item(2, 25, "ANGLE OFFSET(AVG|INSTANT): ", angle_offsets, " deg"); + + wrefresh(w[Win::CarState]); +} + +void ConsoleUI::displayHelp() { + for (int i = 0; i < std::size(keyboard_shortcuts); ++i) { + wmove(w[Win::Help], i * 2, 0); + for (auto &[key, desc] : keyboard_shortcuts[i]) { + wattron(w[Win::Help], A_REVERSE); + waddstr(w[Win::Help], (' ' + key + ' ').c_str()); + wattroff(w[Win::Help], A_REVERSE); + waddstr(w[Win::Help], (' ' + desc + ' ').c_str()); + } + } + wrefresh(w[Win::Help]); +} + +void ConsoleUI::displayTimelineDesc() { + std::tuple indicators[]{ + {Color::Engaged, " Engaged ", false}, + {Color::Disengaged, " Disengaged ", false}, + {Color::Green, " Info ", true}, + {Color::Yellow, " Warning ", true}, + {Color::Red, " Critical ", true}, + }; + for (auto [color, name, bold] : indicators) { + add_str(w[Win::TimelineDesc], "__", color, bold); + add_str(w[Win::TimelineDesc], name); + } +} + +void ConsoleUI::logMessage(ReplyMsgType type, const QString &msg) { + if (auto win = w[Win::Log]) { + Color color = Color::Default; + if (type == ReplyMsgType::Debug) { + color = Color::Debug; + } else if (type == ReplyMsgType::Warning) { + color = Color::Yellow; + } else if (type == ReplyMsgType::Critical) { + color = Color::Red; + } + add_str(win, qPrintable(msg + "\n"), color); + wrefresh(win); + } +} + +void ConsoleUI::updateProgressBar(uint64_t cur, uint64_t total, bool success) { + werase(w[Win::DownloadBar]); + if (success && cur < total) { + const int width = 35; + const float progress = cur / (double)total; + const int pos = width * progress; + wprintw(w[Win::DownloadBar], "Downloading [%s>%s] %d%% %s", std::string(pos, '=').c_str(), + std::string(width - pos, ' ').c_str(), int(progress * 100.0), formattedDataSize(total).c_str()); + } + wrefresh(w[Win::DownloadBar]); +} + +void ConsoleUI::updateSummary() { + const auto &route = replay->route(); + mvwprintw(w[Win::Stats], 0, 0, "Route: %s, %d segments", qPrintable(route->name()), route->segments().size()); + mvwprintw(w[Win::Stats], 1, 0, "Car Fingerprint: %s", replay->carFingerprint().c_str()); + wrefresh(w[Win::Stats]); +} + +void ConsoleUI::updateTimeline() { + auto win = w[Win::Timeline]; + int width = getmaxx(win); + werase(win); + + wattron(win, COLOR_PAIR(Color::Disengaged)); + mvwhline(win, 1, 0, ' ', width); + mvwhline(win, 2, 0, ' ', width); + wattroff(win, COLOR_PAIR(Color::Disengaged)); + + const int total_sec = replay->totalSeconds(); + for (auto [begin, end, type] : replay->getTimeline()) { + int start_pos = ((double)begin / total_sec) * width; + int end_pos = ((double)end / total_sec) * width; + if (type == TimelineType::Engaged) { + mvwchgat(win, 1, start_pos, end_pos - start_pos + 1, A_COLOR, Color::Engaged, NULL); + mvwchgat(win, 2, start_pos, end_pos - start_pos + 1, A_COLOR, Color::Engaged, NULL); + } else { + auto color_id = Color::Green; + if (type != TimelineType::AlertInfo) { + color_id = type == TimelineType::AlertWarning ? Color::Yellow : Color::Red; + } + mvwchgat(win, 3, start_pos, end_pos - start_pos + 1, ACS_S3, color_id, NULL); + } + } + + int cur_pos = ((double)replay->currentSeconds() / total_sec) * width; + wattron(win, COLOR_PAIR(Color::BrightWhite)); + mvwaddch(win, 0, cur_pos, ACS_VLINE); + mvwaddch(win, 3, cur_pos, ACS_VLINE); + wattroff(win, COLOR_PAIR(Color::BrightWhite)); + wrefresh(win); +} + +void ConsoleUI::readyRead() { + int c; + while ((c = getch()) != ERR) { + handleKey(c); + } +} + +void ConsoleUI::pauseReplay(bool pause) { + replay->pause(pause); + status = pause ? Status::Paused : Status::Waiting; +} + +void ConsoleUI::handleKey(char c) { + if (c == '\n') { + // pause the replay and blocking getchar() + pauseReplay(true); + updateStatus(); + getch_timer.stop(); + curs_set(true); + nodelay(stdscr, false); + + // Wait for user input + rWarning("Waiting for input..."); + int y = getmaxy(stdscr) - 9; + move(y, BORDER_SIZE); + add_str(stdscr, "Enter seek request: ", Color::BrightWhite, true); + refresh(); + + // Seek to choice + echo(); + int choice = 0; + scanw((char *)"%d", &choice); + noecho(); + pauseReplay(false); + replay->seekTo(choice, false); + + // Clean up and turn off the blocking mode + move(y, 0); + clrtoeol(); + nodelay(stdscr, true); + curs_set(false); + refresh(); + getch_timer.start(1000, this); + + } else if (c == 'x') { + if (replay->hasFlag(REPLAY_FLAG_FULL_SPEED)) { + replay->removeFlag(REPLAY_FLAG_FULL_SPEED); + rWarning("replay at normal speed"); + } else { + replay->addFlag(REPLAY_FLAG_FULL_SPEED); + rWarning("replay at full speed"); + } + } else if (c == 'e') { + replay->seekToFlag(FindFlag::nextEngagement); + } else if (c == 'd') { + replay->seekToFlag(FindFlag::nextDisEngagement); + } else if (c == 'm') { + replay->seekTo(+60, true); + } else if (c == 'M') { + replay->seekTo(-60, true); + } else if (c == 's') { + replay->seekTo(+10, true); + } else if (c == 'S') { + replay->seekTo(-10, true); + } else if (c == ' ') { + pauseReplay(!replay->isPaused()); + } else if (c == 'q' || c == 'Q') { + replay->stop(); + qApp->exit(); + } +} diff --git a/selfdrive/ui/replay/consoleui.h b/selfdrive/ui/replay/consoleui.h new file mode 100644 index 000000000..bce1146d4 --- /dev/null +++ b/selfdrive/ui/replay/consoleui.h @@ -0,0 +1,50 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "selfdrive/ui/replay/replay.h" +#include + +class ConsoleUI : public QObject { + Q_OBJECT + +public: + ConsoleUI(Replay *replay, QObject *parent = 0); + ~ConsoleUI(); + +private: + void initWindows(); + void handleKey(char c); + void displayHelp(); + void displayTimelineDesc(); + void updateTimeline(); + void updateSummary(); + void updateStatus(); + void pauseReplay(bool pause); + + enum Status { Waiting, Playing, Paused }; + enum Win { Title, Stats, Log, LogBorder, DownloadBar, Timeline, TimelineDesc, Help, CarState, Max}; + std::array w{}; + SubMaster sm; + Replay *replay; + QBasicTimer getch_timer; + QTimer sm_timer; + QSocketNotifier notifier{0, QSocketNotifier::Read, this}; + int max_width, max_height; + Status status = Status::Waiting; + +signals: + void updateProgressBarSignal(uint64_t cur, uint64_t total, bool success); + void logMessageSignal(ReplyMsgType type, const QString &msg); + +private slots: + void readyRead(); + void timerEvent(QTimerEvent *ev); + void updateProgressBar(uint64_t cur, uint64_t total, bool success); + void logMessage(ReplyMsgType type, const QString &msg); +}; diff --git a/selfdrive/ui/replay/filereader.cc b/selfdrive/ui/replay/filereader.cc new file mode 100644 index 000000000..b57a62d50 --- /dev/null +++ b/selfdrive/ui/replay/filereader.cc @@ -0,0 +1,45 @@ +#include "selfdrive/ui/replay/filereader.h" + +#include + +#include "selfdrive/common/util.h" +#include "selfdrive/ui/replay/util.h" + +std::string cacheFilePath(const std::string &url) { + static std::string cache_path = [] { + const std::string comma_cache = util::getenv("COMMA_CACHE", "/tmp/comma_download_cache/"); + util::create_directories(comma_cache, 0755); + return comma_cache.back() == '/' ? comma_cache : comma_cache + "/"; + }(); + + return cache_path + sha256(getUrlWithoutQuery(url)); +} + +std::string FileReader::read(const std::string &file, std::atomic *abort) { + const bool is_remote = file.find("https://") == 0; + const std::string local_file = is_remote ? cacheFilePath(file) : file; + std::string result; + + if ((!is_remote || cache_to_local_) && util::file_exists(local_file)) { + result = util::read_file(local_file); + } else if (is_remote) { + result = download(file, abort); + if (cache_to_local_ && !result.empty()) { + std::ofstream fs(local_file, std::ios::binary | std::ios::out); + fs.write(result.data(), result.size()); + } + } + return result; +} + +std::string FileReader::download(const std::string &url, std::atomic *abort) { + for (int i = 0; i <= max_retries_ && !(abort && *abort); ++i) { + if (i > 0) rWarning("download failed, retrying %d", i); + + std::string result = httpGet(url, chunk_size_, abort); + if (!result.empty()) { + return result; + } + } + return {}; +} diff --git a/selfdrive/ui/replay/filereader.h b/selfdrive/ui/replay/filereader.h new file mode 100644 index 000000000..34aa91e85 --- /dev/null +++ b/selfdrive/ui/replay/filereader.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include + +class FileReader { +public: + FileReader(bool cache_to_local, size_t chunk_size = 0, int retries = 3) + : cache_to_local_(cache_to_local), chunk_size_(chunk_size), max_retries_(retries) {} + virtual ~FileReader() {} + std::string read(const std::string &file, std::atomic *abort = nullptr); + +private: + std::string download(const std::string &url, std::atomic *abort); + size_t chunk_size_; + int max_retries_; + bool cache_to_local_; +}; + +std::string cacheFilePath(const std::string &url); diff --git a/selfdrive/ui/replay/framereader.cc b/selfdrive/ui/replay/framereader.cc new file mode 100644 index 000000000..ef90c2835 --- /dev/null +++ b/selfdrive/ui/replay/framereader.cc @@ -0,0 +1,246 @@ +#include "selfdrive/ui/replay/framereader.h" +#include "selfdrive/ui/replay/util.h" + +#include +#include "libyuv.h" + +#include "cereal/visionipc/visionbuf.h" + +namespace { + +struct buffer_data { + const uint8_t *data; + int64_t offset; + size_t size; +}; + +int readPacket(void *opaque, uint8_t *buf, int buf_size) { + struct buffer_data *bd = (struct buffer_data *)opaque; + assert(bd->offset <= bd->size); + buf_size = std::min((size_t)buf_size, (size_t)(bd->size - bd->offset)); + if (!buf_size) return AVERROR_EOF; + + memcpy(buf, bd->data + bd->offset, buf_size); + bd->offset += buf_size; + return buf_size; +} + +enum AVPixelFormat get_hw_format(AVCodecContext *ctx, const enum AVPixelFormat *pix_fmts) { + enum AVPixelFormat *hw_pix_fmt = reinterpret_cast(ctx->opaque); + for (const enum AVPixelFormat *p = pix_fmts; *p != -1; p++) { + if (*p == *hw_pix_fmt) return *p; + } + rWarning("Please run replay with the --no-cuda flag!"); + // fallback to YUV420p + *hw_pix_fmt = AV_PIX_FMT_NONE; + return AV_PIX_FMT_YUV420P; +} + +} // namespace + +FrameReader::FrameReader() { + av_log_set_level(AV_LOG_QUIET); +} + +FrameReader::~FrameReader() { + for (AVPacket *pkt : packets) { + av_packet_free(&pkt); + } + + if (decoder_ctx) avcodec_free_context(&decoder_ctx); + if (input_ctx) avformat_close_input(&input_ctx); + if (hw_device_ctx) av_buffer_unref(&hw_device_ctx); + + if (avio_ctx_) { + av_freep(&avio_ctx_->buffer); + avio_context_free(&avio_ctx_); + } +} + +bool FrameReader::load(const std::string &url, bool no_cuda, std::atomic *abort, bool local_cache, int chunk_size, int retries) { + FileReader f(local_cache, chunk_size, retries); + std::string data = f.read(url, abort); + if (data.empty()) return false; + + return load((std::byte *)data.data(), data.size(), no_cuda, abort); +} + +bool FrameReader::load(const std::byte *data, size_t size, bool no_cuda, std::atomic *abort) { + input_ctx = avformat_alloc_context(); + if (!input_ctx) return false; + + struct buffer_data bd = { + .data = (const uint8_t*)data, + .offset = 0, + .size = size, + }; + const int avio_ctx_buffer_size = 64 * 1024; + unsigned char *avio_ctx_buffer = (unsigned char *)av_malloc(avio_ctx_buffer_size); + avio_ctx_ = avio_alloc_context(avio_ctx_buffer, avio_ctx_buffer_size, 0, &bd, readPacket, nullptr, nullptr); + input_ctx->pb = avio_ctx_; + + input_ctx->probesize = 10 * 1024 * 1024; // 10MB + int ret = avformat_open_input(&input_ctx, nullptr, nullptr, nullptr); + if (ret != 0) { + char err_str[1024] = {0}; + av_strerror(ret, err_str, std::size(err_str)); + rError("Error loading video - %s", err_str); + return false; + } + + ret = avformat_find_stream_info(input_ctx, nullptr); + if (ret < 0) { + rError("cannot find a video stream in the input file"); + return false; + } + + AVStream *video = input_ctx->streams[0]; + AVCodec *decoder = avcodec_find_decoder(video->codec->codec_id); + if (!decoder) return false; + + decoder_ctx = avcodec_alloc_context3(decoder); + ret = avcodec_parameters_to_context(decoder_ctx, video->codecpar); + if (ret != 0) return false; + + width = (decoder_ctx->width + 3) & ~3; + height = decoder_ctx->height; + visionbuf_compute_aligned_width_and_height(width, height, &aligned_width, &aligned_height); + + if (has_cuda_device && !no_cuda) { + if (!initHardwareDecoder(AV_HWDEVICE_TYPE_CUDA)) { + rWarning("No CUDA capable device was found. fallback to CPU decoding."); + } else { + nv12toyuv_buffer.resize(getYUVSize()); + } + } + + ret = avcodec_open2(decoder_ctx, decoder, nullptr); + if (ret < 0) return false; + + packets.reserve(60 * 20); // 20fps, one minute + while (!(abort && *abort)) { + AVPacket *pkt = av_packet_alloc(); + ret = av_read_frame(input_ctx, pkt); + if (ret < 0) { + av_packet_free(&pkt); + valid_ = (ret == AVERROR_EOF); + break; + } + packets.push_back(pkt); + // some stream seems to contian no keyframes + key_frames_count_ += pkt->flags & AV_PKT_FLAG_KEY; + } + valid_ = valid_ && !packets.empty(); + return valid_; +} + +bool FrameReader::initHardwareDecoder(AVHWDeviceType hw_device_type) { + for (int i = 0;; i++) { + const AVCodecHWConfig *config = avcodec_get_hw_config(decoder_ctx->codec, i); + if (!config) { + rWarning("decoder %s does not support hw device type %s.", decoder_ctx->codec->name, + av_hwdevice_get_type_name(hw_device_type)); + return false; + } + if (config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX && config->device_type == hw_device_type) { + hw_pix_fmt = config->pix_fmt; + break; + } + } + + int ret = av_hwdevice_ctx_create(&hw_device_ctx, hw_device_type, nullptr, nullptr, 0); + if (ret < 0) { + hw_pix_fmt = AV_PIX_FMT_NONE; + has_cuda_device = false; + rWarning("Failed to create specified HW device %d.", ret); + return false; + } + + decoder_ctx->hw_device_ctx = av_buffer_ref(hw_device_ctx); + decoder_ctx->opaque = &hw_pix_fmt; + decoder_ctx->get_format = get_hw_format; + return true; +} + +bool FrameReader::get(int idx, uint8_t *rgb, uint8_t *yuv) { + assert(rgb || yuv); + if (!valid_ || idx < 0 || idx >= packets.size()) { + return false; + } + return decode(idx, rgb, yuv); +} + +bool FrameReader::decode(int idx, uint8_t *rgb, uint8_t *yuv) { + int from_idx = idx; + if (idx != prev_idx + 1 && key_frames_count_ > 1) { + // seeking to the nearest key frame + for (int i = idx; i >= 0; --i) { + if (packets[i]->flags & AV_PKT_FLAG_KEY) { + from_idx = i; + break; + } + } + } + prev_idx = idx; + + for (int i = from_idx; i <= idx; ++i) { + AVFrame *f = decodeFrame(packets[i]); + if (f && i == idx) { + return copyBuffers(f, rgb, yuv); + } + } + return false; +} + +AVFrame *FrameReader::decodeFrame(AVPacket *pkt) { + int ret = avcodec_send_packet(decoder_ctx, pkt); + if (ret < 0) { + rError("Error sending a packet for decoding: %d", ret); + return nullptr; + } + + av_frame_.reset(av_frame_alloc()); + ret = avcodec_receive_frame(decoder_ctx, av_frame_.get()); + if (ret != 0) { + rError("avcodec_receive_frame error: %d", ret); + return nullptr; + } + + if (av_frame_->format == hw_pix_fmt) { + hw_frame.reset(av_frame_alloc()); + if ((ret = av_hwframe_transfer_data(hw_frame.get(), av_frame_.get(), 0)) < 0) { + rError("error transferring the data from GPU to CPU"); + return nullptr; + } + return hw_frame.get(); + } else { + return av_frame_.get(); + } +} + +bool FrameReader::copyBuffers(AVFrame *f, uint8_t *rgb, uint8_t *yuv) { + if (hw_pix_fmt == AV_PIX_FMT_CUDA) { + uint8_t *y = yuv ? yuv : nv12toyuv_buffer.data(); + uint8_t *u = y + width * height; + uint8_t *v = u + (width / 2) * (height / 2); + libyuv::NV12ToI420(f->data[0], f->linesize[0], f->data[1], f->linesize[1], + y, width, u, width / 2, v, width / 2, width, height); + libyuv::I420ToRGB24(y, width, u, width / 2, v, width / 2, + rgb, aligned_width * 3, width, height); + } else { + if (yuv) { + uint8_t *u = yuv + width * height; + uint8_t *v = u + (width / 2) * (height / 2); + libyuv::I420Copy(f->data[0], f->linesize[0], + f->data[1], f->linesize[1], + f->data[2], f->linesize[2], + yuv, width, u, width / 2, v, width / 2, + width, height); + } + libyuv::I420ToRGB24(f->data[0], f->linesize[0], + f->data[1], f->linesize[1], + f->data[2], f->linesize[2], + rgb, aligned_width * 3, width, height); + } + return true; +} diff --git a/selfdrive/ui/replay/framereader.h b/selfdrive/ui/replay/framereader.h new file mode 100644 index 000000000..8de5c1f93 --- /dev/null +++ b/selfdrive/ui/replay/framereader.h @@ -0,0 +1,52 @@ +#pragma once + +#include +#include +#include + +#include "selfdrive/ui/replay/filereader.h" + +extern "C" { +#include +#include +} + +struct AVFrameDeleter { + void operator()(AVFrame* frame) const { av_frame_free(&frame); } +}; + +class FrameReader { +public: + FrameReader(); + ~FrameReader(); + bool load(const std::string &url, bool no_cuda = false, std::atomic *abort = nullptr, bool local_cache = false, int chunk_size = -1, int retries = 0); + bool load(const std::byte *data, size_t size, bool no_cuda = false, std::atomic *abort = nullptr); + bool get(int idx, uint8_t *rgb, uint8_t *yuv); + int getRGBSize() const { return aligned_width * aligned_height * 3; } + int getYUVSize() const { return width * height * 3 / 2; } + size_t getFrameCount() const { return packets.size(); } + bool valid() const { return valid_; } + + int width = 0, height = 0; + int aligned_width = 0, aligned_height = 0; + +private: + bool initHardwareDecoder(AVHWDeviceType hw_device_type); + bool decode(int idx, uint8_t *rgb, uint8_t *yuv); + AVFrame * decodeFrame(AVPacket *pkt); + bool copyBuffers(AVFrame *f, uint8_t *rgb, uint8_t *yuv); + + std::vector packets; + std::unique_ptrav_frame_, hw_frame; + AVFormatContext *input_ctx = nullptr; + AVCodecContext *decoder_ctx = nullptr; + int key_frames_count_ = 0; + bool valid_ = false; + AVIOContext *avio_ctx_ = nullptr; + + AVPixelFormat hw_pix_fmt = AV_PIX_FMT_NONE; + AVBufferRef *hw_device_ctx = nullptr; + std::vector nv12toyuv_buffer; + int prev_idx = -1; + inline static std::atomic has_cuda_device = true; +}; diff --git a/selfdrive/ui/replay/logreader.cc b/selfdrive/ui/replay/logreader.cc new file mode 100644 index 000000000..579fe5064 --- /dev/null +++ b/selfdrive/ui/replay/logreader.cc @@ -0,0 +1,105 @@ +#include "selfdrive/ui/replay/logreader.h" + +#include +#include "selfdrive/ui/replay/util.h" + +Event::Event(const kj::ArrayPtr &amsg, bool frame) : reader(amsg), frame(frame) { + words = kj::ArrayPtr(amsg.begin(), reader.getEnd()); + event = reader.getRoot(); + which = event.which(); + mono_time = event.getLogMonoTime(); + + // 1) Send video data at t=timestampEof/timestampSof + // 2) Send encodeIndex packet at t=logMonoTime + if (frame) { + auto idx = capnp::AnyStruct::Reader(event).getPointerSection()[0].getAs(); + // C2 only has eof set, and some older routes have neither + uint64_t sof = idx.getTimestampSof(); + uint64_t eof = idx.getTimestampEof(); + if (sof > 0) { + mono_time = sof; + } else if (eof > 0) { + mono_time = eof; + } + } +} + +// class LogReader + +LogReader::LogReader(size_t memory_pool_block_size) { +#ifdef HAS_MEMORY_RESOURCE + const size_t buf_size = sizeof(Event) * memory_pool_block_size; + pool_buffer_ = ::operator new(buf_size); + mbr_ = new std::pmr::monotonic_buffer_resource(pool_buffer_, buf_size); +#endif + events.reserve(memory_pool_block_size); +} + +LogReader::~LogReader() { + for (Event *e : events) { + delete e; + } + +#ifdef HAS_MEMORY_RESOURCE + delete mbr_; + ::operator delete(pool_buffer_); +#endif +} + +bool LogReader::load(const std::string &url, std::atomic *abort, bool local_cache, int chunk_size, int retries) { + FileReader f(local_cache, chunk_size, retries); + std::string data = f.read(url, abort); + if (data.empty()) return false; + + return load((std::byte*)data.data(), data.size(), abort); +} + +bool LogReader::load(const std::byte *data, size_t size, std::atomic *abort) { + raw_ = decompressBZ2(data, size, abort); + if (raw_.empty()) { + if (!(abort && *abort)) { + rWarning("failed to decompress log"); + } + return false; + } + + try { + kj::ArrayPtr words((const capnp::word *)raw_.data(), raw_.size() / sizeof(capnp::word)); + while (words.size() > 0 && !(abort && *abort)) { + +#ifdef HAS_MEMORY_RESOURCE + Event *evt = new (mbr_) Event(words); +#else + Event *evt = new Event(words); +#endif + + // Add encodeIdx packet again as a frame packet for the video stream + if (evt->which == cereal::Event::ROAD_ENCODE_IDX || + evt->which == cereal::Event::DRIVER_ENCODE_IDX || + evt->which == cereal::Event::WIDE_ROAD_ENCODE_IDX) { + +#ifdef HAS_MEMORY_RESOURCE + Event *frame_evt = new (mbr_) Event(words, true); +#else + Event *frame_evt = new Event(words, true); +#endif + + events.push_back(frame_evt); + } + + words = kj::arrayPtr(evt->reader.getEnd(), words.end()); + events.push_back(evt); + } + } catch (const kj::Exception &e) { + rWarning("failed to parse log : %s", e.getDescription().cStr()); + if (!events.empty()) { + rWarning("read %zu events from corrupt log", events.size()); + } + } + + if (!events.empty() && !(abort && *abort)) { + std::sort(events.begin(), events.end(), Event::lessThan()); + return true; + } + return false; +} diff --git a/selfdrive/ui/replay/logreader.h b/selfdrive/ui/replay/logreader.h new file mode 100644 index 000000000..7ada20605 --- /dev/null +++ b/selfdrive/ui/replay/logreader.h @@ -0,0 +1,64 @@ +#pragma once + +#if __has_include() +#define HAS_MEMORY_RESOURCE 1 +#include +#endif + +#include "cereal/gen/cpp/log.capnp.h" +#include "selfdrive/camerad/cameras/camera_common.h" +#include "selfdrive/ui/replay/filereader.h" + +const CameraType ALL_CAMERAS[] = {RoadCam, DriverCam, WideRoadCam}; +const int MAX_CAMERAS = std::size(ALL_CAMERAS); +const int DEFAULT_EVENT_MEMORY_POOL_BLOCK_SIZE = 65000; + +class Event { +public: + Event(cereal::Event::Which which, uint64_t mono_time) : reader(kj::ArrayPtr{}) { + // construct a dummy Event for binary search, e.g std::upper_bound + this->which = which; + this->mono_time = mono_time; + } + Event(const kj::ArrayPtr &amsg, bool frame = false); + inline kj::ArrayPtr bytes() const { return words.asBytes(); } + + struct lessThan { + inline bool operator()(const Event *l, const Event *r) { + return l->mono_time < r->mono_time || (l->mono_time == r->mono_time && l->which < r->which); + } + }; + +#if HAS_MEMORY_RESOURCE + void *operator new(size_t size, std::pmr::monotonic_buffer_resource *mbr) { + return mbr->allocate(size); + } + void operator delete(void *ptr) { + // No-op. memory used by EventMemoryPool increases monotonically until the logReader is destroyed. + } +#endif + + uint64_t mono_time; + cereal::Event::Which which; + cereal::Event::Reader event; + capnp::FlatArrayMessageReader reader; + kj::ArrayPtr words; + bool frame; +}; + +class LogReader { +public: + LogReader(size_t memory_pool_block_size = DEFAULT_EVENT_MEMORY_POOL_BLOCK_SIZE); + ~LogReader(); + bool load(const std::string &url, std::atomic *abort = nullptr, bool local_cache = false, int chunk_size = -1, int retries = 0); + bool load(const std::byte *data, size_t size, std::atomic *abort = nullptr); + + std::vector events; + +private: + std::string raw_; +#ifdef HAS_MEMORY_RESOURCE + std::pmr::monotonic_buffer_resource *mbr_ = nullptr; + void *pool_buffer_ = nullptr; +#endif +}; diff --git a/selfdrive/ui/replay/main.cc b/selfdrive/ui/replay/main.cc new file mode 100644 index 000000000..a7d2f5404 --- /dev/null +++ b/selfdrive/ui/replay/main.cc @@ -0,0 +1,60 @@ +#include +#include + +#include "selfdrive/ui/replay/consoleui.h" +#include "selfdrive/ui/replay/replay.h" + +const QString DEMO_ROUTE = "4cf7a6ad03080c90|2021-09-29--13-46-36"; + +int main(int argc, char *argv[]) { + QApplication app(argc, argv); + + const std::tuple flags[] = { + {"dcam", REPLAY_FLAG_DCAM, "load driver camera"}, + {"ecam", REPLAY_FLAG_ECAM, "load wide road camera"}, + {"no-loop", REPLAY_FLAG_NO_LOOP, "stop at the end of the route"}, + {"no-cache", REPLAY_FLAG_NO_FILE_CACHE, "turn off local cache"}, + {"qcam", REPLAY_FLAG_QCAMERA, "load qcamera"}, + {"yuv", REPLAY_FLAG_SEND_YUV, "send yuv frame"}, + {"no-cuda", REPLAY_FLAG_NO_CUDA, "disable CUDA"}, + {"no-vipc", REPLAY_FLAG_NO_VIPC, "do not output video"}, + }; + + QCommandLineParser parser; + parser.setApplicationDescription("Mock openpilot components by publishing logged messages."); + parser.addHelpOption(); + parser.addPositionalArgument("route", "the drive to replay. find your drives at connect.comma.ai"); + parser.addOption({{"a", "allow"}, "whitelist of services to send", "allow"}); + parser.addOption({{"b", "block"}, "blacklist of services to send", "block"}); + parser.addOption({{"s", "start"}, "start from ", "seconds"}); + parser.addOption({"demo", "use a demo route instead of providing your own"}); + parser.addOption({"data_dir", "local directory with routes", "data_dir"}); + for (auto &[name, _, desc] : flags) { + parser.addOption({name, desc}); + } + + parser.process(app); + const QStringList args = parser.positionalArguments(); + if (args.empty() && !parser.isSet("demo")) { + parser.showHelp(); + } + + const QString route = args.empty() ? DEMO_ROUTE : args.first(); + QStringList allow = parser.value("allow").isEmpty() ? QStringList{} : parser.value("allow").split(","); + QStringList block = parser.value("block").isEmpty() ? QStringList{} : parser.value("block").split(","); + + uint32_t replay_flags = REPLAY_FLAG_NONE; + for (const auto &[name, flag, _] : flags) { + if (parser.isSet(name)) { + replay_flags |= flag; + } + } + Replay *replay = new Replay(route, allow, block, nullptr, replay_flags, parser.value("data_dir"), &app); + if (!replay->load()) { + return 0; + } + + ConsoleUI console_ui(replay); + replay->start(parser.value("start").toInt()); + return app.exec(); +} diff --git a/selfdrive/ui/replay/replay.cc b/selfdrive/ui/replay/replay.cc new file mode 100644 index 000000000..fd1a4b199 --- /dev/null +++ b/selfdrive/ui/replay/replay.cc @@ -0,0 +1,405 @@ +#include "selfdrive/ui/replay/replay.h" + +#include +#include + +#include +#include "cereal/services.h" +#include "selfdrive/common/params.h" +#include "selfdrive/common/timing.h" +#include "selfdrive/hardware/hw.h" +#include "selfdrive/ui/replay/util.h" + +Replay::Replay(QString route, QStringList allow, QStringList block, SubMaster *sm_, uint32_t flags, QString data_dir, QObject *parent) + : sm(sm_), flags_(flags), QObject(parent) { + std::vector s; + auto event_struct = capnp::Schema::from().asStruct(); + sockets_.resize(event_struct.getUnionFields().size()); + for (const auto &it : services) { + if ((allow.empty() || allow.contains(it.name)) && !block.contains(it.name)) { + uint16_t which = event_struct.getFieldByName(it.name).getProto().getDiscriminantValue(); + sockets_[which] = it.name; + s.push_back(it.name); + } + } + qDebug() << "services " << s; + qDebug() << "loading route " << route; + + if (sm == nullptr) { + pm = std::make_unique(s); + } + route_ = std::make_unique(route, data_dir); + events_ = std::make_unique>(); + new_events_ = std::make_unique>(); +} + +Replay::~Replay() { + stop(); +} + +void Replay::stop() { + if (!stream_thread_ && segments_.empty()) return; + + rInfo("shutdown: in progress..."); + if (stream_thread_ != nullptr) { + exit_ = updating_events_ = true; + stream_cv_.notify_one(); + stream_thread_->quit(); + stream_thread_->wait(); + stream_thread_ = nullptr; + } + segments_.clear(); + camera_server_.reset(nullptr); + timeline_future.waitForFinished(); + rInfo("shutdown: done"); +} + +bool Replay::load() { + if (!route_->load()) { + qCritical() << "failed to load route" << route_->name() + << "from" << (route_->dir().isEmpty() ? "server" : route_->dir()); + return false; + } + + for (auto &[n, f] : route_->segments()) { + bool has_log = !f.rlog.isEmpty() || !f.qlog.isEmpty(); + bool has_video = !f.road_cam.isEmpty() || !f.qcamera.isEmpty(); + if (has_log && (has_video || hasFlag(REPLAY_FLAG_NO_VIPC))) { + segments_.insert({n, nullptr}); + } + } + if (segments_.empty()) { + qCritical() << "no valid segments in route" << route_->name(); + return false; + } + rInfo("load route %s with %zu valid segments", qPrintable(route_->name()), segments_.size()); + return true; +} + +void Replay::start(int seconds) { + seekTo(route_->identifier().segment_id * 60 + seconds, false); +} + +void Replay::updateEvents(const std::function &lambda) { + // set updating_events to true to force stream thread relase the lock and wait for evnets_udpated. + updating_events_ = true; + { + std::unique_lock lk(stream_lock_); + events_updated_ = lambda(); + updating_events_ = false; + } + stream_cv_.notify_one(); +} + +void Replay::seekTo(int seconds, bool relative) { + seconds = relative ? seconds + currentSeconds() : seconds; + updateEvents([&]() { + seconds = std::max(0, seconds); + int seg = seconds / 60; + if (segments_.find(seg) == segments_.end()) { + rWarning("can't seek to %d s segment %d is invalid", seconds, seg); + return true; + } + + rInfo("seeking to %d s, segment %d", seconds, seg); + current_segment_ = seg; + cur_mono_time_ = route_start_ts_ + seconds * 1e9; + return isSegmentMerged(seg); + }); + queueSegment(); +} + +void Replay::seekToFlag(FindFlag flag) { + if (auto next = find(flag)) { + seekTo(*next - 2, false); // seek to 2 seconds before next + } +} + +void Replay::buildTimeline() { + uint64_t engaged_begin = 0; + uint64_t alert_begin = 0; + TimelineType alert_type = TimelineType::None; + + for (int i = 0; i < segments_.size() && !exit_; ++i) { + LogReader log; + if (!log.load(route_->at(i).qlog.toStdString(), &exit_, !hasFlag(REPLAY_FLAG_NO_FILE_CACHE), 0, 3)) continue; + + for (const Event *e : log.events) { + if (e->which == cereal::Event::Which::CONTROLS_STATE) { + auto cs = e->event.getControlsState(); + + if (!engaged_begin && cs.getEnabled()) { + engaged_begin = e->mono_time; + } else if (engaged_begin && !cs.getEnabled()) { + std::lock_guard lk(timeline_lock); + timeline.push_back({toSeconds(engaged_begin), toSeconds(e->mono_time), TimelineType::Engaged}); + engaged_begin = 0; + } + + if (!alert_begin && cs.getAlertType().size() > 0) { + alert_begin = e->mono_time; + alert_type = TimelineType::AlertInfo; + if (cs.getAlertStatus() != cereal::ControlsState::AlertStatus::NORMAL) { + alert_type = cs.getAlertStatus() == cereal::ControlsState::AlertStatus::USER_PROMPT + ? TimelineType::AlertWarning + : TimelineType::AlertCritical; + } + } else if (alert_begin && cs.getAlertType().size() == 0) { + std::lock_guard lk(timeline_lock); + timeline.push_back({toSeconds(alert_begin), toSeconds(e->mono_time), alert_type}); + alert_begin = 0; + } + } + } + } +} + +std::optional Replay::find(FindFlag flag) { + int cur_ts = currentSeconds(); + for (auto [start_ts, end_ts, type] : getTimeline()) { + if (type == TimelineType::Engaged) { + if (flag == FindFlag::nextEngagement && start_ts > cur_ts) { + return start_ts; + } else if (flag == FindFlag::nextDisEngagement && end_ts > cur_ts) { + return end_ts; + } + } + } + return std::nullopt; +} + +void Replay::pause(bool pause) { + updateEvents([=]() { + rWarning("%s at %d s", pause ? "paused..." : "resuming", currentSeconds()); + paused_ = pause; + return true; + }); +} + +void Replay::setCurrentSegment(int n) { + if (current_segment_.exchange(n) != n) { + QMetaObject::invokeMethod(this, &Replay::queueSegment, Qt::QueuedConnection); + } +} + +void Replay::segmentLoadFinished(bool success) { + if (!success) { + Segment *seg = qobject_cast(sender()); + rWarning("failed to load segment %d, removing it from current replay list", seg->seg_num); + segments_.erase(seg->seg_num); + } + queueSegment(); +} + +void Replay::queueSegment() { + if (segments_.empty()) return; + + SegmentMap::iterator cur, end; + cur = end = segments_.lower_bound(std::min(current_segment_.load(), segments_.rbegin()->first)); + for (int i = 0; end != segments_.end() && i <= FORWARD_SEGS; ++i) { + ++end; + } + // load one segment at a time + for (auto it = cur; it != end; ++it) { + auto &[n, seg] = *it; + if ((seg && !seg->isLoaded()) || !seg) { + if (!seg) { + rDebug("loading segment %d...", n); + seg = std::make_unique(n, route_->at(n), flags_); + QObject::connect(seg.get(), &Segment::loadFinished, this, &Replay::segmentLoadFinished); + } + break; + } + } + + const auto &cur_segment = cur->second; + // merge the previous adjacent segment if it's loaded + auto begin = segments_.find(cur_segment->seg_num - 1); + if (begin == segments_.end() || !(begin->second && begin->second->isLoaded())) { + begin = cur; + } + mergeSegments(begin, end); + + // free segments out of current semgnt window. + std::for_each(segments_.begin(), begin, [](auto &e) { e.second.reset(nullptr); }); + std::for_each(end, segments_.end(), [](auto &e) { e.second.reset(nullptr); }); + + // start stream thread + if (stream_thread_ == nullptr && cur_segment->isLoaded()) { + startStream(cur_segment.get()); + emit streamStarted(); + } +} + +void Replay::mergeSegments(const SegmentMap::iterator &begin, const SegmentMap::iterator &end) { + // merge 3 segments in sequence. + std::vector segments_need_merge; + size_t new_events_size = 0; + for (auto it = begin; it != end && it->second && it->second->isLoaded() && segments_need_merge.size() < 3; ++it) { + segments_need_merge.push_back(it->first); + new_events_size += it->second->log->events.size(); + } + + if (segments_need_merge != segments_merged_) { + std::string s; + for (int i = 0; i < segments_need_merge.size(); ++i) { + s += std::to_string(segments_need_merge[i]); + if (i != segments_need_merge.size() - 1) s += ", "; + } + rDebug("merge segments %s", s.c_str()); + new_events_->clear(); + new_events_->reserve(new_events_size); + for (int n : segments_need_merge) { + const auto &e = segments_[n]->log->events; + auto middle = new_events_->insert(new_events_->end(), e.begin(), e.end()); + std::inplace_merge(new_events_->begin(), middle, new_events_->end(), Event::lessThan()); + } + + updateEvents([&]() { + events_.swap(new_events_); + segments_merged_ = segments_need_merge; + return true; + }); + } +} + +void Replay::startStream(const Segment *cur_segment) { + const auto &events = cur_segment->log->events; + + // get route start time from initData + auto it = std::find_if(events.begin(), events.end(), [](auto e) { return e->which == cereal::Event::Which::INIT_DATA; }); + route_start_ts_ = it != events.end() ? (*it)->mono_time : events[0]->mono_time; + cur_mono_time_ += route_start_ts_; + + // write CarParams + it = std::find_if(events.begin(), events.end(), [](auto e) { return e->which == cereal::Event::Which::CAR_PARAMS; }); + if (it != events.end()) { + car_fingerprint_ = (*it)->event.getCarParams().getCarFingerprint(); + auto bytes = (*it)->bytes(); + Params().put("CarParams", (const char *)bytes.begin(), bytes.size()); + } else { + rWarning("failed to read CarParams from current segment"); + } + + // start camera server + if (!hasFlag(REPLAY_FLAG_NO_VIPC)) { + std::pair camera_size[MAX_CAMERAS] = {}; + for (auto type : ALL_CAMERAS) { + if (auto &fr = cur_segment->frames[type]) { + camera_size[type] = {fr->width, fr->height}; + } + } + camera_server_ = std::make_unique(camera_size, hasFlag(REPLAY_FLAG_SEND_YUV)); + } + + // start stream thread + stream_thread_ = new QThread(); + QObject::connect(stream_thread_, &QThread::started, [=]() { stream(); }); + QObject::connect(stream_thread_, &QThread::finished, stream_thread_, &QThread::deleteLater); + stream_thread_->start(); + + timeline_future = QtConcurrent::run(this, &Replay::buildTimeline); +} + +void Replay::publishMessage(const Event *e) { + if (sm == nullptr) { + auto bytes = e->bytes(); + int ret = pm->send(sockets_[e->which], (capnp::byte *)bytes.begin(), bytes.size()); + if (ret == -1) { + rWarning("stop publishing %s due to multiple publishers error", sockets_[e->which]); + sockets_[e->which] = nullptr; + } + } else { + sm->update_msgs(nanos_since_boot(), {{sockets_[e->which], e->event}}); + } +} + +void Replay::publishFrame(const Event *e) { + static const std::map cam_types{ + {cereal::Event::ROAD_ENCODE_IDX, RoadCam}, + {cereal::Event::DRIVER_ENCODE_IDX, DriverCam}, + {cereal::Event::WIDE_ROAD_ENCODE_IDX, WideRoadCam}, + }; + if ((e->which == cereal::Event::DRIVER_ENCODE_IDX && !hasFlag(REPLAY_FLAG_DCAM)) || + (e->which == cereal::Event::WIDE_ROAD_ENCODE_IDX && !hasFlag(REPLAY_FLAG_ECAM))) { + return; + } + auto eidx = capnp::AnyStruct::Reader(e->event).getPointerSection()[0].getAs(); + if (eidx.getType() == cereal::EncodeIndex::Type::FULL_H_E_V_C && isSegmentMerged(eidx.getSegmentNum())) { + CameraType cam = cam_types.at(e->which); + camera_server_->pushFrame(cam, segments_[eidx.getSegmentNum()]->frames[cam].get(), eidx); + } +} + +void Replay::stream() { + cereal::Event::Which cur_which = cereal::Event::Which::INIT_DATA; + std::unique_lock lk(stream_lock_); + + while (true) { + stream_cv_.wait(lk, [=]() { return exit_ || (events_updated_ && !paused_); }); + events_updated_ = false; + if (exit_) break; + + Event cur_event(cur_which, cur_mono_time_); + auto eit = std::upper_bound(events_->begin(), events_->end(), &cur_event, Event::lessThan()); + if (eit == events_->end()) { + rInfo("waiting for events..."); + continue; + } + + uint64_t evt_start_ts = cur_mono_time_; + uint64_t loop_start_ts = nanos_since_boot(); + + for (auto end = events_->end(); !updating_events_ && eit != end; ++eit) { + const Event *evt = (*eit); + cur_which = evt->which; + cur_mono_time_ = evt->mono_time; + setCurrentSegment(toSeconds(cur_mono_time_) / 60); + + // migration for pandaState -> pandaStates to keep UI working for old segments + if (cur_which == cereal::Event::Which::PANDA_STATE_D_E_P_R_E_C_A_T_E_D) { + MessageBuilder msg; + auto ps = msg.initEvent().initPandaStates(1); + ps[0].setIgnitionLine(true); + ps[0].setPandaType(cereal::PandaState::PandaType::DOS); + pm->send(sockets_[cereal::Event::Which::PANDA_STATES], msg); + } + + if (cur_which < sockets_.size() && sockets_[cur_which] != nullptr) { + // keep time + long etime = cur_mono_time_ - evt_start_ts; + long rtime = nanos_since_boot() - loop_start_ts; + long behind_ns = etime - rtime; + // if behind_ns is greater than 1 second, it means that an invalid segemnt is skipped by seeking/replaying + if (behind_ns >= 1 * 1e9) { + // reset start times + evt_start_ts = cur_mono_time_; + loop_start_ts = nanos_since_boot(); + } else if (behind_ns > 0 && !hasFlag(REPLAY_FLAG_FULL_SPEED)) { + precise_nano_sleep(behind_ns); + } + + if (!evt->frame) { + publishMessage(evt); + } else if (camera_server_) { + if (hasFlag(REPLAY_FLAG_FULL_SPEED)) { + camera_server_->waitFinish(); + } + publishFrame(evt); + } + } + } + // wait for frame to be sent before unlock.(frameReader may be deleted after unlock) + if (camera_server_) { + camera_server_->waitFinish(); + } + + if (eit == events_->end() && !hasFlag(REPLAY_FLAG_NO_LOOP)) { + int last_segment = segments_.rbegin()->first; + if (current_segment_ >= last_segment && isSegmentMerged(last_segment)) { + rInfo("reaches the end of route, restart from beginning"); + QMetaObject::invokeMethod(this, std::bind(&Replay::seekTo, this, 0, false), Qt::QueuedConnection); + } + } + } +} diff --git a/selfdrive/ui/replay/replay.h b/selfdrive/ui/replay/replay.h new file mode 100644 index 000000000..d20d5bb92 --- /dev/null +++ b/selfdrive/ui/replay/replay.h @@ -0,0 +1,112 @@ +#pragma once + +#include + +#include + +#include "selfdrive/ui/replay/camera.h" +#include "selfdrive/ui/replay/route.h" + +// one segment uses about 100M of memory +constexpr int FORWARD_SEGS = 5; + +enum REPLAY_FLAGS { + REPLAY_FLAG_NONE = 0x0000, + REPLAY_FLAG_DCAM = 0x0002, + REPLAY_FLAG_ECAM = 0x0004, + REPLAY_FLAG_NO_LOOP = 0x0010, + REPLAY_FLAG_NO_FILE_CACHE = 0x0020, + REPLAY_FLAG_QCAMERA = 0x0040, + REPLAY_FLAG_SEND_YUV = 0x0080, + REPLAY_FLAG_NO_CUDA = 0x0100, + REPLAY_FLAG_FULL_SPEED = 0x0200, + REPLAY_FLAG_NO_VIPC = 0x0400, +}; + +enum class FindFlag { + nextEngagement, + nextDisEngagement +}; + +enum class TimelineType { None, Engaged, AlertInfo, AlertWarning, AlertCritical }; + +class Replay : public QObject { + Q_OBJECT + +public: + Replay(QString route, QStringList allow, QStringList block, SubMaster *sm = nullptr, + uint32_t flags = REPLAY_FLAG_NONE, QString data_dir = "", QObject *parent = 0); + ~Replay(); + bool load(); + void start(int seconds = 0); + void stop(); + void pause(bool pause); + void seekToFlag(FindFlag flag); + void seekTo(int seconds, bool relative); + inline bool isPaused() const { return paused_; } + inline bool hasFlag(REPLAY_FLAGS flag) const { return flags_ & flag; } + inline void addFlag(REPLAY_FLAGS flag) { flags_ |= flag; } + inline void removeFlag(REPLAY_FLAGS flag) { flags_ &= ~flag; } + inline const Route* route() const { return route_.get(); } + inline int currentSeconds() const { return (cur_mono_time_ - route_start_ts_) / 1e9; } + inline int toSeconds(uint64_t mono_time) const { return (mono_time - route_start_ts_) / 1e9; } + inline int totalSeconds() const { return segments_.size() * 60; } + inline const std::string &carFingerprint() const { return car_fingerprint_; } + inline const std::vector> getTimeline() { + std::lock_guard lk(timeline_lock); + return timeline; + } + +signals: + void streamStarted(); + +protected slots: + void segmentLoadFinished(bool sucess); + +protected: + typedef std::map> SegmentMap; + std::optional find(FindFlag flag); + void startStream(const Segment *cur_segment); + void stream(); + void setCurrentSegment(int n); + void queueSegment(); + void mergeSegments(const SegmentMap::iterator &begin, const SegmentMap::iterator &end); + void updateEvents(const std::function& lambda); + void publishMessage(const Event *e); + void publishFrame(const Event *e); + void buildTimeline(); + inline bool isSegmentMerged(int n) { + return std::find(segments_merged_.begin(), segments_merged_.end(), n) != segments_merged_.end(); + } + + QThread *stream_thread_ = nullptr; + + // logs + std::mutex stream_lock_; + std::condition_variable stream_cv_; + std::atomic updating_events_ = false; + std::atomic current_segment_ = 0; + SegmentMap segments_; + // the following variables must be protected with stream_lock_ + std::atomic exit_ = false; + bool paused_ = false; + bool events_updated_ = false; + uint64_t route_start_ts_ = 0; + uint64_t cur_mono_time_ = 0; + std::unique_ptr> events_; + std::unique_ptr> new_events_; + std::vector segments_merged_; + + // messaging + SubMaster *sm = nullptr; + std::unique_ptr pm; + std::vector sockets_; + std::unique_ptr route_; + std::unique_ptr camera_server_; + std::atomic flags_ = REPLAY_FLAG_NONE; + + std::mutex timeline_lock; + QFuture timeline_future; + std::vector> timeline; + std::string car_fingerprint_; +}; diff --git a/selfdrive/ui/replay/route.cc b/selfdrive/ui/replay/route.cc new file mode 100644 index 000000000..e6a617714 --- /dev/null +++ b/selfdrive/ui/replay/route.cc @@ -0,0 +1,134 @@ +#include "selfdrive/ui/replay/route.h" + +#include +#include +#include +#include +#include +#include + +#include "selfdrive/hardware/hw.h" +#include "selfdrive/ui/qt/api.h" +#include "selfdrive/ui/replay/replay.h" +#include "selfdrive/ui/replay/util.h" + +Route::Route(const QString &route, const QString &data_dir) : data_dir_(data_dir) { + route_ = parseRoute(route); +} + +RouteIdentifier Route::parseRoute(const QString &str) { + QRegExp rx(R"(^([a-z0-9]{16})([|_/])(\d{4}-\d{2}-\d{2}--\d{2}-\d{2}-\d{2})(?:(--|/)(\d*))?$)"); + if (rx.indexIn(str) == -1) return {}; + + const QStringList list = rx.capturedTexts(); + return {list[1], list[3], list[5].toInt(), list[1] + "|" + list[3]}; +} + +bool Route::load() { + if (route_.str.isEmpty()) { + rInfo("invalid route format"); + return false; + } + return data_dir_.isEmpty() ? loadFromServer() : loadFromLocal(); +} + +bool Route::loadFromServer() { + QEventLoop loop; + HttpRequest http(nullptr, !Hardware::PC()); + QObject::connect(&http, &HttpRequest::requestDone, [&](const QString &json, bool success) { + loop.exit(success ? loadFromJson(json) : 0); + }); + http.sendRequest("https://api.commadotai.com/v1/route/" + route_.str + "/files"); + return loop.exec(); +} + +bool Route::loadFromJson(const QString &json) { + QRegExp rx(R"(\/(\d+)\/)"); + for (const auto &value : QJsonDocument::fromJson(json.trimmed().toUtf8()).object()) { + for (const auto &url : value.toArray()) { + QString url_str = url.toString(); + if (rx.indexIn(url_str) != -1) { + addFileToSegment(rx.cap(1).toInt(), url_str); + } + } + } + return !segments_.empty(); +} + +bool Route::loadFromLocal() { + QDir log_dir(data_dir_); + for (const auto &folder : log_dir.entryList(QDir::Dirs | QDir::NoDot | QDir::NoDotDot, QDir::NoSort)) { + int pos = folder.lastIndexOf("--"); + if (pos != -1 && folder.left(pos) == route_.timestamp) { + const int seg_num = folder.mid(pos + 2).toInt(); + QDir segment_dir(log_dir.filePath(folder)); + for (const auto &f : segment_dir.entryList(QDir::Files)) { + addFileToSegment(seg_num, segment_dir.absoluteFilePath(f)); + } + } + } + return !segments_.empty(); +} + +void Route::addFileToSegment(int n, const QString &file) { + const QString name = QUrl(file).fileName(); + if (name == "rlog.bz2") { + segments_[n].rlog = file; + } else if (name == "qlog.bz2") { + segments_[n].qlog = file; + } else if (name == "fcamera.hevc") { + segments_[n].road_cam = file; + } else if (name == "dcamera.hevc") { + segments_[n].driver_cam = file; + } else if (name == "ecamera.hevc") { + segments_[n].wide_road_cam = file; + } else if (name == "qcamera.ts") { + segments_[n].qcamera = file; + } +} + +// class Segment + +Segment::Segment(int n, const SegmentFile &files, uint32_t flags) : seg_num(n), flags(flags) { + // [RoadCam, DriverCam, WideRoadCam, log]. fallback to qcamera/qlog + const std::array file_list = { + (flags & REPLAY_FLAG_QCAMERA) || files.road_cam.isEmpty() ? files.qcamera : files.road_cam, + flags & REPLAY_FLAG_DCAM ? files.driver_cam : "", + flags & REPLAY_FLAG_ECAM ? files.wide_road_cam : "", + files.rlog.isEmpty() ? files.qlog : files.rlog, + }; + for (int i = 0; i < file_list.size(); ++i) { + if (!file_list[i].isEmpty() && (!(flags & REPLAY_FLAG_NO_VIPC) || i >= MAX_CAMERAS)) { + ++loading_; + synchronizer_.addFuture(QtConcurrent::run(this, &Segment::loadFile, i, file_list[i].toStdString())); + } + } +} + +Segment::~Segment() { + disconnect(); + abort_ = true; + synchronizer_.setCancelOnWait(true); + synchronizer_.waitForFinished(); +} + +void Segment::loadFile(int id, const std::string file) { + const bool local_cache = !(flags & REPLAY_FLAG_NO_FILE_CACHE); + bool success = false; + if (id < MAX_CAMERAS) { + frames[id] = std::make_unique(); + success = frames[id]->load(file, flags & REPLAY_FLAG_NO_CUDA, &abort_, local_cache, 20 * 1024 * 1024, 3); + } else { + log = std::make_unique(); + success = log->load(file, &abort_, local_cache, 0, 3); + } + + if (!success) { + // abort all loading jobs. + abort_ = true; + } + + if (--loading_ == 0) { + emit loadFinished(!abort_); + } +} diff --git a/selfdrive/ui/replay/route.h b/selfdrive/ui/replay/route.h new file mode 100644 index 000000000..ac8fba75c --- /dev/null +++ b/selfdrive/ui/replay/route.h @@ -0,0 +1,68 @@ +#pragma once + +#include + +#include "selfdrive/ui/replay/framereader.h" +#include "selfdrive/ui/replay/logreader.h" +#include "selfdrive/ui/replay/util.h" + +struct RouteIdentifier { + QString dongle_id; + QString timestamp; + int segment_id; + QString str; +}; + +struct SegmentFile { + QString rlog; + QString qlog; + QString road_cam; + QString driver_cam; + QString wide_road_cam; + QString qcamera; +}; + +class Route { +public: + Route(const QString &route, const QString &data_dir = {}); + bool load(); + inline const QString &name() const { return route_.str; } + inline const QString &dir() const { return data_dir_; } + inline const RouteIdentifier &identifier() const { return route_; } + inline const std::map &segments() const { return segments_; } + inline const SegmentFile &at(int n) { return segments_.at(n); } + static RouteIdentifier parseRoute(const QString &str); + +protected: + bool loadFromLocal(); + bool loadFromServer(); + bool loadFromJson(const QString &json); + void addFileToSegment(int seg_num, const QString &file); + RouteIdentifier route_ = {}; + QString data_dir_; + std::map segments_; +}; + +class Segment : public QObject { + Q_OBJECT + +public: + Segment(int n, const SegmentFile &files, uint32_t flags); + ~Segment(); + inline bool isLoaded() const { return !loading_ && !abort_; } + + const int seg_num = 0; + std::unique_ptr log; + std::unique_ptr frames[MAX_CAMERAS] = {}; + +signals: + void loadFinished(bool success); + +protected: + void loadFile(int id, const std::string file); + + std::atomic abort_ = false; + std::atomic loading_ = 0; + QFutureSynchronizer synchronizer_; + uint32_t flags; +}; diff --git a/selfdrive/ui/replay/util.cc b/selfdrive/ui/replay/util.cc new file mode 100644 index 000000000..5f06a6c83 --- /dev/null +++ b/selfdrive/ui/replay/util.cc @@ -0,0 +1,320 @@ +#include "selfdrive/ui/replay/util.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "selfdrive/common/timing.h" +#include "selfdrive/common/util.h" + +ReplayMessageHandler message_handler = nullptr; +DownloadProgressHandler download_progress_handler = nullptr; + +void installMessageHandler(ReplayMessageHandler handler) { message_handler = handler; } +void installDownloadProgressHandler(DownloadProgressHandler handler) { download_progress_handler = handler; } + +void logMessage(ReplyMsgType type, const char *fmt, ...) { + static std::mutex lock; + std::lock_guard lk(lock); + + char *msg_buf = nullptr; + va_list args; + va_start(args, fmt); + int ret = vasprintf(&msg_buf, fmt, args); + va_end(args); + if (ret <= 0 || !msg_buf) return; + + if (message_handler) { + message_handler(type, msg_buf); + } else { + if (type == ReplyMsgType::Debug) { + std::cout << "\033[38;5;248m" << msg_buf << "\033[00m" << std::endl; + } else if (type == ReplyMsgType::Warning) { + std::cout << "\033[38;5;227m" << msg_buf << "\033[00m" << std::endl; + } else if (type == ReplyMsgType::Critical) { + std::cout << "\033[38;5;196m" << msg_buf << "\033[00m" << std::endl; + } else { + std::cout << msg_buf << std::endl; + } + } + + free(msg_buf); +} + +namespace { + +struct CURLGlobalInitializer { + CURLGlobalInitializer() { curl_global_init(CURL_GLOBAL_DEFAULT); } + ~CURLGlobalInitializer() { curl_global_cleanup(); } +}; + +static CURLGlobalInitializer curl_initializer; + +template +struct MultiPartWriter { + T *buf; + size_t *total_written; + size_t offset; + size_t end; + + size_t write(char *data, size_t size, size_t count) { + size_t bytes = size * count; + if ((offset + bytes) > end) return 0; + + if constexpr (std::is_same::value) { + memcpy(buf->data() + offset, data, bytes); + } else if constexpr (std::is_same::value) { + buf->seekp(offset); + buf->write(data, bytes); + } + + offset += bytes; + *total_written += bytes; + return bytes; + } +}; + +template +size_t write_cb(char *data, size_t size, size_t count, void *userp) { + auto w = (MultiPartWriter *)userp; + return w->write(data, size, count); +} + +size_t dumy_write_cb(char *data, size_t size, size_t count, void *userp) { return size * count; } + +struct DownloadStats { + void add(const std::string &url, uint64_t total_bytes) { + std::lock_guard lk(lock); + items[url] = {0, total_bytes}; + } + + void remove(const std::string &url) { + std::lock_guard lk(lock); + items.erase(url); + } + + void update(const std::string &url, uint64_t downloaded, bool success = true) { + std::lock_guard lk(lock); + items[url].first = downloaded; + + auto stat = std::accumulate(items.begin(), items.end(), std::pair{}, [=](auto &a, auto &b){ + return std::pair{a.first + b.second.first, a.second + b.second.second}; + }); + double tm = millis_since_boot(); + if (download_progress_handler && ((tm - prev_tm) > 500 || !success || stat.first >= stat.second)) { + download_progress_handler(stat.first, stat.second, success); + prev_tm = tm; + } + } + + std::mutex lock; + std::map> items; + double prev_tm = 0; +}; + +} // namespace + +std::string formattedDataSize(size_t size) { + if (size < 1024) { + return std::to_string(size) + " B"; + } else if (size < 1024 * 1024) { + return util::string_format("%.2f KB", (float)size / 1024); + } else { + return util::string_format("%.2f MB", (float)size / (1024 * 1024)); + } +} + +size_t getRemoteFileSize(const std::string &url, std::atomic *abort) { + CURL *curl = curl_easy_init(); + if (!curl) return -1; + + curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, dumy_write_cb); + curl_easy_setopt(curl, CURLOPT_HEADER, 1); + curl_easy_setopt(curl, CURLOPT_NOBODY, 1); + + CURLM *cm = curl_multi_init(); + curl_multi_add_handle(cm, curl); + int still_running = 1; + while (still_running > 0 && !(abort && *abort)) { + CURLMcode mc = curl_multi_perform(cm, &still_running); + if (!mc) curl_multi_wait(cm, nullptr, 0, 1000, nullptr); + } + + double content_length = -1; + curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &content_length); + curl_multi_remove_handle(cm, curl); + curl_easy_cleanup(curl); + curl_multi_cleanup(cm); + return content_length > 0 ? (size_t)content_length : 0; +} + +std::string getUrlWithoutQuery(const std::string &url) { + size_t idx = url.find("?"); + return (idx == std::string::npos ? url : url.substr(0, idx)); +} + +template +bool httpDownload(const std::string &url, T &buf, size_t chunk_size, size_t content_length, std::atomic *abort) { + static DownloadStats download_stats; + download_stats.add(url, content_length); + + int parts = 1; + if (chunk_size > 0 && content_length > 10 * 1024 * 1024) { + parts = std::nearbyint(content_length / (float)chunk_size); + parts = std::clamp(parts, 1, 5); + } + + CURLM *cm = curl_multi_init(); + size_t written = 0; + std::map> writers; + const int part_size = content_length / parts; + for (int i = 0; i < parts; ++i) { + CURL *eh = curl_easy_init(); + writers[eh] = { + .buf = &buf, + .total_written = &written, + .offset = (size_t)(i * part_size), + .end = i == parts - 1 ? content_length : (i + 1) * part_size, + }; + curl_easy_setopt(eh, CURLOPT_WRITEFUNCTION, write_cb); + curl_easy_setopt(eh, CURLOPT_WRITEDATA, (void *)(&writers[eh])); + curl_easy_setopt(eh, CURLOPT_URL, url.c_str()); + curl_easy_setopt(eh, CURLOPT_RANGE, util::string_format("%d-%d", writers[eh].offset, writers[eh].end - 1).c_str()); + curl_easy_setopt(eh, CURLOPT_HTTPGET, 1); + curl_easy_setopt(eh, CURLOPT_NOSIGNAL, 1); + curl_easy_setopt(eh, CURLOPT_FOLLOWLOCATION, 1); + + curl_multi_add_handle(cm, eh); + } + + int still_running = 1; + while (still_running > 0 && !(abort && *abort)) { + curl_multi_wait(cm, nullptr, 0, 1000, nullptr); + curl_multi_perform(cm, &still_running); + download_stats.update(url, written); + } + + CURLMsg *msg; + int msgs_left = -1; + int complete = 0; + while ((msg = curl_multi_info_read(cm, &msgs_left)) && !(abort && *abort)) { + if (msg->msg == CURLMSG_DONE) { + if (msg->data.result == CURLE_OK) { + long res_status = 0; + curl_easy_getinfo(msg->easy_handle, CURLINFO_RESPONSE_CODE, &res_status); + if (res_status == 206) { + complete++; + } else { + rWarning("Download failed: http error code: %d", res_status); + } + } else { + rWarning("Download failed: connection failure: %d", msg->data.result); + } + } + } + + bool success = complete == parts; + download_stats.update(url, written, success); + download_stats.remove(url); + + for (const auto &[e, w] : writers) { + curl_multi_remove_handle(cm, e); + curl_easy_cleanup(e); + } + curl_multi_cleanup(cm); + + return success; +} + +std::string httpGet(const std::string &url, size_t chunk_size, std::atomic *abort) { + size_t size = getRemoteFileSize(url, abort); + if (size == 0) return {}; + + std::string result(size, '\0'); + return httpDownload(url, result, chunk_size, size, abort) ? result : ""; +} + +bool httpDownload(const std::string &url, const std::string &file, size_t chunk_size, std::atomic *abort) { + size_t size = getRemoteFileSize(url, abort); + if (size == 0) return false; + + std::ofstream of(file, std::ios::binary | std::ios::out); + of.seekp(size - 1).write("\0", 1); + return httpDownload(url, of, chunk_size, size, abort); +} + +std::string decompressBZ2(const std::string &in, std::atomic *abort) { + return decompressBZ2((std::byte *)in.data(), in.size(), abort); +} + +std::string decompressBZ2(const std::byte *in, size_t in_size, std::atomic *abort) { + if (in_size == 0) return {}; + + bz_stream strm = {}; + int bzerror = BZ2_bzDecompressInit(&strm, 0, 0); + assert(bzerror == BZ_OK); + + strm.next_in = (char *)in; + strm.avail_in = in_size; + std::string out(in_size * 5, '\0'); + do { + strm.next_out = (char *)(&out[strm.total_out_lo32]); + strm.avail_out = out.size() - strm.total_out_lo32; + + const char *prev_write_pos = strm.next_out; + bzerror = BZ2_bzDecompress(&strm); + if (bzerror == BZ_OK && prev_write_pos == strm.next_out) { + // content is corrupt + bzerror = BZ_STREAM_END; + rWarning("decompressBZ2 error : content is corrupt"); + break; + } + + if (bzerror == BZ_OK && strm.avail_in > 0 && strm.avail_out == 0) { + out.resize(out.size() * 2); + } + } while (bzerror == BZ_OK && !(abort && *abort)); + + BZ2_bzDecompressEnd(&strm); + if (bzerror == BZ_STREAM_END && !(abort && *abort)) { + out.resize(strm.total_out_lo32); + return out; + } + return {}; +} + +void precise_nano_sleep(long sleep_ns) { + const long estimate_ns = 1 * 1e6; // 1ms + struct timespec req = {.tv_nsec = estimate_ns}; + uint64_t start_sleep = nanos_since_boot(); + while (sleep_ns > estimate_ns) { + nanosleep(&req, nullptr); + uint64_t end_sleep = nanos_since_boot(); + sleep_ns -= (end_sleep - start_sleep); + start_sleep = end_sleep; + } + // spin wait + if (sleep_ns > 0) { + while ((nanos_since_boot() - start_sleep) <= sleep_ns) { + usleep(0); + } + } +} + +std::string sha256(const std::string &str) { + unsigned char hash[SHA256_DIGEST_LENGTH]; + SHA256_CTX sha256; + SHA256_Init(&sha256); + SHA256_Update(&sha256, str.c_str(), str.size()); + SHA256_Final(hash, &sha256); + return util::hexdump(hash, SHA256_DIGEST_LENGTH); +} diff --git a/selfdrive/ui/replay/util.h b/selfdrive/ui/replay/util.h new file mode 100644 index 000000000..6c808095e --- /dev/null +++ b/selfdrive/ui/replay/util.h @@ -0,0 +1,34 @@ +#pragma once + +#include +#include +#include + +enum class ReplyMsgType { + Info, + Debug, + Warning, + Critical +}; + +typedef std::function ReplayMessageHandler; +void installMessageHandler(ReplayMessageHandler); +void logMessage(ReplyMsgType type, const char* fmt, ...); + +#define rInfo(fmt, ...) ::logMessage(ReplyMsgType::Info, fmt, ## __VA_ARGS__) +#define rDebug(fmt, ...) ::logMessage(ReplyMsgType::Debug, fmt, ## __VA_ARGS__) +#define rWarning(fmt, ...) ::logMessage(ReplyMsgType::Warning, fmt, ## __VA_ARGS__) +#define rError(fmt, ...) ::logMessage(ReplyMsgType::Critical , fmt, ## __VA_ARGS__) + +std::string sha256(const std::string &str); +void precise_nano_sleep(long sleep_ns); +std::string decompressBZ2(const std::string &in, std::atomic *abort = nullptr); +std::string decompressBZ2(const std::byte *in, size_t in_size, std::atomic *abort = nullptr); +std::string getUrlWithoutQuery(const std::string &url); +size_t getRemoteFileSize(const std::string &url, std::atomic *abort = nullptr); +std::string httpGet(const std::string &url, size_t chunk_size = 0, std::atomic *abort = nullptr); + +typedef std::function DownloadProgressHandler; +void installDownloadProgressHandler(DownloadProgressHandler); +bool httpDownload(const std::string &url, const std::string &file, size_t chunk_size = 0, std::atomic *abort = nullptr); +std::string formattedDataSize(size_t size); diff --git a/selfdrive/ui/soundd/.gitignore b/selfdrive/ui/soundd/.gitignore new file mode 100644 index 000000000..c47f949d3 --- /dev/null +++ b/selfdrive/ui/soundd/.gitignore @@ -0,0 +1 @@ +_soundd diff --git a/selfdrive/ui/soundd/_soundd b/selfdrive/ui/soundd/_soundd new file mode 100755 index 000000000..8fde0dc42 Binary files /dev/null and b/selfdrive/ui/soundd/_soundd differ diff --git a/selfdrive/ui/soundd/main.cc b/selfdrive/ui/soundd/main.cc new file mode 100644 index 000000000..64088deff --- /dev/null +++ b/selfdrive/ui/soundd/main.cc @@ -0,0 +1,22 @@ +#include + +#include + +#include "selfdrive/ui/qt/util.h" +#include "selfdrive/ui/soundd/sound.h" + +void sigHandler(int s) { + qApp->quit(); +} + +int main(int argc, char **argv) { + qInstallMessageHandler(swagLogMessageHandler); + setpriority(PRIO_PROCESS, 0, -20); + + QApplication a(argc, argv); + std::signal(SIGINT, sigHandler); + std::signal(SIGTERM, sigHandler); + + Sound sound; + return a.exec(); +} diff --git a/selfdrive/ui/soundd/sound.cc b/selfdrive/ui/soundd/sound.cc new file mode 100644 index 000000000..f303aa92b --- /dev/null +++ b/selfdrive/ui/soundd/sound.cc @@ -0,0 +1,81 @@ +#include "selfdrive/ui/soundd/sound.h" + +#include + +#include +#include +#include + +#include "cereal/messaging/messaging.h" +#include "selfdrive/common/util.h" + +// TODO: detect when we can't play sounds +// TODO: detect when we can't display the UI + +Sound::Sound(QObject *parent) : sm({"carState", "controlsState", "deviceState"}) { + qInfo() << "default audio device: " << QAudioDeviceInfo::defaultOutputDevice().deviceName(); + + for (auto &[alert, fn, loops] : sound_list) { + QSoundEffect *s = new QSoundEffect(this); + QObject::connect(s, &QSoundEffect::statusChanged, [=]() { + assert(s->status() != QSoundEffect::Error); + }); + s->setVolume(Hardware::MIN_VOLUME); + s->setSource(QUrl::fromLocalFile("../../assets/sounds/" + fn)); + sounds[alert] = {s, loops}; + } + + QTimer *timer = new QTimer(this); + QObject::connect(timer, &QTimer::timeout, this, &Sound::update); + timer->start(1000 / UI_FREQ); +}; + +void Sound::update() { + const bool started_prev = sm["deviceState"].getDeviceState().getStarted(); + sm.update(0); + + const bool started = sm["deviceState"].getDeviceState().getStarted(); + if (started && !started_prev) { + started_frame = sm.frame; + } + + // no sounds while offroad + // also no sounds if nothing is alive in case thermald crashes while offroad + const bool crashed = (sm.frame - std::max(sm.rcv_frame("deviceState"), sm.rcv_frame("controlsState"))) > 10*UI_FREQ; + if (!started || crashed) { + setAlert({}); + return; + } + + // scale volume with speed + if (sm.updated("carState")) { + float volume = util::map_val(sm["carState"].getCarState().getVEgo(), 11.f, 20.f, 0.f, 1.0f); + volume = QAudio::convertVolume(volume, QAudio::LogarithmicVolumeScale, QAudio::LinearVolumeScale); + volume = util::map_val(volume, 0.f, 1.f, Hardware::MIN_VOLUME, Hardware::MAX_VOLUME); + for (auto &[s, loops] : sounds) { + s->setVolume(std::round(100 * volume) / 100); + } + } + + setAlert(Alert::get(sm, started_frame)); +} + +void Sound::setAlert(const Alert &alert) { + if (!current_alert.equal(alert)) { + current_alert = alert; + // stop sounds + for (auto &[s, loops] : sounds) { + // Only stop repeating sounds + if (s->loopsRemaining() > 1 || s->loopsRemaining() == QSoundEffect::Infinite) { + s->stop(); + } + } + + // play sound + if (alert.sound != AudibleAlert::NONE) { + auto &[s, loops] = sounds[alert.sound]; + s->setLoopCount(loops); + s->play(); + } + } +} diff --git a/selfdrive/ui/soundd/sound.h b/selfdrive/ui/soundd/sound.h new file mode 100644 index 000000000..82b360fd3 --- /dev/null +++ b/selfdrive/ui/soundd/sound.h @@ -0,0 +1,34 @@ +#include +#include +#include + +#include "selfdrive/hardware/hw.h" +#include "selfdrive/ui/ui.h" + +const std::tuple sound_list[] = { + // AudibleAlert, file name, loop count + {AudibleAlert::ENGAGE, "engage.wav", 0}, + {AudibleAlert::DISENGAGE, "disengage.wav", 0}, + {AudibleAlert::REFUSE, "refuse.wav", 0}, + + {AudibleAlert::PROMPT, "prompt.wav", 0}, + {AudibleAlert::PROMPT_REPEAT, "prompt.wav", QSoundEffect::Infinite}, + {AudibleAlert::PROMPT_DISTRACTED, "prompt_distracted.wav", QSoundEffect::Infinite}, + + {AudibleAlert::WARNING_SOFT, "warning_soft.wav", QSoundEffect::Infinite}, + {AudibleAlert::WARNING_IMMEDIATE, "warning_immediate.wav", QSoundEffect::Infinite}, +}; + +class Sound : public QObject { +public: + explicit Sound(QObject *parent = 0); + +protected: + void update(); + void setAlert(const Alert &alert); + + Alert current_alert = {}; + QMap> sounds; + SubMaster sm; + uint64_t started_frame; +}; diff --git a/selfdrive/ui/soundd/soundd b/selfdrive/ui/soundd/soundd new file mode 100755 index 000000000..66dda46d5 --- /dev/null +++ b/selfdrive/ui/soundd/soundd @@ -0,0 +1,5 @@ +#!/bin/sh +cd "$(dirname "$0")" +export LD_LIBRARY_PATH="/system/lib64:$LD_LIBRARY_PATH" +export QT_QPA_PLATFORM="offscreen" +exec ./_soundd diff --git a/selfdrive/ui/spinner b/selfdrive/ui/spinner new file mode 100755 index 000000000..4a75ca25a --- /dev/null +++ b/selfdrive/ui/spinner @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ -f /EON ] && [ ! -f qt/spinner ]; then + cp qt/spinner_aarch64 qt/spinner +elif [ -f /TICI ] && [ ! -f qt/spinner ]; then + cp qt/spinner_larch64 qt/spinner +fi + +export LD_LIBRARY_PATH="/system/lib64:$LD_LIBRARY_PATH" +exec ./qt/spinner "$1" diff --git a/selfdrive/ui/tbui.h b/selfdrive/ui/tbui.h new file mode 100644 index 000000000..0c587fac6 --- /dev/null +++ b/selfdrive/ui/tbui.h @@ -0,0 +1,73 @@ +const int vwp_w = 1920; +const int vwp_h = 1080; + + +static void ui_draw_infobar(UIState *s) { + //const UIScene *scene = &s->scene; + int ui_viz_rx = s->viz_rect.x; + bool hasSidebar = !s->sidebar_collapsed; + int rect_w = vwp_w - ui_viz_rx - bdr_s; + int rect_h = 60; + int rect_x = 0; + // rect_y = screen height - board - background height + int rect_y = vwp_h - bdr_s - (int) (rect_h/2) - 5; + rect_x = rect_x + ui_viz_rx; + + int text_x = rect_w / 2; + text_x = text_x + ui_viz_rx; + int text_y = rect_y + 45; + + // Get local time to display + char infobar[68]; + time_t t = time(NULL); + struct tm tm = *localtime(&t); + + char uom_str[5]; + snprintf(uom_str, sizeof(uom_str), s->scene.is_metric ? "km/h" : "mph"); + char spd[6]; + snprintf(spd, sizeof(spd), "%.1f ", s->scene.is_metric ? s->scene.car_state.getVEgo() * 3.6 : s->scene.car_state.getVEgo() * 2.2369363); + + char ang_steer[9]; + snprintf(ang_steer, sizeof(ang_steer), "%s%03.1f°", s->b.angleSteers < 0? "-" : "+", fabs(s->b.angleSteers)); + + char lead_dist[8]; + if (s->scene.lead_data[0].getStatus()) { + snprintf(lead_dist, sizeof(lead_dist), "%05.2fm", s->scene.lead_data[0].getDRel()); + } else { + snprintf(lead_dist, sizeof(lead_dist), "%3s", "N/A"); + } + + char maxspeed_str[7]; + if (s->scene.started && s->scene.controls_state.getVCruise() > 0) { + float maxspeed = s->scene.is_metric ? s->scene.controls_state.getVCruise() : s->scene.controls_state.getVCruise() / 1.609; + snprintf(maxspeed_str, sizeof(maxspeed_str), "/%.1f", maxspeed); + } + + snprintf( + infobar, + sizeof(infobar), + "%04d/%02d/%02d %02d:%02d:%02d | %s%s %s | DST: %s | ANG: %s", + tm.tm_year + 1900, + tm.tm_mon + 1, + tm.tm_mday, + tm.tm_hour, + tm.tm_min, + tm.tm_sec, + spd, + maxspeed_str, + uom_str, + lead_dist, + ang_steer + ); + + nvgBeginPath(s->vg); + nvgRoundedRect(s->vg, rect_x, rect_y, rect_w, rect_h, 5); + nvgFillColor(s->vg, nvgRGBA(0, 0, 0, 180)); + nvgFill(s->vg); + + nvgFontSize(s->vg, hasSidebar? 40:50); + nvgFontFace(s->vg, "courbd"); + nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 180)); + nvgTextAlign(s->vg, NVG_ALIGN_CENTER); + nvgText(s->vg, text_x, text_y, infobar, NULL); +} diff --git a/selfdrive/ui/text b/selfdrive/ui/text new file mode 100755 index 000000000..a7177c656 --- /dev/null +++ b/selfdrive/ui/text @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ -f /EON ] && [ ! -f qt/text ]; then + cp qt/text_aarch64 qt/text +elif [ -f /TICI ] && [ ! -f qt/text ]; then + cp qt/text_larch64 qt/text +fi + +export LD_LIBRARY_PATH="/system/lib64:$LD_LIBRARY_PATH" +exec ./qt/text "$1" diff --git a/selfdrive/ui/ui b/selfdrive/ui/ui new file mode 100755 index 000000000..68c8c2cad --- /dev/null +++ b/selfdrive/ui/ui @@ -0,0 +1,5 @@ +#!/bin/sh +cd "$(dirname "$0")" +export LD_LIBRARY_PATH="/system/lib64:$LD_LIBRARY_PATH" +export QT_PLUGIN_PATH="../../third_party/qt-plugins/$(uname -m)" +exec ./_ui diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc new file mode 100644 index 000000000..59115bad5 --- /dev/null +++ b/selfdrive/ui/ui.cc @@ -0,0 +1,358 @@ +#include "selfdrive/ui/ui.h" + +#include +#include + +#include + +#include "common/transformations/orientation.hpp" +#include "selfdrive/common/params.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/util.h" +#include "selfdrive/common/watchdog.h" +#include "selfdrive/hardware/hw.h" + +#define BACKLIGHT_DT 0.05 +#define BACKLIGHT_TS 10.00 +#define BACKLIGHT_OFFROAD 50 + + + +// Projects a point in car to space to the corresponding point in full frame +// image space. +static bool calib_frame_to_full_frame(const UIState *s, float in_x, float in_y, float in_z, QPointF *out) { + const float margin = 500.0f; + const QRectF clip_region{-margin, -margin, s->fb_w + 2 * margin, s->fb_h + 2 * margin}; + + const vec3 pt = (vec3){{in_x, in_y, in_z}}; + const vec3 Ep = matvecmul3(s->scene.view_from_calib, pt); + const vec3 KEp = matvecmul3(s->wide_camera ? ecam_intrinsic_matrix : fcam_intrinsic_matrix, Ep); + + // Project. + QPointF point = s->car_space_transform.map(QPointF{KEp.v[0] / KEp.v[2], KEp.v[1] / KEp.v[2]}); + if (clip_region.contains(point)) { + *out = point; + return true; + } + return false; +} + +static int get_path_length_idx(const cereal::ModelDataV2::XYZTData::Reader &line, const float path_height) { + const auto line_x = line.getX(); + int max_idx = 0; + for (int i = 1; i < TRAJECTORY_SIZE && line_x[i] <= path_height; ++i) { + max_idx = i; + } + return max_idx; +} + +static void update_leads(UIState *s, const cereal::RadarState::Reader &radar_state, const cereal::ModelDataV2::XYZTData::Reader &line) { + for (int i = 0; i < 2; ++i) { + auto lead_data = (i == 0) ? radar_state.getLeadOne() : radar_state.getLeadTwo(); + if (lead_data.getStatus()) { + float z = line.getZ()[get_path_length_idx(line, lead_data.getDRel())]; + calib_frame_to_full_frame(s, lead_data.getDRel(), -lead_data.getYRel(), z + 1.22, &s->scene.lead_vertices[i]); + } + } +} + +static void update_line_data(const UIState *s, const cereal::ModelDataV2::XYZTData::Reader &line, + float y_off, float z_off, line_vertices_data *pvd, int max_idx) { + const auto line_x = line.getX(), line_y = line.getY(), line_z = line.getZ(); + QPointF *v = &pvd->v[0]; + for (int i = 0; i <= max_idx; i++) { + v += calib_frame_to_full_frame(s, line_x[i], line_y[i] - y_off, line_z[i] + z_off, v); + } + for (int i = max_idx; i >= 0; i--) { + v += calib_frame_to_full_frame(s, line_x[i], line_y[i] + y_off, line_z[i] + z_off, v); + } + pvd->cnt = v - pvd->v; + assert(pvd->cnt <= std::size(pvd->v)); +} + +static void update_model(UIState *s, const cereal::ModelDataV2::Reader &model) { + UIScene &scene = s->scene; + auto model_position = model.getPosition(); + float max_distance = std::clamp(model_position.getX()[TRAJECTORY_SIZE - 1], + MIN_DRAW_DISTANCE, MAX_DRAW_DISTANCE); + + // update lane lines + const auto lane_lines = model.getLaneLines(); + const auto lane_line_probs = model.getLaneLineProbs(); + int max_idx = get_path_length_idx(lane_lines[0], max_distance); + for (int i = 0; i < std::size(scene.lane_line_vertices); i++) { + scene.lane_line_probs[i] = lane_line_probs[i]; + update_line_data(s, lane_lines[i], 0.025 * scene.lane_line_probs[i], 0, &scene.lane_line_vertices[i], max_idx); + } + + // update road edges + const auto road_edges = model.getRoadEdges(); + const auto road_edge_stds = model.getRoadEdgeStds(); + for (int i = 0; i < std::size(scene.road_edge_vertices); i++) { + scene.road_edge_stds[i] = road_edge_stds[i]; + update_line_data(s, road_edges[i], 0.025, 0, &scene.road_edge_vertices[i], max_idx); + } + + // update path + auto lead_one = (*s->sm)["radarState"].getRadarState().getLeadOne(); + if (lead_one.getStatus()) { + const float lead_d = lead_one.getDRel() * 2.; + max_distance = std::clamp((float)(lead_d - fmin(lead_d * 0.35, 10.)), 0.0f, max_distance); + } + max_idx = get_path_length_idx(model_position, max_distance); + update_line_data(s, model_position, 0.5, 1.22, &scene.track_vertices, max_idx); +} + +static void update_sockets(UIState *s) { + s->sm->update(0); +} + +static void update_state(UIState *s) { + SubMaster &sm = *(s->sm); + UIScene &scene = s->scene; + + if (sm.updated("liveCalibration")) { + auto rpy_list = sm["liveCalibration"].getLiveCalibration().getRpyCalib(); + Eigen::Vector3d rpy; + rpy << rpy_list[0], rpy_list[1], rpy_list[2]; + Eigen::Matrix3d device_from_calib = euler2rot(rpy); + Eigen::Matrix3d view_from_device; + view_from_device << 0,1,0, + 0,0,1, + 1,0,0; + Eigen::Matrix3d view_from_calib = view_from_device * device_from_calib; + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { + scene.view_from_calib.v[i*3 + j] = view_from_calib(i,j); + } + } + } + if (s->worldObjectsVisible()) { + if (sm.updated("modelV2")) { + update_model(s, sm["modelV2"].getModelV2()); + } + if (sm.updated("radarState") && sm.rcv_frame("modelV2") > s->scene.started_frame) { + update_leads(s, sm["radarState"].getRadarState(), sm["modelV2"].getModelV2().getPosition()); + } + } + if (sm.updated("pandaStates")) { + auto pandaStates = sm["pandaStates"].getPandaStates(); + if (pandaStates.size() > 0) { + scene.pandaType = pandaStates[0].getPandaType(); + + if (scene.pandaType != cereal::PandaState::PandaType::UNKNOWN) { + scene.ignition = false; + for (const auto& pandaState : pandaStates) { + scene.ignition |= pandaState.getIgnitionLine() || pandaState.getIgnitionCan(); + } + } + } + } else if ((s->sm->frame - s->sm->rcv_frame("pandaStates")) > 5*UI_FREQ) { + scene.pandaType = cereal::PandaState::PandaType::UNKNOWN; + } + if (sm.updated("carParams")) { + scene.longitudinal_control = sm["carParams"].getCarParams().getOpenpilotLongitudinalControl(); + } + if ((!scene.started && !s->should_turn_screen_off) && sm.updated("sensorEvents")) { + for (auto sensor : sm["sensorEvents"].getSensorEvents()) { + if (sensor.which() == cereal::SensorEventData::ACCELERATION) { + auto accel = sensor.getAcceleration().getV(); + if (accel.totalSize().wordCount) { // TODO: sometimes empty lists are received. Figure out why + scene.accel_sensor = accel[2]; + } + } else if (sensor.which() == cereal::SensorEventData::GYRO_UNCALIBRATED) { + auto gyro = sensor.getGyroUncalibrated().getV(); + if (gyro.totalSize().wordCount) { + scene.gyro_sensor = gyro[1]; + } + } + } + } + if (!Hardware::TICI() && sm.updated("roadCameraState")) { + auto camera_state = sm["roadCameraState"].getRoadCameraState(); + + float max_lines = Hardware::EON() ? 5408 : 1904; + float max_gain = Hardware::EON() ? 1.0: 10.0; + float max_ev = max_lines * max_gain; + + float ev = camera_state.getGain() * float(camera_state.getIntegLines()); + + scene.light_sensor = std::clamp(1.0 - (ev / max_ev), 0.0, 1.0); + } else if (Hardware::TICI() && sm.updated("wideRoadCameraState")) { + auto camera_state = sm["wideRoadCameraState"].getWideRoadCameraState(); + + float max_lines = 1904; + float max_gain = 10.0; + float max_ev = max_lines * max_gain / 6; + + float ev = camera_state.getGain() * float(camera_state.getIntegLines()); + + scene.light_sensor = std::clamp(1.0 - (ev / max_ev), 0.0, 1.0); + } + scene.started = sm["deviceState"].getDeviceState().getStarted() && scene.ignition; +} + +void ui_update_params(UIState *s) { + const uint64_t frame = s->sm->frame; + s->scene.is_metric = Params().getBool("IsMetric"); + if (frame % (6*UI_FREQ) == 0) { + s->should_turn_screen_off = ((!Params().tinkla_get_bool_param("TinklaDebugMode")) && Params().tinkla_get_bool_param("TinklaTurnScreenOff")); + } +} + +void UIState::updateStatus() { + if (scene.started && sm->updated("controlsState")) { + auto controls_state = (*sm)["controlsState"].getControlsState(); + auto alert_status = controls_state.getAlertStatus(); + auto atext1 = controls_state.getAlertText1(); + alert_active = (strlen(atext1.cStr()) > 0); + if (alert_status == cereal::ControlsState::AlertStatus::USER_PROMPT) { + status = STATUS_WARNING; + } else if (alert_status == cereal::ControlsState::AlertStatus::CRITICAL) { + status = STATUS_ALERT; + } else { + status = controls_state.getEnabled() ? STATUS_ENGAGED : STATUS_DISENGAGED; + } + } + + // Handle onroad/offroad transition + if (scene.started != started_prev || sm->frame == 1) { + if (scene.started) { + status = STATUS_DISENGAGED; + scene.started_frame = sm->frame; + scene.end_to_end = Params().getBool("EndToEndToggle"); + wide_camera = Hardware::TICI() ? Params().getBool("EnableWideCamera") : false; + } else { + alert_active = false; + } + started_prev = scene.started; + emit offroadTransition(!scene.started); + } +} + +UIState::UIState(QObject *parent) : QObject(parent) { + sm = std::make_unique>({ + "modelV2", "controlsState", "liveCalibration", "radarState", "deviceState", "roadCameraState", + "pandaStates", "carParams", "driverMonitoringState", "sensorEvents", "carState", "liveLocationKalman", + "wideRoadCameraState", + }); + + Params params; + wide_camera = Hardware::TICI() ? params.getBool("EnableWideCamera") : false; + prime_type = std::atoi(params.get("PrimeType").c_str()); + + // update timer + timer = new QTimer(this); + QObject::connect(timer, &QTimer::timeout, this, &UIState::update); + timer->start(1000 / UI_FREQ); +} + +void UIState::update() { + update_sockets(this); + update_state(this); + updateStatus(); + + if (sm->frame % UI_FREQ == 0) { + watchdog_kick(); + } + emit uiUpdate(*this); +} + +Device::Device(QObject *parent) : brightness_filter(BACKLIGHT_OFFROAD, BACKLIGHT_TS, BACKLIGHT_DT), QObject(parent) { + setAwake(true); + resetInteractiveTimout(); + + QObject::connect(uiState(), &UIState::uiUpdate, this, &Device::update); +} + +void Device::update(const UIState &s) { + updateBrightness(s); + updateWakefulness(s); + + // TODO: remove from UIState and use signals + uiState()->awake = awake; +} + +void Device::setAwake(bool on) { + if (on != awake) { + awake = on; + Hardware::set_display_power(awake); + LOGD("setting display power %d", awake); + emit displayPowerChanged(awake); + } +} + +void Device::resetInteractiveTimout() { + interactive_timeout = (ignition_on ? 10 : 30) * UI_FREQ; +} + +void Device::updateBrightness(const UIState &s) { + float clipped_brightness = BACKLIGHT_OFFROAD; + if (s.scene.started) { + // Scale to 0% to 100% + clipped_brightness = 100.0 * s.scene.light_sensor; + + // CIE 1931 - https://www.photonstophotos.net/GeneralTopics/Exposure/Psychometric_Lightness_and_Gamma.htm + if (clipped_brightness <= 8) { + clipped_brightness = (clipped_brightness / 903.3); + } else { + clipped_brightness = std::pow((clipped_brightness + 16.0) / 116.0, 3.0); + } + + // Scale back to 10% to 100% + clipped_brightness = std::clamp(100.0f * clipped_brightness, 10.0f, 100.0f); + + if (awake && s.should_turn_screen_off) { + clipped_brightness = (s.alert_active || (interactive_timeout > 0)) ? clipped_brightness : 0; + } + } + + int brightness = brightness_filter.update(clipped_brightness); + + if (!awake) { + brightness = 0; + } + + if (brightness != last_brightness) { + if (!brightness_future.isRunning()) { + brightness_future = QtConcurrent::run(Hardware::set_brightness, brightness); + last_brightness = brightness; + } + } +} + +bool Device::motionTriggered(const UIState &s) { + static float accel_prev = 0; + static float gyro_prev = 0; + + bool accel_trigger = abs(s.scene.accel_sensor - accel_prev) > 0.2; + bool gyro_trigger = abs(s.scene.gyro_sensor - gyro_prev) > 0.15; + + gyro_prev = s.scene.gyro_sensor; + accel_prev = (accel_prev * (accel_samples - 1) + s.scene.accel_sensor) / accel_samples; + + return (!awake && accel_trigger && gyro_trigger); +} + +void Device::updateWakefulness(const UIState &s) { + bool ignition_just_turned_off = !s.scene.ignition && ignition_on; + ignition_on = s.scene.ignition; + + if (ignition_just_turned_off || (motionTriggered(s) && !ignition_on)) { + resetInteractiveTimout(); + } else if (interactive_timeout > 0 && --interactive_timeout == 0) { + emit interactiveTimout(); + } + + bool should_be_awake = s.scene.ignition; + if (s.should_turn_screen_off && should_be_awake) { + should_be_awake = (s.alert_active && should_be_awake); + } + + setAwake(should_be_awake || interactive_timeout > 0); +} + +UIState *uiState() { + static UIState ui_state; + return &ui_state; +} diff --git a/selfdrive/ui/ui.h b/selfdrive/ui/ui.h new file mode 100644 index 000000000..817f05b6d --- /dev/null +++ b/selfdrive/ui/ui.h @@ -0,0 +1,184 @@ +#pragma once + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "cereal/messaging/messaging.h" +#include "selfdrive/common/modeldata.h" +#include "selfdrive/common/params.h" +#include "selfdrive/common/timing.h" + +const int bdr_s = 30; +const int header_h = 420; +const int footer_h = 280; + +const int UI_FREQ = 20; // Hz +typedef cereal::CarControl::HUDControl::AudibleAlert AudibleAlert; + +// TODO: this is also hardcoded in common/transformations/camera.py +// TODO: choose based on frame input size +const float y_offset = Hardware::EON() ? 0.0 : 150.0; +const float ZOOM = Hardware::EON() ? 2138.5 : 2912.8; + +struct Alert { + QString text1; + QString text2; + QString type; + cereal::ControlsState::AlertSize size; + AudibleAlert sound; + + bool equal(const Alert &a2) { + return text1 == a2.text1 && text2 == a2.text2 && type == a2.type && sound == a2.sound; + } + + static Alert get(const SubMaster &sm, uint64_t started_frame) { + const cereal::ControlsState::Reader &cs = sm["controlsState"].getControlsState(); + if (sm.updated("controlsState")) { + return {cs.getAlertText1().cStr(), cs.getAlertText2().cStr(), + cs.getAlertType().cStr(), cs.getAlertSize(), + cs.getAlertSound()}; + } else if ((sm.frame - started_frame) > 5 * UI_FREQ) { + const int CONTROLS_TIMEOUT = 5; + const int controls_missing = (nanos_since_boot() - sm.rcv_time("controlsState")) / 1e9; + + // Handle controls timeout + if (sm.rcv_frame("controlsState") < started_frame) { + // car is started, but controlsState hasn't been seen at all + return {"openpilot Unavailable", "Waiting for controls to start", + "controlsWaiting", cereal::ControlsState::AlertSize::MID, + AudibleAlert::NONE}; + } else if (controls_missing > CONTROLS_TIMEOUT) { + // car is started, but controls is lagging or died + if (cs.getEnabled() && (controls_missing - CONTROLS_TIMEOUT) < 10) { + return {"TAKE CONTROL IMMEDIATELY", "Controls Unresponsive", + "controlsUnresponsive", cereal::ControlsState::AlertSize::FULL, + AudibleAlert::WARNING_IMMEDIATE}; + } else { + return {"Controls Unresponsive", "Reboot Device", + "controlsUnresponsivePermanent", cereal::ControlsState::AlertSize::MID, + AudibleAlert::NONE}; + } + } + } + return {}; + } +}; + +typedef enum UIStatus { + STATUS_DISENGAGED, + STATUS_ENGAGED, + STATUS_WARNING, + STATUS_ALERT, +} UIStatus; + +const QColor bg_colors [] = { + [STATUS_DISENGAGED] = QColor(0x17, 0x33, 0x49, 0xc8), + [STATUS_ENGAGED] = QColor(0x17, 0x86, 0x44, 0xf1), + [STATUS_WARNING] = QColor(0xDA, 0x6F, 0x25, 0xf1), + [STATUS_ALERT] = QColor(0xC9, 0x22, 0x31, 0xf1), +}; + +typedef struct { + QPointF v[TRAJECTORY_SIZE * 2]; + int cnt; +} line_vertices_data; + +typedef struct UIScene { + mat3 view_from_calib; + cereal::PandaState::PandaType pandaType; + + // modelV2 + float lane_line_probs[4]; + float road_edge_stds[2]; + line_vertices_data track_vertices; + line_vertices_data lane_line_vertices[4]; + line_vertices_data road_edge_vertices[2]; + + // lead + QPointF lead_vertices[2]; + + float light_sensor, accel_sensor, gyro_sensor; + bool started, ignition, is_metric, longitudinal_control, end_to_end; + uint64_t started_frame; +} UIScene; + +class UIState : public QObject { + Q_OBJECT + +public: + UIState(QObject* parent = 0); + void updateStatus(); + inline bool worldObjectsVisible() const { + return sm->rcv_frame("liveCalibration") > scene.started_frame; + }; + + int fb_w = 0, fb_h = 0; + bool should_turn_screen_off = false; + bool alert_active = false; + + std::unique_ptr sm; + + UIStatus status; + UIScene scene = {}; + + bool awake; + int prime_type = 0; + + QTransform car_space_transform; + bool wide_camera; + +signals: + void uiUpdate(const UIState &s); + void offroadTransition(bool offroad); + +private slots: + void update(); + +private: + QTimer *timer; + bool started_prev = false; +}; + +UIState *uiState(); + +// device management class + +class Device : public QObject { + Q_OBJECT + +public: + Device(QObject *parent = 0); + +private: + // auto brightness + const float accel_samples = 5*UI_FREQ; + + bool awake = false; + int interactive_timeout = 0; + bool ignition_on = false; + int last_brightness = 0; + FirstOrderFilter brightness_filter; + QFuture brightness_future; + + void updateBrightness(const UIState &s); + void updateWakefulness(const UIState &s); + bool motionTriggered(const UIState &s); + void setAwake(bool on); + +signals: + void displayPowerChanged(bool on); + void interactiveTimout(); + +public slots: + void resetInteractiveTimout(); + void update(const UIState &s); +}; + +void ui_update_params(UIState *s); diff --git a/selfdrive/ui/watch3.cc b/selfdrive/ui/watch3.cc new file mode 100644 index 000000000..73c8e1131 --- /dev/null +++ b/selfdrive/ui/watch3.cc @@ -0,0 +1,36 @@ +#include +#include + +#include "selfdrive/ui/qt/qt_window.h" +#include "selfdrive/ui/qt/util.h" +#include "selfdrive/ui/qt/widgets/cameraview.h" + +int main(int argc, char *argv[]) { + QSurfaceFormat fmt; + fmt.setRenderableType(QSurfaceFormat::OpenGLES); + QSurfaceFormat::setDefaultFormat(fmt); + + QApplication a(argc, argv); + QWidget w; + setMainWindow(&w); + + QVBoxLayout *layout = new QVBoxLayout(&w); + layout->setMargin(0); + layout->setSpacing(0); + + { + QHBoxLayout *hlayout = new QHBoxLayout(); + layout->addLayout(hlayout); + hlayout->addWidget(new CameraViewWidget("navd", VISION_STREAM_RGB_MAP, false)); + hlayout->addWidget(new CameraViewWidget("camerad", VISION_STREAM_RGB_BACK, false)); + } + + { + QHBoxLayout *hlayout = new QHBoxLayout(); + layout->addLayout(hlayout); + hlayout->addWidget(new CameraViewWidget("camerad", VISION_STREAM_RGB_FRONT, false)); + hlayout->addWidget(new CameraViewWidget("camerad", VISION_STREAM_RGB_WIDE, false)); + } + + return a.exec(); +} diff --git a/selfdrive/updated.py b/selfdrive/updated.py new file mode 100755 index 000000000..24440edaa --- /dev/null +++ b/selfdrive/updated.py @@ -0,0 +1,478 @@ +#!/usr/bin/env python3 + +# Safe Update: A simple service that waits for network access and tries to +# update every 10 minutes. It's intended to make the OP update process more +# robust against Git repository corruption. This service DOES NOT try to fix +# an already-corrupt BASEDIR Git repo, only prevent it from happening. +# +# During normal operation, both onroad and offroad, the update process makes +# no changes to the BASEDIR install of OP. All update attempts are performed +# in a disposable staging area provided by OverlayFS. It assumes the deleter +# process provides enough disk space to carry out the process. +# +# If an update succeeds, a flag is set, and the update is swapped in at the +# next reboot. If an update is interrupted or otherwise fails, the OverlayFS +# upper layer and metadata can be discarded before trying again. +# +# The swap on boot is triggered by launch_chffrplus.sh +# gated on the existence of $FINALIZED/.overlay_consistent and also the +# existence and mtime of $BASEDIR/.overlay_init. +# +# Other than build byproducts, BASEDIR should not be modified while this +# service is running. Developers modifying code directly in BASEDIR should +# disable this service. + +import os +import datetime +import subprocess +import psutil +import shutil +import signal +import fcntl +import time +import threading +from pathlib import Path +from typing import List, Tuple, Optional + +from common.basedir import BASEDIR +from common.markdown import parse_markdown +from common.params import Params +from selfdrive.hardware import EON, TICI, HARDWARE +from selfdrive.swaglog import cloudlog +from selfdrive.controls.lib.alertmanager import set_offroad_alert +from selfdrive.version import is_tested_branch + +LOCK_FILE = os.getenv("UPDATER_LOCK_FILE", "/tmp/safe_staging_overlay.lock") +STAGING_ROOT = os.getenv("UPDATER_STAGING_ROOT", "/data/safe_staging") + +NEOSUPDATE_DIR = os.getenv("UPDATER_NEOSUPDATE_DIR", "/data/neoupdate") + +OVERLAY_UPPER = os.path.join(STAGING_ROOT, "upper") +OVERLAY_METADATA = os.path.join(STAGING_ROOT, "metadata") +OVERLAY_MERGED = os.path.join(STAGING_ROOT, "merged") +FINALIZED = os.path.join(STAGING_ROOT, "finalized") + +DAYS_NO_CONNECTIVITY_MAX = 14 # do not allow to engage after this many days +DAYS_NO_CONNECTIVITY_PROMPT = 10 # send an offroad prompt after this many days + +class WaitTimeHelper: + def __init__(self, proc): + self.proc = proc + self.ready_event = threading.Event() + self.shutdown = False + signal.signal(signal.SIGTERM, self.graceful_shutdown) + signal.signal(signal.SIGINT, self.graceful_shutdown) + signal.signal(signal.SIGHUP, self.update_now) + + def graceful_shutdown(self, signum: int, frame) -> None: + # umount -f doesn't appear effective in avoiding "device busy" on NEOS, + # so don't actually die until the next convenient opportunity in main(). + cloudlog.info("caught SIGINT/SIGTERM, dismounting overlay at next opportunity") + + # forward the signal to all our child processes + child_procs = self.proc.children(recursive=True) + for p in child_procs: + p.send_signal(signum) + + self.shutdown = True + self.ready_event.set() + + def update_now(self, signum: int, frame) -> None: + cloudlog.info("caught SIGHUP, running update check immediately") + self.ready_event.set() + + def sleep(self, t: float) -> None: + self.ready_event.wait(timeout=t) + + +def run(cmd: List[str], cwd: Optional[str] = None, low_priority: bool = False): + if low_priority: + cmd = ["nice", "-n", "19"] + cmd + return subprocess.check_output(cmd, cwd=cwd, stderr=subprocess.STDOUT, encoding='utf8') + + +def set_consistent_flag(consistent: bool) -> None: + os.sync() + consistent_file = Path(os.path.join(FINALIZED, ".overlay_consistent")) + if consistent: + consistent_file.touch() + elif not consistent: + consistent_file.unlink(missing_ok=True) + os.sync() + + +def set_params(new_version: bool, failed_count: int, exception: Optional[str]) -> None: + params = Params() + + params.put("UpdateFailedCount", str(failed_count)) + + last_update = datetime.datetime.utcnow() + if failed_count == 0: + t = last_update.isoformat() + params.put("LastUpdateTime", t.encode('utf8')) + else: + try: + t = params.get("LastUpdateTime", encoding='utf8') + last_update = datetime.datetime.fromisoformat(t) + except (TypeError, ValueError): + pass + + if exception is None: + params.delete("LastUpdateException") + else: + params.put("LastUpdateException", exception) + + # Write out release notes for new versions + if new_version: + try: + with open(os.path.join(FINALIZED, "RELEASES.md"), "rb") as f: + r = f.read().split(b'\n\n', 1)[0] # Slice latest release notes + try: + params.put("ReleaseNotes", parse_markdown(r.decode("utf-8"))) + except Exception: + params.put("ReleaseNotes", r + b"\n") + except Exception: + params.put("ReleaseNotes", "") + params.put_bool("UpdateAvailable", True) + + # Handle user prompt + for alert in ("Offroad_UpdateFailed", "Offroad_ConnectivityNeeded", "Offroad_ConnectivityNeededPrompt"): + set_offroad_alert(alert, False) + + now = datetime.datetime.utcnow() + dt = now - last_update + if failed_count > 15 and exception is not None: + if is_tested_branch(): + extra_text = "Ensure the software is correctly installed" + else: + extra_text = exception + set_offroad_alert("Offroad_UpdateFailed", True, extra_text=extra_text) + elif dt.days > DAYS_NO_CONNECTIVITY_MAX and failed_count > 1: + set_offroad_alert("Offroad_ConnectivityNeeded", True) + elif dt.days > DAYS_NO_CONNECTIVITY_PROMPT: + remaining = max(DAYS_NO_CONNECTIVITY_MAX - dt.days, 1) + set_offroad_alert("Offroad_ConnectivityNeededPrompt", True, extra_text=f"{remaining} day{'' if remaining == 1 else 's'}.") + + +def setup_git_options(cwd: str) -> None: + # We sync FS object atimes (which NEOS doesn't use) and mtimes, but ctimes + # are outside user control. Make sure Git is set up to ignore system ctimes, + # because they change when we make hard links during finalize. Otherwise, + # there is a lot of unnecessary churn. This appears to be a common need on + # OSX as well: https://www.git-tower.com/blog/make-git-rebase-safe-on-osx/ + + # We are using copytree to copy the directory, which also changes + # inode numbers. Ignore those changes too. + git_cfg = [ + ("core.trustctime", "false"), + ("core.checkStat", "minimal"), + ] + for option, value in git_cfg: + run(["git", "config", option, value], cwd) + + +def dismount_overlay() -> None: + if os.path.ismount(OVERLAY_MERGED): + cloudlog.info("unmounting existing overlay") + args = ["umount", "-l", OVERLAY_MERGED] + if TICI: + args = ["sudo"] + args + run(args) + + +def init_overlay() -> None: + + overlay_init_file = Path(os.path.join(BASEDIR, ".overlay_init")) + + # Re-create the overlay if BASEDIR/.git has changed since we created the overlay + if overlay_init_file.is_file(): + git_dir_path = os.path.join(BASEDIR, ".git") + new_files = run(["find", git_dir_path, "-newer", str(overlay_init_file)]) + if not len(new_files.splitlines()): + # A valid overlay already exists + return + else: + cloudlog.info(".git directory changed, recreating overlay") + + cloudlog.info("preparing new safe staging area") + + params = Params() + params.put_bool("UpdateAvailable", False) + set_consistent_flag(False) + dismount_overlay() + if TICI: + run(["sudo", "rm", "-rf", STAGING_ROOT]) + if os.path.isdir(STAGING_ROOT): + shutil.rmtree(STAGING_ROOT) + + for dirname in [STAGING_ROOT, OVERLAY_UPPER, OVERLAY_METADATA, OVERLAY_MERGED]: + os.mkdir(dirname, 0o755) + + if os.lstat(BASEDIR).st_dev != os.lstat(OVERLAY_MERGED).st_dev: + raise RuntimeError("base and overlay merge directories are on different filesystems; not valid for overlay FS!") + + # Leave a timestamped canary in BASEDIR to check at startup. The device clock + # should be correct by the time we get here. If the init file disappears, or + # critical mtimes in BASEDIR are newer than .overlay_init, continue.sh can + # assume that BASEDIR has used for local development or otherwise modified, + # and skips the update activation attempt. + consistent_file = Path(os.path.join(BASEDIR, ".overlay_consistent")) + if consistent_file.is_file(): + consistent_file.unlink() + overlay_init_file.touch() + + os.sync() + overlay_opts = f"lowerdir={BASEDIR},upperdir={OVERLAY_UPPER},workdir={OVERLAY_METADATA}" + + mount_cmd = ["mount", "-t", "overlay", "-o", overlay_opts, "none", OVERLAY_MERGED] + if TICI: + run(["sudo"] + mount_cmd) + run(["sudo", "chmod", "755", os.path.join(OVERLAY_METADATA, "work")]) + else: + run(mount_cmd) + + git_diff = run(["git", "diff"], OVERLAY_MERGED, low_priority=True) + params.put("GitDiff", git_diff) + cloudlog.info(f"git diff output:\n{git_diff}") + + +def finalize_update() -> None: + """Take the current OverlayFS merged view and finalize a copy outside of + OverlayFS, ready to be swapped-in at BASEDIR. Copy using shutil.copytree""" + + # Remove the update ready flag and any old updates + cloudlog.info("creating finalized version of the overlay") + set_consistent_flag(False) + + # Copy the merged overlay view and set the update ready flag + if os.path.exists(FINALIZED): + shutil.rmtree(FINALIZED) + shutil.copytree(OVERLAY_MERGED, FINALIZED, symlinks=True) + + run(["git", "reset", "--hard"], FINALIZED) + run(["git", "submodule", "foreach", "--recursive", "git", "reset"], FINALIZED) + + set_consistent_flag(True) + cloudlog.info("done finalizing overlay") + + +def handle_agnos_update(wait_helper: WaitTimeHelper) -> None: + from selfdrive.hardware.tici.agnos import flash_agnos_update, get_target_slot_number + + cur_version = HARDWARE.get_os_version() + updated_version = run(["bash", "-c", r"unset AGNOS_VERSION && source launch_env.sh && \ + echo -n $AGNOS_VERSION"], OVERLAY_MERGED).strip() + + cloudlog.info(f"AGNOS version check: {cur_version} vs {updated_version}") + if cur_version == updated_version: + return + + # prevent an openpilot getting swapped in with a mismatched or partially downloaded agnos + set_consistent_flag(False) + + cloudlog.info(f"Beginning background installation for AGNOS {updated_version}") + set_offroad_alert("Offroad_NeosUpdate", True) + + manifest_path = os.path.join(OVERLAY_MERGED, "selfdrive/hardware/tici/agnos.json") + target_slot_number = get_target_slot_number() + flash_agnos_update(manifest_path, target_slot_number, cloudlog) + set_offroad_alert("Offroad_NeosUpdate", False) + + +def handle_neos_update(wait_helper: WaitTimeHelper) -> None: + from selfdrive.hardware.eon.neos import download_neos_update + + cur_neos = HARDWARE.get_os_version() + updated_neos = run(["bash", "-c", r"unset REQUIRED_NEOS_VERSION && source launch_env.sh && \ + echo -n $REQUIRED_NEOS_VERSION"], OVERLAY_MERGED).strip() + + cloudlog.info(f"NEOS version check: {cur_neos} vs {updated_neos}") + if cur_neos == updated_neos: + return + + cloudlog.info(f"Beginning background download for NEOS {updated_neos}") + set_offroad_alert("Offroad_NeosUpdate", True) + + update_manifest = os.path.join(OVERLAY_MERGED, "selfdrive/hardware/eon/neos.json") + + neos_downloaded = False + start_time = time.monotonic() + # Try to download for one day + while not neos_downloaded and not wait_helper.shutdown and \ + (time.monotonic() - start_time < 60*60*24): + wait_helper.ready_event.clear() + try: + download_neos_update(update_manifest, cloudlog) + neos_downloaded = True + except Exception: + cloudlog.info("NEOS background download failed, retrying") + wait_helper.sleep(120) + + # If the download failed, we'll show the alert again when we retry + set_offroad_alert("Offroad_NeosUpdate", False) + if not neos_downloaded: + raise Exception("Failed to download NEOS update") + cloudlog.info(f"NEOS background download successful, took {time.monotonic() - start_time} seconds") + + +def check_git_fetch_result(fetch_txt: str) -> bool: + err_msg = "Failed to add the host to the list of known hosts (/data/data/com.termux/files/home/.ssh/known_hosts).\n" + return len(fetch_txt) > 0 and (fetch_txt != err_msg) + + +def check_for_update() -> Tuple[bool, bool]: + setup_git_options(OVERLAY_MERGED) + fetch_output = None + try: + fetch_output = run(["git", "fetch", "--dry-run"], OVERLAY_MERGED, low_priority=True) + return True, check_git_fetch_result(fetch_output) + except subprocess.CalledProcessError: + # check for internet + if fetch_output is not None and fetch_output.startswith("fatal: unable to access") and \ + "Could not resolve host:" in str(fetch_output): + return False, False + + raise + +def fetch_update(wait_helper: WaitTimeHelper) -> bool: + cloudlog.info("attempting git fetch inside staging overlay") + + setup_git_options(OVERLAY_MERGED) + + git_fetch_output = run(["git", "fetch"], OVERLAY_MERGED, low_priority=True) + cloudlog.info("git fetch success: %s", git_fetch_output) + + cur_hash = run(["git", "rev-parse", "HEAD"], OVERLAY_MERGED).rstrip() + upstream_hash = run(["git", "rev-parse", "@{u}"], OVERLAY_MERGED).rstrip() + new_version = cur_hash != upstream_hash + git_fetch_result = check_git_fetch_result(git_fetch_output) + + cloudlog.info(f"comparing {cur_hash} to {upstream_hash}") + if new_version or git_fetch_result: + cloudlog.info("Running update") + + if new_version: + cloudlog.info("git reset in progress") + r = [ + run(["git", "reset", "--hard", "@{u}"], OVERLAY_MERGED, low_priority=True), + run(["git", "clean", "-xdf"], OVERLAY_MERGED, low_priority=True ), + run(["git", "submodule", "init"], OVERLAY_MERGED, low_priority=True), + run(["git", "submodule", "update"], OVERLAY_MERGED, low_priority=True), + ] + cloudlog.info("git reset success: %s", '\n'.join(r)) + + if EON: + handle_neos_update(wait_helper) + elif TICI: + handle_agnos_update(wait_helper) + + # Create the finalized, ready-to-swap update + finalize_update() + cloudlog.info("openpilot update successful!") + else: + cloudlog.info("nothing new from git at this time") + + return new_version + + +def main() -> None: + params = Params() + + if params.get_bool("DisableUpdates"): + cloudlog.warning("updates are disabled by the DisableUpdates param") + exit(0) + + ov_lock_fd = open(LOCK_FILE, 'w') + try: + fcntl.flock(ov_lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB) + except OSError as e: + raise RuntimeError("couldn't get overlay lock; is another instance running?") from e + + # Set low io priority + proc = psutil.Process() + if psutil.LINUX: + proc.ionice(psutil.IOPRIO_CLASS_BE, value=7) + + # Check if we just performed an update + if Path(os.path.join(STAGING_ROOT, "old_openpilot")).is_dir(): + cloudlog.event("update installed") + + if not params.get("InstallDate"): + t = datetime.datetime.utcnow().isoformat() + params.put("InstallDate", t.encode('utf8')) + + overlay_init = Path(os.path.join(BASEDIR, ".overlay_init")) + overlay_init.unlink(missing_ok=True) + + first_run = True + last_fetch_time = 0.0 + update_failed_count = 0 + + # Set initial params for offroad alerts + set_params(False, 0, None) + + # Wait for IsOffroad to be set before our first update attempt + wait_helper = WaitTimeHelper(proc) + wait_helper.sleep(30) + + # Run the update loop + # * every 1m, do a lightweight internet/update check + # * every 10m, do a full git fetch + while not wait_helper.shutdown: + update_now = wait_helper.ready_event.is_set() + wait_helper.ready_event.clear() + + # Don't run updater while onroad or if the time's wrong + time_wrong = datetime.datetime.utcnow().year < 2019 + is_onroad = not params.get_bool("IsOffroad") + if is_onroad or time_wrong: + wait_helper.sleep(30) + cloudlog.info("not running updater, not offroad") + continue + + # Attempt an update + exception = None + new_version = False + update_failed_count += 1 + try: + init_overlay() + + internet_ok, update_available = check_for_update() + if internet_ok and not update_available: + update_failed_count = 0 + + # Fetch updates at most every 10 minutes + if internet_ok and (update_now or time.monotonic() - last_fetch_time > 60*10): + new_version = fetch_update(wait_helper) + update_failed_count = 0 + last_fetch_time = time.monotonic() + + if first_run and not new_version and os.path.isdir(NEOSUPDATE_DIR): + shutil.rmtree(NEOSUPDATE_DIR) + first_run = False + except subprocess.CalledProcessError as e: + cloudlog.event( + "update process failed", + cmd=e.cmd, + output=e.output, + returncode=e.returncode + ) + exception = f"command failed: {e.cmd}\n{e.output}" + overlay_init.unlink(missing_ok=True) + except Exception as e: + cloudlog.exception("uncaught updated exception, shouldn't happen") + exception = str(e) + overlay_init.unlink(missing_ok=True) + + try: + set_params(new_version, update_failed_count, exception) + except Exception: + cloudlog.exception("uncaught updated exception while setting params, shouldn't happen") + + wait_helper.sleep(60) + + dismount_overlay() + + +if __name__ == "__main__": + main() diff --git a/selfdrive/version.py b/selfdrive/version.py new file mode 100644 index 000000000..f2570cd30 --- /dev/null +++ b/selfdrive/version.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python3 +import os +import subprocess +from typing import List, Optional +from functools import lru_cache + +from common.basedir import BASEDIR +from selfdrive.swaglog import cloudlog + +TESTED_BRANCHES = ['devel', 'release2-staging', 'release3-staging', 'dashcam-staging', 'release2', 'release3', 'dashcam'] + +training_version: bytes = b"0.2.0" +terms_version: bytes = b"2" + + +def cache(user_function, /): + return lru_cache(maxsize=None)(user_function) + + +def run_cmd(cmd: List[str]) -> str: + return subprocess.check_output(cmd, encoding='utf8').strip() + + +def run_cmd_default(cmd: List[str], default: Optional[str] = None) -> Optional[str]: + try: + return run_cmd(cmd) + except subprocess.CalledProcessError: + return default + + +@cache +def get_commit(branch: str = "HEAD", default: Optional[str] = None) -> Optional[str]: + return run_cmd_default(["git", "rev-parse", branch], default=default) + + +@cache +def get_short_branch(default: Optional[str] = None) -> Optional[str]: + return run_cmd_default(["git", "rev-parse", "--abbrev-ref", "HEAD"], default=default) + + +@cache +def get_branch(default: Optional[str] = None) -> Optional[str]: + return run_cmd_default(["git", "rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"], default=default) + + +@cache +def get_origin(default: Optional[str] = None) -> Optional[str]: + try: + local_branch = run_cmd(["git", "name-rev", "--name-only", "HEAD"]) + tracking_remote = run_cmd(["git", "config", "branch." + local_branch + ".remote"]) + return run_cmd(["git", "config", "remote." + tracking_remote + ".url"]) + except subprocess.CalledProcessError: # Not on a branch, fallback + return run_cmd_default(["git", "config", "--get", "remote.origin.url"], default=default) + + +@cache +def get_normalized_origin(default: Optional[str] = None) -> Optional[str]: + return get_origin()\ + .replace("git@", "", 1)\ + .replace(".git", "", 1)\ + .replace("https://", "", 1)\ + .replace(":", "/", 1) + + +@cache +def get_version() -> str: + with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "common", "version.h")) as _versionf: + version = _versionf.read().split('"')[1] + return version + +@cache +def get_short_version() -> str: + return get_version().split('-')[0] + +@cache +def is_prebuilt() -> bool: + return os.path.exists(os.path.join(BASEDIR, 'prebuilt')) + + +@cache +def is_comma_remote() -> bool: + # note to fork maintainers, this is used for release metrics. please do not + # touch this to get rid of the orange startup alert. there's better ways to do that + origin = get_origin() + if origin is None: + return False + + return origin.startswith('git@github.com:commaai') or origin.startswith('https://github.com/commaai') + + +@cache +def is_tested_branch() -> bool: + return get_short_branch() in TESTED_BRANCHES + + +@cache +def is_dirty() -> bool: + origin = get_origin() + branch = get_branch() + if (origin is None) or (branch is None): + return True + + dirty = False + try: + # Actually check dirty files + if not is_prebuilt(): + # This is needed otherwise touched files might show up as modified + try: + subprocess.check_call(["git", "update-index", "--refresh"]) + except subprocess.CalledProcessError: + pass + + dirty = (subprocess.call(["git", "diff-index", "--quiet", branch, "--"]) != 0) + except subprocess.CalledProcessError: + cloudlog.exception("git subprocess failed while checking dirty") + dirty = True + + return dirty + + +if __name__ == "__main__": + from common.params import Params + + params = Params() + params.put("TermsVersion", terms_version) + params.put("TrainingVersion", training_version) + + print(f"Dirty: {is_dirty()}") + print(f"Version: {get_version()}") + print(f"Short version: {get_short_version()}") + print(f"Origin: {get_origin()}") + print(f"Normalized origin: {get_normalized_origin()}") + print(f"Branch: {get_branch()}") + print(f"Short branch: {get_short_branch()}") + print(f"Prebuilt: {is_prebuilt()}") diff --git a/site_scons/site_tools/cython.py b/site_scons/site_tools/cython.py new file mode 100644 index 000000000..c29147553 --- /dev/null +++ b/site_scons/site_tools/cython.py @@ -0,0 +1,72 @@ +import re +import SCons +from SCons.Action import Action +from SCons.Scanner import Scanner + +pyx_from_import_re = re.compile(r'^from\s+(\S+)\s+cimport', re.M) +pyx_import_re = re.compile(r'^cimport\s+(\S+)', re.M) +cdef_import_re = re.compile(r'^cdef extern from\s+.(\S+).:', re.M) + + +def pyx_scan(node, env, path, arg=None): + contents = node.get_text_contents() + + # from cimport ... + matches = pyx_from_import_re.findall(contents) + # cimport + matches += pyx_import_re.findall(contents) + + # Modules can be either .pxd or .pyx files + files = [m.replace('.', '/') + '.pxd' for m in matches] + files += [m.replace('.', '/') + '.pyx' for m in matches] + + # cdef extern from + files += cdef_import_re.findall(contents) + + # Handle relative imports + cur_dir = str(node.get_dir()) + files = [cur_dir + f if f.startswith('/') else f for f in files] + + # Filter out non-existing files (probably system imports) + files = [f for f in files if env.File(f).exists()] + return env.File(files) + + +pyxscanner = Scanner(function=pyx_scan, skeys=['.pyx', '.pxd'], recursive=True) +cythonAction = Action("$CYTHONCOM") + + +def create_builder(env): + try: + cython = env['BUILDERS']['Cython'] + except KeyError: + cython = SCons.Builder.Builder( + action=cythonAction, + emitter={}, + suffix=cython_suffix_emitter, + single_source=1 + ) + env.Append(SCANNERS=pyxscanner) + env['BUILDERS']['Cython'] = cython + return cython + +def cython_suffix_emitter(env, source): + return "$CYTHONCFILESUFFIX" + +def generate(env): + env["CYTHON"] = "cythonize" + env["CYTHONCOM"] = "$CYTHON $CYTHONFLAGS $SOURCE" + env["CYTHONCFILESUFFIX"] = ".cpp" + + c_file, _ = SCons.Tool.createCFileBuilders(env) + + c_file.suffix['.pyx'] = cython_suffix_emitter + c_file.add_action('.pyx', cythonAction) + + c_file.suffix['.py'] = cython_suffix_emitter + c_file.add_action('.py', cythonAction) + + create_builder(env) + +def exists(env): + return True diff --git a/third_party/SConscript b/third_party/SConscript new file mode 100644 index 000000000..5a7a62ae5 --- /dev/null +++ b/third_party/SConscript @@ -0,0 +1,6 @@ +Import('env') + +env.Library('json11', ['json11/json11.cpp']) +env.Append(CPPPATH=[Dir('json11')]) + +env.Library('kaitai', ['kaitai/kaitaistream.cpp'], CPPDEFINES=['KS_STR_ENCODING_NONE']) diff --git a/third_party/acados/aarch64/lib/libacados.so b/third_party/acados/aarch64/lib/libacados.so new file mode 100755 index 000000000..fe961d8c5 Binary files /dev/null and b/third_party/acados/aarch64/lib/libacados.so differ diff --git a/third_party/acados/aarch64/lib/libblasfeo.so b/third_party/acados/aarch64/lib/libblasfeo.so new file mode 100755 index 000000000..a59f3f79f Binary files /dev/null and b/third_party/acados/aarch64/lib/libblasfeo.so differ diff --git a/third_party/acados/aarch64/lib/libhpipm.so b/third_party/acados/aarch64/lib/libhpipm.so new file mode 100755 index 000000000..6916c9c71 Binary files /dev/null and b/third_party/acados/aarch64/lib/libhpipm.so differ diff --git a/third_party/acados/aarch64/lib/libqpOASES_e.so b/third_party/acados/aarch64/lib/libqpOASES_e.so new file mode 120000 index 000000000..14048625a --- /dev/null +++ b/third_party/acados/aarch64/lib/libqpOASES_e.so @@ -0,0 +1 @@ +libqpOASES_e.so.3.1 \ No newline at end of file diff --git a/third_party/acados/aarch64/lib/libqpOASES_e.so.3.1 b/third_party/acados/aarch64/lib/libqpOASES_e.so.3.1 new file mode 100755 index 000000000..98d8dbfcd Binary files /dev/null and b/third_party/acados/aarch64/lib/libqpOASES_e.so.3.1 differ diff --git a/third_party/acados/aarch64/t_renderer b/third_party/acados/aarch64/t_renderer new file mode 100755 index 000000000..dc3cdf554 Binary files /dev/null and b/third_party/acados/aarch64/t_renderer differ diff --git a/third_party/acados/include/acados/dense_qp/dense_qp_common.h b/third_party/acados/include/acados/dense_qp/dense_qp_common.h new file mode 100644 index 000000000..f3809c429 --- /dev/null +++ b/third_party/acados/include/acados/dense_qp/dense_qp_common.h @@ -0,0 +1,150 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_DENSE_QP_DENSE_QP_COMMON_H_ +#define ACADOS_DENSE_QP_DENSE_QP_COMMON_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// hpipm +#include "hpipm/include/hpipm_d_dense_qp.h" +#include "hpipm/include/hpipm_d_dense_qp_res.h" +#include "hpipm/include/hpipm_d_dense_qp_sol.h" +// acados +#include "acados/utils/types.h" + +typedef struct d_dense_qp_dim dense_qp_dims; +typedef struct d_dense_qp dense_qp_in; +typedef struct d_dense_qp_sol dense_qp_out; +typedef struct d_dense_qp_res dense_qp_res; +typedef struct d_dense_qp_res_ws dense_qp_res_ws; + + + +#ifndef QP_SOLVER_CONFIG_ +#define QP_SOLVER_CONFIG_ +typedef struct +{ + void (*dims_set)(void *config_, void *dims_, const char *field, const int* value); + acados_size_t (*opts_calculate_size)(void *config, void *dims); + void *(*opts_assign)(void *config, void *dims, void *raw_memory); + void (*opts_initialize_default)(void *config, void *dims, void *args); + void (*opts_update)(void *config, void *dims, void *args); + void (*opts_set)(void *config_, void *opts_, const char *field, void* value); + acados_size_t (*memory_calculate_size)(void *config, void *dims, void *args); + void *(*memory_assign)(void *config, void *dims, void *args, void *raw_memory); + void (*memory_get)(void *config_, void *mem_, const char *field, void* value); + acados_size_t (*workspace_calculate_size)(void *config, void *dims, void *args); + int (*evaluate)(void *config, void *qp_in, void *qp_out, void *args, void *mem, void *work); + void (*eval_sens)(void *config, void *qp_in, void *qp_out, void *opts, void *mem, void *work); +} qp_solver_config; +#endif + + + +#ifndef QP_INFO_ +#define QP_INFO_ +typedef struct +{ + double solve_QP_time; + double condensing_time; + double interface_time; + double total_time; + int num_iter; + int t_computed; +} qp_info; +#endif + + + +/* config */ +// +acados_size_t dense_qp_solver_config_calculate_size(); +// +qp_solver_config *dense_qp_solver_config_assign(void *raw_memory); + +/* dims */ +// +acados_size_t dense_qp_dims_calculate_size(); +// +dense_qp_dims *dense_qp_dims_assign(void *raw_memory); +// +void dense_qp_dims_set(void *config_, void *dims_, const char *field, const int* value); +// + +/* in */ +// +acados_size_t dense_qp_in_calculate_size(dense_qp_dims *dims); +// +dense_qp_in *dense_qp_in_assign(dense_qp_dims *dims, void *raw_memory); + +/* out */ +// +acados_size_t dense_qp_out_calculate_size(dense_qp_dims *dims); +// +dense_qp_out *dense_qp_out_assign(dense_qp_dims *dims, void *raw_memory); +// +void dense_qp_out_get(dense_qp_out *out, const char *field, void *value); + +/* res */ +// +acados_size_t dense_qp_res_calculate_size(dense_qp_dims *dims); +// +dense_qp_res *dense_qp_res_assign(dense_qp_dims *dims, void *raw_memory); +// +acados_size_t dense_qp_res_workspace_calculate_size(dense_qp_dims *dims); +// +dense_qp_res_ws *dense_qp_res_workspace_assign(dense_qp_dims *dims, void *raw_memory); +// +void dense_qp_compute_t(dense_qp_in *qp_in, dense_qp_out *qp_out); +// +void dense_qp_res_compute(dense_qp_in *qp_in, dense_qp_out *qp_out, dense_qp_res *qp_res, dense_qp_res_ws *res_ws); +// +void dense_qp_res_compute_nrm_inf(dense_qp_res *qp_res, double res[4]); + +/* misc */ +// +void dense_qp_stack_slacks_dims(dense_qp_dims *in, dense_qp_dims *out); +// +void dense_qp_stack_slacks(dense_qp_in *in, dense_qp_in *out); +// +void dense_qp_unstack_slacks(dense_qp_out *in, dense_qp_in *qp_out, dense_qp_out *out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_DENSE_QP_DENSE_QP_COMMON_H_ diff --git a/third_party/acados/include/acados/dense_qp/dense_qp_hpipm.h b/third_party/acados/include/acados/dense_qp/dense_qp_hpipm.h new file mode 100644 index 000000000..20eedc26a --- /dev/null +++ b/third_party/acados/include/acados/dense_qp/dense_qp_hpipm.h @@ -0,0 +1,94 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_DENSE_QP_DENSE_QP_HPIPM_H_ +#define ACADOS_DENSE_QP_DENSE_QP_HPIPM_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// hpipm +#include "hpipm/include/hpipm_d_dense_qp.h" +#include "hpipm/include/hpipm_d_dense_qp_ipm.h" +#include "hpipm/include/hpipm_d_dense_qp_sol.h" +// acados +#include "acados/dense_qp/dense_qp_common.h" +#include "acados/utils/types.h" + + + +typedef struct dense_qp_hpipm_opts_ +{ + struct d_dense_qp_ipm_arg *hpipm_opts; +} dense_qp_hpipm_opts; + + + +typedef struct dense_qp_hpipm_memory_ +{ + struct d_dense_qp_ipm_ws *hpipm_workspace; + double time_qp_solver_call; + int iter; + +} dense_qp_hpipm_memory; + + + +// +acados_size_t dense_qp_hpipm_opts_calculate_size(void *config, void *dims); +// +void *dense_qp_hpipm_opts_assign(void *config, void *dims, void *raw_memory); +// +void dense_qp_hpipm_opts_initialize_default(void *config, void *dims, void *opts_); +// +void dense_qp_hpipm_opts_update(void *config, void *dims, void *opts_); +// +acados_size_t dense_qp_hpipm_calculate_memory_size(void *dims, void *opts_); +// +void *dense_qp_hpipm_assign_memory(void *dims, void *opts_, void *raw_memory); +// +acados_size_t dense_qp_hpipm_calculate_workspace_size(void *dims, void *opts_); +// +int dense_qp_hpipm(void *config, void *qp_in, void *qp_out, void *opts_, void *mem_, void *work_); +// +void dense_qp_hpipm_eval_sens(void *config_, void *qp_in, void *qp_out, void *opts_, void *mem_, void *work_); +// +void dense_qp_hpipm_config_initialize_default(void *config_); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_DENSE_QP_DENSE_QP_HPIPM_H_ diff --git a/third_party/acados/include/acados/dense_qp/dense_qp_ooqp.h b/third_party/acados/include/acados/dense_qp/dense_qp_ooqp.h new file mode 100644 index 000000000..646f11f06 --- /dev/null +++ b/third_party/acados/include/acados/dense_qp/dense_qp_ooqp.h @@ -0,0 +1,128 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_DENSE_QP_DENSE_QP_OOQP_H_ +#define ACADOS_DENSE_QP_DENSE_QP_OOQP_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/dense_qp/dense_qp_common.h" +#include "acados/utils/types.h" + +enum dense_qp_ooqp_termination_code +{ + DENSE_SUCCESSFUL_TERMINATION = 0, + DENSE_NOT_FINISHED, + DENSE_MAX_ITS_EXCEEDED, + DENSE_INFEASIBLE, + DENSE_UNKNOWN +}; + +typedef struct dense_qp_ooqp_opts_ +{ + int printLevel; + int useDiagonalWeights; // TODO(dimitris): implement option + int fixHessian; + int fixDynamics; + int fixInequalities; +} dense_qp_ooqp_opts; + +typedef struct dense_qp_ooqp_workspace_ +{ + double *x; + double *gamma; + double *phi; + double *y; + double *z; + double *lambda; + double *pi; + double objectiveValue; +} dense_qp_ooqp_workspace; + +typedef struct dense_qp_ooqp_memory_ +{ + int firstRun; + int nx; + int my; + int mz; + double *c; + double *dQ; + double *xlow; + char *ixlow; + double *xupp; + char *ixupp; + double *dA; + double *bA; + double *dC; + double *clow; + char *iclow; + double *cupp; + char *icupp; + double time_qp_solver_call; + int iter; + +} dense_qp_ooqp_memory; + +// +acados_size_t dense_qp_ooqp_opts_calculate_size(void *config_, dense_qp_dims *dims); +// +void *dense_qp_ooqp_opts_assign(void *config_, dense_qp_dims *dims, void *raw_memory); +// +void dense_qp_ooqp_opts_initialize_default(void *config_, dense_qp_dims *dims, void *opts_); +// +void dense_qp_ooqp_opts_update(void *config_, dense_qp_dims *dims, void *opts_); +// +acados_size_t dense_qp_ooqp_memory_calculate_size(void *config_, dense_qp_dims *dims, void *opts_); +// +void *dense_qp_ooqp_memory_assign(void *config_, dense_qp_dims *dims, void *opts_, + void *raw_memory); +// +acados_size_t dense_qp_ooqp_workspace_calculate_size(void *config_, dense_qp_dims *dims, void *opts_); +// +int dense_qp_ooqp(void *config_, dense_qp_in *qp_in, dense_qp_out *qp_out, void *opts_, + void *memory_, void *work_); +// +void dense_qp_ooqp_destroy(void *mem_, void *work); +// +void dense_qp_ooqp_eval_sens(void *config_, void *qp_in, void *qp_out, void *opts_, void *mem_, void *work_); +// +void dense_qp_ooqp_config_initialize_default(void *config_); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_DENSE_QP_DENSE_QP_OOQP_H_ diff --git a/third_party/acados/include/acados/dense_qp/dense_qp_qore.h b/third_party/acados/include/acados/dense_qp/dense_qp_qore.h new file mode 100644 index 000000000..52606fac5 --- /dev/null +++ b/third_party/acados/include/acados/dense_qp/dense_qp_qore.h @@ -0,0 +1,127 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_DENSE_QP_DENSE_QP_QORE_H_ +#define ACADOS_DENSE_QP_DENSE_QP_QORE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// qore +#include "qore/QPSOLVER_DENSE/include/qpsolver_dense.h" +// acados +#include "acados/dense_qp/dense_qp_common.h" +#include "acados/utils/types.h" + +typedef struct dense_qp_qore_opts_ +{ + int nsmax; // maximum size of Schur complement + int print_freq; // print frequency, + // prtfreq < 0: disable printing; + // prtfreq == 0: print on each call and include working set changes; + // prtfreq > 0: print on every prtfreq seconds, but do not include working set + // changes; + int warm_start; // warm start with updated matrices H and C + int warm_strategy; // 0: ramp-up from zero homotopy; 1: setup homotopy from the previous + // solution + int hot_start; // hot start with unchanged matrices H and C + int max_iter; // maximum number of iterations + int compute_t; // compute t in qp_out (to have correct residuals in NLP) +} dense_qp_qore_opts; + +typedef struct dense_qp_qore_memory_ +{ + double *H; + double *HH; + double *g; + double *gg; + double *Zl; + double *Zu; + double *zl; + double *zu; + double *A; + double *b; + double *C; + double *CC; + double *Ct; + double *CCt; + double *d_lb0; + double *d_ub0; + double *d_lb; + double *d_ub; + double *d_lg; + double *d_ug; + double *d_ls; + double *d_us; + double *lb; + double *ub; + int *idxb; + int *idxb_stacked; + int *idxs; + double *prim_sol; + double *dual_sol; + QoreProblemDense *QP; + int num_iter; + dense_qp_in *qp_stacked; + double time_qp_solver_call; + int iter; + +} dense_qp_qore_memory; + +acados_size_t dense_qp_qore_opts_calculate_size(void *config, dense_qp_dims *dims); +// +void *dense_qp_qore_opts_assign(void *config, dense_qp_dims *dims, void *raw_memory); +// +void dense_qp_qore_opts_initialize_default(void *config, dense_qp_dims *dims, void *opts_); +// +void dense_qp_qore_opts_update(void *config, dense_qp_dims *dims, void *opts_); +// +acados_size_t dense_qp_qore_memory_calculate_size(void *config, dense_qp_dims *dims, void *opts_); +// +void *dense_qp_qore_memory_assign(void *config, dense_qp_dims *dims, void *opts_, void *raw_memory); +// +acados_size_t dense_qp_qore_workspace_calculate_size(void *config, dense_qp_dims *dims, void *opts_); +// +int dense_qp_qore(void *config, dense_qp_in *qp_in, dense_qp_out *qp_out, void *opts_, void *memory_, void *work_); +// +void dense_qp_qore_eval_sens(void *config_, void *qp_in, void *qp_out, void *opts_, void *mem_, void *work_); +// +void dense_qp_qore_config_initialize_default(void *config); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_DENSE_QP_DENSE_QP_QORE_H_ diff --git a/third_party/acados/include/acados/dense_qp/dense_qp_qpoases.h b/third_party/acados/include/acados/dense_qp/dense_qp_qpoases.h new file mode 100644 index 000000000..8fca17dd1 --- /dev/null +++ b/third_party/acados/include/acados/dense_qp/dense_qp_qpoases.h @@ -0,0 +1,127 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_DENSE_QP_DENSE_QP_QPOASES_H_ +#define ACADOS_DENSE_QP_DENSE_QP_QPOASES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// blasfeo +#include "blasfeo/include/blasfeo_common.h" + +// acados +#include "acados/dense_qp/dense_qp_common.h" +#include "acados/utils/types.h" + +typedef struct dense_qp_qpoases_opts_ +{ + double max_cputime; // maximum cpu time in seconds + int max_nwsr; // maximum number of working set recalculations + int warm_start; // warm start with dual_sol in memory + int use_precomputed_cholesky; + int hotstart; // this option requires constant data matrices! (eg linear MPC, inexact schemes + // with frozen sensitivities) + int set_acado_opts; // use same options as in acado code generation + int compute_t; // compute t in qp_out (to have correct residuals in NLP) + double tolerance; // terminationTolerance +} dense_qp_qpoases_opts; + +typedef struct dense_qp_qpoases_memory_ +{ + double *H; + double *HH; + double *R; + double *g; + double *gg; + double *Zl; + double *Zu; + double *zl; + double *zu; + double *A; + double *b; + double *d_lb0; + double *d_ub0; + double *d_lb; + double *d_ub; + double *C; + double *CC; + double *d_lg0; + double *d_ug0; + double *d_lg; + double *d_ug; + double *d_ls; + double *d_us; + int *idxb; + int *idxb_stacked; + int *idxs; + double *prim_sol; + double *dual_sol; + void *QPB; // NOTE(giaf): cast to QProblemB to use + void *QP; // NOTE(giaf): cast to QProblem to use + double cputime; // cputime of qpoases + int nwsr; // performed number of working set recalculations + int first_it; // to be used with hotstart + dense_qp_in *qp_stacked; + double time_qp_solver_call; // equal to cputime + int iter; + +} dense_qp_qpoases_memory; + +acados_size_t dense_qp_qpoases_opts_calculate_size(void *config, dense_qp_dims *dims); +// +void *dense_qp_qpoases_opts_assign(void *config, dense_qp_dims *dims, void *raw_memory); +// +void dense_qp_qpoases_opts_initialize_default(void *config, dense_qp_dims *dims, void *opts_); +// +void dense_qp_qpoases_opts_update(void *config, dense_qp_dims *dims, void *opts_); +// +acados_size_t dense_qp_qpoases__memorycalculate_size(void *config, dense_qp_dims *dims, void *opts_); +// +void *dense_qp_qpoases_memory_assign(void *config, dense_qp_dims *dims, void *opts_, void *raw_memory); +// +acados_size_t dense_qp_qpoases_workspace_calculate_size(void *config, dense_qp_dims *dims, void *opts_); +// +int dense_qp_qpoases(void *config, dense_qp_in *qp_in, dense_qp_out *qp_out, void *opts_, void *memory_, void *work_); +// +void dense_qp_qpoases_eval_sens(void *config_, void *qp_in, void *qp_out, void *opts_, void *mem_, void *work_); +// +void dense_qp_qpoases_config_initialize_default(void *config_); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_DENSE_QP_DENSE_QP_QPOASES_H_ diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_common.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_common.h new file mode 100644 index 000000000..64939b9ed --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_common.h @@ -0,0 +1,434 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + + +/// \defgroup ocp_nlp ocp_nlp +/// @{ +/// @} + +/// \defgroup ocp_nlp_solver ocp_nlp_solver +/// @{ +/// @} + +/// \ingroup ocp_nlp +/// @{ + +/// \ingroup ocp_nlp_solver +/// @{ + +/// \defgroup ocp_nlp_common ocp_nlp_common +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_COMMON_H_ +#define ACADOS_OCP_NLP_OCP_NLP_COMMON_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/ocp_nlp/ocp_nlp_constraints_common.h" +#include "acados/ocp_nlp/ocp_nlp_cost_common.h" +#include "acados/ocp_nlp/ocp_nlp_dynamics_common.h" +#include "acados/ocp_nlp/ocp_nlp_reg_common.h" +#include "acados/ocp_qp/ocp_qp_common.h" +#include "acados/ocp_qp/ocp_qp_xcond_solver.h" +#include "acados/sim/sim_common.h" +#include "acados/utils/external_function_generic.h" +#include "acados/utils/types.h" + + + +/************************************************ + * config + ************************************************/ + +typedef struct ocp_nlp_config +{ + int N; // number of stages + + // solver-specific implementations of memory management functions + acados_size_t (*opts_calculate_size)(void *config, void *dims); + void *(*opts_assign)(void *config, void *dims, void *raw_memory); + void (*opts_initialize_default)(void *config, void *dims, void *opts_); + void (*opts_update)(void *config, void *dims, void *opts_); + acados_size_t (*memory_calculate_size)(void *config, void *dims, void *opts_); + void *(*memory_assign)(void *config, void *dims, void *opts_, void *raw_memory); + acados_size_t (*workspace_calculate_size)(void *config, void *dims, void *opts_); + void (*opts_set)(void *config_, void *opts_, const char *field, void* value); + void (*opts_set_at_stage)(void *config_, void *opts_, size_t stage, const char *field, void* value); + // evaluate solver // TODO rename into solve + int (*evaluate)(void *config, void *dims, void *nlp_in, void *nlp_out, void *opts_, void *mem, void *work); + void (*eval_param_sens)(void *config, void *dims, void *opts_, void *mem, void *work, + char *field, int stage, int index, void *sens_nlp_out); + // prepare memory + int (*precompute)(void *config, void *dims, void *nlp_in, void *nlp_out, void *opts_, void *mem, void *work); + // initalize this struct with default values + void (*config_initialize_default)(void *config); + // general getter + void (*get)(void *config_, void *dims, void *mem_, const char *field, void *return_value_); + void (*opts_get)(void *config_, void *dims, void *opts_, const char *field, void *return_value_); + void (*work_get)(void *config_, void *dims, void *work_, const char *field, void *return_value_); + // config structs of submodules + ocp_qp_xcond_solver_config *qp_solver; // TODO rename xcond_solver + ocp_nlp_dynamics_config **dynamics; + ocp_nlp_cost_config **cost; + ocp_nlp_constraints_config **constraints; + ocp_nlp_reg_config *regularize; + +} ocp_nlp_config; + +// +acados_size_t ocp_nlp_config_calculate_size(int N); +// +ocp_nlp_config *ocp_nlp_config_assign(int N, void *raw_memory); + + + +/************************************************ + * dims + ************************************************/ + +/// Structure to store dimensions/number of variables. +typedef struct ocp_nlp_dims +{ + void **cost; + void **dynamics; + void **constraints; + ocp_qp_xcond_solver_dims *qp_solver; // xcond solver instead ?? + ocp_nlp_reg_dims *regularize; + + int *nv; // number of primal variables (states+controls+slacks) + int *nx; // number of differential states + int *nu; // number of inputs + int *ni; // number of two-sided inequality constraints: nb+ng+nh+ns + int *nz; // number of algebraic variables + int *ns; // number of slack variables + int N; // number of shooting nodes + + void *raw_memory; // Pointer to allocated memory, to be used for freeing +} ocp_nlp_dims; + +// +acados_size_t ocp_nlp_dims_calculate_size(void *config); +// +ocp_nlp_dims *ocp_nlp_dims_assign(void *config, void *raw_memory); + +/// Sets the dimension of optimization variables +/// (states, constrols, algebraic variables, slack variables). +/// +/// \param config_ The configuration struct. +/// \param dims_ The dimension struct. +/// \param field The type of optimization variables, either nx, nu, nz, or ns. +/// \param value_array Number of variables for each stage. +void ocp_nlp_dims_set_opt_vars(void *config_, void *dims_, + const char *field, const void* value_array); + +/// Sets the dimensions of constraints functions for a stage +/// (bounds on states, bounds on controls, equality constraints, +/// inequality constraints). +/// +/// \param config_ The configuration struct. +/// \param dims_ The dimension struct. +/// \param stage Stage number. +/// \param field The type of constraint/bound, either nbx, nbu, ng, or nh. +/// \param value_field Number of constraints/bounds for the given stage. +void ocp_nlp_dims_set_constraints(void *config_, void *dims_, int stage, + const char *field, const void* value_field); + +/// Sets the dimensions of the cost terms for a stage. +/// +/// \param config_ The configuration struct. +/// \param dims_ The dimension struct. +/// \param stage Stage number. +/// \param field Type of cost term, can be eiter ny. +/// \param value_field Number of cost terms/residuals for the given stage. +void ocp_nlp_dims_set_cost(void *config_, void *dims_, int stage, const char *field, + const void* value_field); + +/// Sets the dimensions of the dynamics for a stage. +/// +/// \param config_ The configuration struct. +/// \param dims_ The dimension struct. +/// \param stage Stage number. +/// \param field TBD +/// \param value TBD +void ocp_nlp_dims_set_dynamics(void *config_, void *dims_, int stage, const char *field, + const void* value); + +/************************************************ + * Inputs + ************************************************/ + +/// Struct for storing the inputs of an OCP NLP solver +typedef struct ocp_nlp_in +{ + /// Length of sampling intervals/timesteps. + double *Ts; + + /// Pointers to cost functions (TBC). + void **cost; + + /// Pointers to dynamics functions (TBC). + void **dynamics; + + /// Pointers to constraints functions (TBC). + void **constraints; + + /// Pointer to allocated memory, to be used for freeing. + void *raw_memory; + +} ocp_nlp_in; + +// +acados_size_t ocp_nlp_in_calculate_size_self(int N); +// +acados_size_t ocp_nlp_in_calculate_size(ocp_nlp_config *config, ocp_nlp_dims *dims); +// +ocp_nlp_in *ocp_nlp_in_assign_self(int N, void *raw_memory); +// +ocp_nlp_in *ocp_nlp_in_assign(ocp_nlp_config *config, ocp_nlp_dims *dims, void *raw_memory); + + +/************************************************ + * out + ************************************************/ + +typedef struct ocp_nlp_out +{ + struct blasfeo_dvec *ux; // NOTE: this contains [u; x; s_l; s_u]! - rename to uxs? + struct blasfeo_dvec *z; // algebraic vairables + struct blasfeo_dvec *pi; // multipliers for dynamics + struct blasfeo_dvec *lam; // inequality mulitpliers + struct blasfeo_dvec *t; // slack variables corresponding to evaluation of all inequalities (at the solution) + + // NOTE: the inequalities are internally organized in the following order: + // [ lbu lbx lg lh lphi ubu ubx ug uh uphi; lsbu lsbx lsg lsh lsphi usbu usbx usg ush usphi] + + int sqp_iter; + int qp_iter; + double inf_norm_res; + double total_time; + + void *raw_memory; // Pointer to allocated memory, to be used for freeing + +} ocp_nlp_out; + +// +acados_size_t ocp_nlp_out_calculate_size(ocp_nlp_config *config, ocp_nlp_dims *dims); +// +ocp_nlp_out *ocp_nlp_out_assign(ocp_nlp_config *config, ocp_nlp_dims *dims, + void *raw_memory); + + + +/************************************************ + * options + ************************************************/ + +/// Globalization types +typedef enum +{ + FIXED_STEP, + MERIT_BACKTRACKING, +} ocp_nlp_globalization_t; + +typedef struct ocp_nlp_opts +{ + ocp_qp_xcond_solver_opts *qp_solver_opts; // xcond solver opts instead ??? + void *regularize; + void **dynamics; // dynamics_opts + void **cost; // cost_opts + void **constraints; // constraints_opts + double step_length; // step length in case of FIXED_STEP + double levenberg_marquardt; // LM factor to be added to the hessian before regularization + int reuse_workspace; + int num_threads; + + // TODO: move to separate struct? + ocp_nlp_globalization_t globalization; + double alpha_min; + double alpha_reduction; +} ocp_nlp_opts; + +// +acados_size_t ocp_nlp_opts_calculate_size(void *config, void *dims); +// +void *ocp_nlp_opts_assign(void *config, void *dims, void *raw_memory); +// +void ocp_nlp_opts_initialize_default(void *config, void *dims, void *opts); +// +void ocp_nlp_opts_update(void *config, void *dims, void *opts); +// +void ocp_nlp_opts_set(void *config_, void *opts_, const char *field, void* value); +// +void ocp_nlp_opts_set_at_stage(void *config, void *opts, int stage, const char *field, void *value); + + +/************************************************ + * residuals + ************************************************/ + +typedef struct ocp_nlp_res +{ + struct blasfeo_dvec *res_stat; // stationarity + struct blasfeo_dvec *res_eq; // dynamics + struct blasfeo_dvec *res_ineq; // inequality constraints + struct blasfeo_dvec *res_comp; // complementarity + double inf_norm_res_stat; + double inf_norm_res_eq; + double inf_norm_res_ineq; + double inf_norm_res_comp; + acados_size_t memsize; +} ocp_nlp_res; + +// +acados_size_t ocp_nlp_res_calculate_size(ocp_nlp_dims *dims); +// +ocp_nlp_res *ocp_nlp_res_assign(ocp_nlp_dims *dims, void *raw_memory); + +/************************************************ + * memory + ************************************************/ + +typedef struct ocp_nlp_memory +{ +// void *qp_solver_mem; // xcond solver mem instead ??? + ocp_qp_xcond_solver_memory *qp_solver_mem; // xcond solver mem instead ??? + void *regularize_mem; + void **dynamics; // dynamics memory + void **cost; // cost memory + void **constraints; // constraints memory + + // residuals + ocp_nlp_res *nlp_res; + + // qp in & out + ocp_qp_in *qp_in; + ocp_qp_out *qp_out; + // QP stuff not entering the qp_in struct + struct blasfeo_dmat *dzduxt; // dzdux transposed + struct blasfeo_dvec *z_alg; // z_alg, output algebraic variables + + struct blasfeo_dvec *cost_grad; + struct blasfeo_dvec *ineq_fun; + struct blasfeo_dvec *ineq_adj; + struct blasfeo_dvec *dyn_fun; + struct blasfeo_dvec *dyn_adj; + + double cost_value; + + bool *set_sim_guess; // indicate if there is new explicitly provided guess for integration variables + struct blasfeo_dvec *sim_guess; + + int *sqp_iter; // pointer to iteration number + +} ocp_nlp_memory; + +// +acados_size_t ocp_nlp_memory_calculate_size(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_opts *opts); +// +ocp_nlp_memory *ocp_nlp_memory_assign(ocp_nlp_config *config, ocp_nlp_dims *dims, + ocp_nlp_opts *opts, void *raw_memory); + + + +/************************************************ + * workspace + ************************************************/ + +typedef struct ocp_nlp_workspace +{ + + void *qp_work; + void **dynamics; // dynamics_workspace + void **cost; // cost_workspace + void **constraints; // constraints_workspace + + ocp_nlp_out *tmp_nlp_out; + ocp_nlp_out *weight_merit_fun; + +} ocp_nlp_workspace; + +// +acados_size_t ocp_nlp_workspace_calculate_size(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_opts *opts); +// +ocp_nlp_workspace *ocp_nlp_workspace_assign(ocp_nlp_config *config, ocp_nlp_dims *dims, + ocp_nlp_opts *opts, ocp_nlp_memory *mem, void *raw_memory); + + + +/************************************************ + * function + ************************************************/ + +// +void ocp_nlp_initialize_qp(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in, + ocp_nlp_out *out, ocp_nlp_opts *opts, ocp_nlp_memory *mem, ocp_nlp_workspace *work); +// +void ocp_nlp_approximate_qp_matrices(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in, + ocp_nlp_out *out, ocp_nlp_opts *opts, ocp_nlp_memory *mem, ocp_nlp_workspace *work); +// +void ocp_nlp_approximate_qp_vectors_sqp(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in, + ocp_nlp_out *out, ocp_nlp_opts *opts, ocp_nlp_memory *mem, ocp_nlp_workspace *work); +// +void ocp_nlp_embed_initial_value(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in, + ocp_nlp_out *out, ocp_nlp_opts *opts, ocp_nlp_memory *mem, ocp_nlp_workspace *work); +// +void ocp_nlp_update_variables_sqp(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in, + ocp_nlp_out *out, ocp_nlp_opts *opts, ocp_nlp_memory *mem, ocp_nlp_workspace *work, double alpha); +// +double ocp_nlp_line_search(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in, + ocp_nlp_out *out, ocp_nlp_opts *opts, ocp_nlp_memory *mem, ocp_nlp_workspace *work); +// +double ocp_nlp_evaluate_merit_fun(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in, + ocp_nlp_out *out, ocp_nlp_opts *opts, ocp_nlp_memory *mem, ocp_nlp_workspace *work); +// +void ocp_nlp_initialize_t_slacks(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in, + ocp_nlp_out *out, ocp_nlp_opts *opts, ocp_nlp_memory *mem, ocp_nlp_workspace *work); +// +void ocp_nlp_res_compute(ocp_nlp_dims *dims, ocp_nlp_in *in, ocp_nlp_out *out, + ocp_nlp_res *res, ocp_nlp_memory *mem); +// +void ocp_nlp_cost_compute(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in, + ocp_nlp_out *out, ocp_nlp_opts *opts, ocp_nlp_memory *mem, ocp_nlp_workspace *work); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_COMMON_H_ +/// @} +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_constraints_bgh.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_constraints_bgh.h new file mode 100644 index 000000000..7f7a30faf --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_constraints_bgh.h @@ -0,0 +1,241 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \addtogroup ocp_nlp +/// @{ +/// \addtogroup ocp_nlp_constraints +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_CONSTRAINTS_BGH_H_ +#define ACADOS_OCP_NLP_OCP_NLP_CONSTRAINTS_BGH_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// acados +#include "acados/ocp_qp/ocp_qp_common.h" +#include "acados/ocp_nlp/ocp_nlp_constraints_common.h" +#include "acados/utils/external_function_generic.h" +#include "acados/utils/types.h" + + + +/************************************************ + * dims + ************************************************/ + +typedef struct +{ + int nx; + int nu; + int nz; + int nb; // nbx + nbu + int nbu; // number of input box constraints + int nbx; // number of state box constraints + int ng; // number of general linear constraints + int nh; // number of nonlinear path constraints + int ns; // nsbu + nsbx + nsg + nsh + int nsbu; // number of softened input bounds + int nsbx; // number of softened state bounds + int nsg; // number of softened general linear constraints + int nsh; // number of softened nonlinear constraints + int nbue; // number of input box constraints which are equality + int nbxe; // number of state box constraints which are equality + int nge; // number of general linear constraints which are equality + int nhe; // number of nonlinear path constraints which are equality +} ocp_nlp_constraints_bgh_dims; + +// +acados_size_t ocp_nlp_constraints_bgh_dims_calculate_size(void *config); +// +void *ocp_nlp_constraints_bgh_dims_assign(void *config, void *raw_memory); +// +void ocp_nlp_constraints_bgh_dims_initialize(void *config, void *dims, int nx, int nu, int nz, int nbx, + int nbu, int ng, int nh, int dummy0, int ns); +// +void ocp_nlp_constraints_bgh_dims_get(void *config_, void *dims_, const char *field, int* value); +// +void ocp_nlp_constraints_bgh_dims_set(void *config_, void *dims_, + const char *field, const int* value); + + +/************************************************ + * model + ************************************************/ + +typedef struct +{ + int *idxb; + int *idxs; + int *idxe; + struct blasfeo_dvec d; // gathers bounds + struct blasfeo_dmat DCt; // general linear constraint matrix + // lg <= [D, C] * [u; x] <= ug + external_function_generic *nl_constr_h_fun; // nonlinear: lh <= h(x,u) <= uh + external_function_generic *nl_constr_h_fun_jac; // nonlinear: lh <= h(x,u) <= uh + external_function_generic *nl_constr_h_fun_jac_hess; // nonlinear: lh <= h(x,u) <= uh +} ocp_nlp_constraints_bgh_model; + +// +acados_size_t ocp_nlp_constraints_bgh_model_calculate_size(void *config, void *dims); +// +void *ocp_nlp_constraints_bgh_model_assign(void *config, void *dims, void *raw_memory); +// +int ocp_nlp_constraints_bgh_model_set(void *config_, void *dims_, + void *model_, const char *field, void *value); + + + +/************************************************ + * options + ************************************************/ + +typedef struct +{ + int compute_adj; + int compute_hess; +} ocp_nlp_constraints_bgh_opts; + +// +acados_size_t ocp_nlp_constraints_bgh_opts_calculate_size(void *config, void *dims); +// +void *ocp_nlp_constraints_bgh_opts_assign(void *config, void *dims, void *raw_memory); +// +void ocp_nlp_constraints_bgh_opts_initialize_default(void *config, void *dims, void *opts); +// +void ocp_nlp_constraints_bgh_opts_update(void *config, void *dims, void *opts); +// +void ocp_nlp_constraints_bgh_opts_set(void *config, void *opts, char *field, void *value); + + + +/************************************************ + * memory + ************************************************/ + +typedef struct +{ + struct blasfeo_dvec fun; + struct blasfeo_dvec adj; + struct blasfeo_dvec *ux; // pointer to ux in nlp_out + struct blasfeo_dvec *tmp_ux; // pointer to ux in tmp_nlp_out + struct blasfeo_dvec *lam; // pointer to lam in nlp_out + struct blasfeo_dvec *tmp_lam;// pointer to lam in tmp_nlp_out + struct blasfeo_dvec *z_alg; // pointer to z_alg in ocp_nlp memory + struct blasfeo_dmat *DCt; // pointer to DCt in qp_in + struct blasfeo_dmat *RSQrq; // pointer to RSQrq in qp_in + struct blasfeo_dmat *dzduxt; // pointer to dzduxt in ocp_nlp memory + int *idxb; // pointer to idxb[ii] in qp_in + int *idxs_rev; // pointer to idxs_rev[ii] in qp_in + int *idxe; // pointer to idxe[ii] in qp_in +} ocp_nlp_constraints_bgh_memory; + +// +acados_size_t ocp_nlp_constraints_bgh_memory_calculate_size(void *config, void *dims, void *opts); +// +void *ocp_nlp_constraints_bgh_memory_assign(void *config, void *dims, void *opts, void *raw_memory); +// +struct blasfeo_dvec *ocp_nlp_constraints_bgh_memory_get_fun_ptr(void *memory_); +// +struct blasfeo_dvec *ocp_nlp_constraints_bgh_memory_get_adj_ptr(void *memory_); +// +void ocp_nlp_constraints_bgh_memory_set_ux_ptr(struct blasfeo_dvec *ux, void *memory_); +// +void ocp_nlp_constraints_bgh_memory_set_tmp_ux_ptr(struct blasfeo_dvec *tmp_ux, void *memory_); +// +void ocp_nlp_constraints_bgh_memory_set_lam_ptr(struct blasfeo_dvec *lam, void *memory_); +// +void ocp_nlp_constraints_bgh_memory_set_tmp_lam_ptr(struct blasfeo_dvec *tmp_lam, void *memory_); +// +void ocp_nlp_constraints_bgh_memory_set_DCt_ptr(struct blasfeo_dmat *DCt, void *memory); +// +void ocp_nlp_constraints_bgh_memory_set_RSQrq_ptr(struct blasfeo_dmat *RSQrq, void *memory_); +// +void ocp_nlp_constraints_bgh_memory_set_z_alg_ptr(struct blasfeo_dvec *z_alg, void *memory_); +// +void ocp_nlp_constraints_bgh_memory_set_dzduxt_ptr(struct blasfeo_dmat *dzduxt, void *memory_); +// +void ocp_nlp_constraints_bgh_memory_set_idxb_ptr(int *idxb, void *memory_); +// +void ocp_nlp_constraints_bgh_memory_set_idxs_rev_ptr(int *idxs_rev, void *memory_); +// +void ocp_nlp_constraints_bgh_memory_set_idxe_ptr(int *idxe, void *memory_); + + + +/************************************************ + * workspace + ************************************************/ + +typedef struct +{ + struct blasfeo_dmat tmp_nv_nv; + struct blasfeo_dmat tmp_nz_nh; + struct blasfeo_dmat tmp_nv_nh; + struct blasfeo_dmat tmp_nz_nv; + struct blasfeo_dmat hess_z; + struct blasfeo_dvec tmp_ni; + struct blasfeo_dvec tmp_nh; +} ocp_nlp_constraints_bgh_workspace; + +// +acados_size_t ocp_nlp_constraints_bgh_workspace_calculate_size(void *config, void *dims, void *opts); + +/* functions */ + +// +void ocp_nlp_constraints_bgh_config_initialize_default(void *config); +// +void ocp_nlp_constraints_bgh_initialize(void *config, void *dims, void *model, void *opts, + void *mem, void *work); +// +void ocp_nlp_constraints_bgh_update_qp_matrices(void *config_, void *dims, void *model_, + void *opts_, void *memory_, void *work_); + +// +void ocp_nlp_constraints_bgh_compute_fun(void *config_, void *dims, void *model_, + void *opts_, void *memory_, void *work_); +// +void ocp_nlp_constraints_bgh_bounds_update(void *config_, void *dims, void *model_, + void *opts_, void *memory_, void *work_); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_CONSTRAINTS_BGH_H_ +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_constraints_bgp.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_constraints_bgp.h new file mode 100644 index 000000000..beeec7841 --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_constraints_bgp.h @@ -0,0 +1,221 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \addtogroup ocp_nlp +/// @{ +/// \addtogroup ocp_nlp_constraints +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_CONSTRAINTS_BGP_H_ +#define ACADOS_OCP_NLP_OCP_NLP_CONSTRAINTS_BGP_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// acados +#include "acados/ocp_qp/ocp_qp_common.h" +#include "acados/ocp_nlp/ocp_nlp_constraints_common.h" +#include "acados/utils/external_function_generic.h" +#include "acados/utils/types.h" + + + +/* dims */ + +typedef struct +{ + int nx; + int nu; + int nz; + int nb; // nbx + nbu + int nbu; + int nbx; + int ng; // number of general linear constraints + int nphi; // dimension of convex outer part + int ns; // nsbu + nsbx + nsg + nsphi + int nsbu; // number of softened input bounds + int nsbx; // number of softened state bounds + int nsg; // number of softened general linear constraints + int nsphi; // number of softened nonlinear constraints + int nr; // dimension of nonlinear function in convex_over_nonlinear constraint + int nbue; // number of input box constraints which are equality + int nbxe; // number of state box constraints which are equality + int nge; // number of general linear constraints which are equality + int nphie; // number of nonlinear path constraints which are equality +} ocp_nlp_constraints_bgp_dims; + +// +acados_size_t ocp_nlp_constraints_bgp_dims_calculate_size(void *config); +// +void *ocp_nlp_constraints_bgp_dims_assign(void *config, void *raw_memory); +// +void ocp_nlp_constraints_bgp_dims_initialize(void *config, void *dims, int nx, int nu, int nz, + int nbx, int nbu, int ng, int nphi, int nq, int ns); +// +void ocp_nlp_constraints_bgp_dims_get(void *config_, void *dims_, const char *field, int* value); + + +/* model */ + +typedef struct +{ + // ocp_nlp_constraints_bgp_dims *dims; + int *idxb; + int *idxs; + int *idxe; + struct blasfeo_dvec d; + struct blasfeo_dmat DCt; + external_function_generic *nl_constr_phi_o_r_fun_phi_jac_ux_z_phi_hess_r_jac_ux; + external_function_generic *nl_constr_phi_o_r_fun; + external_function_generic *nl_constr_r_fun_jac; +} ocp_nlp_constraints_bgp_model; + +// +acados_size_t ocp_nlp_constraints_bgp_calculate_size(void *config, void *dims); +// +void *ocp_nlp_constraints_bgp_assign(void *config, void *dims, void *raw_memory); +// +int ocp_nlp_constraints_bgp_model_set(void *config_, void *dims_, + void *model_, const char *field, void *value); + +/* options */ + +typedef struct +{ + int compute_adj; + int compute_hess; +} ocp_nlp_constraints_bgp_opts; + +// +acados_size_t ocp_nlp_constraints_bgp_opts_calculate_size(void *config, void *dims); +// +void *ocp_nlp_constraints_bgp_opts_assign(void *config, void *dims, void *raw_memory); +// +void ocp_nlp_constraints_bgp_opts_initialize_default(void *config, void *dims, void *opts); +// +void ocp_nlp_constraints_bgp_opts_update(void *config, void *dims, void *opts); +// +void ocp_nlp_constraints_bgp_opts_set(void *config, void *opts, char *field, void *value); + +/* memory */ + +typedef struct +{ + struct blasfeo_dvec fun; + struct blasfeo_dvec adj; + struct blasfeo_dvec *ux; // pointer to ux in nlp_out + struct blasfeo_dvec *tmp_ux; // pointer to ux in tmp_nlp_out + struct blasfeo_dvec *lam; // pointer to lam in nlp_out + struct blasfeo_dvec *tmp_lam;// pointer to lam in tmp_nlp_out + struct blasfeo_dvec *z_alg; // pointer to z_alg in ocp_nlp memory + struct blasfeo_dmat *DCt; // pointer to DCt in qp_in + struct blasfeo_dmat *RSQrq; // pointer to RSQrq in qp_in + struct blasfeo_dmat *dzduxt; // pointer to dzduxt in ocp_nlp memory + int *idxb; // pointer to idxb[ii] in qp_in + int *idxs_rev; // pointer to idxs_rev[ii] in qp_in + int *idxe; // pointer to idxe[ii] in qp_in +} ocp_nlp_constraints_bgp_memory; + +// +acados_size_t ocp_nlp_constraints_bgp_memory_calculate_size(void *config, void *dims, void *opts); +// +void *ocp_nlp_constraints_bgp_memory_assign(void *config, void *dims, void *opts, + void *raw_memory); +// +struct blasfeo_dvec *ocp_nlp_constraints_bgp_memory_get_fun_ptr(void *memory_); +// +struct blasfeo_dvec *ocp_nlp_constraints_bgp_memory_get_adj_ptr(void *memory_); +// +void ocp_nlp_constraints_bgp_memory_set_ux_ptr(struct blasfeo_dvec *ux, void *memory_); +// +void ocp_nlp_constraints_bgp_memory_set_tmp_ux_ptr(struct blasfeo_dvec *tmp_ux, void *memory_); +// +void ocp_nlp_constraints_bgp_memory_set_lam_ptr(struct blasfeo_dvec *lam, void *memory_); +// +void ocp_nlp_constraints_bgp_memory_set_tmp_lam_ptr(struct blasfeo_dvec *tmp_lam, void *memory_); +// +void ocp_nlp_constraints_bgp_memory_set_DCt_ptr(struct blasfeo_dmat *DCt, void *memory); +// +void ocp_nlp_constraints_bgp_memory_set_z_alg_ptr(struct blasfeo_dvec *z_alg, void *memory_); +// +void ocp_nlp_constraints_bgp_memory_set_dzduxt_ptr(struct blasfeo_dmat *dzduxt, void *memory_); +// +void ocp_nlp_constraints_bgp_memory_set_idxb_ptr(int *idxb, void *memory_); +// +void ocp_nlp_constraints_bgp_memory_set_idxs_rev_ptr(int *idxs_rev, void *memory_); +// +void ocp_nlp_constraints_bgh_memory_set_idxe_ptr(int *idxe, void *memory_); + +/* workspace */ + +typedef struct +{ + struct blasfeo_dvec tmp_ni; + struct blasfeo_dmat jac_r_ux_tran; + struct blasfeo_dmat tmp_nr_nphi_nr; + struct blasfeo_dmat tmp_nv_nr; + struct blasfeo_dmat tmp_nv_nphi; + struct blasfeo_dmat tmp_nz_nphi; +} ocp_nlp_constraints_bgp_workspace; + +// +acados_size_t ocp_nlp_constraints_bgp_workspace_calculate_size(void *config, void *dims, void *opts); + +/* functions */ + +// +void ocp_nlp_constraints_bgp_config_initialize_default(void *config); +// +void ocp_nlp_constraints_bgp_initialize(void *config, void *dims, void *model, + void *opts, void *mem, void *work); +// +void ocp_nlp_constraints_bgp_update_qp_matrices(void *config_, void *dims, + void *model_, void *opts_, void *memory_, void *work_); +// +void ocp_nlp_constraints_bgp_compute_fun(void *config_, void *dims, + void *model_, void *opts_, void *memory_, void *work_); +// +void ocp_nlp_constraints_bgp_bounds_update(void *config_, void *dims, void *model_, + void *opts_, void *memory_, void *work_); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_CONSTRAINTS_BGP_H_ +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_constraints_common.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_constraints_common.h new file mode 100644 index 000000000..7cadecab4 --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_constraints_common.h @@ -0,0 +1,112 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \ingroup ocp_nlp +/// @{ + +/// \defgroup ocp_nlp_constraints ocp_nlp_constraints +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_CONSTRAINTS_COMMON_H_ +#define ACADOS_OCP_NLP_OCP_NLP_CONSTRAINTS_COMMON_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// acados +#include "acados/ocp_qp/ocp_qp_common.h" +#include "acados/utils/external_function_generic.h" +#include "acados/utils/types.h" + + + +/************************************************ + * config + ************************************************/ + +typedef struct +{ + acados_size_t (*dims_calculate_size)(void *config); + void *(*dims_assign)(void *config, void *raw_memory); + void (*dims_initialize)(void *config, void *dims, int nx, int nu, int nz, int nbx, int nbu, int ng, + int nh, int nq, int ns); + acados_size_t (*model_calculate_size)(void *config, void *dims); + void *(*model_assign)(void *config, void *dims, void *raw_memory); + int (*model_set)(void *config_, void *dims_, void *model_, const char *field, void *value); + acados_size_t (*opts_calculate_size)(void *config, void *dims); + void *(*opts_assign)(void *config, void *dims, void *raw_memory); + void (*opts_initialize_default)(void *config, void *dims, void *opts); + void (*opts_update)(void *config, void *dims, void *opts); + void (*opts_set)(void *config, void *opts, char *field, void *value); + acados_size_t (*memory_calculate_size)(void *config, void *dims, void *opts); + struct blasfeo_dvec *(*memory_get_fun_ptr)(void *memory); + struct blasfeo_dvec *(*memory_get_adj_ptr)(void *memory); + void (*memory_set_ux_ptr)(struct blasfeo_dvec *ux, void *memory); + void (*memory_set_tmp_ux_ptr)(struct blasfeo_dvec *tmp_ux, void *memory); + void (*memory_set_lam_ptr)(struct blasfeo_dvec *lam, void *memory); + void (*memory_set_tmp_lam_ptr)(struct blasfeo_dvec *tmp_lam, void *memory); + void (*memory_set_DCt_ptr)(struct blasfeo_dmat *DCt, void *memory); + void (*memory_set_RSQrq_ptr)(struct blasfeo_dmat *RSQrq, void *memory); + void (*memory_set_z_alg_ptr)(struct blasfeo_dvec *z_alg, void *memory); + void (*memory_set_dzdux_tran_ptr)(struct blasfeo_dmat *dzduxt, void *memory); + void (*memory_set_idxb_ptr)(int *idxb, void *memory); + void (*memory_set_idxs_rev_ptr)(int *idxs_rev, void *memory); + void (*memory_set_idxe_ptr)(int *idxe, void *memory); + void *(*memory_assign)(void *config, void *dims, void *opts, void *raw_memory); + acados_size_t (*workspace_calculate_size)(void *config, void *dims, void *opts); + void (*initialize)(void *config, void *dims, void *model, void *opts, void *mem, void *work); + void (*update_qp_matrices)(void *config, void *dims, void *model, void *opts, void *mem, void *work); + void (*compute_fun)(void *config, void *dims, void *model, void *opts, void *mem, void *work); + void (*bounds_update)(void *config, void *dims, void *model, void *opts, void *mem, void *work); + void (*config_initialize_default)(void *config); + // dimension setters + void (*dims_set)(void *config_, void *dims_, const char *field, const int *value); + void (*dims_get)(void *config_, void *dims_, const char *field, int* value); +} ocp_nlp_constraints_config; + +// +acados_size_t ocp_nlp_constraints_config_calculate_size(); +// +ocp_nlp_constraints_config *ocp_nlp_constraints_config_assign(void *raw_memory); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_CONSTRAINTS_COMMON_H_ +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_cost_common.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_cost_common.h new file mode 100644 index 000000000..c9fbbfb40 --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_cost_common.h @@ -0,0 +1,109 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// +/// \defgroup ocp_nlp_cost ocp_nlp_cost +/// + +/// \addtogroup ocp_nlp_cost ocp_nlp_cost +/// @{ +/// \addtogroup ocp_nlp_cost_common ocp_nlp_cost_common +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_COST_COMMON_H_ +#define ACADOS_OCP_NLP_OCP_NLP_COST_COMMON_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// acados +#include "acados/utils/external_function_generic.h" +#include "acados/utils/types.h" + + + +/************************************************ + * config + ************************************************/ + +typedef struct +{ + acados_size_t (*dims_calculate_size)(void *config); + void *(*dims_assign)(void *config, void *raw_memory); + void (*dims_initialize)(void *config, void *dims, int nx, int nu, int ny, int ns, int nz); + void (*dims_set)(void *config_, void *dims_, const char *field, int *value); + void (*dims_get)(void *config_, void *dims_, const char *field, int *value); + acados_size_t (*model_calculate_size)(void *config, void *dims); + void *(*model_assign)(void *config, void *dims, void *raw_memory); + int (*model_set)(void *config_, void *dims_, void *model_, const char *field, void *value_); + acados_size_t (*opts_calculate_size)(void *config, void *dims); + void *(*opts_assign)(void *config, void *dims, void *raw_memory); + void (*opts_initialize_default)(void *config, void *dims, void *opts); + void (*opts_update)(void *config, void *dims, void *opts); + void (*opts_set)(void *config, void *opts, const char *field, void *value); + acados_size_t (*memory_calculate_size)(void *config, void *dims, void *opts); + double *(*memory_get_fun_ptr)(void *memory); + struct blasfeo_dvec *(*memory_get_grad_ptr)(void *memory); + void (*memory_set_ux_ptr)(struct blasfeo_dvec *ux, void *memory); + void (*memory_set_tmp_ux_ptr)(struct blasfeo_dvec *tmp_ux, void *memory); + void (*memory_set_z_alg_ptr)(struct blasfeo_dvec *z_alg, void *memory); + void (*memory_set_dzdux_tran_ptr)(struct blasfeo_dmat *dzdux, void *memory); + void (*memory_set_RSQrq_ptr)(struct blasfeo_dmat *RSQrq, void *memory); + void (*memory_set_Z_ptr)(struct blasfeo_dvec *Z, void *memory); + void *(*memory_assign)(void *config, void *dims, void *opts, void *raw_memory); + acados_size_t (*workspace_calculate_size)(void *config, void *dims, void *opts); + void (*initialize)(void *config_, void *dims, void *model_, void *opts_, void *mem_, void *work_); + + // computes the function value, gradient and hessian (approximation) of the cost function + void (*update_qp_matrices)(void *config_, void *dims, void *model_, void *opts_, void *mem_, void *work_); + // computes the cost function value (intended for globalization) + void (*compute_fun)(void *config_, void *dims, void *model_, void *opts_, void *mem_, void *work_); + void (*config_initialize_default)(void *config); +} ocp_nlp_cost_config; + +// +acados_size_t ocp_nlp_cost_config_calculate_size(); +// +ocp_nlp_cost_config *ocp_nlp_cost_config_assign(void *raw_memory); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_COST_COMMON_H_ +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_cost_external.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_cost_external.h new file mode 100644 index 000000000..f2196dbee --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_cost_external.h @@ -0,0 +1,187 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_OCP_NLP_OCP_NLP_COST_EXTERNAL_H_ +#define ACADOS_OCP_NLP_OCP_NLP_COST_EXTERNAL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// blasfeo +#include "blasfeo/include/blasfeo_common.h" + +// acados +#include "acados/ocp_nlp/ocp_nlp_cost_common.h" +#include "acados/utils/external_function_generic.h" +#include "acados/utils/types.h" + +/************************************************ + * dims + ************************************************/ + +typedef struct +{ + int nx; // number of states + int nu; // number of inputs + int ns; // number of slacks +} ocp_nlp_cost_external_dims; + +// +acados_size_t ocp_nlp_cost_external_dims_calculate_size(void *config); +// +void *ocp_nlp_cost_external_dims_assign(void *config, void *raw_memory); +// +void ocp_nlp_cost_external_dims_initialize(void *config, void *dims, int nx, + int nu, int ny, int ns, int nz); +// +void ocp_nlp_cost_external_dims_set(void *config_, void *dims_, const char *field, int* value); +// +void ocp_nlp_cost_external_dims_get(void *config_, void *dims_, const char *field, int* value); + +/************************************************ + * model + ************************************************/ + +typedef struct +{ + external_function_generic *ext_cost_fun; // function + external_function_generic *ext_cost_fun_jac_hess; // function, gradient and hessian + external_function_generic *ext_cost_fun_jac; // function, gradient + struct blasfeo_dvec Z; + struct blasfeo_dvec z; + struct blasfeo_dmat numerical_hessian; // custom hessian approximation + double scaling; +} ocp_nlp_cost_external_model; + +// +acados_size_t ocp_nlp_cost_external_model_calculate_size(void *config, void *dims); +// +void *ocp_nlp_cost_external_model_assign(void *config, void *dims, void *raw_memory); + + + +/************************************************ + * options + ************************************************/ + +typedef struct +{ + int use_numerical_hessian; // > 0 indicating custom hessian is used instead of CasADi evaluation +} ocp_nlp_cost_external_opts; + +// +acados_size_t ocp_nlp_cost_external_opts_calculate_size(void *config, void *dims); +// +void *ocp_nlp_cost_external_opts_assign(void *config, void *dims, void *raw_memory); +// +void ocp_nlp_cost_external_opts_initialize_default(void *config, void *dims, void *opts); +// +void ocp_nlp_cost_external_opts_update(void *config, void *dims, void *opts); +// +void ocp_nlp_cost_external_opts_set(void *config, void *opts, const char *field, void *value); + + + +/************************************************ + * memory + ************************************************/ + +typedef struct +{ + struct blasfeo_dvec grad; // gradient of cost function + struct blasfeo_dvec *ux; // pointer to ux in nlp_out + struct blasfeo_dvec *tmp_ux; // pointer to tmp_ux in nlp_out + struct blasfeo_dmat *RSQrq; // pointer to RSQrq in qp_in + struct blasfeo_dvec *Z; // pointer to Z in qp_in + struct blasfeo_dvec *z_alg; ///< pointer to z in sim_out + struct blasfeo_dmat *dzdux_tran; ///< pointer to sensitivity of a wrt ux in sim_out + double fun; ///< value of the cost function +} ocp_nlp_cost_external_memory; + +// +acados_size_t ocp_nlp_cost_external_memory_calculate_size(void *config, void *dims, void *opts); +// +void *ocp_nlp_cost_external_memory_assign(void *config, void *dims, void *opts, void *raw_memory); +// +double *ocp_nlp_cost_external_memory_get_fun_ptr(void *memory_); +// +struct blasfeo_dvec *ocp_nlp_cost_external_memory_get_grad_ptr(void *memory_); +// +void ocp_nlp_cost_external_memory_set_RSQrq_ptr(struct blasfeo_dmat *RSQrq, void *memory); +// +void ocp_nlp_cost_ls_memory_set_Z_ptr(struct blasfeo_dvec *Z, void *memory); +// +void ocp_nlp_cost_external_memory_set_ux_ptr(struct blasfeo_dvec *ux, void *memory_); +// +void ocp_nlp_cost_external_memory_set_tmp_ux_ptr(struct blasfeo_dvec *tmp_ux, void *memory_); +// +void ocp_nlp_cost_external_memory_set_z_alg_ptr(struct blasfeo_dvec *z_alg, void *memory_); +// +void ocp_nlp_cost_external_memory_set_dzdux_tran_ptr(struct blasfeo_dmat *dzdux_tran, void *memory_); + +/************************************************ + * workspace + ************************************************/ + +typedef struct +{ + struct blasfeo_dmat tmp_nv_nv; + struct blasfeo_dvec tmp_2ns; // temporary vector of dimension 2*ns +} ocp_nlp_cost_external_workspace; + +// +acados_size_t ocp_nlp_cost_external_workspace_calculate_size(void *config, void *dims, void *opts); + +/************************************************ + * functions + ************************************************/ + +// +void ocp_nlp_cost_external_config_initialize_default(void *config); +// +void ocp_nlp_cost_external_initialize(void *config_, void *dims, void *model_, + void *opts_, void *mem_, void *work_); +// +void ocp_nlp_cost_external_update_qp_matrices(void *config_, void *dims, void *model_, + void *opts_, void *memory_, void *work_); +// +void ocp_nlp_cost_external_compute_fun(void *config_, void *dims, void *model_, + void *opts_, void *memory_, void *work_); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_COST_EXTERNAL_H_ diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_cost_ls.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_cost_ls.h new file mode 100644 index 000000000..3cf759504 --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_cost_ls.h @@ -0,0 +1,259 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \addtogroup ocp_nlp +/// @{ +/// \addtogroup ocp_nlp_cost ocp_nlp_cost +/// @{ +/// \addtogroup ocp_nlp_cost_ls ocp_nlp_cost_ls +/// \brief This module implements linear-least squares costs of the form +/// \f$\min_{x,u,z} \| V_x x + V_u u + V_z z - y_{\text{ref}}\|_W^2\f$. +/// @{ + + + +#ifndef ACADOS_OCP_NLP_OCP_NLP_COST_LS_H_ +#define ACADOS_OCP_NLP_OCP_NLP_COST_LS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// blasfeo +#include "blasfeo/include/blasfeo_common.h" + +// acados +#include "acados/ocp_nlp/ocp_nlp_cost_common.h" +#include "acados/utils/external_function_generic.h" +#include "acados/utils/types.h" + + +//////////////////////////////////////////////////////////////////////////////// +// dims // +//////////////////////////////////////////////////////////////////////////////// + +typedef struct +{ + int nx; // number of states + int nz; // number of algebraic variables + int nu; // number of inputs + int ny; // number of outputs + int ns; // number of slacks +} ocp_nlp_cost_ls_dims; + + +/// Calculate the size of the ocp_nlp_cost_ls_dims struct +/// +/// \param[in] config_ structure containing configuration of ocp_nlp_cost +/// module +/// \param[out] [] +/// \return \c size of ocp_nlp_dims struct +acados_size_t ocp_nlp_cost_ls_dims_calculate_size(void *config); + + +/// Assign memory pointed to by raw_memory to ocp_nlp-cost_ls dims struct +/// +/// \param[in] config structure containing configuration of ocp_nlp_cost +/// module +/// \param[in] raw_memory pointer to memory location +/// \param[out] [] +/// \return dims +void *ocp_nlp_cost_ls_dims_assign(void *config, void *raw_memory); + + +/// Initialize the dimensions struct of the +/// ocp_nlp-cost_ls component +/// +/// \param[in] config structure containing configuration ocp_nlp-cost_ls component +/// \param[in] nx number of states +/// \param[in] nu number of inputs +/// \param[in] ny number of residuals +/// \param[in] ns number of slacks +/// \param[in] nz number of algebraic variables +/// \param[out] dims +/// \return size +void ocp_nlp_cost_ls_dims_initialize(void *config, void *dims, int nx, + int nu, int ny, int ns, int nz); + +// +void ocp_nlp_cost_ls_dims_set(void *config_, void *dims_, const char *field, int* value); +// +void ocp_nlp_cost_ls_dims_get(void *config_, void *dims_, const char *field, int* value); + + +//////////////////////////////////////////////////////////////////////////////// +// model // +//////////////////////////////////////////////////////////////////////////////// + + +/// structure containing the data describing the linear least-square cost +typedef struct +{ + // slack penalty has the form z^T * s + .5 * s^T * Z * s + struct blasfeo_dmat Cyt; ///< output matrix: Cy * [u,x] = y; in transposed form + struct blasfeo_dmat Vz; ///< Vz in ls cost Vx*x + Vu*u + Vz*z + struct blasfeo_dmat W; ///< ls norm corresponding to this matrix + struct blasfeo_dvec y_ref; ///< yref + struct blasfeo_dvec Z; ///< diagonal Hessian of slacks as vector (lower and upper) + struct blasfeo_dvec z; ///< gradient of slacks as vector (lower and upper) + double scaling; +} ocp_nlp_cost_ls_model; + +// +acados_size_t ocp_nlp_cost_ls_model_calculate_size(void *config, void *dims); +// +void *ocp_nlp_cost_ls_model_assign(void *config, void *dims, void *raw_memory); +// +int ocp_nlp_cost_ls_model_set(void *config_, void *dims_, void *model_, + const char *field, void *value_); + + + +//////////////////////////////////////////////////////////////////////////////// +// options // +//////////////////////////////////////////////////////////////////////////////// + + + +typedef struct +{ + int dummy; // struct can't be void +} ocp_nlp_cost_ls_opts; + +// +acados_size_t ocp_nlp_cost_ls_opts_calculate_size(void *config, void *dims); +// +void *ocp_nlp_cost_ls_opts_assign(void *config, void *dims, void *raw_memory); +// +void ocp_nlp_cost_ls_opts_initialize_default(void *config, void *dims, void *opts); +// +void ocp_nlp_cost_ls_opts_update(void *config, void *dims, void *opts); +// +void ocp_nlp_cost_ls_opts_set(void *config, void *opts, const char *field, void *value); + + + +//////////////////////////////////////////////////////////////////////////////// +// memory // +//////////////////////////////////////////////////////////////////////////////// + + + +/// structure containing the memory associated with cost_ls component +/// of the ocp_nlp module +typedef struct +{ + struct blasfeo_dmat hess; ///< hessian of cost function + struct blasfeo_dmat W_chol; ///< cholesky factor of weight matrix + struct blasfeo_dvec res; ///< ls residual r(x) + struct blasfeo_dvec grad; ///< gradient of cost function + struct blasfeo_dvec *ux; ///< pointer to ux in nlp_out + struct blasfeo_dvec *tmp_ux; ///< pointer to ux in tmp_nlp_out + struct blasfeo_dvec *z_alg; ///< pointer to z in sim_out + struct blasfeo_dmat *dzdux_tran; ///< pointer to sensitivity of a wrt ux in sim_out + struct blasfeo_dmat *RSQrq; ///< pointer to RSQrq in qp_in + struct blasfeo_dvec *Z; ///< pointer to Z in qp_in + double fun; ///< value of the cost function +} ocp_nlp_cost_ls_memory; + +// +acados_size_t ocp_nlp_cost_ls_memory_calculate_size(void *config, void *dims, void *opts); +// +void *ocp_nlp_cost_ls_memory_assign(void *config, void *dims, void *opts, void *raw_memory); +// +double *ocp_nlp_cost_ls_memory_get_fun_ptr(void *memory_); +// +struct blasfeo_dvec *ocp_nlp_cost_ls_memory_get_grad_ptr(void *memory_); +// +void ocp_nlp_cost_ls_memory_set_RSQrq_ptr(struct blasfeo_dmat *RSQrq, void *memory); +// +void ocp_nlp_cost_ls_memory_set_Z_ptr(struct blasfeo_dvec *Z, void *memory); +// +void ocp_nlp_cost_ls_memory_set_ux_ptr(struct blasfeo_dvec *ux, void *memory_); +// +void ocp_nlp_cost_ls_memory_set_tmp_ux_ptr(struct blasfeo_dvec *tmp_ux, void *memory_); +// +void ocp_nlp_cost_ls_memory_set_z_alg_ptr(struct blasfeo_dvec *z_alg, void *memory_); +// +void ocp_nlp_cost_ls_memory_set_dzdux_tran_ptr(struct blasfeo_dmat *dzdux_tran, void *memory_); + + + +//////////////////////////////////////////////////////////////////////////////// +// workspace // +//////////////////////////////////////////////////////////////////////////////// + + + +typedef struct +{ + struct blasfeo_dmat tmp_nv_ny; // temporary matrix of dimensions nv, ny + struct blasfeo_dmat Cyt_tilde; // updated Cyt (after z elimination) + struct blasfeo_dmat dzdux_tran; // derivatives of z wrt u and x (tran) + struct blasfeo_dvec tmp_ny; // temporary vector of dimension ny + struct blasfeo_dvec tmp_2ns; // temporary vector of dimension ny + struct blasfeo_dvec tmp_nz; // temporary vector of dimension nz + struct blasfeo_dvec y_ref_tilde; // updated y_ref (after z elimination) +} ocp_nlp_cost_ls_workspace; + +// +acados_size_t ocp_nlp_cost_ls_workspace_calculate_size(void *config, void *dims, void *opts); + + + +//////////////////////////////////////////////////////////////////////////////// +// functions // +//////////////////////////////////////////////////////////////////////////////// + + + +// +void ocp_nlp_cost_ls_config_initialize_default(void *config); +// +void ocp_nlp_cost_ls_initialize(void *config_, void *dims, void *model_, void *opts_, + void *mem_, void *work_); +// +void ocp_nlp_cost_ls_update_qp_matrices(void *config_, void *dims, void *model_, + void *opts_, void *memory_, void *work_); +// +void ocp_nlp_cost_ls_compute_fun(void *config_, void *dims, void *model_, void *opts_, void *memory_, void *work_); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_COST_LS_H_ +/// @} +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_cost_nls.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_cost_nls.h new file mode 100644 index 000000000..aafb6b354 --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_cost_nls.h @@ -0,0 +1,210 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \addtogroup ocp_nlp +/// @{ +/// \addtogroup ocp_nlp_cost ocp_nlp_cost +/// @{ +/// \addtogroup ocp_nlp_cost_nls ocp_nlp_cost_nls +/// \brief This module implements nonlinear-least squares costs of the form +/// \f$\min_{x,u} \| r(x,u) - y_{\text{ref}} \|_W^2\f$. +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_COST_NLS_H_ +#define ACADOS_OCP_NLP_OCP_NLP_COST_NLS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// blasfeo +#include "blasfeo/include/blasfeo_common.h" + +// acados +#include "acados/ocp_nlp/ocp_nlp_cost_common.h" +#include "acados/utils/external_function_generic.h" +#include "acados/utils/types.h" + + + +/************************************************ + * dims + ************************************************/ + +typedef struct +{ + int nx; // number of states + int nu; // number of inputs + int ny; // number of outputs + int ns; // number of slacks +} ocp_nlp_cost_nls_dims; + +// +acados_size_t ocp_nlp_cost_nls_dims_calculate_size(void *config); +// +void *ocp_nlp_cost_nls_dims_assign(void *config, void *raw_memory); +// +void ocp_nlp_cost_nls_dims_initialize(void *config, void *dims, int nx, int nu, int ny, int ns, int nz); +// +void ocp_nlp_cost_nls_dims_set(void *config_, void *dims_, const char *field, int* value); +// +void ocp_nlp_cost_nls_dims_get(void *config_, void *dims_, const char *field, int* value); + + + +/************************************************ + * model + ************************************************/ + +typedef struct +{ + // nonliner function nls_y(x,u) replaces Cy * [x,u] in ls_cost + // slack penalty has the form z^T * s + .5 * s^T * Z * s + external_function_generic *nls_y_fun; // evaluation of nls function + external_function_generic *nls_y_fun_jac; // evaluation nls function and jacobian + external_function_generic *nls_y_hess; // hessian*seeds of nls residuals + struct blasfeo_dmat W; // + struct blasfeo_dvec y_ref; + struct blasfeo_dvec Z; // diagonal Hessian of slacks as vector + struct blasfeo_dvec z; // gradient of slacks as vector + double scaling; +} ocp_nlp_cost_nls_model; + +// +acados_size_t ocp_nlp_cost_nls_model_calculate_size(void *config, void *dims); +// +void *ocp_nlp_cost_nls_model_assign(void *config, void *dims, void *raw_memory); +// +int ocp_nlp_cost_nls_model_set(void *config_, void *dims_, void *model_, const char *field, void *value_); + + + +/************************************************ + * options + ************************************************/ + +typedef struct +{ + bool gauss_newton_hess; // gauss-newton hessian approximation +} ocp_nlp_cost_nls_opts; + +// +acados_size_t ocp_nlp_cost_nls_opts_calculate_size(void *config, void *dims); +// +void *ocp_nlp_cost_nls_opts_assign(void *config, void *dims, void *raw_memory); +// +void ocp_nlp_cost_nls_opts_initialize_default(void *config, void *dims, void *opts); +// +void ocp_nlp_cost_nls_opts_update(void *config, void *dims, void *opts); +// +void ocp_nlp_cost_nls_opts_set(void *config, void *opts, const char *field, void *value); + + + +/************************************************ + * memory + ************************************************/ + +typedef struct +{ + struct blasfeo_dmat W_chol; // cholesky factor of weight matrix + struct blasfeo_dmat Jt; // jacobian of nls fun + struct blasfeo_dvec res; // nls residual r(x) + struct blasfeo_dvec grad; // gradient of cost function + struct blasfeo_dvec *ux; // pointer to ux in nlp_out + struct blasfeo_dvec *tmp_ux; // pointer to ux in tmp_nlp_out + struct blasfeo_dvec *z_alg; ///< pointer to z in sim_out + struct blasfeo_dmat *dzdux_tran; ///< pointer to sensitivity of a wrt ux in sim_out + struct blasfeo_dmat *RSQrq; // pointer to RSQrq in qp_in + struct blasfeo_dvec *Z; // pointer to Z in qp_in + double fun; ///< value of the cost function +} ocp_nlp_cost_nls_memory; + +// +acados_size_t ocp_nlp_cost_nls_memory_calculate_size(void *config, void *dims, void *opts); +// +void *ocp_nlp_cost_nls_memory_assign(void *config, void *dims, void *opts, void *raw_memory); +// +double *ocp_nlp_cost_nls_memory_get_fun_ptr(void *memory_); +// +struct blasfeo_dvec *ocp_nlp_cost_nls_memory_get_grad_ptr(void *memory_); +// +void ocp_nlp_cost_nls_memory_set_RSQrq_ptr(struct blasfeo_dmat *RSQrq, void *memory); +// +void ocp_nlp_cost_nls_memory_set_Z_ptr(struct blasfeo_dvec *Z, void *memory); +// +void ocp_nlp_cost_nls_memory_set_ux_ptr(struct blasfeo_dvec *ux, void *memory_); +// +void ocp_nlp_cost_nls_memory_set_tmp_ux_ptr(struct blasfeo_dvec *tmp_ux, void *memory_); +// +void ocp_nlp_cost_nls_memory_set_z_alg_ptr(struct blasfeo_dvec *z_alg, void *memory_); +// +void ocp_nlp_cost_nls_memory_set_dzdux_tran_ptr(struct blasfeo_dmat *dzdux_tran, void *memory_); + +/************************************************ + * workspace + ************************************************/ + +typedef struct +{ + struct blasfeo_dmat tmp_nv_ny; + struct blasfeo_dmat tmp_nv_nv; + struct blasfeo_dvec tmp_ny; + struct blasfeo_dvec tmp_2ns; // temporary vector of dimension ny +} ocp_nlp_cost_nls_workspace; + +// +acados_size_t ocp_nlp_cost_nls_workspace_calculate_size(void *config, void *dims, void *opts); + +/************************************************ + * functions + ************************************************/ + +// +void ocp_nlp_cost_nls_config_initialize_default(void *config); +// +void ocp_nlp_cost_nls_initialize(void *config_, void *dims, void *model_, void *opts_, void *mem_, void *work_); +// +void ocp_nlp_cost_nls_update_qp_matrices(void *config_, void *dims, void *model_, void *opts_, void *memory_, void *work_); +// +void ocp_nlp_cost_nls_compute_fun(void *config_, void *dims, void *model_, void *opts_, void *memory_, void *work_); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_COST_NLS_H_ +/// @} +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_dynamics_common.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_dynamics_common.h new file mode 100644 index 000000000..45dac20a2 --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_dynamics_common.h @@ -0,0 +1,122 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \ingroup ocp_nlp +/// @{ + +/// \defgroup ocp_nlp_dynamics ocp_nlp_dynamics +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_DYNAMICS_COMMON_H_ +#define ACADOS_OCP_NLP_OCP_NLP_DYNAMICS_COMMON_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + + +// blasfeo +#include "blasfeo/include/blasfeo_common.h" + +// acados +#include "acados/sim/sim_common.h" +#include "acados/utils/external_function_generic.h" +#include "acados/utils/types.h" + + + +/************************************************ + * config + ************************************************/ + +typedef struct +{ + void (*config_initialize_default)(void *config); + sim_config *sim_solver; + /* dims */ + acados_size_t (*dims_calculate_size)(void *config); + void *(*dims_assign)(void *config, void *raw_memory); + void (*dims_initialize)(void *config, void *dims, int nx, int nu, int nx1, int nu1, int nz); + void (*dims_set)(void *config_, void *dims_, const char *field, int *value); + void (*dims_get)(void *config_, void *dims_, const char *field, int* value); + /* model */ + acados_size_t (*model_calculate_size)(void *config, void *dims); + void *(*model_assign)(void *config, void *dims, void *raw_memory); + void (*model_set)(void *config_, void *dims_, void *model_, const char *field, void *value_); + /* opts */ + acados_size_t (*opts_calculate_size)(void *config, void *dims); + void *(*opts_assign)(void *config, void *dims, void *raw_memory); + void (*opts_initialize_default)(void *config, void *dims, void *opts); + void (*opts_set)(void *config_, void *opts_, const char *field, void *value); + void (*opts_update)(void *config, void *dims, void *opts); + /* memory */ + acados_size_t (*memory_calculate_size)(void *config, void *dims, void *opts); + void *(*memory_assign)(void *config, void *dims, void *opts, void *raw_memory); + struct blasfeo_dvec *(*memory_get_fun_ptr)(void *memory_); + struct blasfeo_dvec *(*memory_get_adj_ptr)(void *memory_); + void (*memory_set_ux_ptr)(struct blasfeo_dvec *ux, void *memory_); + void (*memory_set_tmp_ux_ptr)(struct blasfeo_dvec *tmp_ux, void *memory_); + void (*memory_set_ux1_ptr)(struct blasfeo_dvec *ux1, void *memory_); + void (*memory_set_tmp_ux1_ptr)(struct blasfeo_dvec *tmp_ux1, void *memory_); + void (*memory_set_pi_ptr)(struct blasfeo_dvec *pi, void *memory_); + void (*memory_set_tmp_pi_ptr)(struct blasfeo_dvec *tmp_pi, void *memory_); + void (*memory_set_BAbt_ptr)(struct blasfeo_dmat *BAbt, void *memory_); + void (*memory_set_RSQrq_ptr)(struct blasfeo_dmat *RSQrq, void *memory_); + void (*memory_set_dzduxt_ptr)(struct blasfeo_dmat *mat, void *memory_); + void (*memory_set_sim_guess_ptr)(struct blasfeo_dvec *vec, bool *bool_ptr, void *memory_); + void (*memory_set_z_alg_ptr)(struct blasfeo_dvec *vec, void *memory_); + void (*memory_get)(void *config, void *dims, void *mem, const char *field, void* value); + /* workspace */ + acados_size_t (*workspace_calculate_size)(void *config, void *dims, void *opts); + void (*initialize)(void *config_, void *dims, void *model_, void *opts_, void *mem_, void *work_); + void (*update_qp_matrices)(void *config_, void *dims, void *model_, void *opts_, void *mem_, void *work_); + void (*compute_fun)(void *config_, void *dims, void *model_, void *opts_, void *mem_, void *work_); + int (*precompute)(void *config_, void *dims, void *model_, void *opts_, void *mem_, void *work_); +} ocp_nlp_dynamics_config; + +// +acados_size_t ocp_nlp_dynamics_config_calculate_size(); +// +ocp_nlp_dynamics_config *ocp_nlp_dynamics_config_assign(void *raw_memory); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_DYNAMICS_COMMON_H_ +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_dynamics_cont.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_dynamics_cont.h new file mode 100644 index 000000000..59a2df4f4 --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_dynamics_cont.h @@ -0,0 +1,216 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \addtogroup ocp_nlp +/// @{ +/// \addtogroup ocp_nlp_dynamics +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_DYNAMICS_CONT_H_ +#define ACADOS_OCP_NLP_OCP_NLP_DYNAMICS_CONT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + + +// blasfeo +#include "blasfeo/include/blasfeo_common.h" + +// acados +#include "acados/ocp_nlp/ocp_nlp_dynamics_common.h" +#include "acados/utils/external_function_generic.h" +#include "acados/utils/types.h" +#include "acados_c/sim_interface.h" + + + +/************************************************ + * dims + ************************************************/ + +typedef struct +{ + void *sim; + int nx; // number of states at the current stage + int nz; // number of algebraic states at the current stage + int nu; // number of inputs at the current stage + int nx1; // number of states at the next stage + int nu1; // number of inputes at the next stage +} ocp_nlp_dynamics_cont_dims; + +// +acados_size_t ocp_nlp_dynamics_cont_dims_calculate_size(void *config); +// +void *ocp_nlp_dynamics_cont_dims_assign(void *config, void *raw_memory); +// +void ocp_nlp_dynamics_cont_dims_initialize(void *config, void *dims, int nx, int nu, int nx1, + int nu1, int nz); + +// +void ocp_nlp_dynamics_cont_dims_set(void *config_, void *dims_, const char *field, int* value); + +/************************************************ + * options + ************************************************/ + +typedef struct +{ + void *sim_solver; + int compute_adj; + int compute_hess; +} ocp_nlp_dynamics_cont_opts; + +// +acados_size_t ocp_nlp_dynamics_cont_opts_calculate_size(void *config, void *dims); +// +void *ocp_nlp_dynamics_cont_opts_assign(void *config, void *dims, void *raw_memory); +// +void ocp_nlp_dynamics_cont_opts_initialize_default(void *config, void *dims, void *opts); +// +void ocp_nlp_dynamics_cont_opts_update(void *config, void *dims, void *opts); +// +void ocp_nlp_dynamics_cont_opts_set(void *config, void *opts, const char *field, void* value); + + + +/************************************************ + * memory + ************************************************/ + +typedef struct +{ + struct blasfeo_dvec fun; + struct blasfeo_dvec adj; + struct blasfeo_dvec *ux; // pointer to ux in nlp_out at current stage + struct blasfeo_dvec *tmp_ux; // pointer to ux in tmp_nlp_out at current stage + struct blasfeo_dvec *ux1; // pointer to ux in nlp_out at next stage + struct blasfeo_dvec *tmp_ux1; // pointer to ux in tmp_nlp_out at next stage + struct blasfeo_dvec *pi; // pointer to pi in nlp_out at current stage + struct blasfeo_dvec *tmp_pi; // pointer to pi in tmp_nlp_out at current stage + struct blasfeo_dmat *BAbt; // pointer to BAbt in qp_in + struct blasfeo_dmat *RSQrq; // pointer to RSQrq in qp_in + struct blasfeo_dvec *z_alg; // pointer to output z at t = 0 + bool *set_sim_guess; // indicate if initialization for integrator is set from outside + struct blasfeo_dvec *sim_guess; // initializations for integrator + // struct blasfeo_dvec *z; // pointer to (input) z in nlp_out at current stage + struct blasfeo_dmat *dzduxt; // pointer to dzdux transposed + void *sim_solver; // sim solver memory +} ocp_nlp_dynamics_cont_memory; + +// +acados_size_t ocp_nlp_dynamics_cont_memory_calculate_size(void *config, void *dims, void *opts); +// +void *ocp_nlp_dynamics_cont_memory_assign(void *config, void *dims, void *opts, void *raw_memory); +// +struct blasfeo_dvec *ocp_nlp_dynamics_cont_memory_get_fun_ptr(void *memory); +// +struct blasfeo_dvec *ocp_nlp_dynamics_cont_memory_get_adj_ptr(void *memory); +// +void ocp_nlp_dynamics_cont_memory_set_ux_ptr(struct blasfeo_dvec *ux, void *memory); +// +void ocp_nlp_dynamics_cont_memory_set_tmp_ux_ptr(struct blasfeo_dvec *tmp_ux, void *memory); +// +void ocp_nlp_dynamics_cont_memory_set_ux1_ptr(struct blasfeo_dvec *ux1, void *memory); +// +void ocp_nlp_dynamics_cont_memory_set_tmp_ux1_ptr(struct blasfeo_dvec *tmp_ux1, void *memory); +// +void ocp_nlp_dynamics_cont_memory_set_pi_ptr(struct blasfeo_dvec *pi, void *memory); +// +void ocp_nlp_dynamics_cont_memory_set_tmp_pi_ptr(struct blasfeo_dvec *tmp_pi, void *memory); +// +void ocp_nlp_dynamics_cont_memory_set_BAbt_ptr(struct blasfeo_dmat *BAbt, void *memory); + + + +/************************************************ + * workspace + ************************************************/ + +typedef struct +{ + struct blasfeo_dmat hess; + sim_in *sim_in; + sim_out *sim_out; + void *sim_solver; // sim solver workspace +} ocp_nlp_dynamics_cont_workspace; + +acados_size_t ocp_nlp_dynamics_cont_workspace_calculate_size(void *config, void *dims, void *opts); + + + +/************************************************ + * model + ************************************************/ + +typedef struct +{ + void *sim_model; + // double *state_transition; // TODO + double T; // simulation time +} ocp_nlp_dynamics_cont_model; + +// +acados_size_t ocp_nlp_dynamics_cont_model_calculate_size(void *config, void *dims); +// +void *ocp_nlp_dynamics_cont_model_assign(void *config, void *dims, void *raw_memory); +// +void ocp_nlp_dynamics_cont_model_set(void *config_, void *dims_, void *model_, const char *field, void *value); + + + +/************************************************ + * functions + ************************************************/ + +// +void ocp_nlp_dynamics_cont_config_initialize_default(void *config); +// +void ocp_nlp_dynamics_cont_initialize(void *config_, void *dims, void *model_, void *opts, void *mem, void *work_); +// +void ocp_nlp_dynamics_cont_update_qp_matrices(void *config_, void *dims, void *model_, void *opts, void *mem, void *work_); +// +void ocp_nlp_dynamics_cont_compute_fun(void *config_, void *dims, void *model_, void *opts, void *mem, void *work_); +// +int ocp_nlp_dynamics_cont_precompute(void *config_, void *dims, void *model_, void *opts_, void *mem_, void *work_); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_DYNAMICS_CONT_H_ +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_dynamics_disc.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_dynamics_disc.h new file mode 100644 index 000000000..8b2a6177b --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_dynamics_disc.h @@ -0,0 +1,199 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \addtogroup ocp_nlp +/// @{ +/// \addtogroup ocp_nlp_dynamics +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_DYNAMICS_DISC_H_ +#define ACADOS_OCP_NLP_OCP_NLP_DYNAMICS_DISC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// blasfeo +#include "blasfeo/include/blasfeo_common.h" + +// acados +#include "acados/ocp_nlp/ocp_nlp_dynamics_common.h" +#include "acados/utils/external_function_generic.h" +#include "acados/utils/types.h" + +/************************************************ + * dims + ************************************************/ + +typedef struct +{ + int nx; // number of states at the current stage + int nu; // number of inputs at the current stage + int nx1; // number of states at the next stage + int nu1; // number of inputes at the next stage +} ocp_nlp_dynamics_disc_dims; + +// +acados_size_t ocp_nlp_dynamics_disc_dims_calculate_size(void *config); +// +void *ocp_nlp_dynamics_disc_dims_assign(void *config, void *raw_memory); +// +void ocp_nlp_dynamics_disc_dims_initialize(void *config, void *dims, int nx, int nu, int nx1, + int nu1, int nz); + +// +void ocp_nlp_dynamics_disc_dims_set(void *config_, void *dims_, const char *dim, int* value); + + +/************************************************ + * options + ************************************************/ + +typedef struct +{ + int compute_adj; + int compute_hess; +} ocp_nlp_dynamics_disc_opts; + +// +acados_size_t ocp_nlp_dynamics_disc_opts_calculate_size(void *config, void *dims); +// +void *ocp_nlp_dynamics_disc_opts_assign(void *config, void *dims, void *raw_memory); +// +void ocp_nlp_dynamics_disc_opts_initialize_default(void *config, void *dims, void *opts); +// +void ocp_nlp_dynamics_disc_opts_update(void *config, void *dims, void *opts); +// +int ocp_nlp_dynamics_disc_precompute(void *config_, void *dims, void *model_, void *opts_, + void *mem_, void *work_); + + +/************************************************ + * memory + ************************************************/ + +typedef struct +{ + struct blasfeo_dvec fun; + struct blasfeo_dvec adj; + struct blasfeo_dvec *ux; // pointer to ux in nlp_out at current stage + struct blasfeo_dvec *tmp_ux; // pointer to ux in tmp_nlp_out at current stage + struct blasfeo_dvec *ux1; // pointer to ux in nlp_out at next stage + struct blasfeo_dvec *tmp_ux1;// pointer to ux in tmp_nlp_out at next stage + struct blasfeo_dvec *pi; // pointer to pi in nlp_out at current stage + struct blasfeo_dvec *tmp_pi; // pointer to pi in tmp_nlp_out at current stage + struct blasfeo_dmat *BAbt; // pointer to BAbt in qp_in + struct blasfeo_dmat *RSQrq; // pointer to RSQrq in qp_in +} ocp_nlp_dynamics_disc_memory; + +// +acados_size_t ocp_nlp_dynamics_disc_memory_calculate_size(void *config, void *dims, void *opts); +// +void *ocp_nlp_dynamics_disc_memory_assign(void *config, void *dims, void *opts, void *raw_memory); +// +struct blasfeo_dvec *ocp_nlp_dynamics_disc_memory_get_fun_ptr(void *memory); +// +struct blasfeo_dvec *ocp_nlp_dynamics_disc_memory_get_adj_ptr(void *memory); +// +void ocp_nlp_dynamics_disc_memory_set_ux_ptr(struct blasfeo_dvec *ux, void *memory); +// +void ocp_nlp_dynamics_disc_memory_set_tmp_ux_ptr(struct blasfeo_dvec *tmp_ux, void *memory); +// +void ocp_nlp_dynamics_disc_memory_set_ux1_ptr(struct blasfeo_dvec *ux1, void *memory); +// +void ocp_nlp_dynamics_disc_memory_set_tmp_ux1_ptr(struct blasfeo_dvec *tmp_ux1, void *memory); +// +void ocp_nlp_dynamics_disc_memory_set_pi_ptr(struct blasfeo_dvec *pi, void *memory); +// +void ocp_nlp_dynamics_disc_memory_set_tmp_pi_ptr(struct blasfeo_dvec *tmp_pi, void *memory); +// +void ocp_nlp_dynamics_disc_memory_set_BAbt_ptr(struct blasfeo_dmat *BAbt, void *memory); + + + +/************************************************ + * workspace + ************************************************/ + +typedef struct +{ + struct blasfeo_dmat tmp_nv_nv; +} ocp_nlp_dynamics_disc_workspace; + +acados_size_t ocp_nlp_dynamics_disc_workspace_calculate_size(void *config, void *dims, void *opts); + + + +/************************************************ + * model + ************************************************/ + +typedef struct +{ + external_function_generic *disc_dyn_fun; + external_function_generic *disc_dyn_fun_jac; + external_function_generic *disc_dyn_fun_jac_hess; +} ocp_nlp_dynamics_disc_model; + +// +acados_size_t ocp_nlp_dynamics_disc_model_calculate_size(void *config, void *dims); +// +void *ocp_nlp_dynamics_disc_model_assign(void *config, void *dims, void *raw_memory); +// +void ocp_nlp_dynamics_disc_model_set(void *config_, void *dims_, void *model_, const char *field, void *value); + + + +/************************************************ + * functions + ************************************************/ + +// +void ocp_nlp_dynamics_disc_config_initialize_default(void *config); +// +void ocp_nlp_dynamics_disc_initialize(void *config_, void *dims, void *model_, void *opts, void *mem, void *work_); +// +void ocp_nlp_dynamics_disc_update_qp_matrices(void *config_, void *dims, void *model_, void *opts, void *mem, void *work_); +// +void ocp_nlp_dynamics_disc_compute_fun(void *config_, void *dims, void *model_, void *opts, void *mem, void *work_); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_DYNAMICS_DISC_H_ +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_common.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_common.h new file mode 100644 index 000000000..cd26788a5 --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_common.h @@ -0,0 +1,125 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \ingroup ocp_nlp +/// @{ + +/// \defgroup ocp_nlp_reg ocp_nlp_reg +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_REG_COMMON_H_ +#define ACADOS_OCP_NLP_OCP_NLP_REG_COMMON_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/ocp_qp/ocp_qp_common.h" + + + +/* dims */ + +//typedef ocp_qp_dims ocp_nlp_reg_dims; +typedef struct +{ + int *nx; + int *nu; + int *nbu; + int *nbx; + int *ng; + int N; +} ocp_nlp_reg_dims; + +// +acados_size_t ocp_nlp_reg_dims_calculate_size(int N); +// +ocp_nlp_reg_dims *ocp_nlp_reg_dims_assign(int N, void *raw_memory); +// +void ocp_nlp_reg_dims_set(void *config_, ocp_nlp_reg_dims *dims, int stage, char *field, int* value); + + + +/* config */ + +typedef struct +{ + /* dims */ + acados_size_t (*dims_calculate_size)(int N); + ocp_nlp_reg_dims *(*dims_assign)(int N, void *raw_memory); + void (*dims_set)(void *config, ocp_nlp_reg_dims *dims, int stage, char *field, int *value); + /* opts */ + acados_size_t (*opts_calculate_size)(void); + void *(*opts_assign)(void *raw_memory); + void (*opts_initialize_default)(void *config, ocp_nlp_reg_dims *dims, void *opts); + void (*opts_set)(void *config, ocp_nlp_reg_dims *dims, void *opts, char *field, void* value); + /* memory */ + acados_size_t (*memory_calculate_size)(void *config, ocp_nlp_reg_dims *dims, void *opts); + void *(*memory_assign)(void *config, ocp_nlp_reg_dims *dims, void *opts, void *raw_memory); + void (*memory_set)(void *config, ocp_nlp_reg_dims *dims, void *memory, char *field, void* value); + void (*memory_set_RSQrq_ptr)(ocp_nlp_reg_dims *dims, struct blasfeo_dmat *mat, void *memory); + void (*memory_set_rq_ptr)(ocp_nlp_reg_dims *dims, struct blasfeo_dvec *vec, void *memory); + void (*memory_set_BAbt_ptr)(ocp_nlp_reg_dims *dims, struct blasfeo_dmat *mat, void *memory); + void (*memory_set_b_ptr)(ocp_nlp_reg_dims *dims, struct blasfeo_dvec *vec, void *memory); + void (*memory_set_idxb_ptr)(ocp_nlp_reg_dims *dims, int **idxb, void *memory); + void (*memory_set_DCt_ptr)(ocp_nlp_reg_dims *dims, struct blasfeo_dmat *mat, void *memory); + void (*memory_set_ux_ptr)(ocp_nlp_reg_dims *dims, struct blasfeo_dvec *vec, void *memory); + void (*memory_set_pi_ptr)(ocp_nlp_reg_dims *dims, struct blasfeo_dvec *vec, void *memory); + void (*memory_set_lam_ptr)(ocp_nlp_reg_dims *dims, struct blasfeo_dvec *vec, void *memory); + /* functions */ + void (*regularize_hessian)(void *config, ocp_nlp_reg_dims *dims, void *opts, void *memory); + void (*correct_dual_sol)(void *config, ocp_nlp_reg_dims *dims, void *opts, void *memory); +} ocp_nlp_reg_config; + +// +acados_size_t ocp_nlp_reg_config_calculate_size(void); +// +void *ocp_nlp_reg_config_assign(void *raw_memory); + + + +/* regularization help functions */ +void acados_reconstruct_A(int dim, double *A, double *V, double *d); +void acados_mirror(int dim, double *A, double *V, double *d, double *e, double epsilon); +void acados_project(int dim, double *A, double *V, double *d, double *e, double epsilon); + + + +#ifdef __cplusplus +} +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_REG_COMMON_H_ +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_convexify.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_convexify.h new file mode 100644 index 000000000..df3136168 --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_convexify.h @@ -0,0 +1,149 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \addtogroup ocp_nlp +/// @{ +/// \addtogroup ocp_nlp_reg +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_REG_CONVEXIFY_H_ +#define ACADOS_OCP_NLP_OCP_NLP_REG_CONVEXIFY_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + + +// blasfeo +#include "blasfeo/include/blasfeo_common.h" + +// acados +#include "acados/ocp_nlp/ocp_nlp_reg_common.h" + + + +/************************************************ + * dims + ************************************************/ + +// use the functions in ocp_nlp_reg_common + +/************************************************ + * options + ************************************************/ + +typedef struct +{ + double delta; + double epsilon; +// double gamma; // 0.0 +} ocp_nlp_reg_convexify_opts; + +// +acados_size_t ocp_nlp_reg_convexify_opts_calculate_size(void); +// +void *ocp_nlp_reg_convexify_opts_assign(void *raw_memory); +// +void ocp_nlp_reg_convexify_opts_initialize_default(void *config_, ocp_nlp_reg_dims *dims, void *opts_); +// +void ocp_nlp_reg_convexify_opts_set(void *config_, ocp_nlp_reg_dims *dims, void *opts_, char *field, void* value); + + + +/************************************************ + * memory + ************************************************/ + +typedef struct { + double *R; + double *V; // TODO move to workspace + double *d; // TODO move to workspace + double *e; // TODO move to workspace + double *reg_hess; // TODO move to workspace + + struct blasfeo_dmat Q_tilde; + struct blasfeo_dmat Q_bar; + struct blasfeo_dmat BAQ; + struct blasfeo_dmat L; + struct blasfeo_dmat delta_eye; + struct blasfeo_dmat St_copy; + + struct blasfeo_dmat *original_RSQrq; + struct blasfeo_dmat tmp_RSQ; + + struct blasfeo_dvec tmp_nuxM; + struct blasfeo_dvec tmp_nbgM; + +// struct blasfeo_dvec grad; +// struct blasfeo_dvec b2; + + // giaf's + struct blasfeo_dmat **RSQrq; // pointer to RSQrq in qp_in + struct blasfeo_dvec **rq; // pointer to rq in qp_in + struct blasfeo_dmat **BAbt; // pointer to BAbt in qp_in + struct blasfeo_dvec **b; // pointer to b in qp_in + struct blasfeo_dmat **DCt; // pointer to DCt in qp_in + struct blasfeo_dvec **ux; // pointer to ux in qp_out + struct blasfeo_dvec **pi; // pointer to pi in qp_out + struct blasfeo_dvec **lam; // pointer to lam in qp_out + int **idxb; // pointer to idxb in qp_in + +} ocp_nlp_reg_convexify_memory; + +// +acados_size_t ocp_nlp_reg_convexify_calculate_memory_size(void *config, ocp_nlp_reg_dims *dims, void *opts); +// +void *ocp_nlp_reg_convexify_assign_memory(void *config, ocp_nlp_reg_dims *dims, void *opts, void *raw_memory); + +/************************************************ + * workspace + ************************************************/ + + // TODO + +/************************************************ + * functions + ************************************************/ + +// +void ocp_nlp_reg_convexify_config_initialize_default(ocp_nlp_reg_config *config); + +#ifdef __cplusplus +} +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_REG_CONVEXIFY_H_ +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_mirror.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_mirror.h new file mode 100644 index 000000000..f6bd7dcaf --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_mirror.h @@ -0,0 +1,124 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \addtogroup ocp_nlp +/// @{ +/// \addtogroup ocp_nlp_reg +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_REG_MIRROR_H_ +#define ACADOS_OCP_NLP_OCP_NLP_REG_MIRROR_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + + +// blasfeo +#include "blasfeo/include/blasfeo_common.h" + +// acados +#include "acados/ocp_nlp/ocp_nlp_reg_common.h" + + + +/************************************************ + * dims + ************************************************/ + +// use the functions in ocp_nlp_reg_common + +/************************************************ + * options + ************************************************/ + +typedef struct +{ + double epsilon; +} ocp_nlp_reg_mirror_opts; + +// +acados_size_t ocp_nlp_reg_mirror_opts_calculate_size(void); +// +void *ocp_nlp_reg_mirror_opts_assign(void *raw_memory); +// +void ocp_nlp_reg_mirror_opts_initialize_default(void *config_, ocp_nlp_reg_dims *dims, void *opts_); +// +void ocp_nlp_reg_mirror_opts_set(void *config_, ocp_nlp_reg_dims *dims, void *opts_, char *field, void* value); + + + +/************************************************ + * memory + ************************************************/ + +typedef struct +{ + double *reg_hess; // TODO move to workspace + double *V; // TODO move to workspace + double *d; // TODO move to workspace + double *e; // TODO move to workspace + + // giaf's + struct blasfeo_dmat **RSQrq; // pointer to RSQrq in qp_in +} ocp_nlp_reg_mirror_memory; + +// +acados_size_t ocp_nlp_reg_mirror_memory_calculate_size(void *config, ocp_nlp_reg_dims *dims, void *opts); +// +void *ocp_nlp_reg_mirror_memory_assign(void *config, ocp_nlp_reg_dims *dims, void *opts, void *raw_memory); + +/************************************************ + * workspace + ************************************************/ + + // TODO + +/************************************************ + * functions + ************************************************/ + +// +void ocp_nlp_reg_mirror_config_initialize_default(ocp_nlp_reg_config *config); + + + +#ifdef __cplusplus +} +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_REG_MIRROR_H_ +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_noreg.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_noreg.h new file mode 100644 index 000000000..8d2b6ecc1 --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_noreg.h @@ -0,0 +1,120 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \addtogroup ocp_nlp +/// @{ +/// \addtogroup ocp_nlp_reg +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_REG_NOREG_H_ +#define ACADOS_OCP_NLP_OCP_NLP_REG_NOREG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + + +// blasfeo +#include "blasfeo/include/blasfeo_common.h" + +// acados +#include "acados/ocp_nlp/ocp_nlp_reg_common.h" + + + +/************************************************ + * dims + ************************************************/ + +// use the functions in ocp_nlp_reg_common + + +/************************************************ + * options + ************************************************/ + +typedef struct +{ + int dummy; +} ocp_nlp_reg_noreg_opts; + +// +acados_size_t ocp_nlp_reg_noreg_opts_calculate_size(void); +// +void *ocp_nlp_reg_noreg_opts_assign(void *raw_memory); +// +void ocp_nlp_reg_noreg_opts_initialize_default(void *config_, ocp_nlp_reg_dims *dims, void *opts_); +// +void ocp_nlp_reg_noreg_opts_set(void *config_, ocp_nlp_reg_dims *dims, void *opts_, char *field, void* value); + + + +/************************************************ + * memory + ************************************************/ + +typedef struct +{ + int dummy; +} ocp_nlp_reg_noreg_memory; + +// +acados_size_t ocp_nlp_reg_noreg_memory_calculate_size(void *config, ocp_nlp_reg_dims *dims, void *opts); +// +void *ocp_nlp_reg_noreg_memory_assign(void *config, ocp_nlp_reg_dims *dims, void *opts, void *raw_memory); + +/************************************************ + * workspace + ************************************************/ + +// not needed + +/************************************************ + * functions + ************************************************/ + +// +void ocp_nlp_reg_noreg_config_initialize_default(ocp_nlp_reg_config *config); + + + +#ifdef __cplusplus +} +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_REG_NOREG_H_ + +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_project.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_project.h new file mode 100644 index 000000000..104c29720 --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_project.h @@ -0,0 +1,124 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \addtogroup ocp_nlp +/// @{ +/// \addtogroup ocp_nlp_reg +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_REG_PROJECT_H_ +#define ACADOS_OCP_NLP_OCP_NLP_REG_PROJECT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + + +// blasfeo +#include "blasfeo/include/blasfeo_common.h" + +// acados +#include "acados/ocp_nlp/ocp_nlp_reg_common.h" + + + +/************************************************ + * dims + ************************************************/ + +// use the functions in ocp_nlp_reg_common + +/************************************************ + * options + ************************************************/ + +typedef struct +{ + double epsilon; +} ocp_nlp_reg_project_opts; + +// +acados_size_t ocp_nlp_reg_project_opts_calculate_size(void); +// +void *ocp_nlp_reg_project_opts_assign(void *raw_memory); +// +void ocp_nlp_reg_project_opts_initialize_default(void *config_, ocp_nlp_reg_dims *dims, void *opts_); +// +void ocp_nlp_reg_project_opts_set(void *config_, ocp_nlp_reg_dims *dims, void *opts_, char *field, void* value); + + + +/************************************************ + * memory + ************************************************/ + +typedef struct +{ + double *reg_hess; // TODO move to workspace + double *V; // TODO move to workspace + double *d; // TODO move to workspace + double *e; // TODO move to workspace + + // giaf's + struct blasfeo_dmat **RSQrq; // pointer to RSQrq in qp_in +} ocp_nlp_reg_project_memory; + +// +acados_size_t ocp_nlp_reg_project_memory_calculate_size(void *config, ocp_nlp_reg_dims *dims, void *opts); +// +void *ocp_nlp_reg_project_memory_assign(void *config, ocp_nlp_reg_dims *dims, void *opts, void *raw_memory); + +/************************************************ + * workspace + ************************************************/ + + // TODO + +/************************************************ + * functions + ************************************************/ + +// +void ocp_nlp_reg_project_config_initialize_default(ocp_nlp_reg_config *config); + + + +#ifdef __cplusplus +} +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_REG_PROJECT_H_ +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_project_reduc_hess.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_project_reduc_hess.h new file mode 100644 index 000000000..e0b854bc1 --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_reg_project_reduc_hess.h @@ -0,0 +1,135 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \addtogroup ocp_nlp +/// @{ +/// \addtogroup ocp_nlp_reg +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_REG_PROJECT_REDUC_HESS_H_ +#define ACADOS_OCP_NLP_OCP_NLP_REG_PROJECT_REDUC_HESS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + + +// blasfeo +#include "blasfeo/include/blasfeo_common.h" + +// acados +#include "acados/ocp_nlp/ocp_nlp_reg_common.h" + + + +/************************************************ + * dims + ************************************************/ + +// use the functions in ocp_nlp_reg_common + +/************************************************ + * options + ************************************************/ + +typedef struct +{ + double thr_eig; + double min_eig; + double min_pivot; + int pivoting; +} ocp_nlp_reg_project_reduc_hess_opts; + +// +acados_size_t ocp_nlp_reg_project_reduc_hess_opts_calculate_size(void); +// +void *ocp_nlp_reg_project_reduc_hess_opts_assign(void *raw_memory); +// +void ocp_nlp_reg_project_reduc_hess_opts_initialize_default(void *config_, ocp_nlp_reg_dims *dims, void *opts_); +// +void ocp_nlp_reg_project_reduc_hess_opts_set(void *config_, ocp_nlp_reg_dims *dims, void *opts_, char *field, void* value); + + + +/************************************************ + * memory + ************************************************/ + +typedef struct +{ + double *reg_hess; // TODO move to workspace + double *V; // TODO move to workspace + double *d; // TODO move to workspace + double *e; // TODO move to workspace + + // giaf's + struct blasfeo_dmat L; // TODO move to workspace + struct blasfeo_dmat L2; // TODO move to workspace + struct blasfeo_dmat L3; // TODO move to workspace + struct blasfeo_dmat Ls; // TODO move to workspace + struct blasfeo_dmat P; // TODO move to workspace + struct blasfeo_dmat AL; // TODO move to workspace + + struct blasfeo_dmat **RSQrq; // pointer to RSQrq in qp_in + struct blasfeo_dmat **BAbt; // pointer to RSQrq in qp_in +} ocp_nlp_reg_project_reduc_hess_memory; + +// +acados_size_t ocp_nlp_reg_project_reduc_hess_memory_calculate_size(void *config, ocp_nlp_reg_dims *dims, void *opts); +// +void *ocp_nlp_reg_project_reduc_hess_memory_assign(void *config, ocp_nlp_reg_dims *dims, void *opts, void *raw_memory); + +/************************************************ + * workspace + ************************************************/ + + // TODO + +/************************************************ + * functions + ************************************************/ + +// +void ocp_nlp_reg_project_reduc_hess_config_initialize_default(ocp_nlp_reg_config *config); + + + +#ifdef __cplusplus +} +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_REG_PROJECT_REDUC_HESS_H_ +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_sqp.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_sqp.h new file mode 100644 index 000000000..81a4afd03 --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_sqp.h @@ -0,0 +1,171 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \addtogroup ocp_nlp +/// @{ +/// \addtogroup ocp_nlp_solver +/// @{ +/// \addtogroup ocp_nlp_sqp ocp_nlp_sqp +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_SQP_H_ +#define ACADOS_OCP_NLP_OCP_NLP_SQP_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// acados +#include "acados/ocp_nlp/ocp_nlp_common.h" +#include "acados/utils/types.h" + + + +/************************************************ + * options + ************************************************/ + +typedef struct +{ + ocp_nlp_opts *nlp_opts; + double tol_stat; // exit tolerance on stationarity condition + double tol_eq; // exit tolerance on equality constraints + double tol_ineq; // exit tolerance on inequality constraints + double tol_comp; // exit tolerance on complementarity condition + int max_iter; + int ext_qp_res; // compute external QP residuals (i.e. at SQP level) at each SQP iteration (for debugging) + int qp_warm_start; // qp_warm_start in all but the first sqp iterations + bool warm_start_first_qp; // to set qp_warm_start in first iteration + int rti_phase; // only phase 0 at the moment + int print_level; // verbosity + int initialize_t_slacks; // 0-false or 1-true + +} ocp_nlp_sqp_opts; + +// +acados_size_t ocp_nlp_sqp_opts_calculate_size(void *config, void *dims); +// +void *ocp_nlp_sqp_opts_assign(void *config, void *dims, void *raw_memory); +// +void ocp_nlp_sqp_opts_initialize_default(void *config, void *dims, void *opts); +// +void ocp_nlp_sqp_opts_update(void *config, void *dims, void *opts); +// +void ocp_nlp_sqp_opts_set(void *config_, void *opts_, const char *field, void* value); +// +void ocp_nlp_sqp_opts_set_at_stage(void *config_, void *opts_, size_t stage, const char *field, void* value); + + + +/************************************************ + * memory + ************************************************/ + +typedef struct +{ + // nlp memory + ocp_nlp_memory *nlp_mem; + + double time_qp_sol; + double time_qp_solver_call; + double time_qp_xcond; + double time_lin; + double time_reg; + double time_tot; + double time_glob; + double time_sim; + double time_sim_la; + double time_sim_ad; + + // statistics + double *stat; + int stat_m; + int stat_n; + + int status; + int sqp_iter; + +} ocp_nlp_sqp_memory; + +// +acados_size_t ocp_nlp_sqp_memory_calculate_size(void *config, void *dims, void *opts_); +// +void *ocp_nlp_sqp_memory_assign(void *config, void *dims, void *opts_, void *raw_memory); + + + +/************************************************ + * workspace + ************************************************/ + +typedef struct +{ + ocp_nlp_workspace *nlp_work; + + // temp QP in & out (to be used as workspace in param sens) + ocp_qp_in *tmp_qp_in; + ocp_qp_out *tmp_qp_out; + + // qp residuals + ocp_qp_res *qp_res; + ocp_qp_res_ws *qp_res_ws; + +} ocp_nlp_sqp_workspace; + +// +acados_size_t ocp_nlp_sqp_workspace_calculate_size(void *config, void *dims, void *opts_); + + + +/************************************************ + * functions + ************************************************/ + +// +int ocp_nlp_sqp(void *config, void *dims, void *nlp_in, void *nlp_out, + void *args, void *mem, void *work_); +// +void ocp_nlp_sqp_config_initialize_default(void *config_); +// +int ocp_nlp_sqp_precompute(void *config_, void *dims_, void *nlp_in_, void *nlp_out_, + void *opts_, void *mem_, void *work_); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_SQP_H_ +/// @} +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_nlp/ocp_nlp_sqp_rti.h b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_sqp_rti.h new file mode 100644 index 000000000..6f16594d2 --- /dev/null +++ b/third_party/acados/include/acados/ocp_nlp/ocp_nlp_sqp_rti.h @@ -0,0 +1,172 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +/// \addtogroup ocp_nlp +/// @{ +/// \addtogroup ocp_nlp_solver +/// @{ +/// \addtogroup ocp_nlp_sqp_rti ocp_nlp_sqp_rti +/// @{ + +#ifndef ACADOS_OCP_NLP_OCP_NLP_SQP_RTI_H_ +#define ACADOS_OCP_NLP_OCP_NLP_SQP_RTI_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// acados +#include "acados/ocp_nlp/ocp_nlp_common.h" +#include "acados/utils/types.h" + + + +/************************************************ + * options + ************************************************/ + +typedef struct +{ + ocp_nlp_opts *nlp_opts; + int compute_dual_sol; + int ext_qp_res; // compute external QP residuals (i.e. at SQP level) at each SQP iteration (for debugging) + int qp_warm_start; // NOTE: this is not actually setting the warm_start! Just for compatibility with sqp. + bool warm_start_first_qp; // to set qp_warm_start in first iteration + int rti_phase; // phase of RTI. Possible values 1 (preparation), 2 (feedback) 0 (both) + int print_level; // verbosity + +} ocp_nlp_sqp_rti_opts; + +// +acados_size_t ocp_nlp_sqp_rti_opts_calculate_size(void *config_, void *dims_); +// +void *ocp_nlp_sqp_rti_opts_assign(void *config_, void *dims_, void *raw_memory); +// +void ocp_nlp_sqp_rti_opts_initialize_default(void *config_, void *dims_, void *opts_); +// +void ocp_nlp_sqp_rti_opts_update(void *config_, void *dims_, void *opts_); +// +void ocp_nlp_sqp_rti_opts_set(void *config_, void *opts_, const char *field, void* value); +// +void ocp_nlp_sqp_rti_opts_set_at_stage(void *config_, void *opts_, size_t stage, + const char *field, void* value); + + + +/************************************************ + * memory + ************************************************/ + +typedef struct +{ + // nlp memory + ocp_nlp_memory *nlp_mem; + + double time_qp_sol; + double time_qp_solver_call; + double time_qp_xcond; + double time_lin; + double time_reg; + double time_tot; + double time_glob; + + // statistics + double *stat; + int stat_m; + int stat_n; + + int status; + +} ocp_nlp_sqp_rti_memory; + +// +acados_size_t ocp_nlp_sqp_rti_memory_calculate_size(void *config_, void *dims_, void *opts_); +// +void *ocp_nlp_sqp_rti_memory_assign(void *config_, void *dims_, void *opts_, + void *raw_memory); + + + +/************************************************ + * workspace + ************************************************/ + +typedef struct +{ + ocp_nlp_workspace *nlp_work; + + // temp QP in & out (to be used as workspace in param sens) + ocp_qp_in *tmp_qp_in; + ocp_qp_out *tmp_qp_out; + + // qp residuals + ocp_qp_res *qp_res; + ocp_qp_res_ws *qp_res_ws; + + +} ocp_nlp_sqp_rti_workspace; + +// +acados_size_t ocp_nlp_sqp_rti_workspace_calculate_size(void *config_, void *dims_, void *opts_); + + + +/************************************************ + * functions + ************************************************/ + +void ocp_nlp_sqp_rti_preparation_step(void *config_, void *dims_, + void *nlp_in_, void *nlp_out_, void *opts, void *mem_, void *work_); +// +void ocp_nlp_sqp_rti_feedback_step(void *config_, void *dims_, + void *nlp_in_, void *nlp_out_, void *opts_, void *mem_, void *work_); +// +int ocp_nlp_sqp_rti(void *config_, void *dims_, void *nlp_in_, void *nlp_out_, + void *opts_, void *mem_, void *work_); +// +void ocp_nlp_sqp_rti_config_initialize_default(void *config_); +// +int ocp_nlp_sqp_rti_precompute(void *config_, void *dims_, + void *nlp_in_, void *nlp_out_, void *opts_, void *mem_, void *work_); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_NLP_OCP_NLP_SQP_RTI_H_ +/// @} +/// @} +/// @} diff --git a/third_party/acados/include/acados/ocp_qp/ocp_qp_common.h b/third_party/acados/include/acados/ocp_qp/ocp_qp_common.h new file mode 100644 index 000000000..bba55f8f7 --- /dev/null +++ b/third_party/acados/include/acados/ocp_qp/ocp_qp_common.h @@ -0,0 +1,182 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_OCP_QP_OCP_QP_COMMON_H_ +#define ACADOS_OCP_QP_OCP_QP_COMMON_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// hpipm +#include "hpipm/include/hpipm_d_ocp_qp.h" +#include "hpipm/include/hpipm_d_ocp_qp_dim.h" +#include "hpipm/include/hpipm_d_ocp_qp_res.h" +#include "hpipm/include/hpipm_d_ocp_qp_sol.h" +// acados +#include "acados/utils/types.h" + + + +typedef struct d_ocp_qp_dim ocp_qp_dims; +typedef struct d_ocp_qp ocp_qp_in; +typedef struct d_ocp_qp_sol ocp_qp_out; +typedef struct d_ocp_qp_res ocp_qp_res; +typedef struct d_ocp_qp_res_ws ocp_qp_res_ws; + + + +#ifndef QP_SOLVER_CONFIG_ +#define QP_SOLVER_CONFIG_ +typedef struct +{ + void (*dims_set)(void *config_, void *dims_, int stage, const char *field, int* value); + acados_size_t (*opts_calculate_size)(void *config, void *dims); + void *(*opts_assign)(void *config, void *dims, void *raw_memory); + void (*opts_initialize_default)(void *config, void *dims, void *opts); + void (*opts_update)(void *config, void *dims, void *opts); + void (*opts_set)(void *config_, void *opts_, const char *field, void* value); + acados_size_t (*memory_calculate_size)(void *config, void *dims, void *opts); + void *(*memory_assign)(void *config, void *dims, void *opts, void *raw_memory); + void (*memory_get)(void *config_, void *mem_, const char *field, void* value); + acados_size_t (*workspace_calculate_size)(void *config, void *dims, void *opts); + int (*evaluate)(void *config, void *qp_in, void *qp_out, void *opts, void *mem, void *work); + void (*eval_sens)(void *config, void *qp_in, void *qp_out, void *opts, void *mem, void *work); +} qp_solver_config; +#endif + + + +typedef struct +{ + acados_size_t (*dims_calculate_size)(void *config, int N); + void *(*dims_assign)(void *config, int N, void *raw_memory); + void (*dims_set)(void *config, void *dims_, int stage, const char *field, int* value); + void (*dims_get)(void *config, void *dims, const char *field, void* value); + // TODO add config everywhere !!!!! + acados_size_t (*opts_calculate_size)(void *dims); + void *(*opts_assign)(void *dims, void *raw_memory); + void (*opts_initialize_default)(void *dims, void *opts); + void (*opts_update)(void *dims, void *opts); + void (*opts_set)(void *opts_, const char *field, void* value); + acados_size_t (*memory_calculate_size)(void *dims, void *opts); + void *(*memory_assign)(void *dims, void *opts, void *raw_memory); + void (*memory_get)(void *config, void *mem, const char *field, void* value); + acados_size_t (*workspace_calculate_size)(void *dims, void *opts); + int (*condensing)(void *qp_in, void *qp_out, void *opts, void *mem, void *work); + int (*condensing_rhs)(void *qp_in, void *qp_out, void *opts, void *mem, void *work); + int (*expansion)(void *qp_in, void *qp_out, void *opts, void *mem, void *work); +} ocp_qp_xcond_config; + + + +/// Struct containing metrics of the qp solver. +#ifndef QP_INFO_ +#define QP_INFO_ +typedef struct +{ + double solve_QP_time; + double condensing_time; + double interface_time; + double total_time; + int num_iter; + int t_computed; +} qp_info; +#endif + + + +/* config */ +// +acados_size_t ocp_qp_solver_config_calculate_size(); +// +qp_solver_config *ocp_qp_solver_config_assign(void *raw_memory); +// +acados_size_t ocp_qp_condensing_config_calculate_size(); +// +ocp_qp_xcond_config *ocp_qp_condensing_config_assign(void *raw_memory); + + +/* dims */ +// +acados_size_t ocp_qp_dims_calculate_size(int N); +// +ocp_qp_dims *ocp_qp_dims_assign(int N, void *raw_memory); +// +void ocp_qp_dims_set(void *config_, void *dims, int stage, const char *field, int* value); +// +void ocp_qp_dims_get(void *config_, void *dims, int stage, const char *field, int* value); + + +/* in */ +// +acados_size_t ocp_qp_in_calculate_size(ocp_qp_dims *dims); +// +ocp_qp_in *ocp_qp_in_assign(ocp_qp_dims *dims, void *raw_memory); + + +/* out */ +// +acados_size_t ocp_qp_out_calculate_size(ocp_qp_dims *dims); +// +ocp_qp_out *ocp_qp_out_assign(ocp_qp_dims *dims, void *raw_memory); + +/* res */ +// +acados_size_t ocp_qp_res_calculate_size(ocp_qp_dims *dims); +// +ocp_qp_res *ocp_qp_res_assign(ocp_qp_dims *dims, void *raw_memory); +// +acados_size_t ocp_qp_res_workspace_calculate_size(ocp_qp_dims *dims); +// +ocp_qp_res_ws *ocp_qp_res_workspace_assign(ocp_qp_dims *dims, void *raw_memory); +// +void ocp_qp_res_compute(ocp_qp_in *qp_in, ocp_qp_out *qp_out, ocp_qp_res *qp_res, ocp_qp_res_ws *res_ws); +// +void ocp_qp_res_compute_nrm_inf(ocp_qp_res *qp_res, double res[4]); + + +/* misc */ +// +void ocp_qp_stack_slacks_dims(ocp_qp_dims *in, ocp_qp_dims *out); +// +void ocp_qp_stack_slacks(ocp_qp_in *in, ocp_qp_in *out); +// +void ocp_qp_compute_t(ocp_qp_in *qp_in, ocp_qp_out *qp_out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_QP_OCP_QP_COMMON_H_ diff --git a/third_party/acados/include/acados/ocp_qp/ocp_qp_common_frontend.h b/third_party/acados/include/acados/ocp_qp/ocp_qp_common_frontend.h new file mode 100644 index 000000000..50b80850c --- /dev/null +++ b/third_party/acados/include/acados/ocp_qp/ocp_qp_common_frontend.h @@ -0,0 +1,121 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_OCP_QP_OCP_QP_COMMON_FRONTEND_H_ +#define ACADOS_OCP_QP_OCP_QP_COMMON_FRONTEND_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/ocp_qp/ocp_qp_common.h" + +typedef struct +{ + int N; + int *nx; + int *nu; + int *nb; + int *nc; + double **A; + double **B; + double **b; + double **Q; + double **S; + double **R; + double **q; + double **r; + int **idxb; + double **lb; + double **ub; + double **Cx; + double **Cu; + double **lc; + double **uc; +} colmaj_ocp_qp_in; + +typedef struct +{ + double **x; + double **u; + double **pi; + double **lam; +} colmaj_ocp_qp_out; + +typedef struct +{ + double **res_r; + double **res_q; + double **res_ls; + double **res_us; + double **res_b; + double **res_d_lb; + double **res_d_ub; + double **res_d_lg; + double **res_d_ug; + double **res_d_ls; + double **res_d_us; + double **res_m_lb; + double **res_m_ub; + double **res_m_lg; + double **res_m_ug; + double **res_m_ls; + double **res_m_us; + double res_nrm_inf[4]; +} colmaj_ocp_qp_res; + +// +acados_size_t colmaj_ocp_qp_in_calculate_size(ocp_qp_dims *dims); +// +char *assign_colmaj_ocp_qp_in(ocp_qp_dims *dims, colmaj_ocp_qp_in **qp_in, void *ptr); +// +acados_size_t colmaj_ocp_qp_out_calculate_size(ocp_qp_dims *dims); +// +char *assign_colmaj_ocp_qp_out(ocp_qp_dims *dims, colmaj_ocp_qp_out **qp_out, void *ptr); +// +acados_size_t colmaj_ocp_qp_res_calculate_size(ocp_qp_dims *dims); +// +char *assign_colmaj_ocp_qp_res(ocp_qp_dims *dims, colmaj_ocp_qp_res **qp_res, void *ptr); +// +void convert_colmaj_to_ocp_qp_in(colmaj_ocp_qp_in *cm_qp_in, ocp_qp_in *qp_in); +// +void convert_ocp_qp_out_to_colmaj(ocp_qp_out *qp_out, colmaj_ocp_qp_out *cm_qp_out); +// +void convert_ocp_qp_res_to_colmaj(ocp_qp_res *qp_res, colmaj_ocp_qp_res *cm_qp_res); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_QP_OCP_QP_COMMON_FRONTEND_H_ diff --git a/third_party/acados/include/acados/ocp_qp/ocp_qp_full_condensing.h b/third_party/acados/include/acados/ocp_qp/ocp_qp_full_condensing.h new file mode 100644 index 000000000..14ac97bbf --- /dev/null +++ b/third_party/acados/include/acados/ocp_qp/ocp_qp_full_condensing.h @@ -0,0 +1,117 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_OCP_QP_OCP_QP_FULL_CONDENSING_H_ +#define ACADOS_OCP_QP_OCP_QP_FULL_CONDENSING_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// hpipm +#include "hpipm/include/hpipm_d_ocp_qp_red.h" +// acados +#include "acados/dense_qp/dense_qp_common.h" +#include "acados/ocp_qp/ocp_qp_common.h" +#include "acados/utils/types.h" + + + +typedef struct +{ + ocp_qp_dims *orig_dims; + ocp_qp_dims *red_dims; // dims of reduced qp + dense_qp_dims *fcond_dims; +} ocp_qp_full_condensing_dims; + + + +typedef struct ocp_qp_full_condensing_opts_ +{ + struct d_cond_qp_arg *hpipm_cond_opts; + struct d_ocp_qp_reduce_eq_dof_arg *hpipm_red_opts; +// dense_qp_dims *fcond_dims; // TODO(all): move to dims + int cond_hess; // 0 cond only rhs, 1 cond hess + rhs + int expand_dual_sol; // 0 primal sol only, 1 primal + dual sol + int ric_alg; + int mem_qp_in; // allocate qp_in in memory +} ocp_qp_full_condensing_opts; + + + +typedef struct ocp_qp_full_condensing_memory_ +{ + struct d_cond_qp_ws *hpipm_cond_work; + struct d_ocp_qp_reduce_eq_dof_ws *hpipm_red_work; + // in memory + dense_qp_in *fcond_qp_in; + dense_qp_out *fcond_qp_out; + ocp_qp_in *red_qp; // reduced qp + ocp_qp_out *red_sol; // reduced qp sol + // only pointer + ocp_qp_in *ptr_qp_in; + qp_info *qp_out_info; // info in fcond_qp_in + double time_qp_xcond; +} ocp_qp_full_condensing_memory; + + + +// +acados_size_t ocp_qp_full_condensing_opts_calculate_size(void *dims); +// +void *ocp_qp_full_condensing_opts_assign(void *dims, void *raw_memory); +// +void ocp_qp_full_condensing_opts_initialize_default(void *dims, void *opts_); +// +void ocp_qp_full_condensing_opts_update(void *dims, void *opts_); +// +void ocp_qp_full_condensing_opts_set(void *opts_, const char *field, void* value); +// +acados_size_t ocp_qp_full_condensing_memory_calculate_size(void *dims, void *opts_); +// +void *ocp_qp_full_condensing_memory_assign(void *dims, void *opts_, void *raw_memory); +// +acados_size_t ocp_qp_full_condensing_workspace_calculate_size(void *dims, void *opts_); +// +int ocp_qp_full_condensing(void *in, void *out, void *opts, void *mem, void *work); +// +int ocp_qp_full_expansion(void *in, void *out, void *opts, void *mem, void *work); +// +void ocp_qp_full_condensing_config_initialize_default(void *config_); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_QP_OCP_QP_FULL_CONDENSING_H_ diff --git a/third_party/acados/include/acados/ocp_qp/ocp_qp_hpipm.h b/third_party/acados/include/acados/ocp_qp/ocp_qp_hpipm.h new file mode 100644 index 000000000..84e874863 --- /dev/null +++ b/third_party/acados/include/acados/ocp_qp/ocp_qp_hpipm.h @@ -0,0 +1,100 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_OCP_QP_OCP_QP_HPIPM_H_ +#define ACADOS_OCP_QP_OCP_QP_HPIPM_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// hpipm +#include "hpipm/include/hpipm_d_ocp_qp_ipm.h" +// acados +#include "acados/ocp_qp/ocp_qp_common.h" +#include "acados/utils/types.h" + + + +// struct of arguments to the solver +// TODO(roversch): why not make this a typedef of the underlying struct? +typedef struct ocp_qp_hpipm_opts_ +{ + struct d_ocp_qp_ipm_arg *hpipm_opts; +} ocp_qp_hpipm_opts; + + + +// TODO(roversch): why not make this a typedef of the underlying struct? +// struct of the solver memory +typedef struct ocp_qp_hpipm_memory_ +{ + struct d_ocp_qp_ipm_ws *hpipm_workspace; + double time_qp_solver_call; + int iter; + +} ocp_qp_hpipm_memory; + + + +// +acados_size_t ocp_qp_hpipm_opts_calculate_size(void *config, void *dims); +// +void *ocp_qp_hpipm_opts_assign(void *config, void *dims, void *raw_memory); +// +void ocp_qp_hpipm_opts_initialize_default(void *config, void *dims, void *opts_); +// +void ocp_qp_hpipm_opts_update(void *config, void *dims, void *opts_); +// +void ocp_qp_hpipm_opts_set(void *config_, void *opts_, const char *field, void *value); +// +acados_size_t ocp_qp_hpipm_memory_calculate_size(void *config, void *dims, void *opts_); +// +void *ocp_qp_hpipm_memory_assign(void *config, void *dims, void *opts_, void *raw_memory); +// +acados_size_t ocp_qp_hpipm_workspace_calculate_size(void *config, void *dims, void *opts_); +// +int ocp_qp_hpipm(void *config, void *qp_in, void *qp_out, void *opts_, void *mem_, void *work_); +// +void ocp_qp_hpipm_eval_sens(void *config, void *qp_in, void *qp_out, void *opts_, void *mem_, void *work_); +// +void ocp_qp_hpipm_config_initialize_default(void *config); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_QP_OCP_QP_HPIPM_H_ diff --git a/third_party/acados/include/acados/ocp_qp/ocp_qp_hpmpc.h b/third_party/acados/include/acados/ocp_qp/ocp_qp_hpmpc.h new file mode 100644 index 000000000..37d1c0a33 --- /dev/null +++ b/third_party/acados/include/acados/ocp_qp/ocp_qp_hpmpc.h @@ -0,0 +1,129 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_OCP_QP_OCP_QP_HPMPC_H_ +#define ACADOS_OCP_QP_OCP_QP_HPMPC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/ocp_qp/ocp_qp_common.h" +#include "acados/utils/types.h" + +typedef enum hpmpc_options_t_ { HPMPC_DEFAULT_ARGUMENTS } hpmpc_options_t; + +typedef struct ocp_qp_hpmpc_opts_ +{ + double tol; + int max_iter; + double mu0; + double alpha_min; + int warm_start; + int N2; // horizion length of the partially condensed problem + + // partial tightening + double sigma_mu; + int N; + int M; +} ocp_qp_hpmpc_opts; + +// struct of the solver memory +typedef struct ocp_qp_hpmpc_memory_ +{ + struct blasfeo_dvec *hpi; + double *stats; + + // workspace + void *hpmpc_work; // raw workspace + + // partial tightening-specific (init of extra variables) + struct blasfeo_dvec *lam0; + struct blasfeo_dvec *ux0; + struct blasfeo_dvec *pi0; + struct blasfeo_dvec *t0; + + // 2. workspace + struct blasfeo_dmat *hsL; + struct blasfeo_dmat *hsric_work_mat; + struct blasfeo_dmat sLxM; + struct blasfeo_dmat sPpM; + + struct blasfeo_dvec *hsQx; + struct blasfeo_dvec *hsqx; + struct blasfeo_dvec *hstinv; + struct blasfeo_dvec *hsrq; + struct blasfeo_dvec *hsdux; + + struct blasfeo_dvec *hsdlam; + struct blasfeo_dvec *hsdt; + struct blasfeo_dvec *hsdpi; + struct blasfeo_dvec *hslamt; + + struct blasfeo_dvec *hsPb; + + void *work_ric; + + int out_iter; + + double time_qp_solver_call; + int iter; + +} ocp_qp_hpmpc_memory; + +acados_size_t ocp_qp_hpmpc_opts_calculate_size(void *config_, ocp_qp_dims *dims); +// +void *ocp_qp_hpmpc_opts_assign(void *config_, ocp_qp_dims *dims, void *raw_memory); +// +void ocp_qp_hpmpc_opts_initialize_default(void *config_, ocp_qp_dims *dims, void *opts_); +// +void ocp_qp_hpmpc_opts_update(void *config_, ocp_qp_dims *dims, void *opts_); +// +acados_size_t ocp_qp_hpmpc_memory_calculate_size(void *config_, ocp_qp_dims *dims, void *opts_); +// +void *ocp_qp_hpmpc_memory_assign(void *config_, ocp_qp_dims *dims, void *opts_, void *raw_memory); +// +acados_size_t ocp_qp_hpmpc_workspace_calculate_size(void *config_, ocp_qp_dims *dims, void *opts_); +// +int ocp_qp_hpmpc(void *config_, void *qp_in, void *qp_out, void *opts_, void *mem_, void *work_); +// +void ocp_qp_hpmpc_eval_sens(void *config_, void *qp_in, void *qp_out, void *opts_, void *mem_, void *work_); +// +void ocp_qp_hpmpc_config_initialize_default(void *config_); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_QP_OCP_QP_HPMPC_H_ diff --git a/third_party/acados/include/acados/ocp_qp/ocp_qp_ooqp.h b/third_party/acados/include/acados/ocp_qp/ocp_qp_ooqp.h new file mode 100644 index 000000000..e1b789b96 --- /dev/null +++ b/third_party/acados/include/acados/ocp_qp/ocp_qp_ooqp.h @@ -0,0 +1,146 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_OCP_QP_OCP_QP_OOQP_H_ +#define ACADOS_OCP_QP_OCP_QP_OOQP_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/ocp_qp/ocp_qp_common.h" +#include "acados/utils/types.h" + +enum ocp_qp_ooqp_termination_code +{ + SPARSE_SUCCESSFUL_TERMINATION = 0, + SPARSE_NOT_FINISHED, + SPARSE_MAX_ITS_EXCEEDED, + SPARSE_INFEASIBLE, + SPARSE_UNKNOWN +}; + +typedef struct ocp_qp_ooqp_opts_ +{ + int printLevel; + int useDiagonalWeights; // TODO(dimitris): implement option + int fixHessian; + int fixHessianSparsity; + int fixDynamics; + int fixDynamicsSparsity; + int fixInequalities; + int fixInequalitiesSparsity; +} ocp_qp_ooqp_opts; + +typedef struct ocp_qp_ooqp_workspace_ +{ + double *x; + double *gamma; + double *phi; + double *y; + double *z; + double *lambda; + double *pi; + double objectiveValue; + int *tmpInt; // temporary vector to sort indicies sparse matrices + double *tmpReal; // temporary vector to sort data of sparse matrices + // int ierr; +} ocp_qp_ooqp_workspace; + +typedef struct ocp_qp_ooqp_memory_ +{ + int firstRun; + double *c; + int nx; + int *irowQ; + int nnzQ; + int *jcolQ; + int *orderQ; + double *dQ; + double *xlow; + char *ixlow; + double *xupp; + char *ixupp; + int *irowA; + int nnzA; + int *jcolA; + int *orderA; + double *dA; + double *bA; + int my; + int *irowC; + int nnzC; + int *jcolC; + int *orderC; + double *dC; + double *clow; + int mz; + char *iclow; + double *cupp; + char *icupp; + int nnz; // max(nnzQ, nnzA, nnzC) + double time_qp_solver_call; + int iter; + +} ocp_qp_ooqp_memory; + +// +acados_size_t ocp_qp_ooqp_opts_calculate_size(void *config_, ocp_qp_dims *dims); +// +void *ocp_qp_ooqp_opts_assign(void *config_, ocp_qp_dims *dims, void *raw_memory); +// +void ocp_qp_ooqp_opts_initialize_default(void *config_, ocp_qp_dims *dims, void *opts_); +// +void ocp_qp_ooqp_opts_update(void *config_, ocp_qp_dims *dims, void *opts_); +// +acados_size_t ocp_qp_ooqp_memory_calculate_size(void *config_, ocp_qp_dims *dims, void *opts_); +// +void *ocp_qp_ooqp_memory_assign(void *config_, ocp_qp_dims *dims, void *opts_, void *raw_memory); +// +acados_size_t ocp_qp_ooqp_workspace_calculate_size(void *config_, ocp_qp_dims *dims, void *opts_); +// +int ocp_qp_ooqp(void *config_, ocp_qp_in *qp_in, ocp_qp_out *qp_out, void *opts_, void *memory_, + void *work_); +// +void ocp_qp_ooqp_destroy(void *mem_, void *work); +// +void ocp_qp_ooqp_eval_sens(void *config_, void *qp_in, void *qp_out, void *opts_, void *mem_, void *work_); +// +void ocp_qp_ooqp_config_initialize_default(void *config_); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_QP_OCP_QP_OOQP_H_ diff --git a/third_party/acados/include/acados/ocp_qp/ocp_qp_osqp.h b/third_party/acados/include/acados/ocp_qp/ocp_qp_osqp.h new file mode 100644 index 000000000..55321a46b --- /dev/null +++ b/third_party/acados/include/acados/ocp_qp/ocp_qp_osqp.h @@ -0,0 +1,105 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_OCP_QP_OCP_QP_OSQP_H_ +#define ACADOS_OCP_QP_OCP_QP_OSQP_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// osqp +#include "osqp/include/types.h" + +// acados +#include "acados/ocp_qp/ocp_qp_common.h" +#include "acados/utils/types.h" + +typedef struct ocp_qp_osqp_opts_ +{ + OSQPSettings *osqp_opts; +} ocp_qp_osqp_opts; + + +typedef struct ocp_qp_osqp_memory_ +{ + c_int first_run; + + c_float *q; + c_float *l; + c_float *u; + + c_int P_nnzmax; + c_int *P_i; + c_int *P_p; + c_float *P_x; + + c_int A_nnzmax; + c_int *A_i; + c_int *A_p; + c_float *A_x; + + OSQPData *osqp_data; + OSQPWorkspace *osqp_work; + + double time_qp_solver_call; + int iter; + +} ocp_qp_osqp_memory; + +acados_size_t ocp_qp_osqp_opts_calculate_size(void *config, void *dims); +// +void *ocp_qp_osqp_opts_assign(void *config, void *dims, void *raw_memory); +// +void ocp_qp_osqp_opts_initialize_default(void *config, void *dims, void *opts_); +// +void ocp_qp_osqp_opts_update(void *config, void *dims, void *opts_); +// +acados_size_t ocp_qp_osqp_memory_calculate_size(void *config, void *dims, void *opts_); +// +void *ocp_qp_osqp_memory_assign(void *config, void *dims, void *opts_, void *raw_memory); +// +acados_size_t ocp_qp_osqp_workspace_calculate_size(void *config, void *dims, void *opts_); +// +int ocp_qp_osqp(void *config, void *qp_in, void *qp_out, void *opts_, void *mem_, void *work_); +// +void ocp_qp_osqp_eval_sens(void *config_, void *qp_in, void *qp_out, void *opts_, void *mem_, void *work_); +// +void ocp_qp_osqp_config_initialize_default(void *config); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_QP_OCP_QP_OSQP_H_ diff --git a/third_party/acados/include/acados/ocp_qp/ocp_qp_partial_condensing.h b/third_party/acados/include/acados/ocp_qp/ocp_qp_partial_condensing.h new file mode 100644 index 000000000..b95a11114 --- /dev/null +++ b/third_party/acados/include/acados/ocp_qp/ocp_qp_partial_condensing.h @@ -0,0 +1,123 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_OCP_QP_OCP_QP_PARTIAL_CONDENSING_H_ +#define ACADOS_OCP_QP_OCP_QP_PARTIAL_CONDENSING_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// hpipm +#include "hpipm/include/hpipm_d_ocp_qp_red.h" +// acados +#include "acados/ocp_qp/ocp_qp_common.h" + + + +typedef struct +{ + ocp_qp_dims *orig_dims; + ocp_qp_dims *red_dims; // dims of reduced qp + ocp_qp_dims *pcond_dims; + int *block_size; + int N2; + int N2_bkp; +} ocp_qp_partial_condensing_dims; + + + +typedef struct ocp_qp_partial_condensing_opts_ +{ + struct d_part_cond_qp_arg *hpipm_pcond_opts; + struct d_ocp_qp_reduce_eq_dof_arg *hpipm_red_opts; +// ocp_qp_dims *pcond_dims; // TODO(all): move to dims +// int *block_size; + int N2; + int N2_bkp; +// int expand_dual_sol; // 0 primal sol only, 1 primal + dual sol + int ric_alg; + int mem_qp_in; // allocate qp_in in memory +} ocp_qp_partial_condensing_opts; + + + +typedef struct ocp_qp_partial_condensing_memory_ +{ + struct d_part_cond_qp_ws *hpipm_pcond_work; + struct d_ocp_qp_reduce_eq_dof_ws *hpipm_red_work; + // in memory + ocp_qp_in *pcond_qp_in; + ocp_qp_out *pcond_qp_out; + ocp_qp_in *red_qp; // reduced qp + ocp_qp_out *red_sol; // reduced qp sol + // only pointer + ocp_qp_in *ptr_qp_in; + ocp_qp_in *ptr_pcond_qp_in; + qp_info *qp_out_info; // info in pcond_qp_in + double time_qp_xcond; +} ocp_qp_partial_condensing_memory; + + + +// +acados_size_t ocp_qp_partial_condensing_opts_calculate_size(void *dims); +// +void *ocp_qp_partial_condensing_opts_assign(void *dims, void *raw_memory); +// +void ocp_qp_partial_condensing_opts_initialize_default(void *dims, void *opts_); +// +void ocp_qp_partial_condensing_opts_update(void *dims, void *opts_); +// +void ocp_qp_partial_condensing_opts_set(void *opts_, const char *field, void* value); +// +acados_size_t ocp_qp_partial_condensing_memory_calculate_size(void *dims, void *opts_); +// +void *ocp_qp_partial_condensing_memory_assign(void *dims, void *opts, void *raw_memory); +// +acados_size_t ocp_qp_partial_condensing_workspace_calculate_size(void *dims, void *opts_); +// +int ocp_qp_partial_condensing(void *in, void *out, void *opts, void *mem, void *work); +// +int ocp_qp_partial_expansion(void *in, void *out, void *opts, void *mem, void *work); +// +void ocp_qp_partial_condensing_config_initialize_default(void *config_); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_QP_OCP_QP_PARTIAL_CONDENSING_H_ diff --git a/third_party/acados/include/acados/ocp_qp/ocp_qp_qpdunes.h b/third_party/acados/include/acados/ocp_qp/ocp_qp_qpdunes.h new file mode 100644 index 000000000..348627c67 --- /dev/null +++ b/third_party/acados/include/acados/ocp_qp/ocp_qp_qpdunes.h @@ -0,0 +1,121 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_OCP_QP_OCP_QP_QPDUNES_H_ +#define ACADOS_OCP_QP_OCP_QP_QPDUNES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "qpDUNES.h" + +#include "acados/ocp_qp/ocp_qp_common.h" +#include "acados/utils/types.h" + +typedef enum qpdunes_options_t_ { + QPDUNES_DEFAULT_ARGUMENTS, + QPDUNES_LINEAR_MPC, // TODO(dimitris): partly implemented + QPDUNES_NONLINEAR_MPC, // TODO(dimitris): not implemented yet + QPDUNES_ACADO_SETTINGS +} qpdunes_options_t; + +typedef enum { QPDUNES_WITH_QPOASES, QPDUNES_WITH_CLIPPING } qpdunes_stage_qp_solver_t; + +typedef struct ocp_qp_qpdunes_opts_ +{ + qpOptions_t options; + qpdunes_stage_qp_solver_t stageQpSolver; + int warmstart; // warmstart = 0: all multipliers set to zero, warmstart = 1: use previous mult. + bool isLinearMPC; +} ocp_qp_qpdunes_opts; + +typedef struct ocp_qp_qpdunes_memory_ +{ + int firstRun; + int nx; + int nu; + int nz; + int nDmax; // max(dims->ng) + qpData_t qpData; + double time_qp_solver_call; + int iter; + +} ocp_qp_qpdunes_memory; + +typedef struct ocp_qp_qpdunes_workspace_ +{ + double *H; + double *Q; + double *R; + double *S; + double *g; + double *ABt; + double *b; + double *Ct; + double *lc; + double *uc; + double *zLow; + double *zUpp; +} ocp_qp_qpdunes_workspace; + +// +acados_size_t ocp_qp_qpdunes_opts_calculate_size(void *config_, ocp_qp_dims *dims); +// +void *ocp_qp_qpdunes_opts_assign(void *config_, ocp_qp_dims *dims, void *raw_memory); +// +void ocp_qp_qpdunes_opts_initialize_default(void *config_, ocp_qp_dims *dims, void *opts_); +// +void ocp_qp_qpdunes_opts_update(void *config_, ocp_qp_dims *dims, void *opts_); +// +acados_size_t ocp_qp_qpdunes_memory_calculate_size(void *config_, ocp_qp_dims *dims, void *opts_); +// +void *ocp_qp_qpdunes_memory_assign(void *config_, ocp_qp_dims *dims, void *opts_, void *raw_memory); +// +acados_size_t ocp_qp_qpdunes_workspace_calculate_size(void *config_, ocp_qp_dims *dims, void *opts_); +// +int ocp_qp_qpdunes(void *config_, ocp_qp_in *qp_in, ocp_qp_out *qp_out, void *opts_, void *memory_, + void *work_); +// +void ocp_qp_qpdunes_free_memory(void *mem_); +// +void ocp_qp_qpdunes_eval_sens(void *config_, void *qp_in, void *qp_out, void *opts_, void *mem_, void *work_); +// +void ocp_qp_qpdunes_config_initialize_default(void *config_); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_QP_OCP_QP_QPDUNES_H_ diff --git a/third_party/acados/include/acados/ocp_qp/ocp_qp_xcond_solver.h b/third_party/acados/include/acados/ocp_qp/ocp_qp_xcond_solver.h new file mode 100644 index 000000000..9d4f309bd --- /dev/null +++ b/third_party/acados/include/acados/ocp_qp/ocp_qp_xcond_solver.h @@ -0,0 +1,151 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_OCP_QP_OCP_QP_PARTIAL_CONDENSING_SOLVER_H_ +#define ACADOS_OCP_QP_OCP_QP_PARTIAL_CONDENSING_SOLVER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// acados +#include "acados/ocp_qp/ocp_qp_common.h" +#include "acados/utils/types.h" + + + +typedef struct +{ + ocp_qp_dims *orig_dims; + void *xcond_dims; +} ocp_qp_xcond_solver_dims; + + + +typedef struct ocp_qp_xcond_solver_opts_ +{ + void *xcond_opts; + void *qp_solver_opts; +} ocp_qp_xcond_solver_opts; + + + +typedef struct ocp_qp_xcond_solver_memory_ +{ + void *xcond_memory; + void *solver_memory; + void *xcond_qp_in; + void *xcond_qp_out; +} ocp_qp_xcond_solver_memory; + + + +typedef struct ocp_qp_xcond_solver_workspace_ +{ + void *xcond_work; + void *qp_solver_work; +} ocp_qp_xcond_solver_workspace; + + + +typedef struct +{ + acados_size_t (*dims_calculate_size)(void *config, int N); + ocp_qp_xcond_solver_dims *(*dims_assign)(void *config, int N, void *raw_memory); + void (*dims_set)(void *config_, ocp_qp_xcond_solver_dims *dims, int stage, const char *field, int* value); + acados_size_t (*opts_calculate_size)(void *config, ocp_qp_xcond_solver_dims *dims); + void *(*opts_assign)(void *config, ocp_qp_xcond_solver_dims *dims, void *raw_memory); + void (*opts_initialize_default)(void *config, ocp_qp_xcond_solver_dims *dims, void *opts); + void (*opts_update)(void *config, ocp_qp_xcond_solver_dims *dims, void *opts); + void (*opts_set)(void *config_, void *opts_, const char *field, void* value); + acados_size_t (*memory_calculate_size)(void *config, ocp_qp_xcond_solver_dims *dims, void *opts); + void *(*memory_assign)(void *config, ocp_qp_xcond_solver_dims *dims, void *opts, void *raw_memory); + void (*memory_get)(void *config_, void *mem_, const char *field, void* value); + acados_size_t (*workspace_calculate_size)(void *config, ocp_qp_xcond_solver_dims *dims, void *opts); + int (*evaluate)(void *config, ocp_qp_xcond_solver_dims *dims, ocp_qp_in *qp_in, ocp_qp_out *qp_out, void *opts, void *mem, void *work); + void (*eval_sens)(void *config, ocp_qp_xcond_solver_dims *dims, ocp_qp_in *param_qp_in, ocp_qp_out *sens_qp_out, void *opts, void *mem, void *work); + qp_solver_config *qp_solver; // either ocp_qp_solver or dense_solver + ocp_qp_xcond_config *xcond; +} ocp_qp_xcond_solver_config; // pcond - partial condensing or fcond - full condensing + + + +/* config */ +// +acados_size_t ocp_qp_xcond_solver_config_calculate_size(); +// +ocp_qp_xcond_solver_config *ocp_qp_xcond_solver_config_assign(void *raw_memory); + +/* dims */ +// +acados_size_t ocp_qp_xcond_solver_dims_calculate_size(void *config, int N); +// +ocp_qp_xcond_solver_dims *ocp_qp_xcond_solver_dims_assign(void *config, int N, void *raw_memory); +// +void ocp_qp_xcond_solver_dims_set_(void *config, ocp_qp_xcond_solver_dims *dims, int stage, const char *field, int* value); + +/* opts */ +// +acados_size_t ocp_qp_xcond_solver_opts_calculate_size(void *config, ocp_qp_xcond_solver_dims *dims); +// +void *ocp_qp_xcond_solver_opts_assign(void *config, ocp_qp_xcond_solver_dims *dims, void *raw_memory); +// +void ocp_qp_xcond_solver_opts_initialize_default(void *config, ocp_qp_xcond_solver_dims *dims, void *opts_); +// +void ocp_qp_xcond_solver_opts_update(void *config, ocp_qp_xcond_solver_dims *dims, void *opts_); +// +void ocp_qp_xcond_solver_opts_set_(void *config_, void *opts_, const char *field, void* value); + +/* memory */ +// +acados_size_t ocp_qp_xcond_solver_memory_calculate_size(void *config, ocp_qp_xcond_solver_dims *dims, void *opts_); +// +void *ocp_qp_xcond_solver_memory_assign(void *config, ocp_qp_xcond_solver_dims *dims, void *opts_, void *raw_memory); + +/* workspace */ +// +acados_size_t ocp_qp_xcond_solver_workspace_calculate_size(void *config, ocp_qp_xcond_solver_dims *dims, void *opts_); + +/* config */ +// +int ocp_qp_xcond_solver(void *config, ocp_qp_xcond_solver_dims *dims, ocp_qp_in *qp_in, ocp_qp_out *qp_out, void *opts_, void *mem_, void *work_); + +// +void ocp_qp_xcond_solver_config_initialize_default(void *config_); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_OCP_QP_OCP_QP_PARTIAL_CONDENSING_SOLVER_H_ diff --git a/third_party/acados/include/acados/sim/sim_collocation_utils.h b/third_party/acados/include/acados/sim/sim_collocation_utils.h new file mode 100644 index 000000000..40a0b1c0c --- /dev/null +++ b/third_party/acados/include/acados/sim/sim_collocation_utils.h @@ -0,0 +1,100 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_SIM_SIM_COLLOCATION_UTILS_H_ +#define ACADOS_SIM_SIM_COLLOCATION_UTILS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/utils/types.h" + + + +// enum Newton_type_collocation +// { +// exact = 0, +// simplified_in, +// simplified_inis +// }; + + + +// typedef struct +// { +// enum Newton_type_collocation type; +// double *eig; +// double *low_tria; +// bool single; +// bool freeze; + +// double *transf1; +// double *transf2; + +// double *transf1_T; +// double *transf2_T; +// } Newton_scheme; + + +typedef enum +{ + GAUSS_LEGENDRE, + GAUSS_RADAU_IIA, +} sim_collocation_type; + + +// +// acados_size_t gauss_legendre_nodes_work_calculate_size(int ns); +// +// void gauss_legendre_nodes(int ns, double *nodes, void *raw_memory); +// +// acados_size_t gauss_simplified_work_calculate_size(int ns); +// // +// void gauss_simplified(int ns, Newton_scheme *scheme, void *work); +// +acados_size_t butcher_tableau_work_calculate_size(int ns); +// +// void calculate_butcher_tableau_from_nodes(int ns, double *nodes, double *b, double *A, void *work); +// +void calculate_butcher_tableau(int ns, sim_collocation_type collocation_type, double *c_vec, + double *b_vec, double *A_mat, void *work); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_SIM_SIM_COLLOCATION_UTILS_H_ diff --git a/third_party/acados/include/acados/sim/sim_common.h b/third_party/acados/include/acados/sim/sim_common.h new file mode 100644 index 000000000..1838d76f8 --- /dev/null +++ b/third_party/acados/include/acados/sim/sim_common.h @@ -0,0 +1,222 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_SIM_SIM_COMMON_H_ +#define ACADOS_SIM_SIM_COMMON_H_ + +#include + +#include "acados/sim/sim_collocation_utils.h" +#include "acados/utils/timing.h" +#include "acados/utils/types.h" + +#include "acados/utils/external_function_generic.h" + +// maximum number of integration stages +#define NS_MAX 15 + + + +typedef enum +{ + // ERK and LIFTED_ERK + EXPL_ODE_FUN, + EXPL_ODE_HES, // wrt x and u ??? + EXPL_VDE_FOR, + EXPL_VDE_ADJ, + // IRK + IMPL_ODE_FUN, + IMPL_ODE_FUN_JAC_X_XDOT, + IMPL_ODE_JAC_X_XDOT_U, + IMPL_ODE_FUN_JAC_X_XDOT_U, + IMPL_ODE_HESS, + // gnsf + PHI_FUN, + PHI_FUN_JAC_Y, + PHI_JAC_Y_UHAT, + LO_FUN, + GET_GNSF_MATRICES +} sim_function_t; + + + +typedef struct +{ + void *dims; + + double *x; // x[NX] - initial state value for simulation + double *u; // u[NU] - control - constant over simulation time + + double *S_forw; // forward seed [Sx, Su] + double *S_adj; // backward seed + + bool identity_seed; // indicating if S_forw = [eye(nx), zeros(nx x nu)] + + void *model; + + double T; // simulation time + +} sim_in; + + + +typedef struct +{ + double CPUtime; // in seconds + double LAtime; // in seconds + double ADtime; // in seconds + +} sim_info; + + + +typedef struct +{ + double *xn; // xn[NX] + double *S_forw; // S_forw[NX*(NX+NU)] + double *S_adj; // + double *S_hess; // + + double *zn; // z - algebraic variables - reported at start of simulation interval + double *S_algebraic; // sensitivities of reported value of algebraic variables w.r.t. + // initial stat & control (x_n,u) + + double *grad; // gradient correction + + sim_info *info; + +} sim_out; + + + +typedef struct +{ + int ns; // number of integration stages + + int num_steps; + int num_forw_sens; + + int tableau_size; // check that is consistent with ns + // only update when butcher tableau is changed + // kind of private -> no setter! + double *A_mat; + double *c_vec; + double *b_vec; + + bool sens_forw; + bool sens_adj; + bool sens_hess; + + bool output_z; // 1 -- if zn should be computed + bool sens_algebraic; // 1 -- if S_algebraic should be computed + bool exact_z_output; // 1 -- if z, S_algebraic should be computed exactly, extra Newton iterations + sim_collocation_type collocation_type; + + // for explicit integrators: newton_iter == 0 && scheme == NULL + // && jac_reuse=false + int newton_iter; + bool jac_reuse; + // Newton_scheme *scheme; + + // workspace + void *work; + +} sim_opts; + + + +typedef struct +{ + int (*evaluate)(void *config_, sim_in *in, sim_out *out, void *opts, void *mem, void *work); + int (*precompute)(void *config_, sim_in *in, sim_out *out, void *opts, void *mem, void *work); + // opts + acados_size_t (*opts_calculate_size)(void *config_, void *dims); + void *(*opts_assign)(void *config_, void *dims, void *raw_memory); + void (*opts_initialize_default)(void *config_, void *dims, void *opts); + void (*opts_update)(void *config_, void *dims, void *opts); + void (*opts_set)(void *config_, void *opts_, const char *field, void *value); + void (*opts_get)(void *config_, void *opts_, const char *field, void *value); + // mem + acados_size_t (*memory_calculate_size)(void *config, void *dims, void *opts); + void *(*memory_assign)(void *config, void *dims, void *opts, void *raw_memory); + int (*memory_set)(void *config, void *dims, void *mem, const char *field, void *value); + int (*memory_set_to_zero)(void *config, void *dims, void *opts, void *mem, const char *field); + void (*memory_get)(void *config, void *dims, void *mem, const char *field, void *value); + // work + acados_size_t (*workspace_calculate_size)(void *config, void *dims, void *opts); + // model + acados_size_t (*model_calculate_size)(void *config, void *dims); + void *(*model_assign)(void *config, void *dims, void *raw_memory); + int (*model_set)(void *model, const char *field, void *value); + // config + void (*config_initialize_default)(void *config); + // dims + acados_size_t (*dims_calculate_size)(); + void *(*dims_assign)(void *config, void *raw_memory); + void (*dims_set)(void *config, void *dims, const char *field, const int *value); + void (*dims_get)(void *config, void *dims, const char *field, int *value); + +} sim_config; + + + +/* config */ +// +acados_size_t sim_config_calculate_size(); +// +sim_config *sim_config_assign(void *raw_memory); + +/* in */ +// +acados_size_t sim_in_calculate_size(void *config, void *dims); +// +sim_in *sim_in_assign(void *config, void *dims, void *raw_memory); +// +int sim_in_set_(void *config_, void *dims_, sim_in *in, const char *field, void *value); + +/* out */ +// +acados_size_t sim_out_calculate_size(void *config, void *dims); +// +sim_out *sim_out_assign(void *config, void *dims, void *raw_memory); +// +int sim_out_get_(void *config, void *dims, sim_out *out, const char *field, void *value); + +/* opts */ +// +void sim_opts_set_(sim_opts *opts, const char *field, void *value); +// +void sim_opts_get_(sim_config *config, sim_opts *opts, const char *field, void *value); + +#endif // ACADOS_SIM_SIM_COMMON_H_ diff --git a/third_party/acados/include/acados/sim/sim_erk_integrator.h b/third_party/acados/include/acados/sim/sim_erk_integrator.h new file mode 100644 index 000000000..24a00c707 --- /dev/null +++ b/third_party/acados/include/acados/sim/sim_erk_integrator.h @@ -0,0 +1,143 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_SIM_SIM_ERK_INTEGRATOR_H_ +#define ACADOS_SIM_SIM_ERK_INTEGRATOR_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/sim/sim_common.h" +#include "acados/utils/types.h" + + + +typedef struct +{ + int nx; + int nu; + int nz; +} sim_erk_dims; + + + +typedef struct +{ + /* external functions */ + // explicit ode + external_function_generic *expl_ode_fun; + // hessian explicit ode + external_function_generic *expl_ode_hes; + // forward explicit vde + external_function_generic *expl_vde_for; + // adjoint explicit vde + external_function_generic *expl_vde_adj; + +} erk_model; + + + +typedef struct +{ + // memory + double time_sim; + double time_ad; + double time_la; + + // workspace structs +} sim_erk_memory; + + + +typedef struct +{ + // workspace mem + double *rhs_forw_in; // x + S + p + + double *K_traj; // (stages*nX) or (steps*stages*nX) for adj + double *out_forw_traj; // S or (steps+1)*nX for adj + + double *rhs_adj_in; + double *out_adj_tmp; + double *adj_traj; + +} sim_erk_workspace; + + + +// dims +acados_size_t sim_erk_dims_calculate_size(); +void *sim_erk_dims_assign(void *config_, void *raw_memory); +void sim_erk_dims_set(void *config_, void *dims_, const char *field, const int* value); +void sim_erk_dims_get(void *config_, void *dims_, const char *field, int* value); + +// model +acados_size_t sim_erk_model_calculate_size(void *config, void *dims); +void *sim_erk_model_assign(void *config, void *dims, void *raw_memory); +int sim_erk_model_set(void *model, const char *field, void *value); + +// opts +acados_size_t sim_erk_opts_calculate_size(void *config, void *dims); +// +void sim_erk_opts_update(void *config_, void *dims, void *opts_); +// +void *sim_erk_opts_assign(void *config, void *dims, void *raw_memory); +// +void sim_erk_opts_initialize_default(void *config, void *dims, void *opts_); +// +void sim_erk_opts_set(void *config_, void *opts_, const char *field, void *value); + + +// memory +acados_size_t sim_erk_memory_calculate_size(void *config, void *dims, void *opts_); +// +void *sim_erk_memory_assign(void *config, void *dims, void *opts_, void *raw_memory); +// +int sim_erk_memory_set(void *config_, void *dims_, void *mem_, const char *field, void *value); + + +// workspace +acados_size_t sim_erk_workspace_calculate_size(void *config, void *dims, void *opts_); + +// +int sim_erk(void *config, sim_in *in, sim_out *out, void *opts_, void *mem_, void *work_); +// +void sim_erk_config_initialize_default(void *config); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_SIM_SIM_ERK_INTEGRATOR_H_ diff --git a/third_party/acados/include/acados/sim/sim_gnsf.h b/third_party/acados/include/acados/sim/sim_gnsf.h new file mode 100644 index 000000000..5524b384e --- /dev/null +++ b/third_party/acados/include/acados/sim/sim_gnsf.h @@ -0,0 +1,367 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_SIM_SIM_GNSF_H_ +#define ACADOS_SIM_SIM_GNSF_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#include "acados/utils/timing.h" +#include "acados/utils/types.h" +#include "acados/sim/sim_common.h" + +#include "blasfeo/include/blasfeo_common.h" +#include "blasfeo/include/blasfeo_d_aux.h" +#include "blasfeo/include/blasfeo_d_aux_ext_dep.h" +#include "blasfeo/include/blasfeo_d_blas.h" +#include "blasfeo/include/blasfeo_d_kernel.h" +#include "blasfeo/include/blasfeo_i_aux_ext_dep.h" +#include "blasfeo/include/blasfeo_target.h" + +/* +GNSF - Generalized Nonlinear Static Feedback Model +has the following form +https://github.com/acados/acados/files/3359595/gnsf_structure_blo.pdf + +Details on the algorithm can be found in master thesis of Jonathan Frey, +which presents a slightly different format without the terms B_LO, c_LO. +https://github.com/acados/acados/files/2318322/gnsf_structure.pdf +https://cdn.syscop.de/publications/Frey2018.pdf +https://cdn.syscop.de/publications/Frey2019.pdf +*/ + +typedef struct +{ + int nx; // total number of differential states + int nu; // total number of inputs + int nz; // total number of algebraic states + int nx1; // number of differential states in NSF part + int nz1; // number of algebraic states in NSF part + int n_out; // output dimension of phi + int ny; // dimension of first input of phi + int nuhat; // dimension of second input of phi + +} sim_gnsf_dims; + + + +typedef struct +{ + /* external functions */ + // phi: nonlinearity function + external_function_generic *phi_fun; + external_function_generic *phi_fun_jac_y; + external_function_generic *phi_jac_y_uhat; + + // f_lo: linear output function + external_function_generic *f_lo_fun_jac_x1_x1dot_u_z; + + // to import model matrices + external_function_generic *get_gnsf_matrices; + + // flag indicating, if model defining matrices are imported via external (casadi) function, + // [default]: true -> auto; + bool auto_import_gnsf; + + // booleans from structure detection + bool nontrivial_f_LO; // indicates if f_LO is constant zero function + bool fully_linear; // indicates if model is fully linear LOS + + /* model defining matrices */ + // TODO: add setters to set manually + double *A; + double *B; + double *C; + double *E; + + double *L_x; + double *L_xdot; + double *L_z; + double *L_u; + + double *A_LO; + double *B_LO; + double *E_LO; + + /* constant vector */ + double *c; + double *c_LO; + + // permutation vector - to have GNSF order of x, z within sim_gnsf only + int *ipiv_x; + int *ipiv_z; + + double *ipiv_x_double; + double *ipiv_z_double; + +} gnsf_model; + + + +// pre_workspace - workspace used in the precomputation phase +typedef struct +{ + struct blasfeo_dmat E11; + struct blasfeo_dmat E12; + struct blasfeo_dmat E21; + struct blasfeo_dmat E22; + + struct blasfeo_dmat A1; + struct blasfeo_dmat A2; + struct blasfeo_dmat B1; + struct blasfeo_dmat B2; + struct blasfeo_dmat C1; + struct blasfeo_dmat C2; + + struct blasfeo_dmat AA1; + struct blasfeo_dmat AA2; + struct blasfeo_dmat BB1; + struct blasfeo_dmat BB2; + struct blasfeo_dmat CC1; + struct blasfeo_dmat CC2; + struct blasfeo_dmat DD1; + struct blasfeo_dmat DD2; + struct blasfeo_dmat EE1; + struct blasfeo_dmat EE2; + + struct blasfeo_dmat QQ1; + + struct blasfeo_dmat LLZ; + struct blasfeo_dmat LLx; + struct blasfeo_dmat LLK; + + int *ipivEE1; // index of pivot vector + int *ipivEE2; + int *ipivQQ1; + + // for algebraic sensitivity propagation + struct blasfeo_dmat Q1; + + // for constant term in NSF + struct blasfeo_dvec cc1; + struct blasfeo_dvec cc2; + +} gnsf_pre_workspace; + + + +// workspace +typedef struct +{ + double *Z_work; // used to perform computations to get out->zn + + int *ipiv; // index of pivot vector + + struct blasfeo_dvec *vv_traj; + struct blasfeo_dvec *yy_traj; + struct blasfeo_dmat *f_LO_jac_traj; + + struct blasfeo_dvec K2_val; + struct blasfeo_dvec x0_traj; + struct blasfeo_dvec res_val; + struct blasfeo_dvec u0; + struct blasfeo_dvec lambda; + struct blasfeo_dvec lambda_old; + + struct blasfeo_dvec yyu; + struct blasfeo_dvec yyss; + + struct blasfeo_dvec K1_val; + struct blasfeo_dvec f_LO_val; + struct blasfeo_dvec x1_stage_val; + struct blasfeo_dvec Z1_val; + + struct blasfeo_dvec K1u; + struct blasfeo_dvec Zu; + struct blasfeo_dvec ALOtimesx02; + struct blasfeo_dvec BLOtimesu0; + + struct blasfeo_dvec uhat; + + struct blasfeo_dmat J_r_vv; + struct blasfeo_dmat J_r_x1u; + + struct blasfeo_dmat dK1_dx1; + struct blasfeo_dmat dK1_du; + struct blasfeo_dmat dZ_dx1; + struct blasfeo_dmat dZ_du; + struct blasfeo_dmat J_G2_K1; + + struct blasfeo_dmat dK2_dx1; + struct blasfeo_dmat dK2_dvv; + struct blasfeo_dmat dxf_dwn; + struct blasfeo_dmat S_forw_new; + struct blasfeo_dmat S_algebraic_aux; + + struct blasfeo_dmat dPsi_dvv; + struct blasfeo_dmat dPsi_dx; + struct blasfeo_dmat dPsi_du; + + struct blasfeo_dmat dPHI_dyuhat; + struct blasfeo_dvec z0; + + // memory only available if (opts->sens_algebraic) + // struct blasfeo_dvec y_one_stage; + // struct blasfeo_dvec x0dot_1; + // struct blasfeo_dmat dz10_dx1u; // (nz1) * (nx1+nu); + // struct blasfeo_dmat dr0_dvv0; // (n_out * n_out) + // struct blasfeo_dmat f_LO_jac0; // (nx2+nz2) * (2*nx1 + nz1 + nu) + // struct blasfeo_dmat sens_z2_rhs; // (nx2 + nz2) * (nx1 + nu) + // int *ipiv_vv0; + +} gnsf_workspace; + + + +// memory +typedef struct +{ + bool first_call; + + // simulation time for one step + double dt; + + // (scaled) butcher table + double *A_dt; + double *b_dt; + double *c_butcher; + + // value used to initialize integration variables - corresponding to value of phi + double *phi_guess; // n_out + + struct blasfeo_dmat S_forw; + struct blasfeo_dmat S_algebraic; + + // precomputed matrices + struct blasfeo_dmat KKv; + struct blasfeo_dmat KKx; + struct blasfeo_dmat KKu; + + struct blasfeo_dmat YYv; + struct blasfeo_dmat YYx; + struct blasfeo_dmat YYu; + + struct blasfeo_dmat ZZv; + struct blasfeo_dmat ZZx; + struct blasfeo_dmat ZZu; + + struct blasfeo_dmat ALO; + struct blasfeo_dmat BLO; + struct blasfeo_dmat M2_LU; + int *ipivM2; + + struct blasfeo_dmat dK2_dx2; + struct blasfeo_dmat dK2_du; + struct blasfeo_dmat dx2f_dx2u; + + struct blasfeo_dmat Lu; + + // precomputed vectors for constant term in NSF + struct blasfeo_dvec KK0; + struct blasfeo_dvec YY0; + struct blasfeo_dvec ZZ0; + + // for algebraic sensitivities only; + // struct blasfeo_dmat *Z0x; + // struct blasfeo_dmat *Z0u; + // struct blasfeo_dmat *Z0v; + + // struct blasfeo_dmat *Y0x; + // struct blasfeo_dmat *Y0u; + // struct blasfeo_dmat *Y0v; + + // struct blasfeo_dmat *K0x; + // struct blasfeo_dmat *K0u; + // struct blasfeo_dmat *K0v; + + // struct blasfeo_dmat *ELO_LU; + // int *ipiv_ELO; + // struct blasfeo_dmat *ELO_inv_ALO; + + // struct blasfeo_dmat *Lx; + // struct blasfeo_dmat *Lxdot; + // struct blasfeo_dmat *Lz; + + double time_sim; + double time_ad; + double time_la; + +} sim_gnsf_memory; + + + +// gnsf dims +acados_size_t sim_gnsf_dims_calculate_size(); +void *sim_gnsf_dims_assign(void *config_, void *raw_memory); + +// get & set functions +void sim_gnsf_dims_set(void *config_, void *dims_, const char *field, const int *value); +void sim_gnsf_dims_get(void *config_, void *dims_, const char *field, int* value); + +// opts +acados_size_t sim_gnsf_opts_calculate_size(void *config, void *dims); +void *sim_gnsf_opts_assign(void *config, void *dims, void *raw_memory); +void sim_gnsf_opts_initialize_default(void *config, void *dims, void *opts_); +void sim_gnsf_opts_update(void *config_, void *dims, void *opts_); +void sim_gnsf_opts_set(void *config_, void *opts_, const char *field, void *value); + +// model +acados_size_t sim_gnsf_model_calculate_size(void *config, void *dims_); +void *sim_gnsf_model_assign(void *config, void *dims_, void *raw_memory); +int sim_gnsf_model_set(void *model_, const char *field, void *value); + +// precomputation +int sim_gnsf_precompute(void *config_, sim_in *in, sim_out *out, void *opts_, void *mem_, + void *work_); + +// workspace & memory +acados_size_t sim_gnsf_workspace_calculate_size(void *config, void *dims_, void *args); +acados_size_t sim_gnsf_memory_calculate_size(void *config, void *dims_, void *opts_); +void *sim_gnsf_memory_assign(void *config, void *dims_, void *opts_, void *raw_memory); + +// interface +void sim_gnsf_config_initialize_default(void *config_); + +// integrator +int sim_gnsf(void *config, sim_in *in, sim_out *out, void *opts, void *mem_, void *work_); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_SIM_SIM_GNSF_H_ diff --git a/third_party/acados/include/acados/sim/sim_irk_integrator.h b/third_party/acados/include/acados/sim/sim_irk_integrator.h new file mode 100644 index 000000000..6851bacb3 --- /dev/null +++ b/third_party/acados/include/acados/sim/sim_irk_integrator.h @@ -0,0 +1,186 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_SIM_SIM_IRK_INTEGRATOR_H_ +#define ACADOS_SIM_SIM_IRK_INTEGRATOR_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/sim/sim_common.h" +#include "acados/utils/types.h" + +#include "blasfeo/include/blasfeo_common.h" + +typedef struct +{ + int nx; + int nu; + int nz; + +} sim_irk_dims; + + + +typedef struct +{ + /* external functions */ + // implicit fun - can either be fully implicit ode or dae + // - i.e. dae has z as additional last argument & nz > 0 + external_function_generic *impl_ode_fun; + // implicit ode & jac_x & jax_xdot & jac_z + external_function_generic *impl_ode_fun_jac_x_xdot_z; + // jax_x & jac_xdot & jac_u & jac_z of implicit ode + external_function_generic *impl_ode_jac_x_xdot_u_z; + // hessian of implicit ode: + external_function_generic *impl_ode_hess; +} irk_model; + + + +typedef struct +{ + struct blasfeo_dvec *rG; // residuals of G (nx*ns) + struct blasfeo_dvec *K; // internal K variables ((nx+nz)*ns) + struct blasfeo_dvec *xt; // temporary x + struct blasfeo_dvec *xn; // x at each integration step + struct blasfeo_dvec xtdot; // temporary xdot + + struct blasfeo_dvec *lambda; // adjoint sensitivities (nx + nu) + struct blasfeo_dvec *lambdaK; // auxiliary variable ((nx+nz)*ns) for adjoint propagation + + struct blasfeo_dmat df_dx; // temporary Jacobian of ode w.r.t x (nx+nz, nx) + struct blasfeo_dmat df_dxdot; // temporary Jacobian of ode w.r.t xdot (nx+nz, nx) + struct blasfeo_dmat df_du; // temporary Jacobian of ode w.r.t u (nx+nz, nu) + struct blasfeo_dmat df_dz; // temporary Jacobian of ode w.r.t z (nx+nz, nu) + + /* NOTE: the memory allocation corresponding to the following fields is CONDITIONAL */ + + // only allocated if (opts->sens_algebraic || opts->output_z) + int *ipiv_one_stage; // index of pivot vector (nx + nz) + double *Z_work; // used to perform computations to get out->zn (ns) + + // df_dxdotz, dk0_dxu, only allocated if (opts->sens_algebraic && opts->exact_z_output) + // used for algebraic sensitivity generation + struct blasfeo_dmat df_dxdotz; // temporary Jacobian of ode w.r.t. xdot,z (nx+nz, nx+nz); + struct blasfeo_dmat dk0_dxu; // intermediate result, (nx+nz, nx+nu) + + // dK_dxu: if (!opts->sens_hess) - single blasfeo_dmat that is reused + // if ( opts->sens_hess) - array of (num_steps) blasfeo_dmat + // to store intermediate results + struct blasfeo_dmat *dK_dxu; // jacobian of (K,Z) over x and u ((nx+nz)*ns, nx+nu); + + // S_forw: if (!opts->sens_hess) - single blasfeo_dmat that is reused + // if ( opts->sens_hess) - array of (num_steps + 1) blasfeo_dmat + // to store intermediate results + struct blasfeo_dmat *S_forw; // forward sensitivities (nx, nx+nu) + + // dG_dxu: if (!opts->sens_hess) - single blasfeo_dmat that is reused + // if ( opts->sens_hess) - array of blasfeo_dmat to store intermediate results + struct blasfeo_dmat *dG_dxu; // jacobian of G over x and u ((nx+nz)*ns, nx+nu) + + // dG_dK: if (!opts->sens_hess) - single blasfeo_dmat that is reused + // if ( opts->sens_hess) - array of blasfeo_dmat to store intermediate results + struct blasfeo_dmat *dG_dK; // jacobian of G over K ((nx+nz)*ns, (nx+nz)*ns) + + // ipiv: index of pivot vector + // if (!opts->sens_hess) - array (ns * (nx + nz)) that is reused + // if ( opts->sens_hess) - array (ns * (nx + nz)) * num_steps, to store all + // pivot vectors for dG_dxu + int *ipiv; // index of pivot vector + + // xn_traj, K_traj only available if( opts->sens_adj || opts->sens_hess ) + struct blasfeo_dvec *xn_traj; // xn trajectory + struct blasfeo_dvec *K_traj; // K trajectory + + /* the following variables are only available if (opts->sens_hess) */ + // For Hessian propagation + struct blasfeo_dmat Hess; // temporary Hessian (nx + nu, nx + nu) + // output of impl_ode_hess + struct blasfeo_dmat f_hess; // size: (nx + nu, nx + nu) + struct blasfeo_dmat dxkzu_dw0; // size (2*nx + nu + nz) x (nx + nu) + struct blasfeo_dmat tmp_dxkzu_dw0; // size (2*nx + nu + nz) x (nx + nu) + +} sim_irk_workspace; + + +typedef struct +{ + double *xdot; // xdot[NX] - initialization for state derivatives k within the integrator + double *z; // z[NZ] - initialization for algebraic variables z + + double time_sim; + double time_ad; + double time_la; +} sim_irk_memory; + + +// get & set functions +void sim_irk_dims_set(void *config_, void *dims_, const char *field, const int *value); +void sim_irk_dims_get(void *config_, void *dims_, const char *field, int* value); + +// dims +acados_size_t sim_irk_dims_calculate_size(); +void *sim_irk_dims_assign(void *config_, void *raw_memory); + +// model +acados_size_t sim_irk_model_calculate_size(void *config, void *dims); +void *sim_irk_model_assign(void *config, void *dims, void *raw_memory); +int sim_irk_model_set(void *model, const char *field, void *value); + +// opts +acados_size_t sim_irk_opts_calculate_size(void *config, void *dims); +void *sim_irk_opts_assign(void *config, void *dims, void *raw_memory); +void sim_irk_opts_initialize_default(void *config, void *dims, void *opts_); +void sim_irk_opts_update(void *config_, void *dims, void *opts_); +void sim_irk_opts_set(void *config_, void *opts_, const char *field, void *value); + +// memory +acados_size_t sim_irk_memory_calculate_size(void *config, void *dims, void *opts_); +void *sim_irk_memory_assign(void *config, void *dims, void *opts_, void *raw_memory); +int sim_irk_memory_set(void *config_, void *dims_, void *mem_, const char *field, void *value); + +// workspace +acados_size_t sim_irk_workspace_calculate_size(void *config, void *dims, void *opts_); +void sim_irk_config_initialize_default(void *config); + +// main +int sim_irk(void *config, sim_in *in, sim_out *out, void *opts_, void *mem_, void *work_); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_SIM_SIM_IRK_INTEGRATOR_H_ diff --git a/third_party/acados/include/acados/sim/sim_lifted_irk_integrator.h b/third_party/acados/include/acados/sim/sim_lifted_irk_integrator.h new file mode 100644 index 000000000..8e476b0e2 --- /dev/null +++ b/third_party/acados/include/acados/sim/sim_lifted_irk_integrator.h @@ -0,0 +1,159 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_SIM_SIM_LIFTED_IRK_INTEGRATOR_H_ +#define ACADOS_SIM_SIM_LIFTED_IRK_INTEGRATOR_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/sim/sim_common.h" +#include "acados/utils/types.h" + +typedef struct +{ + int nx; + int nu; + int nz; +} sim_lifted_irk_dims; + + + +typedef struct +{ + /* external functions */ + // implicit ode + external_function_generic *impl_ode_fun; + // implicit ode & jax_x & jac_xdot & jac_u implicit ode + external_function_generic *impl_ode_fun_jac_x_xdot_u; + +} lifted_irk_model; + + + +typedef struct +{ + + struct blasfeo_dmat *J_temp_x; // temporary Jacobian of ode w.r.t x (nx, nx) + struct blasfeo_dmat *J_temp_xdot; // temporary Jacobian of ode w.r.t xdot (nx, nx) + struct blasfeo_dmat *J_temp_u; // temporary Jacobian of ode w.r.t u (nx, nu) + + struct blasfeo_dvec *rG; // residuals of G (nx*ns) + struct blasfeo_dvec *xt; // temporary x + struct blasfeo_dvec *xn; // x at each integration step (for evaluations) + struct blasfeo_dvec *xn_out; // x at each integration step (output) + struct blasfeo_dvec *dxn; // dx at each integration step + struct blasfeo_dvec *w; // stacked x and u + + int *ipiv; // index of pivot vector + +} sim_lifted_irk_workspace; + + + +typedef struct +{ + // memory for lifted integrators + struct blasfeo_dmat *S_forw; // forward sensitivities + struct blasfeo_dmat *JGK; // jacobian of G over K (nx*ns, nx*ns) + struct blasfeo_dmat *JGf; // jacobian of G over x and u (nx*ns, nx+nu); + struct blasfeo_dmat *JKf; // jacobian of K over x and u (nx*ns, nx+nu); + + struct blasfeo_dvec *K; // internal variables (nx*ns) + struct blasfeo_dvec *x; // states (nx) -- for expansion step + struct blasfeo_dvec *u; // controls (nu) -- for expansion step + + int update_sens; + + double time_sim; + double time_ad; + double time_la; + +} sim_lifted_irk_memory; + + + +/* dims */ +void sim_lifted_irk_dims_set(void *config_, void *dims_, const char *field, const int *value); +void sim_lifted_irk_dims_get(void *config_, void *dims_, const char *field, int* value); + +acados_size_t sim_lifted_irk_dims_calculate_size(); +// +void *sim_lifted_irk_dims_assign(void* config_, void *raw_memory); + +/* model */ +// +acados_size_t sim_lifted_irk_model_calculate_size(void *config, void *dims); +// +void *sim_lifted_irk_model_assign(void *config, void *dims, void *raw_memory); +// +int sim_lifted_irk_model_set(void *model_, const char *field, void *value); + +/* opts */ +// +acados_size_t sim_lifted_irk_opts_calculate_size(void *config, void *dims); +// +void *sim_lifted_irk_opts_assign(void *config, void *dims, void *raw_memory); +// +void sim_lifted_irk_opts_initialize_default(void *config, void *dims, void *opts_); +// +void sim_lifted_irk_opts_update(void *config_, void *dims, void *opts_); +// +void sim_lifted_irk_opts_set(void *config_, void *opts_, const char *field, void *value); + +/* memory */ +// +acados_size_t sim_lifted_irk_memory_calculate_size(void *config, void *dims, void *opts_); +// +void *sim_lifted_irk_memory_assign(void *config, void *dims, void *opts_, void *raw_memory); + +/* workspace */ +// +acados_size_t sim_lifted_irk_workspace_calculate_size(void *config, void *dims, void *opts_); +// +void sim_lifted_irk_config_initialize_default(void *config); + +/* solver */ +// +int sim_lifted_irk(void *config, sim_in *in, sim_out *out, void *opts_, + void *mem_, void *work_); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_SIM_SIM_LIFTED_IRK_INTEGRATOR_H_ diff --git a/third_party/acados/include/acados/utils/external_function_generic.h b/third_party/acados/include/acados/utils/external_function_generic.h new file mode 100644 index 000000000..021363f26 --- /dev/null +++ b/third_party/acados/include/acados/utils/external_function_generic.h @@ -0,0 +1,245 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_UTILS_EXTERNAL_FUNCTION_GENERIC_H_ +#define ACADOS_UTILS_EXTERNAL_FUNCTION_GENERIC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/utils/types.h" + +/************************************************ + * generic external function + ************************************************/ + +// type of arguments +typedef enum { + COLMAJ, + BLASFEO_DMAT, + BLASFEO_DVEC, + COLMAJ_ARGS, + BLASFEO_DMAT_ARGS, + BLASFEO_DVEC_ARGS, + IGNORE_ARGUMENT +} ext_fun_arg_t; + +struct colmaj_args +{ + double *A; + int lda; +}; + +struct blasfeo_dmat_args +{ + struct blasfeo_dmat *A; + int ai; + int aj; +}; + +struct blasfeo_dvec_args +{ + struct blasfeo_dvec *x; + int xi; +}; + +// prototype of an external function +typedef struct +{ + // public members (have to be before private ones) + void (*evaluate)(void *, ext_fun_arg_t *, void **, ext_fun_arg_t *, void **); + // private members + // ..... +} external_function_generic; + + + +/************************************************ + * generic external parametric function + ************************************************/ + +// prototype of a parametric external function +typedef struct +{ + // public members for core (have to be before private ones) + void (*evaluate)(void *, ext_fun_arg_t *, void **, ext_fun_arg_t *, void **); + // public members for interfaces + void (*get_nparam)(void *, int *); + void (*set_param)(void *, double *); + void (*set_param_sparse)(void *, int n_update, int *idx, double *); + // private members + void *ptr_ext_mem; // pointer to external memory + int (*fun)(void **, void **, void *); + double *p; // parameters + int np; // number of parameters + // ..... +} external_function_param_generic; + +// +acados_size_t external_function_param_generic_struct_size(); +// +void external_function_param_generic_set_fun(external_function_param_generic *fun, void *value); +// +acados_size_t external_function_param_generic_calculate_size(external_function_param_generic *fun, int np); +// +void external_function_param_generic_assign(external_function_param_generic *fun, void *mem); +// +void external_function_param_generic_wrapper(void *self, ext_fun_arg_t *type_in, void **in, ext_fun_arg_t *type_out, void **out); +// +void external_function_param_generic_get_nparam(void *self, int *np); +// +void external_function_param_generic_set_param(void *self, double *p); + + +/************************************************ + * casadi external function + ************************************************/ + +typedef struct +{ + // public members (have to be the same as in the prototype, and before the private ones) + void (*evaluate)(void *, ext_fun_arg_t *, void **, ext_fun_arg_t *, void **); + // private members + void *ptr_ext_mem; // pointer to external memory + int (*casadi_fun)(const double **, double **, int *, double *, void *); + int (*casadi_work)(int *, int *, int *, int *); + const int *(*casadi_sparsity_in)(int); + const int *(*casadi_sparsity_out)(int); + int (*casadi_n_in)(); + int (*casadi_n_out)(); + double **args; + double **res; + double *w; + int *iw; + int *args_size; // size of args[i] + int *res_size; // size of res[i] + int args_num; // number of args arrays + int args_size_tot; // total size of args arrays + int res_num; // number of res arrays + int res_size_tot; // total size of res arrays + int in_num; // number of input arrays + int out_num; // number of output arrays + int iw_size; // number of ints for worksapce + int w_size; // number of doubles for workspace +} external_function_casadi; + +// +acados_size_t external_function_casadi_struct_size(); +// +void external_function_casadi_set_fun(external_function_casadi *fun, void *value); +// +void external_function_casadi_set_work(external_function_casadi *fun, void *value); +// +void external_function_casadi_set_sparsity_in(external_function_casadi *fun, void *value); +// +void external_function_casadi_set_sparsity_out(external_function_casadi *fun, void *value); +// +void external_function_casadi_set_n_in(external_function_casadi *fun, void *value); +// +void external_function_casadi_set_n_out(external_function_casadi *fun, void *value); +// +acados_size_t external_function_casadi_calculate_size(external_function_casadi *fun); +// +void external_function_casadi_assign(external_function_casadi *fun, void *mem); +// +void external_function_casadi_wrapper(void *self, ext_fun_arg_t *type_in, void **in, + ext_fun_arg_t *type_out, void **out); + +/************************************************ + * casadi external parametric function + ************************************************/ + +typedef struct +{ + // public members for core (have to be the same as in the prototype, and before the private ones) + void (*evaluate)(void *, ext_fun_arg_t *, void **, ext_fun_arg_t *, void **); + // public members for interfaces + void (*get_nparam)(void *, int *); + void (*set_param)(void *, double *); + void (*set_param_sparse)(void *, int n_update, int *idx, double *); + // private members + void *ptr_ext_mem; // pointer to external memory + int (*casadi_fun)(const double **, double **, int *, double *, void *); + int (*casadi_work)(int *, int *, int *, int *); + const int *(*casadi_sparsity_in)(int); + const int *(*casadi_sparsity_out)(int); + int (*casadi_n_in)(); + int (*casadi_n_out)(); + double **args; + double **res; + double *w; + int *iw; + int *args_size; // size of args[i] + int *res_size; // size of res[i] + int args_num; // number of args arrays + int args_size_tot; // total size of args arrays + int res_num; // number of res arrays + int res_size_tot; // total size of res arrays + int in_num; // number of input arrays + int out_num; // number of output arrays + int iw_size; // number of ints for worksapce + int w_size; // number of doubles for workspace + int np; // number of parameters +} external_function_param_casadi; + +// +acados_size_t external_function_param_casadi_struct_size(); +// +void external_function_param_casadi_set_fun(external_function_param_casadi *fun, void *value); +// +void external_function_param_casadi_set_work(external_function_param_casadi *fun, void *value); +// +void external_function_param_casadi_set_sparsity_in(external_function_param_casadi *fun, void *value); +// +void external_function_param_casadi_set_sparsity_out(external_function_param_casadi *fun, void *value); +// +void external_function_param_casadi_set_n_in(external_function_param_casadi *fun, void *value); +// +void external_function_param_casadi_set_n_out(external_function_param_casadi *fun, void *value); +// +acados_size_t external_function_param_casadi_calculate_size(external_function_param_casadi *fun, int np); +// +void external_function_param_casadi_assign(external_function_param_casadi *fun, void *mem); +// +void external_function_param_casadi_wrapper(void *self, ext_fun_arg_t *type_in, void **in, + ext_fun_arg_t *type_out, void **out); +// +void external_function_param_casadi_get_nparam(void *self, int *np); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_UTILS_EXTERNAL_FUNCTION_GENERIC_H_ diff --git a/third_party/acados/include/acados/utils/math.h b/third_party/acados/include/acados/utils/math.h new file mode 100644 index 000000000..fe1da875f --- /dev/null +++ b/third_party/acados/include/acados/utils/math.h @@ -0,0 +1,105 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + +#ifndef ACADOS_UTILS_MATH_H_ +#define ACADOS_UTILS_MATH_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/utils/types.h" + +#if defined(__MABX2__) +double fmax(double a, double b); +#endif + +#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MAX(a,b) (((a)>(b))?(a):(b)) + +void dgemm_nn_3l(int m, int n, int k, double *A, int lda, double *B, int ldb, double *C, int ldc); +// void dgemv_n_3l(int m, int n, double *A, int lda, double *x, double *y); +// void dgemv_t_3l(int m, int n, double *A, int lda, double *x, double *y); +// void dcopy_3l(int n, double *x, int incx, double *y, int incy); +void daxpy_3l(int n, double da, double *dx, double *dy); +void dscal_3l(int n, double da, double *dx); +double twonormv(int n, double *ptrv); + +/* copies a matrix into another matrix */ +void dmcopy(int row, int col, double *ptrA, int lda, double *ptrB, int ldb); + +/* solution of a system of linear equations */ +void dgesv_3l(int n, int nrhs, double *A, int lda, int *ipiv, double *B, int ldb, int *info); + +/* matrix exponential */ +void expm(int row, double *A); + +int idamax_3l(int n, double *x); + +void dswap_3l(int n, double *x, int incx, double *y, int incy); + +void dger_3l(int m, int n, double alpha, double *x, int incx, double *y, int incy, double *A, + int lda); + +void dgetf2_3l(int m, int n, double *A, int lda, int *ipiv, int *info); + +void dlaswp_3l(int n, double *A, int lda, int k1, int k2, int *ipiv); + +void dtrsm_l_l_n_u_3l(int m, int n, double *A, int lda, double *B, int ldb); + +void dgetrs_3l(int n, int nrhs, double *A, int lda, int *ipiv, double *B, int ldb); + +void dgesv_3l(int n, int nrhs, double *A, int lda, int *ipiv, double *B, int ldb, int *info); + +double onenorm(int row, int col, double *ptrA); + +// double twonormv(int n, double *ptrv); + +void padeapprox(int m, int row, double *A); + +void expm(int row, double *A); + +// void d_compute_qp_size_ocp2dense_rev(int N, int *nx, int *nu, int *nb, int **hidxb, int *ng, +// int *nvd, int *ned, int *nbd, int *ngd); + +void acados_eigen_decomposition(int dim, double *A, double *V, double *d, double *e); + +double minimum_of_doubles(double *x, int n); + +void neville_algorithm(double xx, int n, double *x, double *Q, double *out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_UTILS_MATH_H_ diff --git a/third_party/acados/include/acados/utils/mem.h b/third_party/acados/include/acados/utils/mem.h new file mode 100644 index 000000000..7b9efc5ed --- /dev/null +++ b/third_party/acados/include/acados/utils/mem.h @@ -0,0 +1,113 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_UTILS_MEM_H_ +#define ACADOS_UTILS_MEM_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#include "types.h" + +// blasfeo +#include "blasfeo/include/blasfeo_d_aux.h" +#include "blasfeo/include/blasfeo_d_aux_ext_dep.h" + +// TODO(dimitris): probably does not belong here +typedef struct +{ + int (*fun)(void *); + acados_size_t (*calculate_args_size)(void *); + void *(*assign_args)(void *); + void (*initialize_default_args)(void *); + acados_size_t (*calculate_memory_size)(void *); + void *(*assign_memory)(void *); + acados_size_t (*calculate_workspace_size)(void *); +} module_solver; + +// make int counter of memory multiple of a number (typically 8 or 64) +void make_int_multiple_of(acados_size_t num, acados_size_t *size); + +// align char pointer to number (typically 8 for pointers and doubles, +// 64 for blasfeo structs) and return offset +int align_char_to(int num, char **c_ptr); + +// switch between malloc and calloc (for valgrinding) +void *acados_malloc(size_t nitems, acados_size_t size); + +// uses always calloc +void *acados_calloc(size_t nitems, acados_size_t size); + +// allocate vector of pointers to vectors of doubles and advance pointer +void assign_and_advance_double_ptrs(int n, double ***v, char **ptr); + +// allocate vector of pointers to vectors of ints and advance pointer +void assign_and_advance_int_ptrs(int n, int ***v, char **ptr); + +// allocate vector of pointers to strvecs and advance pointer +void assign_and_advance_blasfeo_dvec_structs(int n, struct blasfeo_dvec **sv, char **ptr); + +// allocate vector of pointers to strmats and advance pointer +void assign_and_advance_blasfeo_dmat_structs(int n, struct blasfeo_dmat **sm, char **ptr); + +// allocate vector of pointers to vector of pointers to strmats and advance pointer +void assign_and_advance_blasfeo_dmat_ptrs(int n, struct blasfeo_dmat ***sm, char **ptr); + +// allocate vector of chars and advance pointer +void assign_and_advance_char(int n, char **v, char **ptr); + +// allocate vector of ints and advance pointer +void assign_and_advance_int(int n, int **v, char **ptr); + +// allocate vector of bools and advance pointer +void assign_and_advance_bool(int n, bool **v, char **ptr); + +// allocate vector of doubles and advance pointer +void assign_and_advance_double(int n, double **v, char **ptr); + +// allocate strvec and advance pointer +void assign_and_advance_blasfeo_dvec_mem(int n, struct blasfeo_dvec *sv, char **ptr); + +// allocate strmat and advance pointer +void assign_and_advance_blasfeo_dmat_mem(int m, int n, struct blasfeo_dmat *sA, char **ptr); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_UTILS_MEM_H_ diff --git a/third_party/acados/include/acados/utils/print.h b/third_party/acados/include/acados/utils/print.h new file mode 100644 index 000000000..2993447db --- /dev/null +++ b/third_party/acados/include/acados/utils/print.h @@ -0,0 +1,109 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_UTILS_PRINT_H_ +#define ACADOS_UTILS_PRINT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/dense_qp/dense_qp_common.h" +#include "acados/ocp_nlp/ocp_nlp_common.h" +#include "acados/ocp_qp/ocp_qp_common.h" +#include "acados/ocp_qp/ocp_qp_common_frontend.h" +#include "acados/utils/types.h" + +// void print_matrix(char *file_name, const real_t *matrix, const int_t nrows, const int_t ncols); + +// void print_matrix_name(char *file_name, char *name, const real_t *matrix, const int_t nrows, +// const int_t ncols); + +// void print_int_matrix(char *file_name, const int_t *matrix, const int_t nrows, const int_t ncols); + +// void print_array(char *file_name, real_t *array, int_t size); + +// void print_int_array(char *file_name, const int_t *array, int_t size); + +void read_matrix(const char *file_name, real_t *array, const int_t nrows, const int_t ncols); + +void write_double_vector_to_txt(real_t *vec, int_t n, const char *fname); + +// ocp nlp +// TODO(andrea): inconsistent naming +void ocp_nlp_dims_print(ocp_nlp_dims *dims); +// TODO(andrea): inconsistent naming +void ocp_nlp_out_print(ocp_nlp_dims *dims, ocp_nlp_out *nlp_out); +// TODO(andrea): inconsistent naming +void ocp_nlp_res_print(ocp_nlp_dims *dims, ocp_nlp_res *nlp_res); + +// ocp qp +void print_ocp_qp_dims(ocp_qp_dims *dims); + +// void print_dense_qp_dims(dense_qp_dims *dims); + +void print_ocp_qp_in(ocp_qp_in *qp_in); + +void print_ocp_qp_out(ocp_qp_out *qp_out); + +// void print_ocp_qp_in_to_string(char string_out[], ocp_qp_in *qp_in); + +// void print_ocp_qp_out_to_string(char string_out[], ocp_qp_out *qp_out); + +void print_ocp_qp_res(ocp_qp_res *qp_res); + +// void print_colmaj_ocp_qp_in(colmaj_ocp_qp_in *qp); + +// void print_colmaj_ocp_qp_in_to_file(colmaj_ocp_qp_in *qp); + +// void print_colmaj_ocp_qp_out(char *filename, colmaj_ocp_qp_in *qp, colmaj_ocp_qp_out *out); + +void print_dense_qp_in(dense_qp_in *qp_in); + +void print_qp_info(qp_info *info); + +// void acados_warning(char warning_string[]); + +// void acados_error(char error_string[]); + +// void acados_not_implemented(char feature_string[]); + +// blasfeo +// void print_blasfeo_target(); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_UTILS_PRINT_H_ diff --git a/third_party/acados/include/acados/utils/strsep.h b/third_party/acados/include/acados/utils/strsep.h new file mode 100644 index 000000000..02f183559 --- /dev/null +++ b/third_party/acados/include/acados/utils/strsep.h @@ -0,0 +1,72 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_UTILS_STRSEP_H_ +#define ACADOS_UTILS_STRSEP_H_ + +#ifdef __cplusplus +#include +#define STD(x) std::x +namespace std +{ +#else +#include +#define STD(x) x +#endif + +char* strsep_acados(char** stringp, const char* delim) +{ + char* result; + + if ((stringp == NULL) || (*stringp == NULL)) return NULL; + + result = *stringp; + + while (**stringp && !STD(strchr)(delim, **stringp)) ++*stringp; + + if (**stringp) + *(*stringp)++ = '\0'; + else + *stringp = NULL; + + return result; +} + +#ifdef __cplusplus +} // namespace std +#endif + +#undef STD + +#endif // ACADOS_UTILS_STRSEP_H_ diff --git a/third_party/acados/include/acados/utils/timing.h b/third_party/acados/include/acados/utils/timing.h new file mode 100644 index 000000000..fe561d389 --- /dev/null +++ b/third_party/acados/include/acados/utils/timing.h @@ -0,0 +1,125 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_UTILS_TIMING_H_ +#define ACADOS_UTILS_TIMING_H_ + +#include "acados/utils/types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef MEASURE_TIMINGS +#if (defined _WIN32 || defined _WIN64) && !(defined __MINGW32__ || defined __MINGW64__) + +/* Use Windows QueryPerformanceCounter for timing. */ +#include + +/** A structure for keeping internal timer data. */ +typedef struct acados_timer_ +{ + LARGE_INTEGER tic; + LARGE_INTEGER toc; + LARGE_INTEGER freq; +} acados_timer; + +#elif defined(__APPLE__) + +#include + +/** A structure for keeping internal timer data. */ +typedef struct acados_timer_ +{ + uint64_t tic; + uint64_t toc; + mach_timebase_info_data_t tinfo; +} acados_timer; + +#elif defined(__MABX2__) + +#include + +typedef struct acados_timer_ +{ + double time; +} acados_timer; + +#else + +/* Use POSIX clock_gettime() for timing on non-Windows machines. */ +#include + +#if (__STDC_VERSION__ >= 199901L) && !(defined __MINGW32__ || defined __MINGW64__) // C99 Mode + +#include +#include + +typedef struct acados_timer_ +{ + struct timeval tic; + struct timeval toc; +} acados_timer; + +#else // ANSI C Mode + +/** A structure for keeping internal timer data. */ +typedef struct acados_timer_ +{ + struct timespec tic; + struct timespec toc; +} acados_timer; + +#endif // __STDC_VERSION__ >= 199901L + +#endif // (defined _WIN32 || defined _WIN64) + +#else + +// Dummy type when timings are off +typedef real_t acados_timer; + +#endif // MEASURE_TIMINGS + +/** A function for measurement of the current time. */ +void acados_tic(acados_timer* t); + +/** A function which returns the elapsed time. */ +real_t acados_toc(acados_timer* t); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_UTILS_TIMING_H_ diff --git a/third_party/acados/include/acados/utils/types.h b/third_party/acados/include/acados/utils/types.h new file mode 100644 index 000000000..99ad375fe --- /dev/null +++ b/third_party/acados/include/acados/utils/types.h @@ -0,0 +1,79 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef ACADOS_UTILS_TYPES_H_ +#define ACADOS_UTILS_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#define MAX_STR_LEN 256 +#define ACADOS_EPS 1e-12 +#define ACADOS_NEG_INFTY -1.0e9 +#define ACADOS_POS_INFTY +1.0e9 +#define UNUSED(x) ((void)(x)) + + + +typedef double real_t; +typedef int int_t; +typedef size_t acados_size_t; + + +typedef int (*casadi_function_t)(const double** arg, double** res, int* iw, double* w, void* mem); + + + +// enum of return values +enum return_values +{ + ACADOS_SUCCESS, + ACADOS_FAILURE, + ACADOS_MAXITER, + ACADOS_MINSTEP, + ACADOS_QP_FAILURE, + ACADOS_READY, +}; + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ACADOS_UTILS_TYPES_H_ diff --git a/third_party/acados/include/acados_c/condensing_interface.h b/third_party/acados/include/acados_c/condensing_interface.h new file mode 100644 index 000000000..51fe82712 --- /dev/null +++ b/third_party/acados/include/acados_c/condensing_interface.h @@ -0,0 +1,84 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef INTERFACES_ACADOS_C_CONDENSING_INTERFACE_H_ +#define INTERFACES_ACADOS_C_CONDENSING_INTERFACE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/ocp_qp/ocp_qp_full_condensing.h" +#include "acados/ocp_qp/ocp_qp_partial_condensing.h" + +typedef enum { + PARTIAL_CONDENSING, + FULL_CONDENSING, +} condensing_t; + +typedef struct +{ + condensing_t condensing_type; +} condensing_plan; + +typedef struct +{ + ocp_qp_xcond_config *config; + void *dims; + void *opts; + void *mem; + void *work; +} condensing_module; + +ocp_qp_xcond_config *ocp_qp_condensing_config_create(condensing_plan *plan); +// +void *ocp_qp_condensing_opts_create(ocp_qp_xcond_config *config, void *dims_); +// +acados_size_t ocp_qp_condensing_calculate_size(ocp_qp_xcond_config *config, void *dims_, void *opts_); +// +condensing_module *ocp_qp_condensing_assign(ocp_qp_xcond_config *config, void *dims_, + void *opts_, void *raw_memory); +// +condensing_module *ocp_qp_condensing_create(ocp_qp_xcond_config *config, void *dims_, + void *opts_); +// +int ocp_qp_condense(condensing_module *module, void *qp_in, void *qp_out); +// +int ocp_qp_expand(condensing_module *module, void *qp_in, void *qp_out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // INTERFACES_ACADOS_C_CONDENSING_INTERFACE_H_ diff --git a/third_party/acados/include/acados_c/dense_qp_interface.h b/third_party/acados/include/acados_c/dense_qp_interface.h new file mode 100644 index 000000000..4ecc77381 --- /dev/null +++ b/third_party/acados/include/acados_c/dense_qp_interface.h @@ -0,0 +1,94 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef INTERFACES_ACADOS_C_DENSE_QP_INTERFACE_H_ +#define INTERFACES_ACADOS_C_DENSE_QP_INTERFACE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/dense_qp/dense_qp_common.h" + +typedef enum { DENSE_QP_HPIPM, DENSE_QP_QORE, DENSE_QP_QPOASES, DENSE_QP_OOQP } dense_qp_solver_t; + +typedef struct +{ + dense_qp_solver_t qp_solver; +} dense_qp_solver_plan; + +typedef struct +{ + qp_solver_config *config; + void *dims; + void *opts; + void *mem; + void *work; +} dense_qp_solver; + +qp_solver_config *dense_qp_config_create(dense_qp_solver_plan *plan); +// +dense_qp_dims *dense_qp_dims_create(); +// +dense_qp_in *dense_qp_in_create(qp_solver_config *config, dense_qp_dims *dims); +// +dense_qp_out *dense_qp_out_create(qp_solver_config *config, dense_qp_dims *dims); +// +void *dense_qp_opts_create(qp_solver_config *config, dense_qp_dims *dims); +// +acados_size_t dense_qp_calculate_size(qp_solver_config *config, dense_qp_dims *dims, void *opts_); +// +dense_qp_solver *dense_qp_assign(qp_solver_config *config, dense_qp_dims *dims, void *opts_, + void *raw_memory); +// +dense_qp_solver *dense_qp_create(qp_solver_config *config, dense_qp_dims *dims, void *opts_); +// +int dense_qp_solve(dense_qp_solver *solver, dense_qp_in *qp_in, dense_qp_out *qp_out); +// +void dense_qp_inf_norm_residuals(dense_qp_dims *dims, dense_qp_in *qp_in, dense_qp_out *qp_out, + double *res); +// +bool dense_qp_set_field_double_array(const char *field, double *arr, dense_qp_in *qp_in); +// +bool dense_qp_set_field_int_array(const char *field, int *arr, dense_qp_in *qp_in); +// +bool dense_qp_get_field_double_array(const char *field, dense_qp_in *qp_in, double *arr); +// +bool dense_qp_get_field_int_array(const char *field, dense_qp_in *qp_in, int *arr); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // INTERFACES_ACADOS_C_DENSE_QP_INTERFACE_H_ diff --git a/third_party/acados/include/acados_c/external_function_interface.h b/third_party/acados/include/acados_c/external_function_interface.h new file mode 100644 index 000000000..683897507 --- /dev/null +++ b/third_party/acados/include/acados_c/external_function_interface.h @@ -0,0 +1,92 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef INTERFACES_ACADOS_C_EXTERNAL_FUNCTION_INTERFACE_H_ +#define INTERFACES_ACADOS_C_EXTERNAL_FUNCTION_INTERFACE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/utils/external_function_generic.h" + + + +/************************************************ + * generic external parametric function + ************************************************/ + +// +void external_function_param_generic_create(external_function_param_generic *fun, int np); +// +void external_function_param_generic_free(external_function_param_generic *fun); + + + +/************************************************ + * casadi external function + ************************************************/ + +// +void external_function_casadi_create(external_function_casadi *fun); +// +void external_function_casadi_free(external_function_casadi *fun); +// +void external_function_casadi_create_array(int size, external_function_casadi *funs); +// +void external_function_casadi_free_array(int size, external_function_casadi *funs); + + + +/************************************************ + * casadi external parametric function + ************************************************/ + +// +void external_function_param_casadi_create(external_function_param_casadi *fun, int np); +// +void external_function_param_casadi_free(external_function_param_casadi *fun); +// +void external_function_param_casadi_create_array(int size, external_function_param_casadi *funs, + int np); +// +void external_function_param_casadi_free_array(int size, external_function_param_casadi *funs); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // INTERFACES_ACADOS_C_EXTERNAL_FUNCTION_INTERFACE_H_ diff --git a/third_party/acados/include/acados_c/ocp_nlp_interface.h b/third_party/acados/include/acados_c/ocp_nlp_interface.h new file mode 100644 index 000000000..b6b893024 --- /dev/null +++ b/third_party/acados/include/acados_c/ocp_nlp_interface.h @@ -0,0 +1,403 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef INTERFACES_ACADOS_C_OCP_NLP_INTERFACE_H_ +#define INTERFACES_ACADOS_C_OCP_NLP_INTERFACE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// acados +#include "acados/ocp_nlp/ocp_nlp_common.h" +#include "acados/ocp_nlp/ocp_nlp_constraints_bgh.h" +#include "acados/sim/sim_erk_integrator.h" +#include "acados/sim/sim_irk_integrator.h" +#include "acados/sim/sim_lifted_irk_integrator.h" +#include "acados/sim/sim_gnsf.h" +// acados_c +#include "acados_c/ocp_qp_interface.h" +#include "acados_c/sim_interface.h" + + +/// Solution methods for optimal control problems. +typedef enum +{ + SQP, + SQP_RTI, + INVALID_NLP_SOLVER, +} ocp_nlp_solver_t; + + +/// Types of the cost function. +typedef enum +{ + LINEAR_LS, + NONLINEAR_LS, + EXTERNAL, + INVALID_COST, +} ocp_nlp_cost_t; + + +/// Types of the system dynamics, discrete or continuous time. +typedef enum +{ + CONTINUOUS_MODEL, + DISCRETE_MODEL, + INVALID_DYNAMICS, +} ocp_nlp_dynamics_t; + + +/// Constraint types +typedef enum +{ + /// Comprises simple bounds, polytopic constraints, + /// general non-linear constraints. + BGH, + + /// Comprises simple bounds, polytopic constraints, + /// general non-linear constraints, and positive definite constraints. + BGP, + + INVALID_CONSTRAINT, +} ocp_nlp_constraints_t; + + +/// Regularization types +typedef enum +{ + NO_REGULARIZE, + MIRROR, + PROJECT, + PROJECT_REDUC_HESS, + CONVEXIFY, + INVALID_REGULARIZE, +} ocp_nlp_reg_t; + + +/// Structure to store the configuration of a non-linear program +typedef struct ocp_nlp_plan +{ + /// QP solver configuration. + ocp_qp_solver_plan ocp_qp_solver_plan; + + /// Simulation solver configuration for each stage. + sim_solver_plan *sim_solver_plan; + + /// Nlp solver type. + ocp_nlp_solver_t nlp_solver; + + /// Regularization type, defaults to no regularization. + ocp_nlp_reg_t regularization; + + /// Cost type for each stage. + ocp_nlp_cost_t *nlp_cost; + + /// Dynamics type for each stage. + ocp_nlp_dynamics_t *nlp_dynamics; + + /// Constraints type for each stage. + ocp_nlp_constraints_t *nlp_constraints; + + /// Horizon length. + int N; + +} ocp_nlp_plan; + + +/// Structure to store the state/configuration for the non-linear programming solver +typedef struct ocp_nlp_solver +{ + ocp_nlp_config *config; + void *dims; + void *opts; + void *mem; + void *work; +} ocp_nlp_solver; + + +/// Constructs an empty plan struct (user nlp configuration), all fields are set to a +/// default/invalid state. +/// +/// \param N Horizon length +ocp_nlp_plan *ocp_nlp_plan_create(int N); + +/// Destructor for plan struct, frees memory. +/// +/// \param plan_ The plan struct to destroy. +void ocp_nlp_plan_destroy(void* plan_); + + +/// Constructs an nlp configuration struct from a plan. +/// +/// \param plan The plan (user nlp configuration). +ocp_nlp_config *ocp_nlp_config_create(ocp_nlp_plan plan); + +/// Desctructor of the nlp configuration. +/// +/// \param config_ The configuration struct. +void ocp_nlp_config_destroy(void *config_); + + +/// Constructs an struct that contains the dimensions of the variables. +/// +/// \param config_ The configuration struct. +ocp_nlp_dims *ocp_nlp_dims_create(void *config_); + +/// Destructor of The dimension struct. +/// +/// \param dims_ The dimension struct. +void ocp_nlp_dims_destroy(void *dims_); + + +/// Constructs an input struct for a non-linear programs. +/// +/// \param config The configuration struct. +/// \param dims The dimension struct. +ocp_nlp_in *ocp_nlp_in_create(ocp_nlp_config *config, ocp_nlp_dims *dims); + +/// Destructor of the inputs struct. +/// +/// \param in The inputs struct. +void ocp_nlp_in_destroy(void *in); + + +/// Sets the sampling times for the given stage. +/// +/// \param config The configuration struct. +/// \param dims The dimension struct. +/// \param in The inputs struct. +/// \param stage Stage number. +/// \param field Has to be "Ts" (TBC other options). +/// \param value The sampling times (floating point). +void ocp_nlp_in_set(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in, int stage, + const char *field, void *value); + + +/// Sets the function pointers to the dynamics functions for the given stage. +/// +/// \param config The configuration struct. +/// \param dims The dimension struct. +/// \param in The inputs struct. +/// \param stage Stage number. +/// \param fun_type The name of the function type, either impl_ode_fun, +/// impl_ode_fun_jac_x_xdot, impl_ode_jac_x_xdot_u (TBC) +/// \param fun_ptr Function pointer to the dynamics function. +int ocp_nlp_dynamics_model_set(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in, + int stage, const char *fun_type, void *fun_ptr); + + +/// Sets the function pointers to the cost functions for the given stage. +/// +/// \param config The configuration struct. +/// \param dims The dimension struct. +/// \param in The inputs struct. +/// \param stage Stage number. +/// \param field The name of the field, either nls_res_jac, +/// y_ref, W (others TBC) +/// \param value Cost values. +int ocp_nlp_cost_model_set(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in, + int stage, const char *field, void *value); + + +/// Sets the function pointers to the constraints functions for the given stage. +/// +/// \param config The configuration struct. +/// \param dims The dimension struct. +/// \param in The inputs struct. +/// \param stage Stage number. +/// \param field The name of the field, either lb, ub (others TBC) +/// \param value Constraints function or values. +int ocp_nlp_constraints_model_set(ocp_nlp_config *config, ocp_nlp_dims *dims, + ocp_nlp_in *in, int stage, const char *field, void *value); + +/* out */ + +/// Constructs an output struct for the non-linear program. +/// +/// \param config The configuration struct. +/// \param dims The dimension struct. +ocp_nlp_out *ocp_nlp_out_create(ocp_nlp_config *config, ocp_nlp_dims *dims); + +/// Destructor of the output struct. +/// +/// \param out The output struct. +void ocp_nlp_out_destroy(void *out); + + +/// Sets fields in the output struct of an nlp solver, used to initialize the solver. +/// +/// \param config The configuration struct. +/// \param dims The dimension struct. +/// \param out The output struct. +/// \param stage Stage number. +/// \param field The name of the field, either x, u, pi. +/// \param value Initialization values. +void ocp_nlp_out_set(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_out *out, + int stage, const char *field, void *value); + + +/// Gets values of fields in the output struct of an nlp solver. +/// +/// \param config The configuration struct. +/// \param dims The dimension struct. +/// \param out The output struct. +/// \param stage Stage number. +/// \param field The name of the field, either x, u, z, pi. +/// \param value Pointer to the output memory. +void ocp_nlp_out_get(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_out *out, + int stage, const char *field, void *value); + +// +void ocp_nlp_get_at_stage(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_solver *solver, + int stage, const char *field, void *value); + +// TODO(andrea): remove this once/if the MATLAB interface uses the new setters below? +int ocp_nlp_dims_get_from_attr(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_out *out, + int stage, const char *field); + +void ocp_nlp_constraint_dims_get_from_attr(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_out *out, + int stage, const char *field, int *dims_out); + +void ocp_nlp_cost_dims_get_from_attr(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_out *out, + int stage, const char *field, int *dims_out); + +void ocp_nlp_dynamics_dims_get_from_attr(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_out *out, + int stage, const char *field, int *dims_out); + +/* opts */ + +/// Creates an options struct for the non-linear program. +/// +/// \param config The configuration struct. +/// \param dims The dimension struct. +void *ocp_nlp_solver_opts_create(ocp_nlp_config *config, ocp_nlp_dims *dims); + +/// Destructor of the options. +/// +/// \param opts The options struct. +void ocp_nlp_solver_opts_destroy(void *opts); + +/// Sets an option. +/// +/// \param config The configuration struct. +/// \param opts_ The options struct. +/// \param field Name of the option. +/// \param value Value of the option. +void ocp_nlp_solver_opts_set(ocp_nlp_config *config, void *opts_, const char *field, void* value); + + +void ocp_nlp_solver_opts_set_at_stage(ocp_nlp_config *config, void *opts_, int stage, const char *field, void* value); + + +/// TBC +/// Updates the options. +/// +/// \param config The configuration struct. +/// \param dims The dimension struct. +/// \param opts_ The options struct. +void ocp_nlp_solver_opts_update(ocp_nlp_config *config, ocp_nlp_dims *dims, void *opts_); + + +/* solver */ + +/// Creates an ocp solver. +/// +/// \param config The configuration struct. +/// \param dims The dimension struct. +/// \param opts_ The options struct. +/// \return The solver. +ocp_nlp_solver *ocp_nlp_solver_create(ocp_nlp_config *config, ocp_nlp_dims *dims, void *opts_); + +/// Destructor of the solver. +/// +/// \param solver The solver struct. +void ocp_nlp_solver_destroy(void *solver); + +/// Solves the optimal control problem. Call ocp_nlp_precompute before +/// calling this functions (TBC). +/// +/// \param solver The solver struct. +/// \param nlp_in The inputs struct. +/// \param nlp_out The output struct. +int ocp_nlp_solve(ocp_nlp_solver *solver, ocp_nlp_in *nlp_in, ocp_nlp_out *nlp_out); + +/// Performs precomputations for the solver. Needs to be called before +/// ocl_nlp_solve (TBC). +/// +/// \param solver The solver struct. +/// \param nlp_in The inputs struct. +/// \param nlp_out The output struct. +int ocp_nlp_precompute(ocp_nlp_solver *solver, ocp_nlp_in *nlp_in, ocp_nlp_out *nlp_out); + + +/// Computes cost function value. +/// +/// \param solver The solver struct. +/// \param nlp_in The inputs struct. +/// \param nlp_out The output struct. +void ocp_nlp_eval_cost(ocp_nlp_solver *solver, ocp_nlp_in *nlp_in, ocp_nlp_out *nlp_out); + +// +void ocp_nlp_eval_residuals(ocp_nlp_solver *solver, ocp_nlp_in *nlp_in, ocp_nlp_out *nlp_out); + +// +void ocp_nlp_eval_param_sens(ocp_nlp_solver *solver, char *field, int stage, int index, ocp_nlp_out *sens_nlp_out); + +/* get */ +/// \param config The configuration struct. +/// \param solver The solver struct. +/// \param field Supports "sqp_iter", "status", "nlp_res", "time_tot", ... +/// \param return_value_ Pointer to the output memory. +void ocp_nlp_get(ocp_nlp_config *config, ocp_nlp_solver *solver, + const char *field, void *return_value_); + +/* set */ +/// Sets the initial guesses for the integrator for the given stage. +/// +/// \param config The configuration struct. +/// \param solver The ocp_nlp_solver struct. +/// \param stage Stage number. +/// \param field Supports "z_guess", "xdot_guess" (IRK), "phi_guess" (GNSF-IRK) +/// \param value The initial guess for the algebraic variables in the integrator (if continuous model is used). +void ocp_nlp_set(ocp_nlp_config *config, ocp_nlp_solver *solver, + int stage, const char *field, void *value); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // INTERFACES_ACADOS_C_OCP_NLP_INTERFACE_H_ diff --git a/third_party/acados/include/acados_c/ocp_qp_interface.h b/third_party/acados/include/acados_c/ocp_qp_interface.h new file mode 100644 index 000000000..a567ebeb3 --- /dev/null +++ b/third_party/acados/include/acados_c/ocp_qp_interface.h @@ -0,0 +1,261 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef INTERFACES_ACADOS_C_OCP_QP_INTERFACE_H_ +#define INTERFACES_ACADOS_C_OCP_QP_INTERFACE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/ocp_qp/ocp_qp_common.h" +#include "acados/ocp_qp/ocp_qp_xcond_solver.h" + + +/// QP solver types (Enumeration). +/// +/// Full list of fields: +/// PARTIAL_CONDENSING_HPIPM +/// PARTIAL_CONDENSING_HPMPC +/// PARTIAL_CONDENSING_OOQP +/// PARTIAL_CONDENSING_OSQP +/// PARTIAL_CONDENSING_QPDUNES +/// FULL_CONDENSING_HPIPM +/// FULL_CONDENSING_QPOASES +/// FULL_CONDENSING_QORE +/// FULL_CONDENSING_OOQP +/// INVALID_QP_SOLVER +/// +/// Note: In this enumeration the partial condensing solvers have to be +/// specified before the full condensing solvers. +typedef enum { + PARTIAL_CONDENSING_HPIPM, +#ifdef ACADOS_WITH_HPMPC + PARTIAL_CONDENSING_HPMPC, +#else + PARTIAL_CONDENSING_HPMPC_NOT_AVAILABLE, +#endif +#ifdef ACADOS_WITH_OOQP + PARTIAL_CONDENSING_OOQP, +#else + PARTIAL_CONDENSING_OOQP_NOT_AVAILABLE, +#endif +#ifdef ACADOS_WITH_OSQP + PARTIAL_CONDENSING_OSQP, +#else + PARTIAL_CONDENSING_OSQP_NOT_AVAILABLE, +#endif +#ifdef ACADOS_WITH_QPDUNES + PARTIAL_CONDENSING_QPDUNES, +#else + PARTIAL_CONDENSING_QPDUNES_NOT_AVAILABLE, +#endif + FULL_CONDENSING_HPIPM, +#ifdef ACADOS_WITH_QPOASES + FULL_CONDENSING_QPOASES, +#else + FULL_CONDENSING_QPOASES_NOT_AVAILABLE, +#endif +#ifdef ACADOS_WITH_QORE + FULL_CONDENSING_QORE, +#else + FULL_CONDENSING_QORE_NOT_AVAILABLE, +#endif +#ifdef ACADOS_WITH_OOQP + FULL_CONDENSING_OOQP, +#else + FULL_CONDENSING_OOQP_NOT_AVAILABLE, +#endif + INVALID_QP_SOLVER, +} ocp_qp_solver_t; + + +/// Struct containing qp solver +typedef struct +{ + ocp_qp_solver_t qp_solver; +} ocp_qp_solver_plan; + + +/// Linear ocp configuration. +typedef struct +{ + ocp_qp_xcond_solver_config *config; + ocp_qp_xcond_solver_dims *dims; + void *opts; + void *mem; + void *work; +} ocp_qp_solver; + + +/// Initializes the qp solver configuration. +/// TBC should this be private/static - no, used in ocp_nlp +void ocp_qp_xcond_solver_config_initialize_from_plan( + ocp_qp_solver_t solver_name, ocp_qp_xcond_solver_config *solver_config); + +/// Constructs a qp solver config and Initializes with default values. +/// +/// \param plan The qp solver plan struct. +ocp_qp_xcond_solver_config *ocp_qp_xcond_solver_config_create(ocp_qp_solver_plan plan); + +/// Destructor for config struct, frees memory. +/// +/// \param config The config object to destroy. +void ocp_qp_xcond_solver_config_free(ocp_qp_xcond_solver_config *config); + + +/// Constructs a struct that contains the dimensions for the variables of the qp. +/// +/// \param N The number of variables. +ocp_qp_dims *ocp_qp_dims_create(int N); + +/// Destructor of The dimension struct. +/// +/// \param dims The dimension struct. +void ocp_qp_dims_free(void *dims); + +// +ocp_qp_xcond_solver_dims *ocp_qp_xcond_solver_dims_create(ocp_qp_xcond_solver_config *config, int N); +// +ocp_qp_xcond_solver_dims *ocp_qp_xcond_solver_dims_create_from_ocp_qp_dims( + ocp_qp_xcond_solver_config *config, ocp_qp_dims *dims); +// +void ocp_qp_xcond_solver_dims_free(ocp_qp_xcond_solver_dims *dims_); + +void ocp_qp_xcond_solver_dims_set(void *config_, ocp_qp_xcond_solver_dims *dims, + int stage, const char *field, int* value); + + +/// Constructs an input object for the qp. +/// +/// \param dims The dimension struct. +ocp_qp_in *ocp_qp_in_create(ocp_qp_dims *dims); + + +void ocp_qp_in_set(ocp_qp_xcond_solver_config *config, ocp_qp_in *in, + int stage, char *field, void *value); + +/// Destructor of the inputs struct. +/// +/// \param in_ The inputs struct. +void ocp_qp_in_free(void *in_); + + +/// Constructs an outputs object for the qp. +/// +/// \param dims The dimension struct. +ocp_qp_out *ocp_qp_out_create(ocp_qp_dims *dims); + +/// Destructor of the output struct. +/// +/// \param out_ The output struct. +void ocp_qp_out_free(void *out_); + + +/// Getter of output struct +void ocp_qp_out_get(ocp_qp_out *out, const char *field, void *value); + + +/// Constructs an options object for the qp. +/// +/// \param config The configuration struct. +/// \param dims The dimension struct. +void *ocp_qp_xcond_solver_opts_create(ocp_qp_xcond_solver_config *config, + ocp_qp_xcond_solver_dims *dims); + +/// Destructor of the options struct. +/// +/// \param opts The options struct to destroy. +void ocp_qp_xcond_solver_opts_free(ocp_qp_xcond_solver_opts *opts); + + +/// Setter of the options struct. +/// +/// \param opts The options struct. +void ocp_qp_xcond_solver_opts_set(ocp_qp_xcond_solver_config *config, + ocp_qp_xcond_solver_opts *opts, const char *field, void* value); + +/// TBC Should be private/static? +acados_size_t ocp_qp_calculate_size(ocp_qp_xcond_solver_config *config, ocp_qp_xcond_solver_dims *dims, void *opts_); + + +/// TBC Reserves memory? TBC Should this be private? +/// +/// \param config The configuration struct. +/// \param dims The dimension struct. +/// \param opts_ The options struct. +/// \param raw_memory Pointer to raw memory to assign to qp solver. +ocp_qp_solver *ocp_qp_assign(ocp_qp_xcond_solver_config *config, ocp_qp_xcond_solver_dims *dims, + void *opts_, void *raw_memory); + +/// Creates a qp solver. Reserves memory. +/// +/// \param config The configuration struct. +/// \param dims The dimension struct. +/// \param opts_ The options struct. +ocp_qp_solver *ocp_qp_create(ocp_qp_xcond_solver_config *config, + ocp_qp_xcond_solver_dims *dims, void *opts_); + + +/// Destroys a qp solver. Frees memory. +/// +/// \param solver The qp solver +void ocp_qp_solver_destroy(ocp_qp_solver *solver); + +void ocp_qp_x_cond_solver_free(ocp_qp_xcond_solver_config *config, + ocp_qp_xcond_solver_dims *dims, void *opts_); + + +/// Solves the qp. +/// +/// \param solver The solver. +/// \param qp_in The inputs struct. +/// \param qp_out The output struct. +int ocp_qp_solve(ocp_qp_solver *solver, ocp_qp_in *qp_in, ocp_qp_out *qp_out); + + +/// Calculates the infinity norm of the residuals. +/// +/// \param dims The dimension struct. +/// \param qp_in The inputs struct. +/// \param qp_out The output struct. +/// \param res Output array for the residuals. +void ocp_qp_inf_norm_residuals(ocp_qp_dims *dims, ocp_qp_in *qp_in, ocp_qp_out *qp_out, + double *res); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // INTERFACES_ACADOS_C_OCP_QP_INTERFACE_H_ diff --git a/third_party/acados/include/acados_c/sim_interface.h b/third_party/acados/include/acados_c/sim_interface.h new file mode 100644 index 000000000..cc47b62ed --- /dev/null +++ b/third_party/acados/include/acados_c/sim_interface.h @@ -0,0 +1,140 @@ +/* + * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, + * Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, + * Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, + * Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl + * + * This file is part of acados. + * + * The 2-Clause BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE.; + */ + + +#ifndef INTERFACES_ACADOS_C_SIM_INTERFACE_H_ +#define INTERFACES_ACADOS_C_SIM_INTERFACE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "acados/sim/sim_common.h" + + + +typedef enum +{ + ERK, + IRK, + GNSF, + LIFTED_IRK, + INVALID_SIM_SOLVER, +} sim_solver_t; + + + +typedef struct +{ + sim_solver_t sim_solver; +} sim_solver_plan; + + + +typedef struct +{ + sim_config *config; + void *dims; + void *opts; + void *mem; + void *work; +} sim_solver; + + + +/* config */ +// +sim_config *sim_config_create(sim_solver_plan plan); +// +void sim_config_destroy(void *config); + +/* dims */ +// +void *sim_dims_create(void *config_); +// +void sim_dims_destroy(void *dims); +// +void sim_dims_set(sim_config *config, void *dims, const char *field, const int* value); +// +void sim_dims_get(sim_config *config, void *dims, const char *field, int* value); +// +void sim_dims_get_from_attr(sim_config *config, void *dims, const char *field, int *dims_out); + +/* in */ +// +sim_in *sim_in_create(sim_config *config, void *dims); +// +void sim_in_destroy(void *out); +// +int sim_in_set(void *config_, void *dims_, sim_in *in, const char *field, void *value); + + +/* out */ +// +sim_out *sim_out_create(sim_config *config, void *dims); +// +void sim_out_destroy(void *out); +// +int sim_out_get(void *config, void *dims, sim_out *out, const char *field, void *value); + +/* opts */ +// +void *sim_opts_create(sim_config *config, void *dims); +// +void sim_opts_destroy(void *opts); +// +void sim_opts_set(sim_config *config, void *opts, const char *field, void *value); +// +void sim_opts_get(sim_config *config, void *opts, const char *field, void *value); + +/* solver */ +// +acados_size_t sim_calculate_size(sim_config *config, void *dims, void *opts_); +// +sim_solver *sim_assign(sim_config *config, void *dims, void *opts_, void *raw_memory); +// +sim_solver *sim_solver_create(sim_config *config, void *dims, void *opts_); +// +void sim_solver_destroy(void *solver); +// +int sim_solve(sim_solver *solver, sim_in *in, sim_out *out); +// +int sim_precompute(sim_solver *solver, sim_in *in, sim_out *out); +// +int sim_solver_set(sim_solver *solver, const char *field, void *value); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // INTERFACES_ACADOS_C_SIM_INTERFACE_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo.h b/third_party/acados/include/blasfeo/include/blasfeo.h new file mode 100644 index 000000000..c85491819 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo.h @@ -0,0 +1,52 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#include "blasfeo_processor_features.h" +#include "blasfeo_target.h" +#include "blasfeo_block_size.h" +#include "blasfeo_stdlib.h" +#include "blasfeo_common.h" +#include "blasfeo_d_aux.h" +#include "blasfeo_d_aux_ext_dep.h" +#include "blasfeo_d_kernel.h" +#include "blasfeo_d_blas.h" +#include "blasfeo_s_aux.h" +#include "blasfeo_s_aux_ext_dep.h" +#include "blasfeo_s_kernel.h" +#include "blasfeo_s_blas.h" +#include "blasfeo_i_aux_ext_dep.h" +#include "blasfeo_v_aux_ext_dep.h" +#include "blasfeo_timing.h" +#include "blasfeo_memory.h" diff --git a/third_party/acados/include/blasfeo/include/blasfeo_block_size.h b/third_party/acados/include/blasfeo/include/blasfeo_block_size.h new file mode 100644 index 000000000..0ccd4f1bb --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_block_size.h @@ -0,0 +1,392 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_BLOCK_SIZE_H_ +#define BLASFEO_BLOCK_SIZE_H_ + + + +#define D_EL_SIZE 8 // double precision +#define S_EL_SIZE 4 // single precision + + + +#if defined( TARGET_X64_INTEL_SKYLAKE_X ) +// common +#define CACHE_LINE_SIZE 64 // data cache size: 64 bytes +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 kB, 8-way +#define L2_CACHE_SIZE (256*1024) //(1024*1024) // L2 data cache size: 1 MB ; DTLB1 64*4 kB = 256 kB +#define LLC_CACHE_SIZE (6*1024*1024) //(8*1024*1024) // LLC cache size: 8 MB ; TLB 1536*4 kB = 6 MB +// double +#define D_PS 8 // panel size +#define D_PLD 8 // 4 // GCD of panel length +#define D_M_KERNEL 24 // max kernel size +#define D_KC 128 //256 // 192 +#define D_NC 144 //72 //96 //72 // 120 // 512 +#define D_MC 2400 // 6000 +// single +#define S_PS 16 // panel size +#define S_PLD 4 // GCD of panel length TODO probably 16 when writing assebly +#define S_M_KERNEL 32 // max kernel size +#define S_KC 128 //256 +#define S_NC 128 //144 +#define S_MC 3000 + +#elif defined( TARGET_X64_INTEL_HASWELL ) +// common +#define CACHE_LINE_SIZE 64 // data cache size: 64 bytes +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 kB, 8-way +#define L2_CACHE_SIZE (256*1024) // L2 data cache size: 256 kB ; DTLB1 64*4 kB = 256 kB +#define LLC_CACHE_SIZE (6*1024*1024) // LLC cache size: 6 MB ; TLB 1024*4 kB = 4 MB +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 12 // max kernel size +#define D_KC 256 // 192 +#define D_NC 72 //96 //72 // 120 // 512 +#define D_MC 1500 // 6000 +// single +#define S_PS 8 // panel size +#define S_PLD 4 // 2 // GCD of panel length +#define S_M_KERNEL 24 // max kernel size +#define S_KC 256 +#define S_NC 144 +#define S_MC 3000 + +#elif defined( TARGET_X64_INTEL_SANDY_BRIDGE ) +// common +#define CACHE_LINE_SIZE 64 // data cache size: 64 bytes +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 kB, 8-way +#define L2_CACHE_SIZE (256*1024) // L2 data cache size: 256 kB ; DTLB1 64*4 kB = 256 kB +#define LLC_CACHE_SIZE (4*1024*1024) // LLC cache size: 4 MB ; TLB 1024*4 kB = 4 MB +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 8 // max kernel size +#define D_KC 256 //320 //256 //320 +#define D_NC 72 //64 //72 //60 // 120 +#define D_MC 1000 // 800 +// single +#define S_PS 8 // panel size +#define S_PLD 4 // 2 // GCD of panel length +#define S_M_KERNEL 16 // max kernel size +#define S_KC 256 +#define S_NC 144 +#define S_MC 2000 + +#elif defined( TARGET_X64_INTEL_CORE ) +// common +#define CACHE_LINE_SIZE 64 +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 kB +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 4 // max kernel size +#define D_KC 256 +#define D_NC 128 // TODO these are just dummy +#define D_MC 3000 // TODO these are just dummy +// single +#define S_PS 4 +#define S_PLD 4 //2 +#define S_M_KERNEL 4 // max kernel size +#define S_KC 256 +#define S_NC 128 // TODO these are just dummy +#define S_MC 3000 // TODO these are just dummy + +#elif defined( TARGET_X64_AMD_BULLDOZER ) +// common +#define CACHE_LINE_SIZE 64 +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 kB +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 4 // max kernel size +#define D_KC 256 +#define D_NC 128 // TODO these are just dummy +#define D_MC 3000 // TODO these are just dummy +// single +#define S_PS 4 +#define S_PLD 4 //2 +#define S_M_KERNEL 4 // max kernel size +#define S_KC 256 +#define S_NC 128 // TODO these are just dummy +#define S_MC 3000 // TODO these are just dummy + + +#elif defined( TARGET_X86_AMD_JAGUAR ) +// common +#define CACHE_LINE_SIZE 64 +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 kB +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 4 // max kernel size +#define D_KC 256 +#define D_NC 128 // TODO these are just dummy +#define D_MC 3000 // TODO these are just dummy +// single +#define S_PS 4 +#define S_PLD 4 //2 +#define S_M_KERNEL 4 // max kernel size +#define S_KC 256 +#define S_NC 128 // TODO these are just dummy +#define S_MC 3000 // TODO these are just dummy + + +#elif defined( TARGET_X86_AMD_BARCELONA ) +// common +#define CACHE_LINE_SIZE 64 +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 kB +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 4 // max kernel size +#define D_KC 256 +#define D_NC 128 // TODO these are just dummy +#define D_MC 3000 // TODO these are just dummy +// single +#define S_PS 4 +#define S_PLD 4 //2 +#define S_M_KERNEL 4 // max kernel size +#define S_KC 256 +#define S_NC 128 // TODO these are just dummy +#define S_MC 3000 // TODO these are just dummy + + +#elif defined(TARGET_ARMV8A_ARM_CORTEX_A76) +// common +#define CACHE_LINE_SIZE 64 +#define L1_CACHE_SIZE (64*1024) // L1 data cache size: 64 kB, 4-way ; DTLB1 48*4 kB = 192 kB +#define LLC_CACHE_SIZE (1*1024*1024) // LLC cache size: 1 MB +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 8 // max kernel size +#define D_KC 512 //256 +#define D_NC 128 //256 +#define D_MC 6000 +// single +#define S_PS 4 +#define S_PLD 4 //2 +#define S_M_KERNEL 8 // max kernel size +#define S_KC 512 +#define S_NC 256 +#define S_MC 6000 + + +#elif defined(TARGET_ARMV8A_ARM_CORTEX_A73) +// common +#define CACHE_LINE_SIZE 64 +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 (64?) kB, 4-way, seen as 8-(16-)way ; DTLB1 48*4 kB = 192 kB +#define LLC_CACHE_SIZE (1*1024*1024) // LLC cache size: 1 MB +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 8 // max kernel size +#define D_KC 320 +#define D_NC 256 +#define D_MC 6000 +// single +#define S_PS 4 +#define S_PLD 4 //2 +#define S_M_KERNEL 8 // max kernel size +#define S_KC 256 +#define S_NC 128 // TODO these are just dummy +#define S_MC 3000 // TODO these are just dummy + + +#elif defined(TARGET_ARMV8A_ARM_CORTEX_A57) +// common +#define CACHE_LINE_SIZE 64 +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 kB, 2-way ; DTLB1 32*4 kB = 128 kB +#define LLC_CACHE_SIZE (1*1024*1024) // LLC cache size: 1 MB // 2 MB ??? +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 8 // max kernel size +#define D_KC 224 //256 //192 +#define D_NC 40 //36 //48 +#define D_MC 512 //488 //600 +// single +#define S_PS 4 +#define S_PLD 4 //2 +#define S_M_KERNEL 8 // max kernel size +#define S_KC 256 +#define S_NC 128 // TODO these are just dummy +#define S_MC 3000 // TODO these are just dummy + + +#elif defined(TARGET_ARMV8A_ARM_CORTEX_A55) +// common +#define CACHE_LINE_SIZE 64 +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 kB, 4-way ; DTLB1 16*4 kB = 64 kB +#define LLC_CACHE_SIZE (512*1024) // LLC cache size: 512 kB +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 12 // max kernel size +#define D_KC 224 +#define D_NC 160 +#define D_MC 6000 +// single +#define S_PS 4 +#define S_PLD 4 //2 +#define S_M_KERNEL 8 // max kernel size +#define S_KC 256 +#define S_NC 128 // TODO these are just dummy +#define S_MC 3000 // TODO these are just dummy + + +#elif defined(TARGET_ARMV8A_ARM_CORTEX_A53) +// common +#define CACHE_LINE_SIZE 64 +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 kB, 4-way ??? ; DTLB1 10*4 kB = 40 kB +#define LLC_CACHE_SIZE (256*1024) // LLC cache size: 256 kB +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 12 // max kernel size +#define D_KC 160 +#define D_NC 128 +#define D_MC 6000 +// single +#define S_PS 4 +#define S_PLD 4 //2 +#define S_M_KERNEL 8 // max kernel size +#define S_KC 256 +#define S_NC 128 // TODO these are just dummy +#define S_MC 3000 // TODO these are just dummy + + +#elif defined( TARGET_ARMV7A_ARM_CORTEX_A15 ) +// common +#define CACHE_LINE_SIZE 64 +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 kB +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 4 // max kernel size +#define D_KC 256 +#define D_NC 128 // TODO these are just dummy +#define D_MC 3000 // TODO these are just dummy +// single +#define S_PS 4 +#define S_PLD 4 //2 +#define S_M_KERNEL 4 // max kernel size +#define S_KC 256 +#define S_NC 128 // TODO these are just dummy +#define S_MC 3000 // TODO these are just dummy + + +#elif defined( TARGET_ARMV7A_ARM_CORTEX_A7 ) +// common +#define CACHE_LINE_SIZE 64 +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 kB +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 4 // max kernel size +#define D_KC 256 +#define D_NC 128 // TODO these are just dummy +#define D_MC 3000 // TODO these are just dummy +// single +#define S_PS 4 +#define S_PLD 4 //2 +#define S_M_KERNEL 4 // max kernel size +#define S_KC 256 +#define S_NC 128 // TODO these are just dummy +#define S_MC 3000 // TODO these are just dummy + + +#elif defined( TARGET_ARMV7A_ARM_CORTEX_A9 ) +// common +#define CACHE_LINE_SIZE 32 +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 kB +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 4 // max kernel size +#define D_KC 256 +#define D_NC 128 // TODO these are just dummy +#define D_MC 3000 // TODO these are just dummy +// single +#define S_PS 4 +#define S_PLD 4 //2 +#define S_M_KERNEL 4 // max kernel size +#define S_KC 256 +#define S_NC 128 // TODO these are just dummy +#define S_MC 3000 // TODO these are just dummy + + +#elif defined( TARGET_GENERIC ) +// common +#define CACHE_LINE_SIZE 64 +#define L1_CACHE_SIZE (32*1024) // L1 data cache size: 32 kB +// double +#define D_PS 4 // panel size +#define D_PLD 4 // 2 // GCD of panel length +#define D_M_KERNEL 4 // max kernel size +#define D_KC 256 +#define D_NC 128 // TODO these are just dummy +#define D_MC 3000 // TODO these are just dummy + +// single +#define S_PS 4 +#define S_PLD 4 //2 +#define S_M_KERNEL 4 // max kernel size +#define S_KC 256 +#define S_NC 128 // TODO these are just dummy +#define S_MC 3000 // TODO these are just dummy + + +#else +#error "Unknown architecture" +#endif + + + +#define D_CACHE_LINE_EL (CACHE_LINE_SIZE/D_EL_SIZE) +#define D_L1_CACHE_EL (L1_CACHE_SIZE/D_EL_SIZE) +#define D_L2_CACHE_EL (L2_CACHE_SIZE/D_EL_SIZE) +#define D_LLC_CACHE_EL (LLC_CACHE_SIZE/D_EL_SIZE) + +#define S_CACHE_LINE_EL (CACHE_LINE_SIZE/S_EL_SIZE) +#define S_L1_CACHE_EL (L1_CACHE_SIZE/S_EL_SIZE) +#define S_L2_CACHE_EL (L2_CACHE_SIZE/S_EL_SIZE) +#define S_LLC_CACHE_EL (LLC_CACHE_SIZE/S_EL_SIZE) + + + +#endif // BLASFEO_BLOCK_SIZE_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_common.h b/third_party/acados/include/blasfeo/include/blasfeo_common.h new file mode 100644 index 000000000..a648142ba --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_common.h @@ -0,0 +1,236 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_COMMON_H_ +#define BLASFEO_COMMON_H_ + + + +#include "blasfeo_target.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#if defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__INTEL_LLVM_COMPILER) +#define ALIGNED(VEC, BYTES) VEC __attribute__ ((aligned ( BYTES ))) +#elif defined (_MSC_VER) +#define ALIGNED(VEC, BYTES) __declspec(align( BYTES )) VEC +#else +#define ALIGNED(VEC, BYTES) VEC +#endif + + + + +#if ( defined(LA_HIGH_PERFORMANCE) & defined(MF_PANELMAJ) ) | ( defined(LA_REFERENCE) & defined(MF_PANELMAJ) ) + +#include "blasfeo_block_size.h" + +// matrix structure +struct blasfeo_dmat + { + double *mem; // pointer to passed chunk of memory + double *pA; // pointer to a pm*pn array of doubles, the first is aligned to cache line size + double *dA; // pointer to a min(m,n) (or max???) array of doubles + int m; // rows + int n; // cols + int pm; // packed number or rows + int cn; // packed number or cols + int use_dA; // flag to tell if dA can be used + int memsize; // size of needed memory + }; + +struct blasfeo_smat + { + float *mem; // pointer to passed chunk of memory + float *pA; // pointer to a pm*pn array of floats, the first is aligned to cache line size + float *dA; // pointer to a min(m,n) (or max???) array of floats + int m; // rows + int n; // cols + int pm; // packed number or rows + int cn; // packed number or cols + int use_dA; // flag to tell if dA can be used + int memsize; // size of needed memory + }; + +// vector structure +struct blasfeo_dvec + { + double *mem; // pointer to passed chunk of memory + double *pa; // pointer to a pm array of doubles, the first is aligned to cache line size + int m; // size + int pm; // packed size + int memsize; // size of needed memory + }; + +struct blasfeo_svec + { + float *mem; // pointer to passed chunk of memory + float *pa; // pointer to a pm array of floats, the first is aligned to cache line size + int m; // size + int pm; // packed size + int memsize; // size of needed memory + }; + +#define BLASFEO_DMATEL(sA,ai,aj) ((sA)->pA[((ai)-((ai)&(D_PS-1)))*(sA)->cn+(aj)*D_PS+((ai)&(D_PS-1))]) +#define BLASFEO_SMATEL(sA,ai,aj) ((sA)->pA[((ai)-((ai)&(S_PS-1)))*(sA)->cn+(aj)*S_PS+((ai)&(S_PS-1))]) +#define BLASFEO_DVECEL(sa,ai) ((sa)->pa[ai]) +#define BLASFEO_SVECEL(sa,ai) ((sa)->pa[ai]) + +#elif ( defined(LA_HIGH_PERFORMANCE) & defined(MF_COLMAJ) ) | ( defined(LA_REFERENCE) & defined(MF_COLMAJ) ) | defined(LA_EXTERNAL_BLAS_WRAPPER) + +// matrix structure +struct blasfeo_dmat + { + double *mem; // pointer to passed chunk of memory + double *pA; // pointer to a m*n array of doubles + double *dA; // pointer to a min(m,n) (or max???) array of doubles + int m; // rows + int n; // cols + int use_dA; // flag to tell if dA can be used + int memsize; // size of needed memory + }; + +struct blasfeo_smat + { + float *mem; // pointer to passed chunk of memory + float *pA; // pointer to a m*n array of floats + float *dA; // pointer to a min(m,n) (or max???) array of floats + int m; // rows + int n; // cols + int use_dA; // flag to tell if dA can be used + int memsize; // size of needed memory + }; + +// vector structure +struct blasfeo_dvec + { + double *mem; // pointer to passed chunk of memory + double *pa; // pointer to a m array of doubles, the first is aligned to cache line size + int m; // size + int memsize; // size of needed memory + }; + +struct blasfeo_svec + { + float *mem; // pointer to passed chunk of memory + float *pa; // pointer to a m array of floats, the first is aligned to cache line size + int m; // size + int memsize; // size of needed memory + }; + +#define BLASFEO_DMATEL(sA,ai,aj) ((sA)->pA[(ai)+(aj)*(sA)->m]) +#define BLASFEO_SMATEL(sA,ai,aj) ((sA)->pA[(ai)+(aj)*(sA)->m]) +#define BLASFEO_DVECEL(sa,ai) ((sa)->pa[ai]) +#define BLASFEO_SVECEL(sa,ai) ((sa)->pa[ai]) + +#else + +#error : wrong LA or MF choice + +#endif + + + +// Explicitly panel-major matrix structure +struct blasfeo_pm_dmat + { + double *mem; // pointer to passed chunk of memory + double *pA; // pointer to a pm*pn array of doubles, the first is aligned to cache line size + double *dA; // pointer to a min(m,n) (or max???) array of doubles + int m; // rows + int n; // cols + int pm; // packed number or rows + int cn; // packed number or cols + int use_dA; // flag to tell if dA can be used + int ps; // panel size + int memsize; // size of needed memory + }; + +struct blasfeo_pm_smat + { + float *mem; // pointer to passed chunk of memory + float *pA; // pointer to a pm*pn array of floats, the first is aligned to cache line size + float *dA; // pointer to a min(m,n) (or max???) array of floats + int m; // rows + int n; // cols + int pm; // packed number or rows + int cn; // packed number or cols + int use_dA; // flag to tell if dA can be used + int ps; // panel size + int memsize; // size of needed memory + }; + +// Explicitly column-major matrix structure +struct blasfeo_cm_dmat + { + double *mem; // pointer to passed chunk of memory + double *pA; // pointer to a m*n array of doubles + double *dA; // pointer to a min(m,n) (or max???) array of doubles + int m; // rows + int n; // cols + int use_dA; // flag to tell if dA can be used + int memsize; // size of needed memory + }; + +struct blasfeo_cm_smat + { + float *mem; // pointer to passed chunk of memory + float *pA; // pointer to a m*n array of floats + float *dA; // pointer to a min(m,n) (or max???) array of floats + int m; // rows + int n; // cols + int use_dA; // flag to tell if dA can be used + int memsize; // size of needed memory + }; + + +#define BLASFEO_PM_DMATEL(sA,ai,aj) ((sA)->pA[((ai)-((ai)&((sA)->ps-1)))*(sA)->cn+(aj)*((sA)->ps)+((ai)&((sA)->ps-1))]) +#define BLASFEO_PM_SMATEL(sA,ai,aj) ((sA)->pA[((ai)-((ai)&((sA)->ps-1)))*(sA)->cn+(aj)*((sA)->ps)+((ai)&((sA)->ps-1))]) +#define BLASFEO_CM_DMATEL(sA,ai,aj) ((sA)->pA[(ai)+(aj)*(sA)->m]) +#define BLASFEO_CM_SMATEL(sA,ai,aj) ((sA)->pA[(ai)+(aj)*(sA)->m]) + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_COMMON_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_d_aux.h b/third_party/acados/include/blasfeo/include/blasfeo_d_aux.h new file mode 100644 index 000000000..7a9415a59 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_d_aux.h @@ -0,0 +1,239 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +/* + * auxiliary algebra operations header + * + * include/blasfeo_aux_lib*.h + * + */ + +#ifndef BLASFEO_D_AUX_H_ +#define BLASFEO_D_AUX_H_ + + + +#include + +#include "blasfeo_common.h" +#include "blasfeo_d_aux_old.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + +// --- memory size calculations +// +// returns the memory size (in bytes) needed for a dmat +size_t blasfeo_memsize_dmat(int m, int n); +// returns the memory size (in bytes) needed for the diagonal of a dmat +size_t blasfeo_memsize_diag_dmat(int m, int n); +// returns the memory size (in bytes) needed for a dvec +size_t blasfeo_memsize_dvec(int m); + +// --- creation +// +// create a strmat for a matrix of size m*n by using memory passed by a pointer (pointer is not updated) +void blasfeo_create_dmat(int m, int n, struct blasfeo_dmat *sA, void *memory); +// create a strvec for a vector of size m by using memory passed by a pointer (pointer is not updated) +void blasfeo_create_dvec(int m, struct blasfeo_dvec *sA, void *memory); + +// --- packing +// pack the column-major matrix A into the matrix struct B +void blasfeo_pack_dmat(int m, int n, double *A, int lda, struct blasfeo_dmat *sB, int bi, int bj); +// pack the lower-triangular column-major matrix A into the matrix struct B +void blasfeo_pack_l_dmat(int m, int n, double *A, int lda, struct blasfeo_dmat *sB, int bi, int bj); +// pack the upper-triangular column-major matrix A into the matrix struct B +void blasfeo_pack_u_dmat(int m, int n, double *A, int lda, struct blasfeo_dmat *sB, int bi, int bj); +// transpose and pack the column-major matrix A into the matrix struct B +void blasfeo_pack_tran_dmat(int m, int n, double *A, int lda, struct blasfeo_dmat *sB, int bi, int bj); +// pack the vector x into the vector structure y +void blasfeo_pack_dvec(int m, double *x, int xi, struct blasfeo_dvec *sy, int yi); +// unpack the matrix structure A into the column-major matrix B +void blasfeo_unpack_dmat(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, double *B, int ldb); +// transpose and unpack the matrix structure A into the column-major matrix B +void blasfeo_unpack_tran_dmat(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, double *B, int ldb); +// pack the vector structure x into the vector y +void blasfeo_unpack_dvec(int m, struct blasfeo_dvec *sx, int xi, double *y, int yi); + +// --- cast +// +//void d_cast_mat2strmat(double *A, struct blasfeo_dmat *sA); // TODO +//void d_cast_diag_mat2strmat(double *dA, struct blasfeo_dmat *sA); // TODO +//void d_cast_vec2vecmat(double *a, struct blasfeo_dvec *sx); // TODO + + +// ge +// --- insert/extract +// +// sA[ai, aj] <= a +void blasfeo_dgein1(double a, struct blasfeo_dmat *sA, int ai, int aj); +// <= sA[ai, aj] +double blasfeo_dgeex1(struct blasfeo_dmat *sA, int ai, int aj); + +// --- set +// A <= alpha +void blasfeo_dgese(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj); + +// --- copy / scale +// B <= A +void blasfeo_dgecp(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); +// A <= alpha*A +void blasfeo_dgesc(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj); +// B <= alpha*A +void blasfeo_dgecpsc(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); +// B <= A, A lower triangular +void blasfeo_dtrcp_l(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); +void blasfeo_dtrcpsc_l(int m, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); +void blasfeo_dtrsc_l(int m, double alpha, struct blasfeo_dmat *sA, int ai, int aj); + +// --- sum +// B <= B + alpha*A +void blasfeo_dgead(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); +// y <= y + alpha*x +void blasfeo_dvecad(int m, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi); + +// --- traspositions +// B <= A' +void blasfeo_dgetr(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); +// B <= A', A lower triangular +void blasfeo_dtrtr_l(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); +// B <= A', A upper triangular +void blasfeo_dtrtr_u(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); + +// dia +// diag(A) += alpha +void blasfeo_ddiare(int kmax, double alpha, struct blasfeo_dmat *sA, int ai, int aj); +// diag(A) <= alpha*x +void blasfeo_ddiain(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +// diag(A)[idx] <= alpha*x +void blasfeo_ddiain_sp(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dmat *sD, int di, int dj); +// x <= diag(A) +void blasfeo_ddiaex(int kmax, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi); +// x <= diag(A)[idx] +void blasfeo_ddiaex_sp(int kmax, double alpha, int *idx, struct blasfeo_dmat *sD, int di, int dj, struct blasfeo_dvec *sx, int xi); +// diag(A) += alpha*x +void blasfeo_ddiaad(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +// diag(A)[idx] += alpha*x +void blasfeo_ddiaad_sp(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dmat *sD, int di, int dj); +// diag(A)[idx] = y + alpha*x +void blasfeo_ddiaadin_sp(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi, int *idx, struct blasfeo_dmat *sD, int di, int dj); + +// row +void blasfeo_drowin(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +void blasfeo_drowex(int kmax, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi); +void blasfeo_drowad(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +void blasfeo_drowad_sp(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dmat *sD, int di, int dj); +void blasfeo_drowsw(int kmax, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sC, int ci, int cj); +void blasfeo_drowpe(int kmax, int *ipiv, struct blasfeo_dmat *sA); +void blasfeo_drowpei(int kmax, int *ipiv, struct blasfeo_dmat *sA); + +// col +void blasfeo_dcolex(int kmax, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi); +void blasfeo_dcolin(int kmax, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +void blasfeo_dcolad(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +void blasfeo_dcolsc(int kmax, double alpha, struct blasfeo_dmat *sA, int ai, int aj); +void blasfeo_dcolsw(int kmax, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sC, int ci, int cj); +void blasfeo_dcolpe(int kmax, int *ipiv, struct blasfeo_dmat *sA); +void blasfeo_dcolpei(int kmax, int *ipiv, struct blasfeo_dmat *sA); + +// vec +// a <= alpha +void blasfeo_dvecse(int m, double alpha, struct blasfeo_dvec *sx, int xi); +// sx[xi] <= a +void blasfeo_dvecin1(double a, struct blasfeo_dvec *sx, int xi); +// <= sx[xi] +double blasfeo_dvecex1(struct blasfeo_dvec *sx, int xi); +// y <= x +void blasfeo_dveccp(int m, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi); +// x <= alpha*x +void blasfeo_dvecsc(int m, double alpha, struct blasfeo_dvec *sx, int xi); +// y <= alpha*x +void blasfeo_dveccpsc(int m, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi); +void blasfeo_dvecad_sp(int m, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dvec *sz, int zi); +void blasfeo_dvecin_sp(int m, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dvec *sz, int zi); +void blasfeo_dvecex_sp(int m, double alpha, int *idx, struct blasfeo_dvec *sx, int x, struct blasfeo_dvec *sz, int zi); + +void blasfeo_dveccl(int m, + struct blasfeo_dvec *sxm, int xim, struct blasfeo_dvec *sx, int xi, + struct blasfeo_dvec *sxp, int xip, struct blasfeo_dvec *sz, int zi); + +void blasfeo_dveccl_mask(int m, + struct blasfeo_dvec *sxm, int xim, struct blasfeo_dvec *sx, int xi, + struct blasfeo_dvec *sxp, int xip, struct blasfeo_dvec *sz, int zi, + struct blasfeo_dvec *sm, int mi); + +void blasfeo_dvecze(int m, struct blasfeo_dvec *sm, int mi, struct blasfeo_dvec *sv, int vi, struct blasfeo_dvec *se, int ei); +void blasfeo_dvecnrm_inf(int m, struct blasfeo_dvec *sx, int xi, double *ptr_norm); +void blasfeo_dvecnrm_2(int m, struct blasfeo_dvec *sx, int xi, double *ptr_norm); +void blasfeo_dvecpe(int kmax, int *ipiv, struct blasfeo_dvec *sx, int xi); +void blasfeo_dvecpei(int kmax, int *ipiv, struct blasfeo_dvec *sx, int xi); + + + + + +/* +* Explicitly panel-major matrix format +*/ + +// returns the memory size (in bytes) needed for a dmat +size_t blasfeo_pm_memsize_dmat(int ps, int m, int n); +// create a strmat for a matrix of size m*n by using memory passed by a pointer (pointer is not updated) +void blasfeo_pm_create_dmat(int ps, int m, int n, struct blasfeo_pm_dmat *sA, void *memory); +// print +void blasfeo_pm_print_dmat(int m, int n, struct blasfeo_pm_dmat *sA, int ai, int aj); + + + +/* +* Explicitly panel-major matrix format +*/ + +// returns the memory size (in bytes) needed for a dmat +size_t blasfeo_cm_memsize_dmat(int m, int n); +// create a strmat for a matrix of size m*n by using memory passed by a pointer (pointer is not updated) +void blasfeo_cm_create_dmat(int m, int n, struct blasfeo_pm_dmat *sA, void *memory); + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_D_AUX_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_d_aux_ext_dep.h b/third_party/acados/include/blasfeo/include/blasfeo_d_aux_ext_dep.h new file mode 100644 index 000000000..bee9e986f --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_d_aux_ext_dep.h @@ -0,0 +1,145 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +/* + * auxiliary algebra operation external dependancies header + * + * include/blasfeo_d_aux_ext_dep.h + * + * - dynamic memory allocation + * - print + * + */ + +#ifndef BLASFEO_D_AUX_EXT_DEP_H_ +#define BLASFEO_D_AUX_EXT_DEP_H_ + + + +#include + + + +#include "blasfeo_common.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#ifdef EXT_DEP + +/* column-major matrices */ + +// dynamically allocate row*col doubles of memory and set accordingly a pointer to double; set allocated memory to zero +void d_zeros(double **pA, int row, int col); +// dynamically allocate row*col doubles of memory aligned to 64-byte boundaries and set accordingly a pointer to double; set allocated memory to zero +void d_zeros_align(double **pA, int row, int col); +// dynamically allocate size bytes of memory aligned to 64-byte boundaries and set accordingly a pointer to double; set allocated memory to zero +void d_zeros_align_bytes(double **pA, int size); +// free the memory allocated by d_zeros +void d_free(double *pA); +// free the memory allocated by d_zeros_align or d_zeros_align_bytes +void d_free_align(double *pA); +// print a column-major matrix +void d_print_mat(int m, int n, double *A, int lda); +// print the transposed of a column-major matrix +void d_print_tran_mat(int row, int col, double *A, int lda); +// print to file a column-major matrix +void d_print_to_file_mat(FILE *file, int row, int col, double *A, int lda); +// print to file a column-major matrix in exponential format +void d_print_to_file_exp_mat(FILE *file, int row, int col, double *A, int lda); +// print to string a column-major matrix +void d_print_to_string_mat(char **buf_out, int row, int col, double *A, int lda); +// print to file the transposed of a column-major matrix +void d_print_tran_to_file_mat(FILE *file, int row, int col, double *A, int lda); +// print to file the transposed of a column-major matrix in exponential format +void d_print_tran_to_file_exp_mat(FILE *file, int row, int col, double *A, int lda); +// print in exponential notation a column-major matrix +void d_print_exp_mat(int m, int n, double *A, int lda); +// print in exponential notation the transposed of a column-major matrix +void d_print_exp_tran_mat(int row, int col, double *A, int lda); + +/* strmat and strvec */ + +// create a strmat for a matrix of size m*n by dynamically allocating memory +void blasfeo_allocate_dmat(int m, int n, struct blasfeo_dmat *sA); +// create a strvec for a vector of size m by dynamically allocating memory +void blasfeo_allocate_dvec(int m, struct blasfeo_dvec *sa); +// free the memory allocated by blasfeo_allocate_dmat +void blasfeo_free_dmat(struct blasfeo_dmat *sA); +// free the memory allocated by blasfeo_allocate_dvec +void blasfeo_free_dvec(struct blasfeo_dvec *sa); +// print a strmat +void blasfeo_print_dmat(int m, int n, struct blasfeo_dmat *sA, int ai, int aj); +// print in exponential notation a strmat +void blasfeo_print_exp_dmat(int m, int n, struct blasfeo_dmat *sA, int ai, int aj); +// print to file a strmat +void blasfeo_print_to_file_dmat(FILE *file, int m, int n, struct blasfeo_dmat *sA, int ai, int aj); +// print to file a strmat in exponential format +void blasfeo_print_to_file_exp_dmat(FILE *file, int m, int n, struct blasfeo_dmat *sA, int ai, int aj); +// print to string a strmat +void blasfeo_print_to_string_dmat(char **buf_out, int m, int n, struct blasfeo_dmat *sA, int ai, int aj); +// print the transposed of a strmat +void blasfeo_print_tran_dmat(int m, int n, struct blasfeo_dmat *sA, int ai, int aj); +// print a strvec +void blasfeo_print_dvec(int m, struct blasfeo_dvec *sa, int ai); +// print in exponential notation a strvec +void blasfeo_print_exp_dvec(int m, struct blasfeo_dvec *sa, int ai); +// print to file a strvec +void blasfeo_print_to_file_dvec(FILE *file, int m, struct blasfeo_dvec *sa, int ai); +// print to string a strvec +void blasfeo_print_to_string_dvec(char **buf_out, int m, struct blasfeo_dvec *sa, int ai); +// print the transposed of a strvec +void blasfeo_print_tran_dvec(int m, struct blasfeo_dvec *sa, int ai); +// print in exponential notation the transposed of a strvec +void blasfeo_print_exp_tran_dvec(int m, struct blasfeo_dvec *sa, int ai); +// print to file the transposed of a strvec +void blasfeo_print_to_file_tran_dvec(FILE *file, int m, struct blasfeo_dvec *sa, int ai); +// print to string the transposed of a strvec +void blasfeo_print_to_string_tran_dvec(char **buf_out, int m, struct blasfeo_dvec *sa, int ai); + +#endif // EXT_DEP + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_D_AUX_EXT_DEP_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_d_aux_ext_dep_ref.h b/third_party/acados/include/blasfeo/include/blasfeo_d_aux_ext_dep_ref.h new file mode 100644 index 000000000..81b811f03 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_d_aux_ext_dep_ref.h @@ -0,0 +1,84 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +/* + * auxiliary algebra operation external dependancies header + * + * include/blasfeo_d_aux_ext_dep.h + * + * - dynamic memory allocation + * - print + * + */ + +#ifndef BLASFEO_D_AUX_EXT_DEP_REF_H_ +#define BLASFEO_D_AUX_EXT_DEP_REF_H_ + + +#include + +#include "blasfeo_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// expose reference BLASFEO for testing +// see blasfeo_d_aux_exp_dep.h for help + +void blasfeo_print_dmat_ref(int m, int n, struct blasfeo_dmat_ref *sA, int ai, int aj); +void blasfeo_allocate_dmat_ref(int m, int n, struct blasfeo_dmat_ref *sA); +void blasfeo_allocate_dvec_ref(int m, struct blasfeo_dvec_ref *sa); +void blasfeo_free_dmat_ref(struct blasfeo_dmat_ref *sA); +void blasfeo_free_dvec_ref(struct blasfeo_dvec_ref *sa); +void blasfeo_print_dmat_ref(int m, int n, struct blasfeo_dmat_ref *sA, int ai, int aj); +void blasfeo_print_exp_dmat_ref(int m, int n, struct blasfeo_dmat_ref *sA, int ai, int aj); +void blasfeo_print_to_file_dmat_ref(FILE *file, int m, int n, struct blasfeo_dmat_ref *sA, int ai, int aj); +void blasfeo_print_to_file_exp_dmat_ref(FILE *file, int m, int n, struct blasfeo_dmat_ref *sA, int ai, int aj); +void blasfeo_print_to_string_dmat_ref(char **buf_out, int m, int n, struct blasfeo_dmat_ref *sA, int ai, int aj); +void blasfeo_print_dvec(int m, struct blasfeo_dvec *sa, int ai); +void blasfeo_print_exp_dvec(int m, struct blasfeo_dvec *sa, int ai); +void blasfeo_print_to_file_dvec(FILE *file, int m, struct blasfeo_dvec *sa, int ai); +void blasfeo_print_to_string_dvec(char **buf_out, int m, struct blasfeo_dvec *sa, int ai); +void blasfeo_print_tran_dvec(int m, struct blasfeo_dvec *sa, int ai); +void blasfeo_print_exp_tran_dvec(int m, struct blasfeo_dvec *sa, int ai); +void blasfeo_print_to_file_tran_dvec(FILE *file, int m, struct blasfeo_dvec *sa, int ai); +void blasfeo_print_to_string_tran_dvec(char **buf_out, int m, struct blasfeo_dvec *sa, int ai); + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_D_AUX_EXT_DEP_REF_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_d_aux_old.h b/third_party/acados/include/blasfeo/include/blasfeo_d_aux_old.h new file mode 100644 index 000000000..3a1847a6a --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_d_aux_old.h @@ -0,0 +1,75 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +/* + * ----------- TOMOVE + * + * expecting column major matrices + * + */ + +#include "blasfeo_common.h" + + +void dtrcp_l_lib(int m, double alpha, int offsetA, double *A, int sda, int offsetB, double *B, int sdb); +void dgead_lib(int m, int n, double alpha, int offsetA, double *A, int sda, int offsetB, double *B, int sdb); +// TODO remove ??? +void ddiain_sqrt_lib(int kmax, double *x, int offset, double *pD, int sdd); +// TODO ddiaad1 +void ddiareg_lib(int kmax, double reg, int offset, double *pD, int sdd); + + +void dgetr_lib(int m, int n, double alpha, int offsetA, double *pA, int sda, int offsetC, double *pC, int sdc); +void dtrtr_l_lib(int m, double alpha, int offsetA, double *pA, int sda, int offsetC, double *pC, int sdc); +void dtrtr_u_lib(int m, double alpha, int offsetA, double *pA, int sda, int offsetC, double *pC, int sdc); +void ddiaex_lib(int kmax, double alpha, int offset, double *pD, int sdd, double *x); +void ddiaad_lib(int kmax, double alpha, double *x, int offset, double *pD, int sdd); +void ddiain_libsp(int kmax, int *idx, double alpha, double *x, double *pD, int sdd); +void ddiaex_libsp(int kmax, int *idx, double alpha, double *pD, int sdd, double *x); +void ddiaad_libsp(int kmax, int *idx, double alpha, double *x, double *pD, int sdd); +void ddiaadin_libsp(int kmax, int *idx, double alpha, double *x, double *y, double *pD, int sdd); +void drowin_lib(int kmax, double alpha, double *x, double *pD); +void drowex_lib(int kmax, double alpha, double *pD, double *x); +void drowad_lib(int kmax, double alpha, double *x, double *pD); +void drowin_libsp(int kmax, double alpha, int *idx, double *x, double *pD); +void drowad_libsp(int kmax, int *idx, double alpha, double *x, double *pD); +void drowadin_libsp(int kmax, int *idx, double alpha, double *x, double *y, double *pD); +void dcolin_lib(int kmax, double *x, int offset, double *pD, int sdd); +void dcolad_lib(int kmax, double alpha, double *x, int offset, double *pD, int sdd); +void dcolin_libsp(int kmax, int *idx, double *x, double *pD, int sdd); +void dcolad_libsp(int kmax, double alpha, int *idx, double *x, double *pD, int sdd); +void dcolsw_lib(int kmax, int offsetA, double *pA, int sda, int offsetC, double *pC, int sdc); +void dvecin_libsp(int kmax, int *idx, double *x, double *y); +void dvecad_libsp(int kmax, int *idx, double alpha, double *x, double *y); diff --git a/third_party/acados/include/blasfeo/include/blasfeo_d_aux_ref.h b/third_party/acados/include/blasfeo/include/blasfeo_d_aux_ref.h new file mode 100644 index 000000000..448234044 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_d_aux_ref.h @@ -0,0 +1,206 @@ + +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_D_AUX_REF_H_ +#define BLASFEO_D_AUX_REF_H_ + + + +#include + +#include "blasfeo_common.h" +#include "blasfeo_d_aux_old.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + +// --- memory calculations +// +// returns the memory size (in bytes) needed for a dmat +size_t blasfeo_ref_memsize_dmat(int m, int n); +// returns the memory size (in bytes) needed for the diagonal of a dmat +size_t blasfeo_ref_memsize_diag_dmat(int m, int n); +// returns the memory size (in bytes) needed for a dvec +size_t blasfeo_ref_memsize_dvec(int m); + +// --- creation +// +// create a strmat for a matrix of size m*n by using memory passed by a pointer (pointer is not updated) +void blasfeo_ref_create_dmat(int m, int n, struct blasfeo_dmat *sA, void *memory); +// create a strvec for a vector of size m by using memory passed by a pointer (pointer is not updated) +void blasfeo_ref_create_dvec(int m, struct blasfeo_dvec *sA, void *memory); + +// --- packing +// pack the column-major matrix A into the matrix struct B +void blasfeo_ref_pack_dmat(int m, int n, double *A, int lda, struct blasfeo_dmat *sB, int bi, int bj); +// pack the lower-triangular column-major matrix A into the matrix struct B +void blasfeo_ref_pack_l_dmat(int m, int n, double *A, int lda, struct blasfeo_dmat *sB, int bi, int bj); +// pack the upper-triangular column-major matrix A into the matrix struct B +void blasfeo_ref_pack_u_dmat(int m, int n, double *A, int lda, struct blasfeo_dmat *sB, int bi, int bj); +// transpose and pack the column-major matrix A into the matrix struct B +void blasfeo_ref_pack_tran_dmat(int m, int n, double *A, int lda, struct blasfeo_dmat *sB, int bi, int bj); +// pack the vector x into the vector structure y +void blasfeo_ref_pack_dvec(int m, double *x, int xi, struct blasfeo_dvec *sy, int yi); +// unpack the matrix structure A into the column-major matrix B +void blasfeo_ref_unpack_dmat(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, double *B, int ldb); +// transpose and unpack the matrix structure A into the column-major matrix B +void blasfeo_ref_unpack_tran_dmat(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, double *B, int ldb); +// pack the vector structure x into the vector y +void blasfeo_ref_unpack_dvec(int m, struct blasfeo_dvec *sx, int xi, double *y, int yi); + +// --- cast +// +void ref_d_cast_mat2strmat(double *A, struct blasfeo_dmat *sA); // TODO +void ref_d_cast_diag_mat2strmat(double *dA, struct blasfeo_dmat *sA); // TODO +void ref_d_cast_vec2vecmat(double *a, struct blasfeo_dvec *sx); // TODO + + +// ge +// --- insert/extract +// +// sA[ai, aj] <= a +void blasfeo_ref_dgein1(double a, struct blasfeo_dmat *sA, int ai, int aj); +// <= sA[ai, aj] +double blasfeo_ref_dgeex1(struct blasfeo_dmat *sA, int ai, int aj); + +// --- set +// A <= alpha +void blasfeo_ref_dgese(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj); + +// --- copy / scale +// B <= A +void blasfeo_ref_dgecp(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); +// A <= alpha*A +void blasfeo_ref_dgesc(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj); +// B <= alpha*A +void blasfeo_ref_dgecpsc(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); +// B <= A, A lower triangular +void blasfeo_ref_dtrcp_l(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); +void blasfeo_ref_dtrcpsc_l(int m, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); +void blasfeo_ref_dtrsc_l(int m, double alpha, struct blasfeo_dmat *sA, int ai, int aj); + +// --- sum +// B <= B + alpha*A +void blasfeo_ref_dgead(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sC, int yi, int cj); +// y <= y + alpha*x +void blasfeo_ref_dvecad(int m, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi); + +// --- traspositions +// B <= A' +void blasfeo_ref_dgetr(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); +// B <= A', A lower triangular +void blasfeo_ref_dtrtr_l(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); +// B <= A', A upper triangular +void blasfeo_ref_dtrtr_u(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj); + +// dia +// diag(A) += alpha +void blasfeo_ref_ddiare(int kmax, double alpha, struct blasfeo_dmat *sA, int ai, int aj); +// diag(A) <= alpha*x +void blasfeo_ref_ddiain(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +// diag(A)[idx] <= alpha*x +void blasfeo_ref_ddiain_sp(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dmat *sD, int di, int dj); +// x <= diag(A) +void blasfeo_ref_ddiaex(int kmax, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi); +// x <= diag(A)[idx] +void blasfeo_ref_ddiaex_sp(int kmax, double alpha, int *idx, struct blasfeo_dmat *sD, int di, int dj, struct blasfeo_dvec *sx, int xi); +// diag(A) += alpha*x +void blasfeo_ref_ddiaad(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +// diag(A)[idx] += alpha*x +void blasfeo_ref_ddiaad_sp(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dmat *sD, int di, int dj); +// diag(A)[idx] = y + alpha*x +void blasfeo_ref_ddiaadin_sp(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi, int *idx, struct blasfeo_dmat *sD, int di, int dj); + +// row +void blasfeo_ref_drowin(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +void blasfeo_ref_drowex(int kmax, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi); +void blasfeo_ref_drowad(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +void blasfeo_ref_drowad_sp(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dmat *sD, int di, int dj); +void blasfeo_ref_drowsw(int kmax, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sC, int ci, int cj); +void blasfeo_ref_drowpe(int kmax, int *ipiv, struct blasfeo_dmat *sA); +void blasfeo_ref_drowpei(int kmax, int *ipiv, struct blasfeo_dmat *sA); + +// col +void blasfeo_ref_dcolex(int kmax, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi); +void blasfeo_ref_dcolin(int kmax, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +void blasfeo_ref_dcolad(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +void blasfeo_ref_dcolsc(int kmax, double alpha, struct blasfeo_dmat *sA, int ai, int aj); +void blasfeo_ref_dcolsw(int kmax, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sC, int ci, int cj); +void blasfeo_ref_dcolpe(int kmax, int *ipiv, struct blasfeo_dmat *sA); +void blasfeo_ref_dcolpei(int kmax, int *ipiv, struct blasfeo_dmat *sA); + +// vec +// a <= alpha +void blasfeo_ref_dvecse(int m, double alpha, struct blasfeo_dvec *sx, int xi); +// sx[xi] <= a +void blasfeo_ref_dvecin1(double a, struct blasfeo_dvec *sx, int xi); +// <= sx[xi] +double blasfeo_ref_dvecex1(struct blasfeo_dvec *sx, int xi); +// y <= x +void blasfeo_ref_dveccp(int m, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi); +// x <= alpha*x +void blasfeo_ref_dvecsc(int m, double alpha, struct blasfeo_dvec *sx, int xi); +// y <= alpha*x +void blasfeo_ref_dveccpsc(int m, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi); +void blasfeo_ref_dvecad_sp(int m, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dvec *sz, int zi); +void blasfeo_ref_dvecin_sp(int m, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dvec *sz, int zi); +void blasfeo_ref_dvecex_sp(int m, double alpha, int *idx, struct blasfeo_dvec *sx, int x, struct blasfeo_dvec *sz, int zi); + +void blasfeo_ref_dveccl(int m, + struct blasfeo_dvec *sxm, int xim, struct blasfeo_dvec *sx, int xi, + struct blasfeo_dvec *sxp, int xip, struct blasfeo_dvec *sz, int zi); + +void blasfeo_ref_dveccl_mask(int m, + struct blasfeo_dvec *sxm, int xim, struct blasfeo_dvec *sx, int xi, + struct blasfeo_dvec *sxp, int xip, struct blasfeo_dvec *sz, int zi, + struct blasfeo_dvec *sm, int mi); + +void blasfeo_ref_dvecze(int m, struct blasfeo_dvec *sm, int mi, struct blasfeo_dvec *sv, int vi, struct blasfeo_dvec *se, int ei); +void blasfeo_ref_dvecnrm_inf(int m, struct blasfeo_dvec *sx, int xi, double *ptr_norm); +void blasfeo_ref_dvecpe(int kmax, int *ipiv, struct blasfeo_dvec *sx, int xi); +void blasfeo_ref_dvecpei(int kmax, int *ipiv, struct blasfeo_dvec *sx, int xi); + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_D_AUX_REF_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_d_aux_test.h b/third_party/acados/include/blasfeo/include/blasfeo_d_aux_test.h new file mode 100644 index 000000000..1c61635f3 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_d_aux_test.h @@ -0,0 +1,226 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +/* + * auxiliary algebra operations header + * + * include/blasfeo_aux_lib*.h + * + */ + +#ifndef BLASFEO_D_AUX_TEST_H_ +#define BLASFEO_D_AUX_TEST_H_ + +#include "blasfeo_common.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +// --- memory calculations +int test_blasfeo_memsize_dmat(int m, int n); +int test_blasfeo_memsize_diag_dmat(int m, int n); +int test_blasfeo_memsize_dvec(int m); + +// --- creation +void test_blasfeo_create_dmat(int m, int n, struct blasfeo_dmat *sA, void *memory); +void test_blasfeo_create_dvec(int m, struct blasfeo_dvec *sA, void *memory); + +// --- conversion +void test_blasfeo_pack_dmat(int m, int n, double *A, int lda, struct blasfeo_dmat *sA, int ai, int aj); +void test_blasfeo_pack_dvec(int m, double *x, int xi, struct blasfeo_dvec *sa, int ai); +void test_blasfeo_pack_tran_dmat(int m, int n, double *A, int lda, struct blasfeo_dmat *sA, int ai, int aj); +void test_blasfeo_unpack_dmat(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, double *A, int lda); +void test_blasfeo_unpack_dvec(int m, struct blasfeo_dvec *sa, int ai, double *x, int xi); +void test_blasfeo_unpack_tran_dmat(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, double *A, int lda); + +// --- cast +void test_d_cast_mat2strmat(double *A, struct blasfeo_dmat *sA); +void test_d_cast_diag_mat2strmat(double *dA, struct blasfeo_dmat *sA); +void test_d_cast_vec2vecmat(double *a, struct blasfeo_dvec *sa); + +// ------ copy / scale + +// B <= A +void test_blasfeo_dgecp(int m, int n, + struct blasfeo_dmat *sA, int ai, int aj, + struct blasfeo_dmat *sB, int bi, int bj); + +// A <= alpha*A +void test_blasfeo_dgesc(int m, int n, + double alpha, + struct blasfeo_dmat *sA, int ai, int aj); + +// B <= alpha*A +void test_blasfeo_dgecpsc(int m, int n, + double alpha, + struct blasfeo_dmat *sA, int ai, int aj, + struct blasfeo_dmat *sB, int bi, int bj); + +// // --- insert/extract +// // +// // <= sA[ai, aj] +// void test_blasfeo_dgein1(double a, struct blasfeo_dmat *sA, int ai, int aj); +// // <= sA[ai, aj] +// double blasfeo_dgeex1(struct blasfeo_dmat *sA, int ai, int aj); +// // sx[xi] <= a +// void test_blasfeo_dvecin1(double a, struct blasfeo_dvec *sx, int xi); +// // <= sx[xi] +// double blasfeo_dvecex1(struct blasfeo_dvec *sx, int xi); +// // A <= alpha + +// // --- set +// void test_blasfeo_dgese(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj); +// // a <= alpha +// void test_blasfeo_dvecse(int m, double alpha, struct blasfeo_dvec *sx, int xi); +// // B <= A + + +// // --- vector +// // y <= x +// void test_blasfeo_dveccp(int m, struct blasfeo_dvec *sa, int ai, struct blasfeo_dvec *sc, int ci); +// // x <= alpha*x +// void test_blasfeo_dvecsc(int m, double alpha, struct blasfeo_dvec *sa, int ai); +// // TODO +// // x <= alpha*x +// void test_blasfeo_dveccpsc(int m, double alpha, struct blasfeo_dvec *sa, int ai, struct blasfeo_dvec *sc, int ci); + + +// // B <= A, A lower triangular +// void test_blasfeo_dtrcp_l(int m, +// struct blasfeo_dmat *sA, int ai, int aj, +// struct blasfeo_dmat *sB, int bi, int bj); + +// void test_blasfeo_dtrcpsc_l(int m, double alpha, +// struct blasfeo_dmat *sA, int ai, int aj, +// struct blasfeo_dmat *sB, int bi, int bj); + +// void test_blasfeo_dtrsc_l(int m, double alpha, +// struct blasfeo_dmat *sA, int ai, int aj); + + +// // B <= B + alpha*A +// void test_blasfeo_dgead(int m, int n, double alpha, +// struct blasfeo_dmat *sA, int ai, int aj, +// struct blasfeo_dmat *sC, int ci, int cj); + +// // y <= y + alpha*x +// void test_blasfeo_dvecad(int m, double alpha, +// struct blasfeo_dvec *sa, int ai, +// struct blasfeo_dvec *sc, int ci); + +// // --- traspositions +// void test_dgetr_lib(int m, int n, double alpha, int offsetA, double *pA, int sda, int offsetC, double *pC, int sdc); +// void test_blasfeo_dgetr(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sC, int ci, int cj); +// void test_dtrtr_l_lib(int m, double alpha, int offsetA, double *pA, int sda, int offsetC, double *pC, int sdc); +// void test_blasfeo_dtrtr_l(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sC, int ci, int cj); +// void test_dtrtr_u_lib(int m, double alpha, int offsetA, double *pA, int sda, int offsetC, double *pC, int sdc); +// void test_blasfeo_dtrtr_u(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sC, int ci, int cj); +// void test_blasfeo_ddiare(int kmax, double alpha, struct blasfeo_dmat *sA, int ai, int aj); +// void test_blasfeo_ddiain(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +// void test_ddiaex_lib(int kmax, double alpha, int offset, double *pD, int sdd, double *x); +// void test_ddiaad_lib(int kmax, double alpha, double *x, int offset, double *pD, int sdd); +// void test_ddiain_libsp(int kmax, int *idx, double alpha, double *x, double *pD, int sdd); +// void test_blasfeo_ddiain_sp(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dmat *sD, int di, int dj); +// void test_ddiaex_libsp(int kmax, int *idx, double alpha, double *pD, int sdd, double *x); +// void test_blasfeo_ddiaex(int kmax, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi); +// void test_blasfeo_ddiaex_sp(int kmax, double alpha, int *idx, struct blasfeo_dmat *sD, int di, int dj, struct blasfeo_dvec *sx, int xi); +// void test_blasfeo_ddiaad(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +// void test_ddiaad_libsp(int kmax, int *idx, double alpha, double *x, double *pD, int sdd); +// void test_blasfeo_ddiaad_sp(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dmat *sD, int di, int dj); +// void test_ddiaadin_libsp(int kmax, int *idx, double alpha, double *x, double *y, double *pD, int sdd); +// void test_blasfeo_ddiaadin_sp(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi, int *idx, struct blasfeo_dmat *sD, int di, int dj); +// void test_drowin_lib(int kmax, double alpha, double *x, double *pD); +// void test_blasfeo_drowin(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +// void test_drowex_lib(int kmax, double alpha, double *pD, double *x); +// void test_blasfeo_drowex(int kmax, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi); +// void test_drowad_lib(int kmax, double alpha, double *x, double *pD); +// void test_blasfeo_drowad(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +// void test_drowin_libsp(int kmax, double alpha, int *idx, double *x, double *pD); +// void test_drowad_libsp(int kmax, int *idx, double alpha, double *x, double *pD); +// void test_blasfeo_drowad_sp(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dmat *sD, int di, int dj); +// void test_drowadin_libsp(int kmax, int *idx, double alpha, double *x, double *y, double *pD); +// void test_drowsw_lib(int kmax, double *pA, double *pC); +// void test_blasfeo_drowsw(int kmax, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sC, int ci, int cj); +// void test_blasfeo_drowpe(int kmax, int *ipiv, struct blasfeo_dmat *sA); +// void test_blasfeo_dcolex(int kmax, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi); +// void test_dcolin_lib(int kmax, double *x, int offset, double *pD, int sdd); +// void test_blasfeo_dcolin(int kmax, struct blasfeo_dvec *sx, int xi, struct blasfeo_dmat *sA, int ai, int aj); +// void test_dcolad_lib(int kmax, double alpha, double *x, int offset, double *pD, int sdd); +// void test_dcolin_libsp(int kmax, int *idx, double *x, double *pD, int sdd); +// void test_dcolad_libsp(int kmax, double alpha, int *idx, double *x, double *pD, int sdd); +// void test_dcolsw_lib(int kmax, int offsetA, double *pA, int sda, int offsetC, double *pC, int sdc); +// void test_blasfeo_dcolsw(int kmax, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sC, int ci, int cj); +// void test_blasfeo_dcolpe(int kmax, int *ipiv, struct blasfeo_dmat *sA); +// void test_dvecin_libsp(int kmax, int *idx, double *x, double *y); +// void test_dvecad_libsp(int kmax, int *idx, double alpha, double *x, double *y); +// void test_blasfeo_dvecad_sp(int m, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dvec *sz, int zi); +// void test_blasfeo_dvecin_sp(int m, double alpha, struct blasfeo_dvec *sx, int xi, int *idx, struct blasfeo_dvec *sz, int zi); +// void test_blasfeo_dvecex_sp(int m, double alpha, int *idx, struct blasfeo_dvec *sx, int x, struct blasfeo_dvec *sz, int zi); +// void test_blasfeo_dveccl(int m, struct blasfeo_dvec *sxm, int xim, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sxp, int xip, struct blasfeo_dvec *sz, int zi); +// void test_blasfeo_dveccl_mask(int m, struct blasfeo_dvec *sxm, int xim, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sxp, int xip, struct blasfeo_dvec *sz, int zi, struct blasfeo_dvec *sm, int mi); +// void test_blasfeo_dvecze(int m, struct blasfeo_dvec *sm, int mi, struct blasfeo_dvec *sv, int vi, struct blasfeo_dvec *se, int ei); +// void test_blasfeo_dvecnrm_inf(int m, struct blasfeo_dvec *sx, int xi, double *ptr_norm); +// void test_blasfeo_dvecpe(int kmax, int *ipiv, struct blasfeo_dvec *sx, int xi); +// void test_blasfeo_dvecpei(int kmax, int *ipiv, struct blasfeo_dvec *sx, int xi); + +// ext_dep + +void test_blasfeo_allocate_dmat(int m, int n, struct blasfeo_dmat *sA); +void test_blasfeo_allocate_dvec(int m, struct blasfeo_dvec *sa); + +void test_blasfeo_free_dmat(struct blasfeo_dmat *sA); +void test_blasfeo_free_dvec(struct blasfeo_dvec *sa); + +void test_blasfeo_print_dmat(int m, int n, struct blasfeo_dmat *sA, int ai, int aj); +void test_blasfeo_print_dvec(int m, struct blasfeo_dvec *sa, int ai); +void test_blasfeo_print_tran_dvec(int m, struct blasfeo_dvec *sa, int ai); + +void test_blasfeo_print_to_file_dmat(FILE *file, int m, int n, struct blasfeo_dmat *sA, int ai, int aj); +void test_blasfeo_print_to_file_dvec(FILE *file, int m, struct blasfeo_dvec *sa, int ai); +void test_blasfeo_print_to_file_tran_dvec(FILE *file, int m, struct blasfeo_dvec *sa, int ai); + +void test_blasfeo_print_exp_dmat(int m, int n, struct blasfeo_dmat *sA, int ai, int aj); +void test_blasfeo_print_exp_dvec(int m, struct blasfeo_dvec *sa, int ai); +void test_blasfeo_print_exp_tran_dvec(int m, struct blasfeo_dvec *sa, int ai); + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_D_AUX_TEST_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_d_blas.h b/third_party/acados/include/blasfeo/include/blasfeo_d_blas.h new file mode 100644 index 000000000..ea8d00673 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_d_blas.h @@ -0,0 +1,46 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_D_BLAS_H_ +#define BLASFEO_D_BLAS_H_ + + + +#include "blasfeo_d_blasfeo_api.h" +#include "blasfeo_d_blas_api.h" + + + +#endif // BLASFEO_D_BLAS_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_d_blas_api.h b/third_party/acados/include/blasfeo/include/blasfeo_d_blas_api.h new file mode 100644 index 000000000..64dd43f67 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_d_blas_api.h @@ -0,0 +1,161 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef BLASFEO_D_BLAS_API_H_ +#define BLASFEO_D_BLAS_API_H_ + + + +#include "blasfeo_target.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#ifdef BLAS_API + + + +#ifdef FORTRAN_BLAS_API + + + +// BLAS 1 +// +void daxpy_(int *n, double *alpha, double *x, int *incx, double *y, int *incy); +// +void dcopy_(int *n, double *x, int *incx, double *y, int *incy); +// +double ddot_(int *n, double *x, int *incx, double *y, int *incy); + +// BLAS 3 +// +void dgemm_(char *ta, char *tb, int *m, int *n, int *k, double *alpha, double *A, int *lda, double *B, int *ldb, double *beta, double *C, int *ldc); +// +void dsyrk_(char *uplo, char *ta, int *m, int *k, double *alpha, double *A, int *lda, double *beta, double *C, int *ldc); +// +void dtrmm_(char *side, char *uplo, char *transa, char *diag, int *m, int *n, double *alpha, double *A, int *lda, double *B, int *ldb); +// +void dtrsm_(char *side, char *uplo, char *transa, char *diag, int *m, int *n, double *alpha, double *A, int *lda, double *B, int *ldb); + + + +// LAPACK +// +void dgesv_(int *m, int *n, double *A, int *lda, int *ipiv, double *B, int *ldb, int *info); +// +void dgetrf_(int *m, int *n, double *A, int *lda, int *ipiv, int *info); +// +void dgetrf_np_(int *m, int *n, double *A, int *lda, int *info); +// +void dgetrs_(char *trans, int *m, int *n, double *A, int *lda, int *ipiv, double *B, int *ldb, int *info); +// +void dlaswp_(int *n, double *A, int *lda, int *k1, int *k2, int *ipiv, int *incx); +// +void dposv_(char *uplo, int *m, int *n, double *A, int *lda, double *B, int *ldb, int *info); +// +void dpotrf_(char *uplo, int *m, double *A, int *lda, int *info); +// +void dpotrs_(char *uplo, int *m, int *n, double *A, int *lda, double *B, int *ldb, int *info); +// +void dtrtrs_(char *uplo, char *trans, char *diag, int *m, int *n, double *A, int *lda, double *B, int *ldb, int *info); + + + +#else // BLASFEO_API + + + +// BLAS 1 +// +void blas_daxpy(int *n, double *alpha, double *x, int *incx, double *y, int *incy); +// +double blas_ddot(int *n, double *x, int *incx, double *y, int *incy); +// +void blas_dcopy(int *n, double *x, int *incx, double *y, int *incy); + +// BLAS 3 +// +void blas_dgemm(char *ta, char *tb, int *m, int *n, int *k, double *alpha, double *A, int *lda, double *B, int *ldb, double *beta, double *C, int *ldc); +// +void blas_dsyrk(char *uplo, char *ta, int *m, int *k, double *alpha, double *A, int *lda, double *beta, double *C, int *ldc); +// +void blas_dtrmm(char *side, char *uplo, char *transa, char *diag, int *m, int *n, double *alpha, double *A, int *lda, double *B, int *ldb); +// +void blas_dtrsm(char *side, char *uplo, char *transa, char *diag, int *m, int *n, double *alpha, double *A, int *lda, double *B, int *ldb); + + + +// LAPACK +// +void blas_dgesv(int *m, int *n, double *A, int *lda, int *ipiv, double *B, int *ldb, int *info); +// +void blas_dgetrf(int *m, int *n, double *A, int *lda, int *ipiv, int *info); +// +void blas_dgetrf_np(int *m, int *n, double *A, int *lda, int *info); +// +void blas_dgetrs(char *trans, int *m, int *n, double *A, int *lda, int *ipiv, double *B, int *ldb, int *info); +// +void blas_dlaswp(int *n, double *A, int *lda, int *k1, int *k2, int *ipiv, int *incx); +// +void blas_dposv(char *uplo, int *m, int *n, double *A, int *lda, double *B, int *ldb, int *info); +// +void blas_dpotrf(char *uplo, int *m, double *A, int *lda, int *info); +// +void blas_dpotrs(char *uplo, int *m, int *n, double *A, int *lda, double *B, int *ldb, int *info); +// +void blas_dtrtrs(char *uplo, char *trans, char *diag, int *m, int *n, double *A, int *lda, double *B, int *ldb, int *info); + + + +#endif // BLASFEO_API + + + +#endif // BLAS_API + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_D_BLAS_API_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_d_blasfeo_api.h b/third_party/acados/include/blasfeo/include/blasfeo_d_blasfeo_api.h new file mode 100644 index 000000000..15915f436 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_d_blasfeo_api.h @@ -0,0 +1,342 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_D_BLASFEO_API_H_ +#define BLASFEO_D_BLASFEO_API_H_ + + + +#include "blasfeo_common.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +// level 1 BLAS +// + +// z = y + alpha*x +// z[zi:zi+n] = alpha*x[xi:xi+n] + y[yi:yi+n] +// NB: Different arguments semantic compare to equivalent standard BLAS routine +void blasfeo_daxpy(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +// z = beta*y + alpha*x +void blasfeo_daxpby(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, double beta, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +// z = x .* y +void blasfeo_dvecmul(int m, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +// z += x .* y +void blasfeo_dvecmulacc(int m, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +// z = x .* y, return sum(z) = x^T * y +double blasfeo_dvecmuldot(int m, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +// return x^T * y +double blasfeo_ddot(int m, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi); +// construct givens plane rotation +void blasfeo_drotg(double a, double b, double *c, double *s); +// apply plane rotation [a b] [c -s; s; c] to the aj0 and aj1 columns of A at row index ai +void blasfeo_dcolrot(int m, struct blasfeo_dmat *sA, int ai, int aj0, int aj1, double c, double s); +// apply plane rotation [c s; -s c] [a; b] to the ai0 and ai1 rows of A at column index aj +void blasfeo_drowrot(int m, struct blasfeo_dmat *sA, int ai0, int ai1, int aj, double c, double s); + + + +// +// level 2 BLAS +// + +// dense + +// z <= beta * y + alpha * A * x +void blasfeo_dgemv_n(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, double beta, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +// z <= beta * y + alpha * A^T * x +void blasfeo_dgemv_t(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, double beta, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A ) * x, A (m)x(n) +void blasfeo_dtrsv_lnn_mn(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A^T ) * x, A (m)x(n) +void blasfeo_dtrsv_ltn_mn(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A ) * x, A (m)x(m) lower, not_transposed, not_unit +void blasfeo_dtrsv_lnn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A ) * x, A (m)x(m) lower, not_transposed, unit +void blasfeo_dtrsv_lnu(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A^T ) * x, A (m)x(m) lower, transposed, not_unit +void blasfeo_dtrsv_ltn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A^T ) * x, A (m)x(m) lower, transposed, unit +void blasfeo_dtrsv_ltu(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A^T ) * x, A (m)x(m) upper, not_transposed, not_unit +void blasfeo_dtrsv_unn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A^T ) * x, A (m)x(m) upper, transposed, not_unit +void blasfeo_dtrsv_utn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= A * x ; A lower triangular +void blasfeo_dtrmv_lnn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= A * x ; A lower triangular, unit diagonal +void blasfeo_dtrmv_lnu(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= A^T * x ; A lower triangular +void blasfeo_dtrmv_ltn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= A^T * x ; A lower triangular, unit diagonal +void blasfeo_dtrmv_ltu(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= beta * y + alpha * A * x ; A upper triangular +void blasfeo_dtrmv_unn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= A^T * x ; A upper triangular +void blasfeo_dtrmv_utn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z_n <= beta_n * y_n + alpha_n * A * x_n +// z_t <= beta_t * y_t + alpha_t * A^T * x_t +void blasfeo_dgemv_nt(int m, int n, double alpha_n, double alpha_t, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx_n, int xi_n, struct blasfeo_dvec *sx_t, int xi_t, double beta_n, double beta_t, struct blasfeo_dvec *sy_n, int yi_n, struct blasfeo_dvec *sy_t, int yi_t, struct blasfeo_dvec *sz_n, int zi_n, struct blasfeo_dvec *sz_t, int zi_t); +// z <= beta * y + alpha * A * x, where A is symmetric and only the lower triangular patr of A is accessed +void blasfeo_dsymv_l(int m, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, double beta, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +void blasfeo_dsymv_l_mn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, double beta, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); + +// diagonal + +// z <= beta * y + alpha * A * x, A diagonal +void blasfeo_dgemv_d(int m, double alpha, struct blasfeo_dvec *sA, int ai, struct blasfeo_dvec *sx, int xi, double beta, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); + + + +// +// level 3 BLAS +// + +// dense + +// D <= beta * C + alpha * A * B +void blasfeo_dgemm_nn(int m, int n, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= beta * C + alpha * A * B^T +void blasfeo_dgemm_nt(int m, int n, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= beta * C + alpha * A^T * B +void blasfeo_dgemm_tn(int m, int n, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= beta * C + alpha * A^T * B^T +void blasfeo_dgemm_tt(int m, int n, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= beta * C + alpha * A * B^T ; C, D lower triangular +void blasfeo_dsyrk_ln(int m, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +void blasfeo_dsyrk_ln_mn(int m, int n, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +#if ( defined(LA_HIGH_PERFORMANCE) & defined(MF_COLMAJ) ) +void blasfeo_dsyrk3_ln(int m, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +#endif +// D <= beta * C + alpha * A^T * B ; C, D lower triangular +void blasfeo_dsyrk_lt(int m, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +#if ( defined(LA_HIGH_PERFORMANCE) & defined(MF_COLMAJ) ) +void blasfeo_dsyrk3_lt(int m, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +#endif +// D <= beta * C + alpha * A * B^T ; C, D upper triangular +void blasfeo_dsyrk_un(int m, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +#if ( defined(LA_HIGH_PERFORMANCE) & defined(MF_COLMAJ) ) +void blasfeo_dsyrk3_un(int m, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +#endif +// D <= beta * C + alpha * A^T * B ; C, D upper triangular +void blasfeo_dsyrk_ut(int m, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +#if ( defined(LA_HIGH_PERFORMANCE) & defined(MF_COLMAJ) ) +void blasfeo_dsyrk3_ut(int m, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +#endif +// D <= alpha * A * B ; A lower triangular +void blasfeo_dtrmm_llnn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A * B ; A lower triangular +void blasfeo_dtrmm_llnu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^T * B ; A lower triangular +void blasfeo_dtrmm_lltn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^T * B ; A lower triangular +void blasfeo_dtrmm_lltu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A * B ; A upper triangular +void blasfeo_dtrmm_lunn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A * B ; A upper triangular +void blasfeo_dtrmm_lunu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^T * B ; A upper triangular +void blasfeo_dtrmm_lutn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^T * B ; A upper triangular +void blasfeo_dtrmm_lutu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A ; A lower triangular +void blasfeo_dtrmm_rlnn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A ; A lower triangular +void blasfeo_dtrmm_rlnu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^T ; A lower triangular +void blasfeo_dtrmm_rltn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^T ; A lower triangular +void blasfeo_dtrmm_rltu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A ; A upper triangular +void blasfeo_dtrmm_runn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A ; A upper triangular +void blasfeo_dtrmm_runu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^T ; A upper triangular +void blasfeo_dtrmm_rutn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^T ; A upper triangular +void blasfeo_dtrmm_rutu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A lower triangular employint explicit inverse of diagonal +// D <= alpha * A^{-1} * B , with A lower triangular employing explicit inverse of diagonal +void blasfeo_dtrsm_llnn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A lower triangular with unit diagonal +void blasfeo_dtrsm_llnu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A lower triangular employing explicit inverse of diagonal +void blasfeo_dtrsm_lltn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A lower triangular with unit diagonal +void blasfeo_dtrsm_lltu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A upper triangular employing explicit inverse of diagonal +void blasfeo_dtrsm_lunn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A upper triangular with unit diagonal +void blasfeo_dtrsm_lunu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A upper triangular employing explicit inverse of diagonal +void blasfeo_dtrsm_lutn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A upper triangular with unit diagonal +void blasfeo_dtrsm_lutu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A lower triangular employing explicit inverse of diagonal +void blasfeo_dtrsm_rlnn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A lower triangular with unit diagonal +void blasfeo_dtrsm_rlnu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A lower triangular employing explicit inverse of diagonal +void blasfeo_dtrsm_rltn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A lower triangular with unit diagonal +void blasfeo_dtrsm_rltu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A upper triangular employing explicit inverse of diagonal +void blasfeo_dtrsm_runn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A upper triangular with unit diagonal +void blasfeo_dtrsm_runu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A upper triangular employing explicit inverse of diagonal +void blasfeo_dtrsm_rutn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A upper triangular with unit diagonal +void blasfeo_dtrsm_rutu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); + +// diagonal + +// D <= alpha * A * B + beta * C, with A diagonal (stored as strvec) +void dgemm_diag_left_lib(int m, int n, double alpha, double *dA, double *pB, int sdb, double beta, double *pC, int sdc, double *pD, int sdd); +void blasfeo_dgemm_dn(int m, int n, double alpha, struct blasfeo_dvec *sA, int ai, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A * B + beta * C, with B diagonal (stored as strvec) +void blasfeo_dgemm_nd(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sB, int bi, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); + + + +// +// LAPACK +// + +// D <= chol( C ) ; C, D lower triangular +void blasfeo_dpotrf_l(int m, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +void blasfeo_dpotrf_l_mn(int m, int n, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= chol( C ) ; C, D upper triangular +void blasfeo_dpotrf_u(int m, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= chol( C + A * B' ) ; C, D lower triangular +// D <= chol( C + A * B^T ) ; C, D lower triangular +void blasfeo_dsyrk_dpotrf_ln(int m, int k, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +void blasfeo_dsyrk_dpotrf_ln_mn(int m, int n, int k, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= lu( C ) ; no pivoting +void blasfeo_dgetrf_np(int m, int n, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= lu( C ) ; row pivoting +void blasfeo_dgetrf_rp(int m, int n, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj, int *ipiv); +// D <= qr( C ) +int blasfeo_dgeqrf_worksize(int m, int n); // in bytes +void blasfeo_dgeqrf(int m, int n, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj, void *work); +// D <= Q factor, where C is the output of the LQ factorization +int blasfeo_dorglq_worksize(int m, int n, int k); // in bytes +void blasfeo_dorglq(int m, int n, int k, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj, void *work); +// D <= lq( C ) +void blasfeo_dgelqf(int m, int n, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj, void *work); +int blasfeo_dgelqf_worksize(int m, int n); // in bytes +// D <= lq( C ), positive diagonal elements +void blasfeo_dgelqf_pd(int m, int n, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj, void *work); +// [L, A] <= lq( [L, A] ), positive diagonal elements, array of matrices, with +// L lower triangular, of size (m)x(m) +// A full, of size (m)x(n1) +void blasfeo_dgelqf_pd_la(int m, int n1, struct blasfeo_dmat *sL, int li, int lj, struct blasfeo_dmat *sA, int ai, int aj, void *work); +// [L, L, A] <= lq( [L, L, A] ), positive diagonal elements, array of matrices, with: +// L lower triangular, of size (m)x(m) +// A full, of size (m)x(n1) +void blasfeo_dgelqf_pd_lla(int m, int n1, struct blasfeo_dmat *sL0, int l0i, int l0j, struct blasfeo_dmat *sL1, int l1i, int l1j, struct blasfeo_dmat *sA, int ai, int aj, void *work); + + + +// +// BLAS API helper functions +// + +#if ( defined(BLAS_API) & defined(MF_PANELMAJ) ) +// BLAS 3 +void blasfeo_cm_dgemm_nn(int m, int n, int k, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, double beta, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dgemm_nt(int m, int n, int k, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, double beta, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dgemm_tn(int m, int n, int k, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, double beta, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dgemm_tt(int m, int n, int k, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, double beta, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dsyrk_ln(int m, int k, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, double beta, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dsyrk_lt(int m, int k, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, double beta, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dsyrk_un(int m, int k, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, double beta, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dsyrk_ut(int m, int k, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, double beta, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dsyrk3_ln(int m, int k, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, double beta, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dsyrk3_lt(int m, int k, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, double beta, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dsyrk3_un(int m, int k, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, double beta, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dsyrk3_ut(int m, int k, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, double beta, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_llnn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_llnu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_lltn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_lltu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_lunn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_lunu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_lutn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_lutu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_rlnn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_rlnu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_rltn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_rltu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_runn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_runu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_rutn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrsm_rutu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_llnn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_llnu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_lltn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_lltu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_lunn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_lunu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_lutn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_lutu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_rlnn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_rlnu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_rltn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_rltu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_runn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_runu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_rutn(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dtrmm_rutu(int m, int n, double alpha, struct blasfeo_cm_dmat *sA, int ai, int aj, struct blasfeo_cm_dmat *sB, int bi, int bj, struct blasfeo_cm_dmat *sD, int di, int dj); +// LAPACK +void blasfeo_cm_dpotrf_l(int m, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dpotrf_u(int m, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj); +void blasfeo_cm_dgetrf_rp(int m, int n, struct blasfeo_cm_dmat *sC, int ci, int cj, struct blasfeo_cm_dmat *sD, int di, int dj, int *ipiv); +#endif + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_D_BLASFEO_API_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_d_blasfeo_api_ref.h b/third_party/acados/include/blasfeo/include/blasfeo_d_blasfeo_api_ref.h new file mode 100644 index 000000000..141a1f0f0 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_d_blasfeo_api_ref.h @@ -0,0 +1,147 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_D_BLASFEO_API_REF_H_ +#define BLASFEO_D_BLASFEO_API_REF_H_ + +#include "blasfeo_common.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + +// expose reference BLASFEO for testing + +// --- level 1 + +void blasfeo_daxpy_ref(int kmax, double alpha, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sy, int yi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_daxpby_ref(int kmax, double alpha, struct blasfeo_dvec_ref *sx, int xi, double beta, struct blasfeo_dvec_ref *sy, int yi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dvecmul_ref(int m, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sy, int yi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dvecmulacc_ref(int m, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sy, int yi, struct blasfeo_dvec_ref *sz, int zi); +double blasfeo_dvecmuldot_ref(int m, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sy, int yi, struct blasfeo_dvec_ref *sz, int zi); +double blasfeo_ddot_ref(int m, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sy, int yi); +void blasfeo_drotg_ref(double a, double b, double *c, double *s); +void blasfeo_dcolrot_ref(int m, struct blasfeo_dmat_ref *sA, int ai, int aj0, int aj1, double c, double s); +void blasfeo_drowrot_ref(int m, struct blasfeo_dmat_ref *sA, int ai0, int ai1, int aj, double c, double s); + + +// --- level 2 + +// dense +void blasfeo_dgemv_n_ref(int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, double beta, struct blasfeo_dvec_ref *sy, int yi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dgemv_t_ref(int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, double beta, struct blasfeo_dvec_ref *sy, int yi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dtrsv_lnn_mn_ref(int m, int n, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dtrsv_ltn_mn_ref(int m, int n, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dtrsv_lnn_ref(int m, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dtrsv_lnu_ref(int m, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dtrsv_ltn_ref(int m, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dtrsv_ltu_ref(int m, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dtrsv_unn_ref(int m, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dtrsv_utn_ref(int m, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dtrmv_unn_ref(int m, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dtrmv_utn_ref(int m, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dtrmv_lnn_ref(int m, int n, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dtrmv_ltn_ref(int m, int n, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dtrmv_lnu_ref(int m, int n, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dtrmv_ltu_ref(int m, int n, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, struct blasfeo_dvec_ref *sz, int zi); +void blasfeo_dgemv_nt_ref(int m, int n, double alpha_n, double alpha_t, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx_n, int xi_n, struct blasfeo_dvec_ref *sx_t, int xi_t, double beta_n, double beta_t, struct blasfeo_dvec_ref *sy_n, int yi_n, struct blasfeo_dvec_ref *sy_t, int yi_t, struct blasfeo_dvec_ref *sz_n, int zi_n, struct blasfeo_dvec_ref *sz_t, int zi_t); +void blasfeo_dsymv_l_ref(int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sx, int xi, double beta, struct blasfeo_dvec_ref *sy, int yi, struct blasfeo_dvec_ref *sz, int zi); + +// diagonal +void blasfeo_dgemv_d_ref(int m, double alpha, struct blasfeo_dvec_ref *sA, int ai, struct blasfeo_dvec_ref *sx, int xi, double beta, struct blasfeo_dvec_ref *sy, int yi, struct blasfeo_dvec_ref *sz, int zi); + + +// --- level 3 + +// dense +void blasfeo_dgemm_nn_ref( int m, int n, int k, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, double beta, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dgemm_nt_ref( int m, int n, int k, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, double beta, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dgemm_tn_ref(int m, int n, int k, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, double beta, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dgemm_tt_ref(int m, int n, int k, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, double beta, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); + +void blasfeo_dsyrk_ln_mn_ref( int m, int n, int k, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, double beta, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dsyrk_ln_ref( int m, int k, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, double beta, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dsyrk_lt_ref( int m, int k, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, double beta, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dsyrk_un_ref( int m, int k, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, double beta, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dsyrk_ut_ref( int m, int k, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, double beta, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); + +void blasfeo_dtrmm_rutn_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrmm_rlnn_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); + +void blasfeo_dtrsm_lunu_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_lunn_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_lutu_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_lutn_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_llnu_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_llnn_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_lltu_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_lltn_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_runu_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_runn_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_rutu_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_rutn_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_rlnu_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_rlnn_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_rltu_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dtrsm_rltn_ref( int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sD, int di, int dj); + +// diagonal +void dgemm_diag_left_lib_ref(int m, int n, double alpha, double *dA, double *pB, int sdb, double beta, double *pC, int sdc, double *pD, int sdd); +void blasfeo_dgemm_dn_ref(int m, int n, double alpha, struct blasfeo_dvec_ref *sA, int ai, struct blasfeo_dmat_ref *sB, int bi, int bj, double beta, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dgemm_nd_ref(int m, int n, double alpha, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dvec_ref *sB, int bi, double beta, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); + +// --- lapack + +void blasfeo_dgetrf_nopivot_ref(int m, int n, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dgetrf_rowpivot_ref(int m, int n, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj, int *ipiv); +void blasfeo_dpotrf_l_ref(int m, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dpotrf_l_mn_ref(int m, int n, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dsyrk_dpotrf_ln_ref(int m, int k, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dsyrk_dpotrf_ln_mn_ref(int m, int n, int k, struct blasfeo_dmat_ref *sA, int ai, int aj, struct blasfeo_dmat_ref *sB, int bi, int bj, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dgetrf_nopivot_ref(int m, int n, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj); +void blasfeo_dgetrf_rowpivot_ref(int m, int n, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj, int *ipiv); +void blasfeo_dgeqrf_ref(int m, int n, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj, void *work); +void blasfeo_dgelqf_ref(int m, int n, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj, void *work); +void blasfeo_dgelqf_pd_ref(int m, int n, struct blasfeo_dmat_ref *sC, int ci, int cj, struct blasfeo_dmat_ref *sD, int di, int dj, void *work); +void blasfeo_dgelqf_pd_la_ref(int m, int n1, struct blasfeo_dmat_ref *sL, int li, int lj, struct blasfeo_dmat_ref *sA, int ai, int aj, void *work); +void blasfeo_dgelqf_pd_lla_ref(int m, int n1, struct blasfeo_dmat_ref *sL0, int l0i, int l0j, struct blasfeo_dmat_ref *sL1, int l1i, int l1j, struct blasfeo_dmat_ref *sA, int ai, int aj, void *work); + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_D_BLASFEO_API_REF_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_d_blasfeo_ref_api.h b/third_party/acados/include/blasfeo/include/blasfeo_d_blasfeo_ref_api.h new file mode 100644 index 000000000..5773715cf --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_d_blasfeo_ref_api.h @@ -0,0 +1,271 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_D_BLASFEO_REF_API_H_ +#define BLASFEO_D_BLASFEO_REF_API_H_ + + + +#include "blasfeo_common.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +// level 1 BLAS +// + +// z = y + alpha*x +// z[zi:zi+n] = alpha*x[xi:xi+n] + y[yi:yi+n] +// NB: Different arguments semantic compare to equivalent standard BLAS routine +void blasfeo_ref_daxpy(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +// z = beta*y + alpha*x +void blasfeo_ref_daxpby(int kmax, double alpha, struct blasfeo_dvec *sx, int xi, double beta, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +// z = x .* y +void blasfeo_ref_dvecmul(int m, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +// z += x .* y +void blasfeo_ref_dvecmulacc(int m, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +// z = x .* y, return sum(z) = x^T * y +double blasfeo_ref_dvecmuldot(int m, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +// return x^T * y +double blasfeo_ref_ddot(int m, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sy, int yi); +// construct givens plane rotation +void blasfeo_ref_drotg(double a, double b, double *c, double *s); +// apply plane rotation [a b] [c -s; s; c] to the aj0 and aj1 columns of A at row index ai +void blasfeo_ref_dcolrot(int m, struct blasfeo_dmat *sA, int ai, int aj0, int aj1, double c, double s); +// apply plane rotation [c s; -s c] [a; b] to the ai0 and ai1 rows of A at column index aj +void blasfeo_ref_drowrot(int m, struct blasfeo_dmat *sA, int ai0, int ai1, int aj, double c, double s); + + + +// +// level 2 BLAS +// + +// dense + +// z <= beta * y + alpha * A * x +void blasfeo_ref_dgemv_n(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, double beta, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +// z <= beta * y + alpha * A' * x +void blasfeo_ref_dgemv_t(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, double beta, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A ) * x, A (m)x(n) +void blasfeo_ref_dtrsv_lnn_mn(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(n) +void blasfeo_ref_dtrsv_ltn_mn(int m, int n, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A ) * x, A (m)x(m) lower, not_transposed, not_unit +void blasfeo_ref_dtrsv_lnn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A ) * x, A (m)x(m) lower, not_transposed, unit +void blasfeo_ref_dtrsv_lnu(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(m) lower, transposed, not_unit +void blasfeo_ref_dtrsv_ltn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(m) lower, transposed, unit +void blasfeo_ref_dtrsv_ltu(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(m) upper, not_transposed, not_unit +void blasfeo_ref_dtrsv_unn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(m) upper, transposed, not_unit +void blasfeo_ref_dtrsv_utn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= A * x ; A lower triangular +void blasfeo_ref_dtrmv_lnn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= A * x ; A lower triangular, unit diagonal +void blasfeo_ref_dtrmv_lnu(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= A' * x ; A lower triangular +void blasfeo_ref_dtrmv_ltn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= A' * x ; A lower triangular, unit diagonal +void blasfeo_ref_dtrmv_ltu(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= beta * y + alpha * A * x ; A upper triangular +void blasfeo_ref_dtrmv_unn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z <= A' * x ; A upper triangular +void blasfeo_ref_dtrmv_utn(int m, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, struct blasfeo_dvec *sz, int zi); +// z_n <= beta_n * y_n + alpha_n * A * x_n +// z_t <= beta_t * y_t + alpha_t * A' * x_t +void blasfeo_ref_dgemv_nt(int m, int n, double alpha_n, double alpha_t, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx_n, int xi_n, struct blasfeo_dvec *sx_t, int xi_t, double beta_n, double beta_t, struct blasfeo_dvec *sy_n, int yi_n, struct blasfeo_dvec *sy_t, int yi_t, struct blasfeo_dvec *sz_n, int zi_n, struct blasfeo_dvec *sz_t, int zi_t); +// z <= beta * y + alpha * A * x, where A is symmetric and only the lower triangular patr of A is accessed +void blasfeo_ref_dsymv_l(int m, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, double beta, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); +void blasfeo_ref_dsymv_l_mn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, double beta, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); + +// diagonal + +// z <= beta * y + alpha * A * x, A diagonal +void blasfeo_ref_dgemv_d(int m, double alpha, struct blasfeo_dvec *sA, int ai, struct blasfeo_dvec *sx, int xi, double beta, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi); + + + +// +// level 3 BLAS +// + +// dense + +// D <= beta * C + alpha * A * B +void blasfeo_ref_dgemm_nn(int m, int n, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= beta * C + alpha * A * B^T +void blasfeo_ref_dgemm_nt(int m, int n, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= beta * C + alpha * A^T * B +void blasfeo_ref_dgemm_tn(int m, int n, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= beta * C + alpha * A^T * B^T +void blasfeo_ref_dgemm_tt(int m, int n, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= beta * C + alpha * A * B^T ; C, D lower triangular +void blasfeo_ref_dsyrk_ln(int m, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +void blasfeo_ref_dsyrk_ln_mn(int m, int n, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= beta * C + alpha * A^T * B ; C, D lower triangular +void blasfeo_ref_dsyrk_lt(int m, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= beta * C + alpha * A * B^T ; C, D upper triangular +void blasfeo_ref_dsyrk_un(int m, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= beta * C + alpha * A^T * B ; C, D upper triangular +void blasfeo_ref_dsyrk_ut(int m, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A * B ; A lower triangular +void blasfeo_ref_dtrmm_llnn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A * B ; A lower triangular +void blasfeo_ref_dtrmm_llnu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^T * B ; A lower triangular +void blasfeo_ref_dtrmm_lltn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^T * B ; A lower triangular +void blasfeo_ref_dtrmm_lltu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A * B ; A upper triangular +void blasfeo_ref_dtrmm_lunn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A * B ; A upper triangular +void blasfeo_ref_dtrmm_lunu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^T * B ; A upper triangular +void blasfeo_ref_dtrmm_lutn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^T * B ; A upper triangular +void blasfeo_ref_dtrmm_lutu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A ; A lower triangular +void blasfeo_ref_dtrmm_rlnn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A ; A lower triangular +void blasfeo_ref_dtrmm_rlnu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^T ; A lower triangular +void blasfeo_ref_dtrmm_rltn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^T ; A lower triangular +void blasfeo_ref_dtrmm_rltu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A ; A upper triangular +void blasfeo_ref_dtrmm_runn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A ; A upper triangular +void blasfeo_ref_dtrmm_runu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^T ; A upper triangular +void blasfeo_ref_dtrmm_rutn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^T ; A upper triangular +void blasfeo_ref_dtrmm_rutu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A lower triangular employint explicit inverse of diagonal +void blasfeo_ref_dtrsm_llnn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A lower triangular with unit diagonal +void blasfeo_ref_dtrsm_llnu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A lower triangular employint explicit inverse of diagonal +void blasfeo_ref_dtrsm_lltn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A lower triangular with unit diagonal +void blasfeo_ref_dtrsm_lltu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A upper triangular employing explicit inverse of diagonal +void blasfeo_ref_dtrsm_lunn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A upper triangular withunit diagonal +void blasfeo_ref_dtrsm_lunu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A upper triangular employing explicit inverse of diagonal +void blasfeo_ref_dtrsm_lutn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A upper triangular withunit diagonal +void blasfeo_ref_dtrsm_lutu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A lower triangular employing explicit inverse of diagonal +void blasfeo_ref_dtrsm_rlnn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A lower triangular with unit diagonal +void blasfeo_ref_dtrsm_rlnu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A lower triangular employing explicit inverse of diagonal +void blasfeo_ref_dtrsm_rltn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A lower triangular with unit diagonal +void blasfeo_ref_dtrsm_rltu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A upper triangular employing explicit inverse of diagonal +void blasfeo_ref_dtrsm_runn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A upper triangular with unit diagonal +void blasfeo_ref_dtrsm_runu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A upper triangular employing explicit inverse of diagonal +void blasfeo_ref_dtrsm_rutn(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A upper triangular with unit diagonal +void blasfeo_ref_dtrsm_rutu(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sD, int di, int dj); + +// diagonal + +// D <= alpha * A * B + beta * C, with A diagonal (stored as strvec) +void dgemm_diag_left_lib(int m, int n, double alpha, double *dA, double *pB, int sdb, double beta, double *pC, int sdc, double *pD, int sdd); +void blasfeo_ref_dgemm_dn(int m, int n, double alpha, struct blasfeo_dvec *sA, int ai, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= alpha * A * B + beta * C, with B diagonal (stored as strvec) +void blasfeo_ref_dgemm_nd(int m, int n, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sB, int bi, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); + + + +// +// LAPACK +// + +// D <= chol( C ) ; C, D lower triangular +void blasfeo_ref_dpotrf_l(int m, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +void blasfeo_ref_dpotrf_l_mn(int m, int n, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= chol( C ) ; C, D upper triangular +void blasfeo_ref_dpotrf_u(int m, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= chol( C + A * B' ) ; C, D lower triangular +void blasfeo_ref_dsyrk_dpotrf_ln(int m, int k, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +void blasfeo_ref_dsyrk_dpotrf_ln_mn(int m, int n, int k, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= lu( C ) ; no pivoting +void blasfeo_ref_dgetrf_np(int m, int n, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj); +// D <= lu( C ) ; row pivoting +void blasfeo_ref_dgetrf_rp(int m, int n, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj, int *ipiv); +// D <= qr( C ) +int blasfeo_ref_dgeqrf_worksize(int m, int n); // in bytes +void blasfeo_ref_dgeqrf(int m, int n, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj, void *work); +// D <= Q factor, where C is the output of the LQ factorization +int blasfeo_ref_dorglq_worksize(int m, int n, int k); // in bytes +void blasfeo_ref_dorglq(int m, int n, int k, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj, void *work); +// D <= lq( C ) +void blasfeo_ref_dgelqf(int m, int n, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj, void *work); +int blasfeo_ref_dgelqf_worksize(int m, int n); // in bytes +// D <= lq( C ), positive diagonal elements +void blasfeo_ref_dgelqf_pd(int m, int n, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj, void *work); +// [L, A] <= lq( [L, A] ), positive diagonal elements, array of matrices, with +// L lower triangular, of size (m)x(m) +// A full, of size (m)x(n1) +void blasfeo_ref_dgelqf_pd_la(int m, int n1, struct blasfeo_dmat *sL, int li, int lj, struct blasfeo_dmat *sA, int ai, int aj, void *work); +// [L, L, A] <= lq( [L, L, A] ), positive diagonal elements, array of matrices, with: +// L lower triangular, of size (m)x(m) +// A full, of size (m)x(n1) +void blasfeo_ref_dgelqf_pd_lla(int m, int n1, struct blasfeo_dmat *sL0, int l0i, int l0j, struct blasfeo_dmat *sL1, int l1i, int l1j, struct blasfeo_dmat *sA, int ai, int aj, void *work); + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_D_BLASFEO_REF_API_H_ + diff --git a/third_party/acados/include/blasfeo/include/blasfeo_d_kernel.h b/third_party/acados/include/blasfeo/include/blasfeo_d_kernel.h new file mode 100644 index 000000000..709485769 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_d_kernel.h @@ -0,0 +1,1247 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_D_KERNEL_H_ +#define BLASFEO_D_KERNEL_H_ + + + +#include "blasfeo_target.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// utils +void blasfeo_align_2MB(void *ptr, void **ptr_align); +void blasfeo_align_4096_byte(void *ptr, void **ptr_align); +void blasfeo_align_64_byte(void *ptr, void **ptr_align); + + +// +// lib8 +// + +// 24x8 +void kernel_dgemm_nt_24x8_lib8(int k, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nt_24x8_vs_lib8(int k, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dtrsm_nt_rl_inv_24x8_lib8(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E); // +void kernel_dpotrf_nt_l_24x8_lib8(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dpotrf_nt_l_24x8_vs_lib8(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int m1, int n1); +void kernel_dtrsm_nt_rl_inv_24x8_vs_lib8(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E, int m1, int n1); // +void kernel_dgemm_dtrsm_nt_rl_inv_24x8_lib8(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E); +void kernel_dgemm_dtrsm_nt_rl_inv_24x8_vs_lib8(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E, int m1, int n1); +void kernel_dsyrk_dpotrf_nt_l_24x8_lib8(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dsyrk_dpotrf_nt_l_24x8_vs_lib8(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int m1, int n1); +void kernel_dlarfb8_rn_24_lib8(int kmax, double *pV, double *pT, double *pD, int sdd); +// 16x8 +void kernel_dgemm_nt_16x8_lib8(int k, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nt_16x8_vs_lib8(int k, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dgemm_nt_16x8_gen_lib8(int k, double *alpha, double *A, int sda, double *B, double *beta, int offC, double *C, int sdc, int offD, double *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_dgemm_nn_16x8_lib8(int k, double *alpha, double *A, int sda, int offB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nn_16x8_vs_lib8(int k, double *alpha, double *A, int sda, int offB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dgemm_nn_16x8_gen_lib8(int k, double *alpha, double *A, int sda, int offB, double *B, int sdb, double *beta, int offC, double *C, int sdc, int offD, double *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_dsyrk_nt_l_16x8_lib8(int k, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dsyrk_nt_l_16x8_vs_lib8(int k, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dsyrk_nt_l_16x8_gen_lib8(int k, double *alpha, double *A, int sda, double *B, double *beta, int offC, double *C, int sdc, int offD, double *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_dtrmm_nn_rl_16x8_lib8(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *D, int sdd); +void kernel_dtrmm_nn_rl_16x8_vs_lib8(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *D, int sdd, int m1, int n1); +void kernel_dtrmm_nn_rl_16x8_gen_lib8(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, int offD, double *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_dtrsm_nt_rl_inv_16x8_lib8(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E); // +void kernel_dtrsm_nt_rl_inv_16x8_vs_lib8(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E, int m1, int n1); // +void kernel_dpotrf_nt_l_16x8_lib8(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dpotrf_nt_l_16x8_vs_lib8(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int m1, int n1); +void kernel_dgemm_dtrsm_nt_rl_inv_16x8_lib8(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E); +void kernel_dgemm_dtrsm_nt_rl_inv_16x8_vs_lib8(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E, int m1, int n1); +void kernel_dsyrk_dpotrf_nt_l_16x8_lib8(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dsyrk_dpotrf_nt_l_16x8_vs_lib8(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int m1, int n1); +void kernel_dlarfb8_rn_16_lib8(int kmax, double *pV, double *pT, double *pD, int sdd); +void kernel_dlarfb8_rn_la_16_lib8(int n1, double *pVA, double *pT, double *pD, int sdd, double *pA, int sda); +void kernel_dlarfb8_rn_lla_16_lib8(int n0, int n1, double *pVL, double *pVA, double *pT, double *pD, int sdd, double *pL, int sdl, double *pA, int sda); +// 8x16 +void kernel_dgemm_tt_8x16_lib8(int k, double *alpha, int offA, double *A, int sda, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dgemm_tt_8x16_vs_lib8(int k, double *alpha, int offA, double *A, int sda, double *B, int sdb, double *beta, double *C, double *D, int m1, int n1); // +void kernel_dgemm_tt_8x16_gen_lib8(int k, double *alpha, int offA, double *A, int sda, double *B, int sdb, double *beta, int offC, double *C, int sdc, int offD, double *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_dgemm_nt_8x16_lib8(int k, double *alpha, double *A, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dgemm_nt_8x16_vs_lib8(int k, double *alpha, double *A, double *B, int sdb, double *beta, double *C, double *D, int m1, int n1); // +// 8x8 +void kernel_dgemm_nt_8x8_lib8(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D); // +void kernel_dgemm_nt_8x8_vs_lib8(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D, int m1, int n1); // +void kernel_dgemm_nt_8x8_gen_lib8(int k, double *alpha, double *A, double *B, double *beta, int offC, double *C, int sdc, int offD, double *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_dgemm_nn_8x8_lib8(int k, double *alpha, double *A, int offB, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dgemm_nn_8x8_vs_lib8(int k, double *alpha, double *A, int offB, double *B, int sdb, double *beta, double *C, double *D, int m1, int n1); // +void kernel_dgemm_nn_8x8_gen_lib8(int k, double *alpha, double *A, int offB, double *B, int sdb, double *beta, int offC, double *C, int sdc, int offD, double *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_dgemm_tt_8x8_lib8(int k, double *alpha, int offA, double *A, int sda, double *B, double *beta, double *C, double *D); // +void kernel_dgemm_tt_8x8_vs_lib8(int k, double *alpha, int offA, double *A, int sda, double *B, double *beta, double *C, double *D, int m1, int n1); // +void kernel_dgemm_tt_8x8_gen_lib8(int k, double *alpha, int offA, double *A, int sda, double *B, double *beta, int offc, double *C, int sdc, int offD, double *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_dsyrk_nt_l_8x8_lib8(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D); // +void kernel_dsyrk_nt_l_8x8_vs_lib8(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D, int m1, int n1); // +void kernel_dsyrk_nt_l_8x8_gen_lib8(int k, double *alpha, double *A, double *B, double *beta, int offC, double *C, int sdc, int offD, double *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_dtrmm_nn_rl_8x8_lib8(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *D); +void kernel_dtrmm_nn_rl_8x8_vs_lib8(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *D, int m1, int n1); +void kernel_dtrmm_nn_rl_8x8_gen_lib8(int k, double *alpha, double *A, int offsetB, double *B, int sdb, int offD, double *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_dtrsm_nt_rl_inv_8x8_lib8(int k, double *A, double *B, double *beta, double *C, double *D, double *E, double *inv_diag_E); +void kernel_dtrsm_nt_rl_inv_8x8_vs_lib8(int k, double *A, double *B, double *beta, double *C, double *D, double *E, double *inv_diag_E, int m1, int n1); +void kernel_dpotrf_nt_l_8x8_lib8(int k, double *A, double *B, double *C, double *D, double *inv_diag_D); +void kernel_dpotrf_nt_l_8x8_vs_lib8(int k, double *A, double *B, double *C, double *D, double *inv_diag_D, int m1, int n1); +void kernel_dgemm_dtrsm_nt_rl_inv_8x8_lib8(int kp, double *Ap, double *Bp, int km_, double *Am, double *Bm, double *C, double *D, double *E, double *inv_diag_E); +void kernel_dgemm_dtrsm_nt_rl_inv_8x8_vs_lib8(int kp, double *Ap, double *Bp, int km_, double *Am, double *Bm, double *C, double *D, double *E, double *inv_diag_E, int m1, int n1); +void kernel_dsyrk_dpotrf_nt_l_8x8_lib8(int kp, double *Ap, double *Bp, int km_, double *Am, double *Bm, double *C, double *D, double *inv_diag_D); +void kernel_dsyrk_dpotrf_nt_l_8x8_vs_lib8(int kp, double *Ap, double *Bp, int km_, double *Am, double *Bm, double *C, double *D, double *inv_diag_D, int m1, int n1); +void kernel_dgelqf_vs_lib8(int m, int n, int k, int offD, double *pD, int sdd, double *dD); +void kernel_dgelqf_pd_vs_lib8(int m, int n, int k, int offD, double *pD, int sdd, double *dD); +void kernel_dgelqf_8_lib8(int kmax, double *pD, double *dD); +void kernel_dgelqf_pd_8_lib8(int kmax, double *pD, double *dD); +void kernel_dlarft_8_lib8(int kmax, double *pD, double *dD, double *pT); +void kernel_dlarfb8_rn_8_lib8(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb8_rn_8_vs_lib8(int kmax, double *pV, double *pT, double *pD, int m1); +void kernel_dlarfb8_rn_1_lib8(int kmax, double *pV, double *pT, double *pD); +void kernel_dgelqf_dlarft8_8_lib8(int kmax, double *pD, double *dD, double *pT); +void kernel_dgelqf_pd_dlarft8_8_lib8(int kmax, double *pD, double *dD, double *pT); +void kernel_dgelqf_pd_la_vs_lib8(int m, int n1, int k, int offD, double *pD, int sdd, double *dD, int offA, double *pA, int sda); +void kernel_dgelqf_pd_la_dlarft8_8_lib8(int kmax, double *pD, double *dD, double *pA, double *pT); +void kernel_dlarft_la_8_lib8(int n1, double *dD, double *pA, double *pT); +void kernel_dlarfb8_rn_la_8_lib8(int n1, double *pVA, double *pT, double *pD, double *pA); +void kernel_dlarfb8_rn_la_8_vs_lib8(int n1, double *pVA, double *pT, double *pD, double *pA, int m1); +void kernel_dlarfb8_rn_la_1_lib8(int n1, double *pVA, double *pT, double *pD, double *pA); +void kernel_dgelqf_pd_lla_vs_lib8(int m, int n0, int n1, int k, int offD, double *pD, int sdd, double *dD, int offL, double *pL, int sdl, int offA, double *pA, int sda); +void kernel_dgelqf_pd_lla_dlarft8_8_lib8(int n0, int n1, double *pD, double *dD, double *pL, double *pA, double *pT); +void kernel_dlarft_lla_8_lib8(int n0, int n1, double *dD, double *pL, double *pA, double *pT); +void kernel_dlarfb8_rn_lla_8_lib8(int n0, int n1, double *pVL, double *pVA, double *pT, double *pD, double *pL, double *pA); +void kernel_dlarfb8_rn_lla_8_vs_lib8(int n0, int n1, double *pVL, double *pVA, double *pT, double *pD, double *pL, double *pA, int m1); +void kernel_dlarfb8_rn_lla_1_lib8(int n0, int n1, double *pVL, double *pVA, double *pT, double *pD, double *pL, double *pA); + +// panel copy / pack +// 24 +void kernel_dpack_nn_24_lib8(int kmax, double *A, int lda, double *C, int sdc); +void kernel_dpack_nn_24_vs_lib8(int kmax, double *A, int lda, double *C, int sdc, int m1); +// 16 +void kernel_dpacp_nn_16_lib8(int kmax, int offsetA, double *A, int sda, double *B, int sdb); +void kernel_dpacp_nn_16_vs_lib8(int kmax, int offsetA, double *A, int sda, double *B, int sdb, int m1); +void kernel_dpack_nn_16_lib8(int kmax, double *A, int lda, double *C, int sdc); +void kernel_dpack_nn_16_vs_lib8(int kmax, double *A, int lda, double *C, int sdc, int m1); +// 8 +void kernel_dpacp_nn_8_lib8(int kmax, int offsetA, double *A, int sda, double *B); +void kernel_dpacp_nn_8_vs_lib8(int kmax, int offsetA, double *A, int sda, double *B, int m1); +void kernel_dpacp_tn_8_lib8(int kmax, int offsetA, double *A, int sda, double *B); +void kernel_dpacp_tn_8_vs_lib8(int kmax, int offsetA, double *A, int sda, double *B, int m1); +void kernel_dpacp_l_nn_8_lib8(int kmax, int offsetA, double *A, int sda, double *B); +void kernel_dpacp_l_nn_8_vs_lib8(int kmax, int offsetA, double *A, int sda, double *B, int m1); +void kernel_dpacp_l_tn_8_lib8(int kmax, int offsetA, double *A, int sda, double *B); +void kernel_dpacp_l_tn_8_vs_lib8(int kmax, int offsetA, double *A, int sda, double *B, int m1); +void kernel_dpaad_nn_8_lib8(int kmax, double *alpha, int offsetA, double *A, int sda, double *B); +void kernel_dpaad_nn_8_vs_lib8(int kmax, double *alpha, int offsetA, double *A, int sda, double *B, int m1); +void kernel_dpack_nn_8_lib8(int kmax, double *A, int lda, double *C); +void kernel_dpack_nn_8_vs_lib8(int kmax, double *A, int lda, double *C, int m1); +void kernel_dpack_tn_8_lib8(int kmax, double *A, int lda, double *C); +void kernel_dpack_tn_8_vs_lib8(int kmax, double *A, int lda, double *C, int m1); +// 4 +void kernel_dpack_tt_4_lib8(int kmax, double *A, int lda, double *C, int sdc); // TODO offsetC +void kernel_dpack_tt_4_vs_lib8(int kmax, double *A, int lda, double *C, int sdc, int m1); // TODO offsetC + +// level 2 BLAS +// 16 +void kernel_dgemv_n_16_lib8(int k, double *alpha, double *A, int sda, double *x, double *beta, double *y, double *z); +// 8 +void kernel_dgemv_n_8_lib8(int k, double *alpha, double *A, double *x, double *beta, double *y, double *z); +void kernel_dgemv_n_8_vs_lib8(int k, double *alpha, double *A, double *x, double *beta, double *y, double *z, int m1); +//void kernel_dgemv_n_8_gen_lib8(int k, double *alpha, double *A, double *x, double *beta, double *y, double *z, int m0, int m1); +void kernel_dgemv_n_8_gen_lib8(int k, double *alpha, int offsetA, double *A, double *x, double *beta, double *y, double *z, int m1); +void kernel_dgemv_t_8_lib8(int k, double *alpha, int offsetA, double *A, int sda, double *x, double *beta, double *y, double *z); +void kernel_dgemv_t_8_vs_lib8(int k, double *alpha, int offsetA, double *A, int sda, double *x, double *beta, double *y, double *z, int n1); +void kernel_dgemv_nt_8_lib8(int kmax, double *alpha_n, double *alpha_t, int offsetA, double *A, int sda, double *x_n, double *x_t, double *beta_t, double *y_t, double *z_n, double *z_t); +void kernel_dgemv_nt_8_vs_lib8(int kmax, double *alpha_n, double *alpha_t, int offsetA, double *A, int sda, double *x_n, double *x_t, double *beta_t, double *y_t, double *z_n, double *z_t, int n1); +void kernel_dsymv_l_8_lib8(int kmax, double *alpha, double *A, int sda, double *x, double *z); +void kernel_dsymv_l_8_vs_lib8(int kmax, double *alpha, double *A, int sda, double *x, double *z, int n1); +void kernel_dsymv_l_8_gen_lib8(int kmax, double *alpha, int offsetA, double *A, int sda, double *x, double *z, int n1); +void kernel_dtrmv_n_ln_8_lib8(int k, double *A, double *x, double *z); +void kernel_dtrmv_n_ln_8_vs_lib8(int k, double *A, double *x, double *z, int m1); +void kernel_dtrmv_n_ln_8_gen_lib8(int k, int offsetA, double *A, double *x, double *z, int m1); +void kernel_dtrmv_t_ln_8_lib8(int k, double *A, int sda, double *x, double *z); +void kernel_dtrmv_t_ln_8_vs_lib8(int k, double *A, int sda, double *x, double *z, int n1); +void kernel_dtrmv_t_ln_8_gen_lib8(int k, int offsetA, double *A, int sda, double *x, double *z, int n1); +void kernel_dtrsv_n_l_inv_8_lib8(int k, double *A, double *inv_diag_A, double *x, double *z); +void kernel_dtrsv_n_l_inv_8_vs_lib8(int k, double *A, double *inv_diag_A, double *x, double *z, int m1, int n1); +void kernel_dtrsv_t_l_inv_8_lib8(int k, double *A, int sda, double *inv_diag_A, double *x, double *z); +void kernel_dtrsv_t_l_inv_8_vs_lib8(int k, double *A, int sda, double *inv_diag_A, double *x, double *z, int m1, int n1); + + + +// +// lib4 +// + +// level 2 BLAS +// 12 +void kernel_dgemv_n_12_lib4(int k, double *alpha, double *A, int sda, double *x, double *beta, double *y, double *z); +void kernel_dgemv_t_12_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *x, double *beta, double *y, double *z); +// 8 +void kernel_dgemv_n_8_lib4(int k, double *alpha, double *A, int sda, double *x, double *beta, double *y, double *z); +void kernel_dgemv_t_8_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *x, double *beta, double *y, double *z); +void kernel_dtrmv_un_8_lib4(int k, double *A, int sda, double *x, double *z); +// 4 +void kernel_dgemv_n_4_lib4(int k, double *alpha, double *A, double *x, double *beta, double *y, double *z); +void kernel_dgemv_n_4_vs_lib4(int k, double *alpha, double *A, double *x, double *beta, double *y, double *z, int k1); +void kernel_dgemv_n_4_gen_lib4(int kmax, double *alpha, double *A, double *x, double *beta, double *y, double *z, int k0, int k1); +void kernel_dgemv_t_4_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *x, double *beta, double *y, double *z); +void kernel_dgemv_t_4_vs_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *x, double *beta, double *y, double *z, int k1); +void kernel_dtrsv_ln_inv_4_lib4(int k, double *A, double *inv_diag_A, double *x, double *y, double *z); +void kernel_dtrsv_ln_inv_4_vs_lib4(int k, double *A, double *inv_diag_A, double *x, double *y, double *z, int km, int kn); +void kernel_dtrsv_lt_inv_4_lib4(int k, double *A, int sda, double *inv_diag_A, double *x, double *y, double *z); +void kernel_dtrsv_lt_inv_3_lib4(int k, double *A, int sda, double *inv_diag_A, double *x, double *y, double *z); +void kernel_dtrsv_lt_inv_2_lib4(int k, double *A, int sda, double *inv_diag_A, double *x, double *y, double *z); +void kernel_dtrsv_lt_inv_1_lib4(int k, double *A, int sda, double *inv_diag_A, double *x, double *y, double *z); +void kernel_dtrsv_lt_one_4_lib4(int k, double *A, int sda, double *x, double *y, double *z); +void kernel_dtrsv_lt_one_3_lib4(int k, double *A, int sda, double *x, double *y, double *z); +void kernel_dtrsv_lt_one_2_lib4(int k, double *A, int sda, double *x, double *y, double *z); +void kernel_dtrsv_lt_one_1_lib4(int k, double *A, int sda, double *x, double *y, double *z); +void kernel_dtrsv_ln_one_4_vs_lib4(int kmax, double *A, double *x, double *y, double *z, int km, int kn); +void kernel_dtrsv_ln_one_4_lib4(int kmax, double *A, double *x, double *y, double *z); +void kernel_dtrsv_un_inv_4_lib4(int kmax, double *A, double *inv_diag_A, double *x, double *y, double *z); +void kernel_dtrsv_ut_inv_4_lib4(int kmax, double *A, int sda, double *inv_diag_A, double *x, double *y, double *z); +void kernel_dtrsv_ut_inv_4_vs_lib4(int kmax, double *A, int sda, double *inv_diag_A, double *x, double *y, double *z, int m1, int n1); +void kernel_dtrmv_un_4_lib4(int k, double *A, double *x, double *z); +void kernel_dtrmv_ut_4_lib4(int k, double *A, int sda, double *x, double *z); +void kernel_dtrmv_ut_4_vs_lib4(int k, double *A, int sda, double *x, double *z, int km); +void kernel_dgemv_nt_6_lib4(int kmax, double *alpha_n, double *alpha_t, double *A, int sda, double *x_n, double *x_t, double *beta_t, double *y_t, double *z_n, double *z_t); +void kernel_dgemv_nt_4_lib4(int kmax, double *alpha_n, double *alpha_t, double *A, int sda, double *x_n, double *x_t, double *beta_t, double *y_t, double *z_n, double *z_t); +void kernel_dgemv_nt_4_vs_lib4(int kmax, double *alpha_n, double *alpha_t, double *A, int sda, double *x_n, double *x_t, double *beta_t, double *y_t, double *z_n, double *z_t, int km); +void kernel_dsymv_l_4_lib4(int kmax, double *alpha, double *A, int sda, double *x, double *z); +void kernel_dsymv_l_4_gen_lib4(int kmax, double *alpha, int offA, double *A, int sda, double *x, double *z, int km); + + + +// level 3 BLAS +// 12x4 +void kernel_dgemm_nt_12x4_lib4(int k, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nt_12x4_vs_lib4(int k, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, int km, int kn); // +void kernel_dgemm_nt_12x4_gen_lib4(int k, double *alpha, double *A, int sda, double *B, double *beta, int offsetC, double *C, int sdc, int offsetD, double *D, int sdd, int m0, int m1, int k0, int k1); +void kernel_dgemm_nn_12x4_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nn_12x4_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int km, int kn); // +void kernel_dgemm_nn_12x4_gen_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, int offsetC, double *C, int sdc, int offsetD, double *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_dgemm_tt_12x4_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_tt_12x4_vs_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dsyrk_nn_u_12x4_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dsyrk_nn_u_12x4_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dsyrk_nt_l_12x4_lib4(int k, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dsyrk_nt_l_12x4_vs_lib4(int k, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, int km, int kn); // +void kernel_dtrmm_nt_ru_12x4_lib4(int k, double *alpha, double *A, int sda, double *B, double *D, int sdd); // +void kernel_dtrmm_nt_ru_12x4_vs_lib4(int k, double *alpha, double *A, int sda, double *B, double *D, int sdd, int km, int kn); // +void kernel_dtrmm_nn_rl_12x4_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *D, int sdd); +void kernel_dtrmm_nn_rl_12x4_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *D, int sdd, int km, int kn); +void kernel_dtrsm_nt_rl_inv_12x4_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E); +void kernel_dtrsm_nt_rl_inv_12x4_vs_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E, int km, int kn); +void kernel_dtrsm_nt_rl_one_12x4_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E); +void kernel_dtrsm_nt_rl_one_12x4_vs_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, int km, int kn); +void kernel_dtrsm_nt_ru_inv_12x4_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E); +void kernel_dtrsm_nt_ru_inv_12x4_vs_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E, int km, int kn); +void kernel_dtrsm_nt_ru_one_12x4_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E); +void kernel_dtrsm_nt_ru_one_12x4_vs_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, int km, int kn); +void kernel_dtrsm_nn_ru_inv_12x4_lib4(int k, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E); +void kernel_dtrsm_nn_ru_inv_12x4_vs_lib4(int k, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E, int km, int kn); +void kernel_dtrsm_nn_ll_inv_12x4_lib4(int k, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int sde, double *inv_diag_E); +void kernel_dtrsm_nn_ll_inv_12x4_vs_lib4(int k, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int sde, double *inv_diag_E, int km, int kn); +void kernel_dtrsm_nn_ll_one_12x4_lib4(int k, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int sde); +void kernel_dtrsm_nn_ll_one_12x4_vs_lib4(int k, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int sde, int km, int kn); +void kernel_dtrsm_nn_lu_inv_12x4_lib4(int kmax, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *E, int sde, double *inv_diag_E); +void kernel_dtrsm_nn_lu_inv_12x4_vs_lib4(int kmax, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *E, int sde, double *inv_diag_E, int km, int kn); +// 4x12 +void kernel_dgemm_nt_4x12_lib4(int k, double *alpha, double *A, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dgemm_nt_4x12_vs_lib4(int k, double *alpha, double *A, double *B, int sdb, double *beta, double *C, double *D, int km, int kn); // +void kernel_dgemm_nn_4x12_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dgemm_nn_4x12_vs_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D, int m1, int n1); // +void kernel_dgemm_tt_4x12_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dgemm_tt_4x12_vs_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *B, int sdb, double *beta, double *C, double *D, int m1, int n1); // +void kernel_dgemm_tt_4x12_gen_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *B, int sdb, double *beta, int offsetC, double *C, int sdc, int offsetD, double *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_dtrsm_nt_rl_inv_4x12_lib4(int k, double *A, double *B, int sdb, double *C, double *D, double *E, int sed, double *inv_diag_E); +void kernel_dtrsm_nt_rl_inv_4x12_vs_lib4(int k, double *A, double *B, int sdb, double *C, double *D, double *E, int sed, double *inv_diag_E, int km, int kn); +// 8x8 +void kernel_dgemm_nt_8x8l_lib4(int k, double *alpha, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // computes [A00 *; A10 A11] +void kernel_dgemm_nt_8x8u_lib4(int k, double *alpha, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // computes [A00 *; A10 A11] +void kernel_dgemm_nt_8x8l_vs_lib4(int k, double *alpha, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int km, int kn); // computes [A00 *; A10 A11] +void kernel_dgemm_nt_8x8u_vs_lib4(int k, double *alpha, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int km, int kn); // computes [A00 *; A10 A11] +void kernel_dsyrk_nn_u_8x8_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dsyrk_nn_u_8x8_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dsyrk_nt_l_8x8_lib4(int k, double *alpha, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // computes [L00 *; A10 L11] +void kernel_dsyrk_nt_l_8x8_vs_lib4(int k, double *alpha, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int km, int kn); // computes [L00 *; A10 L11] +void kernel_dtrsm_nt_rl_inv_8x8l_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *E, int sed, double *inv_diag_E); +void kernel_dtrsm_nt_rl_inv_8x8l_vs_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *E, int sed, double *inv_diag_E, int km, int kn); +void kernel_dtrsm_nt_rl_inv_8x8u_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *E, int sed, double *inv_diag_E); +void kernel_dtrsm_nt_rl_inv_8x8u_vs_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *E, int sed, double *inv_diag_E, int km, int kn); +// 8x4 +void kernel_dgemm_nt_8x4_lib4(int k, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nt_8x4_vs_lib4(int k, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, int km, int kn); // +void kernel_dgemm_nt_8x4_gen_lib4(int k, double *alpha, double *A, int sda, double *B, double *beta, int offsetC, double *C, int sdc, int offsetD, double *D, int sdd, int m0, int m1, int k0, int k1); +void kernel_dgemm_nn_8x4_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nn_8x4_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dgemm_nn_8x4_gen_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, int offsetC, double *C, int sdc, int offsetD, double *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_dgemm_tt_8x4_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_tt_8x4_vs_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dsyrk_nn_u_8x4_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dsyrk_nn_u_8x4_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dsyrk_nt_l_8x4_lib4(int k, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dsyrk_nt_l_8x4_vs_lib4(int k, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, int km, int kn); // +void kernel_dsyrk_nt_l_8x4_gen_lib4(int k, double *alpha, double *A, int sda, double *B, double *beta, int offsetC, double *C, int sdc, int offsetD, double *D, int sdd, int m0, int m1, int k0, int k1); +void kernel_dtrmm_nt_ru_8x4_lib4(int k, double *alpha, double *A, int sda, double *B, double *D, int sdd); // +void kernel_dtrmm_nt_ru_8x4_vs_lib4(int k, double *alpha, double *A, int sda, double *B, double *D, int sdd, int km, int kn); // +void kernel_dtrmm_nn_rl_8x4_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *D, int sdd); +void kernel_dtrmm_nn_rl_8x4_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *D, int sdd, int km, int kn); +void kernel_dtrmm_nn_rl_8x4_gen_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, int offsetD, double *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_dtrsm_nt_rl_inv_8x4_vs_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E, int km, int kn); +void kernel_dtrsm_nt_rl_inv_8x4_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E); +void kernel_dtrsm_nt_rl_one_8x4_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E); +void kernel_dtrsm_nt_rl_one_8x4_vs_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, int km, int kn); +void kernel_dtrsm_nt_ru_inv_8x4_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E); +void kernel_dtrsm_nt_ru_inv_8x4_vs_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E, int km, int kn); +void kernel_dtrsm_nt_ru_one_8x4_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E); +void kernel_dtrsm_nt_ru_one_8x4_vs_lib4(int k, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd, double *E, int km, int kn); +void kernel_dtrsm_nn_ru_inv_8x4_lib4(int k, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E); +void kernel_dtrsm_nn_ru_inv_8x4_vs_lib4(int k, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E, int km, int kn); +void kernel_dtrsm_nn_ll_inv_8x4_lib4(int k, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int sde, double *inv_diag_E); +void kernel_dtrsm_nn_ll_inv_8x4_vs_lib4(int k, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int sde, double *inv_diag_E, int km, int kn); +void kernel_dtrsm_nn_ll_one_8x4_lib4(int k, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int sde); +void kernel_dtrsm_nn_ll_one_8x4_vs_lib4(int k, double *A, int sda, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int sde, int km, int kn); +void kernel_dtrsm_nn_lu_inv_8x4_lib4(int kmax, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *E, int sde, double *inv_diag_E); +void kernel_dtrsm_nn_lu_inv_8x4_vs_lib4(int kmax, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *E, int sde, double *inv_diag_E, int km, int kn); +// 4x8 +void kernel_dgemm_nt_4x8_lib4(int k, double *alpha, double *A, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dgemm_nt_4x8_vs_lib4(int k, double *alpha, double *A, double *B, int sdb, double *beta, double *C, double *D, int km, int kn); // +void kernel_dgemm_nn_4x8_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dgemm_nn_4x8_vs_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D, int m1, int n1); // +void kernel_dgemm_tt_4x8_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dgemm_tt_4x8_vs_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *B, int sdb, double *beta, double *C, double *D, int m1, int n1); // +void kernel_dgemm_tt_4x8_gen_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *B, int sdb, double *beta, int offsetC, double *C, int sdc, int offsetD, double *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_dtrsm_nt_rl_inv_4x8_lib4(int k, double *A, double *B, int sdb, double *C, double *D, double *E, int sed, double *inv_diag_E); +void kernel_dtrsm_nt_rl_inv_4x8_vs_lib4(int k, double *A, double *B, int sdb, double *C, double *D, double *E, int sed, double *inv_diag_E, int km, int kn); +// 8x2 +void kernel_dgemm_nn_8x2_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nn_8x2_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +// 2x8 +void kernel_dgemm_nn_2x8_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dgemm_nn_2x8_vs_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D, int m1, int n1); // +// 10xX +void kernel_dgemm_nn_10x4_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nn_10x4_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dgemm_nn_10x2_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nn_10x2_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +// 6xX +void kernel_dgemm_nn_8x6_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nn_8x6_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dgemm_nn_6x8_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nn_6x8_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dgemm_nn_6x6_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nn_6x6_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dgemm_nn_6x4_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nn_6x4_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +void kernel_dgemm_nn_6x2_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd); // +void kernel_dgemm_nn_6x2_vs_lib4(int k, double *alpha, double *A, int sda, int offsetB, double *B, int sdb, double *beta, double *C, int sdc, double *D, int sdd, int m1, int n1); // +// 4x4 +void kernel_dgemm_nt_4x4_lib4(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D); // +void kernel_dgemm_nt_4x4_vs_lib4(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D, int km, int kn); // +void kernel_dgemm_nt_4x4_gen_lib4(int k, double *alpha, double *A, double *B, double *beta, int offsetC, double *C, int sdc, int offsetD, double *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_dgemm_nn_4x4_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dgemm_nn_4x4_vs_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D, int m1, int n1); // +void kernel_dgemm_nn_4x4_gen_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, int offsetC, double *C, int sdc, int offsetD, double *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_dgemm_tt_4x4_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *B, double *beta, double *C, double *D); // +void kernel_dgemm_tt_4x4_vs_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *B, double *beta, double *C, double *D, int m1, int n1); // +void kernel_dgemm_tt_4x4_gen_lib4(int k, double *alpha, int offsetA, double *A, int sda, double *B, double *beta, int offsetC, double *C, int sdc, int offsetD, double *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_dsyrk_nn_u_4x4_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dsyrk_nn_u_4x4_vs_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D, int m1, int n1); // +void kernel_dsyrk_nt_l_4x4_lib4(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D); // +void kernel_dsyrk_nt_l_4x4_vs_lib4(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D, int km, int kn); // +void kernel_dsyrk_nt_l_4x4_gen_lib4(int k, double *alpha, double *A, double *B, double *beta, int offsetC, double *C, int sdc, int offsetD, double *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_dsyrk_nt_u_4x4_lib4(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D); // +void kernel_dsyrk_nt_u_4x4_vs_lib4(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D, int km, int kn); // +void kernel_dsyrk_nt_u_4x4_gen_lib4(int k, double *alpha, double *A, double *B, double *beta, int offsetC, double *C, int sdc, int offsetD, double *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_dtrmm_nt_ru_4x4_lib4(int k, double *alpha, double *A, double *B, double *D); // +void kernel_dtrmm_nt_ru_4x4_vs_lib4(int k, double *alpha, double *A, double *B, double *D, int km, int kn); // +void kernel_dtrmm_nn_rl_4x4_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *D); +void kernel_dtrmm_nn_rl_4x4_vs_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *D, int m1, int n1); +void kernel_dtrmm_nn_rl_4x4_gen_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, int offsetD, double *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_dtrsm_nt_rl_inv_4x4_lib4(int k, double *A, double *B, double *beta, double *C, double *D, double *E, double *inv_diag_E); +void kernel_dtrsm_nt_rl_inv_4x4_vs_lib4(int k, double *A, double *B, double *beta, double *C, double *D, double *E, double *inv_diag_E, int km, int kn); +void kernel_dtrsm_nt_rl_one_4x4_lib4(int k, double *A, double *B, double *beta, double *C, double *D, double *E); +void kernel_dtrsm_nt_rl_one_4x4_vs_lib4(int k, double *A, double *B, double *beta, double *C, double *D, double *E, int km, int kn); +void kernel_dtrsm_nt_ru_inv_4x4_lib4(int k, double *A, double *B, double *beta, double *C, double *D, double *E, double *inv_diag_E); +void kernel_dtrsm_nt_ru_inv_4x4_vs_lib4(int k, double *A, double *B, double *beta, double *C, double *D, double *E, double *inv_diag_E, int km, int kn); +void kernel_dtrsm_nt_ru_one_4x4_lib4(int k, double *A, double *B, double *beta, double *C, double *D, double *E); +void kernel_dtrsm_nt_ru_one_4x4_vs_lib4(int k, double *A, double *B, double *beta, double *C, double *D, double *E, int km, int kn); +void kernel_dtrsm_nn_ru_inv_4x4_lib4(int k, double *A, double *B, int sdb, double *beta, double *C, double *D, double *E, double *inv_diag_E); +void kernel_dtrsm_nn_ru_inv_4x4_vs_lib4(int k, double *A, double *B, int sdb, double *beta, double *C, double *D, double *E, double *inv_diag_E, int km, int kn); +void kernel_dtrsm_nn_ll_inv_4x4_lib4(int k, double *A, double *B, int sdb, double *beta, double *C, double *D, double *E, double *inv_diag_E); +void kernel_dtrsm_nn_ll_inv_4x4_vs_lib4(int k, double *A, double *B, int sdb, double *beta, double *C, double *D, double *E, double *inv_diag_E, int km, int kn); +void kernel_dtrsm_nn_ll_one_4x4_lib4(int k, double *A, double *B, int sdb, double *beta, double *C, double *D, double *E); +void kernel_dtrsm_nn_ll_one_4x4_vs_lib4(int k, double *A, double *B, int sdb, double *beta, double *C, double *D, double *E, int km, int kn); +void kernel_dtrsm_nn_lu_inv_4x4_lib4(int kmax, double *A, double *B, int sdb, double *C, double *D, double *E, double *inv_diag_E); +void kernel_dtrsm_nn_lu_inv_4x4_vs_lib4(int kmax, double *A, double *B, int sdb, double *C, double *D, double *E, double *inv_diag_E, int km, int kn); +void kernel_dtrsm_nn_lu_one_4x4_lib4(int kmax, double *A, double *B, int sdb, double *C, double *D, double *E); +void kernel_dtrsm_nn_lu_one_4x4_vs_lib4(int kmax, double *A, double *B, int sdb, double *C, double *D, double *E, int km, int kn); +// 4x2 +void kernel_dgemm_nn_4x2_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dgemm_nn_4x2_vs_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D, int m1, int n1); // +void kernel_dgemm_nt_4x2_lib4(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D); +void kernel_dgemm_nt_4x2_vs_lib4(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D, int m1, int n1); +void kernel_dsyrk_nt_l_4x2_lib4(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D); // +void kernel_dsyrk_nt_l_4x2_vs_lib4(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D, int km, int kn); // +void kernel_dtrmm_nn_rl_4x2_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *D); +void kernel_dtrmm_nn_rl_4x2_vs_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *D, int m1, int n1); +void kernel_dtrsm_nt_rl_inv_4x2_lib4(int k, double *A, double *B, double *beta, double *C, double *D, double *E, double *inv_diag_E); +void kernel_dtrsm_nt_rl_inv_4x2_vs_lib4(int k, double *A, double *B, double *beta, double *C, double *D, double *E, double *inv_diag_E, int km, int kn); +// 2x4 +void kernel_dgemm_nn_2x4_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dgemm_nn_2x4_vs_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D, int m1, int n1); // +// 2x2 +void kernel_dgemm_nn_2x2_lib4(int k, double *alpha, double *A, int offsetB, double *B, int sdb, double *beta, double *C, double *D); // +void kernel_dsyrk_nt_l_2x2_lib4(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D); // +void kernel_dsyrk_nt_l_2x2_vs_lib4(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D, int km, int kn); // +// diag +void kernel_dgemm_diag_right_4_a0_lib4(int kmax, double *alpha, double *A, int sda, double *B, double *D, int sdd); +void kernel_dgemm_diag_right_4_lib4(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd); +void kernel_dgemm_diag_right_3_lib4(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd); +void kernel_dgemm_diag_right_2_lib4(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd); +void kernel_dgemm_diag_right_1_lib4(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int sdd); +void kernel_dgemm_diag_left_4_a0_lib4(int kmax, double *alpha, double *A, double *B, double *D); +void kernel_dgemm_diag_left_4_lib4(int kmax, double *alpha, double *A, double *B, double *beta, double *C, double *D); +void kernel_dgemm_diag_left_3_lib4(int kmax, double *alpha, double *A, double *B, double *beta, double *C, double *D); +void kernel_dgemm_diag_left_2_lib4(int kmax, double *alpha, double *A, double *B, double *beta, double *C, double *D); +void kernel_dgemm_diag_left_1_lib4(int kmax, double *alpha, double *A, double *B, double *beta, double *C, double *D); +// low rank update +void kernel_dger4_sub_12r_lib4(int k, double *A, int sda, double *B, double *C, int sdc); +void kernel_dger4_sub_12r_vs_lib4(int k, double *A, int sda, double *B, double *C, int sdc, int km); +void kernel_dger4_sub_8r_lib4(int k, double *A, int sda, double *B, double *C, int sdc); +void kernel_dger4_sub_8r_vs_lib4(int k, double *A, int sda, double *B, double *C, int sdc, int km); +void kernel_dger4_sub_4r_lib4(int n, double *A, double *B, double *C); +void kernel_dger4_sub_4r_vs_lib4(int n, double *A, double *B, double *C, int km); + + + +// LAPACK +// 12x4 +void kernel_dpotrf_nt_l_12x4_lib4(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dpotrf_nt_l_12x4_vs_lib4(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +void kernel_dgetrf_nn_l_12x4_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dgetrf_nn_l_12x4_vs_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +void kernel_dgetrf_nn_m_12x4_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dgetrf_nn_m_12x4_vs_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +void kernel_dgetrf_nn_r_12x4_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dgetrf_nn_r_12x4_vs_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +void kernel_dgetrf_nt_l_12x4_lib4(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dgetrf_nt_l_12x4_vs_lib4(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +void kernel_dgetrf_nt_m_12x4_lib4(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dgetrf_nt_m_12x4_vs_lib4(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +void kernel_dgetrf_nt_r_12x4_lib4(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dgetrf_nt_r_12x4_vs_lib4(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +// 8x8 +void kernel_dpotrf_nt_l_8x8_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dpotrf_nt_l_8x8_vs_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +// 8x4 +void kernel_dpotrf_nt_l_8x4_lib4(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dpotrf_nt_l_8x4_vs_lib4(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +void kernel_dgetrf_nn_l_8x4_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dgetrf_nn_l_8x4_vs_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +void kernel_dgetrf_nn_r_8x4_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dgetrf_nn_r_8x4_vs_lib4(int k, double *A, int sda, double *B, int sdb, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +void kernel_dgetrf_nt_l_8x4_lib4(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dgetrf_nt_l_8x4_vs_lib4(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +void kernel_dgetrf_nt_r_8x4_lib4(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dgetrf_nt_r_8x4_vs_lib4(int k, double *A, int sda, double *B, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +// 4x4 +void kernel_dpotrf_nt_l_4x4_lib4(int k, double *A, double *B, double *C, double *D, double *inv_diag_D); +void kernel_dpotrf_nt_l_4x4_vs_lib4(int k, double *A, double *B, double *C, double *D, double *inv_diag_D, int km, int kn); +#if defined(TARGET_X64_INTEL_SANDY_BRIDGE) +void kernel_dlauum_nt_4x4_lib4(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D); // +void kernel_dlauum_nt_4x4_vs_lib4(int k, double *alpha, double *A, double *B, double *beta, double *C, double *D, int km, int kn); // +#endif +void kernel_dgetrf_nn_4x4_lib4(int k, double *A, double *B, int sdb, double *C, double *D, double *inv_diag_D); +void kernel_dgetrf_nn_4x4_vs_lib4(int k, double *A, double *B, int sdb, double *C, double *D, double *inv_diag_D, int km, int kn); +void kernel_dgetrf_nt_4x4_lib4(int k, double *A, double *B, double *C, double *D, double *inv_diag_D); +void kernel_dgetrf_nt_4x4_vs_lib4(int k, double *A, double *B, double *C, double *D, double *inv_diag_D, int km, int kn); +void kernel_dgeqrf_4_lib4(int m, double *pD, int sdd, double *dD); +void kernel_dgeqrf_vs_lib4(int m, int n, int k, int offD, double *pD, int sdd, double *dD); +void kernel_dlarf_4_lib4(int m, int n, double *pV, int sdv, double *tau, double *pC, int sdc); // rank-4 reflector +void kernel_dlarf_t_4_lib4(int m, int n, double *pD, int sdd, double *pVt, double *dD, double *pC0, int sdc, double *pW); +void kernel_dgelqf_4_lib4(int n, double *pD, double *dD); +void kernel_dgelqf_vs_lib4(int m, int n, int k, int offD, double *pD, int sdd, double *dD); +void kernel_dlarft_4_lib4(int kmax, double *pD, double *dD, double *pT); +void kernel_dlarft_3_lib4(int kmax, double *pD, double *dD, double *pT); +void kernel_dlarft_2_lib4(int kmax, double *pD, double *dD, double *pT); +void kernel_dlarft_1_lib4(int kmax, double *pD, double *dD, double *pT); +void kernel_dgelqf_dlarft12_12_lib4(int n, double *pD, int sdd, double *dD, double *pT); +void kernel_dgelqf_dlarft4_12_lib4(int n, double *pD, int sdd, double *dD, double *pT); +void kernel_dgelqf_dlarft4_8_lib4(int n, double *pD, int sdd, double *dD, double *pT); +void kernel_dgelqf_dlarft4_4_lib4(int n, double *pD, double *dD, double *pT); +void kernel_dlarfb12_rn_12_lib4(int kmax, double *pV, int sdd, double *pT, double *pD, double *pK); +void kernel_dlarfb12_rn_4_lib4(int kmax, double *pV, int sdd, double *pT, double *pD, double *pK, int km); +void kernel_dlarfb4_rn_12_lib4(int kmax, double *pV, double *pT, double *pD, int sdd); +void kernel_dlarfb4_rn_8_lib4(int kmax, double *pV, double *pT, double *pD, int sdd); +void kernel_dlarfb4_rn_4_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb3_rn_4_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb2_rn_4_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb1_rn_4_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb4_rn_1_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb3_rn_1_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb2_rn_1_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb1_rn_1_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb4_rt_4_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb3_rt_4_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb2_rt_4_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb1_rt_4_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb4_rt_1_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb3_rt_1_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb2_rt_1_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dlarfb1_rt_1_lib4(int kmax, double *pV, double *pT, double *pD); +void kernel_dgelqf_pd_dlarft12_12_lib4(int n, double *pD, int sdd, double *dD, double *pT); +void kernel_dgelqf_pd_dlarft4_8_lib4(int n, double *pD, int sdd, double *dD, double *pT); +void kernel_dgelqf_pd_dlarft4_4_lib4(int n, double *pD, double *dD, double *pT); +void kernel_dgelqf_pd_4_lib4(int n, double *pD, double *dD); +void kernel_dgelqf_pd_vs_lib4(int m, int n, int k, int offD, double *pD, int sdd, double *dD); +void kernel_dgelqf_pd_la_vs_lib4(int m, int n1, int k, int offD, double *pD, int sdd, double *dD, int offA, double *pA, int sda); +void kernel_dlarft_4_la_lib4(int n1, double *dD, double *pA, double *pT); +void kernel_dlarfb4_rn_12_la_lib4(int n1, double *pVA, double *pT, double *pD, int sdd, double *pA, int sda); +void kernel_dlarfb4_rn_8_la_lib4(int n1, double *pVA, double *pT, double *pD, int sdd, double *pA, int sda); +void kernel_dlarfb4_rn_4_la_lib4(int n1, double *pVA, double *pT, double *pD, double *pA); +void kernel_dlarfb4_rn_1_la_lib4(int n1, double *pVA, double *pT, double *pD, double *pA); +void kernel_dgelqf_pd_lla_vs_lib4(int m, int n0, int n1, int k, int offD, double *pD, int sdd, double *dD, int offL, double *pL, int sdl, int offA, double *pA, int sda); +void kernel_dlarft_4_lla_lib4(int n0, int n1, double *dD, double *pL, double *pA, double *pT); +void kernel_dlarfb4_rn_12_lla_lib4(int n0, int n1, double *pVL, double *pVA, double *pT, double *pD, int sdd, double *pL, int sdl, double *pA, int sda); +void kernel_dlarfb4_rn_8_lla_lib4(int n0, int n1, double *pVL, double *pVA, double *pT, double *pD, int sdd, double *pL, int sdl, double *pA, int sda); +void kernel_dlarfb4_rn_4_lla_lib4(int n0, int n1, double *pVL, double *pVA, double *pT, double *pD, double *pL, double *pA); +void kernel_dlarfb4_rn_1_lla_lib4(int n0, int n1, double *pVL, double *pVA, double *pT, double *pD, double *pL, double *pA); +// 4x2 +void kernel_dpotrf_nt_l_4x2_lib4(int k, double *A, double *B, double *C, double *D, double *inv_diag_D); +void kernel_dpotrf_nt_l_4x2_vs_lib4(int k, double *A, double *B, double *C, double *D, double *inv_diag_D, int km, int kn); +// 2x2 +void kernel_dpotrf_nt_l_2x2_lib4(int k, double *A, double *B, double *C, double *D, double *inv_diag_D); +void kernel_dpotrf_nt_l_2x2_vs_lib4(int k, double *A, double *B, double *C, double *D, double *inv_diag_D, int km, int kn); +// 12 +void kernel_dgetrf_pivot_12_lib4(int m, double *pA, int sda, double *inv_diag_A, int* ipiv); +void kernel_dgetrf_pivot_12_vs_lib4(int m, double *pA, int sda, double *inv_diag_A, int* ipiv, int n); +// 8 +void kernel_dgetrf_pivot_8_lib4(int m, double *pA, int sda, double *inv_diag_A, int* ipiv); +void kernel_dgetrf_pivot_8_vs_lib4(int m, double *pA, int sda, double *inv_diag_A, int* ipiv, int n); +// 4 +void kernel_dgetrf_pivot_4_lib4(int m, double *pA, int sda, double *inv_diag_A, int* ipiv); +void kernel_dgetrf_pivot_4_vs_lib4(int m, double *pA, int sda, double *inv_diag_A, int* ipiv, int n1); +// vector +void kernel_drowsw_lib4(int kmax, double *pA, double *pC); + + + +// merged routines +// 12x4 +void kernel_dgemm_dtrsm_nt_rl_inv_12x4_lib4(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E); +void kernel_dgemm_dtrsm_nt_rl_inv_12x4_vs_lib4(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E, int km, int kn); +void kernel_dsyrk_dpotrf_nt_l_12x4_lib4(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dsyrk_dpotrf_nt_l_12x4_vs_lib4(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +// 4x12 +void kernel_dgemm_dtrsm_nt_rl_inv_4x12_vs_lib4(int kp, double *Ap, double *Bp, int sdbp, int km_, double *Am, double *Bm, int sdbm, double *C, double *D, double *E, int sde, double *inv_diag_E, int km, int kn); +// 8x8 +void kernel_dsyrk_dpotrf_nt_l_8x8_lib4(int kp, double *Ap, int sdap, double *Bp, int sdbp, int km_, double *Am, int sdam, double *Bm, int sdbm, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dsyrk_dpotrf_nt_l_8x8_vs_lib4(int kp, double *Ap, int sdap, double *Bp, int sdbp, int km_, double *Am, int sdam, double *Bm, int sdbm, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +void kernel_dgemm_dtrsm_nt_rl_inv_8x8l_vs_lib4(int kp, double *Ap, int sdap, double *Bp, int sdb, int km_, double *Am, int sdam, double *Bm, int sdbm, double *C, int sdc, double *D, int sdd, double *E, int sde, double *inv_diag_E, int km, int kn); +void kernel_dgemm_dtrsm_nt_rl_inv_8x8u_vs_lib4(int kp, double *Ap, int sdap, double *Bp, int sdb, int km_, double *Am, int sdam, double *Bm, int sdbm, double *C, int sdc, double *D, int sdd, double *E, int sde, double *inv_diag_E, int km, int kn); +// 8x4 +void kernel_dgemm_dtrsm_nt_rl_inv_8x4_lib4(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E); +void kernel_dgemm_dtrsm_nt_rl_inv_8x4_vs_lib4(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *E, double *inv_diag_E, int km, int kn); +void kernel_dsyrk_dpotrf_nt_l_8x4_lib4(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *inv_diag_D); +void kernel_dsyrk_dpotrf_nt_l_8x4_vs_lib4(int kp, double *Ap, int sdap, double *Bp, int km_, double *Am, int sdam, double *Bm, double *C, int sdc, double *D, int sdd, double *inv_diag_D, int km, int kn); +// 4x8 +void kernel_dgemm_dtrsm_nt_rl_inv_4x8_vs_lib4(int kp, double *Ap, double *Bp, int sdbp, int km_, double *Am, double *Bm, int sdbm, double *C, double *D, double *E, int sde, double *inv_diag_E, int km, int kn); +// 4x4 +void kernel_dgemm_dtrsm_nt_rl_inv_4x4_lib4(int kp, double *Ap, double *Bp, int km_, double *Am, double *Bm, double *C, double *D, double *E, double *inv_diag_E); +void kernel_dgemm_dtrsm_nt_rl_inv_4x4_vs_lib4(int kp, double *Ap, double *Bp, int km_, double *Am, double *Bm, double *C, double *D, double *E, double *inv_diag_E, int km, int kn); +void kernel_dsyrk_dpotrf_nt_l_4x4_lib4(int kp, double *Ap, double *Bp, int km_, double *Am, double *Bm, double *C, double *D, double *inv_diag_D); +void kernel_dsyrk_dpotrf_nt_l_4x4_vs_lib4(int kp, double *Ap, double *Bp, int km_, double *Am, double *Bm, double *C, double *D, double *inv_diag_D, int km, int kn); +// 4x2 +void kernel_dgemm_dtrsm_nt_rl_inv_4x2_lib4(int kp, double *Ap, double *Bp, int km_, double *Am, double *Bm, double *C, double *D, double *E, double *inv_diag_E); +void kernel_dgemm_dtrsm_nt_rl_inv_4x2_vs_lib4(int kp, double *Ap, double *Bp, int km_, double *Am, double *Bm, double *C, double *D, double *E, double *inv_diag_E, int km, int kn); +void kernel_dsyrk_dpotrf_nt_l_4x2_lib4(int kp, double *Ap, double *Bp, int km_, double *Am, double *Bm, double *C, double *D, double *inv_diag_D); +void kernel_dsyrk_dpotrf_nt_l_4x2_vs_lib4(int kp, double *Ap, double *Bp, int km_, double *Am, double *Bm, double *C, double *D, double *inv_diag_D, int km, int kn); +// 2x2 +void kernel_dsyrk_dpotrf_nt_l_2x2_lib4(int kp, double *Ap, double *Bp, int km_, double *Am, double *Bm, double *C, double *D, double *inv_diag_D); +void kernel_dsyrk_dpotrf_nt_l_2x2_vs_lib4(int kp, double *Ap, double *Bp, int km_, double *Am, double *Bm, double *C, double *D, double *inv_diag_D, int km, int kn); + +/* + * + * Auxiliary routines + * + * cpsc copy and scale, scale + * cp copy + * add + * set and scale + * transpose and scale + * set and scale + * + */ + +// copy and scale +void kernel_dgecpsc_8_0_lib4(int tri, int kmax, double alpha, double *A0, int sda, double *B, int sdb); +void kernel_dgecpsc_8_1_lib4(int tri, int kmax, double alpha, double *A0, int sda, double *B, int sdb); +void kernel_dgecpsc_8_2_lib4(int tri, int kmax, double alpha, double *A0, int sda, double *B, int sdb); +void kernel_dgecpsc_8_3_lib4(int tri, int kmax, double alpha, double *A0, int sda, double *B, int sdb); + +void kernel_dgecpsc_4_0_lib4(int tri, int kmax, double alpha, double *A, double *B); +void kernel_dgecpsc_4_1_lib4(int tri, int kmax, double alpha, double *A0, int sda, double *B); +void kernel_dgecpsc_4_2_lib4(int tri, int kmax, double alpha, double *A0, int sda, double *B); +void kernel_dgecpsc_4_3_lib4(int tri, int kmax, double alpha, double *A0, int sda, double *B); + +void kernel_dgecpsc_3_0_lib4(int tri, int kmax, double alpha, double *A, double *B); +void kernel_dgecpsc_3_2_lib4(int tri, int kmax, double alpha, double *A0, int sda, double *B); +void kernel_dgecpsc_3_3_lib4(int tri, int kmax, double alpha, double *A0, int sda, double *B); + +void kernel_dgecpsc_2_0_lib4(int tri, int kmax, double alpha, double *A, double *B); +void kernel_dgecpsc_2_3_lib4(int tri, int kmax, double alpha, double *A0, int sda, double *B); + +void kernel_dgecpsc_1_0_lib4(int tri, int kmax, double alpha, double *A, double *B); + +// copy only +void kernel_dgecp_8_0_lib4(int tri, int kmax, double *A, int sda, double *B, int sdb); + +void kernel_dgecp_4_0_lib4(int tri, int kmax, double *A, double *B); + +// add +void kernel_dgead_8_0_lib4(int kmax, double alpha, double *A0, int sda, double *B, int sdb); +void kernel_dgead_8_1_lib4(int kmax, double alpha, double *A0, int sda, double *B, int sdb); +void kernel_dgead_8_2_lib4(int kmax, double alpha, double *A0, int sda, double *B, int sdb); +void kernel_dgead_8_3_lib4(int kmax, double alpha, double *A0, int sda, double *B, int sdb); +void kernel_dgead_4_0_lib4(int kmax, double alpha, double *A, double *B); +void kernel_dgead_4_1_lib4(int kmax, double alpha, double *A0, int sda, double *B); +void kernel_dgead_4_2_lib4(int kmax, double alpha, double *A0, int sda, double *B); +void kernel_dgead_4_3_lib4(int kmax, double alpha, double *A0, int sda, double *B); +void kernel_dgead_3_0_lib4(int kmax, double alpha, double *A, double *B); +void kernel_dgead_3_2_lib4(int kmax, double alpha, double *A0, int sda, double *B); +void kernel_dgead_3_3_lib4(int kmax, double alpha, double *A0, int sda, double *B); +void kernel_dgead_2_0_lib4(int kmax, double alpha, double *A, double *B); +void kernel_dgead_2_3_lib4(int kmax, double alpha, double *A0, int sda, double *B); +void kernel_dgead_1_0_lib4(int kmax, double alpha, double *A, double *B); + +// set +void kernel_dgeset_4_lib4(int kmax, double alpha, double *A); +void kernel_dtrset_4_lib4(int kmax, double alpha, double *A); + +// traspose +void kernel_dgetr_8_lib4(int tri, int kmax, int kna, double alpha, double *A, int sda, double *C, int sdc); +void kernel_dgetr_4_lib4(int tri, int kmax, int kna, double alpha, double *A, double *C, int sdc); +void kernel_dgetr_3_lib4(int tri, int kmax, int kna, double alpha, double *A, double *C, int sdc); +void kernel_dgetr_2_lib4(int tri, int kmax, int kna, double alpha, double *A, double *C, int sdc); +void kernel_dgetr_1_lib4(int tri, int kmax, int kna, double alpha, double *A, double *C, int sdc); +void kernel_dgetr_4_0_lib4(int m, double *A, int sda, double *B); + + + +// pack +// 12 +void kernel_dpack_nn_12_lib4(int kmax, double *A, int lda, double *B, int sdb); +void kernel_dpack_nn_12_vs_lib4(int kmax, double *A, int lda, double *B, int sdb, int m1); +void kernel_dpack_tt_12_lib4(int kmax, double *A, int lda, double *B, int sdb); +// 8 +void kernel_dpack_nn_8_lib4(int kmax, double *A, int lda, double *B, int sdb); +void kernel_dpack_nn_8_vs_lib4(int kmax, double *A, int lda, double *B, int sdb, int m1); +void kernel_dpack_tt_8_lib4(int kmax, double *A, int lda, double *B, int sdb); +// 4 +void kernel_dpack_nn_4_lib4(int kmax, double *A, int lda, double *B); +void kernel_dpack_nn_4_vs_lib4(int kmax, double *A, int lda, double *B, int m1); +void kernel_dpack_tn_4_p0_lib4(int kmax, double *A, int lda, double *B); +void kernel_dpack_tn_4_lib4(int kmax, double *A, int lda, double *B); +void kernel_dpack_tn_4_vs_lib4(int kmax, double *A, int lda, double *B, int m1); +void kernel_dpack_tt_4_lib4(int kmax, double *A, int lda, double *B, int sdb); +void kernel_dpack_tt_4_vs_lib4(int kmax, double *A, int lda, double *B, int sdb, int m1); +// unpack +// 12 +void kernel_dunpack_nn_12_lib4(int kmax, double *A, int sda, double *B, int ldb); +void kernel_dunpack_nn_12_vs_lib4(int kmax, double *A, int sda, double *B, int ldb, int m1); +void kernel_dunpack_tt_12_lib4(int kmax, double *A, int sda, double *B, int ldb); +// 8 +void kernel_dunpack_nn_8_lib4(int kmax, double *A, int sda, double *B, int ldb); +void kernel_dunpack_nn_8_vs_lib4(int kmax, double *A, int sda, double *B, int ldb, int m1); +void kernel_dunpack_tt_8_lib4(int kmax, double *A, int sda, double *B, int ldb); +// 4 +void kernel_dunpack_nn_4_lib4(int kmax, double *A, double *B, int ldb); +void kernel_dunpack_nn_4_vs_lib4(int kmax, double *A, double *B, int ldb, int m1); +void kernel_dunpack_nt_4_lib4(int kmax, double *A, double *B, int ldb); +void kernel_dunpack_nt_4_vs_lib4(int kmax, double *A, double *B, int ldb, int m1); +void kernel_dunpack_tt_4_lib4(int kmax, double *A, int sda, double *B, int ldb); + +// panel copy +// 12 +void kernel_dpacp_nn_12_lib4(int kmax, int offsetA, double *A, int sda, double *B, int sdb); +void kernel_dpacp_nn_12_vs_lib4(int kmax, int offsetA, double *A, int sda, double *B, int sdb, int m1); +// 8 +void kernel_dpacp_nn_8_lib4(int kmax, int offsetA, double *A, int sda, double *B, int sdb); +void kernel_dpacp_nn_8_vs_lib4(int kmax, int offsetA, double *A, int sda, double *B, int sdb, int m1); +// 4 +void kernel_dpacp_nt_4_lib4(int kmax, double *A, int offsetB, double *B, int sdb); +void kernel_dpacp_tn_4_lib4(int kmax, int offsetA, double *A, int sda, double *B); +void kernel_dpacp_nn_4_lib4(int kmax, int offsetA, double *A, int sda, double *B); +void kernel_dpacp_nn_4_vs_lib4(int kmax, int offsetA, double *A, int sda, double *B, int m1); + + + +/************************************************ +* BLAS API kernels +************************************************/ + +//#if defined(BLAS_API) + +// A, B panel-major bs=4; C, D column-major +// 12x4 +void kernel_dgemm_nt_12x4_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_12x4_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nt_12x4_p0_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *A_p, double *B_p); +void kernel_dsyrk_nt_l_12x4_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dsyrk_nt_l_12x4_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dsyrk_nt_u_12x4_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dsyrk_nt_u_12x4_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_12x4_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_rl_12x4_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_one_12x4_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_rl_one_12x4_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_12x4_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_ru_12x4_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_one_12x4_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_ru_one_12x4_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrsm_nt_rl_inv_12x4_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, double *dE); +void kernel_dtrsm_nt_rl_inv_12x4_vs_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, double *dE, int m1, int n1); +void kernel_dtrsm_nt_rl_inv_12x4_lib44ccc(int kmax, double *A, int sda, double *B, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nt_rl_inv_12x4_vs_lib44ccc(int kmax, double *A, int sda, double *B, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_rl_one_12x4_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E); +void kernel_dtrsm_nt_rl_one_12x4_vs_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, int m1, int n1); +void kernel_dtrsm_nt_ru_inv_12x4_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, double *dE); +void kernel_dtrsm_nt_ru_inv_12x4_vs_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, double *dE, int m1, int n1); +void kernel_dtrsm_nt_ru_one_12x4_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E); +void kernel_dtrsm_nt_ru_one_12x4_vs_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, int m1, int n1); +void kernel_dpotrf_nt_l_12x4_lib44cc(int kmax, double *A, int sda, double *B, double *C, int ldc, double *D, int ldd, double *dD); +void kernel_dpotrf_nt_l_12x4_vs_lib44cc(int kmax, double *A, int sda, double *B, double *C, int ldc, double *D, int ldd, double *dD, int m1, int n1); +// 4x12 +void kernel_dgemm_nt_4x12_lib44cc(int kmax, double *alpha, double *A, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_4x12_vs_lib44cc(int kmax, double *alpha, double *A, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_4x12_tran_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_rl_4x12_tran_vs_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_one_4x12_tran_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_rl_one_4x12_tran_vs_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_4x12_tran_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_ru_4x12_tran_vs_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_one_4x12_tran_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_ru_one_4x12_tran_vs_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +// 8x8 +void kernel_dsyrk_nt_l_8x8_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dsyrk_nt_l_8x8_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dsyrk_nt_u_8x8_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dsyrk_nt_u_8x8_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dpotrf_nt_l_8x8_lib44cc(int kmax, double *A, int sda, double *B, int sdb, double *C, int ldc, double *D, int ldd, double *dD); +void kernel_dpotrf_nt_l_8x8_vs_lib44cc(int kmax, double *A, int sda, double *B, int sdb, double *C, int ldc, double *D, int ldd, double *dD, int m1, int n1); +// 8x4 +void kernel_dgemm_nt_8x4_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_8x4_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nt_8x4_p0_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *A_p, double *B_p); +void kernel_dgemm_nt_8x4_p_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *A_p); +void kernel_dsyrk_nt_l_8x4_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dsyrk_nt_l_8x4_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dsyrk_nt_u_8x4_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dsyrk_nt_u_8x4_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_8x4_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_rl_8x4_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_one_8x4_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_rl_one_8x4_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_8x4_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_ru_8x4_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_one_8x4_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_ru_one_8x4_vs_lib44cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrsm_nt_rl_inv_8x4_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, double *dE); +void kernel_dtrsm_nt_rl_inv_8x4_vs_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, double *dE, int m1, int n1); +void kernel_dtrsm_nt_rl_inv_8x4_lib44ccc(int kmax, double *A, int sda, double *B, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nt_rl_inv_8x4_vs_lib44ccc(int kmax, double *A, int sda, double *B, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_rl_one_8x4_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E); +void kernel_dtrsm_nt_rl_one_8x4_vs_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, int m1, int n1); +void kernel_dtrsm_nt_ru_inv_8x4_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, double *dE); +void kernel_dtrsm_nt_ru_inv_8x4_vs_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, double *dE, int m1, int n1); +void kernel_dtrsm_nt_ru_one_8x4_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E); +void kernel_dtrsm_nt_ru_one_8x4_vs_lib44cc4(int kmax, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, int m1, int n1); +void kernel_dpotrf_nt_l_8x4_lib44cc(int kmax, double *A, int sda, double *B, double *C, int ldc, double *D, int ldd, double *dD); +void kernel_dpotrf_nt_l_8x4_vs_lib44cc(int kmax, double *A, int sda, double *B, double *C, int ldc, double *D, int ldd, double *dD, int m1, int n1); +// 4x8 +void kernel_dgemm_nt_4x8_lib44cc(int kmax, double *alpha, double *A, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_4x8_vs_lib44cc(int kmax, double *alpha, double *A, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_4x8_tran_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_rl_4x8_tran_vs_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_one_4x8_tran_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_rl_one_4x8_tran_vs_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_4x8_tran_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_ru_4x8_tran_vs_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_one_4x8_tran_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_ru_one_4x8_tran_vs_lib444c(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +// 4x4 +void kernel_dgemm_nt_4x4_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_4x4_vs_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dsyrk_nt_l_4x4_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dsyrk_nt_l_4x4_vs_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dsyrk_nt_u_4x4_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dsyrk_nt_u_4x4_vs_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_4x4_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_rl_4x4_vs_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_4x4_tran_lib444c(int kmax, double *alpha, double *A, double *B, double *beta, double *C, double *D, int ldd); +void kernel_dtrmm_nt_rl_4x4_tran_vs_lib444c(int kmax, double *alpha, double *A, double *B, double *beta, double *C, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_one_4x4_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_rl_one_4x4_vs_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_one_4x4_tran_lib444c(int kmax, double *alpha, double *A, double *B, double *beta, double *C, double *D, int ldd); +void kernel_dtrmm_nt_rl_one_4x4_tran_vs_lib444c(int kmax, double *alpha, double *A, double *B, double *beta, double *C, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_4x4_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_ru_4x4_vs_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_4x4_tran_lib444c(int kmax, double *alpha, double *A, double *B, double *beta, double *C, double *D, int ldd); +void kernel_dtrmm_nt_ru_4x4_tran_vs_lib444c(int kmax, double *alpha, double *A, double *B, double *beta, double *C, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_one_4x4_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_ru_one_4x4_vs_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_one_4x4_tran_lib444c(int kmax, double *alpha, double *A, double *B, double *beta, double *C, double *D, int ldd); +void kernel_dtrmm_nt_ru_one_4x4_tran_vs_lib444c(int kmax, double *alpha, double *A, double *B, double *beta, double *C, double *D, int ldd, int m1, int n1); +void kernel_dtrsm_nt_rl_inv_4x4_lib44cc4(int kmax, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, double *dE); +void kernel_dtrsm_nt_rl_inv_4x4_vs_lib44cc4(int kmax, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, double *dE, int m1, int n1); +void kernel_dtrsm_nt_rl_inv_4x4_lib44ccc(int kmax, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nt_rl_inv_4x4_vs_lib44ccc(int kmax, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_rl_one_4x4_lib44cc4(int kmax, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E); +void kernel_dtrsm_nt_rl_one_4x4_vs_lib44cc4(int kmax, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, int m1, int n1); +void kernel_dtrsm_nt_ru_inv_4x4_lib44cc4(int kmax, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, double *dE); +void kernel_dtrsm_nt_ru_inv_4x4_vs_lib44cc4(int kmax, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, double *dE, int m1, int n1); +void kernel_dtrsm_nt_ru_one_4x4_lib44cc4(int kmax, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E); +void kernel_dtrsm_nt_ru_one_4x4_vs_lib44cc4(int kmax, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, double *E, int m1, int n1); +void kernel_dpotrf_nt_l_4x4_lib44cc(int kmax, double *A, double *B, double *C, int ldc, double *D, int ldd, double *dD); +void kernel_dpotrf_nt_l_4x4_vs_lib44cc(int kmax, double *A, double *B, double *C, int ldc, double *D, int ldd, double *dD, int m1, int n1); +// 4x2 +void kernel_dgemm_nt_4x2_lib44cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd); + +// A panel-major bs=4; B, C, D column-major +// 12x4 +void kernel_dgemm_nn_12x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nn_12x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nt_12x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_12x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dsyrk_nt_l_12x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dsyrk_nt_l_12x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_rl_12x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nn_rl_12x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_rl_one_12x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nn_rl_one_12x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_ru_12x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nn_ru_12x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_ru_one_12x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nn_ru_one_12x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_12x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_rl_12x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_one_12x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_rl_one_12x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_12x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_ru_12x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_one_12x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_ru_one_12x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrsm_nn_ll_one_12x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nn_ll_one_12x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nn_rl_inv_12x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nn_rl_inv_12x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nn_rl_one_12x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nn_rl_one_12x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nt_rl_inv_12x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nt_rl_inv_12x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_rl_one_12x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nt_rl_one_12x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nn_ru_inv_12x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nn_ru_inv_12x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nn_ru_one_12x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nn_ru_one_12x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nt_ru_inv_12x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nt_ru_inv_12x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_ru_one_12x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nt_ru_one_12x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dgetrf_nn_l_12x4_lib4ccc(int kmax, double *A, int sda, double *B, int ldb, double *C, int ldc, double *D, int ldd, double *diag); +void kernel_dgetrf_nn_l_12x4_vs_lib4ccc(int kmax, double *A, int sda, double *B, int ldb, double *C, int ldc, double *D, int ldd, double *diag, int m1, int n1); +void kernel_dgetrf_nn_m_12x4_lib4ccc(int kmax, double *A, int sda, double *B, int ldb, double *C, int ldc, double *D, int ldd, double *diag); +void kernel_dgetrf_nn_m_12x4_vs_lib4ccc(int kmax, double *A, int sda, double *B, int ldb, double *C, int ldc, double *D, int ldd, double *diag, int m1, int n1); +void kernel_dgetrf_nn_r_12x4_lib4ccc(int kmax, double *A, int sda, double *B, int ldb, double *C, int ldc, double *D, int ldd, double *diag); +void kernel_dgetrf_nn_r_12x4_vs_lib4ccc(int kmax, double *A, int sda, double *B, int ldb, double *C, int ldc, double *D, int ldd, double *diag, int m1, int n1); +// 4x12 +void kernel_dgemm_nn_4x12_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nn_4x12_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nt_4x12_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_4x12_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_rl_4x12_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nn_rl_4x12_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_rl_one_4x12_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nn_rl_one_4x12_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_ru_4x12_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nn_ru_4x12_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_ru_one_4x12_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nn_ru_one_4x12_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_4x12_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_rl_4x12_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_one_4x12_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_rl_one_4x12_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_4x12_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_ru_4x12_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_one_4x12_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_ru_one_4x12_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +// 8x4 +void kernel_dgemm_nn_8x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nn_8x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nt_8x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_8x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dsyrk_nt_l_8x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dsyrk_nt_l_8x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_rl_8x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nn_rl_8x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_rl_one_8x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nn_rl_one_8x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_ru_8x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nn_ru_8x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_ru_one_8x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nn_ru_one_8x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_8x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_rl_8x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_one_8x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_rl_one_8x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_8x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_ru_8x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_one_8x4_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_ru_one_8x4_vs_lib4ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrsm_nn_ll_one_8x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nn_ll_one_8x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nn_rl_inv_8x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nn_rl_inv_8x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nn_rl_one_8x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nn_rl_one_8x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nt_rl_inv_8x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nt_rl_inv_8x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_rl_one_8x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nt_rl_one_8x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nn_ru_inv_8x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nn_ru_inv_8x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nn_ru_one_8x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nn_ru_one_8x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nt_ru_inv_8x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nt_ru_inv_8x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_ru_one_8x4_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nt_ru_one_8x4_vs_lib4cccc(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dgetrf_nn_l_8x4_lib4ccc(int kmax, double *A, int sda, double *B, int ldb, double *C, int ldc, double *D, int ldd, double *diag); +void kernel_dgetrf_nn_l_8x4_vs_lib4ccc(int kmax, double *A, int sda, double *B, int ldb, double *C, int ldc, double *D, int ldd, double *diag, int m1, int n1); +void kernel_dgetrf_nn_r_8x4_lib4ccc(int kmax, double *A, int sda, double *B, int ldb, double *C, int ldc, double *D, int ldd, double *diag); +void kernel_dgetrf_nn_r_8x4_vs_lib4ccc(int kmax, double *A, int sda, double *B, int ldb, double *C, int ldc, double *D, int ldd, double *diag, int m1, int n1); +// 4x8 +void kernel_dgemm_nn_4x8_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nn_4x8_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nt_4x8_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_4x8_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_rl_4x8_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nn_rl_4x8_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_rl_one_4x8_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nn_rl_one_4x8_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_ru_4x8_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nn_ru_4x8_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_ru_one_4x8_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nn_ru_one_4x8_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_4x8_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_rl_4x8_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_one_4x8_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_rl_one_4x8_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_4x8_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_ru_4x8_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_one_4x8_tran_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd); +void kernel_dtrmm_nt_ru_one_4x8_tran_vs_lib4c4c(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int ldd, int m1, int n1); +// 4x4 +void kernel_dgemm_nn_4x4_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nn_4x4_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nt_4x4_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_4x4_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dsyrk_nt_l_4x4_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dsyrk_nt_l_4x4_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_rl_4x4_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nn_rl_4x4_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_rl_4x4_tran_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd); +void kernel_dtrmm_nn_rl_4x4_tran_vs_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_rl_one_4x4_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nn_rl_one_4x4_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_rl_one_4x4_tran_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd); +void kernel_dtrmm_nn_rl_one_4x4_tran_vs_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_ru_4x4_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nn_ru_4x4_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_ru_4x4_tran_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd); +void kernel_dtrmm_nn_ru_4x4_tran_vs_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_ru_one_4x4_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nn_ru_one_4x4_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nn_ru_one_4x4_tran_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd); +void kernel_dtrmm_nn_ru_one_4x4_tran_vs_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_4x4_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_rl_4x4_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_4x4_tran_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd); +void kernel_dtrmm_nt_rl_4x4_tran_vs_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_one_4x4_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_rl_one_4x4_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_rl_one_4x4_tran_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd); +void kernel_dtrmm_nt_rl_one_4x4_tran_vs_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_4x4_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_ru_4x4_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_4x4_tran_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd); +void kernel_dtrmm_nt_ru_4x4_tran_vs_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_one_4x4_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dtrmm_nt_ru_one_4x4_vs_lib4ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dtrmm_nt_ru_one_4x4_tran_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd); +void kernel_dtrmm_nt_ru_one_4x4_tran_vs_lib4c4c(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, double *D, int ldd, int m1, int n1); +void kernel_dtrsm_nn_ll_one_4x4_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nn_ll_one_4x4_vs_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nn_rl_inv_4x4_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nn_rl_inv_4x4_vs_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nn_rl_one_4x4_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nn_rl_one_4x4_vs_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nt_rl_inv_4x4_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nt_rl_inv_4x4_vs_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_rl_one_4x4_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nt_rl_one_4x4_vs_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nn_ru_inv_4x4_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nn_ru_inv_4x4_vs_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nn_ru_one_4x4_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nn_ru_one_4x4_vs_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nt_ru_inv_4x4_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE); +void kernel_dtrsm_nt_ru_inv_4x4_vs_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_ru_one_4x4_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde); +void kernel_dtrsm_nt_ru_one_4x4_vs_lib4cccc(int kmax, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, double *E, int lde, int m1, int n1); +void kernel_dgetrf_nn_4x4_lib4ccc(int kmax, double *A, double *B, int ldb, double *C, int ldc, double *D, int ldd, double *diag); +void kernel_dgetrf_nn_4x4_vs_lib4ccc(int kmax, double *A, double *B, int ldb, double *C, int ldc, double *D, int ldd, double *diag, int m1, int n1); + +// B panel-major bs=4; A, C, D column-major +// 12x4 +void kernel_dgemm_nt_12x4_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_12x4_vs_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_tt_12x4_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_tt_12x4_vs_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +// 4x12 +void kernel_dgemm_nt_4x12_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_4x12_vs_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_tt_4x12_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_tt_4x12_vs_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +// 8x4 +void kernel_dgemm_nt_8x4_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_8x4_vs_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_tt_8x4_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_tt_8x4_vs_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +// 4x8 +void kernel_dgemm_nt_4x8_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_4x8_vs_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_tt_4x8_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_tt_4x8_vs_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +// 4x4 +void kernel_dgemm_nt_4x4_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_4x4_vs_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_tt_4x4_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_tt_4x4_vs_libc4cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); + +// A, C, D panel-major; B, E column-major +// TODO merge with above +// 12x4 +void kernel_dtrsm_nn_rl_inv_12x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE); +void kernel_dtrsm_nn_rl_inv_12x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nn_rl_one_12x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde); +void kernel_dtrsm_nn_rl_one_12x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nn_ru_inv_12x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE); +void kernel_dtrsm_nn_ru_inv_12x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nn_ru_one_12x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde); +void kernel_dtrsm_nn_ru_one_12x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nt_rl_inv_12x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE); +void kernel_dtrsm_nt_rl_inv_12x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_rl_one_12x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde); +void kernel_dtrsm_nt_rl_one_12x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nt_ru_inv_12x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE); +void kernel_dtrsm_nt_ru_inv_12x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_ru_one_12x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde); +void kernel_dtrsm_nt_ru_one_12x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, int m1, int n1); +// 8x4 +void kernel_dtrsm_nn_rl_inv_8x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE); +void kernel_dtrsm_nn_rl_inv_8x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nn_rl_one_8x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde); +void kernel_dtrsm_nn_rl_one_8x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nn_ru_inv_8x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE); +void kernel_dtrsm_nn_ru_inv_8x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nn_ru_one_8x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde); +void kernel_dtrsm_nn_ru_one_8x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nt_rl_inv_8x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE); +void kernel_dtrsm_nt_rl_inv_8x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_rl_one_8x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde); +void kernel_dtrsm_nt_rl_one_8x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nt_ru_inv_8x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE); +void kernel_dtrsm_nt_ru_inv_8x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_ru_one_8x4_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde); +void kernel_dtrsm_nt_ru_one_8x4_vs_lib4c44c(int kmax, double *A, int sda, double *B, int ldb, double *beta, double *C, int sdc, double *D, int sdd, double *E, int lde, int m1, int n1); +// 4x4 +void kernel_dtrsm_nn_rl_inv_4x4_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde, double *dE); +void kernel_dtrsm_nn_rl_inv_4x4_vs_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nn_rl_one_4x4_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde); +void kernel_dtrsm_nn_rl_one_4x4_vs_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nn_ru_inv_4x4_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde, double *dE); +void kernel_dtrsm_nn_ru_inv_4x4_vs_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nn_ru_one_4x4_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde); +void kernel_dtrsm_nn_ru_one_4x4_vs_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nt_rl_inv_4x4_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde, double *dE); +void kernel_dtrsm_nt_rl_inv_4x4_vs_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_rl_one_4x4_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde); +void kernel_dtrsm_nt_rl_one_4x4_vs_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde, int m1, int n1); +void kernel_dtrsm_nt_ru_inv_4x4_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde, double *dE); +void kernel_dtrsm_nt_ru_inv_4x4_vs_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde, double *dE, int m1, int n1); +void kernel_dtrsm_nt_ru_one_4x4_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde); +void kernel_dtrsm_nt_ru_one_4x4_vs_lib4c44c(int kmax, double *A, double *B, int ldb, double *beta, double *C, double *D, double *E, int lde, int m1, int n1); + +// A, B, C, D column-major +// 12x4 +void kernel_dgemm_nn_12x4_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nn_12x4_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nt_12x4_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_12x4_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_tt_12x4_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_tt_12x4_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +// 4x12 +void kernel_dgemm_nn_4x12_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nn_4x12_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nt_4x12_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_4x12_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_tt_4x12_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_tt_4x12_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +// 8x4 +void kernel_dgemm_nn_8x4_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nn_8x4_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nt_8x4_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_8x4_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_tt_8x4_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_tt_8x4_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +// 4x8 +void kernel_dgemm_nn_4x8_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nn_4x8_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nt_4x8_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_4x8_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_tt_4x8_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_tt_4x8_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +// 4x4 +void kernel_dgemm_nn_4x4_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nn_4x4_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nt_4x4_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_4x4_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_tt_4x4_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_tt_4x4_vs_libcccc(int kmax, double *alpha, double *A, int lda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); + +// A column-major +// 12 +void kernel_dgetrf_pivot_12_lib(int m, double *pA, int lda, double *inv_diag_A, int* ipiv); +void kernel_dgetrf_pivot_12_vs_lib(int m, double *pA, int lda, double *inv_diag_A, int* ipiv, int n); +// 8 +void kernel_dgetrf_pivot_8_lib(int m, double *pA, int lda, double *inv_diag_A, int* ipiv); +void kernel_dgetrf_pivot_8_vs_lib(int m, double *pA, int lda, double *inv_diag_A, int* ipiv, int n); +// 4 +void kernel_dgetrf_pivot_4_lib(int m, double *pA, int lda, double *inv_diag_A, int* ipiv); +void kernel_dgetrf_pivot_4_vs_lib(int m, double *pA, int lda, double *inv_diag_A, int* ipiv, int n); + +// vector +void kernel_ddot_11_lib(int n, double *x, double *y, double *res); +void kernel_daxpy_11_lib(int n, double *alpha, double *x, double *y); +void kernel_drowsw_lib(int kmax, double *pA, int lda, double *pC, int ldc); + +//#endif // BLAS_API + + + +// larger kernels +// 12 +void kernel_dgemm_nt_12xn_p0_lib44cc(int n, int k, double *alpha, double *A, int sda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, double *A_p, double *B_p); +void kernel_dgemm_nt_12xn_pl_lib44cc(int n, int k, double *alpha, double *A, int sda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, double *A_p, double *B_p); +// 8 +void kernel_dgemm_nt_8xn_p0_lib44cc(int n, int k, double *alpha, double *A, int sda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, double *A_p, double *B_p); + + + +// A, B panel-major bs=8; C, D column-major +// 24x8 +void kernel_dgemm_nt_24x8_lib88cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_24x8_vs_lib88cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +// 16x8 +void kernel_dgemm_nt_16x8_lib88cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_16x8_vs_lib88cc(int kmax, double *alpha, double *A, int sda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +// 8x8 +void kernel_dgemm_nt_8x8_lib88cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_8x8_vs_lib88cc(int kmax, double *alpha, double *A, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); + +// A, panel-major bs=8; B, C, D column-major +// 24x8 +void kernel_dgemm_nt_24x8_lib8ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_24x8_vs_lib8ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nn_24x8_lib8ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nn_24x8_vs_lib8ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +// 16x8 +void kernel_dgemm_nt_16x8_lib8ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_16x8_vs_lib8ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nn_16x8_lib8ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nn_16x8_vs_lib8ccc(int kmax, double *alpha, double *A, int sda, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +// 8x8 +void kernel_dgemm_nt_8x8_lib8ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_8x8_vs_lib8ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_nn_8x8_lib8ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nn_8x8_vs_lib8ccc(int kmax, double *alpha, double *A, double *B, int ldb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); + +// B, panel-major bs=8; A, C, D column-major +// 8x24 +void kernel_dgemm_nt_8x24_libc8cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_8x24_vs_libc8cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_tt_8x24_libc8cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_tt_8x24_vs_libc8cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +// 8x16 +void kernel_dgemm_nt_8x16_libc8cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_8x16_vs_libc8cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_tt_8x16_libc8cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_tt_8x16_vs_libc8cc(int kmax, double *alpha, double *A, int lda, double *B, int sdb, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +// 8x8 +void kernel_dgemm_nt_8x8_libc8cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_nt_8x8_vs_libc8cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); +void kernel_dgemm_tt_8x8_libc8cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd); +void kernel_dgemm_tt_8x8_vs_libc8cc(int kmax, double *alpha, double *A, int lda, double *B, double *beta, double *C, int ldc, double *D, int ldd, int m1, int n1); + + + +// aux +void kernel_dvecld_inc1(int kmax, double *x); +void kernel_dveccp_inc1(int kmax, double *x, double *y); + + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_D_KERNEL_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_i_aux_ext_dep.h b/third_party/acados/include/blasfeo/include/blasfeo_i_aux_ext_dep.h new file mode 100644 index 000000000..74c3fb5c0 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_i_aux_ext_dep.h @@ -0,0 +1,69 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_I_AUX_EXT_DEP_H_ +#define BLASFEO_I_AUX_EXT_DEP_H_ + + + +#include "blasfeo_target.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#ifdef EXT_DEP + +// i_aux_extern_depend_lib +void int_zeros(int **pA, int row, int col); +void int_zeros_align(int **pA, int row, int col); +void int_free(int *pA); +void int_free_align(int *pA); +void int_print_mat(int row, int col, int *A, int lda); +int int_print_to_string_mat(char **buf_out, int row, int col, int *A, int lda); + +#endif // EXT_DEP + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_I_AUX_EXT_DEP_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_m_aux.h b/third_party/acados/include/blasfeo/include/blasfeo_m_aux.h new file mode 100644 index 000000000..6248853e2 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_m_aux.h @@ -0,0 +1,57 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_M_AUX_H_ +#define BLASFEO_M_AUX_H_ + +#include "blasfeo_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +void blasfeo_cvt_d2s_vec(int m, struct blasfeo_dvec *vd, int vdi, struct blasfeo_svec *vs, int vsi); +void blasfeo_cvt_s2d_vec(int m, struct blasfeo_svec *vs, int vsi, struct blasfeo_dvec *vd, int vdi); +void blasfeo_cvt_d2s_mat(int m, int n, struct blasfeo_dmat *Md, int mid, int nid, struct blasfeo_smat *Ms, int mis, int nis); +void blasfeo_cvt_s2d_mat(int m, int n, struct blasfeo_smat *Ms, int mis, int nis, struct blasfeo_dmat *Md, int mid, int nid); + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_M_AUX_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_memory.h b/third_party/acados/include/blasfeo/include/blasfeo_memory.h new file mode 100644 index 000000000..da4e7fa09 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_memory.h @@ -0,0 +1,62 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2020 by Gianluca Frison. * +* All rights reserved. * +* * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + +#ifndef BLASFEO_MEMORY_H_ +#define BLASFEO_MEMORY_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +int blasfeo_is_init(); +// +void blasfeo_init(); +// +void blasfeo_quit(); +// +void *blasfeo_get_buffer(); + + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_MEMORY_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_naming.h b/third_party/acados/include/blasfeo/include/blasfeo_naming.h new file mode 100644 index 000000000..c289443b1 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_naming.h @@ -0,0 +1,77 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + +/* + * ----------- Naming conventions + * + * (precision)(data) + * + * 1) d(double) + * s(single) + * + * 2) ge(general) + * tr(triangular) + * vec(vector) + * row(row) + * col(column) + * dia(diagonal) + * + * 3) se(set) + * cp(copy) + * sc(scale) + * ad(add) + * tr(transpose) + * in(insert) + * ex(extract) + * pe(premute) + * sw(swap) + * + * f(factorization) + * + * lqf(LQ factorization) + * qrf (factorization) + * trf (LU factorization using partial pivoting with row interchanges.) + * + * 4) _l(lower) / _u(upper) + * _lib8 (hp implementation, 8 rows kernel) + * _lib4 (hp implementation, 4 rows kernel) + * _lib0 (hp interface with reference implentation) + * _lib (reference implementation) + * _libref (reference implementation with dedicated namespace) + * + * 5) _sp(sparse) + * _exp(exponential format) + */ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_processor_features.h b/third_party/acados/include/blasfeo/include/blasfeo_processor_features.h new file mode 100644 index 000000000..65a0c7e80 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_processor_features.h @@ -0,0 +1,88 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Ian McInerney * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_PROCESSOR_FEATURES_H_ +#define BLASFEO_PROCESSOR_FEATURES_H_ + +/** + * Flags to indicate the different processor features + */ +enum +{ + // x86-64 CPU features + BLASFEO_PROCESSOR_FEATURE_AVX = 0x0001, /// AVX instruction set + BLASFEO_PROCESSOR_FEATURE_AVX2 = 0x0002, /// AVX2 instruction set + BLASFEO_PROCESSOR_FEATURE_FMA = 0x0004, /// FMA instruction set + BLASFEO_PROCESSOR_FEATURE_SSE3 = 0x0008, /// SSE3 instruction set + + // ARM CPU features + BLASFEO_PROCESSOR_FEATURE_VFPv3 = 0x0100, /// VFPv3 instruction set + BLASFEO_PROCESSOR_FEATURE_NEON = 0x0100, /// NEON instruction set + BLASFEO_PROCESSOR_FEATURE_VFPv4 = 0x0100, /// VFPv4 instruction set + BLASFEO_PROCESSOR_FEATURE_NEONv2 = 0x0100, /// NEONv2 instruction set +} BLASFEO_PROCESSOR_FEATURES; + +/** + * Test the features that this processor provides against what the library was compiled with. + * + * @param features - Pointer to an integer to store the supported feature set (using the flags in the BLASFEO_PROCESSOR_FEATURES enum) + * @return 0 if current processor doesn't support all features required for this library, 1 otherwise + */ +int blasfeo_processor_cpu_features( int* features ); + +/** + * Test the features that this processor provides against what the library was compiled with. + * + * @param features - Pointer to an integer to store the supported feature set (using the flags in the BLASFEO_PROCESSOR_FEATURES enum) + * @return 0 if current processor doesn't support all features required for this library, 1 otherwise + */ +void blasfeo_processor_library_features( int* features ); + +/** + * Create a string listing the features the current processor supports. + * + * @param features - Flags from the BLASFEO_PROCESSOR_FEATURES enum indicating the features supported + * @param featureString - Character array to store the feature string in + */ +void blasfeo_processor_feature_string( int features, char* featureString ); + +/** + * Get a string listing the processor features that this library version needs to run. + * + * @param featureString - Character array to store the feature string in + */ +void blasfeo_processor_library_string( char* featureString ); + +#endif // BLASFEO_PROCESSOR_FEATURES_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_s_aux.h b/third_party/acados/include/blasfeo/include/blasfeo_s_aux.h new file mode 100644 index 000000000..539268849 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_s_aux.h @@ -0,0 +1,166 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_S_AUX_H_ +#define BLASFEO_S_AUX_H_ + + + +#include + +#include "blasfeo_s_aux_old.h" +#include "blasfeo_common.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + +/************************************************ +* d_aux_lib.c +************************************************/ + +// returns the memory size (in bytes) needed for a smat +size_t blasfeo_memsize_smat(int m, int n); +size_t blasfeo_memsize_smat_ps(int ps, int m, int n); +// returns the memory size (in bytes) needed for the diagonal of a smat +size_t blasfeo_memsize_diag_smat(int m, int n); +// returns the memory size (in bytes) needed for a svec +size_t blasfeo_memsize_svec(int m); +// create a strmat for a matrix of size m*n by using memory passed by a pointer (pointer is not updated) +void blasfeo_create_smat(int m, int n, struct blasfeo_smat *sA, void *memory); +void blasfeo_create_smat_ps(int ps, int m, int n, struct blasfeo_smat *sA, void *memory); +// create a strvec for a vector of size m by using memory passed by a pointer (pointer is not updated) +void blasfeo_create_svec(int m, struct blasfeo_svec *sA, void *memory); +void blasfeo_pack_smat(int m, int n, float *A, int lda, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_pack_l_smat(int m, int n, float *A, int lda, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_pack_u_smat(int m, int n, float *A, int lda, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_pack_tran_smat(int m, int n, float *A, int lda, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_pack_svec(int m, float *x, int xi, struct blasfeo_svec *sa, int ai); +void blasfeo_unpack_smat(int m, int n, struct blasfeo_smat *sA, int ai, int aj, float *A, int lda); +void blasfeo_unpack_tran_smat(int m, int n, struct blasfeo_smat *sA, int ai, int aj, float *A, int lda); +void blasfeo_unpack_svec(int m, struct blasfeo_svec *sa, int ai, float *x, int xi); +//void s_cast_mat2strmat(float *A, struct blasfeo_smat *sA); +//void s_cast_diag_mat2strmat(float *dA, struct blasfeo_smat *sA); +//void s_cast_vec2vecmat(float *a, struct blasfeo_svec *sa); + +// ge +void blasfeo_sgese(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_sgecpsc(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void blasfeo_sgecp(int m, int n, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void blasfeo_sgesc(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_sgein1(float a, struct blasfeo_smat *sA, int ai, int aj); +float blasfeo_sgeex1(struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_sgead(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void blasfeo_sgetr(int m, int n, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +// tr +void blasfeo_strcp_l(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void blasfeo_strtr_l(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void blasfeo_strtr_u(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +// dia +void blasfeo_sdiare(int kmax, float alpha, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_sdiaex(int kmax, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi); +void blasfeo_sdiain(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_sdiain_sp(int kmax, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_smat *sD, int di, int dj); +void blasfeo_sdiaex_sp(int kmax, float alpha, int *idx, struct blasfeo_smat *sD, int di, int dj, struct blasfeo_svec *sx, int xi); +void blasfeo_sdiaad(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_sdiaad_sp(int kmax, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_smat *sD, int di, int dj); +void blasfeo_sdiaadin_sp(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sy, int yi, int *idx, struct blasfeo_smat *sD, int di, int dj); +// row +void blasfeo_srowin(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_srowex(int kmax, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi); +void blasfeo_srowad(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_srowad_sp(int kmax, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_smat *sD, int di, int dj); +void blasfeo_srowsw(int kmax, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void blasfeo_srowpe(int kmax, int *ipiv, struct blasfeo_smat *sA); +void blasfeo_srowpei(int kmax, int *ipiv, struct blasfeo_smat *sA); +// col +void blasfeo_scolex(int kmax, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi); +void blasfeo_scolin(int kmax, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_scolad(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_scolsc(int kmax, float alpha, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_scolsw(int kmax, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void blasfeo_scolpe(int kmax, int *ipiv, struct blasfeo_smat *sA); +void blasfeo_scolpei(int kmax, int *ipiv, struct blasfeo_smat *sA); +// vec +void blasfeo_svecse(int m, float alpha, struct blasfeo_svec *sx, int xi); +void blasfeo_sveccp(int m, struct blasfeo_svec *sa, int ai, struct blasfeo_svec *sc, int ci); +void blasfeo_svecsc(int m, float alpha, struct blasfeo_svec *sa, int ai); +void blasfeo_sveccpsc(int m, float alpha, struct blasfeo_svec *sa, int ai, struct blasfeo_svec *sc, int ci); +void blasfeo_svecad(int m, float alpha, struct blasfeo_svec *sa, int ai, struct blasfeo_svec *sc, int ci); +void blasfeo_svecin1(float a, struct blasfeo_svec *sx, int xi); +float blasfeo_svecex1(struct blasfeo_svec *sx, int xi); +void blasfeo_svecad_sp(int m, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_svec *sz, int zi); +void blasfeo_svecin_sp(int m, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_svec *sz, int zi); +void blasfeo_svecex_sp(int m, float alpha, int *idx, struct blasfeo_svec *sx, int x, struct blasfeo_svec *sz, int zi); +void blasfeo_sveccl(int m, struct blasfeo_svec *sxm, int xim, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sxp, int xip, struct blasfeo_svec *sz, int zi); +void blasfeo_sveccl_mask(int m, struct blasfeo_svec *sxm, int xim, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sxp, int xip, struct blasfeo_svec *sz, int zi, struct blasfeo_svec *sm, int mi); +void blasfeo_svecze(int m, struct blasfeo_svec *sm, int mi, struct blasfeo_svec *sv, int vi, struct blasfeo_svec *se, int ei); +void blasfeo_svecnrm_inf(int m, struct blasfeo_svec *sx, int xi, float *ptr_norm); +void blasfeo_svecnrm_2(int m, struct blasfeo_svec *sx, int xi, float *ptr_norm); +void blasfeo_svecpe(int kmax, int *ipiv, struct blasfeo_svec *sx, int xi); +void blasfeo_svecpei(int kmax, int *ipiv, struct blasfeo_svec *sx, int xi); + + + +/* +* Explicitly panel-major matrix format +*/ + +// returns the memory size (in bytes) needed for a dmat +size_t blasfeo_pm_memsize_smat(int ps, int m, int n); +// create a strmat for a matrix of size m*n by using memory passed by a pointer (pointer is not updated) +void blasfeo_pm_create_smat(int ps, int m, int n, struct blasfeo_pm_smat *sA, void *memory); + + + +/* +* Explicitly column-major matrix format +*/ + +// returns the memory size (in bytes) needed for a dmat +size_t blasfeo_cm_memsize_smat(int m, int n); +// create a strmat for a matrix of size m*n by using memory passed by a pointer (pointer is not updated) +void blasfeo_cm_create_smat(int m, int n, struct blasfeo_pm_smat *sA, void *memory); + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_S_AUX_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_s_aux_ext_dep.h b/third_party/acados/include/blasfeo/include/blasfeo_s_aux_ext_dep.h new file mode 100644 index 000000000..5209d20d3 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_s_aux_ext_dep.h @@ -0,0 +1,141 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_S_AUX_EXT_DEP_H_ +#define BLASFEO_S_AUX_EXT_DEP_H_ + + + +#include + + + +#include "blasfeo_common.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#ifdef EXT_DEP + +/************************************************ +* s_aux_extern_depend_lib.c +************************************************/ + +/* column-major matrices */ + +// dynamically allocate row*col floats of memory and set accordingly a pointer to float; set allocated memory to zero +void s_zeros(float **pA, int row, int col); +// dynamically allocate row*col floats of memory aligned to 64-byte boundaries and set accordingly a pointer to float; set allocated memory to zero +void s_zeros_align(float **pA, int row, int col); +// dynamically allocate size bytes of memory aligned to 64-byte boundaries and set accordingly a pointer to float; set allocated memory to zero +void s_zeros_align_bytes(float **pA, int size); +// free the memory allocated by d_zeros +void s_free(float *pA); +// free the memory allocated by d_zeros_align or d_zeros_align_bytes +void s_free_align(float *pA); +// print a column-major matrix +void s_print_mat(int m, int n, float *A, int lda); +// print the transposed of a column-major matrix +void s_print_tran_mat(int row, int col, float *A, int lda); +// print to file a column-major matrix +void s_print_to_file_mat(FILE *file, int row, int col, float *A, int lda); +// print to file a column-major matrix in exponential format +void s_print_to_file_exp_mat(FILE *file, int row, int col, float *A, int lda); +// print to string a column-major matrix +void s_print_to_string_mat(char **buf_out, int row, int col, float *A, int lda); +// print to file the transposed of a column-major matrix +void s_print_tran_to_file_mat(FILE *file, int row, int col, float *A, int lda); +// print to file the transposed of a column-major matrix in exponential format +void s_print_tran_to_file_exp_mat(FILE *file, int row, int col, float *A, int lda); +// print in exponential notation a column-major matrix +void s_print_exp_mat(int m, int n, float *A, int lda); +// print in exponential notation the transposed of a column-major matrix +void s_print_exp_tran_mat(int row, int col, float *A, int lda); + +/* strmat and strvec */ + +// create a strmat for a matrix of size m*n by dynamically allocating memory +void blasfeo_allocate_smat(int m, int n, struct blasfeo_smat *sA); +// create a strvec for a vector of size m by dynamically allocating memory +void blasfeo_allocate_svec(int m, struct blasfeo_svec *sa); +// free the memory allocated by blasfeo_allocate_dmat +void blasfeo_free_smat(struct blasfeo_smat *sA); +// free the memory allocated by blasfeo_allocate_dvec +void blasfeo_free_svec(struct blasfeo_svec *sa); +// print a strmat +void blasfeo_print_smat(int m, int n, struct blasfeo_smat *sA, int ai, int aj); +// print in exponential notation a strmat +void blasfeo_print_exp_smat(int m, int n, struct blasfeo_smat *sA, int ai, int aj); +// print to file a strmat +void blasfeo_print_to_file_smat(FILE *file, int m, int n, struct blasfeo_smat *sA, int ai, int aj); +// print to file a strmat in exponential format +void blasfeo_print_to_file_exp_smat(FILE *file, int m, int n, struct blasfeo_smat *sA, int ai, int aj); +// print to string a strmat +void blasfeo_print_to_string_smat(char **buf_out, int m, int n, struct blasfeo_smat *sA, int ai, int aj); +// print the transpose of a strmat +void blasfeo_print_tran_smat(int m, int n, struct blasfeo_smat *sA, int ai, int aj); +// print a strvec +void blasfeo_print_svec(int m, struct blasfeo_svec *sa, int ai); +// print in exponential notation a strvec +void blasfeo_print_exp_svec(int m, struct blasfeo_svec *sa, int ai); +// print to file a strvec +void blasfeo_print_to_file_svec(FILE *file, int m, struct blasfeo_svec *sa, int ai); +// print to string a strvec +void blasfeo_print_to_string_svec(char **buf_out, int m, struct blasfeo_svec *sa, int ai); +// print the transposed of a strvec +void blasfeo_print_tran_svec(int m, struct blasfeo_svec *sa, int ai); +// print in exponential notation the transposed of a strvec +void blasfeo_print_exp_tran_svec(int m, struct blasfeo_svec *sa, int ai); +// print to file the transposed of a strvec +void blasfeo_print_to_file_tran_svec(FILE *file, int m, struct blasfeo_svec *sa, int ai); +// print to string the transposed of a strvec +void blasfeo_print_to_string_tran_svec(char **buf_out, int m, struct blasfeo_svec *sa, int ai); + +#endif // EXT_DEP + + + +#ifdef __cplusplus +} +#endif + + + +#endif // BLASFEO_S_AUX_EXT_DEP_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_s_aux_ext_dep_ref.h b/third_party/acados/include/blasfeo/include/blasfeo_s_aux_ext_dep_ref.h new file mode 100644 index 000000000..6640e20a4 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_s_aux_ext_dep_ref.h @@ -0,0 +1,82 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_S_AUX_EXT_DEP_REF_H_ +#define BLASFEO_S_AUX_EXT_DEP_REF_H_ + +#if defined(EXT_DEP) + + + +#include + +#include "blasfeo_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// expose reference BLASFEO for testing +// see blasfeo_s_aux_exp_dep.h for help + +void blasfeo_print_smat_ref(int m, int n, struct blasfeo_smat_ref *sA, int ai, int aj); +void blasfeo_allocate_smat_ref(int m, int n, struct blasfeo_smat_ref *sA); +void blasfeo_allocate_svec_ref(int m, struct blasfeo_svec_ref *sa); +void blasfeo_free_smat_ref(struct blasfeo_smat_ref *sA); +void blasfeo_free_svec_ref(struct blasfeo_svec_ref *sa); +void blasfeo_print_smat_ref(int m, int n, struct blasfeo_smat_ref *sA, int ai, int aj); +void blasfeo_print_exp_smat_ref(int m, int n, struct blasfeo_smat_ref *sA, int ai, int aj); +void blasfeo_print_to_file_smat_ref(FILE *file, int m, int n, struct blasfeo_smat_ref *sA, int ai, int aj); +void blasfeo_print_to_file_exp_smat_ref(FILE *file, int m, int n, struct blasfeo_smat_ref *sA, int ai, int aj); +void blasfeo_print_to_string_smat_ref(char **buf_out, int m, int n, struct blasfeo_smat_ref *sA, int ai, int aj); +void blasfeo_print_svec(int m, struct blasfeo_svec *sa, int ai); +void blasfeo_print_exp_svec(int m, struct blasfeo_svec *sa, int ai); +void blasfeo_print_to_file_svec(FILE *file, int m, struct blasfeo_svec *sa, int ai); +void blasfeo_print_to_string_svec(char **buf_out, int m, struct blasfeo_svec *sa, int ai); +void blasfeo_print_tran_svec(int m, struct blasfeo_svec *sa, int ai); +void blasfeo_print_exp_tran_svec(int m, struct blasfeo_svec *sa, int ai); +void blasfeo_print_to_file_tran_svec(FILE *file, int m, struct blasfeo_svec *sa, int ai); +void blasfeo_print_to_string_tran_svec(char **buf_out, int m, struct blasfeo_svec *sa, int ai); + + +#ifdef __cplusplus +} +#endif + + + +#endif // EXT_DEP + +#endif // BLASFEO_S_AUX_EXT_DEP_REF_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_s_aux_old.h b/third_party/acados/include/blasfeo/include/blasfeo_s_aux_old.h new file mode 100644 index 000000000..5c6db37ba --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_s_aux_old.h @@ -0,0 +1,64 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +// TODO remove +// +void strcp_l_lib(int m, float alpha, int offsetA, float *A, int sda, int offsetB, float *B, int sdb); +void sgead_lib(int m, int n, float alpha, int offsetA, float *A, int sda, int offsetB, float *B, int sdb); +void sgetr_lib(int m, int n, float alpha, int offsetA, float *pA, int sda, int offsetC, float *pC, int sdc); +void strtr_l_lib(int m, float alpha, int offsetA, float *pA, int sda, int offsetC, float *pC, int sdc); +void strtr_u_lib(int m, float alpha, int offsetA, float *pA, int sda, int offsetC, float *pC, int sdc); +void sdiareg_lib(int kmax, float reg, int offset, float *pD, int sdd); +void sdiain_sqrt_lib(int kmax, float *x, int offset, float *pD, int sdd); +void sdiaex_lib(int kmax, float alpha, int offset, float *pD, int sdd, float *x); +void sdiaad_lib(int kmax, float alpha, float *x, int offset, float *pD, int sdd); +void sdiain_libsp(int kmax, int *idx, float alpha, float *x, float *pD, int sdd); +void sdiaex_libsp(int kmax, int *idx, float alpha, float *pD, int sdd, float *x); +void sdiaad_libsp(int kmax, int *idx, float alpha, float *x, float *pD, int sdd); +void sdiaadin_libsp(int kmax, int *idx, float alpha, float *x, float *y, float *pD, int sdd); +void srowin_lib(int kmax, float alpha, float *x, float *pD); +void srowex_lib(int kmax, float alpha, float *pD, float *x); +void srowad_lib(int kmax, float alpha, float *x, float *pD); +void srowin_libsp(int kmax, float alpha, int *idx, float *x, float *pD); +void srowad_libsp(int kmax, int *idx, float alpha, float *x, float *pD); +void srowadin_libsp(int kmax, int *idx, float alpha, float *x, float *y, float *pD); +void srowsw_lib(int kmax, float *pA, float *pC); +void scolin_lib(int kmax, float *x, int offset, float *pD, int sdd); +void scolad_lib(int kmax, float alpha, float *x, int offset, float *pD, int sdd); +void scolin_libsp(int kmax, int *idx, float *x, float *pD, int sdd); +void scolad_libsp(int kmax, float alpha, int *idx, float *x, float *pD, int sdd); +void scolsw_lib(int kmax, int offsetA, float *pA, int sda, int offsetC, float *pC, int sdc); +void svecin_libsp(int kmax, int *idx, float *x, float *y); +void svecad_libsp(int kmax, int *idx, float alpha, float *x, float *y); diff --git a/third_party/acados/include/blasfeo/include/blasfeo_s_aux_ref.h b/third_party/acados/include/blasfeo/include/blasfeo_s_aux_ref.h new file mode 100644 index 000000000..f6e16a957 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_s_aux_ref.h @@ -0,0 +1,145 @@ + +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_S_AUX_REF_H_ +#define BLASFEO_S_AUX_REF_H_ + + + +#include + +#include "blasfeo_s_aux_old.h" +#include "blasfeo_common.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + +/************************************************ +* d_aux_lib.c +************************************************/ + +// returns the memory size (in bytes) needed for a smat +size_t blasfeo_ref_memsize_smat(int m, int n); +size_t blasfeo_ref_memsize_smat_ps(int ps, int m, int n); +// returns the memory size (in bytes) needed for the diagonal of a smat +size_t blasfeo_ref_memsize_diag_smat(int m, int n); +// returns the memory size (in bytes) needed for a svec +size_t blasfeo_ref_memsize_svec(int m); +// create a strmat for a matrix of size m*n by using memory passed by a pointer (pointer is not updated) +void blasfeo_ref_create_smat(int m, int n, struct blasfeo_smat *sA, void *memory); +void blasfeo_ref_create_smat_ps(int ps, int m, int n, struct blasfeo_smat *sA, void *memory); +// create a strvec for a vector of size m by using memory passed by a pointer (pointer is not updated) +void blasfeo_ref_create_svec(int m, struct blasfeo_svec *sA, void *memory); +void blasfeo_ref_pack_smat(int m, int n, float *A, int lda, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_ref_pack_l_smat(int m, int n, float *A, int lda, struct blasfeo_smat *sB, int bi, int bj); +void blasfeo_ref_pack_l_smat(int m, int n, float *A, int lda, struct blasfeo_smat *sB, int bi, int bj); +void blasfeo_ref_pack_tran_smat(int m, int n, float *A, int lda, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_ref_pack_svec(int m, float *x, int xi, struct blasfeo_svec *sa, int ai); +void blasfeo_ref_unpack_smat(int m, int n, struct blasfeo_smat *sA, int ai, int aj, float *A, int lda); +void blasfeo_ref_unpack_tran_smat(int m, int n, struct blasfeo_smat *sA, int ai, int aj, float *A, int lda); +void blasfeo_ref_unpack_svec(int m, struct blasfeo_svec *sa, int ai, float *x, int xi); +void ref_s_cast_mat2strmat(float *A, struct blasfeo_smat *sA); +void ref_s_cast_diag_mat2strmat(float *dA, struct blasfeo_smat *sA); +void ref_s_cast_vec2vecmat(float *a, struct blasfeo_svec *sa); + +// ge +void blasfeo_ref_sgese(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_ref_sgecpsc(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void blasfeo_ref_sgecp(int m, int n, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void blasfeo_ref_sgesc(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_ref_sgein1(float a, struct blasfeo_smat *sA, int ai, int aj); +float blasfeo_ref_sgeex1(struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_ref_sgead(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void blasfeo_ref_sgetr(int m, int n, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +// tr +void blasfeo_ref_strcp_l(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void blasfeo_ref_strtr_l(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void blasfeo_ref_strtr_u(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +// dia +void blasfeo_ref_sdiare(int kmax, float alpha, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_ref_sdiaex(int kmax, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi); +void blasfeo_ref_sdiain(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_ref_sdiain_sp(int kmax, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_smat *sD, int di, int dj); +void blasfeo_ref_sdiaex_sp(int kmax, float alpha, int *idx, struct blasfeo_smat *sD, int di, int dj, struct blasfeo_svec *sx, int xi); +void blasfeo_ref_sdiaad(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_ref_sdiaad_sp(int kmax, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_smat *sD, int di, int dj); +void blasfeo_ref_sdiaadin_sp(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sy, int yi, int *idx, struct blasfeo_smat *sD, int di, int dj); +// row +void blasfeo_ref_srowin(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_ref_srowex(int kmax, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi); +void blasfeo_ref_srowad(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_ref_srowad_sp(int kmax, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_smat *sD, int di, int dj); +void blasfeo_ref_srowsw(int kmax, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void blasfeo_ref_srowpe(int kmax, int *ipiv, struct blasfeo_smat *sA); +void blasfeo_ref_srowpei(int kmax, int *ipiv, struct blasfeo_smat *sA); +// col +void blasfeo_ref_scolex(int kmax, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi); +void blasfeo_ref_scolin(int kmax, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_ref_scolad(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_ref_scolsc(int kmax, float alpha, struct blasfeo_smat *sA, int ai, int aj); +void blasfeo_ref_scolsw(int kmax, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void blasfeo_ref_scolpe(int kmax, int *ipiv, struct blasfeo_smat *sA); +void blasfeo_ref_scolpei(int kmax, int *ipiv, struct blasfeo_smat *sA); +// vec +void blasfeo_ref_svecse(int m, float alpha, struct blasfeo_svec *sx, int xi); +void blasfeo_ref_sveccp(int m, struct blasfeo_svec *sa, int ai, struct blasfeo_svec *sc, int ci); +void blasfeo_ref_svecsc(int m, float alpha, struct blasfeo_svec *sa, int ai); +void blasfeo_ref_sveccpsc(int m, float alpha, struct blasfeo_svec *sa, int ai, struct blasfeo_svec *sc, int ci); +void blasfeo_ref_svecad(int m, float alpha, struct blasfeo_svec *sa, int ai, struct blasfeo_svec *sc, int ci); +void blasfeo_ref_svecin1(float a, struct blasfeo_svec *sx, int xi); +float blasfeo_ref_svecex1(struct blasfeo_svec *sx, int xi); +void blasfeo_ref_svecad_sp(int m, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_svec *sz, int zi); +void blasfeo_ref_svecin_sp(int m, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_svec *sz, int zi); +void blasfeo_ref_svecex_sp(int m, float alpha, int *idx, struct blasfeo_svec *sx, int x, struct blasfeo_svec *sz, int zi); +void blasfeo_ref_sveccl(int m, struct blasfeo_svec *sxm, int xim, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sxp, int xip, struct blasfeo_svec *sz, int zi); +void blasfeo_ref_sveccl_mask(int m, struct blasfeo_svec *sxm, int xim, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sxp, int xip, struct blasfeo_svec *sz, int zi, struct blasfeo_svec *sm, int mi); +void blasfeo_ref_svecze(int m, struct blasfeo_svec *sm, int mi, struct blasfeo_svec *sv, int vi, struct blasfeo_svec *se, int ei); +void blasfeo_ref_svecnrm_inf(int m, struct blasfeo_svec *sx, int xi, float *ptr_norm); +void blasfeo_ref_svecpe(int kmax, int *ipiv, struct blasfeo_svec *sx, int xi); +void blasfeo_ref_svecpei(int kmax, int *ipiv, struct blasfeo_svec *sx, int xi); + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_S_AUX_REF_H_ + diff --git a/third_party/acados/include/blasfeo/include/blasfeo_s_aux_test.h b/third_party/acados/include/blasfeo/include/blasfeo_s_aux_test.h new file mode 100644 index 000000000..08d9a14a6 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_s_aux_test.h @@ -0,0 +1,177 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_S_AUX_TEST_H_ +#define BLASFEO_S_AUX_TEST_H_ + +#include + +#include "blasfeo_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +/************************************************ +* d_aux_lib.c +************************************************/ + +int test_blasfeo_memsize_smat(int m, int n); +int test_blasfeo_memsize_diag_smat(int m, int n); +int test_blasfeo_memsize_svec(int m); + +void test_blasfeo_create_smat(int m, int n, struct blasfeo_smat *sA, void *memory); +void test_blasfeo_create_svec(int m, struct blasfeo_svec *sA, void *memory); + +void test_blasfeo_pack_smat(int m, int n, float *A, int lda, struct blasfeo_smat *sA, int ai, int aj); +void test_blasfeo_pack_svec(int m, float *x, int xi, struct blasfeo_svec *sa, int ai); +void test_blasfeo_pack_tran_smat(int m, int n, float *A, int lda, struct blasfeo_smat *sA, int ai, int aj); +void test_blasfeo_unpack_smat(int m, int n, struct blasfeo_smat *sA, int ai, int aj, float *A, int lda); +void test_blasfeo_unpack_svec(int m, struct blasfeo_svec *sa, int ai, float *x, int xi); +void test_blasfeo_unpack_tran_smat(int m, int n, struct blasfeo_smat *sA, int ai, int aj, float *A, int lda); + +void test_s_cast_mat2strmat(float *A, struct blasfeo_smat *sA); +void test_s_cast_diag_mat2strmat(float *dA, struct blasfeo_smat *sA); +void test_s_cast_vec2vecmat(float *a, struct blasfeo_svec *sa); +// copy and scale +void test_blasfeo_sgecpsc(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void test_blasfeo_sgecp(int m, int n, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +void test_blasfeo_sgesc(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj); + +// void test_blasfeo_sgein1(float a, struct blasfeo_smat *sA, int ai, int aj); +// float test_blasfeo_sgeex1(struct blasfeo_smat *sA, int ai, int aj); +// void test_blasfeo_svecin1(float a, struct blasfeo_svec *sx, int xi); +// float test_blasfeo_svecex1(struct blasfeo_svec *sx, int xi); + +// // A <= alpha +// void test_blasfeo_sgese(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj); +// // a <= alpha +// void test_blasfeo_svecse(int m, float alpha, struct blasfeo_svec *sx, int xi); + + +// void test_blasfeo_sveccp(int m, struct blasfeo_svec *sa, int ai, struct blasfeo_svec *sc, int ci); +// void test_blasfeo_svecsc(int m, float alpha, struct blasfeo_svec *sa, int ai); + +// void test_strcp_l_lib(int m, float alpha, int offsetA, float *A, int sda, int offsetB, float *B, int sdb); +// void test_blasfeo_strcp_l(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); + +// void test_sgead_lib(int m, int n, float alpha, int offsetA, float *A, int sda, int offsetB, float *B, int sdb); +// void test_blasfeo_sgead(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +// void test_blasfeo_svecad(int m, float alpha, struct blasfeo_svec *sa, int ai, struct blasfeo_svec *sc, int ci); + +// void test_sgetr_lib(int m, int n, float alpha, int offsetA, float *pA, int sda, int offsetC, float *pC, int sdc); +// void test_blasfeo_sgetr(int m, int n, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); + +// void test_strtr_l_lib(int m, float alpha, int offsetA, float *pA, int sda, int offsetC, float *pC, int sdc); +// void test_blasfeo_strtr_l(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +// void test_strtr_u_lib(int m, float alpha, int offsetA, float *pA, int sda, int offsetC, float *pC, int sdc); +// void test_blasfeo_strtr_u(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); + +// void test_sdiareg_lib(int kmax, float reg, int offset, float *pD, int sdd); +// void test_blasfeo_sdiaex(int kmax, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi); +// void test_blasfeo_sdiain(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +// void test_sdiain_sqrt_lib(int kmax, float *x, int offset, float *pD, int sdd); +// void test_sdiaex_lib(int kmax, float alpha, int offset, float *pD, int sdd, float *x); +// void test_sdiaad_lib(int kmax, float alpha, float *x, int offset, float *pD, int sdd); +// void test_sdiain_libsp(int kmax, int *idx, float alpha, float *x, float *pD, int sdd); +// void test_blasfeo_sdiain_sp(int kmax, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_smat *sD, int di, int dj); +// void test_sdiaex_libsp(int kmax, int *idx, float alpha, float *pD, int sdd, float *x); +// void test_blasfeo_sdiaex_sp(int kmax, float alpha, int *idx, struct blasfeo_smat *sD, int di, int dj, struct blasfeo_svec *sx, int xi); +// void test_blasfeo_sdiaad(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +// void test_sdiaad_libsp(int kmax, int *idx, float alpha, float *x, float *pD, int sdd); +// void test_blasfeo_sdiaad_sp(int kmax, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_smat *sD, int di, int dj); +// void test_sdiaadin_libsp(int kmax, int *idx, float alpha, float *x, float *y, float *pD, int sdd); +// void test_blasfeo_sdiaadin_sp(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sy, int yi, int *idx, struct blasfeo_smat *sD, int di, int dj); +// void test_srowin_lib(int kmax, float alpha, float *x, float *pD); +// void test_blasfeo_srowin(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +// void test_srowex_lib(int kmax, float alpha, float *pD, float *x); +// void test_blasfeo_srowex(int kmax, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi); +// void test_srowad_lib(int kmax, float alpha, float *x, float *pD); +// void test_blasfeo_srowad(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +// void test_srowin_libsp(int kmax, float alpha, int *idx, float *x, float *pD); +// void test_srowad_libsp(int kmax, int *idx, float alpha, float *x, float *pD); +// void test_blasfeo_srowad_sp(int kmax, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_smat *sD, int di, int dj); +// void test_srowadin_libsp(int kmax, int *idx, float alpha, float *x, float *y, float *pD); +// void test_srowsw_lib(int kmax, float *pA, float *pC); +// void test_blasfeo_srowsw(int kmax, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +// void test_blasfeo_srowpe(int kmax, int *ipiv, struct blasfeo_smat *sA); +// void test_scolin_lib(int kmax, float *x, int offset, float *pD, int sdd); +// void test_blasfeo_scolin(int kmax, struct blasfeo_svec *sx, int xi, struct blasfeo_smat *sA, int ai, int aj); +// void test_scolad_lib(int kmax, float alpha, float *x, int offset, float *pD, int sdd); +// void test_scolin_libsp(int kmax, int *idx, float *x, float *pD, int sdd); +// void test_scolad_libsp(int kmax, float alpha, int *idx, float *x, float *pD, int sdd); +// void test_scolsw_lib(int kmax, int offsetA, float *pA, int sda, int offsetC, float *pC, int sdc); +// void test_blasfeo_scolsw(int kmax, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sC, int ci, int cj); +// void test_blasfeo_scolpe(int kmax, int *ipiv, struct blasfeo_smat *sA); +// void test_svecin_libsp(int kmax, int *idx, float *x, float *y); +// void test_svecad_libsp(int kmax, int *idx, float alpha, float *x, float *y); +// void test_blasfeo_svecad_sp(int m, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_svec *sz, int zi); +// void test_blasfeo_svecin_sp(int m, float alpha, struct blasfeo_svec *sx, int xi, int *idx, struct blasfeo_svec *sz, int zi); +// void test_blasfeo_svecex_sp(int m, float alpha, int *idx, struct blasfeo_svec *sx, int x, struct blasfeo_svec *sz, int zi); +// void test_blasfeo_sveccl(int m, struct blasfeo_svec *sxm, int xim, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sxp, int xip, struct blasfeo_svec *sz, int zi); +// void test_blasfeo_sveccl_mask(int m, struct blasfeo_svec *sxm, int xim, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sxp, int xip, struct blasfeo_svec *sz, int zi, struct blasfeo_svec *sm, int mi); +// void test_blasfeo_svecze(int m, struct blasfeo_svec *sm, int mi, struct blasfeo_svec *sv, int vi, struct blasfeo_svec *se, int ei); +// void test_blasfeo_svecnrm_inf(int m, struct blasfeo_svec *sx, int xi, float *ptr_norm); +// void test_blasfeo_svecpe(int kmax, int *ipiv, struct blasfeo_svec *sx, int xi); + + +// ext_dep + +void test_blasfeo_allocate_smat(int m, int n, struct blasfeo_smat *sA); +void test_blasfeo_allocate_svec(int m, struct blasfeo_svec *sa); + +void test_blasfeo_free_smat(struct blasfeo_smat *sA); +void test_blasfeo_free_svec(struct blasfeo_svec *sa); + +void test_blasfeo_print_smat(int m, int n, struct blasfeo_smat *sA, int ai, int aj); +void test_blasfeo_print_svec(int m, struct blasfeo_svec *sa, int ai); +void test_blasfeo_print_tran_svec(int m, struct blasfeo_svec *sa, int ai); + +void test_blasfeo_print_to_file_smat(FILE *file, int m, int n, struct blasfeo_smat *sA, int ai, int aj); +void test_blasfeo_print_to_file_svec(FILE *file, int m, struct blasfeo_svec *sa, int ai); +void test_blasfeo_print_to_file_tran_svec(FILE *file, int m, struct blasfeo_svec *sa, int ai); + +void test_blasfeo_print_exp_smat(int m, int n, struct blasfeo_smat *sA, int ai, int aj); +void test_blasfeo_print_exp_svec(int m, struct blasfeo_svec *sa, int ai); +void test_blasfeo_print_exp_tran_svec(int m, struct blasfeo_svec *sa, int ai); + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_S_AUX_TEST_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_s_blas.h b/third_party/acados/include/blasfeo/include/blasfeo_s_blas.h new file mode 100644 index 000000000..200f1f51b --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_s_blas.h @@ -0,0 +1,46 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_S_BLAS_H_ +#define BLASFEO_S_BLAS_H_ + + + +#include "blasfeo_s_blasfeo_api.h" +#include "blasfeo_s_blas_api.h" + + + +#endif // BLASFEO_S_BLAS_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_s_blas_api.h b/third_party/acados/include/blasfeo/include/blasfeo_s_blas_api.h new file mode 100644 index 000000000..d0fa2245c --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_s_blas_api.h @@ -0,0 +1,117 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef BLASFEO_S_BLAS_API_H_ +#define BLASFEO_S_BLAS_API_H_ + + + +#include "blasfeo_target.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#ifdef BLAS_API + + + +#ifdef FORTRAN_BLAS_API + + + +// BLAS 1 +// +void saxpy_(int *n, float *alpha, float *x, int *incx, float *y, int *incy); +// +float sdot_(int *n, float *x, int *incx, float *y, int *incy); + +// BLAS 3 +// +void sgemm_(char *ta, char *tb, int *m, int *n, int *k, float *alpha, float *A, int *lda, float *B, int *ldb, float *beta, float *C, int *ldc); +// +void strsm_(char *side, char *uplo, char *transa, char *diag, int *m, int *n, float *alpha, float *A, int *lda, float *B, int *ldb); + + + +// LAPACK +// +void spotrf_(char *uplo, int *m, float *A, int *lda, int *info); + + + +#else // BLASFEO_API + + + +// BLAS 1 +// +void blas_saxpy(int *n, float *alpha, float *x, int *incx, float *y, int *incy); +// +float blas_sdot(int *n, float *x, int *incx, float *y, int *incy); + +// BLAS 3 +// +void blas_sgemm(char *ta, char *tb, int *m, int *n, int *k, float *alpha, float *A, int *lda, float *B, int *ldb, float *beta, float *C, int *ldc); +// +void blas_strsm(char *side, char *uplo, char *transa, char *diag, int *m, int *n, float *alpha, float *A, int *lda, float *B, int *ldb); + + + +// LAPACK +// +void blas_spotrf(char *uplo, int *m, float *A, int *lda, int *info); + + + +#endif // BLASFEO_API + + + +#endif // BLAS_API + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_S_BLAS_API_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_s_blasfeo_api.h b/third_party/acados/include/blasfeo/include/blasfeo_s_blasfeo_api.h new file mode 100644 index 000000000..24b21ead2 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_s_blasfeo_api.h @@ -0,0 +1,272 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_S_BLASFEO_API_H_ +#define BLASFEO_S_BLASFEO_API_H_ + + + +#include "blasfeo_common.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + +// +// level 1 BLAS +// + +// z = y + alpha*x +void blasfeo_saxpy(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +// z = beta*y + alpha*x +void blasfeo_saxpby(int kmax, float alpha, struct blasfeo_svec *sx, int xi, float beta, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +// z = x .* y +void blasfeo_svecmul(int m, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +// z += x .* y +void blasfeo_svecmulacc(int m, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +// z = x .* y, return sum(z) = x^T * y +float blasfeo_svecmuldot(int m, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +// return x^T * y +float blasfeo_sdot(int m, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sy, int yi); +// construct givens plane rotation +void blasfeo_srotg(float a, float b, float *c, float *s); +// apply plane rotation [a b] [c -s; s; c] to the aj0 and aj1 columns of A at row index ai +void blasfeo_scolrot(int m, struct blasfeo_smat *sA, int ai, int aj0, int aj1, float c, float s); +// apply plane rotation [c s; -s c] [a; b] to the ai0 and ai1 rows of A at column index aj +void blasfeo_srowrot(int m, struct blasfeo_smat *sA, int ai0, int ai1, int aj, float c, float s); + + + +// +// level 2 BLAS +// + +// dense + +// z <= beta * y + alpha * A * x +void blasfeo_sgemv_n(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, float beta, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +// z <= beta * y + alpha * A' * x +void blasfeo_sgemv_t(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, float beta, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +// z <= inv( A ) * x, A (m)x(n) +void blasfeo_strsv_lnn_mn(int m, int n, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(n) +void blasfeo_strsv_ltn_mn(int m, int n, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= inv( A ) * x, A (m)x(m) lower, not_transposed, not_unit +void blasfeo_strsv_lnn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= inv( A ) * x, A (m)x(m) lower, not_transposed, unit +void blasfeo_strsv_lnu(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(m) lower, transposed, not_unit +void blasfeo_strsv_ltn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(m) lower, transposed, unit +void blasfeo_strsv_ltu(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(m) upper, not_transposed, not_unit +void blasfeo_strsv_unn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(m) upper, transposed, not_unit +void blasfeo_strsv_utn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= A * x ; A lower triangular +void blasfeo_strmv_lnn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= A * x ; A lower triangular, unit diagonal +void blasfeo_strmv_lnu(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= A' * x ; A lower triangular +void blasfeo_strmv_ltn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= A' * x ; A lower triangular, unit diagonal +void blasfeo_strmv_ltu(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= beta * y + alpha * A * x ; A upper triangular +void blasfeo_strmv_unn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= A' * x ; A upper triangular +void blasfeo_strmv_utn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z_n <= beta_n * y_n + alpha_n * A * x_n +// z_t <= beta_t * y_t + alpha_t * A' * x_t +void blasfeo_sgemv_nt(int m, int n, float alpha_n, float alpha_t, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx_n, int xi_n, struct blasfeo_svec *sx_t, int xi_t, float beta_n, float beta_t, struct blasfeo_svec *sy_n, int yi_n, struct blasfeo_svec *sy_t, int yi_t, struct blasfeo_svec *sz_n, int zi_n, struct blasfeo_svec *sz_t, int zi_t); +// z <= beta * y + alpha * A * x, where A is symmetric and only the lower triangular patr of A is accessed +void blasfeo_ssymv_l(int m, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, float beta, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +void blasfeo_ssymv_l_mn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, float beta, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); + +// diagonal + +// z <= beta * y + alpha * A * x, A diagonal +void blasfeo_sgemv_d(int m, float alpha, struct blasfeo_svec *sA, int ai, struct blasfeo_svec *sx, int xi, float beta, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); + + + +// +// level 3 BLAS +// + +// dense + +// D <= beta * C + alpha * A * B +void blasfeo_sgemm_nn(int m, int n, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= beta * C + alpha * A * B^T +void blasfeo_sgemm_nt(int m, int n, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= beta * C + alpha * A^T * B +void blasfeo_sgemm_tn(int m, int n, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= beta * C + alpha * A^T * B +void blasfeo_sgemm_tt(int m, int n, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= beta * C + alpha * A * B^T ; C, D lower triangular +void blasfeo_ssyrk_ln(int m, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +void blasfeo_ssyrk_ln_mn(int m, int n, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= beta * C + alpha * A^T * B ; C, D lower triangular +void blasfeo_ssyrk_lt(int m, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= beta * C + alpha * A * B^T ; C, D upper triangular +void blasfeo_ssyrk_un(int m, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= beta * C + alpha * A^T * B ; C, D upper triangular +void blasfeo_ssyrk_ut(int m, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^T ; B upper triangular +void blasfeo_strmm_rutn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A ; A lower triangular +void blasfeo_strmm_rlnn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A lower triangular employint explicit inverse of diagonal +void blasfeo_strsm_llnn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A lower triangular with unit diagonal +void blasfeo_strsm_llnu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A lower triangular employint explicit inverse of diagonal +void blasfeo_strsm_lltn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A lower triangular with unit diagonal +void blasfeo_strsm_lltu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A upper triangular employing explicit inverse of diagonal +void blasfeo_strsm_lunn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A upper triangular withunit diagonal +void blasfeo_strsm_lunu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A upper triangular employing explicit inverse of diagonal +void blasfeo_strsm_lutn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A upper triangular withunit diagonal +void blasfeo_strsm_lutu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A lower triangular employing explicit inverse of diagonal +void blasfeo_strsm_rlnn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A lower triangular with unit diagonal +void blasfeo_strsm_rlnu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A lower triangular employing explicit inverse of diagonal +void blasfeo_strsm_rltn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A lower triangular with unit diagonal +void blasfeo_strsm_rltu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A upper triangular employing explicit inverse of diagonal +void blasfeo_strsm_runn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A upper triangular with unit diagonal +void blasfeo_strsm_runu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A upper triangular employing explicit inverse of diagonal +void blasfeo_strsm_rutn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A upper triangular with unit diagonal +void blasfeo_strsm_rutu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); + +// diagonal + +// D <= alpha * A * B + beta * C, with A diagonal (stored as strvec) +void sgemm_diag_left_ib(int m, int n, float alpha, float *dA, float *pB, int sdb, float beta, float *pC, int sdc, float *pD, int sdd); +void blasfeo_sgemm_dn(int m, int n, float alpha, struct blasfeo_svec *sA, int ai, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A * B + beta * C, with B diagonal (stored as strvec) +void blasfeo_sgemm_nd(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sB, int bi, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); + + + +// +// LAPACK +// + +// D <= chol( C ) ; C, D lower triangular +void blasfeo_spotrf_l(int m, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +void blasfeo_spotrf_l_mn(int m, int n, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= chol( C ) ; C, D upper triangular +void blasfeo_spotrf_u(int m, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= chol( C + A * B' ) ; C, D lower triangular +void blasfeo_ssyrk_spotrf_ln(int m, int k, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +void blasfeo_ssyrk_spotrf_ln_mn(int m, int n, int k, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= lu( C ) ; no pivoting +void blasfeo_sgetrf_np(int m, int n, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= lu( C ) ; row pivoting +void blasfeo_sgetrf_rp(int m, int n, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj, int *ipiv); +// D <= qr( C ) +void blasfeo_sgeqrf(int m, int n, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj, void *work); +int blasfeo_sgeqrf_worksize(int m, int n); // in bytes +// D <= Q factor, where C is the output of the LQ factorization +int blasfeo_sorglq_worksize(int m, int n, int k); // in bytes +void blasfeo_sorglq(int m, int n, int k, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj, void *work); +// D <= lq( C ) +void blasfeo_sgelqf(int m, int n, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj, void *work); +int blasfeo_sgelqf_worksize(int m, int n); // in bytes +// D <= lq( C ), positive diagonal elements +void blasfeo_sgelqf_pd(int m, int n, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj, void *work); +// [L, A] <= lq( [L, A] ), positive diagonal elements, array of matrices, with +// L lower triangular, of size (m)x(m) +// A full, of size (m)x(n1) +void blasfeo_sgelqf_pd_la(int m, int n1, struct blasfeo_smat *sL, int li, int lj, struct blasfeo_smat *sA, int ai, int aj, void *work); +// [L, L, A] <= lq( [L, L, A] ), positive diagonal elements, array of matrices, with: +// L lower triangular, of size (m)x(m) +// A full, of size (m)x(n1) +void blasfeo_sgelqf_pd_lla(int m, int n1, struct blasfeo_smat *sL0, int l0i, int l0j, struct blasfeo_smat *sL1, int l1i, int l1j, struct blasfeo_smat *sA, int ai, int aj, void *work); + + + + +// +// BLAS API helper functions +// + +#if ( defined(BLAS_API) & defined(MF_PANELMAJ) ) +// BLAS 3 +void blasfeo_cm_sgemm_nn(int m, int n, int k, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, float beta, struct blasfeo_cm_smat *sC, int ci, int cj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_sgemm_nt(int m, int n, int k, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, float beta, struct blasfeo_cm_smat *sC, int ci, int cj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_sgemm_tn(int m, int n, int k, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, float beta, struct blasfeo_cm_smat *sC, int ci, int cj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_sgemm_tt(int m, int n, int k, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, float beta, struct blasfeo_cm_smat *sC, int ci, int cj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_llnn(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_llnu(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_lltn(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_lltu(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_lunn(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_lunu(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_lutn(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_lutu(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_rlnn(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_rlnu(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_rltn(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_rltu(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_runn(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_runu(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_rutn(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_strsm_rutu(int m, int n, float alpha, struct blasfeo_cm_smat *sA, int ai, int aj, struct blasfeo_cm_smat *sB, int bi, int bj, struct blasfeo_cm_smat *sD, int di, int dj); +// LAPACK +void blasfeo_cm_spotrf_l(int m, struct blasfeo_cm_smat *sC, int ci, int cj, struct blasfeo_cm_smat *sD, int di, int dj); +void blasfeo_cm_spotrf_u(int m, struct blasfeo_cm_smat *sC, int ci, int cj, struct blasfeo_cm_smat *sD, int di, int dj); +#endif + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_S_BLASFEO_API_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_s_blasfeo_api_ref.h b/third_party/acados/include/blasfeo/include/blasfeo_s_blasfeo_api_ref.h new file mode 100644 index 000000000..f429a79dc --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_s_blasfeo_api_ref.h @@ -0,0 +1,135 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_S_BLASFEO_API_REF_H_ +#define BLASFEO_S_BLASFEO_API_REF_H_ + +#include "blasfeo_common.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + +// expose reference BLASFEO for testing + +// --- level 1 + +void blasfeo_saxpy_ref(int kmax, float alpha, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sy, int yi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_saxpby_ref(int kmax, float alpha, struct blasfeo_svec_ref *sx, int xi, float beta, struct blasfeo_svec_ref *sy, int yi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_svecmul_ref(int m, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sy, int yi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_svecmulacc_ref(int m, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sy, int yi, struct blasfeo_svec_ref *sz, int zi); +float blasfeo_svecmuldot_ref(int m, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sy, int yi, struct blasfeo_svec_ref *sz, int zi); +float blasfeo_sdot_ref(int m, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sy, int yi); +void blasfeo_srotg_ref(float a, float b, float *c, float *s); +void blasfeo_scolrot_ref(int m, struct blasfeo_smat_ref *sA, int ai, int aj0, int aj1, float c, float s); +void blasfeo_srowrot_ref(int m, struct blasfeo_smat_ref *sA, int ai0, int ai1, int aj, float c, float s); + + +// --- level 2 + +// dense +void blasfeo_sgemv_n_ref(int m, int n, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, float beta, struct blasfeo_svec_ref *sy, int yi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_sgemv_t_ref(int m, int n, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, float beta, struct blasfeo_svec_ref *sy, int yi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_strsv_lnn_mn_ref(int m, int n, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_strsv_ltn_mn_ref(int m, int n, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_strsv_lnn_ref(int m, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_strsv_lnu_ref(int m, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_strsv_ltn_ref(int m, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_strsv_ltu_ref(int m, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_strsv_unn_ref(int m, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_strsv_utn_ref(int m, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_strmv_unn_ref(int m, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_strmv_utn_ref(int m, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_strmv_lnn_ref(int m, int n, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_strmv_ltn_ref(int m, int n, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_strmv_lnu_ref(int m, int n, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_strmv_ltu_ref(int m, int n, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, struct blasfeo_svec_ref *sz, int zi); +void blasfeo_sgemv_nt_ref(int m, int n, float alpha_n, float alpha_t, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx_n, int xi_n, struct blasfeo_svec_ref *sx_t, int xi_t, float beta_n, float beta_t, struct blasfeo_svec_ref *sy_n, int yi_n, struct blasfeo_svec_ref *sy_t, int yi_t, struct blasfeo_svec_ref *sz_n, int zi_n, struct blasfeo_svec_ref *sz_t, int zi_t); +void blasfeo_ssymv_l_ref(int m, int n, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sx, int xi, float beta, struct blasfeo_svec_ref *sy, int yi, struct blasfeo_svec_ref *sz, int zi); + +// diagonal +void blasfeo_sgemv_d_ref(int m, float alpha, struct blasfeo_svec_ref *sA, int ai, struct blasfeo_svec_ref *sx, int xi, float beta, struct blasfeo_svec_ref *sy, int yi, struct blasfeo_svec_ref *sz, int zi); + + +// --- level 3 + +// dense +void blasfeo_sgemm_nn_ref( int m, int n, int k, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, float beta, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_sgemm_nt_ref( int m, int n, int k, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, float beta, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_sgemm_tn_ref(int m, int n, int k, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, float beta, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_sgemm_tt_ref(int m, int n, int k, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, float beta, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); + +void blasfeo_ssyrk_ln_mn_ref( int m, int n, int k, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, float beta, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_ssyrk_ln_ref( int m, int k, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, float beta, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_ssyrk_lt_ref( int m, int k, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, float beta, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_ssyrk_un_ref( int m, int k, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, float beta, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_ssyrk_ut_ref( int m, int k, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, float beta, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); + +void blasfeo_strmm_rutn_ref( int m, int n, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_strmm_rlnn_ref( int m, int n, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_strsm_rltn_ref( int m, int n, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_strsm_rltu_ref( int m, int n, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_strsm_rutn_ref( int m, int n, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_strsm_llnu_ref( int m, int n, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_strsm_lunn_ref( int m, int n, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, struct blasfeo_smat_ref *sD, int di, int dj); + +// diagonal +void dgemm_diag_left_lib_ref(int m, int n, float alpha, float *dA, float *pB, int sdb, float beta, float *pC, int sdc, float *pD, int sdd); +void blasfeo_sgemm_dn_ref(int m, int n, float alpha, struct blasfeo_svec_ref *sA, int ai, struct blasfeo_smat_ref *sB, int bi, int bj, float beta, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_sgemm_nd_ref(int m, int n, float alpha, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_svec_ref *sB, int bi, float beta, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); + +// --- lapack + +void blasfeo_sgetrf_nopivot_ref(int m, int n, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_sgetrf_rowpivot_ref(int m, int n, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj, int *ipiv); +void blasfeo_spotrf_l_ref(int m, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_spotrf_l_mn_ref(int m, int n, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_ssyrk_dpotrf_ln_ref(int m, int k, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_ssyrk_dpotrf_ln_mn_ref(int m, int n, int k, struct blasfeo_smat_ref *sA, int ai, int aj, struct blasfeo_smat_ref *sB, int bi, int bj, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_sgetrf_nopivot_ref(int m, int n, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj); +void blasfeo_sgetrf_rowpivot_ref(int m, int n, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj, int *ipiv); +void blasfeo_sgeqrf_ref(int m, int n, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj, void *work); +void blasfeo_sgelqf_ref(int m, int n, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj, void *work); +void blasfeo_sgelqf_pd_ref(int m, int n, struct blasfeo_smat_ref *sC, int ci, int cj, struct blasfeo_smat_ref *sD, int di, int dj, void *work); +void blasfeo_sgelqf_pd_la_ref(int m, int n1, struct blasfeo_smat_ref *sL, int li, int lj, struct blasfeo_smat_ref *sA, int ai, int aj, void *work); +void blasfeo_sgelqf_pd_lla_ref(int m, int n1, struct blasfeo_smat_ref *sL0, int l0i, int l0j, struct blasfeo_smat_ref *sL1, int l1i, int l1j, struct blasfeo_smat_ref *sA, int ai, int aj, void *work); + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_S_BLASFEO_API_REF_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_s_blasfeo_ref_api.h b/third_party/acados/include/blasfeo/include/blasfeo_s_blasfeo_ref_api.h new file mode 100644 index 000000000..805914cc0 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_s_blasfeo_ref_api.h @@ -0,0 +1,240 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_S_BLASFEO_REF_API_H_ +#define BLASFEO_S_BLASFEO_REF_API_H_ + + + +#include "blasfeo_common.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + +// +// level 1 BLAS +// + +// z = y + alpha*x +void blasfeo_ref_saxpy(int kmax, float alpha, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +// z = beta*y + alpha*x +void blasfeo_ref_saxpby(int kmax, float alpha, struct blasfeo_svec *sx, int xi, float beta, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +// z = x .* y +void blasfeo_ref_svecmul(int m, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +// z += x .* y +void blasfeo_ref_svecmulacc(int m, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +// z = x .* y, return sum(z) = x^T * y +float blasfeo_ref_svecmuldot(int m, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +// return x^T * y +float blasfeo_ref_sdot(int m, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sy, int yi); +// construct givens plane rotation +void blasfeo_ref_srotg(float a, float b, float *c, float *s); +// apply plane rotation [a b] [c -s; s; c] to the aj0 and aj1 columns of A at row index ai +void blasfeo_ref_scolrot(int m, struct blasfeo_smat *sA, int ai, int aj0, int aj1, float c, float s); +// apply plane rotation [c s; -s c] [a; b] to the ai0 and ai1 rows of A at column index aj +void blasfeo_ref_srowrot(int m, struct blasfeo_smat *sA, int ai0, int ai1, int aj, float c, float s); + + + +// +// level 2 BLAS +// + +// dense + +// z <= beta * y + alpha * A * x +void blasfeo_ref_sgemv_n(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, float beta, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +// z <= beta * y + alpha * A' * x +void blasfeo_ref_sgemv_t(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, float beta, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +// z <= inv( A ) * x, A (m)x(n) +void blasfeo_ref_strsv_lnn_mn(int m, int n, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(n) +void blasfeo_ref_strsv_ltn_mn(int m, int n, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= inv( A ) * x, A (m)x(m) lower, not_transposed, not_unit +void blasfeo_ref_strsv_lnn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= inv( A ) * x, A (m)x(m) lower, not_transposed, unit +void blasfeo_ref_strsv_lnu(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(m) lower, transposed, not_unit +void blasfeo_ref_strsv_ltn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(m) lower, transposed, unit +void blasfeo_ref_strsv_ltu(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(m) upper, not_transposed, not_unit +void blasfeo_ref_strsv_unn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= inv( A' ) * x, A (m)x(m) upper, transposed, not_unit +void blasfeo_ref_strsv_utn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= A * x ; A lower triangular +void blasfeo_ref_strmv_lnn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= A * x ; A lower triangular, unit diagonal +void blasfeo_ref_strmv_lnu(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= A' * x ; A lower triangular +void blasfeo_ref_strmv_ltn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= A' * x ; A lower triangular, unit diagonal +void blasfeo_ref_strmv_ltu(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= beta * y + alpha * A * x ; A upper triangular +void blasfeo_ref_strmv_unn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z <= A' * x ; A upper triangular +void blasfeo_ref_strmv_utn(int m, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, struct blasfeo_svec *sz, int zi); +// z_n <= beta_n * y_n + alpha_n * A * x_n +// z_t <= beta_t * y_t + alpha_t * A' * x_t +void blasfeo_ref_sgemv_nt(int m, int n, float alpha_n, float alpha_t, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx_n, int xi_n, struct blasfeo_svec *sx_t, int xi_t, float beta_n, float beta_t, struct blasfeo_svec *sy_n, int yi_n, struct blasfeo_svec *sy_t, int yi_t, struct blasfeo_svec *sz_n, int zi_n, struct blasfeo_svec *sz_t, int zi_t); +// z <= beta * y + alpha * A * x, where A is symmetric and only the lower triangular patr of A is accessed +void blasfeo_ref_ssymv_l(int m, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, float beta, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); +void blasfeo_ref_ssymv_l_mn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sx, int xi, float beta, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); + +// diagonal + +// z <= beta * y + alpha * A * x, A diagonal +void blasfeo_ref_sgemv_d(int m, float alpha, struct blasfeo_svec *sA, int ai, struct blasfeo_svec *sx, int xi, float beta, struct blasfeo_svec *sy, int yi, struct blasfeo_svec *sz, int zi); + + + +// +// level 3 BLAS +// + +// dense + +// D <= beta * C + alpha * A * B +void blasfeo_ref_sgemm_nn(int m, int n, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= beta * C + alpha * A * B^T +void blasfeo_ref_sgemm_nt(int m, int n, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= beta * C + alpha * A^T * B +void blasfeo_ref_sgemm_tn(int m, int n, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= beta * C + alpha * A^T * B +void blasfeo_ref_sgemm_tt(int m, int n, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= beta * C + alpha * A * B^T ; C, D lower triangular +void blasfeo_ref_ssyrk_ln(int m, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +void blasfeo_ref_ssyrk_ln_mn(int m, int n, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= beta * C + alpha * A^T * B ; C, D lower triangular +void blasfeo_ref_ssyrk_lt(int m, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= beta * C + alpha * A * B^T ; C, D upper triangular +void blasfeo_ref_ssyrk_un(int m, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= beta * C + alpha * A^T * B ; C, D upper triangular +void blasfeo_ref_ssyrk_ut(int m, int k, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^T ; B upper triangular +void blasfeo_ref_strmm_rutn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A ; A lower triangular +void blasfeo_ref_strmm_rlnn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A lower triangular employint explicit inverse of diagonal +void blasfeo_ref_strsm_llnn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A lower triangular with unit diagonal +void blasfeo_ref_strsm_llnu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A lower triangular employint explicit inverse of diagonal +void blasfeo_ref_strsm_lltn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A lower triangular with unit diagonal +void blasfeo_ref_strsm_lltu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A upper triangular employing explicit inverse of diagonal +void blasfeo_ref_strsm_lunn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-1} * B , with A upper triangular withunit diagonal +void blasfeo_ref_strsm_lunu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A upper triangular employing explicit inverse of diagonal +void blasfeo_ref_strsm_lutn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A^{-T} * B , with A upper triangular withunit diagonal +void blasfeo_ref_strsm_lutu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A lower triangular employing explicit inverse of diagonal +void blasfeo_ref_strsm_rlnn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A lower triangular with unit diagonal +void blasfeo_ref_strsm_rlnu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A lower triangular employing explicit inverse of diagonal +void blasfeo_ref_strsm_rltn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A lower triangular with unit diagonal +void blasfeo_ref_strsm_rltu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A upper triangular employing explicit inverse of diagonal +void blasfeo_ref_strsm_runn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-1} , with A upper triangular with unit diagonal +void blasfeo_ref_strsm_runu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A upper triangular employing explicit inverse of diagonal +void blasfeo_ref_strsm_rutn(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * B * A^{-T} , with A upper triangular with unit diagonal +void blasfeo_ref_strsm_rutu(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sD, int di, int dj); + +// diagonal + +// D <= alpha * A * B + beta * C, with A diagonal (stored as strvec) +void sgemm_diag_left_ib(int m, int n, float alpha, float *dA, float *pB, int sdb, float beta, float *pC, int sdc, float *pD, int sdd); +void blasfeo_ref_sgemm_dn(int m, int n, float alpha, struct blasfeo_svec *sA, int ai, struct blasfeo_smat *sB, int bi, int bj, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= alpha * A * B + beta * C, with B diagonal (stored as strvec) +void blasfeo_ref_sgemm_nd(int m, int n, float alpha, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_svec *sB, int bi, float beta, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); + + + +// +// LAPACK +// + +// D <= chol( C ) ; C, D lower triangular +void blasfeo_ref_spotrf_l(int m, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +void blasfeo_ref_spotrf_l_mn(int m, int n, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= chol( C ) ; C, D upper triangular +void blasfeo_ref_spotrf_u(int m, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= chol( C + A * B' ) ; C, D lower triangular +void blasfeo_ref_ssyrk_spotrf_ln(int m, int k, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +void blasfeo_ref_ssyrk_spotrf_ln_mn(int m, int n, int k, struct blasfeo_smat *sA, int ai, int aj, struct blasfeo_smat *sB, int bi, int bj, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= lu( C ) ; no pivoting +void blasfeo_ref_sgetrf_np(int m, int n, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj); +// D <= lu( C ) ; row pivoting +void blasfeo_ref_sgetrf_rp(int m, int n, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj, int *ipiv); +// D <= qr( C ) +void blasfeo_ref_sgeqrf(int m, int n, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj, void *work); +int blasfeo_ref_sgeqrf_worksize(int m, int n); // in bytes +// D <= Q factor, where C is the output of the LQ factorization +int blasfeo_ref_sorglq_worksize(int m, int n, int k); // in bytes +void blasfeo_ref_sorglq(int m, int n, int k, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj, void *work); +// D <= lq( C ) +void blasfeo_ref_sgelqf(int m, int n, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj, void *work); +int blasfeo_ref_sgelqf_worksize(int m, int n); // in bytes +// D <= lq( C ), positive diagonal elements +void blasfeo_ref_sgelqf_pd(int m, int n, struct blasfeo_smat *sC, int ci, int cj, struct blasfeo_smat *sD, int di, int dj, void *work); +// [L, A] <= lq( [L, A] ), positive diagonal elements, array of matrices, with +// L lower triangular, of size (m)x(m) +// A full, of size (m)x(n1) +void blasfeo_ref_sgelqf_pd_la(int m, int n1, struct blasfeo_smat *sL, int li, int lj, struct blasfeo_smat *sA, int ai, int aj, void *work); +// [L, L, A] <= lq( [L, L, A] ), positive diagonal elements, array of matrices, with: +// L lower triangular, of size (m)x(m) +// A full, of size (m)x(n1) +void blasfeo_ref_sgelqf_pd_lla(int m, int n1, struct blasfeo_smat *sL0, int l0i, int l0j, struct blasfeo_smat *sL1, int l1i, int l1j, struct blasfeo_smat *sA, int ai, int aj, void *work); + + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_S_BLASFEO_REF_API_H_ + diff --git a/third_party/acados/include/blasfeo/include/blasfeo_s_kernel.h b/third_party/acados/include/blasfeo/include/blasfeo_s_kernel.h new file mode 100644 index 000000000..99d2b28c8 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_s_kernel.h @@ -0,0 +1,692 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_S_KERNEL_H_ +#define BLASFEO_S_KERNEL_H_ + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// utils +void blasfeo_align_2MB(void *ptr, void **ptr_align); +void blasfeo_align_4096_byte(void *ptr, void **ptr_align); +void blasfeo_align_64_byte(void *ptr, void **ptr_align); + + + +// +// lib8 +// + +// 24x4 +void kernel_sgemm_nt_24x4_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd); +void kernel_sgemm_nt_24x4_vs_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, int km, int kn); +void kernel_sgemm_nt_24x4_gen_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, int offsetC, float *C, int sdc, int offsetD, float *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_sgemm_nn_24x4_lib8(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, float *beta, float *C, int sdc, float *D, int sdd); +void kernel_sgemm_nn_24x4_vs_lib8(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, float *beta, float *C, int sdc, float *D, int sdd, int km, int kn); +void kernel_sgemm_nn_24x4_gen_lib8(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, float *beta, int offsetC, float *C, int sdc, int offsetD, float *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_ssyrk_nt_l_24x4_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd); +void kernel_ssyrk_nt_l_24x4_vs_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, int km, int kn); +void kernel_ssyrk_nt_l_20x4_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd); +void kernel_ssyrk_nt_l_20x4_vs_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, int km, int kn); +void kernel_spotrf_nt_l_24x4_lib8(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *inv_diag_D); +void kernel_spotrf_nt_l_24x4_vs_lib8(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *inv_diag_D, int km, int kn); +void kernel_spotrf_nt_l_20x4_lib8(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *inv_diag_D); +void kernel_spotrf_nt_l_20x4_vs_lib8(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *inv_diag_D, int km, int kn); +void kernel_strsm_nt_rl_inv_24x4_lib8(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *E, float *inv_diag_E); +void kernel_strsm_nt_rl_inv_24x4_vs_lib8(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *E, float *inv_diag_E, int km, int kn); +void kernel_sgemm_strsm_nt_rl_inv_24x4_lib8(int kp, float *Ap, int sdap, float *Bp, int km_, float *Am, int sdam, float *Bm, float *C, int sdc, float *D, int sdd, float *E, float *inv_diag_E); +void kernel_sgemm_strsm_nt_rl_inv_24x4_vs_lib8(int kp, float *Ap, int sdap, float *Bp, int km_, float *Am, int sdam, float *Bm, float *C, int sdc, float *D, int sdd, float *E, float *inv_diag_E, int km, int kn); +void kernel_ssyrk_spotrf_nt_l_20x4_vs_lib8(int kp, float *Ap, int sdap, float *Bp, int km_, float *Am, int sdam, float *Bm, float *C, int sdc, float *D, int sdd, float *inv_diag_D, int km, int kn); +void kernel_ssyrk_spotrf_nt_l_20x4_lib8(int kp, float *Ap, int sdap, float *Bp, int km_, float *Am, int sdam, float *Bm, float *C, int sdc, float *D, int sdd, float *inv_diag_D); +void kernel_ssyrk_spotrf_nt_l_24x4_vs_lib8(int kp, float *Ap, int sdap, float *Bp, int km_, float *Am, int sdam, float *Bm, float *C, int sdc, float *D, int sdd, float *inv_diag_D, int km, int kn); +void kernel_ssyrk_spotrf_nt_l_24x4_lib8(int kp, float *Ap, int sdap, float *Bp, int km_, float *Am, int sdam, float *Bm, float *C, int sdc, float *D, int sdd, float *inv_diag_D); +void kernel_strmm_nn_rl_24x4_lib8(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, float *D, int sdd); +void kernel_strmm_nn_rl_24x4_vs_lib8(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, float *D, int sdd, int km, int kn); + +// 16x8 +void kernel_sgemm_nt_16x8_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, float *spil); + +// 16x4 +void kernel_sgemm_nt_16x4_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd); +void kernel_sgemm_nt_16x4_vs_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, int km, int kn); +void kernel_sgemm_nt_16x4_gen_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, int offsetC, float *C, int sdc, int offsetD, float *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_sgemm_nn_16x4_lib8(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, float *beta, float *C, int sdc, float *D, int sdd); +void kernel_sgemm_nn_16x4_vs_lib8(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, float *beta, float *C, int sdc, float *D, int sdd, int km, int kn); +void kernel_sgemm_nn_16x4_gen_lib8(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, float *beta, int offsetC, float *C, int sdc, int offsetD, float *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_ssyrk_nt_l_16x4_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd); +void kernel_ssyrk_nt_l_16x4_vs_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, int km, int kn); +void kernel_ssyrk_nt_l_12x4_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd); +void kernel_ssyrk_nt_l_12x4_vs_lib8(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, int km, int kn); +void kernel_spotrf_nt_l_16x4_lib8(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *inv_diag_D); +void kernel_spotrf_nt_l_16x4_vs_lib8(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *inv_diag_D, int km, int kn); +void kernel_spotrf_nt_l_12x4_lib8(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *inv_diag_D); +void kernel_spotrf_nt_l_12x4_vs_lib8(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *inv_diag_D, int km, int kn); +void kernel_strsm_nt_rl_inv_16x4_lib8(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *E, float *inv_diag_E); +void kernel_strsm_nt_rl_inv_16x4_vs_lib8(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *E, float *inv_diag_E, int km, int kn); +void kernel_sgemm_strsm_nt_rl_inv_16x4_lib8(int kp, float *Ap, int sdap, float *Bp, int km_, float *Am, int sdam, float *Bm, float *C, int sdc, float *D, int sdd, float *E, float *inv_diag_E); +void kernel_sgemm_strsm_nt_rl_inv_16x4_vs_lib8(int kp, float *Ap, int sdap, float *Bp, int km_, float *Am, int sdam, float *Bm, float *C, int sdc, float *D, int sdd, float *E, float *inv_diag_E, int km, int kn); +void kernel_ssyrk_spotrf_nt_l_12x4_vs_lib8(int kp, float *Ap, int sdap, float *Bp, int km_, float *Am, int sdam, float *Bm, float *C, int sdc, float *D, int sdd, float *inv_diag_D, int km, int kn); +void kernel_ssyrk_spotrf_nt_l_12x4_lib8(int kp, float *Ap, int sdap, float *Bp, int km_, float *Am, int sdam, float *Bm, float *C, int sdc, float *D, int sdd, float *inv_diag_D); +void kernel_ssyrk_spotrf_nt_l_16x4_vs_lib8(int kp, float *Ap, int sdap, float *Bp, int km_, float *Am, int sdam, float *Bm, float *C, int sdc, float *D, int sdd, float *inv_diag_D, int km, int kn); +void kernel_ssyrk_spotrf_nt_l_16x4_lib8(int kp, float *Ap, int sdap, float *Bp, int km_, float *Am, int sdam, float *Bm, float *C, int sdc, float *D, int sdd, float *inv_diag_D); +void kernel_strmm_nn_rl_16x4_lib8(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, float *D, int sdd); +void kernel_strmm_nn_rl_16x4_vs_lib8(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, float *D, int sdd, int km, int kn); +void kernel_strmm_nn_rl_16x4_gen_lib8(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, int offsetD, float *D, int sdd, int m0, int m1, int n0, int n1); + +// 8x8 +void kernel_sgemm_nt_8x8_lib8(int k, float *alpha, float *A, float *B, float *beta, float *C, float *D); +void kernel_sgemm_nt_8x8_vs_lib8(int k, float *alpha, float *A, float *B, float *beta, float *C, float *D, int km, int kn); +void kernel_sgemm_nt_8x8_gen_lib8(int k, float *alpha, float *A, float *B, float *beta, int offsetC, float *C, int sdc, int offsetD, float *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_sgemm_nn_8x8_lib8(int k, float *alpha, float *A, int offsetB, float *B, int sdb, float *beta, float *C, float *D); +void kernel_sgemm_nn_8x8_vs_lib8(int k, float *alpha, float *A, int offsetB, float *B, int sdb, float *beta, float *C, float *D, int km, int kn); +void kernel_sgemm_nn_8x8_gen_lib8(int k, float *alpha, float *A, int offsetB, float *B, int sdb, float *beta, int offsetC, float *C, int sdc, int offsetD, float *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_ssyrk_nt_l_8x8_lib8(int k, float *alpha, float *A, float *B, float *beta, float *C, float *D); +void kernel_ssyrk_nt_l_8x8_vs_lib8(int k, float *alpha, float *A, float *B, float *beta, float *C, float *D, int km, int kn); +void kernel_spotrf_nt_l_8x8_lib8(int k, float *A, float *B, float *C, float *D, float *inv_diag_D); +void kernel_spotrf_nt_l_8x8_vs_lib8(int k, float *A, float *B, float *C, float *D, float *inv_diag_D, int km, int kn); +void kernel_strsm_nt_rl_inv_8x8_lib8(int k, float *A, float *B, float *C, float *D, float *E, float *inv_diag_E); +void kernel_strsm_nt_rl_inv_8x8_vs_lib8(int k, float *A, float *B, float *C, float *D, float *E, float *inv_diag_E, int km, int kn); +void kernel_sgemm_strsm_nt_rl_inv_8x8_lib8(int kp, float *Ap, float *Bp, int km_, float *Am, float *Bm, float *C, float *D, float *E, float *inv_diag_E); +void kernel_sgemm_strsm_nt_rl_inv_8x8_vs_lib8(int kp, float *Ap, float *Bp, int km_, float *Am, float *Bm, float *C, float *D, float *E, float *inv_diag_E, int km, int kn); +void kernel_ssyrk_spotrf_nt_l_8x8_vs_lib8(int kp, float *Ap, float *Bp, int km_, float *Am, float *Bm, float *C, float *D, float *inv_diag_D, int km, int kn); +void kernel_ssyrk_spotrf_nt_l_8x8_lib8(int kp, float *Ap, float *Bp, int km_, float *Am, float *Bm, float *C, float *D, float *inv_diag_D); + +// 8x4 +void kernel_sgemm_nt_8x4_lib8(int k, float *alpha, float *A, float *B, float *beta, float *C, float *D); +void kernel_sgemm_nt_8x4_vs_lib8(int k, float *alpha, float *A, float *B, float *beta, float *C, float *D, int km, int kn); +void kernel_sgemm_nt_8x4_gen_lib8(int k, float *alpha, float *A, float *B, float *beta, int offsetC, float *C, int sdc, int offsetD, float *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_sgemm_nn_8x4_lib8(int k, float *alpha, float *A, int offsetB, float *B, int sdb, float *beta, float *C, float *D); +void kernel_sgemm_nn_8x4_vs_lib8(int k, float *alpha, float *A, int offsetB, float *B, int sdb, float *beta, float *C, float *D, int km, int kn); +void kernel_sgemm_nn_8x4_gen_lib8(int k, float *alpha, float *A, int offsetB, float *B, int sdb, float *beta, int offsetC, float *C, int sdc, int offsetD, float *D, int sdd, int m0, int m1, int n0, int n1); +//void kernel_ssyrk_nt_l_8x4_lib8(int k, float *alpha, float *A, float *B, float *beta, float *C, float *D); +void kernel_ssyrk_nt_l_8x4_vs_lib8(int k, float *alpha, float *A, float *B, float *beta, float *C, float *D, int km, int kn); +void kernel_spotrf_nt_l_8x4_lib8(int k, float *A, float *B, float *C, float *D, float *inv_diag_D); +void kernel_spotrf_nt_l_8x4_vs_lib8(int k, float *A, float *B, float *C, float *D, float *inv_diag_D, int km, int kn); +void kernel_strsm_nt_rl_inv_8x4_lib8(int k, float *A, float *B, float *C, float *D, float *E, float *inv_diag_E); +void kernel_strsm_nt_rl_inv_8x4_vs_lib8(int k, float *A, float *B, float *C, float *D, float *E, float *inv_diag_E, int km, int kn); +void kernel_sgemm_strsm_nt_rl_inv_8x4_lib8(int kp, float *Ap, float *Bp, int km_, float *Am, float *Bm, float *C, float *D, float *E, float *inv_diag_E); +void kernel_sgemm_strsm_nt_rl_inv_8x4_vs_lib8(int kp, float *Ap, float *Bp, int km_, float *Am, float *Bm, float *C, float *D, float *E, float *inv_diag_E, int km, int kn); +void kernel_ssyrk_spotrf_nt_l_8x4_vs_lib8(int kp, float *Ap, float *Bp, int km_, float *Am, float *Bm, float *C, float *D, float *inv_diag_D, int km, int kn); +void kernel_ssyrk_spotrf_nt_l_8x4_lib8(int kp, float *Ap, float *Bp, int km_, float *Am, float *Bm, float *C, float *D, float *inv_diag_D); +void kernel_strmm_nn_rl_8x4_lib8(int k, float *alpha, float *A, int offsetB, float *B, int sdb, float *D); +void kernel_strmm_nn_rl_8x4_vs_lib8(int k, float *alpha, float *A, int offsetB, float *B, int sdb, float *D, int km, int kn); +void kernel_strmm_nn_rl_8x4_gen_lib8(int k, float *alpha, float *A, int offsetB, float *B, int sdb, int offsetD, float *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_strmm_nt_ru_8x4_lib8(int k, float *alpha, float *A, float *B, float *D); +void kernel_strmm_nt_ru_8x4_vs_lib8(int k, float *alpha, float *A, float *B, float *D, int km, int kn); + +// 4x8 +void kernel_sgemm_nt_4x8_lib8(int k, float *alpha, float *A, float *B, float *beta, float *C, float *D); +void kernel_sgemm_nt_4x8_vs_lib8(int k, float *alpha, float *A, float *B, float *beta, float *C, float *D, int km, int kn); +void kernel_sgemm_nt_4x8_gen_lib8(int k, float *alpha, float *A, float *B, float *beta, int offsetC, float *C, int sdc, int offsetD, float *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_strsm_nt_rl_inv_4x8_lib8(int k, float *A, float *B, float *C, float *D, float *E, float *inv_diag_E); +void kernel_strsm_nt_rl_inv_4x8_vs_lib8(int k, float *A, float *B, float *C, float *D, float *E, float *inv_diag_E, int km, int kn); + +// 8 +void kernel_sgemv_n_8_lib8(int k, float *alpha, float *A, float *x, float *beta, float *y, float *z); +void kernel_sgemv_n_8_vs_lib8(int k, float *alpha, float *A, float *x, float *beta, float *y, float *z, int k1); +void kernel_sgemv_n_8_gen_lib8(int kmax, float *alpha, float *A, float *x, float *beta, float *y, float *z, int k0, int k1); +void kernel_sgemv_t_8_lib8(int k, float *alpha, int offsetA, float *A, int sda, float *x, float *beta, float *y, float *z); +void kernel_sgemv_t_8_vs_lib8(int k, float *alpha, int offsetA, float *A, int sda, float *x, float *beta, float *y, float *z, int k1); +void kernel_sgemv_t_4_lib8(int k, float *alpha, int offsetA, float *A, int sda, float *x, float *beta, float *y, float *z); +void kernel_sgemv_t_4_vs_lib8(int k, float *alpha, int offsetA, float *A, int sda, float *x, float *beta, float *y, float *z, int k1); +void kernel_strsv_ln_inv_8_lib8(int k, float *A, float *inv_diag_A, float *x, float *y, float *z); +void kernel_strsv_ln_inv_8_vs_lib8(int k, float *A, float *inv_diag_A, float *x, float *y, float *z, int km, int kn); +void kernel_strsv_lt_inv_8_lib8(int k, float *A, int sda, float *inv_diag_A, float *x, float *y, float *z); +void kernel_strsv_lt_inv_8_vs_lib8(int k, float *A, int sda, float *inv_diag_A, float *x, float *y, float *z, int km, int kn); +void kernel_sgemv_nt_4_lib8(int kmax, float *alpha_n, float *alpha_t, float *A, int sda, float *x_n, float *x_t, float *beta_t, float *y_t, float *z_n, float *z_t); +void kernel_sgemv_nt_4_vs_lib8(int kmax, float *alpha_n, float *alpha_t, float *A, int sda, float *x_n, float *x_t, float *beta_t, float *y_t, float *z_n, float *z_t, int km); +void kernel_ssymv_l_4l_lib8(int kmax, float *alpha, float *A, int sda, float *x, float *z); +void kernel_ssymv_l_4r_lib8(int kmax, float *alpha, float *A, int sda, float *x, float *z); +void kernel_ssymv_l_4l_gen_lib8(int kmax, float *alpha, int offA, float *A, int sda, float *x, float *z, int km); +void kernel_ssymv_l_4r_gen_lib8(int kmax, float *alpha, int offA, float *A, int sda, float *x, float *z, int km); + +// -------- aux + +// ---- copy + +// lib4 +// +void kernel_sgecpsc_4_0_lib4(int kmax, float *alpha, float *A, float *B); +void kernel_sgecp_4_0_lib4(int kmax, float *A, float *B); + +void kernel_sgecpsc_4_1_lib4(int kmax, float *alpha, float *A0, int sda, float *B); +void kernel_sgecp_4_1_lib4(int kmax, float *A0, int sda, float *B); +void kernel_sgecpsc_4_2_lib4(int kmax, float *alpha, float *A0, int sda, float *B); +void kernel_sgecp_4_2_lib4(int kmax, float *A0, int sda, float *B); +void kernel_sgecpsc_4_3_lib4(int kmax, float *alpha, float *A0, int sda, float *B); +void kernel_sgecp_4_3_lib4(int kmax, float *A0, int sda, float *B); + +void kernel_sgecpsc_3_0_lib4(int kmax, float *alpha, float *A, float *B); +void kernel_sgecp_3_0_lib4(int kmax, float *A, float *B); +void kernel_sgecpsc_3_2_lib4(int kmax, float *alpha, float *A0, int sda, float *B); +void kernel_sgecp_3_2_lib4(int kmax, float *A0, int sda, float *B); +void kernel_sgecpsc_3_3_lib4(int kmax, float *alpha, float *A0, int sda, float *B); +void kernel_sgecp_3_3_lib4(int kmax, float *A0, int sda, float *B); + +void kernel_sgecpsc_2_0_lib4(int kmax, float *alpha, float *A, float *B); +void kernel_sgecp_2_0_lib4(int kmax, float *A, float *B); +void kernel_sgecpsc_2_3_lib4(int kmax, float *alpha, float *A0, int sda, float *B); +void kernel_sgecp_2_3_lib4(int kmax, float *A0, int sda, float *B); + +void kernel_sgecpsc_1_0_lib4(int kmax, float *alpha, float *A, float *B); +void kernel_sgecp_1_0_lib4(int kmax, float *A, float *B); + +// lib8 +// +void kernel_sgecp_8_0_lib8(int m, float *A, float *B); +void kernel_sgecp_8_0_gen_lib8(int m, float *A, float *B, int m1); +void kernel_sgecp_8_0_gen_u_lib8(int m, float *A, float *B, int m1); + +void kernel_sgesc_8_0_lib8(int m, float *alpha, float *A); +void kernel_sgesc_8_0_gen_lib8(int m, float *alpha, float *A, int m1); +void kernel_sgesc_8_0_gen_u_lib8(int m, float *alpha, float *A, int m1); + +void kernel_sgecpsc_8_0_lib8(int m, float *alpha, float *A, float *B); +void kernel_sgecpsc_8_0_gen_lib8(int m, float *alpha, float *A, float *B, int m1); +void kernel_sgecpsc_8_0_gen_u_lib8(int m, float *alpha, float *A, float *B, int m1); + +void kernel_sgecp_8_1_lib8(int m, float *A, int sda, float *B); +void kernel_sgecp_8_1_gen_lib8(int m, float *A, int sda, float *B, int m1); +void kernel_sgecpsc_8_1_lib8(int m, float *alpha, float *A, int sda, float *B); +void kernel_sgecpsc_8_1_gen_lib8(int m, float *alpha, float *A, int sda, float *B, int m1); + +void kernel_sgecp_8_2_lib8(int m, float *A, int sda, float *B); +void kernel_sgecp_8_2_gen_lib8(int m, float *A, int sda, float *B, int m1); +void kernel_sgecpsc_8_2_lib8(int m, float *alpha, float *A, int sda, float *B); +void kernel_sgecpsc_8_2_gen_lib8(int m, float *alpha, float *A, int sda, float *B, int m1); + +void kernel_sgecp_8_3_lib8(int m, float *A, int sda, float *B); +void kernel_sgecp_8_3_gen_lib8(int m, float *A, int sda, float *B, int m1); +void kernel_sgecpsc_8_3_lib8(int m, float *alpha, float *A, int sda, float *B); +void kernel_sgecpsc_8_3_gen_lib8(int m, float *alpha, float *A, int sda, float *B, int m1); + +void kernel_sgecp_8_4_lib8(int m, float *A, int sda, float *B); +void kernel_sgecp_8_4_gen_lib8(int m, float *A, int sda, float *B, int m1); +void kernel_sgecpsc_8_4_lib8(int m, float *alpha, float *A, int sda, float *B); +void kernel_sgecpsc_8_4_gen_lib8(int m, float *alpha, float *A, int sda, float *B, int m1); + +void kernel_sgecp_8_5_lib8(int m, float *A, int sda, float *B); +void kernel_sgecp_8_5_gen_lib8(int m, float *A, int sda, float *B, int m1); +void kernel_sgecpsc_8_5_lib8(int m, float *alpha, float *A, int sda, float *B); +void kernel_sgecpsc_8_5_gen_lib8(int m, float *alpha, float *A, int sda, float *B, int m1); + +void kernel_sgecp_8_6_lib8(int m, float *A, int sda, float *B); +void kernel_sgecp_8_6_gen_lib8(int m, float *A, int sda, float *B, int m1); +void kernel_sgecpsc_8_6_lib8(int m, float *alpha, float *A, int sda, float *B); +void kernel_sgecpsc_8_6_gen_lib8(int m, float *alpha, float *A, int sda, float *B, int m1); + +void kernel_sgecp_8_7_lib8(int m, float *A, int sda, float *B); +void kernel_sgecp_8_7_gen_lib8(int m, float *A, int sda, float *B, int m1); +void kernel_sgecpsc_8_7_lib8(int m, float *alpha, float *A, int sda, float *B); +void kernel_sgecpsc_8_7_gen_lib8(int m, float *alpha, float *A, int sda, float *B, int m1); + +// transpose +// +void kernel_sgetr_8_0_lib8(int m, float *A, int sda, float *B); +void kernel_sgetr_8_0_gen_lib8(int m, float *A, int sda, float *B, int m1); +void kernel_sgetr_8_1_lib8(int m, float *A, int sda, float *B); +void kernel_sgetr_8_1_gen_lib8(int m, float *A, int sda, float *B, int m1); +void kernel_sgetr_8_2_lib8(int m, float *A, int sda, float *B); +void kernel_sgetr_8_2_gen_lib8(int m, float *A, int sda, float *B, int m1); +void kernel_sgetr_8_3_lib8(int m, float *A, int sda, float *B); +void kernel_sgetr_8_3_gen_lib8(int m, float *A, int sda, float *B, int m1); +void kernel_sgetr_8_4_lib8(int m, float *A, int sda, float *B); +void kernel_sgetr_8_4_gen_lib8(int m, float *A, int sda, float *B, int m1); +void kernel_sgetr_8_5_lib8(int m, float *A, int sda, float *B); +void kernel_sgetr_8_5_gen_lib8(int m, float *A, int sda, float *B, int m1); +void kernel_sgetr_8_6_lib8(int m, float *A, int sda, float *B); +void kernel_sgetr_8_6_gen_lib8(int m, float *A, int sda, float *B, int m1); +void kernel_sgetr_8_7_lib8(int m, float *A, int sda, float *B); +void kernel_sgetr_8_7_gen_lib8(int m, float *A, int sda, float *B, int m1); + +// add +// +void kernel_sgead_8_0_lib8(int m, float *alpha, float *A, float *B); +void kernel_sgead_8_0_gen_lib8(int m, float *alpha, float *A, float *B, int m1); +void kernel_sgead_8_1_lib8(int m, float *alpha, float *A, int sda, float *B); +void kernel_sgead_8_1_gen_lib8(int m, float *alpha, float *A, int sda, float *B, int m1); +void kernel_sgead_8_2_lib8(int m, float *alpha, float *A, int sda, float *B); +void kernel_sgead_8_2_gen_lib8(int m, float *alpha, float *A, int sda, float *B, int m1); +void kernel_sgead_8_3_lib8(int m, float *alpha, float *A, int sda, float *B); +void kernel_sgead_8_3_gen_lib8(int m, float *alpha, float *A, int sda, float *B, int m1); +void kernel_sgead_8_4_lib8(int m, float *alpha, float *A, int sda, float *B); +void kernel_sgead_8_4_gen_lib8(int m, float *alpha, float *A, int sda, float *B, int m1); +void kernel_sgead_8_5_lib8(int m, float *alpha, float *A, int sda, float *B); +void kernel_sgead_8_5_gen_lib8(int m, float *alpha, float *A, int sda, float *B, int m1); +void kernel_sgead_8_6_lib8(int m, float *alpha, float *A, int sda, float *B); +void kernel_sgead_8_6_gen_lib8(int m, float *alpha, float *A, int sda, float *B, int m1); +void kernel_sgead_8_7_lib8(int m, float *alpha, float *A, int sda, float *B); +void kernel_sgead_8_7_gen_lib8(int m, float *alpha, float *A, int sda, float *B, int m1); + + +// +// lib4 +// + + + +// level 2 BLAS +// 4 +void kernel_sgemv_n_4_lib4(int k, float *alpha, float *A, float *x, float *beta, float *y, float *z); +void kernel_sgemv_n_4_vs_lib4(int k, float *alpha, float *A, float *x, float *beta, float *y, float *z, int k1); +void kernel_sgemv_n_4_gen_lib4(int kmax, float *alpha, float *A, float *x, float *beta, float *y, float *z, int k0, int k1); +void kernel_sgemv_t_4_lib4(int k, float *alpha, int offsetA, float *A, int sda, float *x, float *beta, float *y, float *z); +void kernel_sgemv_t_4_vs_lib4(int k, float *alpha, int offsetA, float *A, int sda, float *x, float *beta, float *y, float *z, int k1); +void kernel_strsv_ln_inv_4_lib4(int k, float *A, float *inv_diag_A, float *x, float *y, float *z); +void kernel_strsv_ln_inv_4_vs_lib4(int k, float *A, float *inv_diag_A, float *x, float *y, float *z, int km, int kn); +void kernel_strsv_lt_inv_4_lib4(int k, float *A, int sda, float *inv_diag_A, float *x, float *y, float *z); +void kernel_strsv_lt_inv_3_lib4(int k, float *A, int sda, float *inv_diag_A, float *x, float *y, float *z); +void kernel_strsv_lt_inv_2_lib4(int k, float *A, int sda, float *inv_diag_A, float *x, float *y, float *z); +void kernel_strsv_lt_inv_1_lib4(int k, float *A, int sda, float *inv_diag_A, float *x, float *y, float *z); +void kernel_strmv_un_4_lib4(int k, float *A, float *x, float *z); +void kernel_strmv_ut_4_lib4(int k, float *A, int sda, float *x, float *z); +void kernel_strmv_ut_4_vs_lib4(int k, float *A, int sda, float *x, float *z, int km); +void kernel_sgemv_nt_6_lib4(int kmax, float *alpha_n, float *alpha_t, float *A, int sda, float *x_n, float *x_t, float *beta_t, float *y_t, float *z_n, float *z_t); +void kernel_sgemv_nt_4_lib4(int kmax, float *alpha_n, float *alpha_t, float *A, int sda, float *x_n, float *x_t, float *beta_t, float *y_t, float *z_n, float *z_t); +void kernel_sgemv_nt_4_vs_lib4(int kmax, float *alpha_n, float *alpha_t, float *A, int sda, float *x_n, float *x_t, float *beta_t, float *y_t, float *z_n, float *z_t, int km); +void kernel_ssymv_l_4_lib4(int kmax, float *alpha, float *A, int sda, float *x_n, float *z_n); +void kernel_ssymv_l_4_gen_lib4(int kmax, float *alpha, int offA, float *A, int sda, float *x_n, float *z_n, int km); + + + +// level 3 BLAS +// 12x4 +void kernel_sgemm_nt_16x4_lib4(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd); // +void kernel_sgemm_nt_16x4_vs_lib4(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, int m1, int n1); // +void kernel_strsm_nt_rl_inv_16x4_lib4(int k, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, float *E, float *inv_diag_E); +void kernel_strsm_nt_rl_inv_16x4_vs_lib4(int k, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, float *E, float *inv_diag_E, int m1, int n1); +// 12x4 +void kernel_sgemm_nt_12x4_lib4(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd); // +void kernel_sgemm_nt_12x4_vs_lib4(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, int m1, int n1); // +void kernel_strsm_nt_rl_inv_12x4_lib4(int k, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, float *E, float *inv_diag_E); +void kernel_strsm_nt_rl_inv_12x4_vs_lib4(int k, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, float *E, float *inv_diag_E, int m1, int n1); +// 8x8 +void kernel_sgemm_nt_8x8_lib4(int k, float *alpha, float *A, int sda, float *B, int sdb, float *beta, float *C, int sdc, float *D, int sdd); // +void kernel_sgemm_nt_8x8_vs_lib4(int k, float *alpha, float *A, int sda, float *B, int sdb, float *beta, float *C, int sdc, float *D, int sdd, int m1, int n1); // +void kernel_sgemm_nn_8x8_lib4(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, float *beta, float *C, int sdc, float *D, int sdd); // +void kernel_sgemm_nn_8x8_vs_lib4(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, float *beta, float *C, int sdc, float *D, int sdd, int m1, int n1); // +// 8x4 +void kernel_sgemm_nt_8x4_lib4(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd); // +void kernel_sgemm_nt_8x4_vs_lib4(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, int m1, int n1); // +void kernel_sgemm_nn_8x4_lib4(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, float *beta, float *C, int sdc, float *D, int sdd); // +void kernel_sgemm_nn_8x4_vs_lib4(int k, float *alpha, float *A, int sda, int offsetB, float *B, int sdb, float *beta, float *C, int sdc, float *D, int sdd, int m1, int n1); // +void kernel_ssyrk_nt_l_8x4_lib4(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd); // +void kernel_ssyrk_nt_l_8x4_vs_lib4(int k, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, int km, int kn); // +void kernel_strsm_nt_rl_inv_8x4_lib4(int k, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, float *E, float *inv_diag_E); +void kernel_strsm_nt_rl_inv_8x4_vs_lib4(int k, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd, float *E, float *inv_diag_E, int m1, int n1); +// 4x4 +void kernel_sgemm_nt_4x4_lib4(int k, float *alpha, float *A, float *B, float *beta, float *C, float *D); // +void kernel_sgemm_nt_4x4_vs_lib4(int k, float *alpha, float *A, float *B, float *beta, float *C, float *D, int km, int kn); // +void kernel_sgemm_nt_4x4_gen_lib4(int k, float *alpha, float *A, float *B, float *beta, int offsetC, float *C, int sdc, int offsetD, float *D, int sdd, int m0, int m1, int k0, int k1); +void kernel_sgemm_nn_4x4_lib4(int k, float *alpha, float *A, int offsetB, float *B, int sdb, float *beta, float *C, float *D); // +void kernel_sgemm_nn_4x4_vs_lib4(int k, float *alpha, float *A, int offsetB, float *B, int sdb, float *beta, float *C, float *D, int km, int kn); // +void kernel_sgemm_nn_4x4_gen_lib4(int k, float *alpha, float *A, int offsetB, float *B, int sdb, float *beta, int offsetC, float *C, int sdc, int offsetD, float *D, int sdd, int m0, int m1, int n0, int n1); // +void kernel_ssyrk_nt_l_4x4_lib4(int k, float *alpha, float *A, float *B, float *beta, float *C, float *D); // +void kernel_ssyrk_nt_l_4x4_vs_lib4(int k, float *alpha, float *A, float *B, float *beta, float *C, float *D, int km, int kn); // +void kernel_ssyrk_nt_l_4x4_gen_lib4(int k, float *alpha, float *A, float *B, float *beta, int offsetC, float *C, int sdc, int offsetD, float *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_strmm_nt_ru_4x4_lib4(int k, float *alpha, float *A, float *B, float *D); // +void kernel_strmm_nt_ru_4x4_vs_lib4(int k, float *alpha, float *A, float *B, float *D, int km, int kn); // +void kernel_strmm_nn_rl_4x4_lib4(int k, float *alpha, float *A, int offsetB, float *B, int sdb, float *D); +void kernel_strmm_nn_rl_4x4_gen_lib4(int k, float *alpha, float *A, int offsetB, float *B, int sdb, int offsetD, float *D, int sdd, int m0, int m1, int n0, int n1); +void kernel_strsm_nt_rl_inv_4x4_lib4(int k, float *A, float *B, float *beta, float *C, float *D, float *E, float *inv_diag_E); +void kernel_strsm_nt_rl_inv_4x4_vs_lib4(int k, float *A, float *B, float *beta, float *C, float *D, float *E, float *inv_diag_E, int km, int kn); +void kernel_strsm_nt_rl_one_4x4_lib4(int k, float *A, float *B, float *beta, float *C, float *D, float *E); +void kernel_strsm_nt_rl_one_4x4_vs_lib4(int k, float *A, float *B, float *beta, float *C, float *D, float *E, int km, int kn); +void kernel_strsm_nt_ru_inv_4x4_lib4(int k, float *A, float *B, float *beta, float *C, float *D, float *E, float *inv_diag_E); +void kernel_strsm_nt_ru_inv_4x4_vs_lib4(int k, float *A, float *B, float *beta, float *C, float *D, float *E, float *inv_diag_E, int km, int kn); +void kernel_strsm_nt_ru_one_4x4_lib4(int k, float *A, float *B, float *beta, float *C, float *D, float *E); +void kernel_strsm_nt_ru_one_4x4_vs_lib4(int k, float *A, float *B, float *beta, float *C, float *D, float *E, int km, int kn); +void kernel_strsm_nn_ru_inv_4x4_lib4(int k, float *A, float *B, int sdb, float *beta, float *C, float *D, float *E, float *inv_diag_E); +void kernel_strsm_nn_ru_inv_4x4_vs_lib4(int k, float *A, float *B, int sdb, float *beta, float *C, float *D, float *E, float *inv_diag_E, int km, int kn); +void kernel_strsm_nn_ll_one_4x4_lib4(int k, float *A, float *B, int sdb, float *C, float *D, float *E); +void kernel_strsm_nn_ll_one_4x4_vs_lib4(int k, float *A, float *B, int sdb, float *C, float *D, float *E, int km, int kn); +void kernel_strsm_nn_lu_inv_4x4_lib4(int kmax, float *A, float *B, int sdb, float *C, float *D, float *E, float *inv_diag_E); +void kernel_strsm_nn_lu_inv_4x4_vs_lib4(int kmax, float *A, float *B, int sdb, float *C, float *D, float *E, float *inv_diag_E, int km, int kn); +// diag +void kernel_sgemm_diag_right_4_a0_lib4(int kmax, float *alpha, float *A, int sda, float *B, float *D, int sdd); +void kernel_sgemm_diag_right_4_lib4(int kmax, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd); +void kernel_sgemm_diag_right_3_lib4(int kmax, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd); +void kernel_sgemm_diag_right_2_lib4(int kmax, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd); +void kernel_sgemm_diag_right_1_lib4(int kmax, float *alpha, float *A, int sda, float *B, float *beta, float *C, int sdc, float *D, int sdd); +void kernel_sgemm_diag_left_4_a0_lib4(int kmax, float *alpha, float *A, float *B, float *D); +void kernel_sgemm_diag_left_4_lib4(int kmax, float *alpha, float *A, float *B, float *beta, float *C, float *D); +void kernel_sgemm_diag_left_3_lib4(int kmax, float *alpha, float *A, float *B, float *beta, float *C, float *D); +void kernel_sgemm_diag_left_2_lib4(int kmax, float *alpha, float *A, float *B, float *beta, float *C, float *D); +void kernel_sgemm_diag_left_1_lib4(int kmax, float *alpha, float *A, float *B, float *beta, float *C, float *D); + + + +// LAPACK +// 16x4 +void kernel_spotrf_nt_l_16x4_lib4(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *inv_diag_D); +void kernel_spotrf_nt_l_16x4_vs_lib4(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *inv_diag_D, int m1, int n1); +// 12x4 +void kernel_spotrf_nt_l_12x4_lib4(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *inv_diag_D); +void kernel_spotrf_nt_l_12x4_vs_lib4(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *inv_diag_D, int m1, int n1); +// 8x4 +void kernel_spotrf_nt_l_8x4_lib4(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *inv_diag_D); +void kernel_spotrf_nt_l_8x4_vs_lib4(int k, float *A, int sda, float *B, float *C, int sdc, float *D, int sdd, float *inv_diag_D, int m1, int n1); +// 4x4 +void kernel_spotrf_nt_l_4x4_lib4(int k, float *A, float *B, float *C, float *D, float *inv_diag_D); +void kernel_spotrf_nt_l_4x4_vs_lib4(int k, float *A, float *B, float *C, float *D, float *inv_diag_D, int km, int kn); +void kernel_sgetrf_nn_4x4_lib4(int k, float *A, float *B, int sdb, float *C, float *D, float *inv_diag_D); +void kernel_sgetrf_nn_4x4_vs_lib4(int k, float *A, float *B, int sdb, float *C, float *D, float *inv_diag_D, int km, int kn); +void kernel_sgetrf_pivot_4_lib4(int m, float *pA, int sda, float *inv_diag_A, int* ipiv); +void kernel_sgetrf_pivot_4_vs_lib4(int m, int n, float *pA, int sda, float *inv_diag_A, int* ipiv); + + + +// merged routines +// 4x4 +void kernel_sgemm_strsm_nt_rl_inv_4x4_lib4(int kp, float *Ap, float *Bp, int km_, float *Am, float *Bm, float *C, float *D, float *E, float *inv_diag_E); +void kernel_sgemm_strsm_nt_rl_inv_4x4_vs_lib4(int kp, float *Ap, float *Bp, int km_, float *Am, float *Bm, float *C, float *D, float *E, float *inv_diag_E, int km, int kn); +void kernel_ssyrk_spotrf_nt_l_4x4_vs_lib4(int kp, float *Ap, float *Bp, int km_, float *Am, float *Bm, float *C, float *D, float *inv_diag_D, int km, int kn); +void kernel_ssyrk_spotrf_nt_l_4x4_lib4(int kp, float *Ap, float *Bp, int km_, float *Am, float *Bm, float *C, float *D, float *inv_diag_D); + + + +// auxiliary routines +void kernel_strcp_l_4_0_lib4(int kmax, float *A, float *B); +void kernel_strcp_l_4_1_lib4(int kmax, float *A0, int sda, float *B); +void kernel_strcp_l_4_2_lib4(int kmax, float *A0, int sda, float *B); +void kernel_strcp_l_4_3_lib4(int kmax, float *A0, int sda, float *B); +void kernel_strcp_l_3_0_lib4(int kmax, float *A, float *B); +void kernel_strcp_l_3_2_lib4(int kmax, float *A0, int sda, float *B); +void kernel_strcp_l_3_3_lib4(int kmax, float *A0, int sda, float *B); +void kernel_strcp_l_2_0_lib4(int kmax, float *A, float *B); +void kernel_strcp_l_2_3_lib4(int kmax, float *A0, int sda, float *B); +void kernel_strcp_l_1_0_lib4(int kmax, float *A, float *B); +void kernel_sgead_4_0_lib4(int kmax, float *alpha, float *A, float *B); +void kernel_sgead_4_1_lib4(int kmax, float *alpha, float *A0, int sda, float *B); +void kernel_sgead_4_2_lib4(int kmax, float *alpha, float *A0, int sda, float *B); +void kernel_sgead_4_3_lib4(int kmax, float *alpha, float *A0, int sda, float *B); +void kernel_sgead_3_0_lib4(int kmax, float *alpha, float *A, float *B); +void kernel_sgead_3_2_lib4(int kmax, float *alpha, float *A0, int sda, float *B); +void kernel_sgead_3_3_lib4(int kmax, float *alpha, float *A0, int sda, float *B); +void kernel_sgead_2_0_lib4(int kmax, float *alpha, float *A, float *B); +void kernel_sgead_2_3_lib4(int kmax, float *alpha, float *A0, int sda, float *B); +void kernel_sgead_1_0_lib4(int kmax, float *alpha, float *A, float *B); +// TODO +void kernel_sgeset_4_lib4(int kmax, float alpha, float *A); +void kernel_strset_4_lib4(int kmax, float alpha, float *A); +void kernel_sgetr_4_lib4(int tri, int kmax, int kna, float alpha, float *A, float *C, int sdc); +void kernel_sgetr_3_lib4(int tri, int kmax, int kna, float alpha, float *A, float *C, int sdc); +void kernel_sgetr_2_lib4(int tri, int kmax, int kna, float alpha, float *A, float *C, int sdc); +void kernel_sgetr_1_lib4(int tri, int kmax, int kna, float alpha, float *A, float *C, int sdc); + + + +// pack +// 24 lib 8 +void kernel_spack_nn_24_lib8(int kmax, float *A, int lda, float *B, int sdb); +void kernel_spack_nn_24_vs_lib8(int kmax, float *A, int lda, float *B, int sdb, int m1); +// 16 lib 8 +void kernel_spack_nn_16_lib8(int kmax, float *A, int lda, float *B, int sdb); +void kernel_spack_nn_16_vs_lib8(int kmax, float *A, int lda, float *B, int sdb, int m1); +// 8 lib 8 +void kernel_spack_nn_8_lib8(int kmax, float *A, int lda, float *B); +void kernel_spack_nn_8_vs_lib8(int kmax, float *A, int lda, float *B, int m1); +void kernel_spack_tn_8_lib8(int kmax, float *A, int lda, float *B); +void kernel_spack_tn_8_vs_lib8(int kmax, float *A, int lda, float *B, int m1); +void kernel_spack_tt_8_lib8(int kmax, float *A, int lda, float *B, int sdb); +void kernel_spack_tt_8_vs_lib8(int kmax, float *A, int lda, float *B, int sdb, int m1); +// 8 lib 4 +void kernel_spack_nn_8_lib4(int kmax, float *A, int lda, float *B, int sdb); +void kernel_spack_nn_8_vs_lib4(int kmax, float *A, int lda, float *B, int sdb, int m1); +//void kernel_spack_tt_8_lib4(int kmax, float *A, int lda, float *B, int sdb); +// 4 +void kernel_spack_nn_4_lib4(int kmax, float *A, int lda, float *B); +void kernel_spack_nn_4_vs_lib4(int kmax, float *A, int lda, float *B, int m1); +void kernel_spack_tn_4_lib4(int kmax, float *A, int lda, float *B); +void kernel_spack_tn_4_vs_lib4(int kmax, float *A, int lda, float *B, int m1); +void kernel_spack_tt_4_lib4(int kmax, float *A, int lda, float *B, int sdb); +void kernel_spack_tt_4_vs_lib4(int kmax, float *A, int lda, float *B, int sdb, int m1); +// unpack +// 8 +void kernel_sunpack_nn_8_lib4(int kmax, float *A, int sda, float *B, int ldb); +void kernel_sunpack_nn_8_vs_lib4(int kmax, float *A, int sda, float *B, int ldb, int m1); +//void kernel_sunpack_tt_8_lib4(int kmax, float *A, int sda, float *B, int ldb); +// 4 +void kernel_sunpack_nn_4_lib4(int kmax, float *A, float *B, int ldb); +void kernel_sunpack_nn_4_vs_lib4(int kmax, float *A, float *B, int ldb, int m1); +void kernel_sunpack_nt_4_lib4(int kmax, float *A, float *B, int ldb); +void kernel_sunpack_nt_4_vs_lib4(int kmax, float *A, float *B, int ldb, int m1); +void kernel_sunpack_tt_4_lib4(int kmax, float *A, int sda, float *B, int ldb); + +// panel copy +// 4 +void kernel_spacp_nt_4_lib4(int kmax, float *A, int offsetB, float *B, int sdb); +void kernel_spacp_tn_4_lib4(int kmax, int offsetA, float *A, int sda, float *B); +void kernel_spacp_nn_4_lib4(int kmax, int offsetA, float *A, int sda, float *B); +void kernel_spacp_nn_4_vs_lib4(int kmax, int offsetA, float *A, int sda, float *B, int m1); + + + +/************************************************ +* BLAS API kernels +************************************************/ + +//#if defined(BLAS_API) + +// A, B panel-major bs=8; C, D column-major +// 24x4 +void kernel_sgemm_nt_24x4_lib88cc(int kmax, float *alpha, float *A, int sda, float *B, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_24x4_vs_lib88cc(int kmax, float *alpha, float *A, int sda, float *B, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +// 16x4 +void kernel_sgemm_nt_16x4_lib88cc(int kmax, float *alpha, float *A, int sda, float *B, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_16x4_vs_lib88cc(int kmax, float *alpha, float *A, int sda, float *B, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +// 8x8 +void kernel_sgemm_nt_8x8_lib88cc(int kmax, float *alpha, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_8x8_vs_lib88cc(int kmax, float *alpha, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_spotrf_nt_l_8x8_lib88cc(int kmax, float *A, float *B, float *C, int ldc, float *D, int ldd, float *dD); +void kernel_spotrf_nt_l_8x8_vs_lib88cc(int kmax, float *A, float *B, float *C, int ldc, float *D, int ldd, float *dD, int m1, int n1); +void kernel_strsm_nt_rl_inv_8x8_lib88ccc(int kmax, float *A, float *B, float *C, int ldc, float *D, int ldd, float *E, int lde, float *dE); +void kernel_strsm_nt_rl_inv_8x8_vs_lib88ccc(int kmax, float *A, float *B, float *C, int ldc, float *D, int ldd, float *E, int lde, float *dE, int m1, int n1); +// 8x4 +void kernel_sgemm_nt_8x4_lib88cc(int kmax, float *alpha, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_8x4_vs_lib88cc(int kmax, float *alpha, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); + +// A, B panel-major bs=4; C, D column-major +// 8x8 +void kernel_sgemm_nt_8x8_lib44cc(int kmax, float *alpha, float *A, int sda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd); +// 8x4 +void kernel_sgemm_nt_8x4_lib44cc(int kmax, float *alpha, float *A, int sda, float *B, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_8x4_vs_lib44cc(int kmax, float *alpha, float *A, int sda, float *B, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_spotrf_nt_l_8x4_lib44cc(int kmax, float *A, int sda, float *B, float *C, int ldc, float *D, int ldd, float *dD); +void kernel_strsm_nt_rl_inv_8x4_lib44ccc(int kmax, float *A, int sda, float *B, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, float *dE); +void kernel_strsm_nt_rl_inv_8x4_vs_lib44ccc(int kmax, float *A, int sda, float *B, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, float *dE, int m1, int n1); +// 4x4 +void kernel_sgemm_nt_4x4_lib44cc(int kmax, float *alpha, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_4x4_vs_lib44cc(int kmax, float *alpha, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_strsm_nt_rl_inv_4x4_lib44cc4(int kmax, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd, float *E, float *dE); +void kernel_strsm_nt_rl_inv_4x4_vs_lib44cc4(int kmax, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd, float *E, float *dE, int m1, int n1); +void kernel_strsm_nt_rl_inv_4x4_lib44ccc(int kmax, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, float *dE); +void kernel_strsm_nt_rl_inv_4x4_vs_lib44ccc(int kmax, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, float *dE, int m1, int n1); +void kernel_strsm_nt_rl_one_4x4_lib44cc4(int kmax, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd, float *E); +void kernel_strsm_nt_rl_one_4x4_vs_lib44cc4(int kmax, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd, float *E, int m1, int n1); +void kernel_strsm_nt_ru_inv_4x4_lib44cc4(int kmax, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd, float *E, float *dE); +void kernel_strsm_nt_ru_inv_4x4_vs_lib44cc4(int kmax, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd, float *E, float *dE, int m1, int n1); +void kernel_strsm_nt_ru_one_4x4_lib44cc4(int kmax, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd, float *E); +void kernel_strsm_nt_ru_one_4x4_vs_lib44cc4(int kmax, float *A, float *B, float *beta, float *C, int ldc, float *D, int ldd, float *E, int m1, int n1); +void kernel_spotrf_nt_l_4x4_lib44cc(int kmax, float *A, float *B, float *C, int ldc, float *D, int ldd, float *dD); +void kernel_spotrf_nt_l_4x4_vs_lib44cc(int kmax, float *A, float *B, float *C, int ldc, float *D, int ldd, float *dD, int m1, int n1); + +// B panel-major bs=8; A, C, D column-major +// 4x24 +void kernel_sgemm_nt_4x24_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_4x24_vs_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_tt_4x24_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_tt_4x24_vs_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +// 4x16 +void kernel_sgemm_nt_4x16_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_4x16_vs_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_tt_4x16_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_tt_4x16_vs_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +// 8x8 +void kernel_sgemm_nt_8x8_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_8x8_vs_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_tt_8x8_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_tt_8x8_vs_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +// 4x8 +void kernel_sgemm_nt_4x8_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_4x8_vs_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_tt_4x8_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_tt_4x8_vs_libc8cc(int kmax, float *alpha, float *A, int lda, float *B, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); + +// B panel-major bs=4; A, C, D column-major +// 8x8 +void kernel_sgemm_nt_8x8_libc4cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_8x8_vs_libc4cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_tt_8x8_libc4cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_tt_8x8_vs_libc4cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +// 4x8 +void kernel_sgemm_nt_4x8_libc4cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_4x8_vs_libc4cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_tt_4x8_libc4cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_tt_4x8_vs_libc4cc(int kmax, float *alpha, float *A, int lda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +// 4x4 +void kernel_sgemm_nt_4x4_libc4cc(int kmax, float *alpha, float *A, int lda, float *B, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_4x4_vs_libc4cc(int kmax, float *alpha, float *A, int lda, float *B, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_tt_4x4_libc4cc(int kmax, float *alpha, float *A, int lda, float *B, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_tt_4x4_vs_libc4cc(int kmax, float *alpha, float *A, int lda, float *B, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); + +// A panel-major bs=8; B, C, D column-major +// 24x4 +void kernel_sgemm_nn_24x4_lib8ccc(int kmax, float *alpha, float *A, int lda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nn_24x4_vs_lib8ccc(int kmax, float *alpha, float *A, int lda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_nt_24x4_lib8ccc(int kmax, float *alpha, float *A, int lda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_24x4_vs_lib8ccc(int kmax, float *alpha, float *A, int lda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +// 16x4 +void kernel_sgemm_nn_16x4_lib8ccc(int kmax, float *alpha, float *A, int lda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nn_16x4_vs_lib8ccc(int kmax, float *alpha, float *A, int lda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_nt_16x4_lib8ccc(int kmax, float *alpha, float *A, int lda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_16x4_vs_lib8ccc(int kmax, float *alpha, float *A, int lda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +// 8x8 +void kernel_sgemm_nn_8x8_lib8ccc(int kmax, float *alpha, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nn_8x8_vs_lib8ccc(int kmax, float *alpha, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_nt_8x8_lib8ccc(int kmax, float *alpha, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_8x8_vs_lib8ccc(int kmax, float *alpha, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +// 8x4 +void kernel_sgemm_nn_8x4_lib8ccc(int kmax, float *alpha, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nn_8x4_vs_lib8ccc(int kmax, float *alpha, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_nt_8x4_lib8ccc(int kmax, float *alpha, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_8x4_vs_lib8ccc(int kmax, float *alpha, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); + +// A panel-major bs=4; B, C, D column-major +// 8x8 +void kernel_sgemm_nn_8x8_lib4ccc(int kmax, float *alpha, float *A, int sda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_8x8_lib4ccc(int kmax, float *alpha, float *A, int sda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +// 8x4 +void kernel_sgemm_nn_8x4_lib4ccc(int kmax, float *alpha, float *A, int sda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nn_8x4_vs_lib4ccc(int kmax, float *alpha, float *A, int sda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_nt_8x4_lib4ccc(int kmax, float *alpha, float *A, int sda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_8x4_vs_lib4ccc(int kmax, float *alpha, float *A, int sda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +// 4x4 +void kernel_sgemm_nn_4x4_lib4ccc(int kmax, float *alpha, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nn_4x4_vs_lib4ccc(int kmax, float *alpha, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_nt_4x4_lib4ccc(int kmax, float *alpha, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_4x4_vs_lib4ccc(int kmax, float *alpha, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_strsm_nn_rl_inv_4x4_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, float *dE); +void kernel_strsm_nn_rl_inv_4x4_vs_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, float *dE, int m1, int n1); +void kernel_strsm_nn_rl_one_4x4_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde); +void kernel_strsm_nn_rl_one_4x4_vs_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, int m1, int n1); +void kernel_strsm_nt_rl_inv_4x4_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, float *dE); +void kernel_strsm_nt_rl_inv_4x4_vs_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, float *dE, int m1, int n1); +void kernel_strsm_nt_rl_one_4x4_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde); +void kernel_strsm_nt_rl_one_4x4_vs_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, int m1, int n1); +void kernel_strsm_nn_ru_inv_4x4_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, float *dE); +void kernel_strsm_nn_ru_inv_4x4_vs_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, float *dE, int m1, int n1); +void kernel_strsm_nn_ru_one_4x4_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde); +void kernel_strsm_nn_ru_one_4x4_vs_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, int m1, int n1); +void kernel_strsm_nt_ru_inv_4x4_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, float *dE); +void kernel_strsm_nt_ru_inv_4x4_vs_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, float *dE, int m1, int n1); +void kernel_strsm_nt_ru_one_4x4_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde); +void kernel_strsm_nt_ru_one_4x4_vs_lib4cccc(int kmax, float *A, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, float *E, int lde, int m1, int n1); + +// A, C, D panel-major; B, E column-major +// TODO merge with above +// 4x4 +void kernel_strsm_nn_rl_inv_4x4_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde, float *dE); +void kernel_strsm_nn_rl_inv_4x4_vs_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde, float *dE, int m1, int n1); +void kernel_strsm_nn_rl_one_4x4_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde); +void kernel_strsm_nn_rl_one_4x4_vs_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde, int m1, int n1); +void kernel_strsm_nn_ru_inv_4x4_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde, float *dE); +void kernel_strsm_nn_ru_inv_4x4_vs_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde, float *dE, int m1, int n1); +void kernel_strsm_nn_ru_one_4x4_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde); +void kernel_strsm_nn_ru_one_4x4_vs_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde, int m1, int n1); +void kernel_strsm_nt_rl_inv_4x4_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde, float *dE); +void kernel_strsm_nt_rl_inv_4x4_vs_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde, float *dE, int m1, int n1); +void kernel_strsm_nt_rl_one_4x4_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde); +void kernel_strsm_nt_rl_one_4x4_vs_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde, int m1, int n1); +void kernel_strsm_nt_ru_inv_4x4_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde, float *dE); +void kernel_strsm_nt_ru_inv_4x4_vs_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde, float *dE, int m1, int n1); +void kernel_strsm_nt_ru_one_4x4_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde); +void kernel_strsm_nt_ru_one_4x4_vs_lib4c44c(int kmax, float *A, float *B, int ldb, float *beta, float *C, float *D, float *E, int lde, int m1, int n1); + +// A, B, C, D column-major +void kernel_sgemm_nn_4x4_libcccc(int kmax, float *alpha, float *A, int lda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nn_4x4_vs_libcccc(int kmax, float *alpha, float *A, int lda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_nt_4x4_libcccc(int kmax, float *alpha, float *A, int lda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_nt_4x4_vs_libcccc(int kmax, float *alpha, float *A, int lda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); +void kernel_sgemm_tt_4x4_libcccc(int kmax, float *alpha, float *A, int lda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd); +void kernel_sgemm_tt_4x4_vs_libcccc(int kmax, float *alpha, float *A, int lda, float *B, int ldb, float *beta, float *C, int ldc, float *D, int ldd, int m1, int n1); + +// vector +void kernel_sdot_11_lib(int n, float *x, float *y, float *res); +void kernel_saxpy_11_lib(int n, float *alpha, float *x, float *y); + + +//#endif // BLAS_API + + + +// larger kernels +// 24 +void kernel_sgemm_nt_24xn_p0_lib88cc(int n, int k, float *alpha, float *A, int sda, float *B, int sdb, float *beta, float *C, int ldc, float *D, int ldd, float *A_p, float *B_p); + + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_S_KERNEL_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_stdlib.h b/third_party/acados/include/blasfeo/include/blasfeo_stdlib.h new file mode 100644 index 000000000..9bd248b1d --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_stdlib.h @@ -0,0 +1,62 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_STDLIB_H_ +#define BLASFEO_STDLIB_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + + +#include + +// +void blasfeo_malloc(void **ptr, size_t size); +// +void blasfeo_malloc_align(void **ptr, size_t size); +// +void blasfeo_free(void *ptr); +// +void blasfeo_free_align(void *ptr); + + + +#ifdef __cplusplus +} +#endif + +#endif // BLASFEO_STDLIB_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_target.h b/third_party/acados/include/blasfeo/include/blasfeo_target.h new file mode 100644 index 000000000..51f617a64 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_target.h @@ -0,0 +1,73 @@ +#ifndef TARGET_X64_INTEL_HASWELL +#define TARGET_X64_INTEL_HASWELL +#endif + +#ifndef TARGET_NEED_FEATURE_AVX2 +#define TARGET_NEED_FEATURE_AVX2 1 +#endif + +#ifndef TARGET_NEED_FEATURE_FMA +#define TARGET_NEED_FEATURE_FMA 1 +#endif + +#ifndef TARGET_NEED_FEATURE_SSE3 +/* #undef TARGET_NEED_FEATURE_SSE3 */ +#endif + +#ifndef TARGET_NEED_FEATURE_AVX +/* #undef TARGET_NEED_FEATURE_AVX */ +#endif + +#ifndef TARGET_NEED_FEATURE_VFPv3 +/* #undef TARGET_NEED_FEATURE_VFPv3 */ +#endif + +#ifndef TARGET_NEED_FEATURE_NEON +/* #undef TARGET_NEED_FEATURE_NEON */ +#endif + +#ifndef TARGET_NEED_FEATURE_VFPv4 +/* #undef TARGET_NEED_FEATURE_VFPv4 */ +#endif + +#ifndef TARGET_NEED_FEATURE_NEONv2 +/* #undef TARGET_NEED_FEATURE_NEONv2 */ +#endif + +#ifndef LA_HIGH_PERFORMANCE +#define LA_HIGH_PERFORMANCE +#endif + +#ifndef MF_PANELMAJ +#define MF_PANELMAJ +#endif + +#ifndef EXT_DEP +#define ON 1 +#define OFF 0 +#if ON==ON +#define EXT_DEP +#endif +#undef ON +#undef OFF +#endif + +#ifndef BLAS_API +#define ON 1 +#define OFF 0 +#if OFF==ON +#define BLAS_API +#endif +#undef ON +#undef OFF +#endif + +#ifndef FORTRAN_BLAS_API +#define ON 1 +#define OFF 0 +#if OFF==ON +#define FORTRAN_BLAS_API +#endif +#undef ON +#undef OFF +#endif diff --git a/third_party/acados/include/blasfeo/include/blasfeo_timing.h b/third_party/acados/include/blasfeo/include/blasfeo_timing.h new file mode 100644 index 000000000..5671b888f --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_timing.h @@ -0,0 +1,114 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_TIMING_H_ +#define BLASFEO_TIMING_H_ + +//#include + +#if (defined _WIN32 || defined _WIN64) && !(defined __MINGW32__ || defined __MINGW64__) + + /* Use Windows QueryPerformanceCounter for timing. */ + #include + + /** A structure for keeping internal timer data. */ + typedef struct blasfeo_timer_ { + LARGE_INTEGER tic; + LARGE_INTEGER toc; + LARGE_INTEGER freq; + } blasfeo_timer; + +#elif(defined __APPLE__) + + #include + + /** A structure for keeping internal timer data. */ + typedef struct blasfeo_timer_ { + uint64_t tic; + uint64_t toc; + mach_timebase_info_data_t tinfo; + } blasfeo_timer; + +#elif(defined __DSPACE__) + + #include + + typedef struct blasfeo_timer_ { + double time; + } blasfeo_timer; + +#elif(defined __XILINX_NONE_ELF__ || defined __XILINX_ULTRASCALE_NONE_ELF_JAILHOUSE__) + + #include "xtime_l.h" + + typedef struct blasfeo_timer_ { + uint64_t tic; + uint64_t toc; + } blasfeo_timer; + +#else + + /* Use POSIX clock_gettime() for timing on non-Windows machines. */ + #include + + #if __STDC_VERSION__ >= 199901L // C99 Mode + + #include + #include + + typedef struct blasfeo_timer_ { + struct timeval tic; + struct timeval toc; + } blasfeo_timer; + + #else // ANSI C Mode + + /** A structure for keeping internal timer data. */ + typedef struct blasfeo_timer_ { + struct timespec tic; + struct timespec toc; + } blasfeo_timer; + + #endif // __STDC_VERSION__ >= 199901L + +#endif // (defined _WIN32 || defined _WIN64) + +/** A function for measurement of the current time. */ +void blasfeo_tic(blasfeo_timer* t); + +/** A function which returns the elapsed time. */ +double blasfeo_toc(blasfeo_timer* t); + +#endif // BLASFEO_TIMING_H_ diff --git a/third_party/acados/include/blasfeo/include/blasfeo_v_aux_ext_dep.h b/third_party/acados/include/blasfeo/include/blasfeo_v_aux_ext_dep.h new file mode 100644 index 000000000..159855118 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/blasfeo_v_aux_ext_dep.h @@ -0,0 +1,83 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef BLASFEO_V_AUX_EXT_DEP_H_ +#define BLASFEO_V_AUX_EXT_DEP_H_ + + + +#include "blasfeo_target.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +/************************************************ +* d_aux_extern_depend_lib.c +************************************************/ + +#ifdef EXT_DEP + +void v_zeros(void **ptrA, int size); +// dynamically allocate size bytes of memory aligned to 64-byte boundaries and set accordingly a pointer to void; set allocated memory to zero +void v_zeros_align(void **ptrA, int size); +// free the memory allocated by v_zeros +void v_free(void *ptrA); +// free the memory allocated by v_zeros_aligned +void v_free_align(void *ptrA); +// dynamically allocate size bytes of memory and set accordingly a pointer to char; set allocated memory to zero +void c_zeros(char **ptrA, int size); +// dynamically allocate size bytes of memory aligned to 64-byte boundaries and set accordingly a pointer to char; set allocated memory to zero +void c_zeros_align(char **ptrA, int size); +// free the memory allocated by c_zeros +void c_free(char *ptrA); +// free the memory allocated by c_zeros_aligned +void c_free_align(char *ptrA); + +#endif // EXT_DEP + + + +#ifdef __cplusplus +} +#endif + + + +#endif // BLASFEO_V_AUX_EXT_DEP_H_ diff --git a/third_party/acados/include/blasfeo/include/d_blas.h b/third_party/acados/include/blasfeo/include/d_blas.h new file mode 100644 index 000000000..d6f878672 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/d_blas.h @@ -0,0 +1,77 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + + + +// headers to reference BLAS and LAPACK routines employed in BLASFEO WR + +// level 1 +double ddot_(int *m, double *x, int *incx, double *y, int *incy); +void dcopy_(int *m, double *x, int *incx, double *y, int *incy); +void daxpy_(int *m, double *alpha, double *x, int *incx, double *y, int *incy); +void dscal_(int *m, double *alpha, double *x, int *incx); +void drot_(int *m, double *x, int *incx, double *y, int *incy, double *c, double *s); +void drotg_(double *a, double *b, double *c, double *s); + +// level 2 +void dgemv_(char *ta, int *m, int *n, double *alpha, double *A, int *lda, double *x, int *incx, double *beta, double *y, int *incy); +void dsymv_(char *uplo, int *m, double *alpha, double *A, int *lda, double *x, int *incx, double *beta, double *y, int *incy); +void dtrmv_(char *uplo, char *trans, char *diag, int *n, double *A, int *lda, double *x, int *incx); +void dtrsv_(char *uplo, char *trans, char *diag, int *n, double *A, int *lda, double *x, int *incx); +void dger_(int *m, int *n, double *alpha, double *x, int *incx, double *y, int *incy, double *A, int *lda); + +// level 3 +void dgemm_(char *ta, char *tb, int *m, int *n, int *k, double *alpha, double *A, int *lda, double *B, int *ldb, double *beta, double *C, int *ldc); +void dsyrk_(char *uplo, char *trans, int *n, int *k, double *alpha, double *A, int *lda, double *beta, double *C, int *ldc); +void dtrmm_(char *side, char *uplo, char *trans, char *diag, int *m, int *n, double *alpha, double *A, int *lda, double *B, int *ldb); +void dtrsm_(char *side, char *uplo, char *trans, char *diag, int *m, int *n, double *alpha, double *A, int *lda, double *B, int *ldb); + +// lapack +void dpotrf_(char *uplo, int *m, double *A, int *lda, int *info); +void dgetrf_(int *m, int *n, double *A, int *lda, int *ipiv, int *info); +void dgeqrf_(int *m, int *n, double *A, int *lda, double *tau, double *work, int *lwork, int *info); +void dgeqr2_(int *m, int *n, double *A, int *lda, double *tau, double *work, int *info); +void dgelqf_(int *m, int *n, double *A, int *lda, double *tau, double *work, int *lwork, int *info); +void dorglq_(int *m, int *n, int *k, double *A, int *lda, double *tau, double *work, int *lwork, int *info); + + + +#ifdef __cplusplus +} +#endif diff --git a/third_party/acados/include/blasfeo/include/d_blas_64.h b/third_party/acados/include/blasfeo/include/d_blas_64.h new file mode 100644 index 000000000..4f40d00df --- /dev/null +++ b/third_party/acados/include/blasfeo/include/d_blas_64.h @@ -0,0 +1,73 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + + + +// headers to reference BLAS and LAPACK routines employed in BLASFEO WR + +// level 1 +double ddot_(long long *m, double *x, long long *incx, double *y, long long *incy); +void dcopy_(long long *m, double *x, long long *incx, double *y, long long *incy); +void daxpy_(long long *m, double *alpha, double *x, long long *incx, double *y, long long *incy); +void dscal_(long long *m, double *alpha, double *x, long long *incx); + +// level 2 +void dgemv_(char *ta, long long *m, long long *n, double *alpha, double *A, long long *lda, double *x, long long *incx, double *beta, double *y, long long *incy); +void dsymv_(char *uplo, long long *m, double *alpha, double *A, long long *lda, double *x, long long *incx, double *beta, double *y, long long *incy); +void dtrmv_(char *uplo, char *trans, char *diag, long long *n, double *A, long long *lda, double *x, long long *incx); +void dtrsv_(char *uplo, char *trans, char *diag, long long *n, double *A, long long *lda, double *x, long long *incx); +void dger_(long long *m, long long *n, double *alpha, double *x, long long *incx, double *y, long long *incy, double *A, long long *lda); + +// level 3 +void dgemm_(char *ta, char *tb, long long *m, long long *n, long long *k, double *alpha, double *A, long long *lda, double *B, long long *ldb, double *beta, double *C, long long *ldc); +void dsyrk_(char *uplo, char *trans, long long *n, long long *k, double *alpha, double *A, long long *lda, double *beta, double *C, long long *ldc); +void dtrmm_(char *side, char *uplo, char *trans, char *diag, long long *m, long long *n, double *alpha, double *A, long long *lda, double *B, long long *ldb); +void dtrsm_(char *side, char *uplo, char *trans, char *diag, long long *m, long long *n, double *alpha, double *A, long long *lda, double *B, long long *ldb); + +// lapack +void dpotrf_(char *uplo, long long *m, double *A, long long *lda, long long *info); +void dgetrf_(long long *m, long long *n, double *A, long long *lda, long long *ipiv, long long *info); +void dgeqrf_(long long *m, long long *n, double *A, long long *lda, double *tau, double *work, long long *lwork, long long *info); +void dgeqr2_(long long *m, long long *n, double *A, long long *lda, double *tau, double *work, long long *info); + + + +#ifdef __cplusplus +} +#endif diff --git a/third_party/acados/include/blasfeo/include/s_blas.h b/third_party/acados/include/blasfeo/include/s_blas.h new file mode 100644 index 000000000..58b2bb0a1 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/s_blas.h @@ -0,0 +1,77 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + + + +// headers to reference BLAS and LAPACK routines employed in BLASFEO WR + +// level 1 +float sdot_(int *m, float *x, int *incx, float *y, int *incy); +void scopy_(int *m, float *x, int *incx, float *y, int *incy); +void saxpy_(int *m, float *alpha, float *x, int *incx, float *y, int *incy); +void sscal_(int *m, float *alpha, float *x, int *incx); +void srot_(int *m, float *x, int *incx, float *y, int *incy, float *c, float *s); +void srotg_(float *a, float *b, float *c, float *s); + +// level 2 +void sgemv_(char *ta, int *m, int *n, float *alpha, float *A, int *lda, float *x, int *incx, float *beta, float *y, int *incy); +void ssymv_(char *uplo, int *m, float *alpha, float *A, int *lda, float *x, int *incx, float *beta, float *y, int *incy); +void strmv_(char *uplo, char *trans, char *diag, int *n, float *A, int *lda, float *x, int *incx); +void strsv_(char *uplo, char *trans, char *diag, int *n, float *A, int *lda, float *x, int *incx); +void sger_(int *m, int *n, float *alpha, float *x, int *incx, float *y, int *incy, float *A, int *lda); + +// level 3 +void sgemm_(char *ta, char *tb, int *m, int *n, int *k, float *alpha, float *A, int *lda, float *B, int *ldb, float *beta, float *C, int *ldc); +void ssyrk_(char *uplo, char *trans, int *n, int *k, float *alpha, float *A, int *lda, float *beta, float *C, int *ldc); +void strmm_(char *side, char *uplo, char *transa, char *diag, int *m, int *n, float *alpha, float *A, int *lda, float *B, int *ldb); +void strsm_(char *side, char *uplo, char *transa, char *diag, int *m, int *n, float *alpha, float *A, int *lda, float *B, int *ldb); + +// lapack +void spotrf_(char *uplo, int *m, float *A, int *lda, int *info); +void sgetrf_(int *m, int *n, float *A, int *lda, int *ipiv, int *info); +void sgeqrf_(int *m, int *n, float *A, int *lda, float *tau, float *work, int *lwork, int *info); +void sgeqr2_(int *m, int *n, float *A, int *lda, float *tau, float *work, int *info); +void sgelqf_(int *m, int *n, float *A, int *lda, float *tau, float *work, int *lwork, int *info); +void sorglq_(int *m, int *n, int *k, float *A, int *lda, float *tau, float *work, int *lwork, int *info); + + + +#ifdef __cplusplus +} +#endif diff --git a/third_party/acados/include/blasfeo/include/s_blas_64.h b/third_party/acados/include/blasfeo/include/s_blas_64.h new file mode 100644 index 000000000..b9efab6c2 --- /dev/null +++ b/third_party/acados/include/blasfeo/include/s_blas_64.h @@ -0,0 +1,73 @@ +/************************************************************************************************** +* * +* This file is part of BLASFEO. * +* * +* BLASFEO -- BLAS For Embedded Optimization. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + + + +// headers to reference BLAS and LAPACK routines employed in BLASFEO WR + +// level 1 +float sdot_(long long *m, float *x, long long *incx, float *y, long long *incy); +void scopy_(long long *m, float *x, long long *incx, float *y, long long *incy); +void saxpy_(long long *m, float *alpha, float *x, long long *incx, float *y, long long *incy); +void sscal_(long long *m, float *alpha, float *x, long long *incx); + +// level 2 +void sgemv_(char *ta, long long *m, long long *n, float *alpha, float *A, long long *lda, float *x, long long *incx, float *beta, float *y, long long *incy); +void ssymv_(char *uplo, long long *m, float *alpha, float *A, long long *lda, float *x, long long *incx, float *beta, float *y, long long *incy); +void strmv_(char *uplo, char *trans, char *diag, long long *n, float *A, long long *lda, float *x, long long *incx); +void strsv_(char *uplo, char *trans, char *diag, long long *n, float *A, long long *lda, float *x, long long *incx); +void sger_(long long *m, long long *n, float *alpha, float *x, long long *incx, float *y, long long *incy, float *A, long long *lda); + +// level 3 +void sgemm_(char *ta, char *tb, long long *m, long long *n, long long *k, float *alpha, float *A, long long *lda, float *B, long long *ldb, float *beta, float *C, long long *ldc); +void ssyrk_(char *uplo, char *trans, long long *n, long long *k, float *alpha, float *A, long long *lda, float *beta, float *C, long long *ldc); +void strmm_(char *side, char *uplo, char *transa, char *diag, long long *m, long long *n, float *alpha, float *A, long long *lda, float *B, long long *ldb); +void strsm_(char *side, char *uplo, char *transa, char *diag, long long *m, long long *n, float *alpha, float *A, long long *lda, float *B, long long *ldb); + +// lapack +void spotrf_(char *uplo, long long *m, float *A, long long *lda, long long *info); +void sgetrf_(long long *m, long long *n, float *A, long long *lda, long long *ipiv, long long *info); +void sgeqrf_(long long *m, long long *n, float *A, long long *lda, float *tau, float *work, long long *lwork, long long *info); +void sgeqr2_(long long *m, long long *n, float *A, long long *lda, float *tau, float *work, long long *info); + + + +#ifdef __cplusplus +} +#endif diff --git a/third_party/acados/include/hpipm/include/hpipm_aux_mem.h b/third_party/acados/include/hpipm/include/hpipm_aux_mem.h new file mode 100644 index 000000000..7bd3d7e8b --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_aux_mem.h @@ -0,0 +1,52 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_AUX_MEM_H_ +#define HPIPM_AUX_MEM_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void hpipm_zero_memset(hpipm_size_t memsize, void *mem); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // HPIPM_AUX_MEM_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_aux_string.h b/third_party/acados/include/hpipm/include/hpipm_aux_string.h new file mode 100644 index 000000000..804cba5dc --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_aux_string.h @@ -0,0 +1,50 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_AUX_STRING_H_ +#define HPIPM_AUX_STRING_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define MAX_STR_LEN 5 +int hpipm_strcmp(char *str1, char *str2); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // HPIPM_AUX_STRING_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_common.h b/third_party/acados/include/hpipm/include/hpipm_common.h new file mode 100644 index 000000000..0cc96a7b5 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_common.h @@ -0,0 +1,76 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_COMMON_H_ +#define HPIPM_COMMON_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef size_t hpipm_size_t; + +enum hpipm_mode + { + SPEED_ABS, // focus on speed, absolute IPM formulation + SPEED, // focus on speed, relative IPM formulation + BALANCE, // balanced mode, relative IPM formulation + ROBUST, // focus on robustness, relative IPM formulation + }; + +enum hpipm_status + { + SUCCESS, // found solution satisfying accuracy tolerance + MAX_ITER, // maximum iteration number reached + MIN_STEP, // minimum step length reached + NAN_SOL, // NaN in solution detected + INCONS_EQ, // unconsistent equality constraints + }; + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_COMMON_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_cast_qcqp.h b/third_party/acados/include/hpipm/include/hpipm_d_cast_qcqp.h new file mode 100644 index 000000000..0e4c41f22 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_cast_qcqp.h @@ -0,0 +1,71 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_D_CAST_QCQP_H_ +#define HPIPM_D_CAST_QCQP_H_ + + + +#include +#include + +#include "hpipm_d_dense_qcqp.h" +#include "hpipm_d_dense_qcqp_sol.h" +#include "hpipm_d_ocp_qcqp.h" +#include "hpipm_d_ocp_qcqp_dim.h" +#include "hpipm_d_ocp_qcqp_sol.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void d_cast_qcqp_compute_dim(struct d_ocp_qcqp_dim *ocp_dim, struct d_dense_qcqp_dim *dense_dim); +// +void d_cast_qcqp_cond(struct d_ocp_qcqp *ocp_qp, struct d_dense_qcqp *dense_qp); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_CAST_QCQP_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_cond.h b/third_party/acados/include/hpipm/include/hpipm_d_cond.h new file mode 100644 index 000000000..5900a2ab1 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_cond.h @@ -0,0 +1,135 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_D_COND_H_ +#define HPIPM_D_COND_H_ + + + +#include +#include + +#include "hpipm_d_dense_qp.h" +#include "hpipm_d_dense_qp_sol.h" +#include "hpipm_d_ocp_qp.h" +#include "hpipm_d_ocp_qp_dim.h" +#include "hpipm_d_ocp_qp_sol.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_cond_qp_arg + { + int cond_last_stage; // condense last stage + int cond_alg; // condensing algorithm: 0 N2-nx3, 1 N3-nx2 + int comp_prim_sol; // primal solution (v) + int comp_dual_sol_eq; // dual solution equality constr (pi) + int comp_dual_sol_ineq; // dual solution inequality constr (lam t) + int square_root_alg; // square root algorithm (faster but requires RSQ>0) + hpipm_size_t memsize; + }; + + + +struct d_cond_qp_ws + { + struct blasfeo_dmat *Gamma; + struct blasfeo_dmat *GammaQ; + struct blasfeo_dmat *L; + struct blasfeo_dmat *Lx; + struct blasfeo_dmat *AL; + struct blasfeo_dvec *Gammab; + struct blasfeo_dvec *l; + struct blasfeo_dvec *tmp_nbgM; + struct blasfeo_dvec *tmp_nuxM; + int bs; // block size + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_cond_qp_arg_memsize(); +// +void d_cond_qp_arg_create(struct d_cond_qp_arg *cond_arg, void *mem); +// +void d_cond_qp_arg_set_default(struct d_cond_qp_arg *cond_arg); +// condensing algorithm: 0 N2-nx3, 1 N3-nx2 +void d_cond_qp_arg_set_cond_alg(int cond_alg, struct d_cond_qp_arg *cond_arg); +// set riccati-like algorithm: 0 classical, 1 square-root +void d_cond_qp_arg_set_ric_alg(int ric_alg, struct d_cond_qp_arg *cond_arg); +// condense last stage: 0 last stage disregarded, 1 last stage condensed too +void d_cond_qp_arg_set_cond_last_stage(int cond_last_stage, struct d_cond_qp_arg *cond_arg); +// +void d_cond_qp_arg_set_comp_prim_sol(int value, struct d_cond_qp_arg *cond_arg); +// +void d_cond_qp_arg_set_comp_dual_sol_eq(int value, struct d_cond_qp_arg *cond_arg); +// +void d_cond_qp_arg_set_comp_dual_sol_ineq(int value, struct d_cond_qp_arg *cond_arg); + +// +void d_cond_qp_compute_dim(struct d_ocp_qp_dim *ocp_dim, struct d_dense_qp_dim *dense_dim); +// +hpipm_size_t d_cond_qp_ws_memsize(struct d_ocp_qp_dim *ocp_dim, struct d_cond_qp_arg *cond_arg); +// +void d_cond_qp_ws_create(struct d_ocp_qp_dim *ocp_dim, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws, void *mem); +// +void d_cond_qp_cond(struct d_ocp_qp *ocp_qp, struct d_dense_qp *dense_qp, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_cond_qp_cond_lhs(struct d_ocp_qp *ocp_qp, struct d_dense_qp *dense_qp, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_cond_qp_cond_rhs(struct d_ocp_qp *ocp_qp, struct d_dense_qp *dense_qp, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_cond_qp_expand_sol(struct d_ocp_qp *ocp_qp, struct d_dense_qp_sol *dense_qp_sol, struct d_ocp_qp_sol *ocp_qp_sol, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// TODO remove +void d_cond_qp_expand_primal_sol(struct d_ocp_qp *ocp_qp, struct d_dense_qp_sol *dense_qp_sol, struct d_ocp_qp_sol *ocp_qp_sol, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); + +// +void d_cond_qp_update(int *idxc, struct d_ocp_qp *ocp_qp, struct d_dense_qp *dense_qp, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_COND_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_cond_aux.h b/third_party/acados/include/hpipm/include/hpipm_d_cond_aux.h new file mode 100644 index 000000000..73afba3c7 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_cond_aux.h @@ -0,0 +1,92 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_D_COND_AUX_H_ +#define HPIPM_D_COND_AUX_H_ + + + +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void d_cond_BAbt(struct d_ocp_qp *ocp_qp, struct blasfeo_dmat *BAbt2, struct blasfeo_dvec *b, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_cond_BAt(struct d_ocp_qp *ocp_qp, struct blasfeo_dmat *BAbt2, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_cond_b(struct d_ocp_qp *ocp_qp, struct blasfeo_dvec *b, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_cond_RSQrq(struct d_ocp_qp *ocp_qp, struct blasfeo_dmat *RSQrq2, struct blasfeo_dvec *rq, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_cond_RSQ(struct d_ocp_qp *ocp_qp, struct blasfeo_dmat *RSQrq2, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_cond_rq(struct d_ocp_qp *ocp_qp, struct blasfeo_dvec *rq, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_cond_DCtd(struct d_ocp_qp *ocp_qp, int *idxb2, struct blasfeo_dmat *DCt2, struct blasfeo_dvec *d2, struct blasfeo_dvec *d_mask2, int *idxs_rev2, struct blasfeo_dvec *Z2, struct blasfeo_dvec *z, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_cond_DCt(struct d_ocp_qp *ocp_qp, int *idxb2, struct blasfeo_dmat *DCt2, int *idxs_rev2, struct blasfeo_dvec *Z2, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_cond_d(struct d_ocp_qp *ocp_qp, struct blasfeo_dvec *d2, struct blasfeo_dvec *d_mask2, struct blasfeo_dvec *z, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_expand_sol(struct d_ocp_qp *ocp_qp, struct d_dense_qp_sol *dense_qp_sol, struct d_ocp_qp_sol *ocp_qp_so, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_expand_primal_sol(struct d_ocp_qp *ocp_qp, struct d_dense_qp_sol *dense_qp_sol, struct d_ocp_qp_sol *ocp_qp_so, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); + +// +void d_update_cond_BAbt(int *idxc, struct d_ocp_qp *ocp_qp, struct blasfeo_dmat *BAbt2, struct blasfeo_dvec *b, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_update_cond_RSQrq_N2nx3(int *idxc, struct d_ocp_qp *ocp_qp, struct blasfeo_dmat *RSQrq2, struct blasfeo_dvec *rq, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); +// +void d_update_cond_DCtd(int *idxc, struct d_ocp_qp *ocp_qp, int *idxb2, struct blasfeo_dmat *DCt2, struct blasfeo_dvec *d2, int *idxs2, struct blasfeo_dvec *Z2, struct blasfeo_dvec *z, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_COND_AUX_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_cond_qcqp.h b/third_party/acados/include/hpipm/include/hpipm_d_cond_qcqp.h new file mode 100644 index 000000000..266567bb8 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_cond_qcqp.h @@ -0,0 +1,129 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_D_COND_QCQP_H_ +#define HPIPM_D_COND_QCQP_H_ + + + +#include +#include + +#include "hpipm_d_dense_qcqp.h" +#include "hpipm_d_dense_qcqp_sol.h" +#include "hpipm_d_ocp_qcqp.h" +#include "hpipm_d_ocp_qcqp_dim.h" +#include "hpipm_d_ocp_qcqp_sol.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_cond_qcqp_arg + { + struct d_cond_qp_arg *qp_arg; + int cond_last_stage; // condense last stage +// int cond_variant; // TODO + int comp_prim_sol; // primal solution (v) + int comp_dual_sol_eq; // dual solution equality constr (pi) + int comp_dual_sol_ineq; // dual solution equality constr (lam t) + int square_root_alg; // square root algorithm (faster but requires RSQ>0) + hpipm_size_t memsize; + }; + + + +struct d_cond_qcqp_ws + { + struct d_cond_qp_ws *qp_ws; + struct blasfeo_dmat *hess_array; // TODO remove + struct blasfeo_dmat *zero_hess; // TODO remove + struct blasfeo_dvec *grad_array; // TODO remove + struct blasfeo_dvec *zero_grad; // TODO remove + struct blasfeo_dvec *tmp_nvc; + struct blasfeo_dvec *tmp_nuxM; + struct blasfeo_dmat *GammaQ; + struct blasfeo_dmat *tmp_DCt; + struct blasfeo_dmat *tmp_nuM_nxM; +// struct blasfeo_dvec *d_qp; +// struct blasfeo_dvec *d_mask_qp; + hpipm_size_t memsize; + }; + + +// +hpipm_size_t d_cond_qcqp_arg_memsize(); +// +void d_cond_qcqp_arg_create(struct d_cond_qcqp_arg *cond_arg, void *mem); +// +void d_cond_qcqp_arg_set_default(struct d_cond_qcqp_arg *cond_arg); +// set riccati-like algorithm: 0 classical, 1 square-root +void d_cond_qcqp_arg_set_ric_alg(int ric_alg, struct d_cond_qcqp_arg *cond_arg); +// condense last stage: 0 last stage disregarded, 1 last stage condensed too +void d_cond_qcqp_arg_set_cond_last_stage(int cond_last_stage, struct d_cond_qcqp_arg *cond_arg); + +// +void d_cond_qcqp_compute_dim(struct d_ocp_qcqp_dim *ocp_dim, struct d_dense_qcqp_dim *dense_dim); +// +hpipm_size_t d_cond_qcqp_ws_memsize(struct d_ocp_qcqp_dim *ocp_dim, struct d_cond_qcqp_arg *cond_arg); +// +void d_cond_qcqp_ws_create(struct d_ocp_qcqp_dim *ocp_dim, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws, void *mem); +// +void d_cond_qcqp_qc(struct d_ocp_qcqp *ocp_qp, struct blasfeo_dmat *Hq2, int *Hq_nzero2, struct blasfeo_dmat *Ct2, struct blasfeo_dvec *d2, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws); +// +void d_cond_qcqp_qc_lhs(struct d_ocp_qcqp *ocp_qp, struct blasfeo_dmat *Hq2, int *Hq_nzero2, struct blasfeo_dmat *Ct2, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws); +// +void d_cond_qcqp_qc_rhs(struct d_ocp_qcqp *ocp_qp, struct blasfeo_dvec *d2, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws); +// +void d_cond_qcqp_cond(struct d_ocp_qcqp *ocp_qp, struct d_dense_qcqp *dense_qp, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws); +// +void d_cond_qcqp_cond_rhs(struct d_ocp_qcqp *ocp_qp, struct d_dense_qcqp *dense_qp, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws); +// +void d_cond_qcqp_cond_lhs(struct d_ocp_qcqp *ocp_qp, struct d_dense_qcqp *dense_qp, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws); +// +void d_cond_qcqp_expand_sol(struct d_ocp_qcqp *ocp_qp, struct d_dense_qcqp_sol *dense_qp_sol, struct d_ocp_qcqp_sol *ocp_qp_sol, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_COND_QCQP_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_core_qp_ipm.h b/third_party/acados/include/hpipm/include/hpipm_d_core_qp_ipm.h new file mode 100644 index 000000000..f39d9a9b5 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_core_qp_ipm.h @@ -0,0 +1,101 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_CORE_QP_IPM_ +#define HPIPM_D_CORE_QP_IPM_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct d_core_qp_ipm_workspace + { + double *v; // primal variables + double *pi; // equality constraints multipliers + double *lam; // inequality constraints multipliers + double *t; // inequality constraints slacks + double *t_inv; // inverse of t + double *v_bkp; // backup of primal variables + double *pi_bkp; // backup of equality constraints multipliers + double *lam_bkp; // backup of inequality constraints multipliers + double *t_bkp; // backup of inequality constraints slacks + double *dv; // step in v + double *dpi; // step in pi + double *dlam; // step in lam + double *dt; // step in t + double *res_g; // q-residuals + double *res_b; // b-residuals + double *res_d; // d-residuals + double *res_m; // m-residuals + double *res_m_bkp; // m-residuals + double *Gamma; // Hessian update + double *gamma; // gradient update + double alpha; // step length + double alpha_prim; // step length + double alpha_dual; // step length + double sigma; // centering XXX + double mu; // duality measuere + double mu_aff; // affine duality measuere + double nc_inv; // 1.0/nc, where nc is the total number of inequality constraints + double nc_mask_inv; // 1.0/nc_mask + double lam_min; // min value in lam vector + double t_min; // min value in t vector + double t_min_inv; // inverse of min value in t vector + double tau_min; // min value of barrier parameter + int nv; // number of primal variables + int ne; // number of equality constraints + int nc; // (twice the) number of (two-sided) inequality constraints + int nc_mask; // total number of ineq constr after masking + int split_step; // use different step for primal and dual variables + int t_lam_min; // clip t and lam also in solution, or only in Gamma computation + hpipm_size_t memsize; // memory size (in bytes) of workspace + }; + + + +// +hpipm_size_t d_memsize_core_qp_ipm(int nv, int ne, int nc); +// +void d_create_core_qp_ipm(int nv, int ne, int nc, struct d_core_qp_ipm_workspace *workspace, void *mem); +// +void d_core_qp_ipm(struct d_core_qp_ipm_workspace *workspace); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // HPIPM_D_CORE_QP_IPM_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_core_qp_ipm_aux.h b/third_party/acados/include/hpipm/include/hpipm_d_core_qp_ipm_aux.h new file mode 100644 index 000000000..30cc824ba --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_core_qp_ipm_aux.h @@ -0,0 +1,68 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_CORE_QP_IPM_AUX_ +#define HPIPM_S_CORE_QP_IPM_AUX_ + +#ifdef __cplusplus +extern "C" { +#endif + +// +void d_compute_Gamma_gamma_qp(double *res_d, double *res_m, struct d_core_qp_ipm_workspace *rws); +// +void d_compute_gamma_qp(double *res_d, double *res_m, struct d_core_qp_ipm_workspace *rws); +// +void d_compute_lam_t_qp(double *res_d, double *res_m, double *dlam, double *dt, struct d_core_qp_ipm_workspace *rws); +// +void d_compute_alpha_qp(struct d_core_qp_ipm_workspace *rws); +// +void d_update_var_qp(struct d_core_qp_ipm_workspace *rws); +// +void d_compute_mu_aff_qp(struct d_core_qp_ipm_workspace *rws); +// +void d_backup_res_m(struct d_core_qp_ipm_workspace *rws); +// +void d_compute_centering_correction_qp(struct d_core_qp_ipm_workspace *rws); +// +void d_compute_centering_qp(struct d_core_qp_ipm_workspace *rws); +// +void d_compute_tau_min_qp(struct d_core_qp_ipm_workspace *rws); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // HPIPM_S_CORE_QP_IPM_AUX_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp.h b/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp.h new file mode 100644 index 000000000..3da571649 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp.h @@ -0,0 +1,199 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_D_DENSE_QCQP_H_ +#define HPIPM_D_DENSE_QCQP_H_ + + + +#include +#include + +#include "hpipm_d_dense_qcqp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_dense_qcqp + { + struct d_dense_qcqp_dim *dim; + struct blasfeo_dmat *Hv; // hessian of cost & vector work space + struct blasfeo_dmat *A; // equality constraint matrix + struct blasfeo_dmat *Ct; // inequality constraints matrix + struct blasfeo_dmat *Hq; // hessians of quadratic constraints + struct blasfeo_dvec *gz; // gradient of cost & gradient of slacks + struct blasfeo_dvec *b; // equality constraint vector + struct blasfeo_dvec *d; // inequality constraints vector + struct blasfeo_dvec *d_mask; // inequality constraints mask vector + struct blasfeo_dvec *m; // rhs of complementarity condition + struct blasfeo_dvec *Z; // (diagonal) hessian of slacks + int *idxb; // indices of box constrained variables within [u; x] + int *idxs_rev; // index of soft constraints (reverse storage) + int *Hq_nzero; // for each int, the last 3 bits ...abc, {a,b,c}=0 => {R,S,Q}=0 + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t d_dense_qcqp_memsize(struct d_dense_qcqp_dim *dim); +// +void d_dense_qcqp_create(struct d_dense_qcqp_dim *dim, struct d_dense_qcqp *qp, void *memory); + +// +void d_dense_qcqp_set(char *field, void *value, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_H(double *H, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_g(double *g, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_A(double *A, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_b(double *b, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_idxb(int *idxb, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_lb(double *lb, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_lb_mask(double *lb, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_ub(double *ub, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_ub_mask(double *ub, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_C(double *C, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_lg(double *lg, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_lg_mask(double *lg, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_ug(double *ug, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_ug_mask(double *ug, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_Hq(double *Hq, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_gq(double *gq, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_uq(double *uq, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_uq_mask(double *uq, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_idxs(int *idxs, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_idxs_rev(int *idxs_rev, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_Zl(double *Zl, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_Zu(double *Zu, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_zl(double *zl, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_zu(double *zu, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_ls(double *ls, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_ls_mask(double *ls, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_us(double *us, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_set_us_mask(double *us, struct d_dense_qcqp *qp); + +// getters (COLMAJ) + +void d_dense_qcqp_get_H(struct d_dense_qcqp *qp, double *H); +// +void d_dense_qcqp_get_g(struct d_dense_qcqp *qp, double *g); +// +void d_dense_qcqp_get_A(struct d_dense_qcqp *qp, double *A); +// +void d_dense_qcqp_get_b(struct d_dense_qcqp *qp, double *b); +// +void d_dense_qcqp_get_idxb(struct d_dense_qcqp *qp, int *idxb); +// +void d_dense_qcqp_get_lb(struct d_dense_qcqp *qp, double *lb); +// +void d_dense_qcqp_get_lb_mask(struct d_dense_qcqp *qp, double *lb); +// +void d_dense_qcqp_get_ub(struct d_dense_qcqp *qp, double *ub); +// +void d_dense_qcqp_get_ub_mask(struct d_dense_qcqp *qp, double *ub); +// +void d_dense_qcqp_get_C(struct d_dense_qcqp *qp, double *C); +// +void d_dense_qcqp_get_lg(struct d_dense_qcqp *qp, double *lg); +// +void d_dense_qcqp_get_lg_mask(struct d_dense_qcqp *qp, double *lg); +// +void d_dense_qcqp_get_ug(struct d_dense_qcqp *qp, double *ug); +// +void d_dense_qcqp_get_ug_mask(struct d_dense_qcqp *qp, double *ug); +// +void d_dense_qcqp_get_idxs(struct d_dense_qcqp *qp, int *idxs); +// +void d_dense_qcqp_get_idxs_rev(struct d_dense_qcqp *qp, int *idxs_rev); +// +void d_dense_qcqp_get_Zl(struct d_dense_qcqp *qp, double *Zl); +// +void d_dense_qcqp_get_Zu(struct d_dense_qcqp *qp, double *Zu); +// +void d_dense_qcqp_get_zl(struct d_dense_qcqp *qp, double *zl); +// +void d_dense_qcqp_get_zu(struct d_dense_qcqp *qp, double *zu); +// +void d_dense_qcqp_get_ls(struct d_dense_qcqp *qp, double *ls); +// +void d_dense_qcqp_get_ls_mask(struct d_dense_qcqp *qp, double *ls); +// +void d_dense_qcqp_get_us(struct d_dense_qcqp *qp, double *us); +// +void d_dense_qcqp_get_us_mask(struct d_dense_qcqp *qp, double *us); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_DENSE_QCQP_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_dim.h b/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_dim.h new file mode 100644 index 000000000..fa8c574a1 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_dim.h @@ -0,0 +1,98 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_DENSE_QCQP_DIM_H_ +#define HPIPM_D_DENSE_QCQP_DIM_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_dense_qcqp_dim + { + struct d_dense_qp_dim *qp_dim; // dim of qp approximation + int nv; // number of variables + int ne; // number of equality constraints + int nb; // number of box constraints + int ng; // number of general constraints + int nq; // number of quadratic constraints + int nsb; // number of softened box constraints + int nsg; // number of softened general constraints + int nsq; // number of softened quadratic constraints + int ns; // number of softened constraints (nsb+nsg+nsq) TODO number of slacks + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_dense_qcqp_dim_memsize(); +// +void d_dense_qcqp_dim_create(struct d_dense_qcqp_dim *dim, void *memory); +// +void d_dense_qcqp_dim_set(char *field_name, int value, struct d_dense_qcqp_dim *dim); +// +void d_dense_qcqp_dim_set_nv(int value, struct d_dense_qcqp_dim *dim); +// +void d_dense_qcqp_dim_set_ne(int value, struct d_dense_qcqp_dim *dim); +// +void d_dense_qcqp_dim_set_nb(int value, struct d_dense_qcqp_dim *dim); +// +void d_dense_qcqp_dim_set_ng(int value, struct d_dense_qcqp_dim *dim); +// +void d_dense_qcqp_dim_set_nq(int value, struct d_dense_qcqp_dim *dim); +// +void d_dense_qcqp_dim_set_nsb(int value, struct d_dense_qcqp_dim *dim); +// +void d_dense_qcqp_dim_set_nsg(int value, struct d_dense_qcqp_dim *dim); +// +void d_dense_qcqp_dim_set_nsq(int value, struct d_dense_qcqp_dim *dim); +// +void d_dense_qcqp_dim_set_ns(int value, struct d_dense_qcqp_dim *dim); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_DENSE_QCQP_DIM_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_ipm.h b/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_ipm.h new file mode 100644 index 000000000..fa3f98fa7 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_ipm.h @@ -0,0 +1,193 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_D_DENSE_QCQP_IPM_H_ +#define HPIPM_D_DENSE_QCQP_IPM_H_ + + + +#include +#include + +#include +#include +#include +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_dense_qcqp_ipm_arg + { + struct d_dense_qp_ipm_arg *qp_arg; + double mu0; // initial value for duality measure + double alpha_min; // exit cond on step length + double res_g_max; // exit cond on inf norm of residuals + double res_b_max; // exit cond on inf norm of residuals + double res_d_max; // exit cond on inf norm of residuals + double res_m_max; // exit cond on inf norm of residuals + double reg_prim; // reg of primal hessian + double reg_dual; // reg of dual hessian + double lam_min; // min value in lam vector + double t_min; // min value in t vector + int iter_max; // exit cond in iter number + int stat_max; // iterations saved in stat + int pred_corr; // Mehrotra's predictor-corrector IPM algirthm + int cond_pred_corr; // conditional Mehrotra's predictor-corrector + int scale; // scale hessian + int itref_pred_max; // max number of iterative refinement steps for predictor step + int itref_corr_max; // max number of iterative refinement steps for corrector step + int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol + int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq + int abs_form; // absolute IPM formulation + int comp_res_exit; // compute residuals on exit (only for abs_form==1) + int comp_res_pred; // compute residuals of prediction + int split_step; // use different step for primal and dual variables + int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution + int mode; + hpipm_size_t memsize; + }; + + + +struct d_dense_qcqp_ipm_ws + { + struct d_dense_qp_ipm_ws *qp_ws; + struct d_dense_qp *qp; + struct d_dense_qp_sol *qp_sol; + struct d_dense_qcqp_res_ws *qcqp_res_ws; + struct d_dense_qcqp_res *qcqp_res; + struct blasfeo_dvec *tmp_nv; + int iter; // iteration number + int status; + hpipm_size_t memsize; // memory size (in bytes) of workspace + }; + + + +// +hpipm_size_t d_dense_qcqp_ipm_arg_memsize(struct d_dense_qcqp_dim *dim); +// +void d_dense_qcqp_ipm_arg_create(struct d_dense_qcqp_dim *dim, struct d_dense_qcqp_ipm_arg *arg, void *mem); +// +void d_dense_qcqp_ipm_arg_set_default(enum hpipm_mode mode, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set(char *field, void *value, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_iter_max(int *iter_max, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_alpha_min(double *alpha_min, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_mu0(double *mu0, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_tol_stat(double *tol_stat, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_tol_eq(double *tol_eq, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_tol_ineq(double *tol_ineq, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_tol_comp(double *tol_comp, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_reg_prim(double *reg, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_reg_dual(double *reg, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_warm_start(int *warm_start, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_pred_corr(int *pred_corr, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_cond_pred_corr(int *cond_pred_corr, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_comp_res_pred(int *comp_res_pred, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_comp_res_exit(int *comp_res_exit, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_lam_min(double *value, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_t_min(double *value, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_split_step(int *value, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_arg_set_t_lam_min(int *value, struct d_dense_qcqp_ipm_arg *arg); + +// +hpipm_size_t d_dense_qcqp_ipm_ws_memsize(struct d_dense_qcqp_dim *qp_dim, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_ipm_ws_create(struct d_dense_qcqp_dim *qp_dim, struct d_dense_qcqp_ipm_arg *arg, struct d_dense_qcqp_ipm_ws *ws, void *mem); +// +void d_dense_qcqp_ipm_get(char *field, struct d_dense_qcqp_ipm_ws *ws, void *value); +// +void d_dense_qcqp_ipm_get_status(struct d_dense_qcqp_ipm_ws *ws, int *status); +// +void d_dense_qcqp_ipm_get_iter(struct d_dense_qcqp_ipm_ws *ws, int *iter); +// +void d_dense_qcqp_ipm_get_max_res_stat(struct d_dense_qcqp_ipm_ws *ws, double *res_stat); +// +void d_dense_qcqp_ipm_get_max_res_eq(struct d_dense_qcqp_ipm_ws *ws, double *res_eq); +// +void d_dense_qcqp_ipm_get_max_res_ineq(struct d_dense_qcqp_ipm_ws *ws, double *res_ineq); +// +void d_dense_qcqp_ipm_get_max_res_comp(struct d_dense_qcqp_ipm_ws *ws, double *res_comp); +// +void d_dense_qcqp_ipm_get_stat(struct d_dense_qcqp_ipm_ws *ws, double **stat); +// +void d_dense_qcqp_ipm_get_stat_m(struct d_dense_qcqp_ipm_ws *ws, int *stat_m); +// +void d_dense_qcqp_init_var(struct d_dense_qcqp *qp, struct d_dense_qcqp_sol *qp_sol, struct d_dense_qcqp_ipm_arg *arg, struct d_dense_qcqp_ipm_ws *ws); +// +void d_dense_qcqp_ipm_solve(struct d_dense_qcqp *qp, struct d_dense_qcqp_sol *qp_sol, struct d_dense_qcqp_ipm_arg *arg, struct d_dense_qcqp_ipm_ws *ws); +#if 0 +// +void d_dense_qcqp_ipm_predict(struct d_dense_qcqp *qp, struct d_dense_qcqp_sol *qp_sol, struct d_dense_qcqp_ipm_arg *arg, struct d_dense_qcqp_ipm_ws *ws); +// +void d_dense_qcqp_ipm_sens(struct d_dense_qcqp *qp, struct d_dense_qcqp_sol *qp_sol, struct d_dense_qcqp_ipm_arg *arg, struct d_dense_qcqp_ipm_ws *ws); +#endif + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_DENSE_QCQP_IPM_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_res.h b/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_res.h new file mode 100644 index 000000000..a76f16215 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_res.h @@ -0,0 +1,107 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_DENSE_QCQP_RES_H_ +#define HPIPM_D_DENSE_QCQP_RES_H_ + + + +#include +#include + +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_dense_qcqp_res + { + struct d_dense_qcqp_dim *dim; + struct blasfeo_dvec *res_g; // q-residuals + struct blasfeo_dvec *res_b; // b-residuals + struct blasfeo_dvec *res_d; // d-residuals + struct blasfeo_dvec *res_m; // m-residuals + double res_max[4]; // infinity norm of residuals + double res_mu; // mu-residual + hpipm_size_t memsize; + }; + + + +struct d_dense_qcqp_res_ws + { + struct blasfeo_dvec *tmp_nv; // work space of size nv + struct blasfeo_dvec *tmp_nbgq; // work space of size nbM+ngM+nqM + struct blasfeo_dvec *tmp_ns; // work space of size nsM + struct blasfeo_dvec *q_fun; // value for evaluation of quadr constr + struct blasfeo_dvec *q_adj; // value for adjoint of quadr constr + int use_q_fun; // reuse cached value for evaluation of quadr constr + int use_q_adj; // reuse cached value for adjoint of quadr constr + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_dense_qcqp_res_memsize(struct d_dense_qcqp_dim *dim); +// +void d_dense_qcqp_res_create(struct d_dense_qcqp_dim *dim, struct d_dense_qcqp_res *res, void *mem); +// +hpipm_size_t d_dense_qcqp_res_ws_memsize(struct d_dense_qcqp_dim *dim); +// +void d_dense_qcqp_res_ws_create(struct d_dense_qcqp_dim *dim, struct d_dense_qcqp_res_ws *workspace, void *mem); +// +void d_dense_qcqp_res_compute(struct d_dense_qcqp *qp, struct d_dense_qcqp_sol *qp_sol, struct d_dense_qcqp_res *res, struct d_dense_qcqp_res_ws *ws); +// +void d_dense_qcqp_res_compute_inf_norm(struct d_dense_qcqp_res *res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_D_DENSE_QCQP_RES_H_ + + + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_sol.h b/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_sol.h new file mode 100644 index 000000000..6c697a8e6 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_sol.h @@ -0,0 +1,85 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_D_DENSE_QCQP_SOL_H_ +#define HPIPM_D_DENSE_QCQP_SOL_H_ + + + +#include +#include + +#include "hpipm_d_dense_qcqp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_dense_qcqp_sol + { + struct d_dense_qcqp_dim *dim; + struct blasfeo_dvec *v; + struct blasfeo_dvec *pi; + struct blasfeo_dvec *lam; + struct blasfeo_dvec *t; + void *misc; + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_dense_qcqp_sol_memsize(struct d_dense_qcqp_dim *dim); +// +void d_dense_qcqp_sol_create(struct d_dense_qcqp_dim *dim, struct d_dense_qcqp_sol *qp_sol, void *memory); +// +void d_dense_qcqp_sol_get_v(struct d_dense_qcqp_sol *qp_sol, double *v); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_DENSE_QCQP_SOL_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_utils.h b/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_utils.h new file mode 100644 index 000000000..a34218bae --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_dense_qcqp_utils.h @@ -0,0 +1,82 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_DENSE_QCQP_UTILS_H_ +#define HPIPM_D_DENSE_QCQP_UTILS_H_ + + + +#include +#include + +#include "hpipm_d_dense_qcqp_dim.h" +#include "hpipm_d_dense_qcqp.h" +#include "hpipm_d_dense_qcqp_sol.h" +//#include "hpipm_d_dense_qcqp_ipm.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void d_dense_qcqp_dim_print(struct d_dense_qcqp_dim *qp_dim); +// +//void d_dense_qcqp_dim_codegen(char *file_name, char *mode, struct d_dense_qcqp_dim *qp_dim); +// +void d_dense_qcqp_print(struct d_dense_qcqp_dim *qp_dim, struct d_dense_qcqp *qp); +// +//void d_dense_qcqp_codegen(char *file_name, char *mode, struct d_dense_qcqp_dim *qp_dim, struct d_dense_qcqp *qp); +// +void d_dense_qcqp_sol_print(struct d_dense_qcqp_dim *qp_dim, struct d_dense_qcqp_sol *dense_qcqp_sol); +// +//void d_dense_qcqp_ipm_arg_codegen(char *file_name, char *mode, struct d_dense_qcqp_dim *qp_dim, struct d_dense_qcqp_ipm_arg *arg); +// +void d_dense_qcqp_res_print(struct d_dense_qcqp_dim *qp_dim, struct d_dense_qcqp_res *dense_qcqp_res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_DENSE_QCQP_UTILS_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_dense_qp.h b/third_party/acados/include/hpipm/include/hpipm_d_dense_qp.h new file mode 100644 index 000000000..02fba5a92 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_dense_qp.h @@ -0,0 +1,207 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_D_DENSE_QP_H_ +#define HPIPM_D_DENSE_QP_H_ + + + +#include +#include + +#include "hpipm_d_dense_qp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_dense_qp + { + struct d_dense_qp_dim *dim; + struct blasfeo_dmat *Hv; // hessian of cost & vector work space + struct blasfeo_dmat *A; // equality constraint matrix + struct blasfeo_dmat *Ct; // inequality constraints matrix + struct blasfeo_dvec *gz; // gradient of cost & gradient of slacks + struct blasfeo_dvec *b; // equality constraint vector + struct blasfeo_dvec *d; // inequality constraints vector + struct blasfeo_dvec *d_mask; // inequality constraints mask vector + struct blasfeo_dvec *m; // rhs of complementarity condition + struct blasfeo_dvec *Z; // (diagonal) hessian of slacks + int *idxb; // indices of box constrained variables within [u; x] + int *idxs_rev; // index of soft constraints (reverse storage) + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t d_dense_qp_memsize(struct d_dense_qp_dim *dim); +// +void d_dense_qp_create(struct d_dense_qp_dim *dim, struct d_dense_qp *qp, void *memory); + +// setters - colmaj +// +void d_dense_qp_set_all(double *H, double *g, double *A, double *b, int *idxb, double *d_lb, double *d_ub, double *C, double *d_lg, double *d_ug, double *Zl, double *Zu, double *zl, double *zu, int *idxs, double *d_ls, double *d_us, struct d_dense_qp *qp); +// +void d_dense_qp_get_all(struct d_dense_qp *qp, double *H, double *g, double *A, double *b, int *idxb, double *d_lb, double *d_ub, double *C, double *d_lg, double *d_ug, double *Zl, double *Zu, double *zl, double *zu, int *idxs, double *d_ls, double *d_us); +// +void d_dense_qp_set(char *field, void *value, struct d_dense_qp *qp); +// +void d_dense_qp_set_H(double *H, struct d_dense_qp *qp); +// +void d_dense_qp_set_g(double *g, struct d_dense_qp *qp); +// +void d_dense_qp_set_A(double *A, struct d_dense_qp *qp); +// +void d_dense_qp_set_b(double *b, struct d_dense_qp *qp); +// +void d_dense_qp_set_idxb(int *idxb, struct d_dense_qp *qp); +// +void d_dense_qp_set_Jb(double *Jb, struct d_dense_qp *qp); +// +void d_dense_qp_set_lb(double *lb, struct d_dense_qp *qp); +// +void d_dense_qp_set_lb_mask(double *lb, struct d_dense_qp *qp); +// +void d_dense_qp_set_ub(double *ub, struct d_dense_qp *qp); +// +void d_dense_qp_set_ub_mask(double *ub, struct d_dense_qp *qp); +// +void d_dense_qp_set_C(double *C, struct d_dense_qp *qp); +// +void d_dense_qp_set_lg(double *lg, struct d_dense_qp *qp); +// +void d_dense_qp_set_lg_mask(double *lg, struct d_dense_qp *qp); +// +void d_dense_qp_set_ug(double *ug, struct d_dense_qp *qp); +// +void d_dense_qp_set_ug_mask(double *ug, struct d_dense_qp *qp); +// +void d_dense_qp_set_idxs(int *idxs, struct d_dense_qp *qp); +// +void d_dense_qp_set_idxs_rev(int *idxs_rev, struct d_dense_qp *qp); +// +void d_dense_qp_set_Jsb(double *Jsb, struct d_dense_qp *qp); +// +void d_dense_qp_set_Jsg(double *Jsg, struct d_dense_qp *qp); +// +void d_dense_qp_set_Zl(double *Zl, struct d_dense_qp *qp); +// +void d_dense_qp_set_Zu(double *Zu, struct d_dense_qp *qp); +// +void d_dense_qp_set_zl(double *zl, struct d_dense_qp *qp); +// +void d_dense_qp_set_zu(double *zu, struct d_dense_qp *qp); +// +void d_dense_qp_set_ls(double *ls, struct d_dense_qp *qp); +// +void d_dense_qp_set_ls_mask(double *ls, struct d_dense_qp *qp); +// +void d_dense_qp_set_us(double *us, struct d_dense_qp *qp); +// +void d_dense_qp_set_us_mask(double *us, struct d_dense_qp *qp); + +// getters - colmaj +// +void d_dense_qp_get_H(struct d_dense_qp *qp, double *H); +// +void d_dense_qp_get_g(struct d_dense_qp *qp, double *g); +// +void d_dense_qp_get_A(struct d_dense_qp *qp, double *A); +// +void d_dense_qp_get_b(struct d_dense_qp *qp, double *b); +// +void d_dense_qp_get_idxb(struct d_dense_qp *qp, int *idxb); +// +void d_dense_qp_get_lb(struct d_dense_qp *qp, double *lb); +// +void d_dense_qp_get_lb_mask(struct d_dense_qp *qp, double *lb); +// +void d_dense_qp_get_ub(struct d_dense_qp *qp, double *ub); +// +void d_dense_qp_get_ub_mask(struct d_dense_qp *qp, double *ub); +// +void d_dense_qp_get_C(struct d_dense_qp *qp, double *C); +// +void d_dense_qp_get_lg(struct d_dense_qp *qp, double *lg); +// +void d_dense_qp_get_lg_mask(struct d_dense_qp *qp, double *lg); +// +void d_dense_qp_get_ug(struct d_dense_qp *qp, double *ug); +// +void d_dense_qp_get_ug_mask(struct d_dense_qp *qp, double *ug); +// +void d_dense_qp_get_idxs(struct d_dense_qp *qp, int *idxs); +// +void d_dense_qp_get_idxs_rev(struct d_dense_qp *qp, int *idxs_rev); +// +void d_dense_qp_get_Zl(struct d_dense_qp *qp, double *Zl); +// +void d_dense_qp_get_Zu(struct d_dense_qp *qp, double *Zu); +// +void d_dense_qp_get_zl(struct d_dense_qp *qp, double *zl); +// +void d_dense_qp_get_zu(struct d_dense_qp *qp, double *zu); +// +void d_dense_qp_get_ls(struct d_dense_qp *qp, double *ls); +// +void d_dense_qp_get_ls_mask(struct d_dense_qp *qp, double *ls); +// +void d_dense_qp_get_us(struct d_dense_qp *qp, double *us); +// +void d_dense_qp_get_us_mask(struct d_dense_qp *qp, double *us); + +// setters - rowmaj +// +void d_dense_qp_set_all_rowmaj(double *H, double *g, double *A, double *b, int *idxb, double *d_lb, double *d_ub, double *C, double *d_lg, double *d_ug, double *Zl, double *Zu, double *zl, double *zu, int *idxs, double *d_ls, double *d_us, struct d_dense_qp *qp); + +// getters - rowmaj +// +void d_dense_qp_get_all_rowmaj(struct d_dense_qp *qp, double *H, double *g, double *A, double *b, int *idxb, double *d_lb, double *d_ub, double *C, double *d_lg, double *d_ug, double *Zl, double *Zu, double *zl, double *zu, int *idxs, double *d_ls, double *d_us); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_DENSE_QP_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_dim.h b/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_dim.h new file mode 100644 index 000000000..98a551f31 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_dim.h @@ -0,0 +1,92 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_DENSE_QP_DIM_H_ +#define HPIPM_D_DENSE_QP_DIM_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_dense_qp_dim + { + int nv; // number of variables + int ne; // number of equality constraints + int nb; // number of box constraints + int ng; // number of general constraints + int nsb; // number of softened box constraints + int nsg; // number of softened general constraints + int ns; // number of softened constraints (nsb+nsg) + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_dense_qp_dim_memsize(); +// +void d_dense_qp_dim_create(struct d_dense_qp_dim *qp_dim, void *memory); +// +void d_dense_qp_dim_set_all(int nv, int ne, int nb, int ng, int nsb, int nsg, struct d_dense_qp_dim *dim); +// +void d_dense_qp_dim_set(char *field_name, int value, struct d_dense_qp_dim *dim); +// +void d_dense_qp_dim_set_nv(int value, struct d_dense_qp_dim *dim); +// +void d_dense_qp_dim_set_ne(int value, struct d_dense_qp_dim *dim); +// +void d_dense_qp_dim_set_nb(int value, struct d_dense_qp_dim *dim); +// +void d_dense_qp_dim_set_ng(int value, struct d_dense_qp_dim *dim); +// +void d_dense_qp_dim_set_nsb(int value, struct d_dense_qp_dim *dim); +// +void d_dense_qp_dim_set_nsg(int value, struct d_dense_qp_dim *dim); +// +void d_dense_qp_dim_set_ns(int value, struct d_dense_qp_dim *dim); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_DENSE_QP_DIM_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_ipm.h b/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_ipm.h new file mode 100644 index 000000000..e6e5d5d9b --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_ipm.h @@ -0,0 +1,260 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_D_DENSE_QP_IPM_H_ +#define HPIPM_D_DENSE_QP_IPM_H_ + + + +#include +#include + +#include +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_dense_qp_ipm_arg + { + double mu0; // initial value for duality measure + double alpha_min; // exit cond on step length + double res_g_max; // exit cond on inf norm of residuals + double res_b_max; // exit cond on inf norm of residuals + double res_d_max; // exit cond on inf norm of residuals + double res_m_max; // exit cond on inf norm of residuals + double reg_prim; // reg of primal hessian + double reg_dual; // reg of dual hessian + double lam_min; // min value in lam vector + double t_min; // min value in t vector + double tau_min; // min value of barrier parameter + int iter_max; // exit cond in iter number + int stat_max; // iterations saved in stat + int pred_corr; // Mehrotra's predictor-corrector IPM algirthm + int cond_pred_corr; // conditional Mehrotra's predictor-corrector + int scale; // scale hessian + int itref_pred_max; // max number of iterative refinement steps for predictor step + int itref_corr_max; // max number of iterative refinement steps for corrector step + int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol + int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq + int abs_form; // absolute IPM formulation + int comp_res_exit; // compute residuals on exit (only for abs_form==1) + int comp_res_pred; // compute residuals of prediction + int kkt_fact_alg; // 0 null-space, 1 schur-complement + int remove_lin_dep_eq; // 0 do not, 1 do check and remove linearly dependent equality constraints + int compute_obj; // compute obj on exit + int split_step; // use different steps for primal and dual variables + int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution + int mode; + hpipm_size_t memsize; + }; + + + +struct d_dense_qp_ipm_ws + { + struct d_core_qp_ipm_workspace *core_workspace; + struct d_dense_qp_res_ws *res_ws; + struct d_dense_qp_sol *sol_step; + struct d_dense_qp_sol *sol_itref; + struct d_dense_qp *qp_step; + struct d_dense_qp *qp_itref; + struct d_dense_qp_res *res; + struct d_dense_qp_res *res_itref; + struct d_dense_qp_res *res_step; + struct blasfeo_dvec *Gamma; // + struct blasfeo_dvec *gamma; // + struct blasfeo_dvec *Zs_inv; // + struct blasfeo_dmat *Lv; // + struct blasfeo_dmat *AL; // + struct blasfeo_dmat *Le; // + struct blasfeo_dmat *Ctx; // + struct blasfeo_dvec *lv; // + struct blasfeo_dvec *sv; // scale for Lv + struct blasfeo_dvec *se; // scale for Le + struct blasfeo_dvec *tmp_nbg; // work space of size nb+ng + struct blasfeo_dvec *tmp_ns; // work space of size ns + struct blasfeo_dmat *lq0; + struct blasfeo_dmat *lq1; + struct blasfeo_dvec *tmp_m; + struct blasfeo_dmat *A_LQ; + struct blasfeo_dmat *A_Q; + struct blasfeo_dmat *Zt; + struct blasfeo_dmat *ZtH; + struct blasfeo_dmat *ZtHZ; + struct blasfeo_dvec *xy; + struct blasfeo_dvec *Yxy; + struct blasfeo_dvec *xz; + struct blasfeo_dvec *tmp_nv; + struct blasfeo_dvec *tmp_2ns; + struct blasfeo_dvec *tmp_nv2ns; + struct blasfeo_dmat *A_li; // A of linearly independent equality constraints + struct blasfeo_dvec *b_li; // b of linearly independent equality constraints + struct blasfeo_dmat *A_bkp; // pointer to backup A + struct blasfeo_dvec *b_bkp; // pointer to backup b + struct blasfeo_dmat *Ab_LU; + double *stat; // convergence statistics + int *ipiv_v; + int *ipiv_e; + int *ipiv_e1; + void *lq_work0; + void *lq_work1; + void *lq_work_null; + void *orglq_work_null; + int iter; // iteration number + int stat_max; // iterations saved in stat + int stat_m; // numer of recorded stat per ipm iter + int scale; + int use_hess_fact; + int use_A_fact; + int status; + int lq_fact; // cache from arg + int mask_constr; // use constr mask + int ne_li; // number of linearly independent equality constraints + int ne_bkp; // ne backup + hpipm_size_t memsize; // memory size (in bytes) of workspace + }; + + + +// +hpipm_size_t d_dense_qp_ipm_arg_memsize(struct d_dense_qp_dim *dim); +// +void d_dense_qp_ipm_arg_create(struct d_dense_qp_dim *dim, struct d_dense_qp_ipm_arg *arg, void *mem); +// +void d_dense_qp_ipm_arg_set_default(enum hpipm_mode mode, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set(char *field, void *value, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_iter_max(int *iter_max, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_alpha_min(double *alpha_min, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_mu0(double *mu0, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_tol_stat(double *tol_stat, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_tol_eq(double *tol_eq, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_tol_ineq(double *tol_ineq, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_tol_comp(double *tol_comp, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_reg_prim(double *reg, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_reg_dual(double *reg, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_warm_start(int *warm_start, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_pred_corr(int *pred_corr, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_cond_pred_corr(int *cond_pred_corr, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_comp_res_pred(int *comp_res_pred, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_comp_res_exit(int *comp_res_exit, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_lam_min(double *value, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_t_min(double *value, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_tau_min(double *value, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_kkt_fact_alg(int *value, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_remove_lin_dep_eq(int *value, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_compute_obj(int *value, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_arg_set_t_lam_min(int *value, struct d_dense_qp_ipm_arg *arg); + +// +void d_dense_qp_ipm_arg_set_split_step(int *value, struct d_dense_qp_ipm_arg *arg); + +// +hpipm_size_t d_dense_qp_ipm_ws_memsize(struct d_dense_qp_dim *qp_dim, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_ipm_ws_create(struct d_dense_qp_dim *qp_dim, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws, void *mem); +// +void d_dense_qp_ipm_get(char *field, struct d_dense_qp_ipm_ws *ws, void *value); +// +void d_dense_qp_ipm_get_status(struct d_dense_qp_ipm_ws *ws, int *status); +// +void d_dense_qp_ipm_get_iter(struct d_dense_qp_ipm_ws *ws, int *iter); +// +void d_dense_qp_ipm_get_max_res_stat(struct d_dense_qp_ipm_ws *ws, double *res_stat); +// +void d_dense_qp_ipm_get_max_res_eq(struct d_dense_qp_ipm_ws *ws, double *res_eq); +// +void d_dense_qp_ipm_get_max_res_ineq(struct d_dense_qp_ipm_ws *ws, double *res_ineq); +// +void d_dense_qp_ipm_get_max_res_comp(struct d_dense_qp_ipm_ws *ws, double *res_comp); +// +void d_dense_qp_ipm_get_stat(struct d_dense_qp_ipm_ws *ws, double **stat); +// +void d_dense_qp_ipm_get_stat_m(struct d_dense_qp_ipm_ws *ws, int *stat_m); +// +void d_dense_qp_init_var(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws); +// +void d_dense_qp_ipm_abs_step(int kk, struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws); +// +void d_dense_qp_ipm_delta_step(int kk, struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws); +// +void d_dense_qp_ipm_solve(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws); +// +void d_dense_qp_ipm_predict(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws); +// +void d_dense_qp_ipm_sens(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws); +// +void d_dense_qp_compute_step_length(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_DENSE_QP_IPM_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_kkt.h b/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_kkt.h new file mode 100644 index 000000000..6d05779f4 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_kkt.h @@ -0,0 +1,72 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_D_DENSE_QP_KKT_H_ +#define HPIPM_D_DENSE_QP_KKT_H_ + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void d_fact_solve_kkt_unconstr_dense_qp(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws); +// +void d_fact_solve_kkt_step_dense_qp(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws); +// +void d_fact_lq_solve_kkt_step_dense_qp(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws); +// +void d_solve_kkt_step_dense_qp(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws); +// +void d_dense_qp_remove_lin_dep_eq(struct d_dense_qp *qp, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws); +// +void d_dense_qp_restore_lin_dep_eq(struct d_dense_qp *qp, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws); +// +void d_dense_qp_compute_obj(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_DENSE_QP_KKT_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_res.h b/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_res.h new file mode 100644 index 000000000..7c2023257 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_res.h @@ -0,0 +1,105 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_DENSE_QP_RES_H_ +#define HPIPM_D_DENSE_QP_RES_H_ + + + +#include +#include + +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_dense_qp_res + { + struct d_dense_qp_dim *dim; + struct blasfeo_dvec *res_g; // q-residuals + struct blasfeo_dvec *res_b; // b-residuals + struct blasfeo_dvec *res_d; // d-residuals + struct blasfeo_dvec *res_m; // m-residuals + double res_max[4]; // max of residuals + double res_mu; // mu-residual + hpipm_size_t memsize; + }; + + + +struct d_dense_qp_res_ws + { + struct blasfeo_dvec *tmp_nbg; // work space of size nbM+ngM + struct blasfeo_dvec *tmp_ns; // work space of size nsM + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_dense_qp_res_memsize(struct d_dense_qp_dim *dim); +// +void d_dense_qp_res_create(struct d_dense_qp_dim *dim, struct d_dense_qp_res *res, void *mem); +// +hpipm_size_t d_dense_qp_res_ws_memsize(struct d_dense_qp_dim *dim); +// +void d_dense_qp_res_ws_create(struct d_dense_qp_dim *dim, struct d_dense_qp_res_ws *workspace, void *mem); +// +void d_dense_qp_res_compute(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_res *res, struct d_dense_qp_res_ws *ws); +// +void d_dense_qp_res_compute_lin(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_sol *qp_step, struct d_dense_qp_res *res, struct d_dense_qp_res_ws *ws); +// +void d_dense_qp_res_compute_inf_norm(struct d_dense_qp_res *res); +// +void d_dense_qp_res_get_all(struct d_dense_qp_res *res, double *res_g, double *res_ls, double *res_us, double *res_b, double *res_d_lb, double *res_d_ub, double *res_d_lg, double *res_d_ug, double *res_d_ls, double *res_d_us, double *res_m_lb, double *res_m_ub, double *res_m_lg, double *res_m_ug, double *res_m_ls, double *res_m_us); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_D_DENSE_QP_RES_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_sol.h b/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_sol.h new file mode 100644 index 000000000..aaa3fdb0e --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_sol.h @@ -0,0 +1,94 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_D_DENSE_QP_SOL_H_ +#define HPIPM_D_DENSE_QP_SOL_H_ + + + +#include +#include + +#include "hpipm_d_dense_qp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_dense_qp_sol + { + struct d_dense_qp_dim *dim; + struct blasfeo_dvec *v; + struct blasfeo_dvec *pi; + struct blasfeo_dvec *lam; + struct blasfeo_dvec *t; + void *misc; + double obj; + int valid_obj; + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_dense_qp_sol_memsize(struct d_dense_qp_dim *dim); +// +void d_dense_qp_sol_create(struct d_dense_qp_dim *dim, struct d_dense_qp_sol *qp_sol, void *memory); +// +void d_dense_qp_sol_get_all(struct d_dense_qp_sol *qp_sol, double *v, double *ls, double *us, double *pi, double *lam_lb, double *lam_ub, double *lam_lg, double *lam_ug, double *lam_ls, double *lam_us); +// +void d_dense_qp_sol_get(char *field, struct d_dense_qp_sol *sol, void *value); +// +void d_dense_qp_sol_get_v(struct d_dense_qp_sol *sol, double *v); +// +void d_dense_qp_sol_get_valid_obj(struct d_dense_qp_sol *sol, int *valid_obj); +// +void d_dense_qp_sol_get_obj(struct d_dense_qp_sol *sol, double *obj); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_DENSE_QP_SOL_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_utils.h b/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_utils.h new file mode 100644 index 000000000..ccb77aaca --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_dense_qp_utils.h @@ -0,0 +1,83 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_DENSE_QP_UTILS_H_ +#define HPIPM_D_DENSE_QP_UTILS_H_ + + + +#include +#include + +#include "hpipm_d_dense_qp_dim.h" +#include "hpipm_d_dense_qp.h" +#include "hpipm_d_dense_qp_sol.h" +#include "hpipm_d_dense_qp_ipm.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void d_dense_qp_dim_print(struct d_dense_qp_dim *qp_dim); +// +//void d_dense_qp_dim_codegen(char *file_name, char *mode, struct d_dense_qp_dim *qp_dim); +// +void d_dense_qp_print(struct d_dense_qp_dim *qp_dim, struct d_dense_qp *qp); +// +//void d_dense_qp_codegen(char *file_name, char *mode, struct d_dense_qp_dim *qp_dim, struct d_dense_qp *qp); +// +void d_dense_qp_sol_print(struct d_dense_qp_dim *qp_dim, struct d_dense_qp_sol *dense_qp_sol); +// +//void d_dense_qp_ipm_arg_codegen(char *file_name, char *mode, struct d_dense_qp_dim *qp_dim, struct d_dense_qp_ipm_arg *arg); +// +void d_dense_qp_res_print(struct d_dense_qp_dim *qp_dim, struct d_dense_qp_res *dense_qp_res); +// +void d_dense_qp_arg_print(struct d_dense_qp_dim *qp_dim, struct d_dense_qp_ipm_arg *qp_ipm_arg); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_DENSE_QP_UTILS_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp.h b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp.h new file mode 100644 index 000000000..240c9b04b --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp.h @@ -0,0 +1,303 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_OCP_QCQP_H_ +#define HPIPM_D_OCP_QCQP_H_ + + + +#include +#include + +#include "hpipm_d_ocp_qcqp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_ocp_qcqp + { + struct d_ocp_qcqp_dim *dim; + struct blasfeo_dmat *BAbt; // dynamics matrix & vector work space + struct blasfeo_dmat *RSQrq; // hessian of cost & vector work space + struct blasfeo_dmat *DCt; // inequality constraints matrix + struct blasfeo_dmat **Hq; // hessians of quadratic constraints + struct blasfeo_dvec *b; // dynamics vector + struct blasfeo_dvec *rqz; // gradient of cost & gradient of slacks + struct blasfeo_dvec *d; // inequality constraints vector + struct blasfeo_dvec *d_mask; // inequality constraints mask vector + struct blasfeo_dvec *m; // rhs of complementarity condition + struct blasfeo_dvec *Z; // (diagonal) hessian of slacks + int **idxb; // indices of box constrained variables within [u; x] + int **idxs_rev; // index of soft constraints (reverse storage) + int **Hq_nzero; // for each int, the last 3 bits ...abc, {a,b,c}=0 => {R,S,Q}=0 + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t d_ocp_qcqp_strsize(); +// +hpipm_size_t d_ocp_qcqp_memsize(struct d_ocp_qcqp_dim *dim); +// +void d_ocp_qcqp_create(struct d_ocp_qcqp_dim *dim, struct d_ocp_qcqp *qp, void *memory); +// +void d_ocp_qcqp_copy_all(struct d_ocp_qcqp *qp_orig, struct d_ocp_qcqp *qp_dest); + +// setters +// +void d_ocp_qcqp_set_all_zero(struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_rhs_zero(struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set(char *field_name, int stage, void *value, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_el(char *field_name, int stage, int index, void *value, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_A(int stage, double *mat, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_B(int stage, double *mat, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_b(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_Q(int stage, double *mat, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_S(int stage, double *mat, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_R(int stage, double *mat, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_q(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_r(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_lb(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_lb_mask(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_ub(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_ub_mask(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_lbx(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_lbx_mask(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_el_lbx(int stage, int index, double *elem, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_ubx(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_ubx_mask(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_el_ubx(int stage, int index, double *elem, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_lbu(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_lbu_mask(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_ubu(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_ubu_mask(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_idxb(int stage, int *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_idxbx(int stage, int *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_Jbx(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_idxbu(int stage, int *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_Jbu(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_C(int stage, double *mat, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_D(int stage, double *mat, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_lg(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_lg_mask(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_ug(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_ug_mask(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_Qq(int stage, double *mat, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_Sq(int stage, double *mat, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_Rq(int stage, double *mat, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_qq(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_rq(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_uq(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_uq_mask(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_Zl(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_Zu(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_zl(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_zu(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_lls(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_lls_mask(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_lus(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_lus_mask(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_idxs(int stage, int *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_idxs_rev(int stage, int *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_Jsbu(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_Jsbx(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_Jsg(int stage, double *vec, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_set_Jsq(int stage, double *vec, struct d_ocp_qcqp *qp); + +// getters +// +void d_ocp_qcqp_get(char *field, int stage, struct d_ocp_qcqp *qp, void *value); +// +void d_ocp_qcqp_get_A(int stage, struct d_ocp_qcqp *qp, double *mat); +// +void d_ocp_qcqp_get_B(int stage, struct d_ocp_qcqp *qp, double *mat); +// +void d_ocp_qcqp_get_b(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_Q(int stage, struct d_ocp_qcqp *qp, double *mat); +// +void d_ocp_qcqp_get_S(int stage, struct d_ocp_qcqp *qp, double *mat); +// +void d_ocp_qcqp_get_R(int stage, struct d_ocp_qcqp *qp, double *mat); +// +void d_ocp_qcqp_get_q(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_r(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_ub(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_ub_mask(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_lb(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_lb_mask(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_lbx(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_lbx_mask(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_ubx(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_ubx_mask(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_lbu(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_lbu_mask(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_ubu(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_ubu_mask(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_idxb(int stage, struct d_ocp_qcqp *qp, int *vec); +// +//void d_ocp_qcqp_get_idxbx(int stage, struct d_ocp_qcqp *qp, int *vec); +// +//void d_ocp_qcqp_get_Jbx(int stage, struct d_ocp_qcqp *qp, double *vec); +// +//void d_ocp_qcqp_get_idxbu(int stage, struct d_ocp_qcqp *qp, int *vec); +// +//void d_ocp_qcqp_get_Jbu(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_C(int stage, struct d_ocp_qcqp *qp, double *mat); +// +void d_ocp_qcqp_get_D(int stage, struct d_ocp_qcqp *qp, double *mat); +// +void d_ocp_qcqp_get_lg(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_lg_mask(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_ug(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_ug_mask(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_Zl(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_Zu(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_zl(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_zu(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_lls(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_lls_mask(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_lus(int stage, struct d_ocp_qcqp *qp, double *vec); +// +void d_ocp_qcqp_get_lus_mask(int stage, struct d_ocp_qcqp *qp, double *vec); +// XXX only valid if there is one slack per softed constraint !!! +void d_ocp_qcqp_get_idxs(int stage, struct d_ocp_qcqp *qp, int *vec); +// +void d_ocp_qcqp_get_idxs_rev(int stage, struct d_ocp_qcqp *qp, int *vec); +// +//void d_ocp_qcqp_get_Jsbu(int stage, struct d_ocp_qcqp *qp, float *vec); +// +//void d_ocp_qcqp_get_Jsbx(int stage, struct d_ocp_qcqp *qp, float *vec); +// +//void d_ocp_qcqp_get_Jsg(int stage, struct d_ocp_qcqp *qp, float *vec); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_OCP_QCQP_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_dim.h b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_dim.h new file mode 100644 index 000000000..268628a2b --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_dim.h @@ -0,0 +1,118 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_OCP_QCQP_DIM_H_ +#define HPIPM_D_OCP_QCQP_DIM_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_ocp_qcqp_dim + { + struct d_ocp_qp_dim *qp_dim; // dim of qp approximation + int *nx; // number of states + int *nu; // number of inputs + int *nb; // number of box constraints + int *nbx; // number of (two-sided) state box constraints + int *nbu; // number of (two-sided) input box constraints + int *ng; // number of (two-sided) general constraints + int *nq; // number of (upper) quadratic constraints + int *ns; // number of soft constraints + int *nsbx; // number of (two-sided) soft state box constraints + int *nsbu; // number of (two-sided) soft input box constraints + int *nsg; // number of (two-sided) soft general constraints + int *nsq; // number of (upper) soft quadratic constraints + int N; // horizon length + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_ocp_qcqp_dim_strsize(); +// +hpipm_size_t d_ocp_qcqp_dim_memsize(int N); +// +void d_ocp_qcqp_dim_create(int N, struct d_ocp_qcqp_dim *qp_dim, void *memory); +// +void d_ocp_qcqp_dim_copy_all(struct d_ocp_qcqp_dim *dim_orig, struct d_ocp_qcqp_dim *dim_dest); +// +void d_ocp_qcqp_dim_set(char *field, int stage, int value, struct d_ocp_qcqp_dim *dim); +// +void d_ocp_qcqp_dim_set_nx(int stage, int value, struct d_ocp_qcqp_dim *dim); +// +void d_ocp_qcqp_dim_set_nu(int stage, int value, struct d_ocp_qcqp_dim *dim); +// +void d_ocp_qcqp_dim_set_nbx(int stage, int value, struct d_ocp_qcqp_dim *dim); +// +void d_ocp_qcqp_dim_set_nbu(int stage, int value, struct d_ocp_qcqp_dim *dim); +// +void d_ocp_qcqp_dim_set_ng(int stage, int value, struct d_ocp_qcqp_dim *dim); +// +void d_ocp_qcqp_dim_set_nq(int stage, int value, struct d_ocp_qcqp_dim *dim); +// +void d_ocp_qcqp_dim_set_ns(int stage, int value, struct d_ocp_qcqp_dim *dim); +// +void d_ocp_qcqp_dim_set_nsbx(int stage, int value, struct d_ocp_qcqp_dim *dim); +// +void d_ocp_qcqp_dim_set_nsbu(int stage, int value, struct d_ocp_qcqp_dim *dim); +// +void d_ocp_qcqp_dim_set_nsg(int stage, int value, struct d_ocp_qcqp_dim *dim); +// +void d_ocp_qcqp_dim_set_nsq(int stage, int value, struct d_ocp_qcqp_dim *dim); +// +void d_ocp_qcqp_dim_get(struct d_ocp_qcqp_dim *dim, char *field, int stage, int *value); +// +void d_ocp_qcqp_dim_get_N(struct d_ocp_qcqp_dim *dim, int *value); +// +void d_ocp_qcqp_dim_get_nx(struct d_ocp_qcqp_dim *dim, int stage, int *value); +// +void d_ocp_qcqp_dim_get_nu(struct d_ocp_qcqp_dim *dim, int stage, int *value); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_OCP_QCQP_DIM_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_ipm.h b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_ipm.h new file mode 100644 index 000000000..99f2329dc --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_ipm.h @@ -0,0 +1,190 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_OCP_QCQP_IPM_H_ +#define HPIPM_D_OCP_QCQP_IPM_H_ + + + +#include +#include + +#include +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_ocp_qcqp_ipm_arg + { + struct d_ocp_qp_ipm_arg *qp_arg; + double mu0; // initial value for complementarity slackness + double alpha_min; // exit cond on step length + double res_g_max; // exit cond on inf norm of residuals + double res_b_max; // exit cond on inf norm of residuals + double res_d_max; // exit cond on inf norm of residuals + double res_m_max; // exit cond on inf norm of residuals + double reg_prim; // reg of primal hessian + double lam_min; // min value in lam vector + double t_min; // min value in t vector + int iter_max; // exit cond in iter number + int stat_max; // iterations saved in stat + int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm + int cond_pred_corr; // conditional Mehrotra's predictor-corrector + int itref_pred_max; // max number of iterative refinement steps for predictor step + int itref_corr_max; // max number of iterative refinement steps for corrector step + int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol + int square_root_alg; // 0 classical Riccati, 1 square-root Riccati + int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq (for square_root_alg==1) + int abs_form; // absolute IPM formulation + int comp_dual_sol_eq; // dual solution of equality constrains (only for abs_form==1) + int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol_eq==1) + int comp_res_pred; // compute residuals of prediction + int split_step; // use different step for primal and dual variables + int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution + int mode; + hpipm_size_t memsize; + }; + + + +struct d_ocp_qcqp_ipm_ws + { + struct d_ocp_qp_ipm_ws *qp_ws; + struct d_ocp_qp *qp; + struct d_ocp_qp_sol *qp_sol; + struct d_ocp_qcqp_res_ws *qcqp_res_ws; + struct d_ocp_qcqp_res *qcqp_res; + struct blasfeo_dvec *tmp_nuxM; + int iter; // iteration number + int status; + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_ocp_qcqp_ipm_arg_strsize(); +// +hpipm_size_t d_ocp_qcqp_ipm_arg_memsize(struct d_ocp_qcqp_dim *ocp_dim); +// +void d_ocp_qcqp_ipm_arg_create(struct d_ocp_qcqp_dim *ocp_dim, struct d_ocp_qcqp_ipm_arg *arg, void *mem); +// +void d_ocp_qcqp_ipm_arg_set_default(enum hpipm_mode mode, struct d_ocp_qcqp_ipm_arg *arg); +// +void d_ocp_qcqp_ipm_arg_set(char *field, void *value, struct d_ocp_qcqp_ipm_arg *arg); +// set maximum number of iterations +void d_ocp_qcqp_ipm_arg_set_iter_max(int *value, struct d_ocp_qcqp_ipm_arg *arg); +// set minimum step lenght +void d_ocp_qcqp_ipm_arg_set_alpha_min(double *value, struct d_ocp_qcqp_ipm_arg *arg); +// set initial value of barrier parameter +void d_ocp_qcqp_ipm_arg_set_mu0(double *value, struct d_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on stationarity condition +void d_ocp_qcqp_ipm_arg_set_tol_stat(double *value, struct d_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on equality constr +void d_ocp_qcqp_ipm_arg_set_tol_eq(double *value, struct d_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on inequality constr +void d_ocp_qcqp_ipm_arg_set_tol_ineq(double *value, struct d_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on complementarity condition +void d_ocp_qcqp_ipm_arg_set_tol_comp(double *value, struct d_ocp_qcqp_ipm_arg *arg); +// set regularization of primal variables +void d_ocp_qcqp_ipm_arg_set_reg_prim(double *value, struct d_ocp_qcqp_ipm_arg *arg); +// set warm start: 0 no warm start, 1 primal var +void d_ocp_qcqp_ipm_arg_set_warm_start(int *value, struct d_ocp_qcqp_ipm_arg *arg); +// Mehrotra's predictor-corrector IPM algorithm: 0 no predictor-corrector, 1 use predictor-corrector +void d_ocp_qcqp_ipm_arg_set_pred_corr(int *value, struct d_ocp_qcqp_ipm_arg *arg); +// conditional predictor-corrector: 0 no conditinal predictor-corrector, 1 conditional predictor-corrector +void d_ocp_qcqp_ipm_arg_set_cond_pred_corr(int *value, struct d_ocp_qcqp_ipm_arg *arg); +// set riccati algorithm: 0 classic, 1 square-root +void d_ocp_qcqp_ipm_arg_set_ric_alg(int *value, struct d_ocp_qcqp_ipm_arg *arg); +// compute residuals after solution +void d_ocp_qcqp_ipm_arg_set_comp_res_exit(int *value, struct d_ocp_qcqp_ipm_arg *arg); +// compute residuals of prediction +void d_ocp_qcqp_ipm_arg_set_comp_res_pred(int *value, struct d_ocp_qcqp_ipm_arg *arg); +// min value of lam in the solution +void d_ocp_qcqp_ipm_arg_set_lam_min(double *value, struct d_ocp_qcqp_ipm_arg *arg); +// min value of t in the solution +void d_ocp_qcqp_ipm_arg_set_t_min(double *value, struct d_ocp_qcqp_ipm_arg *arg); +// use different step for primal and dual variables +void d_ocp_qcqp_ipm_arg_set_split_step(int *value, struct d_ocp_qcqp_ipm_arg *arg); +// clip t and lam: 0 no, 1 in Gamma computation, 2 in solution +void d_ocp_qcqp_ipm_arg_set_t_lam_min(int *value, struct d_ocp_qcqp_ipm_arg *arg); + +// +hpipm_size_t d_ocp_qcqp_ipm_ws_strsize(); +// +hpipm_size_t d_ocp_qcqp_ipm_ws_memsize(struct d_ocp_qcqp_dim *ocp_dim, struct d_ocp_qcqp_ipm_arg *arg); +// +void d_ocp_qcqp_ipm_ws_create(struct d_ocp_qcqp_dim *ocp_dim, struct d_ocp_qcqp_ipm_arg *arg, struct d_ocp_qcqp_ipm_ws *ws, void *mem); +// +void d_ocp_qcqp_ipm_get(char *field, struct d_ocp_qcqp_ipm_ws *ws, void *value); +// +void d_ocp_qcqp_ipm_get_status(struct d_ocp_qcqp_ipm_ws *ws, int *status); +// +void d_ocp_qcqp_ipm_get_iter(struct d_ocp_qcqp_ipm_ws *ws, int *iter); +// +void d_ocp_qcqp_ipm_get_max_res_stat(struct d_ocp_qcqp_ipm_ws *ws, double *res_stat); +// +void d_ocp_qcqp_ipm_get_max_res_eq(struct d_ocp_qcqp_ipm_ws *ws, double *res_eq); +// +void d_ocp_qcqp_ipm_get_max_res_ineq(struct d_ocp_qcqp_ipm_ws *ws, double *res_ineq); +// +void d_ocp_qcqp_ipm_get_max_res_comp(struct d_ocp_qcqp_ipm_ws *ws, double *res_comp); +// +void d_ocp_qcqp_ipm_get_stat(struct d_ocp_qcqp_ipm_ws *ws, double **stat); +// +void d_ocp_qcqp_ipm_get_stat_m(struct d_ocp_qcqp_ipm_ws *ws, int *stat_m); +// +void d_ocp_qcqp_init_var(struct d_ocp_qcqp *qp, struct d_ocp_qcqp_sol *qp_sol, struct d_ocp_qcqp_ipm_arg *arg, struct d_ocp_qcqp_ipm_ws *ws); +// +void d_ocp_qcqp_ipm_solve(struct d_ocp_qcqp *qp, struct d_ocp_qcqp_sol *qp_sol, struct d_ocp_qcqp_ipm_arg *arg, struct d_ocp_qcqp_ipm_ws *ws); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_D_OCP_QCQP_IPM_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_res.h b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_res.h new file mode 100644 index 000000000..077f13467 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_res.h @@ -0,0 +1,114 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_OCP_QCQP_RES_H_ +#define HPIPM_D_OCP_QCQP_RES_H_ + + + +#include +#include + +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_ocp_qcqp_res + { + struct d_ocp_qcqp_dim *dim; + struct blasfeo_dvec *res_g; // q-residuals + struct blasfeo_dvec *res_b; // b-residuals + struct blasfeo_dvec *res_d; // d-residuals + struct blasfeo_dvec *res_m; // m-residuals + double res_max[4]; // max of residuals + double res_mu; // mu-residual + hpipm_size_t memsize; + }; + + + +struct d_ocp_qcqp_res_ws + { + struct blasfeo_dvec *tmp_nuxM; // work space of size nuM+nxM + struct blasfeo_dvec *tmp_nbgqM; // work space of size nbM+ngM+nqM + struct blasfeo_dvec *tmp_nsM; // work space of size nsM + struct blasfeo_dvec *q_fun; // value for evaluation of quadr constr + struct blasfeo_dvec *q_adj; // value for adjoint of quadr constr + int use_q_fun; // reuse cached value for evaluation of quadr constr + int use_q_adj; // reuse cached value for adjoint of quadr constr + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_ocp_qcqp_res_memsize(struct d_ocp_qcqp_dim *ocp_dim); +// +void d_ocp_qcqp_res_create(struct d_ocp_qcqp_dim *ocp_dim, struct d_ocp_qcqp_res *res, void *mem); +// +hpipm_size_t d_ocp_qcqp_res_ws_memsize(struct d_ocp_qcqp_dim *ocp_dim); +// +void d_ocp_qcqp_res_ws_create(struct d_ocp_qcqp_dim *ocp_dim, struct d_ocp_qcqp_res_ws *workspace, void *mem); +// +void d_ocp_qcqp_res_compute(struct d_ocp_qcqp *qp, struct d_ocp_qcqp_sol *qp_sol, struct d_ocp_qcqp_res *res, struct d_ocp_qcqp_res_ws *ws); +// +void d_ocp_qcqp_res_compute_inf_norm(struct d_ocp_qcqp_res *res); +// +void d_ocp_qcqp_res_get_max_res_stat(struct d_ocp_qcqp_res *res, double *value); +// +void d_ocp_qcqp_res_get_max_res_eq(struct d_ocp_qcqp_res *res, double *value); +// +void d_ocp_qcqp_res_get_max_res_ineq(struct d_ocp_qcqp_res *res, double *value); +// +void d_ocp_qcqp_res_get_max_res_comp(struct d_ocp_qcqp_res *res, double *value); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_D_OCP_QCQP_RES_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_sol.h b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_sol.h new file mode 100644 index 000000000..68adbfce2 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_sol.h @@ -0,0 +1,114 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_OCP_QCQP_SOL_H_ +#define HPIPM_D_OCP_QCQP_SOL_H_ + + + +#include +#include + +#include "hpipm_d_ocp_qcqp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_ocp_qcqp_sol + { + struct d_ocp_qcqp_dim *dim; + struct blasfeo_dvec *ux; + struct blasfeo_dvec *pi; + struct blasfeo_dvec *lam; + struct blasfeo_dvec *t; + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t d_ocp_qcqp_sol_strsize(); +// +hpipm_size_t d_ocp_qcqp_sol_memsize(struct d_ocp_qcqp_dim *dim); +// +void d_ocp_qcqp_sol_create(struct d_ocp_qcqp_dim *dim, struct d_ocp_qcqp_sol *qp_sol, void *memory); +// +void d_ocp_qcqp_sol_copy_all(struct d_ocp_qcqp_sol *qp_sol_orig, struct d_ocp_qcqp_sol *qp_sol_dest); +// +void d_ocp_qcqp_sol_get(char *field, int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_ocp_qcqp_sol_get_u(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_ocp_qcqp_sol_get_x(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_ocp_qcqp_sol_get_sl(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_ocp_qcqp_sol_get_su(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_ocp_qcqp_sol_get_pi(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_ocp_qcqp_sol_get_lam_lb(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_ocp_qcqp_sol_get_lam_ub(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_ocp_qcqp_sol_get_lam_lg(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_ocp_qcqp_sol_get_lam_ug(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_ocp_qcqp_sol_set(char *field, int stage, double *vec, struct d_ocp_qcqp_sol *qp_sol); +// +void d_ocp_qcqp_sol_set_u(int stage, double *vec, struct d_ocp_qcqp_sol *qp_sol); +// +void d_ocp_qcqp_sol_set_x(int stage, double *vec, struct d_ocp_qcqp_sol *qp_sol); +// +void d_ocp_qcqp_sol_set_sl(int stage, double *vec, struct d_ocp_qcqp_sol *qp_sol); +// +void d_ocp_qcqp_sol_set_su(int stage, double *vec, struct d_ocp_qcqp_sol *qp_sol); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_OCP_QCQP_SOL_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_utils.h b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_utils.h new file mode 100644 index 000000000..00248f1db --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qcqp_utils.h @@ -0,0 +1,81 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_OCP_QCQP_UTILS_H_ +#define HPIPM_D_OCP_QCQP_UTILS_H_ + + + +#include +#include + +#include "hpipm_d_ocp_qcqp_dim.h" +#include "hpipm_d_ocp_qp.h" +#include "hpipm_d_ocp_qcqp_sol.h" +#include "hpipm_d_ocp_qcqp_ipm.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void d_ocp_qcqp_dim_print(struct d_ocp_qcqp_dim *qcqp_dim); +// +void d_ocp_qcqp_dim_codegen(char *file_name, char *mode, struct d_ocp_qcqp_dim *qcqp_dim); +// +void d_ocp_qcqp_print(struct d_ocp_qcqp_dim *qcqp_dim, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_codegen(char *file_name, char *mode, struct d_ocp_qcqp_dim *qcqp_dim, struct d_ocp_qcqp *qp); +// +void d_ocp_qcqp_sol_print(struct d_ocp_qcqp_dim *qcqp_dim, struct d_ocp_qcqp_sol *ocp_qcqp_sol); +// +void d_ocp_qcqp_ipm_arg_codegen(char *file_name, char *mode, struct d_ocp_qcqp_dim *qcqp_dim, struct d_ocp_qcqp_ipm_arg *arg); +// +void d_ocp_qcqp_res_print(struct d_ocp_qcqp_dim *qcqp_dim, struct d_ocp_qcqp_res *ocp_qcqp_res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_OCP_QCQP_UTILS_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp.h b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp.h new file mode 100644 index 000000000..ca26cdba3 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp.h @@ -0,0 +1,306 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_OCP_QP_H_ +#define HPIPM_D_OCP_QP_H_ + + + +#include +#include + +#include "hpipm_d_ocp_qp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_ocp_qp + { + struct d_ocp_qp_dim *dim; + struct blasfeo_dmat *BAbt; // dynamics matrix & vector work space + struct blasfeo_dmat *RSQrq; // hessian of cost & vector work space + struct blasfeo_dmat *DCt; // inequality constraints matrix + struct blasfeo_dvec *b; // dynamics vector + struct blasfeo_dvec *rqz; // gradient of cost & gradient of slacks + struct blasfeo_dvec *d; // inequality constraints vector + struct blasfeo_dvec *d_mask; // inequality constraints mask vector + struct blasfeo_dvec *m; // rhs of complementarity condition + struct blasfeo_dvec *Z; // (diagonal) hessian of slacks + int **idxb; // indices of box constrained variables within [u; x] + int **idxs_rev; // index of soft constraints (reverse storage) + int **idxe; // indices of constraints within [bu, bx, g] that are equalities, subset of [0, ..., nbu+nbx+ng-1] + int *diag_H_flag; // flag the fact that Hessian is diagonal + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t d_ocp_qp_strsize(); +// +hpipm_size_t d_ocp_qp_memsize(struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_create(struct d_ocp_qp_dim *dim, struct d_ocp_qp *qp, void *memory); +// +void d_ocp_qp_copy_all(struct d_ocp_qp *qp_orig, struct d_ocp_qp *qp_dest); + +// setters +// +void d_ocp_qp_set_all_zero(struct d_ocp_qp *qp); +// +void d_ocp_qp_set_rhs_zero(struct d_ocp_qp *qp); +// +void d_ocp_qp_set_all(double **A, double **B, double **b, double **Q, double **S, double **R, double **q, double **r, int **idxbx, double **lbx, double **ubx, int **idxbu, double **lbu, double **ubu, double **C, double **D, double **lg, double **ug, double **Zl, double **Zu, double **zl, double **zu, int **idxs, double **ls, double **us, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_all_rowmaj(double **A, double **B, double **b, double **Q, double **S, double **R, double **q, double **r, int **idxbx, double **lbx, double **ubx, int **idxbu, double **lbu, double **ubu, double **C, double **D, double **lg, double **ug, double **Zl, double **Zu, double **zl, double **zu, int **idxs, double **ls, double **us, struct d_ocp_qp *qp); +// +void d_ocp_qp_set(char *field_name, int stage, void *value, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_el(char *field_name, int stage, int index, void *value, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_A(int stage, double *mat, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_B(int stage, double *mat, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_b(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_Q(int stage, double *mat, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_S(int stage, double *mat, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_R(int stage, double *mat, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_q(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_r(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_lb(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_lb_mask(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_ub(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_ub_mask(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_lbx(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_lbx_mask(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_el_lbx(int stage, int index, double *elem, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_ubx(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_ubx_mask(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_el_ubx(int stage, int index, double *elem, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_lbu(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_lbu_mask(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_ubu(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_ubu_mask(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_idxb(int stage, int *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_idxbx(int stage, int *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_Jbx(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_idxbu(int stage, int *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_Jbu(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_C(int stage, double *mat, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_D(int stage, double *mat, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_lg(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_lg_mask(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_ug(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_ug_mask(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_Zl(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_Zu(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_zl(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_zu(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_lls(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_lls_mask(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_lus(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_lus_mask(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_idxs(int stage, int *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_idxs_rev(int stage, int *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_Jsbu(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_Jsbx(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_Jsg(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_idxe(int stage, int *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_idxbxe(int stage, int *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_idxbue(int stage, int *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_idxge(int stage, int *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_Jbxe(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_Jbue(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_Jge(int stage, double *vec, struct d_ocp_qp *qp); +// +void d_ocp_qp_set_diag_H_flag(int stage, int *value, struct d_ocp_qp *qp); + +// getters +// +void d_ocp_qp_get(char *field, int stage, struct d_ocp_qp *qp, void *value); +// +void d_ocp_qp_get_A(int stage, struct d_ocp_qp *qp, double *mat); +// +void d_ocp_qp_get_B(int stage, struct d_ocp_qp *qp, double *mat); +// +void d_ocp_qp_get_b(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_Q(int stage, struct d_ocp_qp *qp, double *mat); +// +void d_ocp_qp_get_S(int stage, struct d_ocp_qp *qp, double *mat); +// +void d_ocp_qp_get_R(int stage, struct d_ocp_qp *qp, double *mat); +// +void d_ocp_qp_get_q(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_r(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_ub(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_ub_mask(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_lb(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_lb_mask(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_lbx(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_lbx_mask(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_ubx(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_ubx_mask(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_lbu(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_lbu_mask(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_ubu(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_ubu_mask(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_idxb(int stage, struct d_ocp_qp *qp, int *vec); +// +//void d_ocp_qp_get_idxbx(int stage, struct d_ocp_qp *qp, int *vec); +// +//void d_ocp_qp_get_Jbx(int stage, struct d_ocp_qp *qp, double *vec); +// +//void d_ocp_qp_get_idxbu(int stage, struct d_ocp_qp *qp, int *vec); +// +//void d_ocp_qp_get_Jbu(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_C(int stage, struct d_ocp_qp *qp, double *mat); +// +void d_ocp_qp_get_D(int stage, struct d_ocp_qp *qp, double *mat); +// +void d_ocp_qp_get_lg(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_lg_mask(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_ug(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_ug_mask(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_Zl(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_Zu(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_zl(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_zu(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_lls(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_lls_mask(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_lus(int stage, struct d_ocp_qp *qp, double *vec); +// +void d_ocp_qp_get_lus_mask(int stage, struct d_ocp_qp *qp, double *vec); +// XXX only valid if there is one slack per softed constraint !!! +void d_ocp_qp_get_idxs(int stage, struct d_ocp_qp *qp, int *vec); +// +void d_ocp_qp_get_idxs_rev(int stage, struct d_ocp_qp *qp, int *vec); +// +//void d_ocp_qp_get_Jsbu(int stage, struct d_ocp_qp *qp, float *vec); +// +//void d_ocp_qp_get_Jsbx(int stage, struct d_ocp_qp *qp, float *vec); +// +//void d_ocp_qp_get_Jsg(int stage, struct d_ocp_qp *qp, float *vec); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_OCP_QP_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_dim.h b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_dim.h new file mode 100644 index 000000000..dcfb801d3 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_dim.h @@ -0,0 +1,142 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_OCP_QP_DIM_H_ +#define HPIPM_D_OCP_QP_DIM_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_ocp_qp_dim + { + int *nx; // number of states + int *nu; // number of inputs + int *nb; // number of box constraints + int *nbx; // number of state box constraints + int *nbu; // number of input box constraints + int *ng; // number of general constraints + int *ns; // number of soft constraints + int *nsbx; // number of soft state box constraints + int *nsbu; // number of soft input box constraints + int *nsg; // number of soft general constraints + int *nbxe; // number of state box constraints which are equality + int *nbue; // number of input box constraints which are equality + int *nge; // number of general constraints which are equality + int N; // horizon length + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_ocp_qp_dim_strsize(); +// +hpipm_size_t d_ocp_qp_dim_memsize(int N); +// +void d_ocp_qp_dim_create(int N, struct d_ocp_qp_dim *qp_dim, void *memory); +// +void d_ocp_qp_dim_copy_all(struct d_ocp_qp_dim *dim_orig, struct d_ocp_qp_dim *dim_dest); +// +void d_ocp_qp_dim_set_all(int *nx, int *nu, int *nbx, int *nbu, int *ng, int *nsbx, int *nsbu, int *nsg, struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_dim_set(char *field, int stage, int value, struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_dim_set_nx(int stage, int value, struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_dim_set_nu(int stage, int value, struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_dim_set_nbx(int stage, int value, struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_dim_set_nbu(int stage, int value, struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_dim_set_ng(int stage, int value, struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_dim_set_ns(int stage, int value, struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_dim_set_nsbx(int stage, int value, struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_dim_set_nsbu(int stage, int value, struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_dim_set_nsg(int stage, int value, struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_dim_set_nbxe(int stage, int value, struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_dim_set_nbue(int stage, int value, struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_dim_set_nge(int stage, int value, struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_dim_get(struct d_ocp_qp_dim *dim, char *field, int stage, int *value); +// +void d_ocp_qp_dim_get_N(struct d_ocp_qp_dim *dim, int *value); +// +void d_ocp_qp_dim_get_nx(struct d_ocp_qp_dim *dim, int stage, int *value); +// +void d_ocp_qp_dim_get_nu(struct d_ocp_qp_dim *dim, int stage, int *value); +// +void d_ocp_qp_dim_get_nbx(struct d_ocp_qp_dim *dim, int stage, int *value); +// +void d_ocp_qp_dim_get_nbu(struct d_ocp_qp_dim *dim, int stage, int *value); +// +void d_ocp_qp_dim_get_ng(struct d_ocp_qp_dim *dim, int stage, int *value); +// +void d_ocp_qp_dim_get_ns(struct d_ocp_qp_dim *dim, int stage, int *value); +// +void d_ocp_qp_dim_get_nsbx(struct d_ocp_qp_dim *dim, int stage, int *value); +// +void d_ocp_qp_dim_get_nsbu(struct d_ocp_qp_dim *dim, int stage, int *value); +// +void d_ocp_qp_dim_get_nsg(struct d_ocp_qp_dim *dim, int stage, int *value); +// +void d_ocp_qp_dim_get_nbxe(struct d_ocp_qp_dim *dim, int stage, int *value); +// +void d_ocp_qp_dim_get_nbue(struct d_ocp_qp_dim *dim, int stage, int *value); +// +void d_ocp_qp_dim_get_nge(struct d_ocp_qp_dim *dim, int stage, int *value); + + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_OCP_QP_DIM_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_ipm.h b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_ipm.h new file mode 100644 index 000000000..d2a2833f2 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_ipm.h @@ -0,0 +1,250 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_OCP_QP_IPM_H_ +#define HPIPM_D_OCP_QP_IPM_H_ + + + +#include +#include + +#include +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_ocp_qp_ipm_arg + { + double mu0; // initial value for complementarity slackness + double alpha_min; // exit cond on step length + double res_g_max; // exit cond on inf norm of residuals + double res_b_max; // exit cond on inf norm of residuals + double res_d_max; // exit cond on inf norm of residuals + double res_m_max; // exit cond on inf norm of residuals + double reg_prim; // reg of primal hessian + double lam_min; // min value in lam vector + double t_min; // min value in t vector + double tau_min; // min value of barrier parameter + int iter_max; // exit cond in iter number + int stat_max; // iterations saved in stat + int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm + int cond_pred_corr; // conditional Mehrotra's predictor-corrector + int itref_pred_max; // max number of iterative refinement steps for predictor step + int itref_corr_max; // max number of iterative refinement steps for corrector step + int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol + int square_root_alg; // 0 classical Riccati, 1 square-root Riccati + int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq (for square_root_alg==1) + int abs_form; // absolute IPM formulation + int comp_dual_sol_eq; // dual solution of equality constraints (only for abs_form==1) + int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol_eq==1) + int comp_res_pred; // compute residuals of prediction + int split_step; // use different steps for primal and dual variables + int var_init_scheme; // variables initialization scheme + int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution + int mode; + hpipm_size_t memsize; + }; + + + +struct d_ocp_qp_ipm_ws + { + double qp_res[4]; // infinity norm of residuals + struct d_core_qp_ipm_workspace *core_workspace; + struct d_ocp_qp_dim *dim; // cache dim + struct d_ocp_qp_res_ws *res_workspace; + struct d_ocp_qp_sol *sol_step; + struct d_ocp_qp_sol *sol_itref; + struct d_ocp_qp *qp_step; + struct d_ocp_qp *qp_itref; + struct d_ocp_qp_res *res_itref; + struct d_ocp_qp_res *res; + struct blasfeo_dvec *Gamma; // hessian update + struct blasfeo_dvec *gamma; // hessian update + struct blasfeo_dvec *tmp_nuxM; // work space of size nxM + struct blasfeo_dvec *tmp_nbgM; // work space of size nbM+ngM + struct blasfeo_dvec *tmp_nsM; // work space of size nsM + struct blasfeo_dvec *Pb; // Pb + struct blasfeo_dvec *Zs_inv; + struct blasfeo_dvec *tmp_m; + struct blasfeo_dvec *l; // cache linear part for _get_ric_xxx + struct blasfeo_dmat *L; + struct blasfeo_dmat *Ls; + struct blasfeo_dmat *P; + struct blasfeo_dmat *Lh; + struct blasfeo_dmat *AL; + struct blasfeo_dmat *lq0; + struct blasfeo_dmat *tmp_nxM_nxM; + double *stat; // convergence statistics + int *use_hess_fact; + void *lq_work0; + int iter; // iteration number + int stat_max; // iterations saved in stat + int stat_m; // number of recorded stat per IPM iter + int use_Pb; + int status; // solver status + int square_root_alg; // cache from arg + int lq_fact; // cache from arg + int mask_constr; // use constr mask + int valid_ric_vec; // meaningful riccati vectors + int valid_ric_p; // form of riccati p: 0 p*inv(L), 1 p + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_ocp_qp_ipm_arg_strsize(); +// +hpipm_size_t d_ocp_qp_ipm_arg_memsize(struct d_ocp_qp_dim *ocp_dim); +// +void d_ocp_qp_ipm_arg_create(struct d_ocp_qp_dim *ocp_dim, struct d_ocp_qp_ipm_arg *arg, void *mem); +// +void d_ocp_qp_ipm_arg_set_default(enum hpipm_mode mode, struct d_ocp_qp_ipm_arg *arg); +// +void d_ocp_qp_ipm_arg_set(char *field, void *value, struct d_ocp_qp_ipm_arg *arg); +// set maximum number of iterations +void d_ocp_qp_ipm_arg_set_iter_max(int *iter_max, struct d_ocp_qp_ipm_arg *arg); +// set minimum step lenght +void d_ocp_qp_ipm_arg_set_alpha_min(double *alpha_min, struct d_ocp_qp_ipm_arg *arg); +// set initial value of barrier parameter +void d_ocp_qp_ipm_arg_set_mu0(double *mu0, struct d_ocp_qp_ipm_arg *arg); +// set exit tolerance on stationarity condition +void d_ocp_qp_ipm_arg_set_tol_stat(double *tol_stat, struct d_ocp_qp_ipm_arg *arg); +// set exit tolerance on equality constr +void d_ocp_qp_ipm_arg_set_tol_eq(double *tol_eq, struct d_ocp_qp_ipm_arg *arg); +// set exit tolerance on inequality constr +void d_ocp_qp_ipm_arg_set_tol_ineq(double *tol_ineq, struct d_ocp_qp_ipm_arg *arg); +// set exit tolerance on complementarity condition +void d_ocp_qp_ipm_arg_set_tol_comp(double *tol_comp, struct d_ocp_qp_ipm_arg *arg); +// set regularization of primal variables +void d_ocp_qp_ipm_arg_set_reg_prim(double *tol_comp, struct d_ocp_qp_ipm_arg *arg); +// set warm start: 0 no warm start, 1 primal var +void d_ocp_qp_ipm_arg_set_warm_start(int *warm_start, struct d_ocp_qp_ipm_arg *arg); +// Mehrotra's predictor-corrector IPM algorithm: 0 no predictor-corrector, 1 use predictor-corrector +void d_ocp_qp_ipm_arg_set_pred_corr(int *pred_corr, struct d_ocp_qp_ipm_arg *arg); +// conditional predictor-corrector: 0 no conditinal predictor-corrector, 1 conditional predictor-corrector +void d_ocp_qp_ipm_arg_set_cond_pred_corr(int *value, struct d_ocp_qp_ipm_arg *arg); +// set riccati algorithm: 0 classic, 1 square-root +void d_ocp_qp_ipm_arg_set_ric_alg(int *value, struct d_ocp_qp_ipm_arg *arg); +// dual solution of equality constraints (only for abs_form==1) +void d_ocp_qp_ipm_arg_set_comp_dual_sol_eq(int *value, struct d_ocp_qp_ipm_arg *arg); +// compute residuals after solution +void d_ocp_qp_ipm_arg_set_comp_res_exit(int *value, struct d_ocp_qp_ipm_arg *arg); +// compute residuals of prediction +void d_ocp_qp_ipm_arg_set_comp_res_pred(int *value, struct d_ocp_qp_ipm_arg *arg); +// min value of lam in the solution +void d_ocp_qp_ipm_arg_set_lam_min(double *value, struct d_ocp_qp_ipm_arg *arg); +// min value of t in the solution +void d_ocp_qp_ipm_arg_set_t_min(double *value, struct d_ocp_qp_ipm_arg *arg); +// min value of tau in the solution +void d_ocp_qp_ipm_arg_set_tau_min(double *value, struct d_ocp_qp_ipm_arg *arg); +// set split step: 0 same step, 1 different step for primal and dual variables +void d_ocp_qp_ipm_arg_set_split_step(int *value, struct d_ocp_qp_ipm_arg *arg); +// variables initialization scheme +void d_ocp_qp_ipm_arg_set_var_init_scheme(int *value, struct d_ocp_qp_ipm_arg *arg); +// clip t and lam: 0 no, 1 in Gamma computation, 2 in solution +void d_ocp_qp_ipm_arg_set_t_lam_min(int *value, struct d_ocp_qp_ipm_arg *arg); + +// +hpipm_size_t d_ocp_qp_ipm_ws_strsize(); +// +hpipm_size_t d_ocp_qp_ipm_ws_memsize(struct d_ocp_qp_dim *ocp_dim, struct d_ocp_qp_ipm_arg *arg); +// +void d_ocp_qp_ipm_ws_create(struct d_ocp_qp_dim *ocp_dim, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, void *mem); +// +void d_ocp_qp_ipm_get(char *field, struct d_ocp_qp_ipm_ws *ws, void *value); +// +void d_ocp_qp_ipm_get_status(struct d_ocp_qp_ipm_ws *ws, int *status); +// +void d_ocp_qp_ipm_get_iter(struct d_ocp_qp_ipm_ws *ws, int *iter); +// +void d_ocp_qp_ipm_get_max_res_stat(struct d_ocp_qp_ipm_ws *ws, double *res_stat); +// +void d_ocp_qp_ipm_get_max_res_eq(struct d_ocp_qp_ipm_ws *ws, double *res_eq); +// +void d_ocp_qp_ipm_get_max_res_ineq(struct d_ocp_qp_ipm_ws *ws, double *res_ineq); +// +void d_ocp_qp_ipm_get_max_res_comp(struct d_ocp_qp_ipm_ws *ws, double *res_comp); +// +void d_ocp_qp_ipm_get_stat(struct d_ocp_qp_ipm_ws *ws, double **stat); +// +void d_ocp_qp_ipm_get_stat_m(struct d_ocp_qp_ipm_ws *ws, int *stat_m); +// +void d_ocp_qp_ipm_get_ric_Lr(struct d_ocp_qp *qp, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, int stage, double *Lr); +// +void d_ocp_qp_ipm_get_ric_Ls(struct d_ocp_qp *qp, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, int stage, double *Ls); +// +void d_ocp_qp_ipm_get_ric_P(struct d_ocp_qp *qp, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, int stage, double *P); +// +void d_ocp_qp_ipm_get_ric_lr(struct d_ocp_qp *qp, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, int stage, double *lr); +// +void d_ocp_qp_ipm_get_ric_p(struct d_ocp_qp *qp, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, int stage, double *p); +// feedback control gain in the form u = K x + k +void d_ocp_qp_ipm_get_ric_K(struct d_ocp_qp *qp, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, int stage, double *K); +// feedback control gain in the form u = K x + k +void d_ocp_qp_ipm_get_ric_k(struct d_ocp_qp *qp, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, int stage, double *k); +// +void d_ocp_qp_init_var(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws); +// +void d_ocp_qp_ipm_abs_step(int kk, struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws); +// +void d_ocp_qp_ipm_delta_step(int kk, struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws); +// +void d_ocp_qp_ipm_solve(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws); +// +void d_ocp_qp_ipm_predict(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws); +// +void d_ocp_qp_ipm_sens(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws); + + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_D_OCP_QP_IPM_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_kkt.h b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_kkt.h new file mode 100644 index 000000000..19dcec32c --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_kkt.h @@ -0,0 +1,66 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_OCP_QP_KKT_H_ +#define HPIPM_D_OCP_QP_KKT_H_ + +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + +// +void d_ocp_qp_fact_solve_kkt_unconstr(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws); +// +void d_ocp_qp_fact_solve_kkt_step(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws); +// +void d_ocp_qp_fact_lq_solve_kkt_step(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws); +// +void d_ocp_qp_solve_kkt_step(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif // HPIPM_D_OCP_QP_KKT_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_red.h b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_red.h new file mode 100644 index 000000000..f0482b044 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_red.h @@ -0,0 +1,117 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_OCP_QP_RED_H_ +#define HPIPM_D_OCP_QP_RED_H_ + + + +#include +#include + +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_ocp_qp_reduce_eq_dof_arg + { + double lam_min; + double t_min; + int alias_unchanged; // do not keep copy unchanged stage + int comp_prim_sol; // primal solution (v) + int comp_dual_sol_eq; // dual solution equality constr (pi) + int comp_dual_sol_ineq; // dual solution inequality constr (lam t) + hpipm_size_t memsize; // memory size in bytes + }; + + + +struct d_ocp_qp_reduce_eq_dof_ws + { + struct blasfeo_dvec *tmp_nuxM; + struct blasfeo_dvec *tmp_nbgM; + int *e_imask_ux; + int *e_imask_d; + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +void d_ocp_qp_dim_reduce_eq_dof(struct d_ocp_qp_dim *dim, struct d_ocp_qp_dim *dim_red); +// +hpipm_size_t d_ocp_qp_reduce_eq_dof_arg_memsize(); +// +void d_ocp_qp_reduce_eq_dof_arg_create(struct d_ocp_qp_reduce_eq_dof_arg *arg, void *mem); +// +void d_ocp_qp_reduce_eq_dof_arg_set_default(struct d_ocp_qp_reduce_eq_dof_arg *arg); +// +void d_ocp_qp_reduce_eq_dof_arg_set_alias_unchanged(struct d_ocp_qp_reduce_eq_dof_arg *arg, int value); +// +void d_ocp_qp_reduce_eq_dof_arg_set_comp_prim_sol(struct d_ocp_qp_reduce_eq_dof_arg *arg, int value); +// +void d_ocp_qp_reduce_eq_dof_arg_set_comp_dual_sol_eq(struct d_ocp_qp_reduce_eq_dof_arg *arg, int value); +// +void d_ocp_qp_reduce_eq_dof_arg_set_comp_dual_sol_ineq(struct d_ocp_qp_reduce_eq_dof_arg *arg, int value); +// +hpipm_size_t d_ocp_qp_reduce_eq_dof_ws_memsize(struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_reduce_eq_dof_ws_create(struct d_ocp_qp_dim *dim, struct d_ocp_qp_reduce_eq_dof_ws *work, void *mem); +// +void d_ocp_qp_reduce_eq_dof(struct d_ocp_qp *qp, struct d_ocp_qp *qp_red, struct d_ocp_qp_reduce_eq_dof_arg *arg, struct d_ocp_qp_reduce_eq_dof_ws *work); +// +void d_ocp_qp_reduce_eq_dof_lhs(struct d_ocp_qp *qp, struct d_ocp_qp *qp_red, struct d_ocp_qp_reduce_eq_dof_arg *arg, struct d_ocp_qp_reduce_eq_dof_ws *work); +// +void d_ocp_qp_reduce_eq_dof_rhs(struct d_ocp_qp *qp, struct d_ocp_qp *qp_red, struct d_ocp_qp_reduce_eq_dof_arg *arg, struct d_ocp_qp_reduce_eq_dof_ws *work); +// +void d_ocp_qp_restore_eq_dof(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol_red, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_reduce_eq_dof_arg *arg, struct d_ocp_qp_reduce_eq_dof_ws *work); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_OCP_QP_RED_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_res.h b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_res.h new file mode 100644 index 000000000..061c5729c --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_res.h @@ -0,0 +1,112 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_OCP_QP_RES_H_ +#define HPIPM_D_OCP_QP_RES_H_ + + + +#include +#include + +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_ocp_qp_res + { + struct d_ocp_qp_dim *dim; + struct blasfeo_dvec *res_g; // q-residuals + struct blasfeo_dvec *res_b; // b-residuals + struct blasfeo_dvec *res_d; // d-residuals + struct blasfeo_dvec *res_m; // m-residuals + double res_max[4]; // max of residuals + double res_mu; // mu-residual + hpipm_size_t memsize; + }; + + + +struct d_ocp_qp_res_ws + { + struct blasfeo_dvec *tmp_nbgM; // work space of size nbM+ngM + struct blasfeo_dvec *tmp_nsM; // work space of size nsM + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_ocp_qp_res_memsize(struct d_ocp_qp_dim *ocp_dim); +// +void d_ocp_qp_res_create(struct d_ocp_qp_dim *ocp_dim, struct d_ocp_qp_res *res, void *mem); +// +hpipm_size_t d_ocp_qp_res_ws_memsize(struct d_ocp_qp_dim *ocp_dim); +// +void d_ocp_qp_res_ws_create(struct d_ocp_qp_dim *ocp_dim, struct d_ocp_qp_res_ws *workspace, void *mem); +// +void d_ocp_qp_res_compute(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_res *res, struct d_ocp_qp_res_ws *ws); +// +void d_ocp_qp_res_compute_lin(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_sol *qp_step, struct d_ocp_qp_res *res, struct d_ocp_qp_res_ws *ws); +// +void d_ocp_qp_res_compute_inf_norm(struct d_ocp_qp_res *res); +// +void d_ocp_qp_res_get_all(struct d_ocp_qp_res *res, double **res_r, double **res_q, double **res_ls, double **res_us, double **res_b, double **res_d_lb, double **res_d_ub, double **res_d_lg, double **res_d_ug, double **res_d_ls, double **res_d_us, double **res_m_lb, double **res_m_ub, double **res_m_lg, double **res_m_ug, double **res_m_ls, double **res_m_us); +// +void d_ocp_qp_res_get_max_res_stat(struct d_ocp_qp_res *res, double *value); +// +void d_ocp_qp_res_get_max_res_eq(struct d_ocp_qp_res *res, double *value); +// +void d_ocp_qp_res_get_max_res_ineq(struct d_ocp_qp_res *res, double *value); +// +void d_ocp_qp_res_get_max_res_comp(struct d_ocp_qp_res *res, double *value); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_D_OCP_QP_RES_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_sol.h b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_sol.h new file mode 100644 index 000000000..eb91f3a7b --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_sol.h @@ -0,0 +1,128 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_OCP_QP_SOL_H_ +#define HPIPM_D_OCP_QP_SOL_H_ + + + +#include +#include + +#include "hpipm_d_ocp_qp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_ocp_qp_sol + { + struct d_ocp_qp_dim *dim; + struct blasfeo_dvec *ux; + struct blasfeo_dvec *pi; + struct blasfeo_dvec *lam; + struct blasfeo_dvec *t; + void *misc; + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t d_ocp_qp_sol_strsize(); +// +hpipm_size_t d_ocp_qp_sol_memsize(struct d_ocp_qp_dim *dim); +// +void d_ocp_qp_sol_create(struct d_ocp_qp_dim *dim, struct d_ocp_qp_sol *qp_sol, void *memory); +// +void d_ocp_qp_sol_copy_all(struct d_ocp_qp_sol *qp_sol_orig, struct d_ocp_qp_sol *qp_sol_dest); +// +void d_ocp_qp_sol_get_all(struct d_ocp_qp_sol *qp_sol, double **u, double **x, double **ls, double **us, double **pi, double **lam_lb, double **lam_ub, double **lam_lg, double **lam_ug, double **lam_ls, double **lam_us); +// +void d_ocp_qp_sol_get_all_rowmaj(struct d_ocp_qp_sol *qp_sol, double **u, double **x, double **ls, double **us, double **pi, double **lam_lb, double **lam_ub, double **lam_lg, double **lam_ug, double **lam_ls, double **lam_us); +// +void d_ocp_qp_sol_set_all(double **u, double **x, double **ls, double **us, double **pi, double **lam_lb, double **lam_ub, double **lam_lg, double **lam_ug, double **lam_ls, double **lam_us, struct d_ocp_qp_sol *qp_sol); +// +void d_ocp_qp_sol_get(char *field, int stage, struct d_ocp_qp_sol *qp_sol, double *vec); +// +void d_ocp_qp_sol_get_u(int stage, struct d_ocp_qp_sol *qp_sol, double *vec); +// +void d_ocp_qp_sol_get_x(int stage, struct d_ocp_qp_sol *qp_sol, double *vec); +// +void d_ocp_qp_sol_get_sl(int stage, struct d_ocp_qp_sol *qp_sol, double *vec); +// +void d_ocp_qp_sol_get_su(int stage, struct d_ocp_qp_sol *qp_sol, double *vec); +// +void d_ocp_qp_sol_get_pi(int stage, struct d_ocp_qp_sol *qp_sol, double *vec); +// +void d_ocp_qp_sol_get_lam_lb(int stage, struct d_ocp_qp_sol *qp_sol, double *vec); +// +void d_ocp_qp_sol_get_lam_lbu(int stage, struct d_ocp_qp_sol *qp_sol, double *vec); +// +void d_ocp_qp_sol_get_lam_lbx(int stage, struct d_ocp_qp_sol *qp_sol, double *vec); +// +void d_ocp_qp_sol_get_lam_ub(int stage, struct d_ocp_qp_sol *qp_sol, double *vec); +// +void d_ocp_qp_sol_get_lam_ubu(int stage, struct d_ocp_qp_sol *qp_sol, double *vec); +// +void d_ocp_qp_sol_get_lam_ubx(int stage, struct d_ocp_qp_sol *qp_sol, double *vec); +// +void d_ocp_qp_sol_get_lam_lg(int stage, struct d_ocp_qp_sol *qp_sol, double *vec); +// +void d_ocp_qp_sol_get_lam_ug(int stage, struct d_ocp_qp_sol *qp_sol, double *vec); +// +void d_ocp_qp_sol_set(char *field, int stage, double *vec, struct d_ocp_qp_sol *qp_sol); +// +void d_ocp_qp_sol_set_u(int stage, double *vec, struct d_ocp_qp_sol *qp_sol); +// +void d_ocp_qp_sol_set_x(int stage, double *vec, struct d_ocp_qp_sol *qp_sol); +// +void d_ocp_qp_sol_set_sl(int stage, double *vec, struct d_ocp_qp_sol *qp_sol); +// +void d_ocp_qp_sol_set_su(int stage, double *vec, struct d_ocp_qp_sol *qp_sol); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_OCP_QP_SOL_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_utils.h b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_utils.h new file mode 100644 index 000000000..217e9d94a --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_ocp_qp_utils.h @@ -0,0 +1,82 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_OCP_QP_UTILS_H_ +#define HPIPM_D_OCP_QP_UTILS_H_ + + + +#include +#include + +#include "hpipm_d_ocp_qp_dim.h" +#include "hpipm_d_ocp_qp.h" +#include "hpipm_d_ocp_qp_sol.h" +#include "hpipm_d_ocp_qp_ipm.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void d_ocp_qp_dim_print(struct d_ocp_qp_dim *qp_dim); +// +void d_ocp_qp_dim_codegen(char *file_name, char *mode, struct d_ocp_qp_dim *qp_dim); +// +void d_ocp_qp_print(struct d_ocp_qp_dim *qp_dim, struct d_ocp_qp *qp); +// +void d_ocp_qp_codegen(char *file_name, char *mode, struct d_ocp_qp_dim *qp_dim, struct d_ocp_qp *qp); +// +void d_ocp_qp_sol_print(struct d_ocp_qp_dim *qp_dim, struct d_ocp_qp_sol *ocp_qp_sol); +// +void d_ocp_qp_ipm_arg_print(struct d_ocp_qp_dim *qp_dim, struct d_ocp_qp_ipm_arg *arg); +// +void d_ocp_qp_ipm_arg_codegen(char *file_name, char *mode, struct d_ocp_qp_dim *qp_dim, struct d_ocp_qp_ipm_arg *arg); +// +void d_ocp_qp_res_print(struct d_ocp_qp_dim *qp_dim, struct d_ocp_qp_res *ocp_qp_res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_OCP_QP_UTILS_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_part_cond.h b/third_party/acados/include/hpipm/include/hpipm_d_part_cond.h new file mode 100644 index 000000000..1c5f78503 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_part_cond.h @@ -0,0 +1,115 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_D_PART_COND_H_ +#define HPIPM_D_PART_COND_H_ + + + +#include +#include + +#include "hpipm_common.h" +#include "hpipm_d_cond.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_part_cond_qp_arg + { + struct d_cond_qp_arg *cond_arg; + int N2; + hpipm_size_t memsize; + }; + + + +struct d_part_cond_qp_ws + { + struct d_cond_qp_ws *cond_workspace; + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_part_cond_qp_arg_memsize(int N2); +// +void d_part_cond_qp_arg_create(int N2, struct d_part_cond_qp_arg *cond_arg, void *mem); +// +void d_part_cond_qp_arg_set_default(struct d_part_cond_qp_arg *cond_arg); +// set riccati-like algorithm: 0 classical, 1 squre-root +void d_part_cond_qp_arg_set_ric_alg(int ric_alg, struct d_part_cond_qp_arg *cond_arg); +// +void d_part_cond_qp_arg_set_comp_prim_sol(int value, struct d_part_cond_qp_arg *cond_arg); +// +void d_part_cond_qp_arg_set_comp_dual_sol_eq(int value, struct d_part_cond_qp_arg *cond_arg); +// +void d_part_cond_qp_arg_set_comp_dual_sol_ineq(int value, struct d_part_cond_qp_arg *cond_arg); + +// +void d_part_cond_qp_compute_block_size(int N, int N2, int *block_size); +// +void d_part_cond_qp_compute_dim(struct d_ocp_qp_dim *ocp_dim, int *block_size, struct d_ocp_qp_dim *part_dense_dim); +// +hpipm_size_t d_part_cond_qp_ws_memsize(struct d_ocp_qp_dim *ocp_dim, int *block_size, struct d_ocp_qp_dim *part_dense_dim, struct d_part_cond_qp_arg *cond_arg); +// +void d_part_cond_qp_ws_create(struct d_ocp_qp_dim *ocp_dim, int *block_size, struct d_ocp_qp_dim *part_dense_dim, struct d_part_cond_qp_arg *cond_arg, struct d_part_cond_qp_ws *cond_ws, void *mem); +// +void d_part_cond_qp_cond(struct d_ocp_qp *ocp_qp, struct d_ocp_qp *part_dense_qp, struct d_part_cond_qp_arg *cond_arg, struct d_part_cond_qp_ws *cond_ws); +// +void d_part_cond_qp_cond_lhs(struct d_ocp_qp *ocp_qp, struct d_ocp_qp *part_dense_qp, struct d_part_cond_qp_arg *cond_arg, struct d_part_cond_qp_ws *cond_ws); +// +void d_part_cond_qp_cond_rhs(struct d_ocp_qp *ocp_qp, struct d_ocp_qp *part_dense_qp, struct d_part_cond_qp_arg *cond_arg, struct d_part_cond_qp_ws *cond_ws); +// +void d_part_cond_qp_expand_sol(struct d_ocp_qp *ocp_qp, struct d_ocp_qp *part_dense_qp, struct d_ocp_qp_sol *part_dense_qp_sol, struct d_ocp_qp_sol *ocp_qp_sol, struct d_part_cond_qp_arg *cond_arg, struct d_part_cond_qp_ws *cond_ws); + +// +void d_part_cond_qp_update(int *idxc, struct d_ocp_qp *ocp_qp, struct d_ocp_qp *part_dense_qp, struct d_part_cond_qp_arg *cond_arg, struct d_part_cond_qp_ws *cond_ws); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_PART_COND_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_part_cond_qcqp.h b/third_party/acados/include/hpipm/include/hpipm_d_part_cond_qcqp.h new file mode 100644 index 000000000..2d6624e5b --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_part_cond_qcqp.h @@ -0,0 +1,106 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_D_PART_COND_QCQP_H_ +#define HPIPM_D_PART_COND_QCQP_H_ + + + +#include +#include + +#include "hpipm_d_cond_qcqp.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_part_cond_qcqp_arg + { + struct d_cond_qcqp_arg *cond_arg; + int N2; + hpipm_size_t memsize; + }; + + + +struct d_part_cond_qcqp_ws + { + struct d_cond_qcqp_ws *cond_ws; + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_part_cond_qcqp_arg_memsize(int N2); +// +void d_part_cond_qcqp_arg_create(int N2, struct d_part_cond_qcqp_arg *cond_arg, void *mem); +// +void d_part_cond_qcqp_arg_set_default(struct d_part_cond_qcqp_arg *cond_arg); +// set riccati-like algorithm: 0 classical, 1 squre-root +void d_part_cond_qcqp_arg_set_ric_alg(int ric_alg, struct d_part_cond_qcqp_arg *cond_arg); + +// +void d_part_cond_qcqp_compute_block_size(int N, int N2, int *block_size); +// +void d_part_cond_qcqp_compute_dim(struct d_ocp_qcqp_dim *ocp_dim, int *block_size, struct d_ocp_qcqp_dim *part_dense_dim); +// +hpipm_size_t d_part_cond_qcqp_ws_memsize(struct d_ocp_qcqp_dim *ocp_dim, int *block_size, struct d_ocp_qcqp_dim *part_dense_dim, struct d_part_cond_qcqp_arg *cond_arg); +// +void d_part_cond_qcqp_ws_create(struct d_ocp_qcqp_dim *ocp_dim, int *block_size, struct d_ocp_qcqp_dim *part_dense_dim, struct d_part_cond_qcqp_arg *cond_arg, struct d_part_cond_qcqp_ws *cond_ws, void *mem); +// +void d_part_cond_qcqp_cond(struct d_ocp_qcqp *ocp_qp, struct d_ocp_qcqp *part_dense_qp, struct d_part_cond_qcqp_arg *cond_arg, struct d_part_cond_qcqp_ws *cond_ws); +// +void d_part_cond_qcqp_cond_lhs(struct d_ocp_qcqp *ocp_qp, struct d_ocp_qcqp *part_dense_qp, struct d_part_cond_qcqp_arg *cond_arg, struct d_part_cond_qcqp_ws *cond_ws); +// +void d_part_cond_qcqp_cond_rhs(struct d_ocp_qcqp *ocp_qp, struct d_ocp_qcqp *part_dense_qp, struct d_part_cond_qcqp_arg *cond_arg, struct d_part_cond_qcqp_ws *cond_ws); +// +void d_part_cond_qcqp_expand_sol(struct d_ocp_qcqp *ocp_qp, struct d_ocp_qcqp *part_dense_qp, struct d_ocp_qcqp_sol *part_dense_qp_sol, struct d_ocp_qcqp_sol *ocp_qp_sol, struct d_part_cond_qcqp_arg *cond_arg, struct d_part_cond_qcqp_ws *cond_ws); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_PART_COND_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_sim_erk.h b/third_party/acados/include/hpipm/include/hpipm_d_sim_erk.h new file mode 100644 index 000000000..320b66bb2 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_sim_erk.h @@ -0,0 +1,122 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_SIM_ERK_H_ +#define HPIPM_D_SIM_ERK_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct d_sim_erk_arg + { + struct d_sim_rk_data *rk_data; // integrator data + double h; // step size + int steps; // number of steps +// int for_sens; // compute adjoint sensitivities +// int adj_sens; // compute adjoint sensitivities + hpipm_size_t memsize; + }; + + + +struct d_sim_erk_ws + { + void (*ode)(int t, double *x, double *p, void *ode_args, double *xdot); // function pointer to ode + void (*vde_for)(int t, double *x, double *p, void *ode_args, double *xdot); // function pointer to forward vde + void (*vde_adj)(int t, double *adj_in, void *ode_args, double *adj_out); // function pointer to adjoint vde + void *ode_args; // pointer to ode args + struct d_sim_erk_arg *erk_arg; // erk arg + double *K; // internal variables + double *x_for; // states and forward sensitivities + double *x_traj; // states at all steps + double *l; // adjoint sensitivities + double *p; // parameter + double *x_tmp; // temporary states and forward sensitivities + double *adj_in; + double *adj_tmp; + int nx; // number of states + int np; // number of parameters + int nf; // number of forward sensitivities + int na; // number of adjoint sensitivities + int nf_max; // max number of forward sensitivities + int na_max; // max number of adjoint sensitivities + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_sim_erk_arg_memsize(); +// +void d_sim_erk_arg_create(struct d_sim_erk_arg *erk_arg, void *mem); +// +void d_sim_erk_arg_set_all(struct d_sim_rk_data *rk_data, double h, int steps, struct d_sim_erk_arg *erk_arg); + +// +hpipm_size_t d_sim_erk_ws_memsize(struct d_sim_erk_arg *erk_arg, int nx, int np, int nf_max, int na_max); +// +void d_sim_erk_ws_create(struct d_sim_erk_arg *erk_arg, int nx, int np, int nf_max, int na_max, struct d_sim_erk_ws *work, void *memory); +// +void d_sim_erk_ws_set_all(int nf, int na, double *x, double *fs, double *bs, double *p, void (*ode)(int t, double *x, double *p, void *ode_args, double *xdot), void (*vde_for)(int t, double *x, double *p, void *ode_args, double *xdot), void (*vde_adj)(int t, double *adj_in, void *ode_args, double *adj_out), void *ode_args, struct d_sim_erk_ws *work); +// number of directions for forward sensitivities +void d_sim_erk_ws_set_nf(int *nf, struct d_sim_erk_ws *work); +// parameters (e.g. inputs) +void d_sim_erk_ws_set_p(double *p, struct d_sim_erk_ws *work); +// state +void d_sim_erk_ws_set_x(double *x, struct d_sim_erk_ws *work); +// forward sensitivities +void d_sim_erk_ws_set_fs(double *fs, struct d_sim_erk_ws *work); +// ode funtion +void d_sim_erk_ws_set_ode(void (*ode)(int t, double *x, double *p, void *ode_args, double *xdot), struct d_sim_erk_ws *work); +// forward vde function +void d_sim_erk_ws_set_vde_for(void (*ode)(int t, double *x, double *p, void *ode_args, double *xdot), struct d_sim_erk_ws *work); +// ode_args, passed straight to the ode/vde_for/vde_adj functions +void d_sim_erk_ws_set_ode_args(void *ode_args, struct d_sim_erk_ws *work); +// state +void d_sim_erk_ws_get_x(struct d_sim_erk_ws *work, double *x); +// forward sensitivities +void d_sim_erk_ws_get_fs(struct d_sim_erk_ws *work, double *fs); +// +void d_sim_erk_solve(struct d_sim_erk_arg *arg, struct d_sim_erk_ws *work); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // HPIPM_D_SIM_ERK_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_sim_rk.h b/third_party/acados/include/hpipm/include/hpipm_d_sim_rk.h new file mode 100644 index 000000000..a50dcbb49 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_sim_rk.h @@ -0,0 +1,71 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_SIM_RK_H_ +#define HPIPM_D_SIM_RK_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct d_sim_rk_data + { + double *A_rk; // A in butcher tableau + double *B_rk; // b in butcher tableau + double *C_rk; // c in butcher tableau + int expl; // erk vs irk + int ns; // number of stages + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_sim_rk_data_memsize(int ns); +// +void d_sim_rk_data_create(int ns, struct d_sim_rk_data *rk_data, void *memory); +// +void d_sim_rk_data_init_default(char *field, struct d_sim_rk_data *rk_data); +// +void d_sim_rk_data_set_all(int expl, double *A_rk, double *B_rk, double *C_rk, struct d_sim_rk_data *rk_data); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // HPIPM_D_SIM_RK_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp.h b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp.h new file mode 100644 index 000000000..f36b51a06 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp.h @@ -0,0 +1,213 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_TREE_OCP_QCQP_H_ +#define HPIPM_D_TREE_OCP_QCQP_H_ + + + +#include +#include + +#include "hpipm_common.h" +#include "hpipm_d_tree_ocp_qcqp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_tree_ocp_qcqp + { + struct d_tree_ocp_qcqp_dim *dim; + struct blasfeo_dmat *BAbt; // Nn-1 + struct blasfeo_dmat *RSQrq; // Nn + struct blasfeo_dmat *DCt; // Nn + struct blasfeo_dmat **Hq; // Nn + struct blasfeo_dvec *b; // Nn-1 + struct blasfeo_dvec *rqz; // Nn + struct blasfeo_dvec *d; // Nn + struct blasfeo_dvec *d_mask; // Nn + struct blasfeo_dvec *m; // Nn + struct blasfeo_dvec *Z; // Nn + int **idxb; // indices of box constrained variables within [u; x] // Nn + int **idxs_rev; // index of soft constraints + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t d_tree_ocp_qcqp_memsize(struct d_tree_ocp_qcqp_dim *dim); +// +void d_tree_ocp_qcqp_create(struct d_tree_ocp_qcqp_dim *dim, struct d_tree_ocp_qcqp *qp, void *memory); +// +void d_tree_ocp_qcqp_set_all(double **A, double **B, double **b, double **Q, double **S, double **R, double **q, double **r, int **idxb, double **d_lb, double **d_ub, double **C, double **D, double **d_lg, double **d_ug, double **Zl, double **Zu, double **zl, double **zu, int **idxs, double **d_ls, double **d_us, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set(char *field_name, int node_edge, void *value, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_A(int edge, double *mat, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_B(int edge, double *mat, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_b(int edge, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_Q(int node, double *mat, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_S(int node, double *mat, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_R(int node, double *mat, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_q(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_r(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_lb(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_lb_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_ub(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_ub_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_lbx(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_lbx_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_ubx(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_ubx_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_lbu(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_lbu_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_ubu(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_ubu_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_idxb(int node, int *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_idxbx(int node, int *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_Jbx(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_idxbu(int node, int *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_Jbu(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_C(int node, double *mat, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_D(int node, double *mat, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_lg(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_lg_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_ug(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_ug_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_Qq(int node, double *mat, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_Sq(int node, double *mat, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_Rq(int node, double *mat, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_qq(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_rq(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_uq(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_uq_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_Zl(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_Zu(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_zl(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_zu(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_lls(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_lls_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_lus(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_lus_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_idxs(int node, int *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_idxs_rev(int node, int *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_Jsbu(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_Jsbx(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_Jsg(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_set_Jsq(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +//void d_tree_ocp_qcqp_set_idxe(int node, int *vec, struct d_tree_ocp_qcqp *qp); +// +//void d_tree_ocp_qcqp_set_idxbxe(int node, int *vec, struct d_tree_ocp_qcqp *qp); +// +//void d_tree_ocp_qcqp_set_idxbue(int node, int *vec, struct d_tree_ocp_qcqp *qp); +// +//void d_tree_ocp_qcqp_set_idxge(int node, int *vec, struct d_tree_ocp_qcqp *qp); +// +//void d_tree_ocp_qcqp_set_Jbxe(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +//void d_tree_ocp_qcqp_set_Jbue(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +//void d_tree_ocp_qcqp_set_Jge(int node, double *vec, struct d_tree_ocp_qcqp *qp); +// +//void d_tree_ocp_qcqp_set_diag_H_flag(int node, int *value, struct d_tree_ocp_qcqp *qp); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_TREE_OCP_QCQP_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_dim.h b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_dim.h new file mode 100644 index 000000000..257b82b25 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_dim.h @@ -0,0 +1,117 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_TREE_OCP_QCQP_DIM_H_ +#define HPIPM_D_TREE_OCP_QCQP_DIM_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_tree_ocp_qcqp_dim + { + struct d_tree_ocp_qp_dim *qp_dim; // dim of qp approximation + struct tree *ttree; // tree describing node conndection + int *nx; // number of states // Nn + int *nu; // number of inputs // Nn + int *nb; // number of box constraints // Nn + int *nbx; // number of state box constraints // Nn + int *nbu; // number of input box constraints // Nn + int *ng; // number of general constraints // Nn + int *nq; // number of (upper) quadratic constraints + int *ns; // number of soft constraints // Nn + int *nsbx; // number of soft state box constraints + int *nsbu; // number of soft input box constraints + int *nsg; // number of soft general constraints + int *nsq; // number of (upper) soft quadratic constraints + int Nn; // number of nodes + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_tree_ocp_qcqp_dim_strsize(); +// +hpipm_size_t d_tree_ocp_qcqp_dim_memsize(int Nn); +// +void d_tree_ocp_qcqp_dim_create(int Nn, struct d_tree_ocp_qcqp_dim *qp_dim, void *memory); +// +void d_tree_ocp_qcqp_dim_set_tree(struct tree *ttree, struct d_tree_ocp_qcqp_dim *dim); +// +void d_tree_ocp_qcqp_dim_set(char *field, int stage, int value, struct d_tree_ocp_qcqp_dim *dim); +// +void d_tree_ocp_qcqp_dim_set_nx(int stage, int value, struct d_tree_ocp_qcqp_dim *dim); +// +void d_tree_ocp_qcqp_dim_set_nu(int stage, int value, struct d_tree_ocp_qcqp_dim *dim); +// +void d_tree_ocp_qcqp_dim_set_nbx(int stage, int value, struct d_tree_ocp_qcqp_dim *dim); +// +void d_tree_ocp_qcqp_dim_set_nbu(int stage, int value, struct d_tree_ocp_qcqp_dim *dim); +// +void d_tree_ocp_qcqp_dim_set_ng(int stage, int value, struct d_tree_ocp_qcqp_dim *dim); +// +void d_tree_ocp_qcqp_dim_set_nq(int stage, int value, struct d_tree_ocp_qcqp_dim *dim); +// +void d_tree_ocp_qcqp_dim_set_ns(int stage, int value, struct d_tree_ocp_qcqp_dim *dim); +// +void d_tree_ocp_qcqp_dim_set_nsbx(int stage, int value, struct d_tree_ocp_qcqp_dim *dim); +// +void d_tree_ocp_qcqp_dim_set_nsbu(int stage, int value, struct d_tree_ocp_qcqp_dim *dim); +// +void d_tree_ocp_qcqp_dim_set_nsg(int stage, int value, struct d_tree_ocp_qcqp_dim *dim); +// +void d_tree_ocp_qcqp_dim_set_nsq(int stage, int value, struct d_tree_ocp_qcqp_dim *dim); +// +//void d_tree_ocp_qcqp_dim_set_nbxe(int stage, int value, struct d_tree_ocp_qcqp_dim *dim); +// +//void d_tree_ocp_qcqp_dim_set_nbue(int stage, int value, struct d_tree_ocp_qcqp_dim *dim); +// +//void d_tree_ocp_qcqp_dim_set_nge(int stage, int value, struct d_tree_ocp_qcqp_dim *dim); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_TREE_OCP_QCQP_DIM_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_ipm.h b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_ipm.h new file mode 100644 index 000000000..4a0fed106 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_ipm.h @@ -0,0 +1,191 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_TREE_OCP_QCQP_IPM_H_ +#define HPIPM_D_TREE_OCP_QCQP_IPM_H_ + + + +#include +#include + +#include +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_tree_ocp_qcqp_ipm_arg + { + struct d_tree_ocp_qp_ipm_arg *qp_arg; + double mu0; // initial value for complementarity slackness + double alpha_min; // exit cond on step length + double res_g_max; // exit cond on inf norm of residuals + double res_b_max; // exit cond on inf norm of residuals + double res_d_max; // exit cond on inf norm of residuals + double res_m_max; // exit cond on inf norm of residuals + double reg_prim; // reg of primal hessian + double lam_min; // min value in lam vector + double t_min; // min value in t vector + int iter_max; // exit cond in iter number + int stat_max; // iterations saved in stat + int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm + int cond_pred_corr; // conditional Mehrotra's predictor-corrector + int itref_pred_max; // max number of iterative refinement steps for predictor step + int itref_corr_max; // max number of iterative refinement steps for corrector step + int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol +// int square_root_alg; // 0 classical Riccati, 1 square-root Riccati + int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq (for square_root_alg==1) + int abs_form; // absolute IPM formulation + int comp_dual_sol_eq; // dual solution of equality constrains (only for abs_form==1) + int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol_eq==1) +// int comp_res_pred; // compute residuals of prediction + int split_step; // use different step for primal and dual variables + int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution + int mode; + hpipm_size_t memsize; + }; + + + +struct d_tree_ocp_qcqp_ipm_ws + { + struct d_tree_ocp_qp_ipm_ws *qp_ws; + struct d_tree_ocp_qp *qp; + struct d_tree_ocp_qp_sol *qp_sol; + struct d_tree_ocp_qcqp_res_ws *qcqp_res_ws; + struct d_tree_ocp_qcqp_res *qcqp_res; + struct blasfeo_dvec *tmp_nuxM; + int iter; // iteration number + int status; + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_tree_ocp_qcqp_ipm_arg_strsize(); +// +hpipm_size_t d_tree_ocp_qcqp_ipm_arg_memsize(struct d_tree_ocp_qcqp_dim *ocp_dim); +// +void d_tree_ocp_qcqp_ipm_arg_create(struct d_tree_ocp_qcqp_dim *ocp_dim, struct d_tree_ocp_qcqp_ipm_arg *arg, void *mem); +// +void d_tree_ocp_qcqp_ipm_arg_set_default(enum hpipm_mode mode, struct d_tree_ocp_qcqp_ipm_arg *arg); +// +void d_tree_ocp_qcqp_ipm_arg_set(char *field, void *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// set maximum number of iterations +void d_tree_ocp_qcqp_ipm_arg_set_iter_max(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// set minimum step lenght +void d_tree_ocp_qcqp_ipm_arg_set_alpha_min(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// set initial value of barrier parameter +void d_tree_ocp_qcqp_ipm_arg_set_mu0(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on stationarity condition +void d_tree_ocp_qcqp_ipm_arg_set_tol_stat(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on equality constr +void d_tree_ocp_qcqp_ipm_arg_set_tol_eq(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on inequality constr +void d_tree_ocp_qcqp_ipm_arg_set_tol_ineq(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on complementarity condition +void d_tree_ocp_qcqp_ipm_arg_set_tol_comp(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// set regularization of primal variables +void d_tree_ocp_qcqp_ipm_arg_set_reg_prim(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// set warm start: 0 no warm start, 1 primal var +void d_tree_ocp_qcqp_ipm_arg_set_warm_start(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// Mehrotra's predictor-corrector IPM algorithm: 0 no predictor-corrector, 1 use predictor-corrector +void d_tree_ocp_qcqp_ipm_arg_set_pred_corr(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// conditional predictor-corrector: 0 no conditinal predictor-corrector, 1 conditional predictor-corrector +void d_tree_ocp_qcqp_ipm_arg_set_cond_pred_corr(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// set riccati algorithm: 0 classic, 1 square-root +//void d_tree_ocp_qcqp_ipm_arg_set_ric_alg(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// compute residuals after solution +void d_tree_ocp_qcqp_ipm_arg_set_comp_res_exit(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// compute residuals of prediction +//void d_tree_ocp_qcqp_ipm_arg_set_comp_res_pred(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// min value of lam in the solution +void d_tree_ocp_qcqp_ipm_arg_set_lam_min(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// min value of t in the solution +void d_tree_ocp_qcqp_ipm_arg_set_t_min(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// use different step for primal and dual variables +void d_tree_ocp_qcqp_ipm_arg_set_split_step(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg); +// clip t and lam: 0 no, 1 in Gamma computation, 2 in solution +void d_tree_ocp_qcqp_ipm_arg_set_t_lam_min(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg); + +// +hpipm_size_t d_tree_ocp_qcqp_ipm_ws_strsize(); +// +hpipm_size_t d_tree_ocp_qcqp_ipm_ws_memsize(struct d_tree_ocp_qcqp_dim *ocp_dim, struct d_tree_ocp_qcqp_ipm_arg *arg); +// +void d_tree_ocp_qcqp_ipm_ws_create(struct d_tree_ocp_qcqp_dim *ocp_dim, struct d_tree_ocp_qcqp_ipm_arg *arg, struct d_tree_ocp_qcqp_ipm_ws *ws, void *mem); +// +void d_tree_ocp_qcqp_ipm_get(char *field, struct d_tree_ocp_qcqp_ipm_ws *ws, void *value); +// +void d_tree_ocp_qcqp_ipm_get_status(struct d_tree_ocp_qcqp_ipm_ws *ws, int *status); +// +void d_tree_ocp_qcqp_ipm_get_iter(struct d_tree_ocp_qcqp_ipm_ws *ws, int *iter); +// +void d_tree_ocp_qcqp_ipm_get_max_res_stat(struct d_tree_ocp_qcqp_ipm_ws *ws, double *res_stat); +// +void d_tree_ocp_qcqp_ipm_get_max_res_eq(struct d_tree_ocp_qcqp_ipm_ws *ws, double *res_eq); +// +void d_tree_ocp_qcqp_ipm_get_max_res_ineq(struct d_tree_ocp_qcqp_ipm_ws *ws, double *res_ineq); +// +void d_tree_ocp_qcqp_ipm_get_max_res_comp(struct d_tree_ocp_qcqp_ipm_ws *ws, double *res_comp); +// +void d_tree_ocp_qcqp_ipm_get_stat(struct d_tree_ocp_qcqp_ipm_ws *ws, double **stat); +// +void d_tree_ocp_qcqp_ipm_get_stat_m(struct d_tree_ocp_qcqp_ipm_ws *ws, int *stat_m); +// +void d_tree_ocp_qcqp_init_var(struct d_tree_ocp_qcqp *qp, struct d_tree_ocp_qcqp_sol *qp_sol, struct d_tree_ocp_qcqp_ipm_arg *arg, struct d_tree_ocp_qcqp_ipm_ws *ws); +// +void d_tree_ocp_qcqp_ipm_solve(struct d_tree_ocp_qcqp *qp, struct d_tree_ocp_qcqp_sol *qp_sol, struct d_tree_ocp_qcqp_ipm_arg *arg, struct d_tree_ocp_qcqp_ipm_ws *ws); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_D_TREE_OCP_QCQP_IPM_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_res.h b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_res.h new file mode 100644 index 000000000..69eebb1ba --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_res.h @@ -0,0 +1,108 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_TREE_OCP_QCQP_RES_H_ +#define HPIPM_D_TREE_OCP_QCQP_RES_H_ + + + +#include +#include + +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_tree_ocp_qcqp_res + { + struct d_tree_ocp_qcqp_dim *dim; + struct blasfeo_dvec *res_g; // q-residuals + struct blasfeo_dvec *res_b; // b-residuals + struct blasfeo_dvec *res_d; // d-residuals + struct blasfeo_dvec *res_m; // m-residuals + double res_max[4]; // max of residuals + double res_mu; // mu-residual + hpipm_size_t memsize; + }; + + + +struct d_tree_ocp_qcqp_res_ws + { + struct blasfeo_dvec *tmp_nuxM; // work space of size nuM+nxM + struct blasfeo_dvec *tmp_nbgqM; // work space of size nbM+ngM+nqM + struct blasfeo_dvec *tmp_nsM; // work space of size nsM + struct blasfeo_dvec *q_fun; // value for evaluation of quadr constr + struct blasfeo_dvec *q_adj; // value for adjoint of quadr constr + int use_q_fun; // reuse cached value for evaluation of quadr constr + int use_q_adj; // reuse cached value for adjoint of quadr constr + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_tree_ocp_qcqp_res_memsize(struct d_tree_ocp_qcqp_dim *ocp_dim); +// +void d_tree_ocp_qcqp_res_create(struct d_tree_ocp_qcqp_dim *ocp_dim, struct d_tree_ocp_qcqp_res *res, void *mem); +// +hpipm_size_t d_tree_ocp_qcqp_res_ws_memsize(struct d_tree_ocp_qcqp_dim *ocp_dim); +// +void d_tree_ocp_qcqp_res_ws_create(struct d_tree_ocp_qcqp_dim *ocp_dim, struct d_tree_ocp_qcqp_res_ws *ws, void *mem); +// +void d_tree_ocp_qcqp_res_compute(struct d_tree_ocp_qcqp *qp, struct d_tree_ocp_qcqp_sol *qp_sol, struct d_tree_ocp_qcqp_res *res, struct d_tree_ocp_qcqp_res_ws *ws); +// +void d_tree_ocp_qcqp_res_compute_inf_norm(struct d_tree_ocp_qcqp_res *res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_D_TREE_OCP_QCQP_RES_H_ + + + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_sol.h b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_sol.h new file mode 100644 index 000000000..cde8de5c5 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_sol.h @@ -0,0 +1,99 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_TREE_OCP_QCQP_SOL_H_ +#define HPIPM_D_TREE_OCP_QCQP_SOL_H_ + + + +#include +#include + +#include "hpipm_d_tree_ocp_qcqp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + +struct d_tree_ocp_qcqp_sol + { + struct d_tree_ocp_qcqp_dim *dim; + struct blasfeo_dvec *ux; + struct blasfeo_dvec *pi; + struct blasfeo_dvec *lam; + struct blasfeo_dvec *t; + void *misc; + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t d_tree_ocp_qcqp_sol_memsize(struct d_tree_ocp_qcqp_dim *dim); +// +void d_tree_ocp_qcqp_sol_create(struct d_tree_ocp_qcqp_dim *dim, struct d_tree_ocp_qcqp_sol *qp_sol, void *memory); +// +void d_tree_ocp_qcqp_sol_get(char *field, int node_edge, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qcqp_sol_get_u(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qcqp_sol_get_x(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qcqp_sol_get_sl(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qcqp_sol_get_su(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qcqp_sol_get_pi(int edge, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qcqp_sol_get_lam_lb(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qcqp_sol_get_lam_ub(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qcqp_sol_get_lam_lg(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qcqp_sol_get_lam_ug(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_TREE_OCP_QCQP_SOL_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_utils.h b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_utils.h new file mode 100644 index 000000000..5ef04fcf6 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qcqp_utils.h @@ -0,0 +1,84 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_TREE_OCP_QP_UTILS_H_ +#define HPIPM_D_TREE_OCP_QP_UTILS_H_ + + + +#include +#include + +#include "hpipm_d_tree_ocp_qcqp_dim.h" +#include "hpipm_d_tree_ocp_qcqp.h" +#include "hpipm_d_tree_ocp_qcqp_sol.h" +#include "hpipm_d_tree_ocp_qcqp_ipm.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void d_tree_ocp_qcqp_dim_print(struct d_tree_ocp_qcqp_dim *qp_dim); +// +//void d_tree_ocp_qcqp_dim_codegen(char *file_name, char *mode, struct d_tree_ocp_qcqp_dim *qp_dim); +// +void d_tree_ocp_qcqp_print(struct d_tree_ocp_qcqp_dim *qp_dim, struct d_tree_ocp_qcqp *qp); +// +//void d_tree_ocp_qcqp_codegen(char *file_name, char *mode, struct d_tree_ocp_qcqp_dim *qp_dim, struct d_tree_ocp_qcqp *qp); +// +void d_tree_ocp_qcqp_sol_print(struct d_tree_ocp_qcqp_dim *qp_dim, struct d_tree_ocp_qcqp_sol *ocp_qcqp_sol); +// +void d_tree_ocp_qcqp_ipm_arg_print(struct d_tree_ocp_qcqp_dim *qp_dim, struct d_tree_ocp_qcqp_ipm_arg *arg); +// +//void d_tree_ocp_qcqp_ipm_arg_codegen(char *file_name, char *mode, struct d_tree_ocp_qcqp_dim *qp_dim, struct d_tree_ocp_qcqp_ipm_arg *arg); +// +void d_tree_ocp_qcqp_res_print(struct d_tree_ocp_qcqp_dim *qp_dim, struct d_tree_ocp_qcqp_res *ocp_qcqp_res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_TREE_OCP_QP_UTILS_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp.h b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp.h new file mode 100644 index 000000000..1666ad7c7 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp.h @@ -0,0 +1,195 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_TREE_OCP_QP_H_ +#define HPIPM_D_TREE_OCP_QP_H_ + + + +#include +#include + +#include "hpipm_d_tree_ocp_qp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_tree_ocp_qp + { + struct d_tree_ocp_qp_dim *dim; + struct blasfeo_dmat *BAbt; // Nn-1 + struct blasfeo_dmat *RSQrq; // Nn + struct blasfeo_dmat *DCt; // Nn + struct blasfeo_dvec *b; // Nn-1 + struct blasfeo_dvec *rqz; // Nn + struct blasfeo_dvec *d; // Nn + struct blasfeo_dvec *d_mask; // Nn + struct blasfeo_dvec *m; // Nn + struct blasfeo_dvec *Z; // Nn + int **idxb; // indices of box constrained variables within [u; x] // Nn +// int **idxs; // index of soft constraints + int **idxs_rev; // index of soft constraints + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t d_tree_ocp_qp_memsize(struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_create(struct d_tree_ocp_qp_dim *dim, struct d_tree_ocp_qp *qp, void *memory); +// +void d_tree_ocp_qp_set_all(double **A, double **B, double **b, double **Q, double **S, double **R, double **q, double **r, int **idxb, double **d_lb, double **d_ub, double **C, double **D, double **d_lg, double **d_ug, double **Zl, double **Zu, double **zl, double **zu, int **idxs, double **d_ls, double **d_us, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set(char *field_name, int node_edge, void *value, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_A(int edge, double *mat, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_B(int edge, double *mat, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_b(int edge, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_Q(int node, double *mat, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_S(int node, double *mat, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_R(int node, double *mat, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_q(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_r(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_lb(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_lb_mask(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_ub(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_ub_mask(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_lbx(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_lbx_mask(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_ubx(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_ubx_mask(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_lbu(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_lbu_mask(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_ubu(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_ubu_mask(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_idxb(int node, int *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_idxbx(int node, int *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_Jbx(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_idxbu(int node, int *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_Jbu(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_C(int node, double *mat, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_D(int node, double *mat, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_lg(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_lg_mask(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_ug(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_ug_mask(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_Zl(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_Zu(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_zl(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_zu(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_lls(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_lls_mask(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_lus(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_lus_mask(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_idxs(int node, int *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_idxs_rev(int node, int *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_Jsbu(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_Jsbx(int node, double *vec, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_set_Jsg(int node, double *vec, struct d_tree_ocp_qp *qp); +// +//void d_tree_ocp_qp_set_idxe(int node, int *vec, struct d_tree_ocp_qp *qp); +// +//void d_tree_ocp_qp_set_idxbxe(int node, int *vec, struct d_tree_ocp_qp *qp); +// +//void d_tree_ocp_qp_set_idxbue(int node, int *vec, struct d_tree_ocp_qp *qp); +// +//void d_tree_ocp_qp_set_idxge(int node, int *vec, struct d_tree_ocp_qp *qp); +// +//void d_tree_ocp_qp_set_Jbxe(int node, double *vec, struct d_tree_ocp_qp *qp); +// +//void d_tree_ocp_qp_set_Jbue(int node, double *vec, struct d_tree_ocp_qp *qp); +// +//void d_tree_ocp_qp_set_Jge(int node, double *vec, struct d_tree_ocp_qp *qp); +// +//void d_tree_ocp_qp_set_diag_H_flag(int node, int *value, struct d_tree_ocp_qp *qp); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_TREE_OCP_QP_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_dim.h b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_dim.h new file mode 100644 index 000000000..659b66459 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_dim.h @@ -0,0 +1,111 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_TREE_OCP_QP_DIM_H_ +#define HPIPM_D_TREE_OCP_QP_DIM_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_tree_ocp_qp_dim + { + struct tree *ttree; // tree describing node conndection + int *nx; // number of states // Nn + int *nu; // number of inputs // Nn + int *nb; // number of box constraints // Nn + int *nbx; // number of state box constraints // Nn + int *nbu; // number of input box constraints // Nn + int *ng; // number of general constraints // Nn + int *ns; // number of soft constraints // Nn + int *nsbx; // number of soft state box constraints + int *nsbu; // number of soft input box constraints + int *nsg; // number of soft general constraints + int Nn; // number of nodes + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_tree_ocp_qp_dim_strsize(); +// +hpipm_size_t d_tree_ocp_qp_dim_memsize(int Nn); +// +void d_tree_ocp_qp_dim_create(int Nn, struct d_tree_ocp_qp_dim *qp_dim, void *memory); +// +void d_tree_ocp_qp_dim_set_all(struct tree *ttree, int *nx, int *nu, int *nbx, int *nbu, int *ng, int *nsbx, int *nsbu, int *nsg, struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_dim_set_tree(struct tree *ttree, struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_dim_set(char *field, int stage, int value, struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_dim_set_nx(int stage, int value, struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_dim_set_nu(int stage, int value, struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_dim_set_nbx(int stage, int value, struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_dim_set_nbu(int stage, int value, struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_dim_set_ng(int stage, int value, struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_dim_set_ns(int stage, int value, struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_dim_set_nsbx(int stage, int value, struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_dim_set_nsbu(int stage, int value, struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_dim_set_nsg(int stage, int value, struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_dim_set_nbxe(int stage, int value, struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_dim_set_nbue(int stage, int value, struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_dim_set_nge(int stage, int value, struct d_tree_ocp_qp_dim *dim); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_TREE_OCP_QP_DIM_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_ipm.h b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_ipm.h new file mode 100644 index 000000000..fb634208c --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_ipm.h @@ -0,0 +1,209 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_D_TREE_OCP_QP_IPM_H_ +#define HPIPM_D_TREE_OCP_QP_IPM_H_ + + + +#include +#include + +#include +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_tree_ocp_qp_ipm_arg + { + double mu0; // initial value for duality measure + double alpha_min; // exit cond on step length + double res_g_max; // exit cond on inf norm of residuals + double res_b_max; // exit cond on inf norm of residuals + double res_d_max; // exit cond on inf norm of residuals + double res_m_max; // exit cond on inf norm of residuals + double reg_prim; // reg of primal hessian + double lam_min; // min value in lam vector + double t_min; // min value in t vector + double tau_min; // min value of barrier parameter + int iter_max; // exit cond in iter number + int stat_max; // iterations saved in stat + int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm + int cond_pred_corr; // conditional Mehrotra's predictor-corrector + int itref_pred_max; // max number of iterative refinement steps for predictor step + int itref_corr_max; // max number of iterative refinement steps for corrector step + int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol + int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq + int abs_form; // absolute IPM formulation + int comp_dual_sol_eq; // dual solution (only for abs_form==1) + int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol==1) + int split_step; // use different steps for primal and dual variables + int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution + int mode; + hpipm_size_t memsize; + }; + + + +struct d_tree_ocp_qp_ipm_ws + { + struct d_core_qp_ipm_workspace *core_workspace; + struct d_tree_ocp_qp_res_ws *res_workspace; + struct d_tree_ocp_qp_sol *sol_step; + struct d_tree_ocp_qp_sol *sol_itref; + struct d_tree_ocp_qp *qp_step; + struct d_tree_ocp_qp *qp_itref; + struct d_tree_ocp_qp_res *res_itref; + struct d_tree_ocp_qp_res *res; + struct blasfeo_dvec *Gamma; // hessian update + struct blasfeo_dvec *gamma; // hessian update + struct blasfeo_dvec *tmp_nxM; // work space of size nxM + struct blasfeo_dvec *tmp_nbgM; // work space of size nbgM + struct blasfeo_dvec *tmp_nsM; // work space of size nsM + struct blasfeo_dvec *Pb; // Pb + struct blasfeo_dvec *Zs_inv; + struct blasfeo_dmat *L; + struct blasfeo_dmat *Lh; + struct blasfeo_dmat *AL; + struct blasfeo_dmat *lq0; + struct blasfeo_dvec *tmp_m; + double *stat; // convergence statistics + int *use_hess_fact; + void *lq_work0; + double qp_res[4]; // infinity norm of residuals + int iter; // iteration number + int stat_max; // iterations saved in stat + int stat_m; // number of recorded stat per IPM iter + int use_Pb; + int status; // solver status + int lq_fact; // cache from arg + int mask_constr; // use constr mask + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_tree_ocp_qp_ipm_arg_memsize(struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_ipm_arg_create(struct d_tree_ocp_qp_dim *dim, struct d_tree_ocp_qp_ipm_arg *arg, void *mem); +// +void d_tree_ocp_qp_ipm_arg_set_default(enum hpipm_mode mode, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_iter_max(int *iter_max, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_alpha_min(double *alpha_min, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_mu0(double *mu0, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_tol_stat(double *tol_stat, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_tol_eq(double *tol_eq, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_tol_ineq(double *tol_ineq, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_tol_comp(double *tol_comp, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_reg_prim(double *reg, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_warm_start(int *warm_start, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_pred_corr(int *pred_corr, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_cond_pred_corr(int *value, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_comp_dual_sol_eq(int *value, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_comp_res_exit(int *value, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_lam_min(double *value, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_t_min(double *value, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_tau_min(double *value, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_split_step(int *value, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_arg_set_t_lam_min(int *value, struct d_tree_ocp_qp_ipm_arg *arg); + +// +hpipm_size_t d_tree_ocp_qp_ipm_ws_memsize(struct d_tree_ocp_qp_dim *dim, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_ipm_ws_create(struct d_tree_ocp_qp_dim *dim, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws, void *mem); +// +void d_tree_ocp_qp_ipm_get_status(struct d_tree_ocp_qp_ipm_ws *ws, int *status); +// +void d_tree_ocp_qp_ipm_get_iter(struct d_tree_ocp_qp_ipm_ws *ws, int *iter); +// +void d_tree_ocp_qp_ipm_get_max_res_stat(struct d_tree_ocp_qp_ipm_ws *ws, double *res_stat); +// +void d_tree_ocp_qp_ipm_get_max_res_eq(struct d_tree_ocp_qp_ipm_ws *ws, double *res_eq); +// +void d_tree_ocp_qp_ipm_get_max_res_ineq(struct d_tree_ocp_qp_ipm_ws *ws, double *res_ineq); +// +void d_tree_ocp_qp_ipm_get_max_res_comp(struct d_tree_ocp_qp_ipm_ws *ws, double *res_comp); +// +void d_tree_ocp_qp_ipm_get_stat(struct d_tree_ocp_qp_ipm_ws *ws, double **stat); +// +void d_tree_ocp_qp_ipm_get_stat_m(struct d_tree_ocp_qp_ipm_ws *ws, int *stat_m); +// +void d_tree_ocp_qp_init_var(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws); +// +void d_tree_ocp_qp_ipm_abs_step(int kk, struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws); +// +void d_tree_ocp_qp_ipm_delta_step(int kk, struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws); +// +void d_tree_ocp_qp_ipm_solve(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_TREE_OCP_QP_IPM_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_kkt.h b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_kkt.h new file mode 100644 index 000000000..4afd52fe4 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_kkt.h @@ -0,0 +1,52 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + + +// +void d_tree_ocp_qp_fact_solve_kkt_unconstr(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws); +// +void d_tree_ocp_qp_fact_solve_kkt_step(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws); +// +void d_tree_ocp_qp_fact_lq_solve_kkt_step(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws); +// +void d_tree_ocp_qp_solve_kkt_step(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws); + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_res.h b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_res.h new file mode 100644 index 000000000..fe499080e --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_res.h @@ -0,0 +1,106 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_TREE_OCP_QP_RES_H_ +#define HPIPM_D_TREE_OCP_QP_RES_H_ + + + +#include +#include + +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct d_tree_ocp_qp_res + { + struct d_tree_ocp_qp_dim *dim; + struct blasfeo_dvec *res_g; // q-residuals + struct blasfeo_dvec *res_b; // b-residuals + struct blasfeo_dvec *res_d; // d-residuals + struct blasfeo_dvec *res_m; // m-residuals + double res_max[4]; // max of residuals + double res_mu; // mu-residual + hpipm_size_t memsize; + }; + + + +struct d_tree_ocp_qp_res_ws + { + struct blasfeo_dvec *tmp_nbgM; // work space of size nbM+ngM + struct blasfeo_dvec *tmp_nsM; // work space of size nsM + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t d_tree_ocp_qp_res_memsize(struct d_tree_ocp_qp_dim *ocp_dim); +// +void d_tree_ocp_qp_res_create(struct d_tree_ocp_qp_dim *ocp_dim, struct d_tree_ocp_qp_res *res, void *mem); +// +hpipm_size_t d_tree_ocp_qp_res_ws_memsize(struct d_tree_ocp_qp_dim *ocp_dim); +// +void d_tree_ocp_qp_res_ws_create(struct d_tree_ocp_qp_dim *ocp_dim, struct d_tree_ocp_qp_res_ws *ws, void *mem); +// +void d_tree_ocp_qp_res_get_all(struct d_tree_ocp_qp_res *res, double **res_r, double **res_q, double **res_ls, double **res_us, double **res_b, double **res_d_lb, double **res_d_ub, double **res_d_lg, double **res_d_ug, double **res_d_ls, double **res_d_us, double **res_m_lb, double **res_m_ub, double **res_m_lg, double **res_m_ug, double **res_m_ls, double **res_m_us); +// +void d_tree_ocp_qp_res_compute(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_res *res, struct d_tree_ocp_qp_res_ws *ws); +// +void d_tree_ocp_qp_res_compute_lin(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_sol *qp_step, struct d_tree_ocp_qp_res *res, struct d_tree_ocp_qp_res_ws *ws); +// +void d_tree_ocp_qp_res_compute_inf_norm(struct d_tree_ocp_qp_res *res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_D_TREE_OCP_QP_RES_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_sol.h b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_sol.h new file mode 100644 index 000000000..343d5e8ca --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_sol.h @@ -0,0 +1,100 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_TREE_OCP_QP_SOL_H_ +#define HPIPM_D_TREE_OCP_QP_SOL_H_ + + + +#include +#include + +#include "hpipm_d_tree_ocp_qp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + +struct d_tree_ocp_qp_sol + { + struct d_tree_ocp_qp_dim *dim; + struct blasfeo_dvec *ux; + struct blasfeo_dvec *pi; + struct blasfeo_dvec *lam; + struct blasfeo_dvec *t; + void *misc; + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t d_tree_ocp_qp_sol_memsize(struct d_tree_ocp_qp_dim *dim); +// +void d_tree_ocp_qp_sol_create(struct d_tree_ocp_qp_dim *dim, struct d_tree_ocp_qp_sol *qp_sol, void *memory); +// +void d_tree_ocp_qp_sol_get_all(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, double **u, double **x, double **ls, double **us, double **pi, double **lam_lb, double **lam_ub, double **lam_lg, double **lam_ug, double **lam_ls, double **lam_us); +// +void d_tree_ocp_qp_sol_get(char *field, int node_edge, struct d_tree_ocp_qp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qp_sol_get_u(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qp_sol_get_x(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qp_sol_get_sl(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qp_sol_get_su(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qp_sol_get_pi(int edge, struct d_tree_ocp_qp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qp_sol_get_lam_lb(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qp_sol_get_lam_ub(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qp_sol_get_lam_lg(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec); +// +void d_tree_ocp_qp_sol_get_lam_ug(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_TREE_OCP_QP_SOL_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_utils.h b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_utils.h new file mode 100644 index 000000000..b689fdc0f --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_d_tree_ocp_qp_utils.h @@ -0,0 +1,83 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_D_TREE_OCP_QP_UTILS_H_ +#define HPIPM_D_TREE_OCP_QP_UTILS_H_ + + + +#include +#include + +#include "hpipm_d_tree_ocp_qp_dim.h" +#include "hpipm_d_tree_ocp_qp.h" +#include "hpipm_d_tree_ocp_qp_sol.h" +#include "hpipm_d_tree_ocp_qp_ipm.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void d_tree_ocp_qp_dim_print(struct d_tree_ocp_qp_dim *qp_dim); +// +//void d_tree_ocp_qp_dim_codegen(char *file_name, char *mode, struct d_tree_ocp_qp_dim *qp_dim); +// +void d_tree_ocp_qp_print(struct d_tree_ocp_qp_dim *qp_dim, struct d_tree_ocp_qp *qp); +// +//void d_tree_ocp_qp_codegen(char *file_name, char *mode, struct d_tree_ocp_qp_dim *qp_dim, struct d_tree_ocp_qp *qp); +// +void d_tree_ocp_qp_sol_print(struct d_tree_ocp_qp_dim *qp_dim, struct d_tree_ocp_qp_sol *ocp_qp_sol); +// +void d_tree_ocp_qp_ipm_arg_print(struct d_tree_ocp_qp_dim *qp_dim, struct d_tree_ocp_qp_ipm_arg *arg); +// +//void d_tree_ocp_qp_ipm_arg_codegen(char *file_name, char *mode, struct d_tree_ocp_qp_dim *qp_dim, struct d_tree_ocp_qp_ipm_arg *arg); +// +void d_tree_ocp_qp_res_print(struct d_tree_ocp_qp_dim *qp_dim, struct d_tree_ocp_qp_res *ocp_qp_res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_TREE_OCP_QP_UTILS_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_m_dense_qp.h b/third_party/acados/include/hpipm/include/hpipm_m_dense_qp.h new file mode 100644 index 000000000..8bc101003 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_m_dense_qp.h @@ -0,0 +1,68 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + + +#ifndef HPIPM_M_DENSE_QP_H_ +#define HPIPM_M_DENSE_QP_H_ + + + +#include +#include + +#include "hpipm_d_dense_qp.h" +#include "hpipm_s_dense_qp.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +void cvt_d2s_dense_qp(struct d_dense_qp *qpd, struct s_dense_qp *qps); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_M_DENSE_QP_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_m_dense_qp_dim.h b/third_party/acados/include/hpipm/include/hpipm_m_dense_qp_dim.h new file mode 100644 index 000000000..4610321b9 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_m_dense_qp_dim.h @@ -0,0 +1,68 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + + +#ifndef HPIPM_M_DENSE_QP_DIM_H_ +#define HPIPM_M_DENSE_QP_DIM_H_ + + + +#include +#include + +#include "hpipm_d_dense_qp_dim.h" +#include "hpipm_s_dense_qp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +void cvt_d2s_dense_qp_dim(struct d_dense_qp_dim *qpd, struct s_dense_qp_dim *qps); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_M_DENSE_QP_DIM_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_m_ocp_qp.h b/third_party/acados/include/hpipm/include/hpipm_m_ocp_qp.h new file mode 100644 index 000000000..95c3dad1a --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_m_ocp_qp.h @@ -0,0 +1,49 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void m_cvt_d_ocp_qp_to_s_ocp_qp(struct d_ocp_qp *d_qp, struct s_ocp_qp *s_qp); + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/third_party/acados/include/hpipm/include/hpipm_m_ocp_qp_ipm_hard.h b/third_party/acados/include/hpipm/include/hpipm_m_ocp_qp_ipm_hard.h new file mode 100644 index 000000000..1c44acee2 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_m_ocp_qp_ipm_hard.h @@ -0,0 +1,115 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +struct m_ipm_hard_ocp_qp_workspace + { + struct d_ipm_hard_core_qp_workspace *core_workspace; + struct blasfeo_dvec *dux; + struct blasfeo_dvec *dpi; + struct blasfeo_dvec *dt_lb; + struct blasfeo_dvec *dt_lg; + struct blasfeo_svec *sdux; // XXX + struct blasfeo_svec *sdpi; // XXX + struct blasfeo_dvec *res_g; // q-residuals + struct blasfeo_dvec *res_b; // b-residuals + struct blasfeo_dvec *res_d; // d-residuals XXX remove ??? + struct blasfeo_dvec *res_d_lb; // d-residuals + struct blasfeo_dvec *res_d_ub; // d-residuals + struct blasfeo_dvec *res_d_lg; // d-residuals + struct blasfeo_dvec *res_d_ug; // d-residuals + struct blasfeo_dvec *res_m; // m-residuals + struct blasfeo_dvec *res_m_lb; // m-residuals + struct blasfeo_dvec *res_m_ub; // m-residuals + struct blasfeo_dvec *res_m_lg; // m-residuals + struct blasfeo_dvec *res_m_ug; // m-residuals + struct blasfeo_svec *sres_g; // q-residuals // XXX + struct blasfeo_svec *sres_b; // b-residuals // XXX + struct blasfeo_dvec *Qx_lb; // hessian update + struct blasfeo_dvec *Qx_lg; // hessian update + struct blasfeo_dvec *qx_lb; // gradient update + struct blasfeo_dvec *qx_lg; // gradient update + struct blasfeo_svec *sQx_lb; // hessian update // XXX + struct blasfeo_svec *sQx_lg; // hessian update // XXX + struct blasfeo_svec *sqx_lb; // gradient update // XXX + struct blasfeo_svec *sqx_lg; // gradient update // XXX + struct blasfeo_dvec *tmp_nbM; // work space of size nbM + struct blasfeo_svec *tmp_nxM; // work space of size nxM // XXX + struct blasfeo_dvec *tmp_ngM; // work space of size ngM + struct blasfeo_svec *Pb; // Pb // XXX + struct blasfeo_smat *L; // XXX + struct blasfeo_smat *AL; // XXX + struct blasfeo_svec *sSx; // scaling + struct blasfeo_svec *sSi; // scaling inverted + double *stat; // convergence statistics + double res_mu; // mu-residual + int iter; // iteration number + int compute_Pb; + int scale; + }; + + + +struct m_ipm_hard_ocp_qp_arg + { + double alpha_min; // exit cond on step length + double mu_max; // exit cond on duality measure + double mu0; // initial value for duality measure + int iter_max; // exit cond in iter number + }; + + + +// +hpipm_size_t m_memsize_ipm_hard_ocp_qp(struct d_ocp_qp *d_qp, struct s_ocp_qp *s_qp, struct m_ipm_hard_ocp_qp_arg *arg); +// +void m_create_ipm_hard_ocp_qp(struct d_ocp_qp *d_qp, struct s_ocp_qp *s_qp, struct m_ipm_hard_ocp_qp_arg *arg, struct m_ipm_hard_ocp_qp_workspace *ws, void *mem); +// +void m_solve_ipm_hard_ocp_qp(struct d_ocp_qp *d_qp, struct s_ocp_qp *s_qp, struct d_ocp_qp_sol *qp_sol, struct m_ipm_hard_ocp_qp_workspace *ws); +// +void m_solve_ipm2_hard_ocp_qp(struct d_ocp_qp *d_qp, struct s_ocp_qp *s_qp, struct d_ocp_qp_sol *qp_sol, struct m_ipm_hard_ocp_qp_workspace *ws); + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/third_party/acados/include/hpipm/include/hpipm_m_ocp_qp_kkt.h b/third_party/acados/include/hpipm/include/hpipm_m_ocp_qp_kkt.h new file mode 100644 index 000000000..032fe95b1 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_m_ocp_qp_kkt.h @@ -0,0 +1,45 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +void m_fact_solve_kkt_step_hard_ocp_qp(struct d_ocp_qp *d_qp, struct s_ocp_qp *s_qp, struct m_ipm_hard_ocp_qp_workspace *ws); +void m_solve_kkt_step_hard_ocp_qp(struct d_ocp_qp *d_qp, struct s_ocp_qp *s_qp, struct m_ipm_hard_ocp_qp_workspace *ws); + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/third_party/acados/include/hpipm/include/hpipm_s_cast_qcqp.h b/third_party/acados/include/hpipm/include/hpipm_s_cast_qcqp.h new file mode 100644 index 000000000..ba01ecb3b --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_cast_qcqp.h @@ -0,0 +1,72 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_S_CAST_QCQP_H_ +#define HPIPM_S_CAST_QCQP_H_ + + + +#include +#include + +#include "hpipm_s_dense_qcqp.h" +#include "hpipm_s_dense_qcqp_sol.h" +#include "hpipm_s_ocp_qcqp.h" +#include "hpipm_s_ocp_qcqp_dim.h" +#include "hpipm_s_ocp_qcqp_sol.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void s_cast_qcqp_compute_dim(struct s_ocp_qcqp_dim *ocp_dim, struct s_dense_qcqp_dim *dense_dim); +// +void s_cast_qcqp_cond(struct s_ocp_qcqp *ocp_qp, struct s_dense_qcqp *dense_qp); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_CAST_QCQP_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_cond.h b/third_party/acados/include/hpipm/include/hpipm_s_cond.h new file mode 100644 index 000000000..30116798b --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_cond.h @@ -0,0 +1,137 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_S_COND_H_ +#define HPIPM_S_COND_H_ + + + +#include +#include + +#include "hpipm_s_dense_qp.h" +#include "hpipm_s_dense_qp_sol.h" +#include "hpipm_s_ocp_qp.h" +#include "hpipm_s_ocp_qp_dim.h" +#include "hpipm_s_ocp_qp_sol.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_cond_qp_arg + { + int cond_last_stage; // condense last stage + int cond_alg; // condensing algorithm: 0 N2-nx3, 1 N3-nx2 + int comp_prim_sol; // primal solution (v) + int comp_dual_sol_eq; // dual solution equality constr (pi) + int comp_dual_sol_ineq; // dual solution inequality constr (lam t) + int square_root_alg; // square root algorithm (faster but requires RSQ>0) + hpipm_size_t memsize; + }; + + + +struct s_cond_qp_ws + { + struct blasfeo_smat *Gamma; + struct blasfeo_smat *GammaQ; + struct blasfeo_smat *L; + struct blasfeo_smat *Lx; + struct blasfeo_smat *AL; + struct blasfeo_svec *Gammab; + struct blasfeo_svec *l; + struct blasfeo_svec *tmp_nbgM; + struct blasfeo_svec *tmp_nuxM; + int bs; // block size + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_cond_qp_arg_memsize(); +// +void s_cond_qp_arg_create(struct s_cond_qp_arg *cond_arg, void *mem); +// +void s_cond_qp_arg_set_default(struct s_cond_qp_arg *cond_arg); +// condensing algorithm: 0 N2-nx3, 1 N3-nx2 +void s_cond_qp_arg_set_cond_alg(int cond_alg, struct s_cond_qp_arg *cond_arg); +// set riccati-like algorithm: 0 classical, 1 square-root +void s_cond_qp_arg_set_ric_alg(int ric_alg, struct s_cond_qp_arg *cond_arg); +// condense last stage: 0 last stage disregarded, 1 last stage condensed too +void s_cond_qp_arg_set_cond_last_stage(int cond_last_stage, struct s_cond_qp_arg *cond_arg); +// +void s_cond_qp_arg_set_comp_prim_sol(int value, struct s_cond_qp_arg *cond_arg); +// +void s_cond_qp_arg_set_comp_dual_sol_eq(int value, struct s_cond_qp_arg *cond_arg); +// +void s_cond_qp_arg_set_comp_dual_sol_ineq(int value, struct s_cond_qp_arg *cond_arg); + +// +void s_cond_qp_compute_dim(struct s_ocp_qp_dim *ocp_dim, struct s_dense_qp_dim *dense_dim); +// +hpipm_size_t s_cond_qp_ws_memsize(struct s_ocp_qp_dim *ocp_dim, struct s_cond_qp_arg *cond_arg); +// +void s_cond_qp_ws_create(struct s_ocp_qp_dim *ocp_dim, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws, void *mem); +// +void s_cond_qp_cond(struct s_ocp_qp *ocp_qp, struct s_dense_qp *dense_qp, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_cond_qp_cond_lhs(struct s_ocp_qp *ocp_qp, struct s_dense_qp *dense_qp, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_cond_qp_cond_rhs(struct s_ocp_qp *ocp_qp, struct s_dense_qp *dense_qp, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_cond_qp_expand_sol(struct s_ocp_qp *ocp_qp, struct s_dense_qp_sol *dense_qp_sol, struct s_ocp_qp_sol *ocp_qp_sol, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// TODO remove +void s_cond_qp_expand_primal_sol(struct s_ocp_qp *ocp_qp, struct s_dense_qp_sol *dense_qp_sol, struct s_ocp_qp_sol *ocp_qp_sol, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); + +// +void s_cond_qp_update(int *idxc, struct s_ocp_qp *ocp_qp, struct s_dense_qp *dense_qp, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_COND_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_cond_aux.h b/third_party/acados/include/hpipm/include/hpipm_s_cond_aux.h new file mode 100644 index 000000000..003472ab9 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_cond_aux.h @@ -0,0 +1,92 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_S_COND_AUX_H_ +#define HPIPM_S_COND_AUX_H_ + + + +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void s_cond_BAbt(struct s_ocp_qp *ocp_qp, struct blasfeo_smat *BAbt2, struct blasfeo_svec *b2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_cond_BAt(struct s_ocp_qp *ocp_qp, struct blasfeo_smat *BAbt2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_cond_b(struct s_ocp_qp *ocp_qp, struct blasfeo_svec *b2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_cond_RSQrq(struct s_ocp_qp *ocp_qp, struct blasfeo_smat *RSQrq2, struct blasfeo_svec *rq2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_cond_RSQ(struct s_ocp_qp *ocp_qp, struct blasfeo_smat *RSQrq2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_cond_rq(struct s_ocp_qp *ocp_qp, struct blasfeo_svec *rq2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_cond_DCtd(struct s_ocp_qp *ocp_qp, int *idxb2, struct blasfeo_smat *DCt2, struct blasfeo_svec *d2, struct blasfeo_svec *d_mask2, int *idxs_rev2, struct blasfeo_svec *Z2, struct blasfeo_svec *z2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_cond_DCt(struct s_ocp_qp *ocp_qp, int *idxb2, struct blasfeo_smat *DCt2, int *idxs_rev2, struct blasfeo_svec *Z2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_cond_d(struct s_ocp_qp *ocp_qp, struct blasfeo_svec *d2, struct blasfeo_svec *d_mask2, struct blasfeo_svec *z2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_expand_sol(struct s_ocp_qp *ocp_qp, struct s_dense_qp_sol *dense_qp_sol, struct s_ocp_qp_sol *ocp_qp_sol, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_expand_primal_sol(struct s_ocp_qp *ocp_qp, struct s_dense_qp_sol *dense_qp_sol, struct s_ocp_qp_sol *ocp_qp_sol, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); + +// +void s_update_cond_BAbt(int *idxc, struct s_ocp_qp *ocp_qp, struct blasfeo_smat *BAbt2, struct blasfeo_svec *b2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_update_cond_RSQrq_N2nx3(int *idxc, struct s_ocp_qp *ocp_qp, struct blasfeo_smat *RSQrq2, struct blasfeo_svec *rq2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); +// +void s_update_cond_DCtd(int *idxc, struct s_ocp_qp *ocp_qp, int *idxb2, struct blasfeo_smat *DCt2, struct blasfeo_svec *d2, int *idxs2, struct blasfeo_svec *Z2, struct blasfeo_svec *z2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_COND_AUX_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_cond_qcqp.h b/third_party/acados/include/hpipm/include/hpipm_s_cond_qcqp.h new file mode 100644 index 000000000..c36678abd --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_cond_qcqp.h @@ -0,0 +1,130 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_S_COND_QCQP_H_ +#define HPIPM_S_COND_QCQP_H_ + + + +#include +#include + +#include "hpipm_s_dense_qcqp.h" +#include "hpipm_s_dense_qcqp_sol.h" +#include "hpipm_s_ocp_qcqp.h" +#include "hpipm_s_ocp_qcqp_dim.h" +#include "hpipm_s_ocp_qcqp_sol.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_cond_qcqp_arg + { + struct s_cond_qp_arg *qp_arg; + int cond_last_stage; // condense last stage +// int cond_variant; // TODO + int comp_prim_sol; // primal solution (v) + int comp_dual_sol_eq; // dual solution equality constr (pi) + int comp_dual_sol_ineq; // dual solution equality constr (lam t) + int square_root_alg; // square root algorithm (faster but requires RSQ>0) + hpipm_size_t memsize; + }; + + + +struct s_cond_qcqp_ws + { + struct s_cond_qp_ws *qp_ws; + struct blasfeo_smat *hess_array; // TODO remove + struct blasfeo_smat *zero_hess; // TODO remove + struct blasfeo_svec *zero_grad; // TODO remove + struct blasfeo_svec *grad_array; // TODO remove + struct blasfeo_svec *tmp_nvc; + struct blasfeo_svec *tmp_nuxM; + struct blasfeo_smat *GammaQ; + struct blasfeo_smat *tmp_DCt; + struct blasfeo_smat *tmp_nuM_nxM; +// struct blasfeo_svec *d_qp; +// struct blasfeo_svec *d_mask_qp; + hpipm_size_t memsize; + }; + + +// +hpipm_size_t s_cond_qcqp_arg_memsize(); +// +void s_cond_qcqp_arg_create(struct s_cond_qcqp_arg *cond_arg, void *mem); +// +void s_cond_qcqp_arg_set_default(struct s_cond_qcqp_arg *cond_arg); +// set riccati-like algorithm: 0 classical, 1 square-root +void s_cond_qcqp_arg_set_ric_alg(int ric_alg, struct s_cond_qcqp_arg *cond_arg); +// condense last stage: 0 last stage disregarded, 1 last stage condensed too +void s_cond_qcqp_arg_set_cond_last_stage(int cond_last_stage, struct s_cond_qcqp_arg *cond_arg); + +// +void s_cond_qcqp_compute_dim(struct s_ocp_qcqp_dim *ocp_dim, struct s_dense_qcqp_dim *dense_dim); +// +hpipm_size_t s_cond_qcqp_ws_memsize(struct s_ocp_qcqp_dim *ocp_dim, struct s_cond_qcqp_arg *cond_arg); +// +void s_cond_qcqp_ws_create(struct s_ocp_qcqp_dim *ocp_dim, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws, void *mem); +// +void s_cond_qcqp_qc(struct s_ocp_qcqp *ocp_qp, struct blasfeo_smat *Hq2, int *Hq_nzero2, struct blasfeo_smat *Ct2, struct blasfeo_svec *d2, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws); +// +void s_cond_qcqp_qc_lhs(struct s_ocp_qcqp *ocp_qp, struct blasfeo_smat *Hq2, int *Hq_nzero2, struct blasfeo_smat *Ct2, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws); +// +void s_cond_qcqp_qc_rhs(struct s_ocp_qcqp *ocp_qp, struct blasfeo_svec *d2, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws); +// +void s_cond_qcqp_cond(struct s_ocp_qcqp *ocp_qp, struct s_dense_qcqp *dense_qp, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws); +// +void s_cond_qcqp_cond_rhs(struct s_ocp_qcqp *ocp_qp, struct s_dense_qcqp *dense_qp, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws); +// +void s_cond_qcqp_cond_lhs(struct s_ocp_qcqp *ocp_qp, struct s_dense_qcqp *dense_qp, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws); +// +void s_cond_qcqp_expand_sol(struct s_ocp_qcqp *ocp_qp, struct s_dense_qcqp_sol *dense_qp_sol, struct s_ocp_qcqp_sol *ocp_qp_sol, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_COND_QCQP_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_core_qp_ipm.h b/third_party/acados/include/hpipm/include/hpipm_s_core_qp_ipm.h new file mode 100644 index 000000000..480392c7d --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_core_qp_ipm.h @@ -0,0 +1,101 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_CORE_QP_IPM_ +#define HPIPM_S_CORE_QP_IPM_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct s_core_qp_ipm_workspace + { + float *v; // primal variables + float *pi; // equality constraints multipliers + float *lam; // inequality constraints multipliers + float *t; // inequality constraints slacks + float *t_inv; // inverse of t + float *v_bkp; // backup of primal variables + float *pi_bkp; // backup of equality constraints multipliers + float *lam_bkp; // backup of inequality constraints multipliers + float *t_bkp; // backup of inequality constraints slacks + float *dv; // step in v + float *dpi; // step in pi + float *dlam; // step in lam + float *dt; // step in t + float *res_g; // q-residuals + float *res_b; // b-residuals + float *res_d; // d-residuals + float *res_m; // m-residuals + float *res_m_bkp; // m-residuals + float *Gamma; // Hessian update + float *gamma; // gradient update + float alpha_prim; // step length + float alpha_dual; // step length + float alpha; // step length + float sigma; // centering XXX + float mu; // duality measuere + float mu_aff; // affine duality measuere + float nc_inv; // 1.0/nc, where nc is the total number of constraints + float nc_mask_inv; // 1.0/nc_mask + float lam_min; // min value in lam vector + float t_min; // min value in t vector + float t_min_inv; // inverse of min value in t vector + float tau_min; // min value of barrier parameter + int nv; // number of primal variables + int ne; // number of equality constraints + int nc; // (twice the) number of (two-sided) inequality constraints + int nc_mask; // total number of ineq constr after masking + int split_step; // use different step for primal and dual variables + int t_lam_min; // clip t and lam also in solution, or only in Gamma computation + hpipm_size_t memsize; // memory size (in bytes) of workspace + }; + + + +// +hpipm_size_t s_memsize_core_qp_ipm(int nv, int ne, int nc); +// +void s_create_core_qp_ipm(int nv, int ne, int nc, struct s_core_qp_ipm_workspace *workspace, void *mem); +// +void s_core_qp_ipm(struct s_core_qp_ipm_workspace *workspace); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // HPIPM_S_CORE_QP_IPM_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_core_qp_ipm_aux.h b/third_party/acados/include/hpipm/include/hpipm_s_core_qp_ipm_aux.h new file mode 100644 index 000000000..1ac3d7ede --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_core_qp_ipm_aux.h @@ -0,0 +1,68 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_CORE_QP_IPM_AUX_ +#define HPIPM_S_CORE_QP_IPM_AUX_ + +#ifdef __cplusplus +extern "C" { +#endif + +// +void s_compute_Gamma_gamma_qp(float *res_d, float *res_m, struct s_core_qp_ipm_workspace *rws); +// +void s_compute_gamma_qp(float *res_d, float *res_m, struct s_core_qp_ipm_workspace *rws); +// +void s_compute_lam_t_qp(float *res_d, float *res_m, float *dlam, float *dt, struct s_core_qp_ipm_workspace *rws); +// +void s_compute_alpha_qp(struct s_core_qp_ipm_workspace *rws); +// +void s_update_var_qp(struct s_core_qp_ipm_workspace *rws); +// +void s_compute_mu_aff_qp(struct s_core_qp_ipm_workspace *rws); +// +void s_backup_res_m(struct s_core_qp_ipm_workspace *rws); +// +void s_compute_centering_correction_qp(struct s_core_qp_ipm_workspace *rws); +// +void s_compute_centering_qp(struct s_core_qp_ipm_workspace *rws); +// +void s_compute_tau_min_qp(struct s_core_qp_ipm_workspace *rws); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // HPIPM_S_CORE_QP_IPM_AUX_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp.h b/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp.h new file mode 100644 index 000000000..d03c06537 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp.h @@ -0,0 +1,200 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_S_DENSE_QCQP_H_ +#define HPIPM_S_DENSE_QCQP_H_ + + + +#include +#include + +#include "hpipm_s_dense_qcqp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_dense_qcqp + { + struct s_dense_qcqp_dim *dim; + struct blasfeo_smat *Hv; // hessian of cost & vector work space + struct blasfeo_smat *A; // equality constraint matrix + struct blasfeo_smat *Ct; // inequality constraints matrix + struct blasfeo_smat *Hq; // hessians of quadratic constraints + struct blasfeo_svec *gz; // gradient of cost & gradient of slacks + struct blasfeo_svec *b; // equality constraint vector + struct blasfeo_svec *d; // inequality constraints vector + struct blasfeo_svec *d_mask; // inequality constraints mask vector + struct blasfeo_svec *m; // rhs of complementarity condition + struct blasfeo_svec *Z; // (diagonal) hessian of slacks + int *idxb; // indices of box constrained variables within [u; x] + int *idxs_rev; // index of soft constraints (reverse storage) + int *Hq_nzero; // for each int, the last 3 bits ...abc, {a,b,c}=0 => {R,S,Q}=0 + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t s_dense_qcqp_memsize(struct s_dense_qcqp_dim *dim); +// +void s_dense_qcqp_create(struct s_dense_qcqp_dim *dim, struct s_dense_qcqp *qp, void *memory); + +// +void s_dense_qcqp_set(char *field, void *value, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_H(float *H, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_g(float *g, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_A(float *A, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_b(float *b, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_idxb(int *idxb, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_lb(float *lb, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_lb_mask(float *lb, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_ub(float *ub, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_ub_mask(float *ub, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_C(float *C, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_lg(float *lg, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_lg_mask(float *lg, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_ug(float *ug, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_ug_mask(float *ug, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_Hq(float *Hq, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_gq(float *gq, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_uq(float *uq, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_uq_mask(float *uq, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_idxs(int *idxs, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_idxs_rev(int *idxs_rev, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_Zl(float *Zl, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_Zu(float *Zu, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_zl(float *zl, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_zu(float *zu, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_ls(float *ls, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_ls_mask(float *ls, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_us(float *us, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_set_us_mask(float *us, struct s_dense_qcqp *qp); + +// getters (COLMAJ) + +void s_dense_qcqp_get_H(struct s_dense_qcqp *qp, float *H); +// +void s_dense_qcqp_get_g(struct s_dense_qcqp *qp, float *g); +// +void s_dense_qcqp_get_A(struct s_dense_qcqp *qp, float *A); +// +void s_dense_qcqp_get_b(struct s_dense_qcqp *qp, float *b); +// +void s_dense_qcqp_get_idxb(struct s_dense_qcqp *qp, int *idxb); +// +void s_dense_qcqp_get_lb(struct s_dense_qcqp *qp, float *lb); +// +void s_dense_qcqp_get_lb_mask(struct s_dense_qcqp *qp, float *lb); +// +void s_dense_qcqp_get_ub(struct s_dense_qcqp *qp, float *ub); +// +void s_dense_qcqp_get_ub_mask(struct s_dense_qcqp *qp, float *ub); +// +void s_dense_qcqp_get_C(struct s_dense_qcqp *qp, float *C); +// +void s_dense_qcqp_get_lg(struct s_dense_qcqp *qp, float *lg); +// +void s_dense_qcqp_get_lg_mask(struct s_dense_qcqp *qp, float *lg); +// +void s_dense_qcqp_get_ug(struct s_dense_qcqp *qp, float *ug); +// +void s_dense_qcqp_get_ug_mask(struct s_dense_qcqp *qp, float *ug); +// +void s_dense_qcqp_get_idxs(struct s_dense_qcqp *qp, int *idxs); +// +void s_dense_qcqp_get_idxs_rev(struct s_dense_qcqp *qp, int *idxs_rev); +// +void s_dense_qcqp_get_Zl(struct s_dense_qcqp *qp, float *Zl); +// +void s_dense_qcqp_get_Zu(struct s_dense_qcqp *qp, float *Zu); +// +void s_dense_qcqp_get_zl(struct s_dense_qcqp *qp, float *zl); +// +void s_dense_qcqp_get_zu(struct s_dense_qcqp *qp, float *zu); +// +void s_dense_qcqp_get_ls(struct s_dense_qcqp *qp, float *ls); +// +void s_dense_qcqp_get_ls_mask(struct s_dense_qcqp *qp, float *ls); +// +void s_dense_qcqp_get_us(struct s_dense_qcqp *qp, float *us); +// +void s_dense_qcqp_get_us_mask(struct s_dense_qcqp *qp, float *us); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_DENSE_QCQP_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_dim.h b/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_dim.h new file mode 100644 index 000000000..04908c2c3 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_dim.h @@ -0,0 +1,99 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_DENSE_QCQP_DIM_H_ +#define HPIPM_S_DENSE_QCQP_DIM_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_dense_qcqp_dim + { + struct s_dense_qp_dim *qp_dim; // dim of qp approximation + int nv; // number of variables + int ne; // number of equality constraints + int nb; // number of box constraints + int ng; // number of general constraints + int nq; // number of quadratic constraints + int nsb; // number of softened box constraints + int nsg; // number of softened general constraints + int nsq; // number of softened quadratic constraints + int ns; // number of softened constraints (nsb+nsg+nsq) TODO number of slacks + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_dense_qcqp_dim_memsize(); +// +void s_dense_qcqp_dim_create(struct s_dense_qcqp_dim *dim, void *memory); +// +void s_dense_qcqp_dim_set(char *fiels_name, int value, struct s_dense_qcqp_dim *dim); +// +void s_dense_qcqp_dim_set_nv(int value, struct s_dense_qcqp_dim *dim); +// +void s_dense_qcqp_dim_set_ne(int value, struct s_dense_qcqp_dim *dim); +// +void s_dense_qcqp_dim_set_nb(int value, struct s_dense_qcqp_dim *dim); +// +void s_dense_qcqp_dim_set_ng(int value, struct s_dense_qcqp_dim *dim); +// +void s_dense_qcqp_dim_set_nq(int value, struct s_dense_qcqp_dim *dim); +// +void s_dense_qcqp_dim_set_nsb(int value, struct s_dense_qcqp_dim *dim); +// +void s_dense_qcqp_dim_set_nsg(int value, struct s_dense_qcqp_dim *dim); +// +void s_dense_qcqp_dim_set_nsq(int value, struct s_dense_qcqp_dim *dim); +// +void s_dense_qcqp_dim_set_ns(int value, struct s_dense_qcqp_dim *dim); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_S_DENSE_QCQP_DIM_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_ipm.h b/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_ipm.h new file mode 100644 index 000000000..8f85768ee --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_ipm.h @@ -0,0 +1,204 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_S_DENSE_QCQP_IPM_H_ +#define HPIPM_S_DENSE_QCQP_IPM_H_ + + + +#include +#include + +#include +#include +#include +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_dense_qcqp_ipm_arg + { + struct s_dense_qp_ipm_arg *qp_arg; + float mu0; // initial value for duality measure + float alpha_min; // exit cond on step length + float res_g_max; // exit cond on inf norm of residuals + float res_b_max; // exit cond on inf norm of residuals + float res_d_max; // exit cond on inf norm of residuals + float res_m_max; // exit cond on inf norm of residuals + float reg_prim; // reg of primal hessian + float reg_dual; // reg of dual hessian + float lam_min; // min value in lam vector + float t_min; // min value in t vector + int iter_max; // exit cond in iter number + int stat_max; // iterations saved in stat + int pred_corr; // Mehrotra's predictor-corrector IPM algirthm + int cond_pred_corr; // conditional Mehrotra's predictor-corrector + int scale; // scale hessian + int itref_pred_max; // max number of iterative refinement steps for predictor step + int itref_corr_max; // max number of iterative refinement steps for corrector step + int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol + int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq + int abs_form; // absolute IPM formulation + int comp_res_exit; // compute residuals on exit (only for abs_form==1) + int comp_res_pred; // compute residuals of prediction + int split_step; // use different step for primal and dual variables + int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution + int mode; + hpipm_size_t memsize; + }; + + + +struct s_dense_qcqp_ipm_ws + { +// float qp_res[4]; // infinity norm of residuals + struct s_dense_qp_ipm_ws *qp_ws; + struct s_dense_qp *qp; + struct s_dense_qp_sol *qp_sol; + struct s_dense_qcqp_res_ws *qcqp_res_ws; + struct s_dense_qcqp_res *qcqp_res; + struct blasfeo_svec *tmp_nv; +// float *stat; // convergence statistics +// void *lq_work0; +// void *lq_work1; + int iter; // iteration number +// int stat_max; // iterations saved in stat +// int stat_m; // numer of recorded stat per ipm iter +// int scale; +// int use_hess_fact; + int status; + hpipm_size_t memsize; // memory size (in bytes) of workspace + }; + + + +// +hpipm_size_t s_dense_qcqp_ipm_arg_memsize(struct s_dense_qcqp_dim *dim); +// +void s_dense_qcqp_ipm_arg_create(struct s_dense_qcqp_dim *dim, struct s_dense_qcqp_ipm_arg *arg, void *mem); +// +void s_dense_qcqp_ipm_arg_set_default(enum hpipm_mode mode, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set(char *field, void *value, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_iter_max(int *iter_max, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_alpha_min(float *alpha_min, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_mu0(float *mu0, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_tol_stat(float *tol_stat, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_tol_eq(float *tol_eq, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_tol_ineq(float *tol_ineq, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_tol_comp(float *tol_comp, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_reg_prim(float *reg, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_reg_dual(float *reg, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_warm_start(int *warm_start, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_pred_corr(int *pred_corr, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_cond_pred_corr(int *cond_pred_corr, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_comp_res_pred(int *comp_res_pred, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_comp_res_exit(int *comp_res_exit, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_lam_min(float *value, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_t_min(float *value, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_split_step(int *value, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_arg_set_t_lam_min(int *value, struct s_dense_qcqp_ipm_arg *arg); + +// +hpipm_size_t s_dense_qcqp_ipm_ws_memsize(struct s_dense_qcqp_dim *qp_dim, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_ipm_ws_create(struct s_dense_qcqp_dim *qp_dim, struct s_dense_qcqp_ipm_arg *arg, struct s_dense_qcqp_ipm_ws *ws, void *mem); +// +void s_dense_qcqp_ipm_get(char *field, struct s_dense_qcqp_ipm_ws *ws, void *value); +// +void s_dense_qcqp_ipm_get_status(struct s_dense_qcqp_ipm_ws *ws, int *status); +// +void s_dense_qcqp_ipm_get_iter(struct s_dense_qcqp_ipm_ws *ws, int *iter); +// +void s_dense_qcqp_ipm_get_max_res_stat(struct s_dense_qcqp_ipm_ws *ws, float *res_stat); +// +void s_dense_qcqp_ipm_get_max_res_eq(struct s_dense_qcqp_ipm_ws *ws, float *res_eq); +// +void s_dense_qcqp_ipm_get_max_res_ineq(struct s_dense_qcqp_ipm_ws *ws, float *res_ineq); +// +void s_dense_qcqp_ipm_get_max_res_comp(struct s_dense_qcqp_ipm_ws *ws, float *res_comp); +// +void s_dense_qcqp_ipm_get_stat(struct s_dense_qcqp_ipm_ws *ws, float **stat); +// +void s_dense_qcqp_ipm_get_stat_m(struct s_dense_qcqp_ipm_ws *ws, int *stat_m); +#if 0 +// +void s_dense_qcqp_init_var(struct s_dense_qcqp *qp, struct s_dense_qcqp_sol *qp_sol, struct s_dense_qcqp_ipm_arg *arg, struct s_dense_qcqp_ipm_ws *ws); +#endif +// +void s_dense_qcqp_ipm_solve(struct s_dense_qcqp *qp, struct s_dense_qcqp_sol *qp_sol, struct s_dense_qcqp_ipm_arg *arg, struct s_dense_qcqp_ipm_ws *ws); +#if 0 +// +void s_dense_qcqp_ipm_predict(struct s_dense_qcqp *qp, struct s_dense_qcqp_sol *qp_sol, struct s_dense_qcqp_ipm_arg *arg, struct s_dense_qcqp_ipm_ws *ws); +// +void s_dense_qcqp_ipm_sens(struct s_dense_qcqp *qp, struct s_dense_qcqp_sol *qp_sol, struct s_dense_qcqp_ipm_arg *arg, struct s_dense_qcqp_ipm_ws *ws); +#endif + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_DENSE_QCQP_IPM_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_res.h b/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_res.h new file mode 100644 index 000000000..779658cc8 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_res.h @@ -0,0 +1,108 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_DENSE_QCQP_RES_H_ +#define HPIPM_S_DENSE_QCQP_RES_H_ + + + +#include +#include + +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_dense_qcqp_res + { + struct s_dense_qcqp_dim *dim; + struct blasfeo_svec *res_g; // q-residuals + struct blasfeo_svec *res_b; // b-residuals + struct blasfeo_svec *res_d; // d-residuals + struct blasfeo_svec *res_m; // m-residuals + float res_max[4]; // infinity norm of residuals + float res_mu; // mu-residual + hpipm_size_t memsize; + }; + + + +struct s_dense_qcqp_res_ws + { + struct blasfeo_svec *tmp_nv; // work space of size nv + struct blasfeo_svec *tmp_nbgq; // work space of size nbM+ngM+nqM + struct blasfeo_svec *tmp_ns; // work space of size nsM + struct blasfeo_svec *q_fun; // value for evaluation of quadr constr + struct blasfeo_svec *q_adj; // value for adjoint of quadr constr + int use_q_fun; // reuse cached value for evaluation of quadr constr + int use_q_adj; // reuse cached value for adjoint of quadr constr + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_dense_qcqp_res_memsize(struct s_dense_qcqp_dim *dim); +// +void s_dense_qcqp_res_create(struct s_dense_qcqp_dim *dim, struct s_dense_qcqp_res *res, void *mem); +// +hpipm_size_t s_dense_qcqp_res_ws_memsize(struct s_dense_qcqp_dim *dim); +// +void s_dense_qcqp_res_ws_create(struct s_dense_qcqp_dim *dim, struct s_dense_qcqp_res_ws *workspace, void *mem); +// +void s_dense_qcqp_res_compute(struct s_dense_qcqp *qp, struct s_dense_qcqp_sol *qp_sol, struct s_dense_qcqp_res *res, struct s_dense_qcqp_res_ws *ws); +// +void s_dense_qcqp_res_compute_inf_norm(struct s_dense_qcqp_res *res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_S_DENSE_QCQP_RES_H_ + + + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_sol.h b/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_sol.h new file mode 100644 index 000000000..197a690e5 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_sol.h @@ -0,0 +1,86 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_S_DENSE_QCQP_SOL_H_ +#define HPIPM_S_DENSE_QCQP_SOL_H_ + + + +#include +#include + +#include "hpipm_s_dense_qcqp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_dense_qcqp_sol + { + struct s_dense_qcqp_dim *dim; + struct blasfeo_svec *v; + struct blasfeo_svec *pi; + struct blasfeo_svec *lam; + struct blasfeo_svec *t; + void *misc; + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_dense_qcqp_sol_memsize(struct s_dense_qcqp_dim *dim); +// +void s_dense_qcqp_sol_create(struct s_dense_qcqp_dim *dim, struct s_dense_qcqp_sol *qp_sol, void *memory); +// +void s_dense_qcqp_sol_get_v(struct s_dense_qcqp_sol *qp_sol, float *v); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_DENSE_QCQP_SOL_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_utils.h b/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_utils.h new file mode 100644 index 000000000..4f5aae26e --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_dense_qcqp_utils.h @@ -0,0 +1,83 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_DENSE_QCQP_UTILS_H_ +#define HPIPM_S_DENSE_QCQP_UTILS_H_ + + + +#include +#include + +#include "hpipm_s_dense_qcqp_dim.h" +#include "hpipm_s_dense_qcqp.h" +#include "hpipm_s_dense_qcqp_sol.h" +//#include "hpipm_s_dense_qcqp_ipm.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void s_dense_qcqp_dim_print(struct s_dense_qcqp_dim *qp_dim); +// +//void s_dense_qcqp_dim_codegen(char *file_name, char *mode, struct s_dense_qcqp_dim *qp_dim); +// +void s_dense_qcqp_print(struct s_dense_qcqp_dim *qp_dim, struct s_dense_qcqp *qp); +// +//void s_dense_qcqp_codegen(char *file_name, char *mode, struct s_dense_qcqp_dim *qp_dim, struct s_dense_qcqp *qp); +// +void s_dense_qcqp_sol_print(struct s_dense_qcqp_dim *qp_dim, struct s_dense_qcqp_sol *dense_qcqp_sol); +// +//void s_dense_qcqp_ipm_arg_codegen(char *file_name, char *mode, struct s_dense_qcqp_dim *qp_dim, struct s_dense_qcqp_ipm_arg *arg); +// +void s_dense_qcqp_res_print(struct s_dense_qcqp_dim *qp_dim, struct s_dense_qcqp_res *dense_qcqp_res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_S_DENSE_QCQP_UTILS_H_ + + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_dense_qp.h b/third_party/acados/include/hpipm/include/hpipm_s_dense_qp.h new file mode 100644 index 000000000..3c2517fe1 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_dense_qp.h @@ -0,0 +1,207 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_S_DENSE_QP_H_ +#define HPIPM_S_DENSE_QP_H_ + + + +#include +#include + +#include "hpipm_s_dense_qp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_dense_qp + { + struct s_dense_qp_dim *dim; + struct blasfeo_smat *Hv; // hessian & gradient + struct blasfeo_smat *A; // dynamics matrix + struct blasfeo_smat *Ct; // constraints matrix + struct blasfeo_svec *gz; // gradient & gradient of slacks + struct blasfeo_svec *b; // dynamics vector + struct blasfeo_svec *d; // constraints vector + struct blasfeo_svec *d_mask; // inequality constraints mask vector + struct blasfeo_svec *m; // rhs of complementarity condition + struct blasfeo_svec *Z; // (diagonal) hessian of slacks + int *idxb; // indices of box constrained variables within [u; x] + int *idxs_rev; // index of soft constraints (reverse storage) + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t s_dense_qp_memsize(struct s_dense_qp_dim *dim); +// +void s_dense_qp_create(struct s_dense_qp_dim *dim, struct s_dense_qp *qp, void *memory); + +// setters - colmaj +// +void s_dense_qp_set_all(float *H, float *g, float *A, float *b, int *idxb, float *d_lb, float *d_ub, float *C, float *d_lg, float *d_ug, float *Zl, float *Zu, float *zl, float *zu, int *idxs, float *d_ls, float *d_us, struct s_dense_qp *qp); +// +void s_dense_qp_get_all(struct s_dense_qp *qp, float *H, float *g, float *A, float *b, int *idxb, float *d_lb, float *d_ub, float *C, float *d_lg, float *d_ug, float *Zl, float *Zu, float *zl, float *zu, int *idxs, float *d_ls, float *d_us); +// +void s_dense_qp_set(char *field, void *value, struct s_dense_qp *qp); +// +void s_dense_qp_set_H(float *H, struct s_dense_qp *qp); +// +void s_dense_qp_set_g(float *g, struct s_dense_qp *qp); +// +void s_dense_qp_set_A(float *A, struct s_dense_qp *qp); +// +void s_dense_qp_set_b(float *b, struct s_dense_qp *qp); +// +void s_dense_qp_set_idxb(int *idxb, struct s_dense_qp *qp); +// +void s_dense_qp_set_Jb(float *Jb, struct s_dense_qp *qp); +// +void s_dense_qp_set_lb(float *lb, struct s_dense_qp *qp); +// +void s_dense_qp_set_lb_mask(float *lb, struct s_dense_qp *qp); +// +void s_dense_qp_set_ub(float *ub, struct s_dense_qp *qp); +// +void s_dense_qp_set_ub_mask(float *ub, struct s_dense_qp *qp); +// +void s_dense_qp_set_C(float *C, struct s_dense_qp *qp); +// +void s_dense_qp_set_lg(float *lg, struct s_dense_qp *qp); +// +void s_dense_qp_set_lg_mask(float *lg, struct s_dense_qp *qp); +// +void s_dense_qp_set_ug(float *ug, struct s_dense_qp *qp); +// +void s_dense_qp_set_ug_mask(float *ug, struct s_dense_qp *qp); +// +void s_dense_qp_set_idxs(int *idxs, struct s_dense_qp *qp); +// +void s_dense_qp_set_idxs_rev(int *idxs_rev, struct s_dense_qp *qp); +// +void s_dense_qp_set_Jsb(float *Jsb, struct s_dense_qp *qp); +// +void s_dense_qp_set_Jsg(float *Jsg, struct s_dense_qp *qp); +// +void s_dense_qp_set_Zl(float *Zl, struct s_dense_qp *qp); +// +void s_dense_qp_set_Zu(float *Zu, struct s_dense_qp *qp); +// +void s_dense_qp_set_zl(float *zl, struct s_dense_qp *qp); +// +void s_dense_qp_set_zu(float *zu, struct s_dense_qp *qp); +// +void s_dense_qp_set_ls(float *ls, struct s_dense_qp *qp); +// +void s_dense_qp_set_ls_mask(float *ls, struct s_dense_qp *qp); +// +void s_dense_qp_set_us(float *us, struct s_dense_qp *qp); +// +void s_dense_qp_set_us_mask(float *us, struct s_dense_qp *qp); + +// getters - colmaj +// +void s_dense_qp_get_H(struct s_dense_qp *qp, float *H); +// +void s_dense_qp_get_g(struct s_dense_qp *qp, float *g); +// +void s_dense_qp_get_A(struct s_dense_qp *qp, float *A); +// +void s_dense_qp_get_b(struct s_dense_qp *qp, float *b); +// +void s_dense_qp_get_idxb(struct s_dense_qp *qp, int *idxb); +// +void s_dense_qp_get_lb(struct s_dense_qp *qp, float *lb); +// +void s_dense_qp_get_lb_mask(struct s_dense_qp *qp, float *lb); +// +void s_dense_qp_get_ub(struct s_dense_qp *qp, float *ub); +// +void s_dense_qp_get_ub_mask(struct s_dense_qp *qp, float *ub); +// +void s_dense_qp_get_C(struct s_dense_qp *qp, float *C); +// +void s_dense_qp_get_lg(struct s_dense_qp *qp, float *lg); +// +void s_dense_qp_get_lg_mask(struct s_dense_qp *qp, float *lg); +// +void s_dense_qp_get_ug(struct s_dense_qp *qp, float *ug); +// +void s_dense_qp_get_ug_mask(struct s_dense_qp *qp, float *ug); +// +void s_dense_qp_get_idxs(struct s_dense_qp *qp, int *idxs); +// +void s_dense_qp_get_idxs_rev(struct s_dense_qp *qp, int *idxs_rev); +// +void s_dense_qp_get_Zl(struct s_dense_qp *qp, float *Zl); +// +void s_dense_qp_get_Zu(struct s_dense_qp *qp, float *Zu); +// +void s_dense_qp_get_zl(struct s_dense_qp *qp, float *zl); +// +void s_dense_qp_get_zu(struct s_dense_qp *qp, float *zu); +// +void s_dense_qp_get_ls(struct s_dense_qp *qp, float *ls); +// +void s_dense_qp_get_ls_mask(struct s_dense_qp *qp, float *ls); +// +void s_dense_qp_get_us(struct s_dense_qp *qp, float *us); +// +void s_dense_qp_get_us_mask(struct s_dense_qp *qp, float *us); + +// setters - rowmaj +// +void s_dense_qp_set_all_rowmaj(float *H, float *g, float *A, float *b, int *idxb, float *d_lb, float *d_ub, float *C, float *d_lg, float *d_ug, float *Zl, float *Zu, float *zl, float *zu, int *idxs, float *d_ls, float *d_us, struct s_dense_qp *qp); + +// getters - rowmaj +// +void s_dense_qp_get_all_rowmaj(struct s_dense_qp *qp, float *H, float *g, float *A, float *b, int *idxb, float *d_lb, float *d_ub, float *C, float *d_lg, float *d_ug, float *Zl, float *Zu, float *zl, float *zu, int *idxs, float *d_ls, float *d_us); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_DENSE_QP_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_dim.h b/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_dim.h new file mode 100644 index 000000000..b979d2443 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_dim.h @@ -0,0 +1,94 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_DENSE_QP_DIM_H_ +#define HPIPM_S_DENSE_QP_DIM_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_dense_qp_dim + { + int nv; // number of variables + int ne; // number of equality constraints + int nb; // number of box constraints + int ng; // number of general constraints + int nsb; // number of softened box constraints + int nsg; // number of softened general constraints + int ns; // number of softened constraints (nsb+nsg) + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_dense_qp_dim_memsize(); +// +void s_dense_qp_dim_create(struct s_dense_qp_dim *qp_dim, void *memory); +// +void s_dense_qp_dim_set_all(int nv, int ne, int nb, int ng, int nsb, int nsg, struct s_dense_qp_dim *dim); +// +void s_dense_qp_dim_set(char *fiels_name, int value, struct s_dense_qp_dim *dim); +// +void s_dense_qp_dim_set_nv(int value, struct s_dense_qp_dim *dim); +// +void s_dense_qp_dim_set_ne(int value, struct s_dense_qp_dim *dim); +// +void s_dense_qp_dim_set_nb(int value, struct s_dense_qp_dim *dim); +// +void s_dense_qp_dim_set_ng(int value, struct s_dense_qp_dim *dim); +// +void s_dense_qp_dim_set_nsb(int value, struct s_dense_qp_dim *dim); +// +void s_dense_qp_dim_set_nsg(int value, struct s_dense_qp_dim *dim); +// +void s_dense_qp_dim_set_ns(int value, struct s_dense_qp_dim *dim); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_S_DENSE_QP_DIM_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_ipm.h b/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_ipm.h new file mode 100644 index 000000000..f2d56d452 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_ipm.h @@ -0,0 +1,260 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_S_DENSE_QP_IPM_H_ +#define HPIPM_S_DENSE_QP_IPM_H_ + + + +#include +#include + +#include +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_dense_qp_ipm_arg + { + float mu0; // initial value for duality measure + float alpha_min; // exit cond on step length + float res_g_max; // exit cond on inf norm of residuals + float res_b_max; // exit cond on inf norm of residuals + float res_d_max; // exit cond on inf norm of residuals + float res_m_max; // exit cond on inf norm of residuals + float reg_prim; // reg of primal hessian + float reg_dual; // reg of dual hessian + float lam_min; // min value in lam vector + float t_min; // min value in t vector + float tau_min; // min value of barrier parameter + int iter_max; // exit cond in iter number + int stat_max; // iterations saved in stat + int pred_corr; // Mehrotra's predictor-corrector IPM algirthm + int cond_pred_corr; // conditional Mehrotra's predictor-corrector + int scale; // scale hessian + int itref_pred_max; // max number of iterative refinement steps for predictor step + int itref_corr_max; // max number of iterative refinement steps for corrector step + int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol + int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq + int abs_form; // absolute IPM formulation + int comp_res_exit; // compute residuals on exit (only for abs_form==1) + int comp_res_pred; // compute residuals of prediction + int kkt_fact_alg; // 0 null-space, 1 schur-complement + int remove_lin_dep_eq; // 0 do not, 1 do check and remove linearly dependent equality constraints + int compute_obj; // compute obj on exit + int split_step; // use different steps for primal and dual variables + int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution + int mode; + hpipm_size_t memsize; + }; + + + +struct s_dense_qp_ipm_ws + { + struct s_core_qp_ipm_workspace *core_workspace; + struct s_dense_qp_res_ws *res_ws; + struct s_dense_qp_sol *sol_step; + struct s_dense_qp_sol *sol_itref; + struct s_dense_qp *qp_step; + struct s_dense_qp *qp_itref; + struct s_dense_qp_res *res; + struct s_dense_qp_res *res_itref; + struct s_dense_qp_res *res_step; + struct blasfeo_svec *Gamma; // + struct blasfeo_svec *gamma; // + struct blasfeo_svec *Zs_inv; // + struct blasfeo_smat *Lv; // + struct blasfeo_smat *AL; // + struct blasfeo_smat *Le; // + struct blasfeo_smat *Ctx; // + struct blasfeo_svec *lv; // + struct blasfeo_svec *sv; // scale for Lv + struct blasfeo_svec *se; // scale for Le + struct blasfeo_svec *tmp_nbg; // work space of size nb+ng + struct blasfeo_svec *tmp_ns; // work space of size ns + struct blasfeo_smat *lq0; + struct blasfeo_smat *lq1; + struct blasfeo_svec *tmp_m; + struct blasfeo_smat *A_LQ; + struct blasfeo_smat *A_Q; + struct blasfeo_smat *Zt; + struct blasfeo_smat *ZtH; + struct blasfeo_smat *ZtHZ; + struct blasfeo_svec *xy; + struct blasfeo_svec *Yxy; + struct blasfeo_svec *xz; + struct blasfeo_svec *tmp_nv; + struct blasfeo_svec *tmp_2ns; + struct blasfeo_svec *tmp_nv2ns; + struct blasfeo_smat *A_li; // A of linearly independent equality constraints + struct blasfeo_svec *b_li; // b of linearly independent equality constraints + struct blasfeo_smat *A_bkp; // pointer to backup A + struct blasfeo_svec *b_bkp; // pointer to backup b + struct blasfeo_smat *Ab_LU; + float *stat; // convergence statistics + int *ipiv_v; + int *ipiv_e; + int *ipiv_e1; + void *lq_work0; + void *lq_work1; + void *lq_work_null; + void *orglq_work_null; + int iter; // iteration number + int stat_max; // iterations saved in stat + int stat_m; // numer of recorded stat per ipm iter + int scale; + int use_hess_fact; + int use_A_fact; + int status; + int lq_fact; // cache from arg + int mask_constr; // use constr mask + int ne_li; // number of linearly independent equality constraints + int ne_bkp; // ne backup + hpipm_size_t memsize; // memory size (in bytes) of workspace + }; + + + +// +hpipm_size_t s_dense_qp_ipm_arg_memsize(struct s_dense_qp_dim *qp_dim); +// +void s_dense_qp_ipm_arg_create(struct s_dense_qp_dim *qp_dim, struct s_dense_qp_ipm_arg *arg, void *mem); +// +void s_dense_qp_ipm_arg_set_default(enum hpipm_mode mode, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set(char *field, void *value, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_iter_max(int *iter_max, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_alpha_min(float *alpha_min, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_mu0(float *mu0, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_tol_stat(float *tol_stat, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_tol_eq(float *tol_eq, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_tol_ineq(float *tol_ineq, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_tol_comp(float *tol_comp, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_reg_prim(float *reg, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_reg_dual(float *reg, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_warm_start(int *warm_start, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_pred_corr(int *pred_corr, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_cond_pred_corr(int *cond_pred_corr, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_comp_res_pred(int *comp_res_pred, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_comp_res_exit(int *comp_res_exit, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_lam_min(float *value, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_t_min(float *value, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_tau_min(float *value, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_kkt_fact_alg(int *value, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_remove_lin_dep_eq(int *value, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_compute_obj(int *value, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_split_step(int *value, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_arg_set_t_lam_min(int *value, struct s_dense_qp_ipm_arg *arg); + +// +hpipm_size_t s_dense_qp_ipm_ws_memsize(struct s_dense_qp_dim *qp_dim, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_ipm_ws_create(struct s_dense_qp_dim *qp_dim, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws, void *mem); +// +void s_dense_qp_ipm_get(char *field, struct s_dense_qp_ipm_ws *ws, void *value); +// +void s_dense_qp_ipm_get_status(struct s_dense_qp_ipm_ws *ws, int *status); +// +void s_dense_qp_ipm_get_iter(struct s_dense_qp_ipm_ws *ws, int *iter); +// +void s_dense_qp_ipm_get_max_res_stat(struct s_dense_qp_ipm_ws *ws, float *res_stat); +// +void s_dense_qp_ipm_get_max_res_eq(struct s_dense_qp_ipm_ws *ws, float *res_eq); +// +void s_dense_qp_ipm_get_max_res_ineq(struct s_dense_qp_ipm_ws *ws, float *res_ineq); +// +void s_dense_qp_ipm_get_max_res_comp(struct s_dense_qp_ipm_ws *ws, float *res_comp); +// +void s_dense_qp_ipm_get_stat(struct s_dense_qp_ipm_ws *ws, float **stat); +// +void s_dense_qp_ipm_get_stat_m(struct s_dense_qp_ipm_ws *ws, int *stat_m); +// +void s_dense_qp_init_var(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws); +// +void s_dense_qp_ipm_abs_step(int kk, struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws); +// +void s_dense_qp_ipm_delta_step(int kk, struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws); +// +void s_dense_qp_ipm_solve(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws); +// +void s_dense_qp_ipm_predict(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws); +// +void s_dense_qp_ipm_sens(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws); +// +void s_dense_qp_compute_step_length(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_DENSE_QP_IPM_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_kkt.h b/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_kkt.h new file mode 100644 index 000000000..260dc0ab2 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_kkt.h @@ -0,0 +1,72 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_S_DENSE_QP_KKT_H_ +#define HPIPM_S_DENSE_QP_KKT_H_ + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void s_fact_solve_kkt_unconstr_dense_qp(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws); +// +void s_fact_solve_kkt_step_dense_qp(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws); +// +void s_fact_lq_solve_kkt_step_dense_qp(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws); +// +void s_solve_kkt_step_dense_qp(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws); +// +void s_dense_qp_remove_lin_dep_eq(struct s_dense_qp *qp, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws); +// +void s_dense_qp_restore_lin_dep_eq(struct s_dense_qp *qp, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws); +// +void s_dense_qp_compute_obj(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_DENSE_QP_KKT_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_res.h b/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_res.h new file mode 100644 index 000000000..06b609c53 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_res.h @@ -0,0 +1,106 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_DENSE_QP_RES_H_ +#define HPIPM_S_DENSE_QP_RES_H_ + + + +#include +#include + +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_dense_qp_res + { + struct s_dense_qp_dim *dim; + struct blasfeo_svec *res_g; // q-residuals + struct blasfeo_svec *res_b; // b-residuals + struct blasfeo_svec *res_d; // d-residuals + struct blasfeo_svec *res_m; // m-residuals + float res_max[4]; // max of residuals + float res_mu; // mu-residual + hpipm_size_t memsize; + }; + + + +struct s_dense_qp_res_ws + { + struct blasfeo_svec *tmp_nbg; // work space of size nbM+ngM + struct blasfeo_svec *tmp_ns; // work space of size nsM + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_dense_qp_res_memsize(struct s_dense_qp_dim *dim); +// +void s_dense_qp_res_create(struct s_dense_qp_dim *dim, struct s_dense_qp_res *res, void *mem); +// +hpipm_size_t s_dense_qp_res_ws_memsize(struct s_dense_qp_dim *dim); +// +void s_dense_qp_res_ws_create(struct s_dense_qp_dim *dim, struct s_dense_qp_res_ws *workspace, void *mem); +// +void s_dense_qp_res_compute(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_res *res, struct s_dense_qp_res_ws *ws); +// +void s_dense_qp_res_compute_lin(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_sol *qp_step, struct s_dense_qp_res *res, struct s_dense_qp_res_ws *ws); +// +void s_dense_qp_res_compute_inf_norm(struct s_dense_qp_res *res); +// +void s_dense_qp_res_get_all(struct s_dense_qp_res *res, float *res_g, float *res_ls, float *res_us, float *res_b, float *res_d_lb, float *res_d_ub, float *res_d_lg, float *res_d_ug, float *res_d_ls, float *res_d_us, float *res_m_lb, float *res_m_ub, float *res_m_lg, float *res_m_ug, float *res_m_ls, float *res_m_us); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_D_DENSE_QP_RES_H_ + + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_sol.h b/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_sol.h new file mode 100644 index 000000000..1f4007637 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_sol.h @@ -0,0 +1,94 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_S_DENSE_QP_SOL_H_ +#define HPIPM_S_DENSE_QP_SOL_H_ + + + +#include +#include + +#include "hpipm_s_dense_qp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_dense_qp_sol + { + struct s_dense_qp_dim *dim; + struct blasfeo_svec *v; + struct blasfeo_svec *pi; + struct blasfeo_svec *lam; + struct blasfeo_svec *t; + void *misc; + float obj; + int valid_obj; + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_dense_qp_sol_memsize(struct s_dense_qp_dim *dim); +// +void s_dense_qp_sol_create(struct s_dense_qp_dim *dim, struct s_dense_qp_sol *qp_sol, void *memory); +// +void s_dense_qp_sol_get_all(struct s_dense_qp_sol *qp_sol, float *v, float *ls, float *us, float *pi, float *lam_lb, float *lam_ub, float *lam_lg, float *lam_ug, float *lam_ls, float *lam_us); +// +void s_dense_qp_sol_get(char *field, struct s_dense_qp_sol *sol, void *value); +// +void s_dense_qp_sol_get_v(struct s_dense_qp_sol *sol, float *v); +// +void s_dense_qp_sol_get_valid_obj(struct s_dense_qp_sol *sol, int *valid_obj); +// +void s_dense_qp_sol_get_obj(struct s_dense_qp_sol *sol, float *obj); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_DENSE_QP_SOL_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_utils.h b/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_utils.h new file mode 100644 index 000000000..3dd93259a --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_dense_qp_utils.h @@ -0,0 +1,84 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_DENSE_QP_UTILS_H_ +#define HPIPM_S_DENSE_QP_UTILS_H_ + + + +#include +#include + +#include "hpipm_s_dense_qp_dim.h" +#include "hpipm_s_dense_qp.h" +#include "hpipm_s_dense_qp_sol.h" +#include "hpipm_s_dense_qp_ipm.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void s_dense_qp_dim_print(struct s_dense_qp_dim *qp_dim); +// +//void s_dense_qp_dim_codegen(char *file_name, char *mode, struct s_dense_qp_dim *qp_dim); +// +void s_dense_qp_print(struct s_dense_qp_dim *qp_dim, struct s_dense_qp *qp); +// +//void s_dense_qp_codegen(char *file_name, char *mode, struct s_dense_qp_dim *qp_dim, struct s_dense_qp *qp); +// +void s_dense_qp_sol_print(struct s_dense_qp_dim *qp_dim, struct s_dense_qp_sol *dense_qp_sol); +// +//void s_dense_qp_ipm_arg_codegen(char *file_name, char *mode, struct s_dense_qp_dim *qp_dim, struct s_dense_qp_ipm_arg *arg); +// +void s_dense_qp_res_print(struct s_dense_qp_dim *qp_dim, struct s_dense_qp_res *dense_qp_res); +// +void s_dense_qp_arg_print(struct s_dense_qp_dim *qp_dim, struct s_dense_qp_ipm_arg *qp_ipm_arg); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_S_DENSE_QP_UTILS_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp.h b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp.h new file mode 100644 index 000000000..b90b2ac63 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp.h @@ -0,0 +1,303 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_OCP_QCQP_H_ +#define HPIPM_S_OCP_QCQP_H_ + + + +#include +#include + +#include "hpipm_s_ocp_qcqp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_ocp_qcqp + { + struct s_ocp_qcqp_dim *dim; + struct blasfeo_smat *BAbt; // dynamics matrix & vector work space + struct blasfeo_smat *RSQrq; // hessian of cost & vector work space + struct blasfeo_smat *DCt; // inequality constraints matrix + struct blasfeo_smat **Hq; // hessians of quadratic constraints + struct blasfeo_svec *b; // dynamics vector + struct blasfeo_svec *rqz; // gradient of cost & gradient of slacks + struct blasfeo_svec *d; // inequality constraints vector + struct blasfeo_svec *d_mask; // inequality constraints mask vector + struct blasfeo_svec *m; // rhs of complementarity condition + struct blasfeo_svec *Z; // (diagonal) hessian of slacks + int **idxb; // indices of box constrained variables within [u; x] + int **idxs_rev; // index of soft constraints (reverse storage) + int **Hq_nzero; // for each int, the last 3 bits ...abc, {a,b,c}=0 => {R,S,Q}=0 + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t s_ocp_qcqp_strsize(); +// +hpipm_size_t s_ocp_qcqp_memsize(struct s_ocp_qcqp_dim *dim); +// +void s_ocp_qcqp_create(struct s_ocp_qcqp_dim *dim, struct s_ocp_qcqp *qp, void *memory); +// +void s_ocp_qcqp_copy_all(struct s_ocp_qcqp *qp_orig, struct s_ocp_qcqp *qp_dest); + +// setters +// +void s_ocp_qcqp_set_all_zero(struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_rhs_zero(struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set(char *fiels_name, int stage, void *value, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_el(char *fiels_name, int stage, int index, void *value, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_A(int stage, float *mat, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_B(int stage, float *mat, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_b(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_Q(int stage, float *mat, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_S(int stage, float *mat, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_R(int stage, float *mat, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_q(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_r(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_lb(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_lb_mask(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_ub(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_ub_mask(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_lbx(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_lbx_mask(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_el_lbx(int stage, int index, float *elem, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_ubx(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_ubx_mask(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_el_ubx(int stage, int index, float *elem, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_lbu(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_lbu_mask(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_ubu(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_ubu_mask(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_idxb(int stage, int *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_idxbx(int stage, int *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_Jbx(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_idxbu(int stage, int *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_Jbu(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_C(int stage, float *mat, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_D(int stage, float *mat, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_lg(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_lg_mask(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_ug(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_ug_mask(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_Qq(int stage, float *mat, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_Sq(int stage, float *mat, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_Rq(int stage, float *mat, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_qq(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_rq(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_uq(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_uq_mask(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_Zl(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_Zu(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_zl(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_zu(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_lls(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_lls_mask(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_lus(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_lus_mask(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_idxs(int stage, int *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_idxs_rev(int stage, int *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_Jsbu(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_Jsbx(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_Jsg(int stage, float *vec, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_set_Jsq(int stage, float *vec, struct s_ocp_qcqp *qp); + +// getters +// +void s_ocp_qcqp_get(char *field, int stage, struct s_ocp_qcqp *qp, void *value); +// +void s_ocp_qcqp_get_A(int stage, struct s_ocp_qcqp *qp, float *mat); +// +void s_ocp_qcqp_get_B(int stage, struct s_ocp_qcqp *qp, float *mat); +// +void s_ocp_qcqp_get_b(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_Q(int stage, struct s_ocp_qcqp *qp, float *mat); +// +void s_ocp_qcqp_get_S(int stage, struct s_ocp_qcqp *qp, float *mat); +// +void s_ocp_qcqp_get_R(int stage, struct s_ocp_qcqp *qp, float *mat); +// +void s_ocp_qcqp_get_q(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_r(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_ub(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_ub_mask(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_lb(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_lb_mask(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_lbx(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_lbx_mask(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_ubx(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_ubx_mask(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_lbu(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_lbu_mask(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_ubu(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_ubu_mask(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_idxb(int stage, struct s_ocp_qcqp *qp, int *vec); +// +//void s_ocp_qcqp_get_idxbx(int stage, struct s_ocp_qcqp *qp, int *vec); +// +//void s_ocp_qcqp_get_Jbx(int stage, struct s_ocp_qcqp *qp, float *vec); +// +//void s_ocp_qcqp_get_idxbu(int stage, struct s_ocp_qcqp *qp, int *vec); +// +//void s_ocp_qcqp_get_Jbu(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_C(int stage, struct s_ocp_qcqp *qp, float *mat); +// +void s_ocp_qcqp_get_D(int stage, struct s_ocp_qcqp *qp, float *mat); +// +void s_ocp_qcqp_get_lg(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_lg_mask(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_ug(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_ug_mask(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_Zl(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_Zu(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_zl(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_zu(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_lls(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_lls_mask(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_lus(int stage, struct s_ocp_qcqp *qp, float *vec); +// +void s_ocp_qcqp_get_lus_mask(int stage, struct s_ocp_qcqp *qp, float *vec); +// XXX only valid if there is one slack per softed constraint !!! +void s_ocp_qcqp_get_idxs(int stage, struct s_ocp_qcqp *qp, int *vec); +// +void s_ocp_qcqp_get_idxs_rev(int stage, struct s_ocp_qcqp *qp, int *vec); +// +//void s_ocp_qcqp_get_Jsbu(int stage, struct s_ocp_qcqp *qp, float *vec); +// +//void s_ocp_qcqp_get_Jsbx(int stage, struct s_ocp_qcqp *qp, float *vec); +// +//void s_ocp_qcqp_get_Jsg(int stage, struct s_ocp_qcqp *qp, float *vec); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_OCP_QCQP_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_dim.h b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_dim.h new file mode 100644 index 000000000..c09903f07 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_dim.h @@ -0,0 +1,119 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_OCP_QCQP_DIM_H_ +#define HPIPM_S_OCP_QCQP_DIM_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_ocp_qcqp_dim + { + struct s_ocp_qp_dim *qp_dim; // dim of qp approximation + int *nx; // number of states + int *nu; // number of inputs + int *nb; // number of box constraints + int *nbx; // number of (two-sided) state box constraints + int *nbu; // number of (two-sided) input box constraints + int *ng; // number of (two-sided) general constraints + int *nq; // number of (upper) quadratic constraints + int *ns; // number of soft constraints + int *nsbx; // number of (two-sided) soft state box constraints + int *nsbu; // number of (two-sided) soft input box constraints + int *nsg; // number of (two-sided) soft general constraints + int *nsq; // number of (upper) soft quadratic constraints + int N; // horizon length + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_ocp_qcqp_dim_strsize(); +// +hpipm_size_t s_ocp_qcqp_dim_memsize(int N); +// +void s_ocp_qcqp_dim_create(int N, struct s_ocp_qcqp_dim *qp_dim, void *memory); +// +void s_ocp_qcqp_dim_copy_all(struct s_ocp_qcqp_dim *dim_orig, struct s_ocp_qcqp_dim *dim_dest); +// +void s_ocp_qcqp_dim_set(char *field, int stage, int value, struct s_ocp_qcqp_dim *dim); +// +void s_ocp_qcqp_dim_set_nx(int stage, int value, struct s_ocp_qcqp_dim *dim); +// +void s_ocp_qcqp_dim_set_nu(int stage, int value, struct s_ocp_qcqp_dim *dim); +// +void s_ocp_qcqp_dim_set_nbx(int stage, int value, struct s_ocp_qcqp_dim *dim); +// +void s_ocp_qcqp_dim_set_nbu(int stage, int value, struct s_ocp_qcqp_dim *dim); +// +void s_ocp_qcqp_dim_set_ng(int stage, int value, struct s_ocp_qcqp_dim *dim); +// +void s_ocp_qcqp_dim_set_nq(int stage, int value, struct s_ocp_qcqp_dim *dim); +// +void s_ocp_qcqp_dim_set_ns(int stage, int value, struct s_ocp_qcqp_dim *dim); +// +void s_ocp_qcqp_dim_set_nsbx(int stage, int value, struct s_ocp_qcqp_dim *dim); +// +void s_ocp_qcqp_dim_set_nsbu(int stage, int value, struct s_ocp_qcqp_dim *dim); +// +void s_ocp_qcqp_dim_set_nsg(int stage, int value, struct s_ocp_qcqp_dim *dim); +// +void s_ocp_qcqp_dim_set_nsq(int stage, int value, struct s_ocp_qcqp_dim *dim); +// +void s_ocp_qcqp_dim_get(struct s_ocp_qcqp_dim *dim, char *field, int stage, int *value); +// +void s_ocp_qcqp_dim_get_N(struct s_ocp_qcqp_dim *dim, int *value); +// +void s_ocp_qcqp_dim_get_nx(struct s_ocp_qcqp_dim *dim, int stage, int *value); +// +void s_ocp_qcqp_dim_get_nu(struct s_ocp_qcqp_dim *dim, int stage, int *value); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_S_OCP_QCQP_DIM_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_ipm.h b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_ipm.h new file mode 100644 index 000000000..c14fc1c9f --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_ipm.h @@ -0,0 +1,191 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_OCP_QCQP_IPM_H_ +#define HPIPM_S_OCP_QCQP_IPM_H_ + + + +#include +#include + +#include +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_ocp_qcqp_ipm_arg + { + struct s_ocp_qp_ipm_arg *qp_arg; + float mu0; // initial value for complementarity slackness + float alpha_min; // exit cond on step length + float res_g_max; // exit cond on inf norm of residuals + float res_b_max; // exit cond on inf norm of residuals + float res_d_max; // exit cond on inf norm of residuals + float res_m_max; // exit cond on inf norm of residuals + float reg_prim; // reg of primal hessian + float lam_min; // min value in lam vector + float t_min; // min value in t vector + int iter_max; // exit cond in iter number + int stat_max; // iterations saved in stat + int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm + int cond_pred_corr; // conditional Mehrotra's predictor-corrector + int itref_pred_max; // max number of iterative refinement steps for predictor step + int itref_corr_max; // max number of iterative refinement steps for corrector step + int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol + int square_root_alg; // 0 classical Riccati, 1 square-root Riccati + int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq (for square_root_alg==1) + int abs_form; // absolute IPM formulation + int comp_dual_sol_eq; // dual solution of equality constraints (only for abs_form==1) + int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol_eq==1) + int comp_res_pred; // compute residuals of prediction + int split_step; // use different step for primal and dual variables + int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution + int mode; + hpipm_size_t memsize; + }; + + + +struct s_ocp_qcqp_ipm_ws + { + struct s_ocp_qp_ipm_ws *qp_ws; + struct s_ocp_qp *qp; + struct s_ocp_qp_sol *qp_sol; + struct s_ocp_qcqp_res_ws *qcqp_res_ws; + struct s_ocp_qcqp_res *qcqp_res; + struct blasfeo_svec *tmp_nuxM; + int iter; // iteration number + int status; + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_ocp_qcqp_ipm_arg_strsize(); +// +hpipm_size_t s_ocp_qcqp_ipm_arg_memsize(struct s_ocp_qcqp_dim *ocp_dim); +// +void s_ocp_qcqp_ipm_arg_create(struct s_ocp_qcqp_dim *ocp_dim, struct s_ocp_qcqp_ipm_arg *arg, void *mem); +// +void s_ocp_qcqp_ipm_arg_set_default(enum hpipm_mode mode, struct s_ocp_qcqp_ipm_arg *arg); +// +void s_ocp_qcqp_ipm_arg_set(char *field, void *value, struct s_ocp_qcqp_ipm_arg *arg); +// set maximum number of iterations +void s_ocp_qcqp_ipm_arg_set_iter_max(int *value, struct s_ocp_qcqp_ipm_arg *arg); +// set minimum step lenght +void s_ocp_qcqp_ipm_arg_set_alpha_min(float *value, struct s_ocp_qcqp_ipm_arg *arg); +// set initial value of barrier parameter +void s_ocp_qcqp_ipm_arg_set_mu0(float *value, struct s_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on stationarity condition +void s_ocp_qcqp_ipm_arg_set_tol_stat(float *value, struct s_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on equality constr +void s_ocp_qcqp_ipm_arg_set_tol_eq(float *value, struct s_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on inequality constr +void s_ocp_qcqp_ipm_arg_set_tol_ineq(float *value, struct s_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on complementarity condition +void s_ocp_qcqp_ipm_arg_set_tol_comp(float *value, struct s_ocp_qcqp_ipm_arg *arg); +// set regularization of primal variables +void s_ocp_qcqp_ipm_arg_set_reg_prim(float *value, struct s_ocp_qcqp_ipm_arg *arg); +// set warm start: 0 no warm start, 1 primal var +void s_ocp_qcqp_ipm_arg_set_warm_start(int *value, struct s_ocp_qcqp_ipm_arg *arg); +// Mehrotra's predictor-corrector IPM algorithm: 0 no predictor-corrector, 1 use predictor-corrector +void s_ocp_qcqp_ipm_arg_set_pred_corr(int *value, struct s_ocp_qcqp_ipm_arg *arg); +// conditional predictor-corrector: 0 no conditinal predictor-corrector, 1 conditional predictor-corrector +void s_ocp_qcqp_ipm_arg_set_cond_pred_corr(int *value, struct s_ocp_qcqp_ipm_arg *arg); +// set riccati algorithm: 0 classic, 1 square-root +void s_ocp_qcqp_ipm_arg_set_ric_alg(int *value, struct s_ocp_qcqp_ipm_arg *arg); +// compute residuals after solution +void s_ocp_qcqp_ipm_arg_set_comp_res_exit(int *value, struct s_ocp_qcqp_ipm_arg *arg); +// compute residuals of prediction +void s_ocp_qcqp_ipm_arg_set_comp_res_pred(int *value, struct s_ocp_qcqp_ipm_arg *arg); +// min value of lam in the solution +void s_ocp_qcqp_ipm_arg_set_lam_min(float *value, struct s_ocp_qcqp_ipm_arg *arg); +// min value of t in the solution +void s_ocp_qcqp_ipm_arg_set_t_min(float *value, struct s_ocp_qcqp_ipm_arg *arg); +// use different step for primal and dual variables +void s_ocp_qcqp_ipm_arg_set_split_step(int *value, struct s_ocp_qcqp_ipm_arg *arg); +// clip t and lam: 0 no, 1 in Gamma computation, 2 in solution +void s_ocp_qcqp_ipm_arg_set_t_lam_min(int *value, struct s_ocp_qcqp_ipm_arg *arg); + +// +hpipm_size_t s_ocp_qcqp_ipm_ws_strsize(); +// +hpipm_size_t s_ocp_qcqp_ipm_ws_memsize(struct s_ocp_qcqp_dim *ocp_dim, struct s_ocp_qcqp_ipm_arg *arg); +// +void s_ocp_qcqp_ipm_ws_create(struct s_ocp_qcqp_dim *ocp_dim, struct s_ocp_qcqp_ipm_arg *arg, struct s_ocp_qcqp_ipm_ws *ws, void *mem); +// +void s_ocp_qcqp_ipm_get(char *field, struct s_ocp_qcqp_ipm_ws *ws, void *value); +// +void s_ocp_qcqp_ipm_get_status(struct s_ocp_qcqp_ipm_ws *ws, int *status); +// +void s_ocp_qcqp_ipm_get_iter(struct s_ocp_qcqp_ipm_ws *ws, int *iter); +// +void s_ocp_qcqp_ipm_get_max_res_stat(struct s_ocp_qcqp_ipm_ws *ws, float *res_stat); +// +void s_ocp_qcqp_ipm_get_max_res_eq(struct s_ocp_qcqp_ipm_ws *ws, float *res_eq); +// +void s_ocp_qcqp_ipm_get_max_res_ineq(struct s_ocp_qcqp_ipm_ws *ws, float *res_ineq); +// +void s_ocp_qcqp_ipm_get_max_res_comp(struct s_ocp_qcqp_ipm_ws *ws, float *res_comp); +// +void s_ocp_qcqp_ipm_get_stat(struct s_ocp_qcqp_ipm_ws *ws, float **stat); +// +void s_ocp_qcqp_ipm_get_stat_m(struct s_ocp_qcqp_ipm_ws *ws, int *stat_m); +// +void s_ocp_qcqp_init_var(struct s_ocp_qcqp *qp, struct s_ocp_qcqp_sol *qp_sol, struct s_ocp_qcqp_ipm_arg *arg, struct s_ocp_qcqp_ipm_ws *ws); +// +void s_ocp_qcqp_ipm_solve(struct s_ocp_qcqp *qp, struct s_ocp_qcqp_sol *qp_sol, struct s_ocp_qcqp_ipm_arg *arg, struct s_ocp_qcqp_ipm_ws *ws); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_S_OCP_QCQP_IPM_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_res.h b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_res.h new file mode 100644 index 000000000..1ceeec93b --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_res.h @@ -0,0 +1,115 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_OCP_QCQP_RES_H_ +#define HPIPM_S_OCP_QCQP_RES_H_ + + + +#include +#include + +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_ocp_qcqp_res + { + struct s_ocp_qcqp_dim *dim; + struct blasfeo_svec *res_g; // q-residuals + struct blasfeo_svec *res_b; // b-residuals + struct blasfeo_svec *res_d; // d-residuals + struct blasfeo_svec *res_m; // m-residuals + float res_max[4]; // max of residuals + float res_mu; // mu-residual + hpipm_size_t memsize; + }; + + + +struct s_ocp_qcqp_res_ws + { + struct blasfeo_svec *tmp_nuxM; // work space of size nuM+nxM + struct blasfeo_svec *tmp_nbgqM; // work space of size nbM+ngM+nqM + struct blasfeo_svec *tmp_nsM; // work space of size nsM + struct blasfeo_svec *q_fun; // value for evaluation of quadr constr + struct blasfeo_svec *q_adj; // value for adjoint of quadr constr + int use_q_fun; // reuse cached value for evaluation of quadr constr + int use_q_adj; // reuse cached value for adjoint of quadr constr + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_ocp_qcqp_res_memsize(struct s_ocp_qcqp_dim *ocp_dim); +// +void s_ocp_qcqp_res_create(struct s_ocp_qcqp_dim *ocp_dim, struct s_ocp_qcqp_res *res, void *mem); +// +hpipm_size_t s_ocp_qcqp_res_ws_memsize(struct s_ocp_qcqp_dim *ocp_dim); +// +void s_ocp_qcqp_res_ws_create(struct s_ocp_qcqp_dim *ocp_dim, struct s_ocp_qcqp_res_ws *workspace, void *mem); +// +void s_ocp_qcqp_res_compute(struct s_ocp_qcqp *qp, struct s_ocp_qcqp_sol *qp_sol, struct s_ocp_qcqp_res *res, struct s_ocp_qcqp_res_ws *ws); +// +void s_ocp_qcqp_res_compute_inf_norm(struct s_ocp_qcqp_res *res); +// +void s_ocp_qcqp_res_get_max_res_stat(struct s_ocp_qcqp_res *res, float *value); +// +void s_ocp_qcqp_res_get_max_res_eq(struct s_ocp_qcqp_res *res, float *value); +// +void s_ocp_qcqp_res_get_max_res_ineq(struct s_ocp_qcqp_res *res, float *value); +// +void s_ocp_qcqp_res_get_max_res_comp(struct s_ocp_qcqp_res *res, float *value); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_S_OCP_QCQP_RES_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_sol.h b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_sol.h new file mode 100644 index 000000000..3d58022cc --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_sol.h @@ -0,0 +1,115 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_OCP_QCQP_SOL_H_ +#define HPIPM_S_OCP_QCQP_SOL_H_ + + + +#include +#include + +#include "hpipm_s_ocp_qcqp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_ocp_qcqp_sol + { + struct s_ocp_qcqp_dim *dim; + struct blasfeo_svec *ux; + struct blasfeo_svec *pi; + struct blasfeo_svec *lam; + struct blasfeo_svec *t; + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t s_ocp_qcqp_sol_strsize(); +// +hpipm_size_t s_ocp_qcqp_sol_memsize(struct s_ocp_qcqp_dim *dim); +// +void s_ocp_qcqp_sol_create(struct s_ocp_qcqp_dim *dim, struct s_ocp_qcqp_sol *qp_sol, void *memory); +// +void s_ocp_qcqp_sol_copy_all(struct s_ocp_qcqp_sol *qp_sol_orig, struct s_ocp_qcqp_sol *qp_sol_dest); +// +void s_ocp_qcqp_sol_get(char *field, int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_ocp_qcqp_sol_get_u(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_ocp_qcqp_sol_get_x(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_ocp_qcqp_sol_get_sl(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_ocp_qcqp_sol_get_su(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_ocp_qcqp_sol_get_pi(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_ocp_qcqp_sol_get_lam_lb(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_ocp_qcqp_sol_get_lam_ub(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_ocp_qcqp_sol_get_lam_lg(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_ocp_qcqp_sol_get_lam_ug(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_ocp_qcqp_sol_set(char *field, int stage, float *vec, struct s_ocp_qcqp_sol *qp_sol); +// +void s_ocp_qcqp_sol_set_u(int stage, float *vec, struct s_ocp_qcqp_sol *qp_sol); +// +void s_ocp_qcqp_sol_set_x(int stage, float *vec, struct s_ocp_qcqp_sol *qp_sol); +// +void s_ocp_qcqp_sol_set_sl(int stage, float *vec, struct s_ocp_qcqp_sol *qp_sol); +// +void s_ocp_qcqp_sol_set_su(int stage, float *vec, struct s_ocp_qcqp_sol *qp_sol); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_S_OCP_QCQP_SOL_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_utils.h b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_utils.h new file mode 100644 index 000000000..d64e3aabe --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qcqp_utils.h @@ -0,0 +1,82 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_OCP_QCQP_UTILS_H_ +#define HPIPM_S_OCP_QCQP_UTILS_H_ + + + +#include +#include + +#include "hpipm_s_ocp_qcqp_dim.h" +#include "hpipm_s_ocp_qp.h" +#include "hpipm_s_ocp_qcqp_sol.h" +#include "hpipm_s_ocp_qcqp_ipm.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void s_ocp_qcqp_dim_print(struct s_ocp_qcqp_dim *qcqp_dim); +// +void s_ocp_qcqp_dim_codegen(char *file_name, char *mode, struct s_ocp_qcqp_dim *qcqp_dim); +// +void s_ocp_qcqp_print(struct s_ocp_qcqp_dim *qcqp_dim, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_codegen(char *file_name, char *mode, struct s_ocp_qcqp_dim *qcqp_dim, struct s_ocp_qcqp *qp); +// +void s_ocp_qcqp_sol_print(struct s_ocp_qcqp_dim *qcqp_dim, struct s_ocp_qcqp_sol *ocp_qcqp_sol); +// +void s_ocp_qcqp_ipm_arg_codegen(char *file_name, char *mode, struct s_ocp_qcqp_dim *qcqp_dim, struct s_ocp_qcqp_ipm_arg *arg); +// +void s_ocp_qcqp_res_print(struct s_ocp_qcqp_dim *qcqp_dim, struct s_ocp_qcqp_res *ocp_qcqp_res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_S_OCP_QCQP_UTILS_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp.h b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp.h new file mode 100644 index 000000000..b49191f19 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp.h @@ -0,0 +1,306 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_OCP_QP_H_ +#define HPIPM_S_OCP_QP_H_ + + + +#include +#include + +#include "hpipm_s_ocp_qp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_ocp_qp + { + struct s_ocp_qp_dim *dim; + struct blasfeo_smat *BAbt; // dynamics matrix & vector work space + struct blasfeo_smat *RSQrq; // hessian of cost & vector work space + struct blasfeo_smat *DCt; // inequality constraints matrix + struct blasfeo_svec *b; // dynamics vector + struct blasfeo_svec *rqz; // gradient of cost & gradient of slacks + struct blasfeo_svec *d; // inequality constraints vector + struct blasfeo_svec *d_mask; // inequality constraints mask vector + struct blasfeo_svec *m; // rhs of complementarity condition + struct blasfeo_svec *Z; // (diagonal) hessian of slacks + int **idxb; // indices of box constrained variables within [u; x] + int **idxs_rev; // index of soft constraints (reverse storage) + int **idxe; // indices of constraints within [bu, bx, g] that are equalities, subset of [0, ..., nbu+nbx+ng-1] + int *diag_H_flag; // flag the fact that Hessian is diagonal + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t s_ocp_qp_strsize(); +// +hpipm_size_t s_ocp_qp_memsize(struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_create(struct s_ocp_qp_dim *dim, struct s_ocp_qp *qp, void *memory); +// +void s_ocp_qp_copy_all(struct s_ocp_qp *qp_orig, struct s_ocp_qp *qp_dest); + +// setters +// +void s_ocp_qp_set_all_zero(struct s_ocp_qp *qp); +// +void s_ocp_qp_set_rhs_zero(struct s_ocp_qp *qp); +// +void s_ocp_qp_set_all(float **A, float **B, float **b, float **Q, float **S, float **R, float **q, float **r, int **idxbx, float **lbx, float **ubx, int **idxbu, float **lbu, float **ubu, float **C, float **D, float **lg, float **ug, float **Zl, float **Zu, float **zl, float **zu, int **idxs, float **ls, float **us, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_all_rowmaj(float **A, float **B, float **b, float **Q, float **S, float **R, float **q, float **r, int **idxbx, float **lbx, float **ubx, int **idxbu, float **lbu, float **ubu, float **C, float **D, float **lg, float **ug, float **Zl, float **Zu, float **zl, float **zu, int **idxs, float **ls, float **us, struct s_ocp_qp *qp); +// +void s_ocp_qp_set(char *fiels_name, int stage, void *value, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_el(char *fiels_name, int stage, int index, void *value, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_A(int stage, float *mat, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_B(int stage, float *mat, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_b(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_Q(int stage, float *mat, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_S(int stage, float *mat, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_R(int stage, float *mat, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_q(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_r(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_lb(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_lb_mask(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_ub(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_ub_mask(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_lbx(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_lbx_mask(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_el_lbx(int stage, int index, float *elem, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_ubx(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_ubx_mask(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_el_ubx(int stage, int index, float *elem, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_lbu(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_lbu_mask(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_ubu(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_ubu_mask(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_idxb(int stage, int *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_idxbx(int stage, int *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_Jbx(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_idxbu(int stage, int *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_Jbu(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_C(int stage, float *mat, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_D(int stage, float *mat, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_lg(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_lg_mask(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_ug(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_ug_mask(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_Zl(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_Zu(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_zl(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_zu(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_lls(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_lls_mask(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_lus(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_lus_mask(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_idxs(int stage, int *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_idxs_rev(int stage, int *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_Jsbu(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_Jsbx(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_Jsg(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_idxe(int stage, int *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_idxbxe(int stage, int *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_idxbue(int stage, int *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_idxge(int stage, int *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_Jbxe(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_Jbue(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_Jge(int stage, float *vec, struct s_ocp_qp *qp); +// +void s_ocp_qp_set_diag_H_flag(int stage, int *value, struct s_ocp_qp *qp); + +// getters +// +void s_ocp_qp_get(char *field, int stage, struct s_ocp_qp *qp, void *value); +// +void s_ocp_qp_get_A(int stage, struct s_ocp_qp *qp, float *mat); +// +void s_ocp_qp_get_B(int stage, struct s_ocp_qp *qp, float *mat); +// +void s_ocp_qp_get_b(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_Q(int stage, struct s_ocp_qp *qp, float *mat); +// +void s_ocp_qp_get_S(int stage, struct s_ocp_qp *qp, float *mat); +// +void s_ocp_qp_get_R(int stage, struct s_ocp_qp *qp, float *mat); +// +void s_ocp_qp_get_q(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_r(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_ub(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_ub_mask(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_lb(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_lb_mask(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_lbx(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_lbx_mask(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_ubx(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_ubx_mask(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_lbu(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_lbu_mask(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_ubu(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_ubu_mask(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_idxb(int stage, struct s_ocp_qp *qp, int *vec); +// +//void s_ocp_qp_get_idxbx(int stage, struct s_ocp_qp *qp, int *vec); +// +//void s_ocp_qp_get_Jbx(int stage, struct s_ocp_qp *qp, float *vec); +// +//void s_ocp_qp_get_idxbu(int stage, struct s_ocp_qp *qp, int *vec); +// +//void s_ocp_qp_get_Jbu(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_C(int stage, struct s_ocp_qp *qp, float *mat); +// +void s_ocp_qp_get_D(int stage, struct s_ocp_qp *qp, float *mat); +// +void s_ocp_qp_get_lg(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_lg_mask(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_ug(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_ug_mask(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_Zl(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_Zu(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_zl(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_zu(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_lls(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_lls_mask(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_lus(int stage, struct s_ocp_qp *qp, float *vec); +// +void s_ocp_qp_get_lus_mask(int stage, struct s_ocp_qp *qp, float *vec); +// XXX only valid if there is one slack per softed constraint !!! +void s_ocp_qp_get_idxs(int stage, struct s_ocp_qp *qp, int *vec); +// +void s_ocp_qp_get_idxs_rev(int stage, struct s_ocp_qp *qp, int *vec); +// +//void s_ocp_qp_get_Jsbu(int stage, struct s_ocp_qp *qp, float *vec); +// +//void s_ocp_qp_get_Jsbx(int stage, struct s_ocp_qp *qp, float *vec); +// +//void s_ocp_qp_get_Jsg(int stage, struct s_ocp_qp *qp, float *vec); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_OCP_QP_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_dim.h b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_dim.h new file mode 100644 index 000000000..bce80243b --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_dim.h @@ -0,0 +1,141 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_OCP_QP_DIM_H_ +#define HPIPM_S_OCP_QP_DIM_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_ocp_qp_dim + { + int *nx; // number of states + int *nu; // number of inputs + int *nb; // number of box constraints + int *nbx; // number of state box constraints + int *nbu; // number of input box constraints + int *ng; // number of general constraints + int *ns; // number of soft constraints + int *nsbx; // number of soft state box constraints + int *nsbu; // number of soft input box constraints + int *nsg; // number of soft general constraints + int *nbxe; // number of state box constraints which are equality + int *nbue; // number of input box constraints which are equality + int *nge; // number of general constraints which are equality + int N; // horizon length + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_ocp_qp_dim_strsize(); +// +hpipm_size_t s_ocp_qp_dim_memsize(int N); +// +void s_ocp_qp_dim_create(int N, struct s_ocp_qp_dim *qp_dim, void *memory); +// +void s_ocp_qp_dim_copy_all(struct s_ocp_qp_dim *dim_orig, struct s_ocp_qp_dim *dim_dest); +// +void s_ocp_qp_dim_set_all(int *nx, int *nu, int *nbx, int *nbu, int *ng, int *nsbx, int *nsbu, int *nsg, struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_dim_set(char *field, int stage, int value, struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_dim_set_nx(int stage, int value, struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_dim_set_nu(int stage, int value, struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_dim_set_nbx(int stage, int value, struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_dim_set_nbu(int stage, int value, struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_dim_set_ng(int stage, int value, struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_dim_set_ns(int stage, int value, struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_dim_set_nsbx(int stage, int value, struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_dim_set_nsbu(int stage, int value, struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_dim_set_nsg(int stage, int value, struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_dim_set_nbxe(int stage, int value, struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_dim_set_nbue(int stage, int value, struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_dim_set_nge(int stage, int value, struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_dim_get(struct s_ocp_qp_dim *dim, char *field, int stage, int *value); +// +void s_ocp_qp_dim_get_N(struct s_ocp_qp_dim *dim, int *value); +// +void s_ocp_qp_dim_get_nx(struct s_ocp_qp_dim *dim, int stage, int *value); +// +void s_ocp_qp_dim_get_nu(struct s_ocp_qp_dim *dim, int stage, int *value); +// +void s_ocp_qp_dim_get_nbx(struct s_ocp_qp_dim *dim, int stage, int *value); +// +void s_ocp_qp_dim_get_nbu(struct s_ocp_qp_dim *dim, int stage, int *value); +// +void s_ocp_qp_dim_get_ng(struct s_ocp_qp_dim *dim, int stage, int *value); +// +void s_ocp_qp_dim_get_ns(struct s_ocp_qp_dim *dim, int stage, int *value); +// +void s_ocp_qp_dim_get_nsbx(struct s_ocp_qp_dim *dim, int stage, int *value); +// +void s_ocp_qp_dim_get_nsbu(struct s_ocp_qp_dim *dim, int stage, int *value); +// +void s_ocp_qp_dim_get_nsg(struct s_ocp_qp_dim *dim, int stage, int *value); +// +void s_ocp_qp_dim_get_nbxe(struct s_ocp_qp_dim *dim, int stage, int *value); +// +void s_ocp_qp_dim_get_nbue(struct s_ocp_qp_dim *dim, int stage, int *value); +// +void s_ocp_qp_dim_get_nge(struct s_ocp_qp_dim *dim, int stage, int *value); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_S_OCP_QP_DIM_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_ipm.h b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_ipm.h new file mode 100644 index 000000000..11f3c47be --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_ipm.h @@ -0,0 +1,250 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_OCP_QP_IPM_H_ +#define HPIPM_S_OCP_QP_IPM_H_ + + + +#include +#include + +#include +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_ocp_qp_ipm_arg + { + float mu0; // initial value for complementarity slackness + float alpha_min; // exit cond on step length + float res_g_max; // exit cond on inf norm of residuals + float res_b_max; // exit cond on inf norm of residuals + float res_d_max; // exit cond on inf norm of residuals + float res_m_max; // exit cond on inf norm of residuals + float reg_prim; // reg of primal hessian + float lam_min; // min value in lam vector + float t_min; // min value in t vector + float tau_min; // min value of barrier parameter + int iter_max; // exit cond in iter number + int stat_max; // iterations saved in stat + int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm + int cond_pred_corr; // conditional Mehrotra's predictor-corrector + int itref_pred_max; // max number of iterative refinement steps for predictor step + int itref_corr_max; // max number of iterative refinement steps for corrector step + int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol + int square_root_alg; // 0 classical Riccati, 1 square-root Riccati + int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq (for square_root_alg==1) + int abs_form; // absolute IPM formulation + int comp_dual_sol_eq; // dual solution of equality constraints (only for abs_form==1) + int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol_eq==1) + int comp_res_pred; // compute residuals of prediction + int split_step; // use different steps for primal and dual variables + int var_init_scheme; // variables initialization scheme + int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution + int mode; + hpipm_size_t memsize; + }; + + + +struct s_ocp_qp_ipm_ws + { + struct s_core_qp_ipm_workspace *core_workspace; + struct s_ocp_qp_res_ws *res_workspace; + struct s_ocp_qp_dim *dim; // cache dim + struct s_ocp_qp_sol *sol_step; + struct s_ocp_qp_sol *sol_itref; + struct s_ocp_qp *qp_step; + struct s_ocp_qp *qp_itref; + struct s_ocp_qp_res *res; + struct s_ocp_qp_res *res_itref; + struct blasfeo_svec *Gamma; // hessian update + struct blasfeo_svec *gamma; // hessian update + struct blasfeo_svec *tmp_nuxM; // work space of size nxM + struct blasfeo_svec *tmp_nbgM; // work space of size nbM+ngM + struct blasfeo_svec *tmp_nsM; // work space of size nsM + struct blasfeo_svec *Pb; // Pb + struct blasfeo_svec *Zs_inv; + struct blasfeo_svec *tmp_m; + struct blasfeo_svec *l; // cache linear part for _get_ric_xxx + struct blasfeo_smat *L; + struct blasfeo_smat *Ls; + struct blasfeo_smat *P; + struct blasfeo_smat *Lh; + struct blasfeo_smat *AL; + struct blasfeo_smat *lq0; + struct blasfeo_smat *tmp_nxM_nxM; + float *stat; // convergence statistics + int *use_hess_fact; + void *lq_work0; + float qp_res[4]; // infinity norm of residuals + int iter; // iteration number + int stat_max; // iterations saved in stat + int stat_m; // number of recorded stat per IPM iter + int use_Pb; + int status; // solver status + int square_root_alg; // cache from arg + int lq_fact; // cache from arg + int mask_constr; // use constr mask + int valid_ric_vec; // meaningful riccati vectors + int valid_ric_p; // form of riccati p: 0 p*inv(L), 1 p + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_ocp_qp_ipm_arg_strsize(); +// +hpipm_size_t s_ocp_qp_ipm_arg_memsize(struct s_ocp_qp_dim *ocp_dim); +// +void s_ocp_qp_ipm_arg_create(struct s_ocp_qp_dim *ocp_dim, struct s_ocp_qp_ipm_arg *arg, void *mem); +// +void s_ocp_qp_ipm_arg_set_default(enum hpipm_mode mode, struct s_ocp_qp_ipm_arg *arg); +// +void s_ocp_qp_ipm_arg_set(char *field, void *value, struct s_ocp_qp_ipm_arg *arg); +// set maximum number of iterations +void s_ocp_qp_ipm_arg_set_iter_max(int *iter_max, struct s_ocp_qp_ipm_arg *arg); +// set minimum step lenght +void s_ocp_qp_ipm_arg_set_alpha_min(float *alpha_min, struct s_ocp_qp_ipm_arg *arg); +// set initial value of barrier parameter +void s_ocp_qp_ipm_arg_set_mu0(float *mu0, struct s_ocp_qp_ipm_arg *arg); +// set exit tolerance on stationarity condition +void s_ocp_qp_ipm_arg_set_tol_stat(float *tol_stat, struct s_ocp_qp_ipm_arg *arg); +// set exit tolerance on equality constr +void s_ocp_qp_ipm_arg_set_tol_eq(float *tol_eq, struct s_ocp_qp_ipm_arg *arg); +// set exit tolerance on inequality constr +void s_ocp_qp_ipm_arg_set_tol_ineq(float *tol_ineq, struct s_ocp_qp_ipm_arg *arg); +// set exit tolerance on complementarity condition +void s_ocp_qp_ipm_arg_set_tol_comp(float *tol_comp, struct s_ocp_qp_ipm_arg *arg); +// set regularization of primal variables +void s_ocp_qp_ipm_arg_set_reg_prim(float *tol_comp, struct s_ocp_qp_ipm_arg *arg); +// set warm start: 0 no warm start, 1 primal var +void s_ocp_qp_ipm_arg_set_warm_start(int *warm_start, struct s_ocp_qp_ipm_arg *arg); +// Mehrotra's predictor-corrector IPM algorithm: 0 no predictor-corrector, 1 use predictor-corrector +void s_ocp_qp_ipm_arg_set_pred_corr(int *pred_corr, struct s_ocp_qp_ipm_arg *arg); +// conditional predictor-corrector: 0 no conditinal predictor-corrector, 1 conditional predictor-corrector +void s_ocp_qp_ipm_arg_set_cond_pred_corr(int *value, struct s_ocp_qp_ipm_arg *arg); +// set riccati algorithm: 0 classic, 1 square-root +void s_ocp_qp_ipm_arg_set_ric_alg(int *alg, struct s_ocp_qp_ipm_arg *arg); +// dual solution of equality constraints (only for abs_form==1) +void s_ocp_qp_ipm_arg_set_comp_dual_sol_eq(int *value, struct s_ocp_qp_ipm_arg *arg); +// compute residuals after solution +void s_ocp_qp_ipm_arg_set_comp_res_exit(int *value, struct s_ocp_qp_ipm_arg *arg); +// compute residuals of prediction +void s_ocp_qp_ipm_arg_set_comp_res_pred(int *alg, struct s_ocp_qp_ipm_arg *arg); +// min value of lam in the solution +void s_ocp_qp_ipm_arg_set_lam_min(float *value, struct s_ocp_qp_ipm_arg *arg); +// min value of t in the solution +void s_ocp_qp_ipm_arg_set_t_min(float *value, struct s_ocp_qp_ipm_arg *arg); +// min value of tau in the solution +void s_ocp_qp_ipm_arg_set_tau_min(float *value, struct s_ocp_qp_ipm_arg *arg); +// set split step: 0 same step, 1 different step for primal and dual variables +void s_ocp_qp_ipm_arg_set_split_step(int *value, struct s_ocp_qp_ipm_arg *arg); +// variables initialization scheme +void s_ocp_qp_ipm_arg_set_var_init_scheme(int *value, struct s_ocp_qp_ipm_arg *arg); +// clip t and lam: 0 no, 1 in Gamma computation, 2 in solution +void s_ocp_qp_ipm_arg_set_t_lam_min(int *value, struct s_ocp_qp_ipm_arg *arg); + +// +hpipm_size_t s_ocp_qp_ipm_ws_strsize(); +// +hpipm_size_t s_ocp_qp_ipm_ws_memsize(struct s_ocp_qp_dim *ocp_dim, struct s_ocp_qp_ipm_arg *arg); +// +void s_ocp_qp_ipm_ws_create(struct s_ocp_qp_dim *ocp_dim, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, void *mem); +// +void s_ocp_qp_ipm_get(char *field, struct s_ocp_qp_ipm_ws *ws, void *value); +// +void s_ocp_qp_ipm_get_status(struct s_ocp_qp_ipm_ws *ws, int *status); +// +void s_ocp_qp_ipm_get_iter(struct s_ocp_qp_ipm_ws *ws, int *iter); +// +void s_ocp_qp_ipm_get_max_res_stat(struct s_ocp_qp_ipm_ws *ws, float *res_stat); +// +void s_ocp_qp_ipm_get_max_res_eq(struct s_ocp_qp_ipm_ws *ws, float *res_eq); +// +void s_ocp_qp_ipm_get_max_res_ineq(struct s_ocp_qp_ipm_ws *ws, float *res_ineq); +// +void s_ocp_qp_ipm_get_max_res_comp(struct s_ocp_qp_ipm_ws *ws, float *res_comp); +// +void s_ocp_qp_ipm_get_stat(struct s_ocp_qp_ipm_ws *ws, float **stat); +// +void s_ocp_qp_ipm_get_stat_m(struct s_ocp_qp_ipm_ws *ws, int *stat_m); +// +void s_ocp_qp_ipm_get_ric_Lr(struct s_ocp_qp *qp, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, int stage, float *Lr); +// +void s_ocp_qp_ipm_get_ric_Ls(struct s_ocp_qp *qp, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, int stage, float *Ls); +// +void s_ocp_qp_ipm_get_ric_P(struct s_ocp_qp *qp, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, int stage, float *P); +// +void s_ocp_qp_ipm_get_ric_lr(struct s_ocp_qp *qp, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, int stage, float *lr); +// +void s_ocp_qp_ipm_get_ric_p(struct s_ocp_qp *qp, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, int stage, float *p); +// feedback control gain in the form u = K x + k +void s_ocp_qp_ipm_get_ric_K(struct s_ocp_qp *qp, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, int stage, float *K); +// feedback control gain in the form u = K x + k +void s_ocp_qp_ipm_get_ric_k(struct s_ocp_qp *qp, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, int stage, float *k); +// +void s_ocp_qp_init_var(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws); +// +void s_ocp_qp_ipm_abs_step(int kk, struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws); +// +void s_ocp_qp_ipm_delta_step(int kk, struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws); +// +void s_ocp_qp_ipm_solve(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws); +// +void s_ocp_qp_ipm_predict(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws); +// +void s_ocp_qp_ipm_sens(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_OCP_QP_IPM_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_kkt.h b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_kkt.h new file mode 100644 index 000000000..3eb1f4aae --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_kkt.h @@ -0,0 +1,66 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + +#ifndef HPIPM_S_OCP_QP_KKT_H_ +#define HPIPM_S_OCP_QP_KKT_H_ + +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + +// +void s_ocp_qp_fact_solve_kkt_unconstr(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws); +// +void s_ocp_qp_fact_solve_kkt_step(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws); +// +void s_ocp_qp_fact_lq_solve_kkt_step(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws); +// +void s_ocp_qp_solve_kkt_step(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif // HPIPM_S_OCP_QP_KKT_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_red.h b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_red.h new file mode 100644 index 000000000..5a7b3b070 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_red.h @@ -0,0 +1,118 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_OCP_QP_RED_H_ +#define HPIPM_S_OCP_QP_RED_H_ + + + +#include +#include + +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_ocp_qp_reduce_eq_dof_arg + { + float lam_min; + float t_min; + int alias_unchanged; // do not keep copy unchanged stage + int comp_prim_sol; // primal solution (v) + int comp_dual_sol_eq; // dual solution equality constr (pi) + int comp_dual_sol_ineq; // dual solution inequality constr (lam t) + hpipm_size_t memsize; // memory size in bytes + }; + + + +struct s_ocp_qp_reduce_eq_dof_ws + { + struct blasfeo_svec *tmp_nuxM; + struct blasfeo_svec *tmp_nbgM; + int *e_imask_ux; + int *e_imask_d; + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +void s_ocp_qp_dim_reduce_eq_dof(struct s_ocp_qp_dim *dim, struct s_ocp_qp_dim *dim_red); +// +hpipm_size_t s_ocp_qp_reduce_eq_dof_arg_memsize(); +// +void s_ocp_qp_reduce_eq_dof_arg_create(struct s_ocp_qp_reduce_eq_dof_arg *arg, void *mem); +// +void s_ocp_qp_reduce_eq_dof_arg_set_default(struct s_ocp_qp_reduce_eq_dof_arg *arg); +// +void s_ocp_qp_reduce_eq_dof_arg_set_alias_unchanged(struct s_ocp_qp_reduce_eq_dof_arg *arg, int value); +// +void s_ocp_qp_reduce_eq_dof_arg_set_comp_prim_sol(struct s_ocp_qp_reduce_eq_dof_arg *arg, int value); +// +void s_ocp_qp_reduce_eq_dof_arg_set_comp_dual_sol_eq(struct s_ocp_qp_reduce_eq_dof_arg *arg, int value); +// +void s_ocp_qp_reduce_eq_dof_arg_set_comp_dual_sol_ineq(struct s_ocp_qp_reduce_eq_dof_arg *arg, int value); +// +hpipm_size_t s_ocp_qp_reduce_eq_dof_ws_memsize(struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_reduce_eq_dof_ws_create(struct s_ocp_qp_dim *dim, struct s_ocp_qp_reduce_eq_dof_ws *work, void *mem); +// +void s_ocp_qp_reduce_eq_dof(struct s_ocp_qp *qp, struct s_ocp_qp *qp_red, struct s_ocp_qp_reduce_eq_dof_arg *arg, struct s_ocp_qp_reduce_eq_dof_ws *work); +// +void s_ocp_qp_reduce_eq_dof_lhs(struct s_ocp_qp *qp, struct s_ocp_qp *qp_red, struct s_ocp_qp_reduce_eq_dof_arg *arg, struct s_ocp_qp_reduce_eq_dof_ws *work); +// +void s_ocp_qp_reduce_eq_dof_rhs(struct s_ocp_qp *qp, struct s_ocp_qp *qp_red, struct s_ocp_qp_reduce_eq_dof_arg *arg, struct s_ocp_qp_reduce_eq_dof_ws *work); +// +void s_ocp_qp_restore_eq_dof(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol_red, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_reduce_eq_dof_arg *arg, struct s_ocp_qp_reduce_eq_dof_ws *work); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_S_OCP_QP_RED_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_res.h b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_res.h new file mode 100644 index 000000000..821585da6 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_res.h @@ -0,0 +1,114 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_OCP_QP_RES_H_ +#define HPIPM_S_OCP_QP_RES_H_ + + + +#include +#include + +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_ocp_qp_res + { + struct s_ocp_qp_dim *dim; + struct blasfeo_svec *res_g; // q-residuals + struct blasfeo_svec *res_b; // b-residuals + struct blasfeo_svec *res_d; // d-residuals + struct blasfeo_svec *res_m; // m-residuals + float res_max[4]; // max of residuals + float res_mu; // mu-residual + hpipm_size_t memsize; + }; + + + +struct s_ocp_qp_res_ws + { + struct blasfeo_svec *tmp_nbgM; // work space of size nbM+ngM + struct blasfeo_svec *tmp_nsM; // work space of size nsM + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_ocp_qp_res_memsize(struct s_ocp_qp_dim *ocp_dim); +// +void s_ocp_qp_res_create(struct s_ocp_qp_dim *ocp_dim, struct s_ocp_qp_res *res, void *mem); +// +hpipm_size_t s_ocp_qp_res_ws_memsize(struct s_ocp_qp_dim *ocp_dim); +// +void s_ocp_qp_res_ws_create(struct s_ocp_qp_dim *ocp_dim, struct s_ocp_qp_res_ws *workspace, void *mem); +// +void s_ocp_qp_res_compute(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_res *res, struct s_ocp_qp_res_ws *ws); +// +void s_ocp_qp_res_compute_lin(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_sol *qp_step, struct s_ocp_qp_res *res, struct s_ocp_qp_res_ws *ws); +// +void s_ocp_qp_res_compute_inf_norm(struct s_ocp_qp_res *res); +// +void s_ocp_qp_res_get_all(struct s_ocp_qp_res *res, float **res_r, float **res_q, float **res_ls, float **res_us, float **res_b, float **res_d_lb, float **res_d_ub, float **res_d_lg, float **res_d_ug, float **res_d_ls, float **res_d_us, float **res_m_lb, float **res_m_ub, float **res_m_lg, float **res_m_ug, float **res_m_ls, float **res_m_us); +// +void s_ocp_qp_res_get_max_res_stat(struct s_ocp_qp_res *res, float *value); +// +void s_ocp_qp_res_get_max_res_eq(struct s_ocp_qp_res *res, float *value); +// +void s_ocp_qp_res_get_max_res_ineq(struct s_ocp_qp_res *res, float *value); +// +void s_ocp_qp_res_get_max_res_comp(struct s_ocp_qp_res *res, float *value); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_S_OCP_QP_RES_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_sol.h b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_sol.h new file mode 100644 index 000000000..94dfa0d00 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_sol.h @@ -0,0 +1,128 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_OCP_QP_SOL_H_ +#define HPIPM_S_OCP_QP_SOL_H_ + + + +#include +#include + +#include "hpipm_s_ocp_qp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_ocp_qp_sol + { + struct s_ocp_qp_dim *dim; + struct blasfeo_svec *ux; + struct blasfeo_svec *pi; + struct blasfeo_svec *lam; + struct blasfeo_svec *t; + void *misc; + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t s_ocp_qp_sol_strsize(); +// +hpipm_size_t s_ocp_qp_sol_memsize(struct s_ocp_qp_dim *dim); +// +void s_ocp_qp_sol_create(struct s_ocp_qp_dim *dim, struct s_ocp_qp_sol *qp_sol, void *memory); +// +void s_ocp_qp_sol_copy_all(struct s_ocp_qp_sol *qp_sol_orig, struct s_ocp_qp_sol *qp_sol_dest); +// +void s_qp_sol_get_all(struct s_ocp_qp_sol *qp_sol, float **u, float **x, float **ls, float **us, float **pi, float **lam_lb, float **lam_ub, float **lam_lg, float **lam_ug, float **lam_ls, float **lam_us); +// +void s_qp_sol_get_all_rowmaj(struct s_ocp_qp_sol *qp_sol, float **u, float **x, float **ls, float **us, float **pi, float **lam_lb, float **lam_ub, float **lam_lg, float **lam_ug, float **lam_ls, float **lam_us); +// +void s_ocp_qp_sol_set_all(float **u, float **x, float **ls, float **us, float **pi, float **lam_lb, float **lam_ub, float **lam_lg, float **lam_ug, float **lam_ls, float **lam_us, struct s_ocp_qp_sol *qp_sol); +// +void s_ocp_qp_sol_get(char *field, int stage, struct s_ocp_qp_sol *qp_sol, float *vec); +// +void s_ocp_qp_sol_get_u(int stage, struct s_ocp_qp_sol *qp_sol, float *vec); +// +void s_ocp_qp_sol_get_x(int stage, struct s_ocp_qp_sol *qp_sol, float *vec); +// +void s_ocp_qp_sol_get_sl(int stage, struct s_ocp_qp_sol *qp_sol, float *vec); +// +void s_ocp_qp_sol_get_su(int stage, struct s_ocp_qp_sol *qp_sol, float *vec); +// +void s_ocp_qp_sol_get_pi(int stage, struct s_ocp_qp_sol *qp_sol, float *vec); +// +void s_ocp_qp_sol_get_lam_lb(int stage, struct s_ocp_qp_sol *qp_sol, float *vec); +// +void s_ocp_qp_sol_get_lam_lbu(int stage, struct s_ocp_qp_sol *qp_sol, float *vec); +// +void s_ocp_qp_sol_get_lam_lbx(int stage, struct s_ocp_qp_sol *qp_sol, float *vec); +// +void s_ocp_qp_sol_get_lam_ub(int stage, struct s_ocp_qp_sol *qp_sol, float *vec); +// +void s_ocp_qp_sol_get_lam_ubu(int stage, struct s_ocp_qp_sol *qp_sol, float *vec); +// +void s_ocp_qp_sol_get_lam_ubx(int stage, struct s_ocp_qp_sol *qp_sol, float *vec); +// +void s_ocp_qp_sol_get_lam_lg(int stage, struct s_ocp_qp_sol *qp_sol, float *vec); +// +void s_ocp_qp_sol_get_lam_ug(int stage, struct s_ocp_qp_sol *qp_sol, float *vec); +// +void s_ocp_qp_sol_set(char *field, int stage, float *vec, struct s_ocp_qp_sol *qp_sol); +// +void s_ocp_qp_sol_set_u(int stage, float *vec, struct s_ocp_qp_sol *qp_sol); +// +void s_ocp_qp_sol_set_x(int stage, float *vec, struct s_ocp_qp_sol *qp_sol); +// +void s_ocp_qp_sol_set_sl(int stage, float *vec, struct s_ocp_qp_sol *qp_sol); +// +void s_ocp_qp_sol_set_su(int stage, float *vec, struct s_ocp_qp_sol *qp_sol); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_OCP_QP_SOL_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_utils.h b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_utils.h new file mode 100644 index 000000000..a4f832a5e --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_ocp_qp_utils.h @@ -0,0 +1,83 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_OCP_QP_UTILS_H_ +#define HPIPM_S_OCP_QP_UTILS_H_ + + + +#include +#include + +#include "hpipm_s_ocp_qp_dim.h" +#include "hpipm_s_ocp_qp.h" +#include "hpipm_s_ocp_qp_sol.h" +#include "hpipm_s_ocp_qp_ipm.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void s_ocp_qp_dim_print(struct s_ocp_qp_dim *qp_dim); +// +void s_ocp_qp_dim_codegen(char *file_name, char *mode, struct s_ocp_qp_dim *qp_dim); +// +void s_ocp_qp_print(struct s_ocp_qp_dim *qp_dim, struct s_ocp_qp *qp); +// +void s_ocp_qp_codegen(char *file_name, char *mode, struct s_ocp_qp_dim *qp_dim, struct s_ocp_qp *qp); +// +void s_ocp_qp_sol_print(struct s_ocp_qp_dim *qp_dim, struct s_ocp_qp_sol *ocp_qp_sol); +// +void s_ocp_qp_ipm_arg_print(struct s_ocp_qp_dim *qp_dim, struct s_ocp_qp_ipm_arg *arg); +// +void s_ocp_qp_ipm_arg_codegen(char *file_name, char *mode, struct s_ocp_qp_dim *qp_dim, struct s_ocp_qp_ipm_arg *arg); +// +void s_ocp_qp_res_print(struct s_ocp_qp_dim *qp_dim, struct s_ocp_qp_res *ocp_qp_res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_D_OCP_QP_UTILS_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_part_cond.h b/third_party/acados/include/hpipm/include/hpipm_s_part_cond.h new file mode 100644 index 000000000..e40511e69 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_part_cond.h @@ -0,0 +1,115 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_S_PART_COND_H_ +#define HPIPM_S_PART_COND_H_ + + + +#include +#include + +#include "hpipm_s_cond.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_part_cond_qp_arg + { + struct s_cond_qp_arg *cond_arg; + int N2; + hpipm_size_t memsize; + }; + + + +struct s_part_cond_qp_ws + { + struct s_cond_qp_ws *cond_workspace; + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_part_cond_qp_arg_memsize(int N2); +// +void s_part_cond_qp_arg_create(int N2, struct s_part_cond_qp_arg *cond_arg, void *mem); +// +void s_part_cond_qp_arg_set_default(struct s_part_cond_qp_arg *cond_arg); +// set riccati-like algorithm: 0 classical, 1 squre-root +void s_part_cond_qp_arg_set_ric_alg(int ric_alg, struct s_part_cond_qp_arg *cond_arg); +// +void s_part_cond_qp_arg_set_comp_prim_sol(int value, struct s_part_cond_qp_arg *cond_arg); +// +void s_part_cond_qp_arg_set_comp_dual_sol_eq(int value, struct s_part_cond_qp_arg *cond_arg); +// +void s_part_cond_qp_arg_set_comp_dual_sol_ineq(int value, struct s_part_cond_qp_arg *cond_arg); + +// +void s_part_cond_qp_compute_block_size(int N, int N2, int *block_size); +// +void s_part_cond_qp_compute_dim(struct s_ocp_qp_dim *ocp_dim, int *block_size, struct s_ocp_qp_dim *part_dense_dim); +// +hpipm_size_t s_part_cond_qp_ws_memsize(struct s_ocp_qp_dim *ocp_dim, int *block_size, struct s_ocp_qp_dim *part_dense_dim, struct s_part_cond_qp_arg *cond_arg); +// +void s_part_cond_qp_ws_create(struct s_ocp_qp_dim *ocp_dim, int *block_size, struct s_ocp_qp_dim *part_dense_dim, struct s_part_cond_qp_arg *cond_arg, struct s_part_cond_qp_ws *cond_ws, void *mem); +// +void s_part_cond_qp_cond(struct s_ocp_qp *ocp_qp, struct s_ocp_qp *part_dense_qp, struct s_part_cond_qp_arg *cond_arg, struct s_part_cond_qp_ws *cond_ws); +// +void s_part_cond_qp_cond_lhs(struct s_ocp_qp *ocp_qp, struct s_ocp_qp *part_dense_qp, struct s_part_cond_qp_arg *cond_arg, struct s_part_cond_qp_ws *cond_ws); +// +void s_part_cond_qp_cond_rhs(struct s_ocp_qp *ocp_qp, struct s_ocp_qp *part_dense_qp, struct s_part_cond_qp_arg *cond_arg, struct s_part_cond_qp_ws *cond_ws); +// +void s_part_cond_qp_expand_sol(struct s_ocp_qp *ocp_qp, struct s_ocp_qp *part_dense_qp, struct s_ocp_qp_sol *part_dense_qp_sol, struct s_ocp_qp_sol *ocp_qp_sol, struct s_part_cond_qp_arg *cond_arg, struct s_part_cond_qp_ws *cond_ws); + +// +void s_part_cond_qp_update(int *idxc, struct s_ocp_qp *ocp_qp, struct s_ocp_qp *part_dense_qp, struct s_part_cond_qp_arg *cond_arg, struct s_part_cond_qp_ws *cond_ws); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_PART_COND_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_part_cond_qcqp.h b/third_party/acados/include/hpipm/include/hpipm_s_part_cond_qcqp.h new file mode 100644 index 000000000..311f7000b --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_part_cond_qcqp.h @@ -0,0 +1,107 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_S_PART_COND_QCQP_H_ +#define HPIPM_S_PART_COND_QCQP_H_ + + + +#include +#include + +#include "hpipm_s_cond_qcqp.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_part_cond_qcqp_arg + { + struct s_cond_qcqp_arg *cond_arg; + int N2; + hpipm_size_t memsize; + }; + + + +struct s_part_cond_qcqp_ws + { + struct s_cond_qcqp_ws *cond_ws; + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_part_cond_qcqp_arg_memsize(int N2); +// +void s_part_cond_qcqp_arg_create(int N2, struct s_part_cond_qcqp_arg *cond_arg, void *mem); +// +void s_part_cond_qcqp_arg_set_default(struct s_part_cond_qcqp_arg *cond_arg); +// set riccati-like algorithm: 0 classical, 1 squre-root +void s_part_cond_qcqp_arg_set_ric_alg(int ric_alg, struct s_part_cond_qcqp_arg *cond_arg); + +// +void s_part_cond_qcqp_compute_block_size(int N, int N2, int *block_size); +// +void s_part_cond_qcqp_compute_dim(struct s_ocp_qcqp_dim *ocp_dim, int *block_size, struct s_ocp_qcqp_dim *part_dense_dim); +// +hpipm_size_t s_part_cond_qcqp_ws_memsize(struct s_ocp_qcqp_dim *ocp_dim, int *block_size, struct s_ocp_qcqp_dim *part_dense_dim, struct s_part_cond_qcqp_arg *cond_arg); +// +void s_part_cond_qcqp_ws_create(struct s_ocp_qcqp_dim *ocp_dim, int *block_size, struct s_ocp_qcqp_dim *part_dense_dim, struct s_part_cond_qcqp_arg *cond_arg, struct s_part_cond_qcqp_ws *cond_ws, void *mem); +// +void s_part_cond_qcqp_cond(struct s_ocp_qcqp *ocp_qp, struct s_ocp_qcqp *part_dense_qp, struct s_part_cond_qcqp_arg *cond_arg, struct s_part_cond_qcqp_ws *cond_ws); +// +void s_part_cond_qcqp_cond_lhs(struct s_ocp_qcqp *ocp_qp, struct s_ocp_qcqp *part_dense_qp, struct s_part_cond_qcqp_arg *cond_arg, struct s_part_cond_qcqp_ws *cond_ws); +// +void s_part_cond_qcqp_cond_rhs(struct s_ocp_qcqp *ocp_qp, struct s_ocp_qcqp *part_dense_qp, struct s_part_cond_qcqp_arg *cond_arg, struct s_part_cond_qcqp_ws *cond_ws); +// +void s_part_cond_qcqp_expand_sol(struct s_ocp_qcqp *ocp_qp, struct s_ocp_qcqp *part_dense_qp, struct s_ocp_qcqp_sol *part_dense_qp_sol, struct s_ocp_qcqp_sol *ocp_qp_sol, struct s_part_cond_qcqp_arg *cond_arg, struct s_part_cond_qcqp_ws *cond_ws); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_D_PART_COND_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_sim_erk.h b/third_party/acados/include/hpipm/include/hpipm_s_sim_erk.h new file mode 100644 index 000000000..1a05ad1a2 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_sim_erk.h @@ -0,0 +1,121 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_SIM_ERK_H_ +#define HPIPM_S_SIM_ERK_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +struct s_sim_erk_arg + { + struct s_sim_rk_data *rk_data; // integrator data + float h; // step size + int steps; // number of steps +// int for_sens; // compute adjoint sensitivities +// int adj_sens; // compute adjoint sensitivities + hpipm_size_t memsize; + }; + + + +struct s_sim_erk_ws + { + void (*ode)(int t, float *x, float *p, void *ode_args, float *xdot); // function pointer to ode + void (*vde_for)(int t, float *x, float *p, void *ode_args, float *xdot); // function pointer to forward vde + void (*vde_adj)(int t, float *adj_in, void *ode_args, float *adj_out); // function pointer to adjoint vde + void *ode_args; // pointer to ode args + struct s_sim_erk_arg *erk_arg; // erk arg + float *K; // internal variables + float *x_for; // states and forward sensitivities + float *x_traj; // states at all steps + float *l; // adjoint sensitivities + float *p; // parameter + float *x_tmp; // temporary states and forward sensitivities + float *adj_in; + float *adj_tmp; + int nx; // number of states + int np; // number of parameters + int nf; // number of forward sensitivities + int na; // number of adjoint sensitivities + int nf_max; // max number of forward sensitivities + int na_max; // max number of adjoint sensitivities + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_sim_erk_arg_memsize(); +// +void s_sim_erk_arg_create(struct s_sim_erk_arg *erk_arg, void *mem); +// +void s_sim_erk_arg_set_all(struct s_sim_rk_data *rk_data, float h, int steps, struct s_sim_erk_arg *erk_arg); + +// +hpipm_size_t s_sim_erk_ws_memsize(struct s_sim_erk_arg *erk_arg, int nx, int np, int nf_max, int na_max); +// +void s_sim_erk_ws_create(struct s_sim_erk_arg *erk_arg, int nx, int np, int nf_max, int na_max, struct s_sim_erk_ws *work, void *memory); +// +void s_sim_erk_ws_set_all(int nf, int na, float *x, float *fs, float *bs, float *p, void (*ode)(int t, float *x, float *p, void *ode_args, float *xdot), void (*vde_for)(int t, float *x, float *p, void *ode_args, float *xdot), void (*vde_adj)(int t, float *adj_in, void *ode_args, float *adj_out), void *ode_args, struct s_sim_erk_ws *work); +// number of directions for forward sensitivities +void s_sim_erk_ws_set_nf(int *nf, struct s_sim_erk_ws *work); +// parameters (e.g. inputs) +void s_sim_erk_ws_set_p(float *p, struct s_sim_erk_ws *work); +// state +void s_sim_erk_ws_set_x(float *x, struct s_sim_erk_ws *work); +// forward sensitivities +void s_sim_erk_ws_set_fs(float *fs, struct s_sim_erk_ws *work); +// ode funtion +void s_sim_erk_ws_set_ode(void (*ode)(int t, float *x, float *p, void *ode_args, float *xdot), struct s_sim_erk_ws *work); +// forward vde function +void s_sim_erk_ws_set_vde_for(void (*ode)(int t, float *x, float *p, void *ode_args, float *xdot), struct s_sim_erk_ws *work); +// ode_args, passed straight to the ode/vde_for/vde_adj functions +void s_sim_erk_ws_set_ode_args(void *ode_args, struct s_sim_erk_ws *work); +// state +void s_sim_erk_ws_get_x(struct s_sim_erk_ws *work, float *x); +// forward sensitivities +void s_sim_erk_ws_get_fs(struct s_sim_erk_ws *work, float *fs); +// +void s_sim_erk_solve(struct s_sim_erk_arg *arg, struct s_sim_erk_ws *work); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // HPIPM_D_SIM_ERK_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_sim_rk.h b/third_party/acados/include/hpipm/include/hpipm_s_sim_rk.h new file mode 100644 index 000000000..53acd7149 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_sim_rk.h @@ -0,0 +1,72 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_SIM_RK_H_ +#define HPIPM_S_SIM_RK_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct s_sim_rk_data + { + float *A_rk; // A in butcher tableau + float *B_rk; // b in butcher tableau + float *C_rk; // c in butcher tableau + int expl; // erk vs irk + int ns; // number of stages + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_sim_rk_data_memsize(int ns); +// +void s_sim_rk_data_create(int ns, struct s_sim_rk_data *rk_data, void *memory); +// +void s_sim_rk_data_init_default(char *field, struct s_sim_rk_data *rk_data); +// +void s_sim_rk_data_set_all(int expl, float *A_rk, float *B_rk, float *C_rk, struct s_sim_rk_data *rk_data); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // HPIPM_S_SIM_RK_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp.h b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp.h new file mode 100644 index 000000000..450e99262 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp.h @@ -0,0 +1,213 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_TREE_OCP_QCQP_H_ +#define HPIPM_S_TREE_OCP_QCQP_H_ + + + +#include +#include + +#include "hpipm_s_tree_ocp_qcqp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_tree_ocp_qcqp + { + struct s_tree_ocp_qcqp_dim *dim; + struct blasfeo_smat *BAbt; // Nn-1 + struct blasfeo_smat *RSQrq; // Nn + struct blasfeo_smat *DCt; // Nn + struct blasfeo_smat **Hq; // Nn + struct blasfeo_svec *b; // Nn-1 + struct blasfeo_svec *rqz; // Nn + struct blasfeo_svec *d; // Nn + struct blasfeo_svec *d_mask; // Nn + struct blasfeo_svec *m; // Nn + struct blasfeo_svec *Z; // Nn + int **idxb; // indices of box constrained variables within [u; x] // Nn + int **idxs_rev; // index of soft constraints + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t s_tree_ocp_qcqp_memsize(struct s_tree_ocp_qcqp_dim *dim); +// +void s_tree_ocp_qcqp_create(struct s_tree_ocp_qcqp_dim *dim, struct s_tree_ocp_qcqp *qp, void *memory); +// +void s_tree_ocp_qcqp_set_all(float **A, float **B, float **b, float **Q, float **S, float **R, float **q, float **r, int **idxb, float **d_lb, float **d_ub, float **C, float **D, float **d_lg, float **d_ug, float **Zl, float **Zu, float **zl, float **zu, int **idxs, float **d_ls, float **d_us, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set(char *field_name, int node_edge, void *value, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_A(int edge, float *mat, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_B(int edge, float *mat, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_b(int edge, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_Q(int node, float *mat, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_S(int node, float *mat, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_R(int node, float *mat, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_q(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_r(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_lb(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_lb_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_ub(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_ub_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_lbx(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_lbx_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_ubx(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_ubx_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_lbu(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_lbu_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_ubu(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_ubu_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_idxb(int node, int *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_idxbx(int node, int *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_Jbx(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_idxbu(int node, int *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_Jbu(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_C(int node, float *mat, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_D(int node, float *mat, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_lg(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_lg_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_ug(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_ug_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_Qq(int node, float *mat, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_Sq(int node, float *mat, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_Rq(int node, float *mat, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_qq(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_rq(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_uq(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_uq_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_Zl(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_Zu(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_zl(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_zu(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_lls(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_lls_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_lus(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_lus_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_idxs(int node, int *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_idxs_rev(int node, int *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_Jsbu(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_Jsbx(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_Jsg(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_set_Jsq(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +//void s_tree_ocp_qcqp_set_idxe(int node, int *vec, struct s_tree_ocp_qcqp *qp); +// +//void s_tree_ocp_qcqp_set_idxbxe(int node, int *vec, struct s_tree_ocp_qcqp *qp); +// +//void s_tree_ocp_qcqp_set_idxbue(int node, int *vec, struct s_tree_ocp_qcqp *qp); +// +//void s_tree_ocp_qcqp_set_idxge(int node, int *vec, struct s_tree_ocp_qcqp *qp); +// +//void s_tree_ocp_qcqp_set_Jbxe(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +//void s_tree_ocp_qcqp_set_Jbue(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +//void s_tree_ocp_qcqp_set_Jge(int node, float *vec, struct s_tree_ocp_qcqp *qp); +// +//void s_tree_ocp_qcqp_set_diag_H_flag(int node, int *value, struct s_tree_ocp_qcqp *qp); + + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_TREE_OCP_QCQP_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_dim.h b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_dim.h new file mode 100644 index 000000000..7a49d5199 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_dim.h @@ -0,0 +1,118 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_TREE_OCP_QCQP_DIM_H_ +#define HPIPM_S_TREE_OCP_QCQP_DIM_H_ + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_tree_ocp_qcqp_dim + { + struct s_tree_ocp_qp_dim *qp_dim; // dim of qp approximation + struct tree *ttree; // tree describing node conndection + int *nx; // number of states // Nn + int *nu; // number of inputs // Nn + int *nb; // number of box constraints // Nn + int *nbx; // number of state box constraints // Nn + int *nbu; // number of input box constraints // Nn + int *ng; // number of general constraints // Nn + int *nq; // number of (upper) quadratic constraints + int *ns; // number of soft constraints // Nn + int *nsbx; // number of soft state box constraints + int *nsbu; // number of soft input box constraints + int *nsg; // number of soft general constraints + int *nsq; // number of (upper) soft quadratic constraints + int Nn; // number of nodes + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_tree_ocp_qcqp_dim_strsize(); +// +hpipm_size_t s_tree_ocp_qcqp_dim_memsize(int Nn); +// +void s_tree_ocp_qcqp_dim_create(int Nn, struct s_tree_ocp_qcqp_dim *qp_dim, void *memory); +// +void s_tree_ocp_qcqp_dim_set_tree(struct tree *ttree, struct s_tree_ocp_qcqp_dim *dim); +// +void s_tree_ocp_qcqp_dim_set(char *field, int stage, int value, struct s_tree_ocp_qcqp_dim *dim); +// +void s_tree_ocp_qcqp_dim_set_nx(int stage, int value, struct s_tree_ocp_qcqp_dim *dim); +// +void s_tree_ocp_qcqp_dim_set_nu(int stage, int value, struct s_tree_ocp_qcqp_dim *dim); +// +void s_tree_ocp_qcqp_dim_set_nbx(int stage, int value, struct s_tree_ocp_qcqp_dim *dim); +// +void s_tree_ocp_qcqp_dim_set_nbu(int stage, int value, struct s_tree_ocp_qcqp_dim *dim); +// +void s_tree_ocp_qcqp_dim_set_ng(int stage, int value, struct s_tree_ocp_qcqp_dim *dim); +// +void s_tree_ocp_qcqp_dim_set_nq(int stage, int value, struct s_tree_ocp_qcqp_dim *dim); +// +void s_tree_ocp_qcqp_dim_set_ns(int stage, int value, struct s_tree_ocp_qcqp_dim *dim); +// +void s_tree_ocp_qcqp_dim_set_nsbx(int stage, int value, struct s_tree_ocp_qcqp_dim *dim); +// +void s_tree_ocp_qcqp_dim_set_nsbu(int stage, int value, struct s_tree_ocp_qcqp_dim *dim); +// +void s_tree_ocp_qcqp_dim_set_nsg(int stage, int value, struct s_tree_ocp_qcqp_dim *dim); +// +void s_tree_ocp_qcqp_dim_set_nsq(int stage, int value, struct s_tree_ocp_qcqp_dim *dim); +// +//void s_tree_ocp_qcqp_dim_set_nbxe(int stage, int value, struct s_tree_ocp_qcqp_dim *dim); +// +//void s_tree_ocp_qcqp_dim_set_nbue(int stage, int value, struct s_tree_ocp_qcqp_dim *dim); +// +//void s_tree_ocp_qcqp_dim_set_nge(int stage, int value, struct s_tree_ocp_qcqp_dim *dim); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_S_TREE_OCP_QCQP_DIM_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_ipm.h b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_ipm.h new file mode 100644 index 000000000..69d65914c --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_ipm.h @@ -0,0 +1,192 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_TREE_OCP_QCQP_IPM_H_ +#define HPIPM_S_TREE_OCP_QCQP_IPM_H_ + + + +#include +#include + +#include +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_tree_ocp_qcqp_ipm_arg + { + struct s_tree_ocp_qp_ipm_arg *qp_arg; + float mu0; // initial value for complementarity slackness + float alpha_min; // exit cond on step length + float res_g_max; // exit cond on inf norm of residuals + float res_b_max; // exit cond on inf norm of residuals + float res_d_max; // exit cond on inf norm of residuals + float res_m_max; // exit cond on inf norm of residuals + float reg_prim; // reg of primal hessian + float lam_min; // min value in lam vector + float t_min; // min value in t vector + int iter_max; // exit cond in iter number + int stat_max; // iterations saved in stat + int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm + int cond_pred_corr; // conditional Mehrotra's predictor-corrector + int itref_pred_max; // max number of iterative refinement steps for predictor step + int itref_corr_max; // max number of iterative refinement steps for corrector step + int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol +// int square_root_alg; // 0 classical Riccati, 1 square-root Riccati + int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq (for square_root_alg==1) + int abs_form; // absolute IPM formulation + int comp_dual_sol_eq; // dual solution of equality constraints (only for abs_form==1) + int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol_eq==1) +// int comp_res_pred; // compute residuals of prediction + int split_step; // use different step for primal and dual variables + int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution + int mode; + hpipm_size_t memsize; + }; + + + +struct s_tree_ocp_qcqp_ipm_ws + { + struct s_tree_ocp_qp_ipm_ws *qp_ws; + struct s_tree_ocp_qp *qp; + struct s_tree_ocp_qp_sol *qp_sol; + struct s_tree_ocp_qcqp_res_ws *qcqp_res_ws; + struct s_tree_ocp_qcqp_res *qcqp_res; + struct blasfeo_svec *tmp_nuxM; + int iter; // iteration number + int status; + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_tree_ocp_qcqp_ipm_arg_strsize(); +// +hpipm_size_t s_tree_ocp_qcqp_ipm_arg_memsize(struct s_tree_ocp_qcqp_dim *ocp_dim); +// +void s_tree_ocp_qcqp_ipm_arg_create(struct s_tree_ocp_qcqp_dim *ocp_dim, struct s_tree_ocp_qcqp_ipm_arg *arg, void *mem); +// +void s_tree_ocp_qcqp_ipm_arg_set_default(enum hpipm_mode mode, struct s_tree_ocp_qcqp_ipm_arg *arg); +// +void s_tree_ocp_qcqp_ipm_arg_set(char *field, void *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// set maximum number of iterations +void s_tree_ocp_qcqp_ipm_arg_set_iter_max(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// set minimum step lenght +void s_tree_ocp_qcqp_ipm_arg_set_alpha_min(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// set initial value of barrier parameter +void s_tree_ocp_qcqp_ipm_arg_set_mu0(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on stationarity condition +void s_tree_ocp_qcqp_ipm_arg_set_tol_stat(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on equality constr +void s_tree_ocp_qcqp_ipm_arg_set_tol_eq(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on inequality constr +void s_tree_ocp_qcqp_ipm_arg_set_tol_ineq(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// set exit tolerance on complementarity condition +void s_tree_ocp_qcqp_ipm_arg_set_tol_comp(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// set regularization of primal variables +void s_tree_ocp_qcqp_ipm_arg_set_reg_prim(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// set warm start: 0 no warm start, 1 primal var +void s_tree_ocp_qcqp_ipm_arg_set_warm_start(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// Mehrotra's predictor-corrector IPM algorithm: 0 no predictor-corrector, 1 use predictor-corrector +void s_tree_ocp_qcqp_ipm_arg_set_pred_corr(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// conditional predictor-corrector: 0 no conditinal predictor-corrector, 1 conditional predictor-corrector +void s_tree_ocp_qcqp_ipm_arg_set_cond_pred_corr(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// set riccati algorithm: 0 classic, 1 square-root +//void s_tree_ocp_qcqp_ipm_arg_set_ric_alg(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// compute residuals after solution +void s_tree_ocp_qcqp_ipm_arg_set_comp_res_exit(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// compute residuals of prediction +//void s_tree_ocp_qcqp_ipm_arg_set_comp_res_pred(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// min value of lam in the solution +void s_tree_ocp_qcqp_ipm_arg_set_lam_min(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// min value of t in the solution +void s_tree_ocp_qcqp_ipm_arg_set_t_min(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// use different step for primal and dual variables +void s_tree_ocp_qcqp_ipm_arg_set_split_step(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg); +// clip t and lam: 0 no, 1 in Gamma computation, 2 in solution +void s_tree_ocp_qcqp_ipm_arg_set_t_lam_min(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg); + +// +hpipm_size_t s_tree_ocp_qcqp_ipm_ws_strsize(); +// +hpipm_size_t s_tree_ocp_qcqp_ipm_ws_memsize(struct s_tree_ocp_qcqp_dim *ocp_dim, struct s_tree_ocp_qcqp_ipm_arg *arg); +// +void s_tree_ocp_qcqp_ipm_ws_create(struct s_tree_ocp_qcqp_dim *ocp_dim, struct s_tree_ocp_qcqp_ipm_arg *arg, struct s_tree_ocp_qcqp_ipm_ws *ws, void *mem); +// +void s_tree_ocp_qcqp_ipm_get(char *field, struct s_tree_ocp_qcqp_ipm_ws *ws, void *value); +// +void s_tree_ocp_qcqp_ipm_get_status(struct s_tree_ocp_qcqp_ipm_ws *ws, int *status); +// +void s_tree_ocp_qcqp_ipm_get_iter(struct s_tree_ocp_qcqp_ipm_ws *ws, int *iter); +// +void s_tree_ocp_qcqp_ipm_get_max_res_stat(struct s_tree_ocp_qcqp_ipm_ws *ws, float *res_stat); +// +void s_tree_ocp_qcqp_ipm_get_max_res_eq(struct s_tree_ocp_qcqp_ipm_ws *ws, float *res_eq); +// +void s_tree_ocp_qcqp_ipm_get_max_res_ineq(struct s_tree_ocp_qcqp_ipm_ws *ws, float *res_ineq); +// +void s_tree_ocp_qcqp_ipm_get_max_res_comp(struct s_tree_ocp_qcqp_ipm_ws *ws, float *res_comp); +// +void s_tree_ocp_qcqp_ipm_get_stat(struct s_tree_ocp_qcqp_ipm_ws *ws, float **stat); +// +void s_tree_ocp_qcqp_ipm_get_stat_m(struct s_tree_ocp_qcqp_ipm_ws *ws, int *stat_m); +// +void s_tree_ocp_qcqp_init_var(struct s_tree_ocp_qcqp *qp, struct s_tree_ocp_qcqp_sol *qp_sol, struct s_tree_ocp_qcqp_ipm_arg *arg, struct s_tree_ocp_qcqp_ipm_ws *ws); +// +void s_tree_ocp_qcqp_ipm_solve(struct s_tree_ocp_qcqp *qp, struct s_tree_ocp_qcqp_sol *qp_sol, struct s_tree_ocp_qcqp_ipm_arg *arg, struct s_tree_ocp_qcqp_ipm_ws *ws); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_S_TREE_OCP_QCQP_IPM_H_ + + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_res.h b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_res.h new file mode 100644 index 000000000..d0d84a6f2 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_res.h @@ -0,0 +1,109 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_TREE_OCP_QCQP_RES_H_ +#define HPIPM_S_TREE_OCP_QCQP_RES_H_ + + + +#include +#include + +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_tree_ocp_qcqp_res + { + struct s_tree_ocp_qcqp_dim *dim; + struct blasfeo_svec *res_g; // q-residuals + struct blasfeo_svec *res_b; // b-residuals + struct blasfeo_svec *res_d; // d-residuals + struct blasfeo_svec *res_m; // m-residuals + float res_max[4]; // max of residuals + float res_mu; // mu-residual + hpipm_size_t memsize; + }; + + + +struct s_tree_ocp_qcqp_res_ws + { + struct blasfeo_svec *tmp_nuxM; // work space of size nuM+nxM + struct blasfeo_svec *tmp_nbgqM; // work space of size nbM+ngM+nqM + struct blasfeo_svec *tmp_nsM; // work space of size nsM + struct blasfeo_svec *q_fun; // value for evaluation of quadr constr + struct blasfeo_svec *q_adj; // value for adjoint of quadr constr + int use_q_fun; // reuse cached value for evaluation of quadr constr + int use_q_adj; // reuse cached value for adjoint of quadr constr + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_tree_ocp_qcqp_res_memsize(struct s_tree_ocp_qcqp_dim *ocp_dim); +// +void s_tree_ocp_qcqp_res_create(struct s_tree_ocp_qcqp_dim *ocp_dim, struct s_tree_ocp_qcqp_res *res, void *mem); +// +hpipm_size_t s_tree_ocp_qcqp_res_ws_memsize(struct s_tree_ocp_qcqp_dim *ocp_dim); +// +void s_tree_ocp_qcqp_res_ws_create(struct s_tree_ocp_qcqp_dim *ocp_dim, struct s_tree_ocp_qcqp_res_ws *ws, void *mem); +// +void s_tree_ocp_qcqp_res_compute(struct s_tree_ocp_qcqp *qp, struct s_tree_ocp_qcqp_sol *qp_sol, struct s_tree_ocp_qcqp_res *res, struct s_tree_ocp_qcqp_res_ws *ws); +// +void s_tree_ocp_qcqp_res_compute_inf_norm(struct s_tree_ocp_qcqp_res *res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_S_TREE_OCP_QCQP_RES_H_ + + + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_sol.h b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_sol.h new file mode 100644 index 000000000..47f038c6b --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_sol.h @@ -0,0 +1,97 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_TREE_OCP_QCQP_SOL_H_ +#define HPIPM_S_TREE_OCP_QCQP_SOL_H_ + + + +#include +#include + +#include "hpipm_s_tree_ocp_qcqp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + +struct s_tree_ocp_qcqp_sol + { + struct s_tree_ocp_qcqp_dim *dim; + struct blasfeo_svec *ux; + struct blasfeo_svec *pi; + struct blasfeo_svec *lam; + struct blasfeo_svec *t; + void *misc; + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t s_tree_ocp_qcqp_sol_memsize(struct s_tree_ocp_qcqp_dim *dim); +// +void s_tree_ocp_qcqp_sol_create(struct s_tree_ocp_qcqp_dim *dim, struct s_tree_ocp_qcqp_sol *qp_sol, void *memory); +// +void s_tree_ocp_qcqp_sol_get_u(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qcqp_sol_get_x(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qcqp_sol_get_sl(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qcqp_sol_get_su(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qcqp_sol_get_pi(int edge, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qcqp_sol_get_lam_lb(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qcqp_sol_get_lam_ub(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qcqp_sol_get_lam_lg(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qcqp_sol_get_lam_ug(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_TREE_OCP_QCQP_SOL_H_ + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_utils.h b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_utils.h new file mode 100644 index 000000000..79528de1c --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qcqp_utils.h @@ -0,0 +1,85 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_TREE_OCP_QCQP_UTILS_H_ +#define HPIPM_S_TREE_OCP_QCQP_UTILS_H_ + + + +#include +#include + +#include "hpipm_s_tree_ocp_qcqp_dim.h" +#include "hpipm_s_tree_ocp_qcqp.h" +#include "hpipm_s_tree_ocp_qcqp_sol.h" +#include "hpipm_s_tree_ocp_qcqp_ipm.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void s_tree_ocp_qcqp_dim_print(struct s_tree_ocp_qcqp_dim *qp_dim); +// +//void s_tree_ocp_qcqp_dim_codegen(char *file_name, char *mode, struct s_tree_ocp_qcqp_dim *qp_dim); +// +void s_tree_ocp_qcqp_print(struct s_tree_ocp_qcqp_dim *qp_dim, struct s_tree_ocp_qcqp *qp); +// +//void s_tree_ocp_qcqp_codegen(char *file_name, char *mode, struct s_tree_ocp_qcqp_dim *qp_dim, struct s_tree_ocp_qcqp *qp); +// +void s_tree_ocp_qcqp_sol_print(struct s_tree_ocp_qcqp_dim *qp_dim, struct s_tree_ocp_qcqp_sol *ocp_qcqp_sol); +// +void s_tree_ocp_qcqp_ipm_arg_print(struct s_tree_ocp_qcqp_dim *qp_dim, struct s_tree_ocp_qcqp_ipm_arg *arg); +// +//void s_tree_ocp_qcqp_ipm_arg_codegen(char *file_name, char *mode, struct s_tree_ocp_qcqp_dim *qp_dim, struct s_tree_ocp_qcqp_ipm_arg *arg); +// +void s_tree_ocp_qcqp_res_print(struct s_tree_ocp_qcqp_dim *qp_dim, struct s_tree_ocp_qcqp_res *ocp_qcqp_res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_S_TREE_OCP_QCQP_UTILS_H_ + + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp.h b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp.h new file mode 100644 index 000000000..722b930b9 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp.h @@ -0,0 +1,196 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_TREE_OCP_QP_H_ +#define HPIPM_S_TREE_OCP_QP_H_ + + + +#include +#include + +#include "hpipm_s_tree_ocp_qp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_tree_ocp_qp + { + struct s_tree_ocp_qp_dim *dim; + struct blasfeo_smat *BAbt; // Nn-1 + struct blasfeo_smat *RSQrq; // Nn + struct blasfeo_smat *DCt; // Nn + struct blasfeo_svec *b; // Nn-1 + struct blasfeo_svec *rqz; // Nn + struct blasfeo_svec *d; // Nn + struct blasfeo_svec *d_mask; // Nn + struct blasfeo_svec *m; // Nn + struct blasfeo_svec *Z; // Nn + int **idxb; // indices of box constrained variables within [u; x] // Nn +// int **idxs; // index of soft constraints + int **idxs_rev; // index of soft constraints + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t s_tree_ocp_qp_memsize(struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_create(struct s_tree_ocp_qp_dim *dim, struct s_tree_ocp_qp *qp, void *memory); +// +void s_tree_ocp_qp_set_all(float **A, float **B, float **b, float **Q, float **S, float **R, float **q, float **r, int **idxb, float **d_lb, float **d_ub, float **C, float **D, float **d_lg, float **d_ug, float **Zl, float **Zu, float **zl, float **zu, int **idxs, float **d_ls, float **d_us, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set(char *field_name, int node_edge, void *value, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_A(int edge, float *mat, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_B(int edge, float *mat, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_b(int edge, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_Q(int node, float *mat, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_S(int node, float *mat, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_R(int node, float *mat, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_q(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_r(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_lb(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_lb_mask(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_ub(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_ub_mask(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_lbx(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_lbx_mask(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_ubx(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_ubx_mask(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_lbu(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_lbu_mask(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_ubu(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_ubu_mask(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_idxb(int node, int *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_idxbx(int node, int *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_Jbx(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_idxbu(int node, int *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_Jbu(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_C(int node, float *mat, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_D(int node, float *mat, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_lg(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_lg_mask(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_ug(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_ug_mask(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_Zl(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_Zu(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_zl(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_zu(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_lls(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_lls_mask(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_lus(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_lus_mask(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_idxs(int node, int *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_idxs_rev(int node, int *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_Jsbu(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_Jsbx(int node, float *vec, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_set_Jsg(int node, float *vec, struct s_tree_ocp_qp *qp); +// +//void s_tree_ocp_qp_set_idxe(int node, int *vec, struct s_tree_ocp_qp *qp); +// +//void s_tree_ocp_qp_set_idxbxe(int node, int *vec, struct s_tree_ocp_qp *qp); +// +//void s_tree_ocp_qp_set_idxbue(int node, int *vec, struct s_tree_ocp_qp *qp); +// +//void s_tree_ocp_qp_set_idxge(int node, int *vec, struct s_tree_ocp_qp *qp); +// +//void s_tree_ocp_qp_set_Jbxe(int node, float *vec, struct s_tree_ocp_qp *qp); +// +//void s_tree_ocp_qp_set_Jbue(int node, float *vec, struct s_tree_ocp_qp *qp); +// +//void s_tree_ocp_qp_set_Jge(int node, float *vec, struct s_tree_ocp_qp *qp); +// +//void s_tree_ocp_qp_set_diag_H_flag(int node, int *value, struct s_tree_ocp_qp *qp); + + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_TREE_OCP_QP_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_dim.h b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_dim.h new file mode 100644 index 000000000..90df57182 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_dim.h @@ -0,0 +1,111 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_TREE_OCP_QP_DIM_H_ +#define HPIPM_S_TREE_OCP_QP_DIM_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_tree_ocp_qp_dim + { + struct tree *ttree; // tree describing node conndection + int *nx; // number of states // Nn + int *nu; // number of inputs // Nn + int *nb; // number of box constraints // Nn + int *nbx; // number of state box constraints // Nn + int *nbu; // number of input box constraints // Nn + int *ng; // number of general constraints // Nn + int *ns; // number of soft constraints // Nn + int *nsbx; // number of soft state box constraints + int *nsbu; // number of soft input box constraints + int *nsg; // number of soft general constraints + int Nn; // number of nodes + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_tree_ocp_qp_dim_strsize(); +// +hpipm_size_t s_tree_ocp_qp_dim_memsize(int Nn); +// +void s_tree_ocp_qp_dim_create(int Nn, struct s_tree_ocp_qp_dim *qp_dim, void *memory); +// +void s_tree_ocp_qp_dim_set_all(struct tree *ttree, int *nx, int *nu, int *nbx, int *nbu, int *ng, int *nsbx, int *nsbu, int *nsg, struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_dim_set_tree(struct tree *ttree, struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_dim_set(char *field, int stage, int value, struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_dim_set_nx(int stage, int value, struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_dim_set_nu(int stage, int value, struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_dim_set_nbx(int stage, int value, struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_dim_set_nbu(int stage, int value, struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_dim_set_ng(int stage, int value, struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_dim_set_ns(int stage, int value, struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_dim_set_nsbx(int stage, int value, struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_dim_set_nsbu(int stage, int value, struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_dim_set_nsg(int stage, int value, struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_dim_set_nbxe(int stage, int value, struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_dim_set_nbue(int stage, int value, struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_dim_set_nge(int stage, int value, struct s_tree_ocp_qp_dim *dim); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_S_TREE_OCP_QP_DIM_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_ipm.h b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_ipm.h new file mode 100644 index 000000000..f8c26d317 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_ipm.h @@ -0,0 +1,208 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + + +#ifndef HPIPM_S_TREE_OCP_QP_IPM_H_ +#define HPIPM_S_TREE_OCP_QP_IPM_H_ + + + +#include +#include + +#include +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_tree_ocp_qp_ipm_arg + { + float mu0; // initial value for duality measure + float alpha_min; // exit cond on step length + float res_g_max; // exit cond on inf norm of residuals + float res_b_max; // exit cond on inf norm of residuals + float res_d_max; // exit cond on inf norm of residuals + float res_m_max; // exit cond on inf norm of residuals + float reg_prim; // reg of primal hessian + float lam_min; // min value in lam vector + float t_min; // min value in t vector + float tau_min; // min value of barrier parameter + int iter_max; // exit cond in iter number + int stat_max; // iterations saved in stat + int stat_m; // number of recorded stat per IPM iter + int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm + int cond_pred_corr; // conditional Mehrotra's predictor-corrector + int itref_pred_max; // max number of iterative refinement steps for predictor step + int itref_corr_max; // max number of iterative refinement steps for corrector step + int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol + int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq + int abs_form; // absolute IPM formulation + int comp_dual_sol_eq; // dual solution (only for abs_form==1) + int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol==1) + int split_step; // use different steps for primal and dual variables + int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution + int mode; + hpipm_size_t memsize; + }; + + + +struct s_tree_ocp_qp_ipm_ws + { + struct s_core_qp_ipm_workspace *core_workspace; + struct s_tree_ocp_qp_res_ws *res_workspace; + struct s_tree_ocp_qp_sol *sol_step; + struct s_tree_ocp_qp_sol *sol_itref; + struct s_tree_ocp_qp *qp_step; + struct s_tree_ocp_qp *qp_itref; + struct s_tree_ocp_qp_res *res_itref; + struct s_tree_ocp_qp_res *res; + struct blasfeo_svec *Gamma; // hessian update + struct blasfeo_svec *gamma; // hessian update + struct blasfeo_svec *tmp_nxM; // work space of size nxM + struct blasfeo_svec *tmp_nbgM; // work space of size nbgM + struct blasfeo_svec *tmp_nsM; // work space of size nsM + struct blasfeo_svec *Pb; // Pb + struct blasfeo_svec *Zs_inv; + struct blasfeo_smat *L; + struct blasfeo_smat *Lh; + struct blasfeo_smat *AL; + struct blasfeo_smat *lq0; + struct blasfeo_svec *tmp_m; + float *stat; // convergence statistics + int *use_hess_fact; + void *lq_work0; + float qp_res[4]; // infinity norm of residuals + int iter; // iteration number + int stat_max; // iterations saved in stat + int stat_m; // number of recorded stat per IPM iter + int use_Pb; + int status; // solver status + int lq_fact; // cache from arg + int mask_constr; // use constr mask + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_tree_ocp_qp_ipm_arg_memsize(struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_ipm_arg_create(struct s_tree_ocp_qp_dim *dim, struct s_tree_ocp_qp_ipm_arg *arg, void *mem); +// +void s_tree_ocp_qp_ipm_arg_set_default(enum hpipm_mode mode, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_iter_max(int *iter_max, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_alpha_min(float *alpha_min, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_mu0(float *mu0, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_tol_stat(float *tol_stat, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_tol_eq(float *tol_eq, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_tol_ineq(float *tol_ineq, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_tol_comp(float *tol_comp, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_reg_prim(float *reg, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_warm_start(int *warm_start, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_pred_corr(int *pred_corr, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_cond_pred_corr(int *value, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_comp_dual_sol_eq(int *value, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_comp_res_exit(int *value, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_lam_min(float *value, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_t_min(float *value, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_tau_min(float *value, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_split_step(int *value, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_arg_set_t_lam_min(int *value, struct s_tree_ocp_qp_ipm_arg *arg); + +// +hpipm_size_t s_tree_ocp_qp_ipm_ws_memsize(struct s_tree_ocp_qp_dim *dim, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_ipm_ws_create(struct s_tree_ocp_qp_dim *dim, struct s_tree_ocp_qp_ipm_arg *arg, struct s_tree_ocp_qp_ipm_ws *ws, void *mem); +// +void s_tree_ocp_qp_ipm_get_status(struct s_tree_ocp_qp_ipm_ws *ws, int *status); +// +void s_tree_ocp_qp_ipm_get_iter(struct s_tree_ocp_qp_ipm_ws *ws, int *iter); +// +void s_tree_ocp_qp_ipm_get_max_res_stat(struct s_tree_ocp_qp_ipm_ws *ws, float *res_stat); +// +void s_tree_ocp_qp_ipm_get_max_res_eq(struct s_tree_ocp_qp_ipm_ws *ws, float *res_eq); +// +void s_tree_ocp_qp_ipm_get_max_res_ineq(struct s_tree_ocp_qp_ipm_ws *ws, float *res_ineq); +// +void s_tree_ocp_qp_ipm_get_max_res_comp(struct s_tree_ocp_qp_ipm_ws *ws, float *res_comp); +// +void s_tree_ocp_qp_ipm_get_stat(struct s_tree_ocp_qp_ipm_ws *ws, float **stat); +// +void s_tree_ocp_qp_ipm_get_stat_m(struct s_tree_ocp_qp_ipm_ws *ws, int *stat_m); +// +void s_tree_ocp_qp_init_var(struct s_tree_ocp_qp *qp, struct s_tree_ocp_qp_sol *qp_sol, struct s_tree_ocp_qp_ipm_arg *arg, struct s_tree_ocp_qp_ipm_ws *ws); +// +void s_tree_ocp_qp_ipm_abs_step(int kk, struct s_tree_ocp_qp *qp, struct s_tree_ocp_qp_sol *qp_sol, struct s_tree_ocp_qp_ipm_arg *arg, struct s_tree_ocp_qp_ipm_ws *ws); +// +void s_tree_ocp_qp_ipm_delta_step(int kk, struct s_tree_ocp_qp *qp, struct s_tree_ocp_qp_sol *qp_sol, struct s_tree_ocp_qp_ipm_arg *arg, struct s_tree_ocp_qp_ipm_ws *ws); +// +void s_tree_ocp_qp_ipm_solve(struct s_tree_ocp_qp *qp, struct s_tree_ocp_qp_sol *qp_sol, struct s_tree_ocp_qp_ipm_arg *arg, struct s_tree_ocp_qp_ipm_ws *ws); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_TREE_OCP_QP_IPM_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_kkt.h b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_kkt.h new file mode 100644 index 000000000..bcf735478 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_kkt.h @@ -0,0 +1,54 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + +#ifdef __cplusplus +extern "C" { +#endif + +// +void s_tree_ocp_qp_fact_solve_kkt_unconstr(struct s_tree_ocp_qp *qp, struct s_tree_ocp_qp_sol *qp_sol, struct s_tree_ocp_qp_ipm_arg *arg, struct s_tree_ocp_qp_ipm_ws *ws); +// +void s_tree_ocp_qp_fact_solve_kkt_step(struct s_tree_ocp_qp *qp, struct s_tree_ocp_qp_sol *qp_sol, struct s_tree_ocp_qp_ipm_arg *arg, struct s_tree_ocp_qp_ipm_ws *ws); +// +void s_tree_ocp_qp_fact_lq_solve_kkt_step(struct s_tree_ocp_qp *qp, struct s_tree_ocp_qp_sol *qp_sol, struct s_tree_ocp_qp_ipm_arg *arg, struct s_tree_ocp_qp_ipm_ws *ws); +// +void s_tree_ocp_qp_solve_kkt_step(struct s_tree_ocp_qp *qp, struct s_tree_ocp_qp_sol *qp_sol, struct s_tree_ocp_qp_ipm_arg *arg, struct s_tree_ocp_qp_ipm_ws *ws); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_res.h b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_res.h new file mode 100644 index 000000000..5c6797204 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_res.h @@ -0,0 +1,107 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_TREE_OCP_QP_RES_H_ +#define HPIPM_S_TREE_OCP_QP_RES_H_ + + + +#include +#include + +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct s_tree_ocp_qp_res + { + struct s_tree_ocp_qp_dim *dim; + struct blasfeo_svec *res_g; // q-residuals + struct blasfeo_svec *res_b; // b-residuals + struct blasfeo_svec *res_d; // d-residuals + struct blasfeo_svec *res_m; // m-residuals + float res_max[4]; // max of residuals + float res_mu; // mu-residual + hpipm_size_t memsize; + }; + + + +struct s_tree_ocp_qp_res_ws + { + struct blasfeo_svec *tmp_nbgM; // work space of size nbM+ngM + struct blasfeo_svec *tmp_nsM; // work space of size nsM + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t s_tree_ocp_qp_res_memsize(struct s_tree_ocp_qp_dim *ocp_dim); +// +void s_tree_ocp_qp_res_create(struct s_tree_ocp_qp_dim *ocp_dim, struct s_tree_ocp_qp_res *res, void *mem); +// +hpipm_size_t s_tree_ocp_qp_res_ws_memsize(struct s_tree_ocp_qp_dim *ocp_dim); +// +void s_tree_ocp_qp_res_ws_create(struct s_tree_ocp_qp_dim *ocp_dim, struct s_tree_ocp_qp_res_ws *ws, void *mem); +// +void s_tree_ocp_qp_res_get_all(struct s_tree_ocp_qp_res *res, float **res_r, float **res_q, float **res_ls, float **res_us, float **res_b, float **res_d_lb, float **res_d_ub, float **res_d_lg, float **res_d_ug, float **res_d_ls, float **res_d_us, float **res_m_lb, float **res_m_ub, float **res_m_lg, float **res_m_ug, float **res_m_ls, float **res_m_us); +// +void s_tree_ocp_qp_res_compute(struct s_tree_ocp_qp *qp, struct s_tree_ocp_qp_sol *qp_sol, struct s_tree_ocp_qp_res *res, struct s_tree_ocp_qp_res_ws *ws); +// +void s_tree_ocp_qp_res_compute_lin(struct s_tree_ocp_qp *qp, struct s_tree_ocp_qp_sol *qp_sol, struct s_tree_ocp_qp_sol *qp_step, struct s_tree_ocp_qp_res *res, struct s_tree_ocp_qp_res_ws *ws); +// +void s_tree_ocp_qp_res_compute_inf_norm(struct s_tree_ocp_qp_res *res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_S_TREE_OCP_QP_RES_H_ + + + diff --git a/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_sol.h b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_sol.h new file mode 100644 index 000000000..71e887675 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_sol.h @@ -0,0 +1,98 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_TREE_OCP_QP_SOL_H_ +#define HPIPM_S_TREE_OCP_QP_SOL_H_ + + + +#include +#include + +#include "hpipm_s_tree_ocp_qp_dim.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + +struct s_tree_ocp_qp_sol + { + struct s_tree_ocp_qp_dim *dim; + struct blasfeo_svec *ux; + struct blasfeo_svec *pi; + struct blasfeo_svec *lam; + struct blasfeo_svec *t; + void *misc; + hpipm_size_t memsize; // memory size in bytes + }; + + + +// +hpipm_size_t s_tree_ocp_qp_sol_memsize(struct s_tree_ocp_qp_dim *dim); +// +void s_tree_ocp_qp_sol_create(struct s_tree_ocp_qp_dim *dim, struct s_tree_ocp_qp_sol *qp_sol, void *memory); +// +void s_tree_ocp_qp_sol_get_all(struct s_tree_ocp_qp *qp, struct s_tree_ocp_qp_sol *qp_sol, float **u, float **x, float **ls, float **us, float **pi, float **lam_lb, float **lam_ub, float **lam_lg, float **lam_ug, float **lam_ls, float **lam_us); +// +void s_tree_ocp_qp_sol_get_u(int node, struct s_tree_ocp_qp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qp_sol_get_x(int node, struct s_tree_ocp_qp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qp_sol_get_sl(int node, struct s_tree_ocp_qp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qp_sol_get_su(int node, struct s_tree_ocp_qp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qp_sol_get_pi(int edge, struct s_tree_ocp_qp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qp_sol_get_lam_lb(int node, struct s_tree_ocp_qp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qp_sol_get_lam_ub(int node, struct s_tree_ocp_qp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qp_sol_get_lam_lg(int node, struct s_tree_ocp_qp_sol *qp_sol, float *vec); +// +void s_tree_ocp_qp_sol_get_lam_ug(int node, struct s_tree_ocp_qp_sol *qp_sol, float *vec); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif // HPIPM_S_TREE_OCP_QP_SOL_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_utils.h b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_utils.h new file mode 100644 index 000000000..ec1747568 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_s_tree_ocp_qp_utils.h @@ -0,0 +1,84 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_S_TREE_OCP_QP_UTILS_H_ +#define HPIPM_S_TREE_OCP_QP_UTILS_H_ + + + +#include +#include + +#include "hpipm_s_tree_ocp_qp_dim.h" +#include "hpipm_s_tree_ocp_qp.h" +#include "hpipm_s_tree_ocp_qp_sol.h" +#include "hpipm_s_tree_ocp_qp_ipm.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// +void s_tree_ocp_qp_dim_print(struct s_tree_ocp_qp_dim *qp_dim); +// +//void s_tree_ocp_qp_dim_codegen(char *file_name, char *mode, struct s_tree_ocp_qp_dim *qp_dim); +// +void s_tree_ocp_qp_print(struct s_tree_ocp_qp_dim *qp_dim, struct s_tree_ocp_qp *qp); +// +//void s_tree_ocp_qp_codegen(char *file_name, char *mode, struct s_tree_ocp_qp_dim *qp_dim, struct s_tree_ocp_qp *qp); +// +void s_tree_ocp_qp_sol_print(struct s_tree_ocp_qp_dim *qp_dim, struct s_tree_ocp_qp_sol *ocp_qp_sol); +// +void s_tree_ocp_qp_ipm_arg_print(struct s_tree_ocp_qp_dim *qp_dim, struct s_tree_ocp_qp_ipm_arg *arg); +// +//void s_tree_ocp_qp_ipm_arg_codegen(char *file_name, char *mode, struct s_tree_ocp_qp_dim *qp_dim, struct s_tree_ocp_qp_ipm_arg *arg); +// +void s_tree_ocp_qp_res_print(struct s_tree_ocp_qp_dim *qp_dim, struct s_tree_ocp_qp_res *ocp_qp_res); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + + +#endif // HPIPM_S_TREE_OCP_QP_UTILS_H_ + + diff --git a/third_party/acados/include/hpipm/include/hpipm_scenario_tree.h b/third_party/acados/include/hpipm/include/hpipm_scenario_tree.h new file mode 100644 index 000000000..a3c77a670 --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_scenario_tree.h @@ -0,0 +1,70 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_SCENARIO_TREE_H_ +#define HPIPM_SCENARIO_TREE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct sctree + { + struct node *root; // pointer to root + int *kids; // pointer to array of kids + int Nn; // numer of nodes + int md; // number of realizations + int Nr; // robust horizion + int Nh; // control horizion + hpipm_size_t memsize; + }; + + + +// +hpipm_size_t sctree_memsize(int md, int Nr, int Nh); +// +void sctree_create(int md, int Nr, int Nh, struct sctree *st, void *memory); +// +void sctree_cast_to_tree(struct sctree *st, struct tree *tt); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // HPIPM_SCENARIO_TREE_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_timing.h b/third_party/acados/include/hpipm/include/hpipm_timing.h new file mode 100644 index 000000000..bd0f2dbcb --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_timing.h @@ -0,0 +1,67 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + +#ifndef HPIPM_TIMING_H_ +#define HPIPM_TIMING_H_ + + + +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +typedef blasfeo_timer hpipm_timer; + + + +// +void hpipm_tic(hpipm_timer *t); +// +double hpipm_toc(hpipm_timer *t); + + + +#ifdef __cplusplus +} // #extern "C" +#endif + + +#endif // HPIPM_TIMING_H_ diff --git a/third_party/acados/include/hpipm/include/hpipm_tree.h b/third_party/acados/include/hpipm/include/hpipm_tree.h new file mode 100644 index 000000000..f9d69ecdd --- /dev/null +++ b/third_party/acados/include/hpipm/include/hpipm_tree.h @@ -0,0 +1,76 @@ +/************************************************************************************************** +* * +* This file is part of HPIPM. * +* * +* HPIPM -- High-Performance Interior Point Method. * +* Copyright (C) 2019 by Gianluca Frison. * +* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * +* All rights reserved. * +* * +* The 2-Clause BSD License * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright notice, this * +* list of conditions and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright notice, * +* this list of conditions and the following disclaimer in the documentation * +* and/or other materials provided with the distribution. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * +* * +**************************************************************************************************/ + + +#ifndef HPIPM_TREE_H_ +#define HPIPM_TREE_H_ + +#include "hpipm_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +struct node + { + int *kids; // 64 bits + int idx; // 32 bits + int dad; // 32 bits + int nkids; // 32 bits + int stage; // 32 bits + int real; // 32 bits + int idxkid; // 32 bits // XXX needed ??? + // total 256 bits + }; + + + +struct tree + { + struct node *root; // pointer to root + int *kids; // pointer to array of kids + int Nn; // numer of nodes + hpipm_size_t memsize; + }; + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // HPIPM_TREE_H_ diff --git a/third_party/acados/include/qpOASES_e/Bounds.h b/third_party/acados/include/qpOASES_e/Bounds.h new file mode 100644 index 000000000..4e41c1d16 --- /dev/null +++ b/third_party/acados/include/qpOASES_e/Bounds.h @@ -0,0 +1,543 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/Bounds.h + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + * + * Declaration of the Bounds class designed to manage working sets of + * bounds within a QProblem. + */ + + +#ifndef QPOASES_BOUNDS_H +#define QPOASES_BOUNDS_H + + +#include + + +BEGIN_NAMESPACE_QPOASES + + +/** + * \brief Manages working sets of bounds (= box constraints). + * + * This class manages working sets of bounds (= box constraints) + * by storing index sets and other status information. + * + * \author Hans Joachim Ferreau + * \version 3.1embedded + * \date 2007-2015 + */ +typedef struct +{ + Indexlist *freee; /**< Index list of free variables. */ + Indexlist *fixed; /**< Index list of fixed variables. */ + + Indexlist *shiftedFreee; /**< Memory for shifting free variables. */ + Indexlist *shiftedFixed; /**< Memory for shifting fixed variables. */ + + Indexlist *rotatedFreee; /**< Memory for rotating free variables. */ + Indexlist *rotatedFixed; /**< Memory for rotating fixed variables. */ + + SubjectToType *type; /**< Type of bounds. */ + SubjectToStatus *status; /**< Status of bounds. */ + + SubjectToType *typeTmp; /**< Temp memory for type of bounds. */ + SubjectToStatus *statusTmp; /**< Temp memory for status of bounds. */ + + BooleanType noLower; /**< This flag indicates if there is no lower bound on any variable. */ + BooleanType noUpper; /**< This flag indicates if there is no upper bound on any variable. */ + + int n; /**< Total number of bounds. */ +} Bounds; + +int Bounds_calculateMemorySize( int n); + +char *Bounds_assignMemory(int n, Bounds **mem, void *raw_memory); + +Bounds *Bounds_createMemory( int n ); + +/** Constructor which takes the number of bounds. */ +void BoundsCON( Bounds* _THIS, + int _n /**< Number of bounds. */ + ); + +/** Copies all members from given rhs object. + * \return SUCCESSFUL_RETURN */ +void BoundsCPY( Bounds* FROM, + Bounds* TO + ); + + +/** Initialises object with given number of bounds. + * \return SUCCESSFUL_RETURN \n + RET_INVALID_ARGUMENTS */ +returnValue Bounds_init( Bounds* _THIS, + int _n /**< Number of bounds. */ + ); + + +/** Initially adds number of a new (i.e. not yet in the list) bound to + * given index set. + * \return SUCCESSFUL_RETURN \n + RET_SETUP_BOUND_FAILED \n + RET_INDEX_OUT_OF_BOUNDS \n + RET_INVALID_ARGUMENTS */ +returnValue Bounds_setupBound( Bounds* _THIS, + int number, /**< Number of new bound. */ + SubjectToStatus _status /**< Status of new bound. */ + ); + +/** Initially adds all numbers of new (i.e. not yet in the list) bounds to + * to the index set of free bounds; the order depends on the SujectToType + * of each index. + * \return SUCCESSFUL_RETURN \n + RET_SETUP_BOUND_FAILED */ +returnValue Bounds_setupAllFree( Bounds* _THIS + ); + +/** Initially adds all numbers of new (i.e. not yet in the list) bounds to + * to the index set of fixed bounds (on their lower bounds); + * the order depends on the SujectToType of each index. + * \return SUCCESSFUL_RETURN \n + RET_SETUP_BOUND_FAILED */ +returnValue Bounds_setupAllLower( Bounds* _THIS + ); + +/** Initially adds all numbers of new (i.e. not yet in the list) bounds to + * to the index set of fixed bounds (on their upper bounds); + * the order depends on the SujectToType of each index. + * \return SUCCESSFUL_RETURN \n + RET_SETUP_BOUND_FAILED */ +returnValue Bounds_setupAllUpper( Bounds* _THIS + ); + + +/** Moves index of a bound from index list of fixed to that of free bounds. + * \return SUCCESSFUL_RETURN \n + RET_MOVING_BOUND_FAILED \n + RET_INDEX_OUT_OF_BOUNDS */ +returnValue Bounds_moveFixedToFree( Bounds* _THIS, + int number /**< Number of bound to be freed. */ + ); + +/** Moves index of a bound from index list of free to that of fixed bounds. + * \return SUCCESSFUL_RETURN \n + RET_MOVING_BOUND_FAILED \n + RET_INDEX_OUT_OF_BOUNDS */ +returnValue Bounds_moveFreeToFixed( Bounds* _THIS, + int number, /**< Number of bound to be fixed. */ + SubjectToStatus _status /**< Status of bound to be fixed. */ + ); + +/** Flip fixed bound. + * \return SUCCESSFUL_RETURN \n + RET_MOVING_BOUND_FAILED \n + RET_INDEX_OUT_OF_BOUNDS */ +returnValue Bounds_flipFixed( Bounds* _THIS, + int number + ); + +/** Swaps the indices of two free bounds within the index set. + * \return SUCCESSFUL_RETURN \n + RET_SWAPINDEX_FAILED */ +returnValue Bounds_swapFree( Bounds* _THIS, + int number1, /**< Number of first bound. */ + int number2 /**< Number of second bound. */ + ); + + +/** Returns number of variables. + * \return Number of variables. */ +static inline int Bounds_getNV( Bounds* _THIS + ); + +/** Returns number of implicitly fixed variables. + * \return Number of implicitly fixed variables. */ +static inline int Bounds_getNFV( Bounds* _THIS + ); + +/** Returns number of bounded (but possibly free) variables. + * \return Number of bounded (but possibly free) variables. */ +static inline int Bounds_getNBV( Bounds* _THIS + ); + +/** Returns number of unbounded variables. + * \return Number of unbounded variables. */ +static inline int Bounds_getNUV( Bounds* _THIS + ); + +/** Returns number of free variables. + * \return Number of free variables. */ +static inline int Bounds_getNFR( Bounds* _THIS + ); + +/** Returns number of fixed variables. + * \return Number of fixed variables. */ +static inline int Bounds_getNFX( Bounds* _THIS + ); + + +/** Returns a pointer to free variables index list. + * \return Pointer to free variables index list. */ +static inline Indexlist* Bounds_getFree( Bounds* _THIS + ); + +/** Returns a pointer to fixed variables index list. + * \return Pointer to fixed variables index list. */ +static inline Indexlist* Bounds_getFixed( Bounds* _THIS + ); + + +/** Returns number of bounds with given SubjectTo type. + * \return Number of bounds with given type. */ +static inline int Bounds_getNumberOfType( Bounds* _THIS, + SubjectToType _type /**< Type of bound. */ + ); + + +/** Returns type of bound. + * \return Type of bound \n + RET_INDEX_OUT_OF_BOUNDS */ +static inline SubjectToType Bounds_getType( Bounds* _THIS, + int i /**< Number of bound. */ + ); + +/** Returns status of bound. + * \return Status of bound \n + ST_UNDEFINED */ +static inline SubjectToStatus Bounds_getStatus( Bounds* _THIS, + int i /**< Number of bound. */ + ); + + +/** Sets type of bound. + * \return SUCCESSFUL_RETURN \n + RET_INDEX_OUT_OF_BOUNDS */ +static inline returnValue Bounds_setType( Bounds* _THIS, + int i, /**< Number of bound. */ + SubjectToType value /**< Type of bound. */ + ); + +/** Sets status of bound. + * \return SUCCESSFUL_RETURN \n + RET_INDEX_OUT_OF_BOUNDS */ +static inline returnValue Bounds_setStatus( Bounds* _THIS, + int i, /**< Number of bound. */ + SubjectToStatus value /**< Status of bound. */ + ); + + +/** Sets status of lower bounds. */ +static inline void Bounds_setNoLower( Bounds* _THIS, + BooleanType _status /**< Status of lower bounds. */ + ); + +/** Sets status of upper bounds. */ +static inline void Bounds_setNoUpper( Bounds* _THIS, + BooleanType _status /**< Status of upper bounds. */ + ); + + +/** Returns status of lower bounds. + * \return BT_TRUE if there is no lower bound on any variable. */ +static inline BooleanType Bounds_hasNoLower( Bounds* _THIS + ); + +/** Returns status of upper bounds. + * \return BT_TRUE if there is no upper bound on any variable. */ +static inline BooleanType Bounds_hasNoUpper( Bounds* _THIS + ); + + +/** Shifts forward type and status of all bounds by a given + * offset. This offset has to lie within the range [0,n/2] and has to + * be an integer divisor of the total number of bounds n. + * Type and status of the first \ bounds is thrown away, + * type and status of the last \ bounds is doubled, + * e.g. for offset = 2: \n + * shift( {b1,b2,b3,b4,b5,b6} ) = {b3,b4,b5,b6,b5,b6} + * \return SUCCESSFUL_RETURN \n + RET_INDEX_OUT_OF_BOUNDS \n + RET_INVALID_ARGUMENTS \n + RET_SHIFTING_FAILED */ +returnValue Bounds_shift( Bounds* _THIS, + int offset /**< Shift offset within the range [0,n/2] and integer divisor of n. */ + ); + +/** Rotates forward type and status of all bounds by a given + * offset. This offset has to lie within the range [0,n]. + * Example for offset = 2: \n + * rotate( {b1,b2,b3,b4,b5,b6} ) = {b3,b4,b5,b6,b1,b2} + * \return SUCCESSFUL_RETURN \n + RET_INDEX_OUT_OF_BOUNDS \n + RET_ROTATING_FAILED */ +returnValue Bounds_rotate( Bounds* _THIS, + int offset /**< Rotation offset within the range [0,n]. */ + ); + + +/** Prints information on bounds object + * (in particular, lists of free and fixed bounds. + * \return SUCCESSFUL_RETURN \n + RET_INDEXLIST_CORRUPTED */ +returnValue Bounds_print( Bounds* _THIS + ); + + +/** Initially adds all numbers of new (i.e. not yet in the list) bounds to + * to the index set corresponding to the desired status; + * the order depends on the SujectToType of each index. + * \return SUCCESSFUL_RETURN \n + RET_SETUP_BOUND_FAILED */ +returnValue Bounds_setupAll( Bounds* _THIS, + SubjectToStatus _status /**< Desired initial status for all bounds. */ + ); + + +/** Adds the index of a new bound to index set. + * \return SUCCESSFUL_RETURN \n + RET_ADDINDEX_FAILED \n + RET_INVALID_ARGUMENTS */ +returnValue Bounds_addIndex( Bounds* _THIS, + Indexlist* const indexlist, /**< Index list to which the new index shall be added. */ + int newnumber, /**< Number of new bound. */ + SubjectToStatus newstatus /**< Status of new bound. */ + ); + +/** Removes the index of a bound from index set. + * \return SUCCESSFUL_RETURN \n + RET_REMOVEINDEX_FAILED \n + RET_INVALID_ARGUMENTS */ +returnValue Bounds_removeIndex( Bounds* _THIS, + Indexlist* const indexlist, /**< Index list from which the new index shall be removed. */ + int removenumber /**< Number of bound to be removed. */ + ); + +/** Swaps the indices of two constraints or bounds within the index set. + * \return SUCCESSFUL_RETURN \n + RET_SWAPINDEX_FAILED \n + RET_INVALID_ARGUMENTS */ +returnValue Bounds_swapIndex( Bounds* _THIS, + Indexlist* const indexlist, /**< Index list in which the indices shold be swapped. */ + int number1, /**< Number of first bound. */ + int number2 /**< Number of second bound. */ + ); + + + +/* + * g e t N u m b e r O f T y p e + */ +static inline int Bounds_getNumberOfType( Bounds* _THIS, SubjectToType _type ) +{ + int i; + int numberOfType = 0; + + if ( _THIS->type != 0 ) + { + for( i=0; i<_THIS->n; ++i ) + if ( _THIS->type[i] == _type ) + ++numberOfType; + } + + return numberOfType; +} + + +/* + * g e t T y p e + */ +static inline SubjectToType Bounds_getType( Bounds* _THIS, int i ) +{ + if ( ( i >= 0 ) && ( i < _THIS->n ) ) + return _THIS->type[i]; + + return ST_UNKNOWN; +} + + +/* + * g e t S t a t u s + */ +static inline SubjectToStatus Bounds_getStatus( Bounds* _THIS, int i ) +{ + if ( ( i >= 0 ) && ( i < _THIS->n ) ) + return _THIS->status[i]; + + return ST_UNDEFINED; +} + + +/* + * s e t T y p e + */ +static inline returnValue Bounds_setType( Bounds* _THIS, int i, SubjectToType value ) +{ + if ( ( i >= 0 ) && ( i < _THIS->n ) ) + { + _THIS->type[i] = value; + return SUCCESSFUL_RETURN; + } + else + return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); +} + + +/* + * s e t S t a t u s + */ +static inline returnValue Bounds_setStatus( Bounds* _THIS, int i, SubjectToStatus value ) +{ + if ( ( i >= 0 ) && ( i < _THIS->n ) ) + { + _THIS->status[i] = value; + return SUCCESSFUL_RETURN; + } + else + return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); +} + + +/* + * s e t N o L o w e r + */ +static inline void Bounds_setNoLower( Bounds* _THIS, BooleanType _status ) +{ + _THIS->noLower = _status; +} + + +/* + * s e t N o U p p e r + */ +static inline void Bounds_setNoUpper( Bounds* _THIS, BooleanType _status ) +{ + _THIS->noUpper = _status; +} + + +/* + * h a s N o L o w e r + */ +static inline BooleanType Bounds_hasNoLower( Bounds* _THIS ) +{ + return _THIS->noLower; +} + + +/* + * h a s N o U p p p e r + */ +static inline BooleanType Bounds_hasNoUpper( Bounds* _THIS ) +{ + return _THIS->noUpper; +} + + + +/* + * g e t N V + */ +static inline int Bounds_getNV( Bounds* _THIS ) +{ + return _THIS->n; +} + + +/* + * g e t N F V + */ +static inline int Bounds_getNFV( Bounds* _THIS ) +{ + return Bounds_getNumberOfType( _THIS,ST_EQUALITY ); +} + + +/* + * g e t N B V + */ +static inline int Bounds_getNBV( Bounds* _THIS ) +{ + return Bounds_getNumberOfType( _THIS,ST_BOUNDED ); +} + + +/* + * g e t N U V + */ +static inline int Bounds_getNUV( Bounds* _THIS ) +{ + return Bounds_getNumberOfType( _THIS,ST_UNBOUNDED ); +} + + +/* + * g e t N F R + */ +static inline int Bounds_getNFR( Bounds* _THIS ) +{ + return Indexlist_getLength( _THIS->freee ); +} + + +/* + * g e t N F X + */ +static inline int Bounds_getNFX( Bounds* _THIS ) +{ + return Indexlist_getLength( _THIS->fixed ); +} + + +/* + * g e t F r e e + */ +static inline Indexlist* Bounds_getFree( Bounds* _THIS ) +{ + return _THIS->freee; +} + + +/* + * g e t F i x e d + */ +static inline Indexlist* Bounds_getFixed( Bounds* _THIS ) +{ + return _THIS->fixed; +} + + +END_NAMESPACE_QPOASES + +#endif /* QPOASES_BOUNDS_H */ + + +/* + * end of file + */ diff --git a/third_party/acados/include/qpOASES_e/Constants.h b/third_party/acados/include/qpOASES_e/Constants.h new file mode 100644 index 000000000..0e3dcd19f --- /dev/null +++ b/third_party/acados/include/qpOASES_e/Constants.h @@ -0,0 +1,134 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/Constants.h + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + * + * Definition of all global constants. + */ + + +#ifndef QPOASES_CONSTANTS_H +#define QPOASES_CONSTANTS_H + + +#include + +#ifdef __CODE_GENERATION__ + + #define CONVERTTOSTRINGAUX(x) #x + #define CONVERTTOSTRING(x) CONVERTTOSTRINGAUX(x) + + #ifndef QPOASES_CUSTOM_INTERFACE + #include "acado_qpoases3_interface.h" + #else + #include CONVERTTOSTRING(QPOASES_CUSTOM_INTERFACE) + #endif + +#endif + + +BEGIN_NAMESPACE_QPOASES + + +#ifndef __EXTERNAL_DIMENSIONS__ + + /*#define QPOASES_NVMAX 50 + #define QPOASES_NCMAX 100*/ + #define QPOASES_NVMAX 287 + #define QPOASES_NCMAX 709 + +#endif /* __EXTERNAL_DIMENSIONS__ */ + + +/** Maximum number of variables within a QP formulation. + * Note: this value has to be positive! */ +#define NVMAX QPOASES_NVMAX + +/** Maximum number of constraints within a QP formulation. + * Note: this value has to be positive! */ +#define NCMAX QPOASES_NCMAX + +#if ( QPOASES_NVMAX > QPOASES_NCMAX ) +#define NVCMAX QPOASES_NVMAX +#else +#define NVCMAX QPOASES_NCMAX +#endif + +#if ( QPOASES_NVMAX > QPOASES_NCMAX ) +#define NVCMIN QPOASES_NCMAX +#else +#define NVCMIN QPOASES_NVMAX +#endif + + +/** Maximum number of QPs in a sequence solved by means of the OQP interface. + * Note: this value has to be positive! */ +#define NQPMAX 1000 + + +/** Numerical value of machine precision (min eps, s.t. 1+eps > 1). + * Note: this value has to be positive! */ +#ifndef __CODE_GENERATION__ + + #ifdef __USE_SINGLE_PRECISION__ + static const real_t QPOASES_EPS = 1.193e-07; + #else + static const real_t QPOASES_EPS = 2.221e-16; + #endif /* __USE_SINGLE_PRECISION__ */ + +#endif /* __CODE_GENERATION__ */ + + +/** Numerical value of zero (for situations in which it would be + * unreasonable to compare with 0.0). + * Note: this value has to be positive! */ +static const real_t QPOASES_ZERO = 1.0e-25; + +/** Numerical value of infinity (e.g. for non-existing bounds). + * Note: this value has to be positive! */ +static const real_t QPOASES_INFTY = 1.0e20; + +/** Tolerance to used for isEqual, isZero etc. + * Note: this value has to be positive! */ +static const real_t QPOASES_TOL = 1.0e-25; + + +/** Maximum number of characters within a string. + * Note: this value should be at least 41! */ +#define QPOASES_MAX_STRING_LENGTH 160 + + +END_NAMESPACE_QPOASES + + +#endif /* QPOASES_CONSTANTS_H */ + + +/* + * end of file + */ diff --git a/third_party/acados/include/qpOASES_e/ConstraintProduct.h b/third_party/acados/include/qpOASES_e/ConstraintProduct.h new file mode 100644 index 000000000..ddfcfbe5d --- /dev/null +++ b/third_party/acados/include/qpOASES_e/ConstraintProduct.h @@ -0,0 +1,62 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/ConstraintProduct.h + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches (thanks to D. Kwame Minde Kufoalor) + * \version 3.1embedded + * \date 2009-2015 + * + * Declaration of the ConstraintProduct interface which allows to specify a + * user-defined function for evaluating the constraint product at the + * current iterate to speed-up QP solution in case of a specially structured + * constraint matrix. + */ + + + +#ifndef QPOASES_CONSTRAINT_PRODUCT_H +#define QPOASES_CONSTRAINT_PRODUCT_H + + +BEGIN_NAMESPACE_QPOASES + + +/** + * \brief Interface for specifying user-defined evaluations of constraint products. + * + * An interface which allows to specify a user-defined function for evaluating the + * constraint product at the current iterate to speed-up QP solution in case + * of a specially structured constraint matrix. + * + * \author Hans Joachim Ferreau (thanks to Kwame Minde Kufoalor) + * \version 3.1embedded + * \date 2009-2015 + */ +typedef int(*ConstraintProduct)( int, const real_t* const, real_t* const ); + + +END_NAMESPACE_QPOASES + +#endif /* QPOASES_CONSTRAINT_PRODUCT_H */ diff --git a/third_party/acados/include/qpOASES_e/Constraints.h b/third_party/acados/include/qpOASES_e/Constraints.h new file mode 100644 index 000000000..8aca10d5d --- /dev/null +++ b/third_party/acados/include/qpOASES_e/Constraints.h @@ -0,0 +1,535 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/Constraints.h + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + * + * Declaration of the Constraints class designed to manage working sets of + * constraints within a QProblem. + */ + + +#ifndef QPOASES_CONSTRAINTS_H +#define QPOASES_CONSTRAINTS_H + + +#include + + +BEGIN_NAMESPACE_QPOASES + + +/** + * \brief Manages working sets of constraints. + * + * This class manages working sets of constraints by storing + * index sets and other status information. + * + * \author Hans Joachim Ferreau + * \version 3.1embedded + * \date 2007-2015 + */ +typedef struct +{ + Indexlist *active; /**< Index list of active constraints. */ + Indexlist *inactive; /**< Index list of inactive constraints. */ + + Indexlist *shiftedActive; /**< Memory for shifting active constraints. */ + Indexlist *shiftedInactive; /**< Memory for shifting inactive constraints. */ + + Indexlist *rotatedActive; /**< Memory for rotating active constraints. */ + Indexlist *rotatedInactive; /**< Memory for rotating inactive constraints. */ + + SubjectToType *type; /**< Type of constraints. */ + SubjectToStatus *status; /**< Status of constraints. */ + + SubjectToType *typeTmp; /**< Temp memory for type of constraints. */ + SubjectToStatus *statusTmp; /**< Temp memory for status of constraints. */ + + BooleanType noLower; /**< This flag indicates if there is no lower bound on any variable. */ + BooleanType noUpper; /**< This flag indicates if there is no upper bound on any variable. */ + + int n; /**< Total number of constraints. */ +} Constraints; + +int Constraints_calculateMemorySize( int n); + +char *Constraints_assignMemory(int n, Constraints **mem, void *raw_memory); + +Constraints *Constraints_createMemory( int n ); + +/** Constructor which takes the number of constraints. */ +void ConstraintsCON( Constraints* _THIS, + int _n /**< Number of constraints. */ + ); + +/** Copies all members from given rhs object. + * \return SUCCESSFUL_RETURN */ +void ConstraintsCPY( Constraints* FROM, + Constraints* TO + ); + + +/** Initialises object with given number of constraints. + * \return SUCCESSFUL_RETURN \n + RET_INVALID_ARGUMENTS */ +returnValue Constraints_init( Constraints* _THIS, + int _n /**< Number of constraints. */ + ); + + +/** Initially adds number of a new (i.e. not yet in the list) constraint to + * a given index set. + * \return SUCCESSFUL_RETURN \n + RET_SETUP_CONSTRAINT_FAILED \n + RET_INDEX_OUT_OF_BOUNDS \n + RET_INVALID_ARGUMENTS */ +returnValue Constraints_setupConstraint( Constraints* _THIS, + int number, /**< Number of new constraint. */ + SubjectToStatus _status /**< Status of new constraint. */ + ); + +/** Initially adds all enabled numbers of new (i.e. not yet in the list) constraints to + * to the index set of inactive constraints; the order depends on the SujectToType + * of each index. Only disabled constraints are added to index set of disabled constraints! + * \return SUCCESSFUL_RETURN \n + RET_SETUP_CONSTRAINT_FAILED */ +returnValue Constraints_setupAllInactive( Constraints* _THIS + ); + +/** Initially adds all enabled numbers of new (i.e. not yet in the list) constraints to + * to the index set of active constraints (on their lower bounds); the order depends on the SujectToType + * of each index. Only disabled constraints are added to index set of disabled constraints! + * \return SUCCESSFUL_RETURN \n + RET_SETUP_CONSTRAINT_FAILED */ +returnValue Constraints_setupAllLower( Constraints* _THIS + ); + +/** Initially adds all enabled numbers of new (i.e. not yet in the list) constraints to + * to the index set of active constraints (on their upper bounds); the order depends on the SujectToType + * of each index. Only disabled constraints are added to index set of disabled constraints! + * \return SUCCESSFUL_RETURN \n + RET_SETUP_CONSTRAINT_FAILED */ +returnValue Constraints_setupAllUpper( Constraints* _THIS + ); + + +/** Moves index of a constraint from index list of active to that of inactive constraints. + * \return SUCCESSFUL_RETURN \n + RET_MOVING_CONSTRAINT_FAILED */ +returnValue Constraints_moveActiveToInactive( Constraints* _THIS, + int number /**< Number of constraint to become inactive. */ + ); + +/** Moves index of a constraint from index list of inactive to that of active constraints. + * \return SUCCESSFUL_RETURN \n + RET_MOVING_CONSTRAINT_FAILED */ +returnValue Constraints_moveInactiveToActive( Constraints* _THIS, + int number, /**< Number of constraint to become active. */ + SubjectToStatus _status /**< Status of constraint to become active. */ + ); + +/** Flip fixed constraint. + * \return SUCCESSFUL_RETURN \n + RET_MOVING_CONSTRAINT_FAILED \n + RET_INDEX_OUT_OF_BOUNDS */ +returnValue Constraints_flipFixed( Constraints* _THIS, + int number + ); + + +/** Returns the number of constraints. + * \return Number of constraints. */ +static inline int Constraints_getNC( Constraints* _THIS + ); + +/** Returns the number of implicit equality constraints. + * \return Number of implicit equality constraints. */ +static inline int Constraints_getNEC( Constraints* _THIS + ); + +/** Returns the number of "real" inequality constraints. + * \return Number of "real" inequality constraints. */ +static inline int Constraints_getNIC( Constraints* _THIS + ); + +/** Returns the number of unbounded constraints (i.e. without any bounds). + * \return Number of unbounded constraints (i.e. without any bounds). */ +static inline int Constraints_getNUC( Constraints* _THIS + ); + +/** Returns the number of active constraints. + * \return Number of active constraints. */ +static inline int Constraints_getNAC( Constraints* _THIS + ); + +/** Returns the number of inactive constraints. + * \return Number of inactive constraints. */ +static inline int Constraints_getNIAC( Constraints* _THIS + ); + + +/** Returns a pointer to active constraints index list. + * \return Pointer to active constraints index list. */ +static inline Indexlist* Constraints_getActive( Constraints* _THIS + ); + +/** Returns a pointer to inactive constraints index list. + * \return Pointer to inactive constraints index list. */ +static inline Indexlist* Constraints_getInactive( Constraints* _THIS + ); + + +/** Returns number of constraints with given SubjectTo type. + * \return Number of constraints with given type. */ +static inline int Constraints_getNumberOfType( Constraints* _THIS, + SubjectToType _type /**< Type of constraints' bound. */ + ); + + +/** Returns type of constraints' bound. + * \return Type of constraints' bound \n + RET_INDEX_OUT_OF_BOUNDS */ +static inline SubjectToType Constraints_getType( Constraints* _THIS, + int i /**< Number of constraints' bound. */ + ); + +/** Returns status of constraints' bound. + * \return Status of constraints' bound \n + ST_UNDEFINED */ +static inline SubjectToStatus Constraints_getStatus( Constraints* _THIS, + int i /**< Number of constraints' bound. */ + ); + + +/** Sets type of constraints' bound. + * \return SUCCESSFUL_RETURN \n + RET_INDEX_OUT_OF_BOUNDS */ +static inline returnValue Constraints_setType( Constraints* _THIS, + int i, /**< Number of constraints' bound. */ + SubjectToType value /**< Type of constraints' bound. */ + ); + +/** Sets status of constraints' bound. + * \return SUCCESSFUL_RETURN \n + RET_INDEX_OUT_OF_BOUNDS */ +static inline returnValue Constraints_setStatus( Constraints* _THIS, + int i, /**< Number of constraints' bound. */ + SubjectToStatus value /**< Status of constraints' bound. */ + ); + + +/** Sets status of lower constraints' bounds. */ +static inline void Constraints_setNoLower( Constraints* _THIS, + BooleanType _status /**< Status of lower constraints' bounds. */ + ); + +/** Sets status of upper constraints' bounds. */ +static inline void Constraints_setNoUpper( Constraints* _THIS, + BooleanType _status /**< Status of upper constraints' bounds. */ + ); + + +/** Returns status of lower constraints' bounds. + * \return BT_TRUE if there is no lower constraints' bound on any variable. */ +static inline BooleanType Constraints_hasNoLower( Constraints* _THIS + ); + +/** Returns status of upper bounds. + * \return BT_TRUE if there is no upper constraints' bound on any variable. */ +static inline BooleanType Constraints_hasNoUpper( Constraints* _THIS + ); + + +/** Shifts forward type and status of all constraints by a given + * offset. This offset has to lie within the range [0,n/2] and has to + * be an integer divisor of the total number of constraints n. + * Type and status of the first \ constraints is thrown away, + * type and status of the last \ constraints is doubled, + * e.g. for offset = 2: \n + * shift( {c/b1,c/b2,c/b3,c/b4,c/b5,c/b6} ) = {c/b3,c/b4,c/b5,c/b6,c/b5,c/b6} + * \return SUCCESSFUL_RETURN \n + RET_INDEX_OUT_OF_BOUNDS \n + RET_INVALID_ARGUMENTS \n + RET_SHIFTING_FAILED */ +returnValue Constraints_shift( Constraints* _THIS, + int offset /**< Shift offset within the range [0,n/2] and integer divisor of n. */ + ); + +/** Rotates forward type and status of all constraints by a given + * offset. This offset has to lie within the range [0,n]. + * Example for offset = 2: \n + * rotate( {c1,c2,c3,c4,c5,c6} ) = {c3,c4,c5,c6,c1,c2} + * \return SUCCESSFUL_RETURN \n + RET_INDEX_OUT_OF_BOUNDS \n + RET_ROTATING_FAILED */ +returnValue Constraints_rotate( Constraints* _THIS, + int offset /**< Rotation offset within the range [0,n]. */ + ); + + +/** Prints information on constraints object + * (in particular, lists of inactive and active constraints. + * \return SUCCESSFUL_RETURN \n + RET_INDEXLIST_CORRUPTED */ +returnValue Constraints_print( Constraints* _THIS + ); + + +/** Initially adds all numbers of new (i.e. not yet in the list) bounds to + * to the index set corresponding to the desired status; + * the order depends on the SujectToType of each index. + * \return SUCCESSFUL_RETURN \n + RET_SETUP_CONSTRAINT_FAILED */ +returnValue Constraints_setupAll( Constraints* _THIS, + SubjectToStatus _status /**< Desired initial status for all bounds. */ + ); + + +/** Adds the index of a new constraint to index set. + * \return SUCCESSFUL_RETURN \n + RET_ADDINDEX_FAILED \n + RET_INVALID_ARGUMENTS */ +returnValue Constraints_addIndex( Constraints* _THIS, + Indexlist* const indexlist, /**< Index list to which the new index shall be added. */ + int newnumber, /**< Number of new constraint. */ + SubjectToStatus newstatus /**< Status of new constraint. */ + ); + +/** Removes the index of a constraint from index set. + * \return SUCCESSFUL_RETURN \n + RET_REMOVEINDEX_FAILED \n + RET_INVALID_ARGUMENTS */ +returnValue Constraints_removeIndex( Constraints* _THIS, + Indexlist* const indexlist, /**< Index list from which the new index shall be removed. */ + int removenumber /**< Number of constraint to be removed. */ + ); + +/** Swaps the indices of two constraints or bounds within the index set. + * \return SUCCESSFUL_RETURN \n + RET_SWAPINDEX_FAILED \n + RET_INVALID_ARGUMENTS */ +returnValue Constraints_swapIndex( Constraints* _THIS, + Indexlist* const indexlist, /**< Index list in which the indices shold be swapped. */ + int number1, /**< Number of first constraint. */ + int number2 /**< Number of second constraint. */ + ); + + + +/* + * g e t N u m b e r O f T y p e + */ +static inline int Constraints_getNumberOfType( Constraints* _THIS, SubjectToType _type ) +{ + int i; + int numberOfType = 0; + + if ( _THIS->type != 0 ) + { + for( i=0; i<_THIS->n; ++i ) + if ( _THIS->type[i] == _type ) + ++numberOfType; + } + + return numberOfType; +} + + +/* + * g e t T y p e + */ +static inline SubjectToType Constraints_getType( Constraints* _THIS, int i ) +{ + if ( ( i >= 0 ) && ( i < _THIS->n ) ) + return _THIS->type[i]; + + return ST_UNKNOWN; +} + + +/* + * g e t S t a t u s + */ +static inline SubjectToStatus Constraints_getStatus( Constraints* _THIS, int i ) +{ + if ( ( i >= 0 ) && ( i < _THIS->n ) ) + return _THIS->status[i]; + + return ST_UNDEFINED; +} + + +/* + * s e t T y p e + */ +static inline returnValue Constraints_setType( Constraints* _THIS, int i, SubjectToType value ) +{ + if ( ( i >= 0 ) && ( i < _THIS->n ) ) + { + _THIS->type[i] = value; + return SUCCESSFUL_RETURN; + } + else + return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); +} + + +/* + * s e t S t a t u s + */ +static inline returnValue Constraints_setStatus( Constraints* _THIS, int i, SubjectToStatus value ) +{ + if ( ( i >= 0 ) && ( i < _THIS->n ) ) + { + _THIS->status[i] = value; + return SUCCESSFUL_RETURN; + } + else + return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); +} + + +/* + * s e t N o L o w e r + */ +static inline void Constraints_setNoLower( Constraints* _THIS, BooleanType _status ) +{ + _THIS->noLower = _status; +} + + +/* + * s e t N o U p p e r + */ +static inline void Constraints_setNoUpper( Constraints* _THIS, BooleanType _status ) +{ + _THIS->noUpper = _status; +} + + +/* + * h a s N o L o w e r + */ +static inline BooleanType Constraints_hasNoLower( Constraints* _THIS ) +{ + return _THIS->noLower; +} + + +/* + * h a s N o U p p p e r + */ +static inline BooleanType Constraints_hasNoUpper( Constraints* _THIS ) +{ + return _THIS->noUpper; +} + + + +/* + * g e t N C + */ +static inline int Constraints_getNC( Constraints* _THIS ) +{ + return _THIS->n; +} + + +/* + * g e t N E C + */ +static inline int Constraints_getNEC( Constraints* _THIS ) +{ + return Constraints_getNumberOfType( _THIS,ST_EQUALITY ); +} + + +/* + * g e t N I C + */ +static inline int Constraints_getNIC( Constraints* _THIS ) +{ + return Constraints_getNumberOfType( _THIS,ST_BOUNDED ); +} + + +/* + * g e t N U C + */ +static inline int Constraints_getNUC( Constraints* _THIS ) +{ + return Constraints_getNumberOfType( _THIS,ST_UNBOUNDED ); +} + + +/* + * g e t N A C + */ +static inline int Constraints_getNAC( Constraints* _THIS ) +{ + return Indexlist_getLength( _THIS->active ); +} + + +/* + * g e t N I A C + */ +static inline int Constraints_getNIAC( Constraints* _THIS ) +{ + return Indexlist_getLength( _THIS->inactive ); +} + + + +/* + * g e t A c t i v e + */ +static inline Indexlist* Constraints_getActive( Constraints* _THIS ) +{ + return _THIS->active; +} + + +/* + * g e t I n a c t i v e + */ +static inline Indexlist* Constraints_getInactive( Constraints* _THIS ) +{ + return _THIS->inactive; +} + + +END_NAMESPACE_QPOASES + + +#endif /* QPOASES_CONSTRAINTS_H */ + + +/* + * end of file + */ diff --git a/third_party/acados/include/qpOASES_e/Flipper.h b/third_party/acados/include/qpOASES_e/Flipper.h new file mode 100644 index 000000000..63526a30f --- /dev/null +++ b/third_party/acados/include/qpOASES_e/Flipper.h @@ -0,0 +1,129 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/Flipper.h + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + * + * Declaration of the Options class designed to manage user-specified + * options for solving a QProblem. + */ + + +#ifndef QPOASES_FLIPPER_H +#define QPOASES_FLIPPER_H + + +#include +#include + + +BEGIN_NAMESPACE_QPOASES + + +/** + * \brief Auxiliary class for storing a copy of the current matrix factorisations. + * + * This auxiliary class stores a copy of the current matrix factorisations. It + * is used by the classe QProblemB and QProblem in case flipping bounds are enabled. + * + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + */ +typedef struct +{ + Bounds *bounds; /**< Data structure for problem's bounds. */ + Constraints *constraints; /**< Data structure for problem's constraints. */ + + real_t *R; /**< Cholesky factor of H (i.e. H = R^T*R). */ + real_t *Q; /**< Orthonormal quadratic matrix, A = [0 T]*Q'. */ + real_t *T; /**< Reverse triangular matrix, A = [0 T]*Q'. */ + + unsigned int nV; /**< Number of variables. */ + unsigned int nC; /**< Number of constraints. */ +} Flipper; + +int Flipper_calculateMemorySize( unsigned int nV, unsigned int nC ); + +char *Flipper_assignMemory( unsigned int nV, unsigned int nC, Flipper **mem, void *raw_memory ); + +Flipper *Flipper_createMemory( unsigned int nV, unsigned int nC ); + +/** Constructor which takes the number of bounds and constraints. */ +void FlipperCON( Flipper* _THIS, + unsigned int _nV, /**< Number of bounds. */ + unsigned int _nC /**< Number of constraints. */ + ); + +/** Copy constructor (deep copy). */ +void FlipperCPY( Flipper* FROM, + Flipper* TO + ); + +/** Initialises object with given number of bounds and constraints. + * \return SUCCESSFUL_RETURN \n + RET_INVALID_ARGUMENTS */ +returnValue Flipper_init( Flipper* _THIS, + unsigned int _nV, /**< Number of bounds. */ + unsigned int _nC /**< Number of constraints. */ + ); + + +/** Copies current values to non-null arguments (assumed to be allocated with consistent size). + * \return SUCCESSFUL_RETURN */ +returnValue Flipper_get( Flipper* _THIS, + Bounds* const _bounds, /**< Pointer to new bounds. */ + real_t* const R, /**< New matrix R. */ + Constraints* const _constraints, /**< Pointer to new constraints. */ + real_t* const _Q, /**< New matrix Q. */ + real_t* const _T /**< New matrix T. */ + ); + +/** Assigns new values to non-null arguments. + * \return SUCCESSFUL_RETURN */ +returnValue Flipper_set( Flipper* _THIS, + const Bounds* const _bounds, /**< Pointer to new bounds. */ + const real_t* const _R, /**< New matrix R. */ + const Constraints* const _constraints, /**< Pointer to new constraints. */ + const real_t* const _Q, /**< New matrix Q. */ + const real_t* const _T /**< New matrix T. */ + ); + +/** Returns dimension of matrix T. + * \return Dimension of matrix T. */ +unsigned int Flipper_getDimT( Flipper* _THIS ); + + +END_NAMESPACE_QPOASES + + +#endif /* QPOASES_FLIPPER_H */ + + +/* + * end of file + */ diff --git a/third_party/acados/include/qpOASES_e/Indexlist.h b/third_party/acados/include/qpOASES_e/Indexlist.h new file mode 100644 index 000000000..c3026a7ff --- /dev/null +++ b/third_party/acados/include/qpOASES_e/Indexlist.h @@ -0,0 +1,221 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/Indexlist.h + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + * + * Declaration of the Indexlist class designed to manage index lists of + * constraints and bounds within a SubjectTo object. + */ + + +#ifndef QPOASES_INDEXLIST_H +#define QPOASES_INDEXLIST_H + + +#include + + +BEGIN_NAMESPACE_QPOASES + + +/** + * \brief Stores and manages index lists. + * + * This class manages index lists of active/inactive bounds/constraints. + * + * \author Hans Joachim Ferreau + * \version 3.1embedded + * \date 2007-2015 + */ +typedef struct +{ + int *number; /**< Array to store numbers of constraints or bounds. */ + int *iSort; /**< Index list to sort vector \a number */ + + int length; /**< Length of index list. */ + int first; /**< Physical index of first element. */ + int last; /**< Physical index of last element. */ + int lastusedindex; /**< Physical index of last entry in index list. */ + int physicallength; /**< Physical length of index list. */ +} Indexlist; + +int Indexlist_calculateMemorySize( int n); + +char *Indexlist_assignMemory(int n, Indexlist **mem, void *raw_memory); + +Indexlist *Indexlist_createMemory( int n ); + +/** Constructor which takes the desired physical length of the index list. */ +void IndexlistCON( Indexlist* _THIS, + int n /**< Physical length of index list. */ + ); + +/** Copies all members from given rhs object. + * \return SUCCESSFUL_RETURN */ +void IndexlistCPY( Indexlist* FROM, + Indexlist* TO + ); + +/** Initialises index list of desired physical length. + * \return SUCCESSFUL_RETURN \n + RET_INVALID_ARGUMENTS */ +returnValue Indexlist_init( Indexlist* _THIS, + int n /**< Physical length of index list. */ + ); + +/** Creates an array of all numbers within the index set in correct order. + * \return SUCCESSFUL_RETURN \n + RET_INDEXLIST_CORRUPTED */ +returnValue Indexlist_getNumberArray( Indexlist* _THIS, + int** const numberarray /**< Output: Array of numbers (NULL on error). */ + ); + +/** Creates an array of all numbers within the index set in correct order. + * \return SUCCESSFUL_RETURN \n + RET_INDEXLIST_CORRUPTED */ +returnValue Indexlist_getISortArray( Indexlist* _THIS, + int** const iSortArray /**< Output: iSort Array. */ + ); + + +/** Determines the index within the index list at which a given number is stored. + * \return >= 0: Index of given number. \n + -1: Number not found. */ +int Indexlist_getIndex( Indexlist* _THIS, + int givennumber /**< Number whose index shall be determined. */ + ); + +/** Returns the number stored at a given physical index. + * \return >= 0: Number stored at given physical index. \n + -RET_INDEXLIST_OUTOFBOUNDS */ +static inline int Indexlist_getNumber( Indexlist* _THIS, + int physicalindex /**< Physical index of the number to be returned. */ + ); + + +/** Returns the current length of the index list. + * \return Current length of the index list. */ +static inline int Indexlist_getLength( Indexlist* _THIS + ); + +/** Returns last number within the index list. + * \return Last number within the index list. */ +static inline int Indexlist_getLastNumber( Indexlist* _THIS + ); + + +/** Adds number to index list. + * \return SUCCESSFUL_RETURN \n + RET_INDEXLIST_MUST_BE_REORDERD \n + RET_INDEXLIST_EXCEEDS_MAX_LENGTH */ +returnValue Indexlist_addNumber( Indexlist* _THIS, + int addnumber /**< Number to be added. */ + ); + +/** Removes number from index list. + * \return SUCCESSFUL_RETURN */ +returnValue Indexlist_removeNumber( Indexlist* _THIS, + int removenumber /**< Number to be removed. */ + ); + +/** Swaps two numbers within index list. + * \return SUCCESSFUL_RETURN */ +returnValue Indexlist_swapNumbers( Indexlist* _THIS, + int number1, /**< First number for swapping. */ + int number2 /**< Second number for swapping. */ + ); + +/** Determines if a given number is contained in the index set. + * \return BT_TRUE iff number is contain in the index set */ +static inline BooleanType Indexlist_isMember( Indexlist* _THIS, + int _number /**< Number to be tested for membership. */ + ); + + +/** Find first index j between -1 and length in sorted list of indices + * iSort such that numbers[iSort[j]] <= i < numbers[iSort[j+1]]. Uses + * bisection. + * \return j. */ +int Indexlist_findInsert( Indexlist* _THIS, + int i + ); + + + +/* + * g e t N u m b e r + */ +static inline int Indexlist_getNumber( Indexlist* _THIS, int physicalindex ) +{ + /* consistency check */ + if ( ( physicalindex < 0 ) || ( physicalindex > _THIS->length ) ) + return -RET_INDEXLIST_OUTOFBOUNDS; + + return _THIS->number[physicalindex]; +} + + +/* + * g e t L e n g t h + */ +static inline int Indexlist_getLength( Indexlist* _THIS ) +{ + return _THIS->length; +} + + +/* + * g e t L a s t N u m b e r + */ +static inline int Indexlist_getLastNumber( Indexlist* _THIS ) +{ + return _THIS->number[_THIS->length-1]; +} + + +/* + * g e t L a s t N u m b e r + */ +static inline BooleanType Indexlist_isMember( Indexlist* _THIS, int _number ) +{ + if ( Indexlist_getIndex( _THIS,_number ) >= 0 ) + return BT_TRUE; + else + return BT_FALSE; +} + + +END_NAMESPACE_QPOASES + + +#endif /* QPOASES_INDEXLIST_H */ + + +/* + * end of file + */ diff --git a/third_party/acados/include/qpOASES_e/Matrices.h b/third_party/acados/include/qpOASES_e/Matrices.h new file mode 100644 index 000000000..1d6da8c3c --- /dev/null +++ b/third_party/acados/include/qpOASES_e/Matrices.h @@ -0,0 +1,287 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/Matrices.h + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2009-2015 + * + * Various matrix classes: Abstract base matrix class, dense and sparse matrices, + * including symmetry exploiting specializations. + */ + + + +#ifndef QPOASES_MATRICES_H +#define QPOASES_MATRICES_H + +#ifdef __USE_SINGLE_PRECISION__ + + // single precision + #define GEMM sgemm_ + #define GEMV sgemv_ +// #define SYR ssyr_ +// #define SYR2 ssyr2_ + #define POTRF spotrf_ + +#else + + // double precision + #define GEMM dgemm_ + #define GEMV dgemv_ +// #define SYR dsyr_ +// #define SYR2 dsyr2_ + #define POTRF dpotrf_ + +#endif /* __USE_SINGLE_PRECISION__ */ + + +#ifdef EXTERNAL_BLAS + // double precision + void dgemm_(char *ta, char *tb, int *m, int *n, int *k, double *alpha, double *A, int *lda, double *B, int ldb, double *beta, double *C, int *ldc); + void dgemv_(char *ta, int *m, int *n, double *alpha, double *A, int *lda, double *x, int *incx, double *beta, double *y, int *incy); + void dpotrf_(char *uplo, int *m, double *A, int *lda, int *info); + // single precision + void sgemm_(char *ta, char *tb, int *m, int *n, int *k, float *alpha, float *A, int *lda, float *B, int ldb, float *beta, float *C, int *ldc); + void sgemv_(char *ta, int *m, int *n, float *alpha, float *A, int *lda, float *x, int *incx, float *beta, float *y, int *incy); + void spotrf_(char *uplo, int *m, float *A, int *lda, int *info); +#else + /** Performs one of the matrix-matrix operation in double precision. */ + void dgemm_ ( const char*, const char*, const unsigned long*, const unsigned long*, const unsigned long*, + const double*, const double*, const unsigned long*, const double*, const unsigned long*, + const double*, double*, const unsigned long* ); + /** Performs one of the matrix-matrix operation in single precision. */ + void sgemm_ ( const char*, const char*, const unsigned long*, const unsigned long*, const unsigned long*, + const float*, const float*, const unsigned long*, const float*, const unsigned long*, + const float*, float*, const unsigned long* ); + + /** Calculates the Cholesky factorization of a real symmetric positive definite matrix in double precision. */ + void dpotrf_ ( const char *, const unsigned long *, double *, const unsigned long *, long * ); + /** Calculates the Cholesky factorization of a real symmetric positive definite matrix in single precision. */ + void spotrf_ ( const char *, const unsigned long *, float *, const unsigned long *, long * ); + +#endif + + /** Performs a symmetric rank 1 operation in double precision. */ +// void dsyr_ ( const char *, const unsigned long *, const double *, const double *, +// const unsigned long *, double *, const unsigned long *); + /** Performs a symmetric rank 1 operation in single precision. */ +// void ssyr_ ( const char *, const unsigned long *, const float *, const float *, +// const unsigned long *, float *, const unsigned long *); + + /** Performs a symmetric rank 2 operation in double precision. */ +// void dsyr2_ ( const char *, const unsigned long *, const double *, const double *, +// const unsigned long *, const double *, const unsigned long *, double *, const unsigned long *); + /** Performs a symmetric rank 2 operation in single precision. */ +// void ssyr2_ ( const char *, const unsigned long *, const float *, const float *, +// const unsigned long *, const float *, const unsigned long *, float *, const unsigned long *); + + +#include + + +BEGIN_NAMESPACE_QPOASES + + +/** + * \brief Interfaces matrix-vector operations tailored to general dense matrices. + * + * Dense matrix class (row major format). + * + * \author Andreas Potschka, Christian Kirches, Hans Joachim Ferreau + * \version 3.1embedded + * \date 2011-2015 + */ +typedef struct +{ + real_t *val; /**< Vector of entries. */ + int nRows; /**< Number of rows. */ + int nCols; /**< Number of columns. */ + int leaDim; /**< Leading dimension. */ +} DenseMatrix; + +int DenseMatrix_calculateMemorySize( int m, int n ); + +char *DenseMatrix_assignMemory( int m, int n, DenseMatrix **mem, void *raw_memory ); + +DenseMatrix *DenseMatrix_createMemory( int m, int n ); + +/** Constructor from vector of values. + * Caution: Data pointer must be valid throughout lifetime + */ +void DenseMatrixCON( DenseMatrix* _THIS, + int m, /**< Number of rows. */ + int n, /**< Number of columns. */ + int lD, /**< Leading dimension. */ + real_t *v /**< Values. */ + ); + +void DenseMatrixCPY( DenseMatrix* FROM, + DenseMatrix* TO + ); + + +/** Frees all internal memory. */ +void DenseMatrix_free( DenseMatrix* _THIS ); + +/** Constructor from vector of values. + * Caution: Data pointer must be valid throughout lifetime + */ +returnValue DenseMatrix_init( DenseMatrix* _THIS, + int m, /**< Number of rows. */ + int n, /**< Number of columns. */ + int lD, /**< Leading dimension. */ + real_t *v /**< Values. */ + ); + + +/** Returns i-th diagonal entry. + * \return i-th diagonal entry */ +real_t DenseMatrix_diag( DenseMatrix* _THIS, + int i /**< Index. */ + ); + +/** Checks whether matrix is square and diagonal. + * \return BT_TRUE iff matrix is square and diagonal; \n + * BT_FALSE otherwise. */ +BooleanType DenseMatrix_isDiag( DenseMatrix* _THIS ); + +/** Get the N-norm of the matrix + * \return N-norm of the matrix + */ +real_t DenseMatrix_getNorm( DenseMatrix* _THIS, + int type /**< Norm type, 1: one-norm, 2: Euclidean norm. */ + ); + +/** Get the N-norm of a row + * \return N-norm of row \a rNum + */ +real_t DenseMatrix_getRowNorm( DenseMatrix* _THIS, + int rNum, /**< Row number. */ + int type /**< Norm type, 1: one-norm, 2: Euclidean norm. */ + ); + +/** Retrieve indexed entries of matrix row multiplied by alpha. + * \return SUCCESSFUL_RETURN */ +returnValue DenseMatrix_getRow( DenseMatrix* _THIS, + int rNum, /**< Row number. */ + const Indexlist* const icols, /**< Index list specifying columns. */ + real_t alpha, /**< Scalar factor. */ + real_t *row /**< Output row vector. */ + ); + +/** Retrieve indexed entries of matrix column multiplied by alpha. + * \return SUCCESSFUL_RETURN */ + returnValue DenseMatrix_getCol( DenseMatrix* _THIS, + int cNum, /**< Column number. */ + const Indexlist* const irows, /**< Index list specifying rows. */ + real_t alpha, /**< Scalar factor. */ + real_t *col /**< Output column vector. */ + ); + +/** Evaluate Y=alpha*A*X + beta*Y. + * \return SUCCESSFUL_RETURN. */ +returnValue DenseMatrix_times( DenseMatrix* _THIS, + int xN, /**< Number of vectors to multiply. */ + real_t alpha, /**< Scalar factor for matrix vector product. */ + const real_t *x, /**< Input vector to be multiplied. */ + int xLD, /**< Leading dimension of input x. */ + real_t beta, /**< Scalar factor for y. */ + real_t *y, /**< Output vector of results. */ + int yLD /**< Leading dimension of output y. */ + ); + +/** Evaluate Y=alpha*A'*X + beta*Y. + * \return SUCCESSFUL_RETURN. */ +returnValue DenseMatrix_transTimes( DenseMatrix* _THIS, + int xN, /**< Number of vectors to multiply. */ + real_t alpha, /**< Scalar factor for matrix vector product. */ + const real_t *x, /**< Input vector to be multiplied. */ + int xLD, /**< Leading dimension of input x. */ + real_t beta, /**< Scalar factor for y. */ + real_t *y, /**< Output vector of results. */ + int yLD /**< Leading dimension of output y. */ + ); + +/** Evaluate matrix vector product with submatrix given by Indexlist. + * \return SUCCESSFUL_RETURN */ + returnValue DenseMatrix_subTimes( DenseMatrix* _THIS, + const Indexlist* const irows, /**< Index list specifying rows. */ + const Indexlist* const icols, /**< Index list specifying columns. */ + int xN, /**< Number of vectors to multiply. */ + real_t alpha, /**< Scalar factor for matrix vector product. */ + const real_t *x, /**< Input vector to be multiplied. */ + int xLD, /**< Leading dimension of input x. */ + real_t beta, /**< Scalar factor for y. */ + real_t *y, /**< Output vector of results. */ + int yLD, /**< Leading dimension of output y. */ + BooleanType yCompr /**< Compressed storage for y. */ + ); + +/** Evaluate matrix transpose vector product. + * \return SUCCESSFUL_RETURN */ +returnValue DenseMatrix_subTransTimes( DenseMatrix* _THIS, + const Indexlist* const irows, /**< Index list specifying rows. */ + const Indexlist* const icols, /**< Index list specifying columns. */ + int xN, /**< Number of vectors to multiply. */ + real_t alpha, /**< Scalar factor for matrix vector product. */ + const real_t *x, /**< Input vector to be multiplied. */ + int xLD, /**< Leading dimension of input x. */ + real_t beta, /**< Scalar factor for y. */ + real_t *y, /**< Output vector of results. */ + int yLD /**< Leading dimension of output y. */ + ); + +/** Adds given offset to diagonal of matrix. + * \return SUCCESSFUL_RETURN \n + RET_NO_DIAGONAL_AVAILABLE */ +returnValue DenseMatrix_addToDiag( DenseMatrix* _THIS, + real_t alpha /**< Diagonal offset. */ + ); + +/** Prints matrix to screen. + * \return SUCCESSFUL_RETURN */ +returnValue DenseMatrix_print( DenseMatrix* _THIS + ); + +static inline real_t* DenseMatrix_getVal( DenseMatrix* _THIS ) { return _THIS->val; } + +/** Compute bilinear form y = x'*H*x using submatrix given by index list. + * \return SUCCESSFUL_RETURN */ +returnValue DenseMatrix_bilinear( DenseMatrix* _THIS, + const Indexlist* const icols, /**< Index list specifying columns of x. */ + int xN, /**< Number of vectors to multiply. */ + const real_t *x, /**< Input vector to be multiplied (uncompressed). */ + int xLD, /**< Leading dimension of input x. */ + real_t *y, /**< Output vector of results (compressed). */ + int yLD /**< Leading dimension of output y. */ + ); + + + +END_NAMESPACE_QPOASES + + +#endif /* QPOASES_MATRICES_H */ diff --git a/third_party/acados/include/qpOASES_e/MessageHandling.h b/third_party/acados/include/qpOASES_e/MessageHandling.h new file mode 100644 index 000000000..fe5524948 --- /dev/null +++ b/third_party/acados/include/qpOASES_e/MessageHandling.h @@ -0,0 +1,544 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/MessageHandling.h + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches (thanks to Leonard Wirsching) + * \version 3.1embedded + * \date 2007-2015 + * + * Declaration of the MessageHandling class including global return values. + */ + + +#ifndef QPOASES_MESSAGEHANDLING_H +#define QPOASES_MESSAGEHANDLING_H + + +#include +#include +#include +#include + +#include + + +BEGIN_NAMESPACE_QPOASES + + +/** Default file to display messages. */ +#define stdFile stderr + + +/** + * \brief Defines all symbols for global return values. + * + * The enumeration returnValueType defines all symbols for global return values. + * Important: All return values are assumed to be nonnegative! + * + * \author Hans Joachim Ferreau + */ +typedef enum +{ +TERMINAL_LIST_ELEMENT = -1, /**< Terminal list element, internal usage only! */ +/* miscellaneous */ +SUCCESSFUL_RETURN = 0, /**< Successful return. */ +RET_DIV_BY_ZERO, /**< Division by zero. */ +RET_INDEX_OUT_OF_BOUNDS, /**< Index out of bounds. */ +RET_INVALID_ARGUMENTS, /**< At least one of the arguments is invalid. */ +RET_ERROR_UNDEFINED, /**< Error number undefined. */ +RET_WARNING_UNDEFINED, /**< Warning number undefined. */ +RET_INFO_UNDEFINED, /**< Info number undefined. */ +RET_EWI_UNDEFINED, /**< Error/warning/info number undefined. */ +RET_AVAILABLE_WITH_LINUX_ONLY, /**< This function is available under Linux only. */ +RET_UNKNOWN_BUG, /**< The error occurred is not yet known. */ +RET_PRINTLEVEL_CHANGED, /**< Print level changed. (10) */ +RET_NOT_YET_IMPLEMENTED, /**< Requested function is not yet implemented in this version of qpOASES. */ +/* Indexlist */ +RET_INDEXLIST_MUST_BE_REORDERD, /**< Index list has to be reordered. */ +RET_INDEXLIST_EXCEEDS_MAX_LENGTH, /**< Index list exceeds its maximal physical length. */ +RET_INDEXLIST_CORRUPTED, /**< Index list corrupted. */ +RET_INDEXLIST_OUTOFBOUNDS, /**< Physical index is out of bounds. */ +RET_INDEXLIST_ADD_FAILED, /**< Adding indices from another index set failed. */ +RET_INDEXLIST_INTERSECT_FAILED, /**< Intersection with another index set failed. */ +/* SubjectTo / Bounds / Constraints */ +RET_INDEX_ALREADY_OF_DESIRED_STATUS, /**< Index is already of desired status. (18) */ +RET_ADDINDEX_FAILED, /**< Adding index to index set failed. */ +RET_REMOVEINDEX_FAILED, /**< Removing index from index set failed. (20) */ +RET_SWAPINDEX_FAILED, /**< Cannot swap between different indexsets. */ +RET_NOTHING_TO_DO, /**< Nothing to do. */ +RET_SETUP_BOUND_FAILED, /**< Setting up bound index failed. */ +RET_SETUP_CONSTRAINT_FAILED, /**< Setting up constraint index failed. */ +RET_MOVING_BOUND_FAILED, /**< Moving bound between index sets failed. */ +RET_MOVING_CONSTRAINT_FAILED, /**< Moving constraint between index sets failed. */ +RET_SHIFTING_FAILED, /**< Shifting of bounds/constraints failed. */ +RET_ROTATING_FAILED, /**< Rotating of bounds/constraints failed. */ +/* QProblem */ +RET_QPOBJECT_NOT_SETUP, /**< The QP object has not been setup correctly, use another constructor. */ +RET_QP_ALREADY_INITIALISED, /**< QProblem has already been initialised. (30) */ +RET_NO_INIT_WITH_STANDARD_SOLVER, /**< Initialisation via extern QP solver is not yet implemented. */ +RET_RESET_FAILED, /**< Reset failed. */ +RET_INIT_FAILED, /**< Initialisation failed. */ +RET_INIT_FAILED_TQ, /**< Initialisation failed due to TQ factorisation. */ +RET_INIT_FAILED_CHOLESKY, /**< Initialisation failed due to Cholesky decomposition. */ +RET_INIT_FAILED_HOTSTART, /**< Initialisation failed! QP could not be solved! */ +RET_INIT_FAILED_INFEASIBILITY, /**< Initial QP could not be solved due to infeasibility! */ +RET_INIT_FAILED_UNBOUNDEDNESS, /**< Initial QP could not be solved due to unboundedness! */ +RET_INIT_FAILED_REGULARISATION, /**< Initialisation failed as Hessian matrix could not be regularised. */ +RET_INIT_SUCCESSFUL, /**< Initialisation done. (40) */ +RET_OBTAINING_WORKINGSET_FAILED, /**< Failed to obtain working set for auxiliary QP. */ +RET_SETUP_WORKINGSET_FAILED, /**< Failed to setup working set for auxiliary QP. */ +RET_SETUP_AUXILIARYQP_FAILED, /**< Failed to setup auxiliary QP for initialised homotopy. */ +RET_NO_CHOLESKY_WITH_INITIAL_GUESS, /**< Externally computed Cholesky factor cannot be combined with an initial guess. */ +RET_NO_EXTERN_SOLVER, /**< No extern QP solver available. */ +RET_QP_UNBOUNDED, /**< QP is unbounded. */ +RET_QP_INFEASIBLE, /**< QP is infeasible. */ +RET_QP_NOT_SOLVED, /**< Problems occurred while solving QP with standard solver. */ +RET_QP_SOLVED, /**< QP successfully solved. */ +RET_UNABLE_TO_SOLVE_QP, /**< Problems occurred while solving QP. (50) */ +RET_INITIALISATION_STARTED, /**< Starting problem initialisation... */ +RET_HOTSTART_FAILED, /**< Unable to perform homotopy due to internal error. */ +RET_HOTSTART_FAILED_TO_INIT, /**< Unable to initialise problem. */ +RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED, /**< Unable to perform homotopy as previous QP is not solved. */ +RET_ITERATION_STARTED, /**< Iteration... */ +RET_SHIFT_DETERMINATION_FAILED, /**< Determination of shift of the QP data failed. */ +RET_STEPDIRECTION_DETERMINATION_FAILED, /**< Determination of step direction failed. */ +RET_STEPLENGTH_DETERMINATION_FAILED, /**< Determination of step direction failed. */ +RET_OPTIMAL_SOLUTION_FOUND, /**< Optimal solution of neighbouring QP found. */ +RET_HOMOTOPY_STEP_FAILED, /**< Unable to perform homotopy step. (60) */ +RET_HOTSTART_STOPPED_INFEASIBILITY, /**< Premature homotopy termination because QP is infeasible. */ +RET_HOTSTART_STOPPED_UNBOUNDEDNESS, /**< Premature homotopy termination because QP is unbounded. */ +RET_WORKINGSET_UPDATE_FAILED, /**< Unable to update working sets according to initial guesses. */ +RET_MAX_NWSR_REACHED, /**< Maximum number of working set recalculations performed. */ +RET_CONSTRAINTS_NOT_SPECIFIED, /**< Problem does comprise constraints! You also have to specify new constraints' bounds. */ +RET_INVALID_FACTORISATION_FLAG, /**< Invalid factorisation flag. */ +RET_UNABLE_TO_SAVE_QPDATA, /**< Unable to save QP data. */ +RET_STEPDIRECTION_FAILED_TQ, /**< Abnormal termination due to TQ factorisation. */ +RET_STEPDIRECTION_FAILED_CHOLESKY, /**< Abnormal termination due to Cholesky factorisation. */ +RET_CYCLING_DETECTED, /**< Cycling detected. (70) */ +RET_CYCLING_NOT_RESOLVED, /**< Cycling cannot be resolved, QP probably infeasible. */ +RET_CYCLING_RESOLVED, /**< Cycling probably resolved. */ +RET_STEPSIZE, /**< For displaying performed stepsize. */ +RET_STEPSIZE_NONPOSITIVE, /**< For displaying non-positive stepsize. */ +RET_SETUPSUBJECTTOTYPE_FAILED, /**< Setup of SubjectToTypes failed. */ +RET_ADDCONSTRAINT_FAILED, /**< Addition of constraint to working set failed. */ +RET_ADDCONSTRAINT_FAILED_INFEASIBILITY, /**< Addition of constraint to working set failed (due to QP infeasibility). */ +RET_ADDBOUND_FAILED, /**< Addition of bound to working set failed. */ +RET_ADDBOUND_FAILED_INFEASIBILITY, /**< Addition of bound to working set failed (due to QP infeasibility). */ +RET_REMOVECONSTRAINT_FAILED, /**< Removal of constraint from working set failed. (80) */ +RET_REMOVEBOUND_FAILED, /**< Removal of bound from working set failed. */ +RET_REMOVE_FROM_ACTIVESET, /**< Removing from active set... */ +RET_ADD_TO_ACTIVESET, /**< Adding to active set... */ +RET_REMOVE_FROM_ACTIVESET_FAILED, /**< Removing from active set failed. */ +RET_ADD_TO_ACTIVESET_FAILED, /**< Adding to active set failed. */ +RET_CONSTRAINT_ALREADY_ACTIVE, /**< Constraint is already active. */ +RET_ALL_CONSTRAINTS_ACTIVE, /**< All constraints are active, no further constraint can be added. */ +RET_LINEARLY_DEPENDENT, /**< New bound/constraint is linearly dependent. */ +RET_LINEARLY_INDEPENDENT, /**< New bound/constraint is linearly independent. */ +RET_LI_RESOLVED, /**< Linear independence of active constraint matrix successfully resolved. (90) */ +RET_ENSURELI_FAILED, /**< Failed to ensure linear independence of active constraint matrix. */ +RET_ENSURELI_FAILED_TQ, /**< Abnormal termination due to TQ factorisation. */ +RET_ENSURELI_FAILED_NOINDEX, /**< QP is infeasible. */ +RET_ENSURELI_FAILED_CYCLING, /**< QP is infeasible. */ +RET_BOUND_ALREADY_ACTIVE, /**< Bound is already active. */ +RET_ALL_BOUNDS_ACTIVE, /**< All bounds are active, no further bound can be added. */ +RET_CONSTRAINT_NOT_ACTIVE, /**< Constraint is not active. */ +RET_BOUND_NOT_ACTIVE, /**< Bound is not active. */ +RET_HESSIAN_NOT_SPD, /**< Projected Hessian matrix not positive definite. */ +RET_HESSIAN_INDEFINITE, /**< Hessian matrix is indefinite. (100) */ +RET_MATRIX_SHIFT_FAILED, /**< Unable to update matrices or to transform vectors. */ +RET_MATRIX_FACTORISATION_FAILED, /**< Unable to calculate new matrix factorisations. */ +RET_PRINT_ITERATION_FAILED, /**< Unable to print information on current iteration. */ +RET_NO_GLOBAL_MESSAGE_OUTPUTFILE, /**< No global message output file initialised. */ +RET_DISABLECONSTRAINTS_FAILED, /**< Unable to disbable constraints. */ +RET_ENABLECONSTRAINTS_FAILED, /**< Unable to enbable constraints. */ +RET_ALREADY_ENABLED, /**< Bound or constraint is already enabled. */ +RET_ALREADY_DISABLED, /**< Bound or constraint is already disabled. */ +RET_NO_HESSIAN_SPECIFIED, /**< No Hessian matrix has been specified. */ +RET_USING_REGULARISATION, /**< Using regularisation as Hessian matrix is not positive definite. (110) */ +RET_EPS_MUST_BE_POSITVE, /**< Eps for regularisation must be sufficiently positive. */ +RET_REGSTEPS_MUST_BE_POSITVE, /**< Maximum number of regularisation steps must be non-negative. */ +RET_HESSIAN_ALREADY_REGULARISED, /**< Hessian has been already regularised. */ +RET_CANNOT_REGULARISE_IDENTITY, /**< Identity Hessian matrix cannot be regularised. */ +RET_CANNOT_REGULARISE_SPARSE, /**< Sparse matrix cannot be regularised as diagonal entry is missing. */ +RET_NO_REGSTEP_NWSR, /**< No additional regularisation step could be performed due to limits. */ +RET_FEWER_REGSTEPS_NWSR, /**< Fewer additional regularisation steps have been performed due to limits. */ +RET_CHOLESKY_OF_ZERO_HESSIAN, /**< Cholesky decomposition of (unregularised) zero Hessian matrix. */ +RET_ZERO_HESSIAN_ASSUMED, /**< Zero Hessian matrix assumed as null pointer passed without specifying hessianType. */ +RET_CONSTRAINTS_ARE_NOT_SCALED, /**< (no longer in use) (120) */ +RET_INITIAL_BOUNDS_STATUS_NYI, /**< (no longer in use) */ +RET_ERROR_IN_CONSTRAINTPRODUCT, /**< Error in user-defined constraint product function. */ +RET_FIX_BOUNDS_FOR_LP, /**< All initial bounds must be fixed when solving an (unregularised) LP. */ +RET_USE_REGULARISATION_FOR_LP, /**< Set options.enableRegularisation=BT_TRUE for solving LPs. */ +/* SQProblem */ +RET_UPDATEMATRICES_FAILED, /**< Unable to update QP matrices. */ +RET_UPDATEMATRICES_FAILED_AS_QP_NOT_SOLVED, /**< Unable to update matrices as previous QP is not solved. */ +/* Utils */ +RET_UNABLE_TO_OPEN_FILE, /**< Unable to open file. */ +RET_UNABLE_TO_WRITE_FILE, /**< Unable to write into file. */ +RET_UNABLE_TO_READ_FILE, /**< Unable to read from file. */ +RET_FILEDATA_INCONSISTENT, /**< File contains inconsistent data. (130) */ +/* Options */ +RET_OPTIONS_ADJUSTED, /**< Options needed to be adjusted for consistency reasons. */ +/* SolutionAnalysis */ +RET_UNABLE_TO_ANALYSE_QPROBLEM, /**< Unable to analyse (S)QProblem(B) object. */ +/* Benchmark */ +RET_NWSR_SET_TO_ONE, /**< Maximum number of working set changes was set to 1. */ +RET_UNABLE_TO_READ_BENCHMARK, /**< Unable to read benchmark data. */ +RET_BENCHMARK_ABORTED, /**< Benchmark aborted. */ +RET_INITIAL_QP_SOLVED, /**< Initial QP solved. */ +RET_QP_SOLUTION_STARTED, /**< Solving QP... */ +RET_BENCHMARK_SUCCESSFUL, /**< Benchmark terminated successfully. */ +/* Sparse matrices */ +RET_NO_DIAGONAL_AVAILABLE, /**< Sparse matrix does not have entries on full diagonal. */ +RET_DIAGONAL_NOT_INITIALISED, /**< Diagonal data of sparse matrix has not been initialised. (140) */ +/* Dropping of infeasible constraints */ +RET_ENSURELI_DROPPED, /**< Linear independence resolved by dropping blocking constraint. */ +/* Simple exitflags */ +RET_SIMPLE_STATUS_P1, /**< QP problem could not be solved within given number of iterations. */ +RET_SIMPLE_STATUS_P0, /**< QP problem solved. */ +RET_SIMPLE_STATUS_M1, /**< QP problem could not be solved due to an internal error. */ +RET_SIMPLE_STATUS_M2, /**< QP problem is infeasible (and thus could not be solved). */ +RET_SIMPLE_STATUS_M3 /**< QP problem is unbounded (and thus could not be solved). (146) */ +} returnValue; + + +/** + * \brief Data structure for entries in global message list. + * + * Data structure for entries in global message list. + * + * \author Hans Joachim Ferreau + * \version 3.1embedded + * \date 2007-2015 + */ +typedef struct +{ + returnValue key; /**< Global return value. */ + const char* data; /**< Corresponding message. */ + VisibilityStatus globalVisibilityStatus; /**< Determines if message can be printed. + * If this value is set to VS_HIDDEN, no message is printed! */ +} ReturnValueList; + + + +/** + * \brief Handles all kind of error messages, warnings and other information. + * + * This class handles all kinds of messages (errors, warnings, infos) initiated + * by qpOASES modules and stores the corresponding global preferences. + * + * \author Hans Joachim Ferreau (thanks to Leonard Wirsching) + * \version 3.1embedded + * \date 2007-2015 + */ +typedef struct +{ + VisibilityStatus errorVisibility; /**< Error messages visible? */ + VisibilityStatus warningVisibility; /**< Warning messages visible? */ + VisibilityStatus infoVisibility; /**< Info messages visible? */ + + FILE* outputFile; /**< Output file for messages. */ + + int errorCount; /**< Counts number of errors (for nicer output only). */ +} MessageHandling; + + + +/** Constructor which takes the desired output file and desired visibility states. */ +void MessageHandlingCON( MessageHandling* _THIS, + FILE* _outputFile, /**< Output file. */ + VisibilityStatus _errorVisibility, /**< Visibility status for error messages. */ + VisibilityStatus _warningVisibility,/**< Visibility status for warning messages. */ + VisibilityStatus _infoVisibility /**< Visibility status for info messages. */ + ); + +void MessageHandlingCPY( MessageHandling* FROM, + MessageHandling* TO + ); + + +/** Prints an error message(a simplified macro THROWERROR is also provided). \n + * Errors are definied as abnormal events which cause an immediate termination of the current (sub) function. + * Errors of a sub function should be commented by the calling function by means of a warning message + * (if this error does not cause an error of the calling function, either)! + * \return Error number returned by sub function call + */ +returnValue MessageHandling_throwError( MessageHandling* _THIS, + returnValue Enumber, /**< Error number returned by sub function call. */ + const char* additionaltext, /**< Additional error text (0, if none). */ + const char* functionname, /**< Name of function which caused the error. */ + const char* filename, /**< Name of file which caused the error. */ + const unsigned long linenumber, /**< Number of line which caused the error.incompatible binary file */ + VisibilityStatus localVisibilityStatus /**< Determines (locally) if error message can be printed to stderr. + * If GLOBAL visibility status of the message is set to VS_HIDDEN, + * no message is printed, anyway! */ + ); + +/** Prints a warning message (a simplified macro THROWWARNING is also provided). + * Warnings are definied as abnormal events which does NOT cause an immediate termination of the current (sub) function. + * \return Warning number returned by sub function call + */ +returnValue MessageHandling_throwWarning( MessageHandling* _THIS, + returnValue Wnumber, /**< Warning number returned by sub function call. */ + const char* additionaltext, /**< Additional warning text (0, if none). */ + const char* functionname, /**< Name of function which caused the warning. */ + const char* filename, /**< Name of file which caused the warning. */ + const unsigned long linenumber, /**< Number of line which caused the warning. */ + VisibilityStatus localVisibilityStatus /**< Determines (locally) if warning message can be printed to stderr. + * If GLOBAL visibility status of the message is set to VS_HIDDEN, + * no message is printed, anyway! */ + ); + +/** Prints a info message (a simplified macro THROWINFO is also provided). + * \return Info number returned by sub function call + */ +returnValue MessageHandling_throwInfo( MessageHandling* _THIS, + returnValue Inumber, /**< Info number returned by sub function call. */ + const char* additionaltext, /**< Additional warning text (0, if none). */ + const char* functionname, /**< Name of function which submitted the info. */ + const char* filename, /**< Name of file which submitted the info. */ + const unsigned long linenumber, /**< Number of line which submitted the info. */ + VisibilityStatus localVisibilityStatus /**< Determines (locally) if info message can be printed to stderr. + * If GLOBAL visibility status of the message is set to VS_HIDDEN, + * no message is printed, anyway! */ + ); + + +/** Resets all preferences to default values. + * \return SUCCESSFUL_RETURN */ +returnValue MessageHandling_reset( MessageHandling* _THIS ); + + +/** Prints a complete list of all messages to output file. + * \return SUCCESSFUL_RETURN */ +returnValue MessageHandling_listAllMessages( MessageHandling* _THIS ); + + +/** Returns visibility status for error messages. + * \return Visibility status for error messages. */ +static inline VisibilityStatus MessageHandling_getErrorVisibilityStatus( MessageHandling* _THIS ); + +/** Returns visibility status for warning messages. + * \return Visibility status for warning messages. */ +static inline VisibilityStatus MessageHandling_getWarningVisibilityStatus( MessageHandling* _THIS ); + +/** Returns visibility status for info messages. + * \return Visibility status for info messages. */ +static inline VisibilityStatus MessageHandling_getInfoVisibilityStatus( MessageHandling* _THIS ); + +/** Returns pointer to output file. + * \return Pointer to output file. */ +static inline FILE* MessageHandling_getOutputFile( MessageHandling* _THIS ); + +/** Returns error count value. + * \return Error count value. */ +static inline int MessageHandling_getErrorCount( MessageHandling* _THIS ); + + +/** Changes visibility status for error messages. */ +static inline void MessageHandling_setErrorVisibilityStatus( MessageHandling* _THIS, + VisibilityStatus _errorVisibility /**< New visibility status for error messages. */ + ); + +/** Changes visibility status for warning messages. */ +static inline void MessageHandling_setWarningVisibilityStatus( MessageHandling* _THIS, + VisibilityStatus _warningVisibility /**< New visibility status for warning messages. */ + ); + +/** Changes visibility status for info messages. */ +static inline void MessageHandling_setInfoVisibilityStatus( MessageHandling* _THIS, + VisibilityStatus _infoVisibility /**< New visibility status for info messages. */ + ); + +/** Changes output file for messages. */ +static inline void MessageHandling_setOutputFile( MessageHandling* _THIS, + FILE* _outputFile /**< New output file for messages. */ + ); + +/** Changes error count. + * \return SUCCESSFUL_RETURN \n + * RET_INVALID_ARGUMENT */ +static inline returnValue MessageHandling_setErrorCount( MessageHandling* _THIS, + int _errorCount /**< New error count value. */ + ); + +/** Provides message text corresponding to given \a returnValue. + * \return String containing message text. */ +const char* MessageHandling_getErrorCodeMessage( MessageHandling* _THIS, + const returnValue _returnValue + ); + + +returnValue MessageHandling_throwMessage( MessageHandling* _THIS, + returnValue RETnumber, /**< Error/warning/info number returned by sub function call. */ + const char* additionaltext, /**< Additional warning text (0, if none). */ + const char* functionname, /**< Name of function which caused the error/warning/info. */ + const char* filename, /**< Name of file which caused the error/warning/info. */ + const unsigned long linenumber, /**< Number of line which caused the error/warning/info. */ + VisibilityStatus localVisibilityStatus, /**< Determines (locally) if info message can be printed to stderr. + * If GLOBAL visibility status of the message is set to VS_HIDDEN, + * no message is printed, anyway! */ + const char* RETstring /**< Leading string of error/warning/info message. */ + ); + + +#ifndef __FILE__ + /** Ensures that __FILE__ macro is defined. */ + #define __FILE__ 0 +#endif + +#ifndef __LINE__ + /** Ensures that __LINE__ macro is defined. */ + #define __LINE__ 0 +#endif + +/** Define __FUNC__ macro providing current function for debugging. */ +/*#define __FUNC__ 0*/ +#define __FUNC__ ("(no function name provided)") +/*#define __FUNC__ __func__*/ +/*#define __FUNC__ __FUNCTION__*/ + + +/** Short version of throwError with default values, only returnValue is needed */ +#define THROWERROR(retval) ( MessageHandling_throwError( qpOASES_getGlobalMessageHandler(),(retval),0,__FUNC__,__FILE__,__LINE__,VS_VISIBLE) ) + +/** Short version of throwWarning with default values, only returnValue is needed */ +#define THROWWARNING(retval) ( MessageHandling_throwWarning( qpOASES_getGlobalMessageHandler(),(retval),0,__FUNC__,__FILE__,__LINE__,VS_VISIBLE) ) + +/** Short version of throwInfo with default values, only returnValue is needed */ +#define THROWINFO(retval) ( MessageHandling_throwInfo( qpOASES_getGlobalMessageHandler(),(retval),0,__FUNC__,__FILE__,__LINE__,VS_VISIBLE) ) + + +/** Returns a pointer to global message handler. + * \return Pointer to global message handler. + */ +MessageHandling* qpOASES_getGlobalMessageHandler( ); + + +/* + * g e t E r r o r V i s i b i l i t y S t a t u s + */ +static inline VisibilityStatus MessageHandling_getErrorVisibilityStatus( MessageHandling* _THIS ) +{ + return _THIS->errorVisibility; +} + + +/* + * g e t W a r n i n g V i s i b i l i t y S t a t u s + */ +static inline VisibilityStatus MessageHandling_getWarningVisibilityStatus( MessageHandling* _THIS ) +{ + return _THIS->warningVisibility; +} + + +/* + * g e t I n f o V i s i b i l i t y S t a t u s + */ +static inline VisibilityStatus MessageHandling_getInfoVisibilityStatus( MessageHandling* _THIS ) +{ + return _THIS->infoVisibility; +} + + +/* + * g e t O u t p u t F i l e + */ +static inline FILE* MessageHandling_getOutputFile( MessageHandling* _THIS ) +{ + return _THIS->outputFile; +} + + +/* + * g e t E r r o r C o u n t + */ +static inline int MessageHandling_getErrorCount( MessageHandling* _THIS ) +{ + return _THIS->errorCount; +} + + +/* + * s e t E r r o r V i s i b i l i t y S t a t u s + */ +static inline void MessageHandling_setErrorVisibilityStatus( MessageHandling* _THIS, VisibilityStatus _errorVisibility ) +{ + _THIS->errorVisibility = _errorVisibility; +} + + +/* + * s e t W a r n i n g V i s i b i l i t y S t a t u s + */ +static inline void MessageHandling_setWarningVisibilityStatus( MessageHandling* _THIS, VisibilityStatus _warningVisibility ) +{ + _THIS->warningVisibility = _warningVisibility; +} + + +/* + * s e t I n f o V i s i b i l i t y S t a t u s + */ +static inline void MessageHandling_setInfoVisibilityStatus( MessageHandling* _THIS, VisibilityStatus _infoVisibility ) +{ + _THIS->infoVisibility = _infoVisibility; +} + + +/* + * s e t O u t p u t F i l e + */ +static inline void MessageHandling_setOutputFile( MessageHandling* _THIS, FILE* _outputFile ) +{ + _THIS->outputFile = _outputFile; +} + + +/* + * s e t E r r o r C o u n t + */ +static inline returnValue MessageHandling_setErrorCount( MessageHandling* _THIS, int _errorCount ) +{ + if ( _errorCount >= 0 ) + { + _THIS->errorCount = _errorCount; + return SUCCESSFUL_RETURN; + } + else + return RET_INVALID_ARGUMENTS; +} + + +END_NAMESPACE_QPOASES + + +#endif /* QPOASES_MESSAGEHANDLING_H */ + + +/* + * end of file + */ diff --git a/third_party/acados/include/qpOASES_e/Options.h b/third_party/acados/include/qpOASES_e/Options.h new file mode 100644 index 000000000..b471ee066 --- /dev/null +++ b/third_party/acados/include/qpOASES_e/Options.h @@ -0,0 +1,153 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/Options.h + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + * + * Declaration of the Options class designed to manage user-specified + * options for solving a QProblem. + */ + + +#ifndef QPOASES_OPTIONS_H +#define QPOASES_OPTIONS_H + + +#include + + +BEGIN_NAMESPACE_QPOASES + + +/** + * \brief Manages all user-specified options for solving QPs. + * + * This class manages all user-specified options used for solving + * quadratic programs. + * + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + */ +typedef struct +{ + PrintLevel printLevel; /**< Print level. */ + + BooleanType enableRamping; /**< Specifies whether ramping shall be enabled or not. */ + BooleanType enableFarBounds; /**< Specifies whether far bounds shall be used or not. */ + BooleanType enableFlippingBounds; /**< Specifies whether flipping bounds shall be used or not. */ + BooleanType enableRegularisation; /**< Specifies whether Hessian matrix shall be regularised in case semi-definiteness is detected. */ + BooleanType enableFullLITests; /**< Specifies whether condition-hardened LI test shall be used or not. */ + BooleanType enableNZCTests; /**< Specifies whether nonzero curvature tests shall be used. */ + int enableDriftCorrection; /**< Specifies the frequency of drift corrections (0 = off). */ + int enableCholeskyRefactorisation; /**< Specifies the frequency of full refactorisation of proj. Hessian (otherwise updates). */ + BooleanType enableEqualities; /**< Specifies whether equalities shall be always treated as active constraints. */ + + real_t terminationTolerance; /**< Termination tolerance. */ + real_t boundTolerance; /**< Lower/upper (constraints') bound tolerance (an inequality constraint whose lower and upper bounds differ by less is regarded to be an equality constraint). */ + real_t boundRelaxation; /**< Offset for relaxing (constraints') bounds at beginning of an initial homotopy. It is also as initial value for far bounds. */ + real_t epsNum; /**< Numerator tolerance for ratio tests. */ + real_t epsDen; /**< Denominator tolerance for ratio tests. */ + real_t maxPrimalJump; /**< Maximum allowed jump in primal variables in nonzero curvature tests. */ + real_t maxDualJump; /**< Maximum allowed jump in dual variables in linear independence tests. */ + + real_t initialRamping; /**< Start value for Ramping Strategy. */ + real_t finalRamping; /**< Final value for Ramping Strategy. */ + real_t initialFarBounds; /**< Initial size of Far Bounds. */ + real_t growFarBounds; /**< Factor to grow Far Bounds. */ + SubjectToStatus initialStatusBounds; /**< Initial status of bounds at first iteration. */ + real_t epsFlipping; /**< Tolerance of squared Cholesky diagonal factor which triggers flipping bound. */ + int numRegularisationSteps; /**< Maximum number of successive regularisation steps. */ + real_t epsRegularisation; /**< Scaling factor of identity matrix used for Hessian regularisation. */ + int numRefinementSteps; /**< Maximum number of iterative refinement steps. */ + real_t epsIterRef; /**< Early termination tolerance for iterative refinement. */ + real_t epsLITests; /**< Tolerance for linear independence tests. */ + real_t epsNZCTests; /**< Tolerance for nonzero curvature tests. */ + + BooleanType enableDropInfeasibles; /**< ... */ + int dropBoundPriority; /**< ... */ + int dropEqConPriority; /**< ... */ + int dropIneqConPriority; /**< ... */ +} Options; + + +void OptionsCON( Options* _THIS + ); + +/** Copies all members from given rhs object. + * \return SUCCESSFUL_RETURN */ +void OptionsCPY( Options* FROM, + Options* TO + ); + + +/** Sets all options to default values. + * \return SUCCESSFUL_RETURN */ +returnValue Options_setToDefault( Options* _THIS + ); + +/** Sets all options to values resulting in maximum reliabilty. + * \return SUCCESSFUL_RETURN */ +returnValue Options_setToReliable( Options* _THIS + ); + +/** Sets all options to values resulting in minimum solution time. + * \return SUCCESSFUL_RETURN */ +returnValue Options_setToMPC( Options* _THIS + ); + +/** Same as setToMPC( ), for ensuring backwards compatibility. + * \return SUCCESSFUL_RETURN */ +returnValue Options_setToFast( Options* _THIS + ); + + +/** Ensures that all options have consistent values by automatically + * adjusting inconsistent ones. + * Note: This routine cannot (and does not try to) ensure that values + * are set to reasonable values that make the QP solution work! + * \return SUCCESSFUL_RETURN \n + * RET_OPTIONS_ADJUSTED */ +returnValue Options_ensureConsistency( Options* _THIS + ); + + +/** Prints values of all options. + * \return SUCCESSFUL_RETURN */ +returnValue Options_print( Options* _THIS + ); + + +END_NAMESPACE_QPOASES + + +#endif /* QPOASES_OPTIONS_H */ + + +/* + * end of file + */ diff --git a/third_party/acados/include/qpOASES_e/QProblem.h b/third_party/acados/include/qpOASES_e/QProblem.h new file mode 100644 index 000000000..3c61a4d59 --- /dev/null +++ b/third_party/acados/include/qpOASES_e/QProblem.h @@ -0,0 +1,2369 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/QProblem.h + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + * + * Declaration of the QProblem class which is able to use the newly + * developed online active set strategy for parametric quadratic programming. + */ + + + +#ifndef QPOASES_QPROBLEM_H +#define QPOASES_QPROBLEM_H + + +#include +#include +#include +#include +#include +#include + + +BEGIN_NAMESPACE_QPOASES + +typedef struct { + Bounds *auxiliaryBounds; + Constraints *auxiliaryConstraints; + + real_t *ub_new_far; + real_t *lb_new_far; + real_t *ubA_new_far; + real_t *lbA_new_far; + + real_t *g_new; + real_t *lb_new; + real_t *ub_new; + real_t *lbA_new; + real_t *ubA_new; + + real_t *g_new2; + real_t *lb_new2; + real_t *ub_new2; + real_t *lbA_new2; + real_t *ubA_new2; + + real_t *delta_xFX5; + real_t *delta_xFR5; + real_t *delta_yAC5; + real_t *delta_yFX5; + + real_t *Hx; + + real_t *_H; + + real_t *g_original; + real_t *lb_original; + real_t *ub_original; + real_t *lbA_original; + real_t *ubA_original; + + real_t *delta_xFR; + real_t *delta_xFX; + real_t *delta_yAC; + real_t *delta_yFX; + real_t *delta_g; + real_t *delta_lb; + real_t *delta_ub; + real_t *delta_lbA; + real_t *delta_ubA; + + real_t *gMod; + + real_t *aFR; + real_t *wZ; + + real_t *delta_g2; + real_t *delta_xFX2; + real_t *delta_xFR2; + real_t *delta_yAC2; + real_t *delta_yFX2; + real_t *nul; + real_t *Arow; + + real_t *xiC; + real_t *xiC_TMP; + real_t *xiB; + real_t *Arow2; + real_t *num; + + real_t *w; + real_t *tmp; + + real_t *delta_g3; + real_t *delta_xFX3; + real_t *delta_xFR3; + real_t *delta_yAC3; + real_t *delta_yFX3; + real_t *nul2; + + real_t *xiC2; + real_t *xiC_TMP2; + real_t *xiB2; + real_t *num2; + + real_t *Hz; + real_t *z; + real_t *ZHz; + real_t *r; + + real_t *tmp2; + real_t *Hz2; + real_t *z2; + real_t *r2; + real_t *rhs; + + real_t *delta_xFX4; + real_t *delta_xFR4; + real_t *delta_yAC4; + real_t *delta_yFX4; + real_t *nul3; + real_t *ek; + real_t *x_W; + real_t *As; + real_t *Ax_W; + + real_t *num3; + real_t *den; + real_t *delta_Ax_l; + real_t *delta_Ax_u; + real_t *delta_Ax; + real_t *delta_x; + + real_t *_A; + + real_t *grad; + real_t *AX; +} QProblem_ws; + +int QProblem_ws_calculateMemorySize( unsigned int nV, unsigned int nC ); + +char *QProblem_ws_assignMemory( unsigned int nV, unsigned int nC, QProblem_ws **mem, void *raw_memory ); + +QProblem_ws *QProblem_ws_createMemory( unsigned int nV, unsigned int nC ); + +/** + * \brief Implements the online active set strategy for QPs with general constraints. + * + * A class for setting up and solving quadratic programs. The main feature is + * the possibily to use the newly developed online active set strategy for + * parametric quadratic programming. + * + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + */ +typedef struct +{ + QProblem_ws *ws; /**< Workspace */ + Bounds *bounds; /**< Data structure for problem's bounds. */ + Constraints *constraints; /**< Data structure for problem's constraints. */ + Flipper *flipper; /**< Struct for making a temporary copy of the matrix factorisations. */ + + DenseMatrix* H; /**< Hessian matrix pointer. */ + DenseMatrix* A; /**< Constraint matrix pointer. */ + + Options options; /**< Struct containing all user-defined options for solving QPs. */ + TabularOutput tabularOutput; /**< Struct storing information for tabular output (printLevel == PL_TABULAR). */ + + real_t *g; /**< Gradient. */ + + real_t *lb; /**< Lower bound vector (on variables). */ + real_t *ub; /**< Upper bound vector (on variables). */ + real_t *lbA; /**< Lower constraints' bound vector. */ + real_t *ubA; /**< Upper constraints' bound vector. */ + + real_t *R; /**< Cholesky factor of H (i.e. H = R^T*R). */ + + real_t *T; /**< Reverse triangular matrix, A = [0 T]*Q'. */ + real_t *Q; /**< Orthonormal quadratic matrix, A = [0 T]*Q'. */ + + real_t *Ax; /**< Stores the current A*x \n + * (for increased efficiency only). */ + real_t *Ax_l; /**< Stores the current distance to lower constraints' bounds A*x-lbA \n + * (for increased efficiency only). */ + real_t *Ax_u; /**< Stores the current distance to lower constraints' bounds ubA-A*x \n + * (for increased efficiency only). */ + + real_t *x; /**< Primal solution vector. */ + real_t *y; /**< Dual solution vector. */ + + real_t *delta_xFR_TMP; /**< Temporary for determineStepDirection */ + real_t *tempA; /**< Temporary for determineStepDirection. */ + real_t *tempB; /**< Temporary for determineStepDirection. */ + real_t *ZFR_delta_xFRz; /**< Temporary for determineStepDirection. */ + real_t *delta_xFRy; /**< Temporary for determineStepDirection. */ + real_t *delta_xFRz; /**< Temporary for determineStepDirection. */ + real_t *delta_yAC_TMP; /**< Temporary for determineStepDirection. */ + + ConstraintProduct constraintProduct; /**< Pointer to user-defined constraint product function. */ + + real_t tau; /**< Last homotopy step length. */ + real_t regVal; /**< Holds the offset used to regularise Hessian matrix (zero by default). */ + + real_t ramp0; /**< Start value for Ramping Strategy. */ + real_t ramp1; /**< Final value for Ramping Strategy. */ + + QProblemStatus status; /**< Current status of the solution process. */ + HessianType hessianType; /**< Type of Hessian matrix. */ + + BooleanType haveCholesky; /**< Flag indicating whether Cholesky decomposition has already been setup. */ + BooleanType infeasible; /**< QP infeasible? */ + BooleanType unbounded; /**< QP unbounded? */ + + int rampOffset; /**< Offset index for Ramping. */ + unsigned int count; /**< Counts the number of hotstart function calls (internal usage only!). */ + + int sizeT; /**< Matrix T is stored in a (sizeT x sizeT) array. */ +} QProblem; + +int QProblem_calculateMemorySize( unsigned int nV, unsigned int nC ); + +char *QProblem_assignMemory( unsigned int nV, unsigned int nC, QProblem **mem, void *raw_memory ); + +QProblem *QProblem_createMemory( unsigned int nV, unsigned int nC ); + + +/** Constructor which takes the QP dimension and Hessian type + * information. If the Hessian is the zero (i.e. HST_ZERO) or the + * identity matrix (i.e. HST_IDENTITY), respectively, no memory + * is allocated for it and a NULL pointer can be passed for it + * to the init() functions. */ +void QProblemCON( QProblem* _THIS, + int _nV, /**< Number of variables. */ + int _nC, /**< Number of constraints. */ + HessianType _hessianType /**< Type of Hessian matrix. */ + ); + +/** Copies all members from given rhs object. + * \return SUCCESSFUL_RETURN */ +void QProblemCPY( QProblem* FROM, + QProblem* TO + ); + + +/** Clears all data structures of QProblem except for QP data. + * \return SUCCESSFUL_RETURN \n + RET_RESET_FAILED */ +returnValue QProblem_reset( QProblem* _THIS ); + + +/** Initialises a QP problem with given QP data and tries to solve it + * using at most nWSR iterations. + * + * Note: This function internally calls solveInitialQP for initialisation! + * + * \return SUCCESSFUL_RETURN \n + RET_INIT_FAILED \n + RET_INIT_FAILED_CHOLESKY \n + RET_INIT_FAILED_TQ \n + RET_INIT_FAILED_HOTSTART \n + RET_INIT_FAILED_INFEASIBILITY \n + RET_INIT_FAILED_UNBOUNDEDNESS \n + RET_MAX_NWSR_REACHED \n + RET_INVALID_ARGUMENTS */ +returnValue QProblem_initM( QProblem* _THIS, + DenseMatrix *_H, /**< Hessian matrix. */ + const real_t* const _g, /**< Gradient vector. */ + DenseMatrix *_A, /**< Constraint matrix. */ + const real_t* const _lb, /**< Lower bound vector (on variables). \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const _ub, /**< Upper bound vector (on variables). \n + If no upper bounds exist, a NULL pointer can be passed. */ + const real_t* const _lbA, /**< Lower constraints' bound vector. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const real_t* const _ubA, /**< Upper constraints' bound vector. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy. + Output: Number of performed working set recalculations. */ + real_t* const cputime /**< Input: Maximum CPU time allowed for QP initialisation. \n + Output: CPU time spent for QP initialisation (if pointer passed). */ + ); + + +/** Initialises a QP problem with given QP data and tries to solve it + * using at most nWSR iterations. + * + * Note: This function internally calls solveInitialQP for initialisation! + * + * \return SUCCESSFUL_RETURN \n + RET_INIT_FAILED \n + RET_INIT_FAILED_CHOLESKY \n + RET_INIT_FAILED_TQ \n + RET_INIT_FAILED_HOTSTART \n + RET_INIT_FAILED_INFEASIBILITY \n + RET_INIT_FAILED_UNBOUNDEDNESS \n + RET_MAX_NWSR_REACHED \n + RET_INVALID_ARGUMENTS */ +returnValue QProblem_init( QProblem* _THIS, + real_t* const _H, /**< Hessian matrix. \n + If Hessian matrix is trivial, a NULL pointer can be passed. */ + const real_t* const _g, /**< Gradient vector. */ + real_t* const _A, /**< Constraint matrix. */ + const real_t* const _lb, /**< Lower bound vector (on variables). \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const _ub, /**< Upper bound vector (on variables). \n + If no upper bounds exist, a NULL pointer can be passed. */ + const real_t* const _lbA, /**< Lower constraints' bound vector. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const real_t* const _ubA, /**< Upper constraints' bound vector. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy. + Output: Number of performed working set recalculations. */ + real_t* const cputime /**< Input: Maximum CPU time allowed for QP initialisation. \n + Output: CPU time spent for QP initialisation (if pointer passed). */ + ); + +/** Initialises a QP problem with given QP data to be read from files and tries to solve it + * using at most nWSR iterations. + * + * Note: This function internally calls solveInitialQP for initialisation! + * + * \return SUCCESSFUL_RETURN \n + RET_INIT_FAILED \n + RET_INIT_FAILED_CHOLESKY \n + RET_INIT_FAILED_TQ \n + RET_INIT_FAILED_HOTSTART \n + RET_INIT_FAILED_INFEASIBILITY \n + RET_INIT_FAILED_UNBOUNDEDNESS \n + RET_MAX_NWSR_REACHED \n + RET_UNABLE_TO_READ_FILE */ +returnValue QProblem_initF( QProblem* _THIS, + const char* const H_file, /**< Name of file where Hessian matrix is stored. \n + If Hessian matrix is trivial, a NULL pointer can be passed. */ + const char* const g_file, /**< Name of file where gradient vector is stored. */ + const char* const A_file, /**< Name of file where constraint matrix is stored. */ + const char* const lb_file, /**< Name of file where lower bound vector. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const char* const ub_file, /**< Name of file where upper bound vector. \n + If no upper bounds exist, a NULL pointer can be passed. */ + const char* const lbA_file, /**< Name of file where lower constraints' bound vector. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const char* const ubA_file, /**< Name of file where upper constraints' bound vector. \n + If no upper constraints' bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy. + Output: Number of performed working set recalculations. */ + real_t* const cputime /**< Input: Maximum CPU time allowed for QP initialisation. \n + Output: CPU time spent for QP initialisation (if pointer passed). */ + ); + +/** Initialises a QP problem with given QP data and tries to solve it + * using at most nWSR iterations. Depending on the parameter constellation it: \n + * 1. 0, 0, 0 : starts with xOpt = 0, yOpt = 0 and gB/gC empty (or all implicit equality bounds), \n + * 2. xOpt, 0, 0 : starts with xOpt, yOpt = 0 and obtain gB/gC by "clipping", \n + * 3. 0, yOpt, 0 : starts with xOpt = 0, yOpt and obtain gB/gC from yOpt != 0, \n + * 4. 0, 0, gB/gC: starts with xOpt = 0, yOpt = 0 and gB/gC, \n + * 5. xOpt, yOpt, 0 : starts with xOpt, yOpt and obtain gB/gC from yOpt != 0, \n + * 6. xOpt, 0, gB/gC: starts with xOpt, yOpt = 0 and gB/gC, \n + * 7. xOpt, yOpt, gB/gC: starts with xOpt, yOpt and gB/gC (assume them to be consistent!) + * + * Note: This function internally calls solveInitialQP for initialisation! + * + * \return SUCCESSFUL_RETURN \n + RET_INIT_FAILED \n + RET_INIT_FAILED_CHOLESKY \n + RET_INIT_FAILED_TQ \n + RET_INIT_FAILED_HOTSTART \n + RET_INIT_FAILED_INFEASIBILITY \n + RET_INIT_FAILED_UNBOUNDEDNESS \n + RET_MAX_NWSR_REACHED \n + RET_INVALID_ARGUMENTS */ +returnValue QProblem_initMW( QProblem* _THIS, + DenseMatrix *_H, /**< Hessian matrix. \n + If Hessian matrix is trivial, a NULL pointer can be passed. */ + const real_t* const _g, /**< Gradient vector. */ + DenseMatrix *_A, /**< Constraint matrix. */ + const real_t* const _lb, /**< Lower bound vector (on variables). \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const _ub, /**< Upper bound vector (on variables). \n + If no upper bounds exist, a NULL pointer can be passed. */ + const real_t* const _lbA, /**< Lower constraints' bound vector. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const real_t* const _ubA, /**< Upper constraints' bound vector. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy. + * Output: Number of performed working set recalculations. */ + real_t* const cputime, /**< Input: Maximum CPU time allowed for QP initialisation. \n + Output: CPU time spent for QP initialisation. */ + const real_t* const xOpt, /**< Optimal primal solution vector. \n + (If a null pointer is passed, the old primal solution is kept!) */ + const real_t* const yOpt, /**< Optimal dual solution vector. \n + (If a null pointer is passed, the old dual solution is kept!) */ + Bounds* const guessedBounds, /**< Optimal working set of bounds for solution (xOpt,yOpt). */ + Constraints* const guessedConstraints, /**< Optimal working set of constraints for solution (xOpt,yOpt). */ + const real_t* const _R /**< Pre-computed (upper triangular) Cholesky factor of Hessian matrix. + The Cholesky factor must be stored in a real_t array of size nV*nV + in row-major format. Note: Only used if xOpt/yOpt and gB are NULL! \n + (If a null pointer is passed, Cholesky decomposition is computed internally!) */ + ); + +/** Initialises a QP problem with given QP data and tries to solve it + * using at most nWSR iterations. Depending on the parameter constellation it: \n + * 1. 0, 0, 0 : starts with xOpt = 0, yOpt = 0 and gB/gC empty (or all implicit equality bounds), \n + * 2. xOpt, 0, 0 : starts with xOpt, yOpt = 0 and obtain gB/gC by "clipping", \n + * 3. 0, yOpt, 0 : starts with xOpt = 0, yOpt and obtain gB/gC from yOpt != 0, \n + * 4. 0, 0, gB/gC: starts with xOpt = 0, yOpt = 0 and gB/gC, \n + * 5. xOpt, yOpt, 0 : starts with xOpt, yOpt and obtain gB/gC from yOpt != 0, \n + * 6. xOpt, 0, gB/gC: starts with xOpt, yOpt = 0 and gB/gC, \n + * 7. xOpt, yOpt, gB/gC: starts with xOpt, yOpt and gB/gC (assume them to be consistent!) + * + * Note: This function internally calls solveInitialQP for initialisation! + * + * \return SUCCESSFUL_RETURN \n + RET_INIT_FAILED \n + RET_INIT_FAILED_CHOLESKY \n + RET_INIT_FAILED_TQ \n + RET_INIT_FAILED_HOTSTART \n + RET_INIT_FAILED_INFEASIBILITY \n + RET_INIT_FAILED_UNBOUNDEDNESS \n + RET_MAX_NWSR_REACHED \n + RET_INVALID_ARGUMENTS */ +returnValue QProblem_initW( QProblem* _THIS, + real_t* const _H, /**< Hessian matrix. \n + If Hessian matrix is trivial, a NULL pointer can be passed. */ + const real_t* const _g, /**< Gradient vector. */ + real_t* const _A, /**< Constraint matrix. */ + const real_t* const _lb, /**< Lower bound vector (on variables). \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const _ub, /**< Upper bound vector (on variables). \n + If no upper bounds exist, a NULL pointer can be passed. */ + const real_t* const _lbA, /**< Lower constraints' bound vector. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const real_t* const _ubA, /**< Upper constraints' bound vector. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy. + * Output: Number of performed working set recalculations. */ + real_t* const cputime, /**< Input: Maximum CPU time allowed for QP initialisation. \n + Output: CPU time spent for QP initialisation. */ + const real_t* const xOpt, /**< Optimal primal solution vector. \n + (If a null pointer is passed, the old primal solution is kept!) */ + const real_t* const yOpt, /**< Optimal dual solution vector. \n + (If a null pointer is passed, the old dual solution is kept!) */ + Bounds* const guessedBounds, /**< Optimal working set of bounds for solution (xOpt,yOpt). */ + Constraints* const guessedConstraints, /**< Optimal working set of constraints for solution (xOpt,yOpt). */ + const real_t* const _R /**< Pre-computed (upper triangular) Cholesky factor of Hessian matrix. + The Cholesky factor must be stored in a real_t array of size nV*nV + in row-major format. Note: Only used if xOpt/yOpt and gB are NULL! \n + (If a null pointer is passed, Cholesky decomposition is computed internally!) */ + ); + +/** Initialises a QP problem with given QP data to be ream from files and tries to solve it + * using at most nWSR iterations. Depending on the parameter constellation it: \n + * 1. 0, 0, 0 : starts with xOpt = 0, yOpt = 0 and gB/gC empty (or all implicit equality bounds), \n + * 2. xOpt, 0, 0 : starts with xOpt, yOpt = 0 and obtain gB/gC by "clipping", \n + * 3. 0, yOpt, 0 : starts with xOpt = 0, yOpt and obtain gB/gC from yOpt != 0, \n + * 4. 0, 0, gB/gC: starts with xOpt = 0, yOpt = 0 and gB/gC, \n + * 5. xOpt, yOpt, 0 : starts with xOpt, yOpt and obtain gB/gC from yOpt != 0, \n + * 6. xOpt, 0, gB/gC: starts with xOpt, yOpt = 0 and gB/gC, \n + * 7. xOpt, yOpt, gB/gC: starts with xOpt, yOpt and gB/gC (assume them to be consistent!) + * + * Note: This function internally calls solveInitialQP for initialisation! + * + * \return SUCCESSFUL_RETURN \n + RET_INIT_FAILED \n + RET_INIT_FAILED_CHOLESKY \n + RET_INIT_FAILED_TQ \n + RET_INIT_FAILED_HOTSTART \n + RET_INIT_FAILED_INFEASIBILITY \n + RET_INIT_FAILED_UNBOUNDEDNESS \n + RET_MAX_NWSR_REACHED \n + RET_UNABLE_TO_READ_FILE */ +returnValue QProblem_initFW( QProblem* _THIS, + const char* const H_file, /**< Name of file where Hessian matrix is stored. \n + If Hessian matrix is trivial, a NULL pointer can be passed. */ + const char* const g_file, /**< Name of file where gradient vector is stored. */ + const char* const A_file, /**< Name of file where constraint matrix is stored. */ + const char* const lb_file, /**< Name of file where lower bound vector. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const char* const ub_file, /**< Name of file where upper bound vector. \n + If no upper bounds exist, a NULL pointer can be passed. */ + const char* const lbA_file, /**< Name of file where lower constraints' bound vector. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const char* const ubA_file, /**< Name of file where upper constraints' bound vector. \n + If no upper constraints' bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy. + Output: Number of performed working set recalculations. */ + real_t* const cputime, /**< Input: Maximum CPU time allowed for QP initialisation. \n + Output: CPU time spent for QP initialisation. */ + const real_t* const xOpt, /**< Optimal primal solution vector. \n + (If a null pointer is passed, the old primal solution is kept!) */ + const real_t* const yOpt, /**< Optimal dual solution vector. \n + (If a null pointer is passed, the old dual solution is kept!) */ + Bounds* const guessedBounds, /**< Optimal working set of bounds for solution (xOpt,yOpt). */ + Constraints* const guessedConstraints, /**< Optimal working set of constraints for solution (xOpt,yOpt). */ + const char* const R_file /**< Pre-computed (upper triangular) Cholesky factor of Hessian matrix. + The Cholesky factor must be stored in a real_t array of size nV*nV + in row-major format. Note: Only used if xOpt/yOpt and gB are NULL! \n + (If a null pointer is passed, Cholesky decomposition is computed internally!) */ + ); + +/** Solves an initialised QP sequence using the online active set strategy. + * QP solution is started from previous solution. + * + * Note: This function internally calls solveQP/solveRegularisedQP + * for solving an initialised QP! + * + * \return SUCCESSFUL_RETURN \n + RET_MAX_NWSR_REACHED \n + RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED \n + RET_HOTSTART_FAILED \n + RET_SHIFT_DETERMINATION_FAILED \n + RET_STEPDIRECTION_DETERMINATION_FAILED \n + RET_STEPLENGTH_DETERMINATION_FAILED \n + RET_HOMOTOPY_STEP_FAILED \n + RET_HOTSTART_STOPPED_INFEASIBILITY \n + RET_HOTSTART_STOPPED_UNBOUNDEDNESS */ +returnValue QProblem_hotstart( QProblem* _THIS, + const real_t* const g_new, /**< Gradient of neighbouring QP to be solved. */ + const real_t* const lb_new, /**< Lower bounds of neighbouring QP to be solved. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const ub_new, /**< Upper bounds of neighbouring QP to be solved. \n + If no upper bounds exist, a NULL pointer can be passed. */ + const real_t* const lbA_new, /**< Lower constraints' bounds of neighbouring QP to be solved. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const real_t* const ubA_new, /**< Upper constraints' bounds of neighbouring QP to be solved. \n + If no upper constraints' bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations; \n + Output: Number of performed working set recalculations. */ + real_t* const cputime /**< Input: Maximum CPU time allowed for QP solution. \n + Output: CPU time spent for QP solution (or to perform nWSR iterations). */ + ); + +/** Solves an initialised QP sequence using the online active set strategy, + * where QP data is read from files. QP solution is started from previous solution. + * + * Note: This function internally calls solveQP/solveRegularisedQP + * for solving an initialised QP! + * + * \return SUCCESSFUL_RETURN \n + RET_MAX_NWSR_REACHED \n + RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED \n + RET_HOTSTART_FAILED \n + RET_SHIFT_DETERMINATION_FAILED \n + RET_STEPDIRECTION_DETERMINATION_FAILED \n + RET_STEPLENGTH_DETERMINATION_FAILED \n + RET_HOMOTOPY_STEP_FAILED \n + RET_HOTSTART_STOPPED_INFEASIBILITY \n + RET_HOTSTART_STOPPED_UNBOUNDEDNESS \n + RET_UNABLE_TO_READ_FILE \n + RET_INVALID_ARGUMENTS */ +returnValue QProblem_hotstartF( QProblem* _THIS, + const char* const g_file, /**< Name of file where gradient, of neighbouring QP to be solved, is stored. */ + const char* const lb_file, /**< Name of file where lower bounds, of neighbouring QP to be solved, is stored. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const char* const ub_file, /**< Name of file where upper bounds, of neighbouring QP to be solved, is stored. \n + If no upper bounds exist, a NULL pointer can be passed. */ + const char* const lbA_file, /**< Name of file where lower constraints' bounds, of neighbouring QP to be solved, is stored. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const char* const ubA_file, /**< Name of file where upper constraints' bounds, of neighbouring QP to be solved, is stored. \n + If no upper constraints' bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations; \n + Output: Number of performed working set recalculations. */ + real_t* const cputime /**< Input: Maximum CPU time allowed for QP solution. \n + Output: CPU time spent for QP solution (or to perform nWSR iterations). */ + ); + +/** Solves an initialised QP sequence using the online active set strategy. + * By default, QP solution is started from previous solution. If a guess + * for the working set is provided, an initialised homotopy is performed. + * + * Note: This function internally calls solveQP/solveRegularisedQP + * for solving an initialised QP! + * + * \return SUCCESSFUL_RETURN \n + RET_MAX_NWSR_REACHED \n + RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED \n + RET_HOTSTART_FAILED \n + RET_SHIFT_DETERMINATION_FAILED \n + RET_STEPDIRECTION_DETERMINATION_FAILED \n + RET_STEPLENGTH_DETERMINATION_FAILED \n + RET_HOMOTOPY_STEP_FAILED \n + RET_HOTSTART_STOPPED_INFEASIBILITY \n + RET_HOTSTART_STOPPED_UNBOUNDEDNESS \n + RET_SETUP_AUXILIARYQP_FAILED */ +returnValue QProblem_hotstartW( QProblem* _THIS, + const real_t* const g_new, /**< Gradient of neighbouring QP to be solved. */ + const real_t* const lb_new, /**< Lower bounds of neighbouring QP to be solved. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const ub_new, /**< Upper bounds of neighbouring QP to be solved. \n + If no upper bounds exist, a NULL pointer can be passed. */ + const real_t* const lbA_new, /**< Lower constraints' bounds of neighbouring QP to be solved. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const real_t* const ubA_new, /**< Upper constraints' bounds of neighbouring QP to be solved. \n + If no upper constraints' bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations; \n + Output: Number of performed working set recalculations. */ + real_t* const cputime, /**< Input: Maximum CPU time allowed for QP solution. \n + Output: CPU time spent for QP solution (or to perform nWSR iterations). */ + Bounds* const guessedBounds, /**< Optimal working set of bounds for solution (xOpt,yOpt). \n + (If a null pointer is passed, the previous working set of bounds is kept!) */ + Constraints* const guessedConstraints /**< Optimal working set of constraints for solution (xOpt,yOpt). \n + (If a null pointer is passed, the previous working set of constraints is kept!) */ + ); + +/** Solves an initialised QP sequence using the online active set strategy, + * where QP data is read from files. + * By default, QP solution is started from previous solution. If a guess + * for the working set is provided, an initialised homotopy is performed. + * + * Note: This function internally calls solveQP/solveRegularisedQP + * for solving an initialised QP! + * + * \return SUCCESSFUL_RETURN \n + RET_MAX_NWSR_REACHED \n + RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED \n + RET_HOTSTART_FAILED \n + RET_SHIFT_DETERMINATION_FAILED \n + RET_STEPDIRECTION_DETERMINATION_FAILED \n + RET_STEPLENGTH_DETERMINATION_FAILED \n + RET_HOMOTOPY_STEP_FAILED \n + RET_HOTSTART_STOPPED_INFEASIBILITY \n + RET_HOTSTART_STOPPED_UNBOUNDEDNESS \n + RET_SETUP_AUXILIARYQP_FAILED \n + RET_UNABLE_TO_READ_FILE \n + RET_INVALID_ARGUMENTS */ +returnValue QProblem_hotstartFW( QProblem* _THIS, + const char* const g_file, /**< Name of file where gradient, of neighbouring QP to be solved, is stored. */ + const char* const lb_file, /**< Name of file where lower bounds, of neighbouring QP to be solved, is stored. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const char* const ub_file, /**< Name of file where upper bounds, of neighbouring QP to be solved, is stored. \n + If no upper bounds exist, a NULL pointer can be passed. */ + const char* const lbA_file, /**< Name of file where lower constraints' bounds, of neighbouring QP to be solved, is stored. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const char* const ubA_file, /**< Name of file where upper constraints' bounds, of neighbouring QP to be solved, is stored. \n + If no upper constraints' bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations; \n + Output: Number of performed working set recalculations. */ + real_t* const cputime, /**< Input: Maximum CPU time allowed for QP solution. \n + Output: CPU time spent for QP solution (or to perform nWSR iterations). */ + Bounds* const guessedBounds, /**< Optimal working set of bounds for solution (xOpt,yOpt). \n + (If a null pointer is passed, the previous working set of bounds is kept!) */ + Constraints* const guessedConstraints /**< Optimal working set of constraints for solution (xOpt,yOpt). \n + (If a null pointer is passed, the previous working set of constraints is kept!) */ + ); + + +/** Solves using the current working set + * \return SUCCESSFUL_RETURN \n + * RET_STEPDIRECTION_FAILED_TQ \n + * RET_STEPDIRECTION_FAILED_CHOLESKY \n + * RET_INVALID_ARGUMENTS */ +returnValue QProblem_solveCurrentEQP ( QProblem* _THIS, + const int n_rhs, /**< Number of consecutive right hand sides */ + const real_t* g_in, /**< Gradient of neighbouring QP to be solved. */ + const real_t* lb_in, /**< Lower bounds of neighbouring QP to be solved. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* ub_in, /**< Upper bounds of neighbouring QP to be solved. \n + If no upper bounds exist, a NULL pointer can be passed. */ + const real_t* lbA_in, /**< Lower constraints' bounds of neighbouring QP to be solved. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const real_t* ubA_in, /**< Upper constraints' bounds of neighbouring QP to be solved. \n */ + real_t* x_out, /**< Output: Primal solution */ + real_t* y_out /**< Output: Dual solution */ + ); + + + +/** Returns current constraints object of the QP (deep copy). + * \return SUCCESSFUL_RETURN \n + RET_QPOBJECT_NOT_SETUP */ +static inline returnValue QProblem_getConstraints( QProblem* _THIS, + Constraints* _constraints /** Output: Constraints object. */ + ); + + +/** Returns the number of constraints. + * \return Number of constraints. */ +static inline int QProblem_getNC( QProblem* _THIS ); + +/** Returns the number of (implicitly defined) equality constraints. + * \return Number of (implicitly defined) equality constraints. */ +static inline int QProblem_getNEC( QProblem* _THIS ); + +/** Returns the number of active constraints. + * \return Number of active constraints. */ +static inline int QProblem_getNAC( QProblem* _THIS ); + +/** Returns the number of inactive constraints. + * \return Number of inactive constraints. */ +static inline int QProblem_getNIAC( QProblem* _THIS ); + +/** Returns the dimension of null space. + * \return Dimension of null space. */ +int QProblem_getNZ( QProblem* _THIS ); + + +/** Returns the dual solution vector (deep copy). + * \return SUCCESSFUL_RETURN \n + RET_QP_NOT_SOLVED */ +returnValue QProblem_getDualSolution( QProblem* _THIS, + real_t* const yOpt /**< Output: Dual solution vector (if QP has been solved). */ + ); + + +/** Defines user-defined routine for calculating the constraint product A*x + * \return SUCCESSFUL_RETURN \n */ +returnValue QProblem_setConstraintProduct( QProblem* _THIS, + ConstraintProduct _constraintProduct + ); + + +/** Prints concise list of properties of the current QP. + * \return SUCCESSFUL_RETURN \n */ +returnValue QProblem_printProperties( QProblem* _THIS ); + + + +/** Writes a vector with the state of the working set +* \return SUCCESSFUL_RETURN */ +returnValue QProblem_getWorkingSet( QProblem* _THIS, + real_t* workingSet /** Output: array containing state of the working set. */ + ); + +/** Writes a vector with the state of the working set of bounds + * \return SUCCESSFUL_RETURN \n + * RET_INVALID_ARGUMENTS */ +returnValue QProblem_getWorkingSetBounds( QProblem* _THIS, + real_t* workingSetB /** Output: array containing state of the working set of bounds. */ + ); + +/** Writes a vector with the state of the working set of constraints + * \return SUCCESSFUL_RETURN \n + * RET_INVALID_ARGUMENTS */ +returnValue QProblem_getWorkingSetConstraints( QProblem* _THIS, + real_t* workingSetC /** Output: array containing state of the working set of constraints. */ + ); + + +/** Returns current bounds object of the QP (deep copy). + * \return SUCCESSFUL_RETURN \n + RET_QPOBJECT_NOT_SETUP */ +static inline returnValue QProblem_getBounds( QProblem* _THIS, + Bounds* _bounds /** Output: Bounds object. */ + ); + + +/** Returns the number of variables. + * \return Number of variables. */ +static inline int QProblem_getNV( QProblem* _THIS ); + +/** Returns the number of free variables. + * \return Number of free variables. */ +static inline int QProblem_getNFR( QProblem* _THIS ); + +/** Returns the number of fixed variables. + * \return Number of fixed variables. */ +static inline int QProblem_getNFX( QProblem* _THIS ); + +/** Returns the number of implicitly fixed variables. + * \return Number of implicitly fixed variables. */ +static inline int QProblem_getNFV( QProblem* _THIS ); + + +/** Returns the optimal objective function value. + * \return finite value: Optimal objective function value (QP was solved) \n + +infinity: QP was not yet solved */ +real_t QProblem_getObjVal( QProblem* _THIS ); + +/** Returns the objective function value at an arbitrary point x. + * \return Objective function value at point x */ +real_t QProblem_getObjValX( QProblem* _THIS, + const real_t* const _x /**< Point at which the objective function shall be evaluated. */ + ); + +/** Returns the primal solution vector. + * \return SUCCESSFUL_RETURN \n + RET_QP_NOT_SOLVED */ +returnValue QProblem_getPrimalSolution( QProblem* _THIS, + real_t* const xOpt /**< Output: Primal solution vector (if QP has been solved). */ + ); + + +/** Returns status of the solution process. + * \return Status of solution process. */ +static inline QProblemStatus QProblem_getStatus( QProblem* _THIS ); + + +/** Returns if the QProblem object is initialised. + * \return BT_TRUE: QProblem initialised \n + BT_FALSE: QProblem not initialised */ +static inline BooleanType QProblem_isInitialised( QProblem* _THIS ); + +/** Returns if the QP has been solved. + * \return BT_TRUE: QProblem solved \n + BT_FALSE: QProblem not solved */ +static inline BooleanType QProblem_isSolved( QProblem* _THIS ); + +/** Returns if the QP is infeasible. + * \return BT_TRUE: QP infeasible \n + BT_FALSE: QP feasible (or not known to be infeasible!) */ +static inline BooleanType QProblem_isInfeasible( QProblem* _THIS ); + +/** Returns if the QP is unbounded. + * \return BT_TRUE: QP unbounded \n + BT_FALSE: QP unbounded (or not known to be unbounded!) */ +static inline BooleanType QProblem_isUnbounded( QProblem* _THIS ); + + +/** Returns Hessian type flag (type is not determined due to _THIS call!). + * \return Hessian type. */ +static inline HessianType QProblem_getHessianType( QProblem* _THIS ); + +/** Changes the print level. + * \return SUCCESSFUL_RETURN */ +static inline returnValue QProblem_setHessianType( QProblem* _THIS, + HessianType _hessianType /**< New Hessian type. */ + ); + +/** Returns if the QP has been internally regularised. + * \return BT_TRUE: Hessian is internally regularised for QP solution \n + BT_FALSE: No internal Hessian regularisation is used for QP solution */ +static inline BooleanType QProblem_usingRegularisation( QProblem* _THIS ); + +/** Returns current options struct. + * \return Current options struct. */ +static inline Options QProblem_getOptions( QProblem* _THIS ); + +/** Overrides current options with given ones. + * \return SUCCESSFUL_RETURN */ +static inline returnValue QProblem_setOptions( QProblem* _THIS, + Options _options /**< New options. */ + ); + +/** Returns the print level. + * \return Print level. */ +static inline PrintLevel QProblem_getPrintLevel( QProblem* _THIS ); + +/** Changes the print level. + * \return SUCCESSFUL_RETURN */ +returnValue QProblem_setPrintLevel( QProblem* _THIS, + PrintLevel _printlevel /**< New print level. */ + ); + + +/** Returns the current number of QP problems solved. + * \return Number of QP problems solved. */ +static inline unsigned int QProblem_getCount( QProblem* _THIS ); + +/** Resets QP problem counter (to zero). + * \return SUCCESSFUL_RETURN. */ +static inline returnValue QProblem_resetCounter( QProblem* _THIS ); + + +/** Prints a list of all options and their current values. + * \return SUCCESSFUL_RETURN \n */ +returnValue QProblem_printOptions( QProblem* _THIS ); + + +/** Solves a QProblem whose QP data is assumed to be stored in the member variables. + * A guess for its primal/dual optimal solution vectors and the corresponding + * working sets of bounds and constraints can be provided. + * Note: This function is internally called by all init functions! + * \return SUCCESSFUL_RETURN \n + RET_INIT_FAILED \n + RET_INIT_FAILED_CHOLESKY \n + RET_INIT_FAILED_TQ \n + RET_INIT_FAILED_HOTSTART \n + RET_INIT_FAILED_INFEASIBILITY \n + RET_INIT_FAILED_UNBOUNDEDNESS \n + RET_MAX_NWSR_REACHED */ +returnValue QProblem_solveInitialQP( QProblem* _THIS, + const real_t* const xOpt, /**< Optimal primal solution vector.*/ + const real_t* const yOpt, /**< Optimal dual solution vector. */ + Bounds* const guessedBounds, /**< Optimal working set of bounds for solution (xOpt,yOpt). */ + Constraints* const guessedConstraints, /**< Optimal working set of constraints for solution (xOpt,yOpt). */ + const real_t* const _R, /**< Pre-computed (upper triangular) Cholesky factor of Hessian matrix. */ + int* nWSR, /**< Input: Maximum number of working set recalculations; \n + * Output: Number of performed working set recalculations. */ + real_t* const cputime /**< Input: Maximum CPU time allowed for QP solution. \n + * Output: CPU time spent for QP solution (or to perform nWSR iterations). */ + ); + +/** Solves QProblem using online active set strategy. + * Note: This function is internally called by all hotstart functions! + * \return SUCCESSFUL_RETURN \n + RET_MAX_NWSR_REACHED \n + RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED \n + RET_HOTSTART_FAILED \n + RET_SHIFT_DETERMINATION_FAILED \n + RET_STEPDIRECTION_DETERMINATION_FAILED \n + RET_STEPLENGTH_DETERMINATION_FAILED \n + RET_HOMOTOPY_STEP_FAILED \n + RET_HOTSTART_STOPPED_INFEASIBILITY \n + RET_HOTSTART_STOPPED_UNBOUNDEDNESS */ +returnValue QProblem_solveQP( QProblem* _THIS, + const real_t* const g_new, /**< Gradient of neighbouring QP to be solved. */ + const real_t* const lb_new, /**< Lower bounds of neighbouring QP to be solved. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const ub_new, /**< Upper bounds of neighbouring QP to be solved. \n + If no upper bounds exist, a NULL pointer can be passed. */ + const real_t* const lbA_new, /**< Lower constraints' bounds of neighbouring QP to be solved. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const real_t* const ubA_new, /**< Upper constraints' bounds of neighbouring QP to be solved. \n + If no upper constraints' bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations; \n + Output: Number of performed working set recalculations. */ + real_t* const cputime, /**< Input: Maximum CPU time allowed for QP solution. \n + Output: CPU time spent for QP solution (or to perform nWSR iterations). */ + int nWSRperformed, /**< Number of working set recalculations already performed to solve + this QP within previous solveQP() calls. This number is + always zero, except for successive calls from solveRegularisedQP() + or when using the far bound strategy. */ + BooleanType isFirstCall /**< Indicating whether this is the first call for current QP. */ + ); + + +/** Solves QProblem using online active set strategy. + * Note: This function is internally called by all hotstart functions! + * \return SUCCESSFUL_RETURN \n + RET_MAX_NWSR_REACHED \n + RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED \n + RET_HOTSTART_FAILED \n + RET_SHIFT_DETERMINATION_FAILED \n + RET_STEPDIRECTION_DETERMINATION_FAILED \n + RET_STEPLENGTH_DETERMINATION_FAILED \n + RET_HOMOTOPY_STEP_FAILED \n + RET_HOTSTART_STOPPED_INFEASIBILITY \n + RET_HOTSTART_STOPPED_UNBOUNDEDNESS */ +returnValue QProblem_solveRegularisedQP( QProblem* _THIS, + const real_t* const g_new, /**< Gradient of neighbouring QP to be solved. */ + const real_t* const lb_new, /**< Lower bounds of neighbouring QP to be solved. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const ub_new, /**< Upper bounds of neighbouring QP to be solved. \n + If no upper bounds exist, a NULL pointer can be passed. */ + const real_t* const lbA_new, /**< Lower constraints' bounds of neighbouring QP to be solved. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const real_t* const ubA_new, /**< Upper constraints' bounds of neighbouring QP to be solved. \n + If no upper constraints' bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations; \n + Output: Number of performed working set recalculations. */ + real_t* const cputime, /**< Input: Maximum CPU time allowed for QP solution. \n + Output: CPU time spent for QP solution (or to perform nWSR iterations). */ + int nWSRperformed, /**< Number of working set recalculations already performed to solve + this QP within previous solveRegularisedQP() calls. This number is + always zero, except for successive calls when using the far bound strategy. */ + BooleanType isFirstCall /**< Indicating whether this is the first call for current QP. */ + ); + + +/** Determines type of existing constraints and bounds (i.e. implicitly fixed, unbounded etc.). + * \return SUCCESSFUL_RETURN \n + RET_SETUPSUBJECTTOTYPE_FAILED */ +returnValue QProblem_setupSubjectToType( QProblem* _THIS ); + +/** Determines type of new constraints and bounds (i.e. implicitly fixed, unbounded etc.). + * \return SUCCESSFUL_RETURN \n + RET_SETUPSUBJECTTOTYPE_FAILED */ +returnValue QProblem_setupSubjectToTypeNew( QProblem* _THIS, + const real_t* const lb_new, /**< New lower bounds. */ + const real_t* const ub_new, /**< New upper bounds. */ + const real_t* const lbA_new, /**< New lower constraints' bounds. */ + const real_t* const ubA_new /**< New upper constraints' bounds. */ + ); + +/** Computes the Cholesky decomposition of the projected Hessian (i.e. R^T*R = Z^T*H*Z). + * Note: If Hessian turns out not to be positive definite, the Hessian type + * is set to HST_SEMIDEF accordingly. + * \return SUCCESSFUL_RETURN \n + * RET_HESSIAN_NOT_SPD \n + * RET_INDEXLIST_CORRUPTED */ +returnValue QProblem_computeProjectedCholesky( QProblem* _THIS ); + +/** Computes initial Cholesky decomposition of the projected Hessian making + * use of the function setupCholeskyDecomposition() or setupCholeskyDecompositionProjected(). + * \return SUCCESSFUL_RETURN \n + * RET_HESSIAN_NOT_SPD \n + * RET_INDEXLIST_CORRUPTED */ +returnValue QProblem_setupInitialCholesky( QProblem* _THIS ); + +/** Initialises TQ factorisation of A (i.e. A*Q = [0 T]) if NO constraint is active. + * \return SUCCESSFUL_RETURN \n + RET_INDEXLIST_CORRUPTED */ +returnValue QProblem_setupTQfactorisation( QProblem* _THIS ); + + +/** Obtains the desired working set for the auxiliary initial QP in + * accordance with the user specifications + * (assumes that member AX has already been initialised!) + * \return SUCCESSFUL_RETURN \n + RET_OBTAINING_WORKINGSET_FAILED \n + RET_INVALID_ARGUMENTS */ +returnValue QProblem_obtainAuxiliaryWorkingSet( QProblem* _THIS, + const real_t* const xOpt, /**< Optimal primal solution vector. + * If a NULL pointer is passed, all entries are assumed to be zero. */ + const real_t* const yOpt, /**< Optimal dual solution vector. + * If a NULL pointer is passed, all entries are assumed to be zero. */ + Bounds* const guessedBounds, /**< Guessed working set of bounds for solution (xOpt,yOpt). */ + Constraints* const guessedConstraints, /**< Guessed working set for solution (xOpt,yOpt). */ + Bounds* auxiliaryBounds, /**< Input: Allocated bound object. \n + * Ouput: Working set of constraints for auxiliary QP. */ + Constraints* auxiliaryConstraints /**< Input: Allocated bound object. \n + * Ouput: Working set for auxiliary QP. */ + ); + +/** Sets up bound and constraints data structures according to auxiliaryBounds/Constraints. + * (If the working set shall be setup afresh, make sure that + * bounds and constraints data structure have been resetted + * and the TQ factorisation has been initialised!) + * \return SUCCESSFUL_RETURN \n + RET_SETUP_WORKINGSET_FAILED \n + RET_INVALID_ARGUMENTS \n + RET_UNKNOWN_BUG */ +returnValue QProblem_setupAuxiliaryWorkingSet( QProblem* _THIS, + Bounds* const auxiliaryBounds, /**< Working set of bounds for auxiliary QP. */ + Constraints* const auxiliaryConstraints, /**< Working set of constraints for auxiliary QP. */ + BooleanType setupAfresh /**< Flag indicating if given working set shall be + * setup afresh or by updating the current one. */ + ); + +/** Sets up the optimal primal/dual solution of the auxiliary initial QP. + * \return SUCCESSFUL_RETURN */ +returnValue QProblem_setupAuxiliaryQPsolution( QProblem* _THIS, + const real_t* const xOpt, /**< Optimal primal solution vector. + * If a NULL pointer is passed, all entries are set to zero. */ + const real_t* const yOpt /**< Optimal dual solution vector. + * If a NULL pointer is passed, all entries are set to zero. */ + ); + +/** Sets up gradient of the auxiliary initial QP for given + * optimal primal/dual solution and given initial working set + * (assumes that members X, Y and BOUNDS, CONSTRAINTS have already been initialised!). + * \return SUCCESSFUL_RETURN */ +returnValue QProblem_setupAuxiliaryQPgradient( QProblem* _THIS ); + +/** Sets up (constraints') bounds of the auxiliary initial QP for given + * optimal primal/dual solution and given initial working set + * (assumes that members X, Y and BOUNDS, CONSTRAINTS have already been initialised!). + * \return SUCCESSFUL_RETURN \n + RET_UNKNOWN_BUG */ +returnValue QProblem_setupAuxiliaryQPbounds( QProblem* _THIS, + Bounds* const auxiliaryBounds, /**< Working set of bounds for auxiliary QP. */ + Constraints* const auxiliaryConstraints, /**< Working set of constraints for auxiliary QP. */ + BooleanType useRelaxation /**< Flag indicating if inactive (constraints') bounds shall be relaxed. */ + ); + + +/** Adds a constraint to active set. + * \return SUCCESSFUL_RETURN \n + RET_ADDCONSTRAINT_FAILED \n + RET_ADDCONSTRAINT_FAILED_INFEASIBILITY \n + RET_ENSURELI_FAILED */ +returnValue QProblem_addConstraint( QProblem* _THIS, + int number, /**< Number of constraint to be added to active set. */ + SubjectToStatus C_status, /**< Status of new active constraint. */ + BooleanType updateCholesky, /**< Flag indicating if Cholesky decomposition shall be updated. */ + BooleanType ensureLI /**< Ensure linear independence by exchange rules by default. */ + ); + +/** Checks if new active constraint to be added is linearly dependent from + * from row of the active constraints matrix. + * \return RET_LINEARLY_DEPENDENT \n + RET_LINEARLY_INDEPENDENT \n + RET_INDEXLIST_CORRUPTED */ +returnValue QProblem_addConstraint_checkLI( QProblem* _THIS, + int number /**< Number of constraint to be added to active set. */ + ); + +/** Ensures linear independence of constraint matrix when a new constraint is added. + * To _THIS end a bound or constraint is removed simultaneously if necessary. + * \return SUCCESSFUL_RETURN \n + RET_LI_RESOLVED \n + RET_ENSURELI_FAILED \n + RET_ENSURELI_FAILED_TQ \n + RET_ENSURELI_FAILED_NOINDEX \n + RET_REMOVE_FROM_ACTIVESET */ +returnValue QProblem_addConstraint_ensureLI( QProblem* _THIS, + int number, /**< Number of constraint to be added to active set. */ + SubjectToStatus C_status /**< Status of new active bound. */ + ); + +/** Adds a bound to active set. + * \return SUCCESSFUL_RETURN \n + RET_ADDBOUND_FAILED \n + RET_ADDBOUND_FAILED_INFEASIBILITY \n + RET_ENSURELI_FAILED */ +returnValue QProblem_addBound( QProblem* _THIS, + int number, /**< Number of bound to be added to active set. */ + SubjectToStatus B_status, /**< Status of new active bound. */ + BooleanType updateCholesky, /**< Flag indicating if Cholesky decomposition shall be updated. */ + BooleanType ensureLI /**< Ensure linear independence by exchange rules by default. */ + ); + +/** Checks if new active bound to be added is linearly dependent from + * from row of the active constraints matrix. + * \return RET_LINEARLY_DEPENDENT \n + RET_LINEARLY_INDEPENDENT */ +returnValue QProblem_addBound_checkLI( QProblem* _THIS, + int number /**< Number of bound to be added to active set. */ + ); + +/** Ensures linear independence of constraint matrix when a new bound is added. + * To _THIS end a bound or constraint is removed simultaneously if necessary. + * \return SUCCESSFUL_RETURN \n + RET_LI_RESOLVED \n + RET_ENSURELI_FAILED \n + RET_ENSURELI_FAILED_TQ \n + RET_ENSURELI_FAILED_NOINDEX \n + RET_REMOVE_FROM_ACTIVESET */ +returnValue QProblem_addBound_ensureLI( QProblem* _THIS, + int number, /**< Number of bound to be added to active set. */ + SubjectToStatus B_status /**< Status of new active bound. */ + ); + +/** Removes a constraint from active set. + * \return SUCCESSFUL_RETURN \n + RET_CONSTRAINT_NOT_ACTIVE \n + RET_REMOVECONSTRAINT_FAILED \n + RET_HESSIAN_NOT_SPD */ +returnValue QProblem_removeConstraint( QProblem* _THIS, + int number, /**< Number of constraint to be removed from active set. */ + BooleanType updateCholesky, /**< Flag indicating if Cholesky decomposition shall be updated. */ + BooleanType allowFlipping, /**< Flag indicating if flipping bounds are allowed. */ + BooleanType ensureNZC /**< Flag indicating if non-zero curvature is ensured by exchange rules. */ + ); + +/** Removes a bounds from active set. + * \return SUCCESSFUL_RETURN \n + RET_BOUND_NOT_ACTIVE \n + RET_HESSIAN_NOT_SPD \n + RET_REMOVEBOUND_FAILED */ +returnValue QProblem_removeBound( QProblem* _THIS, + int number, /**< Number of bound to be removed from active set. */ + BooleanType updateCholesky, /**< Flag indicating if Cholesky decomposition shall be updated. */ + BooleanType allowFlipping, /**< Flag indicating if flipping bounds are allowed. */ + BooleanType ensureNZC /**< Flag indicating if non-zero curvature is ensured by exchange rules. */ + ); + + +/** Performs robustified ratio test yield the maximum possible step length + * along the homotopy path. + * \return SUCCESSFUL_RETURN */ +returnValue QProblem_performPlainRatioTest( QProblem* _THIS, + int nIdx, /**< Number of ratios to be checked. */ + const int* const idxList, /**< Array containing the indices of all ratios to be checked. */ + const real_t* const num, /**< Array containing all numerators for performing the ratio test. */ + const real_t* const den, /**< Array containing all denominators for performing the ratio test. */ + real_t epsNum, /**< Numerator tolerance. */ + real_t epsDen, /**< Denominator tolerance. */ + real_t* t, /**< Output: Maximum possible step length along the homotopy path. */ + int* BC_idx /**< Output: Index of blocking constraint. */ + ); + + +/** Ensure non-zero curvature by primal jump. + * \return SUCCESSFUL_RETURN \n + * RET_HOTSTART_STOPPED_UNBOUNDEDNESS */ +returnValue QProblem_ensureNonzeroCurvature( QProblem* _THIS, + BooleanType removeBoundNotConstraint, /**< SubjectTo to be removed is a bound. */ + int remIdx, /**< Index of bound/constraint to be removed. */ + BooleanType* exchangeHappened, /**< Output: Exchange was necessary to ensure. */ + BooleanType* addBoundNotConstraint, /**< SubjectTo to be added is a bound. */ + int* addIdx, /**< Index of bound/constraint to be added. */ + SubjectToStatus* addStatus /**< Status of bound/constraint to be added. */ + ); + + +/** Solves the system Ta = b or T^Ta = b where T is a reverse upper triangular matrix. + * \return SUCCESSFUL_RETURN \n + RET_DIV_BY_ZERO */ +returnValue QProblem_backsolveT( QProblem* _THIS, + const real_t* const b, /**< Right hand side vector. */ + BooleanType transposed, /**< Indicates if the transposed system shall be solved. */ + real_t* const a /**< Output: Solution vector */ + ); + + +/** Determines step direction of the shift of the QP data. + * \return SUCCESSFUL_RETURN */ +returnValue QProblem_determineDataShift( QProblem* _THIS, + const real_t* const g_new, /**< New gradient vector. */ + const real_t* const lbA_new, /**< New lower constraints' bounds. */ + const real_t* const ubA_new, /**< New upper constraints' bounds. */ + const real_t* const lb_new, /**< New lower bounds. */ + const real_t* const ub_new, /**< New upper bounds. */ + real_t* const delta_g, /**< Output: Step direction of gradient vector. */ + real_t* const delta_lbA, /**< Output: Step direction of lower constraints' bounds. */ + real_t* const delta_ubA, /**< Output: Step direction of upper constraints' bounds. */ + real_t* const delta_lb, /**< Output: Step direction of lower bounds. */ + real_t* const delta_ub, /**< Output: Step direction of upper bounds. */ + BooleanType* Delta_bC_isZero, /**< Output: Indicates if active constraints' bounds are to be shifted. */ + BooleanType* Delta_bB_isZero /**< Output: Indicates if active bounds are to be shifted. */ + ); + +/** Determines step direction of the homotopy path. + * \return SUCCESSFUL_RETURN \n + RET_STEPDIRECTION_FAILED_TQ \n + RET_STEPDIRECTION_FAILED_CHOLESKY */ +returnValue QProblem_determineStepDirection( QProblem* _THIS, + const real_t* const delta_g, /**< Step direction of gradient vector. */ + const real_t* const delta_lbA, /**< Step direction of lower constraints' bounds. */ + const real_t* const delta_ubA, /**< Step direction of upper constraints' bounds. */ + const real_t* const delta_lb, /**< Step direction of lower bounds. */ + const real_t* const delta_ub, /**< Step direction of upper bounds. */ + BooleanType Delta_bC_isZero, /**< Indicates if active constraints' bounds are to be shifted. */ + BooleanType Delta_bB_isZero, /**< Indicates if active bounds are to be shifted. */ + real_t* const delta_xFX, /**< Output: Primal homotopy step direction of fixed variables. */ + real_t* const delta_xFR, /**< Output: Primal homotopy step direction of free variables. */ + real_t* const delta_yAC, /**< Output: Dual homotopy step direction of active constraints' multiplier. */ + real_t* const delta_yFX /**< Output: Dual homotopy step direction of fixed variables' multiplier. */ + ); + +/** Determines the maximum possible step length along the homotopy path + * and performs _THIS step (without changing working set). + * \return SUCCESSFUL_RETURN \n + * RET_ERROR_IN_CONSTRAINTPRODUCT \n + * RET_QP_INFEASIBLE */ +returnValue QProblem_performStep( QProblem* _THIS, + const real_t* const delta_g, /**< Step direction of gradient. */ + const real_t* const delta_lbA, /**< Step direction of lower constraints' bounds. */ + const real_t* const delta_ubA, /**< Step direction of upper constraints' bounds. */ + const real_t* const delta_lb, /**< Step direction of lower bounds. */ + const real_t* const delta_ub, /**< Step direction of upper bounds. */ + const real_t* const delta_xFX, /**< Primal homotopy step direction of fixed variables. */ + const real_t* const delta_xFR, /**< Primal homotopy step direction of free variables. */ + const real_t* const delta_yAC, /**< Dual homotopy step direction of active constraints' multiplier. */ + const real_t* const delta_yFX, /**< Dual homotopy step direction of fixed variables' multiplier. */ + int* BC_idx, /**< Output: Index of blocking constraint. */ + SubjectToStatus* BC_status, /**< Output: Status of blocking constraint. */ + BooleanType* BC_isBound /**< Output: Indicates if blocking constraint is a bound. */ + ); + +/** Updates the active set. + * \return SUCCESSFUL_RETURN \n + RET_REMOVE_FROM_ACTIVESET_FAILED \n + RET_ADD_TO_ACTIVESET_FAILED */ +returnValue QProblem_changeActiveSet( QProblem* _THIS, + int BC_idx, /**< Index of blocking constraint. */ + SubjectToStatus BC_status, /**< Status of blocking constraint. */ + BooleanType BC_isBound /**< Indicates if blocking constraint is a bound. */ + ); + + +/** Compute relative length of homotopy in data space for termination + * criterion. + * \return Relative length in data space. */ +real_t QProblem_getRelativeHomotopyLength( QProblem* _THIS, + const real_t* const g_new, /**< Final gradient. */ + const real_t* const lb_new, /**< Final lower variable bounds. */ + const real_t* const ub_new, /**< Final upper variable bounds. */ + const real_t* const lbA_new, /**< Final lower constraint bounds. */ + const real_t* const ubA_new /**< Final upper constraint bounds. */ + ); + + +/** Ramping Strategy to avoid ties. Modifies homotopy start without + * changing current active set. + * \return SUCCESSFUL_RETURN */ +returnValue QProblem_performRamping( QProblem* _THIS ); + + +/** ... */ +returnValue QProblem_updateFarBounds( QProblem* _THIS, + real_t curFarBound, /**< ... */ + int nRamp, /**< ... */ + const real_t* const lb_new, /**< ... */ + real_t* const lb_new_far, /**< ... */ + const real_t* const ub_new, /**< ... */ + real_t* const ub_new_far, /**< ... */ + const real_t* const lbA_new, /**< ... */ + real_t* const lbA_new_far, /**< ... */ + const real_t* const ubA_new, /**< ... */ + real_t* const ubA_new_far /**< ... */ + ); + +/** ... */ +returnValue QProblemBCPY_updateFarBounds( QProblem* _THIS, + real_t curFarBound, /**< ... */ + int nRamp, /**< ... */ + const real_t* const lb_new, /**< ... */ + real_t* const lb_new_far, /**< ... */ + const real_t* const ub_new, /**< ... */ + real_t* const ub_new_far /**< ... */ + ); + + + +/** Performs robustified ratio test yield the maximum possible step length + * along the homotopy path. + * \return SUCCESSFUL_RETURN */ +returnValue QProblem_performRatioTestC( QProblem* _THIS, + int nIdx, /**< Number of ratios to be checked. */ + const int* const idxList, /**< Array containing the indices of all ratios to be checked. */ + Constraints* const subjectTo, /**< Constraint object corresponding to ratios to be checked. */ + const real_t* const num, /**< Array containing all numerators for performing the ratio test. */ + const real_t* const den, /**< Array containing all denominators for performing the ratio test. */ + real_t epsNum, /**< Numerator tolerance. */ + real_t epsDen, /**< Denominator tolerance. */ + real_t* t, /**< Output: Maximum possible step length along the homotopy path. */ + int* BC_idx /**< Output: Index of blocking constraint. */ + ); + + +/** Drift correction at end of each active set iteration + * \return SUCCESSFUL_RETURN */ +returnValue QProblem_performDriftCorrection( QProblem* _THIS ); + + +/** Updates QP vectors, working sets and internal data structures in order to + start from an optimal solution corresponding to initial guesses of the working + set for bounds and constraints. + * \return SUCCESSFUL_RETURN \n + * RET_SETUP_AUXILIARYQP_FAILED \n + RET_INVALID_ARGUMENTS */ +returnValue QProblem_setupAuxiliaryQP( QProblem* _THIS, + Bounds* const guessedBounds, /**< Initial guess for working set of bounds. */ + Constraints* const guessedConstraints /**< Initial guess for working set of constraints. */ + ); + +/** Determines if it is more efficient to refactorise the matrices when + * hotstarting or not (i.e. better to update the existing factorisations). + * \return BT_TRUE iff matrices shall be refactorised afresh + */ +BooleanType QProblem_shallRefactorise( QProblem* _THIS, + Bounds* const guessedBounds, /**< Guessed new working set of bounds. */ + Constraints* const guessedConstraints /**< Guessed new working set of constraints. */ + ); + +/** Setups internal QP data. + * \return SUCCESSFUL_RETURN \n + RET_INVALID_ARGUMENTS \n + RET_UNKNONW_BUG */ +returnValue QProblem_setupQPdataM( QProblem* _THIS, + DenseMatrix *_H, /**< Hessian matrix. \n + If Hessian matrix is trivial,a NULL pointer can be passed. */ + const real_t* const _g, /**< Gradient vector. */ + DenseMatrix *_A, /**< Constraint matrix. */ + const real_t* const _lb, /**< Lower bound vector (on variables). \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const _ub, /**< Upper bound vector (on variables). \n + If no upper bounds exist, a NULL pointer can be passed. */ + const real_t* const _lbA, /**< Lower constraints' bound vector. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const real_t* const _ubA /**< Upper constraints' bound vector. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + ); + + +/** Sets up dense internal QP data. If the current Hessian is trivial + * (i.e. HST_ZERO or HST_IDENTITY) but a non-trivial one is given, + * memory for Hessian is allocated and it is set to the given one. + * \return SUCCESSFUL_RETURN \n + RET_INVALID_ARGUMENTS \n + RET_UNKNONW_BUG */ +returnValue QProblem_setupQPdata( QProblem* _THIS, + real_t* const _H, /**< Hessian matrix. \n + If Hessian matrix is trivial,a NULL pointer can be passed. */ + const real_t* const _g, /**< Gradient vector. */ + real_t* const _A, /**< Constraint matrix. */ + const real_t* const _lb, /**< Lower bound vector (on variables). \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const _ub, /**< Upper bound vector (on variables). \n + If no upper bounds exist, a NULL pointer can be passed. */ + const real_t* const _lbA, /**< Lower constraints' bound vector. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const real_t* const _ubA /**< Upper constraints' bound vector. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + ); + +/** Sets up internal QP data by loading it from files. If the current Hessian + * is trivial (i.e. HST_ZERO or HST_IDENTITY) but a non-trivial one is given, + * memory for Hessian is allocated and it is set to the given one. + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_OPEN_FILE \n + RET_UNABLE_TO_READ_FILE \n + RET_INVALID_ARGUMENTS \n + RET_UNKNONW_BUG */ +returnValue QProblem_setupQPdataFromFile( QProblem* _THIS, + const char* const H_file, /**< Name of file where Hessian matrix, of neighbouring QP to be solved, is stored. \n + If Hessian matrix is trivial,a NULL pointer can be passed. */ + const char* const g_file, /**< Name of file where gradient, of neighbouring QP to be solved, is stored. */ + const char* const A_file, /**< Name of file where constraint matrix, of neighbouring QP to be solved, is stored. */ + const char* const lb_file, /**< Name of file where lower bounds, of neighbouring QP to be solved, is stored. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const char* const ub_file, /**< Name of file where upper bounds, of neighbouring QP to be solved, is stored. \n + If no upper bounds exist, a NULL pointer can be passed. */ + const char* const lbA_file, /**< Name of file where lower constraints' bounds, of neighbouring QP to be solved, is stored. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const char* const ubA_file /**< Name of file where upper constraints' bounds, of neighbouring QP to be solved, is stored. \n + If no upper constraints' bounds exist, a NULL pointer can be passed. */ + ); + +/** Loads new QP vectors from files (internal members are not affected!). + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_OPEN_FILE \n + RET_UNABLE_TO_READ_FILE \n + RET_INVALID_ARGUMENTS */ +returnValue QProblem_loadQPvectorsFromFile( QProblem* _THIS, + const char* const g_file, /**< Name of file where gradient, of neighbouring QP to be solved, is stored. */ + const char* const lb_file, /**< Name of file where lower bounds, of neighbouring QP to be solved, is stored. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const char* const ub_file, /**< Name of file where upper bounds, of neighbouring QP to be solved, is stored. \n + If no upper bounds exist, a NULL pointer can be passed. */ + const char* const lbA_file, /**< Name of file where lower constraints' bounds, of neighbouring QP to be solved, is stored. \n + If no lower constraints' bounds exist, a NULL pointer can be passed. */ + const char* const ubA_file, /**< Name of file where upper constraints' bounds, of neighbouring QP to be solved, is stored. \n + If no upper constraints' bounds exist, a NULL pointer can be passed. */ + real_t* const g_new, /**< Output: Gradient of neighbouring QP to be solved. */ + real_t* const lb_new, /**< Output: Lower bounds of neighbouring QP to be solved */ + real_t* const ub_new, /**< Output: Upper bounds of neighbouring QP to be solved */ + real_t* const lbA_new, /**< Output: Lower constraints' bounds of neighbouring QP to be solved */ + real_t* const ubA_new /**< Output: Upper constraints' bounds of neighbouring QP to be solved */ + ); + + +/** Prints concise information on the current iteration. + * \return SUCCESSFUL_RETURN \n */ +returnValue QProblem_printIteration( QProblem* _THIS, + int iter, /**< Number of current iteration. */ + int BC_idx, /**< Index of blocking constraint. */ + SubjectToStatus BC_status, /**< Status of blocking constraint. */ + BooleanType BC_isBound, /**< Indicates if blocking constraint is a bound. */ + real_t homotopyLength, /**< Current homotopy distance. */ + BooleanType isFirstCall /**< Indicating whether this is the first call for current QP. */ + ); + + +/** Sets constraint matrix of the QP. \n + Note: Also internal vector Ax is recomputed! + * \return SUCCESSFUL_RETURN \n + * RET_INVALID_ARGUMENTS */ +static inline returnValue QProblem_setAM( QProblem* _THIS, + DenseMatrix *A_new /**< New constraint matrix. */ + ); + +/** Sets dense constraint matrix of the QP. \n + Note: Also internal vector Ax is recomputed! + * \return SUCCESSFUL_RETURN \n + * RET_INVALID_ARGUMENTS */ +static inline returnValue QProblem_setA( QProblem* _THIS, + real_t* const A_new /**< New dense constraint matrix (with correct dimension!). */ + ); + + +/** Sets constraints' lower bound vector of the QP. + * \return SUCCESSFUL_RETURN \n + * RET_QPOBJECT_NOT_SETUP */ +static inline returnValue QProblem_setLBA( QProblem* _THIS, + const real_t* const lbA_new /**< New constraints' lower bound vector (with correct dimension!). */ + ); + +/** Changes single entry of lower constraints' bound vector of the QP. + * \return SUCCESSFUL_RETURN \n + * RET_QPOBJECT_NOT_SETUP \n + * RET_INDEX_OUT_OF_BOUNDS */ +static inline returnValue QProblem_setLBAn( QProblem* _THIS, + int number, /**< Number of entry to be changed. */ + real_t value /**< New value for entry of lower constraints' bound vector (with correct dimension!). */ + ); + +/** Sets constraints' upper bound vector of the QP. + * \return SUCCESSFUL_RETURN \n + * RET_QPOBJECT_NOT_SETUP */ +static inline returnValue QProblem_setUBA( QProblem* _THIS, + const real_t* const ubA_new /**< New constraints' upper bound vector (with correct dimension!). */ + ); + +/** Changes single entry of upper constraints' bound vector of the QP. + * \return SUCCESSFUL_RETURN \n + * RET_QPOBJECT_NOT_SETUP \n + * RET_INDEX_OUT_OF_BOUNDS */ +static inline returnValue QProblem_setUBAn( QProblem* _THIS, + int number, /**< Number of entry to be changed. */ + real_t value /**< New value for entry of upper constraints' bound vector (with correct dimension!). */ + ); + + +/** Decides if lower bounds are smaller than upper bounds + * + * \return SUCCESSFUL_RETURN \n + * RET_QP_INFEASIBLE */ +returnValue QProblem_areBoundsConsistent( QProblem* _THIS, + const real_t* const lb, /**< Vector of lower bounds*/ + const real_t* const ub, /**< Vector of upper bounds*/ + const real_t* const lbA, /**< Vector of lower constraints*/ + const real_t* const ubA /**< Vector of upper constraints*/ + ); + + +/** Drops the blocking bound/constraint that led to infeasibility, or finds another + * bound/constraint to drop according to drop priorities. + * \return SUCCESSFUL_RETURN \n + */ +returnValue QProblem_dropInfeasibles ( QProblem* _THIS, + int BC_number, /**< Number of the bound or constraint to be added */ + SubjectToStatus BC_status, /**< New status of the bound or constraint to be added */ + BooleanType BC_isBound, /**< Whether a bound or a constraint is to be added */ + real_t *xiB, + real_t *xiC + ); + + +/** If Hessian type has been set by the user, nothing is done. + * Otherwise the Hessian type is set to HST_IDENTITY, HST_ZERO, or + * HST_POSDEF (default), respectively. + * \return SUCCESSFUL_RETURN \n + RET_HESSIAN_INDEFINITE */ +returnValue QProblem_determineHessianType( QProblem* _THIS ); + +/** Computes the Cholesky decomposition of the (simply projected) Hessian + * (i.e. R^T*R = Z^T*H*Z). It only works in the case where Z is a simple + * projection matrix! + * Note: If Hessian turns out not to be positive definite, the Hessian type + * is set to HST_SEMIDEF accordingly. + * \return SUCCESSFUL_RETURN \n + * RET_HESSIAN_NOT_SPD \n + * RET_INDEXLIST_CORRUPTED */ +returnValue QProblemBCPY_computeCholesky( QProblem* _THIS ); + +/** Obtains the desired working set for the auxiliary initial QP in + * accordance with the user specifications + * \return SUCCESSFUL_RETURN \n + RET_OBTAINING_WORKINGSET_FAILED \n + RET_INVALID_ARGUMENTS */ +returnValue QProblemBCPY_obtainAuxiliaryWorkingSet( QProblem* _THIS, + const real_t* const xOpt, /**< Optimal primal solution vector. + * If a NULL pointer is passed, all entries are assumed to be zero. */ + const real_t* const yOpt, /**< Optimal dual solution vector. + * If a NULL pointer is passed, all entries are assumed to be zero. */ + Bounds* const guessedBounds, /**< Guessed working set for solution (xOpt,yOpt). */ + Bounds* auxiliaryBounds /**< Input: Allocated bound object. \n + * Output: Working set for auxiliary QP. */ + ); + + +/** Solves the system Ra = b or R^Ta = b where R is an upper triangular matrix. + * \return SUCCESSFUL_RETURN \n + RET_DIV_BY_ZERO */ +returnValue QProblem_backsolveR( QProblem* _THIS, + const real_t* const b, /**< Right hand side vector. */ + BooleanType transposed, /**< Indicates if the transposed system shall be solved. */ + real_t* const a /**< Output: Solution vector */ + ); + +/** Solves the system Ra = b or R^Ta = b where R is an upper triangular matrix. \n + * Special variant for the case that _THIS function is called from within "removeBound()". + * \return SUCCESSFUL_RETURN \n + RET_DIV_BY_ZERO */ +returnValue QProblem_backsolveRrem( QProblem* _THIS, + const real_t* const b, /**< Right hand side vector. */ + BooleanType transposed, /**< Indicates if the transposed system shall be solved. */ + BooleanType removingBound, /**< Indicates if function is called from "removeBound()". */ + real_t* const a /**< Output: Solution vector */ + ); + + +/** Determines step direction of the shift of the QP data. + * \return SUCCESSFUL_RETURN */ +returnValue QProblemBCPY_determineDataShift( QProblem* _THIS, + const real_t* const g_new, /**< New gradient vector. */ + const real_t* const lb_new, /**< New lower bounds. */ + const real_t* const ub_new, /**< New upper bounds. */ + real_t* const delta_g, /**< Output: Step direction of gradient vector. */ + real_t* const delta_lb, /**< Output: Step direction of lower bounds. */ + real_t* const delta_ub, /**< Output: Step direction of upper bounds. */ + BooleanType* Delta_bB_isZero /**< Output: Indicates if active bounds are to be shifted. */ + ); + + +/** Sets up internal QP data. + * \return SUCCESSFUL_RETURN \n + RET_INVALID_ARGUMENTS */ +returnValue QProblemBCPY_setupQPdataM( QProblem* _THIS, + DenseMatrix *_H, /**< Hessian matrix.*/ + const real_t* const _g, /**< Gradient vector. */ + const real_t* const _lb, /**< Lower bounds (on variables). \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const _ub /**< Upper bounds (on variables). \n + If no upper bounds exist, a NULL pointer can be passed. */ + ); + +/** Sets up internal QP data. If the current Hessian is trivial + * (i.e. HST_ZERO or HST_IDENTITY) but a non-trivial one is given, + * memory for Hessian is allocated and it is set to the given one. + * \return SUCCESSFUL_RETURN \n + RET_INVALID_ARGUMENTS \n + RET_NO_HESSIAN_SPECIFIED */ +returnValue QProblemBCPY_setupQPdata( QProblem* _THIS, + real_t* const _H, /**< Hessian matrix. \n + If Hessian matrix is trivial,a NULL pointer can be passed. */ + const real_t* const _g, /**< Gradient vector. */ + const real_t* const _lb, /**< Lower bounds (on variables). \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const _ub /**< Upper bounds (on variables). \n + If no upper bounds exist, a NULL pointer can be passed. */ + ); + +/** Sets up internal QP data by loading it from files. If the current Hessian + * is trivial (i.e. HST_ZERO or HST_IDENTITY) but a non-trivial one is given, + * memory for Hessian is allocated and it is set to the given one. + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_OPEN_FILE \n + RET_UNABLE_TO_READ_FILE \n + RET_INVALID_ARGUMENTS \n + RET_NO_HESSIAN_SPECIFIED */ +returnValue QProblemBCPY_setupQPdataFromFile( QProblem* _THIS, + const char* const H_file, /**< Name of file where Hessian matrix, of neighbouring QP to be solved, is stored. \n + If Hessian matrix is trivial,a NULL pointer can be passed. */ + const char* const g_file, /**< Name of file where gradient, of neighbouring QP to be solved, is stored. */ + const char* const lb_file, /**< Name of file where lower bounds, of neighbouring QP to be solved, is stored. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const char* const ub_file /**< Name of file where upper bounds, of neighbouring QP to be solved, is stored. \n + If no upper bounds exist, a NULL pointer can be passed. */ + ); + +/** Loads new QP vectors from files (internal members are not affected!). + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_OPEN_FILE \n + RET_UNABLE_TO_READ_FILE \n + RET_INVALID_ARGUMENTS */ +returnValue QProblemBCPY_loadQPvectorsFromFile( QProblem* _THIS, + const char* const g_file, /**< Name of file where gradient, of neighbouring QP to be solved, is stored. */ + const char* const lb_file, /**< Name of file where lower bounds, of neighbouring QP to be solved, is stored. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const char* const ub_file, /**< Name of file where upper bounds, of neighbouring QP to be solved, is stored. \n + If no upper bounds exist, a NULL pointer can be passed. */ + real_t* const g_new, /**< Output: Gradient of neighbouring QP to be solved. */ + real_t* const lb_new, /**< Output: Lower bounds of neighbouring QP to be solved */ + real_t* const ub_new /**< Output: Upper bounds of neighbouring QP to be solved */ + ); + + +/** Sets internal infeasibility flag and throws given error in case the far bound + * strategy is not enabled (as QP might actually not be infeasible in _THIS case). + * \return RET_HOTSTART_STOPPED_INFEASIBILITY \n + RET_ENSURELI_FAILED_CYCLING \n + RET_ENSURELI_FAILED_NOINDEX */ +returnValue QProblem_setInfeasibilityFlag( QProblem* _THIS, + returnValue returnvalue, /**< Returnvalue to be tunneled. */ + BooleanType doThrowError /**< Flag forcing to throw an error. */ + ); + + +/** Determines if next QP iteration can be performed within given CPU time limit. + * \return BT_TRUE: CPU time limit is exceeded, stop QP solution. \n + BT_FALSE: Sufficient CPU time for next QP iteration. */ +BooleanType QProblem_isCPUtimeLimitExceeded( QProblem* _THIS, + const real_t* const cputime, /**< Maximum CPU time allowed for QP solution. */ + real_t starttime, /**< Start time of current QP solution. */ + int nWSR /**< Number of working set recalculations performed so far. */ + ); + + +/** Regularise Hessian matrix by adding a scaled identity matrix to it. + * \return SUCCESSFUL_RETURN \n + RET_HESSIAN_ALREADY_REGULARISED */ +returnValue QProblem_regulariseHessian( QProblem* _THIS ); + + +/** Sets Hessian matrix of the QP. + * \return SUCCESSFUL_RETURN */ +static inline returnValue QProblem_setHM( QProblem* _THIS, + DenseMatrix* H_new /**< New Hessian matrix. */ + ); + +/** Sets dense Hessian matrix of the QP. + * If a null pointer is passed and + * a) hessianType is HST_IDENTITY, nothing is done, + * b) hessianType is not HST_IDENTITY, Hessian matrix is set to zero. + * \return SUCCESSFUL_RETURN */ +static inline returnValue QProblem_setH( QProblem* _THIS, + real_t* const H_new /**< New dense Hessian matrix (with correct dimension!). */ + ); + +/** Changes gradient vector of the QP. + * \return SUCCESSFUL_RETURN \n + * RET_INVALID_ARGUMENTS */ +static inline returnValue QProblem_setG( QProblem* _THIS, + const real_t* const g_new /**< New gradient vector (with correct dimension!). */ + ); + +/** Changes lower bound vector of the QP. + * \return SUCCESSFUL_RETURN \n + * RET_INVALID_ARGUMENTS */ +static inline returnValue QProblem_setLB( QProblem* _THIS, + const real_t* const lb_new /**< New lower bound vector (with correct dimension!). */ + ); + +/** Changes single entry of lower bound vector of the QP. + * \return SUCCESSFUL_RETURN \n + RET_INDEX_OUT_OF_BOUNDS */ +static inline returnValue QProblem_setLBn( QProblem* _THIS, + int number, /**< Number of entry to be changed. */ + real_t value /**< New value for entry of lower bound vector. */ + ); + +/** Changes upper bound vector of the QP. + * \return SUCCESSFUL_RETURN \n + * RET_INVALID_ARGUMENTS */ +static inline returnValue QProblem_setUB( QProblem* _THIS, + const real_t* const ub_new /**< New upper bound vector (with correct dimension!). */ + ); + +/** Changes single entry of upper bound vector of the QP. + * \return SUCCESSFUL_RETURN \n + RET_INDEX_OUT_OF_BOUNDS */ +static inline returnValue QProblem_setUBn( QProblem* _THIS, + int number, /**< Number of entry to be changed. */ + real_t value /**< New value for entry of upper bound vector. */ + ); + + + +/** Compute relative length of homotopy in data space for termination + * criterion. + * \return Relative length in data space. */ +real_t QProblemBCPY_getRelativeHomotopyLength( QProblem* _THIS, + const real_t* const g_new, /**< Final gradient. */ + const real_t* const lb_new, /**< Final lower variable bounds. */ + const real_t* const ub_new /**< Final upper variable bounds. */ + ); + + + +/** Performs robustified ratio test yield the maximum possible step length + * along the homotopy path. + * \return SUCCESSFUL_RETURN */ +returnValue QProblem_performRatioTestB( QProblem* _THIS, + int nIdx, /**< Number of ratios to be checked. */ + const int* const idxList, /**< Array containing the indices of all ratios to be checked. */ + Bounds* const subjectTo, /**< Bound object corresponding to ratios to be checked. */ + const real_t* const num, /**< Array containing all numerators for performing the ratio test. */ + const real_t* const den, /**< Array containing all denominators for performing the ratio test. */ + real_t epsNum, /**< Numerator tolerance. */ + real_t epsDen, /**< Denominator tolerance. */ + real_t* t, /**< Output: Maximum possible step length along the homotopy path. */ + int* BC_idx /**< Output: Index of blocking constraint. */ + ); + +/** Checks whether given ratio is blocking, i.e. limits the maximum step length + * along the homotopy path to a value lower than given one. + * \return SUCCESSFUL_RETURN */ +static inline BooleanType QProblem_isBlocking( QProblem* _THIS, + real_t num, /**< Numerator for performing the ratio test. */ + real_t den, /**< Denominator for performing the ratio test. */ + real_t epsNum, /**< Numerator tolerance. */ + real_t epsDen, /**< Denominator tolerance. */ + real_t* t /**< Input: Current maximum step length along the homotopy path, + * Output: Updated maximum possible step length along the homotopy path. */ + ); + + +/** ... + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_OPEN_FILE */ +returnValue QProblem_writeQpDataIntoMatFile( QProblem* _THIS, + const char* const filename /**< Mat file name. */ + ); + +/** ... +* \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_OPEN_FILE */ +returnValue QProblem_writeQpWorkspaceIntoMatFile( QProblem* _THIS, + const char* const filename /**< Mat file name. */ + ); + + +/* + * g e t B o u n d s + */ +static inline returnValue QProblem_getBounds( QProblem* _THIS, Bounds* _bounds ) +{ + int nV = QProblem_getNV( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + _bounds = _THIS->bounds; + + return SUCCESSFUL_RETURN; +} + + +/* + * g e t N V + */ +static inline int QProblem_getNV( QProblem* _THIS ) +{ + return Bounds_getNV( _THIS->bounds ); +} + + +/* + * g e t N F R + */ +static inline int QProblem_getNFR( QProblem* _THIS ) +{ + return Bounds_getNFR( _THIS->bounds ); +} + + +/* + * g e t N F X + */ +static inline int QProblem_getNFX( QProblem* _THIS ) +{ + return Bounds_getNFX( _THIS->bounds ); +} + + +/* + * g e t N F V + */ +static inline int QProblem_getNFV( QProblem* _THIS ) +{ + return Bounds_getNFV( _THIS->bounds ); +} + + +/* + * g e t S t a t u s + */ +static inline QProblemStatus QProblem_getStatus( QProblem* _THIS ) +{ + return _THIS->status; +} + + +/* + * i s I n i t i a l i s e d + */ +static inline BooleanType QProblem_isInitialised( QProblem* _THIS ) +{ + if ( _THIS->status == QPS_NOTINITIALISED ) + return BT_FALSE; + else + return BT_TRUE; +} + + +/* + * i s S o l v e d + */ +static inline BooleanType QProblem_isSolved( QProblem* _THIS ) +{ + if ( _THIS->status == QPS_SOLVED ) + return BT_TRUE; + else + return BT_FALSE; +} + + +/* + * i s I n f e a s i b l e + */ +static inline BooleanType QProblem_isInfeasible( QProblem* _THIS ) +{ + return _THIS->infeasible; +} + + +/* + * i s U n b o u n d e d + */ +static inline BooleanType QProblem_isUnbounded( QProblem* _THIS ) +{ + return _THIS->unbounded; +} + + +/* + * g e t H e s s i a n T y p e + */ +static inline HessianType QProblem_getHessianType( QProblem* _THIS ) +{ + return _THIS->hessianType; +} + + +/* + * s e t H e s s i a n T y p e + */ +static inline returnValue QProblem_setHessianType( QProblem* _THIS, HessianType _hessianType ) +{ + _THIS->hessianType = _hessianType; + return SUCCESSFUL_RETURN; +} + + +/* + * u s i n g R e g u l a r i s a t i o n + */ +static inline BooleanType QProblem_usingRegularisation( QProblem* _THIS ) +{ + if ( _THIS->regVal > QPOASES_ZERO ) + return BT_TRUE; + else + return BT_FALSE; +} + + +/* + * g e t O p t i o n s + */ +static inline Options QProblem_getOptions( QProblem* _THIS ) +{ + return _THIS->options; +} + + +/* + * s e t O p t i o n s + */ +static inline returnValue QProblem_setOptions( QProblem* _THIS, + Options _options + ) +{ + OptionsCPY( &_options,&(_THIS->options) ); + Options_ensureConsistency( &(_THIS->options) ); + + QProblem_setPrintLevel( _THIS,_THIS->options.printLevel ); + + return SUCCESSFUL_RETURN; +} + + +/* + * g e t P r i n t L e v e l + */ +static inline PrintLevel QProblem_getPrintLevel( QProblem* _THIS ) +{ + return _THIS->options.printLevel; +} + + +/* + * g e t C o u n t + */ +static inline unsigned int QProblem_getCount( QProblem* _THIS ) +{ + return _THIS->count; +} + + +/* + * r e s e t C o u n t e r + */ +static inline returnValue QProblem_resetCounter( QProblem* _THIS ) +{ + _THIS->count = 0; + return SUCCESSFUL_RETURN; +} + + + +/***************************************************************************** + * P R O T E C T E D * + *****************************************************************************/ + + +/* + * s e t H + */ +static inline returnValue QProblem_setHM( QProblem* _THIS, DenseMatrix* H_new ) +{ + if ( H_new == 0 ) + return QProblem_setH( _THIS,(real_t*)0 ); + else + return QProblem_setH( _THIS,DenseMatrix_getVal(H_new) ); +} + + +/* + * s e t H + */ +static inline returnValue QProblem_setH( QProblem* _THIS, real_t* const H_new ) +{ + /* if null pointer is passed, Hessian is set to zero matrix + * (or stays identity matrix) */ + if ( H_new == 0 ) + { + if ( _THIS->hessianType == HST_IDENTITY ) + return SUCCESSFUL_RETURN; + + _THIS->hessianType = HST_ZERO; + + _THIS->H = 0; + } + else + { + DenseMatrixCON( _THIS->H,QProblem_getNV( _THIS ),QProblem_getNV( _THIS ),QProblem_getNV( _THIS ),H_new ); + } + + return SUCCESSFUL_RETURN; +} + + +/* + * s e t G + */ +static inline returnValue QProblem_setG( QProblem* _THIS, const real_t* const g_new ) +{ + unsigned int nV = (unsigned int)QProblem_getNV( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( g_new == 0 ) + return THROWERROR( RET_INVALID_ARGUMENTS ); + + memcpy( _THIS->g,g_new,nV*sizeof(real_t) ); + + return SUCCESSFUL_RETURN; +} + + +/* + * s e t L B + */ +static inline returnValue QProblem_setLB( QProblem* _THIS, const real_t* const lb_new ) +{ + unsigned int i; + unsigned int nV = (unsigned int)QProblem_getNV( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( lb_new != 0 ) + { + memcpy( _THIS->lb,lb_new,nV*sizeof(real_t) ); + } + else + { + /* if no lower bounds are specified, set them to -infinity */ + for( i=0; ilb[i] = -QPOASES_INFTY; + } + + return SUCCESSFUL_RETURN; +} + + +/* + * s e t L B + */ +static inline returnValue QProblem_setLBn( QProblem* _THIS, int number, real_t value ) +{ + int nV = QProblem_getNV( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( ( number >= 0 ) && ( number < nV ) ) + { + _THIS->lb[number] = value; + return SUCCESSFUL_RETURN; + } + else + { + return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); + } +} + + +/* + * s e t U B + */ +static inline returnValue QProblem_setUB( QProblem* _THIS, const real_t* const ub_new ) +{ + unsigned int i; + unsigned int nV = (unsigned int)QProblem_getNV( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( ub_new != 0 ) + { + memcpy( _THIS->ub,ub_new,nV*sizeof(real_t) ); + } + else + { + /* if no upper bounds are specified, set them to infinity */ + for( i=0; iub[i] = QPOASES_INFTY; + } + + return SUCCESSFUL_RETURN; +} + + +/* + * s e t U B + */ +static inline returnValue QProblem_setUBn( QProblem* _THIS, int number, real_t value ) +{ + int nV = QProblem_getNV( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( ( number >= 0 ) && ( number < nV ) ) + { + _THIS->ub[number] = value; + + return SUCCESSFUL_RETURN; + } + else + { + return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); + } +} + + + +/* + * i s B l o c k i n g + */ +static inline BooleanType QProblem_isBlocking( QProblem* _THIS, + real_t num, + real_t den, + real_t epsNum, + real_t epsDen, + real_t* t + ) +{ + if ( ( den >= epsDen ) && ( num >= epsNum ) ) + { + if ( num < (*t)*den ) + return BT_TRUE; + } + + return BT_FALSE; +} + + + +/* + * g e t C o n s t r a i n t s + */ +static inline returnValue QProblem_getConstraints( QProblem* _THIS, Constraints* _constraints ) +{ + int nV = QProblem_getNV( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + ConstraintsCPY( _THIS->constraints,_constraints ); + + return SUCCESSFUL_RETURN; +} + + + +/* + * g e t N C + */ +static inline int QProblem_getNC( QProblem* _THIS ) +{ + return Constraints_getNC( _THIS->constraints ); +} + + +/* + * g e t N E C + */ +static inline int QProblem_getNEC( QProblem* _THIS ) +{ + return Constraints_getNEC( _THIS->constraints ); +} + + +/* + * g e t N A C + */ +static inline int QProblem_getNAC( QProblem* _THIS ) +{ + return Constraints_getNAC( _THIS->constraints ); +} + + +/* + * g e t N I A C + */ +static inline int QProblem_getNIAC( QProblem* _THIS ) +{ + return Constraints_getNIAC( _THIS->constraints ); +} + + + +/***************************************************************************** + * P R O T E C T E D * + *****************************************************************************/ + + +/* + * s e t A + */ +static inline returnValue QProblem_setAM( QProblem* _THIS, DenseMatrix *A_new ) +{ + if ( A_new == 0 ) + return QProblem_setA( _THIS,(real_t*)0 ); + else + return QProblem_setA( _THIS,DenseMatrix_getVal(A_new) ); +} + + +/* + * s e t A + */ +static inline returnValue QProblem_setA( QProblem* _THIS, real_t* const A_new ) +{ + int j; + int nV = QProblem_getNV( _THIS ); + int nC = QProblem_getNC( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( A_new == 0 ) + return THROWERROR( RET_INVALID_ARGUMENTS ); + + DenseMatrixCON( _THIS->A,QProblem_getNC( _THIS ),QProblem_getNV( _THIS ),QProblem_getNV( _THIS ),A_new ); + + DenseMatrix_times( _THIS->A,1, 1.0, _THIS->x, nV, 0.0, _THIS->Ax, nC); + + for( j=0; jAx_u[j] = _THIS->ubA[j] - _THIS->Ax[j]; + _THIS->Ax_l[j] = _THIS->Ax[j] - _THIS->lbA[j]; + + /* (ckirches) disable constraints with empty rows */ + if ( qpOASES_isZero( DenseMatrix_getRowNorm( _THIS->A,j,2 ),QPOASES_ZERO ) == BT_TRUE ) + Constraints_setType( _THIS->constraints,j,ST_DISABLED ); + } + + return SUCCESSFUL_RETURN; +} + + +/* + * s e t L B A + */ +static inline returnValue QProblem_setLBA( QProblem* _THIS, const real_t* const lbA_new ) +{ + unsigned int i; + unsigned int nV = (unsigned int)QProblem_getNV( _THIS ); + unsigned int nC = (unsigned int)QProblem_getNC( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( lbA_new != 0 ) + { + memcpy( _THIS->lbA,lbA_new,nC*sizeof(real_t) ); + } + else + { + /* if no lower constraints' bounds are specified, set them to -infinity */ + for( i=0; ilbA[i] = -QPOASES_INFTY; + } + + return SUCCESSFUL_RETURN; +} + + +/* + * s e t L B A + */ +static inline returnValue QProblem_setLBAn( QProblem* _THIS, int number, real_t value ) +{ + int nV = QProblem_getNV( _THIS ); + int nC = QProblem_getNC( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( ( number >= 0 ) && ( number < nC ) ) + { + _THIS->lbA[number] = value; + return SUCCESSFUL_RETURN; + } + else + return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); +} + + +/* + * s e t U B A + */ +static inline returnValue QProblem_setUBA( QProblem* _THIS, const real_t* const ubA_new ) +{ + unsigned int i; + unsigned int nV = (unsigned int)QProblem_getNV( _THIS ); + unsigned int nC = (unsigned int)QProblem_getNC( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( ubA_new != 0 ) + { + memcpy( _THIS->ubA,ubA_new,nC*sizeof(real_t) ); + } + else + { + /* if no upper constraints' bounds are specified, set them to infinity */ + for( i=0; iubA[i] = QPOASES_INFTY; + } + + return SUCCESSFUL_RETURN; +} + + +/* + * s e t U B A + */ +static inline returnValue QProblem_setUBAn( QProblem* _THIS, int number, real_t value ) +{ + int nV = QProblem_getNV( _THIS ); + int nC = QProblem_getNC( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( ( number >= 0 ) && ( number < nC ) ) + { + _THIS->ubA[number] = value; + return SUCCESSFUL_RETURN; + } + else + return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); +} + + +END_NAMESPACE_QPOASES + + +#endif /* QPOASES_QPROBLEM_H */ + + +/* + * end of file + */ diff --git a/third_party/acados/include/qpOASES_e/QProblemB.h b/third_party/acados/include/qpOASES_e/QProblemB.h new file mode 100644 index 000000000..ee5157dda --- /dev/null +++ b/third_party/acados/include/qpOASES_e/QProblemB.h @@ -0,0 +1,1641 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/QProblemB.h + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + * + * Declaration of the QProblemB class which is able to use the newly + * developed online active set strategy for parametric quadratic programming + * for problems with (simple) bounds only. + */ + + + +#ifndef QPOASES_QPROBLEMB_H +#define QPOASES_QPROBLEMB_H + + +#include +#include +#include +#include + + +BEGIN_NAMESPACE_QPOASES + +typedef struct { + Bounds *emptyBounds; + Bounds *auxiliaryBounds; + + real_t *ub_new_far; + real_t *lb_new_far; + + real_t *g_new; + real_t *lb_new; + real_t *ub_new; + + real_t *g_new2; + real_t *lb_new2; + real_t *ub_new2; + + real_t *Hx; + + real_t *_H; + + real_t *g_original; + real_t *lb_original; + real_t *ub_original; + + real_t *delta_xFR; + real_t *delta_xFX; + real_t *delta_yFX; + real_t *delta_g; + real_t *delta_lb; + real_t *delta_ub; + + real_t *gMod; + + real_t *num; + real_t *den; + + real_t *rhs; + real_t *r; +} QProblemB_ws; + +int QProblemB_ws_calculateMemorySize( unsigned int nV ); + +char *QProblemB_ws_assignMemory( unsigned int nV, QProblemB_ws **mem, void *raw_memory ); + +QProblemB_ws *QProblemB_ws_createMemory( unsigned int nV ); + + +/** + * \brief Implements the online active set strategy for box-constrained QPs. + * + * Class for setting up and solving quadratic programs with bounds (= box constraints) only. + * The main feature is the possibility to use the newly developed online active set strategy + * for parametric quadratic programming. + * + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + */ +typedef struct +{ + QProblemB_ws *ws; + Bounds *bounds; /**< Data structure for problem's bounds. */ + Flipper *flipper; /**< Struct for making a temporary copy of the matrix factorisations. */ + + DenseMatrix* H; /**< Hessian matrix pointer. */ + + Options options; /**< Struct containing all user-defined options for solving QPs. */ + TabularOutput tabularOutput; /**< Struct storing information for tabular output (printLevel == PL_TABULAR). */ + + real_t *g; /**< Gradient. */ + real_t *lb; /**< Lower bound vector (on variables). */ + real_t *ub; /**< Upper bound vector (on variables). */ + + real_t *R; /**< Cholesky factor of H (i.e. H = R^T*R). */ + + real_t *x; /**< Primal solution vector. */ + real_t *y; /**< Dual solution vector. */ + + real_t *delta_xFR_TMP; /**< Temporary for determineStepDirection */ + + real_t tau; /**< Last homotopy step length. */ + real_t regVal; /**< Holds the offset used to regularise Hessian matrix (zero by default). */ + + real_t ramp0; /**< Start value for Ramping Strategy. */ + real_t ramp1; /**< Final value for Ramping Strategy. */ + + QProblemStatus status; /**< Current status of the solution process. */ + HessianType hessianType; /**< Type of Hessian matrix. */ + + BooleanType haveCholesky; /**< Flag indicating whether Cholesky decomposition has already been setup. */ + BooleanType infeasible; /**< QP infeasible? */ + BooleanType unbounded; /**< QP unbounded? */ + + int rampOffset; /**< Offset index for Ramping. */ + unsigned int count; /**< Counts the number of hotstart function calls (internal usage only!). */ +} QProblemB; + +int QProblemB_calculateMemorySize( unsigned int nV ); + +char *QProblemB_assignMemory( unsigned int nV, QProblemB **mem, void *raw_memory ); + +QProblemB *QProblemB_createMemory( unsigned int nV ); + + +/** Constructor which takes the QP dimension and Hessian type + * information. If the Hessian is the zero (i.e. HST_ZERO) or the + * identity matrix (i.e. HST_IDENTITY), respectively, no memory + * is allocated for it and a NULL pointer can be passed for it + * to the init() functions. */ +void QProblemBCON( QProblemB* _THIS, + int _nV, /**< Number of variables. */ + HessianType _hessianType /**< Type of Hessian matrix. */ + ); + +void QProblemBCPY( QProblemB* FROM, + QProblemB* TO + ); + + +/** Clears all data structures of QProblemB except for QP data. + * \return SUCCESSFUL_RETURN \n + RET_RESET_FAILED */ +returnValue QProblemB_reset( QProblemB* _THIS ); + + +/** Initialises a simply bounded QP problem with given QP data and tries to solve it + * using at most nWSR iterations. + * + * Note: This function internally calls solveInitialQP for initialisation! + * + * \return SUCCESSFUL_RETURN \n + RET_INIT_FAILED \n + RET_INIT_FAILED_CHOLESKY \n + RET_INIT_FAILED_HOTSTART \n + RET_INIT_FAILED_INFEASIBILITY \n + RET_INIT_FAILED_UNBOUNDEDNESS \n + RET_MAX_NWSR_REACHED \n + RET_INVALID_ARGUMENTS */ +returnValue QProblemB_initM( QProblemB* _THIS, + DenseMatrix *_H, /**< Hessian matrix. */ + const real_t* const _g, /**< Gradient vector. */ + const real_t* const _lb, /**< Lower bounds (on variables). \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const _ub, /**< Upper bounds (on variables). \n + If no upper bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy. \n + Output: Number of performed working set recalculations. */ + real_t* const cputime /**< Input: Maximum CPU time allowed for QP initialisation. \n + Output: CPU time spent for QP initialisation (if pointer passed). */ + ); + +/** Initialises a simply bounded QP problem with given QP data and tries to solve it + * using at most nWSR iterations. + * + * Note: This function internally calls solveInitialQP for initialisation! + * + * \return SUCCESSFUL_RETURN \n + RET_INIT_FAILED \n + RET_INIT_FAILED_CHOLESKY \n + RET_INIT_FAILED_HOTSTART \n + RET_INIT_FAILED_INFEASIBILITY \n + RET_INIT_FAILED_UNBOUNDEDNESS \n + RET_MAX_NWSR_REACHED \n + RET_INVALID_ARGUMENTS */ +returnValue QProblemB_init( QProblemB* _THIS, + real_t* const _H, /**< Hessian matrix. \n + If Hessian matrix is trivial, a NULL pointer can be passed. */ + const real_t* const _g, /**< Gradient vector. */ + const real_t* const _lb, /**< Lower bounds (on variables). \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const _ub, /**< Upper bounds (on variables). \n + If no upper bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy. \n + Output: Number of performed working set recalculations. */ + real_t* const cputime /**< Input: Maximum CPU time allowed for QP initialisation. \n + Output: CPU time spent for QP initialisation (if pointer passed). */ + ); + +/** Initialises a simply bounded QP problem with given QP data to be read from files and solves it + * using at most nWSR iterations. + * + * Note: This function internally calls solveInitialQP for initialisation! + * + * \return SUCCESSFUL_RETURN \n + RET_INIT_FAILED \n + RET_INIT_FAILED_CHOLESKY \n + RET_INIT_FAILED_HOTSTART \n + RET_INIT_FAILED_INFEASIBILITY \n + RET_INIT_FAILED_UNBOUNDEDNESS \n + RET_MAX_NWSR_REACHED \n + RET_UNABLE_TO_READ_FILE */ +returnValue QProblemB_initF( QProblemB* _THIS, + const char* const H_file, /**< Name of file where Hessian matrix is stored. \n + If Hessian matrix is trivial, a NULL pointer can be passed. */ + const char* const g_file, /**< Name of file where gradient vector is stored. */ + const char* const lb_file, /**< Name of file where lower bound vector. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const char* const ub_file, /**< Name of file where upper bound vector. \n + If no upper bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy. \n + Output: Number of performed working set recalculations. */ + real_t* const cputime /**< Input: Maximum CPU time allowed for QP initialisation. \n + Output: CPU time spent for QP initialisation (if pointer passed). */ + ); + +/** Initialises a simply bounded QP problem with given QP data and tries to solve it + * using at most nWSR iterations. Depending on the parameter constellation it: \n + * 1. 0, 0, 0 : starts with xOpt = 0, yOpt = 0 and gB empty (or all implicit equality bounds), \n + * 2. xOpt, 0, 0 : starts with xOpt, yOpt = 0 and obtain gB by "clipping", \n + * 3. 0, yOpt, 0 : starts with xOpt = 0, yOpt and obtain gB from yOpt != 0, \n + * 4. 0, 0, gB: starts with xOpt = 0, yOpt = 0 and gB, \n + * 5. xOpt, yOpt, 0 : starts with xOpt, yOpt and obtain gB from yOpt != 0, \n + * 6. xOpt, 0, gB: starts with xOpt, yOpt = 0 and gB, \n + * 7. xOpt, yOpt, gB: starts with xOpt, yOpt and gB (assume them to be consistent!) + * + * Note: This function internally calls solveInitialQP for initialisation! + * + * \return SUCCESSFUL_RETURN \n + RET_INIT_FAILED \n + RET_INIT_FAILED_CHOLESKY \n + RET_INIT_FAILED_HOTSTART \n + RET_INIT_FAILED_INFEASIBILITY \n + RET_INIT_FAILED_UNBOUNDEDNESS \n + RET_MAX_NWSR_REACHED \n + RET_INVALID_ARGUMENTS */ +returnValue QProblemB_initMW( QProblemB* _THIS, + DenseMatrix *_H, /**< Hessian matrix. */ + const real_t* const _g, /**< Gradient vector. */ + const real_t* const _lb, /**< Lower bounds (on variables). \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const _ub, /**< Upper bounds (on variables). \n + If no upper bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy. \n + Output: Number of performed working set recalculations. */ + real_t* const cputime, /**< Input: Maximum CPU time allowed for QP initialisation. \n + Output: CPU time spent for QP initialisation. */ + const real_t* const xOpt, /**< Optimal primal solution vector. A NULL pointer can be passed. \n + (If a null pointer is passed, the old primal solution is kept!) */ + const real_t* const yOpt, /**< Optimal dual solution vector. A NULL pointer can be passed. \n + (If a null pointer is passed, the old dual solution is kept!) */ + Bounds* const guessedBounds, /**< Optimal working set of bounds for solution (xOpt,yOpt). \n + (If a null pointer is passed, all bounds are assumed inactive!) */ + const real_t* const _R /**< Pre-computed (upper triangular) Cholesky factor of Hessian matrix. + The Cholesky factor must be stored in a real_t array of size nV*nV + in row-major format. Note: Only used if xOpt/yOpt and gB are NULL! \n + (If a null pointer is passed, Cholesky decomposition is computed internally!) */ + ); + +/** Initialises a simply bounded QP problem with given QP data and tries to solve it + * using at most nWSR iterations. Depending on the parameter constellation it: \n + * 1. 0, 0, 0 : starts with xOpt = 0, yOpt = 0 and gB empty (or all implicit equality bounds), \n + * 2. xOpt, 0, 0 : starts with xOpt, yOpt = 0 and obtain gB by "clipping", \n + * 3. 0, yOpt, 0 : starts with xOpt = 0, yOpt and obtain gB from yOpt != 0, \n + * 4. 0, 0, gB: starts with xOpt = 0, yOpt = 0 and gB, \n + * 5. xOpt, yOpt, 0 : starts with xOpt, yOpt and obtain gB from yOpt != 0, \n + * 6. xOpt, 0, gB: starts with xOpt, yOpt = 0 and gB, \n + * 7. xOpt, yOpt, gB: starts with xOpt, yOpt and gB (assume them to be consistent!) + * + * Note: This function internally calls solveInitialQP for initialisation! + * + * \return SUCCESSFUL_RETURN \n + RET_INIT_FAILED \n + RET_INIT_FAILED_CHOLESKY \n + RET_INIT_FAILED_HOTSTART \n + RET_INIT_FAILED_INFEASIBILITY \n + RET_INIT_FAILED_UNBOUNDEDNESS \n + RET_MAX_NWSR_REACHED \n + RET_INVALID_ARGUMENTS */ +returnValue QProblemB_initW( QProblemB* _THIS, + real_t* const _H, /**< Hessian matrix. \n + If Hessian matrix is trivial, a NULL pointer can be passed. */ + const real_t* const _g, /**< Gradient vector. */ + const real_t* const _lb, /**< Lower bounds (on variables). \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const _ub, /**< Upper bounds (on variables). \n + If no upper bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy. \n + Output: Number of performed working set recalculations. */ + real_t* const cputime, /**< Input: Maximum CPU time allowed for QP initialisation. \n + Output: CPU time spent for QP initialisation. */ + const real_t* const xOpt, /**< Optimal primal solution vector. A NULL pointer can be passed. \n + (If a null pointer is passed, the old primal solution is kept!) */ + const real_t* const yOpt, /**< Optimal dual solution vector. A NULL pointer can be passed. \n + (If a null pointer is passed, the old dual solution is kept!) */ + Bounds* const guessedBounds, /**< Optimal working set of bounds for solution (xOpt,yOpt). \n + (If a null pointer is passed, all bounds are assumed inactive!) */ + const real_t* const _R /**< Pre-computed (upper triangular) Cholesky factor of Hessian matrix. + The Cholesky factor must be stored in a real_t array of size nV*nV + in row-major format. Note: Only used if xOpt/yOpt and gB are NULL! \n + (If a null pointer is passed, Cholesky decomposition is computed internally!) */ + ); + +/** Initialises a simply bounded QP problem with given QP data to be read from files and solves it + * using at most nWSR iterations. Depending on the parameter constellation it: \n + * 1. 0, 0, 0 : starts with xOpt = 0, yOpt = 0 and gB empty (or all implicit equality bounds), \n + * 2. xOpt, 0, 0 : starts with xOpt, yOpt = 0 and obtain gB by "clipping", \n + * 3. 0, yOpt, 0 : starts with xOpt = 0, yOpt and obtain gB from yOpt != 0, \n + * 4. 0, 0, gB: starts with xOpt = 0, yOpt = 0 and gB, \n + * 5. xOpt, yOpt, 0 : starts with xOpt, yOpt and obtain gB from yOpt != 0, \n + * 6. xOpt, 0, gB: starts with xOpt, yOpt = 0 and gB, \n + * 7. xOpt, yOpt, gB: starts with xOpt, yOpt and gB (assume them to be consistent!) + * + * Note: This function internally calls solveInitialQP for initialisation! + * + * \return SUCCESSFUL_RETURN \n + RET_INIT_FAILED \n + RET_INIT_FAILED_CHOLESKY \n + RET_INIT_FAILED_HOTSTART \n + RET_INIT_FAILED_INFEASIBILITY \n + RET_INIT_FAILED_UNBOUNDEDNESS \n + RET_MAX_NWSR_REACHED \n + RET_UNABLE_TO_READ_FILE */ +returnValue QProblemB_initFW( QProblemB* _THIS, + const char* const H_file, /**< Name of file where Hessian matrix is stored. \n + If Hessian matrix is trivial, a NULL pointer can be passed. */ + const char* const g_file, /**< Name of file where gradient vector is stored. */ + const char* const lb_file, /**< Name of file where lower bound vector. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const char* const ub_file, /**< Name of file where upper bound vector. \n + If no upper bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy. \n + Output: Number of performed working set recalculations. */ + real_t* const cputime, /**< Input: Maximum CPU time allowed for QP initialisation. \n + Output: CPU time spent for QP initialisation. */ + const real_t* const xOpt, /**< Optimal primal solution vector. A NULL pointer can be passed. \n + (If a null pointer is passed, the old primal solution is kept!) */ + const real_t* const yOpt, /**< Optimal dual solution vector. A NULL pointer can be passed. \n + (If a null pointer is passed, the old dual solution is kept!) */ + Bounds* const guessedBounds, /**< Optimal working set of bounds for solution (xOpt,yOpt). \n + (If a null pointer is passed, all bounds are assumed inactive!) */ + const char* const R_file /**< Name of the file where a pre-computed (upper triangular) Cholesky factor + of the Hessian matrix is stored. \n + (If a null pointer is passed, Cholesky decomposition is computed internally!) */ + ); + + +/** Solves an initialised QP sequence using the online active set strategy. + * By default, QP solution is started from previous solution. + * + * Note: This function internally calls solveQP/solveRegularisedQP + * for solving an initialised QP! + * + * \return SUCCESSFUL_RETURN \n + RET_MAX_NWSR_REACHED \n + RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED \n + RET_HOTSTART_FAILED \n + RET_SHIFT_DETERMINATION_FAILED \n + RET_STEPDIRECTION_DETERMINATION_FAILED \n + RET_STEPLENGTH_DETERMINATION_FAILED \n + RET_HOMOTOPY_STEP_FAILED \n + RET_HOTSTART_STOPPED_INFEASIBILITY \n + RET_HOTSTART_STOPPED_UNBOUNDEDNESS */ +returnValue QProblemB_hotstart( QProblemB* _THIS, + const real_t* const g_new, /**< Gradient of neighbouring QP to be solved. */ + const real_t* const lb_new, /**< Lower bounds of neighbouring QP to be solved. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const ub_new, /**< Upper bounds of neighbouring QP to be solved. \n + If no upper bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations; \n + Output: Number of performed working set recalculations. */ + real_t* const cputime /**< Input: Maximum CPU time allowed for QP solution. \n + Output: CPU time spent for QP solution (or to perform nWSR iterations). */ + ); + +/** Solves an initialised QP sequence using the online active set strategy, + * where QP data is read from files. QP solution is started from previous solution. + * + * Note: This function internally calls solveQP/solveRegularisedQP + * for solving an initialised QP! + * + * \return SUCCESSFUL_RETURN \n + RET_MAX_NWSR_REACHED \n + RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED \n + RET_HOTSTART_FAILED \n + RET_SHIFT_DETERMINATION_FAILED \n + RET_STEPDIRECTION_DETERMINATION_FAILED \n + RET_STEPLENGTH_DETERMINATION_FAILED \n + RET_HOMOTOPY_STEP_FAILED \n + RET_HOTSTART_STOPPED_INFEASIBILITY \n + RET_HOTSTART_STOPPED_UNBOUNDEDNESS \n + RET_UNABLE_TO_READ_FILE \n + RET_INVALID_ARGUMENTS */ +returnValue QProblemB_hotstartF( QProblemB* _THIS, + const char* const g_file, /**< Name of file where gradient, of neighbouring QP to be solved, is stored. */ + const char* const lb_file, /**< Name of file where lower bounds, of neighbouring QP to be solved, is stored. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const char* const ub_file, /**< Name of file where upper bounds, of neighbouring QP to be solved, is stored. \n + If no upper bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations; \n + Output: Number of performed working set recalculations. */ + real_t* const cputime /**< Input: Maximum CPU time allowed for QP solution. \n + Output: CPU time spent for QP solution (or to perform nWSR iterations). */ + ); + +/** Solves an initialised QP sequence using the online active set strategy. + * By default, QP solution is started from previous solution. If a guess + * for the working set is provided, an initialised homotopy is performed. + * + * Note: This function internally calls solveQP/solveRegularisedQP + * for solving an initialised QP! + * + * \return SUCCESSFUL_RETURN \n + RET_MAX_NWSR_REACHED \n + RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED \n + RET_HOTSTART_FAILED \n + RET_SHIFT_DETERMINATION_FAILED \n + RET_STEPDIRECTION_DETERMINATION_FAILED \n + RET_STEPLENGTH_DETERMINATION_FAILED \n + RET_HOMOTOPY_STEP_FAILED \n + RET_HOTSTART_STOPPED_INFEASIBILITY \n + RET_HOTSTART_STOPPED_UNBOUNDEDNESS \n + RET_SETUP_AUXILIARYQP_FAILED */ +returnValue QProblemB_hotstartW( QProblemB* _THIS, + const real_t* const g_new, /**< Gradient of neighbouring QP to be solved. */ + const real_t* const lb_new, /**< Lower bounds of neighbouring QP to be solved. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const ub_new, /**< Upper bounds of neighbouring QP to be solved. \n + If no upper bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations; \n + Output: Number of performed working set recalculations. */ + real_t* const cputime, /**< Input: Maximum CPU time allowed for QP solution. \n + Output: CPU time spent for QP solution (or to perform nWSR iterations). */ + Bounds* const guessedBounds /**< Optimal working set of bounds for solution (xOpt,yOpt). \n + (If a null pointer is passed, the previous working set is kept!) */ + ); + +/** Solves an initialised QP sequence using the online active set strategy, + * where QP data is read from files. + * By default, QP solution is started from previous solution. If a guess + * for the working set is provided, an initialised homotopy is performed. + * + * Note: This function internally calls solveQP/solveRegularisedQP + * for solving an initialised QP! + * + * \return SUCCESSFUL_RETURN \n + RET_MAX_NWSR_REACHED \n + RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED \n + RET_HOTSTART_FAILED \n + RET_SHIFT_DETERMINATION_FAILED \n + RET_STEPDIRECTION_DETERMINATION_FAILED \n + RET_STEPLENGTH_DETERMINATION_FAILED \n + RET_HOMOTOPY_STEP_FAILED \n + RET_HOTSTART_STOPPED_INFEASIBILITY \n + RET_HOTSTART_STOPPED_UNBOUNDEDNESS \n + RET_UNABLE_TO_READ_FILE \n + RET_INVALID_ARGUMENTS \n + RET_SETUP_AUXILIARYQP_FAILED */ +returnValue QProblemB_hotstartFW( QProblemB* _THIS, + const char* const g_file, /**< Name of file where gradient, of neighbouring QP to be solved, is stored. */ + const char* const lb_file, /**< Name of file where lower bounds, of neighbouring QP to be solved, is stored. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const char* const ub_file, /**< Name of file where upper bounds, of neighbouring QP to be solved, is stored. \n + If no upper bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations; \n + Output: Number of performed working set recalculations. */ + real_t* const cputime, /**< Input: Maximum CPU time allowed for QP solution. \n + Output: CPU time spent for QP solution (or to perform nWSR iterations). */ + Bounds* const guessedBounds /**< Optimal working set of bounds for solution (xOpt,yOpt). \n + (If a null pointer is passed, the previous working set is kept!) */ + ); + + +/** Writes a vector with the state of the working set + * \return SUCCESSFUL_RETURN \n + * RET_INVALID_ARGUMENTS */ +returnValue QProblemB_getWorkingSet( QProblemB* _THIS, + real_t* workingSet /** Output: array containing state of the working set. */ + ); + +/** Writes a vector with the state of the working set of bounds + * \return SUCCESSFUL_RETURN \n + * RET_INVALID_ARGUMENTS */ +returnValue QProblemB_getWorkingSetBounds( QProblemB* _THIS, + real_t* workingSetB /** Output: array containing state of the working set of bounds. */ + ); + +/** Writes a vector with the state of the working set of constraints + * \return SUCCESSFUL_RETURN \n + * RET_INVALID_ARGUMENTS */ +returnValue QProblemB_getWorkingSetConstraints( QProblemB* _THIS, + real_t* workingSetC /** Output: array containing state of the working set of constraints. */ + ); + + +/** Returns current bounds object of the QP (deep copy). + * \return SUCCESSFUL_RETURN \n + RET_QPOBJECT_NOT_SETUP */ +static inline returnValue QProblemB_getBounds( QProblemB* _THIS, + Bounds* _bounds /** Output: Bounds object. */ + ); + + +/** Returns the number of variables. + * \return Number of variables. */ +static inline int QProblemB_getNV( QProblemB* _THIS ); + +/** Returns the number of free variables. + * \return Number of free variables. */ +static inline int QProblemB_getNFR( QProblemB* _THIS ); + +/** Returns the number of fixed variables. + * \return Number of fixed variables. */ +static inline int QProblemB_getNFX( QProblemB* _THIS ); + +/** Returns the number of implicitly fixed variables. + * \return Number of implicitly fixed variables. */ +static inline int QProblemB_getNFV( QProblemB* _THIS ); + +/** Returns the dimension of null space. + * \return Dimension of null space. */ +int QProblemB_getNZ( QProblemB* _THIS ); + + +/** Returns the optimal objective function value. + * \return finite value: Optimal objective function value (QP was solved) \n + +infinity: QP was not yet solved */ +real_t QProblemB_getObjVal( QProblemB* _THIS ); + +/** Returns the objective function value at an arbitrary point x. + * \return Objective function value at point x */ +real_t QProblemB_getObjValX( QProblemB* _THIS, + const real_t* const _x /**< Point at which the objective function shall be evaluated. */ + ); + +/** Returns the primal solution vector. + * \return SUCCESSFUL_RETURN \n + RET_QP_NOT_SOLVED */ +returnValue QProblemB_getPrimalSolution( QProblemB* _THIS, + real_t* const xOpt /**< Output: Primal solution vector (if QP has been solved). */ + ); + +/** Returns the dual solution vector. + * \return SUCCESSFUL_RETURN \n + RET_QP_NOT_SOLVED */ +returnValue QProblemB_getDualSolution( QProblemB* _THIS, + real_t* const yOpt /**< Output: Dual solution vector (if QP has been solved). */ + ); + + +/** Returns status of the solution process. + * \return Status of solution process. */ +static inline QProblemStatus QProblemB_getStatus( QProblemB* _THIS ); + + +/** Returns if the QProblem object is initialised. + * \return BT_TRUE: QProblemB initialised \n + BT_FALSE: QProblemB not initialised */ +static inline BooleanType QProblemB_isInitialised( QProblemB* _THIS ); + +/** Returns if the QP has been solved. + * \return BT_TRUE: QProblemB solved \n + BT_FALSE: QProblemB not solved */ +static inline BooleanType QProblemB_isSolved( QProblemB* _THIS ); + +/** Returns if the QP is infeasible. + * \return BT_TRUE: QP infeasible \n + BT_FALSE: QP feasible (or not known to be infeasible!) */ +static inline BooleanType QProblemB_isInfeasible( QProblemB* _THIS ); + +/** Returns if the QP is unbounded. + * \return BT_TRUE: QP unbounded \n + BT_FALSE: QP unbounded (or not known to be unbounded!) */ +static inline BooleanType QProblemB_isUnbounded( QProblemB* _THIS ); + + +/** Returns Hessian type flag (type is not determined due to _THIS call!). + * \return Hessian type. */ +static inline HessianType QProblemB_getHessianType( QProblemB* _THIS ); + +/** Changes the print level. + * \return SUCCESSFUL_RETURN */ +static inline returnValue QProblemB_setHessianType( QProblemB* _THIS, + HessianType _hessianType /**< New Hessian type. */ + ); + +/** Returns if the QP has been internally regularised. + * \return BT_TRUE: Hessian is internally regularised for QP solution \n + BT_FALSE: No internal Hessian regularisation is used for QP solution */ +static inline BooleanType QProblemB_usingRegularisation( QProblemB* _THIS ); + +/** Returns current options struct. + * \return Current options struct. */ +static inline Options QProblemB_getOptions( QProblemB* _THIS ); + +/** Overrides current options with given ones. + * \return SUCCESSFUL_RETURN */ +static inline returnValue QProblemB_setOptions( QProblemB* _THIS, + Options _options /**< New options. */ + ); + +/** Returns the print level. + * \return Print level. */ +static inline PrintLevel QProblemB_getPrintLevel( QProblemB* _THIS ); + +/** Changes the print level. + * \return SUCCESSFUL_RETURN */ +returnValue QProblemB_setPrintLevel( QProblemB* _THIS, + PrintLevel _printlevel /**< New print level. */ + ); + +/** Returns the current number of QP problems solved. + * \return Number of QP problems solved. */ +static inline unsigned int QProblemB_getCount( QProblemB* _THIS ); + +/** Resets QP problem counter (to zero). + * \return SUCCESSFUL_RETURN. */ +static inline returnValue QProblemB_resetCounter( QProblemB* _THIS ); + + +/** Prints concise list of properties of the current QP. + * \return SUCCESSFUL_RETURN \n */ +returnValue QProblemB_printProperties( QProblemB* _THIS ); + +/** Prints a list of all options and their current values. + * \return SUCCESSFUL_RETURN \n */ +returnValue QProblemB_printOptions( QProblemB* _THIS ); + + +/** If Hessian type has been set by the user, nothing is done. + * Otherwise the Hessian type is set to HST_IDENTITY, HST_ZERO, or + * HST_POSDEF (default), respectively. + * \return SUCCESSFUL_RETURN \n + RET_HESSIAN_INDEFINITE */ +returnValue QProblemB_determineHessianType( QProblemB* _THIS ); + +/** Determines type of existing constraints and bounds (i.e. implicitly fixed, unbounded etc.). + * \return SUCCESSFUL_RETURN \n + RET_SETUPSUBJECTTOTYPE_FAILED */ +returnValue QProblemB_setupSubjectToType( QProblemB* _THIS ); + +/** Determines type of new constraints and bounds (i.e. implicitly fixed, unbounded etc.). + * \return SUCCESSFUL_RETURN \n + RET_SETUPSUBJECTTOTYPE_FAILED */ +returnValue QProblemB_setupSubjectToTypeNew( QProblemB* _THIS, + const real_t* const lb_new, /**< New lower bounds. */ + const real_t* const ub_new /**< New upper bounds. */ + ); + +/** Computes the Cholesky decomposition of the (simply projected) Hessian + * (i.e. R^T*R = Z^T*H*Z). It only works in the case where Z is a simple + * projection matrix! + * Note: If Hessian turns out not to be positive definite, the Hessian type + * is set to HST_SEMIDEF accordingly. + * \return SUCCESSFUL_RETURN \n + * RET_HESSIAN_NOT_SPD \n + * RET_INDEXLIST_CORRUPTED */ +returnValue QProblemB_computeCholesky( QProblemB* _THIS ); + +/** Computes initial Cholesky decomposition of the projected Hessian making + * use of the function setupCholeskyDecomposition() or setupCholeskyDecompositionProjected(). + * \return SUCCESSFUL_RETURN \n + * RET_HESSIAN_NOT_SPD \n + * RET_INDEXLIST_CORRUPTED */ +returnValue QProblemB_setupInitialCholesky( QProblemB* _THIS ); + + +/** Obtains the desired working set for the auxiliary initial QP in + * accordance with the user specifications + * \return SUCCESSFUL_RETURN \n + RET_OBTAINING_WORKINGSET_FAILED \n + RET_INVALID_ARGUMENTS */ +returnValue QProblemB_obtainAuxiliaryWorkingSet( QProblemB* _THIS, + const real_t* const xOpt, /**< Optimal primal solution vector. + * If a NULL pointer is passed, all entries are assumed to be zero. */ + const real_t* const yOpt, /**< Optimal dual solution vector. + * If a NULL pointer is passed, all entries are assumed to be zero. */ + Bounds* const guessedBounds, /**< Guessed working set for solution (xOpt,yOpt). */ + Bounds* auxiliaryBounds /**< Input: Allocated bound object. \n + * Ouput: Working set for auxiliary QP. */ + ); + +/** Decides if lower bounds are smaller than upper bounds + * + * \return SUCCESSFUL_RETURN \n + * RET_QP_INFEASIBLE */ +returnValue QProblemB_areBoundsConsistent( QProblemB* _THIS, + const real_t* const lb, /**< Vector of lower bounds*/ + const real_t* const ub /**< Vector of upper bounds*/ + ); + +/** Solves the system Ra = b or R^Ta = b where R is an upper triangular matrix. + * \return SUCCESSFUL_RETURN \n + RET_DIV_BY_ZERO */ +returnValue QProblemB_backsolveR( QProblemB* _THIS, + const real_t* const b, /**< Right hand side vector. */ + BooleanType transposed, /**< Indicates if the transposed system shall be solved. */ + real_t* const a /**< Output: Solution vector */ + ); + +/** Solves the system Ra = b or R^Ta = b where R is an upper triangular matrix. \n + * Special variant for the case that _THIS function is called from within "removeBound()". + * \return SUCCESSFUL_RETURN \n + RET_DIV_BY_ZERO */ +returnValue QProblemB_backsolveRrem( QProblemB* _THIS, + const real_t* const b, /**< Right hand side vector. */ + BooleanType transposed, /**< Indicates if the transposed system shall be solved. */ + BooleanType removingBound, /**< Indicates if function is called from "removeBound()". */ + real_t* const a /**< Output: Solution vector */ + ); + + +/** Determines step direction of the shift of the QP data. + * \return SUCCESSFUL_RETURN */ +returnValue QProblemB_determineDataShift( QProblemB* _THIS, + const real_t* const g_new, /**< New gradient vector. */ + const real_t* const lb_new, /**< New lower bounds. */ + const real_t* const ub_new, /**< New upper bounds. */ + real_t* const delta_g, /**< Output: Step direction of gradient vector. */ + real_t* const delta_lb, /**< Output: Step direction of lower bounds. */ + real_t* const delta_ub, /**< Output: Step direction of upper bounds. */ + BooleanType* Delta_bB_isZero/**< Output: Indicates if active bounds are to be shifted. */ + ); + + +/** Sets up internal QP data. + * \return SUCCESSFUL_RETURN \n + RET_INVALID_ARGUMENTS */ +returnValue QProblemB_setupQPdataM( QProblemB* _THIS, + DenseMatrix *_H, /**< Hessian matrix.*/ + const real_t* const _g, /**< Gradient vector. */ + const real_t* const _lb, /**< Lower bounds (on variables). \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const _ub /**< Upper bounds (on variables). \n + If no upper bounds exist, a NULL pointer can be passed. */ + ); + +/** Sets up internal QP data. If the current Hessian is trivial + * (i.e. HST_ZERO or HST_IDENTITY) but a non-trivial one is given, + * memory for Hessian is allocated and it is set to the given one. + * \return SUCCESSFUL_RETURN \n + RET_INVALID_ARGUMENTS \n + RET_NO_HESSIAN_SPECIFIED */ +returnValue QProblemB_setupQPdata( QProblemB* _THIS, + real_t* const _H, /**< Hessian matrix. \n + If Hessian matrix is trivial,a NULL pointer can be passed. */ + const real_t* const _g, /**< Gradient vector. */ + const real_t* const _lb, /**< Lower bounds (on variables). \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const _ub /**< Upper bounds (on variables). \n + If no upper bounds exist, a NULL pointer can be passed. */ + ); + +/** Sets up internal QP data by loading it from files. If the current Hessian + * is trivial (i.e. HST_ZERO or HST_IDENTITY) but a non-trivial one is given, + * memory for Hessian is allocated and it is set to the given one. + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_OPEN_FILE \n + RET_UNABLE_TO_READ_FILE \n + RET_INVALID_ARGUMENTS \n + RET_NO_HESSIAN_SPECIFIED */ +returnValue QProblemB_setupQPdataFromFile( QProblemB* _THIS, + const char* const H_file, /**< Name of file where Hessian matrix, of neighbouring QP to be solved, is stored. \n + If Hessian matrix is trivial,a NULL pointer can be passed. */ + const char* const g_file, /**< Name of file where gradient, of neighbouring QP to be solved, is stored. */ + const char* const lb_file, /**< Name of file where lower bounds, of neighbouring QP to be solved, is stored. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const char* const ub_file /**< Name of file where upper bounds, of neighbouring QP to be solved, is stored. \n + If no upper bounds exist, a NULL pointer can be passed. */ + ); + +/** Loads new QP vectors from files (internal members are not affected!). + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_OPEN_FILE \n + RET_UNABLE_TO_READ_FILE \n + RET_INVALID_ARGUMENTS */ +returnValue QProblemB_loadQPvectorsFromFile( QProblemB* _THIS, + const char* const g_file, /**< Name of file where gradient, of neighbouring QP to be solved, is stored. */ + const char* const lb_file, /**< Name of file where lower bounds, of neighbouring QP to be solved, is stored. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const char* const ub_file, /**< Name of file where upper bounds, of neighbouring QP to be solved, is stored. \n + If no upper bounds exist, a NULL pointer can be passed. */ + real_t* const g_new, /**< Output: Gradient of neighbouring QP to be solved. */ + real_t* const lb_new, /**< Output: Lower bounds of neighbouring QP to be solved */ + real_t* const ub_new /**< Output: Upper bounds of neighbouring QP to be solved */ + ); + + +/** Sets internal infeasibility flag and throws given error in case the far bound + * strategy is not enabled (as QP might actually not be infeasible in _THIS case). + * \return RET_HOTSTART_STOPPED_INFEASIBILITY \n + RET_ENSURELI_FAILED_CYCLING \n + RET_ENSURELI_FAILED_NOINDEX */ +returnValue QProblemB_setInfeasibilityFlag( QProblemB* _THIS, + returnValue returnvalue, /**< Returnvalue to be tunneled. */ + BooleanType doThrowError /**< Flag forcing to throw an error. */ + ); + + +/** Determines if next QP iteration can be performed within given CPU time limit. + * \return BT_TRUE: CPU time limit is exceeded, stop QP solution. \n + BT_FALSE: Sufficient CPU time for next QP iteration. */ +BooleanType QProblemB_isCPUtimeLimitExceeded( QProblemB* _THIS, + const real_t* const cputime, /**< Maximum CPU time allowed for QP solution. */ + real_t starttime, /**< Start time of current QP solution. */ + int nWSR /**< Number of working set recalculations performed so far. */ + ); + + +/** Regularise Hessian matrix by adding a scaled identity matrix to it. + * \return SUCCESSFUL_RETURN \n + RET_HESSIAN_ALREADY_REGULARISED */ +returnValue QProblemB_regulariseHessian( QProblemB* _THIS ); + + +/** Sets Hessian matrix of the QP. + * \return SUCCESSFUL_RETURN */ +static inline returnValue QProblemB_setHM( QProblemB* _THIS, + DenseMatrix* H_new /**< New Hessian matrix. */ + ); + +/** Sets dense Hessian matrix of the QP. + * If a null pointer is passed and + * a) hessianType is HST_IDENTITY, nothing is done, + * b) hessianType is not HST_IDENTITY, Hessian matrix is set to zero. + * \return SUCCESSFUL_RETURN */ +static inline returnValue QProblemB_setH( QProblemB* _THIS, + real_t* const H_new /**< New dense Hessian matrix (with correct dimension!). */ + ); + +/** Changes gradient vector of the QP. + * \return SUCCESSFUL_RETURN \n + * RET_INVALID_ARGUMENTS */ +static inline returnValue QProblemB_setG( QProblemB* _THIS, + const real_t* const g_new /**< New gradient vector (with correct dimension!). */ + ); + +/** Changes lower bound vector of the QP. + * \return SUCCESSFUL_RETURN \n + * RET_QPOBJECT_NOT_SETUP */ +static inline returnValue QProblemB_setLB( QProblemB* _THIS, + const real_t* const lb_new /**< New lower bound vector (with correct dimension!). */ + ); + +/** Changes single entry of lower bound vector of the QP. + * \return SUCCESSFUL_RETURN \n + * RET_QPOBJECT_NOT_SETUP \n + * RET_INDEX_OUT_OF_BOUNDS */ +static inline returnValue QProblemB_setLBn( QProblemB* _THIS, + int number, /**< Number of entry to be changed. */ + real_t value /**< New value for entry of lower bound vector. */ + ); + +/** Changes upper bound vector of the QP. + * \return SUCCESSFUL_RETURN \n + * RET_QPOBJECT_NOT_SETUP */ +static inline returnValue QProblemB_setUB( QProblemB* _THIS, + const real_t* const ub_new /**< New upper bound vector (with correct dimension!). */ + ); + +/** Changes single entry of upper bound vector of the QP. + * \return SUCCESSFUL_RETURN \n + * RET_QPOBJECT_NOT_SETUP \n + * RET_INDEX_OUT_OF_BOUNDS */ +static inline returnValue QProblemB_setUBn( QProblemB* _THIS, + int number, /**< Number of entry to be changed. */ + real_t value /**< New value for entry of upper bound vector. */ + ); + + +/** Computes parameters for the Givens matrix G for which [x,y]*G = [z,0] + * \return SUCCESSFUL_RETURN */ +static inline void QProblemB_computeGivens( real_t xold, /**< Matrix entry to be normalised. */ + real_t yold, /**< Matrix entry to be annihilated. */ + real_t* xnew, /**< Output: Normalised matrix entry. */ + real_t* ynew, /**< Output: Annihilated matrix entry. */ + real_t* c, /**< Output: Cosine entry of Givens matrix. */ + real_t* s /**< Output: Sine entry of Givens matrix. */ + ); + +/** Applies Givens matrix determined by c and s (cf. computeGivens). + * \return SUCCESSFUL_RETURN */ +static inline void QProblemB_applyGivens( real_t c, /**< Cosine entry of Givens matrix. */ + real_t s, /**< Sine entry of Givens matrix. */ + real_t nu, /**< Further factor: s/(1+c). */ + real_t xold, /**< Matrix entry to be transformed corresponding to + * the normalised entry of the original matrix. */ + real_t yold, /**< Matrix entry to be transformed corresponding to + * the annihilated entry of the original matrix. */ + real_t* xnew, /**< Output: Transformed matrix entry corresponding to + * the normalised entry of the original matrix. */ + real_t* ynew /**< Output: Transformed matrix entry corresponding to + * the annihilated entry of the original matrix. */ + ); + + + +/** Compute relative length of homotopy in data space for termination + * criterion. + * \return Relative length in data space. */ +real_t QProblemB_getRelativeHomotopyLength( QProblemB* _THIS, + const real_t* const g_new, /**< Final gradient. */ + const real_t* const lb_new, /**< Final lower variable bounds. */ + const real_t* const ub_new /**< Final upper variable bounds. */ + ); + +/** Ramping Strategy to avoid ties. Modifies homotopy start without + * changing current active set. + * \return SUCCESSFUL_RETURN */ +returnValue QProblemB_performRamping( QProblemB* _THIS ); + + +/** ... */ +returnValue QProblemB_updateFarBounds( QProblemB* _THIS, + real_t curFarBound, /**< ... */ + int nRamp, /**< ... */ + const real_t* const lb_new, /**< ... */ + real_t* const lb_new_far, /**< ... */ + const real_t* const ub_new, /**< ... */ + real_t* const ub_new_far /**< ... */ + ); + + + +/** Performs robustified ratio test yield the maximum possible step length + * along the homotopy path. + * \return SUCCESSFUL_RETURN */ +returnValue QProblemB_performRatioTestB( QProblemB* _THIS, + int nIdx, /**< Number of ratios to be checked. */ + const int* const idxList, /**< Array containing the indices of all ratios to be checked. */ + Bounds* const subjectTo, /**< Bound object corresponding to ratios to be checked. */ + const real_t* const num, /**< Array containing all numerators for performing the ratio test. */ + const real_t* const den, /**< Array containing all denominators for performing the ratio test. */ + real_t epsNum, /**< Numerator tolerance. */ + real_t epsDen, /**< Denominator tolerance. */ + real_t* t, /**< Output: Maximum possible step length along the homotopy path. */ + int* BC_idx /**< Output: Index of blocking constraint. */ + ); + +/** Checks whether given ratio is blocking, i.e. limits the maximum step length + * along the homotopy path to a value lower than given one. + * \return SUCCESSFUL_RETURN */ +static inline BooleanType QProblemB_isBlocking( QProblemB* _THIS, + real_t num, /**< Numerator for performing the ratio test. */ + real_t den, /**< Denominator for performing the ratio test. */ + real_t epsNum, /**< Numerator tolerance. */ + real_t epsDen, /**< Denominator tolerance. */ + real_t* t /**< Input: Current maximum step length along the homotopy path, + * Output: Updated maximum possible step length along the homotopy path. */ + ); + + +/** Solves a QProblemB whose QP data is assumed to be stored in the member variables. + * A guess for its primal/dual optimal solution vectors and the corresponding + * optimal working set can be provided. + * Note: This function is internally called by all init functions! + * \return SUCCESSFUL_RETURN \n + RET_INIT_FAILED \n + RET_INIT_FAILED_CHOLESKY \n + RET_INIT_FAILED_HOTSTART \n + RET_INIT_FAILED_INFEASIBILITY \n + RET_INIT_FAILED_UNBOUNDEDNESS \n + RET_MAX_NWSR_REACHED */ +returnValue QProblemB_solveInitialQP( QProblemB* _THIS, + const real_t* const xOpt, /**< Optimal primal solution vector.*/ + const real_t* const yOpt, /**< Optimal dual solution vector. */ + Bounds* const guessedBounds, /**< Optimal working set of bounds for solution (xOpt,yOpt). */ + const real_t* const _R, /**< Pre-computed (upper triangular) Cholesky factor of Hessian matrix. */ + int* nWSR, /**< Input: Maximum number of working set recalculations; \n + * Output: Number of performed working set recalculations. */ + real_t* const cputime /**< Input: Maximum CPU time allowed for QP solution. \n + * Output: CPU time spent for QP solution (or to perform nWSR iterations). */ + ); + +/** Solves an initialised QProblemB using online active set strategy. + * Note: This function is internally called by all hotstart functions! + * \return SUCCESSFUL_RETURN \n + RET_MAX_NWSR_REACHED \n + RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED \n + RET_HOTSTART_FAILED \n + RET_SHIFT_DETERMINATION_FAILED \n + RET_STEPDIRECTION_DETERMINATION_FAILED \n + RET_STEPLENGTH_DETERMINATION_FAILED \n + RET_HOMOTOPY_STEP_FAILED \n + RET_HOTSTART_STOPPED_INFEASIBILITY \n + RET_HOTSTART_STOPPED_UNBOUNDEDNESS */ +returnValue QProblemB_solveQP( QProblemB* _THIS, + const real_t* const g_new, /**< Gradient of neighbouring QP to be solved. */ + const real_t* const lb_new, /**< Lower bounds of neighbouring QP to be solved. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const ub_new, /**< Upper bounds of neighbouring QP to be solved. \n + If no upper bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations; \n + Output: Number of performed working set recalculations. */ + real_t* const cputime, /**< Input: Maximum CPU time allowed for QP solution. \n + Output: CPU time spent for QP solution (or to perform nWSR iterations). */ + int nWSRperformed, /**< Number of working set recalculations already performed to solve + this QP within previous solveQP() calls. This number is + always zero, except for successive calls from solveRegularisedQP() + or when using the far bound strategy. */ + BooleanType isFirstCall /**< Indicating whether this is the first call for current QP. */ + ); + + +/** Solves an initialised QProblemB using online active set strategy. + * Note: This function is internally called by all hotstart functions! + * \return SUCCESSFUL_RETURN \n + RET_MAX_NWSR_REACHED \n + RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED \n + RET_HOTSTART_FAILED \n + RET_SHIFT_DETERMINATION_FAILED \n + RET_STEPDIRECTION_DETERMINATION_FAILED \n + RET_STEPLENGTH_DETERMINATION_FAILED \n + RET_HOMOTOPY_STEP_FAILED \n + RET_HOTSTART_STOPPED_INFEASIBILITY \n + RET_HOTSTART_STOPPED_UNBOUNDEDNESS */ +returnValue QProblemB_solveRegularisedQP( QProblemB* _THIS, + const real_t* const g_new, /**< Gradient of neighbouring QP to be solved. */ + const real_t* const lb_new, /**< Lower bounds of neighbouring QP to be solved. \n + If no lower bounds exist, a NULL pointer can be passed. */ + const real_t* const ub_new, /**< Upper bounds of neighbouring QP to be solved. \n + If no upper bounds exist, a NULL pointer can be passed. */ + int* nWSR, /**< Input: Maximum number of working set recalculations; \n + Output: Number of performed working set recalculations. */ + real_t* const cputime, /**< Input: Maximum CPU time allowed for QP solution. \n + Output: CPU time spent for QP solution (or to perform nWSR iterations). */ + int nWSRperformed, /**< Number of working set recalculations already performed to solve + this QP within previous solveRegularisedQP() calls. This number is + always zero, except for successive calls when using the far bound strategy. */ + BooleanType isFirstCall /**< Indicating whether this is the first call for current QP. */ + ); + + +/** Sets up bound data structure according to auxiliaryBounds. + * (If the working set shall be setup afresh, make sure that + * bounds data structure has been resetted!) + * \return SUCCESSFUL_RETURN \n + RET_SETUP_WORKINGSET_FAILED \n + RET_INVALID_ARGUMENTS \n + RET_UNKNOWN_BUG */ +returnValue QProblemB_setupAuxiliaryWorkingSet( QProblemB* _THIS, + Bounds* const auxiliaryBounds, /**< Working set for auxiliary QP. */ + BooleanType setupAfresh /**< Flag indicating if given working set shall be + * setup afresh or by updating the current one. */ + ); + +/** Sets up the optimal primal/dual solution of the auxiliary initial QP. + * \return SUCCESSFUL_RETURN */ +returnValue QProblemB_setupAuxiliaryQPsolution( QProblemB* _THIS, + const real_t* const xOpt, /**< Optimal primal solution vector. + * If a NULL pointer is passed, all entries are set to zero. */ + const real_t* const yOpt /**< Optimal dual solution vector. + * If a NULL pointer is passed, all entries are set to zero. */ + ); + +/** Sets up gradient of the auxiliary initial QP for given + * optimal primal/dual solution and given initial working set + * (assumes that members X, Y and BOUNDS have already been (ialised!). + * \return SUCCESSFUL_RETURN */ +returnValue QProblemB_setupAuxiliaryQPgradient( QProblemB* _THIS ); + +/** Sets up bounds of the auxiliary initial QP for given + * optimal primal/dual solution and given initial working set + * (assumes that members X, Y and BOUNDS have already been initialised!). + * \return SUCCESSFUL_RETURN \n + RET_UNKNOWN_BUG */ +returnValue QProblemB_setupAuxiliaryQPbounds( QProblemB* _THIS, + BooleanType useRelaxation /**< Flag indicating if inactive bounds shall be relaxed. */ + ); + + +/** Updates QP vectors, working sets and internal data structures in order to + start from an optimal solution corresponding to initial guesses of the working + set for bounds + * \return SUCCESSFUL_RETURN \n + * RET_SETUP_AUXILIARYQP_FAILED */ +returnValue QProblemB_setupAuxiliaryQP( QProblemB* _THIS, + Bounds* const guessedBounds /**< Initial guess for working set of bounds. */ + ); + +/** Determines step direction of the homotopy path. + * \return SUCCESSFUL_RETURN \n + RET_STEPDIRECTION_FAILED_CHOLESKY */ +returnValue QProblemB_determineStepDirection( QProblemB* _THIS, + const real_t* const delta_g, /**< Step direction of gradient vector. */ + const real_t* const delta_lb, /**< Step direction of lower bounds. */ + const real_t* const delta_ub, /**< Step direction of upper bounds. */ + BooleanType Delta_bB_isZero, /**< Indicates if active bounds are to be shifted. */ + real_t* const delta_xFX, /**< Output: Primal homotopy step direction of fixed variables. */ + real_t* const delta_xFR, /**< Output: Primal homotopy step direction of free variables. */ + real_t* const delta_yFX /**< Output: Dual homotopy step direction of fixed variables' multiplier. */ + ); + +/** Determines the maximum possible step length along the homotopy path + * and performs _THIS step (without changing working set). + * \return SUCCESSFUL_RETURN \n + * RET_QP_INFEASIBLE \n + */ +returnValue QProblemB_performStep( QProblemB* _THIS, + const real_t* const delta_g, /**< Step direction of gradient. */ + const real_t* const delta_lb, /**< Step direction of lower bounds. */ + const real_t* const delta_ub, /**< Step direction of upper bounds. */ + const real_t* const delta_xFX, /**< Primal homotopy step direction of fixed variables. */ + const real_t* const delta_xFR, /**< Primal homotopy step direction of free variables. */ + const real_t* const delta_yFX, /**< Dual homotopy step direction of fixed variables' multiplier. */ + int* BC_idx, /**< Output: Index of blocking constraint. */ + SubjectToStatus* BC_status /**< Output: Status of blocking constraint. */ + ); + +/** Updates active set. + * \return SUCCESSFUL_RETURN \n + RET_REMOVE_FROM_ACTIVESET_FAILED \n + RET_ADD_TO_ACTIVESET_FAILED */ +returnValue QProblemB_changeActiveSet( QProblemB* _THIS, + int BC_idx, /**< Index of blocking constraint. */ + SubjectToStatus BC_status /**< Status of blocking constraint. */ + ); + +/** Drift correction at end of each active set iteration + * \return SUCCESSFUL_RETURN */ +returnValue QProblemB_performDriftCorrection( QProblemB* _THIS ); + +/** Determines if it is more efficient to refactorise the matrices when + * hotstarting or not (i.e. better to update the existing factorisations). + * \return BT_TRUE iff matrices shall be refactorised afresh + */ +BooleanType QProblemB_shallRefactorise( QProblemB* _THIS, + Bounds* const guessedBounds /**< Guessed new working set. */ + ); + + +/** Adds a bound to active set (specialised version for the case where no constraints exist). + * \return SUCCESSFUL_RETURN \n + RET_ADDBOUND_FAILED */ +returnValue QProblemB_addBound( QProblemB* _THIS, + int number, /**< Number of bound to be added to active set. */ + SubjectToStatus B_status, /**< Status of new active bound. */ + BooleanType updateCholesky /**< Flag indicating if Cholesky decomposition shall be updated. */ + ); + +/** Removes a bounds from active set (specialised version for the case where no constraints exist). + * \return SUCCESSFUL_RETURN \n + RET_HESSIAN_NOT_SPD \n + RET_REMOVEBOUND_FAILED */ +returnValue QProblemB_removeBound( QProblemB* _THIS, + int number, /**< Number of bound to be removed from active set. */ + BooleanType updateCholesky /**< Flag indicating if Cholesky decomposition shall be updated. */ + ); + + +/** Prints concise information on the current iteration. + * \return SUCCESSFUL_RETURN \n */ +returnValue QProblemB_printIteration( QProblemB* _THIS, + int iter, /**< Number of current iteration. */ + int BC_idx, /**< Index of blocking bound. */ + SubjectToStatus BC_status, /**< Status of blocking bound. */ + real_t homotopyLength, /**< Current homotopy distance. */ + BooleanType isFirstCall /**< Indicating whether this is the first call for current QP. */ + ); + + + +/* + * g e t B o u n d s + */ +static inline returnValue QProblemB_getBounds( QProblemB* _THIS, Bounds* _bounds ) +{ + int nV = QProblemB_getNV( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + _bounds = _THIS->bounds; + + return SUCCESSFUL_RETURN; +} + + +/* + * g e t N V + */ +static inline int QProblemB_getNV( QProblemB* _THIS ) +{ + return Bounds_getNV( _THIS->bounds ); +} + + +/* + * g e t N F R + */ +static inline int QProblemB_getNFR( QProblemB* _THIS ) +{ + return Bounds_getNFR( _THIS->bounds ); +} + + +/* + * g e t N F X + */ +static inline int QProblemB_getNFX( QProblemB* _THIS ) +{ + return Bounds_getNFX( _THIS->bounds ); +} + + +/* + * g e t N F V + */ +static inline int QProblemB_getNFV( QProblemB* _THIS ) +{ + return Bounds_getNFV( _THIS->bounds ); +} + + +/* + * g e t S t a t u s + */ +static inline QProblemStatus QProblemB_getStatus( QProblemB* _THIS ) +{ + return _THIS->status; +} + + +/* + * i s I n i t i a l i s e d + */ +static inline BooleanType QProblemB_isInitialised( QProblemB* _THIS ) +{ + if ( _THIS->status == QPS_NOTINITIALISED ) + return BT_FALSE; + else + return BT_TRUE; +} + + +/* + * i s S o l v e d + */ +static inline BooleanType QProblemB_isSolved( QProblemB* _THIS ) +{ + if ( _THIS->status == QPS_SOLVED ) + return BT_TRUE; + else + return BT_FALSE; +} + + +/* + * i s I n f e a s i b l e + */ +static inline BooleanType QProblemB_isInfeasible( QProblemB* _THIS ) +{ + return _THIS->infeasible; +} + + +/* + * i s U n b o u n d e d + */ +static inline BooleanType QProblemB_isUnbounded( QProblemB* _THIS ) +{ + return _THIS->unbounded; +} + + +/* + * g e t H e s s i a n T y p e + */ +static inline HessianType QProblemB_getHessianType( QProblemB* _THIS ) +{ + return _THIS->hessianType; +} + + +/* + * s e t H e s s i a n T y p e + */ +static inline returnValue QProblemB_setHessianType( QProblemB* _THIS, HessianType _hessianType ) +{ + _THIS->hessianType = _hessianType; + return SUCCESSFUL_RETURN; +} + + +/* + * u s i n g R e g u l a r i s a t i o n + */ +static inline BooleanType QProblemB_usingRegularisation( QProblemB* _THIS ) +{ + if ( _THIS->regVal > QPOASES_ZERO ) + return BT_TRUE; + else + return BT_FALSE; +} + + +/* + * g e t O p t i o n s + */ +static inline Options QProblemB_getOptions( QProblemB* _THIS ) +{ + return _THIS->options; +} + + +/* + * s e t O p t i o n s + */ +static inline returnValue QProblemB_setOptions( QProblemB* _THIS, + Options _options + ) +{ + OptionsCPY( &_options,&(_THIS->options) ); + Options_ensureConsistency( &(_THIS->options) ); + + QProblemB_setPrintLevel( _THIS,_THIS->options.printLevel ); + + return SUCCESSFUL_RETURN; +} + + +/* + * g e t P r i n t L e v e l + */ +static inline PrintLevel QProblemB_getPrintLevel( QProblemB* _THIS ) +{ + return _THIS->options.printLevel; +} + + + +/* + * g e t C o u n t + */ +static inline unsigned int QProblemB_getCount( QProblemB* _THIS ) +{ + return _THIS->count; +} + + +/* + * r e s e t C o u n t e r + */ +static inline returnValue QProblemB_resetCounter( QProblemB* _THIS ) +{ + _THIS->count = 0; + return SUCCESSFUL_RETURN; +} + + + +/***************************************************************************** + * P R O T E C T E D * + *****************************************************************************/ + + +/* + * s e t H + */ +static inline returnValue QProblemB_setHM( QProblemB* _THIS, DenseMatrix* H_new ) +{ + if ( H_new == 0 ) + return QProblemB_setH( _THIS,(real_t*)0 ); + else + return QProblemB_setH( _THIS,DenseMatrix_getVal(H_new) ); +} + + +/* + * s e t H + */ +static inline returnValue QProblemB_setH( QProblemB* _THIS, real_t* const H_new ) +{ + /* if null pointer is passed, Hessian is set to zero matrix + * (or stays identity matrix) */ + if ( H_new == 0 ) + { + if ( _THIS->hessianType == HST_IDENTITY ) + return SUCCESSFUL_RETURN; + + _THIS->hessianType = HST_ZERO; + + _THIS->H = 0; + } + else + { + DenseMatrixCON( _THIS->H,QProblemB_getNV( _THIS ),QProblemB_getNV( _THIS ),QProblemB_getNV( _THIS ),H_new ); + } + + return SUCCESSFUL_RETURN; +} + + +/* + * s e t G + */ +static inline returnValue QProblemB_setG( QProblemB* _THIS, const real_t* const g_new ) +{ + unsigned int nV = (unsigned int)QProblemB_getNV( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( g_new == 0 ) + return THROWERROR( RET_INVALID_ARGUMENTS ); + + memcpy( _THIS->g,g_new,nV*sizeof(real_t) ); + + return SUCCESSFUL_RETURN; +} + + +/* + * s e t L B + */ +static inline returnValue QProblemB_setLB( QProblemB* _THIS, const real_t* const lb_new ) +{ + unsigned int i; + unsigned int nV = (unsigned int)QProblemB_getNV( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( lb_new != 0 ) + { + memcpy( _THIS->lb,lb_new,nV*sizeof(real_t) ); + } + else + { + /* if no lower bounds are specified, set them to -infinity */ + for( i=0; ilb[i] = -QPOASES_INFTY; + } + + return SUCCESSFUL_RETURN; +} + + +/* + * s e t L B + */ +static inline returnValue QProblemB_setLBn( QProblemB* _THIS, int number, real_t value ) +{ + int nV = QProblemB_getNV( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( ( number >= 0 ) && ( number < nV ) ) + { + _THIS->lb[number] = value; + return SUCCESSFUL_RETURN; + } + else + { + return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); + } +} + + +/* + * s e t U B + */ +static inline returnValue QProblemB_setUB( QProblemB* _THIS, const real_t* const ub_new ) +{ + unsigned int i; + unsigned int nV = (unsigned int)QProblemB_getNV( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( ub_new != 0 ) + { + memcpy( _THIS->ub,ub_new,nV*sizeof(real_t) ); + } + else + { + /* if no upper bounds are specified, set them to infinity */ + for( i=0; iub[i] = QPOASES_INFTY; + } + + return SUCCESSFUL_RETURN; +} + + +/* + * s e t U B + */ +static inline returnValue QProblemB_setUBn( QProblemB* _THIS, int number, real_t value ) +{ + int nV = QProblemB_getNV( _THIS ); + + if ( nV == 0 ) + return THROWERROR( RET_QPOBJECT_NOT_SETUP ); + + if ( ( number >= 0 ) && ( number < nV ) ) + { + _THIS->ub[number] = value; + + return SUCCESSFUL_RETURN; + } + else + { + return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); + } +} + + +/* + * c o m p u t e G i v e n s + */ +static inline void QProblemB_computeGivens( real_t xold, real_t yold, + real_t* xnew, real_t* ynew, real_t* c, real_t* s + ) +{ + real_t t, mu; + + if ( fabs( yold ) <= QPOASES_ZERO ) + { + *c = 1.0; + *s = 0.0; + + *xnew = xold; + *ynew = yold; + } + else + { + mu = fabs( xold ); + if ( fabs( yold ) > mu ) + mu = fabs( yold ); + + t = mu * sqrt( (xold/mu)*(xold/mu) + (yold/mu)*(yold/mu) ); + + if ( xold < 0.0 ) + t = -t; + + *c = xold/t; + *s = yold/t; + *xnew = t; + *ynew = 0.0; + } + + return; +} + + +/* + * a p p l y G i v e n s + */ +static inline void QProblemB_applyGivens( real_t c, real_t s, real_t nu, real_t xold, real_t yold, + real_t* xnew, real_t* ynew + ) +{ + #ifdef __USE_THREE_MULTS_GIVENS__ + + /* Givens plane rotation requiring only three multiplications, + * cf. Hammarling, S.: A note on modifications to the givens plane rotation. + * J. Inst. Maths Applics, 13:215-218, 1974. */ + *xnew = xold*c + yold*s; + *ynew = (*xnew+xold)*nu - yold; + + #else + + /* Usual Givens plane rotation requiring four multiplications. */ + *xnew = c*xold + s*yold; + *ynew = -s*xold + c*yold; + + #endif + + return; +} + + +/* + * i s B l o c k i n g + */ +static inline BooleanType QProblemB_isBlocking( QProblemB* _THIS, + real_t num, + real_t den, + real_t epsNum, + real_t epsDen, + real_t* t + ) +{ + if ( ( den >= epsDen ) && ( num >= epsNum ) ) + { + if ( num < (*t)*den ) + return BT_TRUE; + } + + return BT_FALSE; +} + + +END_NAMESPACE_QPOASES + + +#endif /* QPOASES_QPROBLEMB_H */ + + +/* + * end of file + */ diff --git a/third_party/acados/include/qpOASES_e/Types.h b/third_party/acados/include/qpOASES_e/Types.h new file mode 100644 index 000000000..1e452097f --- /dev/null +++ b/third_party/acados/include/qpOASES_e/Types.h @@ -0,0 +1,310 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/Types.h + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + * + * Declaration of all non-built-in types (except for classes). + */ + + +#ifndef QPOASES_TYPES_H +#define QPOASES_TYPES_H + +#ifdef USE_ACADOS_TYPES +#include "acados/utils/types.h" +#endif + +/* If your compiler does not support the snprintf() function, + * uncomment the following line and try to compile again. */ +/* #define __NO_SNPRINTF__ */ + + +/* Uncomment the following line for setting the __DSPACE__ flag. */ +/* #define __DSPACE__ */ + +/* Uncomment the following line for setting the __XPCTARGET__ flag. */ +/* #define __XPCTARGET__ */ + + +/* Uncomment the following line for setting the __NO_FMATH__ flag. */ +/* #define __NO_FMATH__ */ + +/* Uncomment the following line to enable debug information. */ +/* #define __DEBUG__ */ + +/* Uncomment the following line to enable suppress any kind of console output. */ +/* #define __SUPPRESSANYOUTPUT__ */ + + +/** Forces to always include all implicitly fixed bounds and all equality constraints + * into the initial working set when setting up an auxiliary QP. */ +#define __ALWAYS_INITIALISE_WITH_ALL_EQUALITIES__ + +/* Uncomment the following line to activate the use of an alternative Givens + * plane rotation requiring only three multiplications. */ +/* #define __USE_THREE_MULTS_GIVENS__ */ + +/* Uncomment the following line to activate the use of single precision arithmetic. */ +/* #define __USE_SINGLE_PRECISION__ */ + +/* The inline keyword is skipped by default as it is not part of the C90 standard. + * However, by uncommenting the following line, use of the inline keyword can be enforced. */ +/* #define __USE_INLINE__ */ + + +/* Work-around for Borland BCC 5.5 compiler. */ +#ifdef __BORLANDC__ +#if __BORLANDC__ < 0x0561 + #define __STDC__ 1 +#endif +#endif + + +/* Work-around for Microsoft compilers. */ +#ifdef _MSC_VER + #define __NO_SNPRINTF__ + #pragma warning( disable : 4061 4100 4250 4514 4996 ) +#endif + + +/* Apply pre-processor settings when using qpOASES within auto-generated code. */ +#ifdef __CODE_GENERATION__ + #define __NO_COPYRIGHT__ + #define __EXTERNAL_DIMENSIONS__ +#endif /* __CODE_GENERATION__ */ + + +/* Avoid using static variables declaration within functions. */ +#ifdef __NO_STATIC__ + #define myStatic +#else + #define myStatic static +#endif /* __NO_STATIC__ */ + + +/* Skip inline keyword if not specified otherwise. */ +#ifndef __USE_INLINE__ + #define inline +#endif + + +/* Avoid any printing on embedded platforms. */ +#if defined(__DSPACE__) || defined(__XPCTARGET__) + #define __SUPPRESSANYOUTPUT__ + #define __NO_SNPRINTF__ +#endif + + +#ifdef __NO_SNPRINTF__ + #if (!defined(_MSC_VER)) || defined(__DSPACE__) || defined(__XPCTARGET__) + /* If snprintf is not available, provide an empty implementation... */ + int snprintf( char* s, size_t n, const char* format, ... ); + #else + /* ... or substitute snprintf by _snprintf for Microsoft compilers. */ + #define snprintf _snprintf + #endif +#endif /* __NO_SNPRINTF__ */ + + +/** Macro for switching on/off the beginning of the qpOASES namespace definition. */ +#define BEGIN_NAMESPACE_QPOASES + +/** Macro for switching on/off the end of the qpOASES namespace definition. */ +#define END_NAMESPACE_QPOASES + +/** Macro for switching on/off the use of the qpOASES namespace. */ +#define USING_NAMESPACE_QPOASES + +/** Macro for switching on/off references to the qpOASES namespace. */ +#define REFER_NAMESPACE_QPOASES /*::*/ + + +/** Macro for accessing the Cholesky factor R. */ +#define RR( I,J ) _THIS->R[(I)+nV*(J)] + +/** Macro for accessing the orthonormal matrix Q of the QT factorisation. */ +#define QQ( I,J ) _THIS->Q[(I)+nV*(J)] + +/** Macro for accessing the triangular matrix T of the QT factorisation. */ +#define TT( I,J ) _THIS->T[(I)*nVC_min+(J)] + + + +BEGIN_NAMESPACE_QPOASES + + +/** Defines real_t for facilitating switching between double and float. */ + +#ifndef USE_ACADOS_TYPES +#ifndef __CODE_GENERATION__ + + #ifdef __USE_SINGLE_PRECISION__ + typedef float real_t; + #else + typedef double real_t; + #endif /* __USE_SINGLE_PRECISION__ */ + +#endif /* __CODE_GENERATION__ */ +#endif /* USE_ACADOS_TYPES */ + +/** Summarises all possible logical values. */ +typedef enum +{ + BT_FALSE = 0, /**< Logical value for "false". */ + BT_TRUE /**< Logical value for "true". */ +} BooleanType; + + +/** Summarises all possible print levels. Print levels are used to describe + * the desired amount of output during runtime of qpOASES. */ +typedef enum +{ + PL_DEBUG_ITER = -2, /**< Full tabular debugging output. */ + PL_TABULAR, /**< Tabular output. */ + PL_NONE, /**< No output. */ + PL_LOW, /**< Print error messages only. */ + PL_MEDIUM, /**< Print error and warning messages as well as concise info messages. */ + PL_HIGH /**< Print all messages with full details. */ +} PrintLevel; + + +/** Defines visibility status of a message. */ +typedef enum +{ + VS_HIDDEN, /**< Message not visible. */ + VS_VISIBLE /**< Message visible. */ +} VisibilityStatus; + + +/** Summarises all possible states of the (S)QProblem(B) object during the +solution process of a QP sequence. */ +typedef enum +{ + QPS_NOTINITIALISED, /**< QProblem object is freshly instantiated or reset. */ + QPS_PREPARINGAUXILIARYQP, /**< An auxiliary problem is currently setup, either at the very beginning + * via an initial homotopy or after changing the QP matrices. */ + QPS_AUXILIARYQPSOLVED, /**< An auxilary problem was solved, either at the very beginning + * via an initial homotopy or after changing the QP matrices. */ + QPS_PERFORMINGHOMOTOPY, /**< A homotopy according to the main idea of the online active + * set strategy is performed. */ + QPS_HOMOTOPYQPSOLVED, /**< An intermediate QP along the homotopy path was solved. */ + QPS_SOLVED /**< The solution of the actual QP was found. */ +} QProblemStatus; + + +/** Summarises all possible types of the QP's Hessian matrix. */ +typedef enum +{ + HST_ZERO, /**< Hessian is zero matrix (i.e. LP formulation). */ + HST_IDENTITY, /**< Hessian is identity matrix. */ + HST_POSDEF, /**< Hessian is (strictly) positive definite. */ + HST_POSDEF_NULLSPACE, /**< Hessian is positive definite on null space of active bounds/constraints. */ + HST_SEMIDEF, /**< Hessian is positive semi-definite. */ + HST_INDEF, /**< Hessian is indefinite. */ + HST_UNKNOWN /**< Hessian type is unknown. */ +} HessianType; + + +/** Summarises all possible types of bounds and constraints. */ +typedef enum +{ + ST_UNBOUNDED, /**< Bound/constraint is unbounded. */ + ST_BOUNDED, /**< Bound/constraint is bounded but not fixed. */ + ST_EQUALITY, /**< Bound/constraint is fixed (implicit equality bound/constraint). */ + ST_DISABLED, /**< Bound/constraint is disabled (i.e. ignored when solving QP). */ + ST_UNKNOWN /**< Type of bound/constraint unknown. */ +} SubjectToType; + + +/** Summarises all possible states of bounds and constraints. */ +typedef enum +{ + ST_LOWER = -1, /**< Bound/constraint is at its lower bound. */ + ST_INACTIVE, /**< Bound/constraint is inactive. */ + ST_UPPER, /**< Bound/constraint is at its upper bound. */ + ST_INFEASIBLE_LOWER, /**< (to be documented) */ + ST_INFEASIBLE_UPPER, /**< (to be documented) */ + ST_UNDEFINED /**< Status of bound/constraint undefined. */ +} SubjectToStatus; + + +/** + * \brief Stores internal information for tabular (debugging) output. + * + * Struct storing internal information for tabular (debugging) output + * when using the (S)QProblem(B) objects. + * + * \author Hans Joachim Ferreau + * \version 3.1embedded + * \date 2013-2015 + */ +typedef struct +{ + int idxAddB; /**< Index of bound that has been added to working set. */ + int idxRemB; /**< Index of bound that has been removed from working set. */ + int idxAddC; /**< Index of constraint that has been added to working set. */ + int idxRemC; /**< Index of constraint that has been removed from working set. */ + int excAddB; /**< Flag indicating whether a bound has been added to working set to keep a regular projected Hessian. */ + int excRemB; /**< Flag indicating whether a bound has been removed from working set to keep a regular projected Hessian. */ + int excAddC; /**< Flag indicating whether a constraint has been added to working set to keep a regular projected Hessian. */ + int excRemC; /**< Flag indicating whether a constraint has been removed from working set to keep a regular projected Hessian. */ +} TabularOutput; + +/** + * \brief Struct containing the variable header for mat file. + * + * Struct storing the header of a variable to be stored in + * Matlab's binary format (using the outdated Level 4 variant + * for simplictiy). + * + * Note, this code snippet has been inspired from the document + * "Matlab(R) MAT-file Format, R2013b" by MathWorks + * + * \author Hans Joachim Ferreau + * \version 3.1embedded + * \date 2013-2015 + */ +typedef struct +{ + long numericFormat; /**< Flag indicating numerical format. */ + long nRows; /**< Number of rows. */ + long nCols; /**< Number of rows. */ + long imaginaryPart; /**< (to be documented) */ + long nCharName; /**< Number of character in name. */ +} MatMatrixHeader; + + +END_NAMESPACE_QPOASES + + +#endif /* QPOASES_TYPES_H */ + + +/* + * end of file + */ diff --git a/third_party/acados/include/qpOASES_e/UnitTesting.h b/third_party/acados/include/qpOASES_e/UnitTesting.h new file mode 100644 index 000000000..3fb31129a --- /dev/null +++ b/third_party/acados/include/qpOASES_e/UnitTesting.h @@ -0,0 +1,79 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/UnitTesting.h + * \author Hans Joachim Ferreau + * \version 3.1embedded + * \date 2014-2015 + * + * Definition of auxiliary functions/macros for unit testing. + */ + + +#ifndef QPOASES_UNIT_TESTING_H +#define QPOASES_UNIT_TESTING_H + + +#ifndef TEST_TOL_FACTOR +#define TEST_TOL_FACTOR 1 +#endif + + +/** Return value for tests that passed. */ +#define TEST_PASSED 0 + +/** Return value for tests that failed. */ +#define TEST_FAILED 1 + +/** Return value for tests that could not run due to missing external data. */ +#define TEST_DATA_NOT_FOUND 99 + + +/** Macro verifying that two numerical values are equal in order to pass unit test. */ +#define QPOASES_TEST_FOR_EQUAL( x,y ) if ( REFER_NAMESPACE_QPOASES isEqual( (x),(y) ) == BT_FALSE ) { return TEST_FAILED; } + +/** Macro verifying that two numerical values are close to each other in order to pass unit test. */ +#define QPOASES_TEST_FOR_NEAR( x,y ) if ( REFER_NAMESPACE_QPOASES getAbs((x)-(y)) / REFER_NAMESPACE_QPOASES getMax( 1.0,REFER_NAMESPACE_QPOASES getAbs(x) ) >= 1e-10 ) { return TEST_FAILED; } + +/** Macro verifying that first quantity is lower or equal than second one in order to pass unit test. */ +#define QPOASES_TEST_FOR_TOL( x,tol ) if ( (x) > (tol)*(TEST_TOL_FACTOR) ) { return TEST_FAILED; } + +/** Macro verifying that a logical expression holds in order to pass unit test. */ +#define QPOASES_TEST_FOR_TRUE( x ) if ( (x) == 0 ) { return TEST_FAILED; } + + + +BEGIN_NAMESPACE_QPOASES + + +END_NAMESPACE_QPOASES + + +#endif /* QPOASES_UNIT_TESTING_H */ + + +/* + * end of file + */ diff --git a/third_party/acados/include/qpOASES_e/Utils.h b/third_party/acados/include/qpOASES_e/Utils.h new file mode 100644 index 000000000..75e45a56a --- /dev/null +++ b/third_party/acados/include/qpOASES_e/Utils.h @@ -0,0 +1,500 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/Utils.h + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + * + * Declaration of some utilities for working with the different QProblem classes. + */ + + +#ifndef QPOASES_UTILS_H +#define QPOASES_UTILS_H + +#include + + +BEGIN_NAMESPACE_QPOASES + + +/** Prints a vector. + * \return SUCCESSFUL_RETURN */ +returnValue qpOASES_printV( const real_t* const v, /**< Vector to be printed. */ + int n /**< Length of vector. */ + ); + +/** Prints a permuted vector. + * \return SUCCESSFUL_RETURN */ +returnValue qpOASES_printPV( const real_t* const v, /**< Vector to be printed. */ + int n, /**< Length of vector. */ + const int* const V_idx /**< Pemutation vector. */ + ); + +/** Prints a named vector. + * \return SUCCESSFUL_RETURN */ +returnValue qpOASES_printNV( const real_t* const v, /**< Vector to be printed. */ + int n, /**< Length of vector. */ + const char* name /** Name of vector. */ + ); + +/** Prints a matrix. + * \return SUCCESSFUL_RETURN */ +returnValue qpOASES_printM( const real_t* const M, /**< Matrix to be printed. */ + int nrow, /**< Row number of matrix. */ + int ncol /**< Column number of matrix. */ + ); + +/** Prints a permuted matrix. + * \return SUCCESSFUL_RETURN */ +returnValue qpOASES_printPM( const real_t* const M, /**< Matrix to be printed. */ + int nrow, /**< Row number of matrix. */ + int ncol , /**< Column number of matrix. */ + const int* const ROW_idx, /**< Row pemutation vector. */ + const int* const COL_idx /**< Column pemutation vector. */ + ); + +/** Prints a named matrix. + * \return SUCCESSFUL_RETURN */ +returnValue qpOASES_printNM( const real_t* const M, /**< Matrix to be printed. */ + int nrow, /**< Row number of matrix. */ + int ncol, /**< Column number of matrix. */ + const char* name /** Name of matrix. */ + ); + +/** Prints an index array. + * \return SUCCESSFUL_RETURN */ +returnValue qpOASES_printI( const int* const _index, /**< Index array to be printed. */ + int n /**< Length of index array. */ + ); + +/** Prints a named index array. + * \return SUCCESSFUL_RETURN */ +returnValue qpOASES_printNI( const int* const _index, /**< Index array to be printed. */ + int n, /**< Length of index array. */ + const char* name /**< Name of index array. */ + ); + + +/** Prints a string to desired output target (useful also for MATLAB output!). + * \return SUCCESSFUL_RETURN */ +returnValue qpOASES_myPrintf( const char* s /**< String to be written. */ + ); + + +/** Prints qpOASES copyright notice. + * \return SUCCESSFUL_RETURN */ +returnValue qpOASES_printCopyrightNotice( ); + + +/** Reads a real_t matrix from file. + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_OPEN_FILE \n + RET_UNABLE_TO_READ_FILE */ +returnValue qpOASES_readFromFileM( real_t* data, /**< Matrix to be read from file. */ + int nrow, /**< Row number of matrix. */ + int ncol, /**< Column number of matrix. */ + const char* datafilename /**< Data file name. */ + ); + +/** Reads a real_t vector from file. + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_OPEN_FILE \n + RET_UNABLE_TO_READ_FILE */ +returnValue qpOASES_readFromFileV( real_t* data, /**< Vector to be read from file. */ + int n, /**< Length of vector. */ + const char* datafilename /**< Data file name. */ + ); + +/** Reads an integer (column) vector from file. + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_OPEN_FILE \n + RET_UNABLE_TO_READ_FILE */ +returnValue qpOASES_readFromFileI( int* data, /**< Vector to be read from file. */ + int n, /**< Length of vector. */ + const char* datafilename /**< Data file name. */ + ); + + +/** Writes a real_t matrix into a file. + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_OPEN_FILE */ +returnValue qpOASES_writeIntoFileM( const real_t* const data, /**< Matrix to be written into file. */ + int nrow, /**< Row number of matrix. */ + int ncol, /**< Column number of matrix. */ + const char* datafilename, /**< Data file name. */ + BooleanType append /**< Indicates if data shall be appended if the file already exists (otherwise it is overwritten). */ + ); + +/** Writes a real_t vector into a file. + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_OPEN_FILE */ +returnValue qpOASES_writeIntoFileV( const real_t* const data, /**< Vector to be written into file. */ + int n, /**< Length of vector. */ + const char* datafilename, /**< Data file name. */ + BooleanType append /**< Indicates if data shall be appended if the file already exists (otherwise it is overwritten). */ + ); + +/** Writes an integer (column) vector into a file. + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_OPEN_FILE */ +returnValue qpOASES_writeIntoFileI( const int* const integer, /**< Integer vector to be written into file. */ + int n, /**< Length of vector. */ + const char* datafilename, /**< Data file name. */ + BooleanType append /**< Indicates if integer shall be appended if the file already exists (otherwise it is overwritten). */ + ); + +/** Writes a real_t matrix/vector into a Matlab binary file. + * \return SUCCESSFUL_RETURN \n + RET_INVALID_ARGUMENTS + RET_UNABLE_TO_WRITE_FILE */ +returnValue qpOASES_writeIntoMatFile( FILE* const matFile, /**< Pointer to Matlab binary file. */ + const real_t* const data, /**< Data to be written into file. */ + int nRows, /**< Row number of matrix. */ + int nCols, /**< Column number of matrix. */ + const char* name /**< Matlab name of matrix/vector to be stored. */ + ); + +/** Writes in integer matrix/vector into a Matlab binary file. + * \return SUCCESSFUL_RETURN \n + RET_INVALID_ARGUMENTS + RET_UNABLE_TO_WRITE_FILE */ +returnValue qpOASES_writeIntoMatFileI( FILE* const matFile, /**< Pointer to Matlab binary file. */ + const int* const data, /**< Data to be written into file. */ + int nRows, /**< Row number of matrix. */ + int nCols, /**< Column number of matrix. */ + const char* name /**< Matlab name of matrix/vector to be stored. */ + ); + + +/** Returns the current system time. + * \return current system time */ +real_t qpOASES_getCPUtime( ); + + +/** Returns the N-norm of a vector. + * \return >= 0.0: successful */ +real_t qpOASES_getNorm( const real_t* const v, /**< Vector. */ + int n, /**< Vector's dimension. */ + int type /**< Norm type, 1: one-norm, 2: Euclidean norm. */ + ); + +/** Tests whether two real-valued arguments are (numerically) equal. + * \return BT_TRUE: arguments differ not more than TOL \n + BT_FALSE: arguments differ more than TOL */ +static inline BooleanType qpOASES_isEqual( real_t x, /**< First real number. */ + real_t y, /**< Second real number. */ + real_t TOL /**< Tolerance for comparison. */ + ); + + +/** Tests whether a real-valued argument is (numerically) zero. + * \return BT_TRUE: argument differs from 0.0 not more than TOL \n + BT_FALSE: argument differs from 0.0 more than TOL */ +static inline BooleanType qpOASES_isZero( real_t x, /**< Real number. */ + real_t TOL /**< Tolerance for comparison. */ + ); + + +/** Returns sign of a real-valued argument. + * \return 1.0: argument is non-negative \n + -1.0: argument is negative */ +static inline real_t qpOASES_getSign( real_t arg /**< real-valued argument whose sign is to be determined. */ + ); + + +/** Returns maximum of two integers. + * \return Maximum of two integers */ +static inline int qpOASES_getMaxI( int x, /**< First integer. */ + int y /**< Second integer. */ + ); + + +/** Returns minimum of two integers. + * \return Minimum of two integers */ +static inline int qpOASES_getMinI( int x, /**< First integer. */ + int y /**< Second integer. */ + ); + + +/** Returns maximum of two reals. + * \return Maximum of two reals */ +static inline real_t qpOASES_getMax( real_t x, /**< First real number. */ + real_t y /**< Second real number. */ + ); + + +/** Returns minimum of two reals. + * \return Minimum of two reals */ +static inline real_t qpOASES_getMin( real_t x, /**< First real number. */ + real_t y /**< Second real number. */ + ); + + +/** Returns the absolute value of a real_t-valued argument. + * \return Absolute value of a real_t-valued argument */ +static inline real_t qpOASES_getAbs( real_t x /**< real_t-valued argument. */ + ); + +/** Returns the square-root of a real number. + * \return Square-root of a real number */ +static inline real_t qpOASES_getSqrt( real_t x /**< Non-negative real number. */ + ); + + +/** Computes the maximum violation of the KKT optimality conditions + * of given iterate for given QP data. */ +returnValue qpOASES_getKktViolation( int nV, /**< Number of variables. */ + int nC, /**< Number of constraints. */ + const real_t* const H, /**< Hessian matrix (may be NULL if Hessian is zero or identity matrix). */ + const real_t* const g, /**< Gradient vector. */ + const real_t* const A, /**< Constraint matrix. */ + const real_t* const lb, /**< Lower bound vector (on variables). */ + const real_t* const ub, /**< Upper bound vector (on variables). */ + const real_t* const lbA, /**< Lower constraints' bound vector. */ + const real_t* const ubA, /**< Upper constraints' bound vector. */ + const real_t* const x, /**< Primal trial vector. */ + const real_t* const y, /**< Dual trial vector. */ + real_t* const _stat, /**< Output: maximum value of stationarity condition residual. */ + real_t* const feas, /**< Output: maximum value of primal feasibility violation. */ + real_t* const cmpl /**< Output: maximum value of complementarity residual. */ + ); + +/** Computes the maximum violation of the KKT optimality conditions + * of given iterate for given QP data. */ +returnValue qpOASES_getKktViolationSB( int nV, /**< Number of variables. */ + const real_t* const H, /**< Hessian matrix (may be NULL if Hessian is zero or identity matrix). */ + const real_t* const g, /**< Gradient vector. */ + const real_t* const lb, /**< Lower bound vector (on variables). */ + const real_t* const ub, /**< Upper bound vector (on variables). */ + const real_t* const x, /**< Primal trial vector. */ + const real_t* const y, /**< Dual trial vector. */ + real_t* const _stat, /**< Output: maximum value of stationarity condition residual. */ + real_t* const feas, /**< Output: maximum value of primal feasibility violation. */ + real_t* const cmpl /**< Output: maximum value of complementarity residual. */ + ); + + +/** Writes a value of BooleanType into a string. + * \return SUCCESSFUL_RETURN */ +returnValue qpOASES_convertBooleanTypeToString( BooleanType value, /**< Value to be written. */ + char* const string /**< Input: String of sufficient size, \n + Output: String containing value. */ + ); + +/** Writes a value of SubjectToStatus into a string. + * \return SUCCESSFUL_RETURN */ +returnValue qpOASES_convertSubjectToStatusToString( SubjectToStatus value, /**< Value to be written. */ + char* const string /**< Input: String of sufficient size, \n + Output: String containing value. */ + ); + +/** Writes a value of PrintLevel into a string. + * \return SUCCESSFUL_RETURN */ +returnValue qpOASES_convertPrintLevelToString( PrintLevel value, /**< Value to be written. */ + char* const string /**< Input: String of sufficient size, \n + Output: String containing value. */ + ); + + +/** Converts a returnValue from an QProblem(B) object into a more + * simple status flag. + * + * \return 0: QP problem solved + * 1: QP could not be solved within given number of iterations + * -1: QP could not be solved due to an internal error + * -2: QP is infeasible (and thus could not be solved) + * -3: QP is unbounded (and thus could not be solved) + */ +int qpOASES_getSimpleStatus( returnValue returnvalue, /**< ReturnValue to be analysed. */ + BooleanType doPrintStatus /**< Flag indicating whether simple status shall be printed to screen. */ + ); + +/** Normalises QP constraints. + * \return SUCCESSFUL_RETURN \n + * RET_INVALID_ARGUMENTS */ +returnValue qpOASES_normaliseConstraints( int nV, /**< Number of variables. */ + int nC, /**< Number of constraints. */ + real_t* A, /**< Input: Constraint matrix, \n + Output: Normalised constraint matrix. */ + real_t* lbA, /**< Input: Constraints' lower bound vector, \n + Output: Normalised constraints' lower bound vector. */ + real_t* ubA, /**< Input: Constraints' upper bound vector, \n + Output: Normalised constraints' upper bound vector. */ + int type /**< Norm type, 1: one-norm, 2: Euclidean norm. */ + ); + + +#ifdef __DEBUG__ +/** Writes matrix with given dimension into specified file. */ +void gdb_printmat( const char *fname, /**< File name. */ + real_t *M, /**< Matrix to be written. */ + int n, /**< Number of rows. */ + int m, /**< Number of columns. */ + int ldim /**< Leading dimension. */ + ); +#endif /* __DEBUG__ */ + + +#if defined(__DSPACE__) || defined(__XPCTARGET__) +void __cxa_pure_virtual( void ); +#endif /* __DSPACE__ || __XPCTARGET__*/ + + + +/* + * i s E q u a l + */ +static inline BooleanType qpOASES_isEqual( real_t x, + real_t y, + real_t TOL + ) +{ + if ( qpOASES_getAbs(x-y) <= TOL ) + return BT_TRUE; + else + return BT_FALSE; +} + + +/* + * i s Z e r o + */ +static inline BooleanType qpOASES_isZero( real_t x, + real_t TOL + ) +{ + if ( qpOASES_getAbs(x) <= TOL ) + return BT_TRUE; + else + return BT_FALSE; +} + + +/* + * g e t S i g n + */ +static inline real_t qpOASES_getSign( real_t arg + ) +{ + if ( arg >= 0.0 ) + return 1.0; + else + return -1.0; +} + + + +/* + * g e t M a x + */ +static inline int qpOASES_getMaxI( int x, + int y + ) +{ + return (yx) ? x : y; +} + + +/* + * g e t M a x + */ +static inline real_t qpOASES_getMax( real_t x, + real_t y + ) +{ + #ifdef __NO_FMATH__ + return (yx) ? x : y; + #else + return (y>x) ? x : y; + /*return fmin(x,y); seems to be slower */ + #endif +} + + +/* + * g e t A b s + */ +static inline real_t qpOASES_getAbs( real_t x + ) +{ + #ifdef __NO_FMATH__ + return (x>=0.0) ? x : -x; + #else + return fabs(x); + #endif +} + +/* + * g e t S q r t + */ +static inline real_t qpOASES_getSqrt( real_t x + ) +{ + #ifdef __NO_FMATH__ + return sqrt(x); /* put your custom sqrt-replacement here */ + #else + return sqrt(x); + #endif +} + + +END_NAMESPACE_QPOASES + + +#endif /* QPOASES_UTILS_H */ + + +/* + * end of file + */ diff --git a/third_party/acados/include/qpOASES_e/extras/OQPinterface.h b/third_party/acados/include/qpOASES_e/extras/OQPinterface.h new file mode 100644 index 000000000..da59ea9db --- /dev/null +++ b/third_party/acados/include/qpOASES_e/extras/OQPinterface.h @@ -0,0 +1,227 @@ +/* + * This file is part of qpOASES. + * + * qpOASES -- An Implementation of the Online Active Set Strategy. + * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, + * Christian Kirches et al. All rights reserved. + * + * qpOASES 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. + * + * qpOASES 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 qpOASES; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +/** + * \file include/qpOASES_e/extras/OQPinterface.h + * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches + * \version 3.1embedded + * \date 2007-2015 + * + * Declaration of an interface comprising several utility functions + * for solving test problems from the Online QP Benchmark Collection + * (This collection is no longer maintained, see + * http://www.qpOASES.org/onlineQP for a backup). + */ + + +#ifndef QPOASES_OQPINTERFACE_H +#define QPOASES_OQPINTERFACE_H + + +#include +#include + +#include +#include + + +BEGIN_NAMESPACE_QPOASES + +typedef struct { + QProblem *qp; + + DenseMatrix *H; + DenseMatrix *A; + + real_t *x; + real_t *y; +} OQPbenchmark_ws; + +int OQPbenchmark_ws_calculateMemorySize( unsigned int nV, unsigned int nC ); + +char *OQPbenchmark_ws_assignMemory( unsigned int nV, unsigned int nC, OQPbenchmark_ws **mem, void *raw_memory ); + +OQPbenchmark_ws *OQPbenchmark_ws_createMemory( unsigned int nV, unsigned int nC ); + +typedef struct { + QProblemB *qp; + + DenseMatrix *H; + + real_t *x; + real_t *y; +} OQPbenchmarkB_ws; + +int OQPbenchmarkB_ws_calculateMemorySize( unsigned int nV ); + +char *OQPbenchmarkB_ws_assignMemory( unsigned int nV, OQPbenchmarkB_ws **mem, void *raw_memory ); + +OQPbenchmarkB_ws *OQPbenchmarkB_ws_createMemory( unsigned int nV ); + +typedef struct { + OQPbenchmark_ws *qp_ws; + OQPbenchmarkB_ws *qpB_ws; + + real_t *H; + real_t *g; + real_t *A; + real_t *lb; + real_t *ub; + real_t *lbA; + real_t *ubA; +} OQPinterface_ws; + +int OQPinterface_ws_calculateMemorySize( unsigned int nV, unsigned int nC, unsigned int nQP ); + +char *OQPinterface_ws_assignMemory( unsigned int nV, unsigned int nC, unsigned int nQP, OQPinterface_ws **mem, void *raw_memory ); + +OQPinterface_ws *OQPinterface_ws_createMemory( unsigned int nV, unsigned int nC, unsigned int nQP ); + +/** Reads dimensions of an Online QP Benchmark problem from file. + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_READ_FILE \n + RET_FILEDATA_INCONSISTENT */ +returnValue readOQPdimensions( const char* path, /**< Full path of the data files (without trailing slash!). */ + int* nQP, /**< Output: Number of QPs. */ + int* nV, /**< Output: Number of variables. */ + int* nC, /**< Output: Number of constraints. */ + int* nEC /**< Output: Number of equality constraints. */ + ); + +/** Reads data of an Online QP Benchmark problem from file. + * This function allocates the required memory for all data; after successfully calling it, + * you have to free this memory yourself! + * \return SUCCESSFUL_RETURN \n + RET_INVALID_ARGUMENTS \n + RET_UNABLE_TO_READ_FILE \n + RET_FILEDATA_INCONSISTENT */ +returnValue readOQPdata( const char* path, /**< Full path of the data files (without trailing slash!). */ + int* nQP, /**< Output: Number of QPs. */ + int* nV, /**< Output: Number of variables. */ + int* nC, /**< Output: Number of constraints. */ + int* nEC, /**< Output: Number of equality constraints. */ + real_t* H, /**< Output: Hessian matrix. */ + real_t* g, /**< Output: Sequence of gradient vectors. */ + real_t* A, /**< Output: Constraint matrix. */ + real_t* lb, /**< Output: Sequence of lower bound vectors (on variables). */ + real_t* ub, /**< Output: Sequence of upper bound vectors (on variables). */ + real_t* lbA, /**< Output: Sequence of lower constraints' bound vectors. */ + real_t* ubA, /**< Output: Sequence of upper constraints' bound vectors. */ + real_t* xOpt, /**< Output: Sequence of primal solution vectors + * (not read if a null pointer is passed). */ + real_t* yOpt, /**< Output: Sequence of dual solution vectors + * (not read if a null pointer is passed). */ + real_t* objOpt /**< Output: Sequence of optimal objective function values + * (not read if a null pointer is passed). */ + ); + + +/** Solves an Online QP Benchmark problem as specified by the arguments. + * The maximum deviations from the given optimal solution as well as the + * maximum CPU time to solve each QP are determined. + * \return SUCCESSFUL_RETURN \n + RET_BENCHMARK_ABORTED */ +returnValue solveOQPbenchmark( int nQP, /**< Number of QPs. */ + int nV, /**< Number of variables. */ + int nC, /**< Number of constraints. */ + int nEC, /**< Number of equality constraints. */ + real_t* _H, /**< Hessian matrix. */ + const real_t* const g, /**< Sequence of gradient vectors. */ + real_t* _A, /**< Constraint matrix. */ + const real_t* const lb, /**< Sequence of lower bound vectors (on variables). */ + const real_t* const ub, /**< Sequence of upper bound vectors (on variables). */ + const real_t* const lbA, /**< Sequence of lower constraints' bound vectors. */ + const real_t* const ubA, /**< Sequence of upper constraints' bound vectors. */ + BooleanType isSparse, /**< Shall convert matrices to sparse format before solution? */ + BooleanType useHotstarts, /**< Shall QP solution be hotstarted? */ + const Options* options, /**< QP solver options to be used while solving benchmark problems. */ + int maxAllowedNWSR, /**< Maximum number of working set recalculations to be performed. */ + real_t* maxNWSR, /**< Output: Maximum number of performed working set recalculations. */ + real_t* avgNWSR, /**< Output: Average number of performed working set recalculations. */ + real_t* maxCPUtime, /**< Output: Maximum CPU time required for solving each QP. */ + real_t* avgCPUtime, /**< Output: Average CPU time required for solving each QP. */ + real_t* maxStationarity, /**< Output: Maximum residual of stationarity condition. */ + real_t* maxFeasibility, /**< Output: Maximum residual of primal feasibility condition. */ + real_t* maxComplementarity, /**< Output: Maximum residual of complementarity condition. */ + OQPbenchmark_ws *work /**< Workspace. */ + ); + +/** Solves an Online QP Benchmark problem (without constraints) as specified + * by the arguments. The maximum deviations from the given optimal solution + * as well as the maximum CPU time to solve each QP are determined. + * \return SUCCESSFUL_RETURN \n + RET_BENCHMARK_ABORTED */ +returnValue solveOQPbenchmarkB( int nQP, /**< Number of QPs. */ + int nV, /**< Number of variables. */ + real_t* _H, /**< Hessian matrix. */ + const real_t* const g, /**< Sequence of gradient vectors. */ + const real_t* const lb, /**< Sequence of lower bound vectors (on variables). */ + const real_t* const ub, /**< Sequence of upper bound vectors (on variables). */ + BooleanType isSparse, /**< Shall convert matrices to sparse format before solution? */ + BooleanType useHotstarts, /**< Shall QP solution be hotstarted? */ + const Options* options, /**< QP solver options to be used while solving benchmark problems. */ + int maxAllowedNWSR, /**< Maximum number of working set recalculations to be performed. */ + real_t* maxNWSR, /**< Output: Maximum number of performed working set recalculations. */ + real_t* avgNWSR, /**< Output: Average number of performed working set recalculations. */ + real_t* maxCPUtime, /**< Output: Maximum CPU time required for solving each QP. */ + real_t* avgCPUtime, /**< Output: Average CPU time required for solving each QP. */ + real_t* maxStationarity, /**< Output: Maximum residual of stationarity condition. */ + real_t* maxFeasibility, /**< Output: Maximum residual of primal feasibility condition. */ + real_t* maxComplementarity, /**< Output: Maximum residual of complementarity condition. */ + OQPbenchmarkB_ws *work /**< Workspace. */ + ); + + +/** Runs an Online QP Benchmark problem and determines the maximum + * violation of the KKT optimality conditions as well as the + * maximum and average number of iterations and CPU time to solve + * each QP. + * + * \return SUCCESSFUL_RETURN \n + RET_UNABLE_TO_READ_BENCHMARK \n + RET_BENCHMARK_ABORTED */ +returnValue runOQPbenchmark( const char* path, /**< Full path of the benchmark files (without trailing slash!). */ + BooleanType isSparse, /**< Shall convert matrices to sparse format before solution? */ + BooleanType useHotstarts, /**< Shall QP solution be hotstarted? */ + const Options* options, /**< QP solver options to be used while solving benchmark problems. */ + int maxAllowedNWSR, /**< Maximum number of working set recalculations to be performed. */ + real_t* maxNWSR, /**< Output: Maximum number of performed working set recalculations. */ + real_t* avgNWSR, /**< Output: Average number of performed working set recalculations. */ + real_t* maxCPUtime, /**< Output: Maximum CPU time required for solving each QP. */ + real_t* avgCPUtime, /**< Output: Average CPU time required for solving each QP. */ + real_t* maxStationarity, /**< Output: Maximum residual of stationarity condition. */ + real_t* maxFeasibility, /**< Output: Maximum residual of primal feasibility condition. */ + real_t* maxComplementarity, /**< Output: Maximum residual of complementarity condition. */ + OQPinterface_ws* work /**< Workspace. */ + ); + +END_NAMESPACE_QPOASES + + +#endif /* QPOASES_OQPINTERFACE_H */ + + +/* + * end of file + */ diff --git a/third_party/acados/larch64/lib/libacados.so b/third_party/acados/larch64/lib/libacados.so new file mode 100644 index 000000000..1f2b1f5c0 Binary files /dev/null and b/third_party/acados/larch64/lib/libacados.so differ diff --git a/third_party/acados/larch64/lib/libblasfeo.so b/third_party/acados/larch64/lib/libblasfeo.so new file mode 100644 index 000000000..790282fa1 Binary files /dev/null and b/third_party/acados/larch64/lib/libblasfeo.so differ diff --git a/third_party/acados/larch64/lib/libhpipm.so b/third_party/acados/larch64/lib/libhpipm.so new file mode 100644 index 000000000..bebd5e891 Binary files /dev/null and b/third_party/acados/larch64/lib/libhpipm.so differ diff --git a/third_party/acados/larch64/lib/libqpOASES_e.so b/third_party/acados/larch64/lib/libqpOASES_e.so new file mode 120000 index 000000000..14048625a --- /dev/null +++ b/third_party/acados/larch64/lib/libqpOASES_e.so @@ -0,0 +1 @@ +libqpOASES_e.so.3.1 \ No newline at end of file diff --git a/third_party/acados/larch64/lib/libqpOASES_e.so.3.1 b/third_party/acados/larch64/lib/libqpOASES_e.so.3.1 new file mode 100644 index 000000000..0611c8a93 Binary files /dev/null and b/third_party/acados/larch64/lib/libqpOASES_e.so.3.1 differ diff --git a/third_party/acados/larch64/t_renderer b/third_party/acados/larch64/t_renderer new file mode 100755 index 000000000..b4ff8bc31 Binary files /dev/null and b/third_party/acados/larch64/t_renderer differ diff --git a/third_party/acados/x86_64/lib/libacados.so b/third_party/acados/x86_64/lib/libacados.so new file mode 100644 index 000000000..00a5e2371 Binary files /dev/null and b/third_party/acados/x86_64/lib/libacados.so differ diff --git a/third_party/acados/x86_64/lib/libblasfeo.so b/third_party/acados/x86_64/lib/libblasfeo.so new file mode 100644 index 000000000..5a8399287 Binary files /dev/null and b/third_party/acados/x86_64/lib/libblasfeo.so differ diff --git a/third_party/acados/x86_64/lib/libhpipm.so b/third_party/acados/x86_64/lib/libhpipm.so new file mode 100644 index 000000000..f52091d93 Binary files /dev/null and b/third_party/acados/x86_64/lib/libhpipm.so differ diff --git a/third_party/acados/x86_64/lib/libqpOASES_e.so b/third_party/acados/x86_64/lib/libqpOASES_e.so new file mode 120000 index 000000000..14048625a --- /dev/null +++ b/third_party/acados/x86_64/lib/libqpOASES_e.so @@ -0,0 +1 @@ +libqpOASES_e.so.3.1 \ No newline at end of file diff --git a/third_party/acados/x86_64/lib/libqpOASES_e.so.3.1 b/third_party/acados/x86_64/lib/libqpOASES_e.so.3.1 new file mode 100644 index 000000000..6b553554f Binary files /dev/null and b/third_party/acados/x86_64/lib/libqpOASES_e.so.3.1 differ diff --git a/third_party/acados/x86_64/t_renderer b/third_party/acados/x86_64/t_renderer new file mode 100755 index 000000000..181ef9c3d Binary files /dev/null and b/third_party/acados/x86_64/t_renderer differ diff --git a/third_party/android_frameworks_native/get.txt b/third_party/android_frameworks_native/get.txt new file mode 100644 index 000000000..277bdcb6a --- /dev/null +++ b/third_party/android_frameworks_native/get.txt @@ -0,0 +1,3 @@ +git clone https://github.com/CyanogenMod/android_frameworks_native.git && cd android_frameworks_native +git reset --hard b22bca465e55618a949d9cbdea665a1a3a831241 +cp -r include ~/one/third_party/android_frameworks_native/ diff --git a/third_party/android_frameworks_native/include/android/asset_manager.h b/third_party/android_frameworks_native/include/android/asset_manager.h new file mode 100644 index 000000000..d65483968 --- /dev/null +++ b/third_party/android_frameworks_native/include/android/asset_manager.h @@ -0,0 +1,215 @@ +/* + * Copyright (C) 2010 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. + */ + +/** + * @addtogroup Asset + * @{ + */ + +/** + * @file asset_manager.h + */ + +#ifndef ANDROID_ASSET_MANAGER_H +#define ANDROID_ASSET_MANAGER_H + +#ifdef __cplusplus +extern "C" { +#endif + +struct AAssetManager; +/** + * {@link AAssetManager} provides access to an application's raw assets by + * creating {@link AAsset} objects. + * + * AAssetManager is a wrapper to the low-level native implementation + * of the java {@link AAssetManager}, a pointer can be obtained using + * AAssetManager_fromJava(). + * + * The asset hierarchy may be examined like a filesystem, using + * {@link AAssetDir} objects to peruse a single directory. + * + * A native {@link AAssetManager} pointer may be shared across multiple threads. + */ +typedef struct AAssetManager AAssetManager; + +struct AAssetDir; +/** + * {@link AAssetDir} provides access to a chunk of the asset hierarchy as if + * it were a single directory. The contents are populated by the + * {@link AAssetManager}. + * + * The list of files will be sorted in ascending order by ASCII value. + */ +typedef struct AAssetDir AAssetDir; + +struct AAsset; +/** + * {@link AAsset} provides access to a read-only asset. + * + * {@link AAsset} objects are NOT thread-safe, and should not be shared across + * threads. + */ +typedef struct AAsset AAsset; + +/** Available access modes for opening assets with {@link AAssetManager_open} */ +enum { + /** No specific information about how data will be accessed. **/ + AASSET_MODE_UNKNOWN = 0, + /** Read chunks, and seek forward and backward. */ + AASSET_MODE_RANDOM = 1, + /** Read sequentially, with an occasional forward seek. */ + AASSET_MODE_STREAMING = 2, + /** Caller plans to ask for a read-only buffer with all data. */ + AASSET_MODE_BUFFER = 3 +}; + + +/** + * Open the named directory within the asset hierarchy. The directory can then + * be inspected with the AAssetDir functions. To open the top-level directory, + * pass in "" as the dirName. + * + * The object returned here should be freed by calling AAssetDir_close(). + */ +AAssetDir* AAssetManager_openDir(AAssetManager* mgr, const char* dirName); + +/** + * Open an asset. + * + * The object returned here should be freed by calling AAsset_close(). + */ +AAsset* AAssetManager_open(AAssetManager* mgr, const char* filename, int mode); + +/** + * Iterate over the files in an asset directory. A NULL string is returned + * when all the file names have been returned. + * + * The returned file name is suitable for passing to AAssetManager_open(). + * + * The string returned here is owned by the AssetDir implementation and is not + * guaranteed to remain valid if any other calls are made on this AAssetDir + * instance. + */ +const char* AAssetDir_getNextFileName(AAssetDir* assetDir); + +/** + * Reset the iteration state of AAssetDir_getNextFileName() to the beginning. + */ +void AAssetDir_rewind(AAssetDir* assetDir); + +/** + * Close an opened AAssetDir, freeing any related resources. + */ +void AAssetDir_close(AAssetDir* assetDir); + +/** + * Attempt to read 'count' bytes of data from the current offset. + * + * Returns the number of bytes read, zero on EOF, or < 0 on error. + */ +int AAsset_read(AAsset* asset, void* buf, size_t count); + +/** + * Seek to the specified offset within the asset data. 'whence' uses the + * same constants as lseek()/fseek(). + * + * Returns the new position on success, or (off_t) -1 on error. + */ +off_t AAsset_seek(AAsset* asset, off_t offset, int whence); + +/** + * Seek to the specified offset within the asset data. 'whence' uses the + * same constants as lseek()/fseek(). + * + * Uses 64-bit data type for large files as opposed to the 32-bit type used + * by AAsset_seek. + * + * Returns the new position on success, or (off64_t) -1 on error. + */ +off64_t AAsset_seek64(AAsset* asset, off64_t offset, int whence); + +/** + * Close the asset, freeing all associated resources. + */ +void AAsset_close(AAsset* asset); + +/** + * Get a pointer to a buffer holding the entire contents of the assset. + * + * Returns NULL on failure. + */ +const void* AAsset_getBuffer(AAsset* asset); + +/** + * Report the total size of the asset data. + */ +off_t AAsset_getLength(AAsset* asset); + +/** + * Report the total size of the asset data. Reports the size using a 64-bit + * number insted of 32-bit as AAsset_getLength. + */ +off64_t AAsset_getLength64(AAsset* asset); + +/** + * Report the total amount of asset data that can be read from the current position. + */ +off_t AAsset_getRemainingLength(AAsset* asset); + +/** + * Report the total amount of asset data that can be read from the current position. + * + * Uses a 64-bit number instead of a 32-bit number as AAsset_getRemainingLength does. + */ +off64_t AAsset_getRemainingLength64(AAsset* asset); + +/** + * Open a new file descriptor that can be used to read the asset data. If the + * start or length cannot be represented by a 32-bit number, it will be + * truncated. If the file is large, use AAsset_openFileDescriptor64 instead. + * + * Returns < 0 if direct fd access is not possible (for example, if the asset is + * compressed). + */ +int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength); + +/** + * Open a new file descriptor that can be used to read the asset data. + * + * Uses a 64-bit number for the offset and length instead of 32-bit instead of + * as AAsset_openFileDescriptor does. + * + * Returns < 0 if direct fd access is not possible (for example, if the asset is + * compressed). + */ +int AAsset_openFileDescriptor64(AAsset* asset, off64_t* outStart, off64_t* outLength); + +/** + * Returns whether this asset's internal buffer is allocated in ordinary RAM (i.e. not + * mmapped). + */ +int AAsset_isAllocated(AAsset* asset); + + + +#ifdef __cplusplus +}; +#endif + +#endif // ANDROID_ASSET_MANAGER_H + +/** @} */ diff --git a/third_party/android_frameworks_native/include/android/asset_manager_jni.h b/third_party/android_frameworks_native/include/android/asset_manager_jni.h new file mode 100644 index 000000000..dcee17e10 --- /dev/null +++ b/third_party/android_frameworks_native/include/android/asset_manager_jni.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2010 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. + */ + +/** + * @addtogroup Asset + * @{ + */ + +/** + * @file asset_manager_jni.h + */ + +#ifndef ANDROID_ASSET_MANAGER_JNI_H +#define ANDROID_ASSET_MANAGER_JNI_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Given a Dalvik AssetManager object, obtain the corresponding native AAssetManager + * object. Note that the caller is responsible for obtaining and holding a VM reference + * to the jobject to prevent its being garbage collected while the native object is + * in use. + */ +AAssetManager* AAssetManager_fromJava(JNIEnv* env, jobject assetManager); + +#ifdef __cplusplus +}; +#endif + +#endif // ANDROID_ASSET_MANAGER_JNI_H + +/** @} */ diff --git a/third_party/android_frameworks_native/include/android/bitmap.h b/third_party/android_frameworks_native/include/android/bitmap.h new file mode 100644 index 000000000..261e64fac --- /dev/null +++ b/third_party/android_frameworks_native/include/android/bitmap.h @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2009 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. + */ + +/** + * @addtogroup Bitmap + * @{ + */ + +/** + * @file bitmap.h + */ + +#ifndef ANDROID_BITMAP_H +#define ANDROID_BITMAP_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** AndroidBitmap functions result code. */ +enum { + /** Operation was successful. */ + ANDROID_BITMAP_RESULT_SUCCESS = 0, + /** Bad parameter. */ + ANDROID_BITMAP_RESULT_BAD_PARAMETER = -1, + /** JNI exception occured. */ + ANDROID_BITMAP_RESULT_JNI_EXCEPTION = -2, + /** Allocation failed. */ + ANDROID_BITMAP_RESULT_ALLOCATION_FAILED = -3, +}; + +/** Backward compatibility: this macro used to be misspelled. */ +#define ANDROID_BITMAP_RESUT_SUCCESS ANDROID_BITMAP_RESULT_SUCCESS + +/** Bitmap pixel format. */ +enum AndroidBitmapFormat { + /** No format. */ + ANDROID_BITMAP_FORMAT_NONE = 0, + /** Red: 8 bits, Green: 8 bits, Blue: 8 bits, Alpha: 8 bits. **/ + ANDROID_BITMAP_FORMAT_RGBA_8888 = 1, + /** Red: 5 bits, Green: 6 bits, Blue: 5 bits. **/ + ANDROID_BITMAP_FORMAT_RGB_565 = 4, + /** Red: 4 bits, Green: 4 bits, Blue: 4 bits, Alpha: 4 bits. **/ + ANDROID_BITMAP_FORMAT_RGBA_4444 = 7, + /** Deprecated. */ + ANDROID_BITMAP_FORMAT_A_8 = 8, +}; + +/** Bitmap info, see AndroidBitmap_getInfo(). */ +typedef struct { + /** The bitmap width in pixels. */ + uint32_t width; + /** The bitmap height in pixels. */ + uint32_t height; + /** The number of byte per row. */ + uint32_t stride; + /** The bitmap pixel format. See {@link AndroidBitmapFormat} */ + int32_t format; + /** Unused. */ + uint32_t flags; // 0 for now +} AndroidBitmapInfo; + +/** + * Given a java bitmap object, fill out the AndroidBitmapInfo struct for it. + * If the call fails, the info parameter will be ignored. + */ +int AndroidBitmap_getInfo(JNIEnv* env, jobject jbitmap, + AndroidBitmapInfo* info); + +/** + * Given a java bitmap object, attempt to lock the pixel address. + * Locking will ensure that the memory for the pixels will not move + * until the unlockPixels call, and ensure that, if the pixels had been + * previously purged, they will have been restored. + * + * If this call succeeds, it must be balanced by a call to + * AndroidBitmap_unlockPixels, after which time the address of the pixels should + * no longer be used. + * + * If this succeeds, *addrPtr will be set to the pixel address. If the call + * fails, addrPtr will be ignored. + */ +int AndroidBitmap_lockPixels(JNIEnv* env, jobject jbitmap, void** addrPtr); + +/** + * Call this to balance a successful call to AndroidBitmap_lockPixels. + */ +int AndroidBitmap_unlockPixels(JNIEnv* env, jobject jbitmap); + +#ifdef __cplusplus +} +#endif + +#endif + +/** @} */ diff --git a/third_party/android_frameworks_native/include/android/configuration.h b/third_party/android_frameworks_native/include/android/configuration.h new file mode 100644 index 000000000..81f71a92c --- /dev/null +++ b/third_party/android_frameworks_native/include/android/configuration.h @@ -0,0 +1,708 @@ +/* + * Copyright (C) 2010 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. + */ + +/** + * @addtogroup Configuration + * @{ + */ + +/** + * @file configuration.h + */ + +#ifndef ANDROID_CONFIGURATION_H +#define ANDROID_CONFIGURATION_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct AConfiguration; +/** + * {@link AConfiguration} is an opaque type used to get and set + * various subsystem configurations. + * + * A {@link AConfiguration} pointer can be obtained using: + * - AConfiguration_new() + * - AConfiguration_fromAssetManager() + */ +typedef struct AConfiguration AConfiguration; + + +/** + * Define flags and constants for various subsystem configurations. + */ +enum { + /** Orientation: not specified. */ + ACONFIGURATION_ORIENTATION_ANY = 0x0000, + /** + * Orientation: value corresponding to the + * port + * resource qualifier. + */ + ACONFIGURATION_ORIENTATION_PORT = 0x0001, + /** + * Orientation: value corresponding to the + * land + * resource qualifier. + */ + ACONFIGURATION_ORIENTATION_LAND = 0x0002, + /** @deprecated Not currently supported or used. */ + ACONFIGURATION_ORIENTATION_SQUARE = 0x0003, + + /** Touchscreen: not specified. */ + ACONFIGURATION_TOUCHSCREEN_ANY = 0x0000, + /** + * Touchscreen: value corresponding to the + * notouch + * resource qualifier. + */ + ACONFIGURATION_TOUCHSCREEN_NOTOUCH = 0x0001, + /** @deprecated Not currently supported or used. */ + ACONFIGURATION_TOUCHSCREEN_STYLUS = 0x0002, + /** + * Touchscreen: value corresponding to the + * finger + * resource qualifier. + */ + ACONFIGURATION_TOUCHSCREEN_FINGER = 0x0003, + + /** Density: default density. */ + ACONFIGURATION_DENSITY_DEFAULT = 0, + /** + * Density: value corresponding to the + * ldpi + * resource qualifier. + */ + ACONFIGURATION_DENSITY_LOW = 120, + /** + * Density: value corresponding to the + * mdpi + * resource qualifier. + */ + ACONFIGURATION_DENSITY_MEDIUM = 160, + /** + * Density: value corresponding to the + * tvdpi + * resource qualifier. + */ + ACONFIGURATION_DENSITY_TV = 213, + /** + * Density: value corresponding to the + * hdpi + * resource qualifier. + */ + ACONFIGURATION_DENSITY_HIGH = 240, + /** + * Density: value corresponding to the + * xhdpi + * resource qualifier. + */ + ACONFIGURATION_DENSITY_XHIGH = 320, + /** + * Density: value corresponding to the + * xxhdpi + * resource qualifier. + */ + ACONFIGURATION_DENSITY_XXHIGH = 480, + /** + * Density: value corresponding to the + * xxxhdpi + * resource qualifier. + */ + ACONFIGURATION_DENSITY_XXXHIGH = 640, + /** Density: any density. */ + ACONFIGURATION_DENSITY_ANY = 0xfffe, + /** Density: no density specified. */ + ACONFIGURATION_DENSITY_NONE = 0xffff, + + /** Keyboard: not specified. */ + ACONFIGURATION_KEYBOARD_ANY = 0x0000, + /** + * Keyboard: value corresponding to the + * nokeys + * resource qualifier. + */ + ACONFIGURATION_KEYBOARD_NOKEYS = 0x0001, + /** + * Keyboard: value corresponding to the + * qwerty + * resource qualifier. + */ + ACONFIGURATION_KEYBOARD_QWERTY = 0x0002, + /** + * Keyboard: value corresponding to the + * 12key + * resource qualifier. + */ + ACONFIGURATION_KEYBOARD_12KEY = 0x0003, + + /** Navigation: not specified. */ + ACONFIGURATION_NAVIGATION_ANY = 0x0000, + /** + * Navigation: value corresponding to the + * nonav + * resource qualifier. + */ + ACONFIGURATION_NAVIGATION_NONAV = 0x0001, + /** + * Navigation: value corresponding to the + * dpad + * resource qualifier. + */ + ACONFIGURATION_NAVIGATION_DPAD = 0x0002, + /** + * Navigation: value corresponding to the + * trackball + * resource qualifier. + */ + ACONFIGURATION_NAVIGATION_TRACKBALL = 0x0003, + /** + * Navigation: value corresponding to the + * wheel + * resource qualifier. + */ + ACONFIGURATION_NAVIGATION_WHEEL = 0x0004, + + /** Keyboard availability: not specified. */ + ACONFIGURATION_KEYSHIDDEN_ANY = 0x0000, + /** + * Keyboard availability: value corresponding to the + * keysexposed + * resource qualifier. + */ + ACONFIGURATION_KEYSHIDDEN_NO = 0x0001, + /** + * Keyboard availability: value corresponding to the + * keyshidden + * resource qualifier. + */ + ACONFIGURATION_KEYSHIDDEN_YES = 0x0002, + /** + * Keyboard availability: value corresponding to the + * keyssoft + * resource qualifier. + */ + ACONFIGURATION_KEYSHIDDEN_SOFT = 0x0003, + + /** Navigation availability: not specified. */ + ACONFIGURATION_NAVHIDDEN_ANY = 0x0000, + /** + * Navigation availability: value corresponding to the + * navexposed + * resource qualifier. + */ + ACONFIGURATION_NAVHIDDEN_NO = 0x0001, + /** + * Navigation availability: value corresponding to the + * navhidden + * resource qualifier. + */ + ACONFIGURATION_NAVHIDDEN_YES = 0x0002, + + /** Screen size: not specified. */ + ACONFIGURATION_SCREENSIZE_ANY = 0x00, + /** + * Screen size: value indicating the screen is at least + * approximately 320x426 dp units, corresponding to the + * small + * resource qualifier. + */ + ACONFIGURATION_SCREENSIZE_SMALL = 0x01, + /** + * Screen size: value indicating the screen is at least + * approximately 320x470 dp units, corresponding to the + * normal + * resource qualifier. + */ + ACONFIGURATION_SCREENSIZE_NORMAL = 0x02, + /** + * Screen size: value indicating the screen is at least + * approximately 480x640 dp units, corresponding to the + * large + * resource qualifier. + */ + ACONFIGURATION_SCREENSIZE_LARGE = 0x03, + /** + * Screen size: value indicating the screen is at least + * approximately 720x960 dp units, corresponding to the + * xlarge + * resource qualifier. + */ + ACONFIGURATION_SCREENSIZE_XLARGE = 0x04, + + /** Screen layout: not specified. */ + ACONFIGURATION_SCREENLONG_ANY = 0x00, + /** + * Screen layout: value that corresponds to the + * notlong + * resource qualifier. + */ + ACONFIGURATION_SCREENLONG_NO = 0x1, + /** + * Screen layout: value that corresponds to the + * long + * resource qualifier. + */ + ACONFIGURATION_SCREENLONG_YES = 0x2, + + ACONFIGURATION_SCREENROUND_ANY = 0x00, + ACONFIGURATION_SCREENROUND_NO = 0x1, + ACONFIGURATION_SCREENROUND_YES = 0x2, + + /** UI mode: not specified. */ + ACONFIGURATION_UI_MODE_TYPE_ANY = 0x00, + /** + * UI mode: value that corresponds to + * no + * UI mode type resource qualifier specified. + */ + ACONFIGURATION_UI_MODE_TYPE_NORMAL = 0x01, + /** + * UI mode: value that corresponds to + * desk resource qualifier specified. + */ + ACONFIGURATION_UI_MODE_TYPE_DESK = 0x02, + /** + * UI mode: value that corresponds to + * car resource qualifier specified. + */ + ACONFIGURATION_UI_MODE_TYPE_CAR = 0x03, + /** + * UI mode: value that corresponds to + * television resource qualifier specified. + */ + ACONFIGURATION_UI_MODE_TYPE_TELEVISION = 0x04, + /** + * UI mode: value that corresponds to + * appliance resource qualifier specified. + */ + ACONFIGURATION_UI_MODE_TYPE_APPLIANCE = 0x05, + /** + * UI mode: value that corresponds to + * watch resource qualifier specified. + */ + ACONFIGURATION_UI_MODE_TYPE_WATCH = 0x06, + + /** UI night mode: not specified.*/ + ACONFIGURATION_UI_MODE_NIGHT_ANY = 0x00, + /** + * UI night mode: value that corresponds to + * notnight resource qualifier specified. + */ + ACONFIGURATION_UI_MODE_NIGHT_NO = 0x1, + /** + * UI night mode: value that corresponds to + * night resource qualifier specified. + */ + ACONFIGURATION_UI_MODE_NIGHT_YES = 0x2, + + /** Screen width DPI: not specified. */ + ACONFIGURATION_SCREEN_WIDTH_DP_ANY = 0x0000, + + /** Screen height DPI: not specified. */ + ACONFIGURATION_SCREEN_HEIGHT_DP_ANY = 0x0000, + + /** Smallest screen width DPI: not specified.*/ + ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY = 0x0000, + + /** Layout direction: not specified. */ + ACONFIGURATION_LAYOUTDIR_ANY = 0x00, + /** + * Layout direction: value that corresponds to + * ldltr resource qualifier specified. + */ + ACONFIGURATION_LAYOUTDIR_LTR = 0x01, + /** + * Layout direction: value that corresponds to + * ldrtl resource qualifier specified. + */ + ACONFIGURATION_LAYOUTDIR_RTL = 0x02, + + /** + * Bit mask for + * mcc + * configuration. + */ + ACONFIGURATION_MCC = 0x0001, + /** + * Bit mask for + * mnc + * configuration. + */ + ACONFIGURATION_MNC = 0x0002, + /** + * Bit mask for + * locale + * configuration. + */ + ACONFIGURATION_LOCALE = 0x0004, + /** + * Bit mask for + * touchscreen + * configuration. + */ + ACONFIGURATION_TOUCHSCREEN = 0x0008, + /** + * Bit mask for + * keyboard + * configuration. + */ + ACONFIGURATION_KEYBOARD = 0x0010, + /** + * Bit mask for + * keyboardHidden + * configuration. + */ + ACONFIGURATION_KEYBOARD_HIDDEN = 0x0020, + /** + * Bit mask for + * navigation + * configuration. + */ + ACONFIGURATION_NAVIGATION = 0x0040, + /** + * Bit mask for + * orientation + * configuration. + */ + ACONFIGURATION_ORIENTATION = 0x0080, + /** + * Bit mask for + * density + * configuration. + */ + ACONFIGURATION_DENSITY = 0x0100, + /** + * Bit mask for + * screen size + * configuration. + */ + ACONFIGURATION_SCREEN_SIZE = 0x0200, + /** + * Bit mask for + * platform version + * configuration. + */ + ACONFIGURATION_VERSION = 0x0400, + /** + * Bit mask for screen layout configuration. + */ + ACONFIGURATION_SCREEN_LAYOUT = 0x0800, + /** + * Bit mask for + * ui mode + * configuration. + */ + ACONFIGURATION_UI_MODE = 0x1000, + /** + * Bit mask for + * smallest screen width + * configuration. + */ + ACONFIGURATION_SMALLEST_SCREEN_SIZE = 0x2000, + /** + * Bit mask for + * layout direction + * configuration. + */ + ACONFIGURATION_LAYOUTDIR = 0x4000, + ACONFIGURATION_SCREEN_ROUND = 0x8000, + /** + * Constant used to to represent MNC (Mobile Network Code) zero. + * 0 cannot be used, since it is used to represent an undefined MNC. + */ + ACONFIGURATION_MNC_ZERO = 0xffff, +}; + +/** + * Create a new AConfiguration, initialized with no values set. + */ +AConfiguration* AConfiguration_new(); + +/** + * Free an AConfiguration that was previously created with + * AConfiguration_new(). + */ +void AConfiguration_delete(AConfiguration* config); + +/** + * Create and return a new AConfiguration based on the current configuration in + * use in the given {@link AAssetManager}. + */ +void AConfiguration_fromAssetManager(AConfiguration* out, AAssetManager* am); + +/** + * Copy the contents of 'src' to 'dest'. + */ +void AConfiguration_copy(AConfiguration* dest, AConfiguration* src); + +/** + * Return the current MCC set in the configuration. 0 if not set. + */ +int32_t AConfiguration_getMcc(AConfiguration* config); + +/** + * Set the current MCC in the configuration. 0 to clear. + */ +void AConfiguration_setMcc(AConfiguration* config, int32_t mcc); + +/** + * Return the current MNC set in the configuration. 0 if not set. + */ +int32_t AConfiguration_getMnc(AConfiguration* config); + +/** + * Set the current MNC in the configuration. 0 to clear. + */ +void AConfiguration_setMnc(AConfiguration* config, int32_t mnc); + +/** + * Return the current language code set in the configuration. The output will + * be filled with an array of two characters. They are not 0-terminated. If + * a language is not set, they will be 0. + */ +void AConfiguration_getLanguage(AConfiguration* config, char* outLanguage); + +/** + * Set the current language code in the configuration, from the first two + * characters in the string. + */ +void AConfiguration_setLanguage(AConfiguration* config, const char* language); + +/** + * Return the current country code set in the configuration. The output will + * be filled with an array of two characters. They are not 0-terminated. If + * a country is not set, they will be 0. + */ +void AConfiguration_getCountry(AConfiguration* config, char* outCountry); + +/** + * Set the current country code in the configuration, from the first two + * characters in the string. + */ +void AConfiguration_setCountry(AConfiguration* config, const char* country); + +/** + * Return the current ACONFIGURATION_ORIENTATION_* set in the configuration. + */ +int32_t AConfiguration_getOrientation(AConfiguration* config); + +/** + * Set the current orientation in the configuration. + */ +void AConfiguration_setOrientation(AConfiguration* config, int32_t orientation); + +/** + * Return the current ACONFIGURATION_TOUCHSCREEN_* set in the configuration. + */ +int32_t AConfiguration_getTouchscreen(AConfiguration* config); + +/** + * Set the current touchscreen in the configuration. + */ +void AConfiguration_setTouchscreen(AConfiguration* config, int32_t touchscreen); + +/** + * Return the current ACONFIGURATION_DENSITY_* set in the configuration. + */ +int32_t AConfiguration_getDensity(AConfiguration* config); + +/** + * Set the current density in the configuration. + */ +void AConfiguration_setDensity(AConfiguration* config, int32_t density); + +/** + * Return the current ACONFIGURATION_KEYBOARD_* set in the configuration. + */ +int32_t AConfiguration_getKeyboard(AConfiguration* config); + +/** + * Set the current keyboard in the configuration. + */ +void AConfiguration_setKeyboard(AConfiguration* config, int32_t keyboard); + +/** + * Return the current ACONFIGURATION_NAVIGATION_* set in the configuration. + */ +int32_t AConfiguration_getNavigation(AConfiguration* config); + +/** + * Set the current navigation in the configuration. + */ +void AConfiguration_setNavigation(AConfiguration* config, int32_t navigation); + +/** + * Return the current ACONFIGURATION_KEYSHIDDEN_* set in the configuration. + */ +int32_t AConfiguration_getKeysHidden(AConfiguration* config); + +/** + * Set the current keys hidden in the configuration. + */ +void AConfiguration_setKeysHidden(AConfiguration* config, int32_t keysHidden); + +/** + * Return the current ACONFIGURATION_NAVHIDDEN_* set in the configuration. + */ +int32_t AConfiguration_getNavHidden(AConfiguration* config); + +/** + * Set the current nav hidden in the configuration. + */ +void AConfiguration_setNavHidden(AConfiguration* config, int32_t navHidden); + +/** + * Return the current SDK (API) version set in the configuration. + */ +int32_t AConfiguration_getSdkVersion(AConfiguration* config); + +/** + * Set the current SDK version in the configuration. + */ +void AConfiguration_setSdkVersion(AConfiguration* config, int32_t sdkVersion); + +/** + * Return the current ACONFIGURATION_SCREENSIZE_* set in the configuration. + */ +int32_t AConfiguration_getScreenSize(AConfiguration* config); + +/** + * Set the current screen size in the configuration. + */ +void AConfiguration_setScreenSize(AConfiguration* config, int32_t screenSize); + +/** + * Return the current ACONFIGURATION_SCREENLONG_* set in the configuration. + */ +int32_t AConfiguration_getScreenLong(AConfiguration* config); + +/** + * Set the current screen long in the configuration. + */ +void AConfiguration_setScreenLong(AConfiguration* config, int32_t screenLong); + +/** + * Return the current ACONFIGURATION_SCREENROUND_* set in the configuration. + */ +int32_t AConfiguration_getScreenRound(AConfiguration* config); + +/** + * Set the current screen round in the configuration. + */ +void AConfiguration_setScreenRound(AConfiguration* config, int32_t screenRound); + +/** + * Return the current ACONFIGURATION_UI_MODE_TYPE_* set in the configuration. + */ +int32_t AConfiguration_getUiModeType(AConfiguration* config); + +/** + * Set the current UI mode type in the configuration. + */ +void AConfiguration_setUiModeType(AConfiguration* config, int32_t uiModeType); + +/** + * Return the current ACONFIGURATION_UI_MODE_NIGHT_* set in the configuration. + */ +int32_t AConfiguration_getUiModeNight(AConfiguration* config); + +/** + * Set the current UI mode night in the configuration. + */ +void AConfiguration_setUiModeNight(AConfiguration* config, int32_t uiModeNight); + +/** + * Return the current configuration screen width in dp units, or + * ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set. + */ +int32_t AConfiguration_getScreenWidthDp(AConfiguration* config); + +/** + * Set the configuration's current screen width in dp units. + */ +void AConfiguration_setScreenWidthDp(AConfiguration* config, int32_t value); + +/** + * Return the current configuration screen height in dp units, or + * ACONFIGURATION_SCREEN_HEIGHT_DP_ANY if not set. + */ +int32_t AConfiguration_getScreenHeightDp(AConfiguration* config); + +/** + * Set the configuration's current screen width in dp units. + */ +void AConfiguration_setScreenHeightDp(AConfiguration* config, int32_t value); + +/** + * Return the configuration's smallest screen width in dp units, or + * ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY if not set. + */ +int32_t AConfiguration_getSmallestScreenWidthDp(AConfiguration* config); + +/** + * Set the configuration's smallest screen width in dp units. + */ +void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value); + +/** + * Return the configuration's layout direction, or + * ACONFIGURATION_LAYOUTDIR_ANY if not set. + */ +int32_t AConfiguration_getLayoutDirection(AConfiguration* config); + +/** + * Set the configuration's layout direction. + */ +void AConfiguration_setLayoutDirection(AConfiguration* config, int32_t value); + +/** + * Perform a diff between two configurations. Returns a bit mask of + * ACONFIGURATION_* constants, each bit set meaning that configuration element + * is different between them. + */ +int32_t AConfiguration_diff(AConfiguration* config1, AConfiguration* config2); + +/** + * Determine whether 'base' is a valid configuration for use within the + * environment 'requested'. Returns 0 if there are any values in 'base' + * that conflict with 'requested'. Returns 1 if it does not conflict. + */ +int32_t AConfiguration_match(AConfiguration* base, AConfiguration* requested); + +/** + * Determine whether the configuration in 'test' is better than the existing + * configuration in 'base'. If 'requested' is non-NULL, this decision is based + * on the overall configuration given there. If it is NULL, this decision is + * simply based on which configuration is more specific. Returns non-0 if + * 'test' is better than 'base'. + * + * This assumes you have already filtered the configurations with + * AConfiguration_match(). + */ +int32_t AConfiguration_isBetterThan(AConfiguration* base, AConfiguration* test, + AConfiguration* requested); + +#ifdef __cplusplus +}; +#endif + +#endif // ANDROID_CONFIGURATION_H + +/** @} */ diff --git a/third_party/android_frameworks_native/include/android/input.h b/third_party/android_frameworks_native/include/android/input.h new file mode 100644 index 000000000..46cf89c7e --- /dev/null +++ b/third_party/android_frameworks_native/include/android/input.h @@ -0,0 +1,1317 @@ +/* + * Copyright (C) 2010 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. + */ + +/** + * @addtogroup Input + * @{ + */ + +/** + * @file input.h + */ + +#ifndef _ANDROID_INPUT_H +#define _ANDROID_INPUT_H + +/****************************************************************** + * + * IMPORTANT NOTICE: + * + * This file is part of Android's set of stable system headers + * exposed by the Android NDK (Native Development Kit). + * + * Third-party source AND binary code relies on the definitions + * here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES. + * + * - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES) + * - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS + * - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY + * - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES + */ + +/* + * Structures and functions to receive and process input events in + * native code. + * + * NOTE: These functions MUST be implemented by /system/lib/libui.so + */ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Key states (may be returned by queries about the current state of a + * particular key code, scan code or switch). + */ +enum { + /** The key state is unknown or the requested key itself is not supported. */ + AKEY_STATE_UNKNOWN = -1, + + /** The key is up. */ + AKEY_STATE_UP = 0, + + /** The key is down. */ + AKEY_STATE_DOWN = 1, + + /** The key is down but is a virtual key press that is being emulated by the system. */ + AKEY_STATE_VIRTUAL = 2 +}; + +/** + * Meta key / modifer state. + */ +enum { + /** No meta keys are pressed. */ + AMETA_NONE = 0, + + /** This mask is used to check whether one of the ALT meta keys is pressed. */ + AMETA_ALT_ON = 0x02, + + /** This mask is used to check whether the left ALT meta key is pressed. */ + AMETA_ALT_LEFT_ON = 0x10, + + /** This mask is used to check whether the right ALT meta key is pressed. */ + AMETA_ALT_RIGHT_ON = 0x20, + + /** This mask is used to check whether one of the SHIFT meta keys is pressed. */ + AMETA_SHIFT_ON = 0x01, + + /** This mask is used to check whether the left SHIFT meta key is pressed. */ + AMETA_SHIFT_LEFT_ON = 0x40, + + /** This mask is used to check whether the right SHIFT meta key is pressed. */ + AMETA_SHIFT_RIGHT_ON = 0x80, + + /** This mask is used to check whether the SYM meta key is pressed. */ + AMETA_SYM_ON = 0x04, + + /** This mask is used to check whether the FUNCTION meta key is pressed. */ + AMETA_FUNCTION_ON = 0x08, + + /** This mask is used to check whether one of the CTRL meta keys is pressed. */ + AMETA_CTRL_ON = 0x1000, + + /** This mask is used to check whether the left CTRL meta key is pressed. */ + AMETA_CTRL_LEFT_ON = 0x2000, + + /** This mask is used to check whether the right CTRL meta key is pressed. */ + AMETA_CTRL_RIGHT_ON = 0x4000, + + /** This mask is used to check whether one of the META meta keys is pressed. */ + AMETA_META_ON = 0x10000, + + /** This mask is used to check whether the left META meta key is pressed. */ + AMETA_META_LEFT_ON = 0x20000, + + /** This mask is used to check whether the right META meta key is pressed. */ + AMETA_META_RIGHT_ON = 0x40000, + + /** This mask is used to check whether the CAPS LOCK meta key is on. */ + AMETA_CAPS_LOCK_ON = 0x100000, + + /** This mask is used to check whether the NUM LOCK meta key is on. */ + AMETA_NUM_LOCK_ON = 0x200000, + + /** This mask is used to check whether the SCROLL LOCK meta key is on. */ + AMETA_SCROLL_LOCK_ON = 0x400000, +}; + +struct AInputEvent; +/** + * Input events. + * + * Input events are opaque structures. Use the provided accessors functions to + * read their properties. + */ +typedef struct AInputEvent AInputEvent; + +/** + * Input event types. + */ +enum { + /** Indicates that the input event is a key event. */ + AINPUT_EVENT_TYPE_KEY = 1, + + /** Indicates that the input event is a motion event. */ + AINPUT_EVENT_TYPE_MOTION = 2 +}; + +/** + * Key event actions. + */ +enum { + /** The key has been pressed down. */ + AKEY_EVENT_ACTION_DOWN = 0, + + /** The key has been released. */ + AKEY_EVENT_ACTION_UP = 1, + + /** + * Multiple duplicate key events have occurred in a row, or a + * complex string is being delivered. The repeat_count property + * of the key event contains the number of times the given key + * code should be executed. + */ + AKEY_EVENT_ACTION_MULTIPLE = 2 +}; + +/** + * Key event flags. + */ +enum { + /** This mask is set if the device woke because of this key event. */ + AKEY_EVENT_FLAG_WOKE_HERE = 0x1, + + /** This mask is set if the key event was generated by a software keyboard. */ + AKEY_EVENT_FLAG_SOFT_KEYBOARD = 0x2, + + /** This mask is set if we don't want the key event to cause us to leave touch mode. */ + AKEY_EVENT_FLAG_KEEP_TOUCH_MODE = 0x4, + + /** + * This mask is set if an event was known to come from a trusted + * part of the system. That is, the event is known to come from + * the user, and could not have been spoofed by a third party + * component. + */ + AKEY_EVENT_FLAG_FROM_SYSTEM = 0x8, + + /** + * This mask is used for compatibility, to identify enter keys that are + * coming from an IME whose enter key has been auto-labelled "next" or + * "done". This allows TextView to dispatch these as normal enter keys + * for old applications, but still do the appropriate action when + * receiving them. + */ + AKEY_EVENT_FLAG_EDITOR_ACTION = 0x10, + + /** + * When associated with up key events, this indicates that the key press + * has been canceled. Typically this is used with virtual touch screen + * keys, where the user can slide from the virtual key area on to the + * display: in that case, the application will receive a canceled up + * event and should not perform the action normally associated with the + * key. Note that for this to work, the application can not perform an + * action for a key until it receives an up or the long press timeout has + * expired. + */ + AKEY_EVENT_FLAG_CANCELED = 0x20, + + /** + * This key event was generated by a virtual (on-screen) hard key area. + * Typically this is an area of the touchscreen, outside of the regular + * display, dedicated to "hardware" buttons. + */ + AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY = 0x40, + + /** + * This flag is set for the first key repeat that occurs after the + * long press timeout. + */ + AKEY_EVENT_FLAG_LONG_PRESS = 0x80, + + /** + * Set when a key event has AKEY_EVENT_FLAG_CANCELED set because a long + * press action was executed while it was down. + */ + AKEY_EVENT_FLAG_CANCELED_LONG_PRESS = 0x100, + + /** + * Set for AKEY_EVENT_ACTION_UP when this event's key code is still being + * tracked from its initial down. That is, somebody requested that tracking + * started on the key down and a long press has not caused + * the tracking to be canceled. + */ + AKEY_EVENT_FLAG_TRACKING = 0x200, + + /** + * Set when a key event has been synthesized to implement default behavior + * for an event that the application did not handle. + * Fallback key events are generated by unhandled trackball motions + * (to emulate a directional keypad) and by certain unhandled key presses + * that are declared in the key map (such as special function numeric keypad + * keys when numlock is off). + */ + AKEY_EVENT_FLAG_FALLBACK = 0x400, +}; + +/** + * Bit shift for the action bits holding the pointer index as + * defined by AMOTION_EVENT_ACTION_POINTER_INDEX_MASK. + */ +#define AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT 8 + +/** Motion event actions */ +enum { + /** Bit mask of the parts of the action code that are the action itself. */ + AMOTION_EVENT_ACTION_MASK = 0xff, + + /** + * Bits in the action code that represent a pointer index, used with + * AMOTION_EVENT_ACTION_POINTER_DOWN and AMOTION_EVENT_ACTION_POINTER_UP. Shifting + * down by AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT provides the actual pointer + * index where the data for the pointer going up or down can be found. + */ + AMOTION_EVENT_ACTION_POINTER_INDEX_MASK = 0xff00, + + /** A pressed gesture has started, the motion contains the initial starting location. */ + AMOTION_EVENT_ACTION_DOWN = 0, + + /** + * A pressed gesture has finished, the motion contains the final release location + * as well as any intermediate points since the last down or move event. + */ + AMOTION_EVENT_ACTION_UP = 1, + + /** + * A change has happened during a press gesture (between AMOTION_EVENT_ACTION_DOWN and + * AMOTION_EVENT_ACTION_UP). The motion contains the most recent point, as well as + * any intermediate points since the last down or move event. + */ + AMOTION_EVENT_ACTION_MOVE = 2, + + /** + * The current gesture has been aborted. + * You will not receive any more points in it. You should treat this as + * an up event, but not perform any action that you normally would. + */ + AMOTION_EVENT_ACTION_CANCEL = 3, + + /** + * A movement has happened outside of the normal bounds of the UI element. + * This does not provide a full gesture, but only the initial location of the movement/touch. + */ + AMOTION_EVENT_ACTION_OUTSIDE = 4, + + /** + * A non-primary pointer has gone down. + * The bits in AMOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed. + */ + AMOTION_EVENT_ACTION_POINTER_DOWN = 5, + + /** + * A non-primary pointer has gone up. + * The bits in AMOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed. + */ + AMOTION_EVENT_ACTION_POINTER_UP = 6, + + /** + * A change happened but the pointer is not down (unlike AMOTION_EVENT_ACTION_MOVE). + * The motion contains the most recent point, as well as any intermediate points since + * the last hover move event. + */ + AMOTION_EVENT_ACTION_HOVER_MOVE = 7, + + /** + * The motion event contains relative vertical and/or horizontal scroll offsets. + * Use getAxisValue to retrieve the information from AMOTION_EVENT_AXIS_VSCROLL + * and AMOTION_EVENT_AXIS_HSCROLL. + * The pointer may or may not be down when this event is dispatched. + * This action is always delivered to the winder under the pointer, which + * may not be the window currently touched. + */ + AMOTION_EVENT_ACTION_SCROLL = 8, + + /** The pointer is not down but has entered the boundaries of a window or view. */ + AMOTION_EVENT_ACTION_HOVER_ENTER = 9, + + /** The pointer is not down but has exited the boundaries of a window or view. */ + AMOTION_EVENT_ACTION_HOVER_EXIT = 10, + + /* One or more buttons have been pressed. */ + AMOTION_EVENT_ACTION_BUTTON_PRESS = 11, + + /* One or more buttons have been released. */ + AMOTION_EVENT_ACTION_BUTTON_RELEASE = 12, +}; + +/** + * Motion event flags. + */ +enum { + /** + * This flag indicates that the window that received this motion event is partly + * or wholly obscured by another visible window above it. This flag is set to true + * even if the event did not directly pass through the obscured area. + * A security sensitive application can check this flag to identify situations in which + * a malicious application may have covered up part of its content for the purpose + * of misleading the user or hijacking touches. An appropriate response might be + * to drop the suspect touches or to take additional precautions to confirm the user's + * actual intent. + */ + AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED = 0x1, +}; + +/** + * Motion event edge touch flags. + */ +enum { + /** No edges intersected. */ + AMOTION_EVENT_EDGE_FLAG_NONE = 0, + + /** Flag indicating the motion event intersected the top edge of the screen. */ + AMOTION_EVENT_EDGE_FLAG_TOP = 0x01, + + /** Flag indicating the motion event intersected the bottom edge of the screen. */ + AMOTION_EVENT_EDGE_FLAG_BOTTOM = 0x02, + + /** Flag indicating the motion event intersected the left edge of the screen. */ + AMOTION_EVENT_EDGE_FLAG_LEFT = 0x04, + + /** Flag indicating the motion event intersected the right edge of the screen. */ + AMOTION_EVENT_EDGE_FLAG_RIGHT = 0x08 +}; + +/** + * Constants that identify each individual axis of a motion event. + * @anchor AMOTION_EVENT_AXIS + */ +enum { + /** + * Axis constant: X axis of a motion event. + * + * - For a touch screen, reports the absolute X screen position of the center of + * the touch contact area. The units are display pixels. + * - For a touch pad, reports the absolute X surface position of the center of the touch + * contact area. The units are device-dependent. + * - For a mouse, reports the absolute X screen position of the mouse pointer. + * The units are display pixels. + * - For a trackball, reports the relative horizontal displacement of the trackball. + * The value is normalized to a range from -1.0 (left) to 1.0 (right). + * - For a joystick, reports the absolute X position of the joystick. + * The value is normalized to a range from -1.0 (left) to 1.0 (right). + */ + AMOTION_EVENT_AXIS_X = 0, + /** + * Axis constant: Y axis of a motion event. + * + * - For a touch screen, reports the absolute Y screen position of the center of + * the touch contact area. The units are display pixels. + * - For a touch pad, reports the absolute Y surface position of the center of the touch + * contact area. The units are device-dependent. + * - For a mouse, reports the absolute Y screen position of the mouse pointer. + * The units are display pixels. + * - For a trackball, reports the relative vertical displacement of the trackball. + * The value is normalized to a range from -1.0 (up) to 1.0 (down). + * - For a joystick, reports the absolute Y position of the joystick. + * The value is normalized to a range from -1.0 (up or far) to 1.0 (down or near). + */ + AMOTION_EVENT_AXIS_Y = 1, + /** + * Axis constant: Pressure axis of a motion event. + * + * - For a touch screen or touch pad, reports the approximate pressure applied to the surface + * by a finger or other tool. The value is normalized to a range from + * 0 (no pressure at all) to 1 (normal pressure), although values higher than 1 + * may be generated depending on the calibration of the input device. + * - For a trackball, the value is set to 1 if the trackball button is pressed + * or 0 otherwise. + * - For a mouse, the value is set to 1 if the primary mouse button is pressed + * or 0 otherwise. + */ + AMOTION_EVENT_AXIS_PRESSURE = 2, + /** + * Axis constant: Size axis of a motion event. + * + * - For a touch screen or touch pad, reports the approximate size of the contact area in + * relation to the maximum detectable size for the device. The value is normalized + * to a range from 0 (smallest detectable size) to 1 (largest detectable size), + * although it is not a linear scale. This value is of limited use. + * To obtain calibrated size information, see + * {@link AMOTION_EVENT_AXIS_TOUCH_MAJOR} or {@link AMOTION_EVENT_AXIS_TOOL_MAJOR}. + */ + AMOTION_EVENT_AXIS_SIZE = 3, + /** + * Axis constant: TouchMajor axis of a motion event. + * + * - For a touch screen, reports the length of the major axis of an ellipse that + * represents the touch area at the point of contact. + * The units are display pixels. + * - For a touch pad, reports the length of the major axis of an ellipse that + * represents the touch area at the point of contact. + * The units are device-dependent. + */ + AMOTION_EVENT_AXIS_TOUCH_MAJOR = 4, + /** + * Axis constant: TouchMinor axis of a motion event. + * + * - For a touch screen, reports the length of the minor axis of an ellipse that + * represents the touch area at the point of contact. + * The units are display pixels. + * - For a touch pad, reports the length of the minor axis of an ellipse that + * represents the touch area at the point of contact. + * The units are device-dependent. + * + * When the touch is circular, the major and minor axis lengths will be equal to one another. + */ + AMOTION_EVENT_AXIS_TOUCH_MINOR = 5, + /** + * Axis constant: ToolMajor axis of a motion event. + * + * - For a touch screen, reports the length of the major axis of an ellipse that + * represents the size of the approaching finger or tool used to make contact. + * - For a touch pad, reports the length of the major axis of an ellipse that + * represents the size of the approaching finger or tool used to make contact. + * The units are device-dependent. + * + * When the touch is circular, the major and minor axis lengths will be equal to one another. + * + * The tool size may be larger than the touch size since the tool may not be fully + * in contact with the touch sensor. + */ + AMOTION_EVENT_AXIS_TOOL_MAJOR = 6, + /** + * Axis constant: ToolMinor axis of a motion event. + * + * - For a touch screen, reports the length of the minor axis of an ellipse that + * represents the size of the approaching finger or tool used to make contact. + * - For a touch pad, reports the length of the minor axis of an ellipse that + * represents the size of the approaching finger or tool used to make contact. + * The units are device-dependent. + * + * When the touch is circular, the major and minor axis lengths will be equal to one another. + * + * The tool size may be larger than the touch size since the tool may not be fully + * in contact with the touch sensor. + */ + AMOTION_EVENT_AXIS_TOOL_MINOR = 7, + /** + * Axis constant: Orientation axis of a motion event. + * + * - For a touch screen or touch pad, reports the orientation of the finger + * or tool in radians relative to the vertical plane of the device. + * An angle of 0 radians indicates that the major axis of contact is oriented + * upwards, is perfectly circular or is of unknown orientation. A positive angle + * indicates that the major axis of contact is oriented to the right. A negative angle + * indicates that the major axis of contact is oriented to the left. + * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians + * (finger pointing fully right). + * - For a stylus, the orientation indicates the direction in which the stylus + * is pointing in relation to the vertical axis of the current orientation of the screen. + * The range is from -PI radians to PI radians, where 0 is pointing up, + * -PI/2 radians is pointing left, -PI or PI radians is pointing down, and PI/2 radians + * is pointing right. See also {@link AMOTION_EVENT_AXIS_TILT}. + */ + AMOTION_EVENT_AXIS_ORIENTATION = 8, + /** + * Axis constant: Vertical Scroll axis of a motion event. + * + * - For a mouse, reports the relative movement of the vertical scroll wheel. + * The value is normalized to a range from -1.0 (down) to 1.0 (up). + * + * This axis should be used to scroll views vertically. + */ + AMOTION_EVENT_AXIS_VSCROLL = 9, + /** + * Axis constant: Horizontal Scroll axis of a motion event. + * + * - For a mouse, reports the relative movement of the horizontal scroll wheel. + * The value is normalized to a range from -1.0 (left) to 1.0 (right). + * + * This axis should be used to scroll views horizontally. + */ + AMOTION_EVENT_AXIS_HSCROLL = 10, + /** + * Axis constant: Z axis of a motion event. + * + * - For a joystick, reports the absolute Z position of the joystick. + * The value is normalized to a range from -1.0 (high) to 1.0 (low). + * On game pads with two analog joysticks, this axis is often reinterpreted + * to report the absolute X position of the second joystick instead. + */ + AMOTION_EVENT_AXIS_Z = 11, + /** + * Axis constant: X Rotation axis of a motion event. + * + * - For a joystick, reports the absolute rotation angle about the X axis. + * The value is normalized to a range from -1.0 (counter-clockwise) to 1.0 (clockwise). + */ + AMOTION_EVENT_AXIS_RX = 12, + /** + * Axis constant: Y Rotation axis of a motion event. + * + * - For a joystick, reports the absolute rotation angle about the Y axis. + * The value is normalized to a range from -1.0 (counter-clockwise) to 1.0 (clockwise). + */ + AMOTION_EVENT_AXIS_RY = 13, + /** + * Axis constant: Z Rotation axis of a motion event. + * + * - For a joystick, reports the absolute rotation angle about the Z axis. + * The value is normalized to a range from -1.0 (counter-clockwise) to 1.0 (clockwise). + * On game pads with two analog joysticks, this axis is often reinterpreted + * to report the absolute Y position of the second joystick instead. + */ + AMOTION_EVENT_AXIS_RZ = 14, + /** + * Axis constant: Hat X axis of a motion event. + * + * - For a joystick, reports the absolute X position of the directional hat control. + * The value is normalized to a range from -1.0 (left) to 1.0 (right). + */ + AMOTION_EVENT_AXIS_HAT_X = 15, + /** + * Axis constant: Hat Y axis of a motion event. + * + * - For a joystick, reports the absolute Y position of the directional hat control. + * The value is normalized to a range from -1.0 (up) to 1.0 (down). + */ + AMOTION_EVENT_AXIS_HAT_Y = 16, + /** + * Axis constant: Left Trigger axis of a motion event. + * + * - For a joystick, reports the absolute position of the left trigger control. + * The value is normalized to a range from 0.0 (released) to 1.0 (fully pressed). + */ + AMOTION_EVENT_AXIS_LTRIGGER = 17, + /** + * Axis constant: Right Trigger axis of a motion event. + * + * - For a joystick, reports the absolute position of the right trigger control. + * The value is normalized to a range from 0.0 (released) to 1.0 (fully pressed). + */ + AMOTION_EVENT_AXIS_RTRIGGER = 18, + /** + * Axis constant: Throttle axis of a motion event. + * + * - For a joystick, reports the absolute position of the throttle control. + * The value is normalized to a range from 0.0 (fully open) to 1.0 (fully closed). + */ + AMOTION_EVENT_AXIS_THROTTLE = 19, + /** + * Axis constant: Rudder axis of a motion event. + * + * - For a joystick, reports the absolute position of the rudder control. + * The value is normalized to a range from -1.0 (turn left) to 1.0 (turn right). + */ + AMOTION_EVENT_AXIS_RUDDER = 20, + /** + * Axis constant: Wheel axis of a motion event. + * + * - For a joystick, reports the absolute position of the steering wheel control. + * The value is normalized to a range from -1.0 (turn left) to 1.0 (turn right). + */ + AMOTION_EVENT_AXIS_WHEEL = 21, + /** + * Axis constant: Gas axis of a motion event. + * + * - For a joystick, reports the absolute position of the gas (accelerator) control. + * The value is normalized to a range from 0.0 (no acceleration) + * to 1.0 (maximum acceleration). + */ + AMOTION_EVENT_AXIS_GAS = 22, + /** + * Axis constant: Brake axis of a motion event. + * + * - For a joystick, reports the absolute position of the brake control. + * The value is normalized to a range from 0.0 (no braking) to 1.0 (maximum braking). + */ + AMOTION_EVENT_AXIS_BRAKE = 23, + /** + * Axis constant: Distance axis of a motion event. + * + * - For a stylus, reports the distance of the stylus from the screen. + * A value of 0.0 indicates direct contact and larger values indicate increasing + * distance from the surface. + */ + AMOTION_EVENT_AXIS_DISTANCE = 24, + /** + * Axis constant: Tilt axis of a motion event. + * + * - For a stylus, reports the tilt angle of the stylus in radians where + * 0 radians indicates that the stylus is being held perpendicular to the + * surface, and PI/2 radians indicates that the stylus is being held flat + * against the surface. + */ + AMOTION_EVENT_AXIS_TILT = 25, + /** + * Axis constant: Generic 1 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_1 = 32, + /** + * Axis constant: Generic 2 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_2 = 33, + /** + * Axis constant: Generic 3 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_3 = 34, + /** + * Axis constant: Generic 4 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_4 = 35, + /** + * Axis constant: Generic 5 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_5 = 36, + /** + * Axis constant: Generic 6 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_6 = 37, + /** + * Axis constant: Generic 7 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_7 = 38, + /** + * Axis constant: Generic 8 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_8 = 39, + /** + * Axis constant: Generic 9 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_9 = 40, + /** + * Axis constant: Generic 10 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_10 = 41, + /** + * Axis constant: Generic 11 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_11 = 42, + /** + * Axis constant: Generic 12 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_12 = 43, + /** + * Axis constant: Generic 13 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_13 = 44, + /** + * Axis constant: Generic 14 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_14 = 45, + /** + * Axis constant: Generic 15 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_15 = 46, + /** + * Axis constant: Generic 16 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + AMOTION_EVENT_AXIS_GENERIC_16 = 47, + + // NOTE: If you add a new axis here you must also add it to several other files. + // Refer to frameworks/base/core/java/android/view/MotionEvent.java for the full list. +}; + +/** + * Constants that identify buttons that are associated with motion events. + * Refer to the documentation on the MotionEvent class for descriptions of each button. + */ +enum { + /** primary */ + AMOTION_EVENT_BUTTON_PRIMARY = 1 << 0, + /** secondary */ + AMOTION_EVENT_BUTTON_SECONDARY = 1 << 1, + /** tertiary */ + AMOTION_EVENT_BUTTON_TERTIARY = 1 << 2, + /** back */ + AMOTION_EVENT_BUTTON_BACK = 1 << 3, + /** forward */ + AMOTION_EVENT_BUTTON_FORWARD = 1 << 4, + AMOTION_EVENT_BUTTON_STYLUS_PRIMARY = 1 << 5, + AMOTION_EVENT_BUTTON_STYLUS_SECONDARY = 1 << 6, +}; + +/** + * Constants that identify tool types. + * Refer to the documentation on the MotionEvent class for descriptions of each tool type. + */ +enum { + /** unknown */ + AMOTION_EVENT_TOOL_TYPE_UNKNOWN = 0, + /** finger */ + AMOTION_EVENT_TOOL_TYPE_FINGER = 1, + /** stylus */ + AMOTION_EVENT_TOOL_TYPE_STYLUS = 2, + /** mouse */ + AMOTION_EVENT_TOOL_TYPE_MOUSE = 3, + /** eraser */ + AMOTION_EVENT_TOOL_TYPE_ERASER = 4, +}; + +/** + * Input source masks. + * + * Refer to the documentation on android.view.InputDevice for more details about input sources + * and their correct interpretation. + */ +enum { + /** mask */ + AINPUT_SOURCE_CLASS_MASK = 0x000000ff, + + /** none */ + AINPUT_SOURCE_CLASS_NONE = 0x00000000, + /** button */ + AINPUT_SOURCE_CLASS_BUTTON = 0x00000001, + /** pointer */ + AINPUT_SOURCE_CLASS_POINTER = 0x00000002, + /** navigation */ + AINPUT_SOURCE_CLASS_NAVIGATION = 0x00000004, + /** position */ + AINPUT_SOURCE_CLASS_POSITION = 0x00000008, + /** joystick */ + AINPUT_SOURCE_CLASS_JOYSTICK = 0x00000010, +}; + +/** + * Input sources. + */ +enum { + /** unknown */ + AINPUT_SOURCE_UNKNOWN = 0x00000000, + + /** keyboard */ + AINPUT_SOURCE_KEYBOARD = 0x00000100 | AINPUT_SOURCE_CLASS_BUTTON, + /** dpad */ + AINPUT_SOURCE_DPAD = 0x00000200 | AINPUT_SOURCE_CLASS_BUTTON, + /** gamepad */ + AINPUT_SOURCE_GAMEPAD = 0x00000400 | AINPUT_SOURCE_CLASS_BUTTON, + /** touchscreen */ + AINPUT_SOURCE_TOUCHSCREEN = 0x00001000 | AINPUT_SOURCE_CLASS_POINTER, + /** mouse */ + AINPUT_SOURCE_MOUSE = 0x00002000 | AINPUT_SOURCE_CLASS_POINTER, + /** stylus */ + AINPUT_SOURCE_STYLUS = 0x00004000 | AINPUT_SOURCE_CLASS_POINTER, + /** bluetooth stylus */ + AINPUT_SOURCE_BLUETOOTH_STYLUS = 0x00008000 | AINPUT_SOURCE_STYLUS, + /** trackball */ + AINPUT_SOURCE_TRACKBALL = 0x00010000 | AINPUT_SOURCE_CLASS_NAVIGATION, + /** touchpad */ + AINPUT_SOURCE_TOUCHPAD = 0x00100000 | AINPUT_SOURCE_CLASS_POSITION, + /** navigation */ + AINPUT_SOURCE_TOUCH_NAVIGATION = 0x00200000 | AINPUT_SOURCE_CLASS_NONE, + /** gesture sensor (?) */ + AINPUT_SOURCE_GESTURE_SENSOR = 0x00400000 | AINPUT_SOURCE_CLASS_NONE, + /** joystick */ + AINPUT_SOURCE_JOYSTICK = 0x01000000 | AINPUT_SOURCE_CLASS_JOYSTICK, + + /** any */ + AINPUT_SOURCE_ANY = 0xffffff00, +}; + +/** + * Keyboard types. + * + * Refer to the documentation on android.view.InputDevice for more details. + */ +enum { + /** none */ + AINPUT_KEYBOARD_TYPE_NONE = 0, + /** non alphabetic */ + AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC = 1, + /** alphabetic */ + AINPUT_KEYBOARD_TYPE_ALPHABETIC = 2, +}; + +/** + * Constants used to retrieve information about the range of motion for a particular + * coordinate of a motion event. + * + * Refer to the documentation on android.view.InputDevice for more details about input sources + * and their correct interpretation. + * + * @deprecated These constants are deprecated. Use {@link AMOTION_EVENT_AXIS AMOTION_EVENT_AXIS_*} constants instead. + */ +enum { + /** x */ + AINPUT_MOTION_RANGE_X = AMOTION_EVENT_AXIS_X, + /** y */ + AINPUT_MOTION_RANGE_Y = AMOTION_EVENT_AXIS_Y, + /** pressure */ + AINPUT_MOTION_RANGE_PRESSURE = AMOTION_EVENT_AXIS_PRESSURE, + /** size */ + AINPUT_MOTION_RANGE_SIZE = AMOTION_EVENT_AXIS_SIZE, + /** touch major */ + AINPUT_MOTION_RANGE_TOUCH_MAJOR = AMOTION_EVENT_AXIS_TOUCH_MAJOR, + /** touch minor */ + AINPUT_MOTION_RANGE_TOUCH_MINOR = AMOTION_EVENT_AXIS_TOUCH_MINOR, + /** tool major */ + AINPUT_MOTION_RANGE_TOOL_MAJOR = AMOTION_EVENT_AXIS_TOOL_MAJOR, + /** tool minor */ + AINPUT_MOTION_RANGE_TOOL_MINOR = AMOTION_EVENT_AXIS_TOOL_MINOR, + /** orientation */ + AINPUT_MOTION_RANGE_ORIENTATION = AMOTION_EVENT_AXIS_ORIENTATION, +}; + + +/** + * Input event accessors. + * + * Note that most functions can only be used on input events that are of a given type. + * Calling these functions on input events of other types will yield undefined behavior. + */ + +/*** Accessors for all input events. ***/ + +/** Get the input event type. */ +int32_t AInputEvent_getType(const AInputEvent* event); + +/** Get the id for the device that an input event came from. + * + * Input events can be generated by multiple different input devices. + * Use the input device id to obtain information about the input + * device that was responsible for generating a particular event. + * + * An input device id of 0 indicates that the event didn't come from a physical device; + * other numbers are arbitrary and you shouldn't depend on the values. + * Use the provided input device query API to obtain information about input devices. + */ +int32_t AInputEvent_getDeviceId(const AInputEvent* event); + +/** Get the input event source. */ +int32_t AInputEvent_getSource(const AInputEvent* event); + +/*** Accessors for key events only. ***/ + +/** Get the key event action. */ +int32_t AKeyEvent_getAction(const AInputEvent* key_event); + +/** Get the key event flags. */ +int32_t AKeyEvent_getFlags(const AInputEvent* key_event); + +/** + * Get the key code of the key event. + * This is the physical key that was pressed, not the Unicode character. + */ +int32_t AKeyEvent_getKeyCode(const AInputEvent* key_event); + +/** + * Get the hardware key id of this key event. + * These values are not reliable and vary from device to device. + */ +int32_t AKeyEvent_getScanCode(const AInputEvent* key_event); + +/** Get the meta key state. */ +int32_t AKeyEvent_getMetaState(const AInputEvent* key_event); + +/** + * Get the repeat count of the event. + * For both key up an key down events, this is the number of times the key has + * repeated with the first down starting at 0 and counting up from there. For + * multiple key events, this is the number of down/up pairs that have occurred. + */ +int32_t AKeyEvent_getRepeatCount(const AInputEvent* key_event); + +/** + * Get the time of the most recent key down event, in the + * java.lang.System.nanoTime() time base. If this is a down event, + * this will be the same as eventTime. + * Note that when chording keys, this value is the down time of the most recently + * pressed key, which may not be the same physical key of this event. + */ +int64_t AKeyEvent_getDownTime(const AInputEvent* key_event); + +/** + * Get the time this event occurred, in the + * java.lang.System.nanoTime() time base. + */ +int64_t AKeyEvent_getEventTime(const AInputEvent* key_event); + +/*** Accessors for motion events only. ***/ + +/** Get the combined motion event action code and pointer index. */ +int32_t AMotionEvent_getAction(const AInputEvent* motion_event); + +/** Get the motion event flags. */ +int32_t AMotionEvent_getFlags(const AInputEvent* motion_event); + +/** + * Get the state of any meta / modifier keys that were in effect when the + * event was generated. + */ +int32_t AMotionEvent_getMetaState(const AInputEvent* motion_event); + +/** Get the button state of all buttons that are pressed. */ +int32_t AMotionEvent_getButtonState(const AInputEvent* motion_event); + +/** + * Get a bitfield indicating which edges, if any, were touched by this motion event. + * For touch events, clients can use this to determine if the user's finger was + * touching the edge of the display. + */ +int32_t AMotionEvent_getEdgeFlags(const AInputEvent* motion_event); + +/** + * Get the time when the user originally pressed down to start a stream of + * position events, in the java.lang.System.nanoTime() time base. + */ +int64_t AMotionEvent_getDownTime(const AInputEvent* motion_event); + +/** + * Get the time when this specific event was generated, + * in the java.lang.System.nanoTime() time base. + */ +int64_t AMotionEvent_getEventTime(const AInputEvent* motion_event); + +/** + * Get the X coordinate offset. + * For touch events on the screen, this is the delta that was added to the raw + * screen coordinates to adjust for the absolute position of the containing windows + * and views. + */ +float AMotionEvent_getXOffset(const AInputEvent* motion_event); + +/** + * Get the Y coordinate offset. + * For touch events on the screen, this is the delta that was added to the raw + * screen coordinates to adjust for the absolute position of the containing windows + * and views. + */ +float AMotionEvent_getYOffset(const AInputEvent* motion_event); + +/** + * Get the precision of the X coordinates being reported. + * You can multiply this number with an X coordinate sample to find the + * actual hardware value of the X coordinate. + */ +float AMotionEvent_getXPrecision(const AInputEvent* motion_event); + +/** + * Get the precision of the Y coordinates being reported. + * You can multiply this number with a Y coordinate sample to find the + * actual hardware value of the Y coordinate. + */ +float AMotionEvent_getYPrecision(const AInputEvent* motion_event); + +/** + * Get the number of pointers of data contained in this event. + * Always >= 1. + */ +size_t AMotionEvent_getPointerCount(const AInputEvent* motion_event); + +/** + * Get the pointer identifier associated with a particular pointer + * data index in this event. The identifier tells you the actual pointer + * number associated with the data, accounting for individual pointers + * going up and down since the start of the current gesture. + */ +int32_t AMotionEvent_getPointerId(const AInputEvent* motion_event, size_t pointer_index); + +/** + * Get the tool type of a pointer for the given pointer index. + * The tool type indicates the type of tool used to make contact such as a + * finger or stylus, if known. + */ +int32_t AMotionEvent_getToolType(const AInputEvent* motion_event, size_t pointer_index); + +/** + * Get the original raw X coordinate of this event. + * For touch events on the screen, this is the original location of the event + * on the screen, before it had been adjusted for the containing window + * and views. + */ +float AMotionEvent_getRawX(const AInputEvent* motion_event, size_t pointer_index); + +/** + * Get the original raw X coordinate of this event. + * For touch events on the screen, this is the original location of the event + * on the screen, before it had been adjusted for the containing window + * and views. + */ +float AMotionEvent_getRawY(const AInputEvent* motion_event, size_t pointer_index); + +/** + * Get the current X coordinate of this event for the given pointer index. + * Whole numbers are pixels; the value may have a fraction for input devices + * that are sub-pixel precise. + */ +float AMotionEvent_getX(const AInputEvent* motion_event, size_t pointer_index); + +/** + * Get the current Y coordinate of this event for the given pointer index. + * Whole numbers are pixels; the value may have a fraction for input devices + * that are sub-pixel precise. + */ +float AMotionEvent_getY(const AInputEvent* motion_event, size_t pointer_index); + +/** + * Get the current pressure of this event for the given pointer index. + * The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure), + * although values higher than 1 may be generated depending on the calibration of + * the input device. + */ +float AMotionEvent_getPressure(const AInputEvent* motion_event, size_t pointer_index); + +/** + * Get the current scaled value of the approximate size for the given pointer index. + * This represents some approximation of the area of the screen being + * pressed; the actual value in pixels corresponding to the + * touch is normalized with the device specific range of values + * and scaled to a value between 0 and 1. The value of size can be used to + * determine fat touch events. + */ +float AMotionEvent_getSize(const AInputEvent* motion_event, size_t pointer_index); + +/** + * Get the current length of the major axis of an ellipse that describes the touch area + * at the point of contact for the given pointer index. + */ +float AMotionEvent_getTouchMajor(const AInputEvent* motion_event, size_t pointer_index); + +/** + * Get the current length of the minor axis of an ellipse that describes the touch area + * at the point of contact for the given pointer index. + */ +float AMotionEvent_getTouchMinor(const AInputEvent* motion_event, size_t pointer_index); + +/** + * Get the current length of the major axis of an ellipse that describes the size + * of the approaching tool for the given pointer index. + * The tool area represents the estimated size of the finger or pen that is + * touching the device independent of its actual touch area at the point of contact. + */ +float AMotionEvent_getToolMajor(const AInputEvent* motion_event, size_t pointer_index); + +/** + * Get the current length of the minor axis of an ellipse that describes the size + * of the approaching tool for the given pointer index. + * The tool area represents the estimated size of the finger or pen that is + * touching the device independent of its actual touch area at the point of contact. + */ +float AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_index); + +/** + * Get the current orientation of the touch area and tool area in radians clockwise from + * vertical for the given pointer index. + * An angle of 0 degrees indicates that the major axis of contact is oriented + * upwards, is perfectly circular or is of unknown orientation. A positive angle + * indicates that the major axis of contact is oriented to the right. A negative angle + * indicates that the major axis of contact is oriented to the left. + * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians + * (finger pointing fully right). + */ +float AMotionEvent_getOrientation(const AInputEvent* motion_event, size_t pointer_index); + +/** Get the value of the request axis for the given pointer index. */ +float AMotionEvent_getAxisValue(const AInputEvent* motion_event, + int32_t axis, size_t pointer_index); + +/** + * Get the number of historical points in this event. These are movements that + * have occurred between this event and the previous event. This only applies + * to AMOTION_EVENT_ACTION_MOVE events -- all other actions will have a size of 0. + * Historical samples are indexed from oldest to newest. + */ +size_t AMotionEvent_getHistorySize(const AInputEvent* motion_event); + +/** + * Get the time that a historical movement occurred between this event and + * the previous event, in the java.lang.System.nanoTime() time base. + */ +int64_t AMotionEvent_getHistoricalEventTime(const AInputEvent* motion_event, + size_t history_index); + +/** + * Get the historical raw X coordinate of this event for the given pointer index that + * occurred between this event and the previous motion event. + * For touch events on the screen, this is the original location of the event + * on the screen, before it had been adjusted for the containing window + * and views. + * Whole numbers are pixels; the value may have a fraction for input devices + * that are sub-pixel precise. + */ +float AMotionEvent_getHistoricalRawX(const AInputEvent* motion_event, size_t pointer_index, + size_t history_index); + +/** + * Get the historical raw Y coordinate of this event for the given pointer index that + * occurred between this event and the previous motion event. + * For touch events on the screen, this is the original location of the event + * on the screen, before it had been adjusted for the containing window + * and views. + * Whole numbers are pixels; the value may have a fraction for input devices + * that are sub-pixel precise. + */ +float AMotionEvent_getHistoricalRawY(const AInputEvent* motion_event, size_t pointer_index, + size_t history_index); + +/** + * Get the historical X coordinate of this event for the given pointer index that + * occurred between this event and the previous motion event. + * Whole numbers are pixels; the value may have a fraction for input devices + * that are sub-pixel precise. + */ +float AMotionEvent_getHistoricalX(const AInputEvent* motion_event, size_t pointer_index, + size_t history_index); + +/** + * Get the historical Y coordinate of this event for the given pointer index that + * occurred between this event and the previous motion event. + * Whole numbers are pixels; the value may have a fraction for input devices + * that are sub-pixel precise. + */ +float AMotionEvent_getHistoricalY(const AInputEvent* motion_event, size_t pointer_index, + size_t history_index); + +/** + * Get the historical pressure of this event for the given pointer index that + * occurred between this event and the previous motion event. + * The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure), + * although values higher than 1 may be generated depending on the calibration of + * the input device. + */ +float AMotionEvent_getHistoricalPressure(const AInputEvent* motion_event, size_t pointer_index, + size_t history_index); + +/** + * Get the current scaled value of the approximate size for the given pointer index that + * occurred between this event and the previous motion event. + * This represents some approximation of the area of the screen being + * pressed; the actual value in pixels corresponding to the + * touch is normalized with the device specific range of values + * and scaled to a value between 0 and 1. The value of size can be used to + * determine fat touch events. + */ +float AMotionEvent_getHistoricalSize(const AInputEvent* motion_event, size_t pointer_index, + size_t history_index); + +/** + * Get the historical length of the major axis of an ellipse that describes the touch area + * at the point of contact for the given pointer index that + * occurred between this event and the previous motion event. + */ +float AMotionEvent_getHistoricalTouchMajor(const AInputEvent* motion_event, size_t pointer_index, + size_t history_index); + +/** + * Get the historical length of the minor axis of an ellipse that describes the touch area + * at the point of contact for the given pointer index that + * occurred between this event and the previous motion event. + */ +float AMotionEvent_getHistoricalTouchMinor(const AInputEvent* motion_event, size_t pointer_index, + size_t history_index); + +/** + * Get the historical length of the major axis of an ellipse that describes the size + * of the approaching tool for the given pointer index that + * occurred between this event and the previous motion event. + * The tool area represents the estimated size of the finger or pen that is + * touching the device independent of its actual touch area at the point of contact. + */ +float AMotionEvent_getHistoricalToolMajor(const AInputEvent* motion_event, size_t pointer_index, + size_t history_index); + +/** + * Get the historical length of the minor axis of an ellipse that describes the size + * of the approaching tool for the given pointer index that + * occurred between this event and the previous motion event. + * The tool area represents the estimated size of the finger or pen that is + * touching the device independent of its actual touch area at the point of contact. + */ +float AMotionEvent_getHistoricalToolMinor(const AInputEvent* motion_event, size_t pointer_index, + size_t history_index); + +/** + * Get the historical orientation of the touch area and tool area in radians clockwise from + * vertical for the given pointer index that + * occurred between this event and the previous motion event. + * An angle of 0 degrees indicates that the major axis of contact is oriented + * upwards, is perfectly circular or is of unknown orientation. A positive angle + * indicates that the major axis of contact is oriented to the right. A negative angle + * indicates that the major axis of contact is oriented to the left. + * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians + * (finger pointing fully right). + */ +float AMotionEvent_getHistoricalOrientation(const AInputEvent* motion_event, size_t pointer_index, + size_t history_index); + +/** + * Get the historical value of the request axis for the given pointer index + * that occurred between this event and the previous motion event. + */ +float AMotionEvent_getHistoricalAxisValue(const AInputEvent* motion_event, + int32_t axis, size_t pointer_index, size_t history_index); + + +struct AInputQueue; +/** + * Input queue + * + * An input queue is the facility through which you retrieve input + * events. + */ +typedef struct AInputQueue AInputQueue; + +/** + * Add this input queue to a looper for processing. See + * ALooper_addFd() for information on the ident, callback, and data params. + */ +void AInputQueue_attachLooper(AInputQueue* queue, ALooper* looper, + int ident, ALooper_callbackFunc callback, void* data); + +/** + * Remove the input queue from the looper it is currently attached to. + */ +void AInputQueue_detachLooper(AInputQueue* queue); + +/** + * Returns true if there are one or more events available in the + * input queue. Returns 1 if the queue has events; 0 if + * it does not have events; and a negative value if there is an error. + */ +int32_t AInputQueue_hasEvents(AInputQueue* queue); + +/** + * Returns the next available event from the queue. Returns a negative + * value if no events are available or an error has occurred. + */ +int32_t AInputQueue_getEvent(AInputQueue* queue, AInputEvent** outEvent); + +/** + * Sends the key for standard pre-dispatching -- that is, possibly deliver + * it to the current IME to be consumed before the app. Returns 0 if it + * was not pre-dispatched, meaning you can process it right now. If non-zero + * is returned, you must abandon the current event processing and allow the + * event to appear again in the event queue (if it does not get consumed during + * pre-dispatching). + */ +int32_t AInputQueue_preDispatchEvent(AInputQueue* queue, AInputEvent* event); + +/** + * Report that dispatching has finished with the given event. + * This must be called after receiving an event with AInputQueue_get_event(). + */ +void AInputQueue_finishEvent(AInputQueue* queue, AInputEvent* event, int handled); + +#ifdef __cplusplus +} +#endif + +#endif // _ANDROID_INPUT_H + +/** @} */ diff --git a/third_party/android_frameworks_native/include/android/keycodes.h b/third_party/android_frameworks_native/include/android/keycodes.h new file mode 100644 index 000000000..421abe547 --- /dev/null +++ b/third_party/android_frameworks_native/include/android/keycodes.h @@ -0,0 +1,752 @@ +/* + * Copyright (C) 2010 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. + */ + +/** + * @addtogroup Input + * @{ + */ + +/** + * @file keycodes.h + */ + +#ifndef _ANDROID_KEYCODES_H +#define _ANDROID_KEYCODES_H + +/****************************************************************** + * + * IMPORTANT NOTICE: + * + * This file is part of Android's set of stable system headers + * exposed by the Android NDK (Native Development Kit). + * + * Third-party source AND binary code relies on the definitions + * here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES. + * + * - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES) + * - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS + * - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY + * - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Key codes. + */ +enum { + /** Unknown key code. */ + AKEYCODE_UNKNOWN = 0, + /** Soft Left key. + * Usually situated below the display on phones and used as a multi-function + * feature key for selecting a software defined function shown on the bottom left + * of the display. */ + AKEYCODE_SOFT_LEFT = 1, + /** Soft Right key. + * Usually situated below the display on phones and used as a multi-function + * feature key for selecting a software defined function shown on the bottom right + * of the display. */ + AKEYCODE_SOFT_RIGHT = 2, + /** Home key. + * This key is handled by the framework and is never delivered to applications. */ + AKEYCODE_HOME = 3, + /** Back key. */ + AKEYCODE_BACK = 4, + /** Call key. */ + AKEYCODE_CALL = 5, + /** End Call key. */ + AKEYCODE_ENDCALL = 6, + /** '0' key. */ + AKEYCODE_0 = 7, + /** '1' key. */ + AKEYCODE_1 = 8, + /** '2' key. */ + AKEYCODE_2 = 9, + /** '3' key. */ + AKEYCODE_3 = 10, + /** '4' key. */ + AKEYCODE_4 = 11, + /** '5' key. */ + AKEYCODE_5 = 12, + /** '6' key. */ + AKEYCODE_6 = 13, + /** '7' key. */ + AKEYCODE_7 = 14, + /** '8' key. */ + AKEYCODE_8 = 15, + /** '9' key. */ + AKEYCODE_9 = 16, + /** '*' key. */ + AKEYCODE_STAR = 17, + /** '#' key. */ + AKEYCODE_POUND = 18, + /** Directional Pad Up key. + * May also be synthesized from trackball motions. */ + AKEYCODE_DPAD_UP = 19, + /** Directional Pad Down key. + * May also be synthesized from trackball motions. */ + AKEYCODE_DPAD_DOWN = 20, + /** Directional Pad Left key. + * May also be synthesized from trackball motions. */ + AKEYCODE_DPAD_LEFT = 21, + /** Directional Pad Right key. + * May also be synthesized from trackball motions. */ + AKEYCODE_DPAD_RIGHT = 22, + /** Directional Pad Center key. + * May also be synthesized from trackball motions. */ + AKEYCODE_DPAD_CENTER = 23, + /** Volume Up key. + * Adjusts the speaker volume up. */ + AKEYCODE_VOLUME_UP = 24, + /** Volume Down key. + * Adjusts the speaker volume down. */ + AKEYCODE_VOLUME_DOWN = 25, + /** Power key. */ + AKEYCODE_POWER = 26, + /** Camera key. + * Used to launch a camera application or take pictures. */ + AKEYCODE_CAMERA = 27, + /** Clear key. */ + AKEYCODE_CLEAR = 28, + /** 'A' key. */ + AKEYCODE_A = 29, + /** 'B' key. */ + AKEYCODE_B = 30, + /** 'C' key. */ + AKEYCODE_C = 31, + /** 'D' key. */ + AKEYCODE_D = 32, + /** 'E' key. */ + AKEYCODE_E = 33, + /** 'F' key. */ + AKEYCODE_F = 34, + /** 'G' key. */ + AKEYCODE_G = 35, + /** 'H' key. */ + AKEYCODE_H = 36, + /** 'I' key. */ + AKEYCODE_I = 37, + /** 'J' key. */ + AKEYCODE_J = 38, + /** 'K' key. */ + AKEYCODE_K = 39, + /** 'L' key. */ + AKEYCODE_L = 40, + /** 'M' key. */ + AKEYCODE_M = 41, + /** 'N' key. */ + AKEYCODE_N = 42, + /** 'O' key. */ + AKEYCODE_O = 43, + /** 'P' key. */ + AKEYCODE_P = 44, + /** 'Q' key. */ + AKEYCODE_Q = 45, + /** 'R' key. */ + AKEYCODE_R = 46, + /** 'S' key. */ + AKEYCODE_S = 47, + /** 'T' key. */ + AKEYCODE_T = 48, + /** 'U' key. */ + AKEYCODE_U = 49, + /** 'V' key. */ + AKEYCODE_V = 50, + /** 'W' key. */ + AKEYCODE_W = 51, + /** 'X' key. */ + AKEYCODE_X = 52, + /** 'Y' key. */ + AKEYCODE_Y = 53, + /** 'Z' key. */ + AKEYCODE_Z = 54, + /** ',' key. */ + AKEYCODE_COMMA = 55, + /** '.' key. */ + AKEYCODE_PERIOD = 56, + /** Left Alt modifier key. */ + AKEYCODE_ALT_LEFT = 57, + /** Right Alt modifier key. */ + AKEYCODE_ALT_RIGHT = 58, + /** Left Shift modifier key. */ + AKEYCODE_SHIFT_LEFT = 59, + /** Right Shift modifier key. */ + AKEYCODE_SHIFT_RIGHT = 60, + /** Tab key. */ + AKEYCODE_TAB = 61, + /** Space key. */ + AKEYCODE_SPACE = 62, + /** Symbol modifier key. + * Used to enter alternate symbols. */ + AKEYCODE_SYM = 63, + /** Explorer special function key. + * Used to launch a browser application. */ + AKEYCODE_EXPLORER = 64, + /** Envelope special function key. + * Used to launch a mail application. */ + AKEYCODE_ENVELOPE = 65, + /** Enter key. */ + AKEYCODE_ENTER = 66, + /** Backspace key. + * Deletes characters before the insertion point, unlike {@link AKEYCODE_FORWARD_DEL}. */ + AKEYCODE_DEL = 67, + /** '`' (backtick) key. */ + AKEYCODE_GRAVE = 68, + /** '-'. */ + AKEYCODE_MINUS = 69, + /** '=' key. */ + AKEYCODE_EQUALS = 70, + /** '[' key. */ + AKEYCODE_LEFT_BRACKET = 71, + /** ']' key. */ + AKEYCODE_RIGHT_BRACKET = 72, + /** '\' key. */ + AKEYCODE_BACKSLASH = 73, + /** ';' key. */ + AKEYCODE_SEMICOLON = 74, + /** ''' (apostrophe) key. */ + AKEYCODE_APOSTROPHE = 75, + /** '/' key. */ + AKEYCODE_SLASH = 76, + /** '@' key. */ + AKEYCODE_AT = 77, + /** Number modifier key. + * Used to enter numeric symbols. + * This key is not {@link AKEYCODE_NUM_LOCK}; it is more like {@link AKEYCODE_ALT_LEFT}. */ + AKEYCODE_NUM = 78, + /** Headset Hook key. + * Used to hang up calls and stop media. */ + AKEYCODE_HEADSETHOOK = 79, + /** Camera Focus key. + * Used to focus the camera. */ + AKEYCODE_FOCUS = 80, + /** '+' key. */ + AKEYCODE_PLUS = 81, + /** Menu key. */ + AKEYCODE_MENU = 82, + /** Notification key. */ + AKEYCODE_NOTIFICATION = 83, + /** Search key. */ + AKEYCODE_SEARCH = 84, + /** Play/Pause media key. */ + AKEYCODE_MEDIA_PLAY_PAUSE= 85, + /** Stop media key. */ + AKEYCODE_MEDIA_STOP = 86, + /** Play Next media key. */ + AKEYCODE_MEDIA_NEXT = 87, + /** Play Previous media key. */ + AKEYCODE_MEDIA_PREVIOUS = 88, + /** Rewind media key. */ + AKEYCODE_MEDIA_REWIND = 89, + /** Fast Forward media key. */ + AKEYCODE_MEDIA_FAST_FORWARD = 90, + /** Mute key. + * Mutes the microphone, unlike {@link AKEYCODE_VOLUME_MUTE}. */ + AKEYCODE_MUTE = 91, + /** Page Up key. */ + AKEYCODE_PAGE_UP = 92, + /** Page Down key. */ + AKEYCODE_PAGE_DOWN = 93, + /** Picture Symbols modifier key. + * Used to switch symbol sets (Emoji, Kao-moji). */ + AKEYCODE_PICTSYMBOLS = 94, + /** Switch Charset modifier key. + * Used to switch character sets (Kanji, Katakana). */ + AKEYCODE_SWITCH_CHARSET = 95, + /** A Button key. + * On a game controller, the A button should be either the button labeled A + * or the first button on the bottom row of controller buttons. */ + AKEYCODE_BUTTON_A = 96, + /** B Button key. + * On a game controller, the B button should be either the button labeled B + * or the second button on the bottom row of controller buttons. */ + AKEYCODE_BUTTON_B = 97, + /** C Button key. + * On a game controller, the C button should be either the button labeled C + * or the third button on the bottom row of controller buttons. */ + AKEYCODE_BUTTON_C = 98, + /** X Button key. + * On a game controller, the X button should be either the button labeled X + * or the first button on the upper row of controller buttons. */ + AKEYCODE_BUTTON_X = 99, + /** Y Button key. + * On a game controller, the Y button should be either the button labeled Y + * or the second button on the upper row of controller buttons. */ + AKEYCODE_BUTTON_Y = 100, + /** Z Button key. + * On a game controller, the Z button should be either the button labeled Z + * or the third button on the upper row of controller buttons. */ + AKEYCODE_BUTTON_Z = 101, + /** L1 Button key. + * On a game controller, the L1 button should be either the button labeled L1 (or L) + * or the top left trigger button. */ + AKEYCODE_BUTTON_L1 = 102, + /** R1 Button key. + * On a game controller, the R1 button should be either the button labeled R1 (or R) + * or the top right trigger button. */ + AKEYCODE_BUTTON_R1 = 103, + /** L2 Button key. + * On a game controller, the L2 button should be either the button labeled L2 + * or the bottom left trigger button. */ + AKEYCODE_BUTTON_L2 = 104, + /** R2 Button key. + * On a game controller, the R2 button should be either the button labeled R2 + * or the bottom right trigger button. */ + AKEYCODE_BUTTON_R2 = 105, + /** Left Thumb Button key. + * On a game controller, the left thumb button indicates that the left (or only) + * joystick is pressed. */ + AKEYCODE_BUTTON_THUMBL = 106, + /** Right Thumb Button key. + * On a game controller, the right thumb button indicates that the right + * joystick is pressed. */ + AKEYCODE_BUTTON_THUMBR = 107, + /** Start Button key. + * On a game controller, the button labeled Start. */ + AKEYCODE_BUTTON_START = 108, + /** Select Button key. + * On a game controller, the button labeled Select. */ + AKEYCODE_BUTTON_SELECT = 109, + /** Mode Button key. + * On a game controller, the button labeled Mode. */ + AKEYCODE_BUTTON_MODE = 110, + /** Escape key. */ + AKEYCODE_ESCAPE = 111, + /** Forward Delete key. + * Deletes characters ahead of the insertion point, unlike {@link AKEYCODE_DEL}. */ + AKEYCODE_FORWARD_DEL = 112, + /** Left Control modifier key. */ + AKEYCODE_CTRL_LEFT = 113, + /** Right Control modifier key. */ + AKEYCODE_CTRL_RIGHT = 114, + /** Caps Lock key. */ + AKEYCODE_CAPS_LOCK = 115, + /** Scroll Lock key. */ + AKEYCODE_SCROLL_LOCK = 116, + /** Left Meta modifier key. */ + AKEYCODE_META_LEFT = 117, + /** Right Meta modifier key. */ + AKEYCODE_META_RIGHT = 118, + /** Function modifier key. */ + AKEYCODE_FUNCTION = 119, + /** System Request / Print Screen key. */ + AKEYCODE_SYSRQ = 120, + /** Break / Pause key. */ + AKEYCODE_BREAK = 121, + /** Home Movement key. + * Used for scrolling or moving the cursor around to the start of a line + * or to the top of a list. */ + AKEYCODE_MOVE_HOME = 122, + /** End Movement key. + * Used for scrolling or moving the cursor around to the end of a line + * or to the bottom of a list. */ + AKEYCODE_MOVE_END = 123, + /** Insert key. + * Toggles insert / overwrite edit mode. */ + AKEYCODE_INSERT = 124, + /** Forward key. + * Navigates forward in the history stack. Complement of {@link AKEYCODE_BACK}. */ + AKEYCODE_FORWARD = 125, + /** Play media key. */ + AKEYCODE_MEDIA_PLAY = 126, + /** Pause media key. */ + AKEYCODE_MEDIA_PAUSE = 127, + /** Close media key. + * May be used to close a CD tray, for example. */ + AKEYCODE_MEDIA_CLOSE = 128, + /** Eject media key. + * May be used to eject a CD tray, for example. */ + AKEYCODE_MEDIA_EJECT = 129, + /** Record media key. */ + AKEYCODE_MEDIA_RECORD = 130, + /** F1 key. */ + AKEYCODE_F1 = 131, + /** F2 key. */ + AKEYCODE_F2 = 132, + /** F3 key. */ + AKEYCODE_F3 = 133, + /** F4 key. */ + AKEYCODE_F4 = 134, + /** F5 key. */ + AKEYCODE_F5 = 135, + /** F6 key. */ + AKEYCODE_F6 = 136, + /** F7 key. */ + AKEYCODE_F7 = 137, + /** F8 key. */ + AKEYCODE_F8 = 138, + /** F9 key. */ + AKEYCODE_F9 = 139, + /** F10 key. */ + AKEYCODE_F10 = 140, + /** F11 key. */ + AKEYCODE_F11 = 141, + /** F12 key. */ + AKEYCODE_F12 = 142, + /** Num Lock key. + * This is the Num Lock key; it is different from {@link AKEYCODE_NUM}. + * This key alters the behavior of other keys on the numeric keypad. */ + AKEYCODE_NUM_LOCK = 143, + /** Numeric keypad '0' key. */ + AKEYCODE_NUMPAD_0 = 144, + /** Numeric keypad '1' key. */ + AKEYCODE_NUMPAD_1 = 145, + /** Numeric keypad '2' key. */ + AKEYCODE_NUMPAD_2 = 146, + /** Numeric keypad '3' key. */ + AKEYCODE_NUMPAD_3 = 147, + /** Numeric keypad '4' key. */ + AKEYCODE_NUMPAD_4 = 148, + /** Numeric keypad '5' key. */ + AKEYCODE_NUMPAD_5 = 149, + /** Numeric keypad '6' key. */ + AKEYCODE_NUMPAD_6 = 150, + /** Numeric keypad '7' key. */ + AKEYCODE_NUMPAD_7 = 151, + /** Numeric keypad '8' key. */ + AKEYCODE_NUMPAD_8 = 152, + /** Numeric keypad '9' key. */ + AKEYCODE_NUMPAD_9 = 153, + /** Numeric keypad '/' key (for division). */ + AKEYCODE_NUMPAD_DIVIDE = 154, + /** Numeric keypad '*' key (for multiplication). */ + AKEYCODE_NUMPAD_MULTIPLY = 155, + /** Numeric keypad '-' key (for subtraction). */ + AKEYCODE_NUMPAD_SUBTRACT = 156, + /** Numeric keypad '+' key (for addition). */ + AKEYCODE_NUMPAD_ADD = 157, + /** Numeric keypad '.' key (for decimals or digit grouping). */ + AKEYCODE_NUMPAD_DOT = 158, + /** Numeric keypad ',' key (for decimals or digit grouping). */ + AKEYCODE_NUMPAD_COMMA = 159, + /** Numeric keypad Enter key. */ + AKEYCODE_NUMPAD_ENTER = 160, + /** Numeric keypad '=' key. */ + AKEYCODE_NUMPAD_EQUALS = 161, + /** Numeric keypad '(' key. */ + AKEYCODE_NUMPAD_LEFT_PAREN = 162, + /** Numeric keypad ')' key. */ + AKEYCODE_NUMPAD_RIGHT_PAREN = 163, + /** Volume Mute key. + * Mutes the speaker, unlike {@link AKEYCODE_MUTE}. + * This key should normally be implemented as a toggle such that the first press + * mutes the speaker and the second press restores the original volume. */ + AKEYCODE_VOLUME_MUTE = 164, + /** Info key. + * Common on TV remotes to show additional information related to what is + * currently being viewed. */ + AKEYCODE_INFO = 165, + /** Channel up key. + * On TV remotes, increments the television channel. */ + AKEYCODE_CHANNEL_UP = 166, + /** Channel down key. + * On TV remotes, decrements the television channel. */ + AKEYCODE_CHANNEL_DOWN = 167, + /** Zoom in key. */ + AKEYCODE_ZOOM_IN = 168, + /** Zoom out key. */ + AKEYCODE_ZOOM_OUT = 169, + /** TV key. + * On TV remotes, switches to viewing live TV. */ + AKEYCODE_TV = 170, + /** Window key. + * On TV remotes, toggles picture-in-picture mode or other windowing functions. */ + AKEYCODE_WINDOW = 171, + /** Guide key. + * On TV remotes, shows a programming guide. */ + AKEYCODE_GUIDE = 172, + /** DVR key. + * On some TV remotes, switches to a DVR mode for recorded shows. */ + AKEYCODE_DVR = 173, + /** Bookmark key. + * On some TV remotes, bookmarks content or web pages. */ + AKEYCODE_BOOKMARK = 174, + /** Toggle captions key. + * Switches the mode for closed-captioning text, for example during television shows. */ + AKEYCODE_CAPTIONS = 175, + /** Settings key. + * Starts the system settings activity. */ + AKEYCODE_SETTINGS = 176, + /** TV power key. + * On TV remotes, toggles the power on a television screen. */ + AKEYCODE_TV_POWER = 177, + /** TV input key. + * On TV remotes, switches the input on a television screen. */ + AKEYCODE_TV_INPUT = 178, + /** Set-top-box power key. + * On TV remotes, toggles the power on an external Set-top-box. */ + AKEYCODE_STB_POWER = 179, + /** Set-top-box input key. + * On TV remotes, switches the input mode on an external Set-top-box. */ + AKEYCODE_STB_INPUT = 180, + /** A/V Receiver power key. + * On TV remotes, toggles the power on an external A/V Receiver. */ + AKEYCODE_AVR_POWER = 181, + /** A/V Receiver input key. + * On TV remotes, switches the input mode on an external A/V Receiver. */ + AKEYCODE_AVR_INPUT = 182, + /** Red "programmable" key. + * On TV remotes, acts as a contextual/programmable key. */ + AKEYCODE_PROG_RED = 183, + /** Green "programmable" key. + * On TV remotes, actsas a contextual/programmable key. */ + AKEYCODE_PROG_GREEN = 184, + /** Yellow "programmable" key. + * On TV remotes, acts as a contextual/programmable key. */ + AKEYCODE_PROG_YELLOW = 185, + /** Blue "programmable" key. + * On TV remotes, acts as a contextual/programmable key. */ + AKEYCODE_PROG_BLUE = 186, + /** App switch key. + * Should bring up the application switcher dialog. */ + AKEYCODE_APP_SWITCH = 187, + /** Generic Game Pad Button #1.*/ + AKEYCODE_BUTTON_1 = 188, + /** Generic Game Pad Button #2.*/ + AKEYCODE_BUTTON_2 = 189, + /** Generic Game Pad Button #3.*/ + AKEYCODE_BUTTON_3 = 190, + /** Generic Game Pad Button #4.*/ + AKEYCODE_BUTTON_4 = 191, + /** Generic Game Pad Button #5.*/ + AKEYCODE_BUTTON_5 = 192, + /** Generic Game Pad Button #6.*/ + AKEYCODE_BUTTON_6 = 193, + /** Generic Game Pad Button #7.*/ + AKEYCODE_BUTTON_7 = 194, + /** Generic Game Pad Button #8.*/ + AKEYCODE_BUTTON_8 = 195, + /** Generic Game Pad Button #9.*/ + AKEYCODE_BUTTON_9 = 196, + /** Generic Game Pad Button #10.*/ + AKEYCODE_BUTTON_10 = 197, + /** Generic Game Pad Button #11.*/ + AKEYCODE_BUTTON_11 = 198, + /** Generic Game Pad Button #12.*/ + AKEYCODE_BUTTON_12 = 199, + /** Generic Game Pad Button #13.*/ + AKEYCODE_BUTTON_13 = 200, + /** Generic Game Pad Button #14.*/ + AKEYCODE_BUTTON_14 = 201, + /** Generic Game Pad Button #15.*/ + AKEYCODE_BUTTON_15 = 202, + /** Generic Game Pad Button #16.*/ + AKEYCODE_BUTTON_16 = 203, + /** Language Switch key. + * Toggles the current input language such as switching between English and Japanese on + * a QWERTY keyboard. On some devices, the same function may be performed by + * pressing Shift+Spacebar. */ + AKEYCODE_LANGUAGE_SWITCH = 204, + /** Manner Mode key. + * Toggles silent or vibrate mode on and off to make the device behave more politely + * in certain settings such as on a crowded train. On some devices, the key may only + * operate when long-pressed. */ + AKEYCODE_MANNER_MODE = 205, + /** 3D Mode key. + * Toggles the display between 2D and 3D mode. */ + AKEYCODE_3D_MODE = 206, + /** Contacts special function key. + * Used to launch an address book application. */ + AKEYCODE_CONTACTS = 207, + /** Calendar special function key. + * Used to launch a calendar application. */ + AKEYCODE_CALENDAR = 208, + /** Music special function key. + * Used to launch a music player application. */ + AKEYCODE_MUSIC = 209, + /** Calculator special function key. + * Used to launch a calculator application. */ + AKEYCODE_CALCULATOR = 210, + /** Japanese full-width / half-width key. */ + AKEYCODE_ZENKAKU_HANKAKU = 211, + /** Japanese alphanumeric key. */ + AKEYCODE_EISU = 212, + /** Japanese non-conversion key. */ + AKEYCODE_MUHENKAN = 213, + /** Japanese conversion key. */ + AKEYCODE_HENKAN = 214, + /** Japanese katakana / hiragana key. */ + AKEYCODE_KATAKANA_HIRAGANA = 215, + /** Japanese Yen key. */ + AKEYCODE_YEN = 216, + /** Japanese Ro key. */ + AKEYCODE_RO = 217, + /** Japanese kana key. */ + AKEYCODE_KANA = 218, + /** Assist key. + * Launches the global assist activity. Not delivered to applications. */ + AKEYCODE_ASSIST = 219, + /** Brightness Down key. + * Adjusts the screen brightness down. */ + AKEYCODE_BRIGHTNESS_DOWN = 220, + /** Brightness Up key. + * Adjusts the screen brightness up. */ + AKEYCODE_BRIGHTNESS_UP = 221, + /** Audio Track key. + * Switches the audio tracks. */ + AKEYCODE_MEDIA_AUDIO_TRACK = 222, + /** Sleep key. + * Puts the device to sleep. Behaves somewhat like {@link AKEYCODE_POWER} but it + * has no effect if the device is already asleep. */ + AKEYCODE_SLEEP = 223, + /** Wakeup key. + * Wakes up the device. Behaves somewhat like {@link AKEYCODE_POWER} but it + * has no effect if the device is already awake. */ + AKEYCODE_WAKEUP = 224, + /** Pairing key. + * Initiates peripheral pairing mode. Useful for pairing remote control + * devices or game controllers, especially if no other input mode is + * available. */ + AKEYCODE_PAIRING = 225, + /** Media Top Menu key. + * Goes to the top of media menu. */ + AKEYCODE_MEDIA_TOP_MENU = 226, + /** '11' key. */ + AKEYCODE_11 = 227, + /** '12' key. */ + AKEYCODE_12 = 228, + /** Last Channel key. + * Goes to the last viewed channel. */ + AKEYCODE_LAST_CHANNEL = 229, + /** TV data service key. + * Displays data services like weather, sports. */ + AKEYCODE_TV_DATA_SERVICE = 230, + /** Voice Assist key. + * Launches the global voice assist activity. Not delivered to applications. */ + AKEYCODE_VOICE_ASSIST = 231, + /** Radio key. + * Toggles TV service / Radio service. */ + AKEYCODE_TV_RADIO_SERVICE = 232, + /** Teletext key. + * Displays Teletext service. */ + AKEYCODE_TV_TELETEXT = 233, + /** Number entry key. + * Initiates to enter multi-digit channel nubmber when each digit key is assigned + * for selecting separate channel. Corresponds to Number Entry Mode (0x1D) of CEC + * User Control Code. */ + AKEYCODE_TV_NUMBER_ENTRY = 234, + /** Analog Terrestrial key. + * Switches to analog terrestrial broadcast service. */ + AKEYCODE_TV_TERRESTRIAL_ANALOG = 235, + /** Digital Terrestrial key. + * Switches to digital terrestrial broadcast service. */ + AKEYCODE_TV_TERRESTRIAL_DIGITAL = 236, + /** Satellite key. + * Switches to digital satellite broadcast service. */ + AKEYCODE_TV_SATELLITE = 237, + /** BS key. + * Switches to BS digital satellite broadcasting service available in Japan. */ + AKEYCODE_TV_SATELLITE_BS = 238, + /** CS key. + * Switches to CS digital satellite broadcasting service available in Japan. */ + AKEYCODE_TV_SATELLITE_CS = 239, + /** BS/CS key. + * Toggles between BS and CS digital satellite services. */ + AKEYCODE_TV_SATELLITE_SERVICE = 240, + /** Toggle Network key. + * Toggles selecting broacast services. */ + AKEYCODE_TV_NETWORK = 241, + /** Antenna/Cable key. + * Toggles broadcast input source between antenna and cable. */ + AKEYCODE_TV_ANTENNA_CABLE = 242, + /** HDMI #1 key. + * Switches to HDMI input #1. */ + AKEYCODE_TV_INPUT_HDMI_1 = 243, + /** HDMI #2 key. + * Switches to HDMI input #2. */ + AKEYCODE_TV_INPUT_HDMI_2 = 244, + /** HDMI #3 key. + * Switches to HDMI input #3. */ + AKEYCODE_TV_INPUT_HDMI_3 = 245, + /** HDMI #4 key. + * Switches to HDMI input #4. */ + AKEYCODE_TV_INPUT_HDMI_4 = 246, + /** Composite #1 key. + * Switches to composite video input #1. */ + AKEYCODE_TV_INPUT_COMPOSITE_1 = 247, + /** Composite #2 key. + * Switches to composite video input #2. */ + AKEYCODE_TV_INPUT_COMPOSITE_2 = 248, + /** Component #1 key. + * Switches to component video input #1. */ + AKEYCODE_TV_INPUT_COMPONENT_1 = 249, + /** Component #2 key. + * Switches to component video input #2. */ + AKEYCODE_TV_INPUT_COMPONENT_2 = 250, + /** VGA #1 key. + * Switches to VGA (analog RGB) input #1. */ + AKEYCODE_TV_INPUT_VGA_1 = 251, + /** Audio description key. + * Toggles audio description off / on. */ + AKEYCODE_TV_AUDIO_DESCRIPTION = 252, + /** Audio description mixing volume up key. + * Louden audio description volume as compared with normal audio volume. */ + AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP = 253, + /** Audio description mixing volume down key. + * Lessen audio description volume as compared with normal audio volume. */ + AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN = 254, + /** Zoom mode key. + * Changes Zoom mode (Normal, Full, Zoom, Wide-zoom, etc.) */ + AKEYCODE_TV_ZOOM_MODE = 255, + /** Contents menu key. + * Goes to the title list. Corresponds to Contents Menu (0x0B) of CEC User Control + * Code */ + AKEYCODE_TV_CONTENTS_MENU = 256, + /** Media context menu key. + * Goes to the context menu of media contents. Corresponds to Media Context-sensitive + * Menu (0x11) of CEC User Control Code. */ + AKEYCODE_TV_MEDIA_CONTEXT_MENU = 257, + /** Timer programming key. + * Goes to the timer recording menu. Corresponds to Timer Programming (0x54) of + * CEC User Control Code. */ + AKEYCODE_TV_TIMER_PROGRAMMING = 258, + /** Help key. */ + AKEYCODE_HELP = 259, + AKEYCODE_NAVIGATE_PREVIOUS = 260, + AKEYCODE_NAVIGATE_NEXT = 261, + AKEYCODE_NAVIGATE_IN = 262, + AKEYCODE_NAVIGATE_OUT = 263, + /** Primary stem key for Wear + * Main power/reset button on watch. */ + AKEYCODE_STEM_PRIMARY = 264, + /** Generic stem key 1 for Wear */ + AKEYCODE_STEM_1 = 265, + /** Generic stem key 2 for Wear */ + AKEYCODE_STEM_2 = 266, + /** Generic stem key 3 for Wear */ + AKEYCODE_STEM_3 = 267, + AKEYCODE_MEDIA_SKIP_FORWARD = 272, + AKEYCODE_MEDIA_SKIP_BACKWARD = 273, + AKEYCODE_MEDIA_STEP_FORWARD = 274, + AKEYCODE_MEDIA_STEP_BACKWARD = 275, + /** Put device to sleep unless a wakelock is held. */ + AKEYCODE_SOFT_SLEEP = 276 + + // NOTE: If you add a new keycode here you must also add it to several other files. + // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list. +}; + +#ifdef __cplusplus +} +#endif + +#endif // _ANDROID_KEYCODES_H + +/** @} */ diff --git a/third_party/android_frameworks_native/include/android/looper.h b/third_party/android_frameworks_native/include/android/looper.h new file mode 100644 index 000000000..718f70304 --- /dev/null +++ b/third_party/android_frameworks_native/include/android/looper.h @@ -0,0 +1,269 @@ +/* + * Copyright (C) 2010 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. + */ + +/** + * @addtogroup Looper + * @{ + */ + +/** + * @file looper.h + */ + +#ifndef ANDROID_LOOPER_H +#define ANDROID_LOOPER_H + +#ifdef __cplusplus +extern "C" { +#endif + +struct ALooper; +/** + * ALooper + * + * A looper is the state tracking an event loop for a thread. + * Loopers do not define event structures or other such things; rather + * they are a lower-level facility to attach one or more discrete objects + * listening for an event. An "event" here is simply data available on + * a file descriptor: each attached object has an associated file descriptor, + * and waiting for "events" means (internally) polling on all of these file + * descriptors until one or more of them have data available. + * + * A thread can have only one ALooper associated with it. + */ +typedef struct ALooper ALooper; + +/** + * Returns the looper associated with the calling thread, or NULL if + * there is not one. + */ +ALooper* ALooper_forThread(); + +/** Option for for ALooper_prepare(). */ +enum { + /** + * This looper will accept calls to ALooper_addFd() that do not + * have a callback (that is provide NULL for the callback). In + * this case the caller of ALooper_pollOnce() or ALooper_pollAll() + * MUST check the return from these functions to discover when + * data is available on such fds and process it. + */ + ALOOPER_PREPARE_ALLOW_NON_CALLBACKS = 1<<0 +}; + +/** + * Prepares a looper associated with the calling thread, and returns it. + * If the thread already has a looper, it is returned. Otherwise, a new + * one is created, associated with the thread, and returned. + * + * The opts may be ALOOPER_PREPARE_ALLOW_NON_CALLBACKS or 0. + */ +ALooper* ALooper_prepare(int opts); + +/** Result from ALooper_pollOnce() and ALooper_pollAll(). */ +enum { + /** + * The poll was awoken using wake() before the timeout expired + * and no callbacks were executed and no other file descriptors were ready. + */ + ALOOPER_POLL_WAKE = -1, + + /** + * Result from ALooper_pollOnce() and ALooper_pollAll(): + * One or more callbacks were executed. + */ + ALOOPER_POLL_CALLBACK = -2, + + /** + * Result from ALooper_pollOnce() and ALooper_pollAll(): + * The timeout expired. + */ + ALOOPER_POLL_TIMEOUT = -3, + + /** + * Result from ALooper_pollOnce() and ALooper_pollAll(): + * An error occurred. + */ + ALOOPER_POLL_ERROR = -4, +}; + +/** + * Acquire a reference on the given ALooper object. This prevents the object + * from being deleted until the reference is removed. This is only needed + * to safely hand an ALooper from one thread to another. + */ +void ALooper_acquire(ALooper* looper); + +/** + * Remove a reference that was previously acquired with ALooper_acquire(). + */ +void ALooper_release(ALooper* looper); + +/** + * Flags for file descriptor events that a looper can monitor. + * + * These flag bits can be combined to monitor multiple events at once. + */ +enum { + /** + * The file descriptor is available for read operations. + */ + ALOOPER_EVENT_INPUT = 1 << 0, + + /** + * The file descriptor is available for write operations. + */ + ALOOPER_EVENT_OUTPUT = 1 << 1, + + /** + * The file descriptor has encountered an error condition. + * + * The looper always sends notifications about errors; it is not necessary + * to specify this event flag in the requested event set. + */ + ALOOPER_EVENT_ERROR = 1 << 2, + + /** + * The file descriptor was hung up. + * For example, indicates that the remote end of a pipe or socket was closed. + * + * The looper always sends notifications about hangups; it is not necessary + * to specify this event flag in the requested event set. + */ + ALOOPER_EVENT_HANGUP = 1 << 3, + + /** + * The file descriptor is invalid. + * For example, the file descriptor was closed prematurely. + * + * The looper always sends notifications about invalid file descriptors; it is not necessary + * to specify this event flag in the requested event set. + */ + ALOOPER_EVENT_INVALID = 1 << 4, +}; + +/** + * For callback-based event loops, this is the prototype of the function + * that is called when a file descriptor event occurs. + * It is given the file descriptor it is associated with, + * a bitmask of the poll events that were triggered (typically ALOOPER_EVENT_INPUT), + * and the data pointer that was originally supplied. + * + * Implementations should return 1 to continue receiving callbacks, or 0 + * to have this file descriptor and callback unregistered from the looper. + */ +typedef int (*ALooper_callbackFunc)(int fd, int events, void* data); + +/** + * Waits for events to be available, with optional timeout in milliseconds. + * Invokes callbacks for all file descriptors on which an event occurred. + * + * If the timeout is zero, returns immediately without blocking. + * If the timeout is negative, waits indefinitely until an event appears. + * + * Returns ALOOPER_POLL_WAKE if the poll was awoken using wake() before + * the timeout expired and no callbacks were invoked and no other file + * descriptors were ready. + * + * Returns ALOOPER_POLL_CALLBACK if one or more callbacks were invoked. + * + * Returns ALOOPER_POLL_TIMEOUT if there was no data before the given + * timeout expired. + * + * Returns ALOOPER_POLL_ERROR if an error occurred. + * + * Returns a value >= 0 containing an identifier (the same identifier + * `ident` passed to ALooper_addFd()) if its file descriptor has data + * and it has no callback function (requiring the caller here to + * handle it). In this (and only this) case outFd, outEvents and + * outData will contain the poll events and data associated with the + * fd, otherwise they will be set to NULL. + * + * This method does not return until it has finished invoking the appropriate callbacks + * for all file descriptors that were signalled. + */ +int ALooper_pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData); + +/** + * Like ALooper_pollOnce(), but performs all pending callbacks until all + * data has been consumed or a file descriptor is available with no callback. + * This function will never return ALOOPER_POLL_CALLBACK. + */ +int ALooper_pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData); + +/** + * Wakes the poll asynchronously. + * + * This method can be called on any thread. + * This method returns immediately. + */ +void ALooper_wake(ALooper* looper); + +/** + * Adds a new file descriptor to be polled by the looper. + * If the same file descriptor was previously added, it is replaced. + * + * "fd" is the file descriptor to be added. + * "ident" is an identifier for this event, which is returned from ALooper_pollOnce(). + * The identifier must be >= 0, or ALOOPER_POLL_CALLBACK if providing a non-NULL callback. + * "events" are the poll events to wake up on. Typically this is ALOOPER_EVENT_INPUT. + * "callback" is the function to call when there is an event on the file descriptor. + * "data" is a private data pointer to supply to the callback. + * + * There are two main uses of this function: + * + * (1) If "callback" is non-NULL, then this function will be called when there is + * data on the file descriptor. It should execute any events it has pending, + * appropriately reading from the file descriptor. The 'ident' is ignored in this case. + * + * (2) If "callback" is NULL, the 'ident' will be returned by ALooper_pollOnce + * when its file descriptor has data available, requiring the caller to take + * care of processing it. + * + * Returns 1 if the file descriptor was added or -1 if an error occurred. + * + * This method can be called on any thread. + * This method may block briefly if it needs to wake the poll. + */ +int ALooper_addFd(ALooper* looper, int fd, int ident, int events, + ALooper_callbackFunc callback, void* data); + +/** + * Removes a previously added file descriptor from the looper. + * + * When this method returns, it is safe to close the file descriptor since the looper + * will no longer have a reference to it. However, it is possible for the callback to + * already be running or for it to run one last time if the file descriptor was already + * signalled. Calling code is responsible for ensuring that this case is safely handled. + * For example, if the callback takes care of removing itself during its own execution either + * by returning 0 or by calling this method, then it can be guaranteed to not be invoked + * again at any later time unless registered anew. + * + * Returns 1 if the file descriptor was removed, 0 if none was previously registered + * or -1 if an error occurred. + * + * This method can be called on any thread. + * This method may block briefly if it needs to wake the poll. + */ +int ALooper_removeFd(ALooper* looper, int fd); + +#ifdef __cplusplus +}; +#endif + +#endif // ANDROID_LOOPER_H + +/** @} */ diff --git a/third_party/android_frameworks_native/include/android/multinetwork.h b/third_party/android_frameworks_native/include/android/multinetwork.h new file mode 100644 index 000000000..6c718c903 --- /dev/null +++ b/third_party/android_frameworks_native/include/android/multinetwork.h @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2015 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_MULTINETWORK_H +#define ANDROID_MULTINETWORK_H + +#include +#include +#include + +__BEGIN_DECLS + +/** + * The corresponding C type for android.net.Network#getNetworkHandle() return + * values. The Java signed long value can be safely cast to a net_handle_t: + * + * [C] ((net_handle_t) java_long_network_handle) + * [C++] static_cast(java_long_network_handle) + * + * as appropriate. + */ +typedef uint64_t net_handle_t; + +/** + * The value NETWORK_UNSPECIFIED indicates no specific network. + * + * For some functions (documented below), a previous binding may be cleared + * by an invocation with NETWORK_UNSPECIFIED. + * + * Depending on the context it may indicate an error. It is expressly + * not used to indicate some notion of the "current default network". + */ +#define NETWORK_UNSPECIFIED ((net_handle_t)0) + + +/** + * All functions below that return an int return 0 on success or -1 + * on failure with an appropriate errno value set. + */ + + +/** + * Set the network to be used by the given socket file descriptor. + * + * To clear a previous socket binding invoke with NETWORK_UNSPECIFIED. + * + * This is the equivalent of: + * + * [ android.net.Network#bindSocket() ] + * https://developer.android.com/reference/android/net/Network.html#bindSocket(java.net.Socket) + */ +int android_setsocknetwork(net_handle_t network, int fd); + + +/** + * Binds the current process to |network|. All sockets created in the future + * (and not explicitly bound via android_setsocknetwork()) will be bound to + * |network|. All host name resolutions will be limited to |network| as well. + * Note that if the network identified by |network| ever disconnects, all + * sockets created in this way will cease to work and all host name + * resolutions will fail. This is by design so an application doesn't + * accidentally use sockets it thinks are still bound to a particular network. + * + * To clear a previous process binding invoke with NETWORK_UNSPECIFIED. + * + * This is the equivalent of: + * + * [ android.net.ConnectivityManager#setProcessDefaultNetwork() ] + * https://developer.android.com/reference/android/net/ConnectivityManager.html#setProcessDefaultNetwork(android.net.Network) + */ +int android_setprocnetwork(net_handle_t network); + + +/** + * Perform hostname resolution via the DNS servers associated with |network|. + * + * All arguments (apart from |network|) are used identically as those passed + * to getaddrinfo(3). Return and error values are identical to those of + * getaddrinfo(3), and in particular gai_strerror(3) can be used as expected. + * Similar to getaddrinfo(3): + * - |hints| may be NULL (in which case man page documented defaults apply) + * - either |node| or |service| may be NULL, but not both + * - |res| must not be NULL + * + * This is the equivalent of: + * + * [ android.net.Network#getAllByName() ] + * https://developer.android.com/reference/android/net/Network.html#getAllByName(java.lang.String) + */ +int android_getaddrinfofornetwork(net_handle_t network, + const char *node, const char *service, + const struct addrinfo *hints, struct addrinfo **res); + +__END_DECLS + +#endif // ANDROID_MULTINETWORK_H diff --git a/third_party/android_frameworks_native/include/android/native_activity.h b/third_party/android_frameworks_native/include/android/native_activity.h new file mode 100644 index 000000000..d3d99cf7a --- /dev/null +++ b/third_party/android_frameworks_native/include/android/native_activity.h @@ -0,0 +1,340 @@ +/* + * Copyright (C) 2010 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. + */ + +/** + * @addtogroup NativeActivity Native Activity + * @{ + */ + +/** + * @file native_activity.h + */ + +#ifndef ANDROID_NATIVE_ACTIVITY_H +#define ANDROID_NATIVE_ACTIVITY_H + +#include +#include + +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * {@link ANativeActivityCallbacks} + */ +struct ANativeActivityCallbacks; + +/** + * This structure defines the native side of an android.app.NativeActivity. + * It is created by the framework, and handed to the application's native + * code as it is being launched. + */ +typedef struct ANativeActivity { + /** + * Pointer to the callback function table of the native application. + * You can set the functions here to your own callbacks. The callbacks + * pointer itself here should not be changed; it is allocated and managed + * for you by the framework. + */ + struct ANativeActivityCallbacks* callbacks; + + /** + * The global handle on the process's Java VM. + */ + JavaVM* vm; + + /** + * JNI context for the main thread of the app. Note that this field + * can ONLY be used from the main thread of the process; that is, the + * thread that calls into the ANativeActivityCallbacks. + */ + JNIEnv* env; + + /** + * The NativeActivity object handle. + * + * IMPORTANT NOTE: This member is mis-named. It should really be named + * 'activity' instead of 'clazz', since it's a reference to the + * NativeActivity instance created by the system for you. + * + * We unfortunately cannot change this without breaking NDK + * source-compatibility. + */ + jobject clazz; + + /** + * Path to this application's internal data directory. + */ + const char* internalDataPath; + + /** + * Path to this application's external (removable/mountable) data directory. + */ + const char* externalDataPath; + + /** + * The platform's SDK version code. + */ + int32_t sdkVersion; + + /** + * This is the native instance of the application. It is not used by + * the framework, but can be set by the application to its own instance + * state. + */ + void* instance; + + /** + * Pointer to the Asset Manager instance for the application. The application + * uses this to access binary assets bundled inside its own .apk file. + */ + AAssetManager* assetManager; + + /** + * Available starting with Honeycomb: path to the directory containing + * the application's OBB files (if any). If the app doesn't have any + * OBB files, this directory may not exist. + */ + const char* obbPath; +} ANativeActivity; + +/** + * These are the callbacks the framework makes into a native application. + * All of these callbacks happen on the main thread of the application. + * By default, all callbacks are NULL; set to a pointer to your own function + * to have it called. + */ +typedef struct ANativeActivityCallbacks { + /** + * NativeActivity has started. See Java documentation for Activity.onStart() + * for more information. + */ + void (*onStart)(ANativeActivity* activity); + + /** + * NativeActivity has resumed. See Java documentation for Activity.onResume() + * for more information. + */ + void (*onResume)(ANativeActivity* activity); + + /** + * Framework is asking NativeActivity to save its current instance state. + * See Java documentation for Activity.onSaveInstanceState() for more + * information. The returned pointer needs to be created with malloc(); + * the framework will call free() on it for you. You also must fill in + * outSize with the number of bytes in the allocation. Note that the + * saved state will be persisted, so it can not contain any active + * entities (pointers to memory, file descriptors, etc). + */ + void* (*onSaveInstanceState)(ANativeActivity* activity, size_t* outSize); + + /** + * NativeActivity has paused. See Java documentation for Activity.onPause() + * for more information. + */ + void (*onPause)(ANativeActivity* activity); + + /** + * NativeActivity has stopped. See Java documentation for Activity.onStop() + * for more information. + */ + void (*onStop)(ANativeActivity* activity); + + /** + * NativeActivity is being destroyed. See Java documentation for Activity.onDestroy() + * for more information. + */ + void (*onDestroy)(ANativeActivity* activity); + + /** + * Focus has changed in this NativeActivity's window. This is often used, + * for example, to pause a game when it loses input focus. + */ + void (*onWindowFocusChanged)(ANativeActivity* activity, int hasFocus); + + /** + * The drawing window for this native activity has been created. You + * can use the given native window object to start drawing. + */ + void (*onNativeWindowCreated)(ANativeActivity* activity, ANativeWindow* window); + + /** + * The drawing window for this native activity has been resized. You should + * retrieve the new size from the window and ensure that your rendering in + * it now matches. + */ + void (*onNativeWindowResized)(ANativeActivity* activity, ANativeWindow* window); + + /** + * The drawing window for this native activity needs to be redrawn. To avoid + * transient artifacts during screen changes (such resizing after rotation), + * applications should not return from this function until they have finished + * drawing their window in its current state. + */ + void (*onNativeWindowRedrawNeeded)(ANativeActivity* activity, ANativeWindow* window); + + /** + * The drawing window for this native activity is going to be destroyed. + * You MUST ensure that you do not touch the window object after returning + * from this function: in the common case of drawing to the window from + * another thread, that means the implementation of this callback must + * properly synchronize with the other thread to stop its drawing before + * returning from here. + */ + void (*onNativeWindowDestroyed)(ANativeActivity* activity, ANativeWindow* window); + + /** + * The input queue for this native activity's window has been created. + * You can use the given input queue to start retrieving input events. + */ + void (*onInputQueueCreated)(ANativeActivity* activity, AInputQueue* queue); + + /** + * The input queue for this native activity's window is being destroyed. + * You should no longer try to reference this object upon returning from this + * function. + */ + void (*onInputQueueDestroyed)(ANativeActivity* activity, AInputQueue* queue); + + /** + * The rectangle in the window in which content should be placed has changed. + */ + void (*onContentRectChanged)(ANativeActivity* activity, const ARect* rect); + + /** + * The current device AConfiguration has changed. The new configuration can + * be retrieved from assetManager. + */ + void (*onConfigurationChanged)(ANativeActivity* activity); + + /** + * The system is running low on memory. Use this callback to release + * resources you do not need, to help the system avoid killing more + * important processes. + */ + void (*onLowMemory)(ANativeActivity* activity); +} ANativeActivityCallbacks; + +/** + * This is the function that must be in the native code to instantiate the + * application's native activity. It is called with the activity instance (see + * above); if the code is being instantiated from a previously saved instance, + * the savedState will be non-NULL and point to the saved data. You must make + * any copy of this data you need -- it will be released after you return from + * this function. + */ +typedef void ANativeActivity_createFunc(ANativeActivity* activity, + void* savedState, size_t savedStateSize); + +/** + * The name of the function that NativeInstance looks for when launching its + * native code. This is the default function that is used, you can specify + * "android.app.func_name" string meta-data in your manifest to use a different + * function. + */ +extern ANativeActivity_createFunc ANativeActivity_onCreate; + +/** + * Finish the given activity. Its finish() method will be called, causing it + * to be stopped and destroyed. Note that this method can be called from + * *any* thread; it will send a message to the main thread of the process + * where the Java finish call will take place. + */ +void ANativeActivity_finish(ANativeActivity* activity); + +/** + * Change the window format of the given activity. Calls getWindow().setFormat() + * of the given activity. Note that this method can be called from + * *any* thread; it will send a message to the main thread of the process + * where the Java finish call will take place. + */ +void ANativeActivity_setWindowFormat(ANativeActivity* activity, int32_t format); + +/** + * Change the window flags of the given activity. Calls getWindow().setFlags() + * of the given activity. Note that this method can be called from + * *any* thread; it will send a message to the main thread of the process + * where the Java finish call will take place. See window.h for flag constants. + */ +void ANativeActivity_setWindowFlags(ANativeActivity* activity, + uint32_t addFlags, uint32_t removeFlags); + +/** + * Flags for ANativeActivity_showSoftInput; see the Java InputMethodManager + * API for documentation. + */ +enum { + /** + * Implicit request to show the input window, not as the result + * of a direct request by the user. + */ + ANATIVEACTIVITY_SHOW_SOFT_INPUT_IMPLICIT = 0x0001, + + /** + * The user has forced the input method open (such as by + * long-pressing menu) so it should not be closed until they + * explicitly do so. + */ + ANATIVEACTIVITY_SHOW_SOFT_INPUT_FORCED = 0x0002, +}; + +/** + * Show the IME while in the given activity. Calls InputMethodManager.showSoftInput() + * for the given activity. Note that this method can be called from + * *any* thread; it will send a message to the main thread of the process + * where the Java finish call will take place. + */ +void ANativeActivity_showSoftInput(ANativeActivity* activity, uint32_t flags); + +/** + * Flags for ANativeActivity_hideSoftInput; see the Java InputMethodManager + * API for documentation. + */ +enum { + /** + * The soft input window should only be hidden if it was not + * explicitly shown by the user. + */ + ANATIVEACTIVITY_HIDE_SOFT_INPUT_IMPLICIT_ONLY = 0x0001, + /** + * The soft input window should normally be hidden, unless it was + * originally shown with {@link ANATIVEACTIVITY_SHOW_SOFT_INPUT_FORCED}. + */ + ANATIVEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS = 0x0002, +}; + +/** + * Hide the IME while in the given activity. Calls InputMethodManager.hideSoftInput() + * for the given activity. Note that this method can be called from + * *any* thread; it will send a message to the main thread of the process + * where the Java finish call will take place. + */ +void ANativeActivity_hideSoftInput(ANativeActivity* activity, uint32_t flags); + +#ifdef __cplusplus +}; +#endif + +#endif // ANDROID_NATIVE_ACTIVITY_H + +/** @} */ diff --git a/third_party/android_frameworks_native/include/android/native_window.h b/third_party/android_frameworks_native/include/android/native_window.h new file mode 100644 index 000000000..cf07f1afa --- /dev/null +++ b/third_party/android_frameworks_native/include/android/native_window.h @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2010 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. + */ + +/** + * @addtogroup NativeActivity Native Activity + * @{ + */ + +/** + * @file native_window.h + */ + +#ifndef ANDROID_NATIVE_WINDOW_H +#define ANDROID_NATIVE_WINDOW_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Pixel formats that a window can use. + */ +enum { + /** Red: 8 bits, Green: 8 bits, Blue: 8 bits, Alpha: 8 bits. **/ + WINDOW_FORMAT_RGBA_8888 = 1, + /** Red: 8 bits, Green: 8 bits, Blue: 8 bits, Unused: 8 bits. **/ + WINDOW_FORMAT_RGBX_8888 = 2, + /** Red: 5 bits, Green: 6 bits, Blue: 5 bits. **/ + WINDOW_FORMAT_RGB_565 = 4, +}; + +struct ANativeWindow; +/** + * {@link ANativeWindow} is opaque type that provides access to a native window. + * + * A pointer can be obtained using ANativeWindow_fromSurface(). + */ +typedef struct ANativeWindow ANativeWindow; + +/** + * {@link ANativeWindow} is a struct that represents a windows buffer. + * + * A pointer can be obtained using ANativeWindow_lock(). + */ +typedef struct ANativeWindow_Buffer { + // The number of pixels that are show horizontally. + int32_t width; + + // The number of pixels that are shown vertically. + int32_t height; + + // The number of *pixels* that a line in the buffer takes in + // memory. This may be >= width. + int32_t stride; + + // The format of the buffer. One of WINDOW_FORMAT_* + int32_t format; + + // The actual bits. + void* bits; + + // Do not touch. + uint32_t reserved[6]; +} ANativeWindow_Buffer; + +/** + * Acquire a reference on the given ANativeWindow object. This prevents the object + * from being deleted until the reference is removed. + */ +void ANativeWindow_acquire(ANativeWindow* window); + +/** + * Remove a reference that was previously acquired with ANativeWindow_acquire(). + */ +void ANativeWindow_release(ANativeWindow* window); + +/** + * Return the current width in pixels of the window surface. Returns a + * negative value on error. + */ +int32_t ANativeWindow_getWidth(ANativeWindow* window); + +/** + * Return the current height in pixels of the window surface. Returns a + * negative value on error. + */ +int32_t ANativeWindow_getHeight(ANativeWindow* window); + +/** + * Return the current pixel format of the window surface. Returns a + * negative value on error. + */ +int32_t ANativeWindow_getFormat(ANativeWindow* window); + +/** + * Change the format and size of the window buffers. + * + * The width and height control the number of pixels in the buffers, not the + * dimensions of the window on screen. If these are different than the + * window's physical size, then it buffer will be scaled to match that size + * when compositing it to the screen. + * + * For all of these parameters, if 0 is supplied then the window's base + * value will come back in force. + * + * width and height must be either both zero or both non-zero. + * + */ +int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window, + int32_t width, int32_t height, int32_t format); + +/** + * Lock the window's next drawing surface for writing. + * inOutDirtyBounds is used as an in/out parameter, upon entering the + * function, it contains the dirty region, that is, the region the caller + * intends to redraw. When the function returns, inOutDirtyBounds is updated + * with the actual area the caller needs to redraw -- this region is often + * extended by ANativeWindow_lock. + */ +int32_t ANativeWindow_lock(ANativeWindow* window, ANativeWindow_Buffer* outBuffer, + ARect* inOutDirtyBounds); + +/** + * Unlock the window's drawing surface after previously locking it, + * posting the new buffer to the display. + */ +int32_t ANativeWindow_unlockAndPost(ANativeWindow* window); + +#ifdef __cplusplus +}; +#endif + +#endif // ANDROID_NATIVE_WINDOW_H + +/** @} */ diff --git a/third_party/android_frameworks_native/include/android/native_window_jni.h b/third_party/android_frameworks_native/include/android/native_window_jni.h new file mode 100644 index 000000000..60a36c3f2 --- /dev/null +++ b/third_party/android_frameworks_native/include/android/native_window_jni.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2010 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. + */ + +/** + * @addtogroup NativeActivity Native Activity + * @{ + */ + +/** + * @file native_window_jni.h + */ + +#ifndef ANDROID_NATIVE_WINDOW_JNI_H +#define ANDROID_NATIVE_WINDOW_JNI_H + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Return the ANativeWindow associated with a Java Surface object, + * for interacting with it through native code. This acquires a reference + * on the ANativeWindow that is returned; be sure to use ANativeWindow_release() + * when done with it so that it doesn't leak. + */ +ANativeWindow* ANativeWindow_fromSurface(JNIEnv* env, jobject surface); + +#ifdef __cplusplus +}; +#endif + +#endif // ANDROID_NATIVE_WINDOW_H + +/** @} */ diff --git a/third_party/android_frameworks_native/include/android/obb.h b/third_party/android_frameworks_native/include/android/obb.h new file mode 100644 index 000000000..4c6d9d7ba --- /dev/null +++ b/third_party/android_frameworks_native/include/android/obb.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2010 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. + */ + +/** + * @addtogroup Storage + * @{ + */ + +/** + * @file obb.h + */ + +#ifndef ANDROID_OBB_H +#define ANDROID_OBB_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct AObbInfo; +/** {@link AObbInfo} is an opaque type representing information for obb storage. */ +typedef struct AObbInfo AObbInfo; + +/** Flag for an obb file, returned by AObbInfo_getFlags(). */ +enum { + /** overlay */ + AOBBINFO_OVERLAY = 0x0001, +}; + +/** + * Scan an OBB and get information about it. + */ +AObbInfo* AObbScanner_getObbInfo(const char* filename); + +/** + * Destroy the AObbInfo object. You must call this when finished with the object. + */ +void AObbInfo_delete(AObbInfo* obbInfo); + +/** + * Get the package name for the OBB. + */ +const char* AObbInfo_getPackageName(AObbInfo* obbInfo); + +/** + * Get the version of an OBB file. + */ +int32_t AObbInfo_getVersion(AObbInfo* obbInfo); + +/** + * Get the flags of an OBB file. + */ +int32_t AObbInfo_getFlags(AObbInfo* obbInfo); + +#ifdef __cplusplus +}; +#endif + +#endif // ANDROID_OBB_H + +/** @} */ diff --git a/third_party/android_frameworks_native/include/android/rect.h b/third_party/android_frameworks_native/include/android/rect.h new file mode 100644 index 000000000..80741c044 --- /dev/null +++ b/third_party/android_frameworks_native/include/android/rect.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2010 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. + */ + +/** + * @addtogroup NativeActivity Native Activity + * @{ + */ + +/** + * @file rect.h + */ + +#ifndef ANDROID_RECT_H +#define ANDROID_RECT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * {@link ARect} is a struct that represents a rectangular window area. + * + * It is used with {@link + * ANativeActivityCallbacks::onContentRectChanged} event callback and + * ANativeWindow_lock() function. + */ +typedef struct ARect { +#ifdef __cplusplus + typedef int32_t value_type; +#endif + /** left position */ + int32_t left; + /** top position */ + int32_t top; + /** left position */ + int32_t right; + /** bottom position */ + int32_t bottom; +} ARect; + +#ifdef __cplusplus +}; +#endif + +#endif // ANDROID_RECT_H + +/** @} */ diff --git a/third_party/android_frameworks_native/include/android/sensor.h b/third_party/android_frameworks_native/include/android/sensor.h new file mode 100644 index 000000000..73928ea76 --- /dev/null +++ b/third_party/android_frameworks_native/include/android/sensor.h @@ -0,0 +1,475 @@ +/* + * Copyright (C) 2010 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. + */ + +/** + * @addtogroup Sensor + * @{ + */ + +/** + * @file sensor.h + */ + +#ifndef ANDROID_SENSOR_H +#define ANDROID_SENSOR_H + +/****************************************************************** + * + * IMPORTANT NOTICE: + * + * This file is part of Android's set of stable system headers + * exposed by the Android NDK (Native Development Kit). + * + * Third-party source AND binary code relies on the definitions + * here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES. + * + * - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES) + * - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS + * - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY + * - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES + */ + +/** + * Structures and functions to receive and process sensor events in + * native code. + * + */ + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * Sensor types. + * (keep in sync with hardware/sensor.h) + */ +enum { + /** + * {@link ASENSOR_TYPE_ACCELEROMETER} + * reporting-mode: continuous + * + * All values are in SI units (m/s^2) and measure the acceleration of the + * device minus the force of gravity. + */ + ASENSOR_TYPE_ACCELEROMETER = 1, + /** + * {@link ASENSOR_TYPE_MAGNETIC_FIELD} + * reporting-mode: continuous + * + * All values are in micro-Tesla (uT) and measure the geomagnetic + * field in the X, Y and Z axis. + */ + ASENSOR_TYPE_MAGNETIC_FIELD = 2, + /** + * {@link ASENSOR_TYPE_GYROSCOPE} + * reporting-mode: continuous + * + * All values are in radians/second and measure the rate of rotation + * around the X, Y and Z axis. + */ + ASENSOR_TYPE_GYROSCOPE = 4, + /** + * {@link ASENSOR_TYPE_LIGHT} + * reporting-mode: on-change + * + * The light sensor value is returned in SI lux units. + */ + ASENSOR_TYPE_LIGHT = 5, + /** + * {@link ASENSOR_TYPE_PROXIMITY} + * reporting-mode: on-change + * + * The proximity sensor which turns the screen off and back on during calls is the + * wake-up proximity sensor. Implement wake-up proximity sensor before implementing + * a non wake-up proximity sensor. For the wake-up proximity sensor set the flag + * SENSOR_FLAG_WAKE_UP. + * The value corresponds to the distance to the nearest object in centimeters. + */ + ASENSOR_TYPE_PROXIMITY = 8 +}; + +/** + * Sensor accuracy measure. + */ +enum { + /** no contact */ + ASENSOR_STATUS_NO_CONTACT = -1, + /** unreliable */ + ASENSOR_STATUS_UNRELIABLE = 0, + /** low accuracy */ + ASENSOR_STATUS_ACCURACY_LOW = 1, + /** medium accuracy */ + ASENSOR_STATUS_ACCURACY_MEDIUM = 2, + /** high accuracy */ + ASENSOR_STATUS_ACCURACY_HIGH = 3 +}; + +/** + * Sensor Reporting Modes. + */ +enum { + /** continuous reporting */ + AREPORTING_MODE_CONTINUOUS = 0, + /** reporting on change */ + AREPORTING_MODE_ON_CHANGE = 1, + /** on shot reporting */ + AREPORTING_MODE_ONE_SHOT = 2, + /** special trigger reporting */ + AREPORTING_MODE_SPECIAL_TRIGGER = 3 +}; + +/* + * A few useful constants + */ + +/** Earth's gravity in m/s^2 */ +#define ASENSOR_STANDARD_GRAVITY (9.80665f) +/** Maximum magnetic field on Earth's surface in uT */ +#define ASENSOR_MAGNETIC_FIELD_EARTH_MAX (60.0f) +/** Minimum magnetic field on Earth's surface in uT*/ +#define ASENSOR_MAGNETIC_FIELD_EARTH_MIN (30.0f) + +/** + * A sensor event. + */ + +/* NOTE: Must match hardware/sensors.h */ +typedef struct ASensorVector { + union { + float v[3]; + struct { + float x; + float y; + float z; + }; + struct { + float azimuth; + float pitch; + float roll; + }; + }; + int8_t status; + uint8_t reserved[3]; +} ASensorVector; + +typedef struct AMetaDataEvent { + int32_t what; + int32_t sensor; +} AMetaDataEvent; + +typedef struct AUncalibratedEvent { + union { + float uncalib[3]; + struct { + float x_uncalib; + float y_uncalib; + float z_uncalib; + }; + }; + union { + float bias[3]; + struct { + float x_bias; + float y_bias; + float z_bias; + }; + }; +} AUncalibratedEvent; + +typedef struct AHeartRateEvent { + float bpm; + int8_t status; +} AHeartRateEvent; + +/* NOTE: Must match hardware/sensors.h */ +typedef struct ASensorEvent { + int32_t version; /* sizeof(struct ASensorEvent) */ + int32_t sensor; + int32_t type; + int32_t reserved0; + int64_t timestamp; + union { + union { + float data[16]; + ASensorVector vector; + ASensorVector acceleration; + ASensorVector magnetic; + float temperature; + float distance; + float light; + float pressure; + float relative_humidity; + AUncalibratedEvent uncalibrated_gyro; + AUncalibratedEvent uncalibrated_magnetic; + AMetaDataEvent meta_data; + AHeartRateEvent heart_rate; + }; + union { + uint64_t data[8]; + uint64_t step_counter; + } u64; + }; + + uint32_t flags; + int32_t reserved1[3]; +} ASensorEvent; + +struct ASensorManager; +/** + * {@link ASensorManager} is an opaque type to manage sensors and + * events queues. + * + * {@link ASensorManager} is a singleton that can be obtained using + * ASensorManager_getInstance(). + * + * This file provides a set of functions that uses {@link + * ASensorManager} to access and list hardware sensors, and + * create and destroy event queues: + * - ASensorManager_getSensorList() + * - ASensorManager_getDefaultSensor() + * - ASensorManager_getDefaultSensorEx() + * - ASensorManager_createEventQueue() + * - ASensorManager_destroyEventQueue() + */ +typedef struct ASensorManager ASensorManager; + + +struct ASensorEventQueue; +/** + * {@link ASensorEventQueue} is an opaque type that provides access to + * {@link ASensorEvent} from hardware sensors. + * + * A new {@link ASensorEventQueue} can be obtained using ASensorManager_createEventQueue(). + * + * This file provides a set of functions to enable and disable + * sensors, check and get events, and set event rates on a {@link + * ASensorEventQueue}. + * - ASensorEventQueue_enableSensor() + * - ASensorEventQueue_disableSensor() + * - ASensorEventQueue_hasEvents() + * - ASensorEventQueue_getEvents() + * - ASensorEventQueue_setEventRate() + */ +typedef struct ASensorEventQueue ASensorEventQueue; + +struct ASensor; +/** + * {@link ASensor} is an opaque type that provides information about + * an hardware sensors. + * + * A {@link ASensor} pointer can be obtained using + * ASensorManager_getDefaultSensor(), + * ASensorManager_getDefaultSensorEx() or from a {@link ASensorList}. + * + * This file provides a set of functions to access properties of a + * {@link ASensor}: + * - ASensor_getName() + * - ASensor_getVendor() + * - ASensor_getType() + * - ASensor_getResolution() + * - ASensor_getMinDelay() + * - ASensor_getFifoMaxEventCount() + * - ASensor_getFifoReservedEventCount() + * - ASensor_getStringType() + * - ASensor_getReportingMode() + * - ASensor_isWakeUpSensor() + */ +typedef struct ASensor ASensor; +/** + * {@link ASensorRef} is a type for constant pointers to {@link ASensor}. + * + * This is used to define entry in {@link ASensorList} arrays. + */ +typedef ASensor const* ASensorRef; +/** + * {@link ASensorList} is an array of reference to {@link ASensor}. + * + * A {@link ASensorList} can be initialized using ASensorManager_getSensorList(). + */ +typedef ASensorRef const* ASensorList; + +/*****************************************************************************/ + +/** + * Get a reference to the sensor manager. ASensorManager is a singleton + * per package as different packages may have access to different sensors. + * + * Deprecated: Use ASensorManager_getInstanceForPackage(const char*) instead. + * + * Example: + * + * ASensorManager* sensorManager = ASensorManager_getInstance(); + * + */ +__attribute__ ((deprecated)) ASensorManager* ASensorManager_getInstance(); + +/* + * Get a reference to the sensor manager. ASensorManager is a singleton + * per package as different packages may have access to different sensors. + * + * Example: + * + * ASensorManager* sensorManager = ASensorManager_getInstanceForPackage("foo.bar.baz"); + * + */ +ASensorManager* ASensorManager_getInstanceForPackage(const char* packageName); + +/** + * Returns the list of available sensors. + */ +int ASensorManager_getSensorList(ASensorManager* manager, ASensorList* list); + +/** + * Returns the default sensor for the given type, or NULL if no sensor + * of that type exists. + */ +ASensor const* ASensorManager_getDefaultSensor(ASensorManager* manager, int type); + +/** + * Returns the default sensor with the given type and wakeUp properties or NULL if no sensor + * of this type and wakeUp properties exists. + */ +ASensor const* ASensorManager_getDefaultSensorEx(ASensorManager* manager, int type, + bool wakeUp); + +/** + * Creates a new sensor event queue and associate it with a looper. + * + * "ident" is a identifier for the events that will be returned when + * calling ALooper_pollOnce(). The identifier must be >= 0, or + * ALOOPER_POLL_CALLBACK if providing a non-NULL callback. + */ +ASensorEventQueue* ASensorManager_createEventQueue(ASensorManager* manager, + ALooper* looper, int ident, ALooper_callbackFunc callback, void* data); + +/** + * Destroys the event queue and free all resources associated to it. + */ +int ASensorManager_destroyEventQueue(ASensorManager* manager, ASensorEventQueue* queue); + + +/*****************************************************************************/ + +/** + * Enable the selected sensor. Returns a negative error code on failure. + */ +int ASensorEventQueue_enableSensor(ASensorEventQueue* queue, ASensor const* sensor); + +/** + * Disable the selected sensor. Returns a negative error code on failure. + */ +int ASensorEventQueue_disableSensor(ASensorEventQueue* queue, ASensor const* sensor); + +/** + * Sets the delivery rate of events in microseconds for the given sensor. + * Note that this is a hint only, generally event will arrive at a higher + * rate. It is an error to set a rate inferior to the value returned by + * ASensor_getMinDelay(). + * Returns a negative error code on failure. + */ +int ASensorEventQueue_setEventRate(ASensorEventQueue* queue, ASensor const* sensor, int32_t usec); + +/** + * Returns true if there are one or more events available in the + * sensor queue. Returns 1 if the queue has events; 0 if + * it does not have events; and a negative value if there is an error. + */ +int ASensorEventQueue_hasEvents(ASensorEventQueue* queue); + +/** + * Returns the next available events from the queue. Returns a negative + * value if no events are available or an error has occurred, otherwise + * the number of events returned. + * + * Examples: + * ASensorEvent event; + * ssize_t numEvent = ASensorEventQueue_getEvents(queue, &event, 1); + * + * ASensorEvent eventBuffer[8]; + * ssize_t numEvent = ASensorEventQueue_getEvents(queue, eventBuffer, 8); + * + */ +ssize_t ASensorEventQueue_getEvents(ASensorEventQueue* queue, + ASensorEvent* events, size_t count); + + +/*****************************************************************************/ + +/** + * Returns this sensor's name (non localized) + */ +const char* ASensor_getName(ASensor const* sensor); + +/** + * Returns this sensor's vendor's name (non localized) + */ +const char* ASensor_getVendor(ASensor const* sensor); + +/** + * Return this sensor's type + */ +int ASensor_getType(ASensor const* sensor); + +/** + * Returns this sensors's resolution + */ +float ASensor_getResolution(ASensor const* sensor); + +/** + * Returns the minimum delay allowed between events in microseconds. + * A value of zero means that this sensor doesn't report events at a + * constant rate, but rather only when a new data is available. + */ +int ASensor_getMinDelay(ASensor const* sensor); + +/** + * Returns the maximum size of batches for this sensor. Batches will often be + * smaller, as the hardware fifo might be used for other sensors. + */ +int ASensor_getFifoMaxEventCount(ASensor const* sensor); + +/** + * Returns the hardware batch fifo size reserved to this sensor. + */ +int ASensor_getFifoReservedEventCount(ASensor const* sensor); + +/** + * Returns this sensor's string type. + */ +const char* ASensor_getStringType(ASensor const* sensor); + +/** + * Returns the reporting mode for this sensor. One of AREPORTING_MODE_* constants. + */ +int ASensor_getReportingMode(ASensor const* sensor); + +/** + * Returns true if this is a wake up sensor, false otherwise. + */ +bool ASensor_isWakeUpSensor(ASensor const* sensor); + +#ifdef __cplusplus +}; +#endif + +#endif // ANDROID_SENSOR_H + +/** @} */ diff --git a/third_party/android_frameworks_native/include/android/storage_manager.h b/third_party/android_frameworks_native/include/android/storage_manager.h new file mode 100644 index 000000000..7f2ee08d6 --- /dev/null +++ b/third_party/android_frameworks_native/include/android/storage_manager.h @@ -0,0 +1,154 @@ +/* + * Copyright (C) 2010 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. + */ + +/** + * @addtogroup Storage + * @{ + */ + +/** + * @file storage_manager.h + */ + +#ifndef ANDROID_STORAGE_MANAGER_H +#define ANDROID_STORAGE_MANAGER_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct AStorageManager; +/** + * {@link AStorageManager} manages application OBB storage, a pointer + * can be obtained with AStorageManager_new(). + */ +typedef struct AStorageManager AStorageManager; + +/** + * The different states of a OBB storage passed to AStorageManager_obbCallbackFunc(). + */ +enum { + /** + * The OBB container is now mounted and ready for use. Can be returned + * as the status for callbacks made during asynchronous OBB actions. + */ + AOBB_STATE_MOUNTED = 1, + + /** + * The OBB container is now unmounted and not usable. Can be returned + * as the status for callbacks made during asynchronous OBB actions. + */ + AOBB_STATE_UNMOUNTED = 2, + + /** + * There was an internal system error encountered while trying to + * mount the OBB. Can be returned as the status for callbacks made + * during asynchronous OBB actions. + */ + AOBB_STATE_ERROR_INTERNAL = 20, + + /** + * The OBB could not be mounted by the system. Can be returned as the + * status for callbacks made during asynchronous OBB actions. + */ + AOBB_STATE_ERROR_COULD_NOT_MOUNT = 21, + + /** + * The OBB could not be unmounted. This most likely indicates that a + * file is in use on the OBB. Can be returned as the status for + * callbacks made during asynchronous OBB actions. + */ + AOBB_STATE_ERROR_COULD_NOT_UNMOUNT = 22, + + /** + * A call was made to unmount the OBB when it was not mounted. Can be + * returned as the status for callbacks made during asynchronous OBB + * actions. + */ + AOBB_STATE_ERROR_NOT_MOUNTED = 23, + + /** + * The OBB has already been mounted. Can be returned as the status for + * callbacks made during asynchronous OBB actions. + */ + AOBB_STATE_ERROR_ALREADY_MOUNTED = 24, + + /** + * The current application does not have permission to use this OBB. + * This could be because the OBB indicates it's owned by a different + * package. Can be returned as the status for callbacks made during + * asynchronous OBB actions. + */ + AOBB_STATE_ERROR_PERMISSION_DENIED = 25, +}; + +/** + * Obtains a new instance of AStorageManager. + */ +AStorageManager* AStorageManager_new(); + +/** + * Release AStorageManager instance. + */ +void AStorageManager_delete(AStorageManager* mgr); + +/** + * Callback function for asynchronous calls made on OBB files. + * + * "state" is one of the following constants: + * - {@link AOBB_STATE_MOUNTED} + * - {@link AOBB_STATE_UNMOUNTED} + * - {@link AOBB_STATE_ERROR_INTERNAL} + * - {@link AOBB_STATE_ERROR_COULD_NOT_MOUNT} + * - {@link AOBB_STATE_ERROR_COULD_NOT_UNMOUNT} + * - {@link AOBB_STATE_ERROR_NOT_MOUNTED} + * - {@link AOBB_STATE_ERROR_ALREADY_MOUNTED} + * - {@link AOBB_STATE_ERROR_PERMISSION_DENIED} + */ +typedef void (*AStorageManager_obbCallbackFunc)(const char* filename, const int32_t state, void* data); + +/** + * Attempts to mount an OBB file. This is an asynchronous operation. + */ +void AStorageManager_mountObb(AStorageManager* mgr, const char* filename, const char* key, + AStorageManager_obbCallbackFunc cb, void* data); + +/** + * Attempts to unmount an OBB file. This is an asynchronous operation. + */ +void AStorageManager_unmountObb(AStorageManager* mgr, const char* filename, const int force, + AStorageManager_obbCallbackFunc cb, void* data); + +/** + * Check whether an OBB is mounted. + */ +int AStorageManager_isObbMounted(AStorageManager* mgr, const char* filename); + +/** + * Get the mounted path for an OBB. + */ +const char* AStorageManager_getMountedObbPath(AStorageManager* mgr, const char* filename); + + +#ifdef __cplusplus +}; +#endif + +#endif // ANDROID_STORAGE_MANAGER_H + +/** @} */ diff --git a/third_party/android_frameworks_native/include/android/trace.h b/third_party/android_frameworks_native/include/android/trace.h new file mode 100644 index 000000000..e42e33410 --- /dev/null +++ b/third_party/android_frameworks_native/include/android/trace.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2015 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_NATIVE_TRACE_H +#define ANDROID_NATIVE_TRACE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Returns true if tracing is enabled. Use this signal to avoid expensive computation only necessary + * when tracing is enabled. + */ +bool ATrace_isEnabled(); + +/** + * Writes a tracing message to indicate that the given section of code has begun. This call must be + * followed by a corresponding call to endSection() on the same thread. + * + * Note: At this time the vertical bar character '|' and newline character '\n' are used internally + * by the tracing mechanism. If sectionName contains these characters they will be replaced with a + * space character in the trace. + */ +void ATrace_beginSection(const char* sectionName); + +/** + * Writes a tracing message to indicate that a given section of code has ended. This call must be + * preceeded by a corresponding call to beginSection(char*) on the same thread. Calling this method + * will mark the end of the most recently begun section of code, so care must be taken to ensure + * that beginSection / endSection pairs are properly nested and called from the same thread. + */ +void ATrace_endSection(); + +#ifdef __cplusplus +}; +#endif + +#endif // ANDROID_NATIVE_TRACE_H diff --git a/third_party/android_frameworks_native/include/android/window.h b/third_party/android_frameworks_native/include/android/window.h new file mode 100644 index 000000000..436bf3a83 --- /dev/null +++ b/third_party/android_frameworks_native/include/android/window.h @@ -0,0 +1,224 @@ +/* + * Copyright (C) 2010 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. + */ + +/** + * @addtogroup NativeActivity Native Activity + * @{ + */ + +/** + * @file window.h + */ + +#ifndef ANDROID_WINDOW_H +#define ANDROID_WINDOW_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Window flags, as per the Java API at android.view.WindowManager.LayoutParams. + */ +enum { + /** + * As long as this window is visible to the user, allow the lock + * screen to activate while the screen is on. This can be used + * independently, or in combination with {@link + * AWINDOW_FLAG_KEEP_SCREEN_ON} and/or {@link + * AWINDOW_FLAG_SHOW_WHEN_LOCKED} + */ + AWINDOW_FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001, + /** Everything behind this window will be dimmed. */ + AWINDOW_FLAG_DIM_BEHIND = 0x00000002, + /** + * Blur everything behind this window. + * @deprecated Blurring is no longer supported. + */ + AWINDOW_FLAG_BLUR_BEHIND = 0x00000004, + /** + * This window won't ever get key input focus, so the + * user can not send key or other button events to it. Those will + * instead go to whatever focusable window is behind it. This flag + * will also enable {@link AWINDOW_FLAG_NOT_TOUCH_MODAL} whether or not that + * is explicitly set. + * + * Setting this flag also implies that the window will not need to + * interact with + * a soft input method, so it will be Z-ordered and positioned + * independently of any active input method (typically this means it + * gets Z-ordered on top of the input method, so it can use the full + * screen for its content and cover the input method if needed. You + * can use {@link AWINDOW_FLAG_ALT_FOCUSABLE_IM} to modify this behavior. + */ + AWINDOW_FLAG_NOT_FOCUSABLE = 0x00000008, + /** this window can never receive touch events. */ + AWINDOW_FLAG_NOT_TOUCHABLE = 0x00000010, + /** + * Even when this window is focusable (its + * {@link AWINDOW_FLAG_NOT_FOCUSABLE} is not set), allow any pointer events + * outside of the window to be sent to the windows behind it. Otherwise + * it will consume all pointer events itself, regardless of whether they + * are inside of the window. + */ + AWINDOW_FLAG_NOT_TOUCH_MODAL = 0x00000020, + /** + * When set, if the device is asleep when the touch + * screen is pressed, you will receive this first touch event. Usually + * the first touch event is consumed by the system since the user can + * not see what they are pressing on. + * + * @deprecated This flag has no effect. + */ + AWINDOW_FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040, + /** + * As long as this window is visible to the user, keep + * the device's screen turned on and bright. + */ + AWINDOW_FLAG_KEEP_SCREEN_ON = 0x00000080, + /** + * Place the window within the entire screen, ignoring + * decorations around the border (such as the status bar). The + * window must correctly position its contents to take the screen + * decoration into account. + */ + AWINDOW_FLAG_LAYOUT_IN_SCREEN = 0x00000100, + /** allow window to extend outside of the screen. */ + AWINDOW_FLAG_LAYOUT_NO_LIMITS = 0x00000200, + /** + * Hide all screen decorations (such as the status + * bar) while this window is displayed. This allows the window to + * use the entire display space for itself -- the status bar will + * be hidden when an app window with this flag set is on the top + * layer. A fullscreen window will ignore a value of {@link + * AWINDOW_SOFT_INPUT_ADJUST_RESIZE}; the window will stay + * fullscreen and will not resize. + */ + AWINDOW_FLAG_FULLSCREEN = 0x00000400, + /** + * Override {@link AWINDOW_FLAG_FULLSCREEN} and force the + * screen decorations (such as the status bar) to be shown. + */ + AWINDOW_FLAG_FORCE_NOT_FULLSCREEN = 0x00000800, + /** + * Turn on dithering when compositing this window to + * the screen. + * @deprecated This flag is no longer used. + */ + AWINDOW_FLAG_DITHER = 0x00001000, + /** + * Treat the content of the window as secure, preventing + * it from appearing in screenshots or from being viewed on non-secure + * displays. + */ + AWINDOW_FLAG_SECURE = 0x00002000, + /** + * A special mode where the layout parameters are used + * to perform scaling of the surface when it is composited to the + * screen. + */ + AWINDOW_FLAG_SCALED = 0x00004000, + /** + * Intended for windows that will often be used when the user is + * holding the screen against their face, it will aggressively + * filter the event stream to prevent unintended presses in this + * situation that may not be desired for a particular window, when + * such an event stream is detected, the application will receive + * a {@link AMOTION_EVENT_ACTION_CANCEL} to indicate this so + * applications can handle this accordingly by taking no action on + * the event until the finger is released. + */ + AWINDOW_FLAG_IGNORE_CHEEK_PRESSES = 0x00008000, + /** + * A special option only for use in combination with + * {@link AWINDOW_FLAG_LAYOUT_IN_SCREEN}. When requesting layout in the + * screen your window may appear on top of or behind screen decorations + * such as the status bar. By also including this flag, the window + * manager will report the inset rectangle needed to ensure your + * content is not covered by screen decorations. + */ + AWINDOW_FLAG_LAYOUT_INSET_DECOR = 0x00010000, + /** + * Invert the state of {@link AWINDOW_FLAG_NOT_FOCUSABLE} with + * respect to how this window interacts with the current method. + * That is, if FLAG_NOT_FOCUSABLE is set and this flag is set, + * then the window will behave as if it needs to interact with the + * input method and thus be placed behind/away from it; if {@link + * AWINDOW_FLAG_NOT_FOCUSABLE} is not set and this flag is set, + * then the window will behave as if it doesn't need to interact + * with the input method and can be placed to use more space and + * cover the input method. + */ + AWINDOW_FLAG_ALT_FOCUSABLE_IM = 0x00020000, + /** + * If you have set {@link AWINDOW_FLAG_NOT_TOUCH_MODAL}, you + * can set this flag to receive a single special MotionEvent with + * the action + * {@link AMOTION_EVENT_ACTION_OUTSIDE} for + * touches that occur outside of your window. Note that you will not + * receive the full down/move/up gesture, only the location of the + * first down as an {@link AMOTION_EVENT_ACTION_OUTSIDE}. + */ + AWINDOW_FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000, + /** + * Special flag to let windows be shown when the screen + * is locked. This will let application windows take precedence over + * key guard or any other lock screens. Can be used with + * {@link AWINDOW_FLAG_KEEP_SCREEN_ON} to turn screen on and display windows + * directly before showing the key guard window. Can be used with + * {@link AWINDOW_FLAG_DISMISS_KEYGUARD} to automatically fully dismisss + * non-secure keyguards. This flag only applies to the top-most + * full-screen window. + */ + AWINDOW_FLAG_SHOW_WHEN_LOCKED = 0x00080000, + /** + * Ask that the system wallpaper be shown behind + * your window. The window surface must be translucent to be able + * to actually see the wallpaper behind it; this flag just ensures + * that the wallpaper surface will be there if this window actually + * has translucent regions. + */ + AWINDOW_FLAG_SHOW_WALLPAPER = 0x00100000, + /** + * When set as a window is being added or made + * visible, once the window has been shown then the system will + * poke the power manager's user activity (as if the user had woken + * up the device) to turn the screen on. + */ + AWINDOW_FLAG_TURN_SCREEN_ON = 0x00200000, + /** + * When set the window will cause the keyguard to + * be dismissed, only if it is not a secure lock keyguard. Because such + * a keyguard is not needed for security, it will never re-appear if + * the user navigates to another window (in contrast to + * {@link AWINDOW_FLAG_SHOW_WHEN_LOCKED}, which will only temporarily + * hide both secure and non-secure keyguards but ensure they reappear + * when the user moves to another UI that doesn't hide them). + * If the keyguard is currently active and is secure (requires an + * unlock pattern) than the user will still need to confirm it before + * seeing this window, unless {@link AWINDOW_FLAG_SHOW_WHEN_LOCKED} has + * also been set. + */ + AWINDOW_FLAG_DISMISS_KEYGUARD = 0x00400000, +}; + +#ifdef __cplusplus +}; +#endif + +#endif // ANDROID_WINDOW_H + +/** @} */ diff --git a/third_party/android_frameworks_native/include/binder/AppOpsManager.h b/third_party/android_frameworks_native/include/binder/AppOpsManager.h new file mode 100644 index 000000000..1d0e968c4 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/AppOpsManager.h @@ -0,0 +1,130 @@ +/* + * 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_APP_OPS_MANAGER_H +#define ANDROID_APP_OPS_MANAGER_H + +#include + +#include + +// --------------------------------------------------------------------------- +namespace android { + +class AppOpsManager +{ +public: + enum { + MODE_ALLOWED = IAppOpsService::MODE_ALLOWED, + MODE_IGNORED = IAppOpsService::MODE_IGNORED, + MODE_ERRORED = IAppOpsService::MODE_ERRORED + }; + + enum { + OP_NONE = -1, + OP_COARSE_LOCATION = 0, + OP_FINE_LOCATION = 1, + OP_GPS = 2, + OP_VIBRATE = 3, + OP_READ_CONTACTS = 4, + OP_WRITE_CONTACTS = 5, + OP_READ_CALL_LOG = 6, + OP_WRITE_CALL_LOG = 7, + OP_READ_CALENDAR = 8, + OP_WRITE_CALENDAR = 9, + OP_WIFI_SCAN = 10, + OP_POST_NOTIFICATION = 11, + OP_NEIGHBORING_CELLS = 12, + OP_CALL_PHONE = 13, + OP_READ_SMS = 14, + OP_WRITE_SMS = 15, + OP_RECEIVE_SMS = 16, + OP_RECEIVE_EMERGECY_SMS = 17, + OP_RECEIVE_MMS = 18, + OP_RECEIVE_WAP_PUSH = 19, + OP_SEND_SMS = 20, + OP_READ_ICC_SMS = 21, + OP_WRITE_ICC_SMS = 22, + OP_WRITE_SETTINGS = 23, + OP_SYSTEM_ALERT_WINDOW = 24, + OP_ACCESS_NOTIFICATIONS = 25, + OP_CAMERA = 26, + OP_RECORD_AUDIO = 27, + OP_PLAY_AUDIO = 28, + OP_READ_CLIPBOARD = 29, + OP_WRITE_CLIPBOARD = 30, + OP_TAKE_MEDIA_BUTTONS = 31, + OP_TAKE_AUDIO_FOCUS = 32, + OP_AUDIO_MASTER_VOLUME = 33, + OP_AUDIO_VOICE_VOLUME = 34, + OP_AUDIO_RING_VOLUME = 35, + OP_AUDIO_MEDIA_VOLUME = 36, + OP_AUDIO_ALARM_VOLUME = 37, + OP_AUDIO_NOTIFICATION_VOLUME = 38, + OP_AUDIO_BLUETOOTH_VOLUME = 39, + OP_WAKE_LOCK = 40, + OP_MONITOR_LOCATION = 41, + OP_MONITOR_HIGH_POWER_LOCATION = 42, + OP_GET_USAGE_STATS = 43, + OP_MUTE_MICROPHONE = 44, + OP_TOAST_WINDOW = 45, + OP_PROJECT_MEDIA = 46, + OP_ACTIVATE_VPN = 47, + OP_WRITE_WALLPAPER = 48, + OP_ASSIST_STRUCTURE = 49, + OP_ASSIST_SCREENSHOT = 50, + OP_READ_PHONE_STATE = 51, + OP_ADD_VOICEMAIL = 52, + OP_USE_SIP = 53, + OP_PROCESS_OUTGOING_CALLS = 54, + OP_USE_FINGERPRINT = 55, + OP_BODY_SENSORS = 56, + OP_READ_CELL_BROADCASTS = 57, + OP_MOCK_LOCATION = 58, + OP_READ_EXTERNAL_STORAGE = 59, + OP_WRITE_EXTERNAL_STORAGE = 60, + OP_TURN_SCREEN_ON = 61, + OP_GET_ACCOUNTS = 62, + OP_WIFI_CHANGE = 63, + OP_BLUETOOTH_CHANGE = 64, + OP_BOOT_COMPLETED = 65, + OP_NFC_CHANGE = 66, + OP_DATA_CONNECT_CHANGE = 67, + OP_SU = 68 + }; + + AppOpsManager(); + + int32_t checkOp(int32_t op, int32_t uid, const String16& callingPackage); + int32_t noteOp(int32_t op, int32_t uid, const String16& callingPackage); + int32_t startOp(int32_t op, int32_t uid, const String16& callingPackage); + void finishOp(int32_t op, int32_t uid, const String16& callingPackage); + void startWatchingMode(int32_t op, const String16& packageName, + const sp& callback); + void stopWatchingMode(const sp& callback); + int32_t permissionToOpCode(const String16& permission); + +private: + Mutex mLock; + sp mService; + + sp getService(); +}; + + +}; // namespace android +// --------------------------------------------------------------------------- +#endif // ANDROID_APP_OPS_MANAGER_H diff --git a/third_party/android_frameworks_native/include/binder/Binder.h b/third_party/android_frameworks_native/include/binder/Binder.h new file mode 100644 index 000000000..86628a03d --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/Binder.h @@ -0,0 +1,105 @@ +/* + * 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_BINDER_H +#define ANDROID_BINDER_H + +#include +#include +#include + +// --------------------------------------------------------------------------- +namespace android { + +class BBinder : public IBinder +{ +public: + BBinder(); + + virtual const String16& getInterfaceDescriptor() const; + virtual bool isBinderAlive() const; + virtual status_t pingBinder(); + virtual status_t dump(int fd, const Vector& args); + + virtual status_t transact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); + + virtual status_t linkToDeath(const sp& recipient, + void* cookie = NULL, + uint32_t flags = 0); + + virtual status_t unlinkToDeath( const wp& recipient, + void* cookie = NULL, + uint32_t flags = 0, + wp* outRecipient = NULL); + + virtual void attachObject( const void* objectID, + void* object, + void* cleanupCookie, + object_cleanup_func func); + virtual void* findObject(const void* objectID) const; + virtual void detachObject(const void* objectID); + + virtual BBinder* localBinder(); + +protected: + virtual ~BBinder(); + + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); + +private: + BBinder(const BBinder& o); + BBinder& operator=(const BBinder& o); + + class Extras; + + atomic_uintptr_t mExtras; // should be atomic + void* mReserved0; +}; + +// --------------------------------------------------------------------------- + +class BpRefBase : public virtual RefBase +{ +protected: + BpRefBase(const sp& o); + virtual ~BpRefBase(); + virtual void onFirstRef(); + virtual void onLastStrongRef(const void* id); + virtual bool onIncStrongAttempted(uint32_t flags, const void* id); + + inline IBinder* remote() { return mRemote; } + inline IBinder* remote() const { return mRemote; } + +private: + BpRefBase(const BpRefBase& o); + BpRefBase& operator=(const BpRefBase& o); + + IBinder* const mRemote; + RefBase::weakref_type* mRefs; + volatile int32_t mState; +}; + +}; // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_BINDER_H diff --git a/third_party/android_frameworks_native/include/binder/BinderService.h b/third_party/android_frameworks_native/include/binder/BinderService.h new file mode 100644 index 000000000..ef703bda9 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/BinderService.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2010 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_BINDER_SERVICE_H +#define ANDROID_BINDER_SERVICE_H + +#include + +#include +#include + +#include +#include +#include +#include + +// --------------------------------------------------------------------------- +namespace android { + +template +class BinderService +{ +public: + static status_t publish(bool allowIsolated = false) { + sp sm(defaultServiceManager()); + return sm->addService( + String16(SERVICE::getServiceName()), + new SERVICE(), allowIsolated); + } + + static void publishAndJoinThreadPool(bool allowIsolated = false) { + publish(allowIsolated); + joinThreadPool(); + } + + static void instantiate() { publish(); } + + static status_t shutdown() { return NO_ERROR; } + +private: + static void joinThreadPool() { + sp ps(ProcessState::self()); + ps->startThreadPool(); + ps->giveThreadPoolName(); + IPCThreadState::self()->joinThreadPool(); + } +}; + + +}; // namespace android +// --------------------------------------------------------------------------- +#endif // ANDROID_BINDER_SERVICE_H diff --git a/third_party/android_frameworks_native/include/binder/BpBinder.h b/third_party/android_frameworks_native/include/binder/BpBinder.h new file mode 100644 index 000000000..7ef93aa39 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/BpBinder.h @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2005 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_BPBINDER_H +#define ANDROID_BPBINDER_H + +#include +#include +#include + +// --------------------------------------------------------------------------- +namespace android { + +class BpBinder : public IBinder +{ +public: + BpBinder(int32_t handle); + + inline int32_t handle() const { return mHandle; } + + virtual const String16& getInterfaceDescriptor() const; + virtual bool isBinderAlive() const; + virtual status_t pingBinder(); + virtual status_t dump(int fd, const Vector& args); + + virtual status_t transact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); + + virtual status_t linkToDeath(const sp& recipient, + void* cookie = NULL, + uint32_t flags = 0); + virtual status_t unlinkToDeath( const wp& recipient, + void* cookie = NULL, + uint32_t flags = 0, + wp* outRecipient = NULL); + + virtual void attachObject( const void* objectID, + void* object, + void* cleanupCookie, + object_cleanup_func func); + virtual void* findObject(const void* objectID) const; + virtual void detachObject(const void* objectID); + + virtual BpBinder* remoteBinder(); + + status_t setConstantData(const void* data, size_t size); + void sendObituary(); + + class ObjectManager + { + public: + ObjectManager(); + ~ObjectManager(); + + void attach( const void* objectID, + void* object, + void* cleanupCookie, + IBinder::object_cleanup_func func); + void* find(const void* objectID) const; + void detach(const void* objectID); + + void kill(); + + private: + ObjectManager(const ObjectManager&); + ObjectManager& operator=(const ObjectManager&); + + struct entry_t + { + void* object; + void* cleanupCookie; + IBinder::object_cleanup_func func; + }; + + KeyedVector mObjects; + }; + +protected: + virtual ~BpBinder(); + virtual void onFirstRef(); + virtual void onLastStrongRef(const void* id); + virtual bool onIncStrongAttempted(uint32_t flags, const void* id); + +private: + const int32_t mHandle; + + struct Obituary { + wp recipient; + void* cookie; + uint32_t flags; + }; + + void reportOneDeath(const Obituary& obit); + bool isDescriptorCached() const; + + mutable Mutex mLock; + volatile int32_t mAlive; + volatile int32_t mObitsSent; + Vector* mObituaries; + ObjectManager mObjects; + Parcel* mConstantData; + mutable String16 mDescriptorCache; +}; + +}; // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_BPBINDER_H diff --git a/third_party/android_frameworks_native/include/binder/BufferedTextOutput.h b/third_party/android_frameworks_native/include/binder/BufferedTextOutput.h new file mode 100644 index 000000000..9a7c43bb1 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/BufferedTextOutput.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2006 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_BUFFEREDTEXTOUTPUT_H +#define ANDROID_BUFFEREDTEXTOUTPUT_H + +#include +#include +#include + +// --------------------------------------------------------------------------- +namespace android { + +class BufferedTextOutput : public TextOutput +{ +public: + //** Flags for constructor */ + enum { + MULTITHREADED = 0x0001 + }; + + BufferedTextOutput(uint32_t flags = 0); + virtual ~BufferedTextOutput(); + + virtual status_t print(const char* txt, size_t len); + virtual void moveIndent(int delta); + + virtual void pushBundle(); + virtual void popBundle(); + +protected: + virtual status_t writeLines(const struct iovec& vec, size_t N) = 0; + +private: + struct BufferState; + struct ThreadState; + + static ThreadState*getThreadState(); + static void threadDestructor(void *st); + + BufferState*getBuffer() const; + + uint32_t mFlags; + const int32_t mSeq; + const int32_t mIndex; + + Mutex mLock; + BufferState* mGlobalState; +}; + +// --------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_BUFFEREDTEXTOUTPUT_H diff --git a/third_party/android_frameworks_native/include/binder/Debug.h b/third_party/android_frameworks_native/include/binder/Debug.h new file mode 100644 index 000000000..f6a335502 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/Debug.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2005 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_BINDER_DEBUG_H +#define ANDROID_BINDER_DEBUG_H + +#include +#include + +namespace android { +// --------------------------------------------------------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +const char* stringForIndent(int32_t indentLevel); + +typedef void (*debugPrintFunc)(void* cookie, const char* txt); + +void printTypeCode(uint32_t typeCode, + debugPrintFunc func = 0, void* cookie = 0); + +void printHexData(int32_t indent, const void *buf, size_t length, + size_t bytesPerLine=16, int32_t singleLineBytesCutoff=16, + size_t alignment=0, bool cArrayStyle=false, + debugPrintFunc func = 0, void* cookie = 0); + +#ifdef __cplusplus +} +#endif + +// --------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_BINDER_DEBUG_H diff --git a/third_party/android_frameworks_native/include/binder/IAppOpsCallback.h b/third_party/android_frameworks_native/include/binder/IAppOpsCallback.h new file mode 100644 index 000000000..7f8eb0168 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/IAppOpsCallback.h @@ -0,0 +1,55 @@ +/* + * 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_IAPP_OPS_CALLBACK_H +#define ANDROID_IAPP_OPS_CALLBACK_H + +#include + +namespace android { + +// ---------------------------------------------------------------------- + +class IAppOpsCallback : public IInterface +{ +public: + DECLARE_META_INTERFACE(AppOpsCallback); + + virtual void opChanged(int32_t op, const String16& packageName) = 0; + + enum { + OP_CHANGED_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION + }; +}; + +// ---------------------------------------------------------------------- + +class BnAppOpsCallback : public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------- + +}; // namespace android + +#endif // ANDROID_IAPP_OPS_CALLBACK_H + diff --git a/third_party/android_frameworks_native/include/binder/IAppOpsService.h b/third_party/android_frameworks_native/include/binder/IAppOpsService.h new file mode 100644 index 000000000..cd81efa36 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/IAppOpsService.h @@ -0,0 +1,78 @@ +/* + * 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_IAPP_OPS_SERVICE_H +#define ANDROID_IAPP_OPS_SERVICE_H + +#include +#include + +namespace android { + +// ---------------------------------------------------------------------- + +class IAppOpsService : public IInterface +{ +public: + DECLARE_META_INTERFACE(AppOpsService); + + virtual int32_t checkOperation(int32_t code, int32_t uid, const String16& packageName) = 0; + virtual int32_t noteOperation(int32_t code, int32_t uid, const String16& packageName) = 0; + virtual int32_t startOperation(const sp& token, int32_t code, int32_t uid, + const String16& packageName) = 0; + virtual void finishOperation(const sp& token, int32_t code, int32_t uid, + const String16& packageName) = 0; + virtual void startWatchingMode(int32_t op, const String16& packageName, + const sp& callback) = 0; + virtual void stopWatchingMode(const sp& callback) = 0; + virtual sp getToken(const sp& clientToken) = 0; + virtual int32_t permissionToOpCode(const String16& permission) = 0; + + enum { + CHECK_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION, + NOTE_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+1, + START_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+2, + FINISH_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+3, + START_WATCHING_MODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+4, + STOP_WATCHING_MODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+5, + GET_TOKEN_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+6, + PERMISSION_TO_OP_CODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+7, + }; + + enum { + MODE_ALLOWED = 0, + MODE_IGNORED = 1, + MODE_ERRORED = 2 + }; +}; + +// ---------------------------------------------------------------------- + +class BnAppOpsService : public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------- + +}; // namespace android + +#endif // ANDROID_IAPP_OPS_SERVICE_H diff --git a/third_party/android_frameworks_native/include/binder/IBatteryStats.h b/third_party/android_frameworks_native/include/binder/IBatteryStats.h new file mode 100644 index 000000000..5f3818652 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/IBatteryStats.h @@ -0,0 +1,79 @@ +/* + * 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_IBATTERYSTATS_H +#define ANDROID_IBATTERYSTATS_H + +#include + +namespace android { + +// ---------------------------------------------------------------------- + +class IBatteryStats : public IInterface +{ +public: + DECLARE_META_INTERFACE(BatteryStats); + + virtual void noteStartSensor(int uid, int sensor) = 0; + virtual void noteStopSensor(int uid, int sensor) = 0; + virtual void noteStartVideo(int uid) = 0; + virtual void noteStopVideo(int uid) = 0; + virtual void noteStartAudio(int uid) = 0; + virtual void noteStopAudio(int uid) = 0; + virtual void noteResetVideo() = 0; + virtual void noteResetAudio() = 0; + virtual void noteFlashlightOn(int uid) = 0; + virtual void noteFlashlightOff(int uid) = 0; + virtual void noteStartCamera(int uid) = 0; + virtual void noteStopCamera(int uid) = 0; + virtual void noteResetCamera() = 0; + virtual void noteResetFlashlight() = 0; + + enum { + NOTE_START_SENSOR_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION, + NOTE_STOP_SENSOR_TRANSACTION, + NOTE_START_VIDEO_TRANSACTION, + NOTE_STOP_VIDEO_TRANSACTION, + NOTE_START_AUDIO_TRANSACTION, + NOTE_STOP_AUDIO_TRANSACTION, + NOTE_RESET_VIDEO_TRANSACTION, + NOTE_RESET_AUDIO_TRANSACTION, + NOTE_FLASHLIGHT_ON_TRANSACTION, + NOTE_FLASHLIGHT_OFF_TRANSACTION, + NOTE_START_CAMERA_TRANSACTION, + NOTE_STOP_CAMERA_TRANSACTION, + NOTE_RESET_CAMERA_TRANSACTION, + NOTE_RESET_FLASHLIGHT_TRANSACTION + }; +}; + +// ---------------------------------------------------------------------- + +class BnBatteryStats : public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------- + +}; // namespace android + +#endif // ANDROID_IBATTERYSTATS_H diff --git a/third_party/android_frameworks_native/include/binder/IBinder.h b/third_party/android_frameworks_native/include/binder/IBinder.h new file mode 100644 index 000000000..43b654334 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/IBinder.h @@ -0,0 +1,152 @@ +/* + * 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_IBINDER_H +#define ANDROID_IBINDER_H + +#include +#include +#include +#include + + +#define B_PACK_CHARS(c1, c2, c3, c4) \ + ((((c1)<<24)) | (((c2)<<16)) | (((c3)<<8)) | (c4)) + +// --------------------------------------------------------------------------- +namespace android { + +class BBinder; +class BpBinder; +class IInterface; +class Parcel; + +/** + * Base class and low-level protocol for a remotable object. + * You can derive from this class to create an object for which other + * processes can hold references to it. Communication between processes + * (method calls, property get and set) is down through a low-level + * protocol implemented on top of the transact() API. + */ +class IBinder : public virtual RefBase +{ +public: + enum { + FIRST_CALL_TRANSACTION = 0x00000001, + LAST_CALL_TRANSACTION = 0x00ffffff, + + PING_TRANSACTION = B_PACK_CHARS('_','P','N','G'), + DUMP_TRANSACTION = B_PACK_CHARS('_','D','M','P'), + INTERFACE_TRANSACTION = B_PACK_CHARS('_', 'N', 'T', 'F'), + SYSPROPS_TRANSACTION = B_PACK_CHARS('_', 'S', 'P', 'R'), + + // Corresponds to TF_ONE_WAY -- an asynchronous call. + FLAG_ONEWAY = 0x00000001 + }; + + IBinder(); + + /** + * Check if this IBinder implements the interface named by + * @a descriptor. If it does, the base pointer to it is returned, + * which you can safely static_cast<> to the concrete C++ interface. + */ + virtual sp queryLocalInterface(const String16& descriptor); + + /** + * Return the canonical name of the interface provided by this IBinder + * object. + */ + virtual const String16& getInterfaceDescriptor() const = 0; + + virtual bool isBinderAlive() const = 0; + virtual status_t pingBinder() = 0; + virtual status_t dump(int fd, const Vector& args) = 0; + + virtual status_t transact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0) = 0; + + class DeathRecipient : public virtual RefBase + { + public: + virtual void binderDied(const wp& who) = 0; + }; + + /** + * Register the @a recipient for a notification if this binder + * goes away. If this binder object unexpectedly goes away + * (typically because its hosting process has been killed), + * then DeathRecipient::binderDied() will be called with a reference + * to this. + * + * The @a cookie is optional -- if non-NULL, it should be a + * memory address that you own (that is, you know it is unique). + * + * @note You will only receive death notifications for remote binders, + * as local binders by definition can't die without you dying as well. + * Trying to use this function on a local binder will result in an + * INVALID_OPERATION code being returned and nothing happening. + * + * @note This link always holds a weak reference to its recipient. + * + * @note You will only receive a weak reference to the dead + * binder. You should not try to promote this to a strong reference. + * (Nor should you need to, as there is nothing useful you can + * directly do with it now that it has passed on.) + */ + virtual status_t linkToDeath(const sp& recipient, + void* cookie = NULL, + uint32_t flags = 0) = 0; + + /** + * Remove a previously registered death notification. + * The @a recipient will no longer be called if this object + * dies. The @a cookie is optional. If non-NULL, you can + * supply a NULL @a recipient, and the recipient previously + * added with that cookie will be unlinked. + */ + virtual status_t unlinkToDeath( const wp& recipient, + void* cookie = NULL, + uint32_t flags = 0, + wp* outRecipient = NULL) = 0; + + virtual bool checkSubclass(const void* subclassID) const; + + typedef void (*object_cleanup_func)(const void* id, void* obj, void* cleanupCookie); + + virtual void attachObject( const void* objectID, + void* object, + void* cleanupCookie, + object_cleanup_func func) = 0; + virtual void* findObject(const void* objectID) const = 0; + virtual void detachObject(const void* objectID) = 0; + + virtual BBinder* localBinder(); + virtual BpBinder* remoteBinder(); + +protected: + virtual ~IBinder(); + +private: +}; + +}; // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_IBINDER_H diff --git a/third_party/android_frameworks_native/include/binder/IInterface.h b/third_party/android_frameworks_native/include/binder/IInterface.h new file mode 100644 index 000000000..4ce361380 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/IInterface.h @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2005 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_IINTERFACE_H +#define ANDROID_IINTERFACE_H + +#include + +namespace android { + +// ---------------------------------------------------------------------- + +class IInterface : public virtual RefBase +{ +public: + IInterface(); + static sp asBinder(const IInterface*); + static sp asBinder(const sp&); + +protected: + virtual ~IInterface(); + virtual IBinder* onAsBinder() = 0; +}; + +// ---------------------------------------------------------------------- + +template +inline sp interface_cast(const sp& obj) +{ + return INTERFACE::asInterface(obj); +} + +// ---------------------------------------------------------------------- + +template +class BnInterface : public INTERFACE, public BBinder +{ +public: + virtual sp queryLocalInterface(const String16& _descriptor); + virtual const String16& getInterfaceDescriptor() const; + +protected: + virtual IBinder* onAsBinder(); +}; + +// ---------------------------------------------------------------------- + +template +class BpInterface : public INTERFACE, public BpRefBase +{ +public: + BpInterface(const sp& remote); + +protected: + virtual IBinder* onAsBinder(); +}; + +// ---------------------------------------------------------------------- + +#define DECLARE_META_INTERFACE(INTERFACE) \ + static const android::String16 descriptor; \ + static android::sp asInterface( \ + const android::sp& obj); \ + virtual const android::String16& getInterfaceDescriptor() const; \ + I##INTERFACE(); \ + virtual ~I##INTERFACE(); \ + + +#define IMPLEMENT_META_INTERFACE(INTERFACE, NAME) \ + const android::String16 I##INTERFACE::descriptor(NAME); \ + const android::String16& \ + I##INTERFACE::getInterfaceDescriptor() const { \ + return I##INTERFACE::descriptor; \ + } \ + android::sp I##INTERFACE::asInterface( \ + const android::sp& obj) \ + { \ + android::sp intr; \ + if (obj != NULL) { \ + intr = static_cast( \ + obj->queryLocalInterface( \ + I##INTERFACE::descriptor).get()); \ + if (intr == NULL) { \ + intr = new Bp##INTERFACE(obj); \ + } \ + } \ + return intr; \ + } \ + I##INTERFACE::I##INTERFACE() { } \ + I##INTERFACE::~I##INTERFACE() { } \ + + +#define CHECK_INTERFACE(interface, data, reply) \ + if (!data.checkInterface(this)) { return PERMISSION_DENIED; } \ + + +// ---------------------------------------------------------------------- +// No user-serviceable parts after this... + +template +inline sp BnInterface::queryLocalInterface( + const String16& _descriptor) +{ + if (_descriptor == INTERFACE::descriptor) return this; + return NULL; +} + +template +inline const String16& BnInterface::getInterfaceDescriptor() const +{ + return INTERFACE::getInterfaceDescriptor(); +} + +template +IBinder* BnInterface::onAsBinder() +{ + return this; +} + +template +inline BpInterface::BpInterface(const sp& remote) + : BpRefBase(remote) +{ +} + +template +inline IBinder* BpInterface::onAsBinder() +{ + return remote(); +} + +// ---------------------------------------------------------------------- + +}; // namespace android + +#endif // ANDROID_IINTERFACE_H diff --git a/third_party/android_frameworks_native/include/binder/IMemory.h b/third_party/android_frameworks_native/include/binder/IMemory.h new file mode 100644 index 000000000..178ef8593 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/IMemory.h @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2007 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_IMEMORY_H +#define ANDROID_IMEMORY_H + +#include +#include +#include + +#include +#include +#include + +namespace android { + +// ---------------------------------------------------------------------------- + +class IMemoryHeap : public IInterface +{ +public: + DECLARE_META_INTERFACE(MemoryHeap); + + // flags returned by getFlags() + enum { + READ_ONLY = 0x00000001, +#ifdef USE_MEMORY_HEAP_ION + USE_ION_FD = 0x00008000 +#else + USE_ION_FD = 0x00000008 +#endif + }; + + virtual int getHeapID() const = 0; + virtual void* getBase() const = 0; + virtual size_t getSize() const = 0; + virtual uint32_t getFlags() const = 0; + virtual uint32_t getOffset() const = 0; + + // these are there just for backward source compatibility + int32_t heapID() const { return getHeapID(); } + void* base() const { return getBase(); } + size_t virtualSize() const { return getSize(); } +}; + +class BnMemoryHeap : public BnInterface +{ +public: + virtual status_t onTransact( + uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); + + BnMemoryHeap(); +protected: + virtual ~BnMemoryHeap(); +}; + +// ---------------------------------------------------------------------------- + +class IMemory : public IInterface +{ +public: + DECLARE_META_INTERFACE(Memory); + + virtual sp getMemory(ssize_t* offset=0, size_t* size=0) const = 0; + + // helpers + void* fastPointer(const sp& heap, ssize_t offset) const; + void* pointer() const; + size_t size() const; + ssize_t offset() const; +}; + +class BnMemory : public BnInterface +{ +public: + virtual status_t onTransact( + uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); + + BnMemory(); +protected: + virtual ~BnMemory(); +}; + +// ---------------------------------------------------------------------------- + +}; // namespace android + +#endif // ANDROID_IMEMORY_H diff --git a/third_party/android_frameworks_native/include/binder/IPCThreadState.h b/third_party/android_frameworks_native/include/binder/IPCThreadState.h new file mode 100644 index 000000000..1853cff23 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/IPCThreadState.h @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2005 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_IPC_THREAD_STATE_H +#define ANDROID_IPC_THREAD_STATE_H + +#include +#include +#include +#include + +#if defined(_WIN32) +typedef int uid_t; +#endif + +// --------------------------------------------------------------------------- +namespace android { + +class IPCThreadState +{ +public: + static IPCThreadState* self(); + static IPCThreadState* selfOrNull(); // self(), but won't instantiate + + sp process(); + + status_t clearLastError(); + + pid_t getCallingPid() const; + uid_t getCallingUid() const; + + void setStrictModePolicy(int32_t policy); + int32_t getStrictModePolicy() const; + + void setLastTransactionBinderFlags(int32_t flags); + int32_t getLastTransactionBinderFlags() const; + + int64_t clearCallingIdentity(); + void restoreCallingIdentity(int64_t token); + + int setupPolling(int* fd); + status_t handlePolledCommands(); + void flushCommands(); + + void joinThreadPool(bool isMain = true); + + // Stop the local process. + void stopProcess(bool immediate = true); + + status_t transact(int32_t handle, + uint32_t code, const Parcel& data, + Parcel* reply, uint32_t flags); + + void incStrongHandle(int32_t handle); + void decStrongHandle(int32_t handle); + void incWeakHandle(int32_t handle); + void decWeakHandle(int32_t handle); + status_t attemptIncStrongHandle(int32_t handle); + static void expungeHandle(int32_t handle, IBinder* binder); + status_t requestDeathNotification( int32_t handle, + BpBinder* proxy); + status_t clearDeathNotification( int32_t handle, + BpBinder* proxy); + + static void shutdown(); + + // Call this to disable switching threads to background scheduling when + // receiving incoming IPC calls. This is specifically here for the + // Android system process, since it expects to have background apps calling + // in to it but doesn't want to acquire locks in its services while in + // the background. + static void disableBackgroundScheduling(bool disable); + + // Call blocks until the number of executing binder threads is less than + // the maximum number of binder threads threads allowed for this process. + void blockUntilThreadAvailable(); + +private: + IPCThreadState(); + ~IPCThreadState(); + + status_t sendReply(const Parcel& reply, uint32_t flags); + status_t waitForResponse(Parcel *reply, + status_t *acquireResult=NULL); + status_t talkWithDriver(bool doReceive=true); + status_t writeTransactionData(int32_t cmd, + uint32_t binderFlags, + int32_t handle, + uint32_t code, + const Parcel& data, + status_t* statusBuffer); + status_t getAndExecuteCommand(); + status_t executeCommand(int32_t command); + void processPendingDerefs(); + + void clearCaller(); + + static void threadDestructor(void *st); + static void freeBuffer(Parcel* parcel, + const uint8_t* data, size_t dataSize, + const binder_size_t* objects, size_t objectsSize, + void* cookie); + + const sp mProcess; + const pid_t mMyThreadId; + Vector mPendingStrongDerefs; + Vector mPendingWeakDerefs; + + Parcel mIn; + Parcel mOut; + status_t mLastError; + pid_t mCallingPid; + uid_t mCallingUid; + int32_t mStrictModePolicy; + int32_t mLastTransactionBinderFlags; +}; + +}; // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_IPC_THREAD_STATE_H diff --git a/third_party/android_frameworks_native/include/binder/IPermissionController.h b/third_party/android_frameworks_native/include/binder/IPermissionController.h new file mode 100644 index 000000000..4e5fb3483 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/IPermissionController.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2005 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_IPERMISSION_CONTROLLER_H +#define ANDROID_IPERMISSION_CONTROLLER_H + +#include +#include + +namespace android { + +// ---------------------------------------------------------------------- + +class IPermissionController : public IInterface +{ +public: + DECLARE_META_INTERFACE(PermissionController); + + virtual bool checkPermission(const String16& permission, int32_t pid, int32_t uid) = 0; + + virtual void getPackagesForUid(const uid_t uid, Vector &packages) = 0; + + virtual bool isRuntimePermission(const String16& permission) = 0; + + enum { + CHECK_PERMISSION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION, + GET_PACKAGES_FOR_UID_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION + 1, + IS_RUNTIME_PERMISSION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION + 2 + }; +}; + +// ---------------------------------------------------------------------- + +class BnPermissionController : public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------- + +}; // namespace android + +#endif // ANDROID_IPERMISSION_CONTROLLER_H + diff --git a/third_party/android_frameworks_native/include/binder/IProcessInfoService.h b/third_party/android_frameworks_native/include/binder/IProcessInfoService.h new file mode 100644 index 000000000..dc62f457c --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/IProcessInfoService.h @@ -0,0 +1,53 @@ +/* + * Copyright 2015 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_I_PROCESS_INFO_SERVICE_H +#define ANDROID_I_PROCESS_INFO_SERVICE_H + +#include + +namespace android { + +// ---------------------------------------------------------------------- + +class IProcessInfoService : public IInterface { +public: + DECLARE_META_INTERFACE(ProcessInfoService); + + virtual status_t getProcessStatesFromPids( size_t length, + /*in*/ int32_t* pids, + /*out*/ int32_t* states) = 0; + + enum { + GET_PROCESS_STATES_FROM_PIDS = IBinder::FIRST_CALL_TRANSACTION, + }; +}; + +// ---------------------------------------------------------------------- + +class BnProcessInfoService : public BnInterface { +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------- + +}; // namespace android + +#endif // ANDROID_I_PROCESS_INFO_SERVICE_H diff --git a/third_party/android_frameworks_native/include/binder/IServiceManager.h b/third_party/android_frameworks_native/include/binder/IServiceManager.h new file mode 100644 index 000000000..2c297d64f --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/IServiceManager.h @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2005 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_ISERVICE_MANAGER_H +#define ANDROID_ISERVICE_MANAGER_H + +#include +#include +#include +#include + +namespace android { + +// ---------------------------------------------------------------------- + +class IServiceManager : public IInterface +{ +public: + DECLARE_META_INTERFACE(ServiceManager); + + /** + * Retrieve an existing service, blocking for a few seconds + * if it doesn't yet exist. + */ + virtual sp getService( const String16& name) const = 0; + + /** + * Retrieve an existing service, non-blocking. + */ + virtual sp checkService( const String16& name) const = 0; + + /** + * Register a service. + */ + virtual status_t addService( const String16& name, + const sp& service, + bool allowIsolated = false) = 0; + + /** + * Return list of all existing services. + */ + virtual Vector listServices() = 0; + + enum { + GET_SERVICE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION, + CHECK_SERVICE_TRANSACTION, + ADD_SERVICE_TRANSACTION, + LIST_SERVICES_TRANSACTION, + }; +}; + +sp defaultServiceManager(); + +template +status_t getService(const String16& name, sp* outService) +{ + const sp sm = defaultServiceManager(); + if (sm != NULL) { + *outService = interface_cast(sm->getService(name)); + if ((*outService) != NULL) return NO_ERROR; + } + return NAME_NOT_FOUND; +} + +bool checkCallingPermission(const String16& permission); +bool checkCallingPermission(const String16& permission, + int32_t* outPid, int32_t* outUid); +bool checkPermission(const String16& permission, pid_t pid, uid_t uid); + + +// ---------------------------------------------------------------------- + +class BnServiceManager : public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------- + +}; // namespace android + +#endif // ANDROID_ISERVICE_MANAGER_H + diff --git a/third_party/android_frameworks_native/include/binder/MemoryBase.h b/third_party/android_frameworks_native/include/binder/MemoryBase.h new file mode 100644 index 000000000..463e26d97 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/MemoryBase.h @@ -0,0 +1,51 @@ +/* + * 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_MEMORY_BASE_H +#define ANDROID_MEMORY_BASE_H + +#include +#include + +#include + + +namespace android { + +// --------------------------------------------------------------------------- + +class MemoryBase : public BnMemory +{ +public: + MemoryBase(const sp& heap, ssize_t offset, size_t size); + virtual ~MemoryBase(); + virtual sp getMemory(ssize_t* offset, size_t* size) const; + +protected: + size_t getSize() const { return mSize; } + ssize_t getOffset() const { return mOffset; } + const sp& getHeap() const { return mHeap; } + +private: + size_t mSize; + ssize_t mOffset; + sp mHeap; +}; + +// --------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_MEMORY_BASE_H diff --git a/third_party/android_frameworks_native/include/binder/MemoryDealer.h b/third_party/android_frameworks_native/include/binder/MemoryDealer.h new file mode 100644 index 000000000..aa415d5ac --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/MemoryDealer.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2007 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_MEMORY_DEALER_H +#define ANDROID_MEMORY_DEALER_H + + +#include +#include + +#include +#include + +namespace android { +// ---------------------------------------------------------------------------- + +class SimpleBestFitAllocator; + +// ---------------------------------------------------------------------------- + +class MemoryDealer : public RefBase +{ +public: + MemoryDealer(size_t size, const char* name = 0, + uint32_t flags = 0 /* or bits such as MemoryHeapBase::READ_ONLY */ ); + + virtual sp allocate(size_t size); + virtual void deallocate(size_t offset); + virtual void dump(const char* what) const; + + sp getMemoryHeap() const { return heap(); } + +protected: + virtual ~MemoryDealer(); + +private: + const sp& heap() const; + SimpleBestFitAllocator* allocator() const; + + sp mHeap; + SimpleBestFitAllocator* mAllocator; +}; + + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_MEMORY_DEALER_H diff --git a/third_party/android_frameworks_native/include/binder/MemoryHeapBase.h b/third_party/android_frameworks_native/include/binder/MemoryHeapBase.h new file mode 100644 index 000000000..ea9b66c49 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/MemoryHeapBase.h @@ -0,0 +1,103 @@ +/* + * 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_MEMORY_HEAP_BASE_H +#define ANDROID_MEMORY_HEAP_BASE_H + +#include +#include + +#include + + +namespace android { + +// --------------------------------------------------------------------------- + +class MemoryHeapBase : public virtual BnMemoryHeap +{ +public: + enum { + READ_ONLY = IMemoryHeap::READ_ONLY, + // memory won't be mapped locally, but will be mapped in the remote + // process. + DONT_MAP_LOCALLY = 0x00000100, + NO_CACHING = 0x00000200 + }; + + /* + * maps the memory referenced by fd. but DOESN'T take ownership + * of the filedescriptor (it makes a copy with dup() + */ + MemoryHeapBase(int fd, size_t size, uint32_t flags = 0, uint32_t offset = 0); + + /* + * maps memory from the given device + */ + MemoryHeapBase(const char* device, size_t size = 0, uint32_t flags = 0); + + /* + * maps memory from ashmem, with the given name for debugging + */ + MemoryHeapBase(size_t size, uint32_t flags = 0, char const* name = NULL); + + virtual ~MemoryHeapBase(); + + /* implement IMemoryHeap interface */ + virtual int getHeapID() const; + + /* virtual address of the heap. returns MAP_FAILED in case of error */ + virtual void* getBase() const; + + virtual size_t getSize() const; + virtual uint32_t getFlags() const; + virtual uint32_t getOffset() const; + + const char* getDevice() const; + + /* this closes this heap -- use carefully */ + void dispose(); + + /* this is only needed as a workaround, use only if you know + * what you are doing */ + status_t setDevice(const char* device) { + if (mDevice == 0) + mDevice = device; + return mDevice ? NO_ERROR : ALREADY_EXISTS; + } + +protected: + MemoryHeapBase(); + // init() takes ownership of fd + status_t init(int fd, void *base, int size, + int flags = 0, const char* device = NULL); + +private: + status_t mapfd(int fd, size_t size, uint32_t offset = 0); + + int mFD; + size_t mSize; + void* mBase; + uint32_t mFlags; + const char* mDevice; + bool mNeedUnmap; + uint32_t mOffset; +}; + +// --------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_MEMORY_HEAP_BASE_H diff --git a/third_party/android_frameworks_native/include/binder/MemoryHeapIon.h b/third_party/android_frameworks_native/include/binder/MemoryHeapIon.h new file mode 100644 index 000000000..7e059f4ea --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/MemoryHeapIon.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * Copyright 2011, Samsung Electronics Co. LTD + * + * 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. + */ +/*! + * \file MemoryHeapIon.h + * \brief header file for MemoryHeapIon + * \author MinGu, Jeon(mingu85.jeon) + * \date 2011/11/20 + * + * Revision History: + * - 2011/11/21 : MinGu, Jeon(mingu85.jeon)) \n + * Initial version + * - 2012/11/29 : MinGu, Jeon(mingu85.jeon)) \n + * Change name + */ + +#ifndef ANDROID_MEMORY_HEAP_ION_H +#define ANDROID_MEMORY_HEAP_ION_H + +#include +#include +#include + +#define MHB_ION_HEAP_SYSTEM_CONTIG_MASK (1 << 1) +#define MHB_ION_HEAP_EXYNOS_CONTIG_MASK (1 << 4) +#define MHB_ION_HEAP_EXYNOS_MASK (1 << 5) +#define MHB_ION_HEAP_SYSTEM_MASK (1 << 6) + +#define MHB_ION_FLAG_CACHED (1 << 16) +#define MHB_ION_FLAG_CACHED_NEEDS_SYNC (1 << 17) +#define MHB_ION_FLAG_PRESERVE_KMAP (1 << 18) + +#define MHB_ION_EXYNOS_VIDEO_MASK (1 << 21) +#define MHB_ION_EXYNOS_MFC_INPUT_MASK (1 << 25) +#define MHB_ION_EXYNOS_MFC_OUTPUT_MASK (1 << 26) +#define MHB_ION_EXYNOS_GSC_MASK (1 << 27) +#define MHB_ION_EXYNOS_FIMD_VIDEO_MASK (1 << 28) + +namespace android { + +class MemoryHeapIon : public MemoryHeapBase +{ +public: + enum { + USE_ION_FD = IMemoryHeap::USE_ION_FD + }; + MemoryHeapIon(size_t size, uint32_t flags = 0, char const* name = NULL); + MemoryHeapIon(int fd, size_t size, uint32_t flags = 0, uint32_t offset = 0); + ~MemoryHeapIon(); +private: + int mIonClient; +}; + +}; +#endif diff --git a/third_party/android_frameworks_native/include/binder/Parcel.h b/third_party/android_frameworks_native/include/binder/Parcel.h new file mode 100644 index 000000000..91ffae0ba --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/Parcel.h @@ -0,0 +1,436 @@ +/* + * Copyright (C) 2005 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_PARCEL_H +#define ANDROID_PARCEL_H + +#include +#include +#include +#include +#include +#include +#include + +// --------------------------------------------------------------------------- +namespace android { + +template class Flattenable; +template class LightFlattenable; +class IBinder; +class IPCThreadState; +class ProcessState; +class String8; +class TextOutput; + +class Parcel { + friend class IPCThreadState; +public: + class ReadableBlob; + class WritableBlob; + + Parcel(); + ~Parcel(); + + const uint8_t* data() const; + size_t dataSize() const; + size_t dataAvail() const; + size_t dataPosition() const; + size_t dataCapacity() const; + + status_t setDataSize(size_t size); + void setDataPosition(size_t pos) const; + status_t setDataCapacity(size_t size); + + status_t setData(const uint8_t* buffer, size_t len); + + status_t appendFrom(const Parcel *parcel, + size_t start, size_t len); + + bool allowFds() const; + bool pushAllowFds(bool allowFds); + void restoreAllowFds(bool lastValue); + + bool hasFileDescriptors() const; + + // Writes the RPC header. + status_t writeInterfaceToken(const String16& interface); + + // Parses the RPC header, returning true if the interface name + // in the header matches the expected interface from the caller. + // + // Additionally, enforceInterface does part of the work of + // propagating the StrictMode policy mask, populating the current + // IPCThreadState, which as an optimization may optionally be + // passed in. + bool enforceInterface(const String16& interface, + IPCThreadState* threadState = NULL) const; + bool checkInterface(IBinder*) const; + + void freeData(); + +private: + const binder_size_t* objects() const; + +public: + size_t objectsCount() const; + + status_t errorCheck() const; + void setError(status_t err); + + status_t write(const void* data, size_t len); + void* writeInplace(size_t len); + status_t writeUnpadded(const void* data, size_t len); + status_t writeInt32(int32_t val); + status_t writeUint32(uint32_t val); + status_t writeInt64(int64_t val); + status_t writeUint64(uint64_t val); + status_t writeFloat(float val); + status_t writeDouble(double val); + status_t writeCString(const char* str); + status_t writeString8(const String8& str); + status_t writeString16(const String16& str); + status_t writeString16(const char16_t* str, size_t len); + status_t writeStrongBinder(const sp& val); + status_t writeWeakBinder(const wp& val); + status_t writeInt32Array(size_t len, const int32_t *val); + status_t writeByteArray(size_t len, const uint8_t *val); + + template + status_t write(const Flattenable& val); + + template + status_t write(const LightFlattenable& val); + + + // Place a native_handle into the parcel (the native_handle's file- + // descriptors are dup'ed, so it is safe to delete the native_handle + // when this function returns). + // Doesn't take ownership of the native_handle. + status_t writeNativeHandle(const native_handle* handle); + + // Place a file descriptor into the parcel. The given fd must remain + // valid for the lifetime of the parcel. + // The Parcel does not take ownership of the given fd unless you ask it to. + status_t writeFileDescriptor(int fd, bool takeOwnership = false); + + // Place a file descriptor into the parcel. A dup of the fd is made, which + // will be closed once the parcel is destroyed. + status_t writeDupFileDescriptor(int fd); + + // Writes a blob to the parcel. + // If the blob is small, then it is stored in-place, otherwise it is + // transferred by way of an anonymous shared memory region. Prefer sending + // immutable blobs if possible since they may be subsequently transferred between + // processes without further copying whereas mutable blobs always need to be copied. + // The caller should call release() on the blob after writing its contents. + status_t writeBlob(size_t len, bool mutableCopy, WritableBlob* outBlob); + + // Write an existing immutable blob file descriptor to the parcel. + // This allows the client to send the same blob to multiple processes + // as long as it keeps a dup of the blob file descriptor handy for later. + status_t writeDupImmutableBlobFileDescriptor(int fd); + + status_t writeObject(const flat_binder_object& val, bool nullMetaData); + + // Like Parcel.java's writeNoException(). Just writes a zero int32. + // Currently the native implementation doesn't do any of the StrictMode + // stack gathering and serialization that the Java implementation does. + status_t writeNoException(); + + void remove(size_t start, size_t amt); + + status_t read(void* outData, size_t len) const; + const void* readInplace(size_t len) const; + int32_t readInt32() const; + status_t readInt32(int32_t *pArg) const; + uint32_t readUint32() const; + status_t readUint32(uint32_t *pArg) const; + int64_t readInt64() const; + status_t readInt64(int64_t *pArg) const; + uint64_t readUint64() const; + status_t readUint64(uint64_t *pArg) const; + float readFloat() const; + status_t readFloat(float *pArg) const; + double readDouble() const; + status_t readDouble(double *pArg) const; + intptr_t readIntPtr() const; + status_t readIntPtr(intptr_t *pArg) const; + + const char* readCString() const; + String8 readString8() const; + String16 readString16() const; + const char16_t* readString16Inplace(size_t* outLen) const; + sp readStrongBinder() const; + wp readWeakBinder() const; + + template + status_t read(Flattenable& val) const; + + template + status_t read(LightFlattenable& val) const; + + // Like Parcel.java's readExceptionCode(). Reads the first int32 + // off of a Parcel's header, returning 0 or the negative error + // code on exceptions, but also deals with skipping over rich + // response headers. Callers should use this to read & parse the + // response headers rather than doing it by hand. + int32_t readExceptionCode() const; + + // Retrieve native_handle from the parcel. This returns a copy of the + // parcel's native_handle (the caller takes ownership). The caller + // must free the native_handle with native_handle_close() and + // native_handle_delete(). + native_handle* readNativeHandle() const; + + + // Retrieve a file descriptor from the parcel. This returns the raw fd + // in the parcel, which you do not own -- use dup() to get your own copy. + int readFileDescriptor() const; + + // Reads a blob from the parcel. + // The caller should call release() on the blob after reading its contents. + status_t readBlob(size_t len, ReadableBlob* outBlob) const; + + const flat_binder_object* readObject(bool nullMetaData) const; + + // Explicitly close all file descriptors in the parcel. + void closeFileDescriptors(); + + // Debugging: get metrics on current allocations. + static size_t getGlobalAllocSize(); + static size_t getGlobalAllocCount(); + +private: + typedef void (*release_func)(Parcel* parcel, + const uint8_t* data, size_t dataSize, + const binder_size_t* objects, size_t objectsSize, + void* cookie); + + uintptr_t ipcData() const; + size_t ipcDataSize() const; + uintptr_t ipcObjects() const; + size_t ipcObjectsCount() const; + void ipcSetDataReference(const uint8_t* data, size_t dataSize, + const binder_size_t* objects, size_t objectsCount, + release_func relFunc, void* relCookie); + +public: + void print(TextOutput& to, uint32_t flags = 0) const; + +private: + Parcel(const Parcel& o); + Parcel& operator=(const Parcel& o); + + status_t finishWrite(size_t len); + void releaseObjects(); + void acquireObjects(); + status_t growData(size_t len); + status_t restartWrite(size_t desired); + status_t continueWrite(size_t desired); + status_t writePointer(uintptr_t val); + status_t readPointer(uintptr_t *pArg) const; + uintptr_t readPointer() const; + void freeDataNoInit(); + void initState(); + void scanForFds() const; + + template + status_t readAligned(T *pArg) const; + + template T readAligned() const; + + template + status_t writeAligned(T val); + + status_t mError; + uint8_t* mData; + size_t mDataSize; + size_t mDataCapacity; + mutable size_t mDataPos; + binder_size_t* mObjects; + size_t mObjectsSize; + size_t mObjectsCapacity; + mutable size_t mNextObjectHint; + + mutable bool mFdsKnown; + mutable bool mHasFds; + bool mAllowFds; + + release_func mOwner; + void* mOwnerCookie; + + class Blob { + public: + Blob(); + ~Blob(); + + void clear(); + void release(); + inline size_t size() const { return mSize; } + inline int fd() const { return mFd; }; + inline bool isMutable() const { return mMutable; } + + protected: + void init(int fd, void* data, size_t size, bool isMutable); + + int mFd; // owned by parcel so not closed when released + void* mData; + size_t mSize; + bool mMutable; + }; + + class FlattenableHelperInterface { + protected: + ~FlattenableHelperInterface() { } + public: + virtual size_t getFlattenedSize() const = 0; + virtual size_t getFdCount() const = 0; + virtual status_t flatten(void* buffer, size_t size, int* fds, size_t count) const = 0; + virtual status_t unflatten(void const* buffer, size_t size, int const* fds, size_t count) = 0; + }; + + template + class FlattenableHelper : public FlattenableHelperInterface { + friend class Parcel; + const Flattenable& val; + explicit FlattenableHelper(const Flattenable& val) : val(val) { } + + public: + virtual size_t getFlattenedSize() const { + return val.getFlattenedSize(); + } + virtual size_t getFdCount() const { + return val.getFdCount(); + } + virtual status_t flatten(void* buffer, size_t size, int* fds, size_t count) const { + return val.flatten(buffer, size, fds, count); + } + virtual status_t unflatten(void const* buffer, size_t size, int const* fds, size_t count) { + return const_cast&>(val).unflatten(buffer, size, fds, count); + } + }; + status_t write(const FlattenableHelperInterface& val); + status_t read(FlattenableHelperInterface& val) const; + +public: + class ReadableBlob : public Blob { + friend class Parcel; + public: + inline const void* data() const { return mData; } + inline void* mutableData() { return isMutable() ? mData : NULL; } + }; + + class WritableBlob : public Blob { + friend class Parcel; + public: + inline void* data() { return mData; } + }; + +#ifndef DISABLE_ASHMEM_TRACKING +private: + size_t mOpenAshmemSize; +#endif + +public: + // TODO: Remove once ABI can be changed. + size_t getBlobAshmemSize() const; + size_t getOpenAshmemSize() const; +}; + +// --------------------------------------------------------------------------- + +template +status_t Parcel::write(const Flattenable& val) { + const FlattenableHelper helper(val); + return write(helper); +} + +template +status_t Parcel::write(const LightFlattenable& val) { + size_t size(val.getFlattenedSize()); + if (!val.isFixedSize()) { + status_t err = writeInt32(size); + if (err != NO_ERROR) { + return err; + } + } + if (size) { + void* buffer = writeInplace(size); + if (buffer == NULL) + return NO_MEMORY; + return val.flatten(buffer, size); + } + return NO_ERROR; +} + +template +status_t Parcel::read(Flattenable& val) const { + FlattenableHelper helper(val); + return read(helper); +} + +template +status_t Parcel::read(LightFlattenable& val) const { + size_t size; + if (val.isFixedSize()) { + size = val.getFlattenedSize(); + } else { + int32_t s; + status_t err = readInt32(&s); + if (err != NO_ERROR) { + return err; + } + size = s; + } + if (size) { + void const* buffer = readInplace(size); + return buffer == NULL ? NO_MEMORY : + val.unflatten(buffer, size); + } + return NO_ERROR; +} + +// --------------------------------------------------------------------------- + +inline TextOutput& operator<<(TextOutput& to, const Parcel& parcel) +{ + parcel.print(to); + return to; +} + +// --------------------------------------------------------------------------- + +// Generic acquire and release of objects. +void acquire_object(const sp& proc, + const flat_binder_object& obj, const void* who); +void release_object(const sp& proc, + const flat_binder_object& obj, const void* who); + +void flatten_binder(const sp& proc, + const sp& binder, flat_binder_object* out); +void flatten_binder(const sp& proc, + const wp& binder, flat_binder_object* out); +status_t unflatten_binder(const sp& proc, + const flat_binder_object& flat, sp* out); +status_t unflatten_binder(const sp& proc, + const flat_binder_object& flat, wp* out); + +}; // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_PARCEL_H diff --git a/third_party/android_frameworks_native/include/binder/PermissionCache.h b/third_party/android_frameworks_native/include/binder/PermissionCache.h new file mode 100644 index 000000000..bcdf0c291 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/PermissionCache.h @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2009 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 BINDER_PERMISSION_H +#define BINDER_PERMISSION_H + +#include +#include + +#include +#include +#include + +namespace android { +// --------------------------------------------------------------------------- + +/* + * PermissionCache caches permission checks for a given uid. + * + * Currently the cache is not updated when there is a permission change, + * for instance when an application is uninstalled. + * + * IMPORTANT: for the reason stated above, only system permissions are safe + * to cache. This restriction may be lifted at a later time. + * + */ + +class PermissionCache : Singleton { + struct Entry { + String16 name; + uid_t uid; + bool granted; + inline bool operator < (const Entry& e) const { + return (uid == e.uid) ? (name < e.name) : (uid < e.uid); + } + }; + mutable Mutex mLock; + // we pool all the permission names we see, as many permissions checks + // will have identical names + SortedVector< String16 > mPermissionNamesPool; + // this is our cache per say. it stores pooled names. + SortedVector< Entry > mCache; + + // free the whole cache, but keep the permission name pool + void purge(); + + status_t check(bool* granted, + const String16& permission, uid_t uid) const; + + void cache(const String16& permission, uid_t uid, bool granted); + +public: + PermissionCache(); + + static bool checkCallingPermission(const String16& permission); + + static bool checkCallingPermission(const String16& permission, + int32_t* outPid, int32_t* outUid); + + static bool checkPermission(const String16& permission, + pid_t pid, uid_t uid); +}; + +// --------------------------------------------------------------------------- +}; // namespace android + +#endif /* BINDER_PERMISSION_H */ diff --git a/third_party/android_frameworks_native/include/binder/ProcessInfoService.h b/third_party/android_frameworks_native/include/binder/ProcessInfoService.h new file mode 100644 index 000000000..c5ead2067 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/ProcessInfoService.h @@ -0,0 +1,65 @@ +/* + * Copyright 2015 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_PROCESS_INFO_SERVICE_H +#define ANDROID_PROCESS_INFO_SERVICE_H + +#include +#include +#include +#include + +namespace android { + +// ---------------------------------------------------------------------- + +class ProcessInfoService : public Singleton { + + friend class Singleton; + sp mProcessInfoService; + Mutex mProcessInfoLock; + + ProcessInfoService(); + + status_t getProcessStatesImpl(size_t length, /*in*/ int32_t* pids, /*out*/ int32_t* states); + void updateBinderLocked(); + + static const int BINDER_ATTEMPT_LIMIT = 5; + +public: + + /** + * For each PID in the given "pids" input array, write the current process state + * for that process into the "states" output array, or + * ActivityManager.PROCESS_STATE_NONEXISTENT * to indicate that no process with the given PID + * exists. + * + * Returns NO_ERROR if this operation was successful, or a negative error code otherwise. + */ + static status_t getProcessStatesFromPids(size_t length, /*in*/ int32_t* pids, + /*out*/ int32_t* states) { + return ProcessInfoService::getInstance().getProcessStatesImpl(length, /*in*/ pids, + /*out*/ states); + } + +}; + +// ---------------------------------------------------------------------- + +}; // namespace android + +#endif // ANDROID_PROCESS_INFO_SERVICE_H + diff --git a/third_party/android_frameworks_native/include/binder/ProcessState.h b/third_party/android_frameworks_native/include/binder/ProcessState.h new file mode 100644 index 000000000..f9edc2a69 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/ProcessState.h @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2005 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_PROCESS_STATE_H +#define ANDROID_PROCESS_STATE_H + +#include +#include +#include +#include + +#include + +#include + +// --------------------------------------------------------------------------- +namespace android { + +class IPCThreadState; + +class ProcessState : public virtual RefBase +{ +public: + static sp self(); + + void setContextObject(const sp& object); + sp getContextObject(const sp& caller); + + void setContextObject(const sp& object, + const String16& name); + sp getContextObject(const String16& name, + const sp& caller); + + void startThreadPool(); + + typedef bool (*context_check_func)(const String16& name, + const sp& caller, + void* userData); + + bool isContextManager(void) const; + bool becomeContextManager( + context_check_func checkFunc, + void* userData); + + sp getStrongProxyForHandle(int32_t handle); + wp getWeakProxyForHandle(int32_t handle); + void expungeHandle(int32_t handle, IBinder* binder); + + void spawnPooledThread(bool isMain); + + status_t setThreadPoolMaxThreadCount(size_t maxThreads); + void giveThreadPoolName(); + +private: + friend class IPCThreadState; + + ProcessState(); + ~ProcessState(); + + ProcessState(const ProcessState& o); + ProcessState& operator=(const ProcessState& o); + String8 makeBinderThreadName(); + + struct handle_entry { + IBinder* binder; + RefBase::weakref_type* refs; + }; + + handle_entry* lookupHandleLocked(int32_t handle); + + int mDriverFD; + void* mVMStart; + + // Protects thread count variable below. + pthread_mutex_t mThreadCountLock; + pthread_cond_t mThreadCountDecrement; + // Number of binder threads current executing a command. + size_t mExecutingThreadsCount; + // Maximum number for binder threads allowed for this process. + size_t mMaxThreads; + + mutable Mutex mLock; // protects everything below. + + VectormHandleToObject; + + bool mManagesContexts; + context_check_func mBinderContextCheckFunc; + void* mBinderContextUserData; + + KeyedVector > + mContexts; + + + String8 mRootDir; + bool mThreadPoolStarted; + volatile int32_t mThreadPoolSeq; +}; + +}; // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_PROCESS_STATE_H diff --git a/third_party/android_frameworks_native/include/binder/TextOutput.h b/third_party/android_frameworks_native/include/binder/TextOutput.h new file mode 100644 index 000000000..974a194d8 --- /dev/null +++ b/third_party/android_frameworks_native/include/binder/TextOutput.h @@ -0,0 +1,195 @@ +/* + * Copyright (C) 2006 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_TEXTOUTPUT_H +#define ANDROID_TEXTOUTPUT_H + +#include + +#include +#include + +// --------------------------------------------------------------------------- +namespace android { + +class String8; +class String16; + +class TextOutput +{ +public: + TextOutput(); + virtual ~TextOutput(); + + virtual status_t print(const char* txt, size_t len) = 0; + virtual void moveIndent(int delta) = 0; + + class Bundle { + public: + inline Bundle(TextOutput& to) : mTO(to) { to.pushBundle(); } + inline ~Bundle() { mTO.popBundle(); } + private: + TextOutput& mTO; + }; + + virtual void pushBundle() = 0; + virtual void popBundle() = 0; +}; + +// --------------------------------------------------------------------------- + +// Text output stream for printing to the log (via utils/Log.h). +extern TextOutput& alog; + +// Text output stream for printing to stdout. +extern TextOutput& aout; + +// Text output stream for printing to stderr. +extern TextOutput& aerr; + +typedef TextOutput& (*TextOutputManipFunc)(TextOutput&); + +TextOutput& endl(TextOutput& to); +TextOutput& indent(TextOutput& to); +TextOutput& dedent(TextOutput& to); + +TextOutput& operator<<(TextOutput& to, const char* str); +TextOutput& operator<<(TextOutput& to, char); // writes raw character +TextOutput& operator<<(TextOutput& to, bool); +TextOutput& operator<<(TextOutput& to, int); +TextOutput& operator<<(TextOutput& to, long); +TextOutput& operator<<(TextOutput& to, unsigned int); +TextOutput& operator<<(TextOutput& to, unsigned long); +TextOutput& operator<<(TextOutput& to, long long); +TextOutput& operator<<(TextOutput& to, unsigned long long); +TextOutput& operator<<(TextOutput& to, float); +TextOutput& operator<<(TextOutput& to, double); +TextOutput& operator<<(TextOutput& to, TextOutputManipFunc func); +TextOutput& operator<<(TextOutput& to, const void*); +TextOutput& operator<<(TextOutput& to, const String8& val); +TextOutput& operator<<(TextOutput& to, const String16& val); + +class TypeCode +{ +public: + inline TypeCode(uint32_t code); + inline ~TypeCode(); + + inline uint32_t typeCode() const; + +private: + uint32_t mCode; +}; + +TextOutput& operator<<(TextOutput& to, const TypeCode& val); + +class HexDump +{ +public: + HexDump(const void *buf, size_t size, size_t bytesPerLine=16); + inline ~HexDump(); + + inline HexDump& setBytesPerLine(size_t bytesPerLine); + inline HexDump& setSingleLineCutoff(int32_t bytes); + inline HexDump& setAlignment(size_t alignment); + inline HexDump& setCArrayStyle(bool enabled); + + inline const void* buffer() const; + inline size_t size() const; + inline size_t bytesPerLine() const; + inline int32_t singleLineCutoff() const; + inline size_t alignment() const; + inline bool carrayStyle() const; + +private: + const void* mBuffer; + size_t mSize; + size_t mBytesPerLine; + int32_t mSingleLineCutoff; + size_t mAlignment; + bool mCArrayStyle; +}; + +TextOutput& operator<<(TextOutput& to, const HexDump& val); + +// --------------------------------------------------------------------------- +// No user servicable parts below. + +inline TextOutput& endl(TextOutput& to) +{ + to.print("\n", 1); + return to; +} + +inline TextOutput& indent(TextOutput& to) +{ + to.moveIndent(1); + return to; +} + +inline TextOutput& dedent(TextOutput& to) +{ + to.moveIndent(-1); + return to; +} + +inline TextOutput& operator<<(TextOutput& to, const char* str) +{ + to.print(str, strlen(str)); + return to; +} + +inline TextOutput& operator<<(TextOutput& to, char c) +{ + to.print(&c, 1); + return to; +} + +inline TextOutput& operator<<(TextOutput& to, TextOutputManipFunc func) +{ + return (*func)(to); +} + +inline TypeCode::TypeCode(uint32_t code) : mCode(code) { } +inline TypeCode::~TypeCode() { } +inline uint32_t TypeCode::typeCode() const { return mCode; } + +inline HexDump::~HexDump() { } + +inline HexDump& HexDump::setBytesPerLine(size_t bytesPerLine) { + mBytesPerLine = bytesPerLine; return *this; +} +inline HexDump& HexDump::setSingleLineCutoff(int32_t bytes) { + mSingleLineCutoff = bytes; return *this; +} +inline HexDump& HexDump::setAlignment(size_t alignment) { + mAlignment = alignment; return *this; +} +inline HexDump& HexDump::setCArrayStyle(bool enabled) { + mCArrayStyle = enabled; return *this; +} + +inline const void* HexDump::buffer() const { return mBuffer; } +inline size_t HexDump::size() const { return mSize; } +inline size_t HexDump::bytesPerLine() const { return mBytesPerLine; } +inline int32_t HexDump::singleLineCutoff() const { return mSingleLineCutoff; } +inline size_t HexDump::alignment() const { return mAlignment; } +inline bool HexDump::carrayStyle() const { return mCArrayStyle; } + +// --------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_TEXTOUTPUT_H diff --git a/third_party/android_frameworks_native/include/gui/BitTube.h b/third_party/android_frameworks_native/include/gui/BitTube.h new file mode 100644 index 000000000..3ecac52ad --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/BitTube.h @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2010 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_GUI_SENSOR_CHANNEL_H +#define ANDROID_GUI_SENSOR_CHANNEL_H + +#include +#include + +#include +#include +#include + + +namespace android { +// ---------------------------------------------------------------------------- +class Parcel; + +class BitTube : public RefBase +{ +public: + + // creates a BitTube with a default (4KB) send buffer + BitTube(); + + // creates a BitTube with a a specified send and receive buffer size + explicit BitTube(size_t bufsize); + + explicit BitTube(const Parcel& data); + virtual ~BitTube(); + + // check state after construction + status_t initCheck() const; + + // get receive file-descriptor + int getFd() const; + + // get the send file-descriptor. + int getSendFd() const; + + // send objects (sized blobs). All objects are guaranteed to be written or the call fails. + template + static ssize_t sendObjects(const sp& tube, + T const* events, size_t count) { + return sendObjects(tube, events, count, sizeof(T)); + } + + // receive objects (sized blobs). If the receiving buffer isn't large enough, + // excess messages are silently discarded. + template + static ssize_t recvObjects(const sp& tube, + T* events, size_t count) { + return recvObjects(tube, events, count, sizeof(T)); + } + + // parcels this BitTube + status_t writeToParcel(Parcel* reply) const; + +private: + void init(size_t rcvbuf, size_t sndbuf); + + // send a message. The write is guaranteed to send the whole message or fail. + ssize_t write(void const* vaddr, size_t size); + + // receive a message. the passed buffer must be at least as large as the + // write call used to send the message, excess data is silently discarded. + ssize_t read(void* vaddr, size_t size); + + int mSendFd; + mutable int mReceiveFd; + + static ssize_t sendObjects(const sp& tube, + void const* events, size_t count, size_t objSize); + + static ssize_t recvObjects(const sp& tube, + void* events, size_t count, size_t objSize); +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_SENSOR_CHANNEL_H diff --git a/third_party/android_frameworks_native/include/gui/BufferItem.h b/third_party/android_frameworks_native/include/gui/BufferItem.h new file mode 100644 index 000000000..145efe6f6 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/BufferItem.h @@ -0,0 +1,130 @@ +/* + * Copyright 2014 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_GUI_BUFFERITEM_H +#define ANDROID_GUI_BUFFERITEM_H + +#include +#include + +#include +#include + +#include + +#include +#include + +namespace android { + +class Fence; +class GraphicBuffer; + +class BufferItem : public Flattenable { + friend class Flattenable; + size_t getPodSize() const; + size_t getFlattenedSize() const; + size_t getFdCount() const; + status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const; + status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count); + + public: + // The default value of mBuf, used to indicate this doesn't correspond to a slot. + enum { INVALID_BUFFER_SLOT = -1 }; + BufferItem(); + ~BufferItem(); + + static const char* scalingModeName(uint32_t scalingMode); + + // mGraphicBuffer points to the buffer allocated for this slot, or is NULL + // if the buffer in this slot has been acquired in the past (see + // BufferSlot.mAcquireCalled). + sp mGraphicBuffer; + + // mFence is a fence that will signal when the buffer is idle. + sp mFence; + + // mCrop is the current crop rectangle for this buffer slot. + Rect mCrop; + + // mTransform is the current transform flags for this buffer slot. + // refer to NATIVE_WINDOW_TRANSFORM_* in + uint32_t mTransform; + + // mScalingMode is the current scaling mode for this buffer slot. + // refer to NATIVE_WINDOW_SCALING_* in + uint32_t mScalingMode; + + // mTimestamp is the current timestamp for this buffer slot. This gets + // to set by queueBuffer each time this slot is queued. This value + // is guaranteed to be monotonically increasing for each newly + // acquired buffer. + union { + int64_t mTimestamp; + struct { + uint32_t mTimestampLo; + uint32_t mTimestampHi; + }; + }; + + // mIsAutoTimestamp indicates whether mTimestamp was generated + // automatically when the buffer was queued. + bool mIsAutoTimestamp; + + // mDataSpace is the current dataSpace value for this buffer slot. This gets + // set by queueBuffer each time this slot is queued. The meaning of the + // dataSpace is format-dependent. + android_dataspace mDataSpace; + + // mFrameNumber is the number of the queued frame for this slot. + union { + uint64_t mFrameNumber; + struct { + uint32_t mFrameNumberLo; + uint32_t mFrameNumberHi; + }; + }; + + union { + // mSlot is the slot index of this buffer (default INVALID_BUFFER_SLOT). + int mSlot; + + // mBuf is the former name for mSlot + int mBuf; + }; + + // mIsDroppable whether this buffer was queued with the + // property that it can be replaced by a new buffer for the purpose of + // making sure dequeueBuffer() won't block. + // i.e.: was the BufferQueue in "mDequeueBufferCannotBlock" when this buffer + // was queued. + bool mIsDroppable; + + // Indicates whether this buffer has been seen by a consumer yet + bool mAcquireCalled; + + // Indicates this buffer must be transformed by the inverse transform of the screen + // it is displayed onto. This is applied after mTransform. + bool mTransformToDisplayInverse; + + // Describes the portion of the surface that has been modified since the + // previous frame + Region mSurfaceDamage; +}; + +} // namespace android + +#endif diff --git a/third_party/android_frameworks_native/include/gui/BufferItemConsumer.h b/third_party/android_frameworks_native/include/gui/BufferItemConsumer.h new file mode 100644 index 000000000..56c7a3f46 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/BufferItemConsumer.h @@ -0,0 +1,93 @@ +/* + * 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_GUI_BUFFERITEMCONSUMER_H +#define ANDROID_GUI_BUFFERITEMCONSUMER_H + +#include + +#include + +#include +#include +#include + +#define ANDROID_GRAPHICS_BUFFERITEMCONSUMER_JNI_ID "mBufferItemConsumer" + +namespace android { + +class BufferQueue; + +/** + * BufferItemConsumer is a BufferQueue consumer endpoint that allows clients + * access to the whole BufferItem entry from BufferQueue. Multiple buffers may + * be acquired at once, to be used concurrently by the client. This consumer can + * operate either in synchronous or asynchronous mode. + */ +class BufferItemConsumer: public ConsumerBase +{ + public: + typedef ConsumerBase::FrameAvailableListener FrameAvailableListener; + + enum { DEFAULT_MAX_BUFFERS = -1 }; + enum { INVALID_BUFFER_SLOT = BufferQueue::INVALID_BUFFER_SLOT }; + enum { NO_BUFFER_AVAILABLE = BufferQueue::NO_BUFFER_AVAILABLE }; + + // Create a new buffer item consumer. The consumerUsage parameter determines + // the consumer usage flags passed to the graphics allocator. The + // bufferCount parameter specifies how many buffers can be locked for user + // access at the same time. + // controlledByApp tells whether this consumer is controlled by the + // application. + BufferItemConsumer(const sp& consumer, + uint32_t consumerUsage, int bufferCount = DEFAULT_MAX_BUFFERS, + bool controlledByApp = false); + + virtual ~BufferItemConsumer(); + + // set the name of the BufferItemConsumer that will be used to identify it in + // log messages. + void setName(const String8& name); + + // Gets the next graphics buffer from the producer, filling out the + // passed-in BufferItem structure. Returns NO_BUFFER_AVAILABLE if the queue + // of buffers is empty, and INVALID_OPERATION if the maximum number of + // buffers is already acquired. + // + // Only a fixed number of buffers can be acquired at a time, determined by + // the construction-time bufferCount parameter. If INVALID_OPERATION is + // returned by acquireBuffer, then old buffers must be returned to the + // queue by calling releaseBuffer before more buffers can be acquired. + // + // If waitForFence is true, and the acquired BufferItem has a valid fence object, + // acquireBuffer will wait on the fence with no timeout before returning. + status_t acquireBuffer(BufferItem* item, nsecs_t presentWhen, + bool waitForFence = true); + + // Returns an acquired buffer to the queue, allowing it to be reused. Since + // only a fixed number of buffers may be acquired at a time, old buffers + // must be released by calling releaseBuffer to ensure new buffers can be + // acquired by acquireBuffer. Once a BufferItem is released, the caller must + // not access any members of the BufferItem, and should immediately remove + // all of its references to the BufferItem itself. + status_t releaseBuffer(const BufferItem &item, + const sp& releaseFence = Fence::NO_FENCE); + +}; + +} // namespace android + +#endif // ANDROID_GUI_CPUCONSUMER_H diff --git a/third_party/android_frameworks_native/include/gui/BufferQueue.h b/third_party/android_frameworks_native/include/gui/BufferQueue.h new file mode 100644 index 000000000..09300a20c --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/BufferQueue.h @@ -0,0 +1,89 @@ +/* + * 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_GUI_BUFFERQUEUE_H +#define ANDROID_GUI_BUFFERQUEUE_H + +#include +#include +#include +#include +#include + +// These are only required to keep other parts of the framework with incomplete +// dependencies building successfully +#include + +namespace android { + +class BufferQueue { +public: + // BufferQueue will keep track of at most this value of buffers. + // Attempts at runtime to increase the number of buffers past this will fail. + enum { NUM_BUFFER_SLOTS = BufferQueueDefs::NUM_BUFFER_SLOTS }; + // Used as a placeholder slot# when the value isn't pointing to an existing buffer. + enum { INVALID_BUFFER_SLOT = BufferItem::INVALID_BUFFER_SLOT }; + // Alias to -- please scope from there in future code! + enum { + NO_BUFFER_AVAILABLE = IGraphicBufferConsumer::NO_BUFFER_AVAILABLE, + PRESENT_LATER = IGraphicBufferConsumer::PRESENT_LATER, + }; + + // When in async mode we reserve two slots in order to guarantee that the + // producer and consumer can run asynchronously. + enum { MAX_MAX_ACQUIRED_BUFFERS = NUM_BUFFER_SLOTS - 2 }; + + // for backward source compatibility + typedef ::android::ConsumerListener ConsumerListener; + + // ProxyConsumerListener is a ConsumerListener implementation that keeps a weak + // reference to the actual consumer object. It forwards all calls to that + // consumer object so long as it exists. + // + // This class exists to avoid having a circular reference between the + // BufferQueue object and the consumer object. The reason this can't be a weak + // reference in the BufferQueue class is because we're planning to expose the + // consumer side of a BufferQueue as a binder interface, which doesn't support + // weak references. + class ProxyConsumerListener : public BnConsumerListener { + public: + ProxyConsumerListener(const wp& consumerListener); + virtual ~ProxyConsumerListener(); + virtual void onFrameAvailable(const BufferItem& item) override; + virtual void onFrameReplaced(const BufferItem& item) override; + virtual void onBuffersReleased() override; + virtual void onSidebandStreamChanged() override; + private: + // mConsumerListener is a weak reference to the IConsumerListener. This is + // the raison d'etre of ProxyConsumerListener. + wp mConsumerListener; + }; + + // BufferQueue manages a pool of gralloc memory slots to be used by + // producers and consumers. allocator is used to allocate all the + // needed gralloc buffers. + static void createBufferQueue(sp* outProducer, + sp* outConsumer, + const sp& allocator = NULL); + +private: + BufferQueue(); // Create through createBufferQueue +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_BUFFERQUEUE_H diff --git a/third_party/android_frameworks_native/include/gui/BufferQueueConsumer.h b/third_party/android_frameworks_native/include/gui/BufferQueueConsumer.h new file mode 100644 index 000000000..cde302f8a --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/BufferQueueConsumer.h @@ -0,0 +1,187 @@ +/* + * Copyright 2014 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_GUI_BUFFERQUEUECONSUMER_H +#define ANDROID_GUI_BUFFERQUEUECONSUMER_H + +#include +#include + +#include +#include + +namespace android { + +class BufferQueueCore; + +class BufferQueueConsumer : public BnGraphicBufferConsumer { + +public: + BufferQueueConsumer(const sp& core); + virtual ~BufferQueueConsumer(); + + // acquireBuffer attempts to acquire ownership of the next pending buffer in + // the BufferQueue. If no buffer is pending then it returns + // NO_BUFFER_AVAILABLE. If a buffer is successfully acquired, the + // information about the buffer is returned in BufferItem. If the buffer + // returned had previously been acquired then the BufferItem::mGraphicBuffer + // field of buffer is set to NULL and it is assumed that the consumer still + // holds a reference to the buffer. + // + // If expectedPresent is nonzero, it indicates the time when the buffer + // will be displayed on screen. If the buffer's timestamp is farther in the + // future, the buffer won't be acquired, and PRESENT_LATER will be + // returned. The presentation time is in nanoseconds, and the time base + // is CLOCK_MONOTONIC. + virtual status_t acquireBuffer(BufferItem* outBuffer, + nsecs_t expectedPresent, uint64_t maxFrameNumber = 0) override; + + // See IGraphicBufferConsumer::detachBuffer + virtual status_t detachBuffer(int slot); + + // See IGraphicBufferConsumer::attachBuffer + virtual status_t attachBuffer(int* slot, const sp& buffer); + + // releaseBuffer releases a buffer slot from the consumer back to the + // BufferQueue. This may be done while the buffer's contents are still + // being accessed. The fence will signal when the buffer is no longer + // in use. frameNumber is used to indentify the exact buffer returned. + // + // If releaseBuffer returns STALE_BUFFER_SLOT, then the consumer must free + // any references to the just-released buffer that it might have, as if it + // had received a onBuffersReleased() call with a mask set for the released + // buffer. + // + // Note that the dependencies on EGL will be removed once we switch to using + // the Android HW Sync HAL. + virtual status_t releaseBuffer(int slot, uint64_t frameNumber, + const sp& releaseFence, EGLDisplay display, + EGLSyncKHR fence); + + // connect connects a consumer to the BufferQueue. Only one + // consumer may be connected, and when that consumer disconnects the + // BufferQueue is placed into the "abandoned" state, causing most + // interactions with the BufferQueue by the producer to fail. + // controlledByApp indicates whether the consumer is controlled by + // the application. + // + // consumerListener may not be NULL. + virtual status_t connect(const sp& consumerListener, + bool controlledByApp); + + // disconnect disconnects a consumer from the BufferQueue. All + // buffers will be freed and the BufferQueue is placed in the "abandoned" + // state, causing most interactions with the BufferQueue by the producer to + // fail. + virtual status_t disconnect(); + + // getReleasedBuffers sets the value pointed to by outSlotMask to a bit mask + // indicating which buffer slots have been released by the BufferQueue + // but have not yet been released by the consumer. + // + // This should be called from the onBuffersReleased() callback. + virtual status_t getReleasedBuffers(uint64_t* outSlotMask); + + // setDefaultBufferSize is used to set the size of buffers returned by + // dequeueBuffer when a width and height of zero is requested. Default + // is 1x1. + virtual status_t setDefaultBufferSize(uint32_t width, uint32_t height); + + // setDefaultMaxBufferCount sets the default value for the maximum buffer + // count (the initial default is 2). If the producer has requested a + // buffer count using setBufferCount, the default buffer count will only + // take effect if the producer sets the count back to zero. + // + // The count must be between 2 and NUM_BUFFER_SLOTS, inclusive. + virtual status_t setDefaultMaxBufferCount(int bufferCount); + + // disableAsyncBuffer disables the extra buffer used in async mode + // (when both producer and consumer have set their "isControlledByApp" + // flag) and has dequeueBuffer() return WOULD_BLOCK instead. + // + // This can only be called before connect(). + virtual status_t disableAsyncBuffer(); + + // setMaxAcquiredBufferCount sets the maximum number of buffers that can + // be acquired by the consumer at one time (default 1). This call will + // fail if a producer is connected to the BufferQueue. + virtual status_t setMaxAcquiredBufferCount(int maxAcquiredBuffers); + + // setConsumerName sets the name used in logging + virtual void setConsumerName(const String8& name); + + // setDefaultBufferFormat allows the BufferQueue to create + // GraphicBuffers of a defaultFormat if no format is specified + // in dequeueBuffer. The initial default is HAL_PIXEL_FORMAT_RGBA_8888. + virtual status_t setDefaultBufferFormat(PixelFormat defaultFormat); + + // setDefaultBufferDataSpace allows the BufferQueue to create + // GraphicBuffers of a defaultDataSpace if no data space is specified + // in queueBuffer. + // The initial default is HAL_DATASPACE_UNKNOWN + virtual status_t setDefaultBufferDataSpace( + android_dataspace defaultDataSpace); + + // setConsumerUsageBits will turn on additional usage bits for dequeueBuffer. + // These are merged with the bits passed to dequeueBuffer. The values are + // enumerated in gralloc.h, e.g. GRALLOC_USAGE_HW_RENDER; the default is 0. + virtual status_t setConsumerUsageBits(uint32_t usage); + + // setTransformHint bakes in rotation to buffers so overlays can be used. + // The values are enumerated in window.h, e.g. + // NATIVE_WINDOW_TRANSFORM_ROT_90. The default is 0 (no transform). + virtual status_t setTransformHint(uint32_t hint); + + // Retrieve the sideband buffer stream, if any. + virtual sp getSidebandStream() const; + + // dump our state in a String + virtual void dump(String8& result, const char* prefix) const; + + // Functions required for backwards compatibility. + // These will be modified/renamed in IGraphicBufferConsumer and will be + // removed from this class at that time. See b/13306289. + + virtual status_t releaseBuffer(int buf, uint64_t frameNumber, + EGLDisplay display, EGLSyncKHR fence, + const sp& releaseFence) { + return releaseBuffer(buf, frameNumber, releaseFence, display, fence); + } + + virtual status_t consumerConnect(const sp& consumer, + bool controlledByApp) { + return connect(consumer, controlledByApp); + } + + virtual status_t consumerDisconnect() { return disconnect(); } + + // End functions required for backwards compatibility + +private: + sp mCore; + + // This references mCore->mSlots. Lock mCore->mMutex while accessing. + BufferQueueDefs::SlotsType& mSlots; + + // This is a cached copy of the name stored in the BufferQueueCore. + // It's updated during setConsumerName. + String8 mConsumerName; + +}; // class BufferQueueConsumer + +} // namespace android + +#endif diff --git a/third_party/android_frameworks_native/include/gui/BufferQueueCore.h b/third_party/android_frameworks_native/include/gui/BufferQueueCore.h new file mode 100644 index 000000000..99134ea50 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/BufferQueueCore.h @@ -0,0 +1,287 @@ +/* + * Copyright 2014 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_GUI_BUFFERQUEUECORE_H +#define ANDROID_GUI_BUFFERQUEUECORE_H + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define BQ_LOGV(x, ...) ALOGV("[%s] " x, mConsumerName.string(), ##__VA_ARGS__) +#define BQ_LOGD(x, ...) ALOGD("[%s] " x, mConsumerName.string(), ##__VA_ARGS__) +#define BQ_LOGI(x, ...) ALOGI("[%s] " x, mConsumerName.string(), ##__VA_ARGS__) +#define BQ_LOGW(x, ...) ALOGW("[%s] " x, mConsumerName.string(), ##__VA_ARGS__) +#define BQ_LOGE(x, ...) ALOGE("[%s] " x, mConsumerName.string(), ##__VA_ARGS__) + +#define ATRACE_BUFFER_INDEX(index) \ + if (ATRACE_ENABLED()) { \ + char ___traceBuf[1024]; \ + snprintf(___traceBuf, 1024, "%s: %d", \ + mCore->mConsumerName.string(), (index)); \ + android::ScopedTrace ___bufTracer(ATRACE_TAG, ___traceBuf); \ + } + +namespace android { + +class IConsumerListener; +class IGraphicBufferAlloc; +class IProducerListener; + +class BufferQueueCore : public virtual RefBase { + + friend class BufferQueueProducer; + friend class BufferQueueConsumer; + +public: + // Used as a placeholder slot number when the value isn't pointing to an + // existing buffer. + enum { INVALID_BUFFER_SLOT = BufferItem::INVALID_BUFFER_SLOT }; + + // We reserve two slots in order to guarantee that the producer and + // consumer can run asynchronously. + enum { MAX_MAX_ACQUIRED_BUFFERS = BufferQueueDefs::NUM_BUFFER_SLOTS - 2 }; + + // The default API number used to indicate that no producer is connected + enum { NO_CONNECTED_API = 0 }; + + typedef Vector Fifo; + + // BufferQueueCore manages a pool of gralloc memory slots to be used by + // producers and consumers. allocator is used to allocate all the needed + // gralloc buffers. + BufferQueueCore(const sp& allocator = NULL); + virtual ~BufferQueueCore(); + +private: + // Dump our state in a string + void dump(String8& result, const char* prefix) const; + + // getMinUndequeuedBufferCountLocked returns the minimum number of buffers + // that must remain in a state other than DEQUEUED. The async parameter + // tells whether we're in asynchronous mode. + int getMinUndequeuedBufferCountLocked(bool async) const; + + // getMinMaxBufferCountLocked returns the minimum number of buffers allowed + // given the current BufferQueue state. The async parameter tells whether + // we're in asynchonous mode. + int getMinMaxBufferCountLocked(bool async) const; + + // getMaxBufferCountLocked returns the maximum number of buffers that can be + // allocated at once. This value depends on the following member variables: + // + // mDequeueBufferCannotBlock + // mMaxAcquiredBufferCount + // mDefaultMaxBufferCount + // mOverrideMaxBufferCount + // async parameter + // + // Any time one of these member variables is changed while a producer is + // connected, mDequeueCondition must be broadcast. + int getMaxBufferCountLocked(bool async) const; + + // setDefaultMaxBufferCountLocked sets the maximum number of buffer slots + // that will be used if the producer does not override the buffer slot + // count. The count must be between 2 and NUM_BUFFER_SLOTS, inclusive. The + // initial default is 2. + status_t setDefaultMaxBufferCountLocked(int count); + + // freeBufferLocked frees the GraphicBuffer and sync resources for the + // given slot. + void freeBufferLocked(int slot); + + // freeAllBuffersLocked frees the GraphicBuffer and sync resources for + // all slots. + void freeAllBuffersLocked(); + + // stillTracking returns true iff the buffer item is still being tracked + // in one of the slots. + bool stillTracking(const BufferItem* item) const; + + // waitWhileAllocatingLocked blocks until mIsAllocating is false. + void waitWhileAllocatingLocked() const; + + // validateConsistencyLocked ensures that the free lists are in sync with + // the information stored in mSlots + void validateConsistencyLocked() const; + + // mAllocator is the connection to SurfaceFlinger that is used to allocate + // new GraphicBuffer objects. + sp mAllocator; + + // mMutex is the mutex used to prevent concurrent access to the member + // variables of BufferQueueCore objects. It must be locked whenever any + // member variable is accessed. + mutable Mutex mMutex; + + // mIsAbandoned indicates that the BufferQueue will no longer be used to + // consume image buffers pushed to it using the IGraphicBufferProducer + // interface. It is initialized to false, and set to true in the + // consumerDisconnect method. A BufferQueue that is abandoned will return + // the NO_INIT error from all IGraphicBufferProducer methods capable of + // returning an error. + bool mIsAbandoned; + + // mConsumerControlledByApp indicates whether the connected consumer is + // controlled by the application. + bool mConsumerControlledByApp; + + // mConsumerName is a string used to identify the BufferQueue in log + // messages. It is set by the IGraphicBufferConsumer::setConsumerName + // method. + String8 mConsumerName; + + // mConsumerListener is used to notify the connected consumer of + // asynchronous events that it may wish to react to. It is initially + // set to NULL and is written by consumerConnect and consumerDisconnect. + sp mConsumerListener; + + // mConsumerUsageBits contains flags that the consumer wants for + // GraphicBuffers. + uint32_t mConsumerUsageBits; + + // mConnectedApi indicates the producer API that is currently connected + // to this BufferQueue. It defaults to NO_CONNECTED_API, and gets updated + // by the connect and disconnect methods. + int mConnectedApi; + + // mConnectedProducerToken is used to set a binder death notification on + // the producer. + sp mConnectedProducerListener; + + // mSlots is an array of buffer slots that must be mirrored on the producer + // side. This allows buffer ownership to be transferred between the producer + // and consumer without sending a GraphicBuffer over Binder. The entire + // array is initialized to NULL at construction time, and buffers are + // allocated for a slot when requestBuffer is called with that slot's index. + BufferQueueDefs::SlotsType mSlots; + + // mQueue is a FIFO of queued buffers used in synchronous mode. + Fifo mQueue; + + // mFreeSlots contains all of the slots which are FREE and do not currently + // have a buffer attached + std::set mFreeSlots; + + // mFreeBuffers contains all of the slots which are FREE and currently have + // a buffer attached + std::list mFreeBuffers; + + // mOverrideMaxBufferCount is the limit on the number of buffers that will + // be allocated at one time. This value is set by the producer by calling + // setBufferCount. The default is 0, which means that the producer doesn't + // care about the number of buffers in the pool. In that case, + // mDefaultMaxBufferCount is used as the limit. + int mOverrideMaxBufferCount; + + // mDequeueCondition is a condition variable used for dequeueBuffer in + // synchronous mode. + mutable Condition mDequeueCondition; + + // mUseAsyncBuffer indicates whether an extra buffer is used in async mode + // to prevent dequeueBuffer from blocking. + bool mUseAsyncBuffer; + + // mDequeueBufferCannotBlock indicates whether dequeueBuffer is allowed to + // block. This flag is set during connect when both the producer and + // consumer are controlled by the application. + bool mDequeueBufferCannotBlock; + + // mDefaultBufferFormat can be set so it will override the buffer format + // when it isn't specified in dequeueBuffer. + PixelFormat mDefaultBufferFormat; + + // mDefaultWidth holds the default width of allocated buffers. It is used + // in dequeueBuffer if a width and height of 0 are specified. + uint32_t mDefaultWidth; + + // mDefaultHeight holds the default height of allocated buffers. It is used + // in dequeueBuffer if a width and height of 0 are specified. + uint32_t mDefaultHeight; + + // mDefaultBufferDataSpace holds the default dataSpace of queued buffers. + // It is used in queueBuffer if a dataspace of 0 (HAL_DATASPACE_UNKNOWN) + // is specified. + android_dataspace mDefaultBufferDataSpace; + + // mDefaultMaxBufferCount is the default limit on the number of buffers that + // will be allocated at one time. This default limit is set by the consumer. + // The limit (as opposed to the default limit) may be overriden by the + // producer. + int mDefaultMaxBufferCount; + + // mMaxAcquiredBufferCount is the number of buffers that the consumer may + // acquire at one time. It defaults to 1, and can be changed by the consumer + // via setMaxAcquiredBufferCount, but this may only be done while no + // producer is connected to the BufferQueue. This value is used to derive + // the value returned for the MIN_UNDEQUEUED_BUFFERS query to the producer. + int mMaxAcquiredBufferCount; + + // mBufferHasBeenQueued is true once a buffer has been queued. It is reset + // when something causes all buffers to be freed (e.g., changing the buffer + // count). + bool mBufferHasBeenQueued; + + // mFrameCounter is the free running counter, incremented on every + // successful queueBuffer call and buffer allocation. + uint64_t mFrameCounter; + + // mTransformHint is used to optimize for screen rotations. + uint32_t mTransformHint; + + // mSidebandStream is a handle to the sideband buffer stream, if any + sp mSidebandStream; + + // mIsAllocating indicates whether a producer is currently trying to allocate buffers (which + // releases mMutex while doing the allocation proper). Producers should not modify any of the + // FREE slots while this is true. mIsAllocatingCondition is signaled when this value changes to + // false. + bool mIsAllocating; + + // mIsAllocatingCondition is a condition variable used by producers to wait until mIsAllocating + // becomes false. + mutable Condition mIsAllocatingCondition; + + // mAllowAllocation determines whether dequeueBuffer is allowed to allocate + // new buffers + bool mAllowAllocation; + + // mBufferAge tracks the age of the contents of the most recently dequeued + // buffer as the number of frames that have elapsed since it was last queued + uint64_t mBufferAge; + + // mGenerationNumber stores the current generation number of the attached + // producer. Any attempt to attach a buffer with a different generation + // number will fail. + uint32_t mGenerationNumber; + +}; // class BufferQueueCore + +} // namespace android + +#endif diff --git a/third_party/android_frameworks_native/include/gui/BufferQueueDefs.h b/third_party/android_frameworks_native/include/gui/BufferQueueDefs.h new file mode 100644 index 000000000..83e958003 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/BufferQueueDefs.h @@ -0,0 +1,35 @@ +/* + * Copyright 2014 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_GUI_BUFFERQUEUECOREDEFS_H +#define ANDROID_GUI_BUFFERQUEUECOREDEFS_H + +#include + +namespace android { + class BufferQueueCore; + + namespace BufferQueueDefs { + // BufferQueue will keep track of at most this value of buffers. + // Attempts at runtime to increase the number of buffers past this + // will fail. + enum { NUM_BUFFER_SLOTS = 64 }; + + typedef BufferSlot SlotsType[NUM_BUFFER_SLOTS]; + } // namespace BufferQueueDefs +} // namespace android + +#endif diff --git a/third_party/android_frameworks_native/include/gui/BufferQueueProducer.h b/third_party/android_frameworks_native/include/gui/BufferQueueProducer.h new file mode 100644 index 000000000..9754a89ea --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/BufferQueueProducer.h @@ -0,0 +1,228 @@ +/* + * Copyright 2014 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_GUI_BUFFERQUEUEPRODUCER_H +#define ANDROID_GUI_BUFFERQUEUEPRODUCER_H + +#include +#include + +namespace android { + +class BufferSlot; + +class BufferQueueProducer : public BnGraphicBufferProducer, + private IBinder::DeathRecipient { +public: + friend class BufferQueue; // Needed to access binderDied + + BufferQueueProducer(const sp& core); + virtual ~BufferQueueProducer(); + + // requestBuffer returns the GraphicBuffer for slot N. + // + // In normal operation, this is called the first time slot N is returned + // by dequeueBuffer. It must be called again if dequeueBuffer returns + // flags indicating that previously-returned buffers are no longer valid. + virtual status_t requestBuffer(int slot, sp* buf); + + // setBufferCount updates the number of available buffer slots. If this + // method succeeds, buffer slots will be both unallocated and owned by + // the BufferQueue object (i.e. they are not owned by the producer or + // consumer). + // + // This will fail if the producer has dequeued any buffers, or if + // bufferCount is invalid. bufferCount must generally be a value + // between the minimum undequeued buffer count (exclusive) and NUM_BUFFER_SLOTS + // (inclusive). It may also be set to zero (the default) to indicate + // that the producer does not wish to set a value. The minimum value + // can be obtained by calling query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, + // ...). + // + // This may only be called by the producer. The consumer will be told + // to discard buffers through the onBuffersReleased callback. + virtual status_t setBufferCount(int bufferCount); + + // dequeueBuffer gets the next buffer slot index for the producer to use. + // If a buffer slot is available then that slot index is written to the + // location pointed to by the buf argument and a status of OK is returned. + // If no slot is available then a status of -EBUSY is returned and buf is + // unmodified. + // + // The outFence parameter will be updated to hold the fence associated with + // the buffer. The contents of the buffer must not be overwritten until the + // fence signals. If the fence is Fence::NO_FENCE, the buffer may be + // written immediately. + // + // The width and height parameters must be no greater than the minimum of + // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv). + // An error due to invalid dimensions might not be reported until + // updateTexImage() is called. If width and height are both zero, the + // default values specified by setDefaultBufferSize() are used instead. + // + // If the format is 0, the default format will be used. + // + // The usage argument specifies gralloc buffer usage flags. The values + // are enumerated in gralloc.h, e.g. GRALLOC_USAGE_HW_RENDER. These + // will be merged with the usage flags specified by setConsumerUsageBits. + // + // The return value may be a negative error value or a non-negative + // collection of flags. If the flags are set, the return values are + // valid, but additional actions must be performed. + // + // If IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION is set, the + // producer must discard cached GraphicBuffer references for the slot + // returned in buf. + // If IGraphicBufferProducer::RELEASE_ALL_BUFFERS is set, the producer + // must discard cached GraphicBuffer references for all slots. + // + // In both cases, the producer will need to call requestBuffer to get a + // GraphicBuffer handle for the returned slot. + virtual status_t dequeueBuffer(int *outSlot, sp* outFence, + bool async, uint32_t width, uint32_t height, PixelFormat format, + uint32_t usage); + + // See IGraphicBufferProducer::detachBuffer + virtual status_t detachBuffer(int slot); + + // See IGraphicBufferProducer::detachNextBuffer + virtual status_t detachNextBuffer(sp* outBuffer, + sp* outFence); + + // See IGraphicBufferProducer::attachBuffer + virtual status_t attachBuffer(int* outSlot, const sp& buffer); + + // queueBuffer returns a filled buffer to the BufferQueue. + // + // Additional data is provided in the QueueBufferInput struct. Notably, + // a timestamp must be provided for the buffer. The timestamp is in + // nanoseconds, and must be monotonically increasing. Its other semantics + // (zero point, etc) are producer-specific and should be documented by the + // producer. + // + // The caller may provide a fence that signals when all rendering + // operations have completed. Alternatively, NO_FENCE may be used, + // indicating that the buffer is ready immediately. + // + // Some values are returned in the output struct: the current settings + // for default width and height, the current transform hint, and the + // number of queued buffers. + virtual status_t queueBuffer(int slot, + const QueueBufferInput& input, QueueBufferOutput* output); + + // cancelBuffer returns a dequeued buffer to the BufferQueue, but doesn't + // queue it for use by the consumer. + // + // The buffer will not be overwritten until the fence signals. The fence + // will usually be the one obtained from dequeueBuffer. + virtual void cancelBuffer(int slot, const sp& fence); + + // Query native window attributes. The "what" values are enumerated in + // window.h (e.g. NATIVE_WINDOW_FORMAT). + virtual int query(int what, int* outValue); + + // connect attempts to connect a producer API to the BufferQueue. This + // must be called before any other IGraphicBufferProducer methods are + // called except for getAllocator. A consumer must already be connected. + // + // This method will fail if connect was previously called on the + // BufferQueue and no corresponding disconnect call was made (i.e. if + // it's still connected to a producer). + // + // APIs are enumerated in window.h (e.g. NATIVE_WINDOW_API_CPU). + virtual status_t connect(const sp& listener, + int api, bool producerControlledByApp, QueueBufferOutput* output); + + // disconnect attempts to disconnect a producer API from the BufferQueue. + // Calling this method will cause any subsequent calls to other + // IGraphicBufferProducer methods to fail except for getAllocator and connect. + // Successfully calling connect after this will allow the other methods to + // succeed again. + // + // This method will fail if the the BufferQueue is not currently + // connected to the specified producer API. + virtual status_t disconnect(int api); + + // Attaches a sideband buffer stream to the IGraphicBufferProducer. + // + // A sideband stream is a device-specific mechanism for passing buffers + // from the producer to the consumer without using dequeueBuffer/ + // queueBuffer. If a sideband stream is present, the consumer can choose + // whether to acquire buffers from the sideband stream or from the queued + // buffers. + // + // Passing NULL or a different stream handle will detach the previous + // handle if any. + virtual status_t setSidebandStream(const sp& stream); + + // See IGraphicBufferProducer::allocateBuffers + virtual void allocateBuffers(bool async, uint32_t width, uint32_t height, + PixelFormat format, uint32_t usage); + + // See IGraphicBufferProducer::allowAllocation + virtual status_t allowAllocation(bool allow); + + // See IGraphicBufferProducer::setGenerationNumber + virtual status_t setGenerationNumber(uint32_t generationNumber); + + // See IGraphicBufferProducer::getConsumerName + virtual String8 getConsumerName() const override; + +private: + // This is required by the IBinder::DeathRecipient interface + virtual void binderDied(const wp& who); + + // waitForFreeSlotThenRelock finds the oldest slot in the FREE state. It may + // block if there are no available slots and we are not in non-blocking + // mode (producer and consumer controlled by the application). If it blocks, + // it will release mCore->mMutex while blocked so that other operations on + // the BufferQueue may succeed. + status_t waitForFreeSlotThenRelock(const char* caller, bool async, + int* found, status_t* returnFlags) const; + + sp mCore; + + // This references mCore->mSlots. Lock mCore->mMutex while accessing. + BufferQueueDefs::SlotsType& mSlots; + + // This is a cached copy of the name stored in the BufferQueueCore. + // It's updated during connect and dequeueBuffer (which should catch + // most updates). + String8 mConsumerName; + + uint32_t mStickyTransform; + + // This saves the fence from the last queueBuffer, such that the + // next queueBuffer call can throttle buffer production. The prior + // queueBuffer's fence is not nessessarily available elsewhere, + // since the previous buffer might have already been acquired. + sp mLastQueueBufferFence; + + // Take-a-ticket system for ensuring that onFrame* callbacks are called in + // the order that frames are queued. While the BufferQueue lock + // (mCore->mMutex) is held, a ticket is retained by the producer. After + // dropping the BufferQueue lock, the producer must wait on the condition + // variable until the current callback ticket matches its retained ticket. + Mutex mCallbackMutex; + int mNextCallbackTicket; // Protected by mCore->mMutex + int mCurrentCallbackTicket; // Protected by mCallbackMutex + Condition mCallbackCondition; + +}; // class BufferQueueProducer + +} // namespace android + +#endif diff --git a/third_party/android_frameworks_native/include/gui/BufferSlot.h b/third_party/android_frameworks_native/include/gui/BufferSlot.h new file mode 100644 index 000000000..6085e116a --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/BufferSlot.h @@ -0,0 +1,142 @@ +/* + * Copyright 2014 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_GUI_BUFFERSLOT_H +#define ANDROID_GUI_BUFFERSLOT_H + +#include +#include + +#include +#include + +#include + +namespace android { + +class Fence; + +struct BufferSlot { + + BufferSlot() + : mEglDisplay(EGL_NO_DISPLAY), + mBufferState(BufferSlot::FREE), + mRequestBufferCalled(false), + mFrameNumber(0), + mEglFence(EGL_NO_SYNC_KHR), + mAcquireCalled(false), + mNeedsCleanupOnRelease(false), + mAttachedByConsumer(false) { + } + + // mGraphicBuffer points to the buffer allocated for this slot or is NULL + // if no buffer has been allocated. + sp mGraphicBuffer; + + // mEglDisplay is the EGLDisplay used to create EGLSyncKHR objects. + EGLDisplay mEglDisplay; + + // BufferState represents the different states in which a buffer slot + // can be. All slots are initially FREE. + enum BufferState { + // FREE indicates that the buffer is available to be dequeued + // by the producer. The buffer may be in use by the consumer for + // a finite time, so the buffer must not be modified until the + // associated fence is signaled. + // + // The slot is "owned" by BufferQueue. It transitions to DEQUEUED + // when dequeueBuffer is called. + FREE = 0, + + // DEQUEUED indicates that the buffer has been dequeued by the + // producer, but has not yet been queued or canceled. The + // producer may modify the buffer's contents as soon as the + // associated ready fence is signaled. + // + // The slot is "owned" by the producer. It can transition to + // QUEUED (via queueBuffer) or back to FREE (via cancelBuffer). + DEQUEUED = 1, + + // QUEUED indicates that the buffer has been filled by the + // producer and queued for use by the consumer. The buffer + // contents may continue to be modified for a finite time, so + // the contents must not be accessed until the associated fence + // is signaled. + // + // The slot is "owned" by BufferQueue. It can transition to + // ACQUIRED (via acquireBuffer) or to FREE (if another buffer is + // queued in asynchronous mode). + QUEUED = 2, + + // ACQUIRED indicates that the buffer has been acquired by the + // consumer. As with QUEUED, the contents must not be accessed + // by the consumer until the fence is signaled. + // + // The slot is "owned" by the consumer. It transitions to FREE + // when releaseBuffer is called. + ACQUIRED = 3 + }; + + static const char* bufferStateName(BufferState state); + + // mBufferState is the current state of this buffer slot. + BufferState mBufferState; + + // mRequestBufferCalled is used for validating that the producer did + // call requestBuffer() when told to do so. Technically this is not + // needed but useful for debugging and catching producer bugs. + bool mRequestBufferCalled; + + // mFrameNumber is the number of the queued frame for this slot. This + // is used to dequeue buffers in LRU order (useful because buffers + // may be released before their release fence is signaled). + uint64_t mFrameNumber; + + // mEglFence is the EGL sync object that must signal before the buffer + // associated with this buffer slot may be dequeued. It is initialized + // to EGL_NO_SYNC_KHR when the buffer is created and may be set to a + // new sync object in releaseBuffer. (This is deprecated in favor of + // mFence, below.) + EGLSyncKHR mEglFence; + + // mFence is a fence which will signal when work initiated by the + // previous owner of the buffer is finished. When the buffer is FREE, + // the fence indicates when the consumer has finished reading + // from the buffer, or when the producer has finished writing if it + // called cancelBuffer after queueing some writes. When the buffer is + // QUEUED, it indicates when the producer has finished filling the + // buffer. When the buffer is DEQUEUED or ACQUIRED, the fence has been + // passed to the consumer or producer along with ownership of the + // buffer, and mFence is set to NO_FENCE. + sp mFence; + + // Indicates whether this buffer has been seen by a consumer yet + bool mAcquireCalled; + + // Indicates whether this buffer needs to be cleaned up by the + // consumer. This is set when a buffer in ACQUIRED state is freed. + // It causes releaseBuffer to return STALE_BUFFER_SLOT. + bool mNeedsCleanupOnRelease; + + // Indicates whether the buffer was attached on the consumer side. + // If so, it needs to set the BUFFER_NEEDS_REALLOCATION flag when dequeued + // to prevent the producer from using a stale cached buffer. + bool mAttachedByConsumer; +}; + +} // namespace android + +#endif diff --git a/third_party/android_frameworks_native/include/gui/ConsumerBase.h b/third_party/android_frameworks_native/include/gui/ConsumerBase.h new file mode 100644 index 000000000..9307a26fb --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/ConsumerBase.h @@ -0,0 +1,252 @@ +/* + * Copyright (C) 2010 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_GUI_CONSUMERBASE_H +#define ANDROID_GUI_CONSUMERBASE_H + +#include + +#include + +#include +#include +#include +#include + +namespace android { +// ---------------------------------------------------------------------------- + +class String8; + +// ConsumerBase is a base class for BufferQueue consumer end-points. It +// handles common tasks like management of the connection to the BufferQueue +// and the buffer pool. +class ConsumerBase : public virtual RefBase, + protected ConsumerListener { +public: + struct FrameAvailableListener : public virtual RefBase { + // See IConsumerListener::onFrame{Available,Replaced} + virtual void onFrameAvailable(const BufferItem& item) = 0; + virtual void onFrameReplaced(const BufferItem& /* item */) {} + }; + + virtual ~ConsumerBase(); + + // abandon frees all the buffers and puts the ConsumerBase into the + // 'abandoned' state. Once put in this state the ConsumerBase can never + // leave it. When in the 'abandoned' state, all methods of the + // IGraphicBufferProducer interface will fail with the NO_INIT error. + // + // Note that while calling this method causes all the buffers to be freed + // from the perspective of the the ConsumerBase, if there are additional + // references on the buffers (e.g. if a buffer is referenced by a client + // or by OpenGL ES as a texture) then those buffer will remain allocated. + void abandon(); + + // Returns true if the ConsumerBase is in the 'abandoned' state + bool isAbandoned(); + + // set the name of the ConsumerBase that will be used to identify it in + // log messages. + void setName(const String8& name); + + // dump writes the current state to a string. Child classes should add + // their state to the dump by overriding the dumpLocked method, which is + // called by these methods after locking the mutex. + void dump(String8& result) const; + void dump(String8& result, const char* prefix) const; + + // setFrameAvailableListener sets the listener object that will be notified + // when a new frame becomes available. + void setFrameAvailableListener(const wp& listener); + + // See IGraphicBufferConsumer::detachBuffer + status_t detachBuffer(int slot); + + // See IGraphicBufferConsumer::setDefaultBufferSize + status_t setDefaultBufferSize(uint32_t width, uint32_t height); + + // See IGraphicBufferConsumer::setDefaultBufferFormat + status_t setDefaultBufferFormat(PixelFormat defaultFormat); + + // See IGraphicBufferConsumer::setDefaultBufferDataSpace + status_t setDefaultBufferDataSpace(android_dataspace defaultDataSpace); + +private: + ConsumerBase(const ConsumerBase&); + void operator=(const ConsumerBase&); + +protected: + // ConsumerBase constructs a new ConsumerBase object to consume image + // buffers from the given IGraphicBufferConsumer. + // The controlledByApp flag indicates that this consumer is under the application's + // control. + ConsumerBase(const sp& consumer, bool controlledByApp = false); + + // onLastStrongRef gets called by RefBase just before the dtor of the most + // derived class. It is used to clean up the buffers so that ConsumerBase + // can coordinate the clean-up by calling into virtual methods implemented + // by the derived classes. This would not be possible from the + // ConsuemrBase dtor because by the time that gets called the derived + // classes have already been destructed. + // + // This methods should not need to be overridden by derived classes, but + // if they are overridden the ConsumerBase implementation must be called + // from the derived class. + virtual void onLastStrongRef(const void* id); + + // Implementation of the IConsumerListener interface. These + // calls are used to notify the ConsumerBase of asynchronous events in the + // BufferQueue. The onFrameAvailable, onFrameReplaced, and + // onBuffersReleased methods should not need to be overridden by derived + // classes, but if they are overridden the ConsumerBase implementation must + // be called from the derived class. The ConsumerBase version of + // onSidebandStreamChanged does nothing and can be overriden by derived + // classes if they want the notification. + virtual void onFrameAvailable(const BufferItem& item) override; + virtual void onFrameReplaced(const BufferItem& item) override; + virtual void onBuffersReleased() override; + virtual void onSidebandStreamChanged() override; + + // freeBufferLocked frees up the given buffer slot. If the slot has been + // initialized this will release the reference to the GraphicBuffer in that + // slot. Otherwise it has no effect. + // + // Derived classes should override this method to clean up any state they + // keep per slot. If it is overridden, the derived class's implementation + // must call ConsumerBase::freeBufferLocked. + // + // This method must be called with mMutex locked. + virtual void freeBufferLocked(int slotIndex); + + // abandonLocked puts the BufferQueue into the abandoned state, causing + // all future operations on it to fail. This method rather than the public + // abandon method should be overridden by child classes to add abandon- + // time behavior. + // + // Derived classes should override this method to clean up any object + // state they keep (as opposed to per-slot state). If it is overridden, + // the derived class's implementation must call ConsumerBase::abandonLocked. + // + // This method must be called with mMutex locked. + virtual void abandonLocked(); + + // dumpLocked dumps the current state of the ConsumerBase object to the + // result string. Each line is prefixed with the string pointed to by the + // prefix argument. The buffer argument points to a buffer that may be + // used for intermediate formatting data, and the size of that buffer is + // indicated by the size argument. + // + // Derived classes should override this method to dump their internal + // state. If this method is overridden the derived class's implementation + // should call ConsumerBase::dumpLocked. + // + // This method must be called with mMutex locked. + virtual void dumpLocked(String8& result, const char* prefix) const; + + // acquireBufferLocked fetches the next buffer from the BufferQueue and + // updates the buffer slot for the buffer returned. + // + // Derived classes should override this method to perform any + // initialization that must take place the first time a buffer is assigned + // to a slot. If it is overridden the derived class's implementation must + // call ConsumerBase::acquireBufferLocked. + virtual status_t acquireBufferLocked(BufferItem *item, nsecs_t presentWhen, + uint64_t maxFrameNumber = 0); + + // releaseBufferLocked relinquishes control over a buffer, returning that + // control to the BufferQueue. + // + // Derived classes should override this method to perform any cleanup that + // must take place when a buffer is released back to the BufferQueue. If + // it is overridden the derived class's implementation must call + // ConsumerBase::releaseBufferLocked.e + virtual status_t releaseBufferLocked(int slot, + const sp graphicBuffer, + EGLDisplay display, EGLSyncKHR eglFence); + + // returns true iff the slot still has the graphicBuffer in it. + bool stillTracking(int slot, const sp graphicBuffer); + + // addReleaseFence* adds the sync points associated with a fence to the set + // of sync points that must be reached before the buffer in the given slot + // may be used after the slot has been released. This should be called by + // derived classes each time some asynchronous work is kicked off that + // references the buffer. + status_t addReleaseFence(int slot, + const sp graphicBuffer, const sp& fence); + status_t addReleaseFenceLocked(int slot, + const sp graphicBuffer, const sp& fence); + + // Slot contains the information and object references that + // ConsumerBase maintains about a BufferQueue buffer slot. + struct Slot { + // mGraphicBuffer is the Gralloc buffer store in the slot or NULL if + // no Gralloc buffer is in the slot. + sp mGraphicBuffer; + + // mFence is a fence which will signal when the buffer associated with + // this buffer slot is no longer being used by the consumer and can be + // overwritten. The buffer can be dequeued before the fence signals; + // the producer is responsible for delaying writes until it signals. + sp mFence; + + // the frame number of the last acquired frame for this slot + uint64_t mFrameNumber; + }; + + // mSlots stores the buffers that have been allocated by the BufferQueue + // for each buffer slot. It is initialized to null pointers, and gets + // filled in with the result of BufferQueue::acquire when the + // client dequeues a buffer from a + // slot that has not yet been used. The buffer allocated to a slot will also + // be replaced if the requested buffer usage or geometry differs from that + // of the buffer allocated to a slot. + Slot mSlots[BufferQueue::NUM_BUFFER_SLOTS]; + + // mAbandoned indicates that the BufferQueue will no longer be used to + // consume images buffers pushed to it using the IGraphicBufferProducer + // interface. It is initialized to false, and set to true in the abandon + // method. A BufferQueue that has been abandoned will return the NO_INIT + // error from all IConsumerBase methods capable of returning an error. + bool mAbandoned; + + // mName is a string used to identify the ConsumerBase in log messages. + // It can be set by the setName method. + String8 mName; + + // mFrameAvailableListener is the listener object that will be called when a + // new frame becomes available. If it is not NULL it will be called from + // queueBuffer. + wp mFrameAvailableListener; + + // The ConsumerBase has-a BufferQueue and is responsible for creating this object + // if none is supplied + sp mConsumer; + + // mMutex is the mutex used to prevent concurrent access to the member + // variables of ConsumerBase objects. It must be locked whenever the + // member variables are accessed or when any of the *Locked methods are + // called. + // + // This mutex is intended to be locked by derived classes. + mutable Mutex mMutex; +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_CONSUMERBASE_H diff --git a/third_party/android_frameworks_native/include/gui/CpuConsumer.h b/third_party/android_frameworks_native/include/gui/CpuConsumer.h new file mode 100644 index 000000000..3b07a3175 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/CpuConsumer.h @@ -0,0 +1,131 @@ +/* + * 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_GUI_CPUCONSUMER_H +#define ANDROID_GUI_CPUCONSUMER_H + +#include + +#include + +#include +#include +#include + + +namespace android { + +class BufferQueue; + +/** + * CpuConsumer is a BufferQueue consumer endpoint that allows direct CPU + * access to the underlying gralloc buffers provided by BufferQueue. Multiple + * buffers may be acquired by it at once, to be used concurrently by the + * CpuConsumer owner. Sets gralloc usage flags to be software-read-only. + * This queue is synchronous by default. + */ + +class CpuConsumer : public ConsumerBase +{ + public: + typedef ConsumerBase::FrameAvailableListener FrameAvailableListener; + + struct LockedBuffer { + uint8_t *data; + uint32_t width; + uint32_t height; + PixelFormat format; + uint32_t stride; + Rect crop; + uint32_t transform; + uint32_t scalingMode; + int64_t timestamp; + android_dataspace dataSpace; + uint64_t frameNumber; + // this is the same as format, except for formats that are compatible with + // a flexible format (e.g. HAL_PIXEL_FORMAT_YCbCr_420_888). In the latter + // case this contains that flexible format + PixelFormat flexFormat; + // Values below are only valid when using HAL_PIXEL_FORMAT_YCbCr_420_888 + // or compatible format, in which case LockedBuffer::data + // contains the Y channel, and stride is the Y channel stride. For other + // formats, these will all be 0. + uint8_t *dataCb; + uint8_t *dataCr; + uint32_t chromaStride; + uint32_t chromaStep; + }; + + // Create a new CPU consumer. The maxLockedBuffers parameter specifies + // how many buffers can be locked for user access at the same time. + CpuConsumer(const sp& bq, + size_t maxLockedBuffers, bool controlledByApp = false); + + virtual ~CpuConsumer(); + + // set the name of the CpuConsumer that will be used to identify it in + // log messages. + void setName(const String8& name); + + // Gets the next graphics buffer from the producer and locks it for CPU use, + // filling out the passed-in locked buffer structure with the native pointer + // and metadata. Returns BAD_VALUE if no new buffer is available, and + // NOT_ENOUGH_DATA if the maximum number of buffers is already locked. + // + // Only a fixed number of buffers can be locked at a time, determined by the + // construction-time maxLockedBuffers parameter. If INVALID_OPERATION is + // returned by lockNextBuffer, then old buffers must be returned to the queue + // by calling unlockBuffer before more buffers can be acquired. + status_t lockNextBuffer(LockedBuffer *nativeBuffer); + + // Returns a locked buffer to the queue, allowing it to be reused. Since + // only a fixed number of buffers may be locked at a time, old buffers must + // be released by calling unlockBuffer to ensure new buffers can be acquired by + // lockNextBuffer. + status_t unlockBuffer(const LockedBuffer &nativeBuffer); + + private: + // Maximum number of buffers that can be locked at a time + size_t mMaxLockedBuffers; + + status_t releaseAcquiredBufferLocked(size_t lockedIdx); + + virtual void freeBufferLocked(int slotIndex); + + // Tracking for buffers acquired by the user + struct AcquiredBuffer { + // Need to track the original mSlot index and the buffer itself because + // the mSlot entry may be freed/reused before the acquired buffer is + // released. + int mSlot; + sp mGraphicBuffer; + void *mBufferPointer; + + AcquiredBuffer() : + mSlot(BufferQueue::INVALID_BUFFER_SLOT), + mBufferPointer(NULL) { + } + }; + Vector mAcquiredBuffers; + + // Count of currently locked buffers + size_t mCurrentLockedBuffers; + +}; + +} // namespace android + +#endif // ANDROID_GUI_CPUCONSUMER_H diff --git a/third_party/android_frameworks_native/include/gui/DisplayEventReceiver.h b/third_party/android_frameworks_native/include/gui/DisplayEventReceiver.h new file mode 100644 index 000000000..a4718b91c --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/DisplayEventReceiver.h @@ -0,0 +1,137 @@ +/* + * 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_GUI_DISPLAY_EVENT_H +#define ANDROID_GUI_DISPLAY_EVENT_H + +#include +#include + +#include +#include +#include + +#include + +// ---------------------------------------------------------------------------- + +namespace android { + +// ---------------------------------------------------------------------------- + +class BitTube; +class IDisplayEventConnection; + +// ---------------------------------------------------------------------------- + +class DisplayEventReceiver { +public: + enum { + DISPLAY_EVENT_VSYNC = 'vsyn', + DISPLAY_EVENT_HOTPLUG = 'plug' + }; + + struct Event { + + struct Header { + uint32_t type; + uint32_t id; + nsecs_t timestamp __attribute__((aligned(8))); + }; + + struct VSync { + uint32_t count; + }; + + struct Hotplug { + bool connected; + }; + + Header header; + union { + VSync vsync; + Hotplug hotplug; + }; + }; + +public: + /* + * DisplayEventReceiver creates and registers an event connection with + * SurfaceFlinger. VSync events are disabled by default. Call setVSyncRate + * or requestNextVsync to receive them. + * Other events start being delivered immediately. + */ + DisplayEventReceiver(); + + /* + * ~DisplayEventReceiver severs the connection with SurfaceFlinger, new events + * stop being delivered immediately. Note that the queue could have + * some events pending. These will be delivered. + */ + ~DisplayEventReceiver(); + + /* + * initCheck returns the state of DisplayEventReceiver after construction. + */ + status_t initCheck() const; + + /* + * getFd returns the file descriptor to use to receive events. + * OWNERSHIP IS RETAINED by DisplayEventReceiver. DO NOT CLOSE this + * file-descriptor. + */ + int getFd() const; + + /* + * getEvents reads events from the queue and returns how many events were + * read. Returns 0 if there are no more events or a negative error code. + * If NOT_ENOUGH_DATA is returned, the object has become invalid forever, it + * should be destroyed and getEvents() shouldn't be called again. + */ + ssize_t getEvents(Event* events, size_t count); + static ssize_t getEvents(const sp& dataChannel, + Event* events, size_t count); + + /* + * sendEvents write events to the queue and returns how many events were + * written. + */ + static ssize_t sendEvents(const sp& dataChannel, + Event const* events, size_t count); + + /* + * setVsyncRate() sets the Event::VSync delivery rate. A value of + * 1 returns every Event::VSync. A value of 2 returns every other event, + * etc... a value of 0 returns no event unless requestNextVsync() has + * been called. + */ + status_t setVsyncRate(uint32_t count); + + /* + * requestNextVsync() schedules the next Event::VSync. It has no effect + * if the vsync rate is > 0. + */ + status_t requestNextVsync(); + +private: + sp mEventConnection; + sp mDataChannel; +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_DISPLAY_EVENT_H diff --git a/third_party/android_frameworks_native/include/gui/GLConsumer.h b/third_party/android_frameworks_native/include/gui/GLConsumer.h new file mode 100644 index 000000000..c35c7be06 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/GLConsumer.h @@ -0,0 +1,488 @@ +/* + * Copyright (C) 2010 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_GUI_CONSUMER_H +#define ANDROID_GUI_CONSUMER_H + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +namespace android { +// ---------------------------------------------------------------------------- + + +class String8; + +/* + * GLConsumer consumes buffers of graphics data from a BufferQueue, + * and makes them available to OpenGL as a texture. + * + * A typical usage pattern is to set up the GLConsumer with the + * desired options, and call updateTexImage() when a new frame is desired. + * If a new frame is available, the texture will be updated. If not, + * the previous contents are retained. + * + * By default, the texture is attached to the GL_TEXTURE_EXTERNAL_OES + * texture target, in the EGL context of the first thread that calls + * updateTexImage(). + * + * This class was previously called SurfaceTexture. + */ +class GLConsumer : public ConsumerBase { +public: + enum { TEXTURE_EXTERNAL = 0x8D65 }; // GL_TEXTURE_EXTERNAL_OES + typedef ConsumerBase::FrameAvailableListener FrameAvailableListener; + + // GLConsumer constructs a new GLConsumer object. If the constructor with + // the tex parameter is used, tex indicates the name of the OpenGL ES + // texture to which images are to be streamed. texTarget specifies the + // OpenGL ES texture target to which the texture will be bound in + // updateTexImage. useFenceSync specifies whether fences should be used to + // synchronize access to buffers if that behavior is enabled at + // compile-time. + // + // A GLConsumer may be detached from one OpenGL ES context and then + // attached to a different context using the detachFromContext and + // attachToContext methods, respectively. The intention of these methods is + // purely to allow a GLConsumer to be transferred from one consumer + // context to another. If such a transfer is not needed there is no + // requirement that either of these methods be called. + // + // If the constructor with the tex parameter is used, the GLConsumer is + // created in a state where it is considered attached to an OpenGL ES + // context for the purposes of the attachToContext and detachFromContext + // methods. However, despite being considered "attached" to a context, the + // specific OpenGL ES context doesn't get latched until the first call to + // updateTexImage. After that point, all calls to updateTexImage must be + // made with the same OpenGL ES context current. + // + // If the constructor without the tex parameter is used, the GLConsumer is + // created in a detached state, and attachToContext must be called before + // calls to updateTexImage. + GLConsumer(const sp& bq, + uint32_t tex, uint32_t texureTarget, bool useFenceSync, + bool isControlledByApp); + + GLConsumer(const sp& bq, uint32_t texureTarget, + bool useFenceSync, bool isControlledByApp); + + // updateTexImage acquires the most recently queued buffer, and sets the + // image contents of the target texture to it. + // + // This call may only be made while the OpenGL ES context to which the + // target texture belongs is bound to the calling thread. + // + // This calls doGLFenceWait to ensure proper synchronization. + status_t updateTexImage(); + + // releaseTexImage releases the texture acquired in updateTexImage(). + // This is intended to be used in single buffer mode. + // + // This call may only be made while the OpenGL ES context to which the + // target texture belongs is bound to the calling thread. + status_t releaseTexImage(); + + // setReleaseFence stores a fence that will signal when the current buffer + // is no longer being read. This fence will be returned to the producer + // when the current buffer is released by updateTexImage(). Multiple + // fences can be set for a given buffer; they will be merged into a single + // union fence. + void setReleaseFence(const sp& fence); + + // setDefaultMaxBufferCount sets the default limit on the maximum number + // of buffers that will be allocated at one time. The image producer may + // override the limit. + status_t setDefaultMaxBufferCount(int bufferCount); + + // getTransformMatrix retrieves the 4x4 texture coordinate transform matrix + // associated with the texture image set by the most recent call to + // updateTexImage. + // + // This transform matrix maps 2D homogeneous texture coordinates of the form + // (s, t, 0, 1) with s and t in the inclusive range [0, 1] to the texture + // coordinate that should be used to sample that location from the texture. + // Sampling the texture outside of the range of this transform is undefined. + // + // This transform is necessary to compensate for transforms that the stream + // content producer may implicitly apply to the content. By forcing users of + // a GLConsumer to apply this transform we avoid performing an extra + // copy of the data that would be needed to hide the transform from the + // user. + // + // The matrix is stored in column-major order so that it may be passed + // directly to OpenGL ES via the glLoadMatrixf or glUniformMatrix4fv + // functions. + void getTransformMatrix(float mtx[16]); + + // getTimestamp retrieves the timestamp associated with the texture image + // set by the most recent call to updateTexImage. + // + // The timestamp is in nanoseconds, and is monotonically increasing. Its + // other semantics (zero point, etc) are source-dependent and should be + // documented by the source. + int64_t getTimestamp(); + + // getFrameNumber retrieves the frame number associated with the texture + // image set by the most recent call to updateTexImage. + // + // The frame number is an incrementing counter set to 0 at the creation of + // the BufferQueue associated with this consumer. + uint64_t getFrameNumber(); + + // setDefaultBufferSize is used to set the size of buffers returned by + // requestBuffers when a with and height of zero is requested. + // A call to setDefaultBufferSize() may trigger requestBuffers() to + // be called from the client. + // The width and height parameters must be no greater than the minimum of + // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv). + // An error due to invalid dimensions might not be reported until + // updateTexImage() is called. + status_t setDefaultBufferSize(uint32_t width, uint32_t height); + + // setFilteringEnabled sets whether the transform matrix should be computed + // for use with bilinear filtering. + void setFilteringEnabled(bool enabled); + + // getCurrentBuffer returns the buffer associated with the current image. + sp getCurrentBuffer() const; + + // getCurrentTextureTarget returns the texture target of the current + // texture as returned by updateTexImage(). + uint32_t getCurrentTextureTarget() const; + + // getCurrentCrop returns the cropping rectangle of the current buffer. + Rect getCurrentCrop() const; + + // getCurrentTransform returns the transform of the current buffer. + uint32_t getCurrentTransform() const; + + // getCurrentScalingMode returns the scaling mode of the current buffer. + uint32_t getCurrentScalingMode() const; + + // getCurrentFence returns the fence indicating when the current buffer is + // ready to be read from. + sp getCurrentFence() const; + + // doGLFenceWait inserts a wait command into the OpenGL ES command stream + // to ensure that it is safe for future OpenGL ES commands to access the + // current texture buffer. + status_t doGLFenceWait() const; + + // set the name of the GLConsumer that will be used to identify it in + // log messages. + void setName(const String8& name); + + // These functions call the corresponding BufferQueue implementation + // so the refactoring can proceed smoothly + status_t setDefaultBufferFormat(PixelFormat defaultFormat); + status_t setDefaultBufferDataSpace(android_dataspace defaultDataSpace); + status_t setConsumerUsageBits(uint32_t usage); + status_t setTransformHint(uint32_t hint); + + // detachFromContext detaches the GLConsumer from the calling thread's + // current OpenGL ES context. This context must be the same as the context + // that was current for previous calls to updateTexImage. + // + // Detaching a GLConsumer from an OpenGL ES context will result in the + // deletion of the OpenGL ES texture object into which the images were being + // streamed. After a GLConsumer has been detached from the OpenGL ES + // context calls to updateTexImage will fail returning INVALID_OPERATION + // until the GLConsumer is attached to a new OpenGL ES context using the + // attachToContext method. + status_t detachFromContext(); + + // attachToContext attaches a GLConsumer that is currently in the + // 'detached' state to the current OpenGL ES context. A GLConsumer is + // in the 'detached' state iff detachFromContext has successfully been + // called and no calls to attachToContext have succeeded since the last + // detachFromContext call. Calls to attachToContext made on a + // GLConsumer that is not in the 'detached' state will result in an + // INVALID_OPERATION error. + // + // The tex argument specifies the OpenGL ES texture object name in the + // new context into which the image contents will be streamed. A successful + // call to attachToContext will result in this texture object being bound to + // the texture target and populated with the image contents that were + // current at the time of the last call to detachFromContext. + status_t attachToContext(uint32_t tex); + +protected: + + // abandonLocked overrides the ConsumerBase method to clear + // mCurrentTextureImage in addition to the ConsumerBase behavior. + virtual void abandonLocked(); + + // dumpLocked overrides the ConsumerBase method to dump GLConsumer- + // specific info in addition to the ConsumerBase behavior. + virtual void dumpLocked(String8& result, const char* prefix) const; + + // acquireBufferLocked overrides the ConsumerBase method to update the + // mEglSlots array in addition to the ConsumerBase behavior. + virtual status_t acquireBufferLocked(BufferItem *item, nsecs_t presentWhen, + uint64_t maxFrameNumber = 0) override; + + // releaseBufferLocked overrides the ConsumerBase method to update the + // mEglSlots array in addition to the ConsumerBase. + virtual status_t releaseBufferLocked(int slot, + const sp graphicBuffer, + EGLDisplay display, EGLSyncKHR eglFence); + + status_t releaseBufferLocked(int slot, + const sp graphicBuffer, EGLSyncKHR eglFence) { + return releaseBufferLocked(slot, graphicBuffer, mEglDisplay, eglFence); + } + + static bool isExternalFormat(PixelFormat format); + + // This releases the buffer in the slot referenced by mCurrentTexture, + // then updates state to refer to the BufferItem, which must be a + // newly-acquired buffer. + status_t updateAndReleaseLocked(const BufferItem& item); + + // Binds mTexName and the current buffer to mTexTarget. Uses + // mCurrentTexture if it's set, mCurrentTextureImage if not. If the + // bind succeeds, this calls doGLFenceWait. + status_t bindTextureImageLocked(); + + // Gets the current EGLDisplay and EGLContext values, and compares them + // to mEglDisplay and mEglContext. If the fields have been previously + // set, the values must match; if not, the fields are set to the current + // values. + // The contextCheck argument is used to ensure that a GL context is + // properly set; when set to false, the check is not performed. + status_t checkAndUpdateEglStateLocked(bool contextCheck = false); + +private: + // EglImage is a utility class for tracking and creating EGLImageKHRs. There + // is primarily just one image per slot, but there is also special cases: + // - For releaseTexImage, we use a debug image (mReleasedTexImage) + // - After freeBuffer, we must still keep the current image/buffer + // Reference counting EGLImages lets us handle all these cases easily while + // also only creating new EGLImages from buffers when required. + class EglImage : public LightRefBase { + public: + EglImage(sp graphicBuffer); + + // createIfNeeded creates an EGLImage if required (we haven't created + // one yet, or the EGLDisplay or crop-rect has changed). + status_t createIfNeeded(EGLDisplay display, + const Rect& cropRect, + bool forceCreate = false); + + // This calls glEGLImageTargetTexture2DOES to bind the image to the + // texture in the specified texture target. + void bindToTextureTarget(uint32_t texTarget); + + const sp& graphicBuffer() { return mGraphicBuffer; } + const native_handle* graphicBufferHandle() { + return mGraphicBuffer == NULL ? NULL : mGraphicBuffer->handle; + } + + private: + // Only allow instantiation using ref counting. + friend class LightRefBase; + virtual ~EglImage(); + + // createImage creates a new EGLImage from a GraphicBuffer. + EGLImageKHR createImage(EGLDisplay dpy, + const sp& graphicBuffer, const Rect& crop); + + // Disallow copying + EglImage(const EglImage& rhs); + void operator = (const EglImage& rhs); + + // mGraphicBuffer is the buffer that was used to create this image. + sp mGraphicBuffer; + + // mEglImage is the EGLImage created from mGraphicBuffer. + EGLImageKHR mEglImage; + + // mEGLDisplay is the EGLDisplay that was used to create mEglImage. + EGLDisplay mEglDisplay; + + // mCropRect is the crop rectangle passed to EGL when mEglImage + // was created. + Rect mCropRect; + }; + + // freeBufferLocked frees up the given buffer slot. If the slot has been + // initialized this will release the reference to the GraphicBuffer in that + // slot and destroy the EGLImage in that slot. Otherwise it has no effect. + // + // This method must be called with mMutex locked. + virtual void freeBufferLocked(int slotIndex); + + // computeCurrentTransformMatrixLocked computes the transform matrix for the + // current texture. It uses mCurrentTransform and the current GraphicBuffer + // to compute this matrix and stores it in mCurrentTransformMatrix. + // mCurrentTextureImage must not be NULL. + void computeCurrentTransformMatrixLocked(); + + // doGLFenceWaitLocked inserts a wait command into the OpenGL ES command + // stream to ensure that it is safe for future OpenGL ES commands to + // access the current texture buffer. + status_t doGLFenceWaitLocked() const; + + // syncForReleaseLocked performs the synchronization needed to release the + // current slot from an OpenGL ES context. If needed it will set the + // current slot's fence to guard against a producer accessing the buffer + // before the outstanding accesses have completed. + status_t syncForReleaseLocked(EGLDisplay dpy); + + // returns a graphic buffer used when the texture image has been released + static sp getDebugTexImageBuffer(); + + // The default consumer usage flags that GLConsumer always sets on its + // BufferQueue instance; these will be OR:d with any additional flags passed + // from the GLConsumer user. In particular, GLConsumer will always + // consume buffers as hardware textures. + static const uint32_t DEFAULT_USAGE_FLAGS = GraphicBuffer::USAGE_HW_TEXTURE; + + // mCurrentTextureImage is the EglImage/buffer of the current texture. It's + // possible that this buffer is not associated with any buffer slot, so we + // must track it separately in order to support the getCurrentBuffer method. + sp mCurrentTextureImage; + + // mCurrentCrop is the crop rectangle that applies to the current texture. + // It gets set each time updateTexImage is called. + Rect mCurrentCrop; + + // mCurrentTransform is the transform identifier for the current texture. It + // gets set each time updateTexImage is called. + uint32_t mCurrentTransform; + + // mCurrentScalingMode is the scaling mode for the current texture. It gets + // set each time updateTexImage is called. + uint32_t mCurrentScalingMode; + + // mCurrentFence is the fence received from BufferQueue in updateTexImage. + sp mCurrentFence; + + // mCurrentTransformMatrix is the transform matrix for the current texture. + // It gets computed by computeTransformMatrix each time updateTexImage is + // called. + float mCurrentTransformMatrix[16]; + + // mCurrentTimestamp is the timestamp for the current texture. It + // gets set each time updateTexImage is called. + int64_t mCurrentTimestamp; + + // mCurrentFrameNumber is the frame counter for the current texture. + // It gets set each time updateTexImage is called. + uint64_t mCurrentFrameNumber; + + uint32_t mDefaultWidth, mDefaultHeight; + + // mFilteringEnabled indicates whether the transform matrix is computed for + // use with bilinear filtering. It defaults to true and is changed by + // setFilteringEnabled(). + bool mFilteringEnabled; + + // mTexName is the name of the OpenGL texture to which streamed images will + // be bound when updateTexImage is called. It is set at construction time + // and can be changed with a call to attachToContext. + uint32_t mTexName; + + // mUseFenceSync indicates whether creation of the EGL_KHR_fence_sync + // extension should be used to prevent buffers from being dequeued before + // it's safe for them to be written. It gets set at construction time and + // never changes. + const bool mUseFenceSync; + + // mTexTarget is the GL texture target with which the GL texture object is + // associated. It is set in the constructor and never changed. It is + // almost always GL_TEXTURE_EXTERNAL_OES except for one use case in Android + // Browser. In that case it is set to GL_TEXTURE_2D to allow + // glCopyTexSubImage to read from the texture. This is a hack to work + // around a GL driver limitation on the number of FBO attachments, which the + // browser's tile cache exceeds. + const uint32_t mTexTarget; + + // EGLSlot contains the information and object references that + // GLConsumer maintains about a BufferQueue buffer slot. + struct EglSlot { + EglSlot() : mEglFence(EGL_NO_SYNC_KHR) {} + + // mEglImage is the EGLImage created from mGraphicBuffer. + sp mEglImage; + + // mFence is the EGL sync object that must signal before the buffer + // associated with this buffer slot may be dequeued. It is initialized + // to EGL_NO_SYNC_KHR when the buffer is created and (optionally, based + // on a compile-time option) set to a new sync object in updateTexImage. + EGLSyncKHR mEglFence; + }; + + // mEglDisplay is the EGLDisplay with which this GLConsumer is currently + // associated. It is intialized to EGL_NO_DISPLAY and gets set to the + // current display when updateTexImage is called for the first time and when + // attachToContext is called. + EGLDisplay mEglDisplay; + + // mEglContext is the OpenGL ES context with which this GLConsumer is + // currently associated. It is initialized to EGL_NO_CONTEXT and gets set + // to the current GL context when updateTexImage is called for the first + // time and when attachToContext is called. + EGLContext mEglContext; + + // mEGLSlots stores the buffers that have been allocated by the BufferQueue + // for each buffer slot. It is initialized to null pointers, and gets + // filled in with the result of BufferQueue::acquire when the + // client dequeues a buffer from a + // slot that has not yet been used. The buffer allocated to a slot will also + // be replaced if the requested buffer usage or geometry differs from that + // of the buffer allocated to a slot. + EglSlot mEglSlots[BufferQueue::NUM_BUFFER_SLOTS]; + + // mCurrentTexture is the buffer slot index of the buffer that is currently + // bound to the OpenGL texture. It is initialized to INVALID_BUFFER_SLOT, + // indicating that no buffer slot is currently bound to the texture. Note, + // however, that a value of INVALID_BUFFER_SLOT does not necessarily mean + // that no buffer is bound to the texture. A call to setBufferCount will + // reset mCurrentTexture to INVALID_BUFFER_SLOT. + int mCurrentTexture; + + // mAttached indicates whether the ConsumerBase is currently attached to + // an OpenGL ES context. For legacy reasons, this is initialized to true, + // indicating that the ConsumerBase is considered to be attached to + // whatever context is current at the time of the first updateTexImage call. + // It is set to false by detachFromContext, and then set to true again by + // attachToContext. + bool mAttached; + + // protects static initialization + static Mutex sStaticInitLock; + + // mReleasedTexImageBuffer is a dummy buffer used when in single buffer + // mode and releaseTexImage() has been called + static sp sReleasedTexImageBuffer; + sp mReleasedTexImage; +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_CONSUMER_H diff --git a/third_party/android_frameworks_native/include/gui/GraphicBufferAlloc.h b/third_party/android_frameworks_native/include/gui/GraphicBufferAlloc.h new file mode 100644 index 000000000..69fe51ef9 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/GraphicBufferAlloc.h @@ -0,0 +1,45 @@ +/* + * 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_SF_GRAPHIC_BUFFER_ALLOC_H +#define ANDROID_SF_GRAPHIC_BUFFER_ALLOC_H + +#include +#include + +#include +#include +#include + +namespace android { +// --------------------------------------------------------------------------- + +class GraphicBuffer; + +class GraphicBufferAlloc : public BnGraphicBufferAlloc { +public: + GraphicBufferAlloc(); + virtual ~GraphicBufferAlloc(); + virtual sp createGraphicBuffer(uint32_t width, + uint32_t height, PixelFormat format, uint32_t usage, + status_t* error); +}; + + +// --------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_SF_GRAPHIC_BUFFER_ALLOC_H diff --git a/third_party/android_frameworks_native/include/gui/GuiConfig.h b/third_party/android_frameworks_native/include/gui/GuiConfig.h new file mode 100644 index 000000000..b020ed9b6 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/GuiConfig.h @@ -0,0 +1,29 @@ +/* + * 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_GUI_CONFIG_H +#define ANDROID_GUI_CONFIG_H + +#include + +namespace android { + +// Append the libgui configuration details to configStr. +void appendGuiConfigString(String8& configStr); + +}; // namespace android + +#endif /*ANDROID_GUI_CONFIG_H*/ diff --git a/third_party/android_frameworks_native/include/gui/IConsumerListener.h b/third_party/android_frameworks_native/include/gui/IConsumerListener.h new file mode 100644 index 000000000..3f3979956 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/IConsumerListener.h @@ -0,0 +1,104 @@ +/* + * 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_GUI_ICONSUMERLISTENER_H +#define ANDROID_GUI_ICONSUMERLISTENER_H + +#include +#include + +#include +#include + +#include + +namespace android { +// ---------------------------------------------------------------------------- + +class BufferItem; + +// ConsumerListener is the interface through which the BufferQueue notifies +// the consumer of events that the consumer may wish to react to. Because +// the consumer will generally have a mutex that is locked during calls from +// the consumer to the BufferQueue, these calls from the BufferQueue to the +// consumer *MUST* be called only when the BufferQueue mutex is NOT locked. + +class ConsumerListener : public virtual RefBase { +public: + ConsumerListener() { } + virtual ~ConsumerListener() { } + + // onFrameAvailable is called from queueBuffer each time an additional + // frame becomes available for consumption. This means that frames that + // are queued while in asynchronous mode only trigger the callback if no + // previous frames are pending. Frames queued while in synchronous mode + // always trigger the callback. The item passed to the callback will contain + // all of the information about the queued frame except for its + // GraphicBuffer pointer, which will always be null. + // + // This is called without any lock held and can be called concurrently + // by multiple threads. + virtual void onFrameAvailable(const BufferItem& item) = 0; /* Asynchronous */ + + // onFrameReplaced is called from queueBuffer if the frame being queued is + // replacing an existing slot in the queue. Any call to queueBuffer that + // doesn't call onFrameAvailable will call this callback instead. The item + // passed to the callback will contain all of the information about the + // queued frame except for its GraphicBuffer pointer, which will always be + // null. + // + // This is called without any lock held and can be called concurrently + // by multiple threads. + virtual void onFrameReplaced(const BufferItem& /* item */) {} /* Asynchronous */ + + // onBuffersReleased is called to notify the buffer consumer that the + // BufferQueue has released its references to one or more GraphicBuffers + // contained in its slots. The buffer consumer should then call + // BufferQueue::getReleasedBuffers to retrieve the list of buffers + // + // This is called without any lock held and can be called concurrently + // by multiple threads. + virtual void onBuffersReleased() = 0; /* Asynchronous */ + + // onSidebandStreamChanged is called to notify the buffer consumer that the + // BufferQueue's sideband buffer stream has changed. This is called when a + // stream is first attached and when it is either detached or replaced by a + // different stream. + virtual void onSidebandStreamChanged() = 0; /* Asynchronous */ +}; + + +class IConsumerListener : public ConsumerListener, public IInterface +{ +public: + DECLARE_META_INTERFACE(ConsumerListener); +}; + +// ---------------------------------------------------------------------------- + +class BnConsumerListener : public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_ICONSUMERLISTENER_H diff --git a/third_party/android_frameworks_native/include/gui/IDisplayEventConnection.h b/third_party/android_frameworks_native/include/gui/IDisplayEventConnection.h new file mode 100644 index 000000000..86247de62 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/IDisplayEventConnection.h @@ -0,0 +1,73 @@ +/* + * 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_GUI_IDISPLAY_EVENT_CONNECTION_H +#define ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H + +#include +#include + +#include +#include + +#include + +namespace android { +// ---------------------------------------------------------------------------- + +class BitTube; + +class IDisplayEventConnection : public IInterface +{ +public: + + DECLARE_META_INTERFACE(DisplayEventConnection); + + /* + * getDataChannel() returns a BitTube where to receive the events from + */ + virtual sp getDataChannel() const = 0; + + /* + * setVsyncRate() sets the vsync event delivery rate. A value of + * 1 returns every vsync events. A value of 2 returns every other events, + * etc... a value of 0 returns no event unless requestNextVsync() has + * been called. + */ + virtual void setVsyncRate(uint32_t count) = 0; + + /* + * requestNextVsync() schedules the next vsync event. It has no effect + * if the vsync rate is > 0. + */ + virtual void requestNextVsync() = 0; // asynchronous +}; + +// ---------------------------------------------------------------------------- + +class BnDisplayEventConnection : public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H diff --git a/third_party/android_frameworks_native/include/gui/IGraphicBufferAlloc.h b/third_party/android_frameworks_native/include/gui/IGraphicBufferAlloc.h new file mode 100644 index 000000000..f3c46ec2e --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/IGraphicBufferAlloc.h @@ -0,0 +1,58 @@ +/* + * 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_GUI_IGRAPHIC_BUFFER_ALLOC_H +#define ANDROID_GUI_IGRAPHIC_BUFFER_ALLOC_H + +#include +#include + +#include +#include +#include + +namespace android { +// ---------------------------------------------------------------------------- + +class GraphicBuffer; + +class IGraphicBufferAlloc : public IInterface +{ +public: + DECLARE_META_INTERFACE(GraphicBufferAlloc); + + /* Create a new GraphicBuffer for the client to use. + */ + virtual sp createGraphicBuffer(uint32_t w, uint32_t h, + PixelFormat format, uint32_t usage, status_t* error) = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnGraphicBufferAlloc : public BnInterface +{ +public: + virtual status_t onTransact(uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------------- + +}; // namespace android + +#endif // ANDROID_GUI_IGRAPHIC_BUFFER_ALLOC_H diff --git a/third_party/android_frameworks_native/include/gui/IGraphicBufferConsumer.h b/third_party/android_frameworks_native/include/gui/IGraphicBufferConsumer.h new file mode 100644 index 000000000..60ec9cc0e --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/IGraphicBufferConsumer.h @@ -0,0 +1,280 @@ +/* + * 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_GUI_IGRAPHICBUFFERCONSUMER_H +#define ANDROID_GUI_IGRAPHICBUFFERCONSUMER_H + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +namespace android { +// ---------------------------------------------------------------------------- + +class BufferItem; +class Fence; +class GraphicBuffer; +class IConsumerListener; +class NativeHandle; + +class IGraphicBufferConsumer : public IInterface { + +public: + enum { + // Returned by releaseBuffer, after which the consumer must + // free any references to the just-released buffer that it might have. + STALE_BUFFER_SLOT = 1, + // Returned by dequeueBuffer if there are no pending buffers available. + NO_BUFFER_AVAILABLE, + // Returned by dequeueBuffer if it's too early for the buffer to be acquired. + PRESENT_LATER, + }; + + // acquireBuffer attempts to acquire ownership of the next pending buffer in + // the BufferQueue. If no buffer is pending then it returns + // NO_BUFFER_AVAILABLE. If a buffer is successfully acquired, the + // information about the buffer is returned in BufferItem. + // + // If the buffer returned had previously been + // acquired then the BufferItem::mGraphicBuffer field of buffer is set to + // NULL and it is assumed that the consumer still holds a reference to the + // buffer. + // + // If presentWhen is non-zero, it indicates the time when the buffer will + // be displayed on screen. If the buffer's timestamp is farther in the + // future, the buffer won't be acquired, and PRESENT_LATER will be + // returned. The presentation time is in nanoseconds, and the time base + // is CLOCK_MONOTONIC. + // + // If maxFrameNumber is non-zero, it indicates that acquireBuffer should + // only return a buffer with a frame number less than or equal to + // maxFrameNumber. If no such frame is available (such as when a buffer has + // been replaced but the consumer has not received the onFrameReplaced + // callback), then PRESENT_LATER will be returned. + // + // Return of NO_ERROR means the operation completed as normal. + // + // Return of a positive value means the operation could not be completed + // at this time, but the user should try again later: + // * NO_BUFFER_AVAILABLE - no buffer is pending (nothing queued by producer) + // * PRESENT_LATER - the buffer's timestamp is farther in the future + // + // Return of a negative value means an error has occurred: + // * INVALID_OPERATION - too many buffers have been acquired + virtual status_t acquireBuffer(BufferItem* buffer, nsecs_t presentWhen, + uint64_t maxFrameNumber = 0) = 0; + + // detachBuffer attempts to remove all ownership of the buffer in the given + // slot from the buffer queue. If this call succeeds, the slot will be + // freed, and there will be no way to obtain the buffer from this interface. + // The freed slot will remain unallocated until either it is selected to + // hold a freshly allocated buffer in dequeueBuffer or a buffer is attached + // to the slot. The buffer must have already been acquired. + // + // Return of a value other than NO_ERROR means an error has occurred: + // * BAD_VALUE - the given slot number is invalid, either because it is + // out of the range [0, NUM_BUFFER_SLOTS) or because the slot + // it refers to is not currently acquired. + virtual status_t detachBuffer(int slot) = 0; + + // attachBuffer attempts to transfer ownership of a buffer to the buffer + // queue. If this call succeeds, it will be as if this buffer was acquired + // from the returned slot number. As such, this call will fail if attaching + // this buffer would cause too many buffers to be simultaneously acquired. + // + // If the buffer is successfully attached, its frameNumber is initialized + // to 0. This must be passed into the releaseBuffer call or else the buffer + // will be deallocated as stale. + // + // Return of a value other than NO_ERROR means an error has occurred: + // * BAD_VALUE - outSlot or buffer were NULL, or the generation number of + // the buffer did not match the buffer queue. + // * INVALID_OPERATION - cannot attach the buffer because it would cause too + // many buffers to be acquired. + // * NO_MEMORY - no free slots available + virtual status_t attachBuffer(int *outSlot, + const sp& buffer) = 0; + + // releaseBuffer releases a buffer slot from the consumer back to the + // BufferQueue. This may be done while the buffer's contents are still + // being accessed. The fence will signal when the buffer is no longer + // in use. frameNumber is used to indentify the exact buffer returned. + // + // If releaseBuffer returns STALE_BUFFER_SLOT, then the consumer must free + // any references to the just-released buffer that it might have, as if it + // had received a onBuffersReleased() call with a mask set for the released + // buffer. + // + // Note that the dependencies on EGL will be removed once we switch to using + // the Android HW Sync HAL. + // + // Return of NO_ERROR means the operation completed as normal. + // + // Return of a positive value means the operation could not be completed + // at this time, but the user should try again later: + // * STALE_BUFFER_SLOT - see above (second paragraph) + // + // Return of a negative value means an error has occurred: + // * BAD_VALUE - one of the following could've happened: + // * the buffer slot was invalid + // * the fence was NULL + // * the buffer slot specified is not in the acquired state + virtual status_t releaseBuffer(int buf, uint64_t frameNumber, + EGLDisplay display, EGLSyncKHR fence, + const sp& releaseFence) = 0; + + // consumerConnect connects a consumer to the BufferQueue. Only one + // consumer may be connected, and when that consumer disconnects the + // BufferQueue is placed into the "abandoned" state, causing most + // interactions with the BufferQueue by the producer to fail. + // controlledByApp indicates whether the consumer is controlled by + // the application. + // + // consumer may not be NULL. + // + // Return of a value other than NO_ERROR means an error has occurred: + // * NO_INIT - the buffer queue has been abandoned + // * BAD_VALUE - a NULL consumer was provided + virtual status_t consumerConnect(const sp& consumer, bool controlledByApp) = 0; + + // consumerDisconnect disconnects a consumer from the BufferQueue. All + // buffers will be freed and the BufferQueue is placed in the "abandoned" + // state, causing most interactions with the BufferQueue by the producer to + // fail. + // + // Return of a value other than NO_ERROR means an error has occurred: + // * BAD_VALUE - no consumer is currently connected + virtual status_t consumerDisconnect() = 0; + + // getReleasedBuffers sets the value pointed to by slotMask to a bit set. + // Each bit index with a 1 corresponds to a released buffer slot with that + // index value. In particular, a released buffer is one that has + // been released by the BufferQueue but have not yet been released by the consumer. + // + // This should be called from the onBuffersReleased() callback. + // + // Return of a value other than NO_ERROR means an error has occurred: + // * NO_INIT - the buffer queue has been abandoned. + virtual status_t getReleasedBuffers(uint64_t* slotMask) = 0; + + // setDefaultBufferSize is used to set the size of buffers returned by + // dequeueBuffer when a width and height of zero is requested. Default + // is 1x1. + // + // Return of a value other than NO_ERROR means an error has occurred: + // * BAD_VALUE - either w or h was zero + virtual status_t setDefaultBufferSize(uint32_t w, uint32_t h) = 0; + + // setDefaultMaxBufferCount sets the default value for the maximum buffer + // count (the initial default is 2). If the producer has requested a + // buffer count using setBufferCount, the default buffer count will only + // take effect if the producer sets the count back to zero. + // + // The count must be between 2 and NUM_BUFFER_SLOTS, inclusive. + // + // Return of a value other than NO_ERROR means an error has occurred: + // * BAD_VALUE - bufferCount was out of range (see above). + virtual status_t setDefaultMaxBufferCount(int bufferCount) = 0; + + // disableAsyncBuffer disables the extra buffer used in async mode + // (when both producer and consumer have set their "isControlledByApp" + // flag) and has dequeueBuffer() return WOULD_BLOCK instead. + // + // This can only be called before consumerConnect(). + // + // Return of a value other than NO_ERROR means an error has occurred: + // * INVALID_OPERATION - attempting to call this after consumerConnect. + virtual status_t disableAsyncBuffer() = 0; + + // setMaxAcquiredBufferCount sets the maximum number of buffers that can + // be acquired by the consumer at one time (default 1). This call will + // fail if a producer is connected to the BufferQueue. + // + // maxAcquiredBuffers must be (inclusive) between 1 and MAX_MAX_ACQUIRED_BUFFERS. + // + // Return of a value other than NO_ERROR means an error has occurred: + // * BAD_VALUE - maxAcquiredBuffers was out of range (see above). + // * INVALID_OPERATION - attempting to call this after a producer connected. + virtual status_t setMaxAcquiredBufferCount(int maxAcquiredBuffers) = 0; + + // setConsumerName sets the name used in logging + virtual void setConsumerName(const String8& name) = 0; + + // setDefaultBufferFormat allows the BufferQueue to create + // GraphicBuffers of a defaultFormat if no format is specified + // in dequeueBuffer. + // The initial default is PIXEL_FORMAT_RGBA_8888. + // + // Return of a value other than NO_ERROR means an unknown error has occurred. + virtual status_t setDefaultBufferFormat(PixelFormat defaultFormat) = 0; + + // setDefaultBufferDataSpace is a request to the producer to provide buffers + // of the indicated dataSpace. The producer may ignore this request. + // The initial default is HAL_DATASPACE_UNKNOWN. + // + // Return of a value other than NO_ERROR means an unknown error has occurred. + virtual status_t setDefaultBufferDataSpace( + android_dataspace defaultDataSpace) = 0; + + // setConsumerUsageBits will turn on additional usage bits for dequeueBuffer. + // These are merged with the bits passed to dequeueBuffer. The values are + // enumerated in gralloc.h, e.g. GRALLOC_USAGE_HW_RENDER; the default is 0. + // + // Return of a value other than NO_ERROR means an unknown error has occurred. + virtual status_t setConsumerUsageBits(uint32_t usage) = 0; + + // setTransformHint bakes in rotation to buffers so overlays can be used. + // The values are enumerated in window.h, e.g. + // NATIVE_WINDOW_TRANSFORM_ROT_90. The default is 0 (no transform). + // + // Return of a value other than NO_ERROR means an unknown error has occurred. + virtual status_t setTransformHint(uint32_t hint) = 0; + + // Retrieve the sideband buffer stream, if any. + virtual sp getSidebandStream() const = 0; + + // dump state into a string + virtual void dump(String8& result, const char* prefix) const = 0; + +public: + DECLARE_META_INTERFACE(GraphicBufferConsumer); +}; + +// ---------------------------------------------------------------------------- + +class BnGraphicBufferConsumer : public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_IGRAPHICBUFFERCONSUMER_H diff --git a/third_party/android_frameworks_native/include/gui/IGraphicBufferProducer.h b/third_party/android_frameworks_native/include/gui/IGraphicBufferProducer.h new file mode 100644 index 000000000..9530de1aa --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/IGraphicBufferProducer.h @@ -0,0 +1,502 @@ +/* + * Copyright (C) 2010 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_GUI_IGRAPHICBUFFERPRODUCER_H +#define ANDROID_GUI_IGRAPHICBUFFERPRODUCER_H + +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include + +namespace android { +// ---------------------------------------------------------------------------- + +class IProducerListener; +class NativeHandle; +class Surface; + +/* + * This class defines the Binder IPC interface for the producer side of + * a queue of graphics buffers. It's used to send graphics data from one + * component to another. For example, a class that decodes video for + * playback might use this to provide frames. This is typically done + * indirectly, through Surface. + * + * The underlying mechanism is a BufferQueue, which implements + * BnGraphicBufferProducer. In normal operation, the producer calls + * dequeueBuffer() to get an empty buffer, fills it with data, then + * calls queueBuffer() to make it available to the consumer. + * + * This class was previously called ISurfaceTexture. + */ +class IGraphicBufferProducer : public IInterface +{ +public: + DECLARE_META_INTERFACE(GraphicBufferProducer); + + enum { + // A flag returned by dequeueBuffer when the client needs to call + // requestBuffer immediately thereafter. + BUFFER_NEEDS_REALLOCATION = 0x1, + // A flag returned by dequeueBuffer when all mirrored slots should be + // released by the client. This flag should always be processed first. + RELEASE_ALL_BUFFERS = 0x2, + }; + + // requestBuffer requests a new buffer for the given index. The server (i.e. + // the IGraphicBufferProducer implementation) assigns the newly created + // buffer to the given slot index, and the client is expected to mirror the + // slot->buffer mapping so that it's not necessary to transfer a + // GraphicBuffer for every dequeue operation. + // + // The slot must be in the range of [0, NUM_BUFFER_SLOTS). + // + // Return of a value other than NO_ERROR means an error has occurred: + // * NO_INIT - the buffer queue has been abandoned. + // * BAD_VALUE - one of the two conditions occurred: + // * slot was out of range (see above) + // * buffer specified by the slot is not dequeued + virtual status_t requestBuffer(int slot, sp* buf) = 0; + + // setBufferCount sets the number of buffer slots available. Calling this + // will also cause all buffer slots to be emptied. The caller should empty + // its mirrored copy of the buffer slots when calling this method. + // + // This function should not be called when there are any dequeued buffer + // slots, doing so will result in a BAD_VALUE error returned. + // + // The buffer count should be at most NUM_BUFFER_SLOTS (inclusive), but at least + // the minimum undequeued buffer count (exclusive). The minimum value + // can be obtained by calling query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS). + // In particular the range is (minUndequeudBuffers, NUM_BUFFER_SLOTS]. + // + // The buffer count may also be set to 0 (the default), to indicate that + // the producer does not wish to set a value. + // + // Return of a value other than NO_ERROR means an error has occurred: + // * NO_INIT - the buffer queue has been abandoned. + // * BAD_VALUE - one of the below conditions occurred: + // * bufferCount was out of range (see above) + // * client has one or more buffers dequeued + virtual status_t setBufferCount(int bufferCount) = 0; + + // dequeueBuffer requests a new buffer slot for the client to use. Ownership + // of the slot is transfered to the client, meaning that the server will not + // use the contents of the buffer associated with that slot. + // + // The slot index returned may or may not contain a buffer (client-side). + // If the slot is empty the client should call requestBuffer to assign a new + // buffer to that slot. + // + // Once the client is done filling this buffer, it is expected to transfer + // buffer ownership back to the server with either cancelBuffer on + // the dequeued slot or to fill in the contents of its associated buffer + // contents and call queueBuffer. + // + // If dequeueBuffer returns the BUFFER_NEEDS_REALLOCATION flag, the client is + // expected to call requestBuffer immediately. + // + // If dequeueBuffer returns the RELEASE_ALL_BUFFERS flag, the client is + // expected to release all of the mirrored slot->buffer mappings. + // + // The fence parameter will be updated to hold the fence associated with + // the buffer. The contents of the buffer must not be overwritten until the + // fence signals. If the fence is Fence::NO_FENCE, the buffer may be written + // immediately. + // + // The async parameter sets whether we're in asynchronous mode for this + // dequeueBuffer() call. + // + // The width and height parameters must be no greater than the minimum of + // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv). + // An error due to invalid dimensions might not be reported until + // updateTexImage() is called. If width and height are both zero, the + // default values specified by setDefaultBufferSize() are used instead. + // + // If the format is 0, the default format will be used. + // + // The usage argument specifies gralloc buffer usage flags. The values + // are enumerated in , e.g. GRALLOC_USAGE_HW_RENDER. These + // will be merged with the usage flags specified by + // IGraphicBufferConsumer::setConsumerUsageBits. + // + // This call will block until a buffer is available to be dequeued. If + // both the producer and consumer are controlled by the app, then this call + // can never block and will return WOULD_BLOCK if no buffer is available. + // + // A non-negative value with flags set (see above) will be returned upon + // success. + // + // Return of a negative means an error has occurred: + // * NO_INIT - the buffer queue has been abandoned. + // * BAD_VALUE - both in async mode and buffer count was less than the + // max numbers of buffers that can be allocated at once. + // * INVALID_OPERATION - cannot attach the buffer because it would cause + // too many buffers to be dequeued, either because + // the producer already has a single buffer dequeued + // and did not set a buffer count, or because a + // buffer count was set and this call would cause + // it to be exceeded. + // * WOULD_BLOCK - no buffer is currently available, and blocking is disabled + // since both the producer/consumer are controlled by app + // * NO_MEMORY - out of memory, cannot allocate the graphics buffer. + // + // All other negative values are an unknown error returned downstream + // from the graphics allocator (typically errno). + virtual status_t dequeueBuffer(int* slot, sp* fence, bool async, + uint32_t w, uint32_t h, PixelFormat format, uint32_t usage) = 0; + + // detachBuffer attempts to remove all ownership of the buffer in the given + // slot from the buffer queue. If this call succeeds, the slot will be + // freed, and there will be no way to obtain the buffer from this interface. + // The freed slot will remain unallocated until either it is selected to + // hold a freshly allocated buffer in dequeueBuffer or a buffer is attached + // to the slot. The buffer must have already been dequeued, and the caller + // must already possesses the sp (i.e., must have called + // requestBuffer). + // + // Return of a value other than NO_ERROR means an error has occurred: + // * NO_INIT - the buffer queue has been abandoned. + // * BAD_VALUE - the given slot number is invalid, either because it is + // out of the range [0, NUM_BUFFER_SLOTS), or because the slot + // it refers to is not currently dequeued and requested. + virtual status_t detachBuffer(int slot) = 0; + + // detachNextBuffer is equivalent to calling dequeueBuffer, requestBuffer, + // and detachBuffer in sequence, except for two things: + // + // 1) It is unnecessary to know the dimensions, format, or usage of the + // next buffer. + // 2) It will not block, since if it cannot find an appropriate buffer to + // return, it will return an error instead. + // + // Only slots that are free but still contain a GraphicBuffer will be + // considered, and the oldest of those will be returned. outBuffer is + // equivalent to outBuffer from the requestBuffer call, and outFence is + // equivalent to fence from the dequeueBuffer call. + // + // Return of a value other than NO_ERROR means an error has occurred: + // * NO_INIT - the buffer queue has been abandoned. + // * BAD_VALUE - either outBuffer or outFence were NULL. + // * NO_MEMORY - no slots were found that were both free and contained a + // GraphicBuffer. + virtual status_t detachNextBuffer(sp* outBuffer, + sp* outFence) = 0; + + // attachBuffer attempts to transfer ownership of a buffer to the buffer + // queue. If this call succeeds, it will be as if this buffer was dequeued + // from the returned slot number. As such, this call will fail if attaching + // this buffer would cause too many buffers to be simultaneously dequeued. + // + // If attachBuffer returns the RELEASE_ALL_BUFFERS flag, the caller is + // expected to release all of the mirrored slot->buffer mappings. + // + // A non-negative value with flags set (see above) will be returned upon + // success. + // + // Return of a negative value means an error has occurred: + // * NO_INIT - the buffer queue has been abandoned. + // * BAD_VALUE - outSlot or buffer were NULL, invalid combination of + // async mode and buffer count override, or the generation + // number of the buffer did not match the buffer queue. + // * INVALID_OPERATION - cannot attach the buffer because it would cause + // too many buffers to be dequeued, either because + // the producer already has a single buffer dequeued + // and did not set a buffer count, or because a + // buffer count was set and this call would cause + // it to be exceeded. + // * WOULD_BLOCK - no buffer slot is currently available, and blocking is + // disabled since both the producer/consumer are + // controlled by the app. + virtual status_t attachBuffer(int* outSlot, + const sp& buffer) = 0; + + // queueBuffer indicates that the client has finished filling in the + // contents of the buffer associated with slot and transfers ownership of + // that slot back to the server. + // + // It is not valid to call queueBuffer on a slot that is not owned + // by the client or one for which a buffer associated via requestBuffer + // (an attempt to do so will fail with a return value of BAD_VALUE). + // + // In addition, the input must be described by the client (as documented + // below). Any other properties (zero point, etc) + // are client-dependent, and should be documented by the client. + // + // The slot must be in the range of [0, NUM_BUFFER_SLOTS). + // + // Upon success, the output will be filled with meaningful values + // (refer to the documentation below). + // + // Return of a value other than NO_ERROR means an error has occurred: + // * NO_INIT - the buffer queue has been abandoned. + // * BAD_VALUE - one of the below conditions occurred: + // * fence was NULL + // * scaling mode was unknown + // * both in async mode and buffer count was less than the + // max numbers of buffers that can be allocated at once + // * slot index was out of range (see above). + // * the slot was not in the dequeued state + // * the slot was enqueued without requesting a buffer + // * crop rect is out of bounds of the buffer dimensions + + struct QueueBufferInput : public Flattenable { + friend class Flattenable; + inline QueueBufferInput(const Parcel& parcel); + // timestamp - a monotonically increasing value in nanoseconds + // isAutoTimestamp - if the timestamp was synthesized at queue time + // dataSpace - description of the contents, interpretation depends on format + // crop - a crop rectangle that's used as a hint to the consumer + // scalingMode - a set of flags from NATIVE_WINDOW_SCALING_* in + // transform - a set of flags from NATIVE_WINDOW_TRANSFORM_* in + // async - if the buffer is queued in asynchronous mode + // fence - a fence that the consumer must wait on before reading the buffer, + // set this to Fence::NO_FENCE if the buffer is ready immediately + // sticky - the sticky transform set in Surface (only used by the LEGACY + // camera mode). + inline QueueBufferInput(int64_t timestamp, bool isAutoTimestamp, + android_dataspace dataSpace, const Rect& crop, int scalingMode, + uint32_t transform, bool async, const sp& fence, + uint32_t sticky = 0) + : timestamp(timestamp), isAutoTimestamp(isAutoTimestamp), + dataSpace(dataSpace), crop(crop), scalingMode(scalingMode), + transform(transform), stickyTransform(sticky), + async(async), fence(fence), surfaceDamage() { } + inline void deflate(int64_t* outTimestamp, bool* outIsAutoTimestamp, + android_dataspace* outDataSpace, + Rect* outCrop, int* outScalingMode, + uint32_t* outTransform, bool* outAsync, sp* outFence, + uint32_t* outStickyTransform = NULL) const { + *outTimestamp = timestamp; + *outIsAutoTimestamp = bool(isAutoTimestamp); + *outDataSpace = dataSpace; + *outCrop = crop; + *outScalingMode = scalingMode; + *outTransform = transform; + *outAsync = bool(async); + *outFence = fence; + if (outStickyTransform != NULL) { + *outStickyTransform = stickyTransform; + } + } + + // Flattenable protocol + size_t getFlattenedSize() const; + size_t getFdCount() const; + status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const; + status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count); + + const Region& getSurfaceDamage() const { return surfaceDamage; } + void setSurfaceDamage(const Region& damage) { surfaceDamage = damage; } + + private: + int64_t timestamp; + int isAutoTimestamp; + android_dataspace dataSpace; + Rect crop; + int scalingMode; + uint32_t transform; + uint32_t stickyTransform; + int async; + sp fence; + Region surfaceDamage; + }; + + // QueueBufferOutput must be a POD structure + struct __attribute__ ((__packed__)) QueueBufferOutput { + inline QueueBufferOutput() { } + // outWidth - filled with default width applied to the buffer + // outHeight - filled with default height applied to the buffer + // outTransformHint - filled with default transform applied to the buffer + // outNumPendingBuffers - num buffers queued that haven't yet been acquired + // (counting the currently queued buffer) + inline void deflate(uint32_t* outWidth, + uint32_t* outHeight, + uint32_t* outTransformHint, + uint32_t* outNumPendingBuffers) const { + *outWidth = width; + *outHeight = height; + *outTransformHint = transformHint; + *outNumPendingBuffers = numPendingBuffers; + } + inline void inflate(uint32_t inWidth, uint32_t inHeight, + uint32_t inTransformHint, uint32_t inNumPendingBuffers) { + width = inWidth; + height = inHeight; + transformHint = inTransformHint; + numPendingBuffers = inNumPendingBuffers; + } + private: + uint32_t width; + uint32_t height; + uint32_t transformHint; + uint32_t numPendingBuffers; + }; + + virtual status_t queueBuffer(int slot, + const QueueBufferInput& input, QueueBufferOutput* output) = 0; + + // cancelBuffer indicates that the client does not wish to fill in the + // buffer associated with slot and transfers ownership of the slot back to + // the server. + // + // The buffer is not queued for use by the consumer. + // + // The buffer will not be overwritten until the fence signals. The fence + // will usually be the one obtained from dequeueBuffer. + virtual void cancelBuffer(int slot, const sp& fence) = 0; + + // query retrieves some information for this surface + // 'what' tokens allowed are that of NATIVE_WINDOW_* in + // + // Return of a value other than NO_ERROR means an error has occurred: + // * NO_INIT - the buffer queue has been abandoned. + // * BAD_VALUE - what was out of range + virtual int query(int what, int* value) = 0; + + // connect attempts to connect a client API to the IGraphicBufferProducer. + // This must be called before any other IGraphicBufferProducer methods are + // called except for getAllocator. A consumer must be already connected. + // + // This method will fail if the connect was previously called on the + // IGraphicBufferProducer and no corresponding disconnect call was made. + // + // The listener is an optional binder callback object that can be used if + // the producer wants to be notified when the consumer releases a buffer + // back to the BufferQueue. It is also used to detect the death of the + // producer. If only the latter functionality is desired, there is a + // DummyProducerListener class in IProducerListener.h that can be used. + // + // The api should be one of the NATIVE_WINDOW_API_* values in + // + // The producerControlledByApp should be set to true if the producer is hosted + // by an untrusted process (typically app_process-forked processes). If both + // the producer and the consumer are app-controlled then all buffer queues + // will operate in async mode regardless of the async flag. + // + // Upon success, the output will be filled with meaningful data + // (refer to QueueBufferOutput documentation above). + // + // Return of a value other than NO_ERROR means an error has occurred: + // * NO_INIT - one of the following occurred: + // * the buffer queue was abandoned + // * no consumer has yet connected + // * BAD_VALUE - one of the following has occurred: + // * the producer is already connected + // * api was out of range (see above). + // * output was NULL. + // * DEAD_OBJECT - the token is hosted by an already-dead process + // + // Additional negative errors may be returned by the internals, they + // should be treated as opaque fatal unrecoverable errors. + virtual status_t connect(const sp& listener, + int api, bool producerControlledByApp, QueueBufferOutput* output) = 0; + + // disconnect attempts to disconnect a client API from the + // IGraphicBufferProducer. Calling this method will cause any subsequent + // calls to other IGraphicBufferProducer methods to fail except for + // getAllocator and connect. Successfully calling connect after this will + // allow the other methods to succeed again. + // + // This method will fail if the the IGraphicBufferProducer is not currently + // connected to the specified client API. + // + // The api should be one of the NATIVE_WINDOW_API_* values in + // + // Disconnecting from an abandoned IGraphicBufferProducer is legal and + // is considered a no-op. + // + // Return of a value other than NO_ERROR means an error has occurred: + // * BAD_VALUE - one of the following has occurred: + // * the api specified does not match the one that was connected + // * api was out of range (see above). + // * DEAD_OBJECT - the token is hosted by an already-dead process + virtual status_t disconnect(int api) = 0; + + // Attaches a sideband buffer stream to the IGraphicBufferProducer. + // + // A sideband stream is a device-specific mechanism for passing buffers + // from the producer to the consumer without using dequeueBuffer/ + // queueBuffer. If a sideband stream is present, the consumer can choose + // whether to acquire buffers from the sideband stream or from the queued + // buffers. + // + // Passing NULL or a different stream handle will detach the previous + // handle if any. + virtual status_t setSidebandStream(const sp& stream) = 0; + + // Allocates buffers based on the given dimensions/format. + // + // This function will allocate up to the maximum number of buffers + // permitted by the current BufferQueue configuration. It will use the + // given format, dimensions, and usage bits, which are interpreted in the + // same way as for dequeueBuffer, and the async flag must be set the same + // way as for dequeueBuffer to ensure that the correct number of buffers are + // allocated. This is most useful to avoid an allocation delay during + // dequeueBuffer. If there are already the maximum number of buffers + // allocated, this function has no effect. + virtual void allocateBuffers(bool async, uint32_t width, uint32_t height, + PixelFormat format, uint32_t usage) = 0; + + // Sets whether dequeueBuffer is allowed to allocate new buffers. + // + // Normally dequeueBuffer does not discriminate between free slots which + // already have an allocated buffer and those which do not, and will + // allocate a new buffer if the slot doesn't have a buffer or if the slot's + // buffer doesn't match the requested size, format, or usage. This method + // allows the producer to restrict the eligible slots to those which already + // have an allocated buffer of the correct size, format, and usage. If no + // eligible slot is available, dequeueBuffer will block or return an error + // as usual. + virtual status_t allowAllocation(bool allow) = 0; + + // Sets the current generation number of the BufferQueue. + // + // This generation number will be inserted into any buffers allocated by the + // BufferQueue, and any attempts to attach a buffer with a different + // generation number will fail. Buffers already in the queue are not + // affected and will retain their current generation number. The generation + // number defaults to 0. + virtual status_t setGenerationNumber(uint32_t generationNumber) = 0; + + // Returns the name of the connected consumer. + virtual String8 getConsumerName() const = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnGraphicBufferProducer : public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_IGRAPHICBUFFERPRODUCER_H diff --git a/third_party/android_frameworks_native/include/gui/IProducerListener.h b/third_party/android_frameworks_native/include/gui/IProducerListener.h new file mode 100644 index 000000000..3848a6c85 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/IProducerListener.h @@ -0,0 +1,67 @@ +/* + * Copyright 2014 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_GUI_IPRODUCERLISTENER_H +#define ANDROID_GUI_IPRODUCERLISTENER_H + +#include + +#include + +namespace android { + +// ProducerListener is the interface through which the BufferQueue notifies the +// producer of events that the producer may wish to react to. Because the +// producer will generally have a mutex that is locked during calls from the +// producer to the BufferQueue, these calls from the BufferQueue to the +// producer *MUST* be called only when the BufferQueue mutex is NOT locked. + +class ProducerListener : public virtual RefBase +{ +public: + ProducerListener() {} + virtual ~ProducerListener() {} + + // onBufferReleased is called from IGraphicBufferConsumer::releaseBuffer to + // notify the producer that a new buffer is free and ready to be dequeued. + // + // This is called without any lock held and can be called concurrently by + // multiple threads. + virtual void onBufferReleased() = 0; // Asynchronous +}; + +class IProducerListener : public ProducerListener, public IInterface +{ +public: + DECLARE_META_INTERFACE(ProducerListener) +}; + +class BnProducerListener : public BnInterface +{ +public: + virtual status_t onTransact(uint32_t code, const Parcel& data, + Parcel* reply, uint32_t flags = 0); +}; + +class DummyProducerListener : public BnProducerListener +{ +public: + virtual void onBufferReleased() {} +}; + +} // namespace android + +#endif diff --git a/third_party/android_frameworks_native/include/gui/ISensorEventConnection.h b/third_party/android_frameworks_native/include/gui/ISensorEventConnection.h new file mode 100644 index 000000000..f64c6b860 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/ISensorEventConnection.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2010 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_GUI_ISENSOR_EVENT_CONNECTION_H +#define ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H + +#include +#include + +#include +#include + +#include + +namespace android { +// ---------------------------------------------------------------------------- + +class BitTube; + +class ISensorEventConnection : public IInterface +{ +public: + DECLARE_META_INTERFACE(SensorEventConnection); + + virtual sp getSensorChannel() const = 0; + virtual status_t enableDisable(int handle, bool enabled, nsecs_t samplingPeriodNs, + nsecs_t maxBatchReportLatencyNs, int reservedFlags) = 0; + virtual status_t setEventRate(int handle, nsecs_t ns) = 0; + virtual status_t flush() = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnSensorEventConnection : public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H diff --git a/third_party/android_frameworks_native/include/gui/ISensorServer.h b/third_party/android_frameworks_native/include/gui/ISensorServer.h new file mode 100644 index 000000000..3dca2a373 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/ISensorServer.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2010 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_GUI_ISENSORSERVER_H +#define ANDROID_GUI_ISENSORSERVER_H + +#include +#include + +#include +#include + +#include + +namespace android { +// ---------------------------------------------------------------------------- + +class Sensor; +class ISensorEventConnection; +class String8; + +class ISensorServer : public IInterface +{ +public: + DECLARE_META_INTERFACE(SensorServer); + + virtual Vector getSensorList(const String16& opPackageName) = 0; + virtual sp createSensorEventConnection(const String8& packageName, + int mode, const String16& opPackageName) = 0; + virtual int32_t isDataInjectionEnabled() = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnSensorServer : public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_ISENSORSERVER_H diff --git a/third_party/android_frameworks_native/include/gui/ISurfaceComposer.h b/third_party/android_frameworks_native/include/gui/ISurfaceComposer.h new file mode 100644 index 000000000..6e3fc5a6d --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/ISurfaceComposer.h @@ -0,0 +1,201 @@ +/* + * Copyright (C) 2006 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_GUI_ISURFACE_COMPOSER_H +#define ANDROID_GUI_ISURFACE_COMPOSER_H + +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include +#include + +namespace android { +// ---------------------------------------------------------------------------- + +class ComposerState; +class DisplayState; +struct DisplayInfo; +struct DisplayStatInfo; +class IDisplayEventConnection; +class IMemoryHeap; +class Rect; + +/* + * This class defines the Binder IPC interface for accessing various + * SurfaceFlinger features. + */ +class ISurfaceComposer: public IInterface { +public: + DECLARE_META_INTERFACE(SurfaceComposer); + + // flags for setTransactionState() + enum { + eSynchronous = 0x01, + eAnimation = 0x02, + }; + + enum { + eDisplayIdMain = 0, + eDisplayIdHdmi = 1, +#ifdef QTI_BSP + eDisplayIdTertiary = 2 +#endif + }; + + enum Rotation { + eRotateNone = 0, + eRotate90 = 1, + eRotate180 = 2, + eRotate270 = 3 + }; + + /* create connection with surface flinger, requires + * ACCESS_SURFACE_FLINGER permission + */ + virtual sp createConnection() = 0; + + /* create a graphic buffer allocator + */ + virtual sp createGraphicBufferAlloc() = 0; + + /* return an IDisplayEventConnection */ + virtual sp createDisplayEventConnection() = 0; + + /* create a virtual display + * requires ACCESS_SURFACE_FLINGER permission. + */ + virtual sp createDisplay(const String8& displayName, + bool secure) = 0; + + /* destroy a virtual display + * requires ACCESS_SURFACE_FLINGER permission. + */ + virtual void destroyDisplay(const sp& display) = 0; + + /* get the token for the existing default displays. possible values + * for id are eDisplayIdMain and eDisplayIdHdmi. + */ + virtual sp getBuiltInDisplay(int32_t id) = 0; + + /* open/close transactions. requires ACCESS_SURFACE_FLINGER permission */ + virtual void setTransactionState(const Vector& state, + const Vector& displays, uint32_t flags) = 0; + + /* signal that we're done booting. + * Requires ACCESS_SURFACE_FLINGER permission + */ + virtual void bootFinished() = 0; + + /* verify that an IGraphicBufferProducer was created by SurfaceFlinger. + */ + virtual bool authenticateSurfaceTexture( + const sp& surface) const = 0; + + /* set display power mode. depending on the mode, it can either trigger + * screen on, off or low power mode and wait for it to complete. + * requires ACCESS_SURFACE_FLINGER permission. + */ + virtual void setPowerMode(const sp& display, int mode) = 0; + + /* returns information for each configuration of the given display + * intended to be used to get information about built-in displays */ + virtual status_t getDisplayConfigs(const sp& display, + Vector* configs) = 0; + + /* returns display statistics for a given display + * intended to be used by the media framework to properly schedule + * video frames */ + virtual status_t getDisplayStats(const sp& display, + DisplayStatInfo* stats) = 0; + + /* indicates which of the configurations returned by getDisplayInfo is + * currently active */ + virtual int getActiveConfig(const sp& display) = 0; + + /* specifies which configuration (of those returned by getDisplayInfo) + * should be used */ + virtual status_t setActiveConfig(const sp& display, int id) = 0; + + /* Capture the specified screen. requires READ_FRAME_BUFFER permission + * This function will fail if there is a secure window on screen. + */ + virtual status_t captureScreen(const sp& display, + const sp& producer, + Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, + uint32_t minLayerZ, uint32_t maxLayerZ, + bool useIdentityTransform, + Rotation rotation = eRotateNone, + bool isCpuConsumer = false) = 0; + + /* Clears the frame statistics for animations. + * + * Requires the ACCESS_SURFACE_FLINGER permission. + */ + virtual status_t clearAnimationFrameStats() = 0; + + /* Gets the frame statistics for animations. + * + * Requires the ACCESS_SURFACE_FLINGER permission. + */ + virtual status_t getAnimationFrameStats(FrameStats* outStats) const = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnSurfaceComposer: public BnInterface { +public: + enum { + // Note: BOOT_FINISHED must remain this value, it is called from + // Java by ActivityManagerService. + BOOT_FINISHED = IBinder::FIRST_CALL_TRANSACTION, + CREATE_CONNECTION, + CREATE_GRAPHIC_BUFFER_ALLOC, + CREATE_DISPLAY_EVENT_CONNECTION, + CREATE_DISPLAY, + DESTROY_DISPLAY, + GET_BUILT_IN_DISPLAY, + SET_TRANSACTION_STATE, + AUTHENTICATE_SURFACE, + GET_DISPLAY_CONFIGS, + GET_ACTIVE_CONFIG, + SET_ACTIVE_CONFIG, + CONNECT_DISPLAY, + CAPTURE_SCREEN, + CLEAR_ANIMATION_FRAME_STATS, + GET_ANIMATION_FRAME_STATS, + SET_POWER_MODE, + GET_DISPLAY_STATS, + }; + + virtual status_t onTransact(uint32_t code, const Parcel& data, + Parcel* reply, uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------------- + +}; // namespace android + +#endif // ANDROID_GUI_ISURFACE_COMPOSER_H diff --git a/third_party/android_frameworks_native/include/gui/ISurfaceComposerClient.h b/third_party/android_frameworks_native/include/gui/ISurfaceComposerClient.h new file mode 100644 index 000000000..d3e8b8ba1 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/ISurfaceComposerClient.h @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2007 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_GUI_ISURFACE_COMPOSER_CLIENT_H +#define ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H + +#include +#include + +#include +#include + +#include + +#include +#include + +namespace android { +// ---------------------------------------------------------------------------- + +class IGraphicBufferProducer; + +class ISurfaceComposerClient : public IInterface +{ +public: + DECLARE_META_INTERFACE(SurfaceComposerClient); + + // flags for createSurface() + enum { // (keep in sync with Surface.java) + eHidden = 0x00000004, + eDestroyBackbuffer = 0x00000020, + eSecure = 0x00000080, + eNonPremultiplied = 0x00000100, + eOpaque = 0x00000400, + eProtectedByApp = 0x00000800, + eProtectedByDRM = 0x00001000, + eCursorWindow = 0x00002000, + + eFXSurfaceNormal = 0x00000000, + eFXSurfaceBlur = 0x00010000, + eFXSurfaceDim = 0x00020000, + eFXSurfaceMask = 0x000F0000, + }; + + /* + * Requires ACCESS_SURFACE_FLINGER permission + */ + virtual status_t createSurface( + const String8& name, uint32_t w, uint32_t h, + PixelFormat format, uint32_t flags, + sp* handle, + sp* gbp) = 0; + + /* + * Requires ACCESS_SURFACE_FLINGER permission + */ + virtual status_t destroySurface(const sp& handle) = 0; + + /* + * Requires ACCESS_SURFACE_FLINGER permission + */ + virtual status_t clearLayerFrameStats(const sp& handle) const = 0; + + /* + * Requires ACCESS_SURFACE_FLINGER permission + */ + virtual status_t getLayerFrameStats(const sp& handle, FrameStats* outStats) const = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnSurfaceComposerClient: public BnInterface { +public: + virtual status_t onTransact(uint32_t code, const Parcel& data, + Parcel* reply, uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------------- + +}; // namespace android + +#endif // ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H diff --git a/third_party/android_frameworks_native/include/gui/Sensor.h b/third_party/android_frameworks_native/include/gui/Sensor.h new file mode 100644 index 000000000..8142be635 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/Sensor.h @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2010 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_GUI_SENSOR_H +#define ANDROID_GUI_SENSOR_H + +#include +#include + +#include +#include +#include +#include + +#include + +#include + +// ---------------------------------------------------------------------------- +// Concrete types for the NDK +struct ASensor { }; + +// ---------------------------------------------------------------------------- +namespace android { +// ---------------------------------------------------------------------------- + +class Parcel; + +// ---------------------------------------------------------------------------- + +class Sensor : public ASensor, public LightFlattenable +{ +public: + enum { + TYPE_ACCELEROMETER = ASENSOR_TYPE_ACCELEROMETER, + TYPE_MAGNETIC_FIELD = ASENSOR_TYPE_MAGNETIC_FIELD, + TYPE_GYROSCOPE = ASENSOR_TYPE_GYROSCOPE, + TYPE_LIGHT = ASENSOR_TYPE_LIGHT, + TYPE_PROXIMITY = ASENSOR_TYPE_PROXIMITY + }; + + Sensor(); + Sensor(struct sensor_t const* hwSensor, int halVersion = 0); + ~Sensor(); + + const String8& getName() const; + const String8& getVendor() const; + int32_t getHandle() const; + int32_t getType() const; + float getMinValue() const; + float getMaxValue() const; + float getResolution() const; + float getPowerUsage() const; + int32_t getMinDelay() const; + nsecs_t getMinDelayNs() const; + int32_t getVersion() const; + uint32_t getFifoReservedEventCount() const; + uint32_t getFifoMaxEventCount() const; + const String8& getStringType() const; + const String8& getRequiredPermission() const; + bool isRequiredPermissionRuntime() const; + int32_t getRequiredAppOp() const; + int32_t getMaxDelay() const; + uint32_t getFlags() const; + bool isWakeUpSensor() const; + int32_t getReportingMode() const; + + // LightFlattenable protocol + inline bool isFixedSize() const { return false; } + size_t getFlattenedSize() const; + status_t flatten(void* buffer, size_t size) const; + status_t unflatten(void const* buffer, size_t size); + +private: + String8 mName; + String8 mVendor; + int32_t mHandle; + int32_t mType; + float mMinValue; + float mMaxValue; + float mResolution; + float mPower; + int32_t mMinDelay; + int32_t mVersion; + uint32_t mFifoReservedEventCount; + uint32_t mFifoMaxEventCount; + String8 mStringType; + String8 mRequiredPermission; + bool mRequiredPermissionRuntime = false; + int32_t mRequiredAppOp; + int32_t mMaxDelay; + uint32_t mFlags; + static void flattenString8(void*& buffer, size_t& size, const String8& string8); + static bool unflattenString8(void const*& buffer, size_t& size, String8& outputString8); +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_SENSOR_H diff --git a/third_party/android_frameworks_native/include/gui/SensorEventQueue.h b/third_party/android_frameworks_native/include/gui/SensorEventQueue.h new file mode 100644 index 000000000..e5b9fc598 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/SensorEventQueue.h @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2010 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_SENSOR_EVENT_QUEUE_H +#define ANDROID_SENSOR_EVENT_QUEUE_H + +#include +#include + +#include +#include +#include +#include + +#include + +// ---------------------------------------------------------------------------- +#define WAKE_UP_SENSOR_EVENT_NEEDS_ACK (1U << 31) +struct ALooper; +struct ASensorEvent; + +// Concrete types for the NDK +struct ASensorEventQueue { + ALooper* looper; +}; + +// ---------------------------------------------------------------------------- +namespace android { +// ---------------------------------------------------------------------------- + +class ISensorEventConnection; +class Sensor; +class Looper; + +// ---------------------------------------------------------------------------- + +class SensorEventQueue : public ASensorEventQueue, public RefBase +{ +public: + + enum { MAX_RECEIVE_BUFFER_EVENT_COUNT = 256 }; + + SensorEventQueue(const sp& connection); + virtual ~SensorEventQueue(); + virtual void onFirstRef(); + + int getFd() const; + + static ssize_t write(const sp& tube, + ASensorEvent const* events, size_t numEvents); + + ssize_t read(ASensorEvent* events, size_t numEvents); + + status_t waitForEvent() const; + status_t wake() const; + + status_t enableSensor(Sensor const* sensor) const; + status_t disableSensor(Sensor const* sensor) const; + status_t setEventRate(Sensor const* sensor, nsecs_t ns) const; + + // these are here only to support SensorManager.java + status_t enableSensor(int32_t handle, int32_t samplingPeriodUs, int maxBatchReportLatencyUs, + int reservedFlags) const; + status_t disableSensor(int32_t handle) const; + status_t flush() const; + // Send an ack for every wake_up sensor event that is set to WAKE_UP_SENSOR_EVENT_NEEDS_ACK. + void sendAck(const ASensorEvent* events, int count); + + status_t injectSensorEvent(const ASensorEvent& event); +private: + sp getLooper() const; + sp mSensorEventConnection; + sp mSensorChannel; + mutable Mutex mLock; + mutable sp mLooper; + ASensorEvent* mRecBuffer; + size_t mAvailable; + size_t mConsumed; + uint32_t mNumAcksToSend; +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_SENSOR_EVENT_QUEUE_H diff --git a/third_party/android_frameworks_native/include/gui/SensorManager.h b/third_party/android_frameworks_native/include/gui/SensorManager.h new file mode 100644 index 000000000..0cff46c07 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/SensorManager.h @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2010 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_GUI_SENSOR_MANAGER_H +#define ANDROID_GUI_SENSOR_MANAGER_H + +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +// ---------------------------------------------------------------------------- +// Concrete types for the NDK +struct ASensorManager { }; + +// ---------------------------------------------------------------------------- +namespace android { +// ---------------------------------------------------------------------------- + +class ISensorServer; +class Sensor; +class SensorEventQueue; +// ---------------------------------------------------------------------------- + +class SensorManager : + public ASensorManager +{ +public: + static SensorManager& getInstanceForPackage(const String16& packageName); + ~SensorManager(); + + ssize_t getSensorList(Sensor const* const** list) const; + Sensor const* getDefaultSensor(int type); + sp createEventQueue(String8 packageName = String8(""), int mode = 0); + bool isDataInjectionEnabled(); + +private: + // DeathRecipient interface + void sensorManagerDied(); + + SensorManager(const String16& opPackageName); + status_t assertStateLocked() const; + +private: + static Mutex sLock; + static std::map sPackageInstances; + + mutable Mutex mLock; + mutable sp mSensorServer; + mutable Sensor const** mSensorList; + mutable Vector mSensors; + mutable sp mDeathObserver; + const String16 mOpPackageName; +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_SENSOR_MANAGER_H diff --git a/third_party/android_frameworks_native/include/gui/StreamSplitter.h b/third_party/android_frameworks_native/include/gui/StreamSplitter.h new file mode 100644 index 000000000..8f47eb47a --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/StreamSplitter.h @@ -0,0 +1,184 @@ +/* + * Copyright 2014 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_GUI_STREAMSPLITTER_H +#define ANDROID_GUI_STREAMSPLITTER_H + +#include +#include + +#include +#include +#include +#include + +namespace android { + +class GraphicBuffer; +class IGraphicBufferConsumer; +class IGraphicBufferProducer; + +// StreamSplitter is an autonomous class that manages one input BufferQueue +// and multiple output BufferQueues. By using the buffer attach and detach logic +// in BufferQueue, it is able to present the illusion of a single split +// BufferQueue, where each buffer queued to the input is available to be +// acquired by each of the outputs, and is able to be dequeued by the input +// again only once all of the outputs have released it. +class StreamSplitter : public BnConsumerListener { +public: + // createSplitter creates a new splitter, outSplitter, using inputQueue as + // the input BufferQueue. Output BufferQueues must be added using addOutput + // before queueing any buffers to the input. + // + // A return value other than NO_ERROR means that an error has occurred and + // outSplitter has not been modified. BAD_VALUE is returned if inputQueue or + // outSplitter is NULL. See IGraphicBufferConsumer::consumerConnect for + // explanations of other error codes. + static status_t createSplitter(const sp& inputQueue, + sp* outSplitter); + + // addOutput adds an output BufferQueue to the splitter. The splitter + // connects to outputQueue as a CPU producer, and any buffers queued + // to the input will be queued to each output. It is assumed that all of the + // outputs are added before any buffers are queued on the input. If any + // output is abandoned by its consumer, the splitter will abandon its input + // queue (see onAbandoned). + // + // A return value other than NO_ERROR means that an error has occurred and + // outputQueue has not been added to the splitter. BAD_VALUE is returned if + // outputQueue is NULL. See IGraphicBufferProducer::connect for explanations + // of other error codes. + status_t addOutput(const sp& outputQueue); + + // setName sets the consumer name of the input queue + void setName(const String8& name); + +private: + // From IConsumerListener + // + // During this callback, we store some tracking information, detach the + // buffer from the input, and attach it to each of the outputs. This call + // can block if there are too many outstanding buffers. If it blocks, it + // will resume when onBufferReleasedByOutput releases a buffer back to the + // input. + virtual void onFrameAvailable(const BufferItem& item); + + // From IConsumerListener + // We don't care about released buffers because we detach each buffer as + // soon as we acquire it. See the comment for onBufferReleased below for + // some clarifying notes about the name. + virtual void onBuffersReleased() {} + + // From IConsumerListener + // We don't care about sideband streams, since we won't be splitting them + virtual void onSidebandStreamChanged() {} + + // This is the implementation of the onBufferReleased callback from + // IProducerListener. It gets called from an OutputListener (see below), and + // 'from' is which producer interface from which the callback was received. + // + // During this callback, we detach the buffer from the output queue that + // generated the callback, update our state tracking to see if this is the + // last output releasing the buffer, and if so, release it to the input. + // If we release the buffer to the input, we allow a blocked + // onFrameAvailable call to proceed. + void onBufferReleasedByOutput(const sp& from); + + // When this is called, the splitter disconnects from (i.e., abandons) its + // input queue and signals any waiting onFrameAvailable calls to wake up. + // It still processes callbacks from other outputs, but only detaches their + // buffers so they can continue operating until they run out of buffers to + // acquire. This must be called with mMutex locked. + void onAbandonedLocked(); + + // This is a thin wrapper class that lets us determine which BufferQueue + // the IProducerListener::onBufferReleased callback is associated with. We + // create one of these per output BufferQueue, and then pass the producer + // into onBufferReleasedByOutput above. + class OutputListener : public BnProducerListener, + public IBinder::DeathRecipient { + public: + OutputListener(const sp& splitter, + const sp& output); + virtual ~OutputListener(); + + // From IProducerListener + virtual void onBufferReleased(); + + // From IBinder::DeathRecipient + virtual void binderDied(const wp& who); + + private: + sp mSplitter; + sp mOutput; + }; + + class BufferTracker : public LightRefBase { + public: + BufferTracker(const sp& buffer); + + const sp& getBuffer() const { return mBuffer; } + const sp& getMergedFence() const { return mMergedFence; } + + void mergeFence(const sp& with); + + // Returns the new value + // Only called while mMutex is held + size_t incrementReleaseCountLocked() { return ++mReleaseCount; } + + private: + // Only destroy through LightRefBase + friend LightRefBase; + ~BufferTracker(); + + // Disallow copying + BufferTracker(const BufferTracker& other); + BufferTracker& operator=(const BufferTracker& other); + + sp mBuffer; // One instance that holds this native handle + sp mMergedFence; + size_t mReleaseCount; + }; + + // Only called from createSplitter + StreamSplitter(const sp& inputQueue); + + // Must be accessed through RefBase + virtual ~StreamSplitter(); + + static const int MAX_OUTSTANDING_BUFFERS = 2; + + // mIsAbandoned is set to true when an output dies. Once the StreamSplitter + // has been abandoned, it will continue to detach buffers from other + // outputs, but it will disconnect from the input and not attempt to + // communicate with it further. + bool mIsAbandoned; + + Mutex mMutex; + Condition mReleaseCondition; + int mOutstandingBuffers; + sp mInput; + Vector > mOutputs; + + // Map of GraphicBuffer IDs (GraphicBuffer::getId()) to buffer tracking + // objects (which are mostly for counting how many outputs have released the + // buffer, but also contain merged release fences). + KeyedVector > mBuffers; +}; + +} // namespace android + +#endif diff --git a/third_party/android_frameworks_native/include/gui/Surface.h b/third_party/android_frameworks_native/include/gui/Surface.h new file mode 100644 index 000000000..72f106707 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/Surface.h @@ -0,0 +1,324 @@ +/* + * Copyright (C) 2010 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_GUI_SURFACE_H +#define ANDROID_GUI_SURFACE_H + +#include +#include + +#include +#include + +#include +#include +#include + +struct ANativeWindow_Buffer; + +namespace android { + +/* + * An implementation of ANativeWindow that feeds graphics buffers into a + * BufferQueue. + * + * This is typically used by programs that want to render frames through + * some means (maybe OpenGL, a software renderer, or a hardware decoder) + * and have the frames they create forwarded to SurfaceFlinger for + * compositing. For example, a video decoder could render a frame and call + * eglSwapBuffers(), which invokes ANativeWindow callbacks defined by + * Surface. Surface then forwards the buffers through Binder IPC + * to the BufferQueue's producer interface, providing the new frame to a + * consumer such as GLConsumer. + */ +class Surface + : public ANativeObjectBase +{ +public: + + /* + * creates a Surface from the given IGraphicBufferProducer (which concrete + * implementation is a BufferQueue). + * + * Surface is mainly state-less while it's disconnected, it can be + * viewed as a glorified IGraphicBufferProducer holder. It's therefore + * safe to create other Surfaces from the same IGraphicBufferProducer. + * + * However, once a Surface is connected, it'll prevent other Surfaces + * referring to the same IGraphicBufferProducer to become connected and + * therefore prevent them to be used as actual producers of buffers. + * + * the controlledByApp flag indicates that this Surface (producer) is + * controlled by the application. This flag is used at connect time. + */ + Surface(const sp& bufferProducer, bool controlledByApp = false); + + /* getIGraphicBufferProducer() returns the IGraphicBufferProducer this + * Surface was created with. Usually it's an error to use the + * IGraphicBufferProducer while the Surface is connected. + */ + sp getIGraphicBufferProducer() const; + + /* convenience function to check that the given surface is non NULL as + * well as its IGraphicBufferProducer */ + static bool isValid(const sp& surface) { + return surface != NULL && surface->getIGraphicBufferProducer() != NULL; + } + + /* Attaches a sideband buffer stream to the Surface's IGraphicBufferProducer. + * + * A sideband stream is a device-specific mechanism for passing buffers + * from the producer to the consumer without using dequeueBuffer/ + * queueBuffer. If a sideband stream is present, the consumer can choose + * whether to acquire buffers from the sideband stream or from the queued + * buffers. + * + * Passing NULL or a different stream handle will detach the previous + * handle if any. + */ + void setSidebandStream(const sp& stream); + + /* Allocates buffers based on the current dimensions/format. + * + * This function will allocate up to the maximum number of buffers + * permitted by the current BufferQueue configuration. It will use the + * default format and dimensions. This is most useful to avoid an allocation + * delay during dequeueBuffer. If there are already the maximum number of + * buffers allocated, this function has no effect. + */ + void allocateBuffers(); + + /* Sets the generation number on the IGraphicBufferProducer and updates the + * generation number on any buffers attached to the Surface after this call. + * See IGBP::setGenerationNumber for more information. */ + status_t setGenerationNumber(uint32_t generationNumber); + + // See IGraphicBufferProducer::getConsumerName + String8 getConsumerName() const; + +protected: + virtual ~Surface(); + +private: + // can't be copied + Surface& operator = (const Surface& rhs); + Surface(const Surface& rhs); + + // ANativeWindow hooks + static int hook_cancelBuffer(ANativeWindow* window, + ANativeWindowBuffer* buffer, int fenceFd); + static int hook_dequeueBuffer(ANativeWindow* window, + ANativeWindowBuffer** buffer, int* fenceFd); + static int hook_perform(ANativeWindow* window, int operation, ...); + static int hook_query(const ANativeWindow* window, int what, int* value); + static int hook_queueBuffer(ANativeWindow* window, + ANativeWindowBuffer* buffer, int fenceFd); + static int hook_setSwapInterval(ANativeWindow* window, int interval); + + static int hook_cancelBuffer_DEPRECATED(ANativeWindow* window, + ANativeWindowBuffer* buffer); + static int hook_dequeueBuffer_DEPRECATED(ANativeWindow* window, + ANativeWindowBuffer** buffer); + static int hook_lockBuffer_DEPRECATED(ANativeWindow* window, + ANativeWindowBuffer* buffer); + static int hook_queueBuffer_DEPRECATED(ANativeWindow* window, + ANativeWindowBuffer* buffer); + + int dispatchConnect(va_list args); + int dispatchDisconnect(va_list args); + int dispatchSetBufferCount(va_list args); + int dispatchSetBuffersGeometry(va_list args); + int dispatchSetBuffersDimensions(va_list args); + int dispatchSetBuffersUserDimensions(va_list args); + int dispatchSetBuffersFormat(va_list args); + int dispatchSetScalingMode(va_list args); + int dispatchSetBuffersTransform(va_list args); + int dispatchSetBuffersStickyTransform(va_list args); + int dispatchSetBuffersTimestamp(va_list args); + int dispatchSetCrop(va_list args); + int dispatchSetPostTransformCrop(va_list args); + int dispatchSetUsage(va_list args); + int dispatchLock(va_list args); + int dispatchUnlockAndPost(va_list args); + int dispatchSetSidebandStream(va_list args); + int dispatchSetBuffersDataSpace(va_list args); + int dispatchSetSurfaceDamage(va_list args); + +protected: + virtual int dequeueBuffer(ANativeWindowBuffer** buffer, int* fenceFd); + virtual int cancelBuffer(ANativeWindowBuffer* buffer, int fenceFd); + virtual int queueBuffer(ANativeWindowBuffer* buffer, int fenceFd); + virtual int perform(int operation, va_list args); + virtual int query(int what, int* value) const; + virtual int setSwapInterval(int interval); + + virtual int lockBuffer_DEPRECATED(ANativeWindowBuffer* buffer); + + virtual int connect(int api); + virtual int disconnect(int api); + virtual int setBufferCount(int bufferCount); + virtual int setBuffersDimensions(uint32_t width, uint32_t height); + virtual int setBuffersUserDimensions(uint32_t width, uint32_t height); + virtual int setBuffersFormat(PixelFormat format); + virtual int setScalingMode(int mode); + virtual int setBuffersTransform(uint32_t transform); + virtual int setBuffersStickyTransform(uint32_t transform); + virtual int setBuffersTimestamp(int64_t timestamp); + virtual int setBuffersDataSpace(android_dataspace dataSpace); + virtual int setCrop(Rect const* rect); + virtual int setUsage(uint32_t reqUsage); + virtual void setSurfaceDamage(android_native_rect_t* rects, size_t numRects); + +public: + virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds); + virtual int unlockAndPost(); + + virtual int connect(int api, const sp& listener); + virtual int detachNextBuffer(sp* outBuffer, + sp* outFence); + virtual int attachBuffer(ANativeWindowBuffer*); + +protected: + enum { NUM_BUFFER_SLOTS = BufferQueue::NUM_BUFFER_SLOTS }; + enum { DEFAULT_FORMAT = PIXEL_FORMAT_RGBA_8888 }; + +private: + void freeAllBuffers(); + int getSlotFromBufferLocked(android_native_buffer_t* buffer) const; + + struct BufferSlot { + sp buffer; + Region dirtyRegion; + }; + + // mSurfaceTexture is the interface to the surface texture server. All + // operations on the surface texture client ultimately translate into + // interactions with the server using this interface. + // TODO: rename to mBufferProducer + sp mGraphicBufferProducer; + + // mSlots stores the buffers that have been allocated for each buffer slot. + // It is initialized to null pointers, and gets filled in with the result of + // IGraphicBufferProducer::requestBuffer when the client dequeues a buffer from a + // slot that has not yet been used. The buffer allocated to a slot will also + // be replaced if the requested buffer usage or geometry differs from that + // of the buffer allocated to a slot. + BufferSlot mSlots[NUM_BUFFER_SLOTS]; + + // mReqWidth is the buffer width that will be requested at the next dequeue + // operation. It is initialized to 1. + uint32_t mReqWidth; + + // mReqHeight is the buffer height that will be requested at the next + // dequeue operation. It is initialized to 1. + uint32_t mReqHeight; + + // mReqFormat is the buffer pixel format that will be requested at the next + // deuque operation. It is initialized to PIXEL_FORMAT_RGBA_8888. + PixelFormat mReqFormat; + + // mReqUsage is the set of buffer usage flags that will be requested + // at the next deuque operation. It is initialized to 0. + uint32_t mReqUsage; + + // mTimestamp is the timestamp that will be used for the next buffer queue + // operation. It defaults to NATIVE_WINDOW_TIMESTAMP_AUTO, which means that + // a timestamp is auto-generated when queueBuffer is called. + int64_t mTimestamp; + + // mDataSpace is the buffer dataSpace that will be used for the next buffer + // queue operation. It defaults to HAL_DATASPACE_UNKNOWN, which + // means that the buffer contains some type of color data. + android_dataspace mDataSpace; + + // mCrop is the crop rectangle that will be used for the next buffer + // that gets queued. It is set by calling setCrop. + Rect mCrop; + + // mScalingMode is the scaling mode that will be used for the next + // buffers that get queued. It is set by calling setScalingMode. + int mScalingMode; + + // mTransform is the transform identifier that will be used for the next + // buffer that gets queued. It is set by calling setTransform. + uint32_t mTransform; + + // mStickyTransform is a transform that is applied on top of mTransform + // in each buffer that is queued. This is typically used to force the + // compositor to apply a transform, and will prevent the transform hint + // from being set by the compositor. + uint32_t mStickyTransform; + + // mDefaultWidth is default width of the buffers, regardless of the + // native_window_set_buffers_dimensions call. + uint32_t mDefaultWidth; + + // mDefaultHeight is default height of the buffers, regardless of the + // native_window_set_buffers_dimensions call. + uint32_t mDefaultHeight; + + // mUserWidth, if non-zero, is an application-specified override + // of mDefaultWidth. This is lower priority than the width set by + // native_window_set_buffers_dimensions. + uint32_t mUserWidth; + + // mUserHeight, if non-zero, is an application-specified override + // of mDefaultHeight. This is lower priority than the height set + // by native_window_set_buffers_dimensions. + uint32_t mUserHeight; + + // mTransformHint is the transform probably applied to buffers of this + // window. this is only a hint, actual transform may differ. + uint32_t mTransformHint; + + // mProducerControlledByApp whether this buffer producer is controlled + // by the application + bool mProducerControlledByApp; + + // mSwapIntervalZero set if we should drop buffers at queue() time to + // achieve an asynchronous swap interval + bool mSwapIntervalZero; + + // mConsumerRunningBehind whether the consumer is running more than + // one buffer behind the producer. + mutable bool mConsumerRunningBehind; + + // mMutex is the mutex used to prevent concurrent access to the member + // variables of Surface objects. It must be locked whenever the + // member variables are accessed. + mutable Mutex mMutex; + + // must be used from the lock/unlock thread + sp mLockedBuffer; + sp mPostedBuffer; + bool mConnectedToCpu; + + // When a CPU producer is attached, this reflects the region that the + // producer wished to update as well as whether the Surface was able to copy + // the previous buffer back to allow a partial update. + // + // When a non-CPU producer is attached, this reflects the surface damage + // (the change since the previous frame) passed in by the producer. + Region mDirtyRegion; + + // Stores the current generation number. See setGenerationNumber and + // IGraphicBufferProducer::setGenerationNumber for more information. + uint32_t mGenerationNumber; +}; + +}; // namespace android + +#endif // ANDROID_GUI_SURFACE_H diff --git a/third_party/android_frameworks_native/include/gui/SurfaceComposerClient.h b/third_party/android_frameworks_native/include/gui/SurfaceComposerClient.h new file mode 100644 index 000000000..9ec3f2349 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/SurfaceComposerClient.h @@ -0,0 +1,242 @@ +/* + * Copyright (C) 2007 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_GUI_SURFACE_COMPOSER_CLIENT_H +#define ANDROID_GUI_SURFACE_COMPOSER_CLIENT_H + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +namespace android { + +// --------------------------------------------------------------------------- + +class DisplayInfo; +class Composer; +class ISurfaceComposerClient; +class IGraphicBufferProducer; +class Region; + +// --------------------------------------------------------------------------- + +class SurfaceComposerClient : public RefBase +{ + friend class Composer; +public: + SurfaceComposerClient(); + virtual ~SurfaceComposerClient(); + + // Always make sure we could initialize + status_t initCheck() const; + + // Return the connection of this client + sp connection() const; + + // Forcibly remove connection before all references have gone away. + void dispose(); + + // callback when the composer is dies + status_t linkToComposerDeath(const sp& recipient, + void* cookie = NULL, uint32_t flags = 0); + + // Get a list of supported configurations for a given display + static status_t getDisplayConfigs(const sp& display, + Vector* configs); + + // Get the DisplayInfo for the currently-active configuration + static status_t getDisplayInfo(const sp& display, + DisplayInfo* info); + + // Get the index of the current active configuration (relative to the list + // returned by getDisplayInfo) + static int getActiveConfig(const sp& display); + + // Set a new active configuration using an index relative to the list + // returned by getDisplayInfo + static status_t setActiveConfig(const sp& display, int id); + + /* Triggers screen on/off or low power mode and waits for it to complete */ + static void setDisplayPowerMode(const sp& display, int mode); + + // ------------------------------------------------------------------------ + // surface creation / destruction + + //! Create a surface + sp createSurface( + const String8& name,// name of the surface + uint32_t w, // width in pixel + uint32_t h, // height in pixel + PixelFormat format, // pixel-format desired + uint32_t flags = 0 // usage flags + ); + + //! Create a virtual display + static sp createDisplay(const String8& displayName, bool secure); + + //! Destroy a virtual display + static void destroyDisplay(const sp& display); + + //! Get the token for the existing default displays. + //! Possible values for id are eDisplayIdMain and eDisplayIdHdmi. + static sp getBuiltInDisplay(int32_t id); + + // ------------------------------------------------------------------------ + // Composer parameters + // All composer parameters must be changed within a transaction + // several surfaces can be updated in one transaction, all changes are + // committed at once when the transaction is closed. + // closeGlobalTransaction() requires an IPC with the server. + + //! Open a composer transaction on all active SurfaceComposerClients. + static void openGlobalTransaction(); + + //! Close a composer transaction on all active SurfaceComposerClients. + static void closeGlobalTransaction(bool synchronous = false); + + //! Flag the currently open transaction as an animation transaction. + static void setAnimationTransaction(); + + status_t hide(const sp& id); + status_t show(const sp& id); + status_t setFlags(const sp& id, uint32_t flags, uint32_t mask); + status_t setTransparentRegionHint(const sp& id, const Region& transparent); + status_t setLayer(const sp& id, uint32_t layer); + status_t setAlpha(const sp& id, float alpha=1.0f); + status_t setMatrix(const sp& id, float dsdx, float dtdx, float dsdy, float dtdy); + status_t setPosition(const sp& id, float x, float y); + status_t setSize(const sp& id, uint32_t w, uint32_t h); + status_t setCrop(const sp& id, const Rect& crop); + status_t setLayerStack(const sp& id, uint32_t layerStack); + status_t destroySurface(const sp& id); + + status_t clearLayerFrameStats(const sp& token) const; + status_t getLayerFrameStats(const sp& token, FrameStats* outStats) const; + + static status_t clearAnimationFrameStats(); + static status_t getAnimationFrameStats(FrameStats* outStats); + + static void setDisplaySurface(const sp& token, + const sp& bufferProducer); + static void setDisplayLayerStack(const sp& token, + uint32_t layerStack); + static void setDisplaySize(const sp& token, uint32_t width, uint32_t height); + + /* setDisplayProjection() defines the projection of layer stacks + * to a given display. + * + * - orientation defines the display's orientation. + * - layerStackRect defines which area of the window manager coordinate + * space will be used. + * - displayRect defines where on the display will layerStackRect be + * mapped to. displayRect is specified post-orientation, that is + * it uses the orientation seen by the end-user. + */ + static void setDisplayProjection(const sp& token, + uint32_t orientation, + const Rect& layerStackRect, + const Rect& displayRect); + + status_t setBlur(const sp& id, float blur); + status_t setBlurMaskSurface(const sp& id, const sp& maskSurfaceId); + status_t setBlurMaskSampling(const sp& id, uint32_t blurMaskSampling); + status_t setBlurMaskAlphaThreshold(const sp& id, float alpha); + +private: + virtual void onFirstRef(); + Composer& getComposer(); + + mutable Mutex mLock; + status_t mStatus; + sp mClient; + Composer& mComposer; +}; + +// --------------------------------------------------------------------------- + +class ScreenshotClient +{ +public: + // if cropping isn't required, callers may pass in a default Rect, e.g.: + // capture(display, producer, Rect(), reqWidth, ...); + static status_t capture( + const sp& display, + const sp& producer, + Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, + uint32_t minLayerZ, uint32_t maxLayerZ, + bool useIdentityTransform); + +private: + mutable sp mCpuConsumer; + mutable sp mProducer; + CpuConsumer::LockedBuffer mBuffer; + bool mHaveBuffer; + +public: + ScreenshotClient(); + ~ScreenshotClient(); + + // frees the previous screenshot and captures a new one + // if cropping isn't required, callers may pass in a default Rect, e.g.: + // update(display, Rect(), useIdentityTransform); + status_t update(const sp& display, + Rect sourceCrop, bool useIdentityTransform); + status_t update(const sp& display, + Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, + bool useIdentityTransform); + status_t update(const sp& display, + Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, + uint32_t minLayerZ, uint32_t maxLayerZ, + bool useIdentityTransform); + status_t update(const sp& display, + Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, + uint32_t minLayerZ, uint32_t maxLayerZ, + bool useIdentityTransform, uint32_t rotation); + + sp getCpuConsumer() const; + + // release memory occupied by the screenshot + void release(); + + // pixels are valid until this object is freed or + // release() or update() is called + void const* getPixels() const; + + uint32_t getWidth() const; + uint32_t getHeight() const; + PixelFormat getFormat() const; + uint32_t getStride() const; + // size of allocated memory in bytes + size_t getSize() const; +}; + +// --------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_SURFACE_COMPOSER_CLIENT_H diff --git a/third_party/android_frameworks_native/include/gui/SurfaceControl.h b/third_party/android_frameworks_native/include/gui/SurfaceControl.h new file mode 100644 index 000000000..5fa45d166 --- /dev/null +++ b/third_party/android_frameworks_native/include/gui/SurfaceControl.h @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2007 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_GUI_SURFACE_CONTROL_H +#define ANDROID_GUI_SURFACE_CONTROL_H + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include + +namespace android { + +// --------------------------------------------------------------------------- + +class IGraphicBufferProducer; +class Surface; +class SurfaceComposerClient; + +// --------------------------------------------------------------------------- + +class SurfaceControl : public RefBase +{ +public: + static bool isValid(const sp& surface) { + return (surface != 0) && surface->isValid(); + } + + bool isValid() { + return mHandle!=0 && mClient!=0; + } + + static bool isSameSurface( + const sp& lhs, const sp& rhs); + + // release surface data from java + void clear(); + + status_t setLayerStack(uint32_t layerStack); + status_t setLayer(uint32_t layer); + status_t setPosition(float x, float y); + status_t setSize(uint32_t w, uint32_t h); + status_t hide(); + status_t show(); + status_t setFlags(uint32_t flags, uint32_t mask); + status_t setTransparentRegionHint(const Region& transparent); + status_t setAlpha(float alpha=1.0f); + status_t setMatrix(float dsdx, float dtdx, float dsdy, float dtdy); + status_t setCrop(const Rect& crop); + + static status_t writeSurfaceToParcel( + const sp& control, Parcel* parcel); + + sp getSurface() const; + + status_t clearLayerFrameStats() const; + status_t getLayerFrameStats(FrameStats* outStats) const; + + status_t setBlur(float blur = 0); + status_t setBlurMaskSurface(const sp& maskSurface); + status_t setBlurMaskSampling(uint32_t blurMaskSampling); + status_t setBlurMaskAlphaThreshold(float alpha); + +private: + // can't be copied + SurfaceControl& operator = (SurfaceControl& rhs); + SurfaceControl(const SurfaceControl& rhs); + + friend class SurfaceComposerClient; + friend class Surface; + + SurfaceControl( + const sp& client, + const sp& handle, + const sp& gbp); + + ~SurfaceControl(); + + status_t validate() const; + void destroy(); + + sp mClient; + sp mHandle; + sp mGraphicBufferProducer; + mutable Mutex mLock; + mutable sp mSurfaceData; +}; + +}; // namespace android + +#endif // ANDROID_GUI_SURFACE_CONTROL_H diff --git a/third_party/android_frameworks_native/include/ui/ANativeObjectBase.h b/third_party/android_frameworks_native/include/ui/ANativeObjectBase.h new file mode 100644 index 000000000..76e850fa2 --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/ANativeObjectBase.h @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2009 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_ANDROID_NATIVES_H +#define ANDROID_ANDROID_NATIVES_H + +#include +#include + +#include +#include + +// --------------------------------------------------------------------------- + +/* FIXME: this is legacy for pixmaps */ +typedef struct egl_native_pixmap_t +{ + int32_t version; /* must be 32 */ + int32_t width; + int32_t height; + int32_t stride; + uint8_t* data; + uint8_t format; + uint8_t rfu[3]; + union { + uint32_t compressedFormat; + int32_t vstride; + }; + int32_t reserved; +} egl_native_pixmap_t; + +/*****************************************************************************/ + +#ifdef __cplusplus + +#include + +namespace android { + +/* + * This helper class turns a ANativeXXX object type into a C++ + * reference-counted object; with proper type conversions. + */ +template +class ANativeObjectBase : public NATIVE_TYPE, public REF +{ +public: + // Disambiguate between the incStrong in REF and NATIVE_TYPE + void incStrong(const void* id) const { + REF::incStrong(id); + } + void decStrong(const void* id) const { + REF::decStrong(id); + } + +protected: + typedef ANativeObjectBase BASE; + ANativeObjectBase() : NATIVE_TYPE(), REF() { + NATIVE_TYPE::common.incRef = incRef; + NATIVE_TYPE::common.decRef = decRef; + } + static inline TYPE* getSelf(NATIVE_TYPE* self) { + return static_cast(self); + } + static inline TYPE const* getSelf(NATIVE_TYPE const* self) { + return static_cast(self); + } + static inline TYPE* getSelf(android_native_base_t* base) { + return getSelf(reinterpret_cast(base)); + } + static inline TYPE const * getSelf(android_native_base_t const* base) { + return getSelf(reinterpret_cast(base)); + } + static void incRef(android_native_base_t* base) { + ANativeObjectBase* self = getSelf(base); + self->incStrong(self); + } + static void decRef(android_native_base_t* base) { + ANativeObjectBase* self = getSelf(base); + self->decStrong(self); + } +}; + +} // namespace android +#endif // __cplusplus + +/*****************************************************************************/ + +#endif /* ANDROID_ANDROID_NATIVES_H */ diff --git a/third_party/android_frameworks_native/include/ui/DisplayInfo.h b/third_party/android_frameworks_native/include/ui/DisplayInfo.h new file mode 100644 index 000000000..ad73ee72f --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/DisplayInfo.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2007 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_UI_DISPLAY_INFO_H +#define ANDROID_UI_DISPLAY_INFO_H + +#include +#include +#include + +#include + +namespace android { + +struct DisplayInfo { + uint32_t w; + uint32_t h; + float xdpi; + float ydpi; + float fps; + float density; + uint8_t orientation; + bool secure; + nsecs_t appVsyncOffset; + nsecs_t presentationDeadline; + int colorTransform; +}; + +/* Display orientations as defined in Surface.java and ISurfaceComposer.h. */ +enum { + DISPLAY_ORIENTATION_0 = 0, + DISPLAY_ORIENTATION_90 = 1, + DISPLAY_ORIENTATION_180 = 2, + DISPLAY_ORIENTATION_270 = 3 +}; + +}; // namespace android + +#endif // ANDROID_COMPOSER_DISPLAY_INFO_H diff --git a/third_party/android_frameworks_native/include/ui/DisplayStatInfo.h b/third_party/android_frameworks_native/include/ui/DisplayStatInfo.h new file mode 100644 index 000000000..0549a832b --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/DisplayStatInfo.h @@ -0,0 +1,31 @@ +/* + * Copyright 2014 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_UI_DISPLAY_STAT_INFO_H +#define ANDROID_UI_DISPLAY_STAT_INFO_H + +#include + +namespace android { + +struct DisplayStatInfo { + nsecs_t vsyncTime; + nsecs_t vsyncPeriod; +}; + +}; // namespace android + +#endif // ANDROID_COMPOSER_DISPLAY_STAT_INFO_H diff --git a/third_party/android_frameworks_native/include/ui/Fence.h b/third_party/android_frameworks_native/include/ui/Fence.h new file mode 100644 index 000000000..b431bd52a --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/Fence.h @@ -0,0 +1,117 @@ +/* + * 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_FENCE_H +#define ANDROID_FENCE_H + +#include +#include + +#include +#include +#include +#include +#include +#include + +struct ANativeWindowBuffer; + +namespace android { + +// =========================================================================== +// Fence +// =========================================================================== + +class Fence + : public LightRefBase, public Flattenable +{ +public: + static const sp NO_FENCE; + + // TIMEOUT_NEVER may be passed to the wait method to indicate that it + // should wait indefinitely for the fence to signal. + enum { TIMEOUT_NEVER = -1 }; + + // Construct a new Fence object with an invalid file descriptor. This + // should be done when the Fence object will be set up by unflattening + // serialized data. + Fence(); + + // Construct a new Fence object to manage a given fence file descriptor. + // When the new Fence object is destructed the file descriptor will be + // closed. + Fence(int fenceFd); + + // Check whether the Fence has an open fence file descriptor. Most Fence + // methods treat an invalid file descriptor just like a valid fence that + // is already signalled, so using this is usually not necessary. + bool isValid() const { return mFenceFd != -1; } + + // wait waits for up to timeout milliseconds for the fence to signal. If + // the fence signals then NO_ERROR is returned. If the timeout expires + // before the fence signals then -ETIME is returned. A timeout of + // TIMEOUT_NEVER may be used to indicate that the call should wait + // indefinitely for the fence to signal. + status_t wait(int timeout); + + // waitForever is a convenience function for waiting forever for a fence to + // signal (just like wait(TIMEOUT_NEVER)), but issuing an error to the + // system log and fence state to the kernel log if the wait lasts longer + // than a warning timeout. + // The logname argument should be a string identifying + // the caller and will be included in the log message. + status_t waitForever(const char* logname); + + // merge combines two Fence objects, creating a new Fence object that + // becomes signaled when both f1 and f2 are signaled (even if f1 or f2 is + // destroyed before it becomes signaled). The name argument specifies the + // human-readable name to associated with the new Fence object. + static sp merge(const String8& name, const sp& f1, + const sp& f2); + + // Return a duplicate of the fence file descriptor. The caller is + // responsible for closing the returned file descriptor. On error, -1 will + // be returned and errno will indicate the problem. + int dup() const; + + // getSignalTime returns the system monotonic clock time at which the + // fence transitioned to the signaled state. If the fence is not signaled + // then INT64_MAX is returned. If the fence is invalid or if an error + // occurs then -1 is returned. + nsecs_t getSignalTime() const; + + // Flattenable interface + size_t getFlattenedSize() const; + size_t getFdCount() const; + status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const; + status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count); + +private: + // Only allow instantiation using ref counting. + friend class LightRefBase; + ~Fence(); + + // Disallow copying + Fence(const Fence& rhs); + Fence& operator = (const Fence& rhs); + const Fence& operator = (const Fence& rhs) const; + + int mFenceFd; +}; + +}; // namespace android + +#endif // ANDROID_FENCE_H diff --git a/third_party/android_frameworks_native/include/ui/FrameStats.h b/third_party/android_frameworks_native/include/ui/FrameStats.h new file mode 100644 index 000000000..6bfe635c7 --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/FrameStats.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2014 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_UI_FRAME_STATS_H +#define ANDROID_UI_FRAME_STATS_H + +#include +#include +#include + +namespace android { + +class FrameStats : public LightFlattenable { +public: + FrameStats() : refreshPeriodNano(0) {}; + + /* + * Approximate refresh time, in nanoseconds. + */ + nsecs_t refreshPeriodNano; + + /* + * The times in nanoseconds for when the frame contents were posted by the producer (e.g. + * the application). They are either explicitly set or defaulted to the time when + * Surface::queueBuffer() was called. + */ + Vector desiredPresentTimesNano; + + /* + * The times in milliseconds for when the frame contents were presented on the screen. + */ + Vector actualPresentTimesNano; + + /* + * The times in nanoseconds for when the frame contents were ready to be presented. Note that + * a frame can be posted and still it contents being rendered asynchronously in GL. In such a + * case these are the times when the frame contents were completely rendered (i.e. their fences + * signaled). + */ + Vector frameReadyTimesNano; + + // LightFlattenable + bool isFixedSize() const; + size_t getFlattenedSize() const; + status_t flatten(void* buffer, size_t size) const; + status_t unflatten(void const* buffer, size_t size); +}; + +}; // namespace android + +#endif // ANDROID_UI_FRAME_STATS_H diff --git a/third_party/android_frameworks_native/include/ui/FramebufferNativeWindow.h b/third_party/android_frameworks_native/include/ui/FramebufferNativeWindow.h new file mode 100644 index 000000000..6b66d5f66 --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/FramebufferNativeWindow.h @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2007 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 INCLUDED_FROM_FRAMEBUFFER_NATIVE_WINDOW_CPP +#warning "FramebufferNativeWindow is deprecated" +#endif + +#ifndef ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H +#define ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H + +#include +#include + +#include + +#include +#include + +#include +#include + +#define MIN_NUM_FRAME_BUFFERS 2 +#define MAX_NUM_FRAME_BUFFERS 3 + +extern "C" EGLNativeWindowType android_createDisplaySurface(void); + +// --------------------------------------------------------------------------- +namespace android { +// --------------------------------------------------------------------------- + +class Surface; +class NativeBuffer; + +// --------------------------------------------------------------------------- + +class FramebufferNativeWindow + : public ANativeObjectBase< + ANativeWindow, + FramebufferNativeWindow, + LightRefBase > +{ +public: + FramebufferNativeWindow(); + + framebuffer_device_t const * getDevice() const { return fbDev; } + + bool isUpdateOnDemand() const { return mUpdateOnDemand; } + status_t setUpdateRectangle(const Rect& updateRect); + status_t compositionComplete(); + + void dump(String8& result); + + // for debugging only + int getCurrentBufferIndex() const; + +private: + friend class LightRefBase; + ~FramebufferNativeWindow(); // this class cannot be overloaded + static int setSwapInterval(ANativeWindow* window, int interval); + static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer, int* fenceFd); + static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer, int fenceFd); + static int query(const ANativeWindow* window, int what, int* value); + static int perform(ANativeWindow* window, int operation, ...); + + static int dequeueBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer** buffer); + static int queueBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer* buffer); + static int lockBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer* buffer); + + framebuffer_device_t* fbDev; + alloc_device_t* grDev; + + sp buffers[MAX_NUM_FRAME_BUFFERS]; + sp front; + + mutable Mutex mutex; + Condition mCondition; + int32_t mNumBuffers; + int32_t mNumFreeBuffers; + int32_t mBufferHead; + int32_t mCurrentBufferIndex; + bool mUpdateOnDemand; +}; + +// --------------------------------------------------------------------------- +}; // namespace android +// --------------------------------------------------------------------------- + +#endif // ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H + diff --git a/third_party/android_frameworks_native/include/ui/GraphicBuffer.h b/third_party/android_frameworks_native/include/ui/GraphicBuffer.h new file mode 100644 index 000000000..3da720ff3 --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/GraphicBuffer.h @@ -0,0 +1,183 @@ +/* + * Copyright (C) 2007 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_GRAPHIC_BUFFER_H +#define ANDROID_GRAPHIC_BUFFER_H + +#include +#include + +#include +#include +#include +#include +#include + + +struct ANativeWindowBuffer; + +namespace android { + +class GraphicBufferMapper; + +// =========================================================================== +// GraphicBuffer +// =========================================================================== + +class GraphicBuffer + : public ANativeObjectBase< ANativeWindowBuffer, GraphicBuffer, RefBase >, + public Flattenable +{ + friend class Flattenable; +public: + + enum { + USAGE_SW_READ_NEVER = GRALLOC_USAGE_SW_READ_NEVER, + USAGE_SW_READ_RARELY = GRALLOC_USAGE_SW_READ_RARELY, + USAGE_SW_READ_OFTEN = GRALLOC_USAGE_SW_READ_OFTEN, + USAGE_SW_READ_MASK = GRALLOC_USAGE_SW_READ_MASK, + + USAGE_SW_WRITE_NEVER = GRALLOC_USAGE_SW_WRITE_NEVER, + USAGE_SW_WRITE_RARELY = GRALLOC_USAGE_SW_WRITE_RARELY, + USAGE_SW_WRITE_OFTEN = GRALLOC_USAGE_SW_WRITE_OFTEN, + USAGE_SW_WRITE_MASK = GRALLOC_USAGE_SW_WRITE_MASK, + + USAGE_SOFTWARE_MASK = USAGE_SW_READ_MASK|USAGE_SW_WRITE_MASK, + + USAGE_PROTECTED = GRALLOC_USAGE_PROTECTED, + + USAGE_HW_TEXTURE = GRALLOC_USAGE_HW_TEXTURE, + USAGE_HW_RENDER = GRALLOC_USAGE_HW_RENDER, + USAGE_HW_2D = GRALLOC_USAGE_HW_2D, + USAGE_HW_COMPOSER = GRALLOC_USAGE_HW_COMPOSER, + USAGE_HW_VIDEO_ENCODER = GRALLOC_USAGE_HW_VIDEO_ENCODER, + USAGE_HW_MASK = GRALLOC_USAGE_HW_MASK, + + USAGE_CURSOR = GRALLOC_USAGE_CURSOR, + }; + + GraphicBuffer(); + + // creates w * h buffer + GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, + uint32_t inUsage); + + // create a buffer from an existing handle + GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, + uint32_t inUsage, uint32_t inStride, native_handle_t* inHandle, + bool keepOwnership); + + // create a buffer from an existing ANativeWindowBuffer + GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership); + + // return status + status_t initCheck() const; + + uint32_t getWidth() const { return static_cast(width); } + uint32_t getHeight() const { return static_cast(height); } + uint32_t getStride() const { return static_cast(stride); } + uint32_t getUsage() const { return static_cast(usage); } + PixelFormat getPixelFormat() const { return format; } + Rect getBounds() const { return Rect(width, height); } + uint64_t getId() const { return mId; } + + uint32_t getGenerationNumber() const { return mGenerationNumber; } + void setGenerationNumber(uint32_t generation) { + mGenerationNumber = generation; + } + + status_t reallocate(uint32_t inWidth, uint32_t inHeight, + PixelFormat inFormat, uint32_t inUsage); + + bool needsReallocation(uint32_t inWidth, uint32_t inHeight, + PixelFormat inFormat, uint32_t inUsage); + + status_t lock(uint32_t inUsage, void** vaddr); + status_t lock(uint32_t inUsage, const Rect& rect, void** vaddr); + // For HAL_PIXEL_FORMAT_YCbCr_420_888 + status_t lockYCbCr(uint32_t inUsage, android_ycbcr *ycbcr); + status_t lockYCbCr(uint32_t inUsage, const Rect& rect, + android_ycbcr *ycbcr); + status_t unlock(); + status_t lockAsync(uint32_t inUsage, void** vaddr, int fenceFd); + status_t lockAsync(uint32_t inUsage, const Rect& rect, void** vaddr, + int fenceFd); + status_t lockAsyncYCbCr(uint32_t inUsage, android_ycbcr *ycbcr, + int fenceFd); + status_t lockAsyncYCbCr(uint32_t inUsage, const Rect& rect, + android_ycbcr *ycbcr, int fenceFd); + status_t unlockAsync(int *fenceFd); + + ANativeWindowBuffer* getNativeBuffer() const; + + // for debugging + static void dumpAllocationsToSystemLog(); + + // Flattenable protocol + size_t getFlattenedSize() const; + size_t getFdCount() const; + status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const; + status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count); + +private: + ~GraphicBuffer(); + + enum { + ownNone = 0, + ownHandle = 1, + ownData = 2, + }; + + inline const GraphicBufferMapper& getBufferMapper() const { + return mBufferMapper; + } + inline GraphicBufferMapper& getBufferMapper() { + return mBufferMapper; + } + uint8_t mOwner; + +private: + friend class Surface; + friend class BpSurface; + friend class BnSurface; + friend class LightRefBase; + GraphicBuffer(const GraphicBuffer& rhs); + GraphicBuffer& operator = (const GraphicBuffer& rhs); + const GraphicBuffer& operator = (const GraphicBuffer& rhs) const; + + status_t initSize(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, + uint32_t inUsage); + + void free_handle(); + + GraphicBufferMapper& mBufferMapper; + ssize_t mInitCheck; + + // If we're wrapping another buffer then this reference will make sure it + // doesn't get freed. + sp mWrappedBuffer; + + uint64_t mId; + + // Stores the generation number of this buffer. If this number does not + // match the BufferQueue's internal generation number (set through + // IGBP::setGenerationNumber), attempts to attach the buffer will fail. + uint32_t mGenerationNumber; +}; + +}; // namespace android + +#endif // ANDROID_GRAPHIC_BUFFER_H diff --git a/third_party/android_frameworks_native/include/ui/GraphicBufferAllocator.h b/third_party/android_frameworks_native/include/ui/GraphicBufferAllocator.h new file mode 100644 index 000000000..5443f09a1 --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/GraphicBufferAllocator.h @@ -0,0 +1,95 @@ +/* +** +** Copyright 2009, 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_BUFFER_ALLOCATOR_H +#define ANDROID_BUFFER_ALLOCATOR_H + +#include + +#include + +#include +#include +#include +#include + +#include + +#include + + +namespace android { +// --------------------------------------------------------------------------- + +class String8; + +class GraphicBufferAllocator : public Singleton +{ +public: + enum { + USAGE_SW_READ_NEVER = GRALLOC_USAGE_SW_READ_NEVER, + USAGE_SW_READ_RARELY = GRALLOC_USAGE_SW_READ_RARELY, + USAGE_SW_READ_OFTEN = GRALLOC_USAGE_SW_READ_OFTEN, + USAGE_SW_READ_MASK = GRALLOC_USAGE_SW_READ_MASK, + + USAGE_SW_WRITE_NEVER = GRALLOC_USAGE_SW_WRITE_NEVER, + USAGE_SW_WRITE_RARELY = GRALLOC_USAGE_SW_WRITE_RARELY, + USAGE_SW_WRITE_OFTEN = GRALLOC_USAGE_SW_WRITE_OFTEN, + USAGE_SW_WRITE_MASK = GRALLOC_USAGE_SW_WRITE_MASK, + + USAGE_SOFTWARE_MASK = USAGE_SW_READ_MASK|USAGE_SW_WRITE_MASK, + + USAGE_HW_TEXTURE = GRALLOC_USAGE_HW_TEXTURE, + USAGE_HW_RENDER = GRALLOC_USAGE_HW_RENDER, + USAGE_HW_2D = GRALLOC_USAGE_HW_2D, + USAGE_HW_MASK = GRALLOC_USAGE_HW_MASK + }; + + static inline GraphicBufferAllocator& get() { return getInstance(); } + + status_t alloc(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, + buffer_handle_t* handle, uint32_t* stride); + + status_t free(buffer_handle_t handle); + + void dump(String8& res) const; + static void dumpToSystemLog(); + +private: + struct alloc_rec_t { + uint32_t width; + uint32_t height; + uint32_t stride; + PixelFormat format; + uint32_t usage; + size_t size; + }; + + static Mutex sLock; + static KeyedVector sAllocList; + + friend class Singleton; + GraphicBufferAllocator(); + ~GraphicBufferAllocator(); + + alloc_device_t *mAllocDev; +}; + +// --------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_BUFFER_ALLOCATOR_H diff --git a/third_party/android_frameworks_native/include/ui/GraphicBufferMapper.h b/third_party/android_frameworks_native/include/ui/GraphicBufferMapper.h new file mode 100644 index 000000000..990062482 --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/GraphicBufferMapper.h @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2007 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_UI_BUFFER_MAPPER_H +#define ANDROID_UI_BUFFER_MAPPER_H + +#include +#include + +#include + +#include + + +struct gralloc_module_t; + +namespace android { + +// --------------------------------------------------------------------------- + +class Rect; + +class GraphicBufferMapper : public Singleton +{ +public: + static inline GraphicBufferMapper& get() { return getInstance(); } + + status_t registerBuffer(buffer_handle_t handle); + + status_t unregisterBuffer(buffer_handle_t handle); + + status_t lock(buffer_handle_t handle, + uint32_t usage, const Rect& bounds, void** vaddr); + + status_t lockYCbCr(buffer_handle_t handle, + uint32_t usage, const Rect& bounds, android_ycbcr *ycbcr); + + status_t unlock(buffer_handle_t handle); + + status_t lockAsync(buffer_handle_t handle, + uint32_t usage, const Rect& bounds, void** vaddr, int fenceFd); + + status_t lockAsyncYCbCr(buffer_handle_t handle, + uint32_t usage, const Rect& bounds, android_ycbcr *ycbcr, + int fenceFd); + + status_t unlockAsync(buffer_handle_t handle, int *fenceFd); + +#ifdef EXYNOS4_ENHANCEMENTS + status_t getphys(buffer_handle_t handle, void** paddr); +#endif + + // dumps information about the mapping of this handle + void dump(buffer_handle_t handle); + +private: + friend class Singleton; + GraphicBufferMapper(); + gralloc_module_t const *mAllocMod; +}; + +// --------------------------------------------------------------------------- + +}; // namespace android + +#endif // ANDROID_UI_BUFFER_MAPPER_H + diff --git a/third_party/android_frameworks_native/include/ui/PixelFormat.h b/third_party/android_frameworks_native/include/ui/PixelFormat.h new file mode 100644 index 000000000..f26fecb8b --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/PixelFormat.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2005 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. + */ + +// + +// Pixel formats used across the system. +// These formats might not all be supported by all renderers, for instance +// skia or SurfaceFlinger are not required to support all of these formats +// (either as source or destination) + + +#ifndef UI_PIXELFORMAT_H +#define UI_PIXELFORMAT_H + +#include + +namespace android { + +enum { + // + // these constants need to match those + // in graphics/PixelFormat.java & pixelflinger/format.h + // + PIXEL_FORMAT_UNKNOWN = 0, + PIXEL_FORMAT_NONE = 0, + + // logical pixel formats used by the SurfaceFlinger ----------------------- + PIXEL_FORMAT_CUSTOM = -4, + // Custom pixel-format described by a PixelFormatInfo structure + + PIXEL_FORMAT_TRANSLUCENT = -3, + // System chooses a format that supports translucency (many alpha bits) + + PIXEL_FORMAT_TRANSPARENT = -2, + // System chooses a format that supports transparency + // (at least 1 alpha bit) + + PIXEL_FORMAT_OPAQUE = -1, + // System chooses an opaque format (no alpha bits required) + + // real pixel formats supported for rendering ----------------------------- + + PIXEL_FORMAT_RGBA_8888 = HAL_PIXEL_FORMAT_RGBA_8888, // 4x8-bit RGBA + PIXEL_FORMAT_RGBX_8888 = HAL_PIXEL_FORMAT_RGBX_8888, // 4x8-bit RGB0 + PIXEL_FORMAT_RGB_888 = HAL_PIXEL_FORMAT_RGB_888, // 3x8-bit RGB + PIXEL_FORMAT_RGB_565 = HAL_PIXEL_FORMAT_RGB_565, // 16-bit RGB + PIXEL_FORMAT_BGRA_8888 = HAL_PIXEL_FORMAT_BGRA_8888, // 4x8-bit BGRA + PIXEL_FORMAT_RGBA_5551 = 6, // 16-bit ARGB + PIXEL_FORMAT_RGBA_4444 = 7, // 16-bit ARGB +}; + +typedef int32_t PixelFormat; + +uint32_t bytesPerPixel(PixelFormat format); +uint32_t bitsPerPixel(PixelFormat format); + +}; // namespace android + +#endif // UI_PIXELFORMAT_H diff --git a/third_party/android_frameworks_native/include/ui/Point.h b/third_party/android_frameworks_native/include/ui/Point.h new file mode 100644 index 000000000..1d7f64d30 --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/Point.h @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2006 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_UI_POINT +#define ANDROID_UI_POINT + +#include +#include + +namespace android { + +class Point : public LightFlattenablePod +{ +public: + int x; + int y; + + // we don't provide copy-ctor and operator= on purpose + // because we want the compiler generated versions + + // Default constructor doesn't initialize the Point + inline Point() { + } + inline Point(int x, int y) : x(x), y(y) { + } + + inline bool operator == (const Point& rhs) const { + return (x == rhs.x) && (y == rhs.y); + } + inline bool operator != (const Point& rhs) const { + return !operator == (rhs); + } + + inline bool isOrigin() const { + return !(x|y); + } + + // operator < defines an order which allows to use points in sorted + // vectors. + bool operator < (const Point& rhs) const { + return y +#include +#include +#include + +#include + +namespace android { + +class Rect : public ARect, public LightFlattenablePod +{ +public: + typedef ARect::value_type value_type; + + static const Rect INVALID_RECT; + + // we don't provide copy-ctor and operator= on purpose + // because we want the compiler generated versions + + inline Rect() { + left = right = top = bottom = 0; + } + + inline Rect(int32_t w, int32_t h) { + left = top = 0; + right = w; + bottom = h; + } + + inline Rect(uint32_t w, uint32_t h) { + if (w > INT32_MAX) { + ALOG(LOG_WARN, "Rect", + "Width %u too large for Rect class, clamping", w); + w = INT32_MAX; + } + if (h > INT32_MAX) { + ALOG(LOG_WARN, "Rect", + "Height %u too large for Rect class, clamping", h); + h = INT32_MAX; + } + left = top = 0; + right = w; + bottom = h; + } + + inline Rect(int32_t l, int32_t t, int32_t r, int32_t b) { + left = l; + top = t; + right = r; + bottom = b; + } + + inline Rect(const Point& lt, const Point& rb) { + left = lt.x; + top = lt.y; + right = rb.x; + bottom = rb.y; + } + + void makeInvalid(); + + inline void clear() { + left = top = right = bottom = 0; + } + + // a valid rectangle has a non negative width and height + inline bool isValid() const { + return (getWidth() >= 0) && (getHeight() >= 0); + } + + // an empty rect has a zero width or height, or is invalid + inline bool isEmpty() const { + return (getWidth() <= 0) || (getHeight() <= 0); + } + + // rectangle's width + inline int32_t getWidth() const { + return right - left; + } + + // rectangle's height + inline int32_t getHeight() const { + return bottom - top; + } + + inline Rect getBounds() const { + return Rect(right - left, bottom - top); + } + + void setLeftTop(const Point& lt) { + left = lt.x; + top = lt.y; + } + + void setRightBottom(const Point& rb) { + right = rb.x; + bottom = rb.y; + } + + // the following 4 functions return the 4 corners of the rect as Point + Point leftTop() const { + return Point(left, top); + } + Point rightBottom() const { + return Point(right, bottom); + } + Point rightTop() const { + return Point(right, top); + } + Point leftBottom() const { + return Point(left, bottom); + } + + // comparisons + inline bool operator == (const Rect& rhs) const { + return (left == rhs.left) && (top == rhs.top) && + (right == rhs.right) && (bottom == rhs.bottom); + } + + inline bool operator != (const Rect& rhs) const { + return !operator == (rhs); + } + + // operator < defines an order which allows to use rectangles in sorted + // vectors. + bool operator < (const Rect& rhs) const; + + const Rect operator + (const Point& rhs) const; + const Rect operator - (const Point& rhs) const; + + Rect& operator += (const Point& rhs) { + return offsetBy(rhs.x, rhs.y); + } + Rect& operator -= (const Point& rhs) { + return offsetBy(-rhs.x, -rhs.y); + } + + Rect& offsetToOrigin() { + right -= left; + bottom -= top; + left = top = 0; + return *this; + } + Rect& offsetTo(const Point& p) { + return offsetTo(p.x, p.y); + } + Rect& offsetBy(const Point& dp) { + return offsetBy(dp.x, dp.y); + } + + Rect& offsetTo(int32_t x, int32_t y); + Rect& offsetBy(int32_t x, int32_t y); + + bool intersect(const Rect& with, Rect* result) const; + + // Create a new Rect by transforming this one using a graphics HAL + // transform. This rectangle is defined in a coordinate space starting at + // the origin and extending to (width, height). If the transform includes + // a ROT90 then the output rectangle is defined in a space extending to + // (height, width). Otherwise the output rectangle is in the same space as + // the input. + Rect transform(uint32_t xform, int32_t width, int32_t height) const; + + // this calculates (Region(*this) - exclude).bounds() efficiently + Rect reduce(const Rect& exclude) const; + + + // for backward compatibility + inline int32_t width() const { return getWidth(); } + inline int32_t height() const { return getHeight(); } + inline void set(const Rect& rhs) { operator = (rhs); } +}; + +ANDROID_BASIC_TYPES_TRAITS(Rect) + +}; // namespace android + +#endif // ANDROID_UI_RECT diff --git a/third_party/android_frameworks_native/include/ui/Region.h b/third_party/android_frameworks_native/include/ui/Region.h new file mode 100644 index 000000000..2a1491837 --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/Region.h @@ -0,0 +1,223 @@ +/* + * Copyright (C) 2007 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_UI_REGION_H +#define ANDROID_UI_REGION_H + +#include +#include + +#include + +#include +#include + +namespace android { +// --------------------------------------------------------------------------- + +class SharedBuffer; +class String8; + +// --------------------------------------------------------------------------- +class Region : public LightFlattenable +{ +public: + static const Region INVALID_REGION; + + Region(); + Region(const Region& rhs); + explicit Region(const Rect& rhs); + ~Region(); + + static Region createTJunctionFreeRegion(const Region& r); + + Region& operator = (const Region& rhs); + + inline bool isEmpty() const { return getBounds().isEmpty(); } + inline bool isRect() const { return mStorage.size() == 1; } + + inline Rect getBounds() const { return mStorage[mStorage.size() - 1]; } + inline Rect bounds() const { return getBounds(); } + + bool contains(const Point& point) const; + bool contains(int x, int y) const; + + // the region becomes its bounds + Region& makeBoundsSelf(); + + void clear(); + void set(const Rect& r); + void set(int32_t w, int32_t h); + void set(uint32_t w, uint32_t h); + + Region& orSelf(const Rect& rhs); + Region& xorSelf(const Rect& rhs); + Region& andSelf(const Rect& rhs); + Region& subtractSelf(const Rect& rhs); + + // boolean operators, applied on this + Region& orSelf(const Region& rhs); + Region& xorSelf(const Region& rhs); + Region& andSelf(const Region& rhs); + Region& subtractSelf(const Region& rhs); + + // boolean operators + const Region merge(const Rect& rhs) const; + const Region mergeExclusive(const Rect& rhs) const; + const Region intersect(const Rect& rhs) const; + const Region subtract(const Rect& rhs) const; + + // boolean operators + const Region merge(const Region& rhs) const; + const Region mergeExclusive(const Region& rhs) const; + const Region intersect(const Region& rhs) const; + const Region subtract(const Region& rhs) const; + + // these translate rhs first + Region& translateSelf(int dx, int dy); + Region& orSelf(const Region& rhs, int dx, int dy); + Region& xorSelf(const Region& rhs, int dx, int dy); + Region& andSelf(const Region& rhs, int dx, int dy); + Region& subtractSelf(const Region& rhs, int dx, int dy); + + // these translate rhs first + const Region translate(int dx, int dy) const; + const Region merge(const Region& rhs, int dx, int dy) const; + const Region mergeExclusive(const Region& rhs, int dx, int dy) const; + const Region intersect(const Region& rhs, int dx, int dy) const; + const Region subtract(const Region& rhs, int dx, int dy) const; + + // convenience operators overloads + inline const Region operator | (const Region& rhs) const; + inline const Region operator ^ (const Region& rhs) const; + inline const Region operator & (const Region& rhs) const; + inline const Region operator - (const Region& rhs) const; + inline const Region operator + (const Point& pt) const; + + inline Region& operator |= (const Region& rhs); + inline Region& operator ^= (const Region& rhs); + inline Region& operator &= (const Region& rhs); + inline Region& operator -= (const Region& rhs); + inline Region& operator += (const Point& pt); + + + // returns true if the regions share the same underlying storage + bool isTriviallyEqual(const Region& region) const; + + + /* various ways to access the rectangle list */ + + + // STL-like iterators + typedef Rect const* const_iterator; + const_iterator begin() const; + const_iterator end() const; + + // returns an array of rect which has the same life-time has this + // Region object. + Rect const* getArray(size_t* count) const; + + // returns a SharedBuffer as well as the number of rects. + // ownership is transfered to the caller. + // the caller must call SharedBuffer::release() to free the memory. + SharedBuffer const* getSharedBuffer(size_t* count) const; + + /* no user serviceable parts here... */ + + // add a rectangle to the internal list. This rectangle must + // be sorted in Y and X and must not make the region invalid. + void addRectUnchecked(int l, int t, int r, int b); + + inline bool isFixedSize() const { return false; } + size_t getFlattenedSize() const; + status_t flatten(void* buffer, size_t size) const; + status_t unflatten(void const* buffer, size_t size); + + void dump(String8& out, const char* what, uint32_t flags=0) const; + void dump(const char* what, uint32_t flags=0) const; + +private: + class rasterizer; + friend class rasterizer; + + Region& operationSelf(const Rect& r, int op); + Region& operationSelf(const Region& r, int op); + Region& operationSelf(const Region& r, int dx, int dy, int op); + const Region operation(const Rect& rhs, int op) const; + const Region operation(const Region& rhs, int op) const; + const Region operation(const Region& rhs, int dx, int dy, int op) const; + + static void boolean_operation(int op, Region& dst, + const Region& lhs, const Region& rhs, int dx, int dy); + static void boolean_operation(int op, Region& dst, + const Region& lhs, const Rect& rhs, int dx, int dy); + + static void boolean_operation(int op, Region& dst, + const Region& lhs, const Region& rhs); + static void boolean_operation(int op, Region& dst, + const Region& lhs, const Rect& rhs); + + static void translate(Region& reg, int dx, int dy); + static void translate(Region& dst, const Region& reg, int dx, int dy); + + static bool validate(const Region& reg, + const char* name, bool silent = false); + + // mStorage is a (manually) sorted array of Rects describing the region + // with an extra Rect as the last element which is set to the + // bounds of the region. However, if the region is + // a simple Rect then mStorage contains only that rect. + Vector mStorage; +}; + + +const Region Region::operator | (const Region& rhs) const { + return merge(rhs); +} +const Region Region::operator ^ (const Region& rhs) const { + return mergeExclusive(rhs); +} +const Region Region::operator & (const Region& rhs) const { + return intersect(rhs); +} +const Region Region::operator - (const Region& rhs) const { + return subtract(rhs); +} +const Region Region::operator + (const Point& pt) const { + return translate(pt.x, pt.y); +} + + +Region& Region::operator |= (const Region& rhs) { + return orSelf(rhs); +} +Region& Region::operator ^= (const Region& rhs) { + return xorSelf(rhs); +} +Region& Region::operator &= (const Region& rhs) { + return andSelf(rhs); +} +Region& Region::operator -= (const Region& rhs) { + return subtractSelf(rhs); +} +Region& Region::operator += (const Point& pt) { + return translateSelf(pt.x, pt.y); +} +// --------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_UI_REGION_H + diff --git a/third_party/android_frameworks_native/include/ui/TMatHelpers.h b/third_party/android_frameworks_native/include/ui/TMatHelpers.h new file mode 100644 index 000000000..a6aadcad4 --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/TMatHelpers.h @@ -0,0 +1,257 @@ +/* + * Copyright 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 TMAT_IMPLEMENTATION +#error "Don't include TMatHelpers.h directly. use ui/mat*.h instead" +#else +#undef TMAT_IMPLEMENTATION +#endif + + +#ifndef UI_TMAT_HELPERS_H +#define UI_TMAT_HELPERS_H + +#include +#include +#include +#include +#include + +#define PURE __attribute__((pure)) + +namespace android { +// ------------------------------------------------------------------------------------- + +/* + * No user serviceable parts here. + * + * Don't use this file directly, instead include ui/mat*.h + */ + + +/* + * Matrix utilities + */ + +namespace matrix { + +inline int PURE transpose(int v) { return v; } +inline float PURE transpose(float v) { return v; } +inline double PURE transpose(double v) { return v; } + +inline int PURE trace(int v) { return v; } +inline float PURE trace(float v) { return v; } +inline double PURE trace(double v) { return v; } + +template +MATRIX PURE inverse(const MATRIX& src) { + + COMPILE_TIME_ASSERT_FUNCTION_SCOPE( MATRIX::COL_SIZE == MATRIX::ROW_SIZE ); + + typename MATRIX::value_type t; + const size_t N = MATRIX::col_size(); + size_t swap; + MATRIX tmp(src); + MATRIX inverse(1); + + for (size_t i=0 ; i fabs(tmp[i][i])) { + swap = j; + } + } + + if (swap != i) { + /* swap rows. */ + for (size_t k=0 ; k +MATRIX_R PURE multiply(const MATRIX_A& lhs, const MATRIX_B& rhs) { + // pre-requisite: + // lhs : D columns, R rows + // rhs : C columns, D rows + // res : C columns, R rows + + COMPILE_TIME_ASSERT_FUNCTION_SCOPE( MATRIX_A::ROW_SIZE == MATRIX_B::COL_SIZE ); + COMPILE_TIME_ASSERT_FUNCTION_SCOPE( MATRIX_R::ROW_SIZE == MATRIX_B::ROW_SIZE ); + COMPILE_TIME_ASSERT_FUNCTION_SCOPE( MATRIX_R::COL_SIZE == MATRIX_A::COL_SIZE ); + + MATRIX_R res(MATRIX_R::NO_INIT); + for (size_t r=0 ; r +MATRIX PURE transpose(const MATRIX& m) { + // for now we only handle square matrix transpose + COMPILE_TIME_ASSERT_FUNCTION_SCOPE( MATRIX::ROW_SIZE == MATRIX::COL_SIZE ); + MATRIX result(MATRIX::NO_INIT); + for (size_t r=0 ; r +typename MATRIX::value_type PURE trace(const MATRIX& m) { + COMPILE_TIME_ASSERT_FUNCTION_SCOPE( MATRIX::ROW_SIZE == MATRIX::COL_SIZE ); + typename MATRIX::value_type result(0); + for (size_t r=0 ; r +typename MATRIX::col_type PURE diag(const MATRIX& m) { + COMPILE_TIME_ASSERT_FUNCTION_SCOPE( MATRIX::ROW_SIZE == MATRIX::COL_SIZE ); + typename MATRIX::col_type result(MATRIX::col_type::NO_INIT); + for (size_t r=0 ; r +String8 asString(const MATRIX& m) { + String8 s; + for (size_t c=0 ; c. + * + * BASE only needs to implement operator[] and size(). + * By simply inheriting from TMatProductOperators BASE will automatically + * get all the functionality here. + */ + +template class BASE, typename T> +class TMatProductOperators { +public: + // multiply by a scalar + BASE& operator *= (T v) { + BASE& lhs(static_cast< BASE& >(*this)); + for (size_t r=0 ; r& operator /= (T v) { + BASE& lhs(static_cast< BASE& >(*this)); + for (size_t r=0 ; r + friend BASE PURE operator *(const BASE& lhs, const BASE& rhs) { + return matrix::multiply >(lhs, rhs); + } +}; + + +/* + * TMatSquareFunctions implements functions on a matrix of type BASE. + * + * BASE only needs to implement: + * - operator[] + * - col_type + * - row_type + * - COL_SIZE + * - ROW_SIZE + * + * By simply inheriting from TMatSquareFunctions BASE will automatically + * get all the functionality here. + */ + +template class BASE, typename T> +class TMatSquareFunctions { +public: + /* + * NOTE: the functions below ARE NOT member methods. They are friend functions + * with they definition inlined with their declaration. This makes these + * template functions available to the compiler when (and only when) this class + * is instantiated, at which point they're only templated on the 2nd parameter + * (the first one, BASE being known). + */ + friend BASE PURE inverse(const BASE& m) { return matrix::inverse(m); } + friend BASE PURE transpose(const BASE& m) { return matrix::transpose(m); } + friend T PURE trace(const BASE& m) { return matrix::trace(m); } +}; + +template class BASE, typename T> +class TMatDebug { +public: + String8 asString() const { + return matrix::asString( static_cast< const BASE& >(*this) ); + } +}; + +// ------------------------------------------------------------------------------------- +}; // namespace android + +#undef PURE + +#endif /* UI_TMAT_HELPERS_H */ diff --git a/third_party/android_frameworks_native/include/ui/TVecHelpers.h b/third_party/android_frameworks_native/include/ui/TVecHelpers.h new file mode 100644 index 000000000..bb7dbfc2b --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/TVecHelpers.h @@ -0,0 +1,381 @@ +/* + * Copyright 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 TVEC_IMPLEMENTATION +#error "Don't include TVecHelpers.h directly. use ui/vec*.h instead" +#else +#undef TVEC_IMPLEMENTATION +#endif + + +#ifndef UI_TVEC_HELPERS_H +#define UI_TVEC_HELPERS_H + +#include +#include + +#define PURE __attribute__((pure)) + +namespace android { +// ------------------------------------------------------------------------------------- + +/* + * No user serviceable parts here. + * + * Don't use this file directly, instead include ui/vec{2|3|4}.h + */ + +/* + * This class casts itself into anything and assign itself from anything! + * Use with caution! + */ +template +struct Impersonator { + Impersonator& operator = (const TYPE& rhs) { + reinterpret_cast(*this) = rhs; + return *this; + } + operator TYPE& () { + return reinterpret_cast(*this); + } + operator TYPE const& () const { + return reinterpret_cast(*this); + } +}; + +/* + * TVec{Add|Product}Operators implements basic arithmetic and basic compound assignments + * operators on a vector of type BASE. + * + * BASE only needs to implement operator[] and size(). + * By simply inheriting from TVec{Add|Product}Operators BASE will automatically + * get all the functionality here. + */ + +template class BASE, typename T> +class TVecAddOperators { +public: + /* compound assignment from a another vector of the same size but different + * element type. + */ + template + BASE& operator += (const BASE& v) { + BASE& rhs = static_cast&>(*this); + for (size_t i=0 ; i::size() ; i++) { + rhs[i] += v[i]; + } + return rhs; + } + template + BASE& operator -= (const BASE& v) { + BASE& rhs = static_cast&>(*this); + for (size_t i=0 ; i::size() ; i++) { + rhs[i] -= v[i]; + } + return rhs; + } + + /* compound assignment from a another vector of the same type. + * These operators can be used for implicit conversion and handle operations + * like "vector *= scalar" by letting the compiler implicitly convert a scalar + * to a vector (assuming the BASE allows it). + */ + BASE& operator += (const BASE& v) { + BASE& rhs = static_cast&>(*this); + for (size_t i=0 ; i::size() ; i++) { + rhs[i] += v[i]; + } + return rhs; + } + BASE& operator -= (const BASE& v) { + BASE& rhs = static_cast&>(*this); + for (size_t i=0 ; i::size() ; i++) { + rhs[i] -= v[i]; + } + return rhs; + } + + /* + * NOTE: the functions below ARE NOT member methods. They are friend functions + * with they definition inlined with their declaration. This makes these + * template functions available to the compiler when (and only when) this class + * is instantiated, at which point they're only templated on the 2nd parameter + * (the first one, BASE being known). + */ + + /* The operators below handle operation between vectors of the same side + * but of a different element type. + */ + template + friend inline + BASE PURE operator +(const BASE& lv, const BASE& rv) { + return BASE(lv) += rv; + } + template + friend inline + BASE PURE operator -(const BASE& lv, const BASE& rv) { + return BASE(lv) -= rv; + } + + /* The operators below (which are not templates once this class is instanced, + * i.e.: BASE is known) can be used for implicit conversion on both sides. + * These handle operations like "vector * scalar" and "scalar * vector" by + * letting the compiler implicitly convert a scalar to a vector (assuming + * the BASE allows it). + */ + friend inline + BASE PURE operator +(const BASE& lv, const BASE& rv) { + return BASE(lv) += rv; + } + friend inline + BASE PURE operator -(const BASE& lv, const BASE& rv) { + return BASE(lv) -= rv; + } +}; + +template class BASE, typename T> +class TVecProductOperators { +public: + /* compound assignment from a another vector of the same size but different + * element type. + */ + template + BASE& operator *= (const BASE& v) { + BASE& rhs = static_cast&>(*this); + for (size_t i=0 ; i::size() ; i++) { + rhs[i] *= v[i]; + } + return rhs; + } + template + BASE& operator /= (const BASE& v) { + BASE& rhs = static_cast&>(*this); + for (size_t i=0 ; i::size() ; i++) { + rhs[i] /= v[i]; + } + return rhs; + } + + /* compound assignment from a another vector of the same type. + * These operators can be used for implicit conversion and handle operations + * like "vector *= scalar" by letting the compiler implicitly convert a scalar + * to a vector (assuming the BASE allows it). + */ + BASE& operator *= (const BASE& v) { + BASE& rhs = static_cast&>(*this); + for (size_t i=0 ; i::size() ; i++) { + rhs[i] *= v[i]; + } + return rhs; + } + BASE& operator /= (const BASE& v) { + BASE& rhs = static_cast&>(*this); + for (size_t i=0 ; i::size() ; i++) { + rhs[i] /= v[i]; + } + return rhs; + } + + /* + * NOTE: the functions below ARE NOT member methods. They are friend functions + * with they definition inlined with their declaration. This makes these + * template functions available to the compiler when (and only when) this class + * is instantiated, at which point they're only templated on the 2nd parameter + * (the first one, BASE being known). + */ + + /* The operators below handle operation between vectors of the same side + * but of a different element type. + */ + template + friend inline + BASE PURE operator *(const BASE& lv, const BASE& rv) { + return BASE(lv) *= rv; + } + template + friend inline + BASE PURE operator /(const BASE& lv, const BASE& rv) { + return BASE(lv) /= rv; + } + + /* The operators below (which are not templates once this class is instanced, + * i.e.: BASE is known) can be used for implicit conversion on both sides. + * These handle operations like "vector * scalar" and "scalar * vector" by + * letting the compiler implicitly convert a scalar to a vector (assuming + * the BASE allows it). + */ + friend inline + BASE PURE operator *(const BASE& lv, const BASE& rv) { + return BASE(lv) *= rv; + } + friend inline + BASE PURE operator /(const BASE& lv, const BASE& rv) { + return BASE(lv) /= rv; + } +}; + +/* + * TVecUnaryOperators implements unary operators on a vector of type BASE. + * + * BASE only needs to implement operator[] and size(). + * By simply inheriting from TVecUnaryOperators BASE will automatically + * get all the functionality here. + * + * These operators are implemented as friend functions of TVecUnaryOperators + */ +template class BASE, typename T> +class TVecUnaryOperators { +public: + BASE& operator ++ () { + BASE& rhs = static_cast&>(*this); + for (size_t i=0 ; i::size() ; i++) { + ++rhs[i]; + } + return rhs; + } + BASE& operator -- () { + BASE& rhs = static_cast&>(*this); + for (size_t i=0 ; i::size() ; i++) { + --rhs[i]; + } + return rhs; + } + BASE operator - () const { + BASE r(BASE::NO_INIT); + BASE const& rv(static_cast const&>(*this)); + for (size_t i=0 ; i::size() ; i++) { + r[i] = -rv[i]; + } + return r; + } +}; + + +/* + * TVecComparisonOperators implements relational/comparison operators + * on a vector of type BASE. + * + * BASE only needs to implement operator[] and size(). + * By simply inheriting from TVecComparisonOperators BASE will automatically + * get all the functionality here. + */ +template class BASE, typename T> +class TVecComparisonOperators { +public: + /* + * NOTE: the functions below ARE NOT member methods. They are friend functions + * with they definition inlined with their declaration. This makes these + * template functions available to the compiler when (and only when) this class + * is instantiated, at which point they're only templated on the 2nd parameter + * (the first one, BASE being known). + */ + template + friend inline + bool PURE operator ==(const BASE& lv, const BASE& rv) { + for (size_t i = 0; i < BASE::size(); i++) + if (lv[i] != rv[i]) + return false; + return true; + } + + template + friend inline + bool PURE operator !=(const BASE& lv, const BASE& rv) { + return !operator ==(lv, rv); + } + + template + friend inline + bool PURE operator >(const BASE& lv, const BASE& rv) { + for (size_t i = 0; i < BASE::size(); i++) + if (lv[i] <= rv[i]) + return false; + return true; + } + + template + friend inline + bool PURE operator <=(const BASE& lv, const BASE& rv) { + return !(lv > rv); + } + + template + friend inline + bool PURE operator <(const BASE& lv, const BASE& rv) { + for (size_t i = 0; i < BASE::size(); i++) + if (lv[i] >= rv[i]) + return false; + return true; + } + + template + friend inline + bool PURE operator >=(const BASE& lv, const BASE& rv) { + return !(lv < rv); + } +}; + + +/* + * TVecFunctions implements functions on a vector of type BASE. + * + * BASE only needs to implement operator[] and size(). + * By simply inheriting from TVecFunctions BASE will automatically + * get all the functionality here. + */ +template class BASE, typename T> +class TVecFunctions { +public: + /* + * NOTE: the functions below ARE NOT member methods. They are friend functions + * with they definition inlined with their declaration. This makes these + * template functions available to the compiler when (and only when) this class + * is instantiated, at which point they're only templated on the 2nd parameter + * (the first one, BASE being known). + */ + template + friend inline + T PURE dot(const BASE& lv, const BASE& rv) { + T r(0); + for (size_t i = 0; i < BASE::size(); i++) + r += lv[i]*rv[i]; + return r; + } + + friend inline + T PURE length(const BASE& lv) { + return sqrt( dot(lv, lv) ); + } + + template + friend inline + T PURE distance(const BASE& lv, const BASE& rv) { + return length(rv - lv); + } + + friend inline + BASE PURE normalize(const BASE& lv) { + return lv * (1 / length(lv)); + } +}; + +#undef PURE + +// ------------------------------------------------------------------------------------- +}; // namespace android + + +#endif /* UI_TVEC_HELPERS_H */ diff --git a/third_party/android_frameworks_native/include/ui/UiConfig.h b/third_party/android_frameworks_native/include/ui/UiConfig.h new file mode 100644 index 000000000..fcf8ed5d6 --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/UiConfig.h @@ -0,0 +1,29 @@ +/* + * 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_UI_CONFIG_H +#define ANDROID_UI_CONFIG_H + +#include + +namespace android { + +// Append the libui configuration details to configStr. +void appendUiConfigString(String8& configStr); + +}; // namespace android + +#endif /*ANDROID_UI_CONFIG_H*/ diff --git a/third_party/android_frameworks_native/include/ui/mat4.h b/third_party/android_frameworks_native/include/ui/mat4.h new file mode 100644 index 000000000..4fd1effd7 --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/mat4.h @@ -0,0 +1,395 @@ +/* + * Copyright 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 UI_MAT4_H +#define UI_MAT4_H + +#include +#include + +#include +#include + +#define TMAT_IMPLEMENTATION +#include + +#define PURE __attribute__((pure)) + +namespace android { +// ------------------------------------------------------------------------------------- + +template +class tmat44 : public TVecUnaryOperators, + public TVecComparisonOperators, + public TVecAddOperators, + public TMatProductOperators, + public TMatSquareFunctions, + public TMatDebug +{ +public: + enum no_init { NO_INIT }; + typedef T value_type; + typedef T& reference; + typedef T const& const_reference; + typedef size_t size_type; + typedef tvec4 col_type; + typedef tvec4 row_type; + + // size of a column (i.e.: number of rows) + enum { COL_SIZE = col_type::SIZE }; + static inline size_t col_size() { return COL_SIZE; } + + // size of a row (i.e.: number of columns) + enum { ROW_SIZE = row_type::SIZE }; + static inline size_t row_size() { return ROW_SIZE; } + static inline size_t size() { return row_size(); } // for TVec*<> + +private: + + /* + * <-- N columns --> + * + * a00 a10 a20 ... aN0 ^ + * a01 a11 a21 ... aN1 | + * a02 a12 a22 ... aN2 M rows + * ... | + * a0M a1M a2M ... aNM v + * + * COL_SIZE = M + * ROW_SIZE = N + * m[0] = [a00 a01 a02 ... a01M] + */ + + col_type mValue[ROW_SIZE]; + +public: + // array access + inline col_type const& operator [] (size_t i) const { return mValue[i]; } + inline col_type& operator [] (size_t i) { return mValue[i]; } + + T const* asArray() const { return &mValue[0][0]; } + + // ----------------------------------------------------------------------- + // we don't provide copy-ctor and operator= on purpose + // because we want the compiler generated versions + + /* + * constructors + */ + + // leaves object uninitialized. use with caution. + explicit tmat44(no_init) { } + + // initialize to identity + tmat44(); + + // initialize to Identity*scalar. + template + explicit tmat44(U v); + + // sets the diagonal to the passed vector + template + explicit tmat44(const tvec4& rhs); + + // construct from another matrix of the same size + template + explicit tmat44(const tmat44& rhs); + + // construct from 4 column vectors + template + tmat44(const tvec4& v0, const tvec4& v1, const tvec4& v2, const tvec4& v3); + + // construct from 16 scalars + template < + typename A, typename B, typename C, typename D, + typename E, typename F, typename G, typename H, + typename I, typename J, typename K, typename L, + typename M, typename N, typename O, typename P> + tmat44( A m00, B m01, C m02, D m03, + E m10, F m11, G m12, H m13, + I m20, J m21, K m22, L m23, + M m30, N m31, O m32, P m33); + + // construct from a C array + template + explicit tmat44(U const* rawArray); + + /* + * helpers + */ + + static tmat44 ortho(T left, T right, T bottom, T top, T near, T far); + + static tmat44 frustum(T left, T right, T bottom, T top, T near, T far); + + template + static tmat44 lookAt(const tvec3& eye, const tvec3& center, const tvec3& up); + + template + static tmat44 translate(const tvec4& t); + + template + static tmat44 scale(const tvec4& s); + + template + static tmat44 rotate(A radian, const tvec3& about); +}; + +// ---------------------------------------------------------------------------------------- +// Constructors +// ---------------------------------------------------------------------------------------- + +/* + * Since the matrix code could become pretty big quickly, we don't inline most + * operations. + */ + +template +tmat44::tmat44() { + mValue[0] = col_type(1,0,0,0); + mValue[1] = col_type(0,1,0,0); + mValue[2] = col_type(0,0,1,0); + mValue[3] = col_type(0,0,0,1); +} + +template +template +tmat44::tmat44(U v) { + mValue[0] = col_type(v,0,0,0); + mValue[1] = col_type(0,v,0,0); + mValue[2] = col_type(0,0,v,0); + mValue[3] = col_type(0,0,0,v); +} + +template +template +tmat44::tmat44(const tvec4& v) { + mValue[0] = col_type(v.x,0,0,0); + mValue[1] = col_type(0,v.y,0,0); + mValue[2] = col_type(0,0,v.z,0); + mValue[3] = col_type(0,0,0,v.w); +} + +// construct from 16 scalars +template +template < + typename A, typename B, typename C, typename D, + typename E, typename F, typename G, typename H, + typename I, typename J, typename K, typename L, + typename M, typename N, typename O, typename P> +tmat44::tmat44( A m00, B m01, C m02, D m03, + E m10, F m11, G m12, H m13, + I m20, J m21, K m22, L m23, + M m30, N m31, O m32, P m33) { + mValue[0] = col_type(m00, m01, m02, m03); + mValue[1] = col_type(m10, m11, m12, m13); + mValue[2] = col_type(m20, m21, m22, m23); + mValue[3] = col_type(m30, m31, m32, m33); +} + +template +template +tmat44::tmat44(const tmat44& rhs) { + for (size_t r=0 ; r +template +tmat44::tmat44(const tvec4& v0, const tvec4& v1, const tvec4& v2, const tvec4& v3) { + mValue[0] = v0; + mValue[1] = v1; + mValue[2] = v2; + mValue[3] = v3; +} + +template +template +tmat44::tmat44(U const* rawArray) { + for (size_t r=0 ; r +tmat44 tmat44::ortho(T left, T right, T bottom, T top, T near, T far) { + tmat44 m; + m[0][0] = 2 / (right - left); + m[1][1] = 2 / (top - bottom); + m[2][2] = -2 / (far - near); + m[3][0] = -(right + left) / (right - left); + m[3][1] = -(top + bottom) / (top - bottom); + m[3][2] = -(far + near) / (far - near); + return m; +} + +template +tmat44 tmat44::frustum(T left, T right, T bottom, T top, T near, T far) { + tmat44 m; + T A = (right + left) / (right - left); + T B = (top + bottom) / (top - bottom); + T C = (far + near) / (far - near); + T D = (2 * far * near) / (far - near); + m[0][0] = (2 * near) / (right - left); + m[1][1] = (2 * near) / (top - bottom); + m[2][0] = A; + m[2][1] = B; + m[2][2] = C; + m[2][3] =-1; + m[3][2] = D; + m[3][3] = 0; + return m; +} + +template +template +tmat44 tmat44::lookAt(const tvec3& eye, const tvec3& center, const tvec3& up) { + tvec3 L(normalize(center - eye)); + tvec3 S(normalize( cross(L, up) )); + tvec3 U(cross(S, L)); + return tmat44( + tvec4( S, 0), + tvec4( U, 0), + tvec4(-L, 0), + tvec4(-eye, 1)); +} + +template +template +tmat44 tmat44::translate(const tvec4& t) { + tmat44 r; + r[3] = t; + return r; +} + +template +template +tmat44 tmat44::scale(const tvec4& s) { + tmat44 r; + r[0][0] = s[0]; + r[1][1] = s[1]; + r[2][2] = s[2]; + r[3][3] = s[3]; + return r; +} + +template +template +tmat44 tmat44::rotate(A radian, const tvec3& about) { + tmat44 rotation; + T* r = const_cast(rotation.asArray()); + T c = cos(radian); + T s = sin(radian); + if (about.x==1 && about.y==0 && about.z==0) { + r[5] = c; r[10]= c; + r[6] = s; r[9] = -s; + } else if (about.x==0 && about.y==1 && about.z==0) { + r[0] = c; r[10]= c; + r[8] = s; r[2] = -s; + } else if (about.x==0 && about.y==0 && about.z==1) { + r[0] = c; r[5] = c; + r[1] = s; r[4] = -s; + } else { + tvec3 nabout = normalize(about); + B x = nabout.x; + B y = nabout.y; + B z = nabout.z; + T nc = 1 - c; + T xy = x * y; + T yz = y * z; + T zx = z * x; + T xs = x * s; + T ys = y * s; + T zs = z * s; + r[ 0] = x*x*nc + c; r[ 4] = xy*nc - zs; r[ 8] = zx*nc + ys; + r[ 1] = xy*nc + zs; r[ 5] = y*y*nc + c; r[ 9] = yz*nc - xs; + r[ 2] = zx*nc - ys; r[ 6] = yz*nc + xs; r[10] = z*z*nc + c; + } + return rotation; +} + +// ---------------------------------------------------------------------------------------- +// Arithmetic operators outside of class +// ---------------------------------------------------------------------------------------- + +/* We use non-friend functions here to prevent the compiler from using + * implicit conversions, for instance of a scalar to a vector. The result would + * not be what the caller expects. + * + * Also note that the order of the arguments in the inner loop is important since + * it determines the output type (only relevant when T != U). + */ + +// matrix * vector, result is a vector of the same type than the input vector +template +typename tmat44::col_type PURE operator *(const tmat44& lv, const tvec4& rv) { + typename tmat44::col_type result; + for (size_t r=0 ; r::row_size() ; r++) + result += rv[r]*lv[r]; + return result; +} + +// vector * matrix, result is a vector of the same type than the input vector +template +typename tmat44::row_type PURE operator *(const tvec4& rv, const tmat44& lv) { + typename tmat44::row_type result(tmat44::row_type::NO_INIT); + for (size_t r=0 ; r::row_size() ; r++) + result[r] = dot(rv, lv[r]); + return result; +} + +// matrix * scalar, result is a matrix of the same type than the input matrix +template +tmat44 PURE operator *(const tmat44& lv, U rv) { + tmat44 result(tmat44::NO_INIT); + for (size_t r=0 ; r::row_size() ; r++) + result[r] = lv[r]*rv; + return result; +} + +// scalar * matrix, result is a matrix of the same type than the input matrix +template +tmat44 PURE operator *(U rv, const tmat44& lv) { + tmat44 result(tmat44::NO_INIT); + for (size_t r=0 ; r::row_size() ; r++) + result[r] = lv[r]*rv; + return result; +} + +// ---------------------------------------------------------------------------------------- + +/* FIXME: this should go into TMatSquareFunctions<> but for some reason + * BASE::col_type is not accessible from there (???) + */ +template +typename tmat44::col_type PURE diag(const tmat44& m) { + return matrix::diag(m); +} + +// ---------------------------------------------------------------------------------------- + +typedef tmat44 mat4; + +// ---------------------------------------------------------------------------------------- +}; // namespace android + +#undef PURE + +#endif /* UI_MAT4_H */ diff --git a/third_party/android_frameworks_native/include/ui/vec2.h b/third_party/android_frameworks_native/include/ui/vec2.h new file mode 100644 index 000000000..c31d0e43e --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/vec2.h @@ -0,0 +1,91 @@ +/* + * Copyright 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 UI_VEC2_H +#define UI_VEC2_H + +#include +#include + +#define TVEC_IMPLEMENTATION +#include + +namespace android { +// ------------------------------------------------------------------------------------- + +template +class tvec2 : public TVecProductOperators, + public TVecAddOperators, + public TVecUnaryOperators, + public TVecComparisonOperators, + public TVecFunctions +{ +public: + enum no_init { NO_INIT }; + typedef T value_type; + typedef T& reference; + typedef T const& const_reference; + typedef size_t size_type; + + union { + struct { T x, y; }; + struct { T s, t; }; + struct { T r, g; }; + }; + + enum { SIZE = 2 }; + inline static size_type size() { return SIZE; } + + // array access + inline T const& operator [] (size_t i) const { return (&x)[i]; } + inline T& operator [] (size_t i) { return (&x)[i]; } + + // ----------------------------------------------------------------------- + // we don't provide copy-ctor and operator= on purpose + // because we want the compiler generated versions + + // constructors + + // leaves object uninitialized. use with caution. + explicit tvec2(no_init) { } + + // default constructor + tvec2() : x(0), y(0) { } + + // handles implicit conversion to a tvec4. must not be explicit. + template + tvec2(A v) : x(v), y(v) { } + + template + tvec2(A x, B y) : x(x), y(y) { } + + template + explicit tvec2(const tvec2& v) : x(v.x), y(v.y) { } + + template + tvec2(const Impersonator< tvec2 >& v) + : x(((const tvec2&)v).x), + y(((const tvec2&)v).y) { } +}; + +// ---------------------------------------------------------------------------------------- + +typedef tvec2 vec2; + +// ---------------------------------------------------------------------------------------- +}; // namespace android + +#endif /* UI_VEC4_H */ diff --git a/third_party/android_frameworks_native/include/ui/vec3.h b/third_party/android_frameworks_native/include/ui/vec3.h new file mode 100644 index 000000000..dde59a96f --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/vec3.h @@ -0,0 +1,113 @@ +/* + * Copyright 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 UI_VEC3_H +#define UI_VEC3_H + +#include +#include + +#include + +namespace android { +// ------------------------------------------------------------------------------------- + +template +class tvec3 : public TVecProductOperators, + public TVecAddOperators, + public TVecUnaryOperators, + public TVecComparisonOperators, + public TVecFunctions +{ +public: + enum no_init { NO_INIT }; + typedef T value_type; + typedef T& reference; + typedef T const& const_reference; + typedef size_t size_type; + + union { + struct { T x, y, z; }; + struct { T s, t, p; }; + struct { T r, g, b; }; + Impersonator< tvec2 > xy; + Impersonator< tvec2 > st; + Impersonator< tvec2 > rg; + }; + + enum { SIZE = 3 }; + inline static size_type size() { return SIZE; } + + // array access + inline T const& operator [] (size_t i) const { return (&x)[i]; } + inline T& operator [] (size_t i) { return (&x)[i]; } + + // ----------------------------------------------------------------------- + // we don't provide copy-ctor and operator= on purpose + // because we want the compiler generated versions + + // constructors + // leaves object uninitialized. use with caution. + explicit tvec3(no_init) { } + + // default constructor + tvec3() : x(0), y(0), z(0) { } + + // handles implicit conversion to a tvec4. must not be explicit. + template + tvec3(A v) : x(v), y(v), z(v) { } + + template + tvec3(A x, B y, C z) : x(x), y(y), z(z) { } + + template + tvec3(const tvec2& v, B z) : x(v.x), y(v.y), z(z) { } + + template + explicit tvec3(const tvec3& v) : x(v.x), y(v.y), z(v.z) { } + + template + tvec3(const Impersonator< tvec3 >& v) + : x(((const tvec3&)v).x), + y(((const tvec3&)v).y), + z(((const tvec3&)v).z) { } + + template + tvec3(const Impersonator< tvec2 >& v, B z) + : x(((const tvec2&)v).x), + y(((const tvec2&)v).y), + z(z) { } + + // cross product works only on vectors of size 3 + template + friend inline + tvec3 __attribute__((pure)) cross(const tvec3& u, const tvec3& v) { + return tvec3( + u.y*v.z - u.z*v.y, + u.z*v.x - u.x*v.z, + u.x*v.y - u.y*v.x); + } +}; + + +// ---------------------------------------------------------------------------------------- + +typedef tvec3 vec3; + +// ---------------------------------------------------------------------------------------- +}; // namespace android + +#endif /* UI_VEC4_H */ diff --git a/third_party/android_frameworks_native/include/ui/vec4.h b/third_party/android_frameworks_native/include/ui/vec4.h new file mode 100644 index 000000000..e03d331fb --- /dev/null +++ b/third_party/android_frameworks_native/include/ui/vec4.h @@ -0,0 +1,118 @@ +/* + * Copyright 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 UI_VEC4_H +#define UI_VEC4_H + +#include +#include + +#include + +namespace android { +// ------------------------------------------------------------------------------------- + +template +class tvec4 : public TVecProductOperators, + public TVecAddOperators, + public TVecUnaryOperators, + public TVecComparisonOperators, + public TVecFunctions +{ +public: + enum no_init { NO_INIT }; + typedef T value_type; + typedef T& reference; + typedef T const& const_reference; + typedef size_t size_type; + + union { + struct { T x, y, z, w; }; + struct { T s, t, p, q; }; + struct { T r, g, b, a; }; + Impersonator< tvec2 > xy; + Impersonator< tvec2 > st; + Impersonator< tvec2 > rg; + Impersonator< tvec3 > xyz; + Impersonator< tvec3 > stp; + Impersonator< tvec3 > rgb; + }; + + enum { SIZE = 4 }; + inline static size_type size() { return SIZE; } + + // array access + inline T const& operator [] (size_t i) const { return (&x)[i]; } + inline T& operator [] (size_t i) { return (&x)[i]; } + + // ----------------------------------------------------------------------- + // we don't provide copy-ctor and operator= on purpose + // because we want the compiler generated versions + + // constructors + + // leaves object uninitialized. use with caution. + explicit tvec4(no_init) { } + + // default constructor + tvec4() : x(0), y(0), z(0), w(0) { } + + // handles implicit conversion to a tvec4. must not be explicit. + template + tvec4(A v) : x(v), y(v), z(v), w(v) { } + + template + tvec4(A x, B y, C z, D w) : x(x), y(y), z(z), w(w) { } + + template + tvec4(const tvec2& v, B z, C w) : x(v.x), y(v.y), z(z), w(w) { } + + template + tvec4(const tvec3& v, B w) : x(v.x), y(v.y), z(v.z), w(w) { } + + template + explicit tvec4(const tvec4& v) : x(v.x), y(v.y), z(v.z), w(v.w) { } + + template + tvec4(const Impersonator< tvec4 >& v) + : x(((const tvec4&)v).x), + y(((const tvec4&)v).y), + z(((const tvec4&)v).z), + w(((const tvec4&)v).w) { } + + template + tvec4(const Impersonator< tvec3 >& v, B w) + : x(((const tvec3&)v).x), + y(((const tvec3&)v).y), + z(((const tvec3&)v).z), + w(w) { } + + template + tvec4(const Impersonator< tvec2 >& v, B z, C w) + : x(((const tvec2&)v).x), + y(((const tvec2&)v).y), + z(z), + w(w) { } +}; + +// ---------------------------------------------------------------------------------------- + +typedef tvec4 vec4; + +// ---------------------------------------------------------------------------------------- +}; // namespace android + +#endif /* UI_VEC4_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/activity_recognition.h b/third_party/android_hardware_libhardware/include/hardware/activity_recognition.h new file mode 100644 index 000000000..8f9945982 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/activity_recognition.h @@ -0,0 +1,223 @@ +/* + * Copyright (C) 2014 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. + */ + +/* + * Activity Recognition HAL. The goal is to provide low power, low latency, always-on activity + * recognition implemented in hardware (i.e. these activity recognition algorithms/classifers + * should NOT be run on the AP). By low power we mean that this may be activated 24/7 without + * impacting the battery drain speed (goal in order of 1mW including the power for sensors). + * This HAL does not specify the input sources that are used towards detecting these activities. + * It has one monitor interface which can be used to batch activities for always-on + * activity_recognition and if the latency is zero, the same interface can be used for low latency + * detection. + */ + +#ifndef ANDROID_ACTIVITY_RECOGNITION_INTERFACE_H +#define ANDROID_ACTIVITY_RECOGNITION_INTERFACE_H + +#include + +__BEGIN_DECLS + +#define ACTIVITY_RECOGNITION_HEADER_VERSION 1 +#define ACTIVITY_RECOGNITION_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION_2(0, 1, ACTIVITY_RECOGNITION_HEADER_VERSION) + +#define ACTIVITY_RECOGNITION_HARDWARE_MODULE_ID "activity_recognition" +#define ACTIVITY_RECOGNITION_HARDWARE_INTERFACE "activity_recognition_hw_if" + +/* + * Define types for various activities. Multiple activities may be active at the same time and + * sometimes none of these activities may be active. + * + * Each activity has a corresponding type. Only activities that are defined here should use + * android.activity_recognition.* prefix. OEM defined activities should not use this prefix. + * Activity type of OEM-defined activities should start with the reverse domain name of the entity + * defining the activity. + * + * When android introduces a new activity type that can potentially replace an OEM-defined activity + * type, the OEM must use the official activity type on versions of the HAL that support this new + * official activity type. + * + * Example (made up): Suppose Google's Glass team wants to detect nodding activity. + * - Such an activity is not officially supported in android L + * - Glass devices launching on L can implement a custom activity with + * type = "com.google.glass.nodding" + * - In M android release, if android decides to define ACITIVITY_TYPE_NODDING, those types + * should replace the Glass-team-specific types in all future launches. + * - When launching glass on the M release, Google should now use the official activity type + * - This way, other applications can use this activity. + */ + +#define ACTIVITY_TYPE_IN_VEHICLE "android.activity_recognition.in_vehicle" + +#define ACTIVITY_TYPE_ON_BICYCLE "android.activity_recognition.on_bicycle" + +#define ACTIVITY_TYPE_WALKING "android.activity_recognition.walking" + +#define ACTIVITY_TYPE_RUNNING "android.activity_recognition.running" + +#define ACTIVITY_TYPE_STILL "android.activity_recognition.still" + +#define ACTIVITY_TYPE_TILTING "android.activity_recognition.tilting" + +/* Values for activity_event.event_types. */ +enum { + /* + * A flush_complete event which indicates that a flush() has been successfully completed. This + * does not correspond to any activity/event. An event of this type should be added to the end + * of a batch FIFO and it indicates that all the events in the batch FIFO have been successfully + * reported to the framework. An event of this type should be generated only if flush() has been + * explicitly called and if the FIFO is empty at the time flush() is called it should trivially + * return a flush_complete_event to indicate that the FIFO is empty. + * + * A flush complete event should have the following parameters set. + * activity_event_t.event_type = ACTIVITY_EVENT_FLUSH_COMPLETE + * activity_event_t.activity = 0 + * activity_event_t.timestamp = 0 + * activity_event_t.reserved = 0 + * See (*flush)() for more details. + */ + ACTIVITY_EVENT_FLUSH_COMPLETE = 0, + + /* Signifies entering an activity. */ + ACTIVITY_EVENT_ENTER = 1, + + /* Signifies exiting an activity. */ + ACTIVITY_EVENT_EXIT = 2 +}; + +/* + * Each event is a separate activity with event_type indicating whether this activity has started + * or ended. Eg event: (event_type="enter", activity="ON_FOOT", timestamp) + */ +typedef struct activity_event { + /* One of the ACTIVITY_EVENT_* constants defined above. */ + uint32_t event_type; + + /* + * Index of the activity in the list returned by get_supported_activities_list. If this event + * is a flush complete event, this should be set to zero. + */ + uint32_t activity; + + /* Time at which the transition/event has occurred in nanoseconds using elapsedRealTimeNano. */ + int64_t timestamp; + + /* Set to zero. */ + int32_t reserved[4]; +} activity_event_t; + +typedef struct activity_recognition_module { + /** + * Common methods of the activity recognition module. This *must* be the first member of + * activity_recognition_module as users of this structure will cast a hw_module_t to + * activity_recognition_module pointer in contexts where it's known the hw_module_t + * references an activity_recognition_module. + */ + hw_module_t common; + + /* + * List of all activities supported by this module including OEM defined activities. Each + * activity is represented using a string defined above. Each string should be null terminated. + * The index of the activity in this array is used as a "handle" for enabling/disabling and + * event delivery. + * Return value is the size of this list. + */ + int (*get_supported_activities_list)(struct activity_recognition_module* module, + char const* const* *activity_list); +} activity_recognition_module_t; + +struct activity_recognition_device; + +typedef struct activity_recognition_callback_procs { + // Callback for activity_data. This is guaranteed to not invoke any HAL methods. + // Memory allocated for the events can be reused after this method returns. + // events - Array of activity_event_t s that are reported. + // count - size of the array. + void (*activity_callback)(const struct activity_recognition_callback_procs* procs, + const activity_event_t* events, int count); +} activity_recognition_callback_procs_t; + +typedef struct activity_recognition_device { + /** + * Common methods of the activity recognition device. This *must* be the first member of + * activity_recognition_device as users of this structure will cast a hw_device_t to + * activity_recognition_device pointer in contexts where it's known the hw_device_t + * references an activity_recognition_device. + */ + hw_device_t common; + + /* + * Sets the callback to invoke when there are events to report. This call overwrites the + * previously registered callback (if any). + */ + void (*register_activity_callback)(const struct activity_recognition_device* dev, + const activity_recognition_callback_procs_t* callback); + + /* + * Activates monitoring of activity transitions. Activities need not be reported as soon as they + * are detected. The detected activities are stored in a FIFO and reported in batches when the + * "max_batch_report_latency" expires or when the batch FIFO is full. The implementation should + * allow the AP to go into suspend mode while the activities are detected and stored in the + * batch FIFO. Whenever events need to be reported (like when the FIFO is full or when the + * max_batch_report_latency has expired for an activity, event pair), it should wake_up the AP + * so that no events are lost. Activities are stored as transitions and they are allowed to + * overlap with each other. Each (activity, event_type) pair can be activated or deactivated + * independently of the other. The HAL implementation needs to keep track of which pairs are + * currently active and needs to detect only those pairs. + * + * activity_handle - Index of the specific activity that needs to be detected in the list + * returned by get_supported_activities_list. + * event_type - Specific transition of the activity that needs to be detected. + * max_batch_report_latency_ns - a transition can be delayed by at most + * “max_batch_report_latency” nanoseconds. + * Return 0 on success, negative errno code otherwise. + */ + int (*enable_activity_event)(const struct activity_recognition_device* dev, + uint32_t activity_handle, uint32_t event_type, int64_t max_batch_report_latency_ns); + + /* + * Disables detection of a specific (activity, event_type) pair. + */ + int (*disable_activity_event)(const struct activity_recognition_device* dev, + uint32_t activity_handle, uint32_t event_type); + + /* + * Flush all the batch FIFOs. Report all the activities that were stored in the FIFO so far as + * if max_batch_report_latency had expired. This shouldn't change the latency in any way. Add + * a flush_complete_event to indicate the end of the FIFO after all events are delivered. + * See ACTIVITY_EVENT_FLUSH_COMPLETE for more details. + * Return 0 on success, negative errno code otherwise. + */ + int (*flush)(const struct activity_recognition_device* dev); + + // Must be set to NULL. + void (*reserved_procs[16 - 4])(void); +} activity_recognition_device_t; + +static inline int activity_recognition_open(const hw_module_t* module, + activity_recognition_device_t** device) { + return module->methods->open(module, + ACTIVITY_RECOGNITION_HARDWARE_INTERFACE, (hw_device_t**)device); +} + +static inline int activity_recognition_close(activity_recognition_device_t* device) { + return device->common.close(&device->common); +} + +__END_DECLS + +#endif // ANDROID_ACTIVITY_RECOGNITION_INTERFACE_H diff --git a/third_party/android_hardware_libhardware/include/hardware/audio.h b/third_party/android_hardware_libhardware/include/hardware/audio.h new file mode 100644 index 000000000..22e741976 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/audio.h @@ -0,0 +1,700 @@ +/* + * 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 +#include +#include +#include + +#include + +#include +#include +#include +#ifdef AUDIO_LISTEN_ENABLED +#include +#endif + +__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_3_0 HARDWARE_DEVICE_API_VERSION(3, 0) +#define AUDIO_DEVICE_API_VERSION_CURRENT AUDIO_DEVICE_API_VERSION_3_0 +/* Minimal audio HAL version supported by the audio framework */ +#define AUDIO_DEVICE_API_VERSION_MIN 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" + +/* Hearing Aid Compatibility - Telecoil (HAC-T) mode on/off + Strings must be in sync with CallFeaturesSetting.java */ +#define AUDIO_PARAMETER_KEY_HAC "HACSetting" +#define AUDIO_PARAMETER_VALUE_HAC_ON "ON" +#define AUDIO_PARAMETER_VALUE_HAC_OFF "OFF" + +/* A2DP sink address set by framework */ +#define AUDIO_PARAMETER_A2DP_SINK_ADDRESS "a2dp_sink_address" + +/* A2DP source address set by framework */ +#define AUDIO_PARAMETER_A2DP_SOURCE_ADDRESS "a2dp_source_address" + +/* Screen state */ +#define AUDIO_PARAMETER_KEY_SCREEN_STATE "screen_state" + +/* Bluetooth SCO wideband */ +#define AUDIO_PARAMETER_KEY_BT_SCO_WB "bt_wbs" + +/* Get a new HW synchronization source identifier. + * Return a valid source (positive integer) or AUDIO_HW_SYNC_INVALID if an error occurs + * or no HW sync is available. */ +#define AUDIO_PARAMETER_HW_AV_SYNC "hw_av_sync" + +/* Device state*/ +#define AUDIO_PARAMETER_KEY_DEV_SHUTDOWN "dev_shutdown" + +/** + * 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 */ + +#define AUDIO_PARAMETER_DEVICE_CONNECT "connect" /* audio_devices_t */ +#define AUDIO_PARAMETER_DEVICE_DISCONNECT "disconnect" /* audio_devices_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" + +/* Set the HW synchronization source for an output stream. */ +#define AUDIO_PARAMETER_STREAM_HW_AV_SYNC "hw_av_sync" + +/** + * 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 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 { + /** + * Common methods of the audio stream out. This *must* be the first member of audio_stream_out + * as users of this structure will cast a audio_stream to audio_stream_out pointer in contexts + * where it's known the audio_stream references an 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 { + /** + * Common methods of the audio stream in. This *must* be the first member of audio_stream_in + * as users of this structure will cast a audio_stream to audio_stream_in pointer in contexts + * where it's known the audio_stream references an 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). + * + * Deprecated: use audio_stream_out_frame_size() or audio_stream_in_frame_size() instead. + */ +__attribute__((__deprecated__)) +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); +} + +/** + * return the frame size (number of bytes per sample) of an output stream. + */ +static inline size_t audio_stream_out_frame_size(const struct audio_stream_out *s) +{ + size_t chan_samp_sz; + audio_format_t format = s->common.get_format(&s->common); + + if (audio_is_linear_pcm(format)) { + chan_samp_sz = audio_bytes_per_sample(format); + return audio_channel_count_from_out_mask(s->common.get_channels(&s->common)) * chan_samp_sz; + } + + return sizeof(int8_t); +} + +/** + * return the frame size (number of bytes per sample) of an input stream. + */ +static inline size_t audio_stream_in_frame_size(const struct audio_stream_in *s) +{ + size_t chan_samp_sz; + audio_format_t format = s->common.get_format(&s->common); + + if (audio_is_linear_pcm(format)) { + chan_samp_sz = audio_bytes_per_sample(format); + return audio_channel_count_from_in_mask(s->common.get_channels(&s->common)) * 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 { + /** + * Common methods of the audio device. This *must* be the first member of audio_hw_device + * as users of this structure will cast a hw_device_t to audio_hw_device pointer in contexts + * where it's known the hw_device_t references an 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. + * The "address" parameter qualifies the "devices" audio device type if needed. + * The format format depends on the device type: + * - Bluetooth devices use the MAC address of the device in the form "00:11:22:AA:BB:CC" + * - USB devices use the ALSA card and device numbers in the form "card=X;device=Y" + * - Other devices may use a number or any other string. + */ + + 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, + const char *address); + + 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, + audio_input_flags_t flags, + const char *address, + audio_source_t source); + + 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); + + /** + * Routing control + */ + + /* Creates an audio patch between several source and sink ports. + * The handle is allocated by the HAL and should be unique for this + * audio HAL module. */ + int (*create_audio_patch)(struct audio_hw_device *dev, + unsigned int num_sources, + const struct audio_port_config *sources, + unsigned int num_sinks, + const struct audio_port_config *sinks, + audio_patch_handle_t *handle); + + /* Release an audio patch */ + int (*release_audio_patch)(struct audio_hw_device *dev, + audio_patch_handle_t handle); + + /* Fills the list of supported attributes for a given audio port. + * As input, "port" contains the information (type, role, address etc...) + * needed by the HAL to identify the port. + * As output, "port" contains possible attributes (sampling rates, formats, + * channel masks, gain controllers...) for this port. + */ + int (*get_audio_port)(struct audio_hw_device *dev, + struct audio_port *port); + + /* Set audio port configuration */ + int (*set_audio_port_config)(struct audio_hw_device *dev, + const struct audio_port_config *config); + +#ifdef AUDIO_LISTEN_ENABLED + /** This method creates the listen session and returns handle */ + int (*open_listen_session)(struct audio_hw_device *dev, + listen_open_params_t *params, + struct listen_session** handle); + + /** This method closes the listen session */ + int (*close_listen_session)(struct audio_hw_device *dev, + struct listen_session* handle); + + /** This method sets the mad observer callback */ + int (*set_mad_observer)(struct audio_hw_device *dev, + listen_callback_t cb_func); + + /** + * This method is used for setting listen hal specfic parameters. + * If multiple paramets are set in one call and setting any one of them + * fails it will return failure. + */ + int (*listen_set_parameters)(struct audio_hw_device *dev, + const char *kv_pairs); +#endif +}; +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/third_party/android_hardware_libhardware/include/hardware/audio_alsaops.h b/third_party/android_hardware_libhardware/include/hardware/audio_alsaops.h new file mode 100644 index 000000000..0d266ff55 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/audio_alsaops.h @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2014 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. + */ + +/* This file contains shared utility functions to handle the tinyalsa + * implementation for Android internal audio, generally in the hardware layer. + * Some routines may log a fatal error on failure, as noted. + */ + +#ifndef ANDROID_AUDIO_ALSAOPS_H +#define ANDROID_AUDIO_ALSAOPS_H + +#include +#include +#include + +__BEGIN_DECLS + +/* Converts audio_format to pcm_format. + * Parameters: + * format the audio_format_t to convert + * + * Logs a fatal error if format is not a valid convertible audio_format_t. + */ +static inline enum pcm_format pcm_format_from_audio_format(audio_format_t format) +{ + switch (format) { +#ifdef HAVE_BIG_ENDIAN + case AUDIO_FORMAT_PCM_16_BIT: + return PCM_FORMAT_S16_BE; + case AUDIO_FORMAT_PCM_24_BIT_PACKED: + return PCM_FORMAT_S24_3BE; + case AUDIO_FORMAT_PCM_32_BIT: + return PCM_FORMAT_S32_BE; + case AUDIO_FORMAT_PCM_8_24_BIT: + return PCM_FORMAT_S24_BE; +#else + case AUDIO_FORMAT_PCM_16_BIT: + return PCM_FORMAT_S16_LE; + case AUDIO_FORMAT_PCM_24_BIT_PACKED: + return PCM_FORMAT_S24_3LE; + case AUDIO_FORMAT_PCM_32_BIT: + return PCM_FORMAT_S32_LE; + case AUDIO_FORMAT_PCM_8_24_BIT: + return PCM_FORMAT_S24_LE; +#endif + case AUDIO_FORMAT_PCM_FLOAT: /* there is no equivalent for float */ + default: + LOG_ALWAYS_FATAL("pcm_format_from_audio_format: invalid audio format %#x", format); + return 0; + } +} + +/* Converts pcm_format to audio_format. + * Parameters: + * format the pcm_format to convert + * + * Logs a fatal error if format is not a valid convertible pcm_format. + */ +static inline audio_format_t audio_format_from_pcm_format(enum pcm_format format) +{ + switch (format) { +#ifdef HAVE_BIG_ENDIAN + case PCM_FORMAT_S16_BE: + return AUDIO_FORMAT_PCM_16_BIT; + case PCM_FORMAT_S24_3BE: + return AUDIO_FORMAT_PCM_24_BIT_PACKED; + case PCM_FORMAT_S24_BE: + return AUDIO_FORMAT_PCM_8_24_BIT; + case PCM_FORMAT_S32_BE: + return AUDIO_FORMAT_PCM_32_BIT; +#else + case PCM_FORMAT_S16_LE: + return AUDIO_FORMAT_PCM_16_BIT; + case PCM_FORMAT_S24_3LE: + return AUDIO_FORMAT_PCM_24_BIT_PACKED; + case PCM_FORMAT_S24_LE: + return AUDIO_FORMAT_PCM_8_24_BIT; + case PCM_FORMAT_S32_LE: + return AUDIO_FORMAT_PCM_32_BIT; +#endif + default: + LOG_ALWAYS_FATAL("audio_format_from_pcm_format: invalid pcm format %#x", format); + return 0; + } +} + +__END_DECLS + +#endif /* ANDROID_AUDIO_ALSAOPS_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/audio_amplifier.h b/third_party/android_hardware_libhardware/include/hardware/audio_amplifier.h new file mode 100644 index 000000000..e3477d52a --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/audio_amplifier.h @@ -0,0 +1,144 @@ +/* + * Copyright (C) 2015, The CyanogenMod 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 CM_AUDIO_AMPLIFIER_INTERFACE_H +#define CM_AUDIO_AMPLIFIER_INTERFACE_H + +#include +#include +#include + +#include +#include + +#include + +__BEGIN_DECLS + +#define AMPLIFIER_HARDWARE_MODULE_ID "audio_amplifier" + +#define AMPLIFIER_HARDWARE_INTERFACE "audio_amplifier_hw_if" + +#define AMPLIFIER_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) + +#define AMPLIFIER_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) +#define AMPLIFIER_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) +#define AMPLIFIER_DEVICE_API_VERSION_CURRENT AMPLIFIER_DEVICE_API_VERSION_2_0 + +struct str_parms; + +typedef struct amplifier_device { + /** + * Common methods of the amplifier device. This *must* be the first member + * of amplifier_device as users of this structure will cast a hw_device_t + * to amplifier_device pointer in contexts where it's known + * the hw_device_t references a amplifier_device. + */ + struct hw_device_t common; + + /** + * Notify amplifier device of current input devices + * + * This function should handle only input devices. + */ + int (*set_input_devices)(struct amplifier_device *device, uint32_t devices); + + /** + * Notify amplifier device of current output devices + * + * This function should handle only output devices. + */ + int (*set_output_devices)(struct amplifier_device *device, uint32_t devices); + + /** + * Notify amplifier device of output device enable/disable + * + * This function should handle only output devices. + */ + int (*enable_output_devices)(struct amplifier_device *device, + uint32_t devices, bool enable); + + /** + * Notify amplifier device of input device enable/disable + * + * This function should handle only input devices. + */ + int (*enable_input_devices)(struct amplifier_device *device, + uint32_t devices, bool enable); + + /** + * Notify amplifier device about current audio mode + */ + int (*set_mode)(struct amplifier_device *device, audio_mode_t mode); + + /** + * Notify amplifier device that an output stream has started + */ + int (*output_stream_start)(struct amplifier_device *device, + struct audio_stream_out *stream, bool offload); + + /** + * Notify amplifier device that an input stream has started + */ + int (*input_stream_start)(struct amplifier_device *device, + struct audio_stream_in *stream); + + /** + * Notify amplifier device that an output stream has stopped + */ + int (*output_stream_standby)(struct amplifier_device *device, + struct audio_stream_out *stream); + + /** + * Notify amplifier device that an input stream has stopped + */ + int (*input_stream_standby)(struct amplifier_device *device, + struct audio_stream_in *stream); + + /** + * set/get output audio device parameters. + */ + int (*set_parameters)(struct amplifier_device *device, + struct str_parms *parms); +} amplifier_device_t; + +typedef struct amplifier_module { + /** + * Common methods of the amplifier module. This *must* be the first member + * of amplifier_module as users of this structure will cast a hw_module_t + * to amplifier_module pointer in contexts where it's known + * the hw_module_t references a amplifier_module. + */ + struct hw_module_t common; +} amplifier_module_t; + +/** convenience API for opening and closing a supported device */ + +static inline int amplifier_device_open(const struct hw_module_t *module, + struct amplifier_device **device) +{ + return module->methods->open(module, AMPLIFIER_HARDWARE_INTERFACE, + (struct hw_device_t **) device); +} + +static inline int amplifier_device_close(struct amplifier_device *device) +{ + return device->common.close(&device->common); +} + +__END_DECLS + +#endif // CM_AUDIO_AMPLIFIER_INTERFACE_H diff --git a/third_party/android_hardware_libhardware/include/hardware/audio_effect.h b/third_party/android_hardware_libhardware/include/hardware/audio_effect.h new file mode 100644 index 000000000..41cd2e614 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/audio_effect.h @@ -0,0 +1,1014 @@ +/* + * 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 +#include +#include +#include +#include + +#include + +#include + + +__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 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 () +// 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 () +// 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 () +// 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 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 in + // 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/third_party/android_hardware_libhardware/include/hardware/audio_policy.h b/third_party/android_hardware_libhardware/include/hardware/audio_policy.h new file mode 100644 index 000000000..99cb0449f --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/audio_policy.h @@ -0,0 +1,457 @@ +/* + * 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_POLICY_INTERFACE_H +#define ANDROID_AUDIO_POLICY_INTERFACE_H + +#include +#include +#include + +#include + +#include +#include + +__BEGIN_DECLS + +/** + * The id of this module + */ +#define AUDIO_POLICY_HARDWARE_MODULE_ID "audio_policy" + +/** + * Name of the audio devices to open + */ +#define AUDIO_POLICY_INTERFACE "policy" + +/* ---------------------------------------------------------------------------- */ + +/* + * The audio_policy and audio_policy_service_ops structs define the + * communication interfaces between the platform specific audio policy manager + * and Android generic audio policy manager. + * The platform specific audio policy manager must implement methods of the + * audio_policy struct. + * This implementation makes use of the audio_policy_service_ops to control + * the activity and configuration of audio input and output streams. + * + * The platform specific audio policy manager is in charge of the audio + * routing and volume control policies for a given platform. + * The main roles of this module are: + * - keep track of current system state (removable device connections, phone + * state, user requests...). + * System state changes and user actions are notified to audio policy + * manager with methods of the audio_policy. + * + * - process get_output() queries received when AudioTrack objects are + * created: Those queries return a handler on an output that has been + * selected, configured and opened by the audio policy manager and that + * must be used by the AudioTrack when registering to the AudioFlinger + * with the createTrack() method. + * When the AudioTrack object is released, a release_output() query + * is received and the audio policy manager can decide to close or + * reconfigure the output depending on other streams using this output and + * current system state. + * + * - similarly process get_input() and release_input() queries received from + * AudioRecord objects and configure audio inputs. + * - process volume control requests: the stream volume is converted from + * an index value (received from UI) to a float value applicable to each + * output as a function of platform specific settings and current output + * route (destination device). It also make sure that streams are not + * muted if not allowed (e.g. camera shutter sound in some countries). + */ + +/* XXX: this should be defined OUTSIDE of frameworks/base */ +struct effect_descriptor_s; + +struct audio_policy { + /* + * configuration functions + */ + + /* indicate a change in device connection status */ + int (*set_device_connection_state)(struct audio_policy *pol, + audio_devices_t device, + audio_policy_dev_state_t state, + const char *device_address); + + /* retrieve a device connection status */ + audio_policy_dev_state_t (*get_device_connection_state)( + const struct audio_policy *pol, + audio_devices_t device, + const char *device_address); + + /* indicate a change in phone state. Valid phones states are defined + * by audio_mode_t */ + void (*set_phone_state)(struct audio_policy *pol, audio_mode_t state); + + /* deprecated, never called (was "indicate a change in ringer mode") */ + void (*set_ringer_mode)(struct audio_policy *pol, uint32_t mode, + uint32_t mask); + + /* force using a specific device category for the specified usage */ + void (*set_force_use)(struct audio_policy *pol, + audio_policy_force_use_t usage, + audio_policy_forced_cfg_t config); + + /* retrieve current device category forced for a given usage */ + audio_policy_forced_cfg_t (*get_force_use)(const struct audio_policy *pol, + audio_policy_force_use_t usage); + + /* if can_mute is true, then audio streams that are marked ENFORCED_AUDIBLE + * can still be muted. */ + void (*set_can_mute_enforced_audible)(struct audio_policy *pol, + bool can_mute); + + /* check proper initialization */ + int (*init_check)(const struct audio_policy *pol); + + /* + * Audio routing query functions + */ + + /* request an output appropriate for playback of the supplied stream type and + * parameters */ + audio_io_handle_t (*get_output)(struct audio_policy *pol, + audio_stream_type_t stream, + uint32_t samplingRate, + audio_format_t format, + audio_channel_mask_t channelMask, + audio_output_flags_t flags, + const audio_offload_info_t *offloadInfo); + + /* indicates to the audio policy manager that the output starts being used + * by corresponding stream. */ + int (*start_output)(struct audio_policy *pol, + audio_io_handle_t output, + audio_stream_type_t stream, + int session); + + /* indicates to the audio policy manager that the output stops being used + * by corresponding stream. */ + int (*stop_output)(struct audio_policy *pol, + audio_io_handle_t output, + audio_stream_type_t stream, + int session); + + /* releases the output. */ + void (*release_output)(struct audio_policy *pol, audio_io_handle_t output); + + /* request an input appropriate for record from the supplied device with + * supplied parameters. */ + audio_io_handle_t (*get_input)(struct audio_policy *pol, audio_source_t inputSource, + uint32_t samplingRate, + audio_format_t format, + audio_channel_mask_t channelMask, + audio_in_acoustics_t acoustics); + + /* indicates to the audio policy manager that the input starts being used */ + int (*start_input)(struct audio_policy *pol, audio_io_handle_t input); + + /* indicates to the audio policy manager that the input stops being used. */ + int (*stop_input)(struct audio_policy *pol, audio_io_handle_t input); + + /* releases the input. */ + void (*release_input)(struct audio_policy *pol, audio_io_handle_t input); + + /* + * volume control functions + */ + + /* initialises stream volume conversion parameters by specifying volume + * index range. The index range for each stream is defined by AudioService. */ + void (*init_stream_volume)(struct audio_policy *pol, + audio_stream_type_t stream, + int index_min, + int index_max); + + /* sets the new stream volume at a level corresponding to the supplied + * index. The index is within the range specified by init_stream_volume() */ + int (*set_stream_volume_index)(struct audio_policy *pol, + audio_stream_type_t stream, + int index); + + /* retrieve current volume index for the specified stream */ + int (*get_stream_volume_index)(const struct audio_policy *pol, + audio_stream_type_t stream, + int *index); + + /* sets the new stream volume at a level corresponding to the supplied + * index for the specified device. + * The index is within the range specified by init_stream_volume() */ + int (*set_stream_volume_index_for_device)(struct audio_policy *pol, + audio_stream_type_t stream, + int index, + audio_devices_t device); + + /* retrieve current volume index for the specified stream for the specified device */ + int (*get_stream_volume_index_for_device)(const struct audio_policy *pol, + audio_stream_type_t stream, + int *index, + audio_devices_t device); + + /* return the strategy corresponding to a given stream type */ + uint32_t (*get_strategy_for_stream)(const struct audio_policy *pol, + audio_stream_type_t stream); + + /* return the enabled output devices for the given stream type */ + audio_devices_t (*get_devices_for_stream)(const struct audio_policy *pol, + audio_stream_type_t stream); + + /* Audio effect management */ + audio_io_handle_t (*get_output_for_effect)(struct audio_policy *pol, + const struct effect_descriptor_s *desc); + + int (*register_effect)(struct audio_policy *pol, + const struct effect_descriptor_s *desc, + audio_io_handle_t output, + uint32_t strategy, + int session, + int id); + + int (*unregister_effect)(struct audio_policy *pol, int id); + + int (*set_effect_enabled)(struct audio_policy *pol, int id, bool enabled); + + bool (*is_stream_active)(const struct audio_policy *pol, + audio_stream_type_t stream, + uint32_t in_past_ms); + + bool (*is_stream_active_remotely)(const struct audio_policy *pol, + audio_stream_type_t stream, + uint32_t in_past_ms); + + bool (*is_source_active)(const struct audio_policy *pol, + audio_source_t source); + + /* dump state */ + int (*dump)(const struct audio_policy *pol, int fd); + + /* check if offload is possible for given sample rate, bitrate, duration, ... */ + bool (*is_offload_supported)(const struct audio_policy *pol, + const audio_offload_info_t *info); +}; + + +struct audio_policy_service_ops { + /* + * Audio output Control functions + */ + + /* Opens an audio output with the requested parameters. + * + * The parameter values can indicate to use the default values in case the + * audio policy manager has no specific requirements for the output being + * opened. + * + * When the function returns, the parameter values reflect the actual + * values used by the audio hardware output stream. + * + * The audio policy manager can check if the proposed parameters are + * suitable or not and act accordingly. + */ + audio_io_handle_t (*open_output)(void *service, + audio_devices_t *pDevices, + uint32_t *pSamplingRate, + audio_format_t *pFormat, + audio_channel_mask_t *pChannelMask, + uint32_t *pLatencyMs, + audio_output_flags_t flags); + + /* creates a special output that is duplicated to the two outputs passed as + * arguments. The duplication is performed by + * a special mixer thread in the AudioFlinger. + */ + audio_io_handle_t (*open_duplicate_output)(void *service, + audio_io_handle_t output1, + audio_io_handle_t output2); + + /* closes the output stream */ + int (*close_output)(void *service, audio_io_handle_t output); + + /* suspends the output. + * + * When an output is suspended, the corresponding audio hardware output + * stream is placed in standby and the AudioTracks attached to the mixer + * thread are still processed but the output mix is discarded. + */ + int (*suspend_output)(void *service, audio_io_handle_t output); + + /* restores a suspended output. */ + int (*restore_output)(void *service, audio_io_handle_t output); + + /* */ + /* Audio input Control functions */ + /* */ + + /* opens an audio input + * deprecated - new implementations should use open_input_on_module, + * and the acoustics parameter is ignored + */ + audio_io_handle_t (*open_input)(void *service, + audio_devices_t *pDevices, + uint32_t *pSamplingRate, + audio_format_t *pFormat, + audio_channel_mask_t *pChannelMask, + audio_in_acoustics_t acoustics); + + /* closes an audio input */ + int (*close_input)(void *service, audio_io_handle_t input); + + /* */ + /* misc control functions */ + /* */ + + /* set a stream volume for a particular output. + * + * For the same user setting, a given stream type can have different + * volumes for each output (destination device) it is attached to. + */ + int (*set_stream_volume)(void *service, + audio_stream_type_t stream, + float volume, + audio_io_handle_t output, + int delay_ms); + + /* invalidate a stream type, causing a reroute to an unspecified new output */ + int (*invalidate_stream)(void *service, + audio_stream_type_t stream); + + /* function enabling to send proprietary informations directly from audio + * policy manager to audio hardware interface. */ + void (*set_parameters)(void *service, + audio_io_handle_t io_handle, + const char *kv_pairs, + int delay_ms); + + /* function enabling to receive proprietary informations directly from + * audio hardware interface to audio policy manager. + * + * Returns a pointer to a heap allocated string. The caller is responsible + * for freeing the memory for it using free(). + */ + + char * (*get_parameters)(void *service, audio_io_handle_t io_handle, + const char *keys); + + /* request the playback of a tone on the specified stream. + * used for instance to replace notification sounds when playing over a + * telephony device during a phone call. + */ + int (*start_tone)(void *service, + audio_policy_tone_t tone, + audio_stream_type_t stream); + + int (*stop_tone)(void *service); + + /* set down link audio volume. */ + int (*set_voice_volume)(void *service, + float volume, + int delay_ms); + + /* move effect to the specified output */ + int (*move_effects)(void *service, + int session, + audio_io_handle_t src_output, + audio_io_handle_t dst_output); + + /* loads an audio hw module. + * + * The module name passed is the base name of the HW module library, e.g "primary" or "a2dp". + * The function returns a handle on the module that will be used to specify a particular + * module when calling open_output_on_module() or open_input_on_module() + */ + audio_module_handle_t (*load_hw_module)(void *service, + const char *name); + + /* Opens an audio output on a particular HW module. + * + * Same as open_output() but specifying a specific HW module on which the output must be opened. + */ + audio_io_handle_t (*open_output_on_module)(void *service, + audio_module_handle_t module, + audio_devices_t *pDevices, + uint32_t *pSamplingRate, + audio_format_t *pFormat, + audio_channel_mask_t *pChannelMask, + uint32_t *pLatencyMs, + audio_output_flags_t flags, + const audio_offload_info_t *offloadInfo); + + /* Opens an audio input on a particular HW module. + * + * Same as open_input() but specifying a specific HW module on which the input must be opened. + * Also removed deprecated acoustics parameter + */ + audio_io_handle_t (*open_input_on_module)(void *service, + audio_module_handle_t module, + audio_devices_t *pDevices, + uint32_t *pSamplingRate, + audio_format_t *pFormat, + audio_channel_mask_t *pChannelMask); + +}; + +/**********************************************************************/ + +/** + * 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 audio_policy_module { + struct hw_module_t common; +} audio_policy_module_t; + +struct audio_policy_device { + /** + * Common methods of the audio policy device. This *must* be the first member of + * audio_policy_device as users of this structure will cast a hw_device_t to + * audio_policy_device pointer in contexts where it's known the hw_device_t references an + * audio_policy_device. + */ + struct hw_device_t common; + + int (*create_audio_policy)(const struct audio_policy_device *device, + struct audio_policy_service_ops *aps_ops, + void *service, + struct audio_policy **ap); + + int (*destroy_audio_policy)(const struct audio_policy_device *device, + struct audio_policy *ap); +}; + +/** convenience API for opening and closing a supported device */ + +static inline int audio_policy_dev_open(const hw_module_t* module, + struct audio_policy_device** device) +{ + return module->methods->open(module, AUDIO_POLICY_INTERFACE, + (hw_device_t**)device); +} + +static inline int audio_policy_dev_close(struct audio_policy_device* device) +{ + return device->common.close(&device->common); +} + + +__END_DECLS + +#endif // ANDROID_AUDIO_POLICY_INTERFACE_H diff --git a/third_party/android_hardware_libhardware/include/hardware/bluetooth.h b/third_party/android_hardware_libhardware/include/hardware/bluetooth.h new file mode 100644 index 000000000..5e8b468d6 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/bluetooth.h @@ -0,0 +1,595 @@ +/* + * 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 +#include +#include +#include + +#include + +__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_HANDSFREE_CLIENT_ID "handsfree_client" +#define BT_PROFILE_ADVANCED_AUDIO_ID "a2dp" +#define BT_PROFILE_ADVANCED_AUDIO_SINK_ID "a2dp_sink" +#define BT_PROFILE_HEALTH_ID "health" +#define BT_PROFILE_SOCKETS_ID "socket" +#define BT_PROFILE_HIDHOST_ID "hidhost" +#define BT_PROFILE_HIDDEV_ID "hiddev" +#define BT_PROFILE_PAN_ID "pan" +#define BT_PROFILE_MAP_CLIENT_ID "map_client" +#define BT_PROFILE_SDP_CLIENT_ID "sdp" +#define BT_PROFILE_GATT_ID "gatt" +#define BT_PROFILE_AV_RC_ID "avrcp" +#define WIPOWER_PROFILE_ID "wipower" +#define BT_PROFILE_AV_RC_CTRL_ID "avrcp_ctrl" + +/** 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_AUTH_REJECTED + +} bt_status_t; + +/** Bluetooth PinKey Code */ +typedef struct { + uint8_t pin[16]; +} __attribute__((packed))bt_pin_code_t; + +typedef struct { + uint8_t status; + uint8_t ctrl_state; /* stack reported state */ + uint64_t tx_time; /* in ms */ + uint64_t rx_time; /* in ms */ + uint64_t idle_time; /* in ms */ + uint64_t energy_used; /* a product of mA, V and ms */ +} __attribute__((packed))bt_activity_energy_info; + +/** 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; + +typedef struct +{ + uint16_t version_supported; + uint8_t local_privacy_enabled; + uint8_t max_adv_instance; + uint8_t rpa_offload_supported; + uint8_t max_irk_list_size; + uint8_t max_adv_filter_supported; + uint8_t activity_energy_info_supported; + uint16_t scan_result_storage_size; + uint16_t total_trackable_advertisers; + bool extended_scan_support; + bool debug_logging_supported; +}bt_local_le_features_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, + + /** + * Description - Local LE features + * Access mode - GET. + * Data type - bt_local_le_features_t. + */ + BT_PROPERTY_LOCAL_LE_FEATURES, + + 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, bool min_16_digit); + +/** 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); + +/** Bluetooth HCI event Callback */ +/* Receive any HCI event from controller for raw commands */ +typedef void (*hci_event_recv_callback)(uint8_t event_code, 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); + +/** Callback invoked when energy details are obtained */ +/* Ctrl_state-Current controller state-Active-1,scan-2,or idle-3 state as defined by HCI spec. + * If the ctrl_state value is 0, it means the API call failed + * Time values-In milliseconds as returned by the controller + * Energy used-Value as returned by the controller + * Status-Provides the status of the read_energy_info API call */ +typedef void (*energy_info_callback)(bt_activity_energy_info *energy_info); + +/** 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; + energy_info_callback energy_info_cb; + hci_event_recv_callback hci_event_recv_cb; +} bt_callbacks_t; + +typedef void (*alarm_cb)(void *data); +typedef bool (*set_wake_alarm_callout)(uint64_t delay_millis, bool should_wake, alarm_cb cb, void *data); +typedef int (*acquire_wake_lock_callout)(const char *lock_name); +typedef int (*release_wake_lock_callout)(const char *lock_name); + +/** The set of functions required by bluedroid to set wake alarms and + * grab wake locks. This struct is passed into the stack through the + * |set_os_callouts| function on |bt_interface_t|. + */ +typedef struct { + /* set to sizeof(bt_os_callouts_t) */ + size_t size; + + set_wake_alarm_callout set_wake_alarm; + acquire_wake_lock_callout acquire_wake_lock; + release_wake_lock_callout release_wake_lock; +} bt_os_callouts_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)(bool guest_mode); + + /** Disable Bluetooth. */ + int (*disable)(void); + + /** Closes the interface. */ + void (*cleanup)(void); + + /** SSR cleanup. */ + void (*ssrcleanup)(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, int transport); + + /** Remove Bond */ + int (*remove_bond)(const bt_bdaddr_t *bd_addr); + + /** Cancel Bond */ + int (*cancel_bond)(const bt_bdaddr_t *bd_addr); + + /** + * Get the connection status for a given remote device. + * return value of 0 means the device is not connected, + * non-zero return status indicates an active connection. + */ + int (*get_connection_state)(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); + + /* Send any test HCI command to the controller. */ + int (*hci_cmd_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); + + /** Sets the OS call-out functions that bluedroid needs for alarms and wake locks. + * This should be called immediately after a successful |init|. + */ + int (*set_os_callouts)(bt_os_callouts_t *callouts); + + /** Read Energy info details - return value indicates BT_STATUS_SUCCESS or BT_STATUS_NOT_READY + * Success indicates that the VSC command was sent to controller + */ + int (*read_energy_info)(); + + /** + * Native support for dumpsys function + * Function is synchronous and |fd| is owned by caller. + */ + void (*dump)(int fd); + + /** + * Clear /data/misc/bt_config.conf and erase all stored connections + */ + int (*config_clear)(void); + + /** BT stack Test interface */ + const void* (*get_testapp_interface)(int test_app_profile); + + /** + * Clear (reset) the dynamic portion of the device interoperability database. + */ + void (*interop_database_clear)(void); + + /** + * Add a new device interoperability workaround for a remote device whose + * first |len| bytes of the its device address match |addr|. + * NOTE: |feature| has to match an item defined in interop_feature_t (interop.h). + */ + void (*interop_database_add)(uint16_t feature, const bt_bdaddr_t *addr, size_t len); +} 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/third_party/android_hardware_libhardware/include/hardware/bt_av.h b/third_party/android_hardware_libhardware/include/hardware/bt_av.h new file mode 100644 index 000000000..be82fbeff --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/bt_av.h @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2013-2014, The Linux Foundation. All rights reserved. + * Not a Contribution. + * + * 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); + +/** Callback for connection priority of device for incoming connection + * btav_connection_priority_t + */ +typedef void (* btav_connection_priority_callback)(bt_bdaddr_t *bd_addr); + +/** Callback for audio configuration change. + * Used only for the A2DP sink interface. + * state will have one of the values from btav_audio_state_t + * sample_rate: sample rate in Hz + * channel_count: number of channels (1 for mono, 2 for stereo) + */ +typedef void (* btav_audio_config_callback)(bt_bdaddr_t *bd_addr, + uint32_t sample_rate, + uint8_t channel_count); + +/** Callback for updating apps for A2dp multicast state. + */ + +typedef void (* btav_is_multicast_enabled_callback)(int state); + +/* + * Callback for audio focus request to be used only in + * case of A2DP Sink. This is required because we are using + * AudioTrack approach for audio data rendering. + */ +typedef void (* btav_audio_focus_request_callback)(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_audio_config_callback audio_config_cb; + btav_connection_priority_callback connection_priority_cb; + btav_is_multicast_enabled_callback multicast_state_cb; + btav_audio_focus_request_callback audio_focus_request_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. + * Used for both the A2DP source and sink interfaces. + */ +typedef struct { + + /** set to sizeof(btav_interface_t) */ + size_t size; + /** + * Register the BtAv callbacks + */ + bt_status_t (*init)( btav_callbacks_t* callbacks , int max_a2dp_connections, + int a2dp_multicast_state); + + /** 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 ); + + /** Send priority of device to stack*/ + void (*allow_connection)( int is_valid , bt_bdaddr_t *bd_addr); + + /** Sends Audio Focus State. */ + void (*audio_focus_state)( int focus_state ); +} btav_interface_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_AV_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/bt_common_types.h b/third_party/android_hardware_libhardware/include/hardware/bt_common_types.h new file mode 100644 index 000000000..e30ac24e3 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/bt_common_types.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2015 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. + */ + +/****************************************************************************** + * + * This file contains constants and definitions that can be used commonly between JNI and stack layer + * + ******************************************************************************/ +#ifndef ANDROID_INCLUDE_BT_COMMON_TYPES_H +#define ANDROID_INCLUDE_BT_COMMON_TYPES_H + +#include "bluetooth.h" + +typedef struct +{ + uint8_t client_if; + uint8_t filt_index; + uint8_t advertiser_state; + uint8_t advertiser_info_present; + uint8_t addr_type; + uint8_t tx_power; + int8_t rssi_value; + uint16_t time_stamp; + bt_bdaddr_t bd_addr; + uint8_t adv_pkt_len; + uint8_t *p_adv_pkt_data; + uint8_t scan_rsp_len; + uint8_t *p_scan_rsp_data; +} btgatt_track_adv_info_t; + +#endif /* ANDROID_INCLUDE_BT_COMMON_TYPES_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/bt_gatt.h b/third_party/android_hardware_libhardware/include/hardware/bt_gatt.h new file mode 100644 index 000000000..42e14c2f1 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/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 +#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/third_party/android_hardware_libhardware/include/hardware/bt_gatt_client.h b/third_party/android_hardware_libhardware/include/hardware/bt_gatt_client.h new file mode 100644 index 000000000..e7e8e82bb --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/bt_gatt_client.h @@ -0,0 +1,455 @@ +/* + * 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 +#include "bt_gatt_types.h" +#include "bt_common_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 +{ + uint8_t client_if; + uint8_t action; + uint8_t filt_index; + uint16_t feat_seln; + uint16_t list_logic_type; + uint8_t filt_logic_type; + uint8_t rssi_high_thres; + uint8_t rssi_low_thres; + uint8_t dely_mode; + uint16_t found_timeout; + uint16_t lost_timeout; + uint8_t found_timeout_cnt; + uint16_t num_of_tracking_entries; +} btgatt_filt_param_setup_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 error codes */ +typedef enum +{ + BT_GATTC_COMMAND_SUCCESS = 0, /* 0 Command succeeded */ + BT_GATTC_COMMAND_STARTED, /* 1 Command started OK. */ + BT_GATTC_COMMAND_BUSY, /* 2 Device busy with another command */ + BT_GATTC_COMMAND_STORED, /* 3 request is stored in control block */ + BT_GATTC_NO_RESOURCES, /* 4 No resources to issue command */ + BT_GATTC_MODE_UNSUPPORTED, /* 5 Request for 1 or more unsupported modes */ + BT_GATTC_ILLEGAL_VALUE, /* 6 Illegal command /parameter value */ + BT_GATTC_INCORRECT_STATE, /* 7 Device in wrong state for request */ + BT_GATTC_UNKNOWN_ADDR, /* 8 Unknown remote BD address */ + BT_GATTC_DEVICE_TIMEOUT, /* 9 Device timeout */ + BT_GATTC_INVALID_CONTROLLER_OUTPUT,/* 10 An incorrect value was received from HCI */ + BT_GATTC_SECURITY_ERROR, /* 11 Authorization or security failure or not authorized */ + BT_GATTC_DELAYED_ENCRYPTION_CHECK, /*12 Delayed encryption check */ + BT_GATTC_ERR_PROCESSING /* 12 Generic error */ +} btgattc_error_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 indicating the status of a listen() operation + */ +typedef void (*listen_callback)(int status, int server_if); + +/** Callback invoked when the MTU for a given connection changes */ +typedef void (*configure_mtu_callback)(int conn_id, int status, int mtu); + +/** Callback invoked when a scan filter configuration command has completed */ +typedef void (*scan_filter_cfg_callback)(int action, int client_if, int status, int filt_type, + int avbl_space); + +/** Callback invoked when scan param has been added, cleared, or deleted */ +typedef void (*scan_filter_param_callback)(int action, int client_if, int status, + int avbl_space); + +/** Callback invoked when a scan filter configuration command has completed */ +typedef void (*scan_filter_status_callback)(int enable, int client_if, int status); + +/** Callback invoked when multi-adv enable operation has completed */ +typedef void (*multi_adv_enable_callback)(int client_if, int status); + +/** Callback invoked when multi-adv param update operation has completed */ +typedef void (*multi_adv_update_callback)(int client_if, int status); + +/** Callback invoked when multi-adv instance data set operation has completed */ +typedef void (*multi_adv_data_callback)(int client_if, int status); + +/** Callback invoked when multi-adv disable operation has completed */ +typedef void (*multi_adv_disable_callback)(int client_if, int status); + +/** + * Callback notifying an application that a remote device connection is currently congested + * and cannot receive any more data. An application should avoid sending more data until + * a further callback is received indicating the congestion status has been cleared. + */ +typedef void (*congestion_callback)(int conn_id, bool congested); +/** Callback invoked when batchscan storage config operation has completed */ +typedef void (*batchscan_cfg_storage_callback)(int client_if, int status); + +/** Callback invoked when batchscan enable / disable operation has completed */ +typedef void (*batchscan_enable_disable_callback)(int action, int client_if, int status); + +/** Callback invoked when batchscan reports are obtained */ +typedef void (*batchscan_reports_callback)(int client_if, int status, int report_format, + int num_records, int data_len, uint8_t* rep_data); + +/** Callback invoked when batchscan storage threshold limit is crossed */ +typedef void (*batchscan_threshold_callback)(int client_if); + +/** Track ADV VSE callback invoked when tracked device is found or lost */ +typedef void (*track_adv_event_callback)(btgatt_track_adv_info_t *p_track_adv_info); + +/** Callback invoked when scan parameter setup has completed */ +typedef void (*scan_parameter_setup_completed_callback)(int client_if, + btgattc_error_t status); + +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; + configure_mtu_callback configure_mtu_cb; + scan_filter_cfg_callback scan_filter_cfg_cb; + scan_filter_param_callback scan_filter_param_cb; + scan_filter_status_callback scan_filter_status_cb; + multi_adv_enable_callback multi_adv_enable_cb; + multi_adv_update_callback multi_adv_update_cb; + multi_adv_data_callback multi_adv_data_cb; + multi_adv_disable_callback multi_adv_disable_cb; + congestion_callback congestion_cb; + batchscan_cfg_storage_callback batchscan_cfg_storage_cb; + batchscan_enable_disable_callback batchscan_enb_disable_cb; + batchscan_reports_callback batchscan_reports_cb; + batchscan_threshold_callback batchscan_threshold_cb; + track_adv_event_callback track_adv_event_cb; + scan_parameter_setup_completed_callback scan_parameter_setup_completed_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)( 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, int transport ); + + /** 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); + + /** Setup scan filter params */ + bt_status_t (*scan_filter_param_setup)(btgatt_filt_param_setup_t filt_param); + + + /** Configure a scan filter condition */ + bt_status_t (*scan_filter_add_remove)(int client_if, int action, int filt_type, + int filt_index, int company_id, + int company_id_mask, const bt_uuid_t *p_uuid, + const bt_uuid_t *p_uuid_mask, const bt_bdaddr_t *bd_addr, + char addr_type, int data_len, char* p_data, int mask_len, + char* p_mask); + + /** Clear all scan filter conditions for specific filter index*/ + bt_status_t (*scan_filter_clear)(int client_if, int filt_index); + + /** Enable / disable scan filter feature*/ + bt_status_t (*scan_filter_enable)(int client_if, bool enable); + + /** 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 client_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, + uint16_t service_data_len, char* service_data, + uint16_t service_uuid_len, char* service_uuid); + + /** Configure the MTU for a given connection */ + bt_status_t (*configure_mtu)(int conn_id, int mtu); + + /** Request a connection parameter update */ + bt_status_t (*conn_parameter_update)(const bt_bdaddr_t *bd_addr, int min_interval, + int max_interval, int latency, int timeout); + + /** Sets the LE scan interval and window in units of N*0.625 msec */ + bt_status_t (*set_scan_parameters)(int client_if, int scan_interval, int scan_window); + + /* Setup the parameters as per spec, user manual specified values and enable multi ADV */ + bt_status_t (*multi_adv_enable)(int client_if, int min_interval,int max_interval,int adv_type, + int chnl_map, int tx_power, int timeout_s); + + /* Update the parameters as per spec, user manual specified values and restart multi ADV */ + bt_status_t (*multi_adv_update)(int client_if, int min_interval,int max_interval,int adv_type, + int chnl_map, int tx_power, int timeout_s); + + /* Setup the data for the specified instance */ + bt_status_t (*multi_adv_set_inst_data)(int client_if, bool set_scan_rsp, bool include_name, + bool incl_txpower, int appearance, int manufacturer_len, + char* manufacturer_data, int service_data_len, + char* service_data, int service_uuid_len, char* service_uuid); + + /* Disable the multi adv instance */ + bt_status_t (*multi_adv_disable)(int client_if); + + /* Configure the batchscan storage */ + bt_status_t (*batchscan_cfg_storage)(int client_if, int batch_scan_full_max, + int batch_scan_trunc_max, int batch_scan_notify_threshold); + + /* Enable batchscan */ + bt_status_t (*batchscan_enb_batch_scan)(int client_if, int scan_mode, + int scan_interval, int scan_window, int addr_type, int discard_rule); + + /* Disable batchscan */ + bt_status_t (*batchscan_dis_batch_scan)(int client_if); + + /* Read out batchscan reports */ + bt_status_t (*batchscan_read_reports)(int client_if, int scan_mode); + + /** 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/third_party/android_hardware_libhardware/include/hardware/bt_gatt_server.h b/third_party/android_hardware_libhardware/include/hardware/bt_gatt_server.h new file mode 100644 index 000000000..0d6cc1e8d --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/bt_gatt_server.h @@ -0,0 +1,196 @@ +/* + * 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 + +#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); + +/** + * Callback confirming that a notification or indication has been sent + * to a remote device. + */ +typedef void (*indication_sent_callback)(int conn_id, int status); + +/** + * Callback notifying an application that a remote device connection is currently congested + * and cannot receive any more data. An application should avoid sending more data until + * a further callback is received indicating the congestion status has been cleared. + */ +typedef void (*congestion_callback)(int conn_id, bool congested); + +/** Callback invoked when the MTU for a given connection changes */ +typedef void (*mtu_changed_callback)(int conn_id, int mtu); + +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; + indication_sent_callback indication_sent_cb; + congestion_callback congestion_cb; + mtu_changed_callback mtu_changed_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, int transport); + + /** 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/third_party/android_hardware_libhardware/include/hardware/bt_gatt_types.h b/third_party/android_hardware_libhardware/include/hardware/bt_gatt_types.h new file mode 100644 index 000000000..e037ddcdb --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/bt_gatt_types.h @@ -0,0 +1,56 @@ +/* + * 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 +#include + +__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; + +/** Preferred physical Transport for GATT connection */ +typedef enum +{ + GATT_TRANSPORT_AUTO, + GATT_TRANSPORT_BREDR, + GATT_TRANSPORT_LE +} btgatt_transport_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_GATT_TYPES_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/bt_hd.h b/third_party/android_hardware_libhardware/include/hardware/bt_hd.h new file mode 100644 index 000000000..6ba5b097d --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/bt_hd.h @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2013, The Linux Foundation. All rights reserved. + * Not a Contribution + * 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_HD_H +#define ANDROID_INCLUDE_BT_HD_H + +#include + +__BEGIN_DECLS + +typedef enum +{ + BTHD_REPORT_TYPE_OTHER = 0, + BTHD_REPORT_TYPE_INPUT, + BTHD_REPORT_TYPE_OUTPUT, + BTHD_REPORT_TYPE_FEATURE, + BTHD_REPORT_TYPE_INTRDATA // special value for reports to be sent on INTR (INPUT is assumed) +} bthd_report_type_t; + +typedef enum +{ + BTHD_APP_STATE_NOT_REGISTERED, + BTHD_APP_STATE_REGISTERED +} bthd_application_state_t; + +typedef enum +{ + BTHD_CONN_STATE_CONNECTED, + BTHD_CONN_STATE_CONNECTING, + BTHD_CONN_STATE_DISCONNECTED, + BTHD_CONN_STATE_DISCONNECTING, + BTHD_CONN_STATE_UNKNOWN +} bthd_connection_state_t; + +typedef struct +{ + const char *name; + const char *description; + const char *provider; + uint8_t subclass; + uint8_t *desc_list; + int desc_list_len; +} bthd_app_param_t; + +typedef struct +{ + uint8_t service_type; + uint32_t token_rate; + uint32_t token_bucket_size; + uint32_t peak_bandwidth; + uint32_t access_latency; + uint32_t delay_variation; +} bthd_qos_param_t; + +typedef void (* bthd_application_state_callback)(bt_bdaddr_t *bd_addr, bthd_application_state_t state); +typedef void (* bthd_connection_state_callback)(bt_bdaddr_t *bd_addr, bthd_connection_state_t state); +typedef void (* bthd_get_report_callback)(uint8_t type, uint8_t id, uint16_t buffer_size); +typedef void (* bthd_set_report_callback)(uint8_t type, uint8_t id, uint16_t len, uint8_t *p_data); +typedef void (* bthd_set_protocol_callback)(uint8_t protocol); +typedef void (* bthd_intr_data_callback)(uint8_t report_id, uint16_t len, uint8_t *p_data); +typedef void (* bthd_vc_unplug_callback)(void); + +/** BT-HD callbacks */ +typedef struct { + size_t size; + + bthd_application_state_callback application_state_cb; + bthd_connection_state_callback connection_state_cb; + bthd_get_report_callback get_report_cb; + bthd_set_report_callback set_report_cb; + bthd_set_protocol_callback set_protocol_cb; + bthd_intr_data_callback intr_data_cb; + bthd_vc_unplug_callback vc_unplug_cb; +} bthd_callbacks_t; + +/** BT-HD interface */ +typedef struct { + + size_t size; + + /** init interface and register callbacks */ + bt_status_t (*init)(bthd_callbacks_t* callbacks); + + /** close interface */ + void (*cleanup)(void); + + /** register application */ + bt_status_t (*register_app)(bthd_app_param_t *app_param, bthd_qos_param_t *in_qos, + bthd_qos_param_t *out_qos); + + /** unregister application */ + bt_status_t (*unregister_app)(void); + + /** connects to host with virtual cable */ + bt_status_t (*connect)(void); + + /** disconnects from currently connected host */ + bt_status_t (*disconnect)(void); + + /** send report */ + bt_status_t (*send_report)(bthd_report_type_t type, uint8_t id, uint16_t len, uint8_t *p_data); + + /** notifies error for invalid SET_REPORT */ + bt_status_t (*report_error)(uint8_t error); + + /** send Virtual Cable Unplug */ + bt_status_t (*virtual_cable_unplug)(void); + +} bthd_interface_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_HD_H */ + diff --git a/third_party/android_hardware_libhardware/include/hardware/bt_hf.h b/third_party/android_hardware_libhardware/include/hardware/bt_hf.h new file mode 100644 index 000000000..dbac06130 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/bt_hf.h @@ -0,0 +1,348 @@ +/* + * 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; + +/* WBS codec setting */ +typedef enum +{ + BTHF_WBS_NONE, + BTHF_WBS_NO, + BTHF_WBS_YES +}bthf_wbs_config_t; + +/* BIND type*/ +typedef enum +{ + BTHF_BIND_SET, + BTHF_BIND_READ, + BTHF_BIND_TEST +}bthf_bind_type_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, bt_bdaddr_t *bd_addr); + +/** Callback for answer incoming call (ATA) + */ +typedef void (* bthf_answer_call_cmd_callback)(bt_bdaddr_t *bd_addr); + +/** Callback for disconnect call (AT+CHUP) + */ +typedef void (* bthf_hangup_call_cmd_callback)(bt_bdaddr_t *bd_addr); + +/** 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, bt_bdaddr_t *bd_addr); + +/** Callback for dialing an outgoing call + * If number is NULL, redial + */ +typedef void (* bthf_dial_call_cmd_callback)(char *number, bt_bdaddr_t *bd_addr); + +/** Callback for sending DTMF tones + * tone contains the dtmf character to be sent + */ +typedef void (* bthf_dtmf_cmd_callback)(char tone, bt_bdaddr_t *bd_addr); + +/** 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, bt_bdaddr_t *bd_addr); + +/** Callback for AT+BCS and event from BAC + * WBS enable, WBS disable + */ +typedef void (* bthf_wbs_callback)(bthf_wbs_config_t wbs, bt_bdaddr_t *bd_addr); + +/** 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, bt_bdaddr_t *bd_addr); + +/** Callback for CNUM (subscriber number) + */ +typedef void (* bthf_cnum_cmd_callback)(bt_bdaddr_t *bd_addr); + +/** Callback for indicators (CIND) + */ +typedef void (* bthf_cind_cmd_callback)(bt_bdaddr_t *bd_addr); + +/** Callback for operator selection (COPS) + */ +typedef void (* bthf_cops_cmd_callback)(bt_bdaddr_t *bd_addr); + +/** Callback for call list (AT+CLCC) + */ +typedef void (* bthf_clcc_cmd_callback) (bt_bdaddr_t *bd_addr); + +/** 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, bt_bdaddr_t *bd_addr); + +/** Callback for keypressed (HSP) event. + */ +typedef void (* bthf_key_pressed_cmd_callback)(bt_bdaddr_t *bd_addr); + +/** Callback for HF indicators (BIND) + */ +typedef void (* bthf_bind_cmd_callback)(char* hf_ind, bthf_bind_type_t type, bt_bdaddr_t *bd_addr); + +/** Callback for HF indicator value (BIEV) + */ +typedef void (* bthf_biev_cmd_callback)(char* hf_ind_val, bt_bdaddr_t *bd_addr); + + +/** 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_wbs_callback wbs_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_bind_cmd_callback bind_cmd_cb; + bthf_biev_cmd_callback biev_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_HF_INDICATOR_STATE_DISABLED = 0, + BTHF_HF_INDICATOR_STATE_ENABLED +} bthf_hf_indicator_status_t; + +typedef enum { + BTHF_CALL_ADDRTYPE_UNKNOWN = 0x81, + BTHF_CALL_ADDRTYPE_INTERNATIONAL = 0x91 +} bthf_call_addrtype_t; + +typedef enum { + BTHF_VOIP_CALL_NETWORK_TYPE_MOBILE = 0, + BTHF_VOIP_CALL_NETWORK_TYPE_WIFI +} bthf_voip_call_network_type_t; + +typedef enum { + BTHF_VOIP_STATE_STOPPED = 0, + BTHF_VOIP_STATE_STARTED +} bthf_voip_state_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, int max_hf_clients); + + /** 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)( bt_bdaddr_t *bd_addr ); + + /** stop voice recognition */ + bt_status_t (*stop_voice_recognition)( bt_bdaddr_t *bd_addr ); + + /** volume control */ + bt_status_t (*volume_control) (bthf_volume_type_t type, int volume, bt_bdaddr_t *bd_addr ); + + /** 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, bt_bdaddr_t *bd_addr ); + + /** 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, bt_bdaddr_t *bd_addr ); + + /** Pre-formatted AT response, typically in response to unknown AT cmd */ + bt_status_t (*formatted_at_response)(const char *rsp, bt_bdaddr_t *bd_addr ); + + /** ok/error response + * ERROR (0) + * OK (1) + */ + bt_status_t (*at_response) (bthf_at_response_t response_code, int error_code, bt_bdaddr_t *bd_addr ); + + /** 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, bt_bdaddr_t *bd_addr ); + + /** 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 ); + + /** configureation for the SCO codec */ + bt_status_t (*configure_wbs)( bt_bdaddr_t *bd_addr ,bthf_wbs_config_t config ); + + /** Response for BIND READ command and activation/deactivation of HF indicator */ + bt_status_t (*bind_response) (int anum, bthf_hf_indicator_status_t status, + bt_bdaddr_t *bd_addr); + + /** Response for BIND TEST command */ + bt_status_t (*bind_string_response) (const char* result, bt_bdaddr_t *bd_addr); + + /** Sends connectivity network type used by Voip currently to stack */ + bt_status_t (*voip_network_type_wifi) (bthf_voip_state_t is_voip_started, + bthf_voip_call_network_type_t is_network_wifi); +} bthf_interface_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_HF_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/bt_hf_client.h b/third_party/android_hardware_libhardware/include/hardware/bt_hf_client.h new file mode 100644 index 000000000..0577e97d4 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/bt_hf_client.h @@ -0,0 +1,375 @@ +/* + * Copyright (C) 2012-2014 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_CLIENT_H +#define ANDROID_INCLUDE_BT_HF_CLIENT_H + +__BEGIN_DECLS + +typedef enum { + BTHF_CLIENT_CONNECTION_STATE_DISCONNECTED = 0, + BTHF_CLIENT_CONNECTION_STATE_CONNECTING, + BTHF_CLIENT_CONNECTION_STATE_CONNECTED, + BTHF_CLIENT_CONNECTION_STATE_SLC_CONNECTED, + BTHF_CLIENT_CONNECTION_STATE_DISCONNECTING +} bthf_client_connection_state_t; + +typedef enum { + BTHF_CLIENT_AUDIO_STATE_DISCONNECTED = 0, + BTHF_CLIENT_AUDIO_STATE_CONNECTING, + BTHF_CLIENT_AUDIO_STATE_CONNECTED, + BTHF_CLIENT_AUDIO_STATE_CONNECTED_MSBC, +} bthf_client_audio_state_t; + +typedef enum { + BTHF_CLIENT_VR_STATE_STOPPED = 0, + BTHF_CLIENT_VR_STATE_STARTED +} bthf_client_vr_state_t; + +typedef enum { + BTHF_CLIENT_VOLUME_TYPE_SPK = 0, + BTHF_CLIENT_VOLUME_TYPE_MIC +} bthf_client_volume_type_t; + +typedef enum +{ + BTHF_CLIENT_NETWORK_STATE_NOT_AVAILABLE = 0, + BTHF_CLIENT_NETWORK_STATE_AVAILABLE +} bthf_client_network_state_t; + +typedef enum +{ + BTHF_CLIENT_SERVICE_TYPE_HOME = 0, + BTHF_CLIENT_SERVICE_TYPE_ROAMING +} bthf_client_service_type_t; + +typedef enum { + BTHF_CLIENT_CALL_STATE_ACTIVE = 0, + BTHF_CLIENT_CALL_STATE_HELD, + BTHF_CLIENT_CALL_STATE_DIALING, + BTHF_CLIENT_CALL_STATE_ALERTING, + BTHF_CLIENT_CALL_STATE_INCOMING, + BTHF_CLIENT_CALL_STATE_WAITING, + BTHF_CLIENT_CALL_STATE_HELD_BY_RESP_HOLD, +} bthf_client_call_state_t; + +typedef enum { + BTHF_CLIENT_CALL_NO_CALLS_IN_PROGRESS = 0, + BTHF_CLIENT_CALL_CALLS_IN_PROGRESS +} bthf_client_call_t; + +typedef enum { + BTHF_CLIENT_CALLSETUP_NONE = 0, + BTHF_CLIENT_CALLSETUP_INCOMING, + BTHF_CLIENT_CALLSETUP_OUTGOING, + BTHF_CLIENT_CALLSETUP_ALERTING + +} bthf_client_callsetup_t; + +typedef enum { + BTHF_CLIENT_CALLHELD_NONE = 0, + BTHF_CLIENT_CALLHELD_HOLD_AND_ACTIVE, + BTHF_CLIENT_CALLHELD_HOLD, +} bthf_client_callheld_t; + +typedef enum { + BTHF_CLIENT_RESP_AND_HOLD_HELD = 0, + BTRH_CLIENT_RESP_AND_HOLD_ACCEPT, + BTRH_CLIENT_RESP_AND_HOLD_REJECT, +} bthf_client_resp_and_hold_t; + +typedef enum { + BTHF_CLIENT_CALL_DIRECTION_OUTGOING = 0, + BTHF_CLIENT_CALL_DIRECTION_INCOMING +} bthf_client_call_direction_t; + +typedef enum { + BTHF_CLIENT_CALL_MPTY_TYPE_SINGLE = 0, + BTHF_CLIENT_CALL_MPTY_TYPE_MULTI +} bthf_client_call_mpty_type_t; + +typedef enum { + BTHF_CLIENT_CMD_COMPLETE_OK = 0, + BTHF_CLIENT_CMD_COMPLETE_ERROR, + BTHF_CLIENT_CMD_COMPLETE_ERROR_NO_CARRIER, + BTHF_CLIENT_CMD_COMPLETE_ERROR_BUSY, + BTHF_CLIENT_CMD_COMPLETE_ERROR_NO_ANSWER, + BTHF_CLIENT_CMD_COMPLETE_ERROR_DELAYED, + BTHF_CLIENT_CMD_COMPLETE_ERROR_BLACKLISTED, + BTHF_CLIENT_CMD_COMPLETE_ERROR_CME +} bthf_client_cmd_complete_t; + +typedef enum { + BTHF_CLIENT_CALL_ACTION_CHLD_0 = 0, + BTHF_CLIENT_CALL_ACTION_CHLD_1, + BTHF_CLIENT_CALL_ACTION_CHLD_2, + BTHF_CLIENT_CALL_ACTION_CHLD_3, + BTHF_CLIENT_CALL_ACTION_CHLD_4, + BTHF_CLIENT_CALL_ACTION_CHLD_1x, + BTHF_CLIENT_CALL_ACTION_CHLD_2x, + BTHF_CLIENT_CALL_ACTION_ATA, + BTHF_CLIENT_CALL_ACTION_CHUP, + BTHF_CLIENT_CALL_ACTION_BTRH_0, + BTHF_CLIENT_CALL_ACTION_BTRH_1, + BTHF_CLIENT_CALL_ACTION_BTRH_2, +} bthf_client_call_action_t; + +typedef enum { + BTHF_CLIENT_SERVICE_UNKNOWN = 0, + BTHF_CLIENT_SERVICE_VOICE, + BTHF_CLIENT_SERVICE_FAX +} bthf_client_subscriber_service_type_t; + +typedef enum { + BTHF_CLIENT_IN_BAND_RINGTONE_NOT_PROVIDED = 0, + BTHF_CLIENT_IN_BAND_RINGTONE_PROVIDED, +} bthf_client_in_band_ring_state_t; + +/* Peer features masks */ +#define BTHF_CLIENT_PEER_FEAT_3WAY 0x00000001 /* Three-way calling */ +#define BTHF_CLIENT_PEER_FEAT_ECNR 0x00000002 /* Echo cancellation and/or noise reduction */ +#define BTHF_CLIENT_PEER_FEAT_VREC 0x00000004 /* Voice recognition */ +#define BTHF_CLIENT_PEER_FEAT_INBAND 0x00000008 /* In-band ring tone */ +#define BTHF_CLIENT_PEER_FEAT_VTAG 0x00000010 /* Attach a phone number to a voice tag */ +#define BTHF_CLIENT_PEER_FEAT_REJECT 0x00000020 /* Ability to reject incoming call */ +#define BTHF_CLIENT_PEER_FEAT_ECS 0x00000040 /* Enhanced Call Status */ +#define BTHF_CLIENT_PEER_FEAT_ECC 0x00000080 /* Enhanced Call Control */ +#define BTHF_CLIENT_PEER_FEAT_EXTERR 0x00000100 /* Extended error codes */ +#define BTHF_CLIENT_PEER_FEAT_CODEC 0x00000200 /* Codec Negotiation */ + +/* Peer call handling features masks */ +#define BTHF_CLIENT_CHLD_FEAT_REL 0x00000001 /* 0 Release waiting call or held calls */ +#define BTHF_CLIENT_CHLD_FEAT_REL_ACC 0x00000002 /* 1 Release active calls and accept other + (waiting or held) cal */ +#define BTHF_CLIENT_CHLD_FEAT_REL_X 0x00000004 /* 1x Release specified active call only */ +#define BTHF_CLIENT_CHLD_FEAT_HOLD_ACC 0x00000008 /* 2 Active calls on hold and accept other + (waiting or held) call */ +#define BTHF_CLIENT_CHLD_FEAT_PRIV_X 0x00000010 /* 2x Request private mode with specified + call (put the rest on hold) */ +#define BTHF_CLIENT_CHLD_FEAT_MERGE 0x00000020 /* 3 Add held call to multiparty */ +#define BTHF_CLIENT_CHLD_FEAT_MERGE_DETACH 0x00000040 /* 4 Connect two calls and leave + (disconnect from) multiparty */ + +/** Callback for connection state change. + * state will have one of the values from BtHfConnectionState + * peer/chld_features are valid only for BTHF_CLIENT_CONNECTION_STATE_SLC_CONNECTED state + */ +typedef void (* bthf_client_connection_state_callback)(bthf_client_connection_state_t state, + unsigned int peer_feat, + unsigned int chld_feat, + bt_bdaddr_t *bd_addr); + +/** Callback for audio connection state change. + * state will have one of the values from BtHfAudioState + */ +typedef void (* bthf_client_audio_state_callback)(bthf_client_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_client_vr_cmd_callback)(bthf_client_vr_state_t state); + +/** Callback for network state change + */ +typedef void (* bthf_client_network_state_callback) (bthf_client_network_state_t state); + +/** Callback for network roaming status change + */ +typedef void (* bthf_client_network_roaming_callback) (bthf_client_service_type_t type); + +/** Callback for signal strength indication + */ +typedef void (* bthf_client_network_signal_callback) (int signal_strength); + +/** Callback for battery level indication + */ +typedef void (* bthf_client_battery_level_callback) (int battery_level); + +/** Callback for current operator name + */ +typedef void (* bthf_client_current_operator_callback) (const char *name); + +/** Callback for call indicator + */ +typedef void (* bthf_client_call_callback) (bthf_client_call_t call); + +/** Callback for callsetup indicator + */ +typedef void (* bthf_client_callsetup_callback) (bthf_client_callsetup_t callsetup); + +/** Callback for callheld indicator + */ +typedef void (* bthf_client_callheld_callback) (bthf_client_callheld_t callheld); + +/** Callback for response and hold + */ +typedef void (* bthf_client_resp_and_hold_callback) (bthf_client_resp_and_hold_t resp_and_hold); + +/** Callback for Calling Line Identification notification + * Will be called only when there is an incoming call and number is provided. + */ +typedef void (* bthf_client_clip_callback) (const char *number); + +/** + * Callback for Call Waiting notification + */ +typedef void (* bthf_client_call_waiting_callback) (const char *number); + +/** + * Callback for listing current calls. Can be called multiple time. + * If number is unknown NULL is passed. + */ +typedef void (*bthf_client_current_calls) (int index, bthf_client_call_direction_t dir, + bthf_client_call_state_t state, + bthf_client_call_mpty_type_t mpty, + const char *number); + +/** Callback for audio volume change + */ +typedef void (*bthf_client_volume_change_callback) (bthf_client_volume_type_t type, int volume); + +/** Callback for command complete event + * cme is valid only for BTHF_CLIENT_CMD_COMPLETE_ERROR_CME type + */ +typedef void (*bthf_client_cmd_complete_callback) (bthf_client_cmd_complete_t type, int cme); + +/** Callback for subscriber information + */ +typedef void (* bthf_client_subscriber_info_callback) (const char *name, + bthf_client_subscriber_service_type_t type); + +/** Callback for in-band ring tone settings + */ +typedef void (* bthf_client_in_band_ring_tone_callback) (bthf_client_in_band_ring_state_t state); + +/** + * Callback for requested number from AG + */ +typedef void (* bthf_client_last_voice_tag_number_callback) (const char *number); + +/** + * Callback for sending ring indication to app + */ +typedef void (* bthf_client_ring_indication_callback) (void); + +/** + * Callback for sending cgmi indication to app + */ +typedef void (* bthf_client_cgmi_indication_callback) (const char *str); + +/** + * Callback for sending cgmm indication to app + */ +typedef void (* bthf_client_cgmm_indication_callback) (const char *str); + +/** BT-HF callback structure. */ +typedef struct { + /** set to sizeof(BtHfClientCallbacks) */ + size_t size; + bthf_client_connection_state_callback connection_state_cb; + bthf_client_audio_state_callback audio_state_cb; + bthf_client_vr_cmd_callback vr_cmd_cb; + bthf_client_network_state_callback network_state_cb; + bthf_client_network_roaming_callback network_roaming_cb; + bthf_client_network_signal_callback network_signal_cb; + bthf_client_battery_level_callback battery_level_cb; + bthf_client_current_operator_callback current_operator_cb; + bthf_client_call_callback call_cb; + bthf_client_callsetup_callback callsetup_cb; + bthf_client_callheld_callback callheld_cb; + bthf_client_resp_and_hold_callback resp_and_hold_cb; + bthf_client_clip_callback clip_cb; + bthf_client_call_waiting_callback call_waiting_cb; + bthf_client_current_calls current_calls_cb; + bthf_client_volume_change_callback volume_change_cb; + bthf_client_cmd_complete_callback cmd_complete_cb; + bthf_client_subscriber_info_callback subscriber_info_cb; + bthf_client_in_band_ring_tone_callback in_band_ring_tone_cb; + bthf_client_last_voice_tag_number_callback last_voice_tag_number_callback; + bthf_client_ring_indication_callback ring_indication_cb; + bthf_client_cgmi_indication_callback cgmi_cb; + bthf_client_cgmm_indication_callback cgmm_cb; +} bthf_client_callbacks_t; + +/** Represents the standard BT-HF interface. */ +typedef struct { + + /** set to sizeof(BtHfClientInterface) */ + size_t size; + /** + * Register the BtHf callbacks + */ + bt_status_t (*init)(bthf_client_callbacks_t* callbacks); + + /** connect to audio gateway */ + bt_status_t (*connect)(bt_bdaddr_t *bd_addr); + + /** disconnect from audio gateway */ + 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)(void); + + /** stop voice recognition */ + bt_status_t (*stop_voice_recognition)(void); + + /** volume control */ + bt_status_t (*volume_control) (bthf_client_volume_type_t type, int volume); + + /** place a call with number a number + * if number is NULL last called number is called (aka re-dial)*/ + bt_status_t (*dial) (const char *number); + + /** place a call with number specified by location (speed dial) */ + bt_status_t (*dial_memory) (int location); + + /** perform specified call related action + * idx is limited only for enhanced call control related action + */ + bt_status_t (*handle_call_action) (bthf_client_call_action_t action, int idx); + + /** query list of current calls */ + bt_status_t (*query_current_calls) (void); + + /** query name of current selected operator */ + bt_status_t (*query_current_operator_name) (void); + + /** Retrieve subscriber information */ + bt_status_t (*retrieve_subscriber_info) (void); + + /** Send DTMF code*/ + bt_status_t (*send_dtmf) (char code); + + /** Request a phone number from AG corresponding to last voice tag recorded */ + bt_status_t (*request_last_voice_tag_number) (void); + + /** Closes the interface. */ + void (*cleanup)(void); + + /** Send AT Command. */ + bt_status_t (*send_at_cmd) (int cmd, int val1, int val2, const char *arg); +} bthf_client_interface_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_HF_CLIENT_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/bt_hh.h b/third_party/android_hardware_libhardware/include/hardware/bt_hh.h new file mode 100644 index 000000000..ece3c1142 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/bt_hh.h @@ -0,0 +1,191 @@ +/* + * 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 + +__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 protocol 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); + +/** Callback for set_report/set_protocol api and if error + * occurs for get_report/get_protocol api. + */ +typedef void (* bthh_handshake_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status); + + +/** 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_handshake_callback handshake_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); + + /** Get the HID Idle Time */ + bt_status_t (*get_idle_time)(bt_bdaddr_t *bd_addr); + + /** Set the HID Idle Time */ + bt_status_t (*set_idle_time)(bt_bdaddr_t *bd_addr, uint8_t idleTime); + + /** 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/third_party/android_hardware_libhardware/include/hardware/bt_hl.h b/third_party/android_hardware_libhardware/include/hardware/bt_hl.h new file mode 100644 index 000000000..bd29e3abf --- /dev/null +++ b/third_party/android_hardware_libhardware/include/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/third_party/android_hardware_libhardware/include/hardware/bt_mce.h b/third_party/android_hardware_libhardware/include/hardware/bt_mce.h new file mode 100644 index 000000000..5d159b336 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/bt_mce.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2014 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_MCE_H +#define ANDROID_INCLUDE_BT_MCE_H + +__BEGIN_DECLS + +/** MAS instance description */ +typedef struct +{ + int id; + int scn; + int msg_types; + char *p_name; +} btmce_mas_instance_t; + +/** callback for get_remote_mas_instances */ +typedef void (*btmce_remote_mas_instances_callback)(bt_status_t status, bt_bdaddr_t *bd_addr, + int num_instances, btmce_mas_instance_t *instances); + +typedef struct { + /** set to sizeof(btmce_callbacks_t) */ + size_t size; + btmce_remote_mas_instances_callback remote_mas_instances_cb; +} btmce_callbacks_t; + +typedef struct { + /** set to size of this struct */ + size_t size; + + /** register BT MCE callbacks */ + bt_status_t (*init)(btmce_callbacks_t *callbacks); + + /** search for MAS instances on remote device */ + bt_status_t (*get_remote_mas_instances)(bt_bdaddr_t *bd_addr); +} btmce_interface_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_MCE_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/bt_pan.h b/third_party/android_hardware_libhardware/include/hardware/bt_pan.h new file mode 100644 index 000000000..83e7949b2 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/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, int local_role, + bt_status_t error, 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/third_party/android_hardware_libhardware/include/hardware/bt_rc.h b/third_party/android_hardware_libhardware/include/hardware/bt_rc.h new file mode 100644 index 000000000..6e1109d38 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/bt_rc.h @@ -0,0 +1,527 @@ +/* + * Copyright (C) 2013-2014, The Linux Foundation. All rights reserved. + * Not a Contribution. + * + * 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 +#define BTRC_CHARSET_UTF8 0x006A + +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_EVT_NOW_PLAYING_CONTENT_CHANGED = 0x09, + BTRC_EVT_AVAILABLE_PLAYERS_CHANGED = 0x0a, + BTRC_EVT_ADDRESSED_PLAYER_CHANGED = 0x0b, +} btrc_event_id_t; + +//used for Scope +typedef enum { + BTRC_EVT_MEDIA_PLAYLIST = 0, + BTRC_EVT_MEDIA_VIRTUALFILESYST = 1, + BTRC_EVT_SEARCH = 2, + BTRC_EVT_NOWPLAYING = 3, + BTRC_EVT_MAX_BROWSE = 4, +} btrc_browse_folderitem_t; + +typedef enum { + BTRC_NOTIFICATION_TYPE_INTERIM = 0, + BTRC_NOTIFICATION_TYPE_CHANGED = 1, + BTRC_NOTIFICATION_TYPE_REJECT = 2, +} 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 enum { + BTRC_TYPE_MEDIA_PLAYER = 0x01, + BTRC_TYPE_FOLDER = 0x02, + BTRC_TYPE_MEDIA_ELEMENT = 0x03 +} btrc_folder_list_item_type_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 struct { + uint32_t start_item; + uint32_t end_item; + uint32_t size; + uint32_t attrs[BTRC_MAX_ELEM_ATTR_SIZE]; + uint8_t attr_count; +}btrc_getfolderitem_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; + uint16_t player_id; +} 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); +#define BTRC_FEATURE_MASK_SIZE 16 + +typedef uint8_t btrc_feature_mask_t[BTRC_FEATURE_MASK_SIZE]; + +typedef struct { + uint16_t charset_id; + uint16_t str_len; + uint8_t *p_str; +} btrc_player_full_name_t; + +typedef struct +{ + uint32_t sub_type; + uint16_t player_id; + uint8_t major_type; + uint8_t play_status; + btrc_feature_mask_t features; /* Supported feature bit mask*/ + btrc_player_full_name_t name; /* The player name, name length and character set id.*/ +} btrc_folder_list_item_player_t; + +typedef struct +{ + uint64_t uid; + uint8_t type; + uint8_t playable; + btrc_player_full_name_t name; +} btrc_folder_list_item_folder_t; + +typedef struct +{ + uint32_t attr_id; + btrc_player_full_name_t name; +} btrc_attr_entry_t; + +typedef struct +{ + uint64_t uid; + uint8_t type; + uint8_t attr_count; + btrc_player_full_name_t name; + btrc_attr_entry_t* p_attr_list; +} btrc_folder_list_item_media_t; + +typedef struct { + uint16_t str_len; + uint8_t *p_str; +} btrc_name_t; + +/* SetBrowsedPlayer */ +typedef struct +{ + uint32_t num_items; + uint16_t uid_counter; + uint16_t charset_id; + uint8_t status; + uint8_t folder_depth; + btrc_name_t *p_folders; +} btrc_set_browsed_player_rsp_t; + +typedef struct +{ + uint8_t item_type; + union + { + btrc_folder_list_item_player_t player; + btrc_folder_list_item_folder_t folder; + btrc_folder_list_item_media_t media; + } u; +} btrc_folder_list_item_t; + +/* GetFolderItems */ +typedef struct +{ + uint16_t uid_counter; + uint16_t item_count; + uint8_t status; + btrc_folder_list_item_t *p_item_list; +} btrc_folder_list_entries_t; + +/** Callback for play status request */ +typedef void (* btrc_get_play_status_callback)(bt_bdaddr_t *bd_addr); + +/** Callback for list player application attributes (Shuffle, Repeat,...) */ +typedef void (* btrc_list_player_app_attr_callback)(bt_bdaddr_t *bd_addr); + +/** Callback for list player application attributes (Shuffle, Repeat,...) */ +typedef void (* btrc_list_player_app_values_callback)(btrc_player_attr_t attr_id, + bt_bdaddr_t *bd_addr); + +/** 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, + bt_bdaddr_t *bd_addr); + +/** 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, bt_bdaddr_t *bd_addr); + +/** 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, bt_bdaddr_t *bd_addr); + +/** Callback for setting the player application settings values */ +typedef void (* btrc_set_player_app_value_callback) (btrc_player_settings_t *p_vals, + bt_bdaddr_t *bd_addr); + +/** 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, + bt_bdaddr_t *bd_addr); + +/** 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, + bt_bdaddr_t *bd_addr); + +/* 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, bt_bdaddr_t *bd_addr); + +/** Callback for passthrough commands */ +typedef void (* btrc_passthrough_cmd_callback) (int id, int key_state, bt_bdaddr_t *bd_addr); + +/** BT-RC Target callback structure. */ + +typedef void (* btrc_get_folder_items_callback) (btrc_browse_folderitem_t id, + btrc_getfolderitem_t *param, bt_bdaddr_t *bd_addr); + +typedef void (* btrc_set_addressed_player_callback) (uint32_t player_id, bt_bdaddr_t *bd_addr); + +typedef void (* btrc_set_browsed_player_callback) (uint32_t player_id, bt_bdaddr_t *bd_addr); + +typedef void (* btrc_change_path_callback) (uint8_t direction, uint64_t uid, bt_bdaddr_t *bd_addr); + +typedef void (* btrc_play_item_callback) (uint8_t scope, uint64_t uid, bt_bdaddr_t *bd_addr); + +typedef void (* btrc_get_item_attr_callback) (uint8_t scope, uint64_t uid, + uint8_t num_attr, btrc_media_attr_t *p_attrs, bt_bdaddr_t *bd_addr); + +typedef void (* btrc_connection_state_callback) (bool state, bt_bdaddr_t *bd_addr); + +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_get_folder_items_callback get_folderitems_cb; + btrc_set_addressed_player_callback set_addrplayer_cb; + btrc_set_browsed_player_callback set_browsed_player_cb; + btrc_change_path_callback change_path_cb; + btrc_play_item_callback play_item_cb; + btrc_get_item_attr_callback get_item_attr_cb; + btrc_connection_state_callback connection_state_cb; +} btrc_callbacks_t; + +/** Represents the standard BT-RC AVRCP Target interface. */ +typedef struct { + + /** set to sizeof(BtRcInterface) */ + size_t size; + /** + * Register the BtRc callbacks + */ + bt_status_t (*init)( btrc_callbacks_t* callbacks , int max_avrcp_connections); + + /** 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, bt_bdaddr_t *bd_addr); + + /** 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)( uint8_t num_attr, btrc_player_attr_t *p_attrs, + bt_bdaddr_t *bd_addr); + + /** 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)( uint8_t num_val, uint8_t *p_vals, + bt_bdaddr_t *bd_addr); + + /** 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, + bt_bdaddr_t *bd_addr); + + /** 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, + bt_bdaddr_t *bd_addr); + + /** 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, + bt_bdaddr_t *bd_addr); + + /** 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, + bt_bdaddr_t *bd_addr); + + /** 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, bt_bdaddr_t *bd_addr); + + /* 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, + bt_bdaddr_t *bd_addr); + + /* 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, bt_bdaddr_t *bd_addr); + bt_status_t (*get_folder_items_rsp) (btrc_folder_list_entries_t *p_param, bt_bdaddr_t *bd_addr); + + bt_status_t (*set_addressed_player_rsp) (btrc_status_t status_code, bt_bdaddr_t *bd_addr); + bt_status_t (*set_browsed_player_rsp) (btrc_set_browsed_player_rsp_t *p_param, + bt_bdaddr_t *bd_addr); + bt_status_t (*change_path_rsp) (uint8_t status_code, uint32_t item_count, + bt_bdaddr_t *bd_addr); + bt_status_t (*play_item_rsp) (uint8_t status_code, bt_bdaddr_t *bd_addr); + bt_status_t (*get_item_attr_rsp)( uint8_t num_attr, btrc_element_attr_val_t *p_attrs, + bt_bdaddr_t *bd_addr); + bt_status_t (*is_device_active_in_handoff) (bt_bdaddr_t *bd_addr); + + /** Closes the interface. */ + void (*cleanup)( void ); +} btrc_interface_t; + + +typedef void (* btrc_passthrough_rsp_callback) (int id, int key_state); + +typedef void (* btrc_connection_state_callback) (bool state, bt_bdaddr_t *bd_addr); + +typedef void (* btrc_ctrl_getrcfeatures_callback) (bt_bdaddr_t *bd_addr, int features); + +typedef void (* btrc_ctrl_getcapability_rsp_callback) (bt_bdaddr_t *bd_addr, int cap_id, + uint32_t* supported_values, int num_supported, uint8_t rsp_type); + +typedef void (* btrc_ctrl_listplayerappsettingattrib_rsp_callback) (bt_bdaddr_t *bd_addr, + uint8_t* supported_attribs, int num_attrib, uint8_t rsp_type); + +typedef void (* btrc_ctrl_listplayerappsettingvalue_rsp_callback) (bt_bdaddr_t *bd_addr, + uint8_t* supported_val, uint8_t num_supported, uint8_t rsp_type); + +typedef void (* btrc_ctrl_currentplayerappsetting_rsp_callback) (bt_bdaddr_t *bd_addr,uint8_t* supported_ids, + uint8_t* supported_val, uint8_t num_attrib, uint8_t rsp_type); + +typedef void (* btrc_ctrl_setplayerapplicationsetting_rsp_callback) (bt_bdaddr_t *bd_addr,uint8_t rsp_type); + +typedef void (* btrc_ctrl_notification_rsp_callback) (bt_bdaddr_t *bd_addr, uint8_t rsp_type, + int rsp_len, uint8_t* notification_rsp); + +typedef void (* btrc_ctrl_getelementattrib_rsp_callback) (bt_bdaddr_t *bd_addr, uint8_t num_attributes, + int rsp_len, uint8_t* attrib_rsp, uint8_t rsp_type); + +typedef void (* btrc_ctrl_getplaystatus_rsp_callback) (bt_bdaddr_t *bd_addr, int param_len, uint8_t* play_status_rsp + ,uint8_t rsp_type); + +typedef void (* btrc_ctrl_setabsvol_cmd_callback) (bt_bdaddr_t *bd_addr, uint8_t abs_vol); + +typedef void (* btrc_ctrl_registernotification_abs_vol_callback) (bt_bdaddr_t *bd_addr); +/** BT-RC Controller callback structure. */ +typedef struct { + /** set to sizeof(BtRcCallbacks) */ + size_t size; + btrc_passthrough_rsp_callback passthrough_rsp_cb; + btrc_connection_state_callback connection_state_cb; + btrc_ctrl_getrcfeatures_callback getrcfeatures_cb; + btrc_ctrl_getcapability_rsp_callback getcap_rsp_cb; + btrc_ctrl_listplayerappsettingattrib_rsp_callback listplayerappsettingattrib_rsp_cb; + btrc_ctrl_listplayerappsettingvalue_rsp_callback listplayerappsettingvalue_rsp_cb; + btrc_ctrl_currentplayerappsetting_rsp_callback currentplayerappsetting_rsp_cb; + btrc_ctrl_setplayerapplicationsetting_rsp_callback setplayerappsetting_rsp_cb; + btrc_ctrl_notification_rsp_callback notification_rsp_cb; + btrc_ctrl_getelementattrib_rsp_callback getelementattrib_rsp_cb; + btrc_ctrl_getplaystatus_rsp_callback getplaystatus_rsp_cb; + btrc_ctrl_setabsvol_cmd_callback setabsvol_cmd_cb; + btrc_ctrl_registernotification_abs_vol_callback registernotification_absvol_cb; +} btrc_ctrl_callbacks_t; + +/** Represents the standard BT-RC AVRCP Controller interface. */ +typedef struct { + + /** set to sizeof(BtRcInterface) */ + size_t size; + /** + * Register the BtRc callbacks + */ + bt_status_t (*init)( btrc_ctrl_callbacks_t* callbacks ); + + /** send pass through command to target */ + bt_status_t (*send_pass_through_cmd) ( bt_bdaddr_t *bd_addr, uint8_t key_code, + uint8_t key_state ); + + /** send get_cap command to target */ + bt_status_t (*getcapabilities_cmd) (uint8_t cap_id); + + /** send command to get supported player application settings to target */ + bt_status_t (*list_player_app_setting_attrib_cmd) (void); + + /** send command to get supported values of player application settings for a + * particular attribute to target */ + bt_status_t (*list_player_app_setting_value_cmd) (uint8_t attrib_id); + + /** send command to get current player attributes to target */ + bt_status_t (*get_player_app_setting_cmd) (uint8_t num_attrib, uint8_t* attrib_ids); + + /** send command to set player applicaiton setting attributes to target */ + bt_status_t (*set_player_app_setting_cmd) (uint8_t num_attrib, uint8_t* attrib_ids, uint8_t* attrib_vals); + + /** send command to register for supported notificaiton events to target */ + bt_status_t (*register_notification_cmd) (uint8_t event_id, uint32_t event_value); + + /** send command to get element attribute to target */ + bt_status_t (*get_element_attribute_cmd) (uint8_t num_attribute, uint32_t attribute_id); + + /** send command to get play status to target */ + bt_status_t (*get_play_status_cmd) (void); + + /** send rsp to set_abs_vol received from target */ + bt_status_t (*send_abs_vol_rsp) (uint8_t abs_vol); + + /** send notificaiton rsp for abs vol to target */ + bt_status_t (*send_register_abs_vol_rsp) (uint8_t rsp_type, uint8_t abs_vol); + + /** Closes the interface. */ + void (*cleanup)( void ); +} btrc_ctrl_interface_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_RC_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/bt_sdp.h b/third_party/android_hardware_libhardware/include/hardware/bt_sdp.h new file mode 100644 index 000000000..8f39bc5bd --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/bt_sdp.h @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2015 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. + */ + +#pragma once + +#include "bluetooth.h" + +#define SDP_OPP_SUPPORTED_FORMATS_MAX_LENGTH 15 + +__BEGIN_DECLS + +/** + * These events are handled by the state machine + */ +typedef enum { + SDP_TYPE_RAW, // Used to carry raw SDP search data for unknown UUIDs + SDP_TYPE_MAP_MAS, // Message Access Profile - Server + SDP_TYPE_MAP_MNS, // Message Access Profile - Client (Notification Server) + SDP_TYPE_PBAP_PSE, // Phone Book Profile - Server + SDP_TYPE_PBAP_PCE, // Phone Book Profile - Client + SDP_TYPE_OPP_SERVER, // Object Push Profile + SDP_TYPE_SAP_SERVER // SIM Access Profile +} bluetooth_sdp_types; + +typedef struct _bluetooth_sdp_hdr { + bluetooth_sdp_types type; + bt_uuid_t uuid; + uint32_t service_name_length; + char *service_name; + int32_t rfcomm_channel_number; + int32_t l2cap_psm; + int32_t profile_version; +} bluetooth_sdp_hdr; + +/** + * Some signals need additional pointers, hence we introduce a + * generic way to handle these pointers. + */ +typedef struct _bluetooth_sdp_hdr_overlay { + bluetooth_sdp_types type; + bt_uuid_t uuid; + uint32_t service_name_length; + char *service_name; + int32_t rfcomm_channel_number; + int32_t l2cap_psm; + int32_t profile_version; + + // User pointers, only used for some signals - see bluetooth_sdp_ops_record + int user1_ptr_len; + uint8_t *user1_ptr; + int user2_ptr_len; + uint8_t *user2_ptr; +} bluetooth_sdp_hdr_overlay; + +typedef struct _bluetooth_sdp_mas_record { + bluetooth_sdp_hdr_overlay hdr; + uint32_t mas_instance_id; + uint32_t supported_features; + uint32_t supported_message_types; +} bluetooth_sdp_mas_record; + +typedef struct _bluetooth_sdp_mns_record { + bluetooth_sdp_hdr_overlay hdr; + uint32_t supported_features; +} bluetooth_sdp_mns_record; + +typedef struct _bluetooth_sdp_pse_record { + bluetooth_sdp_hdr_overlay hdr; + uint32_t supported_features; + uint32_t supported_repositories; +} bluetooth_sdp_pse_record; + +typedef struct _bluetooth_sdp_pce_record { + bluetooth_sdp_hdr_overlay hdr; +} bluetooth_sdp_pce_record; + +typedef struct _bluetooth_sdp_ops_record { + bluetooth_sdp_hdr_overlay hdr; + int supported_formats_list_len; + uint8_t supported_formats_list[SDP_OPP_SUPPORTED_FORMATS_MAX_LENGTH]; +} bluetooth_sdp_ops_record; + +typedef struct _bluetooth_sdp_sap_record { + bluetooth_sdp_hdr_overlay hdr; +} bluetooth_sdp_sap_record; + +typedef union { + bluetooth_sdp_hdr_overlay hdr; + bluetooth_sdp_mas_record mas; + bluetooth_sdp_mns_record mns; + bluetooth_sdp_pse_record pse; + bluetooth_sdp_pce_record pce; + bluetooth_sdp_ops_record ops; + bluetooth_sdp_sap_record sap; +} bluetooth_sdp_record; + + +/** Callback for SDP search */ +typedef void (*btsdp_search_callback)(bt_status_t status, bt_bdaddr_t *bd_addr, uint8_t* uuid, int num_records, bluetooth_sdp_record *records); + +typedef struct { + /** Set to sizeof(btsdp_callbacks_t) */ + size_t size; + btsdp_search_callback sdp_search_cb; +} btsdp_callbacks_t; + +typedef struct { + /** Set to size of this struct */ + size_t size; + + /** Register BT SDP search callbacks */ + bt_status_t (*init)(btsdp_callbacks_t *callbacks); + + /** Unregister BT SDP */ + bt_status_t (*deinit)(); + + /** Search for SDP records with specific uuid on remote device */ + bt_status_t (*sdp_search)(bt_bdaddr_t *bd_addr, const uint8_t* uuid); + + /** + * Use listen in the socket interface to create rfcomm and/or l2cap PSM channels, + * (without UUID and service_name and set the BTSOCK_FLAG_NO_SDP flag in flags). + * Then use createSdpRecord to create the SDP record associated with the rfcomm/l2cap channels. + * + * Returns a handle to the SDP record, which can be parsed to remove_sdp_record. + * + * record (in) The SDP record to create + * record_handle (out)The corresponding record handle will be written to this pointer. + */ + bt_status_t (*create_sdp_record)(bluetooth_sdp_record *record, int* record_handle); + + /** Remove a SDP record created by createSdpRecord */ + bt_status_t (*remove_sdp_record)(int sdp_handle); +} btsdp_interface_t; + +__END_DECLS + diff --git a/third_party/android_hardware_libhardware/include/hardware/bt_sock.h b/third_party/android_hardware_libhardware/include/hardware/bt_sock.h new file mode 100644 index 000000000..9dd83bb1c --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/bt_sock.h @@ -0,0 +1,91 @@ +/* + * 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. + */ + +#pragma once + +__BEGIN_DECLS + +#define BTSOCK_FLAG_ENCRYPT 1 +#define BTSOCK_FLAG_AUTH (1 << 1) +#define BTSOCK_FLAG_NO_SDP (1 << 2) +#define BTSOCK_FLAG_AUTH_MITM (1 << 3) +#define BTSOCK_FLAG_AUTH_16_DIGIT (1 << 4) + +typedef enum { + BTSOCK_RFCOMM = 1, + BTSOCK_SCO = 2, + BTSOCK_L2CAP = 3 +} btsock_type_t; + +typedef enum { + BTSOCK_OPT_GET_MODEM_BITS = 1, + BTSOCK_OPT_SET_MODEM_BITS = 2, + BTSOCK_OPT_CLR_MODEM_BITS = 3, +} btsock_option_type_t; + +/** Represents the standard BT SOCKET interface. */ +typedef struct { + short size; + bt_bdaddr_t bd_addr; + int channel; + int status; + + // The writer must make writes using a buffer of this maximum size + // to avoid loosing data. (L2CAP only) + unsigned short max_tx_packet_size; + + // The reader must read using a buffer of at least this size to avoid + // loosing data. (L2CAP only) + unsigned short max_rx_packet_size; +} __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. + * If neither a UUID nor a channel is provided, a channel will be allocated + * and a service record can be created providing the channel number to + * create_sdp_record(...) in bt_sdp. + */ + 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); + + /* + * get socket option of rfcomm channel socket. + */ + bt_status_t (*get_sock_opt)(btsock_type_t type, int channel, btsock_option_type_t option_name, + void *option_value, int *option_len); + /* + + * set socket option of rfcomm channel socket. + */ + bt_status_t (*set_sock_opt)(btsock_type_t type, int channel, btsock_option_type_t option_name, + void *option_value, int option_len); + +} btsock_interface_t; + +__END_DECLS + diff --git a/third_party/android_hardware_libhardware/include/hardware/camera.h b/third_party/android_hardware_libhardware/include/hardware/camera.h new file mode 100644 index 000000000..b1f18fffc --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/camera.h @@ -0,0 +1,298 @@ +/* + * Copyright (C) 2010-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_INCLUDE_CAMERA_H +#define ANDROID_INCLUDE_CAMERA_H + +#include "camera_common.h" + +/** + * Camera device HAL, initial version [ CAMERA_DEVICE_API_VERSION_1_0 ] + * + * DEPRECATED. New devices should use Camera HAL v3.2 or newer. + * + * Supports the android.hardware.Camera API, and the android.hardware.camera2 + * API in legacy mode only. + * + * Camera devices that support this version of the HAL must return a value in + * the range HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF) in + * camera_device_t.common.version. CAMERA_DEVICE_API_VERSION_1_0 is the + * recommended value. + * + * Camera modules that implement version 2.0 or higher of camera_module_t must + * also return the value of camera_device_t.common.version in + * camera_info_t.device_version. + * + * See camera_common.h for more details. + */ + +__BEGIN_DECLS + +struct camera_memory; +typedef void (*camera_release_memory)(struct camera_memory *mem); + +typedef struct camera_memory { + void *data; + size_t size; + void *handle; + camera_release_memory release; +} camera_memory_t; + +typedef camera_memory_t* (*camera_request_memory)(int fd, size_t buf_size, unsigned int num_bufs, + void *user); + +typedef void (*camera_notify_callback)(int32_t msg_type, + int32_t ext1, + int32_t ext2, + void *user); + +typedef void (*camera_data_callback)(int32_t msg_type, + const camera_memory_t *data, unsigned int index, + camera_frame_metadata_t *metadata, void *user); + +typedef void (*camera_data_timestamp_callback)(int64_t timestamp, + int32_t msg_type, + const camera_memory_t *data, unsigned int index, + void *user); + +#define HAL_CAMERA_PREVIEW_WINDOW_TAG 0xcafed00d + +typedef struct preview_stream_ops { + int (*dequeue_buffer)(struct preview_stream_ops* w, + buffer_handle_t** buffer, int *stride); + int (*enqueue_buffer)(struct preview_stream_ops* w, + buffer_handle_t* buffer); + int (*cancel_buffer)(struct preview_stream_ops* w, + buffer_handle_t* buffer); + int (*set_buffer_count)(struct preview_stream_ops* w, int count); + int (*set_buffers_geometry)(struct preview_stream_ops* pw, + int w, int h, int format); + int (*set_crop)(struct preview_stream_ops *w, + int left, int top, int right, int bottom); + int (*set_usage)(struct preview_stream_ops* w, int usage); + int (*set_swap_interval)(struct preview_stream_ops *w, int interval); + int (*get_min_undequeued_buffer_count)(const struct preview_stream_ops *w, + int *count); + int (*lock_buffer)(struct preview_stream_ops* w, + buffer_handle_t* buffer); + // Timestamps are measured in nanoseconds, and must be comparable + // and monotonically increasing between two frames in the same + // preview stream. They do not need to be comparable between + // consecutive or parallel preview streams, cameras, or app runs. + int (*set_timestamp)(struct preview_stream_ops *w, int64_t timestamp); +} preview_stream_ops_t; + +struct camera_device; +typedef struct camera_device_ops { + /** Set the ANativeWindow to which preview frames are sent */ + int (*set_preview_window)(struct camera_device *, + struct preview_stream_ops *window); + + /** Set the notification and data callbacks */ + void (*set_callbacks)(struct camera_device *, + camera_notify_callback notify_cb, + camera_data_callback data_cb, + camera_data_timestamp_callback data_cb_timestamp, + camera_request_memory get_memory, + void *user); + + /** + * The following three functions all take a msg_type, which is a bitmask of + * the messages defined in include/ui/Camera.h + */ + + /** + * Enable a message, or set of messages. + */ + void (*enable_msg_type)(struct camera_device *, int32_t msg_type); + + /** + * Disable a message, or a set of messages. + * + * Once received a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), camera + * HAL should not rely on its client to call releaseRecordingFrame() to + * release video recording frames sent out by the cameral HAL before and + * after the disableMsgType(CAMERA_MSG_VIDEO_FRAME) call. Camera HAL + * clients must not modify/access any video recording frame after calling + * disableMsgType(CAMERA_MSG_VIDEO_FRAME). + */ + void (*disable_msg_type)(struct camera_device *, int32_t msg_type); + + /** + * Query whether a message, or a set of messages, is enabled. Note that + * this is operates as an AND, if any of the messages queried are off, this + * will return false. + */ + int (*msg_type_enabled)(struct camera_device *, int32_t msg_type); + + /** + * Start preview mode. + */ + int (*start_preview)(struct camera_device *); + + /** + * Stop a previously started preview. + */ + void (*stop_preview)(struct camera_device *); + + /** + * Returns true if preview is enabled. + */ + int (*preview_enabled)(struct camera_device *); + + /** + * Request the camera HAL to store meta data or real YUV data in the video + * buffers sent out via CAMERA_MSG_VIDEO_FRAME for a recording session. If + * it is not called, the default camera HAL behavior is to store real YUV + * data in the video buffers. + * + * This method should be called before startRecording() in order to be + * effective. + * + * If meta data is stored in the video buffers, it is up to the receiver of + * the video buffers to interpret the contents and to find the actual frame + * data with the help of the meta data in the buffer. How this is done is + * outside of the scope of this method. + * + * Some camera HALs may not support storing meta data in the video buffers, + * but all camera HALs should support storing real YUV data in the video + * buffers. If the camera HAL does not support storing the meta data in the + * video buffers when it is requested to do do, INVALID_OPERATION must be + * returned. It is very useful for the camera HAL to pass meta data rather + * than the actual frame data directly to the video encoder, since the + * amount of the uncompressed frame data can be very large if video size is + * large. + * + * @param enable if true to instruct the camera HAL to store + * meta data in the video buffers; false to instruct + * the camera HAL to store real YUV data in the video + * buffers. + * + * @return OK on success. + */ + int (*store_meta_data_in_buffers)(struct camera_device *, int enable); + + /** + * Start record mode. When a record image is available, a + * CAMERA_MSG_VIDEO_FRAME message is sent with the corresponding + * frame. Every record frame must be released by a camera HAL client via + * releaseRecordingFrame() before the client calls + * disableMsgType(CAMERA_MSG_VIDEO_FRAME). After the client calls + * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's + * responsibility to manage the life-cycle of the video recording frames, + * and the client must not modify/access any video recording frames. + */ + int (*start_recording)(struct camera_device *); + + /** + * Stop a previously started recording. + */ + void (*stop_recording)(struct camera_device *); + + /** + * Returns true if recording is enabled. + */ + int (*recording_enabled)(struct camera_device *); + + /** + * Release a record frame previously returned by CAMERA_MSG_VIDEO_FRAME. + * + * It is camera HAL client's responsibility to release video recording + * frames sent out by the camera HAL before the camera HAL receives a call + * to disableMsgType(CAMERA_MSG_VIDEO_FRAME). After it receives the call to + * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's + * responsibility to manage the life-cycle of the video recording frames. + */ + void (*release_recording_frame)(struct camera_device *, + const void *opaque); + + /** + * Start auto focus, the notification callback routine is called with + * CAMERA_MSG_FOCUS once when focusing is complete. autoFocus() will be + * called again if another auto focus is needed. + */ + int (*auto_focus)(struct camera_device *); + + /** + * Cancels auto-focus function. If the auto-focus is still in progress, + * this function will cancel it. Whether the auto-focus is in progress or + * not, this function will return the focus position to the default. If + * the camera does not support auto-focus, this is a no-op. + */ + int (*cancel_auto_focus)(struct camera_device *); + + /** + * Take a picture. + */ + int (*take_picture)(struct camera_device *); + + /** + * Cancel a picture that was started with takePicture. Calling this method + * when no picture is being taken is a no-op. + */ + int (*cancel_picture)(struct camera_device *); + + /** + * Set the camera parameters. This returns BAD_VALUE if any parameter is + * invalid or not supported. + */ + int (*set_parameters)(struct camera_device *, const char *parms); + + /** Retrieve the camera parameters. The buffer returned by the camera HAL + must be returned back to it with put_parameters, if put_parameters + is not NULL. + */ + char *(*get_parameters)(struct camera_device *); + + /** The camera HAL uses its own memory to pass us the parameters when we + call get_parameters. Use this function to return the memory back to + the camera HAL, if put_parameters is not NULL. If put_parameters + is NULL, then you have to use free() to release the memory. + */ + void (*put_parameters)(struct camera_device *, char *); + + /** + * Send command to camera driver. + */ + int (*send_command)(struct camera_device *, + int32_t cmd, int32_t arg1, int32_t arg2); + + /** + * Release the hardware resources owned by this object. Note that this is + * *not* done in the destructor. + */ + void (*release)(struct camera_device *); + + /** + * Dump state of the camera hardware + */ + int (*dump)(struct camera_device *, int fd); +} camera_device_ops_t; + +typedef struct camera_device { + /** + * camera_device.common.version must be in the range + * HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF). CAMERA_DEVICE_API_VERSION_1_0 is + * recommended. + */ + hw_device_t common; + camera_device_ops_t *ops; + void *priv; +} camera_device_t; + +__END_DECLS + +#endif /* #ifdef ANDROID_INCLUDE_CAMERA_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/camera2.h b/third_party/android_hardware_libhardware/include/hardware/camera2.h new file mode 100644 index 000000000..d920d4b65 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/camera2.h @@ -0,0 +1,839 @@ +/* + * 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_CAMERA2_H +#define ANDROID_INCLUDE_CAMERA2_H + +#include "camera_common.h" +#include "system/camera_metadata.h" + +/** + * Camera device HAL 2.1 [ CAMERA_DEVICE_API_VERSION_2_0, CAMERA_DEVICE_API_VERSION_2_1 ] + * + * DEPRECATED. New devices should use Camera HAL v3.2 or newer. + * + * Supports the android.hardware.Camera API, and the android.hardware.camera2 + * API in legacy mode only. + * + * Camera devices that support this version of the HAL must return + * CAMERA_DEVICE_API_VERSION_2_1 in camera_device_t.common.version and in + * camera_info_t.device_version (from camera_module_t.get_camera_info). + * + * Camera modules that may contain version 2.x devices must implement at least + * version 2.0 of the camera module interface (as defined by + * camera_module_t.common.module_api_version). + * + * See camera_common.h for more versioning details. + * + * Version history: + * + * 2.0: CAMERA_DEVICE_API_VERSION_2_0. Initial release (Android 4.2): + * - Sufficient for implementing existing android.hardware.Camera API. + * - Allows for ZSL queue in camera service layer + * - Not tested for any new features such manual capture control, + * Bayer RAW capture, reprocessing of RAW data. + * + * 2.1: CAMERA_DEVICE_API_VERSION_2_1. Support per-device static metadata: + * - Add get_instance_metadata() method to retrieve metadata that is fixed + * after device open, but may be variable between open() calls. + */ + +__BEGIN_DECLS + +struct camera2_device; + +/********************************************************************** + * + * Input/output stream buffer queue interface definitions + * + */ + +/** + * Output image stream queue interface. A set of these methods is provided to + * the HAL device in allocate_stream(), and are used to interact with the + * gralloc buffer queue for that stream. They may not be called until after + * allocate_stream returns. + */ +typedef struct camera2_stream_ops { + /** + * Get a buffer to fill from the queue. The size and format of the buffer + * are fixed for a given stream (defined in allocate_stream), and the stride + * should be queried from the platform gralloc module. The gralloc buffer + * will have been allocated based on the usage flags provided by + * allocate_stream, and will be locked for use. + */ + int (*dequeue_buffer)(const struct camera2_stream_ops* w, + buffer_handle_t** buffer); + + /** + * Push a filled buffer to the stream to be used by the consumer. + * + * The timestamp represents the time at start of exposure of the first row + * of the image; it must be from a monotonic clock, and is measured in + * nanoseconds. The timestamps do not need to be comparable between + * different cameras, or consecutive instances of the same camera. However, + * they must be comparable between streams from the same camera. If one + * capture produces buffers for multiple streams, each stream must have the + * same timestamp for that buffer, and that timestamp must match the + * timestamp in the output frame metadata. + */ + int (*enqueue_buffer)(const struct camera2_stream_ops* w, + int64_t timestamp, + buffer_handle_t* buffer); + /** + * Return a buffer to the queue without marking it as filled. + */ + int (*cancel_buffer)(const struct camera2_stream_ops* w, + buffer_handle_t* buffer); + /** + * Set the crop window for subsequently enqueued buffers. The parameters are + * measured in pixels relative to the buffer width and height. + */ + int (*set_crop)(const struct camera2_stream_ops *w, + int left, int top, int right, int bottom); + +} camera2_stream_ops_t; + +/** + * Temporary definition during transition. + * + * These formats will be removed and replaced with + * HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED. To maximize forward compatibility, + * HAL implementations are strongly recommended to treat FORMAT_OPAQUE and + * FORMAT_ZSL as equivalent to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, and + * return HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED in the format_actual output + * parameter of allocate_stream, allowing the gralloc module to select the + * specific format based on the usage flags from the camera and the stream + * consumer. + */ +enum { + CAMERA2_HAL_PIXEL_FORMAT_OPAQUE = HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, + CAMERA2_HAL_PIXEL_FORMAT_ZSL = -1 +}; + +/** + * Transport header for compressed JPEG buffers in output streams. + * + * To capture JPEG images, a stream is created using the pixel format + * HAL_PIXEL_FORMAT_BLOB, and the static metadata field android.jpeg.maxSize is + * used as the buffer size. Since compressed JPEG images are of variable size, + * the HAL needs to include the final size of the compressed image using this + * structure inside the output stream buffer. The JPEG blob ID field must be set + * to CAMERA2_JPEG_BLOB_ID. + * + * Transport header should be at the end of the JPEG output stream buffer. That + * means the jpeg_blob_id must start at byte[android.jpeg.maxSize - + * sizeof(camera2_jpeg_blob)]. Any HAL using this transport header must + * account for it in android.jpeg.maxSize. The JPEG data itself starts at + * byte[0] and should be jpeg_size bytes long. + */ +typedef struct camera2_jpeg_blob { + uint16_t jpeg_blob_id; + uint32_t jpeg_size; +}; + +enum { + CAMERA2_JPEG_BLOB_ID = 0x00FF +}; + +/** + * Input reprocess stream queue management. A set of these methods is provided + * to the HAL device in allocate_reprocess_stream(); they are used to interact + * with the reprocess stream's input gralloc buffer queue. + */ +typedef struct camera2_stream_in_ops { + /** + * Get the next buffer of image data to reprocess. The width, height, and + * format of the buffer is fixed in allocate_reprocess_stream(), and the + * stride and other details should be queried from the platform gralloc + * module as needed. The buffer will already be locked for use. + */ + int (*acquire_buffer)(const struct camera2_stream_in_ops *w, + buffer_handle_t** buffer); + /** + * Return a used buffer to the buffer queue for reuse. + */ + int (*release_buffer)(const struct camera2_stream_in_ops *w, + buffer_handle_t* buffer); + +} camera2_stream_in_ops_t; + +/********************************************************************** + * + * Metadata queue management, used for requests sent to HAL module, and for + * frames produced by the HAL. + * + */ + +enum { + CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS = -1 +}; + +/** + * Request input queue protocol: + * + * The framework holds the queue and its contents. At start, the queue is empty. + * + * 1. When the first metadata buffer is placed into the queue, the framework + * signals the device by calling notify_request_queue_not_empty(). + * + * 2. After receiving notify_request_queue_not_empty, the device must call + * dequeue() once it's ready to handle the next buffer. + * + * 3. Once the device has processed a buffer, and is ready for the next buffer, + * it must call dequeue() again instead of waiting for a notification. If + * there are no more buffers available, dequeue() will return NULL. After + * this point, when a buffer becomes available, the framework must call + * notify_request_queue_not_empty() again. If the device receives a NULL + * return from dequeue, it does not need to query the queue again until a + * notify_request_queue_not_empty() call is received from the source. + * + * 4. If the device calls buffer_count() and receives 0, this does not mean that + * the framework will provide a notify_request_queue_not_empty() call. The + * framework will only provide such a notification after the device has + * received a NULL from dequeue, or on initial startup. + * + * 5. The dequeue() call in response to notify_request_queue_not_empty() may be + * on the same thread as the notify_request_queue_not_empty() call, and may + * be performed from within the notify call. + * + * 6. All dequeued request buffers must be returned to the framework by calling + * free_request, including when errors occur, a device flush is requested, or + * when the device is shutting down. + */ +typedef struct camera2_request_queue_src_ops { + /** + * Get the count of request buffers pending in the queue. May return + * CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS if a repeating request (stream + * request) is currently configured. Calling this method has no effect on + * whether the notify_request_queue_not_empty() method will be called by the + * framework. + */ + int (*request_count)(const struct camera2_request_queue_src_ops *q); + + /** + * Get a metadata buffer from the framework. Returns OK if there is no + * error. If the queue is empty, returns NULL in buffer. In that case, the + * device must wait for a notify_request_queue_not_empty() message before + * attempting to dequeue again. Buffers obtained in this way must be + * returned to the framework with free_request(). + */ + int (*dequeue_request)(const struct camera2_request_queue_src_ops *q, + camera_metadata_t **buffer); + /** + * Return a metadata buffer to the framework once it has been used, or if + * an error or shutdown occurs. + */ + int (*free_request)(const struct camera2_request_queue_src_ops *q, + camera_metadata_t *old_buffer); + +} camera2_request_queue_src_ops_t; + +/** + * Frame output queue protocol: + * + * The framework holds the queue and its contents. At start, the queue is empty. + * + * 1. When the device is ready to fill an output metadata frame, it must dequeue + * a metadata buffer of the required size. + * + * 2. It should then fill the metadata buffer, and place it on the frame queue + * using enqueue_frame. The framework takes ownership of the frame. + * + * 3. In case of an error, a request to flush the pipeline, or shutdown, the + * device must return any affected dequeued frames to the framework by + * calling cancel_frame. + */ +typedef struct camera2_frame_queue_dst_ops { + /** + * Get an empty metadata buffer to fill from the framework. The new metadata + * buffer will have room for entries number of metadata entries, plus + * data_bytes worth of extra storage. Frames dequeued here must be returned + * to the framework with either cancel_frame or enqueue_frame. + */ + int (*dequeue_frame)(const struct camera2_frame_queue_dst_ops *q, + size_t entries, size_t data_bytes, + camera_metadata_t **buffer); + + /** + * Return a dequeued metadata buffer to the framework for reuse; do not mark it as + * filled. Use when encountering errors, or flushing the internal request queue. + */ + int (*cancel_frame)(const struct camera2_frame_queue_dst_ops *q, + camera_metadata_t *buffer); + + /** + * Place a completed metadata frame on the frame output queue. + */ + int (*enqueue_frame)(const struct camera2_frame_queue_dst_ops *q, + camera_metadata_t *buffer); + +} camera2_frame_queue_dst_ops_t; + +/********************************************************************** + * + * Notification callback and message definition, and trigger definitions + * + */ + +/** + * Asynchronous notification callback from the HAL, fired for various + * reasons. Only for information independent of frame capture, or that require + * specific timing. The user pointer must be the same one that was passed to the + * device in set_notify_callback(). + */ +typedef void (*camera2_notify_callback)(int32_t msg_type, + int32_t ext1, + int32_t ext2, + int32_t ext3, + void *user); + +/** + * Possible message types for camera2_notify_callback + */ +enum { + /** + * An error has occurred. Argument ext1 contains the error code, and + * ext2 and ext3 contain any error-specific information. + */ + CAMERA2_MSG_ERROR = 0x0001, + /** + * The exposure of a given request has begun. Argument ext1 contains the + * frame number, and ext2 and ext3 contain the low-order and high-order + * bytes of the timestamp for when exposure began. + * (timestamp = (ext3 << 32 | ext2)) + */ + CAMERA2_MSG_SHUTTER = 0x0010, + /** + * The autofocus routine has changed state. Argument ext1 contains the new + * state; the values are the same as those for the metadata field + * android.control.afState. Ext2 contains the latest trigger ID passed to + * trigger_action(CAMERA2_TRIGGER_AUTOFOCUS) or + * trigger_action(CAMERA2_TRIGGER_CANCEL_AUTOFOCUS), or 0 if trigger has not + * been called with either of those actions. + */ + CAMERA2_MSG_AUTOFOCUS = 0x0020, + /** + * The autoexposure routine has changed state. Argument ext1 contains the + * new state; the values are the same as those for the metadata field + * android.control.aeState. Ext2 contains the latest trigger ID value passed to + * trigger_action(CAMERA2_TRIGGER_PRECAPTURE_METERING), or 0 if that method + * has not been called. + */ + CAMERA2_MSG_AUTOEXPOSURE = 0x0021, + /** + * The auto-whitebalance routine has changed state. Argument ext1 contains + * the new state; the values are the same as those for the metadata field + * android.control.awbState. Ext2 contains the latest trigger ID passed to + * trigger_action(CAMERA2_TRIGGER_PRECAPTURE_METERING), or 0 if that method + * has not been called. + */ + CAMERA2_MSG_AUTOWB = 0x0022 +}; + +/** + * Error codes for CAMERA_MSG_ERROR + */ +enum { + /** + * A serious failure occured. Camera device may not work without reboot, and + * no further frames or buffer streams will be produced by the + * device. Device should be treated as closed. + */ + CAMERA2_MSG_ERROR_HARDWARE = 0x0001, + /** + * A serious failure occured. No further frames or buffer streams will be + * produced by the device. Device should be treated as closed. The client + * must reopen the device to use it again. + */ + CAMERA2_MSG_ERROR_DEVICE, + /** + * An error has occurred in processing a request. No output (metadata or + * buffers) will be produced for this request. ext2 contains the frame + * number of the request. Subsequent requests are unaffected, and the device + * remains operational. + */ + CAMERA2_MSG_ERROR_REQUEST, + /** + * An error has occurred in producing an output frame metadata buffer for a + * request, but image buffers for it will still be available. Subsequent + * requests are unaffected, and the device remains operational. ext2 + * contains the frame number of the request. + */ + CAMERA2_MSG_ERROR_FRAME, + /** + * An error has occurred in placing an output buffer into a stream for a + * request. The frame metadata and other buffers may still be + * available. Subsequent requests are unaffected, and the device remains + * operational. ext2 contains the frame number of the request, and ext3 + * contains the stream id. + */ + CAMERA2_MSG_ERROR_STREAM, + /** + * Number of error types + */ + CAMERA2_MSG_NUM_ERRORS +}; + +/** + * Possible trigger ids for trigger_action() + */ +enum { + /** + * Trigger an autofocus cycle. The effect of the trigger depends on the + * autofocus mode in effect when the trigger is received, which is the mode + * listed in the latest capture request to be dequeued by the HAL. If the + * mode is OFF, EDOF, or FIXED, the trigger has no effect. In AUTO, MACRO, + * or CONTINUOUS_* modes, see below for the expected behavior. The state of + * the autofocus cycle can be tracked in android.control.afMode and the + * corresponding notifications. + * + ** + * In AUTO or MACRO mode, the AF state transitions (and notifications) + * when calling with trigger ID = N with the previous ID being K are: + * + * Initial state Transitions + * INACTIVE (K) -> ACTIVE_SCAN (N) -> AF_FOCUSED (N) or AF_NOT_FOCUSED (N) + * AF_FOCUSED (K) -> ACTIVE_SCAN (N) -> AF_FOCUSED (N) or AF_NOT_FOCUSED (N) + * AF_NOT_FOCUSED (K) -> ACTIVE_SCAN (N) -> AF_FOCUSED (N) or AF_NOT_FOCUSED (N) + * ACTIVE_SCAN (K) -> AF_FOCUSED(N) or AF_NOT_FOCUSED(N) + * PASSIVE_SCAN (K) Not used in AUTO/MACRO mode + * PASSIVE_FOCUSED (K) Not used in AUTO/MACRO mode + * + ** + * In CONTINUOUS_PICTURE mode, triggering AF must lock the AF to the current + * lens position and transition the AF state to either AF_FOCUSED or + * NOT_FOCUSED. If a passive scan is underway, that scan must complete and + * then lock the lens position and change AF state. TRIGGER_CANCEL_AUTOFOCUS + * will allow the AF to restart its operation. + * + * Initial state Transitions + * INACTIVE (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) + * PASSIVE_FOCUSED (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) + * PASSIVE_SCAN (K) -> AF_FOCUSED (N) or AF_NOT_FOCUSED (N) + * AF_FOCUSED (K) no effect except to change next notification ID to N + * AF_NOT_FOCUSED (K) no effect except to change next notification ID to N + * + ** + * In CONTINUOUS_VIDEO mode, triggering AF must lock the AF to the current + * lens position and transition the AF state to either AF_FOCUSED or + * NOT_FOCUSED. If a passive scan is underway, it must immediately halt, in + * contrast with CONTINUOUS_PICTURE mode. TRIGGER_CANCEL_AUTOFOCUS will + * allow the AF to restart its operation. + * + * Initial state Transitions + * INACTIVE (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) + * PASSIVE_FOCUSED (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) + * PASSIVE_SCAN (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) + * AF_FOCUSED (K) no effect except to change next notification ID to N + * AF_NOT_FOCUSED (K) no effect except to change next notification ID to N + * + * Ext1 is an ID that must be returned in subsequent auto-focus state change + * notifications through camera2_notify_callback() and stored in + * android.control.afTriggerId. + */ + CAMERA2_TRIGGER_AUTOFOCUS = 0x0001, + /** + * Send a cancel message to the autofocus algorithm. The effect of the + * cancellation depends on the autofocus mode in effect when the trigger is + * received, which is the mode listed in the latest capture request to be + * dequeued by the HAL. If the AF mode is OFF or EDOF, the cancel has no + * effect. For other modes, the lens should return to its default position, + * any current autofocus scan must be canceled, and the AF state should be + * set to INACTIVE. + * + * The state of the autofocus cycle can be tracked in android.control.afMode + * and the corresponding notification. Continuous autofocus modes may resume + * focusing operations thereafter exactly as if the camera had just been set + * to a continuous AF mode. + * + * Ext1 is an ID that must be returned in subsequent auto-focus state change + * notifications through camera2_notify_callback() and stored in + * android.control.afTriggerId. + */ + CAMERA2_TRIGGER_CANCEL_AUTOFOCUS, + /** + * Trigger a pre-capture metering cycle, which may include firing the flash + * to determine proper capture parameters. Typically, this trigger would be + * fired for a half-depress of a camera shutter key, or before a snapshot + * capture in general. The state of the metering cycle can be tracked in + * android.control.aeMode and the corresponding notification. If the + * auto-exposure mode is OFF, the trigger does nothing. + * + * Ext1 is an ID that must be returned in subsequent + * auto-exposure/auto-white balance state change notifications through + * camera2_notify_callback() and stored in android.control.aePrecaptureId. + */ + CAMERA2_TRIGGER_PRECAPTURE_METERING +}; + +/** + * Possible template types for construct_default_request() + */ +enum { + /** + * Standard camera preview operation with 3A on auto. + */ + CAMERA2_TEMPLATE_PREVIEW = 1, + /** + * Standard camera high-quality still capture with 3A and flash on auto. + */ + CAMERA2_TEMPLATE_STILL_CAPTURE, + /** + * Standard video recording plus preview with 3A on auto, torch off. + */ + CAMERA2_TEMPLATE_VIDEO_RECORD, + /** + * High-quality still capture while recording video. Application will + * include preview, video record, and full-resolution YUV or JPEG streams in + * request. Must not cause stuttering on video stream. 3A on auto. + */ + CAMERA2_TEMPLATE_VIDEO_SNAPSHOT, + /** + * Zero-shutter-lag mode. Application will request preview and + * full-resolution data for each frame, and reprocess it to JPEG when a + * still image is requested by user. Settings should provide highest-quality + * full-resolution images without compromising preview frame rate. 3A on + * auto. + */ + CAMERA2_TEMPLATE_ZERO_SHUTTER_LAG, + + /* Total number of templates */ + CAMERA2_TEMPLATE_COUNT +}; + + +/********************************************************************** + * + * Camera device operations + * + */ +typedef struct camera2_device_ops { + + /********************************************************************** + * Request and frame queue setup and management methods + */ + + /** + * Pass in input request queue interface methods. + */ + int (*set_request_queue_src_ops)(const struct camera2_device *, + const camera2_request_queue_src_ops_t *request_src_ops); + + /** + * Notify device that the request queue is no longer empty. Must only be + * called when the first buffer is added a new queue, or after the source + * has returned NULL in response to a dequeue call. + */ + int (*notify_request_queue_not_empty)(const struct camera2_device *); + + /** + * Pass in output frame queue interface methods + */ + int (*set_frame_queue_dst_ops)(const struct camera2_device *, + const camera2_frame_queue_dst_ops_t *frame_dst_ops); + + /** + * Number of camera requests being processed by the device at the moment + * (captures/reprocesses that have had their request dequeued, but have not + * yet been enqueued onto output pipeline(s) ). No streams may be released + * by the framework until the in-progress count is 0. + */ + int (*get_in_progress_count)(const struct camera2_device *); + + /** + * Flush all in-progress captures. This includes all dequeued requests + * (regular or reprocessing) that have not yet placed any outputs into a + * stream or the frame queue. Partially completed captures must be completed + * normally. No new requests may be dequeued from the request queue until + * the flush completes. + */ + int (*flush_captures_in_progress)(const struct camera2_device *); + + /** + * Create a filled-in default request for standard camera use cases. + * + * The device must return a complete request that is configured to meet the + * requested use case, which must be one of the CAMERA2_TEMPLATE_* + * enums. All request control fields must be included, except for + * android.request.outputStreams. + * + * The metadata buffer returned must be allocated with + * allocate_camera_metadata. The framework takes ownership of the buffer. + */ + int (*construct_default_request)(const struct camera2_device *, + int request_template, + camera_metadata_t **request); + + /********************************************************************** + * Stream management + */ + + /** + * allocate_stream: + * + * Allocate a new output stream for use, defined by the output buffer width, + * height, target, and possibly the pixel format. Returns the new stream's + * ID, gralloc usage flags, minimum queue buffer count, and possibly the + * pixel format, on success. Error conditions: + * + * - Requesting a width/height/format combination not listed as + * supported by the sensor's static characteristics + * + * - Asking for too many streams of a given format type (2 bayer raw + * streams, for example). + * + * Input parameters: + * + * - width, height, format: Specification for the buffers to be sent through + * this stream. Format is a value from the HAL_PIXEL_FORMAT_* list. If + * HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform + * gralloc module will select a format based on the usage flags provided + * by the camera HAL and the consumer of the stream. The camera HAL should + * inspect the buffers handed to it in the register_stream_buffers call to + * obtain the implementation-specific format if necessary. + * + * - stream_ops: A structure of function pointers for obtaining and queuing + * up buffers for this stream. The underlying stream will be configured + * based on the usage and max_buffers outputs. The methods in this + * structure may not be called until after allocate_stream returns. + * + * Output parameters: + * + * - stream_id: An unsigned integer identifying this stream. This value is + * used in incoming requests to identify the stream, and in releasing the + * stream. + * + * - usage: The gralloc usage mask needed by the HAL device for producing + * the requested type of data. This is used in allocating new gralloc + * buffers for the stream buffer queue. + * + * - max_buffers: The maximum number of buffers the HAL device may need to + * have dequeued at the same time. The device may not dequeue more buffers + * than this value at the same time. + * + */ + int (*allocate_stream)( + const struct camera2_device *, + // inputs + uint32_t width, + uint32_t height, + int format, + const camera2_stream_ops_t *stream_ops, + // outputs + uint32_t *stream_id, + uint32_t *format_actual, // IGNORED, will be removed + uint32_t *usage, + uint32_t *max_buffers); + + /** + * Register buffers for a given stream. This is called after a successful + * allocate_stream call, and before the first request referencing the stream + * is enqueued. This method is intended to allow the HAL device to map or + * otherwise prepare the buffers for later use. num_buffers is guaranteed to + * be at least max_buffers (from allocate_stream), but may be larger. The + * buffers will already be locked for use. At the end of the call, all the + * buffers must be ready to be returned to the queue. If the stream format + * was set to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, the camera HAL should + * inspect the passed-in buffers here to determine any platform-private + * pixel format information. + */ + int (*register_stream_buffers)( + const struct camera2_device *, + uint32_t stream_id, + int num_buffers, + buffer_handle_t *buffers); + + /** + * Release a stream. Returns an error if called when get_in_progress_count + * is non-zero, or if the stream id is invalid. + */ + int (*release_stream)( + const struct camera2_device *, + uint32_t stream_id); + + /** + * allocate_reprocess_stream: + * + * Allocate a new input stream for use, defined by the output buffer width, + * height, and the pixel format. Returns the new stream's ID, gralloc usage + * flags, and required simultaneously acquirable buffer count, on + * success. Error conditions: + * + * - Requesting a width/height/format combination not listed as + * supported by the sensor's static characteristics + * + * - Asking for too many reprocessing streams to be configured at once. + * + * Input parameters: + * + * - width, height, format: Specification for the buffers to be sent through + * this stream. Format must be a value from the HAL_PIXEL_FORMAT_* list. + * + * - reprocess_stream_ops: A structure of function pointers for acquiring + * and releasing buffers for this stream. The underlying stream will be + * configured based on the usage and max_buffers outputs. + * + * Output parameters: + * + * - stream_id: An unsigned integer identifying this stream. This value is + * used in incoming requests to identify the stream, and in releasing the + * stream. These ids are numbered separately from the input stream ids. + * + * - consumer_usage: The gralloc usage mask needed by the HAL device for + * consuming the requested type of data. This is used in allocating new + * gralloc buffers for the stream buffer queue. + * + * - max_buffers: The maximum number of buffers the HAL device may need to + * have acquired at the same time. The device may not have more buffers + * acquired at the same time than this value. + * + */ + int (*allocate_reprocess_stream)(const struct camera2_device *, + uint32_t width, + uint32_t height, + uint32_t format, + const camera2_stream_in_ops_t *reprocess_stream_ops, + // outputs + uint32_t *stream_id, + uint32_t *consumer_usage, + uint32_t *max_buffers); + + /** + * allocate_reprocess_stream_from_stream: + * + * Allocate a new input stream for use, which will use the buffers allocated + * for an existing output stream. That is, after the HAL enqueues a buffer + * onto the output stream, it may see that same buffer handed to it from + * this input reprocessing stream. After the HAL releases the buffer back to + * the reprocessing stream, it will be returned to the output queue for + * reuse. + * + * Error conditions: + * + * - Using an output stream of unsuitable size/format for the basis of the + * reprocessing stream. + * + * - Attempting to allocatee too many reprocessing streams at once. + * + * Input parameters: + * + * - output_stream_id: The ID of an existing output stream which has + * a size and format suitable for reprocessing. + * + * - reprocess_stream_ops: A structure of function pointers for acquiring + * and releasing buffers for this stream. The underlying stream will use + * the same graphics buffer handles as the output stream uses. + * + * Output parameters: + * + * - stream_id: An unsigned integer identifying this stream. This value is + * used in incoming requests to identify the stream, and in releasing the + * stream. These ids are numbered separately from the input stream ids. + * + * The HAL client must always release the reprocessing stream before it + * releases the output stream it is based on. + * + */ + int (*allocate_reprocess_stream_from_stream)(const struct camera2_device *, + uint32_t output_stream_id, + const camera2_stream_in_ops_t *reprocess_stream_ops, + // outputs + uint32_t *stream_id); + + /** + * Release a reprocessing stream. Returns an error if called when + * get_in_progress_count is non-zero, or if the stream id is not + * valid. + */ + int (*release_reprocess_stream)( + const struct camera2_device *, + uint32_t stream_id); + + /********************************************************************** + * Miscellaneous methods + */ + + /** + * Trigger asynchronous activity. This is used for triggering special + * behaviors of the camera 3A routines when they are in use. See the + * documentation for CAMERA2_TRIGGER_* above for details of the trigger ids + * and their arguments. + */ + int (*trigger_action)(const struct camera2_device *, + uint32_t trigger_id, + int32_t ext1, + int32_t ext2); + + /** + * Notification callback setup + */ + int (*set_notify_callback)(const struct camera2_device *, + camera2_notify_callback notify_cb, + void *user); + + /** + * Get methods to query for vendor extension metadata tag infomation. May + * set ops to NULL if no vendor extension tags are defined. + */ + int (*get_metadata_vendor_tag_ops)(const struct camera2_device*, + vendor_tag_query_ops_t **ops); + + /** + * Dump state of the camera hardware + */ + int (*dump)(const struct camera2_device *, int fd); + + /** + * Get device-instance-specific metadata. This metadata must be constant for + * a single instance of the camera device, but may be different between + * open() calls. The returned camera_metadata pointer must be valid until + * the device close() method is called. + * + * Version information: + * + * CAMERA_DEVICE_API_VERSION_2_0: + * + * Not available. Framework may not access this function pointer. + * + * CAMERA_DEVICE_API_VERSION_2_1: + * + * Valid. Can be called by the framework. + * + */ + int (*get_instance_metadata)(const struct camera2_device *, + camera_metadata **instance_metadata); + +} camera2_device_ops_t; + +/********************************************************************** + * + * Camera device definition + * + */ +typedef struct camera2_device { + /** + * common.version must equal CAMERA_DEVICE_API_VERSION_2_0 to identify + * this device as implementing version 2.0 of the camera device HAL. + */ + hw_device_t common; + camera2_device_ops_t *ops; + void *priv; +} camera2_device_t; + +__END_DECLS + +#endif /* #ifdef ANDROID_INCLUDE_CAMERA2_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/camera3.h b/third_party/android_hardware_libhardware/include/hardware/camera3.h new file mode 100644 index 000000000..3ef6d6fad --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/camera3.h @@ -0,0 +1,3077 @@ +/* + * 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_CAMERA3_H +#define ANDROID_INCLUDE_CAMERA3_H + +#include +#include "camera_common.h" + +/** + * Camera device HAL 3.3 [ CAMERA_DEVICE_API_VERSION_3_3 ] + * + * This is the current recommended version of the camera device HAL. + * + * Supports the android.hardware.Camera API, and as of v3.2, the + * android.hardware.camera2 API in LIMITED or FULL modes. + * + * Camera devices that support this version of the HAL must return + * CAMERA_DEVICE_API_VERSION_3_3 in camera_device_t.common.version and in + * camera_info_t.device_version (from camera_module_t.get_camera_info). + * + * CAMERA_DEVICE_API_VERSION_3_3: + * Camera modules that may contain version 3.3 devices must implement at + * least version 2.2 of the camera module interface (as defined by + * camera_module_t.common.module_api_version). + * + * CAMERA_DEVICE_API_VERSION_3_2: + * Camera modules that may contain version 3.2 devices must implement at + * least version 2.2 of the camera module interface (as defined by + * camera_module_t.common.module_api_version). + * + * <= CAMERA_DEVICE_API_VERSION_3_1: + * Camera modules that may contain version 3.1 (or 3.0) devices must + * implement at least version 2.0 of the camera module interface + * (as defined by camera_module_t.common.module_api_version). + * + * See camera_common.h for more versioning details. + * + * Documentation index: + * S1. Version history + * S2. Startup and operation sequencing + * S3. Operational modes + * S4. 3A modes and state machines + * S5. Cropping + * S6. Error management + * S7. Key Performance Indicator (KPI) glossary + * S8. Sample Use Cases + * S9. Notes on Controls and Metadata + * S10. Reprocessing flow and controls + */ + +/** + * S1. Version history: + * + * 1.0: Initial Android camera HAL (Android 4.0) [camera.h]: + * + * - Converted from C++ CameraHardwareInterface abstraction layer. + * + * - Supports android.hardware.Camera API. + * + * 2.0: Initial release of expanded-capability HAL (Android 4.2) [camera2.h]: + * + * - Sufficient for implementing existing android.hardware.Camera API. + * + * - Allows for ZSL queue in camera service layer + * + * - Not tested for any new features such manual capture control, Bayer RAW + * capture, reprocessing of RAW data. + * + * 3.0: First revision of expanded-capability HAL: + * + * - Major version change since the ABI is completely different. No change to + * the required hardware capabilities or operational model from 2.0. + * + * - Reworked input request and stream queue interfaces: Framework calls into + * HAL with next request and stream buffers already dequeued. Sync framework + * support is included, necessary for efficient implementations. + * + * - Moved triggers into requests, most notifications into results. + * + * - Consolidated all callbacks into framework into one structure, and all + * setup methods into a single initialize() call. + * + * - Made stream configuration into a single call to simplify stream + * management. Bidirectional streams replace STREAM_FROM_STREAM construct. + * + * - Limited mode semantics for older/limited hardware devices. + * + * 3.1: Minor revision of expanded-capability HAL: + * + * - configure_streams passes consumer usage flags to the HAL. + * + * - flush call to drop all in-flight requests/buffers as fast as possible. + * + * 3.2: Minor revision of expanded-capability HAL: + * + * - Deprecates get_metadata_vendor_tag_ops. Please use get_vendor_tag_ops + * in camera_common.h instead. + * + * - register_stream_buffers deprecated. All gralloc buffers provided + * by framework to HAL in process_capture_request may be new at any time. + * + * - add partial result support. process_capture_result may be called + * multiple times with a subset of the available result before the full + * result is available. + * + * - add manual template to camera3_request_template. The applications may + * use this template to control the capture settings directly. + * + * - Rework the bidirectional and input stream specifications. + * + * - change the input buffer return path. The buffer is returned in + * process_capture_result instead of process_capture_request. + * + * 3.3: Minor revision of expanded-capability HAL: + * + * - OPAQUE and YUV reprocessing API updates. + * + * - Basic support for depth output buffers. + * + * - Addition of data_space field to camera3_stream_t. + * + * - Addition of rotation field to camera3_stream_t. + * + * - Addition of camera3 stream configuration operation mode to camera3_stream_configuration_t + * + */ + +/** + * S2. Startup and general expected operation sequence: + * + * 1. Framework calls camera_module_t->common.open(), which returns a + * hardware_device_t structure. + * + * 2. Framework inspects the hardware_device_t->version field, and instantiates + * the appropriate handler for that version of the camera hardware device. In + * case the version is CAMERA_DEVICE_API_VERSION_3_0, the device is cast to + * a camera3_device_t. + * + * 3. Framework calls camera3_device_t->ops->initialize() with the framework + * callback function pointers. This will only be called this one time after + * open(), before any other functions in the ops structure are called. + * + * 4. The framework calls camera3_device_t->ops->configure_streams() with a list + * of input/output streams to the HAL device. + * + * 5. <= CAMERA_DEVICE_API_VERSION_3_1: + * + * The framework allocates gralloc buffers and calls + * camera3_device_t->ops->register_stream_buffers() for at least one of the + * output streams listed in configure_streams. The same stream is registered + * only once. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * camera3_device_t->ops->register_stream_buffers() is not called and must + * be NULL. + * + * 6. The framework requests default settings for some number of use cases with + * calls to camera3_device_t->ops->construct_default_request_settings(). This + * may occur any time after step 3. + * + * 7. The framework constructs and sends the first capture request to the HAL, + * with settings based on one of the sets of default settings, and with at + * least one output stream, which has been registered earlier by the + * framework. This is sent to the HAL with + * camera3_device_t->ops->process_capture_request(). The HAL must block the + * return of this call until it is ready for the next request to be sent. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * The buffer_handle_t provided in the camera3_stream_buffer_t array + * in the camera3_capture_request_t may be new and never-before-seen + * by the HAL on any given new request. + * + * 8. The framework continues to submit requests, and call + * construct_default_request_settings to get default settings buffers for + * other use cases. + * + * <= CAMERA_DEVICE_API_VERSION_3_1: + * + * The framework may call register_stream_buffers() at this time for + * not-yet-registered streams. + * + * 9. When the capture of a request begins (sensor starts exposing for the + * capture) or processing a reprocess request begins, the HAL + * calls camera3_callback_ops_t->notify() with the SHUTTER event, including + * the frame number and the timestamp for start of exposure. For a reprocess + * request, the timestamp must be the start of exposure of the input image + * which can be looked up with android.sensor.timestamp from + * camera3_capture_request_t.settings when process_capture_request() is + * called. + * + * <= CAMERA_DEVICE_API_VERSION_3_1: + * + * This notify call must be made before the first call to + * process_capture_result() for that frame number. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * The camera3_callback_ops_t->notify() call with the SHUTTER event should + * be made as early as possible since the framework will be unable to + * deliver gralloc buffers to the application layer (for that frame) until + * it has a valid timestamp for the start of exposure (or the input image's + * start of exposure for a reprocess request). + * + * Both partial metadata results and the gralloc buffers may be sent to the + * framework at any time before or after the SHUTTER event. + * + * 10. After some pipeline delay, the HAL begins to return completed captures to + * the framework with camera3_callback_ops_t->process_capture_result(). These + * are returned in the same order as the requests were submitted. Multiple + * requests can be in flight at once, depending on the pipeline depth of the + * camera HAL device. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * Once a buffer is returned by process_capture_result as part of the + * camera3_stream_buffer_t array, and the fence specified by release_fence + * has been signaled (this is a no-op for -1 fences), the ownership of that + * buffer is considered to be transferred back to the framework. After that, + * the HAL must no longer retain that particular buffer, and the + * framework may clean up the memory for it immediately. + * + * process_capture_result may be called multiple times for a single frame, + * each time with a new disjoint piece of metadata and/or set of gralloc + * buffers. The framework will accumulate these partial metadata results + * into one result. + * + * In particular, it is legal for a process_capture_result to be called + * simultaneously for both a frame N and a frame N+1 as long as the + * above rule holds for gralloc buffers (both input and output). + * + * 11. After some time, the framework may stop submitting new requests, wait for + * the existing captures to complete (all buffers filled, all results + * returned), and then call configure_streams() again. This resets the camera + * hardware and pipeline for a new set of input/output streams. Some streams + * may be reused from the previous configuration; if these streams' buffers + * had already been registered with the HAL, they will not be registered + * again. The framework then continues from step 7, if at least one + * registered output stream remains (otherwise, step 5 is required first). + * + * 12. Alternatively, the framework may call camera3_device_t->common->close() + * to end the camera session. This may be called at any time when no other + * calls from the framework are active, although the call may block until all + * in-flight captures have completed (all results returned, all buffers + * filled). After the close call returns, no more calls to the + * camera3_callback_ops_t functions are allowed from the HAL. Once the + * close() call is underway, the framework may not call any other HAL device + * functions. + * + * 13. In case of an error or other asynchronous event, the HAL must call + * camera3_callback_ops_t->notify() with the appropriate error/event + * message. After returning from a fatal device-wide error notification, the + * HAL should act as if close() had been called on it. However, the HAL must + * either cancel or complete all outstanding captures before calling + * notify(), so that once notify() is called with a fatal error, the + * framework will not receive further callbacks from the device. Methods + * besides close() should return -ENODEV or NULL after the notify() method + * returns from a fatal error message. + */ + +/** + * S3. Operational modes: + * + * The camera 3 HAL device can implement one of two possible operational modes; + * limited and full. Full support is expected from new higher-end + * devices. Limited mode has hardware requirements roughly in line with those + * for a camera HAL device v1 implementation, and is expected from older or + * inexpensive devices. Full is a strict superset of limited, and they share the + * same essential operational flow, as documented above. + * + * The HAL must indicate its level of support with the + * android.info.supportedHardwareLevel static metadata entry, with 0 indicating + * limited mode, and 1 indicating full mode support. + * + * Roughly speaking, limited-mode devices do not allow for application control + * of capture settings (3A control only), high-rate capture of high-resolution + * images, raw sensor readout, or support for YUV output streams above maximum + * recording resolution (JPEG only for large images). + * + * ** Details of limited mode behavior: + * + * - Limited-mode devices do not need to implement accurate synchronization + * between capture request settings and the actual image data + * captured. Instead, changes to settings may take effect some time in the + * future, and possibly not for the same output frame for each settings + * entry. Rapid changes in settings may result in some settings never being + * used for a capture. However, captures that include high-resolution output + * buffers ( > 1080p ) have to use the settings as specified (but see below + * for processing rate). + * + * - Limited-mode devices do not need to support most of the + * settings/result/static info metadata. Specifically, only the following settings + * are expected to be consumed or produced by a limited-mode HAL device: + * + * android.control.aeAntibandingMode (controls and dynamic) + * android.control.aeExposureCompensation (controls and dynamic) + * android.control.aeLock (controls and dynamic) + * android.control.aeMode (controls and dynamic) + * android.control.aeRegions (controls and dynamic) + * android.control.aeTargetFpsRange (controls and dynamic) + * android.control.aePrecaptureTrigger (controls and dynamic) + * android.control.afMode (controls and dynamic) + * android.control.afRegions (controls and dynamic) + * android.control.awbLock (controls and dynamic) + * android.control.awbMode (controls and dynamic) + * android.control.awbRegions (controls and dynamic) + * android.control.captureIntent (controls and dynamic) + * android.control.effectMode (controls and dynamic) + * android.control.mode (controls and dynamic) + * android.control.sceneMode (controls and dynamic) + * android.control.videoStabilizationMode (controls and dynamic) + * android.control.aeAvailableAntibandingModes (static) + * android.control.aeAvailableModes (static) + * android.control.aeAvailableTargetFpsRanges (static) + * android.control.aeCompensationRange (static) + * android.control.aeCompensationStep (static) + * android.control.afAvailableModes (static) + * android.control.availableEffects (static) + * android.control.availableSceneModes (static) + * android.control.availableVideoStabilizationModes (static) + * android.control.awbAvailableModes (static) + * android.control.maxRegions (static) + * android.control.sceneModeOverrides (static) + * android.control.aeState (dynamic) + * android.control.afState (dynamic) + * android.control.awbState (dynamic) + * + * android.flash.mode (controls and dynamic) + * android.flash.info.available (static) + * + * android.info.supportedHardwareLevel (static) + * + * android.jpeg.gpsCoordinates (controls and dynamic) + * android.jpeg.gpsProcessingMethod (controls and dynamic) + * android.jpeg.gpsTimestamp (controls and dynamic) + * android.jpeg.orientation (controls and dynamic) + * android.jpeg.quality (controls and dynamic) + * android.jpeg.thumbnailQuality (controls and dynamic) + * android.jpeg.thumbnailSize (controls and dynamic) + * android.jpeg.availableThumbnailSizes (static) + * android.jpeg.maxSize (static) + * + * android.lens.info.minimumFocusDistance (static) + * + * android.request.id (controls and dynamic) + * + * android.scaler.cropRegion (controls and dynamic) + * android.scaler.availableStreamConfigurations (static) + * android.scaler.availableMinFrameDurations (static) + * android.scaler.availableStallDurations (static) + * android.scaler.availableMaxDigitalZoom (static) + * android.scaler.maxDigitalZoom (static) + * android.scaler.croppingType (static) + * + * android.sensor.orientation (static) + * android.sensor.timestamp (dynamic) + * + * android.statistics.faceDetectMode (controls and dynamic) + * android.statistics.info.availableFaceDetectModes (static) + * android.statistics.faceIds (dynamic) + * android.statistics.faceLandmarks (dynamic) + * android.statistics.faceRectangles (dynamic) + * android.statistics.faceScores (dynamic) + * + * android.sync.frameNumber (dynamic) + * android.sync.maxLatency (static) + * + * - Captures in limited mode that include high-resolution (> 1080p) output + * buffers may block in process_capture_request() until all the output buffers + * have been filled. A full-mode HAL device must process sequences of + * high-resolution requests at the rate indicated in the static metadata for + * that pixel format. The HAL must still call process_capture_result() to + * provide the output; the framework must simply be prepared for + * process_capture_request() to block until after process_capture_result() for + * that request completes for high-resolution captures for limited-mode + * devices. + * + * - Full-mode devices must support below additional capabilities: + * - 30fps at maximum resolution is preferred, more than 20fps is required. + * - Per frame control (android.sync.maxLatency == PER_FRAME_CONTROL). + * - Sensor manual control metadata. See MANUAL_SENSOR defined in + * android.request.availableCapabilities. + * - Post-processing manual control metadata. See MANUAL_POST_PROCESSING defined + * in android.request.availableCapabilities. + * + */ + +/** + * S4. 3A modes and state machines: + * + * While the actual 3A algorithms are up to the HAL implementation, a high-level + * state machine description is defined by the HAL interface, to allow the HAL + * device and the framework to communicate about the current state of 3A, and to + * trigger 3A events. + * + * When the device is opened, all the individual 3A states must be + * STATE_INACTIVE. Stream configuration does not reset 3A. For example, locked + * focus must be maintained across the configure() call. + * + * Triggering a 3A action involves simply setting the relevant trigger entry in + * the settings for the next request to indicate start of trigger. For example, + * the trigger for starting an autofocus scan is setting the entry + * ANDROID_CONTROL_AF_TRIGGER to ANDROID_CONTROL_AF_TRIGGER_START for one + * request, and cancelling an autofocus scan is triggered by setting + * ANDROID_CONTROL_AF_TRIGGER to ANDROID_CONTRL_AF_TRIGGER_CANCEL. Otherwise, + * the entry will not exist, or be set to ANDROID_CONTROL_AF_TRIGGER_IDLE. Each + * request with a trigger entry set to a non-IDLE value will be treated as an + * independent triggering event. + * + * At the top level, 3A is controlled by the ANDROID_CONTROL_MODE setting, which + * selects between no 3A (ANDROID_CONTROL_MODE_OFF), normal AUTO mode + * (ANDROID_CONTROL_MODE_AUTO), and using the scene mode setting + * (ANDROID_CONTROL_USE_SCENE_MODE). + * + * - In OFF mode, each of the individual AE/AF/AWB modes are effectively OFF, + * and none of the capture controls may be overridden by the 3A routines. + * + * - In AUTO mode, Auto-focus, auto-exposure, and auto-whitebalance all run + * their own independent algorithms, and have their own mode, state, and + * trigger metadata entries, as listed in the next section. + * + * - In USE_SCENE_MODE, the value of the ANDROID_CONTROL_SCENE_MODE entry must + * be used to determine the behavior of 3A routines. In SCENE_MODEs other than + * FACE_PRIORITY, the HAL must override the values of + * ANDROId_CONTROL_AE/AWB/AF_MODE to be the mode it prefers for the selected + * SCENE_MODE. For example, the HAL may prefer SCENE_MODE_NIGHT to use + * CONTINUOUS_FOCUS AF mode. Any user selection of AE/AWB/AF_MODE when scene + * must be ignored for these scene modes. + * + * - For SCENE_MODE_FACE_PRIORITY, the AE/AWB/AF_MODE controls work as in + * ANDROID_CONTROL_MODE_AUTO, but the 3A routines must bias toward metering + * and focusing on any detected faces in the scene. + * + * S4.1. Auto-focus settings and result entries: + * + * Main metadata entries: + * + * ANDROID_CONTROL_AF_MODE: Control for selecting the current autofocus + * mode. Set by the framework in the request settings. + * + * AF_MODE_OFF: AF is disabled; the framework/app directly controls lens + * position. + * + * AF_MODE_AUTO: Single-sweep autofocus. No lens movement unless AF is + * triggered. + * + * AF_MODE_MACRO: Single-sweep up-close autofocus. No lens movement unless + * AF is triggered. + * + * AF_MODE_CONTINUOUS_VIDEO: Smooth continuous focusing, for recording + * video. Triggering immediately locks focus in current + * position. Canceling resumes cotinuous focusing. + * + * AF_MODE_CONTINUOUS_PICTURE: Fast continuous focusing, for + * zero-shutter-lag still capture. Triggering locks focus once currently + * active sweep concludes. Canceling resumes continuous focusing. + * + * AF_MODE_EDOF: Advanced extended depth of field focusing. There is no + * autofocus scan, so triggering one or canceling one has no effect. + * Images are focused automatically by the HAL. + * + * ANDROID_CONTROL_AF_STATE: Dynamic metadata describing the current AF + * algorithm state, reported by the HAL in the result metadata. + * + * AF_STATE_INACTIVE: No focusing has been done, or algorithm was + * reset. Lens is not moving. Always the state for MODE_OFF or MODE_EDOF. + * When the device is opened, it must start in this state. + * + * AF_STATE_PASSIVE_SCAN: A continuous focus algorithm is currently scanning + * for good focus. The lens is moving. + * + * AF_STATE_PASSIVE_FOCUSED: A continuous focus algorithm believes it is + * well focused. The lens is not moving. The HAL may spontaneously leave + * this state. + * + * AF_STATE_PASSIVE_UNFOCUSED: A continuous focus algorithm believes it is + * not well focused. The lens is not moving. The HAL may spontaneously + * leave this state. + * + * AF_STATE_ACTIVE_SCAN: A scan triggered by the user is underway. + * + * AF_STATE_FOCUSED_LOCKED: The AF algorithm believes it is focused. The + * lens is not moving. + * + * AF_STATE_NOT_FOCUSED_LOCKED: The AF algorithm has been unable to + * focus. The lens is not moving. + * + * ANDROID_CONTROL_AF_TRIGGER: Control for starting an autofocus scan, the + * meaning of which is mode- and state- dependent. Set by the framework in + * the request settings. + * + * AF_TRIGGER_IDLE: No current trigger. + * + * AF_TRIGGER_START: Trigger start of AF scan. Effect is mode and state + * dependent. + * + * AF_TRIGGER_CANCEL: Cancel current AF scan if any, and reset algorithm to + * default. + * + * Additional metadata entries: + * + * ANDROID_CONTROL_AF_REGIONS: Control for selecting the regions of the FOV + * that should be used to determine good focus. This applies to all AF + * modes that scan for focus. Set by the framework in the request + * settings. + * + * S4.2. Auto-exposure settings and result entries: + * + * Main metadata entries: + * + * ANDROID_CONTROL_AE_MODE: Control for selecting the current auto-exposure + * mode. Set by the framework in the request settings. + * + * AE_MODE_OFF: Autoexposure is disabled; the user controls exposure, gain, + * frame duration, and flash. + * + * AE_MODE_ON: Standard autoexposure, with flash control disabled. User may + * set flash to fire or to torch mode. + * + * AE_MODE_ON_AUTO_FLASH: Standard autoexposure, with flash on at HAL's + * discretion for precapture and still capture. User control of flash + * disabled. + * + * AE_MODE_ON_ALWAYS_FLASH: Standard autoexposure, with flash always fired + * for capture, and at HAL's discretion for precapture.. User control of + * flash disabled. + * + * AE_MODE_ON_AUTO_FLASH_REDEYE: Standard autoexposure, with flash on at + * HAL's discretion for precapture and still capture. Use a flash burst + * at end of precapture sequence to reduce redeye in the final + * picture. User control of flash disabled. + * + * ANDROID_CONTROL_AE_STATE: Dynamic metadata describing the current AE + * algorithm state, reported by the HAL in the result metadata. + * + * AE_STATE_INACTIVE: Initial AE state after mode switch. When the device is + * opened, it must start in this state. + * + * AE_STATE_SEARCHING: AE is not converged to a good value, and is adjusting + * exposure parameters. + * + * AE_STATE_CONVERGED: AE has found good exposure values for the current + * scene, and the exposure parameters are not changing. HAL may + * spontaneously leave this state to search for better solution. + * + * AE_STATE_LOCKED: AE has been locked with the AE_LOCK control. Exposure + * values are not changing. + * + * AE_STATE_FLASH_REQUIRED: The HAL has converged exposure, but believes + * flash is required for a sufficiently bright picture. Used for + * determining if a zero-shutter-lag frame can be used. + * + * AE_STATE_PRECAPTURE: The HAL is in the middle of a precapture + * sequence. Depending on AE mode, this mode may involve firing the + * flash for metering, or a burst of flash pulses for redeye reduction. + * + * ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER: Control for starting a metering + * sequence before capturing a high-quality image. Set by the framework in + * the request settings. + * + * PRECAPTURE_TRIGGER_IDLE: No current trigger. + * + * PRECAPTURE_TRIGGER_START: Start a precapture sequence. The HAL should + * use the subsequent requests to measure good exposure/white balance + * for an upcoming high-resolution capture. + * + * Additional metadata entries: + * + * ANDROID_CONTROL_AE_LOCK: Control for locking AE controls to their current + * values + * + * ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION: Control for adjusting AE + * algorithm target brightness point. + * + * ANDROID_CONTROL_AE_TARGET_FPS_RANGE: Control for selecting the target frame + * rate range for the AE algorithm. The AE routine cannot change the frame + * rate to be outside these bounds. + * + * ANDROID_CONTROL_AE_REGIONS: Control for selecting the regions of the FOV + * that should be used to determine good exposure levels. This applies to + * all AE modes besides OFF. + * + * S4.3. Auto-whitebalance settings and result entries: + * + * Main metadata entries: + * + * ANDROID_CONTROL_AWB_MODE: Control for selecting the current white-balance + * mode. + * + * AWB_MODE_OFF: Auto-whitebalance is disabled. User controls color matrix. + * + * AWB_MODE_AUTO: Automatic white balance is enabled; 3A controls color + * transform, possibly using more complex transforms than a simple + * matrix. + * + * AWB_MODE_INCANDESCENT: Fixed white balance settings good for indoor + * incandescent (tungsten) lighting, roughly 2700K. + * + * AWB_MODE_FLUORESCENT: Fixed white balance settings good for fluorescent + * lighting, roughly 5000K. + * + * AWB_MODE_WARM_FLUORESCENT: Fixed white balance settings good for + * fluorescent lighting, roughly 3000K. + * + * AWB_MODE_DAYLIGHT: Fixed white balance settings good for daylight, + * roughly 5500K. + * + * AWB_MODE_CLOUDY_DAYLIGHT: Fixed white balance settings good for clouded + * daylight, roughly 6500K. + * + * AWB_MODE_TWILIGHT: Fixed white balance settings good for + * near-sunset/sunrise, roughly 15000K. + * + * AWB_MODE_SHADE: Fixed white balance settings good for areas indirectly + * lit by the sun, roughly 7500K. + * + * ANDROID_CONTROL_AWB_STATE: Dynamic metadata describing the current AWB + * algorithm state, reported by the HAL in the result metadata. + * + * AWB_STATE_INACTIVE: Initial AWB state after mode switch. When the device + * is opened, it must start in this state. + * + * AWB_STATE_SEARCHING: AWB is not converged to a good value, and is + * changing color adjustment parameters. + * + * AWB_STATE_CONVERGED: AWB has found good color adjustment values for the + * current scene, and the parameters are not changing. HAL may + * spontaneously leave this state to search for better solution. + * + * AWB_STATE_LOCKED: AWB has been locked with the AWB_LOCK control. Color + * adjustment values are not changing. + * + * Additional metadata entries: + * + * ANDROID_CONTROL_AWB_LOCK: Control for locking AWB color adjustments to + * their current values. + * + * ANDROID_CONTROL_AWB_REGIONS: Control for selecting the regions of the FOV + * that should be used to determine good color balance. This applies only + * to auto-WB mode. + * + * S4.4. General state machine transition notes + * + * Switching between AF, AE, or AWB modes always resets the algorithm's state + * to INACTIVE. Similarly, switching between CONTROL_MODE or + * CONTROL_SCENE_MODE if CONTROL_MODE == USE_SCENE_MODE resets all the + * algorithm states to INACTIVE. + * + * The tables below are per-mode. + * + * S4.5. AF state machines + * + * when enabling AF or changing AF mode + *| state | trans. cause | new state | notes | + *+--------------------+---------------+--------------------+------------------+ + *| Any | AF mode change| INACTIVE | | + *+--------------------+---------------+--------------------+------------------+ + * + * mode = AF_MODE_OFF or AF_MODE_EDOF + *| state | trans. cause | new state | notes | + *+--------------------+---------------+--------------------+------------------+ + *| INACTIVE | | INACTIVE | Never changes | + *+--------------------+---------------+--------------------+------------------+ + * + * mode = AF_MODE_AUTO or AF_MODE_MACRO + *| state | trans. cause | new state | notes | + *+--------------------+---------------+--------------------+------------------+ + *| INACTIVE | AF_TRIGGER | ACTIVE_SCAN | Start AF sweep | + *| | | | Lens now moving | + *+--------------------+---------------+--------------------+------------------+ + *| ACTIVE_SCAN | AF sweep done | FOCUSED_LOCKED | If AF successful | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| ACTIVE_SCAN | AF sweep done | NOT_FOCUSED_LOCKED | If AF successful | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| ACTIVE_SCAN | AF_CANCEL | INACTIVE | Cancel/reset AF | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Cancel/reset AF | + *+--------------------+---------------+--------------------+------------------+ + *| FOCUSED_LOCKED | AF_TRIGGER | ACTIVE_SCAN | Start new sweep | + *| | | | Lens now moving | + *+--------------------+---------------+--------------------+------------------+ + *| NOT_FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Cancel/reset AF | + *+--------------------+---------------+--------------------+------------------+ + *| NOT_FOCUSED_LOCKED | AF_TRIGGER | ACTIVE_SCAN | Start new sweep | + *| | | | Lens now moving | + *+--------------------+---------------+--------------------+------------------+ + *| All states | mode change | INACTIVE | | + *+--------------------+---------------+--------------------+------------------+ + * + * mode = AF_MODE_CONTINUOUS_VIDEO + *| state | trans. cause | new state | notes | + *+--------------------+---------------+--------------------+------------------+ + *| INACTIVE | HAL initiates | PASSIVE_SCAN | Start AF scan | + *| | new scan | | Lens now moving | + *+--------------------+---------------+--------------------+------------------+ + *| INACTIVE | AF_TRIGGER | NOT_FOCUSED_LOCKED | AF state query | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_SCAN | HAL completes | PASSIVE_FOCUSED | End AF scan | + *| | current scan | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_SCAN | HAL fails | PASSIVE_UNFOCUSED | End AF scan | + *| | current scan | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_SCAN | AF_TRIGGER | FOCUSED_LOCKED | Immediate trans. | + *| | | | if focus is good | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_SCAN | AF_TRIGGER | NOT_FOCUSED_LOCKED | Immediate trans. | + *| | | | if focus is bad | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_SCAN | AF_CANCEL | INACTIVE | Reset lens | + *| | | | position | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_FOCUSED | HAL initiates | PASSIVE_SCAN | Start AF scan | + *| | new scan | | Lens now moving | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_UNFOCUSED | HAL initiates | PASSIVE_SCAN | Start AF scan | + *| | new scan | | Lens now moving | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_FOCUSED | AF_TRIGGER | FOCUSED_LOCKED | Immediate trans. | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_UNFOCUSED | AF_TRIGGER | NOT_FOCUSED_LOCKED | Immediate trans. | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| FOCUSED_LOCKED | AF_TRIGGER | FOCUSED_LOCKED | No effect | + *+--------------------+---------------+--------------------+------------------+ + *| FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan | + *+--------------------+---------------+--------------------+------------------+ + *| NOT_FOCUSED_LOCKED | AF_TRIGGER | NOT_FOCUSED_LOCKED | No effect | + *+--------------------+---------------+--------------------+------------------+ + *| NOT_FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan | + *+--------------------+---------------+--------------------+------------------+ + * + * mode = AF_MODE_CONTINUOUS_PICTURE + *| state | trans. cause | new state | notes | + *+--------------------+---------------+--------------------+------------------+ + *| INACTIVE | HAL initiates | PASSIVE_SCAN | Start AF scan | + *| | new scan | | Lens now moving | + *+--------------------+---------------+--------------------+------------------+ + *| INACTIVE | AF_TRIGGER | NOT_FOCUSED_LOCKED | AF state query | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_SCAN | HAL completes | PASSIVE_FOCUSED | End AF scan | + *| | current scan | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_SCAN | HAL fails | PASSIVE_UNFOCUSED | End AF scan | + *| | current scan | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_SCAN | AF_TRIGGER | FOCUSED_LOCKED | Eventual trans. | + *| | | | once focus good | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_SCAN | AF_TRIGGER | NOT_FOCUSED_LOCKED | Eventual trans. | + *| | | | if cannot focus | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_SCAN | AF_CANCEL | INACTIVE | Reset lens | + *| | | | position | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_FOCUSED | HAL initiates | PASSIVE_SCAN | Start AF scan | + *| | new scan | | Lens now moving | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_UNFOCUSED | HAL initiates | PASSIVE_SCAN | Start AF scan | + *| | new scan | | Lens now moving | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_FOCUSED | AF_TRIGGER | FOCUSED_LOCKED | Immediate trans. | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| PASSIVE_UNFOCUSED | AF_TRIGGER | NOT_FOCUSED_LOCKED | Immediate trans. | + *| | | | Lens now locked | + *+--------------------+---------------+--------------------+------------------+ + *| FOCUSED_LOCKED | AF_TRIGGER | FOCUSED_LOCKED | No effect | + *+--------------------+---------------+--------------------+------------------+ + *| FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan | + *+--------------------+---------------+--------------------+------------------+ + *| NOT_FOCUSED_LOCKED | AF_TRIGGER | NOT_FOCUSED_LOCKED | No effect | + *+--------------------+---------------+--------------------+------------------+ + *| NOT_FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan | + *+--------------------+---------------+--------------------+------------------+ + * + * S4.6. AE and AWB state machines + * + * The AE and AWB state machines are mostly identical. AE has additional + * FLASH_REQUIRED and PRECAPTURE states. So rows below that refer to those two + * states should be ignored for the AWB state machine. + * + * when enabling AE/AWB or changing AE/AWB mode + *| state | trans. cause | new state | notes | + *+--------------------+---------------+--------------------+------------------+ + *| Any | mode change | INACTIVE | | + *+--------------------+---------------+--------------------+------------------+ + * + * mode = AE_MODE_OFF / AWB mode not AUTO + *| state | trans. cause | new state | notes | + *+--------------------+---------------+--------------------+------------------+ + *| INACTIVE | | INACTIVE | AE/AWB disabled | + *+--------------------+---------------+--------------------+------------------+ + * + * mode = AE_MODE_ON_* / AWB_MODE_AUTO + *| state | trans. cause | new state | notes | + *+--------------------+---------------+--------------------+------------------+ + *| INACTIVE | HAL initiates | SEARCHING | | + *| | AE/AWB scan | | | + *+--------------------+---------------+--------------------+------------------+ + *| INACTIVE | AE/AWB_LOCK | LOCKED | values locked | + *| | on | | | + *+--------------------+---------------+--------------------+------------------+ + *| SEARCHING | HAL finishes | CONVERGED | good values, not | + *| | AE/AWB scan | | changing | + *+--------------------+---------------+--------------------+------------------+ + *| SEARCHING | HAL finishes | FLASH_REQUIRED | converged but too| + *| | AE scan | | dark w/o flash | + *+--------------------+---------------+--------------------+------------------+ + *| SEARCHING | AE/AWB_LOCK | LOCKED | values locked | + *| | on | | | + *+--------------------+---------------+--------------------+------------------+ + *| CONVERGED | HAL initiates | SEARCHING | values locked | + *| | AE/AWB scan | | | + *+--------------------+---------------+--------------------+------------------+ + *| CONVERGED | AE/AWB_LOCK | LOCKED | values locked | + *| | on | | | + *+--------------------+---------------+--------------------+------------------+ + *| FLASH_REQUIRED | HAL initiates | SEARCHING | values locked | + *| | AE/AWB scan | | | + *+--------------------+---------------+--------------------+------------------+ + *| FLASH_REQUIRED | AE/AWB_LOCK | LOCKED | values locked | + *| | on | | | + *+--------------------+---------------+--------------------+------------------+ + *| LOCKED | AE/AWB_LOCK | SEARCHING | values not good | + *| | off | | after unlock | + *+--------------------+---------------+--------------------+------------------+ + *| LOCKED | AE/AWB_LOCK | CONVERGED | values good | + *| | off | | after unlock | + *+--------------------+---------------+--------------------+------------------+ + *| LOCKED | AE_LOCK | FLASH_REQUIRED | exposure good, | + *| | off | | but too dark | + *+--------------------+---------------+--------------------+------------------+ + *| All AE states | PRECAPTURE_ | PRECAPTURE | Start precapture | + *| | START | | sequence | + *+--------------------+---------------+--------------------+------------------+ + *| PRECAPTURE | Sequence done.| CONVERGED | Ready for high- | + *| | AE_LOCK off | | quality capture | + *+--------------------+---------------+--------------------+------------------+ + *| PRECAPTURE | Sequence done.| LOCKED | Ready for high- | + *| | AE_LOCK on | | quality capture | + *+--------------------+---------------+--------------------+------------------+ + * + */ + +/** + * S5. Cropping: + * + * Cropping of the full pixel array (for digital zoom and other use cases where + * a smaller FOV is desirable) is communicated through the + * ANDROID_SCALER_CROP_REGION setting. This is a per-request setting, and can + * change on a per-request basis, which is critical for implementing smooth + * digital zoom. + * + * The region is defined as a rectangle (x, y, width, height), with (x, y) + * describing the top-left corner of the rectangle. The rectangle is defined on + * the coordinate system of the sensor active pixel array, with (0,0) being the + * top-left pixel of the active pixel array. Therefore, the width and height + * cannot be larger than the dimensions reported in the + * ANDROID_SENSOR_ACTIVE_PIXEL_ARRAY static info field. The minimum allowed + * width and height are reported by the HAL through the + * ANDROID_SCALER_MAX_DIGITAL_ZOOM static info field, which describes the + * maximum supported zoom factor. Therefore, the minimum crop region width and + * height are: + * + * {width, height} = + * { floor(ANDROID_SENSOR_ACTIVE_PIXEL_ARRAY[0] / + * ANDROID_SCALER_MAX_DIGITAL_ZOOM), + * floor(ANDROID_SENSOR_ACTIVE_PIXEL_ARRAY[1] / + * ANDROID_SCALER_MAX_DIGITAL_ZOOM) } + * + * If the crop region needs to fulfill specific requirements (for example, it + * needs to start on even coordinates, and its width/height needs to be even), + * the HAL must do the necessary rounding and write out the final crop region + * used in the output result metadata. Similarly, if the HAL implements video + * stabilization, it must adjust the result crop region to describe the region + * actually included in the output after video stabilization is applied. In + * general, a camera-using application must be able to determine the field of + * view it is receiving based on the crop region, the dimensions of the image + * sensor, and the lens focal length. + * + * It is assumed that the cropping is applied after raw to other color space + * conversion. Raw streams (RAW16 and RAW_OPAQUE) don't have this conversion stage, + * and are not croppable. Therefore, the crop region must be ignored by the HAL + * for raw streams. + * + * Since the crop region applies to all non-raw streams, which may have different aspect + * ratios than the crop region, the exact sensor region used for each stream may + * be smaller than the crop region. Specifically, each stream should maintain + * square pixels and its aspect ratio by minimally further cropping the defined + * crop region. If the stream's aspect ratio is wider than the crop region, the + * stream should be further cropped vertically, and if the stream's aspect ratio + * is narrower than the crop region, the stream should be further cropped + * horizontally. + * + * In all cases, the stream crop must be centered within the full crop region, + * and each stream is only either cropped horizontally or vertical relative to + * the full crop region, never both. + * + * For example, if two streams are defined, a 640x480 stream (4:3 aspect), and a + * 1280x720 stream (16:9 aspect), below demonstrates the expected output regions + * for each stream for a few sample crop regions, on a hypothetical 3 MP (2000 x + * 1500 pixel array) sensor. + * + * Crop region: (500, 375, 1000, 750) (4:3 aspect ratio) + * + * 640x480 stream crop: (500, 375, 1000, 750) (equal to crop region) + * 1280x720 stream crop: (500, 469, 1000, 562) (marked with =) + * + * 0 1000 2000 + * +---------+---------+---------+----------+ + * | Active pixel array | + * | | + * | | + * + +-------------------+ + 375 + * | | | | + * | O===================O | + * | I 1280x720 stream I | + * + I I + 750 + * | I I | + * | O===================O | + * | | | | + * + +-------------------+ + 1125 + * | Crop region, 640x480 stream | + * | | + * | | + * +---------+---------+---------+----------+ 1500 + * + * Crop region: (500, 375, 1333, 750) (16:9 aspect ratio) + * + * 640x480 stream crop: (666, 375, 1000, 750) (marked with =) + * 1280x720 stream crop: (500, 375, 1333, 750) (equal to crop region) + * + * 0 1000 2000 + * +---------+---------+---------+----------+ + * | Active pixel array | + * | | + * | | + * + +---O==================O---+ + 375 + * | | I 640x480 stream I | | + * | | I I | | + * | | I I | | + * + | I I | + 750 + * | | I I | | + * | | I I | | + * | | I I | | + * + +---O==================O---+ + 1125 + * | Crop region, 1280x720 stream | + * | | + * | | + * +---------+---------+---------+----------+ 1500 + * + * Crop region: (500, 375, 750, 750) (1:1 aspect ratio) + * + * 640x480 stream crop: (500, 469, 750, 562) (marked with =) + * 1280x720 stream crop: (500, 543, 750, 414) (marged with #) + * + * 0 1000 2000 + * +---------+---------+---------+----------+ + * | Active pixel array | + * | | + * | | + * + +--------------+ + 375 + * | O==============O | + * | ################ | + * | # # | + * + # # + 750 + * | # # | + * | ################ 1280x720 | + * | O==============O 640x480 | + * + +--------------+ + 1125 + * | Crop region | + * | | + * | | + * +---------+---------+---------+----------+ 1500 + * + * And a final example, a 1024x1024 square aspect ratio stream instead of the + * 480p stream: + * + * Crop region: (500, 375, 1000, 750) (4:3 aspect ratio) + * + * 1024x1024 stream crop: (625, 375, 750, 750) (marked with #) + * 1280x720 stream crop: (500, 469, 1000, 562) (marked with =) + * + * 0 1000 2000 + * +---------+---------+---------+----------+ + * | Active pixel array | + * | | + * | 1024x1024 stream | + * + +--###############--+ + 375 + * | | # # | | + * | O===================O | + * | I 1280x720 stream I | + * + I I + 750 + * | I I | + * | O===================O | + * | | # # | | + * + +--###############--+ + 1125 + * | Crop region | + * | | + * | | + * +---------+---------+---------+----------+ 1500 + * + */ + +/** + * S6. Error management: + * + * Camera HAL device ops functions that have a return value will all return + * -ENODEV / NULL in case of a serious error. This means the device cannot + * continue operation, and must be closed by the framework. Once this error is + * returned by some method, or if notify() is called with ERROR_DEVICE, only + * the close() method can be called successfully. All other methods will return + * -ENODEV / NULL. + * + * If a device op is called in the wrong sequence, for example if the framework + * calls configure_streams() is called before initialize(), the device must + * return -ENOSYS from the call, and do nothing. + * + * Transient errors in image capture must be reported through notify() as follows: + * + * - The failure of an entire capture to occur must be reported by the HAL by + * calling notify() with ERROR_REQUEST. Individual errors for the result + * metadata or the output buffers must not be reported in this case. + * + * - If the metadata for a capture cannot be produced, but some image buffers + * were filled, the HAL must call notify() with ERROR_RESULT. + * + * - If an output image buffer could not be filled, but either the metadata was + * produced or some other buffers were filled, the HAL must call notify() with + * ERROR_BUFFER for each failed buffer. + * + * In each of these transient failure cases, the HAL must still call + * process_capture_result, with valid output and input (if an input buffer was + * submitted) buffer_handle_t. If the result metadata could not be produced, it + * should be NULL. If some buffers could not be filled, they must be returned with + * process_capture_result in the error state, their release fences must be set to + * the acquire fences passed by the framework, or -1 if they have been waited on by + * the HAL already. + * + * Invalid input arguments result in -EINVAL from the appropriate methods. In + * that case, the framework must act as if that call had never been made. + * + */ + +/** + * S7. Key Performance Indicator (KPI) glossary: + * + * This includes some critical definitions that are used by KPI metrics. + * + * Pipeline Latency: + * For a given capture request, the duration from the framework calling + * process_capture_request to the HAL sending capture result and all buffers + * back by process_capture_result call. To make the Pipeline Latency measure + * independent of frame rate, it is measured by frame count. + * + * For example, when frame rate is 30 (fps), the frame duration (time interval + * between adjacent frame capture time) is 33 (ms). + * If it takes 5 frames for framework to get the result and buffers back for + * a given request, then the Pipeline Latency is 5 (frames), instead of + * 5 x 33 = 165 (ms). + * + * The Pipeline Latency is determined by android.request.pipelineDepth and + * android.request.pipelineMaxDepth, see their definitions for more details. + * + */ + +/** + * S8. Sample Use Cases: + * + * This includes some typical use case examples the camera HAL may support. + * + * S8.1 Zero Shutter Lag (ZSL) with CAMERA3_STREAM_BIDIRECTIONAL stream. + * + * For this use case, the bidirectional stream will be used by the framework as follows: + * + * 1. The framework includes a buffer from this stream as output buffer in a + * request as normal. + * + * 2. Once the HAL device returns a filled output buffer to the framework, + * the framework may do one of two things with the filled buffer: + * + * 2. a. The framework uses the filled data, and returns the now-used buffer + * to the stream queue for reuse. This behavior exactly matches the + * OUTPUT type of stream. + * + * 2. b. The framework wants to reprocess the filled data, and uses the + * buffer as an input buffer for a request. Once the HAL device has + * used the reprocessing buffer, it then returns it to the + * framework. The framework then returns the now-used buffer to the + * stream queue for reuse. + * + * 3. The HAL device will be given the buffer again as an output buffer for + * a request at some future point. + * + * For ZSL use case, the pixel format for bidirectional stream will be + * HAL_PIXEL_FORMAT_RAW_OPAQUE or HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED if it + * is listed in android.scaler.availableInputOutputFormatsMap. When + * HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, the gralloc + * usage flags for the consumer endpoint will be set to GRALLOC_USAGE_HW_CAMERA_ZSL. + * A configuration stream list that has BIDIRECTIONAL stream used as input, will + * usually also have a distinct OUTPUT stream to get the reprocessing data. For example, + * for the ZSL use case, the stream list might be configured with the following: + * + * - A HAL_PIXEL_FORMAT_RAW_OPAQUE bidirectional stream is used + * as input. + * - And a HAL_PIXEL_FORMAT_BLOB (JPEG) output stream. + * + * S8.2 ZSL (OPAQUE) reprocessing with CAMERA3_STREAM_INPUT stream. + * + * CAMERA_DEVICE_API_VERSION_3_3: + * When OPAQUE_REPROCESSING capability is supported by the camera device, the INPUT stream + * can be used for application/framework implemented use case like Zero Shutter Lag (ZSL). + * This kind of stream will be used by the framework as follows: + * + * 1. Application/framework configures an opaque (RAW or YUV based) format output stream that is + * used to produce the ZSL output buffers. The stream pixel format will be + * HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED. + * + * 2. Application/framework configures an opaque format input stream that is used to + * send the reprocessing ZSL buffers to the HAL. The stream pixel format will + * also be HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED. + * + * 3. Application/framework configures a YUV/JPEG output stream that is used to receive the + * reprocessed data. The stream pixel format will be YCbCr_420/HAL_PIXEL_FORMAT_BLOB. + * + * 4. Application/framework picks a ZSL buffer from the ZSL output stream when a ZSL capture is + * issued by the application, and sends the data back as an input buffer in a + * reprocessing request, then sends to the HAL for reprocessing. + * + * 5. The HAL sends back the output YUV/JPEG result to framework. + * + * The HAL can select the actual opaque buffer format and configure the ISP pipeline + * appropriately based on the HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED format and + * the gralloc usage flag GRALLOC_USAGE_HW_CAMERA_ZSL. + + * S8.3 YUV reprocessing with CAMERA3_STREAM_INPUT stream. + * + * When YUV reprocessing is supported by the HAL, the INPUT stream + * can be used for the YUV reprocessing use cases like lucky-shot and image fusion. + * This kind of stream will be used by the framework as follows: + * + * 1. Application/framework configures an YCbCr_420 format output stream that is + * used to produce the output buffers. + * + * 2. Application/framework configures an YCbCr_420 format input stream that is used to + * send the reprocessing YUV buffers to the HAL. + * + * 3. Application/framework configures a YUV/JPEG output stream that is used to receive the + * reprocessed data. The stream pixel format will be YCbCr_420/HAL_PIXEL_FORMAT_BLOB. + * + * 4. Application/framework processes the output buffers (could be as simple as picking + * an output buffer directly) from the output stream when a capture is issued, and sends + * the data back as an input buffer in a reprocessing request, then sends to the HAL + * for reprocessing. + * + * 5. The HAL sends back the output YUV/JPEG result to framework. + * + */ + +/** + * S9. Notes on Controls and Metadata + * + * This section contains notes about the interpretation and usage of various metadata tags. + * + * S9.1 HIGH_QUALITY and FAST modes. + * + * Many camera post-processing blocks may be listed as having HIGH_QUALITY, + * FAST, and OFF operating modes. These blocks will typically also have an + * 'available modes' tag representing which of these operating modes are + * available on a given device. The general policy regarding implementing + * these modes is as follows: + * + * 1. Operating mode controls of hardware blocks that cannot be disabled + * must not list OFF in their corresponding 'available modes' tags. + * + * 2. OFF will always be included in their corresponding 'available modes' + * tag if it is possible to disable that hardware block. + * + * 3. FAST must always be included in the 'available modes' tags for all + * post-processing blocks supported on the device. If a post-processing + * block also has a slower and higher quality operating mode that does + * not meet the framerate requirements for FAST mode, HIGH_QUALITY should + * be included in the 'available modes' tag to represent this operating + * mode. + */ + +/** + * S10. Reprocessing flow and controls + * + * This section describes the OPAQUE and YUV reprocessing flow and controls. OPAQUE reprocessing + * uses an opaque format that is not directly application-visible, and the application can + * only select some of the output buffers and send back to HAL for reprocessing, while YUV + * reprocessing gives the application opportunity to process the buffers before reprocessing. + * + * S8 gives the stream configurations for the typical reprocessing uses cases, + * this section specifies the buffer flow and controls in more details. + * + * S10.1 OPAQUE (typically for ZSL use case) reprocessing flow and controls + * + * For OPAQUE reprocessing (e.g. ZSL) use case, after the application creates the specific + * output and input streams, runtime buffer flow and controls are specified as below: + * + * 1. Application starts output streaming by sending repeating requests for output + * opaque buffers and preview. The buffers are held by an application + * maintained circular buffer. The requests are based on CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG + * capture template, which should have all necessary settings that guarantee output + * frame rate is not slowed down relative to sensor output frame rate. + * + * 2. When a capture is issued, the application selects one output buffer based + * on application buffer selection logic, e.g. good AE and AF statistics etc. + * Application then creates an reprocess request based on the capture result associated + * with this selected buffer. The selected output buffer is now added to this reprocess + * request as an input buffer, the output buffer of this reprocess request should be + * either JPEG output buffer or YUV output buffer, or both, depending on the application + * choice. + * + * 3. Application then alters the reprocess settings to get best image quality. The HAL must + * support and only support below controls if the HAL support OPAQUE_REPROCESSING capability: + * - android.jpeg.* (if JPEG buffer is included as one of the output) + * - android.noiseReduction.mode (change to HIGH_QUALITY if it is supported) + * - android.edge.mode (change to HIGH_QUALITY if it is supported) + * All other controls must be ignored by the HAL. + * 4. HAL processed the input buffer and return the output buffers in the capture results + * as normal. + * + * S10.2 YUV reprocessing flow and controls + * + * The YUV reprocessing buffer flow is similar as OPAQUE reprocessing, with below difference: + * + * 1. Application may want to have finer granularity control of the intermediate YUV images + * (before reprocessing). For example, application may choose + * - android.noiseReduction.mode == MINIMAL + * to make sure the no YUV domain noise reduction has applied to the output YUV buffers, + * then it can do its own advanced noise reduction on them. For OPAQUE reprocessing case, this + * doesn't matter, as long as the final reprocessed image has the best quality. + * 2. Application may modify the YUV output buffer data. For example, for image fusion use + * case, where multiple output images are merged together to improve the signal-to-noise + * ratio (SNR). The input buffer may be generated from multiple buffers by the application. + * To avoid excessive amount of noise reduction and insufficient amount of edge enhancement + * being applied to the input buffer, the application can hint the HAL how much effective + * exposure time improvement has been done by the application, then the HAL can adjust the + * noise reduction and edge enhancement paramters to get best reprocessed image quality. + * Below tag can be used for this purpose: + * - android.reprocess.effectiveExposureFactor + * The value would be exposure time increase factor applied to the original output image, + * for example, if there are N image merged, the exposure time increase factor would be up + * to sqrt(N). See this tag spec for more details. + * + * S10.3 Reprocessing pipeline characteristics + * + * Reprocessing pipeline has below different characteristics comparing with normal output + * pipeline: + * + * 1. The reprocessing result can be returned ahead of the pending normal output results. But + * the FIFO ordering must be maintained for all reprocessing results. For example, there are + * below requests (A stands for output requests, B stands for reprocessing requests) + * being processed by the HAL: + * A1, A2, A3, A4, B1, A5, B2, A6... + * result of B1 can be returned before A1-A4, but result of B2 must be returned after B1. + * 2. Single input rule: For a given reprocessing request, all output buffers must be from the + * input buffer, rather than sensor output. For example, if a reprocess request include both + * JPEG and preview buffers, all output buffers must be produced from the input buffer + * included by the reprocessing request, rather than sensor. The HAL must not output preview + * buffers from sensor, while output JPEG buffer from the input buffer. + * 3. Input buffer will be from camera output directly (ZSL case) or indirectly(image fusion + * case). For the case where buffer is modified, the size will remain same. The HAL can + * notify CAMERA3_MSG_ERROR_REQUEST if buffer from unknown source is sent. + * 4. Result as reprocessing request: The HAL can expect that a reprocessing request is a copy + * of one of the output results with minor allowed setting changes. The HAL can notify + * CAMERA3_MSG_ERROR_REQUEST if a request from unknown source is issued. + * 5. Output buffers may not be used as inputs across the configure stream boundary, This is + * because an opaque stream like the ZSL output stream may have different actual image size + * inside of the ZSL buffer to save power and bandwidth for smaller resolution JPEG capture. + * The HAL may notify CAMERA3_MSG_ERROR_REQUEST if this case occurs. + * 6. HAL Reprocess requests error reporting during flush should follow the same rule specified + * by flush() method. + * + */ + +__BEGIN_DECLS + +struct camera3_device; + +/********************************************************************** + * + * Camera3 stream and stream buffer definitions. + * + * These structs and enums define the handles and contents of the input and + * output streams connecting the HAL to various framework and application buffer + * consumers. Each stream is backed by a gralloc buffer queue. + * + */ + +/** + * camera3_stream_type_t: + * + * The type of the camera stream, which defines whether the camera HAL device is + * the producer or the consumer for that stream, and how the buffers of the + * stream relate to the other streams. + */ +typedef enum camera3_stream_type { + /** + * This stream is an output stream; the camera HAL device will be + * responsible for filling buffers from this stream with newly captured or + * reprocessed image data. + */ + CAMERA3_STREAM_OUTPUT = 0, + + /** + * This stream is an input stream; the camera HAL device will be responsible + * for reading buffers from this stream and sending them through the camera + * processing pipeline, as if the buffer was a newly captured image from the + * imager. + * + * The pixel format for input stream can be any format reported by + * android.scaler.availableInputOutputFormatsMap. The pixel format of the + * output stream that is used to produce the reprocessing data may be any + * format reported by android.scaler.availableStreamConfigurations. The + * supported input/output stream combinations depends the camera device + * capabilities, see android.scaler.availableInputOutputFormatsMap for + * stream map details. + * + * This kind of stream is generally used to reprocess data into higher + * quality images (that otherwise would cause a frame rate performance + * loss), or to do off-line reprocessing. + * + * CAMERA_DEVICE_API_VERSION_3_3: + * The typical use cases are OPAQUE (typically ZSL) and YUV reprocessing, + * see S8.2, S8.3 and S10 for more details. + */ + CAMERA3_STREAM_INPUT = 1, + + /** + * This stream can be used for input and output. Typically, the stream is + * used as an output stream, but occasionally one already-filled buffer may + * be sent back to the HAL device for reprocessing. + * + * This kind of stream is meant generally for Zero Shutter Lag (ZSL) + * features, where copying the captured image from the output buffer to the + * reprocessing input buffer would be expensive. See S8.1 for more details. + * + * Note that the HAL will always be reprocessing data it produced. + * + */ + CAMERA3_STREAM_BIDIRECTIONAL = 2, + + /** + * Total number of framework-defined stream types + */ + CAMERA3_NUM_STREAM_TYPES + +} camera3_stream_type_t; + +/** + * camera3_stream_rotation_t: + * + * The required counterclockwise rotation of camera stream. + */ +typedef enum camera3_stream_rotation { + /* No rotation */ + CAMERA3_STREAM_ROTATION_0 = 0, + + /* Rotate by 90 degree counterclockwise */ + CAMERA3_STREAM_ROTATION_90 = 1, + + /* Rotate by 180 degree counterclockwise */ + CAMERA3_STREAM_ROTATION_180 = 2, + + /* Rotate by 270 degree counterclockwise */ + CAMERA3_STREAM_ROTATION_270 = 3 +} camera3_stream_rotation_t; + +/** + * camera3_stream_configuration_mode_t: + * + * This defines the general operation mode for the HAL (for a given stream configuration), where + * modes besides NORMAL have different semantics, and usually limit the generality of the API in + * exchange for higher performance in some particular area. + */ +typedef enum camera3_stream_configuration_mode { + /** + * Normal stream configuration operation mode. This is the default camera operation mode, + * where all semantics of HAL APIs and metadata controls apply. + */ + CAMERA3_STREAM_CONFIGURATION_NORMAL_MODE = 0, + + /** + * Special constrained high speed operation mode for devices that can not support high + * speed output in NORMAL mode. All streams in this configuration are operating at high speed + * mode and have different characteristics and limitations to achieve high speed output. + * The NORMAL mode can still be used for high speed output if the HAL can support high speed + * output while satisfying all the semantics of HAL APIs and metadata controls. It is + * recommended for the HAL to support high speed output in NORMAL mode (by advertising the high + * speed FPS ranges in android.control.aeAvailableTargetFpsRanges) if possible. + * + * This mode has below limitations/requirements: + * + * 1. The HAL must support up to 2 streams with sizes reported by + * android.control.availableHighSpeedVideoConfigurations. + * 2. In this mode, the HAL is expected to output up to 120fps or higher. This mode must + * support the targeted FPS range and size configurations reported by + * android.control.availableHighSpeedVideoConfigurations. + * 3. The HAL must support HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED output stream format. + * 4. To achieve efficient high speed streaming, the HAL may have to aggregate + * multiple frames together and send to camera device for processing where the request + * controls are same for all the frames in this batch (batch mode). The HAL must support + * max batch size and the max batch size requirements defined by + * android.control.availableHighSpeedVideoConfigurations. + * 5. In this mode, the HAL must override aeMode, awbMode, and afMode to ON, ON, and + * CONTINUOUS_VIDEO, respectively. All post-processing block mode controls must be + * overridden to be FAST. Therefore, no manual control of capture and post-processing + * parameters is possible. All other controls operate the same as when + * android.control.mode == AUTO. This means that all other android.control.* fields + * must continue to work, such as + * + * android.control.aeTargetFpsRange + * android.control.aeExposureCompensation + * android.control.aeLock + * android.control.awbLock + * android.control.effectMode + * android.control.aeRegions + * android.control.afRegions + * android.control.awbRegions + * android.control.afTrigger + * android.control.aePrecaptureTrigger + * + * Outside of android.control.*, the following controls must work: + * + * android.flash.mode (TORCH mode only, automatic flash for still capture will not work + * since aeMode is ON) + * android.lens.opticalStabilizationMode (if it is supported) + * android.scaler.cropRegion + * android.statistics.faceDetectMode (if it is supported) + * + * For more details about high speed stream requirements, see + * android.control.availableHighSpeedVideoConfigurations and CONSTRAINED_HIGH_SPEED_VIDEO + * capability defined in android.request.availableCapabilities. + * + * This mode only needs to be supported by HALs that include CONSTRAINED_HIGH_SPEED_VIDEO in + * the android.request.availableCapabilities static metadata. + */ + CAMERA3_STREAM_CONFIGURATION_CONSTRAINED_HIGH_SPEED_MODE = 1, + + /** + * First value for vendor-defined stream configuration modes. + */ + CAMERA3_VENDOR_STREAM_CONFIGURATION_MODE_START = 0x8000 +} camera3_stream_configuration_mode_t; + +/** + * camera3_stream_t: + * + * A handle to a single camera input or output stream. A stream is defined by + * the framework by its buffer resolution and format, and additionally by the + * HAL with the gralloc usage flags and the maximum in-flight buffer count. + * + * The stream structures are owned by the framework, but pointers to a + * camera3_stream passed into the HAL by configure_streams() are valid until the + * end of the first subsequent configure_streams() call that _does not_ include + * that camera3_stream as an argument, or until the end of the close() call. + * + * All camera3_stream framework-controlled members are immutable once the + * camera3_stream is passed into configure_streams(). The HAL may only change + * the HAL-controlled parameters during a configure_streams() call, except for + * the contents of the private pointer. + * + * If a configure_streams() call returns a non-fatal error, all active streams + * remain valid as if configure_streams() had not been called. + * + * The endpoint of the stream is not visible to the camera HAL device. + * In DEVICE_API_VERSION_3_1, this was changed to share consumer usage flags + * on streams where the camera is a producer (OUTPUT and BIDIRECTIONAL stream + * types) see the usage field below. + */ +typedef struct camera3_stream { + + /***** + * Set by framework before configure_streams() + */ + + /** + * The type of the stream, one of the camera3_stream_type_t values. + */ + int stream_type; + + /** + * The width in pixels of the buffers in this stream + */ + uint32_t width; + + /** + * The height in pixels of the buffers in this stream + */ + uint32_t height; + + /** + * The pixel format for the buffers in this stream. Format is a value from + * the HAL_PIXEL_FORMAT_* list in system/core/include/system/graphics.h, or + * from device-specific headers. + * + * If HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform + * gralloc module will select a format based on the usage flags provided by + * the camera device and the other endpoint of the stream. + * + * <= CAMERA_DEVICE_API_VERSION_3_1: + * + * The camera HAL device must inspect the buffers handed to it in the + * subsequent register_stream_buffers() call to obtain the + * implementation-specific format details, if necessary. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * register_stream_buffers() won't be called by the framework, so the HAL + * should configure the ISP and sensor pipeline based purely on the sizes, + * usage flags, and formats for the configured streams. + */ + int format; + + /***** + * Set by HAL during configure_streams(). + */ + + /** + * The gralloc usage flags for this stream, as needed by the HAL. The usage + * flags are defined in gralloc.h (GRALLOC_USAGE_*), or in device-specific + * headers. + * + * For output streams, these are the HAL's producer usage flags. For input + * streams, these are the HAL's consumer usage flags. The usage flags from + * the producer and the consumer will be combined together and then passed + * to the platform gralloc HAL module for allocating the gralloc buffers for + * each stream. + * + * Version information: + * + * == CAMERA_DEVICE_API_VERSION_3_0: + * + * No initial value guaranteed when passed via configure_streams(). + * HAL may not use this field as input, and must write over this field + * with its usage flags. + * + * >= CAMERA_DEVICE_API_VERSION_3_1: + * + * For stream_type OUTPUT and BIDIRECTIONAL, when passed via + * configure_streams(), the initial value of this is the consumer's + * usage flags. The HAL may use these consumer flags to decide stream + * configuration. + * For stream_type INPUT, when passed via configure_streams(), the initial + * value of this is 0. + * For all streams passed via configure_streams(), the HAL must write + * over this field with its usage flags. + */ + uint32_t usage; + + /** + * The maximum number of buffers the HAL device may need to have dequeued at + * the same time. The HAL device may not have more buffers in-flight from + * this stream than this value. + */ + uint32_t max_buffers; + + /** + * A handle to HAL-private information for the stream. Will not be inspected + * by the framework code. + */ + void *priv; + + /** + * A field that describes the contents of the buffer. The format and buffer + * dimensions define the memory layout and structure of the stream buffers, + * while dataSpace defines the meaning of the data within the buffer. + * + * For most formats, dataSpace defines the color space of the image data. + * In addition, for some formats, dataSpace indicates whether image- or + * depth-based data is requested. See system/core/include/system/graphics.h + * for details of formats and valid dataSpace values for each format. + * + * Version information: + * + * < CAMERA_DEVICE_API_VERSION_3_3: + * + * Not defined and should not be accessed. dataSpace should be assumed to + * be HAL_DATASPACE_UNKNOWN, and the appropriate color space, etc, should + * be determined from the usage flags and the format. + * + * >= CAMERA_DEVICE_API_VERSION_3_3: + * + * Always set by the camera service. HAL must use this dataSpace to + * configure the stream to the correct colorspace, or to select between + * color and depth outputs if supported. + */ + android_dataspace_t data_space; + + /** + * The required output rotation of the stream, one of + * the camera3_stream_rotation_t values. This must be inspected by HAL along + * with stream width and height. For example, if the rotation is 90 degree + * and the stream width and height is 720 and 1280 respectively, camera service + * will supply buffers of size 720x1280, and HAL should capture a 1280x720 image + * and rotate the image by 90 degree counterclockwise. The rotation field is + * no-op when the stream type is input. Camera HAL must ignore the rotation + * field for an input stream. + * + * <= CAMERA_DEVICE_API_VERSION_3_2: + * + * Not defined and must not be accessed. HAL must not apply any rotation + * on output images. + * + * >= CAMERA_DEVICE_API_VERSION_3_3: + * + * Always set by camera service. HAL must inspect this field during stream + * configuration and returns -EINVAL if HAL cannot perform such rotation. + * HAL must always support CAMERA3_STREAM_ROTATION_0, so a + * configure_streams() call must not fail for unsupported rotation if + * rotation field of all streams is CAMERA3_STREAM_ROTATION_0. + * + */ + int rotation; + + /* reserved for future use */ + void *reserved[7]; + +} camera3_stream_t; + +/** + * camera3_stream_configuration_t: + * + * A structure of stream definitions, used by configure_streams(). This + * structure defines all the output streams and the reprocessing input + * stream for the current camera use case. + */ +typedef struct camera3_stream_configuration { + /** + * The total number of streams requested by the framework. This includes + * both input and output streams. The number of streams will be at least 1, + * and there will be at least one output-capable stream. + */ + uint32_t num_streams; + + /** + * An array of camera stream pointers, defining the input/output + * configuration for the camera HAL device. + * + * At most one input-capable stream may be defined (INPUT or BIDIRECTIONAL) + * in a single configuration. + * + * At least one output-capable stream must be defined (OUTPUT or + * BIDIRECTIONAL). + */ + camera3_stream_t **streams; + + /** + * >= CAMERA_DEVICE_API_VERSION_3_3: + * + * The operation mode of streams in this configuration, one of the value defined in + * camera3_stream_configuration_mode_t. + * The HAL can use this mode as an indicator to set the stream property (e.g., + * camera3_stream->max_buffers) appropriately. For example, if the configuration is + * CAMERA3_STREAM_CONFIGURATION_CONSTRAINED_HIGH_SPEED_MODE, the HAL may want to set aside more + * buffers for batch mode operation (see android.control.availableHighSpeedVideoConfigurations + * for batch mode definition). + * + */ + uint32_t operation_mode; +} camera3_stream_configuration_t; + +/** + * camera3_buffer_status_t: + * + * The current status of a single stream buffer. + */ +typedef enum camera3_buffer_status { + /** + * The buffer is in a normal state, and can be used after waiting on its + * sync fence. + */ + CAMERA3_BUFFER_STATUS_OK = 0, + + /** + * The buffer does not contain valid data, and the data in it should not be + * used. The sync fence must still be waited on before reusing the buffer. + */ + CAMERA3_BUFFER_STATUS_ERROR = 1 + +} camera3_buffer_status_t; + +/** + * camera3_stream_buffer_t: + * + * A single buffer from a camera3 stream. It includes a handle to its parent + * stream, the handle to the gralloc buffer itself, and sync fences + * + * The buffer does not specify whether it is to be used for input or output; + * that is determined by its parent stream type and how the buffer is passed to + * the HAL device. + */ +typedef struct camera3_stream_buffer { + /** + * The handle of the stream this buffer is associated with + */ + camera3_stream_t *stream; + + /** + * The native handle to the buffer + */ + buffer_handle_t *buffer; + + /** + * Current state of the buffer, one of the camera3_buffer_status_t + * values. The framework will not pass buffers to the HAL that are in an + * error state. In case a buffer could not be filled by the HAL, it must + * have its status set to CAMERA3_BUFFER_STATUS_ERROR when returned to the + * framework with process_capture_result(). + */ + int status; + + /** + * The acquire sync fence for this buffer. The HAL must wait on this fence + * fd before attempting to read from or write to this buffer. + * + * The framework may be set to -1 to indicate that no waiting is necessary + * for this buffer. + * + * When the HAL returns an output buffer to the framework with + * process_capture_result(), the acquire_fence must be set to -1. If the HAL + * never waits on the acquire_fence due to an error in filling a buffer, + * when calling process_capture_result() the HAL must set the release_fence + * of the buffer to be the acquire_fence passed to it by the framework. This + * will allow the framework to wait on the fence before reusing the buffer. + * + * For input buffers, the HAL must not change the acquire_fence field during + * the process_capture_request() call. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * When the HAL returns an input buffer to the framework with + * process_capture_result(), the acquire_fence must be set to -1. If the HAL + * never waits on input buffer acquire fence due to an error, the sync + * fences should be handled similarly to the way they are handled for output + * buffers. + */ + int acquire_fence; + + /** + * The release sync fence for this buffer. The HAL must set this fence when + * returning buffers to the framework, or write -1 to indicate that no + * waiting is required for this buffer. + * + * For the output buffers, the fences must be set in the output_buffers + * array passed to process_capture_result(). + * + * <= CAMERA_DEVICE_API_VERSION_3_1: + * + * For the input buffer, the release fence must be set by the + * process_capture_request() call. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * For the input buffer, the fences must be set in the input_buffer + * passed to process_capture_result(). + * + * After signaling the release_fence for this buffer, the HAL + * should not make any further attempts to access this buffer as the + * ownership has been fully transferred back to the framework. + * + * If a fence of -1 was specified then the ownership of this buffer + * is transferred back immediately upon the call of process_capture_result. + */ + int release_fence; + +} camera3_stream_buffer_t; + +/** + * camera3_stream_buffer_set_t: + * + * The complete set of gralloc buffers for a stream. This structure is given to + * register_stream_buffers() to allow the camera HAL device to register/map/etc + * newly allocated stream buffers. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * Deprecated (and not used). In particular, + * register_stream_buffers is also deprecated and will never be invoked. + * + */ +typedef struct camera3_stream_buffer_set { + /** + * The stream handle for the stream these buffers belong to + */ + camera3_stream_t *stream; + + /** + * The number of buffers in this stream. It is guaranteed to be at least + * stream->max_buffers. + */ + uint32_t num_buffers; + + /** + * The array of gralloc buffer handles for this stream. If the stream format + * is set to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, the camera HAL device + * should inspect the passed-in buffers to determine any platform-private + * pixel format information. + */ + buffer_handle_t **buffers; + +} camera3_stream_buffer_set_t; + +/** + * camera3_jpeg_blob: + * + * Transport header for compressed JPEG buffers in output streams. + * + * To capture JPEG images, a stream is created using the pixel format + * HAL_PIXEL_FORMAT_BLOB. The buffer size for the stream is calculated by the + * framework, based on the static metadata field android.jpeg.maxSize. Since + * compressed JPEG images are of variable size, the HAL needs to include the + * final size of the compressed image using this structure inside the output + * stream buffer. The JPEG blob ID field must be set to CAMERA3_JPEG_BLOB_ID. + * + * Transport header should be at the end of the JPEG output stream buffer. That + * means the jpeg_blob_id must start at byte[buffer_size - + * sizeof(camera3_jpeg_blob)], where the buffer_size is the size of gralloc buffer. + * Any HAL using this transport header must account for it in android.jpeg.maxSize + * The JPEG data itself starts at the beginning of the buffer and should be + * jpeg_size bytes long. + */ +typedef struct camera3_jpeg_blob { + uint16_t jpeg_blob_id; + uint32_t jpeg_size; +} camera3_jpeg_blob_t; + +enum { + CAMERA3_JPEG_BLOB_ID = 0x00FF +}; + +/********************************************************************** + * + * Message definitions for the HAL notify() callback. + * + * These definitions are used for the HAL notify callback, to signal + * asynchronous events from the HAL device to the Android framework. + * + */ + +/** + * camera3_msg_type: + * + * Indicates the type of message sent, which specifies which member of the + * message union is valid. + * + */ +typedef enum camera3_msg_type { + /** + * An error has occurred. camera3_notify_msg.message.error contains the + * error information. + */ + CAMERA3_MSG_ERROR = 1, + + /** + * The exposure of a given request or processing a reprocess request has + * begun. camera3_notify_msg.message.shutter contains the information + * the capture. + */ + CAMERA3_MSG_SHUTTER = 2, + + /** + * Number of framework message types + */ + CAMERA3_NUM_MESSAGES + +} camera3_msg_type_t; + +/** + * Defined error codes for CAMERA_MSG_ERROR + */ +typedef enum camera3_error_msg_code { + /** + * A serious failure occured. No further frames or buffer streams will + * be produced by the device. Device should be treated as closed. The + * client must reopen the device to use it again. The frame_number field + * is unused. + */ + CAMERA3_MSG_ERROR_DEVICE = 1, + + /** + * An error has occurred in processing a request. No output (metadata or + * buffers) will be produced for this request. The frame_number field + * specifies which request has been dropped. Subsequent requests are + * unaffected, and the device remains operational. + */ + CAMERA3_MSG_ERROR_REQUEST = 2, + + /** + * An error has occurred in producing an output result metadata buffer + * for a request, but output stream buffers for it will still be + * available. Subsequent requests are unaffected, and the device remains + * operational. The frame_number field specifies the request for which + * result metadata won't be available. + */ + CAMERA3_MSG_ERROR_RESULT = 3, + + /** + * An error has occurred in placing an output buffer into a stream for a + * request. The frame metadata and other buffers may still be + * available. Subsequent requests are unaffected, and the device remains + * operational. The frame_number field specifies the request for which the + * buffer was dropped, and error_stream contains a pointer to the stream + * that dropped the frame.u + */ + CAMERA3_MSG_ERROR_BUFFER = 4, + + /** + * Number of error types + */ + CAMERA3_MSG_NUM_ERRORS + +} camera3_error_msg_code_t; + +/** + * camera3_error_msg_t: + * + * Message contents for CAMERA3_MSG_ERROR + */ +typedef struct camera3_error_msg { + /** + * Frame number of the request the error applies to. 0 if the frame number + * isn't applicable to the error. + */ + uint32_t frame_number; + + /** + * Pointer to the stream that had a failure. NULL if the stream isn't + * applicable to the error. + */ + camera3_stream_t *error_stream; + + /** + * The code for this error; one of the CAMERA_MSG_ERROR enum values. + */ + int error_code; + +} camera3_error_msg_t; + +/** + * camera3_shutter_msg_t: + * + * Message contents for CAMERA3_MSG_SHUTTER + */ +typedef struct camera3_shutter_msg { + /** + * Frame number of the request that has begun exposure or reprocessing. + */ + uint32_t frame_number; + + /** + * Timestamp for the start of capture. For a reprocess request, this must + * be input image's start of capture. This must match the capture result + * metadata's sensor exposure start timestamp. + */ + uint64_t timestamp; + +} camera3_shutter_msg_t; + +/** + * camera3_notify_msg_t: + * + * The message structure sent to camera3_callback_ops_t.notify() + */ +typedef struct camera3_notify_msg { + + /** + * The message type. One of camera3_notify_msg_type, or a private extension. + */ + int type; + + union { + /** + * Error message contents. Valid if type is CAMERA3_MSG_ERROR + */ + camera3_error_msg_t error; + + /** + * Shutter message contents. Valid if type is CAMERA3_MSG_SHUTTER + */ + camera3_shutter_msg_t shutter; + + /** + * Generic message contents. Used to ensure a minimum size for custom + * message types. + */ + uint8_t generic[32]; + } message; + +} camera3_notify_msg_t; + +/********************************************************************** + * + * Capture request/result definitions for the HAL process_capture_request() + * method, and the process_capture_result() callback. + * + */ + +/** + * camera3_request_template_t: + * + * Available template types for + * camera3_device_ops.construct_default_request_settings() + */ +typedef enum camera3_request_template { + /** + * Standard camera preview operation with 3A on auto. + */ + CAMERA3_TEMPLATE_PREVIEW = 1, + + /** + * Standard camera high-quality still capture with 3A and flash on auto. + */ + CAMERA3_TEMPLATE_STILL_CAPTURE = 2, + + /** + * Standard video recording plus preview with 3A on auto, torch off. + */ + CAMERA3_TEMPLATE_VIDEO_RECORD = 3, + + /** + * High-quality still capture while recording video. Application will + * include preview, video record, and full-resolution YUV or JPEG streams in + * request. Must not cause stuttering on video stream. 3A on auto. + */ + CAMERA3_TEMPLATE_VIDEO_SNAPSHOT = 4, + + /** + * Zero-shutter-lag mode. Application will request preview and + * full-resolution data for each frame, and reprocess it to JPEG when a + * still image is requested by user. Settings should provide highest-quality + * full-resolution images without compromising preview frame rate. 3A on + * auto. + */ + CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG = 5, + + /** + * A basic template for direct application control of capture + * parameters. All automatic control is disabled (auto-exposure, auto-white + * balance, auto-focus), and post-processing parameters are set to preview + * quality. The manual capture parameters (exposure, sensitivity, etc.) + * are set to reasonable defaults, but should be overridden by the + * application depending on the intended use case. + */ + CAMERA3_TEMPLATE_MANUAL = 6, + + /* Total number of templates */ + CAMERA3_TEMPLATE_COUNT, + + /** + * First value for vendor-defined request templates + */ + CAMERA3_VENDOR_TEMPLATE_START = 0x40000000 + +} camera3_request_template_t; + +/** + * camera3_capture_request_t: + * + * A single request for image capture/buffer reprocessing, sent to the Camera + * HAL device by the framework in process_capture_request(). + * + * The request contains the settings to be used for this capture, and the set of + * output buffers to write the resulting image data in. It may optionally + * contain an input buffer, in which case the request is for reprocessing that + * input buffer instead of capturing a new image with the camera sensor. The + * capture is identified by the frame_number. + * + * In response, the camera HAL device must send a camera3_capture_result + * structure asynchronously to the framework, using the process_capture_result() + * callback. + */ +typedef struct camera3_capture_request { + /** + * The frame number is an incrementing integer set by the framework to + * uniquely identify this capture. It needs to be returned in the result + * call, and is also used to identify the request in asynchronous + * notifications sent to camera3_callback_ops_t.notify(). + */ + uint32_t frame_number; + + /** + * The settings buffer contains the capture and processing parameters for + * the request. As a special case, a NULL settings buffer indicates that the + * settings are identical to the most-recently submitted capture request. A + * NULL buffer cannot be used as the first submitted request after a + * configure_streams() call. + */ + const camera_metadata_t *settings; + + /** + * The input stream buffer to use for this request, if any. + * + * If input_buffer is NULL, then the request is for a new capture from the + * imager. If input_buffer is valid, the request is for reprocessing the + * image contained in input_buffer. + * + * In the latter case, the HAL must set the release_fence of the + * input_buffer to a valid sync fence, or to -1 if the HAL does not support + * sync, before process_capture_request() returns. + * + * The HAL is required to wait on the acquire sync fence of the input buffer + * before accessing it. + * + * <= CAMERA_DEVICE_API_VERSION_3_1: + * + * Any input buffer included here will have been registered with the HAL + * through register_stream_buffers() before its inclusion in a request. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * The buffers will not have been pre-registered with the HAL. + * Subsequent requests may reuse buffers, or provide entirely new buffers. + */ + camera3_stream_buffer_t *input_buffer; + + /** + * The number of output buffers for this capture request. Must be at least + * 1. + */ + uint32_t num_output_buffers; + + /** + * An array of num_output_buffers stream buffers, to be filled with image + * data from this capture/reprocess. The HAL must wait on the acquire fences + * of each stream buffer before writing to them. + * + * The HAL takes ownership of the actual buffer_handle_t entries in + * output_buffers; the framework does not access them until they are + * returned in a camera3_capture_result_t. + * + * <= CAMERA_DEVICE_API_VERSION_3_1: + * + * All the buffers included here will have been registered with the HAL + * through register_stream_buffers() before their inclusion in a request. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * Any or all of the buffers included here may be brand new in this + * request (having never before seen by the HAL). + */ + const camera3_stream_buffer_t *output_buffers; + +} camera3_capture_request_t; + +/** + * camera3_capture_result_t: + * + * The result of a single capture/reprocess by the camera HAL device. This is + * sent to the framework asynchronously with process_capture_result(), in + * response to a single capture request sent to the HAL with + * process_capture_request(). Multiple process_capture_result() calls may be + * performed by the HAL for each request. + * + * Each call, all with the same frame + * number, may contain some subset of the output buffers, and/or the result + * metadata. The metadata may only be provided once for a given frame number; + * all other calls must set the result metadata to NULL. + * + * The result structure contains the output metadata from this capture, and the + * set of output buffers that have been/will be filled for this capture. Each + * output buffer may come with a release sync fence that the framework will wait + * on before reading, in case the buffer has not yet been filled by the HAL. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * The metadata may be provided multiple times for a single frame number. The + * framework will accumulate together the final result set by combining each + * partial result together into the total result set. + * + * If an input buffer is given in a request, the HAL must return it in one of + * the process_capture_result calls, and the call may be to just return the input + * buffer, without metadata and output buffers; the sync fences must be handled + * the same way they are done for output buffers. + * + * + * Performance considerations: + * + * Applications will also receive these partial results immediately, so sending + * partial results is a highly recommended performance optimization to avoid + * the total pipeline latency before sending the results for what is known very + * early on in the pipeline. + * + * A typical use case might be calculating the AF state halfway through the + * pipeline; by sending the state back to the framework immediately, we get a + * 50% performance increase and perceived responsiveness of the auto-focus. + * + */ +typedef struct camera3_capture_result { + /** + * The frame number is an incrementing integer set by the framework in the + * submitted request to uniquely identify this capture. It is also used to + * identify the request in asynchronous notifications sent to + * camera3_callback_ops_t.notify(). + */ + uint32_t frame_number; + + /** + * The result metadata for this capture. This contains information about the + * final capture parameters, the state of the capture and post-processing + * hardware, the state of the 3A algorithms, if enabled, and the output of + * any enabled statistics units. + * + * Only one call to process_capture_result() with a given frame_number may + * include the result metadata. All other calls for the same frame_number + * must set this to NULL. + * + * If there was an error producing the result metadata, result must be an + * empty metadata buffer, and notify() must be called with ERROR_RESULT. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * Multiple calls to process_capture_result() with a given frame_number + * may include the result metadata. + * + * Partial metadata submitted should not include any metadata key returned + * in a previous partial result for a given frame. Each new partial result + * for that frame must also set a distinct partial_result value. + * + * If notify has been called with ERROR_RESULT, all further partial + * results for that frame are ignored by the framework. + */ + const camera_metadata_t *result; + + /** + * The number of output buffers returned in this result structure. Must be + * less than or equal to the matching capture request's count. If this is + * less than the buffer count in the capture request, at least one more call + * to process_capture_result with the same frame_number must be made, to + * return the remaining output buffers to the framework. This may only be + * zero if the structure includes valid result metadata or an input buffer + * is returned in this result. + */ + uint32_t num_output_buffers; + + /** + * The handles for the output stream buffers for this capture. They may not + * yet be filled at the time the HAL calls process_capture_result(); the + * framework will wait on the release sync fences provided by the HAL before + * reading the buffers. + * + * The HAL must set the stream buffer's release sync fence to a valid sync + * fd, or to -1 if the buffer has already been filled. + * + * If the HAL encounters an error while processing the buffer, and the + * buffer is not filled, the buffer's status field must be set to + * CAMERA3_BUFFER_STATUS_ERROR. If the HAL did not wait on the acquire fence + * before encountering the error, the acquire fence should be copied into + * the release fence, to allow the framework to wait on the fence before + * reusing the buffer. + * + * The acquire fence must be set to -1 for all output buffers. If + * num_output_buffers is zero, this may be NULL. In that case, at least one + * more process_capture_result call must be made by the HAL to provide the + * output buffers. + * + * When process_capture_result is called with a new buffer for a frame, + * all previous frames' buffers for that corresponding stream must have been + * already delivered (the fences need not have yet been signaled). + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * Gralloc buffers for a frame may be sent to framework before the + * corresponding SHUTTER-notify. + * + * Performance considerations: + * + * Buffers delivered to the framework will not be dispatched to the + * application layer until a start of exposure timestamp has been received + * via a SHUTTER notify() call. It is highly recommended to + * dispatch that call as early as possible. + */ + const camera3_stream_buffer_t *output_buffers; + + /** + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * The handle for the input stream buffer for this capture. It may not + * yet be consumed at the time the HAL calls process_capture_result(); the + * framework will wait on the release sync fences provided by the HAL before + * reusing the buffer. + * + * The HAL should handle the sync fences the same way they are done for + * output_buffers. + * + * Only one input buffer is allowed to be sent per request. Similarly to + * output buffers, the ordering of returned input buffers must be + * maintained by the HAL. + * + * Performance considerations: + * + * The input buffer should be returned as early as possible. If the HAL + * supports sync fences, it can call process_capture_result to hand it back + * with sync fences being set appropriately. If the sync fences are not + * supported, the buffer can only be returned when it is consumed, which + * may take long time; the HAL may choose to copy this input buffer to make + * the buffer return sooner. + */ + const camera3_stream_buffer_t *input_buffer; + + /** + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * In order to take advantage of partial results, the HAL must set the + * static metadata android.request.partialResultCount to the number of + * partial results it will send for each frame. + * + * Each new capture result with a partial result must set + * this field (partial_result) to a distinct inclusive value between + * 1 and android.request.partialResultCount. + * + * HALs not wishing to take advantage of this feature must not + * set an android.request.partialResultCount or partial_result to a value + * other than 1. + * + * This value must be set to 0 when a capture result contains buffers only + * and no metadata. + */ + uint32_t partial_result; + +} camera3_capture_result_t; + +/********************************************************************** + * + * Callback methods for the HAL to call into the framework. + * + * These methods are used to return metadata and image buffers for a completed + * or failed captures, and to notify the framework of asynchronous events such + * as errors. + * + * The framework will not call back into the HAL from within these callbacks, + * and these calls will not block for extended periods. + * + */ +typedef struct camera3_callback_ops { + + /** + * process_capture_result: + * + * Send results from a completed capture to the framework. + * process_capture_result() may be invoked multiple times by the HAL in + * response to a single capture request. This allows, for example, the + * metadata and low-resolution buffers to be returned in one call, and + * post-processed JPEG buffers in a later call, once it is available. Each + * call must include the frame number of the request it is returning + * metadata or buffers for. + * + * A component (buffer or metadata) of the complete result may only be + * included in one process_capture_result call. A buffer for each stream, + * and the result metadata, must be returned by the HAL for each request in + * one of the process_capture_result calls, even in case of errors producing + * some of the output. A call to process_capture_result() with neither + * output buffers or result metadata is not allowed. + * + * The order of returning metadata and buffers for a single result does not + * matter, but buffers for a given stream must be returned in FIFO order. So + * the buffer for request 5 for stream A must always be returned before the + * buffer for request 6 for stream A. This also applies to the result + * metadata; the metadata for request 5 must be returned before the metadata + * for request 6. + * + * However, different streams are independent of each other, so it is + * acceptable and expected that the buffer for request 5 for stream A may be + * returned after the buffer for request 6 for stream B is. And it is + * acceptable that the result metadata for request 6 for stream B is + * returned before the buffer for request 5 for stream A is. + * + * The HAL retains ownership of result structure, which only needs to be + * valid to access during this call. The framework will copy whatever it + * needs before this call returns. + * + * The output buffers do not need to be filled yet; the framework will wait + * on the stream buffer release sync fence before reading the buffer + * data. Therefore, this method should be called by the HAL as soon as + * possible, even if some or all of the output buffers are still in + * being filled. The HAL must include valid release sync fences into each + * output_buffers stream buffer entry, or -1 if that stream buffer is + * already filled. + * + * If the result buffer cannot be constructed for a request, the HAL should + * return an empty metadata buffer, but still provide the output buffers and + * their sync fences. In addition, notify() must be called with an + * ERROR_RESULT message. + * + * If an output buffer cannot be filled, its status field must be set to + * STATUS_ERROR. In addition, notify() must be called with a ERROR_BUFFER + * message. + * + * If the entire capture has failed, then this method still needs to be + * called to return the output buffers to the framework. All the buffer + * statuses should be STATUS_ERROR, and the result metadata should be an + * empty buffer. In addition, notify() must be called with a ERROR_REQUEST + * message. In this case, individual ERROR_RESULT/ERROR_BUFFER messages + * should not be sent. + * + * Performance requirements: + * + * This is a non-blocking call. The framework will return this call in 5ms. + * + * The pipeline latency (see S7 for definition) should be less than or equal to + * 4 frame intervals, and must be less than or equal to 8 frame intervals. + * + */ + void (*process_capture_result)(const struct camera3_callback_ops *, + const camera3_capture_result_t *result); + + /** + * notify: + * + * Asynchronous notification callback from the HAL, fired for various + * reasons. Only for information independent of frame capture, or that + * require specific timing. The ownership of the message structure remains + * with the HAL, and the msg only needs to be valid for the duration of this + * call. + * + * Multiple threads may call notify() simultaneously. + * + * <= CAMERA_DEVICE_API_VERSION_3_1: + * + * The notification for the start of exposure for a given request must be + * sent by the HAL before the first call to process_capture_result() for + * that request is made. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * Buffers delivered to the framework will not be dispatched to the + * application layer until a start of exposure timestamp (or input image's + * start of exposure timestamp for a reprocess request) has been received + * via a SHUTTER notify() call. It is highly recommended to dispatch this + * call as early as possible. + * + * ------------------------------------------------------------------------ + * Performance requirements: + * + * This is a non-blocking call. The framework will return this call in 5ms. + */ + void (*notify)(const struct camera3_callback_ops *, + const camera3_notify_msg_t *msg); + +} camera3_callback_ops_t; + +/********************************************************************** + * + * Camera device operations + * + */ +typedef struct camera3_device_ops { + + /** + * initialize: + * + * One-time initialization to pass framework callback function pointers to + * the HAL. Will be called once after a successful open() call, before any + * other functions are called on the camera3_device_ops structure. + * + * Performance requirements: + * + * This should be a non-blocking call. The HAL should return from this call + * in 5ms, and must return from this call in 10ms. + * + * Return values: + * + * 0: On successful initialization + * + * -ENODEV: If initialization fails. Only close() can be called successfully + * by the framework after this. + */ + int (*initialize)(const struct camera3_device *, + const camera3_callback_ops_t *callback_ops); + + /********************************************************************** + * Stream management + */ + + /** + * configure_streams: + * + * CAMERA_DEVICE_API_VERSION_3_0 only: + * + * Reset the HAL camera device processing pipeline and set up new input and + * output streams. This call replaces any existing stream configuration with + * the streams defined in the stream_list. This method will be called at + * least once after initialize() before a request is submitted with + * process_capture_request(). + * + * The stream_list must contain at least one output-capable stream, and may + * not contain more than one input-capable stream. + * + * The stream_list may contain streams that are also in the currently-active + * set of streams (from the previous call to configure_stream()). These + * streams will already have valid values for usage, max_buffers, and the + * private pointer. + * + * If such a stream has already had its buffers registered, + * register_stream_buffers() will not be called again for the stream, and + * buffers from the stream can be immediately included in input requests. + * + * If the HAL needs to change the stream configuration for an existing + * stream due to the new configuration, it may rewrite the values of usage + * and/or max_buffers during the configure call. + * + * The framework will detect such a change, and will then reallocate the + * stream buffers, and call register_stream_buffers() again before using + * buffers from that stream in a request. + * + * If a currently-active stream is not included in stream_list, the HAL may + * safely remove any references to that stream. It will not be reused in a + * later configure() call by the framework, and all the gralloc buffers for + * it will be freed after the configure_streams() call returns. + * + * The stream_list structure is owned by the framework, and may not be + * accessed once this call completes. The address of an individual + * camera3_stream_t structure will remain valid for access by the HAL until + * the end of the first configure_stream() call which no longer includes + * that camera3_stream_t in the stream_list argument. The HAL may not change + * values in the stream structure outside of the private pointer, except for + * the usage and max_buffers members during the configure_streams() call + * itself. + * + * If the stream is new, the usage, max_buffer, and private pointer fields + * of the stream structure will all be set to 0. The HAL device must set + * these fields before the configure_streams() call returns. These fields + * are then used by the framework and the platform gralloc module to + * allocate the gralloc buffers for each stream. + * + * Before such a new stream can have its buffers included in a capture + * request, the framework will call register_stream_buffers() with that + * stream. However, the framework is not required to register buffers for + * _all_ streams before submitting a request. This allows for quick startup + * of (for example) a preview stream, with allocation for other streams + * happening later or concurrently. + * + * ------------------------------------------------------------------------ + * CAMERA_DEVICE_API_VERSION_3_1 only: + * + * Reset the HAL camera device processing pipeline and set up new input and + * output streams. This call replaces any existing stream configuration with + * the streams defined in the stream_list. This method will be called at + * least once after initialize() before a request is submitted with + * process_capture_request(). + * + * The stream_list must contain at least one output-capable stream, and may + * not contain more than one input-capable stream. + * + * The stream_list may contain streams that are also in the currently-active + * set of streams (from the previous call to configure_stream()). These + * streams will already have valid values for usage, max_buffers, and the + * private pointer. + * + * If such a stream has already had its buffers registered, + * register_stream_buffers() will not be called again for the stream, and + * buffers from the stream can be immediately included in input requests. + * + * If the HAL needs to change the stream configuration for an existing + * stream due to the new configuration, it may rewrite the values of usage + * and/or max_buffers during the configure call. + * + * The framework will detect such a change, and will then reallocate the + * stream buffers, and call register_stream_buffers() again before using + * buffers from that stream in a request. + * + * If a currently-active stream is not included in stream_list, the HAL may + * safely remove any references to that stream. It will not be reused in a + * later configure() call by the framework, and all the gralloc buffers for + * it will be freed after the configure_streams() call returns. + * + * The stream_list structure is owned by the framework, and may not be + * accessed once this call completes. The address of an individual + * camera3_stream_t structure will remain valid for access by the HAL until + * the end of the first configure_stream() call which no longer includes + * that camera3_stream_t in the stream_list argument. The HAL may not change + * values in the stream structure outside of the private pointer, except for + * the usage and max_buffers members during the configure_streams() call + * itself. + * + * If the stream is new, max_buffer, and private pointer fields of the + * stream structure will all be set to 0. The usage will be set to the + * consumer usage flags. The HAL device must set these fields before the + * configure_streams() call returns. These fields are then used by the + * framework and the platform gralloc module to allocate the gralloc + * buffers for each stream. + * + * Before such a new stream can have its buffers included in a capture + * request, the framework will call register_stream_buffers() with that + * stream. However, the framework is not required to register buffers for + * _all_ streams before submitting a request. This allows for quick startup + * of (for example) a preview stream, with allocation for other streams + * happening later or concurrently. + * + * ------------------------------------------------------------------------ + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * Reset the HAL camera device processing pipeline and set up new input and + * output streams. This call replaces any existing stream configuration with + * the streams defined in the stream_list. This method will be called at + * least once after initialize() before a request is submitted with + * process_capture_request(). + * + * The stream_list must contain at least one output-capable stream, and may + * not contain more than one input-capable stream. + * + * The stream_list may contain streams that are also in the currently-active + * set of streams (from the previous call to configure_stream()). These + * streams will already have valid values for usage, max_buffers, and the + * private pointer. + * + * If the HAL needs to change the stream configuration for an existing + * stream due to the new configuration, it may rewrite the values of usage + * and/or max_buffers during the configure call. + * + * The framework will detect such a change, and may then reallocate the + * stream buffers before using buffers from that stream in a request. + * + * If a currently-active stream is not included in stream_list, the HAL may + * safely remove any references to that stream. It will not be reused in a + * later configure() call by the framework, and all the gralloc buffers for + * it will be freed after the configure_streams() call returns. + * + * The stream_list structure is owned by the framework, and may not be + * accessed once this call completes. The address of an individual + * camera3_stream_t structure will remain valid for access by the HAL until + * the end of the first configure_stream() call which no longer includes + * that camera3_stream_t in the stream_list argument. The HAL may not change + * values in the stream structure outside of the private pointer, except for + * the usage and max_buffers members during the configure_streams() call + * itself. + * + * If the stream is new, max_buffer, and private pointer fields of the + * stream structure will all be set to 0. The usage will be set to the + * consumer usage flags. The HAL device must set these fields before the + * configure_streams() call returns. These fields are then used by the + * framework and the platform gralloc module to allocate the gralloc + * buffers for each stream. + * + * Newly allocated buffers may be included in a capture request at any time + * by the framework. Once a gralloc buffer is returned to the framework + * with process_capture_result (and its respective release_fence has been + * signaled) the framework may free or reuse it at any time. + * + * ------------------------------------------------------------------------ + * + * Preconditions: + * + * The framework will only call this method when no captures are being + * processed. That is, all results have been returned to the framework, and + * all in-flight input and output buffers have been returned and their + * release sync fences have been signaled by the HAL. The framework will not + * submit new requests for capture while the configure_streams() call is + * underway. + * + * Postconditions: + * + * The HAL device must configure itself to provide maximum possible output + * frame rate given the sizes and formats of the output streams, as + * documented in the camera device's static metadata. + * + * Performance requirements: + * + * This call is expected to be heavyweight and possibly take several hundred + * milliseconds to complete, since it may require resetting and + * reconfiguring the image sensor and the camera processing pipeline. + * Nevertheless, the HAL device should attempt to minimize the + * reconfiguration delay to minimize the user-visible pauses during + * application operational mode changes (such as switching from still + * capture to video recording). + * + * The HAL should return from this call in 500ms, and must return from this + * call in 1000ms. + * + * Return values: + * + * 0: On successful stream configuration + * + * -EINVAL: If the requested stream configuration is invalid. Some examples + * of invalid stream configurations include: + * + * - Including more than 1 input-capable stream (INPUT or + * BIDIRECTIONAL) + * + * - Not including any output-capable streams (OUTPUT or + * BIDIRECTIONAL) + * + * - Including streams with unsupported formats, or an unsupported + * size for that format. + * + * - Including too many output streams of a certain format. + * + * - Unsupported rotation configuration (only applies to + * devices with version >= CAMERA_DEVICE_API_VERSION_3_3) + * + * - Stream sizes/formats don't satisfy the + * camera3_stream_configuration_t->operation_mode requirements for non-NORMAL mode, + * or the requested operation_mode is not supported by the HAL. + * (only applies to devices with version >= CAMERA_DEVICE_API_VERSION_3_3) + * + * Note that the framework submitting an invalid stream + * configuration is not normal operation, since stream + * configurations are checked before configure. An invalid + * configuration means that a bug exists in the framework code, or + * there is a mismatch between the HAL's static metadata and the + * requirements on streams. + * + * -ENODEV: If there has been a fatal error and the device is no longer + * operational. Only close() can be called successfully by the + * framework after this error is returned. + */ + int (*configure_streams)(const struct camera3_device *, + camera3_stream_configuration_t *stream_list); + + /** + * register_stream_buffers: + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * DEPRECATED. This will not be called and must be set to NULL. + * + * <= CAMERA_DEVICE_API_VERSION_3_1: + * + * Register buffers for a given stream with the HAL device. This method is + * called by the framework after a new stream is defined by + * configure_streams, and before buffers from that stream are included in a + * capture request. If the same stream is listed in a subsequent + * configure_streams() call, register_stream_buffers will _not_ be called + * again for that stream. + * + * The framework does not need to register buffers for all configured + * streams before it submits the first capture request. This allows quick + * startup for preview (or similar use cases) while other streams are still + * being allocated. + * + * This method is intended to allow the HAL device to map or otherwise + * prepare the buffers for later use. The buffers passed in will already be + * locked for use. At the end of the call, all the buffers must be ready to + * be returned to the stream. The buffer_set argument is only valid for the + * duration of this call. + * + * If the stream format was set to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, + * the camera HAL should inspect the passed-in buffers here to determine any + * platform-private pixel format information. + * + * Performance requirements: + * + * This should be a non-blocking call. The HAL should return from this call + * in 1ms, and must return from this call in 5ms. + * + * Return values: + * + * 0: On successful registration of the new stream buffers + * + * -EINVAL: If the stream_buffer_set does not refer to a valid active + * stream, or if the buffers array is invalid. + * + * -ENOMEM: If there was a failure in registering the buffers. The framework + * must consider all the stream buffers to be unregistered, and can + * try to register again later. + * + * -ENODEV: If there is a fatal error, and the device is no longer + * operational. Only close() can be called successfully by the + * framework after this error is returned. + */ + int (*register_stream_buffers)(const struct camera3_device *, + const camera3_stream_buffer_set_t *buffer_set); + + /********************************************************************** + * Request creation and submission + */ + + /** + * construct_default_request_settings: + * + * Create capture settings for standard camera use cases. + * + * The device must return a settings buffer that is configured to meet the + * requested use case, which must be one of the CAMERA3_TEMPLATE_* + * enums. All request control fields must be included. + * + * The HAL retains ownership of this structure, but the pointer to the + * structure must be valid until the device is closed. The framework and the + * HAL may not modify the buffer once it is returned by this call. The same + * buffer may be returned for subsequent calls for the same template, or for + * other templates. + * + * Performance requirements: + * + * This should be a non-blocking call. The HAL should return from this call + * in 1ms, and must return from this call in 5ms. + * + * Return values: + * + * Valid metadata: On successful creation of a default settings + * buffer. + * + * NULL: In case of a fatal error. After this is returned, only + * the close() method can be called successfully by the + * framework. + */ + const camera_metadata_t* (*construct_default_request_settings)( + const struct camera3_device *, + int type); + + /** + * process_capture_request: + * + * Send a new capture request to the HAL. The HAL should not return from + * this call until it is ready to accept the next request to process. Only + * one call to process_capture_request() will be made at a time by the + * framework, and the calls will all be from the same thread. The next call + * to process_capture_request() will be made as soon as a new request and + * its associated buffers are available. In a normal preview scenario, this + * means the function will be called again by the framework almost + * instantly. + * + * The actual request processing is asynchronous, with the results of + * capture being returned by the HAL through the process_capture_result() + * call. This call requires the result metadata to be available, but output + * buffers may simply provide sync fences to wait on. Multiple requests are + * expected to be in flight at once, to maintain full output frame rate. + * + * The framework retains ownership of the request structure. It is only + * guaranteed to be valid during this call. The HAL device must make copies + * of the information it needs to retain for the capture processing. The HAL + * is responsible for waiting on and closing the buffers' fences and + * returning the buffer handles to the framework. + * + * The HAL must write the file descriptor for the input buffer's release + * sync fence into input_buffer->release_fence, if input_buffer is not + * NULL. If the HAL returns -1 for the input buffer release sync fence, the + * framework is free to immediately reuse the input buffer. Otherwise, the + * framework will wait on the sync fence before refilling and reusing the + * input buffer. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * + * The input/output buffers provided by the framework in each request + * may be brand new (having never before seen by the HAL). + * + * ------------------------------------------------------------------------ + * Performance considerations: + * + * Handling a new buffer should be extremely lightweight and there should be + * no frame rate degradation or frame jitter introduced. + * + * This call must return fast enough to ensure that the requested frame + * rate can be sustained, especially for streaming cases (post-processing + * quality settings set to FAST). The HAL should return this call in 1 + * frame interval, and must return from this call in 4 frame intervals. + * + * Return values: + * + * 0: On a successful start to processing the capture request + * + * -EINVAL: If the input is malformed (the settings are NULL when not + * allowed, there are 0 output buffers, etc) and capture processing + * cannot start. Failures during request processing should be + * handled by calling camera3_callback_ops_t.notify(). In case of + * this error, the framework will retain responsibility for the + * stream buffers' fences and the buffer handles; the HAL should + * not close the fences or return these buffers with + * process_capture_result. + * + * -ENODEV: If the camera device has encountered a serious error. After this + * error is returned, only the close() method can be successfully + * called by the framework. + * + */ + int (*process_capture_request)(const struct camera3_device *, + camera3_capture_request_t *request); + + /********************************************************************** + * Miscellaneous methods + */ + + /** + * get_metadata_vendor_tag_ops: + * + * Get methods to query for vendor extension metadata tag information. The + * HAL should fill in all the vendor tag operation methods, or leave ops + * unchanged if no vendor tags are defined. + * + * The definition of vendor_tag_query_ops_t can be found in + * system/media/camera/include/system/camera_metadata.h. + * + * >= CAMERA_DEVICE_API_VERSION_3_2: + * DEPRECATED. This function has been deprecated and should be set to + * NULL by the HAL. Please implement get_vendor_tag_ops in camera_common.h + * instead. + */ + void (*get_metadata_vendor_tag_ops)(const struct camera3_device*, + vendor_tag_query_ops_t* ops); + + /** + * dump: + * + * Print out debugging state for the camera device. This will be called by + * the framework when the camera service is asked for a debug dump, which + * happens when using the dumpsys tool, or when capturing a bugreport. + * + * The passed-in file descriptor can be used to write debugging text using + * dprintf() or write(). The text should be in ASCII encoding only. + * + * Performance requirements: + * + * This must be a non-blocking call. The HAL should return from this call + * in 1ms, must return from this call in 10ms. This call must avoid + * deadlocks, as it may be called at any point during camera operation. + * Any synchronization primitives used (such as mutex locks or semaphores) + * should be acquired with a timeout. + */ + void (*dump)(const struct camera3_device *, int fd); + + /** + * flush: + * + * Flush all currently in-process captures and all buffers in the pipeline + * on the given device. The framework will use this to dump all state as + * quickly as possible in order to prepare for a configure_streams() call. + * + * No buffers are required to be successfully returned, so every buffer + * held at the time of flush() (whether successfully filled or not) may be + * returned with CAMERA3_BUFFER_STATUS_ERROR. Note the HAL is still allowed + * to return valid (CAMERA3_BUFFER_STATUS_OK) buffers during this call, + * provided they are successfully filled. + * + * All requests currently in the HAL are expected to be returned as soon as + * possible. Not-in-process requests should return errors immediately. Any + * interruptible hardware blocks should be stopped, and any uninterruptible + * blocks should be waited on. + * + * flush() may be called concurrently to process_capture_request(), with the expectation that + * process_capture_request will return quickly and the request submitted in that + * process_capture_request call is treated like all other in-flight requests. Due to + * concurrency issues, it is possible that from the HAL's point of view, a + * process_capture_request() call may be started after flush has been invoked but has not + * returned yet. If such a call happens before flush() returns, the HAL should treat the new + * capture request like other in-flight pending requests (see #4 below). + * + * More specifically, the HAL must follow below requirements for various cases: + * + * 1. For captures that are too late for the HAL to cancel/stop, and will be + * completed normally by the HAL; i.e. the HAL can send shutter/notify and + * process_capture_result and buffers as normal. + * + * 2. For pending requests that have not done any processing, the HAL must call notify + * CAMERA3_MSG_ERROR_REQUEST, and return all the output buffers with + * process_capture_result in the error state (CAMERA3_BUFFER_STATUS_ERROR). + * The HAL must not place the release fence into an error state, instead, + * the release fences must be set to the acquire fences passed by the framework, + * or -1 if they have been waited on by the HAL already. This is also the path + * to follow for any captures for which the HAL already called notify() with + * CAMERA3_MSG_SHUTTER but won't be producing any metadata/valid buffers for. + * After CAMERA3_MSG_ERROR_REQUEST, for a given frame, only process_capture_results with + * buffers in CAMERA3_BUFFER_STATUS_ERROR are allowed. No further notifys or + * process_capture_result with non-null metadata is allowed. + * + * 3. For partially completed pending requests that will not have all the output + * buffers or perhaps missing metadata, the HAL should follow below: + * + * 3.1. Call notify with CAMERA3_MSG_ERROR_RESULT if some of the expected result + * metadata (i.e. one or more partial metadata) won't be available for the capture. + * + * 3.2. Call notify with CAMERA3_MSG_ERROR_BUFFER for every buffer that won't + * be produced for the capture. + * + * 3.3 Call notify with CAMERA3_MSG_SHUTTER with the capture timestamp before + * any buffers/metadata are returned with process_capture_result. + * + * 3.4 For captures that will produce some results, the HAL must not call + * CAMERA3_MSG_ERROR_REQUEST, since that indicates complete failure. + * + * 3.5. Valid buffers/metadata should be passed to the framework as normal. + * + * 3.6. Failed buffers should be returned to the framework as described for case 2. + * But failed buffers do not have to follow the strict ordering valid buffers do, + * and may be out-of-order with respect to valid buffers. For example, if buffers + * A, B, C, D, E are sent, D and E are failed, then A, E, B, D, C is an acceptable + * return order. + * + * 3.7. For fully-missing metadata, calling CAMERA3_MSG_ERROR_RESULT is sufficient, no + * need to call process_capture_result with NULL metadata or equivalent. + * + * 4. If a flush() is invoked while a process_capture_request() invocation is active, that + * process call should return as soon as possible. In addition, if a process_capture_request() + * call is made after flush() has been invoked but before flush() has returned, the + * capture request provided by the late process_capture_request call should be treated like + * a pending request in case #2 above. + * + * flush() should only return when there are no more outstanding buffers or + * requests left in the HAL. The framework may call configure_streams (as + * the HAL state is now quiesced) or may issue new requests. + * + * Note that it's sufficient to only support fully-succeeded and fully-failed result cases. + * However, it is highly desirable to support the partial failure cases as well, as it + * could help improve the flush call overall performance. + * + * Performance requirements: + * + * The HAL should return from this call in 100ms, and must return from this + * call in 1000ms. And this call must not be blocked longer than pipeline + * latency (see S7 for definition). + * + * Version information: + * + * only available if device version >= CAMERA_DEVICE_API_VERSION_3_1. + * + * Return values: + * + * 0: On a successful flush of the camera HAL. + * + * -EINVAL: If the input is malformed (the device is not valid). + * + * -ENODEV: If the camera device has encountered a serious error. After this + * error is returned, only the close() method can be successfully + * called by the framework. + */ + int (*flush)(const struct camera3_device *); + + /* reserved for future use */ + void *reserved[8]; +} camera3_device_ops_t; + +/********************************************************************** + * + * Camera device definition + * + */ +typedef struct camera3_device { + /** + * common.version must equal CAMERA_DEVICE_API_VERSION_3_0 to identify this + * device as implementing version 3.0 of the camera device HAL. + * + * Performance requirements: + * + * Camera open (common.module->common.methods->open) should return in 200ms, and must return + * in 500ms. + * Camera close (common.close) should return in 200ms, and must return in 500ms. + * + */ + hw_device_t common; + camera3_device_ops_t *ops; + void *priv; +} camera3_device_t; + +__END_DECLS + +#endif /* #ifdef ANDROID_INCLUDE_CAMERA3_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/camera_common.h b/third_party/android_hardware_libhardware/include/hardware/camera_common.h new file mode 100644 index 000000000..7658dd406 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/camera_common.h @@ -0,0 +1,916 @@ +/* + * 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. + */ + +// FIXME: add well-defined names for cameras + +#ifndef ANDROID_INCLUDE_CAMERA_COMMON_H +#define ANDROID_INCLUDE_CAMERA_COMMON_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +__BEGIN_DECLS + +/** + * The id of this module + */ +#define CAMERA_HARDWARE_MODULE_ID "camera" + +/** + * Module versioning information for the Camera hardware module, based on + * camera_module_t.common.module_api_version. The two most significant hex + * digits represent the major version, and the two least significant represent + * the minor version. + * + ******************************************************************************* + * Versions: 0.X - 1.X [CAMERA_MODULE_API_VERSION_1_0] + * + * Camera modules that report these version numbers implement the initial + * camera module HAL interface. All camera devices openable through this + * module support only version 1 of the camera device HAL. The device_version + * and static_camera_characteristics fields of camera_info are not valid. Only + * the android.hardware.Camera API can be supported by this module and its + * devices. + * + ******************************************************************************* + * Version: 2.0 [CAMERA_MODULE_API_VERSION_2_0] + * + * Camera modules that report this version number implement the second version + * of the camera module HAL interface. Camera devices openable through this + * module may support either version 1.0 or version 2.0 of the camera device + * HAL interface. The device_version field of camera_info is always valid; the + * static_camera_characteristics field of camera_info is valid if the + * device_version field is 2.0 or higher. + * + ******************************************************************************* + * Version: 2.1 [CAMERA_MODULE_API_VERSION_2_1] + * + * This camera module version adds support for asynchronous callbacks to the + * framework from the camera HAL module, which is used to notify the framework + * about changes to the camera module state. Modules that provide a valid + * set_callbacks() method must report at least this version number. + * + ******************************************************************************* + * Version: 2.2 [CAMERA_MODULE_API_VERSION_2_2] + * + * This camera module version adds vendor tag support from the module, and + * deprecates the old vendor_tag_query_ops that were previously only + * accessible with a device open. + * + ******************************************************************************* + * Version: 2.3 [CAMERA_MODULE_API_VERSION_2_3] + * + * This camera module version adds open legacy camera HAL device support. + * Framework can use it to open the camera device as lower device HAL version + * HAL device if the same device can support multiple device API versions. + * The standard hardware module open call (common.methods->open) continues + * to open the camera device with the latest supported version, which is + * also the version listed in camera_info_t.device_version. + * + ******************************************************************************* + * Version: 2.4 [CAMERA_MODULE_API_VERSION_2_4] + * + * This camera module version adds below API changes: + * + * 1. Torch mode support. The framework can use it to turn on torch mode for + * any camera device that has a flash unit, without opening a camera device. The + * camera device has a higher priority accessing the flash unit than the camera + * module; opening a camera device will turn off the torch if it had been enabled + * through the module interface. When there are any resource conflicts, such as + * open() is called to open a camera device, the camera HAL module must notify the + * framework through the torch mode status callback that the torch mode has been + * turned off. + * + * 2. External camera (e.g. USB hot-plug camera) support. The API updates specify that + * the camera static info is only available when camera is connected and ready to + * use for external hot-plug cameras. Calls to get static info will be invalid + * calls when camera status is not CAMERA_DEVICE_STATUS_PRESENT. The frameworks + * will only count on device status change callbacks to manage the available external + * camera list. + * + * 3. Camera arbitration hints. This module version adds support for explicitly + * indicating the number of camera devices that can be simultaneously opened and used. + * To specify valid combinations of devices, the resource_cost and conflicting_devices + * fields should always be set in the camera_info structure returned by the + * get_camera_info call. + * + * 4. Module initialization method. This will be called by the camera service + * right after the HAL module is loaded, to allow for one-time initialization + * of the HAL. It is called before any other module methods are invoked. + */ + +/** + * Predefined macros for currently-defined version numbers + */ + +/** + * All module versions <= HARDWARE_MODULE_API_VERSION(1, 0xFF) must be treated + * as CAMERA_MODULE_API_VERSION_1_0 + */ +#define CAMERA_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) +#define CAMERA_MODULE_API_VERSION_2_0 HARDWARE_MODULE_API_VERSION(2, 0) +#define CAMERA_MODULE_API_VERSION_2_1 HARDWARE_MODULE_API_VERSION(2, 1) +#define CAMERA_MODULE_API_VERSION_2_2 HARDWARE_MODULE_API_VERSION(2, 2) +#define CAMERA_MODULE_API_VERSION_2_3 HARDWARE_MODULE_API_VERSION(2, 3) +#define CAMERA_MODULE_API_VERSION_2_4 HARDWARE_MODULE_API_VERSION(2, 4) + +#define CAMERA_MODULE_API_VERSION_CURRENT CAMERA_MODULE_API_VERSION_2_4 + +/** + * All device versions <= HARDWARE_DEVICE_API_VERSION(1, 0xFF) must be treated + * as CAMERA_DEVICE_API_VERSION_1_0 + */ +#define CAMERA_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) +#define CAMERA_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) +#define CAMERA_DEVICE_API_VERSION_2_1 HARDWARE_DEVICE_API_VERSION(2, 1) +#define CAMERA_DEVICE_API_VERSION_3_0 HARDWARE_DEVICE_API_VERSION(3, 0) +#define CAMERA_DEVICE_API_VERSION_3_1 HARDWARE_DEVICE_API_VERSION(3, 1) +#define CAMERA_DEVICE_API_VERSION_3_2 HARDWARE_DEVICE_API_VERSION(3, 2) +#define CAMERA_DEVICE_API_VERSION_3_3 HARDWARE_DEVICE_API_VERSION(3, 3) + +// Device version 3.3 is current, older HAL camera device versions are not +// recommended for new devices. +#define CAMERA_DEVICE_API_VERSION_CURRENT CAMERA_DEVICE_API_VERSION_3_3 + +/** + * Defined in /system/media/camera/include/system/camera_metadata.h + */ +typedef struct camera_metadata camera_metadata_t; + +typedef struct camera_info { + /** + * The direction that the camera faces to. See system/core/include/system/camera.h + * for camera facing definitions. + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_2_3 or lower: + * + * It should be CAMERA_FACING_BACK or CAMERA_FACING_FRONT. + * + * CAMERA_MODULE_API_VERSION_2_4 or higher: + * + * It should be CAMERA_FACING_BACK, CAMERA_FACING_FRONT or + * CAMERA_FACING_EXTERNAL. + */ + int facing; + + /** + * The orientation of the camera image. The value is the angle that the + * camera image needs to be rotated clockwise so it shows correctly on the + * display in its natural orientation. It should be 0, 90, 180, or 270. + * + * For example, suppose a device has a naturally tall screen. The + * back-facing camera sensor is mounted in landscape. You are looking at the + * screen. If the top side of the camera sensor is aligned with the right + * edge of the screen in natural orientation, the value should be 90. If the + * top side of a front-facing camera sensor is aligned with the right of the + * screen, the value should be 270. + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_2_3 or lower: + * + * Valid in all camera_module versions. + * + * CAMERA_MODULE_API_VERSION_2_4 or higher: + * + * Valid if camera facing is CAMERA_FACING_BACK or CAMERA_FACING_FRONT, + * not valid if camera facing is CAMERA_FACING_EXTERNAL. + */ + int orientation; + + /** + * The value of camera_device_t.common.version. + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_1_0: + * + * Not valid. Can be assumed to be CAMERA_DEVICE_API_VERSION_1_0. Do + * not read this field. + * + * CAMERA_MODULE_API_VERSION_2_0 or higher: + * + * Always valid + * + */ + uint32_t device_version; + + /** + * The camera's fixed characteristics, which include all static camera metadata + * specified in system/media/camera/docs/docs.html. This should be a sorted metadata + * buffer, and may not be modified or freed by the caller. The pointer should remain + * valid for the lifetime of the camera module, and values in it may not + * change after it is returned by get_camera_info(). + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_1_0: + * + * Not valid. Extra characteristics are not available. Do not read this + * field. + * + * CAMERA_MODULE_API_VERSION_2_0 or higher: + * + * Valid if device_version >= CAMERA_DEVICE_API_VERSION_2_0. Do not read + * otherwise. + * + */ + const camera_metadata_t *static_camera_characteristics; + + /** + * The total resource "cost" of using this camera, represented as an integer + * value in the range [0, 100] where 100 represents total usage of the shared + * resource that is the limiting bottleneck of the camera subsystem. This may + * be a very rough estimate, and is used as a hint to the camera service to + * determine when to disallow multiple applications from simultaneously + * opening different cameras advertised by the camera service. + * + * The camera service must be able to simultaneously open and use any + * combination of camera devices exposed by the HAL where the sum of + * the resource costs of these cameras is <= 100. For determining cost, + * each camera device must be assumed to be configured and operating at + * the maximally resource-consuming framerate and stream size settings + * available in the configuration settings exposed for that device through + * the camera metadata. + * + * The camera service may still attempt to simultaneously open combinations + * of camera devices with a total resource cost > 100. This may succeed or + * fail. If this succeeds, combinations of configurations that are not + * supported due to resource constraints from having multiple open devices + * should fail during the configure calls. If the total resource cost is + * <= 100, open and configure should never fail for any stream configuration + * settings or other device capabilities that would normally succeed for a + * device when it is the only open camera device. + * + * This field will be used to determine whether background applications are + * allowed to use this camera device while other applications are using other + * camera devices. Note: multiple applications will never be allowed by the + * camera service to simultaneously open the same camera device. + * + * Example use cases: + * + * Ex. 1: Camera Device 0 = Back Camera + * Camera Device 1 = Front Camera + * - Using both camera devices causes a large framerate slowdown due to + * limited ISP bandwidth. + * + * Configuration: + * + * Camera Device 0 - resource_cost = 51 + * conflicting_devices = null + * Camera Device 1 - resource_cost = 51 + * conflicting_devices = null + * + * Result: + * + * Since the sum of the resource costs is > 100, if a higher-priority + * application has either device open, no lower-priority applications will be + * allowed by the camera service to open either device. If a lower-priority + * application is using a device that a higher-priority subsequently attempts + * to open, the lower-priority application will be forced to disconnect the + * the device. + * + * If the highest-priority application chooses, it may still attempt to open + * both devices (since these devices are not listed as conflicting in the + * conflicting_devices fields), but usage of these devices may fail in the + * open or configure calls. + * + * Ex. 2: Camera Device 0 = Left Back Camera + * Camera Device 1 = Right Back Camera + * Camera Device 2 = Combined stereo camera using both right and left + * back camera sensors used by devices 0, and 1 + * Camera Device 3 = Front Camera + * - Due to do hardware constraints, up to two cameras may be open at once. The + * combined stereo camera may never be used at the same time as either of the + * two back camera devices (device 0, 1), and typically requires too much + * bandwidth to use at the same time as the front camera (device 3). + * + * Configuration: + * + * Camera Device 0 - resource_cost = 50 + * conflicting_devices = { 2 } + * Camera Device 1 - resource_cost = 50 + * conflicting_devices = { 2 } + * Camera Device 2 - resource_cost = 100 + * conflicting_devices = { 0, 1 } + * Camera Device 3 - resource_cost = 50 + * conflicting_devices = null + * + * Result: + * + * Based on the conflicting_devices fields, the camera service guarantees that + * the following sets of open devices will never be allowed: { 1, 2 }, { 0, 2 }. + * + * Based on the resource_cost fields, if a high-priority foreground application + * is using camera device 0, a background application would be allowed to open + * camera device 1 or 3 (but would be forced to disconnect it again if the + * foreground application opened another device). + * + * The highest priority application may still attempt to simultaneously open + * devices 0, 2, and 3, but the HAL may fail in open or configure calls for + * this combination. + * + * Ex. 3: Camera Device 0 = Back Camera + * Camera Device 1 = Front Camera + * Camera Device 2 = Low-power Front Camera that uses the same + * sensor as device 1, but only exposes image stream + * resolutions that can be used in low-power mode + * - Using both front cameras (device 1, 2) at the same time is impossible due + * a shared physical sensor. Using the back and "high-power" front camera + * (device 1) may be impossible for some stream configurations due to hardware + * limitations, but the "low-power" front camera option may always be used as + * it has special dedicated hardware. + * + * Configuration: + * + * Camera Device 0 - resource_cost = 100 + * conflicting_devices = null + * Camera Device 1 - resource_cost = 100 + * conflicting_devices = { 2 } + * Camera Device 2 - resource_cost = 0 + * conflicting_devices = { 1 } + * Result: + * + * Based on the conflicting_devices fields, the camera service guarantees that + * the following sets of open devices will never be allowed: { 1, 2 }. + * + * Based on the resource_cost fields, only the highest priority application + * may attempt to open both device 0 and 1 at the same time. If a higher-priority + * application is not using device 1 or 2, a low-priority background application + * may open device 2 (but will be forced to disconnect it if a higher-priority + * application subsequently opens device 1 or 2). + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_2_3 or lower: + * + * Not valid. Can be assumed to be 100. Do not read this field. + * + * CAMERA_MODULE_API_VERSION_2_4 or higher: + * + * Always valid. + */ + int resource_cost; + + /** + * An array of camera device IDs represented as NULL-terminated strings + * indicating other devices that cannot be simultaneously opened while this + * camera device is in use. + * + * This field is intended to be used to indicate that this camera device + * is a composite of several other camera devices, or otherwise has + * hardware dependencies that prohibit simultaneous usage. If there are no + * dependencies, a NULL may be returned in this field to indicate this. + * + * The camera service will never simultaneously open any of the devices + * in this list while this camera device is open. + * + * The strings pointed to in this field will not be cleaned up by the camera + * service, and must remain while this device is plugged in. + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_2_3 or lower: + * + * Not valid. Can be assumed to be NULL. Do not read this field. + * + * CAMERA_MODULE_API_VERSION_2_4 or higher: + * + * Always valid. + */ + char** conflicting_devices; + + /** + * The length of the array given in the conflicting_devices field. + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_2_3 or lower: + * + * Not valid. Can be assumed to be 0. Do not read this field. + * + * CAMERA_MODULE_API_VERSION_2_4 or higher: + * + * Always valid. + */ + size_t conflicting_devices_length; + +} camera_info_t; + +/** + * camera_device_status_t: + * + * The current status of the camera device, as provided by the HAL through the + * camera_module_callbacks.camera_device_status_change() call. + * + * At module load time, the framework will assume all camera devices are in the + * CAMERA_DEVICE_STATUS_PRESENT state. The HAL should invoke + * camera_module_callbacks::camera_device_status_change to inform the framework + * of any initially NOT_PRESENT devices. + * + * Allowed transitions: + * PRESENT -> NOT_PRESENT + * NOT_PRESENT -> ENUMERATING + * NOT_PRESENT -> PRESENT + * ENUMERATING -> PRESENT + * ENUMERATING -> NOT_PRESENT + */ +typedef enum camera_device_status { + /** + * The camera device is not currently connected, and opening it will return + * failure. + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_2_3 or lower: + * + * Calls to get_camera_info must still succeed, and provide the same information + * it would if the camera were connected. + * + * CAMERA_MODULE_API_VERSION_2_4: + * + * The camera device at this status must return -EINVAL for get_camera_info call, + * as the device is not connected. + */ + CAMERA_DEVICE_STATUS_NOT_PRESENT = 0, + + /** + * The camera device is connected, and opening it will succeed. + * + * CAMERA_MODULE_API_VERSION_2_3 or lower: + * + * The information returned by get_camera_info cannot change due to this status + * change. By default, the framework will assume all devices are in this state. + * + * CAMERA_MODULE_API_VERSION_2_4: + * + * The information returned by get_camera_info will become valid after a device's + * status changes to this. By default, the framework will assume all devices are in + * this state. + */ + CAMERA_DEVICE_STATUS_PRESENT = 1, + + /** + * The camera device is connected, but it is undergoing an enumeration and + * so opening the device will return -EBUSY. + * + * CAMERA_MODULE_API_VERSION_2_3 or lower: + * + * Calls to get_camera_info must still succeed, as if the camera was in the + * PRESENT status. + * + * CAMERA_MODULE_API_VERSION_2_4: + * + * The camera device at this status must return -EINVAL for get_camera_info for call, + * as the device is not ready. + */ + CAMERA_DEVICE_STATUS_ENUMERATING = 2, + +} camera_device_status_t; + +/** + * torch_mode_status_t: + * + * The current status of the torch mode, as provided by the HAL through the + * camera_module_callbacks.torch_mode_status_change() call. + * + * The torch mode status of a camera device is applicable only when the camera + * device is present. The framework will not call set_torch_mode() to turn on + * torch mode of a camera device if the camera device is not present. At module + * load time, the framework will assume torch modes are in the + * TORCH_MODE_STATUS_AVAILABLE_OFF state if the camera device is present and + * android.flash.info.available is reported as true via get_camera_info() call. + * + * The behaviors of the camera HAL module that the framework expects in the + * following situations when a camera device's status changes: + * 1. A previously-disconnected camera device becomes connected. + * After camera_module_callbacks::camera_device_status_change() is invoked + * to inform the framework that the camera device is present, the framework + * will assume the camera device's torch mode is in + * TORCH_MODE_STATUS_AVAILABLE_OFF state. The camera HAL module does not need + * to invoke camera_module_callbacks::torch_mode_status_change() unless the + * flash unit is unavailable to use by set_torch_mode(). + * + * 2. A previously-connected camera becomes disconnected. + * After camera_module_callbacks::camera_device_status_change() is invoked + * to inform the framework that the camera device is not present, the + * framework will not call set_torch_mode() for the disconnected camera + * device until its flash unit becomes available again. The camera HAL + * module does not need to invoke + * camera_module_callbacks::torch_mode_status_change() separately to inform + * that the flash unit has become unavailable. + * + * 3. open() is called to open a camera device. + * The camera HAL module must invoke + * camera_module_callbacks::torch_mode_status_change() for all flash units + * that have entered TORCH_MODE_STATUS_NOT_AVAILABLE state and can not be + * turned on by calling set_torch_mode() anymore due to this open() call. + * open() must not trigger TORCH_MODE_STATUS_AVAILABLE_OFF before + * TORCH_MODE_STATUS_NOT_AVAILABLE for all flash units that have become + * unavailable. + * + * 4. close() is called to close a camera device. + * The camera HAL module must invoke + * camera_module_callbacks::torch_mode_status_change() for all flash units + * that have entered TORCH_MODE_STATUS_AVAILABLE_OFF state and can be turned + * on by calling set_torch_mode() again because of enough resources freed + * up by this close() call. + * + * Note that the framework calling set_torch_mode() successfully must trigger + * TORCH_MODE_STATUS_AVAILABLE_OFF or TORCH_MODE_STATUS_AVAILABLE_ON callback + * for the given camera device. Additionally it must trigger + * TORCH_MODE_STATUS_AVAILABLE_OFF callbacks for other previously-on torch + * modes if HAL cannot keep multiple torch modes on simultaneously. + */ +typedef enum torch_mode_status { + + /** + * The flash unit is no longer available and the torch mode can not be + * turned on by calling set_torch_mode(). If the torch mode is on, it + * will be turned off by HAL before HAL calls torch_mode_status_change(). + */ + TORCH_MODE_STATUS_NOT_AVAILABLE = 0, + + /** + * A torch mode has become off and available to be turned on via + * set_torch_mode(). This may happen in the following + * cases: + * 1. After the resources to turn on the torch mode have become available. + * 2. After set_torch_mode() is called to turn off the torch mode. + * 3. After the framework turned on the torch mode of some other camera + * device and HAL had to turn off the torch modes of any camera devices + * that were previously on. + */ + TORCH_MODE_STATUS_AVAILABLE_OFF = 1, + + /** + * A torch mode has become on and available to be turned off via + * set_torch_mode(). This can happen only after set_torch_mode() is called + * to turn on the torch mode. + */ + TORCH_MODE_STATUS_AVAILABLE_ON = 2, + +} torch_mode_status_t; + +/** + * Callback functions for the camera HAL module to use to inform the framework + * of changes to the camera subsystem. + * + * Version information (based on camera_module_t.common.module_api_version): + * + * Each callback is called only by HAL modules implementing the indicated + * version or higher of the HAL module API interface. + * + * CAMERA_MODULE_API_VERSION_2_1: + * camera_device_status_change() + * + * CAMERA_MODULE_API_VERSION_2_4: + * torch_mode_status_change() + + */ +typedef struct camera_module_callbacks { + + /** + * camera_device_status_change: + * + * Callback to the framework to indicate that the state of a specific camera + * device has changed. At module load time, the framework will assume all + * camera devices are in the CAMERA_DEVICE_STATUS_PRESENT state. The HAL + * must call this method to inform the framework of any initially + * NOT_PRESENT devices. + * + * This callback is added for CAMERA_MODULE_API_VERSION_2_1. + * + * camera_module_callbacks: The instance of camera_module_callbacks_t passed + * to the module with set_callbacks. + * + * camera_id: The ID of the camera device that has a new status. + * + * new_status: The new status code, one of the camera_device_status_t enums, + * or a platform-specific status. + * + */ + void (*camera_device_status_change)(const struct camera_module_callbacks*, + int camera_id, + int new_status); + + /** + * torch_mode_status_change: + * + * Callback to the framework to indicate that the state of the torch mode + * of the flash unit associated with a specific camera device has changed. + * At module load time, the framework will assume the torch modes are in + * the TORCH_MODE_STATUS_AVAILABLE_OFF state if android.flash.info.available + * is reported as true via get_camera_info() call. + * + * This callback is added for CAMERA_MODULE_API_VERSION_2_4. + * + * camera_module_callbacks: The instance of camera_module_callbacks_t + * passed to the module with set_callbacks. + * + * camera_id: The ID of camera device whose flash unit has a new torch mode + * status. + * + * new_status: The new status code, one of the torch_mode_status_t enums. + */ + void (*torch_mode_status_change)(const struct camera_module_callbacks*, + const char* camera_id, + int new_status); + + +} camera_module_callbacks_t; + +typedef struct camera_module { + /** + * Common methods of the camera module. This *must* be the first member of + * camera_module as users of this structure will cast a hw_module_t to + * camera_module pointer in contexts where it's known the hw_module_t + * references a camera_module. + * + * The return values for common.methods->open for camera_module are: + * + * 0: On a successful open of the camera device. + * + * -ENODEV: The camera device cannot be opened due to an internal + * error. + * + * -EINVAL: The input arguments are invalid, i.e. the id is invalid, + * and/or the module is invalid. + * + * -EBUSY: The camera device was already opened for this camera id + * (by using this method or open_legacy), + * regardless of the device HAL version it was opened as. + * + * -EUSERS: The maximal number of camera devices that can be + * opened concurrently were opened already, either by + * this method or the open_legacy method. + * + * All other return values from common.methods->open will be treated as + * -ENODEV. + */ + hw_module_t common; + + /** + * get_number_of_cameras: + * + * Returns the number of camera devices accessible through the camera + * module. The camera devices are numbered 0 through N-1, where N is the + * value returned by this call. The name of the camera device for open() is + * simply the number converted to a string. That is, "0" for camera ID 0, + * "1" for camera ID 1. + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_2_3 or lower: + * + * The value here must be static, and cannot change after the first call + * to this method. + * + * CAMERA_MODULE_API_VERSION_2_4 or higher: + * + * The value here must be static, and must count only built-in cameras, + * which have CAMERA_FACING_BACK or CAMERA_FACING_FRONT camera facing values + * (camera_info.facing). The HAL must not include the external cameras + * (camera_info.facing == CAMERA_FACING_EXTERNAL) into the return value + * of this call. Frameworks will use camera_device_status_change callback + * to manage number of external cameras. + */ + int (*get_number_of_cameras)(void); + + /** + * get_camera_info: + * + * Return the static camera information for a given camera device. This + * information may not change for a camera device. + * + * Return values: + * + * 0: On a successful operation + * + * -ENODEV: The information cannot be provided due to an internal + * error. + * + * -EINVAL: The input arguments are invalid, i.e. the id is invalid, + * and/or the module is invalid. + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_2_4 or higher: + * + * When a camera is disconnected, its camera id becomes invalid. Calling this + * this method with this invalid camera id will get -EINVAL and NULL camera + * static metadata (camera_info.static_camera_characteristics). + */ + int (*get_camera_info)(int camera_id, struct camera_info *info); + + /** + * set_callbacks: + * + * Provide callback function pointers to the HAL module to inform framework + * of asynchronous camera module events. The framework will call this + * function once after initial camera HAL module load, after the + * get_number_of_cameras() method is called for the first time, and before + * any other calls to the module. + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_1_0, CAMERA_MODULE_API_VERSION_2_0: + * + * Not provided by HAL module. Framework may not call this function. + * + * CAMERA_MODULE_API_VERSION_2_1: + * + * Valid to be called by the framework. + * + * Return values: + * + * 0: On a successful operation + * + * -ENODEV: The operation cannot be completed due to an internal + * error. + * + * -EINVAL: The input arguments are invalid, i.e. the callbacks are + * null + */ + int (*set_callbacks)(const camera_module_callbacks_t *callbacks); + + /** + * get_vendor_tag_ops: + * + * Get methods to query for vendor extension metadata tag information. The + * HAL should fill in all the vendor tag operation methods, or leave ops + * unchanged if no vendor tags are defined. + * + * The vendor_tag_ops structure used here is defined in: + * system/media/camera/include/system/vendor_tags.h + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1: + * Not provided by HAL module. Framework may not call this function. + * + * CAMERA_MODULE_API_VERSION_2_2: + * Valid to be called by the framework. + */ + void (*get_vendor_tag_ops)(vendor_tag_ops_t* ops); + + /** + * open_legacy: + * + * Open a specific legacy camera HAL device if multiple device HAL API + * versions are supported by this camera HAL module. For example, if the + * camera module supports both CAMERA_DEVICE_API_VERSION_1_0 and + * CAMERA_DEVICE_API_VERSION_3_2 device API for the same camera id, + * framework can call this function to open the camera device as + * CAMERA_DEVICE_API_VERSION_1_0 device. + * + * This is an optional method. A Camera HAL module does not need to support + * more than one device HAL version per device, and such modules may return + * -ENOSYS for all calls to this method. For all older HAL device API + * versions that are not supported, it may return -EOPNOTSUPP. When above + * cases occur, The normal open() method (common.methods->open) will be + * used by the framework instead. + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1/2_2: + * Not provided by HAL module. Framework will not call this function. + * + * CAMERA_MODULE_API_VERSION_2_3: + * Valid to be called by the framework. + * + * Return values: + * + * 0: On a successful open of the camera device. + * + * -ENOSYS This method is not supported. + * + * -EOPNOTSUPP: The requested HAL version is not supported by this method. + * + * -EINVAL: The input arguments are invalid, i.e. the id is invalid, + * and/or the module is invalid. + * + * -EBUSY: The camera device was already opened for this camera id + * (by using this method or common.methods->open method), + * regardless of the device HAL version it was opened as. + * + * -EUSERS: The maximal number of camera devices that can be + * opened concurrently were opened already, either by + * this method or common.methods->open method. + */ + int (*open_legacy)(const struct hw_module_t* module, const char* id, + uint32_t halVersion, struct hw_device_t** device); + + /** + * set_torch_mode: + * + * Turn on or off the torch mode of the flash unit associated with a given + * camera ID. If the operation is successful, HAL must notify the framework + * torch state by invoking + * camera_module_callbacks.torch_mode_status_change() with the new state. + * + * The camera device has a higher priority accessing the flash unit. When + * there are any resource conflicts, such as open() is called to open a + * camera device, HAL module must notify the framework through + * camera_module_callbacks.torch_mode_status_change() that the + * torch mode has been turned off and the torch mode state has become + * TORCH_MODE_STATUS_NOT_AVAILABLE. When resources to turn on torch mode + * become available again, HAL module must notify the framework through + * camera_module_callbacks.torch_mode_status_change() that the torch mode + * state has become TORCH_MODE_STATUS_AVAILABLE_OFF for set_torch_mode() to + * be called. + * + * When the framework calls set_torch_mode() to turn on the torch mode of a + * flash unit, if HAL cannot keep multiple torch modes on simultaneously, + * HAL should turn off the torch mode that was turned on by + * a previous set_torch_mode() call and notify the framework that the torch + * mode state of that flash unit has become TORCH_MODE_STATUS_AVAILABLE_OFF. + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1/2_2/2_3: + * Not provided by HAL module. Framework will not call this function. + * + * CAMERA_MODULE_API_VERSION_2_4: + * Valid to be called by the framework. + * + * Return values: + * + * 0: On a successful operation. + * + * -ENOSYS: The camera device does not support this operation. It is + * returned if and only if android.flash.info.available is + * false. + * + * -EBUSY: The camera device is already in use. + * + * -EUSERS: The resources needed to turn on the torch mode are not + * available, typically because other camera devices are + * holding the resources to make using the flash unit not + * possible. + * + * -EINVAL: camera_id is invalid. + * + */ + int (*set_torch_mode)(const char* camera_id, bool enabled); + + /** + * init: + * + * This method is called by the camera service before any other methods + * are invoked, right after the camera HAL library has been successfully + * loaded. It may be left as NULL by the HAL module, if no initialization + * in needed. + * + * It can be used by HAL implementations to perform initialization and + * other one-time operations. + * + * Version information (based on camera_module_t.common.module_api_version): + * + * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1/2_2/2_3: + * Not provided by HAL module. Framework will not call this function. + * + * CAMERA_MODULE_API_VERSION_2_4: + * If not NULL, will always be called by the framework once after the HAL + * module is loaded, before any other HAL module method is called. + * + * Return values: + * + * 0: On a successful operation. + * + * -ENODEV: Initialization cannot be completed due to an internal + * error. The HAL must be assumed to be in a nonfunctional + * state. + * + */ + int (*init)(); + + /* reserved for future use */ + void* reserved[5]; +} camera_module_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_CAMERA_COMMON_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/consumerir.h b/third_party/android_hardware_libhardware/include/hardware/consumerir.h new file mode 100644 index 000000000..15334c111 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/consumerir.h @@ -0,0 +1,92 @@ +/* + * 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_HARDWARE_CONSUMERIR_H +#define ANDROID_INCLUDE_HARDWARE_CONSUMERIR_H + +#include +#include +#include +#include + +#define CONSUMERIR_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) +#define CONSUMERIR_HARDWARE_MODULE_ID "consumerir" +#define CONSUMERIR_TRANSMITTER "transmitter" + +typedef struct consumerir_freq_range { + int min; + int max; +} consumerir_freq_range_t; + +typedef struct consumerir_module { + /** + * Common methods of the consumer IR module. This *must* be the first member of + * consumerir_module as users of this structure will cast a hw_module_t to + * consumerir_module pointer in contexts where it's known the hw_module_t references a + * consumerir_module. + */ + struct hw_module_t common; +} consumerir_module_t; + +typedef struct consumerir_device { + /** + * Common methods of the consumer IR device. This *must* be the first member of + * consumerir_device as users of this structure will cast a hw_device_t to + * consumerir_device pointer in contexts where it's known the hw_device_t references a + * consumerir_device. + */ + struct hw_device_t common; + + /* + * (*transmit)() is called to by the ConsumerIrService to send an IR pattern + * at a given carrier_freq. + * + * The pattern is alternating series of carrier on and off periods measured in + * microseconds. The carrier should be turned off at the end of a transmit + * even if there are and odd number of entries in the pattern array. + * + * This call should return when the transmit is complete or encounters an error. + * + * returns: 0 on success. A negative error code on error. + */ + int (*transmit)(struct consumerir_device *dev, int carrier_freq, + const int pattern[], int pattern_len); + + /* + * (*get_num_carrier_freqs)() is called by the ConsumerIrService to get the + * number of carrier freqs to allocate space for, which is then filled by + * a subsequent call to (*get_carrier_freqs)(). + * + * returns: the number of ranges on success. A negative error code on error. + */ + int (*get_num_carrier_freqs)(struct consumerir_device *dev); + + /* + * (*get_carrier_freqs)() is called by the ConsumerIrService to enumerate + * which frequencies the IR transmitter supports. The HAL implementation + * should fill an array of consumerir_freq_range structs with the + * appropriate values for the transmitter, up to len elements. + * + * returns: the number of ranges on success. A negative error code on error. + */ + int (*get_carrier_freqs)(struct consumerir_device *dev, + size_t len, consumerir_freq_range_t *ranges); + + /* Reserved for future use. Must be NULL. */ + void* reserved[8 - 3]; +} consumerir_device_t; + +#endif /* ANDROID_INCLUDE_HARDWARE_CONSUMERIR_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/display_defs.h b/third_party/android_hardware_libhardware/include/hardware/display_defs.h new file mode 100644 index 000000000..669ef78c4 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/display_defs.h @@ -0,0 +1,67 @@ +/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ANDROID_INCLUDE_DISPLAY_DEFS_H +#define ANDROID_INCLUDE_DISPLAY_DEFS_H + +#include +#include + +#include + +__BEGIN_DECLS + +/* Will need to update below enums if hwcomposer_defs.h is updated */ + +/* Extended events for hwc_methods::eventControl() */ +enum { + HWC_EVENT_ORIENTATION = HWC_EVENT_VSYNC + 1 +}; + + +/* Extended hwc_layer_t::compositionType values */ +enum { + /* this layer will be handled in the HWC, using a blit engine */ + HWC_BLIT = 0xFF +}; + +/* Extended hwc_layer_t::flags values + * Flags are set by SurfaceFlinger and read by the HAL + */ +enum { + /* + * HWC_SCREENSHOT_ANIMATOR_LAYER is set by surfaceflinger to indicate + * that this layer is a screenshot animating layer. HWC uses this + * info to disable rotation animation on External Display + */ + HWC_SCREENSHOT_ANIMATOR_LAYER = 0x00000004 +}; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_DISPLAY_DEFS_H*/ diff --git a/third_party/android_hardware_libhardware/include/hardware/fb.h b/third_party/android_hardware_libhardware/include/hardware/fb.h new file mode 100644 index 000000000..9df94165b --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/fb.h @@ -0,0 +1,173 @@ +/* + * 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_FB_INTERFACE_H +#define ANDROID_FB_INTERFACE_H + +#include +#include +#include + +#include + +#include + +__BEGIN_DECLS + +#define GRALLOC_HARDWARE_FB0 "fb0" + +/*****************************************************************************/ + + +/*****************************************************************************/ + +typedef struct framebuffer_device_t { + /** + * Common methods of the framebuffer device. This *must* be the first member of + * framebuffer_device_t as users of this structure will cast a hw_device_t to + * framebuffer_device_t pointer in contexts where it's known the hw_device_t references a + * framebuffer_device_t. + */ + struct hw_device_t common; + + /* flags describing some attributes of the framebuffer */ + const uint32_t flags; + + /* dimensions of the framebuffer in pixels */ + const uint32_t width; + const uint32_t height; + + /* frambuffer stride in pixels */ + const int stride; + + /* framebuffer pixel format */ + const int format; + + /* resolution of the framebuffer's display panel in pixel per inch*/ + const float xdpi; + const float ydpi; + + /* framebuffer's display panel refresh rate in frames per second */ + const float fps; + + /* min swap interval supported by this framebuffer */ + const int minSwapInterval; + + /* max swap interval supported by this framebuffer */ + const int maxSwapInterval; + + /* Number of framebuffers supported*/ + const int numFramebuffers; + + int reserved[7]; + + /* + * requests a specific swap-interval (same definition than EGL) + * + * Returns 0 on success or -errno on error. + */ + int (*setSwapInterval)(struct framebuffer_device_t* window, + int interval); + + /* + * This hook is OPTIONAL. + * + * It is non NULL If the framebuffer driver supports "update-on-demand" + * and the given rectangle is the area of the screen that gets + * updated during (*post)(). + * + * This is useful on devices that are able to DMA only a portion of + * the screen to the display panel, upon demand -- as opposed to + * constantly refreshing the panel 60 times per second, for instance. + * + * Only the area defined by this rectangle is guaranteed to be valid, that + * is, the driver is not allowed to post anything outside of this + * rectangle. + * + * The rectangle evaluated during (*post)() and specifies which area + * of the buffer passed in (*post)() shall to be posted. + * + * return -EINVAL if width or height <=0, or if left or top < 0 + */ + int (*setUpdateRect)(struct framebuffer_device_t* window, + int left, int top, int width, int height); + + /* + * Post to the display (display it on the screen) + * The buffer must have been allocated with the + * GRALLOC_USAGE_HW_FB usage flag. + * buffer must be the same width and height as the display and must NOT + * be locked. + * + * The buffer is shown during the next VSYNC. + * + * If the same buffer is posted again (possibly after some other buffer), + * post() will block until the the first post is completed. + * + * Internally, post() is expected to lock the buffer so that a + * subsequent call to gralloc_module_t::(*lock)() with USAGE_RENDER or + * USAGE_*_WRITE will block until it is safe; that is typically once this + * buffer is shown and another buffer has been posted. + * + * Returns 0 on success or -errno on error. + */ + int (*post)(struct framebuffer_device_t* dev, buffer_handle_t buffer); + + + /* + * The (*compositionComplete)() method must be called after the + * compositor has finished issuing GL commands for client buffers. + */ + + int (*compositionComplete)(struct framebuffer_device_t* dev); + + /* + * This hook is OPTIONAL. + * + * If non NULL it will be caused by SurfaceFlinger on dumpsys + */ + void (*dump)(struct framebuffer_device_t* dev, char *buff, int buff_len); + + /* + * (*enableScreen)() is used to either blank (enable=0) or + * unblank (enable=1) the screen this framebuffer is attached to. + * + * Returns 0 on success or -errno on error. + */ + int (*enableScreen)(struct framebuffer_device_t* dev, int enable); + + void* reserved_proc[6]; + +} framebuffer_device_t; + + +/** convenience API for opening and closing a supported device */ + +static inline int framebuffer_open(const struct hw_module_t* module, + struct framebuffer_device_t** device) { + return module->methods->open(module, + GRALLOC_HARDWARE_FB0, (struct hw_device_t**)device); +} + +static inline int framebuffer_close(struct framebuffer_device_t* device) { + return device->common.close(&device->common); +} + + +__END_DECLS + +#endif // ANDROID_FB_INTERFACE_H diff --git a/third_party/android_hardware_libhardware/include/hardware/fingerprint.h b/third_party/android_hardware_libhardware/include/hardware/fingerprint.h new file mode 100644 index 000000000..ac88c1032 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/fingerprint.h @@ -0,0 +1,266 @@ +/* + * Copyright (C) 2014 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_FINGERPRINT_H +#define ANDROID_INCLUDE_HARDWARE_FINGERPRINT_H + +#include + +#define FINGERPRINT_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) +#define FINGERPRINT_MODULE_API_VERSION_2_0 HARDWARE_MODULE_API_VERSION(2, 0) +#define FINGERPRINT_HARDWARE_MODULE_ID "fingerprint" + +typedef enum fingerprint_msg_type { + FINGERPRINT_ERROR = -1, + FINGERPRINT_ACQUIRED = 1, + FINGERPRINT_TEMPLATE_ENROLLING = 3, + FINGERPRINT_TEMPLATE_REMOVED = 4, + FINGERPRINT_AUTHENTICATED = 5 +} fingerprint_msg_type_t; + +/* + * Fingerprint errors are meant to tell the framework to terminate the current operation and ask + * for the user to correct the situation. These will almost always result in messaging and user + * interaction to correct the problem. + * + * For example, FINGERPRINT_ERROR_CANCELED should follow any acquisition message that results in + * a situation where the current operation can't continue without user interaction. For example, + * if the sensor is dirty during enrollment and no further enrollment progress can be made, + * send FINGERPRINT_ACQUIRED_IMAGER_DIRTY followed by FINGERPRINT_ERROR_CANCELED. + */ +typedef enum fingerprint_error { + FINGERPRINT_ERROR_HW_UNAVAILABLE = 1, /* The hardware has an error that can't be resolved. */ + FINGERPRINT_ERROR_UNABLE_TO_PROCESS = 2, /* Bad data; operation can't continue */ + FINGERPRINT_ERROR_TIMEOUT = 3, /* The operation has timed out waiting for user input. */ + FINGERPRINT_ERROR_NO_SPACE = 4, /* No space available to store a template */ + FINGERPRINT_ERROR_CANCELED = 5, /* The current operation can't proceed. See above. */ + FINGERPRINT_ERROR_UNABLE_TO_REMOVE = 6, /* fingerprint with given id can't be removed */ + FINGERPRINT_ERROR_VENDOR_BASE = 1000 /* vendor-specific error messages start here */ +} fingerprint_error_t; + +/* + * Fingerprint acquisition info is meant as feedback for the current operation. Anything but + * FINGERPRINT_ACQUIRED_GOOD will be shown to the user as feedback on how to take action on the + * current operation. For example, FINGERPRINT_ACQUIRED_IMAGER_DIRTY can be used to tell the user + * to clean the sensor. If this will cause the current operation to fail, an additional + * FINGERPRINT_ERROR_CANCELED can be sent to stop the operation in progress (e.g. enrollment). + * In general, these messages will result in a "Try again" message. + */ +typedef enum fingerprint_acquired_info { + FINGERPRINT_ACQUIRED_GOOD = 0, + FINGERPRINT_ACQUIRED_PARTIAL = 1, /* sensor needs more data, i.e. longer swipe. */ + FINGERPRINT_ACQUIRED_INSUFFICIENT = 2, /* image doesn't contain enough detail for recognition*/ + FINGERPRINT_ACQUIRED_IMAGER_DIRTY = 3, /* sensor needs to be cleaned */ + FINGERPRINT_ACQUIRED_TOO_SLOW = 4, /* mostly swipe-type sensors; not enough data collected */ + FINGERPRINT_ACQUIRED_TOO_FAST = 5, /* for swipe and area sensors; tell user to slow down*/ + FINGERPRINT_ACQUIRED_VENDOR_BASE = 1000 /* vendor-specific acquisition messages start here */ +} fingerprint_acquired_info_t; + +typedef struct fingerprint_finger_id { + uint32_t gid; + uint32_t fid; +} fingerprint_finger_id_t; + +typedef struct fingerprint_enroll { + fingerprint_finger_id_t finger; + /* samples_remaining goes from N (no data collected, but N scans needed) + * to 0 (no more data is needed to build a template). */ + uint32_t samples_remaining; + uint64_t msg; /* Vendor specific message. Used for user guidance */ +} fingerprint_enroll_t; + +typedef struct fingerprint_removed { + fingerprint_finger_id_t finger; +} fingerprint_removed_t; + +typedef struct fingerprint_acquired { + fingerprint_acquired_info_t acquired_info; /* information about the image */ +} fingerprint_acquired_t; + +typedef struct fingerprint_authenticated { + fingerprint_finger_id_t finger; + hw_auth_token_t hat; +} fingerprint_authenticated_t; + +typedef struct fingerprint_msg { + fingerprint_msg_type_t type; + union { + fingerprint_error_t error; + fingerprint_enroll_t enroll; + fingerprint_removed_t removed; + fingerprint_acquired_t acquired; + fingerprint_authenticated_t authenticated; + } data; +} fingerprint_msg_t; + +/* Callback function type */ +typedef void (*fingerprint_notify_t)(const fingerprint_msg_t *msg); + +/* Synchronous operation */ +typedef struct fingerprint_device { + /** + * Common methods of the fingerprint device. This *must* be the first member + * of fingerprint_device as users of this structure will cast a hw_device_t + * to fingerprint_device pointer in contexts where it's known + * the hw_device_t references a fingerprint_device. + */ + struct hw_device_t common; + + /* + * Client provided callback function to receive notifications. + * Do not set by hand, use the function above instead. + */ + fingerprint_notify_t notify; + + /* + * Set notification callback: + * Registers a user function that would receive notifications from the HAL + * The call will block if the HAL state machine is in busy state until HAL + * leaves the busy state. + * + * Function return: 0 if callback function is successfuly registered + * or a negative number in case of error, generally from the errno.h set. + */ + int (*set_notify)(struct fingerprint_device *dev, fingerprint_notify_t notify); + + /* + * Fingerprint pre-enroll enroll request: + * Generates a unique token to upper layers to indicate the start of an enrollment transaction. + * This token will be wrapped by security for verification and passed to enroll() for + * verification before enrollment will be allowed. This is to ensure adding a new fingerprint + * template was preceded by some kind of credential confirmation (e.g. device password). + * + * Function return: 0 if function failed + * otherwise, a uint64_t of token + */ + uint64_t (*pre_enroll)(struct fingerprint_device *dev); + + /* + * Fingerprint enroll request: + * Switches the HAL state machine to collect and store a new fingerprint + * template. Switches back as soon as enroll is complete + * (fingerprint_msg.type == FINGERPRINT_TEMPLATE_ENROLLING && + * fingerprint_msg.data.enroll.samples_remaining == 0) + * or after timeout_sec seconds. + * The fingerprint template will be assigned to the group gid. User has a choice + * to supply the gid or set it to 0 in which case a unique group id will be generated. + * + * Function return: 0 if enrollment process can be successfully started + * or a negative number in case of error, generally from the errno.h set. + * A notify() function may be called indicating the error condition. + */ + int (*enroll)(struct fingerprint_device *dev, const hw_auth_token_t *hat, + uint32_t gid, uint32_t timeout_sec); + + /* + * Finishes the enroll operation and invalidates the pre_enroll() generated challenge. + * This will be called at the end of a multi-finger enrollment session to indicate + * that no more fingers will be added. + * + * Function return: 0 if the request is accepted + * or a negative number in case of error, generally from the errno.h set. + */ + int (*post_enroll)(struct fingerprint_device *dev); + + /* + * get_authenticator_id: + * Returns a token associated with the current fingerprint set. This value will + * change whenever a new fingerprint is enrolled, thus creating a new fingerprint + * set. + * + * Function return: current authenticator id or 0 if function failed. + */ + uint64_t (*get_authenticator_id)(struct fingerprint_device *dev); + + /* + * Cancel pending enroll or authenticate, sending FINGERPRINT_ERROR_CANCELED + * to all running clients. Switches the HAL state machine back to the idle state. + * Unlike enroll_done() doesn't invalidate the pre_enroll() challenge. + * + * Function return: 0 if cancel request is accepted + * or a negative number in case of error, generally from the errno.h set. + */ + int (*cancel)(struct fingerprint_device *dev); + + /* + * Enumerate all the fingerprint templates found in the directory set by + * set_active_group() + * This is a synchronous call. The function takes: + * - A pointer to an array of fingerprint_finger_id_t. + * - The size of the array provided, in fingerprint_finger_id_t elements. + * Max_size is a bi-directional parameter and returns the actual number + * of elements copied to the caller supplied array. + * In the absence of errors the function returns the total number of templates + * in the user directory. + * If the caller has no good guess on the size of the array he should call this + * function witn *max_size == 0 and use the return value for the array allocation. + * The caller of this function has a complete list of the templates when *max_size + * is the same as the function return. + * + * Function return: Total number of fingerprint templates in the current storage directory. + * or a negative number in case of error, generally from the errno.h set. + */ + int (*enumerate)(struct fingerprint_device *dev, fingerprint_finger_id_t *results, + uint32_t *max_size); + + /* + * Fingerprint remove request: + * Deletes a fingerprint template. + * Works only within a path set by set_active_group(). + * notify() will be called with details on the template deleted. + * fingerprint_msg.type == FINGERPRINT_TEMPLATE_REMOVED and + * fingerprint_msg.data.removed.id indicating the template id removed. + * + * Function return: 0 if fingerprint template(s) can be successfully deleted + * or a negative number in case of error, generally from the errno.h set. + */ + int (*remove)(struct fingerprint_device *dev, uint32_t gid, uint32_t fid); + + /* + * Restricts the HAL operation to a set of fingerprints belonging to a + * group provided. + * The caller must provide a path to a storage location within the user's + * data directory. + * + * Function return: 0 on success + * or a negative number in case of error, generally from the errno.h set. + */ + int (*set_active_group)(struct fingerprint_device *dev, uint32_t gid, + const char *store_path); + + /* + * Authenticates an operation identifed by operation_id + * + * Function return: 0 on success + * or a negative number in case of error, generally from the errno.h set. + */ + int (*authenticate)(struct fingerprint_device *dev, uint64_t operation_id, uint32_t gid); + + /* Reserved for backward binary compatibility */ + void *reserved[4]; +} fingerprint_device_t; + +typedef struct fingerprint_module { + /** + * Common methods of the fingerprint module. This *must* be the first member + * of fingerprint_module as users of this structure will cast a hw_module_t + * to fingerprint_module pointer in contexts where it's known + * the hw_module_t references a fingerprint_module. + */ + struct hw_module_t common; +} fingerprint_module_t; + +#endif /* ANDROID_INCLUDE_HARDWARE_FINGERPRINT_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/fused_location.h b/third_party/android_hardware_libhardware/include/hardware/fused_location.h new file mode 100644 index 000000000..73360a12a --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/fused_location.h @@ -0,0 +1,825 @@ +/* + * 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_HARDWARE_FUSED_LOCATION_H +#define ANDROID_INCLUDE_HARDWARE_FUSED_LOCATION_H + +#include + + +/** + * This header file defines the interface of the Fused Location Provider. + * Fused Location Provider is designed to fuse data from various sources + * like GPS, Wifi, Cell, Sensors, Bluetooth etc to provide a fused location to the + * upper layers. The advantage of doing fusion in hardware is power savings. + * The goal is to do this without waking up the AP to get additional data. + * The software implementation of FLP will decide when to use + * the hardware fused location. Other location features like geofencing will + * also be implemented using fusion in hardware. + */ +__BEGIN_DECLS + +#define FLP_HEADER_VERSION 1 +#define FLP_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) +#define FLP_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION_2(0, 1, FLP_HEADER_VERSION) + +/** + * The id of this module + */ +#define FUSED_LOCATION_HARDWARE_MODULE_ID "flp" + +/** + * Name for the FLP location interface + */ +#define FLP_LOCATION_INTERFACE "flp_location" + +/** + * Name for the FLP location interface + */ +#define FLP_DIAGNOSTIC_INTERFACE "flp_diagnostic" + +/** + * Name for the FLP_Geofencing interface. + */ +#define FLP_GEOFENCING_INTERFACE "flp_geofencing" + +/** + * Name for the FLP_device context interface. + */ +#define FLP_DEVICE_CONTEXT_INTERFACE "flp_device_context" + +/** + * Constants to indicate the various subsystems + * that will be used. + */ +#define FLP_TECH_MASK_GNSS (1U<<0) +#define FLP_TECH_MASK_WIFI (1U<<1) +#define FLP_TECH_MASK_SENSORS (1U<<2) +#define FLP_TECH_MASK_CELL (1U<<3) +#define FLP_TECH_MASK_BLUETOOTH (1U<<4) + +/** + * Set when your implementation can produce GNNS-derived locations, + * for use with flp_capabilities_callback. + * + * GNNS is a required capability for a particular feature to be used + * (batching or geofencing). If not supported that particular feature + * won't be used by the upper layer. + */ +#define CAPABILITY_GNSS (1U<<0) +/** + * Set when your implementation can produce WiFi-derived locations, for + * use with flp_capabilities_callback. + */ +#define CAPABILITY_WIFI (1U<<1) +/** + * Set when your implementation can produce cell-derived locations, for + * use with flp_capabilities_callback. + */ +#define CAPABILITY_CELL (1U<<3) + +/** + * Status to return in flp_status_callback when your implementation transitions + * from being unsuccessful in determining location to being successful. + */ +#define FLP_STATUS_LOCATION_AVAILABLE 0 +/** + * Status to return in flp_status_callback when your implementation transitions + * from being successful in determining location to being unsuccessful. + */ +#define FLP_STATUS_LOCATION_UNAVAILABLE 1 + +/** + * This constant is used with the batched locations + * APIs. Batching is mandatory when FLP implementation + * is supported. If the flag is set, the hardware implementation + * will wake up the application processor when the FIFO is full, + * If the flag is not set, the hardware implementation will drop + * the oldest data when the FIFO is full. + */ +#define FLP_BATCH_WAKEUP_ON_FIFO_FULL 0x0000001 + +/** + * While batching, the implementation should not call the + * flp_location_callback on every location fix. However, + * sometimes in high power mode, the system might need + * a location callback every single time the location + * fix has been obtained. This flag controls that option. + * Its the responsibility of the upper layers (caller) to switch + * it off, if it knows that the AP might go to sleep. + * When this bit is on amidst a batching session, batching should + * continue while location fixes are reported in real time. + */ +#define FLP_BATCH_CALLBACK_ON_LOCATION_FIX 0x0000002 + +/** Flags to indicate which values are valid in a FlpLocation. */ +typedef uint16_t FlpLocationFlags; + +// IMPORTANT: Note that the following values must match +// constants in the corresponding java file. + +/** FlpLocation has valid latitude and longitude. */ +#define FLP_LOCATION_HAS_LAT_LONG (1U<<0) +/** FlpLocation has valid altitude. */ +#define FLP_LOCATION_HAS_ALTITUDE (1U<<1) +/** FlpLocation has valid speed. */ +#define FLP_LOCATION_HAS_SPEED (1U<<2) +/** FlpLocation has valid bearing. */ +#define FLP_LOCATION_HAS_BEARING (1U<<4) +/** FlpLocation has valid accuracy. */ +#define FLP_LOCATION_HAS_ACCURACY (1U<<8) + + +typedef int64_t FlpUtcTime; + +/** Represents a location. */ +typedef struct { + /** set to sizeof(FlpLocation) */ + size_t size; + + /** Flags associated with the location object. */ + FlpLocationFlags flags; + + /** Represents latitude in degrees. */ + double latitude; + + /** Represents longitude in degrees. */ + double longitude; + + /** + * Represents altitude in meters above the WGS 84 reference + * ellipsoid. */ + double altitude; + + /** Represents speed in meters per second. */ + float speed; + + /** Represents heading in degrees. */ + float bearing; + + /** Represents expected accuracy in meters. */ + float accuracy; + + /** Timestamp for the location fix. */ + FlpUtcTime timestamp; + + /** Sources used, will be Bitwise OR of the FLP_TECH_MASK bits. */ + uint32_t sources_used; +} FlpLocation; + +typedef enum { + ASSOCIATE_JVM, + DISASSOCIATE_JVM, +} ThreadEvent; + +/** + * Callback with location information. + * Can only be called from a thread associated to JVM using set_thread_event_cb. + * Parameters: + * num_locations is the number of batched locations available. + * location is the pointer to an array of pointers to location objects. + */ +typedef void (*flp_location_callback)(int32_t num_locations, FlpLocation** location); + +/** + * Callback utility for acquiring a wakelock. + * This can be used to prevent the CPU from suspending while handling FLP events. + */ +typedef void (*flp_acquire_wakelock)(); + +/** + * Callback utility for releasing the FLP wakelock. + */ +typedef void (*flp_release_wakelock)(); + +/** + * Callback for associating a thread that can call into the Java framework code. + * This must be used to initialize any threads that report events up to the framework. + * Return value: + * FLP_RESULT_SUCCESS on success. + * FLP_RESULT_ERROR if the association failed in the current thread. + */ +typedef int (*flp_set_thread_event)(ThreadEvent event); + +/** + * Callback for technologies supported by this implementation. + * + * Parameters: capabilities is a bitmask of FLP_CAPABILITY_* values describing + * which features your implementation supports. You should support + * CAPABILITY_GNSS at a minimum for your implementation to be utilized. You can + * return 0 in FlpGeofenceCallbacks to indicate you don't support geofencing, + * or 0 in FlpCallbacks to indicate you don't support location batching. + */ +typedef void (*flp_capabilities_callback)(int capabilities); + +/** + * Callback with status information on the ability to compute location. + * To avoid waking up the application processor you should only send + * changes in status (you shouldn't call this method twice in a row + * with the same status value). As a guideline you should not call this + * more frequently then the requested batch period set with period_ns + * in FlpBatchOptions. For example if period_ns is set to 5 minutes and + * the status changes many times in that interval, you should only report + * one status change every 5 minutes. + * + * Parameters: + * status is one of FLP_STATUS_LOCATION_AVAILABLE + * or FLP_STATUS_LOCATION_UNAVAILABLE. + */ +typedef void (*flp_status_callback)(int32_t status); + +/** FLP callback structure. */ +typedef struct { + /** set to sizeof(FlpCallbacks) */ + size_t size; + flp_location_callback location_cb; + flp_acquire_wakelock acquire_wakelock_cb; + flp_release_wakelock release_wakelock_cb; + flp_set_thread_event set_thread_event_cb; + flp_capabilities_callback flp_capabilities_cb; + flp_status_callback flp_status_cb; +} FlpCallbacks; + + +/** Options with the batching FLP APIs */ +typedef struct { + /** + * Maximum power in mW that the underlying implementation + * can use for this batching call. + * If max_power_allocation_mW is 0, only fixes that are generated + * at no additional cost of power shall be reported. + */ + double max_power_allocation_mW; + + /** Bitwise OR of the FLP_TECH_MASKS to use */ + uint32_t sources_to_use; + + /** + * FLP_BATCH_WAKEUP_ON_FIFO_FULL - If set the hardware + * will wake up the AP when the buffer is full. If not set, the + * hardware will drop the oldest location object. + * + * FLP_BATCH_CALLBACK_ON_LOCATION_FIX - If set the location + * callback will be called every time there is a location fix. + * Its the responsibility of the upper layers (caller) to switch + * it off, if it knows that the AP might go to sleep. When this + * bit is on amidst a batching session, batching should continue + * while location fixes are reported in real time. + * + * Other flags to be bitwised ORed in the future. + */ + uint32_t flags; + + /** + * Frequency with which location needs to be batched in nano + * seconds. + */ + int64_t period_ns; + + /** + * The smallest displacement between reported locations in meters. + * + * If set to 0, then you should report locations at the requested + * interval even if the device is stationary. If positive, you + * can use this parameter as a hint to save power (e.g. throttling + * location period if the user hasn't traveled close to the displacement + * threshold). Even small positive values can be interpreted to mean + * that you don't have to compute location when the device is stationary. + * + * There is no need to filter location delivery based on this parameter. + * Locations can be delivered even if they have a displacement smaller than + * requested. This parameter can safely be ignored at the cost of potential + * power savings. + */ + float smallest_displacement_meters; +} FlpBatchOptions; + +#define FLP_RESULT_SUCCESS 0 +#define FLP_RESULT_ERROR -1 +#define FLP_RESULT_INSUFFICIENT_MEMORY -2 +#define FLP_RESULT_TOO_MANY_GEOFENCES -3 +#define FLP_RESULT_ID_EXISTS -4 +#define FLP_RESULT_ID_UNKNOWN -5 +#define FLP_RESULT_INVALID_GEOFENCE_TRANSITION -6 + +/** + * Represents the standard FLP interface. + */ +typedef struct { + /** + * set to sizeof(FlpLocationInterface) + */ + size_t size; + + /** + * Opens the interface and provides the callback routines + * to the implementation of this interface. Once called you should respond + * by calling the flp_capabilities_callback in FlpCallbacks to + * specify the capabilities that your implementation supports. + */ + int (*init)(FlpCallbacks* callbacks ); + + /** + * Return the batch size (in number of FlpLocation objects) + * available in the hardware. Note, different HW implementations + * may have different sample sizes. This shall return number + * of samples defined in the format of FlpLocation. + * This will be used by the upper layer, to decide on the batching + * interval and whether the AP should be woken up or not. + */ + int (*get_batch_size)(); + + /** + * Start batching locations. This API is primarily used when the AP is + * asleep and the device can batch locations in the hardware. + * flp_location_callback is used to return the locations. When the buffer + * is full and FLP_BATCH_WAKEUP_ON_FIFO_FULL is used, the AP is woken up. + * When the buffer is full and FLP_BATCH_WAKEUP_ON_FIFO_FULL is not set, + * the oldest location object is dropped. In this case the AP will not be + * woken up. The upper layer will use get_batched_location + * API to explicitly ask for the location. + * If FLP_BATCH_CALLBACK_ON_LOCATION_FIX is set, the implementation + * will call the flp_location_callback every single time there is a location + * fix. This overrides FLP_BATCH_WAKEUP_ON_FIFO_FULL flag setting. + * It's the responsibility of the upper layers (caller) to switch + * it off, if it knows that the AP might go to sleep. This is useful + * for nagivational applications when the system is in high power mode. + * Parameters: + * id - Id for the request. + * options - See FlpBatchOptions struct definition. + * Return value: + * FLP_RESULT_SUCCESS on success, FLP_RESULT_INSUFFICIENT_MEMORY, + * FLP_RESULT_ID_EXISTS, FLP_RESULT_ERROR on failure. + */ + int (*start_batching)(int id, FlpBatchOptions* options); + + /** + * Update FlpBatchOptions associated with a batching request. + * When a batching operation is in progress and a batching option + * such as FLP_BATCH_WAKEUP_ON_FIFO_FULL needs to be updated, this API + * will be used. For instance, this can happen when the AP is awake and + * the maps application is being used. + * Parameters: + * id - Id of an existing batch request. + * new_options - Updated FlpBatchOptions + * Return value: + * FLP_RESULT_SUCCESS on success, FLP_RESULT_ID_UNKNOWN, + * FLP_RESULT_ERROR on error. + */ + int (*update_batching_options)(int id, FlpBatchOptions* new_options); + + /** + * Stop batching. + * Parameters: + * id - Id for the request. + * Return Value: + * FLP_RESULT_SUCCESS on success, FLP_RESULT_ID_UNKNOWN or + * FLP_RESULT_ERROR on failure. + */ + int (*stop_batching)(int id); + + /** + * Closes the interface. If any batch operations are in progress, + * they should be stopped. + */ + void (*cleanup)(); + + /** + * Get the fused location that was batched. + * flp_location_callback is used to return the location. The location object + * is dropped from the buffer only when the buffer is full. Do not remove it + * from the buffer just because it has been returned using the callback. + * In other words, when there is no new location object, two calls to + * get_batched_location(1) should return the same location object. + * Parameters: + * last_n_locations - Number of locations to get. This can be one or many. + * If the last_n_locations is 1, you get the latest location known to the + * hardware. + */ + void (*get_batched_location)(int last_n_locations); + + /** + * Injects current location from another location provider + * latitude and longitude are measured in degrees + * expected accuracy is measured in meters + * Parameters: + * location - The location object being injected. + * Return value: FLP_RESULT_SUCCESS or FLP_RESULT_ERROR. + */ + int (*inject_location)(FlpLocation* location); + + /** + * Get a pointer to extension information. + */ + const void* (*get_extension)(const char* name); + + /** + * Retrieve all batched locations currently stored and clear the buffer. + * flp_location_callback MUST be called in response, even if there are + * no locations to flush (in which case num_locations should be 0). + * Subsequent calls to get_batched_location or flush_batched_locations + * should not return any of the locations returned in this call. + */ + void (*flush_batched_locations)(); +} FlpLocationInterface; + +struct flp_device_t { + struct hw_device_t common; + + /** + * Get a handle to the FLP Interface. + */ + const FlpLocationInterface* (*get_flp_interface)(struct flp_device_t* dev); +}; + +/** + * Callback for reports diagnostic data into the Java framework code. +*/ +typedef void (*report_data)(char* data, int length); + +/** + * FLP diagnostic callback structure. + * Currently, not used - but this for future extension. + */ +typedef struct { + /** set to sizeof(FlpDiagnosticCallbacks) */ + size_t size; + + flp_set_thread_event set_thread_event_cb; + + /** reports diagnostic data into the Java framework code */ + report_data data_cb; +} FlpDiagnosticCallbacks; + +/** Extended interface for diagnostic support. */ +typedef struct { + /** set to sizeof(FlpDiagnosticInterface) */ + size_t size; + + /** + * Opens the diagnostic interface and provides the callback routines + * to the implemenation of this interface. + */ + void (*init)(FlpDiagnosticCallbacks* callbacks); + + /** + * Injects diagnostic data into the FLP subsystem. + * Return 0 on success, -1 on error. + **/ + int (*inject_data)(char* data, int length ); +} FlpDiagnosticInterface; + +/** + * Context setting information. + * All these settings shall be injected to FLP HAL at FLP init time. + * Following that, only the changed setting need to be re-injected + * upon changes. + */ + +#define FLP_DEVICE_CONTEXT_GPS_ENABLED (1U<<0) +#define FLP_DEVICE_CONTEXT_AGPS_ENABLED (1U<<1) +#define FLP_DEVICE_CONTEXT_NETWORK_POSITIONING_ENABLED (1U<<2) +#define FLP_DEVICE_CONTEXT_WIFI_CONNECTIVITY_ENABLED (1U<<3) +#define FLP_DEVICE_CONTEXT_WIFI_POSITIONING_ENABLED (1U<<4) +#define FLP_DEVICE_CONTEXT_HW_NETWORK_POSITIONING_ENABLED (1U<<5) +#define FLP_DEVICE_CONTEXT_AIRPLANE_MODE_ON (1U<<6) +#define FLP_DEVICE_CONTEXT_DATA_ENABLED (1U<<7) +#define FLP_DEVICE_CONTEXT_ROAMING_ENABLED (1U<<8) +#define FLP_DEVICE_CONTEXT_CURRENTLY_ROAMING (1U<<9) +#define FLP_DEVICE_CONTEXT_SENSOR_ENABLED (1U<<10) +#define FLP_DEVICE_CONTEXT_BLUETOOTH_ENABLED (1U<<11) +#define FLP_DEVICE_CONTEXT_CHARGER_ON (1U<<12) + +/** Extended interface for device context support. */ +typedef struct { + /** set to sizeof(FlpDeviceContextInterface) */ + size_t size; + + /** + * Injects debug data into the FLP subsystem. + * Return 0 on success, -1 on error. + **/ + int (*inject_device_context)(uint32_t enabledMask); +} FlpDeviceContextInterface; + + +/** + * There are 3 states associated with a Geofence: Inside, Outside, Unknown. + * There are 3 transitions: ENTERED, EXITED, UNCERTAIN. + * + * An example state diagram with confidence level: 95% and Unknown time limit + * set as 30 secs is shown below. (confidence level and Unknown time limit are + * explained latter) + * ____________________________ + * | Unknown (30 secs) | + * """""""""""""""""""""""""""" + * ^ | | ^ + * UNCERTAIN| |ENTERED EXITED| |UNCERTAIN + * | v v | + * ________ EXITED _________ + * | Inside | -----------> | Outside | + * | | <----------- | | + * """""""" ENTERED """"""""" + * + * Inside state: We are 95% confident that the user is inside the geofence. + * Outside state: We are 95% confident that the user is outside the geofence + * Unknown state: Rest of the time. + * + * The Unknown state is better explained with an example: + * + * __________ + * | c| + * | ___ | _______ + * | |a| | | b | + * | """ | """"""" + * | | + * """""""""" + * In the diagram above, "a" and "b" are 2 geofences and "c" is the accuracy + * circle reported by the FLP subsystem. Now with regard to "b", the system is + * confident that the user is outside. But with regard to "a" is not confident + * whether it is inside or outside the geofence. If the accuracy remains the + * same for a sufficient period of time, the UNCERTAIN transition would be + * triggered with the state set to Unknown. If the accuracy improves later, an + * appropriate transition should be triggered. This "sufficient period of time" + * is defined by the parameter in the add_geofence_area API. + * In other words, Unknown state can be interpreted as a state in which the + * FLP subsystem isn't confident enough that the user is either inside or + * outside the Geofence. It moves to Unknown state only after the expiry of the + * timeout. + * + * The geofence callback needs to be triggered for the ENTERED and EXITED + * transitions, when the FLP system is confident that the user has entered + * (Inside state) or exited (Outside state) the Geofence. An implementation + * which uses a value of 95% as the confidence is recommended. The callback + * should be triggered only for the transitions requested by the + * add_geofence_area call. + * + * Even though the diagram and explanation talks about states and transitions, + * the callee is only interested in the transistions. The states are mentioned + * here for illustrative purposes. + * + * Startup Scenario: When the device boots up, if an application adds geofences, + * and then we get an accurate FLP location fix, it needs to trigger the + * appropriate (ENTERED or EXITED) transition for every Geofence it knows about. + * By default, all the Geofences will be in the Unknown state. + * + * When the FLP system is unavailable, flp_geofence_status_callback should be + * called to inform the upper layers of the same. Similarly, when it becomes + * available the callback should be called. This is a global state while the + * UNKNOWN transition described above is per geofence. + * + */ +#define FLP_GEOFENCE_TRANSITION_ENTERED (1L<<0) +#define FLP_GEOFENCE_TRANSITION_EXITED (1L<<1) +#define FLP_GEOFENCE_TRANSITION_UNCERTAIN (1L<<2) + +#define FLP_GEOFENCE_MONITOR_STATUS_UNAVAILABLE (1L<<0) +#define FLP_GEOFENCE_MONITOR_STATUS_AVAILABLE (1L<<1) + +/** + * The callback associated with the geofence. + * Parameters: + * geofence_id - The id associated with the add_geofence_area. + * location - The current location as determined by the FLP subsystem. + * transition - Can be one of FLP_GEOFENCE_TRANSITION_ENTERED, FLP_GEOFENCE_TRANSITION_EXITED, + * FLP_GEOFENCE_TRANSITION_UNCERTAIN. + * timestamp - Timestamp when the transition was detected; -1 if not available. + * sources_used - Bitwise OR of FLP_TECH_MASK flags indicating which + * subsystems were used. + * + * The callback should only be called when the caller is interested in that + * particular transition. For instance, if the caller is interested only in + * ENTERED transition, then the callback should NOT be called with the EXITED + * transition. + * + * IMPORTANT: If a transition is triggered resulting in this callback, the + * subsystem will wake up the application processor, if its in suspend state. + */ +typedef void (*flp_geofence_transition_callback) (int32_t geofence_id, FlpLocation* location, + int32_t transition, FlpUtcTime timestamp, uint32_t sources_used); + +/** + * The callback associated with the availablity of one the sources used for geofence + * monitoring by the FLP sub-system For example, if the GPS system determines that it cannot + * monitor geofences because of lack of reliability or unavailability of the GPS signals, + * it will call this callback with FLP_GEOFENCE_MONITOR_STATUS_UNAVAILABLE parameter and the + * source set to FLP_TECH_MASK_GNSS. + * + * Parameters: + * status - FLP_GEOFENCE_MONITOR_STATUS_UNAVAILABLE or FLP_GEOFENCE_MONITOR_STATUS_AVAILABLE. + * source - One of the FLP_TECH_MASKS + * last_location - Last known location. + */ +typedef void (*flp_geofence_monitor_status_callback) (int32_t status, uint32_t source, + FlpLocation* last_location); + +/** + * The callback associated with the add_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * result - FLP_RESULT_SUCCESS + * FLP_RESULT_ERROR_TOO_MANY_GEOFENCES - geofence limit has been reached. + * FLP_RESULT_ID_EXISTS - geofence with id already exists + * FLP_RESULT_INVALID_GEOFENCE_TRANSITION - the monitorTransition contains an + * invalid transition + * FLP_RESULT_ERROR - for other errors. + */ +typedef void (*flp_geofence_add_callback) (int32_t geofence_id, int32_t result); + +/** + * The callback associated with the remove_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * result - FLP_RESULT_SUCCESS + * FLP_RESULT_ID_UNKNOWN - for invalid id + * FLP_RESULT_ERROR for others. + */ +typedef void (*flp_geofence_remove_callback) (int32_t geofence_id, int32_t result); + + +/** + * The callback associated with the pause_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * result - FLP_RESULT_SUCCESS + * FLP_RESULT__ID_UNKNOWN - for invalid id + * FLP_RESULT_INVALID_TRANSITION - + * when monitor_transitions is invalid + * FLP_RESULT_ERROR for others. + */ +typedef void (*flp_geofence_pause_callback) (int32_t geofence_id, int32_t result); + +/** + * The callback associated with the resume_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * result - FLP_RESULT_SUCCESS + * FLP_RESULT_ID_UNKNOWN - for invalid id + * FLP_RESULT_ERROR for others. + */ +typedef void (*flp_geofence_resume_callback) (int32_t geofence_id, int32_t result); + +typedef struct { + /** set to sizeof(FlpGeofenceCallbacks) */ + size_t size; + flp_geofence_transition_callback geofence_transition_callback; + flp_geofence_monitor_status_callback geofence_status_callback; + flp_geofence_add_callback geofence_add_callback; + flp_geofence_remove_callback geofence_remove_callback; + flp_geofence_pause_callback geofence_pause_callback; + flp_geofence_resume_callback geofence_resume_callback; + flp_set_thread_event set_thread_event_cb; + flp_capabilities_callback flp_capabilities_cb; +} FlpGeofenceCallbacks; + + +/** Type of geofence */ +typedef enum { + TYPE_CIRCLE = 0, +} GeofenceType; + +/** Circular geofence is represented by lat / long / radius */ +typedef struct { + double latitude; + double longitude; + double radius_m; +} GeofenceCircle; + +/** Represents the type of geofence and data */ +typedef struct { + GeofenceType type; + union { + GeofenceCircle circle; + } geofence; +} GeofenceData; + +/** Geofence Options */ +typedef struct { + /** + * The current state of the geofence. For example, if + * the system already knows that the user is inside the geofence, + * this will be set to FLP_GEOFENCE_TRANSITION_ENTERED. In most cases, it + * will be FLP_GEOFENCE_TRANSITION_UNCERTAIN. */ + int last_transition; + + /** + * Transitions to monitor. Bitwise OR of + * FLP_GEOFENCE_TRANSITION_ENTERED, FLP_GEOFENCE_TRANSITION_EXITED and + * FLP_GEOFENCE_TRANSITION_UNCERTAIN. + */ + int monitor_transitions; + + /** + * Defines the best-effort description + * of how soon should the callback be called when the transition + * associated with the Geofence is triggered. For instance, if set + * to 1000 millseconds with FLP_GEOFENCE_TRANSITION_ENTERED, the callback + * should be called 1000 milliseconds within entering the geofence. + * This parameter is defined in milliseconds. + * NOTE: This is not to be confused with the rate that the GPS is + * polled at. It is acceptable to dynamically vary the rate of + * sampling the GPS for power-saving reasons; thus the rate of + * sampling may be faster or slower than this. + */ + int notification_responsivenes_ms; + + /** + * The time limit after which the UNCERTAIN transition + * should be triggered. This paramter is defined in milliseconds. + */ + int unknown_timer_ms; + + /** + * The sources to use for monitoring geofences. Its a BITWISE-OR + * of FLP_TECH_MASK flags. + */ + uint32_t sources_to_use; +} GeofenceOptions; + +/** Geofence struct */ +typedef struct { + int32_t geofence_id; + GeofenceData* data; + GeofenceOptions* options; +} Geofence; + +/** Extended interface for FLP_Geofencing support */ +typedef struct { + /** set to sizeof(FlpGeofencingInterface) */ + size_t size; + + /** + * Opens the geofence interface and provides the callback routines + * to the implemenation of this interface. Once called you should respond + * by calling the flp_capabilities_callback in FlpGeofenceCallbacks to + * specify the capabilities that your implementation supports. + */ + void (*init)( FlpGeofenceCallbacks* callbacks ); + + /** + * Add a list of geofences. + * Parameters: + * number_of_geofences - The number of geofences that needed to be added. + * geofences - Pointer to array of pointers to Geofence structure. + */ + void (*add_geofences) (int32_t number_of_geofences, Geofence** geofences); + + /** + * Pause monitoring a particular geofence. + * Parameters: + * geofence_id - The id for the geofence. + */ + void (*pause_geofence) (int32_t geofence_id); + + /** + * Resume monitoring a particular geofence. + * Parameters: + * geofence_id - The id for the geofence. + * monitor_transitions - Which transitions to monitor. Bitwise OR of + * FLP_GEOFENCE_TRANSITION_ENTERED, FLP_GEOFENCE_TRANSITION_EXITED and + * FLP_GEOFENCE_TRANSITION_UNCERTAIN. + * This supersedes the value associated provided in the + * add_geofence_area call. + */ + void (*resume_geofence) (int32_t geofence_id, int monitor_transitions); + + /** + * Modify a particular geofence option. + * Parameters: + * geofence_id - The id for the geofence. + * options - Various options associated with the geofence. See + * GeofenceOptions structure for details. + */ + void (*modify_geofence_option) (int32_t geofence_id, GeofenceOptions* options); + + /** + * Remove a list of geofences. After the function returns, no notifications + * should be sent. + * Parameter: + * number_of_geofences - The number of geofences that needed to be added. + * geofence_id - Pointer to array of geofence_ids to be removed. + */ + void (*remove_geofences) (int32_t number_of_geofences, int32_t* geofence_id); +} FlpGeofencingInterface; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_HARDWARE_FLP_H */ + diff --git a/third_party/android_hardware_libhardware/include/hardware/gatekeeper.h b/third_party/android_hardware_libhardware/include/hardware/gatekeeper.h new file mode 100644 index 000000000..2bb2b08c3 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/gatekeeper.h @@ -0,0 +1,190 @@ +/* + * Copyright (C) 2015 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_HARDWARE_GATEKEEPER_H +#define ANDROID_HARDWARE_GATEKEEPER_H + +#include +#include +#include + +__BEGIN_DECLS + +#define GATEKEEPER_HARDWARE_MODULE_ID "gatekeeper" + +#define GATEKEEPER_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) + +#define HARDWARE_GATEKEEPER "gatekeeper" + +struct gatekeeper_module { + /** + * Comon methods of the gatekeeper module. This *must* be the first member of + * gatekeeper_module as users of this structure will cast a hw_module_t to + * a gatekeeper_module pointer in the appropriate context. + */ + hw_module_t common; +}; + +struct gatekeeper_device { + /** + * Common methods of the gatekeeper device. As above, this must be the first + * member of keymaster_device. + */ + hw_device_t common; + + /** + * Enrolls desired_password, which should be derived from a user selected pin or password, + * with the authentication factor private key used only for enrolling authentication + * factor data. + * + * If there was already a password enrolled, it should be provided in + * current_password_handle, along with the current password in current_password + * that should validate against current_password_handle. + * + * Parameters: + * - dev: pointer to gatekeeper_device acquired via calls to gatekeeper_open + * - uid: the Android user identifier + * + * - current_password_handle: the currently enrolled password handle the user + * wants to replace. May be null if there's no currently enrolled password. + * - current_password_handle_length: the length in bytes of the buffer pointed + * at by current_password_handle. Must be 0 if current_password_handle is NULL. + * + * - current_password: the user's current password in plain text. If presented, + * it MUST verify against current_password_handle. + * - current_password_length: the size in bytes of the buffer pointed at by + * current_password. Must be 0 if the current_password is NULL. + * + * - desired_password: the new password the user wishes to enroll in plain-text. + * Cannot be NULL. + * - desired_password_length: the length in bytes of the buffer pointed at by + * desired_password. + * + * - enrolled_password_handle: on success, a buffer will be allocated with the + * new password handle referencing the password provided in desired_password. + * This buffer can be used on subsequent calls to enroll or verify. + * The caller is responsible for deallocating this buffer via a call to delete[] + * - enrolled_password_handle_length: pointer to the length in bytes of the buffer allocated + * by this function and pointed to by *enrolled_password_handle_length. + * + * Returns: + * - 0 on success + * - An error code < 0 on failure, or + * - A timeout value T > 0 if the call should not be re-attempted until T milliseconds + * have elapsed. + * + * On error, enrolled_password_handle will not be allocated. + */ + int (*enroll)(const struct gatekeeper_device *dev, uint32_t uid, + const uint8_t *current_password_handle, uint32_t current_password_handle_length, + const uint8_t *current_password, uint32_t current_password_length, + const uint8_t *desired_password, uint32_t desired_password_length, + uint8_t **enrolled_password_handle, uint32_t *enrolled_password_handle_length); + + /** + * Verifies provided_password matches enrolled_password_handle. + * + * Implementations of this module may retain the result of this call + * to attest to the recency of authentication. + * + * On success, writes the address of a verification token to auth_token, + * usable to attest password verification to other trusted services. Clients + * may pass NULL for this value. + * + * Parameters: + * - dev: pointer to gatekeeper_device acquired via calls to gatekeeper_open + * - uid: the Android user identifier + * + * - challenge: An optional challenge to authenticate against, or 0. Used when a separate + * authenticator requests password verification, or for transactional + * password authentication. + * + * - enrolled_password_handle: the currently enrolled password handle that the + * user wishes to verify against. + * - enrolled_password_handle_length: the length in bytes of the buffer pointed + * to by enrolled_password_handle + * + * - provided_password: the plaintext password to be verified against the + * enrolled_password_handle + * - provided_password_length: the length in bytes of the buffer pointed to by + * provided_password + * + * - auth_token: on success, a buffer containing the authentication token + * resulting from this verification is assigned to *auth_token. The caller + * is responsible for deallocating this memory via a call to delete[] + * - auth_token_length: on success, the length in bytes of the authentication + * token assigned to *auth_token will be assigned to *auth_token_length + * + * - request_reenroll: a request to the upper layers to re-enroll the verified + * password due to a version change. Not set if verification fails. + * + * Returns: + * - 0 on success + * - An error code < 0 on failure, or + * - A timeout value T > 0 if the call should not be re-attempted until T milliseconds + * have elapsed. + * On error, auth token will not be allocated + */ + int (*verify)(const struct gatekeeper_device *dev, uint32_t uid, uint64_t challenge, + const uint8_t *enrolled_password_handle, uint32_t enrolled_password_handle_length, + const uint8_t *provided_password, uint32_t provided_password_length, + uint8_t **auth_token, uint32_t *auth_token_length, bool *request_reenroll); + + /* + * Deletes the enrolled_password_handle associated wth the uid. Once deleted + * the user cannot be verified anymore. + * This function is optional and should be set to NULL if it is not implemented. + * + * Parameters + * - dev: pointer to gatekeeper_device acquired via calls to gatekeeper_open + * - uid: the Android user identifier + * + * Returns: + * - 0 on success + * - An error code < 0 on failure + */ + int (*delete_user)(const struct gatekeeper_device *dev, uint32_t uid); + + /* + * Deletes all the enrolled_password_handles for all uid's. Once called, + * no users will be enrolled on the device. + * This function is optional and should be set to NULL if it is not implemented. + * + * Parameters + * - dev: pointer to gatekeeper_device acquired via calls to gatekeeper_open + * + * Returns: + * - 0 on success + * - An error code < 0 on failure + */ + int (*delete_all_users)(const struct gatekeeper_device *dev); +}; + +typedef struct gatekeeper_device gatekeeper_device_t; + +static inline int gatekeeper_open(const struct hw_module_t *module, + gatekeeper_device_t **device) { + return module->methods->open(module, HARDWARE_GATEKEEPER, + (struct hw_device_t **) device); +} + +static inline int gatekeeper_close(gatekeeper_device_t *device) { + return device->common.close(&device->common); +} + +__END_DECLS + +#endif // ANDROID_HARDWARE_GATEKEEPER_H diff --git a/third_party/android_hardware_libhardware/include/hardware/gps.h b/third_party/android_hardware_libhardware/include/hardware/gps.h new file mode 100644 index 000000000..76b6cb7ae --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/gps.h @@ -0,0 +1,1871 @@ +/* + * Copyright (C) 2010 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_GPS_H +#define ANDROID_INCLUDE_HARDWARE_GPS_H + +#include +#include +#include +#include +#include +#include + +#include + +__BEGIN_DECLS + +/** + * The id of this module + */ +#define GPS_HARDWARE_MODULE_ID "gps" + + +/** Milliseconds since January 1, 1970 */ +typedef int64_t GpsUtcTime; + +/** Maximum number of SVs for gps_sv_status_callback(). */ +#define GPS_MAX_SVS 32 + +/** Maximum number of Measurements in gps_measurement_callback(). */ +#define GPS_MAX_MEASUREMENT 32 + +/** Requested operational mode for GPS operation. */ +typedef uint32_t GpsPositionMode; +// IMPORTANT: Note that the following values must match +// constants in GpsLocationProvider.java. +/** Mode for running GPS standalone (no assistance). */ +#define GPS_POSITION_MODE_STANDALONE 0 +/** AGPS MS-Based mode. */ +#define GPS_POSITION_MODE_MS_BASED 1 +/** + * AGPS MS-Assisted mode. This mode is not maintained by the platform anymore. + * It is strongly recommended to use GPS_POSITION_MODE_MS_BASE instead. + */ +#define GPS_POSITION_MODE_MS_ASSISTED 2 + +/** Requested recurrence mode for GPS operation. */ +typedef uint32_t GpsPositionRecurrence; +// IMPORTANT: Note that the following values must match +// constants in GpsLocationProvider.java. +/** Receive GPS fixes on a recurring basis at a specified period. */ +#define GPS_POSITION_RECURRENCE_PERIODIC 0 +/** Request a single shot GPS fix. */ +#define GPS_POSITION_RECURRENCE_SINGLE 1 + +/** GPS status event values. */ +typedef uint16_t GpsStatusValue; +// IMPORTANT: Note that the following values must match +// constants in GpsLocationProvider.java. +/** GPS status unknown. */ +#define GPS_STATUS_NONE 0 +/** GPS has begun navigating. */ +#define GPS_STATUS_SESSION_BEGIN 1 +/** GPS has stopped navigating. */ +#define GPS_STATUS_SESSION_END 2 +/** GPS has powered on but is not navigating. */ +#define GPS_STATUS_ENGINE_ON 3 +/** GPS is powered off. */ +#define GPS_STATUS_ENGINE_OFF 4 + +/** Flags to indicate which values are valid in a GpsLocation. */ +typedef uint16_t GpsLocationFlags; +// IMPORTANT: Note that the following values must match +// constants in GpsLocationProvider.java. +/** GpsLocation has valid latitude and longitude. */ +#define GPS_LOCATION_HAS_LAT_LONG 0x0001 +/** GpsLocation has valid altitude. */ +#define GPS_LOCATION_HAS_ALTITUDE 0x0002 +/** GpsLocation has valid speed. */ +#define GPS_LOCATION_HAS_SPEED 0x0004 +/** GpsLocation has valid bearing. */ +#define GPS_LOCATION_HAS_BEARING 0x0008 +/** GpsLocation has valid accuracy. */ +#define GPS_LOCATION_HAS_ACCURACY 0x0010 + +/** Flags for the gps_set_capabilities callback. */ + +/** GPS HAL schedules fixes for GPS_POSITION_RECURRENCE_PERIODIC mode. + If this is not set, then the framework will use 1000ms for min_interval + and will start and call start() and stop() to schedule the GPS. + */ +#define GPS_CAPABILITY_SCHEDULING 0x0000001 +/** GPS supports MS-Based AGPS mode */ +#define GPS_CAPABILITY_MSB 0x0000002 +/** GPS supports MS-Assisted AGPS mode */ +#define GPS_CAPABILITY_MSA 0x0000004 +/** GPS supports single-shot fixes */ +#define GPS_CAPABILITY_SINGLE_SHOT 0x0000008 +/** GPS supports on demand time injection */ +#define GPS_CAPABILITY_ON_DEMAND_TIME 0x0000010 +/** GPS supports Geofencing */ +#define GPS_CAPABILITY_GEOFENCING 0x0000020 +/** GPS supports Measurements */ +#define GPS_CAPABILITY_MEASUREMENTS 0x0000040 +/** GPS supports Navigation Messages */ +#define GPS_CAPABILITY_NAV_MESSAGES 0x0000080 + +/** Flags used to specify which aiding data to delete + when calling delete_aiding_data(). */ +typedef uint16_t GpsAidingData; +// IMPORTANT: Note that the following values must match +// constants in GpsLocationProvider.java. +#define GPS_DELETE_EPHEMERIS 0x0001 +#define GPS_DELETE_ALMANAC 0x0002 +#define GPS_DELETE_POSITION 0x0004 +#define GPS_DELETE_TIME 0x0008 +#define GPS_DELETE_IONO 0x0010 +#define GPS_DELETE_UTC 0x0020 +#define GPS_DELETE_HEALTH 0x0040 +#define GPS_DELETE_SVDIR 0x0080 +#define GPS_DELETE_SVSTEER 0x0100 +#define GPS_DELETE_SADATA 0x0200 +#define GPS_DELETE_RTI 0x0400 +#define GPS_DELETE_CELLDB_INFO 0x8000 +#define GPS_DELETE_ALL 0xFFFF + +/** AGPS type */ +typedef uint16_t AGpsType; +#define AGPS_TYPE_SUPL 1 +#define AGPS_TYPE_C2K 2 + +typedef uint16_t AGpsSetIDType; +#define AGPS_SETID_TYPE_NONE 0 +#define AGPS_SETID_TYPE_IMSI 1 +#define AGPS_SETID_TYPE_MSISDN 2 + +typedef uint16_t ApnIpType; +#define APN_IP_INVALID 0 +#define APN_IP_IPV4 1 +#define APN_IP_IPV6 2 +#define APN_IP_IPV4V6 3 + +/** + * String length constants + */ +#define GPS_NI_SHORT_STRING_MAXLEN 256 +#define GPS_NI_LONG_STRING_MAXLEN 2048 + +/** + * GpsNiType constants + */ +typedef uint32_t GpsNiType; +#define GPS_NI_TYPE_VOICE 1 +#define GPS_NI_TYPE_UMTS_SUPL 2 +#define GPS_NI_TYPE_UMTS_CTRL_PLANE 3 + +/** + * GpsNiNotifyFlags constants + */ +typedef uint32_t GpsNiNotifyFlags; +/** NI requires notification */ +#define GPS_NI_NEED_NOTIFY 0x0001 +/** NI requires verification */ +#define GPS_NI_NEED_VERIFY 0x0002 +/** NI requires privacy override, no notification/minimal trace */ +#define GPS_NI_PRIVACY_OVERRIDE 0x0004 + +/** + * GPS NI responses, used to define the response in + * NI structures + */ +typedef int GpsUserResponseType; +#define GPS_NI_RESPONSE_ACCEPT 1 +#define GPS_NI_RESPONSE_DENY 2 +#define GPS_NI_RESPONSE_NORESP 3 + +/** + * NI data encoding scheme + */ +typedef int GpsNiEncodingType; +#define GPS_ENC_NONE 0 +#define GPS_ENC_SUPL_GSM_DEFAULT 1 +#define GPS_ENC_SUPL_UTF8 2 +#define GPS_ENC_SUPL_UCS2 3 +#define GPS_ENC_UNKNOWN -1 + +/** AGPS status event values. */ +typedef uint16_t AGpsStatusValue; +/** GPS requests data connection for AGPS. */ +#define GPS_REQUEST_AGPS_DATA_CONN 1 +/** GPS releases the AGPS data connection. */ +#define GPS_RELEASE_AGPS_DATA_CONN 2 +/** AGPS data connection initiated */ +#define GPS_AGPS_DATA_CONNECTED 3 +/** AGPS data connection completed */ +#define GPS_AGPS_DATA_CONN_DONE 4 +/** AGPS data connection failed */ +#define GPS_AGPS_DATA_CONN_FAILED 5 + +#define AGPS_REF_LOCATION_TYPE_GSM_CELLID 1 +#define AGPS_REF_LOCATION_TYPE_UMTS_CELLID 2 +#define AGPS_REG_LOCATION_TYPE_MAC 3 + +/** Network types for update_network_state "type" parameter */ +#define AGPS_RIL_NETWORK_TYPE_MOBILE 0 +#define AGPS_RIL_NETWORK_TYPE_WIFI 1 +#define AGPS_RIL_NETWORK_TYPE_MOBILE_MMS 2 +#define AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL 3 +#define AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN 4 +#define AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI 5 +#define AGPS_RIL_NETWORK_TTYPE_WIMAX 6 + +/** + * Flags to indicate what fields in GpsClock are valid. + */ +typedef uint16_t GpsClockFlags; +/** A valid 'leap second' is stored in the data structure. */ +#define GPS_CLOCK_HAS_LEAP_SECOND (1<<0) +/** A valid 'time uncertainty' is stored in the data structure. */ +#define GPS_CLOCK_HAS_TIME_UNCERTAINTY (1<<1) +/** A valid 'full bias' is stored in the data structure. */ +#define GPS_CLOCK_HAS_FULL_BIAS (1<<2) +/** A valid 'bias' is stored in the data structure. */ +#define GPS_CLOCK_HAS_BIAS (1<<3) +/** A valid 'bias uncertainty' is stored in the data structure. */ +#define GPS_CLOCK_HAS_BIAS_UNCERTAINTY (1<<4) +/** A valid 'drift' is stored in the data structure. */ +#define GPS_CLOCK_HAS_DRIFT (1<<5) +/** A valid 'drift uncertainty' is stored in the data structure. */ +#define GPS_CLOCK_HAS_DRIFT_UNCERTAINTY (1<<6) + +/** + * Enumeration of the available values for the GPS Clock type. + */ +typedef uint8_t GpsClockType; +/** The type is not available ot it is unknown. */ +#define GPS_CLOCK_TYPE_UNKNOWN 0 +/** The source of the time value reported by GPS clock is the local hardware clock. */ +#define GPS_CLOCK_TYPE_LOCAL_HW_TIME 1 +/** + * The source of the time value reported by GPS clock is the GPS time derived from satellites + * (epoch = Jan 6, 1980) + */ +#define GPS_CLOCK_TYPE_GPS_TIME 2 + +/** + * Flags to indicate what fields in GpsMeasurement are valid. + */ +typedef uint32_t GpsMeasurementFlags; +/** A valid 'snr' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_SNR (1<<0) +/** A valid 'elevation' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_ELEVATION (1<<1) +/** A valid 'elevation uncertainty' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY (1<<2) +/** A valid 'azimuth' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_AZIMUTH (1<<3) +/** A valid 'azimuth uncertainty' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY (1<<4) +/** A valid 'pseudorange' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_PSEUDORANGE (1<<5) +/** A valid 'pseudorange uncertainty' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY (1<<6) +/** A valid 'code phase' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_CODE_PHASE (1<<7) +/** A valid 'code phase uncertainty' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY (1<<8) +/** A valid 'carrier frequency' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY (1<<9) +/** A valid 'carrier cycles' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_CARRIER_CYCLES (1<<10) +/** A valid 'carrier phase' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_CARRIER_PHASE (1<<11) +/** A valid 'carrier phase uncertainty' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY (1<<12) +/** A valid 'bit number' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_BIT_NUMBER (1<<13) +/** A valid 'time from last bit' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT (1<<14) +/** A valid 'doppler shift' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_DOPPLER_SHIFT (1<<15) +/** A valid 'doppler shift uncertainty' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY (1<<16) +/** A valid 'used in fix' flag is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_USED_IN_FIX (1<<17) +/** The value of 'pseudorange rate' is uncorrected. */ +#define GPS_MEASUREMENT_HAS_UNCORRECTED_PSEUDORANGE_RATE (1<<18) + +/** + * Enumeration of the available values for the GPS Measurement's loss of lock. + */ +typedef uint8_t GpsLossOfLock; +/** The indicator is not available or it is unknown. */ +#define GPS_LOSS_OF_LOCK_UNKNOWN 0 +/** The measurement does not present any indication of loss of lock. */ +#define GPS_LOSS_OF_LOCK_OK 1 +/** Loss of lock between previous and current observation: cycle slip possible. */ +#define GPS_LOSS_OF_LOCK_CYCLE_SLIP 2 + +/** + * Enumeration of available values for the GPS Measurement's multipath indicator. + */ +typedef uint8_t GpsMultipathIndicator; +/** The indicator is not available or unknown. */ +#define GPS_MULTIPATH_INDICATOR_UNKNOWN 0 +/** The measurement has been indicated to use multipath. */ +#define GPS_MULTIPATH_INDICATOR_DETECTED 1 +/** The measurement has been indicated Not to use multipath. */ +#define GPS_MULTIPATH_INDICATOR_NOT_USED 2 + +/** + * Flags indicating the GPS measurement state. + * The expected behavior here is for GPS HAL to set all the flags that applies. For + * example, if the state for a satellite is only C/A code locked and bit synchronized, + * and there is still millisecond ambiguity, the state should be set as: + * GPS_MEASUREMENT_STATE_CODE_LOCK|GPS_MEASUREMENT_STATE_BIT_SYNC|GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS + * If GPS is still searching for a satellite, the corresponding state should be set to + * GPS_MEASUREMENT_STATE_UNKNOWN(0). + */ +typedef uint16_t GpsMeasurementState; +#define GPS_MEASUREMENT_STATE_UNKNOWN 0 +#define GPS_MEASUREMENT_STATE_CODE_LOCK (1<<0) +#define GPS_MEASUREMENT_STATE_BIT_SYNC (1<<1) +#define GPS_MEASUREMENT_STATE_SUBFRAME_SYNC (1<<2) +#define GPS_MEASUREMENT_STATE_TOW_DECODED (1<<3) +#define GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS (1<<4) + +/** + * Flags indicating the Accumulated Delta Range's states. + */ +typedef uint16_t GpsAccumulatedDeltaRangeState; +#define GPS_ADR_STATE_UNKNOWN 0 +#define GPS_ADR_STATE_VALID (1<<0) +#define GPS_ADR_STATE_RESET (1<<1) +#define GPS_ADR_STATE_CYCLE_SLIP (1<<2) + +/** + * Enumeration of available values to indicate the available GPS Navigation message types. + */ +typedef uint8_t GpsNavigationMessageType; +/** The message type is unknown. */ +#define GPS_NAVIGATION_MESSAGE_TYPE_UNKNOWN 0 +/** L1 C/A message contained in the structure. */ +#define GPS_NAVIGATION_MESSAGE_TYPE_L1CA 1 +/** L2-CNAV message contained in the structure. */ +#define GPS_NAVIGATION_MESSAGE_TYPE_L2CNAV 2 +/** L5-CNAV message contained in the structure. */ +#define GPS_NAVIGATION_MESSAGE_TYPE_L5CNAV 3 +/** CNAV-2 message contained in the structure. */ +#define GPS_NAVIGATION_MESSAGE_TYPE_CNAV2 4 + +/** + * Status of Navigation Message + * When a message is received properly without any parity error in its navigation words, the + * status should be set to NAV_MESSAGE_STATUS_PARITY_PASSED. But if a message is received + * with words that failed parity check, but GPS is able to correct those words, the status + * should be set to NAV_MESSAGE_STATUS_PARITY_REBUILT. + * No need to send any navigation message that contains words with parity error and cannot be + * corrected. + */ +typedef uint16_t NavigationMessageStatus; +#define NAV_MESSAGE_STATUS_UNKONW 0 +#define NAV_MESSAGE_STATUS_PARITY_PASSED (1<<0) +#define NAV_MESSAGE_STATUS_PARITY_REBUILT (1<<1) + +/** + * Name for the GPS XTRA interface. + */ +#define GPS_XTRA_INTERFACE "gps-xtra" + +/** + * Name for the GPS DEBUG interface. + */ +#define GPS_DEBUG_INTERFACE "gps-debug" + +/** + * Name for the AGPS interface. + */ +#define AGPS_INTERFACE "agps" + +/** + * Name of the Supl Certificate interface. + */ +#define SUPL_CERTIFICATE_INTERFACE "supl-certificate" + +/** + * Name for NI interface + */ +#define GPS_NI_INTERFACE "gps-ni" + +/** + * Name for the AGPS-RIL interface. + */ +#define AGPS_RIL_INTERFACE "agps_ril" + +/** + * Name for the GPS_Geofencing interface. + */ +#define GPS_GEOFENCING_INTERFACE "gps_geofencing" + +/** + * Name of the GPS Measurements interface. + */ +#define GPS_MEASUREMENT_INTERFACE "gps_measurement" + +/** + * Name of the GPS navigation message interface. + */ +#define GPS_NAVIGATION_MESSAGE_INTERFACE "gps_navigation_message" + +/** + * Name of the GNSS/GPS configuration interface. + */ +#define GNSS_CONFIGURATION_INTERFACE "gnss_configuration" + + +/** Represents a location. */ +typedef struct { + /** set to sizeof(GpsLocation) */ + size_t size; + /** Contains GpsLocationFlags bits. */ + uint16_t flags; + /** Represents latitude in degrees. */ + double latitude; + /** Represents longitude in degrees. */ + double longitude; + /** Represents altitude in meters above the WGS 84 reference + * ellipsoid. */ + double altitude; + /** Represents speed in meters per second. */ + float speed; + /** Represents heading in degrees. */ + float bearing; + /** Represents expected accuracy in meters. */ + float accuracy; + /** Timestamp for the location fix. */ + GpsUtcTime timestamp; +} GpsLocation; + +/** Represents the status. */ +typedef struct { + /** set to sizeof(GpsStatus) */ + size_t size; + GpsStatusValue status; +} GpsStatus; + +/** Represents SV information. */ +typedef struct { + /** set to sizeof(GpsSvInfo) */ + size_t size; + /** Pseudo-random number for the SV. */ + int prn; + /** Signal to noise ratio. */ + float snr; + /** Elevation of SV in degrees. */ + float elevation; + /** Azimuth of SV in degrees. */ + float azimuth; +} GpsSvInfo; + +/** Represents SV status. */ +typedef struct { + /** set to sizeof(GpsSvStatus) */ + size_t size; + + /** Number of SVs currently visible. */ + int num_svs; + + /** Contains an array of SV information. */ + GpsSvInfo sv_list[GPS_MAX_SVS]; + + /** Represents a bit mask indicating which SVs + * have ephemeris data. + */ + uint32_t ephemeris_mask; + + /** Represents a bit mask indicating which SVs + * have almanac data. + */ + uint32_t almanac_mask; + + /** + * Represents a bit mask indicating which SVs + * were used for computing the most recent position fix. + */ + uint32_t used_in_fix_mask; +} GpsSvStatus; + + +/* 2G and 3G */ +/* In 3G lac is discarded */ +typedef struct { + uint16_t type; + uint16_t mcc; + uint16_t mnc; + uint16_t lac; + uint32_t cid; +} AGpsRefLocationCellID; + +typedef struct { + uint8_t mac[6]; +} AGpsRefLocationMac; + +/** Represents ref locations */ +typedef struct { + uint16_t type; + union { + AGpsRefLocationCellID cellID; + AGpsRefLocationMac mac; + } u; +} AGpsRefLocation; + +/** Callback with location information. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* gps_location_callback)(GpsLocation* location); + +/** Callback with status information. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* gps_status_callback)(GpsStatus* status); + +/** + * Callback with SV status information. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* gps_sv_status_callback)(GpsSvStatus* sv_info); + +/** Callback for reporting NMEA sentences. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* gps_nmea_callback)(GpsUtcTime timestamp, const char* nmea, int length); + +/** Callback to inform framework of the GPS engine's capabilities. + * Capability parameter is a bit field of GPS_CAPABILITY_* flags. + */ +typedef void (* gps_set_capabilities)(uint32_t capabilities); + +/** Callback utility for acquiring the GPS wakelock. + * This can be used to prevent the CPU from suspending while handling GPS events. + */ +typedef void (* gps_acquire_wakelock)(); + +/** Callback utility for releasing the GPS wakelock. */ +typedef void (* gps_release_wakelock)(); + +/** Callback for requesting NTP time */ +typedef void (* gps_request_utc_time)(); + +/** Callback for creating a thread that can call into the Java framework code. + * This must be used to create any threads that report events up to the framework. + */ +typedef pthread_t (* gps_create_thread)(const char* name, void (*start)(void *), void* arg); + +/** GPS callback structure. */ +typedef struct { + /** set to sizeof(GpsCallbacks) */ + size_t size; + gps_location_callback location_cb; + gps_status_callback status_cb; + gps_sv_status_callback sv_status_cb; + gps_nmea_callback nmea_cb; + gps_set_capabilities set_capabilities_cb; + gps_acquire_wakelock acquire_wakelock_cb; + gps_release_wakelock release_wakelock_cb; + gps_create_thread create_thread_cb; + gps_request_utc_time request_utc_time_cb; +} GpsCallbacks; + + +/** Represents the standard GPS interface. */ +typedef struct { + /** set to sizeof(GpsInterface) */ + size_t size; + /** + * Opens the interface and provides the callback routines + * to the implementation of this interface. + */ + int (*init)( GpsCallbacks* callbacks ); + + /** Starts navigating. */ + int (*start)( void ); + + /** Stops navigating. */ + int (*stop)( void ); + + /** Closes the interface. */ + void (*cleanup)( void ); + + /** Injects the current time. */ + int (*inject_time)(GpsUtcTime time, int64_t timeReference, + int uncertainty); + + /** Injects current location from another location provider + * (typically cell ID). + * latitude and longitude are measured in degrees + * expected accuracy is measured in meters + */ + int (*inject_location)(double latitude, double longitude, float accuracy); + + /** + * Specifies that the next call to start will not use the + * information defined in the flags. GPS_DELETE_ALL is passed for + * a cold start. + */ + void (*delete_aiding_data)(GpsAidingData flags); + + /** + * min_interval represents the time between fixes in milliseconds. + * preferred_accuracy represents the requested fix accuracy in meters. + * preferred_time represents the requested time to first fix in milliseconds. + * + * 'mode' parameter should be one of GPS_POSITION_MODE_MS_BASE + * or GPS_POSITION_MODE_STANDALONE. + * It is allowed by the platform (and it is recommended) to fallback to + * GPS_POSITION_MODE_MS_BASE if GPS_POSITION_MODE_MS_ASSISTED is passed in, and + * GPS_POSITION_MODE_MS_BASED is supported. + */ + int (*set_position_mode)(GpsPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); + + /** Get a pointer to extension information. */ + const void* (*get_extension)(const char* name); +} GpsInterface; + +/** Callback to request the client to download XTRA data. + * The client should download XTRA data and inject it by calling inject_xtra_data(). + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* gps_xtra_download_request)(); + +/** Callback structure for the XTRA interface. */ +typedef struct { + gps_xtra_download_request download_request_cb; + gps_create_thread create_thread_cb; +} GpsXtraCallbacks; + +/** Extended interface for XTRA support. */ +typedef struct { + /** set to sizeof(GpsXtraInterface) */ + size_t size; + /** + * Opens the XTRA interface and provides the callback routines + * to the implementation of this interface. + */ + int (*init)( GpsXtraCallbacks* callbacks ); + /** Injects XTRA data into the GPS. */ + int (*inject_xtra_data)( char* data, int length ); +} GpsXtraInterface; + +/** Extended interface for DEBUG support. */ +typedef struct { + /** set to sizeof(GpsDebugInterface) */ + size_t size; + + /** + * This function should return any information that the native + * implementation wishes to include in a bugreport. + */ + size_t (*get_internal_state)(char* buffer, size_t bufferSize); +} GpsDebugInterface; + +#pragma pack(push,4) +// We need to keep the alignment of this data structure to 4-bytes, to ensure that in 64-bit +// environments the size of this legacy definition does not collide with _v2. Implementations should +// be using _v2 and _v3, so it's OK to pay the 'unaligned' penalty in 64-bit if an old +// implementation is still in use. + +/** Represents the status of AGPS. */ +typedef struct { + /** set to sizeof(AGpsStatus_v1) */ + size_t size; + + AGpsType type; + AGpsStatusValue status; +} AGpsStatus_v1; + +#pragma pack(pop) + +/** Represents the status of AGPS augmented with a IPv4 address field. */ +typedef struct { + /** set to sizeof(AGpsStatus_v2) */ + size_t size; + + AGpsType type; + AGpsStatusValue status; + uint32_t ipaddr; +} AGpsStatus_v2; + +/* Represents the status of AGPS augmented to support IPv4 and IPv6. */ +typedef struct { + /** set to sizeof(AGpsStatus_v3) */ + size_t size; + + AGpsType type; + AGpsStatusValue status; + + /** + * Must be set to a valid IPv4 address if the field 'addr' contains an IPv4 + * address, or set to INADDR_NONE otherwise. + */ + uint32_t ipaddr; + + /** + * Must contain the IPv4 (AF_INET) or IPv6 (AF_INET6) address to report. + * Any other value of addr.ss_family will be rejected. + * */ + struct sockaddr_storage addr; +} AGpsStatus_v3; + +typedef AGpsStatus_v3 AGpsStatus; + +/** Callback with AGPS status information. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* agps_status_callback)(AGpsStatus* status); + +/** Callback structure for the AGPS interface. */ +typedef struct { + agps_status_callback status_cb; + gps_create_thread create_thread_cb; +} AGpsCallbacks; + + +/** Extended interface for AGPS support. */ +typedef struct { + /** set to sizeof(AGpsInterface_v1) */ + size_t size; + + /** + * Opens the AGPS interface and provides the callback routines + * to the implementation of this interface. + */ + void (*init)( AGpsCallbacks* callbacks ); + /** + * Notifies that a data connection is available and sets + * the name of the APN to be used for SUPL. + */ + int (*data_conn_open)( const char* apn ); + /** + * Notifies that the AGPS data connection has been closed. + */ + int (*data_conn_closed)(); + /** + * Notifies that a data connection is not available for AGPS. + */ + int (*data_conn_failed)(); + /** + * Sets the hostname and port for the AGPS server. + */ + int (*set_server)( AGpsType type, const char* hostname, int port ); +} AGpsInterface_v1; + +/** + * Extended interface for AGPS support, it is augmented to enable to pass + * extra APN data. + */ +typedef struct { + /** set to sizeof(AGpsInterface_v2) */ + size_t size; + + /** + * Opens the AGPS interface and provides the callback routines to the + * implementation of this interface. + */ + void (*init)(AGpsCallbacks* callbacks); + /** + * Deprecated. + * If the HAL supports AGpsInterface_v2 this API will not be used, see + * data_conn_open_with_apn_ip_type for more information. + */ + int (*data_conn_open)(const char* apn); + /** + * Notifies that the AGPS data connection has been closed. + */ + int (*data_conn_closed)(); + /** + * Notifies that a data connection is not available for AGPS. + */ + int (*data_conn_failed)(); + /** + * Sets the hostname and port for the AGPS server. + */ + int (*set_server)(AGpsType type, const char* hostname, int port); + + /** + * Notifies that a data connection is available and sets the name of the + * APN, and its IP type, to be used for SUPL connections. + */ + int (*data_conn_open_with_apn_ip_type)( + const char* apn, + ApnIpType apnIpType); +} AGpsInterface_v2; + +typedef AGpsInterface_v2 AGpsInterface; + +/** Error codes associated with certificate operations */ +#define AGPS_CERTIFICATE_OPERATION_SUCCESS 0 +#define AGPS_CERTIFICATE_ERROR_GENERIC -100 +#define AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES -101 + +/** A data structure that represents an X.509 certificate using DER encoding */ +typedef struct { + size_t length; + u_char* data; +} DerEncodedCertificate; + +/** + * A type definition for SHA1 Fingerprints used to identify X.509 Certificates + * The Fingerprint is a digest of the DER Certificate that uniquely identifies it. + */ +typedef struct { + u_char data[20]; +} Sha1CertificateFingerprint; + +/** AGPS Interface to handle SUPL certificate operations */ +typedef struct { + /** set to sizeof(SuplCertificateInterface) */ + size_t size; + + /** + * Installs a set of Certificates used for SUPL connections to the AGPS server. + * If needed the HAL should find out internally any certificates that need to be removed to + * accommodate the certificates to install. + * The certificates installed represent a full set of valid certificates needed to connect to + * AGPS SUPL servers. + * The list of certificates is required, and all must be available at the same time, when trying + * to establish a connection with the AGPS Server. + * + * Parameters: + * certificates - A pointer to an array of DER encoded certificates that are need to be + * installed in the HAL. + * length - The number of certificates to install. + * Returns: + * AGPS_CERTIFICATE_OPERATION_SUCCESS if the operation is completed successfully + * AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES if the HAL cannot store the number of + * certificates attempted to be installed, the state of the certificates stored should + * remain the same as before on this error case. + * + * IMPORTANT: + * If needed the HAL should find out internally the set of certificates that need to be + * removed to accommodate the certificates to install. + */ + int (*install_certificates) ( const DerEncodedCertificate* certificates, size_t length ); + + /** + * Notifies the HAL that a list of certificates used for SUPL connections are revoked. It is + * expected that the given set of certificates is removed from the internal store of the HAL. + * + * Parameters: + * fingerprints - A pointer to an array of SHA1 Fingerprints to identify the set of + * certificates to revoke. + * length - The number of fingerprints provided. + * Returns: + * AGPS_CERTIFICATE_OPERATION_SUCCESS if the operation is completed successfully. + * + * IMPORTANT: + * If any of the certificates provided (through its fingerprint) is not known by the HAL, + * it should be ignored and continue revoking/deleting the rest of them. + */ + int (*revoke_certificates) ( const Sha1CertificateFingerprint* fingerprints, size_t length ); +} SuplCertificateInterface; + +/** Represents an NI request */ +typedef struct { + /** set to sizeof(GpsNiNotification) */ + size_t size; + + /** + * An ID generated by HAL to associate NI notifications and UI + * responses + */ + int notification_id; + + /** + * An NI type used to distinguish different categories of NI + * events, such as GPS_NI_TYPE_VOICE, GPS_NI_TYPE_UMTS_SUPL, ... + */ + GpsNiType ni_type; + + /** + * Notification/verification options, combinations of GpsNiNotifyFlags constants + */ + GpsNiNotifyFlags notify_flags; + + /** + * Timeout period to wait for user response. + * Set to 0 for no time out limit. + */ + int timeout; + + /** + * Default response when time out. + */ + GpsUserResponseType default_response; + + /** + * Requestor ID + */ + char requestor_id[GPS_NI_SHORT_STRING_MAXLEN]; + + /** + * Notification message. It can also be used to store client_id in some cases + */ + char text[GPS_NI_LONG_STRING_MAXLEN]; + + /** + * Client name decoding scheme + */ + GpsNiEncodingType requestor_id_encoding; + + /** + * Client name decoding scheme + */ + GpsNiEncodingType text_encoding; + + /** + * A pointer to extra data. Format: + * key_1 = value_1 + * key_2 = value_2 + */ + char extras[GPS_NI_LONG_STRING_MAXLEN]; + +} GpsNiNotification; + +/** Callback with NI notification. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (*gps_ni_notify_callback)(GpsNiNotification *notification); + +/** GPS NI callback structure. */ +typedef struct +{ + /** + * Sends the notification request from HAL to GPSLocationProvider. + */ + gps_ni_notify_callback notify_cb; + gps_create_thread create_thread_cb; +} GpsNiCallbacks; + +/** + * Extended interface for Network-initiated (NI) support. + */ +typedef struct +{ + /** set to sizeof(GpsNiInterface) */ + size_t size; + + /** Registers the callbacks for HAL to use. */ + void (*init) (GpsNiCallbacks *callbacks); + + /** Sends a response to HAL. */ + void (*respond) (int notif_id, GpsUserResponseType user_response); +} GpsNiInterface; + +struct gps_device_t { + struct hw_device_t common; + + /** + * Set the provided lights to the provided values. + * + * Returns: 0 on succes, error code on failure. + */ + const GpsInterface* (*get_gps_interface)(struct gps_device_t* dev); +}; + +#define AGPS_RIL_REQUEST_SETID_IMSI (1<<0L) +#define AGPS_RIL_REQUEST_SETID_MSISDN (1<<1L) + +#define AGPS_RIL_REQUEST_REFLOC_CELLID (1<<0L) +#define AGPS_RIL_REQUEST_REFLOC_MAC (1<<1L) + +typedef void (*agps_ril_request_set_id)(uint32_t flags); +typedef void (*agps_ril_request_ref_loc)(uint32_t flags); + +typedef struct { + agps_ril_request_set_id request_setid; + agps_ril_request_ref_loc request_refloc; + gps_create_thread create_thread_cb; +} AGpsRilCallbacks; + +/** Extended interface for AGPS_RIL support. */ +typedef struct { + /** set to sizeof(AGpsRilInterface) */ + size_t size; + /** + * Opens the AGPS interface and provides the callback routines + * to the implementation of this interface. + */ + void (*init)( AGpsRilCallbacks* callbacks ); + + /** + * Sets the reference location. + */ + void (*set_ref_location) (const AGpsRefLocation *agps_reflocation, size_t sz_struct); + /** + * Sets the set ID. + */ + void (*set_set_id) (AGpsSetIDType type, const char* setid); + + /** + * Send network initiated message. + */ + void (*ni_message) (uint8_t *msg, size_t len); + + /** + * Notify GPS of network status changes. + * These parameters match values in the android.net.NetworkInfo class. + */ + void (*update_network_state) (int connected, int type, int roaming, const char* extra_info); + + /** + * Notify GPS of network status changes. + * These parameters match values in the android.net.NetworkInfo class. + */ + void (*update_network_availability) (int avaiable, const char* apn); +} AGpsRilInterface; + +/** + * GPS Geofence. + * There are 3 states associated with a Geofence: Inside, Outside, Unknown. + * There are 3 transitions: ENTERED, EXITED, UNCERTAIN. + * + * An example state diagram with confidence level: 95% and Unknown time limit + * set as 30 secs is shown below. (confidence level and Unknown time limit are + * explained latter) + * ____________________________ + * | Unknown (30 secs) | + * """""""""""""""""""""""""""" + * ^ | | ^ + * UNCERTAIN| |ENTERED EXITED| |UNCERTAIN + * | v v | + * ________ EXITED _________ + * | Inside | -----------> | Outside | + * | | <----------- | | + * """""""" ENTERED """"""""" + * + * Inside state: We are 95% confident that the user is inside the geofence. + * Outside state: We are 95% confident that the user is outside the geofence + * Unknown state: Rest of the time. + * + * The Unknown state is better explained with an example: + * + * __________ + * | c| + * | ___ | _______ + * | |a| | | b | + * | """ | """"""" + * | | + * """""""""" + * In the diagram above, "a" and "b" are 2 geofences and "c" is the accuracy + * circle reported by the GPS subsystem. Now with regard to "b", the system is + * confident that the user is outside. But with regard to "a" is not confident + * whether it is inside or outside the geofence. If the accuracy remains the + * same for a sufficient period of time, the UNCERTAIN transition would be + * triggered with the state set to Unknown. If the accuracy improves later, an + * appropriate transition should be triggered. This "sufficient period of time" + * is defined by the parameter in the add_geofence_area API. + * In other words, Unknown state can be interpreted as a state in which the + * GPS subsystem isn't confident enough that the user is either inside or + * outside the Geofence. It moves to Unknown state only after the expiry of the + * timeout. + * + * The geofence callback needs to be triggered for the ENTERED and EXITED + * transitions, when the GPS system is confident that the user has entered + * (Inside state) or exited (Outside state) the Geofence. An implementation + * which uses a value of 95% as the confidence is recommended. The callback + * should be triggered only for the transitions requested by the + * add_geofence_area call. + * + * Even though the diagram and explanation talks about states and transitions, + * the callee is only interested in the transistions. The states are mentioned + * here for illustrative purposes. + * + * Startup Scenario: When the device boots up, if an application adds geofences, + * and then we get an accurate GPS location fix, it needs to trigger the + * appropriate (ENTERED or EXITED) transition for every Geofence it knows about. + * By default, all the Geofences will be in the Unknown state. + * + * When the GPS system is unavailable, gps_geofence_status_callback should be + * called to inform the upper layers of the same. Similarly, when it becomes + * available the callback should be called. This is a global state while the + * UNKNOWN transition described above is per geofence. + * + * An important aspect to note is that users of this API (framework), will use + * other subsystems like wifi, sensors, cell to handle Unknown case and + * hopefully provide a definitive state transition to the third party + * application. GPS Geofence will just be a signal indicating what the GPS + * subsystem knows about the Geofence. + * + */ +#define GPS_GEOFENCE_ENTERED (1<<0L) +#define GPS_GEOFENCE_EXITED (1<<1L) +#define GPS_GEOFENCE_UNCERTAIN (1<<2L) + +#define GPS_GEOFENCE_UNAVAILABLE (1<<0L) +#define GPS_GEOFENCE_AVAILABLE (1<<1L) + +#define GPS_GEOFENCE_OPERATION_SUCCESS 0 +#define GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES -100 +#define GPS_GEOFENCE_ERROR_ID_EXISTS -101 +#define GPS_GEOFENCE_ERROR_ID_UNKNOWN -102 +#define GPS_GEOFENCE_ERROR_INVALID_TRANSITION -103 +#define GPS_GEOFENCE_ERROR_GENERIC -149 + +/** + * The callback associated with the geofence. + * Parameters: + * geofence_id - The id associated with the add_geofence_area. + * location - The current GPS location. + * transition - Can be one of GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED, + * GPS_GEOFENCE_UNCERTAIN. + * timestamp - Timestamp when the transition was detected. + * + * The callback should only be called when the caller is interested in that + * particular transition. For instance, if the caller is interested only in + * ENTERED transition, then the callback should NOT be called with the EXITED + * transition. + * + * IMPORTANT: If a transition is triggered resulting in this callback, the GPS + * subsystem will wake up the application processor, if its in suspend state. + */ +typedef void (*gps_geofence_transition_callback) (int32_t geofence_id, GpsLocation* location, + int32_t transition, GpsUtcTime timestamp); + +/** + * The callback associated with the availability of the GPS system for geofencing + * monitoring. If the GPS system determines that it cannot monitor geofences + * because of lack of reliability or unavailability of the GPS signals, it will + * call this callback with GPS_GEOFENCE_UNAVAILABLE parameter. + * + * Parameters: + * status - GPS_GEOFENCE_UNAVAILABLE or GPS_GEOFENCE_AVAILABLE. + * last_location - Last known location. + */ +typedef void (*gps_geofence_status_callback) (int32_t status, GpsLocation* last_location); + +/** + * The callback associated with the add_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - GPS_GEOFENCE_OPERATION_SUCCESS + * GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES - geofence limit has been reached. + * GPS_GEOFENCE_ERROR_ID_EXISTS - geofence with id already exists + * GPS_GEOFENCE_ERROR_INVALID_TRANSITION - the monitorTransition contains an + * invalid transition + * GPS_GEOFENCE_ERROR_GENERIC - for other errors. + */ +typedef void (*gps_geofence_add_callback) (int32_t geofence_id, int32_t status); + +/** + * The callback associated with the remove_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - GPS_GEOFENCE_OPERATION_SUCCESS + * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id + * GPS_GEOFENCE_ERROR_GENERIC for others. + */ +typedef void (*gps_geofence_remove_callback) (int32_t geofence_id, int32_t status); + + +/** + * The callback associated with the pause_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - GPS_GEOFENCE_OPERATION_SUCCESS + * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id + * GPS_GEOFENCE_ERROR_INVALID_TRANSITION - + * when monitor_transitions is invalid + * GPS_GEOFENCE_ERROR_GENERIC for others. + */ +typedef void (*gps_geofence_pause_callback) (int32_t geofence_id, int32_t status); + +/** + * The callback associated with the resume_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - GPS_GEOFENCE_OPERATION_SUCCESS + * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id + * GPS_GEOFENCE_ERROR_GENERIC for others. + */ +typedef void (*gps_geofence_resume_callback) (int32_t geofence_id, int32_t status); + +typedef struct { + gps_geofence_transition_callback geofence_transition_callback; + gps_geofence_status_callback geofence_status_callback; + gps_geofence_add_callback geofence_add_callback; + gps_geofence_remove_callback geofence_remove_callback; + gps_geofence_pause_callback geofence_pause_callback; + gps_geofence_resume_callback geofence_resume_callback; + gps_create_thread create_thread_cb; +} GpsGeofenceCallbacks; + +/** Extended interface for GPS_Geofencing support */ +typedef struct { + /** set to sizeof(GpsGeofencingInterface) */ + size_t size; + + /** + * Opens the geofence interface and provides the callback routines + * to the implementation of this interface. + */ + void (*init)( GpsGeofenceCallbacks* callbacks ); + + /** + * Add a geofence area. This api currently supports circular geofences. + * Parameters: + * geofence_id - The id for the geofence. If a geofence with this id + * already exists, an error value (GPS_GEOFENCE_ERROR_ID_EXISTS) + * should be returned. + * latitude, longtitude, radius_meters - The lat, long and radius + * (in meters) for the geofence + * last_transition - The current state of the geofence. For example, if + * the system already knows that the user is inside the geofence, + * this will be set to GPS_GEOFENCE_ENTERED. In most cases, it + * will be GPS_GEOFENCE_UNCERTAIN. + * monitor_transition - Which transitions to monitor. Bitwise OR of + * GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and + * GPS_GEOFENCE_UNCERTAIN. + * notification_responsiveness_ms - Defines the best-effort description + * of how soon should the callback be called when the transition + * associated with the Geofence is triggered. For instance, if set + * to 1000 millseconds with GPS_GEOFENCE_ENTERED, the callback + * should be called 1000 milliseconds within entering the geofence. + * This parameter is defined in milliseconds. + * NOTE: This is not to be confused with the rate that the GPS is + * polled at. It is acceptable to dynamically vary the rate of + * sampling the GPS for power-saving reasons; thus the rate of + * sampling may be faster or slower than this. + * unknown_timer_ms - The time limit after which the UNCERTAIN transition + * should be triggered. This parameter is defined in milliseconds. + * See above for a detailed explanation. + */ + void (*add_geofence_area) (int32_t geofence_id, double latitude, double longitude, + double radius_meters, int last_transition, int monitor_transitions, + int notification_responsiveness_ms, int unknown_timer_ms); + + /** + * Pause monitoring a particular geofence. + * Parameters: + * geofence_id - The id for the geofence. + */ + void (*pause_geofence) (int32_t geofence_id); + + /** + * Resume monitoring a particular geofence. + * Parameters: + * geofence_id - The id for the geofence. + * monitor_transitions - Which transitions to monitor. Bitwise OR of + * GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and + * GPS_GEOFENCE_UNCERTAIN. + * This supersedes the value associated provided in the + * add_geofence_area call. + */ + void (*resume_geofence) (int32_t geofence_id, int monitor_transitions); + + /** + * Remove a geofence area. After the function returns, no notifications + * should be sent. + * Parameter: + * geofence_id - The id for the geofence. + */ + void (*remove_geofence_area) (int32_t geofence_id); +} GpsGeofencingInterface; + + +/** + * Represents an estimate of the GPS clock time. + */ +typedef struct { + /** set to sizeof(GpsClock) */ + size_t size; + + /** A set of flags indicating the validity of the fields in this data structure. */ + GpsClockFlags flags; + + /** + * Leap second data. + * The sign of the value is defined by the following equation: + * utc_time_ns = time_ns + (full_bias_ns + bias_ns) - leap_second * 1,000,000,000 + * + * If the data is available 'flags' must contain GPS_CLOCK_HAS_LEAP_SECOND. + */ + int16_t leap_second; + + /** + * Indicates the type of time reported by the 'time_ns' field. + * This is a Mandatory field. + */ + GpsClockType type; + + /** + * The GPS receiver internal clock value. This can be either the local hardware clock value + * (GPS_CLOCK_TYPE_LOCAL_HW_TIME), or the current GPS time derived inside GPS receiver + * (GPS_CLOCK_TYPE_GPS_TIME). The field 'type' defines the time reported. + * + * For local hardware clock, this value is expected to be monotonically increasing during + * the reporting session. The real GPS time can be derived by compensating the 'full bias' + * (when it is available) from this value. + * + * For GPS time, this value is expected to be the best estimation of current GPS time that GPS + * receiver can achieve. Set the 'time uncertainty' appropriately when GPS time is specified. + * + * Sub-nanosecond accuracy can be provided by means of the 'bias' field. + * The value contains the 'time uncertainty' in it. + * + * This is a Mandatory field. + */ + int64_t time_ns; + + /** + * 1-Sigma uncertainty associated with the clock's time in nanoseconds. + * The uncertainty is represented as an absolute (single sided) value. + * + * This value should be set if GPS_CLOCK_TYPE_GPS_TIME is set. + * If the data is available 'flags' must contain GPS_CLOCK_HAS_TIME_UNCERTAINTY. + */ + double time_uncertainty_ns; + + /** + * The difference between hardware clock ('time' field) inside GPS receiver and the true GPS + * time since 0000Z, January 6, 1980, in nanoseconds. + * This value is used if and only if GPS_CLOCK_TYPE_LOCAL_HW_TIME is set, and GPS receiver + * has solved the clock for GPS time. + * The caller is responsible for using the 'bias uncertainty' field for quality check. + * + * The sign of the value is defined by the following equation: + * true time (GPS time) = time_ns + (full_bias_ns + bias_ns) + * + * This value contains the 'bias uncertainty' in it. + * If the data is available 'flags' must contain GPS_CLOCK_HAS_FULL_BIAS. + + */ + int64_t full_bias_ns; + + /** + * Sub-nanosecond bias. + * The value contains the 'bias uncertainty' in it. + * + * If the data is available 'flags' must contain GPS_CLOCK_HAS_BIAS. + */ + double bias_ns; + + /** + * 1-Sigma uncertainty associated with the clock's bias in nanoseconds. + * The uncertainty is represented as an absolute (single sided) value. + * + * If the data is available 'flags' must contain GPS_CLOCK_HAS_BIAS_UNCERTAINTY. + */ + double bias_uncertainty_ns; + + /** + * The clock's drift in nanoseconds (per second). + * A positive value means that the frequency is higher than the nominal frequency. + * + * The value contains the 'drift uncertainty' in it. + * If the data is available 'flags' must contain GPS_CLOCK_HAS_DRIFT. + * + * If GpsMeasurement's 'flags' field contains GPS_MEASUREMENT_HAS_UNCORRECTED_PSEUDORANGE_RATE, + * it is encouraged that this field is also provided. + */ + double drift_nsps; + + /** + * 1-Sigma uncertainty associated with the clock's drift in nanoseconds (per second). + * The uncertainty is represented as an absolute (single sided) value. + * + * If the data is available 'flags' must contain GPS_CLOCK_HAS_DRIFT_UNCERTAINTY. + */ + double drift_uncertainty_nsps; +} GpsClock; + +/** + * Represents a GPS Measurement, it contains raw and computed information. + */ +typedef struct { + /** set to sizeof(GpsMeasurement) */ + size_t size; + + /** A set of flags indicating the validity of the fields in this data structure. */ + GpsMeasurementFlags flags; + + /** + * Pseudo-random number in the range of [1, 32] + * This is a Mandatory value. + */ + int8_t prn; + + /** + * Time offset at which the measurement was taken in nanoseconds. + * The reference receiver's time is specified by GpsData::clock::time_ns and should be + * interpreted in the same way as indicated by GpsClock::type. + * + * The sign of time_offset_ns is given by the following equation: + * measurement time = GpsClock::time_ns + time_offset_ns + * + * It provides an individual time-stamp for the measurement, and allows sub-nanosecond accuracy. + * This is a Mandatory value. + */ + double time_offset_ns; + + /** + * Per satellite sync state. It represents the current sync state for the associated satellite. + * Based on the sync state, the 'received GPS tow' field should be interpreted accordingly. + * + * This is a Mandatory value. + */ + GpsMeasurementState state; + + /** + * Received GPS Time-of-Week at the measurement time, in nanoseconds. + * The value is relative to the beginning of the current GPS week. + * + * Given the highest sync state that can be achieved, per each satellite, valid range for + * this field can be: + * Searching : [ 0 ] : GPS_MEASUREMENT_STATE_UNKNOWN + * C/A code lock : [ 0 1ms ] : GPS_MEASUREMENT_STATE_CODE_LOCK is set + * Bit sync : [ 0 20ms ] : GPS_MEASUREMENT_STATE_BIT_SYNC is set + * Subframe sync : [ 0 6s ] : GPS_MEASUREMENT_STATE_SUBFRAME_SYNC is set + * TOW decoded : [ 0 1week ] : GPS_MEASUREMENT_STATE_TOW_DECODED is set + * + * However, if there is any ambiguity in integer millisecond, + * GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS should be set accordingly, in the 'state' field. + * + * This value must be populated if 'state' != GPS_MEASUREMENT_STATE_UNKNOWN. + */ + int64_t received_gps_tow_ns; + + /** + * 1-Sigma uncertainty of the Received GPS Time-of-Week in nanoseconds. + * + * This value must be populated if 'state' != GPS_MEASUREMENT_STATE_UNKNOWN. + */ + int64_t received_gps_tow_uncertainty_ns; + + /** + * Carrier-to-noise density in dB-Hz, in the range [0, 63]. + * It contains the measured C/N0 value for the signal at the antenna input. + * + * This is a Mandatory value. + */ + double c_n0_dbhz; + + /** + * Pseudorange rate at the timestamp in m/s. + * The correction of a given Pseudorange Rate value includes corrections for receiver and + * satellite clock frequency errors. + * + * If GPS_MEASUREMENT_HAS_UNCORRECTED_PSEUDORANGE_RATE is set in 'flags' field, this field must + * be populated with the 'uncorrected' reading. + * If GPS_MEASUREMENT_HAS_UNCORRECTED_PSEUDORANGE_RATE is not set in 'flags' field, this field + * must be populated with the 'corrected' reading. This is the default behavior. + * + * It is encouraged to provide the 'uncorrected' 'pseudorange rate', and provide GpsClock's + * 'drift' field as well. + * + * The value includes the 'pseudorange rate uncertainty' in it. + * A positive 'uncorrected' value indicates that the SV is moving away from the receiver. + * + * The sign of the 'uncorrected' 'pseudorange rate' and its relation to the sign of 'doppler + * shift' is given by the equation: + * pseudorange rate = -k * doppler shift (where k is a constant) + * + * This is a Mandatory value. + */ + double pseudorange_rate_mps; + + /** + * 1-Sigma uncertainty of the pseudurange rate in m/s. + * The uncertainty is represented as an absolute (single sided) value. + * + * This is a Mandatory value. + */ + double pseudorange_rate_uncertainty_mps; + + /** + * Accumulated delta range's state. It indicates whether ADR is reset or there is a cycle slip + * (indicating loss of lock). + * + * This is a Mandatory value. + */ + GpsAccumulatedDeltaRangeState accumulated_delta_range_state; + + /** + * Accumulated delta range since the last channel reset in meters. + * A positive value indicates that the SV is moving away from the receiver. + * + * The sign of the 'accumulated delta range' and its relation to the sign of 'carrier phase' + * is given by the equation: + * accumulated delta range = -k * carrier phase (where k is a constant) + * + * This value must be populated if 'accumulated delta range state' != GPS_ADR_STATE_UNKNOWN. + * However, it is expected that the data is only accurate when: + * 'accumulated delta range state' == GPS_ADR_STATE_VALID. + */ + double accumulated_delta_range_m; + + /** + * 1-Sigma uncertainty of the accumulated delta range in meters. + * This value must be populated if 'accumulated delta range state' != GPS_ADR_STATE_UNKNOWN. + */ + double accumulated_delta_range_uncertainty_m; + + /** + * Best derived Pseudorange by the chip-set, in meters. + * The value contains the 'pseudorange uncertainty' in it. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_PSEUDORANGE. + */ + double pseudorange_m; + + /** + * 1-Sigma uncertainty of the pseudorange in meters. + * The value contains the 'pseudorange' and 'clock' uncertainty in it. + * The uncertainty is represented as an absolute (single sided) value. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY. + */ + double pseudorange_uncertainty_m; + + /** + * A fraction of the current C/A code cycle, in the range [0.0, 1023.0] + * This value contains the time (in Chip units) since the last C/A code cycle (GPS Msec epoch). + * + * The reference frequency is given by the field 'carrier_frequency_hz'. + * The value contains the 'code-phase uncertainty' in it. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CODE_PHASE. + */ + double code_phase_chips; + + /** + * 1-Sigma uncertainty of the code-phase, in a fraction of chips. + * The uncertainty is represented as an absolute (single sided) value. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY. + */ + double code_phase_uncertainty_chips; + + /** + * Carrier frequency at which codes and messages are modulated, it can be L1 or L2. + * If the field is not set, the carrier frequency is assumed to be L1. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY. + */ + float carrier_frequency_hz; + + /** + * The number of full carrier cycles between the satellite and the receiver. + * The reference frequency is given by the field 'carrier_frequency_hz'. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_CYCLES. + */ + int64_t carrier_cycles; + + /** + * The RF phase detected by the receiver, in the range [0.0, 1.0]. + * This is usually the fractional part of the complete carrier phase measurement. + * + * The reference frequency is given by the field 'carrier_frequency_hz'. + * The value contains the 'carrier-phase uncertainty' in it. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_PHASE. + */ + double carrier_phase; + + /** + * 1-Sigma uncertainty of the carrier-phase. + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY. + */ + double carrier_phase_uncertainty; + + /** + * An enumeration that indicates the 'loss of lock' state of the event. + */ + GpsLossOfLock loss_of_lock; + + /** + * The number of GPS bits transmitted since Sat-Sun midnight (GPS week). + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_BIT_NUMBER. + */ + int32_t bit_number; + + /** + * The elapsed time since the last received bit in milliseconds, in the range [0, 20] + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT. + */ + int16_t time_from_last_bit_ms; + + /** + * Doppler shift in Hz. + * A positive value indicates that the SV is moving toward the receiver. + * + * The reference frequency is given by the field 'carrier_frequency_hz'. + * The value contains the 'doppler shift uncertainty' in it. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_DOPPLER_SHIFT. + */ + double doppler_shift_hz; + + /** + * 1-Sigma uncertainty of the doppler shift in Hz. + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY. + */ + double doppler_shift_uncertainty_hz; + + /** + * An enumeration that indicates the 'multipath' state of the event. + */ + GpsMultipathIndicator multipath_indicator; + + /** + * Signal-to-noise ratio in dB. + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_SNR. + */ + double snr_db; + + /** + * Elevation in degrees, the valid range is [-90, 90]. + * The value contains the 'elevation uncertainty' in it. + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_ELEVATION. + */ + double elevation_deg; + + /** + * 1-Sigma uncertainty of the elevation in degrees, the valid range is [0, 90]. + * The uncertainty is represented as the absolute (single sided) value. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY. + */ + double elevation_uncertainty_deg; + + /** + * Azimuth in degrees, in the range [0, 360). + * The value contains the 'azimuth uncertainty' in it. + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_AZIMUTH. + * */ + double azimuth_deg; + + /** + * 1-Sigma uncertainty of the azimuth in degrees, the valid range is [0, 180]. + * The uncertainty is represented as an absolute (single sided) value. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY. + */ + double azimuth_uncertainty_deg; + + /** + * Whether the GPS represented by the measurement was used for computing the most recent fix. + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_USED_IN_FIX. + */ + bool used_in_fix; +} GpsMeasurement; + +/** Represents a reading of GPS measurements. */ +typedef struct { + /** set to sizeof(GpsData) */ + size_t size; + + /** Number of measurements. */ + size_t measurement_count; + + /** The array of measurements. */ + GpsMeasurement measurements[GPS_MAX_MEASUREMENT]; + + /** The GPS clock time reading. */ + GpsClock clock; +} GpsData; + +/** + * The callback for to report measurements from the HAL. + * + * Parameters: + * data - A data structure containing the measurements. + */ +typedef void (*gps_measurement_callback) (GpsData* data); + +typedef struct { + /** set to sizeof(GpsMeasurementCallbacks) */ + size_t size; + gps_measurement_callback measurement_callback; +} GpsMeasurementCallbacks; + +#define GPS_MEASUREMENT_OPERATION_SUCCESS 0 +#define GPS_MEASUREMENT_ERROR_ALREADY_INIT -100 +#define GPS_MEASUREMENT_ERROR_GENERIC -101 + +/** + * Extended interface for GPS Measurements support. + */ +typedef struct { + /** Set to sizeof(GpsMeasurementInterface) */ + size_t size; + + /** + * Initializes the interface and registers the callback routines with the HAL. + * After a successful call to 'init' the HAL must begin to provide updates at its own phase. + * + * Status: + * GPS_MEASUREMENT_OPERATION_SUCCESS + * GPS_MEASUREMENT_ERROR_ALREADY_INIT - if a callback has already been registered without a + * corresponding call to 'close' + * GPS_MEASUREMENT_ERROR_GENERIC - if any other error occurred, it is expected that the HAL + * will not generate any updates upon returning this error code. + */ + int (*init) (GpsMeasurementCallbacks* callbacks); + + /** + * Stops updates from the HAL, and unregisters the callback routines. + * After a call to stop, the previously registered callbacks must be considered invalid by the + * HAL. + * If stop is invoked without a previous 'init', this function should perform no work. + */ + void (*close) (); + +} GpsMeasurementInterface; + + +/** Represents a GPS navigation message (or a fragment of it). */ +typedef struct { + /** set to sizeof(GpsNavigationMessage) */ + size_t size; + + /** + * Pseudo-random number in the range of [1, 32] + * This is a Mandatory value. + */ + int8_t prn; + + /** + * The type of message contained in the structure. + * This is a Mandatory value. + */ + GpsNavigationMessageType type; + + /** + * The status of the received navigation message. + * No need to send any navigation message that contains words with parity error and cannot be + * corrected. + */ + NavigationMessageStatus status; + + /** + * Message identifier. + * It provides an index so the complete Navigation Message can be assembled. i.e. fo L1 C/A + * subframe 4 and 5, this value corresponds to the 'frame id' of the navigation message. + * Subframe 1, 2, 3 does not contain a 'frame id' and this value can be set to -1. + */ + int16_t message_id; + + /** + * Sub-message identifier. + * If required by the message 'type', this value contains a sub-index within the current + * message (or frame) that is being transmitted. + * i.e. for L1 C/A the submessage id corresponds to the sub-frame id of the navigation message. + */ + int16_t submessage_id; + + /** + * The length of the data (in bytes) contained in the current message. + * If this value is different from zero, 'data' must point to an array of the same size. + * e.g. for L1 C/A the size of the sub-frame will be 40 bytes (10 words, 30 bits/word). + * + * This is a Mandatory value. + */ + size_t data_length; + + /** + * The data of the reported GPS message. + * The bytes (or words) specified using big endian format (MSB first). + * + * For L1 C/A, each subframe contains 10 30-bit GPS words. Each GPS word (30 bits) should be + * fitted into the last 30 bits in a 4-byte word (skip B31 and B32), with MSB first. + */ + uint8_t* data; + +} GpsNavigationMessage; + +/** + * The callback to report an available fragment of a GPS navigation messages from the HAL. + * + * Parameters: + * message - The GPS navigation submessage/subframe representation. + */ +typedef void (*gps_navigation_message_callback) (GpsNavigationMessage* message); + +typedef struct { + /** set to sizeof(GpsNavigationMessageCallbacks) */ + size_t size; + gps_navigation_message_callback navigation_message_callback; +} GpsNavigationMessageCallbacks; + +#define GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS 0 +#define GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT -100 +#define GPS_NAVIGATION_MESSAGE_ERROR_GENERIC -101 + +/** + * Extended interface for GPS navigation message reporting support. + */ +typedef struct { + /** Set to sizeof(GpsNavigationMessageInterface) */ + size_t size; + + /** + * Initializes the interface and registers the callback routines with the HAL. + * After a successful call to 'init' the HAL must begin to provide updates as they become + * available. + * + * Status: + * GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS + * GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT - if a callback has already been registered + * without a corresponding call to 'close'. + * GPS_NAVIGATION_MESSAGE_ERROR_GENERIC - if any other error occurred, it is expected that + * the HAL will not generate any updates upon returning this error code. + */ + int (*init) (GpsNavigationMessageCallbacks* callbacks); + + /** + * Stops updates from the HAL, and unregisters the callback routines. + * After a call to stop, the previously registered callbacks must be considered invalid by the + * HAL. + * If stop is invoked without a previous 'init', this function should perform no work. + */ + void (*close) (); + +} GpsNavigationMessageInterface; + +/** + * Interface for passing GNSS configuration contents from platform to HAL. + */ +typedef struct { + /** Set to sizeof(GnssConfigurationInterface) */ + size_t size; + + /** + * Deliver GNSS configuration contents to HAL. + * Parameters: + * config_data - a pointer to a char array which holds what usually is expected from + file(/etc/gps.conf), i.e., a sequence of UTF8 strings separated by '\n'. + * length - total number of UTF8 characters in configuraiton data. + * + * IMPORTANT: + * GPS HAL should expect this function can be called multiple times. And it may be + * called even when GpsLocationProvider is already constructed and enabled. GPS HAL + * should maintain the existing requests for various callback regardless the change + * in configuration data. + */ + void (*configuration_update) (const char* config_data, int32_t length); +} GnssConfigurationInterface; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_HARDWARE_GPS_H */ + diff --git a/third_party/android_hardware_libhardware/include/hardware/gralloc.h b/third_party/android_hardware_libhardware/include/hardware/gralloc.h new file mode 100644 index 000000000..07ac0290b --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/gralloc.h @@ -0,0 +1,401 @@ +/* + * 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_GRALLOC_INTERFACE_H +#define ANDROID_GRALLOC_INTERFACE_H + +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +__BEGIN_DECLS + +/** + * Module versioning information for the Gralloc hardware module, based on + * gralloc_module_t.common.module_api_version. + * + * Version History: + * + * GRALLOC_MODULE_API_VERSION_0_1: + * Initial Gralloc hardware module API. + * + * GRALLOC_MODULE_API_VERSION_0_2: + * Add support for flexible YCbCr format with (*lock_ycbcr)() method. + * + * GRALLOC_MODULE_API_VERSION_0_3: + * Add support for fence passing to/from lock/unlock. + */ + +#define GRALLOC_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) +#define GRALLOC_MODULE_API_VERSION_0_2 HARDWARE_MODULE_API_VERSION(0, 2) +#define GRALLOC_MODULE_API_VERSION_0_3 HARDWARE_MODULE_API_VERSION(0, 3) + +#define GRALLOC_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION(0, 1) + +/** + * The id of this module + */ +#define GRALLOC_HARDWARE_MODULE_ID "gralloc" + +/** + * Name of the graphics device to open + */ + +#define GRALLOC_HARDWARE_GPU0 "gpu0" + +enum { + /* buffer is never read in software */ + GRALLOC_USAGE_SW_READ_NEVER = 0x00000000, + /* buffer is rarely read in software */ + GRALLOC_USAGE_SW_READ_RARELY = 0x00000002, + /* buffer is often read in software */ + GRALLOC_USAGE_SW_READ_OFTEN = 0x00000003, + /* mask for the software read values */ + GRALLOC_USAGE_SW_READ_MASK = 0x0000000F, + + /* buffer is never written in software */ + GRALLOC_USAGE_SW_WRITE_NEVER = 0x00000000, + /* buffer is rarely written in software */ + GRALLOC_USAGE_SW_WRITE_RARELY = 0x00000020, + /* buffer is often written in software */ + GRALLOC_USAGE_SW_WRITE_OFTEN = 0x00000030, + /* mask for the software write values */ + GRALLOC_USAGE_SW_WRITE_MASK = 0x000000F0, + + /* buffer will be used as an OpenGL ES texture */ + GRALLOC_USAGE_HW_TEXTURE = 0x00000100, + /* buffer will be used as an OpenGL ES render target */ + GRALLOC_USAGE_HW_RENDER = 0x00000200, + /* buffer will be used by the 2D hardware blitter */ + GRALLOC_USAGE_HW_2D = 0x00000400, + /* buffer will be used by the HWComposer HAL module */ + GRALLOC_USAGE_HW_COMPOSER = 0x00000800, + /* buffer will be used with the framebuffer device */ + GRALLOC_USAGE_HW_FB = 0x00001000, + + /* buffer should be displayed full-screen on an external display when + * possible */ + GRALLOC_USAGE_EXTERNAL_DISP = 0x00002000, + + /* Must have a hardware-protected path to external display sink for + * this buffer. If a hardware-protected path is not available, then + * either don't composite only this buffer (preferred) to the + * external sink, or (less desirable) do not route the entire + * composition to the external sink. */ + GRALLOC_USAGE_PROTECTED = 0x00004000, + + /* buffer may be used as a cursor */ + GRALLOC_USAGE_CURSOR = 0x00008000, + + /* buffer will be used with the HW video encoder */ + GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000, + /* buffer will be written by the HW camera pipeline */ + GRALLOC_USAGE_HW_CAMERA_WRITE = 0x00020000, + /* buffer will be read by the HW camera pipeline */ + GRALLOC_USAGE_HW_CAMERA_READ = 0x00040000, + /* buffer will be used as part of zero-shutter-lag queue */ + GRALLOC_USAGE_HW_CAMERA_ZSL = 0x00060000, + /* mask for the camera access values */ + GRALLOC_USAGE_HW_CAMERA_MASK = 0x00060000, + /* mask for the software usage bit-mask */ + GRALLOC_USAGE_HW_MASK = 0x00071F00, + + /* buffer will be used as a RenderScript Allocation */ + GRALLOC_USAGE_RENDERSCRIPT = 0x00100000, + + /* Set by the consumer to indicate to the producer that they may attach a + * buffer that they did not detach from the BufferQueue. Will be filtered + * out by GRALLOC_USAGE_ALLOC_MASK, so gralloc modules will not need to + * handle this flag. */ + GRALLOC_USAGE_FOREIGN_BUFFERS = 0x00200000, + + /* Mask of all flags which could be passed to a gralloc module for buffer + * allocation. Any flags not in this mask do not need to be handled by + * gralloc modules. */ + GRALLOC_USAGE_ALLOC_MASK = ~(GRALLOC_USAGE_FOREIGN_BUFFERS), + + /* implementation-specific private usage flags */ + GRALLOC_USAGE_PRIVATE_0 = 0x10000000, + GRALLOC_USAGE_PRIVATE_1 = 0x20000000, + GRALLOC_USAGE_PRIVATE_2 = 0x40000000, + GRALLOC_USAGE_PRIVATE_3 = 0x80000000, + GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000, + +#ifdef EXYNOS4_ENHANCEMENTS + /* SAMSUNG */ + GRALLOC_USAGE_PRIVATE_NONECACHE = 0x00800000, + + GRALLOC_USAGE_HW_FIMC1 = 0x01000000, + GRALLOC_USAGE_HW_ION = 0x02000000, + GRALLOC_USAGE_YUV_ADDR = 0x04000000, + GRALLOC_USAGE_CAMERA = 0x08000000, + + /* SEC Private usage , for Overlay path at HWC */ + GRALLOC_USAGE_HWC_HWOVERLAY = 0x20000000, +#endif +}; + +/*****************************************************************************/ + +/** + * 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 gralloc_module_t { + struct hw_module_t common; + + /* + * (*registerBuffer)() must be called before a buffer_handle_t that has not + * been created with (*alloc_device_t::alloc)() can be used. + * + * This is intended to be used with buffer_handle_t's that have been + * received in this process through IPC. + * + * This function checks that the handle is indeed a valid one and prepares + * it for use with (*lock)() and (*unlock)(). + * + * It is not necessary to call (*registerBuffer)() on a handle created + * with (*alloc_device_t::alloc)(). + * + * returns an error if this buffer_handle_t is not valid. + */ + int (*registerBuffer)(struct gralloc_module_t const* module, + buffer_handle_t handle); + + /* + * (*unregisterBuffer)() is called once this handle is no longer needed in + * this process. After this call, it is an error to call (*lock)(), + * (*unlock)(), or (*registerBuffer)(). + * + * This function doesn't close or free the handle itself; this is done + * by other means, usually through libcutils's native_handle_close() and + * native_handle_free(). + * + * It is an error to call (*unregisterBuffer)() on a buffer that wasn't + * explicitly registered first. + */ + int (*unregisterBuffer)(struct gralloc_module_t const* module, + buffer_handle_t handle); + + /* + * The (*lock)() method is called before a buffer is accessed for the + * specified usage. This call may block, for instance if the h/w needs + * to finish rendering or if CPU caches need to be synchronized. + * + * The caller promises to modify only pixels in the area specified + * by (l,t,w,h). + * + * The content of the buffer outside of the specified area is NOT modified + * by this call. + * + * If usage specifies GRALLOC_USAGE_SW_*, vaddr is filled with the address + * of the buffer in virtual memory. + * + * Note calling (*lock)() on HAL_PIXEL_FORMAT_YCbCr_*_888 buffers will fail + * and return -EINVAL. These buffers must be locked with (*lock_ycbcr)() + * instead. + * + * THREADING CONSIDERATIONS: + * + * It is legal for several different threads to lock a buffer from + * read access, none of the threads are blocked. + * + * However, locking a buffer simultaneously for write or read/write is + * undefined, but: + * - shall not result in termination of the process + * - shall not block the caller + * It is acceptable to return an error or to leave the buffer's content + * into an indeterminate state. + * + * If the buffer was created with a usage mask incompatible with the + * requested usage flags here, -EINVAL is returned. + * + */ + + int (*lock)(struct gralloc_module_t const* module, + buffer_handle_t handle, int usage, + int l, int t, int w, int h, + void** vaddr); + + + /* + * The (*unlock)() method must be called after all changes to the buffer + * are completed. + */ + + int (*unlock)(struct gralloc_module_t const* module, + buffer_handle_t handle); + +#ifdef EXYNOS4_ENHANCEMENTS + int (*getphys) (struct gralloc_module_t const* module, + buffer_handle_t handle, void** paddr); +#endif + + /* reserved for future use */ + int (*perform)(struct gralloc_module_t const* module, + int operation, ... ); + + /* + * The (*lock_ycbcr)() method is like the (*lock)() method, with the + * difference that it fills a struct ycbcr with a description of the buffer + * layout, and zeroes out the reserved fields. + * + * If the buffer format is not compatible with a flexible YUV format (e.g. + * the buffer layout cannot be represented with the ycbcr struct), it + * will return -EINVAL. + * + * This method must work on buffers with HAL_PIXEL_FORMAT_YCbCr_*_888 + * if supported by the device, as well as with any other format that is + * requested by the multimedia codecs when they are configured with a + * flexible-YUV-compatible color-format with android native buffers. + * + * Note that this method may also be called on buffers of other formats, + * including non-YUV formats. + * + * Added in GRALLOC_MODULE_API_VERSION_0_2. + */ + + int (*lock_ycbcr)(struct gralloc_module_t const* module, + buffer_handle_t handle, int usage, + int l, int t, int w, int h, + struct android_ycbcr *ycbcr); + + /* + * The (*lockAsync)() method is like the (*lock)() method except + * that the buffer's sync fence object is passed into the lock + * call instead of requiring the caller to wait for completion. + * + * The gralloc implementation takes ownership of the fenceFd and + * is responsible for closing it when no longer needed. + * + * Added in GRALLOC_MODULE_API_VERSION_0_3. + */ + int (*lockAsync)(struct gralloc_module_t const* module, + buffer_handle_t handle, int usage, + int l, int t, int w, int h, + void** vaddr, int fenceFd); + + /* + * The (*unlockAsync)() method is like the (*unlock)() method + * except that a buffer sync fence object is returned from the + * lock call, representing the completion of any pending work + * performed by the gralloc implementation. + * + * The caller takes ownership of the fenceFd and is responsible + * for closing it when no longer needed. + * + * Added in GRALLOC_MODULE_API_VERSION_0_3. + */ + int (*unlockAsync)(struct gralloc_module_t const* module, + buffer_handle_t handle, int* fenceFd); + + /* + * The (*lockAsync_ycbcr)() method is like the (*lock_ycbcr)() + * method except that the buffer's sync fence object is passed + * into the lock call instead of requiring the caller to wait for + * completion. + * + * The gralloc implementation takes ownership of the fenceFd and + * is responsible for closing it when no longer needed. + * + * Added in GRALLOC_MODULE_API_VERSION_0_3. + */ + int (*lockAsync_ycbcr)(struct gralloc_module_t const* module, + buffer_handle_t handle, int usage, + int l, int t, int w, int h, + struct android_ycbcr *ycbcr, int fenceFd); + + /* reserved for future use */ + void* reserved_proc[3]; +} gralloc_module_t; + +/*****************************************************************************/ + +/** + * Every device data structure must begin with hw_device_t + * followed by module specific public methods and attributes. + */ + +typedef struct alloc_device_t { + struct hw_device_t common; + + /* + * (*alloc)() Allocates a buffer in graphic memory with the requested + * parameters and returns a buffer_handle_t and the stride in pixels to + * allow the implementation to satisfy hardware constraints on the width + * of a pixmap (eg: it may have to be multiple of 8 pixels). + * The CALLER TAKES OWNERSHIP of the buffer_handle_t. + * + * If format is HAL_PIXEL_FORMAT_YCbCr_420_888, the returned stride must be + * 0, since the actual strides are available from the android_ycbcr + * structure. + * + * Returns 0 on success or -errno on error. + */ + + int (*alloc)(struct alloc_device_t* dev, + int w, int h, int format, int usage, + buffer_handle_t* handle, int* stride); + + /* + * (*free)() Frees a previously allocated buffer. + * Behavior is undefined if the buffer is still mapped in any process, + * but shall not result in termination of the program or security breaches + * (allowing a process to get access to another process' buffers). + * THIS FUNCTION TAKES OWNERSHIP of the buffer_handle_t which becomes + * invalid after the call. + * + * Returns 0 on success or -errno on error. + */ + int (*free)(struct alloc_device_t* dev, + buffer_handle_t handle); + + /* This hook is OPTIONAL. + * + * If non NULL it will be caused by SurfaceFlinger on dumpsys + */ + void (*dump)(struct alloc_device_t *dev, char *buff, int buff_len); + + void* reserved_proc[7]; +} alloc_device_t; + + +/** convenience API for opening and closing a supported device */ + +static inline int gralloc_open(const struct hw_module_t* module, + struct alloc_device_t** device) { + return module->methods->open(module, + GRALLOC_HARDWARE_GPU0, (struct hw_device_t**)device); +} + +static inline int gralloc_close(struct alloc_device_t* device) { + return device->common.close(&device->common); +} + +__END_DECLS + +#endif // ANDROID_GRALLOC_INTERFACE_H diff --git a/third_party/android_hardware_libhardware/include/hardware/hardware.h b/third_party/android_hardware_libhardware/include/hardware/hardware.h new file mode 100644 index 000000000..74f57aa4c --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/hardware.h @@ -0,0 +1,238 @@ +/* + * 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 +#include + +#include +#include + +__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; + +#ifdef __LP64__ + uint64_t reserved[32-7]; +#else + /** padding to 128 bytes, reserved for future use */ + uint32_t reserved[32-7]; +#endif + +} 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 */ +#ifdef __LP64__ + uint64_t reserved[12]; +#else + uint32_t reserved[12]; +#endif + + /** 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..so and + * audio.a2dp..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/third_party/android_hardware_libhardware/include/hardware/hdmi_cec.h b/third_party/android_hardware_libhardware/include/hardware/hdmi_cec.h new file mode 100644 index 000000000..ab70f92e2 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/hdmi_cec.h @@ -0,0 +1,429 @@ +/* + * Copyright (C) 2014 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_HDMI_CEC_H +#define ANDROID_INCLUDE_HARDWARE_HDMI_CEC_H + +#include +#include + +#include + +__BEGIN_DECLS + +#define HDMI_CEC_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) +#define HDMI_CEC_MODULE_API_VERSION_CURRENT HDMI_MODULE_API_VERSION_1_0 + +#define HDMI_CEC_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) +#define HDMI_CEC_DEVICE_API_VERSION_CURRENT HDMI_DEVICE_API_VERSION_1_0 + +#define HDMI_CEC_HARDWARE_MODULE_ID "hdmi_cec" +#define HDMI_CEC_HARDWARE_INTERFACE "hdmi_cec_hw_if" + +typedef enum cec_device_type { + CEC_DEVICE_INACTIVE = -1, + CEC_DEVICE_TV = 0, + CEC_DEVICE_RECORDER = 1, + CEC_DEVICE_RESERVED = 2, + CEC_DEVICE_TUNER = 3, + CEC_DEVICE_PLAYBACK = 4, + CEC_DEVICE_AUDIO_SYSTEM = 5, + CEC_DEVICE_MAX = CEC_DEVICE_AUDIO_SYSTEM +} cec_device_type_t; + +typedef enum cec_logical_address { + CEC_ADDR_TV = 0, + CEC_ADDR_RECORDER_1 = 1, + CEC_ADDR_RECORDER_2 = 2, + CEC_ADDR_TUNER_1 = 3, + CEC_ADDR_PLAYBACK_1 = 4, + CEC_ADDR_AUDIO_SYSTEM = 5, + CEC_ADDR_TUNER_2 = 6, + CEC_ADDR_TUNER_3 = 7, + CEC_ADDR_PLAYBACK_2 = 8, + CEC_ADDR_RECORDER_3 = 9, + CEC_ADDR_TUNER_4 = 10, + CEC_ADDR_PLAYBACK_3 = 11, + CEC_ADDR_RESERVED_1 = 12, + CEC_ADDR_RESERVED_2 = 13, + CEC_ADDR_FREE_USE = 14, + CEC_ADDR_UNREGISTERED = 15, + CEC_ADDR_BROADCAST = 15 +} cec_logical_address_t; + +/* + * HDMI CEC messages + */ +enum cec_message_type { + CEC_MESSAGE_FEATURE_ABORT = 0x00, + CEC_MESSAGE_IMAGE_VIEW_ON = 0x04, + CEC_MESSAGE_TUNER_STEP_INCREMENT = 0x05, + CEC_MESSAGE_TUNER_STEP_DECREMENT = 0x06, + CEC_MESSAGE_TUNER_DEVICE_STATUS = 0x07, + CEC_MESSAGE_GIVE_TUNER_DEVICE_STATUS = 0x08, + CEC_MESSAGE_RECORD_ON = 0x09, + CEC_MESSAGE_RECORD_STATUS = 0x0A, + CEC_MESSAGE_RECORD_OFF = 0x0B, + CEC_MESSAGE_TEXT_VIEW_ON = 0x0D, + CEC_MESSAGE_RECORD_TV_SCREEN = 0x0F, + CEC_MESSAGE_GIVE_DECK_STATUS = 0x1A, + CEC_MESSAGE_DECK_STATUS = 0x1B, + CEC_MESSAGE_SET_MENU_LANGUAGE = 0x32, + CEC_MESSAGE_CLEAR_ANALOG_TIMER = 0x33, + CEC_MESSAGE_SET_ANALOG_TIMER = 0x34, + CEC_MESSAGE_TIMER_STATUS = 0x35, + CEC_MESSAGE_STANDBY = 0x36, + CEC_MESSAGE_PLAY = 0x41, + CEC_MESSAGE_DECK_CONTROL = 0x42, + CEC_MESSAGE_TIMER_CLEARED_STATUS = 0x043, + CEC_MESSAGE_USER_CONTROL_PRESSED = 0x44, + CEC_MESSAGE_USER_CONTROL_RELEASED = 0x45, + CEC_MESSAGE_GIVE_OSD_NAME = 0x46, + CEC_MESSAGE_SET_OSD_NAME = 0x47, + CEC_MESSAGE_SET_OSD_STRING = 0x64, + CEC_MESSAGE_SET_TIMER_PROGRAM_TITLE = 0x67, + CEC_MESSAGE_SYSTEM_AUDIO_MODE_REQUEST = 0x70, + CEC_MESSAGE_GIVE_AUDIO_STATUS = 0x71, + CEC_MESSAGE_SET_SYSTEM_AUDIO_MODE = 0x72, + CEC_MESSAGE_REPORT_AUDIO_STATUS = 0x7A, + CEC_MESSAGE_GIVE_SYSTEM_AUDIO_MODE_STATUS = 0x7D, + CEC_MESSAGE_SYSTEM_AUDIO_MODE_STATUS = 0x7E, + CEC_MESSAGE_ROUTING_CHANGE = 0x80, + CEC_MESSAGE_ROUTING_INFORMATION = 0x81, + CEC_MESSAGE_ACTIVE_SOURCE = 0x82, + CEC_MESSAGE_GIVE_PHYSICAL_ADDRESS = 0x83, + CEC_MESSAGE_REPORT_PHYSICAL_ADDRESS = 0x84, + CEC_MESSAGE_REQUEST_ACTIVE_SOURCE = 0x85, + CEC_MESSAGE_SET_STREAM_PATH = 0x86, + CEC_MESSAGE_DEVICE_VENDOR_ID = 0x87, + CEC_MESSAGE_VENDOR_COMMAND = 0x89, + CEC_MESSAGE_VENDOR_REMOTE_BUTTON_DOWN = 0x8A, + CEC_MESSAGE_VENDOR_REMOTE_BUTTON_UP = 0x8B, + CEC_MESSAGE_GIVE_DEVICE_VENDOR_ID = 0x8C, + CEC_MESSAGE_MENU_REQUEST = 0x8D, + CEC_MESSAGE_MENU_STATUS = 0x8E, + CEC_MESSAGE_GIVE_DEVICE_POWER_STATUS = 0x8F, + CEC_MESSAGE_REPORT_POWER_STATUS = 0x90, + CEC_MESSAGE_GET_MENU_LANGUAGE = 0x91, + CEC_MESSAGE_SELECT_ANALOG_SERVICE = 0x92, + CEC_MESSAGE_SELECT_DIGITAL_SERVICE = 0x93, + CEC_MESSAGE_SET_DIGITAL_TIMER = 0x97, + CEC_MESSAGE_CLEAR_DIGITAL_TIMER = 0x99, + CEC_MESSAGE_SET_AUDIO_RATE = 0x9A, + CEC_MESSAGE_INACTIVE_SOURCE = 0x9D, + CEC_MESSAGE_CEC_VERSION = 0x9E, + CEC_MESSAGE_GET_CEC_VERSION = 0x9F, + CEC_MESSAGE_VENDOR_COMMAND_WITH_ID = 0xA0, + CEC_MESSAGE_CLEAR_EXTERNAL_TIMER = 0xA1, + CEC_MESSAGE_SET_EXTERNAL_TIMER = 0xA2, + CEC_MESSAGE_INITIATE_ARC = 0xC0, + CEC_MESSAGE_REPORT_ARC_INITIATED = 0xC1, + CEC_MESSAGE_REPORT_ARC_TERMINATED = 0xC2, + CEC_MESSAGE_REQUEST_ARC_INITIATION = 0xC3, + CEC_MESSAGE_REQUEST_ARC_TERMINATION = 0xC4, + CEC_MESSAGE_TERMINATE_ARC = 0xC5, + CEC_MESSAGE_ABORT = 0xFF +}; + +/* + * Operand description [Abort Reason] + */ +enum abort_reason { + ABORT_UNRECOGNIZED_MODE = 0, + ABORT_NOT_IN_CORRECT_MODE = 1, + ABORT_CANNOT_PROVIDE_SOURCE = 2, + ABORT_INVALID_OPERAND = 3, + ABORT_REFUSED = 4, + ABORT_UNABLE_TO_DETERMINE = 5 +}; + +/* + * HDMI event type. used for hdmi_event_t. + */ +enum { + HDMI_EVENT_CEC_MESSAGE = 1, + HDMI_EVENT_HOT_PLUG = 2, +}; + +/* + * HDMI hotplug event type. Used when the event + * type is HDMI_EVENT_HOT_PLUG. + */ +enum { + HDMI_NOT_CONNECTED = 0, + HDMI_CONNECTED = 1 +}; + +/* + * error code used for send_message. + */ +enum { + HDMI_RESULT_SUCCESS = 0, + HDMI_RESULT_NACK = 1, /* not acknowledged */ + HDMI_RESULT_BUSY = 2, /* bus is busy */ + HDMI_RESULT_FAIL = 3, +}; + +/* + * HDMI port type. + */ +typedef enum hdmi_port_type { + HDMI_INPUT = 0, + HDMI_OUTPUT = 1 +} hdmi_port_type_t; + +/* + * Flags used for set_option() + */ +enum { + /* When set to false, HAL does not wake up the system upon receiving + * or . Used when user changes the TV + * settings to disable the auto TV on functionality. + * True by default. + */ + HDMI_OPTION_WAKEUP = 1, + + /* When set to false, all the CEC commands are discarded. Used when + * user changes the TV settings to disable CEC functionality. + * True by default. + */ + HDMI_OPTION_ENABLE_CEC = 2, + + /* Setting this flag to false means Android system will stop handling + * CEC service and yield the control over to the microprocessor that is + * powered on through the standby mode. When set to true, the system + * will gain the control over, hence telling the microprocessor to stop + * handling the cec commands. This is called when system goes + * in and out of standby mode to notify the microprocessor that it should + * start/stop handling CEC commands on behalf of the system. + * False by default. + */ + HDMI_OPTION_SYSTEM_CEC_CONTROL = 3, + + /* Option 4 not used */ + + /* Passes the updated language information of Android system. + * Contains 3-byte ASCII code as defined in ISO/FDIS 639-2. Can be + * used for HAL to respond to while in standby mode. + * English(eng), for example, is converted to 0x656e67. + */ + HDMI_OPTION_SET_LANG = 5, +}; + +/* + * Maximum length in bytes of cec message body (exclude header block), + * should not exceed 16 (spec CEC 6 Frame Description) + */ +#define CEC_MESSAGE_BODY_MAX_LENGTH 16 + +typedef struct cec_message { + /* logical address of sender */ + cec_logical_address_t initiator; + + /* logical address of receiver */ + cec_logical_address_t destination; + + /* Length in bytes of body, range [0, CEC_MESSAGE_BODY_MAX_LENGTH] */ + size_t length; + unsigned char body[CEC_MESSAGE_BODY_MAX_LENGTH]; +} cec_message_t; + +typedef struct hotplug_event { + /* + * true if the cable is connected; otherwise false. + */ + int connected; + int port_id; +} hotplug_event_t; + +typedef struct tx_status_event { + int status; + int opcode; /* CEC opcode */ +} tx_status_event_t; + +/* + * HDMI event generated from HAL. + */ +typedef struct hdmi_event { + int type; + struct hdmi_cec_device* dev; + union { + cec_message_t cec; + hotplug_event_t hotplug; + }; +} hdmi_event_t; + +/* + * HDMI port descriptor + */ +typedef struct hdmi_port_info { + hdmi_port_type_t type; + // Port ID should start from 1 which corresponds to HDMI "port 1". + int port_id; + int cec_supported; + int arc_supported; + uint16_t physical_address; +} hdmi_port_info_t; + +/* + * Callback function type that will be called by HAL implementation. + * Services can not close/open the device in the callback. + */ +typedef void (*event_callback_t)(const hdmi_event_t* event, void* arg); + +typedef struct hdmi_cec_module { + /** + * Common methods of the HDMI CEC module. This *must* be the first member of + * hdmi_cec_module as users of this structure will cast a hw_module_t to hdmi_cec_module + * pointer in contexts where it's known the hw_module_t references a hdmi_cec_module. + */ + struct hw_module_t common; +} hdmi_module_t; + +/* + * HDMI-CEC HAL interface definition. + */ +typedef struct hdmi_cec_device { + /** + * Common methods of the HDMI CEC device. This *must* be the first member of + * hdmi_cec_device as users of this structure will cast a hw_device_t to hdmi_cec_device + * pointer in contexts where it's known the hw_device_t references a hdmi_cec_device. + */ + struct hw_device_t common; + + /* + * (*add_logical_address)() passes the logical address that will be used + * in this system. + * + * HAL may use it to configure the hardware so that the CEC commands addressed + * the given logical address can be filtered in. This method can be called + * as many times as necessary in order to support multiple logical devices. + * addr should be in the range of valid logical addresses for the call + * to succeed. + * + * Returns 0 on success or -errno on error. + */ + int (*add_logical_address)(const struct hdmi_cec_device* dev, cec_logical_address_t addr); + + /* + * (*clear_logical_address)() tells HAL to reset all the logical addresses. + * + * It is used when the system doesn't need to process CEC command any more, + * hence to tell HAL to stop receiving commands from the CEC bus, and change + * the state back to the beginning. + */ + void (*clear_logical_address)(const struct hdmi_cec_device* dev); + + /* + * (*get_physical_address)() returns the CEC physical address. The + * address is written to addr. + * + * The physical address depends on the topology of the network formed + * by connected HDMI devices. It is therefore likely to change if the cable + * is plugged off and on again. It is advised to call get_physical_address + * to get the updated address when hot plug event takes place. + * + * Returns 0 on success or -errno on error. + */ + int (*get_physical_address)(const struct hdmi_cec_device* dev, uint16_t* addr); + + /* + * (*send_message)() transmits HDMI-CEC message to other HDMI device. + * + * The method should be designed to return in a certain amount of time not + * hanging forever, which can happen if CEC signal line is pulled low for + * some reason. HAL implementation should take the situation into account + * so as not to wait forever for the message to get sent out. + * + * It should try retransmission at least once as specified in the standard. + * + * Returns error code. See HDMI_RESULT_SUCCESS, HDMI_RESULT_NACK, and + * HDMI_RESULT_BUSY. + */ + int (*send_message)(const struct hdmi_cec_device* dev, const cec_message_t*); + + /* + * (*register_event_callback)() registers a callback that HDMI-CEC HAL + * can later use for incoming CEC messages or internal HDMI events. + * When calling from C++, use the argument arg to pass the calling object. + * It will be passed back when the callback is invoked so that the context + * can be retrieved. + */ + void (*register_event_callback)(const struct hdmi_cec_device* dev, + event_callback_t callback, void* arg); + + /* + * (*get_version)() returns the CEC version supported by underlying hardware. + */ + void (*get_version)(const struct hdmi_cec_device* dev, int* version); + + /* + * (*get_vendor_id)() returns the identifier of the vendor. It is + * the 24-bit unique company ID obtained from the IEEE Registration + * Authority Committee (RAC). + */ + void (*get_vendor_id)(const struct hdmi_cec_device* dev, uint32_t* vendor_id); + + /* + * (*get_port_info)() returns the hdmi port information of underlying hardware. + * info is the list of HDMI port information, and 'total' is the number of + * HDMI ports in the system. + */ + void (*get_port_info)(const struct hdmi_cec_device* dev, + struct hdmi_port_info* list[], int* total); + + /* + * (*set_option)() passes flags controlling the way HDMI-CEC service works down + * to HAL implementation. Those flags will be used in case the feature needs + * update in HAL itself, firmware or microcontroller. + */ + void (*set_option)(const struct hdmi_cec_device* dev, int flag, int value); + + /* + * (*set_audio_return_channel)() configures ARC circuit in the hardware logic + * to start or stop the feature. Flag can be either 1 to start the feature + * or 0 to stop it. + * + * Returns 0 on success or -errno on error. + */ + void (*set_audio_return_channel)(const struct hdmi_cec_device* dev, int port_id, int flag); + + /* + * (*is_connected)() returns the connection status of the specified port. + * Returns HDMI_CONNECTED if a device is connected, otherwise HDMI_NOT_CONNECTED. + * The HAL should watch for +5V power signal to determine the status. + */ + int (*is_connected)(const struct hdmi_cec_device* dev, int port_id); + + /* Reserved for future use to maximum 16 functions. Must be NULL. */ + void* reserved[16 - 11]; +} hdmi_cec_device_t; + +/** convenience API for opening and closing a device */ + +static inline int hdmi_cec_open(const struct hw_module_t* module, + struct hdmi_cec_device** device) { + return module->methods->open(module, + HDMI_CEC_HARDWARE_INTERFACE, (struct hw_device_t**)device); +} + +static inline int hdmi_cec_close(struct hdmi_cec_device* device) { + return device->common.close(&device->common); +} + +__END_DECLS + +#endif /* ANDROID_INCLUDE_HARDWARE_HDMI_CEC_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/hw_auth_token.h b/third_party/android_hardware_libhardware/include/hardware/hw_auth_token.h new file mode 100644 index 000000000..f471d1ab7 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/hw_auth_token.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2014 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 + +#ifndef ANDROID_HARDWARE_HW_AUTH_TOKEN_H +#define ANDROID_HARDWARE_HW_AUTH_TOKEN_H + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +const uint8_t HW_AUTH_TOKEN_VERSION = 0; + +typedef enum { + HW_AUTH_NONE = 0, + HW_AUTH_PASSWORD = 1 << 0, + HW_AUTH_FINGERPRINT = 1 << 1, + // Additional entries should be powers of 2. + HW_AUTH_ANY = UINT32_MAX, +} hw_authenticator_type_t; + +/** + * Data format for an authentication record used to prove successful authentication. + */ +typedef struct __attribute__((__packed__)) { + uint8_t version; // Current version is 0 + uint64_t challenge; + uint64_t user_id; // secure user ID, not Android user ID + uint64_t authenticator_id; // secure authenticator ID + uint32_t authenticator_type; // hw_authenticator_type_t, in network order + uint64_t timestamp; // in network order + uint8_t hmac[32]; +} hw_auth_token_t; + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus + +#endif // ANDROID_HARDWARE_HW_AUTH_TOKEN_H diff --git a/third_party/android_hardware_libhardware/include/hardware/hwcomposer.h b/third_party/android_hardware_libhardware/include/hardware/hwcomposer.h new file mode 100644 index 000000000..aa466b300 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/hwcomposer.h @@ -0,0 +1,833 @@ +/* + * Copyright (C) 2010 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_HWCOMPOSER_H +#define ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H + +#include +#include + +#include +#include +#include + +#include + +__BEGIN_DECLS + +/*****************************************************************************/ + +/* for compatibility */ +#define HWC_MODULE_API_VERSION HWC_MODULE_API_VERSION_0_1 +#define HWC_DEVICE_API_VERSION HWC_DEVICE_API_VERSION_0_1 +#define HWC_API_VERSION HWC_DEVICE_API_VERSION + +/*****************************************************************************/ + +/** + * The id of this module + */ +#define HWC_HARDWARE_MODULE_ID "hwcomposer" + +/** + * Name of the sensors device to open + */ +#define HWC_HARDWARE_COMPOSER "composer" + +typedef struct hwc_rect { + int left; + int top; + int right; + int bottom; +} hwc_rect_t; + +typedef struct hwc_frect { + float left; + float top; + float right; + float bottom; +} hwc_frect_t; + +typedef struct hwc_region { + size_t numRects; + hwc_rect_t const* rects; +} hwc_region_t; + +typedef struct hwc_color { + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t a; +} hwc_color_t; + +typedef struct hwc_layer_1 { + /* + * compositionType is used to specify this layer's type and is set by either + * the hardware composer implementation, or by the caller (see below). + * + * This field is always reset to HWC_BACKGROUND or HWC_FRAMEBUFFER + * before (*prepare)() is called when the HWC_GEOMETRY_CHANGED flag is + * also set, otherwise, this field is preserved between (*prepare)() + * calls. + * + * HWC_BACKGROUND + * Always set by the caller before calling (*prepare)(), this value + * indicates this is a special "background" layer. The only valid field + * is backgroundColor. + * The HWC can toggle this value to HWC_FRAMEBUFFER to indicate it CANNOT + * handle the background color. + * + * + * HWC_FRAMEBUFFER_TARGET + * Always set by the caller before calling (*prepare)(), this value + * indicates this layer is the framebuffer surface used as the target of + * OpenGL ES composition. If the HWC sets all other layers to HWC_OVERLAY + * or HWC_BACKGROUND, then no OpenGL ES composition will be done, and + * this layer should be ignored during set(). + * + * This flag (and the framebuffer surface layer) will only be used if the + * HWC version is HWC_DEVICE_API_VERSION_1_1 or higher. In older versions, + * the OpenGL ES target surface is communicated by the (dpy, sur) fields + * in hwc_compositor_device_1_t. + * + * This value cannot be set by the HWC implementation. + * + * + * HWC_FRAMEBUFFER + * Set by the caller before calling (*prepare)() ONLY when the + * HWC_GEOMETRY_CHANGED flag is also set. + * + * Set by the HWC implementation during (*prepare)(), this indicates + * that the layer will be drawn into the framebuffer using OpenGL ES. + * The HWC can toggle this value to HWC_OVERLAY to indicate it will + * handle the layer. + * + * + * HWC_OVERLAY + * Set by the HWC implementation during (*prepare)(), this indicates + * that the layer will be handled by the HWC (ie: it must not be + * composited with OpenGL ES). + * + * + * HWC_SIDEBAND + * Set by the caller before calling (*prepare)(), this value indicates + * the contents of this layer come from a sideband video stream. + * + * The h/w composer is responsible for receiving new image buffers from + * the stream at the appropriate time (e.g. synchronized to a separate + * audio stream), compositing them with the current contents of other + * layers, and displaying the resulting image. This happens + * independently of the normal prepare/set cycle. The prepare/set calls + * only happen when other layers change, or when properties of the + * sideband layer such as position or size change. + * + * If the h/w composer can't handle the layer as a sideband stream for + * some reason (e.g. unsupported scaling/blending/rotation, or too many + * sideband layers) it can set compositionType to HWC_FRAMEBUFFER in + * (*prepare)(). However, doing so will result in the layer being shown + * as a solid color since the platform is not currently able to composite + * sideband layers with the GPU. This may be improved in future + * versions of the platform. + * + * + * HWC_CURSOR_OVERLAY + * Set by the HWC implementation during (*prepare)(), this value + * indicates the layer's composition will now be handled by the HWC. + * Additionally, the client can now asynchronously update the on-screen + * position of this layer using the setCursorPositionAsync() api. + */ + int32_t compositionType; + + /* + * hints is bit mask set by the HWC implementation during (*prepare)(). + * It is preserved between (*prepare)() calls, unless the + * HWC_GEOMETRY_CHANGED flag is set, in which case it is reset to 0. + * + * see hwc_layer_t::hints + */ + uint32_t hints; + + /* see hwc_layer_t::flags */ + uint32_t flags; + + union { + /* color of the background. hwc_color_t.a is ignored */ + hwc_color_t backgroundColor; + + struct { + union { + /* When compositionType is HWC_FRAMEBUFFER, HWC_OVERLAY, + * HWC_FRAMEBUFFER_TARGET, this is the handle of the buffer to + * compose. This handle is guaranteed to have been allocated + * from gralloc using the GRALLOC_USAGE_HW_COMPOSER usage flag. + * If the layer's handle is unchanged across two consecutive + * prepare calls and the HWC_GEOMETRY_CHANGED flag is not set + * for the second call then the HWComposer implementation may + * assume that the contents of the buffer have not changed. */ + buffer_handle_t handle; + + /* When compositionType is HWC_SIDEBAND, this is the handle + * of the sideband video stream to compose. */ + const native_handle_t* sidebandStream; + }; + + /* transformation to apply to the buffer during composition */ + uint32_t transform; + + /* blending to apply during composition */ + int32_t blending; + + /* area of the source to consider, the origin is the top-left corner of + * the buffer. As of HWC_DEVICE_API_VERSION_1_3, sourceRect uses floats. + * If the h/w can't support a non-integer source crop rectangle, it should + * punt to OpenGL ES composition. + */ + union { + // crop rectangle in integer (pre HWC_DEVICE_API_VERSION_1_3) + hwc_rect_t sourceCropi; + hwc_rect_t sourceCrop; // just for source compatibility + // crop rectangle in floats (as of HWC_DEVICE_API_VERSION_1_3) + hwc_frect_t sourceCropf; + }; + + /* where to composite the sourceCrop onto the display. The sourceCrop + * is scaled using linear filtering to the displayFrame. The origin is the + * top-left corner of the screen. + */ + hwc_rect_t displayFrame; + + /* visible region in screen space. The origin is the + * top-left corner of the screen. + * The visible region INCLUDES areas overlapped by a translucent layer. + */ + hwc_region_t visibleRegionScreen; + + /* Sync fence object that will be signaled when the buffer's + * contents are available. May be -1 if the contents are already + * available. This field is only valid during set(), and should be + * ignored during prepare(). The set() call must not wait for the + * fence to be signaled before returning, but the HWC must wait for + * all buffers to be signaled before reading from them. + * + * HWC_FRAMEBUFFER layers will never have an acquire fence, since + * reads from them are complete before the framebuffer is ready for + * display. + * + * HWC_SIDEBAND layers will never have an acquire fence, since + * synchronization is handled through implementation-defined + * sideband mechanisms. + * + * The HWC takes ownership of the acquireFenceFd and is responsible + * for closing it when no longer needed. + */ + int acquireFenceFd; + + /* During set() the HWC must set this field to a file descriptor for + * a sync fence object that will signal after the HWC has finished + * reading from the buffer. The field is ignored by prepare(). Each + * layer should have a unique file descriptor, even if more than one + * refer to the same underlying fence object; this allows each to be + * closed independently. + * + * If buffer reads can complete at significantly different times, + * then using independent fences is preferred. For example, if the + * HWC handles some layers with a blit engine and others with + * overlays, then the blit layers can be reused immediately after + * the blit completes, but the overlay layers can't be reused until + * a subsequent frame has been displayed. + * + * Since HWC doesn't read from HWC_FRAMEBUFFER layers, it shouldn't + * produce a release fence for them. The releaseFenceFd will be -1 + * for these layers when set() is called. + * + * Since HWC_SIDEBAND buffers don't pass through the HWC client, + * the HWC shouldn't produce a release fence for them. The + * releaseFenceFd will be -1 for these layers when set() is called. + * + * The HWC client taks ownership of the releaseFenceFd and is + * responsible for closing it when no longer needed. + */ + int releaseFenceFd; + + /* + * Availability: HWC_DEVICE_API_VERSION_1_2 + * + * Alpha value applied to the whole layer. The effective + * value of each pixel is computed as: + * + * if (blending == HWC_BLENDING_PREMULT) + * pixel.rgb = pixel.rgb * planeAlpha / 255 + * pixel.a = pixel.a * planeAlpha / 255 + * + * Then blending proceeds as usual according to the "blending" + * field above. + * + * NOTE: planeAlpha applies to YUV layers as well: + * + * pixel.rgb = yuv_to_rgb(pixel.yuv) + * if (blending == HWC_BLENDING_PREMULT) + * pixel.rgb = pixel.rgb * planeAlpha / 255 + * pixel.a = planeAlpha + * + * + * IMPLEMENTATION NOTE: + * + * If the source image doesn't have an alpha channel, then + * the h/w can use the HWC_BLENDING_COVERAGE equations instead of + * HWC_BLENDING_PREMULT and simply set the alpha channel to + * planeAlpha. + * + * e.g.: + * + * if (blending == HWC_BLENDING_PREMULT) + * blending = HWC_BLENDING_COVERAGE; + * pixel.a = planeAlpha; + * + */ + uint8_t planeAlpha; + + /* Pad to 32 bits */ + uint8_t _pad[3]; + + /* + * Availability: HWC_DEVICE_API_VERSION_1_5 + * + * This defines the region of the source buffer that has been + * modified since the last frame. + * + * If surfaceDamage.numRects > 0, then it may be assumed that any + * portion of the source buffer not covered by one of the rects has + * not been modified this frame. If surfaceDamage.numRects == 0, + * then the whole source buffer must be treated as if it had been + * modified. + * + * If the layer's contents are not modified relative to the prior + * prepare/set cycle, surfaceDamage will contain exactly one empty + * rect ([0, 0, 0, 0]). + * + * The damage rects are relative to the pre-transformed buffer, and + * their origin is the top-left corner. + */ + hwc_region_t surfaceDamage; + }; + }; + +#ifdef __LP64__ + /* + * For 64-bit mode, this struct is 120 bytes (and 8-byte aligned), and needs + * to be padded as such to maintain binary compatibility. + */ + uint8_t reserved[120 - 112]; +#else + /* + * For 32-bit mode, this struct is 96 bytes, and needs to be padded as such + * to maintain binary compatibility. + */ + uint8_t reserved[96 - 84]; +#endif + +} hwc_layer_1_t; + +/* This represents a display, typically an EGLDisplay object */ +typedef void* hwc_display_t; + +/* This represents a surface, typically an EGLSurface object */ +typedef void* hwc_surface_t; + +/* + * hwc_display_contents_1_t::flags values + */ +enum { + /* + * HWC_GEOMETRY_CHANGED is set by SurfaceFlinger to indicate that the list + * passed to (*prepare)() has changed by more than just the buffer handles + * and acquire fences. + */ + HWC_GEOMETRY_CHANGED = 0x00000001, +}; + +/* + * Description of the contents to output on a display. + * + * This is the top-level structure passed to the prepare and set calls to + * negotiate and commit the composition of a display image. + */ +typedef struct hwc_display_contents_1 { + /* File descriptor referring to a Sync HAL fence object which will signal + * when this composition is retired. For a physical display, a composition + * is retired when it has been replaced on-screen by a subsequent set. For + * a virtual display, the composition is retired when the writes to + * outputBuffer are complete and can be read. The fence object is created + * and returned by the set call; this field will be -1 on entry to prepare + * and set. SurfaceFlinger will close the returned file descriptor. + */ + int retireFenceFd; + + union { + /* Fields only relevant for HWC_DEVICE_VERSION_1_0. */ + struct { + /* (dpy, sur) is the target of SurfaceFlinger's OpenGL ES + * composition for HWC_DEVICE_VERSION_1_0. They aren't relevant to + * prepare. The set call should commit this surface atomically to + * the display along with any overlay layers. + */ + hwc_display_t dpy; + hwc_surface_t sur; + }; + + /* These fields are used for virtual displays when the h/w composer + * version is at least HWC_DEVICE_VERSION_1_3. */ + struct { + /* outbuf is the buffer that receives the composed image for + * virtual displays. Writes to the outbuf must wait until + * outbufAcquireFenceFd signals. A fence that will signal when + * writes to outbuf are complete should be returned in + * retireFenceFd. + * + * This field is set before prepare(), so properties of the buffer + * can be used to decide which layers can be handled by h/w + * composer. + * + * If prepare() sets all layers to FRAMEBUFFER, then GLES + * composition will happen directly to the output buffer. In this + * case, both outbuf and the FRAMEBUFFER_TARGET layer's buffer will + * be the same, and set() has no work to do besides managing fences. + * + * If the TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS board config + * variable is defined (not the default), then this behavior is + * changed: if all layers are marked for FRAMEBUFFER, GLES + * composition will take place to a scratch framebuffer, and + * h/w composer must copy it to the output buffer. This allows the + * h/w composer to do format conversion if there are cases where + * that is more desirable than doing it in the GLES driver or at the + * virtual display consumer. + * + * If some or all layers are marked OVERLAY, then the framebuffer + * and output buffer will be different. As with physical displays, + * the framebuffer handle will not change between frames if all + * layers are marked for OVERLAY. + */ + buffer_handle_t outbuf; + + /* File descriptor for a fence that will signal when outbuf is + * ready to be written. The h/w composer is responsible for closing + * this when no longer needed. + * + * Will be -1 whenever outbuf is NULL, or when the outbuf can be + * written immediately. + */ + int outbufAcquireFenceFd; + }; + }; + + /* List of layers that will be composed on the display. The buffer handles + * in the list will be unique. If numHwLayers is 0, all composition will be + * performed by SurfaceFlinger. + */ + uint32_t flags; + size_t numHwLayers; + hwc_layer_1_t hwLayers[0]; + +} hwc_display_contents_1_t; + +/* see hwc_composer_device::registerProcs() + * All of the callbacks are required and non-NULL unless otherwise noted. + */ +typedef struct hwc_procs { + /* + * (*invalidate)() triggers a screen refresh, in particular prepare and set + * will be called shortly after this call is made. Note that there is + * NO GUARANTEE that the screen refresh will happen after invalidate() + * returns (in particular, it could happen before). + * invalidate() is GUARANTEED TO NOT CALL BACK into the h/w composer HAL and + * it is safe to call invalidate() from any of hwc_composer_device + * hooks, unless noted otherwise. + */ + void (*invalidate)(const struct hwc_procs* procs); + + /* + * (*vsync)() is called by the h/w composer HAL when a vsync event is + * received and HWC_EVENT_VSYNC is enabled on a display + * (see: hwc_event_control). + * + * the "disp" parameter indicates which display the vsync event is for. + * the "timestamp" parameter is the system monotonic clock timestamp in + * nanosecond of when the vsync event happened. + * + * vsync() is GUARANTEED TO NOT CALL BACK into the h/w composer HAL. + * + * It is expected that vsync() is called from a thread of at least + * HAL_PRIORITY_URGENT_DISPLAY with as little latency as possible, + * typically less than 0.5 ms. + * + * It is a (silent) error to have HWC_EVENT_VSYNC enabled when calling + * hwc_composer_device.set(..., 0, 0, 0) (screen off). The implementation + * can either stop or continue to process VSYNC events, but must not + * crash or cause other problems. + */ + void (*vsync)(const struct hwc_procs* procs, int disp, int64_t timestamp); + + /* + * (*hotplug)() is called by the h/w composer HAL when a display is + * connected or disconnected. The PRIMARY display is always connected and + * the hotplug callback should not be called for it. + * + * The disp parameter indicates which display type this event is for. + * The connected parameter indicates whether the display has just been + * connected (1) or disconnected (0). + * + * The hotplug() callback may call back into the h/w composer on the same + * thread to query refresh rate and dpi for the display. Additionally, + * other threads may be calling into the h/w composer while the callback + * is in progress. + * + * The h/w composer must serialize calls to the hotplug callback; only + * one thread may call it at a time. + * + * This callback will be NULL if the h/w composer is using + * HWC_DEVICE_API_VERSION_1_0. + */ + void (*hotplug)(const struct hwc_procs* procs, int disp, int connected); + +} hwc_procs_t; + + +/*****************************************************************************/ + +typedef struct hwc_module { + /** + * Common methods of the hardware composer module. This *must* be the first member of + * hwc_module as users of this structure will cast a hw_module_t to + * hwc_module pointer in contexts where it's known the hw_module_t references a + * hwc_module. + */ + struct hw_module_t common; +} hwc_module_t; + +typedef struct hwc_composer_device_1 { + /** + * Common methods of the hardware composer device. This *must* be the first member of + * hwc_composer_device_1 as users of this structure will cast a hw_device_t to + * hwc_composer_device_1 pointer in contexts where it's known the hw_device_t references a + * hwc_composer_device_1. + */ + struct hw_device_t common; + + /* + * (*prepare)() is called for each frame before composition and is used by + * SurfaceFlinger to determine what composition steps the HWC can handle. + * + * (*prepare)() can be called more than once, the last call prevails. + * + * The HWC responds by setting the compositionType field in each layer to + * either HWC_FRAMEBUFFER, HWC_OVERLAY, or HWC_CURSOR_OVERLAY. For the + * HWC_FRAMEBUFFER type, composition for the layer is handled by + * SurfaceFlinger with OpenGL ES. For the latter two overlay types, + * the HWC will have to handle the layer's composition. compositionType + * and hints are preserved between (*prepare)() calles unless the + * HWC_GEOMETRY_CHANGED flag is set. + * + * (*prepare)() is called with HWC_GEOMETRY_CHANGED to indicate that the + * list's geometry has changed, that is, when more than just the buffer's + * handles have been updated. Typically this happens (but is not limited to) + * when a window is added, removed, resized or moved. In this case + * compositionType and hints are reset to their default value. + * + * For HWC 1.0, numDisplays will always be one, and displays[0] will be + * non-NULL. + * + * For HWC 1.1, numDisplays will always be HWC_NUM_PHYSICAL_DISPLAY_TYPES. + * Entries for unsupported or disabled/disconnected display types will be + * NULL. + * + * In HWC 1.3, numDisplays may be up to HWC_NUM_DISPLAY_TYPES. The extra + * entries correspond to enabled virtual displays, and will be non-NULL. + * + * returns: 0 on success. An negative error code on error. If an error is + * returned, SurfaceFlinger will assume that none of the layer will be + * handled by the HWC. + */ + int (*prepare)(struct hwc_composer_device_1 *dev, + size_t numDisplays, hwc_display_contents_1_t** displays); + + /* + * (*set)() is used in place of eglSwapBuffers(), and assumes the same + * functionality, except it also commits the work list atomically with + * the actual eglSwapBuffers(). + * + * The layer lists are guaranteed to be the same as the ones returned from + * the last call to (*prepare)(). + * + * When this call returns the caller assumes that the displays will be + * updated in the near future with the content of their work lists, without + * artifacts during the transition from the previous frame. + * + * A display with zero layers indicates that the entire composition has + * been handled by SurfaceFlinger with OpenGL ES. In this case, (*set)() + * behaves just like eglSwapBuffers(). + * + * For HWC 1.0, numDisplays will always be one, and displays[0] will be + * non-NULL. + * + * For HWC 1.1, numDisplays will always be HWC_NUM_PHYSICAL_DISPLAY_TYPES. + * Entries for unsupported or disabled/disconnected display types will be + * NULL. + * + * In HWC 1.3, numDisplays may be up to HWC_NUM_DISPLAY_TYPES. The extra + * entries correspond to enabled virtual displays, and will be non-NULL. + * + * IMPORTANT NOTE: There is an implicit layer containing opaque black + * pixels behind all the layers in the list. It is the responsibility of + * the hwcomposer module to make sure black pixels are output (or blended + * from). + * + * IMPORTANT NOTE: In the event of an error this call *MUST* still cause + * any fences returned in the previous call to set to eventually become + * signaled. The caller may have already issued wait commands on these + * fences, and having set return without causing those fences to signal + * will likely result in a deadlock. + * + * returns: 0 on success. A negative error code on error: + * HWC_EGL_ERROR: eglGetError() will provide the proper error code (only + * allowed prior to HWComposer 1.1) + * Another code for non EGL errors. + */ + int (*set)(struct hwc_composer_device_1 *dev, + size_t numDisplays, hwc_display_contents_1_t** displays); + + /* + * eventControl(..., event, enabled) + * Enables or disables h/w composer events for a display. + * + * eventControl can be called from any thread and takes effect + * immediately. + * + * Supported events are: + * HWC_EVENT_VSYNC + * + * returns -EINVAL if the "event" parameter is not one of the value above + * or if the "enabled" parameter is not 0 or 1. + */ + int (*eventControl)(struct hwc_composer_device_1* dev, int disp, + int event, int enabled); + + union { + /* + * For HWC 1.3 and earlier, the blank() interface is used. + * + * blank(..., blank) + * Blanks or unblanks a display's screen. + * + * Turns the screen off when blank is nonzero, on when blank is zero. + * Multiple sequential calls with the same blank value must be + * supported. + * The screen state transition must be be complete when the function + * returns. + * + * returns 0 on success, negative on error. + */ + int (*blank)(struct hwc_composer_device_1* dev, int disp, int blank); + + /* + * For HWC 1.4 and above, setPowerMode() will be used in place of + * blank(). + * + * setPowerMode(..., mode) + * Sets the display screen's power state. + * + * Refer to the documentation of the HWC_POWER_MODE_* constants + * for information about each power mode. + * + * The functionality is similar to the blank() command in previous + * versions of HWC, but with support for more power states. + * + * The display driver is expected to retain and restore the low power + * state of the display while entering and exiting from suspend. + * + * Multiple sequential calls with the same mode value must be supported. + * + * The screen state transition must be be complete when the function + * returns. + * + * returns 0 on success, negative on error. + */ + int (*setPowerMode)(struct hwc_composer_device_1* dev, int disp, + int mode); + }; + + /* + * Used to retrieve information about the h/w composer + * + * Returns 0 on success or -errno on error. + */ + int (*query)(struct hwc_composer_device_1* dev, int what, int* value); + + /* + * (*registerProcs)() registers callbacks that the h/w composer HAL can + * later use. It will be called immediately after the composer device is + * opened with non-NULL procs. It is FORBIDDEN to call any of the callbacks + * from within registerProcs(). registerProcs() must save the hwc_procs_t + * pointer which is needed when calling a registered callback. + */ + void (*registerProcs)(struct hwc_composer_device_1* dev, + hwc_procs_t const* procs); + + /* + * This field is OPTIONAL and can be NULL. + * + * If non NULL it will be called by SurfaceFlinger on dumpsys + */ + void (*dump)(struct hwc_composer_device_1* dev, char *buff, int buff_len); + + /* + * (*getDisplayConfigs)() returns handles for the configurations available + * on the connected display. These handles must remain valid as long as the + * display is connected. + * + * Configuration handles are written to configs. The number of entries + * allocated by the caller is passed in *numConfigs; getDisplayConfigs must + * not try to write more than this number of config handles. On return, the + * total number of configurations available for the display is returned in + * *numConfigs. If *numConfigs is zero on entry, then configs may be NULL. + * + * Hardware composers implementing HWC_DEVICE_API_VERSION_1_3 or prior + * shall choose one configuration to activate and report it as the first + * entry in the returned list. Reporting the inactive configurations is not + * required. + * + * HWC_DEVICE_API_VERSION_1_4 and later provide configuration management + * through SurfaceFlinger, and hardware composers implementing these APIs + * must also provide getActiveConfig and setActiveConfig. Hardware composers + * implementing these API versions may choose not to activate any + * configuration, leaving configuration selection to higher levels of the + * framework. + * + * Returns 0 on success or a negative error code on error. If disp is a + * hotpluggable display type and no display is connected, an error shall be + * returned. + * + * This field is REQUIRED for HWC_DEVICE_API_VERSION_1_1 and later. + * It shall be NULL for previous versions. + */ + int (*getDisplayConfigs)(struct hwc_composer_device_1* dev, int disp, + uint32_t* configs, size_t* numConfigs); + + /* + * (*getDisplayAttributes)() returns attributes for a specific config of a + * connected display. The config parameter is one of the config handles + * returned by getDisplayConfigs. + * + * The list of attributes to return is provided in the attributes + * parameter, terminated by HWC_DISPLAY_NO_ATTRIBUTE. The value for each + * requested attribute is written in order to the values array. The + * HWC_DISPLAY_NO_ATTRIBUTE attribute does not have a value, so the values + * array will have one less value than the attributes array. + * + * This field is REQUIRED for HWC_DEVICE_API_VERSION_1_1 and later. + * It shall be NULL for previous versions. + * + * If disp is a hotpluggable display type and no display is connected, + * or if config is not a valid configuration for the display, a negative + * error code shall be returned. + */ + int (*getDisplayAttributes)(struct hwc_composer_device_1* dev, int disp, + uint32_t config, const uint32_t* attributes, int32_t* values); + + /* + * (*getActiveConfig)() returns the index of the configuration that is + * currently active on the connected display. The index is relative to + * the list of configuration handles returned by getDisplayConfigs. If there + * is no active configuration, -1 shall be returned. + * + * Returns the configuration index on success or -1 on error. + * + * This field is REQUIRED for HWC_DEVICE_API_VERSION_1_4 and later. + * It shall be NULL for previous versions. + */ + int (*getActiveConfig)(struct hwc_composer_device_1* dev, int disp); + + /* + * (*setActiveConfig)() instructs the hardware composer to switch to the + * display configuration at the given index in the list of configuration + * handles returned by getDisplayConfigs. + * + * If this function returns without error, any subsequent calls to + * getActiveConfig shall return the index set by this function until one + * of the following occurs: + * 1) Another successful call of this function + * 2) The display is disconnected + * + * Returns 0 on success or a negative error code on error. If disp is a + * hotpluggable display type and no display is connected, or if index is + * outside of the range of hardware configurations returned by + * getDisplayConfigs, an error shall be returned. + * + * This field is REQUIRED for HWC_DEVICE_API_VERSION_1_4 and later. + * It shall be NULL for previous versions. + */ + int (*setActiveConfig)(struct hwc_composer_device_1* dev, int disp, + int index); + /* + * Asynchronously update the location of the cursor layer. + * + * Within the standard prepare()/set() composition loop, the client + * (surfaceflinger) can request that a given layer uses dedicated cursor + * composition hardware by specifiying the HWC_IS_CURSOR_LAYER flag. Only + * one layer per display can have this flag set. If the layer is suitable + * for the platform's cursor hardware, hwcomposer will return from prepare() + * a composition type of HWC_CURSOR_OVERLAY for that layer. This indicates + * not only that the client is not responsible for compositing that layer, + * but also that the client can continue to update the position of that layer + * after a call to set(). This can reduce the visible latency of mouse + * movement to visible, on-screen cursor updates. Calls to + * setCursorPositionAsync() may be made from a different thread doing the + * prepare()/set() composition loop, but care must be taken to not interleave + * calls of setCursorPositionAsync() between calls of set()/prepare(). + * + * Notes: + * - Only one layer per display can be specified as a cursor layer with + * HWC_IS_CURSOR_LAYER. + * - hwcomposer will only return one layer per display as HWC_CURSOR_OVERLAY + * - This returns 0 on success or -errno on error. + * - This field is optional for HWC_DEVICE_API_VERSION_1_4 and later. It + * should be null for previous versions. + */ + int (*setCursorPositionAsync)(struct hwc_composer_device_1 *dev, int disp, int x_pos, int y_pos); + + /* + * Reserved for future use. Must be NULL. + */ + void* reserved_proc[1]; + +} hwc_composer_device_1_t; + +/** convenience API for opening and closing a device */ + +static inline int hwc_open_1(const struct hw_module_t* module, + hwc_composer_device_1_t** device) { + return module->methods->open(module, + HWC_HARDWARE_COMPOSER, (struct hw_device_t**)device); +} + +static inline int hwc_close_1(hwc_composer_device_1_t* device) { + return device->common.close(&device->common); +} + +/*****************************************************************************/ + +__END_DECLS + +#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/hwcomposer_defs.h b/third_party/android_hardware_libhardware/include/hardware/hwcomposer_defs.h new file mode 100644 index 000000000..a90822a4b --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/hwcomposer_defs.h @@ -0,0 +1,263 @@ +/* + * Copyright (C) 2010 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_HWCOMPOSER_DEFS_H +#define ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_DEFS_H + +#include +#include + +#include +#include +#include + +__BEGIN_DECLS + +/*****************************************************************************/ + +#define HWC_HEADER_VERSION 1 + +#define HWC_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) + +#define HWC_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION_2(1, 0, HWC_HEADER_VERSION) +#define HWC_DEVICE_API_VERSION_1_1 HARDWARE_DEVICE_API_VERSION_2(1, 1, HWC_HEADER_VERSION) +#define HWC_DEVICE_API_VERSION_1_2 HARDWARE_DEVICE_API_VERSION_2(1, 2, HWC_HEADER_VERSION) +#define HWC_DEVICE_API_VERSION_1_3 HARDWARE_DEVICE_API_VERSION_2(1, 3, HWC_HEADER_VERSION) +#define HWC_DEVICE_API_VERSION_1_4 HARDWARE_DEVICE_API_VERSION_2(1, 4, HWC_HEADER_VERSION) +#define HWC_DEVICE_API_VERSION_1_5 HARDWARE_DEVICE_API_VERSION_2(1, 5, HWC_HEADER_VERSION) + +enum { + /* hwc_composer_device_t::set failed in EGL */ + HWC_EGL_ERROR = -1 +}; + +/* + * hwc_layer_t::hints values + * Hints are set by the HAL and read by SurfaceFlinger + */ +enum { + /* + * HWC can set the HWC_HINT_TRIPLE_BUFFER hint to indicate to SurfaceFlinger + * that it should triple buffer this layer. Typically HWC does this when + * the layer will be unavailable for use for an extended period of time, + * e.g. if the display will be fetching data directly from the layer and + * the layer can not be modified until after the next set(). + */ + HWC_HINT_TRIPLE_BUFFER = 0x00000001, + + /* + * HWC sets HWC_HINT_CLEAR_FB to tell SurfaceFlinger that it should clear the + * framebuffer with transparent pixels where this layer would be. + * SurfaceFlinger will only honor this flag when the layer has no blending + * + */ + HWC_HINT_CLEAR_FB = 0x00000002 +}; + +/* + * hwc_layer_t::flags values + * Flags are set by SurfaceFlinger and read by the HAL + */ +enum { + /* + * HWC_SKIP_LAYER is set by SurfaceFlnger to indicate that the HAL + * shall not consider this layer for composition as it will be handled + * by SurfaceFlinger (just as if compositionType was set to HWC_OVERLAY). + */ + HWC_SKIP_LAYER = 0x00000001, + + /* + * HWC_IS_CURSOR_LAYER is set by surfaceflinger to indicate that this + * layer is being used as a cursor on this particular display, and that + * surfaceflinger can potentially perform asynchronous position updates for + * this layer. If a call to prepare() returns HWC_CURSOR_OVERLAY for the + * composition type of this layer, then the hwcomposer will allow async + * position updates to this layer via setCursorPositionAsync(). + */ + HWC_IS_CURSOR_LAYER = 0x00000002 +}; + +/* + * hwc_layer_t::compositionType values + */ +enum { + /* this layer is to be drawn into the framebuffer by SurfaceFlinger */ + HWC_FRAMEBUFFER = 0, + + /* this layer will be handled in the HWC */ + HWC_OVERLAY = 1, + + /* this is the background layer. it's used to set the background color. + * there is only a single background layer */ + HWC_BACKGROUND = 2, + + /* this layer holds the result of compositing the HWC_FRAMEBUFFER layers. + * Added in HWC_DEVICE_API_VERSION_1_1. */ + HWC_FRAMEBUFFER_TARGET = 3, + + /* this layer's contents are taken from a sideband buffer stream. + * Added in HWC_DEVICE_API_VERSION_1_4. */ + HWC_SIDEBAND = 4, + + /* this layer's composition will be handled by hwcomposer by dedicated + cursor overlay hardware. hwcomposer will also all async position updates + of this layer outside of the normal prepare()/set() loop. Added in + HWC_DEVICE_API_VERSION_1_4. */ + HWC_CURSOR_OVERLAY = 5 + }; +/* + * hwc_layer_t::blending values + */ +enum { + /* no blending */ + HWC_BLENDING_NONE = 0x0100, + + /* ONE / ONE_MINUS_SRC_ALPHA */ + HWC_BLENDING_PREMULT = 0x0105, + + /* SRC_ALPHA / ONE_MINUS_SRC_ALPHA */ + HWC_BLENDING_COVERAGE = 0x0405 +}; + +/* + * hwc_layer_t::transform values + */ +enum { + /* flip source image horizontally */ + HWC_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H, + /* flip source image vertically */ + HWC_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V, + /* rotate source image 90 degrees clock-wise */ + HWC_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90, + /* rotate source image 180 degrees */ + HWC_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180, + /* rotate source image 270 degrees clock-wise */ + HWC_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270, +}; + +/* attributes queriable with query() */ +enum { + /* + * Must return 1 if the background layer is supported, 0 otherwise. + */ + HWC_BACKGROUND_LAYER_SUPPORTED = 0, + + /* + * Returns the vsync period in nanoseconds. + * + * This query is not used for HWC_DEVICE_API_VERSION_1_1 and later. + * Instead, the per-display attribute HWC_DISPLAY_VSYNC_PERIOD is used. + */ + HWC_VSYNC_PERIOD = 1, + + /* + * Availability: HWC_DEVICE_API_VERSION_1_1 + * Returns a mask of supported display types. + */ + HWC_DISPLAY_TYPES_SUPPORTED = 2, +}; + +/* display attributes returned by getDisplayAttributes() */ +enum { + /* Indicates the end of an attribute list */ + HWC_DISPLAY_NO_ATTRIBUTE = 0, + + /* The vsync period in nanoseconds */ + HWC_DISPLAY_VSYNC_PERIOD = 1, + + /* The number of pixels in the horizontal and vertical directions. */ + HWC_DISPLAY_WIDTH = 2, + HWC_DISPLAY_HEIGHT = 3, + + /* The number of pixels per thousand inches of this configuration. + * + * Scaling DPI by 1000 allows it to be stored in an int without losing + * too much precision. + * + * If the DPI for a configuration is unavailable or the HWC implementation + * considers it unreliable, it should set these attributes to zero. + */ + HWC_DISPLAY_DPI_X = 4, + HWC_DISPLAY_DPI_Y = 5, + + /* Indicates which of the vendor-defined color transforms is provided by + * this configuration. */ + HWC_DISPLAY_COLOR_TRANSFORM = 6, +}; + +/* Allowed events for hwc_methods::eventControl() */ +enum { + HWC_EVENT_VSYNC = 0 +}; + +/* Display types and associated mask bits. */ +enum { + HWC_DISPLAY_PRIMARY = 0, + HWC_DISPLAY_EXTERNAL = 1, // HDMI, DP, etc. +#ifdef QTI_BSP + HWC_DISPLAY_TERTIARY = 2, + HWC_DISPLAY_VIRTUAL = 3, + + HWC_NUM_PHYSICAL_DISPLAY_TYPES = 3, + HWC_NUM_DISPLAY_TYPES = 4, +#else + HWC_DISPLAY_VIRTUAL = 2, + + HWC_NUM_PHYSICAL_DISPLAY_TYPES = 2, + HWC_NUM_DISPLAY_TYPES = 3, +#endif +}; + +enum { + HWC_DISPLAY_PRIMARY_BIT = 1 << HWC_DISPLAY_PRIMARY, + HWC_DISPLAY_EXTERNAL_BIT = 1 << HWC_DISPLAY_EXTERNAL, +#ifdef QTI_BSP + HWC_DISPLAY_TERTIARY_BIT = 1 << HWC_DISPLAY_TERTIARY, +#endif + HWC_DISPLAY_VIRTUAL_BIT = 1 << HWC_DISPLAY_VIRTUAL, +}; + +/* Display power modes */ +enum { + /* The display is turned off (blanked). */ + HWC_POWER_MODE_OFF = 0, + /* The display is turned on and configured in a low power state + * that is suitable for presenting ambient information to the user, + * possibly with lower fidelity than normal but greater efficiency. */ + HWC_POWER_MODE_DOZE = 1, + /* The display is turned on normally. */ + HWC_POWER_MODE_NORMAL = 2, + /* The display is configured as in HWC_POWER_MODE_DOZE but may + * stop applying frame buffer updates from the graphics subsystem. + * This power mode is effectively a hint from the doze dream to + * tell the hardware that it is done drawing to the display for the + * time being and that the display should remain on in a low power + * state and continue showing its current contents indefinitely + * until the mode changes. + * + * This mode may also be used as a signal to enable hardware-based doze + * functionality. In this case, the doze dream is effectively + * indicating that the hardware is free to take over the display + * and manage it autonomously to implement low power always-on display + * functionality. */ + HWC_POWER_MODE_DOZE_SUSPEND = 3, +}; + +/*****************************************************************************/ + +__END_DECLS + +#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_DEFS_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/input.h b/third_party/android_hardware_libhardware/include/hardware/input.h new file mode 100644 index 000000000..969b8ce57 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/input.h @@ -0,0 +1,549 @@ +/* + * Copyright (C) 2015 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_INPUT_H +#define ANDROID_INCLUDE_HARDWARE_INPUT_H + +#include +#include + +__BEGIN_DECLS + +#define INPUT_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) +#define INPUT_HARDWARE_MODULE_ID "input" + +#define INPUT_INSTANCE_EVDEV "evdev" + +typedef enum input_bus { + INPUT_BUS_BT, + INPUT_BUS_USB, + INPUT_BUS_SERIAL, + INPUT_BUS_BUILTIN +} input_bus_t; + +typedef struct input_host input_host_t; + +typedef struct input_device_handle input_device_handle_t; + +typedef struct input_device_identifier input_device_identifier_t; + +typedef struct input_device_definition input_device_definition_t; + +typedef struct input_report_definition input_report_definition_t; + +typedef struct input_report input_report_t; + +typedef struct input_collection input_collection_t; + +typedef struct input_property_map input_property_map_t; + +typedef struct input_property input_property_t; + +typedef enum { + // keycodes + INPUT_USAGE_KEYCODE_UNKNOWN, + INPUT_USAGE_KEYCODE_SOFT_LEFT, + INPUT_USAGE_KEYCODE_SOFT_RIGHT, + INPUT_USAGE_KEYCODE_HOME, + INPUT_USAGE_KEYCODE_BACK, + INPUT_USAGE_KEYCODE_CALL, + INPUT_USAGE_KEYCODE_ENDCALL, + INPUT_USAGE_KEYCODE_0, + INPUT_USAGE_KEYCODE_1, + INPUT_USAGE_KEYCODE_2, + INPUT_USAGE_KEYCODE_3, + INPUT_USAGE_KEYCODE_4, + INPUT_USAGE_KEYCODE_5, + INPUT_USAGE_KEYCODE_6, + INPUT_USAGE_KEYCODE_7, + INPUT_USAGE_KEYCODE_8, + INPUT_USAGE_KEYCODE_9, + INPUT_USAGE_KEYCODE_STAR, + INPUT_USAGE_KEYCODE_POUND, + INPUT_USAGE_KEYCODE_DPAD_UP, + INPUT_USAGE_KEYCODE_DPAD_DOWN, + INPUT_USAGE_KEYCODE_DPAD_LEFT, + INPUT_USAGE_KEYCODE_DPAD_RIGHT, + INPUT_USAGE_KEYCODE_DPAD_CENTER, + INPUT_USAGE_KEYCODE_VOLUME_UP, + INPUT_USAGE_KEYCODE_VOLUME_DOWN, + INPUT_USAGE_KEYCODE_POWER, + INPUT_USAGE_KEYCODE_CAMERA, + INPUT_USAGE_KEYCODE_CLEAR, + INPUT_USAGE_KEYCODE_A, + INPUT_USAGE_KEYCODE_B, + INPUT_USAGE_KEYCODE_C, + INPUT_USAGE_KEYCODE_D, + INPUT_USAGE_KEYCODE_E, + INPUT_USAGE_KEYCODE_F, + INPUT_USAGE_KEYCODE_G, + INPUT_USAGE_KEYCODE_H, + INPUT_USAGE_KEYCODE_I, + INPUT_USAGE_KEYCODE_J, + INPUT_USAGE_KEYCODE_K, + INPUT_USAGE_KEYCODE_L, + INPUT_USAGE_KEYCODE_M, + INPUT_USAGE_KEYCODE_N, + INPUT_USAGE_KEYCODE_O, + INPUT_USAGE_KEYCODE_P, + INPUT_USAGE_KEYCODE_Q, + INPUT_USAGE_KEYCODE_R, + INPUT_USAGE_KEYCODE_S, + INPUT_USAGE_KEYCODE_T, + INPUT_USAGE_KEYCODE_U, + INPUT_USAGE_KEYCODE_V, + INPUT_USAGE_KEYCODE_W, + INPUT_USAGE_KEYCODE_X, + INPUT_USAGE_KEYCODE_Y, + INPUT_USAGE_KEYCODE_Z, + INPUT_USAGE_KEYCODE_COMMA, + INPUT_USAGE_KEYCODE_PERIOD, + INPUT_USAGE_KEYCODE_ALT_LEFT, + INPUT_USAGE_KEYCODE_ALT_RIGHT, + INPUT_USAGE_KEYCODE_SHIFT_LEFT, + INPUT_USAGE_KEYCODE_SHIFT_RIGHT, + INPUT_USAGE_KEYCODE_TAB, + INPUT_USAGE_KEYCODE_SPACE, + INPUT_USAGE_KEYCODE_SYM, + INPUT_USAGE_KEYCODE_EXPLORER, + INPUT_USAGE_KEYCODE_ENVELOPE, + INPUT_USAGE_KEYCODE_ENTER, + INPUT_USAGE_KEYCODE_DEL, + INPUT_USAGE_KEYCODE_GRAVE, + INPUT_USAGE_KEYCODE_MINUS, + INPUT_USAGE_KEYCODE_EQUALS, + INPUT_USAGE_KEYCODE_LEFT_BRACKET, + INPUT_USAGE_KEYCODE_RIGHT_BRACKET, + INPUT_USAGE_KEYCODE_BACKSLASH, + INPUT_USAGE_KEYCODE_SEMICOLON, + INPUT_USAGE_KEYCODE_APOSTROPHE, + INPUT_USAGE_KEYCODE_SLASH, + INPUT_USAGE_KEYCODE_AT, + INPUT_USAGE_KEYCODE_NUM, + INPUT_USAGE_KEYCODE_HEADSETHOOK, + INPUT_USAGE_KEYCODE_FOCUS, // *Camera* focus + INPUT_USAGE_KEYCODE_PLUS, + INPUT_USAGE_KEYCODE_MENU, + INPUT_USAGE_KEYCODE_NOTIFICATION, + INPUT_USAGE_KEYCODE_SEARCH, + INPUT_USAGE_KEYCODE_MEDIA_PLAY_PAUSE, + INPUT_USAGE_KEYCODE_MEDIA_STOP, + INPUT_USAGE_KEYCODE_MEDIA_NEXT, + INPUT_USAGE_KEYCODE_MEDIA_PREVIOUS, + INPUT_USAGE_KEYCODE_MEDIA_REWIND, + INPUT_USAGE_KEYCODE_MEDIA_FAST_FORWARD, + INPUT_USAGE_KEYCODE_MUTE, + INPUT_USAGE_KEYCODE_PAGE_UP, + INPUT_USAGE_KEYCODE_PAGE_DOWN, + INPUT_USAGE_KEYCODE_PICTSYMBOLS, + INPUT_USAGE_KEYCODE_SWITCH_CHARSET, + INPUT_USAGE_KEYCODE_BUTTON_A, + INPUT_USAGE_KEYCODE_BUTTON_B, + INPUT_USAGE_KEYCODE_BUTTON_C, + INPUT_USAGE_KEYCODE_BUTTON_X, + INPUT_USAGE_KEYCODE_BUTTON_Y, + INPUT_USAGE_KEYCODE_BUTTON_Z, + INPUT_USAGE_KEYCODE_BUTTON_L1, + INPUT_USAGE_KEYCODE_BUTTON_R1, + INPUT_USAGE_KEYCODE_BUTTON_L2, + INPUT_USAGE_KEYCODE_BUTTON_R2, + INPUT_USAGE_KEYCODE_BUTTON_THUMBL, + INPUT_USAGE_KEYCODE_BUTTON_THUMBR, + INPUT_USAGE_KEYCODE_BUTTON_START, + INPUT_USAGE_KEYCODE_BUTTON_SELECT, + INPUT_USAGE_KEYCODE_BUTTON_MODE, + INPUT_USAGE_KEYCODE_ESCAPE, + INPUT_USAGE_KEYCODE_FORWARD_DEL, + INPUT_USAGE_KEYCODE_CTRL_LEFT, + INPUT_USAGE_KEYCODE_CTRL_RIGHT, + INPUT_USAGE_KEYCODE_CAPS_LOCK, + INPUT_USAGE_KEYCODE_SCROLL_LOCK, + INPUT_USAGE_KEYCODE_META_LEFT, + INPUT_USAGE_KEYCODE_META_RIGHT, + INPUT_USAGE_KEYCODE_FUNCTION, + INPUT_USAGE_KEYCODE_SYSRQ, + INPUT_USAGE_KEYCODE_BREAK, + INPUT_USAGE_KEYCODE_MOVE_HOME, + INPUT_USAGE_KEYCODE_MOVE_END, + INPUT_USAGE_KEYCODE_INSERT, + INPUT_USAGE_KEYCODE_FORWARD, + INPUT_USAGE_KEYCODE_MEDIA_PLAY, + INPUT_USAGE_KEYCODE_MEDIA_PAUSE, + INPUT_USAGE_KEYCODE_MEDIA_CLOSE, + INPUT_USAGE_KEYCODE_MEDIA_EJECT, + INPUT_USAGE_KEYCODE_MEDIA_RECORD, + INPUT_USAGE_KEYCODE_F1, + INPUT_USAGE_KEYCODE_F2, + INPUT_USAGE_KEYCODE_F3, + INPUT_USAGE_KEYCODE_F4, + INPUT_USAGE_KEYCODE_F5, + INPUT_USAGE_KEYCODE_F6, + INPUT_USAGE_KEYCODE_F7, + INPUT_USAGE_KEYCODE_F8, + INPUT_USAGE_KEYCODE_F9, + INPUT_USAGE_KEYCODE_F10, + INPUT_USAGE_KEYCODE_F11, + INPUT_USAGE_KEYCODE_F12, + INPUT_USAGE_KEYCODE_NUM_LOCK, + INPUT_USAGE_KEYCODE_NUMPAD_0, + INPUT_USAGE_KEYCODE_NUMPAD_1, + INPUT_USAGE_KEYCODE_NUMPAD_2, + INPUT_USAGE_KEYCODE_NUMPAD_3, + INPUT_USAGE_KEYCODE_NUMPAD_4, + INPUT_USAGE_KEYCODE_NUMPAD_5, + INPUT_USAGE_KEYCODE_NUMPAD_6, + INPUT_USAGE_KEYCODE_NUMPAD_7, + INPUT_USAGE_KEYCODE_NUMPAD_8, + INPUT_USAGE_KEYCODE_NUMPAD_9, + INPUT_USAGE_KEYCODE_NUMPAD_DIVIDE, + INPUT_USAGE_KEYCODE_NUMPAD_MULTIPLY, + INPUT_USAGE_KEYCODE_NUMPAD_SUBTRACT, + INPUT_USAGE_KEYCODE_NUMPAD_ADD, + INPUT_USAGE_KEYCODE_NUMPAD_DOT, + INPUT_USAGE_KEYCODE_NUMPAD_COMMA, + INPUT_USAGE_KEYCODE_NUMPAD_ENTER, + INPUT_USAGE_KEYCODE_NUMPAD_EQUALS, + INPUT_USAGE_KEYCODE_NUMPAD_LEFT_PAREN, + INPUT_USAGE_KEYCODE_NUMPAD_RIGHT_PAREN, + INPUT_USAGE_KEYCODE_VOLUME_MUTE, + INPUT_USAGE_KEYCODE_INFO, + INPUT_USAGE_KEYCODE_CHANNEL_UP, + INPUT_USAGE_KEYCODE_CHANNEL_DOWN, + INPUT_USAGE_KEYCODE_ZOOM_IN, + INPUT_USAGE_KEYCODE_ZOOM_OUT, + INPUT_USAGE_KEYCODE_TV, + INPUT_USAGE_KEYCODE_WINDOW, + INPUT_USAGE_KEYCODE_GUIDE, + INPUT_USAGE_KEYCODE_DVR, + INPUT_USAGE_KEYCODE_BOOKMARK, + INPUT_USAGE_KEYCODE_CAPTIONS, + INPUT_USAGE_KEYCODE_SETTINGS, + INPUT_USAGE_KEYCODE_TV_POWER, + INPUT_USAGE_KEYCODE_TV_INPUT, + INPUT_USAGE_KEYCODE_STB_POWER, + INPUT_USAGE_KEYCODE_STB_INPUT, + INPUT_USAGE_KEYCODE_AVR_POWER, + INPUT_USAGE_KEYCODE_AVR_INPUT, + INPUT_USAGE_KEYCODE_PROG_RED, + INPUT_USAGE_KEYCODE_PROG_GREEN, + INPUT_USAGE_KEYCODE_PROG_YELLOW, + INPUT_USAGE_KEYCODE_PROG_BLUE, + INPUT_USAGE_KEYCODE_APP_SWITCH, + INPUT_USAGE_KEYCODE_BUTTON_1, + INPUT_USAGE_KEYCODE_BUTTON_2, + INPUT_USAGE_KEYCODE_BUTTON_3, + INPUT_USAGE_KEYCODE_BUTTON_4, + INPUT_USAGE_KEYCODE_BUTTON_5, + INPUT_USAGE_KEYCODE_BUTTON_6, + INPUT_USAGE_KEYCODE_BUTTON_7, + INPUT_USAGE_KEYCODE_BUTTON_8, + INPUT_USAGE_KEYCODE_BUTTON_9, + INPUT_USAGE_KEYCODE_BUTTON_10, + INPUT_USAGE_KEYCODE_BUTTON_11, + INPUT_USAGE_KEYCODE_BUTTON_12, + INPUT_USAGE_KEYCODE_BUTTON_13, + INPUT_USAGE_KEYCODE_BUTTON_14, + INPUT_USAGE_KEYCODE_BUTTON_15, + INPUT_USAGE_KEYCODE_BUTTON_16, + INPUT_USAGE_KEYCODE_LANGUAGE_SWITCH, + INPUT_USAGE_KEYCODE_MANNER_MODE, + INPUT_USAGE_KEYCODE_3D_MODE, + INPUT_USAGE_KEYCODE_CONTACTS, + INPUT_USAGE_KEYCODE_CALENDAR, + INPUT_USAGE_KEYCODE_MUSIC, + INPUT_USAGE_KEYCODE_CALCULATOR, + INPUT_USAGE_KEYCODE_ZENKAKU_HANKAKU, + INPUT_USAGE_KEYCODE_EISU, + INPUT_USAGE_KEYCODE_MUHENKAN, + INPUT_USAGE_KEYCODE_HENKAN, + INPUT_USAGE_KEYCODE_KATAKANA_HIRAGANA, + INPUT_USAGE_KEYCODE_YEN, + INPUT_USAGE_KEYCODE_RO, + INPUT_USAGE_KEYCODE_KANA, + INPUT_USAGE_KEYCODE_ASSIST, + INPUT_USAGE_KEYCODE_BRIGHTNESS_DOWN, + INPUT_USAGE_KEYCODE_BRIGHTNESS_UP, + INPUT_USAGE_KEYCODE_MEDIA_AUDIO_TRACK, + INPUT_USAGE_KEYCODE_SLEEP, + INPUT_USAGE_KEYCODE_WAKEUP, + INPUT_USAGE_KEYCODE_PAIRING, + INPUT_USAGE_KEYCODE_MEDIA_TOP_MENU, + INPUT_USAGE_KEYCODE_11, + INPUT_USAGE_KEYCODE_12, + INPUT_USAGE_KEYCODE_LAST_CHANNEL, + INPUT_USAGE_KEYCODE_TV_DATA_SERVICE, + INPUT_USAGE_KEYCODE_VOICE_ASSIST, + INPUT_USAGE_KEYCODE_TV_RADIO_SERVICE, + INPUT_USAGE_KEYCODE_TV_TELETEXT, + INPUT_USAGE_KEYCODE_TV_NUMBER_ENTRY, + INPUT_USAGE_KEYCODE_TV_TERRESTRIAL_ANALOG, + INPUT_USAGE_KEYCODE_TV_TERRESTRIAL_DIGITAL, + INPUT_USAGE_KEYCODE_TV_SATELLITE, + INPUT_USAGE_KEYCODE_TV_SATELLITE_BS, + INPUT_USAGE_KEYCODE_TV_SATELLITE_CS, + INPUT_USAGE_KEYCODE_TV_SATELLITE_SERVICE, + INPUT_USAGE_KEYCODE_TV_NETWORK, + INPUT_USAGE_KEYCODE_TV_ANTENNA_CABLE, + INPUT_USAGE_KEYCODE_TV_INPUT_HDMI_1, + INPUT_USAGE_KEYCODE_TV_INPUT_HDMI_2, + INPUT_USAGE_KEYCODE_TV_INPUT_HDMI_3, + INPUT_USAGE_KEYCODE_TV_INPUT_HDMI_4, + INPUT_USAGE_KEYCODE_TV_INPUT_COMPOSITE_1, + INPUT_USAGE_KEYCODE_TV_INPUT_COMPOSITE_2, + INPUT_USAGE_KEYCODE_TV_INPUT_COMPONENT_1, + INPUT_USAGE_KEYCODE_TV_INPUT_COMPONENT_2, + INPUT_USAGE_KEYCODE_TV_INPUT_VGA_1, + INPUT_USAGE_KEYCODE_TV_AUDIO_DESCRIPTION, + INPUT_USAGE_KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP, + INPUT_USAGE_KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN, + INPUT_USAGE_KEYCODE_TV_ZOOM_MODE, + INPUT_USAGE_KEYCODE_TV_CONTENTS_MENU, + INPUT_USAGE_KEYCODE_TV_MEDIA_CONTEXT_MENU, + INPUT_USAGE_KEYCODE_TV_TIMER_PROGRAMMING, + INPUT_USAGE_KEYCODE_HELP, + + // axes + INPUT_USAGE_AXIS_X, + INPUT_USAGE_AXIS_Y, + INPUT_USAGE_AXIS_PRESSURE, + INPUT_USAGE_AXIS_SIZE, + INPUT_USAGE_AXIS_TOUCH_MAJOR, + INPUT_USAGE_AXIS_TOUCH_MINOR, + INPUT_USAGE_AXIS_TOOL_MAJOR, + INPUT_USAGE_AXIS_TOOL_MINOR, + INPUT_USAGE_AXIS_ORIENTATION, + INPUT_USAGE_AXIS_VSCROLL, + INPUT_USAGE_AXIS_HSCROLL, + INPUT_USAGE_AXIS_Z, + INPUT_USAGE_AXIS_RX, + INPUT_USAGE_AXIS_RY, + INPUT_USAGE_AXIS_RZ, + INPUT_USAGE_AXIS_HAT_X, + INPUT_USAGE_AXIS_HAT_Y, + INPUT_USAGE_AXIS_LTRIGGER, + INPUT_USAGE_AXIS_RTRIGGER, + INPUT_USAGE_AXIS_THROTTLE, + INPUT_USAGE_AXIS_RUDDER, + INPUT_USAGE_AXIS_WHEEL, + INPUT_USAGE_AXIS_GAS, + INPUT_USAGE_AXIS_BRAKE, + INPUT_USAGE_AXIS_DISTANCE, + INPUT_USAGE_AXIS_TILT, + INPUT_USAGE_AXIS_GENERIC_1, + INPUT_USAGE_AXIS_GENERIC_2, + INPUT_USAGE_AXIS_GENERIC_3, + INPUT_USAGE_AXIS_GENERIC_4, + INPUT_USAGE_AXIS_GENERIC_5, + INPUT_USAGE_AXIS_GENERIC_6, + INPUT_USAGE_AXIS_GENERIC_7, + INPUT_USAGE_AXIS_GENERIC_8, + INPUT_USAGE_AXIS_GENERIC_9, + INPUT_USAGE_AXIS_GENERIC_10, + INPUT_USAGE_AXIS_GENERIC_11, + INPUT_USAGE_AXIS_GENERIC_12, + INPUT_USAGE_AXIS_GENERIC_13, + INPUT_USAGE_AXIS_GENERIC_14, + INPUT_USAGE_AXIS_GENERIC_15, + INPUT_USAGE_AXIS_GENERIC_16, + + // leds + INPUT_USAGE_LED_NUM_LOCK, + INPUT_USAGE_LED_CAPS_LOCK, + INPUT_USAGE_LED_SCROLL_LOCK, + INPUT_USAGE_LED_COMPOSE, + INPUT_USAGE_LED_KANA, + INPUT_USAGE_LED_SLEEP, + INPUT_USAGE_LED_SUSPEND, + INPUT_USAGE_LED_MUTE, + INPUT_USAGE_LED_MISC, + INPUT_USAGE_LED_MAIL, + INPUT_USAGE_LED_CHARGING, + INPUT_USAGE_LED_CONTROLLER_1, + INPUT_USAGE_LED_CONTROLLER_2, + INPUT_USAGE_LED_CONTROLLER_3, + INPUT_USAGE_LED_CONTROLLER_4, +} input_usage_t; + +typedef enum { + INPUT_COLLECTION_ID_TOUCH, + INPUT_COLLECTION_ID_KEYBOARD, + INPUT_COLLECTION_ID_MOUSE, + INPUT_COLLECTION_ID_TOUCHPAD, + // etc +} input_collection_id_t; + +typedef struct input_message input_message_t; + +typedef struct input_host_callbacks { + + /** + * Creates a device identifier with the given properties. + * The unique ID should be a string that precisely identifies a given piece of hardware. For + * example, an input device connected via Bluetooth could use its MAC address as its unique ID. + */ + input_device_identifier_t* (*create_device_identifier)(input_host_t* host, + const char* name, int32_t product_id, int32_t vendor_id, + input_bus_t bus, const char* unique_id); + + /** + * Allocates the device definition which will describe the input capabilities of a device. A + * device definition may be used to register as many devices as desired. + */ + input_device_definition_t* (*create_device_definition)(input_host_t* host); + + /** + * Allocate either an input report, which the HAL will use to tell the host of incoming input + * events, or an output report, which the host will use to tell the HAL of desired state + * changes (e.g. setting an LED). + */ + input_report_definition_t* (*create_input_report_definition)(input_host_t* host); + input_report_definition_t* (*create_output_report_definition)(input_host_t* host); + + /** + * Append the report to the given input device. + */ + void (*input_device_definition_add_report)(input_host_t* host, + input_device_definition_t* d, input_report_definition_t* r); + + /** + * Add a collection with the given arity and ID. A collection describes a set + * of logically grouped properties such as the X and Y coordinates of a single finger touch or + * the set of keys on a keyboard. The arity declares how many repeated instances of this + * collection will appear in whatever report it is attached to. The ID describes the type of + * grouping being represented by the collection. For example, a touchscreen capable of + * reporting up to 2 fingers simultaneously might have a collection with the X and Y + * coordinates, an arity of 2, and an ID of INPUT_COLLECTION_USAGE_TOUCHSCREEN. Any given ID + * may only be present once for a given report. + */ + void (*input_report_definition_add_collection)(input_host_t* host, + input_report_definition_t* report, input_collection_id_t id, int32_t arity); + + /** + * Declare an int usage with the given properties. The report and collection defines where the + * usage is being declared. + */ + void (*input_report_definition_declare_usage_int)(input_host_t* host, + input_report_definition_t* report, input_collection_id_t id, + input_usage_t usage, int32_t min, int32_t max, float resolution); + + /** + * Declare a set of boolean usages with the given properties. The report and collection + * defines where the usages are being declared. + */ + void (*input_report_definition_declare_usages_bool)(input_host_t* host, + input_report_definition_t* report, input_collection_id_t id, + input_usage_t* usage, size_t usage_count); + + + /** + * Register a given input device definition. This notifies the host that an input device has + * been connected and gives a description of all its capabilities. + */ + input_device_handle_t* (*register_device)(input_host_t* host, + input_device_identifier_t* id, input_device_definition_t* d); + + /** Unregister the given device */ + void (*unregister_device)(input_host_t* host, input_device_handle_t* handle); + + /** + * Allocate a report that will contain all of the state as described by the given report. + */ + input_report_t* (*input_allocate_report)(input_host_t* host, input_report_definition_t* r); + + /** + * Add an int usage value to a report. + */ + void (*input_report_set_usage_int)(input_host_t* host, input_report_t* r, + input_collection_id_t id, input_usage_t usage, int32_t value, int32_t arity_index); + + /** + * Add a boolean usage value to a report. + */ + void (*input_report_set_usage_bool)(input_host_t* host, input_report_t* r, + input_collection_id_t id, input_usage_t usage, bool value, int32_t arity_index); + + void (*report_event)(input_host_t* host, input_device_handle_t* d, input_report_t* report); + + /** + * Retrieve the set of properties for the device. The returned + * input_property_map_t* may be used to query specific properties via the + * input_get_device_property callback. + */ + input_property_map_t* (*input_get_device_property_map)(input_host_t* host, + input_device_identifier_t* id); + /** + * Retrieve a property for the device with the given key. Returns NULL if + * the key does not exist, or an input_property_t* that must be freed using + * input_free_device_property(). Using an input_property_t after the + * corresponding input_property_map_t is freed is undefined. + */ + input_property_t* (*input_get_device_property)(input_host_t* host, + input_property_map_t* map, const char* key); + + /** + * Get the key for the input property. Returns NULL if the property is NULL. + * The returned const char* is owned by the input_property_t. + */ + const char* (*input_get_property_key)(input_host_t* host, input_property_t* property); + + /** + * Get the value for the input property. Returns NULL if the property is + * NULL. The returned const char* is owned by the input_property_t. + */ + const char* (*input_get_property_value)(input_host_t* host, input_property_t* property); + + /** + * Frees the input_property_t*. + */ + void (*input_free_device_property)(input_host_t* host, input_property_t* property); + + /** + * Frees the input_property_map_t*. + */ + void (*input_free_device_property_map)(input_host_t* host, input_property_map_t* map); +} input_host_callbacks_t; + +typedef struct input_module input_module_t; + +struct input_module { + /** + * Common methods of the input module. This *must* be the first member + * of input_module as users of this structure will cast a hw_module_t + * to input_module pointer in contexts where it's known + * the hw_module_t references a input_module. + */ + struct hw_module_t common; + + /** + * Initialize the module with host callbacks. At this point the HAL should start up whatever + * infrastructure it needs to in order to process input events. + */ + void (*init)(const input_module_t* module, input_host_t* host, input_host_callbacks_t cb); + + /** + * Sends an output report with a new set of state the host would like the given device to + * assume. + */ + void (*notify_report)(const input_module_t* module, input_report_t* report); +}; + +static inline int input_open(const struct hw_module_t** module, const char* type) { + return hw_get_module_by_class(INPUT_HARDWARE_MODULE_ID, type, module); +} + +__END_DECLS + +#endif /* ANDROID_INCLUDE_HARDWARE_INPUT_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/keymaster0.h b/third_party/android_hardware_libhardware/include/hardware/keymaster0.h new file mode 100644 index 000000000..f020e5b18 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/keymaster0.h @@ -0,0 +1,149 @@ +/* + * 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_HARDWARE_KEYMASTER_0_H +#define ANDROID_HARDWARE_KEYMASTER_0_H + +#include + +__BEGIN_DECLS + +/** + * Keymaster0 device definition. + */ +struct keymaster0_device { + /** + * Common methods of the keymaster device. This *must* be the first member of + * keymaster0_device as users of this structure will cast a hw_device_t to + * keymaster0_device pointer in contexts where it's known the hw_device_t references a + * keymaster0_device. + */ + struct hw_device_t common; + + /** + * THIS IS DEPRECATED. Use the new "module_api_version" and "hal_api_version" + * fields in the keymaster_module initialization instead. + */ + uint32_t client_version; + + /** + * See flags defined for keymaster0_device::flags in keymaster_common.h + */ + uint32_t flags; + + void* context; + + /** + * Generates a public and private key. The key-blob returned is opaque + * and must subsequently provided for signing and verification. + * + * Returns: 0 on success or an error code less than 0. + */ + int (*generate_keypair)(const struct keymaster0_device* dev, + const keymaster_keypair_t key_type, const void* key_params, + uint8_t** key_blob, size_t* key_blob_length); + + /** + * Imports a public and private key pair. The imported keys will be in + * PKCS#8 format with DER encoding (Java standard). The key-blob + * returned is opaque and will be subsequently provided for signing + * and verification. + * + * Returns: 0 on success or an error code less than 0. + */ + int (*import_keypair)(const struct keymaster0_device* dev, + const uint8_t* key, const size_t key_length, + uint8_t** key_blob, size_t* key_blob_length); + + /** + * Gets the public key part of a key pair. The public key must be in + * X.509 format (Java standard) encoded byte array. + * + * Returns: 0 on success or an error code less than 0. + * On error, x509_data should not be allocated. + */ + int (*get_keypair_public)(const struct keymaster0_device* dev, + const uint8_t* key_blob, const size_t key_blob_length, + uint8_t** x509_data, size_t* x509_data_length); + + /** + * Deletes the key pair associated with the key blob. + * + * This function is optional and should be set to NULL if it is not + * implemented. + * + * Returns 0 on success or an error code less than 0. + */ + int (*delete_keypair)(const struct keymaster0_device* dev, + const uint8_t* key_blob, const size_t key_blob_length); + + /** + * Deletes all keys in the hardware keystore. Used when keystore is + * reset completely. + * + * This function is optional and should be set to NULL if it is not + * implemented. + * + * Returns 0 on success or an error code less than 0. + */ + int (*delete_all)(const struct keymaster0_device* dev); + + /** + * Signs data using a key-blob generated before. This can use either + * an asymmetric key or a secret key. + * + * Returns: 0 on success or an error code less than 0. + */ + int (*sign_data)(const struct keymaster0_device* dev, + const void* signing_params, + const uint8_t* key_blob, const size_t key_blob_length, + const uint8_t* data, const size_t data_length, + uint8_t** signed_data, size_t* signed_data_length); + + /** + * Verifies data signed with a key-blob. This can use either + * an asymmetric key or a secret key. + * + * Returns: 0 on successful verification or an error code less than 0. + */ + int (*verify_data)(const struct keymaster0_device* dev, + const void* signing_params, + const uint8_t* key_blob, const size_t key_blob_length, + const uint8_t* signed_data, const size_t signed_data_length, + const uint8_t* signature, const size_t signature_length); +}; +typedef struct keymaster0_device keymaster0_device_t; + + +/* Convenience API for opening and closing keymaster devices */ + +static inline int keymaster0_open(const struct hw_module_t* module, + keymaster0_device_t** device) +{ + int rc = module->methods->open(module, KEYSTORE_KEYMASTER, + (struct hw_device_t**) device); + + return rc; +} + +static inline int keymaster0_close(keymaster0_device_t* device) +{ + return device->common.close(&device->common); +} + +__END_DECLS + +#endif // ANDROID_HARDWARE_KEYMASTER_0_H diff --git a/third_party/android_hardware_libhardware/include/hardware/keymaster1.h b/third_party/android_hardware_libhardware/include/hardware/keymaster1.h new file mode 100644 index 000000000..ac2cc2b40 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/keymaster1.h @@ -0,0 +1,597 @@ +/* + * Copyright (C) 2015 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_HARDWARE_KEYMASTER1_H +#define ANDROID_HARDWARE_KEYMASTER1_H + +#include +#include + +__BEGIN_DECLS + +/** + * Keymaster1 device definition + */ +struct keymaster1_device { + /** + * Common methods of the keymaster device. This *must* be the first member of + * keymaster_device as users of this structure will cast a hw_device_t to + * keymaster_device pointer in contexts where it's known the hw_device_t references a + * keymaster_device. + */ + struct hw_device_t common; + + /** + * THIS IS DEPRECATED. Use the new "module_api_version" and "hal_api_version" + * fields in the keymaster_module initialization instead. + */ + uint32_t client_version; + + /** + * See flags defined for keymaster0_devices::flags in keymaster_common.h + */ + uint32_t flags; + + void* context; + + /** + * \deprecated Generates a public and private key. The key-blob returned is opaque and must + * subsequently provided for signing and verification. + * + * Returns: 0 on success or an error code less than 0. + */ + int (*generate_keypair)(const struct keymaster1_device* dev, const keymaster_keypair_t key_type, + const void* key_params, uint8_t** key_blob, size_t* key_blob_length); + + /** + * \deprecated Imports a public and private key pair. The imported keys will be in PKCS#8 format + * with DER encoding (Java standard). The key-blob returned is opaque and will be subsequently + * provided for signing and verification. + * + * Returns: 0 on success or an error code less than 0. + */ + int (*import_keypair)(const struct keymaster1_device* dev, const uint8_t* key, + const size_t key_length, uint8_t** key_blob, size_t* key_blob_length); + + /** + * \deprecated Gets the public key part of a key pair. The public key must be in X.509 format + * (Java standard) encoded byte array. + * + * Returns: 0 on success or an error code less than 0. On error, x509_data + * should not be allocated. + */ + int (*get_keypair_public)(const struct keymaster1_device* dev, const uint8_t* key_blob, + const size_t key_blob_length, uint8_t** x509_data, + size_t* x509_data_length); + + /** + * \deprecated Deletes the key pair associated with the key blob. + * + * This function is optional and should be set to NULL if it is not + * implemented. + * + * Returns 0 on success or an error code less than 0. + */ + int (*delete_keypair)(const struct keymaster1_device* dev, const uint8_t* key_blob, + const size_t key_blob_length); + + /** + * \deprecated Deletes all keys in the hardware keystore. Used when keystore is reset + * completely. + * + * This function is optional and should be set to NULL if it is not + * implemented. + * + * Returns 0 on success or an error code less than 0. + */ + int (*delete_all)(const struct keymaster1_device* dev); + + /** + * \deprecated Signs data using a key-blob generated before. This can use either an asymmetric + * key or a secret key. + * + * Returns: 0 on success or an error code less than 0. + */ + int (*sign_data)(const struct keymaster1_device* dev, const void* signing_params, + const uint8_t* key_blob, const size_t key_blob_length, const uint8_t* data, + const size_t data_length, uint8_t** signed_data, size_t* signed_data_length); + + /** + * \deprecated Verifies data signed with a key-blob. This can use either an asymmetric key or a + * secret key. + * + * Returns: 0 on successful verification or an error code less than 0. + */ + int (*verify_data)(const struct keymaster1_device* dev, const void* signing_params, + const uint8_t* key_blob, const size_t key_blob_length, + const uint8_t* signed_data, const size_t signed_data_length, + const uint8_t* signature, const size_t signature_length); + + /** + * Gets algorithms supported. + * + * \param[in] dev The keymaster device structure. + * + * \param[out] algorithms Array of algorithms supported. The caller takes ownership of the + * array and must free() it. + * + * \param[out] algorithms_length Length of \p algorithms. + */ + keymaster_error_t (*get_supported_algorithms)(const struct keymaster1_device* dev, + keymaster_algorithm_t** algorithms, + size_t* algorithms_length); + + /** + * Gets the block modes supported for the specified algorithm. + * + * \param[in] dev The keymaster device structure. + * + * \param[in] algorithm The algorithm for which supported modes will be returned. + * + * \param[out] modes Array of modes supported. The caller takes ownership of the array and must + * free() it. + * + * \param[out] modes_length Length of \p modes. + */ + keymaster_error_t (*get_supported_block_modes)(const struct keymaster1_device* dev, + keymaster_algorithm_t algorithm, + keymaster_purpose_t purpose, + keymaster_block_mode_t** modes, + size_t* modes_length); + + /** + * Gets the padding modes supported for the specified algorithm. Caller assumes ownership of + * the allocated array. + * + * \param[in] dev The keymaster device structure. + * + * \param[in] algorithm The algorithm for which supported padding modes will be returned. + * + * \param[out] modes Array of padding modes supported. The caller takes ownership of the array + * and must free() it. + * + * \param[out] modes_length Length of \p modes. + */ + keymaster_error_t (*get_supported_padding_modes)(const struct keymaster1_device* dev, + keymaster_algorithm_t algorithm, + keymaster_purpose_t purpose, + keymaster_padding_t** modes, + size_t* modes_length); + + /** + * Gets the digests supported for the specified algorithm. Caller assumes ownership of the + * allocated array. + * + * \param[in] dev The keymaster device structure. + * + * \param[in] algorithm The algorithm for which supported digests will be returned. + * + * \param[out] digests Array of digests supported. The caller takes ownership of the array and + * must free() it. + * + * \param[out] digests_length Length of \p digests. + */ + keymaster_error_t (*get_supported_digests)(const struct keymaster1_device* dev, + keymaster_algorithm_t algorithm, + keymaster_purpose_t purpose, + keymaster_digest_t** digests, + size_t* digests_length); + + /** + * Gets the key import formats supported for keys of the specified algorithm. Caller assumes + * ownership of the allocated array. + * + * \param[in] dev The keymaster device structure. + * + * \param[in] algorithm The algorithm for which supported formats will be returned. + * + * \param[out] formats Array of formats supported. The caller takes ownership of the array and + * must free() it. + * + * \param[out] formats_length Length of \p formats. + */ + keymaster_error_t (*get_supported_import_formats)(const struct keymaster1_device* dev, + keymaster_algorithm_t algorithm, + keymaster_key_format_t** formats, + size_t* formats_length); + + /** + * Gets the key export formats supported for keys of the specified algorithm. Caller assumes + * ownership of the allocated array. + * + * \param[in] dev The keymaster device structure. + * + * \param[in] algorithm The algorithm for which supported formats will be returned. + * + * \param[out] formats Array of formats supported. The caller takes ownership of the array and + * must free() it. + * + * \param[out] formats_length Length of \p formats. + */ + keymaster_error_t (*get_supported_export_formats)(const struct keymaster1_device* dev, + keymaster_algorithm_t algorithm, + keymaster_key_format_t** formats, + size_t* formats_length); + + /** + * Adds entropy to the RNG used by keymaster. Entropy added through this method is guaranteed + * not to be the only source of entropy used, and the mixing function is required to be secure, + * in the sense that if the RNG is seeded (from any source) with any data the attacker cannot + * predict (or control), then the RNG output is indistinguishable from random. Thus, if the + * entropy from any source is good, the output will be good. + * + * \param[in] dev The keymaster device structure. + * + * \param[in] data Random data to be mixed in. + * + * \param[in] data_length Length of \p data. + */ + keymaster_error_t (*add_rng_entropy)(const struct keymaster1_device* dev, const uint8_t* data, + size_t data_length); + + /** + * Generates a key, or key pair, returning a key blob and/or a description of the key. + * + * Key generation parameters are defined as keymaster tag/value pairs, provided in \p params. + * See keymaster_tag_t for the full list. Some values that are always required for generation + * of useful keys are: + * + * - KM_TAG_ALGORITHM; + * - KM_TAG_PURPOSE; and + * - (KM_TAG_USER_SECURE_ID and KM_TAG_USER_AUTH_TYPE) or KM_TAG_NO_AUTH_REQUIRED. + * + * KM_TAG_AUTH_TIMEOUT should generally be specified unless KM_TAG_NO_AUTH_REQUIRED is present, + * or the user will have to authenticate for every use. + * + * KM_TAG_BLOCK_MODE, KM_TAG_PADDING, KM_TAG_MAC_LENGTH and KM_TAG_DIGEST must be specified for + * algorithms that require them. + * + * The following tags may not be specified; their values will be provided by the implementation. + * + * - KM_TAG_ORIGIN, + * - KM_TAG_ROLLBACK_RESISTANT, + * - KM_TAG_CREATION_DATETIME + * + * \param[in] dev The keymaster device structure. + * + * \param[in] params Array of key generation parameters. + * + * \param[in] params_count Length of \p params. + * + * \param[out] key_blob returns the generated key. \p key_blob must not be NULL. The caller + * assumes ownership key_blob->key_material and must free() it. + * + * \param[out] characteristics returns the characteristics of the key that was, generated, if + * non-NULL. If non-NULL, the caller assumes ownership and must deallocate with + * keymaster_free_characteristics(). Note that KM_TAG_ROOT_OF_TRUST, KM_TAG_APPLICATION_ID and + * KM_TAG_APPLICATION_DATA are never returned. + */ + keymaster_error_t (*generate_key)(const struct keymaster1_device* dev, + const keymaster_key_param_set_t* params, + keymaster_key_blob_t* key_blob, + keymaster_key_characteristics_t** characteristics); + + /** + * Returns the characteristics of the specified key, or KM_ERROR_INVALID_KEY_BLOB if the + * key_blob is invalid (implementations must fully validate the integrity of the key). + * client_id and app_data must be the ID and data provided when the key was generated or + * imported, or empty if KM_TAG_APPLICATION_ID and/or KM_TAG_APPLICATION_DATA were not provided + * during generation. Those values are not included in the returned characteristics. The + * caller assumes ownership of the allocated characteristics object, which must be deallocated + * with keymaster_free_characteristics(). + * + * Note that KM_TAG_ROOT_OF_TRUST, KM_TAG_APPLICATION_ID and KM_TAG_APPLICATION_DATA are never + * returned. + * + * \param[in] dev The keymaster device structure. + * + * \param[in] key_blob The key to retreive characteristics from. + * + * \param[in] client_id The client ID data, or NULL if none associated. + * + * \param[in] app_id The app data, or NULL if none associated. + * + * \param[out] characteristics The key characteristics. + */ + keymaster_error_t (*get_key_characteristics)(const struct keymaster1_device* dev, + const keymaster_key_blob_t* key_blob, + const keymaster_blob_t* client_id, + const keymaster_blob_t* app_data, + keymaster_key_characteristics_t** characteristics); + + /** + * Imports a key, or key pair, returning a key blob and/or a description of the key. + * + * Most key import parameters are defined as keymaster tag/value pairs, provided in "params". + * See keymaster_tag_t for the full list. Values that are always required for import of useful + * keys are: + * + * - KM_TAG_ALGORITHM; + * - KM_TAG_PURPOSE; and + * - (KM_TAG_USER_SECURE_ID and KM_TAG_USER_AUTH_TYPE) or KM_TAG_NO_AUTH_REQUIRED. + * + * KM_TAG_AUTH_TIMEOUT should generally be specified. If unspecified, the user will have to + * authenticate for every use. + * + * The following tags will take default values if unspecified: + * + * - KM_TAG_KEY_SIZE will default to the size of the key provided. + * - KM_TAG_RSA_PUBLIC_EXPONENT will default to the value in the key provided (for RSA keys) + * + * The following tags may not be specified; their values will be provided by the implementation. + * + * - KM_TAG_ORIGIN, + * - KM_TAG_ROLLBACK_RESISTANT, + * - KM_TAG_CREATION_DATETIME + * + * \param[in] dev The keymaster device structure. + * + * \param[in] params Parameters defining the imported key. + * + * \param[in] params_count The number of entries in \p params. + * + * \param[in] key_format specifies the format of the key data in key_data. + * + * \param[out] key_blob Used to return the opaque key blob. Must be non-NULL. The caller + * assumes ownership of the contained key_material. + * + * \param[out] characteristics Used to return the characteristics of the imported key. May be + * NULL, in which case no characteristics will be returned. If non-NULL, the caller assumes + * ownership and must deallocate with keymaster_free_characteristics(). Note that + * KM_TAG_ROOT_OF_TRUST, KM_TAG_APPLICATION_ID and + * KM_TAG_APPLICATION_DATA are never returned. + */ + keymaster_error_t (*import_key)(const struct keymaster1_device* dev, + const keymaster_key_param_set_t* params, + keymaster_key_format_t key_format, + const keymaster_blob_t* key_data, + keymaster_key_blob_t* key_blob, + keymaster_key_characteristics_t** characteristics); + + /** + * Exports a public key, returning a byte array in the specified format. + * + * \param[in] dev The keymaster device structure. + * + * \param[in] export_format The format to be used for exporting the key. + * + * \param[in] key_to_export The key to export. + * + * \param[out] export_data The exported key material. The caller assumes ownership. + * + * \param[out] export_data_length The length of \p export_data. + */ + keymaster_error_t (*export_key)(const struct keymaster1_device* dev, + keymaster_key_format_t export_format, + const keymaster_key_blob_t* key_to_export, + const keymaster_blob_t* client_id, + const keymaster_blob_t* app_data, + keymaster_blob_t* export_data); + + /** + * Deletes the key, or key pair, associated with the key blob. After calling this function it + * will be impossible to use the key for any other operations. May be applied to keys from + * foreign roots of trust (keys not usable under the current root of trust). + * + * This function is optional and should be set to NULL if it is not implemented. + * + * \param[in] dev The keymaster device structure. + * + * \param[in] key The key to be deleted. + */ + keymaster_error_t (*delete_key)(const struct keymaster1_device* dev, + const keymaster_key_blob_t* key); + + /** + * Deletes all keys in the hardware keystore. Used when keystore is reset completely. After + * calling this function it will be impossible to use any previously generated or imported key + * blobs for any operations. + * + * This function is optional and should be set to NULL if it is not implemented. + * + * \param[in] dev The keymaster device structure. + */ + keymaster_error_t (*delete_all_keys)(const struct keymaster1_device* dev); + + /** + * Begins a cryptographic operation using the specified key. If all is well, begin() will + * return KM_ERROR_OK and create an operation handle which must be passed to subsequent calls to + * update(), finish() or abort(). + * + * It is critical that each call to begin() be paired with a subsequent call to finish() or + * abort(), to allow the keymaster implementation to clean up any internal operation state. + * Failure to do this may leak internal state space or other internal resources and may + * eventually cause begin() to return KM_ERROR_TOO_MANY_OPERATIONS when it runs out of space for + * operations. Any result other than KM_ERROR_OK from begin(), update() or finish() implicitly + * aborts the operation, in which case abort() need not be called (and will return + * KM_ERROR_INVALID_OPERATION_HANDLE if called). + * + * \param[in] dev The keymaster device structure. + * + * \param[in] purpose The purpose of the operation, one of KM_PURPOSE_ENCRYPT, + * KM_PURPOSE_DECRYPT, KM_PURPOSE_SIGN or KM_PURPOSE_VERIFY. Note that for AEAD modes, + * encryption and decryption imply signing and verification, respectively, but should be + * specified as KM_PURPOSE_ENCRYPT and KM_PURPOSE_DECRYPT. + * + * \param[in] key The key to be used for the operation. \p key must have a purpose compatible + * with \p purpose and all of its usage requirements must be satisfied, or begin() will return + * an appropriate error code. + * + * \param[in] in_params Additional parameters for the operation. This is typically used to + * provide authentication data, with KM_TAG_AUTH_TOKEN. If KM_TAG_APPLICATION_ID or + * KM_TAG_APPLICATION_DATA were provided during generation, they must be provided here, or the + * operation will fail with KM_ERROR_INVALID_KEY_BLOB. For operations that require a nonce or + * IV, on keys that were generated with KM_TAG_CALLER_NONCE, in_params may contain a tag + * KM_TAG_NONCE. For AEAD operations KM_TAG_CHUNK_SIZE is specified here. + * + * \param[out] out_params Output parameters. Used to return additional data from the operation + * initialization, notably to return the IV or nonce from operations that generate an IV or + * nonce. The caller takes ownership of the output parameters array and must free it with + * keymaster_free_param_set(). out_params may be set to NULL if no output parameters are + * expected. If out_params is NULL, and output paramaters are generated, begin() will return + * KM_ERROR_OUTPUT_PARAMETER_NULL. + * + * \param[out] operation_handle The newly-created operation handle which must be passed to + * update(), finish() or abort(). If operation_handle is NULL, begin() will return + * KM_ERROR_OUTPUT_PARAMETER_NULL. + */ + keymaster_error_t (*begin)(const struct keymaster1_device* dev, keymaster_purpose_t purpose, + const keymaster_key_blob_t* key, + const keymaster_key_param_set_t* in_params, + keymaster_key_param_set_t* out_params, + keymaster_operation_handle_t* operation_handle); + + /** + * Provides data to, and possibly receives output from, an ongoing cryptographic operation begun + * with begin(). + * + * If operation_handle is invalid, update() will return KM_ERROR_INVALID_OPERATION_HANDLE. + * + * update() may not consume all of the data provided in the data buffer. update() will return + * the amount consumed in *data_consumed. The caller should provide the unconsumed data in a + * subsequent call. + * + * \param[in] dev The keymaster device structure. + * + * \param[in] operation_handle The operation handle returned by begin(). + * + * \param[in] in_params Additional parameters for the operation. For AEAD modes, this is used + * to specify KM_TAG_ADDITIONAL_DATA. Note that additional data may be provided in multiple + * calls to update(), but only until input data has been provided. + * + * \param[in] input Data to be processed, per the parameters established in the call to begin(). + * Note that update() may or may not consume all of the data provided. See \p input_consumed. + * + * \param[out] input_consumed Amount of data that was consumed by update(). If this is less + * than the amount provided, the caller should provide the remainder in a subsequent call to + * update(). + * + * \param[out] out_params Output parameters. Used to return additional data from the operation + * The caller takes ownership of the output parameters array and must free it with + * keymaster_free_param_set(). out_params may be set to NULL if no output parameters are + * expected. If out_params is NULL, and output paramaters are generated, begin() will return + * KM_ERROR_OUTPUT_PARAMETER_NULL. + * + * \param[out] output The output data, if any. The caller assumes ownership of the allocated + * buffer. output must not be NULL. + * + * Note that update() may not provide any output, in which case output->data_length will be + * zero, and output->data may be either NULL or zero-length (so the caller should always free() + * it). + */ + keymaster_error_t (*update)(const struct keymaster1_device* dev, + keymaster_operation_handle_t operation_handle, + const keymaster_key_param_set_t* in_params, + const keymaster_blob_t* input, size_t* input_consumed, + keymaster_key_param_set_t* out_params, keymaster_blob_t* output); + + /** + * Finalizes a cryptographic operation begun with begin() and invalidates \p operation_handle. + * + * \param[in] dev The keymaster device structure. + * + * \param[in] operation_handle The operation handle returned by begin(). This handle will be + * invalidated. + * + * \param[in] params Additional parameters for the operation. For AEAD modes, this is used to + * specify KM_TAG_ADDITIONAL_DATA, but only if no input data was provided to update(). + * + * \param[in] signature The signature to be verified if the purpose specified in the begin() + * call was KM_PURPOSE_VERIFY. + * + * \param[out] output The output data, if any. The caller assumes ownership of the allocated + * buffer. + * + * If the operation being finished is a signature verification or an AEAD-mode decryption and + * verification fails then finish() will return KM_ERROR_VERIFICATION_FAILED. + */ + keymaster_error_t (*finish)(const struct keymaster1_device* dev, + keymaster_operation_handle_t operation_handle, + const keymaster_key_param_set_t* in_params, + const keymaster_blob_t* signature, + keymaster_key_param_set_t* out_params, keymaster_blob_t* output); + + /** + * Aborts a cryptographic operation begun with begin(), freeing all internal resources and + * invalidating \p operation_handle. + */ + keymaster_error_t (*abort)(const struct keymaster1_device* dev, + keymaster_operation_handle_t operation_handle); + + /** + * Generates a pair of ATTK defined in SOTER. Save the private key into RPMB. + * Note that the ATTK generated will never be touched outside the keymaster. + * + * \param[in] dev The keymaster device structure. + * + * \param[in] copy_num The number of copies that will be saved in the RPMB. + */ + keymaster_error_t (*generate_attk_key_pair)(const struct keymaster1_device* dev, + const uint8_t copy_num); + + /** + * Verify the existance ATTK defined in SOTER. + * + * \param[in] dev The keymaster device structure. + * + * Returns: 0 if the ATTK exists. + */ + keymaster_error_t (*verify_attk_key_pair)(const struct keymaster1_device* dev); + + /** + * Export the public key of ATTK in PEM format. + * + * \param[in] dev The keymaster device structure. + * + * \param[out] pub_key_data The public key data in X.509v3 format PEM encoded + * + * \param[out] pub_key_data_length The length of the public key data. + */ + keymaster_error_t (*export_attk_public_key)(const struct keymaster1_device* dev, + const uint8_t* pub_key_data, + const size_t pub_key_data_length); + + /** + * Get Unique device ID. + * + * \param[in] dev The keymaster device structure. + * + * \param[out] device_id The unique id for each device, format as below: + * 1.bytes 0-3: Identify each silicon provider id. + * 2.bytes 4-7: SoC model ID, defined by each silicon provider + * 3.bytes 8-15: Public Chip Serial *Number of SoC, defined by each silicon provider + * + * \param[out] device_id_length The length of the device id. + */ + keymaster_error_t (*get_device_id)(const struct keymaster1_device* dev, + const uint8_t* device_id, + const size_t device_id_length); +}; +typedef struct keymaster1_device keymaster1_device_t; + +/* Convenience API for opening and closing keymaster devices */ + +static inline int keymaster1_open(const struct hw_module_t* module, keymaster1_device_t** device) { + return module->methods->open(module, KEYSTORE_KEYMASTER, (struct hw_device_t**)device); +} + +static inline int keymaster1_close(keymaster1_device_t* device) { + return device->common.close(&device->common); +} + +__END_DECLS + +#endif // ANDROID_HARDWARE_KEYMASTER1_H diff --git a/third_party/android_hardware_libhardware/include/hardware/keymaster_common.h b/third_party/android_hardware_libhardware/include/hardware/keymaster_common.h new file mode 100644 index 000000000..772d7e4d2 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/keymaster_common.h @@ -0,0 +1,185 @@ +/* + * Copyright (C) 2015 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_HARDWARE_KEYMASTER_COMMON_H +#define ANDROID_HARDWARE_KEYMASTER_COMMON_H + +#include +#include +#include + +#include + +__BEGIN_DECLS + +/** + * The id of this module + */ +#define KEYSTORE_HARDWARE_MODULE_ID "keystore" + +#define KEYSTORE_KEYMASTER "keymaster" + + +/** + * Settings for "module_api_version" and "hal_api_version" + * fields in the keymaster_module initialization. + */ + +/** + * Keymaster 0.X module version provide the same APIs, but later versions add more options + * for algorithms and flags. + */ +#define KEYMASTER_MODULE_API_VERSION_0_2 HARDWARE_MODULE_API_VERSION(0, 2) +#define KEYMASTER_DEVICE_API_VERSION_0_2 HARDWARE_DEVICE_API_VERSION(0, 2) + +#define KEYMASTER_MODULE_API_VERSION_0_3 HARDWARE_MODULE_API_VERSION(0, 3) +#define KEYMASTER_DEVICE_API_VERSION_0_3 HARDWARE_DEVICE_API_VERSION(0, 3) + +/** + * Keymaster 1.0 module version provides a completely different API, incompatible with 0.X. + */ +#define KEYMASTER_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) +#define KEYMASTER_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) + +struct keystore_module { + /** + * Common methods of the keystore module. This *must* be the first member of keystore_module as + * users of this structure will cast a hw_module_t to keystore_module pointer in contexts where + * it's known the hw_module_t references a keystore_module. + */ + hw_module_t common; + + /* There are no keystore module methods other than the common ones. */ +}; + +/** + * Flags for keymaster0_device::flags + */ +enum { + /* + * Indicates this keymaster implementation does not have hardware that + * keeps private keys out of user space. + * + * This should not be implemented on anything other than the default + * implementation. + */ + KEYMASTER_SOFTWARE_ONLY = 1 << 0, + + /* + * This indicates that the key blobs returned via all the primitives + * are sufficient to operate on their own without the trusted OS + * querying userspace to retrieve some other data. Key blobs of + * this type are normally returned encrypted with a + * Key Encryption Key (KEK). + * + * This is currently used by "vold" to know whether the whole disk + * encryption secret can be unwrapped without having some external + * service started up beforehand since the "/data" partition will + * be unavailable at that point. + */ + KEYMASTER_BLOBS_ARE_STANDALONE = 1 << 1, + + /* + * Indicates that the keymaster module supports DSA keys. + */ + KEYMASTER_SUPPORTS_DSA = 1 << 2, + + /* + * Indicates that the keymaster module supports EC keys. + */ + KEYMASTER_SUPPORTS_EC = 1 << 3, +}; + +/** + * Asymmetric key pair types. + */ +typedef enum { + TYPE_RSA = 1, + TYPE_DSA = 2, + TYPE_EC = 3, +} keymaster_keypair_t; + +/** + * Parameters needed to generate an RSA key. + */ +typedef struct { + uint32_t modulus_size; + uint64_t public_exponent; +} keymaster_rsa_keygen_params_t; + +/** + * Parameters needed to generate a DSA key. + */ +typedef struct { + uint32_t key_size; + uint32_t generator_len; + uint32_t prime_p_len; + uint32_t prime_q_len; + const uint8_t* generator; + const uint8_t* prime_p; + const uint8_t* prime_q; +} keymaster_dsa_keygen_params_t; + +/** + * Parameters needed to generate an EC key. + * + * Field size is the only parameter in version 2. The sizes correspond to these required curves: + * + * 192 = NIST P-192 + * 224 = NIST P-224 + * 256 = NIST P-256 + * 384 = NIST P-384 + * 521 = NIST P-521 + * + * The parameters for these curves are available at: http://www.nsa.gov/ia/_files/nist-routines.pdf + * in Chapter 4. + */ +typedef struct { + uint32_t field_size; +} keymaster_ec_keygen_params_t; + + +/** + * Digest type. + */ +typedef enum { + DIGEST_NONE, +} keymaster_digest_algorithm_t; + +/** + * Type of padding used for RSA operations. + */ +typedef enum { + PADDING_NONE, +} keymaster_rsa_padding_t; + + +typedef struct { + keymaster_digest_algorithm_t digest_type; +} keymaster_dsa_sign_params_t; + +typedef struct { + keymaster_digest_algorithm_t digest_type; +} keymaster_ec_sign_params_t; + +typedef struct { + keymaster_digest_algorithm_t digest_type; + keymaster_rsa_padding_t padding_type; +} keymaster_rsa_sign_params_t; + +__END_DECLS + +#endif // ANDROID_HARDWARE_KEYMASTER_COMMON_H diff --git a/third_party/android_hardware_libhardware/include/hardware/keymaster_defs.h b/third_party/android_hardware_libhardware/include/hardware/keymaster_defs.h new file mode 100644 index 000000000..1a723c94a --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/keymaster_defs.h @@ -0,0 +1,539 @@ +/* + * Copyright (C) 2014 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_HARDWARE_KEYMASTER_DEFS_H +#define ANDROID_HARDWARE_KEYMASTER_DEFS_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/** + * Authorization tags each have an associated type. This enumeration facilitates tagging each with + * a type, by using the high four bits (of an implied 32-bit unsigned enum value) to specify up to + * 16 data types. These values are ORed with tag IDs to generate the final tag ID values. + */ +typedef enum { + KM_INVALID = 0 << 28, /* Invalid type, used to designate a tag as uninitialized */ + KM_ENUM = 1 << 28, + KM_ENUM_REP = 2 << 28, /* Repeatable enumeration value. */ + KM_UINT = 3 << 28, + KM_UINT_REP = 4 << 28, /* Repeatable integer value */ + KM_ULONG = 5 << 28, + KM_DATE = 6 << 28, + KM_BOOL = 7 << 28, + KM_BIGNUM = 8 << 28, + KM_BYTES = 9 << 28, + KM_ULONG_REP = 10 << 28, /* Repeatable long value */ +} keymaster_tag_type_t; + +typedef enum { + KM_TAG_INVALID = KM_INVALID | 0, + + /* + * Tags that must be semantically enforced by hardware and software implementations. + */ + + /* Crypto parameters */ + KM_TAG_PURPOSE = KM_ENUM_REP | 1, /* keymaster_purpose_t. */ + KM_TAG_ALGORITHM = KM_ENUM | 2, /* keymaster_algorithm_t. */ + KM_TAG_KEY_SIZE = KM_UINT | 3, /* Key size in bits. */ + KM_TAG_BLOCK_MODE = KM_ENUM_REP | 4, /* keymaster_block_mode_t. */ + KM_TAG_DIGEST = KM_ENUM_REP | 5, /* keymaster_digest_t. */ + KM_TAG_PADDING = KM_ENUM_REP | 6, /* keymaster_padding_t. */ + KM_TAG_CALLER_NONCE = KM_BOOL | 7, /* Allow caller to specify nonce or IV. */ + KM_TAG_MIN_MAC_LENGTH = KM_UINT | 8, /* Minimum length of MAC or AEAD authentication tag in + * bits. */ + + /* Algorithm-specific. */ + KM_TAG_RSA_PUBLIC_EXPONENT = KM_ULONG | 200, + + /* Other hardware-enforced. */ + KM_TAG_BLOB_USAGE_REQUIREMENTS = KM_ENUM | 301, /* keymaster_key_blob_usage_requirements_t */ + KM_TAG_BOOTLOADER_ONLY = KM_BOOL | 302, /* Usable only by bootloader */ + + /* + * Tags that should be semantically enforced by hardware if possible and will otherwise be + * enforced by software (keystore). + */ + + /* Key validity period */ + KM_TAG_ACTIVE_DATETIME = KM_DATE | 400, /* Start of validity */ + KM_TAG_ORIGINATION_EXPIRE_DATETIME = KM_DATE | 401, /* Date when new "messages" should no + longer be created. */ + KM_TAG_USAGE_EXPIRE_DATETIME = KM_DATE | 402, /* Date when existing "messages" should no + longer be trusted. */ + KM_TAG_MIN_SECONDS_BETWEEN_OPS = KM_UINT | 403, /* Minimum elapsed time between + cryptographic operations with the key. */ + KM_TAG_MAX_USES_PER_BOOT = KM_UINT | 404, /* Number of times the key can be used per + boot. */ + + /* User authentication */ + KM_TAG_ALL_USERS = KM_BOOL | 500, /* Reserved for future use -- ignore */ + KM_TAG_USER_ID = KM_UINT | 501, /* Reserved for future use -- ignore */ + KM_TAG_USER_SECURE_ID = KM_ULONG_REP | 502, /* Secure ID of authorized user or authenticator(s). + Disallowed if KM_TAG_ALL_USERS or + KM_TAG_NO_AUTH_REQUIRED is present. */ + KM_TAG_NO_AUTH_REQUIRED = KM_BOOL | 503, /* If key is usable without authentication. */ + KM_TAG_USER_AUTH_TYPE = KM_ENUM | 504, /* Bitmask of authenticator types allowed when + * KM_TAG_USER_SECURE_ID contains a secure user ID, + * rather than a secure authenticator ID. Defined in + * hw_authenticator_type_t in hw_auth_token.h. */ + KM_TAG_AUTH_TIMEOUT = KM_UINT | 505, /* Required freshness of user authentication for + private/secret key operations, in seconds. + Public key operations require no authentication. + If absent, authentication is required for every + use. Authentication state is lost when the + device is powered off. */ + + /* Application access control */ + KM_TAG_ALL_APPLICATIONS = KM_BOOL | 600, /* Reserved for future use -- ignore */ + KM_TAG_APPLICATION_ID = KM_BYTES | 601, /* Reserved for fugure use -- ignore */ + + /* + * Semantically unenforceable tags, either because they have no specific meaning or because + * they're informational only. + */ + KM_TAG_APPLICATION_DATA = KM_BYTES | 700, /* Data provided by authorized application. */ + KM_TAG_CREATION_DATETIME = KM_DATE | 701, /* Key creation time */ + KM_TAG_ORIGIN = KM_ENUM | 702, /* keymaster_key_origin_t. */ + KM_TAG_ROLLBACK_RESISTANT = KM_BOOL | 703, /* Whether key is rollback-resistant. */ + KM_TAG_ROOT_OF_TRUST = KM_BYTES | 704, /* Root of trust ID. */ + + /* Tags used only to provide data to or receive data from operations */ + KM_TAG_ASSOCIATED_DATA = KM_BYTES | 1000, /* Used to provide associated data for AEAD modes. */ + KM_TAG_NONCE = KM_BYTES | 1001, /* Nonce or Initialization Vector */ + KM_TAG_AUTH_TOKEN = KM_BYTES | 1002, /* Authentication token that proves secure user + authentication has been performed. Structure + defined in hw_auth_token_t in hw_auth_token.h. */ + KM_TAG_MAC_LENGTH = KM_UINT | 1003, /* MAC or AEAD authentication tag length in bits. */ + + /* Tags used only for SOTER */ + /* Tags used only to check if the key is for SOTER */ + KM_TAG_SOTER_IS_FROM_SOTER = KM_BOOL | 11000, + /* Attach signature signed with ATTK[pri] while exporting public key */ + KM_TAG_SOTER_IS_AUTO_SIGNED_WITH_ATTK_WHEN_GET_PUBLIC_KEY = KM_BOOL | 11001, + /* Attach signature signed with specified private key while exporting public key */ + KM_TAG_SOTER_IS_AUTO_SIGNED_WITH_COMMON_KEY_WHEN_GET_PUBLIC_KEY = KM_BOOL | 11002, + /* keyalias for the keypair of KM_TAG_SOTER_IS_AUTO_SIGNED_WITH_COMMON_KEY_WHEN_GET_PUBLIC_KEY */ + KM_TAG_SOTER_AUTO_SIGNED_COMMON_KEY_WHEN_GET_PUBLIC_KEY = KM_BYTES | 11003, + /* Attach counter while exporting publick key */ + KM_TAG_SOTER_AUTO_ADD_COUNTER_WHEN_GET_PUBLIC_KEY = KM_BOOL | 11004, + /* Attach secmsg(TEE_Name, TEE_Version, Fingerprint_Sensor_Name, Fingerprint_Sensor_Version) + fingerprint_id and counter while signing */ + KM_TAG_SOTER_IS_SECMSG_FID_COUNTER_SIGNED_WHEN_SIGN = KM_BOOL | 11005, + /* use and set ATTK index to next backup ATTK */ + KM_TAG_SOTER_USE_NEXT_ATTK = KM_BOOL | 11006, + /* attach soter uid */ + KM_TAG_SOTER_UID = KM_UINT | 11007, + /* attach key blob of KM_TAG_SOTER_AUTO_SIGNED_COMMON_KEY_WHEN_GET_PUBLIC_KEY if needed */ + KM_TAG_SOTER_AUTO_SIGNED_COMMON_KEY_WHEN_GET_PUBLIC_KEY_BLOB = KM_BYTES | 11008, +} keymaster_tag_t; + +/** + * Algorithms that may be provided by keymaster implementations. Those that must be provided by all + * implementations are tagged as "required". + */ +typedef enum { + /* Asymmetric algorithms. */ + KM_ALGORITHM_RSA = 1, + // KM_ALGORITHM_DSA = 2, -- Removed, do not re-use value 2. + KM_ALGORITHM_EC = 3, + + /* Block ciphers algorithms */ + KM_ALGORITHM_AES = 32, + + /* MAC algorithms */ + KM_ALGORITHM_HMAC = 128, +} keymaster_algorithm_t; + +/** + * Symmetric block cipher modes provided by keymaster implementations. + */ +typedef enum { + /* Unauthenticated modes, usable only for encryption/decryption and not generally recommended + * except for compatibility with existing other protocols. */ + KM_MODE_ECB = 1, + KM_MODE_CBC = 2, + KM_MODE_CTR = 3, + + /* Authenticated modes, usable for encryption/decryption and signing/verification. Recommended + * over unauthenticated modes for all purposes. */ + KM_MODE_GCM = 32, +} keymaster_block_mode_t; + +/** + * Padding modes that may be applied to plaintext for encryption operations. This list includes + * padding modes for both symmetric and asymmetric algorithms. Note that implementations should not + * provide all possible combinations of algorithm and padding, only the + * cryptographically-appropriate pairs. + */ +typedef enum { + KM_PAD_NONE = 1, /* deprecated */ + KM_PAD_RSA_OAEP = 2, + KM_PAD_RSA_PSS = 3, + KM_PAD_RSA_PKCS1_1_5_ENCRYPT = 4, + KM_PAD_RSA_PKCS1_1_5_SIGN = 5, + KM_PAD_PKCS7 = 64, +} keymaster_padding_t; + +/** + * Digests provided by keymaster implementations. + */ +typedef enum { + KM_DIGEST_NONE = 0, + KM_DIGEST_MD5 = 1, /* Optional, may not be implemented in hardware, will be handled in software + * if needed. */ + KM_DIGEST_SHA1 = 2, + KM_DIGEST_SHA_2_224 = 3, + KM_DIGEST_SHA_2_256 = 4, + KM_DIGEST_SHA_2_384 = 5, + KM_DIGEST_SHA_2_512 = 6, +} keymaster_digest_t; + +/** + * The origin of a key (or pair), i.e. where it was generated. Note that KM_TAG_ORIGIN can be found + * in either the hardware-enforced or software-enforced list for a key, indicating whether the key + * is hardware or software-based. Specifically, a key with KM_ORIGIN_GENERATED in the + * hardware-enforced list is guaranteed never to have existed outide the secure hardware. + */ +typedef enum { + KM_ORIGIN_GENERATED = 0, /* Generated in keymaster */ + KM_ORIGIN_IMPORTED = 2, /* Imported, origin unknown */ + KM_ORIGIN_UNKNOWN = 3, /* Keymaster did not record origin. This value can only be seen on + * keys in a keymaster0 implementation. The keymaster0 adapter uses + * this value to document the fact that it is unkown whether the key + * was generated inside or imported into keymaster. */ +} keymaster_key_origin_t; + +/** + * Usability requirements of key blobs. This defines what system functionality must be available + * for the key to function. For example, key "blobs" which are actually handles referencing + * encrypted key material stored in the file system cannot be used until the file system is + * available, and should have BLOB_REQUIRES_FILE_SYSTEM. Other requirements entries will be added + * as needed for implementations. This type is new in 0_4. + */ +typedef enum { + KM_BLOB_STANDALONE = 0, + KM_BLOB_REQUIRES_FILE_SYSTEM = 1, +} keymaster_key_blob_usage_requirements_t; + +/** + * Possible purposes of a key (or pair). This type is new in 0_4. + */ +typedef enum { + KM_PURPOSE_ENCRYPT = 0, + KM_PURPOSE_DECRYPT = 1, + KM_PURPOSE_SIGN = 2, + KM_PURPOSE_VERIFY = 3, +} keymaster_purpose_t; + +typedef struct { + const uint8_t* data; + size_t data_length; +} keymaster_blob_t; + +typedef struct { + keymaster_tag_t tag; + union { + uint32_t enumerated; /* KM_ENUM and KM_ENUM_REP */ + bool boolean; /* KM_BOOL */ + uint32_t integer; /* KM_INT and KM_INT_REP */ + uint64_t long_integer; /* KM_LONG */ + uint64_t date_time; /* KM_DATE */ + keymaster_blob_t blob; /* KM_BIGNUM and KM_BYTES*/ + }; +} keymaster_key_param_t; + +typedef struct { + keymaster_key_param_t* params; /* may be NULL if length == 0 */ + size_t length; +} keymaster_key_param_set_t; + +/** + * Parameters that define a key's characteristics, including authorized modes of usage and access + * control restrictions. The parameters are divided into two categories, those that are enforced by + * secure hardware, and those that are not. For a software-only keymaster implementation the + * enforced array must NULL. Hardware implementations must enforce everything in the enforced + * array. + */ +typedef struct { + keymaster_key_param_set_t hw_enforced; + keymaster_key_param_set_t sw_enforced; +} keymaster_key_characteristics_t; + +typedef struct { + const uint8_t* key_material; + size_t key_material_size; +} keymaster_key_blob_t; + +/** + * Formats for key import and export. At present, only asymmetric key import/export is supported. + * In the future this list will expand greatly to accommodate asymmetric key import/export. + */ +typedef enum { + KM_KEY_FORMAT_X509 = 0, /* for public key export */ + KM_KEY_FORMAT_PKCS8 = 1, /* for asymmetric key pair import */ + KM_KEY_FORMAT_RAW = 3, /* for symmetric key import */ +} keymaster_key_format_t; + +/** + * The keymaster operation API consists of begin, update, finish and abort. This is the type of the + * handle used to tie the sequence of calls together. A 64-bit value is used because it's important + * that handles not be predictable. Implementations must use strong random numbers for handle + * values. + */ +typedef uint64_t keymaster_operation_handle_t; + +typedef enum { + KM_ERROR_OK = 0, + KM_ERROR_ROOT_OF_TRUST_ALREADY_SET = -1, + KM_ERROR_UNSUPPORTED_PURPOSE = -2, + KM_ERROR_INCOMPATIBLE_PURPOSE = -3, + KM_ERROR_UNSUPPORTED_ALGORITHM = -4, + KM_ERROR_INCOMPATIBLE_ALGORITHM = -5, + KM_ERROR_UNSUPPORTED_KEY_SIZE = -6, + KM_ERROR_UNSUPPORTED_BLOCK_MODE = -7, + KM_ERROR_INCOMPATIBLE_BLOCK_MODE = -8, + KM_ERROR_UNSUPPORTED_MAC_LENGTH = -9, + KM_ERROR_UNSUPPORTED_PADDING_MODE = -10, + KM_ERROR_INCOMPATIBLE_PADDING_MODE = -11, + KM_ERROR_UNSUPPORTED_DIGEST = -12, + KM_ERROR_INCOMPATIBLE_DIGEST = -13, + KM_ERROR_INVALID_EXPIRATION_TIME = -14, + KM_ERROR_INVALID_USER_ID = -15, + KM_ERROR_INVALID_AUTHORIZATION_TIMEOUT = -16, + KM_ERROR_UNSUPPORTED_KEY_FORMAT = -17, + KM_ERROR_INCOMPATIBLE_KEY_FORMAT = -18, + KM_ERROR_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM = -19, /* For PKCS8 & PKCS12 */ + KM_ERROR_UNSUPPORTED_KEY_VERIFICATION_ALGORITHM = -20, /* For PKCS8 & PKCS12 */ + KM_ERROR_INVALID_INPUT_LENGTH = -21, + KM_ERROR_KEY_EXPORT_OPTIONS_INVALID = -22, + KM_ERROR_DELEGATION_NOT_ALLOWED = -23, + KM_ERROR_KEY_NOT_YET_VALID = -24, + KM_ERROR_KEY_EXPIRED = -25, + KM_ERROR_KEY_USER_NOT_AUTHENTICATED = -26, + KM_ERROR_OUTPUT_PARAMETER_NULL = -27, + KM_ERROR_INVALID_OPERATION_HANDLE = -28, + KM_ERROR_INSUFFICIENT_BUFFER_SPACE = -29, + KM_ERROR_VERIFICATION_FAILED = -30, + KM_ERROR_TOO_MANY_OPERATIONS = -31, + KM_ERROR_UNEXPECTED_NULL_POINTER = -32, + KM_ERROR_INVALID_KEY_BLOB = -33, + KM_ERROR_IMPORTED_KEY_NOT_ENCRYPTED = -34, + KM_ERROR_IMPORTED_KEY_DECRYPTION_FAILED = -35, + KM_ERROR_IMPORTED_KEY_NOT_SIGNED = -36, + KM_ERROR_IMPORTED_KEY_VERIFICATION_FAILED = -37, + KM_ERROR_INVALID_ARGUMENT = -38, + KM_ERROR_UNSUPPORTED_TAG = -39, + KM_ERROR_INVALID_TAG = -40, + KM_ERROR_MEMORY_ALLOCATION_FAILED = -41, + KM_ERROR_IMPORT_PARAMETER_MISMATCH = -44, + KM_ERROR_SECURE_HW_ACCESS_DENIED = -45, + KM_ERROR_OPERATION_CANCELLED = -46, + KM_ERROR_CONCURRENT_ACCESS_CONFLICT = -47, + KM_ERROR_SECURE_HW_BUSY = -48, + KM_ERROR_SECURE_HW_COMMUNICATION_FAILED = -49, + KM_ERROR_UNSUPPORTED_EC_FIELD = -50, + KM_ERROR_MISSING_NONCE = -51, + KM_ERROR_INVALID_NONCE = -52, + KM_ERROR_MISSING_MAC_LENGTH = -53, + KM_ERROR_KEY_RATE_LIMIT_EXCEEDED = -54, + KM_ERROR_CALLER_NONCE_PROHIBITED = -55, + KM_ERROR_KEY_MAX_OPS_EXCEEDED = -56, + KM_ERROR_INVALID_MAC_LENGTH = -57, + KM_ERROR_MISSING_MIN_MAC_LENGTH = -58, + KM_ERROR_UNSUPPORTED_MIN_MAC_LENGTH = -59, + + KM_ERROR_UNIMPLEMENTED = -100, + KM_ERROR_VERSION_MISMATCH = -101, + + /* Additional error codes may be added by implementations, but implementers should coordinate + * with Google to avoid code collision. */ + KM_ERROR_UNKNOWN_ERROR = -1000, +} keymaster_error_t; + +/* Convenience functions for manipulating keymaster tag types */ + +static inline keymaster_tag_type_t keymaster_tag_get_type(keymaster_tag_t tag) { + return (keymaster_tag_type_t)(tag & (0xF << 28)); +} + +static inline uint32_t keymaster_tag_mask_type(keymaster_tag_t tag) { + return tag & 0x0FFFFFFF; +} + +static inline bool keymaster_tag_type_repeatable(keymaster_tag_type_t type) { + switch (type) { + case KM_UINT_REP: + case KM_ENUM_REP: + return true; + default: + return false; + } +} + +static inline bool keymaster_tag_repeatable(keymaster_tag_t tag) { + return keymaster_tag_type_repeatable(keymaster_tag_get_type(tag)); +} + +/* Convenience functions for manipulating keymaster_key_param_t structs */ + +inline keymaster_key_param_t keymaster_param_enum(keymaster_tag_t tag, uint32_t value) { + // assert(keymaster_tag_get_type(tag) == KM_ENUM || keymaster_tag_get_type(tag) == KM_ENUM_REP); + keymaster_key_param_t param; + memset(¶m, 0, sizeof(param)); + param.tag = tag; + param.enumerated = value; + return param; +} + +inline keymaster_key_param_t keymaster_param_int(keymaster_tag_t tag, uint32_t value) { + // assert(keymaster_tag_get_type(tag) == KM_INT || keymaster_tag_get_type(tag) == KM_INT_REP); + keymaster_key_param_t param; + memset(¶m, 0, sizeof(param)); + param.tag = tag; + param.integer = value; + return param; +} + +inline keymaster_key_param_t keymaster_param_long(keymaster_tag_t tag, uint64_t value) { + // assert(keymaster_tag_get_type(tag) == KM_LONG); + keymaster_key_param_t param; + memset(¶m, 0, sizeof(param)); + param.tag = tag; + param.long_integer = value; + return param; +} + +inline keymaster_key_param_t keymaster_param_blob(keymaster_tag_t tag, const uint8_t* bytes, + size_t bytes_len) { + // assert(keymaster_tag_get_type(tag) == KM_BYTES || keymaster_tag_get_type(tag) == KM_BIGNUM); + keymaster_key_param_t param; + memset(¶m, 0, sizeof(param)); + param.tag = tag; + param.blob.data = (uint8_t*)bytes; + param.blob.data_length = bytes_len; + return param; +} + +inline keymaster_key_param_t keymaster_param_bool(keymaster_tag_t tag) { + // assert(keymaster_tag_get_type(tag) == KM_BOOL); + keymaster_key_param_t param; + memset(¶m, 0, sizeof(param)); + param.tag = tag; + param.boolean = true; + return param; +} + +inline keymaster_key_param_t keymaster_param_date(keymaster_tag_t tag, uint64_t value) { + // assert(keymaster_tag_get_type(tag) == KM_DATE); + keymaster_key_param_t param; + memset(¶m, 0, sizeof(param)); + param.tag = tag; + param.date_time = value; + return param; +} + +#define KEYMASTER_SIMPLE_COMPARE(a, b) (a < b) ? -1 : ((a > b) ? 1 : 0) +inline int keymaster_param_compare(const keymaster_key_param_t* a, const keymaster_key_param_t* b) { + int retval = KEYMASTER_SIMPLE_COMPARE(a->tag, b->tag); + if (retval != 0) + return retval; + + switch (keymaster_tag_get_type(a->tag)) { + case KM_INVALID: + case KM_BOOL: + return 0; + case KM_ENUM: + case KM_ENUM_REP: + return KEYMASTER_SIMPLE_COMPARE(a->enumerated, b->enumerated); + case KM_UINT: + case KM_UINT_REP: + return KEYMASTER_SIMPLE_COMPARE(a->integer, b->integer); + case KM_ULONG: + case KM_ULONG_REP: + return KEYMASTER_SIMPLE_COMPARE(a->long_integer, b->long_integer); + case KM_DATE: + return KEYMASTER_SIMPLE_COMPARE(a->date_time, b->date_time); + case KM_BIGNUM: + case KM_BYTES: + // Handle the empty cases. + if (a->blob.data_length != 0 && b->blob.data_length == 0) + return -1; + if (a->blob.data_length == 0 && b->blob.data_length == 0) + return 0; + if (a->blob.data_length == 0 && b->blob.data_length > 0) + return 1; + + retval = memcmp(a->blob.data, b->blob.data, a->blob.data_length < b->blob.data_length + ? a->blob.data_length + : b->blob.data_length); + if (retval != 0) + return retval; + else if (a->blob.data_length != b->blob.data_length) { + // Equal up to the common length; longer one is larger. + if (a->blob.data_length < b->blob.data_length) + return -1; + if (a->blob.data_length > b->blob.data_length) + return 1; + }; + } + + return 0; +} +#undef KEYMASTER_SIMPLE_COMPARE + +inline void keymaster_free_param_values(keymaster_key_param_t* param, size_t param_count) { + while (param_count-- > 0) { + switch (keymaster_tag_get_type(param->tag)) { + case KM_BIGNUM: + case KM_BYTES: + free((void*)param->blob.data); + param->blob.data = NULL; + break; + default: + // NOP + break; + } + ++param; + } +} + +inline void keymaster_free_param_set(keymaster_key_param_set_t* set) { + if (set) { + keymaster_free_param_values(set->params, set->length); + free(set->params); + set->params = NULL; + } +} + +inline void keymaster_free_characteristics(keymaster_key_characteristics_t* characteristics) { + if (characteristics) { + keymaster_free_param_set(&characteristics->hw_enforced); + keymaster_free_param_set(&characteristics->sw_enforced); + } +} + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus + +#endif // ANDROID_HARDWARE_KEYMASTER_DEFS_H diff --git a/third_party/android_hardware_libhardware/include/hardware/lights.h b/third_party/android_hardware_libhardware/include/hardware/lights.h new file mode 100644 index 000000000..777c91593 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/lights.h @@ -0,0 +1,157 @@ +/* + * 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_LIGHTS_INTERFACE_H +#define ANDROID_LIGHTS_INTERFACE_H + +#include +#include +#include + +#include + +__BEGIN_DECLS + +/** + * The id of this module + */ +#define LIGHTS_HARDWARE_MODULE_ID "lights" + +/* + * These light IDs correspond to logical lights, not physical. + * So for example, if your INDICATOR light is in line with your + * BUTTONS, it might make sense to also light the INDICATOR + * light to a reasonable color when the BUTTONS are lit. + */ +#define LIGHT_ID_BACKLIGHT "backlight" +#define LIGHT_ID_KEYBOARD "keyboard" +#define LIGHT_ID_BUTTONS "buttons" +#define LIGHT_ID_BATTERY "battery" +#define LIGHT_ID_NOTIFICATIONS "notifications" +#define LIGHT_ID_ATTENTION "attention" + +/* + * These lights aren't currently supported by the higher + * layers, but could be someday, so we have the constants + * here now. + */ +#define LIGHT_ID_BLUETOOTH "bluetooth" +#define LIGHT_ID_WIFI "wifi" + +/* + * Additional hardware-specific lights + */ +#define LIGHT_ID_CAPS "caps" +#define LIGHT_ID_FUNC "func" + +/* ************************************************************************ + * Flash modes for the flashMode field of light_state_t. + */ + +#define LIGHT_FLASH_NONE 0 + +/** + * To flash the light at a given rate, set flashMode to LIGHT_FLASH_TIMED, + * and then flashOnMS should be set to the number of milliseconds to turn + * the light on, followed by the number of milliseconds to turn the light + * off. + */ +#define LIGHT_FLASH_TIMED 1 + +/** + * To flash the light using hardware assist, set flashMode to + * the hardware mode. + */ +#define LIGHT_FLASH_HARDWARE 2 + +/** + * Light brightness is managed by a user setting. + */ +#define BRIGHTNESS_MODE_USER 0 + +/** + * Light brightness is managed by a light sensor. + */ +#define BRIGHTNESS_MODE_SENSOR 1 + +/** + * Light mode allows multiple LEDs + */ +#define LIGHT_MODE_MULTIPLE_LEDS 0x01 + +/** + * The parameters that can be set for a given light. + * + * Not all lights must support all parameters. If you + * can do something backward-compatible, you should. + */ +struct light_state_t { + /** + * The color of the LED in ARGB. + * + * Do your best here. + * - If your light can only do red or green, if they ask for blue, + * you should do green. + * - If you can only do a brightness ramp, then use this formula: + * unsigned char brightness = ((77*((color>>16)&0x00ff)) + * + (150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8; + * - If you can only do on or off, 0 is off, anything else is on. + * + * The high byte should be ignored. Callers will set it to 0xff (which + * would correspond to 255 alpha). + * + * CyanogenMod: The high byte value can be implemented to control the LEDs + * Brightness from the Lights settings. The value goes from 0x01 to 0xFF. + */ + unsigned int color; + + /** + * See the LIGHT_FLASH_* constants + */ + int flashMode; + int flashOnMS; + int flashOffMS; + + /** + * Policy used by the framework to manage the light's brightness. + * Currently the values are BRIGHTNESS_MODE_USER and BRIGHTNESS_MODE_SENSOR. + */ + int brightnessMode; + + /** + * Define the LEDs modes (multiple, ...). + * See the LIGHTS_MODE_* mask constants. + */ + unsigned int ledsModes; +}; + +struct light_device_t { + struct hw_device_t common; + + /** + * Set the provided lights to the provided values. + * + * Returns: 0 on succes, error code on failure. + */ + int (*set_light)(struct light_device_t* dev, + struct light_state_t const* state); +}; + + +__END_DECLS + +#endif // ANDROID_LIGHTS_INTERFACE_H + diff --git a/third_party/android_hardware_libhardware/include/hardware/local_time_hal.h b/third_party/android_hardware_libhardware/include/hardware/local_time_hal.h new file mode 100644 index 000000000..946e79978 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/local_time_hal.h @@ -0,0 +1,123 @@ +/* + * 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_LOCAL_TIME_HAL_INTERFACE_H +#define ANDROID_LOCAL_TIME_HAL_INTERFACE_H + +#include + +#include + +__BEGIN_DECLS + +/** + * The id of this module + */ +#define LOCAL_TIME_HARDWARE_MODULE_ID "local_time" + +/** + * Name of the local time devices to open + */ +#define LOCAL_TIME_HARDWARE_INTERFACE "local_time_hw_if" + +/**********************************************************************/ + +/** + * A structure used to collect low level sync data in a lab environment. Most + * HAL implementations will never need this structure. + */ +struct local_time_debug_event { + int64_t local_timesync_event_id; + int64_t local_time; +}; + +/** + * 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 local_time_module { + struct hw_module_t common; +}; + +struct local_time_hw_device { + /** + * Common methods of the local time hardware device. This *must* be the first member of + * local_time_hw_device as users of this structure will cast a hw_device_t to + * local_time_hw_device pointer in contexts where it's known the hw_device_t references a + * local_time_hw_device. + */ + struct hw_device_t common; + + /** + * + * Returns the current value of the system wide local time counter + */ + int64_t (*get_local_time)(struct local_time_hw_device* dev); + + /** + * + * Returns the nominal frequency (in hertz) of the system wide local time + * counter + */ + uint64_t (*get_local_freq)(struct local_time_hw_device* dev); + + /** + * + * Sets the HW slew rate of oscillator which drives the system wide local + * time counter. On success, platforms should return 0. Platforms which + * do not support HW slew should leave this method set to NULL. + * + * Valid values for rate range from MIN_INT16 to MAX_INT16. Platform + * implementations should attempt map this range linearly to the min/max + * slew rate of their hardware. + */ + int (*set_local_slew)(struct local_time_hw_device* dev, int16_t rate); + + /** + * + * A method used to collect low level sync data in a lab environments. + * Most HAL implementations will simply set this member to NULL, or return + * -EINVAL to indicate that this functionality is not supported. + * Production HALs should never support this method. + */ + int (*get_debug_log)(struct local_time_hw_device* dev, + struct local_time_debug_event* records, + int max_records); +}; + +typedef struct local_time_hw_device local_time_hw_device_t; + +/** convenience API for opening and closing a supported device */ + +static inline int local_time_hw_device_open( + const struct hw_module_t* module, + struct local_time_hw_device** device) +{ + return module->methods->open(module, LOCAL_TIME_HARDWARE_INTERFACE, + (struct hw_device_t**)device); +} + +static inline int local_time_hw_device_close(struct local_time_hw_device* device) +{ + return device->common.close(&device->common); +} + + +__END_DECLS + +#endif // ANDROID_LOCAL_TIME_INTERFACE_H diff --git a/third_party/android_hardware_libhardware/include/hardware/memtrack.h b/third_party/android_hardware_libhardware/include/hardware/memtrack.h new file mode 100644 index 000000000..57ba4ad79 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/memtrack.h @@ -0,0 +1,160 @@ +/* + * 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_HARDWARE_MEMTRACK_H +#define ANDROID_INCLUDE_HARDWARE_MEMTRACK_H + +#include +#include +#include + +#include + +__BEGIN_DECLS + +#define MEMTRACK_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) + +/** + * The id of this module + */ +#define MEMTRACK_HARDWARE_MODULE_ID "memtrack" + +/* + * The Memory Tracker HAL is designed to return information about device-specific + * memory usage. The primary goal is to be able to track memory that is not + * trackable in any other way, for example texture memory that is allocated by + * a process, but not mapped in to that process' address space. + * A secondary goal is to be able to categorize memory used by a process into + * GL, graphics, etc. All memory sizes should be in real memory usage, + * accounting for stride, bit depth, rounding up to page size, etc. + * + * A process collecting memory statistics will call getMemory for each + * combination of pid and memory type. For each memory type that it recognizes + * the HAL should fill out an array of memtrack_record structures breaking + * down the statistics of that memory type as much as possible. For example, + * getMemory(, MEMTRACK_TYPE_GL) might return: + * { { 4096, ACCOUNTED | PRIVATE | SYSTEM }, + * { 40960, UNACCOUNTED | PRIVATE | SYSTEM }, + * { 8192, ACCOUNTED | PRIVATE | DEDICATED }, + * { 8192, UNACCOUNTED | PRIVATE | DEDICATED } } + * If the HAL could not differentiate between SYSTEM and DEDICATED memory, it + * could return: + * { { 12288, ACCOUNTED | PRIVATE }, + * { 49152, UNACCOUNTED | PRIVATE } } + * + * Memory should not overlap between types. For example, a graphics buffer + * that has been mapped into the GPU as a surface should show up when + * MEMTRACK_TYPE_GRAPHICS is requested, and not when MEMTRACK_TYPE_GL + * is requested. + */ + +enum memtrack_type { + MEMTRACK_TYPE_OTHER = 0, + MEMTRACK_TYPE_GL = 1, + MEMTRACK_TYPE_GRAPHICS = 2, + MEMTRACK_TYPE_MULTIMEDIA = 3, + MEMTRACK_TYPE_CAMERA = 4, + MEMTRACK_NUM_TYPES, +}; + +struct memtrack_record { + size_t size_in_bytes; + unsigned int flags; +}; + +/** + * Flags to differentiate memory that can already be accounted for in + * /proc//smaps, + * (Shared_Clean + Shared_Dirty + Private_Clean + Private_Dirty = Size). + * In general, memory mapped in to a userspace process is accounted unless + * it was mapped with remap_pfn_range. + * Exactly one of these should be set. + */ +#define MEMTRACK_FLAG_SMAPS_ACCOUNTED (1 << 1) +#define MEMTRACK_FLAG_SMAPS_UNACCOUNTED (1 << 2) + +/** + * Flags to differentiate memory shared across multiple processes vs. memory + * used by a single process. Only zero or one of these may be set in a record. + * If none are set, record is assumed to count shared + private memory. + */ +#define MEMTRACK_FLAG_SHARED (1 << 3) +#define MEMTRACK_FLAG_SHARED_PSS (1 << 4) /* shared / num_procesess */ +#define MEMTRACK_FLAG_PRIVATE (1 << 5) + +/** + * Flags to differentiate memory taken from the kernel's allocation pool vs. + * memory that is dedicated to non-kernel allocations, for example a carveout + * or separate video memory. Only zero or one of these may be set in a record. + * If none are set, record is assumed to count system + dedicated memory. + */ +#define MEMTRACK_FLAG_SYSTEM (1 << 6) +#define MEMTRACK_FLAG_DEDICATED (1 << 7) + +/** + * Flags to differentiate memory accessible by the CPU in non-secure mode vs. + * memory that is protected. Only zero or one of these may be set in a record. + * If none are set, record is assumed to count secure + nonsecure memory. + */ +#define MEMTRACK_FLAG_NONSECURE (1 << 8) +#define MEMTRACK_FLAG_SECURE (1 << 9) + +/** + * 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 memtrack_module { + struct hw_module_t common; + + /** + * (*init)() performs memtrack management setup actions and is called + * once before any calls to getMemory(). + * Returns 0 on success, -errno on error. + */ + int (*init)(const struct memtrack_module *module); + + /** + * (*getMemory)() expects an array of record objects and populates up to + * *num_record structures with the sizes of memory plus associated flags for + * that memory. It also updates *num_records with the total number of + * records it could return if *num_records was large enough when passed in. + * Returning records with size 0 is expected, the number of records should + * not vary between calls to getMemory for the same memory type, even + * for different pids. + * + * The caller will often call getMemory for a type and pid with + * *num_records == 0 to determine how many records to allocate room for, + * this case should be a fast-path in the HAL, returning a constant and + * not querying any kernel files. If *num_records passed in is 0, + * then records may be NULL. + * + * This function must be thread-safe, it may get called from multiple + * threads at the same time. + * + * Returns 0 on success, -ENODEV if the type is not supported, -errno + * on other errors. + */ + int (*getMemory)(const struct memtrack_module *module, + pid_t pid, + int type, + struct memtrack_record *records, + size_t *num_records); +} memtrack_module_t; + +__END_DECLS + +#endif // ANDROID_INCLUDE_HARDWARE_MEMTRACK_H diff --git a/third_party/android_hardware_libhardware/include/hardware/nfc.h b/third_party/android_hardware_libhardware/include/hardware/nfc.h new file mode 100644 index 000000000..6002e34e8 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/nfc.h @@ -0,0 +1,302 @@ +/* + * Copyright (C) 2011, 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_NFC_HAL_INTERFACE_H +#define ANDROID_NFC_HAL_INTERFACE_H + +#include +#include +#include +#include + +#include + +__BEGIN_DECLS + + +/* NFC device HAL for NCI-based NFC controllers. + * + * This HAL allows NCI silicon vendors to make use + * of the core NCI stack in Android for their own silicon. + * + * The responibilities of the NCI HAL implementation + * are as follows: + * + * - Implement the transport to the NFC controller + * - Implement each of the HAL methods specified below as applicable to their silicon + * - Pass up received NCI messages from the controller to the stack + * + * A simplified timeline of NCI HAL method calls: + * 1) Core NCI stack calls open() + * 2) Core NCI stack executes CORE_RESET and CORE_INIT through calls to write() + * 3) Core NCI stack calls core_initialized() to allow HAL to do post-init configuration + * 4) Core NCI stack calls pre_discover() to allow HAL to prepare for RF discovery + * 5) Core NCI stack starts discovery through calls to write() + * 6) Core NCI stack stops discovery through calls to write() (e.g. screen turns off) + * 7) Core NCI stack calls pre_discover() to prepare for RF discovery (e.g. screen turned back on) + * 8) Core NCI stack starts discovery through calls to write() + * ... + * ... + * 9) Core NCI stack calls close() + */ +#define NFC_NCI_HARDWARE_MODULE_ID "nfc_nci" +#define NFC_NCI_BCM2079X_HARDWARE_MODULE_ID "nfc_nci.bcm2079x" +#define NFC_NCI_NXP_PN54X_HARDWARE_MODULE_ID "nfc_nci.pn54x" +#define NFC_NCI_CONTROLLER "nci" + +/* + * nfc_nci_module_t should contain module-specific parameters + */ +typedef struct nfc_nci_module_t { + /** + * Common methods of the NFC NCI module. This *must* be the first member of + * nfc_nci_module_t as users of this structure will cast a hw_module_t to + * nfc_nci_module_t pointer in contexts where it's known the hw_module_t references a + * nfc_nci_module_t. + */ + struct hw_module_t common; +} nfc_nci_module_t; + +/* + * HAL events that can be passed back to the stack + */ +typedef uint8_t nfc_event_t; + +enum { + HAL_NFC_OPEN_CPLT_EVT = 0x00, + HAL_NFC_CLOSE_CPLT_EVT = 0x01, + HAL_NFC_POST_INIT_CPLT_EVT = 0x02, + HAL_NFC_PRE_DISCOVER_CPLT_EVT = 0x03, + HAL_NFC_REQUEST_CONTROL_EVT = 0x04, + HAL_NFC_RELEASE_CONTROL_EVT = 0x05, + HAL_NFC_ERROR_EVT = 0x06 +}; + +/* + * Allowed status return values for each of the HAL methods + */ +typedef uint8_t nfc_status_t; + +enum { + HAL_NFC_STATUS_OK = 0x00, + HAL_NFC_STATUS_FAILED = 0x01, + HAL_NFC_STATUS_ERR_TRANSPORT = 0x02, + HAL_NFC_STATUS_ERR_CMD_TIMEOUT = 0x03, + HAL_NFC_STATUS_REFUSED = 0x04 +}; + +/* + * The callback passed in from the NFC stack that the HAL + * can use to pass events back to the stack. + */ +typedef void (nfc_stack_callback_t) (nfc_event_t event, nfc_status_t event_status); + +/* + * The callback passed in from the NFC stack that the HAL + * can use to pass incomming data to the stack. + */ +typedef void (nfc_stack_data_callback_t) (uint16_t data_len, uint8_t* p_data); + +/* nfc_nci_device_t starts with a hw_device_t struct, + * followed by device-specific methods and members. + * + * All methods in the NCI HAL are asynchronous. + */ +typedef struct nfc_nci_device { + /** + * Common methods of the NFC NCI device. This *must* be the first member of + * nfc_nci_device_t as users of this structure will cast a hw_device_t to + * nfc_nci_device_t pointer in contexts where it's known the hw_device_t references a + * nfc_nci_device_t. + */ + struct hw_device_t common; + /* + * (*open)() Opens the NFC controller device and performs initialization. + * This may include patch download and other vendor-specific initialization. + * + * If open completes successfully, the controller should be ready to perform + * NCI initialization - ie accept CORE_RESET and subsequent commands through + * the write() call. + * + * If open() returns 0, the NCI stack will wait for a HAL_NFC_OPEN_CPLT_EVT + * before continuing. + * + * If open() returns any other value, the NCI stack will stop. + * + */ + int (*open)(const struct nfc_nci_device *p_dev, nfc_stack_callback_t *p_cback, + nfc_stack_data_callback_t *p_data_cback); + + /* + * (*write)() Performs an NCI write. + * + * This method may queue writes and return immediately. The only + * requirement is that the writes are executed in order. + */ + int (*write)(const struct nfc_nci_device *p_dev, uint16_t data_len, const uint8_t *p_data); + + /* + * (*core_initialized)() is called after the CORE_INIT_RSP is received from the NFCC. + * At this time, the HAL can do any chip-specific configuration. + * + * If core_initialized() returns 0, the NCI stack will wait for a HAL_NFC_POST_INIT_CPLT_EVT + * before continuing. + * + * If core_initialized() returns any other value, the NCI stack will continue + * immediately. + */ + int (*core_initialized)(const struct nfc_nci_device *p_dev, uint8_t* p_core_init_rsp_params); + + /* + * (*pre_discover)() Is called every time before starting RF discovery. + * It is a good place to do vendor-specific configuration that must be + * performed every time RF discovery is about to be started. + * + * If pre_discover() returns 0, the NCI stack will wait for a HAL_NFC_PRE_DISCOVER_CPLT_EVT + * before continuing. + * + * If pre_discover() returns any other value, the NCI stack will start + * RF discovery immediately. + */ + int (*pre_discover)(const struct nfc_nci_device *p_dev); + + /* + * (*close)() Closed the NFC controller. Should free all resources. + */ + int (*close)(const struct nfc_nci_device *p_dev); + + /* + * (*control_granted)() Grant HAL the exclusive control to send NCI commands. + * Called in response to HAL_REQUEST_CONTROL_EVT. + * Must only be called when there are no NCI commands pending. + * HAL_RELEASE_CONTROL_EVT will notify when HAL no longer needs exclusive control. + */ + int (*control_granted)(const struct nfc_nci_device *p_dev); + + /* + * (*power_cycle)() Restart controller by power cyle; + * HAL_OPEN_CPLT_EVT will notify when operation is complete. + */ + int (*power_cycle)(const struct nfc_nci_device *p_dev); +} nfc_nci_device_t; + +/* + * Convenience methods that the NFC stack can use to open + * and close an NCI device + */ +static inline int nfc_nci_open(const struct hw_module_t* module, + nfc_nci_device_t** dev) { + return module->methods->open(module, NFC_NCI_CONTROLLER, + (struct hw_device_t**) dev); +} + +static inline int nfc_nci_close(nfc_nci_device_t* dev) { + return dev->common.close(&dev->common); +} +/* + * End NFC NCI HAL + */ + +/* + * This is a limited NFC HAL for NXP PN544-based devices. + * This HAL as Android is moving to + * an NCI-based NFC stack. + * + * All NCI-based NFC controllers should use the NFC-NCI + * HAL instead. + * Begin PN544 specific HAL + */ +#define NFC_HARDWARE_MODULE_ID "nfc" + +#define NFC_PN544_CONTROLLER "pn544" + +typedef struct nfc_module_t { + /** + * Common methods of the NFC NXP PN544 module. This *must* be the first member of + * nfc_module_t as users of this structure will cast a hw_module_t to + * nfc_module_t pointer in contexts where it's known the hw_module_t references a + * nfc_module_t. + */ + struct hw_module_t common; +} nfc_module_t; + +/* + * PN544 linktypes. + * UART + * I2C + * USB (uses UART DAL) + */ +typedef enum { + PN544_LINK_TYPE_UART, + PN544_LINK_TYPE_I2C, + PN544_LINK_TYPE_USB, + PN544_LINK_TYPE_INVALID, +} nfc_pn544_linktype; + +typedef struct { + /** + * Common methods of the NFC NXP PN544 device. This *must* be the first member of + * nfc_pn544_device_t as users of this structure will cast a hw_device_t to + * nfc_pn544_device_t pointer in contexts where it's known the hw_device_t references a + * nfc_pn544_device_t. + */ + struct hw_device_t common; + + /* The number of EEPROM registers to write */ + uint32_t num_eeprom_settings; + + /* The actual EEPROM settings + * For PN544, each EEPROM setting is a 4-byte entry, + * of the format [0x00, addr_msb, addr_lsb, value]. + */ + uint8_t* eeprom_settings; + + /* The link type to which the PN544 is connected */ + nfc_pn544_linktype linktype; + + /* The device node to which the PN544 is connected */ + const char* device_node; + + /* On Crespo we had an I2C issue that would cause us to sometimes read + * the I2C slave address (0x57) over the bus. libnfc contains + * a hack to ignore this byte and try to read the length byte + * again. + * Set to 0 to disable the workaround, 1 to enable it. + */ + uint8_t enable_i2c_workaround; + /* I2C slave address. Multiple I2C addresses are + * possible for PN544 module. Configure address according to + * board design. + */ + uint8_t i2c_device_address; +} nfc_pn544_device_t; + +static inline int nfc_pn544_open(const struct hw_module_t* module, + nfc_pn544_device_t** dev) { + return module->methods->open(module, NFC_PN544_CONTROLLER, + (struct hw_device_t**) dev); +} + +static inline int nfc_pn544_close(nfc_pn544_device_t* dev) { + return dev->common.close(&dev->common); +} +/* + * End PN544 specific HAL + */ + +__END_DECLS + +#endif // ANDROID_NFC_HAL_INTERFACE_H diff --git a/third_party/android_hardware_libhardware/include/hardware/nfc_tag.h b/third_party/android_hardware_libhardware/include/hardware/nfc_tag.h new file mode 100644 index 000000000..040a07d8c --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/nfc_tag.h @@ -0,0 +1,95 @@ +/* + * 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_NFC_TAG_HAL_INTERFACE_H +#define ANDROID_NFC_TAG_HAL_INTERFACE_H + +#include + +#include + +__BEGIN_DECLS + +/* + * HAL for programmable NFC tags. + * + */ + +#define NFC_TAG_HARDWARE_MODULE_ID "nfc_tag" +#define NFC_TAG_ID "tag" + +typedef struct nfc_tag_module_t { + /** + * Common methods of the NFC tag module. This *must* be the first member of + * nfc_tag_module_t as users of this structure will cast a hw_module_t to + * nfc_tag_module_t pointer in contexts where it's known the hw_module_t references a + * nfc_tag_module_t. + */ + struct hw_module_t common; +} nfc_tag_module_t; + +typedef struct nfc_tag_device { + /** + * Common methods of the NFC tag device. This *must* be the first member of + * nfc_tag_device_t as users of this structure will cast a hw_device_t to + * nfc_tag_device_t pointer in contexts where it's known the hw_device_t references a + * nfc_tag_device_t. + */ + struct hw_device_t common; + + /** + * Initialize the NFC tag. + * + * The driver must: + * * Set the static lock bytes to read only + * * Configure the Capability Container to disable write acess + * eg: 0xE1 0x10 0x0F + * + * This function is called once before any calls to setContent(). + * + * Return 0 on success or -errno on error. + */ + int (*init)(const struct nfc_tag_device *dev); + + /** + * Set the NFC tag content. + * + * The driver must write in the data area of the tag starting at + * byte 0 of block 4 and zero the rest of the data area. + * + * Returns 0 on success or -errno on error. + */ + int (*setContent)(const struct nfc_tag_device *dev, const uint8_t *data, size_t len); + + /** + * Returns the memory size of the data area. + */ + int (*getMemorySize)(const struct nfc_tag_device *dev); +} nfc_tag_device_t; + +static inline int nfc_tag_open(const struct hw_module_t* module, + nfc_tag_device_t** dev) { + return module->methods->open(module, NFC_TAG_ID, + (struct hw_device_t**)dev); +} + +static inline int nfc_tag_close(nfc_tag_device_t* dev) { + return dev->common.close(&dev->common); +} + +__END_DECLS + +#endif // ANDROID_NFC_TAG_HAL_INTERFACE_H diff --git a/third_party/android_hardware_libhardware/include/hardware/power.h b/third_party/android_hardware_libhardware/include/hardware/power.h new file mode 100644 index 000000000..2eb98fe96 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/power.h @@ -0,0 +1,184 @@ +/* + * 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_HARDWARE_POWER_H +#define ANDROID_INCLUDE_HARDWARE_POWER_H + +#include +#include +#include + +#include + +__BEGIN_DECLS + +#define POWER_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) +#define POWER_MODULE_API_VERSION_0_2 HARDWARE_MODULE_API_VERSION(0, 2) +#define POWER_MODULE_API_VERSION_0_3 HARDWARE_MODULE_API_VERSION(0, 3) + +/** + * The id of this module + */ +#define POWER_HARDWARE_MODULE_ID "power" + +/* + * Power hint identifiers passed to (*powerHint) + */ + +typedef enum { + POWER_HINT_VSYNC = 0x00000001, + POWER_HINT_INTERACTION = 0x00000002, + /* DO NOT USE POWER_HINT_VIDEO_ENCODE/_DECODE! They will be removed in + * KLP. + */ + POWER_HINT_VIDEO_ENCODE = 0x00000003, + POWER_HINT_VIDEO_DECODE = 0x00000004, + POWER_HINT_LOW_POWER = 0x00000005, + POWER_HINT_CAM_PREVIEW = 0x00000006, + + POWER_HINT_CPU_BOOST = 0x00000010, + POWER_HINT_LAUNCH_BOOST = 0x00000011, + POWER_HINT_AUDIO = 0x00000020, + POWER_HINT_SET_PROFILE = 0x00000030 + +} power_hint_t; + +typedef enum { + POWER_FEATURE_DOUBLE_TAP_TO_WAKE = 0x00000001, + POWER_FEATURE_SUPPORTED_PROFILES = 0x00001000 +} feature_t; + +/** + * Process info, passed as an opaque handle when + * using POWER_HINT_LAUNCH_BOOST. + */ +typedef struct launch_boost_info { + pid_t pid; + const char* packageName; +} launch_boost_info_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 power_module { + struct hw_module_t common; + + /* + * (*init)() performs power management setup actions at runtime + * startup, such as to set default cpufreq parameters. This is + * called only by the Power HAL instance loaded by + * PowerManagerService. + */ + void (*init)(struct power_module *module); + + /* + * (*setInteractive)() performs power management actions upon the + * system entering interactive state (that is, the system is awake + * and ready for interaction, often with UI devices such as + * display and touchscreen enabled) or non-interactive state (the + * system appears asleep, display usually turned off). The + * non-interactive state is usually entered after a period of + * inactivity, in order to conserve battery power during + * such inactive periods. + * + * Typical actions are to turn on or off devices and adjust + * cpufreq parameters. This function may also call the + * appropriate interfaces to allow the kernel to suspend the + * system to low-power sleep state when entering non-interactive + * state, and to disallow low-power suspend when the system is in + * interactive state. When low-power suspend state is allowed, the + * kernel may suspend the system whenever no wakelocks are held. + * + * on is non-zero when the system is transitioning to an + * interactive / awake state, and zero when transitioning to a + * non-interactive / asleep state. + * + * This function is called to enter non-interactive state after + * turning off the screen (if present), and called to enter + * interactive state prior to turning on the screen. + */ + void (*setInteractive)(struct power_module *module, int on); + + /* + * (*powerHint) is called to pass hints on power requirements, which + * may result in adjustment of power/performance parameters of the + * cpufreq governor and other controls. The possible hints are: + * + * POWER_HINT_VSYNC + * + * Foreground app has started or stopped requesting a VSYNC pulse + * from SurfaceFlinger. If the app has started requesting VSYNC + * then CPU and GPU load is expected soon, and it may be appropriate + * to raise speeds of CPU, memory bus, etc. The data parameter is + * non-zero to indicate VSYNC pulse is now requested, or zero for + * VSYNC pulse no longer requested. + * + * POWER_HINT_INTERACTION + * + * User is interacting with the device, for example, touchscreen + * events are incoming. CPU and GPU load may be expected soon, + * and it may be appropriate to raise speeds of CPU, memory bus, + * etc. The data parameter is the estimated length of the interaction + * in milliseconds, or 0 if unknown. + * + * POWER_HINT_LOW_POWER + * + * Low power mode is activated or deactivated. Low power mode + * is intended to save battery at the cost of performance. The data + * parameter is non-zero when low power mode is activated, and zero + * when deactivated. + * + * POWER_HINT_CPU_BOOST + * + * An operation is happening where it would be ideal for the CPU to + * be boosted for a specific duration. The data parameter is an + * integer value of the boost duration in microseconds. + * + * A particular platform may choose to ignore any hint. + * + * availability: version 0.2 + * + */ + void (*powerHint)(struct power_module *module, power_hint_t hint, + void *data); + + /* + * (*setFeature) is called to turn on or off a particular feature + * depending on the state parameter. The possible features are: + * + * FEATURE_DOUBLE_TAP_TO_WAKE + * + * Enabling/Disabling this feature will allow/disallow the system + * to wake up by tapping the screen twice. + * + * availability: version 0.3 + * + */ + void (*setFeature)(struct power_module *module, feature_t feature, int state); + + /* + * (*getFeature) is called to get the current value of a particular + * feature or capability from the hardware or PowerHAL + */ + int (*getFeature)(struct power_module *module, feature_t feature); + +} power_module_t; + +__END_DECLS + +#endif // ANDROID_INCLUDE_HARDWARE_POWER_H diff --git a/third_party/android_hardware_libhardware/include/hardware/qemu_pipe.h b/third_party/android_hardware_libhardware/include/hardware/qemu_pipe.h new file mode 100644 index 000000000..53aec97a0 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/qemu_pipe.h @@ -0,0 +1,94 @@ +/* + * 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_INCLUDE_HARDWARE_QEMU_PIPE_H +#define ANDROID_INCLUDE_HARDWARE_QEMU_PIPE_H + +#include +#include +#include +#include +#include /* for pthread_once() */ +#include +#include +#include +#include + +#ifndef D +# define D(...) do{}while(0) +#endif + +/* Try to open a new Qemu fast-pipe. This function returns a file descriptor + * that can be used to communicate with a named service managed by the + * emulator. + * + * This file descriptor can be used as a standard pipe/socket descriptor. + * + * 'pipeName' is the name of the emulator service you want to connect to. + * E.g. 'opengles' or 'camera'. + * + * On success, return a valid file descriptor + * Returns -1 on error, and errno gives the error code, e.g.: + * + * EINVAL -> unknown/unsupported pipeName + * ENOSYS -> fast pipes not available in this system. + * + * ENOSYS should never happen, except if you're trying to run within a + * misconfigured emulator. + * + * You should be able to open several pipes to the same pipe service, + * except for a few special cases (e.g. GSM modem), where EBUSY will be + * returned if more than one client tries to connect to it. + */ +static __inline__ int +qemu_pipe_open(const char* pipeName) +{ + char buff[256]; + int buffLen; + int fd, ret; + + if (pipeName == NULL || pipeName[0] == '\0') { + errno = EINVAL; + return -1; + } + + snprintf(buff, sizeof buff, "pipe:%s", pipeName); + + fd = open("/dev/qemu_pipe", O_RDWR); + if (fd < 0 && errno == ENOENT) + fd = open("/dev/goldfish_pipe", O_RDWR); + if (fd < 0) { + D("%s: Could not open /dev/qemu_pipe: %s", __FUNCTION__, strerror(errno)); + //errno = ENOSYS; + return -1; + } + + buffLen = strlen(buff); + + ret = TEMP_FAILURE_RETRY(write(fd, buff, buffLen+1)); + if (ret != buffLen+1) { + D("%s: Could not connect to %s pipe service: %s", __FUNCTION__, pipeName, strerror(errno)); + if (ret == 0) { + errno = ECONNRESET; + } else if (ret > 0) { + errno = EINVAL; + } + return -1; + } + + return fd; +} + +#endif /* ANDROID_INCLUDE_HARDWARE_QEMUD_PIPE_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/qemud.h b/third_party/android_hardware_libhardware/include/hardware/qemud.h new file mode 100644 index 000000000..5c39f9c93 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/qemud.h @@ -0,0 +1,153 @@ +/* + * 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_QEMUD_H +#define ANDROID_INCLUDE_HARDWARE_QEMUD_H + +#include +#include "qemu_pipe.h" + +/* the following is helper code that is used by the QEMU-specific + * hardware HAL modules to communicate with the emulator program + * through the 'qemud' multiplexing daemon, or through the qemud + * pipe. + * + * see the documentation comments for details in + * development/emulator/qemud/qemud.c + * + * all definitions here are built into the HAL module to avoid + * having to write a tiny shared library for this. + */ + +/* we expect the D macro to be defined to a function macro + * that sends its formatted string argument(s) to the log. + * If not, ignore the traces. + */ +#ifndef D +# define D(...) ((void)0) +#endif + +static __inline__ int +qemud_fd_write(int fd, const void* buff, int len) +{ + int len2; + do { + len2 = write(fd, buff, len); + } while (len2 < 0 && errno == EINTR); + return len2; +} + +static __inline__ int +qemud_fd_read(int fd, void* buff, int len) +{ + int len2; + do { + len2 = read(fd, buff, len); + } while (len2 < 0 && errno == EINTR); + return len2; +} + +static __inline__ int +qemud_channel_open(const char* name) +{ + int fd; + int namelen = strlen(name); + char answer[2]; + char pipe_name[256]; + + /* First, try to connect to the pipe. */ + snprintf(pipe_name, sizeof(pipe_name), "qemud:%s", name); + fd = qemu_pipe_open(pipe_name); + if (fd < 0) { + D("QEMUD pipe is not available for %s: %s", name, strerror(errno)); + /* If pipe is not available, connect to qemud control socket */ + fd = socket_local_client( "qemud", + ANDROID_SOCKET_NAMESPACE_RESERVED, + SOCK_STREAM ); + if (fd < 0) { + D("no qemud control socket: %s", strerror(errno)); + return -1; + } + + /* send service name to connect */ + if (qemud_fd_write(fd, name, namelen) != namelen) { + D("can't send service name to qemud: %s", + strerror(errno)); + close(fd); + return -1; + } + + /* read answer from daemon */ + if (qemud_fd_read(fd, answer, 2) != 2 || + answer[0] != 'O' || answer[1] != 'K') { + D("cant' connect to %s service through qemud", name); + close(fd); + return -1; + } + } + return fd; +} + +static __inline__ int +qemud_channel_send(int fd, const void* msg, int msglen) +{ + char header[5]; + + if (msglen < 0) + msglen = strlen((const char*)msg); + + if (msglen == 0) + return 0; + + snprintf(header, sizeof header, "%04x", msglen); + if (qemud_fd_write(fd, header, 4) != 4) { + D("can't write qemud frame header: %s", strerror(errno)); + return -1; + } + + if (qemud_fd_write(fd, msg, msglen) != msglen) { + D("can4t write qemud frame payload: %s", strerror(errno)); + return -1; + } + return 0; +} + +static __inline__ int +qemud_channel_recv(int fd, void* msg, int msgsize) +{ + char header[5]; + int size, avail; + + if (qemud_fd_read(fd, header, 4) != 4) { + D("can't read qemud frame header: %s", strerror(errno)); + return -1; + } + header[4] = 0; + if (sscanf(header, "%04x", &size) != 1) { + D("malformed qemud frame header: '%.*s'", 4, header); + return -1; + } + if (size > msgsize) + return -1; + + if (qemud_fd_read(fd, msg, size) != size) { + D("can't read qemud frame payload: %s", strerror(errno)); + return -1; + } + return size; +} + +#endif /* ANDROID_INCLUDE_HARDWARE_QEMUD_H */ diff --git a/third_party/android_hardware_libhardware/include/hardware/radio.h b/third_party/android_hardware_libhardware/include/hardware/radio.h new file mode 100644 index 000000000..145deb573 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/radio.h @@ -0,0 +1,298 @@ +/* + * Copyright (C) 2015 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 +#include + +#ifndef ANDROID_RADIO_HAL_H +#define ANDROID_RADIO_HAL_H + + +__BEGIN_DECLS + +/** + * The id of this module + */ +#define RADIO_HARDWARE_MODULE_ID "radio" + +/** + * Name of the audio devices to open + */ +#define RADIO_HARDWARE_DEVICE "radio_hw_device" + +#define RADIO_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) +#define RADIO_MODULE_API_VERSION_CURRENT RADIO_MODULE_API_VERSION_1_0 + + +#define RADIO_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) +#define RADIO_DEVICE_API_VERSION_CURRENT RADIO_DEVICE_API_VERSION_1_0 + +/** + * List of known radio HAL modules. This is the base name of the radio HAL + * library composed of the "radio." prefix, one of the base names below and + * a suffix specific to the device. + * E.g: radio.fm.default.so + */ + +#define RADIO_HARDWARE_MODULE_ID_FM "fm" /* corresponds to RADIO_CLASS_AM_FM */ +#define RADIO_HARDWARE_MODULE_ID_SAT "sat" /* corresponds to RADIO_CLASS_SAT */ +#define RADIO_HARDWARE_MODULE_ID_DT "dt" /* corresponds to RADIO_CLASS_DT */ + + +/** + * 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 radio_module { + struct hw_module_t common; +}; + +/* + * Callback function called by the HAL when one of the following occurs: + * - event RADIO_EVENT_HW_FAILURE: radio chip of driver failure requiring + * closing and reopening of the tuner interface. + * - event RADIO_EVENT_CONFIG: new configuration applied in response to open_tuner(), + * or set_configuration(). The event status is 0 (no error) if the configuration has been applied, + * -EINVAL is not or -ETIMEDOUT in case of time out. + * - event RADIO_EVENT_TUNED: tune locked on new station/frequency following scan(), + * step(), tune() or auto AF switching. The event status is 0 (no error) if in tune, + * -EINVAL is not tuned and data in radio_program_info is not valid or -ETIMEDOUT if scan() + * timed out. + * - event RADIO_EVENT_TA: at the beginning and end of traffic announcement if current + * configuration enables TA. + * - event RADIO_EVENT_AF: after automatic switching to alternate frequency if current + * configuration enables AF switching. + * - event RADIO_EVENT_ANTENNA: when the antenna is connected or disconnected. + * - event RADIO_EVENT_METADATA: when new meta data are received from the tuned station. + * The callback MUST NOT be called synchronously while executing a HAL function but from + * a separate thread. + */ +typedef void (*radio_callback_t)(radio_hal_event_t *event, void *cookie); + +/* control interface for a radio tuner */ +struct radio_tuner { + /* + * Apply current radio band configuration (band, range, channel spacing ...). + * + * arguments: + * - config: the band configuration to apply + * + * returns: + * 0 if configuration could be applied + * -EINVAL if configuration requested is invalid + * + * Automatically cancels pending scan, step or tune. + * + * Callback function with event RADIO_EVENT_CONFIG MUST be called once the + * configuration is applied or a failure occurs or after a time out. + */ + int (*set_configuration)(const struct radio_tuner *tuner, + const radio_hal_band_config_t *config); + + /* + * Retrieve current radio band configuration. + * + * arguments: + * - config: where to return the band configuration + * + * returns: + * 0 if valid configuration is returned + * -EINVAL if invalid arguments are passed + */ + int (*get_configuration)(const struct radio_tuner *tuner, + radio_hal_band_config_t *config); + + /* + * Start scanning up to next valid station. + * Must be called when a valid configuration has been applied. + * + * arguments: + * - direction: RADIO_DIRECTION_UP or RADIO_DIRECTION_DOWN + * - skip_sub_channel: valid for HD radio or digital radios only: ignore sub channels + * (e.g SPS for HD radio). + * + * returns: + * 0 if scan successfully started + * -ENOSYS if called out of sequence + * -ENODEV if another error occurs + * + * Automatically cancels pending scan, step or tune. + * + * Callback function with event RADIO_EVENT_TUNED MUST be called once + * locked on a station or after a time out or full frequency scan if + * no station found. The event status should indicate if a valid station + * is tuned or not. + */ + int (*scan)(const struct radio_tuner *tuner, + radio_direction_t direction, bool skip_sub_channel); + + /* + * Move one channel spacing up or down. + * Must be called when a valid configuration has been applied. + * + * arguments: + * - direction: RADIO_DIRECTION_UP or RADIO_DIRECTION_DOWN + * - skip_sub_channel: valid for HD radio or digital radios only: ignore sub channels + * (e.g SPS for HD radio). + * + * returns: + * 0 if step successfully started + * -ENOSYS if called out of sequence + * -ENODEV if another error occurs + * + * Automatically cancels pending scan, step or tune. + * + * Callback function with event RADIO_EVENT_TUNED MUST be called once + * step completed or after a time out. The event status should indicate + * if a valid station is tuned or not. + */ + int (*step)(const struct radio_tuner *tuner, + radio_direction_t direction, bool skip_sub_channel); + + /* + * Tune to specified frequency. + * Must be called when a valid configuration has been applied. + * + * arguments: + * - channel: channel to tune to. A frequency in kHz for AM/FM/HD Radio bands. + * - sub_channel: valid for HD radio or digital radios only: (e.g SPS number for HD radio). + * + * returns: + * 0 if tune successfully started + * -ENOSYS if called out of sequence + * -EINVAL if invalid arguments are passed + * -ENODEV if another error occurs + * + * Automatically cancels pending scan, step or tune. + * + * Callback function with event RADIO_EVENT_TUNED MUST be called once + * tuned or after a time out. The event status should indicate + * if a valid station is tuned or not. + */ + int (*tune)(const struct radio_tuner *tuner, + unsigned int channel, unsigned int sub_channel); + + /* + * Cancel a scan, step or tune operation. + * Must be called while a scan, step or tune operation is pending + * (callback not yet sent). + * + * returns: + * 0 if successful + * -ENOSYS if called out of sequence + * -ENODEV if another error occurs + * + * The callback is not sent. + */ + int (*cancel)(const struct radio_tuner *tuner); + + /* + * Retrieve current station information. + * + * arguments: + * - info: where to return the program info. + * If info->metadata is NULL. no meta data should be returned. + * If meta data must be returned, they should be added to or cloned to + * info->metadata, not passed from a newly created meta data buffer. + * + * returns: + * 0 if tuned and information available + * -EINVAL if invalid arguments are passed + * -ENODEV if another error occurs + */ + int (*get_program_information)(const struct radio_tuner *tuner, + radio_program_info_t *info); +}; + +struct radio_hw_device { + struct hw_device_t common; + + /* + * Retrieve implementation properties. + * + * arguments: + * - properties: where to return the module properties + * + * returns: + * 0 if no error + * -EINVAL if invalid arguments are passed + */ + int (*get_properties)(const struct radio_hw_device *dev, + radio_hal_properties_t *properties); + + /* + * Open a tuner interface for the requested configuration. + * If no other tuner is opened, this will activate the radio module. + * + * arguments: + * - config: the band configuration to apply + * - audio: this tuner will be used for live radio listening and should be connected to + * the radio audio source. + * - callback: the event callback + * - cookie: the cookie to pass when calling the callback + * - tuner: where to return the tuner interface + * + * returns: + * 0 if HW was powered up and configuration could be applied + * -EINVAL if configuration requested is invalid + * -ENOSYS if called out of sequence + * + * Callback function with event RADIO_EVENT_CONFIG MUST be called once the + * configuration is applied or a failure occurs or after a time out. + */ + int (*open_tuner)(const struct radio_hw_device *dev, + const radio_hal_band_config_t *config, + bool audio, + radio_callback_t callback, + void *cookie, + const struct radio_tuner **tuner); + + /* + * Close a tuner interface. + * If the last tuner is closed, the radio module is deactivated. + * + * arguments: + * - tuner: the tuner interface to close + * + * returns: + * 0 if powered down successfully. + * -EINVAL if an invalid argument is passed + * -ENOSYS if called out of sequence + */ + int (*close_tuner)(const struct radio_hw_device *dev, const struct radio_tuner *tuner); + +}; + +typedef struct radio_hw_device radio_hw_device_t; + +/** convenience API for opening and closing a supported device */ + +static inline int radio_hw_device_open(const struct hw_module_t* module, + struct radio_hw_device** device) +{ + return module->methods->open(module, RADIO_HARDWARE_DEVICE, + (struct hw_device_t**)device); +} + +static inline int radio_hw_device_close(const struct radio_hw_device* device) +{ + return device->common.close((struct hw_device_t *)&device->common); +} + +__END_DECLS + +#endif // ANDROID_RADIO_HAL_H diff --git a/third_party/android_hardware_libhardware/include/hardware/sensors.h b/third_party/android_hardware_libhardware/include/hardware/sensors.h new file mode 100644 index 000000000..51bffe119 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/sensors.h @@ -0,0 +1,1096 @@ +/* + * 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_SENSORS_INTERFACE_H +#define ANDROID_SENSORS_INTERFACE_H + +#include +#include +#include + +#include +#include + +__BEGIN_DECLS + +/*****************************************************************************/ + +#define SENSORS_HEADER_VERSION 1 +#define SENSORS_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) +#define SENSORS_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION_2(0, 1, SENSORS_HEADER_VERSION) +#define SENSORS_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION_2(1, 0, SENSORS_HEADER_VERSION) +#define SENSORS_DEVICE_API_VERSION_1_1 HARDWARE_DEVICE_API_VERSION_2(1, 1, SENSORS_HEADER_VERSION) +#define SENSORS_DEVICE_API_VERSION_1_2 HARDWARE_DEVICE_API_VERSION_2(1, 2, SENSORS_HEADER_VERSION) +#define SENSORS_DEVICE_API_VERSION_1_3 HARDWARE_DEVICE_API_VERSION_2(1, 3, SENSORS_HEADER_VERSION) +#define SENSORS_DEVICE_API_VERSION_1_4 HARDWARE_DEVICE_API_VERSION_2(1, 4, SENSORS_HEADER_VERSION) + +/** + * Please see the Sensors section of source.android.com for an + * introduction to and detailed descriptions of Android sensor types: + * http://source.android.com/devices/sensors/index.html + */ + +/** + * The id of this module + */ +#define SENSORS_HARDWARE_MODULE_ID "sensors" + +/** + * Name of the sensors device to open + */ +#define SENSORS_HARDWARE_POLL "poll" + +/** + * Handles must be higher than SENSORS_HANDLE_BASE and must be unique. + * A Handle identifies a given sensors. The handle is used to activate + * and/or deactivate sensors. + * In this version of the API there can only be 256 handles. + */ +#define SENSORS_HANDLE_BASE 0 +#define SENSORS_HANDLE_BITS 8 +#define SENSORS_HANDLE_COUNT (1< 35 degrees + * + * Large accelerations without a change in phone orientation should not trigger a tilt event. + * For example, a sharp turn or strong acceleration while driving a car should not trigger a tilt + * event, even though the angle of the average acceleration might vary by more than 35 degrees. + * + * Typically, this sensor is implemented with the help of only an accelerometer. Other sensors can + * be used as well if they do not increase the power consumption significantly. This is a low power + * sensor that should allow the AP to go into suspend mode. Do not emulate this sensor in the HAL. + * Like other wake up sensors, the driver is expected to a hold a wake_lock with a timeout of 200 ms + * while reporting this event. The only allowed return value is 1.0. + * + * Implement only the wake-up version of this sensor. + */ +#define SENSOR_TYPE_TILT_DETECTOR (22) +#define SENSOR_STRING_TYPE_TILT_DETECTOR "android.sensor.tilt_detector" + +/* + * SENSOR_TYPE_WAKE_GESTURE + * reporting-mode: one-shot + * + * A sensor enabling waking up the device based on a device specific motion. + * + * When this sensor triggers, the device behaves as if the power button was + * pressed, turning the screen on. This behavior (turning on the screen when + * this sensor triggers) might be deactivated by the user in the device + * settings. Changes in settings do not impact the behavior of the sensor: + * only whether the framework turns the screen on when it triggers. + * + * The actual gesture to be detected is not specified, and can be chosen by + * the manufacturer of the device. + * This sensor must be low power, as it is likely to be activated 24/7. + * The only allowed value to return is 1.0. + * + * Implement only the wake-up version of this sensor. + */ +#define SENSOR_TYPE_WAKE_GESTURE (23) +#define SENSOR_STRING_TYPE_WAKE_GESTURE "android.sensor.wake_gesture" + +/* + * SENSOR_TYPE_GLANCE_GESTURE + * reporting-mode: one-shot + * + * A sensor enabling briefly turning the screen on to enable the user to + * glance content on screen based on a specific motion. The device should + * turn the screen off after a few moments. + * + * When this sensor triggers, the device turns the screen on momentarily + * to allow the user to glance notifications or other content while the + * device remains locked in a non-interactive state (dozing). This behavior + * (briefly turning on the screen when this sensor triggers) might be deactivated + * by the user in the device settings. Changes in settings do not impact the + * behavior of the sensor: only whether the framework briefly turns the screen on + * when it triggers. + * + * The actual gesture to be detected is not specified, and can be chosen by + * the manufacturer of the device. + * This sensor must be low power, as it is likely to be activated 24/7. + * The only allowed value to return is 1.0. + * + * Implement only the wake-up version of this sensor. + */ +#define SENSOR_TYPE_GLANCE_GESTURE (24) +#define SENSOR_STRING_TYPE_GLANCE_GESTURE "android.sensor.glance_gesture" + +/** + * SENSOR_TYPE_PICK_UP_GESTURE + * reporting-mode: one-shot + * + * A sensor of this type triggers when the device is picked up regardless of wherever is was + * before (desk, pocket, bag). The only allowed return value is 1.0. + * This sensor de-activates itself immediately after it triggers. + * + * Implement only the wake-up version of this sensor. + */ +#define SENSOR_TYPE_PICK_UP_GESTURE (25) +#define SENSOR_STRING_TYPE_PICK_UP_GESTURE "android.sensor.pick_up_gesture" + +/* + * SENSOR_TYPE_WRIST_TILT_GESTURE + * trigger-mode: special + * wake-up sensor: yes + * + * A sensor of this type triggers an event each time a tilt of the wrist-worn + * device is detected. + * + * This sensor must be low power, as it is likely to be activated 24/7. + * The only allowed value to return is 1.0. + * + * Implement only the wake-up version of this sensor. + */ +#define SENSOR_TYPE_WRIST_TILT_GESTURE (26) +#define SENSOR_STRING_TYPE_WRIST_TILT_GESTURE "android.sensor.wrist_tilt_gesture" + +/** + * Values returned by the accelerometer in various locations in the universe. + * all values are in SI units (m/s^2) + */ +#define GRAVITY_SUN (275.0f) +#define GRAVITY_EARTH (9.80665f) + +/** Maximum magnetic field on Earth's surface */ +#define MAGNETIC_FIELD_EARTH_MAX (60.0f) + +/** Minimum magnetic field on Earth's surface */ +#define MAGNETIC_FIELD_EARTH_MIN (30.0f) + +/** + * Possible values of the status field of sensor events. + */ +#define SENSOR_STATUS_NO_CONTACT -1 +#define SENSOR_STATUS_UNRELIABLE 0 +#define SENSOR_STATUS_ACCURACY_LOW 1 +#define SENSOR_STATUS_ACCURACY_MEDIUM 2 +#define SENSOR_STATUS_ACCURACY_HIGH 3 + +/** + * sensor event data + */ +typedef struct { + union { + float v[3]; + struct { + float x; + float y; + float z; + }; + struct { + float azimuth; + float pitch; + float roll; + }; + }; + int8_t status; + uint8_t reserved[3]; +} sensors_vec_t; + +/** + * uncalibrated gyroscope and magnetometer event data + */ +typedef struct { + union { + float uncalib[3]; + struct { + float x_uncalib; + float y_uncalib; + float z_uncalib; + }; + }; + union { + float bias[3]; + struct { + float x_bias; + float y_bias; + float z_bias; + }; + }; +} uncalibrated_event_t; + +/** + * Meta data event data + */ +typedef struct meta_data_event { + int32_t what; + int32_t sensor; +} meta_data_event_t; + +/** + * Heart rate event data + */ +typedef struct { + // Heart rate in beats per minute. + // Set to 0 when status is SENSOR_STATUS_UNRELIABLE or ..._NO_CONTACT + float bpm; + // Status of the sensor for this reading. Set to one SENSOR_STATUS_... + // Note that this value should only be set for sensors that explicitly define + // the meaning of this field. This field is not piped through the framework + // for other sensors. + int8_t status; +} heart_rate_event_t; + +/** + * Union of the various types of sensor data + * that can be returned. + */ +typedef struct sensors_event_t { + /* must be sizeof(struct sensors_event_t) */ + int32_t version; + + /* sensor identifier */ + int32_t sensor; + + /* sensor type */ + int32_t type; + + /* reserved */ + int32_t reserved0; + + /* time is in nanosecond */ + int64_t timestamp; + + union { + union { + float data[16]; + + /* acceleration values are in meter per second per second (m/s^2) */ + sensors_vec_t acceleration; + + /* magnetic vector values are in micro-Tesla (uT) */ + sensors_vec_t magnetic; + + /* orientation values are in degrees */ + sensors_vec_t orientation; + + /* gyroscope values are in rad/s */ + sensors_vec_t gyro; + + /* temperature is in degrees centigrade (Celsius) */ + float temperature; + + /* distance in centimeters */ + float distance; + + /* light in SI lux units */ + float light; + + /* pressure in hectopascal (hPa) */ + float pressure; + + /* relative humidity in percent */ + float relative_humidity; + + /* uncalibrated gyroscope values are in rad/s */ + uncalibrated_event_t uncalibrated_gyro; + + /* uncalibrated magnetometer values are in micro-Teslas */ + uncalibrated_event_t uncalibrated_magnetic; + + /* heart rate data containing value in bpm and status */ + heart_rate_event_t heart_rate; + + /* this is a special event. see SENSOR_TYPE_META_DATA above. + * sensors_meta_data_event_t events are all reported with a type of + * SENSOR_TYPE_META_DATA. The handle is ignored and must be zero. + */ + meta_data_event_t meta_data; + }; + + union { + uint64_t data[8]; + + /* step-counter */ + uint64_t step_counter; + } u64; + }; + + /* Reserved flags for internal use. Set to zero. */ + uint32_t flags; + + uint32_t reserved1[3]; +} sensors_event_t; + + +/* see SENSOR_TYPE_META_DATA */ +typedef sensors_event_t sensors_meta_data_event_t; + + +struct sensor_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 sensors_module_t { + struct hw_module_t common; + + /** + * Enumerate all available sensors. The list is returned in "list". + * @return number of sensors in the list + */ + int (*get_sensors_list)(struct sensors_module_t* module, + struct sensor_t const** list); + + /** + * Place the module in a specific mode. The following modes are defined + * + * 0 - Normal operation. Default state of the module. + * 1 - Loopback mode. Data is injected for the the supported + * sensors by the sensor service in this mode. + * @return 0 on success + * -EINVAL if requested mode is not supported + * -EPERM if operation is not allowed + */ + int (*set_operation_mode)(unsigned int mode); +}; + +struct sensor_t { + + /* Name of this sensor. + * All sensors of the same "type" must have a different "name". + */ + const char* name; + + /* vendor of the hardware part */ + const char* vendor; + + /* version of the hardware part + driver. The value of this field + * must increase when the driver is updated in a way that changes the + * output of this sensor. This is important for fused sensors when the + * fusion algorithm is updated. + */ + int version; + + /* handle that identifies this sensors. This handle is used to reference + * this sensor throughout the HAL API. + */ + int handle; + + /* this sensor's type. */ + int type; + + /* maximum range of this sensor's value in SI units */ + float maxRange; + + /* smallest difference between two values reported by this sensor */ + float resolution; + + /* rough estimate of this sensor's power consumption in mA */ + float power; + + /* this value depends on the reporting mode: + * + * continuous: minimum sample period allowed in microseconds + * on-change : 0 + * one-shot :-1 + * special : 0, unless otherwise noted + */ + int32_t minDelay; + + /* number of events reserved for this sensor in the batch mode FIFO. + * If there is a dedicated FIFO for this sensor, then this is the + * size of this FIFO. If the FIFO is shared with other sensors, + * this is the size reserved for that sensor and it can be zero. + */ + uint32_t fifoReservedEventCount; + + /* maximum number of events of this sensor that could be batched. + * This is especially relevant when the FIFO is shared between + * several sensors; this value is then set to the size of that FIFO. + */ + uint32_t fifoMaxEventCount; + + /* type of this sensor as a string. Set to corresponding + * SENSOR_STRING_TYPE_*. + * When defining an OEM specific sensor or sensor manufacturer specific + * sensor, use your reserve domain name as a prefix. + * ex: com.google.glass.onheaddetector + * For sensors of known type, the android framework might overwrite this + * string automatically. + */ + const char* stringType; + + /* permission required to see this sensor, register to it and receive data. + * Set to "" if no permission is required. Some sensor types like the + * heart rate monitor have a mandatory require_permission. + * For sensors that always require a specific permission, like the heart + * rate monitor, the android framework might overwrite this string + * automatically. + */ + const char* requiredPermission; + + /* This value is defined only for continuous mode and on-change sensors. It is the delay between + * two sensor events corresponding to the lowest frequency that this sensor supports. When lower + * frequencies are requested through batch()/setDelay() the events will be generated at this + * frequency instead. It can be used by the framework or applications to estimate when the batch + * FIFO may be full. + * + * NOTE: 1) period_ns is in nanoseconds where as maxDelay/minDelay are in microseconds. + * continuous, on-change: maximum sampling period allowed in microseconds. + * one-shot, special : 0 + * 2) maxDelay should always fit within a 32 bit signed integer. It is declared as 64 bit + * on 64 bit architectures only for binary compatibility reasons. + * Availability: SENSORS_DEVICE_API_VERSION_1_3 + */ + #ifdef __LP64__ + int64_t maxDelay; + #else + int32_t maxDelay; + #endif + + /* Flags for sensor. See SENSOR_FLAG_* above. Only the least significant 32 bits are used here. + * It is declared as 64 bit on 64 bit architectures only for binary compatibility reasons. + * Availability: SENSORS_DEVICE_API_VERSION_1_3 + */ + #ifdef __LP64__ + uint64_t flags; + #else + uint32_t flags; + #endif + + /* reserved fields, must be zero */ + void* reserved[2]; +}; + + +/* + * sensors_poll_device_t is used with SENSORS_DEVICE_API_VERSION_0_1 + * and is present for backward binary and source compatibility. + * See the Sensors HAL interface section for complete descriptions of the + * following functions: + * http://source.android.com/devices/sensors/index.html#hal + */ +struct sensors_poll_device_t { + struct hw_device_t common; + int (*activate)(struct sensors_poll_device_t *dev, + int sensor_handle, int enabled); + int (*setDelay)(struct sensors_poll_device_t *dev, + int sensor_handle, int64_t sampling_period_ns); + int (*poll)(struct sensors_poll_device_t *dev, + sensors_event_t* data, int count); +}; + +/* + * struct sensors_poll_device_1 is used in HAL versions >= SENSORS_DEVICE_API_VERSION_1_0 + */ +typedef struct sensors_poll_device_1 { + union { + /* sensors_poll_device_1 is compatible with sensors_poll_device_t, + * and can be down-cast to it + */ + struct sensors_poll_device_t v0; + + struct { + struct hw_device_t common; + + /* Activate/de-activate one sensor. Return 0 on success, negative + * + * sensor_handle is the handle of the sensor to change. + * enabled set to 1 to enable, or 0 to disable the sensor. + * + * Return 0 on success, negative errno code otherwise. + */ + int (*activate)(struct sensors_poll_device_t *dev, + int sensor_handle, int enabled); + + /** + * Set the events's period in nanoseconds for a given sensor. + * If sampling_period_ns > max_delay it will be truncated to + * max_delay and if sampling_period_ns < min_delay it will be + * replaced by min_delay. + */ + int (*setDelay)(struct sensors_poll_device_t *dev, + int sensor_handle, int64_t sampling_period_ns); + + /** + * Returns an array of sensor data. + */ + int (*poll)(struct sensors_poll_device_t *dev, + sensors_event_t* data, int count); + }; + }; + + + /* + * Sets a sensor’s parameters, including sampling frequency and maximum + * report latency. This function can be called while the sensor is + * activated, in which case it must not cause any sensor measurements to + * be lost: transitioning from one sampling rate to the other cannot cause + * lost events, nor can transitioning from a high maximum report latency to + * a low maximum report latency. + * See the Batching sensor results page for details: + * http://source.android.com/devices/sensors/batching.html + */ + int (*batch)(struct sensors_poll_device_1* dev, + int sensor_handle, int flags, int64_t sampling_period_ns, + int64_t max_report_latency_ns); + + /* + * Flush adds a META_DATA_FLUSH_COMPLETE event (sensors_event_meta_data_t) + * to the end of the "batch mode" FIFO for the specified sensor and flushes + * the FIFO. + * If the FIFO is empty or if the sensor doesn't support batching (FIFO size zero), + * it should return SUCCESS along with a trivial META_DATA_FLUSH_COMPLETE event added to the + * event stream. This applies to all sensors other than one-shot sensors. + * If the sensor is a one-shot sensor, flush must return -EINVAL and not generate + * any flush complete metadata. + * If the sensor is not active at the time flush() is called, flush() should return + * -EINVAL. + */ + int (*flush)(struct sensors_poll_device_1* dev, int sensor_handle); + + /* + * Inject a single sensor sample to be to this device. + * data points to the sensor event to be injected + * @return 0 on success + * -EPERM if operation is not allowed + * -EINVAL if sensor event cannot be injected + */ + int (*inject_sensor_data)(struct sensors_poll_device_1 *dev, const sensors_event_t *data); + + void (*reserved_procs[7])(void); + +} sensors_poll_device_1_t; + + +/** convenience API for opening and closing a device */ + +static inline int sensors_open(const struct hw_module_t* module, + struct sensors_poll_device_t** device) { + return module->methods->open(module, + SENSORS_HARDWARE_POLL, (struct hw_device_t**)device); +} + +static inline int sensors_close(struct sensors_poll_device_t* device) { + return device->common.close(&device->common); +} + +static inline int sensors_open_1(const struct hw_module_t* module, + sensors_poll_device_1_t** device) { + return module->methods->open(module, + SENSORS_HARDWARE_POLL, (struct hw_device_t**)device); +} + +static inline int sensors_close_1(sensors_poll_device_1_t* device) { + return device->common.close(&device->common); +} + +__END_DECLS + +#endif // ANDROID_SENSORS_INTERFACE_H diff --git a/third_party/android_hardware_libhardware/include/hardware/sound_trigger.h b/third_party/android_hardware_libhardware/include/hardware/sound_trigger.h new file mode 100644 index 000000000..2a8db87ca --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/sound_trigger.h @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2014 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 +#include +#include + +#ifndef ANDROID_SOUND_TRIGGER_HAL_H +#define ANDROID_SOUND_TRIGGER_HAL_H + + +__BEGIN_DECLS + +/** + * The id of this module + */ +#define SOUND_TRIGGER_HARDWARE_MODULE_ID "sound_trigger" + +/** + * Name of the audio devices to open + */ +#define SOUND_TRIGGER_HARDWARE_INTERFACE "sound_trigger_hw_if" + +#define SOUND_TRIGGER_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) +#define SOUND_TRIGGER_MODULE_API_VERSION_CURRENT SOUND_TRIGGER_MODULE_API_VERSION_1_0 + + +#define SOUND_TRIGGER_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) +#define SOUND_TRIGGER_DEVICE_API_VERSION_CURRENT SOUND_TRIGGER_DEVICE_API_VERSION_1_0 + +/** + * List of known sound trigger HAL modules. This is the base name of the sound_trigger HAL + * library composed of the "sound_trigger." prefix, one of the base names below and + * a suffix specific to the device. + * e.g: sondtrigger.primary.goldfish.so or sound_trigger.primary.default.so + */ + +#define SOUND_TRIGGER_HARDWARE_MODULE_ID_PRIMARY "primary" + + +/** + * 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 sound_trigger_module { + struct hw_module_t common; +}; + +typedef void (*recognition_callback_t)(struct sound_trigger_recognition_event *event, void *cookie); +typedef void (*sound_model_callback_t)(struct sound_trigger_model_event *event, void *cookie); + +struct sound_trigger_hw_device { + struct hw_device_t common; + + /* + * Retrieve implementation properties. + */ + int (*get_properties)(const struct sound_trigger_hw_device *dev, + struct sound_trigger_properties *properties); + + /* + * Load a sound model. Once loaded, recognition of this model can be started and stopped. + * Only one active recognition per model at a time. The SoundTrigger service will handle + * concurrent recognition requests by different users/applications on the same model. + * The implementation returns a unique handle used by other functions (unload_sound_model(), + * start_recognition(), etc... + */ + int (*load_sound_model)(const struct sound_trigger_hw_device *dev, + struct sound_trigger_sound_model *sound_model, + sound_model_callback_t callback, + void *cookie, + sound_model_handle_t *handle); + + /* + * Unload a sound model. A sound model can be unloaded to make room for a new one to overcome + * implementation limitations. + */ + int (*unload_sound_model)(const struct sound_trigger_hw_device *dev, + sound_model_handle_t handle); + + /* Start recognition on a given model. Only one recognition active at a time per model. + * Once recognition succeeds of fails, the callback is called. + * TODO: group recognition configuration parameters into one struct and add key phrase options. + */ + int (*start_recognition)(const struct sound_trigger_hw_device *dev, + sound_model_handle_t sound_model_handle, + const struct sound_trigger_recognition_config *config, + recognition_callback_t callback, + void *cookie); + + /* Stop recognition on a given model. + * The implementation does not have to call the callback when stopped via this method. + */ + int (*stop_recognition)(const struct sound_trigger_hw_device *dev, + sound_model_handle_t sound_model_handle); +}; + +typedef struct sound_trigger_hw_device sound_trigger_hw_device_t; + +/** convenience API for opening and closing a supported device */ + +static inline int sound_trigger_hw_device_open(const struct hw_module_t* module, + struct sound_trigger_hw_device** device) +{ + return module->methods->open(module, SOUND_TRIGGER_HARDWARE_INTERFACE, + (struct hw_device_t**)device); +} + +static inline int sound_trigger_hw_device_close(struct sound_trigger_hw_device* device) +{ + return device->common.close(&device->common); +} + +__END_DECLS + +#endif // ANDROID_SOUND_TRIGGER_HAL_H diff --git a/third_party/android_hardware_libhardware/include/hardware/tv_input.h b/third_party/android_hardware_libhardware/include/hardware/tv_input.h new file mode 100644 index 000000000..456b06e1f --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/tv_input.h @@ -0,0 +1,408 @@ +/* + * Copyright 2014 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_TV_INPUT_INTERFACE_H +#define ANDROID_TV_INPUT_INTERFACE_H + +#include +#include +#include + +#include +#include +#include + +__BEGIN_DECLS + +/* + * Module versioning information for the TV input hardware module, based on + * tv_input_module_t.common.module_api_version. + * + * Version History: + * + * TV_INPUT_MODULE_API_VERSION_0_1: + * Initial TV input hardware module API. + * + */ + +#define TV_INPUT_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) + +#define TV_INPUT_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION(0, 1) + +/* + * The id of this module + */ +#define TV_INPUT_HARDWARE_MODULE_ID "tv_input" + +#define TV_INPUT_DEFAULT_DEVICE "default" + +/*****************************************************************************/ + +/* + * 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 tv_input_module { + struct hw_module_t common; +} tv_input_module_t; + +/*****************************************************************************/ + +enum { + /* Generic hardware. */ + TV_INPUT_TYPE_OTHER_HARDWARE = 1, + /* Tuner. (e.g. built-in terrestrial tuner) */ + TV_INPUT_TYPE_TUNER = 2, + TV_INPUT_TYPE_COMPOSITE = 3, + TV_INPUT_TYPE_SVIDEO = 4, + TV_INPUT_TYPE_SCART = 5, + TV_INPUT_TYPE_COMPONENT = 6, + TV_INPUT_TYPE_VGA = 7, + TV_INPUT_TYPE_DVI = 8, + /* Physical HDMI port. (e.g. HDMI 1) */ + TV_INPUT_TYPE_HDMI = 9, + TV_INPUT_TYPE_DISPLAY_PORT = 10, +}; +typedef uint32_t tv_input_type_t; + +typedef struct tv_input_device_info { + /* Device ID */ + int device_id; + + /* Type of physical TV input. */ + tv_input_type_t type; + + union { + struct { + /* HDMI port ID number */ + uint32_t port_id; + } hdmi; + + /* TODO: add other type specific information. */ + + int32_t type_info_reserved[16]; + }; + + /* TODO: Add capability if necessary. */ + + /* + * Audio info + * + * audio_type == AUDIO_DEVICE_NONE if this input has no audio. + */ + audio_devices_t audio_type; + const char* audio_address; + + int32_t reserved[16]; +} tv_input_device_info_t; + +/* See tv_input_event_t for more details. */ +enum { + /* + * Hardware notifies the framework that a device is available. + * + * Note that DEVICE_AVAILABLE and DEVICE_UNAVAILABLE events do not represent + * hotplug events (i.e. plugging cable into or out of the physical port). + * These events notify the framework whether the port is available or not. + * For a concrete example, when a user plugs in or pulls out the HDMI cable + * from a HDMI port, it does not generate DEVICE_AVAILABLE and/or + * DEVICE_UNAVAILABLE events. However, if a user inserts a pluggable USB + * tuner into the Android device, it will generate a DEVICE_AVAILABLE event + * and when the port is removed, it should generate a DEVICE_UNAVAILABLE + * event. + * + * For hotplug events, please see STREAM_CONFIGURATION_CHANGED for more + * details. + * + * HAL implementation should register devices by using this event when the + * device boots up. The framework will recognize device reported via this + * event only. In addition, the implementation could use this event to + * notify the framework that a removable TV input device (such as USB tuner + * as stated in the example above) is attached. + */ + TV_INPUT_EVENT_DEVICE_AVAILABLE = 1, + /* + * Hardware notifies the framework that a device is unavailable. + * + * HAL implementation should generate this event when a device registered + * by TV_INPUT_EVENT_DEVICE_AVAILABLE is no longer available. For example, + * the event can indicate that a USB tuner is plugged out from the Android + * device. + * + * Note that this event is not for indicating cable plugged out of the port; + * for that purpose, the implementation should use + * STREAM_CONFIGURATION_CHANGED event. This event represents the port itself + * being no longer available. + */ + TV_INPUT_EVENT_DEVICE_UNAVAILABLE = 2, + /* + * Stream configurations are changed. Client should regard all open streams + * at the specific device are closed, and should call + * get_stream_configurations() again, opening some of them if necessary. + * + * HAL implementation should generate this event when the available stream + * configurations change for any reason. A typical use case of this event + * would be to notify the framework that the input signal has changed + * resolution, or that the cable is plugged out so that the number of + * available streams is 0. + * + * The implementation may use this event to indicate hotplug status of the + * port. the framework regards input devices with no available streams as + * disconnected, so the implementation can generate this event with no + * available streams to indicate that this device is disconnected, and vice + * versa. + */ + TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED = 3, + /* + * Hardware is done with capture request with the buffer. Client can assume + * ownership of the buffer again. + * + * HAL implementation should generate this event after request_capture() if + * it succeeded. The event shall have the buffer with the captured image. + */ + TV_INPUT_EVENT_CAPTURE_SUCCEEDED = 4, + /* + * Hardware met a failure while processing a capture request or client + * canceled the request. Client can assume ownership of the buffer again. + * + * The event is similar to TV_INPUT_EVENT_CAPTURE_SUCCEEDED, but HAL + * implementation generates this event upon a failure to process + * request_capture(), or a request cancellation. + */ + TV_INPUT_EVENT_CAPTURE_FAILED = 5, +}; +typedef uint32_t tv_input_event_type_t; + +typedef struct tv_input_capture_result { + /* Device ID */ + int device_id; + + /* Stream ID */ + int stream_id; + + /* Sequence number of the request */ + uint32_t seq; + + /* + * The buffer passed to hardware in request_capture(). The content of + * buffer is undefined (although buffer itself is valid) for + * TV_INPUT_CAPTURE_FAILED event. + */ + buffer_handle_t buffer; + + /* + * Error code for the request. -ECANCELED if request is cancelled; other + * error codes are unknown errors. + */ + int error_code; +} tv_input_capture_result_t; + +typedef struct tv_input_event { + tv_input_event_type_t type; + + union { + /* + * TV_INPUT_EVENT_DEVICE_AVAILABLE: all fields are relevant + * TV_INPUT_EVENT_DEVICE_UNAVAILABLE: only device_id is relevant + * TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED: only device_id is + * relevant + */ + tv_input_device_info_t device_info; + /* + * TV_INPUT_EVENT_CAPTURE_SUCCEEDED: error_code is not relevant + * TV_INPUT_EVENT_CAPTURE_FAILED: all fields are relevant + */ + tv_input_capture_result_t capture_result; + }; +} tv_input_event_t; + +typedef struct tv_input_callback_ops { + /* + * event contains the type of the event and additional data if necessary. + * The event object is guaranteed to be valid only for the duration of the + * call. + * + * data is an object supplied at device initialization, opaque to the + * hardware. +     */ + void (*notify)(struct tv_input_device* dev, + tv_input_event_t* event, void* data); +} tv_input_callback_ops_t; + +enum { + TV_STREAM_TYPE_INDEPENDENT_VIDEO_SOURCE = 1, + TV_STREAM_TYPE_BUFFER_PRODUCER = 2, +}; +typedef uint32_t tv_stream_type_t; + +typedef struct tv_stream_config { + /* + * ID number of the stream. This value is used to identify the whole stream + * configuration. + */ + int stream_id; + + /* Type of the stream */ + tv_stream_type_t type; + + /* Max width/height of the stream. */ + uint32_t max_video_width; + uint32_t max_video_height; +} tv_stream_config_t; + +typedef struct buffer_producer_stream { + /* + * IN/OUT: Width / height of the stream. Client may request for specific + * size but hardware may change it. Client must allocate buffers with + * specified width and height. + */ + uint32_t width; + uint32_t height; + + /* OUT: Client must set this usage when allocating buffer. */ + uint32_t usage; + + /* OUT: Client must allocate a buffer with this format. */ + uint32_t format; + + /* OUT: Client must allocate buffers based on this count. */ + uint32_t buffer_count; +} buffer_producer_stream_t; + +typedef struct tv_stream { + /* IN: ID in the stream configuration */ + int stream_id; + + /* OUT: Type of the stream (for convenience) */ + tv_stream_type_t type; + + /* Data associated with the stream for client's use */ + union { + /* OUT: A native handle describing the sideband stream source */ + native_handle_t* sideband_stream_source_handle; + + /* IN/OUT: Details are in buffer_producer_stream_t */ + buffer_producer_stream_t buffer_producer; + }; +} tv_stream_t; + +/* + * Every device data structure must begin with hw_device_t + * followed by module specific public methods and attributes. + */ +typedef struct tv_input_device { + struct hw_device_t common; + + /* + * initialize: + * + * Provide callbacks to the device and start operation. At first, no device + * is available and after initialize() completes, currently available + * devices including static devices should notify via callback. + * + * Framework owns callbacks object. + * + * data is a framework-owned object which would be sent back to the + * framework for each callback notifications. + * + * Return 0 on success. + */ + int (*initialize)(struct tv_input_device* dev, + const tv_input_callback_ops_t* callback, void* data); + + /* + * get_stream_configurations: + * + * Get stream configurations for a specific device. An input device may have + * multiple configurations. + * + * The configs object is guaranteed to be valid only until the next call to + * get_stream_configurations() or STREAM_CONFIGURATIONS_CHANGED event. + * + * Return 0 on success. + */ + int (*get_stream_configurations)(const struct tv_input_device* dev, + int device_id, int* num_configurations, + const tv_stream_config_t** configs); + + /* + * open_stream: + * + * Open a stream with given stream ID. Caller owns stream object, and the + * populated data is only valid until the stream is closed. + * + * Return 0 on success; -EBUSY if the client should close other streams to + * open the stream; -EEXIST if the stream with the given ID is already open; + * -EINVAL if device_id and/or stream_id are invalid; other non-zero value + * denotes unknown error. + */ + int (*open_stream)(struct tv_input_device* dev, int device_id, + tv_stream_t* stream); + + /* + * close_stream: + * + * Close a stream to a device. data in tv_stream_t* object associated with + * the stream_id is obsolete once this call finishes. + * + * Return 0 on success; -ENOENT if the stream is not open; -EINVAL if + * device_id and/or stream_id are invalid. + */ + int (*close_stream)(struct tv_input_device* dev, int device_id, + int stream_id); + + /* + * request_capture: + * + * Request buffer capture for a stream. This is only valid for buffer + * producer streams. The buffer should be created with size, format and + * usage specified in the stream. Framework provides seq in an + * increasing sequence per each stream. Hardware should provide the picture + * in a chronological order according to seq. For example, if two + * requests are being processed at the same time, the request with the + * smaller seq should get an earlier frame. + * + * The framework releases the ownership of the buffer upon calling this + * function. When the buffer is filled, hardware notifies the framework + * via TV_INPUT_EVENT_CAPTURE_FINISHED callback, and the ownership is + * transferred back to framework at that time. + * + * Return 0 on success; -ENOENT if the stream is not open; -EINVAL if + * device_id and/or stream_id are invalid; -EWOULDBLOCK if HAL cannot take + * additional requests until it releases a buffer. + */ + int (*request_capture)(struct tv_input_device* dev, int device_id, + int stream_id, buffer_handle_t buffer, uint32_t seq); + + /* + * cancel_capture: + * + * Cancel an ongoing capture. Hardware should release the buffer as soon as + * possible via TV_INPUT_EVENT_CAPTURE_FAILED callback. + * + * Return 0 on success; -ENOENT if the stream is not open; -EINVAL if + * device_id, stream_id, and/or seq are invalid. + */ + int (*cancel_capture)(struct tv_input_device* dev, int device_id, + int stream_id, uint32_t seq); + + void* reserved[16]; +} tv_input_device_t; + +__END_DECLS + +#endif // ANDROID_TV_INPUT_INTERFACE_H diff --git a/third_party/android_hardware_libhardware/include/hardware/vibrator.h b/third_party/android_hardware_libhardware/include/hardware/vibrator.h new file mode 100644 index 000000000..92b1fd005 --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/vibrator.h @@ -0,0 +1,74 @@ +/* + * 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 _HARDWARE_VIBRATOR_H +#define _HARDWARE_VIBRATOR_H + +#include + +__BEGIN_DECLS + +#define VIBRATOR_API_VERSION HARDWARE_MODULE_API_VERSION(1,0) + +/** + * The id of this module + */ +#define VIBRATOR_HARDWARE_MODULE_ID "vibrator" + +/** + * The id of the main vibrator device + */ +#define VIBRATOR_DEVICE_ID_MAIN "main_vibrator" + +struct vibrator_device; +typedef struct vibrator_device { + /** + * Common methods of the vibrator device. This *must* be the first member of + * vibrator_device as users of this structure will cast a hw_device_t to + * vibrator_device pointer in contexts where it's known the hw_device_t references a + * vibrator_device. + */ + struct hw_device_t common; + + /** Turn on vibrator + * + * What happens when this function is called while the the timeout of a + * previous call has not expired is implementation dependent. + * + * @param timeout_ms number of milliseconds to vibrate + * + * @return 0 in case of success, negative errno code else + */ + int (*vibrator_on)(struct vibrator_device* vibradev, unsigned int timeout_ms); + + /** Turn off vibrator + * + * It is not guaranteed that the vibrator will be immediately stopped: the + * behaviour is implementation dependent. + * + * @return 0 in case of success, negative errno code else + */ + int (*vibrator_off)(struct vibrator_device* vibradev); +} vibrator_device_t; + +static inline int vibrator_open(const struct hw_module_t* module, vibrator_device_t** device) +{ + return module->methods->open(module, VIBRATOR_DEVICE_ID_MAIN, (struct hw_device_t**)device); +} + +__END_DECLS + +#endif // _HARDWARE_VIBRATOR_H diff --git a/third_party/android_hardware_libhardware/include/hardware/wipower.h b/third_party/android_hardware_libhardware/include/hardware/wipower.h new file mode 100644 index 000000000..eb3a0ee0d --- /dev/null +++ b/third_party/android_hardware_libhardware/include/hardware/wipower.h @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ANDROID_INCLUDE_WIPOWER_H +#define ANDROID_INCLUDE_WIPOWER_H + +#include +#include +#include +#include + +#include +#include + +__BEGIN_DECLS + +typedef enum { + OFF =0, + ON +} wipower_state_t; + + +typedef struct { + +unsigned char optional; +unsigned short rect_voltage; +unsigned short rect_current; +unsigned short out_voltage; +unsigned short out_current; +unsigned char temp; +unsigned short rect_voltage_min; +unsigned short rect_voltage_set; +unsigned short rect_voltage_max; +unsigned char alert; +unsigned short rfu1; +unsigned char rfu2; + +}__attribute__((packed)) wipower_dyn_data_t; + +/** Bluetooth Enable/Disable Callback. */ +typedef void (*wipower_state_changed_callback)(wipower_state_t state); + + +typedef void (*wipower_alerts)(unsigned char alert); + + +typedef void (*wipower_dynamic_data)(wipower_dyn_data_t* alert_data); + + +typedef void (*wipower_power_apply)(unsigned char power_flag); + +typedef void (*callback_thread_event)(bt_cb_thread_evt evt); + +/** Bluetooth DM callback structure. */ +typedef struct { + /** set to sizeof(wipower_callbacks_t) */ + size_t size; + wipower_state_changed_callback wipower_state_changed_cb; + wipower_alerts wipower_alert; + wipower_dynamic_data wipower_data; + wipower_power_apply wipower_power_event; + callback_thread_event callback_thread_event; +} wipower_callbacks_t; + + +/** Represents the standard Wipower interface. */ +typedef struct { + /** set to sizeof(wipower_interface_t) */ + size_t size; + + /** Initialize Wipower modules*/ + int (*init)(wipower_callbacks_t *wp_callbacks); + + /** Enable/Disable Wipower charging */ + int (*enable)(bool enable); + + int (*set_current_limit)(short value); + + unsigned char (*get_current_limit)(void); + + wipower_state_t (*get_state)(void); + + /** Enable/Disable Wipower charging */ + int (*enable_alerts)(bool enable); + + int (*enable_data_notify)(bool enable); + int (*enable_power_apply)(bool enable, bool on, bool time_flag); +} wipower_interface_t; + + +__END_DECLS + +#endif /* ANDROID_INCLUDE_WIPOWER_H */ diff --git a/third_party/android_system_core/include/cutils/android_reboot.h b/third_party/android_system_core/include/cutils/android_reboot.h new file mode 100644 index 000000000..a3861a02d --- /dev/null +++ b/third_party/android_system_core/include/cutils/android_reboot.h @@ -0,0 +1,39 @@ +/* + * Copyright 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 __CUTILS_ANDROID_REBOOT_H__ +#define __CUTILS_ANDROID_REBOOT_H__ + +#include + +__BEGIN_DECLS + +/* Commands */ +#define ANDROID_RB_RESTART 0xDEAD0001 +#define ANDROID_RB_POWEROFF 0xDEAD0002 +#define ANDROID_RB_RESTART2 0xDEAD0003 + +/* Properties */ +#define ANDROID_RB_PROPERTY "sys.powerctl" + +int android_reboot(int cmd, int flags, const char *arg); +int android_reboot_with_callback( + int cmd, int flags, const char *arg, + void (*cb_on_remount)(const struct mntent*)); + +__END_DECLS + +#endif /* __CUTILS_ANDROID_REBOOT_H__ */ diff --git a/third_party/android_system_core/include/cutils/aref.h b/third_party/android_system_core/include/cutils/aref.h new file mode 100644 index 000000000..3bd36ea04 --- /dev/null +++ b/third_party/android_system_core/include/cutils/aref.h @@ -0,0 +1,58 @@ +/* + * 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 _CUTILS_AREF_H_ +#define _CUTILS_AREF_H_ + +#include +#include + +#include + +__BEGIN_DECLS + +#define AREF_TO_ITEM(aref, container, member) \ + (container *) (((char*) (aref)) - offsetof(container, member)) + +struct aref +{ + volatile int32_t count; +}; + +static inline void aref_init(struct aref *r) +{ + r->count = 1; +} + +static inline int32_t aref_count(struct aref *r) +{ + return r->count; +} + +static inline void aref_get(struct aref *r) +{ + android_atomic_inc(&r->count); +} + +static inline void aref_put(struct aref *r, void (*release)(struct aref *)) +{ + if (android_atomic_dec(&r->count) == 1) + release(r); +} + +__END_DECLS + +#endif // _CUTILS_AREF_H_ diff --git a/third_party/android_system_core/include/cutils/ashmem.h b/third_party/android_system_core/include/cutils/ashmem.h new file mode 100644 index 000000000..25b233e6a --- /dev/null +++ b/third_party/android_system_core/include/cutils/ashmem.h @@ -0,0 +1,45 @@ +/* cutils/ashmem.h + ** + ** Copyright 2008 The Android Open Source Project + ** + ** This file is dual licensed. It may be redistributed and/or modified + ** under the terms of the Apache 2.0 License OR version 2 of the GNU + ** General Public License. + */ + +#ifndef _CUTILS_ASHMEM_H +#define _CUTILS_ASHMEM_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +int ashmem_create_region(const char *name, size_t size); +int ashmem_set_prot_region(int fd, int prot); +int ashmem_pin_region(int fd, size_t offset, size_t len); +int ashmem_unpin_region(int fd, size_t offset, size_t len); +int ashmem_get_size_region(int fd); + +#ifdef __cplusplus +} +#endif + +#ifndef __ASHMEMIOC /* in case someone included too */ + +#define ASHMEM_NAME_LEN 256 + +#define ASHMEM_NAME_DEF "dev/ashmem" + +/* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ +#define ASHMEM_NOT_PURGED 0 +#define ASHMEM_WAS_PURGED 1 + +/* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ +#define ASHMEM_IS_UNPINNED 0 +#define ASHMEM_IS_PINNED 1 + +#endif /* ! __ASHMEMIOC */ + +#endif /* _CUTILS_ASHMEM_H */ diff --git a/third_party/android_system_core/include/cutils/atomic.h b/third_party/android_system_core/include/cutils/atomic.h new file mode 100644 index 000000000..ded972acb --- /dev/null +++ b/third_party/android_system_core/include/cutils/atomic.h @@ -0,0 +1,237 @@ +/* + * Copyright (C) 2007 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_CUTILS_ATOMIC_H +#define ANDROID_CUTILS_ATOMIC_H + +#include +#include +#include + +#ifndef ANDROID_ATOMIC_INLINE +#define ANDROID_ATOMIC_INLINE static inline +#endif + +/* + * A handful of basic atomic operations. + * THESE ARE HERE FOR LEGACY REASONS ONLY. AVOID. + * + * PREFERRED ALTERNATIVES: + * - Use C++/C/pthread locks/mutexes whenever there is not a + * convincing reason to do otherwise. Note that very clever and + * complicated, but correct, lock-free code is often slower than + * using locks, especially where nontrivial data structures + * are involved. + * - C11 stdatomic.h. + * - Where supported, C++11 std::atomic . + * + * PLEASE STOP READING HERE UNLESS YOU ARE TRYING TO UNDERSTAND + * OR UPDATE OLD CODE. + * + * The "acquire" and "release" terms can be defined intuitively in terms + * of the placement of memory barriers in a simple lock implementation: + * - wait until compare-and-swap(lock-is-free --> lock-is-held) succeeds + * - barrier + * - [do work] + * - barrier + * - store(lock-is-free) + * In very crude terms, the initial (acquire) barrier prevents any of the + * "work" from happening before the lock is held, and the later (release) + * barrier ensures that all of the work happens before the lock is released. + * (Think of cached writes, cache read-ahead, and instruction reordering + * around the CAS and store instructions.) + * + * The barriers must apply to both the compiler and the CPU. Note it is + * legal for instructions that occur before an "acquire" barrier to be + * moved down below it, and for instructions that occur after a "release" + * barrier to be moved up above it. + * + * The ARM-driven implementation we use here is short on subtlety, + * and actually requests a full barrier from the compiler and the CPU. + * The only difference between acquire and release is in whether they + * are issued before or after the atomic operation with which they + * are associated. To ease the transition to C/C++ atomic intrinsics, + * you should not rely on this, and instead assume that only the minimal + * acquire/release protection is provided. + * + * NOTE: all int32_t* values are expected to be aligned on 32-bit boundaries. + * If they are not, atomicity is not guaranteed. + */ + +/* + * Basic arithmetic and bitwise operations. These all provide a + * barrier with "release" ordering, and return the previous value. + * + * These have the same characteristics (e.g. what happens on overflow) + * as the equivalent non-atomic C operations. + */ +ANDROID_ATOMIC_INLINE +int32_t android_atomic_inc(volatile int32_t* addr) +{ + volatile atomic_int_least32_t* a = (volatile atomic_int_least32_t*)addr; + /* Int32_t, if it exists, is the same as int_least32_t. */ + return atomic_fetch_add_explicit(a, 1, memory_order_release); +} + +ANDROID_ATOMIC_INLINE +int32_t android_atomic_dec(volatile int32_t* addr) +{ + volatile atomic_int_least32_t* a = (volatile atomic_int_least32_t*)addr; + return atomic_fetch_sub_explicit(a, 1, memory_order_release); +} + +ANDROID_ATOMIC_INLINE +int32_t android_atomic_add(int32_t value, volatile int32_t* addr) +{ + volatile atomic_int_least32_t* a = (volatile atomic_int_least32_t*)addr; + return atomic_fetch_add_explicit(a, value, memory_order_release); +} + +ANDROID_ATOMIC_INLINE +int32_t android_atomic_and(int32_t value, volatile int32_t* addr) +{ + volatile atomic_int_least32_t* a = (volatile atomic_int_least32_t*)addr; + return atomic_fetch_and_explicit(a, value, memory_order_release); +} + +ANDROID_ATOMIC_INLINE +int32_t android_atomic_or(int32_t value, volatile int32_t* addr) +{ + volatile atomic_int_least32_t* a = (volatile atomic_int_least32_t*)addr; + return atomic_fetch_or_explicit(a, value, memory_order_release); +} + +/* + * Perform an atomic load with "acquire" or "release" ordering. + * + * Note that the notion of a "release" ordering for a load does not + * really fit into the C11 or C++11 memory model. The extra ordering + * is normally observable only by code using memory_order_relaxed + * atomics, or data races. In the rare cases in which such ordering + * is called for, use memory_order_relaxed atomics and a leading + * atomic_thread_fence (typically with memory_order_acquire, + * not memory_order_release!) instead. If you do not understand + * this comment, you are in the vast majority, and should not be + * using release loads or replacing them with anything other than + * locks or default sequentially consistent atomics. + */ +ANDROID_ATOMIC_INLINE +int32_t android_atomic_acquire_load(volatile const int32_t* addr) +{ + volatile atomic_int_least32_t* a = (volatile atomic_int_least32_t*)addr; + return atomic_load_explicit(a, memory_order_acquire); +} + +ANDROID_ATOMIC_INLINE +int32_t android_atomic_release_load(volatile const int32_t* addr) +{ + volatile atomic_int_least32_t* a = (volatile atomic_int_least32_t*)addr; + atomic_thread_fence(memory_order_seq_cst); + /* Any reasonable clients of this interface would probably prefer */ + /* something weaker. But some remaining clients seem to be */ + /* abusing this API in strange ways, e.g. by using it as a fence. */ + /* Thus we are conservative until we can get rid of remaining */ + /* clients (and this function). */ + return atomic_load_explicit(a, memory_order_relaxed); +} + +/* + * Perform an atomic store with "acquire" or "release" ordering. + * + * Note that the notion of an "acquire" ordering for a store does not + * really fit into the C11 or C++11 memory model. The extra ordering + * is normally observable only by code using memory_order_relaxed + * atomics, or data races. In the rare cases in which such ordering + * is called for, use memory_order_relaxed atomics and a trailing + * atomic_thread_fence (typically with memory_order_release, + * not memory_order_acquire!) instead. + */ +ANDROID_ATOMIC_INLINE +void android_atomic_acquire_store(int32_t value, volatile int32_t* addr) +{ + volatile atomic_int_least32_t* a = (volatile atomic_int_least32_t*)addr; + atomic_store_explicit(a, value, memory_order_relaxed); + atomic_thread_fence(memory_order_seq_cst); + /* Again overly conservative to accomodate weird clients. */ +} + +ANDROID_ATOMIC_INLINE +void android_atomic_release_store(int32_t value, volatile int32_t* addr) +{ + volatile atomic_int_least32_t* a = (volatile atomic_int_least32_t*)addr; + atomic_store_explicit(a, value, memory_order_release); +} + +/* + * Compare-and-set operation with "acquire" or "release" ordering. + * + * This returns zero if the new value was successfully stored, which will + * only happen when *addr == oldvalue. + * + * (The return value is inverted from implementations on other platforms, + * but matches the ARM ldrex/strex result.) + * + * Implementations that use the release CAS in a loop may be less efficient + * than possible, because we re-issue the memory barrier on each iteration. + */ +ANDROID_ATOMIC_INLINE +int android_atomic_acquire_cas(int32_t oldvalue, int32_t newvalue, + volatile int32_t* addr) +{ + volatile atomic_int_least32_t* a = (volatile atomic_int_least32_t*)addr; + return (int)(!atomic_compare_exchange_strong_explicit( + a, &oldvalue, newvalue, + memory_order_acquire, + memory_order_acquire)); +} + +ANDROID_ATOMIC_INLINE +int android_atomic_release_cas(int32_t oldvalue, int32_t newvalue, + volatile int32_t* addr) +{ + volatile atomic_int_least32_t* a = (volatile atomic_int_least32_t*)addr; + return (int)(!atomic_compare_exchange_strong_explicit( + a, &oldvalue, newvalue, + memory_order_release, + memory_order_relaxed)); +} + +/* + * Fence primitives. + */ +ANDROID_ATOMIC_INLINE +void android_compiler_barrier(void) +{ + __asm__ __volatile__ ("" : : : "memory"); + /* Could probably also be: */ + /* atomic_signal_fence(memory_order_seq_cst); */ +} + +ANDROID_ATOMIC_INLINE +void android_memory_barrier(void) +{ + atomic_thread_fence(memory_order_seq_cst); +} + +/* + * Aliases for code using an older version of this header. These are now + * deprecated and should not be used. The definitions will be removed + * in a future release. + */ +#define android_atomic_write android_atomic_release_store +#define android_atomic_cmpxchg android_atomic_release_cas + +#endif // ANDROID_CUTILS_ATOMIC_H diff --git a/third_party/android_system_core/include/cutils/bitops.h b/third_party/android_system_core/include/cutils/bitops.h new file mode 100644 index 000000000..045830d90 --- /dev/null +++ b/third_party/android_system_core/include/cutils/bitops.h @@ -0,0 +1,120 @@ +/* + * 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 __CUTILS_BITOPS_H +#define __CUTILS_BITOPS_H + +#include +#include +#include +#include + +__BEGIN_DECLS + +/* + * Bitmask Operations + * + * Note this doesn't provide any locking/exclusion, and isn't atomic. + * Additionally no bounds checking is done on the bitmask array. + * + * Example: + * + * int num_resources; + * unsigned int resource_bits[BITS_TO_WORDS(num_resources)]; + * bitmask_init(resource_bits, num_resources); + * ... + * int bit = bitmask_ffz(resource_bits, num_resources); + * bitmask_set(resource_bits, bit); + * ... + * if (bitmask_test(resource_bits, bit)) { ... } + * ... + * bitmask_clear(resource_bits, bit); + * + */ + +#define BITS_PER_WORD (sizeof(unsigned int) * 8) +#define BITS_TO_WORDS(x) (((x) + BITS_PER_WORD - 1) / BITS_PER_WORD) +#define BIT_IN_WORD(x) ((x) % BITS_PER_WORD) +#define BIT_WORD(x) ((x) / BITS_PER_WORD) +#define BIT_MASK(x) (1 << BIT_IN_WORD(x)) + +static inline void bitmask_init(unsigned int *bitmask, int num_bits) +{ + memset(bitmask, 0, BITS_TO_WORDS(num_bits)*sizeof(unsigned int)); +} + +static inline int bitmask_ffz(unsigned int *bitmask, int num_bits) +{ + int bit, result; + size_t i; + + for (i = 0; i < BITS_TO_WORDS(num_bits); i++) { + bit = ffs(~bitmask[i]); + if (bit) { + // ffs is 1-indexed, return 0-indexed result + bit--; + result = BITS_PER_WORD * i + bit; + if (result >= num_bits) + return -1; + return result; + } + } + return -1; +} + +static inline int bitmask_weight(unsigned int *bitmask, int num_bits) +{ + size_t i; + int weight = 0; + + for (i = 0; i < BITS_TO_WORDS(num_bits); i++) + weight += __builtin_popcount(bitmask[i]); + return weight; +} + +static inline void bitmask_set(unsigned int *bitmask, int bit) +{ + bitmask[BIT_WORD(bit)] |= BIT_MASK(bit); +} + +static inline void bitmask_clear(unsigned int *bitmask, int bit) +{ + bitmask[BIT_WORD(bit)] &= ~BIT_MASK(bit); +} + +static inline bool bitmask_test(unsigned int *bitmask, int bit) +{ + return bitmask[BIT_WORD(bit)] & BIT_MASK(bit); +} + +static inline int popcount(unsigned int x) +{ + return __builtin_popcount(x); +} + +static inline int popcountl(unsigned long x) +{ + return __builtin_popcountl(x); +} + +static inline int popcountll(unsigned long long x) +{ + return __builtin_popcountll(x); +} + +__END_DECLS + +#endif /* __CUTILS_BITOPS_H */ diff --git a/third_party/android_system_core/include/cutils/compiler.h b/third_party/android_system_core/include/cutils/compiler.h new file mode 100644 index 000000000..70f884a1e --- /dev/null +++ b/third_party/android_system_core/include/cutils/compiler.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2009 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_CUTILS_COMPILER_H +#define ANDROID_CUTILS_COMPILER_H + +/* + * helps the compiler's optimizer predicting branches + */ + +#ifdef __cplusplus +# define CC_LIKELY( exp ) (__builtin_expect( !!(exp), true )) +# define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), false )) +#else +# define CC_LIKELY( exp ) (__builtin_expect( !!(exp), 1 )) +# define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), 0 )) +#endif + +/** + * exports marked symbols + * + * if used on a C++ class declaration, this macro must be inserted + * after the "class" keyword. For instance: + * + * template + * class ANDROID_API Singleton { } + */ + +#define ANDROID_API __attribute__((visibility("default"))) + +#endif // ANDROID_CUTILS_COMPILER_H diff --git a/third_party/android_system_core/include/cutils/config_utils.h b/third_party/android_system_core/include/cutils/config_utils.h new file mode 100644 index 000000000..2dea6f19f --- /dev/null +++ b/third_party/android_system_core/include/cutils/config_utils.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2006 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 __CUTILS_CONFIG_UTILS_H +#define __CUTILS_CONFIG_UTILS_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct cnode cnode; + + +struct cnode +{ + cnode *next; + cnode *first_child; + cnode *last_child; + const char *name; + const char *value; +}; + +/* parse a text string into a config node tree */ +void config_load(cnode *root, char *data); + +/* parse a file into a config node tree */ +void config_load_file(cnode *root, const char *fn); + +/* create a single config node */ +cnode* config_node(const char *name, const char *value); + +/* locate a named child of a config node */ +cnode* config_find(cnode *root, const char *name); + +/* look up a child by name and return the boolean value */ +int config_bool(cnode *root, const char *name, int _default); + +/* look up a child by name and return the string value */ +const char* config_str(cnode *root, const char *name, const char *_default); + +/* add a named child to a config node (or modify it if it already exists) */ +void config_set(cnode *root, const char *name, const char *value); + +/* free a config node tree */ +void config_free(cnode *root); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/android_system_core/include/cutils/debugger.h b/third_party/android_system_core/include/cutils/debugger.h new file mode 100644 index 000000000..285e1afcd --- /dev/null +++ b/third_party/android_system_core/include/cutils/debugger.h @@ -0,0 +1,77 @@ +/* + * 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 __CUTILS_DEBUGGER_H +#define __CUTILS_DEBUGGER_H + +#include +#include + +__BEGIN_DECLS + +#define DEBUGGER_SOCKET_NAME "android:debuggerd" +#define DEBUGGER32_SOCKET_NAME "android:debuggerd32" +#define DEBUGGER64_SOCKET_NAME DEBUGGER_SOCKET_NAME + +typedef enum { + // dump a crash + DEBUGGER_ACTION_CRASH, + // dump a tombstone file + DEBUGGER_ACTION_DUMP_TOMBSTONE, + // dump a backtrace only back to the socket + DEBUGGER_ACTION_DUMP_BACKTRACE, +} debugger_action_t; + +// Make sure that all values have a fixed size so that this structure +// is the same for 32 bit and 64 bit processes. +// NOTE: Any changes to this structure must also be reflected in +// bionic/linker/debugger.cpp. +typedef struct __attribute__((packed)) { + int32_t action; + pid_t tid; + uint64_t abort_msg_address; + int32_t original_si_code; +} debugger_msg_t; + +/* Dumps a process backtrace, registers, and stack to a tombstone file (requires root). + * Stores the tombstone path in the provided buffer. + * Returns 0 on success, -1 on error. + */ +int dump_tombstone(pid_t tid, char* pathbuf, size_t pathlen); + +/* Dumps a process backtrace, registers, and stack to a tombstone file (requires root). + * Stores the tombstone path in the provided buffer. + * If reading debugger data from debuggerd ever takes longer than timeout_secs + * seconds, then stop and return an error. + * Returns 0 on success, -1 on error. + */ +int dump_tombstone_timeout(pid_t tid, char* pathbuf, size_t pathlen, int timeout_secs); + +/* Dumps a process backtrace only to the specified file (requires root). + * Returns 0 on success, -1 on error. + */ +int dump_backtrace_to_file(pid_t tid, int fd); + +/* Dumps a process backtrace only to the specified file (requires root). + * If reading debugger data from debuggerd ever takes longer than timeout_secs + * seconds, then stop and return an error. + * Returns 0 on success, -1 on error. + */ +int dump_backtrace_to_file_timeout(pid_t tid, int fd, int timeout_secs); + +__END_DECLS + +#endif /* __CUTILS_DEBUGGER_H */ diff --git a/third_party/android_system_core/include/cutils/fs.h b/third_party/android_system_core/include/cutils/fs.h new file mode 100644 index 000000000..70f0b9291 --- /dev/null +++ b/third_party/android_system_core/include/cutils/fs.h @@ -0,0 +1,71 @@ +/* + * 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 __CUTILS_FS_H +#define __CUTILS_FS_H + +#include +#include + +/* + * TEMP_FAILURE_RETRY is defined by some, but not all, versions of + * . (Alas, it is not as standard as we'd hoped!) So, if it's + * not already defined, then define it here. + */ +#ifndef TEMP_FAILURE_RETRY +/* Used to retry syscalls that can return EINTR. */ +#define TEMP_FAILURE_RETRY(exp) ({ \ + typeof (exp) _rc; \ + do { \ + _rc = (exp); \ + } while (_rc == -1 && errno == EINTR); \ + _rc; }) +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Ensure that directory exists with given mode and owners. + */ +extern int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid); + +/* + * Read single plaintext integer from given file, correctly handling files + * partially written with fs_write_atomic_int(). + */ +extern int fs_read_atomic_int(const char* path, int* value); + +/* + * Write single plaintext integer to given file, creating backup while + * in progress. + */ +extern int fs_write_atomic_int(const char* path, int value); + +/* + * Ensure that all directories along given path exist, creating parent + * directories as needed. Validates that given path is absolute and that + * it contains no relative "." or ".." paths or symlinks. Last path segment + * is treated as filename and ignored, unless the path ends with "/". + */ +extern int fs_mkdirs(const char* path, mode_t mode); + +#ifdef __cplusplus +} +#endif + +#endif /* __CUTILS_FS_H */ diff --git a/third_party/android_system_core/include/cutils/hashmap.h b/third_party/android_system_core/include/cutils/hashmap.h new file mode 100644 index 000000000..5cb344c15 --- /dev/null +++ b/third_party/android_system_core/include/cutils/hashmap.h @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2007 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. + */ + +/** + * Hash map. + */ + +#ifndef __HASHMAP_H +#define __HASHMAP_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** A hash map. */ +typedef struct Hashmap Hashmap; + +/** + * Creates a new hash map. Returns NULL if memory allocation fails. + * + * @param initialCapacity number of expected entries + * @param hash function which hashes keys + * @param equals function which compares keys for equality + */ +Hashmap* hashmapCreate(size_t initialCapacity, + int (*hash)(void* key), bool (*equals)(void* keyA, void* keyB)); + +/** + * Frees the hash map. Does not free the keys or values themselves. + */ +void hashmapFree(Hashmap* map); + +/** + * Hashes the memory pointed to by key with the given size. Useful for + * implementing hash functions. + */ +int hashmapHash(void* key, size_t keySize); + +/** + * Puts value for the given key in the map. Returns pre-existing value if + * any. + * + * If memory allocation fails, this function returns NULL, the map's size + * does not increase, and errno is set to ENOMEM. + */ +void* hashmapPut(Hashmap* map, void* key, void* value); + +/** + * Gets a value from the map. Returns NULL if no entry for the given key is + * found or if the value itself is NULL. + */ +void* hashmapGet(Hashmap* map, void* key); + +/** + * Returns true if the map contains an entry for the given key. + */ +bool hashmapContainsKey(Hashmap* map, void* key); + +/** + * Gets the value for a key. If a value is not found, this function gets a + * value and creates an entry using the given callback. + * + * If memory allocation fails, the callback is not called, this function + * returns NULL, and errno is set to ENOMEM. + */ +void* hashmapMemoize(Hashmap* map, void* key, + void* (*initialValue)(void* key, void* context), void* context); + +/** + * Removes an entry from the map. Returns the removed value or NULL if no + * entry was present. + */ +void* hashmapRemove(Hashmap* map, void* key); + +/** + * Gets the number of entries in this map. + */ +size_t hashmapSize(Hashmap* map); + +/** + * Invokes the given callback on each entry in the map. Stops iterating if + * the callback returns false. + */ +void hashmapForEach(Hashmap* map, + bool (*callback)(void* key, void* value, void* context), + void* context); + +/** + * Concurrency support. + */ + +/** + * Locks the hash map so only the current thread can access it. + */ +void hashmapLock(Hashmap* map); + +/** + * Unlocks the hash map so other threads can access it. + */ +void hashmapUnlock(Hashmap* map); + +/** + * Key utilities. + */ + +/** + * Hashes int keys. 'key' is a pointer to int. + */ +int hashmapIntHash(void* key); + +/** + * Compares two int keys for equality. + */ +bool hashmapIntEquals(void* keyA, void* keyB); + +/** + * For debugging. + */ + +/** + * Gets current capacity. + */ +size_t hashmapCurrentCapacity(Hashmap* map); + +/** + * Counts the number of entry collisions. + */ +size_t hashmapCountCollisions(Hashmap* map); + +#ifdef __cplusplus +} +#endif + +#endif /* __HASHMAP_H */ diff --git a/third_party/android_system_core/include/cutils/iosched_policy.h b/third_party/android_system_core/include/cutils/iosched_policy.h new file mode 100644 index 000000000..25b87bac0 --- /dev/null +++ b/third_party/android_system_core/include/cutils/iosched_policy.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2007 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 __CUTILS_IOSCHED_POLICY_H +#define __CUTILS_IOSCHED_POLICY_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + IoSchedClass_NONE, + IoSchedClass_RT, + IoSchedClass_BE, + IoSchedClass_IDLE, +} IoSchedClass; + +extern int android_set_ioprio(int pid, IoSchedClass clazz, int ioprio); +extern int android_get_ioprio(int pid, IoSchedClass *clazz, int *ioprio); + +extern int android_set_rt_ioprio(int pid, int rt); + +#ifdef __cplusplus +} +#endif + +#endif /* __CUTILS_IOSCHED_POLICY_H */ diff --git a/third_party/android_system_core/include/cutils/jstring.h b/third_party/android_system_core/include/cutils/jstring.h new file mode 100644 index 000000000..a3426081a --- /dev/null +++ b/third_party/android_system_core/include/cutils/jstring.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2006 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 __CUTILS_STRING16_H +#define __CUTILS_STRING16_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if __STDC_VERSION__ < 201112L && __cplusplus < 201103L + typedef uint16_t char16_t; +#endif + // otherwise char16_t is a keyword with the right semantics + +extern char * strndup16to8 (const char16_t* s, size_t n); +extern size_t strnlen16to8 (const char16_t* s, size_t n); +extern char * strncpy16to8 (char *dest, const char16_t*s, size_t n); + +extern char16_t * strdup8to16 (const char* s, size_t *out_len); +extern size_t strlen8to16 (const char* utf8Str); +extern char16_t * strcpy8to16 (char16_t *dest, const char*s, size_t *out_len); +extern char16_t * strcpylen8to16 (char16_t *dest, const char*s, int length, + size_t *out_len); + +#ifdef __cplusplus +} +#endif + +#endif /* __CUTILS_STRING16_H */ diff --git a/third_party/android_system_core/include/cutils/klog.h b/third_party/android_system_core/include/cutils/klog.h new file mode 100644 index 000000000..295d62be3 --- /dev/null +++ b/third_party/android_system_core/include/cutils/klog.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2010 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 _CUTILS_KLOG_H_ +#define _CUTILS_KLOG_H_ + +#include +#include +#include + +__BEGIN_DECLS + +void klog_init(void); +int klog_get_level(void); +void klog_set_level(int level); +/* TODO: void klog_close(void); - and make klog_fd users thread safe. */ + +void klog_write(int level, const char *fmt, ...) + __attribute__ ((format(printf, 2, 3))); +void klog_writev(int level, const struct iovec* iov, int iov_count); + +__END_DECLS + +#define KLOG_ERROR_LEVEL 3 +#define KLOG_WARNING_LEVEL 4 +#define KLOG_NOTICE_LEVEL 5 +#define KLOG_INFO_LEVEL 6 +#define KLOG_DEBUG_LEVEL 7 + +#define KLOG_ERROR(tag,x...) klog_write(KLOG_ERROR_LEVEL, "<3>" tag ": " x) +#define KLOG_WARNING(tag,x...) klog_write(KLOG_WARNING_LEVEL, "<4>" tag ": " x) +#define KLOG_NOTICE(tag,x...) klog_write(KLOG_NOTICE_LEVEL, "<5>" tag ": " x) +#define KLOG_INFO(tag,x...) klog_write(KLOG_INFO_LEVEL, "<6>" tag ": " x) +#define KLOG_DEBUG(tag,x...) klog_write(KLOG_DEBUG_LEVEL, "<7>" tag ": " x) + +#define KLOG_DEFAULT_LEVEL 3 /* messages <= this level are logged */ + +#endif diff --git a/third_party/android_system_core/include/cutils/list.h b/third_party/android_system_core/include/cutils/list.h new file mode 100644 index 000000000..4ba2cfd49 --- /dev/null +++ b/third_party/android_system_core/include/cutils/list.h @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2008-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 _CUTILS_LIST_H_ +#define _CUTILS_LIST_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +struct listnode +{ + struct listnode *next; + struct listnode *prev; +}; + +#define node_to_item(node, container, member) \ + (container *) (((char*) (node)) - offsetof(container, member)) + +#define list_declare(name) \ + struct listnode name = { \ + .next = &name, \ + .prev = &name, \ + } + +#define list_for_each(node, list) \ + for (node = (list)->next; node != (list); node = node->next) + +#define list_for_each_reverse(node, list) \ + for (node = (list)->prev; node != (list); node = node->prev) + +#define list_for_each_safe(node, n, list) \ + for (node = (list)->next, n = node->next; \ + node != (list); \ + node = n, n = node->next) + +static inline void list_init(struct listnode *node) +{ + node->next = node; + node->prev = node; +} + +static inline void list_add_tail(struct listnode *head, struct listnode *item) +{ + item->next = head; + item->prev = head->prev; + head->prev->next = item; + head->prev = item; +} + +static inline void list_add_head(struct listnode *head, struct listnode *item) +{ + item->next = head->next; + item->prev = head; + head->next->prev = item; + head->next = item; +} + +static inline void list_remove(struct listnode *item) +{ + item->next->prev = item->prev; + item->prev->next = item->next; +} + +#define list_empty(list) ((list) == (list)->next) +#define list_head(list) ((list)->next) +#define list_tail(list) ((list)->prev) + +#ifdef __cplusplus +}; +#endif /* __cplusplus */ + +#endif diff --git a/third_party/android_system_core/include/cutils/log.h b/third_party/android_system_core/include/cutils/log.h new file mode 100644 index 000000000..0e0248e50 --- /dev/null +++ b/third_party/android_system_core/include/cutils/log.h @@ -0,0 +1 @@ +#include diff --git a/third_party/android_system_core/include/cutils/memory.h b/third_party/android_system_core/include/cutils/memory.h new file mode 100644 index 000000000..4d2688255 --- /dev/null +++ b/third_party/android_system_core/include/cutils/memory.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2006 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_CUTILS_MEMORY_H +#define ANDROID_CUTILS_MEMORY_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* size is given in bytes and must be multiple of 2 */ +void android_memset16(uint16_t* dst, uint16_t value, size_t size); + +/* size is given in bytes and must be multiple of 4 */ +void android_memset32(uint32_t* dst, uint32_t value, size_t size); + +#if defined(__GLIBC__) || defined(_WIN32) +/* Declaration of strlcpy() for platforms that don't already have it. */ +size_t strlcpy(char *dst, const char *src, size_t size); +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // ANDROID_CUTILS_MEMORY_H diff --git a/third_party/android_system_core/include/cutils/misc.h b/third_party/android_system_core/include/cutils/misc.h new file mode 100644 index 000000000..0de505f27 --- /dev/null +++ b/third_party/android_system_core/include/cutils/misc.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2006 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 __CUTILS_MISC_H +#define __CUTILS_MISC_H + +#ifdef __cplusplus +extern "C" { +#endif + + /* Load an entire file into a malloc'd chunk of memory + * that is length_of_file + 1 (null terminator). If + * sz is non-zero, return the size of the file via sz. + * Returns 0 on failure. + */ +extern void *load_file(const char *fn, unsigned *sz); + + /* This is the range of UIDs (and GIDs) that are reserved + * for assigning to applications. + */ +#define FIRST_APPLICATION_UID 10000 +#define LAST_APPLICATION_UID 99999 + +#ifdef __cplusplus +} +#endif + +#endif /* __CUTILS_MISC_H */ diff --git a/third_party/android_system_core/include/cutils/multiuser.h b/third_party/android_system_core/include/cutils/multiuser.h new file mode 100644 index 000000000..635ddb135 --- /dev/null +++ b/third_party/android_system_core/include/cutils/multiuser.h @@ -0,0 +1,41 @@ +/* + * 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 __CUTILS_MULTIUSER_H +#define __CUTILS_MULTIUSER_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// NOTE: keep in sync with android.os.UserId + +#define MULTIUSER_APP_PER_USER_RANGE 100000 + +typedef uid_t userid_t; +typedef uid_t appid_t; + +extern userid_t multiuser_get_user_id(uid_t uid); +extern appid_t multiuser_get_app_id(uid_t uid); +extern uid_t multiuser_get_uid(userid_t userId, appid_t appId); + +#ifdef __cplusplus +} +#endif + +#endif /* __CUTILS_MULTIUSER_H */ diff --git a/third_party/android_system_core/include/cutils/native_handle.h b/third_party/android_system_core/include/cutils/native_handle.h new file mode 100644 index 000000000..268c5d3f5 --- /dev/null +++ b/third_party/android_system_core/include/cutils/native_handle.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2009 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 NATIVE_HANDLE_H_ +#define NATIVE_HANDLE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct native_handle +{ + int version; /* sizeof(native_handle_t) */ + int numFds; /* number of file-descriptors at &data[0] */ + int numInts; /* number of ints at &data[numFds] */ + int data[0]; /* numFds + numInts ints */ +} native_handle_t; + +/* + * native_handle_close + * + * closes the file descriptors contained in this native_handle_t + * + * return 0 on success, or a negative error code on failure + * + */ +int native_handle_close(const native_handle_t* h); + + +/* + * native_handle_create + * + * creates a native_handle_t and initializes it. must be destroyed with + * native_handle_delete(). + * + */ +native_handle_t* native_handle_create(int numFds, int numInts); + +/* + * native_handle_delete + * + * frees a native_handle_t allocated with native_handle_create(). + * This ONLY frees the memory allocated for the native_handle_t, but doesn't + * close the file descriptors; which can be achieved with native_handle_close(). + * + * return 0 on success, or a negative error code on failure + * + */ +int native_handle_delete(native_handle_t* h); + + +#ifdef __cplusplus +} +#endif + +#endif /* NATIVE_HANDLE_H_ */ diff --git a/third_party/android_system_core/include/cutils/open_memstream.h b/third_party/android_system_core/include/cutils/open_memstream.h new file mode 100644 index 000000000..c1a81ebbc --- /dev/null +++ b/third_party/android_system_core/include/cutils/open_memstream.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2010 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 __CUTILS_OPEN_MEMSTREAM_H__ +#define __CUTILS_OPEN_MEMSTREAM_H__ + +#include + +#if defined(__APPLE__) + +#ifdef __cplusplus +extern "C" { +#endif + +FILE* open_memstream(char** bufp, size_t* sizep); + +#ifdef __cplusplus +} +#endif + +#endif /* __APPLE__ */ + +#endif /*__CUTILS_OPEN_MEMSTREAM_H__*/ diff --git a/third_party/android_system_core/include/cutils/partition_utils.h b/third_party/android_system_core/include/cutils/partition_utils.h new file mode 100644 index 000000000..72ca80d35 --- /dev/null +++ b/third_party/android_system_core/include/cutils/partition_utils.h @@ -0,0 +1,26 @@ +/* + * Copyright 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 __CUTILS_PARTITION_WIPED_H__ +#define __CUTILS_PARTITION_WIPED_H__ + +__BEGIN_DECLS + +int partition_wiped(char *source); + +__END_DECLS + +#endif /* __CUTILS_PARTITION_WIPED_H__ */ diff --git a/third_party/android_system_core/include/cutils/process_name.h b/third_party/android_system_core/include/cutils/process_name.h new file mode 100644 index 000000000..1e72e5c3a --- /dev/null +++ b/third_party/android_system_core/include/cutils/process_name.h @@ -0,0 +1,42 @@ +/* + * 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. + */ + +/** + * Gives the current process a name. + */ + +#ifndef __PROCESS_NAME_H +#define __PROCESS_NAME_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Sets the current process name. + * + * Warning: This leaks a string every time you call it. Use judiciously! + */ +void set_process_name(const char* process_name); + +/** Gets the current process name. */ +const char* get_process_name(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __PROCESS_NAME_H */ diff --git a/third_party/android_system_core/include/cutils/properties.h b/third_party/android_system_core/include/cutils/properties.h new file mode 100644 index 000000000..24aa224f6 --- /dev/null +++ b/third_party/android_system_core/include/cutils/properties.h @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2006 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 __CUTILS_PROPERTIES_H +#define __CUTILS_PROPERTIES_H + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* System properties are *small* name value pairs managed by the +** property service. If your data doesn't fit in the provided +** space it is not appropriate for a system property. +** +** WARNING: system/bionic/include/sys/system_properties.h also defines +** these, but with different names. (TODO: fix that) +*/ +#define PROPERTY_KEY_MAX PROP_NAME_MAX +#define PROPERTY_VALUE_MAX PROP_VALUE_MAX + +/* property_get: returns the length of the value which will never be +** greater than PROPERTY_VALUE_MAX - 1 and will always be zero terminated. +** (the length does not include the terminating zero). +** +** If the property read fails or returns an empty value, the default +** value is used (if nonnull). +*/ +int property_get(const char *key, char *value, const char *default_value); + +/* property_get_bool: returns the value of key coerced into a +** boolean. If the property is not set, then the default value is returned. +** +* The following is considered to be true (1): +** "1", "true", "y", "yes", "on" +** +** The following is considered to be false (0): +** "0", "false", "n", "no", "off" +** +** The conversion is whitespace-sensitive (e.g. " off" will not be false). +** +** If no property with this key is set (or the key is NULL) or the boolean +** conversion fails, the default value is returned. +**/ +int8_t property_get_bool(const char *key, int8_t default_value); + +/* property_get_int64: returns the value of key truncated and coerced into a +** int64_t. If the property is not set, then the default value is used. +** +** The numeric conversion is identical to strtoimax with the base inferred: +** - All digits up to the first non-digit characters are read +** - The longest consecutive prefix of digits is converted to a long +** +** Valid strings of digits are: +** - An optional sign character + or - +** - An optional prefix indicating the base (otherwise base 10 is assumed) +** -- 0 prefix is octal +** -- 0x / 0X prefix is hex +** +** Leading/trailing whitespace is ignored. Overflow/underflow will cause +** numeric conversion to fail. +** +** If no property with this key is set (or the key is NULL) or the numeric +** conversion fails, the default value is returned. +**/ +int64_t property_get_int64(const char *key, int64_t default_value); + +/* property_get_int32: returns the value of key truncated and coerced into an +** int32_t. If the property is not set, then the default value is used. +** +** The numeric conversion is identical to strtoimax with the base inferred: +** - All digits up to the first non-digit characters are read +** - The longest consecutive prefix of digits is converted to a long +** +** Valid strings of digits are: +** - An optional sign character + or - +** - An optional prefix indicating the base (otherwise base 10 is assumed) +** -- 0 prefix is octal +** -- 0x / 0X prefix is hex +** +** Leading/trailing whitespace is ignored. Overflow/underflow will cause +** numeric conversion to fail. +** +** If no property with this key is set (or the key is NULL) or the numeric +** conversion fails, the default value is returned. +**/ +int32_t property_get_int32(const char *key, int32_t default_value); + +/* property_set: returns 0 on success, < 0 on failure +*/ +int property_set(const char *key, const char *value); + +int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie); + +#if defined(__BIONIC_FORTIFY) + +extern int __property_get_real(const char *, char *, const char *) + __asm__(__USER_LABEL_PREFIX__ "property_get"); +__errordecl(__property_get_too_small_error, "property_get() called with too small of a buffer"); + +__BIONIC_FORTIFY_INLINE +int property_get(const char *key, char *value, const char *default_value) { + size_t bos = __bos(value); + if (bos < PROPERTY_VALUE_MAX) { + __property_get_too_small_error(); + } + return __property_get_real(key, value, default_value); +} + +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/android_system_core/include/cutils/qtaguid.h b/third_party/android_system_core/include/cutils/qtaguid.h new file mode 100644 index 000000000..f8550fda8 --- /dev/null +++ b/third_party/android_system_core/include/cutils/qtaguid.h @@ -0,0 +1,66 @@ +/* + * 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 __CUTILS_QTAGUID_H +#define __CUTILS_QTAGUID_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Set tags (and owning UIDs) for network sockets. +*/ +extern int qtaguid_tagSocket(int sockfd, int tag, uid_t uid); + +/* + * Untag a network socket before closing. +*/ +extern int qtaguid_untagSocket(int sockfd); + +/* + * For the given uid, switch counter sets. + * The kernel only keeps a limited number of sets. + * 2 for now. + */ +extern int qtaguid_setCounterSet(int counterSetNum, uid_t uid); + +/* + * Delete all tag info that relates to the given tag an uid. + * If the tag is 0, then ALL info about the uid is freeded. + * The delete data also affects active tagged socketd, which are + * then untagged. + * The calling process can only operate on its own tags. + * Unless it is part of the happy AID_NET_BW_ACCT group. + * In which case it can clobber everything. + */ +extern int qtaguid_deleteTagData(int tag, uid_t uid); + +/* + * Enable/disable qtaguid functionnality at a lower level. + * When pacified, the kernel will accept commands but do nothing. + */ +extern int qtaguid_setPacifier(int on); + +#ifdef __cplusplus +} +#endif + +#endif /* __CUTILS_QTAG_UID_H */ diff --git a/third_party/android_system_core/include/cutils/record_stream.h b/third_party/android_system_core/include/cutils/record_stream.h new file mode 100644 index 000000000..bfac87a53 --- /dev/null +++ b/third_party/android_system_core/include/cutils/record_stream.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2006 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. + */ + +/* + * A simple utility for reading fixed records out of a stream fd + */ + +#ifndef _CUTILS_RECORD_STREAM_H +#define _CUTILS_RECORD_STREAM_H + +#ifdef __cplusplus +extern "C" { +#endif + + +typedef struct RecordStream RecordStream; + +extern RecordStream *record_stream_new(int fd, size_t maxRecordLen); +extern void record_stream_free(RecordStream *p_rs); + +extern int record_stream_get_next (RecordStream *p_rs, void ** p_outRecord, + size_t *p_outRecordLen); + +#ifdef __cplusplus +} +#endif + + +#endif /*_CUTILS_RECORD_STREAM_H*/ + diff --git a/third_party/android_system_core/include/cutils/sched_policy.h b/third_party/android_system_core/include/cutils/sched_policy.h new file mode 100644 index 000000000..6a8d570b2 --- /dev/null +++ b/third_party/android_system_core/include/cutils/sched_policy.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2007 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 __CUTILS_SCHED_POLICY_H +#define __CUTILS_SCHED_POLICY_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Keep in sync with THREAD_GROUP_* in frameworks/base/core/java/android/os/Process.java */ +typedef enum { + SP_DEFAULT = -1, + SP_BACKGROUND = 0, + SP_FOREGROUND = 1, + SP_SYSTEM = 2, // can't be used with set_sched_policy() + SP_AUDIO_APP = 3, + SP_AUDIO_SYS = 4, + SP_CNT, + SP_MAX = SP_CNT - 1, + SP_SYSTEM_DEFAULT = SP_FOREGROUND, +} SchedPolicy; + +extern int set_cpuset_policy(int tid, SchedPolicy policy); + +/* Assign thread tid to the cgroup associated with the specified policy. + * If the thread is a thread group leader, that is it's gettid() == getpid(), + * then the other threads in the same thread group are _not_ affected. + * On platforms which support gettid(), zero tid means current thread. + * Return value: 0 for success, or -errno for error. + */ +extern int set_sched_policy(int tid, SchedPolicy policy); + +/* Return the policy associated with the cgroup of thread tid via policy pointer. + * On platforms which support gettid(), zero tid means current thread. + * Return value: 0 for success, or -1 for error and set errno. + */ +extern int get_sched_policy(int tid, SchedPolicy *policy); + +/* Return a displayable string corresponding to policy. + * Return value: non-NULL NUL-terminated name of unspecified length; + * the caller is responsible for displaying the useful part of the string. + */ +extern const char *get_sched_policy_name(SchedPolicy policy); + +#ifdef __cplusplus +} +#endif + +#endif /* __CUTILS_SCHED_POLICY_H */ diff --git a/third_party/android_system_core/include/cutils/sockets.h b/third_party/android_system_core/include/cutils/sockets.h new file mode 100644 index 000000000..f8076ca45 --- /dev/null +++ b/third_party/android_system_core/include/cutils/sockets.h @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2006 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 __CUTILS_SOCKETS_H +#define __CUTILS_SOCKETS_H + +#include +#include +#include +#include +#include + +#ifdef HAVE_WINSOCK +#include +typedef int socklen_t; +#else +#include +#endif + +#define ANDROID_SOCKET_ENV_PREFIX "ANDROID_SOCKET_" +#define ANDROID_SOCKET_DIR "/dev/socket" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * android_get_control_socket - simple helper function to get the file + * descriptor of our init-managed Unix domain socket. `name' is the name of the + * socket, as given in init.rc. Returns -1 on error. + * + * This is inline and not in libcutils proper because we want to use this in + * third-party daemons with minimal modification. + */ +static inline int android_get_control_socket(const char *name) +{ + char key[64]; + snprintf(key, sizeof(key), ANDROID_SOCKET_ENV_PREFIX "%s", name); + + const char* val = getenv(key); + if (!val) { + return -1; + } + + errno = 0; + int fd = strtol(val, NULL, 10); + if (errno) { + return -1; + } + + return fd; +} + +/* + * See also android.os.LocalSocketAddress.Namespace + */ +// Linux "abstract" (non-filesystem) namespace +#define ANDROID_SOCKET_NAMESPACE_ABSTRACT 0 +// Android "reserved" (/dev/socket) namespace +#define ANDROID_SOCKET_NAMESPACE_RESERVED 1 +// Normal filesystem namespace +#define ANDROID_SOCKET_NAMESPACE_FILESYSTEM 2 + +extern int socket_loopback_client(int port, int type); +extern int socket_network_client(const char *host, int port, int type); +extern int socket_network_client_timeout(const char *host, int port, int type, + int timeout); +extern int socket_loopback_server(int port, int type); +extern int socket_local_server(const char *name, int namespaceId, int type); +extern int socket_local_server_bind(int s, const char *name, int namespaceId); +extern int socket_local_client_connect(int fd, + const char *name, int namespaceId, int type); +extern int socket_local_client(const char *name, int namespaceId, int type); +extern int socket_inaddr_any_server(int port, int type); + +/* + * socket_peer_is_trusted - Takes a socket which is presumed to be a + * connected local socket (e.g. AF_LOCAL) and returns whether the peer + * (the userid that owns the process on the other end of that socket) + * is one of the two trusted userids, root or shell. + * + * Note: This only works as advertised on the Android OS and always + * just returns true when called on other operating systems. + */ +extern bool socket_peer_is_trusted(int fd); + +#ifdef __cplusplus +} +#endif + +#endif /* __CUTILS_SOCKETS_H */ diff --git a/third_party/android_system_core/include/cutils/str_parms.h b/third_party/android_system_core/include/cutils/str_parms.h new file mode 100644 index 000000000..aa1435a08 --- /dev/null +++ b/third_party/android_system_core/include/cutils/str_parms.h @@ -0,0 +1,60 @@ +/* + * 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 __CUTILS_STR_PARMS_H +#define __CUTILS_STR_PARMS_H + +#include +#include + +__BEGIN_DECLS + +struct str_parms; + +struct str_parms *str_parms_create(void); +struct str_parms *str_parms_create_str(const char *_string); +void str_parms_destroy(struct str_parms *str_parms); + +void str_parms_del(struct str_parms *str_parms, const char *key); + +int str_parms_add_str(struct str_parms *str_parms, const char *key, + const char *value); +int str_parms_add_int(struct str_parms *str_parms, const char *key, int value); + +int str_parms_add_float(struct str_parms *str_parms, const char *key, + float value); + +// Returns non-zero if the str_parms contains the specified key. +int str_parms_has_key(struct str_parms *str_parms, const char *key); + +// Gets value associated with the specified key (if present), placing it in the buffer +// pointed to by the out_val parameter. Returns the length of the returned string value. +// If 'key' isn't in the parms, then return -ENOENT (-2) and leave 'out_val' untouched. +int str_parms_get_str(struct str_parms *str_parms, const char *key, + char *out_val, int len); +int str_parms_get_int(struct str_parms *str_parms, const char *key, + int *out_val); +int str_parms_get_float(struct str_parms *str_parms, const char *key, + float *out_val); + +char *str_parms_to_str(struct str_parms *str_parms); + +/* debug */ +void str_parms_dump(struct str_parms *str_parms); + +__END_DECLS + +#endif /* __CUTILS_STR_PARMS_H */ diff --git a/third_party/android_system_core/include/cutils/threads.h b/third_party/android_system_core/include/cutils/threads.h new file mode 100644 index 000000000..572749407 --- /dev/null +++ b/third_party/android_system_core/include/cutils/threads.h @@ -0,0 +1,148 @@ +/* + * Copyright (C) 2007 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 _LIBS_CUTILS_THREADS_H +#define _LIBS_CUTILS_THREADS_H + +#include + +#if !defined(_WIN32) +#include +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/***********************************************************************/ +/***********************************************************************/ +/***** *****/ +/***** local thread storage *****/ +/***** *****/ +/***********************************************************************/ +/***********************************************************************/ + +extern pid_t gettid(); + +#if !defined(_WIN32) + +typedef struct { + pthread_mutex_t lock; + int has_tls; + pthread_key_t tls; +} thread_store_t; + +#define THREAD_STORE_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, 0, 0 } + +#else // !defined(_WIN32) + +typedef struct { + int lock_init; + int has_tls; + DWORD tls; + CRITICAL_SECTION lock; +} thread_store_t; + +#define THREAD_STORE_INITIALIZER { 0, 0, 0, {0, 0, 0, 0, 0, 0} } + +#endif // !defined(_WIN32) + +typedef void (*thread_store_destruct_t)(void* value); + +extern void* thread_store_get(thread_store_t* store); + +extern void thread_store_set(thread_store_t* store, + void* value, + thread_store_destruct_t destroy); + +/***********************************************************************/ +/***********************************************************************/ +/***** *****/ +/***** mutexes *****/ +/***** *****/ +/***********************************************************************/ +/***********************************************************************/ + +#if !defined(_WIN32) + +typedef pthread_mutex_t mutex_t; + +#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER + +static __inline__ void mutex_lock(mutex_t* lock) +{ + pthread_mutex_lock(lock); +} +static __inline__ void mutex_unlock(mutex_t* lock) +{ + pthread_mutex_unlock(lock); +} +static __inline__ int mutex_init(mutex_t* lock) +{ + return pthread_mutex_init(lock, NULL); +} +static __inline__ void mutex_destroy(mutex_t* lock) +{ + pthread_mutex_destroy(lock); +} + +#else // !defined(_WIN32) + +typedef struct { + int init; + CRITICAL_SECTION lock[1]; +} mutex_t; + +#define MUTEX_INITIALIZER { 0, {{ NULL, 0, 0, NULL, NULL, 0 }} } + +static __inline__ void mutex_lock(mutex_t* lock) +{ + if (!lock->init) { + lock->init = 1; + InitializeCriticalSection( lock->lock ); + lock->init = 2; + } else while (lock->init != 2) + Sleep(10); + + EnterCriticalSection(lock->lock); +} + +static __inline__ void mutex_unlock(mutex_t* lock) +{ + LeaveCriticalSection(lock->lock); +} +static __inline__ int mutex_init(mutex_t* lock) +{ + InitializeCriticalSection(lock->lock); + lock->init = 2; + return 0; +} +static __inline__ void mutex_destroy(mutex_t* lock) +{ + if (lock->init) { + lock->init = 0; + DeleteCriticalSection(lock->lock); + } +} +#endif // !defined(_WIN32) + +#ifdef __cplusplus +} +#endif + +#endif /* _LIBS_CUTILS_THREADS_H */ diff --git a/third_party/android_system_core/include/cutils/trace.h b/third_party/android_system_core/include/cutils/trace.h new file mode 100644 index 000000000..e4ed17983 --- /dev/null +++ b/third_party/android_system_core/include/cutils/trace.h @@ -0,0 +1,252 @@ +/* + * 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 _LIBS_CUTILS_TRACE_H +#define _LIBS_CUTILS_TRACE_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +__BEGIN_DECLS + +/** + * The ATRACE_TAG macro can be defined before including this header to trace + * using one of the tags defined below. It must be defined to one of the + * following ATRACE_TAG_* macros. The trace tag is used to filter tracing in + * userland to avoid some of the runtime cost of tracing when it is not desired. + * + * Defining ATRACE_TAG to be ATRACE_TAG_ALWAYS will result in the tracing always + * being enabled - this should ONLY be done for debug code, as userland tracing + * has a performance cost even when the trace is not being recorded. Defining + * ATRACE_TAG to be ATRACE_TAG_NEVER or leaving ATRACE_TAG undefined will result + * in the tracing always being disabled. + * + * ATRACE_TAG_HAL should be bitwise ORed with the relevant tags for tracing + * within a hardware module. For example a camera hardware module would set: + * #define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) + * + * Keep these in sync with frameworks/base/core/java/android/os/Trace.java. + */ +#define ATRACE_TAG_NEVER 0 // This tag is never enabled. +#define ATRACE_TAG_ALWAYS (1<<0) // This tag is always enabled. +#define ATRACE_TAG_GRAPHICS (1<<1) +#define ATRACE_TAG_INPUT (1<<2) +#define ATRACE_TAG_VIEW (1<<3) +#define ATRACE_TAG_WEBVIEW (1<<4) +#define ATRACE_TAG_WINDOW_MANAGER (1<<5) +#define ATRACE_TAG_ACTIVITY_MANAGER (1<<6) +#define ATRACE_TAG_SYNC_MANAGER (1<<7) +#define ATRACE_TAG_AUDIO (1<<8) +#define ATRACE_TAG_VIDEO (1<<9) +#define ATRACE_TAG_CAMERA (1<<10) +#define ATRACE_TAG_HAL (1<<11) +#define ATRACE_TAG_APP (1<<12) +#define ATRACE_TAG_RESOURCES (1<<13) +#define ATRACE_TAG_DALVIK (1<<14) +#define ATRACE_TAG_RS (1<<15) +#define ATRACE_TAG_BIONIC (1<<16) +#define ATRACE_TAG_POWER (1<<17) +#define ATRACE_TAG_LAST ATRACE_TAG_POWER + +// Reserved for initialization. +#define ATRACE_TAG_NOT_READY (1LL<<63) + +#define ATRACE_TAG_VALID_MASK ((ATRACE_TAG_LAST - 1) | ATRACE_TAG_LAST) + +#ifndef ATRACE_TAG +#define ATRACE_TAG ATRACE_TAG_NEVER +#elif ATRACE_TAG > ATRACE_TAG_VALID_MASK +#error ATRACE_TAG must be defined to be one of the tags defined in cutils/trace.h +#endif + +/** + * Opens the trace file for writing and reads the property for initial tags. + * The atrace.tags.enableflags property sets the tags to trace. + * This function should not be explicitly called, the first call to any normal + * trace function will cause it to be run safely. + */ +void atrace_setup(); + +/** + * If tracing is ready, set atrace_enabled_tags to the system property + * debug.atrace.tags.enableflags. Can be used as a sysprop change callback. + */ +void atrace_update_tags(); + +/** + * Set whether the process is debuggable. By default the process is not + * considered debuggable. If the process is not debuggable then application- + * level tracing is not allowed unless the ro.debuggable system property is + * set to '1'. + */ +void atrace_set_debuggable(bool debuggable); + +/** + * Set whether tracing is enabled for the current process. This is used to + * prevent tracing within the Zygote process. + */ +void atrace_set_tracing_enabled(bool enabled); + +/** + * Flag indicating whether setup has been completed, initialized to 0. + * Nonzero indicates setup has completed. + * Note: This does NOT indicate whether or not setup was successful. + */ +extern atomic_bool atrace_is_ready; + +/** + * Set of ATRACE_TAG flags to trace for, initialized to ATRACE_TAG_NOT_READY. + * A value of zero indicates setup has failed. + * Any other nonzero value indicates setup has succeeded, and tracing is on. + */ +extern uint64_t atrace_enabled_tags; + +/** + * Handle to the kernel's trace buffer, initialized to -1. + * Any other value indicates setup has succeeded, and is a valid fd for tracing. + */ +extern int atrace_marker_fd; + +/** + * atrace_init readies the process for tracing by opening the trace_marker file. + * Calling any trace function causes this to be run, so calling it is optional. + * This can be explicitly run to avoid setup delay on first trace function. + */ +#define ATRACE_INIT() atrace_init() +static inline void atrace_init() +{ + if (CC_UNLIKELY(!atomic_load_explicit(&atrace_is_ready, memory_order_acquire))) { + atrace_setup(); + } +} + +/** + * Get the mask of all tags currently enabled. + * It can be used as a guard condition around more expensive trace calculations. + * Every trace function calls this, which ensures atrace_init is run. + */ +#define ATRACE_GET_ENABLED_TAGS() atrace_get_enabled_tags() +static inline uint64_t atrace_get_enabled_tags() +{ + atrace_init(); + return atrace_enabled_tags; +} + +/** + * Test if a given tag is currently enabled. + * Returns nonzero if the tag is enabled, otherwise zero. + * It can be used as a guard condition around more expensive trace calculations. + */ +#define ATRACE_ENABLED() atrace_is_tag_enabled(ATRACE_TAG) +static inline uint64_t atrace_is_tag_enabled(uint64_t tag) +{ + return atrace_get_enabled_tags() & tag; +} + +/** + * Trace the beginning of a context. name is used to identify the context. + * This is often used to time function execution. + */ +#define ATRACE_BEGIN(name) atrace_begin(ATRACE_TAG, name) +static inline void atrace_begin(uint64_t tag, const char* name) +{ + if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { + void atrace_begin_body(const char*); + atrace_begin_body(name); + } +} + +/** + * Trace the end of a context. + * This should match up (and occur after) a corresponding ATRACE_BEGIN. + */ +#define ATRACE_END() atrace_end(ATRACE_TAG) +static inline void atrace_end(uint64_t tag) +{ + if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { + char c = 'E'; + write(atrace_marker_fd, &c, 1); + } +} + +/** + * Trace the beginning of an asynchronous event. Unlike ATRACE_BEGIN/ATRACE_END + * contexts, asynchronous events do not need to be nested. The name describes + * the event, and the cookie provides a unique identifier for distinguishing + * simultaneous events. The name and cookie used to begin an event must be + * used to end it. + */ +#define ATRACE_ASYNC_BEGIN(name, cookie) \ + atrace_async_begin(ATRACE_TAG, name, cookie) +static inline void atrace_async_begin(uint64_t tag, const char* name, + int32_t cookie) +{ + if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { + void atrace_async_begin_body(const char*, int32_t); + atrace_async_begin_body(name, cookie); + } +} + +/** + * Trace the end of an asynchronous event. + * This should have a corresponding ATRACE_ASYNC_BEGIN. + */ +#define ATRACE_ASYNC_END(name, cookie) atrace_async_end(ATRACE_TAG, name, cookie) +static inline void atrace_async_end(uint64_t tag, const char* name, int32_t cookie) +{ + if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { + void atrace_async_end_body(const char*, int32_t); + atrace_async_end_body(name, cookie); + } +} + +/** + * Traces an integer counter value. name is used to identify the counter. + * This can be used to track how a value changes over time. + */ +#define ATRACE_INT(name, value) atrace_int(ATRACE_TAG, name, value) +static inline void atrace_int(uint64_t tag, const char* name, int32_t value) +{ + if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { + void atrace_int_body(const char*, int32_t); + atrace_int_body(name, value); + } +} + +/** + * Traces a 64-bit integer counter value. name is used to identify the + * counter. This can be used to track how a value changes over time. + */ +#define ATRACE_INT64(name, value) atrace_int64(ATRACE_TAG, name, value) +static inline void atrace_int64(uint64_t tag, const char* name, int64_t value) +{ + if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { + void atrace_int64_body(const char*, int64_t); + atrace_int64_body(name, value); + } +} + +__END_DECLS + +#endif // _LIBS_CUTILS_TRACE_H diff --git a/third_party/android_system_core/include/cutils/uevent.h b/third_party/android_system_core/include/cutils/uevent.h new file mode 100644 index 000000000..da1c2aae6 --- /dev/null +++ b/third_party/android_system_core/include/cutils/uevent.h @@ -0,0 +1,36 @@ +/* + * 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 __CUTILS_UEVENT_H +#define __CUTILS_UEVENT_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +int uevent_open_socket(int buf_sz, bool passcred); +ssize_t uevent_kernel_multicast_recv(int socket, void *buffer, size_t length); +ssize_t uevent_kernel_multicast_uid_recv(int socket, void *buffer, size_t length, uid_t *uid); +ssize_t uevent_kernel_recv(int socket, void *buffer, size_t length, bool require_group, uid_t *uid); + +#ifdef __cplusplus +} +#endif + +#endif /* __CUTILS_UEVENT_H */ diff --git a/third_party/android_system_core/include/log/event_tag_map.h b/third_party/android_system_core/include/log/event_tag_map.h new file mode 100644 index 000000000..1653c61e9 --- /dev/null +++ b/third_party/android_system_core/include/log/event_tag_map.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2007 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 _LIBS_CUTILS_EVENTTAGMAP_H +#define _LIBS_CUTILS_EVENTTAGMAP_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define EVENT_TAG_MAP_FILE "/system/etc/event-log-tags" + +struct EventTagMap; +typedef struct EventTagMap EventTagMap; + +/* + * Open the specified file as an event log tag map. + * + * Returns NULL on failure. + */ +EventTagMap* android_openEventTagMap(const char* fileName); + +/* + * Close the map. + */ +void android_closeEventTagMap(EventTagMap* map); + +/* + * Look up a tag by index. Returns the tag string, or NULL if not found. + */ +const char* android_lookupEventTag(const EventTagMap* map, int tag); + +#ifdef __cplusplus +} +#endif + +#endif /*_LIBS_CUTILS_EVENTTAGMAP_H*/ diff --git a/third_party/android_system_core/include/log/log.h b/third_party/android_system_core/include/log/log.h new file mode 100644 index 000000000..63a441a68 --- /dev/null +++ b/third_party/android_system_core/include/log/log.h @@ -0,0 +1,642 @@ +/* + * Copyright (C) 2005-2014 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. + */ + +// +// C/C++ logging functions. See the logging documentation for API details. +// +// We'd like these to be available from C code (in case we import some from +// somewhere), so this has a C interface. +// +// The output will be correct when the log file is shared between multiple +// threads and/or multiple processes so long as the operating system +// supports O_APPEND. These calls have mutex-protected data structures +// and so are NOT reentrant. Do not use LOG in a signal handler. +// +#ifndef _LIBS_LOG_LOG_H +#define _LIBS_LOG_LOG_H + +#include +#include +#include +#include +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// --------------------------------------------------------------------- + +/* + * Normally we strip ALOGV (VERBOSE messages) from release builds. + * You can modify this (for example with "#define LOG_NDEBUG 0" + * at the top of your source file) to change that behavior. + */ +#ifndef LOG_NDEBUG +#ifdef NDEBUG +#define LOG_NDEBUG 1 +#else +#define LOG_NDEBUG 0 +#endif +#endif + +/* + * This is the local tag used for the following simplified + * logging macros. You can change this preprocessor definition + * before using the other macros to change the tag. + */ +#ifndef LOG_TAG +#define LOG_TAG NULL +#endif + +// --------------------------------------------------------------------- + +#ifndef __predict_false +#define __predict_false(exp) __builtin_expect((exp) != 0, 0) +#endif + +/* + * -DLINT_RLOG in sources that you want to enforce that all logging + * goes to the radio log buffer. If any logging goes to any of the other + * log buffers, there will be a compile or link error to highlight the + * problem. This is not a replacement for a full audit of the code since + * this only catches compiled code, not ifdef'd debug code. Options to + * defining this, either temporarily to do a spot check, or permanently + * to enforce, in all the communications trees; We have hopes to ensure + * that by supplying just the radio log buffer that the communications + * teams will have their one-stop shop for triaging issues. + */ +#ifndef LINT_RLOG + +/* + * Simplified macro to send a verbose log message using the current LOG_TAG. + */ +#ifndef ALOGV +#define __ALOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) +#if LOG_NDEBUG +#define ALOGV(...) do { if (0) { __ALOGV(__VA_ARGS__); } } while (0) +#else +#define ALOGV(...) __ALOGV(__VA_ARGS__) +#endif +#endif + +#ifndef ALOGV_IF +#if LOG_NDEBUG +#define ALOGV_IF(cond, ...) ((void)0) +#else +#define ALOGV_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif +#endif + +/* + * Simplified macro to send a debug log message using the current LOG_TAG. + */ +#ifndef ALOGD +#define ALOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef ALOGD_IF +#define ALOGD_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send an info log message using the current LOG_TAG. + */ +#ifndef ALOGI +#define ALOGI(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef ALOGI_IF +#define ALOGI_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send a warning log message using the current LOG_TAG. + */ +#ifndef ALOGW +#define ALOGW(...) ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef ALOGW_IF +#define ALOGW_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send an error log message using the current LOG_TAG. + */ +#ifndef ALOGE +#define ALOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef ALOGE_IF +#define ALOGE_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +// --------------------------------------------------------------------- + +/* + * Conditional based on whether the current LOG_TAG is enabled at + * verbose priority. + */ +#ifndef IF_ALOGV +#if LOG_NDEBUG +#define IF_ALOGV() if (false) +#else +#define IF_ALOGV() IF_ALOG(LOG_VERBOSE, LOG_TAG) +#endif +#endif + +/* + * Conditional based on whether the current LOG_TAG is enabled at + * debug priority. + */ +#ifndef IF_ALOGD +#define IF_ALOGD() IF_ALOG(LOG_DEBUG, LOG_TAG) +#endif + +/* + * Conditional based on whether the current LOG_TAG is enabled at + * info priority. + */ +#ifndef IF_ALOGI +#define IF_ALOGI() IF_ALOG(LOG_INFO, LOG_TAG) +#endif + +/* + * Conditional based on whether the current LOG_TAG is enabled at + * warn priority. + */ +#ifndef IF_ALOGW +#define IF_ALOGW() IF_ALOG(LOG_WARN, LOG_TAG) +#endif + +/* + * Conditional based on whether the current LOG_TAG is enabled at + * error priority. + */ +#ifndef IF_ALOGE +#define IF_ALOGE() IF_ALOG(LOG_ERROR, LOG_TAG) +#endif + + +// --------------------------------------------------------------------- + +/* + * Simplified macro to send a verbose system log message using the current LOG_TAG. + */ +#ifndef SLOGV +#define __SLOGV(...) \ + ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) +#if LOG_NDEBUG +#define SLOGV(...) do { if (0) { __SLOGV(__VA_ARGS__); } } while (0) +#else +#define SLOGV(...) __SLOGV(__VA_ARGS__) +#endif +#endif + +#ifndef SLOGV_IF +#if LOG_NDEBUG +#define SLOGV_IF(cond, ...) ((void)0) +#else +#define SLOGV_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif +#endif + +/* + * Simplified macro to send a debug system log message using the current LOG_TAG. + */ +#ifndef SLOGD +#define SLOGD(...) \ + ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef SLOGD_IF +#define SLOGD_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send an info system log message using the current LOG_TAG. + */ +#ifndef SLOGI +#define SLOGI(...) \ + ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef SLOGI_IF +#define SLOGI_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send a warning system log message using the current LOG_TAG. + */ +#ifndef SLOGW +#define SLOGW(...) \ + ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef SLOGW_IF +#define SLOGW_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send an error system log message using the current LOG_TAG. + */ +#ifndef SLOGE +#define SLOGE(...) \ + ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef SLOGE_IF +#define SLOGE_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +#endif /* !LINT_RLOG */ + +// --------------------------------------------------------------------- + +/* + * Simplified macro to send a verbose radio log message using the current LOG_TAG. + */ +#ifndef RLOGV +#define __RLOGV(...) \ + ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) +#if LOG_NDEBUG +#define RLOGV(...) do { if (0) { __RLOGV(__VA_ARGS__); } } while (0) +#else +#define RLOGV(...) __RLOGV(__VA_ARGS__) +#endif +#endif + +#ifndef RLOGV_IF +#if LOG_NDEBUG +#define RLOGV_IF(cond, ...) ((void)0) +#else +#define RLOGV_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif +#endif + +/* + * Simplified macro to send a debug radio log message using the current LOG_TAG. + */ +#ifndef RLOGD +#define RLOGD(...) \ + ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef RLOGD_IF +#define RLOGD_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send an info radio log message using the current LOG_TAG. + */ +#ifndef RLOGI +#define RLOGI(...) \ + ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef RLOGI_IF +#define RLOGI_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send a warning radio log message using the current LOG_TAG. + */ +#ifndef RLOGW +#define RLOGW(...) \ + ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef RLOGW_IF +#define RLOGW_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send an error radio log message using the current LOG_TAG. + */ +#ifndef RLOGE +#define RLOGE(...) \ + ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef RLOGE_IF +#define RLOGE_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + + +// --------------------------------------------------------------------- + +/* + * Log a fatal error. If the given condition fails, this stops program + * execution like a normal assertion, but also generating the given message. + * It is NOT stripped from release builds. Note that the condition test + * is -inverted- from the normal assert() semantics. + */ +#ifndef LOG_ALWAYS_FATAL_IF +#define LOG_ALWAYS_FATAL_IF(cond, ...) \ + ( (__predict_false(cond)) \ + ? ((void)android_printAssert(#cond, LOG_TAG, ## __VA_ARGS__)) \ + : (void)0 ) +#endif + +#ifndef LOG_ALWAYS_FATAL +#define LOG_ALWAYS_FATAL(...) \ + ( ((void)android_printAssert(NULL, LOG_TAG, ## __VA_ARGS__)) ) +#endif + +/* + * Versions of LOG_ALWAYS_FATAL_IF and LOG_ALWAYS_FATAL that + * are stripped out of release builds. + */ +#if LOG_NDEBUG + +#ifndef LOG_FATAL_IF +#define LOG_FATAL_IF(cond, ...) ((void)0) +#endif +#ifndef LOG_FATAL +#define LOG_FATAL(...) ((void)0) +#endif + +#else + +#ifndef LOG_FATAL_IF +#define LOG_FATAL_IF(cond, ...) LOG_ALWAYS_FATAL_IF(cond, ## __VA_ARGS__) +#endif +#ifndef LOG_FATAL +#define LOG_FATAL(...) LOG_ALWAYS_FATAL(__VA_ARGS__) +#endif + +#endif + +/* + * Assertion that generates a log message when the assertion fails. + * Stripped out of release builds. Uses the current LOG_TAG. + */ +#ifndef ALOG_ASSERT +#define ALOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__) +//#define ALOG_ASSERT(cond) LOG_FATAL_IF(!(cond), "Assertion failed: " #cond) +#endif + +// --------------------------------------------------------------------- + +/* + * Basic log message macro. + * + * Example: + * ALOG(LOG_WARN, NULL, "Failed with error %d", errno); + * + * The second argument may be NULL or "" to indicate the "global" tag. + */ +#ifndef ALOG +#define ALOG(priority, tag, ...) \ + LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__) +#endif + +/* + * Log macro that allows you to specify a number for the priority. + */ +#ifndef LOG_PRI +#define LOG_PRI(priority, tag, ...) \ + android_printLog(priority, tag, __VA_ARGS__) +#endif + +/* + * Log macro that allows you to pass in a varargs ("args" is a va_list). + */ +#ifndef LOG_PRI_VA +#define LOG_PRI_VA(priority, tag, fmt, args) \ + android_vprintLog(priority, NULL, tag, fmt, args) +#endif + +/* + * Conditional given a desired logging priority and tag. + */ +#ifndef IF_ALOG +#define IF_ALOG(priority, tag) \ + if (android_testLog(ANDROID_##priority, tag)) +#endif + +// --------------------------------------------------------------------- + +/* + * Event logging. + */ + +/* + * Event log entry types. These must match up with the declarations in + * java/android/android/util/EventLog.java. + */ +typedef enum { + EVENT_TYPE_INT = 0, + EVENT_TYPE_LONG = 1, + EVENT_TYPE_STRING = 2, + EVENT_TYPE_LIST = 3, + EVENT_TYPE_FLOAT = 4, +} AndroidEventLogType; +#define sizeof_AndroidEventLogType sizeof(typeof_AndroidEventLogType) +#define typeof_AndroidEventLogType unsigned char + +#ifndef LOG_EVENT_INT +#define LOG_EVENT_INT(_tag, _value) { \ + int intBuf = _value; \ + (void) android_btWriteLog(_tag, EVENT_TYPE_INT, &intBuf, \ + sizeof(intBuf)); \ + } +#endif +#ifndef LOG_EVENT_LONG +#define LOG_EVENT_LONG(_tag, _value) { \ + long long longBuf = _value; \ + (void) android_btWriteLog(_tag, EVENT_TYPE_LONG, &longBuf, \ + sizeof(longBuf)); \ + } +#endif +#ifndef LOG_EVENT_FLOAT +#define LOG_EVENT_FLOAT(_tag, _value) { \ + float floatBuf = _value; \ + (void) android_btWriteLog(_tag, EVENT_TYPE_FLOAT, &floatBuf, \ + sizeof(floatBuf)); \ + } +#endif +#ifndef LOG_EVENT_STRING +#define LOG_EVENT_STRING(_tag, _value) \ + (void) __android_log_bswrite(_tag, _value); +#endif +/* TODO: something for LIST */ + +/* + * =========================================================================== + * + * The stuff in the rest of this file should not be used directly. + */ + +#define android_printLog(prio, tag, fmt...) \ + __android_log_print(prio, tag, fmt) + +#define android_vprintLog(prio, cond, tag, fmt...) \ + __android_log_vprint(prio, tag, fmt) + +/* XXX Macros to work around syntax errors in places where format string + * arg is not passed to ALOG_ASSERT, LOG_ALWAYS_FATAL or LOG_ALWAYS_FATAL_IF + * (happens only in debug builds). + */ + +/* Returns 2nd arg. Used to substitute default value if caller's vararg list + * is empty. + */ +#define __android_second(dummy, second, ...) second + +/* If passed multiple args, returns ',' followed by all but 1st arg, otherwise + * returns nothing. + */ +#define __android_rest(first, ...) , ## __VA_ARGS__ + +#define android_printAssert(cond, tag, fmt...) \ + __android_log_assert(cond, tag, \ + __android_second(0, ## fmt, NULL) __android_rest(fmt)) + +#define android_writeLog(prio, tag, text) \ + __android_log_write(prio, tag, text) + +#define android_bWriteLog(tag, payload, len) \ + __android_log_bwrite(tag, payload, len) +#define android_btWriteLog(tag, type, payload, len) \ + __android_log_btwrite(tag, type, payload, len) + +#define android_errorWriteLog(tag, subTag) \ + __android_log_error_write(tag, subTag, -1, NULL, 0) + +#define android_errorWriteWithInfoLog(tag, subTag, uid, data, dataLen) \ + __android_log_error_write(tag, subTag, uid, data, dataLen) + +/* + * IF_ALOG uses android_testLog, but IF_ALOG can be overridden. + * android_testLog will remain constant in its purpose as a wrapper + * for Android logging filter policy, and can be subject to + * change. It can be reused by the developers that override + * IF_ALOG as a convenient means to reimplement their policy + * over Android. + */ +#if LOG_NDEBUG /* Production */ +#define android_testLog(prio, tag) \ + (__android_log_is_loggable(prio, tag, ANDROID_LOG_DEBUG) != 0) +#else +#define android_testLog(prio, tag) \ + (__android_log_is_loggable(prio, tag, ANDROID_LOG_VERBOSE) != 0) +#endif + +// TODO: remove these prototypes and their users +#define android_writevLog(vec,num) do{}while(0) +#define android_write1Log(str,len) do{}while (0) +#define android_setMinPriority(tag, prio) do{}while(0) +//#define android_logToCallback(func) do{}while(0) +#define android_logToFile(tag, file) (0) +#define android_logToFd(tag, fd) (0) + +#ifndef log_id_t_defined +#define log_id_t_defined + +typedef enum log_id { + LOG_ID_MIN = 0, + +#ifndef LINT_RLOG + LOG_ID_MAIN = 0, +#endif + LOG_ID_RADIO = 1, +#ifndef LINT_RLOG + LOG_ID_EVENTS = 2, + LOG_ID_SYSTEM = 3, + LOG_ID_CRASH = 4, + LOG_ID_KERNEL = 5, +#endif + + LOG_ID_MAX +} log_id_t; +#endif +#define sizeof_log_id_t sizeof(typeof_log_id_t) +#define typeof_log_id_t unsigned char + +/* + * Use the per-tag properties "log.tag." to generate a runtime + * result of non-zero to expose a log. + */ +int __android_log_is_loggable(int prio, const char *tag, int def); + +int __android_log_error_write(int tag, const char *subTag, int32_t uid, const char *data, + uint32_t dataLen); + +/* + * Send a simple string to the log. + */ +int __android_log_buf_write(int bufID, int prio, const char *tag, const char *text); +int __android_log_buf_print(int bufID, int prio, const char *tag, const char *fmt, ...) +#if defined(__GNUC__) + __attribute__((__format__(printf, 4, 5))) +#endif + ; + +#ifdef __cplusplus +} +#endif + +#endif /* _LIBS_LOG_LOG_H */ diff --git a/third_party/android_system_core/include/log/log_read.h b/third_party/android_system_core/include/log/log_read.h new file mode 100644 index 000000000..1b70affc3 --- /dev/null +++ b/third_party/android_system_core/include/log/log_read.h @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2013-2014 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 _LIBS_LOG_LOG_READ_H +#define _LIBS_LOG_LOG_READ_H + +#include +#include + +/* struct log_time is a wire-format variant of struct timespec */ +#define NS_PER_SEC 1000000000ULL + +#ifdef __cplusplus + +// NB: do NOT define a copy constructor. This will result in structure +// no longer being compatible with pass-by-value which is desired +// efficient behavior. Also, pass-by-reference breaks C/C++ ABI. +struct log_time { +public: + uint32_t tv_sec; // good to Feb 5 2106 + uint32_t tv_nsec; + + static const uint32_t tv_sec_max = 0xFFFFFFFFUL; + static const uint32_t tv_nsec_max = 999999999UL; + + log_time(const timespec &T) + { + tv_sec = T.tv_sec; + tv_nsec = T.tv_nsec; + } + log_time(uint32_t sec, uint32_t nsec) + { + tv_sec = sec; + tv_nsec = nsec; + } + static const timespec EPOCH; + log_time() + { + } + log_time(clockid_t id) + { + timespec T; + clock_gettime(id, &T); + tv_sec = T.tv_sec; + tv_nsec = T.tv_nsec; + } + log_time(const char *T) + { + const uint8_t *c = (const uint8_t *) T; + tv_sec = c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24); + tv_nsec = c[4] | (c[5] << 8) | (c[6] << 16) | (c[7] << 24); + } + + // timespec + bool operator== (const timespec &T) const + { + return (tv_sec == static_cast(T.tv_sec)) + && (tv_nsec == static_cast(T.tv_nsec)); + } + bool operator!= (const timespec &T) const + { + return !(*this == T); + } + bool operator< (const timespec &T) const + { + return (tv_sec < static_cast(T.tv_sec)) + || ((tv_sec == static_cast(T.tv_sec)) + && (tv_nsec < static_cast(T.tv_nsec))); + } + bool operator>= (const timespec &T) const + { + return !(*this < T); + } + bool operator> (const timespec &T) const + { + return (tv_sec > static_cast(T.tv_sec)) + || ((tv_sec == static_cast(T.tv_sec)) + && (tv_nsec > static_cast(T.tv_nsec))); + } + bool operator<= (const timespec &T) const + { + return !(*this > T); + } + log_time operator-= (const timespec &T); + log_time operator- (const timespec &T) const + { + log_time local(*this); + return local -= T; + } + log_time operator+= (const timespec &T); + log_time operator+ (const timespec &T) const + { + log_time local(*this); + return local += T; + } + + // log_time + bool operator== (const log_time &T) const + { + return (tv_sec == T.tv_sec) && (tv_nsec == T.tv_nsec); + } + bool operator!= (const log_time &T) const + { + return !(*this == T); + } + bool operator< (const log_time &T) const + { + return (tv_sec < T.tv_sec) + || ((tv_sec == T.tv_sec) && (tv_nsec < T.tv_nsec)); + } + bool operator>= (const log_time &T) const + { + return !(*this < T); + } + bool operator> (const log_time &T) const + { + return (tv_sec > T.tv_sec) + || ((tv_sec == T.tv_sec) && (tv_nsec > T.tv_nsec)); + } + bool operator<= (const log_time &T) const + { + return !(*this > T); + } + log_time operator-= (const log_time &T); + log_time operator- (const log_time &T) const + { + log_time local(*this); + return local -= T; + } + log_time operator+= (const log_time &T); + log_time operator+ (const log_time &T) const + { + log_time local(*this); + return local += T; + } + + uint64_t nsec() const + { + return static_cast(tv_sec) * NS_PER_SEC + tv_nsec; + } + + static const char default_format[]; + + // Add %#q for the fraction of a second to the standard library functions + char *strptime(const char *s, const char *format = default_format); +} __attribute__((__packed__)); + +#else + +typedef struct log_time { + uint32_t tv_sec; + uint32_t tv_nsec; +} __attribute__((__packed__)) log_time; + +#endif + +#endif /* define _LIBS_LOG_LOG_READ_H */ diff --git a/third_party/android_system_core/include/log/logd.h b/third_party/android_system_core/include/log/logd.h new file mode 100644 index 000000000..0fe515f2a --- /dev/null +++ b/third_party/android_system_core/include/log/logd.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2009 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_CUTILS_LOGD_H +#define _ANDROID_CUTILS_LOGD_H + +/* the stable/frozen log-related definitions have been + * moved to this header, which is exposed by the NDK + */ +#include + +/* the rest is only used internally by the system */ +#if !defined(_WIN32) +#include +#endif +#include +#include +#include +#include +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +int __android_log_bwrite(int32_t tag, const void *payload, size_t len); +int __android_log_btwrite(int32_t tag, char type, const void *payload, + size_t len); +int __android_log_bswrite(int32_t tag, const char *payload); + +#ifdef __cplusplus +} +#endif + +#endif /* _LOGD_H */ diff --git a/third_party/android_system_core/include/log/logger.h b/third_party/android_system_core/include/log/logger.h new file mode 100644 index 000000000..f030dab5a --- /dev/null +++ b/third_party/android_system_core/include/log/logger.h @@ -0,0 +1,196 @@ +/* +** +** Copyright 2007-2014, The Android Open Source Project +** +** This file is dual licensed. It may be redistributed and/or modified +** under the terms of the Apache 2.0 License OR version 2 of the GNU +** General Public License. +*/ + +#ifndef _LIBS_LOG_LOGGER_H +#define _LIBS_LOG_LOGGER_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The userspace structure for version 1 of the logger_entry ABI. + * This structure is returned to userspace by the kernel logger + * driver unless an upgrade to a newer ABI version is requested. + */ +struct logger_entry { + uint16_t len; /* length of the payload */ + uint16_t __pad; /* no matter what, we get 2 bytes of padding */ + int32_t pid; /* generating process's pid */ + int32_t tid; /* generating process's tid */ + int32_t sec; /* seconds since Epoch */ + int32_t nsec; /* nanoseconds */ + char msg[0]; /* the entry's payload */ +} __attribute__((__packed__)); + +/* + * The userspace structure for version 2 of the logger_entry ABI. + * This structure is returned to userspace if ioctl(LOGGER_SET_VERSION) + * is called with version==2; or used with the user space log daemon. + */ +struct logger_entry_v2 { + uint16_t len; /* length of the payload */ + uint16_t hdr_size; /* sizeof(struct logger_entry_v2) */ + int32_t pid; /* generating process's pid */ + int32_t tid; /* generating process's tid */ + int32_t sec; /* seconds since Epoch */ + int32_t nsec; /* nanoseconds */ + uint32_t euid; /* effective UID of logger */ + char msg[0]; /* the entry's payload */ +} __attribute__((__packed__)); + +struct logger_entry_v3 { + uint16_t len; /* length of the payload */ + uint16_t hdr_size; /* sizeof(struct logger_entry_v3) */ + int32_t pid; /* generating process's pid */ + int32_t tid; /* generating process's tid */ + int32_t sec; /* seconds since Epoch */ + int32_t nsec; /* nanoseconds */ + uint32_t lid; /* log id of the payload */ + char msg[0]; /* the entry's payload */ +} __attribute__((__packed__)); + +/* + * The maximum size of the log entry payload that can be + * written to the logger. An attempt to write more than + * this amount will result in a truncated log entry. + */ +#define LOGGER_ENTRY_MAX_PAYLOAD 4076 + +/* + * The maximum size of a log entry which can be read from the + * kernel logger driver. An attempt to read less than this amount + * may result in read() returning EINVAL. + */ +#define LOGGER_ENTRY_MAX_LEN (5*1024) + +#define NS_PER_SEC 1000000000ULL + +struct log_msg { + union { + unsigned char buf[LOGGER_ENTRY_MAX_LEN + 1]; + struct logger_entry_v3 entry; + struct logger_entry_v3 entry_v3; + struct logger_entry_v2 entry_v2; + struct logger_entry entry_v1; + } __attribute__((aligned(4))); +#ifdef __cplusplus + /* Matching log_time operators */ + bool operator== (const log_msg &T) const + { + return (entry.sec == T.entry.sec) && (entry.nsec == T.entry.nsec); + } + bool operator!= (const log_msg &T) const + { + return !(*this == T); + } + bool operator< (const log_msg &T) const + { + return (entry.sec < T.entry.sec) + || ((entry.sec == T.entry.sec) + && (entry.nsec < T.entry.nsec)); + } + bool operator>= (const log_msg &T) const + { + return !(*this < T); + } + bool operator> (const log_msg &T) const + { + return (entry.sec > T.entry.sec) + || ((entry.sec == T.entry.sec) + && (entry.nsec > T.entry.nsec)); + } + bool operator<= (const log_msg &T) const + { + return !(*this > T); + } + uint64_t nsec() const + { + return static_cast(entry.sec) * NS_PER_SEC + entry.nsec; + } + + /* packet methods */ + log_id_t id() + { + return (log_id_t) entry.lid; + } + char *msg() + { + return entry.hdr_size ? (char *) buf + entry.hdr_size : entry_v1.msg; + } + unsigned int len() + { + return (entry.hdr_size ? entry.hdr_size : sizeof(entry_v1)) + entry.len; + } +#endif +}; + +struct logger; + +log_id_t android_logger_get_id(struct logger *logger); + +int android_logger_clear(struct logger *logger); +long android_logger_get_log_size(struct logger *logger); +int android_logger_set_log_size(struct logger *logger, unsigned long size); +long android_logger_get_log_readable_size(struct logger *logger); +int android_logger_get_log_version(struct logger *logger); + +struct logger_list; + +ssize_t android_logger_get_statistics(struct logger_list *logger_list, + char *buf, size_t len); +ssize_t android_logger_get_prune_list(struct logger_list *logger_list, + char *buf, size_t len); +int android_logger_set_prune_list(struct logger_list *logger_list, + char *buf, size_t len); + +#define ANDROID_LOG_RDONLY O_RDONLY +#define ANDROID_LOG_WRONLY O_WRONLY +#define ANDROID_LOG_RDWR O_RDWR +#define ANDROID_LOG_ACCMODE O_ACCMODE +#define ANDROID_LOG_NONBLOCK O_NONBLOCK +#define ANDROID_LOG_PSTORE 0x80000000 + +struct logger_list *android_logger_list_alloc(int mode, + unsigned int tail, + pid_t pid); +struct logger_list *android_logger_list_alloc_time(int mode, + log_time start, + pid_t pid); +void android_logger_list_free(struct logger_list *logger_list); +/* In the purest sense, the following two are orthogonal interfaces */ +int android_logger_list_read(struct logger_list *logger_list, + struct log_msg *log_msg); + +/* Multiple log_id_t opens */ +struct logger *android_logger_open(struct logger_list *logger_list, + log_id_t id); +#define android_logger_close android_logger_free +/* Single log_id_t open */ +struct logger_list *android_logger_list_open(log_id_t id, + int mode, + unsigned int tail, + pid_t pid); +#define android_logger_list_close android_logger_list_free + +/* + * log_id_t helpers + */ +log_id_t android_name_to_log_id(const char *logName); +const char *android_log_id_to_name(log_id_t log_id); + +#ifdef __cplusplus +} +#endif + +#endif /* _LIBS_LOG_LOGGER_H */ diff --git a/third_party/android_system_core/include/log/logprint.h b/third_party/android_system_core/include/log/logprint.h new file mode 100644 index 000000000..4b812cc94 --- /dev/null +++ b/third_party/android_system_core/include/log/logprint.h @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2006 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 _LOGPRINT_H +#define _LOGPRINT_H + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + FORMAT_OFF = 0, + FORMAT_BRIEF, + FORMAT_PROCESS, + FORMAT_TAG, + FORMAT_THREAD, + FORMAT_RAW, + FORMAT_TIME, + FORMAT_THREADTIME, + FORMAT_LONG, + /* The following three are modifiers to above formats */ + FORMAT_MODIFIER_COLOR, /* converts priority to color */ + FORMAT_MODIFIER_TIME_USEC, /* switches from msec to usec time precision */ + FORMAT_MODIFIER_PRINTABLE, /* converts non-printable to printable escapes */ +} AndroidLogPrintFormat; + +typedef struct AndroidLogFormat_t AndroidLogFormat; + +typedef struct AndroidLogEntry_t { + time_t tv_sec; + long tv_nsec; + android_LogPriority priority; + int32_t pid; + int32_t tid; + const char * tag; + size_t messageLen; + const char * message; +} AndroidLogEntry; + +AndroidLogFormat *android_log_format_new(); + +void android_log_format_free(AndroidLogFormat *p_format); + +/* currently returns 0 if format is a modifier, 1 if not */ +int android_log_setPrintFormat(AndroidLogFormat *p_format, + AndroidLogPrintFormat format); + +/** + * Returns FORMAT_OFF on invalid string + */ +AndroidLogPrintFormat android_log_formatFromString(const char *s); + +/** + * filterExpression: a single filter expression + * eg "AT:d" + * + * returns 0 on success and -1 on invalid expression + * + * Assumes single threaded execution + * + */ + +int android_log_addFilterRule(AndroidLogFormat *p_format, + const char *filterExpression); + + +/** + * filterString: a whitespace-separated set of filter expressions + * eg "AT:d *:i" + * + * returns 0 on success and -1 on invalid expression + * + * Assumes single threaded execution + * + */ + +int android_log_addFilterString(AndroidLogFormat *p_format, + const char *filterString); + + +/** + * returns 1 if this log line should be printed based on its priority + * and tag, and 0 if it should not + */ +int android_log_shouldPrintLine ( + AndroidLogFormat *p_format, const char *tag, android_LogPriority pri); + + +/** + * Splits a wire-format buffer into an AndroidLogEntry + * entry allocated by caller. Pointers will point directly into buf + * + * Returns 0 on success and -1 on invalid wire format (entry will be + * in unspecified state) + */ +int android_log_processLogBuffer(struct logger_entry *buf, + AndroidLogEntry *entry); + +/** + * Like android_log_processLogBuffer, but for binary logs. + * + * If "map" is non-NULL, it will be used to convert the log tag number + * into a string. + */ +int android_log_processBinaryLogBuffer(struct logger_entry *buf, + AndroidLogEntry *entry, const EventTagMap* map, char* messageBuf, + int messageBufLen); + + +/** + * Formats a log message into a buffer + * + * Uses defaultBuffer if it can, otherwise malloc()'s a new buffer + * If return value != defaultBuffer, caller must call free() + * Returns NULL on malloc error + */ + +char *android_log_formatLogLine ( + AndroidLogFormat *p_format, + char *defaultBuffer, + size_t defaultBufferSize, + const AndroidLogEntry *p_line, + size_t *p_outLength); + + +/** + * Either print or do not print log line, based on filter + * + * Assumes single threaded execution + * + */ +int android_log_printLogLine( + AndroidLogFormat *p_format, + int fd, + const AndroidLogEntry *entry); + + +#ifdef __cplusplus +} +#endif + + +#endif /*_LOGPRINT_H*/ diff --git a/third_party/android_system_core/include/log/uio.h b/third_party/android_system_core/include/log/uio.h new file mode 100644 index 000000000..7059da5f7 --- /dev/null +++ b/third_party/android_system_core/include/log/uio.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2007-2014 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 _LIBS_CUTILS_UIO_H +#define _LIBS_CUTILS_UIO_H + +#if !defined(_WIN32) + +#include + +#else + +#ifdef __cplusplus +extern "C" { +#endif + +// +// Implementation of sys/uio.h for Win32. +// + +#include + +struct iovec { + void* iov_base; + size_t iov_len; +}; + +extern int readv( int fd, struct iovec* vecs, int count ); +extern int writev( int fd, const struct iovec* vecs, int count ); + +#ifdef __cplusplus +} +#endif + +#endif + +#endif /* _LIBS_UTILS_UIO_H */ + diff --git a/third_party/android_system_core/include/system/camera.h b/third_party/android_system_core/include/system/camera.h new file mode 100644 index 000000000..0570ca04c --- /dev/null +++ b/third_party/android_system_core/include/system/camera.h @@ -0,0 +1,365 @@ +/* + * 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 SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H +#define SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H + +#include +#include +#include +#include +#include +#include + +__BEGIN_DECLS + +/** + * A set of bit masks for specifying how the received preview frames are + * handled before the previewCallback() call. + * + * The least significant 3 bits of an "int" value are used for this purpose: + * + * ..... 0 0 0 + * ^ ^ ^ + * | | |---------> determine whether the callback is enabled or not + * | |-----------> determine whether the callback is one-shot or not + * |-------------> determine whether the frame is copied out or not + * + * WARNING: When a frame is sent directly without copying, it is the frame + * receiver's responsiblity to make sure that the frame data won't get + * corrupted by subsequent preview frames filled by the camera. This flag is + * recommended only when copying out data brings significant performance price + * and the handling/processing of the received frame data is always faster than + * the preview frame rate so that data corruption won't occur. + * + * For instance, + * 1. 0x00 disables the callback. In this case, copy out and one shot bits + * are ignored. + * 2. 0x01 enables a callback without copying out the received frames. A + * typical use case is the Camcorder application to avoid making costly + * frame copies. + * 3. 0x05 is enabling a callback with frame copied out repeatedly. A typical + * use case is the Camera application. + * 4. 0x07 is enabling a callback with frame copied out only once. A typical + * use case is the Barcode scanner application. + */ + +enum { + CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK = 0x01, + CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK = 0x02, + CAMERA_FRAME_CALLBACK_FLAG_COPY_OUT_MASK = 0x04, + /** Typical use cases */ + CAMERA_FRAME_CALLBACK_FLAG_NOOP = 0x00, + CAMERA_FRAME_CALLBACK_FLAG_CAMCORDER = 0x01, + CAMERA_FRAME_CALLBACK_FLAG_CAMERA = 0x05, + CAMERA_FRAME_CALLBACK_FLAG_BARCODE_SCANNER = 0x07 +}; + +/** msgType in notifyCallback and dataCallback functions */ +enum { + CAMERA_MSG_ERROR = 0x0001, // notifyCallback + CAMERA_MSG_SHUTTER = 0x0002, // notifyCallback + CAMERA_MSG_FOCUS = 0x0004, // notifyCallback + CAMERA_MSG_ZOOM = 0x0008, // notifyCallback + CAMERA_MSG_PREVIEW_FRAME = 0x0010, // dataCallback + CAMERA_MSG_VIDEO_FRAME = 0x0020, // data_timestamp_callback + CAMERA_MSG_POSTVIEW_FRAME = 0x0040, // dataCallback + CAMERA_MSG_RAW_IMAGE = 0x0080, // dataCallback + CAMERA_MSG_COMPRESSED_IMAGE = 0x0100, // dataCallback + CAMERA_MSG_RAW_IMAGE_NOTIFY = 0x0200, // dataCallback + // Preview frame metadata. This can be combined with + // CAMERA_MSG_PREVIEW_FRAME in dataCallback. For example, the apps can + // request FRAME and METADATA. Or the apps can request only FRAME or only + // METADATA. + CAMERA_MSG_PREVIEW_METADATA = 0x0400, // dataCallback + // Notify on autofocus start and stop. This is useful in continuous + // autofocus - FOCUS_MODE_CONTINUOUS_VIDEO and FOCUS_MODE_CONTINUOUS_PICTURE. + CAMERA_MSG_FOCUS_MOVE = 0x0800, // notifyCallback + CAMERA_MSG_VENDOR_START = 0x1000, + CAMERA_MSG_STATS_DATA = CAMERA_MSG_VENDOR_START, + CAMERA_MSG_META_DATA = 0x2000, + CAMERA_MSG_VENDOR_END = 0x8000, + CAMERA_MSG_ALL_MSGS = 0xFFFF +}; + +/** meta data type in CameraMetaDataCallback */ +enum { + CAMERA_META_DATA_ASD = 0x001, //ASD data + CAMERA_META_DATA_FD = 0x002, //FD/FP data + CAMERA_META_DATA_HDR = 0x003, //Auto HDR data +}; + +/** cmdType in sendCommand functions */ +enum { + CAMERA_CMD_START_SMOOTH_ZOOM = 1, + CAMERA_CMD_STOP_SMOOTH_ZOOM = 2, + + /** + * Set the clockwise rotation of preview display (setPreviewDisplay) in + * degrees. This affects the preview frames and the picture displayed after + * snapshot. This method is useful for portrait mode applications. Note + * that preview display of front-facing cameras is flipped horizontally + * before the rotation, that is, the image is reflected along the central + * vertical axis of the camera sensor. So the users can see themselves as + * looking into a mirror. + * + * This does not affect the order of byte array of + * CAMERA_MSG_PREVIEW_FRAME, CAMERA_MSG_VIDEO_FRAME, + * CAMERA_MSG_POSTVIEW_FRAME, CAMERA_MSG_RAW_IMAGE, or + * CAMERA_MSG_COMPRESSED_IMAGE. This is allowed to be set during preview + * since API level 14. + */ + CAMERA_CMD_SET_DISPLAY_ORIENTATION = 3, + + /** + * cmdType to disable/enable shutter sound. In sendCommand passing arg1 = + * 0 will disable, while passing arg1 = 1 will enable the shutter sound. + */ + CAMERA_CMD_ENABLE_SHUTTER_SOUND = 4, + + /* cmdType to play recording sound */ + CAMERA_CMD_PLAY_RECORDING_SOUND = 5, + + /** + * Start the face detection. This should be called after preview is started. + * The camera will notify the listener of CAMERA_MSG_FACE and the detected + * faces in the preview frame. The detected faces may be the same as the + * previous ones. Apps should call CAMERA_CMD_STOP_FACE_DETECTION to stop + * the face detection. This method is supported if CameraParameters + * KEY_MAX_NUM_HW_DETECTED_FACES or KEY_MAX_NUM_SW_DETECTED_FACES is + * bigger than 0. Hardware and software face detection should not be running + * at the same time. If the face detection has started, apps should not send + * this again. + * + * In hardware face detection mode, CameraParameters KEY_WHITE_BALANCE, + * KEY_FOCUS_AREAS and KEY_METERING_AREAS have no effect. + * + * arg1 is the face detection type. It can be CAMERA_FACE_DETECTION_HW or + * CAMERA_FACE_DETECTION_SW. If the type of face detection requested is not + * supported, the HAL must return BAD_VALUE. + */ + CAMERA_CMD_START_FACE_DETECTION = 6, + + /** + * Stop the face detection. + */ + CAMERA_CMD_STOP_FACE_DETECTION = 7, + + /** + * Enable/disable focus move callback (CAMERA_MSG_FOCUS_MOVE). Passing + * arg1 = 0 will disable, while passing arg1 = 1 will enable the callback. + */ + CAMERA_CMD_ENABLE_FOCUS_MOVE_MSG = 8, + + /** + * Ping camera service to see if camera hardware is released. + * + * When any camera method returns error, the client can use ping command + * to see if the camera has been taken away by other clients. If the result + * is NO_ERROR, it means the camera hardware is not released. If the result + * is not NO_ERROR, the camera has been released and the existing client + * can silently finish itself or show a dialog. + */ + CAMERA_CMD_PING = 9, + + /** + * Configure the number of video buffers used for recording. The intended + * video buffer count for recording is passed as arg1, which must be + * greater than 0. This command must be sent before recording is started. + * This command returns INVALID_OPERATION error if it is sent after video + * recording is started, or the command is not supported at all. This + * command also returns a BAD_VALUE error if the intended video buffer + * count is non-positive or too big to be realized. + */ + CAMERA_CMD_SET_VIDEO_BUFFER_COUNT = 10, + + /** + * Configure an explicit format to use for video recording metadata mode. + * This can be used to switch the format from the + * default IMPLEMENTATION_DEFINED gralloc format to some other + * device-supported format, and the default dataspace from the BT_709 color + * space to some other device-supported dataspace. arg1 is the HAL pixel + * format, and arg2 is the HAL dataSpace. This command returns + * INVALID_OPERATION error if it is sent after video recording is started, + * or the command is not supported at all. + * + * If the gralloc format is set to a format other than + * IMPLEMENTATION_DEFINED, then HALv3 devices will use gralloc usage flags + * of SW_READ_OFTEN. + */ +#ifndef CAMERA_VENDOR_L_COMPAT + CAMERA_CMD_SET_VIDEO_FORMAT = 11, + + CAMERA_CMD_VENDOR_START = 20, + /** + * Commands to enable/disable preview histogram + * + * Based on user's input to enable/disable histogram from the camera + * UI, send the appropriate command to the HAL to turn on/off the histogram + * stats and start sending the data to the application. + */ + CAMERA_CMD_HISTOGRAM_ON = CAMERA_CMD_VENDOR_START, + CAMERA_CMD_HISTOGRAM_OFF = CAMERA_CMD_VENDOR_START + 1, + CAMERA_CMD_HISTOGRAM_SEND_DATA = CAMERA_CMD_VENDOR_START + 2, + CAMERA_CMD_LONGSHOT_ON = CAMERA_CMD_VENDOR_START + 3, + CAMERA_CMD_LONGSHOT_OFF = CAMERA_CMD_VENDOR_START + 4, + CAMERA_CMD_STOP_LONGSHOT = CAMERA_CMD_VENDOR_START + 5, + CAMERA_CMD_METADATA_ON = CAMERA_CMD_VENDOR_START + 6, + CAMERA_CMD_METADATA_OFF = CAMERA_CMD_VENDOR_START + 7, + CAMERA_CMD_VENDOR_END = 200, +#else + + /** + * Values used by older HALs, provided as an option for compatibility + */ + CAMERA_CMD_HISTOGRAM_ON = 11, + CAMERA_CMD_HISTOGRAM_OFF = 12, + CAMERA_CMD_HISTOGRAM_SEND_DATA = 13, + CAMERA_CMD_LONGSHOT_ON = 14, + CAMERA_CMD_LONGSHOT_OFF = 15, + CAMERA_CMD_STOP_LONGSHOT = 16, + CAMERA_CMD_METADATA_ON = 100, + CAMERA_CMD_METADATA_OFF = 101, + CAMERA_CMD_SET_VIDEO_FORMAT = 102, +#endif +}; + +/** camera fatal errors */ +enum { + CAMERA_ERROR_UNKNOWN = 1, + /** + * Camera was released because another client has connected to the camera. + * The original client should call Camera::disconnect immediately after + * getting this notification. Otherwise, the camera will be released by + * camera service in a short time. The client should not call any method + * (except disconnect and sending CAMERA_CMD_PING) after getting this. + */ + CAMERA_ERROR_RELEASED = 2, + CAMERA_ERROR_SERVER_DIED = 100 +}; + +enum { + /** The facing of the camera is opposite to that of the screen. */ + CAMERA_FACING_BACK = 0, + /** The facing of the camera is the same as that of the screen. */ + CAMERA_FACING_FRONT = 1, + /** + * The facing of the camera is not fixed relative to the screen. + * The cameras with this facing are external cameras, e.g. USB cameras. + */ + CAMERA_FACING_EXTERNAL = 2 +}; + +enum { + /** Hardware face detection. It does not use much CPU. */ + CAMERA_FACE_DETECTION_HW = 0, + /** + * Software face detection. It uses some CPU. Applications must use + * Camera.setPreviewTexture for preview in this mode. + */ + CAMERA_FACE_DETECTION_SW = 1 +}; + +/** + * The information of a face from camera face detection. + */ +typedef struct camera_face { + /** + * Bounds of the face [left, top, right, bottom]. (-1000, -1000) represents + * the top-left of the camera field of view, and (1000, 1000) represents the + * bottom-right of the field of view. The width and height cannot be 0 or + * negative. This is supported by both hardware and software face detection. + * + * The direction is relative to the sensor orientation, that is, what the + * sensor sees. The direction is not affected by the rotation or mirroring + * of CAMERA_CMD_SET_DISPLAY_ORIENTATION. + */ + int32_t rect[4]; + + /** + * The confidence level of the face. The range is 1 to 100. 100 is the + * highest confidence. This is supported by both hardware and software + * face detection. + */ + int32_t score; + + /** + * An unique id per face while the face is visible to the tracker. If + * the face leaves the field-of-view and comes back, it will get a new + * id. If the value is 0, id is not supported. + */ + int32_t id; + + /** + * The coordinates of the center of the left eye. The range is -1000 to + * 1000. -2000, -2000 if this is not supported. + */ + int32_t left_eye[2]; + + /** + * The coordinates of the center of the right eye. The range is -1000 to + * 1000. -2000, -2000 if this is not supported. + */ + int32_t right_eye[2]; + + /** + * The coordinates of the center of the mouth. The range is -1000 to 1000. + * -2000, -2000 if this is not supported. + */ + int32_t mouth[2]; + int32_t smile_degree; + int32_t smile_score; + int32_t blink_detected; + int32_t face_recognised; + int32_t gaze_angle; + int32_t updown_dir; + int32_t leftright_dir; + int32_t roll_dir; + int32_t left_right_gaze; + int32_t top_bottom_gaze; + int32_t leye_blink; + int32_t reye_blink; + +} camera_face_t; + +/** + * The information of a data type received in a camera frame. + */ +typedef enum { + /** Data buffer */ + CAMERA_FRAME_DATA_BUF = 0x000, + /** File descriptor */ + CAMERA_FRAME_DATA_FD = 0x100 +} camera_frame_data_type_t; + +/** + * The metadata of the frame data. + */ +typedef struct camera_frame_metadata { + /** + * The number of detected faces in the frame. + */ + int32_t number_of_faces; + + /** + * An array of the detected faces. The length is number_of_faces. + */ + camera_face_t *faces; +} camera_frame_metadata_t; + +__END_DECLS + +#endif /* SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H */ diff --git a/third_party/android_system_core/include/system/graphics.h b/third_party/android_system_core/include/system/graphics.h new file mode 100644 index 000000000..afd9f7bdb --- /dev/null +++ b/third_party/android_system_core/include/system/graphics.h @@ -0,0 +1,763 @@ +/* + * 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 SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H +#define SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * If the HAL needs to create service threads to handle graphics related + * tasks, these threads need to run at HAL_PRIORITY_URGENT_DISPLAY priority + * if they can block the main rendering thread in any way. + * + * the priority of the current thread can be set with: + * + * #include + * setpriority(PRIO_PROCESS, 0, HAL_PRIORITY_URGENT_DISPLAY); + * + */ + +#define HAL_PRIORITY_URGENT_DISPLAY (-8) + +/** + * pixel format definitions + */ + +enum { + /* + * "linear" color pixel formats: + * + * When used with ANativeWindow, the dataSpace field describes the color + * space of the buffer. + * + * The color space determines, for example, if the formats are linear or + * gamma-corrected; or whether any special operations are performed when + * reading or writing into a buffer in one of these formats. + */ + HAL_PIXEL_FORMAT_RGBA_8888 = 1, + HAL_PIXEL_FORMAT_RGBX_8888 = 2, + HAL_PIXEL_FORMAT_RGB_888 = 3, + HAL_PIXEL_FORMAT_RGB_565 = 4, + HAL_PIXEL_FORMAT_BGRA_8888 = 5, + + /* + * 0x100 - 0x1FF + * + * This range is reserved for pixel formats that are specific to the HAL + * implementation. Implementations can use any value in this range to + * communicate video pixel formats between their HAL modules. These formats + * must not have an alpha channel. Additionally, an EGLimage created from a + * gralloc buffer of one of these formats must be supported for use with the + * GL_OES_EGL_image_external OpenGL ES extension. + */ + + /* + * Android YUV format: + * + * This format is exposed outside of the HAL to software decoders and + * applications. EGLImageKHR must support it in conjunction with the + * OES_EGL_image_external extension. + * + * YV12 is a 4:2:0 YCrCb planar format comprised of a WxH Y plane followed + * by (W/2) x (H/2) Cr and Cb planes. + * + * This format assumes + * - an even width + * - an even height + * - a horizontal stride multiple of 16 pixels + * - a vertical stride equal to the height + * + * y_size = stride * height + * c_stride = ALIGN(stride/2, 16) + * c_size = c_stride * height/2 + * size = y_size + c_size * 2 + * cr_offset = y_size + * cb_offset = y_size + c_size + * + * When used with ANativeWindow, the dataSpace field describes the color + * space of the buffer. + */ + HAL_PIXEL_FORMAT_YV12 = 0x32315659, // YCrCb 4:2:0 Planar + + + /* + * Android Y8 format: + * + * This format is exposed outside of the HAL to the framework. + * The expected gralloc usage flags are SW_* and HW_CAMERA_*, + * and no other HW_ flags will be used. + * + * Y8 is a YUV planar format comprised of a WxH Y plane, + * with each pixel being represented by 8 bits. + * + * It is equivalent to just the Y plane from YV12. + * + * This format assumes + * - an even width + * - an even height + * - a horizontal stride multiple of 16 pixels + * - a vertical stride equal to the height + * + * size = stride * height + * + * When used with ANativeWindow, the dataSpace field describes the color + * space of the buffer. + */ + HAL_PIXEL_FORMAT_Y8 = 0x20203859, + + /* + * Android Y16 format: + * + * This format is exposed outside of the HAL to the framework. + * The expected gralloc usage flags are SW_* and HW_CAMERA_*, + * and no other HW_ flags will be used. + * + * Y16 is a YUV planar format comprised of a WxH Y plane, + * with each pixel being represented by 16 bits. + * + * It is just like Y8, but has double the bits per pixel (little endian). + * + * This format assumes + * - an even width + * - an even height + * - a horizontal stride multiple of 16 pixels + * - a vertical stride equal to the height + * - strides are specified in pixels, not in bytes + * + * size = stride * height * 2 + * + * When used with ANativeWindow, the dataSpace field describes the color + * space of the buffer, except that dataSpace field + * HAL_DATASPACE_DEPTH indicates that this buffer contains a depth + * image where each sample is a distance value measured by a depth camera, + * plus an associated confidence value. + */ + HAL_PIXEL_FORMAT_Y16 = 0x20363159, + + /* + * Android RAW sensor format: + * + * This format is exposed outside of the camera HAL to applications. + * + * RAW16 is a single-channel, 16-bit, little endian format, typically + * representing raw Bayer-pattern images from an image sensor, with minimal + * processing. + * + * The exact pixel layout of the data in the buffer is sensor-dependent, and + * needs to be queried from the camera device. + * + * Generally, not all 16 bits are used; more common values are 10 or 12 + * bits. If not all bits are used, the lower-order bits are filled first. + * All parameters to interpret the raw data (black and white points, + * color space, etc) must be queried from the camera device. + * + * This format assumes + * - an even width + * - an even height + * - a horizontal stride multiple of 16 pixels + * - a vertical stride equal to the height + * - strides are specified in pixels, not in bytes + * + * size = stride * height * 2 + * + * This format must be accepted by the gralloc module when used with the + * following usage flags: + * - GRALLOC_USAGE_HW_CAMERA_* + * - GRALLOC_USAGE_SW_* + * - GRALLOC_USAGE_RENDERSCRIPT + * + * When used with ANativeWindow, the dataSpace should be + * HAL_DATASPACE_ARBITRARY, as raw image sensor buffers require substantial + * extra metadata to define. + */ + HAL_PIXEL_FORMAT_RAW16 = 0x20, + + /* + * Android RAW10 format: + * + * This format is exposed outside of the camera HAL to applications. + * + * RAW10 is a single-channel, 10-bit per pixel, densely packed in each row, + * unprocessed format, usually representing raw Bayer-pattern images coming from + * an image sensor. + * + * In an image buffer with this format, starting from the first pixel of each + * row, each 4 consecutive pixels are packed into 5 bytes (40 bits). Each one + * of the first 4 bytes contains the top 8 bits of each pixel, The fifth byte + * contains the 2 least significant bits of the 4 pixels, the exact layout data + * for each 4 consecutive pixels is illustrated below (Pi[j] stands for the jth + * bit of the ith pixel): + * + * bit 7 bit 0 + * =====|=====|=====|=====|=====|=====|=====|=====| + * Byte 0: |P0[9]|P0[8]|P0[7]|P0[6]|P0[5]|P0[4]|P0[3]|P0[2]| + * |-----|-----|-----|-----|-----|-----|-----|-----| + * Byte 1: |P1[9]|P1[8]|P1[7]|P1[6]|P1[5]|P1[4]|P1[3]|P1[2]| + * |-----|-----|-----|-----|-----|-----|-----|-----| + * Byte 2: |P2[9]|P2[8]|P2[7]|P2[6]|P2[5]|P2[4]|P2[3]|P2[2]| + * |-----|-----|-----|-----|-----|-----|-----|-----| + * Byte 3: |P3[9]|P3[8]|P3[7]|P3[6]|P3[5]|P3[4]|P3[3]|P3[2]| + * |-----|-----|-----|-----|-----|-----|-----|-----| + * Byte 4: |P3[1]|P3[0]|P2[1]|P2[0]|P1[1]|P1[0]|P0[1]|P0[0]| + * =============================================== + * + * This format assumes + * - a width multiple of 4 pixels + * - an even height + * - a vertical stride equal to the height + * - strides are specified in bytes, not in pixels + * + * size = stride * height + * + * When stride is equal to width * (10 / 8), there will be no padding bytes at + * the end of each row, the entire image data is densely packed. When stride is + * larger than width * (10 / 8), padding bytes will be present at the end of each + * row (including the last row). + * + * This format must be accepted by the gralloc module when used with the + * following usage flags: + * - GRALLOC_USAGE_HW_CAMERA_* + * - GRALLOC_USAGE_SW_* + * - GRALLOC_USAGE_RENDERSCRIPT + * + * When used with ANativeWindow, the dataSpace field should be + * HAL_DATASPACE_ARBITRARY, as raw image sensor buffers require substantial + * extra metadata to define. + */ + HAL_PIXEL_FORMAT_RAW10 = 0x25, + + /* + * Android RAW12 format: + * + * This format is exposed outside of camera HAL to applications. + * + * RAW12 is a single-channel, 12-bit per pixel, densely packed in each row, + * unprocessed format, usually representing raw Bayer-pattern images coming from + * an image sensor. + * + * In an image buffer with this format, starting from the first pixel of each + * row, each two consecutive pixels are packed into 3 bytes (24 bits). The first + * and second byte contains the top 8 bits of first and second pixel. The third + * byte contains the 4 least significant bits of the two pixels, the exact layout + * data for each two consecutive pixels is illustrated below (Pi[j] stands for + * the jth bit of the ith pixel): + * + * bit 7 bit 0 + * ======|======|======|======|======|======|======|======| + * Byte 0: |P0[11]|P0[10]|P0[ 9]|P0[ 8]|P0[ 7]|P0[ 6]|P0[ 5]|P0[ 4]| + * |------|------|------|------|------|------|------|------| + * Byte 1: |P1[11]|P1[10]|P1[ 9]|P1[ 8]|P1[ 7]|P1[ 6]|P1[ 5]|P1[ 4]| + * |------|------|------|------|------|------|------|------| + * Byte 2: |P1[ 3]|P1[ 2]|P1[ 1]|P1[ 0]|P0[ 3]|P0[ 2]|P0[ 1]|P0[ 0]| + * ======================================================= + * + * This format assumes: + * - a width multiple of 4 pixels + * - an even height + * - a vertical stride equal to the height + * - strides are specified in bytes, not in pixels + * + * size = stride * height + * + * When stride is equal to width * (12 / 8), there will be no padding bytes at + * the end of each row, the entire image data is densely packed. When stride is + * larger than width * (12 / 8), padding bytes will be present at the end of + * each row (including the last row). + * + * This format must be accepted by the gralloc module when used with the + * following usage flags: + * - GRALLOC_USAGE_HW_CAMERA_* + * - GRALLOC_USAGE_SW_* + * - GRALLOC_USAGE_RENDERSCRIPT + * + * When used with ANativeWindow, the dataSpace field should be + * HAL_DATASPACE_ARBITRARY, as raw image sensor buffers require substantial + * extra metadata to define. + */ + HAL_PIXEL_FORMAT_RAW12 = 0x26, + + /* + * Android opaque RAW format: + * + * This format is exposed outside of the camera HAL to applications. + * + * RAW_OPAQUE is a format for unprocessed raw image buffers coming from an + * image sensor. The actual structure of buffers of this format is + * implementation-dependent. + * + * This format must be accepted by the gralloc module when used with the + * following usage flags: + * - GRALLOC_USAGE_HW_CAMERA_* + * - GRALLOC_USAGE_SW_* + * - GRALLOC_USAGE_RENDERSCRIPT + * + * When used with ANativeWindow, the dataSpace field should be + * HAL_DATASPACE_ARBITRARY, as raw image sensor buffers require substantial + * extra metadata to define. + */ + HAL_PIXEL_FORMAT_RAW_OPAQUE = 0x24, + + /* + * Android binary blob graphics buffer format: + * + * This format is used to carry task-specific data which does not have a + * standard image structure. The details of the format are left to the two + * endpoints. + * + * A typical use case is for transporting JPEG-compressed images from the + * Camera HAL to the framework or to applications. + * + * Buffers of this format must have a height of 1, and width equal to their + * size in bytes. + * + * When used with ANativeWindow, the mapping of the dataSpace field to + * buffer contents for BLOB is as follows: + * + * dataSpace value | Buffer contents + * -------------------------------+----------------------------------------- + * HAL_DATASPACE_JFIF | An encoded JPEG image + * HAL_DATASPACE_DEPTH | An android_depth_points buffer + * Other | Unsupported + * + */ + HAL_PIXEL_FORMAT_BLOB = 0x21, + + /* + * Android format indicating that the choice of format is entirely up to the + * device-specific Gralloc implementation. + * + * The Gralloc implementation should examine the usage bits passed in when + * allocating a buffer with this format, and it should derive the pixel + * format from those usage flags. This format will never be used with any + * of the GRALLOC_USAGE_SW_* usage flags. + * + * If a buffer of this format is to be used as an OpenGL ES texture, the + * framework will assume that sampling the texture will always return an + * alpha value of 1.0 (i.e. the buffer contains only opaque pixel values). + * + * When used with ANativeWindow, the dataSpace field describes the color + * space of the buffer. + */ + HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED = 0x22, + + /* + * Android flexible YCbCr 4:2:0 formats + * + * This format allows platforms to use an efficient YCbCr/YCrCb 4:2:0 + * buffer layout, while still describing the general format in a + * layout-independent manner. While called YCbCr, it can be + * used to describe formats with either chromatic ordering, as well as + * whole planar or semiplanar layouts. + * + * struct android_ycbcr (below) is the the struct used to describe it. + * + * This format must be accepted by the gralloc module when + * USAGE_SW_WRITE_* or USAGE_SW_READ_* are set. + * + * This format is locked for use by gralloc's (*lock_ycbcr) method, and + * locking with the (*lock) method will return an error. + * + * When used with ANativeWindow, the dataSpace field describes the color + * space of the buffer. + */ + HAL_PIXEL_FORMAT_YCbCr_420_888 = 0x23, + + /* + * Android flexible YCbCr 4:2:2 formats + * + * This format allows platforms to use an efficient YCbCr/YCrCb 4:2:2 + * buffer layout, while still describing the general format in a + * layout-independent manner. While called YCbCr, it can be + * used to describe formats with either chromatic ordering, as well as + * whole planar or semiplanar layouts. + * + * This format is currently only used by SW readable buffers + * produced by MediaCodecs, so the gralloc module can ignore this format. + */ + HAL_PIXEL_FORMAT_YCbCr_422_888 = 0x27, + + /* + * Android flexible YCbCr 4:4:4 formats + * + * This format allows platforms to use an efficient YCbCr/YCrCb 4:4:4 + * buffer layout, while still describing the general format in a + * layout-independent manner. While called YCbCr, it can be + * used to describe formats with either chromatic ordering, as well as + * whole planar or semiplanar layouts. + * + * This format is currently only used by SW readable buffers + * produced by MediaCodecs, so the gralloc module can ignore this format. + */ + HAL_PIXEL_FORMAT_YCbCr_444_888 = 0x28, + + /* + * Android flexible RGB 888 formats + * + * This format allows platforms to use an efficient RGB/BGR/RGBX/BGRX + * buffer layout, while still describing the general format in a + * layout-independent manner. While called RGB, it can be + * used to describe formats with either color ordering and optional + * padding, as well as whole planar layout. + * + * This format is currently only used by SW readable buffers + * produced by MediaCodecs, so the gralloc module can ignore this format. + */ + HAL_PIXEL_FORMAT_FLEX_RGB_888 = 0x29, + + /* + * Android flexible RGBA 8888 formats + * + * This format allows platforms to use an efficient RGBA/BGRA/ARGB/ABGR + * buffer layout, while still describing the general format in a + * layout-independent manner. While called RGBA, it can be + * used to describe formats with any of the component orderings, as + * well as whole planar layout. + * + * This format is currently only used by SW readable buffers + * produced by MediaCodecs, so the gralloc module can ignore this format. + */ + HAL_PIXEL_FORMAT_FLEX_RGBA_8888 = 0x2A, + + /* Legacy formats (deprecated), used by ImageFormat.java */ + HAL_PIXEL_FORMAT_YCbCr_422_SP = 0x10, // NV16 + HAL_PIXEL_FORMAT_YCrCb_420_SP = 0x11, // NV21 + HAL_PIXEL_FORMAT_YCbCr_422_I = 0x14, // YUY2 +}; + +/* + * Structure for describing YCbCr formats for consumption by applications. + * This is used with HAL_PIXEL_FORMAT_YCbCr_*_888. + * + * Buffer chroma subsampling is defined in the format. + * e.g. HAL_PIXEL_FORMAT_YCbCr_420_888 has subsampling 4:2:0. + * + * Buffers must have a 8 bit depth. + * + * @y, @cb, and @cr point to the first byte of their respective planes. + * + * Stride describes the distance in bytes from the first value of one row of + * the image to the first value of the next row. It includes the width of the + * image plus padding. + * @ystride is the stride of the luma plane. + * @cstride is the stride of the chroma planes. + * + * @chroma_step is the distance in bytes from one chroma pixel value to the + * next. This is 2 bytes for semiplanar (because chroma values are interleaved + * and each chroma value is one byte) and 1 for planar. + */ + +struct android_ycbcr { + void *y; + void *cb; + void *cr; + size_t ystride; + size_t cstride; + size_t chroma_step; + + /** reserved for future use, set to 0 by gralloc's (*lock_ycbcr)() */ + uint32_t reserved[8]; +}; + +/** + * Structure used to define depth point clouds for format HAL_PIXEL_FORMAT_BLOB + * with dataSpace value of HAL_DATASPACE_DEPTH. + * When locking a native buffer of the above format and dataSpace value, + * the vaddr pointer can be cast to this structure. + * + * A variable-length list of (x,y,z, confidence) 3D points, as floats. (x, y, + * z) represents a measured point's position, with the coordinate system defined + * by the data source. Confidence represents the estimated likelihood that this + * measurement is correct. It is between 0.f and 1.f, inclusive, with 1.f == + * 100% confidence. + * + * @num_points is the number of points in the list + * + * @xyz_points is the flexible array of floating-point values. + * It contains (num_points) * 4 floats. + * + * For example: + * android_depth_points d = get_depth_buffer(); + * struct { + * float x; float y; float z; float confidence; + * } firstPoint, lastPoint; + * + * firstPoint.x = d.xyzc_points[0]; + * firstPoint.y = d.xyzc_points[1]; + * firstPoint.z = d.xyzc_points[2]; + * firstPoint.confidence = d.xyzc_points[3]; + * lastPoint.x = d.xyzc_points[(d.num_points - 1) * 4 + 0]; + * lastPoint.y = d.xyzc_points[(d.num_points - 1) * 4 + 1]; + * lastPoint.z = d.xyzc_points[(d.num_points - 1) * 4 + 2]; + * lastPoint.confidence = d.xyzc_points[(d.num_points - 1) * 4 + 3]; + */ + +struct android_depth_points { + uint32_t num_points; + + /** reserved for future use, set to 0 by gralloc's (*lock)() */ + uint32_t reserved[8]; + + float xyzc_points[]; +}; + +/** + * Transformation definitions + * + * IMPORTANT NOTE: + * HAL_TRANSFORM_ROT_90 is applied CLOCKWISE and AFTER HAL_TRANSFORM_FLIP_{H|V}. + * + */ + +enum { + /* flip source image horizontally (around the vertical axis) */ + HAL_TRANSFORM_FLIP_H = 0x01, + /* flip source image vertically (around the horizontal axis)*/ + HAL_TRANSFORM_FLIP_V = 0x02, + /* rotate source image 90 degrees clockwise */ + HAL_TRANSFORM_ROT_90 = 0x04, + /* rotate source image 180 degrees */ + HAL_TRANSFORM_ROT_180 = 0x03, + /* rotate source image 270 degrees clockwise */ + HAL_TRANSFORM_ROT_270 = 0x07, + /* don't use. see system/window.h */ + HAL_TRANSFORM_RESERVED = 0x08, +}; + +/** + * Dataspace Definitions + * ====================== + * + * Dataspace is the definition of how pixel values should be interpreted. + * + * For many formats, this is the colorspace of the image data, which includes + * primaries (including white point) and the transfer characteristic function, + * which describes both gamma curve and numeric range (within the bit depth). + * + * Other dataspaces include depth measurement data from a depth camera. + */ + +typedef enum android_dataspace { + /* + * Default-assumption data space, when not explicitly specified. + * + * It is safest to assume the buffer is an image with sRGB primaries and + * encoding ranges, but the consumer and/or the producer of the data may + * simply be using defaults. No automatic gamma transform should be + * expected, except for a possible display gamma transform when drawn to a + * screen. + */ + HAL_DATASPACE_UNKNOWN = 0x0, + + /* + * Arbitrary dataspace with manually defined characteristics. Definition + * for colorspaces or other meaning must be communicated separately. + * + * This is used when specifying primaries, transfer characteristics, + * etc. separately. + * + * A typical use case is in video encoding parameters (e.g. for H.264), + * where a colorspace can have separately defined primaries, transfer + * characteristics, etc. + */ + HAL_DATASPACE_ARBITRARY = 0x1, + + /* + * RGB Colorspaces + * ----------------- + * + * Primaries are given using (x,y) coordinates in the CIE 1931 definition + * of x and y specified by ISO 11664-1. + * + * Transfer characteristics are the opto-electronic transfer characteristic + * at the source as a function of linear optical intensity (luminance). + */ + + /* + * sRGB linear encoding: + * + * The red, green, and blue components are stored in sRGB space, but + * are linear, not gamma-encoded. + * The RGB primaries and the white point are the same as BT.709. + * + * The values are encoded using the full range ([0,255] for 8-bit) for all + * components. + */ + HAL_DATASPACE_SRGB_LINEAR = 0x200, + + /* + * sRGB gamma encoding: + * + * The red, green and blue components are stored in sRGB space, and + * converted to linear space when read, using the standard sRGB to linear + * equation: + * + * Clinear = Csrgb / 12.92 for Csrgb <= 0.04045 + * = (Csrgb + 0.055 / 1.055)^2.4 for Csrgb > 0.04045 + * + * When written the inverse transformation is performed: + * + * Csrgb = 12.92 * Clinear for Clinear <= 0.0031308 + * = 1.055 * Clinear^(1/2.4) - 0.055 for Clinear > 0.0031308 + * + * + * The alpha component, if present, is always stored in linear space and + * is left unmodified when read or written. + * + * The RGB primaries and the white point are the same as BT.709. + * + * The values are encoded using the full range ([0,255] for 8-bit) for all + * components. + * + */ + HAL_DATASPACE_SRGB = 0x201, + + /* + * YCbCr Colorspaces + * ----------------- + * + * Primaries are given using (x,y) coordinates in the CIE 1931 definition + * of x and y specified by ISO 11664-1. + * + * Transfer characteristics are the opto-electronic transfer characteristic + * at the source as a function of linear optical intensity (luminance). + */ + + /* + * JPEG File Interchange Format (JFIF) + * + * Same model as BT.601-625, but all values (Y, Cb, Cr) range from 0 to 255 + * + * Transfer characteristic curve: + * E = 1.099 * L ^ 0.45 - 0.099, 1.00 >= L >= 0.018 + * E = 4.500 L, 0.018 > L >= 0 + * L - luminance of image 0 <= L <= 1 for conventional colorimetry + * E - corresponding electrical signal + * + * Primaries: x y + * green 0.290 0.600 + * blue 0.150 0.060 + * red 0.640 0.330 + * white (D65) 0.3127 0.3290 + */ + HAL_DATASPACE_JFIF = 0x101, + + /* + * ITU-R Recommendation 601 (BT.601) - 625-line + * + * Standard-definition television, 625 Lines (PAL) + * + * For 8-bit-depth formats: + * Luma (Y) samples should range from 16 to 235, inclusive + * Chroma (Cb, Cr) samples should range from 16 to 240, inclusive + * + * For 10-bit-depth formats: + * Luma (Y) samples should range from 64 to 940, inclusive + * Chroma (Cb, Cr) samples should range from 64 to 960, inclusive + * + * Transfer characteristic curve: + * E = 1.099 * L ^ 0.45 - 0.099, 1.00 >= L >= 0.018 + * E = 4.500 L, 0.018 > L >= 0 + * L - luminance of image 0 <= L <= 1 for conventional colorimetry + * E - corresponding electrical signal + * + * Primaries: x y + * green 0.290 0.600 + * blue 0.150 0.060 + * red 0.640 0.330 + * white (D65) 0.3127 0.3290 + */ + HAL_DATASPACE_BT601_625 = 0x102, + + /* + * ITU-R Recommendation 601 (BT.601) - 525-line + * + * Standard-definition television, 525 Lines (NTSC) + * + * For 8-bit-depth formats: + * Luma (Y) samples should range from 16 to 235, inclusive + * Chroma (Cb, Cr) samples should range from 16 to 240, inclusive + * + * For 10-bit-depth formats: + * Luma (Y) samples should range from 64 to 940, inclusive + * Chroma (Cb, Cr) samples should range from 64 to 960, inclusive + * + * Transfer characteristic curve: + * E = 1.099 * L ^ 0.45 - 0.099, 1.00 >= L >= 0.018 + * E = 4.500 L, 0.018 > L >= 0 + * L - luminance of image 0 <= L <= 1 for conventional colorimetry + * E - corresponding electrical signal + * + * Primaries: x y + * green 0.310 0.595 + * blue 0.155 0.070 + * red 0.630 0.340 + * white (D65) 0.3127 0.3290 + */ + HAL_DATASPACE_BT601_525 = 0x103, + + /* + * ITU-R Recommendation 709 (BT.709) + * + * High-definition television + * + * For 8-bit-depth formats: + * Luma (Y) samples should range from 16 to 235, inclusive + * Chroma (Cb, Cr) samples should range from 16 to 240, inclusive + * + * For 10-bit-depth formats: + * Luma (Y) samples should range from 64 to 940, inclusive + * Chroma (Cb, Cr) samples should range from 64 to 960, inclusive + * + * Primaries: x y + * green 0.300 0.600 + * blue 0.150 0.060 + * red 0.640 0.330 + * white (D65) 0.3127 0.3290 + */ + HAL_DATASPACE_BT709 = 0x104, + + /* + * The buffer contains depth ranging measurements from a depth camera. + * This value is valid with formats: + * HAL_PIXEL_FORMAT_Y16: 16-bit samples, consisting of a depth measurement + * and an associated confidence value. The 3 MSBs of the sample make + * up the confidence value, and the low 13 LSBs of the sample make up + * the depth measurement. + * For the confidence section, 0 means 100% confidence, 1 means 0% + * confidence. The mapping to a linear float confidence value between + * 0.f and 1.f can be obtained with + * float confidence = (((depthSample >> 13) - 1) & 0x7) / 7.0f; + * The depth measurement can be extracted simply with + * uint16_t range = (depthSample & 0x1FFF); + * HAL_PIXEL_FORMAT_BLOB: A depth point cloud, as + * a variable-length float (x,y,z, confidence) coordinate point list. + * The point cloud will be represented with the android_depth_points + * structure. + */ + HAL_DATASPACE_DEPTH = 0x1000 + +} android_dataspace_t; + +#ifdef __cplusplus +} +#endif + +#endif /* SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H */ diff --git a/third_party/android_system_core/include/system/radio.h b/third_party/android_system_core/include/system/radio.h new file mode 100644 index 000000000..a08852604 --- /dev/null +++ b/third_party/android_system_core/include/system/radio.h @@ -0,0 +1,247 @@ +/* + * Copyright (C) 2015 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_RADIO_H +#define ANDROID_RADIO_H + +#include +#include +#include +#include +#include + + +#define RADIO_NUM_BANDS_MAX 16 +#define RADIO_NUM_SPACINGS_MAX 16 +#define RADIO_STRING_LEN_MAX 128 + +/* + * Radio hardware module class. A given radio hardware module HAL is of one class + * only. The platform can not have more than one hardware module of each class. + * Current version of the framework only supports RADIO_CLASS_AM_FM. + */ +typedef enum { + RADIO_CLASS_AM_FM = 0, /* FM (including HD radio) and AM */ + RADIO_CLASS_SAT = 1, /* Satellite Radio */ + RADIO_CLASS_DT = 2, /* Digital Radio (DAB) */ +} radio_class_t; + +/* value for field "type" of radio band described in struct radio_hal_band_config */ +typedef enum { + RADIO_BAND_AM = 0, /* Amplitude Modulation band: LW, MW, SW */ + RADIO_BAND_FM = 1, /* Frequency Modulation band: FM */ + RADIO_BAND_FM_HD = 2, /* FM HD Radio / DRM (IBOC) */ + RADIO_BAND_AM_HD = 3, /* AM HD Radio / DRM (IBOC) */ +} radio_band_t; + +/* RDS variant implemented. A struct radio_hal_fm_band_config can list none or several. */ +enum { + RADIO_RDS_NONE = 0x0, + RADIO_RDS_WORLD = 0x01, + RADIO_RDS_US = 0x02, +}; +typedef unsigned int radio_rds_t; + +/* FM deemphasis variant implemented. A struct radio_hal_fm_band_config can list one or more. */ +enum { + RADIO_DEEMPHASIS_50 = 0x1, + RADIO_DEEMPHASIS_75 = 0x2, +}; +typedef unsigned int radio_deemphasis_t; + +/* Region a particular radio band configuration corresponds to. Not used at the HAL. + * Derived by the framework when converting the band descriptors retrieved from the HAL to + * individual band descriptors for each supported region. */ +typedef enum { + RADIO_REGION_NONE = -1, + RADIO_REGION_ITU_1 = 0, + RADIO_REGION_ITU_2 = 1, + RADIO_REGION_OIRT = 2, + RADIO_REGION_JAPAN = 3, + RADIO_REGION_KOREA = 4, +} radio_region_t; + +/* scanning direction for scan() and step() tuner APIs */ +typedef enum { + RADIO_DIRECTION_UP, + RADIO_DIRECTION_DOWN +} radio_direction_t; + +/* unique handle allocated to a radio module */ +typedef unsigned int radio_handle_t; + +/* Opaque meta data structure used by radio meta data API (see system/radio_metadata.h) */ +typedef struct radio_medtadata radio_metadata_t; + + +/* Additional attributes for an FM band configuration */ +typedef struct radio_hal_fm_band_config { + radio_deemphasis_t deemphasis; /* deemphasis variant */ + bool stereo; /* stereo supported */ + radio_rds_t rds; /* RDS variants supported */ + bool ta; /* Traffic Announcement supported */ + bool af; /* Alternate Frequency supported */ +} radio_hal_fm_band_config_t; + +/* Additional attributes for an AM band configuration */ +typedef struct radio_hal_am_band_config { + bool stereo; /* stereo supported */ +} radio_hal_am_band_config_t; + +/* Radio band configuration. Describes a given band supported by the radio module. + * The HAL can expose only one band per type with the the maximum range supported and all options. + * THe framework will derive the actual regions were this module can operate and expose separate + * band configurations for applications to chose from. */ +typedef struct radio_hal_band_config { + radio_band_t type; + bool antenna_connected; + unsigned int lower_limit; + unsigned int upper_limit; + unsigned int num_spacings; + unsigned int spacings[RADIO_NUM_SPACINGS_MAX]; + union { + radio_hal_fm_band_config_t fm; + radio_hal_am_band_config_t am; + }; +} radio_hal_band_config_t; + +/* Used internally by the framework to represent a band for s specific region */ +typedef struct radio_band_config { + radio_region_t region; + radio_hal_band_config_t band; +} radio_band_config_t; + + +/* Exposes properties of a given hardware radio module. + * NOTE: current framework implementation supports only one audio source (num_audio_sources = 1). + * The source corresponds to AUDIO_DEVICE_IN_FM_TUNER. + * If more than one tuner is supported (num_tuners > 1), only one can be connected to the audio + * source. */ +typedef struct radio_hal_properties { + radio_class_t class_id; /* Class of this module. E.g RADIO_CLASS_AM_FM */ + char implementor[RADIO_STRING_LEN_MAX]; /* implementor name */ + char product[RADIO_STRING_LEN_MAX]; /* product name */ + char version[RADIO_STRING_LEN_MAX]; /* product version */ + char serial[RADIO_STRING_LEN_MAX]; /* serial number (for subscription services) */ + unsigned int num_tuners; /* number of tuners controllable independently */ + unsigned int num_audio_sources; /* number of audio sources driven simultaneously */ + bool supports_capture; /* the hardware supports capture of audio source audio HAL */ + unsigned int num_bands; /* number of band descriptors */ + radio_hal_band_config_t bands[RADIO_NUM_BANDS_MAX]; /* band descriptors */ +} radio_hal_properties_t; + +/* Used internally by the framework. Same information as in struct radio_hal_properties plus a + * unique handle and one band configuration per region. */ +typedef struct radio_properties { + radio_handle_t handle; + radio_class_t class_id; + char implementor[RADIO_STRING_LEN_MAX]; + char product[RADIO_STRING_LEN_MAX]; + char version[RADIO_STRING_LEN_MAX]; + char serial[RADIO_STRING_LEN_MAX]; + unsigned int num_tuners; + unsigned int num_audio_sources; + bool supports_capture; + unsigned int num_bands; + radio_band_config_t bands[RADIO_NUM_BANDS_MAX]; +} radio_properties_t; + +/* Radio program information. Returned by the HAL with event RADIO_EVENT_TUNED. + * Contains information on currently tuned channel. + */ +typedef struct radio_program_info { + unsigned int channel; /* current channel. (e.g kHz for band type RADIO_BAND_FM) */ + unsigned int sub_channel; /* current sub channel. (used for RADIO_BAND_FM_HD) */ + bool tuned; /* tuned to a program or not */ + bool stereo; /* program is stereo or not */ + bool digital; /* digital program or not (e.g HD Radio program) */ + unsigned int signal_strength; /* signal strength from 0 to 100 */ + radio_metadata_t *metadata; /* non null if meta data are present (e.g PTY, song title ...) */ +} radio_program_info_t; + + +/* Events sent to the framework via the HAL callback. An event can notify the completion of an + * asynchronous command (configuration, tune, scan ...) or a spontaneous change (antenna connection, + * failure, AF switching, meta data reception... */ +enum { + RADIO_EVENT_HW_FAILURE = 0, /* hardware module failure. Requires reopening the tuner */ + RADIO_EVENT_CONFIG = 1, /* configuration change completed */ + RADIO_EVENT_ANTENNA = 2, /* Antenna connected, disconnected */ + RADIO_EVENT_TUNED = 3, /* tune, step, scan completed */ + RADIO_EVENT_METADATA = 4, /* New meta data received */ + RADIO_EVENT_TA = 5, /* Traffic announcement start or stop */ + RADIO_EVENT_AF_SWITCH = 6, /* Switch to Alternate Frequency */ + // begin framework only events + RADIO_EVENT_CONTROL = 100, /* loss/gain of tuner control */ + RADIO_EVENT_SERVER_DIED = 101, /* radio service died */ +}; +typedef unsigned int radio_event_type_t; + +/* Event passed to the framework by the HAL callback */ +typedef struct radio_hal_event { + radio_event_type_t type; /* event type */ + int status; /* used by RADIO_EVENT_CONFIG, RADIO_EVENT_TUNED */ + union { + bool on; /* RADIO_EVENT_ANTENNA, RADIO_EVENT_TA */ + radio_hal_band_config_t config; /* RADIO_EVENT_CONFIG */ + radio_program_info_t info; /* RADIO_EVENT_TUNED, RADIO_EVENT_AF_SWITCH */ + radio_metadata_t *metadata; /* RADIO_EVENT_METADATA */ + }; +} radio_hal_event_t; + +/* Used internally by the framework. Same information as in struct radio_hal_event */ +typedef struct radio_event { + radio_event_type_t type; + int status; + union { + bool on; + radio_band_config_t config; + radio_program_info_t info; + radio_metadata_t *metadata; /* offset from start of struct when in shared memory */ + }; +} radio_event_t; + + +static radio_rds_t radio_rds_for_region(bool rds, radio_region_t region) { + if (!rds) + return RADIO_RDS_NONE; + switch(region) { + case RADIO_REGION_ITU_1: + case RADIO_REGION_OIRT: + case RADIO_REGION_JAPAN: + case RADIO_REGION_KOREA: + return RADIO_RDS_WORLD; + case RADIO_REGION_ITU_2: + return RADIO_RDS_US; + default: + return RADIO_REGION_NONE; + } +} + +static radio_deemphasis_t radio_demephasis_for_region(radio_region_t region) { + switch(region) { + case RADIO_REGION_KOREA: + case RADIO_REGION_ITU_2: + return RADIO_DEEMPHASIS_75; + case RADIO_REGION_ITU_1: + case RADIO_REGION_OIRT: + case RADIO_REGION_JAPAN: + default: + return RADIO_DEEMPHASIS_50; + } +} + +#endif // ANDROID_RADIO_H diff --git a/third_party/android_system_core/include/system/thread_defs.h b/third_party/android_system_core/include/system/thread_defs.h new file mode 100644 index 000000000..377a48ce9 --- /dev/null +++ b/third_party/android_system_core/include/system/thread_defs.h @@ -0,0 +1,77 @@ +/* + * 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_THREAD_DEFS_H +#define ANDROID_THREAD_DEFS_H + +#include "graphics.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +enum { + /* + * *********************************************** + * ** Keep in sync with android.os.Process.java ** + * *********************************************** + * + * This maps directly to the "nice" priorities we use in Android. + * A thread priority should be chosen inverse-proportionally to + * the amount of work the thread is expected to do. The more work + * a thread will do, the less favorable priority it should get so that + * it doesn't starve the system. Threads not behaving properly might + * be "punished" by the kernel. + * Use the levels below when appropriate. Intermediate values are + * acceptable, preferably use the {MORE|LESS}_FAVORABLE constants below. + */ + ANDROID_PRIORITY_LOWEST = 19, + + /* use for background tasks */ + ANDROID_PRIORITY_BACKGROUND = 10, + + /* most threads run at normal priority */ + ANDROID_PRIORITY_NORMAL = 0, + + /* threads currently running a UI that the user is interacting with */ + ANDROID_PRIORITY_FOREGROUND = -2, + + /* the main UI thread has a slightly more favorable priority */ + ANDROID_PRIORITY_DISPLAY = -4, + + /* ui service treads might want to run at a urgent display (uncommon) */ + ANDROID_PRIORITY_URGENT_DISPLAY = HAL_PRIORITY_URGENT_DISPLAY, + + /* all normal audio threads */ + ANDROID_PRIORITY_AUDIO = -16, + + /* service audio threads (uncommon) */ + ANDROID_PRIORITY_URGENT_AUDIO = -19, + + /* should never be used in practice. regular process might not + * be allowed to use this level */ + ANDROID_PRIORITY_HIGHEST = -20, + + ANDROID_PRIORITY_DEFAULT = ANDROID_PRIORITY_NORMAL, + ANDROID_PRIORITY_MORE_FAVORABLE = -1, + ANDROID_PRIORITY_LESS_FAVORABLE = +1, +}; + +#if defined(__cplusplus) +} +#endif + +#endif /* ANDROID_THREAD_DEFS_H */ diff --git a/third_party/android_system_core/include/system/window.h b/third_party/android_system_core/include/system/window.h new file mode 100644 index 000000000..508ce00ba --- /dev/null +++ b/third_party/android_system_core/include/system/window.h @@ -0,0 +1,954 @@ +/* + * 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 SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H +#define SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef __UNUSED +#define __UNUSED __attribute__((__unused__)) +#endif +#ifndef __deprecated +#define __deprecated __attribute__((__deprecated__)) +#endif + +__BEGIN_DECLS + +/*****************************************************************************/ + +#define ANDROID_NATIVE_MAKE_CONSTANT(a,b,c,d) \ + (((unsigned)(a)<<24)|((unsigned)(b)<<16)|((unsigned)(c)<<8)|(unsigned)(d)) + +#define ANDROID_NATIVE_WINDOW_MAGIC \ + ANDROID_NATIVE_MAKE_CONSTANT('_','w','n','d') + +#define ANDROID_NATIVE_BUFFER_MAGIC \ + ANDROID_NATIVE_MAKE_CONSTANT('_','b','f','r') + +// --------------------------------------------------------------------------- + +// This #define may be used to conditionally compile device-specific code to +// support either the prior ANativeWindow interface, which did not pass libsync +// fences around, or the new interface that does. This #define is only present +// when the ANativeWindow interface does include libsync support. +#define ANDROID_NATIVE_WINDOW_HAS_SYNC 1 + +// --------------------------------------------------------------------------- + +typedef const native_handle_t* buffer_handle_t; + +// --------------------------------------------------------------------------- + +typedef struct android_native_rect_t +{ + int32_t left; + int32_t top; + int32_t right; + int32_t bottom; +} android_native_rect_t; + +// --------------------------------------------------------------------------- + +typedef struct android_native_base_t +{ + /* a magic value defined by the actual EGL native type */ + int magic; + + /* the sizeof() of the actual EGL native type */ + int version; + + void* reserved[4]; + + /* reference-counting interface */ + void (*incRef)(struct android_native_base_t* base); + void (*decRef)(struct android_native_base_t* base); +} android_native_base_t; + +typedef struct ANativeWindowBuffer +{ +#ifdef __cplusplus + ANativeWindowBuffer() { + common.magic = ANDROID_NATIVE_BUFFER_MAGIC; + common.version = sizeof(ANativeWindowBuffer); + memset(common.reserved, 0, sizeof(common.reserved)); + } + + // Implement the methods that sp expects so that it + // can be used to automatically refcount ANativeWindowBuffer's. + void incStrong(const void* /*id*/) const { + common.incRef(const_cast(&common)); + } + void decStrong(const void* /*id*/) const { + common.decRef(const_cast(&common)); + } +#endif + + struct android_native_base_t common; + + int width; + int height; + int stride; + int format; + int usage; + + void* reserved[2]; + + buffer_handle_t handle; + + void* reserved_proc[8]; +} ANativeWindowBuffer_t; + +// Old typedef for backwards compatibility. +typedef ANativeWindowBuffer_t android_native_buffer_t; + +// --------------------------------------------------------------------------- + +/* attributes queriable with query() */ +enum { + NATIVE_WINDOW_WIDTH = 0, + NATIVE_WINDOW_HEIGHT = 1, + NATIVE_WINDOW_FORMAT = 2, + + /* The minimum number of buffers that must remain un-dequeued after a buffer + * has been queued. This value applies only if set_buffer_count was used to + * override the number of buffers and if a buffer has since been queued. + * Users of the set_buffer_count ANativeWindow method should query this + * value before calling set_buffer_count. If it is necessary to have N + * buffers simultaneously dequeued as part of the steady-state operation, + * and this query returns M then N+M buffers should be requested via + * native_window_set_buffer_count. + * + * Note that this value does NOT apply until a single buffer has been + * queued. In particular this means that it is possible to: + * + * 1. Query M = min undequeued buffers + * 2. Set the buffer count to N + M + * 3. Dequeue all N + M buffers + * 4. Cancel M buffers + * 5. Queue, dequeue, queue, dequeue, ad infinitum + */ + NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS = 3, + + /* Check whether queueBuffer operations on the ANativeWindow send the buffer + * to the window compositor. The query sets the returned 'value' argument + * to 1 if the ANativeWindow DOES send queued buffers directly to the window + * compositor and 0 if the buffers do not go directly to the window + * compositor. + * + * This can be used to determine whether protected buffer content should be + * sent to the ANativeWindow. Note, however, that a result of 1 does NOT + * indicate that queued buffers will be protected from applications or users + * capturing their contents. If that behavior is desired then some other + * mechanism (e.g. the GRALLOC_USAGE_PROTECTED flag) should be used in + * conjunction with this query. + */ + NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER = 4, + + /* Get the concrete type of a ANativeWindow. See below for the list of + * possible return values. + * + * This query should not be used outside the Android framework and will + * likely be removed in the near future. + */ + NATIVE_WINDOW_CONCRETE_TYPE = 5, + + + /* + * Default width and height of ANativeWindow buffers, these are the + * dimensions of the window buffers irrespective of the + * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS call and match the native window + * size unless overridden by NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS. + */ + NATIVE_WINDOW_DEFAULT_WIDTH = 6, + NATIVE_WINDOW_DEFAULT_HEIGHT = 7, + + /* + * transformation that will most-likely be applied to buffers. This is only + * a hint, the actual transformation applied might be different. + * + * INTENDED USE: + * + * The transform hint can be used by a producer, for instance the GLES + * driver, to pre-rotate the rendering such that the final transformation + * in the composer is identity. This can be very useful when used in + * conjunction with the h/w composer HAL, in situations where it + * cannot handle arbitrary rotations. + * + * 1. Before dequeuing a buffer, the GL driver (or any other ANW client) + * queries the ANW for NATIVE_WINDOW_TRANSFORM_HINT. + * + * 2. The GL driver overrides the width and height of the ANW to + * account for NATIVE_WINDOW_TRANSFORM_HINT. This is done by querying + * NATIVE_WINDOW_DEFAULT_{WIDTH | HEIGHT}, swapping the dimensions + * according to NATIVE_WINDOW_TRANSFORM_HINT and calling + * native_window_set_buffers_dimensions(). + * + * 3. The GL driver dequeues a buffer of the new pre-rotated size. + * + * 4. The GL driver renders to the buffer such that the image is + * already transformed, that is applying NATIVE_WINDOW_TRANSFORM_HINT + * to the rendering. + * + * 5. The GL driver calls native_window_set_transform to apply + * inverse transformation to the buffer it just rendered. + * In order to do this, the GL driver needs + * to calculate the inverse of NATIVE_WINDOW_TRANSFORM_HINT, this is + * done easily: + * + * int hintTransform, inverseTransform; + * query(..., NATIVE_WINDOW_TRANSFORM_HINT, &hintTransform); + * inverseTransform = hintTransform; + * if (hintTransform & HAL_TRANSFORM_ROT_90) + * inverseTransform ^= HAL_TRANSFORM_ROT_180; + * + * + * 6. The GL driver queues the pre-transformed buffer. + * + * 7. The composer combines the buffer transform with the display + * transform. If the buffer transform happens to cancel out the + * display transform then no rotation is needed. + * + */ + NATIVE_WINDOW_TRANSFORM_HINT = 8, + + /* + * Boolean that indicates whether the consumer is running more than + * one buffer behind the producer. + */ + NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND = 9, + + /* + * The consumer gralloc usage bits currently set by the consumer. + * The values are defined in hardware/libhardware/include/gralloc.h. + */ + NATIVE_WINDOW_CONSUMER_USAGE_BITS = 10, + + /** + * Transformation that will by applied to buffers by the hwcomposer. + * This must not be set or checked by producer endpoints, and will + * disable the transform hint set in SurfaceFlinger (see + * NATIVE_WINDOW_TRANSFORM_HINT). + * + * INTENDED USE: + * Temporary - Please do not use this. This is intended only to be used + * by the camera's LEGACY mode. + * + * In situations where a SurfaceFlinger client wishes to set a transform + * that is not visible to the producer, and will always be applied in the + * hardware composer, the client can set this flag with + * native_window_set_buffers_sticky_transform. This can be used to rotate + * and flip buffers consumed by hardware composer without actually changing + * the aspect ratio of the buffers produced. + */ + NATIVE_WINDOW_STICKY_TRANSFORM = 11, + + /** + * The default data space for the buffers as set by the consumer. + * The values are defined in graphics.h. + */ + NATIVE_WINDOW_DEFAULT_DATASPACE = 12, + + /* + * Returns the age of the contents of the most recently dequeued buffer as + * the number of frames that have elapsed since it was last queued. For + * example, if the window is double-buffered, the age of any given buffer in + * steady state will be 2. If the dequeued buffer has never been queued, its + * age will be 0. + */ + NATIVE_WINDOW_BUFFER_AGE = 13, +}; + +/* Valid operations for the (*perform)() hook. + * + * Values marked as 'deprecated' are supported, but have been superceded by + * other functionality. + * + * Values marked as 'private' should be considered private to the framework. + * HAL implementation code with access to an ANativeWindow should not use these, + * as it may not interact properly with the framework's use of the + * ANativeWindow. + */ +enum { + NATIVE_WINDOW_SET_USAGE = 0, + NATIVE_WINDOW_CONNECT = 1, /* deprecated */ + NATIVE_WINDOW_DISCONNECT = 2, /* deprecated */ + NATIVE_WINDOW_SET_CROP = 3, /* private */ + NATIVE_WINDOW_SET_BUFFER_COUNT = 4, + NATIVE_WINDOW_SET_BUFFERS_GEOMETRY = 5, /* deprecated */ + NATIVE_WINDOW_SET_BUFFERS_TRANSFORM = 6, + NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP = 7, + NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS = 8, + NATIVE_WINDOW_SET_BUFFERS_FORMAT = 9, + NATIVE_WINDOW_SET_SCALING_MODE = 10, /* private */ + NATIVE_WINDOW_LOCK = 11, /* private */ + NATIVE_WINDOW_UNLOCK_AND_POST = 12, /* private */ + NATIVE_WINDOW_API_CONNECT = 13, /* private */ + NATIVE_WINDOW_API_DISCONNECT = 14, /* private */ + NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS = 15, /* private */ + NATIVE_WINDOW_SET_POST_TRANSFORM_CROP = 16, /* private */ + NATIVE_WINDOW_SET_BUFFERS_STICKY_TRANSFORM = 17,/* private */ + NATIVE_WINDOW_SET_SIDEBAND_STREAM = 18, + NATIVE_WINDOW_SET_BUFFERS_DATASPACE = 19, + NATIVE_WINDOW_SET_SURFACE_DAMAGE = 20, /* private */ +}; + +/* parameter for NATIVE_WINDOW_[API_][DIS]CONNECT */ +enum { + /* Buffers will be queued by EGL via eglSwapBuffers after being filled using + * OpenGL ES. + */ + NATIVE_WINDOW_API_EGL = 1, + + /* Buffers will be queued after being filled using the CPU + */ + NATIVE_WINDOW_API_CPU = 2, + + /* Buffers will be queued by Stagefright after being filled by a video + * decoder. The video decoder can either be a software or hardware decoder. + */ + NATIVE_WINDOW_API_MEDIA = 3, + + /* Buffers will be queued by the the camera HAL. + */ + NATIVE_WINDOW_API_CAMERA = 4, +}; + +/* parameter for NATIVE_WINDOW_SET_BUFFERS_TRANSFORM */ +enum { + /* flip source image horizontally */ + NATIVE_WINDOW_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H , + /* flip source image vertically */ + NATIVE_WINDOW_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V, + /* rotate source image 90 degrees clock-wise, and is applied after TRANSFORM_FLIP_{H|V} */ + NATIVE_WINDOW_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90, + /* rotate source image 180 degrees */ + NATIVE_WINDOW_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180, + /* rotate source image 270 degrees clock-wise */ + NATIVE_WINDOW_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270, + /* transforms source by the inverse transform of the screen it is displayed onto. This + * transform is applied last */ + NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY = 0x08 +}; + +/* parameter for NATIVE_WINDOW_SET_SCALING_MODE */ +enum { + /* the window content is not updated (frozen) until a buffer of + * the window size is received (enqueued) + */ + NATIVE_WINDOW_SCALING_MODE_FREEZE = 0, + /* the buffer is scaled in both dimensions to match the window size */ + NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW = 1, + /* the buffer is scaled uniformly such that the smaller dimension + * of the buffer matches the window size (cropping in the process) + */ + NATIVE_WINDOW_SCALING_MODE_SCALE_CROP = 2, + /* the window is clipped to the size of the buffer's crop rectangle; pixels + * outside the crop rectangle are treated as if they are completely + * transparent. + */ + NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP = 3, +}; + +/* values returned by the NATIVE_WINDOW_CONCRETE_TYPE query */ +enum { + NATIVE_WINDOW_FRAMEBUFFER = 0, /* FramebufferNativeWindow */ + NATIVE_WINDOW_SURFACE = 1, /* Surface */ +}; + +/* parameter for NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP + * + * Special timestamp value to indicate that timestamps should be auto-generated + * by the native window when queueBuffer is called. This is equal to INT64_MIN, + * defined directly to avoid problems with C99/C++ inclusion of stdint.h. + */ +static const int64_t NATIVE_WINDOW_TIMESTAMP_AUTO = (-9223372036854775807LL-1); + +struct ANativeWindow +{ +#ifdef __cplusplus + ANativeWindow() + : flags(0), minSwapInterval(0), maxSwapInterval(0), xdpi(0), ydpi(0) + { + common.magic = ANDROID_NATIVE_WINDOW_MAGIC; + common.version = sizeof(ANativeWindow); + memset(common.reserved, 0, sizeof(common.reserved)); + } + + /* Implement the methods that sp expects so that it + can be used to automatically refcount ANativeWindow's. */ + void incStrong(const void* /*id*/) const { + common.incRef(const_cast(&common)); + } + void decStrong(const void* /*id*/) const { + common.decRef(const_cast(&common)); + } +#endif + + struct android_native_base_t common; + + /* flags describing some attributes of this surface or its updater */ + const uint32_t flags; + + /* min swap interval supported by this updated */ + const int minSwapInterval; + + /* max swap interval supported by this updated */ + const int maxSwapInterval; + + /* horizontal and vertical resolution in DPI */ + const float xdpi; + const float ydpi; + + /* Some storage reserved for the OEM's driver. */ + intptr_t oem[4]; + + /* + * Set the swap interval for this surface. + * + * Returns 0 on success or -errno on error. + */ + int (*setSwapInterval)(struct ANativeWindow* window, + int interval); + + /* + * Hook called by EGL to acquire a buffer. After this call, the buffer + * is not locked, so its content cannot be modified. This call may block if + * no buffers are available. + * + * The window holds a reference to the buffer between dequeueBuffer and + * either queueBuffer or cancelBuffer, so clients only need their own + * reference if they might use the buffer after queueing or canceling it. + * Holding a reference to a buffer after queueing or canceling it is only + * allowed if a specific buffer count has been set. + * + * Returns 0 on success or -errno on error. + * + * XXX: This function is deprecated. It will continue to work for some + * time for binary compatibility, but the new dequeueBuffer function that + * outputs a fence file descriptor should be used in its place. + */ + int (*dequeueBuffer_DEPRECATED)(struct ANativeWindow* window, + struct ANativeWindowBuffer** buffer); + + /* + * hook called by EGL to lock a buffer. This MUST be called before modifying + * the content of a buffer. The buffer must have been acquired with + * dequeueBuffer first. + * + * Returns 0 on success or -errno on error. + * + * XXX: This function is deprecated. It will continue to work for some + * time for binary compatibility, but it is essentially a no-op, and calls + * to it should be removed. + */ + int (*lockBuffer_DEPRECATED)(struct ANativeWindow* window, + struct ANativeWindowBuffer* buffer); + + /* + * Hook called by EGL when modifications to the render buffer are done. + * This unlocks and post the buffer. + * + * The window holds a reference to the buffer between dequeueBuffer and + * either queueBuffer or cancelBuffer, so clients only need their own + * reference if they might use the buffer after queueing or canceling it. + * Holding a reference to a buffer after queueing or canceling it is only + * allowed if a specific buffer count has been set. + * + * Buffers MUST be queued in the same order than they were dequeued. + * + * Returns 0 on success or -errno on error. + * + * XXX: This function is deprecated. It will continue to work for some + * time for binary compatibility, but the new queueBuffer function that + * takes a fence file descriptor should be used in its place (pass a value + * of -1 for the fence file descriptor if there is no valid one to pass). + */ + int (*queueBuffer_DEPRECATED)(struct ANativeWindow* window, + struct ANativeWindowBuffer* buffer); + + /* + * hook used to retrieve information about the native window. + * + * Returns 0 on success or -errno on error. + */ + int (*query)(const struct ANativeWindow* window, + int what, int* value); + + /* + * hook used to perform various operations on the surface. + * (*perform)() is a generic mechanism to add functionality to + * ANativeWindow while keeping backward binary compatibility. + * + * DO NOT CALL THIS HOOK DIRECTLY. Instead, use the helper functions + * defined below. + * + * (*perform)() returns -ENOENT if the 'what' parameter is not supported + * by the surface's implementation. + * + * See above for a list of valid operations, such as + * NATIVE_WINDOW_SET_USAGE or NATIVE_WINDOW_CONNECT + */ + int (*perform)(struct ANativeWindow* window, + int operation, ... ); + + /* + * Hook used to cancel a buffer that has been dequeued. + * No synchronization is performed between dequeue() and cancel(), so + * either external synchronization is needed, or these functions must be + * called from the same thread. + * + * The window holds a reference to the buffer between dequeueBuffer and + * either queueBuffer or cancelBuffer, so clients only need their own + * reference if they might use the buffer after queueing or canceling it. + * Holding a reference to a buffer after queueing or canceling it is only + * allowed if a specific buffer count has been set. + * + * XXX: This function is deprecated. It will continue to work for some + * time for binary compatibility, but the new cancelBuffer function that + * takes a fence file descriptor should be used in its place (pass a value + * of -1 for the fence file descriptor if there is no valid one to pass). + */ + int (*cancelBuffer_DEPRECATED)(struct ANativeWindow* window, + struct ANativeWindowBuffer* buffer); + + /* + * Hook called by EGL to acquire a buffer. This call may block if no + * buffers are available. + * + * The window holds a reference to the buffer between dequeueBuffer and + * either queueBuffer or cancelBuffer, so clients only need their own + * reference if they might use the buffer after queueing or canceling it. + * Holding a reference to a buffer after queueing or canceling it is only + * allowed if a specific buffer count has been set. + * + * The libsync fence file descriptor returned in the int pointed to by the + * fenceFd argument will refer to the fence that must signal before the + * dequeued buffer may be written to. A value of -1 indicates that the + * caller may access the buffer immediately without waiting on a fence. If + * a valid file descriptor is returned (i.e. any value except -1) then the + * caller is responsible for closing the file descriptor. + * + * Returns 0 on success or -errno on error. + */ + int (*dequeueBuffer)(struct ANativeWindow* window, + struct ANativeWindowBuffer** buffer, int* fenceFd); + + /* + * Hook called by EGL when modifications to the render buffer are done. + * This unlocks and post the buffer. + * + * The window holds a reference to the buffer between dequeueBuffer and + * either queueBuffer or cancelBuffer, so clients only need their own + * reference if they might use the buffer after queueing or canceling it. + * Holding a reference to a buffer after queueing or canceling it is only + * allowed if a specific buffer count has been set. + * + * The fenceFd argument specifies a libsync fence file descriptor for a + * fence that must signal before the buffer can be accessed. If the buffer + * can be accessed immediately then a value of -1 should be used. The + * caller must not use the file descriptor after it is passed to + * queueBuffer, and the ANativeWindow implementation is responsible for + * closing it. + * + * Returns 0 on success or -errno on error. + */ + int (*queueBuffer)(struct ANativeWindow* window, + struct ANativeWindowBuffer* buffer, int fenceFd); + + /* + * Hook used to cancel a buffer that has been dequeued. + * No synchronization is performed between dequeue() and cancel(), so + * either external synchronization is needed, or these functions must be + * called from the same thread. + * + * The window holds a reference to the buffer between dequeueBuffer and + * either queueBuffer or cancelBuffer, so clients only need their own + * reference if they might use the buffer after queueing or canceling it. + * Holding a reference to a buffer after queueing or canceling it is only + * allowed if a specific buffer count has been set. + * + * The fenceFd argument specifies a libsync fence file decsriptor for a + * fence that must signal before the buffer can be accessed. If the buffer + * can be accessed immediately then a value of -1 should be used. + * + * Note that if the client has not waited on the fence that was returned + * from dequeueBuffer, that same fence should be passed to cancelBuffer to + * ensure that future uses of the buffer are preceded by a wait on that + * fence. The caller must not use the file descriptor after it is passed + * to cancelBuffer, and the ANativeWindow implementation is responsible for + * closing it. + * + * Returns 0 on success or -errno on error. + */ + int (*cancelBuffer)(struct ANativeWindow* window, + struct ANativeWindowBuffer* buffer, int fenceFd); +}; + + /* Backwards compatibility: use ANativeWindow (struct ANativeWindow in C). + * android_native_window_t is deprecated. + */ +typedef struct ANativeWindow ANativeWindow; +typedef struct ANativeWindow android_native_window_t __deprecated; + +/* + * native_window_set_usage(..., usage) + * Sets the intended usage flags for the next buffers + * acquired with (*lockBuffer)() and on. + * By default (if this function is never called), a usage of + * GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE + * is assumed. + * Calling this function will usually cause following buffers to be + * reallocated. + */ + +static inline int native_window_set_usage( + struct ANativeWindow* window, int usage) +{ + return window->perform(window, NATIVE_WINDOW_SET_USAGE, usage); +} + +/* deprecated. Always returns 0. Don't call. */ +static inline int native_window_connect( + struct ANativeWindow* window __UNUSED, int api __UNUSED) __deprecated; + +static inline int native_window_connect( + struct ANativeWindow* window __UNUSED, int api __UNUSED) { + return 0; +} + +/* deprecated. Always returns 0. Don't call. */ +static inline int native_window_disconnect( + struct ANativeWindow* window __UNUSED, int api __UNUSED) __deprecated; + +static inline int native_window_disconnect( + struct ANativeWindow* window __UNUSED, int api __UNUSED) { + return 0; +} + +/* + * native_window_set_crop(..., crop) + * Sets which region of the next queued buffers needs to be considered. + * Depending on the scaling mode, a buffer's crop region is scaled and/or + * cropped to match the surface's size. This function sets the crop in + * pre-transformed buffer pixel coordinates. + * + * The specified crop region applies to all buffers queued after it is called. + * + * If 'crop' is NULL, subsequently queued buffers won't be cropped. + * + * An error is returned if for instance the crop region is invalid, out of the + * buffer's bound or if the window is invalid. + */ +static inline int native_window_set_crop( + struct ANativeWindow* window, + android_native_rect_t const * crop) +{ + return window->perform(window, NATIVE_WINDOW_SET_CROP, crop); +} + +/* + * native_window_set_post_transform_crop(..., crop) + * Sets which region of the next queued buffers needs to be considered. + * Depending on the scaling mode, a buffer's crop region is scaled and/or + * cropped to match the surface's size. This function sets the crop in + * post-transformed pixel coordinates. + * + * The specified crop region applies to all buffers queued after it is called. + * + * If 'crop' is NULL, subsequently queued buffers won't be cropped. + * + * An error is returned if for instance the crop region is invalid, out of the + * buffer's bound or if the window is invalid. + */ +static inline int native_window_set_post_transform_crop( + struct ANativeWindow* window, + android_native_rect_t const * crop) +{ + return window->perform(window, NATIVE_WINDOW_SET_POST_TRANSFORM_CROP, crop); +} + +/* + * native_window_set_active_rect(..., active_rect) + * + * This function is deprecated and will be removed soon. For now it simply + * sets the post-transform crop for compatibility while multi-project commits + * get checked. + */ +static inline int native_window_set_active_rect( + struct ANativeWindow* window, + android_native_rect_t const * active_rect) __deprecated; + +static inline int native_window_set_active_rect( + struct ANativeWindow* window, + android_native_rect_t const * active_rect) +{ + return native_window_set_post_transform_crop(window, active_rect); +} + +/* + * native_window_set_buffer_count(..., count) + * Sets the number of buffers associated with this native window. + */ +static inline int native_window_set_buffer_count( + struct ANativeWindow* window, + size_t bufferCount) +{ + return window->perform(window, NATIVE_WINDOW_SET_BUFFER_COUNT, bufferCount); +} + +/* + * native_window_set_buffers_geometry(..., int w, int h, int format) + * All buffers dequeued after this call will have the dimensions and format + * specified. A successful call to this function has the same effect as calling + * native_window_set_buffers_size and native_window_set_buffers_format. + * + * XXX: This function is deprecated. The native_window_set_buffers_dimensions + * and native_window_set_buffers_format functions should be used instead. + */ +static inline int native_window_set_buffers_geometry( + struct ANativeWindow* window, + int w, int h, int format) __deprecated; + +static inline int native_window_set_buffers_geometry( + struct ANativeWindow* window, + int w, int h, int format) +{ + return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_GEOMETRY, + w, h, format); +} + +/* + * native_window_set_buffers_dimensions(..., int w, int h) + * All buffers dequeued after this call will have the dimensions specified. + * In particular, all buffers will have a fixed-size, independent from the + * native-window size. They will be scaled according to the scaling mode + * (see native_window_set_scaling_mode) upon window composition. + * + * If w and h are 0, the normal behavior is restored. That is, dequeued buffers + * following this call will be sized to match the window's size. + * + * Calling this function will reset the window crop to a NULL value, which + * disables cropping of the buffers. + */ +static inline int native_window_set_buffers_dimensions( + struct ANativeWindow* window, + int w, int h) +{ + return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS, + w, h); +} + +/* + * native_window_set_buffers_user_dimensions(..., int w, int h) + * + * Sets the user buffer size for the window, which overrides the + * window's size. All buffers dequeued after this call will have the + * dimensions specified unless overridden by + * native_window_set_buffers_dimensions. All buffers will have a + * fixed-size, independent from the native-window size. They will be + * scaled according to the scaling mode (see + * native_window_set_scaling_mode) upon window composition. + * + * If w and h are 0, the normal behavior is restored. That is, the + * default buffer size will match the windows's size. + * + * Calling this function will reset the window crop to a NULL value, which + * disables cropping of the buffers. + */ +static inline int native_window_set_buffers_user_dimensions( + struct ANativeWindow* window, + int w, int h) +{ + return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS, + w, h); +} + +/* + * native_window_set_buffers_format(..., int format) + * All buffers dequeued after this call will have the format specified. + * + * If the specified format is 0, the default buffer format will be used. + */ +static inline int native_window_set_buffers_format( + struct ANativeWindow* window, + int format) +{ + return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_FORMAT, format); +} + +/* + * native_window_set_buffers_data_space(..., int dataSpace) + * All buffers queued after this call will be associated with the dataSpace + * parameter specified. + * + * dataSpace specifies additional information about the buffer that's dependent + * on the buffer format and the endpoints. For example, it can be used to convey + * the color space of the image data in the buffer, or it can be used to + * indicate that the buffers contain depth measurement data instead of color + * images. The default dataSpace is 0, HAL_DATASPACE_UNKNOWN, unless it has been + * overridden by the consumer. + */ +static inline int native_window_set_buffers_data_space( + struct ANativeWindow* window, + android_dataspace_t dataSpace) +{ + return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_DATASPACE, + dataSpace); +} + +/* + * native_window_set_buffers_transform(..., int transform) + * All buffers queued after this call will be displayed transformed according + * to the transform parameter specified. + */ +static inline int native_window_set_buffers_transform( + struct ANativeWindow* window, + int transform) +{ + return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TRANSFORM, + transform); +} + +/* + * native_window_set_buffers_sticky_transform(..., int transform) + * All buffers queued after this call will be displayed transformed according + * to the transform parameter specified applied on top of the regular buffer + * transform. Setting this transform will disable the transform hint. + * + * Temporary - This is only intended to be used by the LEGACY camera mode, do + * not use this for anything else. + */ +static inline int native_window_set_buffers_sticky_transform( + struct ANativeWindow* window, + int transform) +{ + return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_STICKY_TRANSFORM, + transform); +} + +/* + * native_window_set_buffers_timestamp(..., int64_t timestamp) + * All buffers queued after this call will be associated with the timestamp + * parameter specified. If the timestamp is set to NATIVE_WINDOW_TIMESTAMP_AUTO + * (the default), timestamps will be generated automatically when queueBuffer is + * called. The timestamp is measured in nanoseconds, and is normally monotonically + * increasing. The timestamp should be unaffected by time-of-day adjustments, + * and for a camera should be strictly monotonic but for a media player may be + * reset when the position is set. + */ +static inline int native_window_set_buffers_timestamp( + struct ANativeWindow* window, + int64_t timestamp) +{ + return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP, + timestamp); +} + +/* + * native_window_set_scaling_mode(..., int mode) + * All buffers queued after this call will be associated with the scaling mode + * specified. + */ +static inline int native_window_set_scaling_mode( + struct ANativeWindow* window, + int mode) +{ + return window->perform(window, NATIVE_WINDOW_SET_SCALING_MODE, + mode); +} + +/* + * native_window_api_connect(..., int api) + * connects an API to this window. only one API can be connected at a time. + * Returns -EINVAL if for some reason the window cannot be connected, which + * can happen if it's connected to some other API. + */ +static inline int native_window_api_connect( + struct ANativeWindow* window, int api) +{ + return window->perform(window, NATIVE_WINDOW_API_CONNECT, api); +} + +/* + * native_window_api_disconnect(..., int api) + * disconnect the API from this window. + * An error is returned if for instance the window wasn't connected in the + * first place. + */ +static inline int native_window_api_disconnect( + struct ANativeWindow* window, int api) +{ + return window->perform(window, NATIVE_WINDOW_API_DISCONNECT, api); +} + +/* + * native_window_dequeue_buffer_and_wait(...) + * Dequeue a buffer and wait on the fence associated with that buffer. The + * buffer may safely be accessed immediately upon this function returning. An + * error is returned if either of the dequeue or the wait operations fail. + */ +static inline int native_window_dequeue_buffer_and_wait(ANativeWindow *anw, + struct ANativeWindowBuffer** anb) { + return anw->dequeueBuffer_DEPRECATED(anw, anb); +} + +/* + * native_window_set_sideband_stream(..., native_handle_t*) + * Attach a sideband buffer stream to a native window. + */ +static inline int native_window_set_sideband_stream( + struct ANativeWindow* window, + native_handle_t* sidebandHandle) +{ + return window->perform(window, NATIVE_WINDOW_SET_SIDEBAND_STREAM, + sidebandHandle); +} + +/* + * native_window_set_surface_damage(..., android_native_rect_t* rects, int numRects) + * Set the surface damage (i.e., the region of the surface that has changed + * since the previous frame). The damage set by this call will be reset (to the + * default of full-surface damage) after calling queue, so this must be called + * prior to every frame with damage that does not cover the whole surface if the + * caller desires downstream consumers to use this optimization. + * + * The damage region is specified as an array of rectangles, with the important + * caveat that the origin of the surface is considered to be the bottom-left + * corner, as in OpenGL ES. + * + * If numRects is set to 0, rects may be NULL, and the surface damage will be + * set to the full surface (the same as if this function had not been called for + * this frame). + */ +static inline int native_window_set_surface_damage( + struct ANativeWindow* window, + const android_native_rect_t* rects, size_t numRects) +{ + return window->perform(window, NATIVE_WINDOW_SET_SURFACE_DAMAGE, + rects, numRects); +} + +__END_DECLS + +#endif /* SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H */ diff --git a/third_party/android_system_core/include/utils/AndroidThreads.h b/third_party/android_system_core/include/utils/AndroidThreads.h new file mode 100644 index 000000000..aad1e82cb --- /dev/null +++ b/third_party/android_system_core/include/utils/AndroidThreads.h @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2007 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 _LIBS_UTILS_ANDROID_THREADS_H +#define _LIBS_UTILS_ANDROID_THREADS_H + +#include +#include + +#if !defined(_WIN32) +# include +#endif + +#include + +// --------------------------------------------------------------------------- +// C API + +#ifdef __cplusplus +extern "C" { +#endif + +// Create and run a new thread. +extern int androidCreateThread(android_thread_func_t, void *); + +// Create thread with lots of parameters +extern int androidCreateThreadEtc(android_thread_func_t entryFunction, + void *userData, + const char* threadName, + int32_t threadPriority, + size_t threadStackSize, + android_thread_id_t *threadId); + +// Get some sort of unique identifier for the current thread. +extern android_thread_id_t androidGetThreadId(); + +// Low-level thread creation -- never creates threads that can +// interact with the Java VM. +extern int androidCreateRawThreadEtc(android_thread_func_t entryFunction, + void *userData, + const char* threadName, + int32_t threadPriority, + size_t threadStackSize, + android_thread_id_t *threadId); + +// set the same of the running thread +extern void androidSetThreadName(const char* name); + +// Used by the Java Runtime to control how threads are created, so that +// they can be proper and lovely Java threads. +typedef int (*android_create_thread_fn)(android_thread_func_t entryFunction, + void *userData, + const char* threadName, + int32_t threadPriority, + size_t threadStackSize, + android_thread_id_t *threadId); + +extern void androidSetCreateThreadFunc(android_create_thread_fn func); + +// ------------------------------------------------------------------ +// Extra functions working with raw pids. + +#ifdef HAVE_ANDROID_OS +// Change the priority AND scheduling group of a particular thread. The priority +// should be one of the ANDROID_PRIORITY constants. Returns INVALID_OPERATION +// if the priority set failed, else another value if just the group set failed; +// in either case errno is set. Thread ID zero means current thread. +extern int androidSetThreadPriority(pid_t tid, int prio); + +// Get the current priority of a particular thread. Returns one of the +// ANDROID_PRIORITY constants or a negative result in case of error. +extern int androidGetThreadPriority(pid_t tid); +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + +// ---------------------------------------------------------------------------- +// C++ API +#ifdef __cplusplus +namespace android { +// ---------------------------------------------------------------------------- + +// Create and run a new thread. +inline bool createThread(thread_func_t f, void *a) { + return androidCreateThread(f, a) ? true : false; +} + +// Create thread with lots of parameters +inline bool createThreadEtc(thread_func_t entryFunction, + void *userData, + const char* threadName = "android:unnamed_thread", + int32_t threadPriority = PRIORITY_DEFAULT, + size_t threadStackSize = 0, + thread_id_t *threadId = 0) +{ + return androidCreateThreadEtc(entryFunction, userData, threadName, + threadPriority, threadStackSize, threadId) ? true : false; +} + +// Get some sort of unique identifier for the current thread. +inline thread_id_t getThreadId() { + return androidGetThreadId(); +} + +// ---------------------------------------------------------------------------- +}; // namespace android +#endif // __cplusplus +// ---------------------------------------------------------------------------- + +#endif // _LIBS_UTILS_ANDROID_THREADS_H diff --git a/third_party/android_system_core/include/utils/Atomic.h b/third_party/android_system_core/include/utils/Atomic.h new file mode 100644 index 000000000..7eb476c94 --- /dev/null +++ b/third_party/android_system_core/include/utils/Atomic.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2005 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_UTILS_ATOMIC_H +#define ANDROID_UTILS_ATOMIC_H + +#include + +#endif // ANDROID_UTILS_ATOMIC_H diff --git a/third_party/android_system_core/include/utils/BasicHashtable.h b/third_party/android_system_core/include/utils/BasicHashtable.h new file mode 100644 index 000000000..c235d6252 --- /dev/null +++ b/third_party/android_system_core/include/utils/BasicHashtable.h @@ -0,0 +1,402 @@ +/* + * 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_BASIC_HASHTABLE_H +#define ANDROID_BASIC_HASHTABLE_H + +#include +#include +#include +#include + +namespace android { + +/* Implementation type. Nothing to see here. */ +class BasicHashtableImpl { +protected: + struct Bucket { + // The collision flag indicates that the bucket is part of a collision chain + // such that at least two entries both hash to this bucket. When true, we + // may need to seek further along the chain to find the entry. + static const uint32_t COLLISION = 0x80000000UL; + + // The present flag indicates that the bucket contains an initialized entry value. + static const uint32_t PRESENT = 0x40000000UL; + + // Mask for 30 bits worth of the hash code that are stored within the bucket to + // speed up lookups and rehashing by eliminating the need to recalculate the + // hash code of the entry's key. + static const uint32_t HASH_MASK = 0x3fffffffUL; + + // Combined value that stores the collision and present flags as well as + // a 30 bit hash code. + uint32_t cookie; + + // Storage for the entry begins here. + char entry[0]; + }; + + BasicHashtableImpl(size_t entrySize, bool hasTrivialDestructor, + size_t minimumInitialCapacity, float loadFactor); + BasicHashtableImpl(const BasicHashtableImpl& other); + virtual ~BasicHashtableImpl(); + + void dispose(); + + inline void edit() { + if (mBuckets && !SharedBuffer::bufferFromData(mBuckets)->onlyOwner()) { + clone(); + } + } + + void setTo(const BasicHashtableImpl& other); + void clear(); + + ssize_t next(ssize_t index) const; + ssize_t find(ssize_t index, hash_t hash, const void* __restrict__ key) const; + size_t add(hash_t hash, const void* __restrict__ entry); + void removeAt(size_t index); + void rehash(size_t minimumCapacity, float loadFactor); + + const size_t mBucketSize; // number of bytes per bucket including the entry + const bool mHasTrivialDestructor; // true if the entry type does not require destruction + size_t mCapacity; // number of buckets that can be filled before exceeding load factor + float mLoadFactor; // load factor + size_t mSize; // number of elements actually in the table + size_t mFilledBuckets; // number of buckets for which collision or present is true + size_t mBucketCount; // number of slots in the mBuckets array + void* mBuckets; // array of buckets, as a SharedBuffer + + inline const Bucket& bucketAt(const void* __restrict__ buckets, size_t index) const { + return *reinterpret_cast( + static_cast(buckets) + index * mBucketSize); + } + + inline Bucket& bucketAt(void* __restrict__ buckets, size_t index) const { + return *reinterpret_cast(static_cast(buckets) + index * mBucketSize); + } + + virtual bool compareBucketKey(const Bucket& bucket, const void* __restrict__ key) const = 0; + virtual void initializeBucketEntry(Bucket& bucket, const void* __restrict__ entry) const = 0; + virtual void destroyBucketEntry(Bucket& bucket) const = 0; + +private: + void clone(); + + // Allocates a bucket array as a SharedBuffer. + void* allocateBuckets(size_t count) const; + + // Releases a bucket array's associated SharedBuffer. + void releaseBuckets(void* __restrict__ buckets, size_t count) const; + + // Destroys the contents of buckets (invokes destroyBucketEntry for each + // populated bucket if needed). + void destroyBuckets(void* __restrict__ buckets, size_t count) const; + + // Copies the content of buckets (copies the cookie and invokes copyBucketEntry + // for each populated bucket if needed). + void copyBuckets(const void* __restrict__ fromBuckets, + void* __restrict__ toBuckets, size_t count) const; + + // Determines the appropriate size of a bucket array to store a certain minimum + // number of entries and returns its effective capacity. + static void determineCapacity(size_t minimumCapacity, float loadFactor, + size_t* __restrict__ outBucketCount, size_t* __restrict__ outCapacity); + + // Trim a hash code to 30 bits to match what we store in the bucket's cookie. + inline static hash_t trimHash(hash_t hash) { + return (hash & Bucket::HASH_MASK) ^ (hash >> 30); + } + + // Returns the index of the first bucket that is in the collision chain + // for the specified hash code, given the total number of buckets. + // (Primary hash) + inline static size_t chainStart(hash_t hash, size_t count) { + return hash % count; + } + + // Returns the increment to add to a bucket index to seek to the next bucket + // in the collision chain for the specified hash code, given the total number of buckets. + // (Secondary hash) + inline static size_t chainIncrement(hash_t hash, size_t count) { + return ((hash >> 7) | (hash << 25)) % (count - 1) + 1; + } + + // Returns the index of the next bucket that is in the collision chain + // that is defined by the specified increment, given the total number of buckets. + inline static size_t chainSeek(size_t index, size_t increment, size_t count) { + return (index + increment) % count; + } +}; + +/* + * A BasicHashtable stores entries that are indexed by hash code in place + * within an array. The basic operations are finding entries by key, + * adding new entries and removing existing entries. + * + * This class provides a very limited set of operations with simple semantics. + * It is intended to be used as a building block to construct more complex + * and interesting data structures such as HashMap. Think very hard before + * adding anything extra to BasicHashtable, it probably belongs at a + * higher level of abstraction. + * + * TKey: The key type. + * TEntry: The entry type which is what is actually stored in the array. + * + * TKey must support the following contract: + * bool operator==(const TKey& other) const; // return true if equal + * bool operator!=(const TKey& other) const; // return true if unequal + * + * TEntry must support the following contract: + * const TKey& getKey() const; // get the key from the entry + * + * This class supports storing entries with duplicate keys. Of course, it can't + * tell them apart during removal so only the first entry will be removed. + * We do this because it means that operations like add() can't fail. + */ +template +class BasicHashtable : private BasicHashtableImpl { +public: + /* Creates a hashtable with the specified minimum initial capacity. + * The underlying array will be created when the first entry is added. + * + * minimumInitialCapacity: The minimum initial capacity for the hashtable. + * Default is 0. + * loadFactor: The desired load factor for the hashtable, between 0 and 1. + * Default is 0.75. + */ + BasicHashtable(size_t minimumInitialCapacity = 0, float loadFactor = 0.75f); + + /* Copies a hashtable. + * The underlying storage is shared copy-on-write. + */ + BasicHashtable(const BasicHashtable& other); + + /* Clears and destroys the hashtable. + */ + virtual ~BasicHashtable(); + + /* Making this hashtable a copy of the other hashtable. + * The underlying storage is shared copy-on-write. + * + * other: The hashtable to copy. + */ + inline BasicHashtable& operator =(const BasicHashtable & other) { + setTo(other); + return *this; + } + + /* Returns the number of entries in the hashtable. + */ + inline size_t size() const { + return mSize; + } + + /* Returns the capacity of the hashtable, which is the number of elements that can + * added to the hashtable without requiring it to be grown. + */ + inline size_t capacity() const { + return mCapacity; + } + + /* Returns the number of buckets that the hashtable has, which is the size of its + * underlying array. + */ + inline size_t bucketCount() const { + return mBucketCount; + } + + /* Returns the load factor of the hashtable. */ + inline float loadFactor() const { + return mLoadFactor; + }; + + /* Returns a const reference to the entry at the specified index. + * + * index: The index of the entry to retrieve. Must be a valid index within + * the bounds of the hashtable. + */ + inline const TEntry& entryAt(size_t index) const { + return entryFor(bucketAt(mBuckets, index)); + } + + /* Returns a non-const reference to the entry at the specified index. + * + * index: The index of the entry to edit. Must be a valid index within + * the bounds of the hashtable. + */ + inline TEntry& editEntryAt(size_t index) { + edit(); + return entryFor(bucketAt(mBuckets, index)); + } + + /* Clears the hashtable. + * All entries in the hashtable are destroyed immediately. + * If you need to do something special with the entries in the hashtable then iterate + * over them and do what you need before clearing the hashtable. + */ + inline void clear() { + BasicHashtableImpl::clear(); + } + + /* Returns the index of the next entry in the hashtable given the index of a previous entry. + * If the given index is -1, then returns the index of the first entry in the hashtable, + * if there is one, or -1 otherwise. + * If the given index is not -1, then returns the index of the next entry in the hashtable, + * in strictly increasing order, or -1 if there are none left. + * + * index: The index of the previous entry that was iterated, or -1 to begin + * iteration at the beginning of the hashtable. + */ + inline ssize_t next(ssize_t index) const { + return BasicHashtableImpl::next(index); + } + + /* Finds the index of an entry with the specified key. + * If the given index is -1, then returns the index of the first matching entry, + * otherwise returns the index of the next matching entry. + * If the hashtable contains multiple entries with keys that match the requested + * key, then the sequence of entries returned is arbitrary. + * Returns -1 if no entry was found. + * + * index: The index of the previous entry with the specified key, or -1 to + * find the first matching entry. + * hash: The hashcode of the key. + * key: The key. + */ + inline ssize_t find(ssize_t index, hash_t hash, const TKey& key) const { + return BasicHashtableImpl::find(index, hash, &key); + } + + /* Adds the entry to the hashtable. + * Returns the index of the newly added entry. + * If an entry with the same key already exists, then a duplicate entry is added. + * If the entry will not fit, then the hashtable's capacity is increased and + * its contents are rehashed. See rehash(). + * + * hash: The hashcode of the key. + * entry: The entry to add. + */ + inline size_t add(hash_t hash, const TEntry& entry) { + return BasicHashtableImpl::add(hash, &entry); + } + + /* Removes the entry with the specified index from the hashtable. + * The entry is destroyed immediately. + * The index must be valid. + * + * The hashtable is not compacted after an item is removed, so it is legal + * to continue iterating over the hashtable using next() or find(). + * + * index: The index of the entry to remove. Must be a valid index within the + * bounds of the hashtable, and it must refer to an existing entry. + */ + inline void removeAt(size_t index) { + BasicHashtableImpl::removeAt(index); + } + + /* Rehashes the contents of the hashtable. + * Grows the hashtable to at least the specified minimum capacity or the + * current number of elements, whichever is larger. + * + * Rehashing causes all entries to be copied and the entry indices may change. + * Although the hash codes are cached by the hashtable, rehashing can be an + * expensive operation and should be avoided unless the hashtable's size + * needs to be changed. + * + * Rehashing is the only way to change the capacity or load factor of the + * hashtable once it has been created. It can be used to compact the + * hashtable by choosing a minimum capacity that is smaller than the current + * capacity (such as 0). + * + * minimumCapacity: The desired minimum capacity after rehashing. + * loadFactor: The desired load factor after rehashing. + */ + inline void rehash(size_t minimumCapacity, float loadFactor) { + BasicHashtableImpl::rehash(minimumCapacity, loadFactor); + } + + /* Determines whether there is room to add another entry without rehashing. + * When this returns true, a subsequent add() operation is guaranteed to + * complete without performing a rehash. + */ + inline bool hasMoreRoom() const { + return mCapacity > mFilledBuckets; + } + +protected: + static inline const TEntry& entryFor(const Bucket& bucket) { + return reinterpret_cast(bucket.entry); + } + + static inline TEntry& entryFor(Bucket& bucket) { + return reinterpret_cast(bucket.entry); + } + + virtual bool compareBucketKey(const Bucket& bucket, const void* __restrict__ key) const; + virtual void initializeBucketEntry(Bucket& bucket, const void* __restrict__ entry) const; + virtual void destroyBucketEntry(Bucket& bucket) const; + +private: + // For dumping the raw contents of a hashtable during testing. + friend class BasicHashtableTest; + inline uint32_t cookieAt(size_t index) const { + return bucketAt(mBuckets, index).cookie; + } +}; + +template +BasicHashtable::BasicHashtable(size_t minimumInitialCapacity, float loadFactor) : + BasicHashtableImpl(sizeof(TEntry), traits::has_trivial_dtor, + minimumInitialCapacity, loadFactor) { +} + +template +BasicHashtable::BasicHashtable(const BasicHashtable& other) : + BasicHashtableImpl(other) { +} + +template +BasicHashtable::~BasicHashtable() { + dispose(); +} + +template +bool BasicHashtable::compareBucketKey(const Bucket& bucket, + const void* __restrict__ key) const { + return entryFor(bucket).getKey() == *static_cast(key); +} + +template +void BasicHashtable::initializeBucketEntry(Bucket& bucket, + const void* __restrict__ entry) const { + if (!traits::has_trivial_copy) { + new (&entryFor(bucket)) TEntry(*(static_cast(entry))); + } else { + memcpy(&entryFor(bucket), entry, sizeof(TEntry)); + } +} + +template +void BasicHashtable::destroyBucketEntry(Bucket& bucket) const { + if (!traits::has_trivial_dtor) { + entryFor(bucket).~TEntry(); + } +} + +}; // namespace android + +#endif // ANDROID_BASIC_HASHTABLE_H diff --git a/third_party/android_system_core/include/utils/BitSet.h b/third_party/android_system_core/include/utils/BitSet.h new file mode 100644 index 000000000..8c612931d --- /dev/null +++ b/third_party/android_system_core/include/utils/BitSet.h @@ -0,0 +1,294 @@ +/* + * Copyright (C) 2010 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 UTILS_BITSET_H +#define UTILS_BITSET_H + +#include +#include + +/* + * Contains some bit manipulation helpers. + */ + +namespace android { + +// A simple set of 32 bits that can be individually marked or cleared. +struct BitSet32 { + uint32_t value; + + inline BitSet32() : value(0UL) { } + explicit inline BitSet32(uint32_t value) : value(value) { } + + // Gets the value associated with a particular bit index. + static inline uint32_t valueForBit(uint32_t n) { return 0x80000000UL >> n; } + + // Clears the bit set. + inline void clear() { clear(value); } + + static inline void clear(uint32_t& value) { value = 0UL; } + + // Returns the number of marked bits in the set. + inline uint32_t count() const { return count(value); } + + static inline uint32_t count(uint32_t value) { return __builtin_popcountl(value); } + + // Returns true if the bit set does not contain any marked bits. + inline bool isEmpty() const { return isEmpty(value); } + + static inline bool isEmpty(uint32_t value) { return ! value; } + + // Returns true if the bit set does not contain any unmarked bits. + inline bool isFull() const { return isFull(value); } + + static inline bool isFull(uint32_t value) { return value == 0xffffffffUL; } + + // Returns true if the specified bit is marked. + inline bool hasBit(uint32_t n) const { return hasBit(value, n); } + + static inline bool hasBit(uint32_t value, uint32_t n) { return value & valueForBit(n); } + + // Marks the specified bit. + inline void markBit(uint32_t n) { markBit(value, n); } + + static inline void markBit (uint32_t& value, uint32_t n) { value |= valueForBit(n); } + + // Clears the specified bit. + inline void clearBit(uint32_t n) { clearBit(value, n); } + + static inline void clearBit(uint32_t& value, uint32_t n) { value &= ~ valueForBit(n); } + + // Finds the first marked bit in the set. + // Result is undefined if all bits are unmarked. + inline uint32_t firstMarkedBit() const { return firstMarkedBit(value); } + + static uint32_t firstMarkedBit(uint32_t value) { return clz_checked(value); } + + // Finds the first unmarked bit in the set. + // Result is undefined if all bits are marked. + inline uint32_t firstUnmarkedBit() const { return firstUnmarkedBit(value); } + + static inline uint32_t firstUnmarkedBit(uint32_t value) { return clz_checked(~ value); } + + // Finds the last marked bit in the set. + // Result is undefined if all bits are unmarked. + inline uint32_t lastMarkedBit() const { return lastMarkedBit(value); } + + static inline uint32_t lastMarkedBit(uint32_t value) { return 31 - ctz_checked(value); } + + // Finds the first marked bit in the set and clears it. Returns the bit index. + // Result is undefined if all bits are unmarked. + inline uint32_t clearFirstMarkedBit() { return clearFirstMarkedBit(value); } + + static inline uint32_t clearFirstMarkedBit(uint32_t& value) { + uint32_t n = firstMarkedBit(value); + clearBit(value, n); + return n; + } + + // Finds the first unmarked bit in the set and marks it. Returns the bit index. + // Result is undefined if all bits are marked. + inline uint32_t markFirstUnmarkedBit() { return markFirstUnmarkedBit(value); } + + static inline uint32_t markFirstUnmarkedBit(uint32_t& value) { + uint32_t n = firstUnmarkedBit(value); + markBit(value, n); + return n; + } + + // Finds the last marked bit in the set and clears it. Returns the bit index. + // Result is undefined if all bits are unmarked. + inline uint32_t clearLastMarkedBit() { return clearLastMarkedBit(value); } + + static inline uint32_t clearLastMarkedBit(uint32_t& value) { + uint32_t n = lastMarkedBit(value); + clearBit(value, n); + return n; + } + + // Gets the index of the specified bit in the set, which is the number of + // marked bits that appear before the specified bit. + inline uint32_t getIndexOfBit(uint32_t n) const { + return getIndexOfBit(value, n); + } + + static inline uint32_t getIndexOfBit(uint32_t value, uint32_t n) { + return __builtin_popcountl(value & ~(0xffffffffUL >> n)); + } + + inline bool operator== (const BitSet32& other) const { return value == other.value; } + inline bool operator!= (const BitSet32& other) const { return value != other.value; } + inline BitSet32 operator& (const BitSet32& other) const { + return BitSet32(value & other.value); + } + inline BitSet32& operator&= (const BitSet32& other) { + value &= other.value; + return *this; + } + inline BitSet32 operator| (const BitSet32& other) const { + return BitSet32(value | other.value); + } + inline BitSet32& operator|= (const BitSet32& other) { + value |= other.value; + return *this; + } + +private: + // We use these helpers as the signature of __builtin_c{l,t}z has "unsigned int" for the + // input, which is only guaranteed to be 16b, not 32. The compiler should optimize this away. + static inline uint32_t clz_checked(uint32_t value) { + if (sizeof(unsigned int) == sizeof(uint32_t)) { + return __builtin_clz(value); + } else { + return __builtin_clzl(value); + } + } + + static inline uint32_t ctz_checked(uint32_t value) { + if (sizeof(unsigned int) == sizeof(uint32_t)) { + return __builtin_ctz(value); + } else { + return __builtin_ctzl(value); + } + } +}; + +ANDROID_BASIC_TYPES_TRAITS(BitSet32) + +// A simple set of 64 bits that can be individually marked or cleared. +struct BitSet64 { + uint64_t value; + + inline BitSet64() : value(0ULL) { } + explicit inline BitSet64(uint64_t value) : value(value) { } + + // Gets the value associated with a particular bit index. + static inline uint64_t valueForBit(uint32_t n) { return 0x8000000000000000ULL >> n; } + + // Clears the bit set. + inline void clear() { clear(value); } + + static inline void clear(uint64_t& value) { value = 0ULL; } + + // Returns the number of marked bits in the set. + inline uint32_t count() const { return count(value); } + + static inline uint32_t count(uint64_t value) { return __builtin_popcountll(value); } + + // Returns true if the bit set does not contain any marked bits. + inline bool isEmpty() const { return isEmpty(value); } + + static inline bool isEmpty(uint64_t value) { return ! value; } + + // Returns true if the bit set does not contain any unmarked bits. + inline bool isFull() const { return isFull(value); } + + static inline bool isFull(uint64_t value) { return value == 0xffffffffffffffffULL; } + + // Returns true if the specified bit is marked. + inline bool hasBit(uint32_t n) const { return hasBit(value, n); } + + static inline bool hasBit(uint64_t value, uint32_t n) { return value & valueForBit(n); } + + // Marks the specified bit. + inline void markBit(uint32_t n) { markBit(value, n); } + + static inline void markBit(uint64_t& value, uint32_t n) { value |= valueForBit(n); } + + // Clears the specified bit. + inline void clearBit(uint32_t n) { clearBit(value, n); } + + static inline void clearBit(uint64_t& value, uint32_t n) { value &= ~ valueForBit(n); } + + // Finds the first marked bit in the set. + // Result is undefined if all bits are unmarked. + inline uint32_t firstMarkedBit() const { return firstMarkedBit(value); } + + static inline uint32_t firstMarkedBit(uint64_t value) { return __builtin_clzll(value); } + + // Finds the first unmarked bit in the set. + // Result is undefined if all bits are marked. + inline uint32_t firstUnmarkedBit() const { return firstUnmarkedBit(value); } + + static inline uint32_t firstUnmarkedBit(uint64_t value) { return __builtin_clzll(~ value); } + + // Finds the last marked bit in the set. + // Result is undefined if all bits are unmarked. + inline uint32_t lastMarkedBit() const { return lastMarkedBit(value); } + + static inline uint32_t lastMarkedBit(uint64_t value) { return 63 - __builtin_ctzll(value); } + + // Finds the first marked bit in the set and clears it. Returns the bit index. + // Result is undefined if all bits are unmarked. + inline uint32_t clearFirstMarkedBit() { return clearFirstMarkedBit(value); } + + static inline uint32_t clearFirstMarkedBit(uint64_t& value) { + uint64_t n = firstMarkedBit(value); + clearBit(value, n); + return n; + } + + // Finds the first unmarked bit in the set and marks it. Returns the bit index. + // Result is undefined if all bits are marked. + inline uint32_t markFirstUnmarkedBit() { return markFirstUnmarkedBit(value); } + + static inline uint32_t markFirstUnmarkedBit(uint64_t& value) { + uint64_t n = firstUnmarkedBit(value); + markBit(value, n); + return n; + } + + // Finds the last marked bit in the set and clears it. Returns the bit index. + // Result is undefined if all bits are unmarked. + inline uint32_t clearLastMarkedBit() { return clearLastMarkedBit(value); } + + static inline uint32_t clearLastMarkedBit(uint64_t& value) { + uint64_t n = lastMarkedBit(value); + clearBit(value, n); + return n; + } + + // Gets the index of the specified bit in the set, which is the number of + // marked bits that appear before the specified bit. + inline uint32_t getIndexOfBit(uint32_t n) const { return getIndexOfBit(value, n); } + + static inline uint32_t getIndexOfBit(uint64_t value, uint32_t n) { + return __builtin_popcountll(value & ~(0xffffffffffffffffULL >> n)); + } + + inline bool operator== (const BitSet64& other) const { return value == other.value; } + inline bool operator!= (const BitSet64& other) const { return value != other.value; } + inline BitSet64 operator& (const BitSet64& other) const { + return BitSet64(value & other.value); + } + inline BitSet64& operator&= (const BitSet64& other) { + value &= other.value; + return *this; + } + inline BitSet64 operator| (const BitSet64& other) const { + return BitSet64(value | other.value); + } + inline BitSet64& operator|= (const BitSet64& other) { + value |= other.value; + return *this; + } +}; + +ANDROID_BASIC_TYPES_TRAITS(BitSet64) + +} // namespace android + +#endif // UTILS_BITSET_H diff --git a/third_party/android_system_core/include/utils/BlobCache.h b/third_party/android_system_core/include/utils/BlobCache.h new file mode 100644 index 000000000..65dca9fb4 --- /dev/null +++ b/third_party/android_system_core/include/utils/BlobCache.h @@ -0,0 +1,249 @@ +/* + ** Copyright 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_BLOB_CACHE_H +#define ANDROID_BLOB_CACHE_H + +#include + +#include +#include +#include +#include + +namespace android { + +// A BlobCache is an in-memory cache for binary key/value pairs. A BlobCache +// does NOT provide any thread-safety guarantees. +// +// The cache contents can be serialized to an in-memory buffer or mmap'd file +// and then reloaded in a subsequent execution of the program. This +// serialization is non-portable and the data should only be used by the device +// that generated it. +class BlobCache : public RefBase { + +public: + + // Create an empty blob cache. The blob cache will cache key/value pairs + // with key and value sizes less than or equal to maxKeySize and + // maxValueSize, respectively. The total combined size of ALL cache entries + // (key sizes plus value sizes) will not exceed maxTotalSize. + BlobCache(size_t maxKeySize, size_t maxValueSize, size_t maxTotalSize); + + // set inserts a new binary value into the cache and associates it with the + // given binary key. If the key or value are too large for the cache then + // the cache remains unchanged. This includes the case where a different + // value was previously associated with the given key - the old value will + // remain in the cache. If the given key and value are small enough to be + // put in the cache (based on the maxKeySize, maxValueSize, and maxTotalSize + // values specified to the BlobCache constructor), then the key/value pair + // will be in the cache after set returns. Note, however, that a subsequent + // call to set may evict old key/value pairs from the cache. + // + // Preconditions: + // key != NULL + // 0 < keySize + // value != NULL + // 0 < valueSize + void set(const void* key, size_t keySize, const void* value, + size_t valueSize); + + // get retrieves from the cache the binary value associated with a given + // binary key. If the key is present in the cache then the length of the + // binary value associated with that key is returned. If the value argument + // is non-NULL and the size of the cached value is less than valueSize bytes + // then the cached value is copied into the buffer pointed to by the value + // argument. If the key is not present in the cache then 0 is returned and + // the buffer pointed to by the value argument is not modified. + // + // Note that when calling get multiple times with the same key, the later + // calls may fail, returning 0, even if earlier calls succeeded. The return + // value must be checked for each call. + // + // Preconditions: + // key != NULL + // 0 < keySize + // 0 <= valueSize + size_t get(const void* key, size_t keySize, void* value, size_t valueSize); + + + // getFlattenedSize returns the number of bytes needed to store the entire + // serialized cache. + size_t getFlattenedSize() const; + + // flatten serializes the current contents of the cache into the memory + // pointed to by 'buffer'. The serialized cache contents can later be + // loaded into a BlobCache object using the unflatten method. The contents + // of the BlobCache object will not be modified. + // + // Preconditions: + // size >= this.getFlattenedSize() + status_t flatten(void* buffer, size_t size) const; + + // unflatten replaces the contents of the cache with the serialized cache + // contents in the memory pointed to by 'buffer'. The previous contents of + // the BlobCache will be evicted from the cache. If an error occurs while + // unflattening the serialized cache contents then the BlobCache will be + // left in an empty state. + // + status_t unflatten(void const* buffer, size_t size); + +private: + // Copying is disallowed. + BlobCache(const BlobCache&); + void operator=(const BlobCache&); + + // A random function helper to get around MinGW not having nrand48() + long int blob_random(); + + // clean evicts a randomly chosen set of entries from the cache such that + // the total size of all remaining entries is less than mMaxTotalSize/2. + void clean(); + + // isCleanable returns true if the cache is full enough for the clean method + // to have some effect, and false otherwise. + bool isCleanable() const; + + // A Blob is an immutable sized unstructured data blob. + class Blob : public RefBase { + public: + Blob(const void* data, size_t size, bool copyData); + ~Blob(); + + bool operator<(const Blob& rhs) const; + + const void* getData() const; + size_t getSize() const; + + private: + // Copying is not allowed. + Blob(const Blob&); + void operator=(const Blob&); + + // mData points to the buffer containing the blob data. + const void* mData; + + // mSize is the size of the blob data in bytes. + size_t mSize; + + // mOwnsData indicates whether or not this Blob object should free the + // memory pointed to by mData when the Blob gets destructed. + bool mOwnsData; + }; + + // A CacheEntry is a single key/value pair in the cache. + class CacheEntry { + public: + CacheEntry(); + CacheEntry(const sp& key, const sp& value); + CacheEntry(const CacheEntry& ce); + + bool operator<(const CacheEntry& rhs) const; + const CacheEntry& operator=(const CacheEntry&); + + sp getKey() const; + sp getValue() const; + + void setValue(const sp& value); + + private: + + // mKey is the key that identifies the cache entry. + sp mKey; + + // mValue is the cached data associated with the key. + sp mValue; + }; + + // A Header is the header for the entire BlobCache serialization format. No + // need to make this portable, so we simply write the struct out. + struct Header { + // mMagicNumber is the magic number that identifies the data as + // serialized BlobCache contents. It must always contain 'Blb$'. + uint32_t mMagicNumber; + + // mBlobCacheVersion is the serialization format version. + uint32_t mBlobCacheVersion; + + // mDeviceVersion is the device-specific version of the cache. This can + // be used to invalidate the cache. + uint32_t mDeviceVersion; + + // mNumEntries is number of cache entries following the header in the + // data. + size_t mNumEntries; + + // mBuildId is the build id of the device when the cache was created. + // When an update to the build happens (via an OTA or other update) this + // is used to invalidate the cache. + int mBuildIdLength; + char mBuildId[]; + }; + + // An EntryHeader is the header for a serialized cache entry. No need to + // make this portable, so we simply write the struct out. Each EntryHeader + // is followed imediately by the key data and then the value data. + // + // The beginning of each serialized EntryHeader is 4-byte aligned, so the + // number of bytes that a serialized cache entry will occupy is: + // + // ((sizeof(EntryHeader) + keySize + valueSize) + 3) & ~3 + // + struct EntryHeader { + // mKeySize is the size of the entry key in bytes. + size_t mKeySize; + + // mValueSize is the size of the entry value in bytes. + size_t mValueSize; + + // mData contains both the key and value data for the cache entry. The + // key comes first followed immediately by the value. + uint8_t mData[]; + }; + + // mMaxKeySize is the maximum key size that will be cached. Calls to + // BlobCache::set with a keySize parameter larger than mMaxKeySize will + // simply not add the key/value pair to the cache. + const size_t mMaxKeySize; + + // mMaxValueSize is the maximum value size that will be cached. Calls to + // BlobCache::set with a valueSize parameter larger than mMaxValueSize will + // simply not add the key/value pair to the cache. + const size_t mMaxValueSize; + + // mMaxTotalSize is the maximum size that all cache entries can occupy. This + // includes space for both keys and values. When a call to BlobCache::set + // would otherwise cause this limit to be exceeded, either the key/value + // pair passed to BlobCache::set will not be cached or other cache entries + // will be evicted from the cache to make room for the new entry. + const size_t mMaxTotalSize; + + // mTotalSize is the total combined size of all keys and values currently in + // the cache. + size_t mTotalSize; + + // mRandState is the pseudo-random number generator state. It is passed to + // nrand48 to generate random numbers when needed. + unsigned short mRandState[3]; + + // mCacheEntries stores all the cache entries that are resident in memory. + // Cache entries are added to it by the 'set' method. + SortedVector mCacheEntries; +}; + +} + +#endif // ANDROID_BLOB_CACHE_H diff --git a/third_party/android_system_core/include/utils/ByteOrder.h b/third_party/android_system_core/include/utils/ByteOrder.h new file mode 100644 index 000000000..baa3a83dd --- /dev/null +++ b/third_party/android_system_core/include/utils/ByteOrder.h @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2006 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 _LIBS_UTILS_BYTE_ORDER_H +#define _LIBS_UTILS_BYTE_ORDER_H + +#include +#include +#ifdef HAVE_WINSOCK +#include +#else +#include +#endif + +/* + * These macros are like the hton/ntoh byte swapping macros, + * except they allow you to swap to and from the "device" byte + * order. The device byte order is the endianness of the target + * device -- for the ARM CPUs we use today, this is little endian. + * + * Note that the byte swapping functions have not been optimized + * much; performance is currently not an issue for them since the + * intent is to allow us to avoid byte swapping on the device. + */ + +static inline uint32_t android_swap_long(uint32_t v) +{ + return (v<<24) | ((v<<8)&0x00FF0000) | ((v>>8)&0x0000FF00) | (v>>24); +} + +static inline uint16_t android_swap_short(uint16_t v) +{ + return (v<<8) | (v>>8); +} + +#define DEVICE_BYTE_ORDER LITTLE_ENDIAN + +#if BYTE_ORDER == DEVICE_BYTE_ORDER + +#define dtohl(x) (x) +#define dtohs(x) (x) +#define htodl(x) (x) +#define htods(x) (x) + +#else + +#define dtohl(x) (android_swap_long(x)) +#define dtohs(x) (android_swap_short(x)) +#define htodl(x) (android_swap_long(x)) +#define htods(x) (android_swap_short(x)) + +#endif + +#if BYTE_ORDER == LITTLE_ENDIAN +#define fromlel(x) (x) +#define fromles(x) (x) +#define tolel(x) (x) +#define toles(x) (x) +#else +#define fromlel(x) (android_swap_long(x)) +#define fromles(x) (android_swap_short(x)) +#define tolel(x) (android_swap_long(x)) +#define toles(x) (android_swap_short(x)) +#endif + +#endif // _LIBS_UTILS_BYTE_ORDER_H diff --git a/third_party/android_system_core/include/utils/CallStack.h b/third_party/android_system_core/include/utils/CallStack.h new file mode 100644 index 000000000..27e89f462 --- /dev/null +++ b/third_party/android_system_core/include/utils/CallStack.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2007 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_CALLSTACK_H +#define ANDROID_CALLSTACK_H + +#include +#include +#include +#include + +#include +#include + +namespace android { + +class Printer; + +// Collect/print the call stack (function, file, line) traces for a single thread. +class CallStack { +public: + // Create an empty call stack. No-op. + CallStack(); + // Create a callstack with the current thread's stack trace. + // Immediately dump it to logcat using the given logtag. + CallStack(const char* logtag, int32_t ignoreDepth=1); + ~CallStack(); + + // Reset the stack frames (same as creating an empty call stack). + void clear() { mFrameLines.clear(); } + + // Immediately collect the stack traces for the specified thread. + // The default is to dump the stack of the current call. + void update(int32_t ignoreDepth=1, pid_t tid=BACKTRACE_CURRENT_THREAD); + + // Dump a stack trace to the log using the supplied logtag. + void log(const char* logtag, + android_LogPriority priority = ANDROID_LOG_DEBUG, + const char* prefix = 0) const; + + // Dump a stack trace to the specified file descriptor. + void dump(int fd, int indent = 0, const char* prefix = 0) const; + + // Return a string (possibly very long) containing the complete stack trace. + String8 toString(const char* prefix = 0) const; + + // Dump a serialized representation of the stack trace to the specified printer. + void print(Printer& printer) const; + + // Get the count of stack frames that are in this call stack. + size_t size() const { return mFrameLines.size(); } + +private: + Vector mFrameLines; +}; + +}; // namespace android + +#endif // ANDROID_CALLSTACK_H diff --git a/third_party/android_system_core/include/utils/Compat.h b/third_party/android_system_core/include/utils/Compat.h new file mode 100644 index 000000000..7d9631027 --- /dev/null +++ b/third_party/android_system_core/include/utils/Compat.h @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2010 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 __LIB_UTILS_COMPAT_H +#define __LIB_UTILS_COMPAT_H + +#include + +#if defined(__APPLE__) + +/* Mac OS has always had a 64-bit off_t, so it doesn't have off64_t. */ + +typedef off_t off64_t; + +static inline off64_t lseek64(int fd, off64_t offset, int whence) { + return lseek(fd, offset, whence); +} + +static inline ssize_t pread64(int fd, void* buf, size_t nbytes, off64_t offset) { + return pread(fd, buf, nbytes, offset); +} + +#endif /* __APPLE__ */ + +#if defined(_WIN32) +#define O_CLOEXEC O_NOINHERIT +#define O_NOFOLLOW 0 +#define DEFFILEMODE 0666 +#endif /* _WIN32 */ + +#if defined(_WIN32) +#define ZD "%ld" +#define ZD_TYPE long +#else +#define ZD "%zd" +#define ZD_TYPE ssize_t +#endif + +/* + * Needed for cases where something should be constexpr if possible, but not + * being constexpr is fine if in pre-C++11 code (such as a const static float + * member variable). + */ +#if __cplusplus >= 201103L +#define CONSTEXPR constexpr +#else +#define CONSTEXPR +#endif + +/* + * TEMP_FAILURE_RETRY is defined by some, but not all, versions of + * . (Alas, it is not as standard as we'd hoped!) So, if it's + * not already defined, then define it here. + */ +#ifndef TEMP_FAILURE_RETRY +/* Used to retry syscalls that can return EINTR. */ +#define TEMP_FAILURE_RETRY(exp) ({ \ + typeof (exp) _rc; \ + do { \ + _rc = (exp); \ + } while (_rc == -1 && errno == EINTR); \ + _rc; }) +#endif + +#endif /* __LIB_UTILS_COMPAT_H */ diff --git a/third_party/android_system_core/include/utils/Condition.h b/third_party/android_system_core/include/utils/Condition.h new file mode 100644 index 000000000..5a7251982 --- /dev/null +++ b/third_party/android_system_core/include/utils/Condition.h @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2007 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 _LIBS_UTILS_CONDITION_H +#define _LIBS_UTILS_CONDITION_H + +#include +#include +#include + +#if !defined(_WIN32) +# include +#endif + +#include +#include +#include + +// --------------------------------------------------------------------------- +namespace android { +// --------------------------------------------------------------------------- + +/* + * Condition variable class. The implementation is system-dependent. + * + * Condition variables are paired up with mutexes. Lock the mutex, + * call wait(), then either re-wait() if things aren't quite what you want, + * or unlock the mutex and continue. All threads calling wait() must + * use the same mutex for a given Condition. + */ +class Condition { +public: + enum { + PRIVATE = 0, + SHARED = 1 + }; + + enum WakeUpType { + WAKE_UP_ONE = 0, + WAKE_UP_ALL = 1 + }; + + Condition(); + Condition(int type); + ~Condition(); + // Wait on the condition variable. Lock the mutex before calling. + status_t wait(Mutex& mutex); + // same with relative timeout + status_t waitRelative(Mutex& mutex, nsecs_t reltime); + // Signal the condition variable, allowing exactly one thread to continue. + void signal(); + // Signal the condition variable, allowing one or all threads to continue. + void signal(WakeUpType type) { + if (type == WAKE_UP_ONE) { + signal(); + } else { + broadcast(); + } + } + // Signal the condition variable, allowing all threads to continue. + void broadcast(); + +private: +#if !defined(_WIN32) + pthread_cond_t mCond; +#else + void* mState; +#endif +}; + +// --------------------------------------------------------------------------- + +#if !defined(_WIN32) + +inline Condition::Condition() { + pthread_cond_init(&mCond, NULL); +} +inline Condition::Condition(int type) { + if (type == SHARED) { + pthread_condattr_t attr; + pthread_condattr_init(&attr); + pthread_condattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); + pthread_cond_init(&mCond, &attr); + pthread_condattr_destroy(&attr); + } else { + pthread_cond_init(&mCond, NULL); + } +} +inline Condition::~Condition() { + pthread_cond_destroy(&mCond); +} +inline status_t Condition::wait(Mutex& mutex) { + return -pthread_cond_wait(&mCond, &mutex.mMutex); +} +inline status_t Condition::waitRelative(Mutex& mutex, nsecs_t reltime) { +#if defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE) + struct timespec ts; + ts.tv_sec = reltime/1000000000; + ts.tv_nsec = reltime%1000000000; + return -pthread_cond_timedwait_relative_np(&mCond, &mutex.mMutex, &ts); +#else // HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE + struct timespec ts; +#if defined(__linux__) + clock_gettime(CLOCK_REALTIME, &ts); +#else // __APPLE__ + // we don't support the clocks here. + struct timeval t; + gettimeofday(&t, NULL); + ts.tv_sec = t.tv_sec; + ts.tv_nsec= t.tv_usec*1000; +#endif + ts.tv_sec += reltime/1000000000; + ts.tv_nsec+= reltime%1000000000; + if (ts.tv_nsec >= 1000000000) { + ts.tv_nsec -= 1000000000; + ts.tv_sec += 1; + } + return -pthread_cond_timedwait(&mCond, &mutex.mMutex, &ts); +#endif // HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE +} +inline void Condition::signal() { + /* + * POSIX says pthread_cond_signal wakes up "one or more" waiting threads. + * However bionic follows the glibc guarantee which wakes up "exactly one" + * waiting thread. + * + * man 3 pthread_cond_signal + * pthread_cond_signal restarts one of the threads that are waiting on + * the condition variable cond. If no threads are waiting on cond, + * nothing happens. If several threads are waiting on cond, exactly one + * is restarted, but it is not specified which. + */ + pthread_cond_signal(&mCond); +} +inline void Condition::broadcast() { + pthread_cond_broadcast(&mCond); +} + +#endif // !defined(_WIN32) + +// --------------------------------------------------------------------------- +}; // namespace android +// --------------------------------------------------------------------------- + +#endif // _LIBS_UTILS_CONDITON_H diff --git a/third_party/android_system_core/include/utils/Debug.h b/third_party/android_system_core/include/utils/Debug.h new file mode 100644 index 000000000..08893bdaa --- /dev/null +++ b/third_party/android_system_core/include/utils/Debug.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2005 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_UTILS_DEBUG_H +#define ANDROID_UTILS_DEBUG_H + +#include +#include + +namespace android { +// --------------------------------------------------------------------------- + +#ifdef __cplusplus +template struct CompileTimeAssert; +template<> struct CompileTimeAssert {}; +#define COMPILE_TIME_ASSERT(_exp) \ + template class CompileTimeAssert< (_exp) >; +#endif +#define COMPILE_TIME_ASSERT_FUNCTION_SCOPE(_exp) \ + CompileTimeAssert<( _exp )>(); + +// --------------------------------------------------------------------------- + +#ifdef __cplusplus +template struct CompileTimeIfElse; +template +struct CompileTimeIfElse { typedef LHS TYPE; }; +template +struct CompileTimeIfElse { typedef RHS TYPE; }; +#endif + +// --------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_UTILS_DEBUG_H diff --git a/third_party/android_system_core/include/utils/Endian.h b/third_party/android_system_core/include/utils/Endian.h new file mode 100644 index 000000000..591cae0d3 --- /dev/null +++ b/third_party/android_system_core/include/utils/Endian.h @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2005 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. + */ + +// +// Android endian-ness defines. +// +#ifndef _LIBS_UTILS_ENDIAN_H +#define _LIBS_UTILS_ENDIAN_H + +#if defined(__APPLE__) || defined(_WIN32) + +#define __BIG_ENDIAN 0x1000 +#define __LITTLE_ENDIAN 0x0001 +#define __BYTE_ORDER __LITTLE_ENDIAN + +#else + +#include + +#endif + +#endif /*_LIBS_UTILS_ENDIAN_H*/ diff --git a/third_party/android_system_core/include/utils/Errors.h b/third_party/android_system_core/include/utils/Errors.h new file mode 100644 index 000000000..46173db4a --- /dev/null +++ b/third_party/android_system_core/include/utils/Errors.h @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2007 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_ERRORS_H +#define ANDROID_ERRORS_H + +#include +#include + +namespace android { + +// use this type to return error codes +#ifdef HAVE_MS_C_RUNTIME +typedef int status_t; +#else +typedef int32_t status_t; +#endif + +/* the MS C runtime lacks a few error codes */ + +/* + * Error codes. + * All error codes are negative values. + */ + +// Win32 #defines NO_ERROR as well. It has the same value, so there's no +// real conflict, though it's a bit awkward. +#ifdef _WIN32 +# undef NO_ERROR +#endif + +enum { + OK = 0, // Everything's swell. + NO_ERROR = 0, // No errors. + + UNKNOWN_ERROR = (-2147483647-1), // INT32_MIN value + + NO_MEMORY = -ENOMEM, + INVALID_OPERATION = -ENOSYS, + BAD_VALUE = -EINVAL, + BAD_TYPE = (UNKNOWN_ERROR + 1), + NAME_NOT_FOUND = -ENOENT, + PERMISSION_DENIED = -EPERM, + NO_INIT = -ENODEV, + ALREADY_EXISTS = -EEXIST, + DEAD_OBJECT = -EPIPE, + FAILED_TRANSACTION = (UNKNOWN_ERROR + 2), + JPARKS_BROKE_IT = -EPIPE, +#if !defined(HAVE_MS_C_RUNTIME) + BAD_INDEX = -EOVERFLOW, + NOT_ENOUGH_DATA = -ENODATA, + WOULD_BLOCK = -EWOULDBLOCK, + TIMED_OUT = -ETIMEDOUT, + UNKNOWN_TRANSACTION = -EBADMSG, +#else + BAD_INDEX = -E2BIG, + NOT_ENOUGH_DATA = (UNKNOWN_ERROR + 3), + WOULD_BLOCK = (UNKNOWN_ERROR + 4), + TIMED_OUT = (UNKNOWN_ERROR + 5), + UNKNOWN_TRANSACTION = (UNKNOWN_ERROR + 6), +#endif + FDS_NOT_ALLOWED = (UNKNOWN_ERROR + 7), +}; + +// Restore define; enumeration is in "android" namespace, so the value defined +// there won't work for Win32 code in a different namespace. +#ifdef _WIN32 +# define NO_ERROR 0L +#endif + +}; // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_ERRORS_H diff --git a/third_party/android_system_core/include/utils/FileMap.h b/third_party/android_system_core/include/utils/FileMap.h new file mode 100644 index 000000000..f70fc927e --- /dev/null +++ b/third_party/android_system_core/include/utils/FileMap.h @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2006 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. + */ + +// +// Encapsulate a shared file mapping. +// +#ifndef __LIBS_FILE_MAP_H +#define __LIBS_FILE_MAP_H + +#include + +#include + +#if defined(__MINGW32__) +// Ensure that we always pull in winsock2.h before windows.h +#ifdef HAVE_WINSOCK +#include +#endif +#include +#endif + +namespace android { + +/* + * This represents a memory-mapped file. It might be the entire file or + * only part of it. This requires a little bookkeeping because the mapping + * needs to be aligned on page boundaries, and in some cases we'd like to + * have multiple references to the mapped area without creating additional + * maps. + * + * This always uses MAP_SHARED. + * + * TODO: we should be able to create a new FileMap that is a subset of + * an existing FileMap and shares the underlying mapped pages. Requires + * completing the refcounting stuff and possibly introducing the notion + * of a FileMap hierarchy. + */ +class FileMap { +public: + FileMap(void); + + /* + * Create a new mapping on an open file. + * + * Closing the file descriptor does not unmap the pages, so we don't + * claim ownership of the fd. + * + * Returns "false" on failure. + */ + bool create(const char* origFileName, int fd, + off64_t offset, size_t length, bool readOnly); + + ~FileMap(void); + + /* + * Return the name of the file this map came from, if known. + */ + const char* getFileName(void) const { return mFileName; } + + /* + * Get a pointer to the piece of the file we requested. + */ + void* getDataPtr(void) const { return mDataPtr; } + + /* + * Get the length we requested. + */ + size_t getDataLength(void) const { return mDataLength; } + + /* + * Get the data offset used to create this map. + */ + off64_t getDataOffset(void) const { return mDataOffset; } + + /* + * This maps directly to madvise() values, but allows us to avoid + * including everywhere. + */ + enum MapAdvice { + NORMAL, RANDOM, SEQUENTIAL, WILLNEED, DONTNEED + }; + + /* + * Apply an madvise() call to the entire file. + * + * Returns 0 on success, -1 on failure. + */ + int advise(MapAdvice advice); + +protected: + +private: + // these are not implemented + FileMap(const FileMap& src); + const FileMap& operator=(const FileMap& src); + + char* mFileName; // original file name, if known + void* mBasePtr; // base of mmap area; page aligned + size_t mBaseLength; // length, measured from "mBasePtr" + off64_t mDataOffset; // offset used when map was created + void* mDataPtr; // start of requested data, offset from base + size_t mDataLength; // length, measured from "mDataPtr" +#if defined(__MINGW32__) + HANDLE mFileHandle; // Win32 file handle + HANDLE mFileMapping; // Win32 file mapping handle +#endif + + static long mPageSize; +}; + +}; // namespace android + +#endif // __LIBS_FILE_MAP_H diff --git a/third_party/android_system_core/include/utils/Flattenable.h b/third_party/android_system_core/include/utils/Flattenable.h new file mode 100644 index 000000000..882a8b249 --- /dev/null +++ b/third_party/android_system_core/include/utils/Flattenable.h @@ -0,0 +1,198 @@ +/* + * Copyright (C) 2010 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_UTILS_FLATTENABLE_H +#define ANDROID_UTILS_FLATTENABLE_H + + +#include +#include +#include +#include + +namespace android { + + +class FlattenableUtils { +public: + template + static size_t align(size_t size) { + COMPILE_TIME_ASSERT_FUNCTION_SCOPE( !(N & (N-1)) ); + return (size + (N-1)) & ~(N-1); + } + + template + static size_t align(void const*& buffer) { + COMPILE_TIME_ASSERT_FUNCTION_SCOPE( !(N & (N-1)) ); + intptr_t b = intptr_t(buffer); + buffer = (void*)((intptr_t(buffer) + (N-1)) & ~(N-1)); + return size_t(intptr_t(buffer) - b); + } + + template + static size_t align(void*& buffer) { + return align( const_cast(buffer) ); + } + + static void advance(void*& buffer, size_t& size, size_t offset) { + buffer = reinterpret_cast( intptr_t(buffer) + offset ); + size -= offset; + } + + static void advance(void const*& buffer, size_t& size, size_t offset) { + buffer = reinterpret_cast( intptr_t(buffer) + offset ); + size -= offset; + } + + // write a POD structure + template + static void write(void*& buffer, size_t& size, const T& value) { + *static_cast(buffer) = value; + advance(buffer, size, sizeof(T)); + } + + // read a POD structure + template + static void read(void const*& buffer, size_t& size, T& value) { + value = *static_cast(buffer); + advance(buffer, size, sizeof(T)); + } +}; + + +/* + * The Flattenable protocol allows an object to serialize itself out + * to a byte-buffer and an array of file descriptors. + * Flattenable objects must implement this protocol. + */ + +template +class Flattenable { +public: + // size in bytes of the flattened object + inline size_t getFlattenedSize() const; + + // number of file descriptors to flatten + inline size_t getFdCount() const; + + // flattens the object into buffer. + // size should be at least of getFlattenedSize() + // file descriptors are written in the fds[] array but ownership is + // not transfered (ie: they must be dupped by the caller of + // flatten() if needed). + inline status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const; + + // unflattens the object from buffer. + // size should be equal to the value of getFlattenedSize() when the + // object was flattened. + // unflattened file descriptors are found in the fds[] array and + // don't need to be dupped(). ie: the caller of unflatten doesn't + // keep ownership. If a fd is not retained by unflatten() it must be + // explicitly closed. + inline status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count); +}; + +template +inline size_t Flattenable::getFlattenedSize() const { + return static_cast(this)->T::getFlattenedSize(); +} +template +inline size_t Flattenable::getFdCount() const { + return static_cast(this)->T::getFdCount(); +} +template +inline status_t Flattenable::flatten( + void*& buffer, size_t& size, int*& fds, size_t& count) const { + return static_cast(this)->T::flatten(buffer, size, fds, count); +} +template +inline status_t Flattenable::unflatten( + void const*& buffer, size_t& size, int const*& fds, size_t& count) { + return static_cast(this)->T::unflatten(buffer, size, fds, count); +} + +/* + * LightFlattenable is a protocol allowing object to serialize themselves out + * to a byte-buffer. Because it doesn't handle file-descriptors, + * LightFlattenable is usually more size efficient than Flattenable. + * LightFlattenable objects must implement this protocol. + */ +template +class LightFlattenable { +public: + // returns whether this object always flatten into the same size. + // for efficiency, this should always be inline. + inline bool isFixedSize() const; + + // returns size in bytes of the flattened object. must be a constant. + inline size_t getFlattenedSize() const; + + // flattens the object into buffer. + inline status_t flatten(void* buffer, size_t size) const; + + // unflattens the object from buffer of given size. + inline status_t unflatten(void const* buffer, size_t size); +}; + +template +inline bool LightFlattenable::isFixedSize() const { + return static_cast(this)->T::isFixedSize(); +} +template +inline size_t LightFlattenable::getFlattenedSize() const { + return static_cast(this)->T::getFlattenedSize(); +} +template +inline status_t LightFlattenable::flatten(void* buffer, size_t size) const { + return static_cast(this)->T::flatten(buffer, size); +} +template +inline status_t LightFlattenable::unflatten(void const* buffer, size_t size) { + return static_cast(this)->T::unflatten(buffer, size); +} + +/* + * LightFlattenablePod is an implementation of the LightFlattenable protocol + * for POD (plain-old-data) objects. + * Simply derive from LightFlattenablePod to make Foo flattenable; no + * need to implement any methods; obviously Foo must be a POD structure. + */ +template +class LightFlattenablePod : public LightFlattenable { +public: + inline bool isFixedSize() const { + return true; + } + + inline size_t getFlattenedSize() const { + return sizeof(T); + } + inline status_t flatten(void* buffer, size_t size) const { + if (size < sizeof(T)) return NO_MEMORY; + *reinterpret_cast(buffer) = *static_cast(this); + return NO_ERROR; + } + inline status_t unflatten(void const* buffer, size_t) { + *static_cast(this) = *reinterpret_cast(buffer); + return NO_ERROR; + } +}; + + +}; // namespace android + + +#endif /* ANDROID_UTILS_FLATTENABLE_H */ diff --git a/third_party/android_system_core/include/utils/Functor.h b/third_party/android_system_core/include/utils/Functor.h new file mode 100644 index 000000000..09ea614b6 --- /dev/null +++ b/third_party/android_system_core/include/utils/Functor.h @@ -0,0 +1,33 @@ +/* + * 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_FUNCTOR_H +#define ANDROID_FUNCTOR_H + +#include + +namespace android { + +class Functor { +public: + Functor() {} + virtual ~Functor() {} + virtual status_t operator ()(int /*what*/, void* /*data*/) { return NO_ERROR; } +}; + +}; // namespace android + +#endif // ANDROID_FUNCTOR_H diff --git a/third_party/android_system_core/include/utils/JenkinsHash.h b/third_party/android_system_core/include/utils/JenkinsHash.h new file mode 100644 index 000000000..7da5dbd6a --- /dev/null +++ b/third_party/android_system_core/include/utils/JenkinsHash.h @@ -0,0 +1,48 @@ +/* + * 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. + */ + +/* Implementation of Jenkins one-at-a-time hash function. These choices are + * optimized for code size and portability, rather than raw speed. But speed + * should still be quite good. + **/ + +#ifndef ANDROID_JENKINS_HASH_H +#define ANDROID_JENKINS_HASH_H + +#include + +namespace android { + +/* The Jenkins hash of a sequence of 32 bit words A, B, C is: + * Whiten(Mix(Mix(Mix(0, A), B), C)) */ + +inline uint32_t JenkinsHashMix(uint32_t hash, uint32_t data) { + hash += data; + hash += (hash << 10); + hash ^= (hash >> 6); + return hash; +} + +hash_t JenkinsHashWhiten(uint32_t hash); + +/* Helpful utility functions for hashing data in 32 bit chunks */ +uint32_t JenkinsHashMixBytes(uint32_t hash, const uint8_t* bytes, size_t size); + +uint32_t JenkinsHashMixShorts(uint32_t hash, const uint16_t* shorts, size_t size); + +} + +#endif // ANDROID_JENKINS_HASH_H diff --git a/third_party/android_system_core/include/utils/KeyedVector.h b/third_party/android_system_core/include/utils/KeyedVector.h new file mode 100644 index 000000000..c4faae0b7 --- /dev/null +++ b/third_party/android_system_core/include/utils/KeyedVector.h @@ -0,0 +1,224 @@ +/* + * Copyright (C) 2005 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_KEYED_VECTOR_H +#define ANDROID_KEYED_VECTOR_H + +#include +#include +#include + +#include + +#include +#include +#include + +// --------------------------------------------------------------------------- + +namespace android { + +template +class KeyedVector +{ +public: + typedef KEY key_type; + typedef VALUE value_type; + + inline KeyedVector(); + + /* + * empty the vector + */ + + inline void clear() { mVector.clear(); } + + /*! + * vector stats + */ + + //! returns number of items in the vector + inline size_t size() const { return mVector.size(); } + //! returns whether or not the vector is empty + inline bool isEmpty() const { return mVector.isEmpty(); } + //! returns how many items can be stored without reallocating the backing store + inline size_t capacity() const { return mVector.capacity(); } + //! sets the capacity. capacity can never be reduced less than size() + inline ssize_t setCapacity(size_t size) { return mVector.setCapacity(size); } + + // returns true if the arguments is known to be identical to this vector + inline bool isIdenticalTo(const KeyedVector& rhs) const; + + /*! + * accessors + */ + const VALUE& valueFor(const KEY& key) const; + const VALUE& valueAt(size_t index) const; + const KEY& keyAt(size_t index) const; + ssize_t indexOfKey(const KEY& key) const; + const VALUE& operator[] (size_t index) const; + + /*! + * modifying the array + */ + + VALUE& editValueFor(const KEY& key); + VALUE& editValueAt(size_t index); + + /*! + * add/insert/replace items + */ + + ssize_t add(const KEY& key, const VALUE& item); + ssize_t replaceValueFor(const KEY& key, const VALUE& item); + ssize_t replaceValueAt(size_t index, const VALUE& item); + + /*! + * remove items + */ + + ssize_t removeItem(const KEY& key); + ssize_t removeItemsAt(size_t index, size_t count = 1); + +private: + SortedVector< key_value_pair_t > mVector; +}; + +// KeyedVector can be trivially moved using memcpy() because its +// underlying SortedVector can be trivially moved. +template struct trait_trivial_move > { + enum { value = trait_trivial_move > >::value }; +}; + + +// --------------------------------------------------------------------------- + +/** + * Variation of KeyedVector that holds a default value to return when + * valueFor() is called with a key that doesn't exist. + */ +template +class DefaultKeyedVector : public KeyedVector +{ +public: + inline DefaultKeyedVector(const VALUE& defValue = VALUE()); + const VALUE& valueFor(const KEY& key) const; + +private: + VALUE mDefault; +}; + +// --------------------------------------------------------------------------- + +template inline +KeyedVector::KeyedVector() +{ +} + +template inline +bool KeyedVector::isIdenticalTo(const KeyedVector& rhs) const { + return mVector.array() == rhs.mVector.array(); +} + +template inline +ssize_t KeyedVector::indexOfKey(const KEY& key) const { + return mVector.indexOf( key_value_pair_t(key) ); +} + +template inline +const VALUE& KeyedVector::valueFor(const KEY& key) const { + ssize_t i = this->indexOfKey(key); + LOG_ALWAYS_FATAL_IF(i<0, "%s: key not found", __PRETTY_FUNCTION__); + return mVector.itemAt(i).value; +} + +template inline +const VALUE& KeyedVector::valueAt(size_t index) const { + return mVector.itemAt(index).value; +} + +template inline +const VALUE& KeyedVector::operator[] (size_t index) const { + return valueAt(index); +} + +template inline +const KEY& KeyedVector::keyAt(size_t index) const { + return mVector.itemAt(index).key; +} + +template inline +VALUE& KeyedVector::editValueFor(const KEY& key) { + ssize_t i = this->indexOfKey(key); + LOG_ALWAYS_FATAL_IF(i<0, "%s: key not found", __PRETTY_FUNCTION__); + return mVector.editItemAt(i).value; +} + +template inline +VALUE& KeyedVector::editValueAt(size_t index) { + return mVector.editItemAt(index).value; +} + +template inline +ssize_t KeyedVector::add(const KEY& key, const VALUE& value) { + return mVector.add( key_value_pair_t(key, value) ); +} + +template inline +ssize_t KeyedVector::replaceValueFor(const KEY& key, const VALUE& value) { + key_value_pair_t pair(key, value); + mVector.remove(pair); + return mVector.add(pair); +} + +template inline +ssize_t KeyedVector::replaceValueAt(size_t index, const VALUE& item) { + if (index inline +ssize_t KeyedVector::removeItem(const KEY& key) { + return mVector.remove(key_value_pair_t(key)); +} + +template inline +ssize_t KeyedVector::removeItemsAt(size_t index, size_t count) { + return mVector.removeItemsAt(index, count); +} + +// --------------------------------------------------------------------------- + +template inline +DefaultKeyedVector::DefaultKeyedVector(const VALUE& defValue) + : mDefault(defValue) +{ +} + +template inline +const VALUE& DefaultKeyedVector::valueFor(const KEY& key) const { + ssize_t i = this->indexOfKey(key); + return i >= 0 ? KeyedVector::valueAt(i) : mDefault; +} + +}; // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_KEYED_VECTOR_H diff --git a/third_party/android_system_core/include/utils/LinearTransform.h b/third_party/android_system_core/include/utils/LinearTransform.h new file mode 100644 index 000000000..04cb355c7 --- /dev/null +++ b/third_party/android_system_core/include/utils/LinearTransform.h @@ -0,0 +1,64 @@ +/* + * 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 _LIBS_UTILS_LINEAR_TRANSFORM_H +#define _LIBS_UTILS_LINEAR_TRANSFORM_H + +#include + +namespace android { + +// LinearTransform defines a structure which hold the definition of a +// transformation from single dimensional coordinate system A into coordinate +// system B (and back again). Values in A and in B are 64 bit, the linear +// scale factor is expressed as a rational number using two 32 bit values. +// +// Specifically, let +// f(a) = b +// F(b) = f^-1(b) = a +// then +// +// f(a) = (((a - a_zero) * a_to_b_numer) / a_to_b_denom) + b_zero; +// +// and +// +// F(b) = (((b - b_zero) * a_to_b_denom) / a_to_b_numer) + a_zero; +// +struct LinearTransform { + int64_t a_zero; + int64_t b_zero; + int32_t a_to_b_numer; + uint32_t a_to_b_denom; + + // Transform from A->B + // Returns true on success, or false in the case of a singularity or an + // overflow. + bool doForwardTransform(int64_t a_in, int64_t* b_out) const; + + // Transform from B->A + // Returns true on success, or false in the case of a singularity or an + // overflow. + bool doReverseTransform(int64_t b_in, int64_t* a_out) const; + + // Helpers which will reduce the fraction N/D using Euclid's method. + template static void reduce(T* N, T* D); + static void reduce(int32_t* N, uint32_t* D); +}; + + +} + +#endif // _LIBS_UTILS_LINEAR_TRANSFORM_H diff --git a/third_party/android_system_core/include/utils/List.h b/third_party/android_system_core/include/utils/List.h new file mode 100644 index 000000000..403cd7f1e --- /dev/null +++ b/third_party/android_system_core/include/utils/List.h @@ -0,0 +1,332 @@ +/* + * Copyright (C) 2005 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. + */ + +// +// Templated list class. Normally we'd use STL, but we don't have that. +// This class mimics STL's interfaces. +// +// Objects are copied into the list with the '=' operator or with copy- +// construction, so if the compiler's auto-generated versions won't work for +// you, define your own. +// +// The only class you want to use from here is "List". +// +#ifndef _LIBS_UTILS_LIST_H +#define _LIBS_UTILS_LIST_H + +#include +#include + +namespace android { + +/* + * Doubly-linked list. Instantiate with "List myList". + * + * Objects added to the list are copied using the assignment operator, + * so this must be defined. + */ +template +class List +{ +protected: + /* + * One element in the list. + */ + class _Node { + public: + explicit _Node(const T& val) : mVal(val) {} + ~_Node() {} + inline T& getRef() { return mVal; } + inline const T& getRef() const { return mVal; } + inline _Node* getPrev() const { return mpPrev; } + inline _Node* getNext() const { return mpNext; } + inline void setVal(const T& val) { mVal = val; } + inline void setPrev(_Node* ptr) { mpPrev = ptr; } + inline void setNext(_Node* ptr) { mpNext = ptr; } + private: + friend class List; + friend class _ListIterator; + T mVal; + _Node* mpPrev; + _Node* mpNext; + }; + + /* + * Iterator for walking through the list. + */ + + template + struct CONST_ITERATOR { + typedef _Node const * NodePtr; + typedef const TYPE Type; + }; + + template + struct NON_CONST_ITERATOR { + typedef _Node* NodePtr; + typedef TYPE Type; + }; + + template< + typename U, + template class Constness + > + class _ListIterator { + typedef _ListIterator _Iter; + typedef typename Constness::NodePtr _NodePtr; + typedef typename Constness::Type _Type; + + explicit _ListIterator(_NodePtr ptr) : mpNode(ptr) {} + + public: + _ListIterator() {} + _ListIterator(const _Iter& rhs) : mpNode(rhs.mpNode) {} + ~_ListIterator() {} + + // this will handle conversions from iterator to const_iterator + // (and also all convertible iterators) + // Here, in this implementation, the iterators can be converted + // if the nodes can be converted + template explicit + _ListIterator(const V& rhs) : mpNode(rhs.mpNode) {} + + + /* + * Dereference operator. Used to get at the juicy insides. + */ + _Type& operator*() const { return mpNode->getRef(); } + _Type* operator->() const { return &(mpNode->getRef()); } + + /* + * Iterator comparison. + */ + inline bool operator==(const _Iter& right) const { + return mpNode == right.mpNode; } + + inline bool operator!=(const _Iter& right) const { + return mpNode != right.mpNode; } + + /* + * handle comparisons between iterator and const_iterator + */ + template + inline bool operator==(const OTHER& right) const { + return mpNode == right.mpNode; } + + template + inline bool operator!=(const OTHER& right) const { + return mpNode != right.mpNode; } + + /* + * Incr/decr, used to move through the list. + */ + inline _Iter& operator++() { // pre-increment + mpNode = mpNode->getNext(); + return *this; + } + const _Iter operator++(int) { // post-increment + _Iter tmp(*this); + mpNode = mpNode->getNext(); + return tmp; + } + inline _Iter& operator--() { // pre-increment + mpNode = mpNode->getPrev(); + return *this; + } + const _Iter operator--(int) { // post-increment + _Iter tmp(*this); + mpNode = mpNode->getPrev(); + return tmp; + } + + inline _NodePtr getNode() const { return mpNode; } + + _NodePtr mpNode; /* should be private, but older gcc fails */ + private: + friend class List; + }; + +public: + List() { + prep(); + } + List(const List& src) { // copy-constructor + prep(); + insert(begin(), src.begin(), src.end()); + } + virtual ~List() { + clear(); + delete[] (unsigned char*) mpMiddle; + } + + typedef _ListIterator iterator; + typedef _ListIterator const_iterator; + + List& operator=(const List& right); + + /* returns true if the list is empty */ + inline bool empty() const { return mpMiddle->getNext() == mpMiddle; } + + /* return #of elements in list */ + size_t size() const { + return size_t(distance(begin(), end())); + } + + /* + * Return the first element or one past the last element. The + * _Node* we're returning is converted to an "iterator" by a + * constructor in _ListIterator. + */ + inline iterator begin() { + return iterator(mpMiddle->getNext()); + } + inline const_iterator begin() const { + return const_iterator(const_cast<_Node const*>(mpMiddle->getNext())); + } + inline iterator end() { + return iterator(mpMiddle); + } + inline const_iterator end() const { + return const_iterator(const_cast<_Node const*>(mpMiddle)); + } + + /* add the object to the head or tail of the list */ + void push_front(const T& val) { insert(begin(), val); } + void push_back(const T& val) { insert(end(), val); } + + /* insert before the current node; returns iterator at new node */ + iterator insert(iterator posn, const T& val) + { + _Node* newNode = new _Node(val); // alloc & copy-construct + newNode->setNext(posn.getNode()); + newNode->setPrev(posn.getNode()->getPrev()); + posn.getNode()->getPrev()->setNext(newNode); + posn.getNode()->setPrev(newNode); + return iterator(newNode); + } + + /* insert a range of elements before the current node */ + void insert(iterator posn, const_iterator first, const_iterator last) { + for ( ; first != last; ++first) + insert(posn, *first); + } + + /* remove one entry; returns iterator at next node */ + iterator erase(iterator posn) { + _Node* pNext = posn.getNode()->getNext(); + _Node* pPrev = posn.getNode()->getPrev(); + pPrev->setNext(pNext); + pNext->setPrev(pPrev); + delete posn.getNode(); + return iterator(pNext); + } + + /* remove a range of elements */ + iterator erase(iterator first, iterator last) { + while (first != last) + erase(first++); // don't erase than incr later! + return iterator(last); + } + + /* remove all contents of the list */ + void clear() { + _Node* pCurrent = mpMiddle->getNext(); + _Node* pNext; + + while (pCurrent != mpMiddle) { + pNext = pCurrent->getNext(); + delete pCurrent; + pCurrent = pNext; + } + mpMiddle->setPrev(mpMiddle); + mpMiddle->setNext(mpMiddle); + } + + /* + * Measure the distance between two iterators. On exist, "first" + * will be equal to "last". The iterators must refer to the same + * list. + * + * FIXME: This is actually a generic iterator function. It should be a + * template function at the top-level with specializations for things like + * vector<>, which can just do pointer math). Here we limit it to + * _ListIterator of the same type but different constness. + */ + template< + typename U, + template class CL, + template class CR + > + ptrdiff_t distance( + _ListIterator first, _ListIterator last) const + { + ptrdiff_t count = 0; + while (first != last) { + ++first; + ++count; + } + return count; + } + +private: + /* + * I want a _Node but don't need it to hold valid data. More + * to the point, I don't want T's constructor to fire, since it + * might have side-effects or require arguments. So, we do this + * slightly uncouth storage alloc. + */ + void prep() { + mpMiddle = (_Node*) new unsigned char[sizeof(_Node)]; + mpMiddle->setPrev(mpMiddle); + mpMiddle->setNext(mpMiddle); + } + + /* + * This node plays the role of "pointer to head" and "pointer to tail". + * It sits in the middle of a circular list of nodes. The iterator + * runs around the circle until it encounters this one. + */ + _Node* mpMiddle; +}; + +/* + * Assignment operator. + * + * The simplest way to do this would be to clear out the target list and + * fill it with the source. However, we can speed things along by + * re-using existing elements. + */ +template +List& List::operator=(const List& right) +{ + if (this == &right) + return *this; // self-assignment + iterator firstDst = begin(); + iterator lastDst = end(); + const_iterator firstSrc = right.begin(); + const_iterator lastSrc = right.end(); + while (firstSrc != lastSrc && firstDst != lastDst) + *firstDst++ = *firstSrc++; + if (firstSrc == lastSrc) // ran out of elements in source? + erase(firstDst, lastDst); // yes, erase any extras + else + insert(lastDst, firstSrc, lastSrc); // copy remaining over + return *this; +} + +}; // namespace android + +#endif // _LIBS_UTILS_LIST_H diff --git a/third_party/android_system_core/include/utils/Log.h b/third_party/android_system_core/include/utils/Log.h new file mode 100644 index 000000000..4259c86d1 --- /dev/null +++ b/third_party/android_system_core/include/utils/Log.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2005 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. + */ + +// +// C/C++ logging functions. See the logging documentation for API details. +// +// We'd like these to be available from C code (in case we import some from +// somewhere), so this has a C interface. +// +// The output will be correct when the log file is shared between multiple +// threads and/or multiple processes so long as the operating system +// supports O_APPEND. These calls have mutex-protected data structures +// and so are NOT reentrant. Do not use LOG in a signal handler. +// +#ifndef _LIBS_UTILS_LOG_H +#define _LIBS_UTILS_LOG_H + +#include +#include + +#ifdef __cplusplus + +namespace android { + +/* + * A very simple utility that yells in the log when an operation takes too long. + */ +class LogIfSlow { +public: + LogIfSlow(const char* tag, android_LogPriority priority, + int timeoutMillis, const char* message); + ~LogIfSlow(); + +private: + const char* const mTag; + const android_LogPriority mPriority; + const int mTimeoutMillis; + const char* const mMessage; + const int64_t mStart; +}; + +/* + * Writes the specified debug log message if this block takes longer than the + * specified number of milliseconds to run. Includes the time actually taken. + * + * { + * ALOGD_IF_SLOW(50, "Excessive delay doing something."); + * doSomething(); + * } + */ +#define ALOGD_IF_SLOW(timeoutMillis, message) \ + android::LogIfSlow _logIfSlow(LOG_TAG, ANDROID_LOG_DEBUG, timeoutMillis, message); + +} // namespace android + +#endif // __cplusplus + +#endif // _LIBS_UTILS_LOG_H diff --git a/third_party/android_system_core/include/utils/Looper.h b/third_party/android_system_core/include/utils/Looper.h new file mode 100644 index 000000000..da2d5f2b5 --- /dev/null +++ b/third_party/android_system_core/include/utils/Looper.h @@ -0,0 +1,487 @@ +/* + * Copyright (C) 2010 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 UTILS_LOOPER_H +#define UTILS_LOOPER_H + +#include +#include +#include +#include + +#include + +namespace android { + +/* + * NOTE: Since Looper is used to implement the NDK ALooper, the Looper + * enums and the signature of Looper_callbackFunc need to align with + * that implementation. + */ + +/** + * For callback-based event loops, this is the prototype of the function + * that is called when a file descriptor event occurs. + * It is given the file descriptor it is associated with, + * a bitmask of the poll events that were triggered (typically EVENT_INPUT), + * and the data pointer that was originally supplied. + * + * Implementations should return 1 to continue receiving callbacks, or 0 + * to have this file descriptor and callback unregistered from the looper. + */ +typedef int (*Looper_callbackFunc)(int fd, int events, void* data); + +/** + * A message that can be posted to a Looper. + */ +struct Message { + Message() : what(0) { } + Message(int what) : what(what) { } + + /* The message type. (interpretation is left up to the handler) */ + int what; +}; + + +/** + * Interface for a Looper message handler. + * + * The Looper holds a strong reference to the message handler whenever it has + * a message to deliver to it. Make sure to call Looper::removeMessages + * to remove any pending messages destined for the handler so that the handler + * can be destroyed. + */ +class MessageHandler : public virtual RefBase { +protected: + virtual ~MessageHandler() { } + +public: + /** + * Handles a message. + */ + virtual void handleMessage(const Message& message) = 0; +}; + + +/** + * A simple proxy that holds a weak reference to a message handler. + */ +class WeakMessageHandler : public MessageHandler { +protected: + virtual ~WeakMessageHandler(); + +public: + WeakMessageHandler(const wp& handler); + virtual void handleMessage(const Message& message); + +private: + wp mHandler; +}; + + +/** + * A looper callback. + */ +class LooperCallback : public virtual RefBase { +protected: + virtual ~LooperCallback() { } + +public: + /** + * Handles a poll event for the given file descriptor. + * It is given the file descriptor it is associated with, + * a bitmask of the poll events that were triggered (typically EVENT_INPUT), + * and the data pointer that was originally supplied. + * + * Implementations should return 1 to continue receiving callbacks, or 0 + * to have this file descriptor and callback unregistered from the looper. + */ + virtual int handleEvent(int fd, int events, void* data) = 0; +}; + +/** + * Wraps a Looper_callbackFunc function pointer. + */ +class SimpleLooperCallback : public LooperCallback { +protected: + virtual ~SimpleLooperCallback(); + +public: + SimpleLooperCallback(Looper_callbackFunc callback); + virtual int handleEvent(int fd, int events, void* data); + +private: + Looper_callbackFunc mCallback; +}; + +/** + * A polling loop that supports monitoring file descriptor events, optionally + * using callbacks. The implementation uses epoll() internally. + * + * A looper can be associated with a thread although there is no requirement that it must be. + */ +class Looper : public RefBase { +protected: + virtual ~Looper(); + +public: + enum { + /** + * Result from Looper_pollOnce() and Looper_pollAll(): + * The poll was awoken using wake() before the timeout expired + * and no callbacks were executed and no other file descriptors were ready. + */ + POLL_WAKE = -1, + + /** + * Result from Looper_pollOnce() and Looper_pollAll(): + * One or more callbacks were executed. + */ + POLL_CALLBACK = -2, + + /** + * Result from Looper_pollOnce() and Looper_pollAll(): + * The timeout expired. + */ + POLL_TIMEOUT = -3, + + /** + * Result from Looper_pollOnce() and Looper_pollAll(): + * An error occurred. + */ + POLL_ERROR = -4, + }; + + /** + * Flags for file descriptor events that a looper can monitor. + * + * These flag bits can be combined to monitor multiple events at once. + */ + enum { + /** + * The file descriptor is available for read operations. + */ + EVENT_INPUT = 1 << 0, + + /** + * The file descriptor is available for write operations. + */ + EVENT_OUTPUT = 1 << 1, + + /** + * The file descriptor has encountered an error condition. + * + * The looper always sends notifications about errors; it is not necessary + * to specify this event flag in the requested event set. + */ + EVENT_ERROR = 1 << 2, + + /** + * The file descriptor was hung up. + * For example, indicates that the remote end of a pipe or socket was closed. + * + * The looper always sends notifications about hangups; it is not necessary + * to specify this event flag in the requested event set. + */ + EVENT_HANGUP = 1 << 3, + + /** + * The file descriptor is invalid. + * For example, the file descriptor was closed prematurely. + * + * The looper always sends notifications about invalid file descriptors; it is not necessary + * to specify this event flag in the requested event set. + */ + EVENT_INVALID = 1 << 4, + }; + + enum { + /** + * Option for Looper_prepare: this looper will accept calls to + * Looper_addFd() that do not have a callback (that is provide NULL + * for the callback). In this case the caller of Looper_pollOnce() + * or Looper_pollAll() MUST check the return from these functions to + * discover when data is available on such fds and process it. + */ + PREPARE_ALLOW_NON_CALLBACKS = 1<<0 + }; + + /** + * Creates a looper. + * + * If allowNonCallbaks is true, the looper will allow file descriptors to be + * registered without associated callbacks. This assumes that the caller of + * pollOnce() is prepared to handle callback-less events itself. + */ + Looper(bool allowNonCallbacks); + + /** + * Returns whether this looper instance allows the registration of file descriptors + * using identifiers instead of callbacks. + */ + bool getAllowNonCallbacks() const; + + /** + * Waits for events to be available, with optional timeout in milliseconds. + * Invokes callbacks for all file descriptors on which an event occurred. + * + * If the timeout is zero, returns immediately without blocking. + * If the timeout is negative, waits indefinitely until an event appears. + * + * Returns POLL_WAKE if the poll was awoken using wake() before + * the timeout expired and no callbacks were invoked and no other file + * descriptors were ready. + * + * Returns POLL_CALLBACK if one or more callbacks were invoked. + * + * Returns POLL_TIMEOUT if there was no data before the given + * timeout expired. + * + * Returns POLL_ERROR if an error occurred. + * + * Returns a value >= 0 containing an identifier if its file descriptor has data + * and it has no callback function (requiring the caller here to handle it). + * In this (and only this) case outFd, outEvents and outData will contain the poll + * events and data associated with the fd, otherwise they will be set to NULL. + * + * This method does not return until it has finished invoking the appropriate callbacks + * for all file descriptors that were signalled. + */ + int pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData); + inline int pollOnce(int timeoutMillis) { + return pollOnce(timeoutMillis, NULL, NULL, NULL); + } + + /** + * Like pollOnce(), but performs all pending callbacks until all + * data has been consumed or a file descriptor is available with no callback. + * This function will never return POLL_CALLBACK. + */ + int pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData); + inline int pollAll(int timeoutMillis) { + return pollAll(timeoutMillis, NULL, NULL, NULL); + } + + /** + * Wakes the poll asynchronously. + * + * This method can be called on any thread. + * This method returns immediately. + */ + void wake(); + + /** + * Adds a new file descriptor to be polled by the looper. + * If the same file descriptor was previously added, it is replaced. + * + * "fd" is the file descriptor to be added. + * "ident" is an identifier for this event, which is returned from pollOnce(). + * The identifier must be >= 0, or POLL_CALLBACK if providing a non-NULL callback. + * "events" are the poll events to wake up on. Typically this is EVENT_INPUT. + * "callback" is the function to call when there is an event on the file descriptor. + * "data" is a private data pointer to supply to the callback. + * + * There are two main uses of this function: + * + * (1) If "callback" is non-NULL, then this function will be called when there is + * data on the file descriptor. It should execute any events it has pending, + * appropriately reading from the file descriptor. The 'ident' is ignored in this case. + * + * (2) If "callback" is NULL, the 'ident' will be returned by Looper_pollOnce + * when its file descriptor has data available, requiring the caller to take + * care of processing it. + * + * Returns 1 if the file descriptor was added, 0 if the arguments were invalid. + * + * This method can be called on any thread. + * This method may block briefly if it needs to wake the poll. + * + * The callback may either be specified as a bare function pointer or as a smart + * pointer callback object. The smart pointer should be preferred because it is + * easier to avoid races when the callback is removed from a different thread. + * See removeFd() for details. + */ + int addFd(int fd, int ident, int events, Looper_callbackFunc callback, void* data); + int addFd(int fd, int ident, int events, const sp& callback, void* data); + + /** + * Removes a previously added file descriptor from the looper. + * + * When this method returns, it is safe to close the file descriptor since the looper + * will no longer have a reference to it. However, it is possible for the callback to + * already be running or for it to run one last time if the file descriptor was already + * signalled. Calling code is responsible for ensuring that this case is safely handled. + * For example, if the callback takes care of removing itself during its own execution either + * by returning 0 or by calling this method, then it can be guaranteed to not be invoked + * again at any later time unless registered anew. + * + * A simple way to avoid this problem is to use the version of addFd() that takes + * a sp instead of a bare function pointer. The LooperCallback will + * be released at the appropriate time by the Looper. + * + * Returns 1 if the file descriptor was removed, 0 if none was previously registered. + * + * This method can be called on any thread. + * This method may block briefly if it needs to wake the poll. + */ + int removeFd(int fd); + + /** + * Enqueues a message to be processed by the specified handler. + * + * The handler must not be null. + * This method can be called on any thread. + */ + void sendMessage(const sp& handler, const Message& message); + + /** + * Enqueues a message to be processed by the specified handler after all pending messages + * after the specified delay. + * + * The time delay is specified in uptime nanoseconds. + * The handler must not be null. + * This method can be called on any thread. + */ + void sendMessageDelayed(nsecs_t uptimeDelay, const sp& handler, + const Message& message); + + /** + * Enqueues a message to be processed by the specified handler after all pending messages + * at the specified time. + * + * The time is specified in uptime nanoseconds. + * The handler must not be null. + * This method can be called on any thread. + */ + void sendMessageAtTime(nsecs_t uptime, const sp& handler, + const Message& message); + + /** + * Removes all messages for the specified handler from the queue. + * + * The handler must not be null. + * This method can be called on any thread. + */ + void removeMessages(const sp& handler); + + /** + * Removes all messages of a particular type for the specified handler from the queue. + * + * The handler must not be null. + * This method can be called on any thread. + */ + void removeMessages(const sp& handler, int what); + + /** + * Returns whether this looper's thread is currently polling for more work to do. + * This is a good signal that the loop is still alive rather than being stuck + * handling a callback. Note that this method is intrinsically racy, since the + * state of the loop can change before you get the result back. + */ + bool isPolling() const; + + /** + * Prepares a looper associated with the calling thread, and returns it. + * If the thread already has a looper, it is returned. Otherwise, a new + * one is created, associated with the thread, and returned. + * + * The opts may be PREPARE_ALLOW_NON_CALLBACKS or 0. + */ + static sp prepare(int opts); + + /** + * Sets the given looper to be associated with the calling thread. + * If another looper is already associated with the thread, it is replaced. + * + * If "looper" is NULL, removes the currently associated looper. + */ + static void setForThread(const sp& looper); + + /** + * Returns the looper associated with the calling thread, or NULL if + * there is not one. + */ + static sp getForThread(); + +private: + struct Request { + int fd; + int ident; + int events; + int seq; + sp callback; + void* data; + + void initEventItem(struct epoll_event* eventItem) const; + }; + + struct Response { + int events; + Request request; + }; + + struct MessageEnvelope { + MessageEnvelope() : uptime(0) { } + + MessageEnvelope(nsecs_t uptime, const sp handler, + const Message& message) : uptime(uptime), handler(handler), message(message) { + } + + nsecs_t uptime; + sp handler; + Message message; + }; + + const bool mAllowNonCallbacks; // immutable + + int mWakeEventFd; // immutable + Mutex mLock; + + Vector mMessageEnvelopes; // guarded by mLock + bool mSendingMessage; // guarded by mLock + + // Whether we are currently waiting for work. Not protected by a lock, + // any use of it is racy anyway. + volatile bool mPolling; + + int mEpollFd; // guarded by mLock but only modified on the looper thread + bool mEpollRebuildRequired; // guarded by mLock + + // Locked list of file descriptor monitoring requests. + KeyedVector mRequests; // guarded by mLock + int mNextRequestSeq; + + // This state is only used privately by pollOnce and does not require a lock since + // it runs on a single thread. + Vector mResponses; + size_t mResponseIndex; + nsecs_t mNextMessageUptime; // set to LLONG_MAX when none + + int pollInner(int timeoutMillis); + int removeFd(int fd, int seq); + void awoken(); + void pushResponse(int events, const Request& request); + void rebuildEpollLocked(); + void scheduleEpollRebuildLocked(); + + static void initTLSKey(); + static void threadDestructor(void *st); + static void initEpollEvent(struct epoll_event* eventItem); +}; + +} // namespace android + +#endif // UTILS_LOOPER_H diff --git a/third_party/android_system_core/include/utils/LruCache.h b/third_party/android_system_core/include/utils/LruCache.h new file mode 100644 index 000000000..cd9d7f94a --- /dev/null +++ b/third_party/android_system_core/include/utils/LruCache.h @@ -0,0 +1,250 @@ +/* + * 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_UTILS_LRU_CACHE_H +#define ANDROID_UTILS_LRU_CACHE_H + +#include +#include + +namespace android { + +/** + * GenerationCache callback used when an item is removed + */ +template +class OnEntryRemoved { +public: + virtual ~OnEntryRemoved() { }; + virtual void operator()(EntryKey& key, EntryValue& value) = 0; +}; // class OnEntryRemoved + +template +class LruCache { +public: + explicit LruCache(uint32_t maxCapacity); + + enum Capacity { + kUnlimitedCapacity, + }; + + void setOnEntryRemovedListener(OnEntryRemoved* listener); + size_t size() const; + const TValue& get(const TKey& key); + bool put(const TKey& key, const TValue& value); + bool remove(const TKey& key); + bool removeOldest(); + void clear(); + const TValue& peekOldestValue(); + + class Iterator { + public: + Iterator(const LruCache& cache): mCache(cache), mIndex(-1) { + } + + bool next() { + mIndex = mCache.mTable->next(mIndex); + return (ssize_t)mIndex != -1; + } + + size_t index() const { + return mIndex; + } + + const TValue& value() const { + return mCache.mTable->entryAt(mIndex).value; + } + + const TKey& key() const { + return mCache.mTable->entryAt(mIndex).key; + } + private: + const LruCache& mCache; + size_t mIndex; + }; + +private: + LruCache(const LruCache& that); // disallow copy constructor + + struct Entry { + TKey key; + TValue value; + Entry* parent; + Entry* child; + + Entry(TKey key_, TValue value_) : key(key_), value(value_), parent(NULL), child(NULL) { + } + const TKey& getKey() const { return key; } + }; + + void attachToCache(Entry& entry); + void detachFromCache(Entry& entry); + void rehash(size_t newCapacity); + + UniquePtr > mTable; + OnEntryRemoved* mListener; + Entry* mOldest; + Entry* mYoungest; + uint32_t mMaxCapacity; + TValue mNullValue; +}; + +// Implementation is here, because it's fully templated +template +LruCache::LruCache(uint32_t maxCapacity) + : mTable(new BasicHashtable) + , mListener(NULL) + , mOldest(NULL) + , mYoungest(NULL) + , mMaxCapacity(maxCapacity) + , mNullValue(NULL) { +}; + +template +void LruCache::setOnEntryRemovedListener(OnEntryRemoved* listener) { + mListener = listener; +} + +template +size_t LruCache::size() const { + return mTable->size(); +} + +template +const TValue& LruCache::get(const TKey& key) { + hash_t hash = hash_type(key); + ssize_t index = mTable->find(-1, hash, key); + if (index == -1) { + return mNullValue; + } + Entry& entry = mTable->editEntryAt(index); + detachFromCache(entry); + attachToCache(entry); + return entry.value; +} + +template +bool LruCache::put(const TKey& key, const TValue& value) { + if (mMaxCapacity != kUnlimitedCapacity && size() >= mMaxCapacity) { + removeOldest(); + } + + hash_t hash = hash_type(key); + ssize_t index = mTable->find(-1, hash, key); + if (index >= 0) { + return false; + } + if (!mTable->hasMoreRoom()) { + rehash(mTable->capacity() * 2); + } + + // Would it be better to initialize a blank entry and assign key, value? + Entry initEntry(key, value); + index = mTable->add(hash, initEntry); + Entry& entry = mTable->editEntryAt(index); + attachToCache(entry); + return true; +} + +template +bool LruCache::remove(const TKey& key) { + hash_t hash = hash_type(key); + ssize_t index = mTable->find(-1, hash, key); + if (index < 0) { + return false; + } + Entry& entry = mTable->editEntryAt(index); + if (mListener) { + (*mListener)(entry.key, entry.value); + } + detachFromCache(entry); + mTable->removeAt(index); + return true; +} + +template +bool LruCache::removeOldest() { + if (mOldest != NULL) { + return remove(mOldest->key); + // TODO: should probably abort if false + } + return false; +} + +template +const TValue& LruCache::peekOldestValue() { + if (mOldest) { + return mOldest->value; + } + return mNullValue; +} + +template +void LruCache::clear() { + if (mListener) { + for (Entry* p = mOldest; p != NULL; p = p->child) { + (*mListener)(p->key, p->value); + } + } + mYoungest = NULL; + mOldest = NULL; + mTable->clear(); +} + +template +void LruCache::attachToCache(Entry& entry) { + if (mYoungest == NULL) { + mYoungest = mOldest = &entry; + } else { + entry.parent = mYoungest; + mYoungest->child = &entry; + mYoungest = &entry; + } +} + +template +void LruCache::detachFromCache(Entry& entry) { + if (entry.parent != NULL) { + entry.parent->child = entry.child; + } else { + mOldest = entry.child; + } + if (entry.child != NULL) { + entry.child->parent = entry.parent; + } else { + mYoungest = entry.parent; + } + + entry.parent = NULL; + entry.child = NULL; +} + +template +void LruCache::rehash(size_t newCapacity) { + UniquePtr > oldTable(mTable.release()); + Entry* oldest = mOldest; + + mOldest = NULL; + mYoungest = NULL; + mTable.reset(new BasicHashtable(newCapacity)); + for (Entry* p = oldest; p != NULL; p = p->child) { + put(p->key, p->value); + } +} + +} + +#endif // ANDROID_UTILS_LRU_CACHE_H diff --git a/third_party/android_system_core/include/utils/Mutex.h b/third_party/android_system_core/include/utils/Mutex.h new file mode 100644 index 000000000..757519b08 --- /dev/null +++ b/third_party/android_system_core/include/utils/Mutex.h @@ -0,0 +1,157 @@ +/* + * Copyright (C) 2007 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 _LIBS_UTILS_MUTEX_H +#define _LIBS_UTILS_MUTEX_H + +#include +#include +#include + +#if !defined(_WIN32) +# include +#endif + +#include +#include + +// --------------------------------------------------------------------------- +namespace android { +// --------------------------------------------------------------------------- + +class Condition; + +/* + * Simple mutex class. The implementation is system-dependent. + * + * The mutex must be unlocked by the thread that locked it. They are not + * recursive, i.e. the same thread can't lock it multiple times. + */ +class Mutex { +public: + enum { + PRIVATE = 0, + SHARED = 1 + }; + + Mutex(); + Mutex(const char* name); + Mutex(int type, const char* name = NULL); + ~Mutex(); + + // lock or unlock the mutex + status_t lock(); + void unlock(); + + // lock if possible; returns 0 on success, error otherwise + status_t tryLock(); + +#if HAVE_ANDROID_OS + // lock the mutex, but don't wait longer than timeoutMilliseconds. + // Returns 0 on success, TIMED_OUT for failure due to timeout expiration. + // + // OSX doesn't have pthread_mutex_timedlock() or equivalent. To keep + // capabilities consistent across host OSes, this method is only available + // when building Android binaries. + status_t timedLock(nsecs_t timeoutMilliseconds); +#endif + + // Manages the mutex automatically. It'll be locked when Autolock is + // constructed and released when Autolock goes out of scope. + class Autolock { + public: + inline Autolock(Mutex& mutex) : mLock(mutex) { mLock.lock(); } + inline Autolock(Mutex* mutex) : mLock(*mutex) { mLock.lock(); } + inline ~Autolock() { mLock.unlock(); } + private: + Mutex& mLock; + }; + +private: + friend class Condition; + + // A mutex cannot be copied + Mutex(const Mutex&); + Mutex& operator = (const Mutex&); + +#if !defined(_WIN32) + pthread_mutex_t mMutex; +#else + void _init(); + void* mState; +#endif +}; + +// --------------------------------------------------------------------------- + +#if !defined(_WIN32) + +inline Mutex::Mutex() { + pthread_mutex_init(&mMutex, NULL); +} +inline Mutex::Mutex(__attribute__((unused)) const char* name) { + pthread_mutex_init(&mMutex, NULL); +} +inline Mutex::Mutex(int type, __attribute__((unused)) const char* name) { + if (type == SHARED) { + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); + pthread_mutex_init(&mMutex, &attr); + pthread_mutexattr_destroy(&attr); + } else { + pthread_mutex_init(&mMutex, NULL); + } +} +inline Mutex::~Mutex() { + pthread_mutex_destroy(&mMutex); +} +inline status_t Mutex::lock() { + return -pthread_mutex_lock(&mMutex); +} +inline void Mutex::unlock() { + pthread_mutex_unlock(&mMutex); +} +inline status_t Mutex::tryLock() { + return -pthread_mutex_trylock(&mMutex); +} +#if HAVE_ANDROID_OS +inline status_t Mutex::timedLock(nsecs_t timeoutNs) { + const struct timespec ts = { + /* .tv_sec = */ static_cast(timeoutNs / 1000000000), + /* .tv_nsec = */ static_cast(timeoutNs % 1000000000), + }; + return -pthread_mutex_timedlock(&mMutex, &ts); +} +#endif + +#endif // !defined(_WIN32) + +// --------------------------------------------------------------------------- + +/* + * Automatic mutex. Declare one of these at the top of a function. + * When the function returns, it will go out of scope, and release the + * mutex. + */ + +typedef Mutex::Autolock AutoMutex; + +// --------------------------------------------------------------------------- +}; // namespace android +// --------------------------------------------------------------------------- + +#endif // _LIBS_UTILS_MUTEX_H diff --git a/third_party/android_system_core/include/utils/NativeHandle.h b/third_party/android_system_core/include/utils/NativeHandle.h new file mode 100644 index 000000000..b82516879 --- /dev/null +++ b/third_party/android_system_core/include/utils/NativeHandle.h @@ -0,0 +1,56 @@ +/* + * Copyright 2014 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_NATIVE_HANDLE_H +#define ANDROID_NATIVE_HANDLE_H + +#include +#include + +typedef struct native_handle native_handle_t; + +namespace android { + +class NativeHandle: public LightRefBase { +public: + // Create a refcounted wrapper around a native_handle_t, and declare + // whether the wrapper owns the handle (so that it should clean up the + // handle upon destruction) or not. + // If handle is NULL, no NativeHandle will be created. + static sp create(native_handle_t* handle, bool ownsHandle); + + const native_handle_t* handle() const { + return mHandle; + } + +private: + // for access to the destructor + friend class LightRefBase; + + NativeHandle(native_handle_t* handle, bool ownsHandle); + virtual ~NativeHandle(); + + native_handle_t* mHandle; + bool mOwnsHandle; + + // non-copyable + NativeHandle(const NativeHandle&); + NativeHandle& operator=(const NativeHandle&); +}; + +} // namespace android + +#endif // ANDROID_NATIVE_HANDLE_H diff --git a/third_party/android_system_core/include/utils/Printer.h b/third_party/android_system_core/include/utils/Printer.h new file mode 100644 index 000000000..bb6628767 --- /dev/null +++ b/third_party/android_system_core/include/utils/Printer.h @@ -0,0 +1,119 @@ +/* + * 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_PRINTER_H +#define ANDROID_PRINTER_H + +#include + +namespace android { + +// Interface for printing to an arbitrary data stream +class Printer { +public: + // Print a new line specified by 'string'. \n is appended automatically. + // -- Assumes that the string has no new line in it. + virtual void printLine(const char* string = "") = 0; + + // Print a new line specified by the format string. \n is appended automatically. + // -- Assumes that the resulting string has no new line in it. + virtual void printFormatLine(const char* format, ...) __attribute__((format (printf, 2, 3))); + +protected: + Printer(); + virtual ~Printer(); +}; // class Printer + +// Print to logcat +class LogPrinter : public Printer { +public: + // Create a printer using the specified logcat and log priority + // - Unless ignoreBlankLines is false, print blank lines to logcat + // (Note that the default ALOG behavior is to ignore blank lines) + LogPrinter(const char* logtag, + android_LogPriority priority = ANDROID_LOG_DEBUG, + const char* prefix = 0, + bool ignoreBlankLines = false); + + // Print the specified line to logcat. No \n at the end is necessary. + virtual void printLine(const char* string); + +private: + void printRaw(const char* string); + + const char* mLogTag; + android_LogPriority mPriority; + const char* mPrefix; + bool mIgnoreBlankLines; +}; // class LogPrinter + +// Print to a file descriptor +class FdPrinter : public Printer { +public: + // Create a printer using the specified file descriptor. + // - Each line will be prefixed with 'indent' number of blank spaces. + // - In addition, each line will be prefixed with the 'prefix' string. + FdPrinter(int fd, unsigned int indent = 0, const char* prefix = 0); + + // Print the specified line to the file descriptor. \n is appended automatically. + virtual void printLine(const char* string); + +private: + enum { + MAX_FORMAT_STRING = 20, + }; + + int mFd; + unsigned int mIndent; + const char* mPrefix; + char mFormatString[MAX_FORMAT_STRING]; +}; // class FdPrinter + +class String8; + +// Print to a String8 +class String8Printer : public Printer { +public: + // Create a printer using the specified String8 as the target. + // - In addition, each line will be prefixed with the 'prefix' string. + // - target's memory lifetime must be a superset of this String8Printer. + String8Printer(String8* target, const char* prefix = 0); + + // Append the specified line to the String8. \n is appended automatically. + virtual void printLine(const char* string); + +private: + String8* mTarget; + const char* mPrefix; +}; // class String8Printer + +// Print to an existing Printer by adding a prefix to each line +class PrefixPrinter : public Printer { +public: + // Create a printer using the specified printer as the target. + PrefixPrinter(Printer& printer, const char* prefix); + + // Print the line (prefixed with prefix) using the printer. + virtual void printLine(const char* string); + +private: + Printer& mPrinter; + const char* mPrefix; +}; + +}; // namespace android + +#endif // ANDROID_PRINTER_H diff --git a/third_party/android_system_core/include/utils/ProcessCallStack.h b/third_party/android_system_core/include/utils/ProcessCallStack.h new file mode 100644 index 000000000..32458b8b1 --- /dev/null +++ b/third_party/android_system_core/include/utils/ProcessCallStack.h @@ -0,0 +1,79 @@ +/* + * 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_PROCESS_CALLSTACK_H +#define ANDROID_PROCESS_CALLSTACK_H + +#include +#include +#include +#include + +#include +#include + +namespace android { + +class Printer; + +// Collect/print the call stack (function, file, line) traces for all threads in a process. +class ProcessCallStack { +public: + // Create an empty call stack. No-op. + ProcessCallStack(); + // Copy the existing process callstack (no other side effects). + ProcessCallStack(const ProcessCallStack& rhs); + ~ProcessCallStack(); + + // Immediately collect the stack traces for all threads. + void update(); + + // Print all stack traces to the log using the supplied logtag. + void log(const char* logtag, android_LogPriority priority = ANDROID_LOG_DEBUG, + const char* prefix = 0) const; + + // Dump all stack traces to the specified file descriptor. + void dump(int fd, int indent = 0, const char* prefix = 0) const; + + // Return a string (possibly very long) containing all the stack traces. + String8 toString(const char* prefix = 0) const; + + // Dump a serialized representation of all the stack traces to the specified printer. + void print(Printer& printer) const; + + // Get the number of threads whose stack traces were collected. + size_t size() const; + +private: + void printInternal(Printer& printer, Printer& csPrinter) const; + + // Reset the process's stack frames and metadata. + void clear(); + + struct ThreadInfo { + CallStack callStack; + String8 threadName; + }; + + // tid -> ThreadInfo + KeyedVector mThreadMap; + // Time that update() was last called + struct tm mTimeUpdated; +}; + +}; // namespace android + +#endif // ANDROID_PROCESS_CALLSTACK_H diff --git a/third_party/android_system_core/include/utils/PropertyMap.h b/third_party/android_system_core/include/utils/PropertyMap.h new file mode 100644 index 000000000..a9e674f9a --- /dev/null +++ b/third_party/android_system_core/include/utils/PropertyMap.h @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2010 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 _UTILS_PROPERTY_MAP_H +#define _UTILS_PROPERTY_MAP_H + +#include +#include +#include +#include + +namespace android { + +/* + * Provides a mechanism for passing around string-based property key / value pairs + * and loading them from property files. + * + * The property files have the following simple structure: + * + * # Comment + * key = value + * + * Keys and values are any sequence of printable ASCII characters. + * The '=' separates the key from the value. + * The key and value may not contain whitespace. + * + * The '\' character is reserved for escape sequences and is not currently supported. + * The '"" character is reserved for quoting and is not currently supported. + * Files that contain the '\' or '"' character will fail to parse. + * + * The file must not contain duplicate keys. + * + * TODO Support escape sequences and quoted values when needed. + */ +class PropertyMap { +public: + /* Creates an empty property map. */ + PropertyMap(); + ~PropertyMap(); + + /* Clears the property map. */ + void clear(); + + /* Adds a property. + * Replaces the property with the same key if it is already present. + */ + void addProperty(const String8& key, const String8& value); + + /* Returns true if the property map contains the specified key. */ + bool hasProperty(const String8& key) const; + + /* Gets the value of a property and parses it. + * Returns true and sets outValue if the key was found and its value was parsed successfully. + * Otherwise returns false and does not modify outValue. (Also logs a warning.) + */ + bool tryGetProperty(const String8& key, String8& outValue) const; + bool tryGetProperty(const String8& key, bool& outValue) const; + bool tryGetProperty(const String8& key, int32_t& outValue) const; + bool tryGetProperty(const String8& key, float& outValue) const; + + /* Adds all values from the specified property map. */ + void addAll(const PropertyMap* map); + + /* Gets the underlying property map. */ + inline const KeyedVector& getProperties() const { return mProperties; } + + /* Loads a property map from a file. */ + static status_t load(const String8& filename, PropertyMap** outMap); + +private: + class Parser { + PropertyMap* mMap; + Tokenizer* mTokenizer; + + public: + Parser(PropertyMap* map, Tokenizer* tokenizer); + ~Parser(); + status_t parse(); + + private: + status_t parseType(); + status_t parseKey(); + status_t parseKeyProperty(); + status_t parseModifier(const String8& token, int32_t* outMetaState); + status_t parseCharacterLiteral(char16_t* outCharacter); + }; + + KeyedVector mProperties; +}; + +} // namespace android + +#endif // _UTILS_PROPERTY_MAP_H diff --git a/third_party/android_system_core/include/utils/RWLock.h b/third_party/android_system_core/include/utils/RWLock.h new file mode 100644 index 000000000..e743b1c8c --- /dev/null +++ b/third_party/android_system_core/include/utils/RWLock.h @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2007 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 _LIBS_UTILS_RWLOCK_H +#define _LIBS_UTILS_RWLOCK_H + +#include +#include + +#if !defined(_WIN32) +# include +#endif + +#include +#include + +// --------------------------------------------------------------------------- +namespace android { +// --------------------------------------------------------------------------- + +#if !defined(_WIN32) + +/* + * Simple mutex class. The implementation is system-dependent. + * + * The mutex must be unlocked by the thread that locked it. They are not + * recursive, i.e. the same thread can't lock it multiple times. + */ +class RWLock { +public: + enum { + PRIVATE = 0, + SHARED = 1 + }; + + RWLock(); + RWLock(const char* name); + RWLock(int type, const char* name = NULL); + ~RWLock(); + + status_t readLock(); + status_t tryReadLock(); + status_t writeLock(); + status_t tryWriteLock(); + void unlock(); + + class AutoRLock { + public: + inline AutoRLock(RWLock& rwlock) : mLock(rwlock) { mLock.readLock(); } + inline ~AutoRLock() { mLock.unlock(); } + private: + RWLock& mLock; + }; + + class AutoWLock { + public: + inline AutoWLock(RWLock& rwlock) : mLock(rwlock) { mLock.writeLock(); } + inline ~AutoWLock() { mLock.unlock(); } + private: + RWLock& mLock; + }; + +private: + // A RWLock cannot be copied + RWLock(const RWLock&); + RWLock& operator = (const RWLock&); + + pthread_rwlock_t mRWLock; +}; + +inline RWLock::RWLock() { + pthread_rwlock_init(&mRWLock, NULL); +} +inline RWLock::RWLock(__attribute__((unused)) const char* name) { + pthread_rwlock_init(&mRWLock, NULL); +} +inline RWLock::RWLock(int type, __attribute__((unused)) const char* name) { + if (type == SHARED) { + pthread_rwlockattr_t attr; + pthread_rwlockattr_init(&attr); + pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); + pthread_rwlock_init(&mRWLock, &attr); + pthread_rwlockattr_destroy(&attr); + } else { + pthread_rwlock_init(&mRWLock, NULL); + } +} +inline RWLock::~RWLock() { + pthread_rwlock_destroy(&mRWLock); +} +inline status_t RWLock::readLock() { + return -pthread_rwlock_rdlock(&mRWLock); +} +inline status_t RWLock::tryReadLock() { + return -pthread_rwlock_tryrdlock(&mRWLock); +} +inline status_t RWLock::writeLock() { + return -pthread_rwlock_wrlock(&mRWLock); +} +inline status_t RWLock::tryWriteLock() { + return -pthread_rwlock_trywrlock(&mRWLock); +} +inline void RWLock::unlock() { + pthread_rwlock_unlock(&mRWLock); +} + +#endif // !defined(_WIN32) + +// --------------------------------------------------------------------------- +}; // namespace android +// --------------------------------------------------------------------------- + +#endif // _LIBS_UTILS_RWLOCK_H diff --git a/third_party/android_system_core/include/utils/RefBase.h b/third_party/android_system_core/include/utils/RefBase.h new file mode 100644 index 000000000..eac6a7840 --- /dev/null +++ b/third_party/android_system_core/include/utils/RefBase.h @@ -0,0 +1,555 @@ +/* + * Copyright (C) 2005 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_REF_BASE_H +#define ANDROID_REF_BASE_H + +#include + +#include +#include +#include +#include + +#include +#include + +// --------------------------------------------------------------------------- +namespace android { + +class TextOutput; +TextOutput& printWeakPointer(TextOutput& to, const void* val); + +// --------------------------------------------------------------------------- + +#define COMPARE_WEAK(_op_) \ +inline bool operator _op_ (const sp& o) const { \ + return m_ptr _op_ o.m_ptr; \ +} \ +inline bool operator _op_ (const T* o) const { \ + return m_ptr _op_ o; \ +} \ +template \ +inline bool operator _op_ (const sp& o) const { \ + return m_ptr _op_ o.m_ptr; \ +} \ +template \ +inline bool operator _op_ (const U* o) const { \ + return m_ptr _op_ o; \ +} + +// --------------------------------------------------------------------------- + +class ReferenceRenamer { +protected: + // destructor is purposedly not virtual so we avoid code overhead from + // subclasses; we have to make it protected to guarantee that it + // cannot be called from this base class (and to make strict compilers + // happy). + ~ReferenceRenamer() { } +public: + virtual void operator()(size_t i) const = 0; +}; + +// --------------------------------------------------------------------------- + +class RefBase +{ +public: + void incStrong(const void* id) const; + void decStrong(const void* id) const; + + void forceIncStrong(const void* id) const; + + //! DEBUGGING ONLY: Get current strong ref count. + int32_t getStrongCount() const; + + class weakref_type + { + public: + RefBase* refBase() const; + + void incWeak(const void* id); + void decWeak(const void* id); + + // acquires a strong reference if there is already one. + bool attemptIncStrong(const void* id); + + // acquires a weak reference if there is already one. + // This is not always safe. see ProcessState.cpp and BpBinder.cpp + // for proper use. + bool attemptIncWeak(const void* id); + + //! DEBUGGING ONLY: Get current weak ref count. + int32_t getWeakCount() const; + + //! DEBUGGING ONLY: Print references held on object. + void printRefs() const; + + //! DEBUGGING ONLY: Enable tracking for this object. + // enable -- enable/disable tracking + // retain -- when tracking is enable, if true, then we save a stack trace + // for each reference and dereference; when retain == false, we + // match up references and dereferences and keep only the + // outstanding ones. + + void trackMe(bool enable, bool retain); + }; + + weakref_type* createWeak(const void* id) const; + + weakref_type* getWeakRefs() const; + + //! DEBUGGING ONLY: Print references held on object. + inline void printRefs() const { getWeakRefs()->printRefs(); } + + //! DEBUGGING ONLY: Enable tracking of object. + inline void trackMe(bool enable, bool retain) + { + getWeakRefs()->trackMe(enable, retain); + } + + typedef RefBase basetype; + +protected: + RefBase(); + virtual ~RefBase(); + + //! Flags for extendObjectLifetime() + enum { + OBJECT_LIFETIME_STRONG = 0x0000, + OBJECT_LIFETIME_WEAK = 0x0001, + OBJECT_LIFETIME_MASK = 0x0001 + }; + + void extendObjectLifetime(int32_t mode); + + //! Flags for onIncStrongAttempted() + enum { + FIRST_INC_STRONG = 0x0001 + }; + + virtual void onFirstRef(); + virtual void onLastStrongRef(const void* id); + virtual bool onIncStrongAttempted(uint32_t flags, const void* id); + virtual void onLastWeakRef(const void* id); + +private: + friend class weakref_type; + class weakref_impl; + + RefBase(const RefBase& o); + RefBase& operator=(const RefBase& o); + +private: + friend class ReferenceMover; + + static void renameRefs(size_t n, const ReferenceRenamer& renamer); + + static void renameRefId(weakref_type* ref, + const void* old_id, const void* new_id); + + static void renameRefId(RefBase* ref, + const void* old_id, const void* new_id); + + weakref_impl* const mRefs; +}; + +// --------------------------------------------------------------------------- + +template +class LightRefBase +{ +public: + inline LightRefBase() : mCount(0) { } + inline void incStrong(__attribute__((unused)) const void* id) const { + android_atomic_inc(&mCount); + } + inline void decStrong(__attribute__((unused)) const void* id) const { + if (android_atomic_dec(&mCount) == 1) { + delete static_cast(this); + } + } + //! DEBUGGING ONLY: Get current strong ref count. + inline int32_t getStrongCount() const { + return mCount; + } + + typedef LightRefBase basetype; + +protected: + inline ~LightRefBase() { } + +private: + friend class ReferenceMover; + inline static void renameRefs(size_t n, const ReferenceRenamer& renamer) { } + inline static void renameRefId(T* ref, + const void* old_id, const void* new_id) { } + +private: + mutable volatile int32_t mCount; +}; + +// This is a wrapper around LightRefBase that simply enforces a virtual +// destructor to eliminate the template requirement of LightRefBase +class VirtualLightRefBase : public LightRefBase { +public: + virtual ~VirtualLightRefBase() {} +}; + +// --------------------------------------------------------------------------- + +template +class wp +{ +public: + typedef typename RefBase::weakref_type weakref_type; + + inline wp() : m_ptr(0) { } + + wp(T* other); + wp(const wp& other); + wp(const sp& other); + template wp(U* other); + template wp(const sp& other); + template wp(const wp& other); + + ~wp(); + + // Assignment + + wp& operator = (T* other); + wp& operator = (const wp& other); + wp& operator = (const sp& other); + + template wp& operator = (U* other); + template wp& operator = (const wp& other); + template wp& operator = (const sp& other); + + void set_object_and_refs(T* other, weakref_type* refs); + + // promotion to sp + + sp promote() const; + + // Reset + + void clear(); + + // Accessors + + inline weakref_type* get_refs() const { return m_refs; } + + inline T* unsafe_get() const { return m_ptr; } + + // Operators + + COMPARE_WEAK(==) + COMPARE_WEAK(!=) + COMPARE_WEAK(>) + COMPARE_WEAK(<) + COMPARE_WEAK(<=) + COMPARE_WEAK(>=) + + inline bool operator == (const wp& o) const { + return (m_ptr == o.m_ptr) && (m_refs == o.m_refs); + } + template + inline bool operator == (const wp& o) const { + return m_ptr == o.m_ptr; + } + + inline bool operator > (const wp& o) const { + return (m_ptr == o.m_ptr) ? (m_refs > o.m_refs) : (m_ptr > o.m_ptr); + } + template + inline bool operator > (const wp& o) const { + return (m_ptr == o.m_ptr) ? (m_refs > o.m_refs) : (m_ptr > o.m_ptr); + } + + inline bool operator < (const wp& o) const { + return (m_ptr == o.m_ptr) ? (m_refs < o.m_refs) : (m_ptr < o.m_ptr); + } + template + inline bool operator < (const wp& o) const { + return (m_ptr == o.m_ptr) ? (m_refs < o.m_refs) : (m_ptr < o.m_ptr); + } + inline bool operator != (const wp& o) const { return m_refs != o.m_refs; } + template inline bool operator != (const wp& o) const { return !operator == (o); } + inline bool operator <= (const wp& o) const { return !operator > (o); } + template inline bool operator <= (const wp& o) const { return !operator > (o); } + inline bool operator >= (const wp& o) const { return !operator < (o); } + template inline bool operator >= (const wp& o) const { return !operator < (o); } + +private: + template friend class sp; + template friend class wp; + + T* m_ptr; + weakref_type* m_refs; +}; + +template +TextOutput& operator<<(TextOutput& to, const wp& val); + +#undef COMPARE_WEAK + +// --------------------------------------------------------------------------- +// No user serviceable parts below here. + +template +wp::wp(T* other) + : m_ptr(other) +{ + if (other) m_refs = other->createWeak(this); +} + +template +wp::wp(const wp& other) + : m_ptr(other.m_ptr), m_refs(other.m_refs) +{ + if (m_ptr) m_refs->incWeak(this); +} + +template +wp::wp(const sp& other) + : m_ptr(other.m_ptr) +{ + if (m_ptr) { + m_refs = m_ptr->createWeak(this); + } +} + +template template +wp::wp(U* other) + : m_ptr(other) +{ + if (other) m_refs = other->createWeak(this); +} + +template template +wp::wp(const wp& other) + : m_ptr(other.m_ptr) +{ + if (m_ptr) { + m_refs = other.m_refs; + m_refs->incWeak(this); + } +} + +template template +wp::wp(const sp& other) + : m_ptr(other.m_ptr) +{ + if (m_ptr) { + m_refs = m_ptr->createWeak(this); + } +} + +template +wp::~wp() +{ + if (m_ptr) m_refs->decWeak(this); +} + +template +wp& wp::operator = (T* other) +{ + weakref_type* newRefs = + other ? other->createWeak(this) : 0; + if (m_ptr) m_refs->decWeak(this); + m_ptr = other; + m_refs = newRefs; + return *this; +} + +template +wp& wp::operator = (const wp& other) +{ + weakref_type* otherRefs(other.m_refs); + T* otherPtr(other.m_ptr); + if (otherPtr) otherRefs->incWeak(this); + if (m_ptr) m_refs->decWeak(this); + m_ptr = otherPtr; + m_refs = otherRefs; + return *this; +} + +template +wp& wp::operator = (const sp& other) +{ + weakref_type* newRefs = + other != NULL ? other->createWeak(this) : 0; + T* otherPtr(other.m_ptr); + if (m_ptr) m_refs->decWeak(this); + m_ptr = otherPtr; + m_refs = newRefs; + return *this; +} + +template template +wp& wp::operator = (U* other) +{ + weakref_type* newRefs = + other ? other->createWeak(this) : 0; + if (m_ptr) m_refs->decWeak(this); + m_ptr = other; + m_refs = newRefs; + return *this; +} + +template template +wp& wp::operator = (const wp& other) +{ + weakref_type* otherRefs(other.m_refs); + U* otherPtr(other.m_ptr); + if (otherPtr) otherRefs->incWeak(this); + if (m_ptr) m_refs->decWeak(this); + m_ptr = otherPtr; + m_refs = otherRefs; + return *this; +} + +template template +wp& wp::operator = (const sp& other) +{ + weakref_type* newRefs = + other != NULL ? other->createWeak(this) : 0; + U* otherPtr(other.m_ptr); + if (m_ptr) m_refs->decWeak(this); + m_ptr = otherPtr; + m_refs = newRefs; + return *this; +} + +template +void wp::set_object_and_refs(T* other, weakref_type* refs) +{ + if (other) refs->incWeak(this); + if (m_ptr) m_refs->decWeak(this); + m_ptr = other; + m_refs = refs; +} + +template +sp wp::promote() const +{ + sp result; + if (m_ptr && m_refs->attemptIncStrong(&result)) { + result.set_pointer(m_ptr); + } + return result; +} + +template +void wp::clear() +{ + if (m_ptr) { + m_refs->decWeak(this); + m_ptr = 0; + } +} + +template +inline TextOutput& operator<<(TextOutput& to, const wp& val) +{ + return printWeakPointer(to, val.unsafe_get()); +} + +// --------------------------------------------------------------------------- + +// this class just serves as a namespace so TYPE::moveReferences can stay +// private. +class ReferenceMover { +public: + // it would be nice if we could make sure no extra code is generated + // for sp or wp when TYPE is a descendant of RefBase: + // Using a sp override doesn't work; it's a bit like we wanted + // a template template... + + template static inline + void move_references(sp* d, sp const* s, size_t n) { + + class Renamer : public ReferenceRenamer { + sp* d; + sp const* s; + virtual void operator()(size_t i) const { + // The id are known to be the sp<>'s this pointer + TYPE::renameRefId(d[i].get(), &s[i], &d[i]); + } + public: + Renamer(sp* d, sp const* s) : d(d), s(s) { } + virtual ~Renamer() { } + }; + + memmove(d, s, n*sizeof(sp)); + TYPE::renameRefs(n, Renamer(d, s)); + } + + + template static inline + void move_references(wp* d, wp const* s, size_t n) { + + class Renamer : public ReferenceRenamer { + wp* d; + wp const* s; + virtual void operator()(size_t i) const { + // The id are known to be the wp<>'s this pointer + TYPE::renameRefId(d[i].get_refs(), &s[i], &d[i]); + } + public: + Renamer(wp* d, wp const* s) : d(d), s(s) { } + virtual ~Renamer() { } + }; + + memmove(d, s, n*sizeof(wp)); + TYPE::renameRefs(n, Renamer(d, s)); + } +}; + +// specialization for moving sp<> and wp<> types. +// these are used by the [Sorted|Keyed]Vector<> implementations +// sp<> and wp<> need to be handled specially, because they do not +// have trivial copy operation in the general case (see RefBase.cpp +// when DEBUG ops are enabled), but can be implemented very +// efficiently in most cases. + +template inline +void move_forward_type(sp* d, sp const* s, size_t n) { + ReferenceMover::move_references(d, s, n); +} + +template inline +void move_backward_type(sp* d, sp const* s, size_t n) { + ReferenceMover::move_references(d, s, n); +} + +template inline +void move_forward_type(wp* d, wp const* s, size_t n) { + ReferenceMover::move_references(d, s, n); +} + +template inline +void move_backward_type(wp* d, wp const* s, size_t n) { + ReferenceMover::move_references(d, s, n); +} + + +}; // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_REF_BASE_H diff --git a/third_party/android_system_core/include/utils/SharedBuffer.h b/third_party/android_system_core/include/utils/SharedBuffer.h new file mode 100644 index 000000000..b6709537e --- /dev/null +++ b/third_party/android_system_core/include/utils/SharedBuffer.h @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2005 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_SHARED_BUFFER_H +#define ANDROID_SHARED_BUFFER_H + +#include +#include + +// --------------------------------------------------------------------------- + +namespace android { + +class SharedBuffer +{ +public: + + /* flags to use with release() */ + enum { + eKeepStorage = 0x00000001 + }; + + /*! allocate a buffer of size 'size' and acquire() it. + * call release() to free it. + */ + static SharedBuffer* alloc(size_t size); + + /*! free the memory associated with the SharedBuffer. + * Fails if there are any users associated with this SharedBuffer. + * In other words, the buffer must have been release by all its + * users. + */ + static ssize_t dealloc(const SharedBuffer* released); + + //! access the data for read + inline const void* data() const; + + //! access the data for read/write + inline void* data(); + + //! get size of the buffer + inline size_t size() const; + + //! get back a SharedBuffer object from its data + static inline SharedBuffer* bufferFromData(void* data); + + //! get back a SharedBuffer object from its data + static inline const SharedBuffer* bufferFromData(const void* data); + + //! get the size of a SharedBuffer object from its data + static inline size_t sizeFromData(const void* data); + + //! edit the buffer (get a writtable, or non-const, version of it) + SharedBuffer* edit() const; + + //! edit the buffer, resizing if needed + SharedBuffer* editResize(size_t size) const; + + //! like edit() but fails if a copy is required + SharedBuffer* attemptEdit() const; + + //! resize and edit the buffer, loose it's content. + SharedBuffer* reset(size_t size) const; + + //! acquire/release a reference on this buffer + void acquire() const; + + /*! release a reference on this buffer, with the option of not + * freeing the memory associated with it if it was the last reference + * returns the previous reference count + */ + int32_t release(uint32_t flags = 0) const; + + //! returns wether or not we're the only owner + inline bool onlyOwner() const; + + +private: + inline SharedBuffer() { } + inline ~SharedBuffer() { } + SharedBuffer(const SharedBuffer&); + SharedBuffer& operator = (const SharedBuffer&); + + // 16 bytes. must be sized to preserve correct alignment. + mutable int32_t mRefs; + size_t mSize; + uint32_t mReserved[2]; +}; + +// --------------------------------------------------------------------------- + +const void* SharedBuffer::data() const { + return this + 1; +} + +void* SharedBuffer::data() { + return this + 1; +} + +size_t SharedBuffer::size() const { + return mSize; +} + +SharedBuffer* SharedBuffer::bufferFromData(void* data) { + return data ? static_cast(data)-1 : 0; +} + +const SharedBuffer* SharedBuffer::bufferFromData(const void* data) { + return data ? static_cast(data)-1 : 0; +} + +size_t SharedBuffer::sizeFromData(const void* data) { + return data ? bufferFromData(data)->mSize : 0; +} + +bool SharedBuffer::onlyOwner() const { + return (mRefs == 1); +} + +}; // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_VECTOR_H diff --git a/third_party/android_system_core/include/utils/Singleton.h b/third_party/android_system_core/include/utils/Singleton.h new file mode 100644 index 000000000..ffc03cb5d --- /dev/null +++ b/third_party/android_system_core/include/utils/Singleton.h @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2007 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_UTILS_SINGLETON_H +#define ANDROID_UTILS_SINGLETON_H + +#include +#include +#include +#include + +namespace android { +// --------------------------------------------------------------------------- + +template +class ANDROID_API Singleton +{ +public: + static TYPE& getInstance() { + Mutex::Autolock _l(sLock); + TYPE* instance = sInstance; + if (instance == 0) { + instance = new TYPE(); + sInstance = instance; + } + return *instance; + } + + static bool hasInstance() { + Mutex::Autolock _l(sLock); + return sInstance != 0; + } + +protected: + ~Singleton() { }; + Singleton() { }; + +private: + Singleton(const Singleton&); + Singleton& operator = (const Singleton&); + static Mutex sLock; + static TYPE* sInstance; +}; + +/* + * use ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) in your implementation file + * (eg: .cpp) to create the static instance of Singleton<>'s attributes, + * and avoid to have a copy of them in each compilation units Singleton + * is used. + * NOTE: we use a version of Mutex ctor that takes a parameter, because + * for some unknown reason using the default ctor doesn't emit the variable! + */ + +#define ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) \ + template<> ::android::Mutex \ + (::android::Singleton< TYPE >::sLock)(::android::Mutex::PRIVATE); \ + template<> TYPE* ::android::Singleton< TYPE >::sInstance(0); \ + template class ::android::Singleton< TYPE >; + + +// --------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_UTILS_SINGLETON_H + diff --git a/third_party/android_system_core/include/utils/SortedVector.h b/third_party/android_system_core/include/utils/SortedVector.h new file mode 100644 index 000000000..2d3e82a7c --- /dev/null +++ b/third_party/android_system_core/include/utils/SortedVector.h @@ -0,0 +1,282 @@ +/* + * Copyright (C) 2005 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_SORTED_VECTOR_H +#define ANDROID_SORTED_VECTOR_H + +#include +#include +#include + +#include + +#include +#include +#include + +// --------------------------------------------------------------------------- + +namespace android { + +template +class SortedVector : private SortedVectorImpl +{ + friend class Vector; + +public: + typedef TYPE value_type; + + /*! + * Constructors and destructors + */ + + SortedVector(); + SortedVector(const SortedVector& rhs); + virtual ~SortedVector(); + + /*! copy operator */ + const SortedVector& operator = (const SortedVector& rhs) const; + SortedVector& operator = (const SortedVector& rhs); + + /* + * empty the vector + */ + + inline void clear() { VectorImpl::clear(); } + + /*! + * vector stats + */ + + //! returns number of items in the vector + inline size_t size() const { return VectorImpl::size(); } + //! returns whether or not the vector is empty + inline bool isEmpty() const { return VectorImpl::isEmpty(); } + //! returns how many items can be stored without reallocating the backing store + inline size_t capacity() const { return VectorImpl::capacity(); } + //! sets the capacity. capacity can never be reduced less than size() + inline ssize_t setCapacity(size_t size) { return VectorImpl::setCapacity(size); } + + /*! + * C-style array access + */ + + //! read-only C-style access + inline const TYPE* array() const; + + //! read-write C-style access. BE VERY CAREFUL when modifying the array + //! you must keep it sorted! You usually don't use this function. + TYPE* editArray(); + + //! finds the index of an item + ssize_t indexOf(const TYPE& item) const; + + //! finds where this item should be inserted + size_t orderOf(const TYPE& item) const; + + + /*! + * accessors + */ + + //! read-only access to an item at a given index + inline const TYPE& operator [] (size_t index) const; + //! alternate name for operator [] + inline const TYPE& itemAt(size_t index) const; + //! stack-usage of the vector. returns the top of the stack (last element) + const TYPE& top() const; + + /*! + * modifying the array + */ + + //! add an item in the right place (and replace the one that is there) + ssize_t add(const TYPE& item); + + //! editItemAt() MUST NOT change the order of this item + TYPE& editItemAt(size_t index) { + return *( static_cast(VectorImpl::editItemLocation(index)) ); + } + + //! merges a vector into this one + ssize_t merge(const Vector& vector); + ssize_t merge(const SortedVector& vector); + + //! removes an item + ssize_t remove(const TYPE&); + + //! remove several items + inline ssize_t removeItemsAt(size_t index, size_t count = 1); + //! remove one item + inline ssize_t removeAt(size_t index) { return removeItemsAt(index); } + +protected: + virtual void do_construct(void* storage, size_t num) const; + virtual void do_destroy(void* storage, size_t num) const; + virtual void do_copy(void* dest, const void* from, size_t num) const; + virtual void do_splat(void* dest, const void* item, size_t num) const; + virtual void do_move_forward(void* dest, const void* from, size_t num) const; + virtual void do_move_backward(void* dest, const void* from, size_t num) const; + virtual int do_compare(const void* lhs, const void* rhs) const; +}; + +// SortedVector can be trivially moved using memcpy() because moving does not +// require any change to the underlying SharedBuffer contents or reference count. +template struct trait_trivial_move > { enum { value = true }; }; + +// --------------------------------------------------------------------------- +// No user serviceable parts from here... +// --------------------------------------------------------------------------- + +template inline +SortedVector::SortedVector() + : SortedVectorImpl(sizeof(TYPE), + ((traits::has_trivial_ctor ? HAS_TRIVIAL_CTOR : 0) + |(traits::has_trivial_dtor ? HAS_TRIVIAL_DTOR : 0) + |(traits::has_trivial_copy ? HAS_TRIVIAL_COPY : 0)) + ) +{ +} + +template inline +SortedVector::SortedVector(const SortedVector& rhs) + : SortedVectorImpl(rhs) { +} + +template inline +SortedVector::~SortedVector() { + finish_vector(); +} + +template inline +SortedVector& SortedVector::operator = (const SortedVector& rhs) { + SortedVectorImpl::operator = (rhs); + return *this; +} + +template inline +const SortedVector& SortedVector::operator = (const SortedVector& rhs) const { + SortedVectorImpl::operator = (rhs); + return *this; +} + +template inline +const TYPE* SortedVector::array() const { + return static_cast(arrayImpl()); +} + +template inline +TYPE* SortedVector::editArray() { + return static_cast(editArrayImpl()); +} + + +template inline +const TYPE& SortedVector::operator[](size_t index) const { + LOG_FATAL_IF(index>=size(), + "%s: index=%u out of range (%u)", __PRETTY_FUNCTION__, + int(index), int(size())); + return *(array() + index); +} + +template inline +const TYPE& SortedVector::itemAt(size_t index) const { + return operator[](index); +} + +template inline +const TYPE& SortedVector::top() const { + return *(array() + size() - 1); +} + +template inline +ssize_t SortedVector::add(const TYPE& item) { + return SortedVectorImpl::add(&item); +} + +template inline +ssize_t SortedVector::indexOf(const TYPE& item) const { + return SortedVectorImpl::indexOf(&item); +} + +template inline +size_t SortedVector::orderOf(const TYPE& item) const { + return SortedVectorImpl::orderOf(&item); +} + +template inline +ssize_t SortedVector::merge(const Vector& vector) { + return SortedVectorImpl::merge(reinterpret_cast(vector)); +} + +template inline +ssize_t SortedVector::merge(const SortedVector& vector) { + return SortedVectorImpl::merge(reinterpret_cast(vector)); +} + +template inline +ssize_t SortedVector::remove(const TYPE& item) { + return SortedVectorImpl::remove(&item); +} + +template inline +ssize_t SortedVector::removeItemsAt(size_t index, size_t count) { + return VectorImpl::removeItemsAt(index, count); +} + +// --------------------------------------------------------------------------- + +template +void SortedVector::do_construct(void* storage, size_t num) const { + construct_type( reinterpret_cast(storage), num ); +} + +template +void SortedVector::do_destroy(void* storage, size_t num) const { + destroy_type( reinterpret_cast(storage), num ); +} + +template +void SortedVector::do_copy(void* dest, const void* from, size_t num) const { + copy_type( reinterpret_cast(dest), reinterpret_cast(from), num ); +} + +template +void SortedVector::do_splat(void* dest, const void* item, size_t num) const { + splat_type( reinterpret_cast(dest), reinterpret_cast(item), num ); +} + +template +void SortedVector::do_move_forward(void* dest, const void* from, size_t num) const { + move_forward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); +} + +template +void SortedVector::do_move_backward(void* dest, const void* from, size_t num) const { + move_backward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); +} + +template +int SortedVector::do_compare(const void* lhs, const void* rhs) const { + return compare_type( *reinterpret_cast(lhs), *reinterpret_cast(rhs) ); +} + +}; // namespace android + + +// --------------------------------------------------------------------------- + +#endif // ANDROID_SORTED_VECTOR_H diff --git a/third_party/android_system_core/include/utils/StopWatch.h b/third_party/android_system_core/include/utils/StopWatch.h new file mode 100644 index 000000000..693dd3ccf --- /dev/null +++ b/third_party/android_system_core/include/utils/StopWatch.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2005 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_STOPWATCH_H +#define ANDROID_STOPWATCH_H + +#include +#include + +#include + +// --------------------------------------------------------------------------- + +namespace android { + +class StopWatch +{ +public: + StopWatch( const char *name, + int clock = SYSTEM_TIME_MONOTONIC, + uint32_t flags = 0); + ~StopWatch(); + + const char* name() const; + nsecs_t lap(); + nsecs_t elapsedTime() const; + + void reset(); + +private: + const char* mName; + int mClock; + uint32_t mFlags; + + struct lap_t { + nsecs_t soFar; + nsecs_t thisLap; + }; + + nsecs_t mStartTime; + lap_t mLaps[8]; + int mNumLaps; +}; + + +}; // namespace android + + +// --------------------------------------------------------------------------- + +#endif // ANDROID_STOPWATCH_H diff --git a/third_party/android_system_core/include/utils/String16.h b/third_party/android_system_core/include/utils/String16.h new file mode 100644 index 000000000..d131bfc6a --- /dev/null +++ b/third_party/android_system_core/include/utils/String16.h @@ -0,0 +1,250 @@ +/* + * Copyright (C) 2005 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_STRING16_H +#define ANDROID_STRING16_H + +#include +#include +#include +#include + +// --------------------------------------------------------------------------- + +extern "C" { + +} + +// --------------------------------------------------------------------------- + +namespace android { + +// --------------------------------------------------------------------------- + +class String8; +class TextOutput; + +//! This is a string holding UTF-16 characters. +class String16 +{ +public: + /* use String16(StaticLinkage) if you're statically linking against + * libutils and declaring an empty static String16, e.g.: + * + * static String16 sAStaticEmptyString(String16::kEmptyString); + * static String16 sAnotherStaticEmptyString(sAStaticEmptyString); + */ + enum StaticLinkage { kEmptyString }; + + String16(); + explicit String16(StaticLinkage); + String16(const String16& o); + String16(const String16& o, + size_t len, + size_t begin=0); + explicit String16(const char16_t* o); + explicit String16(const char16_t* o, size_t len); + explicit String16(const String8& o); + explicit String16(const char* o); + explicit String16(const char* o, size_t len); + + ~String16(); + + inline const char16_t* string() const; + inline size_t size() const; + + inline const SharedBuffer* sharedBuffer() const; + + void setTo(const String16& other); + status_t setTo(const char16_t* other); + status_t setTo(const char16_t* other, size_t len); + status_t setTo(const String16& other, + size_t len, + size_t begin=0); + + status_t append(const String16& other); + status_t append(const char16_t* other, size_t len); + + inline String16& operator=(const String16& other); + + inline String16& operator+=(const String16& other); + inline String16 operator+(const String16& other) const; + + status_t insert(size_t pos, const char16_t* chrs); + status_t insert(size_t pos, + const char16_t* chrs, size_t len); + + ssize_t findFirst(char16_t c) const; + ssize_t findLast(char16_t c) const; + + bool startsWith(const String16& prefix) const; + bool startsWith(const char16_t* prefix) const; + + status_t makeLower(); + + status_t replaceAll(char16_t replaceThis, + char16_t withThis); + + status_t remove(size_t len, size_t begin=0); + + inline int compare(const String16& other) const; + + inline bool operator<(const String16& other) const; + inline bool operator<=(const String16& other) const; + inline bool operator==(const String16& other) const; + inline bool operator!=(const String16& other) const; + inline bool operator>=(const String16& other) const; + inline bool operator>(const String16& other) const; + + inline bool operator<(const char16_t* other) const; + inline bool operator<=(const char16_t* other) const; + inline bool operator==(const char16_t* other) const; + inline bool operator!=(const char16_t* other) const; + inline bool operator>=(const char16_t* other) const; + inline bool operator>(const char16_t* other) const; + + inline operator const char16_t*() const; + +private: + const char16_t* mString; +}; + +// String16 can be trivially moved using memcpy() because moving does not +// require any change to the underlying SharedBuffer contents or reference count. +ANDROID_TRIVIAL_MOVE_TRAIT(String16) + +// --------------------------------------------------------------------------- +// No user servicable parts below. + +inline int compare_type(const String16& lhs, const String16& rhs) +{ + return lhs.compare(rhs); +} + +inline int strictly_order_type(const String16& lhs, const String16& rhs) +{ + return compare_type(lhs, rhs) < 0; +} + +inline const char16_t* String16::string() const +{ + return mString; +} + +inline size_t String16::size() const +{ + return SharedBuffer::sizeFromData(mString)/sizeof(char16_t)-1; +} + +inline const SharedBuffer* String16::sharedBuffer() const +{ + return SharedBuffer::bufferFromData(mString); +} + +inline String16& String16::operator=(const String16& other) +{ + setTo(other); + return *this; +} + +inline String16& String16::operator+=(const String16& other) +{ + append(other); + return *this; +} + +inline String16 String16::operator+(const String16& other) const +{ + String16 tmp(*this); + tmp += other; + return tmp; +} + +inline int String16::compare(const String16& other) const +{ + return strzcmp16(mString, size(), other.mString, other.size()); +} + +inline bool String16::operator<(const String16& other) const +{ + return strzcmp16(mString, size(), other.mString, other.size()) < 0; +} + +inline bool String16::operator<=(const String16& other) const +{ + return strzcmp16(mString, size(), other.mString, other.size()) <= 0; +} + +inline bool String16::operator==(const String16& other) const +{ + return strzcmp16(mString, size(), other.mString, other.size()) == 0; +} + +inline bool String16::operator!=(const String16& other) const +{ + return strzcmp16(mString, size(), other.mString, other.size()) != 0; +} + +inline bool String16::operator>=(const String16& other) const +{ + return strzcmp16(mString, size(), other.mString, other.size()) >= 0; +} + +inline bool String16::operator>(const String16& other) const +{ + return strzcmp16(mString, size(), other.mString, other.size()) > 0; +} + +inline bool String16::operator<(const char16_t* other) const +{ + return strcmp16(mString, other) < 0; +} + +inline bool String16::operator<=(const char16_t* other) const +{ + return strcmp16(mString, other) <= 0; +} + +inline bool String16::operator==(const char16_t* other) const +{ + return strcmp16(mString, other) == 0; +} + +inline bool String16::operator!=(const char16_t* other) const +{ + return strcmp16(mString, other) != 0; +} + +inline bool String16::operator>=(const char16_t* other) const +{ + return strcmp16(mString, other) >= 0; +} + +inline bool String16::operator>(const char16_t* other) const +{ + return strcmp16(mString, other) > 0; +} + +inline String16::operator const char16_t*() const +{ + return mString; +} + +}; // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_STRING16_H diff --git a/third_party/android_system_core/include/utils/String8.h b/third_party/android_system_core/include/utils/String8.h new file mode 100644 index 000000000..ecfcf10be --- /dev/null +++ b/third_party/android_system_core/include/utils/String8.h @@ -0,0 +1,408 @@ +/* + * Copyright (C) 2005 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_STRING8_H +#define ANDROID_STRING8_H + +#include +#include +#include +#include + +#include // for strcmp +#include + +// --------------------------------------------------------------------------- + +namespace android { + +class String16; +class TextOutput; + +//! This is a string holding UTF-8 characters. Does not allow the value more +// than 0x10FFFF, which is not valid unicode codepoint. +class String8 +{ +public: + /* use String8(StaticLinkage) if you're statically linking against + * libutils and declaring an empty static String8, e.g.: + * + * static String8 sAStaticEmptyString(String8::kEmptyString); + * static String8 sAnotherStaticEmptyString(sAStaticEmptyString); + */ + enum StaticLinkage { kEmptyString }; + + String8(); + explicit String8(StaticLinkage); + String8(const String8& o); + explicit String8(const char* o); + explicit String8(const char* o, size_t numChars); + + explicit String8(const String16& o); + explicit String8(const char16_t* o); + explicit String8(const char16_t* o, size_t numChars); + explicit String8(const char32_t* o); + explicit String8(const char32_t* o, size_t numChars); + ~String8(); + + static inline const String8 empty(); + + static String8 format(const char* fmt, ...) __attribute__((format (printf, 1, 2))); + static String8 formatV(const char* fmt, va_list args); + + inline const char* string() const; + inline size_t size() const; + inline size_t length() const; + inline size_t bytes() const; + inline bool isEmpty() const; + + inline const SharedBuffer* sharedBuffer() const; + + void clear(); + + void setTo(const String8& other); + status_t setTo(const char* other); + status_t setTo(const char* other, size_t numChars); + status_t setTo(const char16_t* other, size_t numChars); + status_t setTo(const char32_t* other, + size_t length); + + status_t append(const String8& other); + status_t append(const char* other); + status_t append(const char* other, size_t numChars); + + status_t appendFormat(const char* fmt, ...) + __attribute__((format (printf, 2, 3))); + status_t appendFormatV(const char* fmt, va_list args); + + // Note that this function takes O(N) time to calculate the value. + // No cache value is stored. + size_t getUtf32Length() const; + int32_t getUtf32At(size_t index, + size_t *next_index) const; + void getUtf32(char32_t* dst) const; + + inline String8& operator=(const String8& other); + inline String8& operator=(const char* other); + + inline String8& operator+=(const String8& other); + inline String8 operator+(const String8& other) const; + + inline String8& operator+=(const char* other); + inline String8 operator+(const char* other) const; + + inline int compare(const String8& other) const; + + inline bool operator<(const String8& other) const; + inline bool operator<=(const String8& other) const; + inline bool operator==(const String8& other) const; + inline bool operator!=(const String8& other) const; + inline bool operator>=(const String8& other) const; + inline bool operator>(const String8& other) const; + + inline bool operator<(const char* other) const; + inline bool operator<=(const char* other) const; + inline bool operator==(const char* other) const; + inline bool operator!=(const char* other) const; + inline bool operator>=(const char* other) const; + inline bool operator>(const char* other) const; + + inline operator const char*() const; + + char* lockBuffer(size_t size); + void unlockBuffer(); + status_t unlockBuffer(size_t size); + + // return the index of the first byte of other in this at or after + // start, or -1 if not found + ssize_t find(const char* other, size_t start = 0) const; + + // return true if this string contains the specified substring + inline bool contains(const char* other) const; + + // removes all occurrence of the specified substring + // returns true if any were found and removed + bool removeAll(const char* other); + + void toLower(); + void toLower(size_t start, size_t numChars); + void toUpper(); + void toUpper(size_t start, size_t numChars); + + + /* + * These methods operate on the string as if it were a path name. + */ + + /* + * Set the filename field to a specific value. + * + * Normalizes the filename, removing a trailing '/' if present. + */ + void setPathName(const char* name); + void setPathName(const char* name, size_t numChars); + + /* + * Get just the filename component. + * + * "/tmp/foo/bar.c" --> "bar.c" + */ + String8 getPathLeaf(void) const; + + /* + * Remove the last (file name) component, leaving just the directory + * name. + * + * "/tmp/foo/bar.c" --> "/tmp/foo" + * "/tmp" --> "" // ????? shouldn't this be "/" ???? XXX + * "bar.c" --> "" + */ + String8 getPathDir(void) const; + + /* + * Retrieve the front (root dir) component. Optionally also return the + * remaining components. + * + * "/tmp/foo/bar.c" --> "tmp" (remain = "foo/bar.c") + * "/tmp" --> "tmp" (remain = "") + * "bar.c" --> "bar.c" (remain = "") + */ + String8 walkPath(String8* outRemains = NULL) const; + + /* + * Return the filename extension. This is the last '.' and any number + * of characters that follow it. The '.' is included in case we + * decide to expand our definition of what constitutes an extension. + * + * "/tmp/foo/bar.c" --> ".c" + * "/tmp" --> "" + * "/tmp/foo.bar/baz" --> "" + * "foo.jpeg" --> ".jpeg" + * "foo." --> "" + */ + String8 getPathExtension(void) const; + + /* + * Return the path without the extension. Rules for what constitutes + * an extension are described in the comment for getPathExtension(). + * + * "/tmp/foo/bar.c" --> "/tmp/foo/bar" + */ + String8 getBasePath(void) const; + + /* + * Add a component to the pathname. We guarantee that there is + * exactly one path separator between the old path and the new. + * If there is no existing name, we just copy the new name in. + * + * If leaf is a fully qualified path (i.e. starts with '/', it + * replaces whatever was there before. + */ + String8& appendPath(const char* leaf); + String8& appendPath(const String8& leaf) { return appendPath(leaf.string()); } + + /* + * Like appendPath(), but does not affect this string. Returns a new one instead. + */ + String8 appendPathCopy(const char* leaf) const + { String8 p(*this); p.appendPath(leaf); return p; } + String8 appendPathCopy(const String8& leaf) const { return appendPathCopy(leaf.string()); } + + /* + * Converts all separators in this string to /, the default path separator. + * + * If the default OS separator is backslash, this converts all + * backslashes to slashes, in-place. Otherwise it does nothing. + * Returns self. + */ + String8& convertToResPath(); + +private: + status_t real_append(const char* other, size_t numChars); + char* find_extension(void) const; + + const char* mString; +}; + +// String8 can be trivially moved using memcpy() because moving does not +// require any change to the underlying SharedBuffer contents or reference count. +ANDROID_TRIVIAL_MOVE_TRAIT(String8) + +// --------------------------------------------------------------------------- +// No user servicable parts below. + +inline int compare_type(const String8& lhs, const String8& rhs) +{ + return lhs.compare(rhs); +} + +inline int strictly_order_type(const String8& lhs, const String8& rhs) +{ + return compare_type(lhs, rhs) < 0; +} + +inline const String8 String8::empty() { + return String8(); +} + +inline const char* String8::string() const +{ + return mString; +} + +inline size_t String8::length() const +{ + return SharedBuffer::sizeFromData(mString)-1; +} + +inline size_t String8::size() const +{ + return length(); +} + +inline bool String8::isEmpty() const +{ + return length() == 0; +} + +inline size_t String8::bytes() const +{ + return SharedBuffer::sizeFromData(mString)-1; +} + +inline const SharedBuffer* String8::sharedBuffer() const +{ + return SharedBuffer::bufferFromData(mString); +} + +inline bool String8::contains(const char* other) const +{ + return find(other) >= 0; +} + +inline String8& String8::operator=(const String8& other) +{ + setTo(other); + return *this; +} + +inline String8& String8::operator=(const char* other) +{ + setTo(other); + return *this; +} + +inline String8& String8::operator+=(const String8& other) +{ + append(other); + return *this; +} + +inline String8 String8::operator+(const String8& other) const +{ + String8 tmp(*this); + tmp += other; + return tmp; +} + +inline String8& String8::operator+=(const char* other) +{ + append(other); + return *this; +} + +inline String8 String8::operator+(const char* other) const +{ + String8 tmp(*this); + tmp += other; + return tmp; +} + +inline int String8::compare(const String8& other) const +{ + return strcmp(mString, other.mString); +} + +inline bool String8::operator<(const String8& other) const +{ + return strcmp(mString, other.mString) < 0; +} + +inline bool String8::operator<=(const String8& other) const +{ + return strcmp(mString, other.mString) <= 0; +} + +inline bool String8::operator==(const String8& other) const +{ + return strcmp(mString, other.mString) == 0; +} + +inline bool String8::operator!=(const String8& other) const +{ + return strcmp(mString, other.mString) != 0; +} + +inline bool String8::operator>=(const String8& other) const +{ + return strcmp(mString, other.mString) >= 0; +} + +inline bool String8::operator>(const String8& other) const +{ + return strcmp(mString, other.mString) > 0; +} + +inline bool String8::operator<(const char* other) const +{ + return strcmp(mString, other) < 0; +} + +inline bool String8::operator<=(const char* other) const +{ + return strcmp(mString, other) <= 0; +} + +inline bool String8::operator==(const char* other) const +{ + return strcmp(mString, other) == 0; +} + +inline bool String8::operator!=(const char* other) const +{ + return strcmp(mString, other) != 0; +} + +inline bool String8::operator>=(const char* other) const +{ + return strcmp(mString, other) >= 0; +} + +inline bool String8::operator>(const char* other) const +{ + return strcmp(mString, other) > 0; +} + +inline String8::operator const char*() const +{ + return mString; +} + +} // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_STRING8_H diff --git a/third_party/android_system_core/include/utils/StrongPointer.h b/third_party/android_system_core/include/utils/StrongPointer.h new file mode 100644 index 000000000..aba9577da --- /dev/null +++ b/third_party/android_system_core/include/utils/StrongPointer.h @@ -0,0 +1,211 @@ +/* + * Copyright (C) 2005 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_STRONG_POINTER_H +#define ANDROID_STRONG_POINTER_H + +#include + +#include +#include +#include + +// --------------------------------------------------------------------------- +namespace android { + +template class wp; + +// --------------------------------------------------------------------------- + +#define COMPARE(_op_) \ +inline bool operator _op_ (const sp& o) const { \ + return m_ptr _op_ o.m_ptr; \ +} \ +inline bool operator _op_ (const T* o) const { \ + return m_ptr _op_ o; \ +} \ +template \ +inline bool operator _op_ (const sp& o) const { \ + return m_ptr _op_ o.m_ptr; \ +} \ +template \ +inline bool operator _op_ (const U* o) const { \ + return m_ptr _op_ o; \ +} \ +inline bool operator _op_ (const wp& o) const { \ + return m_ptr _op_ o.m_ptr; \ +} \ +template \ +inline bool operator _op_ (const wp& o) const { \ + return m_ptr _op_ o.m_ptr; \ +} + +// --------------------------------------------------------------------------- + +template +class sp { +public: + inline sp() : m_ptr(0) { } + + sp(T* other); + sp(const sp& other); + template sp(U* other); + template sp(const sp& other); + + ~sp(); + + // Assignment + + sp& operator = (T* other); + sp& operator = (const sp& other); + + template sp& operator = (const sp& other); + template sp& operator = (U* other); + + //! Special optimization for use by ProcessState (and nobody else). + void force_set(T* other); + + // Reset + + void clear(); + + // Accessors + + inline T& operator* () const { return *m_ptr; } + inline T* operator-> () const { return m_ptr; } + inline T* get() const { return m_ptr; } + + // Operators + + COMPARE(==) + COMPARE(!=) + COMPARE(>) + COMPARE(<) + COMPARE(<=) + COMPARE(>=) + +private: + template friend class sp; + template friend class wp; + void set_pointer(T* ptr); + T* m_ptr; +}; + +#undef COMPARE + +// --------------------------------------------------------------------------- +// No user serviceable parts below here. + +template +sp::sp(T* other) + : m_ptr(other) { + if (other) + other->incStrong(this); +} + +template +sp::sp(const sp& other) + : m_ptr(other.m_ptr) { + if (m_ptr) + m_ptr->incStrong(this); +} + +template template +sp::sp(U* other) + : m_ptr(other) { + if (other) + ((T*) other)->incStrong(this); +} + +template template +sp::sp(const sp& other) + : m_ptr(other.m_ptr) { + if (m_ptr) + m_ptr->incStrong(this); +} + +template +sp::~sp() { + if (m_ptr) + m_ptr->decStrong(this); +} + +template +sp& sp::operator =(const sp& other) { + T* otherPtr(other.m_ptr); + if (otherPtr) + otherPtr->incStrong(this); + if (m_ptr) + m_ptr->decStrong(this); + m_ptr = otherPtr; + return *this; +} + +template +sp& sp::operator =(T* other) { + if (other) + other->incStrong(this); + if (m_ptr) + m_ptr->decStrong(this); + m_ptr = other; + return *this; +} + +template template +sp& sp::operator =(const sp& other) { + T* otherPtr(other.m_ptr); + if (otherPtr) + otherPtr->incStrong(this); + if (m_ptr) + m_ptr->decStrong(this); + m_ptr = otherPtr; + return *this; +} + +template template +sp& sp::operator =(U* other) { + if (other) + ((T*) other)->incStrong(this); + if (m_ptr) + m_ptr->decStrong(this); + m_ptr = other; + return *this; +} + +template +void sp::force_set(T* other) { + other->forceIncStrong(this); + m_ptr = other; +} + +template +void sp::clear() { + if (m_ptr) { + m_ptr->decStrong(this); + m_ptr = 0; + } +} + +template +void sp::set_pointer(T* ptr) { + m_ptr = ptr; +} + +}; // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_STRONG_POINTER_H diff --git a/third_party/android_system_core/include/utils/SystemClock.h b/third_party/android_system_core/include/utils/SystemClock.h new file mode 100644 index 000000000..01db34078 --- /dev/null +++ b/third_party/android_system_core/include/utils/SystemClock.h @@ -0,0 +1,32 @@ +/* + * 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_UTILS_SYSTEMCLOCK_H +#define ANDROID_UTILS_SYSTEMCLOCK_H + +#include +#include + +namespace android { + +int64_t uptimeMillis(); +int64_t elapsedRealtime(); +int64_t elapsedRealtimeNano(); + +}; // namespace android + +#endif // ANDROID_UTILS_SYSTEMCLOCK_H + diff --git a/third_party/android_system_core/include/utils/Thread.h b/third_party/android_system_core/include/utils/Thread.h new file mode 100644 index 000000000..28839fded --- /dev/null +++ b/third_party/android_system_core/include/utils/Thread.h @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2007 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 _LIBS_UTILS_THREAD_H +#define _LIBS_UTILS_THREAD_H + +#include +#include +#include + +#if !defined(_WIN32) +# include +#endif + +#include +#include +#include +#include +#include +#include + +// --------------------------------------------------------------------------- +namespace android { +// --------------------------------------------------------------------------- + +class Thread : virtual public RefBase +{ +public: + // Create a Thread object, but doesn't create or start the associated + // thread. See the run() method. + Thread(bool canCallJava = true); + virtual ~Thread(); + + // Start the thread in threadLoop() which needs to be implemented. + virtual status_t run( const char* name = 0, + int32_t priority = PRIORITY_DEFAULT, + size_t stack = 0); + + // Ask this object's thread to exit. This function is asynchronous, when the + // function returns the thread might still be running. Of course, this + // function can be called from a different thread. + virtual void requestExit(); + + // Good place to do one-time initializations + virtual status_t readyToRun(); + + // Call requestExit() and wait until this object's thread exits. + // BE VERY CAREFUL of deadlocks. In particular, it would be silly to call + // this function from this object's thread. Will return WOULD_BLOCK in + // that case. + status_t requestExitAndWait(); + + // Wait until this object's thread exits. Returns immediately if not yet running. + // Do not call from this object's thread; will return WOULD_BLOCK in that case. + status_t join(); + + // Indicates whether this thread is running or not. + bool isRunning() const; + +#ifdef HAVE_ANDROID_OS + // Return the thread's kernel ID, same as the thread itself calling gettid(), + // or -1 if the thread is not running. + pid_t getTid() const; +#endif + +protected: + // exitPending() returns true if requestExit() has been called. + bool exitPending() const; + +private: + // Derived class must implement threadLoop(). The thread starts its life + // here. There are two ways of using the Thread object: + // 1) loop: if threadLoop() returns true, it will be called again if + // requestExit() wasn't called. + // 2) once: if threadLoop() returns false, the thread will exit upon return. + virtual bool threadLoop() = 0; + +private: + Thread& operator=(const Thread&); + static int _threadLoop(void* user); + const bool mCanCallJava; + // always hold mLock when reading or writing + thread_id_t mThread; + mutable Mutex mLock; + Condition mThreadExitedCondition; + status_t mStatus; + // note that all accesses of mExitPending and mRunning need to hold mLock + volatile bool mExitPending; + volatile bool mRunning; + sp mHoldSelf; +#ifdef HAVE_ANDROID_OS + // legacy for debugging, not used by getTid() as it is set by the child thread + // and so is not initialized until the child reaches that point + pid_t mTid; +#endif +}; + + +}; // namespace android + +// --------------------------------------------------------------------------- +#endif // _LIBS_UTILS_THREAD_H +// --------------------------------------------------------------------------- diff --git a/third_party/android_system_core/include/utils/ThreadDefs.h b/third_party/android_system_core/include/utils/ThreadDefs.h new file mode 100644 index 000000000..9711c1379 --- /dev/null +++ b/third_party/android_system_core/include/utils/ThreadDefs.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2007 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 _LIBS_UTILS_THREAD_DEFS_H +#define _LIBS_UTILS_THREAD_DEFS_H + +#include +#include +#include +#include + +// --------------------------------------------------------------------------- +// C API + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void* android_thread_id_t; + +typedef int (*android_thread_func_t)(void*); + +#ifdef __cplusplus +} // extern "C" +#endif + +// --------------------------------------------------------------------------- +// C++ API +#ifdef __cplusplus +namespace android { +// --------------------------------------------------------------------------- + +typedef android_thread_id_t thread_id_t; +typedef android_thread_func_t thread_func_t; + +enum { + PRIORITY_LOWEST = ANDROID_PRIORITY_LOWEST, + PRIORITY_BACKGROUND = ANDROID_PRIORITY_BACKGROUND, + PRIORITY_NORMAL = ANDROID_PRIORITY_NORMAL, + PRIORITY_FOREGROUND = ANDROID_PRIORITY_FOREGROUND, + PRIORITY_DISPLAY = ANDROID_PRIORITY_DISPLAY, + PRIORITY_URGENT_DISPLAY = ANDROID_PRIORITY_URGENT_DISPLAY, + PRIORITY_AUDIO = ANDROID_PRIORITY_AUDIO, + PRIORITY_URGENT_AUDIO = ANDROID_PRIORITY_URGENT_AUDIO, + PRIORITY_HIGHEST = ANDROID_PRIORITY_HIGHEST, + PRIORITY_DEFAULT = ANDROID_PRIORITY_DEFAULT, + PRIORITY_MORE_FAVORABLE = ANDROID_PRIORITY_MORE_FAVORABLE, + PRIORITY_LESS_FAVORABLE = ANDROID_PRIORITY_LESS_FAVORABLE, +}; + +// --------------------------------------------------------------------------- +}; // namespace android +#endif // __cplusplus +// --------------------------------------------------------------------------- + + +#endif // _LIBS_UTILS_THREAD_DEFS_H diff --git a/third_party/android_system_core/include/utils/Timers.h b/third_party/android_system_core/include/utils/Timers.h new file mode 100644 index 000000000..54ec47489 --- /dev/null +++ b/third_party/android_system_core/include/utils/Timers.h @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2005 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. + */ + +// +// Timer functions. +// +#ifndef _LIBS_UTILS_TIMERS_H +#define _LIBS_UTILS_TIMERS_H + +#include +#include +#include + +#include + +// ------------------------------------------------------------------ +// C API + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int64_t nsecs_t; // nano-seconds + +static CONSTEXPR inline nsecs_t seconds_to_nanoseconds(nsecs_t secs) +{ + return secs*1000000000; +} + +static CONSTEXPR inline nsecs_t milliseconds_to_nanoseconds(nsecs_t secs) +{ + return secs*1000000; +} + +static CONSTEXPR inline nsecs_t microseconds_to_nanoseconds(nsecs_t secs) +{ + return secs*1000; +} + +static CONSTEXPR inline nsecs_t nanoseconds_to_seconds(nsecs_t secs) +{ + return secs/1000000000; +} + +static CONSTEXPR inline nsecs_t nanoseconds_to_milliseconds(nsecs_t secs) +{ + return secs/1000000; +} + +static CONSTEXPR inline nsecs_t nanoseconds_to_microseconds(nsecs_t secs) +{ + return secs/1000; +} + +static CONSTEXPR inline nsecs_t s2ns(nsecs_t v) {return seconds_to_nanoseconds(v);} +static CONSTEXPR inline nsecs_t ms2ns(nsecs_t v) {return milliseconds_to_nanoseconds(v);} +static CONSTEXPR inline nsecs_t us2ns(nsecs_t v) {return microseconds_to_nanoseconds(v);} +static CONSTEXPR inline nsecs_t ns2s(nsecs_t v) {return nanoseconds_to_seconds(v);} +static CONSTEXPR inline nsecs_t ns2ms(nsecs_t v) {return nanoseconds_to_milliseconds(v);} +static CONSTEXPR inline nsecs_t ns2us(nsecs_t v) {return nanoseconds_to_microseconds(v);} + +static CONSTEXPR inline nsecs_t seconds(nsecs_t v) { return s2ns(v); } +static CONSTEXPR inline nsecs_t milliseconds(nsecs_t v) { return ms2ns(v); } +static CONSTEXPR inline nsecs_t microseconds(nsecs_t v) { return us2ns(v); } + +enum { + SYSTEM_TIME_REALTIME = 0, // system-wide realtime clock + SYSTEM_TIME_MONOTONIC = 1, // monotonic time since unspecified starting point + SYSTEM_TIME_PROCESS = 2, // high-resolution per-process clock + SYSTEM_TIME_THREAD = 3, // high-resolution per-thread clock + SYSTEM_TIME_BOOTTIME = 4 // same as SYSTEM_TIME_MONOTONIC, but including CPU suspend time +}; + +// return the system-time according to the specified clock +#ifdef __cplusplus +nsecs_t systemTime(int clock = SYSTEM_TIME_MONOTONIC); +#else +nsecs_t systemTime(int clock); +#endif // def __cplusplus + +/** + * Returns the number of milliseconds to wait between the reference time and the timeout time. + * If the timeout is in the past relative to the reference time, returns 0. + * If the timeout is more than INT_MAX milliseconds in the future relative to the reference time, + * such as when timeoutTime == LLONG_MAX, returns -1 to indicate an infinite timeout delay. + * Otherwise, returns the difference between the reference time and timeout time + * rounded up to the next millisecond. + */ +int toMillisecondTimeoutDelay(nsecs_t referenceTime, nsecs_t timeoutTime); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _LIBS_UTILS_TIMERS_H diff --git a/third_party/android_system_core/include/utils/Tokenizer.h b/third_party/android_system_core/include/utils/Tokenizer.h new file mode 100644 index 000000000..bb25f374c --- /dev/null +++ b/third_party/android_system_core/include/utils/Tokenizer.h @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2010 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 _UTILS_TOKENIZER_H +#define _UTILS_TOKENIZER_H + +#include +#include +#include +#include + +namespace android { + +/** + * A simple tokenizer for loading and parsing ASCII text files line by line. + */ +class Tokenizer { + Tokenizer(const String8& filename, FileMap* fileMap, char* buffer, + bool ownBuffer, size_t length); + +public: + ~Tokenizer(); + + /** + * Opens a file and maps it into memory. + * + * Returns NO_ERROR and a tokenizer for the file, if successful. + * Otherwise returns an error and sets outTokenizer to NULL. + */ + static status_t open(const String8& filename, Tokenizer** outTokenizer); + + /** + * Prepares to tokenize the contents of a string. + * + * Returns NO_ERROR and a tokenizer for the string, if successful. + * Otherwise returns an error and sets outTokenizer to NULL. + */ + static status_t fromContents(const String8& filename, + const char* contents, Tokenizer** outTokenizer); + + /** + * Returns true if at the end of the file. + */ + inline bool isEof() const { return mCurrent == getEnd(); } + + /** + * Returns true if at the end of the line or end of the file. + */ + inline bool isEol() const { return isEof() || *mCurrent == '\n'; } + + /** + * Gets the name of the file. + */ + inline String8 getFilename() const { return mFilename; } + + /** + * Gets a 1-based line number index for the current position. + */ + inline int32_t getLineNumber() const { return mLineNumber; } + + /** + * Formats a location string consisting of the filename and current line number. + * Returns a string like "MyFile.txt:33". + */ + String8 getLocation() const; + + /** + * Gets the character at the current position. + * Returns null at end of file. + */ + inline char peekChar() const { return isEof() ? '\0' : *mCurrent; } + + /** + * Gets the remainder of the current line as a string, excluding the newline character. + */ + String8 peekRemainderOfLine() const; + + /** + * Gets the character at the current position and advances past it. + * Returns null at end of file. + */ + inline char nextChar() { return isEof() ? '\0' : *(mCurrent++); } + + /** + * Gets the next token on this line stopping at the specified delimiters + * or the end of the line whichever comes first and advances past it. + * Also stops at embedded nulls. + * Returns the token or an empty string if the current character is a delimiter + * or is at the end of the line. + */ + String8 nextToken(const char* delimiters); + + /** + * Advances to the next line. + * Does nothing if already at the end of the file. + */ + void nextLine(); + + /** + * Skips over the specified delimiters in the line. + * Also skips embedded nulls. + */ + void skipDelimiters(const char* delimiters); + +private: + Tokenizer(const Tokenizer& other); // not copyable + + String8 mFilename; + FileMap* mFileMap; + char* mBuffer; + bool mOwnBuffer; + size_t mLength; + + const char* mCurrent; + int32_t mLineNumber; + + inline const char* getEnd() const { return mBuffer + mLength; } + +}; + +} // namespace android + +#endif // _UTILS_TOKENIZER_H diff --git a/third_party/android_system_core/include/utils/Trace.h b/third_party/android_system_core/include/utils/Trace.h new file mode 100644 index 000000000..6ee343d79 --- /dev/null +++ b/third_party/android_system_core/include/utils/Trace.h @@ -0,0 +1,69 @@ +/* + * 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_TRACE_H +#define ANDROID_TRACE_H + +#ifdef HAVE_ANDROID_OS + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +// See for more ATRACE_* macros. + +// ATRACE_NAME traces the beginning and end of the current scope. To trace +// the correct start and end times this macro should be declared first in the +// scope body. +#define ATRACE_NAME(name) android::ScopedTrace ___tracer(ATRACE_TAG, name) +// ATRACE_CALL is an ATRACE_NAME that uses the current function name. +#define ATRACE_CALL() ATRACE_NAME(__FUNCTION__) + +namespace android { + +class ScopedTrace { +public: +inline ScopedTrace(uint64_t tag, const char* name) + : mTag(tag) { + atrace_begin(mTag,name); +} + +inline ~ScopedTrace() { + atrace_end(mTag); +} + +private: + uint64_t mTag; +}; + +}; // namespace android + +#else // HAVE_ANDROID_OS + +#define ATRACE_NAME(...) +#define ATRACE_CALL() + +#endif // HAVE_ANDROID_OS + +#endif // ANDROID_TRACE_H diff --git a/third_party/android_system_core/include/utils/TypeHelpers.h b/third_party/android_system_core/include/utils/TypeHelpers.h new file mode 100644 index 000000000..13c908159 --- /dev/null +++ b/third_party/android_system_core/include/utils/TypeHelpers.h @@ -0,0 +1,302 @@ +/* + * Copyright (C) 2005 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_TYPE_HELPERS_H +#define ANDROID_TYPE_HELPERS_H + +#include +#include +#include +#include + +// --------------------------------------------------------------------------- + +namespace android { + +/* + * Types traits + */ + +template struct trait_trivial_ctor { enum { value = false }; }; +template struct trait_trivial_dtor { enum { value = false }; }; +template struct trait_trivial_copy { enum { value = false }; }; +template struct trait_trivial_move { enum { value = false }; }; +template struct trait_pointer { enum { value = false }; }; +template struct trait_pointer { enum { value = true }; }; + +template +struct traits { + enum { + // whether this type is a pointer + is_pointer = trait_pointer::value, + // whether this type's constructor is a no-op + has_trivial_ctor = is_pointer || trait_trivial_ctor::value, + // whether this type's destructor is a no-op + has_trivial_dtor = is_pointer || trait_trivial_dtor::value, + // whether this type type can be copy-constructed with memcpy + has_trivial_copy = is_pointer || trait_trivial_copy::value, + // whether this type can be moved with memmove + has_trivial_move = is_pointer || trait_trivial_move::value + }; +}; + +template +struct aggregate_traits { + enum { + is_pointer = false, + has_trivial_ctor = + traits::has_trivial_ctor && traits::has_trivial_ctor, + has_trivial_dtor = + traits::has_trivial_dtor && traits::has_trivial_dtor, + has_trivial_copy = + traits::has_trivial_copy && traits::has_trivial_copy, + has_trivial_move = + traits::has_trivial_move && traits::has_trivial_move + }; +}; + +#define ANDROID_TRIVIAL_CTOR_TRAIT( T ) \ + template<> struct trait_trivial_ctor< T > { enum { value = true }; }; + +#define ANDROID_TRIVIAL_DTOR_TRAIT( T ) \ + template<> struct trait_trivial_dtor< T > { enum { value = true }; }; + +#define ANDROID_TRIVIAL_COPY_TRAIT( T ) \ + template<> struct trait_trivial_copy< T > { enum { value = true }; }; + +#define ANDROID_TRIVIAL_MOVE_TRAIT( T ) \ + template<> struct trait_trivial_move< T > { enum { value = true }; }; + +#define ANDROID_BASIC_TYPES_TRAITS( T ) \ + ANDROID_TRIVIAL_CTOR_TRAIT( T ) \ + ANDROID_TRIVIAL_DTOR_TRAIT( T ) \ + ANDROID_TRIVIAL_COPY_TRAIT( T ) \ + ANDROID_TRIVIAL_MOVE_TRAIT( T ) + +// --------------------------------------------------------------------------- + +/* + * basic types traits + */ + +ANDROID_BASIC_TYPES_TRAITS( void ) +ANDROID_BASIC_TYPES_TRAITS( bool ) +ANDROID_BASIC_TYPES_TRAITS( char ) +ANDROID_BASIC_TYPES_TRAITS( unsigned char ) +ANDROID_BASIC_TYPES_TRAITS( short ) +ANDROID_BASIC_TYPES_TRAITS( unsigned short ) +ANDROID_BASIC_TYPES_TRAITS( int ) +ANDROID_BASIC_TYPES_TRAITS( unsigned int ) +ANDROID_BASIC_TYPES_TRAITS( long ) +ANDROID_BASIC_TYPES_TRAITS( unsigned long ) +ANDROID_BASIC_TYPES_TRAITS( long long ) +ANDROID_BASIC_TYPES_TRAITS( unsigned long long ) +ANDROID_BASIC_TYPES_TRAITS( float ) +ANDROID_BASIC_TYPES_TRAITS( double ) + +// --------------------------------------------------------------------------- + + +/* + * compare and order types + */ + +template inline +int strictly_order_type(const TYPE& lhs, const TYPE& rhs) { + return (lhs < rhs) ? 1 : 0; +} + +template inline +int compare_type(const TYPE& lhs, const TYPE& rhs) { + return strictly_order_type(rhs, lhs) - strictly_order_type(lhs, rhs); +} + +/* + * create, destroy, copy and move types... + */ + +template inline +void construct_type(TYPE* p, size_t n) { + if (!traits::has_trivial_ctor) { + while (n--) { + new(p++) TYPE; + } + } +} + +template inline +void destroy_type(TYPE* p, size_t n) { + if (!traits::has_trivial_dtor) { + while (n--) { + p->~TYPE(); + p++; + } + } +} + +template inline +void copy_type(TYPE* d, const TYPE* s, size_t n) { + if (!traits::has_trivial_copy) { + while (n--) { + new(d) TYPE(*s); + d++, s++; + } + } else { + memcpy(d,s,n*sizeof(TYPE)); + } +} + +template inline +void splat_type(TYPE* where, const TYPE* what, size_t n) { + if (!traits::has_trivial_copy) { + while (n--) { + new(where) TYPE(*what); + where++; + } + } else { + while (n--) { + *where++ = *what; + } + } +} + +template inline +void move_forward_type(TYPE* d, const TYPE* s, size_t n = 1) { + if ((traits::has_trivial_dtor && traits::has_trivial_copy) + || traits::has_trivial_move) + { + memmove(d,s,n*sizeof(TYPE)); + } else { + d += n; + s += n; + while (n--) { + --d, --s; + if (!traits::has_trivial_copy) { + new(d) TYPE(*s); + } else { + *d = *s; + } + if (!traits::has_trivial_dtor) { + s->~TYPE(); + } + } + } +} + +template inline +void move_backward_type(TYPE* d, const TYPE* s, size_t n = 1) { + if ((traits::has_trivial_dtor && traits::has_trivial_copy) + || traits::has_trivial_move) + { + memmove(d,s,n*sizeof(TYPE)); + } else { + while (n--) { + if (!traits::has_trivial_copy) { + new(d) TYPE(*s); + } else { + *d = *s; + } + if (!traits::has_trivial_dtor) { + s->~TYPE(); + } + d++, s++; + } + } +} + +// --------------------------------------------------------------------------- + +/* + * a key/value pair + */ + +template +struct key_value_pair_t { + typedef KEY key_t; + typedef VALUE value_t; + + KEY key; + VALUE value; + key_value_pair_t() { } + key_value_pair_t(const key_value_pair_t& o) : key(o.key), value(o.value) { } + key_value_pair_t(const KEY& k, const VALUE& v) : key(k), value(v) { } + key_value_pair_t(const KEY& k) : key(k) { } + inline bool operator < (const key_value_pair_t& o) const { + return strictly_order_type(key, o.key); + } + inline const KEY& getKey() const { + return key; + } + inline const VALUE& getValue() const { + return value; + } +}; + +template +struct trait_trivial_ctor< key_value_pair_t > +{ enum { value = aggregate_traits::has_trivial_ctor }; }; +template +struct trait_trivial_dtor< key_value_pair_t > +{ enum { value = aggregate_traits::has_trivial_dtor }; }; +template +struct trait_trivial_copy< key_value_pair_t > +{ enum { value = aggregate_traits::has_trivial_copy }; }; +template +struct trait_trivial_move< key_value_pair_t > +{ enum { value = aggregate_traits::has_trivial_move }; }; + +// --------------------------------------------------------------------------- + +/* + * Hash codes. + */ +typedef uint32_t hash_t; + +template +hash_t hash_type(const TKey& key); + +/* Built-in hash code specializations. + * Assumes pointers are 32bit. */ +#define ANDROID_INT32_HASH(T) \ + template <> inline hash_t hash_type(const T& value) { return hash_t(value); } +#define ANDROID_INT64_HASH(T) \ + template <> inline hash_t hash_type(const T& value) { \ + return hash_t((value >> 32) ^ value); } +#define ANDROID_REINTERPRET_HASH(T, R) \ + template <> inline hash_t hash_type(const T& value) { \ + return hash_type(*reinterpret_cast(&value)); } + +ANDROID_INT32_HASH(bool) +ANDROID_INT32_HASH(int8_t) +ANDROID_INT32_HASH(uint8_t) +ANDROID_INT32_HASH(int16_t) +ANDROID_INT32_HASH(uint16_t) +ANDROID_INT32_HASH(int32_t) +ANDROID_INT32_HASH(uint32_t) +ANDROID_INT64_HASH(int64_t) +ANDROID_INT64_HASH(uint64_t) +ANDROID_REINTERPRET_HASH(float, uint32_t) +ANDROID_REINTERPRET_HASH(double, uint64_t) + +template inline hash_t hash_type(T* const & value) { + return hash_type(uintptr_t(value)); +} + +}; // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_TYPE_HELPERS_H diff --git a/third_party/android_system_core/include/utils/Unicode.h b/third_party/android_system_core/include/utils/Unicode.h new file mode 100644 index 000000000..4e17cc3d9 --- /dev/null +++ b/third_party/android_system_core/include/utils/Unicode.h @@ -0,0 +1,172 @@ +/* + * Copyright (C) 2005 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_UNICODE_H +#define ANDROID_UNICODE_H + +#include +#include + +extern "C" { + +// Standard string functions on char16_t strings. +int strcmp16(const char16_t *, const char16_t *); +int strncmp16(const char16_t *s1, const char16_t *s2, size_t n); +size_t strlen16(const char16_t *); +size_t strnlen16(const char16_t *, size_t); +char16_t *strcpy16(char16_t *, const char16_t *); +char16_t *strncpy16(char16_t *, const char16_t *, size_t); + +// Version of comparison that supports embedded nulls. +// This is different than strncmp() because we don't stop +// at a nul character and consider the strings to be different +// if the lengths are different (thus we need to supply the +// lengths of both strings). This can also be used when +// your string is not nul-terminated as it will have the +// equivalent result as strcmp16 (unlike strncmp16). +int strzcmp16(const char16_t *s1, size_t n1, const char16_t *s2, size_t n2); + +// Version of strzcmp16 for comparing strings in different endianness. +int strzcmp16_h_n(const char16_t *s1H, size_t n1, const char16_t *s2N, size_t n2); + +// Standard string functions on char32_t strings. +size_t strlen32(const char32_t *); +size_t strnlen32(const char32_t *, size_t); + +/** + * Measure the length of a UTF-32 string in UTF-8. If the string is invalid + * such as containing a surrogate character, -1 will be returned. + */ +ssize_t utf32_to_utf8_length(const char32_t *src, size_t src_len); + +/** + * Stores a UTF-8 string converted from "src" in "dst", if "dst_length" is not + * large enough to store the string, the part of the "src" string is stored + * into "dst" as much as possible. See the examples for more detail. + * Returns the size actually used for storing the string. + * dst" is not null-terminated when dst_len is fully used (like strncpy). + * + * Example 1 + * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) + * "src_len" == 2 + * "dst_len" >= 7 + * -> + * Returned value == 6 + * "dst" becomes \xE3\x81\x82\xE3\x81\x84\0 + * (note that "dst" is null-terminated) + * + * Example 2 + * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) + * "src_len" == 2 + * "dst_len" == 5 + * -> + * Returned value == 3 + * "dst" becomes \xE3\x81\x82\0 + * (note that "dst" is null-terminated, but \u3044 is not stored in "dst" + * since "dst" does not have enough size to store the character) + * + * Example 3 + * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) + * "src_len" == 2 + * "dst_len" == 6 + * -> + * Returned value == 6 + * "dst" becomes \xE3\x81\x82\xE3\x81\x84 + * (note that "dst" is NOT null-terminated, like strncpy) + */ +void utf32_to_utf8(const char32_t* src, size_t src_len, char* dst, size_t dst_len); + +/** + * Returns the unicode value at "index". + * Returns -1 when the index is invalid (equals to or more than "src_len"). + * If returned value is positive, it is able to be converted to char32_t, which + * is unsigned. Then, if "next_index" is not NULL, the next index to be used is + * stored in "next_index". "next_index" can be NULL. + */ +int32_t utf32_from_utf8_at(const char *src, size_t src_len, size_t index, size_t *next_index); + + +/** + * Returns the UTF-8 length of UTF-16 string "src". + */ +ssize_t utf16_to_utf8_length(const char16_t *src, size_t src_len); + +/** + * Converts a UTF-16 string to UTF-8. The destination buffer must be large + * enough to fit the UTF-16 as measured by utf16_to_utf8_length with an added + * NULL terminator. + */ +void utf16_to_utf8(const char16_t* src, size_t src_len, char* dst, size_t dst_len); + +/** + * Returns the length of "src" when "src" is valid UTF-8 string. + * Returns 0 if src is NULL or 0-length string. Returns -1 when the source + * is an invalid string. + * + * This function should be used to determine whether "src" is valid UTF-8 + * characters with valid unicode codepoints. "src" must be null-terminated. + * + * If you are going to use other utf8_to_... functions defined in this header + * with string which may not be valid UTF-8 with valid codepoint (form 0 to + * 0x10FFFF), you should use this function before calling others, since the + * other functions do not check whether the string is valid UTF-8 or not. + * + * If you do not care whether "src" is valid UTF-8 or not, you should use + * strlen() as usual, which should be much faster. + */ +ssize_t utf8_length(const char *src); + +/** + * Measure the length of a UTF-32 string. + */ +size_t utf8_to_utf32_length(const char *src, size_t src_len); + +/** + * Stores a UTF-32 string converted from "src" in "dst". "dst" must be large + * enough to store the entire converted string as measured by + * utf8_to_utf32_length plus space for a NULL terminator. + */ +void utf8_to_utf32(const char* src, size_t src_len, char32_t* dst); + +/** + * Returns the UTF-16 length of UTF-8 string "src". + */ +ssize_t utf8_to_utf16_length(const uint8_t* src, size_t srcLen); + +/** + * Convert UTF-8 to UTF-16 including surrogate pairs. + * Returns a pointer to the end of the string (where a null terminator might go + * if you wanted to add one). + */ +char16_t* utf8_to_utf16_no_null_terminator(const uint8_t* src, size_t srcLen, char16_t* dst); + +/** + * Convert UTF-8 to UTF-16 including surrogate pairs. The destination buffer + * must be large enough to hold the result as measured by utf8_to_utf16_length + * plus an added NULL terminator. + */ +void utf8_to_utf16(const uint8_t* src, size_t srcLen, char16_t* dst); + +/** + * Like utf8_to_utf16_no_null_terminator, but you can supply a maximum length of the + * decoded string. The decoded string will fill up to that length; if it is longer + * the returned pointer will be to the character after dstLen. + */ +char16_t* utf8_to_utf16_n(const uint8_t* src, size_t srcLen, char16_t* dst, size_t dstLen); + +} + +#endif diff --git a/third_party/android_system_core/include/utils/Vector.h b/third_party/android_system_core/include/utils/Vector.h new file mode 100644 index 000000000..ed7b72521 --- /dev/null +++ b/third_party/android_system_core/include/utils/Vector.h @@ -0,0 +1,423 @@ +/* + * Copyright (C) 2005 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_VECTOR_H +#define ANDROID_VECTOR_H + +#include +#include +#include + +#include + +#include +#include + +// --------------------------------------------------------------------------- + +namespace android { + +template +class SortedVector; + +/*! + * The main templated vector class ensuring type safety + * while making use of VectorImpl. + * This is the class users want to use. + */ + +template +class Vector : private VectorImpl +{ +public: + typedef TYPE value_type; + + /*! + * Constructors and destructors + */ + + Vector(); + Vector(const Vector& rhs); + explicit Vector(const SortedVector& rhs); + virtual ~Vector(); + + /*! copy operator */ + const Vector& operator = (const Vector& rhs) const; + Vector& operator = (const Vector& rhs); + + const Vector& operator = (const SortedVector& rhs) const; + Vector& operator = (const SortedVector& rhs); + + /* + * empty the vector + */ + + inline void clear() { VectorImpl::clear(); } + + /*! + * vector stats + */ + + //! returns number of items in the vector + inline size_t size() const { return VectorImpl::size(); } + //! returns whether or not the vector is empty + inline bool isEmpty() const { return VectorImpl::isEmpty(); } + //! returns how many items can be stored without reallocating the backing store + inline size_t capacity() const { return VectorImpl::capacity(); } + //! sets the capacity. capacity can never be reduced less than size() + inline ssize_t setCapacity(size_t size) { return VectorImpl::setCapacity(size); } + + /*! + * set the size of the vector. items are appended with the default + * constructor, or removed from the end as needed. + */ + inline ssize_t resize(size_t size) { return VectorImpl::resize(size); } + + /*! + * C-style array access + */ + + //! read-only C-style access + inline const TYPE* array() const; + //! read-write C-style access + TYPE* editArray(); + + /*! + * accessors + */ + + //! read-only access to an item at a given index + inline const TYPE& operator [] (size_t index) const; + //! alternate name for operator [] + inline const TYPE& itemAt(size_t index) const; + //! stack-usage of the vector. returns the top of the stack (last element) + const TYPE& top() const; + + /*! + * modifying the array + */ + + //! copy-on write support, grants write access to an item + TYPE& editItemAt(size_t index); + //! grants right access to the top of the stack (last element) + TYPE& editTop(); + + /*! + * append/insert another vector + */ + + //! insert another vector at a given index + ssize_t insertVectorAt(const Vector& vector, size_t index); + + //! append another vector at the end of this one + ssize_t appendVector(const Vector& vector); + + + //! insert an array at a given index + ssize_t insertArrayAt(const TYPE* array, size_t index, size_t length); + + //! append an array at the end of this vector + ssize_t appendArray(const TYPE* array, size_t length); + + /*! + * add/insert/replace items + */ + + //! insert one or several items initialized with their default constructor + inline ssize_t insertAt(size_t index, size_t numItems = 1); + //! insert one or several items initialized from a prototype item + ssize_t insertAt(const TYPE& prototype_item, size_t index, size_t numItems = 1); + //! pop the top of the stack (removes the last element). No-op if the stack's empty + inline void pop(); + //! pushes an item initialized with its default constructor + inline void push(); + //! pushes an item on the top of the stack + void push(const TYPE& item); + //! same as push() but returns the index the item was added at (or an error) + inline ssize_t add(); + //! same as push() but returns the index the item was added at (or an error) + ssize_t add(const TYPE& item); + //! replace an item with a new one initialized with its default constructor + inline ssize_t replaceAt(size_t index); + //! replace an item with a new one + ssize_t replaceAt(const TYPE& item, size_t index); + + /*! + * remove items + */ + + //! remove several items + inline ssize_t removeItemsAt(size_t index, size_t count = 1); + //! remove one item + inline ssize_t removeAt(size_t index) { return removeItemsAt(index); } + + /*! + * sort (stable) the array + */ + + typedef int (*compar_t)(const TYPE* lhs, const TYPE* rhs); + typedef int (*compar_r_t)(const TYPE* lhs, const TYPE* rhs, void* state); + + inline status_t sort(compar_t cmp); + inline status_t sort(compar_r_t cmp, void* state); + + // for debugging only + inline size_t getItemSize() const { return itemSize(); } + + + /* + * these inlines add some level of compatibility with STL. eventually + * we should probably turn things around. + */ + typedef TYPE* iterator; + typedef TYPE const* const_iterator; + + inline iterator begin() { return editArray(); } + inline iterator end() { return editArray() + size(); } + inline const_iterator begin() const { return array(); } + inline const_iterator end() const { return array() + size(); } + inline void reserve(size_t n) { setCapacity(n); } + inline bool empty() const{ return isEmpty(); } + inline void push_back(const TYPE& item) { insertAt(item, size(), 1); } + inline void push_front(const TYPE& item) { insertAt(item, 0, 1); } + inline iterator erase(iterator pos) { + ssize_t index = removeItemsAt(pos-array()); + return begin() + index; + } + +protected: + virtual void do_construct(void* storage, size_t num) const; + virtual void do_destroy(void* storage, size_t num) const; + virtual void do_copy(void* dest, const void* from, size_t num) const; + virtual void do_splat(void* dest, const void* item, size_t num) const; + virtual void do_move_forward(void* dest, const void* from, size_t num) const; + virtual void do_move_backward(void* dest, const void* from, size_t num) const; +}; + +// Vector can be trivially moved using memcpy() because moving does not +// require any change to the underlying SharedBuffer contents or reference count. +template struct trait_trivial_move > { enum { value = true }; }; + +// --------------------------------------------------------------------------- +// No user serviceable parts from here... +// --------------------------------------------------------------------------- + +template inline +Vector::Vector() + : VectorImpl(sizeof(TYPE), + ((traits::has_trivial_ctor ? HAS_TRIVIAL_CTOR : 0) + |(traits::has_trivial_dtor ? HAS_TRIVIAL_DTOR : 0) + |(traits::has_trivial_copy ? HAS_TRIVIAL_COPY : 0)) + ) +{ +} + +template inline +Vector::Vector(const Vector& rhs) + : VectorImpl(rhs) { +} + +template inline +Vector::Vector(const SortedVector& rhs) + : VectorImpl(static_cast(rhs)) { +} + +template inline +Vector::~Vector() { + finish_vector(); +} + +template inline +Vector& Vector::operator = (const Vector& rhs) { + VectorImpl::operator = (rhs); + return *this; +} + +template inline +const Vector& Vector::operator = (const Vector& rhs) const { + VectorImpl::operator = (static_cast(rhs)); + return *this; +} + +template inline +Vector& Vector::operator = (const SortedVector& rhs) { + VectorImpl::operator = (static_cast(rhs)); + return *this; +} + +template inline +const Vector& Vector::operator = (const SortedVector& rhs) const { + VectorImpl::operator = (rhs); + return *this; +} + +template inline +const TYPE* Vector::array() const { + return static_cast(arrayImpl()); +} + +template inline +TYPE* Vector::editArray() { + return static_cast(editArrayImpl()); +} + + +template inline +const TYPE& Vector::operator[](size_t index) const { + LOG_FATAL_IF(index>=size(), + "%s: index=%u out of range (%u)", __PRETTY_FUNCTION__, + int(index), int(size())); + return *(array() + index); +} + +template inline +const TYPE& Vector::itemAt(size_t index) const { + return operator[](index); +} + +template inline +const TYPE& Vector::top() const { + return *(array() + size() - 1); +} + +template inline +TYPE& Vector::editItemAt(size_t index) { + return *( static_cast(editItemLocation(index)) ); +} + +template inline +TYPE& Vector::editTop() { + return *( static_cast(editItemLocation(size()-1)) ); +} + +template inline +ssize_t Vector::insertVectorAt(const Vector& vector, size_t index) { + return VectorImpl::insertVectorAt(reinterpret_cast(vector), index); +} + +template inline +ssize_t Vector::appendVector(const Vector& vector) { + return VectorImpl::appendVector(reinterpret_cast(vector)); +} + +template inline +ssize_t Vector::insertArrayAt(const TYPE* array, size_t index, size_t length) { + return VectorImpl::insertArrayAt(array, index, length); +} + +template inline +ssize_t Vector::appendArray(const TYPE* array, size_t length) { + return VectorImpl::appendArray(array, length); +} + +template inline +ssize_t Vector::insertAt(const TYPE& item, size_t index, size_t numItems) { + return VectorImpl::insertAt(&item, index, numItems); +} + +template inline +void Vector::push(const TYPE& item) { + return VectorImpl::push(&item); +} + +template inline +ssize_t Vector::add(const TYPE& item) { + return VectorImpl::add(&item); +} + +template inline +ssize_t Vector::replaceAt(const TYPE& item, size_t index) { + return VectorImpl::replaceAt(&item, index); +} + +template inline +ssize_t Vector::insertAt(size_t index, size_t numItems) { + return VectorImpl::insertAt(index, numItems); +} + +template inline +void Vector::pop() { + VectorImpl::pop(); +} + +template inline +void Vector::push() { + VectorImpl::push(); +} + +template inline +ssize_t Vector::add() { + return VectorImpl::add(); +} + +template inline +ssize_t Vector::replaceAt(size_t index) { + return VectorImpl::replaceAt(index); +} + +template inline +ssize_t Vector::removeItemsAt(size_t index, size_t count) { + return VectorImpl::removeItemsAt(index, count); +} + +template inline +status_t Vector::sort(Vector::compar_t cmp) { + return VectorImpl::sort((VectorImpl::compar_t)cmp); +} + +template inline +status_t Vector::sort(Vector::compar_r_t cmp, void* state) { + return VectorImpl::sort((VectorImpl::compar_r_t)cmp, state); +} + +// --------------------------------------------------------------------------- + +template +void Vector::do_construct(void* storage, size_t num) const { + construct_type( reinterpret_cast(storage), num ); +} + +template +void Vector::do_destroy(void* storage, size_t num) const { + destroy_type( reinterpret_cast(storage), num ); +} + +template +void Vector::do_copy(void* dest, const void* from, size_t num) const { + copy_type( reinterpret_cast(dest), reinterpret_cast(from), num ); +} + +template +void Vector::do_splat(void* dest, const void* item, size_t num) const { + splat_type( reinterpret_cast(dest), reinterpret_cast(item), num ); +} + +template +void Vector::do_move_forward(void* dest, const void* from, size_t num) const { + move_forward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); +} + +template +void Vector::do_move_backward(void* dest, const void* from, size_t num) const { + move_backward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); +} + +}; // namespace android + + +// --------------------------------------------------------------------------- + +#endif // ANDROID_VECTOR_H diff --git a/third_party/android_system_core/include/utils/VectorImpl.h b/third_party/android_system_core/include/utils/VectorImpl.h new file mode 100644 index 000000000..21ad71ce6 --- /dev/null +++ b/third_party/android_system_core/include/utils/VectorImpl.h @@ -0,0 +1,183 @@ +/* + * Copyright (C) 2005 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_VECTOR_IMPL_H +#define ANDROID_VECTOR_IMPL_H + +#include +#include +#include +#include + +// --------------------------------------------------------------------------- +// No user serviceable parts in here... +// --------------------------------------------------------------------------- + +namespace android { + +/*! + * Implementation of the guts of the vector<> class + * this ensures backward binary compatibility and + * reduces code size. + * For performance reasons, we expose mStorage and mCount + * so these fields are set in stone. + * + */ + +class VectorImpl +{ +public: + enum { // flags passed to the ctor + HAS_TRIVIAL_CTOR = 0x00000001, + HAS_TRIVIAL_DTOR = 0x00000002, + HAS_TRIVIAL_COPY = 0x00000004, + }; + + VectorImpl(size_t itemSize, uint32_t flags); + VectorImpl(const VectorImpl& rhs); + virtual ~VectorImpl(); + + /*! must be called from subclasses destructor */ + void finish_vector(); + + VectorImpl& operator = (const VectorImpl& rhs); + + /*! C-style array access */ + inline const void* arrayImpl() const { return mStorage; } + void* editArrayImpl(); + + /*! vector stats */ + inline size_t size() const { return mCount; } + inline bool isEmpty() const { return mCount == 0; } + size_t capacity() const; + ssize_t setCapacity(size_t size); + ssize_t resize(size_t size); + + /*! append/insert another vector or array */ + ssize_t insertVectorAt(const VectorImpl& vector, size_t index); + ssize_t appendVector(const VectorImpl& vector); + ssize_t insertArrayAt(const void* array, size_t index, size_t length); + ssize_t appendArray(const void* array, size_t length); + + /*! add/insert/replace items */ + ssize_t insertAt(size_t where, size_t numItems = 1); + ssize_t insertAt(const void* item, size_t where, size_t numItems = 1); + void pop(); + void push(); + void push(const void* item); + ssize_t add(); + ssize_t add(const void* item); + ssize_t replaceAt(size_t index); + ssize_t replaceAt(const void* item, size_t index); + + /*! remove items */ + ssize_t removeItemsAt(size_t index, size_t count = 1); + void clear(); + + const void* itemLocation(size_t index) const; + void* editItemLocation(size_t index); + + typedef int (*compar_t)(const void* lhs, const void* rhs); + typedef int (*compar_r_t)(const void* lhs, const void* rhs, void* state); + status_t sort(compar_t cmp); + status_t sort(compar_r_t cmp, void* state); + +protected: + size_t itemSize() const; + void release_storage(); + + virtual void do_construct(void* storage, size_t num) const = 0; + virtual void do_destroy(void* storage, size_t num) const = 0; + virtual void do_copy(void* dest, const void* from, size_t num) const = 0; + virtual void do_splat(void* dest, const void* item, size_t num) const = 0; + virtual void do_move_forward(void* dest, const void* from, size_t num) const = 0; + virtual void do_move_backward(void* dest, const void* from, size_t num) const = 0; + +private: + void* _grow(size_t where, size_t amount); + void _shrink(size_t where, size_t amount); + + inline void _do_construct(void* storage, size_t num) const; + inline void _do_destroy(void* storage, size_t num) const; + inline void _do_copy(void* dest, const void* from, size_t num) const; + inline void _do_splat(void* dest, const void* item, size_t num) const; + inline void _do_move_forward(void* dest, const void* from, size_t num) const; + inline void _do_move_backward(void* dest, const void* from, size_t num) const; + + // These 2 fields are exposed in the inlines below, + // so they're set in stone. + void * mStorage; // base address of the vector + size_t mCount; // number of items + + const uint32_t mFlags; + const size_t mItemSize; +}; + + + +class SortedVectorImpl : public VectorImpl +{ +public: + SortedVectorImpl(size_t itemSize, uint32_t flags); + SortedVectorImpl(const VectorImpl& rhs); + virtual ~SortedVectorImpl(); + + SortedVectorImpl& operator = (const SortedVectorImpl& rhs); + + //! finds the index of an item + ssize_t indexOf(const void* item) const; + + //! finds where this item should be inserted + size_t orderOf(const void* item) const; + + //! add an item in the right place (or replaces it if there is one) + ssize_t add(const void* item); + + //! merges a vector into this one + ssize_t merge(const VectorImpl& vector); + ssize_t merge(const SortedVectorImpl& vector); + + //! removes an item + ssize_t remove(const void* item); + +protected: + virtual int do_compare(const void* lhs, const void* rhs) const = 0; + +private: + ssize_t _indexOrderOf(const void* item, size_t* order = 0) const; + + // these are made private, because they can't be used on a SortedVector + // (they don't have an implementation either) + ssize_t add(); + void pop(); + void push(); + void push(const void* item); + ssize_t insertVectorAt(const VectorImpl& vector, size_t index); + ssize_t appendVector(const VectorImpl& vector); + ssize_t insertArrayAt(const void* array, size_t index, size_t length); + ssize_t appendArray(const void* array, size_t length); + ssize_t insertAt(size_t where, size_t numItems = 1); + ssize_t insertAt(const void* item, size_t where, size_t numItems = 1); + ssize_t replaceAt(size_t index); + ssize_t replaceAt(const void* item, size_t index); +}; + +}; // namespace android + + +// --------------------------------------------------------------------------- + +#endif // ANDROID_VECTOR_IMPL_H diff --git a/third_party/android_system_core/include/utils/ashmem.h b/third_party/android_system_core/include/utils/ashmem.h new file mode 100644 index 000000000..085477578 --- /dev/null +++ b/third_party/android_system_core/include/utils/ashmem.h @@ -0,0 +1,41 @@ +/* utils/ashmem.h + ** + ** Copyright 2008 The Android Open Source Project + ** + ** This file is dual licensed. It may be redistributed and/or modified + ** under the terms of the Apache 2.0 License OR version 2 of the GNU + ** General Public License. + */ + +#ifndef _UTILS_ASHMEM_H +#define _UTILS_ASHMEM_H + +#include +#include + +#define ASHMEM_NAME_LEN 256 + +#define ASHMEM_NAME_DEF "dev/ashmem" + +/* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ +#define ASHMEM_NOT_REAPED 0 +#define ASHMEM_WAS_REAPED 1 + +/* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ +#define ASHMEM_NOW_UNPINNED 0 +#define ASHMEM_NOW_PINNED 1 + +#define __ASHMEMIOC 0x77 + +#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN]) +#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN]) +#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t) +#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4) +#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long) +#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6) +#define ASHMEM_PIN _IO(__ASHMEMIOC, 7) +#define ASHMEM_UNPIN _IO(__ASHMEMIOC, 8) +#define ASHMEM_ISPINNED _IO(__ASHMEMIOC, 9) +#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10) + +#endif /* _UTILS_ASHMEM_H */ diff --git a/third_party/android_system_core/include/utils/misc.h b/third_party/android_system_core/include/utils/misc.h new file mode 100644 index 000000000..6cccec387 --- /dev/null +++ b/third_party/android_system_core/include/utils/misc.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2005 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. + */ + +// +// Handy utility functions and portability code. +// +#ifndef _LIBS_UTILS_MISC_H +#define _LIBS_UTILS_MISC_H + +#include + +/* get #of elements in a static array */ +#ifndef NELEM +# define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0]))) +#endif + +namespace android { + +typedef void (*sysprop_change_callback)(void); +void add_sysprop_change_callback(sysprop_change_callback cb, int priority); +void report_sysprop_change(); + +}; // namespace android + +#endif // _LIBS_UTILS_MISC_H diff --git a/third_party/android_system_core/include/utils/threads.h b/third_party/android_system_core/include/utils/threads.h new file mode 100644 index 000000000..9de338211 --- /dev/null +++ b/third_party/android_system_core/include/utils/threads.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2007 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 _LIBS_UTILS_THREADS_H +#define _LIBS_UTILS_THREADS_H + +/* + * Please, DO NOT USE! + * + * This file is here only for legacy reasons. Instead, include directly + * the headers you need below. + * + */ + +#include + +#ifdef __cplusplus +#include +#include +#include +#include +#include +#endif + +#endif // _LIBS_UTILS_THREADS_H diff --git a/third_party/bzip2/LICENSE b/third_party/bzip2/LICENSE new file mode 100644 index 000000000..cc614178c --- /dev/null +++ b/third_party/bzip2/LICENSE @@ -0,0 +1,42 @@ + +-------------------------------------------------------------------------- + +This program, "bzip2", the associated library "libbzip2", and all +documentation, are copyright (C) 1996-2010 Julian R Seward. All +rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + +4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Julian Seward, jseward@bzip.org +bzip2/libbzip2 version 1.0.6 of 6 September 2010 + +-------------------------------------------------------------------------- diff --git a/third_party/bzip2/build.txt b/third_party/bzip2/build.txt new file mode 100644 index 000000000..ceb322621 --- /dev/null +++ b/third_party/bzip2/build.txt @@ -0,0 +1,6 @@ +git clone https://github.com/enthought/bzip2-1.0.6.git +cd bzip2-1.0.6 +git reset --hard 288acf97a15d558f96c24c89f578b724d6e06b0c + +make libbz2.a +cp libbz2.a ../ diff --git a/third_party/bzip2/bzlib.h b/third_party/bzip2/bzlib.h new file mode 100644 index 000000000..8277123da --- /dev/null +++ b/third_party/bzip2/bzlib.h @@ -0,0 +1,282 @@ + +/*-------------------------------------------------------------*/ +/*--- Public header file for the library. ---*/ +/*--- bzlib.h ---*/ +/*-------------------------------------------------------------*/ + +/* ------------------------------------------------------------------ + This file is part of bzip2/libbzip2, a program and library for + lossless, block-sorting data compression. + + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward + + Please read the WARNING, DISCLAIMER and PATENTS sections in the + README file. + + This program is released under the terms of the license contained + in the file LICENSE. + ------------------------------------------------------------------ */ + + +#ifndef _BZLIB_H +#define _BZLIB_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define BZ_RUN 0 +#define BZ_FLUSH 1 +#define BZ_FINISH 2 + +#define BZ_OK 0 +#define BZ_RUN_OK 1 +#define BZ_FLUSH_OK 2 +#define BZ_FINISH_OK 3 +#define BZ_STREAM_END 4 +#define BZ_SEQUENCE_ERROR (-1) +#define BZ_PARAM_ERROR (-2) +#define BZ_MEM_ERROR (-3) +#define BZ_DATA_ERROR (-4) +#define BZ_DATA_ERROR_MAGIC (-5) +#define BZ_IO_ERROR (-6) +#define BZ_UNEXPECTED_EOF (-7) +#define BZ_OUTBUFF_FULL (-8) +#define BZ_CONFIG_ERROR (-9) + +typedef + struct { + char *next_in; + unsigned int avail_in; + unsigned int total_in_lo32; + unsigned int total_in_hi32; + + char *next_out; + unsigned int avail_out; + unsigned int total_out_lo32; + unsigned int total_out_hi32; + + void *state; + + void *(*bzalloc)(void *,int,int); + void (*bzfree)(void *,void *); + void *opaque; + } + bz_stream; + + +#ifndef BZ_IMPORT +#define BZ_EXPORT +#endif + +#ifndef BZ_NO_STDIO +/* Need a definitition for FILE */ +#include +#endif + +#ifdef _WIN32 +# include +# ifdef small + /* windows.h define small to char */ +# undef small +# endif +# ifdef BZ_EXPORT +# define BZ_API(func) WINAPI func +# define BZ_EXTERN extern +# else + /* import windows dll dynamically */ +# define BZ_API(func) (WINAPI * func) +# define BZ_EXTERN +# endif +#else +# define BZ_API(func) func +# define BZ_EXTERN extern +#endif + + +/*-- Core (low-level) library functions --*/ + +BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( + bz_stream* strm, + int blockSize100k, + int verbosity, + int workFactor + ); + +BZ_EXTERN int BZ_API(BZ2_bzCompress) ( + bz_stream* strm, + int action + ); + +BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( + bz_stream* strm + ); + +BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( + bz_stream *strm, + int verbosity, + int small + ); + +BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( + bz_stream* strm + ); + +BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( + bz_stream *strm + ); + + + +/*-- High(er) level library functions --*/ + +#ifndef BZ_NO_STDIO +#define BZ_MAX_UNUSED 5000 + +typedef void BZFILE; + +BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( + int* bzerror, + FILE* f, + int verbosity, + int small, + void* unused, + int nUnused + ); + +BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( + int* bzerror, + BZFILE* b + ); + +BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( + int* bzerror, + BZFILE* b, + void** unused, + int* nUnused + ); + +BZ_EXTERN int BZ_API(BZ2_bzRead) ( + int* bzerror, + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( + int* bzerror, + FILE* f, + int blockSize100k, + int verbosity, + int workFactor + ); + +BZ_EXTERN void BZ_API(BZ2_bzWrite) ( + int* bzerror, + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( + int* bzerror, + BZFILE* b, + int abandon, + unsigned int* nbytes_in, + unsigned int* nbytes_out + ); + +BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( + int* bzerror, + BZFILE* b, + int abandon, + unsigned int* nbytes_in_lo32, + unsigned int* nbytes_in_hi32, + unsigned int* nbytes_out_lo32, + unsigned int* nbytes_out_hi32 + ); +#endif + + +/*-- Utility functions --*/ + +BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( + char* dest, + unsigned int* destLen, + char* source, + unsigned int sourceLen, + int blockSize100k, + int verbosity, + int workFactor + ); + +BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( + char* dest, + unsigned int* destLen, + char* source, + unsigned int sourceLen, + int small, + int verbosity + ); + + +/*-- + Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp) + to support better zlib compatibility. + This code is not _officially_ part of libbzip2 (yet); + I haven't tested it, documented it, or considered the + threading-safeness of it. + If this code breaks, please contact both Yoshioka and me. +--*/ + +BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( + void + ); + +#ifndef BZ_NO_STDIO +BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( + const char *path, + const char *mode + ); + +BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( + int fd, + const char *mode + ); + +BZ_EXTERN int BZ_API(BZ2_bzread) ( + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN int BZ_API(BZ2_bzwrite) ( + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN int BZ_API(BZ2_bzflush) ( + BZFILE* b + ); + +BZ_EXTERN void BZ_API(BZ2_bzclose) ( + BZFILE* b + ); + +BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( + BZFILE *b, + int *errnum + ); +#endif + +#ifdef __cplusplus +} +#endif + +#endif + +/*-------------------------------------------------------------*/ +/*--- end bzlib.h ---*/ +/*-------------------------------------------------------------*/ diff --git a/third_party/bzip2/libbz2.a b/third_party/bzip2/libbz2.a new file mode 100644 index 000000000..0efccceb1 Binary files /dev/null and b/third_party/bzip2/libbz2.a differ diff --git a/third_party/json11/json11.cpp b/third_party/json11/json11.cpp new file mode 100644 index 000000000..bc4045f07 --- /dev/null +++ b/third_party/json11/json11.cpp @@ -0,0 +1,784 @@ +/* Copyright (c) 2013 Dropbox, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "json11.hpp" +#include +#include +#include +#include +#include + +namespace json11 { + +static const int max_depth = 200; + +using std::string; +using std::vector; +using std::map; +using std::make_shared; +using std::initializer_list; +using std::move; + +/* Helper for representing null - just a do-nothing struct, plus comparison + * operators so the helpers in JsonValue work. We can't use nullptr_t because + * it may not be orderable. + */ +struct NullStruct { + bool operator==(NullStruct) const { return true; } + bool operator<(NullStruct) const { return false; } +}; + +/* * * * * * * * * * * * * * * * * * * * + * Serialization + */ + +static void dump(NullStruct, string &out) { + out += "null"; +} + +static void dump(double value, string &out) { + if (std::isfinite(value)) { + char buf[32]; + snprintf(buf, sizeof buf, "%.17g", value); + out += buf; + } else { + out += "null"; + } +} + +static void dump(int value, string &out) { + char buf[32]; + snprintf(buf, sizeof buf, "%d", value); + out += buf; +} + +static void dump(bool value, string &out) { + out += value ? "true" : "false"; +} + +static void dump(const string &value, string &out) { + out += '"'; + for (size_t i = 0; i < value.length(); i++) { + const char ch = value[i]; + if (ch == '\\') { + out += "\\\\"; + } else if (ch == '"') { + out += "\\\""; + } else if (ch == '\b') { + out += "\\b"; + } else if (ch == '\f') { + out += "\\f"; + } else if (ch == '\n') { + out += "\\n"; + } else if (ch == '\r') { + out += "\\r"; + } else if (ch == '\t') { + out += "\\t"; + } else if (static_cast(ch) <= 0x1f) { + char buf[8]; + snprintf(buf, sizeof buf, "\\u%04x", ch); + out += buf; + } else if (static_cast(ch) == 0xe2 && static_cast(value[i+1]) == 0x80 + && static_cast(value[i+2]) == 0xa8) { + out += "\\u2028"; + i += 2; + } else if (static_cast(ch) == 0xe2 && static_cast(value[i+1]) == 0x80 + && static_cast(value[i+2]) == 0xa9) { + out += "\\u2029"; + i += 2; + } else { + out += ch; + } + } + out += '"'; +} + +static void dump(const Json::array &values, string &out) { + bool first = true; + out += "["; + for (const auto &value : values) { + if (!first) + out += ", "; + value.dump(out); + first = false; + } + out += "]"; +} + +static void dump(const Json::object &values, string &out) { + bool first = true; + out += "{"; + for (const auto &kv : values) { + if (!first) + out += ", "; + dump(kv.first, out); + out += ": "; + kv.second.dump(out); + first = false; + } + out += "}"; +} + +void Json::dump(string &out) const { + m_ptr->dump(out); +} + +/* * * * * * * * * * * * * * * * * * * * + * Value wrappers + */ + +template +class Value : public JsonValue { +protected: + + // Constructors + explicit Value(const T &value) : m_value(value) {} + explicit Value(T &&value) : m_value(move(value)) {} + + // Get type tag + Json::Type type() const override { + return tag; + } + + // Comparisons + bool equals(const JsonValue * other) const override { + return m_value == static_cast *>(other)->m_value; + } + bool less(const JsonValue * other) const override { + return m_value < static_cast *>(other)->m_value; + } + + const T m_value; + void dump(string &out) const override { json11::dump(m_value, out); } +}; + +class JsonDouble final : public Value { + double number_value() const override { return m_value; } + int int_value() const override { return static_cast(m_value); } + bool equals(const JsonValue * other) const override { return m_value == other->number_value(); } + bool less(const JsonValue * other) const override { return m_value < other->number_value(); } +public: + explicit JsonDouble(double value) : Value(value) {} +}; + +class JsonInt final : public Value { + double number_value() const override { return m_value; } + int int_value() const override { return m_value; } + bool equals(const JsonValue * other) const override { return m_value == other->number_value(); } + bool less(const JsonValue * other) const override { return m_value < other->number_value(); } +public: + explicit JsonInt(int value) : Value(value) {} +}; + +class JsonBoolean final : public Value { + bool bool_value() const override { return m_value; } +public: + explicit JsonBoolean(bool value) : Value(value) {} +}; + +class JsonString final : public Value { + const string &string_value() const override { return m_value; } +public: + explicit JsonString(const string &value) : Value(value) {} + explicit JsonString(string &&value) : Value(move(value)) {} +}; + +class JsonArray final : public Value { + const Json::array &array_items() const override { return m_value; } + const Json & operator[](size_t i) const override; +public: + explicit JsonArray(const Json::array &value) : Value(value) {} + explicit JsonArray(Json::array &&value) : Value(move(value)) {} +}; + +class JsonObject final : public Value { + const Json::object &object_items() const override { return m_value; } + const Json & operator[](const string &key) const override; +public: + explicit JsonObject(const Json::object &value) : Value(value) {} + explicit JsonObject(Json::object &&value) : Value(move(value)) {} +}; + +class JsonNull final : public Value { +public: + JsonNull() : Value({}) {} +}; + +/* * * * * * * * * * * * * * * * * * * * + * Static globals - static-init-safe + */ +struct Statics { + const std::shared_ptr null = make_shared(); + const std::shared_ptr t = make_shared(true); + const std::shared_ptr f = make_shared(false); + const string empty_string; + const vector empty_vector; + const map empty_map; + Statics() {} +}; + +static const Statics & statics() { + static const Statics s {}; + return s; +} + +static const Json & static_null() { + // This has to be separate, not in Statics, because Json() accesses statics().null. + static const Json json_null; + return json_null; +} + +/* * * * * * * * * * * * * * * * * * * * + * Constructors + */ + +Json::Json() noexcept : m_ptr(statics().null) {} +Json::Json(std::nullptr_t) noexcept : m_ptr(statics().null) {} +Json::Json(double value) : m_ptr(make_shared(value)) {} +Json::Json(int value) : m_ptr(make_shared(value)) {} +Json::Json(bool value) : m_ptr(value ? statics().t : statics().f) {} +Json::Json(const string &value) : m_ptr(make_shared(value)) {} +Json::Json(string &&value) : m_ptr(make_shared(move(value))) {} +Json::Json(const char * value) : m_ptr(make_shared(value)) {} +Json::Json(const Json::array &values) : m_ptr(make_shared(values)) {} +Json::Json(Json::array &&values) : m_ptr(make_shared(move(values))) {} +Json::Json(const Json::object &values) : m_ptr(make_shared(values)) {} +Json::Json(Json::object &&values) : m_ptr(make_shared(move(values))) {} + +/* * * * * * * * * * * * * * * * * * * * + * Accessors + */ + +Json::Type Json::type() const { return m_ptr->type(); } +double Json::number_value() const { return m_ptr->number_value(); } +int Json::int_value() const { return m_ptr->int_value(); } +bool Json::bool_value() const { return m_ptr->bool_value(); } +const string & Json::string_value() const { return m_ptr->string_value(); } +const vector & Json::array_items() const { return m_ptr->array_items(); } +const map & Json::object_items() const { return m_ptr->object_items(); } +const Json & Json::operator[] (size_t i) const { return (*m_ptr)[i]; } +const Json & Json::operator[] (const string &key) const { return (*m_ptr)[key]; } + +double JsonValue::number_value() const { return 0; } +int JsonValue::int_value() const { return 0; } +bool JsonValue::bool_value() const { return false; } +const string & JsonValue::string_value() const { return statics().empty_string; } +const vector & JsonValue::array_items() const { return statics().empty_vector; } +const map & JsonValue::object_items() const { return statics().empty_map; } +const Json & JsonValue::operator[] (size_t) const { return static_null(); } +const Json & JsonValue::operator[] (const string &) const { return static_null(); } + +const Json & JsonObject::operator[] (const string &key) const { + auto iter = m_value.find(key); + return (iter == m_value.end()) ? static_null() : iter->second; +} +const Json & JsonArray::operator[] (size_t i) const { + if (i >= m_value.size()) return static_null(); + else return m_value[i]; +} + +/* * * * * * * * * * * * * * * * * * * * + * Comparison + */ + +bool Json::operator== (const Json &other) const { + if (m_ptr->type() != other.m_ptr->type()) + return false; + + return m_ptr->equals(other.m_ptr.get()); +} + +bool Json::operator< (const Json &other) const { + if (m_ptr->type() != other.m_ptr->type()) + return m_ptr->type() < other.m_ptr->type(); + + return m_ptr->less(other.m_ptr.get()); +} + +/* * * * * * * * * * * * * * * * * * * * + * Parsing + */ + +/* esc(c) + * + * Format char c suitable for printing in an error message. + */ +static inline string esc(char c) { + char buf[12]; + if (static_cast(c) >= 0x20 && static_cast(c) <= 0x7f) { + snprintf(buf, sizeof buf, "'%c' (%d)", c, c); + } else { + snprintf(buf, sizeof buf, "(%d)", c); + } + return string(buf); +} + +static inline bool in_range(long x, long lower, long upper) { + return (x >= lower && x <= upper); +} + +namespace { +/* JsonParser + * + * Object that tracks all state of an in-progress parse. + */ +struct JsonParser final { + + /* State + */ + const string &str; + size_t i; + string &err; + bool failed; + const JsonParse strategy; + + /* fail(msg, err_ret = Json()) + * + * Mark this parse as failed. + */ + Json fail(string &&msg) { + return fail(move(msg), Json()); + } + + template + T fail(string &&msg, const T err_ret) { + if (!failed) + err = std::move(msg); + failed = true; + return err_ret; + } + + /* consume_whitespace() + * + * Advance until the current character is non-whitespace. + */ + void consume_whitespace() { + while (str[i] == ' ' || str[i] == '\r' || str[i] == '\n' || str[i] == '\t') + i++; + } + + /* consume_comment() + * + * Advance comments (c-style inline and multiline). + */ + bool consume_comment() { + bool comment_found = false; + if (str[i] == '/') { + i++; + if (i == str.size()) + return fail("unexpected end of input after start of comment", false); + if (str[i] == '/') { // inline comment + i++; + // advance until next line, or end of input + while (i < str.size() && str[i] != '\n') { + i++; + } + comment_found = true; + } + else if (str[i] == '*') { // multiline comment + i++; + if (i > str.size()-2) + return fail("unexpected end of input inside multi-line comment", false); + // advance until closing tokens + while (!(str[i] == '*' && str[i+1] == '/')) { + i++; + if (i > str.size()-2) + return fail( + "unexpected end of input inside multi-line comment", false); + } + i += 2; + comment_found = true; + } + else + return fail("malformed comment", false); + } + return comment_found; + } + + /* consume_garbage() + * + * Advance until the current character is non-whitespace and non-comment. + */ + void consume_garbage() { + consume_whitespace(); + if(strategy == JsonParse::COMMENTS) { + bool comment_found = false; + do { + comment_found = consume_comment(); + if (failed) return; + consume_whitespace(); + } + while(comment_found); + } + } + + /* get_next_token() + * + * Return the next non-whitespace character. If the end of the input is reached, + * flag an error and return 0. + */ + char get_next_token() { + consume_garbage(); + if (failed) return (char)0; + if (i == str.size()) + return fail("unexpected end of input", (char)0); + + return str[i++]; + } + + /* encode_utf8(pt, out) + * + * Encode pt as UTF-8 and add it to out. + */ + void encode_utf8(long pt, string & out) { + if (pt < 0) + return; + + if (pt < 0x80) { + out += static_cast(pt); + } else if (pt < 0x800) { + out += static_cast((pt >> 6) | 0xC0); + out += static_cast((pt & 0x3F) | 0x80); + } else if (pt < 0x10000) { + out += static_cast((pt >> 12) | 0xE0); + out += static_cast(((pt >> 6) & 0x3F) | 0x80); + out += static_cast((pt & 0x3F) | 0x80); + } else { + out += static_cast((pt >> 18) | 0xF0); + out += static_cast(((pt >> 12) & 0x3F) | 0x80); + out += static_cast(((pt >> 6) & 0x3F) | 0x80); + out += static_cast((pt & 0x3F) | 0x80); + } + } + + /* parse_string() + * + * Parse a string, starting at the current position. + */ + string parse_string() { + string out; + long last_escaped_codepoint = -1; + while (true) { + if (i == str.size()) + return fail("unexpected end of input in string", ""); + + char ch = str[i++]; + + if (ch == '"') { + encode_utf8(last_escaped_codepoint, out); + return out; + } + + if (in_range(ch, 0, 0x1f)) + return fail("unescaped " + esc(ch) + " in string", ""); + + // The usual case: non-escaped characters + if (ch != '\\') { + encode_utf8(last_escaped_codepoint, out); + last_escaped_codepoint = -1; + out += ch; + continue; + } + + // Handle escapes + if (i == str.size()) + return fail("unexpected end of input in string", ""); + + ch = str[i++]; + + if (ch == 'u') { + // Extract 4-byte escape sequence + string esc = str.substr(i, 4); + // Explicitly check length of the substring. The following loop + // relies on std::string returning the terminating NUL when + // accessing str[length]. Checking here reduces brittleness. + if (esc.length() < 4) { + return fail("bad \\u escape: " + esc, ""); + } + for (size_t j = 0; j < 4; j++) { + if (!in_range(esc[j], 'a', 'f') && !in_range(esc[j], 'A', 'F') + && !in_range(esc[j], '0', '9')) + return fail("bad \\u escape: " + esc, ""); + } + + long codepoint = strtol(esc.data(), nullptr, 16); + + // JSON specifies that characters outside the BMP shall be encoded as a pair + // of 4-hex-digit \u escapes encoding their surrogate pair components. Check + // whether we're in the middle of such a beast: the previous codepoint was an + // escaped lead (high) surrogate, and this is a trail (low) surrogate. + if (in_range(last_escaped_codepoint, 0xD800, 0xDBFF) + && in_range(codepoint, 0xDC00, 0xDFFF)) { + // Reassemble the two surrogate pairs into one astral-plane character, per + // the UTF-16 algorithm. + encode_utf8((((last_escaped_codepoint - 0xD800) << 10) + | (codepoint - 0xDC00)) + 0x10000, out); + last_escaped_codepoint = -1; + } else { + encode_utf8(last_escaped_codepoint, out); + last_escaped_codepoint = codepoint; + } + + i += 4; + continue; + } + + encode_utf8(last_escaped_codepoint, out); + last_escaped_codepoint = -1; + + if (ch == 'b') { + out += '\b'; + } else if (ch == 'f') { + out += '\f'; + } else if (ch == 'n') { + out += '\n'; + } else if (ch == 'r') { + out += '\r'; + } else if (ch == 't') { + out += '\t'; + } else if (ch == '"' || ch == '\\' || ch == '/') { + out += ch; + } else { + return fail("invalid escape character " + esc(ch), ""); + } + } + } + + /* parse_number() + * + * Parse a double. + */ + Json parse_number() { + size_t start_pos = i; + + if (str[i] == '-') + i++; + + // Integer part + if (str[i] == '0') { + i++; + if (in_range(str[i], '0', '9')) + return fail("leading 0s not permitted in numbers"); + } else if (in_range(str[i], '1', '9')) { + i++; + while (in_range(str[i], '0', '9')) + i++; + } else { + return fail("invalid " + esc(str[i]) + " in number"); + } + + if (str[i] != '.' && str[i] != 'e' && str[i] != 'E' + && (i - start_pos) <= static_cast(std::numeric_limits::digits10)) { + return std::atoi(str.c_str() + start_pos); + } + + // Decimal part + if (str[i] == '.') { + i++; + if (!in_range(str[i], '0', '9')) + return fail("at least one digit required in fractional part"); + + while (in_range(str[i], '0', '9')) + i++; + } + + // Exponent part + if (str[i] == 'e' || str[i] == 'E') { + i++; + + if (str[i] == '+' || str[i] == '-') + i++; + + if (!in_range(str[i], '0', '9')) + return fail("at least one digit required in exponent"); + + while (in_range(str[i], '0', '9')) + i++; + } + + return std::strtod(str.c_str() + start_pos, nullptr); + } + + /* expect(str, res) + * + * Expect that 'str' starts at the character that was just read. If it does, advance + * the input and return res. If not, flag an error. + */ + Json expect(const string &expected, Json res) { + assert(i != 0); + i--; + if (str.compare(i, expected.length(), expected) == 0) { + i += expected.length(); + return res; + } else { + return fail("parse error: expected " + expected + ", got " + str.substr(i, expected.length())); + } + } + + /* parse_json() + * + * Parse a JSON object. + */ + Json parse_json(int depth) { + if (depth > max_depth) { + return fail("exceeded maximum nesting depth"); + } + + char ch = get_next_token(); + if (failed) + return Json(); + + if (ch == '-' || (ch >= '0' && ch <= '9')) { + i--; + return parse_number(); + } + + if (ch == 't') + return expect("true", true); + + if (ch == 'f') + return expect("false", false); + + if (ch == 'n') + return expect("null", Json()); + + if (ch == '"') + return parse_string(); + + if (ch == '{') { + map data; + ch = get_next_token(); + if (ch == '}') + return data; + + while (1) { + if (ch != '"') + return fail("expected '\"' in object, got " + esc(ch)); + + string key = parse_string(); + if (failed) + return Json(); + + ch = get_next_token(); + if (ch != ':') + return fail("expected ':' in object, got " + esc(ch)); + + data[std::move(key)] = parse_json(depth + 1); + if (failed) + return Json(); + + ch = get_next_token(); + if (ch == '}') + break; + if (ch != ',') + return fail("expected ',' in object, got " + esc(ch)); + + ch = get_next_token(); + } + return data; + } + + if (ch == '[') { + vector data; + ch = get_next_token(); + if (ch == ']') + return data; + + while (1) { + i--; + data.push_back(parse_json(depth + 1)); + if (failed) + return Json(); + + ch = get_next_token(); + if (ch == ']') + break; + if (ch != ',') + return fail("expected ',' in list, got " + esc(ch)); + + ch = get_next_token(); + (void)ch; + } + return data; + } + + return fail("expected value, got " + esc(ch)); + } +}; +}//namespace { + +Json Json::parse(const string &in, string &err, JsonParse strategy) { + JsonParser parser { in, 0, err, false, strategy }; + Json result = parser.parse_json(0); + + // Check for any trailing garbage + parser.consume_garbage(); + if (parser.failed) + return Json(); + if (parser.i != in.size()) + return parser.fail("unexpected trailing " + esc(in[parser.i])); + + return result; +} + +// Documented in json11.hpp +vector Json::parse_multi(const string &in, + std::string::size_type &parser_stop_pos, + string &err, + JsonParse strategy) { + JsonParser parser { in, 0, err, false, strategy }; + parser_stop_pos = 0; + vector json_vec; + while (parser.i != in.size() && !parser.failed) { + json_vec.push_back(parser.parse_json(0)); + if (parser.failed) + break; + + // Check for another object + parser.consume_garbage(); + if (parser.failed) + break; + parser_stop_pos = parser.i; + } + return json_vec; +} + +/* * * * * * * * * * * * * * * * * * * * + * Shape-checking + */ + +bool Json::has_shape(const shape & types, string & err) const { + if (!is_object()) { + err = "expected JSON object, got " + dump(); + return false; + } + + for (auto & item : types) { + if ((*this)[item.first].type() != item.second) { + err = "bad type for " + item.first + " in " + dump(); + return false; + } + } + + return true; +} + +} // namespace json11 diff --git a/third_party/json11/json11.hpp b/third_party/json11/json11.hpp new file mode 100644 index 000000000..5202ef932 --- /dev/null +++ b/third_party/json11/json11.hpp @@ -0,0 +1,232 @@ +/* json11 + * + * json11 is a tiny JSON library for C++11, providing JSON parsing and serialization. + * + * The core object provided by the library is json11::Json. A Json object represents any JSON + * value: null, bool, number (int or double), string (std::string), array (std::vector), or + * object (std::map). + * + * Json objects act like values: they can be assigned, copied, moved, compared for equality or + * order, etc. There are also helper methods Json::dump, to serialize a Json to a string, and + * Json::parse (static) to parse a std::string as a Json object. + * + * Internally, the various types of Json object are represented by the JsonValue class + * hierarchy. + * + * A note on numbers - JSON specifies the syntax of number formatting but not its semantics, + * so some JSON implementations distinguish between integers and floating-point numbers, while + * some don't. In json11, we choose the latter. Because some JSON implementations (namely + * Javascript itself) treat all numbers as the same type, distinguishing the two leads + * to JSON that will be *silently* changed by a round-trip through those implementations. + * Dangerous! To avoid that risk, json11 stores all numbers as double internally, but also + * provides integer helpers. + * + * Fortunately, double-precision IEEE754 ('double') can precisely store any integer in the + * range +/-2^53, which includes every 'int' on most systems. (Timestamps often use int64 + * or long long to avoid the Y2038K problem; a double storing microseconds since some epoch + * will be exact for +/- 275 years.) + */ + +/* Copyright (c) 2013 Dropbox, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#ifdef _MSC_VER + #if _MSC_VER <= 1800 // VS 2013 + #ifndef noexcept + #define noexcept throw() + #endif + + #ifndef snprintf + #define snprintf _snprintf_s + #endif + #endif +#endif + +namespace json11 { + +enum JsonParse { + STANDARD, COMMENTS +}; + +class JsonValue; + +class Json final { +public: + // Types + enum Type { + NUL, NUMBER, BOOL, STRING, ARRAY, OBJECT + }; + + // Array and object typedefs + typedef std::vector array; + typedef std::map object; + + // Constructors for the various types of JSON value. + Json() noexcept; // NUL + Json(std::nullptr_t) noexcept; // NUL + Json(double value); // NUMBER + Json(int value); // NUMBER + Json(bool value); // BOOL + Json(const std::string &value); // STRING + Json(std::string &&value); // STRING + Json(const char * value); // STRING + Json(const array &values); // ARRAY + Json(array &&values); // ARRAY + Json(const object &values); // OBJECT + Json(object &&values); // OBJECT + + // Implicit constructor: anything with a to_json() function. + template + Json(const T & t) : Json(t.to_json()) {} + + // Implicit constructor: map-like objects (std::map, std::unordered_map, etc) + template ::value + && std::is_constructible::value, + int>::type = 0> + Json(const M & m) : Json(object(m.begin(), m.end())) {} + + // Implicit constructor: vector-like objects (std::list, std::vector, std::set, etc) + template ::value, + int>::type = 0> + Json(const V & v) : Json(array(v.begin(), v.end())) {} + + // This prevents Json(some_pointer) from accidentally producing a bool. Use + // Json(bool(some_pointer)) if that behavior is desired. + Json(void *) = delete; + + // Accessors + Type type() const; + + bool is_null() const { return type() == NUL; } + bool is_number() const { return type() == NUMBER; } + bool is_bool() const { return type() == BOOL; } + bool is_string() const { return type() == STRING; } + bool is_array() const { return type() == ARRAY; } + bool is_object() const { return type() == OBJECT; } + + // Return the enclosed value if this is a number, 0 otherwise. Note that json11 does not + // distinguish between integer and non-integer numbers - number_value() and int_value() + // can both be applied to a NUMBER-typed object. + double number_value() const; + int int_value() const; + + // Return the enclosed value if this is a boolean, false otherwise. + bool bool_value() const; + // Return the enclosed string if this is a string, "" otherwise. + const std::string &string_value() const; + // Return the enclosed std::vector if this is an array, or an empty vector otherwise. + const array &array_items() const; + // Return the enclosed std::map if this is an object, or an empty map otherwise. + const object &object_items() const; + + // Return a reference to arr[i] if this is an array, Json() otherwise. + const Json & operator[](size_t i) const; + // Return a reference to obj[key] if this is an object, Json() otherwise. + const Json & operator[](const std::string &key) const; + + // Serialize. + void dump(std::string &out) const; + std::string dump() const { + std::string out; + dump(out); + return out; + } + + // Parse. If parse fails, return Json() and assign an error message to err. + static Json parse(const std::string & in, + std::string & err, + JsonParse strategy = JsonParse::STANDARD); + static Json parse(const char * in, + std::string & err, + JsonParse strategy = JsonParse::STANDARD) { + if (in) { + return parse(std::string(in), err, strategy); + } else { + err = "null input"; + return nullptr; + } + } + // Parse multiple objects, concatenated or separated by whitespace + static std::vector parse_multi( + const std::string & in, + std::string::size_type & parser_stop_pos, + std::string & err, + JsonParse strategy = JsonParse::STANDARD); + + static inline std::vector parse_multi( + const std::string & in, + std::string & err, + JsonParse strategy = JsonParse::STANDARD) { + std::string::size_type parser_stop_pos; + return parse_multi(in, parser_stop_pos, err, strategy); + } + + bool operator== (const Json &rhs) const; + bool operator< (const Json &rhs) const; + bool operator!= (const Json &rhs) const { return !(*this == rhs); } + bool operator<= (const Json &rhs) const { return !(rhs < *this); } + bool operator> (const Json &rhs) const { return (rhs < *this); } + bool operator>= (const Json &rhs) const { return !(*this < rhs); } + + /* has_shape(types, err) + * + * Return true if this is a JSON object and, for each item in types, has a field of + * the given type. If not, return false and set err to a descriptive message. + */ + typedef std::initializer_list> shape; + bool has_shape(const shape & types, std::string & err) const; + +private: + std::shared_ptr m_ptr; +}; + +// Internal class hierarchy - JsonValue objects are not exposed to users of this API. +class JsonValue { +protected: + friend class Json; + friend class JsonInt; + friend class JsonDouble; + virtual Json::Type type() const = 0; + virtual bool equals(const JsonValue * other) const = 0; + virtual bool less(const JsonValue * other) const = 0; + virtual void dump(std::string &out) const = 0; + virtual double number_value() const; + virtual int int_value() const; + virtual bool bool_value() const; + virtual const std::string &string_value() const; + virtual const Json::array &array_items() const; + virtual const Json &operator[](size_t i) const; + virtual const Json::object &object_items() const; + virtual const Json &operator[](const std::string &key) const; + virtual ~JsonValue() {} +}; + +} // namespace json11 diff --git a/third_party/kaitai/custom_decoder.h b/third_party/kaitai/custom_decoder.h new file mode 100644 index 000000000..6da7f5fd2 --- /dev/null +++ b/third_party/kaitai/custom_decoder.h @@ -0,0 +1,16 @@ +#ifndef KAITAI_CUSTOM_DECODER_H +#define KAITAI_CUSTOM_DECODER_H + +#include + +namespace kaitai { + +class custom_decoder { +public: + virtual ~custom_decoder() {}; + virtual std::string decode(std::string src) = 0; +}; + +} + +#endif diff --git a/third_party/kaitai/exceptions.h b/third_party/kaitai/exceptions.h new file mode 100644 index 000000000..5c09c4672 --- /dev/null +++ b/third_party/kaitai/exceptions.h @@ -0,0 +1,189 @@ +#ifndef KAITAI_EXCEPTIONS_H +#define KAITAI_EXCEPTIONS_H + +#include + +#include +#include + +// We need to use "noexcept" in virtual destructor of our exceptions +// subclasses. Different compilers have different ideas on how to +// achieve that: C++98 compilers prefer `throw()`, C++11 and later +// use `noexcept`. We define KS_NOEXCEPT macro for that. + +#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900) +#define KS_NOEXCEPT noexcept +#else +#define KS_NOEXCEPT throw() +#endif + +namespace kaitai { + +/** + * Common ancestor for all error originating from Kaitai Struct usage. + * Stores KSY source path, pointing to an element supposedly guilty of + * an error. + */ +class kstruct_error: public std::runtime_error { +public: + kstruct_error(const std::string what, const std::string src_path): + std::runtime_error(src_path + ": " + what), + m_src_path(src_path) + { + } + + virtual ~kstruct_error() KS_NOEXCEPT {}; + +protected: + const std::string m_src_path; +}; + +/** + * Error that occurs when default endianness should be decided with + * a switch, but nothing matches (although using endianness expression + * implies that there should be some positive result). + */ +class undecided_endianness_error: public kstruct_error { +public: + undecided_endianness_error(const std::string src_path): + kstruct_error("unable to decide on endianness for a type", src_path) + { + } + + virtual ~undecided_endianness_error() KS_NOEXCEPT {}; +}; + +/** + * Common ancestor for all validation failures. Stores pointer to + * KaitaiStream IO object which was involved in an error. + */ +class validation_failed_error: public kstruct_error { +public: + validation_failed_error(const std::string what, kstream* io, const std::string src_path): + kstruct_error("at pos " + kstream::to_string(static_cast(io->pos())) + ": validation failed: " + what, src_path), + m_io(io) + { + } + +// "at pos #{io.pos}: validation failed: #{msg}" + + virtual ~validation_failed_error() KS_NOEXCEPT {}; + +protected: + kstream* m_io; +}; + +/** + * Signals validation failure: we required "actual" value to be equal to + * "expected", but it turned out that it's not. + */ +template +class validation_not_equal_error: public validation_failed_error { +public: + validation_not_equal_error(const T& expected, const T& actual, kstream* io, const std::string src_path): + validation_failed_error("not equal", io, src_path), + m_expected(expected), + m_actual(actual) + { + } + + // "not equal, expected #{expected.inspect}, but got #{actual.inspect}" + + virtual ~validation_not_equal_error() KS_NOEXCEPT {}; + +protected: + const T& m_expected; + const T& m_actual; +}; + +/** + * Signals validation failure: we required "actual" value to be greater + * than or equal to "min", but it turned out that it's not. + */ +template +class validation_less_than_error: public validation_failed_error { +public: + validation_less_than_error(const T& min, const T& actual, kstream* io, const std::string src_path): + validation_failed_error("not in range", io, src_path), + m_min(min), + m_actual(actual) + { + } + + // "not in range, min #{min.inspect}, but got #{actual.inspect}" + + virtual ~validation_less_than_error() KS_NOEXCEPT {}; + +protected: + const T& m_min; + const T& m_actual; +}; + +/** + * Signals validation failure: we required "actual" value to be less + * than or equal to "max", but it turned out that it's not. + */ +template +class validation_greater_than_error: public validation_failed_error { +public: + validation_greater_than_error(const T& max, const T& actual, kstream* io, const std::string src_path): + validation_failed_error("not in range", io, src_path), + m_max(max), + m_actual(actual) + { + } + + // "not in range, max #{max.inspect}, but got #{actual.inspect}" + + virtual ~validation_greater_than_error() KS_NOEXCEPT {}; + +protected: + const T& m_max; + const T& m_actual; +}; + +/** + * Signals validation failure: we required "actual" value to be from + * the list, but it turned out that it's not. + */ +template +class validation_not_any_of_error: public validation_failed_error { +public: + validation_not_any_of_error(const T& actual, kstream* io, const std::string src_path): + validation_failed_error("not any of the list", io, src_path), + m_actual(actual) + { + } + + // "not any of the list, got #{actual.inspect}" + + virtual ~validation_not_any_of_error() KS_NOEXCEPT {}; + +protected: + const T& m_actual; +}; + +/** + * Signals validation failure: we required "actual" value to match + * the expression, but it turned out that it doesn't. + */ +template +class validation_expr_error: public validation_failed_error { +public: + validation_expr_error(const T& actual, kstream* io, const std::string src_path): + validation_failed_error("not matching the expression", io, src_path), + m_actual(actual) + { + } + + // "not matching the expression, got #{actual.inspect}" + + virtual ~validation_expr_error() KS_NOEXCEPT {}; + +protected: + const T& m_actual; +}; + +} + +#endif diff --git a/third_party/kaitai/kaitaistream.cpp b/third_party/kaitai/kaitaistream.cpp new file mode 100644 index 000000000..d82ddb7e8 --- /dev/null +++ b/third_party/kaitai/kaitaistream.cpp @@ -0,0 +1,689 @@ +#include + +#if defined(__APPLE__) +#include +#include +#define bswap_16(x) OSSwapInt16(x) +#define bswap_32(x) OSSwapInt32(x) +#define bswap_64(x) OSSwapInt64(x) +#define __BYTE_ORDER BYTE_ORDER +#define __BIG_ENDIAN BIG_ENDIAN +#define __LITTLE_ENDIAN LITTLE_ENDIAN +#elif defined(_MSC_VER) // !__APPLE__ +#include +#define __LITTLE_ENDIAN 1234 +#define __BIG_ENDIAN 4321 +#define __BYTE_ORDER __LITTLE_ENDIAN +#define bswap_16(x) _byteswap_ushort(x) +#define bswap_32(x) _byteswap_ulong(x) +#define bswap_64(x) _byteswap_uint64(x) +#else // !__APPLE__ or !_MSC_VER +#include +#include +#endif + +#include +#include +#include + +kaitai::kstream::kstream(std::istream* io) { + m_io = io; + init(); +} + +kaitai::kstream::kstream(std::string& data): m_io_str(data) { + m_io = &m_io_str; + init(); +} + +void kaitai::kstream::init() { + exceptions_enable(); + align_to_byte(); +} + +void kaitai::kstream::close() { + // m_io->close(); +} + +void kaitai::kstream::exceptions_enable() const { + m_io->exceptions( + std::istream::eofbit | + std::istream::failbit | + std::istream::badbit + ); +} + +// ======================================================================== +// Stream positioning +// ======================================================================== + +bool kaitai::kstream::is_eof() const { + if (m_bits_left > 0) { + return false; + } + char t; + m_io->exceptions( + std::istream::badbit + ); + m_io->get(t); + if (m_io->eof()) { + m_io->clear(); + exceptions_enable(); + return true; + } else { + m_io->unget(); + exceptions_enable(); + return false; + } +} + +void kaitai::kstream::seek(uint64_t pos) { + m_io->seekg(pos); +} + +uint64_t kaitai::kstream::pos() { + return m_io->tellg(); +} + +uint64_t kaitai::kstream::size() { + std::iostream::pos_type cur_pos = m_io->tellg(); + m_io->seekg(0, std::ios::end); + std::iostream::pos_type len = m_io->tellg(); + m_io->seekg(cur_pos); + return len; +} + +// ======================================================================== +// Integer numbers +// ======================================================================== + +// ------------------------------------------------------------------------ +// Signed +// ------------------------------------------------------------------------ + +int8_t kaitai::kstream::read_s1() { + char t; + m_io->get(t); + return t; +} + +// ........................................................................ +// Big-endian +// ........................................................................ + +int16_t kaitai::kstream::read_s2be() { + int16_t t; + m_io->read(reinterpret_cast(&t), 2); +#if __BYTE_ORDER == __LITTLE_ENDIAN + t = bswap_16(t); +#endif + return t; +} + +int32_t kaitai::kstream::read_s4be() { + int32_t t; + m_io->read(reinterpret_cast(&t), 4); +#if __BYTE_ORDER == __LITTLE_ENDIAN + t = bswap_32(t); +#endif + return t; +} + +int64_t kaitai::kstream::read_s8be() { + int64_t t; + m_io->read(reinterpret_cast(&t), 8); +#if __BYTE_ORDER == __LITTLE_ENDIAN + t = bswap_64(t); +#endif + return t; +} + +// ........................................................................ +// Little-endian +// ........................................................................ + +int16_t kaitai::kstream::read_s2le() { + int16_t t; + m_io->read(reinterpret_cast(&t), 2); +#if __BYTE_ORDER == __BIG_ENDIAN + t = bswap_16(t); +#endif + return t; +} + +int32_t kaitai::kstream::read_s4le() { + int32_t t; + m_io->read(reinterpret_cast(&t), 4); +#if __BYTE_ORDER == __BIG_ENDIAN + t = bswap_32(t); +#endif + return t; +} + +int64_t kaitai::kstream::read_s8le() { + int64_t t; + m_io->read(reinterpret_cast(&t), 8); +#if __BYTE_ORDER == __BIG_ENDIAN + t = bswap_64(t); +#endif + return t; +} + +// ------------------------------------------------------------------------ +// Unsigned +// ------------------------------------------------------------------------ + +uint8_t kaitai::kstream::read_u1() { + char t; + m_io->get(t); + return t; +} + +// ........................................................................ +// Big-endian +// ........................................................................ + +uint16_t kaitai::kstream::read_u2be() { + uint16_t t; + m_io->read(reinterpret_cast(&t), 2); +#if __BYTE_ORDER == __LITTLE_ENDIAN + t = bswap_16(t); +#endif + return t; +} + +uint32_t kaitai::kstream::read_u4be() { + uint32_t t; + m_io->read(reinterpret_cast(&t), 4); +#if __BYTE_ORDER == __LITTLE_ENDIAN + t = bswap_32(t); +#endif + return t; +} + +uint64_t kaitai::kstream::read_u8be() { + uint64_t t; + m_io->read(reinterpret_cast(&t), 8); +#if __BYTE_ORDER == __LITTLE_ENDIAN + t = bswap_64(t); +#endif + return t; +} + +// ........................................................................ +// Little-endian +// ........................................................................ + +uint16_t kaitai::kstream::read_u2le() { + uint16_t t; + m_io->read(reinterpret_cast(&t), 2); +#if __BYTE_ORDER == __BIG_ENDIAN + t = bswap_16(t); +#endif + return t; +} + +uint32_t kaitai::kstream::read_u4le() { + uint32_t t; + m_io->read(reinterpret_cast(&t), 4); +#if __BYTE_ORDER == __BIG_ENDIAN + t = bswap_32(t); +#endif + return t; +} + +uint64_t kaitai::kstream::read_u8le() { + uint64_t t; + m_io->read(reinterpret_cast(&t), 8); +#if __BYTE_ORDER == __BIG_ENDIAN + t = bswap_64(t); +#endif + return t; +} + +// ======================================================================== +// Floating point numbers +// ======================================================================== + +// ........................................................................ +// Big-endian +// ........................................................................ + +float kaitai::kstream::read_f4be() { + uint32_t t; + m_io->read(reinterpret_cast(&t), 4); +#if __BYTE_ORDER == __LITTLE_ENDIAN + t = bswap_32(t); +#endif + return reinterpret_cast(t); +} + +double kaitai::kstream::read_f8be() { + uint64_t t; + m_io->read(reinterpret_cast(&t), 8); +#if __BYTE_ORDER == __LITTLE_ENDIAN + t = bswap_64(t); +#endif + return reinterpret_cast(t); +} + +// ........................................................................ +// Little-endian +// ........................................................................ + +float kaitai::kstream::read_f4le() { + uint32_t t; + m_io->read(reinterpret_cast(&t), 4); +#if __BYTE_ORDER == __BIG_ENDIAN + t = bswap_32(t); +#endif + return reinterpret_cast(t); +} + +double kaitai::kstream::read_f8le() { + uint64_t t; + m_io->read(reinterpret_cast(&t), 8); +#if __BYTE_ORDER == __BIG_ENDIAN + t = bswap_64(t); +#endif + return reinterpret_cast(t); +} + +// ======================================================================== +// Unaligned bit values +// ======================================================================== + +void kaitai::kstream::align_to_byte() { + m_bits_left = 0; + m_bits = 0; +} + +uint64_t kaitai::kstream::read_bits_int_be(int n) { + int bits_needed = n - m_bits_left; + if (bits_needed > 0) { + // 1 bit => 1 byte + // 8 bits => 1 byte + // 9 bits => 2 bytes + int bytes_needed = ((bits_needed - 1) / 8) + 1; + if (bytes_needed > 8) + throw std::runtime_error("read_bits_int: more than 8 bytes requested"); + char buf[8]; + m_io->read(buf, bytes_needed); + for (int i = 0; i < bytes_needed; i++) { + uint8_t b = buf[i]; + m_bits <<= 8; + m_bits |= b; + m_bits_left += 8; + } + } + + // raw mask with required number of 1s, starting from lowest bit + uint64_t mask = get_mask_ones(n); + // shift mask to align with highest bits available in @bits + int shift_bits = m_bits_left - n; + mask <<= shift_bits; + // derive reading result + uint64_t res = (m_bits & mask) >> shift_bits; + // clear top bits that we've just read => AND with 1s + m_bits_left -= n; + mask = get_mask_ones(m_bits_left); + m_bits &= mask; + + return res; +} + +// Deprecated, use read_bits_int_be() instead. +uint64_t kaitai::kstream::read_bits_int(int n) { + return read_bits_int_be(n); +} + +uint64_t kaitai::kstream::read_bits_int_le(int n) { + int bits_needed = n - m_bits_left; + if (bits_needed > 0) { + // 1 bit => 1 byte + // 8 bits => 1 byte + // 9 bits => 2 bytes + int bytes_needed = ((bits_needed - 1) / 8) + 1; + if (bytes_needed > 8) + throw std::runtime_error("read_bits_int_le: more than 8 bytes requested"); + char buf[8]; + m_io->read(buf, bytes_needed); + for (int i = 0; i < bytes_needed; i++) { + uint8_t b = buf[i]; + m_bits |= (static_cast(b) << m_bits_left); + m_bits_left += 8; + } + } + + // raw mask with required number of 1s, starting from lowest bit + uint64_t mask = get_mask_ones(n); + // derive reading result + uint64_t res = m_bits & mask; + // remove bottom bits that we've just read by shifting + m_bits >>= n; + m_bits_left -= n; + + return res; +} + +uint64_t kaitai::kstream::get_mask_ones(int n) { + if (n == 64) { + return 0xFFFFFFFFFFFFFFFF; + } else { + return ((uint64_t) 1 << n) - 1; + } +} + +// ======================================================================== +// Byte arrays +// ======================================================================== + +std::string kaitai::kstream::read_bytes(std::streamsize len) { + std::vector result(len); + + // NOTE: streamsize type is signed, negative values are only *supposed* to not be used. + // http://en.cppreference.com/w/cpp/io/streamsize + if (len < 0) { + throw std::runtime_error("read_bytes: requested a negative amount"); + } + + if (len > 0) { + m_io->read(&result[0], len); + } + + return std::string(result.begin(), result.end()); +} + +std::string kaitai::kstream::read_bytes_full() { + std::iostream::pos_type p1 = m_io->tellg(); + m_io->seekg(0, std::ios::end); + std::iostream::pos_type p2 = m_io->tellg(); + size_t len = p2 - p1; + + // Note: this requires a std::string to be backed with a + // contiguous buffer. Officially, it's a only requirement since + // C++11 (C++98 and C++03 didn't have this requirement), but all + // major implementations had contiguous buffers anyway. + std::string result(len, ' '); + m_io->seekg(p1); + m_io->read(&result[0], len); + + return result; +} + +std::string kaitai::kstream::read_bytes_term(char term, bool include, bool consume, bool eos_error) { + std::string result; + std::getline(*m_io, result, term); + if (m_io->eof()) { + // encountered EOF + if (eos_error) { + throw std::runtime_error("read_bytes_term: encountered EOF"); + } + } else { + // encountered terminator + if (include) + result.push_back(term); + if (!consume) + m_io->unget(); + } + return result; +} + +std::string kaitai::kstream::ensure_fixed_contents(std::string expected) { + std::string actual = read_bytes(expected.length()); + + if (actual != expected) { + // NOTE: I think printing it outright is not best idea, it could contain non-ascii charactes like backspace and beeps and whatnot. It would be better to print hexlified version, and also to redirect it to stderr. + throw std::runtime_error("ensure_fixed_contents: actual data does not match expected data"); + } + + return actual; +} + +std::string kaitai::kstream::bytes_strip_right(std::string src, char pad_byte) { + std::size_t new_len = src.length(); + + while (new_len > 0 && src[new_len - 1] == pad_byte) + new_len--; + + return src.substr(0, new_len); +} + +std::string kaitai::kstream::bytes_terminate(std::string src, char term, bool include) { + std::size_t new_len = 0; + std::size_t max_len = src.length(); + + while (new_len < max_len && src[new_len] != term) + new_len++; + + if (include && new_len < max_len) + new_len++; + + return src.substr(0, new_len); +} + +// ======================================================================== +// Byte array processing +// ======================================================================== + +std::string kaitai::kstream::process_xor_one(std::string data, uint8_t key) { + size_t len = data.length(); + std::string result(len, ' '); + + for (size_t i = 0; i < len; i++) + result[i] = data[i] ^ key; + + return result; +} + +std::string kaitai::kstream::process_xor_many(std::string data, std::string key) { + size_t len = data.length(); + size_t kl = key.length(); + std::string result(len, ' '); + + size_t ki = 0; + for (size_t i = 0; i < len; i++) { + result[i] = data[i] ^ key[ki]; + ki++; + if (ki >= kl) + ki = 0; + } + + return result; +} + +std::string kaitai::kstream::process_rotate_left(std::string data, int amount) { + size_t len = data.length(); + std::string result(len, ' '); + + for (size_t i = 0; i < len; i++) { + uint8_t bits = data[i]; + result[i] = (bits << amount) | (bits >> (8 - amount)); + } + + return result; +} + +#ifdef KS_ZLIB +#include + +std::string kaitai::kstream::process_zlib(std::string data) { + int ret; + + unsigned char *src_ptr = reinterpret_cast(&data[0]); + std::stringstream dst_strm; + + z_stream strm; + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + + ret = inflateInit(&strm); + if (ret != Z_OK) + throw std::runtime_error("process_zlib: inflateInit error"); + + strm.next_in = src_ptr; + strm.avail_in = data.length(); + + unsigned char outbuffer[ZLIB_BUF_SIZE]; + std::string outstring; + + // get the decompressed bytes blockwise using repeated calls to inflate + do { + strm.next_out = reinterpret_cast(outbuffer); + strm.avail_out = sizeof(outbuffer); + + ret = inflate(&strm, 0); + + if (outstring.size() < strm.total_out) + outstring.append(reinterpret_cast(outbuffer), strm.total_out - outstring.size()); + } while (ret == Z_OK); + + if (ret != Z_STREAM_END) { // an error occurred that was not EOF + std::ostringstream exc_msg; + exc_msg << "process_zlib: error #" << ret << "): " << strm.msg; + throw std::runtime_error(exc_msg.str()); + } + + if (inflateEnd(&strm) != Z_OK) + throw std::runtime_error("process_zlib: inflateEnd error"); + + return outstring; +} +#endif + +// ======================================================================== +// Misc utility methods +// ======================================================================== + +int kaitai::kstream::mod(int a, int b) { + if (b <= 0) + throw std::invalid_argument("mod: divisor b <= 0"); + int r = a % b; + if (r < 0) + r += b; + return r; +} + +#include +std::string kaitai::kstream::to_string(int val) { + // if int is 32 bits, "-2147483648" is the longest string representation + // => 11 chars + zero => 12 chars + // if int is 64 bits, "-9223372036854775808" is the longest + // => 20 chars + zero => 21 chars + char buf[25]; + int got_len = snprintf(buf, sizeof(buf), "%d", val); + + // should never happen, but check nonetheless + if (got_len > sizeof(buf)) + throw std::invalid_argument("to_string: integer is longer than string buffer"); + + return std::string(buf); +} + +#include +std::string kaitai::kstream::reverse(std::string val) { + std::reverse(val.begin(), val.end()); + + return val; +} + +uint8_t kaitai::kstream::byte_array_min(const std::string val) { + uint8_t min = 0xff; // UINT8_MAX + std::string::const_iterator end = val.end(); + for (std::string::const_iterator it = val.begin(); it != end; ++it) { + uint8_t cur = static_cast(*it); + if (cur < min) { + min = cur; + } + } + return min; +} + +uint8_t kaitai::kstream::byte_array_max(const std::string val) { + uint8_t max = 0; // UINT8_MIN + std::string::const_iterator end = val.end(); + for (std::string::const_iterator it = val.begin(); it != end; ++it) { + uint8_t cur = static_cast(*it); + if (cur > max) { + max = cur; + } + } + return max; +} + +// ======================================================================== +// Other internal methods +// ======================================================================== + +#ifndef KS_STR_DEFAULT_ENCODING +#define KS_STR_DEFAULT_ENCODING "UTF-8" +#endif + +#ifdef KS_STR_ENCODING_ICONV + +#include +#include +#include + +std::string kaitai::kstream::bytes_to_str(std::string src, std::string src_enc) { + iconv_t cd = iconv_open(KS_STR_DEFAULT_ENCODING, src_enc.c_str()); + + if (cd == (iconv_t) -1) { + if (errno == EINVAL) { + throw std::runtime_error("bytes_to_str: invalid encoding pair conversion requested"); + } else { + throw std::runtime_error("bytes_to_str: error opening iconv"); + } + } + + size_t src_len = src.length(); + size_t src_left = src_len; + + // Start with a buffer length of double the source length. + size_t dst_len = src_len * 2; + std::string dst(dst_len, ' '); + size_t dst_left = dst_len; + + char *src_ptr = &src[0]; + char *dst_ptr = &dst[0]; + + while (true) { + size_t res = iconv(cd, &src_ptr, &src_left, &dst_ptr, &dst_left); + + if (res == (size_t) -1) { + if (errno == E2BIG) { + // dst buffer is not enough to accomodate whole string + // enlarge the buffer and try again + size_t dst_used = dst_len - dst_left; + dst_left += dst_len; + dst_len += dst_len; + dst.resize(dst_len); + + // dst.resize might have allocated destination buffer in another area + // of memory, thus our previous pointer "dst" will be invalid; re-point + // it using "dst_used". + dst_ptr = &dst[dst_used]; + } else { + throw std::runtime_error("bytes_to_str: iconv error"); + } + } else { + // conversion successful + dst.resize(dst_len - dst_left); + break; + } + } + + if (iconv_close(cd) != 0) { + throw std::runtime_error("bytes_to_str: iconv close error"); + } + + return dst; +} +#elif defined(KS_STR_ENCODING_NONE) +std::string kaitai::kstream::bytes_to_str(std::string src, std::string src_enc) { + return src; +} +#else +#error Need to decide how to handle strings: please define one of: KS_STR_ENCODING_ICONV, KS_STR_ENCODING_NONE +#endif diff --git a/third_party/kaitai/kaitaistream.h b/third_party/kaitai/kaitaistream.h new file mode 100644 index 000000000..e7f4c6ce3 --- /dev/null +++ b/third_party/kaitai/kaitaistream.h @@ -0,0 +1,268 @@ +#ifndef KAITAI_STREAM_H +#define KAITAI_STREAM_H + +// Kaitai Struct runtime API version: x.y.z = 'xxxyyyzzz' decimal +#define KAITAI_STRUCT_VERSION 9000L + +#include +#include +#include +#include + +namespace kaitai { + +/** + * Kaitai Stream class (kaitai::kstream) is an implementation of + * Kaitai Struct stream API + * for C++/STL. It's implemented as a wrapper over generic STL std::istream. + * + * It provides a wide variety of simple methods to read (parse) binary + * representations of primitive types, such as integer and floating + * point numbers, byte arrays and strings, and also provides stream + * positioning / navigation methods with unified cross-language and + * cross-toolkit semantics. + * + * Typically, end users won't access Kaitai Stream class manually, but would + * describe a binary structure format using .ksy language and then would use + * Kaitai Struct compiler to generate source code in desired target language. + * That code, in turn, would use this class and API to do the actual parsing + * job. + */ +class kstream { +public: + /** + * Constructs new Kaitai Stream object, wrapping a given std::istream. + * \param io istream object to use for this Kaitai Stream + */ + kstream(std::istream* io); + + /** + * Constructs new Kaitai Stream object, wrapping a given in-memory data + * buffer. + * \param data data buffer to use for this Kaitai Stream + */ + kstream(std::string& data); + + void close(); + + /** @name Stream positioning */ + //@{ + /** + * Check if stream pointer is at the end of stream. Note that the semantics + * are different from traditional STL semantics: one does *not* need to do a + * read (which will fail) after the actual end of the stream to trigger EOF + * flag, which can be accessed after that read. It is sufficient to just be + * at the end of the stream for this method to return true. + * \return "true" if we are located at the end of the stream. + */ + bool is_eof() const; + + /** + * Set stream pointer to designated position. + * \param pos new position (offset in bytes from the beginning of the stream) + */ + void seek(uint64_t pos); + + /** + * Get current position of a stream pointer. + * \return pointer position, number of bytes from the beginning of the stream + */ + uint64_t pos(); + + /** + * Get total size of the stream in bytes. + * \return size of the stream in bytes + */ + uint64_t size(); + //@} + + /** @name Integer numbers */ + //@{ + + // ------------------------------------------------------------------------ + // Signed + // ------------------------------------------------------------------------ + + int8_t read_s1(); + + // ........................................................................ + // Big-endian + // ........................................................................ + + int16_t read_s2be(); + int32_t read_s4be(); + int64_t read_s8be(); + + // ........................................................................ + // Little-endian + // ........................................................................ + + int16_t read_s2le(); + int32_t read_s4le(); + int64_t read_s8le(); + + // ------------------------------------------------------------------------ + // Unsigned + // ------------------------------------------------------------------------ + + uint8_t read_u1(); + + // ........................................................................ + // Big-endian + // ........................................................................ + + uint16_t read_u2be(); + uint32_t read_u4be(); + uint64_t read_u8be(); + + // ........................................................................ + // Little-endian + // ........................................................................ + + uint16_t read_u2le(); + uint32_t read_u4le(); + uint64_t read_u8le(); + + //@} + + /** @name Floating point numbers */ + //@{ + + // ........................................................................ + // Big-endian + // ........................................................................ + + float read_f4be(); + double read_f8be(); + + // ........................................................................ + // Little-endian + // ........................................................................ + + float read_f4le(); + double read_f8le(); + + //@} + + /** @name Unaligned bit values */ + //@{ + + void align_to_byte(); + uint64_t read_bits_int_be(int n); + uint64_t read_bits_int(int n); + uint64_t read_bits_int_le(int n); + + //@} + + /** @name Byte arrays */ + //@{ + + std::string read_bytes(std::streamsize len); + std::string read_bytes_full(); + std::string read_bytes_term(char term, bool include, bool consume, bool eos_error); + std::string ensure_fixed_contents(std::string expected); + + static std::string bytes_strip_right(std::string src, char pad_byte); + static std::string bytes_terminate(std::string src, char term, bool include); + static std::string bytes_to_str(std::string src, std::string src_enc); + + //@} + + /** @name Byte array processing */ + //@{ + + /** + * Performs a XOR processing with given data, XORing every byte of input with a single + * given value. + * @param data data to process + * @param key value to XOR with + * @return processed data + */ + static std::string process_xor_one(std::string data, uint8_t key); + + /** + * Performs a XOR processing with given data, XORing every byte of input with a key + * array, repeating key array many times, if necessary (i.e. if data array is longer + * than key array). + * @param data data to process + * @param key array of bytes to XOR with + * @return processed data + */ + static std::string process_xor_many(std::string data, std::string key); + + /** + * Performs a circular left rotation shift for a given buffer by a given amount of bits, + * using groups of 1 bytes each time. Right circular rotation should be performed + * using this procedure with corrected amount. + * @param data source data to process + * @param amount number of bits to shift by + * @return copy of source array with requested shift applied + */ + static std::string process_rotate_left(std::string data, int amount); + +#ifdef KS_ZLIB + /** + * Performs an unpacking ("inflation") of zlib-compressed data with usual zlib headers. + * @param data data to unpack + * @return unpacked data + * @throws IOException + */ + static std::string process_zlib(std::string data); +#endif + + //@} + + /** + * Performs modulo operation between two integers: dividend `a` + * and divisor `b`. Divisor `b` is expected to be positive. The + * result is always 0 <= x <= b - 1. + */ + static int mod(int a, int b); + + /** + * Converts given integer `val` to a decimal string representation. + * Should be used in place of std::to_string() (which is available only + * since C++11) in older C++ implementations. + */ + static std::string to_string(int val); + + /** + * Reverses given string `val`, so that the first character becomes the + * last and the last one becomes the first. This should be used to avoid + * the need of local variables at the caller. + */ + static std::string reverse(std::string val); + + /** + * Finds the minimal byte in a byte array, treating bytes as + * unsigned values. + * @param val byte array to scan + * @return minimal byte in byte array as integer + */ + static uint8_t byte_array_min(const std::string val); + + /** + * Finds the maximal byte in a byte array, treating bytes as + * unsigned values. + * @param val byte array to scan + * @return maximal byte in byte array as integer + */ + static uint8_t byte_array_max(const std::string val); + +private: + std::istream* m_io; + std::istringstream m_io_str; + int m_bits_left; + uint64_t m_bits; + + void init(); + void exceptions_enable() const; + + static uint64_t get_mask_ones(int n); + + static const int ZLIB_BUF_SIZE = 128 * 1024; +}; + +} + +#endif diff --git a/third_party/kaitai/kaitaistruct.h b/third_party/kaitai/kaitaistruct.h new file mode 100644 index 000000000..8172ede6c --- /dev/null +++ b/third_party/kaitai/kaitaistruct.h @@ -0,0 +1,20 @@ +#ifndef KAITAI_STRUCT_H +#define KAITAI_STRUCT_H + +#include + +namespace kaitai { + +class kstruct { +public: + kstruct(kstream *_io) { m__io = _io; } + virtual ~kstruct() {} +protected: + kstream *m__io; +public: + kstream *_io() { return m__io; } +}; + +} + +#endif diff --git a/third_party/libgralloc/include/gralloc_priv.h b/third_party/libgralloc/include/gralloc_priv.h new file mode 100644 index 000000000..4aa47541b --- /dev/null +++ b/third_party/libgralloc/include/gralloc_priv.h @@ -0,0 +1,296 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. + * + * 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 GRALLOC_PRIV_H_ +#define GRALLOC_PRIV_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#define ROUND_UP_PAGESIZE(x) ( (((unsigned long)(x)) + PAGE_SIZE-1) & \ + (~(PAGE_SIZE-1)) ) + +/* Gralloc usage bits indicating the type of allocation that should be used */ +/* SYSTEM heap comes from kernel vmalloc (ION_SYSTEM_HEAP_ID) + * is cached by default and + * is not secured */ + +/* GRALLOC_USAGE_PRIVATE_0 is unused */ + +/* Non linear, Universal Bandwidth Compression */ +#define GRALLOC_USAGE_PRIVATE_ALLOC_UBWC GRALLOC_USAGE_PRIVATE_1 + +/* IOMMU heap comes from manually allocated pages, can be cached/uncached, + * is not secured */ +#define GRALLOC_USAGE_PRIVATE_IOMMU_HEAP GRALLOC_USAGE_PRIVATE_2 + +/* MM heap is a carveout heap for video, can be secured */ +#define GRALLOC_USAGE_PRIVATE_MM_HEAP GRALLOC_USAGE_PRIVATE_3 + +/* ADSP heap is a carveout heap, is not secured */ +#define GRALLOC_USAGE_PRIVATE_ADSP_HEAP 0x01000000 + +/* Set this for allocating uncached memory (using O_DSYNC), + * cannot be used with noncontiguous heaps */ +#define GRALLOC_USAGE_PRIVATE_UNCACHED 0x02000000 + +/* Buffer content should be displayed on an primary display only */ +#define GRALLOC_USAGE_PRIVATE_INTERNAL_ONLY 0x04000000 + +/* Buffer content should be displayed on an external display only */ +#define GRALLOC_USAGE_PRIVATE_EXTERNAL_ONLY 0x08000000 + +/* This flag is set for WFD usecase */ +#define GRALLOC_USAGE_PRIVATE_WFD 0x00200000 + +/* CAMERA heap is a carveout heap for camera, is not secured */ +#define GRALLOC_USAGE_PRIVATE_CAMERA_HEAP 0x00400000 + +/* This flag is used for SECURE display usecase */ +#define GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY 0x00800000 + +/* define Gralloc perform */ +#define GRALLOC_MODULE_PERFORM_CREATE_HANDLE_FROM_BUFFER 1 +// This will be used by the graphics drivers to know if certain features +// are defined in this display HAL. +// Ex: Newer GFX libraries + Older Display HAL +#define GRALLOC_MODULE_PERFORM_GET_STRIDE 2 +#define GRALLOC_MODULE_PERFORM_GET_CUSTOM_STRIDE_FROM_HANDLE 3 +#define GRALLOC_MODULE_PERFORM_GET_CUSTOM_STRIDE_AND_HEIGHT_FROM_HANDLE 4 +#define GRALLOC_MODULE_PERFORM_GET_ATTRIBUTES 5 +#define GRALLOC_MODULE_PERFORM_GET_COLOR_SPACE_FROM_HANDLE 6 +#define GRALLOC_MODULE_PERFORM_GET_YUV_PLANE_INFO 7 +#define GRALLOC_MODULE_PERFORM_GET_MAP_SECURE_BUFFER_INFO 8 +#define GRALLOC_MODULE_PERFORM_GET_UBWC_FLAG 9 +#define GRALLOC_MODULE_PERFORM_GET_RGB_DATA_ADDRESS 10 +#define GRALLOC_MODULE_PERFORM_GET_IGC 11 +#define GRALLOC_MODULE_PERFORM_SET_IGC 12 +#define GRALLOC_MODULE_PERFORM_SET_SINGLE_BUFFER_MODE 13 + +/* OEM specific HAL formats */ + +#define HAL_PIXEL_FORMAT_RGBA_5551 6 +#define HAL_PIXEL_FORMAT_RGBA_4444 7 +#define HAL_PIXEL_FORMAT_NV12_ENCODEABLE 0x102 +#define HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS 0x7FA30C04 +#define HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED 0x7FA30C03 +#define HAL_PIXEL_FORMAT_YCbCr_420_SP 0x109 +#define HAL_PIXEL_FORMAT_YCrCb_420_SP_ADRENO 0x7FA30C01 +#define HAL_PIXEL_FORMAT_YCrCb_422_SP 0x10B +#define HAL_PIXEL_FORMAT_R_8 0x10D +#define HAL_PIXEL_FORMAT_RG_88 0x10E +#define HAL_PIXEL_FORMAT_YCbCr_444_SP 0x10F +#define HAL_PIXEL_FORMAT_YCrCb_444_SP 0x110 +#define HAL_PIXEL_FORMAT_YCrCb_422_I 0x111 +#define HAL_PIXEL_FORMAT_BGRX_8888 0x112 +#define HAL_PIXEL_FORMAT_NV21_ZSL 0x113 +#define HAL_PIXEL_FORMAT_YCrCb_420_SP_VENUS 0x114 +#define HAL_PIXEL_FORMAT_BGR_565 0x115 +#define HAL_PIXEL_FORMAT_INTERLACE 0x180 + +//v4l2_fourcc('Y', 'U', 'Y', 'L'). 24 bpp YUYV 4:2:2 10 bit per component +#define HAL_PIXEL_FORMAT_YCbCr_422_I_10BIT 0x4C595559 + +//v4l2_fourcc('Y', 'B', 'W', 'C'). 10 bit per component. This compressed +//format reduces the memory access bandwidth +#define HAL_PIXEL_FORMAT_YCbCr_422_I_10BIT_COMPRESSED 0x43574259 + +// UBWC aligned Venus format +#define HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS_UBWC 0x7FA30C06 + +//Khronos ASTC formats +#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD + +/* possible values for inverse gamma correction */ +#define HAL_IGC_NOT_SPECIFIED 0 +#define HAL_IGC_s_RGB 1 + +/* possible formats for 3D content*/ +enum { + HAL_NO_3D = 0x0, + HAL_3D_SIDE_BY_SIDE_L_R = 0x1, + HAL_3D_SIDE_BY_SIDE_R_L = 0x2, + HAL_3D_TOP_BOTTOM = 0x4, + HAL_3D_IN_SIDE_BY_SIDE_L_R = 0x10000, //unused legacy format +}; + +enum { + BUFFER_TYPE_UI = 0, + BUFFER_TYPE_VIDEO +}; + +#ifdef __cplusplus +struct private_handle_t : public native_handle { +#else + struct private_handle_t { + native_handle_t nativeHandle; +#endif + enum { + PRIV_FLAGS_FRAMEBUFFER = 0x00000001, + PRIV_FLAGS_USES_ION = 0x00000008, + PRIV_FLAGS_USES_ASHMEM = 0x00000010, + PRIV_FLAGS_NEEDS_FLUSH = 0x00000020, + PRIV_FLAGS_INTERNAL_ONLY = 0x00000040, + PRIV_FLAGS_NON_CPU_WRITER = 0x00000080, + PRIV_FLAGS_NONCONTIGUOUS_MEM = 0x00000100, + PRIV_FLAGS_CACHED = 0x00000200, + PRIV_FLAGS_SECURE_BUFFER = 0x00000400, + // Display on external only + PRIV_FLAGS_EXTERNAL_ONLY = 0x00002000, + // Set by HWC for protected non secure buffers + PRIV_FLAGS_PROTECTED_BUFFER = 0x00004000, + PRIV_FLAGS_VIDEO_ENCODER = 0x00010000, + PRIV_FLAGS_CAMERA_WRITE = 0x00020000, + PRIV_FLAGS_CAMERA_READ = 0x00040000, + PRIV_FLAGS_HW_COMPOSER = 0x00080000, + PRIV_FLAGS_HW_TEXTURE = 0x00100000, + PRIV_FLAGS_ITU_R_601 = 0x00200000, //Unused from display + PRIV_FLAGS_ITU_R_601_FR = 0x00400000, //Unused from display + PRIV_FLAGS_ITU_R_709 = 0x00800000, //Unused from display + PRIV_FLAGS_SECURE_DISPLAY = 0x01000000, + // Buffer is rendered in Tile Format + PRIV_FLAGS_TILE_RENDERED = 0x02000000, + // Buffer rendered using CPU/SW renderer + PRIV_FLAGS_CPU_RENDERED = 0x04000000, + // Buffer is allocated with UBWC alignment + PRIV_FLAGS_UBWC_ALIGNED = 0x08000000, + // Buffer allocated will be consumed by SF/HWC + PRIV_FLAGS_DISP_CONSUMER = 0x10000000 + }; + + // file-descriptors + int fd; + int fd_metadata; // fd for the meta-data + // ints + int magic; + int flags; + unsigned int size; + unsigned int offset; + int bufferType; + uint64_t base __attribute__((aligned(8))); + unsigned int offset_metadata; + // The gpu address mapped into the mmu. + uint64_t gpuaddr __attribute__((aligned(8))); + int format; + int width; // specifies aligned width + int height; // specifies aligned height + int real_width; + int real_height; + uint64_t base_metadata __attribute__((aligned(8))); + +#ifdef __cplusplus + static const int sNumFds = 2; + static inline int sNumInts() { + return ((sizeof(private_handle_t) - sizeof(native_handle_t)) / + sizeof(int)) - sNumFds; + } + static const int sMagic = 'gmsm'; + + private_handle_t(int fd, unsigned int size, int flags, int bufferType, + int format, int aligned_width, int aligned_height, + int width, int height, int eFd = -1, + unsigned int eOffset = 0, uint64_t eBase = 0) : + fd(fd), fd_metadata(eFd), magic(sMagic), + flags(flags), size(size), offset(0), bufferType(bufferType), + base(0), offset_metadata(eOffset), gpuaddr(0), + format(format), width(aligned_width), height(aligned_height), + real_width(width), real_height(height), base_metadata(eBase) + { + version = (int) sizeof(native_handle); + numInts = sNumInts(); + numFds = sNumFds; + } + ~private_handle_t() { + magic = 0; + } + + static int validate(const native_handle* h) { + const private_handle_t* hnd = (const private_handle_t*)h; + if (!h || h->version != sizeof(native_handle) || + h->numInts != sNumInts() || h->numFds != sNumFds || + hnd->magic != sMagic) + { + ALOGD("Invalid gralloc handle (at %p): " + "ver(%d/%zu) ints(%d/%d) fds(%d/%d)" + "magic(%c%c%c%c/%c%c%c%c)", + h, + h ? h->version : -1, sizeof(native_handle), + h ? h->numInts : -1, sNumInts(), + h ? h->numFds : -1, sNumFds, + hnd ? (((hnd->magic >> 24) & 0xFF)? + ((hnd->magic >> 24) & 0xFF) : '-') : '?', + hnd ? (((hnd->magic >> 16) & 0xFF)? + ((hnd->magic >> 16) & 0xFF) : '-') : '?', + hnd ? (((hnd->magic >> 8) & 0xFF)? + ((hnd->magic >> 8) & 0xFF) : '-') : '?', + hnd ? (((hnd->magic >> 0) & 0xFF)? + ((hnd->magic >> 0) & 0xFF) : '-') : '?', + (sMagic >> 24) & 0xFF, + (sMagic >> 16) & 0xFF, + (sMagic >> 8) & 0xFF, + (sMagic >> 0) & 0xFF); + return -EINVAL; + } + return 0; + } + + static private_handle_t* dynamicCast(const native_handle* in) { + if (validate(in) == 0) { + return (private_handle_t*) in; + } + return NULL; + } +#endif + }; + +#endif /* GRALLOC_PRIV_H_ */ diff --git a/third_party/libyuv/include/libyuv.h b/third_party/libyuv/include/libyuv.h new file mode 100644 index 000000000..aeffd5ef7 --- /dev/null +++ b/third_party/libyuv/include/libyuv.h @@ -0,0 +1,32 @@ +/* + * Copyright 2011 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_H_ +#define INCLUDE_LIBYUV_H_ + +#include "libyuv/basic_types.h" +#include "libyuv/compare.h" +#include "libyuv/convert.h" +#include "libyuv/convert_argb.h" +#include "libyuv/convert_from.h" +#include "libyuv/convert_from_argb.h" +#include "libyuv/cpu_id.h" +#include "libyuv/mjpeg_decoder.h" +#include "libyuv/planar_functions.h" +#include "libyuv/rotate.h" +#include "libyuv/rotate_argb.h" +#include "libyuv/row.h" +#include "libyuv/scale.h" +#include "libyuv/scale_argb.h" +#include "libyuv/scale_row.h" +#include "libyuv/version.h" +#include "libyuv/video_common.h" + +#endif // INCLUDE_LIBYUV_H_ diff --git a/third_party/libyuv/include/libyuv/basic_types.h b/third_party/libyuv/include/libyuv/basic_types.h new file mode 100644 index 000000000..5b760ee0d --- /dev/null +++ b/third_party/libyuv/include/libyuv/basic_types.h @@ -0,0 +1,118 @@ +/* + * Copyright 2011 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_BASIC_TYPES_H_ +#define INCLUDE_LIBYUV_BASIC_TYPES_H_ + +#include // for NULL, size_t + +#if defined(_MSC_VER) && (_MSC_VER < 1600) +#include // for uintptr_t on x86 +#else +#include // for uintptr_t +#endif + +#ifndef GG_LONGLONG +#ifndef INT_TYPES_DEFINED +#define INT_TYPES_DEFINED +#ifdef COMPILER_MSVC +typedef unsigned __int64 uint64; +typedef __int64 int64; +#ifndef INT64_C +#define INT64_C(x) x ## I64 +#endif +#ifndef UINT64_C +#define UINT64_C(x) x ## UI64 +#endif +#define INT64_F "I64" +#else // COMPILER_MSVC +#if defined(__LP64__) && !defined(__OpenBSD__) && !defined(__APPLE__) +typedef unsigned long uint64; // NOLINT +typedef long int64; // NOLINT +#ifndef INT64_C +#define INT64_C(x) x ## L +#endif +#ifndef UINT64_C +#define UINT64_C(x) x ## UL +#endif +#define INT64_F "l" +#else // defined(__LP64__) && !defined(__OpenBSD__) && !defined(__APPLE__) +typedef unsigned long long uint64; // NOLINT +typedef long long int64; // NOLINT +#ifndef INT64_C +#define INT64_C(x) x ## LL +#endif +#ifndef UINT64_C +#define UINT64_C(x) x ## ULL +#endif +#define INT64_F "ll" +#endif // __LP64__ +#endif // COMPILER_MSVC +typedef unsigned int uint32; +typedef int int32; +typedef unsigned short uint16; // NOLINT +typedef short int16; // NOLINT +typedef unsigned char uint8; +typedef signed char int8; +#endif // INT_TYPES_DEFINED +#endif // GG_LONGLONG + +// Detect compiler is for x86 or x64. +#if defined(__x86_64__) || defined(_M_X64) || \ + defined(__i386__) || defined(_M_IX86) +#define CPU_X86 1 +#endif +// Detect compiler is for ARM. +#if defined(__arm__) || defined(_M_ARM) +#define CPU_ARM 1 +#endif + +#ifndef ALIGNP +#ifdef __cplusplus +#define ALIGNP(p, t) \ + (reinterpret_cast(((reinterpret_cast(p) + \ + ((t) - 1)) & ~((t) - 1)))) +#else +#define ALIGNP(p, t) \ + ((uint8*)((((uintptr_t)(p) + ((t) - 1)) & ~((t) - 1)))) /* NOLINT */ +#endif +#endif + +#if !defined(LIBYUV_API) +#if defined(_WIN32) || defined(__CYGWIN__) +#if defined(LIBYUV_BUILDING_SHARED_LIBRARY) +#define LIBYUV_API __declspec(dllexport) +#elif defined(LIBYUV_USING_SHARED_LIBRARY) +#define LIBYUV_API __declspec(dllimport) +#else +#define LIBYUV_API +#endif // LIBYUV_BUILDING_SHARED_LIBRARY +#elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__APPLE__) && \ + (defined(LIBYUV_BUILDING_SHARED_LIBRARY) || \ + defined(LIBYUV_USING_SHARED_LIBRARY)) +#define LIBYUV_API __attribute__ ((visibility ("default"))) +#else +#define LIBYUV_API +#endif // __GNUC__ +#endif // LIBYUV_API + +#define LIBYUV_BOOL int +#define LIBYUV_FALSE 0 +#define LIBYUV_TRUE 1 + +// Visual C x86 or GCC little endian. +#if defined(__x86_64__) || defined(_M_X64) || \ + defined(__i386__) || defined(_M_IX86) || \ + defined(__arm__) || defined(_M_ARM) || \ + (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) +#define LIBYUV_LITTLE_ENDIAN +#endif + +#endif // INCLUDE_LIBYUV_BASIC_TYPES_H_ diff --git a/third_party/libyuv/include/libyuv/compare.h b/third_party/libyuv/include/libyuv/compare.h new file mode 100644 index 000000000..550712de6 --- /dev/null +++ b/third_party/libyuv/include/libyuv/compare.h @@ -0,0 +1,78 @@ +/* + * Copyright 2011 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_COMPARE_H_ +#define INCLUDE_LIBYUV_COMPARE_H_ + +#include "libyuv/basic_types.h" + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +// Compute a hash for specified memory. Seed of 5381 recommended. +LIBYUV_API +uint32 HashDjb2(const uint8* src, uint64 count, uint32 seed); + +// Scan an opaque argb image and return fourcc based on alpha offset. +// Returns FOURCC_ARGB, FOURCC_BGRA, or 0 if unknown. +LIBYUV_API +uint32 ARGBDetect(const uint8* argb, int stride_argb, int width, int height); + +// Sum Square Error - used to compute Mean Square Error or PSNR. +LIBYUV_API +uint64 ComputeSumSquareError(const uint8* src_a, + const uint8* src_b, int count); + +LIBYUV_API +uint64 ComputeSumSquareErrorPlane(const uint8* src_a, int stride_a, + const uint8* src_b, int stride_b, + int width, int height); + +static const int kMaxPsnr = 128; + +LIBYUV_API +double SumSquareErrorToPsnr(uint64 sse, uint64 count); + +LIBYUV_API +double CalcFramePsnr(const uint8* src_a, int stride_a, + const uint8* src_b, int stride_b, + int width, int height); + +LIBYUV_API +double I420Psnr(const uint8* src_y_a, int stride_y_a, + const uint8* src_u_a, int stride_u_a, + const uint8* src_v_a, int stride_v_a, + const uint8* src_y_b, int stride_y_b, + const uint8* src_u_b, int stride_u_b, + const uint8* src_v_b, int stride_v_b, + int width, int height); + +LIBYUV_API +double CalcFrameSsim(const uint8* src_a, int stride_a, + const uint8* src_b, int stride_b, + int width, int height); + +LIBYUV_API +double I420Ssim(const uint8* src_y_a, int stride_y_a, + const uint8* src_u_a, int stride_u_a, + const uint8* src_v_a, int stride_v_a, + const uint8* src_y_b, int stride_y_b, + const uint8* src_u_b, int stride_u_b, + const uint8* src_v_b, int stride_v_b, + int width, int height); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_COMPARE_H_ diff --git a/third_party/libyuv/include/libyuv/compare_row.h b/third_party/libyuv/include/libyuv/compare_row.h new file mode 100644 index 000000000..781cad3e6 --- /dev/null +++ b/third_party/libyuv/include/libyuv/compare_row.h @@ -0,0 +1,84 @@ +/* + * Copyright 2013 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_COMPARE_ROW_H_ +#define INCLUDE_LIBYUV_COMPARE_ROW_H_ + +#include "libyuv/basic_types.h" + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +#if defined(__pnacl__) || defined(__CLR_VER) || \ + (defined(__i386__) && !defined(__SSE2__)) +#define LIBYUV_DISABLE_X86 +#endif +// MemorySanitizer does not support assembly code yet. http://crbug.com/344505 +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#define LIBYUV_DISABLE_X86 +#endif +#endif + +// Visual C 2012 required for AVX2. +#if defined(_M_IX86) && !defined(__clang__) && \ + defined(_MSC_VER) && _MSC_VER >= 1700 +#define VISUALC_HAS_AVX2 1 +#endif // VisualStudio >= 2012 + +// clang >= 3.4.0 required for AVX2. +#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) +#if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4)) +#define CLANG_HAS_AVX2 1 +#endif // clang >= 3.4 +#endif // __clang__ + +#if !defined(LIBYUV_DISABLE_X86) && \ + defined(_M_IX86) && (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2)) +#define HAS_HASHDJB2_AVX2 +#endif + +// The following are available for Visual C and GCC: +#if !defined(LIBYUV_DISABLE_X86) && \ + (defined(__x86_64__) || (defined(__i386__) || defined(_M_IX86))) +#define HAS_HASHDJB2_SSE41 +#define HAS_SUMSQUAREERROR_SSE2 +#endif + +// The following are available for Visual C and clangcl 32 bit: +#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \ + (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2)) +#define HAS_HASHDJB2_AVX2 +#define HAS_SUMSQUAREERROR_AVX2 +#endif + +// The following are available for Neon: +#if !defined(LIBYUV_DISABLE_NEON) && \ + (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__)) +#define HAS_SUMSQUAREERROR_NEON +#endif + +uint32 SumSquareError_C(const uint8* src_a, const uint8* src_b, int count); +uint32 SumSquareError_SSE2(const uint8* src_a, const uint8* src_b, int count); +uint32 SumSquareError_AVX2(const uint8* src_a, const uint8* src_b, int count); +uint32 SumSquareError_NEON(const uint8* src_a, const uint8* src_b, int count); + +uint32 HashDjb2_C(const uint8* src, int count, uint32 seed); +uint32 HashDjb2_SSE41(const uint8* src, int count, uint32 seed); +uint32 HashDjb2_AVX2(const uint8* src, int count, uint32 seed); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_COMPARE_ROW_H_ diff --git a/third_party/libyuv/include/libyuv/convert.h b/third_party/libyuv/include/libyuv/convert.h new file mode 100644 index 000000000..d44485847 --- /dev/null +++ b/third_party/libyuv/include/libyuv/convert.h @@ -0,0 +1,259 @@ +/* + * Copyright 2011 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_CONVERT_H_ +#define INCLUDE_LIBYUV_CONVERT_H_ + +#include "libyuv/basic_types.h" + +#include "libyuv/rotate.h" // For enum RotationMode. + +// TODO(fbarchard): fix WebRTC source to include following libyuv headers: +#include "libyuv/convert_argb.h" // For WebRTC I420ToARGB. b/620 +#include "libyuv/convert_from.h" // For WebRTC ConvertFromI420. b/620 +#include "libyuv/planar_functions.h" // For WebRTC I420Rect, CopyPlane. b/618 + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +// Convert I444 to I420. +LIBYUV_API +int I444ToI420(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert I422 to I420. +LIBYUV_API +int I422ToI420(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert I411 to I420. +LIBYUV_API +int I411ToI420(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Copy I420 to I420. +#define I420ToI420 I420Copy +LIBYUV_API +int I420Copy(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert I400 (grey) to I420. +LIBYUV_API +int I400ToI420(const uint8* src_y, int src_stride_y, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +#define J400ToJ420 I400ToI420 + +// Convert NV12 to I420. +LIBYUV_API +int NV12ToI420(const uint8* src_y, int src_stride_y, + const uint8* src_uv, int src_stride_uv, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert NV21 to I420. +LIBYUV_API +int NV21ToI420(const uint8* src_y, int src_stride_y, + const uint8* src_vu, int src_stride_vu, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert YUY2 to I420. +LIBYUV_API +int YUY2ToI420(const uint8* src_yuy2, int src_stride_yuy2, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert UYVY to I420. +LIBYUV_API +int UYVYToI420(const uint8* src_uyvy, int src_stride_uyvy, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert M420 to I420. +LIBYUV_API +int M420ToI420(const uint8* src_m420, int src_stride_m420, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert Android420 to I420. +LIBYUV_API +int Android420ToI420(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + int pixel_stride_uv, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// ARGB little endian (bgra in memory) to I420. +LIBYUV_API +int ARGBToI420(const uint8* src_frame, int src_stride_frame, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// BGRA little endian (argb in memory) to I420. +LIBYUV_API +int BGRAToI420(const uint8* src_frame, int src_stride_frame, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// ABGR little endian (rgba in memory) to I420. +LIBYUV_API +int ABGRToI420(const uint8* src_frame, int src_stride_frame, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// RGBA little endian (abgr in memory) to I420. +LIBYUV_API +int RGBAToI420(const uint8* src_frame, int src_stride_frame, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// RGB little endian (bgr in memory) to I420. +LIBYUV_API +int RGB24ToI420(const uint8* src_frame, int src_stride_frame, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// RGB big endian (rgb in memory) to I420. +LIBYUV_API +int RAWToI420(const uint8* src_frame, int src_stride_frame, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// RGB16 (RGBP fourcc) little endian to I420. +LIBYUV_API +int RGB565ToI420(const uint8* src_frame, int src_stride_frame, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// RGB15 (RGBO fourcc) little endian to I420. +LIBYUV_API +int ARGB1555ToI420(const uint8* src_frame, int src_stride_frame, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// RGB12 (R444 fourcc) little endian to I420. +LIBYUV_API +int ARGB4444ToI420(const uint8* src_frame, int src_stride_frame, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +#ifdef HAVE_JPEG +// src_width/height provided by capture. +// dst_width/height for clipping determine final size. +LIBYUV_API +int MJPGToI420(const uint8* sample, size_t sample_size, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int src_width, int src_height, + int dst_width, int dst_height); + +// Query size of MJPG in pixels. +LIBYUV_API +int MJPGSize(const uint8* sample, size_t sample_size, + int* width, int* height); +#endif + +// Convert camera sample to I420 with cropping, rotation and vertical flip. +// "src_size" is needed to parse MJPG. +// "dst_stride_y" number of bytes in a row of the dst_y plane. +// Normally this would be the same as dst_width, with recommended alignment +// to 16 bytes for better efficiency. +// If rotation of 90 or 270 is used, stride is affected. The caller should +// allocate the I420 buffer according to rotation. +// "dst_stride_u" number of bytes in a row of the dst_u plane. +// Normally this would be the same as (dst_width + 1) / 2, with +// recommended alignment to 16 bytes for better efficiency. +// If rotation of 90 or 270 is used, stride is affected. +// "crop_x" and "crop_y" are starting position for cropping. +// To center, crop_x = (src_width - dst_width) / 2 +// crop_y = (src_height - dst_height) / 2 +// "src_width" / "src_height" is size of src_frame in pixels. +// "src_height" can be negative indicating a vertically flipped image source. +// "crop_width" / "crop_height" is the size to crop the src to. +// Must be less than or equal to src_width/src_height +// Cropping parameters are pre-rotation. +// "rotation" can be 0, 90, 180 or 270. +// "format" is a fourcc. ie 'I420', 'YUY2' +// Returns 0 for successful; -1 for invalid parameter. Non-zero for failure. +LIBYUV_API +int ConvertToI420(const uint8* src_frame, size_t src_size, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int crop_x, int crop_y, + int src_width, int src_height, + int crop_width, int crop_height, + enum RotationMode rotation, + uint32 format); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_CONVERT_H_ diff --git a/third_party/libyuv/include/libyuv/convert_argb.h b/third_party/libyuv/include/libyuv/convert_argb.h new file mode 100644 index 000000000..dc03ac8d5 --- /dev/null +++ b/third_party/libyuv/include/libyuv/convert_argb.h @@ -0,0 +1,319 @@ +/* + * Copyright 2012 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_CONVERT_ARGB_H_ +#define INCLUDE_LIBYUV_CONVERT_ARGB_H_ + +#include "libyuv/basic_types.h" + +#include "libyuv/rotate.h" // For enum RotationMode. + +// TODO(fbarchard): This set of functions should exactly match convert.h +// TODO(fbarchard): Add tests. Create random content of right size and convert +// with C vs Opt and or to I420 and compare. +// TODO(fbarchard): Some of these functions lack parameter setting. + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +// Alias. +#define ARGBToARGB ARGBCopy + +// Copy ARGB to ARGB. +LIBYUV_API +int ARGBCopy(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert I420 to ARGB. +LIBYUV_API +int I420ToARGB(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Duplicate prototype for function in convert_from.h for remoting. +LIBYUV_API +int I420ToABGR(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert I422 to ARGB. +LIBYUV_API +int I422ToARGB(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert I444 to ARGB. +LIBYUV_API +int I444ToARGB(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert J444 to ARGB. +LIBYUV_API +int J444ToARGB(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert I444 to ABGR. +LIBYUV_API +int I444ToABGR(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_abgr, int dst_stride_abgr, + int width, int height); + +// Convert I411 to ARGB. +LIBYUV_API +int I411ToARGB(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert I420 with Alpha to preattenuated ARGB. +LIBYUV_API +int I420AlphaToARGB(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + const uint8* src_a, int src_stride_a, + uint8* dst_argb, int dst_stride_argb, + int width, int height, int attenuate); + +// Convert I420 with Alpha to preattenuated ABGR. +LIBYUV_API +int I420AlphaToABGR(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + const uint8* src_a, int src_stride_a, + uint8* dst_abgr, int dst_stride_abgr, + int width, int height, int attenuate); + +// Convert I400 (grey) to ARGB. Reverse of ARGBToI400. +LIBYUV_API +int I400ToARGB(const uint8* src_y, int src_stride_y, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert J400 (jpeg grey) to ARGB. +LIBYUV_API +int J400ToARGB(const uint8* src_y, int src_stride_y, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Alias. +#define YToARGB I400ToARGB + +// Convert NV12 to ARGB. +LIBYUV_API +int NV12ToARGB(const uint8* src_y, int src_stride_y, + const uint8* src_uv, int src_stride_uv, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert NV21 to ARGB. +LIBYUV_API +int NV21ToARGB(const uint8* src_y, int src_stride_y, + const uint8* src_vu, int src_stride_vu, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert M420 to ARGB. +LIBYUV_API +int M420ToARGB(const uint8* src_m420, int src_stride_m420, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert YUY2 to ARGB. +LIBYUV_API +int YUY2ToARGB(const uint8* src_yuy2, int src_stride_yuy2, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert UYVY to ARGB. +LIBYUV_API +int UYVYToARGB(const uint8* src_uyvy, int src_stride_uyvy, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert J420 to ARGB. +LIBYUV_API +int J420ToARGB(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert J422 to ARGB. +LIBYUV_API +int J422ToARGB(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert J420 to ABGR. +LIBYUV_API +int J420ToABGR(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_abgr, int dst_stride_abgr, + int width, int height); + +// Convert J422 to ABGR. +LIBYUV_API +int J422ToABGR(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_abgr, int dst_stride_abgr, + int width, int height); + +// Convert H420 to ARGB. +LIBYUV_API +int H420ToARGB(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert H422 to ARGB. +LIBYUV_API +int H422ToARGB(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert H420 to ABGR. +LIBYUV_API +int H420ToABGR(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_abgr, int dst_stride_abgr, + int width, int height); + +// Convert H422 to ABGR. +LIBYUV_API +int H422ToABGR(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_abgr, int dst_stride_abgr, + int width, int height); + +// BGRA little endian (argb in memory) to ARGB. +LIBYUV_API +int BGRAToARGB(const uint8* src_frame, int src_stride_frame, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// ABGR little endian (rgba in memory) to ARGB. +LIBYUV_API +int ABGRToARGB(const uint8* src_frame, int src_stride_frame, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// RGBA little endian (abgr in memory) to ARGB. +LIBYUV_API +int RGBAToARGB(const uint8* src_frame, int src_stride_frame, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Deprecated function name. +#define BG24ToARGB RGB24ToARGB + +// RGB little endian (bgr in memory) to ARGB. +LIBYUV_API +int RGB24ToARGB(const uint8* src_frame, int src_stride_frame, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// RGB big endian (rgb in memory) to ARGB. +LIBYUV_API +int RAWToARGB(const uint8* src_frame, int src_stride_frame, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// RGB16 (RGBP fourcc) little endian to ARGB. +LIBYUV_API +int RGB565ToARGB(const uint8* src_frame, int src_stride_frame, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// RGB15 (RGBO fourcc) little endian to ARGB. +LIBYUV_API +int ARGB1555ToARGB(const uint8* src_frame, int src_stride_frame, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// RGB12 (R444 fourcc) little endian to ARGB. +LIBYUV_API +int ARGB4444ToARGB(const uint8* src_frame, int src_stride_frame, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +#ifdef HAVE_JPEG +// src_width/height provided by capture +// dst_width/height for clipping determine final size. +LIBYUV_API +int MJPGToARGB(const uint8* sample, size_t sample_size, + uint8* dst_argb, int dst_stride_argb, + int src_width, int src_height, + int dst_width, int dst_height); +#endif + +// Convert camera sample to ARGB with cropping, rotation and vertical flip. +// "src_size" is needed to parse MJPG. +// "dst_stride_argb" number of bytes in a row of the dst_argb plane. +// Normally this would be the same as dst_width, with recommended alignment +// to 16 bytes for better efficiency. +// If rotation of 90 or 270 is used, stride is affected. The caller should +// allocate the I420 buffer according to rotation. +// "dst_stride_u" number of bytes in a row of the dst_u plane. +// Normally this would be the same as (dst_width + 1) / 2, with +// recommended alignment to 16 bytes for better efficiency. +// If rotation of 90 or 270 is used, stride is affected. +// "crop_x" and "crop_y" are starting position for cropping. +// To center, crop_x = (src_width - dst_width) / 2 +// crop_y = (src_height - dst_height) / 2 +// "src_width" / "src_height" is size of src_frame in pixels. +// "src_height" can be negative indicating a vertically flipped image source. +// "crop_width" / "crop_height" is the size to crop the src to. +// Must be less than or equal to src_width/src_height +// Cropping parameters are pre-rotation. +// "rotation" can be 0, 90, 180 or 270. +// "format" is a fourcc. ie 'I420', 'YUY2' +// Returns 0 for successful; -1 for invalid parameter. Non-zero for failure. +LIBYUV_API +int ConvertToARGB(const uint8* src_frame, size_t src_size, + uint8* dst_argb, int dst_stride_argb, + int crop_x, int crop_y, + int src_width, int src_height, + int crop_width, int crop_height, + enum RotationMode rotation, + uint32 format); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_CONVERT_ARGB_H_ diff --git a/third_party/libyuv/include/libyuv/convert_from.h b/third_party/libyuv/include/libyuv/convert_from.h new file mode 100644 index 000000000..59c40474f --- /dev/null +++ b/third_party/libyuv/include/libyuv/convert_from.h @@ -0,0 +1,179 @@ +/* + * Copyright 2011 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_CONVERT_FROM_H_ +#define INCLUDE_LIBYUV_CONVERT_FROM_H_ + +#include "libyuv/basic_types.h" +#include "libyuv/rotate.h" + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +// See Also convert.h for conversions from formats to I420. + +// I420Copy in convert to I420ToI420. + +LIBYUV_API +int I420ToI422(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +LIBYUV_API +int I420ToI444(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +LIBYUV_API +int I420ToI411(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Copy to I400. Source can be I420, I422, I444, I400, NV12 or NV21. +LIBYUV_API +int I400Copy(const uint8* src_y, int src_stride_y, + uint8* dst_y, int dst_stride_y, + int width, int height); + +LIBYUV_API +int I420ToNV12(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_y, int dst_stride_y, + uint8* dst_uv, int dst_stride_uv, + int width, int height); + +LIBYUV_API +int I420ToNV21(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_y, int dst_stride_y, + uint8* dst_vu, int dst_stride_vu, + int width, int height); + +LIBYUV_API +int I420ToYUY2(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_frame, int dst_stride_frame, + int width, int height); + +LIBYUV_API +int I420ToUYVY(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_frame, int dst_stride_frame, + int width, int height); + +LIBYUV_API +int I420ToARGB(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +LIBYUV_API +int I420ToBGRA(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +LIBYUV_API +int I420ToABGR(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +LIBYUV_API +int I420ToRGBA(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_rgba, int dst_stride_rgba, + int width, int height); + +LIBYUV_API +int I420ToRGB24(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_frame, int dst_stride_frame, + int width, int height); + +LIBYUV_API +int I420ToRAW(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_frame, int dst_stride_frame, + int width, int height); + +LIBYUV_API +int I420ToRGB565(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_frame, int dst_stride_frame, + int width, int height); + +// Convert I420 To RGB565 with 4x4 dither matrix (16 bytes). +// Values in dither matrix from 0 to 7 recommended. +// The order of the dither matrix is first byte is upper left. + +LIBYUV_API +int I420ToRGB565Dither(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_frame, int dst_stride_frame, + const uint8* dither4x4, int width, int height); + +LIBYUV_API +int I420ToARGB1555(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_frame, int dst_stride_frame, + int width, int height); + +LIBYUV_API +int I420ToARGB4444(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_frame, int dst_stride_frame, + int width, int height); + +// Convert I420 to specified format. +// "dst_sample_stride" is bytes in a row for the destination. Pass 0 if the +// buffer has contiguous rows. Can be negative. A multiple of 16 is optimal. +LIBYUV_API +int ConvertFromI420(const uint8* y, int y_stride, + const uint8* u, int u_stride, + const uint8* v, int v_stride, + uint8* dst_sample, int dst_sample_stride, + int width, int height, + uint32 format); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_CONVERT_FROM_H_ diff --git a/third_party/libyuv/include/libyuv/convert_from_argb.h b/third_party/libyuv/include/libyuv/convert_from_argb.h new file mode 100644 index 000000000..8d7f02f8c --- /dev/null +++ b/third_party/libyuv/include/libyuv/convert_from_argb.h @@ -0,0 +1,190 @@ +/* + * Copyright 2012 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_ +#define INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_ + +#include "libyuv/basic_types.h" + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +// Copy ARGB to ARGB. +#define ARGBToARGB ARGBCopy +LIBYUV_API +int ARGBCopy(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert ARGB To BGRA. +LIBYUV_API +int ARGBToBGRA(const uint8* src_argb, int src_stride_argb, + uint8* dst_bgra, int dst_stride_bgra, + int width, int height); + +// Convert ARGB To ABGR. +LIBYUV_API +int ARGBToABGR(const uint8* src_argb, int src_stride_argb, + uint8* dst_abgr, int dst_stride_abgr, + int width, int height); + +// Convert ARGB To RGBA. +LIBYUV_API +int ARGBToRGBA(const uint8* src_argb, int src_stride_argb, + uint8* dst_rgba, int dst_stride_rgba, + int width, int height); + +// Convert ARGB To RGB24. +LIBYUV_API +int ARGBToRGB24(const uint8* src_argb, int src_stride_argb, + uint8* dst_rgb24, int dst_stride_rgb24, + int width, int height); + +// Convert ARGB To RAW. +LIBYUV_API +int ARGBToRAW(const uint8* src_argb, int src_stride_argb, + uint8* dst_rgb, int dst_stride_rgb, + int width, int height); + +// Convert ARGB To RGB565. +LIBYUV_API +int ARGBToRGB565(const uint8* src_argb, int src_stride_argb, + uint8* dst_rgb565, int dst_stride_rgb565, + int width, int height); + +// Convert ARGB To RGB565 with 4x4 dither matrix (16 bytes). +// Values in dither matrix from 0 to 7 recommended. +// The order of the dither matrix is first byte is upper left. +// TODO(fbarchard): Consider pointer to 2d array for dither4x4. +// const uint8(*dither)[4][4]; +LIBYUV_API +int ARGBToRGB565Dither(const uint8* src_argb, int src_stride_argb, + uint8* dst_rgb565, int dst_stride_rgb565, + const uint8* dither4x4, int width, int height); + +// Convert ARGB To ARGB1555. +LIBYUV_API +int ARGBToARGB1555(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb1555, int dst_stride_argb1555, + int width, int height); + +// Convert ARGB To ARGB4444. +LIBYUV_API +int ARGBToARGB4444(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb4444, int dst_stride_argb4444, + int width, int height); + +// Convert ARGB To I444. +LIBYUV_API +int ARGBToI444(const uint8* src_argb, int src_stride_argb, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert ARGB To I422. +LIBYUV_API +int ARGBToI422(const uint8* src_argb, int src_stride_argb, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert ARGB To I420. (also in convert.h) +LIBYUV_API +int ARGBToI420(const uint8* src_argb, int src_stride_argb, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert ARGB to J420. (JPeg full range I420). +LIBYUV_API +int ARGBToJ420(const uint8* src_argb, int src_stride_argb, + uint8* dst_yj, int dst_stride_yj, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert ARGB to J422. +LIBYUV_API +int ARGBToJ422(const uint8* src_argb, int src_stride_argb, + uint8* dst_yj, int dst_stride_yj, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert ARGB To I411. +LIBYUV_API +int ARGBToI411(const uint8* src_argb, int src_stride_argb, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert ARGB to J400. (JPeg full range). +LIBYUV_API +int ARGBToJ400(const uint8* src_argb, int src_stride_argb, + uint8* dst_yj, int dst_stride_yj, + int width, int height); + +// Convert ARGB to I400. +LIBYUV_API +int ARGBToI400(const uint8* src_argb, int src_stride_argb, + uint8* dst_y, int dst_stride_y, + int width, int height); + +// Convert ARGB to G. (Reverse of J400toARGB, which replicates G back to ARGB) +LIBYUV_API +int ARGBToG(const uint8* src_argb, int src_stride_argb, + uint8* dst_g, int dst_stride_g, + int width, int height); + +// Convert ARGB To NV12. +LIBYUV_API +int ARGBToNV12(const uint8* src_argb, int src_stride_argb, + uint8* dst_y, int dst_stride_y, + uint8* dst_uv, int dst_stride_uv, + int width, int height); + +// Convert ARGB To NV21. +LIBYUV_API +int ARGBToNV21(const uint8* src_argb, int src_stride_argb, + uint8* dst_y, int dst_stride_y, + uint8* dst_vu, int dst_stride_vu, + int width, int height); + +// Convert ARGB To NV21. +LIBYUV_API +int ARGBToNV21(const uint8* src_argb, int src_stride_argb, + uint8* dst_y, int dst_stride_y, + uint8* dst_vu, int dst_stride_vu, + int width, int height); + +// Convert ARGB To YUY2. +LIBYUV_API +int ARGBToYUY2(const uint8* src_argb, int src_stride_argb, + uint8* dst_yuy2, int dst_stride_yuy2, + int width, int height); + +// Convert ARGB To UYVY. +LIBYUV_API +int ARGBToUYVY(const uint8* src_argb, int src_stride_argb, + uint8* dst_uyvy, int dst_stride_uyvy, + int width, int height); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_ diff --git a/third_party/libyuv/include/libyuv/cpu_id.h b/third_party/libyuv/include/libyuv/cpu_id.h new file mode 100644 index 000000000..7c6c9aeb0 --- /dev/null +++ b/third_party/libyuv/include/libyuv/cpu_id.h @@ -0,0 +1,81 @@ +/* + * Copyright 2011 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_CPU_ID_H_ +#define INCLUDE_LIBYUV_CPU_ID_H_ + +#include "libyuv/basic_types.h" + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +// Internal flag to indicate cpuid requires initialization. +static const int kCpuInitialized = 0x1; + +// These flags are only valid on ARM processors. +static const int kCpuHasARM = 0x2; +static const int kCpuHasNEON = 0x4; +// 0x8 reserved for future ARM flag. + +// These flags are only valid on x86 processors. +static const int kCpuHasX86 = 0x10; +static const int kCpuHasSSE2 = 0x20; +static const int kCpuHasSSSE3 = 0x40; +static const int kCpuHasSSE41 = 0x80; +static const int kCpuHasSSE42 = 0x100; +static const int kCpuHasAVX = 0x200; +static const int kCpuHasAVX2 = 0x400; +static const int kCpuHasERMS = 0x800; +static const int kCpuHasFMA3 = 0x1000; +static const int kCpuHasAVX3 = 0x2000; +// 0x2000, 0x4000, 0x8000 reserved for future X86 flags. + +// These flags are only valid on MIPS processors. +static const int kCpuHasMIPS = 0x10000; +static const int kCpuHasDSPR2 = 0x20000; +static const int kCpuHasMSA = 0x40000; + +// Internal function used to auto-init. +LIBYUV_API +int InitCpuFlags(void); + +// Internal function for parsing /proc/cpuinfo. +LIBYUV_API +int ArmCpuCaps(const char* cpuinfo_name); + +// Detect CPU has SSE2 etc. +// Test_flag parameter should be one of kCpuHas constants above. +// returns non-zero if instruction set is detected +static __inline int TestCpuFlag(int test_flag) { + LIBYUV_API extern int cpu_info_; + return (!cpu_info_ ? InitCpuFlags() : cpu_info_) & test_flag; +} + +// For testing, allow CPU flags to be disabled. +// ie MaskCpuFlags(~kCpuHasSSSE3) to disable SSSE3. +// MaskCpuFlags(-1) to enable all cpu specific optimizations. +// MaskCpuFlags(1) to disable all cpu specific optimizations. +LIBYUV_API +void MaskCpuFlags(int enable_flags); + +// Low level cpuid for X86. Returns zeros on other CPUs. +// eax is the info type that you want. +// ecx is typically the cpu number, and should normally be zero. +LIBYUV_API +void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_CPU_ID_H_ diff --git a/third_party/libyuv/include/libyuv/macros_msa.h b/third_party/libyuv/include/libyuv/macros_msa.h new file mode 100644 index 000000000..92ed21c38 --- /dev/null +++ b/third_party/libyuv/include/libyuv/macros_msa.h @@ -0,0 +1,76 @@ +/* + * Copyright 2016 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_MACROS_MSA_H_ +#define INCLUDE_LIBYUV_MACROS_MSA_H_ + +#if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa) +#include +#include + +#define LD_B(RTYPE, psrc) *((RTYPE*)(psrc)) /* NOLINT */ +#define LD_UB(...) LD_B(v16u8, __VA_ARGS__) + +#define ST_B(RTYPE, in, pdst) *((RTYPE*)(pdst)) = (in) /* NOLINT */ +#define ST_UB(...) ST_B(v16u8, __VA_ARGS__) + +/* Description : Load two vectors with 16 'byte' sized elements + Arguments : Inputs - psrc, stride + Outputs - out0, out1 + Return Type - as per RTYPE + Details : Load 16 byte elements in 'out0' from (psrc) + Load 16 byte elements in 'out1' from (psrc + stride) +*/ +#define LD_B2(RTYPE, psrc, stride, out0, out1) { \ + out0 = LD_B(RTYPE, (psrc)); \ + out1 = LD_B(RTYPE, (psrc) + stride); \ +} +#define LD_UB2(...) LD_B2(v16u8, __VA_ARGS__) + +#define LD_B4(RTYPE, psrc, stride, out0, out1, out2, out3) { \ + LD_B2(RTYPE, (psrc), stride, out0, out1); \ + LD_B2(RTYPE, (psrc) + 2 * stride , stride, out2, out3); \ +} +#define LD_UB4(...) LD_B4(v16u8, __VA_ARGS__) + +/* Description : Store two vectors with stride each having 16 'byte' sized + elements + Arguments : Inputs - in0, in1, pdst, stride + Details : Store 16 byte elements from 'in0' to (pdst) + Store 16 byte elements from 'in1' to (pdst + stride) +*/ +#define ST_B2(RTYPE, in0, in1, pdst, stride) { \ + ST_B(RTYPE, in0, (pdst)); \ + ST_B(RTYPE, in1, (pdst) + stride); \ +} +#define ST_UB2(...) ST_B2(v16u8, __VA_ARGS__) +# +#define ST_B4(RTYPE, in0, in1, in2, in3, pdst, stride) { \ + ST_B2(RTYPE, in0, in1, (pdst), stride); \ + ST_B2(RTYPE, in2, in3, (pdst) + 2 * stride, stride); \ +} +#define ST_UB4(...) ST_B4(v16u8, __VA_ARGS__) +# +/* Description : Shuffle byte vector elements as per mask vector + Arguments : Inputs - in0, in1, in2, in3, mask0, mask1 + Outputs - out0, out1 + Return Type - as per RTYPE + Details : Byte elements from 'in0' & 'in1' are copied selectively to + 'out0' as per control vector 'mask0' +*/ +#define VSHF_B2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) { \ + out0 = (RTYPE) __msa_vshf_b((v16i8) mask0, (v16i8) in1, (v16i8) in0); \ + out1 = (RTYPE) __msa_vshf_b((v16i8) mask1, (v16i8) in3, (v16i8) in2); \ +} +#define VSHF_B2_UB(...) VSHF_B2(v16u8, __VA_ARGS__) + +#endif /* !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa) */ + +#endif // INCLUDE_LIBYUV_MACROS_MSA_H_ diff --git a/third_party/libyuv/include/libyuv/mjpeg_decoder.h b/third_party/libyuv/include/libyuv/mjpeg_decoder.h new file mode 100644 index 000000000..4975bae5b --- /dev/null +++ b/third_party/libyuv/include/libyuv/mjpeg_decoder.h @@ -0,0 +1,192 @@ +/* + * Copyright 2012 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_MJPEG_DECODER_H_ +#define INCLUDE_LIBYUV_MJPEG_DECODER_H_ + +#include "libyuv/basic_types.h" + +#ifdef __cplusplus +// NOTE: For a simplified public API use convert.h MJPGToI420(). + +struct jpeg_common_struct; +struct jpeg_decompress_struct; +struct jpeg_source_mgr; + +namespace libyuv { + +#ifdef __cplusplus +extern "C" { +#endif + +LIBYUV_BOOL ValidateJpeg(const uint8* sample, size_t sample_size); + +#ifdef __cplusplus +} // extern "C" +#endif + +static const uint32 kUnknownDataSize = 0xFFFFFFFF; + +enum JpegSubsamplingType { + kJpegYuv420, + kJpegYuv422, + kJpegYuv411, + kJpegYuv444, + kJpegYuv400, + kJpegUnknown +}; + +struct Buffer { + const uint8* data; + int len; +}; + +struct BufferVector { + Buffer* buffers; + int len; + int pos; +}; + +struct SetJmpErrorMgr; + +// MJPEG ("Motion JPEG") is a pseudo-standard video codec where the frames are +// simply independent JPEG images with a fixed huffman table (which is omitted). +// It is rarely used in video transmission, but is common as a camera capture +// format, especially in Logitech devices. This class implements a decoder for +// MJPEG frames. +// +// See http://tools.ietf.org/html/rfc2435 +class LIBYUV_API MJpegDecoder { + public: + typedef void (*CallbackFunction)(void* opaque, + const uint8* const* data, + const int* strides, + int rows); + + static const int kColorSpaceUnknown; + static const int kColorSpaceGrayscale; + static const int kColorSpaceRgb; + static const int kColorSpaceYCbCr; + static const int kColorSpaceCMYK; + static const int kColorSpaceYCCK; + + MJpegDecoder(); + ~MJpegDecoder(); + + // Loads a new frame, reads its headers, and determines the uncompressed + // image format. + // Returns LIBYUV_TRUE if image looks valid and format is supported. + // If return value is LIBYUV_TRUE, then the values for all the following + // getters are populated. + // src_len is the size of the compressed mjpeg frame in bytes. + LIBYUV_BOOL LoadFrame(const uint8* src, size_t src_len); + + // Returns width of the last loaded frame in pixels. + int GetWidth(); + + // Returns height of the last loaded frame in pixels. + int GetHeight(); + + // Returns format of the last loaded frame. The return value is one of the + // kColorSpace* constants. + int GetColorSpace(); + + // Number of color components in the color space. + int GetNumComponents(); + + // Sample factors of the n-th component. + int GetHorizSampFactor(int component); + + int GetVertSampFactor(int component); + + int GetHorizSubSampFactor(int component); + + int GetVertSubSampFactor(int component); + + // Public for testability. + int GetImageScanlinesPerImcuRow(); + + // Public for testability. + int GetComponentScanlinesPerImcuRow(int component); + + // Width of a component in bytes. + int GetComponentWidth(int component); + + // Height of a component. + int GetComponentHeight(int component); + + // Width of a component in bytes with padding for DCTSIZE. Public for testing. + int GetComponentStride(int component); + + // Size of a component in bytes. + int GetComponentSize(int component); + + // Call this after LoadFrame() if you decide you don't want to decode it + // after all. + LIBYUV_BOOL UnloadFrame(); + + // Decodes the entire image into a one-buffer-per-color-component format. + // dst_width must match exactly. dst_height must be <= to image height; if + // less, the image is cropped. "planes" must have size equal to at least + // GetNumComponents() and they must point to non-overlapping buffers of size + // at least GetComponentSize(i). The pointers in planes are incremented + // to point to after the end of the written data. + // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded. + LIBYUV_BOOL DecodeToBuffers(uint8** planes, int dst_width, int dst_height); + + // Decodes the entire image and passes the data via repeated calls to a + // callback function. Each call will get the data for a whole number of + // image scanlines. + // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded. + LIBYUV_BOOL DecodeToCallback(CallbackFunction fn, void* opaque, + int dst_width, int dst_height); + + // The helper function which recognizes the jpeg sub-sampling type. + static JpegSubsamplingType JpegSubsamplingTypeHelper( + int* subsample_x, int* subsample_y, int number_of_components); + + private: + void AllocOutputBuffers(int num_outbufs); + void DestroyOutputBuffers(); + + LIBYUV_BOOL StartDecode(); + LIBYUV_BOOL FinishDecode(); + + void SetScanlinePointers(uint8** data); + LIBYUV_BOOL DecodeImcuRow(); + + int GetComponentScanlinePadding(int component); + + // A buffer holding the input data for a frame. + Buffer buf_; + BufferVector buf_vec_; + + jpeg_decompress_struct* decompress_struct_; + jpeg_source_mgr* source_mgr_; + SetJmpErrorMgr* error_mgr_; + + // LIBYUV_TRUE iff at least one component has scanline padding. (i.e., + // GetComponentScanlinePadding() != 0.) + LIBYUV_BOOL has_scanline_padding_; + + // Temporaries used to point to scanline outputs. + int num_outbufs_; // Outermost size of all arrays below. + uint8*** scanlines_; + int* scanlines_sizes_; + // Temporary buffer used for decoding when we can't decode directly to the + // output buffers. Large enough for just one iMCU row. + uint8** databuf_; + int* databuf_strides_; +}; + +} // namespace libyuv + +#endif // __cplusplus +#endif // INCLUDE_LIBYUV_MJPEG_DECODER_H_ diff --git a/third_party/libyuv/include/libyuv/planar_functions.h b/third_party/libyuv/include/libyuv/planar_functions.h new file mode 100644 index 000000000..1b57b2926 --- /dev/null +++ b/third_party/libyuv/include/libyuv/planar_functions.h @@ -0,0 +1,529 @@ +/* + * Copyright 2011 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ +#define INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ + +#include "libyuv/basic_types.h" + +// TODO(fbarchard): Remove the following headers includes. +#include "libyuv/convert.h" +#include "libyuv/convert_argb.h" + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +// Copy a plane of data. +LIBYUV_API +void CopyPlane(const uint8* src_y, int src_stride_y, + uint8* dst_y, int dst_stride_y, + int width, int height); + +LIBYUV_API +void CopyPlane_16(const uint16* src_y, int src_stride_y, + uint16* dst_y, int dst_stride_y, + int width, int height); + +// Set a plane of data to a 32 bit value. +LIBYUV_API +void SetPlane(uint8* dst_y, int dst_stride_y, + int width, int height, + uint32 value); + +// Split interleaved UV plane into separate U and V planes. +LIBYUV_API +void SplitUVPlane(const uint8* src_uv, int src_stride_uv, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Merge separate U and V planes into one interleaved UV plane. +LIBYUV_API +void MergeUVPlane(const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_uv, int dst_stride_uv, + int width, int height); + +// Copy I400. Supports inverting. +LIBYUV_API +int I400ToI400(const uint8* src_y, int src_stride_y, + uint8* dst_y, int dst_stride_y, + int width, int height); + +#define J400ToJ400 I400ToI400 + +// Copy I422 to I422. +#define I422ToI422 I422Copy +LIBYUV_API +int I422Copy(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Copy I444 to I444. +#define I444ToI444 I444Copy +LIBYUV_API +int I444Copy(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert YUY2 to I422. +LIBYUV_API +int YUY2ToI422(const uint8* src_yuy2, int src_stride_yuy2, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Convert UYVY to I422. +LIBYUV_API +int UYVYToI422(const uint8* src_uyvy, int src_stride_uyvy, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +LIBYUV_API +int YUY2ToNV12(const uint8* src_yuy2, int src_stride_yuy2, + uint8* dst_y, int dst_stride_y, + uint8* dst_uv, int dst_stride_uv, + int width, int height); + +LIBYUV_API +int UYVYToNV12(const uint8* src_uyvy, int src_stride_uyvy, + uint8* dst_y, int dst_stride_y, + uint8* dst_uv, int dst_stride_uv, + int width, int height); + +// Convert I420 to I400. (calls CopyPlane ignoring u/v). +LIBYUV_API +int I420ToI400(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_y, int dst_stride_y, + int width, int height); + +// Alias +#define J420ToJ400 I420ToI400 +#define I420ToI420Mirror I420Mirror + +// I420 mirror. +LIBYUV_API +int I420Mirror(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Alias +#define I400ToI400Mirror I400Mirror + +// I400 mirror. A single plane is mirrored horizontally. +// Pass negative height to achieve 180 degree rotation. +LIBYUV_API +int I400Mirror(const uint8* src_y, int src_stride_y, + uint8* dst_y, int dst_stride_y, + int width, int height); + +// Alias +#define ARGBToARGBMirror ARGBMirror + +// ARGB mirror. +LIBYUV_API +int ARGBMirror(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert NV12 to RGB565. +LIBYUV_API +int NV12ToRGB565(const uint8* src_y, int src_stride_y, + const uint8* src_uv, int src_stride_uv, + uint8* dst_rgb565, int dst_stride_rgb565, + int width, int height); + +// I422ToARGB is in convert_argb.h +// Convert I422 to BGRA. +LIBYUV_API +int I422ToBGRA(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_bgra, int dst_stride_bgra, + int width, int height); + +// Convert I422 to ABGR. +LIBYUV_API +int I422ToABGR(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_abgr, int dst_stride_abgr, + int width, int height); + +// Convert I422 to RGBA. +LIBYUV_API +int I422ToRGBA(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_rgba, int dst_stride_rgba, + int width, int height); + +// Alias +#define RGB24ToRAW RAWToRGB24 + +LIBYUV_API +int RAWToRGB24(const uint8* src_raw, int src_stride_raw, + uint8* dst_rgb24, int dst_stride_rgb24, + int width, int height); + +// Draw a rectangle into I420. +LIBYUV_API +int I420Rect(uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int x, int y, int width, int height, + int value_y, int value_u, int value_v); + +// Draw a rectangle into ARGB. +LIBYUV_API +int ARGBRect(uint8* dst_argb, int dst_stride_argb, + int x, int y, int width, int height, uint32 value); + +// Convert ARGB to gray scale ARGB. +LIBYUV_API +int ARGBGrayTo(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Make a rectangle of ARGB gray scale. +LIBYUV_API +int ARGBGray(uint8* dst_argb, int dst_stride_argb, + int x, int y, int width, int height); + +// Make a rectangle of ARGB Sepia tone. +LIBYUV_API +int ARGBSepia(uint8* dst_argb, int dst_stride_argb, + int x, int y, int width, int height); + +// Apply a matrix rotation to each ARGB pixel. +// matrix_argb is 4 signed ARGB values. -128 to 127 representing -2 to 2. +// The first 4 coefficients apply to B, G, R, A and produce B of the output. +// The next 4 coefficients apply to B, G, R, A and produce G of the output. +// The next 4 coefficients apply to B, G, R, A and produce R of the output. +// The last 4 coefficients apply to B, G, R, A and produce A of the output. +LIBYUV_API +int ARGBColorMatrix(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + const int8* matrix_argb, + int width, int height); + +// Deprecated. Use ARGBColorMatrix instead. +// Apply a matrix rotation to each ARGB pixel. +// matrix_argb is 3 signed ARGB values. -128 to 127 representing -1 to 1. +// The first 4 coefficients apply to B, G, R, A and produce B of the output. +// The next 4 coefficients apply to B, G, R, A and produce G of the output. +// The last 4 coefficients apply to B, G, R, A and produce R of the output. +LIBYUV_API +int RGBColorMatrix(uint8* dst_argb, int dst_stride_argb, + const int8* matrix_rgb, + int x, int y, int width, int height); + +// Apply a color table each ARGB pixel. +// Table contains 256 ARGB values. +LIBYUV_API +int ARGBColorTable(uint8* dst_argb, int dst_stride_argb, + const uint8* table_argb, + int x, int y, int width, int height); + +// Apply a color table each ARGB pixel but preserve destination alpha. +// Table contains 256 ARGB values. +LIBYUV_API +int RGBColorTable(uint8* dst_argb, int dst_stride_argb, + const uint8* table_argb, + int x, int y, int width, int height); + +// Apply a luma/color table each ARGB pixel but preserve destination alpha. +// Table contains 32768 values indexed by [Y][C] where 7 it 7 bit luma from +// RGB (YJ style) and C is an 8 bit color component (R, G or B). +LIBYUV_API +int ARGBLumaColorTable(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + const uint8* luma_rgb_table, + int width, int height); + +// Apply a 3 term polynomial to ARGB values. +// poly points to a 4x4 matrix. The first row is constants. The 2nd row is +// coefficients for b, g, r and a. The 3rd row is coefficients for b squared, +// g squared, r squared and a squared. The 4rd row is coefficients for b to +// the 3, g to the 3, r to the 3 and a to the 3. The values are summed and +// result clamped to 0 to 255. +// A polynomial approximation can be dirived using software such as 'R'. + +LIBYUV_API +int ARGBPolynomial(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + const float* poly, + int width, int height); + +// Convert plane of 16 bit shorts to half floats. +// Source values are multiplied by scale before storing as half float. +LIBYUV_API +int HalfFloatPlane(const uint16* src_y, int src_stride_y, + uint16* dst_y, int dst_stride_y, + float scale, + int width, int height); + +// Quantize a rectangle of ARGB. Alpha unaffected. +// scale is a 16 bit fractional fixed point scaler between 0 and 65535. +// interval_size should be a value between 1 and 255. +// interval_offset should be a value between 0 and 255. +LIBYUV_API +int ARGBQuantize(uint8* dst_argb, int dst_stride_argb, + int scale, int interval_size, int interval_offset, + int x, int y, int width, int height); + +// Copy ARGB to ARGB. +LIBYUV_API +int ARGBCopy(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Copy Alpha channel of ARGB to alpha of ARGB. +LIBYUV_API +int ARGBCopyAlpha(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Extract the alpha channel from ARGB. +LIBYUV_API +int ARGBExtractAlpha(const uint8* src_argb, int src_stride_argb, + uint8* dst_a, int dst_stride_a, + int width, int height); + +// Copy Y channel to Alpha of ARGB. +LIBYUV_API +int ARGBCopyYToAlpha(const uint8* src_y, int src_stride_y, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +typedef void (*ARGBBlendRow)(const uint8* src_argb0, const uint8* src_argb1, + uint8* dst_argb, int width); + +// Get function to Alpha Blend ARGB pixels and store to destination. +LIBYUV_API +ARGBBlendRow GetARGBBlend(); + +// Alpha Blend ARGB images and store to destination. +// Source is pre-multiplied by alpha using ARGBAttenuate. +// Alpha of destination is set to 255. +LIBYUV_API +int ARGBBlend(const uint8* src_argb0, int src_stride_argb0, + const uint8* src_argb1, int src_stride_argb1, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Alpha Blend plane and store to destination. +// Source is not pre-multiplied by alpha. +LIBYUV_API +int BlendPlane(const uint8* src_y0, int src_stride_y0, + const uint8* src_y1, int src_stride_y1, + const uint8* alpha, int alpha_stride, + uint8* dst_y, int dst_stride_y, + int width, int height); + +// Alpha Blend YUV images and store to destination. +// Source is not pre-multiplied by alpha. +// Alpha is full width x height and subsampled to half size to apply to UV. +LIBYUV_API +int I420Blend(const uint8* src_y0, int src_stride_y0, + const uint8* src_u0, int src_stride_u0, + const uint8* src_v0, int src_stride_v0, + const uint8* src_y1, int src_stride_y1, + const uint8* src_u1, int src_stride_u1, + const uint8* src_v1, int src_stride_v1, + const uint8* alpha, int alpha_stride, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height); + +// Multiply ARGB image by ARGB image. Shifted down by 8. Saturates to 255. +LIBYUV_API +int ARGBMultiply(const uint8* src_argb0, int src_stride_argb0, + const uint8* src_argb1, int src_stride_argb1, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Add ARGB image with ARGB image. Saturates to 255. +LIBYUV_API +int ARGBAdd(const uint8* src_argb0, int src_stride_argb0, + const uint8* src_argb1, int src_stride_argb1, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Subtract ARGB image (argb1) from ARGB image (argb0). Saturates to 0. +LIBYUV_API +int ARGBSubtract(const uint8* src_argb0, int src_stride_argb0, + const uint8* src_argb1, int src_stride_argb1, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert I422 to YUY2. +LIBYUV_API +int I422ToYUY2(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_frame, int dst_stride_frame, + int width, int height); + +// Convert I422 to UYVY. +LIBYUV_API +int I422ToUYVY(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_frame, int dst_stride_frame, + int width, int height); + +// Convert unattentuated ARGB to preattenuated ARGB. +LIBYUV_API +int ARGBAttenuate(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Convert preattentuated ARGB to unattenuated ARGB. +LIBYUV_API +int ARGBUnattenuate(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Internal function - do not call directly. +// Computes table of cumulative sum for image where the value is the sum +// of all values above and to the left of the entry. Used by ARGBBlur. +LIBYUV_API +int ARGBComputeCumulativeSum(const uint8* src_argb, int src_stride_argb, + int32* dst_cumsum, int dst_stride32_cumsum, + int width, int height); + +// Blur ARGB image. +// dst_cumsum table of width * (height + 1) * 16 bytes aligned to +// 16 byte boundary. +// dst_stride32_cumsum is number of ints in a row (width * 4). +// radius is number of pixels around the center. e.g. 1 = 3x3. 2=5x5. +// Blur is optimized for radius of 5 (11x11) or less. +LIBYUV_API +int ARGBBlur(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + int32* dst_cumsum, int dst_stride32_cumsum, + int width, int height, int radius); + +// Multiply ARGB image by ARGB value. +LIBYUV_API +int ARGBShade(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + int width, int height, uint32 value); + +// Interpolate between two images using specified amount of interpolation +// (0 to 255) and store to destination. +// 'interpolation' is specified as 8 bit fraction where 0 means 100% src0 +// and 255 means 1% src0 and 99% src1. +LIBYUV_API +int InterpolatePlane(const uint8* src0, int src_stride0, + const uint8* src1, int src_stride1, + uint8* dst, int dst_stride, + int width, int height, int interpolation); + +// Interpolate between two ARGB images using specified amount of interpolation +// Internally calls InterpolatePlane with width * 4 (bpp). +LIBYUV_API +int ARGBInterpolate(const uint8* src_argb0, int src_stride_argb0, + const uint8* src_argb1, int src_stride_argb1, + uint8* dst_argb, int dst_stride_argb, + int width, int height, int interpolation); + +// Interpolate between two YUV images using specified amount of interpolation +// Internally calls InterpolatePlane on each plane where the U and V planes +// are half width and half height. +LIBYUV_API +int I420Interpolate(const uint8* src0_y, int src0_stride_y, + const uint8* src0_u, int src0_stride_u, + const uint8* src0_v, int src0_stride_v, + const uint8* src1_y, int src1_stride_y, + const uint8* src1_u, int src1_stride_u, + const uint8* src1_v, int src1_stride_v, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int width, int height, int interpolation); + +#if defined(__pnacl__) || defined(__CLR_VER) || \ + (defined(__i386__) && !defined(__SSE2__)) +#define LIBYUV_DISABLE_X86 +#endif +// MemorySanitizer does not support assembly code yet. http://crbug.com/344505 +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#define LIBYUV_DISABLE_X86 +#endif +#endif +// The following are available on all x86 platforms: +#if !defined(LIBYUV_DISABLE_X86) && \ + (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) +#define HAS_ARGBAFFINEROW_SSE2 +#endif + +// Row function for copying pixels from a source with a slope to a row +// of destination. Useful for scaling, rotation, mirror, texture mapping. +LIBYUV_API +void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride, + uint8* dst_argb, const float* uv_dudv, int width); +LIBYUV_API +void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride, + uint8* dst_argb, const float* uv_dudv, int width); + +// Shuffle ARGB channel order. e.g. BGRA to ARGB. +// shuffler is 16 bytes and must be aligned. +LIBYUV_API +int ARGBShuffle(const uint8* src_bgra, int src_stride_bgra, + uint8* dst_argb, int dst_stride_argb, + const uint8* shuffler, int width, int height); + +// Sobel ARGB effect with planar output. +LIBYUV_API +int ARGBSobelToPlane(const uint8* src_argb, int src_stride_argb, + uint8* dst_y, int dst_stride_y, + int width, int height); + +// Sobel ARGB effect. +LIBYUV_API +int ARGBSobel(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +// Sobel ARGB effect w/ Sobel X, Sobel, Sobel Y in ARGB. +LIBYUV_API +int ARGBSobelXY(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + int width, int height); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ diff --git a/third_party/libyuv/include/libyuv/rotate.h b/third_party/libyuv/include/libyuv/rotate.h new file mode 100644 index 000000000..8a2da9a5a --- /dev/null +++ b/third_party/libyuv/include/libyuv/rotate.h @@ -0,0 +1,117 @@ +/* + * Copyright 2011 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_ROTATE_H_ +#define INCLUDE_LIBYUV_ROTATE_H_ + +#include "libyuv/basic_types.h" + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +// Supported rotation. +typedef enum RotationMode { + kRotate0 = 0, // No rotation. + kRotate90 = 90, // Rotate 90 degrees clockwise. + kRotate180 = 180, // Rotate 180 degrees. + kRotate270 = 270, // Rotate 270 degrees clockwise. + + // Deprecated. + kRotateNone = 0, + kRotateClockwise = 90, + kRotateCounterClockwise = 270, +} RotationModeEnum; + +// Rotate I420 frame. +LIBYUV_API +int I420Rotate(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int src_width, int src_height, enum RotationMode mode); + +// Rotate NV12 input and store in I420. +LIBYUV_API +int NV12ToI420Rotate(const uint8* src_y, int src_stride_y, + const uint8* src_uv, int src_stride_uv, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int src_width, int src_height, enum RotationMode mode); + +// Rotate a plane by 0, 90, 180, or 270. +LIBYUV_API +int RotatePlane(const uint8* src, int src_stride, + uint8* dst, int dst_stride, + int src_width, int src_height, enum RotationMode mode); + +// Rotate planes by 90, 180, 270. Deprecated. +LIBYUV_API +void RotatePlane90(const uint8* src, int src_stride, + uint8* dst, int dst_stride, + int width, int height); + +LIBYUV_API +void RotatePlane180(const uint8* src, int src_stride, + uint8* dst, int dst_stride, + int width, int height); + +LIBYUV_API +void RotatePlane270(const uint8* src, int src_stride, + uint8* dst, int dst_stride, + int width, int height); + +LIBYUV_API +void RotateUV90(const uint8* src, int src_stride, + uint8* dst_a, int dst_stride_a, + uint8* dst_b, int dst_stride_b, + int width, int height); + +// Rotations for when U and V are interleaved. +// These functions take one input pointer and +// split the data into two buffers while +// rotating them. Deprecated. +LIBYUV_API +void RotateUV180(const uint8* src, int src_stride, + uint8* dst_a, int dst_stride_a, + uint8* dst_b, int dst_stride_b, + int width, int height); + +LIBYUV_API +void RotateUV270(const uint8* src, int src_stride, + uint8* dst_a, int dst_stride_a, + uint8* dst_b, int dst_stride_b, + int width, int height); + +// The 90 and 270 functions are based on transposes. +// Doing a transpose with reversing the read/write +// order will result in a rotation by +- 90 degrees. +// Deprecated. +LIBYUV_API +void TransposePlane(const uint8* src, int src_stride, + uint8* dst, int dst_stride, + int width, int height); + +LIBYUV_API +void TransposeUV(const uint8* src, int src_stride, + uint8* dst_a, int dst_stride_a, + uint8* dst_b, int dst_stride_b, + int width, int height); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_ROTATE_H_ diff --git a/third_party/libyuv/include/libyuv/rotate_argb.h b/third_party/libyuv/include/libyuv/rotate_argb.h new file mode 100644 index 000000000..21fe7e180 --- /dev/null +++ b/third_party/libyuv/include/libyuv/rotate_argb.h @@ -0,0 +1,33 @@ +/* + * Copyright 2012 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_ROTATE_ARGB_H_ +#define INCLUDE_LIBYUV_ROTATE_ARGB_H_ + +#include "libyuv/basic_types.h" +#include "libyuv/rotate.h" // For RotationMode. + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +// Rotate ARGB frame +LIBYUV_API +int ARGBRotate(const uint8* src_argb, int src_stride_argb, + uint8* dst_argb, int dst_stride_argb, + int src_width, int src_height, enum RotationMode mode); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_ROTATE_ARGB_H_ diff --git a/third_party/libyuv/include/libyuv/rotate_row.h b/third_party/libyuv/include/libyuv/rotate_row.h new file mode 100644 index 000000000..6abd20167 --- /dev/null +++ b/third_party/libyuv/include/libyuv/rotate_row.h @@ -0,0 +1,121 @@ +/* + * Copyright 2013 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_ROTATE_ROW_H_ +#define INCLUDE_LIBYUV_ROTATE_ROW_H_ + +#include "libyuv/basic_types.h" + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +#if defined(__pnacl__) || defined(__CLR_VER) || \ + (defined(__i386__) && !defined(__SSE2__)) +#define LIBYUV_DISABLE_X86 +#endif +// MemorySanitizer does not support assembly code yet. http://crbug.com/344505 +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#define LIBYUV_DISABLE_X86 +#endif +#endif +// The following are available for Visual C and clangcl 32 bit: +#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) +#define HAS_TRANSPOSEWX8_SSSE3 +#define HAS_TRANSPOSEUVWX8_SSE2 +#endif + +// The following are available for GCC 32 or 64 bit but not NaCL for 64 bit: +#if !defined(LIBYUV_DISABLE_X86) && \ + (defined(__i386__) || (defined(__x86_64__) && !defined(__native_client__))) +#define HAS_TRANSPOSEWX8_SSSE3 +#endif + +// The following are available for 64 bit GCC but not NaCL: +#if !defined(LIBYUV_DISABLE_X86) && !defined(__native_client__) && \ + defined(__x86_64__) +#define HAS_TRANSPOSEWX8_FAST_SSSE3 +#define HAS_TRANSPOSEUVWX8_SSE2 +#endif + +#if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \ + (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__)) +#define HAS_TRANSPOSEWX8_NEON +#define HAS_TRANSPOSEUVWX8_NEON +#endif + +#if !defined(LIBYUV_DISABLE_MIPS) && !defined(__native_client__) && \ + defined(__mips__) && \ + defined(__mips_dsp) && (__mips_dsp_rev >= 2) +#define HAS_TRANSPOSEWX8_DSPR2 +#define HAS_TRANSPOSEUVWX8_DSPR2 +#endif // defined(__mips__) + +void TransposeWxH_C(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width, int height); + +void TransposeWx8_C(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); +void TransposeWx8_NEON(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); +void TransposeWx8_SSSE3(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); +void TransposeWx8_Fast_SSSE3(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); +void TransposeWx8_DSPR2(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); +void TransposeWx8_Fast_DSPR2(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); + +void TransposeWx8_Any_NEON(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); +void TransposeWx8_Any_SSSE3(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); +void TransposeWx8_Fast_Any_SSSE3(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); +void TransposeWx8_Any_DSPR2(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); + +void TransposeUVWxH_C(const uint8* src, int src_stride, + uint8* dst_a, int dst_stride_a, + uint8* dst_b, int dst_stride_b, + int width, int height); + +void TransposeUVWx8_C(const uint8* src, int src_stride, + uint8* dst_a, int dst_stride_a, + uint8* dst_b, int dst_stride_b, int width); +void TransposeUVWx8_SSE2(const uint8* src, int src_stride, + uint8* dst_a, int dst_stride_a, + uint8* dst_b, int dst_stride_b, int width); +void TransposeUVWx8_NEON(const uint8* src, int src_stride, + uint8* dst_a, int dst_stride_a, + uint8* dst_b, int dst_stride_b, int width); +void TransposeUVWx8_DSPR2(const uint8* src, int src_stride, + uint8* dst_a, int dst_stride_a, + uint8* dst_b, int dst_stride_b, int width); + +void TransposeUVWx8_Any_SSE2(const uint8* src, int src_stride, + uint8* dst_a, int dst_stride_a, + uint8* dst_b, int dst_stride_b, int width); +void TransposeUVWx8_Any_NEON(const uint8* src, int src_stride, + uint8* dst_a, int dst_stride_a, + uint8* dst_b, int dst_stride_b, int width); +void TransposeUVWx8_Any_DSPR2(const uint8* src, int src_stride, + uint8* dst_a, int dst_stride_a, + uint8* dst_b, int dst_stride_b, int width); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_ROTATE_ROW_H_ diff --git a/third_party/libyuv/include/libyuv/row.h b/third_party/libyuv/include/libyuv/row.h new file mode 100644 index 000000000..b810221ec --- /dev/null +++ b/third_party/libyuv/include/libyuv/row.h @@ -0,0 +1,1963 @@ +/* + * Copyright 2011 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_ROW_H_ +#define INCLUDE_LIBYUV_ROW_H_ + +#include // For malloc. + +#include "libyuv/basic_types.h" + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1))) + +#define align_buffer_64(var, size) \ + uint8* var##_mem = (uint8*)(malloc((size) + 63)); /* NOLINT */ \ + uint8* var = (uint8*)(((intptr_t)(var##_mem) + 63) & ~63) /* NOLINT */ + +#define free_aligned_buffer_64(var) \ + free(var##_mem); \ + var = 0 + +#if defined(__pnacl__) || defined(__CLR_VER) || \ + (defined(__i386__) && !defined(__SSE2__)) +#define LIBYUV_DISABLE_X86 +#endif +// MemorySanitizer does not support assembly code yet. http://crbug.com/344505 +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#define LIBYUV_DISABLE_X86 +#endif +#endif +// True if compiling for SSSE3 as a requirement. +#if defined(__SSSE3__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 3)) +#define LIBYUV_SSSE3_ONLY +#endif + +#if defined(__native_client__) +#define LIBYUV_DISABLE_NEON +#endif +// clang >= 3.5.0 required for Arm64. +#if defined(__clang__) && defined(__aarch64__) && !defined(LIBYUV_DISABLE_NEON) +#if (__clang_major__ < 3) || (__clang_major__ == 3 && (__clang_minor__ < 5)) +#define LIBYUV_DISABLE_NEON +#endif // clang >= 3.5 +#endif // __clang__ + +// GCC >= 4.7.0 required for AVX2. +#if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) +#if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 7)) +#define GCC_HAS_AVX2 1 +#endif // GNUC >= 4.7 +#endif // __GNUC__ + +// clang >= 3.4.0 required for AVX2. +#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) +#if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4)) +#define CLANG_HAS_AVX2 1 +#endif // clang >= 3.4 +#endif // __clang__ + +// Visual C 2012 required for AVX2. +#if defined(_M_IX86) && !defined(__clang__) && \ + defined(_MSC_VER) && _MSC_VER >= 1700 +#define VISUALC_HAS_AVX2 1 +#endif // VisualStudio >= 2012 + +// The following are available on all x86 platforms: +#if !defined(LIBYUV_DISABLE_X86) && \ + (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) +// Conversions: +#define HAS_ABGRTOUVROW_SSSE3 +#define HAS_ABGRTOYROW_SSSE3 +#define HAS_ARGB1555TOARGBROW_SSE2 +#define HAS_ARGB4444TOARGBROW_SSE2 +#define HAS_ARGBSETROW_X86 +#define HAS_ARGBSHUFFLEROW_SSE2 +#define HAS_ARGBSHUFFLEROW_SSSE3 +#define HAS_ARGBTOARGB1555ROW_SSE2 +#define HAS_ARGBTOARGB4444ROW_SSE2 +#define HAS_ARGBTORAWROW_SSSE3 +#define HAS_ARGBTORGB24ROW_SSSE3 +#define HAS_ARGBTORGB565DITHERROW_SSE2 +#define HAS_ARGBTORGB565ROW_SSE2 +#define HAS_ARGBTOUV444ROW_SSSE3 +#define HAS_ARGBTOUVJROW_SSSE3 +#define HAS_ARGBTOUVROW_SSSE3 +#define HAS_ARGBTOYJROW_SSSE3 +#define HAS_ARGBTOYROW_SSSE3 +#define HAS_ARGBEXTRACTALPHAROW_SSE2 +#define HAS_BGRATOUVROW_SSSE3 +#define HAS_BGRATOYROW_SSSE3 +#define HAS_COPYROW_ERMS +#define HAS_COPYROW_SSE2 +#define HAS_H422TOARGBROW_SSSE3 +#define HAS_I400TOARGBROW_SSE2 +#define HAS_I422TOARGB1555ROW_SSSE3 +#define HAS_I422TOARGB4444ROW_SSSE3 +#define HAS_I422TOARGBROW_SSSE3 +#define HAS_I422TORGB24ROW_SSSE3 +#define HAS_I422TORGB565ROW_SSSE3 +#define HAS_I422TORGBAROW_SSSE3 +#define HAS_I422TOUYVYROW_SSE2 +#define HAS_I422TOYUY2ROW_SSE2 +#define HAS_I444TOARGBROW_SSSE3 +#define HAS_J400TOARGBROW_SSE2 +#define HAS_J422TOARGBROW_SSSE3 +#define HAS_MERGEUVROW_SSE2 +#define HAS_MIRRORROW_SSSE3 +#define HAS_MIRRORUVROW_SSSE3 +#define HAS_NV12TOARGBROW_SSSE3 +#define HAS_NV12TORGB565ROW_SSSE3 +#define HAS_NV21TOARGBROW_SSSE3 +#define HAS_RAWTOARGBROW_SSSE3 +#define HAS_RAWTORGB24ROW_SSSE3 +#define HAS_RAWTOYROW_SSSE3 +#define HAS_RGB24TOARGBROW_SSSE3 +#define HAS_RGB24TOYROW_SSSE3 +#define HAS_RGB565TOARGBROW_SSE2 +#define HAS_RGBATOUVROW_SSSE3 +#define HAS_RGBATOYROW_SSSE3 +#define HAS_SETROW_ERMS +#define HAS_SETROW_X86 +#define HAS_SPLITUVROW_SSE2 +#define HAS_UYVYTOARGBROW_SSSE3 +#define HAS_UYVYTOUV422ROW_SSE2 +#define HAS_UYVYTOUVROW_SSE2 +#define HAS_UYVYTOYROW_SSE2 +#define HAS_YUY2TOARGBROW_SSSE3 +#define HAS_YUY2TOUV422ROW_SSE2 +#define HAS_YUY2TOUVROW_SSE2 +#define HAS_YUY2TOYROW_SSE2 + +// Effects: +#define HAS_ARGBADDROW_SSE2 +#define HAS_ARGBAFFINEROW_SSE2 +#define HAS_ARGBATTENUATEROW_SSSE3 +#define HAS_ARGBBLENDROW_SSSE3 +#define HAS_ARGBCOLORMATRIXROW_SSSE3 +#define HAS_ARGBCOLORTABLEROW_X86 +#define HAS_ARGBCOPYALPHAROW_SSE2 +#define HAS_ARGBCOPYYTOALPHAROW_SSE2 +#define HAS_ARGBGRAYROW_SSSE3 +#define HAS_ARGBLUMACOLORTABLEROW_SSSE3 +#define HAS_ARGBMIRRORROW_SSE2 +#define HAS_ARGBMULTIPLYROW_SSE2 +#define HAS_ARGBPOLYNOMIALROW_SSE2 +#define HAS_ARGBQUANTIZEROW_SSE2 +#define HAS_ARGBSEPIAROW_SSSE3 +#define HAS_ARGBSHADEROW_SSE2 +#define HAS_ARGBSUBTRACTROW_SSE2 +#define HAS_ARGBUNATTENUATEROW_SSE2 +#define HAS_BLENDPLANEROW_SSSE3 +#define HAS_COMPUTECUMULATIVESUMROW_SSE2 +#define HAS_CUMULATIVESUMTOAVERAGEROW_SSE2 +#define HAS_INTERPOLATEROW_SSSE3 +#define HAS_RGBCOLORTABLEROW_X86 +#define HAS_SOBELROW_SSE2 +#define HAS_SOBELTOPLANEROW_SSE2 +#define HAS_SOBELXROW_SSE2 +#define HAS_SOBELXYROW_SSE2 +#define HAS_SOBELYROW_SSE2 + +// The following functions fail on gcc/clang 32 bit with fpic and framepointer. +// caveat: clangcl uses row_win.cc which works. +#if defined(NDEBUG) || !(defined(_DEBUG) && defined(__i386__)) || \ + !defined(__i386__) || defined(_MSC_VER) +// TODO(fbarchard): fix build error on x86 debug +// https://code.google.com/p/libyuv/issues/detail?id=524 +#define HAS_I411TOARGBROW_SSSE3 +// TODO(fbarchard): fix build error on android_full_debug=1 +// https://code.google.com/p/libyuv/issues/detail?id=517 +#define HAS_I422ALPHATOARGBROW_SSSE3 +#endif +#endif + +// The following are available on all x86 platforms, but +// require VS2012, clang 3.4 or gcc 4.7. +// The code supports NaCL but requires a new compiler and validator. +#if !defined(LIBYUV_DISABLE_X86) && (defined(VISUALC_HAS_AVX2) || \ + defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2)) +#define HAS_ARGBCOPYALPHAROW_AVX2 +#define HAS_ARGBCOPYYTOALPHAROW_AVX2 +#define HAS_ARGBMIRRORROW_AVX2 +#define HAS_ARGBPOLYNOMIALROW_AVX2 +#define HAS_ARGBSHUFFLEROW_AVX2 +#define HAS_ARGBTORGB565DITHERROW_AVX2 +#define HAS_ARGBTOUVJROW_AVX2 +#define HAS_ARGBTOUVROW_AVX2 +#define HAS_ARGBTOYJROW_AVX2 +#define HAS_ARGBTOYROW_AVX2 +#define HAS_COPYROW_AVX +#define HAS_H422TOARGBROW_AVX2 +#define HAS_I400TOARGBROW_AVX2 +#if !(defined(_DEBUG) && defined(__i386__)) +// TODO(fbarchard): fix build error on android_full_debug=1 +// https://code.google.com/p/libyuv/issues/detail?id=517 +#define HAS_I422ALPHATOARGBROW_AVX2 +#endif +#define HAS_I411TOARGBROW_AVX2 +#define HAS_I422TOARGB1555ROW_AVX2 +#define HAS_I422TOARGB4444ROW_AVX2 +#define HAS_I422TOARGBROW_AVX2 +#define HAS_I422TORGB24ROW_AVX2 +#define HAS_I422TORGB565ROW_AVX2 +#define HAS_I422TORGBAROW_AVX2 +#define HAS_I444TOARGBROW_AVX2 +#define HAS_INTERPOLATEROW_AVX2 +#define HAS_J422TOARGBROW_AVX2 +#define HAS_MERGEUVROW_AVX2 +#define HAS_MIRRORROW_AVX2 +#define HAS_NV12TOARGBROW_AVX2 +#define HAS_NV12TORGB565ROW_AVX2 +#define HAS_NV21TOARGBROW_AVX2 +#define HAS_SPLITUVROW_AVX2 +#define HAS_UYVYTOARGBROW_AVX2 +#define HAS_UYVYTOUV422ROW_AVX2 +#define HAS_UYVYTOUVROW_AVX2 +#define HAS_UYVYTOYROW_AVX2 +#define HAS_YUY2TOARGBROW_AVX2 +#define HAS_YUY2TOUV422ROW_AVX2 +#define HAS_YUY2TOUVROW_AVX2 +#define HAS_YUY2TOYROW_AVX2 +#define HAS_HALFFLOATROW_AVX2 + +// Effects: +#define HAS_ARGBADDROW_AVX2 +#define HAS_ARGBATTENUATEROW_AVX2 +#define HAS_ARGBMULTIPLYROW_AVX2 +#define HAS_ARGBSUBTRACTROW_AVX2 +#define HAS_ARGBUNATTENUATEROW_AVX2 +#define HAS_BLENDPLANEROW_AVX2 +#endif + +// The following are available for AVX2 Visual C and clangcl 32 bit: +// TODO(fbarchard): Port to gcc. +#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \ + (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2)) +#define HAS_ARGB1555TOARGBROW_AVX2 +#define HAS_ARGB4444TOARGBROW_AVX2 +#define HAS_ARGBTOARGB1555ROW_AVX2 +#define HAS_ARGBTOARGB4444ROW_AVX2 +#define HAS_ARGBTORGB565ROW_AVX2 +#define HAS_J400TOARGBROW_AVX2 +#define HAS_RGB565TOARGBROW_AVX2 +#endif + +// The following are also available on x64 Visual C. +#if !defined(LIBYUV_DISABLE_X86) && defined(_MSC_VER) && defined(_M_X64) && \ + (!defined(__clang__) || defined(__SSSE3__)) +#define HAS_I422ALPHATOARGBROW_SSSE3 +#define HAS_I422TOARGBROW_SSSE3 +#endif + +// The following are available on gcc x86 platforms: +// TODO(fbarchard): Port to Visual C. +#if !defined(LIBYUV_DISABLE_X86) && \ + (defined(__x86_64__) || (defined(__i386__) && !defined(_MSC_VER))) +#define HAS_HALFFLOATROW_SSE2 +#endif + +// The following are available on Neon platforms: +#if !defined(LIBYUV_DISABLE_NEON) && \ + (defined(__aarch64__) || defined(__ARM_NEON__) || defined(LIBYUV_NEON)) +#define HAS_ABGRTOUVROW_NEON +#define HAS_ABGRTOYROW_NEON +#define HAS_ARGB1555TOARGBROW_NEON +#define HAS_ARGB1555TOUVROW_NEON +#define HAS_ARGB1555TOYROW_NEON +#define HAS_ARGB4444TOARGBROW_NEON +#define HAS_ARGB4444TOUVROW_NEON +#define HAS_ARGB4444TOYROW_NEON +#define HAS_ARGBSETROW_NEON +#define HAS_ARGBTOARGB1555ROW_NEON +#define HAS_ARGBTOARGB4444ROW_NEON +#define HAS_ARGBTORAWROW_NEON +#define HAS_ARGBTORGB24ROW_NEON +#define HAS_ARGBTORGB565DITHERROW_NEON +#define HAS_ARGBTORGB565ROW_NEON +#define HAS_ARGBTOUV411ROW_NEON +#define HAS_ARGBTOUV444ROW_NEON +#define HAS_ARGBTOUVJROW_NEON +#define HAS_ARGBTOUVROW_NEON +#define HAS_ARGBTOYJROW_NEON +#define HAS_ARGBTOYROW_NEON +#define HAS_ARGBEXTRACTALPHAROW_NEON +#define HAS_BGRATOUVROW_NEON +#define HAS_BGRATOYROW_NEON +#define HAS_COPYROW_NEON +#define HAS_I400TOARGBROW_NEON +#define HAS_I411TOARGBROW_NEON +#define HAS_I422ALPHATOARGBROW_NEON +#define HAS_I422TOARGB1555ROW_NEON +#define HAS_I422TOARGB4444ROW_NEON +#define HAS_I422TOARGBROW_NEON +#define HAS_I422TORGB24ROW_NEON +#define HAS_I422TORGB565ROW_NEON +#define HAS_I422TORGBAROW_NEON +#define HAS_I422TOUYVYROW_NEON +#define HAS_I422TOYUY2ROW_NEON +#define HAS_I444TOARGBROW_NEON +#define HAS_J400TOARGBROW_NEON +#define HAS_MERGEUVROW_NEON +#define HAS_MIRRORROW_NEON +#define HAS_MIRRORUVROW_NEON +#define HAS_NV12TOARGBROW_NEON +#define HAS_NV12TORGB565ROW_NEON +#define HAS_NV21TOARGBROW_NEON +#define HAS_RAWTOARGBROW_NEON +#define HAS_RAWTORGB24ROW_NEON +#define HAS_RAWTOUVROW_NEON +#define HAS_RAWTOYROW_NEON +#define HAS_RGB24TOARGBROW_NEON +#define HAS_RGB24TOUVROW_NEON +#define HAS_RGB24TOYROW_NEON +#define HAS_RGB565TOARGBROW_NEON +#define HAS_RGB565TOUVROW_NEON +#define HAS_RGB565TOYROW_NEON +#define HAS_RGBATOUVROW_NEON +#define HAS_RGBATOYROW_NEON +#define HAS_SETROW_NEON +#define HAS_SPLITUVROW_NEON +#define HAS_UYVYTOARGBROW_NEON +#define HAS_UYVYTOUV422ROW_NEON +#define HAS_UYVYTOUVROW_NEON +#define HAS_UYVYTOYROW_NEON +#define HAS_YUY2TOARGBROW_NEON +#define HAS_YUY2TOUV422ROW_NEON +#define HAS_YUY2TOUVROW_NEON +#define HAS_YUY2TOYROW_NEON + +// Effects: +#define HAS_ARGBADDROW_NEON +#define HAS_ARGBATTENUATEROW_NEON +#define HAS_ARGBBLENDROW_NEON +#define HAS_ARGBCOLORMATRIXROW_NEON +#define HAS_ARGBGRAYROW_NEON +#define HAS_ARGBMIRRORROW_NEON +#define HAS_ARGBMULTIPLYROW_NEON +#define HAS_ARGBQUANTIZEROW_NEON +#define HAS_ARGBSEPIAROW_NEON +#define HAS_ARGBSHADEROW_NEON +#define HAS_ARGBSHUFFLEROW_NEON +#define HAS_ARGBSUBTRACTROW_NEON +#define HAS_INTERPOLATEROW_NEON +#define HAS_SOBELROW_NEON +#define HAS_SOBELTOPLANEROW_NEON +#define HAS_SOBELXROW_NEON +#define HAS_SOBELXYROW_NEON +#define HAS_SOBELYROW_NEON +#endif + +// The following are available on Mips platforms: +#if !defined(LIBYUV_DISABLE_MIPS) && defined(__mips__) && \ + (_MIPS_SIM == _MIPS_SIM_ABI32) && (__mips_isa_rev < 6) +#define HAS_COPYROW_MIPS +#if defined(__mips_dsp) && (__mips_dsp_rev >= 2) +#define HAS_I422TOARGBROW_DSPR2 +#define HAS_INTERPOLATEROW_DSPR2 +#define HAS_MIRRORROW_DSPR2 +#define HAS_MIRRORUVROW_DSPR2 +#define HAS_SPLITUVROW_DSPR2 +#endif +#endif + +#if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa) +#define HAS_MIRRORROW_MSA +#define HAS_ARGBMIRRORROW_MSA +#endif + +#if defined(_MSC_VER) && !defined(__CLR_VER) && !defined(__clang__) +#if defined(VISUALC_HAS_AVX2) +#define SIMD_ALIGNED(var) __declspec(align(32)) var +#else +#define SIMD_ALIGNED(var) __declspec(align(16)) var +#endif +typedef __declspec(align(16)) int16 vec16[8]; +typedef __declspec(align(16)) int32 vec32[4]; +typedef __declspec(align(16)) int8 vec8[16]; +typedef __declspec(align(16)) uint16 uvec16[8]; +typedef __declspec(align(16)) uint32 uvec32[4]; +typedef __declspec(align(16)) uint8 uvec8[16]; +typedef __declspec(align(32)) int16 lvec16[16]; +typedef __declspec(align(32)) int32 lvec32[8]; +typedef __declspec(align(32)) int8 lvec8[32]; +typedef __declspec(align(32)) uint16 ulvec16[16]; +typedef __declspec(align(32)) uint32 ulvec32[8]; +typedef __declspec(align(32)) uint8 ulvec8[32]; +#elif !defined(__pnacl__) && (defined(__GNUC__) || defined(__clang__)) +// Caveat GCC 4.2 to 4.7 have a known issue using vectors with const. +#if defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2) +#define SIMD_ALIGNED(var) var __attribute__((aligned(32))) +#else +#define SIMD_ALIGNED(var) var __attribute__((aligned(16))) +#endif +typedef int16 __attribute__((vector_size(16))) vec16; +typedef int32 __attribute__((vector_size(16))) vec32; +typedef int8 __attribute__((vector_size(16))) vec8; +typedef uint16 __attribute__((vector_size(16))) uvec16; +typedef uint32 __attribute__((vector_size(16))) uvec32; +typedef uint8 __attribute__((vector_size(16))) uvec8; +typedef int16 __attribute__((vector_size(32))) lvec16; +typedef int32 __attribute__((vector_size(32))) lvec32; +typedef int8 __attribute__((vector_size(32))) lvec8; +typedef uint16 __attribute__((vector_size(32))) ulvec16; +typedef uint32 __attribute__((vector_size(32))) ulvec32; +typedef uint8 __attribute__((vector_size(32))) ulvec8; +#else +#define SIMD_ALIGNED(var) var +typedef int16 vec16[8]; +typedef int32 vec32[4]; +typedef int8 vec8[16]; +typedef uint16 uvec16[8]; +typedef uint32 uvec32[4]; +typedef uint8 uvec8[16]; +typedef int16 lvec16[16]; +typedef int32 lvec32[8]; +typedef int8 lvec8[32]; +typedef uint16 ulvec16[16]; +typedef uint32 ulvec32[8]; +typedef uint8 ulvec8[32]; +#endif + +#if defined(__aarch64__) +// This struct is for Arm64 color conversion. +struct YuvConstants { + uvec16 kUVToRB; + uvec16 kUVToRB2; + uvec16 kUVToG; + uvec16 kUVToG2; + vec16 kUVBiasBGR; + vec32 kYToRgb; +}; +#elif defined(__arm__) +// This struct is for ArmV7 color conversion. +struct YuvConstants { + uvec8 kUVToRB; + uvec8 kUVToG; + vec16 kUVBiasBGR; + vec32 kYToRgb; +}; +#else +// This struct is for Intel color conversion. +struct YuvConstants { + int8 kUVToB[32]; + int8 kUVToG[32]; + int8 kUVToR[32]; + int16 kUVBiasB[16]; + int16 kUVBiasG[16]; + int16 kUVBiasR[16]; + int16 kYToRgb[16]; +}; + +// Offsets into YuvConstants structure +#define KUVTOB 0 +#define KUVTOG 32 +#define KUVTOR 64 +#define KUVBIASB 96 +#define KUVBIASG 128 +#define KUVBIASR 160 +#define KYTORGB 192 +#endif + +// Conversion matrix for YUV to RGB +extern const struct YuvConstants SIMD_ALIGNED(kYuvI601Constants); // BT.601 +extern const struct YuvConstants SIMD_ALIGNED(kYuvJPEGConstants); // JPeg +extern const struct YuvConstants SIMD_ALIGNED(kYuvH709Constants); // BT.709 + +// Conversion matrix for YVU to BGR +extern const struct YuvConstants SIMD_ALIGNED(kYvuI601Constants); // BT.601 +extern const struct YuvConstants SIMD_ALIGNED(kYvuJPEGConstants); // JPeg +extern const struct YuvConstants SIMD_ALIGNED(kYvuH709Constants); // BT.709 + +#if defined(__APPLE__) || defined(__x86_64__) || defined(__llvm__) +#define OMITFP +#else +#define OMITFP __attribute__((optimize("omit-frame-pointer"))) +#endif + +// NaCL macros for GCC x86 and x64. +#if defined(__native_client__) +#define LABELALIGN ".p2align 5\n" +#else +#define LABELALIGN +#endif +#if defined(__native_client__) && defined(__x86_64__) +// r14 is used for MEMOP macros. +#define NACL_R14 "r14", +#define BUNDLELOCK ".bundle_lock\n" +#define BUNDLEUNLOCK ".bundle_unlock\n" +#define MEMACCESS(base) "%%nacl:(%%r15,%q" #base ")" +#define MEMACCESS2(offset, base) "%%nacl:" #offset "(%%r15,%q" #base ")" +#define MEMLEA(offset, base) #offset "(%q" #base ")" +#define MEMLEA3(offset, index, scale) \ + #offset "(,%q" #index "," #scale ")" +#define MEMLEA4(offset, base, index, scale) \ + #offset "(%q" #base ",%q" #index "," #scale ")" +#define MEMMOVESTRING(s, d) "%%nacl:(%q" #s "),%%nacl:(%q" #d "), %%r15" +#define MEMSTORESTRING(reg, d) "%%" #reg ",%%nacl:(%q" #d "), %%r15" +#define MEMOPREG(opcode, offset, base, index, scale, reg) \ + BUNDLELOCK \ + "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \ + #opcode " (%%r15,%%r14),%%" #reg "\n" \ + BUNDLEUNLOCK +#define MEMOPMEM(opcode, reg, offset, base, index, scale) \ + BUNDLELOCK \ + "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \ + #opcode " %%" #reg ",(%%r15,%%r14)\n" \ + BUNDLEUNLOCK +#define MEMOPARG(opcode, offset, base, index, scale, arg) \ + BUNDLELOCK \ + "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \ + #opcode " (%%r15,%%r14),%" #arg "\n" \ + BUNDLEUNLOCK +#define VMEMOPREG(opcode, offset, base, index, scale, reg1, reg2) \ + BUNDLELOCK \ + "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \ + #opcode " (%%r15,%%r14),%%" #reg1 ",%%" #reg2 "\n" \ + BUNDLEUNLOCK +#define VEXTOPMEM(op, sel, reg, offset, base, index, scale) \ + BUNDLELOCK \ + "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \ + #op " $" #sel ",%%" #reg ",(%%r15,%%r14)\n" \ + BUNDLEUNLOCK +#else // defined(__native_client__) && defined(__x86_64__) +#define NACL_R14 +#define BUNDLEALIGN +#define MEMACCESS(base) "(%" #base ")" +#define MEMACCESS2(offset, base) #offset "(%" #base ")" +#define MEMLEA(offset, base) #offset "(%" #base ")" +#define MEMLEA3(offset, index, scale) \ + #offset "(,%" #index "," #scale ")" +#define MEMLEA4(offset, base, index, scale) \ + #offset "(%" #base ",%" #index "," #scale ")" +#define MEMMOVESTRING(s, d) +#define MEMSTORESTRING(reg, d) +#define MEMOPREG(opcode, offset, base, index, scale, reg) \ + #opcode " " #offset "(%" #base ",%" #index "," #scale "),%%" #reg "\n" +#define MEMOPMEM(opcode, reg, offset, base, index, scale) \ + #opcode " %%" #reg ","#offset "(%" #base ",%" #index "," #scale ")\n" +#define MEMOPARG(opcode, offset, base, index, scale, arg) \ + #opcode " " #offset "(%" #base ",%" #index "," #scale "),%" #arg "\n" +#define VMEMOPREG(opcode, offset, base, index, scale, reg1, reg2) \ + #opcode " " #offset "(%" #base ",%" #index "," #scale "),%%" #reg1 ",%%" \ + #reg2 "\n" +#define VEXTOPMEM(op, sel, reg, offset, base, index, scale) \ + #op " $" #sel ",%%" #reg ","#offset "(%" #base ",%" #index "," #scale ")\n" +#endif // defined(__native_client__) && defined(__x86_64__) + +#if defined(__arm__) || defined(__aarch64__) +#undef MEMACCESS +#if defined(__native_client__) +#define MEMACCESS(base) ".p2align 3\nbic %" #base ", #0xc0000000\n" +#else +#define MEMACCESS(base) +#endif +#endif + +void I444ToARGBRow_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGBRow_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422AlphaToARGBRow_NEON(const uint8* y_buf, + const uint8* u_buf, + const uint8* v_buf, + const uint8* a_buf, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGBRow_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I411ToARGBRow_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGBARow_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgba, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGB24Row_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGB565Row_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgb565, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGB1555Row_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb1555, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGB4444Row_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb4444, + const struct YuvConstants* yuvconstants, + int width); +void NV12ToARGBRow_NEON(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV12ToRGB565Row_NEON(const uint8* src_y, + const uint8* src_uv, + uint8* dst_rgb565, + const struct YuvConstants* yuvconstants, + int width); +void NV21ToARGBRow_NEON(const uint8* src_y, + const uint8* src_vu, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void YUY2ToARGBRow_NEON(const uint8* src_yuy2, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void UYVYToARGBRow_NEON(const uint8* src_uyvy, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); + +void ARGBToYRow_AVX2(const uint8* src_argb, uint8* dst_y, int width); +void ARGBToYRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int width); +void ARGBToYRow_SSSE3(const uint8* src_argb, uint8* dst_y, int width); +void ARGBToYJRow_AVX2(const uint8* src_argb, uint8* dst_y, int width); +void ARGBToYJRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int width); +void ARGBToYJRow_SSSE3(const uint8* src_argb, uint8* dst_y, int width); +void BGRAToYRow_SSSE3(const uint8* src_bgra, uint8* dst_y, int width); +void ABGRToYRow_SSSE3(const uint8* src_abgr, uint8* dst_y, int width); +void RGBAToYRow_SSSE3(const uint8* src_rgba, uint8* dst_y, int width); +void RGB24ToYRow_SSSE3(const uint8* src_rgb24, uint8* dst_y, int width); +void RAWToYRow_SSSE3(const uint8* src_raw, uint8* dst_y, int width); +void ARGBToYRow_NEON(const uint8* src_argb, uint8* dst_y, int width); +void ARGBToYJRow_NEON(const uint8* src_argb, uint8* dst_y, int width); +void ARGBToUV444Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, + int width); +void ARGBToUV411Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, + int width); +void ARGBToUVRow_NEON(const uint8* src_argb, int src_stride_argb, + uint8* dst_u, uint8* dst_v, int width); +void ARGBToUVJRow_NEON(const uint8* src_argb, int src_stride_argb, + uint8* dst_u, uint8* dst_v, int width); +void BGRAToUVRow_NEON(const uint8* src_bgra, int src_stride_bgra, + uint8* dst_u, uint8* dst_v, int width); +void ABGRToUVRow_NEON(const uint8* src_abgr, int src_stride_abgr, + uint8* dst_u, uint8* dst_v, int width); +void RGBAToUVRow_NEON(const uint8* src_rgba, int src_stride_rgba, + uint8* dst_u, uint8* dst_v, int width); +void RGB24ToUVRow_NEON(const uint8* src_rgb24, int src_stride_rgb24, + uint8* dst_u, uint8* dst_v, int width); +void RAWToUVRow_NEON(const uint8* src_raw, int src_stride_raw, + uint8* dst_u, uint8* dst_v, int width); +void RGB565ToUVRow_NEON(const uint8* src_rgb565, int src_stride_rgb565, + uint8* dst_u, uint8* dst_v, int width); +void ARGB1555ToUVRow_NEON(const uint8* src_argb1555, int src_stride_argb1555, + uint8* dst_u, uint8* dst_v, int width); +void ARGB4444ToUVRow_NEON(const uint8* src_argb4444, int src_stride_argb4444, + uint8* dst_u, uint8* dst_v, int width); +void BGRAToYRow_NEON(const uint8* src_bgra, uint8* dst_y, int width); +void ABGRToYRow_NEON(const uint8* src_abgr, uint8* dst_y, int width); +void RGBAToYRow_NEON(const uint8* src_rgba, uint8* dst_y, int width); +void RGB24ToYRow_NEON(const uint8* src_rgb24, uint8* dst_y, int width); +void RAWToYRow_NEON(const uint8* src_raw, uint8* dst_y, int width); +void RGB565ToYRow_NEON(const uint8* src_rgb565, uint8* dst_y, int width); +void ARGB1555ToYRow_NEON(const uint8* src_argb1555, uint8* dst_y, int width); +void ARGB4444ToYRow_NEON(const uint8* src_argb4444, uint8* dst_y, int width); +void ARGBToYRow_C(const uint8* src_argb, uint8* dst_y, int width); +void ARGBToYJRow_C(const uint8* src_argb, uint8* dst_y, int width); +void BGRAToYRow_C(const uint8* src_bgra, uint8* dst_y, int width); +void ABGRToYRow_C(const uint8* src_abgr, uint8* dst_y, int width); +void RGBAToYRow_C(const uint8* src_rgba, uint8* dst_y, int width); +void RGB24ToYRow_C(const uint8* src_rgb24, uint8* dst_y, int width); +void RAWToYRow_C(const uint8* src_raw, uint8* dst_y, int width); +void RGB565ToYRow_C(const uint8* src_rgb565, uint8* dst_y, int width); +void ARGB1555ToYRow_C(const uint8* src_argb1555, uint8* dst_y, int width); +void ARGB4444ToYRow_C(const uint8* src_argb4444, uint8* dst_y, int width); +void ARGBToYRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int width); +void ARGBToYJRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int width); +void BGRAToYRow_Any_SSSE3(const uint8* src_bgra, uint8* dst_y, int width); +void ABGRToYRow_Any_SSSE3(const uint8* src_abgr, uint8* dst_y, int width); +void RGBAToYRow_Any_SSSE3(const uint8* src_rgba, uint8* dst_y, int width); +void RGB24ToYRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_y, int width); +void RAWToYRow_Any_SSSE3(const uint8* src_raw, uint8* dst_y, int width); +void ARGBToYRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int width); +void ARGBToYJRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int width); +void BGRAToYRow_Any_NEON(const uint8* src_bgra, uint8* dst_y, int width); +void ABGRToYRow_Any_NEON(const uint8* src_abgr, uint8* dst_y, int width); +void RGBAToYRow_Any_NEON(const uint8* src_rgba, uint8* dst_y, int width); +void RGB24ToYRow_Any_NEON(const uint8* src_rgb24, uint8* dst_y, int width); +void RAWToYRow_Any_NEON(const uint8* src_raw, uint8* dst_y, int width); +void RGB565ToYRow_Any_NEON(const uint8* src_rgb565, uint8* dst_y, int width); +void ARGB1555ToYRow_Any_NEON(const uint8* src_argb1555, uint8* dst_y, + int width); +void ARGB4444ToYRow_Any_NEON(const uint8* src_argb4444, uint8* dst_y, + int width); + +void ARGBToUVRow_AVX2(const uint8* src_argb, int src_stride_argb, + uint8* dst_u, uint8* dst_v, int width); +void ARGBToUVJRow_AVX2(const uint8* src_argb, int src_stride_argb, + uint8* dst_u, uint8* dst_v, int width); +void ARGBToUVRow_SSSE3(const uint8* src_argb, int src_stride_argb, + uint8* dst_u, uint8* dst_v, int width); +void ARGBToUVJRow_SSSE3(const uint8* src_argb, int src_stride_argb, + uint8* dst_u, uint8* dst_v, int width); +void BGRAToUVRow_SSSE3(const uint8* src_bgra, int src_stride_bgra, + uint8* dst_u, uint8* dst_v, int width); +void ABGRToUVRow_SSSE3(const uint8* src_abgr, int src_stride_abgr, + uint8* dst_u, uint8* dst_v, int width); +void RGBAToUVRow_SSSE3(const uint8* src_rgba, int src_stride_rgba, + uint8* dst_u, uint8* dst_v, int width); +void ARGBToUVRow_Any_AVX2(const uint8* src_argb, int src_stride_argb, + uint8* dst_u, uint8* dst_v, int width); +void ARGBToUVJRow_Any_AVX2(const uint8* src_argb, int src_stride_argb, + uint8* dst_u, uint8* dst_v, int width); +void ARGBToUVRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb, + uint8* dst_u, uint8* dst_v, int width); +void ARGBToUVJRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb, + uint8* dst_u, uint8* dst_v, int width); +void BGRAToUVRow_Any_SSSE3(const uint8* src_bgra, int src_stride_bgra, + uint8* dst_u, uint8* dst_v, int width); +void ABGRToUVRow_Any_SSSE3(const uint8* src_abgr, int src_stride_abgr, + uint8* dst_u, uint8* dst_v, int width); +void RGBAToUVRow_Any_SSSE3(const uint8* src_rgba, int src_stride_rgba, + uint8* dst_u, uint8* dst_v, int width); +void ARGBToUV444Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, + int width); +void ARGBToUV411Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, + int width); +void ARGBToUVRow_Any_NEON(const uint8* src_argb, int src_stride_argb, + uint8* dst_u, uint8* dst_v, int width); +void ARGBToUVJRow_Any_NEON(const uint8* src_argb, int src_stride_argb, + uint8* dst_u, uint8* dst_v, int width); +void BGRAToUVRow_Any_NEON(const uint8* src_bgra, int src_stride_bgra, + uint8* dst_u, uint8* dst_v, int width); +void ABGRToUVRow_Any_NEON(const uint8* src_abgr, int src_stride_abgr, + uint8* dst_u, uint8* dst_v, int width); +void RGBAToUVRow_Any_NEON(const uint8* src_rgba, int src_stride_rgba, + uint8* dst_u, uint8* dst_v, int width); +void RGB24ToUVRow_Any_NEON(const uint8* src_rgb24, int src_stride_rgb24, + uint8* dst_u, uint8* dst_v, int width); +void RAWToUVRow_Any_NEON(const uint8* src_raw, int src_stride_raw, + uint8* dst_u, uint8* dst_v, int width); +void RGB565ToUVRow_Any_NEON(const uint8* src_rgb565, int src_stride_rgb565, + uint8* dst_u, uint8* dst_v, int width); +void ARGB1555ToUVRow_Any_NEON(const uint8* src_argb1555, + int src_stride_argb1555, + uint8* dst_u, uint8* dst_v, int width); +void ARGB4444ToUVRow_Any_NEON(const uint8* src_argb4444, + int src_stride_argb4444, + uint8* dst_u, uint8* dst_v, int width); +void ARGBToUVRow_C(const uint8* src_argb, int src_stride_argb, + uint8* dst_u, uint8* dst_v, int width); +void ARGBToUVJRow_C(const uint8* src_argb, int src_stride_argb, + uint8* dst_u, uint8* dst_v, int width); +void BGRAToUVRow_C(const uint8* src_bgra, int src_stride_bgra, + uint8* dst_u, uint8* dst_v, int width); +void ABGRToUVRow_C(const uint8* src_abgr, int src_stride_abgr, + uint8* dst_u, uint8* dst_v, int width); +void RGBAToUVRow_C(const uint8* src_rgba, int src_stride_rgba, + uint8* dst_u, uint8* dst_v, int width); +void RGB24ToUVRow_C(const uint8* src_rgb24, int src_stride_rgb24, + uint8* dst_u, uint8* dst_v, int width); +void RAWToUVRow_C(const uint8* src_raw, int src_stride_raw, + uint8* dst_u, uint8* dst_v, int width); +void RGB565ToUVRow_C(const uint8* src_rgb565, int src_stride_rgb565, + uint8* dst_u, uint8* dst_v, int width); +void ARGB1555ToUVRow_C(const uint8* src_argb1555, int src_stride_argb1555, + uint8* dst_u, uint8* dst_v, int width); +void ARGB4444ToUVRow_C(const uint8* src_argb4444, int src_stride_argb4444, + uint8* dst_u, uint8* dst_v, int width); + +void ARGBToUV444Row_SSSE3(const uint8* src_argb, + uint8* dst_u, uint8* dst_v, int width); +void ARGBToUV444Row_Any_SSSE3(const uint8* src_argb, + uint8* dst_u, uint8* dst_v, int width); + +void ARGBToUV444Row_C(const uint8* src_argb, + uint8* dst_u, uint8* dst_v, int width); +void ARGBToUV411Row_C(const uint8* src_argb, + uint8* dst_u, uint8* dst_v, int width); + +void MirrorRow_AVX2(const uint8* src, uint8* dst, int width); +void MirrorRow_SSSE3(const uint8* src, uint8* dst, int width); +void MirrorRow_NEON(const uint8* src, uint8* dst, int width); +void MirrorRow_DSPR2(const uint8* src, uint8* dst, int width); +void MirrorRow_MSA(const uint8* src, uint8* dst, int width); +void MirrorRow_C(const uint8* src, uint8* dst, int width); +void MirrorRow_Any_AVX2(const uint8* src, uint8* dst, int width); +void MirrorRow_Any_SSSE3(const uint8* src, uint8* dst, int width); +void MirrorRow_Any_SSE2(const uint8* src, uint8* dst, int width); +void MirrorRow_Any_NEON(const uint8* src, uint8* dst, int width); +void MirrorRow_Any_MSA(const uint8* src, uint8* dst, int width); + +void MirrorUVRow_SSSE3(const uint8* src_uv, uint8* dst_u, uint8* dst_v, + int width); +void MirrorUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, + int width); +void MirrorUVRow_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, + int width); +void MirrorUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int width); + +void ARGBMirrorRow_AVX2(const uint8* src, uint8* dst, int width); +void ARGBMirrorRow_SSE2(const uint8* src, uint8* dst, int width); +void ARGBMirrorRow_NEON(const uint8* src, uint8* dst, int width); +void ARGBMirrorRow_MSA(const uint8* src, uint8* dst, int width); +void ARGBMirrorRow_C(const uint8* src, uint8* dst, int width); +void ARGBMirrorRow_Any_AVX2(const uint8* src, uint8* dst, int width); +void ARGBMirrorRow_Any_SSE2(const uint8* src, uint8* dst, int width); +void ARGBMirrorRow_Any_NEON(const uint8* src, uint8* dst, int width); +void ARGBMirrorRow_Any_MSA(const uint8* src, uint8* dst, int width); + +void SplitUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int width); +void SplitUVRow_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, + int width); +void SplitUVRow_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, + int width); +void SplitUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, + int width); +void SplitUVRow_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, + int width); +void SplitUVRow_Any_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, + int width); +void SplitUVRow_Any_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, + int width); +void SplitUVRow_Any_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, + int width); +void SplitUVRow_Any_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, + int width); + +void MergeUVRow_C(const uint8* src_u, const uint8* src_v, uint8* dst_uv, + int width); +void MergeUVRow_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv, + int width); +void MergeUVRow_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv, + int width); +void MergeUVRow_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv, + int width); +void MergeUVRow_Any_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv, + int width); +void MergeUVRow_Any_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv, + int width); +void MergeUVRow_Any_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv, + int width); + +void CopyRow_SSE2(const uint8* src, uint8* dst, int count); +void CopyRow_AVX(const uint8* src, uint8* dst, int count); +void CopyRow_ERMS(const uint8* src, uint8* dst, int count); +void CopyRow_NEON(const uint8* src, uint8* dst, int count); +void CopyRow_MIPS(const uint8* src, uint8* dst, int count); +void CopyRow_C(const uint8* src, uint8* dst, int count); +void CopyRow_Any_SSE2(const uint8* src, uint8* dst, int count); +void CopyRow_Any_AVX(const uint8* src, uint8* dst, int count); +void CopyRow_Any_NEON(const uint8* src, uint8* dst, int count); + +void CopyRow_16_C(const uint16* src, uint16* dst, int count); + +void ARGBCopyAlphaRow_C(const uint8* src_argb, uint8* dst_argb, int width); +void ARGBCopyAlphaRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width); +void ARGBCopyAlphaRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width); +void ARGBCopyAlphaRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb, + int width); +void ARGBCopyAlphaRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb, + int width); + +void ARGBExtractAlphaRow_C(const uint8* src_argb, uint8* dst_a, int width); +void ARGBExtractAlphaRow_SSE2(const uint8* src_argb, uint8* dst_a, int width); +void ARGBExtractAlphaRow_NEON(const uint8* src_argb, uint8* dst_a, int width); +void ARGBExtractAlphaRow_Any_SSE2(const uint8* src_argb, uint8* dst_a, + int width); +void ARGBExtractAlphaRow_Any_NEON(const uint8* src_argb, uint8* dst_a, + int width); + +void ARGBCopyYToAlphaRow_C(const uint8* src_y, uint8* dst_argb, int width); +void ARGBCopyYToAlphaRow_SSE2(const uint8* src_y, uint8* dst_argb, int width); +void ARGBCopyYToAlphaRow_AVX2(const uint8* src_y, uint8* dst_argb, int width); +void ARGBCopyYToAlphaRow_Any_SSE2(const uint8* src_y, uint8* dst_argb, + int width); +void ARGBCopyYToAlphaRow_Any_AVX2(const uint8* src_y, uint8* dst_argb, + int width); + +void SetRow_C(uint8* dst, uint8 v8, int count); +void SetRow_X86(uint8* dst, uint8 v8, int count); +void SetRow_ERMS(uint8* dst, uint8 v8, int count); +void SetRow_NEON(uint8* dst, uint8 v8, int count); +void SetRow_Any_X86(uint8* dst, uint8 v8, int count); +void SetRow_Any_NEON(uint8* dst, uint8 v8, int count); + +void ARGBSetRow_C(uint8* dst_argb, uint32 v32, int count); +void ARGBSetRow_X86(uint8* dst_argb, uint32 v32, int count); +void ARGBSetRow_NEON(uint8* dst_argb, uint32 v32, int count); +void ARGBSetRow_Any_NEON(uint8* dst_argb, uint32 v32, int count); + +// ARGBShufflers for BGRAToARGB etc. +void ARGBShuffleRow_C(const uint8* src_argb, uint8* dst_argb, + const uint8* shuffler, int width); +void ARGBShuffleRow_SSE2(const uint8* src_argb, uint8* dst_argb, + const uint8* shuffler, int width); +void ARGBShuffleRow_SSSE3(const uint8* src_argb, uint8* dst_argb, + const uint8* shuffler, int width); +void ARGBShuffleRow_AVX2(const uint8* src_argb, uint8* dst_argb, + const uint8* shuffler, int width); +void ARGBShuffleRow_NEON(const uint8* src_argb, uint8* dst_argb, + const uint8* shuffler, int width); +void ARGBShuffleRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb, + const uint8* shuffler, int width); +void ARGBShuffleRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb, + const uint8* shuffler, int width); +void ARGBShuffleRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb, + const uint8* shuffler, int width); +void ARGBShuffleRow_Any_NEON(const uint8* src_argb, uint8* dst_argb, + const uint8* shuffler, int width); + +void RGB24ToARGBRow_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int width); +void RAWToARGBRow_SSSE3(const uint8* src_raw, uint8* dst_argb, int width); +void RAWToRGB24Row_SSSE3(const uint8* src_raw, uint8* dst_rgb24, int width); +void RGB565ToARGBRow_SSE2(const uint8* src_rgb565, uint8* dst_argb, int width); +void ARGB1555ToARGBRow_SSE2(const uint8* src_argb1555, uint8* dst_argb, + int width); +void ARGB4444ToARGBRow_SSE2(const uint8* src_argb4444, uint8* dst_argb, + int width); +void RGB565ToARGBRow_AVX2(const uint8* src_rgb565, uint8* dst_argb, int width); +void ARGB1555ToARGBRow_AVX2(const uint8* src_argb1555, uint8* dst_argb, + int width); +void ARGB4444ToARGBRow_AVX2(const uint8* src_argb4444, uint8* dst_argb, + int width); + +void RGB24ToARGBRow_NEON(const uint8* src_rgb24, uint8* dst_argb, int width); +void RAWToARGBRow_NEON(const uint8* src_raw, uint8* dst_argb, int width); +void RAWToRGB24Row_NEON(const uint8* src_raw, uint8* dst_rgb24, int width); +void RGB565ToARGBRow_NEON(const uint8* src_rgb565, uint8* dst_argb, int width); +void ARGB1555ToARGBRow_NEON(const uint8* src_argb1555, uint8* dst_argb, + int width); +void ARGB4444ToARGBRow_NEON(const uint8* src_argb4444, uint8* dst_argb, + int width); +void RGB24ToARGBRow_C(const uint8* src_rgb24, uint8* dst_argb, int width); +void RAWToARGBRow_C(const uint8* src_raw, uint8* dst_argb, int width); +void RAWToRGB24Row_C(const uint8* src_raw, uint8* dst_rgb24, int width); +void RGB565ToARGBRow_C(const uint8* src_rgb, uint8* dst_argb, int width); +void ARGB1555ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int width); +void ARGB4444ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int width); +void RGB24ToARGBRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_argb, + int width); +void RAWToARGBRow_Any_SSSE3(const uint8* src_raw, uint8* dst_argb, int width); +void RAWToRGB24Row_Any_SSSE3(const uint8* src_raw, uint8* dst_rgb24, int width); + +void RGB565ToARGBRow_Any_SSE2(const uint8* src_rgb565, uint8* dst_argb, + int width); +void ARGB1555ToARGBRow_Any_SSE2(const uint8* src_argb1555, uint8* dst_argb, + int width); +void ARGB4444ToARGBRow_Any_SSE2(const uint8* src_argb4444, uint8* dst_argb, + int width); +void RGB565ToARGBRow_Any_AVX2(const uint8* src_rgb565, uint8* dst_argb, + int width); +void ARGB1555ToARGBRow_Any_AVX2(const uint8* src_argb1555, uint8* dst_argb, + int width); +void ARGB4444ToARGBRow_Any_AVX2(const uint8* src_argb4444, uint8* dst_argb, + int width); + +void RGB24ToARGBRow_Any_NEON(const uint8* src_rgb24, uint8* dst_argb, + int width); +void RAWToARGBRow_Any_NEON(const uint8* src_raw, uint8* dst_argb, int width); +void RAWToRGB24Row_Any_NEON(const uint8* src_raw, uint8* dst_rgb24, int width); +void RGB565ToARGBRow_Any_NEON(const uint8* src_rgb565, uint8* dst_argb, + int width); +void ARGB1555ToARGBRow_Any_NEON(const uint8* src_argb1555, uint8* dst_argb, + int width); +void ARGB4444ToARGBRow_Any_NEON(const uint8* src_argb4444, uint8* dst_argb, + int width); + +void ARGBToRGB24Row_SSSE3(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToRAWRow_SSSE3(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToRGB565Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToARGB1555Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToARGB4444Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int width); + +void ARGBToRGB565DitherRow_C(const uint8* src_argb, uint8* dst_rgb, + const uint32 dither4, int width); +void ARGBToRGB565DitherRow_SSE2(const uint8* src_argb, uint8* dst_rgb, + const uint32 dither4, int width); +void ARGBToRGB565DitherRow_AVX2(const uint8* src_argb, uint8* dst_rgb, + const uint32 dither4, int width); + +void ARGBToRGB565Row_AVX2(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToARGB1555Row_AVX2(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToARGB4444Row_AVX2(const uint8* src_argb, uint8* dst_rgb, int width); + +void ARGBToRGB24Row_NEON(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToRAWRow_NEON(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToRGB565Row_NEON(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToARGB1555Row_NEON(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToARGB4444Row_NEON(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToRGB565DitherRow_NEON(const uint8* src_argb, uint8* dst_rgb, + const uint32 dither4, int width); + +void ARGBToRGBARow_C(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToRGB24Row_C(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToRAWRow_C(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToARGB1555Row_C(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToARGB4444Row_C(const uint8* src_argb, uint8* dst_rgb, int width); + +void J400ToARGBRow_SSE2(const uint8* src_y, uint8* dst_argb, int width); +void J400ToARGBRow_AVX2(const uint8* src_y, uint8* dst_argb, int width); +void J400ToARGBRow_NEON(const uint8* src_y, uint8* dst_argb, int width); +void J400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int width); +void J400ToARGBRow_Any_SSE2(const uint8* src_y, uint8* dst_argb, int width); +void J400ToARGBRow_Any_AVX2(const uint8* src_y, uint8* dst_argb, int width); +void J400ToARGBRow_Any_NEON(const uint8* src_y, uint8* dst_argb, int width); + +void I444ToARGBRow_C(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGBRow_C(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGBRow_C(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422AlphaToARGBRow_C(const uint8* y_buf, + const uint8* u_buf, + const uint8* v_buf, + const uint8* a_buf, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I411ToARGBRow_C(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV12ToARGBRow_C(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV12ToRGB565Row_C(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV21ToARGBRow_C(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void YUY2ToARGBRow_C(const uint8* src_yuy2, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void UYVYToARGBRow_C(const uint8* src_uyvy, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGBARow_C(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgba, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGB24Row_C(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGB4444Row_C(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb4444, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGB1555Row_C(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb4444, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGB565Row_C(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgb565, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGBRow_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGBRow_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGBARow_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I444ToARGBRow_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I444ToARGBRow_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I444ToARGBRow_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I444ToARGBRow_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGBRow_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422AlphaToARGBRow_SSSE3(const uint8* y_buf, + const uint8* u_buf, + const uint8* v_buf, + const uint8* a_buf, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422AlphaToARGBRow_AVX2(const uint8* y_buf, + const uint8* u_buf, + const uint8* v_buf, + const uint8* a_buf, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGBRow_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I411ToARGBRow_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I411ToARGBRow_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV12ToARGBRow_SSSE3(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV12ToARGBRow_AVX2(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV12ToRGB565Row_SSSE3(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV12ToRGB565Row_AVX2(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV21ToARGBRow_SSSE3(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV21ToARGBRow_AVX2(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void YUY2ToARGBRow_SSSE3(const uint8* src_yuy2, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void UYVYToARGBRow_SSSE3(const uint8* src_uyvy, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void YUY2ToARGBRow_AVX2(const uint8* src_yuy2, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void UYVYToARGBRow_AVX2(const uint8* src_uyvy, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGBARow_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgba, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGB4444Row_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGB4444Row_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGB1555Row_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGB1555Row_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGB565Row_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGB565Row_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGB24Row_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGB24Row_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGBRow_Any_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGBARow_Any_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I444ToARGBRow_Any_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I444ToARGBRow_Any_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGBRow_Any_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422AlphaToARGBRow_Any_SSSE3(const uint8* y_buf, + const uint8* u_buf, + const uint8* v_buf, + const uint8* a_buf, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422AlphaToARGBRow_Any_AVX2(const uint8* y_buf, + const uint8* u_buf, + const uint8* v_buf, + const uint8* a_buf, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I411ToARGBRow_Any_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I411ToARGBRow_Any_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV12ToARGBRow_Any_SSSE3(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV12ToARGBRow_Any_AVX2(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV21ToARGBRow_Any_SSSE3(const uint8* src_y, + const uint8* src_vu, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV21ToARGBRow_Any_AVX2(const uint8* src_y, + const uint8* src_vu, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV12ToRGB565Row_Any_SSSE3(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV12ToRGB565Row_Any_AVX2(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void YUY2ToARGBRow_Any_SSSE3(const uint8* src_yuy2, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void UYVYToARGBRow_Any_SSSE3(const uint8* src_uyvy, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void YUY2ToARGBRow_Any_AVX2(const uint8* src_yuy2, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void UYVYToARGBRow_Any_AVX2(const uint8* src_uyvy, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGBARow_Any_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgba, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGB4444Row_Any_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgba, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGB4444Row_Any_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgba, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGB1555Row_Any_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgba, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGB1555Row_Any_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgba, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGB565Row_Any_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgba, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGB565Row_Any_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_rgba, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGB24Row_Any_SSSE3(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGB24Row_Any_AVX2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); + +void I400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int width); +void I400ToARGBRow_SSE2(const uint8* src_y, uint8* dst_argb, int width); +void I400ToARGBRow_AVX2(const uint8* src_y, uint8* dst_argb, int width); +void I400ToARGBRow_NEON(const uint8* src_y, uint8* dst_argb, int width); +void I400ToARGBRow_Any_SSE2(const uint8* src_y, uint8* dst_argb, int width); +void I400ToARGBRow_Any_AVX2(const uint8* src_y, uint8* dst_argb, int width); +void I400ToARGBRow_Any_NEON(const uint8* src_y, uint8* dst_argb, int width); + +// ARGB preattenuated alpha blend. +void ARGBBlendRow_SSSE3(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBBlendRow_NEON(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBBlendRow_C(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); + +// Unattenuated planar alpha blend. +void BlendPlaneRow_SSSE3(const uint8* src0, const uint8* src1, + const uint8* alpha, uint8* dst, int width); +void BlendPlaneRow_Any_SSSE3(const uint8* src0, const uint8* src1, + const uint8* alpha, uint8* dst, int width); +void BlendPlaneRow_AVX2(const uint8* src0, const uint8* src1, + const uint8* alpha, uint8* dst, int width); +void BlendPlaneRow_Any_AVX2(const uint8* src0, const uint8* src1, + const uint8* alpha, uint8* dst, int width); +void BlendPlaneRow_C(const uint8* src0, const uint8* src1, + const uint8* alpha, uint8* dst, int width); + +// ARGB multiply images. Same API as Blend, but these require +// pointer and width alignment for SSE2. +void ARGBMultiplyRow_C(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBMultiplyRow_SSE2(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBMultiplyRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBMultiplyRow_AVX2(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBMultiplyRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBMultiplyRow_NEON(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBMultiplyRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); + +// ARGB add images. +void ARGBAddRow_C(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBAddRow_SSE2(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBAddRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBAddRow_AVX2(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBAddRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBAddRow_NEON(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBAddRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); + +// ARGB subtract images. Same API as Blend, but these require +// pointer and width alignment for SSE2. +void ARGBSubtractRow_C(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBSubtractRow_SSE2(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBSubtractRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBSubtractRow_AVX2(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBSubtractRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBSubtractRow_NEON(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); +void ARGBSubtractRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1, + uint8* dst_argb, int width); + +void ARGBToRGB24Row_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToRAWRow_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToRGB565Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToARGB1555Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, + int width); +void ARGBToARGB4444Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, + int width); + +void ARGBToRGB565DitherRow_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, + const uint32 dither4, int width); +void ARGBToRGB565DitherRow_Any_AVX2(const uint8* src_argb, uint8* dst_rgb, + const uint32 dither4, int width); + +void ARGBToRGB565Row_Any_AVX2(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToARGB1555Row_Any_AVX2(const uint8* src_argb, uint8* dst_rgb, + int width); +void ARGBToARGB4444Row_Any_AVX2(const uint8* src_argb, uint8* dst_rgb, + int width); + +void ARGBToRGB24Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToRAWRow_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToRGB565Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int width); +void ARGBToARGB1555Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, + int width); +void ARGBToARGB4444Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, + int width); +void ARGBToRGB565DitherRow_Any_NEON(const uint8* src_argb, uint8* dst_rgb, + const uint32 dither4, int width); + +void I444ToARGBRow_Any_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGBRow_Any_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422AlphaToARGBRow_Any_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + const uint8* src_a, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I411ToARGBRow_Any_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGBARow_Any_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGB24Row_Any_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGB4444Row_Any_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGB1555Row_Any_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToRGB565Row_Any_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV12ToARGBRow_Any_NEON(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV21ToARGBRow_Any_NEON(const uint8* src_y, + const uint8* src_vu, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void NV12ToRGB565Row_Any_NEON(const uint8* src_y, + const uint8* src_uv, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void YUY2ToARGBRow_Any_NEON(const uint8* src_yuy2, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void UYVYToARGBRow_Any_NEON(const uint8* src_uyvy, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGBRow_DSPR2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +void I422ToARGBRow_DSPR2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_argb, + const struct YuvConstants* yuvconstants, + int width); + +void YUY2ToYRow_AVX2(const uint8* src_yuy2, uint8* dst_y, int width); +void YUY2ToUVRow_AVX2(const uint8* src_yuy2, int stride_yuy2, + uint8* dst_u, uint8* dst_v, int width); +void YUY2ToUV422Row_AVX2(const uint8* src_yuy2, + uint8* dst_u, uint8* dst_v, int width); +void YUY2ToYRow_SSE2(const uint8* src_yuy2, uint8* dst_y, int width); +void YUY2ToUVRow_SSE2(const uint8* src_yuy2, int stride_yuy2, + uint8* dst_u, uint8* dst_v, int width); +void YUY2ToUV422Row_SSE2(const uint8* src_yuy2, + uint8* dst_u, uint8* dst_v, int width); +void YUY2ToYRow_NEON(const uint8* src_yuy2, uint8* dst_y, int width); +void YUY2ToUVRow_NEON(const uint8* src_yuy2, int stride_yuy2, + uint8* dst_u, uint8* dst_v, int width); +void YUY2ToUV422Row_NEON(const uint8* src_yuy2, + uint8* dst_u, uint8* dst_v, int width); +void YUY2ToYRow_C(const uint8* src_yuy2, uint8* dst_y, int width); +void YUY2ToUVRow_C(const uint8* src_yuy2, int stride_yuy2, + uint8* dst_u, uint8* dst_v, int width); +void YUY2ToUV422Row_C(const uint8* src_yuy2, + uint8* dst_u, uint8* dst_v, int width); +void YUY2ToYRow_Any_AVX2(const uint8* src_yuy2, uint8* dst_y, int width); +void YUY2ToUVRow_Any_AVX2(const uint8* src_yuy2, int stride_yuy2, + uint8* dst_u, uint8* dst_v, int width); +void YUY2ToUV422Row_Any_AVX2(const uint8* src_yuy2, + uint8* dst_u, uint8* dst_v, int width); +void YUY2ToYRow_Any_SSE2(const uint8* src_yuy2, uint8* dst_y, int width); +void YUY2ToUVRow_Any_SSE2(const uint8* src_yuy2, int stride_yuy2, + uint8* dst_u, uint8* dst_v, int width); +void YUY2ToUV422Row_Any_SSE2(const uint8* src_yuy2, + uint8* dst_u, uint8* dst_v, int width); +void YUY2ToYRow_Any_NEON(const uint8* src_yuy2, uint8* dst_y, int width); +void YUY2ToUVRow_Any_NEON(const uint8* src_yuy2, int stride_yuy2, + uint8* dst_u, uint8* dst_v, int width); +void YUY2ToUV422Row_Any_NEON(const uint8* src_yuy2, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int width); +void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToUV422Row_AVX2(const uint8* src_uyvy, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToYRow_SSE2(const uint8* src_uyvy, uint8* dst_y, int width); +void UYVYToUVRow_SSE2(const uint8* src_uyvy, int stride_uyvy, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToUV422Row_SSE2(const uint8* src_uyvy, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int width); +void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToUV422Row_AVX2(const uint8* src_uyvy, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToYRow_NEON(const uint8* src_uyvy, uint8* dst_y, int width); +void UYVYToUVRow_NEON(const uint8* src_uyvy, int stride_uyvy, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToUV422Row_NEON(const uint8* src_uyvy, + uint8* dst_u, uint8* dst_v, int width); + +void UYVYToYRow_C(const uint8* src_uyvy, uint8* dst_y, int width); +void UYVYToUVRow_C(const uint8* src_uyvy, int stride_uyvy, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToUV422Row_C(const uint8* src_uyvy, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToYRow_Any_AVX2(const uint8* src_uyvy, uint8* dst_y, int width); +void UYVYToUVRow_Any_AVX2(const uint8* src_uyvy, int stride_uyvy, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToUV422Row_Any_AVX2(const uint8* src_uyvy, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToYRow_Any_SSE2(const uint8* src_uyvy, uint8* dst_y, int width); +void UYVYToUVRow_Any_SSE2(const uint8* src_uyvy, int stride_uyvy, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToUV422Row_Any_SSE2(const uint8* src_uyvy, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToYRow_Any_NEON(const uint8* src_uyvy, uint8* dst_y, int width); +void UYVYToUVRow_Any_NEON(const uint8* src_uyvy, int stride_uyvy, + uint8* dst_u, uint8* dst_v, int width); +void UYVYToUV422Row_Any_NEON(const uint8* src_uyvy, + uint8* dst_u, uint8* dst_v, int width); + +void I422ToYUY2Row_C(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_yuy2, int width); +void I422ToUYVYRow_C(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_uyvy, int width); +void I422ToYUY2Row_SSE2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_yuy2, int width); +void I422ToUYVYRow_SSE2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_uyvy, int width); +void I422ToYUY2Row_Any_SSE2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_yuy2, int width); +void I422ToUYVYRow_Any_SSE2(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_uyvy, int width); +void I422ToYUY2Row_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_yuy2, int width); +void I422ToUYVYRow_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_uyvy, int width); +void I422ToYUY2Row_Any_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_yuy2, int width); +void I422ToUYVYRow_Any_NEON(const uint8* src_y, + const uint8* src_u, + const uint8* src_v, + uint8* dst_uyvy, int width); + +// Effects related row functions. +void ARGBAttenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width); +void ARGBAttenuateRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width); +void ARGBAttenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width); +void ARGBAttenuateRow_NEON(const uint8* src_argb, uint8* dst_argb, int width); +void ARGBAttenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb, + int width); +void ARGBAttenuateRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb, + int width); +void ARGBAttenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb, + int width); +void ARGBAttenuateRow_Any_NEON(const uint8* src_argb, uint8* dst_argb, + int width); + +// Inverse table for unattenuate, shared by C and SSE2. +extern const uint32 fixed_invtbl8[256]; +void ARGBUnattenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width); +void ARGBUnattenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width); +void ARGBUnattenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width); +void ARGBUnattenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb, + int width); +void ARGBUnattenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb, + int width); + +void ARGBGrayRow_C(const uint8* src_argb, uint8* dst_argb, int width); +void ARGBGrayRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width); +void ARGBGrayRow_NEON(const uint8* src_argb, uint8* dst_argb, int width); + +void ARGBSepiaRow_C(uint8* dst_argb, int width); +void ARGBSepiaRow_SSSE3(uint8* dst_argb, int width); +void ARGBSepiaRow_NEON(uint8* dst_argb, int width); + +void ARGBColorMatrixRow_C(const uint8* src_argb, uint8* dst_argb, + const int8* matrix_argb, int width); +void ARGBColorMatrixRow_SSSE3(const uint8* src_argb, uint8* dst_argb, + const int8* matrix_argb, int width); +void ARGBColorMatrixRow_NEON(const uint8* src_argb, uint8* dst_argb, + const int8* matrix_argb, int width); + +void ARGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width); +void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width); + +void RGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width); +void RGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width); + +void ARGBQuantizeRow_C(uint8* dst_argb, int scale, int interval_size, + int interval_offset, int width); +void ARGBQuantizeRow_SSE2(uint8* dst_argb, int scale, int interval_size, + int interval_offset, int width); +void ARGBQuantizeRow_NEON(uint8* dst_argb, int scale, int interval_size, + int interval_offset, int width); + +void ARGBShadeRow_C(const uint8* src_argb, uint8* dst_argb, int width, + uint32 value); +void ARGBShadeRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width, + uint32 value); +void ARGBShadeRow_NEON(const uint8* src_argb, uint8* dst_argb, int width, + uint32 value); + +// Used for blur. +void CumulativeSumToAverageRow_SSE2(const int32* topleft, const int32* botleft, + int width, int area, uint8* dst, int count); +void ComputeCumulativeSumRow_SSE2(const uint8* row, int32* cumsum, + const int32* previous_cumsum, int width); + +void CumulativeSumToAverageRow_C(const int32* topleft, const int32* botleft, + int width, int area, uint8* dst, int count); +void ComputeCumulativeSumRow_C(const uint8* row, int32* cumsum, + const int32* previous_cumsum, int width); + +LIBYUV_API +void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride, + uint8* dst_argb, const float* uv_dudv, int width); +LIBYUV_API +void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride, + uint8* dst_argb, const float* uv_dudv, int width); + +// Used for I420Scale, ARGBScale, and ARGBInterpolate. +void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr, + ptrdiff_t src_stride_ptr, + int width, int source_y_fraction); +void InterpolateRow_SSSE3(uint8* dst_ptr, const uint8* src_ptr, + ptrdiff_t src_stride_ptr, int width, + int source_y_fraction); +void InterpolateRow_AVX2(uint8* dst_ptr, const uint8* src_ptr, + ptrdiff_t src_stride_ptr, int width, + int source_y_fraction); +void InterpolateRow_NEON(uint8* dst_ptr, const uint8* src_ptr, + ptrdiff_t src_stride_ptr, int width, + int source_y_fraction); +void InterpolateRow_DSPR2(uint8* dst_ptr, const uint8* src_ptr, + ptrdiff_t src_stride_ptr, int width, + int source_y_fraction); +void InterpolateRow_Any_NEON(uint8* dst_ptr, const uint8* src_ptr, + ptrdiff_t src_stride_ptr, int width, + int source_y_fraction); +void InterpolateRow_Any_SSSE3(uint8* dst_ptr, const uint8* src_ptr, + ptrdiff_t src_stride_ptr, int width, + int source_y_fraction); +void InterpolateRow_Any_AVX2(uint8* dst_ptr, const uint8* src_ptr, + ptrdiff_t src_stride_ptr, int width, + int source_y_fraction); +void InterpolateRow_Any_DSPR2(uint8* dst_ptr, const uint8* src_ptr, + ptrdiff_t src_stride_ptr, int width, + int source_y_fraction); + +void InterpolateRow_16_C(uint16* dst_ptr, const uint16* src_ptr, + ptrdiff_t src_stride_ptr, + int width, int source_y_fraction); + +// Sobel images. +void SobelXRow_C(const uint8* src_y0, const uint8* src_y1, const uint8* src_y2, + uint8* dst_sobelx, int width); +void SobelXRow_SSE2(const uint8* src_y0, const uint8* src_y1, + const uint8* src_y2, uint8* dst_sobelx, int width); +void SobelXRow_NEON(const uint8* src_y0, const uint8* src_y1, + const uint8* src_y2, uint8* dst_sobelx, int width); +void SobelYRow_C(const uint8* src_y0, const uint8* src_y1, + uint8* dst_sobely, int width); +void SobelYRow_SSE2(const uint8* src_y0, const uint8* src_y1, + uint8* dst_sobely, int width); +void SobelYRow_NEON(const uint8* src_y0, const uint8* src_y1, + uint8* dst_sobely, int width); +void SobelRow_C(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_argb, int width); +void SobelRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_argb, int width); +void SobelRow_NEON(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_argb, int width); +void SobelToPlaneRow_C(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_y, int width); +void SobelToPlaneRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_y, int width); +void SobelToPlaneRow_NEON(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_y, int width); +void SobelXYRow_C(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_argb, int width); +void SobelXYRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_argb, int width); +void SobelXYRow_NEON(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_argb, int width); +void SobelRow_Any_SSE2(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_argb, int width); +void SobelRow_Any_NEON(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_argb, int width); +void SobelToPlaneRow_Any_SSE2(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_y, int width); +void SobelToPlaneRow_Any_NEON(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_y, int width); +void SobelXYRow_Any_SSE2(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_argb, int width); +void SobelXYRow_Any_NEON(const uint8* src_sobelx, const uint8* src_sobely, + uint8* dst_argb, int width); + +void ARGBPolynomialRow_C(const uint8* src_argb, + uint8* dst_argb, const float* poly, + int width); +void ARGBPolynomialRow_SSE2(const uint8* src_argb, + uint8* dst_argb, const float* poly, + int width); +void ARGBPolynomialRow_AVX2(const uint8* src_argb, + uint8* dst_argb, const float* poly, + int width); + +// Scale and convert to half float. +void HalfFloatRow_C(const uint16* src, uint16* dst, float scale, int width); +void HalfFloatRow_AVX2(const uint16* src, uint16* dst, float scale, int width); +void HalfFloatRow_Any_AVX2(const uint16* src, uint16* dst, float scale, + int width); +void HalfFloatRow_SSE2(const uint16* src, uint16* dst, float scale, int width); +void HalfFloatRow_Any_SSE2(const uint16* src, uint16* dst, float scale, + int width); + +void ARGBLumaColorTableRow_C(const uint8* src_argb, uint8* dst_argb, int width, + const uint8* luma, uint32 lumacoeff); +void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb, + int width, + const uint8* luma, uint32 lumacoeff); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_ROW_H_ diff --git a/third_party/libyuv/include/libyuv/scale.h b/third_party/libyuv/include/libyuv/scale.h new file mode 100644 index 000000000..ae1469459 --- /dev/null +++ b/third_party/libyuv/include/libyuv/scale.h @@ -0,0 +1,103 @@ +/* + * Copyright 2011 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_SCALE_H_ +#define INCLUDE_LIBYUV_SCALE_H_ + +#include "libyuv/basic_types.h" + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +// Supported filtering. +typedef enum FilterMode { + kFilterNone = 0, // Point sample; Fastest. + kFilterLinear = 1, // Filter horizontally only. + kFilterBilinear = 2, // Faster than box, but lower quality scaling down. + kFilterBox = 3 // Highest quality. +} FilterModeEnum; + +// Scale a YUV plane. +LIBYUV_API +void ScalePlane(const uint8* src, int src_stride, + int src_width, int src_height, + uint8* dst, int dst_stride, + int dst_width, int dst_height, + enum FilterMode filtering); + +LIBYUV_API +void ScalePlane_16(const uint16* src, int src_stride, + int src_width, int src_height, + uint16* dst, int dst_stride, + int dst_width, int dst_height, + enum FilterMode filtering); + +// Scales a YUV 4:2:0 image from the src width and height to the +// dst width and height. +// If filtering is kFilterNone, a simple nearest-neighbor algorithm is +// used. This produces basic (blocky) quality at the fastest speed. +// If filtering is kFilterBilinear, interpolation is used to produce a better +// quality image, at the expense of speed. +// If filtering is kFilterBox, averaging is used to produce ever better +// quality image, at further expense of speed. +// Returns 0 if successful. + +LIBYUV_API +int I420Scale(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + int src_width, int src_height, + uint8* dst_y, int dst_stride_y, + uint8* dst_u, int dst_stride_u, + uint8* dst_v, int dst_stride_v, + int dst_width, int dst_height, + enum FilterMode filtering); + +LIBYUV_API +int I420Scale_16(const uint16* src_y, int src_stride_y, + const uint16* src_u, int src_stride_u, + const uint16* src_v, int src_stride_v, + int src_width, int src_height, + uint16* dst_y, int dst_stride_y, + uint16* dst_u, int dst_stride_u, + uint16* dst_v, int dst_stride_v, + int dst_width, int dst_height, + enum FilterMode filtering); + +#ifdef __cplusplus +// Legacy API. Deprecated. +LIBYUV_API +int Scale(const uint8* src_y, const uint8* src_u, const uint8* src_v, + int src_stride_y, int src_stride_u, int src_stride_v, + int src_width, int src_height, + uint8* dst_y, uint8* dst_u, uint8* dst_v, + int dst_stride_y, int dst_stride_u, int dst_stride_v, + int dst_width, int dst_height, + LIBYUV_BOOL interpolate); + +// Legacy API. Deprecated. +LIBYUV_API +int ScaleOffset(const uint8* src_i420, int src_width, int src_height, + uint8* dst_i420, int dst_width, int dst_height, int dst_yoffset, + LIBYUV_BOOL interpolate); + +// For testing, allow disabling of specialized scalers. +LIBYUV_API +void SetUseReferenceImpl(LIBYUV_BOOL use); +#endif // __cplusplus + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_SCALE_H_ diff --git a/third_party/libyuv/include/libyuv/scale_argb.h b/third_party/libyuv/include/libyuv/scale_argb.h new file mode 100644 index 000000000..35cd191c0 --- /dev/null +++ b/third_party/libyuv/include/libyuv/scale_argb.h @@ -0,0 +1,56 @@ +/* + * Copyright 2012 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_SCALE_ARGB_H_ +#define INCLUDE_LIBYUV_SCALE_ARGB_H_ + +#include "libyuv/basic_types.h" +#include "libyuv/scale.h" // For FilterMode + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +LIBYUV_API +int ARGBScale(const uint8* src_argb, int src_stride_argb, + int src_width, int src_height, + uint8* dst_argb, int dst_stride_argb, + int dst_width, int dst_height, + enum FilterMode filtering); + +// Clipped scale takes destination rectangle coordinates for clip values. +LIBYUV_API +int ARGBScaleClip(const uint8* src_argb, int src_stride_argb, + int src_width, int src_height, + uint8* dst_argb, int dst_stride_argb, + int dst_width, int dst_height, + int clip_x, int clip_y, int clip_width, int clip_height, + enum FilterMode filtering); + +// Scale with YUV conversion to ARGB and clipping. +LIBYUV_API +int YUVToARGBScaleClip(const uint8* src_y, int src_stride_y, + const uint8* src_u, int src_stride_u, + const uint8* src_v, int src_stride_v, + uint32 src_fourcc, + int src_width, int src_height, + uint8* dst_argb, int dst_stride_argb, + uint32 dst_fourcc, + int dst_width, int dst_height, + int clip_x, int clip_y, int clip_width, int clip_height, + enum FilterMode filtering); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_SCALE_ARGB_H_ diff --git a/third_party/libyuv/include/libyuv/scale_row.h b/third_party/libyuv/include/libyuv/scale_row.h new file mode 100644 index 000000000..791fbf7d0 --- /dev/null +++ b/third_party/libyuv/include/libyuv/scale_row.h @@ -0,0 +1,503 @@ +/* + * Copyright 2013 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_SCALE_ROW_H_ +#define INCLUDE_LIBYUV_SCALE_ROW_H_ + +#include "libyuv/basic_types.h" +#include "libyuv/scale.h" + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +#if defined(__pnacl__) || defined(__CLR_VER) || \ + (defined(__i386__) && !defined(__SSE2__)) +#define LIBYUV_DISABLE_X86 +#endif +// MemorySanitizer does not support assembly code yet. http://crbug.com/344505 +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#define LIBYUV_DISABLE_X86 +#endif +#endif + +// GCC >= 4.7.0 required for AVX2. +#if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) +#if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 7)) +#define GCC_HAS_AVX2 1 +#endif // GNUC >= 4.7 +#endif // __GNUC__ + +// clang >= 3.4.0 required for AVX2. +#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) +#if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4)) +#define CLANG_HAS_AVX2 1 +#endif // clang >= 3.4 +#endif // __clang__ + +// Visual C 2012 required for AVX2. +#if defined(_M_IX86) && !defined(__clang__) && \ + defined(_MSC_VER) && _MSC_VER >= 1700 +#define VISUALC_HAS_AVX2 1 +#endif // VisualStudio >= 2012 + +// The following are available on all x86 platforms: +#if !defined(LIBYUV_DISABLE_X86) && \ + (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) +#define HAS_FIXEDDIV1_X86 +#define HAS_FIXEDDIV_X86 +#define HAS_SCALEARGBCOLS_SSE2 +#define HAS_SCALEARGBCOLSUP2_SSE2 +#define HAS_SCALEARGBFILTERCOLS_SSSE3 +#define HAS_SCALEARGBROWDOWN2_SSE2 +#define HAS_SCALEARGBROWDOWNEVEN_SSE2 +#define HAS_SCALECOLSUP2_SSE2 +#define HAS_SCALEFILTERCOLS_SSSE3 +#define HAS_SCALEROWDOWN2_SSSE3 +#define HAS_SCALEROWDOWN34_SSSE3 +#define HAS_SCALEROWDOWN38_SSSE3 +#define HAS_SCALEROWDOWN4_SSSE3 +#define HAS_SCALEADDROW_SSE2 +#endif + +// The following are available on all x86 platforms, but +// require VS2012, clang 3.4 or gcc 4.7. +// The code supports NaCL but requires a new compiler and validator. +#if !defined(LIBYUV_DISABLE_X86) && (defined(VISUALC_HAS_AVX2) || \ + defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2)) +#define HAS_SCALEADDROW_AVX2 +#define HAS_SCALEROWDOWN2_AVX2 +#define HAS_SCALEROWDOWN4_AVX2 +#endif + +// The following are available on Neon platforms: +#if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \ + (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__)) +#define HAS_SCALEARGBCOLS_NEON +#define HAS_SCALEARGBROWDOWN2_NEON +#define HAS_SCALEARGBROWDOWNEVEN_NEON +#define HAS_SCALEFILTERCOLS_NEON +#define HAS_SCALEROWDOWN2_NEON +#define HAS_SCALEROWDOWN34_NEON +#define HAS_SCALEROWDOWN38_NEON +#define HAS_SCALEROWDOWN4_NEON +#define HAS_SCALEARGBFILTERCOLS_NEON +#endif + +// The following are available on Mips platforms: +#if !defined(LIBYUV_DISABLE_MIPS) && !defined(__native_client__) && \ + defined(__mips__) && defined(__mips_dsp) && (__mips_dsp_rev >= 2) +#define HAS_SCALEROWDOWN2_DSPR2 +#define HAS_SCALEROWDOWN4_DSPR2 +#define HAS_SCALEROWDOWN34_DSPR2 +#define HAS_SCALEROWDOWN38_DSPR2 +#endif + +// Scale ARGB vertically with bilinear interpolation. +void ScalePlaneVertical(int src_height, + int dst_width, int dst_height, + int src_stride, int dst_stride, + const uint8* src_argb, uint8* dst_argb, + int x, int y, int dy, + int bpp, enum FilterMode filtering); + +void ScalePlaneVertical_16(int src_height, + int dst_width, int dst_height, + int src_stride, int dst_stride, + const uint16* src_argb, uint16* dst_argb, + int x, int y, int dy, + int wpp, enum FilterMode filtering); + +// Simplify the filtering based on scale factors. +enum FilterMode ScaleFilterReduce(int src_width, int src_height, + int dst_width, int dst_height, + enum FilterMode filtering); + +// Divide num by div and return as 16.16 fixed point result. +int FixedDiv_C(int num, int div); +int FixedDiv_X86(int num, int div); +// Divide num - 1 by div - 1 and return as 16.16 fixed point result. +int FixedDiv1_C(int num, int div); +int FixedDiv1_X86(int num, int div); +#ifdef HAS_FIXEDDIV_X86 +#define FixedDiv FixedDiv_X86 +#define FixedDiv1 FixedDiv1_X86 +#else +#define FixedDiv FixedDiv_C +#define FixedDiv1 FixedDiv1_C +#endif + +// Compute slope values for stepping. +void ScaleSlope(int src_width, int src_height, + int dst_width, int dst_height, + enum FilterMode filtering, + int* x, int* y, int* dx, int* dy); + +void ScaleRowDown2_C(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown2_16_C(const uint16* src_ptr, ptrdiff_t src_stride, + uint16* dst, int dst_width); +void ScaleRowDown2Linear_C(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown2Linear_16_C(const uint16* src_ptr, ptrdiff_t src_stride, + uint16* dst, int dst_width); +void ScaleRowDown2Box_C(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown2Box_Odd_C(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown2Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride, + uint16* dst, int dst_width); +void ScaleRowDown4_C(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown4_16_C(const uint16* src_ptr, ptrdiff_t src_stride, + uint16* dst, int dst_width); +void ScaleRowDown4Box_C(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown4Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride, + uint16* dst, int dst_width); +void ScaleRowDown34_C(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown34_16_C(const uint16* src_ptr, ptrdiff_t src_stride, + uint16* dst, int dst_width); +void ScaleRowDown34_0_Box_C(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* d, int dst_width); +void ScaleRowDown34_0_Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride, + uint16* d, int dst_width); +void ScaleRowDown34_1_Box_C(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* d, int dst_width); +void ScaleRowDown34_1_Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride, + uint16* d, int dst_width); +void ScaleCols_C(uint8* dst_ptr, const uint8* src_ptr, + int dst_width, int x, int dx); +void ScaleCols_16_C(uint16* dst_ptr, const uint16* src_ptr, + int dst_width, int x, int dx); +void ScaleColsUp2_C(uint8* dst_ptr, const uint8* src_ptr, + int dst_width, int, int); +void ScaleColsUp2_16_C(uint16* dst_ptr, const uint16* src_ptr, + int dst_width, int, int); +void ScaleFilterCols_C(uint8* dst_ptr, const uint8* src_ptr, + int dst_width, int x, int dx); +void ScaleFilterCols_16_C(uint16* dst_ptr, const uint16* src_ptr, + int dst_width, int x, int dx); +void ScaleFilterCols64_C(uint8* dst_ptr, const uint8* src_ptr, + int dst_width, int x, int dx); +void ScaleFilterCols64_16_C(uint16* dst_ptr, const uint16* src_ptr, + int dst_width, int x, int dx); +void ScaleRowDown38_C(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown38_16_C(const uint16* src_ptr, ptrdiff_t src_stride, + uint16* dst, int dst_width); +void ScaleRowDown38_3_Box_C(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown38_3_Box_16_C(const uint16* src_ptr, + ptrdiff_t src_stride, + uint16* dst_ptr, int dst_width); +void ScaleRowDown38_2_Box_C(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown38_2_Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride, + uint16* dst_ptr, int dst_width); +void ScaleAddRow_C(const uint8* src_ptr, uint16* dst_ptr, int src_width); +void ScaleAddRow_16_C(const uint16* src_ptr, uint32* dst_ptr, int src_width); +void ScaleARGBRowDown2_C(const uint8* src_argb, + ptrdiff_t src_stride, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDown2Linear_C(const uint8* src_argb, + ptrdiff_t src_stride, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDown2Box_C(const uint8* src_argb, ptrdiff_t src_stride, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDownEven_C(const uint8* src_argb, ptrdiff_t src_stride, + int src_stepx, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDownEvenBox_C(const uint8* src_argb, + ptrdiff_t src_stride, + int src_stepx, + uint8* dst_argb, int dst_width); +void ScaleARGBCols_C(uint8* dst_argb, const uint8* src_argb, + int dst_width, int x, int dx); +void ScaleARGBCols64_C(uint8* dst_argb, const uint8* src_argb, + int dst_width, int x, int dx); +void ScaleARGBColsUp2_C(uint8* dst_argb, const uint8* src_argb, + int dst_width, int, int); +void ScaleARGBFilterCols_C(uint8* dst_argb, const uint8* src_argb, + int dst_width, int x, int dx); +void ScaleARGBFilterCols64_C(uint8* dst_argb, const uint8* src_argb, + int dst_width, int x, int dx); + +// Specialized scalers for x86. +void ScaleRowDown2_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown2Linear_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown2Box_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown2_AVX2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown2Linear_AVX2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown2Box_AVX2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown4_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown4Box_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown4_AVX2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown4Box_AVX2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); + +void ScaleRowDown34_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown34_1_Box_SSSE3(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown34_0_Box_SSSE3(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown38_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown38_3_Box_SSSE3(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown38_2_Box_SSSE3(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown2_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown2Linear_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown2Box_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown2Box_Odd_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown2_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown2Linear_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown2Box_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown2Box_Odd_AVX2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown4_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown4Box_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown4_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown4Box_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); + +void ScaleRowDown34_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown34_1_Box_Any_SSSE3(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown34_0_Box_Any_SSSE3(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown38_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown38_3_Box_Any_SSSE3(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown38_2_Box_Any_SSSE3(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); + +void ScaleAddRow_SSE2(const uint8* src_ptr, uint16* dst_ptr, int src_width); +void ScaleAddRow_AVX2(const uint8* src_ptr, uint16* dst_ptr, int src_width); +void ScaleAddRow_Any_SSE2(const uint8* src_ptr, uint16* dst_ptr, int src_width); +void ScaleAddRow_Any_AVX2(const uint8* src_ptr, uint16* dst_ptr, int src_width); + +void ScaleFilterCols_SSSE3(uint8* dst_ptr, const uint8* src_ptr, + int dst_width, int x, int dx); +void ScaleColsUp2_SSE2(uint8* dst_ptr, const uint8* src_ptr, + int dst_width, int x, int dx); + + +// ARGB Column functions +void ScaleARGBCols_SSE2(uint8* dst_argb, const uint8* src_argb, + int dst_width, int x, int dx); +void ScaleARGBFilterCols_SSSE3(uint8* dst_argb, const uint8* src_argb, + int dst_width, int x, int dx); +void ScaleARGBColsUp2_SSE2(uint8* dst_argb, const uint8* src_argb, + int dst_width, int x, int dx); +void ScaleARGBFilterCols_NEON(uint8* dst_argb, const uint8* src_argb, + int dst_width, int x, int dx); +void ScaleARGBCols_NEON(uint8* dst_argb, const uint8* src_argb, + int dst_width, int x, int dx); +void ScaleARGBFilterCols_Any_NEON(uint8* dst_argb, const uint8* src_argb, + int dst_width, int x, int dx); +void ScaleARGBCols_Any_NEON(uint8* dst_argb, const uint8* src_argb, + int dst_width, int x, int dx); + +// ARGB Row functions +void ScaleARGBRowDown2_SSE2(const uint8* src_argb, ptrdiff_t src_stride, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDown2Linear_SSE2(const uint8* src_argb, ptrdiff_t src_stride, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDown2Box_SSE2(const uint8* src_argb, ptrdiff_t src_stride, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDown2_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleARGBRowDown2Linear_NEON(const uint8* src_argb, ptrdiff_t src_stride, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDown2Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleARGBRowDown2_Any_SSE2(const uint8* src_argb, ptrdiff_t src_stride, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDown2Linear_Any_SSE2(const uint8* src_argb, + ptrdiff_t src_stride, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDown2Box_Any_SSE2(const uint8* src_argb, ptrdiff_t src_stride, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDown2_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleARGBRowDown2Linear_Any_NEON(const uint8* src_argb, + ptrdiff_t src_stride, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDown2Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); + +void ScaleARGBRowDownEven_SSE2(const uint8* src_argb, ptrdiff_t src_stride, + int src_stepx, uint8* dst_argb, int dst_width); +void ScaleARGBRowDownEvenBox_SSE2(const uint8* src_argb, ptrdiff_t src_stride, + int src_stepx, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDownEven_NEON(const uint8* src_argb, ptrdiff_t src_stride, + int src_stepx, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDownEvenBox_NEON(const uint8* src_argb, ptrdiff_t src_stride, + int src_stepx, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDownEven_Any_SSE2(const uint8* src_argb, ptrdiff_t src_stride, + int src_stepx, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDownEvenBox_Any_SSE2(const uint8* src_argb, + ptrdiff_t src_stride, + int src_stepx, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDownEven_Any_NEON(const uint8* src_argb, ptrdiff_t src_stride, + int src_stepx, + uint8* dst_argb, int dst_width); +void ScaleARGBRowDownEvenBox_Any_NEON(const uint8* src_argb, + ptrdiff_t src_stride, + int src_stepx, + uint8* dst_argb, int dst_width); + +// ScaleRowDown2Box also used by planar functions +// NEON downscalers with interpolation. + +// Note - not static due to reuse in convert for 444 to 420. +void ScaleRowDown2_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown2Linear_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown2Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); + +void ScaleRowDown4_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown4Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); + +// Down scale from 4 to 3 pixels. Use the neon multilane read/write +// to load up the every 4th pixel into a 4 different registers. +// Point samples 32 pixels to 24 pixels. +void ScaleRowDown34_NEON(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown34_0_Box_NEON(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown34_1_Box_NEON(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); + +// 32 -> 12 +void ScaleRowDown38_NEON(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +// 32x3 -> 12x1 +void ScaleRowDown38_3_Box_NEON(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +// 32x2 -> 12x1 +void ScaleRowDown38_2_Box_NEON(const uint8* src_ptr, + ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); + +void ScaleRowDown2_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown2Linear_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown2Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown2Box_Odd_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown4_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown4Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown34_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown34_0_Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown34_1_Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +// 32 -> 12 +void ScaleRowDown38_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +// 32x3 -> 12x1 +void ScaleRowDown38_3_Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +// 32x2 -> 12x1 +void ScaleRowDown38_2_Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); + +void ScaleAddRow_NEON(const uint8* src_ptr, uint16* dst_ptr, int src_width); +void ScaleAddRow_Any_NEON(const uint8* src_ptr, uint16* dst_ptr, int src_width); + +void ScaleFilterCols_NEON(uint8* dst_ptr, const uint8* src_ptr, + int dst_width, int x, int dx); + +void ScaleFilterCols_Any_NEON(uint8* dst_ptr, const uint8* src_ptr, + int dst_width, int x, int dx); + +void ScaleRowDown2_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown2Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown4_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown4Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown34_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown34_0_Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* d, int dst_width); +void ScaleRowDown34_1_Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* d, int dst_width); +void ScaleRowDown38_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst, int dst_width); +void ScaleRowDown38_2_Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); +void ScaleRowDown38_3_Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_SCALE_ROW_H_ diff --git a/third_party/libyuv/include/libyuv/version.h b/third_party/libyuv/include/libyuv/version.h new file mode 100644 index 000000000..3a8f6337c --- /dev/null +++ b/third_party/libyuv/include/libyuv/version.h @@ -0,0 +1,16 @@ +/* + * Copyright 2012 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_VERSION_H_ +#define INCLUDE_LIBYUV_VERSION_H_ + +#define LIBYUV_VERSION 1622 + +#endif // INCLUDE_LIBYUV_VERSION_H_ diff --git a/third_party/libyuv/include/libyuv/video_common.h b/third_party/libyuv/include/libyuv/video_common.h new file mode 100644 index 000000000..cb425426a --- /dev/null +++ b/third_party/libyuv/include/libyuv/video_common.h @@ -0,0 +1,184 @@ +/* + * Copyright 2011 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +// Common definitions for video, including fourcc and VideoFormat. + +#ifndef INCLUDE_LIBYUV_VIDEO_COMMON_H_ +#define INCLUDE_LIBYUV_VIDEO_COMMON_H_ + +#include "libyuv/basic_types.h" + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +////////////////////////////////////////////////////////////////////////////// +// Definition of FourCC codes +////////////////////////////////////////////////////////////////////////////// + +// Convert four characters to a FourCC code. +// Needs to be a macro otherwise the OS X compiler complains when the kFormat* +// constants are used in a switch. +#ifdef __cplusplus +#define FOURCC(a, b, c, d) ( \ + (static_cast(a)) | (static_cast(b) << 8) | \ + (static_cast(c) << 16) | (static_cast(d) << 24)) +#else +#define FOURCC(a, b, c, d) ( \ + ((uint32)(a)) | ((uint32)(b) << 8) | /* NOLINT */ \ + ((uint32)(c) << 16) | ((uint32)(d) << 24)) /* NOLINT */ +#endif + +// Some pages discussing FourCC codes: +// http://www.fourcc.org/yuv.php +// http://v4l2spec.bytesex.org/spec/book1.htm +// http://developer.apple.com/quicktime/icefloe/dispatch020.html +// http://msdn.microsoft.com/library/windows/desktop/dd206750.aspx#nv12 +// http://people.xiph.org/~xiphmont/containers/nut/nut4cc.txt + +// FourCC codes grouped according to implementation efficiency. +// Primary formats should convert in 1 efficient step. +// Secondary formats are converted in 2 steps. +// Auxilliary formats call primary converters. +enum FourCC { + // 9 Primary YUV formats: 5 planar, 2 biplanar, 2 packed. + FOURCC_I420 = FOURCC('I', '4', '2', '0'), + FOURCC_I422 = FOURCC('I', '4', '2', '2'), + FOURCC_I444 = FOURCC('I', '4', '4', '4'), + FOURCC_I411 = FOURCC('I', '4', '1', '1'), + FOURCC_I400 = FOURCC('I', '4', '0', '0'), + FOURCC_NV21 = FOURCC('N', 'V', '2', '1'), + FOURCC_NV12 = FOURCC('N', 'V', '1', '2'), + FOURCC_YUY2 = FOURCC('Y', 'U', 'Y', '2'), + FOURCC_UYVY = FOURCC('U', 'Y', 'V', 'Y'), + + // 2 Secondary YUV formats: row biplanar. + FOURCC_M420 = FOURCC('M', '4', '2', '0'), + FOURCC_Q420 = FOURCC('Q', '4', '2', '0'), // deprecated. + + // 9 Primary RGB formats: 4 32 bpp, 2 24 bpp, 3 16 bpp. + FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'), + FOURCC_BGRA = FOURCC('B', 'G', 'R', 'A'), + FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'), + FOURCC_24BG = FOURCC('2', '4', 'B', 'G'), + FOURCC_RAW = FOURCC('r', 'a', 'w', ' '), + FOURCC_RGBA = FOURCC('R', 'G', 'B', 'A'), + FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // rgb565 LE. + FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'), // argb1555 LE. + FOURCC_R444 = FOURCC('R', '4', '4', '4'), // argb4444 LE. + + // 4 Secondary RGB formats: 4 Bayer Patterns. deprecated. + FOURCC_RGGB = FOURCC('R', 'G', 'G', 'B'), + FOURCC_BGGR = FOURCC('B', 'G', 'G', 'R'), + FOURCC_GRBG = FOURCC('G', 'R', 'B', 'G'), + FOURCC_GBRG = FOURCC('G', 'B', 'R', 'G'), + + // 1 Primary Compressed YUV format. + FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'), + + // 5 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias. + FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'), + FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'), + FOURCC_YV24 = FOURCC('Y', 'V', '2', '4'), + FOURCC_YU12 = FOURCC('Y', 'U', '1', '2'), // Linux version of I420. + FOURCC_J420 = FOURCC('J', '4', '2', '0'), + FOURCC_J400 = FOURCC('J', '4', '0', '0'), // unofficial fourcc + FOURCC_H420 = FOURCC('H', '4', '2', '0'), // unofficial fourcc + + // 14 Auxiliary aliases. CanonicalFourCC() maps these to canonical fourcc. + FOURCC_IYUV = FOURCC('I', 'Y', 'U', 'V'), // Alias for I420. + FOURCC_YU16 = FOURCC('Y', 'U', '1', '6'), // Alias for I422. + FOURCC_YU24 = FOURCC('Y', 'U', '2', '4'), // Alias for I444. + FOURCC_YUYV = FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2. + FOURCC_YUVS = FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac. + FOURCC_HDYC = FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY. + FOURCC_2VUY = FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY on Mac. + FOURCC_JPEG = FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG. + FOURCC_DMB1 = FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac. + FOURCC_BA81 = FOURCC('B', 'A', '8', '1'), // Alias for BGGR. + FOURCC_RGB3 = FOURCC('R', 'G', 'B', '3'), // Alias for RAW. + FOURCC_BGR3 = FOURCC('B', 'G', 'R', '3'), // Alias for 24BG. + FOURCC_CM32 = FOURCC(0, 0, 0, 32), // Alias for BGRA kCMPixelFormat_32ARGB + FOURCC_CM24 = FOURCC(0, 0, 0, 24), // Alias for RAW kCMPixelFormat_24RGB + FOURCC_L555 = FOURCC('L', '5', '5', '5'), // Alias for RGBO. + FOURCC_L565 = FOURCC('L', '5', '6', '5'), // Alias for RGBP. + FOURCC_5551 = FOURCC('5', '5', '5', '1'), // Alias for RGBO. + + // 1 Auxiliary compressed YUV format set aside for capturer. + FOURCC_H264 = FOURCC('H', '2', '6', '4'), + + // Match any fourcc. + FOURCC_ANY = -1, +}; + +enum FourCCBpp { + // Canonical fourcc codes used in our code. + FOURCC_BPP_I420 = 12, + FOURCC_BPP_I422 = 16, + FOURCC_BPP_I444 = 24, + FOURCC_BPP_I411 = 12, + FOURCC_BPP_I400 = 8, + FOURCC_BPP_NV21 = 12, + FOURCC_BPP_NV12 = 12, + FOURCC_BPP_YUY2 = 16, + FOURCC_BPP_UYVY = 16, + FOURCC_BPP_M420 = 12, + FOURCC_BPP_Q420 = 12, + FOURCC_BPP_ARGB = 32, + FOURCC_BPP_BGRA = 32, + FOURCC_BPP_ABGR = 32, + FOURCC_BPP_RGBA = 32, + FOURCC_BPP_24BG = 24, + FOURCC_BPP_RAW = 24, + FOURCC_BPP_RGBP = 16, + FOURCC_BPP_RGBO = 16, + FOURCC_BPP_R444 = 16, + FOURCC_BPP_RGGB = 8, + FOURCC_BPP_BGGR = 8, + FOURCC_BPP_GRBG = 8, + FOURCC_BPP_GBRG = 8, + FOURCC_BPP_YV12 = 12, + FOURCC_BPP_YV16 = 16, + FOURCC_BPP_YV24 = 24, + FOURCC_BPP_YU12 = 12, + FOURCC_BPP_J420 = 12, + FOURCC_BPP_J400 = 8, + FOURCC_BPP_H420 = 12, + FOURCC_BPP_MJPG = 0, // 0 means unknown. + FOURCC_BPP_H264 = 0, + FOURCC_BPP_IYUV = 12, + FOURCC_BPP_YU16 = 16, + FOURCC_BPP_YU24 = 24, + FOURCC_BPP_YUYV = 16, + FOURCC_BPP_YUVS = 16, + FOURCC_BPP_HDYC = 16, + FOURCC_BPP_2VUY = 16, + FOURCC_BPP_JPEG = 1, + FOURCC_BPP_DMB1 = 1, + FOURCC_BPP_BA81 = 8, + FOURCC_BPP_RGB3 = 24, + FOURCC_BPP_BGR3 = 24, + FOURCC_BPP_CM32 = 32, + FOURCC_BPP_CM24 = 24, + + // Match any fourcc. + FOURCC_BPP_ANY = 0, // 0 means unknown. +}; + +// Converts fourcc aliases into canonical ones. +LIBYUV_API uint32 CanonicalFourCC(uint32 fourcc); + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + +#endif // INCLUDE_LIBYUV_VIDEO_COMMON_H_ diff --git a/third_party/libyuv/larch64/lib/libyuv.a b/third_party/libyuv/larch64/lib/libyuv.a new file mode 100644 index 000000000..fdbcda251 Binary files /dev/null and b/third_party/libyuv/larch64/lib/libyuv.a differ diff --git a/third_party/libyuv/lib/libyuv.a b/third_party/libyuv/lib/libyuv.a new file mode 100644 index 000000000..228de4d03 Binary files /dev/null and b/third_party/libyuv/lib/libyuv.a differ diff --git a/third_party/linux/include/linux/ion.h b/third_party/linux/include/linux/ion.h new file mode 100644 index 000000000..7b5b031f5 --- /dev/null +++ b/third_party/linux/include/linux/ion.h @@ -0,0 +1,78 @@ +/**************************************************************************** + **************************************************************************** + *** + *** This header was automatically generated from a Linux kernel header + *** of the same name, to make information necessary for userspace to + *** call into the kernel available to libc. It contains only constants, + *** structures, and macros generated from the original header, and thus, + *** contains no copyrightable information. + *** + *** To edit the content of this header, modify the corresponding + *** source file (e.g. under external/kernel-headers/original/) then + *** run bionic/libc/kernel/tools/update_all.py + *** + *** Any manual change here will be lost the next time this script will + *** be run. You've been warned! + *** + **************************************************************************** + ****************************************************************************/ +#ifndef _UAPI_LINUX_ION_H +#define _UAPI_LINUX_ION_H +#include +#include +typedef int ion_user_handle_t; +enum ion_heap_type { + ION_HEAP_TYPE_SYSTEM, + ION_HEAP_TYPE_SYSTEM_CONTIG, + ION_HEAP_TYPE_CARVEOUT, + ION_HEAP_TYPE_CHUNK, + ION_HEAP_TYPE_DMA, + ION_HEAP_TYPE_CUSTOM, +}; +#define ION_NUM_HEAP_IDS (sizeof(unsigned int) * 8) +#define ION_FLAG_CACHED 1 +#define ION_FLAG_CACHED_NEEDS_SYNC 2 +struct ion_allocation_data { + size_t len; + size_t align; + unsigned int heap_id_mask; + unsigned int flags; + ion_user_handle_t handle; +}; +struct ion_fd_data { + ion_user_handle_t handle; + int fd; +}; +struct ion_handle_data { + ion_user_handle_t handle; +}; +struct ion_custom_data { + unsigned int cmd; + unsigned long arg; +}; +#define MAX_HEAP_NAME 32 +struct ion_heap_data { + char name[MAX_HEAP_NAME]; + __u32 type; + __u32 heap_id; + __u32 reserved0; + __u32 reserved1; + __u32 reserved2; +}; +struct ion_heap_query { + __u32 cnt; + __u32 reserved0; + __u64 heaps; + __u32 reserved1; + __u32 reserved2; +}; +#define ION_IOC_MAGIC 'I' +#define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0, struct ion_allocation_data) +#define ION_IOC_FREE _IOWR(ION_IOC_MAGIC, 1, struct ion_handle_data) +#define ION_IOC_MAP _IOWR(ION_IOC_MAGIC, 2, struct ion_fd_data) +#define ION_IOC_SHARE _IOWR(ION_IOC_MAGIC, 4, struct ion_fd_data) +#define ION_IOC_IMPORT _IOWR(ION_IOC_MAGIC, 5, struct ion_fd_data) +#define ION_IOC_SYNC _IOWR(ION_IOC_MAGIC, 7, struct ion_fd_data) +#define ION_IOC_CUSTOM _IOWR(ION_IOC_MAGIC, 6, struct ion_custom_data) +#define ION_IOC_HEAP_QUERY _IOWR(ION_IOC_MAGIC, 8, struct ion_heap_query) +#endif diff --git a/third_party/linux/include/msm_ion.h b/third_party/linux/include/msm_ion.h new file mode 100644 index 000000000..d5caed5eb --- /dev/null +++ b/third_party/linux/include/msm_ion.h @@ -0,0 +1,211 @@ +#ifndef _UAPI_MSM_ION_H +#define _UAPI_MSM_ION_H + +#include + +enum msm_ion_heap_types { + ION_HEAP_TYPE_MSM_START = ION_HEAP_TYPE_CUSTOM + 1, + ION_HEAP_TYPE_SECURE_DMA = ION_HEAP_TYPE_MSM_START, + ION_HEAP_TYPE_SYSTEM_SECURE, + ION_HEAP_TYPE_HYP_CMA, + /* + * if you add a heap type here you should also add it to + * heap_types_info[] in msm_ion.c + */ +}; + +/** + * These are the only ids that should be used for Ion heap ids. + * The ids listed are the order in which allocation will be attempted + * if specified. Don't swap the order of heap ids unless you know what + * you are doing! + * Id's are spaced by purpose to allow new Id's to be inserted in-between (for + * possible fallbacks) + */ + +enum ion_heap_ids { + INVALID_HEAP_ID = -1, + ION_CP_MM_HEAP_ID = 8, + ION_SECURE_HEAP_ID = 9, + ION_SECURE_DISPLAY_HEAP_ID = 10, + ION_CP_MFC_HEAP_ID = 12, + ION_CP_WB_HEAP_ID = 16, /* 8660 only */ + ION_CAMERA_HEAP_ID = 20, /* 8660 only */ + ION_SYSTEM_CONTIG_HEAP_ID = 21, + ION_ADSP_HEAP_ID = 22, + ION_PIL1_HEAP_ID = 23, /* Currently used for other PIL images */ + ION_SF_HEAP_ID = 24, + ION_SYSTEM_HEAP_ID = 25, + ION_PIL2_HEAP_ID = 26, /* Currently used for modem firmware images */ + ION_QSECOM_HEAP_ID = 27, + ION_AUDIO_HEAP_ID = 28, + + ION_MM_FIRMWARE_HEAP_ID = 29, + + ION_HEAP_ID_RESERVED = 31 /** Bit reserved for ION_FLAG_SECURE flag */ +}; + +/* + * The IOMMU heap is deprecated! Here are some aliases for backwards + * compatibility: + */ +#define ION_IOMMU_HEAP_ID ION_SYSTEM_HEAP_ID +#define ION_HEAP_TYPE_IOMMU ION_HEAP_TYPE_SYSTEM + +enum ion_fixed_position { + NOT_FIXED, + FIXED_LOW, + FIXED_MIDDLE, + FIXED_HIGH, +}; + +enum cp_mem_usage { + VIDEO_BITSTREAM = 0x1, + VIDEO_PIXEL = 0x2, + VIDEO_NONPIXEL = 0x3, + DISPLAY_SECURE_CP_USAGE = 0x4, + CAMERA_SECURE_CP_USAGE = 0x5, + MAX_USAGE = 0x6, + UNKNOWN = 0x7FFFFFFF, +}; + +/** + * Flags to be used when allocating from the secure heap for + * content protection + */ +#define ION_FLAG_CP_TOUCH (1 << 17) +#define ION_FLAG_CP_BITSTREAM (1 << 18) +#define ION_FLAG_CP_PIXEL (1 << 19) +#define ION_FLAG_CP_NON_PIXEL (1 << 20) +#define ION_FLAG_CP_CAMERA (1 << 21) +#define ION_FLAG_CP_HLOS (1 << 22) +#define ION_FLAG_CP_HLOS_FREE (1 << 23) +#define ION_FLAG_CP_SEC_DISPLAY (1 << 25) +#define ION_FLAG_CP_APP (1 << 26) + +/** + * Flag to allow non continguous allocation of memory from secure + * heap + */ +#define ION_FLAG_ALLOW_NON_CONTIG (1 << 24) + +/** + * Flag to use when allocating to indicate that a heap is secure. + */ +#define ION_FLAG_SECURE (1 << ION_HEAP_ID_RESERVED) + +/** + * Flag for clients to force contiguous memort allocation + * + * Use of this flag is carefully monitored! + */ +#define ION_FLAG_FORCE_CONTIGUOUS (1 << 30) + +/* + * Used in conjunction with heap which pool memory to force an allocation + * to come from the page allocator directly instead of from the pool allocation + */ +#define ION_FLAG_POOL_FORCE_ALLOC (1 << 16) + + +#define ION_FLAG_POOL_PREFETCH (1 << 27) + +/** +* Deprecated! Please use the corresponding ION_FLAG_* +*/ +#define ION_SECURE ION_FLAG_SECURE +#define ION_FORCE_CONTIGUOUS ION_FLAG_FORCE_CONTIGUOUS + +/** + * Macro should be used with ion_heap_ids defined above. + */ +#define ION_HEAP(bit) (1 << (bit)) + +#define ION_ADSP_HEAP_NAME "adsp" +#define ION_SYSTEM_HEAP_NAME "system" +#define ION_VMALLOC_HEAP_NAME ION_SYSTEM_HEAP_NAME +#define ION_KMALLOC_HEAP_NAME "kmalloc" +#define ION_AUDIO_HEAP_NAME "audio" +#define ION_SF_HEAP_NAME "sf" +#define ION_MM_HEAP_NAME "mm" +#define ION_CAMERA_HEAP_NAME "camera_preview" +#define ION_IOMMU_HEAP_NAME "iommu" +#define ION_MFC_HEAP_NAME "mfc" +#define ION_WB_HEAP_NAME "wb" +#define ION_MM_FIRMWARE_HEAP_NAME "mm_fw" +#define ION_PIL1_HEAP_NAME "pil_1" +#define ION_PIL2_HEAP_NAME "pil_2" +#define ION_QSECOM_HEAP_NAME "qsecom" +#define ION_SECURE_HEAP_NAME "secure_heap" +#define ION_SECURE_DISPLAY_HEAP_NAME "secure_display" + +#define ION_SET_CACHED(__cache) (__cache | ION_FLAG_CACHED) +#define ION_SET_UNCACHED(__cache) (__cache & ~ION_FLAG_CACHED) + +#define ION_IS_CACHED(__flags) ((__flags) & ION_FLAG_CACHED) + +/* struct ion_flush_data - data passed to ion for flushing caches + * + * @handle: handle with data to flush + * @fd: fd to flush + * @vaddr: userspace virtual address mapped with mmap + * @offset: offset into the handle to flush + * @length: length of handle to flush + * + * Performs cache operations on the handle. If p is the start address + * of the handle, p + offset through p + offset + length will have + * the cache operations performed + */ +struct ion_flush_data { + ion_user_handle_t handle; + int fd; + void *vaddr; + unsigned int offset; + unsigned int length; +}; + +struct ion_prefetch_regions { + unsigned int vmid; + size_t *sizes; + unsigned int nr_sizes; +}; + +struct ion_prefetch_data { + int heap_id; + unsigned long len; + /* Is unsigned long bad? 32bit compiler vs 64 bit compiler*/ + struct ion_prefetch_regions *regions; + unsigned int nr_regions; +}; + +#define ION_IOC_MSM_MAGIC 'M' + +/** + * DOC: ION_IOC_CLEAN_CACHES - clean the caches + * + * Clean the caches of the handle specified. + */ +#define ION_IOC_CLEAN_CACHES _IOWR(ION_IOC_MSM_MAGIC, 0, \ + struct ion_flush_data) +/** + * DOC: ION_IOC_INV_CACHES - invalidate the caches + * + * Invalidate the caches of the handle specified. + */ +#define ION_IOC_INV_CACHES _IOWR(ION_IOC_MSM_MAGIC, 1, \ + struct ion_flush_data) +/** + * DOC: ION_IOC_CLEAN_INV_CACHES - clean and invalidate the caches + * + * Clean and invalidate the caches of the handle specified. + */ +#define ION_IOC_CLEAN_INV_CACHES _IOWR(ION_IOC_MSM_MAGIC, 2, \ + struct ion_flush_data) + +#define ION_IOC_PREFETCH _IOWR(ION_IOC_MSM_MAGIC, 3, \ + struct ion_prefetch_data) + +#define ION_IOC_DRAIN _IOWR(ION_IOC_MSM_MAGIC, 4, \ + struct ion_prefetch_data) + +#endif diff --git a/third_party/opencl/include/CL/cl.h b/third_party/opencl/include/CL/cl.h new file mode 100644 index 000000000..0086319f5 --- /dev/null +++ b/third_party/opencl/include/CL/cl.h @@ -0,0 +1,1452 @@ +/******************************************************************************* + * Copyright (c) 2008-2015 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS + * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS + * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT + * https://www.khronos.org/registry/ + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + ******************************************************************************/ + +#ifndef __OPENCL_CL_H +#define __OPENCL_CL_H + +#ifdef __APPLE__ +#include +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/******************************************************************************/ + +typedef struct _cl_platform_id * cl_platform_id; +typedef struct _cl_device_id * cl_device_id; +typedef struct _cl_context * cl_context; +typedef struct _cl_command_queue * cl_command_queue; +typedef struct _cl_mem * cl_mem; +typedef struct _cl_program * cl_program; +typedef struct _cl_kernel * cl_kernel; +typedef struct _cl_event * cl_event; +typedef struct _cl_sampler * cl_sampler; + +typedef cl_uint cl_bool; /* WARNING! Unlike cl_ types in cl_platform.h, cl_bool is not guaranteed to be the same size as the bool in kernels. */ +typedef cl_ulong cl_bitfield; +typedef cl_bitfield cl_device_type; +typedef cl_uint cl_platform_info; +typedef cl_uint cl_device_info; +typedef cl_bitfield cl_device_fp_config; +typedef cl_uint cl_device_mem_cache_type; +typedef cl_uint cl_device_local_mem_type; +typedef cl_bitfield cl_device_exec_capabilities; +typedef cl_bitfield cl_device_svm_capabilities; +typedef cl_bitfield cl_command_queue_properties; +typedef intptr_t cl_device_partition_property; +typedef cl_bitfield cl_device_affinity_domain; + +typedef intptr_t cl_context_properties; +typedef cl_uint cl_context_info; +typedef cl_bitfield cl_queue_properties; +typedef cl_uint cl_command_queue_info; +typedef cl_uint cl_channel_order; +typedef cl_uint cl_channel_type; +typedef cl_bitfield cl_mem_flags; +typedef cl_bitfield cl_svm_mem_flags; +typedef cl_uint cl_mem_object_type; +typedef cl_uint cl_mem_info; +typedef cl_bitfield cl_mem_migration_flags; +typedef cl_uint cl_image_info; +typedef cl_uint cl_buffer_create_type; +typedef cl_uint cl_addressing_mode; +typedef cl_uint cl_filter_mode; +typedef cl_uint cl_sampler_info; +typedef cl_bitfield cl_map_flags; +typedef intptr_t cl_pipe_properties; +typedef cl_uint cl_pipe_info; +typedef cl_uint cl_program_info; +typedef cl_uint cl_program_build_info; +typedef cl_uint cl_program_binary_type; +typedef cl_int cl_build_status; +typedef cl_uint cl_kernel_info; +typedef cl_uint cl_kernel_arg_info; +typedef cl_uint cl_kernel_arg_address_qualifier; +typedef cl_uint cl_kernel_arg_access_qualifier; +typedef cl_bitfield cl_kernel_arg_type_qualifier; +typedef cl_uint cl_kernel_work_group_info; +typedef cl_uint cl_kernel_sub_group_info; +typedef cl_uint cl_event_info; +typedef cl_uint cl_command_type; +typedef cl_uint cl_profiling_info; +typedef cl_bitfield cl_sampler_properties; +typedef cl_uint cl_kernel_exec_info; + +typedef struct _cl_image_format { + cl_channel_order image_channel_order; + cl_channel_type image_channel_data_type; +} cl_image_format; + +typedef struct _cl_image_desc { + cl_mem_object_type image_type; + size_t image_width; + size_t image_height; + size_t image_depth; + size_t image_array_size; + size_t image_row_pitch; + size_t image_slice_pitch; + cl_uint num_mip_levels; + cl_uint num_samples; +#ifdef __GNUC__ + __extension__ /* Prevents warnings about anonymous union in -pedantic builds */ +#endif + union { + cl_mem buffer; + cl_mem mem_object; + }; +} cl_image_desc; + +typedef struct _cl_buffer_region { + size_t origin; + size_t size; +} cl_buffer_region; + + +/******************************************************************************/ + +/* Error Codes */ +#define CL_SUCCESS 0 +#define CL_DEVICE_NOT_FOUND -1 +#define CL_DEVICE_NOT_AVAILABLE -2 +#define CL_COMPILER_NOT_AVAILABLE -3 +#define CL_MEM_OBJECT_ALLOCATION_FAILURE -4 +#define CL_OUT_OF_RESOURCES -5 +#define CL_OUT_OF_HOST_MEMORY -6 +#define CL_PROFILING_INFO_NOT_AVAILABLE -7 +#define CL_MEM_COPY_OVERLAP -8 +#define CL_IMAGE_FORMAT_MISMATCH -9 +#define CL_IMAGE_FORMAT_NOT_SUPPORTED -10 +#define CL_BUILD_PROGRAM_FAILURE -11 +#define CL_MAP_FAILURE -12 +#define CL_MISALIGNED_SUB_BUFFER_OFFSET -13 +#define CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST -14 +#define CL_COMPILE_PROGRAM_FAILURE -15 +#define CL_LINKER_NOT_AVAILABLE -16 +#define CL_LINK_PROGRAM_FAILURE -17 +#define CL_DEVICE_PARTITION_FAILED -18 +#define CL_KERNEL_ARG_INFO_NOT_AVAILABLE -19 + +#define CL_INVALID_VALUE -30 +#define CL_INVALID_DEVICE_TYPE -31 +#define CL_INVALID_PLATFORM -32 +#define CL_INVALID_DEVICE -33 +#define CL_INVALID_CONTEXT -34 +#define CL_INVALID_QUEUE_PROPERTIES -35 +#define CL_INVALID_COMMAND_QUEUE -36 +#define CL_INVALID_HOST_PTR -37 +#define CL_INVALID_MEM_OBJECT -38 +#define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR -39 +#define CL_INVALID_IMAGE_SIZE -40 +#define CL_INVALID_SAMPLER -41 +#define CL_INVALID_BINARY -42 +#define CL_INVALID_BUILD_OPTIONS -43 +#define CL_INVALID_PROGRAM -44 +#define CL_INVALID_PROGRAM_EXECUTABLE -45 +#define CL_INVALID_KERNEL_NAME -46 +#define CL_INVALID_KERNEL_DEFINITION -47 +#define CL_INVALID_KERNEL -48 +#define CL_INVALID_ARG_INDEX -49 +#define CL_INVALID_ARG_VALUE -50 +#define CL_INVALID_ARG_SIZE -51 +#define CL_INVALID_KERNEL_ARGS -52 +#define CL_INVALID_WORK_DIMENSION -53 +#define CL_INVALID_WORK_GROUP_SIZE -54 +#define CL_INVALID_WORK_ITEM_SIZE -55 +#define CL_INVALID_GLOBAL_OFFSET -56 +#define CL_INVALID_EVENT_WAIT_LIST -57 +#define CL_INVALID_EVENT -58 +#define CL_INVALID_OPERATION -59 +#define CL_INVALID_GL_OBJECT -60 +#define CL_INVALID_BUFFER_SIZE -61 +#define CL_INVALID_MIP_LEVEL -62 +#define CL_INVALID_GLOBAL_WORK_SIZE -63 +#define CL_INVALID_PROPERTY -64 +#define CL_INVALID_IMAGE_DESCRIPTOR -65 +#define CL_INVALID_COMPILER_OPTIONS -66 +#define CL_INVALID_LINKER_OPTIONS -67 +#define CL_INVALID_DEVICE_PARTITION_COUNT -68 +#define CL_INVALID_PIPE_SIZE -69 +#define CL_INVALID_DEVICE_QUEUE -70 + +/* OpenCL Version */ +#define CL_VERSION_1_0 1 +#define CL_VERSION_1_1 1 +#define CL_VERSION_1_2 1 +#define CL_VERSION_2_0 1 +#define CL_VERSION_2_1 1 + +/* cl_bool */ +#define CL_FALSE 0 +#define CL_TRUE 1 +#define CL_BLOCKING CL_TRUE +#define CL_NON_BLOCKING CL_FALSE + +/* cl_platform_info */ +#define CL_PLATFORM_PROFILE 0x0900 +#define CL_PLATFORM_VERSION 0x0901 +#define CL_PLATFORM_NAME 0x0902 +#define CL_PLATFORM_VENDOR 0x0903 +#define CL_PLATFORM_EXTENSIONS 0x0904 +#define CL_PLATFORM_HOST_TIMER_RESOLUTION 0x0905 + +/* cl_device_type - bitfield */ +#define CL_DEVICE_TYPE_DEFAULT (1 << 0) +#define CL_DEVICE_TYPE_CPU (1 << 1) +#define CL_DEVICE_TYPE_GPU (1 << 2) +#define CL_DEVICE_TYPE_ACCELERATOR (1 << 3) +#define CL_DEVICE_TYPE_CUSTOM (1 << 4) +#define CL_DEVICE_TYPE_ALL 0xFFFFFFFF + +/* cl_device_info */ +#define CL_DEVICE_TYPE 0x1000 +#define CL_DEVICE_VENDOR_ID 0x1001 +#define CL_DEVICE_MAX_COMPUTE_UNITS 0x1002 +#define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS 0x1003 +#define CL_DEVICE_MAX_WORK_GROUP_SIZE 0x1004 +#define CL_DEVICE_MAX_WORK_ITEM_SIZES 0x1005 +#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR 0x1006 +#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT 0x1007 +#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT 0x1008 +#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG 0x1009 +#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT 0x100A +#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE 0x100B +#define CL_DEVICE_MAX_CLOCK_FREQUENCY 0x100C +#define CL_DEVICE_ADDRESS_BITS 0x100D +#define CL_DEVICE_MAX_READ_IMAGE_ARGS 0x100E +#define CL_DEVICE_MAX_WRITE_IMAGE_ARGS 0x100F +#define CL_DEVICE_MAX_MEM_ALLOC_SIZE 0x1010 +#define CL_DEVICE_IMAGE2D_MAX_WIDTH 0x1011 +#define CL_DEVICE_IMAGE2D_MAX_HEIGHT 0x1012 +#define CL_DEVICE_IMAGE3D_MAX_WIDTH 0x1013 +#define CL_DEVICE_IMAGE3D_MAX_HEIGHT 0x1014 +#define CL_DEVICE_IMAGE3D_MAX_DEPTH 0x1015 +#define CL_DEVICE_IMAGE_SUPPORT 0x1016 +#define CL_DEVICE_MAX_PARAMETER_SIZE 0x1017 +#define CL_DEVICE_MAX_SAMPLERS 0x1018 +#define CL_DEVICE_MEM_BASE_ADDR_ALIGN 0x1019 +#define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE 0x101A +#define CL_DEVICE_SINGLE_FP_CONFIG 0x101B +#define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE 0x101C +#define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE 0x101D +#define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE 0x101E +#define CL_DEVICE_GLOBAL_MEM_SIZE 0x101F +#define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE 0x1020 +#define CL_DEVICE_MAX_CONSTANT_ARGS 0x1021 +#define CL_DEVICE_LOCAL_MEM_TYPE 0x1022 +#define CL_DEVICE_LOCAL_MEM_SIZE 0x1023 +#define CL_DEVICE_ERROR_CORRECTION_SUPPORT 0x1024 +#define CL_DEVICE_PROFILING_TIMER_RESOLUTION 0x1025 +#define CL_DEVICE_ENDIAN_LITTLE 0x1026 +#define CL_DEVICE_AVAILABLE 0x1027 +#define CL_DEVICE_COMPILER_AVAILABLE 0x1028 +#define CL_DEVICE_EXECUTION_CAPABILITIES 0x1029 +#define CL_DEVICE_QUEUE_PROPERTIES 0x102A /* deprecated */ +#define CL_DEVICE_QUEUE_ON_HOST_PROPERTIES 0x102A +#define CL_DEVICE_NAME 0x102B +#define CL_DEVICE_VENDOR 0x102C +#define CL_DRIVER_VERSION 0x102D +#define CL_DEVICE_PROFILE 0x102E +#define CL_DEVICE_VERSION 0x102F +#define CL_DEVICE_EXTENSIONS 0x1030 +#define CL_DEVICE_PLATFORM 0x1031 +#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032 +/* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG */ +#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF 0x1034 +#define CL_DEVICE_HOST_UNIFIED_MEMORY 0x1035 /* deprecated */ +#define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR 0x1036 +#define CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT 0x1037 +#define CL_DEVICE_NATIVE_VECTOR_WIDTH_INT 0x1038 +#define CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG 0x1039 +#define CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT 0x103A +#define CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE 0x103B +#define CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF 0x103C +#define CL_DEVICE_OPENCL_C_VERSION 0x103D +#define CL_DEVICE_LINKER_AVAILABLE 0x103E +#define CL_DEVICE_BUILT_IN_KERNELS 0x103F +#define CL_DEVICE_IMAGE_MAX_BUFFER_SIZE 0x1040 +#define CL_DEVICE_IMAGE_MAX_ARRAY_SIZE 0x1041 +#define CL_DEVICE_PARENT_DEVICE 0x1042 +#define CL_DEVICE_PARTITION_MAX_SUB_DEVICES 0x1043 +#define CL_DEVICE_PARTITION_PROPERTIES 0x1044 +#define CL_DEVICE_PARTITION_AFFINITY_DOMAIN 0x1045 +#define CL_DEVICE_PARTITION_TYPE 0x1046 +#define CL_DEVICE_REFERENCE_COUNT 0x1047 +#define CL_DEVICE_PREFERRED_INTEROP_USER_SYNC 0x1048 +#define CL_DEVICE_PRINTF_BUFFER_SIZE 0x1049 +#define CL_DEVICE_IMAGE_PITCH_ALIGNMENT 0x104A +#define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT 0x104B +#define CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS 0x104C +#define CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE 0x104D +#define CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES 0x104E +#define CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE 0x104F +#define CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE 0x1050 +#define CL_DEVICE_MAX_ON_DEVICE_QUEUES 0x1051 +#define CL_DEVICE_MAX_ON_DEVICE_EVENTS 0x1052 +#define CL_DEVICE_SVM_CAPABILITIES 0x1053 +#define CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE 0x1054 +#define CL_DEVICE_MAX_PIPE_ARGS 0x1055 +#define CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS 0x1056 +#define CL_DEVICE_PIPE_MAX_PACKET_SIZE 0x1057 +#define CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT 0x1058 +#define CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT 0x1059 +#define CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT 0x105A +#define CL_DEVICE_IL_VERSION 0x105B +#define CL_DEVICE_MAX_NUM_SUB_GROUPS 0x105C +#define CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS 0x105D + +/* cl_device_fp_config - bitfield */ +#define CL_FP_DENORM (1 << 0) +#define CL_FP_INF_NAN (1 << 1) +#define CL_FP_ROUND_TO_NEAREST (1 << 2) +#define CL_FP_ROUND_TO_ZERO (1 << 3) +#define CL_FP_ROUND_TO_INF (1 << 4) +#define CL_FP_FMA (1 << 5) +#define CL_FP_SOFT_FLOAT (1 << 6) +#define CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT (1 << 7) + +/* cl_device_mem_cache_type */ +#define CL_NONE 0x0 +#define CL_READ_ONLY_CACHE 0x1 +#define CL_READ_WRITE_CACHE 0x2 + +/* cl_device_local_mem_type */ +#define CL_LOCAL 0x1 +#define CL_GLOBAL 0x2 + +/* cl_device_exec_capabilities - bitfield */ +#define CL_EXEC_KERNEL (1 << 0) +#define CL_EXEC_NATIVE_KERNEL (1 << 1) + +/* cl_command_queue_properties - bitfield */ +#define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE (1 << 0) +#define CL_QUEUE_PROFILING_ENABLE (1 << 1) +#define CL_QUEUE_ON_DEVICE (1 << 2) +#define CL_QUEUE_ON_DEVICE_DEFAULT (1 << 3) + +/* cl_context_info */ +#define CL_CONTEXT_REFERENCE_COUNT 0x1080 +#define CL_CONTEXT_DEVICES 0x1081 +#define CL_CONTEXT_PROPERTIES 0x1082 +#define CL_CONTEXT_NUM_DEVICES 0x1083 + +/* cl_context_properties */ +#define CL_CONTEXT_PLATFORM 0x1084 +#define CL_CONTEXT_INTEROP_USER_SYNC 0x1085 + +/* cl_device_partition_property */ +#define CL_DEVICE_PARTITION_EQUALLY 0x1086 +#define CL_DEVICE_PARTITION_BY_COUNTS 0x1087 +#define CL_DEVICE_PARTITION_BY_COUNTS_LIST_END 0x0 +#define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN 0x1088 + +/* cl_device_affinity_domain */ +#define CL_DEVICE_AFFINITY_DOMAIN_NUMA (1 << 0) +#define CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE (1 << 1) +#define CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE (1 << 2) +#define CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE (1 << 3) +#define CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE (1 << 4) +#define CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE (1 << 5) + +/* cl_device_svm_capabilities */ +#define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER (1 << 0) +#define CL_DEVICE_SVM_FINE_GRAIN_BUFFER (1 << 1) +#define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM (1 << 2) +#define CL_DEVICE_SVM_ATOMICS (1 << 3) + +/* cl_command_queue_info */ +#define CL_QUEUE_CONTEXT 0x1090 +#define CL_QUEUE_DEVICE 0x1091 +#define CL_QUEUE_REFERENCE_COUNT 0x1092 +#define CL_QUEUE_PROPERTIES 0x1093 +#define CL_QUEUE_SIZE 0x1094 +#define CL_QUEUE_DEVICE_DEFAULT 0x1095 + +/* cl_mem_flags and cl_svm_mem_flags - bitfield */ +#define CL_MEM_READ_WRITE (1 << 0) +#define CL_MEM_WRITE_ONLY (1 << 1) +#define CL_MEM_READ_ONLY (1 << 2) +#define CL_MEM_USE_HOST_PTR (1 << 3) +#define CL_MEM_ALLOC_HOST_PTR (1 << 4) +#define CL_MEM_COPY_HOST_PTR (1 << 5) +/* reserved (1 << 6) */ +#define CL_MEM_HOST_WRITE_ONLY (1 << 7) +#define CL_MEM_HOST_READ_ONLY (1 << 8) +#define CL_MEM_HOST_NO_ACCESS (1 << 9) +#define CL_MEM_SVM_FINE_GRAIN_BUFFER (1 << 10) /* used by cl_svm_mem_flags only */ +#define CL_MEM_SVM_ATOMICS (1 << 11) /* used by cl_svm_mem_flags only */ +#define CL_MEM_KERNEL_READ_AND_WRITE (1 << 12) + +/* cl_mem_migration_flags - bitfield */ +#define CL_MIGRATE_MEM_OBJECT_HOST (1 << 0) +#define CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED (1 << 1) + +/* cl_channel_order */ +#define CL_R 0x10B0 +#define CL_A 0x10B1 +#define CL_RG 0x10B2 +#define CL_RA 0x10B3 +#define CL_RGB 0x10B4 +#define CL_RGBA 0x10B5 +#define CL_BGRA 0x10B6 +#define CL_ARGB 0x10B7 +#define CL_INTENSITY 0x10B8 +#define CL_LUMINANCE 0x10B9 +#define CL_Rx 0x10BA +#define CL_RGx 0x10BB +#define CL_RGBx 0x10BC +#define CL_DEPTH 0x10BD +#define CL_DEPTH_STENCIL 0x10BE +#define CL_sRGB 0x10BF +#define CL_sRGBx 0x10C0 +#define CL_sRGBA 0x10C1 +#define CL_sBGRA 0x10C2 +#define CL_ABGR 0x10C3 + +/* cl_channel_type */ +#define CL_SNORM_INT8 0x10D0 +#define CL_SNORM_INT16 0x10D1 +#define CL_UNORM_INT8 0x10D2 +#define CL_UNORM_INT16 0x10D3 +#define CL_UNORM_SHORT_565 0x10D4 +#define CL_UNORM_SHORT_555 0x10D5 +#define CL_UNORM_INT_101010 0x10D6 +#define CL_SIGNED_INT8 0x10D7 +#define CL_SIGNED_INT16 0x10D8 +#define CL_SIGNED_INT32 0x10D9 +#define CL_UNSIGNED_INT8 0x10DA +#define CL_UNSIGNED_INT16 0x10DB +#define CL_UNSIGNED_INT32 0x10DC +#define CL_HALF_FLOAT 0x10DD +#define CL_FLOAT 0x10DE +#define CL_UNORM_INT24 0x10DF +#define CL_UNORM_INT_101010_2 0x10E0 + +/* cl_mem_object_type */ +#define CL_MEM_OBJECT_BUFFER 0x10F0 +#define CL_MEM_OBJECT_IMAGE2D 0x10F1 +#define CL_MEM_OBJECT_IMAGE3D 0x10F2 +#define CL_MEM_OBJECT_IMAGE2D_ARRAY 0x10F3 +#define CL_MEM_OBJECT_IMAGE1D 0x10F4 +#define CL_MEM_OBJECT_IMAGE1D_ARRAY 0x10F5 +#define CL_MEM_OBJECT_IMAGE1D_BUFFER 0x10F6 +#define CL_MEM_OBJECT_PIPE 0x10F7 + +/* cl_mem_info */ +#define CL_MEM_TYPE 0x1100 +#define CL_MEM_FLAGS 0x1101 +#define CL_MEM_SIZE 0x1102 +#define CL_MEM_HOST_PTR 0x1103 +#define CL_MEM_MAP_COUNT 0x1104 +#define CL_MEM_REFERENCE_COUNT 0x1105 +#define CL_MEM_CONTEXT 0x1106 +#define CL_MEM_ASSOCIATED_MEMOBJECT 0x1107 +#define CL_MEM_OFFSET 0x1108 +#define CL_MEM_USES_SVM_POINTER 0x1109 + +/* cl_image_info */ +#define CL_IMAGE_FORMAT 0x1110 +#define CL_IMAGE_ELEMENT_SIZE 0x1111 +#define CL_IMAGE_ROW_PITCH 0x1112 +#define CL_IMAGE_SLICE_PITCH 0x1113 +#define CL_IMAGE_WIDTH 0x1114 +#define CL_IMAGE_HEIGHT 0x1115 +#define CL_IMAGE_DEPTH 0x1116 +#define CL_IMAGE_ARRAY_SIZE 0x1117 +#define CL_IMAGE_BUFFER 0x1118 +#define CL_IMAGE_NUM_MIP_LEVELS 0x1119 +#define CL_IMAGE_NUM_SAMPLES 0x111A + +/* cl_pipe_info */ +#define CL_PIPE_PACKET_SIZE 0x1120 +#define CL_PIPE_MAX_PACKETS 0x1121 + +/* cl_addressing_mode */ +#define CL_ADDRESS_NONE 0x1130 +#define CL_ADDRESS_CLAMP_TO_EDGE 0x1131 +#define CL_ADDRESS_CLAMP 0x1132 +#define CL_ADDRESS_REPEAT 0x1133 +#define CL_ADDRESS_MIRRORED_REPEAT 0x1134 + +/* cl_filter_mode */ +#define CL_FILTER_NEAREST 0x1140 +#define CL_FILTER_LINEAR 0x1141 + +/* cl_sampler_info */ +#define CL_SAMPLER_REFERENCE_COUNT 0x1150 +#define CL_SAMPLER_CONTEXT 0x1151 +#define CL_SAMPLER_NORMALIZED_COORDS 0x1152 +#define CL_SAMPLER_ADDRESSING_MODE 0x1153 +#define CL_SAMPLER_FILTER_MODE 0x1154 +#define CL_SAMPLER_MIP_FILTER_MODE 0x1155 +#define CL_SAMPLER_LOD_MIN 0x1156 +#define CL_SAMPLER_LOD_MAX 0x1157 + +/* cl_map_flags - bitfield */ +#define CL_MAP_READ (1 << 0) +#define CL_MAP_WRITE (1 << 1) +#define CL_MAP_WRITE_INVALIDATE_REGION (1 << 2) + +/* cl_program_info */ +#define CL_PROGRAM_REFERENCE_COUNT 0x1160 +#define CL_PROGRAM_CONTEXT 0x1161 +#define CL_PROGRAM_NUM_DEVICES 0x1162 +#define CL_PROGRAM_DEVICES 0x1163 +#define CL_PROGRAM_SOURCE 0x1164 +#define CL_PROGRAM_BINARY_SIZES 0x1165 +#define CL_PROGRAM_BINARIES 0x1166 +#define CL_PROGRAM_NUM_KERNELS 0x1167 +#define CL_PROGRAM_KERNEL_NAMES 0x1168 +#define CL_PROGRAM_IL 0x1169 + +/* cl_program_build_info */ +#define CL_PROGRAM_BUILD_STATUS 0x1181 +#define CL_PROGRAM_BUILD_OPTIONS 0x1182 +#define CL_PROGRAM_BUILD_LOG 0x1183 +#define CL_PROGRAM_BINARY_TYPE 0x1184 +#define CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE 0x1185 + +/* cl_program_binary_type */ +#define CL_PROGRAM_BINARY_TYPE_NONE 0x0 +#define CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT 0x1 +#define CL_PROGRAM_BINARY_TYPE_LIBRARY 0x2 +#define CL_PROGRAM_BINARY_TYPE_EXECUTABLE 0x4 + +/* cl_build_status */ +#define CL_BUILD_SUCCESS 0 +#define CL_BUILD_NONE -1 +#define CL_BUILD_ERROR -2 +#define CL_BUILD_IN_PROGRESS -3 + +/* cl_kernel_info */ +#define CL_KERNEL_FUNCTION_NAME 0x1190 +#define CL_KERNEL_NUM_ARGS 0x1191 +#define CL_KERNEL_REFERENCE_COUNT 0x1192 +#define CL_KERNEL_CONTEXT 0x1193 +#define CL_KERNEL_PROGRAM 0x1194 +#define CL_KERNEL_ATTRIBUTES 0x1195 +#define CL_KERNEL_MAX_NUM_SUB_GROUPS 0x11B9 +#define CL_KERNEL_COMPILE_NUM_SUB_GROUPS 0x11BA + +/* cl_kernel_arg_info */ +#define CL_KERNEL_ARG_ADDRESS_QUALIFIER 0x1196 +#define CL_KERNEL_ARG_ACCESS_QUALIFIER 0x1197 +#define CL_KERNEL_ARG_TYPE_NAME 0x1198 +#define CL_KERNEL_ARG_TYPE_QUALIFIER 0x1199 +#define CL_KERNEL_ARG_NAME 0x119A + +/* cl_kernel_arg_address_qualifier */ +#define CL_KERNEL_ARG_ADDRESS_GLOBAL 0x119B +#define CL_KERNEL_ARG_ADDRESS_LOCAL 0x119C +#define CL_KERNEL_ARG_ADDRESS_CONSTANT 0x119D +#define CL_KERNEL_ARG_ADDRESS_PRIVATE 0x119E + +/* cl_kernel_arg_access_qualifier */ +#define CL_KERNEL_ARG_ACCESS_READ_ONLY 0x11A0 +#define CL_KERNEL_ARG_ACCESS_WRITE_ONLY 0x11A1 +#define CL_KERNEL_ARG_ACCESS_READ_WRITE 0x11A2 +#define CL_KERNEL_ARG_ACCESS_NONE 0x11A3 + +/* cl_kernel_arg_type_qualifer */ +#define CL_KERNEL_ARG_TYPE_NONE 0 +#define CL_KERNEL_ARG_TYPE_CONST (1 << 0) +#define CL_KERNEL_ARG_TYPE_RESTRICT (1 << 1) +#define CL_KERNEL_ARG_TYPE_VOLATILE (1 << 2) +#define CL_KERNEL_ARG_TYPE_PIPE (1 << 3) + +/* cl_kernel_work_group_info */ +#define CL_KERNEL_WORK_GROUP_SIZE 0x11B0 +#define CL_KERNEL_COMPILE_WORK_GROUP_SIZE 0x11B1 +#define CL_KERNEL_LOCAL_MEM_SIZE 0x11B2 +#define CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x11B3 +#define CL_KERNEL_PRIVATE_MEM_SIZE 0x11B4 +#define CL_KERNEL_GLOBAL_WORK_SIZE 0x11B5 + +/* cl_kernel_sub_group_info */ +#define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE 0x2033 +#define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE 0x2034 +#define CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT 0x11B8 + +/* cl_kernel_exec_info */ +#define CL_KERNEL_EXEC_INFO_SVM_PTRS 0x11B6 +#define CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM 0x11B7 + +/* cl_event_info */ +#define CL_EVENT_COMMAND_QUEUE 0x11D0 +#define CL_EVENT_COMMAND_TYPE 0x11D1 +#define CL_EVENT_REFERENCE_COUNT 0x11D2 +#define CL_EVENT_COMMAND_EXECUTION_STATUS 0x11D3 +#define CL_EVENT_CONTEXT 0x11D4 + +/* cl_command_type */ +#define CL_COMMAND_NDRANGE_KERNEL 0x11F0 +#define CL_COMMAND_TASK 0x11F1 +#define CL_COMMAND_NATIVE_KERNEL 0x11F2 +#define CL_COMMAND_READ_BUFFER 0x11F3 +#define CL_COMMAND_WRITE_BUFFER 0x11F4 +#define CL_COMMAND_COPY_BUFFER 0x11F5 +#define CL_COMMAND_READ_IMAGE 0x11F6 +#define CL_COMMAND_WRITE_IMAGE 0x11F7 +#define CL_COMMAND_COPY_IMAGE 0x11F8 +#define CL_COMMAND_COPY_IMAGE_TO_BUFFER 0x11F9 +#define CL_COMMAND_COPY_BUFFER_TO_IMAGE 0x11FA +#define CL_COMMAND_MAP_BUFFER 0x11FB +#define CL_COMMAND_MAP_IMAGE 0x11FC +#define CL_COMMAND_UNMAP_MEM_OBJECT 0x11FD +#define CL_COMMAND_MARKER 0x11FE +#define CL_COMMAND_ACQUIRE_GL_OBJECTS 0x11FF +#define CL_COMMAND_RELEASE_GL_OBJECTS 0x1200 +#define CL_COMMAND_READ_BUFFER_RECT 0x1201 +#define CL_COMMAND_WRITE_BUFFER_RECT 0x1202 +#define CL_COMMAND_COPY_BUFFER_RECT 0x1203 +#define CL_COMMAND_USER 0x1204 +#define CL_COMMAND_BARRIER 0x1205 +#define CL_COMMAND_MIGRATE_MEM_OBJECTS 0x1206 +#define CL_COMMAND_FILL_BUFFER 0x1207 +#define CL_COMMAND_FILL_IMAGE 0x1208 +#define CL_COMMAND_SVM_FREE 0x1209 +#define CL_COMMAND_SVM_MEMCPY 0x120A +#define CL_COMMAND_SVM_MEMFILL 0x120B +#define CL_COMMAND_SVM_MAP 0x120C +#define CL_COMMAND_SVM_UNMAP 0x120D + +/* command execution status */ +#define CL_COMPLETE 0x0 +#define CL_RUNNING 0x1 +#define CL_SUBMITTED 0x2 +#define CL_QUEUED 0x3 + +/* cl_buffer_create_type */ +#define CL_BUFFER_CREATE_TYPE_REGION 0x1220 + +/* cl_profiling_info */ +#define CL_PROFILING_COMMAND_QUEUED 0x1280 +#define CL_PROFILING_COMMAND_SUBMIT 0x1281 +#define CL_PROFILING_COMMAND_START 0x1282 +#define CL_PROFILING_COMMAND_END 0x1283 +#define CL_PROFILING_COMMAND_COMPLETE 0x1284 + +/********************************************************************************************************/ + +/* Platform API */ +extern CL_API_ENTRY cl_int CL_API_CALL +clGetPlatformIDs(cl_uint /* num_entries */, + cl_platform_id * /* platforms */, + cl_uint * /* num_platforms */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetPlatformInfo(cl_platform_id /* platform */, + cl_platform_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +/* Device APIs */ +extern CL_API_ENTRY cl_int CL_API_CALL +clGetDeviceIDs(cl_platform_id /* platform */, + cl_device_type /* device_type */, + cl_uint /* num_entries */, + cl_device_id * /* devices */, + cl_uint * /* num_devices */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetDeviceInfo(cl_device_id /* device */, + cl_device_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clCreateSubDevices(cl_device_id /* in_device */, + const cl_device_partition_property * /* properties */, + cl_uint /* num_devices */, + cl_device_id * /* out_devices */, + cl_uint * /* num_devices_ret */) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetDefaultDeviceCommandQueue(cl_context /* context */, + cl_device_id /* device */, + cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_2_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetDeviceAndHostTimer(cl_device_id /* device */, + cl_ulong* /* device_timestamp */, + cl_ulong* /* host_timestamp */) CL_API_SUFFIX__VERSION_2_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetHostTimer(cl_device_id /* device */, + cl_ulong * /* host_timestamp */) CL_API_SUFFIX__VERSION_2_1; + + +/* Context APIs */ +extern CL_API_ENTRY cl_context CL_API_CALL +clCreateContext(const cl_context_properties * /* properties */, + cl_uint /* num_devices */, + const cl_device_id * /* devices */, + void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *), + void * /* user_data */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_context CL_API_CALL +clCreateContextFromType(const cl_context_properties * /* properties */, + cl_device_type /* device_type */, + void (CL_CALLBACK * /* pfn_notify*/ )(const char *, const void *, size_t, void *), + void * /* user_data */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetContextInfo(cl_context /* context */, + cl_context_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +/* Command Queue APIs */ +extern CL_API_ENTRY cl_command_queue CL_API_CALL +clCreateCommandQueueWithProperties(cl_context /* context */, + cl_device_id /* device */, + const cl_queue_properties * /* properties */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetCommandQueueInfo(cl_command_queue /* command_queue */, + cl_command_queue_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +/* Memory Object APIs */ +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateBuffer(cl_context /* context */, + cl_mem_flags /* flags */, + size_t /* size */, + void * /* host_ptr */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateSubBuffer(cl_mem /* buffer */, + cl_mem_flags /* flags */, + cl_buffer_create_type /* buffer_create_type */, + const void * /* buffer_create_info */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateImage(cl_context /* context */, + cl_mem_flags /* flags */, + const cl_image_format * /* image_format */, + const cl_image_desc * /* image_desc */, + void * /* host_ptr */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreatePipe(cl_context /* context */, + cl_mem_flags /* flags */, + cl_uint /* pipe_packet_size */, + cl_uint /* pipe_max_packets */, + const cl_pipe_properties * /* properties */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetSupportedImageFormats(cl_context /* context */, + cl_mem_flags /* flags */, + cl_mem_object_type /* image_type */, + cl_uint /* num_entries */, + cl_image_format * /* image_formats */, + cl_uint * /* num_image_formats */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetMemObjectInfo(cl_mem /* memobj */, + cl_mem_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetImageInfo(cl_mem /* image */, + cl_image_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetPipeInfo(cl_mem /* pipe */, + cl_pipe_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_2_0; + + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetMemObjectDestructorCallback(cl_mem /* memobj */, + void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/), + void * /*user_data */ ) CL_API_SUFFIX__VERSION_1_1; + +/* SVM Allocation APIs */ +extern CL_API_ENTRY void * CL_API_CALL +clSVMAlloc(cl_context /* context */, + cl_svm_mem_flags /* flags */, + size_t /* size */, + cl_uint /* alignment */) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY void CL_API_CALL +clSVMFree(cl_context /* context */, + void * /* svm_pointer */) CL_API_SUFFIX__VERSION_2_0; + +/* Sampler APIs */ +extern CL_API_ENTRY cl_sampler CL_API_CALL +clCreateSamplerWithProperties(cl_context /* context */, + const cl_sampler_properties * /* normalized_coords */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetSamplerInfo(cl_sampler /* sampler */, + cl_sampler_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +/* Program Object APIs */ +extern CL_API_ENTRY cl_program CL_API_CALL +clCreateProgramWithSource(cl_context /* context */, + cl_uint /* count */, + const char ** /* strings */, + const size_t * /* lengths */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_program CL_API_CALL +clCreateProgramWithBinary(cl_context /* context */, + cl_uint /* num_devices */, + const cl_device_id * /* device_list */, + const size_t * /* lengths */, + const unsigned char ** /* binaries */, + cl_int * /* binary_status */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_program CL_API_CALL +clCreateProgramWithBuiltInKernels(cl_context /* context */, + cl_uint /* num_devices */, + const cl_device_id * /* device_list */, + const char * /* kernel_names */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_program CL_API_CALL +clCreateProgramWithIL(cl_context /* context */, + const void* /* il */, + size_t /* length */, + cl_int* /* errcode_ret */) CL_API_SUFFIX__VERSION_2_1; + + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clBuildProgram(cl_program /* program */, + cl_uint /* num_devices */, + const cl_device_id * /* device_list */, + const char * /* options */, + void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */), + void * /* user_data */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clCompileProgram(cl_program /* program */, + cl_uint /* num_devices */, + const cl_device_id * /* device_list */, + const char * /* options */, + cl_uint /* num_input_headers */, + const cl_program * /* input_headers */, + const char ** /* header_include_names */, + void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */), + void * /* user_data */) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_program CL_API_CALL +clLinkProgram(cl_context /* context */, + cl_uint /* num_devices */, + const cl_device_id * /* device_list */, + const char * /* options */, + cl_uint /* num_input_programs */, + const cl_program * /* input_programs */, + void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */), + void * /* user_data */, + cl_int * /* errcode_ret */ ) CL_API_SUFFIX__VERSION_1_2; + + +extern CL_API_ENTRY cl_int CL_API_CALL +clUnloadPlatformCompiler(cl_platform_id /* platform */) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetProgramInfo(cl_program /* program */, + cl_program_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetProgramBuildInfo(cl_program /* program */, + cl_device_id /* device */, + cl_program_build_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +/* Kernel Object APIs */ +extern CL_API_ENTRY cl_kernel CL_API_CALL +clCreateKernel(cl_program /* program */, + const char * /* kernel_name */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clCreateKernelsInProgram(cl_program /* program */, + cl_uint /* num_kernels */, + cl_kernel * /* kernels */, + cl_uint * /* num_kernels_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_kernel CL_API_CALL +clCloneKernel(cl_kernel /* source_kernel */, + cl_int* /* errcode_ret */) CL_API_SUFFIX__VERSION_2_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetKernelArg(cl_kernel /* kernel */, + cl_uint /* arg_index */, + size_t /* arg_size */, + const void * /* arg_value */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetKernelArgSVMPointer(cl_kernel /* kernel */, + cl_uint /* arg_index */, + const void * /* arg_value */) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetKernelExecInfo(cl_kernel /* kernel */, + cl_kernel_exec_info /* param_name */, + size_t /* param_value_size */, + const void * /* param_value */) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetKernelInfo(cl_kernel /* kernel */, + cl_kernel_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetKernelArgInfo(cl_kernel /* kernel */, + cl_uint /* arg_indx */, + cl_kernel_arg_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetKernelWorkGroupInfo(cl_kernel /* kernel */, + cl_device_id /* device */, + cl_kernel_work_group_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetKernelSubGroupInfo(cl_kernel /* kernel */, + cl_device_id /* device */, + cl_kernel_sub_group_info /* param_name */, + size_t /* input_value_size */, + const void* /*input_value */, + size_t /* param_value_size */, + void* /* param_value */, + size_t* /* param_value_size_ret */ ) CL_API_SUFFIX__VERSION_2_1; + + +/* Event Object APIs */ +extern CL_API_ENTRY cl_int CL_API_CALL +clWaitForEvents(cl_uint /* num_events */, + const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetEventInfo(cl_event /* event */, + cl_event_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_event CL_API_CALL +clCreateUserEvent(cl_context /* context */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetUserEventStatus(cl_event /* event */, + cl_int /* execution_status */) CL_API_SUFFIX__VERSION_1_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetEventCallback( cl_event /* event */, + cl_int /* command_exec_callback_type */, + void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *), + void * /* user_data */) CL_API_SUFFIX__VERSION_1_1; + +/* Profiling APIs */ +extern CL_API_ENTRY cl_int CL_API_CALL +clGetEventProfilingInfo(cl_event /* event */, + cl_profiling_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +/* Flush and Finish APIs */ +extern CL_API_ENTRY cl_int CL_API_CALL +clFlush(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clFinish(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0; + +/* Enqueued Commands APIs */ +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReadBuffer(cl_command_queue /* command_queue */, + cl_mem /* buffer */, + cl_bool /* blocking_read */, + size_t /* offset */, + size_t /* size */, + void * /* ptr */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReadBufferRect(cl_command_queue /* command_queue */, + cl_mem /* buffer */, + cl_bool /* blocking_read */, + const size_t * /* buffer_offset */, + const size_t * /* host_offset */, + const size_t * /* region */, + size_t /* buffer_row_pitch */, + size_t /* buffer_slice_pitch */, + size_t /* host_row_pitch */, + size_t /* host_slice_pitch */, + void * /* ptr */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueWriteBuffer(cl_command_queue /* command_queue */, + cl_mem /* buffer */, + cl_bool /* blocking_write */, + size_t /* offset */, + size_t /* size */, + const void * /* ptr */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueWriteBufferRect(cl_command_queue /* command_queue */, + cl_mem /* buffer */, + cl_bool /* blocking_write */, + const size_t * /* buffer_offset */, + const size_t * /* host_offset */, + const size_t * /* region */, + size_t /* buffer_row_pitch */, + size_t /* buffer_slice_pitch */, + size_t /* host_row_pitch */, + size_t /* host_slice_pitch */, + const void * /* ptr */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueFillBuffer(cl_command_queue /* command_queue */, + cl_mem /* buffer */, + const void * /* pattern */, + size_t /* pattern_size */, + size_t /* offset */, + size_t /* size */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueCopyBuffer(cl_command_queue /* command_queue */, + cl_mem /* src_buffer */, + cl_mem /* dst_buffer */, + size_t /* src_offset */, + size_t /* dst_offset */, + size_t /* size */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueCopyBufferRect(cl_command_queue /* command_queue */, + cl_mem /* src_buffer */, + cl_mem /* dst_buffer */, + const size_t * /* src_origin */, + const size_t * /* dst_origin */, + const size_t * /* region */, + size_t /* src_row_pitch */, + size_t /* src_slice_pitch */, + size_t /* dst_row_pitch */, + size_t /* dst_slice_pitch */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReadImage(cl_command_queue /* command_queue */, + cl_mem /* image */, + cl_bool /* blocking_read */, + const size_t * /* origin[3] */, + const size_t * /* region[3] */, + size_t /* row_pitch */, + size_t /* slice_pitch */, + void * /* ptr */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueWriteImage(cl_command_queue /* command_queue */, + cl_mem /* image */, + cl_bool /* blocking_write */, + const size_t * /* origin[3] */, + const size_t * /* region[3] */, + size_t /* input_row_pitch */, + size_t /* input_slice_pitch */, + const void * /* ptr */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueFillImage(cl_command_queue /* command_queue */, + cl_mem /* image */, + const void * /* fill_color */, + const size_t * /* origin[3] */, + const size_t * /* region[3] */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueCopyImage(cl_command_queue /* command_queue */, + cl_mem /* src_image */, + cl_mem /* dst_image */, + const size_t * /* src_origin[3] */, + const size_t * /* dst_origin[3] */, + const size_t * /* region[3] */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueCopyImageToBuffer(cl_command_queue /* command_queue */, + cl_mem /* src_image */, + cl_mem /* dst_buffer */, + const size_t * /* src_origin[3] */, + const size_t * /* region[3] */, + size_t /* dst_offset */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueCopyBufferToImage(cl_command_queue /* command_queue */, + cl_mem /* src_buffer */, + cl_mem /* dst_image */, + size_t /* src_offset */, + const size_t * /* dst_origin[3] */, + const size_t * /* region[3] */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY void * CL_API_CALL +clEnqueueMapBuffer(cl_command_queue /* command_queue */, + cl_mem /* buffer */, + cl_bool /* blocking_map */, + cl_map_flags /* map_flags */, + size_t /* offset */, + size_t /* size */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY void * CL_API_CALL +clEnqueueMapImage(cl_command_queue /* command_queue */, + cl_mem /* image */, + cl_bool /* blocking_map */, + cl_map_flags /* map_flags */, + const size_t * /* origin[3] */, + const size_t * /* region[3] */, + size_t * /* image_row_pitch */, + size_t * /* image_slice_pitch */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueUnmapMemObject(cl_command_queue /* command_queue */, + cl_mem /* memobj */, + void * /* mapped_ptr */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueMigrateMemObjects(cl_command_queue /* command_queue */, + cl_uint /* num_mem_objects */, + const cl_mem * /* mem_objects */, + cl_mem_migration_flags /* flags */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueNDRangeKernel(cl_command_queue /* command_queue */, + cl_kernel /* kernel */, + cl_uint /* work_dim */, + const size_t * /* global_work_offset */, + const size_t * /* global_work_size */, + const size_t * /* local_work_size */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueNativeKernel(cl_command_queue /* command_queue */, + void (CL_CALLBACK * /*user_func*/)(void *), + void * /* args */, + size_t /* cb_args */, + cl_uint /* num_mem_objects */, + const cl_mem * /* mem_list */, + const void ** /* args_mem_loc */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueMarkerWithWaitList(cl_command_queue /* command_queue */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueBarrierWithWaitList(cl_command_queue /* command_queue */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMFree(cl_command_queue /* command_queue */, + cl_uint /* num_svm_pointers */, + void *[] /* svm_pointers[] */, + void (CL_CALLBACK * /*pfn_free_func*/)(cl_command_queue /* queue */, + cl_uint /* num_svm_pointers */, + void *[] /* svm_pointers[] */, + void * /* user_data */), + void * /* user_data */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMMemcpy(cl_command_queue /* command_queue */, + cl_bool /* blocking_copy */, + void * /* dst_ptr */, + const void * /* src_ptr */, + size_t /* size */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMMemFill(cl_command_queue /* command_queue */, + void * /* svm_ptr */, + const void * /* pattern */, + size_t /* pattern_size */, + size_t /* size */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMMap(cl_command_queue /* command_queue */, + cl_bool /* blocking_map */, + cl_map_flags /* flags */, + void * /* svm_ptr */, + size_t /* size */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMUnmap(cl_command_queue /* command_queue */, + void * /* svm_ptr */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMMigrateMem(cl_command_queue /* command_queue */, + cl_uint /* num_svm_pointers */, + const void ** /* svm_pointers */, + const size_t * /* sizes */, + cl_mem_migration_flags /* flags */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_2_1; + + +/* Extension function access + * + * Returns the extension function address for the given function name, + * or NULL if a valid function can not be found. The client must + * check to make sure the address is not NULL, before using or + * calling the returned function address. + */ +extern CL_API_ENTRY void * CL_API_CALL +clGetExtensionFunctionAddressForPlatform(cl_platform_id /* platform */, + const char * /* func_name */) CL_API_SUFFIX__VERSION_1_2; + + +/* Deprecated OpenCL 1.1 APIs */ +extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL +clCreateImage2D(cl_context /* context */, + cl_mem_flags /* flags */, + const cl_image_format * /* image_format */, + size_t /* image_width */, + size_t /* image_height */, + size_t /* image_row_pitch */, + void * /* host_ptr */, + cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; + +extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL +clCreateImage3D(cl_context /* context */, + cl_mem_flags /* flags */, + const cl_image_format * /* image_format */, + size_t /* image_width */, + size_t /* image_height */, + size_t /* image_depth */, + size_t /* image_row_pitch */, + size_t /* image_slice_pitch */, + void * /* host_ptr */, + cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; + +extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL +clEnqueueMarker(cl_command_queue /* command_queue */, + cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; + +extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL +clEnqueueWaitForEvents(cl_command_queue /* command_queue */, + cl_uint /* num_events */, + const cl_event * /* event_list */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; + +extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL +clEnqueueBarrier(cl_command_queue /* command_queue */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; + +extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL +clUnloadCompiler(void) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; + +extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL +clGetExtensionFunctionAddress(const char * /* func_name */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; + +/* Deprecated OpenCL 2.0 APIs */ +extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_2_DEPRECATED cl_command_queue CL_API_CALL +clCreateCommandQueue(cl_context /* context */, + cl_device_id /* device */, + cl_command_queue_properties /* properties */, + cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED; + + +extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_2_DEPRECATED cl_sampler CL_API_CALL +clCreateSampler(cl_context /* context */, + cl_bool /* normalized_coords */, + cl_addressing_mode /* addressing_mode */, + cl_filter_mode /* filter_mode */, + cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED; + +extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_2_DEPRECATED cl_int CL_API_CALL +clEnqueueTask(cl_command_queue /* command_queue */, + cl_kernel /* kernel */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED; + +#ifdef __cplusplus +} +#endif + +#endif /* __OPENCL_CL_H */ + diff --git a/third_party/opencl/include/CL/cl_d3d10.h b/third_party/opencl/include/CL/cl_d3d10.h new file mode 100644 index 000000000..d5960a43f --- /dev/null +++ b/third_party/opencl/include/CL/cl_d3d10.h @@ -0,0 +1,131 @@ +/********************************************************************************** + * Copyright (c) 2008-2015 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS + * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS + * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT + * https://www.khronos.org/registry/ + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + **********************************************************************************/ + +/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ + +#ifndef __OPENCL_CL_D3D10_H +#define __OPENCL_CL_D3D10_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** + * cl_khr_d3d10_sharing */ +#define cl_khr_d3d10_sharing 1 + +typedef cl_uint cl_d3d10_device_source_khr; +typedef cl_uint cl_d3d10_device_set_khr; + +/******************************************************************************/ + +/* Error Codes */ +#define CL_INVALID_D3D10_DEVICE_KHR -1002 +#define CL_INVALID_D3D10_RESOURCE_KHR -1003 +#define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004 +#define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005 + +/* cl_d3d10_device_source_nv */ +#define CL_D3D10_DEVICE_KHR 0x4010 +#define CL_D3D10_DXGI_ADAPTER_KHR 0x4011 + +/* cl_d3d10_device_set_nv */ +#define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012 +#define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013 + +/* cl_context_info */ +#define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014 +#define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C + +/* cl_mem_info */ +#define CL_MEM_D3D10_RESOURCE_KHR 0x4015 + +/* cl_image_info */ +#define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016 + +/* cl_command_type */ +#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017 +#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018 + +/******************************************************************************/ + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)( + cl_platform_id platform, + cl_d3d10_device_source_khr d3d_device_source, + void * d3d_object, + cl_d3d10_device_set_khr d3d_device_set, + cl_uint num_entries, + cl_device_id * devices, + cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)( + cl_context context, + cl_mem_flags flags, + ID3D10Buffer * resource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)( + cl_context context, + cl_mem_flags flags, + ID3D10Texture2D * resource, + UINT subresource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)( + cl_context context, + cl_mem_flags flags, + ID3D10Texture3D * resource, + UINT subresource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem * mem_objects, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem * mem_objects, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +#ifdef __cplusplus +} +#endif + +#endif /* __OPENCL_CL_D3D10_H */ + diff --git a/third_party/opencl/include/CL/cl_d3d11.h b/third_party/opencl/include/CL/cl_d3d11.h new file mode 100644 index 000000000..39f907239 --- /dev/null +++ b/third_party/opencl/include/CL/cl_d3d11.h @@ -0,0 +1,131 @@ +/********************************************************************************** + * Copyright (c) 2008-2015 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS + * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS + * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT + * https://www.khronos.org/registry/ + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + **********************************************************************************/ + +/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ + +#ifndef __OPENCL_CL_D3D11_H +#define __OPENCL_CL_D3D11_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** + * cl_khr_d3d11_sharing */ +#define cl_khr_d3d11_sharing 1 + +typedef cl_uint cl_d3d11_device_source_khr; +typedef cl_uint cl_d3d11_device_set_khr; + +/******************************************************************************/ + +/* Error Codes */ +#define CL_INVALID_D3D11_DEVICE_KHR -1006 +#define CL_INVALID_D3D11_RESOURCE_KHR -1007 +#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008 +#define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009 + +/* cl_d3d11_device_source */ +#define CL_D3D11_DEVICE_KHR 0x4019 +#define CL_D3D11_DXGI_ADAPTER_KHR 0x401A + +/* cl_d3d11_device_set */ +#define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B +#define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C + +/* cl_context_info */ +#define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D +#define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D + +/* cl_mem_info */ +#define CL_MEM_D3D11_RESOURCE_KHR 0x401E + +/* cl_image_info */ +#define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F + +/* cl_command_type */ +#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020 +#define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021 + +/******************************************************************************/ + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)( + cl_platform_id platform, + cl_d3d11_device_source_khr d3d_device_source, + void * d3d_object, + cl_d3d11_device_set_khr d3d_device_set, + cl_uint num_entries, + cl_device_id * devices, + cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11BufferKHR_fn)( + cl_context context, + cl_mem_flags flags, + ID3D11Buffer * resource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DKHR_fn)( + cl_context context, + cl_mem_flags flags, + ID3D11Texture2D * resource, + UINT subresource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DKHR_fn)( + cl_context context, + cl_mem_flags flags, + ID3D11Texture3D * resource, + UINT subresource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem * mem_objects, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_2; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem * mem_objects, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_2; + +#ifdef __cplusplus +} +#endif + +#endif /* __OPENCL_CL_D3D11_H */ + diff --git a/third_party/opencl/include/CL/cl_dx9_media_sharing.h b/third_party/opencl/include/CL/cl_dx9_media_sharing.h new file mode 100644 index 000000000..2729e8b9e --- /dev/null +++ b/third_party/opencl/include/CL/cl_dx9_media_sharing.h @@ -0,0 +1,132 @@ +/********************************************************************************** + * Copyright (c) 2008-2015 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS + * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS + * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT + * https://www.khronos.org/registry/ + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + **********************************************************************************/ + +/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ + +#ifndef __OPENCL_CL_DX9_MEDIA_SHARING_H +#define __OPENCL_CL_DX9_MEDIA_SHARING_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/******************************************************************************/ +/* cl_khr_dx9_media_sharing */ +#define cl_khr_dx9_media_sharing 1 + +typedef cl_uint cl_dx9_media_adapter_type_khr; +typedef cl_uint cl_dx9_media_adapter_set_khr; + +#if defined(_WIN32) +#include +typedef struct _cl_dx9_surface_info_khr +{ + IDirect3DSurface9 *resource; + HANDLE shared_handle; +} cl_dx9_surface_info_khr; +#endif + + +/******************************************************************************/ + +/* Error Codes */ +#define CL_INVALID_DX9_MEDIA_ADAPTER_KHR -1010 +#define CL_INVALID_DX9_MEDIA_SURFACE_KHR -1011 +#define CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR -1012 +#define CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR -1013 + +/* cl_media_adapter_type_khr */ +#define CL_ADAPTER_D3D9_KHR 0x2020 +#define CL_ADAPTER_D3D9EX_KHR 0x2021 +#define CL_ADAPTER_DXVA_KHR 0x2022 + +/* cl_media_adapter_set_khr */ +#define CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2023 +#define CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2024 + +/* cl_context_info */ +#define CL_CONTEXT_ADAPTER_D3D9_KHR 0x2025 +#define CL_CONTEXT_ADAPTER_D3D9EX_KHR 0x2026 +#define CL_CONTEXT_ADAPTER_DXVA_KHR 0x2027 + +/* cl_mem_info */ +#define CL_MEM_DX9_MEDIA_ADAPTER_TYPE_KHR 0x2028 +#define CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR 0x2029 + +/* cl_image_info */ +#define CL_IMAGE_DX9_MEDIA_PLANE_KHR 0x202A + +/* cl_command_type */ +#define CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR 0x202B +#define CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR 0x202C + +/******************************************************************************/ + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_fn)( + cl_platform_id platform, + cl_uint num_media_adapters, + cl_dx9_media_adapter_type_khr * media_adapter_type, + void * media_adapters, + cl_dx9_media_adapter_set_khr media_adapter_set, + cl_uint num_entries, + cl_device_id * devices, + cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)( + cl_context context, + cl_mem_flags flags, + cl_dx9_media_adapter_type_khr adapter_type, + void * surface_info, + cl_uint plane, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem * mem_objects, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_2; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseDX9MediaSurfacesKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem * mem_objects, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_2; + +#ifdef __cplusplus +} +#endif + +#endif /* __OPENCL_CL_DX9_MEDIA_SHARING_H */ + diff --git a/third_party/opencl/include/CL/cl_egl.h b/third_party/opencl/include/CL/cl_egl.h new file mode 100644 index 000000000..a765bd526 --- /dev/null +++ b/third_party/opencl/include/CL/cl_egl.h @@ -0,0 +1,136 @@ +/******************************************************************************* + * Copyright (c) 2008-2015 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS + * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS + * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT + * https://www.khronos.org/registry/ + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + ******************************************************************************/ + +#ifndef __OPENCL_CL_EGL_H +#define __OPENCL_CL_EGL_H + +#ifdef __APPLE__ + +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Command type for events created with clEnqueueAcquireEGLObjectsKHR */ +#define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F +#define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D +#define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E + +/* Error type for clCreateFromEGLImageKHR */ +#define CL_INVALID_EGL_OBJECT_KHR -1093 +#define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092 + +/* CLeglImageKHR is an opaque handle to an EGLImage */ +typedef void* CLeglImageKHR; + +/* CLeglDisplayKHR is an opaque handle to an EGLDisplay */ +typedef void* CLeglDisplayKHR; + +/* CLeglSyncKHR is an opaque handle to an EGLSync object */ +typedef void* CLeglSyncKHR; + +/* properties passed to clCreateFromEGLImageKHR */ +typedef intptr_t cl_egl_image_properties_khr; + + +#define cl_khr_egl_image 1 + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromEGLImageKHR(cl_context /* context */, + CLeglDisplayKHR /* egldisplay */, + CLeglImageKHR /* eglimage */, + cl_mem_flags /* flags */, + const cl_egl_image_properties_khr * /* properties */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)( + cl_context context, + CLeglDisplayKHR egldisplay, + CLeglImageKHR eglimage, + cl_mem_flags flags, + const cl_egl_image_properties_khr * properties, + cl_int * errcode_ret); + + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueAcquireEGLObjectsKHR(cl_command_queue /* command_queue */, + cl_uint /* num_objects */, + const cl_mem * /* mem_objects */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem * mem_objects, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event); + + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReleaseEGLObjectsKHR(cl_command_queue /* command_queue */, + cl_uint /* num_objects */, + const cl_mem * /* mem_objects */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem * mem_objects, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event); + + +#define cl_khr_egl_event 1 + +extern CL_API_ENTRY cl_event CL_API_CALL +clCreateEventFromEGLSyncKHR(cl_context /* context */, + CLeglSyncKHR /* sync */, + CLeglDisplayKHR /* display */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)( + cl_context context, + CLeglSyncKHR sync, + CLeglDisplayKHR display, + cl_int * errcode_ret); + +#ifdef __cplusplus +} +#endif + +#endif /* __OPENCL_CL_EGL_H */ diff --git a/third_party/opencl/include/CL/cl_ext.h b/third_party/opencl/include/CL/cl_ext.h new file mode 100644 index 000000000..794158389 --- /dev/null +++ b/third_party/opencl/include/CL/cl_ext.h @@ -0,0 +1,391 @@ +/******************************************************************************* + * Copyright (c) 2008-2015 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS + * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS + * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT + * https://www.khronos.org/registry/ + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + ******************************************************************************/ + +/* $Revision: 11928 $ on $Date: 2010-07-13 09:04:56 -0700 (Tue, 13 Jul 2010) $ */ + +/* cl_ext.h contains OpenCL extensions which don't have external */ +/* (OpenGL, D3D) dependencies. */ + +#ifndef __CL_EXT_H +#define __CL_EXT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __APPLE__ + #include + #include +#else + #include +#endif + +/* cl_khr_fp16 extension - no extension #define since it has no functions */ +#define CL_DEVICE_HALF_FP_CONFIG 0x1033 + +/* Memory object destruction + * + * Apple extension for use to manage externally allocated buffers used with cl_mem objects with CL_MEM_USE_HOST_PTR + * + * Registers a user callback function that will be called when the memory object is deleted and its resources + * freed. Each call to clSetMemObjectCallbackFn registers the specified user callback function on a callback + * stack associated with memobj. The registered user callback functions are called in the reverse order in + * which they were registered. The user callback functions are called and then the memory object is deleted + * and its resources freed. This provides a mechanism for the application (and libraries) using memobj to be + * notified when the memory referenced by host_ptr, specified when the memory object is created and used as + * the storage bits for the memory object, can be reused or freed. + * + * The application may not call CL api's with the cl_mem object passed to the pfn_notify. + * + * Please check for the "cl_APPLE_SetMemObjectDestructor" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS) + * before using. + */ +#define cl_APPLE_SetMemObjectDestructor 1 +cl_int CL_API_ENTRY clSetMemObjectDestructorAPPLE( cl_mem /* memobj */, + void (* /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/), + void * /*user_data */ ) CL_EXT_SUFFIX__VERSION_1_0; + + +/* Context Logging Functions + * + * The next three convenience functions are intended to be used as the pfn_notify parameter to clCreateContext(). + * Please check for the "cl_APPLE_ContextLoggingFunctions" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS) + * before using. + * + * clLogMessagesToSystemLog fowards on all log messages to the Apple System Logger + */ +#define cl_APPLE_ContextLoggingFunctions 1 +extern void CL_API_ENTRY clLogMessagesToSystemLogAPPLE( const char * /* errstr */, + const void * /* private_info */, + size_t /* cb */, + void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0; + +/* clLogMessagesToStdout sends all log messages to the file descriptor stdout */ +extern void CL_API_ENTRY clLogMessagesToStdoutAPPLE( const char * /* errstr */, + const void * /* private_info */, + size_t /* cb */, + void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0; + +/* clLogMessagesToStderr sends all log messages to the file descriptor stderr */ +extern void CL_API_ENTRY clLogMessagesToStderrAPPLE( const char * /* errstr */, + const void * /* private_info */, + size_t /* cb */, + void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0; + + +/************************ +* cl_khr_icd extension * +************************/ +#define cl_khr_icd 1 + +/* cl_platform_info */ +#define CL_PLATFORM_ICD_SUFFIX_KHR 0x0920 + +/* Additional Error Codes */ +#define CL_PLATFORM_NOT_FOUND_KHR -1001 + +extern CL_API_ENTRY cl_int CL_API_CALL +clIcdGetPlatformIDsKHR(cl_uint /* num_entries */, + cl_platform_id * /* platforms */, + cl_uint * /* num_platforms */); + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clIcdGetPlatformIDsKHR_fn)( + cl_uint /* num_entries */, + cl_platform_id * /* platforms */, + cl_uint * /* num_platforms */); + + +/* Extension: cl_khr_image2D_buffer + * + * This extension allows a 2D image to be created from a cl_mem buffer without a copy. + * The type associated with a 2D image created from a buffer in an OpenCL program is image2d_t. + * Both the sampler and sampler-less read_image built-in functions are supported for 2D images + * and 2D images created from a buffer. Similarly, the write_image built-ins are also supported + * for 2D images created from a buffer. + * + * When the 2D image from buffer is created, the client must specify the width, + * height, image format (i.e. channel order and channel data type) and optionally the row pitch + * + * The pitch specified must be a multiple of CL_DEVICE_IMAGE_PITCH_ALIGNMENT pixels. + * The base address of the buffer must be aligned to CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT pixels. + */ + +/************************************* + * cl_khr_initalize_memory extension * + *************************************/ + +#define CL_CONTEXT_MEMORY_INITIALIZE_KHR 0x2030 + + +/************************************** + * cl_khr_terminate_context extension * + **************************************/ + +#define CL_DEVICE_TERMINATE_CAPABILITY_KHR 0x2031 +#define CL_CONTEXT_TERMINATE_KHR 0x2032 + +#define cl_khr_terminate_context 1 +extern CL_API_ENTRY cl_int CL_API_CALL clTerminateContextKHR(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clTerminateContextKHR_fn)(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2; + + +/* + * Extension: cl_khr_spir + * + * This extension adds support to create an OpenCL program object from a + * Standard Portable Intermediate Representation (SPIR) instance + */ + +#define CL_DEVICE_SPIR_VERSIONS 0x40E0 +#define CL_PROGRAM_BINARY_TYPE_INTERMEDIATE 0x40E1 + + +/****************************************** +* cl_nv_device_attribute_query extension * +******************************************/ +/* cl_nv_device_attribute_query extension - no extension #define since it has no functions */ +#define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV 0x4000 +#define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV 0x4001 +#define CL_DEVICE_REGISTERS_PER_BLOCK_NV 0x4002 +#define CL_DEVICE_WARP_SIZE_NV 0x4003 +#define CL_DEVICE_GPU_OVERLAP_NV 0x4004 +#define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005 +#define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006 + +/********************************* +* cl_amd_device_attribute_query * +*********************************/ +#define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD 0x4036 + +/********************************* +* cl_arm_printf extension +*********************************/ +#define CL_PRINTF_CALLBACK_ARM 0x40B0 +#define CL_PRINTF_BUFFERSIZE_ARM 0x40B1 + +#ifdef CL_VERSION_1_1 + /*********************************** + * cl_ext_device_fission extension * + ***********************************/ + #define cl_ext_device_fission 1 + + extern CL_API_ENTRY cl_int CL_API_CALL + clReleaseDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1; + + typedef CL_API_ENTRY cl_int + (CL_API_CALL *clReleaseDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1; + + extern CL_API_ENTRY cl_int CL_API_CALL + clRetainDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1; + + typedef CL_API_ENTRY cl_int + (CL_API_CALL *clRetainDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1; + + typedef cl_ulong cl_device_partition_property_ext; + extern CL_API_ENTRY cl_int CL_API_CALL + clCreateSubDevicesEXT( cl_device_id /*in_device*/, + const cl_device_partition_property_ext * /* properties */, + cl_uint /*num_entries*/, + cl_device_id * /*out_devices*/, + cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1; + + typedef CL_API_ENTRY cl_int + ( CL_API_CALL * clCreateSubDevicesEXT_fn)( cl_device_id /*in_device*/, + const cl_device_partition_property_ext * /* properties */, + cl_uint /*num_entries*/, + cl_device_id * /*out_devices*/, + cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1; + + /* cl_device_partition_property_ext */ + #define CL_DEVICE_PARTITION_EQUALLY_EXT 0x4050 + #define CL_DEVICE_PARTITION_BY_COUNTS_EXT 0x4051 + #define CL_DEVICE_PARTITION_BY_NAMES_EXT 0x4052 + #define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT 0x4053 + + /* clDeviceGetInfo selectors */ + #define CL_DEVICE_PARENT_DEVICE_EXT 0x4054 + #define CL_DEVICE_PARTITION_TYPES_EXT 0x4055 + #define CL_DEVICE_AFFINITY_DOMAINS_EXT 0x4056 + #define CL_DEVICE_REFERENCE_COUNT_EXT 0x4057 + #define CL_DEVICE_PARTITION_STYLE_EXT 0x4058 + + /* error codes */ + #define CL_DEVICE_PARTITION_FAILED_EXT -1057 + #define CL_INVALID_PARTITION_COUNT_EXT -1058 + #define CL_INVALID_PARTITION_NAME_EXT -1059 + + /* CL_AFFINITY_DOMAINs */ + #define CL_AFFINITY_DOMAIN_L1_CACHE_EXT 0x1 + #define CL_AFFINITY_DOMAIN_L2_CACHE_EXT 0x2 + #define CL_AFFINITY_DOMAIN_L3_CACHE_EXT 0x3 + #define CL_AFFINITY_DOMAIN_L4_CACHE_EXT 0x4 + #define CL_AFFINITY_DOMAIN_NUMA_EXT 0x10 + #define CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT 0x100 + + /* cl_device_partition_property_ext list terminators */ + #define CL_PROPERTIES_LIST_END_EXT ((cl_device_partition_property_ext) 0) + #define CL_PARTITION_BY_COUNTS_LIST_END_EXT ((cl_device_partition_property_ext) 0) + #define CL_PARTITION_BY_NAMES_LIST_END_EXT ((cl_device_partition_property_ext) 0 - 1) + +/********************************* +* cl_qcom_ext_host_ptr extension +*********************************/ + +#define CL_MEM_EXT_HOST_PTR_QCOM (1 << 29) + +#define CL_DEVICE_EXT_MEM_PADDING_IN_BYTES_QCOM 0x40A0 +#define CL_DEVICE_PAGE_SIZE_QCOM 0x40A1 +#define CL_IMAGE_ROW_ALIGNMENT_QCOM 0x40A2 +#define CL_IMAGE_SLICE_ALIGNMENT_QCOM 0x40A3 +#define CL_MEM_HOST_UNCACHED_QCOM 0x40A4 +#define CL_MEM_HOST_WRITEBACK_QCOM 0x40A5 +#define CL_MEM_HOST_WRITETHROUGH_QCOM 0x40A6 +#define CL_MEM_HOST_WRITE_COMBINING_QCOM 0x40A7 + +typedef cl_uint cl_image_pitch_info_qcom; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetDeviceImageInfoQCOM(cl_device_id device, + size_t image_width, + size_t image_height, + const cl_image_format *image_format, + cl_image_pitch_info_qcom param_name, + size_t param_value_size, + void *param_value, + size_t *param_value_size_ret); + +typedef struct _cl_mem_ext_host_ptr +{ + /* Type of external memory allocation. */ + /* Legal values will be defined in layered extensions. */ + cl_uint allocation_type; + + /* Host cache policy for this external memory allocation. */ + cl_uint host_cache_policy; + +} cl_mem_ext_host_ptr; + +/********************************* +* cl_qcom_ion_host_ptr extension +*********************************/ + +#define CL_MEM_ION_HOST_PTR_QCOM 0x40A8 + +typedef struct _cl_mem_ion_host_ptr +{ + /* Type of external memory allocation. */ + /* Must be CL_MEM_ION_HOST_PTR_QCOM for ION allocations. */ + cl_mem_ext_host_ptr ext_host_ptr; + + /* ION file descriptor */ + int ion_filedesc; + + /* Host pointer to the ION allocated memory */ + void* ion_hostptr; + +} cl_mem_ion_host_ptr; + +#endif /* CL_VERSION_1_1 */ + + +#ifdef CL_VERSION_2_0 +/********************************* +* cl_khr_sub_groups extension +*********************************/ +#define cl_khr_sub_groups 1 + +typedef cl_uint cl_kernel_sub_group_info_khr; + +/* cl_khr_sub_group_info */ +#define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR 0x2033 +#define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR 0x2034 + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetKernelSubGroupInfoKHR(cl_kernel /* in_kernel */, + cl_device_id /*in_device*/, + cl_kernel_sub_group_info_khr /* param_name */, + size_t /*input_value_size*/, + const void * /*input_value*/, + size_t /*param_value_size*/, + void* /*param_value*/, + size_t* /*param_value_size_ret*/ ) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED; + +typedef CL_API_ENTRY cl_int + ( CL_API_CALL * clGetKernelSubGroupInfoKHR_fn)(cl_kernel /* in_kernel */, + cl_device_id /*in_device*/, + cl_kernel_sub_group_info_khr /* param_name */, + size_t /*input_value_size*/, + const void * /*input_value*/, + size_t /*param_value_size*/, + void* /*param_value*/, + size_t* /*param_value_size_ret*/ ) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED; +#endif /* CL_VERSION_2_0 */ + +#ifdef CL_VERSION_2_1 +/********************************* +* cl_khr_priority_hints extension +*********************************/ +#define cl_khr_priority_hints 1 + +typedef cl_uint cl_queue_priority_khr; + +/* cl_command_queue_properties */ +#define CL_QUEUE_PRIORITY_KHR 0x1096 + +/* cl_queue_priority_khr */ +#define CL_QUEUE_PRIORITY_HIGH_KHR (1<<0) +#define CL_QUEUE_PRIORITY_MED_KHR (1<<1) +#define CL_QUEUE_PRIORITY_LOW_KHR (1<<2) + +#endif /* CL_VERSION_2_1 */ + +#ifdef CL_VERSION_2_1 +/********************************* +* cl_khr_throttle_hints extension +*********************************/ +#define cl_khr_throttle_hints 1 + +typedef cl_uint cl_queue_throttle_khr; + +/* cl_command_queue_properties */ +#define CL_QUEUE_THROTTLE_KHR 0x1097 + +/* cl_queue_throttle_khr */ +#define CL_QUEUE_THROTTLE_HIGH_KHR (1<<0) +#define CL_QUEUE_THROTTLE_MED_KHR (1<<1) +#define CL_QUEUE_THROTTLE_LOW_KHR (1<<2) + +#endif /* CL_VERSION_2_1 */ + +#ifdef __cplusplus +} +#endif + + +#endif /* __CL_EXT_H */ diff --git a/third_party/opencl/include/CL/cl_ext_qcom.h b/third_party/opencl/include/CL/cl_ext_qcom.h new file mode 100644 index 000000000..6328a1cd9 --- /dev/null +++ b/third_party/opencl/include/CL/cl_ext_qcom.h @@ -0,0 +1,255 @@ +/* Copyright (c) 2009-2017 Qualcomm Technologies, Inc. All Rights Reserved. + * Qualcomm Technologies Proprietary and Confidential. + */ + +#ifndef __OPENCL_CL_EXT_QCOM_H +#define __OPENCL_CL_EXT_QCOM_H + +// Needed by cl_khr_egl_event extension +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/************************************ + * cl_qcom_create_buffer_from_image * + ************************************/ + +#define CL_BUFFER_FROM_IMAGE_ROW_PITCH_QCOM 0x40C0 +#define CL_BUFFER_FROM_IMAGE_SLICE_PITCH_QCOM 0x40C1 + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateBufferFromImageQCOM(cl_mem image, + cl_mem_flags flags, + cl_int *errcode_ret); + + +/************************************ + * cl_qcom_limited_printf extension * + ************************************/ + +/* Builtin printf function buffer size in bytes. */ +#define CL_DEVICE_PRINTF_BUFFER_SIZE_QCOM 0x1049 + + +/************************************* + * cl_qcom_extended_images extension * + *************************************/ + +#define CL_CONTEXT_ENABLE_EXTENDED_IMAGES_QCOM 0x40AA +#define CL_DEVICE_EXTENDED_IMAGE2D_MAX_WIDTH_QCOM 0x40AB +#define CL_DEVICE_EXTENDED_IMAGE2D_MAX_HEIGHT_QCOM 0x40AC +#define CL_DEVICE_EXTENDED_IMAGE3D_MAX_WIDTH_QCOM 0x40AD +#define CL_DEVICE_EXTENDED_IMAGE3D_MAX_HEIGHT_QCOM 0x40AE +#define CL_DEVICE_EXTENDED_IMAGE3D_MAX_DEPTH_QCOM 0x40AF + +/************************************* + * cl_qcom_perf_hint extension * + *************************************/ + +typedef cl_uint cl_perf_hint; + +#define CL_CONTEXT_PERF_HINT_QCOM 0x40C2 + +/*cl_perf_hint*/ +#define CL_PERF_HINT_HIGH_QCOM 0x40C3 +#define CL_PERF_HINT_NORMAL_QCOM 0x40C4 +#define CL_PERF_HINT_LOW_QCOM 0x40C5 + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetPerfHintQCOM(cl_context context, + cl_perf_hint perf_hint); + +// This extension is published at Khronos, so its definitions are made in cl_ext.h. +// This duplication is for backward compatibility. + +#ifndef CL_MEM_ANDROID_NATIVE_BUFFER_HOST_PTR_QCOM + +/********************************* +* cl_qcom_android_native_buffer_host_ptr extension +*********************************/ + +#define CL_MEM_ANDROID_NATIVE_BUFFER_HOST_PTR_QCOM 0x40C6 + + +typedef struct _cl_mem_android_native_buffer_host_ptr +{ + // Type of external memory allocation. + // Must be CL_MEM_ANDROID_NATIVE_BUFFER_HOST_PTR_QCOM for Android native buffers. + cl_mem_ext_host_ptr ext_host_ptr; + + // Virtual pointer to the android native buffer + void* anb_ptr; + +} cl_mem_android_native_buffer_host_ptr; + +#endif //#ifndef CL_MEM_ANDROID_NATIVE_BUFFER_HOST_PTR_QCOM + +/*********************************** +* cl_img_egl_image extension * +************************************/ +typedef void* CLeglImageIMG; +typedef void* CLeglDisplayIMG; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromEGLImageIMG(cl_context context, + cl_mem_flags flags, + CLeglImageIMG image, + CLeglDisplayIMG display, + cl_int *errcode_ret); + + +/********************************* +* cl_qcom_other_image extension +*********************************/ + +// Extended flag for creating/querying QCOM non-standard images +#define CL_MEM_OTHER_IMAGE_QCOM (1<<25) + +// cl_channel_type +#define CL_QCOM_UNORM_MIPI10 0x4159 +#define CL_QCOM_UNORM_MIPI12 0x415A +#define CL_QCOM_UNSIGNED_MIPI10 0x415B +#define CL_QCOM_UNSIGNED_MIPI12 0x415C +#define CL_QCOM_UNORM_INT10 0x415D +#define CL_QCOM_UNORM_INT12 0x415E +#define CL_QCOM_UNSIGNED_INT16 0x415F + +// cl_channel_order +// Dedicate 0x4130-0x415F range for QCOM extended image formats +// 0x4130 - 0x4132 range is assigned to pixel-oriented compressed format +#define CL_QCOM_BAYER 0x414E + +#define CL_QCOM_NV12 0x4133 +#define CL_QCOM_NV12_Y 0x4134 +#define CL_QCOM_NV12_UV 0x4135 + +#define CL_QCOM_TILED_NV12 0x4136 +#define CL_QCOM_TILED_NV12_Y 0x4137 +#define CL_QCOM_TILED_NV12_UV 0x4138 + +#define CL_QCOM_P010 0x413C +#define CL_QCOM_P010_Y 0x413D +#define CL_QCOM_P010_UV 0x413E + +#define CL_QCOM_TILED_P010 0x413F +#define CL_QCOM_TILED_P010_Y 0x4140 +#define CL_QCOM_TILED_P010_UV 0x4141 + + +#define CL_QCOM_TP10 0x4145 +#define CL_QCOM_TP10_Y 0x4146 +#define CL_QCOM_TP10_UV 0x4147 + +#define CL_QCOM_TILED_TP10 0x4148 +#define CL_QCOM_TILED_TP10_Y 0x4149 +#define CL_QCOM_TILED_TP10_UV 0x414A + +/********************************* +* cl_qcom_compressed_image extension +*********************************/ + +// Extended flag for creating/querying QCOM non-planar compressed images +#define CL_MEM_COMPRESSED_IMAGE_QCOM (1<<27) + +// Extended image format +// cl_channel_order +#define CL_QCOM_COMPRESSED_RGBA 0x4130 +#define CL_QCOM_COMPRESSED_RGBx 0x4131 + +#define CL_QCOM_COMPRESSED_NV12_Y 0x413A +#define CL_QCOM_COMPRESSED_NV12_UV 0x413B + +#define CL_QCOM_COMPRESSED_P010 0x4142 +#define CL_QCOM_COMPRESSED_P010_Y 0x4143 +#define CL_QCOM_COMPRESSED_P010_UV 0x4144 + +#define CL_QCOM_COMPRESSED_TP10 0x414B +#define CL_QCOM_COMPRESSED_TP10_Y 0x414C +#define CL_QCOM_COMPRESSED_TP10_UV 0x414D + +#define CL_QCOM_COMPRESSED_NV12_4R 0x414F +#define CL_QCOM_COMPRESSED_NV12_4R_Y 0x4150 +#define CL_QCOM_COMPRESSED_NV12_4R_UV 0x4151 +/********************************* +* cl_qcom_compressed_yuv_image_read extension +*********************************/ + +// Extended flag for creating/querying QCOM compressed images +#define CL_MEM_COMPRESSED_YUV_IMAGE_QCOM (1<<28) + +// Extended image format +#define CL_QCOM_COMPRESSED_NV12 0x10C4 + +// Extended flag for setting ION buffer allocation type +#define CL_MEM_ION_HOST_PTR_COMPRESSED_YUV_QCOM 0x40CD +#define CL_MEM_ION_HOST_PTR_PROTECTED_COMPRESSED_YUV_QCOM 0x40CE + +/********************************* +* cl_qcom_accelerated_image_ops +*********************************/ +#define CL_MEM_OBJECT_WEIGHT_IMAGE_QCOM 0x4110 +#define CL_DEVICE_HOF_MAX_NUM_PHASES_QCOM 0x4111 +#define CL_DEVICE_HOF_MAX_FILTER_SIZE_X_QCOM 0x4112 +#define CL_DEVICE_HOF_MAX_FILTER_SIZE_Y_QCOM 0x4113 +#define CL_DEVICE_BLOCK_MATCHING_MAX_REGION_SIZE_X_QCOM 0x4114 +#define CL_DEVICE_BLOCK_MATCHING_MAX_REGION_SIZE_Y_QCOM 0x4115 + +//Extended flag for specifying weight image type +#define CL_WEIGHT_IMAGE_SEPARABLE_QCOM (1<<0) + +// Box Filter +typedef struct _cl_box_filter_size_qcom +{ + // Width of box filter on X direction. + float box_filter_width; + + // Height of box filter on Y direction. + float box_filter_height; +} cl_box_filter_size_qcom; + +// HOF Weight Image Desc +typedef struct _cl_weight_desc_qcom +{ + /** Coordinate of the "center" point of the weight image, + based on the weight image's top-left corner as the origin. */ + size_t center_coord_x; + size_t center_coord_y; + cl_bitfield flags; +} cl_weight_desc_qcom; + +typedef struct _cl_weight_image_desc_qcom +{ + cl_image_desc image_desc; + cl_weight_desc_qcom weight_desc; +} cl_weight_image_desc_qcom; + +/************************************* + * cl_qcom_protected_context extension * + *************************************/ + +#define CL_CONTEXT_PROTECTED_QCOM 0x40C7 +#define CL_MEM_ION_HOST_PTR_PROTECTED_QCOM 0x40C8 + +/************************************* + * cl_qcom_priority_hint extension * + *************************************/ +#define CL_PRIORITY_HINT_NONE_QCOM 0 +typedef cl_uint cl_priority_hint; + +#define CL_CONTEXT_PRIORITY_HINT_QCOM 0x40C9 + +/*cl_priority_hint*/ +#define CL_PRIORITY_HINT_HIGH_QCOM 0x40CA +#define CL_PRIORITY_HINT_NORMAL_QCOM 0x40CB +#define CL_PRIORITY_HINT_LOW_QCOM 0x40CC + +#ifdef __cplusplus +} +#endif + +#endif /* __OPENCL_CL_EXT_QCOM_H */ diff --git a/third_party/opencl/include/CL/cl_gl.h b/third_party/opencl/include/CL/cl_gl.h new file mode 100644 index 000000000..945daa83d --- /dev/null +++ b/third_party/opencl/include/CL/cl_gl.h @@ -0,0 +1,167 @@ +/********************************************************************************** + * Copyright (c) 2008-2015 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS + * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS + * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT + * https://www.khronos.org/registry/ + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + **********************************************************************************/ + +#ifndef __OPENCL_CL_GL_H +#define __OPENCL_CL_GL_H + +#ifdef __APPLE__ +#include +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef cl_uint cl_gl_object_type; +typedef cl_uint cl_gl_texture_info; +typedef cl_uint cl_gl_platform_info; +typedef struct __GLsync *cl_GLsync; + +/* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken */ +#define CL_GL_OBJECT_BUFFER 0x2000 +#define CL_GL_OBJECT_TEXTURE2D 0x2001 +#define CL_GL_OBJECT_TEXTURE3D 0x2002 +#define CL_GL_OBJECT_RENDERBUFFER 0x2003 +#define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E +#define CL_GL_OBJECT_TEXTURE1D 0x200F +#define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010 +#define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011 + +/* cl_gl_texture_info */ +#define CL_GL_TEXTURE_TARGET 0x2004 +#define CL_GL_MIPMAP_LEVEL 0x2005 +#define CL_GL_NUM_SAMPLES 0x2012 + + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromGLBuffer(cl_context /* context */, + cl_mem_flags /* flags */, + cl_GLuint /* bufobj */, + int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromGLTexture(cl_context /* context */, + cl_mem_flags /* flags */, + cl_GLenum /* target */, + cl_GLint /* miplevel */, + cl_GLuint /* texture */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromGLRenderbuffer(cl_context /* context */, + cl_mem_flags /* flags */, + cl_GLuint /* renderbuffer */, + cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetGLObjectInfo(cl_mem /* memobj */, + cl_gl_object_type * /* gl_object_type */, + cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetGLTextureInfo(cl_mem /* memobj */, + cl_gl_texture_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueAcquireGLObjects(cl_command_queue /* command_queue */, + cl_uint /* num_objects */, + const cl_mem * /* mem_objects */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */, + cl_uint /* num_objects */, + const cl_mem * /* mem_objects */, + cl_uint /* num_events_in_wait_list */, + const cl_event * /* event_wait_list */, + cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; + + +/* Deprecated OpenCL 1.1 APIs */ +extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL +clCreateFromGLTexture2D(cl_context /* context */, + cl_mem_flags /* flags */, + cl_GLenum /* target */, + cl_GLint /* miplevel */, + cl_GLuint /* texture */, + cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; + +extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL +clCreateFromGLTexture3D(cl_context /* context */, + cl_mem_flags /* flags */, + cl_GLenum /* target */, + cl_GLint /* miplevel */, + cl_GLuint /* texture */, + cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; + +/* cl_khr_gl_sharing extension */ + +#define cl_khr_gl_sharing 1 + +typedef cl_uint cl_gl_context_info; + +/* Additional Error Codes */ +#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000 + +/* cl_gl_context_info */ +#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006 +#define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007 + +/* Additional cl_context_properties */ +#define CL_GL_CONTEXT_KHR 0x2008 +#define CL_EGL_DISPLAY_KHR 0x2009 +#define CL_GLX_DISPLAY_KHR 0x200A +#define CL_WGL_HDC_KHR 0x200B +#define CL_CGL_SHAREGROUP_KHR 0x200C + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetGLContextInfoKHR(const cl_context_properties * /* properties */, + cl_gl_context_info /* param_name */, + size_t /* param_value_size */, + void * /* param_value */, + size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)( + const cl_context_properties * properties, + cl_gl_context_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret); + +#ifdef __cplusplus +} +#endif + +#endif /* __OPENCL_CL_GL_H */ diff --git a/third_party/opencl/include/CL/cl_gl_ext.h b/third_party/opencl/include/CL/cl_gl_ext.h new file mode 100644 index 000000000..e3c14c640 --- /dev/null +++ b/third_party/opencl/include/CL/cl_gl_ext.h @@ -0,0 +1,74 @@ +/********************************************************************************** + * Copyright (c) 2008-2015 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS + * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS + * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT + * https://www.khronos.org/registry/ + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + **********************************************************************************/ + +/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ + +/* cl_gl_ext.h contains vendor (non-KHR) OpenCL extensions which have */ +/* OpenGL dependencies. */ + +#ifndef __OPENCL_CL_GL_EXT_H +#define __OPENCL_CL_GL_EXT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __APPLE__ + #include +#else + #include +#endif + +/* + * For each extension, follow this template + * cl_VEN_extname extension */ +/* #define cl_VEN_extname 1 + * ... define new types, if any + * ... define new tokens, if any + * ... define new APIs, if any + * + * If you need GLtypes here, mirror them with a cl_GLtype, rather than including a GL header + * This allows us to avoid having to decide whether to include GL headers or GLES here. + */ + +/* + * cl_khr_gl_event extension + * See section 9.9 in the OpenCL 1.1 spec for more information + */ +#define CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR 0x200D + +extern CL_API_ENTRY cl_event CL_API_CALL +clCreateEventFromGLsyncKHR(cl_context /* context */, + cl_GLsync /* cl_GLsync */, + cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1; + +#ifdef __cplusplus +} +#endif + +#endif /* __OPENCL_CL_GL_EXT_H */ diff --git a/third_party/opencl/include/CL/cl_platform.h b/third_party/opencl/include/CL/cl_platform.h new file mode 100644 index 000000000..4e334a291 --- /dev/null +++ b/third_party/opencl/include/CL/cl_platform.h @@ -0,0 +1,1333 @@ +/********************************************************************************** + * Copyright (c) 2008-2015 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS + * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS + * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT + * https://www.khronos.org/registry/ + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + **********************************************************************************/ + +/* $Revision: 11803 $ on $Date: 2010-06-25 10:02:12 -0700 (Fri, 25 Jun 2010) $ */ + +#ifndef __CL_PLATFORM_H +#define __CL_PLATFORM_H + +#ifdef __APPLE__ + /* Contains #defines for AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER below */ + #include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32) + #define CL_API_ENTRY + #define CL_API_CALL __stdcall + #define CL_CALLBACK __stdcall +#else + #define CL_API_ENTRY + #define CL_API_CALL + #define CL_CALLBACK +#endif + +/* + * Deprecation flags refer to the last version of the header in which the + * feature was not deprecated. + * + * E.g. VERSION_1_1_DEPRECATED means the feature is present in 1.1 without + * deprecation but is deprecated in versions later than 1.1. + */ + +#ifdef __APPLE__ + #define CL_EXTENSION_WEAK_LINK __attribute__((weak_import)) + #define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER + #define CL_EXT_SUFFIX__VERSION_1_0 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER + #define CL_API_SUFFIX__VERSION_1_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER + #define GCL_API_SUFFIX__VERSION_1_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER + #define CL_EXT_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER + #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 + + #ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER + #define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER + #define GCL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER + #define CL_EXT_SUFFIX__VERSION_1_2 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER + #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED + #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 + #else + #warning This path should never happen outside of internal operating system development. AvailabilityMacros do not function correctly here! + #define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER + #define GCL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER + #define CL_EXT_SUFFIX__VERSION_1_2 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER + #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER + #endif +#else + #define CL_EXTENSION_WEAK_LINK + #define CL_API_SUFFIX__VERSION_1_0 + #define CL_EXT_SUFFIX__VERSION_1_0 + #define CL_API_SUFFIX__VERSION_1_1 + #define CL_EXT_SUFFIX__VERSION_1_1 + #define CL_API_SUFFIX__VERSION_1_2 + #define CL_EXT_SUFFIX__VERSION_1_2 + #define CL_API_SUFFIX__VERSION_2_0 + #define CL_EXT_SUFFIX__VERSION_2_0 + #define CL_API_SUFFIX__VERSION_2_1 + #define CL_EXT_SUFFIX__VERSION_2_1 + + #ifdef __GNUC__ + #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS + #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED + #else + #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED __attribute__((deprecated)) + #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED + #endif + + #ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS + #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED + #else + #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED __attribute__((deprecated)) + #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED + #endif + + #ifdef CL_USE_DEPRECATED_OPENCL_1_2_APIS + #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED + #else + #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED __attribute__((deprecated)) + #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED + #endif + + #ifdef CL_USE_DEPRECATED_OPENCL_2_0_APIS + #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED + #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED + #else + #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED __attribute__((deprecated)) + #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED + #endif + #elif _WIN32 + #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS + #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED + #else + #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED __declspec(deprecated) + #endif + + #ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS + #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED + #else + #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED __declspec(deprecated) + #endif + + #ifdef CL_USE_DEPRECATED_OPENCL_1_2_APIS + #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED + #else + #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED __declspec(deprecated) + #endif + + #ifdef CL_USE_DEPRECATED_OPENCL_2_0_APIS + #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED + #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED + #else + #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED + #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED __declspec(deprecated) + #endif + #else + #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED + + #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED + + #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED + + #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED + #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED + #endif +#endif + +#if (defined (_WIN32) && defined(_MSC_VER)) + +/* scalar types */ +typedef signed __int8 cl_char; +typedef unsigned __int8 cl_uchar; +typedef signed __int16 cl_short; +typedef unsigned __int16 cl_ushort; +typedef signed __int32 cl_int; +typedef unsigned __int32 cl_uint; +typedef signed __int64 cl_long; +typedef unsigned __int64 cl_ulong; + +typedef unsigned __int16 cl_half; +typedef float cl_float; +typedef double cl_double; + +/* Macro names and corresponding values defined by OpenCL */ +#define CL_CHAR_BIT 8 +#define CL_SCHAR_MAX 127 +#define CL_SCHAR_MIN (-127-1) +#define CL_CHAR_MAX CL_SCHAR_MAX +#define CL_CHAR_MIN CL_SCHAR_MIN +#define CL_UCHAR_MAX 255 +#define CL_SHRT_MAX 32767 +#define CL_SHRT_MIN (-32767-1) +#define CL_USHRT_MAX 65535 +#define CL_INT_MAX 2147483647 +#define CL_INT_MIN (-2147483647-1) +#define CL_UINT_MAX 0xffffffffU +#define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL) +#define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL) +#define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL) + +#define CL_FLT_DIG 6 +#define CL_FLT_MANT_DIG 24 +#define CL_FLT_MAX_10_EXP +38 +#define CL_FLT_MAX_EXP +128 +#define CL_FLT_MIN_10_EXP -37 +#define CL_FLT_MIN_EXP -125 +#define CL_FLT_RADIX 2 +#define CL_FLT_MAX 340282346638528859811704183484516925440.0f +#define CL_FLT_MIN 1.175494350822287507969e-38f +#define CL_FLT_EPSILON 0x1.0p-23f + +#define CL_DBL_DIG 15 +#define CL_DBL_MANT_DIG 53 +#define CL_DBL_MAX_10_EXP +308 +#define CL_DBL_MAX_EXP +1024 +#define CL_DBL_MIN_10_EXP -307 +#define CL_DBL_MIN_EXP -1021 +#define CL_DBL_RADIX 2 +#define CL_DBL_MAX 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0 +#define CL_DBL_MIN 2.225073858507201383090e-308 +#define CL_DBL_EPSILON 2.220446049250313080847e-16 + +#define CL_M_E 2.718281828459045090796 +#define CL_M_LOG2E 1.442695040888963387005 +#define CL_M_LOG10E 0.434294481903251816668 +#define CL_M_LN2 0.693147180559945286227 +#define CL_M_LN10 2.302585092994045901094 +#define CL_M_PI 3.141592653589793115998 +#define CL_M_PI_2 1.570796326794896557999 +#define CL_M_PI_4 0.785398163397448278999 +#define CL_M_1_PI 0.318309886183790691216 +#define CL_M_2_PI 0.636619772367581382433 +#define CL_M_2_SQRTPI 1.128379167095512558561 +#define CL_M_SQRT2 1.414213562373095145475 +#define CL_M_SQRT1_2 0.707106781186547572737 + +#define CL_M_E_F 2.71828174591064f +#define CL_M_LOG2E_F 1.44269502162933f +#define CL_M_LOG10E_F 0.43429449200630f +#define CL_M_LN2_F 0.69314718246460f +#define CL_M_LN10_F 2.30258512496948f +#define CL_M_PI_F 3.14159274101257f +#define CL_M_PI_2_F 1.57079637050629f +#define CL_M_PI_4_F 0.78539818525314f +#define CL_M_1_PI_F 0.31830987334251f +#define CL_M_2_PI_F 0.63661974668503f +#define CL_M_2_SQRTPI_F 1.12837922573090f +#define CL_M_SQRT2_F 1.41421353816986f +#define CL_M_SQRT1_2_F 0.70710676908493f + +#define CL_NAN (CL_INFINITY - CL_INFINITY) +#define CL_HUGE_VALF ((cl_float) 1e50) +#define CL_HUGE_VAL ((cl_double) 1e500) +#define CL_MAXFLOAT CL_FLT_MAX +#define CL_INFINITY CL_HUGE_VALF + +#else + +#include + +/* scalar types */ +typedef int8_t cl_char; +typedef uint8_t cl_uchar; +typedef int16_t cl_short __attribute__((aligned(2))); +typedef uint16_t cl_ushort __attribute__((aligned(2))); +typedef int32_t cl_int __attribute__((aligned(4))); +typedef uint32_t cl_uint __attribute__((aligned(4))); +typedef int64_t cl_long __attribute__((aligned(8))); +typedef uint64_t cl_ulong __attribute__((aligned(8))); + +typedef uint16_t cl_half __attribute__((aligned(2))); +typedef float cl_float __attribute__((aligned(4))); +typedef double cl_double __attribute__((aligned(8))); + +/* Macro names and corresponding values defined by OpenCL */ +#define CL_CHAR_BIT 8 +#define CL_SCHAR_MAX 127 +#define CL_SCHAR_MIN (-127-1) +#define CL_CHAR_MAX CL_SCHAR_MAX +#define CL_CHAR_MIN CL_SCHAR_MIN +#define CL_UCHAR_MAX 255 +#define CL_SHRT_MAX 32767 +#define CL_SHRT_MIN (-32767-1) +#define CL_USHRT_MAX 65535 +#define CL_INT_MAX 2147483647 +#define CL_INT_MIN (-2147483647-1) +#define CL_UINT_MAX 0xffffffffU +#define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL) +#define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL) +#define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL) + +#define CL_FLT_DIG 6 +#define CL_FLT_MANT_DIG 24 +#define CL_FLT_MAX_10_EXP +38 +#define CL_FLT_MAX_EXP +128 +#define CL_FLT_MIN_10_EXP -37 +#define CL_FLT_MIN_EXP -125 +#define CL_FLT_RADIX 2 +#define CL_FLT_MAX 0x1.fffffep127f +#define CL_FLT_MIN 0x1.0p-126f +#define CL_FLT_EPSILON 0x1.0p-23f + +#define CL_DBL_DIG 15 +#define CL_DBL_MANT_DIG 53 +#define CL_DBL_MAX_10_EXP +308 +#define CL_DBL_MAX_EXP +1024 +#define CL_DBL_MIN_10_EXP -307 +#define CL_DBL_MIN_EXP -1021 +#define CL_DBL_RADIX 2 +#define CL_DBL_MAX 0x1.fffffffffffffp1023 +#define CL_DBL_MIN 0x1.0p-1022 +#define CL_DBL_EPSILON 0x1.0p-52 + +#define CL_M_E 2.718281828459045090796 +#define CL_M_LOG2E 1.442695040888963387005 +#define CL_M_LOG10E 0.434294481903251816668 +#define CL_M_LN2 0.693147180559945286227 +#define CL_M_LN10 2.302585092994045901094 +#define CL_M_PI 3.141592653589793115998 +#define CL_M_PI_2 1.570796326794896557999 +#define CL_M_PI_4 0.785398163397448278999 +#define CL_M_1_PI 0.318309886183790691216 +#define CL_M_2_PI 0.636619772367581382433 +#define CL_M_2_SQRTPI 1.128379167095512558561 +#define CL_M_SQRT2 1.414213562373095145475 +#define CL_M_SQRT1_2 0.707106781186547572737 + +#define CL_M_E_F 2.71828174591064f +#define CL_M_LOG2E_F 1.44269502162933f +#define CL_M_LOG10E_F 0.43429449200630f +#define CL_M_LN2_F 0.69314718246460f +#define CL_M_LN10_F 2.30258512496948f +#define CL_M_PI_F 3.14159274101257f +#define CL_M_PI_2_F 1.57079637050629f +#define CL_M_PI_4_F 0.78539818525314f +#define CL_M_1_PI_F 0.31830987334251f +#define CL_M_2_PI_F 0.63661974668503f +#define CL_M_2_SQRTPI_F 1.12837922573090f +#define CL_M_SQRT2_F 1.41421353816986f +#define CL_M_SQRT1_2_F 0.70710676908493f + +#if defined( __GNUC__ ) + #define CL_HUGE_VALF __builtin_huge_valf() + #define CL_HUGE_VAL __builtin_huge_val() + #define CL_NAN __builtin_nanf( "" ) +#else + #define CL_HUGE_VALF ((cl_float) 1e50) + #define CL_HUGE_VAL ((cl_double) 1e500) + float nanf( const char * ); + #define CL_NAN nanf( "" ) +#endif +#define CL_MAXFLOAT CL_FLT_MAX +#define CL_INFINITY CL_HUGE_VALF + +#endif + +#include + +/* Mirror types to GL types. Mirror types allow us to avoid deciding which 87s to load based on whether we are using GL or GLES here. */ +typedef unsigned int cl_GLuint; +typedef int cl_GLint; +typedef unsigned int cl_GLenum; + +/* + * Vector types + * + * Note: OpenCL requires that all types be naturally aligned. + * This means that vector types must be naturally aligned. + * For example, a vector of four floats must be aligned to + * a 16 byte boundary (calculated as 4 * the natural 4-byte + * alignment of the float). The alignment qualifiers here + * will only function properly if your compiler supports them + * and if you don't actively work to defeat them. For example, + * in order for a cl_float4 to be 16 byte aligned in a struct, + * the start of the struct must itself be 16-byte aligned. + * + * Maintaining proper alignment is the user's responsibility. + */ + +/* Define basic vector types */ +#if defined( __VEC__ ) + #include /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */ + typedef vector unsigned char __cl_uchar16; + typedef vector signed char __cl_char16; + typedef vector unsigned short __cl_ushort8; + typedef vector signed short __cl_short8; + typedef vector unsigned int __cl_uint4; + typedef vector signed int __cl_int4; + typedef vector float __cl_float4; + #define __CL_UCHAR16__ 1 + #define __CL_CHAR16__ 1 + #define __CL_USHORT8__ 1 + #define __CL_SHORT8__ 1 + #define __CL_UINT4__ 1 + #define __CL_INT4__ 1 + #define __CL_FLOAT4__ 1 +#endif + +#if defined( __SSE__ ) + #if defined( __MINGW64__ ) + #include + #else + #include + #endif + #if defined( __GNUC__ ) + typedef float __cl_float4 __attribute__((vector_size(16))); + #else + typedef __m128 __cl_float4; + #endif + #define __CL_FLOAT4__ 1 +#endif + +#if defined( __SSE2__ ) + #if defined( __MINGW64__ ) + #include + #else + #include + #endif + #if defined( __GNUC__ ) + typedef cl_uchar __cl_uchar16 __attribute__((vector_size(16))); + typedef cl_char __cl_char16 __attribute__((vector_size(16))); + typedef cl_ushort __cl_ushort8 __attribute__((vector_size(16))); + typedef cl_short __cl_short8 __attribute__((vector_size(16))); + typedef cl_uint __cl_uint4 __attribute__((vector_size(16))); + typedef cl_int __cl_int4 __attribute__((vector_size(16))); + typedef cl_ulong __cl_ulong2 __attribute__((vector_size(16))); + typedef cl_long __cl_long2 __attribute__((vector_size(16))); + typedef cl_double __cl_double2 __attribute__((vector_size(16))); + #else + typedef __m128i __cl_uchar16; + typedef __m128i __cl_char16; + typedef __m128i __cl_ushort8; + typedef __m128i __cl_short8; + typedef __m128i __cl_uint4; + typedef __m128i __cl_int4; + typedef __m128i __cl_ulong2; + typedef __m128i __cl_long2; + typedef __m128d __cl_double2; + #endif + #define __CL_UCHAR16__ 1 + #define __CL_CHAR16__ 1 + #define __CL_USHORT8__ 1 + #define __CL_SHORT8__ 1 + #define __CL_INT4__ 1 + #define __CL_UINT4__ 1 + #define __CL_ULONG2__ 1 + #define __CL_LONG2__ 1 + #define __CL_DOUBLE2__ 1 +#endif + +#if defined( __MMX__ ) + #include + #if defined( __GNUC__ ) + typedef cl_uchar __cl_uchar8 __attribute__((vector_size(8))); + typedef cl_char __cl_char8 __attribute__((vector_size(8))); + typedef cl_ushort __cl_ushort4 __attribute__((vector_size(8))); + typedef cl_short __cl_short4 __attribute__((vector_size(8))); + typedef cl_uint __cl_uint2 __attribute__((vector_size(8))); + typedef cl_int __cl_int2 __attribute__((vector_size(8))); + typedef cl_ulong __cl_ulong1 __attribute__((vector_size(8))); + typedef cl_long __cl_long1 __attribute__((vector_size(8))); + typedef cl_float __cl_float2 __attribute__((vector_size(8))); + #else + typedef __m64 __cl_uchar8; + typedef __m64 __cl_char8; + typedef __m64 __cl_ushort4; + typedef __m64 __cl_short4; + typedef __m64 __cl_uint2; + typedef __m64 __cl_int2; + typedef __m64 __cl_ulong1; + typedef __m64 __cl_long1; + typedef __m64 __cl_float2; + #endif + #define __CL_UCHAR8__ 1 + #define __CL_CHAR8__ 1 + #define __CL_USHORT4__ 1 + #define __CL_SHORT4__ 1 + #define __CL_INT2__ 1 + #define __CL_UINT2__ 1 + #define __CL_ULONG1__ 1 + #define __CL_LONG1__ 1 + #define __CL_FLOAT2__ 1 +#endif + +#if defined( __AVX__ ) + #if defined( __MINGW64__ ) + #include + #else + #include + #endif + #if defined( __GNUC__ ) + typedef cl_float __cl_float8 __attribute__((vector_size(32))); + typedef cl_double __cl_double4 __attribute__((vector_size(32))); + #else + typedef __m256 __cl_float8; + typedef __m256d __cl_double4; + #endif + #define __CL_FLOAT8__ 1 + #define __CL_DOUBLE4__ 1 +#endif + +/* Define capabilities for anonymous struct members. */ +#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) +#define __CL_HAS_ANON_STRUCT__ 1 +#define __CL_ANON_STRUCT__ __extension__ +#elif defined( _WIN32) && (_MSC_VER >= 1500) + /* Microsoft Developer Studio 2008 supports anonymous structs, but + * complains by default. */ +#define __CL_HAS_ANON_STRUCT__ 1 +#define __CL_ANON_STRUCT__ + /* Disable warning C4201: nonstandard extension used : nameless + * struct/union */ +#pragma warning( push ) +#pragma warning( disable : 4201 ) +#else +#define __CL_HAS_ANON_STRUCT__ 0 +#define __CL_ANON_STRUCT__ +#endif + +/* Define alignment keys */ +#if defined( __GNUC__ ) + #define CL_ALIGNED(_x) __attribute__ ((aligned(_x))) +#elif defined( _WIN32) && (_MSC_VER) + /* Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements */ + /* http://msdn.microsoft.com/en-us/library/373ak2y1%28VS.71%29.aspx */ + /* #include */ + /* #define CL_ALIGNED(_x) _CRT_ALIGN(_x) */ + #define CL_ALIGNED(_x) +#else + #warning Need to implement some method to align data here + #define CL_ALIGNED(_x) +#endif + +/* Indicate whether .xyzw, .s0123 and .hi.lo are supported */ +#if __CL_HAS_ANON_STRUCT__ + /* .xyzw and .s0123...{f|F} are supported */ + #define CL_HAS_NAMED_VECTOR_FIELDS 1 + /* .hi and .lo are supported */ + #define CL_HAS_HI_LO_VECTOR_FIELDS 1 +#endif + +/* Define cl_vector types */ + +/* ---- cl_charn ---- */ +typedef union +{ + cl_char CL_ALIGNED(2) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_char x, y; }; + __CL_ANON_STRUCT__ struct{ cl_char s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_char lo, hi; }; +#endif +#if defined( __CL_CHAR2__) + __cl_char2 v2; +#endif +}cl_char2; + +typedef union +{ + cl_char CL_ALIGNED(4) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_char x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_char2 lo, hi; }; +#endif +#if defined( __CL_CHAR2__) + __cl_char2 v2[2]; +#endif +#if defined( __CL_CHAR4__) + __cl_char4 v4; +#endif +}cl_char4; + +/* cl_char3 is identical in size, alignment and behavior to cl_char4. See section 6.1.5. */ +typedef cl_char4 cl_char3; + +typedef union +{ + cl_char CL_ALIGNED(8) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_char x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_char4 lo, hi; }; +#endif +#if defined( __CL_CHAR2__) + __cl_char2 v2[4]; +#endif +#if defined( __CL_CHAR4__) + __cl_char4 v4[2]; +#endif +#if defined( __CL_CHAR8__ ) + __cl_char8 v8; +#endif +}cl_char8; + +typedef union +{ + cl_char CL_ALIGNED(16) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_char x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_char8 lo, hi; }; +#endif +#if defined( __CL_CHAR2__) + __cl_char2 v2[8]; +#endif +#if defined( __CL_CHAR4__) + __cl_char4 v4[4]; +#endif +#if defined( __CL_CHAR8__ ) + __cl_char8 v8[2]; +#endif +#if defined( __CL_CHAR16__ ) + __cl_char16 v16; +#endif +}cl_char16; + + +/* ---- cl_ucharn ---- */ +typedef union +{ + cl_uchar CL_ALIGNED(2) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uchar x, y; }; + __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_uchar lo, hi; }; +#endif +#if defined( __cl_uchar2__) + __cl_uchar2 v2; +#endif +}cl_uchar2; + +typedef union +{ + cl_uchar CL_ALIGNED(4) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_uchar2 lo, hi; }; +#endif +#if defined( __CL_UCHAR2__) + __cl_uchar2 v2[2]; +#endif +#if defined( __CL_UCHAR4__) + __cl_uchar4 v4; +#endif +}cl_uchar4; + +/* cl_uchar3 is identical in size, alignment and behavior to cl_uchar4. See section 6.1.5. */ +typedef cl_uchar4 cl_uchar3; + +typedef union +{ + cl_uchar CL_ALIGNED(8) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_uchar4 lo, hi; }; +#endif +#if defined( __CL_UCHAR2__) + __cl_uchar2 v2[4]; +#endif +#if defined( __CL_UCHAR4__) + __cl_uchar4 v4[2]; +#endif +#if defined( __CL_UCHAR8__ ) + __cl_uchar8 v8; +#endif +}cl_uchar8; + +typedef union +{ + cl_uchar CL_ALIGNED(16) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_uchar8 lo, hi; }; +#endif +#if defined( __CL_UCHAR2__) + __cl_uchar2 v2[8]; +#endif +#if defined( __CL_UCHAR4__) + __cl_uchar4 v4[4]; +#endif +#if defined( __CL_UCHAR8__ ) + __cl_uchar8 v8[2]; +#endif +#if defined( __CL_UCHAR16__ ) + __cl_uchar16 v16; +#endif +}cl_uchar16; + + +/* ---- cl_shortn ---- */ +typedef union +{ + cl_short CL_ALIGNED(4) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_short x, y; }; + __CL_ANON_STRUCT__ struct{ cl_short s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_short lo, hi; }; +#endif +#if defined( __CL_SHORT2__) + __cl_short2 v2; +#endif +}cl_short2; + +typedef union +{ + cl_short CL_ALIGNED(8) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_short x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_short2 lo, hi; }; +#endif +#if defined( __CL_SHORT2__) + __cl_short2 v2[2]; +#endif +#if defined( __CL_SHORT4__) + __cl_short4 v4; +#endif +}cl_short4; + +/* cl_short3 is identical in size, alignment and behavior to cl_short4. See section 6.1.5. */ +typedef cl_short4 cl_short3; + +typedef union +{ + cl_short CL_ALIGNED(16) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_short x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_short4 lo, hi; }; +#endif +#if defined( __CL_SHORT2__) + __cl_short2 v2[4]; +#endif +#if defined( __CL_SHORT4__) + __cl_short4 v4[2]; +#endif +#if defined( __CL_SHORT8__ ) + __cl_short8 v8; +#endif +}cl_short8; + +typedef union +{ + cl_short CL_ALIGNED(32) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_short x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_short8 lo, hi; }; +#endif +#if defined( __CL_SHORT2__) + __cl_short2 v2[8]; +#endif +#if defined( __CL_SHORT4__) + __cl_short4 v4[4]; +#endif +#if defined( __CL_SHORT8__ ) + __cl_short8 v8[2]; +#endif +#if defined( __CL_SHORT16__ ) + __cl_short16 v16; +#endif +}cl_short16; + + +/* ---- cl_ushortn ---- */ +typedef union +{ + cl_ushort CL_ALIGNED(4) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ushort x, y; }; + __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_ushort lo, hi; }; +#endif +#if defined( __CL_USHORT2__) + __cl_ushort2 v2; +#endif +}cl_ushort2; + +typedef union +{ + cl_ushort CL_ALIGNED(8) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_ushort2 lo, hi; }; +#endif +#if defined( __CL_USHORT2__) + __cl_ushort2 v2[2]; +#endif +#if defined( __CL_USHORT4__) + __cl_ushort4 v4; +#endif +}cl_ushort4; + +/* cl_ushort3 is identical in size, alignment and behavior to cl_ushort4. See section 6.1.5. */ +typedef cl_ushort4 cl_ushort3; + +typedef union +{ + cl_ushort CL_ALIGNED(16) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_ushort4 lo, hi; }; +#endif +#if defined( __CL_USHORT2__) + __cl_ushort2 v2[4]; +#endif +#if defined( __CL_USHORT4__) + __cl_ushort4 v4[2]; +#endif +#if defined( __CL_USHORT8__ ) + __cl_ushort8 v8; +#endif +}cl_ushort8; + +typedef union +{ + cl_ushort CL_ALIGNED(32) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_ushort8 lo, hi; }; +#endif +#if defined( __CL_USHORT2__) + __cl_ushort2 v2[8]; +#endif +#if defined( __CL_USHORT4__) + __cl_ushort4 v4[4]; +#endif +#if defined( __CL_USHORT8__ ) + __cl_ushort8 v8[2]; +#endif +#if defined( __CL_USHORT16__ ) + __cl_ushort16 v16; +#endif +}cl_ushort16; + +/* ---- cl_intn ---- */ +typedef union +{ + cl_int CL_ALIGNED(8) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_int x, y; }; + __CL_ANON_STRUCT__ struct{ cl_int s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_int lo, hi; }; +#endif +#if defined( __CL_INT2__) + __cl_int2 v2; +#endif +}cl_int2; + +typedef union +{ + cl_int CL_ALIGNED(16) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_int x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_int2 lo, hi; }; +#endif +#if defined( __CL_INT2__) + __cl_int2 v2[2]; +#endif +#if defined( __CL_INT4__) + __cl_int4 v4; +#endif +}cl_int4; + +/* cl_int3 is identical in size, alignment and behavior to cl_int4. See section 6.1.5. */ +typedef cl_int4 cl_int3; + +typedef union +{ + cl_int CL_ALIGNED(32) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_int x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_int4 lo, hi; }; +#endif +#if defined( __CL_INT2__) + __cl_int2 v2[4]; +#endif +#if defined( __CL_INT4__) + __cl_int4 v4[2]; +#endif +#if defined( __CL_INT8__ ) + __cl_int8 v8; +#endif +}cl_int8; + +typedef union +{ + cl_int CL_ALIGNED(64) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_int x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_int8 lo, hi; }; +#endif +#if defined( __CL_INT2__) + __cl_int2 v2[8]; +#endif +#if defined( __CL_INT4__) + __cl_int4 v4[4]; +#endif +#if defined( __CL_INT8__ ) + __cl_int8 v8[2]; +#endif +#if defined( __CL_INT16__ ) + __cl_int16 v16; +#endif +}cl_int16; + + +/* ---- cl_uintn ---- */ +typedef union +{ + cl_uint CL_ALIGNED(8) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uint x, y; }; + __CL_ANON_STRUCT__ struct{ cl_uint s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_uint lo, hi; }; +#endif +#if defined( __CL_UINT2__) + __cl_uint2 v2; +#endif +}cl_uint2; + +typedef union +{ + cl_uint CL_ALIGNED(16) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_uint2 lo, hi; }; +#endif +#if defined( __CL_UINT2__) + __cl_uint2 v2[2]; +#endif +#if defined( __CL_UINT4__) + __cl_uint4 v4; +#endif +}cl_uint4; + +/* cl_uint3 is identical in size, alignment and behavior to cl_uint4. See section 6.1.5. */ +typedef cl_uint4 cl_uint3; + +typedef union +{ + cl_uint CL_ALIGNED(32) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_uint4 lo, hi; }; +#endif +#if defined( __CL_UINT2__) + __cl_uint2 v2[4]; +#endif +#if defined( __CL_UINT4__) + __cl_uint4 v4[2]; +#endif +#if defined( __CL_UINT8__ ) + __cl_uint8 v8; +#endif +}cl_uint8; + +typedef union +{ + cl_uint CL_ALIGNED(64) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_uint8 lo, hi; }; +#endif +#if defined( __CL_UINT2__) + __cl_uint2 v2[8]; +#endif +#if defined( __CL_UINT4__) + __cl_uint4 v4[4]; +#endif +#if defined( __CL_UINT8__ ) + __cl_uint8 v8[2]; +#endif +#if defined( __CL_UINT16__ ) + __cl_uint16 v16; +#endif +}cl_uint16; + +/* ---- cl_longn ---- */ +typedef union +{ + cl_long CL_ALIGNED(16) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_long x, y; }; + __CL_ANON_STRUCT__ struct{ cl_long s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_long lo, hi; }; +#endif +#if defined( __CL_LONG2__) + __cl_long2 v2; +#endif +}cl_long2; + +typedef union +{ + cl_long CL_ALIGNED(32) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_long x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_long2 lo, hi; }; +#endif +#if defined( __CL_LONG2__) + __cl_long2 v2[2]; +#endif +#if defined( __CL_LONG4__) + __cl_long4 v4; +#endif +}cl_long4; + +/* cl_long3 is identical in size, alignment and behavior to cl_long4. See section 6.1.5. */ +typedef cl_long4 cl_long3; + +typedef union +{ + cl_long CL_ALIGNED(64) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_long x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_long4 lo, hi; }; +#endif +#if defined( __CL_LONG2__) + __cl_long2 v2[4]; +#endif +#if defined( __CL_LONG4__) + __cl_long4 v4[2]; +#endif +#if defined( __CL_LONG8__ ) + __cl_long8 v8; +#endif +}cl_long8; + +typedef union +{ + cl_long CL_ALIGNED(128) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_long x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_long8 lo, hi; }; +#endif +#if defined( __CL_LONG2__) + __cl_long2 v2[8]; +#endif +#if defined( __CL_LONG4__) + __cl_long4 v4[4]; +#endif +#if defined( __CL_LONG8__ ) + __cl_long8 v8[2]; +#endif +#if defined( __CL_LONG16__ ) + __cl_long16 v16; +#endif +}cl_long16; + + +/* ---- cl_ulongn ---- */ +typedef union +{ + cl_ulong CL_ALIGNED(16) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ulong x, y; }; + __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_ulong lo, hi; }; +#endif +#if defined( __CL_ULONG2__) + __cl_ulong2 v2; +#endif +}cl_ulong2; + +typedef union +{ + cl_ulong CL_ALIGNED(32) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_ulong2 lo, hi; }; +#endif +#if defined( __CL_ULONG2__) + __cl_ulong2 v2[2]; +#endif +#if defined( __CL_ULONG4__) + __cl_ulong4 v4; +#endif +}cl_ulong4; + +/* cl_ulong3 is identical in size, alignment and behavior to cl_ulong4. See section 6.1.5. */ +typedef cl_ulong4 cl_ulong3; + +typedef union +{ + cl_ulong CL_ALIGNED(64) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_ulong4 lo, hi; }; +#endif +#if defined( __CL_ULONG2__) + __cl_ulong2 v2[4]; +#endif +#if defined( __CL_ULONG4__) + __cl_ulong4 v4[2]; +#endif +#if defined( __CL_ULONG8__ ) + __cl_ulong8 v8; +#endif +}cl_ulong8; + +typedef union +{ + cl_ulong CL_ALIGNED(128) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_ulong8 lo, hi; }; +#endif +#if defined( __CL_ULONG2__) + __cl_ulong2 v2[8]; +#endif +#if defined( __CL_ULONG4__) + __cl_ulong4 v4[4]; +#endif +#if defined( __CL_ULONG8__ ) + __cl_ulong8 v8[2]; +#endif +#if defined( __CL_ULONG16__ ) + __cl_ulong16 v16; +#endif +}cl_ulong16; + + +/* --- cl_floatn ---- */ + +typedef union +{ + cl_float CL_ALIGNED(8) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_float x, y; }; + __CL_ANON_STRUCT__ struct{ cl_float s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_float lo, hi; }; +#endif +#if defined( __CL_FLOAT2__) + __cl_float2 v2; +#endif +}cl_float2; + +typedef union +{ + cl_float CL_ALIGNED(16) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_float x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_float2 lo, hi; }; +#endif +#if defined( __CL_FLOAT2__) + __cl_float2 v2[2]; +#endif +#if defined( __CL_FLOAT4__) + __cl_float4 v4; +#endif +}cl_float4; + +/* cl_float3 is identical in size, alignment and behavior to cl_float4. See section 6.1.5. */ +typedef cl_float4 cl_float3; + +typedef union +{ + cl_float CL_ALIGNED(32) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_float x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_float4 lo, hi; }; +#endif +#if defined( __CL_FLOAT2__) + __cl_float2 v2[4]; +#endif +#if defined( __CL_FLOAT4__) + __cl_float4 v4[2]; +#endif +#if defined( __CL_FLOAT8__ ) + __cl_float8 v8; +#endif +}cl_float8; + +typedef union +{ + cl_float CL_ALIGNED(64) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_float x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_float8 lo, hi; }; +#endif +#if defined( __CL_FLOAT2__) + __cl_float2 v2[8]; +#endif +#if defined( __CL_FLOAT4__) + __cl_float4 v4[4]; +#endif +#if defined( __CL_FLOAT8__ ) + __cl_float8 v8[2]; +#endif +#if defined( __CL_FLOAT16__ ) + __cl_float16 v16; +#endif +}cl_float16; + +/* --- cl_doublen ---- */ + +typedef union +{ + cl_double CL_ALIGNED(16) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_double x, y; }; + __CL_ANON_STRUCT__ struct{ cl_double s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_double lo, hi; }; +#endif +#if defined( __CL_DOUBLE2__) + __cl_double2 v2; +#endif +}cl_double2; + +typedef union +{ + cl_double CL_ALIGNED(32) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_double x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_double2 lo, hi; }; +#endif +#if defined( __CL_DOUBLE2__) + __cl_double2 v2[2]; +#endif +#if defined( __CL_DOUBLE4__) + __cl_double4 v4; +#endif +}cl_double4; + +/* cl_double3 is identical in size, alignment and behavior to cl_double4. See section 6.1.5. */ +typedef cl_double4 cl_double3; + +typedef union +{ + cl_double CL_ALIGNED(64) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_double x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_double4 lo, hi; }; +#endif +#if defined( __CL_DOUBLE2__) + __cl_double2 v2[4]; +#endif +#if defined( __CL_DOUBLE4__) + __cl_double4 v4[2]; +#endif +#if defined( __CL_DOUBLE8__ ) + __cl_double8 v8; +#endif +}cl_double8; + +typedef union +{ + cl_double CL_ALIGNED(128) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_double x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_double8 lo, hi; }; +#endif +#if defined( __CL_DOUBLE2__) + __cl_double2 v2[8]; +#endif +#if defined( __CL_DOUBLE4__) + __cl_double4 v4[4]; +#endif +#if defined( __CL_DOUBLE8__ ) + __cl_double8 v8[2]; +#endif +#if defined( __CL_DOUBLE16__ ) + __cl_double16 v16; +#endif +}cl_double16; + +/* Macro to facilitate debugging + * Usage: + * Place CL_PROGRAM_STRING_DEBUG_INFO on the line before the first line of your source. + * The first line ends with: CL_PROGRAM_STRING_DEBUG_INFO \" + * Each line thereafter of OpenCL C source must end with: \n\ + * The last line ends in "; + * + * Example: + * + * const char *my_program = CL_PROGRAM_STRING_DEBUG_INFO "\ + * kernel void foo( int a, float * b ) \n\ + * { \n\ + * // my comment \n\ + * *b[ get_global_id(0)] = a; \n\ + * } \n\ + * "; + * + * This should correctly set up the line, (column) and file information for your source + * string so you can do source level debugging. + */ +#define __CL_STRINGIFY( _x ) # _x +#define _CL_STRINGIFY( _x ) __CL_STRINGIFY( _x ) +#define CL_PROGRAM_STRING_DEBUG_INFO "#line " _CL_STRINGIFY(__LINE__) " \"" __FILE__ "\" \n\n" + +#ifdef __cplusplus +} +#endif + +#undef __CL_HAS_ANON_STRUCT__ +#undef __CL_ANON_STRUCT__ +#if defined( _WIN32) && (_MSC_VER >= 1500) +#pragma warning( pop ) +#endif + +#endif /* __CL_PLATFORM_H */ diff --git a/third_party/opencl/include/CL/opencl.h b/third_party/opencl/include/CL/opencl.h new file mode 100644 index 000000000..9855cd75e --- /dev/null +++ b/third_party/opencl/include/CL/opencl.h @@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright (c) 2008-2015 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS + * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS + * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT + * https://www.khronos.org/registry/ + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + ******************************************************************************/ + +/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ + +#ifndef __OPENCL_H +#define __OPENCL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __APPLE__ + +#include +#include +#include +#include + +#else + +#include +#include +#include +#include + +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __OPENCL_H */ + diff --git a/third_party/openmax/include/OMX_Audio.h b/third_party/openmax/include/OMX_Audio.h new file mode 100644 index 000000000..0d455766c --- /dev/null +++ b/third_party/openmax/include/OMX_Audio.h @@ -0,0 +1,1312 @@ +/* + * Copyright (c) 2008 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/** @file OMX_Audio.h - OpenMax IL version 1.1.2 + * The structures needed by Audio components to exchange + * parameters and configuration data with the componenmilts. + */ + +#ifndef OMX_Audio_h +#define OMX_Audio_h + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +/* Each OMX header must include all required header files to allow the + * header to compile without errors. The includes below are required + * for this header file to compile successfully + */ + +#include + +/** @defgroup midi MIDI + * @ingroup audio + */ + +/** @defgroup effects Audio effects + * @ingroup audio + */ + +/** @defgroup audio OpenMAX IL Audio Domain + * Structures for OpenMAX IL Audio domain + * @{ + */ + +/** Enumeration used to define the possible audio codings. + * If "OMX_AUDIO_CodingUnused" is selected, the coding selection must + * be done in a vendor specific way. Since this is for an audio + * processing element this enum is relevant. However, for another + * type of component other enums would be in this area. + */ +typedef enum OMX_AUDIO_CODINGTYPE { + OMX_AUDIO_CodingUnused = 0, /**< Placeholder value when coding is N/A */ + OMX_AUDIO_CodingAutoDetect, /**< auto detection of audio format */ + OMX_AUDIO_CodingPCM, /**< Any variant of PCM coding */ + OMX_AUDIO_CodingADPCM, /**< Any variant of ADPCM encoded data */ + OMX_AUDIO_CodingAMR, /**< Any variant of AMR encoded data */ + OMX_AUDIO_CodingGSMFR, /**< Any variant of GSM fullrate (i.e. GSM610) */ + OMX_AUDIO_CodingGSMEFR, /**< Any variant of GSM Enhanced Fullrate encoded data*/ + OMX_AUDIO_CodingGSMHR, /**< Any variant of GSM Halfrate encoded data */ + OMX_AUDIO_CodingPDCFR, /**< Any variant of PDC Fullrate encoded data */ + OMX_AUDIO_CodingPDCEFR, /**< Any variant of PDC Enhanced Fullrate encoded data */ + OMX_AUDIO_CodingPDCHR, /**< Any variant of PDC Halfrate encoded data */ + OMX_AUDIO_CodingTDMAFR, /**< Any variant of TDMA Fullrate encoded data (TIA/EIA-136-420) */ + OMX_AUDIO_CodingTDMAEFR, /**< Any variant of TDMA Enhanced Fullrate encoded data (TIA/EIA-136-410) */ + OMX_AUDIO_CodingQCELP8, /**< Any variant of QCELP 8kbps encoded data */ + OMX_AUDIO_CodingQCELP13, /**< Any variant of QCELP 13kbps encoded data */ + OMX_AUDIO_CodingEVRC, /**< Any variant of EVRC encoded data */ + OMX_AUDIO_CodingSMV, /**< Any variant of SMV encoded data */ + OMX_AUDIO_CodingG711, /**< Any variant of G.711 encoded data */ + OMX_AUDIO_CodingG723, /**< Any variant of G.723 dot 1 encoded data */ + OMX_AUDIO_CodingG726, /**< Any variant of G.726 encoded data */ + OMX_AUDIO_CodingG729, /**< Any variant of G.729 encoded data */ + OMX_AUDIO_CodingAAC, /**< Any variant of AAC encoded data */ + OMX_AUDIO_CodingMP3, /**< Any variant of MP3 encoded data */ + OMX_AUDIO_CodingSBC, /**< Any variant of SBC encoded data */ + OMX_AUDIO_CodingVORBIS, /**< Any variant of VORBIS encoded data */ + OMX_AUDIO_CodingWMA, /**< Any variant of WMA encoded data */ + OMX_AUDIO_CodingRA, /**< Any variant of RA encoded data */ + OMX_AUDIO_CodingMIDI, /**< Any variant of MIDI encoded data */ + OMX_AUDIO_CodingAC3, /**< Any variant of AC3 encoded data */ + OMX_AUDIO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_CodingMax = 0x7FFFFFFF +} OMX_AUDIO_CODINGTYPE; + + +/** The PortDefinition structure is used to define all of the parameters + * necessary for the compliant component to setup an input or an output audio + * path. If additional information is needed to define the parameters of the + * port (such as frequency), additional structures must be sent such as the + * OMX_AUDIO_PARAM_PCMMODETYPE structure to supply the extra parameters for the port. + */ +typedef struct OMX_AUDIO_PORTDEFINITIONTYPE { + OMX_STRING cMIMEType; /**< MIME type of data for the port */ + OMX_NATIVE_DEVICETYPE pNativeRender; /** < platform specific reference + for an output device, + otherwise this field is 0 */ + OMX_BOOL bFlagErrorConcealment; /**< Turns on error concealment if it is + supported by the OMX component */ + OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this + port (e.g. PCM, AMR, MP3, etc) */ +} OMX_AUDIO_PORTDEFINITIONTYPE; + + +/** Port format parameter. This structure is used to enumerate + * the various data input/output format supported by the port. + */ +typedef struct OMX_AUDIO_PARAM_PORTFORMATTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< Indicates which port to set */ + OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */ + OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */ +} OMX_AUDIO_PARAM_PORTFORMATTYPE; + + +/** PCM mode type */ +typedef enum OMX_AUDIO_PCMMODETYPE { + OMX_AUDIO_PCMModeLinear = 0, /**< Linear PCM encoded data */ + OMX_AUDIO_PCMModeALaw, /**< A law PCM encoded data (G.711) */ + OMX_AUDIO_PCMModeMULaw, /**< Mu law PCM encoded data (G.711) */ + OMX_AUDIO_PCMModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_PCMModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_PCMModeMax = 0x7FFFFFFF +} OMX_AUDIO_PCMMODETYPE; + + +typedef enum OMX_AUDIO_CHANNELTYPE { + OMX_AUDIO_ChannelNone = 0x0, /**< Unused or empty */ + OMX_AUDIO_ChannelLF = 0x1, /**< Left front */ + OMX_AUDIO_ChannelRF = 0x2, /**< Right front */ + OMX_AUDIO_ChannelCF = 0x3, /**< Center front */ + OMX_AUDIO_ChannelLS = 0x4, /**< Left surround */ + OMX_AUDIO_ChannelRS = 0x5, /**< Right surround */ + OMX_AUDIO_ChannelLFE = 0x6, /**< Low frequency effects */ + OMX_AUDIO_ChannelCS = 0x7, /**< Back surround */ + OMX_AUDIO_ChannelLR = 0x8, /**< Left rear. */ + OMX_AUDIO_ChannelRR = 0x9, /**< Right rear. */ + OMX_AUDIO_ChannelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_ChannelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_ChannelMax = 0x7FFFFFFF +} OMX_AUDIO_CHANNELTYPE; + +#define OMX_AUDIO_MAXCHANNELS 16 /**< maximum number distinct audio channels that a buffer may contain */ +#define OMX_MIN_PCMPAYLOAD_MSEC 5 /**< Minimum audio buffer payload size for uncompressed (PCM) audio */ + +/** PCM format description */ +typedef struct OMX_AUDIO_PARAM_PCMMODETYPE { + OMX_U32 nSize; /**< Size of this structure, in Bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels (e.g. 2 for stereo) */ + OMX_NUMERICALDATATYPE eNumData; /**< indicates PCM data as signed or unsigned */ + OMX_ENDIANTYPE eEndian; /**< indicates PCM data as little or big endian */ + OMX_BOOL bInterleaved; /**< True for normal interleaved data; false for + non-interleaved data (e.g. block data) */ + OMX_U32 nBitPerSample; /**< Bit per sample */ + OMX_U32 nSamplingRate; /**< Sampling rate of the source data. Use 0 for + variable or unknown sampling rate. */ + OMX_AUDIO_PCMMODETYPE ePCMMode; /**< PCM mode enumeration */ + OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMap[i] */ + +} OMX_AUDIO_PARAM_PCMMODETYPE; + + +/** Audio channel mode. This is used by both AAC and MP3, although the names are more appropriate + * for the MP3. For example, JointStereo for MP3 is CouplingChannels for AAC. + */ +typedef enum OMX_AUDIO_CHANNELMODETYPE { + OMX_AUDIO_ChannelModeStereo = 0, /**< 2 channels, the bitrate allocation between those + two channels changes accordingly to each channel information */ + OMX_AUDIO_ChannelModeJointStereo, /**< mode that takes advantage of what is common between + 2 channels for higher compression gain */ + OMX_AUDIO_ChannelModeDual, /**< 2 mono-channels, each channel is encoded with half + the bitrate of the overall bitrate */ + OMX_AUDIO_ChannelModeMono, /**< Mono channel mode */ + OMX_AUDIO_ChannelModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_ChannelModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_ChannelModeMax = 0x7FFFFFFF +} OMX_AUDIO_CHANNELMODETYPE; + + +typedef enum OMX_AUDIO_MP3STREAMFORMATTYPE { + OMX_AUDIO_MP3StreamFormatMP1Layer3 = 0, /**< MP3 Audio MPEG 1 Layer 3 Stream format */ + OMX_AUDIO_MP3StreamFormatMP2Layer3, /**< MP3 Audio MPEG 2 Layer 3 Stream format */ + OMX_AUDIO_MP3StreamFormatMP2_5Layer3, /**< MP3 Audio MPEG2.5 Layer 3 Stream format */ + OMX_AUDIO_MP3StreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_MP3StreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_MP3StreamFormatMax = 0x7FFFFFFF +} OMX_AUDIO_MP3STREAMFORMATTYPE; + +/** MP3 params */ +typedef struct OMX_AUDIO_PARAM_MP3TYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels */ + OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable + rate or unknown bit rates */ + OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for + variable or unknown sampling rate. */ + OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should + limit the audio signal. Use 0 to let encoder decide */ + OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ + OMX_AUDIO_MP3STREAMFORMATTYPE eFormat; /**< MP3 stream format */ +} OMX_AUDIO_PARAM_MP3TYPE; + + +typedef enum OMX_AUDIO_AACSTREAMFORMATTYPE { + OMX_AUDIO_AACStreamFormatMP2ADTS = 0, /**< AAC Audio Data Transport Stream 2 format */ + OMX_AUDIO_AACStreamFormatMP4ADTS, /**< AAC Audio Data Transport Stream 4 format */ + OMX_AUDIO_AACStreamFormatMP4LOAS, /**< AAC Low Overhead Audio Stream format */ + OMX_AUDIO_AACStreamFormatMP4LATM, /**< AAC Low overhead Audio Transport Multiplex */ + OMX_AUDIO_AACStreamFormatADIF, /**< AAC Audio Data Interchange Format */ + OMX_AUDIO_AACStreamFormatMP4FF, /**< AAC inside MPEG-4/ISO File Format */ + OMX_AUDIO_AACStreamFormatRAW, /**< AAC Raw Format */ + OMX_AUDIO_AACStreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_AACStreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_AACStreamFormatMax = 0x7FFFFFFF +} OMX_AUDIO_AACSTREAMFORMATTYPE; + + +/** AAC mode type. Note that the term profile is used with the MPEG-2 + * standard and the term object type and profile is used with MPEG-4 */ +typedef enum OMX_AUDIO_AACPROFILETYPE{ + OMX_AUDIO_AACObjectNull = 0, /**< Null, not used */ + OMX_AUDIO_AACObjectMain = 1, /**< AAC Main object */ + OMX_AUDIO_AACObjectLC, /**< AAC Low Complexity object (AAC profile) */ + OMX_AUDIO_AACObjectSSR, /**< AAC Scalable Sample Rate object */ + OMX_AUDIO_AACObjectLTP, /**< AAC Long Term Prediction object */ + OMX_AUDIO_AACObjectHE, /**< AAC High Efficiency (object type SBR, HE-AAC profile) */ + OMX_AUDIO_AACObjectScalable, /**< AAC Scalable object */ + OMX_AUDIO_AACObjectERLC = 17, /**< ER AAC Low Complexity object (Error Resilient AAC-LC) */ + OMX_AUDIO_AACObjectLD = 23, /**< AAC Low Delay object (Error Resilient) */ + OMX_AUDIO_AACObjectHE_PS = 29, /**< AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS) */ + OMX_AUDIO_AACObjectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_AACObjectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_AACObjectMax = 0x7FFFFFFF +} OMX_AUDIO_AACPROFILETYPE; + + +/** AAC tool usage (for nAACtools in OMX_AUDIO_PARAM_AACPROFILETYPE). + * Required for encoder configuration and optional as decoder info output. + * For MP3, OMX_AUDIO_CHANNELMODETYPE is sufficient. */ +#define OMX_AUDIO_AACToolNone 0x00000000 /**< no AAC tools allowed (encoder config) or active (decoder info output) */ +#define OMX_AUDIO_AACToolMS 0x00000001 /**< MS: Mid/side joint coding tool allowed or active */ +#define OMX_AUDIO_AACToolIS 0x00000002 /**< IS: Intensity stereo tool allowed or active */ +#define OMX_AUDIO_AACToolTNS 0x00000004 /**< TNS: Temporal Noise Shaping tool allowed or active */ +#define OMX_AUDIO_AACToolPNS 0x00000008 /**< PNS: MPEG-4 Perceptual Noise substitution tool allowed or active */ +#define OMX_AUDIO_AACToolLTP 0x00000010 /**< LTP: MPEG-4 Long Term Prediction tool allowed or active */ +#define OMX_AUDIO_AACToolAll 0x7FFFFFFF /**< all AAC tools allowed or active (*/ + +/** MPEG-4 AAC error resilience (ER) tool usage (for nAACERtools in OMX_AUDIO_PARAM_AACPROFILETYPE). + * Required for ER encoder configuration and optional as decoder info output */ +#define OMX_AUDIO_AACERNone 0x00000000 /**< no AAC ER tools allowed/used */ +#define OMX_AUDIO_AACERVCB11 0x00000001 /**< VCB11: Virtual Code Books for AAC section data */ +#define OMX_AUDIO_AACERRVLC 0x00000002 /**< RVLC: Reversible Variable Length Coding */ +#define OMX_AUDIO_AACERHCR 0x00000004 /**< HCR: Huffman Codeword Reordering */ +#define OMX_AUDIO_AACERAll 0x7FFFFFFF /**< all AAC ER tools allowed/used */ + + +/** AAC params */ +typedef struct OMX_AUDIO_PARAM_AACPROFILETYPE { + OMX_U32 nSize; /**< Size of this structure, in Bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< Port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels */ + OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for + variable or unknown sampling rate. */ + OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable + rate or unknown bit rates */ + OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should + limit the audio signal. Use 0 to let encoder decide */ + OMX_U32 nFrameLength; /**< Frame length (in audio samples per channel) of the codec. + Can be 1024 or 960 (AAC-LC), 2048 (HE-AAC), 480 or 512 (AAC-LD). + Use 0 to let encoder decide */ + OMX_U32 nAACtools; /**< AAC tool usage */ + OMX_U32 nAACERtools; /**< MPEG-4 AAC error resilience tool usage */ + OMX_AUDIO_AACPROFILETYPE eAACProfile; /**< AAC profile enumeration */ + OMX_AUDIO_AACSTREAMFORMATTYPE eAACStreamFormat; /**< AAC stream format enumeration */ + OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ +} OMX_AUDIO_PARAM_AACPROFILETYPE; + + +/** VORBIS params */ +typedef struct OMX_AUDIO_PARAM_VORBISTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels */ + OMX_U32 nBitRate; /**< Bit rate of the encoded data data. Use 0 for variable + rate or unknown bit rates. Encoding is set to the + bitrate closest to specified value (in bps) */ + OMX_U32 nMinBitRate; /**< Sets minimum bitrate (in bps). */ + OMX_U32 nMaxBitRate; /**< Sets maximum bitrate (in bps). */ + + OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for + variable or unknown sampling rate. */ + OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should + limit the audio signal. Use 0 to let encoder decide */ + OMX_S32 nQuality; /**< Sets encoding quality to n, between -1 (low) and 10 (high). + In the default mode of operation, teh quality level is 3. + Normal quality range is 0 - 10. */ + OMX_BOOL bManaged; /**< Set bitrate management mode. This turns off the + normal VBR encoding, but allows hard or soft bitrate + constraints to be enforced by the encoder. This mode can + be slower, and may also be lower quality. It is + primarily useful for streaming. */ + OMX_BOOL bDownmix; /**< Downmix input from stereo to mono (has no effect on + non-stereo streams). Useful for lower-bitrate encoding. */ +} OMX_AUDIO_PARAM_VORBISTYPE; + + +/** WMA Version */ +typedef enum OMX_AUDIO_WMAFORMATTYPE { + OMX_AUDIO_WMAFormatUnused = 0, /**< format unused or unknown */ + OMX_AUDIO_WMAFormat7, /**< Windows Media Audio format 7 */ + OMX_AUDIO_WMAFormat8, /**< Windows Media Audio format 8 */ + OMX_AUDIO_WMAFormat9, /**< Windows Media Audio format 9 */ + OMX_AUDIO_WMAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_WMAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_WMAFormatMax = 0x7FFFFFFF +} OMX_AUDIO_WMAFORMATTYPE; + + +/** WMA Profile */ +typedef enum OMX_AUDIO_WMAPROFILETYPE { + OMX_AUDIO_WMAProfileUnused = 0, /**< profile unused or unknown */ + OMX_AUDIO_WMAProfileL1, /**< Windows Media audio version 9 profile L1 */ + OMX_AUDIO_WMAProfileL2, /**< Windows Media audio version 9 profile L2 */ + OMX_AUDIO_WMAProfileL3, /**< Windows Media audio version 9 profile L3 */ + OMX_AUDIO_WMAProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_WMAProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_WMAProfileMax = 0x7FFFFFFF +} OMX_AUDIO_WMAPROFILETYPE; + + +/** WMA params */ +typedef struct OMX_AUDIO_PARAM_WMATYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U16 nChannels; /**< Number of channels */ + OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable + rate or unknown bit rates */ + OMX_AUDIO_WMAFORMATTYPE eFormat; /**< Version of WMA stream / data */ + OMX_AUDIO_WMAPROFILETYPE eProfile; /**< Profile of WMA stream / data */ + OMX_U32 nSamplingRate; /**< Sampling rate of the source data */ + OMX_U16 nBlockAlign; /**< is the block alignment, or block size, in bytes of the audio codec */ + OMX_U16 nEncodeOptions; /**< WMA Type-specific data */ + OMX_U32 nSuperBlockAlign; /**< WMA Type-specific data */ +} OMX_AUDIO_PARAM_WMATYPE; + +/** + * RealAudio format + */ +typedef enum OMX_AUDIO_RAFORMATTYPE { + OMX_AUDIO_RAFormatUnused = 0, /**< Format unused or unknown */ + OMX_AUDIO_RA8, /**< RealAudio 8 codec */ + OMX_AUDIO_RA9, /**< RealAudio 9 codec */ + OMX_AUDIO_RA10_AAC, /**< MPEG-4 AAC codec for bitrates of more than 128kbps */ + OMX_AUDIO_RA10_CODEC, /**< RealAudio codec for bitrates less than 128 kbps */ + OMX_AUDIO_RA10_LOSSLESS, /**< RealAudio Lossless */ + OMX_AUDIO_RA10_MULTICHANNEL, /**< RealAudio Multichannel */ + OMX_AUDIO_RA10_VOICE, /**< RealAudio Voice for bitrates below 15 kbps */ + OMX_AUDIO_RAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_RAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_RAFormatMax = 0x7FFFFFFF +} OMX_AUDIO_RAFORMATTYPE; + +/** RA (Real Audio) params */ +typedef struct OMX_AUDIO_PARAM_RATYPE { + OMX_U32 nSize; /**< Size of this structure, in Bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< Port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels */ + OMX_U32 nSamplingRate; /**< is the sampling rate of the source data */ + OMX_U32 nBitsPerFrame; /**< is the value for bits per frame */ + OMX_U32 nSamplePerFrame; /**< is the value for samples per frame */ + OMX_U32 nCouplingQuantBits; /**< is the number of coupling quantization bits in the stream */ + OMX_U32 nCouplingStartRegion; /**< is the coupling start region in the stream */ + OMX_U32 nNumRegions; /**< is the number of regions value */ + OMX_AUDIO_RAFORMATTYPE eFormat; /**< is the RealAudio audio format */ +} OMX_AUDIO_PARAM_RATYPE; + + +/** SBC Allocation Method Type */ +typedef enum OMX_AUDIO_SBCALLOCMETHODTYPE { + OMX_AUDIO_SBCAllocMethodLoudness, /**< Loudness allocation method */ + OMX_AUDIO_SBCAllocMethodSNR, /**< SNR allocation method */ + OMX_AUDIO_SBCAllocMethodKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_SBCAllocMethodVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_SBCAllocMethodMax = 0x7FFFFFFF +} OMX_AUDIO_SBCALLOCMETHODTYPE; + + +/** SBC params */ +typedef struct OMX_AUDIO_PARAM_SBCTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels */ + OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable + rate or unknown bit rates */ + OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for + variable or unknown sampling rate. */ + OMX_U32 nBlocks; /**< Number of blocks */ + OMX_U32 nSubbands; /**< Number of subbands */ + OMX_U32 nBitPool; /**< Bitpool value */ + OMX_BOOL bEnableBitrate; /**< Use bitrate value instead of bitpool */ + OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ + OMX_AUDIO_SBCALLOCMETHODTYPE eSBCAllocType; /**< SBC Allocation method type */ +} OMX_AUDIO_PARAM_SBCTYPE; + + +/** ADPCM stream format parameters */ +typedef struct OMX_AUDIO_PARAM_ADPCMTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels in the data stream (not + necessarily the same as the number of channels + to be rendered. */ + OMX_U32 nBitsPerSample; /**< Number of bits in each sample */ + OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for + variable or unknown sampling rate. */ +} OMX_AUDIO_PARAM_ADPCMTYPE; + + +/** G723 rate */ +typedef enum OMX_AUDIO_G723RATE { + OMX_AUDIO_G723ModeUnused = 0, /**< AMRNB Mode unused / unknown */ + OMX_AUDIO_G723ModeLow, /**< 5300 bps */ + OMX_AUDIO_G723ModeHigh, /**< 6300 bps */ + OMX_AUDIO_G723ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_G723ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_G723ModeMax = 0x7FFFFFFF +} OMX_AUDIO_G723RATE; + + +/** G723 - Sample rate must be 8 KHz */ +typedef struct OMX_AUDIO_PARAM_G723TYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels in the data stream (not + necessarily the same as the number of channels + to be rendered. */ + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ + OMX_AUDIO_G723RATE eBitRate; /**< todo: Should this be moved to a config? */ + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ + OMX_BOOL bPostFilter; /**< Enable Post Filter */ +} OMX_AUDIO_PARAM_G723TYPE; + + +/** ITU G726 (ADPCM) rate */ +typedef enum OMX_AUDIO_G726MODE { + OMX_AUDIO_G726ModeUnused = 0, /**< G726 Mode unused / unknown */ + OMX_AUDIO_G726Mode16, /**< 16 kbps */ + OMX_AUDIO_G726Mode24, /**< 24 kbps */ + OMX_AUDIO_G726Mode32, /**< 32 kbps, most common rate, also G721 */ + OMX_AUDIO_G726Mode40, /**< 40 kbps */ + OMX_AUDIO_G726ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_G726ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_G726ModeMax = 0x7FFFFFFF +} OMX_AUDIO_G726MODE; + + +/** G.726 stream format parameters - must be at 8KHz */ +typedef struct OMX_AUDIO_PARAM_G726TYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels in the data stream (not + necessarily the same as the number of channels + to be rendered. */ + OMX_AUDIO_G726MODE eG726Mode; +} OMX_AUDIO_PARAM_G726TYPE; + + +/** G729 coder type */ +typedef enum OMX_AUDIO_G729TYPE { + OMX_AUDIO_G729 = 0, /**< ITU G.729 encoded data */ + OMX_AUDIO_G729A, /**< ITU G.729 annex A encoded data */ + OMX_AUDIO_G729B, /**< ITU G.729 with annex B encoded data */ + OMX_AUDIO_G729AB, /**< ITU G.729 annexes A and B encoded data */ + OMX_AUDIO_G729KhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_G729VendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_G729Max = 0x7FFFFFFF +} OMX_AUDIO_G729TYPE; + + +/** G729 stream format parameters - fixed 6KHz sample rate */ +typedef struct OMX_AUDIO_PARAM_G729TYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels in the data stream (not + necessarily the same as the number of channels + to be rendered. */ + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ + OMX_AUDIO_G729TYPE eBitType; +} OMX_AUDIO_PARAM_G729TYPE; + + +/** AMR Frame format */ +typedef enum OMX_AUDIO_AMRFRAMEFORMATTYPE { + OMX_AUDIO_AMRFrameFormatConformance = 0, /**< Frame Format is AMR Conformance + (Standard) Format */ + OMX_AUDIO_AMRFrameFormatIF1, /**< Frame Format is AMR Interface + Format 1 */ + OMX_AUDIO_AMRFrameFormatIF2, /**< Frame Format is AMR Interface + Format 2*/ + OMX_AUDIO_AMRFrameFormatFSF, /**< Frame Format is AMR File Storage + Format */ + OMX_AUDIO_AMRFrameFormatRTPPayload, /**< Frame Format is AMR Real-Time + Transport Protocol Payload Format */ + OMX_AUDIO_AMRFrameFormatITU, /**< Frame Format is ITU Format (added at Motorola request) */ + OMX_AUDIO_AMRFrameFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_AMRFrameFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_AMRFrameFormatMax = 0x7FFFFFFF +} OMX_AUDIO_AMRFRAMEFORMATTYPE; + + +/** AMR band mode */ +typedef enum OMX_AUDIO_AMRBANDMODETYPE { + OMX_AUDIO_AMRBandModeUnused = 0, /**< AMRNB Mode unused / unknown */ + OMX_AUDIO_AMRBandModeNB0, /**< AMRNB Mode 0 = 4750 bps */ + OMX_AUDIO_AMRBandModeNB1, /**< AMRNB Mode 1 = 5150 bps */ + OMX_AUDIO_AMRBandModeNB2, /**< AMRNB Mode 2 = 5900 bps */ + OMX_AUDIO_AMRBandModeNB3, /**< AMRNB Mode 3 = 6700 bps */ + OMX_AUDIO_AMRBandModeNB4, /**< AMRNB Mode 4 = 7400 bps */ + OMX_AUDIO_AMRBandModeNB5, /**< AMRNB Mode 5 = 7950 bps */ + OMX_AUDIO_AMRBandModeNB6, /**< AMRNB Mode 6 = 10200 bps */ + OMX_AUDIO_AMRBandModeNB7, /**< AMRNB Mode 7 = 12200 bps */ + OMX_AUDIO_AMRBandModeWB0, /**< AMRWB Mode 0 = 6600 bps */ + OMX_AUDIO_AMRBandModeWB1, /**< AMRWB Mode 1 = 8850 bps */ + OMX_AUDIO_AMRBandModeWB2, /**< AMRWB Mode 2 = 12650 bps */ + OMX_AUDIO_AMRBandModeWB3, /**< AMRWB Mode 3 = 14250 bps */ + OMX_AUDIO_AMRBandModeWB4, /**< AMRWB Mode 4 = 15850 bps */ + OMX_AUDIO_AMRBandModeWB5, /**< AMRWB Mode 5 = 18250 bps */ + OMX_AUDIO_AMRBandModeWB6, /**< AMRWB Mode 6 = 19850 bps */ + OMX_AUDIO_AMRBandModeWB7, /**< AMRWB Mode 7 = 23050 bps */ + OMX_AUDIO_AMRBandModeWB8, /**< AMRWB Mode 8 = 23850 bps */ + OMX_AUDIO_AMRBandModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_AMRBandModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_AMRBandModeMax = 0x7FFFFFFF +} OMX_AUDIO_AMRBANDMODETYPE; + + +/** AMR Discontinuous Transmission mode */ +typedef enum OMX_AUDIO_AMRDTXMODETYPE { + OMX_AUDIO_AMRDTXModeOff = 0, /**< AMR Discontinuous Transmission Mode is disabled */ + OMX_AUDIO_AMRDTXModeOnVAD1, /**< AMR Discontinuous Transmission Mode using + Voice Activity Detector 1 (VAD1) is enabled */ + OMX_AUDIO_AMRDTXModeOnVAD2, /**< AMR Discontinuous Transmission Mode using + Voice Activity Detector 2 (VAD2) is enabled */ + OMX_AUDIO_AMRDTXModeOnAuto, /**< The codec will automatically select between + Off, VAD1 or VAD2 modes */ + + OMX_AUDIO_AMRDTXasEFR, /**< DTX as EFR instead of AMR standard (3GPP 26.101, frame type =8,9,10) */ + + OMX_AUDIO_AMRDTXModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_AMRDTXModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_AMRDTXModeMax = 0x7FFFFFFF +} OMX_AUDIO_AMRDTXMODETYPE; + + +/** AMR params */ +typedef struct OMX_AUDIO_PARAM_AMRTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels */ + OMX_U32 nBitRate; /**< Bit rate read only field */ + OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode; /**< AMR Band Mode enumeration */ + OMX_AUDIO_AMRDTXMODETYPE eAMRDTXMode; /**< AMR DTX Mode enumeration */ + OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat; /**< AMR frame format enumeration */ +} OMX_AUDIO_PARAM_AMRTYPE; + + +/** GSM_FR (ETSI 06.10, 3GPP 46.010) stream format parameters */ +typedef struct OMX_AUDIO_PARAM_GSMFRTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ +} OMX_AUDIO_PARAM_GSMFRTYPE; + + +/** GSM-HR (ETSI 06.20, 3GPP 46.020) stream format parameters */ +typedef struct OMX_AUDIO_PARAM_GSMHRTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ +} OMX_AUDIO_PARAM_GSMHRTYPE; + + +/** GSM-EFR (ETSI 06.60, 3GPP 46.060) stream format parameters */ +typedef struct OMX_AUDIO_PARAM_GSMEFRTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ +} OMX_AUDIO_PARAM_GSMEFRTYPE; + + +/** TDMA FR (TIA/EIA-136-420, VSELP 7.95kbps coder) stream format parameters */ +typedef struct OMX_AUDIO_PARAM_TDMAFRTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels in the data stream (not + necessarily the same as the number of channels + to be rendered. */ + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ +} OMX_AUDIO_PARAM_TDMAFRTYPE; + + +/** TDMA EFR (TIA/EIA-136-410, ACELP 7.4kbps coder) stream format parameters */ +typedef struct OMX_AUDIO_PARAM_TDMAEFRTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels in the data stream (not + necessarily the same as the number of channels + to be rendered. */ + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ +} OMX_AUDIO_PARAM_TDMAEFRTYPE; + + +/** PDC FR ( RCR-27, VSELP 6.7kbps coder) stream format parameters */ +typedef struct OMX_AUDIO_PARAM_PDCFRTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels in the data stream (not + necessarily the same as the number of channels + to be rendered. */ + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ +} OMX_AUDIO_PARAM_PDCFRTYPE; + + +/** PDC EFR ( RCR-27, ACELP 6.7kbps coder) stream format parameters */ +typedef struct OMX_AUDIO_PARAM_PDCEFRTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels in the data stream (not + necessarily the same as the number of channels + to be rendered. */ + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ +} OMX_AUDIO_PARAM_PDCEFRTYPE; + +/** PDC HR ( RCR-27, PSI-CELP 3.45kbps coder) stream format parameters */ +typedef struct OMX_AUDIO_PARAM_PDCHRTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels in the data stream (not + necessarily the same as the number of channels + to be rendered. */ + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ +} OMX_AUDIO_PARAM_PDCHRTYPE; + + +/** CDMA Rate types */ +typedef enum OMX_AUDIO_CDMARATETYPE { + OMX_AUDIO_CDMARateBlank = 0, /**< CDMA encoded frame is blank */ + OMX_AUDIO_CDMARateFull, /**< CDMA encoded frame in full rate */ + OMX_AUDIO_CDMARateHalf, /**< CDMA encoded frame in half rate */ + OMX_AUDIO_CDMARateQuarter, /**< CDMA encoded frame in quarter rate */ + OMX_AUDIO_CDMARateEighth, /**< CDMA encoded frame in eighth rate (DTX)*/ + OMX_AUDIO_CDMARateErasure, /**< CDMA erasure frame */ + OMX_AUDIO_CDMARateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_CDMARateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_CDMARateMax = 0x7FFFFFFF +} OMX_AUDIO_CDMARATETYPE; + + +/** QCELP8 (TIA/EIA-96, up to 8kbps coder) stream format parameters */ +typedef struct OMX_AUDIO_PARAM_QCELP8TYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels in the data stream (not + necessarily the same as the number of channels + to be rendered. */ + OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable + rate or unknown bit rates */ + OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ + OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ + OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ +} OMX_AUDIO_PARAM_QCELP8TYPE; + + +/** QCELP13 ( CDMA, EIA/TIA-733, 13.3kbps coder) stream format parameters */ +typedef struct OMX_AUDIO_PARAM_QCELP13TYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels in the data stream (not + necessarily the same as the number of channels + to be rendered. */ + OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ + OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ + OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ +} OMX_AUDIO_PARAM_QCELP13TYPE; + + +/** EVRC ( CDMA, EIA/TIA-127, RCELP up to 8.55kbps coder) stream format parameters */ +typedef struct OMX_AUDIO_PARAM_EVRCTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels in the data stream (not + necessarily the same as the number of channels + to be rendered. */ + OMX_AUDIO_CDMARATETYPE eCDMARate; /**< actual Frame rate */ + OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */ + OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ + OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ + OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter */ + OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */ + OMX_BOOL bPostFilter; /**< Enable decoder's post Filter */ +} OMX_AUDIO_PARAM_EVRCTYPE; + + +/** SMV ( up to 8.55kbps coder) stream format parameters */ +typedef struct OMX_AUDIO_PARAM_SMVTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannels; /**< Number of channels in the data stream (not + necessarily the same as the number of channels + to be rendered. */ + OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ + OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */ + OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 ??*/ + OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 ??*/ + OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter ??*/ + OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */ + OMX_BOOL bPostFilter; /**< Enable decoder's post Filter ??*/ +} OMX_AUDIO_PARAM_SMVTYPE; + + +/** MIDI Format + * @ingroup midi + */ +typedef enum OMX_AUDIO_MIDIFORMATTYPE +{ + OMX_AUDIO_MIDIFormatUnknown = 0, /**< MIDI Format unknown or don't care */ + OMX_AUDIO_MIDIFormatSMF0, /**< Standard MIDI File Type 0 */ + OMX_AUDIO_MIDIFormatSMF1, /**< Standard MIDI File Type 1 */ + OMX_AUDIO_MIDIFormatSMF2, /**< Standard MIDI File Type 2 */ + OMX_AUDIO_MIDIFormatSPMIDI, /**< SP-MIDI */ + OMX_AUDIO_MIDIFormatXMF0, /**< eXtensible Music Format type 0 */ + OMX_AUDIO_MIDIFormatXMF1, /**< eXtensible Music Format type 1 */ + OMX_AUDIO_MIDIFormatMobileXMF, /**< Mobile XMF (eXtensible Music Format type 2) */ + OMX_AUDIO_MIDIFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_MIDIFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_MIDIFormatMax = 0x7FFFFFFF +} OMX_AUDIO_MIDIFORMATTYPE; + + +/** MIDI params + * @ingroup midi + */ +typedef struct OMX_AUDIO_PARAM_MIDITYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nFileSize; /**< size of the MIDI file in bytes, where the entire + MIDI file passed in, otherwise if 0x0, the MIDI data + is merged and streamed (instead of passed as an + entire MIDI file) */ + OMX_BU32 sMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic + voices. A value of zero indicates that the default + polyphony of the device is used */ + OMX_BOOL bLoadDefaultSound; /**< Whether to load default sound + bank at initialization */ + OMX_AUDIO_MIDIFORMATTYPE eMidiFormat; /**< Version of the MIDI file */ +} OMX_AUDIO_PARAM_MIDITYPE; + + +/** Type of the MIDI sound bank + * @ingroup midi + */ +typedef enum OMX_AUDIO_MIDISOUNDBANKTYPE { + OMX_AUDIO_MIDISoundBankUnused = 0, /**< unused/unknown soundbank type */ + OMX_AUDIO_MIDISoundBankDLS1, /**< DLS version 1 */ + OMX_AUDIO_MIDISoundBankDLS2, /**< DLS version 2 */ + OMX_AUDIO_MIDISoundBankMobileDLSBase, /**< Mobile DLS, using the base functionality */ + OMX_AUDIO_MIDISoundBankMobileDLSPlusOptions, /**< Mobile DLS, using the specification-defined optional feature set */ + OMX_AUDIO_MIDISoundBankKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_MIDISoundBankVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_MIDISoundBankMax = 0x7FFFFFFF +} OMX_AUDIO_MIDISOUNDBANKTYPE; + + +/** Bank Layout describes how bank MSB & LSB are used in the DLS instrument definitions sound bank + * @ingroup midi + */ +typedef enum OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE { + OMX_AUDIO_MIDISoundBankLayoutUnused = 0, /**< unused/unknown soundbank type */ + OMX_AUDIO_MIDISoundBankLayoutGM, /**< GS layout (based on bank MSB 0x00) */ + OMX_AUDIO_MIDISoundBankLayoutGM2, /**< General MIDI 2 layout (using MSB 0x78/0x79, LSB 0x00) */ + OMX_AUDIO_MIDISoundBankLayoutUser, /**< Does not conform to any bank numbering standards */ + OMX_AUDIO_MIDISoundBankLayoutKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_MIDISoundBankLayoutVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_MIDISoundBankLayoutMax = 0x7FFFFFFF +} OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE; + + +/** MIDI params to load/unload user soundbank + * @ingroup midi + */ +typedef struct OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nDLSIndex; /**< DLS file index to be loaded */ + OMX_U32 nDLSSize; /**< Size in bytes */ + OMX_PTR pDLSData; /**< Pointer to DLS file data */ + OMX_AUDIO_MIDISOUNDBANKTYPE eMidiSoundBank; /**< Midi sound bank type enumeration */ + OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE eMidiSoundBankLayout; /**< Midi sound bank layout enumeration */ +} OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE; + + +/** Structure for Live MIDI events and MIP messages. + * (MIP = Maximum Instantaneous Polyphony; part of the SP-MIDI standard.) + * @ingroup midi + */ +typedef struct OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< Port that this structure applies to */ + OMX_U32 nMidiEventSize; /**< Size of immediate MIDI events or MIP message in bytes */ + OMX_U8 nMidiEvents[1]; /**< MIDI event array to be rendered immediately, or an + array for the MIP message buffer, where the size is + indicated by nMidiEventSize */ +} OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE; + + +/** MIDI sound bank/ program pair in a given channel + * @ingroup midi + */ +typedef struct OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< Port that this structure applies to */ + OMX_U32 nChannel; /**< Valid channel values range from 1 to 16 */ + OMX_U16 nIDProgram; /**< Valid program ID range is 1 to 128 */ + OMX_U16 nIDSoundBank; /**< Sound bank ID */ + OMX_U32 nUserSoundBankIndex;/**< User soundbank index, easier to access soundbanks + by index if multiple banks are present */ +} OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE; + + +/** MIDI control + * @ingroup midi + */ +typedef struct OMX_AUDIO_CONFIG_MIDICONTROLTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_BS32 sPitchTransposition; /**< Pitch transposition in semitones, stored as Q22.10 + format based on JAVA MMAPI (JSR-135) requirement */ + OMX_BU32 sPlayBackRate; /**< Relative playback rate, stored as Q14.17 fixed-point + number based on JSR-135 requirement */ + OMX_BU32 sTempo ; /**< Tempo in beats per minute (BPM), stored as Q22.10 + fixed-point number based on JSR-135 requirement */ + OMX_U32 nMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic + voices. A value of zero indicates that the default + polyphony of the device is used */ + OMX_U32 nNumRepeat; /**< Number of times to repeat playback */ + OMX_U32 nStopTime; /**< Time in milliseconds to indicate when playback + will stop automatically. Set to zero if not used */ + OMX_U16 nChannelMuteMask; /**< 16 bit mask for channel mute status */ + OMX_U16 nChannelSoloMask; /**< 16 bit mask for channel solo status */ + OMX_U32 nTrack0031MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 0-31 */ + OMX_U32 nTrack3263MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 32-63 */ + OMX_U32 nTrack0031SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 0-31 */ + OMX_U32 nTrack3263SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 32-63 */ + +} OMX_AUDIO_CONFIG_MIDICONTROLTYPE; + + +/** MIDI Playback States + * @ingroup midi + */ +typedef enum OMX_AUDIO_MIDIPLAYBACKSTATETYPE { + OMX_AUDIO_MIDIPlayBackStateUnknown = 0, /**< Unknown state or state does not map to + other defined states */ + OMX_AUDIO_MIDIPlayBackStateClosedEngaged, /**< No MIDI resource is currently open. + The MIDI engine is currently processing + MIDI events. */ + OMX_AUDIO_MIDIPlayBackStateParsing, /**< A MIDI resource is open and is being + primed. The MIDI engine is currently + processing MIDI events. */ + OMX_AUDIO_MIDIPlayBackStateOpenEngaged, /**< A MIDI resource is open and primed but + not playing. The MIDI engine is currently + processing MIDI events. The transition to + this state is only possible from the + OMX_AUDIO_MIDIPlayBackStatePlaying state, + when the 'playback head' reaches the end + of media data or the playback stops due + to stop time set.*/ + OMX_AUDIO_MIDIPlayBackStatePlaying, /**< A MIDI resource is open and currently + playing. The MIDI engine is currently + processing MIDI events.*/ + OMX_AUDIO_MIDIPlayBackStatePlayingPartially, /**< Best-effort playback due to SP-MIDI/DLS + resource constraints */ + OMX_AUDIO_MIDIPlayBackStatePlayingSilently, /**< Due to system resource constraints and + SP-MIDI content constraints, there is + no audible MIDI content during playback + currently. The situation may change if + resources are freed later.*/ + OMX_AUDIO_MIDIPlayBackStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_MIDIPlayBackStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_MIDIPlayBackStateMax = 0x7FFFFFFF +} OMX_AUDIO_MIDIPLAYBACKSTATETYPE; + + +/** MIDI status + * @ingroup midi + */ +typedef struct OMX_AUDIO_CONFIG_MIDISTATUSTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U16 nNumTracks; /**< Number of MIDI tracks in the file, read only field. + NOTE: May not return a meaningful value until the entire + file is parsed and buffered. */ + OMX_U32 nDuration; /**< The length of the currently open MIDI resource + in milliseconds. NOTE: May not return a meaningful value + until the entire file is parsed and buffered. */ + OMX_U32 nPosition; /**< Current Position of the MIDI resource being played + in milliseconds */ + OMX_BOOL bVibra; /**< Does Vibra track exist? NOTE: May not return a meaningful + value until the entire file is parsed and buffered. */ + OMX_U32 nNumMetaEvents; /**< Total number of MIDI Meta Events in the currently + open MIDI resource. NOTE: May not return a meaningful value + until the entire file is parsed and buffered. */ + OMX_U32 nNumActiveVoices; /**< Number of active voices in the currently playing + MIDI resource. NOTE: May not return a meaningful value until + the entire file is parsed and buffered. */ + OMX_AUDIO_MIDIPLAYBACKSTATETYPE eMIDIPlayBackState; /**< MIDI playback state enumeration, read only field */ +} OMX_AUDIO_CONFIG_MIDISTATUSTYPE; + + +/** MIDI Meta Event structure one per Meta Event. + * MIDI Meta Events are like audio metadata, except that they are interspersed + * with the MIDI content throughout the file and are not localized in the header. + * As such, it is necessary to retrieve information about these Meta Events from + * the engine, as it encounters these Meta Events within the MIDI content. + * For example, SMF files can have up to 14 types of MIDI Meta Events (copyright, + * author, default tempo, etc.) scattered throughout the file. + * @ingroup midi + */ +typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE{ + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nIndex; /**< Index of Meta Event */ + OMX_U8 nMetaEventType; /**< Meta Event Type, 7bits (i.e. 0 - 127) */ + OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */ + OMX_U32 nTrack; /**< track number for the meta event */ + OMX_U32 nPosition; /**< Position of the meta-event in milliseconds */ +} OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE; + + +/** MIDI Meta Event Data structure - one per Meta Event. + * @ingroup midi + */ +typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE{ + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nIndex; /**< Index of Meta Event */ + OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */ + OMX_U8 nData[1]; /**< array of one or more bytes of meta data + as indicated by the nMetaEventSize field */ +} OMX_AUDIO_CONFIG__MIDIMETAEVENTDATATYPE; + + +/** Audio Volume adjustment for a port */ +typedef struct OMX_AUDIO_CONFIG_VOLUMETYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< Port index indicating which port to + set. Select the input port to set + just that port's volume. Select the + output port to adjust the master + volume. */ + OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) + or logarithmic scale (mB) */ + OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR + Volume logarithmic setting for this port. The values + for volume are in mB (millibels = 1/100 dB) relative + to a gain of 1 (e.g. the output is the same as the + input level). Values are in mB from nMax + (maximum volume) to nMin mB (typically negative). + Since the volume is "voltage" + and not a "power", it takes a setting of + -600 mB to decrease the volume by 1/2. If + a component cannot accurately set the + volume to the requested value, it must + set the volume to the closest value BELOW + the requested value. When getting the + volume setting, the current actual volume + must be returned. */ +} OMX_AUDIO_CONFIG_VOLUMETYPE; + + +/** Audio Volume adjustment for a channel */ +typedef struct OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< Port index indicating which port to + set. Select the input port to set + just that port's volume. Select the + output port to adjust the master + volume. */ + OMX_U32 nChannel; /**< channel to select from 0 to N-1, + using OMX_ALL to apply volume settings + to all channels */ + OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) or + logarithmic scale (mB) */ + OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR + Volume logarithmic setting for this port. + The values for volume are in mB + (millibels = 1/100 dB) relative to a gain + of 1 (e.g. the output is the same as the + input level). Values are in mB from nMax + (maximum volume) to nMin mB (typically negative). + Since the volume is "voltage" + and not a "power", it takes a setting of + -600 mB to decrease the volume by 1/2. If + a component cannot accurately set the + volume to the requested value, it must + set the volume to the closest value BELOW + the requested value. When getting the + volume setting, the current actual volume + must be returned. */ + OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel, + FALSE otherwise */ +} OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE; + + +/** Audio balance setting */ +typedef struct OMX_AUDIO_CONFIG_BALANCETYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< Port index indicating which port to + set. Select the input port to set + just that port's balance. Select the + output port to adjust the master + balance. */ + OMX_S32 nBalance; /**< balance setting for this port + (-100 to 100, where -100 indicates + all left, and no right */ +} OMX_AUDIO_CONFIG_BALANCETYPE; + + +/** Audio Port mute */ +typedef struct OMX_AUDIO_CONFIG_MUTETYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< Port index indicating which port to + set. Select the input port to set + just that port's mute. Select the + output port to adjust the master + mute. */ + OMX_BOOL bMute; /**< Mute setting for this port */ +} OMX_AUDIO_CONFIG_MUTETYPE; + + +/** Audio Channel mute */ +typedef struct OMX_AUDIO_CONFIG_CHANNELMUTETYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nChannel; /**< channel to select from 0 to N-1, + using OMX_ALL to apply mute settings + to all channels */ + OMX_BOOL bMute; /**< Mute setting for this channel */ + OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel, + FALSE otherwise */ +} OMX_AUDIO_CONFIG_CHANNELMUTETYPE; + + + +/** Enable / Disable for loudness control, which boosts bass and to a + * smaller extent high end frequencies to compensate for hearing + * ability at the extreme ends of the audio spectrum + */ +typedef struct OMX_AUDIO_CONFIG_LOUDNESSTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_BOOL bLoudness; /**< Enable/disable for loudness */ +} OMX_AUDIO_CONFIG_LOUDNESSTYPE; + + +/** Enable / Disable for bass, which controls low frequencies + */ +typedef struct OMX_AUDIO_CONFIG_BASSTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_BOOL bEnable; /**< Enable/disable for bass control */ + OMX_S32 nBass; /**< bass setting for the port, as a + continuous value from -100 to 100 + (0 means no change in bass level)*/ +} OMX_AUDIO_CONFIG_BASSTYPE; + + +/** Enable / Disable for treble, which controls high frequencies tones + */ +typedef struct OMX_AUDIO_CONFIG_TREBLETYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_BOOL bEnable; /**< Enable/disable for treble control */ + OMX_S32 nTreble; /**< treble setting for the port, as a + continuous value from -100 to 100 + (0 means no change in treble level) */ +} OMX_AUDIO_CONFIG_TREBLETYPE; + + +/** An equalizer is typically used for two reasons: to compensate for an + * sub-optimal frequency response of a system to make it sound more natural + * or to create intentionally some unnatural coloring to the sound to create + * an effect. + * @ingroup effects + */ +typedef struct OMX_AUDIO_CONFIG_EQUALIZERTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_BOOL bEnable; /**< Enable/disable for equalizer */ + OMX_BU32 sBandIndex; /**< Band number to be set. Upper Limit is + N-1, where N is the number of bands, lower limit is 0 */ + OMX_BU32 sCenterFreq; /**< Center frequecies in Hz. This is a + read only element and is used to determine + the lower, center and upper frequency of + this band. */ + OMX_BS32 sBandLevel; /**< band level in millibels */ +} OMX_AUDIO_CONFIG_EQUALIZERTYPE; + + +/** Stereo widening mode type + * @ingroup effects + */ +typedef enum OMX_AUDIO_STEREOWIDENINGTYPE { + OMX_AUDIO_StereoWideningHeadphones, /**< Stereo widening for loudspeakers */ + OMX_AUDIO_StereoWideningLoudspeakers, /**< Stereo widening for closely spaced loudspeakers */ + OMX_AUDIO_StereoWideningKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_StereoWideningVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_StereoWideningMax = 0x7FFFFFFF +} OMX_AUDIO_STEREOWIDENINGTYPE; + + +/** Control for stereo widening, which is a special 2-channel + * case of the audio virtualizer effect. For example, for 5.1-channel + * output, it translates to virtual surround sound. + * @ingroup effects + */ +typedef struct OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_BOOL bEnable; /**< Enable/disable for stereo widening control */ + OMX_AUDIO_STEREOWIDENINGTYPE eWideningType; /**< Stereo widening algorithm type */ + OMX_U32 nStereoWidening; /**< stereo widening setting for the port, + as a continuous value from 0 to 100 */ +} OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE; + + +/** The chorus effect (or ``choralizer'') is any signal processor which makes + * one sound source (such as a voice) sound like many such sources singing + * (or playing) in unison. Since performance in unison is never exact, chorus + * effects simulate this by making independently modified copies of the input + * signal. Modifications may include (1) delay, (2) frequency shift, and + * (3) amplitude modulation. + * @ingroup effects + */ +typedef struct OMX_AUDIO_CONFIG_CHORUSTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_BOOL bEnable; /**< Enable/disable for chorus */ + OMX_BU32 sDelay; /**< average delay in milliseconds */ + OMX_BU32 sModulationRate; /**< rate of modulation in millihertz */ + OMX_U32 nModulationDepth; /**< depth of modulation as a percentage of + delay (i.e. 0 to 100) */ + OMX_BU32 nFeedback; /**< Feedback from chorus output to input in percentage */ +} OMX_AUDIO_CONFIG_CHORUSTYPE; + + +/** Reverberation is part of the reflected sound that follows the early + * reflections. In a typical room, this consists of a dense succession of + * echoes whose energy decays exponentially. The reverberation effect structure + * as defined here includes both (early) reflections as well as (late) reverberations. + * @ingroup effects + */ +typedef struct OMX_AUDIO_CONFIG_REVERBERATIONTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_BOOL bEnable; /**< Enable/disable for reverberation control */ + OMX_BS32 sRoomLevel; /**< Intensity level for the whole room effect + (i.e. both early reflections and late + reverberation) in millibels */ + OMX_BS32 sRoomHighFreqLevel; /**< Attenuation at high frequencies + relative to the intensity at low + frequencies in millibels */ + OMX_BS32 sReflectionsLevel; /**< Intensity level of early reflections + (relative to room value), in millibels */ + OMX_BU32 sReflectionsDelay; /**< Delay time of the first reflection relative + to the direct path, in milliseconds */ + OMX_BS32 sReverbLevel; /**< Intensity level of late reverberation + relative to room level, in millibels */ + OMX_BU32 sReverbDelay; /**< Time delay from the first early reflection + to the beginning of the late reverberation + section, in milliseconds */ + OMX_BU32 sDecayTime; /**< Late reverberation decay time at low + frequencies, in milliseconds */ + OMX_BU32 nDecayHighFreqRatio; /**< Ratio of high frequency decay time relative + to low frequency decay time in percent */ + OMX_U32 nDensity; /**< Modal density in the late reverberation decay, + in percent (i.e. 0 - 100) */ + OMX_U32 nDiffusion; /**< Echo density in the late reverberation decay, + in percent (i.e. 0 - 100) */ + OMX_BU32 sReferenceHighFreq; /**< Reference high frequency in Hertz. This is + the frequency used as the reference for all + the high-frequency settings above */ + +} OMX_AUDIO_CONFIG_REVERBERATIONTYPE; + + +/** Possible settings for the Echo Cancelation structure to use + * @ingroup effects + */ +typedef enum OMX_AUDIO_ECHOCANTYPE { + OMX_AUDIO_EchoCanOff = 0, /**< Echo Cancellation is disabled */ + OMX_AUDIO_EchoCanNormal, /**< Echo Cancellation normal operation - + echo from plastics and face */ + OMX_AUDIO_EchoCanHFree, /**< Echo Cancellation optimized for + Hands Free operation */ + OMX_AUDIO_EchoCanCarKit, /**< Echo Cancellation optimized for + Car Kit (longer echo) */ + OMX_AUDIO_EchoCanKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_AUDIO_EchoCanVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_AUDIO_EchoCanMax = 0x7FFFFFFF +} OMX_AUDIO_ECHOCANTYPE; + + +/** Enable / Disable for echo cancelation, which removes undesired echo's + * from the audio + * @ingroup effects + */ +typedef struct OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_AUDIO_ECHOCANTYPE eEchoCancelation; /**< Echo cancelation settings */ +} OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE; + + +/** Enable / Disable for noise reduction, which undesired noise from + * the audio + * @ingroup effects + */ +typedef struct OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_BOOL bNoiseReduction; /**< Enable/disable for noise reduction */ +} OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE; + +/** @} */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif +/* File EOF */ + diff --git a/third_party/openmax/include/OMX_Component.h b/third_party/openmax/include/OMX_Component.h new file mode 100644 index 000000000..d5956405e --- /dev/null +++ b/third_party/openmax/include/OMX_Component.h @@ -0,0 +1,579 @@ +/* + * Copyright (c) 2008 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/** OMX_Component.h - OpenMax IL version 1.1.2 + * The OMX_Component header file contains the definitions used to define + * the public interface of a component. This header file is intended to + * be used by both the application and the component. + */ + +#ifndef OMX_Component_h +#define OMX_Component_h + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + + +/* Each OMX header must include all required header files to allow the + * header to compile without errors. The includes below are required + * for this header file to compile successfully + */ + +#include +#include +#include +#include + +/** @ingroup comp */ +typedef enum OMX_PORTDOMAINTYPE { + OMX_PortDomainAudio, + OMX_PortDomainVideo, + OMX_PortDomainImage, + OMX_PortDomainOther, + OMX_PortDomainKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_PortDomainVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_PortDomainMax = 0x7ffffff +} OMX_PORTDOMAINTYPE; + +/** @ingroup comp */ +typedef struct OMX_PARAM_PORTDEFINITIONTYPE { + OMX_U32 nSize; /**< Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< Port number the structure applies to */ + OMX_DIRTYPE eDir; /**< Direction (input or output) of this port */ + OMX_U32 nBufferCountActual; /**< The actual number of buffers allocated on this port */ + OMX_U32 nBufferCountMin; /**< The minimum number of buffers this port requires */ + OMX_U32 nBufferSize; /**< Size, in bytes, for buffers to be used for this channel */ + OMX_BOOL bEnabled; /**< Ports default to enabled and are enabled/disabled by + OMX_CommandPortEnable/OMX_CommandPortDisable. + When disabled a port is unpopulated. A disabled port + is not populated with buffers on a transition to IDLE. */ + OMX_BOOL bPopulated; /**< Port is populated with all of its buffers as indicated by + nBufferCountActual. A disabled port is always unpopulated. + An enabled port is populated on a transition to OMX_StateIdle + and unpopulated on a transition to loaded. */ + OMX_PORTDOMAINTYPE eDomain; /**< Domain of the port. Determines the contents of metadata below. */ + union { + OMX_AUDIO_PORTDEFINITIONTYPE audio; + OMX_VIDEO_PORTDEFINITIONTYPE video; + OMX_IMAGE_PORTDEFINITIONTYPE image; + OMX_OTHER_PORTDEFINITIONTYPE other; + } format; + OMX_BOOL bBuffersContiguous; + OMX_U32 nBufferAlignment; +} OMX_PARAM_PORTDEFINITIONTYPE; + +/** @ingroup comp */ +typedef struct OMX_PARAM_U32TYPE { + OMX_U32 nSize; /**< Size of this structure, in Bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_U32 nU32; /**< U32 value */ +} OMX_PARAM_U32TYPE; + +/** @ingroup rpm */ +typedef enum OMX_SUSPENSIONPOLICYTYPE { + OMX_SuspensionDisabled, /**< No suspension; v1.0 behavior */ + OMX_SuspensionEnabled, /**< Suspension allowed */ + OMX_SuspensionPolicyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_SuspensionPolicyStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_SuspensionPolicyMax = 0x7fffffff +} OMX_SUSPENSIONPOLICYTYPE; + +/** @ingroup rpm */ +typedef struct OMX_PARAM_SUSPENSIONPOLICYTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_SUSPENSIONPOLICYTYPE ePolicy; +} OMX_PARAM_SUSPENSIONPOLICYTYPE; + +/** @ingroup rpm */ +typedef enum OMX_SUSPENSIONTYPE { + OMX_NotSuspended, /**< component is not suspended */ + OMX_Suspended, /**< component is suspended */ + OMX_SuspensionKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_SuspensionVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_SuspendMax = 0x7FFFFFFF +} OMX_SUSPENSIONTYPE; + +/** @ingroup rpm */ +typedef struct OMX_PARAM_SUSPENSIONTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_SUSPENSIONTYPE eType; +} OMX_PARAM_SUSPENSIONTYPE ; + +typedef struct OMX_CONFIG_BOOLEANTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_BOOL bEnabled; +} OMX_CONFIG_BOOLEANTYPE; + +/* Parameter specifying the content uri to use. */ +/** @ingroup cp */ +typedef struct OMX_PARAM_CONTENTURITYPE +{ + OMX_U32 nSize; /**< size of the structure in bytes, including + actual URI name */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U8 contentURI[1]; /**< The URI name */ +} OMX_PARAM_CONTENTURITYPE; + +/* Parameter specifying the pipe to use. */ +/** @ingroup cp */ +typedef struct OMX_PARAM_CONTENTPIPETYPE +{ + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_HANDLETYPE hPipe; /**< The pipe handle*/ +} OMX_PARAM_CONTENTPIPETYPE; + +/** @ingroup rpm */ +typedef struct OMX_RESOURCECONCEALMENTTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_BOOL bResourceConcealmentForbidden; /**< disallow the use of resource concealment + methods (like degrading algorithm quality to + lower resource consumption or functional bypass) + on a component as a resolution to resource conflicts. */ +} OMX_RESOURCECONCEALMENTTYPE; + + +/** @ingroup metadata */ +typedef enum OMX_METADATACHARSETTYPE { + OMX_MetadataCharsetUnknown = 0, + OMX_MetadataCharsetASCII, + OMX_MetadataCharsetBinary, + OMX_MetadataCharsetCodePage1252, + OMX_MetadataCharsetUTF8, + OMX_MetadataCharsetJavaConformantUTF8, + OMX_MetadataCharsetUTF7, + OMX_MetadataCharsetImapUTF7, + OMX_MetadataCharsetUTF16LE, + OMX_MetadataCharsetUTF16BE, + OMX_MetadataCharsetGB12345, + OMX_MetadataCharsetHZGB2312, + OMX_MetadataCharsetGB2312, + OMX_MetadataCharsetGB18030, + OMX_MetadataCharsetGBK, + OMX_MetadataCharsetBig5, + OMX_MetadataCharsetISO88591, + OMX_MetadataCharsetISO88592, + OMX_MetadataCharsetISO88593, + OMX_MetadataCharsetISO88594, + OMX_MetadataCharsetISO88595, + OMX_MetadataCharsetISO88596, + OMX_MetadataCharsetISO88597, + OMX_MetadataCharsetISO88598, + OMX_MetadataCharsetISO88599, + OMX_MetadataCharsetISO885910, + OMX_MetadataCharsetISO885913, + OMX_MetadataCharsetISO885914, + OMX_MetadataCharsetISO885915, + OMX_MetadataCharsetShiftJIS, + OMX_MetadataCharsetISO2022JP, + OMX_MetadataCharsetISO2022JP1, + OMX_MetadataCharsetISOEUCJP, + OMX_MetadataCharsetSMS7Bit, + OMX_MetadataCharsetKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_MetadataCharsetVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_MetadataCharsetTypeMax= 0x7FFFFFFF +} OMX_METADATACHARSETTYPE; + +/** @ingroup metadata */ +typedef enum OMX_METADATASCOPETYPE +{ + OMX_MetadataScopeAllLevels, + OMX_MetadataScopeTopLevel, + OMX_MetadataScopePortLevel, + OMX_MetadataScopeNodeLevel, + OMX_MetadataScopeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_MetadataScopeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_MetadataScopeTypeMax = 0x7fffffff +} OMX_METADATASCOPETYPE; + +/** @ingroup metadata */ +typedef enum OMX_METADATASEARCHMODETYPE +{ + OMX_MetadataSearchValueSizeByIndex, + OMX_MetadataSearchItemByIndex, + OMX_MetadataSearchNextItemByKey, + OMX_MetadataSearchKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_MetadataSearchVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_MetadataSearchTypeMax = 0x7fffffff +} OMX_METADATASEARCHMODETYPE; +/** @ingroup metadata */ +typedef struct OMX_CONFIG_METADATAITEMCOUNTTYPE +{ + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_METADATASCOPETYPE eScopeMode; + OMX_U32 nScopeSpecifier; + OMX_U32 nMetadataItemCount; +} OMX_CONFIG_METADATAITEMCOUNTTYPE; + +/** @ingroup metadata */ +typedef struct OMX_CONFIG_METADATAITEMTYPE +{ + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_METADATASCOPETYPE eScopeMode; + OMX_U32 nScopeSpecifier; + OMX_U32 nMetadataItemIndex; + OMX_METADATASEARCHMODETYPE eSearchMode; + OMX_METADATACHARSETTYPE eKeyCharset; + OMX_U8 nKeySizeUsed; + OMX_U8 nKey[128]; + OMX_METADATACHARSETTYPE eValueCharset; + OMX_STRING sLanguageCountry; + OMX_U32 nValueMaxSize; + OMX_U32 nValueSizeUsed; + OMX_U8 nValue[1]; +} OMX_CONFIG_METADATAITEMTYPE; + +/* @ingroup metadata */ +typedef struct OMX_CONFIG_CONTAINERNODECOUNTTYPE +{ + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_BOOL bAllKeys; + OMX_U32 nParentNodeID; + OMX_U32 nNumNodes; +} OMX_CONFIG_CONTAINERNODECOUNTTYPE; + +/** @ingroup metadata */ +typedef struct OMX_CONFIG_CONTAINERNODEIDTYPE +{ + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_BOOL bAllKeys; + OMX_U32 nParentNodeID; + OMX_U32 nNodeIndex; + OMX_U32 nNodeID; + OMX_STRING cNodeName; + OMX_BOOL bIsLeafType; +} OMX_CONFIG_CONTAINERNODEIDTYPE; + +/** @ingroup metadata */ +typedef struct OMX_PARAM_METADATAFILTERTYPE +{ + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_BOOL bAllKeys; /* if true then this structure refers to all keys and + * the three key fields below are ignored */ + OMX_METADATACHARSETTYPE eKeyCharset; + OMX_U32 nKeySizeUsed; + OMX_U8 nKey [128]; + OMX_U32 nLanguageCountrySizeUsed; + OMX_U8 nLanguageCountry[128]; + OMX_BOOL bEnabled; /* if true then key is part of filter (e.g. + * retained for query later). If false then + * key is not part of filter */ +} OMX_PARAM_METADATAFILTERTYPE; + +/** The OMX_HANDLETYPE structure defines the component handle. The component + * handle is used to access all of the component's public methods and also + * contains pointers to the component's private data area. The component + * handle is initialized by the OMX core (with help from the component) + * during the process of loading the component. After the component is + * successfully loaded, the application can safely access any of the + * component's public functions (although some may return an error because + * the state is inappropriate for the access). + * + * @ingroup comp + */ +typedef struct OMX_COMPONENTTYPE +{ + /** The size of this structure, in bytes. It is the responsibility + of the allocator of this structure to fill in this value. Since + this structure is allocated by the GetHandle function, this + function will fill in this value. */ + OMX_U32 nSize; + + /** nVersion is the version of the OMX specification that the structure + is built against. It is the responsibility of the creator of this + structure to initialize this value and every user of this structure + should verify that it knows how to use the exact version of + this structure found herein. */ + OMX_VERSIONTYPE nVersion; + + /** pComponentPrivate is a pointer to the component private data area. + This member is allocated and initialized by the component when the + component is first loaded. The application should not access this + data area. */ + OMX_PTR pComponentPrivate; + + /** pApplicationPrivate is a pointer that is a parameter to the + OMX_GetHandle method, and contains an application private value + provided by the IL client. This application private data is + returned to the IL Client by OMX in all callbacks */ + OMX_PTR pApplicationPrivate; + + /** refer to OMX_GetComponentVersion in OMX_core.h or the OMX IL + specification for details on the GetComponentVersion method. + */ + OMX_ERRORTYPE (*GetComponentVersion)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_OUT OMX_STRING pComponentName, + OMX_OUT OMX_VERSIONTYPE* pComponentVersion, + OMX_OUT OMX_VERSIONTYPE* pSpecVersion, + OMX_OUT OMX_UUIDTYPE* pComponentUUID); + + /** refer to OMX_SendCommand in OMX_core.h or the OMX IL + specification for details on the SendCommand method. + */ + OMX_ERRORTYPE (*SendCommand)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_COMMANDTYPE Cmd, + OMX_IN OMX_U32 nParam1, + OMX_IN OMX_PTR pCmdData); + + /** refer to OMX_GetParameter in OMX_core.h or the OMX IL + specification for details on the GetParameter method. + */ + OMX_ERRORTYPE (*GetParameter)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_INDEXTYPE nParamIndex, + OMX_INOUT OMX_PTR pComponentParameterStructure); + + + /** refer to OMX_SetParameter in OMX_core.h or the OMX IL + specification for details on the SetParameter method. + */ + OMX_ERRORTYPE (*SetParameter)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_INDEXTYPE nIndex, + OMX_IN OMX_PTR pComponentParameterStructure); + + + /** refer to OMX_GetConfig in OMX_core.h or the OMX IL + specification for details on the GetConfig method. + */ + OMX_ERRORTYPE (*GetConfig)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_INDEXTYPE nIndex, + OMX_INOUT OMX_PTR pComponentConfigStructure); + + + /** refer to OMX_SetConfig in OMX_core.h or the OMX IL + specification for details on the SetConfig method. + */ + OMX_ERRORTYPE (*SetConfig)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_INDEXTYPE nIndex, + OMX_IN OMX_PTR pComponentConfigStructure); + + + /** refer to OMX_GetExtensionIndex in OMX_core.h or the OMX IL + specification for details on the GetExtensionIndex method. + */ + OMX_ERRORTYPE (*GetExtensionIndex)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_STRING cParameterName, + OMX_OUT OMX_INDEXTYPE* pIndexType); + + + /** refer to OMX_GetState in OMX_core.h or the OMX IL + specification for details on the GetState method. + */ + OMX_ERRORTYPE (*GetState)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_OUT OMX_STATETYPE* pState); + + + /** The ComponentTunnelRequest method will interact with another OMX + component to determine if tunneling is possible and to setup the + tunneling. The return codes for this method can be used to + determine if tunneling is not possible, or if tunneling is not + supported. + + Base profile components (i.e. non-interop) do not support this + method and should return OMX_ErrorNotImplemented + + The interop profile component MUST support tunneling to another + interop profile component with a compatible port parameters. + A component may also support proprietary communication. + + If proprietary communication is supported the negotiation of + proprietary communication is done outside of OMX in a vendor + specific way. It is only required that the proper result be + returned and the details of how the setup is done is left + to the component implementation. + + When this method is invoked when nPort in an output port, the + component will: + 1. Populate the pTunnelSetup structure with the output port's + requirements and constraints for the tunnel. + + When this method is invoked when nPort in an input port, the + component will: + 1. Query the necessary parameters from the output port to + determine if the ports are compatible for tunneling + 2. If the ports are compatible, the component should store + the tunnel step provided by the output port + 3. Determine which port (either input or output) is the buffer + supplier, and call OMX_SetParameter on the output port to + indicate this selection. + + The component will return from this call within 5 msec. + + @param [in] hComp + Handle of the component to be accessed. This is the component + handle returned by the call to the OMX_GetHandle method. + @param [in] nPort + nPort is used to select the port on the component to be used + for tunneling. + @param [in] hTunneledComp + Handle of the component to tunnel with. This is the component + handle returned by the call to the OMX_GetHandle method. When + this parameter is 0x0 the component should setup the port for + communication with the application / IL Client. + @param [in] nPortOutput + nPortOutput is used indicate the port the component should + tunnel with. + @param [in] pTunnelSetup + Pointer to the tunnel setup structure. When nPort is an output port + the component should populate the fields of this structure. When + When nPort is an input port the component should review the setup + provided by the component with the output port. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup tun + */ + + OMX_ERRORTYPE (*ComponentTunnelRequest)( + OMX_IN OMX_HANDLETYPE hComp, + OMX_IN OMX_U32 nPort, + OMX_IN OMX_HANDLETYPE hTunneledComp, + OMX_IN OMX_U32 nTunneledPort, + OMX_INOUT OMX_TUNNELSETUPTYPE* pTunnelSetup); + + /** refer to OMX_UseBuffer in OMX_core.h or the OMX IL + specification for details on the UseBuffer method. + @ingroup buf + */ + OMX_ERRORTYPE (*UseBuffer)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr, + OMX_IN OMX_U32 nPortIndex, + OMX_IN OMX_PTR pAppPrivate, + OMX_IN OMX_U32 nSizeBytes, + OMX_IN OMX_U8* pBuffer); + + /** refer to OMX_AllocateBuffer in OMX_core.h or the OMX IL + specification for details on the AllocateBuffer method. + @ingroup buf + */ + OMX_ERRORTYPE (*AllocateBuffer)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_INOUT OMX_BUFFERHEADERTYPE** ppBuffer, + OMX_IN OMX_U32 nPortIndex, + OMX_IN OMX_PTR pAppPrivate, + OMX_IN OMX_U32 nSizeBytes); + + /** refer to OMX_FreeBuffer in OMX_core.h or the OMX IL + specification for details on the FreeBuffer method. + @ingroup buf + */ + OMX_ERRORTYPE (*FreeBuffer)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_U32 nPortIndex, + OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); + + /** refer to OMX_EmptyThisBuffer in OMX_core.h or the OMX IL + specification for details on the EmptyThisBuffer method. + @ingroup buf + */ + OMX_ERRORTYPE (*EmptyThisBuffer)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); + + /** refer to OMX_FillThisBuffer in OMX_core.h or the OMX IL + specification for details on the FillThisBuffer method. + @ingroup buf + */ + OMX_ERRORTYPE (*FillThisBuffer)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); + + /** The SetCallbacks method is used by the core to specify the callback + structure from the application to the component. This is a blocking + call. The component will return from this call within 5 msec. + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the GetHandle function. + @param [in] pCallbacks + pointer to an OMX_CALLBACKTYPE structure used to provide the + callback information to the component + @param [in] pAppData + pointer to an application defined value. It is anticipated that + the application will pass a pointer to a data structure or a "this + pointer" in this area to allow the callback (in the application) + to determine the context of the call + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + */ + OMX_ERRORTYPE (*SetCallbacks)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_CALLBACKTYPE* pCallbacks, + OMX_IN OMX_PTR pAppData); + + /** ComponentDeInit method is used to deinitialize the component + providing a means to free any resources allocated at component + initialization. NOTE: After this call the component handle is + not valid for further use. + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the GetHandle function. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + */ + OMX_ERRORTYPE (*ComponentDeInit)( + OMX_IN OMX_HANDLETYPE hComponent); + + /** @ingroup buf */ + OMX_ERRORTYPE (*UseEGLImage)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr, + OMX_IN OMX_U32 nPortIndex, + OMX_IN OMX_PTR pAppPrivate, + OMX_IN void* eglImage); + + OMX_ERRORTYPE (*ComponentRoleEnum)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_OUT OMX_U8 *cRole, + OMX_IN OMX_U32 nIndex); + +} OMX_COMPONENTTYPE; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif +/* File EOF */ diff --git a/third_party/openmax/include/OMX_ContentPipe.h b/third_party/openmax/include/OMX_ContentPipe.h new file mode 100644 index 000000000..5f6310c28 --- /dev/null +++ b/third_party/openmax/include/OMX_ContentPipe.h @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2008 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/** OMX_ContentPipe.h - OpenMax IL version 1.1.2 + * The OMX_ContentPipe header file contains the definitions used to define + * the public interface for content piples. This header file is intended to + * be used by the component. + */ + +#ifndef OMX_CONTENTPIPE_H +#define OMX_CONTENTPIPE_H + +#ifndef KD_EACCES +/* OpenKODE error codes. CPResult values may be zero (indicating success + or one of the following values) */ +#define KD_EACCES (1) +#define KD_EADDRINUSE (2) +#define KD_EAGAIN (5) +#define KD_EBADF (7) +#define KD_EBUSY (8) +#define KD_ECONNREFUSED (9) +#define KD_ECONNRESET (10) +#define KD_EDEADLK (11) +#define KD_EDESTADDRREQ (12) +#define KD_ERANGE (35) +#define KD_EEXIST (13) +#define KD_EFBIG (14) +#define KD_EHOSTUNREACH (15) +#define KD_EINVAL (17) +#define KD_EIO (18) +#define KD_EISCONN (20) +#define KD_EISDIR (21) +#define KD_EMFILE (22) +#define KD_ENAMETOOLONG (23) +#define KD_ENOENT (24) +#define KD_ENOMEM (25) +#define KD_ENOSPC (26) +#define KD_ENOSYS (27) +#define KD_ENOTCONN (28) +#define KD_EPERM (33) +#define KD_ETIMEDOUT (36) +#define KD_EILSEQ (19) +#endif + +/** Map types from OMX standard types only here so interface is as generic as possible. */ +typedef OMX_U32 CPresult; +typedef char * CPstring; +typedef void * CPhandle; +typedef OMX_U32 CPuint; +typedef OMX_S32 CPint; +typedef char CPbyte; +typedef OMX_BOOL CPbool; + +/** enumeration of origin types used in the CP_PIPETYPE's Seek function + * @ingroup cp + */ +typedef enum CP_ORIGINTYPE { + CP_OriginBegin, + CP_OriginCur, + CP_OriginEnd, + CP_OriginKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + CP_OriginVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + CP_OriginMax = 0X7FFFFFFF +} CP_ORIGINTYPE; + +/** enumeration of contact access types used in the CP_PIPETYPE's Open function + * @ingroup cp + */ +typedef enum CP_ACCESSTYPE { + CP_AccessRead, + CP_AccessWrite, + CP_AccessReadWrite , + CP_AccessKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + CP_AccessVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + CP_AccessMax = 0X7FFFFFFF +} CP_ACCESSTYPE; + +/** enumeration of results returned by the CP_PIPETYPE's CheckAvailableBytes function + * @ingroup cp + */ +typedef enum CP_CHECKBYTESRESULTTYPE +{ + CP_CheckBytesOk, /**< There are at least the request number + of bytes available */ + CP_CheckBytesNotReady, /**< The pipe is still retrieving bytes + and presently lacks sufficient bytes. + Client will be called when they are + sufficient bytes are available. */ + CP_CheckBytesInsufficientBytes , /**< The pipe has retrieved all bytes + but those available are less than those + requested */ + CP_CheckBytesAtEndOfStream, /**< The pipe has reached the end of stream + and no more bytes are available. */ + CP_CheckBytesOutOfBuffers, /**< All read/write buffers are currently in use. */ + CP_CheckBytesKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + CP_CheckBytesVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + CP_CheckBytesMax = 0X7FFFFFFF +} CP_CHECKBYTESRESULTTYPE; + +/** enumeration of content pipe events sent to the client callback. + * @ingroup cp + */ +typedef enum CP_EVENTTYPE{ + CP_BytesAvailable, /** bytes requested in a CheckAvailableBytes call are now available*/ + CP_Overflow, /** enumeration of content pipe events sent to the client callback*/ + CP_PipeDisconnected , /** enumeration of content pipe events sent to the client callback*/ + CP_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + CP_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + CP_EventMax = 0X7FFFFFFF +} CP_EVENTTYPE; + +/** content pipe definition + * @ingroup cp + */ +typedef struct CP_PIPETYPE +{ + /** Open a content stream for reading or writing. */ + CPresult (*Open)( CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess ); + + /** Close a content stream. */ + CPresult (*Close)( CPhandle hContent ); + + /** Create a content source and open it for writing. */ + CPresult (*Create)( CPhandle *hContent, CPstring szURI ); + + /** Check the that specified number of bytes are available for reading or writing (depending on access type).*/ + CPresult (*CheckAvailableBytes)( CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE *eResult ); + + /** Seek to certain position in the content relative to the specified origin. */ + CPresult (*SetPosition)( CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin); + + /** Retrieve the current position relative to the start of the content. */ + CPresult (*GetPosition)( CPhandle hContent, CPuint *pPosition); + + /** Retrieve data of the specified size from the content stream (advance content pointer by size of data). + Note: pipe client provides pointer. This function is appropriate for small high frequency reads. */ + CPresult (*Read)( CPhandle hContent, CPbyte *pData, CPuint nSize); + + /** Retrieve a buffer allocated by the pipe that contains the requested number of bytes. + Buffer contains the next block of bytes, as specified by nSize, of the content. nSize also + returns the size of the block actually read. Content pointer advances the by the returned size. + Note: pipe provides pointer. This function is appropriate for large reads. The client must call + ReleaseReadBuffer when done with buffer. + + In some cases the requested block may not reside in contiguous memory within the + pipe implementation. For instance if the pipe leverages a circular buffer then the requested + block may straddle the boundary of the circular buffer. By default a pipe implementation + performs a copy in this case to provide the block to the pipe client in one contiguous buffer. + If, however, the client sets bForbidCopy, then the pipe returns only those bytes preceding the memory + boundary. Here the client may retrieve the data in segments over successive calls. */ + CPresult (*ReadBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint *nSize, CPbool bForbidCopy); + + /** Release a buffer obtained by ReadBuffer back to the pipe. */ + CPresult (*ReleaseReadBuffer)(CPhandle hContent, CPbyte *pBuffer); + + /** Write data of the specified size to the content (advance content pointer by size of data). + Note: pipe client provides pointer. This function is appropriate for small high frequency writes. */ + CPresult (*Write)( CPhandle hContent, CPbyte *data, CPuint nSize); + + /** Retrieve a buffer allocated by the pipe used to write data to the content. + Client will fill buffer with output data. Note: pipe provides pointer. This function is appropriate + for large writes. The client must call WriteBuffer when done it has filled the buffer with data.*/ + CPresult (*GetWriteBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint nSize); + + /** Deliver a buffer obtained via GetWriteBuffer to the pipe. Pipe will write the + the contents of the buffer to content and advance content pointer by the size of the buffer */ + CPresult (*WriteBuffer)( CPhandle hContent, CPbyte *pBuffer, CPuint nFilledSize); + + /** Register a per-handle client callback with the content pipe. */ + CPresult (*RegisterCallback)( CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam)); + +} CP_PIPETYPE; + +#endif + diff --git a/third_party/openmax/include/OMX_Core.h b/third_party/openmax/include/OMX_Core.h new file mode 100644 index 000000000..52d211f0d --- /dev/null +++ b/third_party/openmax/include/OMX_Core.h @@ -0,0 +1,1440 @@ +/* + * Copyright (c) 2008 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/** OMX_Core.h - OpenMax IL version 1.1.2 + * The OMX_Core header file contains the definitions used by both the + * application and the component to access common items. + */ + +#ifndef OMX_Core_h +#define OMX_Core_h + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +/* Each OMX header shall include all required header files to allow the + * header to compile without errors. The includes below are required + * for this header file to compile successfully + */ + +#include + + +/** The OMX_COMMANDTYPE enumeration is used to specify the action in the + * OMX_SendCommand macro. + * @ingroup core + */ +typedef enum OMX_COMMANDTYPE +{ + OMX_CommandStateSet, /**< Change the component state */ + OMX_CommandFlush, /**< Flush the data queue(s) of a component */ + OMX_CommandPortDisable, /**< Disable a port on a component. */ + OMX_CommandPortEnable, /**< Enable a port on a component. */ + OMX_CommandMarkBuffer, /**< Mark a component/buffer for observation */ + OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_CommandMax = 0X7FFFFFFF +} OMX_COMMANDTYPE; + + + +/** The OMX_STATETYPE enumeration is used to indicate or change the component + * state. This enumeration reflects the current state of the component when + * used with the OMX_GetState macro or becomes the parameter in a state change + * command when used with the OMX_SendCommand macro. + * + * The component will be in the Loaded state after the component is initially + * loaded into memory. In the Loaded state, the component is not allowed to + * allocate or hold resources other than to build it's internal parameter + * and configuration tables. The application will send one or more + * SetParameters/GetParameters and SetConfig/GetConfig commands to the + * component and the component will record each of these parameter and + * configuration changes for use later. When the application sends the + * Idle command, the component will acquire the resources needed for the + * specified configuration and will transition to the idle state if the + * allocation is successful. If the component cannot successfully + * transition to the idle state for any reason, the state of the component + * shall be fully rolled back to the Loaded state (e.g. all allocated + * resources shall be released). When the component receives the command + * to go to the Executing state, it shall begin processing buffers by + * sending all input buffers it holds to the application. While + * the component is in the Idle state, the application may also send the + * Pause command. If the component receives the pause command while in the + * Idle state, the component shall send all input buffers it holds to the + * application, but shall not begin processing buffers. This will allow the + * application to prefill buffers. + * + * @ingroup comp + */ + +typedef enum OMX_STATETYPE +{ + OMX_StateInvalid, /**< component has detected that it's internal data + structures are corrupted to the point that + it cannot determine it's state properly */ + OMX_StateLoaded, /**< component has been loaded but has not completed + initialization. The OMX_SetParameter macro + and the OMX_GetParameter macro are the only + valid macros allowed to be sent to the + component in this state. */ + OMX_StateIdle, /**< component initialization has been completed + successfully and the component is ready to + to start. */ + OMX_StateExecuting, /**< component has accepted the start command and + is processing data (if data is available) */ + OMX_StatePause, /**< component has received pause command */ + OMX_StateWaitForResources, /**< component is waiting for resources, either after + preemption or before it gets the resources requested. + See specification for complete details. */ + OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_StateMax = 0X7FFFFFFF +} OMX_STATETYPE; + +/** The OMX_ERRORTYPE enumeration defines the standard OMX Errors. These + * errors should cover most of the common failure cases. However, + * vendors are free to add additional error messages of their own as + * long as they follow these rules: + * 1. Vendor error messages shall be in the range of 0x90000000 to + * 0x9000FFFF. + * 2. Vendor error messages shall be defined in a header file provided + * with the component. No error messages are allowed that are + * not defined. + */ +typedef enum OMX_ERRORTYPE +{ + OMX_ErrorNone = 0, + + /** There were insufficient resources to perform the requested operation */ + OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000, + + /** There was an error, but the cause of the error could not be determined */ + OMX_ErrorUndefined = (OMX_S32) 0x80001001, + + /** The component name string was not valid */ + OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002, + + /** No component with the specified name string was found */ + OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003, + + /** The component specified did not have a "OMX_ComponentInit" or + "OMX_ComponentDeInit entry point */ + OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004, + + /** One or more parameters were not valid */ + OMX_ErrorBadParameter = (OMX_S32) 0x80001005, + + /** The requested function is not implemented */ + OMX_ErrorNotImplemented = (OMX_S32) 0x80001006, + + /** The buffer was emptied before the next buffer was ready */ + OMX_ErrorUnderflow = (OMX_S32) 0x80001007, + + /** The buffer was not available when it was needed */ + OMX_ErrorOverflow = (OMX_S32) 0x80001008, + + /** The hardware failed to respond as expected */ + OMX_ErrorHardware = (OMX_S32) 0x80001009, + + /** The component is in the state OMX_StateInvalid */ + OMX_ErrorInvalidState = (OMX_S32) 0x8000100A, + + /** Stream is found to be corrupt */ + OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B, + + /** Ports being connected are not compatible */ + OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C, + + /** Resources allocated to an idle component have been + lost resulting in the component returning to the loaded state */ + OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D, + + /** No more indicies can be enumerated */ + OMX_ErrorNoMore = (OMX_S32) 0x8000100E, + + /** The component detected a version mismatch */ + OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F, + + /** The component is not ready to return data at this time */ + OMX_ErrorNotReady = (OMX_S32) 0x80001010, + + /** There was a timeout that occurred */ + OMX_ErrorTimeout = (OMX_S32) 0x80001011, + + /** This error occurs when trying to transition into the state you are already in */ + OMX_ErrorSameState = (OMX_S32) 0x80001012, + + /** Resources allocated to an executing or paused component have been + preempted, causing the component to return to the idle state */ + OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013, + + /** A non-supplier port sends this error to the IL client (via the EventHandler callback) + during the allocation of buffers (on a transition from the LOADED to the IDLE state or + on a port restart) when it deems that it has waited an unusually long time for the supplier + to send it an allocated buffer via a UseBuffer call. */ + OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014, + + /** A non-supplier port sends this error to the IL client (via the EventHandler callback) + during the deallocation of buffers (on a transition from the IDLE to LOADED state or + on a port stop) when it deems that it has waited an unusually long time for the supplier + to request the deallocation of a buffer header via a FreeBuffer call. */ + OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015, + + /** A supplier port sends this error to the IL client (via the EventHandler callback) + during the stopping of a port (either on a transition from the IDLE to LOADED + state or a port stop) when it deems that it has waited an unusually long time for + the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */ + OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016, + + /** Attempting a state transtion that is not allowed */ + OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017, + + /* Attempting a command that is not allowed during the present state. */ + OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018, + + /** The values encapsulated in the parameter or config structure are not supported. */ + OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019, + + /** The parameter or config indicated by the given index is not supported. */ + OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A, + + /** The port index supplied is incorrect. */ + OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B, + + /** The port has lost one or more of its buffers and it thus unpopulated. */ + OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C, + + /** Component suspended due to temporary loss of resources */ + OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D, + + /** Component suspended due to an inability to acquire dynamic resources */ + OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E, + + /** When the macroblock error reporting is enabled the component returns new error + for every frame that has errors */ + OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F, + + /** A component reports this error when it cannot parse or determine the format of an input stream. */ + OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020, + + /** The content open operation failed. */ + OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021, + + /** The content creation operation failed. */ + OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022, + + /** Separate table information is being used */ + OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023, + + /** Tunneling is unsupported by the component*/ + OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024, + + OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_ErrorMax = 0x7FFFFFFF +} OMX_ERRORTYPE; + +/** @ingroup core */ +typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN OMX_HANDLETYPE hComponent); + +/** @ingroup core */ +typedef struct OMX_COMPONENTREGISTERTYPE +{ + const char * pName; /* Component name, 128 byte limit (including '\0') applies */ + OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */ +} OMX_COMPONENTREGISTERTYPE; + +/** @ingroup core */ +extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[]; + +/** @ingroup rpm */ +typedef struct OMX_PRIORITYMGMTTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nGroupPriority; /**< Priority of the component group */ + OMX_U32 nGroupID; /**< ID of the component group */ +} OMX_PRIORITYMGMTTYPE; + +/* Component name and Role names are limited to 128 characters including the terminating '\0'. */ +#define OMX_MAX_STRINGNAME_SIZE 128 + +/** @ingroup comp */ +typedef struct OMX_PARAM_COMPONENTROLETYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE]; /**< name of standard component which defines component role */ +} OMX_PARAM_COMPONENTROLETYPE; + +/** End of Stream Buffer Flag: + * + * A component sets EOS when it has no more data to emit on a particular + * output port. Thus an output port shall set EOS on the last buffer it + * emits. A component's determination of when an output port should + * cease sending data is implemenation specific. + * @ingroup buf + */ + +#define OMX_BUFFERFLAG_EOS 0x00000001 + +/** Start Time Buffer Flag: + * + * The source of a stream (e.g. a demux component) sets the STARTTIME + * flag on the buffer that contains the starting timestamp for the + * stream. The starting timestamp corresponds to the first data that + * should be displayed at startup or after a seek. + * The first timestamp of the stream is not necessarily the start time. + * For instance, in the case of a seek to a particular video frame, + * the target frame may be an interframe. Thus the first buffer of + * the stream will be the intra-frame preceding the target frame and + * the starttime will occur with the target frame (with any other + * required frames required to reconstruct the target intervening). + * + * The STARTTIME flag is directly associated with the buffer's + * timestamp ' thus its association to buffer data and its + * propagation is identical to the timestamp's. + * + * When a Sync Component client receives a buffer with the + * STARTTIME flag it shall perform a SetConfig on its sync port + * using OMX_ConfigTimeClientStartTime and passing the buffer's + * timestamp. + * + * @ingroup buf + */ + +#define OMX_BUFFERFLAG_STARTTIME 0x00000002 + + + +/** Decode Only Buffer Flag: + * + * The source of a stream (e.g. a demux component) sets the DECODEONLY + * flag on any buffer that should shall be decoded but should not be + * displayed. This flag is used, for instance, when a source seeks to + * a target interframe that requires the decode of frames preceding the + * target to facilitate the target's reconstruction. In this case the + * source would emit the frames preceding the target downstream + * but mark them as decode only. + * + * The DECODEONLY is associated with buffer data and propagated in a + * manner identical to the buffer timestamp. + * + * A component that renders data should ignore all buffers with + * the DECODEONLY flag set. + * + * @ingroup buf + */ + +#define OMX_BUFFERFLAG_DECODEONLY 0x00000004 + + +/* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt + * @ingroup buf + */ + +#define OMX_BUFFERFLAG_DATACORRUPT 0x00000008 + +/* End of Frame: The buffer contains exactly one end of frame and no data + * occurs after the end of frame. This flag is an optional hint. The absence + * of this flag does not imply the absence of an end of frame within the buffer. + * @ingroup buf +*/ +#define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010 + +/* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame ' + * a frame that has no dependency on any other frame information + * @ingroup buf + */ +#define OMX_BUFFERFLAG_SYNCFRAME 0x00000020 + +/* Extra data present flag: there is extra data appended to the data stream + * residing in the buffer + * @ingroup buf + */ +#define OMX_BUFFERFLAG_EXTRADATA 0x00000040 + +/** Codec Config Buffer Flag: +* OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an +* output port when all bytes in the buffer form part or all of a set of +* codec specific configuration data. Examples include SPS/PPS nal units +* for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for +* OMX_AUDIO_CodingAAC. Any component that for a given stream sets +* OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes +* with frame data in the same buffer, and shall send all buffers +* containing codec configuration bytes before any buffers containing +* frame data that those configurations bytes describe. +* If the stream format for a particular codec has a frame specific +* header at the start of each frame, for example OMX_AUDIO_CodingMP3 or +* OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as +* normal without setting OMX_BUFFERFLAG_CODECCONFIG. + * @ingroup buf + */ +#define OMX_BUFFERFLAG_CODECCONFIG 0x00000080 + +/* +* OMX_BUFFERFLAG_READONLY: This flag is set when a component emitting the +* buffer on an output port or the IL client wishes to identify the buffer +* payload contents to be read-only. An IL client or an input port +* shall not alter the contents of the buffer. This flag shall only be +* cleared by the originator of the buffer when the buffer is returned. +* For tunneled ports, the usage of this flag shall be allowed only if the +* components negotiated a read-only tunnel +*/ +#define OMX_BUFFERFLAG_READONLY 0x00000200 + +/** @ingroup buf */ +typedef struct OMX_BUFFERHEADERTYPE +{ + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U8* pBuffer; /**< Pointer to actual block of memory + that is acting as the buffer */ + OMX_U32 nAllocLen; /**< size of the buffer allocated, in bytes */ + OMX_U32 nFilledLen; /**< number of bytes currently in the + buffer */ + OMX_U32 nOffset; /**< start offset of valid data in bytes from + the start of the buffer */ + OMX_PTR pAppPrivate; /**< pointer to any data the application + wants to associate with this buffer */ + OMX_PTR pPlatformPrivate; /**< pointer to any data the platform + wants to associate with this buffer */ + OMX_PTR pInputPortPrivate; /**< pointer to any data the input port + wants to associate with this buffer */ + OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port + wants to associate with this buffer */ + OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a + mark event upon processing this buffer. */ + OMX_PTR pMarkData; /**< Application specific data associated with + the mark sent on a mark event to disambiguate + this mark from others. */ + OMX_U32 nTickCount; /**< Optional entry that the component and + application can update with a tick count + when they access the component. This + value should be in microseconds. Since + this is a value relative to an arbitrary + starting point, this value cannot be used + to determine absolute time. This is an + optional entry and not all components + will update it.*/ + OMX_TICKS nTimeStamp; /**< Timestamp corresponding to the sample + starting at the first logical sample + boundary in the buffer. Timestamps of + successive samples within the buffer may + be inferred by adding the duration of the + of the preceding buffer to the timestamp + of the preceding buffer.*/ + OMX_U32 nFlags; /**< buffer specific flags */ + OMX_U32 nOutputPortIndex; /**< The index of the output port (if any) using + this buffer */ + OMX_U32 nInputPortIndex; /**< The index of the input port (if any) using + this buffer */ +} OMX_BUFFERHEADERTYPE; + +/** The OMX_EXTRADATATYPE enumeration is used to define the + * possible extra data payload types. + * NB: this enum is binary backwards compatible with the previous + * OMX_EXTRADATA_QUANT define. This should be replaced with + * OMX_ExtraDataQuantization. + */ +typedef enum OMX_EXTRADATATYPE +{ + OMX_ExtraDataNone = 0, /**< Indicates that no more extra data sections follow */ + OMX_ExtraDataQuantization, /**< The data payload contains quantization data */ + OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_ExtraDataMax = 0x7FFFFFFF +} OMX_EXTRADATATYPE; + + +typedef struct OMX_OTHER_EXTRADATATYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_EXTRADATATYPE eType; /* Extra Data type */ + OMX_U32 nDataSize; /* Size of the supporting data to follow */ + OMX_U8 data[1]; /* Supporting data hint */ +} OMX_OTHER_EXTRADATATYPE; + +/** @ingroup comp */ +typedef struct OMX_PORT_PARAM_TYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPorts; /**< The number of ports for this component */ + OMX_U32 nStartPortNumber; /** first port number for this type of port */ +} OMX_PORT_PARAM_TYPE; + +/** @ingroup comp */ +typedef enum OMX_EVENTTYPE +{ + OMX_EventCmdComplete, /**< component has sucessfully completed a command */ + OMX_EventError, /**< component has detected an error condition */ + OMX_EventMark, /**< component has detected a buffer mark */ + OMX_EventPortSettingsChanged, /**< component is reported a port settings change */ + OMX_EventBufferFlag, /**< component has detected an EOS */ + OMX_EventResourcesAcquired, /**< component has been granted resources and is + automatically starting the state change from + OMX_StateWaitForResources to OMX_StateIdle. */ + OMX_EventComponentResumed, /**< Component resumed due to reacquisition of resources */ + OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */ + OMX_EventPortFormatDetected, /**< Component has detected a supported format. */ + OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_EventMax = 0x7FFFFFFF +} OMX_EVENTTYPE; + +typedef struct OMX_CALLBACKTYPE +{ + /** The EventHandler method is used to notify the application when an + event of interest occurs. Events are defined in the OMX_EVENTTYPE + enumeration. Please see that enumeration for details of what will + be returned for each type of event. Callbacks should not return + an error to the component, so if an error occurs, the application + shall handle it internally. This is a blocking call. + + The application should return from this call within 5 msec to avoid + blocking the component for an excessively long period of time. + + @param hComponent + handle of the component to access. This is the component + handle returned by the call to the GetHandle function. + @param pAppData + pointer to an application defined value that was provided in the + pAppData parameter to the OMX_GetHandle method for the component. + This application defined value is provided so that the application + can have a component specific context when receiving the callback. + @param eEvent + Event that the component wants to notify the application about. + @param nData1 + nData will be the OMX_ERRORTYPE for an error event and will be + an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event. + @param nData2 + nData2 will hold further information related to the event. Can be OMX_STATETYPE for + a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event. + Default value is 0 if not used. ) + @param pEventData + Pointer to additional event-specific data (see spec for meaning). + */ + + OMX_ERRORTYPE (*EventHandler)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_PTR pAppData, + OMX_IN OMX_EVENTTYPE eEvent, + OMX_IN OMX_U32 nData1, + OMX_IN OMX_U32 nData2, + OMX_IN OMX_PTR pEventData); + + /** The EmptyBufferDone method is used to return emptied buffers from an + input port back to the application for reuse. This is a blocking call + so the application should not attempt to refill the buffers during this + call, but should queue them and refill them in another thread. There + is no error return, so the application shall handle any errors generated + internally. + + The application should return from this call within 5 msec. + + @param hComponent + handle of the component to access. This is the component + handle returned by the call to the GetHandle function. + @param pAppData + pointer to an application defined value that was provided in the + pAppData parameter to the OMX_GetHandle method for the component. + This application defined value is provided so that the application + can have a component specific context when receiving the callback. + @param pBuffer + pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer + or AllocateBuffer indicating the buffer that was emptied. + @ingroup buf + */ + OMX_ERRORTYPE (*EmptyBufferDone)( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_PTR pAppData, + OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); + + /** The FillBufferDone method is used to return filled buffers from an + output port back to the application for emptying and then reuse. + This is a blocking call so the application should not attempt to + empty the buffers during this call, but should queue the buffers + and empty them in another thread. There is no error return, so + the application shall handle any errors generated internally. The + application shall also update the buffer header to indicate the + number of bytes placed into the buffer. + + The application should return from this call within 5 msec. + + @param hComponent + handle of the component to access. This is the component + handle returned by the call to the GetHandle function. + @param pAppData + pointer to an application defined value that was provided in the + pAppData parameter to the OMX_GetHandle method for the component. + This application defined value is provided so that the application + can have a component specific context when receiving the callback. + @param pBuffer + pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer + or AllocateBuffer indicating the buffer that was filled. + @ingroup buf + */ + OMX_ERRORTYPE (*FillBufferDone)( + OMX_OUT OMX_HANDLETYPE hComponent, + OMX_OUT OMX_PTR pAppData, + OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer); + +} OMX_CALLBACKTYPE; + +/** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier + preference when tunneling between two ports. + @ingroup tun buf +*/ +typedef enum OMX_BUFFERSUPPLIERTYPE +{ + OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified, + or don't care */ + OMX_BufferSupplyInput, /**< input port supplies the buffers */ + OMX_BufferSupplyOutput, /**< output port supplies the buffers */ + OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_BufferSupplyMax = 0x7FFFFFFF +} OMX_BUFFERSUPPLIERTYPE; + + +/** buffer supplier parameter + * @ingroup tun + */ +typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */ +} OMX_PARAM_BUFFERSUPPLIERTYPE; + + +/**< indicates that buffers received by an input port of a tunnel + may not modify the data in the buffers + @ingroup tun + */ +#define OMX_PORTTUNNELFLAG_READONLY 0x00000001 + + +/** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output + port to an input port as part the two ComponentTunnelRequest calls + resulting from a OMX_SetupTunnel call from the IL Client. + @ingroup tun + */ +typedef struct OMX_TUNNELSETUPTYPE +{ + OMX_U32 nTunnelFlags; /**< bit flags for tunneling */ + OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */ +} OMX_TUNNELSETUPTYPE; + +/* OMX Component headers is included to enable the core to use + macros for functions into the component for OMX release 1.0. + Developers should not access any structures or data from within + the component header directly */ +/* TO BE REMOVED - #include */ + +/** GetComponentVersion will return information about the component. + This is a blocking call. This macro will go directly from the + application to the component (via a core macro). The + component will return from this call within 5 msec. + @param [in] hComponent + handle of component to execute the command + @param [out] pComponentName + pointer to an empty string of length 128 bytes. The component + will write its name into this string. The name will be + terminated by a single zero byte. The name of a component will + be 127 bytes or less to leave room for the trailing zero byte. + An example of a valid component name is "OMX.ABC.ChannelMixer\0". + @param [out] pComponentVersion + pointer to an OMX Version structure that the component will fill + in. The component will fill in a value that indicates the + component version. NOTE: the component version is NOT the same + as the OMX Specification version (found in all structures). The + component version is defined by the vendor of the component and + its value is entirely up to the component vendor. + @param [out] pSpecVersion + pointer to an OMX Version structure that the component will fill + in. The SpecVersion is the version of the specification that the + component was built against. Please note that this value may or + may not match the structure's version. For example, if the + component was built against the 2.0 specification, but the + application (which creates the structure is built against the + 1.0 specification the versions would be different. + @param [out] pComponentUUID + pointer to the UUID of the component which will be filled in by + the component. The UUID is a unique identifier that is set at + RUN time for the component and is unique to each instantion of + the component. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup comp + */ +#define OMX_GetComponentVersion( \ + hComponent, \ + pComponentName, \ + pComponentVersion, \ + pSpecVersion, \ + pComponentUUID) \ + ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion( \ + hComponent, \ + pComponentName, \ + pComponentVersion, \ + pSpecVersion, \ + pComponentUUID) /* Macro End */ + + +/** Send a command to the component. This call is a non-blocking call. + The component should check the parameters and then queue the command + to the component thread to be executed. The component thread shall + send the EventHandler() callback at the conclusion of the command. + This macro will go directly from the application to the component (via + a core macro). The component will return from this call within 5 msec. + + When the command is "OMX_CommandStateSet" the component will queue a + state transition to the new state idenfied in nParam. + + When the command is "OMX_CommandFlush", to flush a port's buffer queues, + the command will force the component to return all buffers NOT CURRENTLY + BEING PROCESSED to the application, in the order in which the buffers + were received. + + When the command is "OMX_CommandPortDisable" or + "OMX_CommandPortEnable", the component's port (given by the value of + nParam) will be stopped or restarted. + + When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the + pCmdData will point to a OMX_MARKTYPE structure containing the component + handle of the component to examine the buffer chain for the mark. nParam1 + contains the index of the port on which the buffer mark is applied. + + Specification text for more details. + + @param [in] hComponent + handle of component to execute the command + @param [in] Cmd + Command for the component to execute + @param [in] nParam + Parameter for the command to be executed. When Cmd has the value + OMX_CommandStateSet, value is a member of OMX_STATETYPE. When Cmd has + the value OMX_CommandFlush, value of nParam indicates which port(s) + to flush. -1 is used to flush all ports a single port index will + only flush that port. When Cmd has the value "OMX_CommandPortDisable" + or "OMX_CommandPortEnable", the component's port is given by + the value of nParam. When Cmd has the value "OMX_CommandMarkBuffer" + the components pot is given by the value of nParam. + @param [in] pCmdData + Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value + "OMX_CommandMarkBuffer". + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup comp + */ +#define OMX_SendCommand( \ + hComponent, \ + Cmd, \ + nParam, \ + pCmdData) \ + ((OMX_COMPONENTTYPE*)hComponent)->SendCommand( \ + hComponent, \ + Cmd, \ + nParam, \ + pCmdData) /* Macro End */ + + +/** The OMX_GetParameter macro will get one of the current parameter + settings from the component. This macro cannot only be invoked when + the component is in the OMX_StateInvalid state. The nParamIndex + parameter is used to indicate which structure is being requested from + the component. The application shall allocate the correct structure + and shall fill in the structure size and version information before + invoking this macro. When the parameter applies to a port, the + caller shall fill in the appropriate nPortIndex value indicating the + port on which the parameter applies. If the component has not had + any settings changed, then the component should return a set of + valid DEFAULT parameters for the component. This is a blocking + call. + + The component should return from this call within 20 msec. + + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the OMX_GetHandle function. + @param [in] nParamIndex + Index of the structure to be filled. This value is from the + OMX_INDEXTYPE enumeration. + @param [in,out] pComponentParameterStructure + Pointer to application allocated structure to be filled by the + component. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup comp + */ +#define OMX_GetParameter( \ + hComponent, \ + nParamIndex, \ + pComponentParameterStructure) \ + ((OMX_COMPONENTTYPE*)hComponent)->GetParameter( \ + hComponent, \ + nParamIndex, \ + pComponentParameterStructure) /* Macro End */ + + +/** The OMX_SetParameter macro will send an initialization parameter + structure to a component. Each structure shall be sent one at a time, + in a separate invocation of the macro. This macro can only be + invoked when the component is in the OMX_StateLoaded state, or the + port is disabled (when the parameter applies to a port). The + nParamIndex parameter is used to indicate which structure is being + passed to the component. The application shall allocate the + correct structure and shall fill in the structure size and version + information (as well as the actual data) before invoking this macro. + The application is free to dispose of this structure after the call + as the component is required to copy any data it shall retain. This + is a blocking call. + + The component should return from this call within 20 msec. + + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the OMX_GetHandle function. + @param [in] nIndex + Index of the structure to be sent. This value is from the + OMX_INDEXTYPE enumeration. + @param [in] pComponentParameterStructure + pointer to application allocated structure to be used for + initialization by the component. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup comp + */ +#define OMX_SetParameter( \ + hComponent, \ + nParamIndex, \ + pComponentParameterStructure) \ + ((OMX_COMPONENTTYPE*)hComponent)->SetParameter( \ + hComponent, \ + nParamIndex, \ + pComponentParameterStructure) /* Macro End */ + + +/** The OMX_GetConfig macro will get one of the configuration structures + from a component. This macro can be invoked anytime after the + component has been loaded. The nParamIndex call parameter is used to + indicate which structure is being requested from the component. The + application shall allocate the correct structure and shall fill in the + structure size and version information before invoking this macro. + If the component has not had this configuration parameter sent before, + then the component should return a set of valid DEFAULT values for the + component. This is a blocking call. + + The component should return from this call within 5 msec. + + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the OMX_GetHandle function. + @param [in] nIndex + Index of the structure to be filled. This value is from the + OMX_INDEXTYPE enumeration. + @param [in,out] pComponentConfigStructure + pointer to application allocated structure to be filled by the + component. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup comp +*/ +#define OMX_GetConfig( \ + hComponent, \ + nConfigIndex, \ + pComponentConfigStructure) \ + ((OMX_COMPONENTTYPE*)hComponent)->GetConfig( \ + hComponent, \ + nConfigIndex, \ + pComponentConfigStructure) /* Macro End */ + + +/** The OMX_SetConfig macro will send one of the configuration + structures to a component. Each structure shall be sent one at a time, + each in a separate invocation of the macro. This macro can be invoked + anytime after the component has been loaded. The application shall + allocate the correct structure and shall fill in the structure size + and version information (as well as the actual data) before invoking + this macro. The application is free to dispose of this structure after + the call as the component is required to copy any data it shall retain. + This is a blocking call. + + The component should return from this call within 5 msec. + + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the OMX_GetHandle function. + @param [in] nConfigIndex + Index of the structure to be sent. This value is from the + OMX_INDEXTYPE enumeration above. + @param [in] pComponentConfigStructure + pointer to application allocated structure to be used for + initialization by the component. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup comp + */ +#define OMX_SetConfig( \ + hComponent, \ + nConfigIndex, \ + pComponentConfigStructure) \ + ((OMX_COMPONENTTYPE*)hComponent)->SetConfig( \ + hComponent, \ + nConfigIndex, \ + pComponentConfigStructure) /* Macro End */ + + +/** The OMX_GetExtensionIndex macro will invoke a component to translate + a vendor specific configuration or parameter string into an OMX + structure index. There is no requirement for the vendor to support + this command for the indexes already found in the OMX_INDEXTYPE + enumeration (this is done to save space in small components). The + component shall support all vendor supplied extension indexes not found + in the master OMX_INDEXTYPE enumeration. This is a blocking call. + + The component should return from this call within 5 msec. + + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the GetHandle function. + @param [in] cParameterName + OMX_STRING that shall be less than 128 characters long including + the trailing null byte. This is the string that will get + translated by the component into a configuration index. + @param [out] pIndexType + a pointer to a OMX_INDEXTYPE to receive the index value. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup comp + */ +#define OMX_GetExtensionIndex( \ + hComponent, \ + cParameterName, \ + pIndexType) \ + ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex( \ + hComponent, \ + cParameterName, \ + pIndexType) /* Macro End */ + + +/** The OMX_GetState macro will invoke the component to get the current + state of the component and place the state value into the location + pointed to by pState. + + The component should return from this call within 5 msec. + + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the OMX_GetHandle function. + @param [out] pState + pointer to the location to receive the state. The value returned + is one of the OMX_STATETYPE members + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup comp + */ +#define OMX_GetState( \ + hComponent, \ + pState) \ + ((OMX_COMPONENTTYPE*)hComponent)->GetState( \ + hComponent, \ + pState) /* Macro End */ + + +/** The OMX_UseBuffer macro will request that the component use + a buffer (and allocate its own buffer header) already allocated + by another component, or by the IL Client. This is a blocking + call. + + The component should return from this call within 20 msec. + + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the OMX_GetHandle function. + @param [out] ppBuffer + pointer to an OMX_BUFFERHEADERTYPE structure used to receive the + pointer to the buffer header + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup comp buf + */ + +#define OMX_UseBuffer( \ + hComponent, \ + ppBufferHdr, \ + nPortIndex, \ + pAppPrivate, \ + nSizeBytes, \ + pBuffer) \ + ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer( \ + hComponent, \ + ppBufferHdr, \ + nPortIndex, \ + pAppPrivate, \ + nSizeBytes, \ + pBuffer) + + +/** The OMX_AllocateBuffer macro will request that the component allocate + a new buffer and buffer header. The component will allocate the + buffer and the buffer header and return a pointer to the buffer + header. This is a blocking call. + + The component should return from this call within 5 msec. + + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the OMX_GetHandle function. + @param [out] ppBuffer + pointer to an OMX_BUFFERHEADERTYPE structure used to receive + the pointer to the buffer header + @param [in] nPortIndex + nPortIndex is used to select the port on the component the buffer will + be used with. The port can be found by using the nPortIndex + value as an index into the Port Definition array of the component. + @param [in] pAppPrivate + pAppPrivate is used to initialize the pAppPrivate member of the + buffer header structure. + @param [in] nSizeBytes + size of the buffer to allocate. Used when bAllocateNew is true. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup comp buf + */ +#define OMX_AllocateBuffer( \ + hComponent, \ + ppBuffer, \ + nPortIndex, \ + pAppPrivate, \ + nSizeBytes) \ + ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer( \ + hComponent, \ + ppBuffer, \ + nPortIndex, \ + pAppPrivate, \ + nSizeBytes) /* Macro End */ + + +/** The OMX_FreeBuffer macro will release a buffer header from the component + which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If + the component allocated the buffer (see the OMX_UseBuffer macro) then + the component shall free the buffer and buffer header. This is a + blocking call. + + The component should return from this call within 20 msec. + + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the OMX_GetHandle function. + @param [in] nPortIndex + nPortIndex is used to select the port on the component the buffer will + be used with. + @param [in] pBuffer + pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer + or AllocateBuffer. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup comp buf + */ +#define OMX_FreeBuffer( \ + hComponent, \ + nPortIndex, \ + pBuffer) \ + ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer( \ + hComponent, \ + nPortIndex, \ + pBuffer) /* Macro End */ + + +/** The OMX_EmptyThisBuffer macro will send a buffer full of data to an + input port of a component. The buffer will be emptied by the component + and returned to the application via the EmptyBufferDone call back. + This is a non-blocking call in that the component will record the buffer + and return immediately and then empty the buffer, later, at the proper + time. As expected, this macro may be invoked only while the component + is in the OMX_StateExecuting. If nPortIndex does not specify an input + port, the component shall return an error. + + The component should return from this call within 5 msec. + + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the OMX_GetHandle function. + @param [in] pBuffer + pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer + or AllocateBuffer. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup comp buf + */ +#define OMX_EmptyThisBuffer( \ + hComponent, \ + pBuffer) \ + ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer( \ + hComponent, \ + pBuffer) /* Macro End */ + + +/** The OMX_FillThisBuffer macro will send an empty buffer to an + output port of a component. The buffer will be filled by the component + and returned to the application via the FillBufferDone call back. + This is a non-blocking call in that the component will record the buffer + and return immediately and then fill the buffer, later, at the proper + time. As expected, this macro may be invoked only while the component + is in the OMX_ExecutingState. If nPortIndex does not specify an output + port, the component shall return an error. + + The component should return from this call within 5 msec. + + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the OMX_GetHandle function. + @param [in] pBuffer + pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer + or AllocateBuffer. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup comp buf + */ +#define OMX_FillThisBuffer( \ + hComponent, \ + pBuffer) \ + ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer( \ + hComponent, \ + pBuffer) /* Macro End */ + + + +/** The OMX_UseEGLImage macro will request that the component use + a EGLImage provided by EGL (and allocate its own buffer header) + This is a blocking call. + + The component should return from this call within 20 msec. + + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the OMX_GetHandle function. + @param [out] ppBuffer + pointer to an OMX_BUFFERHEADERTYPE structure used to receive the + pointer to the buffer header. Note that the memory location used + for this buffer is NOT visible to the IL Client. + @param [in] nPortIndex + nPortIndex is used to select the port on the component the buffer will + be used with. The port can be found by using the nPortIndex + value as an index into the Port Definition array of the component. + @param [in] pAppPrivate + pAppPrivate is used to initialize the pAppPrivate member of the + buffer header structure. + @param [in] eglImage + eglImage contains the handle of the EGLImage to use as a buffer on the + specified port. The component is expected to validate properties of + the EGLImage against the configuration of the port to ensure the component + can use the EGLImage as a buffer. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup comp buf + */ +#define OMX_UseEGLImage( \ + hComponent, \ + ppBufferHdr, \ + nPortIndex, \ + pAppPrivate, \ + eglImage) \ + ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage( \ + hComponent, \ + ppBufferHdr, \ + nPortIndex, \ + pAppPrivate, \ + eglImage) + +/** The OMX_Init method is used to initialize the OMX core. It shall be the + first call made into OMX and it should only be executed one time without + an interviening OMX_Deinit call. + + The core should return from this call within 20 msec. + + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup core + */ +OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void); + + +/** The OMX_Deinit method is used to deinitialize the OMX core. It shall be + the last call made into OMX. In the event that the core determines that + thare are components loaded when this call is made, the core may return + with an error rather than try to unload the components. + + The core should return from this call within 20 msec. + + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup core + */ +OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void); + + +/** The OMX_ComponentNameEnum method will enumerate through all the names of + recognised valid components in the system. This function is provided + as a means to detect all the components in the system run-time. There is + no strict ordering to the enumeration order of component names, although + each name will only be enumerated once. If the OMX core supports run-time + installation of new components, it is only requried to detect newly + installed components when the first call to enumerate component names + is made (i.e. when nIndex is 0x0). + + The core should return from this call in 20 msec. + + @param [out] cComponentName + pointer to a null terminated string with the component name. The + names of the components are strings less than 127 bytes in length + plus the trailing null for a maximum size of 128 bytes. An example + of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are + assigned by the vendor, but shall start with "OMX." and then have + the Vendor designation next. + @param [in] nNameLength + number of characters in the cComponentName string. With all + component name strings restricted to less than 128 characters + (including the trailing null) it is recomended that the caller + provide a input string for the cComponentName of 128 characters. + @param [in] nIndex + number containing the enumeration index for the component. + Multiple calls to OMX_ComponentNameEnum with increasing values + of nIndex will enumerate through the component names in the + system until OMX_ErrorNoMore is returned. The value of nIndex + is 0 to (N-1), where N is the number of valid installed components + in the system. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. When the value of nIndex exceeds the number of + components in the system minus 1, OMX_ErrorNoMore will be + returned. Otherwise the appropriate OMX error will be returned. + @ingroup core + */ +OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum( + OMX_OUT OMX_STRING cComponentName, + OMX_IN OMX_U32 nNameLength, + OMX_IN OMX_U32 nIndex); + + +/** The OMX_GetHandle method will locate the component specified by the + component name given, load that component into memory and then invoke + the component's methods to create an instance of the component. + + The core should return from this call within 20 msec. + + @param [out] pHandle + pointer to an OMX_HANDLETYPE pointer to be filled in by this method. + @param [in] cComponentName + pointer to a null terminated string with the component name. The + names of the components are strings less than 127 bytes in length + plus the trailing null for a maximum size of 128 bytes. An example + of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are + assigned by the vendor, but shall start with "OMX." and then have + the Vendor designation next. + @param [in] pAppData + pointer to an application defined value that will be returned + during callbacks so that the application can identify the source + of the callback. + @param [in] pCallBacks + pointer to a OMX_CALLBACKTYPE structure that will be passed to the + component to initialize it with. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup core + */ +OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle( + OMX_OUT OMX_HANDLETYPE* pHandle, + OMX_IN OMX_STRING cComponentName, + OMX_IN OMX_PTR pAppData, + OMX_IN OMX_CALLBACKTYPE* pCallBacks); + + +/** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle + method. If the component reference count goes to zero, the component will + be unloaded from memory. + + The core should return from this call within 20 msec when the component is + in the OMX_StateLoaded state. + + @param [in] hComponent + Handle of the component to be accessed. This is the component + handle returned by the call to the GetHandle function. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + @ingroup core + */ +OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle( + OMX_IN OMX_HANDLETYPE hComponent); + + + +/** The OMX_SetupTunnel method will handle the necessary calls to the components + to setup the specified tunnel the two components. NOTE: This is + an actual method (not a #define macro). This method will make calls into + the component ComponentTunnelRequest method to do the actual tunnel + connection. + + The ComponentTunnelRequest method on both components will be called. + This method shall not be called unless the component is in the + OMX_StateLoaded state except when the ports used for the tunnel are + disabled. In this case, the component may be in the OMX_StateExecuting, + OMX_StatePause, or OMX_StateIdle states. + + The core should return from this call within 20 msec. + + @param [in] hOutput + Handle of the component to be accessed. Also this is the handle + of the component whose port, specified in the nPortOutput parameter + will be used the source for the tunnel. This is the component handle + returned by the call to the OMX_GetHandle function. There is a + requirement that hOutput be the source for the data when + tunelling (i.e. nPortOutput is an output port). If 0x0, the component + specified in hInput will have it's port specified in nPortInput + setup for communication with the application / IL client. + @param [in] nPortOutput + nPortOutput is used to select the source port on component to be + used in the tunnel. + @param [in] hInput + This is the component to setup the tunnel with. This is the handle + of the component whose port, specified in the nPortInput parameter + will be used the destination for the tunnel. This is the component handle + returned by the call to the OMX_GetHandle function. There is a + requirement that hInput be the destination for the data when + tunelling (i.e. nPortInut is an input port). If 0x0, the component + specified in hOutput will have it's port specified in nPortPOutput + setup for communication with the application / IL client. + @param [in] nPortInput + nPortInput is used to select the destination port on component to be + used in the tunnel. + @return OMX_ERRORTYPE + If the command successfully executes, the return code will be + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. + When OMX_ErrorNotImplemented is returned, one or both components is + a non-interop component and does not support tunneling. + + On failure, the ports of both components are setup for communication + with the application / IL Client. + @ingroup core tun + */ +OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel( + OMX_IN OMX_HANDLETYPE hOutput, + OMX_IN OMX_U32 nPortOutput, + OMX_IN OMX_HANDLETYPE hInput, + OMX_IN OMX_U32 nPortInput); + +/** @ingroup cp */ +OMX_API OMX_ERRORTYPE OMX_GetContentPipe( + OMX_OUT OMX_HANDLETYPE *hPipe, + OMX_IN OMX_STRING szURI); + +/** The OMX_GetComponentsOfRole method will return the number of components that support the given + role and (if the compNames field is non-NULL) the names of those components. The call will fail if + an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the + client should: + * first call this function with the compNames field NULL to determine the number of component names + * second call this function with the compNames field pointing to an array of names allocated + according to the number returned by the first call. + + The core should return from this call within 5 msec. + + @param [in] role + This is generic standard component name consisting only of component class + name and the type within that class (e.g. 'audio_decoder.aac'). + @param [inout] pNumComps + This is used both as input and output. + + If compNames is NULL, the input is ignored and the output specifies how many components support + the given role. + + If compNames is not NULL, on input it bounds the size of the input structure and + on output, it specifies the number of components string names listed within the compNames parameter. + @param [inout] compNames + If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts + a list of the names of all physical components that implement the specified standard component name. + Each name is NULL terminated. numComps indicates the number of names. + @ingroup core + */ +OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole ( + OMX_IN OMX_STRING role, + OMX_INOUT OMX_U32 *pNumComps, + OMX_INOUT OMX_U8 **compNames); + +/** The OMX_GetRolesOfComponent method will return the number of roles supported by the given + component and (if the roles field is non-NULL) the names of those roles. The call will fail if + an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the + client should: + * first call this function with the roles field NULL to determine the number of role names + * second call this function with the roles field pointing to an array of names allocated + according to the number returned by the first call. + + The core should return from this call within 5 msec. + + @param [in] compName + This is the name of the component being queried about. + @param [inout] pNumRoles + This is used both as input and output. + + If roles is NULL, the input is ignored and the output specifies how many roles the component supports. + + If compNames is not NULL, on input it bounds the size of the input structure and + on output, it specifies the number of roles string names listed within the roles parameter. + @param [out] roles + If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings + which accepts a list of the names of all standard components roles implemented on the + specified component name. numComps indicates the number of names. + @ingroup core + */ +OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent ( + OMX_IN OMX_STRING compName, + OMX_INOUT OMX_U32 *pNumRoles, + OMX_OUT OMX_U8 **roles); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif +/* File EOF */ + diff --git a/third_party/openmax/include/OMX_CoreExt.h b/third_party/openmax/include/OMX_CoreExt.h new file mode 100644 index 000000000..3ec14b05f --- /dev/null +++ b/third_party/openmax/include/OMX_CoreExt.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2009 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/** OMX_CoreExt.h - OpenMax IL version 1.1.2 + * The OMX_CoreExt header file contains extensions to the definitions used + * by both the application and the component to access common items. + */ + +#ifndef OMX_CoreExt_h +#define OMX_CoreExt_h + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Each OMX header shall include all required header files to allow the + * header to compile without errors. The includes below are required + * for this header file to compile successfully + */ +#include + + +/** Event type extensions. */ +typedef enum OMX_EVENTEXTTYPE +{ + OMX_EventIndexSettingChanged = OMX_EventKhronosExtensions, /**< component signals the IL client of a change + in a param, config, or extension */ + OMX_EventExtMax = 0x7FFFFFFF +} OMX_EVENTEXTTYPE; + + +/** Enable or disable a callback event. */ +typedef struct OMX_CONFIG_CALLBACKREQUESTTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_INDEXTYPE nIndex; /**< the index the callback is requested for */ + OMX_BOOL bEnable; /**< enable (OMX_TRUE) or disable (OMX_FALSE) the callback */ +} OMX_CONFIG_CALLBACKREQUESTTYPE; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* OMX_CoreExt_h */ +/* File EOF */ diff --git a/third_party/openmax/include/OMX_IVCommon.h b/third_party/openmax/include/OMX_IVCommon.h new file mode 100644 index 000000000..ec717565a --- /dev/null +++ b/third_party/openmax/include/OMX_IVCommon.h @@ -0,0 +1,933 @@ +/** + * Copyright (c) 2008 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/** + * @file OMX_IVCommon.h - OpenMax IL version 1.1.2 + * The structures needed by Video and Image components to exchange + * parameters and configuration data with the components. + */ +#ifndef OMX_IVCommon_h +#define OMX_IVCommon_h + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * Each OMX header must include all required header files to allow the header + * to compile without errors. The includes below are required for this header + * file to compile successfully + */ + +#include + +/** @defgroup iv OpenMAX IL Imaging and Video Domain + * Common structures for OpenMAX IL Imaging and Video domains + * @{ + */ + + +/** + * Enumeration defining possible uncompressed image/video formats. + * + * ENUMS: + * Unused : Placeholder value when format is N/A + * Monochrome : black and white + * 8bitRGB332 : Red 7:5, Green 4:2, Blue 1:0 + * 12bitRGB444 : Red 11:8, Green 7:4, Blue 3:0 + * 16bitARGB4444 : Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0 + * 16bitARGB1555 : Alpha 15, Red 14:10, Green 9:5, Blue 4:0 + * 16bitRGB565 : Red 15:11, Green 10:5, Blue 4:0 + * 16bitBGR565 : Blue 15:11, Green 10:5, Red 4:0 + * 18bitRGB666 : Red 17:12, Green 11:6, Blue 5:0 + * 18bitARGB1665 : Alpha 17, Red 16:11, Green 10:5, Blue 4:0 + * 19bitARGB1666 : Alpha 18, Red 17:12, Green 11:6, Blue 5:0 + * 24bitRGB888 : Red 24:16, Green 15:8, Blue 7:0 + * 24bitBGR888 : Blue 24:16, Green 15:8, Red 7:0 + * 24bitARGB1887 : Alpha 23, Red 22:15, Green 14:7, Blue 6:0 + * 25bitARGB1888 : Alpha 24, Red 23:16, Green 15:8, Blue 7:0 + * 32bitBGRA8888 : Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0 + * 32bitARGB8888 : Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0 + * YUV411Planar : U,Y are subsampled by a factor of 4 horizontally + * YUV411PackedPlanar : packed per payload in planar slices + * YUV420Planar : Three arrays Y,U,V. + * YUV420PackedPlanar : packed per payload in planar slices + * YUV420SemiPlanar : Two arrays, one is all Y, the other is U and V + * YUV422Planar : Three arrays Y,U,V. + * YUV422PackedPlanar : packed per payload in planar slices + * YUV422SemiPlanar : Two arrays, one is all Y, the other is U and V + * YCbYCr : Organized as 16bit YUYV (i.e. YCbYCr) + * YCrYCb : Organized as 16bit YVYU (i.e. YCrYCb) + * CbYCrY : Organized as 16bit UYVY (i.e. CbYCrY) + * CrYCbY : Organized as 16bit VYUY (i.e. CrYCbY) + * YUV444Interleaved : Each pixel contains equal parts YUV + * RawBayer8bit : SMIA camera output format + * RawBayer10bit : SMIA camera output format + * RawBayer8bitcompressed : SMIA camera output format + */ +typedef enum OMX_COLOR_FORMATTYPE { + OMX_COLOR_FormatUnused, + OMX_COLOR_FormatMonochrome, + OMX_COLOR_Format8bitRGB332, + OMX_COLOR_Format12bitRGB444, + OMX_COLOR_Format16bitARGB4444, + OMX_COLOR_Format16bitARGB1555, + OMX_COLOR_Format16bitRGB565, + OMX_COLOR_Format16bitBGR565, + OMX_COLOR_Format18bitRGB666, + OMX_COLOR_Format18bitARGB1665, + OMX_COLOR_Format19bitARGB1666, + OMX_COLOR_Format24bitRGB888, + OMX_COLOR_Format24bitBGR888, + OMX_COLOR_Format24bitARGB1887, + OMX_COLOR_Format25bitARGB1888, + OMX_COLOR_Format32bitBGRA8888, + OMX_COLOR_Format32bitARGB8888, + OMX_COLOR_FormatYUV411Planar, + OMX_COLOR_FormatYUV411PackedPlanar, + OMX_COLOR_FormatYUV420Planar, + OMX_COLOR_FormatYUV420PackedPlanar, + OMX_COLOR_FormatYUV420SemiPlanar, + OMX_COLOR_FormatYUV422Planar, + OMX_COLOR_FormatYUV422PackedPlanar, + OMX_COLOR_FormatYUV422SemiPlanar, + OMX_COLOR_FormatYCbYCr, + OMX_COLOR_FormatYCrYCb, + OMX_COLOR_FormatCbYCrY, + OMX_COLOR_FormatCrYCbY, + OMX_COLOR_FormatYUV444Interleaved, + OMX_COLOR_FormatRawBayer8bit, + OMX_COLOR_FormatRawBayer10bit, + OMX_COLOR_FormatRawBayer8bitcompressed, + OMX_COLOR_FormatL2, + OMX_COLOR_FormatL4, + OMX_COLOR_FormatL8, + OMX_COLOR_FormatL16, + OMX_COLOR_FormatL24, + OMX_COLOR_FormatL32, + OMX_COLOR_FormatYUV420PackedSemiPlanar, + OMX_COLOR_FormatYUV422PackedSemiPlanar, + OMX_COLOR_Format18BitBGR666, + OMX_COLOR_Format24BitARGB6666, + OMX_COLOR_Format24BitABGR6666, + OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + /** + +/** @defgroup imaging OpenMAX IL Imaging Domain + * @ingroup iv + * Structures for OpenMAX IL Imaging domain + * @{ + */ + +/** + * Enumeration used to define the possible image compression coding. + */ +typedef enum OMX_IMAGE_CODINGTYPE { + OMX_IMAGE_CodingUnused, /**< Value when format is N/A */ + OMX_IMAGE_CodingAutoDetect, /**< Auto detection of image format */ + OMX_IMAGE_CodingJPEG, /**< JPEG/JFIF image format */ + OMX_IMAGE_CodingJPEG2K, /**< JPEG 2000 image format */ + OMX_IMAGE_CodingEXIF, /**< EXIF image format */ + OMX_IMAGE_CodingTIFF, /**< TIFF image format */ + OMX_IMAGE_CodingGIF, /**< Graphics image format */ + OMX_IMAGE_CodingPNG, /**< PNG image format */ + OMX_IMAGE_CodingLZW, /**< LZW image format */ + OMX_IMAGE_CodingBMP, /**< Windows Bitmap format */ + OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_IMAGE_CodingMax = 0x7FFFFFFF +} OMX_IMAGE_CODINGTYPE; + + +/** + * Data structure used to define an image path. The number of image paths + * for input and output will vary by type of the image component. + * + * Input (aka Source) : Zero Inputs, one Output, + * Splitter : One Input, 2 or more Outputs, + * Processing Element : One Input, one output, + * Mixer : 2 or more inputs, one output, + * Output (aka Sink) : One Input, zero outputs. + * + * The PortDefinition structure is used to define all of the parameters + * necessary for the compliant component to setup an input or an output + * image path. If additional vendor specific data is required, it should + * be transmitted to the component using the CustomCommand function. + * Compliant components will prepopulate this structure with optimal + * values during the OMX_GetParameter() command. + * + * STRUCT MEMBERS: + * cMIMEType : MIME type of data for the port + * pNativeRender : Platform specific reference for a display if a + * sync, otherwise this field is 0 + * nFrameWidth : Width of frame to be used on port if + * uncompressed format is used. Use 0 for + * unknown, don't care or variable + * nFrameHeight : Height of frame to be used on port if + * uncompressed format is used. Use 0 for + * unknown, don't care or variable + * nStride : Number of bytes per span of an image (i.e. + * indicates the number of bytes to get from + * span N to span N+1, where negative stride + * indicates the image is bottom up + * nSliceHeight : Height used when encoding in slices + * bFlagErrorConcealment : Turns on error concealment if it is supported by + * the OMX component + * eCompressionFormat : Compression format used in this instance of + * the component. When OMX_IMAGE_CodingUnused is + * specified, eColorFormat is valid + * eColorFormat : Decompressed format used by this component + * pNativeWindow : Platform specific reference for a window object if a + * display sink , otherwise this field is 0x0. + */ +typedef struct OMX_IMAGE_PORTDEFINITIONTYPE { + OMX_STRING cMIMEType; + OMX_NATIVE_DEVICETYPE pNativeRender; + OMX_U32 nFrameWidth; + OMX_U32 nFrameHeight; + OMX_S32 nStride; + OMX_U32 nSliceHeight; + OMX_BOOL bFlagErrorConcealment; + OMX_IMAGE_CODINGTYPE eCompressionFormat; + OMX_COLOR_FORMATTYPE eColorFormat; + OMX_NATIVE_WINDOWTYPE pNativeWindow; +} OMX_IMAGE_PORTDEFINITIONTYPE; + + +/** + * Port format parameter. This structure is used to enumerate the various + * data input/output format supported by the port. + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Indicates which port to set + * nIndex : Indicates the enumeration index for the format from + * 0x0 to N-1 + * eCompressionFormat : Compression format used in this instance of the + * component. When OMX_IMAGE_CodingUnused is specified, + * eColorFormat is valid + * eColorFormat : Decompressed format used by this component + */ +typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nIndex; + OMX_IMAGE_CODINGTYPE eCompressionFormat; + OMX_COLOR_FORMATTYPE eColorFormat; +} OMX_IMAGE_PARAM_PORTFORMATTYPE; + + +/** + * Flash control type + * + * ENUMS + * Torch : Flash forced constantly on + */ +typedef enum OMX_IMAGE_FLASHCONTROLTYPE { + OMX_IMAGE_FlashControlOn = 0, + OMX_IMAGE_FlashControlOff, + OMX_IMAGE_FlashControlAuto, + OMX_IMAGE_FlashControlRedEyeReduction, + OMX_IMAGE_FlashControlFillin, + OMX_IMAGE_FlashControlTorch, + OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_IMAGE_FlashControlMax = 0x7FFFFFFF +} OMX_IMAGE_FLASHCONTROLTYPE; + + +/** + * Flash control configuration + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * eFlashControl : Flash control type + */ +typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_IMAGE_FLASHCONTROLTYPE eFlashControl; +} OMX_IMAGE_PARAM_FLASHCONTROLTYPE; + + +/** + * Focus control type + */ +typedef enum OMX_IMAGE_FOCUSCONTROLTYPE { + OMX_IMAGE_FocusControlOn = 0, + OMX_IMAGE_FocusControlOff, + OMX_IMAGE_FocusControlAuto, + OMX_IMAGE_FocusControlAutoLock, + OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_IMAGE_FocusControlMax = 0x7FFFFFFF +} OMX_IMAGE_FOCUSCONTROLTYPE; + + +/** + * Focus control configuration + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * eFocusControl : Focus control + * nFocusSteps : Focus can take on values from 0 mm to infinity. + * Interest is only in number of steps over this range. + * nFocusStepIndex : Current focus step index + */ +typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl; + OMX_U32 nFocusSteps; + OMX_U32 nFocusStepIndex; +} OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE; + + +/** + * Q Factor for JPEG compression, which controls the tradeoff between image + * quality and size. Q Factor provides a more simple means of controlling + * JPEG compression quality, without directly programming Quantization + * tables for chroma and luma + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * nQFactor : JPEG Q factor value in the range of 1-100. A factor of 1 + * produces the smallest, worst quality images, and a factor + * of 100 produces the largest, best quality images. A + * typical default is 75 for small good quality images + */ +typedef struct OMX_IMAGE_PARAM_QFACTORTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nQFactor; +} OMX_IMAGE_PARAM_QFACTORTYPE; + +/** + * Quantization table type + */ + +typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE { + OMX_IMAGE_QuantizationTableLuma = 0, + OMX_IMAGE_QuantizationTableChroma, + OMX_IMAGE_QuantizationTableChromaCb, + OMX_IMAGE_QuantizationTableChromaCr, + OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF +} OMX_IMAGE_QUANTIZATIONTABLETYPE; + +/** + * JPEG quantization tables are used to determine DCT compression for + * YUV data, as an alternative to specifying Q factor, providing exact + * control of compression + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * eQuantizationTable : Quantization table type + * nQuantizationMatrix[64] : JPEG quantization table of coefficients stored + * in increasing columns then by rows of data (i.e. + * row 1, ... row 8). Quantization values are in + * the range 0-255 and stored in linear order + * (i.e. the component will zig-zag the + * quantization table data if required internally) + */ +typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable; + OMX_U8 nQuantizationMatrix[64]; +} OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE; + + +/** + * Huffman table type, the same Huffman table is applied for chroma and + * luma component + */ +typedef enum OMX_IMAGE_HUFFMANTABLETYPE { + OMX_IMAGE_HuffmanTableAC = 0, + OMX_IMAGE_HuffmanTableDC, + OMX_IMAGE_HuffmanTableACLuma, + OMX_IMAGE_HuffmanTableACChroma, + OMX_IMAGE_HuffmanTableDCLuma, + OMX_IMAGE_HuffmanTableDCChroma, + OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF +} OMX_IMAGE_HUFFMANTABLETYPE; + +/** + * JPEG Huffman table + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * eHuffmanTable : Huffman table type + * nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each + * possible length + * nHuffmanTable[256] : 0-255, the size used for AC and DC + * HuffmanTable are 16 and 162 + */ +typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable; + OMX_U8 nNumberOfHuffmanCodeOfLength[16]; + OMX_U8 nHuffmanTable[256]; +}OMX_IMAGE_PARAM_HUFFMANTTABLETYPE; + +/** @} */ +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif +/* File EOF */ diff --git a/third_party/openmax/include/OMX_Index.h b/third_party/openmax/include/OMX_Index.h new file mode 100644 index 000000000..a1f17487d --- /dev/null +++ b/third_party/openmax/include/OMX_Index.h @@ -0,0 +1,259 @@ +/* + * Copyright (c) 2008 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/** @file OMX_Index.h - OpenMax IL version 1.1.2 + * The OMX_Index header file contains the definitions for both applications + * and components . + */ + + +#ifndef OMX_Index_h +#define OMX_Index_h + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +/* Each OMX header must include all required header files to allow the + * header to compile without errors. The includes below are required + * for this header file to compile successfully + */ +#include + + +/** The OMX_INDEXTYPE enumeration is used to select a structure when either + * getting or setting parameters and/or configuration data. Each entry in + * this enumeration maps to an OMX specified structure. When the + * OMX_GetParameter, OMX_SetParameter, OMX_GetConfig or OMX_SetConfig methods + * are used, the second parameter will always be an entry from this enumeration + * and the third entry will be the structure shown in the comments for the entry. + * For example, if the application is initializing a cropping function, the + * OMX_SetConfig command would have OMX_IndexConfigCommonInputCrop as the second parameter + * and would send a pointer to an initialized OMX_RECTTYPE structure as the + * third parameter. + * + * The enumeration entries named with the OMX_Config prefix are sent using + * the OMX_SetConfig command and the enumeration entries named with the + * OMX_PARAM_ prefix are sent using the OMX_SetParameter command. + */ +typedef enum OMX_INDEXTYPE { + + OMX_IndexComponentStartUnused = 0x01000000, + OMX_IndexParamPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */ + OMX_IndexParamAudioInit, /**< reference: OMX_PORT_PARAM_TYPE */ + OMX_IndexParamImageInit, /**< reference: OMX_PORT_PARAM_TYPE */ + OMX_IndexParamVideoInit, /**< reference: OMX_PORT_PARAM_TYPE */ + OMX_IndexParamOtherInit, /**< reference: OMX_PORT_PARAM_TYPE */ + OMX_IndexParamNumAvailableStreams, /**< reference: OMX_PARAM_U32TYPE */ + OMX_IndexParamActiveStream, /**< reference: OMX_PARAM_U32TYPE */ + OMX_IndexParamSuspensionPolicy, /**< reference: OMX_PARAM_SUSPENSIONPOLICYTYPE */ + OMX_IndexParamComponentSuspended, /**< reference: OMX_PARAM_SUSPENSIONTYPE */ + OMX_IndexConfigCapturing, /**< reference: OMX_CONFIG_BOOLEANTYPE */ + OMX_IndexConfigCaptureMode, /**< reference: OMX_CONFIG_CAPTUREMODETYPE */ + OMX_IndexAutoPauseAfterCapture, /**< reference: OMX_CONFIG_BOOLEANTYPE */ + OMX_IndexParamContentURI, /**< reference: OMX_PARAM_CONTENTURITYPE */ + OMX_IndexParamCustomContentPipe, /**< reference: OMX_PARAM_CONTENTPIPETYPE */ + OMX_IndexParamDisableResourceConcealment, /**< reference: OMX_RESOURCECONCEALMENTTYPE */ + OMX_IndexConfigMetadataItemCount, /**< reference: OMX_CONFIG_METADATAITEMCOUNTTYPE */ + OMX_IndexConfigContainerNodeCount, /**< reference: OMX_CONFIG_CONTAINERNODECOUNTTYPE */ + OMX_IndexConfigMetadataItem, /**< reference: OMX_CONFIG_METADATAITEMTYPE */ + OMX_IndexConfigCounterNodeID, /**< reference: OMX_CONFIG_CONTAINERNODEIDTYPE */ + OMX_IndexParamMetadataFilterType, /**< reference: OMX_PARAM_METADATAFILTERTYPE */ + OMX_IndexParamMetadataKeyFilter, /**< reference: OMX_PARAM_METADATAFILTERTYPE */ + OMX_IndexConfigPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */ + OMX_IndexParamStandardComponentRole, /**< reference: OMX_PARAM_COMPONENTROLETYPE */ + + OMX_IndexPortStartUnused = 0x02000000, + OMX_IndexParamPortDefinition, /**< reference: OMX_PARAM_PORTDEFINITIONTYPE */ + OMX_IndexParamCompBufferSupplier, /**< reference: OMX_PARAM_BUFFERSUPPLIERTYPE */ + OMX_IndexReservedStartUnused = 0x03000000, + + /* Audio parameters and configurations */ + OMX_IndexAudioStartUnused = 0x04000000, + OMX_IndexParamAudioPortFormat, /**< reference: OMX_AUDIO_PARAM_PORTFORMATTYPE */ + OMX_IndexParamAudioPcm, /**< reference: OMX_AUDIO_PARAM_PCMMODETYPE */ + OMX_IndexParamAudioAac, /**< reference: OMX_AUDIO_PARAM_AACPROFILETYPE */ + OMX_IndexParamAudioRa, /**< reference: OMX_AUDIO_PARAM_RATYPE */ + OMX_IndexParamAudioMp3, /**< reference: OMX_AUDIO_PARAM_MP3TYPE */ + OMX_IndexParamAudioAdpcm, /**< reference: OMX_AUDIO_PARAM_ADPCMTYPE */ + OMX_IndexParamAudioG723, /**< reference: OMX_AUDIO_PARAM_G723TYPE */ + OMX_IndexParamAudioG729, /**< reference: OMX_AUDIO_PARAM_G729TYPE */ + OMX_IndexParamAudioAmr, /**< reference: OMX_AUDIO_PARAM_AMRTYPE */ + OMX_IndexParamAudioWma, /**< reference: OMX_AUDIO_PARAM_WMATYPE */ + OMX_IndexParamAudioSbc, /**< reference: OMX_AUDIO_PARAM_SBCTYPE */ + OMX_IndexParamAudioMidi, /**< reference: OMX_AUDIO_PARAM_MIDITYPE */ + OMX_IndexParamAudioGsm_FR, /**< reference: OMX_AUDIO_PARAM_GSMFRTYPE */ + OMX_IndexParamAudioMidiLoadUserSound, /**< reference: OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE */ + OMX_IndexParamAudioG726, /**< reference: OMX_AUDIO_PARAM_G726TYPE */ + OMX_IndexParamAudioGsm_EFR, /**< reference: OMX_AUDIO_PARAM_GSMEFRTYPE */ + OMX_IndexParamAudioGsm_HR, /**< reference: OMX_AUDIO_PARAM_GSMHRTYPE */ + OMX_IndexParamAudioPdc_FR, /**< reference: OMX_AUDIO_PARAM_PDCFRTYPE */ + OMX_IndexParamAudioPdc_EFR, /**< reference: OMX_AUDIO_PARAM_PDCEFRTYPE */ + OMX_IndexParamAudioPdc_HR, /**< reference: OMX_AUDIO_PARAM_PDCHRTYPE */ + OMX_IndexParamAudioTdma_FR, /**< reference: OMX_AUDIO_PARAM_TDMAFRTYPE */ + OMX_IndexParamAudioTdma_EFR, /**< reference: OMX_AUDIO_PARAM_TDMAEFRTYPE */ + OMX_IndexParamAudioQcelp8, /**< reference: OMX_AUDIO_PARAM_QCELP8TYPE */ + OMX_IndexParamAudioQcelp13, /**< reference: OMX_AUDIO_PARAM_QCELP13TYPE */ + OMX_IndexParamAudioEvrc, /**< reference: OMX_AUDIO_PARAM_EVRCTYPE */ + OMX_IndexParamAudioSmv, /**< reference: OMX_AUDIO_PARAM_SMVTYPE */ + OMX_IndexParamAudioVorbis, /**< reference: OMX_AUDIO_PARAM_VORBISTYPE */ + + OMX_IndexConfigAudioMidiImmediateEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE */ + OMX_IndexConfigAudioMidiControl, /**< reference: OMX_AUDIO_CONFIG_MIDICONTROLTYPE */ + OMX_IndexConfigAudioMidiSoundBankProgram, /**< reference: OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE */ + OMX_IndexConfigAudioMidiStatus, /**< reference: OMX_AUDIO_CONFIG_MIDISTATUSTYPE */ + OMX_IndexConfigAudioMidiMetaEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE */ + OMX_IndexConfigAudioMidiMetaEventData, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE */ + OMX_IndexConfigAudioVolume, /**< reference: OMX_AUDIO_CONFIG_VOLUMETYPE */ + OMX_IndexConfigAudioBalance, /**< reference: OMX_AUDIO_CONFIG_BALANCETYPE */ + OMX_IndexConfigAudioChannelMute, /**< reference: OMX_AUDIO_CONFIG_CHANNELMUTETYPE */ + OMX_IndexConfigAudioMute, /**< reference: OMX_AUDIO_CONFIG_MUTETYPE */ + OMX_IndexConfigAudioLoudness, /**< reference: OMX_AUDIO_CONFIG_LOUDNESSTYPE */ + OMX_IndexConfigAudioEchoCancelation, /**< reference: OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE */ + OMX_IndexConfigAudioNoiseReduction, /**< reference: OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE */ + OMX_IndexConfigAudioBass, /**< reference: OMX_AUDIO_CONFIG_BASSTYPE */ + OMX_IndexConfigAudioTreble, /**< reference: OMX_AUDIO_CONFIG_TREBLETYPE */ + OMX_IndexConfigAudioStereoWidening, /**< reference: OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE */ + OMX_IndexConfigAudioChorus, /**< reference: OMX_AUDIO_CONFIG_CHORUSTYPE */ + OMX_IndexConfigAudioEqualizer, /**< reference: OMX_AUDIO_CONFIG_EQUALIZERTYPE */ + OMX_IndexConfigAudioReverberation, /**< reference: OMX_AUDIO_CONFIG_REVERBERATIONTYPE */ + OMX_IndexConfigAudioChannelVolume, /**< reference: OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE */ + + /* Image specific parameters and configurations */ + OMX_IndexImageStartUnused = 0x05000000, + OMX_IndexParamImagePortFormat, /**< reference: OMX_IMAGE_PARAM_PORTFORMATTYPE */ + OMX_IndexParamFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */ + OMX_IndexConfigFocusControl, /**< reference: OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE */ + OMX_IndexParamQFactor, /**< reference: OMX_IMAGE_PARAM_QFACTORTYPE */ + OMX_IndexParamQuantizationTable, /**< reference: OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE */ + OMX_IndexParamHuffmanTable, /**< reference: OMX_IMAGE_PARAM_HUFFMANTTABLETYPE */ + OMX_IndexConfigFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */ + + /* Video specific parameters and configurations */ + OMX_IndexVideoStartUnused = 0x06000000, + OMX_IndexParamVideoPortFormat, /**< reference: OMX_VIDEO_PARAM_PORTFORMATTYPE */ + OMX_IndexParamVideoQuantization, /**< reference: OMX_VIDEO_PARAM_QUANTIZATIONTYPE */ + OMX_IndexParamVideoFastUpdate, /**< reference: OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE */ + OMX_IndexParamVideoBitrate, /**< reference: OMX_VIDEO_PARAM_BITRATETYPE */ + OMX_IndexParamVideoMotionVector, /**< reference: OMX_VIDEO_PARAM_MOTIONVECTORTYPE */ + OMX_IndexParamVideoIntraRefresh, /**< reference: OMX_VIDEO_PARAM_INTRAREFRESHTYPE */ + OMX_IndexParamVideoErrorCorrection, /**< reference: OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE */ + OMX_IndexParamVideoVBSMC, /**< reference: OMX_VIDEO_PARAM_VBSMCTYPE */ + OMX_IndexParamVideoMpeg2, /**< reference: OMX_VIDEO_PARAM_MPEG2TYPE */ + OMX_IndexParamVideoMpeg4, /**< reference: OMX_VIDEO_PARAM_MPEG4TYPE */ + OMX_IndexParamVideoWmv, /**< reference: OMX_VIDEO_PARAM_WMVTYPE */ + OMX_IndexParamVideoRv, /**< reference: OMX_VIDEO_PARAM_RVTYPE */ + OMX_IndexParamVideoAvc, /**< reference: OMX_VIDEO_PARAM_AVCTYPE */ + OMX_IndexParamVideoH263, /**< reference: OMX_VIDEO_PARAM_H263TYPE */ + OMX_IndexParamVideoProfileLevelQuerySupported, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */ + OMX_IndexParamVideoProfileLevelCurrent, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */ + OMX_IndexConfigVideoBitrate, /**< reference: OMX_VIDEO_CONFIG_BITRATETYPE */ + OMX_IndexConfigVideoFramerate, /**< reference: OMX_CONFIG_FRAMERATETYPE */ + OMX_IndexConfigVideoIntraVOPRefresh, /**< reference: OMX_CONFIG_INTRAREFRESHVOPTYPE */ + OMX_IndexConfigVideoIntraMBRefresh, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */ + OMX_IndexConfigVideoMBErrorReporting, /**< reference: OMX_CONFIG_MBERRORREPORTINGTYPE */ + OMX_IndexParamVideoMacroblocksPerFrame, /**< reference: OMX_PARAM_MACROBLOCKSTYPE */ + OMX_IndexConfigVideoMacroBlockErrorMap, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */ + OMX_IndexParamVideoSliceFMO, /**< reference: OMX_VIDEO_PARAM_AVCSLICEFMO */ + OMX_IndexConfigVideoAVCIntraPeriod, /**< reference: OMX_VIDEO_CONFIG_AVCINTRAPERIOD */ + OMX_IndexConfigVideoNalSize, /**< reference: OMX_VIDEO_CONFIG_NALSIZE */ + OMX_IndexConfigCommonDeinterlace, /**< reference: OMX_VIDEO_CONFIG_DEINTERLACE */ + + /* Image & Video common Configurations */ + OMX_IndexCommonStartUnused = 0x07000000, + OMX_IndexParamCommonDeblocking, /**< reference: OMX_PARAM_DEBLOCKINGTYPE */ + OMX_IndexParamCommonSensorMode, /**< reference: OMX_PARAM_SENSORMODETYPE */ + OMX_IndexParamCommonInterleave, /**< reference: OMX_PARAM_INTERLEAVETYPE */ + OMX_IndexConfigCommonColorFormatConversion, /**< reference: OMX_CONFIG_COLORCONVERSIONTYPE */ + OMX_IndexConfigCommonScale, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */ + OMX_IndexConfigCommonImageFilter, /**< reference: OMX_CONFIG_IMAGEFILTERTYPE */ + OMX_IndexConfigCommonColorEnhancement, /**< reference: OMX_CONFIG_COLORENHANCEMENTTYPE */ + OMX_IndexConfigCommonColorKey, /**< reference: OMX_CONFIG_COLORKEYTYPE */ + OMX_IndexConfigCommonColorBlend, /**< reference: OMX_CONFIG_COLORBLENDTYPE */ + OMX_IndexConfigCommonFrameStabilisation,/**< reference: OMX_CONFIG_FRAMESTABTYPE */ + OMX_IndexConfigCommonRotate, /**< reference: OMX_CONFIG_ROTATIONTYPE */ + OMX_IndexConfigCommonMirror, /**< reference: OMX_CONFIG_MIRRORTYPE */ + OMX_IndexConfigCommonOutputPosition, /**< reference: OMX_CONFIG_POINTTYPE */ + OMX_IndexConfigCommonInputCrop, /**< reference: OMX_CONFIG_RECTTYPE */ + OMX_IndexConfigCommonOutputCrop, /**< reference: OMX_CONFIG_RECTTYPE */ + OMX_IndexConfigCommonDigitalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */ + OMX_IndexConfigCommonOpticalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE*/ + OMX_IndexConfigCommonWhiteBalance, /**< reference: OMX_CONFIG_WHITEBALCONTROLTYPE */ + OMX_IndexConfigCommonExposure, /**< reference: OMX_CONFIG_EXPOSURECONTROLTYPE */ + OMX_IndexConfigCommonContrast, /**< reference: OMX_CONFIG_CONTRASTTYPE */ + OMX_IndexConfigCommonBrightness, /**< reference: OMX_CONFIG_BRIGHTNESSTYPE */ + OMX_IndexConfigCommonBacklight, /**< reference: OMX_CONFIG_BACKLIGHTTYPE */ + OMX_IndexConfigCommonGamma, /**< reference: OMX_CONFIG_GAMMATYPE */ + OMX_IndexConfigCommonSaturation, /**< reference: OMX_CONFIG_SATURATIONTYPE */ + OMX_IndexConfigCommonLightness, /**< reference: OMX_CONFIG_LIGHTNESSTYPE */ + OMX_IndexConfigCommonExclusionRect, /**< reference: OMX_CONFIG_RECTTYPE */ + OMX_IndexConfigCommonDithering, /**< reference: OMX_CONFIG_DITHERTYPE */ + OMX_IndexConfigCommonPlaneBlend, /**< reference: OMX_CONFIG_PLANEBLENDTYPE */ + OMX_IndexConfigCommonExposureValue, /**< reference: OMX_CONFIG_EXPOSUREVALUETYPE */ + OMX_IndexConfigCommonOutputSize, /**< reference: OMX_FRAMESIZETYPE */ + OMX_IndexParamCommonExtraQuantData, /**< reference: OMX_OTHER_EXTRADATATYPE */ + OMX_IndexConfigCommonFocusRegion, /**< reference: OMX_CONFIG_FOCUSREGIONTYPE */ + OMX_IndexConfigCommonFocusStatus, /**< reference: OMX_PARAM_FOCUSSTATUSTYPE */ + OMX_IndexConfigCommonTransitionEffect, /**< reference: OMX_CONFIG_TRANSITIONEFFECTTYPE */ + + /* Reserved Configuration range */ + OMX_IndexOtherStartUnused = 0x08000000, + OMX_IndexParamOtherPortFormat, /**< reference: OMX_OTHER_PARAM_PORTFORMATTYPE */ + OMX_IndexConfigOtherPower, /**< reference: OMX_OTHER_CONFIG_POWERTYPE */ + OMX_IndexConfigOtherStats, /**< reference: OMX_OTHER_CONFIG_STATSTYPE */ + + + /* Reserved Time range */ + OMX_IndexTimeStartUnused = 0x09000000, + OMX_IndexConfigTimeScale, /**< reference: OMX_TIME_CONFIG_SCALETYPE */ + OMX_IndexConfigTimeClockState, /**< reference: OMX_TIME_CONFIG_CLOCKSTATETYPE */ + OMX_IndexConfigTimeActiveRefClock, /**< reference: OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE */ + OMX_IndexConfigTimeCurrentMediaTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */ + OMX_IndexConfigTimeCurrentWallTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */ + OMX_IndexConfigTimeCurrentAudioReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */ + OMX_IndexConfigTimeCurrentVideoReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */ + OMX_IndexConfigTimeMediaTimeRequest, /**< reference: OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE (write only) */ + OMX_IndexConfigTimeClientStartTime, /** + + +/** Khronos standard extension indices. + +This enum lists the current Khronos extension indices to OpenMAX IL. +*/ +typedef enum OMX_INDEXEXTTYPE { + + /* Component parameters and configurations */ + OMX_IndexExtComponentStartUnused = OMX_IndexKhronosExtensions + 0x00100000, + OMX_IndexConfigCallbackRequest, /**< reference: OMX_CONFIG_CALLBACKREQUESTTYPE */ + OMX_IndexConfigCommitMode, /**< reference: OMX_CONFIG_COMMITMODETYPE */ + OMX_IndexConfigCommit, /**< reference: OMX_CONFIG_COMMITTYPE */ + + /* Port parameters and configurations */ + OMX_IndexExtPortStartUnused = OMX_IndexKhronosExtensions + 0x00200000, + + /* Audio parameters and configurations */ + OMX_IndexExtAudioStartUnused = OMX_IndexKhronosExtensions + 0x00400000, + + /* Image parameters and configurations */ + OMX_IndexExtImageStartUnused = OMX_IndexKhronosExtensions + 0x00500000, + + /* Video parameters and configurations */ + OMX_IndexExtVideoStartUnused = OMX_IndexKhronosExtensions + 0x00600000, + OMX_IndexParamNalStreamFormatSupported, /**< reference: OMX_NALSTREAMFORMATTYPE */ + OMX_IndexParamNalStreamFormat, /**< reference: OMX_NALSTREAMFORMATTYPE */ + OMX_IndexParamNalStreamFormatSelect, /**< reference: OMX_NALSTREAMFORMATTYPE */ + OMX_IndexParamVideoVp8, /**< reference: OMX_VIDEO_PARAM_VP8TYPE */ + OMX_IndexConfigVideoVp8ReferenceFrame, /**< reference: OMX_VIDEO_VP8REFERENCEFRAMETYPE */ + OMX_IndexConfigVideoVp8ReferenceFrameType, /**< reference: OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE */ + OMX_IndexParamVideoReserved, /**< Reserved for future index */ + OMX_IndexParamVideoHevc, /**< reference: OMX_VIDEO_PARAM_HEVCTYPE */ + + /* Image & Video common configurations */ + OMX_IndexExtCommonStartUnused = OMX_IndexKhronosExtensions + 0x00700000, + + /* Other configurations */ + OMX_IndexExtOtherStartUnused = OMX_IndexKhronosExtensions + 0x00800000, + OMX_IndexConfigAutoFramerateConversion, /**< reference: OMX_CONFIG_BOOLEANTYPE */ + OMX_IndexConfigPriority, /**< reference: OMX_PARAM_U32TYPE */ + OMX_IndexConfigOperatingRate, /**< reference: OMX_PARAM_U32TYPE in Q16 format for video and in Hz for audio */ + + /* Time configurations */ + OMX_IndexExtTimeStartUnused = OMX_IndexKhronosExtensions + 0x00900000, + + OMX_IndexExtMax = 0x7FFFFFFF +} OMX_INDEXEXTTYPE; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* OMX_IndexExt_h */ +/* File EOF */ diff --git a/third_party/openmax/include/OMX_Other.h b/third_party/openmax/include/OMX_Other.h new file mode 100644 index 000000000..caf7f3844 --- /dev/null +++ b/third_party/openmax/include/OMX_Other.h @@ -0,0 +1,337 @@ +/* + * Copyright (c) 2008 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/** @file OMX_Other.h - OpenMax IL version 1.1.2 + * The structures needed by Other components to exchange + * parameters and configuration data with the components. + */ + +#ifndef OMX_Other_h +#define OMX_Other_h + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +/* Each OMX header must include all required header files to allow the + * header to compile without errors. The includes below are required + * for this header file to compile successfully + */ + +#include + + +/** + * Enumeration of possible data types which match to multiple domains or no + * domain at all. For types which are vendor specific, a value above + * OMX_OTHER_VENDORTSTART should be used. + */ +typedef enum OMX_OTHER_FORMATTYPE { + OMX_OTHER_FormatTime = 0, /**< Transmission of various timestamps, elapsed time, + time deltas, etc */ + OMX_OTHER_FormatPower, /**< Perhaps used for enabling/disabling power + management, setting clocks? */ + OMX_OTHER_FormatStats, /**< Could be things such as frame rate, frames + dropped, etc */ + OMX_OTHER_FormatBinary, /**< Arbitrary binary data */ + OMX_OTHER_FormatVendorReserved = 1000, /**< Starting value for vendor specific + formats */ + + OMX_OTHER_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_OTHER_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_OTHER_FormatMax = 0x7FFFFFFF +} OMX_OTHER_FORMATTYPE; + +/** + * Enumeration of seek modes. + */ +typedef enum OMX_TIME_SEEKMODETYPE { + OMX_TIME_SeekModeFast = 0, /**< Prefer seeking to an approximation + * of the requested seek position over + * the actual seek position if it + * results in a faster seek. */ + OMX_TIME_SeekModeAccurate, /**< Prefer seeking to the actual seek + * position over an approximation + * of the requested seek position even + * if it results in a slower seek. */ + OMX_TIME_SeekModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_TIME_SeekModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_TIME_SeekModeMax = 0x7FFFFFFF +} OMX_TIME_SEEKMODETYPE; + +/* Structure representing the seekmode of the component */ +typedef struct OMX_TIME_CONFIG_SEEKMODETYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_TIME_SEEKMODETYPE eType; /**< The seek mode */ +} OMX_TIME_CONFIG_SEEKMODETYPE; + +/** Structure representing a time stamp used with the following configs + * on the Clock Component (CC): + * + * OMX_IndexConfigTimeCurrentWallTime: query of the CCs current wall + * time + * OMX_IndexConfigTimeCurrentMediaTime: query of the CCs current media + * time + * OMX_IndexConfigTimeCurrentAudioReference and + * OMX_IndexConfigTimeCurrentVideoReference: audio/video reference + * clock sending SC its reference time + * OMX_IndexConfigTimeClientStartTime: a Clock Component client sends + * this structure to the Clock Component via a SetConfig on its + * client port when it receives a buffer with + * OMX_BUFFERFLAG_STARTTIME set. It must use the timestamp + * specified by that buffer for nStartTimestamp. + * + * Its also used with the following config on components in general: + * + * OMX_IndexConfigTimePosition: IL client querying component position + * (GetConfig) or commanding a component to seek to the given location + * (SetConfig) + */ +typedef struct OMX_TIME_CONFIG_TIMESTAMPTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version + * information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_TICKS nTimestamp; /**< timestamp .*/ +} OMX_TIME_CONFIG_TIMESTAMPTYPE; + +/** Enumeration of possible reference clocks to the media time. */ +typedef enum OMX_TIME_UPDATETYPE { + OMX_TIME_UpdateRequestFulfillment, /**< Update is the fulfillment of a media time request. */ + OMX_TIME_UpdateScaleChanged, /**< Update was generated because the scale chagned. */ + OMX_TIME_UpdateClockStateChanged, /**< Update was generated because the clock state changed. */ + OMX_TIME_UpdateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_TIME_UpdateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_TIME_UpdateMax = 0x7FFFFFFF +} OMX_TIME_UPDATETYPE; + +/** Enumeration of possible reference clocks to the media time. */ +typedef enum OMX_TIME_REFCLOCKTYPE { + OMX_TIME_RefClockNone, /**< Use no references. */ + OMX_TIME_RefClockAudio, /**< Use references sent through OMX_IndexConfigTimeCurrentAudioReference */ + OMX_TIME_RefClockVideo, /**< Use references sent through OMX_IndexConfigTimeCurrentVideoReference */ + OMX_TIME_RefClockKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_TIME_RefClockVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_TIME_RefClockMax = 0x7FFFFFFF +} OMX_TIME_REFCLOCKTYPE; + +/** Enumeration of clock states. */ +typedef enum OMX_TIME_CLOCKSTATE { + OMX_TIME_ClockStateRunning, /**< Clock running. */ + OMX_TIME_ClockStateWaitingForStartTime, /**< Clock waiting until the + * prescribed clients emit their + * start time. */ + OMX_TIME_ClockStateStopped, /**< Clock stopped. */ + OMX_TIME_ClockStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_TIME_ClockStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_TIME_ClockStateMax = 0x7FFFFFFF +} OMX_TIME_CLOCKSTATE; + +/** Structure representing a media time request to the clock component. + * + * A client component sends this structure to the Clock Component via a SetConfig + * on its client port to specify a media timestamp the Clock Component + * should emit. The Clock Component should fulfill the request by sending a + * OMX_TIME_MEDIATIMETYPE when its media clock matches the requested + * timestamp. + * + * The client may require a media time request be fulfilled slightly + * earlier than the media time specified. In this case the client specifies + * an offset which is equal to the difference between wall time corresponding + * to the requested media time and the wall time when it will be + * fulfilled. + * + * A client component may uses these requests and the OMX_TIME_MEDIATIMETYPE to + * time events according to timestamps. If a client must perform an operation O at + * a time T (e.g. deliver a video frame at its corresponding timestamp), it makes a + * media time request at T (perhaps specifying an offset to ensure the request fulfillment + * is a little early). When the clock component passes the resulting OMX_TIME_MEDIATIMETYPE + * structure back to the client component, the client may perform operation O (perhaps having + * to wait a slight amount more time itself as specified by the return values). + */ + +typedef struct OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< port that this structure applies to */ + OMX_PTR pClientPrivate; /**< Client private data to disabiguate this media time + * from others (e.g. the number of the frame to deliver). + * Duplicated in the media time structure that fulfills + * this request. A value of zero is reserved for time scale + * updates. */ + OMX_TICKS nMediaTimestamp; /**< Media timestamp requested.*/ + OMX_TICKS nOffset; /**< Amount of wall clock time by which this + * request should be fulfilled early */ +} OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE; + +/**< Structure sent from the clock component client either when fulfilling + * a media time request or when the time scale has changed. + * + * In the former case the Clock Component fills this structure and times its emission + * to a client component (via the client port) according to the corresponding media + * time request sent by the client. The Clock Component should time the emission to occur + * when the requested timestamp matches the Clock Component's media time but also the + * prescribed offset early. + * + * Upon scale changes the clock component clears the nClientPrivate data, sends the current + * media time and sets the nScale to the new scale via the client port. It emits a + * OMX_TIME_MEDIATIMETYPE to all clients independent of any requests. This allows clients to + * alter processing to accomodate scaling. For instance a video component might skip inter-frames + * in the case of extreme fastforward. Likewise an audio component might add or remove samples + * from an audio frame to scale audio data. + * + * It is expected that some clock components may not be able to fulfill requests + * at exactly the prescribed time. This is acceptable so long as the request is + * fulfilled at least as early as described and not later. This structure provides + * fields the client may use to wait for the remaining time. + * + * The client may use either the nOffset or nWallTimeAtMedia fields to determine the + * wall time until the nMediaTimestamp actually occurs. In the latter case the + * client can get a more accurate value for offset by getting the current wall + * from the cloc component and subtracting it from nWallTimeAtMedia. + */ + +typedef struct OMX_TIME_MEDIATIMETYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nClientPrivate; /**< Client private data to disabiguate this media time + * from others. Copied from the media time request. + * A value of zero is reserved for time scale updates. */ + OMX_TIME_UPDATETYPE eUpdateType; /**< Reason for the update */ + OMX_TICKS nMediaTimestamp; /**< Media time requested. If no media time was + * requested then this is the current media time. */ + OMX_TICKS nOffset; /**< Amount of wall clock time by which this + * request was actually fulfilled early */ + + OMX_TICKS nWallTimeAtMediaTime; /**< Wall time corresponding to nMediaTimeStamp. + * A client may compare this value to current + * media time obtained from the Clock Component to determine + * the wall time until the media timestamp is really + * current. */ + OMX_S32 xScale; /**< Current media time scale in Q16 format. */ + OMX_TIME_CLOCKSTATE eState; /* Seeking Change. Added 7/12.*/ + /**< State of the media time. */ +} OMX_TIME_MEDIATIMETYPE; + +/** Structure representing the current media time scale factor. Applicable only to clock + * component, other components see scale changes via OMX_TIME_MEDIATIMETYPE buffers sent via + * the clock component client ports. Upon recieving this config the clock component changes + * the rate by which the media time increases or decreases effectively implementing trick modes. + */ +typedef struct OMX_TIME_CONFIG_SCALETYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_S32 xScale; /**< This is a value in Q16 format which is used for + * scaling the media time */ +} OMX_TIME_CONFIG_SCALETYPE; + +/** Bits used to identify a clock port. Used in OMX_TIME_CONFIG_CLOCKSTATETYPEs nWaitMask field */ +#define OMX_CLOCKPORT0 0x00000001 +#define OMX_CLOCKPORT1 0x00000002 +#define OMX_CLOCKPORT2 0x00000004 +#define OMX_CLOCKPORT3 0x00000008 +#define OMX_CLOCKPORT4 0x00000010 +#define OMX_CLOCKPORT5 0x00000020 +#define OMX_CLOCKPORT6 0x00000040 +#define OMX_CLOCKPORT7 0x00000080 + +/** Structure representing the current mode of the media clock. + * IL Client uses this config to change or query the mode of the + * media clock of the clock component. Applicable only to clock + * component. + * + * On a SetConfig if eState is OMX_TIME_ClockStateRunning media time + * starts immediately at the prescribed start time. If + * OMX_TIME_ClockStateWaitingForStartTime the Clock Component ignores + * the given nStartTime and waits for all clients specified in the + * nWaitMask to send starttimes (via + * OMX_IndexConfigTimeClientStartTime). The Clock Component then starts + * the media clock using the earliest start time supplied. */ +typedef struct OMX_TIME_CONFIG_CLOCKSTATETYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version + * information */ + OMX_TIME_CLOCKSTATE eState; /**< State of the media time. */ + OMX_TICKS nStartTime; /**< Start time of the media time. */ + OMX_TICKS nOffset; /**< Time to offset the media time by + * (e.g. preroll). Media time will be + * reported to be nOffset ticks earlier. + */ + OMX_U32 nWaitMask; /**< Mask of OMX_CLOCKPORT values. */ +} OMX_TIME_CONFIG_CLOCKSTATETYPE; + +/** Structure representing the reference clock currently being used to + * compute media time. IL client uses this config to change or query the + * clock component's active reference clock */ +typedef struct OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_TIME_REFCLOCKTYPE eClock; /**< Reference clock used to compute media time */ +} OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE; + +/** Descriptor for setting specifics of power type. + * Note: this structure is listed for backwards compatibility. */ +typedef struct OMX_OTHER_CONFIG_POWERTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_BOOL bEnablePM; /**< Flag to enable Power Management */ +} OMX_OTHER_CONFIG_POWERTYPE; + + +/** Descriptor for setting specifics of stats type. + * Note: this structure is listed for backwards compatibility. */ +typedef struct OMX_OTHER_CONFIG_STATSTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + /* what goes here */ +} OMX_OTHER_CONFIG_STATSTYPE; + + +/** + * The PortDefinition structure is used to define all of the parameters + * necessary for the compliant component to setup an input or an output other + * path. + */ +typedef struct OMX_OTHER_PORTDEFINITIONTYPE { + OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */ +} OMX_OTHER_PORTDEFINITIONTYPE; + +/** Port format parameter. This structure is used to enumerate + * the various data input/output format supported by the port. + */ +typedef struct OMX_OTHER_PARAM_PORTFORMATTYPE { + OMX_U32 nSize; /**< size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< Indicates which port to set */ + OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */ + OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */ +} OMX_OTHER_PARAM_PORTFORMATTYPE; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif +/* File EOF */ diff --git a/third_party/openmax/include/OMX_QCOMExtns.h b/third_party/openmax/include/OMX_QCOMExtns.h new file mode 100644 index 000000000..20917932b --- /dev/null +++ b/third_party/openmax/include/OMX_QCOMExtns.h @@ -0,0 +1,1888 @@ +/*-------------------------------------------------------------------------- +Copyright (c) 2009-2015, The Linux Foundation. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of The Linux Foundation nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------*/ +#ifndef __OMX_QCOM_EXTENSIONS_H__ +#define __OMX_QCOM_EXTENSIONS_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/*============================================================================ +*//** @file OMX_QCOMExtns.h + This header contains constants and type definitions that specify the + extensions added to the OpenMAX Vendor specific APIs. + +*//*========================================================================*/ + + +/////////////////////////////////////////////////////////////////////////////// +// Include Files +/////////////////////////////////////////////////////////////////////////////// +#include "OMX_Core.h" +#include "OMX_Video.h" + +#define OMX_VIDEO_MAX_HP_LAYERS 6 +/** + * This extension is used to register mapping of a virtual + * address to a physical address. This extension is a parameter + * which can be set using the OMX_SetParameter macro. The data + * pointer corresponding to this extension is + * OMX_QCOM_MemMapEntry. This parameter is a 'write only' + * parameter (Current value cannot be queried using + * OMX_GetParameter macro). + */ +#define OMX_QCOM_EXTN_REGISTER_MMAP "OMX.QCOM.index.param.register_mmap" + +/** + * This structure describes the data pointer corresponding to + * the OMX_QCOM_MMAP_REGISTER_EXTN extension. This parameter + * must be set only 'after' populating a port with a buffer + * using OMX_UseBuffer, wherein the data pointer of the buffer + * corresponds to the virtual address as specified in this + * structure. + */ +struct OMX_QCOM_PARAM_MEMMAPENTRYTYPE +{ + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< Port number the structure applies to */ + + /** + * The virtual address of memory block + */ + OMX_U64 nVirtualAddress; + + /** + * The physical address corresponding to the virtual address. The physical + * address is contiguous for the entire valid range of the virtual + * address. + */ + OMX_U64 nPhysicalAddress; +}; + +#define QOMX_VIDEO_IntraRefreshRandom (OMX_VIDEO_IntraRefreshVendorStartUnused + 0) + +/* This error event is used for H.264 long-term reference (LTR) encoding. + * When IL client specifies an LTR frame with its identifier via + * OMX_QCOM_INDEX_CONFIG_VIDEO_LTRUSE to the encoder, if the specified + * LTR frame can not be located by the encoder in its LTR list, the encoder + * issues this error event to IL client to notify the failure of LTRUse config. + */ +#define QOMX_ErrorLTRUseFailed (OMX_ErrorVendorStartUnused + 1) + +#define QOMX_VIDEO_BUFFERFLAG_BFRAME 0x00100000 + +#define QOMX_VIDEO_BUFFERFLAG_EOSEQ 0x00200000 + +#define QOMX_VIDEO_BUFFERFLAG_MBAFF 0x00400000 + +#define QOMX_VIDEO_BUFFERFLAG_CANCEL 0x00800000 + +#define OMX_QCOM_PORTDEFN_EXTN "OMX.QCOM.index.param.portdefn" +/* Allowed APIs on the above Index: OMX_GetParameter() and OMX_SetParameter() */ + +typedef enum OMX_QCOMMemoryRegion +{ + OMX_QCOM_MemRegionInvalid, + OMX_QCOM_MemRegionEBI1, + OMX_QCOM_MemRegionSMI, + OMX_QCOM_MemRegionMax = 0X7FFFFFFF +} OMX_QCOMMemoryRegion; + +typedef enum OMX_QCOMCacheAttr +{ + OMX_QCOM_CacheAttrNone, + OMX_QCOM_CacheAttrWriteBack, + OMX_QCOM_CacheAttrWriteThrough, + OMX_QCOM_CacheAttrMAX = 0X7FFFFFFF +} OMX_QCOMCacheAttr; + +typedef struct OMX_QCOMRectangle +{ + OMX_S32 x; + OMX_S32 y; + OMX_S32 dx; + OMX_S32 dy; +} OMX_QCOMRectangle; + +/** OMX_QCOMFramePackingFormat + * Input or output buffer format + */ +typedef enum OMX_QCOMFramePackingFormat +{ + /* 0 - unspecified + */ + OMX_QCOM_FramePacking_Unspecified, + + /* 1 - Partial frames may be present OMX IL 1.1.1 Figure 2-10: + * Case 1??Each Buffer Filled In Whole or In Part + */ + OMX_QCOM_FramePacking_Arbitrary, + + /* 2 - Multiple complete frames per buffer (integer number) + * OMX IL 1.1.1 Figure 2-11: Case 2Each Buffer Filled with + * Only Complete Frames of Data + */ + OMX_QCOM_FramePacking_CompleteFrames, + + /* 3 - Only one complete frame per buffer, no partial frame + * OMX IL 1.1.1 Figure 2-12: Case 3Each Buffer Filled with + * Only One Frame of Compressed Data. Usually at least one + * complete unit of data will be delivered in a buffer for + * uncompressed data formats. + */ + OMX_QCOM_FramePacking_OnlyOneCompleteFrame, + + /* 4 - Only one complete subframe per buffer, no partial subframe + * Example: In H264, one complete NAL per buffer, where one frame + * can contatin multiple NAL + */ + OMX_QCOM_FramePacking_OnlyOneCompleteSubFrame, + + OMX_QCOM_FramePacking_MAX = 0X7FFFFFFF +} OMX_QCOMFramePackingFormat; + +typedef struct OMX_QCOM_PARAM_PORTDEFINITIONTYPE { + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion;/** OMX specification version information */ + OMX_U32 nPortIndex; /** Portindex which is extended by this structure */ + + /** Platform specific memory region EBI1, SMI, etc.,*/ + OMX_QCOMMemoryRegion nMemRegion; + + OMX_QCOMCacheAttr nCacheAttr; /** Cache attributes */ + + /** Input or output buffer format */ + OMX_U32 nFramePackingFormat; + +} OMX_QCOM_PARAM_PORTDEFINITIONTYPE; + +typedef struct OMX_QCOM_VIDEO_PARAM_QPRANGETYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 minQP; + OMX_U32 maxQP; +} OMX_QCOM_VIDEO_PARAM_QPRANGETYPE; + +#define OMX_QCOM_PLATFORMPVT_EXTN "OMX.QCOM.index.param.platformprivate" +/** Allowed APIs on the above Index: OMX_SetParameter() */ + +typedef enum OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE +{ + /** Enum for PMEM information */ + OMX_QCOM_PLATFORM_PRIVATE_PMEM = 0x1 +} OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE; + +/** IL client will set the following structure. A failure + * code will be returned if component does not support the + * value provided for 'type'. + */ +struct OMX_QCOM_PLATFORMPRIVATE_EXTN +{ + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /** OMX spec version information */ + OMX_U32 nPortIndex; /** Port number on which usebuffer extn is applied */ + + /** Type of extensions should match an entry from + OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE + */ + OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE type; +}; + +typedef struct OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO +{ + /** pmem file descriptor */ + unsigned long pmem_fd; + /** Offset from pmem device base address */ + OMX_U32 offset; + OMX_U32 size; + OMX_U32 mapped_size; + OMX_PTR buffer; +}OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO; + +typedef struct OMX_QCOM_PLATFORM_PRIVATE_ENTRY +{ + /** Entry type */ + OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE type; + + /** Pointer to platform specific entry */ + OMX_PTR entry; +}OMX_QCOM_PLATFORM_PRIVATE_ENTRY; + +typedef struct OMX_QCOM_PLATFORM_PRIVATE_LIST +{ + /** Number of entries */ + OMX_U32 nEntries; + + /** Pointer to array of platform specific entries * + * Contiguous block of OMX_QCOM_PLATFORM_PRIVATE_ENTRY element + */ + OMX_QCOM_PLATFORM_PRIVATE_ENTRY* entryList; +}OMX_QCOM_PLATFORM_PRIVATE_LIST; + +#define OMX_QCOM_FRAME_PACKING_FORMAT "OMX.QCOM.index.param.framepackfmt" +/* Allowed API call: OMX_GetParameter() */ +/* IL client can use this index to rerieve the list of frame formats * + * supported by the component */ + +typedef struct OMX_QCOM_FRAME_PACKINGFORMAT_TYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nIndex; + OMX_QCOMFramePackingFormat eframePackingFormat; +} OMX_QCOM_FRAME_PACKINGFORMAT_TYPE; + + +/** + * Following is the enum for color formats supported on Qualcomm + * MSMs YVU420SemiPlanar color format is not defined in OpenMAX + * 1.1.1 and prior versions of OpenMAX specification. + */ + +enum OMX_QCOM_COLOR_FORMATTYPE +{ + +/** YVU420SemiPlanar: YVU planar format, organized with a first + * plane containing Y pixels, and a second plane containing + * interleaved V and U pixels. V and U pixels are sub-sampled + * by a factor of two both horizontally and vertically. + */ + QOMX_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00, + QOMX_COLOR_FormatYVU420PackedSemiPlanar32m4ka, + QOMX_COLOR_FormatYUV420PackedSemiPlanar16m2ka, + QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka, + QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m, + QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mMultiView, + QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mCompressed, + QOMX_COLOR_Format32bitRGBA8888, + QOMX_COLOR_Format32bitRGBA8888Compressed, + QOMX_COLOR_FormatAndroidOpaque = (OMX_COLOR_FORMATTYPE) OMX_COLOR_FormatVendorStartUnused + 0x789, +}; + +enum OMX_QCOM_VIDEO_CODINGTYPE +{ +/** Codecs support by qualcomm which are not listed in OMX 1.1.x + * spec + * */ + OMX_QCOM_VIDEO_CodingVC1 = 0x7FA30C00 , + OMX_QCOM_VIDEO_CodingWMV9 = 0x7FA30C01, + QOMX_VIDEO_CodingDivx = 0x7FA30C02, /**< Value when coding is Divx */ + QOMX_VIDEO_CodingSpark = 0x7FA30C03, /**< Value when coding is Sorenson Spark */ + QOMX_VIDEO_CodingVp = 0x7FA30C04, + QOMX_VIDEO_CodingVp8 = OMX_VIDEO_CodingVP8, /**< keeping old enum for backwards compatibility*/ + QOMX_VIDEO_CodingHevc = OMX_VIDEO_CodingHEVC, /**< keeping old enum for backwards compatibility*/ + QOMX_VIDEO_CodingMVC = 0x7FA30C07, + QOMX_VIDEO_CodingVp9 = OMX_VIDEO_CodingVP9, /**< keeping old enum for backwards compatibility*/ +}; + +enum OMX_QCOM_EXTN_INDEXTYPE +{ + /** Qcom proprietary extension index list */ + + /* "OMX.QCOM.index.param.register_mmap" */ + OMX_QcomIndexRegmmap = 0x7F000000, + + /* "OMX.QCOM.index.param.platformprivate" */ + OMX_QcomIndexPlatformPvt = 0x7F000001, + + /* "OMX.QCOM.index.param.portdefn" */ + OMX_QcomIndexPortDefn = 0x7F000002, + + /* "OMX.QCOM.index.param.framepackingformat" */ + OMX_QcomIndexPortFramePackFmt = 0x7F000003, + + /*"OMX.QCOM.index.param.Interlaced */ + OMX_QcomIndexParamInterlaced = 0x7F000004, + + /*"OMX.QCOM.index.config.interlaceformat */ + OMX_QcomIndexConfigInterlaced = 0x7F000005, + + /*"OMX.QCOM.index.param.syntaxhdr" */ + QOMX_IndexParamVideoSyntaxHdr = 0x7F000006, + + /*"OMX.QCOM.index.config.intraperiod" */ + QOMX_IndexConfigVideoIntraperiod = 0x7F000007, + + /*"OMX.QCOM.index.config.randomIntrarefresh" */ + QOMX_IndexConfigVideoIntraRefresh = 0x7F000008, + + /*"OMX.QCOM.index.config.video.TemporalSpatialTradeOff" */ + QOMX_IndexConfigVideoTemporalSpatialTradeOff = 0x7F000009, + + /*"OMX.QCOM.index.param.video.EncoderMode" */ + QOMX_IndexParamVideoEncoderMode = 0x7F00000A, + + /*"OMX.QCOM.index.param.Divxtype */ + OMX_QcomIndexParamVideoDivx = 0x7F00000B, + + /*"OMX.QCOM.index.param.Sparktype */ + OMX_QcomIndexParamVideoSpark = 0x7F00000C, + + /*"OMX.QCOM.index.param.Vptype */ + OMX_QcomIndexParamVideoVp = 0x7F00000D, + + OMX_QcomIndexQueryNumberOfVideoDecInstance = 0x7F00000E, + + OMX_QcomIndexParamVideoSyncFrameDecodingMode = 0x7F00000F, + + OMX_QcomIndexParamVideoDecoderPictureOrder = 0x7F000010, + + /* "OMX.QCOM.index.config.video.FramePackingInfo" */ + OMX_QcomIndexConfigVideoFramePackingArrangement = 0x7F000011, + + OMX_QcomIndexParamConcealMBMapExtraData = 0x7F000012, + + OMX_QcomIndexParamFrameInfoExtraData = 0x7F000013, + + OMX_QcomIndexParamInterlaceExtraData = 0x7F000014, + + OMX_QcomIndexParamH264TimeInfo = 0x7F000015, + + OMX_QcomIndexParamIndexExtraDataType = 0x7F000016, + + OMX_GoogleAndroidIndexEnableAndroidNativeBuffers = 0x7F000017, + + OMX_GoogleAndroidIndexUseAndroidNativeBuffer = 0x7F000018, + + OMX_GoogleAndroidIndexGetAndroidNativeBufferUsage = 0x7F000019, + + /*"OMX.QCOM.index.config.video.QPRange" */ + OMX_QcomIndexConfigVideoQPRange = 0x7F00001A, + + /*"OMX.QCOM.index.param.EnableTimeStampReoder"*/ + OMX_QcomIndexParamEnableTimeStampReorder = 0x7F00001B, + + /*"OMX.google.android.index.storeMetaDataInBuffers"*/ + OMX_QcomIndexParamVideoMetaBufferMode = 0x7F00001C, + + /*"OMX.google.android.index.useAndroidNativeBuffer2"*/ + OMX_GoogleAndroidIndexUseAndroidNativeBuffer2 = 0x7F00001D, + + /*"OMX.QCOM.index.param.VideoMaxAllowedBitrateCheck"*/ + OMX_QcomIndexParamVideoMaxAllowedBitrateCheck = 0x7F00001E, + + OMX_QcomIndexEnableSliceDeliveryMode = 0x7F00001F, + + /* "OMX.QCOM.index.param.video.ExtnUserExtraData" */ + OMX_QcomIndexEnableExtnUserData = 0x7F000020, + + /*"OMX.QCOM.index.param.video.EnableSmoothStreaming"*/ + OMX_QcomIndexParamEnableSmoothStreaming = 0x7F000021, + + /*"OMX.QCOM.index.param.video.QPRange" */ + OMX_QcomIndexParamVideoQPRange = 0x7F000022, + + OMX_QcomIndexEnableH263PlusPType = 0x7F000023, + + /*"OMX.QCOM.index.param.video.LTRCountRangeSupported"*/ + QOMX_IndexParamVideoLTRCountRangeSupported = 0x7F000024, + + /*"OMX.QCOM.index.param.video.LTRMode"*/ + QOMX_IndexParamVideoLTRMode = 0x7F000025, + + /*"OMX.QCOM.index.param.video.LTRCount"*/ + QOMX_IndexParamVideoLTRCount = 0x7F000026, + + /*"OMX.QCOM.index.config.video.LTRPeriod"*/ + QOMX_IndexConfigVideoLTRPeriod = 0x7F000027, + + /*"OMX.QCOM.index.config.video.LTRUse"*/ + QOMX_IndexConfigVideoLTRUse = 0x7F000028, + + /*"OMX.QCOM.index.config.video.LTRMark"*/ + QOMX_IndexConfigVideoLTRMark = 0x7F000029, + + /* OMX.google.android.index.prependSPSPPSToIDRFrames */ + OMX_QcomIndexParamSequenceHeaderWithIDR = 0x7F00002A, + + OMX_QcomIndexParamH264AUDelimiter = 0x7F00002B, + + OMX_QcomIndexParamVideoDownScalar = 0x7F00002C, + + /* "OMX.QCOM.index.param.video.FramePackingExtradata" */ + OMX_QcomIndexParamVideoFramePackingExtradata = 0x7F00002D, + + /* "OMX.QCOM.index.config.activeregiondetection" */ + OMX_QcomIndexConfigActiveRegionDetection = 0x7F00002E, + + /* "OMX.QCOM.index.config.activeregiondetectionstatus" */ + OMX_QcomIndexConfigActiveRegionDetectionStatus = 0x7F00002F, + + /* "OMX.QCOM.index.config.scalingmode" */ + OMX_QcomIndexConfigScalingMode = 0x7F000030, + + /* "OMX.QCOM.index.config.noisereduction" */ + OMX_QcomIndexConfigNoiseReduction = 0x7F000031, + + /* "OMX.QCOM.index.config.imageenhancement" */ + OMX_QcomIndexConfigImageEnhancement = 0x7F000032, + + /* google smooth-streaming support */ + OMX_QcomIndexParamVideoAdaptivePlaybackMode = 0x7F000033, + + /* H.264 MVC codec index */ + QOMX_IndexParamVideoMvc = 0x7F000034, + + /* "OMX.QCOM.index.param.video.QPExtradata" */ + OMX_QcomIndexParamVideoQPExtraData = 0x7F000035, + + /* "OMX.QCOM.index.param.video.InputBitsInfoExtradata" */ + OMX_QcomIndexParamVideoInputBitsInfoExtraData = 0x7F000036, + + /* VP8 Hierarchical P support */ + OMX_QcomIndexHierarchicalStructure = 0x7F000037, + + OMX_QcomIndexParamPerfLevel = 0x7F000038, + + OMX_QcomIndexParamH264VUITimingInfo = 0x7F000039, + + OMX_QcomIndexParamPeakBitrate = 0x7F00003A, + + /* Enable InitialQP index */ + QOMX_IndexParamVideoInitialQp = 0x7F00003B, + + OMX_QcomIndexParamSetMVSearchrange = 0x7F00003C, + + OMX_QcomIndexConfigPerfLevel = 0x7F00003D, + + /*"OMX.QCOM.index.param.video.LTRCount"*/ + OMX_QcomIndexParamVideoLTRCount = QOMX_IndexParamVideoLTRCount, + + /*"OMX.QCOM.index.config.video.LTRUse"*/ + OMX_QcomIndexConfigVideoLTRUse = QOMX_IndexConfigVideoLTRUse, + + /*"OMX.QCOM.index.config.video.LTRMark"*/ + OMX_QcomIndexConfigVideoLTRMark = QOMX_IndexConfigVideoLTRMark, + + /*"OMX.QCOM.index.param.video.CustomBufferSize"*/ + OMX_QcomIndexParamVideoCustomBufferSize = 0x7F00003E, + + /* Max Hierarchical P layers */ + OMX_QcomIndexMaxHierarchicallayers = 0x7F000041, + + /* Set Encoder Performance Index */ + OMX_QcomIndexConfigVideoVencPerfMode = 0x7F000042, + + /* Set Hybrid Hier-p layers */ + OMX_QcomIndexParamVideoHybridHierpMode = 0x7F000043, + + OMX_QcomIndexFlexibleYUVDescription = 0x7F000044, + + /* Vpp Hqv Control Type */ + OMX_QcomIndexParamVppHqvControl = 0x7F000045, + + /* Enable VPP */ + OMX_QcomIndexParamEnableVpp = 0x7F000046, + + /* MBI statistics mode */ + OMX_QcomIndexParamMBIStatisticsMode = 0x7F000047, + + /* Set PictureTypeDecode */ + OMX_QcomIndexConfigPictureTypeDecode = 0x7F000048, + + OMX_QcomIndexConfigH264EntropyCodingCabac = 0x7F000049, + + /* "OMX.QCOM.index.param.video.InputBatch" */ + OMX_QcomIndexParamBatchSize = 0x7F00004A, + + OMX_QcomIndexConfigNumHierPLayers = 0x7F00004B, + + OMX_QcomIndexConfigRectType = 0x7F00004C, + + OMX_QcomIndexConfigBaseLayerId = 0x7F00004E, + + OMX_QcomIndexParamDriverVersion = 0x7F00004F, + + OMX_QcomIndexConfigQp = 0x7F000050, + + OMX_QcomIndexParamVencAspectRatio = 0x7F000051, + + OMX_QTIIndexParamVQZipSEIExtraData = 0x7F000052, + + /* Enable VQZIP SEI NAL type */ + OMX_QTIIndexParamVQZIPSEIType = 0x7F000053, + + OMX_QTIIndexParamPassInputBufferFd = 0x7F000054, + + /* Set Prefer-adaptive playback*/ + /* "OMX.QTI.index.param.video.PreferAdaptivePlayback" */ + OMX_QTIIndexParamVideoPreferAdaptivePlayback = 0x7F000055, + + /* Set time params */ + OMX_QTIIndexConfigSetTimeData = 0x7F000056, + /* Force Compressed format for DPB when resolution <=1080p + * and OPB is cpu_access */ + /* OMX.QTI.index.param.video.ForceCompressedForDPB */ + OMX_QTIIndexParamForceCompressedForDPB = 0x7F000057, + + /* Enable ROI info */ + OMX_QTIIndexParamVideoEnableRoiInfo = 0x7F000058, + + /* Configure ROI info */ + OMX_QTIIndexConfigVideoRoiInfo = 0x7F000059, + + /* Set Low Latency Mode */ + OMX_QTIIndexParamLowLatencyMode = 0x7F00005A, + + /* Force OPB to UnCompressed mode */ + OMX_QTIIndexParamForceUnCompressedForOPB = 0x7F00005B, + +}; + +/** +* This is custom extension to configure Low Latency Mode. +* +* STRUCT MEMBERS +* +* nSize : Size of Structure in bytes +* nVersion : OpenMAX IL specification version information +* bLowLatencyMode : Enable/Disable Low Latency mode +*/ + +typedef struct QOMX_EXTNINDEX_VIDEO_VENC_LOW_LATENCY_MODE +{ + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_BOOL bLowLatencyMode; +} QOMX_EXTNINDEX_VIDEO_VENC_LOW_LATENCY_MODE; + +/** +* This is custom extension to configure Encoder Aspect Ratio. +* +* STRUCT MEMBERS +* +* nSize : Size of Structure in bytes +* nVersion : OpenMAX IL specification version information +* nSARWidth : Horizontal aspect size +* nSARHeight : Vertical aspect size +*/ + +typedef struct QOMX_EXTNINDEX_VIDEO_VENC_SAR +{ + OMX_U32 nSize; + OMX_U32 nVersion; + OMX_U32 nSARWidth; + OMX_U32 nSARHeight; +} QOMX_EXTNINDEX_VIDEO_VENC_SAR; + +/** +* This is custom extension to configure Hier-p layers. +* This mode configures Hier-p layers dynamically. +* +* STRUCT MEMBERS +* +* nSize : Size of Structure in bytes +* nVersion : OpenMAX IL specification version information +* nNumHierLayers: Set the number of Hier-p layers for the session +* - This should be less than the MAX Hier-P +* layers set for the session. +*/ + +typedef struct QOMX_EXTNINDEX_VIDEO_HIER_P_LAYERS { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nNumHierLayers; +} QOMX_EXTNINDEX_VIDEO_HIER_P_LAYERS; + + +/** +* This is custom extension to configure Hybrid Hier-p settings. +* This mode is different from enabling Hier-p mode. This +* property enables Hier-p encoding with LTR referencing in each +* sub-GOP. +* +* STRUCT MEMBERS +* +* nSize : Size of Structure in bytes +* nVersion : OpenMAX IL specification version information +* nKeyFrameInterval : Indicates the I frame interval +* nHpLayers : Set the number of Hier-p layers for the session +* - This should be <= 6. (1 Base layer + +* 5 Enhancement layers) +* nTemporalLayerBitrateRatio[OMX_VIDEO_MAX_HP_LAYERS] : Bitrate to +* be set for each enhancement layer +* nMinQuantizer : minimum session QP +* nMaxQuantizer : Maximun session QP +*/ + +typedef struct QOMX_EXTNINDEX_VIDEO_HYBRID_HP_MODE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nKeyFrameInterval; + OMX_U32 nTemporalLayerBitrateRatio[OMX_VIDEO_MAX_HP_LAYERS]; + OMX_U32 nMinQuantizer; + OMX_U32 nMaxQuantizer; + OMX_U32 nHpLayers; +} QOMX_EXTNINDEX_VIDEO_HYBRID_HP_MODE; + +/** + * Encoder Performance Mode. This structure is used to set + * performance mode or power save mode when encoding. The search + * range is modified to save power or improve quality. + * + * STRUCT MEMBERS: + * OMX_U32 nPerfMode : Performance mode: + * 1: MAX_QUALITY + * 2: POWER_SAVE + */ + +typedef struct QOMX_EXTNINDEX_VIDEO_PERFMODE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPerfMode; +} QOMX_EXTNINDEX_VIDEO_PERFMODE; + +/** + * Initial QP parameter. This structure is used to enable + * vendor specific extension to let client enable setting + * initial QP values to I P B Frames + * + * STRUCT MEMBERS: + * nSize : Size of Structure in bytes + * nVersion : OpenMAX IL specification version information + * nPortIndex : Index of the port to which this structure applies + * OMX_U32 nQpI : First Iframe QP + * OMX_U32 nQpP : First Pframe QP + * OMX_U32 nQpB : First Bframe QP + * OMX_U32 bEnableInitQp : Bit field indicating which frame type(s) shall + * use the specified initial QP. + * Bit 0: Enable initial QP for I/IDR + * and use value specified in nInitQpI + * Bit 1: Enable initial QP for P + * and use value specified in nInitQpP + * Bit 2: Enable initial QP for B + * and use value specified in nInitQpB + */ + +typedef struct QOMX_EXTNINDEX_VIDEO_INITIALQP { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nQpI; + OMX_U32 nQpP; + OMX_U32 nQpB; + OMX_U32 bEnableInitQp; +} QOMX_EXTNINDEX_VIDEO_INITIALQP; + +/** + * Extension index parameter. This structure is used to enable + * vendor specific extension on input/output port and + * to pass the required flags and data, if any. + * The format of flags and data being passed is known to + * the client and component apriori. + * + * STRUCT MEMBERS: + * nSize : Size of Structure plus pData size + * nVersion : OMX specification version information + * nPortIndex : Indicates which port to set + * bEnable : Extension index enable (1) or disable (0) + * nFlags : Extension index flags, if any + * nDataSize : Size of the extension index data to follow + * pData : Extension index data, if present. + */ +typedef struct QOMX_EXTNINDEX_PARAMTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bEnable; + OMX_U32 nFlags; + OMX_U32 nDataSize; + OMX_PTR pData; +} QOMX_EXTNINDEX_PARAMTYPE; + +/** + * Range index parameter. This structure is used to enable + * vendor specific extension on input/output port and + * to pass the required minimum and maximum values + * + * STRUCT MEMBERS: + * nSize : Size of Structure in bytes + * nVersion : OpenMAX IL specification version information + * nPortIndex : Index of the port to which this structure applies + * nMin : Minimum value + * nMax : Maximum value + * nSteSize : Step size + */ +typedef struct QOMX_EXTNINDEX_RANGETYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_S32 nMin; + OMX_S32 nMax; + OMX_S32 nStepSize; +} QOMX_EXTNINDEX_RANGETYPE; + +/** + * Specifies LTR mode types. + */ +typedef enum QOMX_VIDEO_LTRMODETYPE +{ + QOMX_VIDEO_LTRMode_Disable = 0x0, /**< LTR encoding is disabled */ + QOMX_VIDEO_LTRMode_Manual = 0x1, /**< In this mode, IL client configures + ** the encoder the LTR count and manually + ** controls the marking and use of LTR + ** frames during video encoding. + */ + QOMX_VIDEO_LTRMode_Auto = 0x2, /**< In this mode, IL client configures + ** the encoder the LTR count and LTR + ** period. The encoder marks LTR frames + ** automatically based on the LTR period + ** during video encoding. IL client controls + ** the use of LTR frames. + */ + QOMX_VIDEO_LTRMode_MAX = 0x7FFFFFFF /** Maximum LTR Mode type */ +} QOMX_VIDEO_LTRMODETYPE; + +/** + * LTR mode index parameter. This structure is used + * to enable vendor specific extension on output port + * to pass the LTR mode information. + * + * STRUCT MEMBERS: + * nSize : Size of Structure in bytes + * nVersion : OpenMAX IL specification version information + * nPortIndex : Index of the port to which this structure applies + * eLTRMode : Specifies the LTR mode used in encoder + */ +typedef struct QOMX_VIDEO_PARAM_LTRMODE_TYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + QOMX_VIDEO_LTRMODETYPE eLTRMode; +} QOMX_VIDEO_PARAM_LTRMODE_TYPE; + +/** + * LTR count index parameter. This structure is used + * to enable vendor specific extension on output port + * to pass the LTR count information. + * + * STRUCT MEMBERS: + * nSize : Size of Structure in bytes + * nVersion : OpenMAX IL specification version information + * nPortIndex : Index of the port to which this structure applies + * nCount : Specifies the number of LTR frames stored in the + * encoder component + */ +typedef struct QOMX_VIDEO_PARAM_LTRCOUNT_TYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nCount; +} QOMX_VIDEO_PARAM_LTRCOUNT_TYPE; + + +/** + * This should be used with OMX_QcomIndexParamVideoLTRCount extension. + */ +typedef QOMX_VIDEO_PARAM_LTRCOUNT_TYPE OMX_QCOM_VIDEO_PARAM_LTRCOUNT_TYPE; + +/** + * LTR period index parameter. This structure is used + * to enable vendor specific extension on output port + * to pass the LTR period information. + * + * STRUCT MEMBERS: + * nSize : Size of Structure in bytes + * nVersion : OpenMAX IL specification version information + * nPortIndex : Index of the port to which this structure applies + * nFrames : Specifies the number of frames between two consecutive + * LTR frames. + */ +typedef struct QOMX_VIDEO_CONFIG_LTRPERIOD_TYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nFrames; +} QOMX_VIDEO_CONFIG_LTRPERIOD_TYPE; + +/** + * Marks the next encoded frame as an LTR frame. + * STRUCT MEMBERS: + * nSize : Size of Structure in bytes + * nVersion : OpenMAX IL specification version information + * nPortIndex : Index of the port to which this structure applies + * nID : Specifies the identifier of the LTR frame to be marked + * as reference frame for encoding subsequent frames. + */ +typedef struct QOMX_VIDEO_CONFIG_LTRMARK_TYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nID; +} QOMX_VIDEO_CONFIG_LTRMARK_TYPE; + +/** + * This should be used with OMX_QcomIndexConfigVideoLTRMark extension. + */ +typedef QOMX_VIDEO_CONFIG_LTRMARK_TYPE OMX_QCOM_VIDEO_CONFIG_LTRMARK_TYPE; + +/** + * Specifies an LTR frame to encode subsequent frames. + * STRUCT MEMBERS: + * nSize : Size of Structure in bytes + * nVersion : OpenMAX IL specification version information + * nPortIndex : Index of the port to which this structure applies + * nID : Specifies the identifier of the LTR frame to be used + as reference frame for encoding subsequent frames. + * nFrames : Specifies the number of subsequent frames to be + encoded using the LTR frame with its identifier + nID as reference frame. Short-term reference frames + will be used thereafter. The value of 0xFFFFFFFF + indicates that all subsequent frames will be + encodedusing this LTR frame as reference frame. + */ +typedef struct QOMX_VIDEO_CONFIG_LTRUSE_TYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nID; + OMX_U32 nFrames; +} QOMX_VIDEO_CONFIG_LTRUSE_TYPE; + +/** + * This should be used with OMX_QcomIndexConfigVideoLTRUse extension. + */ +typedef QOMX_VIDEO_CONFIG_LTRUSE_TYPE OMX_QCOM_VIDEO_CONFIG_LTRUSE_TYPE; + +/** + * Enumeration used to define the video encoder modes + * + * ENUMS: + * EncoderModeDefault : Default video recording mode. + * All encoder settings made through + * OMX_SetParameter/OMX_SetConfig are applied. No + * parameter is overridden. + * EncoderModeMMS : Video recording mode for MMS (Multimedia Messaging + * Service). This mode is similar to EncoderModeDefault + * except that here the Rate control mode is overridden + * internally and set as a variant of variable bitrate with + * variable frame rate. After this mode is set if the IL + * client tries to set OMX_VIDEO_CONTROLRATETYPE via + * OMX_IndexParamVideoBitrate that would be rejected. For + * this, client should set mode back to EncoderModeDefault + * first and then change OMX_VIDEO_CONTROLRATETYPE. + */ +typedef enum QOMX_VIDEO_ENCODERMODETYPE +{ + QOMX_VIDEO_EncoderModeDefault = 0x00, + QOMX_VIDEO_EncoderModeMMS = 0x01, + QOMX_VIDEO_EncoderModeMax = 0x7FFFFFFF +} QOMX_VIDEO_ENCODERMODETYPE; + +/** + * This structure is used to set the video encoder mode. + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version info + * nPortIndex : Port that this structure applies to + * nMode : defines the video encoder mode + */ +typedef struct QOMX_VIDEO_PARAM_ENCODERMODETYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + QOMX_VIDEO_ENCODERMODETYPE nMode; +} QOMX_VIDEO_PARAM_ENCODERMODETYPE; + +/** + * This structure describes the parameters corresponding to the + * QOMX_VIDEO_SYNTAXHDRTYPE extension. This parameter can be queried + * during the loaded state. + */ + +typedef struct QOMX_VIDEO_SYNTAXHDRTYPE +{ + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion;/** OMX specification version information */ + OMX_U32 nPortIndex; /** Portindex which is extended by this structure */ + OMX_U32 nBytes; /** The number of bytes filled in to the buffer */ + OMX_U8 data[1]; /** Buffer to store the header information */ +} QOMX_VIDEO_SYNTAXHDRTYPE; + +/** + * This structure describes the parameters corresponding to the + * QOMX_VIDEO_TEMPORALSPATIALTYPE extension. This parameter can be set + * dynamically during any state except the state invalid. This is primarily + * used for setting MaxQP from the application. This is set on the out port. + */ + +typedef struct QOMX_VIDEO_TEMPORALSPATIALTYPE +{ + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion;/** OMX specification version information */ + OMX_U32 nPortIndex; /** Portindex which is extended by this structure */ + OMX_U32 nTSFactor; /** Temoral spatial tradeoff factor value in 0-100 */ +} QOMX_VIDEO_TEMPORALSPATIALTYPE; + +/** + * This structure describes the parameters corresponding to the + * OMX_QCOM_VIDEO_CONFIG_INTRAPERIODTYPE extension. This parameter can be set + * dynamically during any state except the state invalid. This is set on the out port. + */ + +typedef struct QOMX_VIDEO_INTRAPERIODTYPE +{ + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion;/** OMX specification version information */ + OMX_U32 nPortIndex; /** Portindex which is extended by this structure */ + OMX_U32 nIDRPeriod; /** This specifies coding a frame as IDR after every nPFrames + of intra frames. If this parameter is set to 0, only the + first frame of the encode session is an IDR frame. This + field is ignored for non-AVC codecs and is used only for + codecs that support IDR Period */ + OMX_U32 nPFrames; /** The number of "P" frames between two "I" frames */ + OMX_U32 nBFrames; /** The number of "B" frames between two "I" frames */ +} QOMX_VIDEO_INTRAPERIODTYPE; + +/** + * This structure describes the parameters corresponding to the + * OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE extension. This parameter can be set + * dynamically during any state except the state invalid. This is used for the buffer negotiation + * with other clients. This is set on the out port. + */ +typedef struct OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE +{ + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /** OMX specification version information */ + OMX_U32 nPortIndex; /** Portindex which is extended by this structure */ + OMX_U32 nBufferOccupancy; /** The number of bytes to be set for the buffer occupancy */ +} OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE; + +/** + * This structure describes the parameters corresponding to the + * OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE extension. This parameter can be set + * dynamically during any state except the state invalid. This is primarily used for the dynamic/random + * intrarefresh. This is set on the out port. + */ +typedef struct OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE +{ + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion;/** OMX specification version information */ + OMX_U32 nPortIndex; /** Portindex which is extended by this structure */ + OMX_U32 nRirMBs; /** The number of MBs to be set for intrarefresh */ +} OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE; + + +/** + * This structure describes the parameters corresponding to the + * OMX_QCOM_VIDEO_CONFIG_QPRANGE extension. This parameter can be set + * dynamically during any state except the state invalid. This is primarily + * used for the min/max QP to be set from the application. This + * is set on the out port. + */ +typedef struct OMX_QCOM_VIDEO_CONFIG_QPRANGE +{ + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion;/** OMX specification version information */ + OMX_U32 nPortIndex; /** Portindex which is extended by this structure */ + OMX_U32 nMinQP; /** The number for minimum quantization parameter */ + OMX_U32 nMaxQP; /** The number for maximum quantization parameter */ +} OMX_QCOM_VIDEO_CONFIG_QPRANGE; + +/** + * This structure describes the parameters for the + * OMX_QcomIndexParamH264AUDelimiter extension. It enables/disables + * the AU delimiters in the H264 stream, which is used by WFD. + */ +typedef struct OMX_QCOM_VIDEO_CONFIG_H264_AUD +{ + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion;/** OMX specification version information */ + OMX_BOOL bEnable; /** Enable/disable the setting */ +} OMX_QCOM_VIDEO_CONFIG_H264_AUD; + +typedef enum QOMX_VIDEO_PERF_LEVEL +{ + OMX_QCOM_PerfLevelNominal, + OMX_QCOM_PerfLevelTurbo +} QOMX_VIDEO_PERF_LEVEL; + +/** + * This structure describes the parameters corresponding + * to OMX_QcomIndexParamPerfLevel extension. It will set + * the performance mode specified as QOMX_VIDEO_PERF_LEVEL. + */ +typedef struct OMX_QCOM_VIDEO_PARAM_PERF_LEVEL { + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /** OMX specification version information */ + QOMX_VIDEO_PERF_LEVEL ePerfLevel; /** Performance level */ +} OMX_QCOM_VIDEO_PARAM_PERF_LEVEL; + +/** + * This structure describes the parameters corresponding + * to OMX_QcomIndexConfigPerfLevel extension. It will set + * the performance mode specified as QOMX_VIDEO_PERF_LEVEL. + */ +typedef struct OMX_QCOM_VIDEO_CONFIG_PERF_LEVEL { + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /** OMX specification version information */ + QOMX_VIDEO_PERF_LEVEL ePerfLevel; /** Performance level */ +} OMX_QCOM_VIDEO_CONFIG_PERF_LEVEL; + +typedef enum QOMX_VIDEO_PICTURE_TYPE_DECODE +{ + OMX_QCOM_PictypeDecode_IPB, + OMX_QCOM_PictypeDecode_I +} QOMX_VIDEO_PICTURE_TYPE_DECODE; + +/** + * This structure describes the parameters corresponding + * to OMX_QcomIndexConfigPictureTypeDecode extension. It + * will set the picture type decode specified by eDecodeType. + */ +typedef struct OMX_QCOM_VIDEO_CONFIG_PICTURE_TYPE_DECODE { + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /** OMX specification version information */ + QOMX_VIDEO_PICTURE_TYPE_DECODE eDecodeType; /** Decode type */ +} OMX_QCOM_VIDEO_CONFIG_PICTURE_TYPE_DECODE; + +/** + * This structure describes the parameters corresponding + * to OMX_QcomIndexParamH264VUITimingInfo extension. It + * will enable/disable the VUI timing info. + */ +typedef struct OMX_QCOM_VIDEO_PARAM_VUI_TIMING_INFO { + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /** OMX specification version information */ + OMX_BOOL bEnable; /** Enable/disable the setting */ +} OMX_QCOM_VIDEO_PARAM_VUI_TIMING_INFO; + +/** + * This structure describes the parameters corresponding + * to OMX_QcomIndexParamVQZIPSEIType extension. It + * will enable/disable the VQZIP SEI info. + */ +typedef struct OMX_QTI_VIDEO_PARAM_VQZIP_SEI_TYPE { + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /** OMX specification version information */ + OMX_BOOL bEnable; /** Enable/disable the setting */ +} OMX_QTI_VIDEO_PARAM_VQZIP_SEI_TYPE; + +/** + * This structure describes the parameters corresponding + * to OMX_QcomIndexParamPeakBitrate extension. It will + * set the peak bitrate specified by nPeakBitrate. + */ +typedef struct OMX_QCOM_VIDEO_PARAM_PEAK_BITRATE { + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /** OMX specification version information */ + OMX_U32 nPeakBitrate; /** Peak bitrate value */ +} OMX_QCOM_VIDEO_PARAM_PEAK_BITRATE; + +/** + * This structure describes the parameters corresponding + * to OMX_QTIIndexParamForceCompressedForDPB extension. Enabling + * this extension will force the split mode DPB(compressed)/OPB(Linear) + * for all resolutions.On some chipsets preferred mode would be combined + * Linear for both DPB/OPB to save memory. For example on 8996 preferred mode + * would be combined linear for resolutions <= 1080p . + * Enabling this might save power but with the cost + * of increased memory i.e almost double the number on output YUV buffers. + */ +typedef struct OMX_QTI_VIDEO_PARAM_FORCE_COMPRESSED_FOR_DPB_TYPE { + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion; /** OMX specification version information */ + OMX_BOOL bEnable; /** Enable/disable the setting */ +} OMX_QTI_VIDEO_PARAM_FORCE_COMPRESSED_FOR_DPB_TYPE; + +/** + * This structure describes the parameters corresponding + * to OMX_QTIIndexParamForceUnCompressedForOPB extension. Enabling this + * extension will force the OPB to be linear for the current video session. + * If this property is not set, then the OPB will be set to linear or compressed + * based on resolution selected and/or if cpu access is requested on the + * OPB buffer. + */ +typedef struct OMX_QTI_VIDEO_PARAM_FORCE_UNCOMPRESSED_FOR_OPB_TYPE { + OMX_U32 nSize; /** Sizeo f the structure in bytes */ + OMX_VERSIONTYPE nVersion; /** OMX specification version information */ + OMX_BOOL bEnable; /** Enable/disable the setting */ +} OMX_QTI_VIDEO_PARAM_FORCE_UNCOMPRESSED_FOR_OPB_TYPE; + +typedef struct OMX_VENDOR_EXTRADATATYPE { + OMX_U32 nPortIndex; + OMX_U32 nDataSize; + OMX_U8 *pData; // cdata (codec_data/extradata) +} OMX_VENDOR_EXTRADATATYPE; + +/** + * This structure describes the parameters corresponding to the + * OMX_VENDOR_VIDEOFRAMERATE extension. This parameter can be set + * dynamically during any state except the state invalid. This is + * used for frame rate to be set from the application. This + * is set on the in port. + */ +typedef struct OMX_VENDOR_VIDEOFRAMERATE { + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion;/** OMX specification version information */ + OMX_U32 nPortIndex; /** Portindex which is extended by this structure */ + OMX_U32 nFps; /** Frame rate value */ + OMX_BOOL bEnabled; /** Flag to enable or disable client's frame rate value */ +} OMX_VENDOR_VIDEOFRAMERATE; + +typedef enum OMX_INDEXVENDORTYPE { + OMX_IndexVendorFileReadInputFilename = 0xFF000001, + OMX_IndexVendorParser3gpInputFilename = 0xFF000002, + OMX_IndexVendorVideoExtraData = 0xFF000003, + OMX_IndexVendorAudioExtraData = 0xFF000004, + OMX_IndexVendorVideoFrameRate = 0xFF000005, +} OMX_INDEXVENDORTYPE; + +typedef enum OMX_QCOM_VC1RESOLUTIONTYPE +{ + OMX_QCOM_VC1_PICTURE_RES_1x1, + OMX_QCOM_VC1_PICTURE_RES_2x1, + OMX_QCOM_VC1_PICTURE_RES_1x2, + OMX_QCOM_VC1_PICTURE_RES_2x2 +} OMX_QCOM_VC1RESOLUTIONTYPE; + +typedef enum OMX_QCOM_INTERLACETYPE +{ + OMX_QCOM_InterlaceFrameProgressive, + OMX_QCOM_InterlaceInterleaveFrameTopFieldFirst, + OMX_QCOM_InterlaceInterleaveFrameBottomFieldFirst, + OMX_QCOM_InterlaceFrameTopFieldFirst, + OMX_QCOM_InterlaceFrameBottomFieldFirst, + OMX_QCOM_InterlaceFieldTop, + OMX_QCOM_InterlaceFieldBottom +}OMX_QCOM_INTERLACETYPE; + +typedef struct OMX_QCOM_PARAM_VIDEO_INTERLACETYPE +{ + OMX_U32 nSize; /** Size of the structure in bytes */ + OMX_VERSIONTYPE nVersion;/** OMX specification version information */ + OMX_U32 nPortIndex; /** Portindex which is extended by this structure */ + OMX_BOOL bInterlace; /** Interlace content **/ +}OMX_QCOM_PARAM_VIDEO_INTERLACETYPE; + +typedef struct OMX_QCOM_CONFIG_INTERLACETYPE +{ + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nIndex; + OMX_QCOM_INTERLACETYPE eInterlaceType; +}OMX_QCOM_CONFIG_INTERLACETYPE; + +#define MAX_PAN_SCAN_WINDOWS 4 + +typedef struct OMX_QCOM_PANSCAN +{ + OMX_U32 numWindows; + OMX_QCOMRectangle window[MAX_PAN_SCAN_WINDOWS]; +} OMX_QCOM_PANSCAN; + +typedef struct OMX_QCOM_ASPECT_RATIO +{ + OMX_U32 aspectRatioX; + OMX_U32 aspectRatioY; +} OMX_QCOM_ASPECT_RATIO; + +typedef struct OMX_QCOM_DISPLAY_ASPECT_RATIO +{ + OMX_U32 displayVerticalSize; + OMX_U32 displayHorizontalSize; +} OMX_QCOM_DISPLAY_ASPECT_RATIO; + +typedef struct OMX_QCOM_FRAME_PACK_ARRANGEMENT +{ + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 id; + OMX_U32 cancel_flag; + OMX_U32 type; + OMX_U32 quincunx_sampling_flag; + OMX_U32 content_interpretation_type; + OMX_U32 spatial_flipping_flag; + OMX_U32 frame0_flipped_flag; + OMX_U32 field_views_flag; + OMX_U32 current_frame_is_frame0_flag; + OMX_U32 frame0_self_contained_flag; + OMX_U32 frame1_self_contained_flag; + OMX_U32 frame0_grid_position_x; + OMX_U32 frame0_grid_position_y; + OMX_U32 frame1_grid_position_x; + OMX_U32 frame1_grid_position_y; + OMX_U32 reserved_byte; + OMX_U32 repetition_period; + OMX_U32 extension_flag; +} OMX_QCOM_FRAME_PACK_ARRANGEMENT; + +typedef struct OMX_QCOM_EXTRADATA_QP +{ + OMX_U32 nQP; +} OMX_QCOM_EXTRADATA_QP; + +typedef struct OMX_QCOM_EXTRADATA_BITS_INFO +{ + OMX_U32 header_bits; + OMX_U32 frame_bits; +} OMX_QCOM_EXTRADATA_BITS_INFO; + +typedef struct OMX_QCOM_EXTRADATA_USERDATA { + OMX_U32 type; + OMX_U32 data[1]; +} OMX_QCOM_EXTRADATA_USERDATA; + +typedef struct OMX_QCOM_EXTRADATA_FRAMEINFO +{ + // common frame meta data. interlace related info removed + OMX_VIDEO_PICTURETYPE ePicType; + OMX_QCOM_INTERLACETYPE interlaceType; + OMX_QCOM_PANSCAN panScan; + OMX_QCOM_ASPECT_RATIO aspectRatio; + OMX_QCOM_DISPLAY_ASPECT_RATIO displayAspectRatio; + OMX_U32 nConcealedMacroblocks; + OMX_U32 nFrameRate; + OMX_TICKS nTimeStamp; +} OMX_QCOM_EXTRADATA_FRAMEINFO; + +typedef struct OMX_QCOM_EXTRADATA_FRAMEDIMENSION +{ + /** Frame Dimensions added to each YUV buffer */ + OMX_U32 nDecWidth; /** Width rounded to multiple of 16 */ + OMX_U32 nDecHeight; /** Height rounded to multiple of 16 */ + OMX_U32 nActualWidth; /** Actual Frame Width */ + OMX_U32 nActualHeight; /** Actual Frame Height */ + +} OMX_QCOM_EXTRADATA_FRAMEDIMENSION; + +typedef struct OMX_QCOM_H264EXTRADATA +{ + OMX_U64 seiTimeStamp; +} OMX_QCOM_H264EXTRADATA; + +typedef struct OMX_QCOM_VC1EXTRADATA +{ + OMX_U32 nVC1RangeY; + OMX_U32 nVC1RangeUV; + OMX_QCOM_VC1RESOLUTIONTYPE eVC1PicResolution; +} OMX_QCOM_VC1EXTRADATA; + +typedef union OMX_QCOM_EXTRADATA_CODEC_DATA +{ + OMX_QCOM_H264EXTRADATA h264ExtraData; + OMX_QCOM_VC1EXTRADATA vc1ExtraData; +} OMX_QCOM_EXTRADATA_CODEC_DATA; + +typedef struct OMX_QCOM_EXTRADATA_MBINFO +{ + OMX_U32 nFormat; + OMX_U32 nDataSize; + OMX_U8 data[0]; +} OMX_QCOM_EXTRADATA_MBINFO; + +typedef struct OMX_QCOM_EXTRADATA_VQZIPSEI { + OMX_U32 nSize; + OMX_U8 data[0]; +} OMX_QCOM_EXTRADATA_VQZIPSEI; + +typedef struct OMX_QTI_VIDEO_PARAM_ENABLE_ROIINFO { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bEnableRoiInfo; +} OMX_QTI_VIDEO_PARAM_ENABLE_ROIINFO; + +typedef struct OMX_QTI_VIDEO_CONFIG_ROIINFO { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_S32 nUpperQpOffset; + OMX_S32 nLowerQpOffset; + OMX_BOOL bUseRoiInfo; + OMX_S32 nRoiMBInfoSize; + OMX_PTR pRoiMBInfo; +} OMX_QTI_VIDEO_CONFIG_ROIINFO; + +typedef enum OMX_QCOM_EXTRADATATYPE +{ + OMX_ExtraDataFrameInfo = 0x7F000001, + OMX_ExtraDataH264 = 0x7F000002, + OMX_ExtraDataVC1 = 0x7F000003, + OMX_ExtraDataFrameDimension = 0x7F000004, + OMX_ExtraDataVideoEncoderSliceInfo = 0x7F000005, + OMX_ExtraDataConcealMB = 0x7F000006, + OMX_ExtraDataInterlaceFormat = 0x7F000007, + OMX_ExtraDataPortDef = 0x7F000008, + OMX_ExtraDataMP2ExtnData = 0x7F000009, + OMX_ExtraDataMP2UserData = 0x7F00000a, + OMX_ExtraDataVideoLTRInfo = 0x7F00000b, + OMX_ExtraDataFramePackingArrangement = 0x7F00000c, + OMX_ExtraDataQP = 0x7F00000d, + OMX_ExtraDataInputBitsInfo = 0x7F00000e, + OMX_ExtraDataVideoEncoderMBInfo = 0x7F00000f, + OMX_ExtraDataVQZipSEI = 0x7F000010, +} OMX_QCOM_EXTRADATATYPE; + +typedef struct OMX_STREAMINTERLACEFORMATTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bInterlaceFormat; + OMX_U32 nInterlaceFormats; +} OMX_STREAMINTERLACEFORMAT; + +typedef enum OMX_INTERLACETYPE +{ + OMX_InterlaceFrameProgressive, + OMX_InterlaceInterleaveFrameTopFieldFirst, + OMX_InterlaceInterleaveFrameBottomFieldFirst, + OMX_InterlaceFrameTopFieldFirst, + OMX_InterlaceFrameBottomFieldFirst +} OMX_INTERLACES; + + +#define OMX_EXTRADATA_HEADER_SIZE 20 + +/** + * AVC profile types, each profile indicates support for various + * performance bounds and different annexes. + */ +typedef enum QOMX_VIDEO_AVCPROFILETYPE { + QOMX_VIDEO_AVCProfileBaseline = OMX_VIDEO_AVCProfileBaseline, + QOMX_VIDEO_AVCProfileMain = OMX_VIDEO_AVCProfileMain, + QOMX_VIDEO_AVCProfileExtended = OMX_VIDEO_AVCProfileExtended, + QOMX_VIDEO_AVCProfileHigh = OMX_VIDEO_AVCProfileHigh, + QOMX_VIDEO_AVCProfileHigh10 = OMX_VIDEO_AVCProfileHigh10, + QOMX_VIDEO_AVCProfileHigh422 = OMX_VIDEO_AVCProfileHigh422, + QOMX_VIDEO_AVCProfileHigh444 = OMX_VIDEO_AVCProfileHigh444, + /* QCom specific profile indexes */ + QOMX_VIDEO_AVCProfileConstrained = OMX_VIDEO_AVCProfileVendorStartUnused, + QOMX_VIDEO_AVCProfileConstrainedBaseline, + QOMX_VIDEO_AVCProfileConstrainedHigh, +} QOMX_VIDEO_AVCPROFILETYPE; + + +/** + * H.264 MVC Profiles + */ +typedef enum QOMX_VIDEO_MVCPROFILETYPE { + QOMX_VIDEO_MVCProfileStereoHigh = 0x1, + QOMX_VIDEO_MVCProfileMultiViewHigh = 0x2, + QOMX_VIDEO_MVCProfileKhronosExtensions = 0x6F000000, + QOMX_VIDEO_MVCProfileVendorStartUnused = 0x7F000000, + QOMX_VIDEO_MVCProfileMax = 0x7FFFFFFF +} QOMX_VIDEO_MVCPROFILETYPE; + +/** + * H.264 MVC Levels + */ +typedef enum QOMX_VIDEO_MVCLEVELTYPE { + QOMX_VIDEO_MVCLevel1 = 0x01, /**< Level 1 */ + QOMX_VIDEO_MVCLevel1b = 0x02, /**< Level 1b */ + QOMX_VIDEO_MVCLevel11 = 0x04, /**< Level 1.1 */ + QOMX_VIDEO_MVCLevel12 = 0x08, /**< Level 1.2 */ + QOMX_VIDEO_MVCLevel13 = 0x10, /**< Level 1.3 */ + QOMX_VIDEO_MVCLevel2 = 0x20, /**< Level 2 */ + QOMX_VIDEO_MVCLevel21 = 0x40, /**< Level 2.1 */ + QOMX_VIDEO_MVCLevel22 = 0x80, /**< Level 2.2 */ + QOMX_VIDEO_MVCLevel3 = 0x100, /**< Level 3 */ + QOMX_VIDEO_MVCLevel31 = 0x200, /**< Level 3.1 */ + QOMX_VIDEO_MVCLevel32 = 0x400, /**< Level 3.2 */ + QOMX_VIDEO_MVCLevel4 = 0x800, /**< Level 4 */ + QOMX_VIDEO_MVCLevel41 = 0x1000, /**< Level 4.1 */ + QOMX_VIDEO_MVCLevel42 = 0x2000, /**< Level 4.2 */ + QOMX_VIDEO_MVCLevel5 = 0x4000, /**< Level 5 */ + QOMX_VIDEO_MVCLevel51 = 0x8000, /**< Level 5.1 */ + QOMX_VIDEO_MVCLevelKhronosExtensions = 0x6F000000, + QOMX_VIDEO_MVCLevelVendorStartUnused = 0x7F000000, + QOMX_VIDEO_MVCLevelMax = 0x7FFFFFFF +} QOMX_VIDEO_MVCLEVELTYPE; + +/** + * DivX Versions + */ +typedef enum QOMX_VIDEO_DIVXFORMATTYPE { + QOMX_VIDEO_DIVXFormatUnused = 0x01, /**< Format unused or unknown */ + QOMX_VIDEO_DIVXFormat311 = 0x02, /**< DivX 3.11 */ + QOMX_VIDEO_DIVXFormat4 = 0x04, /**< DivX 4 */ + QOMX_VIDEO_DIVXFormat5 = 0x08, /**< DivX 5 */ + QOMX_VIDEO_DIVXFormat6 = 0x10, /**< DivX 6 */ + QOMX_VIDEO_DIVXFormatKhronosExtensions = 0x6F000000, + QOMX_VIDEO_DIVXFormatVendorStartUnused = 0x7F000000, + QOMX_VIDEO_DIVXFormatMax = 0x7FFFFFFF +} QOMX_VIDEO_DIVXFORMATTYPE; + +/** + * DivX profile types, each profile indicates support for + * various performance bounds. + */ +typedef enum QOMX_VIDEO_DIVXPROFILETYPE { + QOMX_VIDEO_DivXProfileqMobile = 0x01, /**< qMobile Profile */ + QOMX_VIDEO_DivXProfileMobile = 0x02, /**< Mobile Profile */ + QOMX_VIDEO_DivXProfileMT = 0x04, /**< Mobile Theatre Profile */ + QOMX_VIDEO_DivXProfileHT = 0x08, /**< Home Theatre Profile */ + QOMX_VIDEO_DivXProfileHD = 0x10, /**< High Definition Profile */ + QOMX_VIDEO_DIVXProfileKhronosExtensions = 0x6F000000, + QOMX_VIDEO_DIVXProfileVendorStartUnused = 0x7F000000, + QOMX_VIDEO_DIVXProfileMax = 0x7FFFFFFF +} QOMX_VIDEO_DIVXPROFILETYPE; + +/** + * DivX Video Params + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * eFormat : Version of DivX stream / data + * eProfile : Profile of DivX stream / data + */ +typedef struct QOMX_VIDEO_PARAM_DIVXTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + QOMX_VIDEO_DIVXFORMATTYPE eFormat; + QOMX_VIDEO_DIVXPROFILETYPE eProfile; +} QOMX_VIDEO_PARAM_DIVXTYPE; + + + +/** + * VP Versions + */ +typedef enum QOMX_VIDEO_VPFORMATTYPE { + QOMX_VIDEO_VPFormatUnused = 0x01, /**< Format unused or unknown */ + QOMX_VIDEO_VPFormat6 = 0x02, /**< VP6 Video Format */ + QOMX_VIDEO_VPFormat7 = 0x04, /**< VP7 Video Format */ + QOMX_VIDEO_VPFormat8 = 0x08, /**< VP8 Video Format */ + QOMX_VIDEO_VPFormat9 = 0x10, /**< VP9 Video Format */ + QOMX_VIDEO_VPFormatKhronosExtensions = 0x6F000000, + QOMX_VIDEO_VPFormatVendorStartUnused = 0x7F000000, + QOMX_VIDEO_VPFormatMax = 0x7FFFFFFF +} QOMX_VIDEO_VPFORMATTYPE; + +/** + * VP profile types, each profile indicates support for various + * encoding tools. + */ +typedef enum QOMX_VIDEO_VPPROFILETYPE { + QOMX_VIDEO_VPProfileSimple = 0x01, /**< Simple Profile, applies to VP6 only */ + QOMX_VIDEO_VPProfileAdvanced = 0x02, /**< Advanced Profile, applies to VP6 only */ + QOMX_VIDEO_VPProfileVersion0 = 0x04, /**< Version 0, applies to VP7 and VP8 */ + QOMX_VIDEO_VPProfileVersion1 = 0x08, /**< Version 1, applies to VP7 and VP8 */ + QOMX_VIDEO_VPProfileVersion2 = 0x10, /**< Version 2, applies to VP8 only */ + QOMX_VIDEO_VPProfileVersion3 = 0x20, /**< Version 3, applies to VP8 only */ + QOMX_VIDEO_VPProfileKhronosExtensions = 0x6F000000, + QOMX_VIDEO_VPProfileVendorStartUnused = 0x7F000000, + QOMX_VIDEO_VPProfileMax = 0x7FFFFFFF +} QOMX_VIDEO_VPPROFILETYPE; + +/** + * VP Video Params + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * eFormat : Format of VP stream / data + * eProfile : Profile or Version of VP stream / data + */ +typedef struct QOMX_VIDEO_PARAM_VPTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + QOMX_VIDEO_VPFORMATTYPE eFormat; + QOMX_VIDEO_VPPROFILETYPE eProfile; +} QOMX_VIDEO_PARAM_VPTYPE; + +/** + * Spark Versions + */ +typedef enum QOMX_VIDEO_SPARKFORMATTYPE { + QOMX_VIDEO_SparkFormatUnused = 0x01, /**< Format unused or unknown */ + QOMX_VIDEO_SparkFormat0 = 0x02, /**< Video Format Version 0 */ + QOMX_VIDEO_SparkFormat1 = 0x04, /**< Video Format Version 1 */ + QOMX_VIDEO_SparkFormatKhronosExtensions = 0x6F000000, + QOMX_VIDEO_SparkFormatVendorStartUnused = 0x7F000000, + QOMX_VIDEO_SparkFormatMax = 0x7FFFFFFF +} QOMX_VIDEO_SPARKFORMATTYPE; + +/** + * Spark Video Params + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * eFormat : Version of Spark stream / data + */ +typedef struct QOMX_VIDEO_PARAM_SPARKTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + QOMX_VIDEO_SPARKFORMATTYPE eFormat; +} QOMX_VIDEO_PARAM_SPARKTYPE; + + +typedef struct QOMX_VIDEO_QUERY_DECODER_INSTANCES { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nNumOfInstances; +} QOMX_VIDEO_QUERY_DECODER_INSTANCES; + +typedef struct QOMX_ENABLETYPE { + OMX_BOOL bEnable; +} QOMX_ENABLETYPE; + +typedef enum QOMX_VIDEO_EVENTS { + OMX_EventIndexsettingChanged = OMX_EventVendorStartUnused +} QOMX_VIDEO_EVENTS; + +typedef enum QOMX_VIDEO_PICTURE_ORDER { + QOMX_VIDEO_DISPLAY_ORDER = 0x1, + QOMX_VIDEO_DECODE_ORDER = 0x2 +} QOMX_VIDEO_PICTURE_ORDER; + +typedef struct QOMX_VIDEO_DECODER_PICTURE_ORDER { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + QOMX_VIDEO_PICTURE_ORDER eOutputPictureOrder; +} QOMX_VIDEO_DECODER_PICTURE_ORDER; + +typedef struct QOMX_INDEXEXTRADATATYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bEnabled; + OMX_INDEXTYPE nIndex; +} QOMX_INDEXEXTRADATATYPE; + +typedef struct QOMX_INDEXTIMESTAMPREORDER { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bEnable; +} QOMX_INDEXTIMESTAMPREORDER; + +typedef struct QOMX_INDEXDOWNSCALAR { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bEnable; +} QOMX_INDEXDOWNSCALAR; + +typedef struct QOMX_VIDEO_CUSTOM_BUFFERSIZE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nBufferSize; +} QOMX_VIDEO_CUSTOM_BUFFERSIZE; + +#define OMX_QCOM_INDEX_PARAM_VIDEO_SYNCFRAMEDECODINGMODE "OMX.QCOM.index.param.video.SyncFrameDecodingMode" +#define OMX_QCOM_INDEX_PARAM_INDEXEXTRADATA "OMX.QCOM.index.param.IndexExtraData" +#define OMX_QCOM_INDEX_PARAM_VIDEO_SLICEDELIVERYMODE "OMX.QCOM.index.param.SliceDeliveryMode" +#define OMX_QCOM_INDEX_PARAM_VIDEO_FRAMEPACKING_EXTRADATA "OMX.QCOM.index.param.video.FramePackingExtradata" +#define OMX_QCOM_INDEX_PARAM_VIDEO_QP_EXTRADATA "OMX.QCOM.index.param.video.QPExtradata" +#define OMX_QCOM_INDEX_PARAM_VIDEO_INPUTBITSINFO_EXTRADATA "OMX.QCOM.index.param.video.InputBitsInfoExtradata" +#define OMX_QCOM_INDEX_PARAM_VIDEO_EXTNUSER_EXTRADATA "OMX.QCOM.index.param.video.ExtnUserExtraData" +#define OMX_QCOM_INDEX_CONFIG_VIDEO_FRAMEPACKING_INFO "OMX.QCOM.index.config.video.FramePackingInfo" +#define OMX_QCOM_INDEX_PARAM_VIDEO_MPEG2SEQDISP_EXTRADATA "OMX.QCOM.index.param.video.Mpeg2SeqDispExtraData" + +#define OMX_QCOM_INDEX_PARAM_VIDEO_HIERSTRUCTURE "OMX.QCOM.index.param.video.HierStructure" +#define OMX_QCOM_INDEX_PARAM_VIDEO_LTRCOUNT "OMX.QCOM.index.param.video.LTRCount" +#define OMX_QCOM_INDEX_PARAM_VIDEO_LTRPERIOD "OMX.QCOM.index.param.video.LTRPeriod" +#define OMX_QCOM_INDEX_CONFIG_VIDEO_LTRUSE "OMX.QCOM.index.config.video.LTRUse" +#define OMX_QCOM_INDEX_CONFIG_VIDEO_LTRMARK "OMX.QCOM.index.config.video.LTRMark" +#define OMX_QCOM_INDEX_CONFIG_VIDEO_HIER_P_LAYERS "OMX.QCOM.index.config.video.hierplayers" +#define OMX_QCOM_INDEX_CONFIG_RECTANGLE_TYPE "OMX.QCOM.index.config.video.rectangle" +#define OMX_QCOM_INDEX_PARAM_VIDEO_BASE_LAYER_ID "OMX.QCOM.index.param.video.baselayerid" +#define OMX_QCOM_INDEX_CONFIG_VIDEO_QP "OMX.QCOM.index.config.video.qp" +#define OMX_QCOM_INDEX_PARAM_VIDEO_SAR "OMX.QCOM.index.param.video.sar" +#define OMX_QTI_INDEX_PARAM_VIDEO_LOW_LATENCY "OMX.QTI.index.param.video.LowLatency" + +#define OMX_QCOM_INDEX_PARAM_VIDEO_PASSINPUTBUFFERFD "OMX.QCOM.index.param.video.PassInputBufferFd" +#define OMX_QTI_INDEX_PARAM_VIDEO_PREFER_ADAPTIVE_PLAYBACK "OMX.QTI.index.param.video.PreferAdaptivePlayback" +#define OMX_QTI_INDEX_CONFIG_VIDEO_SETTIMEDATA "OMX.QTI.index.config.video.settimedata" +#define OMX_QTI_INDEX_PARAM_VIDEO_FORCE_COMPRESSED_FOR_DPB "OMX.QTI.index.param.video.ForceCompressedForDPB" +#define OMX_QTI_INDEX_PARAM_VIDEO_ENABLE_ROIINFO "OMX.QTI.index.param.enableRoiInfo" +#define OMX_QTI_INDEX_CONFIG_VIDEO_ROIINFO "OMX.QTI.index.config.RoiInfo" + +typedef enum { + QOMX_VIDEO_FRAME_PACKING_CHECKERBOARD = 0, + QOMX_VIDEO_FRAME_PACKING_COLUMN_INTERLEAVE = 1, + QOMX_VIDEO_FRAME_PACKING_ROW_INTERLEAVE = 2, + QOMX_VIDEO_FRAME_PACKING_SIDE_BY_SIDE = 3, + QOMX_VIDEO_FRAME_PACKING_TOP_BOTTOM = 4, + QOMX_VIDEO_FRAME_PACKING_TEMPORAL = 5, +} QOMX_VIDEO_FRAME_PACKING_ARRANGEMENT; + +typedef enum { + QOMX_VIDEO_CONTENT_UNSPECIFIED = 0, + QOMX_VIDEO_CONTENT_LR_VIEW = 1, + QOMX_VIDEO_CONTENT_RL_VIEW = 2, +} QOMX_VIDEO_CONTENT_INTERPRETATION; + +/** + * Specifies the extended picture types. These values should be + * OR'd along with the types defined in OMX_VIDEO_PICTURETYPE to + * signal all pictures types which are allowed. + * + * ENUMS: + * H.264 Specific Picture Types: IDR + */ +typedef enum QOMX_VIDEO_PICTURETYPE { + QOMX_VIDEO_PictureTypeIDR = OMX_VIDEO_PictureTypeVendorStartUnused + 0x1000 +} QOMX_VIDEO_PICTURETYPE; + +#define OMX_QCOM_INDEX_CONFIG_ACTIVE_REGION_DETECTION "OMX.QCOM.index.config.activeregiondetection" +#define OMX_QCOM_INDEX_CONFIG_ACTIVE_REGION_DETECTION_STATUS "OMX.QCOM.index.config.activeregiondetectionstatus" +#define OMX_QCOM_INDEX_CONFIG_SCALING_MODE "OMX.QCOM.index.config.scalingmode" +#define OMX_QCOM_INDEX_CONFIG_NOISEREDUCTION "OMX.QCOM.index.config.noisereduction" +#define OMX_QCOM_INDEX_CONFIG_IMAGEENHANCEMENT "OMX.QCOM.index.config.imageenhancement" +#define OMX_QCOM_INDEX_PARAM_HELDBUFFERCOUNT "OMX.QCOM.index.param.HeldBufferCount" /**< reference: QOMX_HELDBUFFERCOUNTTYPE */ + + +typedef struct QOMX_RECTTYPE { + OMX_S32 nLeft; + OMX_S32 nTop; + OMX_U32 nWidth; + OMX_U32 nHeight; +} QOMX_RECTTYPE; + +typedef struct QOMX_ACTIVEREGIONDETECTIONTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bEnable; + QOMX_RECTTYPE sROI; + OMX_U32 nNumExclusionRegions; + QOMX_RECTTYPE sExclusionRegions[1]; +} QOMX_ACTIVEREGIONDETECTIONTYPE; + +typedef struct QOMX_ACTIVEREGIONDETECTION_STATUSTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bDetected; + QOMX_RECTTYPE sDetectedRegion; +} QOMX_ACTIVEREGIONDETECTION_STATUSTYPE; + +typedef enum QOMX_SCALE_MODETYPE { + QOMX_SCALE_MODE_Normal, + QOMX_SCALE_MODE_Anamorphic, + QOMX_SCALE_MODE_Max = 0x7FFFFFFF +} QOMX_SCALE_MODETYPE; + +typedef struct QOMX_SCALINGMODETYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + QOMX_SCALE_MODETYPE eScaleMode; +} QOMX_SCALINGMODETYPE; + +typedef struct QOMX_NOISEREDUCTIONTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bEnable; + OMX_BOOL bAutoMode; + OMX_S32 nNoiseReduction; +} QOMX_NOISEREDUCTIONTYPE; + +typedef struct QOMX_IMAGEENHANCEMENTTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bEnable; + OMX_BOOL bAutoMode; + OMX_S32 nImageEnhancement; +} QOMX_IMAGEENHANCEMENTTYPE; + +/* + * these are part of OMX1.2 but JB MR2 branch doesn't have them defined + * OMX_IndexParamInterlaceFormat + * OMX_INTERLACEFORMATTYPE + */ +#ifndef OMX_IndexParamInterlaceFormat +#define OMX_IndexParamInterlaceFormat (0x7FF00000) +typedef struct OMX_INTERLACEFORMATTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nFormat; + OMX_TICKS nTimeStamp; +} OMX_INTERLACEFORMATTYPE; +#endif + +/** + * This structure is used to indicate the maximum number of buffers + * that a port will hold during data flow. + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version info + * nPortIndex : Port that this structure applies to + * nHeldBufferCount : Read-only, maximum number of buffers that will be held + */ +typedef struct QOMX_HELDBUFFERCOUNTTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nHeldBufferCount; +} QOMX_HELDBUFFERCOUNTTYPE; + +typedef enum QOMX_VIDEO_HIERARCHICALCODINGTYPE { + QOMX_HIERARCHICALCODING_P = 0x01, + QOMX_HIERARCHICALCODING_B = 0x02, +} QOMX_VIDEO_HIERARCHICALCODINGTYPE; + +typedef struct QOMX_VIDEO_HIERARCHICALLAYERS { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nNumLayers; + QOMX_VIDEO_HIERARCHICALCODINGTYPE eHierarchicalCodingType; +} QOMX_VIDEO_HIERARCHICALLAYERS; + +typedef struct QOMX_VIDEO_H264ENTROPYCODINGTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_BOOL bCabac; + OMX_U32 nCabacInitIdc; +} QOMX_VIDEO_H264ENTROPYCODINGTYPE; + + +/* VIDEO POSTPROCESSING CTRLS AND ENUMS */ +#define QOMX_VPP_HQV_CUSTOMPAYLOAD_SZ 256 +#define VPP_HQV_CONTROL_GLOBAL_START (VPP_HQV_CONTROL_CUST + 1) + +typedef enum QOMX_VPP_HQV_MODE { + VPP_HQV_MODE_OFF, + VPP_HQV_MODE_AUTO, + VPP_HQV_MODE_MANUAL, + VPP_HQV_MODE_MAX +} QOMX_VPP_HQV_MODE; + +typedef enum QOMX_VPP_HQVCONTROLTYPE { + VPP_HQV_CONTROL_CADE = 0x1, + VPP_HQV_CONTROL_CNR = 0x04, + VPP_HQV_CONTROL_AIE = 0x05, + VPP_HQV_CONTROL_FRC = 0x06, + VPP_HQV_CONTROL_CUST = 0x07, + VPP_HQV_CONTROL_GLOBAL_DEMO = VPP_HQV_CONTROL_GLOBAL_START, + VPP_HQV_CONTROL_MAX, +} QOMX_VPP_HQVCONTROLTYPE; + +typedef enum QOMX_VPP_HQV_HUE_MODE { + VPP_HQV_HUE_MODE_OFF, + VPP_HQV_HUE_MODE_ON, + VPP_HQV_HUE_MODE_MAX, +} QOMX_VPP_HQV_HUE_MODE; + +typedef enum QOMX_VPP_HQV_FRC_MODE { + VPP_HQV_FRC_MODE_OFF, + VPP_HQV_FRC_MODE_LOW, + VPP_HQV_FRC_MODE_MED, + VPP_HQV_FRC_MODE_HIGH, + VPP_HQV_FRC_MODE_MAX, +} QOMX_VPP_HQV_FRC_MODE; + + +typedef struct QOMX_VPP_HQVCTRL_CADE { + QOMX_VPP_HQV_MODE mode; + OMX_U32 level; + OMX_S32 contrast; + OMX_S32 saturation; +} QOMX_VPP_HQVCTRL_CADE; + +typedef struct QOMX_VPP_HQVCTRL_CNR { + QOMX_VPP_HQV_MODE mode; + OMX_U32 level; +} QOMX_VPP_HQVCTRL_CNR; + +typedef struct QOMX_VPP_HQVCTRL_AIE { + QOMX_VPP_HQV_MODE mode; + QOMX_VPP_HQV_HUE_MODE hue_mode; + OMX_U32 cade_level; + OMX_U32 ltm_level; +} QOMX_VPP_HQVCTRL_AIE; + +typedef struct QOMX_VPP_HQVCTRL_CUSTOM { + OMX_U32 id; + OMX_U32 len; + OMX_U8 data[QOMX_VPP_HQV_CUSTOMPAYLOAD_SZ]; +} QOMX_VPP_HQVCTRL_CUSTOM; + +typedef struct QOMX_VPP_HQVCTRL_GLOBAL_DEMO { + OMX_U32 process_percent; +} QOMX_VPP_HQVCTRL_GLOBAL_DEMO; + +typedef struct QOMX_VPP_HQVCTRL_FRC { + QOMX_VPP_HQV_FRC_MODE mode; +} QOMX_VPP_HQVCTRL_FRC; + +typedef struct QOMX_VPP_HQVCONTROL { + QOMX_VPP_HQV_MODE mode; + QOMX_VPP_HQVCONTROLTYPE ctrl_type; + union { + QOMX_VPP_HQVCTRL_CADE cade; + QOMX_VPP_HQVCTRL_CNR cnr; + QOMX_VPP_HQVCTRL_AIE aie; + QOMX_VPP_HQVCTRL_CUSTOM custom; + QOMX_VPP_HQVCTRL_GLOBAL_DEMO global_demo; + QOMX_VPP_HQVCTRL_FRC frc; + }; +} QOMX_VPP_HQVCONTROL; + +/* STRUCTURE TO TURN VPP ON */ +typedef struct QOMX_VPP_ENABLE { + OMX_BOOL enable_vpp; +} QOMX_VPP_ENABLE; + +typedef enum OMX_QOMX_VIDEO_MBISTATISTICSTYPE { + QOMX_MBI_STATISTICS_MODE_DEFAULT = 0, + QOMX_MBI_STATISTICS_MODE_1 = 0x01, + QOMX_MBI_STATISTICS_MODE_2 = 0x02, +} OMX_QOMX_VIDEO_MBISTATISTICSTYPE; + +typedef struct OMX_QOMX_VIDEO_MBI_STATISTICS { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_QOMX_VIDEO_MBISTATISTICSTYPE eMBIStatisticsType; +} OMX_QOMX_VIDEO_MBI_STATISTICS; + +typedef struct QOMX_VIDEO_BATCHSIZETYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nBatchSize; +} QOMX_VIDEO_BATCHSIZETYPE; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __OMX_QCOM_EXTENSIONS_H__ */ diff --git a/third_party/openmax/include/OMX_Skype_VideoExtensions.h b/third_party/openmax/include/OMX_Skype_VideoExtensions.h new file mode 100644 index 000000000..5cc832930 --- /dev/null +++ b/third_party/openmax/include/OMX_Skype_VideoExtensions.h @@ -0,0 +1,155 @@ +/*@@@+++@@@@****************************************************************** + + Microsoft Skype Engineering + Copyright (C) 2014 Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +*@@@---@@@@******************************************************************/ + + +#ifndef __OMX_SKYPE_VIDEOEXTENSIONS_H__ +#define __OMX_SKYPE_VIDEOEXTENSIONS_H__ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include + +#pragma pack(push, 1) + + +typedef enum OMX_SKYPE_VIDEO_SliceControlMode +{ + OMX_SKYPE_VIDEO_SliceControlModeNone = 0, + OMX_SKYPE_VIDEO_SliceControlModeMB = 1, + OMX_SKYPE_VIDEO_SliceControlModeByte = 2, + OMX_SKYPE_VIDEO_SliceControlModMBRow = 3, +} OMX_SKYPE_VIDEO_SliceControlMode; + + +typedef enum OMX_SKYPE_VIDEO_HierarType +{ + OMX_SKYPE_VIDEO_HierarType_P = 0x01, + OMX_SKYPE_VIDEO_HierarType_B = 0x02, +} OMX_SKYPE_VIDEO_HIERAR_HierarType; + +typedef enum OMX_VIDEO_EXTENSION_AVCPROFILETYPE +{ + OMX_VIDEO_EXT_AVCProfileConstrainedBaseline = 0x01, + OMX_VIDEO_EXT_AVCProfileConstrainedHigh = 0x02, +} OMX_VIDEO_EXTENSION_AVCPROFILETYPE; + +typedef struct OMX_SKYPE_VIDEO_ENCODERPARAMS { + OMX_BOOL bLowLatency; + OMX_BOOL bUseExtendedProfile; + OMX_BOOL bSequenceHeaderWithIDR; + OMX_VIDEO_EXTENSION_AVCPROFILETYPE eProfile; + OMX_U32 nLTRFrames; + OMX_SKYPE_VIDEO_HierarType eHierarType; + OMX_U32 nMaxTemporalLayerCount; + OMX_SKYPE_VIDEO_SliceControlMode eSliceControlMode; + OMX_U32 nSarIndex; + OMX_U32 nSarWidth; + OMX_U32 nSarHeight; +} OMX_SKYPE_VIDEO_ENCODERPARAMS; + +typedef struct OMX_SKYPE_VIDEO_PARAM_ENCODERSETTING { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_SKYPE_VIDEO_ENCODERPARAMS stEncParam; +} OMX_SKYPE_VIDEO_PARAM_ENCODESETTING; + +typedef struct OMX_SKYPE_VIDEO_ENCODERCAP { + OMX_BOOL bLowLatency; + OMX_U32 nMaxFrameWidth; + OMX_U32 nMaxFrameHeight; + OMX_U32 nMaxInstances; + OMX_U32 nMaxTemporaLayerCount; + OMX_U32 nMaxRefFrames; + OMX_U32 nMaxLTRFrames; + OMX_VIDEO_AVCLEVELTYPE nMaxLevel; + OMX_U32 nSliceControlModesBM; + OMX_U32 nMaxMacroblockProcessingRate; + OMX_U32 xMinScaleFactor; +} OMX_SKYPE_VIDEO_ENCODERCAP; + +typedef struct OMX_SKYPE_VIDEO_PARAM_ENCODERCAP { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_SKYPE_VIDEO_ENCODERCAP stEncCap; +} OMX_SKYPE_VIDEO_PARAM_ENCODERCAP; + +typedef struct OMX_SKYPE_VIDEO_DECODERCAP { + OMX_BOOL bLowLatency; + OMX_U32 nMaxFrameWidth; + OMX_U32 nMaxFrameHeight; + OMX_U32 nMaxInstances; + OMX_VIDEO_AVCLEVELTYPE nMaxLevel; + OMX_U32 nMaxMacroblockProcessingRate; +} OMX_SKYPE_VIDEO_DECODERCAP; + +typedef struct OMX_SKYPE_VIDEO_PARAM_DECODERCAP { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_SKYPE_VIDEO_DECODERCAP stDecoderCap; +} OMX_SKYPE_VIDEO_PARAM_DECODERCAP; + +typedef struct OMX_SKYPE_VIDEO_CONFIG_QP { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nQP; +} OMX_SKYPE_VIDEO_CONFIG_QP; + +typedef struct OMX_SKYPE_VIDEO_CONFIG_BASELAYERPID{ + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nPID; +} OMX_SKYPE_VIDEO_CONFIG_BASELAYERPID; + +typedef struct OMX_SKYPE_VIDEO_PARAM_DRIVERVER { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U64 nDriverVersion; +} OMX_SKYPE_VIDEO_PARAM_DRIVERVER; + +typedef enum OMX_SKYPE_VIDEO_DownScaleFactor +{ + OMX_SKYPE_VIDEO_DownScaleFactor_1_1 = 0, + OMX_SKYPE_VIDEO_DownScaleFactor_Equal_AR = 1, + OMX_SKYPE_VIDEO_DownScaleFactor_Any = 2, +} OMX_SKYPE_VIDEO_DownScaleFactor; + +#pragma pack(pop) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/openmax/include/OMX_Types.h b/third_party/openmax/include/OMX_Types.h new file mode 100644 index 000000000..3b9fab4fc --- /dev/null +++ b/third_party/openmax/include/OMX_Types.h @@ -0,0 +1,359 @@ +/* + * Copyright (c) 2008 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/** OMX_Types.h - OpenMax IL version 1.1.2 + * The OMX_Types header file contains the primitive type definitions used by + * the core, the application and the component. This file may need to be + * modified to be used on systems that do not have "char" set to 8 bits, + * "short" set to 16 bits and "long" set to 32 bits. + */ + +#ifndef OMX_Types_h +#define OMX_Types_h + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** The OMX_API and OMX_APIENTRY are platform specific definitions used + * to declare OMX function prototypes. They are modified to meet the + * requirements for a particular platform */ +#ifdef __SYMBIAN32__ +# ifdef __OMX_EXPORTS +# define OMX_API __declspec(dllexport) +# else +# ifdef _WIN32 +# define OMX_API __declspec(dllexport) +# else +# define OMX_API __declspec(dllimport) +# endif +# endif +#else +# ifdef _WIN32 +# ifdef __OMX_EXPORTS +# define OMX_API __declspec(dllexport) +# else +# define OMX_API __declspec(dllimport) +# endif +# else +# ifdef __OMX_EXPORTS +# define OMX_API +# else +# define OMX_API extern +# endif +# endif +#endif + +#ifndef OMX_APIENTRY +#define OMX_APIENTRY +#endif + +/** OMX_IN is used to identify inputs to an OMX function. This designation + will also be used in the case of a pointer that points to a parameter + that is used as an output. */ +#ifndef OMX_IN +#define OMX_IN +#endif + +/** OMX_OUT is used to identify outputs from an OMX function. This + designation will also be used in the case of a pointer that points + to a parameter that is used as an input. */ +#ifndef OMX_OUT +#define OMX_OUT +#endif + + +/** OMX_INOUT is used to identify parameters that may be either inputs or + outputs from an OMX function at the same time. This designation will + also be used in the case of a pointer that points to a parameter that + is used both as an input and an output. */ +#ifndef OMX_INOUT +#define OMX_INOUT +#endif + +/** OMX_ALL is used to as a wildcard to select all entities of the same type + * when specifying the index, or referring to a object by an index. (i.e. + * use OMX_ALL to indicate all N channels). When used as a port index + * for a config or parameter this OMX_ALL denotes that the config or + * parameter applies to the entire component not just one port. */ +#define OMX_ALL 0xFFFFFFFF + +/** In the following we define groups that help building doxygen documentation */ + +/** @defgroup core OpenMAX IL core + * Functions and structure related to the OMX IL core + */ + + /** @defgroup comp OpenMAX IL component + * Functions and structure related to the OMX IL component + */ + +/** @defgroup rpm Resource and Policy Management + * Structures for resource and policy management of components + */ + +/** @defgroup buf Buffer Management + * Buffer handling functions and structures + */ + +/** @defgroup tun Tunneling + * @ingroup core comp + * Structures and functions to manage tunnels among component ports + */ + +/** @defgroup cp Content Pipes + * @ingroup core + */ + + /** @defgroup metadata Metadata handling + * + */ + +/** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */ +typedef unsigned char OMX_U8; + +/** OMX_S8 is an 8 bit signed quantity that is byte aligned */ +typedef signed char OMX_S8; + +/** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */ +typedef unsigned short OMX_U16; + +/** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */ +typedef signed short OMX_S16; + +/** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */ +typedef unsigned int OMX_U32; + +/** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */ +typedef signed int OMX_S32; + + +/* Users with compilers that cannot accept the "long long" designation should + define the OMX_SKIP64BIT macro. It should be noted that this may cause + some components to fail to compile if the component was written to require + 64 bit integral types. However, these components would NOT compile anyway + since the compiler does not support the way the component was written. +*/ +#ifndef OMX_SKIP64BIT +#ifdef __SYMBIAN32__ +/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ +typedef unsigned long long OMX_U64; + +/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ +typedef signed long long OMX_S64; + +#elif defined(WIN32) + +/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ +typedef unsigned __int64 OMX_U64; + +/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ +typedef signed __int64 OMX_S64; + +#else /* WIN32 */ + +/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ +typedef unsigned long long OMX_U64; + +/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ +typedef signed long long OMX_S64; + +#endif /* WIN32 */ +#endif + + +/** The OMX_BOOL type is intended to be used to represent a true or a false + value when passing parameters to and from the OMX core and components. The + OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary. + */ +typedef enum OMX_BOOL { + OMX_FALSE = 0, + OMX_TRUE = !OMX_FALSE, + OMX_BOOL_MAX = 0x7FFFFFFF +} OMX_BOOL; + +#ifdef OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS + +typedef OMX_U32 OMX_PTR; +typedef OMX_PTR OMX_STRING; +typedef OMX_PTR OMX_BYTE; + +#else + +/** The OMX_PTR type is intended to be used to pass pointers between the OMX + applications and the OMX Core and components. This is a 32 bit pointer and + is aligned on a 32 bit boundary. + */ +typedef void* OMX_PTR; + +/** The OMX_STRING type is intended to be used to pass "C" type strings between + the application and the core and component. The OMX_STRING type is a 32 + bit pointer to a zero terminated string. The pointer is word aligned and + the string is byte aligned. + */ +typedef char* OMX_STRING; + +/** The OMX_BYTE type is intended to be used to pass arrays of bytes such as + buffers between the application and the component and core. The OMX_BYTE + type is a 32 bit pointer to a zero terminated string. The pointer is word + aligned and the string is byte aligned. + */ +typedef unsigned char* OMX_BYTE; + +/** OMX_UUIDTYPE is a very long unique identifier to uniquely identify + at runtime. This identifier should be generated by a component in a way + that guarantees that every instance of the identifier running on the system + is unique. */ + + +#endif + +typedef unsigned char OMX_UUIDTYPE[128]; + +/** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or + an output port. This enumeration is common across all component types. + */ +typedef enum OMX_DIRTYPE +{ + OMX_DirInput, /**< Port is an input port */ + OMX_DirOutput, /**< Port is an output port */ + OMX_DirMax = 0x7FFFFFFF +} OMX_DIRTYPE; + +/** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering + for numerical data (i.e. big endian, or little endian). + */ +typedef enum OMX_ENDIANTYPE +{ + OMX_EndianBig, /**< big endian */ + OMX_EndianLittle, /**< little endian */ + OMX_EndianMax = 0x7FFFFFFF +} OMX_ENDIANTYPE; + + +/** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data + is signed or unsigned + */ +typedef enum OMX_NUMERICALDATATYPE +{ + OMX_NumericalDataSigned, /**< signed data */ + OMX_NumericalDataUnsigned, /**< unsigned data */ + OMX_NumercialDataMax = 0x7FFFFFFF +} OMX_NUMERICALDATATYPE; + + +/** Unsigned bounded value type */ +typedef struct OMX_BU32 { + OMX_U32 nValue; /**< actual value */ + OMX_U32 nMin; /**< minimum for value (i.e. nValue >= nMin) */ + OMX_U32 nMax; /**< maximum for value (i.e. nValue <= nMax) */ +} OMX_BU32; + + +/** Signed bounded value type */ +typedef struct OMX_BS32 { + OMX_S32 nValue; /**< actual value */ + OMX_S32 nMin; /**< minimum for value (i.e. nValue >= nMin) */ + OMX_S32 nMax; /**< maximum for value (i.e. nValue <= nMax) */ +} OMX_BS32; + + +/** Structure representing some time or duration in microseconds. This structure + * must be interpreted as a signed 64 bit value. The quantity is signed to accommodate + * negative deltas and preroll scenarios. The quantity is represented in microseconds + * to accomodate high resolution timestamps (e.g. DVD presentation timestamps based + * on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g. + * individual audio samples delivered at 192 kHz). The quantity is 64 bit to + * accommodate a large dynamic range (signed 32 bit values would allow only for plus + * or minus 35 minutes). + * + * Implementations with limited precision may convert the signed 64 bit value to + * a signed 32 bit value internally but risk loss of precision. + */ +#ifndef OMX_SKIP64BIT +typedef OMX_S64 OMX_TICKS; +#else +typedef struct OMX_TICKS +{ + OMX_U32 nLowPart; /** low bits of the signed 64 bit tick value */ + OMX_U32 nHighPart; /** high bits of the signed 64 bit tick value */ +} OMX_TICKS; +#endif +#define OMX_TICKS_PER_SECOND 1000000 + +/** Define the public interface for the OMX Handle. The core will not use + this value internally, but the application should only use this value. + */ +typedef void* OMX_HANDLETYPE; + +typedef struct OMX_MARKTYPE +{ + OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will + generate a mark event upon + processing the mark. */ + OMX_PTR pMarkData; /**< Application specific data associated with + the mark sent on a mark event to disambiguate + this mark from others. */ +} OMX_MARKTYPE; + + +/** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the + * platform & operating specific object used to reference the display + * or can be used by a audio port for native audio rendering */ +typedef void* OMX_NATIVE_DEVICETYPE; + +/** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the + * platform & operating specific object used to reference the window */ +typedef void* OMX_NATIVE_WINDOWTYPE; + +/** The OMX_VERSIONTYPE union is used to specify the version for + a structure or component. For a component, the version is entirely + specified by the component vendor. Components doing the same function + from different vendors may or may not have the same version. For + structures, the version shall be set by the entity that allocates the + structure. For structures specified in the OMX 1.1 specification, the + value of the version shall be set to 1.1.0.0 in all cases. Access to the + OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or + by accessing one of the structure elements to, for example, check only + the Major revision. + */ +typedef union OMX_VERSIONTYPE +{ + struct + { + OMX_U8 nVersionMajor; /**< Major version accessor element */ + OMX_U8 nVersionMinor; /**< Minor version accessor element */ + OMX_U8 nRevision; /**< Revision version accessor element */ + OMX_U8 nStep; /**< Step version accessor element */ + } s; + OMX_U32 nVersion; /**< 32 bit value to make accessing the + version easily done in a single word + size copy/compare operation */ +} OMX_VERSIONTYPE; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif +/* File EOF */ diff --git a/third_party/openmax/include/OMX_Video.h b/third_party/openmax/include/OMX_Video.h new file mode 100644 index 000000000..64dbe87b4 --- /dev/null +++ b/third_party/openmax/include/OMX_Video.h @@ -0,0 +1,1082 @@ +/** + * Copyright (c) 2008 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/** + * @file OMX_Video.h - OpenMax IL version 1.1.2 + * The structures is needed by Video components to exchange parameters + * and configuration data with OMX components. + */ +#ifndef OMX_Video_h +#define OMX_Video_h + +/** @defgroup video OpenMAX IL Video Domain + * @ingroup iv + * Structures for OpenMAX IL Video domain + * @{ + */ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +/** + * Each OMX header must include all required header files to allow the + * header to compile without errors. The includes below are required + * for this header file to compile successfully + */ + +#include + + +/** + * Enumeration used to define the possible video compression codings. + * NOTE: This essentially refers to file extensions. If the coding is + * being used to specify the ENCODE type, then additional work + * must be done to configure the exact flavor of the compression + * to be used. For decode cases where the user application can + * not differentiate between MPEG-4 and H.264 bit streams, it is + * up to the codec to handle this. + */ +typedef enum OMX_VIDEO_CODINGTYPE { + OMX_VIDEO_CodingUnused, /**< Value when coding is N/A */ + OMX_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */ + OMX_VIDEO_CodingMPEG2, /**< AKA: H.262 */ + OMX_VIDEO_CodingH263, /**< H.263 */ + OMX_VIDEO_CodingMPEG4, /**< MPEG-4 */ + OMX_VIDEO_CodingWMV, /**< all versions of Windows Media Video */ + OMX_VIDEO_CodingRV, /**< all versions of Real Video */ + OMX_VIDEO_CodingAVC, /**< H.264/AVC */ + OMX_VIDEO_CodingMJPEG, /**< Motion JPEG */ + OMX_VIDEO_CodingVP8, /**< Google VP8, formerly known as On2 VP8 */ + OMX_VIDEO_CodingVP9, /**< Google VP9 */ + OMX_VIDEO_CodingHEVC, /**< HEVC */ + OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_CodingMax = 0x7FFFFFFF +} OMX_VIDEO_CODINGTYPE; + + +/** + * Data structure used to define a video path. The number of Video paths for + * input and output will vary by type of the Video component. + * + * Input (aka Source) : zero Inputs, one Output, + * Splitter : one Input, 2 or more Outputs, + * Processing Element : one Input, one output, + * Mixer : 2 or more inputs, one output, + * Output (aka Sink) : one Input, zero outputs. + * + * The PortDefinition structure is used to define all of the parameters + * necessary for the compliant component to setup an input or an output video + * path. If additional vendor specific data is required, it should be + * transmitted to the component using the CustomCommand function. Compliant + * components will prepopulate this structure with optimal values during the + * GetDefaultInitParams command. + * + * STRUCT MEMBERS: + * cMIMEType : MIME type of data for the port + * pNativeRender : Platform specific reference for a display if a + * sync, otherwise this field is 0 + * nFrameWidth : Width of frame to be used on channel if + * uncompressed format is used. Use 0 for unknown, + * don't care or variable + * nFrameHeight : Height of frame to be used on channel if + * uncompressed format is used. Use 0 for unknown, + * don't care or variable + * nStride : Number of bytes per span of an image + * (i.e. indicates the number of bytes to get + * from span N to span N+1, where negative stride + * indicates the image is bottom up + * nSliceHeight : Height used when encoding in slices + * nBitrate : Bit rate of frame to be used on channel if + * compressed format is used. Use 0 for unknown, + * don't care or variable + * xFramerate : Frame rate to be used on channel if uncompressed + * format is used. Use 0 for unknown, don't care or + * variable. Units are Q16 frames per second. + * bFlagErrorConcealment : Turns on error concealment if it is supported by + * the OMX component + * eCompressionFormat : Compression format used in this instance of the + * component. When OMX_VIDEO_CodingUnused is + * specified, eColorFormat is used + * eColorFormat : Decompressed format used by this component + * pNativeWindow : Platform specific reference for a window object if a + * display sink , otherwise this field is 0x0. + */ +typedef struct OMX_VIDEO_PORTDEFINITIONTYPE { + OMX_STRING cMIMEType; + OMX_NATIVE_DEVICETYPE pNativeRender; + OMX_U32 nFrameWidth; + OMX_U32 nFrameHeight; + OMX_S32 nStride; + OMX_U32 nSliceHeight; + OMX_U32 nBitrate; + OMX_U32 xFramerate; + OMX_BOOL bFlagErrorConcealment; + OMX_VIDEO_CODINGTYPE eCompressionFormat; + OMX_COLOR_FORMATTYPE eColorFormat; + OMX_NATIVE_WINDOWTYPE pNativeWindow; +} OMX_VIDEO_PORTDEFINITIONTYPE; + +/** + * Port format parameter. This structure is used to enumerate the various + * data input/output format supported by the port. + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Indicates which port to set + * nIndex : Indicates the enumeration index for the format from + * 0x0 to N-1 + * eCompressionFormat : Compression format used in this instance of the + * component. When OMX_VIDEO_CodingUnused is specified, + * eColorFormat is used + * eColorFormat : Decompressed format used by this component + * xFrameRate : Indicates the video frame rate in Q16 format + */ +typedef struct OMX_VIDEO_PARAM_PORTFORMATTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nIndex; + OMX_VIDEO_CODINGTYPE eCompressionFormat; + OMX_COLOR_FORMATTYPE eColorFormat; + OMX_U32 xFramerate; +} OMX_VIDEO_PARAM_PORTFORMATTYPE; + + +/** + * This is a structure for configuring video compression quantization + * parameter values. Codecs may support different QP values for different + * frame types. + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version info + * nPortIndex : Port that this structure applies to + * nQpI : QP value to use for index frames + * nQpP : QP value to use for P frames + * nQpB : QP values to use for bidirectional frames + */ +typedef struct OMX_VIDEO_PARAM_QUANTIZATIONTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nQpI; + OMX_U32 nQpP; + OMX_U32 nQpB; +} OMX_VIDEO_PARAM_QUANTIZATIONTYPE; + + +/** + * Structure for configuration of video fast update parameters. + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version info + * nPortIndex : Port that this structure applies to + * bEnableVFU : Enable/Disable video fast update + * nFirstGOB : Specifies the number of the first macroblock row + * nFirstMB : specifies the first MB relative to the specified first GOB + * nNumMBs : Specifies the number of MBs to be refreshed from nFirstGOB + * and nFirstMB + */ +typedef struct OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bEnableVFU; + OMX_U32 nFirstGOB; + OMX_U32 nFirstMB; + OMX_U32 nNumMBs; +} OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE; + + +/** + * Enumeration of possible bitrate control types + */ +typedef enum OMX_VIDEO_CONTROLRATETYPE { + OMX_Video_ControlRateDisable, + OMX_Video_ControlRateVariable, + OMX_Video_ControlRateConstant, + OMX_Video_ControlRateVariableSkipFrames, + OMX_Video_ControlRateConstantSkipFrames, + OMX_Video_ControlRateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_Video_ControlRateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_Video_ControlRateMax = 0x7FFFFFFF +} OMX_VIDEO_CONTROLRATETYPE; + + +/** + * Structure for configuring bitrate mode of a codec. + * + * STRUCT MEMBERS: + * nSize : Size of the struct in bytes + * nVersion : OMX spec version info + * nPortIndex : Port that this struct applies to + * eControlRate : Control rate type enum + * nTargetBitrate : Target bitrate to encode with + */ +typedef struct OMX_VIDEO_PARAM_BITRATETYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_VIDEO_CONTROLRATETYPE eControlRate; + OMX_U32 nTargetBitrate; +} OMX_VIDEO_PARAM_BITRATETYPE; + + +/** + * Enumeration of possible motion vector (MV) types + */ +typedef enum OMX_VIDEO_MOTIONVECTORTYPE { + OMX_Video_MotionVectorPixel, + OMX_Video_MotionVectorHalfPel, + OMX_Video_MotionVectorQuarterPel, + OMX_Video_MotionVectorEighthPel, + OMX_Video_MotionVectorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_Video_MotionVectorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_Video_MotionVectorMax = 0x7FFFFFFF +} OMX_VIDEO_MOTIONVECTORTYPE; + + +/** + * Structure for configuring the number of motion vectors used as well + * as their accuracy. + * + * STRUCT MEMBERS: + * nSize : Size of the struct in bytes + * nVersion : OMX spec version info + * nPortIndex : port that this structure applies to + * eAccuracy : Enumerated MV accuracy + * bUnrestrictedMVs : Allow unrestricted MVs + * bFourMV : Allow use of 4 MVs + * sXSearchRange : Search range in horizontal direction for MVs + * sYSearchRange : Search range in vertical direction for MVs + */ +typedef struct OMX_VIDEO_PARAM_MOTIONVECTORTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_VIDEO_MOTIONVECTORTYPE eAccuracy; + OMX_BOOL bUnrestrictedMVs; + OMX_BOOL bFourMV; + OMX_S32 sXSearchRange; + OMX_S32 sYSearchRange; +} OMX_VIDEO_PARAM_MOTIONVECTORTYPE; + + +/** + * Enumeration of possible methods to use for Intra Refresh + */ +typedef enum OMX_VIDEO_INTRAREFRESHTYPE { + OMX_VIDEO_IntraRefreshCyclic, + OMX_VIDEO_IntraRefreshAdaptive, + OMX_VIDEO_IntraRefreshBoth, + OMX_VIDEO_IntraRefreshKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_IntraRefreshVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_IntraRefreshRandom, + OMX_VIDEO_IntraRefreshMax = 0x7FFFFFFF +} OMX_VIDEO_INTRAREFRESHTYPE; + + +/** + * Structure for configuring intra refresh mode + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * eRefreshMode : Cyclic, Adaptive, or Both + * nAirMBs : Number of intra macroblocks to refresh in a frame when + * AIR is enabled + * nAirRef : Number of times a motion marked macroblock has to be + * intra coded + * nCirMBs : Number of consecutive macroblocks to be coded as "intra" + * when CIR is enabled + */ +typedef struct OMX_VIDEO_PARAM_INTRAREFRESHTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_VIDEO_INTRAREFRESHTYPE eRefreshMode; + OMX_U32 nAirMBs; + OMX_U32 nAirRef; + OMX_U32 nCirMBs; +} OMX_VIDEO_PARAM_INTRAREFRESHTYPE; + + +/** + * Structure for enabling various error correction methods for video + * compression. + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * bEnableHEC : Enable/disable header extension codes (HEC) + * bEnableResync : Enable/disable resynchronization markers + * nResynchMarkerSpacing : Resynch markers interval (in bits) to be + * applied in the stream + * bEnableDataPartitioning : Enable/disable data partitioning + * bEnableRVLC : Enable/disable reversible variable length + * coding + */ +typedef struct OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bEnableHEC; + OMX_BOOL bEnableResync; + OMX_U32 nResynchMarkerSpacing; + OMX_BOOL bEnableDataPartitioning; + OMX_BOOL bEnableRVLC; +} OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE; + + +/** + * Configuration of variable block-size motion compensation (VBSMC) + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * b16x16 : Enable inter block search 16x16 + * b16x8 : Enable inter block search 16x8 + * b8x16 : Enable inter block search 8x16 + * b8x8 : Enable inter block search 8x8 + * b8x4 : Enable inter block search 8x4 + * b4x8 : Enable inter block search 4x8 + * b4x4 : Enable inter block search 4x4 + */ +typedef struct OMX_VIDEO_PARAM_VBSMCTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL b16x16; + OMX_BOOL b16x8; + OMX_BOOL b8x16; + OMX_BOOL b8x8; + OMX_BOOL b8x4; + OMX_BOOL b4x8; + OMX_BOOL b4x4; +} OMX_VIDEO_PARAM_VBSMCTYPE; + + +/** + * H.263 profile types, each profile indicates support for various + * performance bounds and different annexes. + * + * ENUMS: + * Baseline : Baseline Profile: H.263 (V1), no optional modes + * H320 Coding : H.320 Coding Efficiency Backward Compatibility + * Profile: H.263+ (V2), includes annexes I, J, L.4 + * and T + * BackwardCompatible : Backward Compatibility Profile: H.263 (V1), + * includes annex F + * ISWV2 : Interactive Streaming Wireless Profile: H.263+ + * (V2), includes annexes I, J, K and T + * ISWV3 : Interactive Streaming Wireless Profile: H.263++ + * (V3), includes profile 3 and annexes V and W.6.3.8 + * HighCompression : Conversational High Compression Profile: H.263++ + * (V3), includes profiles 1 & 2 and annexes D and U + * Internet : Conversational Internet Profile: H.263++ (V3), + * includes profile 5 and annex K + * Interlace : Conversational Interlace Profile: H.263++ (V3), + * includes profile 5 and annex W.6.3.11 + * HighLatency : High Latency Profile: H.263++ (V3), includes + * profile 6 and annexes O.1 and P.5 + */ +typedef enum OMX_VIDEO_H263PROFILETYPE { + OMX_VIDEO_H263ProfileBaseline = 0x01, + OMX_VIDEO_H263ProfileH320Coding = 0x02, + OMX_VIDEO_H263ProfileBackwardCompatible = 0x04, + OMX_VIDEO_H263ProfileISWV2 = 0x08, + OMX_VIDEO_H263ProfileISWV3 = 0x10, + OMX_VIDEO_H263ProfileHighCompression = 0x20, + OMX_VIDEO_H263ProfileInternet = 0x40, + OMX_VIDEO_H263ProfileInterlace = 0x80, + OMX_VIDEO_H263ProfileHighLatency = 0x100, + OMX_VIDEO_H263ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_H263ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_H263ProfileMax = 0x7FFFFFFF +} OMX_VIDEO_H263PROFILETYPE; + + +/** + * H.263 level types, each level indicates support for various frame sizes, + * bit rates, decoder frame rates. + */ +typedef enum OMX_VIDEO_H263LEVELTYPE { + OMX_VIDEO_H263Level10 = 0x01, + OMX_VIDEO_H263Level20 = 0x02, + OMX_VIDEO_H263Level30 = 0x04, + OMX_VIDEO_H263Level40 = 0x08, + OMX_VIDEO_H263Level45 = 0x10, + OMX_VIDEO_H263Level50 = 0x20, + OMX_VIDEO_H263Level60 = 0x40, + OMX_VIDEO_H263Level70 = 0x80, + OMX_VIDEO_H263LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_H263LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_H263LevelMax = 0x7FFFFFFF +} OMX_VIDEO_H263LEVELTYPE; + + +/** + * Specifies the picture type. These values should be OR'd to signal all + * pictures types which are allowed. + * + * ENUMS: + * Generic Picture Types: I, P and B + * H.263 Specific Picture Types: SI and SP + * H.264 Specific Picture Types: EI and EP + * MPEG-4 Specific Picture Types: S + */ +typedef enum OMX_VIDEO_PICTURETYPE { + OMX_VIDEO_PictureTypeI = 0x01, + OMX_VIDEO_PictureTypeP = 0x02, + OMX_VIDEO_PictureTypeB = 0x04, + OMX_VIDEO_PictureTypeSI = 0x08, + OMX_VIDEO_PictureTypeSP = 0x10, + OMX_VIDEO_PictureTypeEI = 0x11, + OMX_VIDEO_PictureTypeEP = 0x12, + OMX_VIDEO_PictureTypeS = 0x14, + OMX_VIDEO_PictureTypeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_PictureTypeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_PictureTypeMax = 0x7FFFFFFF +} OMX_VIDEO_PICTURETYPE; + + +/** + * H.263 Params + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * nPFrames : Number of P frames between each I frame + * nBFrames : Number of B frames between each I frame + * eProfile : H.263 profile(s) to use + * eLevel : H.263 level(s) to use + * bPLUSPTYPEAllowed : Indicating that it is allowed to use PLUSPTYPE + * (specified in the 1998 version of H.263) to + * indicate custom picture sizes or clock + * frequencies + * nAllowedPictureTypes : Specifies the picture types allowed in the + * bitstream + * bForceRoundingTypeToZero : value of the RTYPE bit (bit 6 of MPPTYPE) is + * not constrained. It is recommended to change + * the value of the RTYPE bit for each reference + * picture in error-free communication + * nPictureHeaderRepetition : Specifies the frequency of picture header + * repetition + * nGOBHeaderInterval : Specifies the interval of non-empty GOB + * headers in units of GOBs + */ +typedef struct OMX_VIDEO_PARAM_H263TYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nPFrames; + OMX_U32 nBFrames; + OMX_VIDEO_H263PROFILETYPE eProfile; + OMX_VIDEO_H263LEVELTYPE eLevel; + OMX_BOOL bPLUSPTYPEAllowed; + OMX_U32 nAllowedPictureTypes; + OMX_BOOL bForceRoundingTypeToZero; + OMX_U32 nPictureHeaderRepetition; + OMX_U32 nGOBHeaderInterval; +} OMX_VIDEO_PARAM_H263TYPE; + + +/** + * MPEG-2 profile types, each profile indicates support for various + * performance bounds and different annexes. + */ +typedef enum OMX_VIDEO_MPEG2PROFILETYPE { + OMX_VIDEO_MPEG2ProfileSimple = 0, /**< Simple Profile */ + OMX_VIDEO_MPEG2ProfileMain, /**< Main Profile */ + OMX_VIDEO_MPEG2Profile422, /**< 4:2:2 Profile */ + OMX_VIDEO_MPEG2ProfileSNR, /**< SNR Profile */ + OMX_VIDEO_MPEG2ProfileSpatial, /**< Spatial Profile */ + OMX_VIDEO_MPEG2ProfileHigh, /**< High Profile */ + OMX_VIDEO_MPEG2ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_MPEG2ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_MPEG2ProfileMax = 0x7FFFFFFF +} OMX_VIDEO_MPEG2PROFILETYPE; + + +/** + * MPEG-2 level types, each level indicates support for various frame + * sizes, bit rates, decoder frame rates. No need + */ +typedef enum OMX_VIDEO_MPEG2LEVELTYPE { + OMX_VIDEO_MPEG2LevelLL = 0, /**< Low Level */ + OMX_VIDEO_MPEG2LevelML, /**< Main Level */ + OMX_VIDEO_MPEG2LevelH14, /**< High 1440 */ + OMX_VIDEO_MPEG2LevelHL, /**< High Level */ + OMX_VIDEO_MPEG2LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_MPEG2LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_MPEG2LevelMax = 0x7FFFFFFF +} OMX_VIDEO_MPEG2LEVELTYPE; + + +/** + * MPEG-2 params + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * nPFrames : Number of P frames between each I frame + * nBFrames : Number of B frames between each I frame + * eProfile : MPEG-2 profile(s) to use + * eLevel : MPEG-2 levels(s) to use + */ +typedef struct OMX_VIDEO_PARAM_MPEG2TYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nPFrames; + OMX_U32 nBFrames; + OMX_VIDEO_MPEG2PROFILETYPE eProfile; + OMX_VIDEO_MPEG2LEVELTYPE eLevel; +} OMX_VIDEO_PARAM_MPEG2TYPE; + + +/** + * MPEG-4 profile types, each profile indicates support for various + * performance bounds and different annexes. + * + * ENUMS: + * - Simple Profile, Levels 1-3 + * - Simple Scalable Profile, Levels 1-2 + * - Core Profile, Levels 1-2 + * - Main Profile, Levels 2-4 + * - N-bit Profile, Level 2 + * - Scalable Texture Profile, Level 1 + * - Simple Face Animation Profile, Levels 1-2 + * - Simple Face and Body Animation (FBA) Profile, Levels 1-2 + * - Basic Animated Texture Profile, Levels 1-2 + * - Hybrid Profile, Levels 1-2 + * - Advanced Real Time Simple Profiles, Levels 1-4 + * - Core Scalable Profile, Levels 1-3 + * - Advanced Coding Efficiency Profile, Levels 1-4 + * - Advanced Core Profile, Levels 1-2 + * - Advanced Scalable Texture, Levels 2-3 + */ +typedef enum OMX_VIDEO_MPEG4PROFILETYPE { + OMX_VIDEO_MPEG4ProfileSimple = 0x01, + OMX_VIDEO_MPEG4ProfileSimpleScalable = 0x02, + OMX_VIDEO_MPEG4ProfileCore = 0x04, + OMX_VIDEO_MPEG4ProfileMain = 0x08, + OMX_VIDEO_MPEG4ProfileNbit = 0x10, + OMX_VIDEO_MPEG4ProfileScalableTexture = 0x20, + OMX_VIDEO_MPEG4ProfileSimpleFace = 0x40, + OMX_VIDEO_MPEG4ProfileSimpleFBA = 0x80, + OMX_VIDEO_MPEG4ProfileBasicAnimated = 0x100, + OMX_VIDEO_MPEG4ProfileHybrid = 0x200, + OMX_VIDEO_MPEG4ProfileAdvancedRealTime = 0x400, + OMX_VIDEO_MPEG4ProfileCoreScalable = 0x800, + OMX_VIDEO_MPEG4ProfileAdvancedCoding = 0x1000, + OMX_VIDEO_MPEG4ProfileAdvancedCore = 0x2000, + OMX_VIDEO_MPEG4ProfileAdvancedScalable = 0x4000, + OMX_VIDEO_MPEG4ProfileAdvancedSimple = 0x8000, + OMX_VIDEO_MPEG4ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_MPEG4ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_MPEG4ProfileMax = 0x7FFFFFFF +} OMX_VIDEO_MPEG4PROFILETYPE; + + +/** + * MPEG-4 level types, each level indicates support for various frame + * sizes, bit rates, decoder frame rates. No need + */ +typedef enum OMX_VIDEO_MPEG4LEVELTYPE { + OMX_VIDEO_MPEG4Level0 = 0x01, /**< Level 0 */ + OMX_VIDEO_MPEG4Level0b = 0x02, /**< Level 0b */ + OMX_VIDEO_MPEG4Level1 = 0x04, /**< Level 1 */ + OMX_VIDEO_MPEG4Level2 = 0x08, /**< Level 2 */ + OMX_VIDEO_MPEG4Level3 = 0x10, /**< Level 3 */ + OMX_VIDEO_MPEG4Level4 = 0x20, /**< Level 4 */ + OMX_VIDEO_MPEG4Level4a = 0x40, /**< Level 4a */ + OMX_VIDEO_MPEG4Level5 = 0x80, /**< Level 5 */ + OMX_VIDEO_MPEG4LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_MPEG4LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF +} OMX_VIDEO_MPEG4LEVELTYPE; + + +/** + * MPEG-4 configuration. This structure handles configuration options + * which are specific to MPEG4 algorithms + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * nSliceHeaderSpacing : Number of macroblocks between slice header (H263+ + * Annex K). Put zero if not used + * bSVH : Enable Short Video Header mode + * bGov : Flag to enable GOV + * nPFrames : Number of P frames between each I frame (also called + * GOV period) + * nBFrames : Number of B frames between each I frame + * nIDCVLCThreshold : Value of intra DC VLC threshold + * bACPred : Flag to use ac prediction + * nMaxPacketSize : Maximum size of packet in bytes. + * nTimeIncRes : Used to pass VOP time increment resolution for MPEG4. + * Interpreted as described in MPEG4 standard. + * eProfile : MPEG-4 profile(s) to use. + * eLevel : MPEG-4 level(s) to use. + * nAllowedPictureTypes : Specifies the picture types allowed in the bitstream + * nHeaderExtension : Specifies the number of consecutive video packet + * headers within a VOP + * bReversibleVLC : Specifies whether reversible variable length coding + * is in use + */ +typedef struct OMX_VIDEO_PARAM_MPEG4TYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nSliceHeaderSpacing; + OMX_BOOL bSVH; + OMX_BOOL bGov; + OMX_U32 nPFrames; + OMX_U32 nBFrames; + OMX_U32 nIDCVLCThreshold; + OMX_BOOL bACPred; + OMX_U32 nMaxPacketSize; + OMX_U32 nTimeIncRes; + OMX_VIDEO_MPEG4PROFILETYPE eProfile; + OMX_VIDEO_MPEG4LEVELTYPE eLevel; + OMX_U32 nAllowedPictureTypes; + OMX_U32 nHeaderExtension; + OMX_BOOL bReversibleVLC; +} OMX_VIDEO_PARAM_MPEG4TYPE; + + +/** + * WMV Versions + */ +typedef enum OMX_VIDEO_WMVFORMATTYPE { + OMX_VIDEO_WMVFormatUnused = 0x01, /**< Format unused or unknown */ + OMX_VIDEO_WMVFormat7 = 0x02, /**< Windows Media Video format 7 */ + OMX_VIDEO_WMVFormat8 = 0x04, /**< Windows Media Video format 8 */ + OMX_VIDEO_WMVFormat9 = 0x08, /**< Windows Media Video format 9 */ + OMX_VIDEO_WMFFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_WMFFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_WMVFormatMax = 0x7FFFFFFF +} OMX_VIDEO_WMVFORMATTYPE; + + +/** + * WMV Params + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * eFormat : Version of WMV stream / data + */ +typedef struct OMX_VIDEO_PARAM_WMVTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_VIDEO_WMVFORMATTYPE eFormat; +} OMX_VIDEO_PARAM_WMVTYPE; + + +/** + * Real Video Version + */ +typedef enum OMX_VIDEO_RVFORMATTYPE { + OMX_VIDEO_RVFormatUnused = 0, /**< Format unused or unknown */ + OMX_VIDEO_RVFormat8, /**< Real Video format 8 */ + OMX_VIDEO_RVFormat9, /**< Real Video format 9 */ + OMX_VIDEO_RVFormatG2, /**< Real Video Format G2 */ + OMX_VIDEO_RVFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_RVFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_RVFormatMax = 0x7FFFFFFF +} OMX_VIDEO_RVFORMATTYPE; + + +/** + * Real Video Params + * + * STUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * eFormat : Version of RV stream / data + * nBitsPerPixel : Bits per pixel coded in the frame + * nPaddedWidth : Padded width in pixel of a video frame + * nPaddedHeight : Padded Height in pixels of a video frame + * nFrameRate : Rate of video in frames per second + * nBitstreamFlags : Flags which internal information about the bitstream + * nBitstreamVersion : Bitstream version + * nMaxEncodeFrameSize: Max encoded frame size + * bEnablePostFilter : Turn on/off post filter + * bEnableTemporalInterpolation : Turn on/off temporal interpolation + * bEnableLatencyMode : When enabled, the decoder does not display a decoded + * frame until it has detected that no enhancement layer + * frames or dependent B frames will be coming. This + * detection usually occurs when a subsequent non-B + * frame is encountered + */ +typedef struct OMX_VIDEO_PARAM_RVTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_VIDEO_RVFORMATTYPE eFormat; + OMX_U16 nBitsPerPixel; + OMX_U16 nPaddedWidth; + OMX_U16 nPaddedHeight; + OMX_U32 nFrameRate; + OMX_U32 nBitstreamFlags; + OMX_U32 nBitstreamVersion; + OMX_U32 nMaxEncodeFrameSize; + OMX_BOOL bEnablePostFilter; + OMX_BOOL bEnableTemporalInterpolation; + OMX_BOOL bEnableLatencyMode; +} OMX_VIDEO_PARAM_RVTYPE; + + +/** + * AVC profile types, each profile indicates support for various + * performance bounds and different annexes. + */ +typedef enum OMX_VIDEO_AVCPROFILETYPE { + OMX_VIDEO_AVCProfileBaseline = 0x01, /**< Baseline profile */ + OMX_VIDEO_AVCProfileMain = 0x02, /**< Main profile */ + OMX_VIDEO_AVCProfileExtended = 0x04, /**< Extended profile */ + OMX_VIDEO_AVCProfileHigh = 0x08, /**< High profile */ + OMX_VIDEO_AVCProfileHigh10 = 0x10, /**< High 10 profile */ + OMX_VIDEO_AVCProfileHigh422 = 0x20, /**< High 4:2:2 profile */ + OMX_VIDEO_AVCProfileHigh444 = 0x40, /**< High 4:4:4 profile */ + OMX_VIDEO_AVCProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_AVCProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_AVCProfileMax = 0x7FFFFFFF +} OMX_VIDEO_AVCPROFILETYPE; + + +/** + * AVC level types, each level indicates support for various frame sizes, + * bit rates, decoder frame rates. No need + */ +typedef enum OMX_VIDEO_AVCLEVELTYPE { + OMX_VIDEO_AVCLevel1 = 0x01, /**< Level 1 */ + OMX_VIDEO_AVCLevel1b = 0x02, /**< Level 1b */ + OMX_VIDEO_AVCLevel11 = 0x04, /**< Level 1.1 */ + OMX_VIDEO_AVCLevel12 = 0x08, /**< Level 1.2 */ + OMX_VIDEO_AVCLevel13 = 0x10, /**< Level 1.3 */ + OMX_VIDEO_AVCLevel2 = 0x20, /**< Level 2 */ + OMX_VIDEO_AVCLevel21 = 0x40, /**< Level 2.1 */ + OMX_VIDEO_AVCLevel22 = 0x80, /**< Level 2.2 */ + OMX_VIDEO_AVCLevel3 = 0x100, /**< Level 3 */ + OMX_VIDEO_AVCLevel31 = 0x200, /**< Level 3.1 */ + OMX_VIDEO_AVCLevel32 = 0x400, /**< Level 3.2 */ + OMX_VIDEO_AVCLevel4 = 0x800, /**< Level 4 */ + OMX_VIDEO_AVCLevel41 = 0x1000, /**< Level 4.1 */ + OMX_VIDEO_AVCLevel42 = 0x2000, /**< Level 4.2 */ + OMX_VIDEO_AVCLevel5 = 0x4000, /**< Level 5 */ + OMX_VIDEO_AVCLevel51 = 0x8000, /**< Level 5.1 */ + OMX_VIDEO_AVCLevel52 = 0x10000, /**< Level 5.2 */ + OMX_VIDEO_AVCLevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_AVCLevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_AVCLevelMax = 0x7FFFFFFF +} OMX_VIDEO_AVCLEVELTYPE; + + +/** + * AVC loop filter modes + * + * OMX_VIDEO_AVCLoopFilterEnable : Enable + * OMX_VIDEO_AVCLoopFilterDisable : Disable + * OMX_VIDEO_AVCLoopFilterDisableSliceBoundary : Disabled on slice boundaries + */ +typedef enum OMX_VIDEO_AVCLOOPFILTERTYPE { + OMX_VIDEO_AVCLoopFilterEnable = 0, + OMX_VIDEO_AVCLoopFilterDisable, + OMX_VIDEO_AVCLoopFilterDisableSliceBoundary, + OMX_VIDEO_AVCLoopFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_AVCLoopFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_AVCLoopFilterMax = 0x7FFFFFFF +} OMX_VIDEO_AVCLOOPFILTERTYPE; + + +/** + * AVC params + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * nSliceHeaderSpacing : Number of macroblocks between slice header, put + * zero if not used + * nPFrames : Number of P frames between each I frame + * nBFrames : Number of B frames between each I frame + * bUseHadamard : Enable/disable Hadamard transform + * nRefFrames : Max number of reference frames to use for inter + * motion search (1-16) + * nRefIdxTrailing : Pic param set ref frame index (index into ref + * frame buffer of trailing frames list), B frame + * support + * nRefIdxForward : Pic param set ref frame index (index into ref + * frame buffer of forward frames list), B frame + * support + * bEnableUEP : Enable/disable unequal error protection. This + * is only valid of data partitioning is enabled. + * bEnableFMO : Enable/disable flexible macroblock ordering + * bEnableASO : Enable/disable arbitrary slice ordering + * bEnableRS : Enable/disable sending of redundant slices + * eProfile : AVC profile(s) to use + * eLevel : AVC level(s) to use + * nAllowedPictureTypes : Specifies the picture types allowed in the + * bitstream + * bFrameMBsOnly : specifies that every coded picture of the + * coded video sequence is a coded frame + * containing only frame macroblocks + * bMBAFF : Enable/disable switching between frame and + * field macroblocks within a picture + * bEntropyCodingCABAC : Entropy decoding method to be applied for the + * syntax elements for which two descriptors appear + * in the syntax tables + * bWeightedPPrediction : Enable/disable weighted prediction shall not + * be applied to P and SP slices + * nWeightedBipredicitonMode : Default weighted prediction is applied to B + * slices + * bconstIpred : Enable/disable intra prediction + * bDirect8x8Inference : Specifies the method used in the derivation + * process for luma motion vectors for B_Skip, + * B_Direct_16x16 and B_Direct_8x8 as specified + * in subclause 8.4.1.2 of the AVC spec + * bDirectSpatialTemporal : Flag indicating spatial or temporal direct + * mode used in B slice coding (related to + * bDirect8x8Inference) . Spatial direct mode is + * more common and should be the default. + * nCabacInitIdx : Index used to init CABAC contexts + * eLoopFilterMode : Enable/disable loop filter + */ +typedef struct OMX_VIDEO_PARAM_AVCTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nSliceHeaderSpacing; + OMX_U32 nPFrames; + OMX_U32 nBFrames; + OMX_BOOL bUseHadamard; + OMX_U32 nRefFrames; + OMX_U32 nRefIdx10ActiveMinus1; + OMX_U32 nRefIdx11ActiveMinus1; + OMX_BOOL bEnableUEP; + OMX_BOOL bEnableFMO; + OMX_BOOL bEnableASO; + OMX_BOOL bEnableRS; + OMX_VIDEO_AVCPROFILETYPE eProfile; + OMX_VIDEO_AVCLEVELTYPE eLevel; + OMX_U32 nAllowedPictureTypes; + OMX_BOOL bFrameMBsOnly; + OMX_BOOL bMBAFF; + OMX_BOOL bEntropyCodingCABAC; + OMX_BOOL bWeightedPPrediction; + OMX_U32 nWeightedBipredicitonMode; + OMX_BOOL bconstIpred ; + OMX_BOOL bDirect8x8Inference; + OMX_BOOL bDirectSpatialTemporal; + OMX_U32 nCabacInitIdc; + OMX_VIDEO_AVCLOOPFILTERTYPE eLoopFilterMode; +} OMX_VIDEO_PARAM_AVCTYPE; + +typedef struct OMX_VIDEO_PARAM_PROFILELEVELTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 eProfile; /**< type is OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263PROFILETYPE, + or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ + OMX_U32 eLevel; /**< type is OMX_VIDEO_AVCLEVELTYPE, OMX_VIDEO_H263LEVELTYPE, + or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ + OMX_U32 nProfileIndex; /**< Used to query for individual profile support information, + This parameter is valid only for + OMX_IndexParamVideoProfileLevelQuerySupported index, + For all other indices this parameter is to be ignored. */ +} OMX_VIDEO_PARAM_PROFILELEVELTYPE; + +/** + * Structure for dynamically configuring bitrate mode of a codec. + * + * STRUCT MEMBERS: + * nSize : Size of the struct in bytes + * nVersion : OMX spec version info + * nPortIndex : Port that this struct applies to + * nEncodeBitrate : Target average bitrate to be generated in bps + */ +typedef struct OMX_VIDEO_CONFIG_BITRATETYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nEncodeBitrate; +} OMX_VIDEO_CONFIG_BITRATETYPE; + +/** + * Defines Encoder Frame Rate setting + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * xEncodeFramerate : Encoding framerate represented in Q16 format + */ +typedef struct OMX_CONFIG_FRAMERATETYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 xEncodeFramerate; /* Q16 format */ +} OMX_CONFIG_FRAMERATETYPE; + +typedef struct OMX_CONFIG_INTRAREFRESHVOPTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL IntraRefreshVOP; +} OMX_CONFIG_INTRAREFRESHVOPTYPE; + +typedef struct OMX_CONFIG_MACROBLOCKERRORMAPTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nErrMapSize; /* Size of the Error Map in bytes */ + OMX_U8 ErrMap[1]; /* Error map hint */ +} OMX_CONFIG_MACROBLOCKERRORMAPTYPE; + +typedef struct OMX_CONFIG_MBERRORREPORTINGTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bEnabled; +} OMX_CONFIG_MBERRORREPORTINGTYPE; + +typedef struct OMX_PARAM_MACROBLOCKSTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nMacroblocks; +} OMX_PARAM_MACROBLOCKSTYPE; + +/** + * AVC Slice Mode modes + * + * OMX_VIDEO_SLICEMODE_AVCDefault : Normal frame encoding, one slice per frame + * OMX_VIDEO_SLICEMODE_AVCMBSlice : NAL mode, number of MBs per frame + * OMX_VIDEO_SLICEMODE_AVCByteSlice : NAL mode, number of bytes per frame + */ +typedef enum OMX_VIDEO_AVCSLICEMODETYPE { + OMX_VIDEO_SLICEMODE_AVCDefault = 0, + OMX_VIDEO_SLICEMODE_AVCMBSlice, + OMX_VIDEO_SLICEMODE_AVCByteSlice, + OMX_VIDEO_SLICEMODE_AVCKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_SLICEMODE_AVCVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_SLICEMODE_AVCLevelMax = 0x7FFFFFFF +} OMX_VIDEO_AVCSLICEMODETYPE; + +/** + * AVC FMO Slice Mode Params + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * nNumSliceGroups : Specifies the number of slice groups + * nSliceGroupMapType : Specifies the type of slice groups + * eSliceMode : Specifies the type of slice + */ +typedef struct OMX_VIDEO_PARAM_AVCSLICEFMO { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U8 nNumSliceGroups; + OMX_U8 nSliceGroupMapType; + OMX_VIDEO_AVCSLICEMODETYPE eSliceMode; +} OMX_VIDEO_PARAM_AVCSLICEFMO; + +/** + * AVC IDR Period Configs + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * nIDRPeriod : Specifies periodicity of IDR frames + * nPFrames : Specifies internal of coding Intra frames + */ +typedef struct OMX_VIDEO_CONFIG_AVCINTRAPERIOD { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nIDRPeriod; + OMX_U32 nPFrames; +} OMX_VIDEO_CONFIG_AVCINTRAPERIOD; + +/** + * AVC NAL Size Configs + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * nNaluBytes : Specifies the NAL unit size + */ +typedef struct OMX_VIDEO_CONFIG_NALSIZE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nNaluBytes; +} OMX_VIDEO_CONFIG_NALSIZE; + + +/** + * Deinterlace Config + * + * STRUCT MEMBERS: + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information + * nPortIndex : Port that this structure applies to + * nEnable : Specifies to enable deinterlace + */ +typedef struct OMX_VIDEO_CONFIG_DEINTERLACE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_U32 nEnable; +} OMX_VIDEO_CONFIG_DEINTERLACE; + +/** @} */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif +/* File EOF */ + diff --git a/third_party/openmax/include/OMX_VideoExt.h b/third_party/openmax/include/OMX_VideoExt.h new file mode 100644 index 000000000..5bf6fd487 --- /dev/null +++ b/third_party/openmax/include/OMX_VideoExt.h @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2010 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/** OMX_VideoExt.h - OpenMax IL version 1.1.2 + * The OMX_VideoExt header file contains extensions to the + * definitions used by both the application and the component to + * access video items. + */ + +#ifndef OMX_VideoExt_h +#define OMX_VideoExt_h + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Each OMX header shall include all required header files to allow the + * header to compile without errors. The includes below are required + * for this header file to compile successfully + */ +#include + +/** NALU Formats */ +typedef enum OMX_NALUFORMATSTYPE { + OMX_NaluFormatStartCodes = 1, + OMX_NaluFormatOneNaluPerBuffer = 2, + OMX_NaluFormatOneByteInterleaveLength = 4, + OMX_NaluFormatTwoByteInterleaveLength = 8, + OMX_NaluFormatFourByteInterleaveLength = 16, + OMX_NaluFormatCodingMax = 0x7FFFFFFF +} OMX_NALUFORMATSTYPE; + +/** NAL Stream Format */ +typedef struct OMX_NALSTREAMFORMATTYPE{ + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_NALUFORMATSTYPE eNaluFormat; +} OMX_NALSTREAMFORMATTYPE; + +/** VP8 profiles */ +typedef enum OMX_VIDEO_VP8PROFILETYPE { + OMX_VIDEO_VP8ProfileMain = 0x01, + OMX_VIDEO_VP8ProfileUnknown = 0x6EFFFFFF, + OMX_VIDEO_VP8ProfileMax = 0x7FFFFFFF +} OMX_VIDEO_VP8PROFILETYPE; + +/** VP8 levels */ +typedef enum OMX_VIDEO_VP8LEVELTYPE { + OMX_VIDEO_VP8Level_Version0 = 0x01, + OMX_VIDEO_VP8Level_Version1 = 0x02, + OMX_VIDEO_VP8Level_Version2 = 0x04, + OMX_VIDEO_VP8Level_Version3 = 0x08, + OMX_VIDEO_VP8LevelUnknown = 0x6EFFFFFF, + OMX_VIDEO_VP8LevelMax = 0x7FFFFFFF +} OMX_VIDEO_VP8LEVELTYPE; + +/** VP8 Param */ +typedef struct OMX_VIDEO_PARAM_VP8TYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_VIDEO_VP8PROFILETYPE eProfile; + OMX_VIDEO_VP8LEVELTYPE eLevel; + OMX_U32 nDCTPartitions; + OMX_BOOL bErrorResilientMode; +} OMX_VIDEO_PARAM_VP8TYPE; + +/** Structure for configuring VP8 reference frames */ +typedef struct OMX_VIDEO_VP8REFERENCEFRAMETYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bPreviousFrameRefresh; + OMX_BOOL bGoldenFrameRefresh; + OMX_BOOL bAlternateFrameRefresh; + OMX_BOOL bUsePreviousFrame; + OMX_BOOL bUseGoldenFrame; + OMX_BOOL bUseAlternateFrame; +} OMX_VIDEO_VP8REFERENCEFRAMETYPE; + +/** Structure for querying VP8 reference frame type */ +typedef struct OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bIsIntraFrame; + OMX_BOOL bIsGoldenOrAlternateFrame; +} OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE; + +/** HEVC Profiles */ +typedef enum OMX_VIDEO_HEVCPROFILETYPE { + OMX_VIDEO_HEVCProfileMain = 0x01, + OMX_VIDEO_HEVCProfileMain10 = 0x02, + OMX_VIDEO_HEVCProfileUnknown = 0x6EFFFFFF, + OMX_VIDEO_HEVCProfileMax = 0x7FFFFFFF +} OMX_VIDEO_HEVCPROFILETYPE; + +/** HEVC levels */ +typedef enum OMX_VIDEO_HEVCLEVELTYPE { + OMX_VIDEO_HEVCLevel_Version0 = 0x0, + OMX_VIDEO_HEVCMainTierLevel1 = 0x1, + OMX_VIDEO_HEVCHighTierLevel1 = 0x2, + OMX_VIDEO_HEVCMainTierLevel2 = 0x4, + OMX_VIDEO_HEVCHighTierLevel2 = 0x8, + OMX_VIDEO_HEVCMainTierLevel21 = 0x10, + OMX_VIDEO_HEVCHighTierLevel21 = 0x20, + OMX_VIDEO_HEVCMainTierLevel3 = 0x40, + OMX_VIDEO_HEVCHighTierLevel3 = 0x80, + OMX_VIDEO_HEVCMainTierLevel31 = 0x100, + OMX_VIDEO_HEVCHighTierLevel31 = 0x200, + OMX_VIDEO_HEVCMainTierLevel4 = 0x400, + OMX_VIDEO_HEVCHighTierLevel4 = 0x800, + OMX_VIDEO_HEVCMainTierLevel41 = 0x1000, + OMX_VIDEO_HEVCHighTierLevel41 = 0x2000, + OMX_VIDEO_HEVCMainTierLevel5 = 0x4000, + OMX_VIDEO_HEVCHighTierLevel5 = 0x8000, + OMX_VIDEO_HEVCMainTierLevel51 = 0x10000, + OMX_VIDEO_HEVCHighTierLevel51 = 0x20000, + OMX_VIDEO_HEVCMainTierLevel52 = 0x40000, + OMX_VIDEO_HEVCHighTierLevel52 = 0x80000, + OMX_VIDEO_HEVCMainTierLevel6 = 0x100000, + OMX_VIDEO_HEVCHighTierLevel6 = 0x200000, + OMX_VIDEO_HEVCMainTierLevel61 = 0x400000, + OMX_VIDEO_HEVCHighTierLevel61 = 0x800000, + OMX_VIDEO_HEVCMainTierLevel62 = 0x1000000, + OMX_VIDEO_HEVCLevelUnknown = 0x6EFFFFFF, + OMX_VIDEO_HEVCLevelMax = 0x7FFFFFFF +} OMX_VIDEO_HEVCLEVELTYPE; + +/** HEVC Param */ +typedef struct OMX_VIDEO_PARAM_HEVCTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_VIDEO_HEVCPROFILETYPE eProfile; + OMX_VIDEO_HEVCLEVELTYPE eLevel; +} OMX_VIDEO_PARAM_HEVCTYPE; + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* OMX_VideoExt_h */ +/* File EOF */ diff --git a/third_party/qrcode/QrCode.cc b/third_party/qrcode/QrCode.cc new file mode 100644 index 000000000..b9de86215 --- /dev/null +++ b/third_party/qrcode/QrCode.cc @@ -0,0 +1,862 @@ +/* + * QR Code generator library (C++) + * + * Copyright (c) Project Nayuki. (MIT License) + * https://www.nayuki.io/page/qr-code-generator-library + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * - The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * - The Software is provided "as is", without warranty of any kind, express or + * implied, including but not limited to the warranties of merchantability, + * fitness for a particular purpose and noninfringement. In no event shall the + * authors or copyright holders be liable for any claim, damages or other + * liability, whether in an action of contract, tort or otherwise, arising from, + * out of or in connection with the Software or the use or other dealings in the + * Software. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "QrCode.hpp" + +using std::int8_t; +using std::uint8_t; +using std::size_t; +using std::vector; + + +namespace qrcodegen { + +QrSegment::Mode::Mode(int mode, int cc0, int cc1, int cc2) : + modeBits(mode) { + numBitsCharCount[0] = cc0; + numBitsCharCount[1] = cc1; + numBitsCharCount[2] = cc2; +} + + +int QrSegment::Mode::getModeBits() const { + return modeBits; +} + + +int QrSegment::Mode::numCharCountBits(int ver) const { + return numBitsCharCount[(ver + 7) / 17]; +} + + +const QrSegment::Mode QrSegment::Mode::NUMERIC (0x1, 10, 12, 14); +const QrSegment::Mode QrSegment::Mode::ALPHANUMERIC(0x2, 9, 11, 13); +const QrSegment::Mode QrSegment::Mode::BYTE (0x4, 8, 16, 16); +const QrSegment::Mode QrSegment::Mode::KANJI (0x8, 8, 10, 12); +const QrSegment::Mode QrSegment::Mode::ECI (0x7, 0, 0, 0); + + +QrSegment QrSegment::makeBytes(const vector &data) { + if (data.size() > static_cast(INT_MAX)) + throw std::length_error("Data too long"); + BitBuffer bb; + for (uint8_t b : data) + bb.appendBits(b, 8); + return QrSegment(Mode::BYTE, static_cast(data.size()), std::move(bb)); +} + + +QrSegment QrSegment::makeNumeric(const char *digits) { + BitBuffer bb; + int accumData = 0; + int accumCount = 0; + int charCount = 0; + for (; *digits != '\0'; digits++, charCount++) { + char c = *digits; + if (c < '0' || c > '9') + throw std::domain_error("String contains non-numeric characters"); + accumData = accumData * 10 + (c - '0'); + accumCount++; + if (accumCount == 3) { + bb.appendBits(static_cast(accumData), 10); + accumData = 0; + accumCount = 0; + } + } + if (accumCount > 0) // 1 or 2 digits remaining + bb.appendBits(static_cast(accumData), accumCount * 3 + 1); + return QrSegment(Mode::NUMERIC, charCount, std::move(bb)); +} + + +QrSegment QrSegment::makeAlphanumeric(const char *text) { + BitBuffer bb; + int accumData = 0; + int accumCount = 0; + int charCount = 0; + for (; *text != '\0'; text++, charCount++) { + const char *temp = std::strchr(ALPHANUMERIC_CHARSET, *text); + if (temp == nullptr) + throw std::domain_error("String contains unencodable characters in alphanumeric mode"); + accumData = accumData * 45 + static_cast(temp - ALPHANUMERIC_CHARSET); + accumCount++; + if (accumCount == 2) { + bb.appendBits(static_cast(accumData), 11); + accumData = 0; + accumCount = 0; + } + } + if (accumCount > 0) // 1 character remaining + bb.appendBits(static_cast(accumData), 6); + return QrSegment(Mode::ALPHANUMERIC, charCount, std::move(bb)); +} + + +vector QrSegment::makeSegments(const char *text) { + // Select the most efficient segment encoding automatically + vector result; + if (*text == '\0'); // Leave result empty + else if (isNumeric(text)) + result.push_back(makeNumeric(text)); + else if (isAlphanumeric(text)) + result.push_back(makeAlphanumeric(text)); + else { + vector bytes; + for (; *text != '\0'; text++) + bytes.push_back(static_cast(*text)); + result.push_back(makeBytes(bytes)); + } + return result; +} + + +QrSegment QrSegment::makeEci(long assignVal) { + BitBuffer bb; + if (assignVal < 0) + throw std::domain_error("ECI assignment value out of range"); + else if (assignVal < (1 << 7)) + bb.appendBits(static_cast(assignVal), 8); + else if (assignVal < (1 << 14)) { + bb.appendBits(2, 2); + bb.appendBits(static_cast(assignVal), 14); + } else if (assignVal < 1000000L) { + bb.appendBits(6, 3); + bb.appendBits(static_cast(assignVal), 21); + } else + throw std::domain_error("ECI assignment value out of range"); + return QrSegment(Mode::ECI, 0, std::move(bb)); +} + + +QrSegment::QrSegment(Mode md, int numCh, const std::vector &dt) : + mode(md), + numChars(numCh), + data(dt) { + if (numCh < 0) + throw std::domain_error("Invalid value"); +} + + +QrSegment::QrSegment(Mode md, int numCh, std::vector &&dt) : + mode(md), + numChars(numCh), + data(std::move(dt)) { + if (numCh < 0) + throw std::domain_error("Invalid value"); +} + + +int QrSegment::getTotalBits(const vector &segs, int version) { + int result = 0; + for (const QrSegment &seg : segs) { + int ccbits = seg.mode.numCharCountBits(version); + if (seg.numChars >= (1L << ccbits)) + return -1; // The segment's length doesn't fit the field's bit width + if (4 + ccbits > INT_MAX - result) + return -1; // The sum will overflow an int type + result += 4 + ccbits; + if (seg.data.size() > static_cast(INT_MAX - result)) + return -1; // The sum will overflow an int type + result += static_cast(seg.data.size()); + } + return result; +} + + +bool QrSegment::isAlphanumeric(const char *text) { + for (; *text != '\0'; text++) { + if (std::strchr(ALPHANUMERIC_CHARSET, *text) == nullptr) + return false; + } + return true; +} + + +bool QrSegment::isNumeric(const char *text) { + for (; *text != '\0'; text++) { + char c = *text; + if (c < '0' || c > '9') + return false; + } + return true; +} + + +QrSegment::Mode QrSegment::getMode() const { + return mode; +} + + +int QrSegment::getNumChars() const { + return numChars; +} + + +const std::vector &QrSegment::getData() const { + return data; +} + + +const char *QrSegment::ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"; + + + +int QrCode::getFormatBits(Ecc ecl) { + switch (ecl) { + case Ecc::LOW : return 1; + case Ecc::MEDIUM : return 0; + case Ecc::QUARTILE: return 3; + case Ecc::HIGH : return 2; + default: throw std::logic_error("Assertion error"); + } +} + + +QrCode QrCode::encodeText(const char *text, Ecc ecl) { + vector segs = QrSegment::makeSegments(text); + return encodeSegments(segs, ecl); +} + + +QrCode QrCode::encodeBinary(const vector &data, Ecc ecl) { + vector segs{QrSegment::makeBytes(data)}; + return encodeSegments(segs, ecl); +} + + +QrCode QrCode::encodeSegments(const vector &segs, Ecc ecl, + int minVersion, int maxVersion, int mask, bool boostEcl) { + if (!(MIN_VERSION <= minVersion && minVersion <= maxVersion && maxVersion <= MAX_VERSION) || mask < -1 || mask > 7) + throw std::invalid_argument("Invalid value"); + + // Find the minimal version number to use + int version, dataUsedBits; + for (version = minVersion; ; version++) { + int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; // Number of data bits available + dataUsedBits = QrSegment::getTotalBits(segs, version); + if (dataUsedBits != -1 && dataUsedBits <= dataCapacityBits) + break; // This version number is found to be suitable + if (version >= maxVersion) { // All versions in the range could not fit the given data + std::ostringstream sb; + if (dataUsedBits == -1) + sb << "Segment too long"; + else { + sb << "Data length = " << dataUsedBits << " bits, "; + sb << "Max capacity = " << dataCapacityBits << " bits"; + } + throw data_too_long(sb.str()); + } + } + if (dataUsedBits == -1) + throw std::logic_error("Assertion error"); + + // Increase the error correction level while the data still fits in the current version number + for (Ecc newEcl : vector{Ecc::MEDIUM, Ecc::QUARTILE, Ecc::HIGH}) { // From low to high + if (boostEcl && dataUsedBits <= getNumDataCodewords(version, newEcl) * 8) + ecl = newEcl; + } + + // Concatenate all segments to create the data bit string + BitBuffer bb; + for (const QrSegment &seg : segs) { + bb.appendBits(static_cast(seg.getMode().getModeBits()), 4); + bb.appendBits(static_cast(seg.getNumChars()), seg.getMode().numCharCountBits(version)); + bb.insert(bb.end(), seg.getData().begin(), seg.getData().end()); + } + if (bb.size() != static_cast(dataUsedBits)) + throw std::logic_error("Assertion error"); + + // Add terminator and pad up to a byte if applicable + size_t dataCapacityBits = static_cast(getNumDataCodewords(version, ecl)) * 8; + if (bb.size() > dataCapacityBits) + throw std::logic_error("Assertion error"); + bb.appendBits(0, std::min(4, static_cast(dataCapacityBits - bb.size()))); + bb.appendBits(0, (8 - static_cast(bb.size() % 8)) % 8); + if (bb.size() % 8 != 0) + throw std::logic_error("Assertion error"); + + // Pad with alternating bytes until data capacity is reached + for (uint8_t padByte = 0xEC; bb.size() < dataCapacityBits; padByte ^= 0xEC ^ 0x11) + bb.appendBits(padByte, 8); + + // Pack bits into bytes in big endian + vector dataCodewords(bb.size() / 8); + for (size_t i = 0; i < bb.size(); i++) + dataCodewords[i >> 3] |= (bb.at(i) ? 1 : 0) << (7 - (i & 7)); + + // Create the QR Code object + return QrCode(version, ecl, dataCodewords, mask); +} + + +QrCode::QrCode(int ver, Ecc ecl, const vector &dataCodewords, int msk) : + // Initialize fields and check arguments + version(ver), + errorCorrectionLevel(ecl) { + if (ver < MIN_VERSION || ver > MAX_VERSION) + throw std::domain_error("Version value out of range"); + if (msk < -1 || msk > 7) + throw std::domain_error("Mask value out of range"); + size = ver * 4 + 17; + size_t sz = static_cast(size); + modules = vector >(sz, vector(sz)); // Initially all white + isFunction = vector >(sz, vector(sz)); + + // Compute ECC, draw modules + drawFunctionPatterns(); + const vector allCodewords = addEccAndInterleave(dataCodewords); + drawCodewords(allCodewords); + + // Do masking + if (msk == -1) { // Automatically choose best mask + long minPenalty = LONG_MAX; + for (int i = 0; i < 8; i++) { + applyMask(i); + drawFormatBits(i); + long penalty = getPenaltyScore(); + if (penalty < minPenalty) { + msk = i; + minPenalty = penalty; + } + applyMask(i); // Undoes the mask due to XOR + } + } + if (msk < 0 || msk > 7) + throw std::logic_error("Assertion error"); + this->mask = msk; + applyMask(msk); // Apply the final choice of mask + drawFormatBits(msk); // Overwrite old format bits + + isFunction.clear(); + isFunction.shrink_to_fit(); +} + + +int QrCode::getVersion() const { + return version; +} + + +int QrCode::getSize() const { + return size; +} + + +QrCode::Ecc QrCode::getErrorCorrectionLevel() const { + return errorCorrectionLevel; +} + + +int QrCode::getMask() const { + return mask; +} + + +bool QrCode::getModule(int x, int y) const { + return 0 <= x && x < size && 0 <= y && y < size && module(x, y); +} + + +std::string QrCode::toSvgString(int border) const { + if (border < 0) + throw std::domain_error("Border must be non-negative"); + if (border > INT_MAX / 2 || border * 2 > INT_MAX - size) + throw std::overflow_error("Border too large"); + + std::ostringstream sb; + sb << "\n"; + sb << "\n"; + sb << "\n"; + sb << "\t\n"; + sb << "\t\n"; + sb << "\n"; + return sb.str(); +} + + +void QrCode::drawFunctionPatterns() { + // Draw horizontal and vertical timing patterns + for (int i = 0; i < size; i++) { + setFunctionModule(6, i, i % 2 == 0); + setFunctionModule(i, 6, i % 2 == 0); + } + + // Draw 3 finder patterns (all corners except bottom right; overwrites some timing modules) + drawFinderPattern(3, 3); + drawFinderPattern(size - 4, 3); + drawFinderPattern(3, size - 4); + + // Draw numerous alignment patterns + const vector alignPatPos = getAlignmentPatternPositions(); + size_t numAlign = alignPatPos.size(); + for (size_t i = 0; i < numAlign; i++) { + for (size_t j = 0; j < numAlign; j++) { + // Don't draw on the three finder corners + if (!((i == 0 && j == 0) || (i == 0 && j == numAlign - 1) || (i == numAlign - 1 && j == 0))) + drawAlignmentPattern(alignPatPos.at(i), alignPatPos.at(j)); + } + } + + // Draw configuration data + drawFormatBits(0); // Dummy mask value; overwritten later in the constructor + drawVersion(); +} + + +void QrCode::drawFormatBits(int msk) { + // Calculate error correction code and pack bits + int data = getFormatBits(errorCorrectionLevel) << 3 | msk; // errCorrLvl is uint2, msk is uint3 + int rem = data; + for (int i = 0; i < 10; i++) + rem = (rem << 1) ^ ((rem >> 9) * 0x537); + int bits = (data << 10 | rem) ^ 0x5412; // uint15 + if (bits >> 15 != 0) + throw std::logic_error("Assertion error"); + + // Draw first copy + for (int i = 0; i <= 5; i++) + setFunctionModule(8, i, getBit(bits, i)); + setFunctionModule(8, 7, getBit(bits, 6)); + setFunctionModule(8, 8, getBit(bits, 7)); + setFunctionModule(7, 8, getBit(bits, 8)); + for (int i = 9; i < 15; i++) + setFunctionModule(14 - i, 8, getBit(bits, i)); + + // Draw second copy + for (int i = 0; i < 8; i++) + setFunctionModule(size - 1 - i, 8, getBit(bits, i)); + for (int i = 8; i < 15; i++) + setFunctionModule(8, size - 15 + i, getBit(bits, i)); + setFunctionModule(8, size - 8, true); // Always black +} + + +void QrCode::drawVersion() { + if (version < 7) + return; + + // Calculate error correction code and pack bits + int rem = version; // version is uint6, in the range [7, 40] + for (int i = 0; i < 12; i++) + rem = (rem << 1) ^ ((rem >> 11) * 0x1F25); + long bits = static_cast(version) << 12 | rem; // uint18 + if (bits >> 18 != 0) + throw std::logic_error("Assertion error"); + + // Draw two copies + for (int i = 0; i < 18; i++) { + bool bit = getBit(bits, i); + int a = size - 11 + i % 3; + int b = i / 3; + setFunctionModule(a, b, bit); + setFunctionModule(b, a, bit); + } +} + + +void QrCode::drawFinderPattern(int x, int y) { + for (int dy = -4; dy <= 4; dy++) { + for (int dx = -4; dx <= 4; dx++) { + int dist = std::max(std::abs(dx), std::abs(dy)); // Chebyshev/infinity norm + int xx = x + dx, yy = y + dy; + if (0 <= xx && xx < size && 0 <= yy && yy < size) + setFunctionModule(xx, yy, dist != 2 && dist != 4); + } + } +} + + +void QrCode::drawAlignmentPattern(int x, int y) { + for (int dy = -2; dy <= 2; dy++) { + for (int dx = -2; dx <= 2; dx++) + setFunctionModule(x + dx, y + dy, std::max(std::abs(dx), std::abs(dy)) != 1); + } +} + + +void QrCode::setFunctionModule(int x, int y, bool isBlack) { + size_t ux = static_cast(x); + size_t uy = static_cast(y); + modules .at(uy).at(ux) = isBlack; + isFunction.at(uy).at(ux) = true; +} + + +bool QrCode::module(int x, int y) const { + return modules.at(static_cast(y)).at(static_cast(x)); +} + + +vector QrCode::addEccAndInterleave(const vector &data) const { + if (data.size() != static_cast(getNumDataCodewords(version, errorCorrectionLevel))) + throw std::invalid_argument("Invalid argument"); + + // Calculate parameter numbers + int numBlocks = NUM_ERROR_CORRECTION_BLOCKS[static_cast(errorCorrectionLevel)][version]; + int blockEccLen = ECC_CODEWORDS_PER_BLOCK [static_cast(errorCorrectionLevel)][version]; + int rawCodewords = getNumRawDataModules(version) / 8; + int numShortBlocks = numBlocks - rawCodewords % numBlocks; + int shortBlockLen = rawCodewords / numBlocks; + + // Split data into blocks and append ECC to each block + vector > blocks; + const vector rsDiv = reedSolomonComputeDivisor(blockEccLen); + for (int i = 0, k = 0; i < numBlocks; i++) { + vector dat(data.cbegin() + k, data.cbegin() + (k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1))); + k += static_cast(dat.size()); + const vector ecc = reedSolomonComputeRemainder(dat, rsDiv); + if (i < numShortBlocks) + dat.push_back(0); + dat.insert(dat.end(), ecc.cbegin(), ecc.cend()); + blocks.push_back(std::move(dat)); + } + + // Interleave (not concatenate) the bytes from every block into a single sequence + vector result; + for (size_t i = 0; i < blocks.at(0).size(); i++) { + for (size_t j = 0; j < blocks.size(); j++) { + // Skip the padding byte in short blocks + if (i != static_cast(shortBlockLen - blockEccLen) || j >= static_cast(numShortBlocks)) + result.push_back(blocks.at(j).at(i)); + } + } + if (result.size() != static_cast(rawCodewords)) + throw std::logic_error("Assertion error"); + return result; +} + + +void QrCode::drawCodewords(const vector &data) { + if (data.size() != static_cast(getNumRawDataModules(version) / 8)) + throw std::invalid_argument("Invalid argument"); + + size_t i = 0; // Bit index into the data + // Do the funny zigzag scan + for (int right = size - 1; right >= 1; right -= 2) { // Index of right column in each column pair + if (right == 6) + right = 5; + for (int vert = 0; vert < size; vert++) { // Vertical counter + for (int j = 0; j < 2; j++) { + size_t x = static_cast(right - j); // Actual x coordinate + bool upward = ((right + 1) & 2) == 0; + size_t y = static_cast(upward ? size - 1 - vert : vert); // Actual y coordinate + if (!isFunction.at(y).at(x) && i < data.size() * 8) { + modules.at(y).at(x) = getBit(data.at(i >> 3), 7 - static_cast(i & 7)); + i++; + } + // If this QR Code has any remainder bits (0 to 7), they were assigned as + // 0/false/white by the constructor and are left unchanged by this method + } + } + } + if (i != data.size() * 8) + throw std::logic_error("Assertion error"); +} + + +void QrCode::applyMask(int msk) { + if (msk < 0 || msk > 7) + throw std::domain_error("Mask value out of range"); + size_t sz = static_cast(size); + for (size_t y = 0; y < sz; y++) { + for (size_t x = 0; x < sz; x++) { + bool invert; + switch (msk) { + case 0: invert = (x + y) % 2 == 0; break; + case 1: invert = y % 2 == 0; break; + case 2: invert = x % 3 == 0; break; + case 3: invert = (x + y) % 3 == 0; break; + case 4: invert = (x / 3 + y / 2) % 2 == 0; break; + case 5: invert = x * y % 2 + x * y % 3 == 0; break; + case 6: invert = (x * y % 2 + x * y % 3) % 2 == 0; break; + case 7: invert = ((x + y) % 2 + x * y % 3) % 2 == 0; break; + default: throw std::logic_error("Assertion error"); + } + modules.at(y).at(x) = modules.at(y).at(x) ^ (invert & !isFunction.at(y).at(x)); + } + } +} + + +long QrCode::getPenaltyScore() const { + long result = 0; + + // Adjacent modules in row having same color, and finder-like patterns + for (int y = 0; y < size; y++) { + bool runColor = false; + int runX = 0; + std::array runHistory = {}; + for (int x = 0; x < size; x++) { + if (module(x, y) == runColor) { + runX++; + if (runX == 5) + result += PENALTY_N1; + else if (runX > 5) + result++; + } else { + finderPenaltyAddHistory(runX, runHistory); + if (!runColor) + result += finderPenaltyCountPatterns(runHistory) * PENALTY_N3; + runColor = module(x, y); + runX = 1; + } + } + result += finderPenaltyTerminateAndCount(runColor, runX, runHistory) * PENALTY_N3; + } + // Adjacent modules in column having same color, and finder-like patterns + for (int x = 0; x < size; x++) { + bool runColor = false; + int runY = 0; + std::array runHistory = {}; + for (int y = 0; y < size; y++) { + if (module(x, y) == runColor) { + runY++; + if (runY == 5) + result += PENALTY_N1; + else if (runY > 5) + result++; + } else { + finderPenaltyAddHistory(runY, runHistory); + if (!runColor) + result += finderPenaltyCountPatterns(runHistory) * PENALTY_N3; + runColor = module(x, y); + runY = 1; + } + } + result += finderPenaltyTerminateAndCount(runColor, runY, runHistory) * PENALTY_N3; + } + + // 2*2 blocks of modules having same color + for (int y = 0; y < size - 1; y++) { + for (int x = 0; x < size - 1; x++) { + bool color = module(x, y); + if ( color == module(x + 1, y) && + color == module(x, y + 1) && + color == module(x + 1, y + 1)) + result += PENALTY_N2; + } + } + + // Balance of black and white modules + int black = 0; + for (const vector &row : modules) { + for (bool color : row) { + if (color) + black++; + } + } + int total = size * size; // Note that size is odd, so black/total != 1/2 + // Compute the smallest integer k >= 0 such that (45-5k)% <= black/total <= (55+5k)% + int k = static_cast((std::abs(black * 20L - total * 10L) + total - 1) / total) - 1; + result += k * PENALTY_N4; + return result; +} + + +vector QrCode::getAlignmentPatternPositions() const { + if (version == 1) + return vector(); + else { + int numAlign = version / 7 + 2; + int step = (version == 32) ? 26 : + (version*4 + numAlign*2 + 1) / (numAlign*2 - 2) * 2; + vector result; + for (int i = 0, pos = size - 7; i < numAlign - 1; i++, pos -= step) + result.insert(result.begin(), pos); + result.insert(result.begin(), 6); + return result; + } +} + + +int QrCode::getNumRawDataModules(int ver) { + if (ver < MIN_VERSION || ver > MAX_VERSION) + throw std::domain_error("Version number out of range"); + int result = (16 * ver + 128) * ver + 64; + if (ver >= 2) { + int numAlign = ver / 7 + 2; + result -= (25 * numAlign - 10) * numAlign - 55; + if (ver >= 7) + result -= 36; + } + if (!(208 <= result && result <= 29648)) + throw std::logic_error("Assertion error"); + return result; +} + + +int QrCode::getNumDataCodewords(int ver, Ecc ecl) { + return getNumRawDataModules(ver) / 8 + - ECC_CODEWORDS_PER_BLOCK [static_cast(ecl)][ver] + * NUM_ERROR_CORRECTION_BLOCKS[static_cast(ecl)][ver]; +} + + +vector QrCode::reedSolomonComputeDivisor(int degree) { + if (degree < 1 || degree > 255) + throw std::domain_error("Degree out of range"); + // Polynomial coefficients are stored from highest to lowest power, excluding the leading term which is always 1. + // For example the polynomial x^3 + 255x^2 + 8x + 93 is stored as the uint8 array {255, 8, 93}. + vector result(static_cast(degree)); + result.at(result.size() - 1) = 1; // Start off with the monomial x^0 + + // Compute the product polynomial (x - r^0) * (x - r^1) * (x - r^2) * ... * (x - r^{degree-1}), + // and drop the highest monomial term which is always 1x^degree. + // Note that r = 0x02, which is a generator element of this field GF(2^8/0x11D). + uint8_t root = 1; + for (int i = 0; i < degree; i++) { + // Multiply the current product by (x - r^i) + for (size_t j = 0; j < result.size(); j++) { + result.at(j) = reedSolomonMultiply(result.at(j), root); + if (j + 1 < result.size()) + result.at(j) ^= result.at(j + 1); + } + root = reedSolomonMultiply(root, 0x02); + } + return result; +} + + +vector QrCode::reedSolomonComputeRemainder(const vector &data, const vector &divisor) { + vector result(divisor.size()); + for (uint8_t b : data) { // Polynomial division + uint8_t factor = b ^ result.at(0); + result.erase(result.begin()); + result.push_back(0); + for (size_t i = 0; i < result.size(); i++) + result.at(i) ^= reedSolomonMultiply(divisor.at(i), factor); + } + return result; +} + + +uint8_t QrCode::reedSolomonMultiply(uint8_t x, uint8_t y) { + // Russian peasant multiplication + int z = 0; + for (int i = 7; i >= 0; i--) { + z = (z << 1) ^ ((z >> 7) * 0x11D); + z ^= ((y >> i) & 1) * x; + } + if (z >> 8 != 0) + throw std::logic_error("Assertion error"); + return static_cast(z); +} + + +int QrCode::finderPenaltyCountPatterns(const std::array &runHistory) const { + int n = runHistory.at(1); + if (n > size * 3) + throw std::logic_error("Assertion error"); + bool core = n > 0 && runHistory.at(2) == n && runHistory.at(3) == n * 3 && runHistory.at(4) == n && runHistory.at(5) == n; + return (core && runHistory.at(0) >= n * 4 && runHistory.at(6) >= n ? 1 : 0) + + (core && runHistory.at(6) >= n * 4 && runHistory.at(0) >= n ? 1 : 0); +} + + +int QrCode::finderPenaltyTerminateAndCount(bool currentRunColor, int currentRunLength, std::array &runHistory) const { + if (currentRunColor) { // Terminate black run + finderPenaltyAddHistory(currentRunLength, runHistory); + currentRunLength = 0; + } + currentRunLength += size; // Add white border to final run + finderPenaltyAddHistory(currentRunLength, runHistory); + return finderPenaltyCountPatterns(runHistory); +} + + +void QrCode::finderPenaltyAddHistory(int currentRunLength, std::array &runHistory) const { + if (runHistory.at(0) == 0) + currentRunLength += size; // Add white border to initial run + std::copy_backward(runHistory.cbegin(), runHistory.cend() - 1, runHistory.end()); + runHistory.at(0) = currentRunLength; +} + + +bool QrCode::getBit(long x, int i) { + return ((x >> i) & 1) != 0; +} + + +/*---- Tables of constants ----*/ + +const int QrCode::PENALTY_N1 = 3; +const int QrCode::PENALTY_N2 = 3; +const int QrCode::PENALTY_N3 = 40; +const int QrCode::PENALTY_N4 = 10; + + +const int8_t QrCode::ECC_CODEWORDS_PER_BLOCK[4][41] = { + // Version: (note that index 0 is for padding, and is set to an illegal value) + //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level + {-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // Low + {-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28}, // Medium + {-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // Quartile + {-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // High +}; + +const int8_t QrCode::NUM_ERROR_CORRECTION_BLOCKS[4][41] = { + // Version: (note that index 0 is for padding, and is set to an illegal value) + //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level + {-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25}, // Low + {-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49}, // Medium + {-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68}, // Quartile + {-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81}, // High +}; + + +data_too_long::data_too_long(const std::string &msg) : + std::length_error(msg) {} + + + +BitBuffer::BitBuffer() + : std::vector() {} + + +void BitBuffer::appendBits(std::uint32_t val, int len) { + if (len < 0 || len > 31 || val >> len != 0) + throw std::domain_error("Value out of range"); + for (int i = len - 1; i >= 0; i--) // Append bit by bit + this->push_back(((val >> i) & 1) != 0); +} + +} diff --git a/third_party/qrcode/QrCode.hpp b/third_party/qrcode/QrCode.hpp new file mode 100644 index 000000000..7341e4102 --- /dev/null +++ b/third_party/qrcode/QrCode.hpp @@ -0,0 +1,556 @@ +/* + * QR Code generator library (C++) + * + * Copyright (c) Project Nayuki. (MIT License) + * https://www.nayuki.io/page/qr-code-generator-library + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * - The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * - The Software is provided "as is", without warranty of any kind, express or + * implied, including but not limited to the warranties of merchantability, + * fitness for a particular purpose and noninfringement. In no event shall the + * authors or copyright holders be liable for any claim, damages or other + * liability, whether in an action of contract, tort or otherwise, arising from, + * out of or in connection with the Software or the use or other dealings in the + * Software. + */ + +#pragma once + +#include +#include +#include +#include +#include + + +namespace qrcodegen { + +/* + * A segment of character/binary/control data in a QR Code symbol. + * Instances of this class are immutable. + * The mid-level way to create a segment is to take the payload data + * and call a static factory function such as QrSegment::makeNumeric(). + * The low-level way to create a segment is to custom-make the bit buffer + * and call the QrSegment() constructor with appropriate values. + * This segment class imposes no length restrictions, but QR Codes have restrictions. + * Even in the most favorable conditions, a QR Code can only hold 7089 characters of data. + * Any segment longer than this is meaningless for the purpose of generating QR Codes. + */ +class QrSegment final { + + /*---- Public helper enumeration ----*/ + + /* + * Describes how a segment's data bits are interpreted. Immutable. + */ + public: class Mode final { + + /*-- Constants --*/ + + public: static const Mode NUMERIC; + public: static const Mode ALPHANUMERIC; + public: static const Mode BYTE; + public: static const Mode KANJI; + public: static const Mode ECI; + + + /*-- Fields --*/ + + // The mode indicator bits, which is a uint4 value (range 0 to 15). + private: int modeBits; + + // Number of character count bits for three different version ranges. + private: int numBitsCharCount[3]; + + + /*-- Constructor --*/ + + private: Mode(int mode, int cc0, int cc1, int cc2); + + + /*-- Methods --*/ + + /* + * (Package-private) Returns the mode indicator bits, which is an unsigned 4-bit value (range 0 to 15). + */ + public: int getModeBits() const; + + /* + * (Package-private) Returns the bit width of the character count field for a segment in + * this mode in a QR Code at the given version number. The result is in the range [0, 16]. + */ + public: int numCharCountBits(int ver) const; + + }; + + + + /*---- Static factory functions (mid level) ----*/ + + /* + * Returns a segment representing the given binary data encoded in + * byte mode. All input byte vectors are acceptable. Any text string + * can be converted to UTF-8 bytes and encoded as a byte mode segment. + */ + public: static QrSegment makeBytes(const std::vector &data); + + + /* + * Returns a segment representing the given string of decimal digits encoded in numeric mode. + */ + public: static QrSegment makeNumeric(const char *digits); + + + /* + * Returns a segment representing the given text string encoded in alphanumeric mode. + * The characters allowed are: 0 to 9, A to Z (uppercase only), space, + * dollar, percent, asterisk, plus, hyphen, period, slash, colon. + */ + public: static QrSegment makeAlphanumeric(const char *text); + + + /* + * Returns a list of zero or more segments to represent the given text string. The result + * may use various segment modes and switch modes to optimize the length of the bit stream. + */ + public: static std::vector makeSegments(const char *text); + + + /* + * Returns a segment representing an Extended Channel Interpretation + * (ECI) designator with the given assignment value. + */ + public: static QrSegment makeEci(long assignVal); + + + /*---- Public static helper functions ----*/ + + /* + * Tests whether the given string can be encoded as a segment in alphanumeric mode. + * A string is encodable iff each character is in the following set: 0 to 9, A to Z + * (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon. + */ + public: static bool isAlphanumeric(const char *text); + + + /* + * Tests whether the given string can be encoded as a segment in numeric mode. + * A string is encodable iff each character is in the range 0 to 9. + */ + public: static bool isNumeric(const char *text); + + + + /*---- Instance fields ----*/ + + /* The mode indicator of this segment. Accessed through getMode(). */ + private: Mode mode; + + /* The length of this segment's unencoded data. Measured in characters for + * numeric/alphanumeric/kanji mode, bytes for byte mode, and 0 for ECI mode. + * Always zero or positive. Not the same as the data's bit length. + * Accessed through getNumChars(). */ + private: int numChars; + + /* The data bits of this segment. Accessed through getData(). */ + private: std::vector data; + + + /*---- Constructors (low level) ----*/ + + /* + * Creates a new QR Code segment with the given attributes and data. + * The character count (numCh) must agree with the mode and the bit buffer length, + * but the constraint isn't checked. The given bit buffer is copied and stored. + */ + public: QrSegment(Mode md, int numCh, const std::vector &dt); + + + /* + * Creates a new QR Code segment with the given parameters and data. + * The character count (numCh) must agree with the mode and the bit buffer length, + * but the constraint isn't checked. The given bit buffer is moved and stored. + */ + public: QrSegment(Mode md, int numCh, std::vector &&dt); + + + /*---- Methods ----*/ + + /* + * Returns the mode field of this segment. + */ + public: Mode getMode() const; + + + /* + * Returns the character count field of this segment. + */ + public: int getNumChars() const; + + + /* + * Returns the data bits of this segment. + */ + public: const std::vector &getData() const; + + + // (Package-private) Calculates the number of bits needed to encode the given segments at + // the given version. Returns a non-negative number if successful. Otherwise returns -1 if a + // segment has too many characters to fit its length field, or the total bits exceeds INT_MAX. + public: static int getTotalBits(const std::vector &segs, int version); + + + /*---- Private constant ----*/ + + /* The set of all legal characters in alphanumeric mode, where + * each character value maps to the index in the string. */ + private: static const char *ALPHANUMERIC_CHARSET; + +}; + + + +/* + * A QR Code symbol, which is a type of two-dimension barcode. + * Invented by Denso Wave and described in the ISO/IEC 18004 standard. + * Instances of this class represent an immutable square grid of black and white cells. + * The class provides static factory functions to create a QR Code from text or binary data. + * The class covers the QR Code Model 2 specification, supporting all versions (sizes) + * from 1 to 40, all 4 error correction levels, and 4 character encoding modes. + * + * Ways to create a QR Code object: + * - High level: Take the payload data and call QrCode::encodeText() or QrCode::encodeBinary(). + * - Mid level: Custom-make the list of segments and call QrCode::encodeSegments(). + * - Low level: Custom-make the array of data codeword bytes (including + * segment headers and final padding, excluding error correction codewords), + * supply the appropriate version number, and call the QrCode() constructor. + * (Note that all ways require supplying the desired error correction level.) + */ +class QrCode final { + + /*---- Public helper enumeration ----*/ + + /* + * The error correction level in a QR Code symbol. + */ + public: enum class Ecc { + LOW = 0 , // The QR Code can tolerate about 7% erroneous codewords + MEDIUM , // The QR Code can tolerate about 15% erroneous codewords + QUARTILE, // The QR Code can tolerate about 25% erroneous codewords + HIGH , // The QR Code can tolerate about 30% erroneous codewords + }; + + + // Returns a value in the range 0 to 3 (unsigned 2-bit integer). + private: static int getFormatBits(Ecc ecl); + + + + /*---- Static factory functions (high level) ----*/ + + /* + * Returns a QR Code representing the given Unicode text string at the given error correction level. + * As a conservative upper bound, this function is guaranteed to succeed for strings that have 2953 or fewer + * UTF-8 code units (not Unicode code points) if the low error correction level is used. The smallest possible + * QR Code version is automatically chosen for the output. The ECC level of the result may be higher than + * the ecl argument if it can be done without increasing the version. + */ + public: static QrCode encodeText(const char *text, Ecc ecl); + + + /* + * Returns a QR Code representing the given binary data at the given error correction level. + * This function always encodes using the binary segment mode, not any text mode. The maximum number of + * bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output. + * The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version. + */ + public: static QrCode encodeBinary(const std::vector &data, Ecc ecl); + + + /*---- Static factory functions (mid level) ----*/ + + /* + * Returns a QR Code representing the given segments with the given encoding parameters. + * The smallest possible QR Code version within the given range is automatically + * chosen for the output. Iff boostEcl is true, then the ECC level of the result + * may be higher than the ecl argument if it can be done without increasing the + * version. The mask number is either between 0 to 7 (inclusive) to force that + * mask, or -1 to automatically choose an appropriate mask (which may be slow). + * This function allows the user to create a custom sequence of segments that switches + * between modes (such as alphanumeric and byte) to encode text in less space. + * This is a mid-level API; the high-level API is encodeText() and encodeBinary(). + */ + public: static QrCode encodeSegments(const std::vector &segs, Ecc ecl, + int minVersion=1, int maxVersion=40, int mask=-1, bool boostEcl=true); // All optional parameters + + + + /*---- Instance fields ----*/ + + // Immutable scalar parameters: + + /* The version number of this QR Code, which is between 1 and 40 (inclusive). + * This determines the size of this barcode. */ + private: int version; + + /* The width and height of this QR Code, measured in modules, between + * 21 and 177 (inclusive). This is equal to version * 4 + 17. */ + private: int size; + + /* The error correction level used in this QR Code. */ + private: Ecc errorCorrectionLevel; + + /* The index of the mask pattern used in this QR Code, which is between 0 and 7 (inclusive). + * Even if a QR Code is created with automatic masking requested (mask = -1), + * the resulting object still has a mask value between 0 and 7. */ + private: int mask; + + // Private grids of modules/pixels, with dimensions of size*size: + + // The modules of this QR Code (false = white, true = black). + // Immutable after constructor finishes. Accessed through getModule(). + private: std::vector > modules; + + // Indicates function modules that are not subjected to masking. Discarded when constructor finishes. + private: std::vector > isFunction; + + + + /*---- Constructor (low level) ----*/ + + /* + * Creates a new QR Code with the given version number, + * error correction level, data codeword bytes, and mask number. + * This is a low-level API that most users should not use directly. + * A mid-level API is the encodeSegments() function. + */ + public: QrCode(int ver, Ecc ecl, const std::vector &dataCodewords, int msk); + + + + /*---- Public instance methods ----*/ + + /* + * Returns this QR Code's version, in the range [1, 40]. + */ + public: int getVersion() const; + + + /* + * Returns this QR Code's size, in the range [21, 177]. + */ + public: int getSize() const; + + + /* + * Returns this QR Code's error correction level. + */ + public: Ecc getErrorCorrectionLevel() const; + + + /* + * Returns this QR Code's mask, in the range [0, 7]. + */ + public: int getMask() const; + + + /* + * Returns the color of the module (pixel) at the given coordinates, which is false + * for white or true for black. The top left corner has the coordinates (x=0, y=0). + * If the given coordinates are out of bounds, then false (white) is returned. + */ + public: bool getModule(int x, int y) const; + + + /* + * Returns a string of SVG code for an image depicting this QR Code, with the given number + * of border modules. The string always uses Unix newlines (\n), regardless of the platform. + */ + public: std::string toSvgString(int border) const; + + + + /*---- Private helper methods for constructor: Drawing function modules ----*/ + + // Reads this object's version field, and draws and marks all function modules. + private: void drawFunctionPatterns(); + + + // Draws two copies of the format bits (with its own error correction code) + // based on the given mask and this object's error correction level field. + private: void drawFormatBits(int msk); + + + // Draws two copies of the version bits (with its own error correction code), + // based on this object's version field, iff 7 <= version <= 40. + private: void drawVersion(); + + + // Draws a 9*9 finder pattern including the border separator, + // with the center module at (x, y). Modules can be out of bounds. + private: void drawFinderPattern(int x, int y); + + + // Draws a 5*5 alignment pattern, with the center module + // at (x, y). All modules must be in bounds. + private: void drawAlignmentPattern(int x, int y); + + + // Sets the color of a module and marks it as a function module. + // Only used by the constructor. Coordinates must be in bounds. + private: void setFunctionModule(int x, int y, bool isBlack); + + + // Returns the color of the module at the given coordinates, which must be in range. + private: bool module(int x, int y) const; + + + /*---- Private helper methods for constructor: Codewords and masking ----*/ + + // Returns a new byte string representing the given data with the appropriate error correction + // codewords appended to it, based on this object's version and error correction level. + private: std::vector addEccAndInterleave(const std::vector &data) const; + + + // Draws the given sequence of 8-bit codewords (data and error correction) onto the entire + // data area of this QR Code. Function modules need to be marked off before this is called. + private: void drawCodewords(const std::vector &data); + + + // XORs the codeword modules in this QR Code with the given mask pattern. + // The function modules must be marked and the codeword bits must be drawn + // before masking. Due to the arithmetic of XOR, calling applyMask() with + // the same mask value a second time will undo the mask. A final well-formed + // QR Code needs exactly one (not zero, two, etc.) mask applied. + private: void applyMask(int msk); + + + // Calculates and returns the penalty score based on state of this QR Code's current modules. + // This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score. + private: long getPenaltyScore() const; + + + + /*---- Private helper functions ----*/ + + // Returns an ascending list of positions of alignment patterns for this version number. + // Each position is in the range [0,177), and are used on both the x and y axes. + // This could be implemented as lookup table of 40 variable-length lists of unsigned bytes. + private: std::vector getAlignmentPatternPositions() const; + + + // Returns the number of data bits that can be stored in a QR Code of the given version number, after + // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8. + // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table. + private: static int getNumRawDataModules(int ver); + + + // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any + // QR Code of the given version number and error correction level, with remainder bits discarded. + // This stateless pure function could be implemented as a (40*4)-cell lookup table. + private: static int getNumDataCodewords(int ver, Ecc ecl); + + + // Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be + // implemented as a lookup table over all possible parameter values, instead of as an algorithm. + private: static std::vector reedSolomonComputeDivisor(int degree); + + + // Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials. + private: static std::vector reedSolomonComputeRemainder(const std::vector &data, const std::vector &divisor); + + + // Returns the product of the two given field elements modulo GF(2^8/0x11D). + // All inputs are valid. This could be implemented as a 256*256 lookup table. + private: static std::uint8_t reedSolomonMultiply(std::uint8_t x, std::uint8_t y); + + + // Can only be called immediately after a white run is added, and + // returns either 0, 1, or 2. A helper function for getPenaltyScore(). + private: int finderPenaltyCountPatterns(const std::array &runHistory) const; + + + // Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore(). + private: int finderPenaltyTerminateAndCount(bool currentRunColor, int currentRunLength, std::array &runHistory) const; + + + // Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore(). + private: void finderPenaltyAddHistory(int currentRunLength, std::array &runHistory) const; + + + // Returns true iff the i'th bit of x is set to 1. + private: static bool getBit(long x, int i); + + + /*---- Constants and tables ----*/ + + // The minimum version number supported in the QR Code Model 2 standard. + public: static constexpr int MIN_VERSION = 1; + + // The maximum version number supported in the QR Code Model 2 standard. + public: static constexpr int MAX_VERSION = 40; + + + // For use in getPenaltyScore(), when evaluating which mask is best. + private: static const int PENALTY_N1; + private: static const int PENALTY_N2; + private: static const int PENALTY_N3; + private: static const int PENALTY_N4; + + + private: static const std::int8_t ECC_CODEWORDS_PER_BLOCK[4][41]; + private: static const std::int8_t NUM_ERROR_CORRECTION_BLOCKS[4][41]; + +}; + + + +/*---- Public exception class ----*/ + +/* + * Thrown when the supplied data does not fit any QR Code version. Ways to handle this exception include: + * - Decrease the error correction level if it was greater than Ecc::LOW. + * - If the encodeSegments() function was called with a maxVersion argument, then increase + * it if it was less than QrCode::MAX_VERSION. (This advice does not apply to the other + * factory functions because they search all versions up to QrCode::MAX_VERSION.) + * - Split the text data into better or optimal segments in order to reduce the number of bits required. + * - Change the text or binary data to be shorter. + * - Change the text to fit the character set of a particular segment mode (e.g. alphanumeric). + * - Propagate the error upward to the caller/user. + */ +class data_too_long : public std::length_error { + + public: explicit data_too_long(const std::string &msg); + +}; + + + +/* + * An appendable sequence of bits (0s and 1s). Mainly used by QrSegment. + */ +class BitBuffer final : public std::vector { + + /*---- Constructor ----*/ + + // Creates an empty bit buffer (length 0). + public: BitBuffer(); + + + + /*---- Method ----*/ + + // Appends the given number of low-order bits of the given value + // to this buffer. Requires 0 <= len <= 31 and val < 2^len. + public: void appendBits(std::uint32_t val, int len); + +}; + +} diff --git a/third_party/snpe/aarch64 b/third_party/snpe/aarch64 new file mode 120000 index 000000000..baf4e9cb6 --- /dev/null +++ b/third_party/snpe/aarch64 @@ -0,0 +1 @@ +aarch64-android-clang6.0 \ No newline at end of file diff --git a/third_party/snpe/aarch64-android-clang6.0/libPlatformValidatorShared.so b/third_party/snpe/aarch64-android-clang6.0/libPlatformValidatorShared.so new file mode 100644 index 000000000..5df5b07b1 Binary files /dev/null and b/third_party/snpe/aarch64-android-clang6.0/libPlatformValidatorShared.so differ diff --git a/third_party/snpe/aarch64-android-clang6.0/libSNPE.so b/third_party/snpe/aarch64-android-clang6.0/libSNPE.so new file mode 100644 index 000000000..6ef777e15 Binary files /dev/null and b/third_party/snpe/aarch64-android-clang6.0/libSNPE.so differ diff --git a/third_party/snpe/aarch64-android-clang6.0/libSNPE_G.so b/third_party/snpe/aarch64-android-clang6.0/libSNPE_G.so new file mode 100644 index 000000000..565c80bb6 Binary files /dev/null and b/third_party/snpe/aarch64-android-clang6.0/libSNPE_G.so differ diff --git a/third_party/snpe/aarch64-android-clang6.0/libc++_shared.so b/third_party/snpe/aarch64-android-clang6.0/libc++_shared.so new file mode 100644 index 000000000..5b9a9cff6 Binary files /dev/null and b/third_party/snpe/aarch64-android-clang6.0/libc++_shared.so differ diff --git a/third_party/snpe/aarch64-android-clang6.0/libcalculator.so b/third_party/snpe/aarch64-android-clang6.0/libcalculator.so new file mode 100644 index 000000000..3aa1ec3ac Binary files /dev/null and b/third_party/snpe/aarch64-android-clang6.0/libcalculator.so differ diff --git a/third_party/snpe/aarch64-android-clang6.0/libcalculator_domains.so b/third_party/snpe/aarch64-android-clang6.0/libcalculator_domains.so new file mode 100644 index 000000000..bef3fc201 Binary files /dev/null and b/third_party/snpe/aarch64-android-clang6.0/libcalculator_domains.so differ diff --git a/third_party/snpe/aarch64-android-clang6.0/libhta.so b/third_party/snpe/aarch64-android-clang6.0/libhta.so new file mode 100644 index 000000000..bfd3554cf Binary files /dev/null and b/third_party/snpe/aarch64-android-clang6.0/libhta.so differ diff --git a/third_party/snpe/aarch64-android-clang6.0/libsnpe_adsp.so b/third_party/snpe/aarch64-android-clang6.0/libsnpe_adsp.so new file mode 100644 index 000000000..8a6b4e3fc Binary files /dev/null and b/third_party/snpe/aarch64-android-clang6.0/libsnpe_adsp.so differ diff --git a/third_party/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains.so b/third_party/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains.so new file mode 100644 index 000000000..0663d25e3 Binary files /dev/null and b/third_party/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains.so differ diff --git a/third_party/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_system.so b/third_party/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_system.so new file mode 100644 index 000000000..33d354ff7 Binary files /dev/null and b/third_party/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_system.so differ diff --git a/third_party/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_v2.so b/third_party/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_v2.so new file mode 100644 index 000000000..5a6334459 Binary files /dev/null and b/third_party/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_v2.so differ diff --git a/third_party/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_v2_system.so b/third_party/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_v2_system.so new file mode 100644 index 000000000..2d74ae0f0 Binary files /dev/null and b/third_party/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_v2_system.so differ diff --git a/third_party/snpe/aarch64-android-clang6.0/libsymphony-cpu.so b/third_party/snpe/aarch64-android-clang6.0/libsymphony-cpu.so new file mode 100644 index 000000000..8dd26fb26 Binary files /dev/null and b/third_party/snpe/aarch64-android-clang6.0/libsymphony-cpu.so differ diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libPlatformValidatorShared.so b/third_party/snpe/aarch64-linux-gcc4.9/libPlatformValidatorShared.so new file mode 100644 index 000000000..32f8e2f60 Binary files /dev/null and b/third_party/snpe/aarch64-linux-gcc4.9/libPlatformValidatorShared.so differ diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libSNPE.so b/third_party/snpe/aarch64-linux-gcc4.9/libSNPE.so new file mode 100644 index 000000000..6f497cfa0 Binary files /dev/null and b/third_party/snpe/aarch64-linux-gcc4.9/libSNPE.so differ diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libatomic.so.1 b/third_party/snpe/aarch64-linux-gcc4.9/libatomic.so.1 new file mode 100644 index 000000000..809fd4ef6 Binary files /dev/null and b/third_party/snpe/aarch64-linux-gcc4.9/libatomic.so.1 differ diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libcalculator.so b/third_party/snpe/aarch64-linux-gcc4.9/libcalculator.so new file mode 100644 index 000000000..dd3bfe5af Binary files /dev/null and b/third_party/snpe/aarch64-linux-gcc4.9/libcalculator.so differ diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libcalculator_domains.so b/third_party/snpe/aarch64-linux-gcc4.9/libcalculator_domains.so new file mode 100644 index 000000000..05cf724b7 Binary files /dev/null and b/third_party/snpe/aarch64-linux-gcc4.9/libcalculator_domains.so differ diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libsnpe_adsp.so b/third_party/snpe/aarch64-linux-gcc4.9/libsnpe_adsp.so new file mode 100644 index 000000000..11db2cdf6 Binary files /dev/null and b/third_party/snpe/aarch64-linux-gcc4.9/libsnpe_adsp.so differ diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libsnpe_dsp_domains_v2.so b/third_party/snpe/aarch64-linux-gcc4.9/libsnpe_dsp_domains_v2.so new file mode 100644 index 000000000..cc8a8dc2a Binary files /dev/null and b/third_party/snpe/aarch64-linux-gcc4.9/libsnpe_dsp_domains_v2.so differ diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libsymphony-cpu.so b/third_party/snpe/aarch64-linux-gcc4.9/libsymphony-cpu.so new file mode 100644 index 000000000..202d7e971 Binary files /dev/null and b/third_party/snpe/aarch64-linux-gcc4.9/libsymphony-cpu.so differ diff --git a/third_party/snpe/dsp/libcalculator_domains_skel.so b/third_party/snpe/dsp/libcalculator_domains_skel.so new file mode 100644 index 000000000..cb8897f23 Binary files /dev/null and b/third_party/snpe/dsp/libcalculator_domains_skel.so differ diff --git a/third_party/snpe/dsp/libcalculator_skel.so b/third_party/snpe/dsp/libcalculator_skel.so new file mode 100644 index 000000000..45515ea4f Binary files /dev/null and b/third_party/snpe/dsp/libcalculator_skel.so differ diff --git a/third_party/snpe/dsp/libsnpe_dsp_domains_skel.so b/third_party/snpe/dsp/libsnpe_dsp_domains_skel.so new file mode 100644 index 000000000..d4e341262 Binary files /dev/null and b/third_party/snpe/dsp/libsnpe_dsp_domains_skel.so differ diff --git a/third_party/snpe/dsp/libsnpe_dsp_skel.so b/third_party/snpe/dsp/libsnpe_dsp_skel.so new file mode 100644 index 000000000..cb37356a9 Binary files /dev/null and b/third_party/snpe/dsp/libsnpe_dsp_skel.so differ diff --git a/third_party/snpe/dsp/libsnpe_dsp_v65_domains_v2_skel.so b/third_party/snpe/dsp/libsnpe_dsp_v65_domains_v2_skel.so new file mode 100644 index 000000000..97a1499a0 Binary files /dev/null and b/third_party/snpe/dsp/libsnpe_dsp_v65_domains_v2_skel.so differ diff --git a/third_party/snpe/dsp/libsnpe_dsp_v66_domains_v2_skel.so b/third_party/snpe/dsp/libsnpe_dsp_v66_domains_v2_skel.so new file mode 100644 index 000000000..008e9e978 Binary files /dev/null and b/third_party/snpe/dsp/libsnpe_dsp_v66_domains_v2_skel.so differ diff --git a/third_party/snpe/include/DiagLog/IDiagLog.hpp b/third_party/snpe/include/DiagLog/IDiagLog.hpp new file mode 100644 index 000000000..018b56725 --- /dev/null +++ b/third_party/snpe/include/DiagLog/IDiagLog.hpp @@ -0,0 +1,84 @@ +//============================================================================= +// +// Copyright (c) 2015, 2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= +#ifndef __IDIAGLOG_HPP_ +#define __IDIAGLOG_HPP_ + +#include + +#include "DiagLog/Options.hpp" +#include "DlSystem/String.hpp" +#include "DlSystem/ZdlExportDefine.hpp" + +namespace zdl +{ +namespace DiagLog +{ + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/// @brief . +/// +/// Interface for controlling logging for zdl components. + +class ZDL_EXPORT IDiagLog +{ +public: + + /// @brief . + /// + /// Sets the options after initialization occurs. + /// + /// @param[in] loggingOptions The options to set up diagnostic logging. + /// + /// @return False if the options could not be set. Ensure logging is not started. + virtual bool setOptions(const Options& loggingOptions) = 0; + + /// @brief . + /// + /// Gets the curent options for the diag logger. + /// + /// @return Diag log options object. + virtual Options getOptions() = 0; + + /// @brief . + /// + /// Allows for setting the log mask once diag logging has started + /// + /// @return True if the level was set successfully, false if a failure occurred. + virtual bool setDiagLogMask(const std::string& mask) = 0; + + /// @brief . + /// + /// Allows for setting the log mask once diag logging has started + /// + /// @return True if the level was set successfully, false if a failure occurred. + virtual bool setDiagLogMask(const zdl::DlSystem::String& mask) = 0; + + /// @brief . + /// + /// Enables logging for zdl components. + /// + /// Logging should be started prior to the instantiation of zdl components + /// to ensure all events are captured. + /// + /// @return False if diagnostic logging could not be started. + virtual bool start(void) = 0; + + /// @brief Disables logging for zdl components. + virtual bool stop(void) = 0; + + virtual ~IDiagLog() {}; +}; + +} // DiagLog namespace +} // zdl namespace + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif diff --git a/third_party/snpe/include/DiagLog/Options.hpp b/third_party/snpe/include/DiagLog/Options.hpp new file mode 100644 index 000000000..798fa3f12 --- /dev/null +++ b/third_party/snpe/include/DiagLog/Options.hpp @@ -0,0 +1,79 @@ +//============================================================================= +// +// Copyright (c) 2015, 2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= +#ifndef __DIAGLOG_OPTIONS_HPP_ +#define __DIAGLOG_OPTIONS_HPP_ + +#include +#include "DlSystem/ZdlExportDefine.hpp" + +namespace zdl +{ +namespace DiagLog +{ +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/// @brief . +/// +/// Options for setting up diagnostic logging for zdl components. +class ZDL_EXPORT Options +{ +public: + Options() : + DiagLogMask(""), + LogFileDirectory("diaglogs"), + LogFileName("DiagLog"), + LogFileRotateCount(20), + LogFileReplace(true) + { + // Solves the empty string problem with multiple std libs + DiagLogMask.reserve(1); + } + + /// @brief . + /// + /// Enables diag logging only on the specified area mask (DNN_RUNTIME=ON | OFF) + std::string DiagLogMask; + + /// @brief . + /// + /// The path to the directory where log files will be written. + /// The path may be relative or absolute. Relative paths are interpreted + /// from the current working directory. + /// Default value is "diaglogs" + std::string LogFileDirectory; + + /// @brief . + /// + //// The name used for log files. If this value is empty then BaseName will be + /// used as the default file name. + /// Default value is "DiagLog" + std::string LogFileName; + + /// @brief . + /// + /// The maximum number of log files to create. If set to 0 no log rotation + /// will be used and the log file name specified will be used each time, overwriting + /// any existing log file that may exist. + /// Default value is 20 + uint32_t LogFileRotateCount; + + /// @brief + /// + /// If the log file already exists, control whether it will be replaced + /// (existing contents truncated), or appended. + /// Default value is true + bool LogFileReplace; +}; +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +} // DiagLog namespace +} // zdl namespace + + +#endif diff --git a/third_party/snpe/include/DlContainer/IDlContainer.hpp b/third_party/snpe/include/DlContainer/IDlContainer.hpp new file mode 100644 index 000000000..4e29b39bb --- /dev/null +++ b/third_party/snpe/include/DlContainer/IDlContainer.hpp @@ -0,0 +1,191 @@ +//============================================================================= +// +// Copyright (c) 2015-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= + +#ifndef ZEROTH_IDNC_CONTAINER_HPP +#define ZEROTH_IDNC_CONTAINER_HPP + +#include +#include +#include +#include +#include + +#include "DlSystem/ZdlExportDefine.hpp" +#include "DlSystem/String.hpp" + +namespace zdl { +namespace DlContainer { + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +class IDlContainer; +class dlc_error; + +/** + * The structure of a record in a DL container. + */ +struct ZDL_EXPORT DlcRecord +{ + /// Name of the record. + std::string name; + /// Byte blob holding the data for the record. + std::vector data; + + DlcRecord(); + DlcRecord( DlcRecord&& other ) + : name(std::move(other.name)) + , data(std::move(other.data)) + {} + DlcRecord(const std::string& new_name) + : name(new_name) + , data() + { + if(name.empty()) + { + name.reserve(1); + } + } + DlcRecord(const DlcRecord&) = delete; +}; + +// The maximum length of any record name. +extern const uint32_t RECORD_NAME_MAX_SIZE; +// The maximum size of the record payload (bytes). +extern const uint32_t RECORD_DATA_MAX_SIZE; +// The maximum number of records in an archive at one time. +extern const uint32_t ARCHIVE_MAX_RECORDS; + +/** + * Represents a container for a neural network model which can + * be used to load the model into the SNPE runtime. + */ +class ZDL_EXPORT IDlContainer +{ +public: + /** + * Initializes a container from a container archive file. + * + * @param[in] filename Container archive file path. + * + * @return A pointer to the initialized container + */ + static std::unique_ptr + open(const std::string &filename) noexcept; + + /** + * Initializes a container from a container archive file. + * + * @param[in] filename Container archive file path. + * + * @return A pointer to the initialized container + */ + static std::unique_ptr + open(const zdl::DlSystem::String &filename) noexcept; + + /** + * Initializes a container from a byte buffer. + * + * @param[in] buffer Byte buffer holding the contents of an archive + * file. + * + * @return A pointer to the initialized container + */ + static std::unique_ptr + open(const std::vector &buffer) noexcept; + + /** + * Initializes a container from a byte buffer. + * + * @param[in] buffer Byte buffer holding the contents of an archive + * file. + * + * @param[in] size Size of the byte buffer. + * + * @return A pointer to the initialized container + */ + static std::unique_ptr + open(const uint8_t* buffer, const size_t size) noexcept; + + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + + /** + * Get the record catalog for a container. + * + * @param[out] catalog Buffer that will hold the record names on + * return. + */ + virtual void getCatalog(std::set &catalog) const = 0; + + /** + * Get the record catalog for a container. + * + * @param[out] catalog Buffer that will hold the record names on + * return. + */ + virtual void getCatalog(std::set &catalog) const = 0; + + /** + * Get a record from a container by name. + * + * @param[in] name Name of the record to fetch. + * @param[out] record The passed in record will be populated with the + * record data on return. Note that the caller + * will own the data in the record and is + * responsible for freeing it if needed. + */ + virtual void getRecord(const std::string &name, DlcRecord &record) const = 0; + + /** + * Get a record from a container by name. + * + * @param[in] name Name of the record to fetch. + * @param[out] record The passed in record will be populated with the + * record data on return. Note that the caller + * will own the data in the record and is + * responsible for freeing it if needed. + */ + virtual void getRecord(const zdl::DlSystem::String &name, DlcRecord &record) const = 0; + + /** + * Save the container to an archive on disk. This function will save the + * container if the filename is different from the file that it was opened + * from, or if at least one record was modified since the container was + * opened. + * + * It will truncate any existing file at the target path. + * + * @param filename Container archive file path. + * + * @return indication of success/failure + */ + virtual bool save(const std::string &filename) = 0; + + /** + * Save the container to an archive on disk. This function will save the + * container if the filename is different from the file that it was opened + * from, or if at least one record was modified since the container was + * opened. + * + * It will truncate any existing file at the target path. + * + * @param filename Container archive file path. + * + * @return indication of success/failure + */ + virtual bool save (const zdl::DlSystem::String &filename) = 0; + + virtual ~IDlContainer() {} +}; + +} // ns DlContainer +} // ns zdl + + +#endif diff --git a/third_party/snpe/include/DlSystem/DlEnums.hpp b/third_party/snpe/include/DlSystem/DlEnums.hpp new file mode 100644 index 000000000..144706355 --- /dev/null +++ b/third_party/snpe/include/DlSystem/DlEnums.hpp @@ -0,0 +1,202 @@ +//============================================================================== +// +// Copyright (c) 2014-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef _DL_ENUMS_HPP_ +#define _DL_ENUMS_HPP_ + +#include "DlSystem/ZdlExportDefine.hpp" + + +namespace zdl { +namespace DlSystem +{ +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * Enumeration of supported target runtimes. + */ +enum class Runtime_t +{ + /// Run the processing on Snapdragon CPU. + /// Data: float 32bit + /// Math: float 32bit + CPU_FLOAT32 = 0, + + /// Run the processing on the Adreno GPU. + /// Data: float 16bit + /// Math: float 32bit + GPU_FLOAT32_16_HYBRID = 1, + + /// Run the processing on the Hexagon DSP. + /// Data: 8bit fixed point Tensorflow style format + /// Math: 8bit fixed point Tensorflow style format + DSP_FIXED8_TF = 2, + + /// Run the processing on the Adreno GPU. + /// Data: float 16bit + /// Math: float 16bit + GPU_FLOAT16 = 3, + + /// Run the processing on Snapdragon AIX+HVX. + /// Data: 8bit fixed point Tensorflow style format + /// Math: 8bit fixed point Tensorflow style format + AIP_FIXED8_TF = 5, + AIP_FIXED_TF = AIP_FIXED8_TF, + + /// Default legacy enum to retain backward compatibility. + /// CPU = CPU_FLOAT32 + CPU = CPU_FLOAT32, + + /// Default legacy enum to retain backward compatibility. + /// GPU = GPU_FLOAT32_16_HYBRID + GPU = GPU_FLOAT32_16_HYBRID, + + /// Default legacy enum to retain backward compatibility. + /// DSP = DSP_FIXED8_TF + DSP = DSP_FIXED8_TF, + + /// Special value indicating the property is unset. + UNSET = -1 +}; + +/** + * Enumeration of runtime available check options. + */ +enum class RuntimeCheckOption_t +{ + /// Perform standard runtime available check + DEFAULT = 0, + /// Perform standard runtime available check + NORMAL_CHECK = 0, + /// Perform basic runtime available check, may be runtime specific + BASIC_CHECK = 1, +}; + +/** + * Enumeration of various performance profiles that can be requested. + */ +enum class PerformanceProfile_t +{ + /// Run in a standard mode. + /// This mode will be deprecated in the future and replaced with BALANCED. + DEFAULT = 0, + /// Run in a balanced mode. + BALANCED = 0, + + /// Run in high performance mode + HIGH_PERFORMANCE = 1, + + /// Run in a power sensitive mode, at the expense of performance. + POWER_SAVER = 2, + + /// Use system settings. SNPE makes no calls to any performance related APIs. + SYSTEM_SETTINGS = 3, + + /// Run in sustained high performance mode + SUSTAINED_HIGH_PERFORMANCE = 4, + + /// Run in burst mode + BURST = 5, + + /// Run in lower clock than POWER_SAVER, at the expense of performance. + LOW_POWER_SAVER = 6, + + /// Run in higher clock and provides better performance than POWER_SAVER. + HIGH_POWER_SAVER = 7, + + /// Run in lower balanced mode + LOW_BALANCED = 8, +}; + +/** + * Enumeration of various profilngLevels that can be requested. + */ +enum class ProfilingLevel_t +{ + /// No profiling. + /// Collects no runtime stats in the DiagLog + OFF = 0, + + /// Basic profiling + /// Collects some runtime stats in the DiagLog + BASIC = 1, + + /// Detailed profiling + /// Collects more runtime stats in the DiagLog, including per-layer statistics + /// Performance may be impacted + DETAILED = 2, + + /// Moderate profiling + /// Collects more runtime stats in the DiagLog, no per-layer statistics + MODERATE = 3 +}; + +/** + * Enumeration of various execution priority hints. + */ +enum class ExecutionPriorityHint_t +{ + /// Normal priority + NORMAL = 0, + + /// Higher than normal priority + HIGH = 1, + + /// Lower priority + LOW = 2 + +}; + +/** @} */ /* end_addtogroup c_plus_plus_apis C++*/ + +/** + * Enumeration that lists the supported image encoding formats. + */ +enum class ImageEncoding_t +{ + /// For unknown image type. Also used as a default value for ImageEncoding_t. + UNKNOWN = 0, + + /// The RGB format consists of 3 bytes per pixel: one byte for + /// Red, one for Green, and one for Blue. The byte ordering is + /// endian independent and is always in RGB byte order. + RGB = 1, + + /// The ARGB32 format consists of 4 bytes per pixel: one byte for + /// Red, one for Green, one for Blue, and one for the alpha channel. + /// The alpha channel is ignored. The byte ordering depends on the + /// underlying CPU. For little endian CPUs, the byte order is BGRA. + /// For big endian CPUs, the byte order is ARGB. + ARGB32 = 2, + + /// The RGBA format consists of 4 bytes per pixel: one byte for + /// Red, one for Green, one for Blue, and one for the alpha channel. + /// The alpha channel is ignored. The byte ordering is endian independent + /// and is always in RGBA byte order. + RGBA = 3, + + /// The GRAYSCALE format is for 8-bit grayscale. + GRAYSCALE = 4, + + /// NV21 is the Android version of YUV. The Chrominance is down + /// sampled and has a subsampling ratio of 4:2:0. Note that this + /// image format has 3 channels, but the U and V channels + /// are subsampled. For every four Y pixels there is one U and one V pixel. @newpage + NV21 = 5, + + /// The BGR format consists of 3 bytes per pixel: one byte for + /// Red, one for Green and one for Blue. The byte ordering is + /// endian independent and is always BGR byte order. + BGR = 6 +}; + +}} // namespaces end + + +#endif diff --git a/third_party/snpe/include/DlSystem/DlError.hpp b/third_party/snpe/include/DlSystem/DlError.hpp new file mode 100644 index 000000000..f0a66e8e4 --- /dev/null +++ b/third_party/snpe/include/DlSystem/DlError.hpp @@ -0,0 +1,247 @@ +//============================================================================== +// +// Copyright (c) 2016-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef _DL_ERROR_HPP_ +#define _DL_ERROR_HPP_ + +#include +#include // numeric_limits + +#include "DlSystem/ZdlExportDefine.hpp" + +namespace zdl { +namespace DlSystem { + +// clang and arm gcc different in how ZDL_EXPORT is used with enum class +#if !defined (__clang__) +enum class ErrorCode : uint32_t ZDL_EXPORT { +#else +enum class ZDL_EXPORT ErrorCode : uint32_t { +#endif // ARM64V8A + NONE = 0, + + // System config errors + SNPE_CONFIG_MISSING_PARAM = 100, + SNPE_CONFIG_INVALID_PARAM = 101, + SNPE_CONFIG_MISSING_FILE = 102, + SNPE_CONFIG_NNCONFIG_NOT_SET = 103, + SNPE_CONFIG_NNCONFIG_INVALID = 104, + SNPE_CONFIG_WRONG_INPUT_NAME = 105, + SNPE_CONFIG_INCORRECT_INPUT_DIMENSIONS = 106, + SNPE_CONFIG_DIMENSIONS_MODIFICATION_NOT_SUPPORTED = 107, + SNPE_CONFIG_BOTH_OUTPUT_LAYER_TENSOR_NAMES_SET = 108, + + SNPE_CONFIG_NNCONFIG_ONLY_TENSOR_SUPPORTED = 120, + SNPE_CONFIG_NNCONFIG_ONLY_USER_BUFFER_SUPPORTED = 121, + + // DlSystem errors + SNPE_DLSYSTEM_MISSING_BUFFER = 200, + SNPE_DLSYSTEM_TENSOR_CAST_FAILED = 201, + SNPE_DLSYSTEM_FIXED_POINT_PARAM_INVALID = 202, + SNPE_DLSYSTEM_SIZE_MISMATCH = 203, + SNPE_DLSYSTEM_NAME_NOT_FOUND = 204, + SNPE_DLSYSTEM_VALUE_MISMATCH = 205, + SNPE_DLSYSTEM_INSERT_FAILED = 206, + SNPE_DLSYSTEM_TENSOR_FILE_READ_FAILED = 207, + SNPE_DLSYSTEM_DIAGLOG_FAILURE = 208, + SNPE_DLSYSTEM_LAYER_NOT_SET = 209, + SNPE_DLSYSTEM_WRONG_NUMBER_INPUT_BUFFERS = 210, + SNPE_DLSYSTEM_RUNTIME_TENSOR_SHAPE_MISMATCH = 211, + SNPE_DLSYSTEM_TENSOR_MISSING = 212, + SNPE_DLSYSTEM_TENSOR_ITERATION_UNSUPPORTED = 213, + SNPE_DLSYSTEM_BUFFER_MANAGER_MISSING = 214, + SNPE_DLSYSTEM_RUNTIME_BUFFER_SOURCE_UNSUPPORTED = 215, + SNPE_DLSYSTEM_BUFFER_CAST_FAILED = 216, + SNPE_DLSYSTEM_WRONG_TRANSITION_TYPE = 217, + SNPE_DLSYSTEM_LAYER_ALREADY_REGISTERED = 218, + + SNPE_DLSYSTEM_BUFFERENCODING_UNKNOWN = 240, + SNPE_DLSYSTEM_BUFFER_INVALID_PARAM = 241, + + // DlContainer errors + SNPE_DLCONTAINER_MODEL_PARSING_FAILED = 300, + SNPE_DLCONTAINER_UNKNOWN_LAYER_CODE = 301, + SNPE_DLCONTAINER_MISSING_LAYER_PARAM = 302, + SNPE_DLCONTAINER_LAYER_PARAM_NOT_SUPPORTED = 303, + SNPE_DLCONTAINER_LAYER_PARAM_INVALID = 304, + SNPE_DLCONTAINER_TENSOR_DATA_MISSING = 305, + SNPE_DLCONTAINER_MODEL_LOAD_FAILED = 306, + SNPE_DLCONTAINER_MISSING_RECORDS = 307, + SNPE_DLCONTAINER_INVALID_RECORD = 308, + SNPE_DLCONTAINER_WRITE_FAILURE = 309, + SNPE_DLCONTAINER_READ_FAILURE = 310, + SNPE_DLCONTAINER_BAD_CONTAINER = 311, + SNPE_DLCONTAINER_BAD_DNN_FORMAT_VERSION = 312, + SNPE_DLCONTAINER_UNKNOWN_AXIS_ANNOTATION = 313, + SNPE_DLCONTAINER_UNKNOWN_SHUFFLE_TYPE = 314, + SNPE_DLCONTAINER_TEMP_FILE_FAILURE = 315, + + // Network errors + SNPE_NETWORK_EMPTY_NETWORK = 400, + SNPE_NETWORK_CREATION_FAILED = 401, + SNPE_NETWORK_PARTITION_FAILED = 402, + SNPE_NETWORK_NO_OUTPUT_DEFINED = 403, + SNPE_NETWORK_MISMATCH_BETWEEN_NAMES_AND_DIMS = 404, + SNPE_NETWORK_MISSING_INPUT_NAMES = 405, + SNPE_NETWORK_MISSING_OUTPUT_NAMES = 406, + + // Host runtime errors + SNPE_HOST_RUNTIME_TARGET_UNAVAILABLE = 500, + + // CPU runtime errors + SNPE_CPU_LAYER_NOT_SUPPORTED = 600, + SNPE_CPU_LAYER_PARAM_NOT_SUPPORTED = 601, + SNPE_CPU_LAYER_PARAM_INVALID = 602, + SNPE_CPU_LAYER_PARAM_COMBINATION_INVALID = 603, + SNPE_CPU_BUFFER_NOT_FOUND = 604, + SNPE_CPU_NETWORK_NOT_SUPPORTED = 605, + SNPE_CPU_UDO_OPERATION_FAILED = 606, + + // CPU fixed-point runtime errors + SNPE_CPU_FXP_LAYER_NOT_SUPPORTED = 700, + SNPE_CPU_FXP_LAYER_PARAM_NOT_SUPPORTED = 701, + SNPE_CPU_FXP_LAYER_PARAM_INVALID = 702, + + // GPU runtime errors + SNPE_GPU_LAYER_NOT_SUPPORTED = 800, + SNPE_GPU_LAYER_PARAM_NOT_SUPPORTED = 801, + SNPE_GPU_LAYER_PARAM_INVALID = 802, + SNPE_GPU_LAYER_PARAM_COMBINATION_INVALID = 803, + SNPE_GPU_KERNEL_COMPILATION_FAILED = 804, + SNPE_GPU_CONTEXT_NOT_SET = 805, + SNPE_GPU_KERNEL_NOT_SET = 806, + SNPE_GPU_KERNEL_PARAM_INVALID = 807, + SNPE_GPU_OPENCL_CHECK_FAILED = 808, + SNPE_GPU_OPENCL_FUNCTION_ERROR = 809, + SNPE_GPU_BUFFER_NOT_FOUND = 810, + SNPE_GPU_TENSOR_DIM_INVALID = 811, + SNPE_GPU_MEMORY_FLAGS_INVALID = 812, + SNPE_GPU_UNEXPECTED_NUMBER_OF_IO = 813, + SNPE_GPU_LAYER_PROXY_ERROR = 814, + SNPE_GPU_BUFFER_IN_USE = 815, + SNPE_GPU_BUFFER_MODIFICATION_ERROR = 816, + SNPE_GPU_DATA_ARRANGEMENT_INVALID = 817, + SNPE_GPU_UDO_OPERATION_FAILED = 818, + // DSP runtime errors + SNPE_DSP_LAYER_NOT_SUPPORTED = 900, + SNPE_DSP_LAYER_PARAM_NOT_SUPPORTED = 901, + SNPE_DSP_LAYER_PARAM_INVALID = 902, + SNPE_DSP_LAYER_PARAM_COMBINATION_INVALID = 903, + SNPE_DSP_STUB_NOT_PRESENT = 904, + SNPE_DSP_LAYER_NAME_TRUNCATED = 905, + SNPE_DSP_LAYER_INPUT_BUFFER_NAME_TRUNCATED = 906, + SNPE_DSP_LAYER_OUTPUT_BUFFER_NAME_TRUNCATED = 907, + SNPE_DSP_RUNTIME_COMMUNICATION_ERROR = 908, + SNPE_DSP_RUNTIME_INVALID_PARAM_ERROR = 909, + SNPE_DSP_RUNTIME_SYSTEM_ERROR = 910, + SNPE_DSP_RUNTIME_CRASHED_ERROR = 911, + + // Model validataion errors + SNPE_MODEL_VALIDATION_LAYER_NOT_SUPPORTED = 1000, + SNPE_MODEL_VALIDATION_LAYER_PARAM_NOT_SUPPORTED = 1001, + SNPE_MODEL_VALIDATION_LAYER_PARAM_INVALID = 1002, + SNPE_MODEL_VALIDATION_LAYER_PARAM_MISSING = 1003, + SNPE_MODEL_VALIDATION_LAYER_PARAM_COMBINATION_INVALID = 1004, + SNPE_MODEL_VALIDATION_LAYER_ORDERING_INVALID = 1005, + SNPE_MODEL_VALIDATION_INVALID_CONSTRAINT = 1006, + SNPE_MODEL_VALIDATION_MISSING_BUFFER = 1007, + SNPE_MODEL_VALIDATION_BUFFER_REUSE_NOT_SUPPORTED = 1008, + SNPE_MODEL_VALIDATION_LAYER_COULD_NOT_BE_ASSIGNED = 1009, + SNPE_MODEL_VALIDATION_UDO_LAYER_FAILED = 1010, + + // UDL errors + SNPE_UDL_LAYER_EMPTY_UDL_NETWORK = 1100, + SNPE_UDL_LAYER_PARAM_INVALID = 1101, + SNPE_UDL_LAYER_INSTANCE_MISSING = 1102, + SNPE_UDL_LAYER_SETUP_FAILED = 1103, + SNPE_UDL_EXECUTE_FAILED = 1104, + SNPE_UDL_BUNDLE_INVALID = 1105, + SNPE_UDO_REGISTRATION_FAILED = 1106, + SNPE_UDO_GET_PACKAGE_FAILED = 1107, + SNPE_UDO_GET_IMPLEMENTATION_FAILED = 1108, + + // Dependent library errors + SNPE_STD_LIBRARY_ERROR = 1200, + + // Unknown exception (catch (...)), Has no component attached to this + SNPE_UNKNOWN_EXCEPTION = 1210, + + // Storage Errors + SNPE_STORAGE_INVALID_KERNEL_REPO = 1300, + + // AIP runtime errors + SNPE_AIP_LAYER_NOT_SUPPORTED = 1400, + SNPE_AIP_LAYER_PARAM_NOT_SUPPORTED = 1401, + SNPE_AIP_LAYER_PARAM_INVALID = 1402, + SNPE_AIP_LAYER_PARAM_COMBINATION_INVALID = 1403, + SNPE_AIP_STUB_NOT_PRESENT = 1404, + SNPE_AIP_LAYER_NAME_TRUNCATED = 1405, + SNPE_AIP_LAYER_INPUT_BUFFER_NAME_TRUNCATED = 1406, + SNPE_AIP_LAYER_OUTPUT_BUFFER_NAME_TRUNCATED = 1407, + SNPE_AIP_RUNTIME_COMMUNICATION_ERROR = 1408, + SNPE_AIP_RUNTIME_INVALID_PARAM_ERROR = 1409, + SNPE_AIP_RUNTIME_SYSTEM_ERROR = 1410, + SNPE_AIP_RUNTIME_TENSOR_MISSING = 1411, + SNPE_AIP_RUNTIME_TENSOR_SHAPE_MISMATCH = 1412, + SNPE_AIP_RUNTIME_BAD_AIX_RECORD = 1413, + + // DlCaching errors + SNPE_DLCACHING_INVALID_METADATA = 1500, + SNPE_DLCACHING_INVALID_INITBLOB = 1501, + + // Infrastructure Errors + SNPE_INFRA_CLUSTERMGR_INSTANCE_INVALID = 1600, + SNPE_INFRA_CLUSTERMGR_EXECUTE_SYNC_FAILED = 1601 + +}; + + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * Returns the error code of the last error encountered. + * + * @return The error code. + * + * @note The returned error code is significant only when the return + * value of the call indicated an error. + */ +ZDL_EXPORT ErrorCode getLastErrorCode(); + +/** + * Returns the error string of the last error encountered. + * + * @return The error string. + * + * @note The returned error string is significant only when the return + * value of the call indicated an error. + */ +ZDL_EXPORT const char* getLastErrorString(); + +/** + * Returns the info string of the last error encountered. + */ +ZDL_EXPORT const char* getLastInfoString(); + +/** + * Returns the uint32_t representation of the error code enum. + * + * @param[in] code The error code to be converted. + * + * @return uint32_t representation of the error code. + */ +ZDL_EXPORT uint32_t enumToUInt32(zdl::DlSystem::ErrorCode code); + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +} // DlSystem +} // zdl + +#endif // _DL_ERROR_HPP_ + diff --git a/third_party/snpe/include/DlSystem/DlOptional.hpp b/third_party/snpe/include/DlSystem/DlOptional.hpp new file mode 100644 index 000000000..4f83e6b4e --- /dev/null +++ b/third_party/snpe/include/DlSystem/DlOptional.hpp @@ -0,0 +1,225 @@ +//============================================================================== +// +// Copyright (c) 2016, 2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef _DL_SYSTEM_OPTIONAL_HPP_ +#define _DL_SYSTEM_OPTIONAL_HPP_ + +#include +#include +#include + +#include "DlSystem/ZdlExportDefine.hpp" + +namespace zdl { +namespace DlSystem { + +template + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * Class to manage a value that may or may not exist. The boolean value + * of the Optional class is true if the object contains a value and false + * if it does not contain a value. + * + * The class must be evaluated and confirmed as true (containing a value) + * before being dereferenced. + */ +class ZDL_EXPORT Optional final { +public: + enum class LIFECYCLE { + NONE = 0, + REFERENCE_OWNED = 1, + POINTER_OWNED = 2, + POINTER_NOT_OWNED = 3 + }; + + struct ReferenceCount { + size_t count = 0; + + void increment() { count++; } + + size_t decrement() { + if (count > 0) { + count--; + } + return count; + } + }; + + using U = typename std::remove_pointer::type; + + /** + * The default constructor is set to not have any value, and is + * therefore evaluated as false. + */ + // Do not explicit it so we can return {} + Optional() { + m_Type = LIFECYCLE::NONE; + } + + /** + * Construct an Optional class using an object. + * @param[in] Reference to an object v + * @param[out] Optional instance of object v + */ + template + Optional (const T& v, typename std::enable_if::value>::type* = 0) + : m_Type(LIFECYCLE::REFERENCE_OWNED) { + try { + m_StoragePtr = new T(v); + } catch (...) { + m_StoragePtr = nullptr; + m_Type = LIFECYCLE::NONE; + } + } + + template + Optional(U* v, LIFECYCLE type, typename std::enable_if::value>::type* = 0) + : m_Type(type) { + switch (m_Type) { + case LIFECYCLE::POINTER_OWNED: + m_StoragePtr = v; + m_Count = new ReferenceCount(); + m_Count->increment(); + break; + case LIFECYCLE::POINTER_NOT_OWNED: + m_StoragePtr = v; + break; + case LIFECYCLE::REFERENCE_OWNED: + throw std::bad_exception(); + case LIFECYCLE::NONE: + break; + } + } + + Optional(const Optional &other) : m_Type(other.m_Type), m_Count(other.m_Count) { + if (isReference()) { + m_StoragePtr = new U(*other.m_StoragePtr); + } else if (isPointer()) { + m_StoragePtr = other.m_StoragePtr; + if (isOwned()) { + m_Count->increment(); + } + } + } + + Optional& operator=(const Optional& other) noexcept { + Optional tmp(other); + swap(std::move(tmp)); + return *this; + } + + Optional(Optional&& other) noexcept { + swap(std::move(other)); + } + + Optional& operator=(Optional&& other) noexcept { + swap(std::move(other)); + return *this; + } + + ~Optional() { + if (isOwned()) { + if (isReference() || (isPointer() && m_Count->decrement() == 0)) { + delete m_StoragePtr; + delete m_Count; + } + } + } + + /** + * Boolean value of Optional class is only true when there exists a value. + */ + operator bool() const noexcept { return isValid(); } + + bool operator!() const noexcept { return !isValid(); } + + /** + * Get reference of Optional object + * @warning User must validate Optional has value before. + */ + const T& operator*() { return this->GetReference(); } + + /** + * Get reference of Optional object + * @warning User must validate Optional has value before. + */ + const T& operator*() const { return this->GetReference(); } + + operator T&() { return this->GetReference(); } + + T operator->() { + T self = this->GetReference(); + return self; + } +private: + void swap(Optional&& other) { + m_Type = other.m_Type; + m_StoragePtr = other.m_StoragePtr; + m_Count = other.m_Count; + + other.m_Type = LIFECYCLE::NONE; + other.m_StoragePtr = nullptr; + other.m_Count = nullptr; + } + + template + typename std::enable_if::value, const Q&>::type GetReference() const noexcept { + if (!isReference()) std::terminate(); + return *static_cast(m_StoragePtr); + } + + template + typename std::enable_if::value, const Q&>::type GetReference() const noexcept { + if (!isPointer()) std::terminate(); + return static_cast(m_StoragePtr); + } + + template + typename std::enable_if::value, Q&>::type GetReference() noexcept { + if (!isReference()) std::terminate(); + return *m_StoragePtr; + } + + template + typename std::enable_if::value, Q&>::type GetReference() noexcept { + if (!isPointer()) std::terminate(); + return m_StoragePtr; + } + + bool isPointer() const { + return m_Type == LIFECYCLE::POINTER_OWNED || m_Type == LIFECYCLE::POINTER_NOT_OWNED; + } + + bool isOwned() const { + return m_Type == LIFECYCLE::REFERENCE_OWNED || m_Type == LIFECYCLE::POINTER_OWNED; + } + + bool isReference() const { + return m_Type == LIFECYCLE::REFERENCE_OWNED; + } + + bool isValid() const { + return m_Type != LIFECYCLE::NONE; + } + + U* m_StoragePtr = nullptr; + LIFECYCLE m_Type; + ReferenceCount *m_Count = nullptr; +}; + +} // ns DlSystem +} // ns zdl + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif // _DL_SYSTEM_OPTIONAL_HPP_ diff --git a/third_party/snpe/include/DlSystem/DlVersion.hpp b/third_party/snpe/include/DlSystem/DlVersion.hpp new file mode 100644 index 000000000..beb8d75f2 --- /dev/null +++ b/third_party/snpe/include/DlSystem/DlVersion.hpp @@ -0,0 +1,78 @@ +//============================================================================== +// +// Copyright (c) 2014-2015 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + + +#ifndef _DL_VERSION_HPP_ +#define _DL_VERSION_HPP_ + +#include "ZdlExportDefine.hpp" +#include +#include +#include "DlSystem/String.hpp" + + +namespace zdl { +namespace DlSystem +{ + class Version_t; +}} + + +namespace zdl { namespace DlSystem +{ +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * A class that contains the different portions of a version number. + */ +class ZDL_EXPORT Version_t +{ +public: + /// Holds the major version number. Changes in this value indicate + /// major changes that break backward compatibility. + int32_t Major; + + /// Holds the minor version number. Changes in this value indicate + /// minor changes made to library that are backwards compatible + /// (such as additions to the interface). + int32_t Minor; + + /// Holds the teeny version number. Changes in this value indicate + /// changes such as bug fixes and patches made to the library that + /// do not affect the interface. + int32_t Teeny; + + /// This string holds information about the build version. + /// + std::string Build; + + static zdl::DlSystem::Version_t fromString(const std::string &stringValue); + + static zdl::DlSystem::Version_t fromString(const zdl::DlSystem::String &stringValue); + + /** + * @brief Returns a string in the form Major.Minor.Teeny.Build + * + * @return A formatted string holding the version information. + */ + const std::string toString() const; + + /** + * @brief Returns a string in the form Major.Minor.Teeny.Build + * + * @return A formatted string holding the version information. + */ + const zdl::DlSystem::String asString() const; +}; + +}} + +/** @} */ /* end_addtogroup c_plus_plus_apis */ + +#endif diff --git a/third_party/snpe/include/DlSystem/IBufferAttributes.hpp b/third_party/snpe/include/DlSystem/IBufferAttributes.hpp new file mode 100644 index 000000000..f893e0a23 --- /dev/null +++ b/third_party/snpe/include/DlSystem/IBufferAttributes.hpp @@ -0,0 +1,86 @@ +//============================================================================== +// +// Copyright (c) 2017-2019 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef _IBUFFER_ATTRIBUTES_HPP +#define _IBUFFER_ATTRIBUTES_HPP +#include "IUserBuffer.hpp" +#include "TensorShape.hpp" +#include "ZdlExportDefine.hpp" + +namespace zdl { + namespace DlSystem { + class UserBufferEncoding; + } +} + +namespace zdl { +namespace DlSystem { + +/** + * @brief IBufferAttributes returns a buffer's dimension and alignment + * requirements, along with info on its encoding type + */ +class ZDL_EXPORT IBufferAttributes { +public: + + /** + * @brief Gets the buffer's element size, in bytes + * + * This can be used to compute the memory size required + * to back this buffer. + * + * @return Element size, in bytes + */ + virtual size_t getElementSize() const noexcept = 0; + + /** + * @brief Gets the element's encoding type + * + * @return encoding type + */ + virtual zdl::DlSystem::UserBufferEncoding::ElementType_t getEncodingType() const noexcept = 0; + + /** + * @brief Gets the number of elements in each dimension + * + * @return Dimension size, in terms of number of elements + */ + virtual const TensorShape getDims() const noexcept = 0; + + /** + * @brief Gets the alignment requirement of each dimension + * + * Alignment per each dimension is expressed as an multiple, for + * example, if one particular dimension can accept multiples of 8, + * the alignment will be 8. + * + * @return Alignment in each dimension, in terms of multiple of + * number of elements + */ + virtual const TensorShape getAlignments() const noexcept = 0; + + /** + * @brief Gets the buffer encoding returned from the network responsible + * for generating this buffer. Depending on the encoding type, this will + * be an instance of an encoding type specific derived class. + * + * @return Derived user buffer encoding object. + */ + virtual zdl::DlSystem::UserBufferEncoding* getEncoding() const noexcept = 0; + + virtual ~IBufferAttributes() {} +}; + + + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +} +} + +#endif diff --git a/third_party/snpe/include/DlSystem/ITensor.hpp b/third_party/snpe/include/DlSystem/ITensor.hpp new file mode 100644 index 000000000..2f006c857 --- /dev/null +++ b/third_party/snpe/include/DlSystem/ITensor.hpp @@ -0,0 +1,146 @@ +//============================================================================= +// +// Copyright (c) 2015-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= + +#ifndef _ITENSOR_HPP_ +#define _ITENSOR_HPP_ + +#include "ITensorItr.hpp" +#include "ITensorItrImpl.hpp" +#include "TensorShape.hpp" +#include "ZdlExportDefine.hpp" +#include +#include +#include + +namespace zdl { +namespace DlSystem +{ + class ITensor; +}} + +namespace zdl { namespace DlSystem +{ +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * Represents a tensor which holds n-dimensional data. It is important to + * understand how the tensor data is represented in memory + * relative to the tensor dimensions. Tensors store data in + * memory in row-major order (i.e. the last tensor dimension is + * the fastest varying one). For example, if you have a two + * dimensional tensor with 3 rows and 2 columns (i.e. the tensor + * dimensions are 3,2 as returned in tensor dimension vectors) + * with the following data in terms rows and columns: + * + * | 1 2 |
    + * | 3 4 |
    + * | 5 6 |
    + * + * This data would be stored in memory as 1,2,3,4,5,6. + */ +class ZDL_EXPORT ITensor +{ +public: + + typedef zdl::DlSystem::ITensorItr iterator; + typedef zdl::DlSystem::ITensorItr const_iterator; + + virtual ~ITensor() {} + + /** + * Returns a tensor iterator pointing to the beginning + * of the data in the tensor. + * + * @return A tensor iterator that points to the first data + * element in the tensor. + */ + virtual iterator begin() = 0; + + /** + * Returns the const version of a tensor iterator + * pointing to the beginning of the data in the tensor. + * + * @return A tensor const iterator that points to the first data + * element in the tensor. + */ + virtual const_iterator cbegin() const = 0; + + /** + * Returns a tensor iterator pointing to the end of the + * data in the tensor. This tensor should not be + * dereferenced. + * + * @return A tensor iterator that points to the end of the data + * (one past the last element) in the tensor. + */ + virtual iterator end() = 0; + + /** + * Returns the const version of a tensor iterator + * pointing to the end of the data in the tensor. This + * tensor should not be dereferenced. + * + * @return A tensor const iterator that points to the end of the + * data (one past the last element) in the tensor. + */ + virtual const_iterator cend() const = 0; + + /** + * @brief Gets the shape of this tensor. + * + * The last element of the vector represents the fastest varying + * dimension and the zeroth element represents the slowest + * varying dimension, etc. + * + * @return A shape class holding the tensor dimensions. + */ + virtual TensorShape getShape() const = 0; + + /** + * Returns the element size of the data in the tensor + * (discounting strides). This is how big a buffer would + * need to be to hold the tensor data contiguously in + * memory. + * + * @return The size of the tensor (in elements). + */ + virtual size_t getSize() const = 0; + + /** + * @brief Serializes the tensor to an output stream. + * + * @param[in] output The output stream to which to write the tensor + * + * @throw std::runtime_error If the stream is ever in a bad + * state before the tensor is fully serialized. + */ + virtual void serialize(std::ostream &output) const = 0; + + friend iterator; + friend const_iterator; + + virtual bool isQuantized() {return false;} + virtual float GetDelta() {return NAN;}; + virtual float GetOffset() {return NAN;}; + +protected: + + /** + * Returns the tensor iterator implementation. + * + * @return A pointer to the tensor iterator implementation. + */ + virtual std::unique_ptr<::DlSystem::ITensorItrImpl> getItrImpl() const = 0; +}; + +}} + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif diff --git a/third_party/snpe/include/DlSystem/ITensorFactory.hpp b/third_party/snpe/include/DlSystem/ITensorFactory.hpp new file mode 100644 index 000000000..57d2c8ea9 --- /dev/null +++ b/third_party/snpe/include/DlSystem/ITensorFactory.hpp @@ -0,0 +1,92 @@ +//============================================================================= +// +// Copyright (c) 2015-2016 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= + +#ifndef _ITENSOR_FACTORY_HPP +#define _ITENSOR_FACTORY_HPP + +#include "ITensor.hpp" +#include "TensorShape.hpp" +#include "ZdlExportDefine.hpp" +#include + +namespace zdl { + namespace DlSystem + { + class ITensor; + class TensorShape; + } +} + +namespace zdl { namespace DlSystem +{ + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * Factory interface class to create ITensor objects. + */ +class ZDL_EXPORT ITensorFactory +{ +public: + virtual ~ITensorFactory() = default; + + /** + * Creates a new ITensor with uninitialized data. + * + * The strides for the tensor will match the tensor dimensions + * (i.e., the tensor data is contiguous in memory). + * + * @param[in] shape The dimensions for the tensor in which the last + * element of the vector represents the fastest varying + * dimension and the zeroth element represents the slowest + * varying, etc. + * + * @return A pointer to the created tensor or nullptr if creating failed. + */ + virtual std::unique_ptr + createTensor(const TensorShape &shape) noexcept = 0; + + /** + * Creates a new ITensor by loading it from a file. + * + * @param[in] input The input stream from which to read the tensor + * data. + * + * @return A pointer to the created tensor or nullptr if creating failed. + * + */ + virtual std::unique_ptr createTensor(std::istream &input) noexcept = 0; + + /** + * Create a new ITensor with specific data. + * (i.e. the tensor data is contiguous in memory). This tensor is + * primarily used to create a tensor where tensor size can't be + * computed directly from dimension. One such example is + * NV21-formatted image, or any YUV formatted image + * + * @param[in] shape The dimensions for the tensor in which the last + * element of the vector represents the fastest varying + * dimension and the zeroth element represents the slowest + * varying, etc. + * + * @param[in] data The actual data with which the Tensor object is filled. + * + * @param[in] dataSize The size of data + * + * @return A pointer to the created tensor + */ + virtual std::unique_ptr + createTensor(const TensorShape &shape, const unsigned char *data, size_t dataSize) noexcept = 0; +}; + +}} + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif diff --git a/third_party/snpe/include/DlSystem/ITensorItr.hpp b/third_party/snpe/include/DlSystem/ITensorItr.hpp new file mode 100644 index 000000000..4ce12a9f1 --- /dev/null +++ b/third_party/snpe/include/DlSystem/ITensorItr.hpp @@ -0,0 +1,182 @@ +//============================================================================= +// +// Copyright (c) 2015 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= + +#ifndef _ITENSOR_ITR_HPP_ +#define _ITENSOR_ITR_HPP_ + +#include "ZdlExportDefine.hpp" +#include "ITensorItrImpl.hpp" + +#include +#include +#include + +namespace zdl { +namespace DlSystem +{ + template class ITensorItr; + class ITensor; + void ZDL_EXPORT fill(ITensorItr first, ITensorItr end, float val); + template OutItr ZDL_EXPORT copy(InItr first, InItr last, OutItr result) + { + return std::copy(first, last, result); + } +}} +namespace DlSystem +{ + class ITensorItrImpl; +} + +namespace zdl { namespace DlSystem +{ + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * A bidirectional iterator (with limited random access + * capabilities) for the zdl::DlSystem::ITensor class. + * + * This is a standard bidrectional iterator and is compatible + * with standard algorithm functions that operate on bidirectional + * access iterators (e.g., std::copy, std::fill, etc.). It uses a + * template parameter to create const and non-const iterators + * from the same code. Iterators are easiest to declare via the + * typedefs iterator and const_iterator in the ITensor class + * (e.g., zdl::DlSystem::ITensor::iterator). + * + * Note that if the tensor the iterator is traversing was + * created with nondefault (i.e., nontrivial) strides, the + * iterator will obey the strides when traversing the tensor + * data. + * + * Also note that nontrivial strides dramatically affect the + * performance of the iterator (on the order of 20x slower). + */ +template +class ZDL_EXPORT ITensorItr : public std::iterator +{ +public: + + typedef typename std::conditional::type VALUE_REF; + + ITensorItr() = delete; + virtual ~ITensorItr() {} + + ITensorItr(std::unique_ptr<::DlSystem::ITensorItrImpl> impl, + bool isTrivial = false, + float* data = nullptr) + : m_Impl(impl->clone()) + , m_IsTrivial(isTrivial) + , m_Data(data) + , m_DataStart(data) {} + + ITensorItr(const ITensorItr& itr) + : m_Impl(itr.m_Impl->clone()), + m_IsTrivial(itr.m_IsTrivial), + m_Data(itr.m_Data), + m_DataStart(itr.m_DataStart) {} + + zdl::DlSystem::ITensorItr& operator=(const ITensorItr& other) + { + if (this == &other) return *this; + m_Impl = std::move(other.m_Impl->clone()); + m_IsTrivial = other.m_IsTrivial; + m_Data = other.m_Data; + m_DataStart = other.m_DataStart; + return *this; + } + + inline zdl::DlSystem::ITensorItr& operator++() + { + if (m_IsTrivial) m_Data++; else m_Impl->increment(); + return *this; + } + inline zdl::DlSystem::ITensorItr operator++(int) + { + ITensorItr tmp(*this); + operator++(); + return tmp; + } + inline zdl::DlSystem::ITensorItr& operator--() + { + if (m_IsTrivial) m_Data--; else m_Impl->decrement(); + return *this; + } + inline zdl::DlSystem::ITensorItr operator--(int) + { + ITensorItr tmp(*this); + operator--(); + return tmp; + } + inline zdl::DlSystem::ITensorItr& operator+=(int rhs) + { + if (m_IsTrivial) m_Data += rhs; else m_Impl->increment(rhs); + return *this; + } + inline friend zdl::DlSystem::ITensorItr operator+(zdl::DlSystem::ITensorItr lhs, int rhs) + { lhs += rhs; return lhs; } + inline zdl::DlSystem::ITensorItr& operator-=(int rhs) + { + if (m_IsTrivial) m_Data -= rhs; else m_Impl->decrement(rhs); + return *this; + } + inline friend zdl::DlSystem::ITensorItr operator-(zdl::DlSystem::ITensorItr lhs, int rhs) + { lhs -= rhs; return lhs; } + + inline size_t operator-(const zdl::DlSystem::ITensorItr& rhs) + { + if (m_IsTrivial) return (m_Data - m_DataStart) - (rhs.m_Data - rhs.m_DataStart); + return m_Impl->getPosition() - rhs.m_Impl->getPosition(); + } + + inline friend bool operator<(const ITensorItr& lhs, const ITensorItr& rhs) + { + if (lhs.m_IsTrivial) return lhs.m_Data < rhs.m_Data; + return lhs.m_Impl->dataPointer() < rhs.m_Impl->dataPointer(); + } + inline friend bool operator>(const ITensorItr& lhs, const ITensorItr& rhs) + { return rhs < lhs; } + inline friend bool operator<=(const ITensorItr& lhs, const ITensorItr& rhs) + { return !(lhs > rhs); } + inline friend bool operator>=(const ITensorItr& lhs, const ITensorItr& rhs) + { return !(lhs < rhs); } + + inline bool operator==(const ITensorItr& rhs) const + { + if (m_IsTrivial) return m_Data == rhs.m_Data; + return m_Impl->dataPointer() == rhs.m_Impl->dataPointer(); + } + inline bool operator!=(const ITensorItr& rhs) const + { return !operator==(rhs); } + + inline VALUE_REF operator[](size_t idx) + { + if (m_IsTrivial) return *(m_DataStart + idx); + return m_Impl->getReferenceAt(idx); + } + inline VALUE_REF operator*() + { if (m_IsTrivial) return *m_Data; else return m_Impl->getReference(); } + inline VALUE_REF operator->() + { return *(*this); } + inline float* dataPointer() const + { if (m_IsTrivial) return m_Data; else return m_Impl->dataPointer(); } + + +protected: + std::unique_ptr<::DlSystem::ITensorItrImpl> m_Impl; + bool m_IsTrivial = false; + float* m_Data = nullptr; + float* m_DataStart = nullptr; +}; + +}} + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif diff --git a/third_party/snpe/include/DlSystem/ITensorItrImpl.hpp b/third_party/snpe/include/DlSystem/ITensorItrImpl.hpp new file mode 100644 index 000000000..069e7a1d6 --- /dev/null +++ b/third_party/snpe/include/DlSystem/ITensorItrImpl.hpp @@ -0,0 +1,42 @@ +//============================================================================= +// +// Copyright (c) 2015-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= + +#ifndef _ITENSOR_ITR_IMPL_HPP_ +#define _ITENSOR_ITR_IMPL_HPP_ + +#include "ZdlExportDefine.hpp" + +#include +#include + +namespace DlSystem +{ + class ITensorItrImpl; +} + +class ZDL_EXPORT DlSystem::ITensorItrImpl +{ +public: + ITensorItrImpl() {} + virtual ~ITensorItrImpl() {} + + virtual float getValue() const = 0; + virtual float& getReference() = 0; + virtual float& getReferenceAt(size_t idx) = 0; + virtual float* dataPointer() const = 0; + virtual void increment(int incVal = 1) = 0; + virtual void decrement(int decVal = 1) = 0; + virtual size_t getPosition() = 0; + virtual std::unique_ptr clone() = 0; + +private: + ITensorItrImpl& operator=(const ITensorItrImpl& other) = delete; + ITensorItrImpl(const ITensorItrImpl& other) = delete; +}; + +#endif diff --git a/third_party/snpe/include/DlSystem/IUDL.hpp b/third_party/snpe/include/DlSystem/IUDL.hpp new file mode 100644 index 000000000..2e9dddc48 --- /dev/null +++ b/third_party/snpe/include/DlSystem/IUDL.hpp @@ -0,0 +1,98 @@ +//============================================================================= +// +// Copyright (c) 2016-2017 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= + +#ifndef _DL_SYSTEM_IUDL_HPP_ +#define _DL_SYSTEM_IUDL_HPP_ + +#include "ZdlExportDefine.hpp" + +namespace zdl { +namespace DlSystem { +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * Base class user concrete UDL implementation. + * + * All functions are marked as: + * + * - virtual + * - noexcept + * + * User should make sure no exceptions are propagated outside of + * their module. Errors can be communicated via return values. + */ +class ZDL_EXPORT IUDL { +public: + /** + * @brief . + * + * Destructor + */ + virtual ~IUDL() = default; + + /** + * @brief Sets up the user's environment. + * This is called by the SNPE framework to allow the user the + * opportunity to setup anything which is needed for running + * user defined layers. + * + * @param cookie User provided opaque data returned by the SNPE + * runtime + * + * @param insz How many elements in input size array + * @param indim Pointer to a buffer that holds input dimension + * array + * @param indimsz Input dimension size array of the buffer + * 'indim'. Corresponds to indim + * + * @param outsz How many elements in output size array + * @param outdim Pointer to a buffer that holds output + * dimension array + * @param outdimsz Output dimension size of the buffer 'oudim'. + * Corresponds to indim + * + * @return true on success, false otherwise + */ + virtual bool setup(void *cookie, + size_t insz, const size_t **indim, const size_t *indimsz, + size_t outsz, const size_t **outdim, const size_t *outdimsz) = 0; + + /** + * @brief Close the instance. Invoked by the SNPE + * framework to allow the user the opportunity to release any resources + * allocated during setup. + * + * @param cookie - User provided opaque data returned by the SNPE runtime + */ + virtual void close(void *cookie) noexcept = 0; + + /** + * @brief Execute the user defined layer + * + * @param cookie User provided opaque data returned by the SNPE + * runtime + * + * @param input Const pointer to a float buffer that contains + * the input + * + * @param output Float pointer to a buffer that would hold + * the user defined layer's output. This buffer + * is allocated and owned by SNPE runtime. + */ + virtual bool execute(void *cookie, const float **input, float **output) = 0; +}; +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +} // ns DlSystem + +} // ns zdl + +#endif // _DL_SYSTEM_IUDL_HPP_ diff --git a/third_party/snpe/include/DlSystem/IUserBuffer.hpp b/third_party/snpe/include/DlSystem/IUserBuffer.hpp new file mode 100644 index 000000000..5e5731dd8 --- /dev/null +++ b/third_party/snpe/include/DlSystem/IUserBuffer.hpp @@ -0,0 +1,421 @@ +//============================================================================== +// +// Copyright (c) 2017-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef _IUSER_BUFFER_HPP +#define _IUSER_BUFFER_HPP + +#include "TensorShape.hpp" +#include "ZdlExportDefine.hpp" +#include + +namespace zdl { +namespace DlSystem { + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + + +/** + * @brief . + * + * A base class buffer encoding type + */ +class ZDL_EXPORT UserBufferEncoding { +public: + + /** + * @brief . + * + * An enum class of all supported element types in a IUserBuffer + */ + enum class ElementType_t + { + /// Unknown element type. + UNKNOWN = 0, + + /// Each element is presented by float. + FLOAT = 1, + + /// Each element is presented by an unsigned int. + UNSIGNED8BIT = 2, + + /// Each element is presented by an 8-bit quantized value. + TF8 = 10, + + /// Each element is presented by an 16-bit quantized value. + TF16 = 11 + }; + + /** + * @brief Retrieves the size of the element, in bytes. + * + * @return Size of the element, in bytes. + */ + virtual size_t getElementSize() const noexcept = 0; + + /** + * @brief Retrieves the element type + * + * @return Element type + */ + ElementType_t getElementType() const noexcept {return m_ElementType;}; + + virtual ~UserBufferEncoding() {} + +protected: + UserBufferEncoding(ElementType_t elementType) : m_ElementType(elementType) {}; +private: + const ElementType_t m_ElementType; +}; + +/** + * @brief . + * + * A base class buffer source type + * + * @note User buffer from CPU support all kinds of runtimes; + * User buffer from GLBUFFER support only GPU runtime. + */ +class ZDL_EXPORT UserBufferSource { +public: + enum class SourceType_t + { + /// Unknown buffer source type. + UNKNOWN = 0, + + /// The network inputs are from CPU buffer. + CPU = 1, + + /// The network inputs are from OpenGL buffer. + GLBUFFER = 2 + }; + + /** + * @brief Retrieves the source type + * + * @return Source type + */ + SourceType_t getSourceType() const noexcept {return m_SourceType;}; + +protected: + UserBufferSource(SourceType_t sourceType): m_SourceType(sourceType) {}; +private: + const SourceType_t m_SourceType; +}; + +/** + * @brief . + * + * An source type where input data is delivered from OpenGL buffer + */ +class ZDL_EXPORT UserBufferSourceGLBuffer : public UserBufferSource{ +public: + UserBufferSourceGLBuffer() : UserBufferSource(SourceType_t::GLBUFFER) {}; +}; + +/** + * @brief . + * + * An encoding type where each element is represented by an unsigned int + */ +class ZDL_EXPORT UserBufferEncodingUnsigned8Bit : public UserBufferEncoding { +public: + UserBufferEncodingUnsigned8Bit() : UserBufferEncoding(ElementType_t::UNSIGNED8BIT) {}; + size_t getElementSize() const noexcept override; + +protected: + UserBufferEncodingUnsigned8Bit(ElementType_t elementType) : UserBufferEncoding(elementType) {}; + +}; + +/** + * @brief . + * + * An encoding type where each element is represented by a float + */ +class ZDL_EXPORT UserBufferEncodingFloat : public UserBufferEncoding { +public: + UserBufferEncodingFloat() : UserBufferEncoding(ElementType_t::FLOAT) {}; + size_t getElementSize() const noexcept override; + +}; + +/** + * @brief . + * + * An encoding type where each element is represented by tf8, which is an + * 8-bit quantizd value, which has an exact representation of 0.0 + */ + +class ZDL_EXPORT UserBufferEncodingTf8 : public UserBufferEncodingUnsigned8Bit { +public: + UserBufferEncodingTf8() = delete; + UserBufferEncodingTf8(unsigned char stepFor0, float stepSize) : + UserBufferEncodingUnsigned8Bit(ElementType_t::TF8), + m_StepExactly0(stepFor0), + m_QuantizedStepSize(stepSize) {}; + + UserBufferEncodingTf8(const zdl::DlSystem::UserBufferEncoding &ubEncoding) : UserBufferEncodingUnsigned8Bit(ubEncoding.getElementType()){ + const zdl::DlSystem::UserBufferEncodingTf8* ubEncodingTf8 + = dynamic_cast (&ubEncoding); + if (ubEncodingTf8) { + m_StepExactly0 = ubEncodingTf8->getStepExactly0(); + m_QuantizedStepSize = ubEncodingTf8->getQuantizedStepSize(); + } + } + +/** + * @brief Sets the step value that represents 0 + * + * @param[in] stepExactly0 The step value that represents 0 + * + */ + + void setStepExactly0(const unsigned char stepExactly0) { + m_StepExactly0 = stepExactly0; + } + + +/** + * @brief Sets the float value that each step represents + * + * @param[in] quantizedStepSize The float value of each step size + * + */ + + void setQuantizedStepSize(const float quantizedStepSize) { + m_QuantizedStepSize = quantizedStepSize; + } + + +/** + * @brief Retrieves the step that represents 0.0 + * + * @return Step value + */ + + unsigned char getStepExactly0() const { + return m_StepExactly0; + } + + +/** + * Calculates the minimum floating point value that + * can be represented with this encoding. + * + * @return Minimum representable floating point value + */ + + float getMin() const { + return m_QuantizedStepSize * (0 - m_StepExactly0); + } + + +/** + * Calculates the maximum floating point value that + * can be represented with this encoding. + * + * @return Maximum representable floating point value + */ + + float getMax() const { + return m_QuantizedStepSize * (255 - m_StepExactly0); + } + + +/** + * @brief Retrieves the step size + * + * @return Step size + */ + + float getQuantizedStepSize() const { + return m_QuantizedStepSize; + } + +private: + unsigned char m_StepExactly0; + + float m_QuantizedStepSize; +}; + + + +class ZDL_EXPORT UserBufferEncodingTfN : public UserBufferEncoding { +public: + UserBufferEncodingTfN() = delete; + UserBufferEncodingTfN(uint64_t stepFor0, float stepSize, uint8_t bWidth=8): + UserBufferEncoding(getTypeFromWidth(bWidth)), + bitWidth(bWidth), + m_StepExactly0(stepFor0), + m_QuantizedStepSize(stepSize){}; + + UserBufferEncodingTfN(const zdl::DlSystem::UserBufferEncoding &ubEncoding) : UserBufferEncoding(ubEncoding.getElementType()){ + const zdl::DlSystem::UserBufferEncodingTfN* ubEncodingTfN + = dynamic_cast (&ubEncoding); + if (ubEncodingTfN) { + m_StepExactly0 = ubEncodingTfN->getStepExactly0(); + m_QuantizedStepSize = ubEncodingTfN->getQuantizedStepSize(); + bitWidth = ubEncodingTfN->bitWidth; + } + } + + size_t getElementSize() const noexcept override; + /** + * @brief Sets the step value that represents 0 + * + * @param[in] stepExactly0 The step value that represents 0 + * + */ + void setStepExactly0(uint64_t stepExactly0) { + m_StepExactly0 = stepExactly0; + } + + /** + * @brief Sets the float value that each step represents + * + * @param[in] quantizedStepSize The float value of each step size + * + */ + void setQuantizedStepSize(const float quantizedStepSize) { + m_QuantizedStepSize = quantizedStepSize; + } + + /** + * @brief Retrieves the step that represents 0.0 + * + * @return Step value + */ + uint64_t getStepExactly0() const { + return m_StepExactly0; + } + + /** + * Calculates the minimum floating point value that + * can be represented with this encoding. + * + * @return Minimum representable floating point value + */ + float getMin() const { + return static_cast(m_QuantizedStepSize * (0 - (double)m_StepExactly0)); + } + + /** + * Calculates the maximum floating point value that + * can be represented with this encoding. + * + * @return Maximum representable floating point value + */ + float getMax() const{ + return static_cast(m_QuantizedStepSize * (pow(2,bitWidth)-1 - (double)m_StepExactly0)); + }; + + /** + * @brief Retrieves the step size + * + * @return Step size + */ + float getQuantizedStepSize() const { + return m_QuantizedStepSize; + } + + ElementType_t getTypeFromWidth(uint8_t width); + + uint8_t bitWidth; +private: + uint64_t m_StepExactly0; + float m_QuantizedStepSize; +}; + + +/** + * @brief UserBuffer contains a pointer and info on how to walk it and interpret its content. + */ +class ZDL_EXPORT IUserBuffer { +public: + virtual ~IUserBuffer() = default; + + /** + * @brief Retrieves the total number of bytes between elements in each dimension if + * the buffer were to be interpreted as a multi-dimensional array. + * + * @return Number of bytes between elements in each dimension. + * e.g. A tightly packed tensor of floats with dimensions [4, 3, 2] would + * return strides of [24, 8, 4]. + */ + virtual const TensorShape& getStrides() const = 0; + + /** + * @brief Retrieves the size of the buffer, in bytes. + * + * @return Size of the underlying buffer, in bytes. + */ + virtual size_t getSize() const = 0; + + /** + * @brief Retrieves the size of the inference data in the buffer, in bytes. + * + * The inference results from a dynamic-sized model may not be exactly the same size + * as the UserBuffer provided to SNPE. This function can be used to get the amount + * of output inference data, which may be less or greater than the size of the UserBuffer. + * + * If the inference results fit in the UserBuffer, getOutputSize() would be less than + * or equal to getSize(). But if the inference results were more than the capacity of + * the provided UserBuffer, the results would be truncated to fit the UserBuffer. But, + * getOutputSize() would be greater than getSize(), which indicates a bigger buffer + * needs to be provided to SNPE to hold all of the inference results. + * + * @return Size required for the buffer to hold all inference results, which can be less + * or more than the size of the buffer, in bytes. + */ + virtual size_t getOutputSize() const = 0; + + /** + * @brief Changes the underlying memory that backs the UserBuffer. + * + * This can be used to avoid creating multiple UserBuffer objects + * when the only thing that differs is the memory location. + * + * @param[in] buffer Pointer to the memory location + * + * @return Whether the set succeeds. + */ + virtual bool setBufferAddress(void *buffer) noexcept = 0; + + /** + * @brief Gets a const reference to the data encoding object of + * the underlying buffer + * + * This is necessary when the UserBuffer is filled by SNPE with + * data types such as TF8, where the caller needs to know the quantization + * parameters in order to interpret the data properly + * + * @return A read-only encoding object + */ + virtual const UserBufferEncoding& getEncoding() const noexcept = 0; + + /** + * @brief Gets a reference to the data encoding object of + * the underlying buffer + * + * This is necessary when the UserBuffer is re-used, and the encoding + * parameters can change. For example, each input can be quantized with + * different step sizes. + * + * @return Data encoding meta-data + */ + virtual UserBufferEncoding& getEncoding() noexcept = 0; + +}; + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +} +} + +#endif diff --git a/third_party/snpe/include/DlSystem/IUserBufferFactory.hpp b/third_party/snpe/include/DlSystem/IUserBufferFactory.hpp new file mode 100644 index 000000000..59803fbd8 --- /dev/null +++ b/third_party/snpe/include/DlSystem/IUserBufferFactory.hpp @@ -0,0 +1,81 @@ +//============================================================================= +// +// Copyright (c) 2017 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= + +#ifndef _IUSERBUFFER_FACTORY_HPP +#define _IUSERBUFFER_FACTORY_HPP + +#include "IUserBuffer.hpp" +#include "TensorShape.hpp" +#include "ZdlExportDefine.hpp" +#include "DlEnums.hpp" +namespace zdl { + namespace DlSystem { + class IUserBuffer; + + class TensorShape; + } +} + +namespace zdl { +namespace DlSystem { + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** +* Factory interface class to create IUserBuffer objects. +*/ +class ZDL_EXPORT IUserBufferFactory { +public: + virtual ~IUserBufferFactory() = default; + + /** + * @brief Creates a UserBuffer + * + * @param[in] buffer Pointer to the buffer that the caller supplies + * + * @param[in] bufSize Buffer size, in bytes + * + * @param[in] strides Total number of bytes between elements in each dimension. + * E.g. A tightly packed tensor of floats with dimensions [4, 3, 2] would have strides of [24, 8, 4]. + * + * @param[in] userBufferEncoding Reference to an UserBufferEncoding object + * + * @note Caller has to ensure that memory pointed to by buffer stays accessible + * for the lifetime of the object created + */ + virtual std::unique_ptr + createUserBuffer(void *buffer, size_t bufSize, const zdl::DlSystem::TensorShape &strides, zdl::DlSystem::UserBufferEncoding* userBufferEncoding) noexcept = 0; + + /** + * @brief Creates a UserBuffer + * + * @param[in] buffer Pointer to the buffer that the caller supplies + * + * @param[in] bufSize Buffer size, in bytes + * + * @param[in] strides Total number of bytes between elements in each dimension. + * E.g. A tightly packed tensor of floats with dimensions [4, 3, 2] would have strides of [24, 8, 4]. + * + * @param[in] userBufferEncoding Reference to an UserBufferEncoding object + * + * @param[in] userBufferSource Reference to an UserBufferSource object + * + * @note Caller has to ensure that memory pointed to by buffer stays accessible + * for the lifetime of the object created + */ + virtual std::unique_ptr + createUserBuffer(void *buffer, size_t bufSize, const zdl::DlSystem::TensorShape &strides, zdl::DlSystem::UserBufferEncoding* userBufferEncoding, zdl::DlSystem::UserBufferSource* userBufferSource) noexcept = 0; +}; +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +} +} + + +#endif diff --git a/third_party/snpe/include/DlSystem/PlatformConfig.hpp b/third_party/snpe/include/DlSystem/PlatformConfig.hpp new file mode 100644 index 000000000..3f15f177e --- /dev/null +++ b/third_party/snpe/include/DlSystem/PlatformConfig.hpp @@ -0,0 +1,203 @@ +//============================================================================= +// +// Copyright (c) 2017-2018 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= + +#ifndef _DL_SYSTEM_PLATFORM_CONFIG_HPP_ +#define _DL_SYSTEM_PLATFORM_CONFIG_HPP_ + +#include "DlSystem/ZdlExportDefine.hpp" +#include + +namespace zdl{ +namespace DlSystem +{ + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + + +/** + * @brief . + * + * A structure OpenGL configuration + * + * @note When certain OpenGL context and display are provided to UserGLConfig for using + * GPU buffer as input directly, the user MUST ensure the particular OpenGL + * context and display remain vaild throughout the execution of neural network models. + */ +struct ZDL_EXPORT UserGLConfig +{ + /// Holds user EGL context. + /// + void* userGLContext = nullptr; + + /// Holds user EGL display. + void* userGLDisplay = nullptr; +}; + +/** + * @brief . + * + * A structure Gpu configuration + */ +struct ZDL_EXPORT UserGpuConfig{ + /// Holds user OpenGL configuration. + /// + UserGLConfig userGLConfig; +}; + +/** + * @brief . + * + * A class user platform configuration + */ +class ZDL_EXPORT PlatformConfig +{ +public: + + /** + * @brief . + * + * An enum class of all supported platform types + */ + enum class PlatformType_t + { + /// Unknown platform type. + UNKNOWN = 0, + + /// Snapdragon CPU. + CPU = 1, + + /// Adreno GPU. + GPU = 2, + + /// Hexagon DSP. + DSP = 3 + }; + + /** + * @brief . + * + * A union class user platform configuration information + */ + union PlatformConfigInfo + { + /// Holds user GPU Configuration. + /// + UserGpuConfig userGpuConfig; + + PlatformConfigInfo(){}; + }; + + PlatformConfig() : m_PlatformType(PlatformType_t::UNKNOWN), + m_PlatformOptions("") {}; + + /** + * @brief Retrieves the platform type + * + * @return Platform type + */ + PlatformType_t getPlatformType() const {return m_PlatformType;}; + + /** + * @brief Indicates whther the plaform configuration is valid. + * + * @return True if the platform configuration is valid; false otherwise. + */ + bool isValid() const {return (PlatformType_t::UNKNOWN != m_PlatformType);}; + + /** + * @brief Retrieves the Gpu configuration + * + * @param[out] userGpuConfig The passed in userGpuConfig populated with the Gpu configuration on return. + * + * @return True if Gpu configuration was retrieved; false otherwise. + */ + bool getUserGpuConfig(UserGpuConfig& userGpuConfig) const + { + if(m_PlatformType == PlatformType_t::GPU) + { + userGpuConfig = m_PlatformConfigInfo.userGpuConfig; + return true; + } + else + { + return false; + } + } + + /** + * @brief Sets the Gpu configuration + * + * @param[in] userGpuConfig Gpu Configuration + * + * @return True if Gpu configuration was successfully set; false otherwise. + */ + bool setUserGpuConfig(UserGpuConfig& userGpuConfig) + { + if((userGpuConfig.userGLConfig.userGLContext != nullptr) && (userGpuConfig.userGLConfig.userGLDisplay != nullptr)) + { + switch (m_PlatformType) + { + case PlatformType_t::GPU: + m_PlatformConfigInfo.userGpuConfig = userGpuConfig; + return true; + case PlatformType_t::UNKNOWN: + m_PlatformType = PlatformType_t::GPU; + m_PlatformConfigInfo.userGpuConfig = userGpuConfig; + return true; + default: + return false; + } + } + else + return false; + } + + /** + * @brief Sets the platform options + * + * @param[in] options Options as a string in the form of "keyword:options" + * + * @return True if options are pass validation; otherwise false. If false, the options are not updated. + */ + bool setPlatformOptions(std::string options) { + std::string oldOptions = m_PlatformOptions; + m_PlatformOptions = options; + if (isOptionsValid()) { + return true; + } else { + m_PlatformOptions = oldOptions; + return false; + } + } + + /** + * @brief Indicates whther the plaform configuration is valid. + * + * @return True if the platform configuration is valid; false otherwise. + */ + bool isOptionsValid() const; + + /** + * @brief Gets the platform options + * + * @return Options as a string + */ + std::string getPlatformOptions() const { return m_PlatformOptions; } + +private: + PlatformType_t m_PlatformType; + PlatformConfigInfo m_PlatformConfigInfo; + std::string m_PlatformOptions; +}; + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +}} //namespace end + +#endif diff --git a/third_party/snpe/include/DlSystem/RuntimeList.hpp b/third_party/snpe/include/DlSystem/RuntimeList.hpp new file mode 100644 index 000000000..1088a5b31 --- /dev/null +++ b/third_party/snpe/include/DlSystem/RuntimeList.hpp @@ -0,0 +1,154 @@ +//============================================================================= +// +// Copyright (c) 2019 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= + +#include "ZdlExportDefine.hpp" +#include "DlSystem/DlEnums.hpp" +#include "DlSystem/StringList.hpp" +#include +#include + +#ifndef DL_SYSTEM_RUNTIME_LIST_HPP +#define DL_SYSTEM_RUNTIME_LIST_HPP + +namespace DlSystem +{ + // Forward declaration of Runtime List implementation. + class RuntimeListImpl; +} + +namespace zdl +{ +namespace DlSystem +{ + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * A class representing list of runtimes + */ +class ZDL_EXPORT RuntimeList final +{ +public: + + /** + * @brief . + * + * Creates a new runtime list + * + */ + RuntimeList(); + + /** + * @brief . + * + * copy constructor. + * @param[in] other object to copy. + */ + RuntimeList(const RuntimeList& other); + + /** + * @brief . + * + * constructor with single Runtime_t object + * @param[in] Runtime_t object + */ + RuntimeList(const zdl::DlSystem::Runtime_t& runtime); + + /** + * @brief . + * + * assignment operator. + */ + RuntimeList& operator=(const RuntimeList& other); + + /** + * @brief . + * + * subscript operator. + */ + Runtime_t& operator[](size_t index); + + /** + * @brief Adds runtime to the end of the runtime list + * order of precedence is former followed by latter entry + * + * @param[in] runtime to add + * + * Ruturns false If the runtime already exists + */ + bool add(const zdl::DlSystem::Runtime_t& runtime); + + /** + * @brief Removes the runtime from the list + * + * @param[in] runtime to be removed + * + * @note If the runtime is not found, nothing is done. + */ + void remove(const zdl::DlSystem::Runtime_t runtime) noexcept; + + /** + * @brief Returns the number of runtimes in the list + */ + size_t size() const noexcept; + + /** + * @brief Returns true if the list is empty + */ + bool empty() const noexcept; + + /** + * @brief . + * + * Removes all runtime from the list + */ + void clear() noexcept; + + /** + * @brief . + * + * Returns a StringList of names from the runtime list in + * order of precedence + */ + zdl::DlSystem::StringList getRuntimeListNames() const; + + /** + * @brief . + * + * @param[in] runtime string + * Returns a Runtime enum corresponding to the in param string + * + */ + static zdl::DlSystem::Runtime_t stringToRuntime(const char* runtimeStr); + + /** + * @brief . + * + * @param[in] runtime + * Returns a string corresponding to the in param runtime enum + * + */ + static const char* runtimeToString(const zdl::DlSystem::Runtime_t runtime); + + ~RuntimeList(); + +private: + void deepCopy(const RuntimeList &other); + std::unique_ptr<::DlSystem::RuntimeListImpl> m_RuntimeListImpl; +}; + +} // DlSystem namespace +} // zdl namespace + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif // DL_SYSTEM_RUNTIME_LIST_HPP + diff --git a/third_party/snpe/include/DlSystem/String.hpp b/third_party/snpe/include/DlSystem/String.hpp new file mode 100644 index 000000000..c1eba3bad --- /dev/null +++ b/third_party/snpe/include/DlSystem/String.hpp @@ -0,0 +1,104 @@ +//============================================================================= +// +// Copyright (c) 2017, 2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= + +#ifndef PLATFORM_STANDARD_STRING_HPP +#define PLATFORM_STANDARD_STRING_HPP + +#include +#include +#include +#include "DlSystem/ZdlExportDefine.hpp" + +namespace zdl +{ +namespace DlSystem +{ +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * Class for wrapping char * as a really stripped down std::string replacement. + */ +class ZDL_EXPORT String final +{ +public: + String() = delete; + + /** + * Construct a string from std::string reference. + * @param str Reference to a std::string + */ + explicit String(const std::string& str); + + /** + * Construct a string from char* reference. + * @param a char* + */ + explicit String(const char* str); + + /** + * move constructor. + */ + String(String&& other) noexcept; + + /** + * copy constructor. + */ + String(const String& other) = delete; + + /** + * assignment operator. + */ + String& operator=(const String&) = delete; + + /** + * move assignment operator. + */ + String& operator=(String&&) = delete; + + /** + * class comparators + */ + bool operator<(const String& rhs) const noexcept; + bool operator>(const String& rhs) const noexcept; + bool operator<=(const String& rhs) const noexcept; + bool operator>=(const String& rhs) const noexcept; + bool operator==(const String& rhs) const noexcept; + bool operator!=(const String& rhs) const noexcept; + + /** + * class comparators against std::string + */ + bool operator<(const std::string& rhs) const noexcept; + bool operator>(const std::string& rhs) const noexcept; + bool operator<=(const std::string& rhs) const noexcept; + bool operator>=(const std::string& rhs) const noexcept; + bool operator==(const std::string& rhs) const noexcept; + bool operator!=(const std::string& rhs) const noexcept; + + const char* c_str() const noexcept; + + ~String(); +private: + + char* m_string; +}; + +/** + * overloaded << operator + */ +ZDL_EXPORT std::ostream& operator<<(std::ostream& os, const String& str) noexcept; + +} // DlSystem namespace +} // zdl namespace + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif // PLATFORM_STANDARD_STRING_HPP diff --git a/third_party/snpe/include/DlSystem/StringList.hpp b/third_party/snpe/include/DlSystem/StringList.hpp new file mode 100644 index 000000000..a9a7d5ed8 --- /dev/null +++ b/third_party/snpe/include/DlSystem/StringList.hpp @@ -0,0 +1,107 @@ +//============================================================================= +// +// Copyright (c) 2016 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= +#include +#include "ZdlExportDefine.hpp" + +#ifndef DL_SYSTEM_STRINGLIST_HPP +#define DL_SYSTEM_STRINGLIST_HPP + +namespace zdl +{ +namespace DlSystem +{ +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * Class for holding an order list of null-terminated ASCII strings. + */ +class ZDL_EXPORT StringList final +{ +public: + StringList() {} + + /** + * Construct a string list with some pre-allocated memory. + * @warning Contents of the list will be uninitialized + * @param[in] length Number of elements for which to pre-allocate space. + */ + explicit StringList(size_t length); + + /** + * Append a string to the list. + * @param[in] str Null-terminated ASCII string to append to the list. + */ + void append(const char* str); + + /** + * Returns the string at the indicated position, + * or an empty string if the positions is greater than the size + * of the list. + * @param[in] idx Position in the list of the desired string + */ + const char* at(size_t idx) const noexcept; + + /** + * Pointer to the first string in the list. + * Can be used to iterate through the list. + */ + const char** begin() const noexcept; + + /** + * Pointer to one after the last string in the list. + * Can be used to iterate through the list. + */ + const char** end() const noexcept; + + /** + * Return the number of valid string pointers held by this list. + */ + size_t size() const noexcept; + + + /** + * assignment operator. + */ + StringList& operator=(const StringList&) noexcept; + + /** + * copy constructor. + * @param[in] other object to copy. + */ + StringList(const StringList& other); + + /** + * move constructor. + * @param[in] other object to move. + */ + StringList(StringList&& other) noexcept; + + ~StringList(); +private: + void copy(const StringList& other); + + void resize(size_t length); + + void clear(); + + static const char* s_Empty; + const char** m_Strings = nullptr; + const char** m_End = nullptr; + size_t m_Size = 0; +}; + +} // DlSystem namespace +} // zdl namespace + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif // DL_SYSTEM_STRINGLIST_HPP + diff --git a/third_party/snpe/include/DlSystem/TensorMap.hpp b/third_party/snpe/include/DlSystem/TensorMap.hpp new file mode 100644 index 000000000..feecec666 --- /dev/null +++ b/third_party/snpe/include/DlSystem/TensorMap.hpp @@ -0,0 +1,120 @@ +//============================================================================= +// +// Copyright (c) 2016 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= +#include +#include "ZdlExportDefine.hpp" +#include "ITensor.hpp" +#include "StringList.hpp" + +#ifndef DL_SYSTEM_TENSOR_MAP_HPP +#define DL_SYSTEM_TENSOR_MAP_HPP + +namespace DlSystem +{ + // Forward declaration of tensor map implementation. + class TensorMapImpl; +} + +namespace zdl +{ +namespace DlSystem +{ + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * A class representing the map of tensor. + */ +class ZDL_EXPORT TensorMap final +{ +public: + + /** + * @brief . + * + * Creates a new empty tensor map + */ + TensorMap(); + + /** + * copy constructor. + * @param[in] other object to copy. + */ + TensorMap(const TensorMap& other); + + /** + * assignment operator. + */ + TensorMap& operator=(const TensorMap& other); + + /** + * @brief Adds a name and the corresponding tensor pointer + * to the map + * + * @param[in] name The name of the tensor + * @param[out] tensor The pointer to the tensor + * + * @note If a tensor with the same name already exists, the + * tensor is replaced with the existing tensor. + */ + void add(const char *name, zdl::DlSystem::ITensor *tensor); + + /** + * @brief Removes a mapping of tensor and its name by its name + * + * @param[in] name The name of tensor to be removed + * + * @note If no tensor with the specified name is found, nothing + * is done. + */ + void remove(const char *name) noexcept; + + /** + * @brief Returns the number of tensors in the map + */ + size_t size() const noexcept; + + /** + * @brief . + * + * Removes all tensors from the map + */ + void clear() noexcept; + + /** + * @brief Returns the tensor given its name. + * + * @param[in] name The name of the tensor to get. + * + * @return nullptr if no tensor with the specified name is + * found; otherwise, a valid pointer to the tensor. + */ + zdl::DlSystem::ITensor* getTensor(const char *name) const noexcept; + + /** + * @brief . + * + * Returns the names of all tensors + */ + zdl::DlSystem::StringList getTensorNames() const; + + ~TensorMap(); +private: + void swap(const TensorMap &other); + std::unique_ptr<::DlSystem::TensorMapImpl> m_TensorMapImpl; +}; + +} // DlSystem namespace +} // zdl namespace + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif // DL_SYSTEM_TENSOR_MAP_HPP + diff --git a/third_party/snpe/include/DlSystem/TensorShape.hpp b/third_party/snpe/include/DlSystem/TensorShape.hpp new file mode 100644 index 000000000..99583dccb --- /dev/null +++ b/third_party/snpe/include/DlSystem/TensorShape.hpp @@ -0,0 +1,203 @@ +//============================================================================= +// +// Copyright (c) 2016 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= +#include +#include +#include +#include +#include "ZdlExportDefine.hpp" + +#ifndef DL_SYSTEM_TENSOR_SHAPE_HPP +#define DL_SYSTEM_TENSOR_SHAPE_HPP + +namespace DlSystem +{ + // Forward declaration of tensor shape implementation. + class TensorShapeImpl; +} + +namespace zdl +{ +namespace DlSystem +{ + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * Convenient typedef to represent dimension + */ +using Dimension = size_t; + +/** + * @brief . + * + * A class representing the shape of tensor. It is used at the + * time of creation of tensor. + */ +class ZDL_EXPORT TensorShape final +{ +public: + + /** + * @brief . + * + * Creates a new shape with a list of dims specified in + * initializer list fashion. + * + * @param[in] dims The dimensions are specified in which the last + * element of the vector represents the fastest varying + * dimension and the zeroth element represents the slowest + * varying, etc. + * + */ + TensorShape(std::initializer_list dims); + + /** + * @brief . + * + * Creates a new shape with a list of dims specified in array + * + * @param[in] dims The dimensions are specified in which the last + * element of the vector represents the fastest varying + * dimension and the zeroth element represents the slowest + * varying, etc. + * + * @param[in] size Size of the array. + * + */ + TensorShape(const Dimension *dims, size_t size); + + /** + * @brief . + * + * Creates a new shape with a vector of dims specified in + * vector fashion. + * + * @param[in] dims The dimensions are specified in which the last + * element of the vector represents the fastest varying + * dimension and the zeroth element represents the slowest + * varying, etc. + * + */ + TensorShape(std::vector dims); + + /** + * @brief . + * + * copy constructor. + * @param[in] other object to copy. + */ + TensorShape(const TensorShape& other); + + /** + * @brief . + * + * assignment operator. + */ + TensorShape& operator=(const TensorShape& other); + + /** + * @brief . + * + * Creates a new shape with no dims. It can be extended later + * by invoking concatenate. + */ + TensorShape(); + + /** + * @brief . + * + * Concatenates additional dimensions specified in + * initializer list fashion to the existing dimensions. + * + * @param[in] dims The dimensions are specified in which the last + * element of the vector represents the fastest varying + * dimension and the zeroth element represents the slowest + * varying, etc. + * + */ + void concatenate(std::initializer_list dims); + + /** + * @brief . + * + * Concatenates additional dimensions specified in + * the array to the existing dimensions. + * + * @param[in] dims The dimensions are specified in which the last + * element of the vector represents the fastest varying + * dimension and the zeroth element represents the slowest + * varying, etc. + * + * @param[in] size Size of the array. + * + */ + void concatenate(const Dimension *dims, size_t size); + + /** + * @brief . + * + * Concatenates an additional dimension to the existing + * dimensions. + * + * @param[in] dim The dimensions are specified in which the last element + * of the vector represents the fastest varying dimension and the + * zeroth element represents the slowest varying, etc. + * + */ + void concatenate(const Dimension &dim); + + /** + * @brief . + * + * Retrieves a single dimension, based on its index. + * + * @return The value of dimension + * + * @throws std::out_of_range if the index is >= the number of + * dimensions (or rank). + */ + Dimension& operator[](size_t index); + Dimension& operator[](size_t index) const; + + /** + * @brief . + * + * Retrieves the rank i.e. number of dimensions. + * + * @return The rank + */ + size_t rank() const; + + /** + * @brief . + * + * Retrieves a pointer to the first dimension of shape + * + * @return nullptr if no dimension exists; otherwise, points to + * the first dimension. + * + */ + const Dimension* getDimensions() const; + + ~TensorShape(); + +private: + void swap(const TensorShape &other); + std::unique_ptr<::DlSystem::TensorShapeImpl> m_TensorShapeImpl; +}; + +} // DlSystem namespace +} // zdl namespace + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif // DL_SYSTEM_TENSOR_SHAPE_HPP + diff --git a/third_party/snpe/include/DlSystem/TensorShapeMap.hpp b/third_party/snpe/include/DlSystem/TensorShapeMap.hpp new file mode 100644 index 000000000..cef946e2e --- /dev/null +++ b/third_party/snpe/include/DlSystem/TensorShapeMap.hpp @@ -0,0 +1,127 @@ +//============================================================================= +// +// Copyright (c) 2017-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= +#include +#include +#include +#include "ZdlExportDefine.hpp" +#include "DlSystem/TensorShape.hpp" +#include "DlSystem/StringList.hpp" + +#ifndef DL_SYSTEM_TENSOR_SHAPE_MAP_HPP +#define DL_SYSTEM_TENSOR_SHAPE_MAP_HPP + +namespace DlSystem +{ + // Forward declaration of tensor shape map implementation. + class TensorShapeMapImpl; +} + +namespace zdl +{ +namespace DlSystem +{ + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * A class representing the map of names and tensorshapes. + */ +class ZDL_EXPORT TensorShapeMap final +{ +public: + + /** + * @brief . + * + * Creates a new tensor shape map + * + */ + TensorShapeMap(); + + /** + * @brief . + * + * copy constructor. + * @param[in] other object to copy. + */ + TensorShapeMap(const TensorShapeMap& other); + + /** + * @brief . + * + * assignment operator. + */ + TensorShapeMap& operator=(const TensorShapeMap& other); + + /** + * @brief Adds a name and the corresponding tensor pointer + * to the map + * + * @param[in] name The name of the tensor + * @param[out] tensor The pointer to the tensor + * + * @note If a tensor with the same name already exists, no new + * tensor is added. + */ + void add(const char *name, const zdl::DlSystem::TensorShape& tensorShape); + + /** + * @brief Removes a mapping of tensor and its name by its name + * + * @param[in] name The name of tensor to be removed + * + * @note If no tensor with the specified name is found, nothing + * is done. + */ + void remove(const char *name) noexcept; + + /** + * @brief Returns the number of tensors in the map + */ + size_t size() const noexcept; + + /** + * @brief . + * + * Removes all tensors from the map + */ + void clear() noexcept; + + /** + * @brief Returns the tensor given its name. + * + * @param[in] name The name of the tensor to get. + * + * @return nullptr if no tensor with the specified name is + * found; otherwise, a valid pointer to the tensor. + */ + zdl::DlSystem::TensorShape getTensorShape(const char *name) const noexcept; + + /** + * @brief . + * + * Returns the names of all tensor shapes + */ + zdl::DlSystem::StringList getTensorShapeNames() const; + + ~TensorShapeMap(); +private: + void swap(const TensorShapeMap &other); + std::unique_ptr<::DlSystem::TensorShapeMapImpl> m_TensorShapeMapImpl; +}; + +} // DlSystem namespace +} // zdl namespace + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif // DL_SYSTEM_TENSOR_SHAPE_MAP_HPP + diff --git a/third_party/snpe/include/DlSystem/UDLContext.hpp b/third_party/snpe/include/DlSystem/UDLContext.hpp new file mode 100644 index 000000000..6b7c07d3e --- /dev/null +++ b/third_party/snpe/include/DlSystem/UDLContext.hpp @@ -0,0 +1,244 @@ +//============================================================================== +// +// Copyright (c) 2016 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef UDL_CONTEXT_HPP +#define UDL_CONTEXT_HPP + +#include // memset +#include + +#include "ZdlExportDefine.hpp" + +namespace zdl { namespace DlSystem { +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * UDLContext holds the user defined layer context which + * consists of a layer name, layer ID, blob and blob size. + * + * An instance of UDLContext is passed as an argument to the + * UDLFactoryFunc provided by the user every time the SNPE + * runtime encounters an unknown layer descriptor. The instance + * of a UDLContext is created by the SNPE runtime and is + * consumed by the user's factory function. The user should + * obtain a copy of this class and should not assume any + * prolonged object lifetime beyond the UDLFactoryFunction. + */ +class ZDL_EXPORT UDLContext final { +public: + /** + * @brief Constructor + * + * @param[in] name name of the layer + * + * @param[in] type layer type + * + * @param[in] id identifier for the layer + * + * @param[in] id Blob/bytes as packed by the user code as part of + * the Python converter script + */ + UDLContext(const std::string& name, + const std::string& type, + int32_t id, + const std::string& blob) : + m_Name(name), m_Type(type), m_Size(blob.size()), m_Id(id) { + // FIXME not dealing with alloc error + m_Buffer = new uint8_t[m_Size]; + std::memcpy(m_Buffer, blob.data(), m_Size); + } + + /** + * @brief . + * + * Empty constructor is useful for + * creating an empty UDLContext and then run copy constructor + * from a fully initialized one. + */ + explicit UDLContext() {} + + /** + * @brief . + * + * destructor Deallocates any internal allocated memory + */ + ~UDLContext() { release(); } + + /** + * @brief . + * + * Deallocate any internally allocated memory + */ + void release() { + if (m_Buffer && m_Size) + std::memset(m_Buffer, 0, m_Size); + delete []m_Buffer; + m_Buffer = nullptr; + m_Size = 0; + } + + /** + * @brief . + * + * Copy Constructor - makes a copy from ctx + * + * @param[in] ctx Source UDLContext to copy from + */ + UDLContext(const UDLContext& ctx) : m_Name(ctx.m_Name), + m_Type(ctx.m_Type), + m_Id(ctx.m_Id) { + std::tuple cpy = ctx.getCopy(); + // current compiler does not support get + m_Buffer = std::get<0>(cpy); + m_Size = std::get<1>(cpy); + } + + /** + * @brief + * + * Assignment operator - makes a copy from ctx + * + * @param[in] ctx Source UDLContext to copy from + * + * @return this + */ + UDLContext& operator=(const UDLContext& ctx) { + UDLContext c (ctx); + this->swap(c); // non throwing swap + return *this; + } + + /** + * @brief . + * + * Move Constructor - Move internals from ctx into this + * + * @param[in] ctx Source UDLContext to move from + */ + UDLContext(UDLContext&& ctx) : + m_Name(std::move(ctx.m_Name)), + m_Type(std::move(ctx.m_Type)), + m_Buffer(ctx.m_Buffer), + m_Size(ctx.m_Size), + m_Id(ctx.m_Id) { + ctx.clear(); + } + + /** + * @brief . + * + * Assignment move - Move assignment operator from ctx + * + * @param[in] ctx Source UDLContext to move from + * + * @return this + */ + UDLContext& operator=(UDLContext&& ctx) { + m_Name = std::move(ctx.m_Name); + m_Type = std::move(ctx.m_Type); + m_Buffer = ctx.m_Buffer; + m_Size = ctx.m_Size; + m_Id = ctx.m_Id; + ctx.clear(); + return *this; + } + + /** + * @brief . + * + * Obtain the name of the layer + * + * @return const reference to the name of the layer + */ + const std::string& getName() const noexcept { return m_Name; } + + /** + * @brief . + * + * Obtain the type of the layer + * + * @return const reference to the type of the layer + */ + const std::string& getType() const noexcept { return m_Type; } + + /** + * @brief . + * + * Obtain the Id of the layer + * + * @return The id of the layer + */ + int32_t getId() const noexcept { return m_Id; } + + /** + * @brief . + * + * Obtain the size of the blob + * + * @return Size of the internal blob + */ + size_t getSize() const noexcept { return m_Size; } + + /** + * @brief . + * + * Get a const pointer to the internal blob + * + * @return Const pointer to the internal blob + */ + const uint8_t* getBlob() const noexcept { return m_Buffer; } + + /** + * @brief . + * + * Get a copy of the blob/size into a tuple + * + * @return A tuple with a pointer to a copy of the blob and a + * size + */ + std::tuple getCopy() const { + uint8_t* buf = new uint8_t[m_Size]; + // FIXME missing memcpy + std::memcpy(buf, m_Buffer, m_Size); + return std::make_tuple(buf, m_Size); + } + + /** + * @brief . + * + * Set zeros in the internals members + */ + void clear() { + m_Name.clear(); + m_Type.clear(); + m_Buffer = 0; + m_Size = 0; + m_Id = -1; + } +private: + void swap(UDLContext& c) noexcept { + std::swap(m_Name, c.m_Name); + std::swap(m_Type, c.m_Type); + std::swap(m_Id, c.m_Id); + std::swap(m_Buffer, c.m_Buffer); + std::swap(m_Size, c.m_Size); + } + std::string m_Name; // name of the layer instance + std::string m_Type; // The actual layer type + uint8_t* m_Buffer = nullptr; + size_t m_Size = 0; + int32_t m_Id = -1; +}; +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +}} + +#endif /* UDL_CONTEXT_HPP */ diff --git a/third_party/snpe/include/DlSystem/UDLFunc.hpp b/third_party/snpe/include/DlSystem/UDLFunc.hpp new file mode 100644 index 000000000..633ce985b --- /dev/null +++ b/third_party/snpe/include/DlSystem/UDLFunc.hpp @@ -0,0 +1,84 @@ +//============================================================================== +// +// Copyright (c) 2015 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef _UDL_FUNC_HPP_ +#define _UDL_FUNC_HPP_ + +#include + +#include "ZdlExportDefine.hpp" +#include + +namespace zdl { + namespace DlSystem { + class UDLContext; + } +} + +namespace zdl { namespace DlSystem { +/** @addtogroup c_plus_plus_apis C++ +@{ */ +/** + * @brief . + * + * Definition of UDLFactoyFunc, using/typedef and default FactoryFunction + * UDLBundle - a simple way to bundle func and cookie into one type + */ + + +/** + * @brief . + * + * Convenient typedef for user defined layer creation factory + * + * @param[out] void* Cookie - a user opaque data that was passed during SNPE's runtime's + * CreateInstance. SNPE's runtime is passing this back to the user. + * + * @param[out] DlSystem::UDLContext* - The specific Layer Description context what is passe + * SNPE runtime. + * + * @return IUDL* - a Concrete instance of IUDL derivative + */ +using UDLFactoryFunc = std::function; + +/** + * @brief . + * + * default UDL factory implementation + * + * @param[out] DlSystem::UDLContext* - The specific Layer Description context what is passe + * SNPE runtime. + * + * @param[out] void* Cookie - a user opaque data that was passed during SNPE's runtime's + * CreateInstance. SNPE's runtime is passing this back to the user. + * + * @return IUDL* - nullptr to indicate SNPE's runtime that there is no specific + * implementation for UDL. When SNPE's runtime sees nullptr as a return + * value from the factory, it will halt execution if model has an unknown layer + * + */ +inline ZDL_EXPORT zdl::DlSystem::IUDL* DefaultUDLFunc(void*, const zdl::DlSystem::UDLContext*) { return nullptr; } + +/** + * @brief . + * + * Simple struct to bundle 2 elements. + * A user defined cookie that would be returned for each + * IUDL call. The user can place anything there and the + * SNPE runtime will provide it back + */ +struct ZDL_EXPORT UDLBundle { + void *cookie = nullptr; + UDLFactoryFunc func = DefaultUDLFunc; +}; + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ +}} + + +#endif // _UDL_FUNC_HPP_ diff --git a/third_party/snpe/include/DlSystem/UserBufferMap.hpp b/third_party/snpe/include/DlSystem/UserBufferMap.hpp new file mode 100644 index 000000000..a03ddfe1d --- /dev/null +++ b/third_party/snpe/include/DlSystem/UserBufferMap.hpp @@ -0,0 +1,122 @@ +//============================================================================= +// +// Copyright (c) 2017 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= +#include +#include "ZdlExportDefine.hpp" +#include "StringList.hpp" + +#ifndef DL_SYSTEM_USER_BUFFER_MAP_HPP +#define DL_SYSTEM_USER_BUFFER_MAP_HPP + +namespace DlSystem +{ + // Forward declaration of UserBuffer map implementation. + class UserBufferMapImpl; +} + +namespace zdl +{ +namespace DlSystem +{ +class IUserBuffer; + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * A class representing the map of UserBuffer. + */ +class ZDL_EXPORT UserBufferMap final +{ +public: + + /** + * @brief . + * + * Creates a new empty UserBuffer map + */ + UserBufferMap(); + + /** + * copy constructor. + * @param[in] other object to copy. + */ + UserBufferMap(const UserBufferMap& other); + + /** + * assignment operator. + */ + UserBufferMap& operator=(const UserBufferMap& other); + + /** + * @brief Adds a name and the corresponding UserBuffer pointer + * to the map + * + * @param[in] name The name of the UserBuffer + * @param[in] userBuffer The pointer to the UserBuffer + * + * @note If a UserBuffer with the same name already exists, the new + * UserBuffer pointer would be updated. + */ + void add(const char *name, zdl::DlSystem::IUserBuffer *buffer); + + /** + * @brief Removes a mapping of one UserBuffer and its name by its name + * + * @param[in] name The name of UserBuffer to be removed + * + * @note If no UserBuffer with the specified name is found, nothing + * is done. + */ + void remove(const char *name) noexcept; + + /** + * @brief Returns the number of UserBuffers in the map + */ + size_t size() const noexcept; + + /** + * @brief . + * + * Removes all UserBuffers from the map + */ + void clear() noexcept; + + /** + * @brief Returns the UserBuffer given its name. + * + * @param[in] name The name of the UserBuffer to get. + * + * @return nullptr if no UserBuffer with the specified name is + * found; otherwise, a valid pointer to the UserBuffer. + */ + zdl::DlSystem::IUserBuffer* getUserBuffer(const char *name) const noexcept; + + /** + * @brief . + * + * Returns the names of all UserBuffers + * + * @return A list of UserBuffer names. + */ + zdl::DlSystem::StringList getUserBufferNames() const; + + ~UserBufferMap(); +private: + void swap(const UserBufferMap &other); + std::unique_ptr<::DlSystem::UserBufferMapImpl> m_UserBufferMapImpl; +}; +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +} // DlSystem namespace +} // zdl namespace + + +#endif // DL_SYSTEM_TENSOR_MAP_HPP + diff --git a/third_party/snpe/include/DlSystem/ZdlExportDefine.hpp b/third_party/snpe/include/DlSystem/ZdlExportDefine.hpp new file mode 100644 index 000000000..92eb786d3 --- /dev/null +++ b/third_party/snpe/include/DlSystem/ZdlExportDefine.hpp @@ -0,0 +1,13 @@ +//============================================================================= +// +// Copyright (c) 2015, 2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= + +#pragma once + +#ifndef ZDL_EXPORT +#define ZDL_EXPORT +#endif diff --git a/third_party/snpe/include/PlatformValidator/PlatformValidator.hpp b/third_party/snpe/include/PlatformValidator/PlatformValidator.hpp new file mode 100644 index 000000000..e74278ead --- /dev/null +++ b/third_party/snpe/include/PlatformValidator/PlatformValidator.hpp @@ -0,0 +1,93 @@ +// ============================================================================= +// +// Copyright (c) 2018-2019 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +// ============================================================================= + +#ifndef SNPE_PLATFORMVALIDATOR_HPP +#define SNPE_PLATFORMVALIDATOR_HPP + +#include "DlSystem/DlEnums.hpp" +#include "DlSystem/DlMacros.hpp" +SNPE_DISABLE_WARNINGS("-Wdelete-non-virtual-dtor","-Wdelete-non-virtual-dtor") +#include +#include +SNPE_ENABLE_WARNINGS + +namespace zdl +{ + namespace SNPE + { + class PlatformValidator; + + class IPlatformValidatorRuntime; + } +} + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** +* The class for checking SNPE compatibility/capability of a device. +* +*/ + +class zdl::SNPE::PlatformValidator +{ +public: + /** + * @brief Default Constructor of the PlatformValidator Class + * + * @return A new instance of a PlatformValidator object + * that can be used to check the SNPE compatibility + * of a device + */ + PlatformValidator(); + + ~PlatformValidator(); + + /** + * @brief Sets the runtime processor for compatibility check + * + * @return Void + */ + void setRuntime(zdl::DlSystem::Runtime_t runtime); + + /** + * @brief Checks if the Runtime prerequisites for SNPE are available. + * + * @return True if the Runtime prerequisites are available, else false. + */ + bool isRuntimeAvailable(); + + /** + * @brief Returns the core version for the Runtime selected. + * + * @return String which contains the actual core version value + */ + std::string getCoreVersion(); + + /** + * @brief Returns the library version for the Runtime selected. + * + * @return String which contains the actual lib version value + */ + std::string getLibVersion(); + + /** + * @brief Runs a small program on the runtime and Checks if SNPE is supported for Runtime. + * + * @return If True, the device is ready for SNPE execution, else not. + */ + + bool runtimeCheck(); + +private: + zdl::DlSystem::Runtime_t m_runtimeType; + std::unique_ptr m_platformValidatorRuntime; +}; +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif //SNPE_PLATFORMVALIDATOR_HPP diff --git a/third_party/snpe/include/SNPE/ApplicationBufferMap.hpp b/third_party/snpe/include/SNPE/ApplicationBufferMap.hpp new file mode 100644 index 000000000..380a3e0e6 --- /dev/null +++ b/third_party/snpe/include/SNPE/ApplicationBufferMap.hpp @@ -0,0 +1,101 @@ +//============================================================================== +// +// Copyright (c) 2019 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef PSNPE_APPLICATIONBUFFERMAP_HPP +#define PSNPE_APPLICATIONBUFFERMAP_HPP +#include +#include +#include + +#include "DlSystem/UserBufferMap.hpp" +#include "DlSystem/ZdlExportDefine.hpp" + +namespace zdl +{ +namespace PSNPE +{ +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * A class representing the UserBufferMap of Input and Output asynchronous mode. + */ + +class ZDL_EXPORT ApplicationBufferMap final +{ + + public: + /** + * @brief Adds a name and the corresponding buffer + * to the map + * + * @param[in] name The name of the UserBuffer + * @param[in] buffer The vector of the uint8_t data + * + * @note If a UserBuffer with the same name already exists, the new + * UserBuffer pointer would be updated. + */ + void add(const char* name, std::vector& buff) noexcept; + void add(const char* name, std::vector& buff) noexcept; + /** + * @brief Removes a mapping of one UserBuffer and its name by its name + * + * @param[in] name The name of UserBuffer to be removed + * + * @note If no UserBuffer with the specified name is found, nothing + * is done. + */ + void remove(const char* name) noexcept; + + /** + * @brief Returns the number of UserBuffers in the map + */ + size_t size() const noexcept; + + /** + * @brief . + * + * Removes all UserBuffers from the map + */ + void clear() noexcept; + + /** + * @brief Returns the UserBuffer given its name. + * + * @param[in] name The name of the UserBuffer to get. + * + * @return nullptr if no UserBuffer with the specified name is + * found; otherwise, a valid pointer to the UserBuffer. + */ + const std::vector& getUserBuffer(const char* name) const; + const std::vector& operator[](const char* name) const; + /** + * @brief . + * + * Returns the names of all UserAsyncBufferMap + * + * @return A list of UserBuffer names. + */ + zdl::DlSystem::StringList getUserBufferNames() const; + const std::unordered_map>& getUserBuffer() const; + explicit ApplicationBufferMap(); + ~ApplicationBufferMap(); + explicit ApplicationBufferMap( + const std::unordered_map> buffer); + + private: + std::unordered_map> m_UserMap; +}; + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ +} // namespace PSNPE +} // namespace zdl + +#endif // PSNPE_APPLICATIONBUFFERMAP_HPP diff --git a/third_party/snpe/include/SNPE/PSNPE.hpp b/third_party/snpe/include/SNPE/PSNPE.hpp new file mode 100644 index 000000000..c0a6fb55d --- /dev/null +++ b/third_party/snpe/include/SNPE/PSNPE.hpp @@ -0,0 +1,194 @@ +// ============================================================================= +// +// Copyright (c) 2019-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +// ============================================================================= + +#ifndef PSNPE_HPP +#define PSNPE_HPP + +#include +#include +#include "SNPE/SNPE.hpp" +#include "DlSystem/UserBufferMap.hpp" +#include "DlContainer/IDlContainer.hpp" +#include "DlSystem/DlEnums.hpp" +#include "DlSystem/ZdlExportDefine.hpp" + +#include "UserBufferList.hpp" +#include "RuntimeConfigList.hpp" +#include "ApplicationBufferMap.hpp" + +namespace zdl +{ +namespace PSNPE +{ + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + *@ brief build snpe instance in serial or parallel + * + */ +enum ZDL_EXPORT BuildMode { + SERIAL = 0, + PARALLEL = 1 +}; +/** + * @brief Input and output transmission mode + */ +enum ZDL_EXPORT InputOutputTransmissionMode +{ + sync = 0, + outputAsync = 1, + inputOutputAsync = 2 +}; + +/** + * @brief A structure representing parameters of callback function of Async Output mode + */ +struct ZDL_EXPORT OutputAsyncCallbackParam +{ + size_t dataIndex; + bool executeStatus; + OutputAsyncCallbackParam(size_t _index,bool _status) + : dataIndex(_index),executeStatus(_status){}; +}; +/** + * @brief A structure representing parameters of callback function of Async Input/Output mode + */ +struct ZDL_EXPORT InputOutputAsyncCallbackParam +{ + size_t dataIndex; + const ApplicationBufferMap& outputMap; + bool executeStatus; + InputOutputAsyncCallbackParam(size_t _index, const ApplicationBufferMap& output_map,bool _status) + : dataIndex(_index) + , outputMap(output_map) + ,executeStatus(_status){ + + }; +}; +/** + * @brief This callback is called when the output data is ready, only use for Output Async mode + */ +using OutputAsyncCallbackFunc = std::function; +/** + * @brief This callback is called when the output data is ready, only use for Output-Input Async mode + */ +using InputOutputAsyncCallbackFunc = std::function; +/** + * @brief This callback is called when the input data is ready,only use for Output-Input Async mode + */ +using InputOutputAsyncInputCallback = std::function(const std::vector &, + const zdl::DlSystem::StringList &)>; +/** + * @brief . + * + * A structure PSNPE configuration + * + */ +struct ZDL_EXPORT BuildConfig final +{ + BuildMode buildMode = BuildMode::SERIAL; ///< Specify build in serial mode or parallel mode + zdl::DlContainer::IDlContainer* container;///< The opened container ptr + zdl::DlSystem::StringList outputBufferNames;///< Specify the output layer name + RuntimeConfigList runtimeConfigList;///< The runtime config list for PSNPE, @see RuntimeConfig + size_t inputThreadNumbers = 1;///< Specify the number of threads used in the execution phase to process input data, only used in inputOutputAsync mode + size_t outputThreadNumbers = 1;///< Specify the number of threads used in the execution phase to process output data, only used in inputOutputAsync and outputAsync mode + OutputAsyncCallbackFunc outputCallback;///< The callback to deal with output data ,only used in outputAsync mode + InputOutputAsyncCallbackFunc inputOutputCallback;///< The callback to deal with output data ,only used in inputOutputAsync mode + InputOutputAsyncInputCallback inputOutputInputCallback;///< The callback to deal with input data ,only used in inputOutputAsync mode + InputOutputTransmissionMode inputOutputTransmissionMode = InputOutputTransmissionMode::sync;///< Specify execution mode + zdl::DlSystem::ProfilingLevel_t profilingLevel = zdl::DlSystem::ProfilingLevel_t::OFF;///< Specify profiling level for Diaglog + uint64_t encode[2] = {0, 0}; + bool enableInitCache = false; +}; +/** + * @brief . + * + * The class for executing SNPE instances in parallel. + */ +class ZDL_EXPORT PSNPE final +{ + public: + ~PSNPE(); + + explicit PSNPE() noexcept :m_TransmissionMode(InputOutputTransmissionMode::sync){}; + + /** + * @brief Build snpe instances. + * + */ + bool build(BuildConfig& buildConfig) noexcept; + + /** + * @brief Execute snpe instances in Async Output mode and Sync mode + * + * @param[in] inputBufferList A list of user buffers that contains the input data + * + * @param[in,out] outputBufferList A list of user buffers that will hold the output data + * + */ + bool execute(UserBufferList& inputBufferList, UserBufferList& outputBufferList) noexcept; + + /** + * @brief Execute snpe instances in Async Input/Output mode + * + * @param[in]inputMap A map of input buffers that contains input data. The names of buffers + * need to be matched with names retrived through getInputTensorNames() + * + * @param dataIndex Index of the input data + * + * @param isTF8buff Whether prefer to using 8 bit quantized element for inference + * + * @return True if executed successfully; flase, otherwise. + */ + bool executeInputOutputAsync(const std::vector& inputMap, size_t dataIndex, bool isTF8buff) noexcept; + bool executeInputOutputAsync(const std::vector& inputMap, size_t dataIndex, bool isTF8buff,bool isTF8Outputbuff) noexcept; + /** + * @brief Returns the input layer names of the network. + * + * @return StringList which contains the input layer names + */ + const zdl::DlSystem::StringList getInputTensorNames() const noexcept; + + /** + * @brief Returns the output layer names of the network. + * + * @return StringList which contains the output layer names + */ + const zdl::DlSystem::StringList getOutputTensorNames() const noexcept; + + /** + * @brief Returns the input tensor dimensions of the network. + * + * @return TensorShape which contains the dimensions. + */ + const zdl::DlSystem::TensorShape getInputDimensions() const noexcept; + + /** + * @brief Returns attributes of buffers. + * + * @see zdl::SNPE + * + * @return BufferAttributes of input/output tensor named. + */ + const zdl::DlSystem::TensorShape getBufferAttributesDims(const char *name) const noexcept; + + zdl::DlSystem::Optional getInputOutputBufferAttributes(const char *name) const noexcept; + + private: + PSNPE(const PSNPE&) = delete; + PSNPE& operator=(const PSNPE&) = delete; + zdl::PSNPE::InputOutputTransmissionMode m_TransmissionMode; + +}; + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ +} // namespace PSNPE +} // namespace zdl +#endif // PSNPE_HPP diff --git a/third_party/snpe/include/SNPE/RuntimeConfigList.hpp b/third_party/snpe/include/SNPE/RuntimeConfigList.hpp new file mode 100644 index 000000000..837dba092 --- /dev/null +++ b/third_party/snpe/include/SNPE/RuntimeConfigList.hpp @@ -0,0 +1,85 @@ +//============================================================================== +// +// Copyright (c) 2019-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== +#ifndef PSNPE_RUNTIMECONFIGLIST_HPP +#define PSNPE_RUNTIMECONFIGLIST_HPP + +#include +#include "DlContainer/IDlContainer.hpp" +#include "DlSystem/DlEnums.hpp" +#include "DlSystem/RuntimeList.hpp" +#include "DlSystem/TensorShapeMap.hpp" +#include "DlSystem/ZdlExportDefine.hpp" +namespace zdl { +namespace PSNPE { + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * The structure for configuring a BulkSNPE runtime + * + */ +struct ZDL_EXPORT RuntimeConfig final { + zdl::DlSystem::Runtime_t runtime; + zdl::DlSystem::RuntimeList runtimeList; + zdl::DlSystem::PerformanceProfile_t perfProfile; + zdl::DlSystem::TensorShapeMap inputDimensionsMap; + bool enableCPUFallback; + RuntimeConfig() + : runtime{zdl::DlSystem::Runtime_t::CPU_FLOAT32}, + perfProfile{zdl::DlSystem::PerformanceProfile_t::HIGH_PERFORMANCE}, + enableCPUFallback{false} {} + RuntimeConfig(const RuntimeConfig& other) { + runtime = other.runtime; + runtimeList = other.runtimeList; + perfProfile = other.perfProfile; + enableCPUFallback = other.enableCPUFallback; + inputDimensionsMap = other.inputDimensionsMap; + } + + RuntimeConfig& operator=(const RuntimeConfig& other) { + this->runtimeList = other.runtimeList; + this->runtime = other.runtime; + this->perfProfile = other.perfProfile; + this->enableCPUFallback = other.enableCPUFallback; + this->inputDimensionsMap = other.inputDimensionsMap; + return *this; + } + + ~RuntimeConfig() {} +}; + +/** + * @brief . + * + * The class for creating a RuntimeConfig container. + * + */ +class ZDL_EXPORT RuntimeConfigList final { + public: + RuntimeConfigList(); + RuntimeConfigList(const size_t size); + void push_back(const RuntimeConfig& runtimeConfig); + RuntimeConfig& operator[](const size_t index); + RuntimeConfigList& operator=(const RuntimeConfigList& other); + size_t size() const noexcept; + size_t capacity() const noexcept; + void clear() noexcept; + ~RuntimeConfigList() = default; + + private: + void swap(const RuntimeConfigList& other); + std::vector m_runtimeConfigs; +}; +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +} // namespace PSNPE +} // namespace zdl +#endif // PSNPE_RUNTIMECONFIGLIST_HPP diff --git a/third_party/snpe/include/SNPE/SNPE.hpp b/third_party/snpe/include/SNPE/SNPE.hpp new file mode 100644 index 000000000..239690ab2 --- /dev/null +++ b/third_party/snpe/include/SNPE/SNPE.hpp @@ -0,0 +1,244 @@ +//============================================================================== +// +// Copyright (c) 2015-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef _SNPE_SNPE_HPP_ +#define _SNPE_SNPE_HPP_ + +#include "DlSystem/DlOptional.hpp" +#include "DlSystem/DlVersion.hpp" +#include "DlSystem/IBufferAttributes.hpp" +#include "DlSystem/ITensor.hpp" +#include "DlSystem/TensorShape.hpp" +#include "DlSystem/TensorMap.hpp" +#include "DlSystem/String.hpp" +#include "DlSystem/StringList.hpp" +#include "DlSystem/IUserBuffer.hpp" +#include "DlSystem/UserBufferMap.hpp" +#include "DlSystem/ZdlExportDefine.hpp" + +namespace zdl { + namespace SNPE + { + class SnpeRuntime; + } +} +namespace zdl { + namespace DiagLog + { + class IDiagLog; + } +} + +namespace zdl { namespace SNPE { +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * The SNPE interface class definition + */ +class ZDL_EXPORT SNPE final +{ +public: + + // keep this undocumented to be hidden in doxygen using HIDE_UNDOC_MEMBERS + explicit SNPE(std::unique_ptr&& runtime) noexcept; + ~SNPE(); + + /** + * @brief Gets the names of input tensors to the network + * + * To support multiple input scenarios, where multiple tensors are + * passed through execute() in a TensorMap, each tensor needs to + * be uniquely named. The names of tensors can be retrieved + * through this function. + * + * In the case of a single input, one name will be returned. + * + * @note Note that because the returned value is an Optional list, + * the list must be verified as boolean true value before being + * dereferenced. + * + * @return An Optional List of input tensor names. + * + * @see zdl::DlSystem::Optional + */ + zdl::DlSystem::Optional + getInputTensorNames() const noexcept; + + /** + * @brief Gets the names of output tensors to the network + * + * @return List of output tensor names. + */ + zdl::DlSystem::Optional + getOutputTensorNames() const noexcept; + + /** + * @brief Gets the name of output tensor from the input layer name + * + * @return Output tensor name. + */ + zdl::DlSystem::StringList + getOutputTensorNamesByLayerName(const char *name) const noexcept; + + /** + * @brief Processes the input data and returns the output + * + * @param[in] A map of tensors that contains the input data for + * each input. The names of tensors needs to be + * matched with names retrieved through + * getInputTensorNames() + * + * @param[in,out] An empty map of tensors that will contain the output + * data of potentially multiple layers (the key + * in the map is the layer name) upon return + * + * @note output tensormap has to be empty. To forward propagate + * and get results in user-supplied tensors, use + * executeWithSuppliedOutputTensors. + */ + bool execute(const zdl::DlSystem::TensorMap &input, + zdl::DlSystem::TensorMap &output) noexcept; + + /** + * @brief Processes the input data and returns the output + * + * @param[in] A single tensor contains the input data. + * + * @param[in,out] An empty map of tensors that will contain the output + * data of potentially multiple layers (the key + * in the map is the layer name) upon return + * + * @note output tensormap has to be empty. + */ + bool execute(const zdl::DlSystem::ITensor *input, + zdl::DlSystem::TensorMap &output) noexcept; + + /** + * @brief Processes the input data and returns the output, using + * user-supplied buffers + * + * @param[in] A map of UserBuffers that contains the input data for + * each input. The names of UserBuffers needs to be + * matched with names retrieved through + * getInputTensorNames() + * + * @param[in,out] A map of UserBuffers that will hold the output + * data of potentially multiple layers (the key + * in the map is the UserBuffer name) + * + * @note input and output UserBuffer maps must be fully pre-populated. with + * dimensions matching what the network expects. + * For example, if there are 5 output UserBuffers they all have to be + * present in map. + * + * Caller must guarantee that for the duration of execute(), the buffer + * stored in UserBuffer would remain valid. For more detail on buffer + * ownership and lifetime requirements, please refer to zdl::DlSystem::UserBuffer + * documentation. + */ + bool execute(const zdl::DlSystem::UserBufferMap &input, + const zdl::DlSystem::UserBufferMap &output) noexcept; + + /** + * @brief Returns the version string embedded at model conversion + * time. + * + * @return Model version string, which is a free-form string + * supplied at the time of the conversion + * + */ + zdl::DlSystem::String getModelVersion() const noexcept; + + /** + * @brief Returns the dimensions of the input data to the model in the + * form of TensorShape. The dimensions in TensorShape corresponds to + * what the tensor dimensions would need to be for an input tensor to + * the model. + * + * @param[in] layer input name. + * + * @note Note that this function only makes sense for networks + * that have a fixed input size. For networks in which the + * input size varies with each call of Execute(), this + * function should not be used. + * + * @note Because the returned type is an Optional instance, it must + * be verified as a boolean true value before being dereferenced. + * + * @return An Optional instance of TensorShape that maintains dimensions, + * matching the tensor dimensions for input to the model, + * where the last entry is the fastest varying dimension, etc. + * + * @see zdl::DlSystem::ITensor + * @see zdl::DlSystem::TensorShape + * @see zdl::DlSystem::Optional + */ + zdl::DlSystem::Optional + getInputDimensions() const noexcept; + zdl::DlSystem::Optional + getInputDimensions(const char *name) const noexcept; + + /** + * @brief Gets the output layer(s) for the network. + * + * Note that the output layers returned by this function may be + * different than those specified when the network was created + * via the zdl::SNPE::SNPEBuilder. For example, if the + * network was created in debug mode with no explicit output + * layers specified, this will contain all layers. + * + * @note Note that because the returned value is an Optional StringList, + * the list must be verified as a boolean true value before being + * dereferenced. + * + * @return A List of output layer names. + * + * @see zdl::DlSystem::Optional + */ + zdl::DlSystem::Optional + getOutputLayerNames() const noexcept; + + /** + * @brief Returns attributes of buffers used to feed input tensors and receive result from output tensors. + * + * @param[in] Tensor name. + * + * @return BufferAttributes of input/output tensor named + */ + zdl::DlSystem::Optional getInputOutputBufferAttributes(const char *name) const noexcept; + + zdl::DlSystem::Optional getInputOutputBufferAttributesTf8(const char *name) const noexcept; + + /** + * @brief . + * + * Get the diagnostic logging interface + * + * @note Note that because the returned type is an Optional instance, + * it must be verified as a boolean true value before being + * dereferenced. + * + * @see zdl::DlSystem::Optional + */ + zdl::DlSystem::Optional + getDiagLogInterface() noexcept; + +private: + SNPE(const SNPE&) = delete; + SNPE& operator=(const SNPE&) = delete; + + std::unique_ptr m_Runtime; +}; + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ +}} + +#endif diff --git a/third_party/snpe/include/SNPE/SNPEBuilder.hpp b/third_party/snpe/include/SNPE/SNPEBuilder.hpp new file mode 100644 index 000000000..f314d88bc --- /dev/null +++ b/third_party/snpe/include/SNPE/SNPEBuilder.hpp @@ -0,0 +1,283 @@ +//============================================================================== +// +// Copyright (c) 2017-2019 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef _SNPE_BUILDER_HPP_ +#define _SNPE_BUILDER_HPP_ + +#include "SNPE/SNPE.hpp" +#include "DlSystem/DlEnums.hpp" +#include "DlSystem/UDLFunc.hpp" +#include "DlSystem/DlOptional.hpp" +#include "DlSystem/TensorShapeMap.hpp" +#include "DlSystem/PlatformConfig.hpp" +#include "DlSystem/RuntimeList.hpp" + +namespace zdl { + namespace DlContainer + { + class IDlContainer; + } +} + +struct SNPEBuilderImpl; + + +namespace zdl { namespace SNPE { +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * The builder class for creating SNPE objects. + * Not meant to be extended. + */ +class ZDL_EXPORT SNPEBuilder final +{ +private: + std::unique_ptr<::SNPEBuilderImpl> m_Impl; +public: + + /** + * @brief Constructor of NeuralNetwork Builder with a supplied model. + * + * @param[in] container A container holding the model. + * + * @return A new instance of a SNPEBuilder object + * that can be used to configure and build + * an instance of SNPE. + * + */ + explicit SNPEBuilder( + zdl::DlContainer::IDlContainer* container); + ~SNPEBuilder(); + + /** + * NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE. Please use + * setRuntimeProcessorOrder() + * + * @brief Sets the runtime processor. + * + * @param[in] targetRuntimeProcessor The target runtime. + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setRuntimeProcessor( + zdl::DlSystem::Runtime_t targetRuntimeProcessor); + + /** + * @brief Requests a performance profile. + * + * @param[in] targetRuntimeProfile The target performance profile. + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setPerformanceProfile( + zdl::DlSystem::PerformanceProfile_t performanceProfile); + + /** + * @brief Sets the profiling level. Default profiling level for + * SNPEBuilder is off. Off and basic only applies to DSP runtime. + * + * @param[in] profilingLevel The target profiling level. + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setProfilingLevel( + zdl::DlSystem::ProfilingLevel_t profilingLevel); + + /** + * @brief Sets a preference for execution priority. + * + * This allows the caller to give coarse hint to SNPE runtime + * about the priority of the network. SNPE runtime is free to use + * this information to co-ordinate between different workloads + * that may or may not extend beyond SNPE. + * + * @param[in] ExecutionPriorityHint_t The target performance profile. + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setExecutionPriorityHint( + zdl::DlSystem::ExecutionPriorityHint_t priority); + + /** + * @brief Sets the layers that will generate output. + * + * @param[in] outputLayerNames List of layer names to + * output. An empty list will + * result in only the final + * layer of the model being + * the output layer. The list + * will be copied. + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setOutputLayers( + const zdl::DlSystem::StringList& outputLayerNames); + + /** + * @brief Sets the output tensor names. + * + * @param[in] outputTensorNames List of tensor names to + * output. An empty list will + * result in producing output for the final + * output tensor of the model. + * The list will be copied. + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setOutputTensors( + const zdl::DlSystem::StringList& outputTensorNames); + + /** + * @brief Passes in a User-defined layer. + * + * @param udlBundle Bundle of udl factory function and a cookie + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setUdlBundle( + zdl::DlSystem::UDLBundle udlBundle); + + /** + * @brief Sets whether this neural network will perform inference with + * input from user-supplied buffers, and write output to user-supplied + * buffers. Default behaviour is to use tensors created by + * ITensorFactory. + * + * @param[in] bufferMode Whether to use user-supplied buffer or not. + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setUseUserSuppliedBuffers( + bool bufferMode); + + /** + * @brief Sets the debug mode of the runtime. + * + * @param[in] debugMode This enables debug mode for the runtime. It + * does two things. For an empty + * outputLayerNames list, all layers will be + * output. It might also disable some internal + * runtime optimizations (e.g., some networks + * might be optimized by combining layers, + * etc.). + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setDebugMode( + bool debugMode); + + /** + * NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE. Please use + * setRuntimeProcessorOrder() + * + * @brief Sets the mode of CPU fallback functionality. + * + * @param[in] mode This flag enables/disables the functionality + * of CPU fallback. When the CPU fallback + * functionality is enabled, layers in model that + * violates runtime constraints will run on CPU + * while the rest of non-violating layers will + * run on the chosen runtime processor. In + * disabled mode, models with layers violating + * runtime constraints will NOT run on the chosen + * runtime processor and will result in runtime + * exception. By default, the functionality is + * enabled. + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setCPUFallbackMode( + bool mode); + + + /** + * @brief Sets network's input dimensions to enable resizing of + * the spatial dimensions of each layer for fully convolutional networks, + * and the batch dimension for all networks. + * + * @param[in] tensorShapeMap The map of input names and their new dimensions. + * The new dimensions overwrite the input dimensions + * embedded in the model and then resize each layer + * of the model. If the model contains + * layers whose dimensions cannot be resized e.g FullyConnected, + * exception will be thrown when SNPE instance is actually built. + * In general the batch dimension is always resizable. + * After resizing of layers' dimensions in model based + * on new input dimensions, the new model is revalidated + * against all runtime constraints, whose failures may + * result in cpu fallback situation. + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setInputDimensions(const zdl::DlSystem::TensorShapeMap& inputDimensionsMap); + + /** + * @brief Sets the mode of init caching functionality. + * + * @param[in] mode This flag enables/disables the functionality of init caching. + * When init caching functionality is enabled, a set of init caches + * will be created during network building/initialization process + * and will be added to DLC container. If such DLC container is saved + * by the user, in subsequent network building/initialization processes + * these init caches will be loaded from the DLC so as to reduce initialization time. + * In disable mode, no init caches will be added to DLC container. + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setInitCacheMode( + bool cacheMode); + + /** + * @brief Returns an instance of SNPE based on the current parameters. + * + * @return A new instance of a SNPE object that can be used + * to execute models or null if any errors occur. + */ + std::unique_ptr build() noexcept; + + /** + * @brief Sets the platform configuration. + * + * @param[in] platformConfig The platform configuration. + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setPlatformConfig(const zdl::DlSystem::PlatformConfig& platformConfig); + + /** + * @brief Sets network's runtime order of precedence. Example: + * CPU_FLOAT32, GPU_FLOAT16, AIP_FIXED8_TF + * Note:- setRuntimeProcessor() or setCPUFallbackMode() will be silently ignored when + * setRuntimeProcessorOrder() is invoked + * + * @param[in] runtimeList The list of runtime in order of precedence + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setRuntimeProcessorOrder(const zdl::DlSystem::RuntimeList& runtimeList); + + /** + * @brief Sets the unconsumed tensors as output + * + * @param[in] setOutput This enables unconsumed tensors (i.e) + * outputs which are not inputs to any + * layer (basically dead ends) to be marked + * for output + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setUnconsumedTensorsAsOutputs( + bool setOutput); + +}; +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +}} + +#endif diff --git a/third_party/snpe/include/SNPE/SNPEFactory.hpp b/third_party/snpe/include/SNPE/SNPEFactory.hpp new file mode 100644 index 000000000..7bef45d87 --- /dev/null +++ b/third_party/snpe/include/SNPE/SNPEFactory.hpp @@ -0,0 +1,131 @@ +//============================================================================== +// +// Copyright (c) 2015-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef _SNPE_FACTORY_HPP_ +#define _SNPE_FACTORY_HPP_ + +#include "SNPE/SNPE.hpp" +#include "DlSystem/DlEnums.hpp" +#include "DlSystem/UDLFunc.hpp" +#include "DlSystem/ZdlExportDefine.hpp" +#include "DlSystem/DlOptional.hpp" + +namespace zdl { + namespace DlSystem + { + class ITensorFactory; + class IUserBufferFactory; + } + namespace DlContainer + { + class IDlContainer; + } +} + + + +namespace zdl { namespace SNPE { +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * The factory class for creating SNPE objects. + * + */ +class ZDL_EXPORT SNPEFactory +{ +public: + + /** + * Indicates whether the supplied runtime is available on the + * current platform. + * + * @param[in] runtime The target runtime to check. + * + * @param[in] option Extent to perform runtime available check. + * + * @return True if the supplied runtime is available; false, + * otherwise. + */ + static bool isRuntimeAvailable(zdl::DlSystem::Runtime_t runtime); + + /** + * Indicates whether the supplied runtime is available on the + * current platform. + * + * @param[in] runtime The target runtime to check. + * + * @param[in] option Extent to perform runtime available check. + * + * @return True if the supplied runtime is available; false, + * otherwise. + */ + static bool isRuntimeAvailable(zdl::DlSystem::Runtime_t runtime, + zdl::DlSystem::RuntimeCheckOption_t option); + + /** + * Gets a reference to the tensor factory. + * + * @return A reference to the tensor factory. + */ + static zdl::DlSystem::ITensorFactory& getTensorFactory(); + + /** + * Gets a reference to the UserBuffer factory. + * + * @return A reference to the UserBuffer factory. + */ + static zdl::DlSystem::IUserBufferFactory& getUserBufferFactory(); + + /** + * Gets the version of the SNPE library. + * + * @return Version of the SNPE library. + * + */ + static zdl::DlSystem::Version_t getLibraryVersion(); + + /** + * Set the SNPE storage location for all SNPE instances in this + * process. Note that this may only be called once, and if so + * must be called before creating any SNPE instances. + * + * @param[in] storagePath Absolute path to a directory which SNPE may + * use for caching and other storage purposes. + * + * @return True if the supplied path was succesfully set as + * the SNPE storage location, false otherwise. + */ + static bool setSNPEStorageLocation(const char* storagePath); + + /** + * @brief Register a user-defined op package with SNPE. + * + * @param[in] regLibraryPath Path to the registration library + * that allows clients to register a set of operations that are + * part of the package, and share op info with SNPE + * + * @return True if successful, False otherwise. + */ + static bool addOpPackage( const std::string& regLibraryPath ); + + /** + * Indicates whether the OpenGL and OpenCL interoperability is supported + * on GPU platform. + * + * @return True if the OpenGL and OpenCl interop is supported; false, + * otherwise. + */ + static bool isGLCLInteropSupported(); +}; + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ +}} + + +#endif diff --git a/third_party/snpe/include/SNPE/UserBufferList.hpp b/third_party/snpe/include/SNPE/UserBufferList.hpp new file mode 100644 index 000000000..a660bca0f --- /dev/null +++ b/third_party/snpe/include/SNPE/UserBufferList.hpp @@ -0,0 +1,49 @@ +//============================================================================== +// +// Copyright (c) 2019 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== +#ifndef PSNPE_USERBUFFERLIST_HPP +#define PSNPE_USERBUFFERLIST_HPP + +#include +#include "DlSystem/UserBufferMap.hpp" +#include "DlSystem/ZdlExportDefine.hpp" + +namespace zdl { +namespace PSNPE +{ + +/** @addtogroup c_plus_plus_apis C++ +@{ */ +/** +* @brief . +* +* The class for creating a UserBufferMap container. +* +*/ +class ZDL_EXPORT UserBufferList final +{ +public: + UserBufferList(); + UserBufferList(const size_t size); + void push_back(const zdl::DlSystem::UserBufferMap &userBufferMap); + zdl::DlSystem::UserBufferMap& operator[](const size_t index); + UserBufferList& operator =(const UserBufferList &other); + size_t size() const noexcept; + size_t capacity() const noexcept; + void clear() noexcept; + ~UserBufferList() = default; + +private: + void swap(const UserBufferList &other); + std::vector m_userBufferMaps; + +}; +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +} // namespace PSNPE +} // namespace zdl +#endif //PSNPE_USERBUFFERLIST_HPP diff --git a/third_party/snpe/include/SnpeUdo/UdoBase.h b/third_party/snpe/include/SnpeUdo/UdoBase.h new file mode 100644 index 000000000..be370e1ac --- /dev/null +++ b/third_party/snpe/include/SnpeUdo/UdoBase.h @@ -0,0 +1,483 @@ +//============================================================================== +// +// Copyright (c) 2019-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef SNPE_UDO_BASE_H +#define SNPE_UDO_BASE_H + +#include + +// Provide values to use for API version. +#define API_VERSION_MAJOR 1 +#define API_VERSION_MINOR 5 +#define API_VERSION_TEENY 0 + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +// Defines a bitmask of enum values. +typedef uint32_t SnpeUdo_Bitmask_t; + +// A string of characters, rather than an array of bytes. +// Assumed to be UTF-8. +typedef char* SnpeUdo_String_t; + +// The maximum allowable length of a SnpeUdo_String_t in bytes, +// including null terminator. SNPE will truncate strings longer +// than this. +#define SNPE_UDO_MAX_STRING_SIZE 1024 + +/** + * An enum which holds the various error types. + * The error types are divided to classes : + * 0 - 99 : generic errors + * 100 - 200 : errors related to configuration + * + */ +typedef enum +{ + /// No Error + SNPE_UDO_NO_ERROR = 0, + /// Unsupported value for core type + SNPE_UDO_WRONG_CORE = 1, + /// Invalid attribute/argument passed into UDO API + SNPE_UDO_INVALID_ARGUMENT = 2, + /// Unsupported feature error + SNPE_UDO_UNSUPPORTED_FEATURE = 3, + /// Error relating to memory allocation + SNPE_UDO_MEM_ALLOC_ERROR = 4, + /* Configuration Specific errors */ + /// No op with given attributes available in library + SNPE_UDO_WRONG_OPERATION = 100, + /// Unsupported value for core type in UDO configuration + SNPE_UDO_WRONG_CORE_TYPE = 101, + /// Wrong number of params in UDO definition + SNPE_UDO_WRONG_NUM_OF_PARAMS = 102, + /// Wrong number of dimensions for tensor(s) in UDO definition + SNPE_UDO_WRONG_NUM_OF_DIMENSIONS = 103, + /// Wrong number of input tensors in UDO definition + SNPE_UDO_WRONG_NUM_OF_INPUTS = 104, + /// Wrong number of output tensors in UDO definition + SNPE_UDO_WRONG_NUM_OF_OUTPUTS = 105, + SNPE_UDO_PROGRAM_CACHE_NOT_FOUND = 106, + SNPE_UDO_UNKNOWN_ERROR = 0xFFFFFFFF +} SnpeUdo_ErrorType_t; + +/** + * An enum which holds the various data types. + * Designed to be used as single values or combined into a bitfield parameter + * (0x1, 0x2, 0x4, etc) + * \n FIXED_XX types are targeted for data in tensors. + * \n UINT / INT types are targeted for scalar params + */ +typedef enum +{ + /// data type: 16-bit floating point + SNPE_UDO_DATATYPE_FLOAT_16 = 0x01, + /// data type: 32-bit floating point + SNPE_UDO_DATATYPE_FLOAT_32 = 0x02, + /// data type: 4-bit fixed point + SNPE_UDO_DATATYPE_FIXED_4 = 0x04, + /// data type: 8-bit fixed point + SNPE_UDO_DATATYPE_FIXED_8 = 0x08, + /// data type: 16-bit fixed point + SNPE_UDO_DATATYPE_FIXED_16 = 0x10, + /// data type: 32-bit fixed point + SNPE_UDO_DATATYPE_FIXED_32 = 0x20, + /// data type: 8-bit unsigned integer + SNPE_UDO_DATATYPE_UINT_8 = 0x100, + /// data type: 16-bit unsigned integer + SNPE_UDO_DATATYPE_UINT_16 = 0x200, + /// data type: 32-bit unsigned integer + SNPE_UDO_DATATYPE_UINT_32 = 0x400, + /// data type: 8-bit signed integer + SNPE_UDO_DATATYPE_INT_8 = 0x1000, + /// data type: 16-bit signed integer + SNPE_UDO_DATATYPE_INT_16 = 0x2000, + /// data type: 32-bit signed integer + SNPE_UDO_DATATYPE_INT_32 = 0x4000, + SNPE_UDO_DATATYPE_LAST = 0xFFFFFFFF +} SnpeUdo_DataType_t; + +/** + * An enum which holds the various layouts. + * Designed to be used as single values or combined into a bitfield parameter + * (0x1, 0x2, 0x4, etc) + */ +typedef enum +{ + /// data layout (4D): NHWC (batch-height-width-channel) + SNPE_UDO_LAYOUT_NHWC = 0x01, + /// data layout (4D): NCHW (batch-channel-height-width) + SNPE_UDO_LAYOUT_NCHW = 0x02, + /// data layout (5D): NDHWC (batch-dimension-height-width-channel) + SNPE_UDO_LAYOUT_NDHWC = 0x04, + SNPE_UDO_LAYOUT_GPU_OPTIMAL1 = 0x08, + SNPE_UDO_LAYOUT_GPU_OPTIMAL2 = 0x10, + SNPE_UDO_LAYOUT_DSP_OPTIMAL1 = 0x11, + SNPE_UDO_LAYOUT_DSP_OPTIMAL2 = 0x12, + // Indicates no data will be allocated for this tensor. + // Used to specify optional inputs/outputs positionally. + SNPE_UDO_LAYOUT_NULL = 0x13, + SNPE_UDO_LAYOUT_LAST = 0xFFFFFFFF +} SnpeUdo_TensorLayout_t; + +/** + * An enum which holds the UDO library Core type . + * Designed to be used as single values or combined into a bitfield parameter + * (0x1, 0x2, 0x4, etc) + */ +typedef enum +{ + /// Library target IP Core is undefined + SNPE_UDO_CORETYPE_UNDEFINED = 0x00, + /// Library target IP Core is CPU + SNPE_UDO_CORETYPE_CPU = 0x01, + /// Library target IP Core is GPU + SNPE_UDO_CORETYPE_GPU = 0x02, + /// Library target IP Core is DSP + SNPE_UDO_CORETYPE_DSP = 0x04, + SNPE_UDO_CORETYPE_LAST = 0xFFFFFFFF +} SnpeUdo_CoreType_t; + +/** + * An enum to specify the parameter type : Scalar or Tensor + */ +typedef enum +{ + /// UDO static param type: scalar + SNPE_UDO_PARAMTYPE_SCALAR, + /// UDO static param type: string + SNPE_UDO_PARAMTYPE_STRING, + /// UDO static param type: tensor + SNPE_UDO_PARAMTYPE_TENSOR, + SNPE_UDO_PARAMTYPE_LAST = 0xFFFFFFFF +} SnpeUdo_ParamType_t; + +/** + * An enum to specify quantization type + */ +typedef enum +{ + /// Tensor Quantization type: NONE. Signifies unquantized tensor data + SNPE_UDO_QUANTIZATION_NONE, + /// Tensor Quantization type: Tensorflow-style + SNPE_UDO_QUANTIZATION_TF, + SNPE_UDO_QUANTIZATION_QMN, + SNPE_UDO_QUANTIZATION_LAST = 0xFFFFFFFF +} SnpeUdo_QuantizationType_t; + +/** + * @brief A struct which is used to provide a version number using 3 values : major, minor, teeny + * + */ +typedef struct +{ + /// version field: major - for backward-incompatible changes + uint32_t major; + /// version field: minor - for backward-compatible feature updates + uint32_t minor; + /// version field: teeny - for minor bug-fixes and clean-up + uint32_t teeny; +} SnpeUdo_Version_t; + +/** + * @brief A struct returned from version query, contains the Library version and API version + * + */ +typedef struct +{ + /// Version of UDO library. Controlled by users + SnpeUdo_Version_t libVersion; + /// Version of SNPE UDO API used in compiling library. Determined by SNPE + SnpeUdo_Version_t apiVersion; +} SnpeUdo_LibVersion_t; + +/** + * @brief A union to hold the value of a generic type. Allows defining a parameter struct + * in a generic way, with a "value" location that holds the data regardless of the type. + * + */ +typedef union +{ + /// value type: float + float floatValue; + /// value type: unsigned 32-bit integer + uint32_t uint32Value; + /// value type: signed 32-bit integer + int32_t int32Value; + /// value type: unsigned 16-bit integer + uint16_t uint16Value; + /// value type: signed 16-bit integer + int16_t int16Value; + /// value type: unsigned 8-bit integer + uint8_t uint8Value; + /// value type: signed 8-bit integer + int8_t int8Value; +} SnpeUdo_Value_t; + +/** + * @brief A struct which defines a scalar parameter : name, data type, and union of values + * + */ +typedef struct +{ + /// The parameter data type : float, int, etc. + SnpeUdo_DataType_t dataType; + /// a union of specified type which holds the data + SnpeUdo_Value_t dataValue; +} SnpeUdo_ScalarParam_t; + +/** + * @brief A struct which defines the quantization parameters in case of Tensorflow style quantization + * + */ +typedef struct +{ + /// minimum value of the quantization range of data + float minValue; + /// maximum value of the quantization range of data + float maxValue; +} SnpeUdo_TFQuantize_t; + +/** + * @brief A struct which defines the quantization type, and union of supported quantization structs + * + */ +typedef struct +{ + /// quantization type (only TF-style currently supported) + SnpeUdo_QuantizationType_t quantizeType; + union + { + /// TF-style min-max quantization ranges + SnpeUdo_TFQuantize_t TFParams; + }; +} SnpeUdo_QuantizeParams_t; + +/** + * @brief A struct which defines the datatype associated with a specified core-type + * This should be used to denote the datatypes for a single tensor info, depending + * on the intended execution core. + * + */ +typedef struct +{ + /// The IP Core + SnpeUdo_CoreType_t coreType; + /// The associated datatype for this coreType + SnpeUdo_DataType_t dataType; +} SnpeUdo_PerCoreDatatype_t; + +/** + * @brief A struct which defines a tensor parameter : name, data type, layout, quantization, more. + * Also holds a pointer to the tensor data. + * + */ +typedef struct +{ + /// The maximum allowable dimensions of the tensor. The memory held in + /// _tensorData_ is guaranteed to be large enough for this. + uint32_t* maxDimensions; + /// The current dimensions of the tensor. An operation may modify the current + /// dimensions of its output, to indicate cases where the output has been + /// "resized". + /// Note that for static parameters, the current and max dimensions must + /// match. + uint32_t* currDimensions; + /// Quantization params applicable to the tensor. Currently only supports + /// Tensorflow quantization style. + SnpeUdo_QuantizeParams_t quantizeParams; + /// Number of dimensions to the tensor: 3D, 4D, etc. + uint32_t tensorRank; + /// The parameter data type: float, int, etc. + SnpeUdo_DataType_t dataType; + /// The tensor layout type: NCHW, NHWC, etc. + SnpeUdo_TensorLayout_t layout; + /// Opaque pointer to tensor data. User may be required to re-interpret the pointer + /// based on core-specific definitions. + void* tensorData; +} SnpeUdo_TensorParam_t; + +/** + * @brief A struct which defines tensor information for activation tensors only + * + * It describes an activation tensor object using its name, the intended layout and the datatype + * it will take depending on the intended runtime core. The repeated field indicates that + * that the tensor info describes several input/output activation tensors, which all share the + * aforementioned properties. + */ +typedef struct +{ + /// The tensor name + SnpeUdo_String_t tensorName; + /// The tensor layout type: NCHW, NHWC, etc. + SnpeUdo_TensorLayout_t layout; + /// The per core datatype: {SNPE_UDO_DATATYPE, SNPE_UDO_CORE_TYPE} + SnpeUdo_PerCoreDatatype_t* perCoreDatatype; + /// A boolean field indicating that this tensorinfo will be repeated e.x for ops such as Concat or Split + bool repeated; + +} SnpeUdo_TensorInfo_t; + + +/** + * @brief struct which defines a UDO parameter - a union of scalar, tensor and string parameters + * + */ +typedef struct +{ + /// Type is scalar or tensor + SnpeUdo_ParamType_t paramType; + /// The param name, for example : "offset", "activation_type" + SnpeUdo_String_t paramName; + union + { + /// scalar param value + SnpeUdo_ScalarParam_t scalarParam; + /// tensor param value + SnpeUdo_TensorParam_t tensorParam; + /// string param value + SnpeUdo_String_t stringParam; + }; +} SnpeUdo_Param_t; + +/** + * @brief A struct which defines Operation information which is specific for IP core (CPU, GPU, DSP ...) + * + */ +typedef struct +{ + /// The IP Core + SnpeUdo_CoreType_t udoCoreType; + /// Bitmask, defines supported internal calculation types (like FLOAT_32, etc) + /// Based on SnpeUdo_DataType + SnpeUdo_Bitmask_t operationCalculationTypes; +} SnpeUdo_OpCoreInfo_t; + +/** + * @brief A struct which defines the common and core-specific Operation information + * + */ +typedef struct +{ + /// Operation type + SnpeUdo_String_t operationType; + /// A bitmask describing which IP Cores (CPU, GPU, DSP ...) support this operation + /// Translated based on SnpeUdo_CoreType + SnpeUdo_Bitmask_t supportedByCores; + /// Number of static parameters defined by the op + uint32_t numOfStaticParams; + /// Array of static parameters. Can be scalar or tensor params + SnpeUdo_Param_t* staticParams; + /// Number of input tensors this op receives + uint32_t numOfInputs; + /// Array of input tensor names to this operation + SnpeUdo_String_t* inputNames; + /// Number of output tensors this op receives + uint32_t numOfOutputs; + /// Array of output tensor names to this operation + SnpeUdo_String_t* outputNames; + /// Number of cores that the op can execute on + uint32_t numOfCoreInfo; + /// Array of per-core information entries + SnpeUdo_OpCoreInfo_t* opPerCoreInfo; + /// Array of input tensor infos for this operation + SnpeUdo_TensorInfo_t* inputInfos; + /// Array of output tensor infos for this operation + SnpeUdo_TensorInfo_t* outputInfos; +} SnpeUdo_OperationInfo_t; + +/** + * @brief A struct which provides the implementation library info : type, name + * + */ +typedef struct +{ + /// Defines the IP Core that this implementation library is targeting + SnpeUdo_CoreType_t udoCoreType; + /// library name. will be looked at in the standard library path + SnpeUdo_String_t libraryName; +} SnpeUdo_LibraryInfo_t; + +/** + * @brief A struct returned by the registration library and contains information on the UDO package : + * name, operations, libraries, etc. + * + */ +typedef struct +{ + /// A string containing the package name + SnpeUdo_String_t packageName; + /// A bitmask describing supported IP cores (CPU, GPU, DSP ...) + /// Translated based on SnpeUdo_CoreType + SnpeUdo_Bitmask_t supportedCoreTypes; + /// The number of implementation libraries in the package + uint32_t numOfImplementationLib; + /// Array of implementation libraries names/types + SnpeUdo_LibraryInfo_t* implementationLib; + /// A string containing all operation types separated by space + SnpeUdo_String_t operationsString; + /// Number of supported operations + uint32_t numOfOperations; + /// Array of Operation info structs. Each entry describes one + /// Operation (name, params, inputs, outputs) + SnpeUdo_OperationInfo_t* operationsInfo; +} SnpeUdo_RegInfo_t; + +/** +* @brief A struct returned by the implementation library and contains information on the +* specific library: name, IP Core, operations, etc. +* +*/ +typedef struct +{ + /// Defines the IP Core that this implementation library is targeting + SnpeUdo_CoreType_t udoCoreType; + /// A string containing the package name + SnpeUdo_String_t packageName; + /// A string containing all operation types separated by space + SnpeUdo_String_t operationsString; + /// Number of supported operations + uint32_t numOfOperations; +} SnpeUdo_ImpInfo_t; + +/** + * @brief This struct defines an operation. It is used for validation + * or creation of an operation. + * In case of using it for creation, the static params which are tensors + * contain pointers to the real data (weights, for example), and input/output + * tensors also include pointers to the buffers used. + */ +typedef struct +{ + /// The IP Core that the operation is defined for - CPU, GPU, DSP... + SnpeUdo_CoreType_t udoCoreType; + /// Operation type + SnpeUdo_String_t operationType; + /// The number of static parameters provided in the staticParams array. + /// this number has to match the number provided by the UDO Registration library information + uint32_t numOfStaticParams; + /// Array of static parameters + SnpeUdo_Param_t* staticParams; + /// The number of input parameters provided in inputs array. + /// this number has to match the number provided by the UDO Registration library information + uint32_t numOfInputs; + /// Array of input tensors, providing layout, data type, sizes, etc + /// When used to create an operation, also contains the initial location of the data + SnpeUdo_TensorParam_t* inputs; + /// The number of output parameters provided in inputs array. + /// this number has to match the number provided by the UDO Registration library information + uint32_t numOfOutputs; + /// Array of output tensors, providing layout, data type, sizes, etc + /// When used to create an operation, also contains the initial location of the data + SnpeUdo_TensorParam_t* outputs; +} SnpeUdo_OpDefinition_t; + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif //SNPE_UDO_BASE_H diff --git a/third_party/snpe/include/SnpeUdo/UdoImpl.h b/third_party/snpe/include/SnpeUdo/UdoImpl.h new file mode 100644 index 000000000..bd29bc251 --- /dev/null +++ b/third_party/snpe/include/SnpeUdo/UdoImpl.h @@ -0,0 +1,323 @@ +//============================================================================== +// +// Copyright (c) 2019-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef SNPE_UDO_IMPL_H +#define SNPE_UDO_IMPL_H + +#include + +#include "SnpeUdo/UdoShared.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +typedef struct _SnpeUdo_OpFactory_t* SnpeUdo_OpFactory_t; +typedef struct _SnpeUdo_Operation_t* SnpeUdo_Operation_t; + +/** + * @brief Initialize the shared library's data structures. Calling any other + * library function before this one will result in error. + * + * @param[in] globalInfrastructure Global core-specific infrastructure to be + * used by operations created in this library. The definition and + * semantics of this object will be defined in the corresponding + * implementation header for the core type. + * @return Error code + */ +SnpeUdo_ErrorType_t +SnpeUdo_initImplLibrary(void* globalInfrastructure); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_InitImplLibraryFunction_t)(void*); + +/** + * @brief A function to query the API version of the UDO implementation library. + * The function populates a SnpeUdo_LibVersion_t struct, which contains a SnpeUdo_Version_t + * struct for API version and library version. + * + * @param[in, out] version A pointer to struct which contains major, minor, teeny information for + * library and api versions. + * + * @return Error code + */ +SnpeUdo_ErrorType_t +SnpeUdo_getImplVersion(SnpeUdo_LibVersion_t** version); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_getImplVersion_t)(SnpeUdo_LibVersion_t** version); + +/** + * @brief Release the shared library's data structures, and invalidate any + * handles returned by the library. The behavior of any outstanding + * asynchronous calls made to this library when this function is called + * are undefined. All library functions (except SnpeUdo_initImplLibrary) will + * return an error after this function has been successfully called. + * + * It should be possible to call SnpeUdo_initImplLibrary after calling this + * function, and re-initialize the library. + * + * @return Error code + */ +SnpeUdo_ErrorType_t +SnpeUdo_terminateImplLibrary(void); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_TerminateImplLibraryFunction_t)(void); + + +/** + * @brief A function to query info on the UDO implementation library. + * The function populates a structure which contains information about + * operations that are part of this library + * + * @param[in, out] implementationInfo A pointer to struct which contains information + * on the operations + * + * @return error code + * + */ +SnpeUdo_ErrorType_t +SnpeUdo_getImpInfo(SnpeUdo_ImpInfo_t** implementationInfo); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_GetImpInfoFunction_t)(SnpeUdo_ImpInfo_t** implementationInfo); + +/** + * @brief A function to create an operation factory. + * The function receives the operation type, and an array of static parameters, + * and returns operation factory handler + * + * @param[in] udoCoreType The Core type to create the operation on. An error will + * be returned if this does not match the core type of the library. + * + * @param[in] perFactoryInfrastructure CreateOpFactory infrastructure appropriate to this + * core type. The definition and semantics of this object will be defined + * in the corresponding implementation header for the core type. + * + * @param[in] operationType A string containing Operation type. for example "MY_CONV" + * + * @param[in] numOfStaticParams The number of static parameters. + * + * @param[in] staticParams Array of static parameters + * + * @param[in,out] opFactory Handler to Operation Factory, to be used when creating operations + * + * @return Error Code + */ +SnpeUdo_ErrorType_t +SnpeUdo_createOpFactory(SnpeUdo_CoreType_t udoCoreType, + void* perFactoryInfrastructure, + SnpeUdo_String_t operationType, + uint32_t numOfStaticParams, + SnpeUdo_Param_t* staticParams, + SnpeUdo_OpFactory_t* opFactory); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_CreateOpFactoryFunction_t)(SnpeUdo_CoreType_t, + void*, + SnpeUdo_String_t, + uint32_t, + SnpeUdo_Param_t*, + SnpeUdo_OpFactory_t*); + + +/** + * @brief A function to release the resources allocated for an operation factory + * created by this library. + * + * @param[in] factory The operation factory to release. Upon success this handle will be invalidated. + * + * @return Error Code + */ +SnpeUdo_ErrorType_t +SnpeUdo_releaseOpFactory(SnpeUdo_OpFactory_t opFactory); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_ReleaseOpFactoryFunction_t)(SnpeUdo_OpFactory_t); + +/** + * @brief A function to create an operation from the factory. + * The function receives array of inputs and array of outputs, and creates an operation + * instance, returning the operation instance handler. + * + * @param[in] opFactory OpFactory instance containing the parameters for this operation. + * + * @param[in] perOpInfrastructure Per-Op infrastructure for this operation. The definition + * and semantics of this object will be defined in the implementation header + * appropriate to this core type. + * + * @param[in] numOfInputs The number of input tensors this operation will receive. + * + * @param[in] inputs Array of input tensors, providing both the sizes and initial + * location of the data. + * + * @param[in] numOfOutputs Number of output tensors this operation will produce. + * + * @param[in] outputs Array of output tensors, providing both the sizes and + * initial location of the data. + * + * @param[in,out] operation Handle for newly created operation instance. + * + * @return Error Code + */ +SnpeUdo_ErrorType_t +SnpeUdo_createOperation(SnpeUdo_OpFactory_t opFactory, + void* perOpInfrastructure, + uint32_t numOfInputs, + SnpeUdo_TensorParam_t* inputs, + uint32_t numOfOutputs, + SnpeUdo_TensorParam_t* outputs, + SnpeUdo_Operation_t* operation); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_CreateOperationFunction_t)(SnpeUdo_OpFactory_t, + void*, + uint32_t, + SnpeUdo_TensorParam_t*, + uint32_t, + SnpeUdo_TensorParam_t*, + SnpeUdo_Operation_t*); + +/** + * @brief A pointer to notification function. + * + * The notification function supports the non-blocking (e.g. asynchronous) execution use-case. + * In case an "executeUdoOp" function is called with "blocking" set to zero, and a + * notify function, this function will be called by the implementation library at the + * end of execution. The implementation library will pass the notify function the ID + * that was provided to it when "executeUdoOp" was called. + * + * @param[in] ID 32-bit value, that was provided to executeUdoOp by the calling entity. + * Can be used to track the notifications, in case of multiple execute calls issued. + * + * @return Error code + * + */ +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_ExternalNotify_t)(const uint32_t ID); + +/** + * @brief Operation execution function. + * + * Calling this function will run the operation on set of inputs, generating a set of outputs. + * The call can be blocking (synchronous) or non-blocking (asynchronous). To support the + * non-blocking mode, the calling entity can pass an ID and a notification function. + * At the end of the execution this notification function would be called, passing it the ID. + * NOTE: Asynchronous execution mode not supported in this release. + * + * @param[in] operation handle to the operation on which execute is invoked + * @param[in] blocking flag to indicate execution mode. + * If set, execution is blocking, + * e.g SnpeUdo_executeOp call does not return until execution is done. + * If not set, SnpeUdo_executeOp returns immediately, and the + * library will call the notification function (if set) when execution is done. + * + * @param[in] ID 32-bit number that can be used by the calling entity to track execution + * in case of non-blocking execution. + * For example, it can be a sequence number, increased by one on each call. + * + * @param[in] notifyFunc Pointer to notification function. if the pointer is set, and execution is + * non-blocking, the library will call this function at end of execution, + * passing the number provided as ID + * + * @return Error code + * + */ +SnpeUdo_ErrorType_t +SnpeUdo_executeOp(SnpeUdo_Operation_t operation, + bool blocking, + const uint32_t ID, + SnpeUdo_ExternalNotify_t notifyFunc); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_ExecuteOpFunction_t)(SnpeUdo_Operation_t, + bool, + const uint32_t, + SnpeUdo_ExternalNotify_t); + +/** + * @brief A function to setting the inputs & outputs. part of SnpeUdo_Operation struct, + * returned from creation of a new operation instance. + * Not supported in this release. + * + * This function allows the calling entity to change some of the inputs and outputs + * between calls to execute. + * Note that the change is limited to changing the pointer to the tensor data only. + * Any other change may be rejected by the implementation library, causing + * immediate invalidation of the operation instance + * + * @param[in] operation Operation on which IO tensors are set + * + * @param[in] inputs array of tensor parameters. The calling entity may provide a subset of the + * operation inputs, providing only those that it wants to change. + * + * @param[in] outputs array of tensor parameters. The calling entity may provide a subset of the + * operation outputs, providing only those that it wants to change. + * + * @return Error code + * + */ +SnpeUdo_ErrorType_t +SnpeUdo_setOpIO(SnpeUdo_Operation_t operation, + SnpeUdo_TensorParam_t* inputs, + SnpeUdo_TensorParam_t* outputs); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_SetOpIOFunction_t)(SnpeUdo_Operation_t, + SnpeUdo_TensorParam_t*, + SnpeUdo_TensorParam_t*); + +/** + * @brief A function to return execution times. + * + * This function can be called to query the operation execution times on the IP core + * on which the operation is run. The time is provided in micro-seconds + * + * @param[in] operation Handle to operation whose execution time is being profiled + * + * @param[in,out] executionTime pointer to a uint32 value.This function writes the operation + * execution time in usec into this value. + * + * @return Error code + * + */ +SnpeUdo_ErrorType_t +SnpeUdo_profileOp(SnpeUdo_Operation_t operation, uint32_t *executionTime); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_ProfileOpFunction_t)(SnpeUdo_Operation_t, uint32_t*); + +/** + * @brief A function to release the operation instance + * \n When it is called, the implementation library needs to release all resources + * allocated for this operation instance. + * \n Note that all function pointers which are part of SnpeUdo_Operation become + * invalid once releaseUdoOp call returns. + * + * @param[in] operation Handle to operation to be released + * @return Error code + * + */ +SnpeUdo_ErrorType_t +SnpeUdo_releaseOp(SnpeUdo_Operation_t operation); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_ReleaseOpFunction_t)(SnpeUdo_Operation_t); + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif //SNPE_UDO_IMPL_H diff --git a/third_party/snpe/include/SnpeUdo/UdoImplCpu.h b/third_party/snpe/include/SnpeUdo/UdoImplCpu.h new file mode 100644 index 000000000..3bbe0638e --- /dev/null +++ b/third_party/snpe/include/SnpeUdo/UdoImplCpu.h @@ -0,0 +1,44 @@ +//============================================================================== +// +// Copyright (c) 2019-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +// Header to be used by a CPU UDO Implementation library + +#ifndef SNPE_UDO_IMPL_CPU_H +#define SNPE_UDO_IMPL_CPU_H + +#include + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief This struct provides the infrastructure needed by a developer of + * CPU UDO Implementation library. + * + * The framework/runtime which loads the CPU UDO implementation library provides + * this infrastructure data to the loaded library at the time of op factory creation. + * as an opaque pointer. It contains hooks for the UDO library to invoke supported + * functionality at the time of execution + * + * @param getData function pointer to retrieve raw tensor data from opaque pointer + * passed into the UDO when creating an instance. + * @param getDataSize function pointer to retrieve tensor data size from opaque pointer + */ + +typedef struct +{ + /// function pointer to retrieve raw tensor data from opaque pointer + /// passed into the UDO when creating an instance. + float* (*getData)(void*); + /// function pointer to retrieve tensor data size from opaque pointer + size_t (*getDataSize) (void*); +} SnpeUdo_CpuInfrastructure_t; + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif // SNPE_UDO_IMPL_CPU_H \ No newline at end of file diff --git a/third_party/snpe/include/SnpeUdo/UdoImplDsp.h b/third_party/snpe/include/SnpeUdo/UdoImplDsp.h new file mode 100644 index 000000000..7e85bf15d --- /dev/null +++ b/third_party/snpe/include/SnpeUdo/UdoImplDsp.h @@ -0,0 +1,187 @@ +//============================================================================== +// +// Copyright (c) 2019-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +//============================================================================== +/* + * THIS HEADER FILE IS COPIED FROM HEXAGON-NN PROJECT + * + */ +//============================================================================== + + +// Header to be used by a DSP Hexnn UDO Implementation library + +#ifndef SNPE_UDO_IMPL_DSP_H +#define SNPE_UDO_IMPL_DSP_H +#include +#include "SnpeUdo/UdoImpl.h" + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief A function to validate that a set of params is supported by an operation + * This function is HexNN specific, use case is when registration library is not in use. + * Optional function. + * + * @param[in] operationType Operation type + * @param[in] numOfStaticParams Number of static params defined by the op + * @param[in] staticParams Array of static params to the op + * @return Error code, indicating if the operation can be created on this set of configuration or not. + * + */ + +SnpeUdo_ErrorType_t +SnpeUdo_validateOperation (SnpeUdo_String_t operationType, + uint32_t numOfStaticParams, + const SnpeUdo_Param_t* staticParams); + +typedef SnpeUdo_ErrorType_t (*SnpeUdo_ValidateOperationFunction_t) (SnpeUdo_String_t, + uint32_t, + const SnpeUdo_Param_t*); + + +// enum used for indicating input/outout tensor data layouts on DSP, plain vs d32 +typedef enum { + SNPE_UDO_DSP_TENSOR_LAYOUT_PLAIN, + SNPE_UDO_DSP_TENSOR_LAYOUT_D32 +} SnpeUdo_HexNNTensorLayout_t; + +/** + * @brief A function to query numbers of inputs and outputs, + * quantization type of each input and each output as arrays, + * and data layout (plain vs d32) of each input and each output as arrays + * of an operation. + * inputsQuantTypes and inputsLayouts should point to arrays of size numOfInputs + * outputsQuantTypes and outputsLayouts should point to arrays of size numOfOutputs + * + * Note: inputsLayouts and inputsLayouts can point to NULL, in this case, it is + * assumed all inputs and/or outputs have plain data layouts, i.e. no D32 + * + * @param[in] operationType Operation type + * @param[in] numOfStaticParams Number of static params defined by the op + * @param[in] staticParams Array of static params to the op + * @param[in,out] numOfInputs Number of input tensors to the op + * @param[in,out] inputsQuantTypes Array of Quantization info for each input tensor + * @param[in,out] inputsLayouts Array of layout type for each input tensor + * @param[in,out] numOfOutputs Number of output tensors to the op + * @param[in,out] outputsQuantTypes Array of Quantization info for each output tensor + * @param[in,out] outputsLayouts Array of layout type for each output tensor + * @return error code, indicating status of query + */ + +SnpeUdo_ErrorType_t +SnpeUdo_queryOperation (SnpeUdo_String_t operationType, + uint32_t numOfStaticParams, + const SnpeUdo_Param_t* staticParams, + uint32_t* numOfInputs, + SnpeUdo_QuantizationType_t** inputsQuantTypes, + SnpeUdo_HexNNTensorLayout_t** inputsLayouts, + uint32_t* numOfOutputs, + SnpeUdo_QuantizationType_t** outputsQuantTypes, + SnpeUdo_HexNNTensorLayout_t** outputsLayouts); + +typedef SnpeUdo_ErrorType_t (*SnpeUdo_QueryOperationFunction_t) (SnpeUdo_String_t, + uint32_t, + const SnpeUdo_Param_t*, + uint32_t*, + SnpeUdo_QuantizationType_t**, + SnpeUdo_HexNNTensorLayout_t**, + uint32_t*, + SnpeUdo_QuantizationType_t**, + SnpeUdo_HexNNTensorLayout_t**); + + + +// Global infrastructure functions supported by Hexagon-NN v2 +typedef void (*workerThread_t) (void* perOpInfrastructure, void* userData); +typedef int (*udoSetOutputTensorSize_t) (void* perOpInfrastructure, uint32_t outIdx, uint32_t size); +typedef int (*udoGetInputD32Paddings_t) (void* perOpInfrastructure, uint32_t inIdx, + uint32_t* heightPadBefore, uint32_t* heightPadAfter, + uint32_t* widthPadBefore, uint32_t* widthPadAfter, + uint32_t* depthPadBefore, uint32_t* depthPadAfter); +typedef int (*udoSetOutputD32ShapeSizePaddings_t) (void* perOpInfrastructure, uint32_t outIdx, + uint32_t batch, + uint32_t height, uint32_t heightPadBefore, uint32_t heightPadAfter, + uint32_t width, uint32_t widthPadBefore, uint32_t widthPadAfter, + uint32_t depth, uint32_t depthPadBefore, uint32_t depthPadAfter, + SnpeUdo_DataType_t dataType); +typedef void* (*udoMemalign_t) (size_t n, size_t size); +typedef void* (*udoMalloc_t) (size_t size); +typedef void* (*udoCalloc_t) (size_t n, size_t size); +typedef void (*udoFree_t) (void* ptr); +typedef uint32_t (*udoGetVtcmSize_t) (void* perOpInfrastructure); +typedef void* (*udoGetVtcmPtr_t) (void* perOpInfrastructure); +typedef uint32_t (*udoVtcmIsReal_t) (void* perOpInfrastructure); +typedef void (*udoRunWorkerThreads_t) (void* perOpInfrastructure, uint32_t nThreads, workerThread_t w, void* userData); + +typedef struct hexNNv2GlobalInfra { + udoSetOutputTensorSize_t udoSetOutputTensorSize; + udoGetInputD32Paddings_t udoGetInputD32Paddings; + udoSetOutputD32ShapeSizePaddings_t udoSetOutputD32ShapeSizePaddings; + udoMemalign_t udoMemalign; + udoMalloc_t udoMalloc; + udoCalloc_t udoCalloc; + udoFree_t udoFree; + udoGetVtcmSize_t udoGetVtcmSize; + udoGetVtcmPtr_t udoGetVtcmPtr; + udoVtcmIsReal_t udoVtcmIsReal; + udoRunWorkerThreads_t udoRunWorkerThreads; +} SnpeUdo_HexNNv2GlobalInfra_t; + +// hexnn types +typedef enum hexnnInfraType { + UDO_INFRA_HEXNN_V2, + UDO_INFRA_HEXNN_V3 // reserved, do not use +} SnpeUdo_HexNNInfraType_t; + + +/** + * @brief Infrastructures needed by a developer of DSP Hexnn UDO Implementation library. + * + * The framework/runtime which loads the Hexnn UDO implementation library provides + * this infrastructure to the loaded library by calling "SnpeUdo_initImplLibrary" + * function, and passing it (cast to void*). The Hexnn UDO library is expected + * to cast it back to this structure. + * + */ +typedef struct dspGlobalInfrastructure { + SnpeUdo_Version_t dspInfraVersion; // api version + SnpeUdo_HexNNInfraType_t infraType; + SnpeUdo_HexNNv2GlobalInfra_t hexNNv2Infra; +} SnpeUdo_DspGlobalInfrastructure_t; + + +/** + * hexnn v2 per op factory infrastructure + * + * The framework/runtime passes per op factory infrastructure as a void pointer + * to HexNN UDO implementation library by calling function "SnpeUdo_createOpFactory". + * UDO implementation library is expected to cast it back to this following struct. + * + */ +typedef struct hexnnv2OpFactoryInfra { + unsigned long graphId; +} SnpeUdo_HexNNv2OpFactoryInfra_t; + + +/** + * hexnn v2 per operation infrastructure + * + * The framework/runtime passes per operation infrastructure as a void pointer + * to HexNN UDO implementation library by calling function "SnpeUdo_createOperation". + * UDO implementation library is expected to cast it to the following type and save it. + * + * This is needed to be passed back into some functions from global infrastructure. + * + */ +typedef void* SnpeUdo_HexNNv2OpInfra_t; + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif // SNPE_UDO_IMPL_DSP_H diff --git a/third_party/snpe/include/SnpeUdo/UdoImplGpu.h b/third_party/snpe/include/SnpeUdo/UdoImplGpu.h new file mode 100644 index 000000000..1af654d11 --- /dev/null +++ b/third_party/snpe/include/SnpeUdo/UdoImplGpu.h @@ -0,0 +1,112 @@ +//============================================================================== +// +// Copyright (c) 2019-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +// Header to be used by a GPU UDO Implementation library + +#ifndef SNPE_UDO_IMPL_GPU_H +#define SNPE_UDO_IMPL_GPU_H + +#include "CL/cl.h" +#include "SnpeUdo/UdoBase.h" + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * This header defines version 0.0.0 of the GPU UDO Infrastructure. + * It defines the interpretation of the global and per-OpFactory infrastructure pointers + * as well as the interpretation of tensorData pointers. + * + * The per-Operation infrastructure pointer is defined to be null, and should not be used. + * + * The SnpeUdoTensorParam_t struct below provides the interpretation for + * the tensorData opaque pointer for SnpeUdoTensorParams representing inputs or outputs. + * + * The tensorData opaque pointer populated in SnpeUdoScalarParam_t structs should be interpreted + * as a host-readable data pointer. + * + */ + +/** + * @brief Function to retrieve opencl program from Program Cache repository. + * @param programCache is opaque pointer to Program Cache repository provided by + * SNPE GPU UDO runtime. + * @param programName is name associated with opencl program for UDO. + * @param program is pointer to opencl program which will be populated with + * valid opencl program if found in Program Cache repository. + * @return SnpeUdo_ErrorType_t is error type returned. SNPE_UDO_NO_ERROR is returned + * on success. + */ +typedef SnpeUdo_ErrorType_t (*SnpeUdo_getProgram_t) + (void* programCache, const char* programName, cl_program* program); + +/** + * @brief Function to store valid opencl program in Program Cache repository. + * @param programCache is opaque pointer to Program Cache repository provided by + * SNPE GPU UDO runtime. + * @param programName is name associated with opencl program for UDO. + * @param program is valid opencl program after program is built. + * @return SnpeUdo_ErrorType_t is error type returned. SNPE_UDO_NO_ERROR is returned + * on success. + * */ +typedef SnpeUdo_ErrorType_t (*SnpeUdo_storeProgram_t) + (void* programCache, const char * programName, cl_program program); + +/** + * @brief Global Infrastructure Definition for GPU UDO Implementations. + */ +typedef struct { + // Infrastructure definition version. This header is 0.0.0 + SnpeUdo_Version_t gpuInfraVersion; + SnpeUdo_getProgram_t SnpeUdo_getProgram; + SnpeUdo_storeProgram_t SnpeUdo_storeProgram; +} SnpeUdo_GpuInfrastructure_t; + +/** + * @brief Per OpFactory Infrastructure Definition for GPU UDO Implementations. + * @note This version of the infrastructure definition guarantees that the same + * Per OpFactory infrastructure pointer will be provided to all OpFactories + * in the same network. + */ +typedef struct +{ + cl_context context; + cl_command_queue commandQueue; + void* programCache; +} SnpeUdo_GpuOpFactoryInfrastructure_t; + +/** + * @brief Opaque tensorData definition for operation inputs and outputs. + * + * The following is a list of all SnpeUdoTensorLayout_t values supported by the + * GPU UDO implementation, and how the parameters of the struct should be + * interpreted in each case: + * + * SNPE_UDO_LAYOUT_NHWC: + * mem shall be single-element array, pointing to a cl buffer memory object. + * the dimensions of this object match the dimensions specified in the encompassing + * SnpeUdoTensorParam_t's currDimensions. + * + * memCount shall be 1. + * + * paddedRank and paddedDimensions are undefined and shall be ignored by the UDO + * implementation. + * + */ +typedef struct +{ + cl_mem* mem; + uint32_t memCount; + uint32_t paddedRank; + uint32_t* paddedDimensions; + +} SnpeUdo_GpuTensorData_t; + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif // SNPE_UDO_IMPL_GPU_H diff --git a/third_party/snpe/include/SnpeUdo/UdoReg.h b/third_party/snpe/include/SnpeUdo/UdoReg.h new file mode 100644 index 000000000..a5d239883 --- /dev/null +++ b/third_party/snpe/include/SnpeUdo/UdoReg.h @@ -0,0 +1,108 @@ +//============================================================================== +// +// Copyright (c) 2019-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef SNPE_UDO_REG_H +#define SNPE_UDO_REG_H + +#include "SnpeUdo/UdoShared.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief Initialize the shared library's data structures. Calling any other + * library function before this one will result in an error being returned. + * + * @return Error code + */ +SnpeUdo_ErrorType_t +SnpeUdo_initRegLibrary(void); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_InitRegLibraryFunction_t)(void); + +/** + * @brief A function to query the API version of the UDO registration library. + * The function populates a SnpeUdo_LibVersion_t struct, which contains a SnpeUdo_Version_t + * struct for API version and library version. + * + * @param[in, out] version A pointer to struct which contains major, minor, teeny information for + * library and api versions. + * + * @return Error code + */ +SnpeUdo_ErrorType_t +SnpeUdo_getRegLibraryVersion(SnpeUdo_LibVersion_t** version); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_getRegLibraryVersion_t)(SnpeUdo_LibVersion_t** version); + +/** + * @brief Release the shared library's data structures, and invalidate any + * handles returned by the library. The behavior of any outstanding + * asynchronous calls made to this library when this function is called + * are undefined. All library functions (except SnpeUdo_InitRegLibrary) will + * return an error after this function has been successfully called. + * + * It should be possible to call SnpeUdo_InitRegLibrary after calling this + * function, and re-initialize the library. + * + * @return Error code + */ +SnpeUdo_ErrorType_t +SnpeUdo_terminateRegLibrary(void); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_TerminateRegLibraryFunction_t)(void); + + +/** + * @brief A function to query the info on the UDO set. + * The function populates a structure which contains information about + * the package and operations contained in it. + * + * @param[in, out] registrationInfo A struct which contains information on the set of UDOs + * + * @return Error code + * + */ +SnpeUdo_ErrorType_t +SnpeUdo_getRegInfo(SnpeUdo_RegInfo_t** registrationInfo); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_GetRegInfoFunction_t)(SnpeUdo_RegInfo_t** registrationInfo); + +/** + * @brief A function to validate that a set of params is supported by an operation + * The function receives an operation definition struct, and returns if this configuration is + * supported (e.g. if an operation can be created using this configuration) + * + * @param[in] opDefinition A struct of SnpeUdo_OpDefinition type, containing the information needed to + * validate that an operation can be created with this configuration. + * + * @return Error code, indicating is the operation can be created on this set or not. + * + */ +SnpeUdo_ErrorType_t +SnpeUdo_validateOperation(SnpeUdo_OpDefinition_t* opDefinition); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_ValidateOperationFunction_t)(SnpeUdo_OpDefinition_t* opDefinition); + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif //SNPE_UDO_REG_H diff --git a/third_party/snpe/include/SnpeUdo/UdoShared.h b/third_party/snpe/include/SnpeUdo/UdoShared.h new file mode 100644 index 000000000..6fd50c318 --- /dev/null +++ b/third_party/snpe/include/SnpeUdo/UdoShared.h @@ -0,0 +1,46 @@ +//============================================================================== +// +// Copyright (c) 2019-2020 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================== + +#ifndef SNPE_UDO_SHARED_H +#define SNPE_UDO_SHARED_H + +#include "SnpeUdo/UdoBase.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief A function to return the various versions as they relate to the UDO + * The function returns a struct containing the the following: + * libVersion: the version of the implementation library compiled for the UDO. Set by user + * apiVersion: the version of the UDO API used in compiling the implementation library. + * Set by SNPE + * + * @param[in, out] version A pointer to Version struct of type SnpeUdo_LibVersion_t + * + * @return Error code + * + */ +SnpeUdo_ErrorType_t +SnpeUdo_getVersion (SnpeUdo_LibVersion_t** version); + +typedef SnpeUdo_ErrorType_t +(*SnpeUdo_GetVersionFunction_t) (SnpeUdo_LibVersion_t** version); + +#ifdef __cplusplus +} // extern "C" +#endif + +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +#endif // SNPE_UDO_SHARED_H diff --git a/third_party/snpe/larch64 b/third_party/snpe/larch64 new file mode 120000 index 000000000..e5c222b1c --- /dev/null +++ b/third_party/snpe/larch64 @@ -0,0 +1 @@ +aarch64-linux-gcc4.9 \ No newline at end of file diff --git a/third_party/zlib/build.txt b/third_party/zlib/build.txt new file mode 100644 index 000000000..b67f9cd57 --- /dev/null +++ b/third_party/zlib/build.txt @@ -0,0 +1,5 @@ +# with neos tree +cd ~/android/system +mka libz + +cp ~/android/system/out/target/product/oneplus3/obj/STATIC_LIBRARIES/libz_intermediates/libz.a lib/ diff --git a/third_party/zlib/lib/libz.a b/third_party/zlib/lib/libz.a new file mode 100644 index 000000000..d2170d8b8 Binary files /dev/null and b/third_party/zlib/lib/libz.a differ diff --git a/tools/lib/README.md b/tools/lib/README.md new file mode 100644 index 000000000..c681809ea --- /dev/null +++ b/tools/lib/README.md @@ -0,0 +1,33 @@ +## LogReader + +Route is a class for conviently accessing all the [logs](/selfdrive/loggerd/) from your routes. The LogReader class reads the non-video logs, i.e. rlog.bz2 and qlog.bz2. There's also a matching FrameReader class for reading the videos. + +```python +from tools.lib.route import Route +from tools.lib.logreader import LogReader + +r = Route("4cf7a6ad03080c90|2021-09-29--13-46-36") + +# get a list of paths for the route's rlog files +print(r.log_paths()) + +# and road camera (fcamera.hevc) files +print(r.camera_paths()) + +# setup a LogReader to read the route's first rlog +lr = LogReader(r.log_paths()[0]) + +# print out all the messages in the log +import codecs +codecs.register_error("strict", codecs.backslashreplace_errors) +for msg in lr: + print(msg) + +# setup a LogReader for the route's second qlog +lr = LogReader(r.log_paths()[1]) + +# print all the steering angles values from the log +for msg in lr: + if msg.which() == "carState": + print(msg.carState.steeringAngleDeg) +``` diff --git a/tools/lib/__init__.py b/tools/lib/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tools/lib/api.py b/tools/lib/api.py new file mode 100644 index 000000000..6ff9242f2 --- /dev/null +++ b/tools/lib/api.py @@ -0,0 +1,34 @@ +import os +import requests +API_HOST = os.getenv('API_HOST', 'https://api.commadotai.com') + +class CommaApi(): + def __init__(self, token=None): + self.session = requests.Session() + self.session.headers['User-agent'] = 'OpenpilotTools' + if token: + self.session.headers['Authorization'] = 'JWT ' + token + + def request(self, method, endpoint, **kwargs): + resp = self.session.request(method, API_HOST + '/' + endpoint, **kwargs) + resp_json = resp.json() + if isinstance(resp_json, dict) and resp_json.get('error'): + if resp.status_code in [401, 403]: + raise UnauthorizedError('Unauthorized. Authenticate with tools/lib/auth.py') + + e = APIError(str(resp.status_code) + ":" + resp_json.get('description', str(resp_json['error']))) + e.status_code = resp.status_code + raise e + return resp_json + + def get(self, endpoint, **kwargs): + return self.request('GET', endpoint, **kwargs) + + def post(self, endpoint, **kwargs): + return self.request('POST', endpoint, **kwargs) + +class APIError(Exception): + pass + +class UnauthorizedError(Exception): + pass diff --git a/tools/lib/auth.py b/tools/lib/auth.py new file mode 100755 index 000000000..0e9e7705b --- /dev/null +++ b/tools/lib/auth.py @@ -0,0 +1,145 @@ +#!/usr/bin/env python3 +""" +Usage:: + + usage: auth.py [-h] [{google,apple,github,jwt}] [jwt] + + Login to your comma account + + positional arguments: + {google,apple,github,jwt} + jwt + + optional arguments: + -h, --help show this help message and exit + + +Examples:: + + ./auth.py # Log in with google account + ./auth.py github # Log in with GitHub Account + ./auth.py jwt ey......hw # Log in with a JWT from https://jwt.comma.ai, for use in CI +""" + +import argparse +import sys +import pprint +import webbrowser +from http.server import BaseHTTPRequestHandler, HTTPServer +from typing import Any, Dict +from urllib.parse import parse_qs, urlencode + +from tools.lib.api import APIError, CommaApi, UnauthorizedError +from tools.lib.auth_config import set_token, get_token + +PORT = 3000 + + +class ClientRedirectServer(HTTPServer): + query_params: Dict[str, Any] = {} + + +class ClientRedirectHandler(BaseHTTPRequestHandler): + def do_GET(self): + if not self.path.startswith('/auth'): + self.send_response(204) + return + + query = self.path.split('?', 1)[-1] + query = parse_qs(query, keep_blank_values=True) + self.server.query_params = query + + self.send_response(200) + self.send_header('Content-type', 'text/plain') + self.end_headers() + self.wfile.write(b'Return to the CLI to continue') + + def log_message(self, format, *args): # pylint: disable=redefined-builtin + pass # this prevent http server from dumping messages to stdout + + +def auth_redirect_link(method): + provider_id = { + 'google': 'g', + 'apple': 'a', + 'github': 'h', + }[method] + + params = { + 'redirect_uri': f"https://api.comma.ai/v2/auth/{provider_id}/redirect/", + 'state': f'service,localhost:{PORT}', + } + + if method == 'google': + params.update({ + 'type': 'web_server', + 'client_id': '45471411055-ornt4svd2miog6dnopve7qtmh5mnu6id.apps.googleusercontent.com', + 'response_type': 'code', + 'scope': 'https://www.googleapis.com/auth/userinfo.email', + 'prompt': 'select_account', + }) + return 'https://accounts.google.com/o/oauth2/auth?' + urlencode(params) + elif method == 'github': + params.update({ + 'client_id': '28c4ecb54bb7272cb5a4', + 'scope': 'read:user', + }) + return 'https://github.com/login/oauth/authorize?' + urlencode(params) + elif method == 'apple': + params.update({ + 'client_id': 'ai.comma.login', + 'response_type': 'code', + 'response_mode': 'form_post', + 'scope': 'name email', + }) + return 'https://appleid.apple.com/auth/authorize?' + urlencode(params) + else: + raise NotImplementedError(f"no redirect implemented for method {method}") + + +def login(method): + oauth_uri = auth_redirect_link(method) + + web_server = ClientRedirectServer(('localhost', PORT), ClientRedirectHandler) + print(f'To sign in, use your browser and navigate to {oauth_uri}') + webbrowser.open(oauth_uri, new=2) + + while True: + web_server.handle_request() + if 'code' in web_server.query_params: + break + elif 'error' in web_server.query_params: + print('Authentication Error: "{}". Description: "{}" '.format( + web_server.query_params['error'], + web_server.query_params.get('error_description')), file=sys.stderr) + break + + try: + auth_resp = CommaApi().post('v2/auth/', data={'code': web_server.query_params['code'], 'provider': web_server.query_params['provider']}) + set_token(auth_resp['access_token']) + except APIError as e: + print(f'Authentication Error: {e}', file=sys.stderr) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Login to your comma account') + parser.add_argument('method', default='google', const='google', nargs='?', choices=['google', 'apple', 'github', 'jwt']) + parser.add_argument('jwt', nargs='?') + + args = parser.parse_args() + if args.method == 'jwt': + if args.jwt is None: + print("method JWT selected, but no JWT was provided") + exit(1) + + set_token(args.jwt) + else: + login(args.method) + + try: + me = CommaApi(token=get_token()).get('/v1/me') + print("Authenticated!") + pprint.pprint(me) + except UnauthorizedError: + print("Got invalid JWT") + exit(1) diff --git a/tools/lib/auth_config.py b/tools/lib/auth_config.py new file mode 100644 index 000000000..1699d94e5 --- /dev/null +++ b/tools/lib/auth_config.py @@ -0,0 +1,34 @@ +import json +import os +from common.file_helpers import mkdirs_exists_ok +from selfdrive.hardware import PC + + +class MissingAuthConfigError(Exception): + pass + + +if PC: + CONFIG_DIR = os.path.expanduser('~/.comma') +else: + CONFIG_DIR = "/tmp/.comma" + +mkdirs_exists_ok(CONFIG_DIR) + + +def get_token(): + try: + with open(os.path.join(CONFIG_DIR, 'auth.json')) as f: + auth = json.load(f) + return auth['access_token'] + except Exception: + return None + + +def set_token(token): + with open(os.path.join(CONFIG_DIR, 'auth.json'), 'w') as f: + json.dump({'access_token': token}, f) + + +def clear_token(): + os.unlink(os.path.join(CONFIG_DIR, 'auth.json')) diff --git a/tools/lib/bootlog.py b/tools/lib/bootlog.py new file mode 100644 index 000000000..dc1cf35c5 --- /dev/null +++ b/tools/lib/bootlog.py @@ -0,0 +1,48 @@ +import datetime +import functools +import re + +from tools.lib.auth_config import get_token +from tools.lib.api import CommaApi +from tools.lib.helpers import RE, timestamp_to_datetime + + +@functools.total_ordering +class Bootlog: + def __init__(self, url: str): + self._url = url + + r = re.search(RE.BOOTLOG_NAME, url) + if not r: + raise Exception(f"Unable to parse: {url}") + + self._dongle_id = r.group('dongle_id') + self._timestamp = r.group('timestamp') + + @property + def url(self) -> str: + return self._url + + @property + def dongle_id(self) -> str: + return self._dongle_id + + @property + def timestamp(self) -> str: + return self._timestamp + + @property + def datetime(self) -> datetime.datetime: + return timestamp_to_datetime(self._timestamp) + + def __eq__(self, b) -> bool: + return self.datetime == b.datetime + + def __lt__(self, b) -> bool: + return self.datetime < b.datetime + + +def get_bootlogs(dongle_id: str): + api = CommaApi(get_token()) + r = api.get(f'v1/devices/{dongle_id}/bootlogs') + return [Bootlog(b) for b in r] diff --git a/tools/lib/cache.py b/tools/lib/cache.py new file mode 100644 index 000000000..82b229873 --- /dev/null +++ b/tools/lib/cache.py @@ -0,0 +1,15 @@ +import os +import urllib.parse +from common.file_helpers import mkdirs_exists_ok + +DEFAULT_CACHE_DIR = os.path.expanduser("~/.commacache") + +def cache_path_for_file_path(fn, cache_prefix=None): + dir_ = os.path.join(DEFAULT_CACHE_DIR, "local") + mkdirs_exists_ok(dir_) + fn_parsed = urllib.parse.urlparse(fn) + if fn_parsed.scheme == '': + cache_fn = os.path.abspath(fn).replace("/", "_") + else: + cache_fn = f'{fn_parsed.hostname}_{fn_parsed.path.replace("/", "_")}' + return os.path.join(dir_, cache_fn) diff --git a/tools/lib/exceptions.py b/tools/lib/exceptions.py new file mode 100644 index 000000000..41de2e864 --- /dev/null +++ b/tools/lib/exceptions.py @@ -0,0 +1,2 @@ +class DataUnreadableError(Exception): + pass diff --git a/tools/lib/filereader.py b/tools/lib/filereader.py new file mode 100644 index 000000000..4ea9ad429 --- /dev/null +++ b/tools/lib/filereader.py @@ -0,0 +1,11 @@ +import os +from tools.lib.url_file import URLFile + +DATA_ENDPOINT = os.getenv("DATA_ENDPOINT", "http://data-raw.internal/") + +def FileReader(fn, debug=False): + if fn.startswith("cd:/"): + fn = fn.replace("cd:/", DATA_ENDPOINT) + if fn.startswith("http://") or fn.startswith("https://"): + return URLFile(fn, debug=debug) + return open(fn, "rb") diff --git a/tools/lib/framereader.py b/tools/lib/framereader.py new file mode 100644 index 000000000..bdf48bb43 --- /dev/null +++ b/tools/lib/framereader.py @@ -0,0 +1,581 @@ +# pylint: skip-file +import json +import os +import pickle +import struct +import subprocess +import tempfile +import threading +from enum import IntEnum +from functools import wraps + +import numpy as np +from lru import LRU + +import _io +from tools.lib.cache import cache_path_for_file_path +from tools.lib.exceptions import DataUnreadableError +from common.file_helpers import atomic_write_in_dir + +from tools.lib.filereader import FileReader + +HEVC_SLICE_B = 0 +HEVC_SLICE_P = 1 +HEVC_SLICE_I = 2 + + +class GOPReader: + def get_gop(self, num): + # returns (start_frame_num, num_frames, frames_to_skip, gop_data) + raise NotImplementedError + + +class DoNothingContextManager: + def __enter__(self): + return self + + def __exit__(self, *x): + pass + + +class FrameType(IntEnum): + raw = 1 + h265_stream = 2 + + +def fingerprint_video(fn): + with FileReader(fn) as f: + header = f.read(4) + if len(header) == 0: + raise DataUnreadableError(f"{fn} is empty") + elif header == b"\x00\xc0\x12\x00": + return FrameType.raw + elif header == b"\x00\x00\x00\x01": + if 'hevc' in fn: + return FrameType.h265_stream + else: + raise NotImplementedError(fn) + else: + raise NotImplementedError(fn) + + +def ffprobe(fn, fmt=None): + cmd = ["ffprobe", + "-v", "quiet", + "-print_format", "json", + "-show_format", "-show_streams"] + if fmt: + cmd += ["-f", fmt] + cmd += [fn] + + try: + ffprobe_output = subprocess.check_output(cmd) + except subprocess.CalledProcessError: + raise DataUnreadableError(fn) + + return json.loads(ffprobe_output) + + +def vidindex(fn, typ): + vidindex_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "vidindex") + vidindex = os.path.join(vidindex_dir, "vidindex") + + subprocess.check_call(["make"], cwd=vidindex_dir, stdout=open("/dev/null", "w")) + + with tempfile.NamedTemporaryFile() as prefix_f, \ + tempfile.NamedTemporaryFile() as index_f: + try: + subprocess.check_call([vidindex, typ, fn, prefix_f.name, index_f.name]) + except subprocess.CalledProcessError: + raise DataUnreadableError(f"vidindex failed on file {fn}") + with open(index_f.name, "rb") as f: + index = f.read() + with open(prefix_f.name, "rb") as f: + prefix = f.read() + + index = np.frombuffer(index, np.uint32).reshape(-1, 2) + + assert index[-1, 0] == 0xFFFFFFFF + assert index[-1, 1] == os.path.getsize(fn) + + return index, prefix + + +def cache_fn(func): + @wraps(func) + def cache_inner(fn, *args, **kwargs): + if kwargs.pop('no_cache', None): + cache_path = None + else: + cache_prefix = kwargs.pop('cache_prefix', None) + cache_path = cache_path_for_file_path(fn, cache_prefix) + + if cache_path and os.path.exists(cache_path): + with open(cache_path, "rb") as cache_file: + cache_value = pickle.load(cache_file) + else: + cache_value = func(fn, *args, **kwargs) + + if cache_path: + with atomic_write_in_dir(cache_path, mode="wb", overwrite=True) as cache_file: + pickle.dump(cache_value, cache_file, -1) + + return cache_value + + return cache_inner + + +@cache_fn +def index_stream(fn, typ): + assert typ in ("hevc", ) + + with FileReader(fn) as f: + assert os.path.exists(f.name), fn + index, prefix = vidindex(f.name, typ) + probe = ffprobe(f.name, typ) + + return { + 'index': index, + 'global_prefix': prefix, + 'probe': probe + } + + +def index_videos(camera_paths, cache_prefix=None): + """Requires that paths in camera_paths are contiguous and of the same type.""" + if len(camera_paths) < 1: + raise ValueError("must provide at least one video to index") + + frame_type = fingerprint_video(camera_paths[0]) + for fn in camera_paths: + index_video(fn, frame_type, cache_prefix) + + +def index_video(fn, frame_type=None, cache_prefix=None): + cache_path = cache_path_for_file_path(fn, cache_prefix) + + if os.path.exists(cache_path): + return + + if frame_type is None: + frame_type = fingerprint_video(fn[0]) + + if frame_type == FrameType.h265_stream: + index_stream(fn, "hevc", cache_prefix=cache_prefix) + else: + raise NotImplementedError("Only h265 supported") + + +def get_video_index(fn, frame_type, cache_prefix=None): + cache_path = cache_path_for_file_path(fn, cache_prefix) + + if not os.path.exists(cache_path): + index_video(fn, frame_type, cache_prefix) + + if not os.path.exists(cache_path): + return None + with open(cache_path, "rb") as cache_file: + return pickle.load(cache_file) + + +def read_file_check_size(f, sz, cookie): + buff = bytearray(sz) + bytes_read = f.readinto(buff) + assert bytes_read == sz, (bytes_read, sz) + return buff + + +def rgb24toyuv420(rgb): + yuv_from_rgb = np.array([[ 0.299 , 0.587 , 0.114 ], + [-0.14714119, -0.28886916, 0.43601035 ], + [ 0.61497538, -0.51496512, -0.10001026 ]]) + img = np.dot(rgb.reshape(-1, 3), yuv_from_rgb.T).reshape(rgb.shape) + + y_len = img.shape[0] * img.shape[1] + uv_len = y_len // 4 + + ys = img[:, :, 0] + us = (img[::2, ::2, 1] + img[1::2, ::2, 1] + img[::2, 1::2, 1] + img[1::2, 1::2, 1]) / 4 + 128 + vs = (img[::2, ::2, 2] + img[1::2, ::2, 2] + img[::2, 1::2, 2] + img[1::2, 1::2, 2]) / 4 + 128 + + yuv420 = np.empty(y_len + 2 * uv_len, dtype=img.dtype) + yuv420[:y_len] = ys.reshape(-1) + yuv420[y_len:y_len + uv_len] = us.reshape(-1) + yuv420[y_len + uv_len:y_len + 2 * uv_len] = vs.reshape(-1) + + return yuv420.clip(0, 255).astype('uint8') + + +def decompress_video_data(rawdat, vid_fmt, w, h, pix_fmt): + # using a tempfile is much faster than proc.communicate for some reason + + with tempfile.TemporaryFile() as tmpf: + tmpf.write(rawdat) + tmpf.seek(0) + + threads = os.getenv("FFMPEG_THREADS", "0") + cuda = os.getenv("FFMPEG_CUDA", "0") == "1" + proc = subprocess.Popen( + ["ffmpeg", + "-threads", threads, + "-hwaccel", "none" if not cuda else "cuda", + "-c:v", "hevc", + "-vsync", "0", + "-f", vid_fmt, + "-flags2", "showall", + "-i", "pipe:0", + "-threads", threads, + "-f", "rawvideo", + "-pix_fmt", pix_fmt, + "pipe:1"], + stdin=tmpf, stdout=subprocess.PIPE, stderr=open("/dev/null")) + + # dat = proc.communicate()[0] + dat = proc.stdout.read() + if proc.wait() != 0: + raise DataUnreadableError("ffmpeg failed") + + if pix_fmt == "rgb24": + ret = np.frombuffer(dat, dtype=np.uint8).reshape(-1, h, w, 3) + elif pix_fmt == "yuv420p": + ret = np.frombuffer(dat, dtype=np.uint8).reshape(-1, (h*w*3//2)) + elif pix_fmt == "yuv444p": + ret = np.frombuffer(dat, dtype=np.uint8).reshape(-1, 3, h, w) + else: + raise NotImplementedError + + return ret + + +class BaseFrameReader: + # properties: frame_type, frame_count, w, h + + def __enter__(self): + return self + + def __exit__(self, *args): + self.close() + + def close(self): + pass + + def get(self, num, count=1, pix_fmt="yuv420p"): + raise NotImplementedError + + +def FrameReader(fn, cache_prefix=None, readahead=False, readbehind=False, index_data=None): + frame_type = fingerprint_video(fn) + if frame_type == FrameType.raw: + return RawFrameReader(fn) + elif frame_type in (FrameType.h265_stream,): + if not index_data: + index_data = get_video_index(fn, frame_type, cache_prefix) + return StreamFrameReader(fn, frame_type, index_data, readahead=readahead, readbehind=readbehind) + else: + raise NotImplementedError(frame_type) + + +class RawData: + def __init__(self, f): + self.f = _io.FileIO(f, 'rb') + self.lenn = struct.unpack("I", self.f.read(4))[0] + self.count = os.path.getsize(f) / (self.lenn+4) + + def read(self, i): + self.f.seek((self.lenn+4)*i + 4) + return self.f.read(self.lenn) + + +class RawFrameReader(BaseFrameReader): + def __init__(self, fn): + # raw camera + self.fn = fn + self.frame_type = FrameType.raw + self.rawfile = RawData(self.fn) + self.frame_count = self.rawfile.count + self.w, self.h = 640, 480 + + def load_and_debayer(self, img): + img = np.frombuffer(img, dtype='uint8').reshape(960, 1280) + cimg = np.dstack([img[0::2, 1::2], ((img[0::2, 0::2].astype("uint16") + img[1::2, 1::2].astype("uint16")) >> 1).astype("uint8"), img[1::2, 0::2]]) + return cimg + + def get(self, num, count=1, pix_fmt="yuv420p"): + assert self.frame_count is not None + assert num+count <= self.frame_count + + if pix_fmt not in ("yuv420p", "rgb24"): + raise ValueError(f"Unsupported pixel format {pix_fmt!r}") + + app = [] + for i in range(num, num+count): + dat = self.rawfile.read(i) + rgb_dat = self.load_and_debayer(dat) + if pix_fmt == "rgb24": + app.append(rgb_dat) + elif pix_fmt == "yuv420p": + app.append(rgb24toyuv420(rgb_dat)) + else: + raise NotImplementedError + + return app + + +class VideoStreamDecompressor: + def __init__(self, fn, vid_fmt, w, h, pix_fmt): + self.fn = fn + self.vid_fmt = vid_fmt + self.w = w + self.h = h + self.pix_fmt = pix_fmt + + if pix_fmt == "yuv420p": + self.out_size = w*h*3//2 # yuv420p + elif pix_fmt in ("rgb24", "yuv444p"): + self.out_size = w*h*3 + else: + raise NotImplementedError + + self.proc = None + self.t = threading.Thread(target=self.write_thread) + self.t.daemon = True + + def write_thread(self): + try: + with FileReader(self.fn) as f: + while True: + r = f.read(1024*1024) + if len(r) == 0: + break + self.proc.stdin.write(r) + finally: + self.proc.stdin.close() + + def read(self): + threads = os.getenv("FFMPEG_THREADS", "0") + cuda = os.getenv("FFMPEG_CUDA", "0") == "1" + cmd = [ + "ffmpeg", + "-threads", threads, + "-hwaccel", "none" if not cuda else "cuda", + "-c:v", "hevc", + # "-avioflags", "direct", + "-analyzeduration", "0", + "-probesize", "32", + "-flush_packets", "0", + # "-fflags", "nobuffer", + "-vsync", "0", + "-f", self.vid_fmt, + "-i", "pipe:0", + "-threads", threads, + "-f", "rawvideo", + "-pix_fmt", self.pix_fmt, + "pipe:1" + ] + self.proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) + try: + self.t.start() + + while True: + dat = self.proc.stdout.read(self.out_size) + if len(dat) == 0: + break + assert len(dat) == self.out_size + if self.pix_fmt == "rgb24": + ret = np.frombuffer(dat, dtype=np.uint8).reshape((self.h, self.w, 3)) + elif self.pix_fmt == "yuv420p": + ret = np.frombuffer(dat, dtype=np.uint8) + elif self.pix_fmt == "yuv444p": + ret = np.frombuffer(dat, dtype=np.uint8).reshape((3, self.h, self.w)) + else: + assert False + yield ret + + result_code = self.proc.wait() + assert result_code == 0, result_code + finally: + self.proc.kill() + self.t.join() + +class StreamGOPReader(GOPReader): + def __init__(self, fn, frame_type, index_data): + assert frame_type == FrameType.h265_stream + + self.fn = fn + + self.frame_type = frame_type + self.frame_count = None + self.w, self.h = None, None + + self.prefix = None + self.index = None + + self.index = index_data['index'] + self.prefix = index_data['global_prefix'] + probe = index_data['probe'] + + self.prefix_frame_data = None + self.num_prefix_frames = 0 + self.vid_fmt = "hevc" + + i = 0 + while i < self.index.shape[0] and self.index[i, 0] != HEVC_SLICE_I: + i += 1 + self.first_iframe = i + + assert self.first_iframe == 0 + + self.frame_count = len(self.index) - 1 + + self.w = probe['streams'][0]['width'] + self.h = probe['streams'][0]['height'] + + def _lookup_gop(self, num): + frame_b = num + while frame_b > 0 and self.index[frame_b, 0] != HEVC_SLICE_I: + frame_b -= 1 + + frame_e = num + 1 + while frame_e < (len(self.index) - 1) and self.index[frame_e, 0] != HEVC_SLICE_I: + frame_e += 1 + + offset_b = self.index[frame_b, 1] + offset_e = self.index[frame_e, 1] + + return (frame_b, frame_e, offset_b, offset_e) + + def get_gop(self, num): + frame_b, frame_e, offset_b, offset_e = self._lookup_gop(num) + assert frame_b <= num < frame_e + + num_frames = frame_e - frame_b + + with FileReader(self.fn) as f: + f.seek(offset_b) + rawdat = f.read(offset_e - offset_b) + + if num < self.first_iframe: + assert self.prefix_frame_data + rawdat = self.prefix_frame_data + rawdat + + rawdat = self.prefix + rawdat + + skip_frames = 0 + if num < self.first_iframe: + skip_frames = self.num_prefix_frames + + return frame_b, num_frames, skip_frames, rawdat + + +class GOPFrameReader(BaseFrameReader): + #FrameReader with caching and readahead for formats that are group-of-picture based + + def __init__(self, readahead=False, readbehind=False): + self.open_ = True + + self.readahead = readahead + self.readbehind = readbehind + self.frame_cache = LRU(64) + + if self.readahead: + self.cache_lock = threading.RLock() + self.readahead_last = None + self.readahead_len = 30 + self.readahead_c = threading.Condition() + self.readahead_thread = threading.Thread(target=self._readahead_thread) + self.readahead_thread.daemon = True + self.readahead_thread.start() + else: + self.cache_lock = DoNothingContextManager() + + def close(self): + if not self.open_: + return + self.open_ = False + + if self.readahead: + self.readahead_c.acquire() + self.readahead_c.notify() + self.readahead_c.release() + self.readahead_thread.join() + + def _readahead_thread(self): + while True: + self.readahead_c.acquire() + try: + if not self.open_: + break + self.readahead_c.wait() + finally: + self.readahead_c.release() + if not self.open_: + break + assert self.readahead_last + num, pix_fmt = self.readahead_last + + if self.readbehind: + for k in range(num - 1, max(0, num - self.readahead_len), -1): + self._get_one(k, pix_fmt) + else: + for k in range(num, min(self.frame_count, num + self.readahead_len)): + self._get_one(k, pix_fmt) + + def _get_one(self, num, pix_fmt): + assert num < self.frame_count + + if (num, pix_fmt) in self.frame_cache: + return self.frame_cache[(num, pix_fmt)] + + with self.cache_lock: + if (num, pix_fmt) in self.frame_cache: + return self.frame_cache[(num, pix_fmt)] + + frame_b, num_frames, skip_frames, rawdat = self.get_gop(num) + + ret = decompress_video_data(rawdat, self.vid_fmt, self.w, self.h, pix_fmt) + ret = ret[skip_frames:] + assert ret.shape[0] == num_frames + + for i in range(ret.shape[0]): + self.frame_cache[(frame_b+i, pix_fmt)] = ret[i] + + return self.frame_cache[(num, pix_fmt)] + + def get(self, num, count=1, pix_fmt="yuv420p"): + assert self.frame_count is not None + + if num + count > self.frame_count: + raise ValueError(f"{num + count} > {self.frame_count}") + + if pix_fmt not in ("yuv420p", "rgb24", "yuv444p"): + raise ValueError(f"Unsupported pixel format {pix_fmt!r}") + + ret = [self._get_one(num + i, pix_fmt) for i in range(count)] + + if self.readahead: + self.readahead_last = (num+count, pix_fmt) + self.readahead_c.acquire() + self.readahead_c.notify() + self.readahead_c.release() + + return ret + + +class StreamFrameReader(StreamGOPReader, GOPFrameReader): + def __init__(self, fn, frame_type, index_data, readahead=False, readbehind=False): + StreamGOPReader.__init__(self, fn, frame_type, index_data) + GOPFrameReader.__init__(self, readahead, readbehind) + + +def GOPFrameIterator(gop_reader, pix_fmt): + dec = VideoStreamDecompressor(gop_reader.fn, gop_reader.vid_fmt, gop_reader.w, gop_reader.h, pix_fmt) + yield from dec.read() + + +def FrameIterator(fn, pix_fmt, **kwargs): + fr = FrameReader(fn, **kwargs) + if isinstance(fr, GOPReader): + yield from GOPFrameIterator(fr, pix_fmt) + else: + for i in range(fr.frame_count): + yield fr.get(i, pix_fmt=pix_fmt)[0] diff --git a/tools/lib/helpers.py b/tools/lib/helpers.py new file mode 100644 index 000000000..efe704b9e --- /dev/null +++ b/tools/lib/helpers.py @@ -0,0 +1,20 @@ +import datetime + +TIME_FMT = "%Y-%m-%d--%H-%M-%S" + +# regex patterns +class RE: + DONGLE_ID = r'(?P[a-z0-9]{16})' + TIMESTAMP = r'(?P[0-9]{4}-[0-9]{2}-[0-9]{2}--[0-9]{2}-[0-9]{2}-[0-9]{2})' + ROUTE_NAME = r'{}[|_/]{}'.format(DONGLE_ID, TIMESTAMP) + SEGMENT_NAME = r'{}(?:--|/)(?P[0-9]+)'.format(ROUTE_NAME) + BOOTLOG_NAME = ROUTE_NAME + + EXPLORER_FILE = r'^(?P{})--(?P[a-z]+\.[a-z0-9]+)$'.format(SEGMENT_NAME) + OP_SEGMENT_DIR = r'^(?P{})$'.format(SEGMENT_NAME) + +def timestamp_to_datetime(t: str) -> datetime.datetime: + """ + Convert an openpilot route timestamp to a python datetime + """ + return datetime.datetime.strptime(t, TIME_FMT) diff --git a/tools/lib/kbhit.py b/tools/lib/kbhit.py new file mode 100644 index 000000000..ac048fda9 --- /dev/null +++ b/tools/lib/kbhit.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python +import sys +import termios +import atexit +from select import select + +STDIN_FD = sys.stdin.fileno() + +class KBHit: + def __init__(self) -> None: + ''' Creates a KBHit object that you can call to do various keyboard things. + ''' + + self.set_kbhit_terminal() + + def set_kbhit_terminal(self) -> None: + ''' Save old terminal settings for closure, remove ICANON & ECHO flags. + ''' + + # Save the terminal settings + self.old_term = termios.tcgetattr(STDIN_FD) + self.new_term = self.old_term.copy() + + # New terminal setting unbuffered + self.new_term[3] &= ~(termios.ICANON | termios.ECHO) # type: ignore + termios.tcsetattr(STDIN_FD, termios.TCSAFLUSH, self.new_term) + + # Support normal-terminal reset at exit + atexit.register(self.set_normal_term) + + def set_normal_term(self) -> None: + ''' Resets to normal terminal. On Windows this is a no-op. + ''' + + termios.tcsetattr(STDIN_FD, termios.TCSAFLUSH, self.old_term) + + @staticmethod + def getch() -> str: + ''' Returns a keyboard character after kbhit() has been called. + Should not be called in the same program as getarrow(). + ''' + return sys.stdin.read(1) + + @staticmethod + def getarrow() -> int: + ''' Returns an arrow-key code after kbhit() has been called. Codes are + 0 : up + 1 : right + 2 : down + 3 : left + Should not be called in the same program as getch(). + ''' + + c = sys.stdin.read(3)[2] + vals = [65, 67, 66, 68] + + return vals.index(ord(c)) + + @staticmethod + def kbhit(): + ''' Returns True if keyboard character was hit, False otherwise. + ''' + return select([sys.stdin], [], [], 0)[0] != [] + + +# Test +if __name__ == "__main__": + + kb = KBHit() + + print('Hit any key, or ESC to exit') + + while True: + + if kb.kbhit(): + c = kb.getch() + if c == '\x1b': # ESC + break + print(c) + + kb.set_normal_term() diff --git a/tools/lib/logreader.py b/tools/lib/logreader.py new file mode 100755 index 000000000..c8d506b4b --- /dev/null +++ b/tools/lib/logreader.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python3 +import os +import sys +import bz2 +import urllib.parse +import capnp + +from tools.lib.filereader import FileReader +from cereal import log as capnp_log + +# this is an iterator itself, and uses private variables from LogReader +class MultiLogIterator: + def __init__(self, log_paths, sort_by_time=False): + self._log_paths = log_paths + self.sort_by_time = sort_by_time + + self._first_log_idx = next(i for i in range(len(log_paths)) if log_paths[i] is not None) + self._current_log = self._first_log_idx + self._idx = 0 + self._log_readers = [None]*len(log_paths) + self.start_time = self._log_reader(self._first_log_idx)._ts[0] + + def _log_reader(self, i): + if self._log_readers[i] is None and self._log_paths[i] is not None: + log_path = self._log_paths[i] + self._log_readers[i] = LogReader(log_path, sort_by_time=self.sort_by_time) + + return self._log_readers[i] + + def __iter__(self): + return self + + def _inc(self): + lr = self._log_reader(self._current_log) + if self._idx < len(lr._ents)-1: + self._idx += 1 + else: + self._idx = 0 + self._current_log = next(i for i in range(self._current_log + 1, len(self._log_readers) + 1) + if i == len(self._log_readers) or self._log_paths[i] is not None) + if self._current_log == len(self._log_readers): + raise StopIteration + + def __next__(self): + while 1: + lr = self._log_reader(self._current_log) + ret = lr._ents[self._idx] + self._inc() + return ret + + def tell(self): + # returns seconds from start of log + return (self._log_reader(self._current_log)._ts[self._idx] - self.start_time) * 1e-9 + + def seek(self, ts): + # seek to nearest minute + minute = int(ts/60) + if minute >= len(self._log_paths) or self._log_paths[minute] is None: + return False + + self._current_log = minute + + # HACK: O(n) seek afterward + self._idx = 0 + while self.tell() < ts: + self._inc() + return True + + +class LogReader: + def __init__(self, fn, canonicalize=True, only_union_types=False, sort_by_time=False): + data_version = None + _, ext = os.path.splitext(urllib.parse.urlparse(fn).path) + with FileReader(fn) as f: + dat = f.read() + + if ext == "": + # old rlogs weren't bz2 compressed + ents = capnp_log.Event.read_multiple_bytes(dat) + elif ext == ".bz2": + dat = bz2.decompress(dat) + ents = capnp_log.Event.read_multiple_bytes(dat) + else: + raise Exception(f"unknown extension {ext}") + + self._ents = list(sorted(ents, key=lambda x: x.logMonoTime) if sort_by_time else ents) + self._ts = [x.logMonoTime for x in self._ents] + self.data_version = data_version + self._only_union_types = only_union_types + + def __iter__(self): + for ent in self._ents: + if self._only_union_types: + try: + ent.which() + yield ent + except capnp.lib.capnp.KjException: + pass + else: + yield ent + +if __name__ == "__main__": + import codecs + # capnproto <= 0.8.0 throws errors converting byte data to string + # below line catches those errors and replaces the bytes with \x__ + codecs.register_error("strict", codecs.backslashreplace_errors) + log_path = sys.argv[1] + lr = LogReader(log_path, sort_by_time=True) + for msg in lr: + print(msg) diff --git a/tools/lib/robust_logreader.py b/tools/lib/robust_logreader.py new file mode 100755 index 000000000..c7feb6c3e --- /dev/null +++ b/tools/lib/robust_logreader.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 +import os +import bz2 +import urllib.parse +import subprocess +import tqdm +import glob +from tempfile import TemporaryDirectory +import capnp + +from tools.lib.logreader import FileReader, LogReader +from cereal import log as capnp_log + + +class RobustLogReader(LogReader): + def __init__(self, fn, canonicalize=True, only_union_types=False, sort_by_time=False): # pylint: disable=super-init-not-called + data_version = None + _, ext = os.path.splitext(urllib.parse.urlparse(fn).path) + with FileReader(fn) as f: + dat = f.read() + + if ext == "": + pass + elif ext == ".bz2": + try: + dat = bz2.decompress(dat) + except ValueError: + print("Failed to decompress, falling back to bzip2recover") + with TemporaryDirectory() as directory: + # Run bzip2recovery on log + with open(os.path.join(directory, 'out.bz2'), 'wb') as f: + f.write(dat) + subprocess.check_call(["bzip2recover", "out.bz2"], cwd=directory) + + # Decompress and concatenate parts + dat = b"" + for n in sorted(glob.glob(f"{directory}/rec*.bz2")): + print(f"Decompressing {n}") + with open(n, 'rb') as f: + dat += bz2.decompress(f.read()) + else: + raise Exception(f"unknown extension {ext}") + + progress = None + while True: + try: + ents = capnp_log.Event.read_multiple_bytes(dat) + self._ents = list(sorted(ents, key=lambda x: x.logMonoTime) if sort_by_time else ents) + break + except capnp.lib.capnp.KjException: + if progress is None: + progress = tqdm.tqdm(total=len(dat)) + + # Cut off bytes at the end until capnp is able to read + dat = dat[:-1] + progress.update(1) + + self._ts = [x.logMonoTime for x in self._ents] + self.data_version = data_version + self._only_union_types = only_union_types diff --git a/tools/lib/route.py b/tools/lib/route.py new file mode 100644 index 000000000..8092096a0 --- /dev/null +++ b/tools/lib/route.py @@ -0,0 +1,223 @@ +import os +import re +from urllib.parse import urlparse +from collections import defaultdict +from itertools import chain + +from tools.lib.auth_config import get_token +from tools.lib.api import CommaApi +from tools.lib.helpers import RE + +QLOG_FILENAMES = ['qlog.bz2'] +QCAMERA_FILENAMES = ['qcamera.ts'] +LOG_FILENAMES = ['rlog.bz2', 'raw_log.bz2'] +CAMERA_FILENAMES = ['fcamera.hevc', 'video.hevc'] +DCAMERA_FILENAMES = ['dcamera.hevc'] +ECAMERA_FILENAMES = ['ecamera.hevc'] + +class Route: + def __init__(self, name, data_dir=None): + self._name = RouteName(name) + self.files = None + if data_dir is not None: + self._segments = self._get_segments_local(data_dir) + else: + self._segments = self._get_segments_remote() + self.max_seg_number = self._segments[-1].name.segment_num + + @property + def name(self): + return self._name + + @property + def segments(self): + return self._segments + + def log_paths(self): + log_path_by_seg_num = {s.name.segment_num: s.log_path for s in self._segments} + return [log_path_by_seg_num.get(i, None) for i in range(self.max_seg_number+1)] + + def qlog_paths(self): + qlog_path_by_seg_num = {s.name.segment_num: s.qlog_path for s in self._segments} + return [qlog_path_by_seg_num.get(i, None) for i in range(self.max_seg_number+1)] + + def camera_paths(self): + camera_path_by_seg_num = {s.name.segment_num: s.camera_path for s in self._segments} + return [camera_path_by_seg_num.get(i, None) for i in range(self.max_seg_number+1)] + + def dcamera_paths(self): + dcamera_path_by_seg_num = {s.name.segment_num: s.dcamera_path for s in self._segments} + return [dcamera_path_by_seg_num.get(i, None) for i in range(self.max_seg_number+1)] + + def ecamera_paths(self): + ecamera_path_by_seg_num = {s.name.segment_num: s.ecamera_path for s in self._segments} + return [ecamera_path_by_seg_num.get(i, None) for i in range(self.max_seg_number+1)] + + def qcamera_paths(self): + qcamera_path_by_seg_num = {s.name.segment_num: s.qcamera_path for s in self._segments} + return [qcamera_path_by_seg_num.get(i, None) for i in range(self.max_seg_number+1)] + + # TODO: refactor this, it's super repetitive + def _get_segments_remote(self): + api = CommaApi(get_token()) + route_files = api.get('v1/route/' + self.name.canonical_name + '/files') + self.files = list(chain.from_iterable(route_files.values())) + + segments = {} + for url in self.files: + _, dongle_id, time_str, segment_num, fn = urlparse(url).path.rsplit('/', maxsplit=4) + segment_name = f'{dongle_id}|{time_str}--{segment_num}' + if segments.get(segment_name): + segments[segment_name] = Segment( + segment_name, + url if fn in LOG_FILENAMES else segments[segment_name].log_path, + url if fn in QLOG_FILENAMES else segments[segment_name].qlog_path, + url if fn in CAMERA_FILENAMES else segments[segment_name].camera_path, + url if fn in DCAMERA_FILENAMES else segments[segment_name].dcamera_path, + url if fn in ECAMERA_FILENAMES else segments[segment_name].ecamera_path, + url if fn in QCAMERA_FILENAMES else segments[segment_name].qcamera_path, + ) + else: + segments[segment_name] = Segment( + segment_name, + url if fn in LOG_FILENAMES else None, + url if fn in QLOG_FILENAMES else None, + url if fn in CAMERA_FILENAMES else None, + url if fn in DCAMERA_FILENAMES else None, + url if fn in ECAMERA_FILENAMES else None, + url if fn in QCAMERA_FILENAMES else None, + ) + + return sorted(segments.values(), key=lambda seg: seg.name.segment_num) + + def _get_segments_local(self, data_dir): + files = os.listdir(data_dir) + segment_files = defaultdict(list) + + for f in files: + fullpath = os.path.join(data_dir, f) + explorer_match = re.match(RE.EXPLORER_FILE, f) + op_match = re.match(RE.OP_SEGMENT_DIR, f) + + if explorer_match: + segment_name = explorer_match.group('segment_name') + fn = explorer_match.group('file_name') + if segment_name.replace('_', '|').startswith(self.name.canonical_name): + segment_files[segment_name].append((fullpath, fn)) + elif op_match and os.path.isdir(fullpath): + segment_name = op_match.group('segment_name') + if segment_name.startswith(self.name.canonical_name): + for seg_f in os.listdir(fullpath): + segment_files[segment_name].append((os.path.join(fullpath, seg_f), seg_f)) + elif f == self.name.canonical_name: + for seg_num in os.listdir(fullpath): + if not seg_num.isdigit(): + continue + + segment_name = f'{self.name.canonical_name}--{seg_num}' + for seg_f in os.listdir(os.path.join(fullpath, seg_num)): + segment_files[segment_name].append((os.path.join(fullpath, seg_num, seg_f), seg_f)) + + segments = [] + for segment, files in segment_files.items(): + + try: + log_path = next(path for path, filename in files if filename in LOG_FILENAMES) + except StopIteration: + log_path = None + + try: + qlog_path = next(path for path, filename in files if filename in QLOG_FILENAMES) + except StopIteration: + qlog_path = None + + try: + camera_path = next(path for path, filename in files if filename in CAMERA_FILENAMES) + except StopIteration: + camera_path = None + + try: + dcamera_path = next(path for path, filename in files if filename in DCAMERA_FILENAMES) + except StopIteration: + dcamera_path = None + + try: + ecamera_path = next(path for path, filename in files if filename in ECAMERA_FILENAMES) + except StopIteration: + ecamera_path = None + + try: + qcamera_path = next(path for path, filename in files if filename in QCAMERA_FILENAMES) + except StopIteration: + qcamera_path = None + + segments.append(Segment(segment, log_path, qlog_path, camera_path, dcamera_path, ecamera_path, qcamera_path)) + + if len(segments) == 0: + raise ValueError(f'Could not find segments for route {self.name.canonical_name} in data directory {data_dir}') + return sorted(segments, key=lambda seg: seg.name.segment_num) + +class Segment: + def __init__(self, name, log_path, qlog_path, camera_path, dcamera_path, ecamera_path, qcamera_path): + self._name = SegmentName(name) + self.log_path = log_path + self.qlog_path = qlog_path + self.camera_path = camera_path + self.dcamera_path = dcamera_path + self.ecamera_path = ecamera_path + self.qcamera_path = qcamera_path + + @property + def name(self): + return self._name + +class RouteName: + def __init__(self, name_str: str): + self._name_str = name_str + delim = next(c for c in self._name_str if c in ("|", "/")) + self._dongle_id, self._time_str = self._name_str.split(delim) + + assert len(self._dongle_id) == 16, self._name_str + assert len(self._time_str) == 20, self._name_str + self._canonical_name = f"{self._dongle_id}|{self._time_str}" + + @property + def canonical_name(self) -> str: return self._canonical_name + + @property + def dongle_id(self) -> str: return self._dongle_id + + @property + def time_str(self) -> str: return self._time_str + + def __str__(self) -> str: return self._canonical_name + +class SegmentName: + # TODO: add constructor that takes dongle_id, time_str, segment_num and then create instances + # of this class instead of manually constructing a segment name (use canonical_name prop instead) + def __init__(self, name_str: str, allow_route_name=False): + self._name_str = name_str + seg_num_delim = "--" if self._name_str.count("--") == 2 else "/" + name_parts = self._name_str.rsplit(seg_num_delim, 1) + if allow_route_name and len(name_parts) == 1: + name_parts.append("-1") # no segment number + self._route_name = RouteName(name_parts[0]) + self._num = int(name_parts[1]) + self._canonical_name = f"{self._route_name._dongle_id}|{self._route_name._time_str}--{self._num}" + + @property + def canonical_name(self) -> str: return self._canonical_name + + @property + def dongle_id(self) -> str: return self._route_name.dongle_id + + @property + def time_str(self) -> str: return self._route_name.time_str + + @property + def segment_num(self) -> int: return self._num + + @property + def route_name(self) -> RouteName: return self._route_name + + def __str__(self) -> str: return self._canonical_name diff --git a/tools/lib/tests/__init__.py b/tools/lib/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tools/lib/tests/test_caching.py b/tools/lib/tests/test_caching.py new file mode 100644 index 000000000..953b47e95 --- /dev/null +++ b/tools/lib/tests/test_caching.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 +import os +import shutil +import unittest + +os.environ["COMMA_CACHE"] = "/tmp/__test_cache__" +from tools.lib.url_file import URLFile, CACHE_DIR + + +class TestFileDownload(unittest.TestCase): + + def compare_loads(self, url, start=0, length=None): + """Compares range between cached and non cached version""" + shutil.rmtree(CACHE_DIR) + + file_cached = URLFile(url, cache=True) + file_downloaded = URLFile(url, cache=False) + + file_cached.seek(start) + file_downloaded.seek(start) + + self.assertEqual(file_cached.get_length(), file_downloaded.get_length()) + self.assertLessEqual(length + start if length is not None else 0, file_downloaded.get_length()) + + response_cached = file_cached.read(ll=length) + response_downloaded = file_downloaded.read(ll=length) + + self.assertEqual(response_cached, response_downloaded) + + # Now test with cache in place + file_cached = URLFile(url, cache=True) + file_cached.seek(start) + response_cached = file_cached.read(ll=length) + + self.assertEqual(file_cached.get_length(), file_downloaded.get_length()) + self.assertEqual(response_cached, response_downloaded) + + def test_small_file(self): + # Make sure we don't force cache + os.environ["FILEREADER_CACHE"] = "0" + small_file_url = "https://raw.githubusercontent.com/commaai/openpilot/master/docs/SAFETY.md" + # If you want large file to be larger than a chunk + # large_file_url = "https://commadataci.blob.core.windows.net/openpilotci/0375fdf7b1ce594d/2019-06-13--08-32-25/3/fcamera.hevc" + + # Load full small file + self.compare_loads(small_file_url) + + file_small = URLFile(small_file_url) + length = file_small.get_length() + + self.compare_loads(small_file_url, length - 100, 100) + self.compare_loads(small_file_url, 50, 100) + + # Load small file 100 bytes at a time + for i in range(length // 100): + self.compare_loads(small_file_url, 100 * i, 100) + + def test_large_file(self): + large_file_url = "https://commadataci.blob.core.windows.net/openpilotci/0375fdf7b1ce594d/2019-06-13--08-32-25/3/qlog.bz2" + # Load the end 100 bytes of both files + file_large = URLFile(large_file_url) + length = file_large.get_length() + + self.compare_loads(large_file_url, length - 100, 100) + self.compare_loads(large_file_url) + + +if __name__ == "__main__": + unittest.main() diff --git a/tools/lib/tests/test_readers.py b/tools/lib/tests/test_readers.py new file mode 100755 index 000000000..1d8918ba5 --- /dev/null +++ b/tools/lib/tests/test_readers.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +import unittest +import requests +import tempfile + +from collections import defaultdict +import numpy as np +from tools.lib.framereader import FrameReader +from tools.lib.logreader import LogReader + + +class TestReaders(unittest.TestCase): + @unittest.skip("skip for bandwith reasons") + def test_logreader(self): + def _check_data(lr): + hist = defaultdict(int) + for l in lr: + hist[l.which()] += 1 + + self.assertEqual(hist['carControl'], 6000) + self.assertEqual(hist['logMessage'], 6857) + + with tempfile.NamedTemporaryFile(suffix=".bz2") as fp: + r = requests.get("https://github.com/commaai/comma2k19/blob/master/Example_1/b0c9d2329ad1606b%7C2018-08-02--08-34-47/40/raw_log.bz2?raw=true") + fp.write(r.content) + fp.flush() + + lr_file = LogReader(fp.name) + _check_data(lr_file) + + lr_url = LogReader("https://github.com/commaai/comma2k19/blob/master/Example_1/b0c9d2329ad1606b%7C2018-08-02--08-34-47/40/raw_log.bz2?raw=true") + _check_data(lr_url) + + @unittest.skip("skip for bandwith reasons") + def test_framereader(self): + def _check_data(f): + self.assertEqual(f.frame_count, 1200) + self.assertEqual(f.w, 1164) + self.assertEqual(f.h, 874) + + frame_first_30 = f.get(0, 30) + self.assertEqual(len(frame_first_30), 30) + + print(frame_first_30[15]) + + print("frame_0") + frame_0 = f.get(0, 1) + frame_15 = f.get(15, 1) + + print(frame_15[0]) + + assert np.all(frame_first_30[0] == frame_0[0]) + assert np.all(frame_first_30[15] == frame_15[0]) + + with tempfile.NamedTemporaryFile(suffix=".hevc") as fp: + r = requests.get("https://github.com/commaai/comma2k19/blob/master/Example_1/b0c9d2329ad1606b%7C2018-08-02--08-34-47/40/video.hevc?raw=true") + fp.write(r.content) + fp.flush() + + fr_file = FrameReader(fp.name) + _check_data(fr_file) + + fr_url = FrameReader("https://github.com/commaai/comma2k19/blob/master/Example_1/b0c9d2329ad1606b%7C2018-08-02--08-34-47/40/video.hevc?raw=true") + _check_data(fr_url) + +if __name__ == "__main__": + unittest.main() diff --git a/tools/lib/url_file.py b/tools/lib/url_file.py new file mode 100644 index 000000000..8ad2f96b3 --- /dev/null +++ b/tools/lib/url_file.py @@ -0,0 +1,198 @@ +# pylint: skip-file + +import os +import time +import tempfile +import threading +import urllib.parse +import pycurl +from hashlib import sha256 +from io import BytesIO +from tenacity import retry, wait_random_exponential, stop_after_attempt +from common.file_helpers import mkdirs_exists_ok, atomic_write_in_dir +# Cache chunk size +K = 1000 +CHUNK_SIZE = 1000 * K + +CACHE_DIR = os.environ.get("COMMA_CACHE", "/tmp/comma_download_cache/") + + +def hash_256(link): + hsh = str(sha256((link.split("?")[0]).encode('utf-8')).hexdigest()) + return hsh + + +class URLFile: + _tlocal = threading.local() + + def __init__(self, url, debug=False, cache=None): + self._url = url + self._pos = 0 + self._length = None + self._local_file = None + self._debug = debug + # True by default, false if FILEREADER_CACHE is defined, but can be overwritten by the cache input + self._force_download = not int(os.environ.get("FILEREADER_CACHE", "0")) + if cache is not None: + self._force_download = not cache + + try: + self._curl = self._tlocal.curl + except AttributeError: + self._curl = self._tlocal.curl = pycurl.Curl() + mkdirs_exists_ok(CACHE_DIR) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + if self._local_file is not None: + os.remove(self._local_file.name) + self._local_file.close() + self._local_file = None + + @retry(wait=wait_random_exponential(multiplier=1, max=5), stop=stop_after_attempt(3), reraise=True) + def get_length_online(self): + c = self._curl + c.reset() + c.setopt(pycurl.NOSIGNAL, 1) + c.setopt(pycurl.TIMEOUT_MS, 500000) + c.setopt(pycurl.FOLLOWLOCATION, True) + c.setopt(pycurl.URL, self._url) + c.setopt(c.NOBODY, 1) + c.perform() + length = int(c.getinfo(c.CONTENT_LENGTH_DOWNLOAD)) + c.reset() + return length + + def get_length(self): + if self._length is not None: + return self._length + file_length_path = os.path.join(CACHE_DIR, hash_256(self._url) + "_length") + if os.path.exists(file_length_path) and not self._force_download: + with open(file_length_path) as file_length: + content = file_length.read() + self._length = int(content) + return self._length + + self._length = self.get_length_online() + if not self._force_download: + with atomic_write_in_dir(file_length_path, mode="w") as file_length: + file_length.write(str(self._length)) + return self._length + + def read(self, ll=None): + if self._force_download: + return self.read_aux(ll=ll) + + file_begin = self._pos + file_end = self._pos + ll if ll is not None else self.get_length() + # We have to align with chunks we store. Position is the begginiing of the latest chunk that starts before or at our file + position = (file_begin // CHUNK_SIZE) * CHUNK_SIZE + response = b"" + while True: + self._pos = position + chunk_number = self._pos / CHUNK_SIZE + file_name = hash_256(self._url) + "_" + str(chunk_number) + full_path = os.path.join(CACHE_DIR, str(file_name)) + data = None + # If we don't have a file, download it + if not os.path.exists(full_path): + data = self.read_aux(ll=CHUNK_SIZE) + with atomic_write_in_dir(full_path, mode="wb") as new_cached_file: + new_cached_file.write(data) + else: + with open(full_path, "rb") as cached_file: + data = cached_file.read() + + response += data[max(0, file_begin - position): min(CHUNK_SIZE, file_end - position)] + + position += CHUNK_SIZE + if position >= file_end: + self._pos = file_end + return response + + @retry(wait=wait_random_exponential(multiplier=1, max=5), stop=stop_after_attempt(3), reraise=True) + def read_aux(self, ll=None): + download_range = False + headers = ["Connection: keep-alive"] + if self._pos != 0 or ll is not None: + if ll is None: + end = self.get_length() - 1 + else: + end = min(self._pos + ll, self.get_length()) - 1 + if self._pos >= end: + return b"" + headers.append(f"Range: bytes={self._pos}-{end}") + download_range = True + + dats = BytesIO() + c = self._curl + c.setopt(pycurl.URL, self._url) + c.setopt(pycurl.WRITEDATA, dats) + c.setopt(pycurl.NOSIGNAL, 1) + c.setopt(pycurl.TIMEOUT_MS, 500000) + c.setopt(pycurl.HTTPHEADER, headers) + c.setopt(pycurl.FOLLOWLOCATION, True) + + if self._debug: + print("downloading", self._url) + + def header(x): + if b'MISS' in x: + print(x.strip()) + + c.setopt(pycurl.HEADERFUNCTION, header) + + def test(debug_type, debug_msg): + print(" debug(%d): %s" % (debug_type, debug_msg.strip())) + + c.setopt(pycurl.VERBOSE, 1) + c.setopt(pycurl.DEBUGFUNCTION, test) + t1 = time.time() + + c.perform() + + if self._debug: + t2 = time.time() + if t2 - t1 > 0.1: + print(f"get {self._url} {headers!r} {t2 - t1:.f} slow") + + response_code = c.getinfo(pycurl.RESPONSE_CODE) + if response_code == 416: # Requested Range Not Satisfiable + raise Exception(f"Error, range out of bounds {response_code} {headers} ({self._url}): {repr(dats.getvalue())[:500]}") + if download_range and response_code != 206: # Partial Content + raise Exception(f"Error, requested range but got unexpected response {response_code} {headers} ({self._url}): {repr(dats.getvalue())[:500]}") + if (not download_range) and response_code != 200: # OK + raise Exception(f"Error {response_code} {headers} ({self._url}): {repr(dats.getvalue())[:500]}") + + ret = dats.getvalue() + self._pos += len(ret) + return ret + + def seek(self, pos): + self._pos = pos + + @property + def name(self): + """Returns a local path to file with the URLFile's contents. + + This can be used to interface with modules that require local files. + """ + if self._local_file is None: + _, ext = os.path.splitext(urllib.parse.urlparse(self._url).path) + local_fd, local_path = tempfile.mkstemp(suffix=ext) + try: + os.write(local_fd, self.read()) + local_file = open(local_path, "rb") + except Exception: + os.remove(local_path) + raise + finally: + os.close(local_fd) + + self._local_file = local_file + self.read = self._local_file.read + self.seek = self._local_file.seek + + return self._local_file.name diff --git a/tools/lib/vidindex/.gitignore b/tools/lib/vidindex/.gitignore new file mode 100644 index 000000000..a77a06e97 --- /dev/null +++ b/tools/lib/vidindex/.gitignore @@ -0,0 +1 @@ +vidindex diff --git a/tools/lib/vidindex/Makefile b/tools/lib/vidindex/Makefile new file mode 100644 index 000000000..f6526db21 --- /dev/null +++ b/tools/lib/vidindex/Makefile @@ -0,0 +1,6 @@ +CC := gcc + +vidindex: bitstream.c bitstream.h vidindex.c + $(eval $@_TMP := $(shell mktemp)) + $(CC) -std=c99 bitstream.c vidindex.c -o $($@_TMP) + mv $($@_TMP) $@ diff --git a/tools/lib/vidindex/bitstream.c b/tools/lib/vidindex/bitstream.c new file mode 100644 index 000000000..d174ffa8a --- /dev/null +++ b/tools/lib/vidindex/bitstream.c @@ -0,0 +1,118 @@ +#include +#include + +#include "bitstream.h" + +static const uint32_t BS_MASKS[33] = { + 0, 0x1L, 0x3L, 0x7L, 0xFL, 0x1FL, + 0x3FL, 0x7FL, 0xFFL, 0x1FFL, 0x3FFL, 0x7FFL, + 0xFFFL, 0x1FFFL, 0x3FFFL, 0x7FFFL, 0xFFFFL, 0x1FFFFL, + 0x3FFFFL, 0x7FFFFL, 0xFFFFFL, 0x1FFFFFL, 0x3FFFFFL, 0x7FFFFFL, + 0xFFFFFFL, 0x1FFFFFFL, 0x3FFFFFFL, 0x7FFFFFFL, 0xFFFFFFFL, 0x1FFFFFFFL, + 0x3FFFFFFFL, 0x7FFFFFFFL, 0xFFFFFFFFL}; + +void bs_init(struct bitstream* bs, const uint8_t* buffer, size_t input_size) { + bs->buffer_ptr = buffer; + bs->buffer_end = buffer + input_size; + bs->value = 0; + bs->pos = 0; + bs->shift = 8; + bs->size = input_size * 8; +} + +uint32_t bs_get(struct bitstream* bs, int n) { + if (n > 32) + return 0; + + bs->pos += n; + bs->shift += n; + while (bs->shift > 8) { + if (bs->buffer_ptr < bs->buffer_end) { + bs->value <<= 8; + bs->value |= *bs->buffer_ptr++; + bs->shift -= 8; + } else { + bs_seek(bs, bs->pos - n); + return 0; + // bs->value <<= 8; + // bs->shift -= 8; + } + } + return (bs->value >> (8 - bs->shift)) & BS_MASKS[n]; +} + +void bs_seek(struct bitstream* bs, size_t new_pos) { + bs->pos = (new_pos / 32) * 32; + bs->shift = 8; + bs->value = 0; + bs_get(bs, new_pos % 32); +} + +uint32_t bs_peek(struct bitstream* bs, int n) { + struct bitstream bak = *bs; + return bs_get(&bak, n); +} + +size_t bs_remain(struct bitstream* bs) { + return bs->size - bs->pos; +} + +int bs_eof(struct bitstream* bs) { + return bs_remain(bs) == 0; +} + +uint32_t bs_ue(struct bitstream* bs) { + static const uint8_t exp_golomb_bits[256] = { + 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + uint32_t bits, read = 0; + int bits_left; + uint8_t coded; + int done = 0; + bits = 0; + // we want to read 8 bits at a time - if we don't have 8 bits, + // read what's left, and shift. The exp_golomb_bits calc remains the + // same. + while (!done) { + bits_left = bs_remain(bs); + if (bits_left < 8) { + read = bs_peek(bs, bits_left) << (8 - bits_left); + done = 1; + } else { + read = bs_peek(bs, 8); + if (read == 0) { + bs_get(bs, 8); + bits += 8; + } else { + done = 1; + } + } + } + coded = exp_golomb_bits[read]; + bs_get(bs, coded); + bits += coded; + + // printf("ue - bits %d\n", bits); + return bs_get(bs, bits + 1) - 1; +} + +int32_t bs_se(struct bitstream* bs) { + uint32_t ret; + ret = bs_ue(bs); + if ((ret & 0x1) == 0) { + ret >>= 1; + int32_t temp = 0 - ret; + return temp; + } + return (ret + 1) >> 1; +} diff --git a/tools/lib/vidindex/bitstream.h b/tools/lib/vidindex/bitstream.h new file mode 100644 index 000000000..0f538a59a --- /dev/null +++ b/tools/lib/vidindex/bitstream.h @@ -0,0 +1,26 @@ +#ifndef bitstream_H +#define bitstream_H + + +#include +#include + +struct bitstream { + const uint8_t *buffer_ptr; + const uint8_t *buffer_end; + uint64_t value; + uint32_t pos; + uint32_t shift; + size_t size; +}; + +void bs_init(struct bitstream *bs, const uint8_t *buffer, size_t input_size); +void bs_seek(struct bitstream *bs, size_t new_pos); +uint32_t bs_get(struct bitstream *bs, int n); +uint32_t bs_peek(struct bitstream *bs, int n); +size_t bs_remain(struct bitstream *bs); +int bs_eof(struct bitstream *bs); +uint32_t bs_ue(struct bitstream *bs); +int32_t bs_se(struct bitstream *bs); + +#endif diff --git a/tools/lib/vidindex/vidindex.c b/tools/lib/vidindex/vidindex.c new file mode 100644 index 000000000..4857c60dd --- /dev/null +++ b/tools/lib/vidindex/vidindex.c @@ -0,0 +1,307 @@ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "bitstream.h" + +#define START_CODE 0x000001 + +static uint32_t read24be(const uint8_t* ptr) { + return (ptr[0] << 16) | (ptr[1] << 8) | ptr[2]; +} +static void write32le(FILE *of, uint32_t v) { + uint8_t va[4] = { + v & 0xff, (v >> 8) & 0xff, (v >> 16) & 0xff, (v >> 24) & 0xff + }; + fwrite(va, 1, sizeof(va), of); +} + +// Table 7-1 +enum hevc_nal_type { + HEVC_NAL_TYPE_TRAIL_N = 0, + HEVC_NAL_TYPE_TRAIL_R = 1, + HEVC_NAL_TYPE_TSA_N = 2, + HEVC_NAL_TYPE_TSA_R = 3, + HEVC_NAL_TYPE_STSA_N = 4, + HEVC_NAL_TYPE_STSA_R = 5, + HEVC_NAL_TYPE_RADL_N = 6, + HEVC_NAL_TYPE_RADL_R = 7, + HEVC_NAL_TYPE_RASL_N = 8, + HEVC_NAL_TYPE_RASL_R = 9, + HEVC_NAL_TYPE_BLA_W_LP = 16, + HEVC_NAL_TYPE_BLA_W_RADL = 17, + HEVC_NAL_TYPE_BLA_N_LP = 18, + HEVC_NAL_TYPE_IDR_W_RADL = 19, + HEVC_NAL_TYPE_IDR_N_LP = 20, + HEVC_NAL_TYPE_CRA_NUT = 21, + HEVC_NAL_TYPE_RSV_IRAP_VCL23 = 23, + HEVC_NAL_TYPE_VPS_NUT = 32, + HEVC_NAL_TYPE_SPS_NUT = 33, + HEVC_NAL_TYPE_PPS_NUT = 34, + HEVC_NAL_TYPE_AUD_NUT = 35, + HEVC_NAL_TYPE_EOS_NUT = 36, + HEVC_NAL_TYPE_EOB_NUT = 37, + HEVC_NAL_TYPE_FD_NUT = 38, + HEVC_NAL_TYPE_PREFIX_SEI_NUT = 39, + HEVC_NAL_TYPE_SUFFIX_SEI_NUT = 40, +}; + +// Table 7-7 +enum hevc_slice_type { + HEVC_SLICE_B = 0, + HEVC_SLICE_P = 1, + HEVC_SLICE_I = 2, +}; + +static void hevc_index(const uint8_t *data, size_t file_size, FILE *of_prefix, FILE *of_index) { + const uint8_t* ptr = data; + const uint8_t* ptr_end = data + file_size; + + assert(ptr[0] == 0); + ptr++; + assert(read24be(ptr) == START_CODE); + + // pps. ignore for now + uint32_t num_extra_slice_header_bits = 0; + uint32_t dependent_slice_segments_enabled_flag = 0; + + while (ptr < ptr_end) { + const uint8_t* next = ptr+1; + for (; next < ptr_end-4; next++) { + if (read24be(next) == START_CODE) break; + } + size_t nal_size = next - ptr; + if (nal_size < 6) { + break; + } + + { + struct bitstream bs = {0}; + bs_init(&bs, ptr, nal_size); + + uint32_t start_code = bs_get(&bs, 24); + assert(start_code == 0x000001); + + // nal_unit_header + uint32_t forbidden_zero_bit = bs_get(&bs, 1); + uint32_t nal_unit_type = bs_get(&bs, 6); + uint32_t nuh_layer_id = bs_get(&bs, 6); + uint32_t nuh_temporal_id_plus1 = bs_get(&bs, 3); + + // if (nal_unit_type != 1) printf("%3d -- %3d %10d %lu\n", nal_unit_type, frame_num, (uint32_t)(ptr-data), nal_size); + + switch (nal_unit_type) { + case HEVC_NAL_TYPE_VPS_NUT: + case HEVC_NAL_TYPE_SPS_NUT: + case HEVC_NAL_TYPE_PPS_NUT: + fwrite(ptr, 1, nal_size, of_prefix); + break; + case HEVC_NAL_TYPE_TRAIL_N: + case HEVC_NAL_TYPE_TRAIL_R: + case HEVC_NAL_TYPE_TSA_N: + case HEVC_NAL_TYPE_TSA_R: + case HEVC_NAL_TYPE_STSA_N: + case HEVC_NAL_TYPE_STSA_R: + case HEVC_NAL_TYPE_RADL_N: + case HEVC_NAL_TYPE_RADL_R: + case HEVC_NAL_TYPE_RASL_N: + case HEVC_NAL_TYPE_RASL_R: + case HEVC_NAL_TYPE_BLA_W_LP: + case HEVC_NAL_TYPE_BLA_W_RADL: + case HEVC_NAL_TYPE_BLA_N_LP: + case HEVC_NAL_TYPE_IDR_W_RADL: + case HEVC_NAL_TYPE_IDR_N_LP: + case HEVC_NAL_TYPE_CRA_NUT: { + // slice_segment_header + uint32_t first_slice_segment_in_pic_flag = bs_get(&bs, 1); + if (nal_unit_type >= HEVC_NAL_TYPE_BLA_W_LP && nal_unit_type <= HEVC_NAL_TYPE_RSV_IRAP_VCL23) { + uint32_t no_output_of_prior_pics_flag = bs_get(&bs, 1); + } + uint32_t slice_pic_parameter_set_id = bs_get(&bs, 1); + if (!first_slice_segment_in_pic_flag) { + // ... + break; + } + + if (!dependent_slice_segments_enabled_flag) { + for (int i=0; i 4); + + const uint8_t* data = (const uint8_t*)mmap(NULL, file_size, PROT_READ, MAP_PRIVATE, fd, 0); + assert(data != MAP_FAILED); + + if (strcmp(file_type, "hevc") == 0) { + hevc_index(data, file_size, of_prefix, of_index); + } else if (strcmp(file_type, "h264") == 0) { + h264_index(data, file_size, of_prefix, of_index); + } else { + assert(false); + } + + munmap((void*)data, file_size); + close(fd); + + return 0; +}